From: support Date: Thu, 17 Nov 2022 16:02:24 +0000 (+0000) Subject: Built motion from commit b3fbe50d.|2.6.22 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=d97d364f73c5a055b8fa78aafb639bfd248ae05a;p=motion2.git Built motion from commit b3fbe50d.|2.6.22 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 23e02ce..663bcbe 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-11-17T15:41:32.333Z", + "time": "2022-11-17T15:54:00.957Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 1318184..5e70dd9 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-17T15:41:32.333Z", + "time": "2022-11-17T15:54:00.957Z", "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 af832c4..f0b2a8d 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 _0xeb5d=['urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar'];(function(_0x26601e,_0x139a4c){var _0x116282=function(_0x292edb){while(--_0x292edb){_0x26601e['push'](_0x26601e['shift']());}};_0x116282(++_0x139a4c);}(_0xeb5d,0x174));var _0xdeb5=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xeb5d[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xdeb5('0x0'));module[_0xdeb5('0x1')]={'name':{'type':Sequelize[_0xdeb5('0x2')],'get':function(_0x195e73){return this[_0xdeb5('0x3')]('action');}},'action':{'type':Sequelize[_0xdeb5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdeb5('0x5'),_0xdeb5('0x6'),_0xdeb5('0x7'),'jscripty',_0xdeb5('0x8'),'browser',_0xdeb5('0x9'),_0xdeb5('0xa')]],'msg':_0xdeb5('0xb')}},'comment':_0xdeb5('0xb')},'data1':{'type':Sequelize['STRING'](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[_0xdeb5('0x4')](0x1000),'comment':_0xdeb5('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xdeb5('0xd')},'data4':{'type':Sequelize[_0xdeb5('0x4')](0x1000),'comments':_0xdeb5('0xe')},'data5':{'type':Sequelize[_0xdeb5('0x4')](0x1000),'comments':_0xdeb5('0xf')},'data6':{'type':Sequelize[_0xdeb5('0x4')],'comments':_0xdeb5('0x10')},'data7':{'type':Sequelize[_0xdeb5('0x11')],'comments':_0xdeb5('0x12')}}; \ No newline at end of file +var _0xb573=['TEXT','urlForward[body]','sequelize','VIRTUAL','action','STRING','motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x16683a,_0x460dca){var _0x480406=function(_0x5bb1e5){while(--_0x5bb1e5){_0x16683a['push'](_0x16683a['shift']());}};_0x480406(++_0x460dca);}(_0xb573,0x101));var _0x3b57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb573[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3b57('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b57('0x1')],'get':function(_0x1ea689){return this['getDataValue'](_0x3b57('0x2'));}},'action':{'type':Sequelize[_0x3b57('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x3b57('0x4'),'jscripty','urlForward',_0x3b57('0x5'),_0x3b57('0x6'),_0x3b57('0x7')]],'msg':_0x3b57('0x8')}},'comment':_0x3b57('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3b57('0x9')},'data2':{'type':Sequelize[_0x3b57('0x3')](0x1000),'comment':_0x3b57('0xa')},'data3':{'type':Sequelize[_0x3b57('0x3')](0x1000),'comment':_0x3b57('0xb')},'data4':{'type':Sequelize[_0x3b57('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3b57('0x3')],'comments':_0x3b57('0xc')},'data7':{'type':Sequelize[_0x3b57('0xd')],'comments':_0x3b57('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index da1723f..a5aac81 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 _0xdf8d=['limit','count','Content-Range','save','then','name','send','body','Action','find','catch','params','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0xdf8d,0xf0));var _0xddf8=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xdf8d[_0x2ed8f3];return _0x525a55;};'use strict';var emlformat=require(_0xddf8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xddf8('0x1'));var rp=require(_0xddf8('0x2'));var moment=require('moment');var BPromise=require(_0xddf8('0x3'));var Mustache=require('mustache');var util=require(_0xddf8('0x4'));var path=require(_0xddf8('0x5'));var sox=require(_0xddf8('0x6'));var csv=require(_0xddf8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddf8('0x8'));var _=require(_0xddf8('0x9'));var squel=require(_0xddf8('0xa'));var crypto=require(_0xddf8('0xb'));var jsforce=require(_0xddf8('0xc'));var deskjs=require(_0xddf8('0xd'));var toCsv=require(_0xddf8('0x7'));var querystring=require(_0xddf8('0xe'));var Papa=require('papaparse');var Redis=require(_0xddf8('0xf'));var authService=require(_0xddf8('0x10'));var qs=require(_0xddf8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf8('0x12'));var logger=require('../../config/logger')(_0xddf8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xddf8('0x14'))['db'];function respondWithStatusCode(_0x4cfdab,_0x17aa2f){_0x17aa2f=_0x17aa2f||0xcc;return function(_0x204351){if(_0x204351){return _0x4cfdab[_0xddf8('0x15')](_0x17aa2f);}return _0x4cfdab[_0xddf8('0x16')](_0x17aa2f)[_0xddf8('0x17')]();};}function respondWithResult(_0x2fbf56,_0x2ac04a){_0x2ac04a=_0x2ac04a||0xc8;return function(_0x2c3b10){if(_0x2c3b10){return _0x2fbf56['status'](_0x2ac04a)[_0xddf8('0x18')](_0x2c3b10);}};}function respondWithFilteredResult(_0x388286,_0x269170){return function(_0x193a01){if(_0x193a01){var _0x5d5b02=typeof _0x269170[_0xddf8('0x19')]==='undefined'&&typeof _0x269170[_0xddf8('0x1a')]==='undefined';var _0x58cfe4=_0x193a01[_0xddf8('0x1b')];var _0x175f5b=_0x5d5b02?0x0:_0x269170[_0xddf8('0x19')];var _0x49e3de=_0x5d5b02?_0x193a01[_0xddf8('0x1b')]:_0x269170[_0xddf8('0x19')]+_0x269170[_0xddf8('0x1a')];var _0x59ce49;if(_0x49e3de>=_0x58cfe4){_0x49e3de=_0x58cfe4;_0x59ce49=0xc8;}else{_0x59ce49=0xce;}_0x388286['status'](_0x59ce49);return _0x388286['set'](_0xddf8('0x1c'),_0x175f5b+'-'+_0x49e3de+'/'+_0x58cfe4)[_0xddf8('0x18')](_0x193a01);}return null;};}function patchUpdates(_0x1631fa){return function(_0x4d4480){try{jsonpatch['apply'](_0x4d4480,_0x1631fa,!![]);}catch(_0x4352e1){return BPromise['reject'](_0x4352e1);}return _0x4d4480[_0xddf8('0x1d')]();};}function saveUpdates(_0x46ddb4,_0x494845){return function(_0x570e4a){if(_0x570e4a){return _0x570e4a['update'](_0x46ddb4)[_0xddf8('0x1e')](function(_0x45c1f0){return _0x45c1f0;});}return null;};}function removeEntity(_0x3d70a9,_0x14d8eb){return function(_0x392746){if(_0x392746){return _0x392746['destroy']()[_0xddf8('0x1e')](function(){_0x3d70a9[_0xddf8('0x16')](0xcc)[_0xddf8('0x17')]();});}};}function handleEntityNotFound(_0x13b131,_0x163b8d){return function(_0x4b6c4a){if(!_0x4b6c4a){_0x13b131[_0xddf8('0x15')](0x194);}return _0x4b6c4a;};}function handleError(_0x525b9c,_0x4f9c39){_0x4f9c39=_0x4f9c39||0x1f4;return function(_0xee9f15){logger['error'](_0xee9f15['stack']);if(_0xee9f15['name']){delete _0xee9f15[_0xddf8('0x1f')];}_0x525b9c[_0xddf8('0x16')](_0x4f9c39)[_0xddf8('0x20')](_0xee9f15);};}exports['update']=function(_0x430bc1,_0x3ed9d1){if(_0x430bc1['body']['id']){delete _0x430bc1[_0xddf8('0x21')]['id'];}return db[_0xddf8('0x22')][_0xddf8('0x23')]({'where':{'id':_0x430bc1['params']['id']}})[_0xddf8('0x1e')](handleEntityNotFound(_0x3ed9d1,null))[_0xddf8('0x1e')](saveUpdates(_0x430bc1[_0xddf8('0x21')],null))[_0xddf8('0x1e')](respondWithResult(_0x3ed9d1,null))[_0xddf8('0x24')](handleError(_0x3ed9d1,null));};exports['destroy']=function(_0x13e6ec,_0x306482){return db[_0xddf8('0x22')]['find']({'where':{'id':_0x13e6ec[_0xddf8('0x25')]['id']}})[_0xddf8('0x1e')](handleEntityNotFound(_0x306482,null))[_0xddf8('0x1e')](removeEntity(_0x306482,null))[_0xddf8('0x24')](handleError(_0x306482,null));}; \ No newline at end of file +var _0xab81=['../../config/environment','../../config/license/util','../../mysqldb','end','json','limit','undefined','count','offset','status','set','apply','save','update','then','destroy','error','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x466ee0,_0x38f276){var _0x3b5d0a=function(_0x166504){while(--_0x166504){_0x466ee0['push'](_0x466ee0['shift']());}};_0x3b5d0a(++_0x38f276);}(_0xab81,0x1c8));var _0x1ab8=function(_0x217d69,_0x23dc97){_0x217d69=_0x217d69-0x0;var _0x331e21=_0xab81[_0x217d69];return _0x331e21;};'use strict';var emlformat=require(_0x1ab8('0x0'));var rimraf=require(_0x1ab8('0x1'));var zipdir=require(_0x1ab8('0x2'));var jsonpatch=require(_0x1ab8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ab8('0x4'));var Mustache=require(_0x1ab8('0x5'));var util=require(_0x1ab8('0x6'));var path=require(_0x1ab8('0x7'));var sox=require(_0x1ab8('0x8'));var csv=require(_0x1ab8('0x9'));var ejs=require(_0x1ab8('0xa'));var fs=require('fs');var fs_extra=require(_0x1ab8('0xb'));var _=require(_0x1ab8('0xc'));var squel=require('squel');var crypto=require(_0x1ab8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ab8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ab8('0xf'));var Papa=require(_0x1ab8('0x10'));var Redis=require(_0x1ab8('0x11'));var authService=require(_0x1ab8('0x12'));var qs=require(_0x1ab8('0x13'));var as=require(_0x1ab8('0x14'));var hardwareService=require(_0x1ab8('0x15'));var logger=require(_0x1ab8('0x16'))('api');var utils=require(_0x1ab8('0x17'));var config=require(_0x1ab8('0x18'));var licenseUtil=require(_0x1ab8('0x19'));var db=require(_0x1ab8('0x1a'))['db'];function respondWithStatusCode(_0x37b22c,_0x47cbca){_0x47cbca=_0x47cbca||0xcc;return function(_0x4f4233){if(_0x4f4233){return _0x37b22c['sendStatus'](_0x47cbca);}return _0x37b22c['status'](_0x47cbca)[_0x1ab8('0x1b')]();};}function respondWithResult(_0x264cc2,_0x520f87){_0x520f87=_0x520f87||0xc8;return function(_0x440b59){if(_0x440b59){return _0x264cc2['status'](_0x520f87)[_0x1ab8('0x1c')](_0x440b59);}};}function respondWithFilteredResult(_0x24f08d,_0x28f27d){return function(_0x471f07){if(_0x471f07){var _0x42c736=typeof _0x28f27d['offset']==='undefined'&&typeof _0x28f27d[_0x1ab8('0x1d')]===_0x1ab8('0x1e');var _0x50aa27=_0x471f07[_0x1ab8('0x1f')];var _0x2bbfea=_0x42c736?0x0:_0x28f27d['offset'];var _0xf7c1ac=_0x42c736?_0x471f07[_0x1ab8('0x1f')]:_0x28f27d[_0x1ab8('0x20')]+_0x28f27d[_0x1ab8('0x1d')];var _0x2d0826;if(_0xf7c1ac>=_0x50aa27){_0xf7c1ac=_0x50aa27;_0x2d0826=0xc8;}else{_0x2d0826=0xce;}_0x24f08d[_0x1ab8('0x21')](_0x2d0826);return _0x24f08d[_0x1ab8('0x22')]('Content-Range',_0x2bbfea+'-'+_0xf7c1ac+'/'+_0x50aa27)['json'](_0x471f07);}return null;};}function patchUpdates(_0x491465){return function(_0x2893f0){try{jsonpatch[_0x1ab8('0x23')](_0x2893f0,_0x491465,!![]);}catch(_0x363a2b){return BPromise['reject'](_0x363a2b);}return _0x2893f0[_0x1ab8('0x24')]();};}function saveUpdates(_0x56c04c,_0x5af4ba){return function(_0x369f10){if(_0x369f10){return _0x369f10[_0x1ab8('0x25')](_0x56c04c)[_0x1ab8('0x26')](function(_0x30eef7){return _0x30eef7;});}return null;};}function removeEntity(_0x281c67,_0x4792b7){return function(_0x5d10a4){if(_0x5d10a4){return _0x5d10a4[_0x1ab8('0x27')]()[_0x1ab8('0x26')](function(){_0x281c67[_0x1ab8('0x21')](0xcc)[_0x1ab8('0x1b')]();});}};}function handleEntityNotFound(_0x38b190,_0x1ca274){return function(_0x3c2717){if(!_0x3c2717){_0x38b190['sendStatus'](0x194);}return _0x3c2717;};}function handleError(_0xa2d4a2,_0xaf16ae){_0xaf16ae=_0xaf16ae||0x1f4;return function(_0x1a677d){logger[_0x1ab8('0x28')](_0x1a677d['stack']);if(_0x1a677d['name']){delete _0x1a677d[_0x1ab8('0x29')];}_0xa2d4a2[_0x1ab8('0x21')](_0xaf16ae)[_0x1ab8('0x2a')](_0x1a677d);};}exports[_0x1ab8('0x25')]=function(_0x18fb58,_0x1ec15c){if(_0x18fb58[_0x1ab8('0x2b')]['id']){delete _0x18fb58[_0x1ab8('0x2b')]['id'];}return db[_0x1ab8('0x2c')][_0x1ab8('0x2d')]({'where':{'id':_0x18fb58[_0x1ab8('0x2e')]['id']}})[_0x1ab8('0x26')](handleEntityNotFound(_0x1ec15c,null))[_0x1ab8('0x26')](saveUpdates(_0x18fb58[_0x1ab8('0x2b')],null))[_0x1ab8('0x26')](respondWithResult(_0x1ec15c,null))[_0x1ab8('0x2f')](handleError(_0x1ec15c,null));};exports[_0x1ab8('0x27')]=function(_0x4bb4c6,_0x3ddfe1){return db[_0x1ab8('0x2c')]['find']({'where':{'id':_0x4bb4c6['params']['id']}})[_0x1ab8('0x26')](handleEntityNotFound(_0x3ddfe1,null))[_0x1ab8('0x26')](removeEntity(_0x3ddfe1,null))['catch'](handleError(_0x3ddfe1,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1efa952..c036b58 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 _0xed27=['moment','bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger'];(function(_0x285c53,_0x1af56c){var _0x5b0fa1=function(_0x58775c){while(--_0x58775c){_0x285c53['push'](_0x285c53['shift']());}};_0x5b0fa1(++_0x1af56c);}(_0xed27,0x183));var _0x7ed2=function(_0x43a76f,_0x569b0d){_0x43a76f=_0x43a76f-0x0;var _0x8abb22=_0xed27[_0x43a76f];return _0x8abb22;};'use strict';var _=require(_0x7ed2('0x0'));var util=require(_0x7ed2('0x1'));var logger=require(_0x7ed2('0x2'))('api');var moment=require(_0x7ed2('0x3'));var BPromise=require(_0x7ed2('0x4'));var rp=require(_0x7ed2('0x5'));var fs=require('fs');var path=require(_0x7ed2('0x6'));var rimraf=require(_0x7ed2('0x7'));var config=require('../../config/environment');var attributes=require(_0x7ed2('0x8'));module[_0x7ed2('0x9')]=function(_0x12e6bb,_0x26bea2){return _0x12e6bb[_0x7ed2('0xa')](_0x7ed2('0xb'),attributes,{'tableName':_0x7ed2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8135=['lodash','util','api','moment','path','rimraf','../../config/environment','./action.attributes','tools_actions'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0x8135,0x171));var _0x5813=function(_0xdaf2cc,_0x21434b){_0xdaf2cc=_0xdaf2cc-0x0;var _0x1c5e61=_0x8135[_0xdaf2cc];return _0x1c5e61;};'use strict';var _=require(_0x5813('0x0'));var util=require(_0x5813('0x1'));var logger=require('../../config/logger')(_0x5813('0x2'));var moment=require(_0x5813('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5813('0x4'));var rimraf=require(_0x5813('0x5'));var config=require(_0x5813('0x6'));var attributes=require(_0x5813('0x7'));module['exports']=function(_0x52004c,_0x4bc5de){return _0x52004c['define']('Action',attributes,{'tableName':_0x5813('0x8'),'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 a29448c..b6d9087 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x53ec,0x192));var _0xc53e=function(_0x30f910,_0x8e3a23){_0x30f910=_0x30f910-0x0;var _0x836515=_0x53ec[_0x30f910];return _0x836515;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xf494,0x1c6));var _0x4f49=function(_0x5be805,_0x472ca3){_0x5be805=_0x5be805-0x0;var _0x86f52f=_0xf494[_0x5be805];return _0x86f52f;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 704ed3a..2bb9ea0 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 _0xa94c=['multer','express','./action.controller','put','isAuthenticated','delete','/:id','destroy','exports'];(function(_0x6acd7a,_0x45ffa8){var _0x3d4120=function(_0x2d29ee){while(--_0x2d29ee){_0x6acd7a['push'](_0x6acd7a['shift']());}};_0x3d4120(++_0x45ffa8);}(_0xa94c,0xd8));var _0xca94=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xa94c[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xca94('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca94('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xca94('0x2'));router[_0xca94('0x3')]('/:id',auth[_0xca94('0x4')](),controller['update']);router[_0xca94('0x5')](_0xca94('0x6'),auth[_0xca94('0x4')](),controller[_0xca94('0x7')]);module[_0xca94('0x8')]=router; \ No newline at end of file +var _0x3f2a=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','delete','/:id'];(function(_0xf7a91b,_0x1c9b9d){var _0x52c82d=function(_0x13d7f5){while(--_0x13d7f5){_0xf7a91b['push'](_0xf7a91b['shift']());}};_0x52c82d(++_0x1c9b9d);}(_0x3f2a,0xe2));var _0xa3f2=function(_0x209d8b,_0x45bc53){_0x209d8b=_0x209d8b-0x0;var _0x1e73ce=_0x3f2a[_0x209d8b];return _0x1e73ce;};'use strict';var multer=require(_0xa3f2('0x0'));var util=require(_0xa3f2('0x1'));var path=require(_0xa3f2('0x2'));var timeout=require(_0xa3f2('0x3'));var express=require('express');var router=express[_0xa3f2('0x4')]();var fs_extra=require(_0xa3f2('0x5'));var auth=require(_0xa3f2('0x6'));var interaction=require(_0xa3f2('0x7'));var config=require(_0xa3f2('0x8'));var controller=require(_0xa3f2('0x9'));router[_0xa3f2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa3f2('0xb')]);router[_0xa3f2('0xc')](_0xa3f2('0xd'),auth['isAuthenticated'](),controller[_0xa3f2('0xe')]);module[_0xa3f2('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 60d913a..8cb47ed 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x356b5b,_0x148ff3){var _0x26f888=function(_0x32f1c2){while(--_0x32f1c2){_0x356b5b['push'](_0x356b5b['shift']());}};_0x26f888(++_0x148ff3);}(_0xac9d,0x14d));var _0xdac9=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xac9d[_0x156a0d];return _0x98a9ba;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x187207,_0xeda217){var _0x57e2e1=function(_0x1029ab){while(--_0x1029ab){_0x187207['push'](_0x187207['shift']());}};_0x57e2e1(++_0xeda217);}(_0x5fc3,0xa8));var _0x35fc=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x5fc3[_0x512c83];return _0x1f7f25;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 902fb3a..6c650ba 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 _0x8549=['field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','SUM(%s)','IS\x20EMPTY','getFields','keyBy','foreignKey','clone','web','fullPath','output','csv','custom','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','from','countTable','COUNT(*)','SELECT','run','runReport','left_join','ValidationErrorItem','Limited\x20Query:','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','where','type','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','CustomReports','error','params','join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x8549,0xd3));var _0x9854=function(_0x395db0,_0x4bf0ea){_0x395db0=_0x395db0-0x0;var _0x53c829=_0x8549[_0x395db0];return _0x53c829;};'use strict';var emlformat=require(_0x9854('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9854('0x1'));var jsonpatch=require(_0x9854('0x2'));var rp=require(_0x9854('0x3'));var moment=require(_0x9854('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9854('0x5'));var path=require(_0x9854('0x6'));var sox=require(_0x9854('0x7'));var csv=require(_0x9854('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9854('0x9'));var _=require(_0x9854('0xa'));var squel=require(_0x9854('0xb'));var crypto=require(_0x9854('0xc'));var jsforce=require(_0x9854('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9854('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9854('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9854('0x10'));var logger=require(_0x9854('0x11'))('api');var utils=require(_0x9854('0x12'));var config=require(_0x9854('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9854('0x14'))['db'];var dbH=require(_0x9854('0x14'))['dbH'];function respondWithStatusCode(_0x491fbf,_0x1dc67e){_0x1dc67e=_0x1dc67e||0xcc;return function(_0x4c62e3){if(_0x4c62e3){return _0x491fbf['sendStatus'](_0x1dc67e);}return _0x491fbf[_0x9854('0x15')](_0x1dc67e)[_0x9854('0x16')]();};}function respondWithResult(_0xeacde9,_0x32a633){_0x32a633=_0x32a633||0xc8;return function(_0x5b4397){if(_0x5b4397){return _0xeacde9[_0x9854('0x15')](_0x32a633)[_0x9854('0x17')](_0x5b4397);}};}function respondWithFilteredResult(_0xdca774,_0x2ac40f){return function(_0x32c44d){if(_0x32c44d){var _0x35e4e1=typeof _0x2ac40f[_0x9854('0x18')]===_0x9854('0x19')&&typeof _0x2ac40f[_0x9854('0x1a')]===_0x9854('0x19');var _0x1ebdf9=_0x32c44d[_0x9854('0x1b')];var _0x4e378b=_0x35e4e1?0x0:_0x2ac40f[_0x9854('0x18')];var _0x4f26be=_0x35e4e1?_0x32c44d[_0x9854('0x1b')]:_0x2ac40f[_0x9854('0x18')]+_0x2ac40f[_0x9854('0x1a')];var _0x3b5372;if(_0x4f26be>=_0x1ebdf9){_0x4f26be=_0x1ebdf9;_0x3b5372=0xc8;}else{_0x3b5372=0xce;}_0xdca774[_0x9854('0x15')](_0x3b5372);return _0xdca774['set']('Content-Range',_0x4e378b+'-'+_0x4f26be+'/'+_0x1ebdf9)['json'](_0x32c44d);}return null;};}function patchUpdates(_0x205a2d){return function(_0x27de4f){try{jsonpatch[_0x9854('0x1c')](_0x27de4f,_0x205a2d,!![]);}catch(_0x43821c){return BPromise['reject'](_0x43821c);}return _0x27de4f[_0x9854('0x1d')]();};}function saveUpdates(_0x42d9e0,_0x2ab8c2){return function(_0x244eaf){if(_0x244eaf){return _0x244eaf[_0x9854('0x1e')](_0x42d9e0)[_0x9854('0x1f')](function(_0xc26853){return _0xc26853;});}return null;};}function removeEntity(_0x3a7b47,_0x1b2c8a){return function(_0x5ef7b4){if(_0x5ef7b4){return _0x5ef7b4[_0x9854('0x20')]()[_0x9854('0x1f')](function(){var _0x25425c=_0x5ef7b4['get']({'plain':!![]});var _0x4deded='CustomReports';return db[_0x9854('0x21')][_0x9854('0x20')]({'where':{'type':_0x4deded,'resourceId':_0x25425c['id']}})[_0x9854('0x1f')](function(){return _0x5ef7b4;});})['then'](function(){_0x3a7b47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16c5a0,_0x57c7d4){return function(_0x4da57b){if(!_0x4da57b){_0x16c5a0[_0x9854('0x22')](0x194);}return _0x4da57b;};}function handleError(_0x18c48d,_0x292d12){_0x292d12=_0x292d12||0x1f4;return function(_0x4eb504){logger['error'](_0x4eb504[_0x9854('0x23')]);if(_0x4eb504[_0x9854('0x24')]){delete _0x4eb504[_0x9854('0x24')];}_0x18c48d[_0x9854('0x15')](_0x292d12)[_0x9854('0x25')](_0x4eb504);};}exports[_0x9854('0x26')]=function(_0x4d72f2,_0x1cc265){var _0x40c9df={},_0x5f1a85={},_0x5b8485={'count':0x0,'rows':[]};var _0x187746=_[_0x9854('0x27')](db[_0x9854('0x28')][_0x9854('0x29')],function(_0x52ee13){return{'name':_0x52ee13[_0x9854('0x2a')],'type':_0x52ee13['type'][_0x9854('0x2b')]};});_0x5f1a85['model']=_[_0x9854('0x27')](_0x187746,_0x9854('0x24'));_0x5f1a85[_0x9854('0x2c')]=_[_0x9854('0x2d')](_0x4d72f2[_0x9854('0x2c')]);_0x5f1a85[_0x9854('0x2e')]=_[_0x9854('0x2f')](_0x5f1a85['model'],_0x5f1a85['query']);_0x40c9df[_0x9854('0x30')]=_['intersection'](_0x5f1a85[_0x9854('0x31')],qs[_0x9854('0x32')](_0x4d72f2[_0x9854('0x2c')][_0x9854('0x32')]));_0x40c9df[_0x9854('0x30')]=_0x40c9df[_0x9854('0x30')]['length']?_0x40c9df[_0x9854('0x30')]:_0x5f1a85['model'];if(!_0x4d72f2[_0x9854('0x2c')]['hasOwnProperty'](_0x9854('0x33'))){_0x40c9df['limit']=qs[_0x9854('0x1a')](_0x4d72f2[_0x9854('0x2c')][_0x9854('0x1a')]);_0x40c9df['offset']=qs[_0x9854('0x18')](_0x4d72f2[_0x9854('0x2c')][_0x9854('0x18')]);}_0x40c9df[_0x9854('0x34')]=qs[_0x9854('0x35')](_0x4d72f2[_0x9854('0x2c')]['sort']);_0x40c9df['where']=qs[_0x9854('0x2e')](_[_0x9854('0x36')](_0x4d72f2[_0x9854('0x2c')],_0x5f1a85[_0x9854('0x2e')]),_0x187746);if(_0x4d72f2[_0x9854('0x2c')]['filter']){_0x40c9df[_0x9854('0x37')]=_['merge'](_0x40c9df['where'],{'$or':_[_0x9854('0x27')](_0x187746,function(_0x28a1a0){if(_0x28a1a0[_0x9854('0x38')]!=='VIRTUAL'){var _0x460ed9={};_0x460ed9[_0x28a1a0[_0x9854('0x24')]]={'$like':'%'+_0x4d72f2[_0x9854('0x2c')]['filter']+'%'};return _0x460ed9;}})});}_0x40c9df=_[_0x9854('0x39')]({},_0x40c9df,_0x4d72f2[_0x9854('0x3a')]);var _0x5aaab1={'where':_0x40c9df[_0x9854('0x37')]};return db[_0x9854('0x28')][_0x9854('0x1b')](_0x5aaab1)[_0x9854('0x1f')](function(_0xf34a76){_0x5b8485[_0x9854('0x1b')]=_0xf34a76;if(_0x4d72f2['query'][_0x9854('0x3b')]){_0x40c9df[_0x9854('0x3c')]=[{'all':!![]}];}return db[_0x9854('0x28')][_0x9854('0x3d')](_0x40c9df);})[_0x9854('0x1f')](function(_0x3cd925){_0x5b8485[_0x9854('0x3e')]=_0x3cd925;return _0x5b8485;})[_0x9854('0x1f')](respondWithFilteredResult(_0x1cc265,_0x40c9df))[_0x9854('0x3f')](handleError(_0x1cc265,null));};exports[_0x9854('0x40')]=function(_0x2ccd5e,_0xc3cb10){var _0x3673bd={'raw':![],'where':{'id':_0x2ccd5e['params']['id']}},_0x5a265c={};_0x5a265c[_0x9854('0x31')]=_[_0x9854('0x2d')](db[_0x9854('0x28')][_0x9854('0x29')]);_0x5a265c['query']=_[_0x9854('0x2d')](_0x2ccd5e['query']);_0x5a265c['filters']=_['intersection'](_0x5a265c[_0x9854('0x31')],_0x5a265c[_0x9854('0x2c')]);_0x3673bd[_0x9854('0x30')]=_[_0x9854('0x2f')](_0x5a265c['model'],qs[_0x9854('0x32')](_0x2ccd5e[_0x9854('0x2c')][_0x9854('0x32')]));_0x3673bd[_0x9854('0x30')]=_0x3673bd['attributes'][_0x9854('0x41')]?_0x3673bd[_0x9854('0x30')]:_0x5a265c[_0x9854('0x31')];if(_0x2ccd5e[_0x9854('0x2c')][_0x9854('0x3b')]){_0x3673bd['include']=[{'all':!![]}];}_0x3673bd=_[_0x9854('0x39')]({},_0x3673bd,_0x2ccd5e[_0x9854('0x3a')]);return db[_0x9854('0x28')][_0x9854('0x42')](_0x3673bd)[_0x9854('0x1f')](handleEntityNotFound(_0xc3cb10,null))[_0x9854('0x1f')](respondWithResult(_0xc3cb10,null))[_0x9854('0x3f')](handleError(_0xc3cb10,null));};exports[_0x9854('0x43')]=function(_0x3fb766,_0x4a2f58){return db[_0x9854('0x28')][_0x9854('0x43')](_0x3fb766[_0x9854('0x44')],{})['then'](function(_0x5060fb){var _0x35a552=_0x3fb766[_0x9854('0x45')]['get']({'plain':!![]});if(!_0x35a552)throw new Error(_0x9854('0x46'));if(_0x35a552[_0x9854('0x47')]===_0x9854('0x45')){var _0x3a1da5=_0x5060fb['get']({'plain':!![]});var _0x3808d6='Reports';return db['UserProfileSection'][_0x9854('0x42')]({'where':{'name':_0x3808d6,'userProfileId':_0x35a552['userProfileId']},'raw':!![]})[_0x9854('0x1f')](function(_0x3d02b6){if(_0x3d02b6&&_0x3d02b6[_0x9854('0x48')]===0x0){return db[_0x9854('0x21')]['create']({'name':_0x3a1da5[_0x9854('0x24')],'resourceId':_0x3a1da5['id'],'type':_0x9854('0x49'),'sectionId':_0x3d02b6['id']},{})[_0x9854('0x1f')](function(){return _0x5060fb;});}else{return _0x5060fb;}})['catch'](function(_0x2a8108){logger[_0x9854('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a8108);throw _0x2a8108;});}return _0x5060fb;})[_0x9854('0x1f')](respondWithResult(_0x4a2f58,0xc9))[_0x9854('0x3f')](handleError(_0x4a2f58,null));};exports['update']=function(_0x1d5491,_0xf2d502){if(_0x1d5491['body']['id']){delete _0x1d5491[_0x9854('0x44')]['id'];}return db[_0x9854('0x28')][_0x9854('0x42')]({'where':{'id':_0x1d5491['params']['id']}})[_0x9854('0x1f')](handleEntityNotFound(_0xf2d502,null))[_0x9854('0x1f')](saveUpdates(_0x1d5491[_0x9854('0x44')],null))[_0x9854('0x1f')](respondWithResult(_0xf2d502,null))[_0x9854('0x3f')](handleError(_0xf2d502,null));};exports[_0x9854('0x20')]=function(_0x26785,_0x486fb1){return db['AnalyticCustomReport'][_0x9854('0x42')]({'where':{'id':_0x26785[_0x9854('0x4b')]['id']}})[_0x9854('0x1f')](handleEntityNotFound(_0x486fb1,null))[_0x9854('0x1f')](removeEntity(_0x486fb1,null))[_0x9854('0x3f')](handleError(_0x486fb1,null));};exports['preview']=function(_0xae5239,_0x40aac1){var _0x252421=0xa;var _0x49530b=[_0x9854('0x4c'),'left_join',_0x9854('0x4d'),'cross_join'];var _0x280af7={'SUM':'SUM(%s)','COUNT':_0x9854('0x4e'),'COUNT DISTINCT':_0x9854('0x4f'),'MAX':_0x9854('0x50'),'MIN':_0x9854('0x51'),'AVG':_0x9854('0x52'),'GROUP_CONCAT':_0x9854('0x53'),'GROUP_CONCAT ASC':_0x9854('0x54'),'GROUP_CONCAT DESC':_0x9854('0x55')};var _0x26a0ac={'SEC_TO_TIME':_0x9854('0x56'),'DATE':'DATE(%s)','HOUR':_0x9854('0x57'),'ROUND':_0x9854('0x58'),'UNIX_TIMESTAMP':_0x9854('0x59')};var _0x4f86af=function(_0x35a2b9){return!_[_0x9854('0x5a')]([_0x9854('0x5b'),_0x9854('0x5c'),'IS\x20EMPTY',_0x9854('0x5d')],_0x35a2b9);};var _0x257eb2=function(_0x573448){if(!_0x573448||!_0x573448[_0x9854('0x5e')][_0x9854('0x41')]){return'';}for(var _0x4afd9b='(',_0x3cc942=0x0;_0x3cc942<_0x573448[_0x9854('0x5e')][_0x9854('0x41')];_0x3cc942+=0x1){_0x3cc942>0x0&&(_0x4afd9b+='\x20'+_0x573448[_0x9854('0x5f')]+'\x20');_0x4afd9b+=_0x573448[_0x9854('0x5e')][_0x3cc942][_0x9854('0x60')]?_0x257eb2(_0x573448[_0x9854('0x5e')][_0x3cc942][_0x9854('0x60')]):_0x573448[_0x9854('0x5e')][_0x3cc942][_0x9854('0x61')]+'\x20'+_0x573448['rules'][_0x3cc942][_0x9854('0x62')]+(_0x4f86af(_0x573448[_0x9854('0x5e')][_0x3cc942][_0x9854('0x62')])?'\x20'+_0x573448['rules'][_0x3cc942][_0x9854('0x63')]:'');}return _0x4afd9b+')';};var _0x50e4bd={'where':{'id':_0xae5239['params']['id']}},_0x1d885b,_0x3971ed,_0x5a702e,_0x4a3fe4,_0x5406d0;_0x50e4bd=_[_0x9854('0x39')]({},_0x50e4bd,_0xae5239[_0x9854('0x3a')]);return db[_0x9854('0x28')][_0x9854('0x42')](_0x50e4bd)[_0x9854('0x1f')](function(_0x48ecf4){if(_0x48ecf4){_0x1d885b=_0x48ecf4;return _0x48ecf4['getFields']();}return null;})[_0x9854('0x1f')](function(_0x2c2d7c){if(_0x2c2d7c){if(!_0x2c2d7c[_0x9854('0x41')]){throw new db[(_0x9854('0x64'))]['ValidationErrorItem'](_0x9854('0x65'),0x193);}_0x3971ed=_0x2c2d7c;return db[_0x9854('0x66')][_0x9854('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x2da123){if(_0x2da123){_0x5a702e=_['keyBy'](_0x2da123,'id');var _0x3f34ff;var _0x53c0d8=squel[_0x9854('0x67')]();_0x53c0d8['from'](_0x1d885b[_0x9854('0x68')]);for(var _0x51b8a4=0x0;_0x51b8a4<_0x3971ed[_0x9854('0x41')];_0x51b8a4+=0x1){_0x3f34ff=_0x3971ed[_0x51b8a4][_0x9854('0x69')]?_0x5a702e[_0x3971ed[_0x51b8a4][_0x9854('0x69')]][_0x9854('0x6a')]:_0x3971ed[_0x51b8a4][_0x9854('0x61')];_0x3f34ff=_0x3971ed[_0x51b8a4][_0x9854('0x6b')]?_['replace'](_0x280af7[_0x3971ed[_0x51b8a4][_0x9854('0x6b')]],'%s',_0x3f34ff):_0x3f34ff;_0x3f34ff=_0x3971ed[_0x51b8a4][_0x9854('0x6c')]?_[_0x9854('0x6d')](_0x26a0ac[_0x3971ed[_0x51b8a4]['format']],'%s',_0x3f34ff):_0x3f34ff;if(_0x3971ed[_0x51b8a4][_0x9854('0x6e')]){_0x53c0d8[_0x9854('0x60')](_0x3f34ff);}_0x3971ed[_0x51b8a4][_0x9854('0x6f')]&&_0x53c0d8[_0x9854('0x34')](_0x3f34ff,_0x3971ed[_0x51b8a4][_0x9854('0x6f')]===_0x9854('0x70')?![]:!![]);_0x53c0d8[_0x9854('0x61')](_0x3f34ff,_0x3971ed[_0x51b8a4][_0x9854('0x71')]||_0x3f34ff);}if(_0x1d885b[_0x9854('0x72')]){_0x1d885b['joins']=JSON[_0x9854('0x73')](_0x1d885b[_0x9854('0x72')]);for(var _0x26aa85=0x0;_0x26aa85<_0x1d885b[_0x9854('0x72')][_0x9854('0x41')];_0x26aa85+=0x1){if(_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x38')]&&_[_0x9854('0x5a')](_0x49530b,_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x38')])&&_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x74')]&&_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x75')]&&_0x1d885b[_0x9854('0x72')][_0x26aa85]['foreignKey']){_0x53c0d8[_0x1d885b['joins'][_0x26aa85]['type']](_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x75')],null,util['format'](_0x9854('0x76'),_0x1d885b['table'],_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x74')],_0x1d885b[_0x9854('0x72')][_0x26aa85][_0x9854('0x75')],_0x1d885b[_0x9854('0x72')][_0x26aa85]['foreignKey']));}}}if(_0x1d885b[_0x9854('0x77')]){_0x1d885b['conditions']=JSON[_0x9854('0x73')](_0x1d885b[_0x9854('0x77')]);_0x53c0d8[_0x9854('0x37')](_0x257eb2(_0x1d885b['conditions'][_0x9854('0x60')]));}_0x5406d0=_0x53c0d8['clone']();_0x53c0d8[_0x9854('0x1a')](_0x252421);_0x53c0d8[_0x9854('0x18')](0x0);logger[_0x9854('0x78')]('Limited\x20Query:',_0x53c0d8[_0x9854('0x79')]());return dbH[_0x9854('0x7a')][_0x9854('0x2c')](_0x53c0d8['toString'](),{'type':dbH[_0x9854('0x7a')][_0x9854('0x7b')]['SELECT']});}})[_0x9854('0x1f')](respondWithResult(_0x40aac1,null))[_0x9854('0x3f')](handleError(_0x40aac1,null));};function runReport(_0x59efbb,_0x479441,_0x12b2f8){var _0x186359=_0x479441[_0x9854('0x24')];var _0x4f4b46=0xa;var _0x249fef=[_0x9854('0x4c'),'left_join',_0x9854('0x4d'),'cross_join'];var _0x4761f9={'SUM':_0x9854('0x7c'),'COUNT':_0x9854('0x4e'),'COUNT DISTINCT':_0x9854('0x4f'),'MAX':_0x9854('0x50'),'MIN':_0x9854('0x51'),'AVG':_0x9854('0x52'),'GROUP_CONCAT':_0x9854('0x53'),'GROUP_CONCAT ASC':_0x9854('0x54'),'GROUP_CONCAT DESC':_0x9854('0x55')};var _0x458f04={'SEC_TO_TIME':_0x9854('0x56'),'DATE':'DATE(%s)','HOUR':_0x9854('0x57'),'ROUND':_0x9854('0x58'),'UNIX_TIMESTAMP':_0x9854('0x59')};var _0x182ee1=function(_0x5f5537){return!_[_0x9854('0x5a')]([_0x9854('0x5b'),'IS\x20NOT\x20NULL',_0x9854('0x7d'),_0x9854('0x5d')],_0x5f5537);};var _0x106325=function(_0x36e65a){if(!_0x36e65a||!_0x36e65a[_0x9854('0x5e')]['length']){return'';}for(var _0x550214='(',_0x45ef2c=0x0;_0x45ef2c<_0x36e65a[_0x9854('0x5e')][_0x9854('0x41')];_0x45ef2c+=0x1){_0x45ef2c>0x0&&(_0x550214+='\x20'+_0x36e65a['operator']+'\x20');_0x550214+=_0x36e65a[_0x9854('0x5e')][_0x45ef2c][_0x9854('0x60')]?_0x106325(_0x36e65a[_0x9854('0x5e')][_0x45ef2c][_0x9854('0x60')]):_0x36e65a[_0x9854('0x5e')][_0x45ef2c][_0x9854('0x61')]+'\x20'+_0x36e65a[_0x9854('0x5e')][_0x45ef2c]['condition']+(_0x182ee1(_0x36e65a[_0x9854('0x5e')][_0x45ef2c][_0x9854('0x62')])?'\x20'+_0x36e65a['rules'][_0x45ef2c][_0x9854('0x63')]:'');}return _0x550214+')';};var _0x5934a5={'where':{'id':_0x59efbb['id']}},_0x481d6a,_0x479ded,_0x5c443c,_0x4d9a01,_0x4d3ff3;_0x5934a5=_[_0x9854('0x39')]({},_0x5934a5,_0x12b2f8);return db[_0x9854('0x28')][_0x9854('0x42')](_0x5934a5)[_0x9854('0x1f')](function(_0x4c522d){if(_0x4c522d){_0x481d6a=_0x4c522d;return _0x4c522d[_0x9854('0x7e')]();}return null;})['then'](function(_0x5388eb){if(_0x5388eb){if(!_0x5388eb[_0x9854('0x41')]){throw new db['Sequelize']['ValidationErrorItem'](_0x9854('0x65'),0x193);}_0x479ded=_0x5388eb;return db['AnalyticMetric'][_0x9854('0x3d')]({'raw':!![]});}return null;})[_0x9854('0x1f')](function(_0x22abac){if(_0x22abac){_0x5c443c=_[_0x9854('0x7f')](_0x22abac,'id');var _0x4dcd40;var _0x5f1bf3=squel[_0x9854('0x67')]();_0x5f1bf3['from'](_0x481d6a[_0x9854('0x68')]);for(var _0x5366f3=0x0;_0x5366f3<_0x479ded[_0x9854('0x41')];_0x5366f3+=0x1){_0x4dcd40=_0x479ded[_0x5366f3][_0x9854('0x69')]?_0x5c443c[_0x479ded[_0x5366f3][_0x9854('0x69')]][_0x9854('0x6a')]:_0x479ded[_0x5366f3][_0x9854('0x61')];_0x4dcd40=_0x479ded[_0x5366f3]['function']?_['replace'](_0x4761f9[_0x479ded[_0x5366f3][_0x9854('0x6b')]],'%s',_0x4dcd40):_0x4dcd40;_0x4dcd40=_0x479ded[_0x5366f3]['format']?_['replace'](_0x458f04[_0x479ded[_0x5366f3][_0x9854('0x6c')]],'%s',_0x4dcd40):_0x4dcd40;if(_0x479ded[_0x5366f3]['groupBy']){_0x5f1bf3[_0x9854('0x60')](_0x4dcd40);}_0x479ded[_0x5366f3][_0x9854('0x6f')]&&_0x5f1bf3['order'](_0x4dcd40,_0x479ded[_0x5366f3][_0x9854('0x6f')]===_0x9854('0x70')?![]:!![]);_0x5f1bf3['field'](_0x4dcd40,_0x479ded[_0x5366f3][_0x9854('0x71')]||_0x4dcd40);}if(_0x481d6a['joins']){_0x481d6a[_0x9854('0x72')]=JSON[_0x9854('0x73')](_0x481d6a['joins']);for(var _0x552888=0x0;_0x552888<_0x481d6a[_0x9854('0x72')][_0x9854('0x41')];_0x552888+=0x1){if(_0x481d6a[_0x9854('0x72')][_0x552888][_0x9854('0x38')]&&_[_0x9854('0x5a')](_0x249fef,_0x481d6a[_0x9854('0x72')][_0x552888]['type'])&&_0x481d6a['joins'][_0x552888][_0x9854('0x74')]&&_0x481d6a[_0x9854('0x72')][_0x552888][_0x9854('0x75')]&&_0x481d6a[_0x9854('0x72')][_0x552888][_0x9854('0x80')]){_0x5f1bf3[_0x481d6a[_0x9854('0x72')][_0x552888]['type']](_0x481d6a[_0x9854('0x72')][_0x552888][_0x9854('0x75')],null,util['format'](_0x9854('0x76'),_0x481d6a[_0x9854('0x68')],_0x481d6a[_0x9854('0x72')][_0x552888][_0x9854('0x74')],_0x481d6a[_0x9854('0x72')][_0x552888][_0x9854('0x75')],_0x481d6a['joins'][_0x552888][_0x9854('0x80')]));}}}if(_0x481d6a['conditions']){_0x481d6a['conditions']=JSON[_0x9854('0x73')](_0x481d6a[_0x9854('0x77')]);_0x5f1bf3[_0x9854('0x37')](_0x106325(_0x481d6a['conditions']['group']));}_0x4d3ff3=_0x5f1bf3[_0x9854('0x81')]();_0x5f1bf3[_0x9854('0x1a')](_0x4f4b46);_0x5f1bf3[_0x9854('0x18')](0x0);return;}})[_0x9854('0x1f')](function(){if(_0x479441['output']===_0x9854('0x82')){return null;}var _0x209359=_[_0x9854('0x39')](_0x479441,{'name':_0x479441[_0x9854('0x83')]||_0x479441[_0x9854('0x24')]||_0x481d6a[_0x9854('0x24')],'basename':_0x186359,'savename':util[_0x9854('0x6c')]('%s-%s.%s',_0x479441['name']||_0x481d6a[_0x9854('0x24')],require('randomstring')['generate'](0x4),_0x479441[_0x9854('0x84')]||_0x9854('0x85')),'reportId':_0x481d6a['id'],'reportType':_0x9854('0x86')});return db[_0x9854('0x87')]['create'](_0x209359,{'raw':!![]});})[_0x9854('0x1f')](function(_0x2f693f){if(_0x481d6a['table']===_0x9854('0x88')){_0x4d3ff3['where'](_0x481d6a[_0x9854('0x68')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x479441[_0x9854('0x89')],_0x479441['endDate']);}else{_0x4d3ff3[_0x9854('0x37')](_0x481d6a['table']+_0x9854('0x8a'),_0x479441[_0x9854('0x89')],_0x479441['endDate']);}if(_0x2f693f){logger[_0x9854('0x8b')](_0x9854('0x8c'),_0x4d3ff3['toString']());require(_0x9854('0x8d'))[_0x9854('0x8e')](path[_0x9854('0x4c')](__dirname,'../../components/export/',_0x2f693f[_0x9854('0x84')]),[_0x2f693f['id'],_0x4d3ff3['toString'](),path['join'](__dirname,_0x9854('0x8f'),_0x2f693f[_0x9854('0x90')]),_0x186359]);return _0x2f693f;}else{var _0x42feae=squel['select']();_0x42feae[_0x9854('0x91')]('('+_0x4d3ff3[_0x9854('0x79')]()+')',_0x9854('0x92'));_0x42feae[_0x9854('0x61')](_0x9854('0x93'),_0x9854('0x1b'));_0x4d3ff3[_0x9854('0x1a')](_0x479441['limit']||_0x4f4b46);_0x4d3ff3[_0x9854('0x18')](_0x479441['offset']||0x0);return dbH[_0x9854('0x7a')]['query'](_0x42feae[_0x9854('0x79')](),{'type':dbH[_0x9854('0x7a')][_0x9854('0x7b')]['SELECT']})[_0x9854('0x1f')](function(_0x6a03a3){if(!_0x6a03a3[_0x9854('0x41')]){_0x4d9a01=0x0;}else{_0x4d9a01=_0x6a03a3[0x0]['count']||0x0;}return dbH[_0x9854('0x7a')][_0x9854('0x2c')](_0x4d3ff3[_0x9854('0x79')](),{'type':dbH[_0x9854('0x7a')][_0x9854('0x7b')][_0x9854('0x94')]});})[_0x9854('0x1f')](function(_0x2e0021){return{'rows':_0x2e0021||[],'count':_0x4d9a01};});}});}exports[_0x9854('0x95')]=function(_0x49c5fb,_0x5e50e6){return runReport(_0x49c5fb[_0x9854('0x4b')],_0x49c5fb[_0x9854('0x2c')],_0x49c5fb['options'])[_0x9854('0x1f')](respondWithResult(_0x5e50e6,null))[_0x9854('0x3f')](handleError(_0x5e50e6,null));};exports[_0x9854('0x96')]=runReport;exports[_0x9854('0x2c')]=function(_0x50d6b5,_0x501867){var _0x51dccf=0xa;var _0x38c465=[_0x9854('0x4c'),_0x9854('0x97'),_0x9854('0x4d'),'cross_join'];var _0x1259d2={'SUM':_0x9854('0x7c'),'COUNT':_0x9854('0x4e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x9854('0x53'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9854('0x55')};var _0x17073e={'SEC_TO_TIME':_0x9854('0x56'),'DATE':'DATE(%s)','HOUR':_0x9854('0x57'),'ROUND':_0x9854('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x387eee=function(_0x36ad48){return!_[_0x9854('0x5a')]([_0x9854('0x5b'),_0x9854('0x5c'),_0x9854('0x7d'),'IS\x20NOT\x20EMPTY'],_0x36ad48);};var _0x508aae=function(_0x6b4ba3){if(!_0x6b4ba3||!_0x6b4ba3[_0x9854('0x5e')][_0x9854('0x41')]){return'';}for(var _0x2e7d3a='(',_0x4d7231=0x0;_0x4d7231<_0x6b4ba3[_0x9854('0x5e')]['length'];_0x4d7231+=0x1){_0x4d7231>0x0&&(_0x2e7d3a+='\x20'+_0x6b4ba3['operator']+'\x20');_0x2e7d3a+=_0x6b4ba3[_0x9854('0x5e')][_0x4d7231][_0x9854('0x60')]?_0x508aae(_0x6b4ba3[_0x9854('0x5e')][_0x4d7231]['group']):_0x6b4ba3['rules'][_0x4d7231][_0x9854('0x61')]+'\x20'+_0x6b4ba3['rules'][_0x4d7231]['condition']+(_0x387eee(_0x6b4ba3[_0x9854('0x5e')][_0x4d7231][_0x9854('0x62')])?'\x20'+_0x6b4ba3[_0x9854('0x5e')][_0x4d7231]['value']:'');}return _0x2e7d3a+')';};var _0x8ef1ef={'where':{'id':_0x50d6b5['params']['id']}},_0xead8c,_0x51945f,_0x226f11,_0x3951e1,_0x55e962;_0x8ef1ef=_['merge']({},_0x8ef1ef,_0x50d6b5[_0x9854('0x3a')]);return db['AnalyticCustomReport'][_0x9854('0x42')](_0x8ef1ef)[_0x9854('0x1f')](function(_0x2d564e){if(_0x2d564e){_0xead8c=_0x2d564e;return _0x2d564e['getFields']();}return null;})[_0x9854('0x1f')](function(_0x51adea){if(_0x51adea){if(!_0x51adea[_0x9854('0x41')]){throw new db[(_0x9854('0x64'))][(_0x9854('0x98'))](_0x9854('0x65'),0x193);}_0x51945f=_0x51adea;return db[_0x9854('0x66')][_0x9854('0x3d')]({'raw':!![]});}return null;})[_0x9854('0x1f')](function(_0x4b06a6){if(_0x4b06a6){_0x226f11=_['keyBy'](_0x4b06a6,'id');var _0x19ca3b;var _0x55efde=squel[_0x9854('0x67')]();_0x55efde[_0x9854('0x91')](_0xead8c[_0x9854('0x68')]);for(var _0x5c26b5=0x0;_0x5c26b5<_0x51945f[_0x9854('0x41')];_0x5c26b5+=0x1){_0x19ca3b=_0x51945f[_0x5c26b5][_0x9854('0x69')]?_0x226f11[_0x51945f[_0x5c26b5]['MetricId']][_0x9854('0x6a')]:_0x51945f[_0x5c26b5][_0x9854('0x61')];_0x19ca3b=_0x51945f[_0x5c26b5][_0x9854('0x6b')]?_[_0x9854('0x6d')](_0x1259d2[_0x51945f[_0x5c26b5][_0x9854('0x6b')]],'%s',_0x19ca3b):_0x19ca3b;_0x19ca3b=_0x51945f[_0x5c26b5]['format']?_[_0x9854('0x6d')](_0x17073e[_0x51945f[_0x5c26b5][_0x9854('0x6c')]],'%s',_0x19ca3b):_0x19ca3b;if(_0x51945f[_0x5c26b5][_0x9854('0x6e')]){_0x55efde[_0x9854('0x60')](_0x19ca3b);}_0x51945f[_0x5c26b5]['orderBy']&&_0x55efde[_0x9854('0x34')](_0x19ca3b,_0x51945f[_0x5c26b5]['orderBy']==='DESC'?![]:!![]);_0x55efde[_0x9854('0x61')](_0x19ca3b,_0x51945f[_0x5c26b5][_0x9854('0x71')]||_0x19ca3b);}if(_0xead8c[_0x9854('0x72')]){_0xead8c['joins']=JSON['parse'](_0xead8c[_0x9854('0x72')]);for(var _0x4d976a=0x0;_0x4d976a<_0xead8c[_0x9854('0x72')][_0x9854('0x41')];_0x4d976a+=0x1){if(_0xead8c[_0x9854('0x72')][_0x4d976a][_0x9854('0x38')]&&_['includes'](_0x38c465,_0xead8c['joins'][_0x4d976a]['type'])&&_0xead8c[_0x9854('0x72')][_0x4d976a]['parentKey']&&_0xead8c[_0x9854('0x72')][_0x4d976a][_0x9854('0x75')]&&_0xead8c['joins'][_0x4d976a][_0x9854('0x80')]){_0x55efde[_0xead8c['joins'][_0x4d976a][_0x9854('0x38')]](_0xead8c['joins'][_0x4d976a][_0x9854('0x75')],null,util['format']('%s.%s\x20=\x20%s.%s',_0xead8c['table'],_0xead8c[_0x9854('0x72')][_0x4d976a][_0x9854('0x74')],_0xead8c[_0x9854('0x72')][_0x4d976a][_0x9854('0x75')],_0xead8c[_0x9854('0x72')][_0x4d976a]['foreignKey']));}}}if(_0xead8c[_0x9854('0x77')]){_0xead8c[_0x9854('0x77')]=JSON['parse'](_0xead8c['conditions']);_0x55efde[_0x9854('0x37')](_0x508aae(_0xead8c['conditions'][_0x9854('0x60')]));}_0x55e962=_0x55efde[_0x9854('0x81')]();_0x55efde[_0x9854('0x1a')](_0x51dccf);_0x55efde[_0x9854('0x18')](0x0);logger[_0x9854('0x78')](_0x9854('0x99'),_0x55efde['toString']());return dbH[_0x9854('0x7a')][_0x9854('0x2c')](_0x55efde[_0x9854('0x79')](),{'type':dbH['sequelize'][_0x9854('0x7b')][_0x9854('0x94')]});}})[_0x9854('0x1f')](function(){return{'sql':_0x55e962[_0x9854('0x79')]()};})['then'](respondWithResult(_0x501867,null))[_0x9854('0x3f')](handleError(_0x501867,null));}; \ No newline at end of file +var _0xf71f=['VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','function','replace','orderBy','order','DESC','alias','joins','includes','parentKey','foreignTable','format','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','cross_join','MIN(%s)','ROUND(%s)','condition','metric','parse','foreignKey','output','web','%s-%s.%s','randomstring','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','groupBy','clone','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','undefined','count','offset','limit','set','apply','reject','save','then','get','CustomReports','UserProfileResource','destroy','end','sendStatus','error','send','index','map','AnalyticCustomReport','rawAttributes','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','merge','where','type'];(function(_0x5f2ae8,_0x47f1e5){var _0x4c268d=function(_0x5c59b9){while(--_0x5c59b9){_0x5f2ae8['push'](_0x5f2ae8['shift']());}};_0x4c268d(++_0x47f1e5);}(_0xf71f,0x1ab));var _0xff71=function(_0x2ff43c,_0x4ea77d){_0x2ff43c=_0x2ff43c-0x0;var _0x2f963e=_0xf71f[_0x2ff43c];return _0x2f963e;};'use strict';var emlformat=require(_0xff71('0x0'));var rimraf=require(_0xff71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff71('0x2'));var rp=require(_0xff71('0x3'));var moment=require(_0xff71('0x4'));var BPromise=require(_0xff71('0x5'));var Mustache=require(_0xff71('0x6'));var util=require('util');var path=require(_0xff71('0x7'));var sox=require(_0xff71('0x8'));var csv=require(_0xff71('0x9'));var ejs=require(_0xff71('0xa'));var fs=require('fs');var fs_extra=require(_0xff71('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff71('0xc'));var jsforce=require(_0xff71('0xd'));var deskjs=require(_0xff71('0xe'));var toCsv=require(_0xff71('0x9'));var querystring=require(_0xff71('0xf'));var Papa=require(_0xff71('0x10'));var Redis=require('ioredis');var authService=require(_0xff71('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xff71('0x12'));var utils=require(_0xff71('0x13'));var config=require(_0xff71('0x14'));var licenseUtil=require(_0xff71('0x15'));var db=require(_0xff71('0x16'))['db'];var dbH=require('../../mysqldb')[_0xff71('0x17')];function respondWithStatusCode(_0xff5f,_0x583492){_0x583492=_0x583492||0xcc;return function(_0x299142){if(_0x299142){return _0xff5f['sendStatus'](_0x583492);}return _0xff5f[_0xff71('0x18')](_0x583492)['end']();};}function respondWithResult(_0x485739,_0x4407d2){_0x4407d2=_0x4407d2||0xc8;return function(_0x58c67c){if(_0x58c67c){return _0x485739[_0xff71('0x18')](_0x4407d2)[_0xff71('0x19')](_0x58c67c);}};}function respondWithFilteredResult(_0x3b7899,_0x1122fd){return function(_0x2ca59e){if(_0x2ca59e){var _0x5ceaff=typeof _0x1122fd['offset']===_0xff71('0x1a')&&typeof _0x1122fd['limit']===_0xff71('0x1a');var _0x172ffd=_0x2ca59e[_0xff71('0x1b')];var _0x223b5c=_0x5ceaff?0x0:_0x1122fd['offset'];var _0x50321e=_0x5ceaff?_0x2ca59e[_0xff71('0x1b')]:_0x1122fd[_0xff71('0x1c')]+_0x1122fd[_0xff71('0x1d')];var _0x13f2c8;if(_0x50321e>=_0x172ffd){_0x50321e=_0x172ffd;_0x13f2c8=0xc8;}else{_0x13f2c8=0xce;}_0x3b7899[_0xff71('0x18')](_0x13f2c8);return _0x3b7899[_0xff71('0x1e')]('Content-Range',_0x223b5c+'-'+_0x50321e+'/'+_0x172ffd)['json'](_0x2ca59e);}return null;};}function patchUpdates(_0x1d5b0e){return function(_0x534488){try{jsonpatch[_0xff71('0x1f')](_0x534488,_0x1d5b0e,!![]);}catch(_0x412bb8){return BPromise[_0xff71('0x20')](_0x412bb8);}return _0x534488[_0xff71('0x21')]();};}function saveUpdates(_0x40279a,_0x182fc6){return function(_0x3fd6d0){if(_0x3fd6d0){return _0x3fd6d0['update'](_0x40279a)[_0xff71('0x22')](function(_0x3fb32d){return _0x3fb32d;});}return null;};}function removeEntity(_0x1b88ba,_0x4904a5){return function(_0x5c7d8a){if(_0x5c7d8a){return _0x5c7d8a['destroy']()[_0xff71('0x22')](function(){var _0x1da5ff=_0x5c7d8a[_0xff71('0x23')]({'plain':!![]});var _0x5566ad=_0xff71('0x24');return db[_0xff71('0x25')][_0xff71('0x26')]({'where':{'type':_0x5566ad,'resourceId':_0x1da5ff['id']}})['then'](function(){return _0x5c7d8a;});})[_0xff71('0x22')](function(){_0x1b88ba[_0xff71('0x18')](0xcc)[_0xff71('0x27')]();});}};}function handleEntityNotFound(_0x59443c,_0xe04388){return function(_0x30c1ca){if(!_0x30c1ca){_0x59443c[_0xff71('0x28')](0x194);}return _0x30c1ca;};}function handleError(_0x5a5c11,_0xc9cb09){_0xc9cb09=_0xc9cb09||0x1f4;return function(_0x5be7f8){logger[_0xff71('0x29')](_0x5be7f8['stack']);if(_0x5be7f8['name']){delete _0x5be7f8['name'];}_0x5a5c11[_0xff71('0x18')](_0xc9cb09)[_0xff71('0x2a')](_0x5be7f8);};}exports[_0xff71('0x2b')]=function(_0x4c4067,_0x2d2fb1){var _0x4be3f3={},_0x1d19e6={},_0x3cc8fd={'count':0x0,'rows':[]};var _0xae0194=_[_0xff71('0x2c')](db[_0xff71('0x2d')][_0xff71('0x2e')],function(_0x353d3a){return{'name':_0x353d3a['fieldName'],'type':_0x353d3a['type']['key']};});_0x1d19e6[_0xff71('0x2f')]=_['map'](_0xae0194,_0xff71('0x30'));_0x1d19e6['query']=_[_0xff71('0x31')](_0x4c4067[_0xff71('0x32')]);_0x1d19e6['filters']=_[_0xff71('0x33')](_0x1d19e6[_0xff71('0x2f')],_0x1d19e6[_0xff71('0x32')]);_0x4be3f3[_0xff71('0x34')]=_[_0xff71('0x33')](_0x1d19e6[_0xff71('0x2f')],qs[_0xff71('0x35')](_0x4c4067[_0xff71('0x32')]['fields']));_0x4be3f3[_0xff71('0x34')]=_0x4be3f3[_0xff71('0x34')][_0xff71('0x36')]?_0x4be3f3[_0xff71('0x34')]:_0x1d19e6[_0xff71('0x2f')];if(!_0x4c4067[_0xff71('0x32')][_0xff71('0x37')]('nolimit')){_0x4be3f3['limit']=qs['limit'](_0x4c4067[_0xff71('0x32')][_0xff71('0x1d')]);_0x4be3f3['offset']=qs[_0xff71('0x1c')](_0x4c4067['query'][_0xff71('0x1c')]);}_0x4be3f3['order']=qs[_0xff71('0x38')](_0x4c4067['query'][_0xff71('0x38')]);_0x4be3f3['where']=qs[_0xff71('0x39')](_[_0xff71('0x3a')](_0x4c4067[_0xff71('0x32')],_0x1d19e6[_0xff71('0x39')]),_0xae0194);if(_0x4c4067[_0xff71('0x32')]['filter']){_0x4be3f3['where']=_[_0xff71('0x3b')](_0x4be3f3[_0xff71('0x3c')],{'$or':_[_0xff71('0x2c')](_0xae0194,function(_0x54a387){if(_0x54a387[_0xff71('0x3d')]!==_0xff71('0x3e')){var _0x1e99cc={};_0x1e99cc[_0x54a387[_0xff71('0x30')]]={'$like':'%'+_0x4c4067['query'][_0xff71('0x3f')]+'%'};return _0x1e99cc;}})});}_0x4be3f3=_[_0xff71('0x3b')]({},_0x4be3f3,_0x4c4067[_0xff71('0x40')]);var _0x20c3fb={'where':_0x4be3f3[_0xff71('0x3c')]};return db['AnalyticCustomReport'][_0xff71('0x1b')](_0x20c3fb)['then'](function(_0x4816df){_0x3cc8fd['count']=_0x4816df;if(_0x4c4067[_0xff71('0x32')][_0xff71('0x41')]){_0x4be3f3['include']=[{'all':!![]}];}return db[_0xff71('0x2d')][_0xff71('0x42')](_0x4be3f3);})[_0xff71('0x22')](function(_0x21cf5f){_0x3cc8fd[_0xff71('0x43')]=_0x21cf5f;return _0x3cc8fd;})[_0xff71('0x22')](respondWithFilteredResult(_0x2d2fb1,_0x4be3f3))[_0xff71('0x44')](handleError(_0x2d2fb1,null));};exports[_0xff71('0x45')]=function(_0x33d70e,_0x1c09b1){var _0x9e3528={'raw':![],'where':{'id':_0x33d70e[_0xff71('0x46')]['id']}},_0x2e5d59={};_0x2e5d59[_0xff71('0x2f')]=_[_0xff71('0x31')](db[_0xff71('0x2d')][_0xff71('0x2e')]);_0x2e5d59['query']=_[_0xff71('0x31')](_0x33d70e['query']);_0x2e5d59[_0xff71('0x39')]=_[_0xff71('0x33')](_0x2e5d59[_0xff71('0x2f')],_0x2e5d59[_0xff71('0x32')]);_0x9e3528[_0xff71('0x34')]=_['intersection'](_0x2e5d59[_0xff71('0x2f')],qs[_0xff71('0x35')](_0x33d70e[_0xff71('0x32')]['fields']));_0x9e3528[_0xff71('0x34')]=_0x9e3528[_0xff71('0x34')][_0xff71('0x36')]?_0x9e3528[_0xff71('0x34')]:_0x2e5d59['model'];if(_0x33d70e[_0xff71('0x32')][_0xff71('0x41')]){_0x9e3528['include']=[{'all':!![]}];}_0x9e3528=_['merge']({},_0x9e3528,_0x33d70e[_0xff71('0x40')]);return db[_0xff71('0x2d')][_0xff71('0x47')](_0x9e3528)[_0xff71('0x22')](handleEntityNotFound(_0x1c09b1,null))['then'](respondWithResult(_0x1c09b1,null))[_0xff71('0x44')](handleError(_0x1c09b1,null));};exports[_0xff71('0x48')]=function(_0x24fb7e,_0x17d4b6){return db[_0xff71('0x2d')]['create'](_0x24fb7e[_0xff71('0x49')],{})[_0xff71('0x22')](function(_0x3f075d){var _0x17d67e=_0x24fb7e[_0xff71('0x4a')][_0xff71('0x23')]({'plain':!![]});if(!_0x17d67e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17d67e['role']==='user'){var _0x969d1a=_0x3f075d['get']({'plain':!![]});var _0x38eef2='Reports';return db['UserProfileSection'][_0xff71('0x47')]({'where':{'name':_0x38eef2,'userProfileId':_0x17d67e[_0xff71('0x4b')]},'raw':!![]})[_0xff71('0x22')](function(_0x241890){if(_0x241890&&_0x241890[_0xff71('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x969d1a[_0xff71('0x30')],'resourceId':_0x969d1a['id'],'type':_0xff71('0x24'),'sectionId':_0x241890['id']},{})[_0xff71('0x22')](function(){return _0x3f075d;});}else{return _0x3f075d;}})[_0xff71('0x44')](function(_0x55fda7){logger['error'](_0xff71('0x4d'),_0x55fda7);throw _0x55fda7;});}return _0x3f075d;})['then'](respondWithResult(_0x17d4b6,0xc9))[_0xff71('0x44')](handleError(_0x17d4b6,null));};exports[_0xff71('0x4e')]=function(_0x9c781f,_0x4eae57){if(_0x9c781f[_0xff71('0x49')]['id']){delete _0x9c781f[_0xff71('0x49')]['id'];}return db['AnalyticCustomReport'][_0xff71('0x47')]({'where':{'id':_0x9c781f[_0xff71('0x46')]['id']}})[_0xff71('0x22')](handleEntityNotFound(_0x4eae57,null))[_0xff71('0x22')](saveUpdates(_0x9c781f[_0xff71('0x49')],null))[_0xff71('0x22')](respondWithResult(_0x4eae57,null))[_0xff71('0x44')](handleError(_0x4eae57,null));};exports[_0xff71('0x26')]=function(_0x56b74f,_0x4bc200){return db[_0xff71('0x2d')][_0xff71('0x47')]({'where':{'id':_0x56b74f[_0xff71('0x46')]['id']}})[_0xff71('0x22')](handleEntityNotFound(_0x4bc200,null))[_0xff71('0x22')](removeEntity(_0x4bc200,null))['catch'](handleError(_0x4bc200,null));};exports[_0xff71('0x4f')]=function(_0x2c1b35,_0x5473c9){var _0x443e8f=0xa;var _0x350527=[_0xff71('0x50'),'left_join',_0xff71('0x51'),'cross_join'];var _0x321393={'SUM':_0xff71('0x52'),'COUNT':_0xff71('0x53'),'COUNT DISTINCT':_0xff71('0x54'),'MAX':_0xff71('0x55'),'MIN':'MIN(%s)','AVG':_0xff71('0x56'),'GROUP_CONCAT':_0xff71('0x57'),'GROUP_CONCAT ASC':_0xff71('0x58'),'GROUP_CONCAT DESC':_0xff71('0x59')};var _0x537722={'SEC_TO_TIME':_0xff71('0x5a'),'DATE':'DATE(%s)','HOUR':_0xff71('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xff71('0x5c')};var _0xd08266=function(_0x1977db){return!_['includes']([_0xff71('0x5d'),_0xff71('0x5e'),_0xff71('0x5f'),_0xff71('0x60')],_0x1977db);};var _0x229a6c=function(_0x564d1a){if(!_0x564d1a||!_0x564d1a[_0xff71('0x61')][_0xff71('0x36')]){return'';}for(var _0x1582e3='(',_0x3dfb55=0x0;_0x3dfb55<_0x564d1a['rules']['length'];_0x3dfb55+=0x1){_0x3dfb55>0x0&&(_0x1582e3+='\x20'+_0x564d1a[_0xff71('0x62')]+'\x20');_0x1582e3+=_0x564d1a[_0xff71('0x61')][_0x3dfb55][_0xff71('0x63')]?_0x229a6c(_0x564d1a[_0xff71('0x61')][_0x3dfb55][_0xff71('0x63')]):_0x564d1a[_0xff71('0x61')][_0x3dfb55][_0xff71('0x64')]+'\x20'+_0x564d1a['rules'][_0x3dfb55]['condition']+(_0xd08266(_0x564d1a[_0xff71('0x61')][_0x3dfb55]['condition'])?'\x20'+_0x564d1a['rules'][_0x3dfb55][_0xff71('0x65')]:'');}return _0x1582e3+')';};var _0x90d0b0={'where':{'id':_0x2c1b35['params']['id']}},_0x203130,_0xfb98e,_0x191276,_0x2369d9,_0x23b515;_0x90d0b0=_[_0xff71('0x3b')]({},_0x90d0b0,_0x2c1b35[_0xff71('0x40')]);return db[_0xff71('0x2d')][_0xff71('0x47')](_0x90d0b0)[_0xff71('0x22')](function(_0x2dc4b2){if(_0x2dc4b2){_0x203130=_0x2dc4b2;return _0x2dc4b2[_0xff71('0x66')]();}return null;})['then'](function(_0x555e5c){if(_0x555e5c){if(!_0x555e5c[_0xff71('0x36')]){throw new db[(_0xff71('0x67'))][(_0xff71('0x68'))](_0xff71('0x69'),0x193);}_0xfb98e=_0x555e5c;return db[_0xff71('0x6a')][_0xff71('0x42')]({'raw':!![]});}return null;})[_0xff71('0x22')](function(_0x360861){if(_0x360861){_0x191276=_['keyBy'](_0x360861,'id');var _0x2408d3;var _0x5a5ef0=squel[_0xff71('0x6b')]();_0x5a5ef0[_0xff71('0x6c')](_0x203130[_0xff71('0x6d')]);for(var _0x4958a9=0x0;_0x4958a9<_0xfb98e[_0xff71('0x36')];_0x4958a9+=0x1){_0x2408d3=_0xfb98e[_0x4958a9][_0xff71('0x6e')]?_0x191276[_0xfb98e[_0x4958a9]['MetricId']]['metric']:_0xfb98e[_0x4958a9][_0xff71('0x64')];_0x2408d3=_0xfb98e[_0x4958a9][_0xff71('0x6f')]?_['replace'](_0x321393[_0xfb98e[_0x4958a9][_0xff71('0x6f')]],'%s',_0x2408d3):_0x2408d3;_0x2408d3=_0xfb98e[_0x4958a9]['format']?_[_0xff71('0x70')](_0x537722[_0xfb98e[_0x4958a9]['format']],'%s',_0x2408d3):_0x2408d3;if(_0xfb98e[_0x4958a9]['groupBy']){_0x5a5ef0[_0xff71('0x63')](_0x2408d3);}_0xfb98e[_0x4958a9][_0xff71('0x71')]&&_0x5a5ef0[_0xff71('0x72')](_0x2408d3,_0xfb98e[_0x4958a9][_0xff71('0x71')]===_0xff71('0x73')?![]:!![]);_0x5a5ef0[_0xff71('0x64')](_0x2408d3,_0xfb98e[_0x4958a9][_0xff71('0x74')]||_0x2408d3);}if(_0x203130[_0xff71('0x75')]){_0x203130[_0xff71('0x75')]=JSON['parse'](_0x203130[_0xff71('0x75')]);for(var _0x2e14c9=0x0;_0x2e14c9<_0x203130[_0xff71('0x75')][_0xff71('0x36')];_0x2e14c9+=0x1){if(_0x203130[_0xff71('0x75')][_0x2e14c9]['type']&&_[_0xff71('0x76')](_0x350527,_0x203130[_0xff71('0x75')][_0x2e14c9][_0xff71('0x3d')])&&_0x203130[_0xff71('0x75')][_0x2e14c9][_0xff71('0x77')]&&_0x203130[_0xff71('0x75')][_0x2e14c9]['foreignTable']&&_0x203130[_0xff71('0x75')][_0x2e14c9]['foreignKey']){_0x5a5ef0[_0x203130['joins'][_0x2e14c9][_0xff71('0x3d')]](_0x203130[_0xff71('0x75')][_0x2e14c9][_0xff71('0x78')],null,util[_0xff71('0x79')](_0xff71('0x7a'),_0x203130['table'],_0x203130[_0xff71('0x75')][_0x2e14c9][_0xff71('0x77')],_0x203130[_0xff71('0x75')][_0x2e14c9][_0xff71('0x78')],_0x203130[_0xff71('0x75')][_0x2e14c9]['foreignKey']));}}}if(_0x203130['conditions']){_0x203130[_0xff71('0x7b')]=JSON['parse'](_0x203130[_0xff71('0x7b')]);_0x5a5ef0[_0xff71('0x3c')](_0x229a6c(_0x203130[_0xff71('0x7b')]['group']));}_0x23b515=_0x5a5ef0['clone']();_0x5a5ef0[_0xff71('0x1d')](_0x443e8f);_0x5a5ef0[_0xff71('0x1c')](0x0);logger[_0xff71('0x7c')](_0xff71('0x7d'),_0x5a5ef0['toString']());return dbH[_0xff71('0x7e')][_0xff71('0x32')](_0x5a5ef0[_0xff71('0x7f')](),{'type':dbH['sequelize'][_0xff71('0x80')][_0xff71('0x81')]});}})[_0xff71('0x22')](respondWithResult(_0x5473c9,null))['catch'](handleError(_0x5473c9,null));};function runReport(_0x50efe6,_0xe858ef,_0x250c00){var _0x294d97=_0xe858ef[_0xff71('0x30')];var _0x5d268c=0xa;var _0x3fd4d8=[_0xff71('0x50'),_0xff71('0x82'),_0xff71('0x51'),_0xff71('0x83')];var _0xdc00d1={'SUM':_0xff71('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xff71('0x55'),'MIN':_0xff71('0x84'),'AVG':_0xff71('0x56'),'GROUP_CONCAT':_0xff71('0x57'),'GROUP_CONCAT ASC':_0xff71('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x144f7b={'SEC_TO_TIME':_0xff71('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xff71('0x85'),'UNIX_TIMESTAMP':_0xff71('0x5c')};var _0x3d3aa1=function(_0x1a0905){return!_[_0xff71('0x76')]([_0xff71('0x5d'),_0xff71('0x5e'),_0xff71('0x5f'),_0xff71('0x60')],_0x1a0905);};var _0x1e565b=function(_0x32f160){if(!_0x32f160||!_0x32f160[_0xff71('0x61')][_0xff71('0x36')]){return'';}for(var _0x473f68='(',_0x24faa7=0x0;_0x24faa7<_0x32f160[_0xff71('0x61')][_0xff71('0x36')];_0x24faa7+=0x1){_0x24faa7>0x0&&(_0x473f68+='\x20'+_0x32f160[_0xff71('0x62')]+'\x20');_0x473f68+=_0x32f160['rules'][_0x24faa7][_0xff71('0x63')]?_0x1e565b(_0x32f160[_0xff71('0x61')][_0x24faa7][_0xff71('0x63')]):_0x32f160[_0xff71('0x61')][_0x24faa7][_0xff71('0x64')]+'\x20'+_0x32f160[_0xff71('0x61')][_0x24faa7][_0xff71('0x86')]+(_0x3d3aa1(_0x32f160['rules'][_0x24faa7][_0xff71('0x86')])?'\x20'+_0x32f160[_0xff71('0x61')][_0x24faa7][_0xff71('0x65')]:'');}return _0x473f68+')';};var _0x36ef9f={'where':{'id':_0x50efe6['id']}},_0x1254d4,_0x323985,_0xf19243,_0x586caa,_0x2775ad;_0x36ef9f=_[_0xff71('0x3b')]({},_0x36ef9f,_0x250c00);return db['AnalyticCustomReport']['find'](_0x36ef9f)[_0xff71('0x22')](function(_0x16c971){if(_0x16c971){_0x1254d4=_0x16c971;return _0x16c971[_0xff71('0x66')]();}return null;})[_0xff71('0x22')](function(_0x29bdfc){if(_0x29bdfc){if(!_0x29bdfc['length']){throw new db[(_0xff71('0x67'))]['ValidationErrorItem'](_0xff71('0x69'),0x193);}_0x323985=_0x29bdfc;return db[_0xff71('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xff71('0x22')](function(_0x342bf8){if(_0x342bf8){_0xf19243=_['keyBy'](_0x342bf8,'id');var _0x4f2fa1;var _0x2ea90a=squel[_0xff71('0x6b')]();_0x2ea90a['from'](_0x1254d4[_0xff71('0x6d')]);for(var _0x183c17=0x0;_0x183c17<_0x323985['length'];_0x183c17+=0x1){_0x4f2fa1=_0x323985[_0x183c17]['MetricId']?_0xf19243[_0x323985[_0x183c17][_0xff71('0x6e')]][_0xff71('0x87')]:_0x323985[_0x183c17][_0xff71('0x64')];_0x4f2fa1=_0x323985[_0x183c17][_0xff71('0x6f')]?_[_0xff71('0x70')](_0xdc00d1[_0x323985[_0x183c17][_0xff71('0x6f')]],'%s',_0x4f2fa1):_0x4f2fa1;_0x4f2fa1=_0x323985[_0x183c17][_0xff71('0x79')]?_['replace'](_0x144f7b[_0x323985[_0x183c17][_0xff71('0x79')]],'%s',_0x4f2fa1):_0x4f2fa1;if(_0x323985[_0x183c17]['groupBy']){_0x2ea90a[_0xff71('0x63')](_0x4f2fa1);}_0x323985[_0x183c17][_0xff71('0x71')]&&_0x2ea90a[_0xff71('0x72')](_0x4f2fa1,_0x323985[_0x183c17][_0xff71('0x71')]===_0xff71('0x73')?![]:!![]);_0x2ea90a[_0xff71('0x64')](_0x4f2fa1,_0x323985[_0x183c17][_0xff71('0x74')]||_0x4f2fa1);}if(_0x1254d4[_0xff71('0x75')]){_0x1254d4['joins']=JSON[_0xff71('0x88')](_0x1254d4[_0xff71('0x75')]);for(var _0x45ec33=0x0;_0x45ec33<_0x1254d4[_0xff71('0x75')][_0xff71('0x36')];_0x45ec33+=0x1){if(_0x1254d4[_0xff71('0x75')][_0x45ec33]['type']&&_[_0xff71('0x76')](_0x3fd4d8,_0x1254d4[_0xff71('0x75')][_0x45ec33]['type'])&&_0x1254d4[_0xff71('0x75')][_0x45ec33]['parentKey']&&_0x1254d4['joins'][_0x45ec33][_0xff71('0x78')]&&_0x1254d4[_0xff71('0x75')][_0x45ec33][_0xff71('0x89')]){_0x2ea90a[_0x1254d4['joins'][_0x45ec33][_0xff71('0x3d')]](_0x1254d4[_0xff71('0x75')][_0x45ec33][_0xff71('0x78')],null,util[_0xff71('0x79')](_0xff71('0x7a'),_0x1254d4[_0xff71('0x6d')],_0x1254d4[_0xff71('0x75')][_0x45ec33]['parentKey'],_0x1254d4['joins'][_0x45ec33][_0xff71('0x78')],_0x1254d4[_0xff71('0x75')][_0x45ec33][_0xff71('0x89')]));}}}if(_0x1254d4[_0xff71('0x7b')]){_0x1254d4[_0xff71('0x7b')]=JSON['parse'](_0x1254d4[_0xff71('0x7b')]);_0x2ea90a[_0xff71('0x3c')](_0x1e565b(_0x1254d4[_0xff71('0x7b')][_0xff71('0x63')]));}_0x2775ad=_0x2ea90a['clone']();_0x2ea90a[_0xff71('0x1d')](_0x5d268c);_0x2ea90a['offset'](0x0);return;}})[_0xff71('0x22')](function(){if(_0xe858ef[_0xff71('0x8a')]===_0xff71('0x8b')){return null;}var _0x13c38f=_[_0xff71('0x3b')](_0xe858ef,{'name':_0xe858ef['fullPath']||_0xe858ef['name']||_0x1254d4[_0xff71('0x30')],'basename':_0x294d97,'savename':util['format'](_0xff71('0x8c'),_0xe858ef[_0xff71('0x30')]||_0x1254d4[_0xff71('0x30')],require(_0xff71('0x8d'))['generate'](0x4),_0xe858ef[_0xff71('0x8a')]||_0xff71('0x8e')),'reportId':_0x1254d4['id'],'reportType':'custom'});return db['AnalyticExtractedReport']['create'](_0x13c38f,{'raw':!![]});})['then'](function(_0x2ef04d){if(_0x1254d4[_0xff71('0x6d')]===_0xff71('0x8f')){_0x2775ad['where'](_0x1254d4[_0xff71('0x6d')]+_0xff71('0x90'),_0xe858ef[_0xff71('0x91')],_0xe858ef['endDate']);}else{_0x2775ad[_0xff71('0x3c')](_0x1254d4[_0xff71('0x6d')]+_0xff71('0x92'),_0xe858ef[_0xff71('0x91')],_0xe858ef[_0xff71('0x93')]);}if(_0x2ef04d){logger[_0xff71('0x94')](_0xff71('0x95'),_0x2775ad['toString']());require(_0xff71('0x96'))[_0xff71('0x97')](path[_0xff71('0x50')](__dirname,_0xff71('0x98'),_0x2ef04d[_0xff71('0x8a')]),[_0x2ef04d['id'],_0x2775ad['toString'](),path[_0xff71('0x50')](__dirname,_0xff71('0x99'),_0x2ef04d[_0xff71('0x9a')]),_0x294d97]);return _0x2ef04d;}else{var _0x370736=squel['select']();_0x370736[_0xff71('0x6c')]('('+_0x2775ad[_0xff71('0x7f')]()+')',_0xff71('0x9b'));_0x370736[_0xff71('0x64')](_0xff71('0x9c'),_0xff71('0x1b'));_0x2775ad[_0xff71('0x1d')](_0xe858ef['limit']||_0x5d268c);_0x2775ad['offset'](_0xe858ef[_0xff71('0x1c')]||0x0);return dbH[_0xff71('0x7e')]['query'](_0x370736['toString'](),{'type':dbH[_0xff71('0x7e')][_0xff71('0x80')][_0xff71('0x81')]})[_0xff71('0x22')](function(_0x8d6b6){if(!_0x8d6b6[_0xff71('0x36')]){_0x586caa=0x0;}else{_0x586caa=_0x8d6b6[0x0][_0xff71('0x1b')]||0x0;}return dbH['sequelize']['query'](_0x2775ad[_0xff71('0x7f')](),{'type':dbH[_0xff71('0x7e')][_0xff71('0x80')][_0xff71('0x81')]});})[_0xff71('0x22')](function(_0xb77729){return{'rows':_0xb77729||[],'count':_0x586caa};});}});}exports[_0xff71('0x9d')]=function(_0x3cb250,_0xb35010){return runReport(_0x3cb250[_0xff71('0x46')],_0x3cb250[_0xff71('0x32')],_0x3cb250['options'])['then'](respondWithResult(_0xb35010,null))[_0xff71('0x44')](handleError(_0xb35010,null));};exports[_0xff71('0x9e')]=runReport;exports[_0xff71('0x32')]=function(_0x1ea35b,_0x260599){var _0x352dab=0xa;var _0x5c1b7a=[_0xff71('0x50'),_0xff71('0x82'),'right_join',_0xff71('0x83')];var _0x5e34e7={'SUM':'SUM(%s)','COUNT':_0xff71('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xff71('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xff71('0x57'),'GROUP_CONCAT ASC':_0xff71('0x58'),'GROUP_CONCAT DESC':_0xff71('0x59')};var _0x56f411={'SEC_TO_TIME':_0xff71('0x5a'),'DATE':_0xff71('0x9f'),'HOUR':'HOUR(%s)','ROUND':_0xff71('0x85'),'UNIX_TIMESTAMP':_0xff71('0x5c')};var _0x2b9fec=function(_0x46ee1b){return!_[_0xff71('0x76')]([_0xff71('0x5d'),_0xff71('0x5e'),_0xff71('0x5f'),_0xff71('0x60')],_0x46ee1b);};var _0x2e5cfb=function(_0x282be1){if(!_0x282be1||!_0x282be1[_0xff71('0x61')][_0xff71('0x36')]){return'';}for(var _0x1d9db5='(',_0x3fd3f2=0x0;_0x3fd3f2<_0x282be1['rules'][_0xff71('0x36')];_0x3fd3f2+=0x1){_0x3fd3f2>0x0&&(_0x1d9db5+='\x20'+_0x282be1[_0xff71('0x62')]+'\x20');_0x1d9db5+=_0x282be1['rules'][_0x3fd3f2]['group']?_0x2e5cfb(_0x282be1[_0xff71('0x61')][_0x3fd3f2][_0xff71('0x63')]):_0x282be1[_0xff71('0x61')][_0x3fd3f2][_0xff71('0x64')]+'\x20'+_0x282be1[_0xff71('0x61')][_0x3fd3f2][_0xff71('0x86')]+(_0x2b9fec(_0x282be1[_0xff71('0x61')][_0x3fd3f2][_0xff71('0x86')])?'\x20'+_0x282be1['rules'][_0x3fd3f2][_0xff71('0x65')]:'');}return _0x1d9db5+')';};var _0x21749f={'where':{'id':_0x1ea35b[_0xff71('0x46')]['id']}},_0x5ffc67,_0x7af258,_0x2db8b4,_0x1ca22e,_0xab2186;_0x21749f=_[_0xff71('0x3b')]({},_0x21749f,_0x1ea35b[_0xff71('0x40')]);return db[_0xff71('0x2d')]['find'](_0x21749f)[_0xff71('0x22')](function(_0x5563f3){if(_0x5563f3){_0x5ffc67=_0x5563f3;return _0x5563f3[_0xff71('0x66')]();}return null;})[_0xff71('0x22')](function(_0x3dda32){if(_0x3dda32){if(!_0x3dda32[_0xff71('0x36')]){throw new db[(_0xff71('0x67'))][(_0xff71('0x68'))](_0xff71('0x69'),0x193);}_0x7af258=_0x3dda32;return db[_0xff71('0x6a')][_0xff71('0x42')]({'raw':!![]});}return null;})['then'](function(_0xcdf20){if(_0xcdf20){_0x2db8b4=_[_0xff71('0xa0')](_0xcdf20,'id');var _0xdfdaa1;var _0x53f509=squel[_0xff71('0x6b')]();_0x53f509['from'](_0x5ffc67['table']);for(var _0x2f3082=0x0;_0x2f3082<_0x7af258[_0xff71('0x36')];_0x2f3082+=0x1){_0xdfdaa1=_0x7af258[_0x2f3082]['MetricId']?_0x2db8b4[_0x7af258[_0x2f3082][_0xff71('0x6e')]][_0xff71('0x87')]:_0x7af258[_0x2f3082][_0xff71('0x64')];_0xdfdaa1=_0x7af258[_0x2f3082][_0xff71('0x6f')]?_[_0xff71('0x70')](_0x5e34e7[_0x7af258[_0x2f3082][_0xff71('0x6f')]],'%s',_0xdfdaa1):_0xdfdaa1;_0xdfdaa1=_0x7af258[_0x2f3082]['format']?_['replace'](_0x56f411[_0x7af258[_0x2f3082]['format']],'%s',_0xdfdaa1):_0xdfdaa1;if(_0x7af258[_0x2f3082][_0xff71('0xa1')]){_0x53f509[_0xff71('0x63')](_0xdfdaa1);}_0x7af258[_0x2f3082]['orderBy']&&_0x53f509[_0xff71('0x72')](_0xdfdaa1,_0x7af258[_0x2f3082]['orderBy']===_0xff71('0x73')?![]:!![]);_0x53f509[_0xff71('0x64')](_0xdfdaa1,_0x7af258[_0x2f3082]['alias']||_0xdfdaa1);}if(_0x5ffc67[_0xff71('0x75')]){_0x5ffc67['joins']=JSON[_0xff71('0x88')](_0x5ffc67[_0xff71('0x75')]);for(var _0x47e79c=0x0;_0x47e79c<_0x5ffc67[_0xff71('0x75')][_0xff71('0x36')];_0x47e79c+=0x1){if(_0x5ffc67['joins'][_0x47e79c]['type']&&_[_0xff71('0x76')](_0x5c1b7a,_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x3d')])&&_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x77')]&&_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x78')]&&_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x89')]){_0x53f509[_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x3d')]](_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x78')],null,util[_0xff71('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ffc67[_0xff71('0x6d')],_0x5ffc67['joins'][_0x47e79c][_0xff71('0x77')],_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x78')],_0x5ffc67[_0xff71('0x75')][_0x47e79c][_0xff71('0x89')]));}}}if(_0x5ffc67[_0xff71('0x7b')]){_0x5ffc67[_0xff71('0x7b')]=JSON['parse'](_0x5ffc67[_0xff71('0x7b')]);_0x53f509[_0xff71('0x3c')](_0x2e5cfb(_0x5ffc67[_0xff71('0x7b')]['group']));}_0xab2186=_0x53f509[_0xff71('0xa2')]();_0x53f509[_0xff71('0x1d')](_0x352dab);_0x53f509[_0xff71('0x1c')](0x0);logger[_0xff71('0x7c')](_0xff71('0x7d'),_0x53f509[_0xff71('0x7f')]());return dbH[_0xff71('0x7e')][_0xff71('0x32')](_0x53f509['toString'](),{'type':dbH['sequelize'][_0xff71('0x80')][_0xff71('0x81')]});}})[_0xff71('0x22')](function(){return{'sql':_0xab2186['toString']()};})[_0xff71('0x22')](respondWithResult(_0x260599,null))[_0xff71('0x44')](handleError(_0x260599,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2ea26cc..cc424e3 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 _0xc2ee=['./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ee,0x10c));var _0xec2e=function(_0x3ad37d,_0xe23097){_0x3ad37d=_0x3ad37d-0x0;var _0x31b4e6=_0xc2ee[_0x3ad37d];return _0x31b4e6;};'use strict';var _=require(_0xec2e('0x0'));var util=require(_0xec2e('0x1'));var logger=require('../../config/logger')(_0xec2e('0x2'));var moment=require(_0xec2e('0x3'));var BPromise=require(_0xec2e('0x4'));var rp=require(_0xec2e('0x5'));var fs=require('fs');var path=require(_0xec2e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xec2e('0x7'));module['exports']=function(_0x3eee15,_0x5a6fe6){return _0x3eee15[_0xec2e('0x8')](_0xec2e('0x9'),attributes,{'tableName':_0xec2e('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x908f=['exports','AnalyticCustomReport','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x10b784,_0x13f30b){var _0x3a31e5=function(_0x37aef9){while(--_0x37aef9){_0x10b784['push'](_0x10b784['shift']());}};_0x3a31e5(++_0x13f30b);}(_0x908f,0x19a));var _0xf908=function(_0x2d80f0,_0x152ccd){_0x2d80f0=_0x2d80f0-0x0;var _0x542827=_0x908f[_0x2d80f0];return _0x542827;};'use strict';var _=require(_0xf908('0x0'));var util=require('util');var logger=require(_0xf908('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf908('0x2'));var rp=require(_0xf908('0x3'));var fs=require('fs');var path=require(_0xf908('0x4'));var rimraf=require('rimraf');var config=require(_0xf908('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0xf908('0x6')]=function(_0x22a301,_0x19f237){return _0x22a301['define'](_0xf908('0x7'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index c2b993f..985c479 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 _0x61ac=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x22ad0c,_0x56e8a1){var _0x3787a9=function(_0x1d87a9){while(--_0x1d87a9){_0x22ad0c['push'](_0x22ad0c['shift']());}};_0x3787a9(++_0x56e8a1);}(_0x61ac,0x163));var _0xc61a=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0x61ac[_0x199c03];return _0x11a7d4;};'use strict';var _=require(_0xc61a('0x0'));var util=require(_0xc61a('0x1'));var moment=require(_0xc61a('0x2'));var BPromise=require(_0xc61a('0x3'));var rs=require(_0xc61a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc61a('0x5'))['db'];var utils=require(_0xc61a('0x6'));var logger=require(_0xc61a('0x7'))('rpc');var config=require(_0xc61a('0x8'));var jayson=require(_0xc61a('0x9'));var client=jayson[_0xc61a('0xa')][_0xc61a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38c571,_0x22acf3,_0x70747f){return new BPromise(function(_0x145d0b,_0x47f6fc){return client[_0xc61a('0xc')](_0x38c571,_0x70747f)[_0xc61a('0xd')](function(_0x55fd5f){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x22acf3,_0xc61a('0xe'));logger[_0xc61a('0xf')](_0xc61a('0x10'),_0x22acf3,_0xc61a('0xe'),JSON[_0xc61a('0x11')](_0x55fd5f));if(_0x55fd5f[_0xc61a('0x12')]){if(_0x55fd5f[_0xc61a('0x12')][_0xc61a('0x13')]===0x1f4){logger['error'](_0xc61a('0x14'),_0x22acf3,_0x55fd5f['error'][_0xc61a('0x15')]);return _0x47f6fc(_0x55fd5f[_0xc61a('0x12')]['message']);}logger[_0xc61a('0x12')](_0xc61a('0x14'),_0x22acf3,_0x55fd5f[_0xc61a('0x12')]['message']);return _0x145d0b(_0x55fd5f[_0xc61a('0x12')]['message']);}else{logger[_0xc61a('0x16')](_0xc61a('0x14'),_0x22acf3,'request\x20sent');_0x145d0b(_0x55fd5f[_0xc61a('0x17')]['message']);}})['catch'](function(_0x532dd8){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x22acf3,_0x532dd8);_0x47f6fc(_0x532dd8);});});} \ No newline at end of file +var _0x84d4=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x235626,_0x4f211e){var _0x6cd2de=function(_0x2759c4){while(--_0x2759c4){_0x235626['push'](_0x235626['shift']());}};_0x6cd2de(++_0x4f211e);}(_0x84d4,0x17e));var _0x484d=function(_0x161c66,_0x5428df){_0x161c66=_0x161c66-0x0;var _0x7c06c8=_0x84d4[_0x161c66];return _0x7c06c8;};'use strict';var _=require(_0x484d('0x0'));var util=require(_0x484d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x484d('0x2'));var fs=require('fs');var Redis=require(_0x484d('0x3'));var db=require(_0x484d('0x4'))['db'];var utils=require(_0x484d('0x5'));var logger=require(_0x484d('0x6'))(_0x484d('0x7'));var config=require(_0x484d('0x8'));var jayson=require(_0x484d('0x9'));var client=jayson[_0x484d('0xa')][_0x484d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x198288,_0x28f175,_0xe37167){return new BPromise(function(_0x5a4959,_0x582525){return client['request'](_0x198288,_0xe37167)[_0x484d('0xc')](function(_0x4826f6){logger[_0x484d('0xd')](_0x484d('0xe'),_0x28f175,_0x484d('0xf'));logger[_0x484d('0x10')](_0x484d('0x11'),_0x28f175,'request\x20sent',JSON['stringify'](_0x4826f6));if(_0x4826f6['error']){if(_0x4826f6[_0x484d('0x12')]['code']===0x1f4){logger[_0x484d('0x12')](_0x484d('0xe'),_0x28f175,_0x4826f6[_0x484d('0x12')][_0x484d('0x13')]);return _0x582525(_0x4826f6[_0x484d('0x12')]['message']);}logger[_0x484d('0x12')](_0x484d('0xe'),_0x28f175,_0x4826f6[_0x484d('0x12')]['message']);return _0x5a4959(_0x4826f6[_0x484d('0x12')]['message']);}else{logger[_0x484d('0xd')](_0x484d('0xe'),_0x28f175,_0x484d('0xf'));_0x5a4959(_0x4826f6[_0x484d('0x14')][_0x484d('0x13')]);}})['catch'](function(_0x27b71e){logger[_0x484d('0x12')](_0x484d('0xe'),_0x28f175,_0x27b71e);_0x582525(_0x27b71e);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 5d333ef..e352569 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 _0x6617=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','preview','/:id/run','run','/:id/query','put','update','exports','multer','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6617,0x89));var _0x7661=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x6617[_0x145b3c];return _0x1b6e36;};'use strict';var multer=require(_0x7661('0x0'));var util=require('util');var path=require(_0x7661('0x1'));var timeout=require(_0x7661('0x2'));var express=require(_0x7661('0x3'));var router=express[_0x7661('0x4')]();var fs_extra=require(_0x7661('0x5'));var auth=require(_0x7661('0x6'));var interaction=require(_0x7661('0x7'));var config=require(_0x7661('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x7661('0x9')]('/',auth[_0x7661('0xa')](),controller['index']);router['get'](_0x7661('0xb'),auth[_0x7661('0xa')](),controller[_0x7661('0xc')]);router[_0x7661('0x9')]('/:id/preview',auth[_0x7661('0xa')](),controller[_0x7661('0xd')]);router[_0x7661('0x9')](_0x7661('0xe'),auth[_0x7661('0xa')](),controller[_0x7661('0xf')]);router[_0x7661('0x9')](_0x7661('0x10'),auth[_0x7661('0xa')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7661('0x11')](_0x7661('0xb'),auth[_0x7661('0xa')](),controller[_0x7661('0x12')]);router['delete'](_0x7661('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7661('0x13')]=router; \ No newline at end of file +var _0xe922=['update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','run','/:id/query','query','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe922,0x1a7));var _0x2e92=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xe922[_0x53b133];return _0x5647e0;};'use strict';var multer=require(_0x2e92('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2e92('0x1'));var express=require(_0x2e92('0x2'));var router=express[_0x2e92('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2e92('0x4'));var interaction=require(_0x2e92('0x5'));var config=require(_0x2e92('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x2e92('0x7')]('/',auth[_0x2e92('0x8')](),controller['index']);router[_0x2e92('0x7')](_0x2e92('0x9'),auth[_0x2e92('0x8')](),controller[_0x2e92('0xa')]);router[_0x2e92('0x7')](_0x2e92('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x2e92('0x7')]('/:id/run',auth[_0x2e92('0x8')](),controller[_0x2e92('0xc')]);router['get'](_0x2e92('0xd'),auth[_0x2e92('0x8')](),controller[_0x2e92('0xe')]);router[_0x2e92('0xf')]('/',auth['isAuthenticated'](),controller[_0x2e92('0x10')]);router[_0x2e92('0x11')](_0x2e92('0x9'),auth[_0x2e92('0x8')](),controller[_0x2e92('0x12')]);router[_0x2e92('0x13')](_0x2e92('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2e92('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6789138..10d23e9 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 _0x33c5=['STRING','TEXT','exports'];(function(_0xaf8d9,_0x118c7c){var _0x242a68=function(_0x57e36b){while(--_0x57e36b){_0xaf8d9['push'](_0xaf8d9['shift']());}};_0x242a68(++_0x118c7c);}(_0x33c5,0xe6));var _0x533c=function(_0x46d87a,_0x5183db){_0x46d87a=_0x46d87a-0x0;var _0x115296=_0x33c5[_0x46d87a];return _0x115296;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x294726,_0x5db9e9){var _0x39e2e3=function(_0x50041d){while(--_0x50041d){_0x294726['push'](_0x294726['shift']());}};_0x39e2e3(++_0x5db9e9);}(_0x5fab,0x177));var _0xb5fa=function(_0x9cf391,_0x3b631f){_0x9cf391=_0x9cf391-0x0;var _0xb7069f=_0x5fab[_0x9cf391];return _0xb7069f;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4c39f78..3e661b2 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 _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x9c49de,_0x5d2d8e){var _0x1b90aa=function(_0x139adb){while(--_0x139adb){_0x9c49de['push'](_0x9c49de['shift']());}};_0x1b90aa(++_0x5d2d8e);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x316ba9,_0x500116){_0x316ba9=_0x316ba9-0x0;var _0x7c2e37=_0x3f8a[_0x316ba9];return _0x7c2e37;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));}; \ No newline at end of file +var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x8d1c97,_0x5f1cdc){var _0x459c5a=function(_0x48bfbb){while(--_0x48bfbb){_0x8d1c97['push'](_0x8d1c97['shift']());}};_0x459c5a(++_0x5f1cdc);}(_0x524e,0x15e));var _0xe524=function(_0x245fd9,_0x5f84c0){_0x245fd9=_0x245fd9-0x0;var _0x4d890b=_0x524e[_0x245fd9];return _0x4d890b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index eda818a..2109776 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 _0x1ef7=['analytics_default_reports','../../config/logger','bluebird','path','../../config/environment','exports','AnalyticDefaultReport'];(function(_0x17af18,_0x253dc1){var _0x3fd38f=function(_0x592875){while(--_0x592875){_0x17af18['push'](_0x17af18['shift']());}};_0x3fd38f(++_0x253dc1);}(_0x1ef7,0x112));var _0x71ef=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x1ef7[_0x334651];return _0x29657c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x71ef('0x0'))('api');var moment=require('moment');var BPromise=require(_0x71ef('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71ef('0x2'));var rimraf=require('rimraf');var config=require(_0x71ef('0x3'));var attributes=require('./analyticDefaultReport.attributes');module[_0x71ef('0x4')]=function(_0x5315c5,_0x235c04){return _0x5315c5['define'](_0x71ef('0x5'),attributes,{'tableName':_0x71ef('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe73=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe73,0xc5));var _0x3fe7=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xfe73[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0x3fe7('0x0'));var logger=require('../../config/logger')(_0x3fe7('0x1'));var moment=require(_0x3fe7('0x2'));var BPromise=require(_0x3fe7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fe7('0x4'));var rimraf=require(_0x3fe7('0x5'));var config=require(_0x3fe7('0x6'));var attributes=require(_0x3fe7('0x7'));module[_0x3fe7('0x8')]=function(_0x1b9398,_0x45c003){return _0x1b9398[_0x3fe7('0x9')](_0x3fe7('0xa'),attributes,{'tableName':_0x3fe7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index f978608..ebdbeb3 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 _0x01a3=['request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x6810d0,_0x4565c3){var _0x568796=function(_0x20bb42){while(--_0x20bb42){_0x6810d0['push'](_0x6810d0['shift']());}};_0x568796(++_0x4565c3);}(_0x01a3,0x9c));var _0x301a=function(_0x57809d,_0x4736db){_0x57809d=_0x57809d-0x0;var _0x5c4d48=_0x01a3[_0x57809d];return _0x5c4d48;};'use strict';var _=require(_0x301a('0x0'));var util=require(_0x301a('0x1'));var moment=require(_0x301a('0x2'));var BPromise=require(_0x301a('0x3'));var rs=require(_0x301a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x301a('0x5'));var logger=require(_0x301a('0x6'))(_0x301a('0x7'));var config=require(_0x301a('0x8'));var jayson=require(_0x301a('0x9'));var client=jayson[_0x301a('0xa')][_0x301a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f8407,_0x37de7b,_0x293902){return new BPromise(function(_0x115433,_0x38aac7){return client[_0x301a('0xc')](_0x1f8407,_0x293902)['then'](function(_0x2c0801){logger['info'](_0x301a('0xd'),_0x37de7b,_0x301a('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x37de7b,_0x301a('0xe'),JSON[_0x301a('0xf')](_0x2c0801));if(_0x2c0801[_0x301a('0x10')]){if(_0x2c0801[_0x301a('0x10')]['code']===0x1f4){logger[_0x301a('0x10')](_0x301a('0xd'),_0x37de7b,_0x2c0801['error'][_0x301a('0x11')]);return _0x38aac7(_0x2c0801[_0x301a('0x10')][_0x301a('0x11')]);}logger[_0x301a('0x10')](_0x301a('0xd'),_0x37de7b,_0x2c0801[_0x301a('0x10')]['message']);return _0x115433(_0x2c0801[_0x301a('0x10')][_0x301a('0x11')]);}else{logger[_0x301a('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x37de7b,'request\x20sent');_0x115433(_0x2c0801[_0x301a('0x13')][_0x301a('0x11')]);}})[_0x301a('0x14')](function(_0x3b1941){logger[_0x301a('0x10')](_0x301a('0xd'),_0x37de7b,_0x3b1941);_0x38aac7(_0x3b1941);});});} \ No newline at end of file +var _0xff16=['stringify','error','code','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xff16,0x159));var _0x6ff1=function(_0x2ad329,_0x4962e2){_0x2ad329=_0x2ad329-0x0;var _0x4ab53a=_0xff16[_0x2ad329];return _0x4ab53a;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ff1('0x2'));var db=require(_0x6ff1('0x3'))['db'];var utils=require(_0x6ff1('0x4'));var logger=require(_0x6ff1('0x5'))(_0x6ff1('0x6'));var config=require(_0x6ff1('0x7'));var jayson=require(_0x6ff1('0x8'));var client=jayson[_0x6ff1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff97c,_0x1c44a2,_0x4c448b){return new BPromise(function(_0x76b83a,_0x5b2fce){return client[_0x6ff1('0xa')](_0x4ff97c,_0x4c448b)[_0x6ff1('0xb')](function(_0x28f2f0){logger[_0x6ff1('0xc')](_0x6ff1('0xd'),_0x1c44a2,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1c44a2,_0x6ff1('0xe'),JSON[_0x6ff1('0xf')](_0x28f2f0));if(_0x28f2f0[_0x6ff1('0x10')]){if(_0x28f2f0[_0x6ff1('0x10')][_0x6ff1('0x11')]===0x1f4){logger[_0x6ff1('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c44a2,_0x28f2f0[_0x6ff1('0x10')]['message']);return _0x5b2fce(_0x28f2f0[_0x6ff1('0x10')][_0x6ff1('0x12')]);}logger[_0x6ff1('0x10')](_0x6ff1('0xd'),_0x1c44a2,_0x28f2f0[_0x6ff1('0x10')][_0x6ff1('0x12')]);return _0x76b83a(_0x28f2f0['error'][_0x6ff1('0x12')]);}else{logger[_0x6ff1('0xc')](_0x6ff1('0xd'),_0x1c44a2,_0x6ff1('0xe'));_0x76b83a(_0x28f2f0['result'][_0x6ff1('0x12')]);}})[_0x6ff1('0x13')](function(_0x5d54b1){logger[_0x6ff1('0x10')](_0x6ff1('0xd'),_0x1c44a2,_0x5d54b1);_0x5b2fce(_0x5d54b1);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 1d28b49..a76b5c2 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 _0xfc20=['../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/preview','/:id/run','run','create','put','update','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2c6d5e,_0x36a0db){var _0x1d55e5=function(_0x3524a6){while(--_0x3524a6){_0x2c6d5e['push'](_0x2c6d5e['shift']());}};_0x1d55e5(++_0x36a0db);}(_0xfc20,0x12d));var _0x0fc2=function(_0x2bba38,_0x1a110b){_0x2bba38=_0x2bba38-0x0;var _0x140d09=_0xfc20[_0x2bba38];return _0x140d09;};'use strict';var multer=require(_0x0fc2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0fc2('0x1'));var express=require('express');var router=express[_0x0fc2('0x2')]();var fs_extra=require(_0x0fc2('0x3'));var auth=require(_0x0fc2('0x4'));var interaction=require(_0x0fc2('0x5'));var config=require('../../config/environment');var controller=require(_0x0fc2('0x6'));router[_0x0fc2('0x7')]('/',auth['isAuthenticated'](),controller[_0x0fc2('0x8')]);router[_0x0fc2('0x7')](_0x0fc2('0x9'),auth[_0x0fc2('0xa')](),controller['show']);router[_0x0fc2('0x7')](_0x0fc2('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x0fc2('0x7')](_0x0fc2('0xc'),auth[_0x0fc2('0xa')](),controller[_0x0fc2('0xd')]);router[_0x0fc2('0x7')]('/:id/query',auth[_0x0fc2('0xa')](),controller['query']);router['post']('/',auth[_0x0fc2('0xa')](),controller[_0x0fc2('0xe')]);router[_0x0fc2('0xf')]('/:id',auth[_0x0fc2('0xa')](),controller[_0x0fc2('0x10')]);router['delete'](_0x0fc2('0x9'),auth[_0x0fc2('0xa')](),controller[_0x0fc2('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe995=['/:id','/:id/preview','preview','/:id/run','get','/:id/query','query','post','put','update','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x23b478,_0x3e738a){var _0x11648e=function(_0x5be1f4){while(--_0x5be1f4){_0x23b478['push'](_0x23b478['shift']());}};_0x11648e(++_0x3e738a);}(_0xe995,0xd0));var _0x5e99=function(_0x4865b8,_0x329985){_0x4865b8=_0x4865b8-0x0;var _0x33cd9c=_0xe995[_0x4865b8];return _0x33cd9c;};'use strict';var multer=require(_0x5e99('0x0'));var util=require(_0x5e99('0x1'));var path=require('path');var timeout=require(_0x5e99('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5e99('0x3'));var interaction=require(_0x5e99('0x4'));var config=require(_0x5e99('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x5e99('0x6')](),controller[_0x5e99('0x7')]);router['get'](_0x5e99('0x8'),auth[_0x5e99('0x6')](),controller['show']);router['get'](_0x5e99('0x9'),auth[_0x5e99('0x6')](),controller[_0x5e99('0xa')]);router['get'](_0x5e99('0xb'),auth[_0x5e99('0x6')](),controller['run']);router[_0x5e99('0xc')](_0x5e99('0xd'),auth[_0x5e99('0x6')](),controller[_0x5e99('0xe')]);router[_0x5e99('0xf')]('/',auth[_0x5e99('0x6')](),controller['create']);router[_0x5e99('0x10')](_0x5e99('0x8'),auth[_0x5e99('0x6')](),controller[_0x5e99('0x11')]);router['delete'](_0x5e99('0x8'),auth[_0x5e99('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 71215fa..23d145f 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 _0x27ef=['exports','STRING','ENUM','pdf','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x4695e2,_0x3d5f15){var _0x160563=function(_0x5df0a2){while(--_0x5df0a2){_0x4695e2['push'](_0x4695e2['shift']());}};_0x160563(++_0x3d5f15);}(_0x27ef,0x82));var _0xf27e=function(_0x2db315,_0x58d720){_0x2db315=_0x2db315-0x0;var _0x12f9a2=_0x27ef[_0x2db315];return _0x12f9a2;};'use strict';var Sequelize=require(_0xf27e('0x0'));var moment=require(_0xf27e('0x1'));module[_0xf27e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xf27e('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf27e('0x4')]('csv',_0xf27e('0x5'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xf27e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xf27e('0x6')},'type':{'type':Sequelize[_0xf27e('0x4')](_0xf27e('0x7'),_0xf27e('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf27e('0x9')](0xb)[_0xf27e('0xa')]},'reportType':{'type':Sequelize[_0xf27e('0x3')]}}; \ No newline at end of file +var _0x7395=['xlsx','csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','pdf'];(function(_0x84f86b,_0x239bfc){var _0x57c5a6=function(_0x4ebd95){while(--_0x4ebd95){_0x84f86b['push'](_0x84f86b['shift']());}};_0x57c5a6(++_0x239bfc);}(_0x7395,0x10c));var _0x5739=function(_0x1fb04b,_0x31476a){_0x1fb04b=_0x1fb04b-0x0;var _0x9792e8=_0x7395[_0x1fb04b];return _0x9792e8;};'use strict';var Sequelize=require(_0x5739('0x0'));var moment=require('moment');module[_0x5739('0x1')]={'name':{'type':Sequelize[_0x5739('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5739('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5739('0x3')]('csv',_0x5739('0x4'),_0x5739('0x5')),'allowNull':![],'defaultValue':_0x5739('0x6')},'savename':{'type':Sequelize[_0x5739('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5739('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5739('0x2')],'defaultValue':_0x5739('0x8')},'type':{'type':Sequelize[_0x5739('0x3')](_0x5739('0x9'),_0x5739('0xa')),'allowNull':![],'defaultValue':_0x5739('0x9')},'reportId':{'type':Sequelize[_0x5739('0xb')](0xb)[_0x5739('0xc')]},'reportType':{'type':Sequelize[_0x5739('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index da87d1b..7150b13 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 _0x4470=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','offset','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','params','keys','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','format','toLowerCase','eml-format','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x2c5058,_0x2320b0){var _0x1fafb4=function(_0x9d3fef){while(--_0x9d3fef){_0x2c5058['push'](_0x2c5058['shift']());}};_0x1fafb4(++_0x2320b0);}(_0x4470,0xa8));var _0x0447=function(_0x141e03,_0x18340e){_0x141e03=_0x141e03-0x0;var _0x2074e3=_0x4470[_0x141e03];return _0x2074e3;};'use strict';var emlformat=require(_0x0447('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0447('0x1'));var jsonpatch=require(_0x0447('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0447('0x3'));var Mustache=require('mustache');var util=require(_0x0447('0x4'));var path=require(_0x0447('0x5'));var sox=require('sox');var csv=require(_0x0447('0x6'));var ejs=require(_0x0447('0x7'));var fs=require('fs');var fs_extra=require(_0x0447('0x8'));var _=require(_0x0447('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0447('0xa'));var deskjs=require(_0x0447('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0447('0xc'));var Papa=require(_0x0447('0xd'));var Redis=require('ioredis');var authService=require(_0x0447('0xe'));var qs=require(_0x0447('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0447('0x10'));var logger=require(_0x0447('0x11'))(_0x0447('0x12'));var utils=require(_0x0447('0x13'));var config=require(_0x0447('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xba305c,_0x14b104){_0x14b104=_0x14b104||0xcc;return function(_0x44f864){if(_0x44f864){return _0xba305c['sendStatus'](_0x14b104);}return _0xba305c[_0x0447('0x15')](_0x14b104)['end']();};}function respondWithResult(_0x2c3137,_0x1370d8){_0x1370d8=_0x1370d8||0xc8;return function(_0x4362d0){if(_0x4362d0){return _0x2c3137['status'](_0x1370d8)[_0x0447('0x16')](_0x4362d0);}};}function respondWithFilteredResult(_0x3c465d,_0x9b1a9c){return function(_0x437d77){if(_0x437d77){var _0xb2c588=typeof _0x9b1a9c['offset']==='undefined'&&typeof _0x9b1a9c[_0x0447('0x17')]===_0x0447('0x18');var _0x3712c9=_0x437d77[_0x0447('0x19')];var _0x42d626=_0xb2c588?0x0:_0x9b1a9c['offset'];var _0x3967e2=_0xb2c588?_0x437d77['count']:_0x9b1a9c['offset']+_0x9b1a9c[_0x0447('0x17')];var _0xe4e95d;if(_0x3967e2>=_0x3712c9){_0x3967e2=_0x3712c9;_0xe4e95d=0xc8;}else{_0xe4e95d=0xce;}_0x3c465d[_0x0447('0x15')](_0xe4e95d);return _0x3c465d[_0x0447('0x1a')](_0x0447('0x1b'),_0x42d626+'-'+_0x3967e2+'/'+_0x3712c9)['json'](_0x437d77);}return null;};}function patchUpdates(_0x5d5ed0){return function(_0x2c65b7){try{jsonpatch[_0x0447('0x1c')](_0x2c65b7,_0x5d5ed0,!![]);}catch(_0xe480d7){return BPromise['reject'](_0xe480d7);}return _0x2c65b7[_0x0447('0x1d')]();};}function saveUpdates(_0x37b06a,_0x1a703a){return function(_0x25e1a3){if(_0x25e1a3){return _0x25e1a3[_0x0447('0x1e')](_0x37b06a)[_0x0447('0x1f')](function(_0xdf11d0){return _0xdf11d0;});}return null;};}function removeEntity(_0x51958b,_0x3800c6){return function(_0x5d6221){if(_0x5d6221){return _0x5d6221[_0x0447('0x20')]()['then'](function(){var _0x327e8d=_0x5d6221[_0x0447('0x21')]({'plain':!![]});var _0x3e826e=_0x0447('0x22');return db[_0x0447('0x23')][_0x0447('0x20')]({'where':{'type':_0x3e826e,'resourceId':_0x327e8d['id']}})[_0x0447('0x1f')](function(){return _0x5d6221;});})['then'](function(){_0x51958b[_0x0447('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b0a3,_0x53f28d){return function(_0x18fe7d){if(!_0x18fe7d){_0x59b0a3[_0x0447('0x24')](0x194);}return _0x18fe7d;};}function handleError(_0x4b305e,_0x2b20a3){_0x2b20a3=_0x2b20a3||0x1f4;return function(_0x54a3c2){logger[_0x0447('0x25')](_0x54a3c2[_0x0447('0x26')]);if(_0x54a3c2[_0x0447('0x27')]){delete _0x54a3c2[_0x0447('0x27')];}_0x4b305e[_0x0447('0x15')](_0x2b20a3)[_0x0447('0x28')](_0x54a3c2);};}exports[_0x0447('0x29')]=function(_0x137b77,_0x2328b2){var _0xfadc7f={},_0x2d038f={},_0x5b7480={'count':0x0,'rows':[]};var _0x307fc4=_[_0x0447('0x2a')](db[_0x0447('0x2b')][_0x0447('0x2c')],function(_0x4c9705){return{'name':_0x4c9705[_0x0447('0x2d')],'type':_0x4c9705['type'][_0x0447('0x2e')]};});_0x2d038f[_0x0447('0x2f')]=_[_0x0447('0x2a')](_0x307fc4,_0x0447('0x27'));_0x2d038f[_0x0447('0x30')]=_['keys'](_0x137b77['query']);_0x2d038f[_0x0447('0x31')]=_[_0x0447('0x32')](_0x2d038f[_0x0447('0x2f')],_0x2d038f[_0x0447('0x30')]);_0xfadc7f['attributes']=_[_0x0447('0x32')](_0x2d038f[_0x0447('0x2f')],qs[_0x0447('0x33')](_0x137b77['query'][_0x0447('0x33')]));_0xfadc7f[_0x0447('0x34')]=_0xfadc7f[_0x0447('0x34')][_0x0447('0x35')]?_0xfadc7f['attributes']:_0x2d038f[_0x0447('0x2f')];if(!_0x137b77[_0x0447('0x30')]['hasOwnProperty'](_0x0447('0x36'))){_0xfadc7f[_0x0447('0x17')]=qs['limit'](_0x137b77[_0x0447('0x30')][_0x0447('0x17')]);_0xfadc7f[_0x0447('0x37')]=qs['offset'](_0x137b77[_0x0447('0x30')]['offset']);}_0xfadc7f['order']=qs['sort'](_0x137b77[_0x0447('0x30')][_0x0447('0x38')]);_0xfadc7f[_0x0447('0x39')]=qs[_0x0447('0x31')](_[_0x0447('0x3a')](_0x137b77[_0x0447('0x30')],_0x2d038f[_0x0447('0x31')]),_0x307fc4);if(_0x137b77['query'][_0x0447('0x3b')]){_0xfadc7f[_0x0447('0x39')]=_[_0x0447('0x3c')](_0xfadc7f[_0x0447('0x39')],{'$or':_[_0x0447('0x2a')](_0x307fc4,function(_0xb95df0){if(_0xb95df0[_0x0447('0x3d')]!==_0x0447('0x3e')){var _0x178906={};_0x178906[_0xb95df0[_0x0447('0x27')]]={'$like':'%'+_0x137b77[_0x0447('0x30')][_0x0447('0x3b')]+'%'};return _0x178906;}})});}_0xfadc7f=_[_0x0447('0x3c')]({},_0xfadc7f,_0x137b77[_0x0447('0x3f')]);var _0x44c16b={'where':_0xfadc7f[_0x0447('0x39')]};return db[_0x0447('0x2b')]['count'](_0x44c16b)[_0x0447('0x1f')](function(_0x32b708){_0x5b7480['count']=_0x32b708;if(_0x137b77[_0x0447('0x30')]['includeAll']){_0xfadc7f['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0xfadc7f);})['then'](function(_0x3ba421){_0x5b7480[_0x0447('0x40')]=_0x3ba421;return _0x5b7480;})['then'](respondWithFilteredResult(_0x2328b2,_0xfadc7f))['catch'](handleError(_0x2328b2,null));};exports['show']=function(_0x4f3503,_0x3aede3){var _0x12c20f={'raw':!![],'where':{'id':_0x4f3503[_0x0447('0x41')]['id']}},_0x1dd6b2={};_0x1dd6b2[_0x0447('0x2f')]=_[_0x0447('0x42')](db['AnalyticExtractedReport'][_0x0447('0x2c')]);_0x1dd6b2[_0x0447('0x30')]=_[_0x0447('0x42')](_0x4f3503[_0x0447('0x30')]);_0x1dd6b2['filters']=_[_0x0447('0x32')](_0x1dd6b2[_0x0447('0x2f')],_0x1dd6b2[_0x0447('0x30')]);_0x12c20f[_0x0447('0x34')]=_[_0x0447('0x32')](_0x1dd6b2['model'],qs['fields'](_0x4f3503['query'][_0x0447('0x33')]));_0x12c20f[_0x0447('0x34')]=_0x12c20f[_0x0447('0x34')][_0x0447('0x35')]?_0x12c20f['attributes']:_0x1dd6b2[_0x0447('0x2f')];if(_0x4f3503[_0x0447('0x30')][_0x0447('0x43')]){_0x12c20f['include']=[{'all':!![]}];}_0x12c20f=_['merge']({},_0x12c20f,_0x4f3503[_0x0447('0x3f')]);return db[_0x0447('0x2b')][_0x0447('0x44')](_0x12c20f)[_0x0447('0x1f')](handleEntityNotFound(_0x3aede3,null))[_0x0447('0x1f')](respondWithResult(_0x3aede3,null))[_0x0447('0x45')](handleError(_0x3aede3,null));};exports[_0x0447('0x46')]=function(_0x4c9826,_0x7514e5){return db[_0x0447('0x2b')][_0x0447('0x46')](_0x4c9826[_0x0447('0x47')],{})[_0x0447('0x1f')](function(_0x3b307a){var _0x483e4e=_0x4c9826[_0x0447('0x48')][_0x0447('0x21')]({'plain':!![]});if(!_0x483e4e)throw new Error(_0x0447('0x49'));if(_0x483e4e[_0x0447('0x4a')]==='user'){var _0x9d78f0=_0x3b307a[_0x0447('0x21')]({'plain':!![]});var _0x583e6b=_0x0447('0x22');return db[_0x0447('0x4b')][_0x0447('0x44')]({'where':{'name':_0x583e6b,'userProfileId':_0x483e4e['userProfileId']},'raw':!![]})[_0x0447('0x1f')](function(_0x46f1ac){if(_0x46f1ac&&_0x46f1ac[_0x0447('0x4c')]===0x0){return db[_0x0447('0x23')][_0x0447('0x46')]({'name':_0x9d78f0[_0x0447('0x27')],'resourceId':_0x9d78f0['id'],'type':_0x46f1ac['name'],'sectionId':_0x46f1ac['id']},{})['then'](function(){return _0x3b307a;});}else{return _0x3b307a;}})[_0x0447('0x45')](function(_0x2867fe){logger[_0x0447('0x25')](_0x0447('0x4d'),_0x2867fe);throw _0x2867fe;});}return _0x3b307a;})[_0x0447('0x1f')](respondWithResult(_0x7514e5,0xc9))['catch'](handleError(_0x7514e5,null));};exports[_0x0447('0x1e')]=function(_0x14d1c3,_0x41477c){if(_0x14d1c3[_0x0447('0x47')]['id']){delete _0x14d1c3[_0x0447('0x47')]['id'];}return db[_0x0447('0x2b')][_0x0447('0x44')]({'where':{'id':_0x14d1c3['params']['id']}})[_0x0447('0x1f')](handleEntityNotFound(_0x41477c,null))[_0x0447('0x1f')](saveUpdates(_0x14d1c3[_0x0447('0x47')],null))[_0x0447('0x1f')](respondWithResult(_0x41477c,null))['catch'](handleError(_0x41477c,null));};exports['destroy']=function(_0x2f7c52,_0x5908b8){return db[_0x0447('0x2b')][_0x0447('0x44')]({'where':{'id':_0x2f7c52[_0x0447('0x41')]['id']}})[_0x0447('0x1f')](handleEntityNotFound(_0x5908b8,null))[_0x0447('0x1f')](removeEntity(_0x5908b8,null))['catch'](handleError(_0x5908b8,null));};exports[_0x0447('0x4e')]=function(_0x195e31,_0xbaf6f2,_0x3e0917){return db[_0x0447('0x2b')][_0x0447('0x44')]({'where':{'id':_0x195e31[_0x0447('0x41')]['id']},'attributes':['name',_0x0447('0x4f'),_0x0447('0x50'),'output'],'raw':!![]})[_0x0447('0x1f')](handleEntityNotFound(_0xbaf6f2,null))[_0x0447('0x1f')](function(_0x19ce23){if(_0x19ce23){if(!fs[_0x0447('0x51')](path[_0x0447('0x52')](config['root'],'server/files/reports',_0x19ce23['savename']))){throw new db[(_0x0447('0x53'))][(_0x0447('0x54'))](_0x0447('0x55'));}if(_0x195e31['query']['exists']){return _0xbaf6f2[_0x0447('0x24')](0xc8);}return _0xbaf6f2[_0x0447('0x4e')](path[_0x0447('0x52')](config[_0x0447('0x56')],'server/files/reports',_0x19ce23[_0x0447('0x50')]),util[_0x0447('0x57')]('%s.%s',_0x19ce23[_0x0447('0x4f')]||_0x19ce23['name'],_0x19ce23['output'][_0x0447('0x58')]()));}})['catch'](handleError(_0xbaf6f2,null));}; \ No newline at end of file +var _0xe0d9=['fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0xe0d9,0x192));var _0x9e0d=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0xe0d9[_0x57cbfb];return _0x4cb933;};'use strict';var emlformat=require(_0x9e0d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e0d('0x1'));var rp=require(_0x9e0d('0x2'));var moment=require('moment');var BPromise=require(_0x9e0d('0x3'));var Mustache=require('mustache');var util=require(_0x9e0d('0x4'));var path=require(_0x9e0d('0x5'));var sox=require(_0x9e0d('0x6'));var csv=require(_0x9e0d('0x7'));var ejs=require(_0x9e0d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e0d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e0d('0xa'));var deskjs=require(_0x9e0d('0xb'));var toCsv=require(_0x9e0d('0x7'));var querystring=require(_0x9e0d('0xc'));var Papa=require('papaparse');var Redis=require(_0x9e0d('0xd'));var authService=require(_0x9e0d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9e0d('0xf'));var hardwareService=require(_0x9e0d('0x10'));var logger=require(_0x9e0d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9e0d('0x12'));var licenseUtil=require(_0x9e0d('0x13'));var db=require(_0x9e0d('0x14'))['db'];function respondWithStatusCode(_0x11edee,_0x3247cc){_0x3247cc=_0x3247cc||0xcc;return function(_0x3d065c){if(_0x3d065c){return _0x11edee[_0x9e0d('0x15')](_0x3247cc);}return _0x11edee[_0x9e0d('0x16')](_0x3247cc)[_0x9e0d('0x17')]();};}function respondWithResult(_0x3d3bbb,_0x46c652){_0x46c652=_0x46c652||0xc8;return function(_0x1f8361){if(_0x1f8361){return _0x3d3bbb[_0x9e0d('0x16')](_0x46c652)[_0x9e0d('0x18')](_0x1f8361);}};}function respondWithFilteredResult(_0x3fad64,_0x388bbc){return function(_0x45838c){if(_0x45838c){var _0x292872=typeof _0x388bbc[_0x9e0d('0x19')]===_0x9e0d('0x1a')&&typeof _0x388bbc[_0x9e0d('0x1b')]===_0x9e0d('0x1a');var _0x1487bf=_0x45838c[_0x9e0d('0x1c')];var _0x5508a8=_0x292872?0x0:_0x388bbc[_0x9e0d('0x19')];var _0x103e22=_0x292872?_0x45838c['count']:_0x388bbc['offset']+_0x388bbc[_0x9e0d('0x1b')];var _0x22fe73;if(_0x103e22>=_0x1487bf){_0x103e22=_0x1487bf;_0x22fe73=0xc8;}else{_0x22fe73=0xce;}_0x3fad64[_0x9e0d('0x16')](_0x22fe73);return _0x3fad64[_0x9e0d('0x1d')]('Content-Range',_0x5508a8+'-'+_0x103e22+'/'+_0x1487bf)[_0x9e0d('0x18')](_0x45838c);}return null;};}function patchUpdates(_0x40eb21){return function(_0x4afdff){try{jsonpatch['apply'](_0x4afdff,_0x40eb21,!![]);}catch(_0x359ae6){return BPromise[_0x9e0d('0x1e')](_0x359ae6);}return _0x4afdff[_0x9e0d('0x1f')]();};}function saveUpdates(_0x4deb1d,_0x5e4050){return function(_0x1b6fcf){if(_0x1b6fcf){return _0x1b6fcf[_0x9e0d('0x20')](_0x4deb1d)[_0x9e0d('0x21')](function(_0x1c1f11){return _0x1c1f11;});}return null;};}function removeEntity(_0x3ae9cf,_0x54a830){return function(_0x11a5a3){if(_0x11a5a3){return _0x11a5a3[_0x9e0d('0x22')]()[_0x9e0d('0x21')](function(){var _0x537e63=_0x11a5a3['get']({'plain':!![]});var _0x3ce94f=_0x9e0d('0x23');return db['UserProfileResource'][_0x9e0d('0x22')]({'where':{'type':_0x3ce94f,'resourceId':_0x537e63['id']}})['then'](function(){return _0x11a5a3;});})['then'](function(){_0x3ae9cf[_0x9e0d('0x16')](0xcc)[_0x9e0d('0x17')]();});}};}function handleEntityNotFound(_0x39cfbf,_0x1f1209){return function(_0x1cd433){if(!_0x1cd433){_0x39cfbf[_0x9e0d('0x15')](0x194);}return _0x1cd433;};}function handleError(_0x3745f8,_0x427f73){_0x427f73=_0x427f73||0x1f4;return function(_0x586bc0){logger[_0x9e0d('0x24')](_0x586bc0[_0x9e0d('0x25')]);if(_0x586bc0[_0x9e0d('0x26')]){delete _0x586bc0[_0x9e0d('0x26')];}_0x3745f8[_0x9e0d('0x16')](_0x427f73)[_0x9e0d('0x27')](_0x586bc0);};}exports[_0x9e0d('0x28')]=function(_0x294983,_0x4923ba){var _0x424de0={},_0xa5501={},_0x5aef63={'count':0x0,'rows':[]};var _0x2f35ae=_[_0x9e0d('0x29')](db[_0x9e0d('0x2a')][_0x9e0d('0x2b')],function(_0x167143){return{'name':_0x167143[_0x9e0d('0x2c')],'type':_0x167143[_0x9e0d('0x2d')][_0x9e0d('0x2e')]};});_0xa5501[_0x9e0d('0x2f')]=_[_0x9e0d('0x29')](_0x2f35ae,_0x9e0d('0x26'));_0xa5501[_0x9e0d('0x30')]=_[_0x9e0d('0x31')](_0x294983[_0x9e0d('0x30')]);_0xa5501[_0x9e0d('0x32')]=_['intersection'](_0xa5501['model'],_0xa5501[_0x9e0d('0x30')]);_0x424de0[_0x9e0d('0x33')]=_[_0x9e0d('0x34')](_0xa5501['model'],qs[_0x9e0d('0x35')](_0x294983[_0x9e0d('0x30')][_0x9e0d('0x35')]));_0x424de0['attributes']=_0x424de0[_0x9e0d('0x33')][_0x9e0d('0x36')]?_0x424de0['attributes']:_0xa5501[_0x9e0d('0x2f')];if(!_0x294983[_0x9e0d('0x30')][_0x9e0d('0x37')](_0x9e0d('0x38'))){_0x424de0[_0x9e0d('0x1b')]=qs[_0x9e0d('0x1b')](_0x294983[_0x9e0d('0x30')][_0x9e0d('0x1b')]);_0x424de0[_0x9e0d('0x19')]=qs['offset'](_0x294983['query'][_0x9e0d('0x19')]);}_0x424de0[_0x9e0d('0x39')]=qs['sort'](_0x294983['query']['sort']);_0x424de0[_0x9e0d('0x3a')]=qs[_0x9e0d('0x32')](_[_0x9e0d('0x3b')](_0x294983[_0x9e0d('0x30')],_0xa5501[_0x9e0d('0x32')]),_0x2f35ae);if(_0x294983[_0x9e0d('0x30')]['filter']){_0x424de0['where']=_[_0x9e0d('0x3c')](_0x424de0[_0x9e0d('0x3a')],{'$or':_[_0x9e0d('0x29')](_0x2f35ae,function(_0x53856f){if(_0x53856f['type']!==_0x9e0d('0x3d')){var _0x411f07={};_0x411f07[_0x53856f[_0x9e0d('0x26')]]={'$like':'%'+_0x294983[_0x9e0d('0x30')]['filter']+'%'};return _0x411f07;}})});}_0x424de0=_['merge']({},_0x424de0,_0x294983[_0x9e0d('0x3e')]);var _0x5812a2={'where':_0x424de0[_0x9e0d('0x3a')]};return db[_0x9e0d('0x2a')][_0x9e0d('0x1c')](_0x5812a2)[_0x9e0d('0x21')](function(_0x241c50){_0x5aef63['count']=_0x241c50;if(_0x294983[_0x9e0d('0x30')][_0x9e0d('0x3f')]){_0x424de0['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x424de0);})[_0x9e0d('0x21')](function(_0x17a707){_0x5aef63[_0x9e0d('0x40')]=_0x17a707;return _0x5aef63;})[_0x9e0d('0x21')](respondWithFilteredResult(_0x4923ba,_0x424de0))['catch'](handleError(_0x4923ba,null));};exports[_0x9e0d('0x41')]=function(_0xd898b5,_0x10b5c9){var _0x140772={'raw':!![],'where':{'id':_0xd898b5[_0x9e0d('0x42')]['id']}},_0x335676={};_0x335676[_0x9e0d('0x2f')]=_['keys'](db[_0x9e0d('0x2a')][_0x9e0d('0x2b')]);_0x335676[_0x9e0d('0x30')]=_[_0x9e0d('0x31')](_0xd898b5[_0x9e0d('0x30')]);_0x335676[_0x9e0d('0x32')]=_[_0x9e0d('0x34')](_0x335676[_0x9e0d('0x2f')],_0x335676['query']);_0x140772[_0x9e0d('0x33')]=_[_0x9e0d('0x34')](_0x335676[_0x9e0d('0x2f')],qs[_0x9e0d('0x35')](_0xd898b5[_0x9e0d('0x30')][_0x9e0d('0x35')]));_0x140772[_0x9e0d('0x33')]=_0x140772[_0x9e0d('0x33')]['length']?_0x140772[_0x9e0d('0x33')]:_0x335676[_0x9e0d('0x2f')];if(_0xd898b5[_0x9e0d('0x30')][_0x9e0d('0x3f')]){_0x140772[_0x9e0d('0x43')]=[{'all':!![]}];}_0x140772=_['merge']({},_0x140772,_0xd898b5[_0x9e0d('0x3e')]);return db['AnalyticExtractedReport'][_0x9e0d('0x44')](_0x140772)[_0x9e0d('0x21')](handleEntityNotFound(_0x10b5c9,null))[_0x9e0d('0x21')](respondWithResult(_0x10b5c9,null))[_0x9e0d('0x45')](handleError(_0x10b5c9,null));};exports['create']=function(_0x50f5bd,_0x5086f9){return db[_0x9e0d('0x2a')][_0x9e0d('0x46')](_0x50f5bd[_0x9e0d('0x47')],{})[_0x9e0d('0x21')](function(_0x51afc9){var _0x3ba223=_0x50f5bd['user'][_0x9e0d('0x48')]({'plain':!![]});if(!_0x3ba223)throw new Error(_0x9e0d('0x49'));if(_0x3ba223['role']===_0x9e0d('0x4a')){var _0xb5998f=_0x51afc9[_0x9e0d('0x48')]({'plain':!![]});var _0x563b9e=_0x9e0d('0x23');return db[_0x9e0d('0x4b')][_0x9e0d('0x44')]({'where':{'name':_0x563b9e,'userProfileId':_0x3ba223[_0x9e0d('0x4c')]},'raw':!![]})[_0x9e0d('0x21')](function(_0x1404e8){if(_0x1404e8&&_0x1404e8['autoAssociation']===0x0){return db[_0x9e0d('0x4d')][_0x9e0d('0x46')]({'name':_0xb5998f['name'],'resourceId':_0xb5998f['id'],'type':_0x1404e8[_0x9e0d('0x26')],'sectionId':_0x1404e8['id']},{})[_0x9e0d('0x21')](function(){return _0x51afc9;});}else{return _0x51afc9;}})[_0x9e0d('0x45')](function(_0x4716a6){logger[_0x9e0d('0x24')](_0x9e0d('0x4e'),_0x4716a6);throw _0x4716a6;});}return _0x51afc9;})[_0x9e0d('0x21')](respondWithResult(_0x5086f9,0xc9))['catch'](handleError(_0x5086f9,null));};exports[_0x9e0d('0x20')]=function(_0x109ae4,_0x2dec6a){if(_0x109ae4[_0x9e0d('0x47')]['id']){delete _0x109ae4[_0x9e0d('0x47')]['id'];}return db[_0x9e0d('0x2a')][_0x9e0d('0x44')]({'where':{'id':_0x109ae4[_0x9e0d('0x42')]['id']}})[_0x9e0d('0x21')](handleEntityNotFound(_0x2dec6a,null))['then'](saveUpdates(_0x109ae4[_0x9e0d('0x47')],null))[_0x9e0d('0x21')](respondWithResult(_0x2dec6a,null))[_0x9e0d('0x45')](handleError(_0x2dec6a,null));};exports[_0x9e0d('0x22')]=function(_0x106983,_0x123256){return db[_0x9e0d('0x2a')][_0x9e0d('0x44')]({'where':{'id':_0x106983[_0x9e0d('0x42')]['id']}})[_0x9e0d('0x21')](handleEntityNotFound(_0x123256,null))[_0x9e0d('0x21')](removeEntity(_0x123256,null))[_0x9e0d('0x45')](handleError(_0x123256,null));};exports[_0x9e0d('0x4f')]=function(_0x3a32a9,_0x258d43,_0x3af534){return db['AnalyticExtractedReport'][_0x9e0d('0x44')]({'where':{'id':_0x3a32a9[_0x9e0d('0x42')]['id']},'attributes':[_0x9e0d('0x26'),_0x9e0d('0x50'),_0x9e0d('0x51'),_0x9e0d('0x52')],'raw':!![]})[_0x9e0d('0x21')](handleEntityNotFound(_0x258d43,null))['then'](function(_0x5916b5){if(_0x5916b5){if(!fs['existsSync'](path[_0x9e0d('0x53')](config[_0x9e0d('0x54')],_0x9e0d('0x55'),_0x5916b5[_0x9e0d('0x51')]))){throw new db['Sequelize'][(_0x9e0d('0x56'))](_0x9e0d('0x57'));}if(_0x3a32a9[_0x9e0d('0x30')]['exists']){return _0x258d43[_0x9e0d('0x15')](0xc8);}return _0x258d43[_0x9e0d('0x4f')](path[_0x9e0d('0x53')](config[_0x9e0d('0x54')],_0x9e0d('0x55'),_0x5916b5[_0x9e0d('0x51')]),util[_0x9e0d('0x58')](_0x9e0d('0x59'),_0x5916b5[_0x9e0d('0x50')]||_0x5916b5[_0x9e0d('0x26')],_0x5916b5[_0x9e0d('0x52')][_0x9e0d('0x5a')]()));}})[_0x9e0d('0x45')](handleError(_0x258d43,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 130140b..8979be9 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 _0xf506=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','AnalyticExtractedReport'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf506,0x129));var _0x6f50=function(_0x1ce954,_0x35fc49){_0x1ce954=_0x1ce954-0x0;var _0x1506d8=_0xf506[_0x1ce954];return _0x1506d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f50('0x0'))(_0x6f50('0x1'));var moment=require(_0x6f50('0x2'));var BPromise=require('bluebird');var rp=require(_0x6f50('0x3'));var fs=require('fs');var path=require(_0x6f50('0x4'));var rimraf=require(_0x6f50('0x5'));var config=require(_0x6f50('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0xc831b6,_0x17f908){return _0xc831b6[_0x6f50('0x7')](_0x6f50('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5f1=['path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xa5f1,0x157));var _0x1a5f=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa5f1[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x1a5f('0x0'));var util=require(_0x1a5f('0x1'));var logger=require(_0x1a5f('0x2'))(_0x1a5f('0x3'));var moment=require(_0x1a5f('0x4'));var BPromise=require(_0x1a5f('0x5'));var rp=require(_0x1a5f('0x6'));var fs=require('fs');var path=require(_0x1a5f('0x7'));var rimraf=require(_0x1a5f('0x8'));var config=require(_0x1a5f('0x9'));var attributes=require('./analyticExtractedReport.attributes');module[_0x1a5f('0xa')]=function(_0xa08486,_0x3b6126){return _0xa08486[_0x1a5f('0xb')](_0x1a5f('0xc'),attributes,{'tableName':_0x1a5f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 4f7d8bd..d7d28ea 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 _0x3d21=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2c4e8b,_0x5daae4){var _0xf4471a=function(_0x242405){while(--_0x242405){_0x2c4e8b['push'](_0x2c4e8b['shift']());}};_0xf4471a(++_0x5daae4);}(_0x3d21,0x11e));var _0x13d2=function(_0x35f468,_0x3e0cdd){_0x35f468=_0x35f468-0x0;var _0x31810c=_0x3d21[_0x35f468];return _0x31810c;};'use strict';var _=require(_0x13d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x13d2('0x1'));var rs=require(_0x13d2('0x2'));var fs=require('fs');var Redis=require(_0x13d2('0x3'));var db=require(_0x13d2('0x4'))['db'];var utils=require(_0x13d2('0x5'));var logger=require(_0x13d2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x13d2('0x7'));var client=jayson[_0x13d2('0x8')][_0x13d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233321,_0x1319fd,_0x3cfea1){return new BPromise(function(_0x485151,_0x4cf3de){return client[_0x13d2('0xa')](_0x233321,_0x3cfea1)[_0x13d2('0xb')](function(_0x39bd0c){logger['info'](_0x13d2('0xc'),_0x1319fd,_0x13d2('0xd'));logger[_0x13d2('0xe')](_0x13d2('0xf'),_0x1319fd,'request\x20sent',JSON[_0x13d2('0x10')](_0x39bd0c));if(_0x39bd0c[_0x13d2('0x11')]){if(_0x39bd0c['error'][_0x13d2('0x12')]===0x1f4){logger[_0x13d2('0x11')](_0x13d2('0xc'),_0x1319fd,_0x39bd0c[_0x13d2('0x11')]['message']);return _0x4cf3de(_0x39bd0c['error']['message']);}logger[_0x13d2('0x11')](_0x13d2('0xc'),_0x1319fd,_0x39bd0c[_0x13d2('0x11')][_0x13d2('0x13')]);return _0x485151(_0x39bd0c['error']['message']);}else{logger[_0x13d2('0x14')](_0x13d2('0xc'),_0x1319fd,_0x13d2('0xd'));_0x485151(_0x39bd0c[_0x13d2('0x15')]['message']);}})[_0x13d2('0x16')](function(_0x5f2dcd){logger[_0x13d2('0x11')](_0x13d2('0xc'),_0x1319fd,_0x5f2dcd);_0x4cf3de(_0x5f2dcd);});});} \ No newline at end of file +var _0x7618=['rpc','jayson/promise','http','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5cc646,_0x4b6f67){var _0x5f3bc5=function(_0x3aaa29){while(--_0x3aaa29){_0x5cc646['push'](_0x5cc646['shift']());}};_0x5f3bc5(++_0x4b6f67);}(_0x7618,0x119));var _0x8761=function(_0x356f65,_0x2a68f0){_0x356f65=_0x356f65-0x0;var _0x26f679=_0x7618[_0x356f65];return _0x26f679;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8761('0x0'));var rs=require(_0x8761('0x1'));var fs=require('fs');var Redis=require(_0x8761('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8761('0x3'));var logger=require('../../config/logger')(_0x8761('0x4'));var config=require('../../config/environment');var jayson=require(_0x8761('0x5'));var client=jayson['client'][_0x8761('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a293c,_0x3199bf,_0xc5fc17){return new BPromise(function(_0x34b055,_0x2471d0){return client[_0x8761('0x7')](_0x1a293c,_0xc5fc17)[_0x8761('0x8')](function(_0x2f3224){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3199bf,_0x8761('0x9'));logger[_0x8761('0xa')](_0x8761('0xb'),_0x3199bf,_0x8761('0x9'),JSON[_0x8761('0xc')](_0x2f3224));if(_0x2f3224[_0x8761('0xd')]){if(_0x2f3224[_0x8761('0xd')][_0x8761('0xe')]===0x1f4){logger[_0x8761('0xd')](_0x8761('0xf'),_0x3199bf,_0x2f3224[_0x8761('0xd')]['message']);return _0x2471d0(_0x2f3224['error'][_0x8761('0x10')]);}logger[_0x8761('0xd')](_0x8761('0xf'),_0x3199bf,_0x2f3224['error']['message']);return _0x34b055(_0x2f3224[_0x8761('0xd')][_0x8761('0x10')]);}else{logger['info'](_0x8761('0xf'),_0x3199bf,_0x8761('0x9'));_0x34b055(_0x2f3224[_0x8761('0x11')][_0x8761('0x10')]);}})[_0x8761('0x12')](function(_0x1a6ae5){logger[_0x8761('0xd')](_0x8761('0xf'),_0x3199bf,_0x1a6ae5);_0x2471d0(_0x1a6ae5);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index cd10854..4921986 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 _0xa9ae=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','update','delete','destroy','exports'];(function(_0x5499d9,_0x1abd4f){var _0x52054c=function(_0x2205bc){while(--_0x2205bc){_0x5499d9['push'](_0x5499d9['shift']());}};_0x52054c(++_0x1abd4f);}(_0xa9ae,0x17c));var _0xea9a=function(_0x10aca3,_0x4204d1){_0x10aca3=_0x10aca3-0x0;var _0x3da238=_0xa9ae[_0x10aca3];return _0x3da238;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea9a('0x0'));var timeout=require(_0xea9a('0x1'));var express=require('express');var router=express[_0xea9a('0x2')]();var fs_extra=require(_0xea9a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xea9a('0x4'));var config=require(_0xea9a('0x5'));var controller=require(_0xea9a('0x6'));router[_0xea9a('0x7')]('/',auth['isAuthenticated'](),controller[_0xea9a('0x8')]);router[_0xea9a('0x7')](_0xea9a('0x9'),auth[_0xea9a('0xa')](),controller[_0xea9a('0xb')]);router['get'](_0xea9a('0xc'),auth[_0xea9a('0xa')](),controller['download']);router[_0xea9a('0xd')]('/',auth[_0xea9a('0xa')](),controller[_0xea9a('0xe')]);router[_0xea9a('0xf')](_0xea9a('0x9'),auth[_0xea9a('0xa')](),controller[_0xea9a('0x10')]);router[_0xea9a('0x11')]('/:id',auth[_0xea9a('0xa')](),controller[_0xea9a('0x12')]);module[_0xea9a('0x13')]=router; \ No newline at end of file +var _0xec61=['isAuthenticated','index','get','/:id','show','/:id/download','post','create','update','delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xec61,0x1ce));var _0x1ec6=function(_0x55ea5f,_0x4c15e6){_0x55ea5f=_0x55ea5f-0x0;var _0x4dd827=_0xec61[_0x55ea5f];return _0x4dd827;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ec6('0x0')]();var fs_extra=require(_0x1ec6('0x1'));var auth=require(_0x1ec6('0x2'));var interaction=require(_0x1ec6('0x3'));var config=require(_0x1ec6('0x4'));var controller=require(_0x1ec6('0x5'));router['get']('/',auth[_0x1ec6('0x6')](),controller[_0x1ec6('0x7')]);router[_0x1ec6('0x8')](_0x1ec6('0x9'),auth['isAuthenticated'](),controller[_0x1ec6('0xa')]);router[_0x1ec6('0x8')](_0x1ec6('0xb'),auth[_0x1ec6('0x6')](),controller['download']);router[_0x1ec6('0xc')]('/',auth['isAuthenticated'](),controller[_0x1ec6('0xd')]);router['put']('/:id',auth[_0x1ec6('0x6')](),controller[_0x1ec6('0xe')]);router[_0x1ec6('0xf')](_0x1ec6('0x9'),auth[_0x1ec6('0x6')](),controller[_0x1ec6('0x10')]);module[_0x1ec6('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 7b69563..fb885b9 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 _0x4c49=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x35ff13,_0x1b4f7b){var _0x18b056=function(_0x346327){while(--_0x346327){_0x35ff13['push'](_0x35ff13['shift']());}};_0x18b056(++_0x1b4f7b);}(_0x4c49,0x130));var _0x94c4=function(_0x2949cc,_0x1e2d12){_0x2949cc=_0x2949cc-0x0;var _0x9f4fda=_0x4c49[_0x2949cc];return _0x9f4fda;};'use strict';var Sequelize=require(_0x94c4('0x0'));module[_0x94c4('0x1')]={'field':{'type':Sequelize[_0x94c4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x94c4('0x3')]},'format':{'type':Sequelize[_0x94c4('0x3')]},'groupBy':{'type':Sequelize[_0x94c4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x94c4('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xee13=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x17a4f5,_0x4a9cdc){var _0x57baee=function(_0x365af2){while(--_0x365af2){_0x17a4f5['push'](_0x17a4f5['shift']());}};_0x57baee(++_0x4a9cdc);}(_0xee13,0x143));var _0x3ee1=function(_0x16c696,_0x2a7b16){_0x16c696=_0x16c696-0x0;var _0x559265=_0xee13[_0x16c696];return _0x559265;};'use strict';var Sequelize=require(_0x3ee1('0x0'));module[_0x3ee1('0x1')]={'field':{'type':Sequelize[_0x3ee1('0x2')]},'alias':{'type':Sequelize[_0x3ee1('0x3')]},'function':{'type':Sequelize[_0x3ee1('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3ee1('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3ee1('0x3')]},'custom':{'type':Sequelize[_0x3ee1('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index ce9dec7..c59c255 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 _0x241b=['hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','show','params','options','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','attributes','fields','length'];(function(_0x184185,_0x3ccb4f){var _0x1565a5=function(_0x2c4ac3){while(--_0x2c4ac3){_0x184185['push'](_0x184185['shift']());}};_0x1565a5(++_0x3ccb4f);}(_0x241b,0x1c9));var _0xb241=function(_0x61b18a,_0x5824ac){_0x61b18a=_0x61b18a-0x0;var _0x541b0b=_0x241b[_0x61b18a];return _0x541b0b;};'use strict';var emlformat=require(_0xb241('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb241('0x1'));var jsonpatch=require(_0xb241('0x2'));var rp=require(_0xb241('0x3'));var moment=require(_0xb241('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb241('0x5'));var util=require(_0xb241('0x6'));var path=require(_0xb241('0x7'));var sox=require(_0xb241('0x8'));var csv=require('to-csv');var ejs=require(_0xb241('0x9'));var fs=require('fs');var fs_extra=require(_0xb241('0xa'));var _=require(_0xb241('0xb'));var squel=require(_0xb241('0xc'));var crypto=require(_0xb241('0xd'));var jsforce=require(_0xb241('0xe'));var deskjs=require(_0xb241('0xf'));var toCsv=require(_0xb241('0x10'));var querystring=require(_0xb241('0x11'));var Papa=require(_0xb241('0x12'));var Redis=require(_0xb241('0x13'));var authService=require(_0xb241('0x14'));var qs=require(_0xb241('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb241('0x16'))('api');var utils=require(_0xb241('0x17'));var config=require(_0xb241('0x18'));var licenseUtil=require(_0xb241('0x19'));var db=require(_0xb241('0x1a'))['db'];function respondWithStatusCode(_0x4d28d3,_0x43b716){_0x43b716=_0x43b716||0xcc;return function(_0x1b7c8d){if(_0x1b7c8d){return _0x4d28d3[_0xb241('0x1b')](_0x43b716);}return _0x4d28d3[_0xb241('0x1c')](_0x43b716)[_0xb241('0x1d')]();};}function respondWithResult(_0x1f15a5,_0x4149de){_0x4149de=_0x4149de||0xc8;return function(_0x5e9886){if(_0x5e9886){return _0x1f15a5[_0xb241('0x1c')](_0x4149de)[_0xb241('0x1e')](_0x5e9886);}};}function respondWithFilteredResult(_0x240c75,_0x3a385a){return function(_0xbc3f7b){if(_0xbc3f7b){var _0x39be61=typeof _0x3a385a[_0xb241('0x1f')]===_0xb241('0x20')&&typeof _0x3a385a[_0xb241('0x21')]==='undefined';var _0x3c4904=_0xbc3f7b[_0xb241('0x22')];var _0xf7eaec=_0x39be61?0x0:_0x3a385a['offset'];var _0x3cbb65=_0x39be61?_0xbc3f7b[_0xb241('0x22')]:_0x3a385a[_0xb241('0x1f')]+_0x3a385a[_0xb241('0x21')];var _0x3c0315;if(_0x3cbb65>=_0x3c4904){_0x3cbb65=_0x3c4904;_0x3c0315=0xc8;}else{_0x3c0315=0xce;}_0x240c75[_0xb241('0x1c')](_0x3c0315);return _0x240c75[_0xb241('0x23')](_0xb241('0x24'),_0xf7eaec+'-'+_0x3cbb65+'/'+_0x3c4904)['json'](_0xbc3f7b);}return null;};}function patchUpdates(_0x4133a3){return function(_0x3aac12){try{jsonpatch[_0xb241('0x25')](_0x3aac12,_0x4133a3,!![]);}catch(_0x199334){return BPromise[_0xb241('0x26')](_0x199334);}return _0x3aac12[_0xb241('0x27')]();};}function saveUpdates(_0x2b0e28,_0x1afdb4){return function(_0x2e6286){if(_0x2e6286){return _0x2e6286[_0xb241('0x28')](_0x2b0e28)[_0xb241('0x29')](function(_0x568c0e){return _0x568c0e;});}return null;};}function removeEntity(_0xff5ef4,_0x413225){return function(_0x1342c4){if(_0x1342c4){return _0x1342c4[_0xb241('0x2a')]()[_0xb241('0x29')](function(){_0xff5ef4[_0xb241('0x1c')](0xcc)[_0xb241('0x1d')]();});}};}function handleEntityNotFound(_0xfd1ea1,_0x306178){return function(_0x44822d){if(!_0x44822d){_0xfd1ea1[_0xb241('0x1b')](0x194);}return _0x44822d;};}function handleError(_0x230a63,_0x5210de){_0x5210de=_0x5210de||0x1f4;return function(_0x39c062){logger[_0xb241('0x2b')](_0x39c062['stack']);if(_0x39c062['name']){delete _0x39c062['name'];}_0x230a63[_0xb241('0x1c')](_0x5210de)[_0xb241('0x2c')](_0x39c062);};}exports[_0xb241('0x2d')]=function(_0x1f5d3a,_0x1641b6){var _0x5cd228={},_0x4a0dad={},_0x23ce86={'count':0x0,'rows':[]};var _0x54e920=_[_0xb241('0x2e')](db[_0xb241('0x2f')][_0xb241('0x30')],function(_0x4d36ac){return{'name':_0x4d36ac[_0xb241('0x31')],'type':_0x4d36ac['type']['key']};});_0x4a0dad[_0xb241('0x32')]=_[_0xb241('0x2e')](_0x54e920,_0xb241('0x33'));_0x4a0dad['query']=_[_0xb241('0x34')](_0x1f5d3a[_0xb241('0x35')]);_0x4a0dad[_0xb241('0x36')]=_[_0xb241('0x37')](_0x4a0dad[_0xb241('0x32')],_0x4a0dad['query']);_0x5cd228[_0xb241('0x38')]=_['intersection'](_0x4a0dad[_0xb241('0x32')],qs[_0xb241('0x39')](_0x1f5d3a[_0xb241('0x35')][_0xb241('0x39')]));_0x5cd228[_0xb241('0x38')]=_0x5cd228['attributes'][_0xb241('0x3a')]?_0x5cd228[_0xb241('0x38')]:_0x4a0dad[_0xb241('0x32')];if(!_0x1f5d3a[_0xb241('0x35')][_0xb241('0x3b')]('nolimit')){_0x5cd228[_0xb241('0x21')]=qs[_0xb241('0x21')](_0x1f5d3a['query'][_0xb241('0x21')]);_0x5cd228[_0xb241('0x1f')]=qs[_0xb241('0x1f')](_0x1f5d3a[_0xb241('0x35')][_0xb241('0x1f')]);}_0x5cd228[_0xb241('0x3c')]=qs[_0xb241('0x3d')](_0x1f5d3a['query'][_0xb241('0x3d')]);_0x5cd228[_0xb241('0x3e')]=qs[_0xb241('0x36')](_[_0xb241('0x3f')](_0x1f5d3a[_0xb241('0x35')],_0x4a0dad[_0xb241('0x36')]),_0x54e920);if(_0x1f5d3a[_0xb241('0x35')][_0xb241('0x40')]){_0x5cd228['where']=_[_0xb241('0x41')](_0x5cd228[_0xb241('0x3e')],{'$or':_[_0xb241('0x2e')](_0x54e920,function(_0x19fccb){if(_0x19fccb[_0xb241('0x42')]!=='VIRTUAL'){var _0x20bbfe={};_0x20bbfe[_0x19fccb['name']]={'$like':'%'+_0x1f5d3a[_0xb241('0x35')][_0xb241('0x40')]+'%'};return _0x20bbfe;}})});}_0x5cd228=_[_0xb241('0x41')]({},_0x5cd228,_0x1f5d3a['options']);var _0x9591c9={'where':_0x5cd228[_0xb241('0x3e')]};return db['AnalyticFieldReport']['count'](_0x9591c9)['then'](function(_0x382175){_0x23ce86[_0xb241('0x22')]=_0x382175;if(_0x1f5d3a[_0xb241('0x35')][_0xb241('0x43')]){_0x5cd228[_0xb241('0x44')]=[{'all':!![]}];}return db[_0xb241('0x2f')][_0xb241('0x45')](_0x5cd228);})['then'](function(_0x564578){_0x23ce86['rows']=_0x564578;return _0x23ce86;})['then'](respondWithFilteredResult(_0x1641b6,_0x5cd228))[_0xb241('0x46')](handleError(_0x1641b6,null));};exports[_0xb241('0x47')]=function(_0x201f02,_0x579168){var _0x4ebcaf={'raw':![],'where':{'id':_0x201f02[_0xb241('0x48')]['id']}},_0x10a85f={};_0x10a85f['model']=_[_0xb241('0x34')](db[_0xb241('0x2f')][_0xb241('0x30')]);_0x10a85f['query']=_[_0xb241('0x34')](_0x201f02[_0xb241('0x35')]);_0x10a85f['filters']=_[_0xb241('0x37')](_0x10a85f[_0xb241('0x32')],_0x10a85f[_0xb241('0x35')]);_0x4ebcaf[_0xb241('0x38')]=_[_0xb241('0x37')](_0x10a85f[_0xb241('0x32')],qs[_0xb241('0x39')](_0x201f02[_0xb241('0x35')][_0xb241('0x39')]));_0x4ebcaf[_0xb241('0x38')]=_0x4ebcaf[_0xb241('0x38')]['length']?_0x4ebcaf[_0xb241('0x38')]:_0x10a85f['model'];if(_0x201f02[_0xb241('0x35')][_0xb241('0x43')]){_0x4ebcaf[_0xb241('0x44')]=[{'all':!![]}];}_0x4ebcaf=_[_0xb241('0x41')]({},_0x4ebcaf,_0x201f02[_0xb241('0x49')]);return db[_0xb241('0x2f')][_0xb241('0x4a')](_0x4ebcaf)['then'](handleEntityNotFound(_0x579168,null))['then'](respondWithResult(_0x579168,null))[_0xb241('0x46')](handleError(_0x579168,null));};exports[_0xb241('0x4b')]=function(_0x5bc862,_0x549233){return db[_0xb241('0x2f')][_0xb241('0x4b')](_0x5bc862['body'],{})['then'](respondWithResult(_0x549233,0xc9))['catch'](handleError(_0x549233,null));};exports[_0xb241('0x4c')]=function(_0x1063d8,_0x312190){return db[_0xb241('0x2f')][_0xb241('0x4c')](_0x1063d8['body'],{'raw':![],'individualHooks':!![]})[_0xb241('0x29')](respondWithResult(_0x312190,0xc9))[_0xb241('0x46')](handleError(_0x312190,null));};exports['update']=function(_0x549d2b,_0x4c3d0d){if(_0x549d2b[_0xb241('0x4d')]['id']){delete _0x549d2b[_0xb241('0x4d')]['id'];}return db[_0xb241('0x2f')][_0xb241('0x4a')]({'where':{'id':_0x549d2b['params']['id']}})[_0xb241('0x29')](handleEntityNotFound(_0x4c3d0d,null))['then'](saveUpdates(_0x549d2b['body'],null))[_0xb241('0x29')](respondWithResult(_0x4c3d0d,null))[_0xb241('0x46')](handleError(_0x4c3d0d,null));};exports[_0xb241('0x2a')]=function(_0x2a71f4,_0x2ddd18){return db['AnalyticFieldReport']['find']({'where':{'id':_0x2a71f4[_0xb241('0x48')]['id']}})[_0xb241('0x29')](handleEntityNotFound(_0x2ddd18,null))['then'](removeEntity(_0x2ddd18,null))[_0xb241('0x46')](handleError(_0x2ddd18,null));};exports[_0xb241('0x4e')]=function(_0x6592f6,_0x52c682){return db[_0xb241('0x2f')][_0xb241('0x2a')]({'where':{'id':_0x6592f6[_0xb241('0x35')][_0xb241('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0xb241('0x29')](respondWithResult(_0x52c682,0xcc))[_0xb241('0x46')](handleError(_0x52c682,null));};exports[_0xb241('0x50')]=function(_0x433713,_0x3bc499,_0x3228e9){return db[_0xb241('0x51')][_0xb241('0x52')]({'where':{'id':_0x433713[_0xb241('0x48')]['id']}})[_0xb241('0x29')](handleEntityNotFound(_0x3bc499,null))['then'](function(_0x2fd718){if(_0x2fd718){return db[_0xb241('0x53')][_0xb241('0x54')](function(_0x2d6805){return db[_0xb241('0x2f')][_0xb241('0x2a')]({'where':{'CustomReportId':_0x433713[_0xb241('0x48')]['id']},'transaction':_0x2d6805})[_0xb241('0x29')](function(_0x28a491){var _0x3c8c85=_[_0xb241('0x2e')](_0x433713[_0xb241('0x4d')],function(_0x1e5798){delete _0x1e5798['id'];_0x1e5798[_0xb241('0x55')]=_0x433713['params']['id'];return _0x1e5798;});return db[_0xb241('0x2f')][_0xb241('0x4c')](_0x3c8c85,{'transaction':_0x2d6805});});})[_0xb241('0x29')](function(){return db[_0xb241('0x2f')]['findAll']({'where':{'CustomReportId':_0x433713[_0xb241('0x48')]['id']}});});}})['then'](respondWithResult(_0x3bc499,null))[_0xb241('0x46')](handleError(_0x3bc499,null));}; \ No newline at end of file +var _0xaf66=['limit','count','apply','reject','then','destroy','end','stack','name','send','index','rawAttributes','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','includeAll','AnalyticFieldReport','rows','params','include','options','create','catch','bulkCreate','body','update','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x2f0511,_0x690dbe){var _0x27a0eb=function(_0x39042e){while(--_0x39042e){_0x2f0511['push'](_0x2f0511['shift']());}};_0x27a0eb(++_0x690dbe);}(_0xaf66,0x7f));var _0x6af6=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0xaf66[_0x5806c3];return _0x48ac77;};'use strict';var emlformat=require(_0x6af6('0x0'));var rimraf=require(_0x6af6('0x1'));var zipdir=require(_0x6af6('0x2'));var jsonpatch=require(_0x6af6('0x3'));var rp=require(_0x6af6('0x4'));var moment=require('moment');var BPromise=require(_0x6af6('0x5'));var Mustache=require(_0x6af6('0x6'));var util=require('util');var path=require(_0x6af6('0x7'));var sox=require(_0x6af6('0x8'));var csv=require(_0x6af6('0x9'));var ejs=require(_0x6af6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6af6('0xb'));var squel=require(_0x6af6('0xc'));var crypto=require(_0x6af6('0xd'));var jsforce=require(_0x6af6('0xe'));var deskjs=require(_0x6af6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6af6('0x10'));var Redis=require(_0x6af6('0x11'));var authService=require(_0x6af6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6af6('0x13'));var hardwareService=require(_0x6af6('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6af6('0x15'));var config=require(_0x6af6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6af6('0x17'))['db'];function respondWithStatusCode(_0x57d47f,_0x1589f7){_0x1589f7=_0x1589f7||0xcc;return function(_0x5b5a2e){if(_0x5b5a2e){return _0x57d47f[_0x6af6('0x18')](_0x1589f7);}return _0x57d47f[_0x6af6('0x19')](_0x1589f7)['end']();};}function respondWithResult(_0x38bc9f,_0x550f06){_0x550f06=_0x550f06||0xc8;return function(_0x1e1679){if(_0x1e1679){return _0x38bc9f['status'](_0x550f06)[_0x6af6('0x1a')](_0x1e1679);}};}function respondWithFilteredResult(_0xa790d6,_0x48687a){return function(_0x23a015){if(_0x23a015){var _0x5c3ae5=typeof _0x48687a[_0x6af6('0x1b')]===_0x6af6('0x1c')&&typeof _0x48687a[_0x6af6('0x1d')]===_0x6af6('0x1c');var _0x28f8fd=_0x23a015[_0x6af6('0x1e')];var _0x148761=_0x5c3ae5?0x0:_0x48687a['offset'];var _0x1938cc=_0x5c3ae5?_0x23a015[_0x6af6('0x1e')]:_0x48687a[_0x6af6('0x1b')]+_0x48687a['limit'];var _0x41c1c9;if(_0x1938cc>=_0x28f8fd){_0x1938cc=_0x28f8fd;_0x41c1c9=0xc8;}else{_0x41c1c9=0xce;}_0xa790d6['status'](_0x41c1c9);return _0xa790d6['set']('Content-Range',_0x148761+'-'+_0x1938cc+'/'+_0x28f8fd)[_0x6af6('0x1a')](_0x23a015);}return null;};}function patchUpdates(_0x2649c1){return function(_0x3ae235){try{jsonpatch[_0x6af6('0x1f')](_0x3ae235,_0x2649c1,!![]);}catch(_0x323ce5){return BPromise[_0x6af6('0x20')](_0x323ce5);}return _0x3ae235['save']();};}function saveUpdates(_0x4224a5,_0x4e191c){return function(_0x2489a9){if(_0x2489a9){return _0x2489a9['update'](_0x4224a5)[_0x6af6('0x21')](function(_0x3aa6e9){return _0x3aa6e9;});}return null;};}function removeEntity(_0x49e32d,_0x1ca2db){return function(_0x12bc97){if(_0x12bc97){return _0x12bc97[_0x6af6('0x22')]()[_0x6af6('0x21')](function(){_0x49e32d[_0x6af6('0x19')](0xcc)[_0x6af6('0x23')]();});}};}function handleEntityNotFound(_0x1a6137,_0x19582e){return function(_0x418bc0){if(!_0x418bc0){_0x1a6137[_0x6af6('0x18')](0x194);}return _0x418bc0;};}function handleError(_0x39e5e7,_0x22c1b2){_0x22c1b2=_0x22c1b2||0x1f4;return function(_0x575462){logger['error'](_0x575462[_0x6af6('0x24')]);if(_0x575462[_0x6af6('0x25')]){delete _0x575462[_0x6af6('0x25')];}_0x39e5e7[_0x6af6('0x19')](_0x22c1b2)[_0x6af6('0x26')](_0x575462);};}exports[_0x6af6('0x27')]=function(_0x1002ec,_0x4175a6){var _0xa08e2f={},_0x25f25a={},_0x444c02={'count':0x0,'rows':[]};var _0x2b5a6a=_['map'](db['AnalyticFieldReport'][_0x6af6('0x28')],function(_0x2cae58){return{'name':_0x2cae58['fieldName'],'type':_0x2cae58[_0x6af6('0x29')][_0x6af6('0x2a')]};});_0x25f25a['model']=_['map'](_0x2b5a6a,_0x6af6('0x25'));_0x25f25a['query']=_[_0x6af6('0x2b')](_0x1002ec[_0x6af6('0x2c')]);_0x25f25a[_0x6af6('0x2d')]=_[_0x6af6('0x2e')](_0x25f25a['model'],_0x25f25a[_0x6af6('0x2c')]);_0xa08e2f[_0x6af6('0x2f')]=_[_0x6af6('0x2e')](_0x25f25a['model'],qs[_0x6af6('0x30')](_0x1002ec['query'][_0x6af6('0x30')]));_0xa08e2f[_0x6af6('0x2f')]=_0xa08e2f[_0x6af6('0x2f')][_0x6af6('0x31')]?_0xa08e2f[_0x6af6('0x2f')]:_0x25f25a[_0x6af6('0x32')];if(!_0x1002ec[_0x6af6('0x2c')][_0x6af6('0x33')](_0x6af6('0x34'))){_0xa08e2f['limit']=qs[_0x6af6('0x1d')](_0x1002ec['query'][_0x6af6('0x1d')]);_0xa08e2f['offset']=qs['offset'](_0x1002ec[_0x6af6('0x2c')][_0x6af6('0x1b')]);}_0xa08e2f['order']=qs[_0x6af6('0x35')](_0x1002ec[_0x6af6('0x2c')]['sort']);_0xa08e2f[_0x6af6('0x36')]=qs[_0x6af6('0x2d')](_[_0x6af6('0x37')](_0x1002ec[_0x6af6('0x2c')],_0x25f25a[_0x6af6('0x2d')]),_0x2b5a6a);if(_0x1002ec[_0x6af6('0x2c')]['filter']){_0xa08e2f['where']=_['merge'](_0xa08e2f[_0x6af6('0x36')],{'$or':_[_0x6af6('0x38')](_0x2b5a6a,function(_0x3e0e3f){if(_0x3e0e3f[_0x6af6('0x29')]!==_0x6af6('0x39')){var _0x272945={};_0x272945[_0x3e0e3f['name']]={'$like':'%'+_0x1002ec[_0x6af6('0x2c')]['filter']+'%'};return _0x272945;}})});}_0xa08e2f=_[_0x6af6('0x3a')]({},_0xa08e2f,_0x1002ec['options']);var _0x5a4973={'where':_0xa08e2f[_0x6af6('0x36')]};return db['AnalyticFieldReport']['count'](_0x5a4973)['then'](function(_0x442421){_0x444c02[_0x6af6('0x1e')]=_0x442421;if(_0x1002ec['query'][_0x6af6('0x3b')]){_0xa08e2f['include']=[{'all':!![]}];}return db[_0x6af6('0x3c')]['findAll'](_0xa08e2f);})[_0x6af6('0x21')](function(_0xc00a32){_0x444c02[_0x6af6('0x3d')]=_0xc00a32;return _0x444c02;})[_0x6af6('0x21')](respondWithFilteredResult(_0x4175a6,_0xa08e2f))['catch'](handleError(_0x4175a6,null));};exports['show']=function(_0x378169,_0x307033){var _0x194c17={'raw':![],'where':{'id':_0x378169[_0x6af6('0x3e')]['id']}},_0x561567={};_0x561567[_0x6af6('0x32')]=_['keys'](db['AnalyticFieldReport'][_0x6af6('0x28')]);_0x561567[_0x6af6('0x2c')]=_['keys'](_0x378169[_0x6af6('0x2c')]);_0x561567[_0x6af6('0x2d')]=_[_0x6af6('0x2e')](_0x561567[_0x6af6('0x32')],_0x561567[_0x6af6('0x2c')]);_0x194c17[_0x6af6('0x2f')]=_[_0x6af6('0x2e')](_0x561567[_0x6af6('0x32')],qs[_0x6af6('0x30')](_0x378169[_0x6af6('0x2c')][_0x6af6('0x30')]));_0x194c17[_0x6af6('0x2f')]=_0x194c17['attributes'][_0x6af6('0x31')]?_0x194c17['attributes']:_0x561567[_0x6af6('0x32')];if(_0x378169[_0x6af6('0x2c')]['includeAll']){_0x194c17[_0x6af6('0x3f')]=[{'all':!![]}];}_0x194c17=_['merge']({},_0x194c17,_0x378169[_0x6af6('0x40')]);return db[_0x6af6('0x3c')]['find'](_0x194c17)[_0x6af6('0x21')](handleEntityNotFound(_0x307033,null))[_0x6af6('0x21')](respondWithResult(_0x307033,null))['catch'](handleError(_0x307033,null));};exports['create']=function(_0x5dcac7,_0x2cbf5a){return db[_0x6af6('0x3c')][_0x6af6('0x41')](_0x5dcac7['body'],{})[_0x6af6('0x21')](respondWithResult(_0x2cbf5a,0xc9))[_0x6af6('0x42')](handleError(_0x2cbf5a,null));};exports[_0x6af6('0x43')]=function(_0x553621,_0x35efb4){return db[_0x6af6('0x3c')]['bulkCreate'](_0x553621[_0x6af6('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x35efb4,0xc9))[_0x6af6('0x42')](handleError(_0x35efb4,null));};exports[_0x6af6('0x45')]=function(_0x450f3c,_0x25e282){if(_0x450f3c[_0x6af6('0x44')]['id']){delete _0x450f3c[_0x6af6('0x44')]['id'];}return db['AnalyticFieldReport'][_0x6af6('0x46')]({'where':{'id':_0x450f3c[_0x6af6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x25e282,null))[_0x6af6('0x21')](saveUpdates(_0x450f3c['body'],null))[_0x6af6('0x21')](respondWithResult(_0x25e282,null))[_0x6af6('0x42')](handleError(_0x25e282,null));};exports[_0x6af6('0x22')]=function(_0x54096f,_0x3677bf){return db[_0x6af6('0x3c')][_0x6af6('0x46')]({'where':{'id':_0x54096f[_0x6af6('0x3e')]['id']}})[_0x6af6('0x21')](handleEntityNotFound(_0x3677bf,null))[_0x6af6('0x21')](removeEntity(_0x3677bf,null))[_0x6af6('0x42')](handleError(_0x3677bf,null));};exports[_0x6af6('0x47')]=function(_0x402eff,_0x466c49){return db['AnalyticFieldReport'][_0x6af6('0x22')]({'where':{'id':_0x402eff[_0x6af6('0x2c')][_0x6af6('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x6af6('0x21')](respondWithResult(_0x466c49,0xcc))[_0x6af6('0x42')](handleError(_0x466c49,null));};exports[_0x6af6('0x49')]=function(_0x1f6160,_0x5aa729,_0x3e87cf){return db[_0x6af6('0x4a')][_0x6af6('0x4b')]({'where':{'id':_0x1f6160[_0x6af6('0x3e')]['id']}})[_0x6af6('0x21')](handleEntityNotFound(_0x5aa729,null))[_0x6af6('0x21')](function(_0x7203f2){if(_0x7203f2){return db['sequelize']['transaction'](function(_0x3d942c){return db[_0x6af6('0x3c')][_0x6af6('0x22')]({'where':{'CustomReportId':_0x1f6160[_0x6af6('0x3e')]['id']},'transaction':_0x3d942c})[_0x6af6('0x21')](function(_0x548db7){var _0x2cb463=_['map'](_0x1f6160['body'],function(_0x5587cd){delete _0x5587cd['id'];_0x5587cd[_0x6af6('0x4c')]=_0x1f6160['params']['id'];return _0x5587cd;});return db[_0x6af6('0x3c')]['bulkCreate'](_0x2cb463,{'transaction':_0x3d942c});});})[_0x6af6('0x21')](function(){return db[_0x6af6('0x3c')][_0x6af6('0x4d')]({'where':{'CustomReportId':_0x1f6160[_0x6af6('0x3e')]['id']}});});}})[_0x6af6('0x21')](respondWithResult(_0x5aa729,null))[_0x6af6('0x42')](handleError(_0x5aa729,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 119a1c5..c741429 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 _0x2491=['AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x2a6c59,_0x23e7a4){var _0x5ea368=function(_0x383b36){while(--_0x383b36){_0x2a6c59['push'](_0x2a6c59['shift']());}};_0x5ea368(++_0x23e7a4);}(_0x2491,0x7a));var _0x1249=function(_0xfddd81,_0x58f13e){_0xfddd81=_0xfddd81-0x0;var _0x122068=_0x2491[_0xfddd81];return _0x122068;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1249('0x0'))(_0x1249('0x1'));var moment=require(_0x1249('0x2'));var BPromise=require('bluebird');var rp=require(_0x1249('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1249('0x4'));var attributes=require(_0x1249('0x5'));module[_0x1249('0x6')]=function(_0x15fc43,_0x3ece1a){return _0x15fc43[_0x1249('0x7')](_0x1249('0x8'),attributes,{'tableName':_0x1249('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f34=['AnalyticFieldReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x2f34,0x64));var _0x42f3=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x2f34[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x42f3('0x0'));var util=require(_0x42f3('0x1'));var logger=require(_0x42f3('0x2'))('api');var moment=require(_0x42f3('0x3'));var BPromise=require(_0x42f3('0x4'));var rp=require(_0x42f3('0x5'));var fs=require('fs');var path=require(_0x42f3('0x6'));var rimraf=require(_0x42f3('0x7'));var config=require(_0x42f3('0x8'));var attributes=require(_0x42f3('0x9'));module['exports']=function(_0x1cc839,_0x787764){return _0x1cc839['define'](_0x42f3('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 47e7068..cabb4df 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 _0xec8e=['util','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xec8e,0x98));var _0xeec8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec8e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xeec8('0x0'));var util=require(_0xeec8('0x1'));var moment=require(_0xeec8('0x2'));var BPromise=require(_0xeec8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeec8('0x4'));var db=require(_0xeec8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xeec8('0x6'));var client=jayson[_0xeec8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6117,_0x551aa6,_0x2b79ed){return new BPromise(function(_0x2a873c,_0x21feed){return client['request'](_0x1c6117,_0x2b79ed)['then'](function(_0x13ba53){logger['info'](_0xeec8('0x8'),_0x551aa6,'request\x20sent');logger['debug'](_0xeec8('0x9'),_0x551aa6,_0xeec8('0xa'),JSON['stringify'](_0x13ba53));if(_0x13ba53['error']){if(_0x13ba53[_0xeec8('0xb')][_0xeec8('0xc')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x551aa6,_0x13ba53[_0xeec8('0xb')]['message']);return _0x21feed(_0x13ba53[_0xeec8('0xb')][_0xeec8('0xd')]);}logger[_0xeec8('0xb')](_0xeec8('0x8'),_0x551aa6,_0x13ba53['error'][_0xeec8('0xd')]);return _0x2a873c(_0x13ba53[_0xeec8('0xb')]['message']);}else{logger[_0xeec8('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x551aa6,_0xeec8('0xa'));_0x2a873c(_0x13ba53[_0xeec8('0xf')]['message']);}})[_0xeec8('0x10')](function(_0x21fdb5){logger[_0xeec8('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x551aa6,_0x21fdb5);_0x21feed(_0x21fdb5);});});} \ No newline at end of file +var _0x9457=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9457,0x15d));var _0x7945=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9457[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7945('0x0'));var util=require(_0x7945('0x1'));var moment=require('moment');var BPromise=require(_0x7945('0x2'));var rs=require(_0x7945('0x3'));var fs=require('fs');var Redis=require(_0x7945('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7945('0x5'))('rpc');var config=require(_0x7945('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7945('0x7')][_0x7945('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35423e,_0x18f79b,_0x2ef7e2){return new BPromise(function(_0x2f7a39,_0x16ceb6){return client[_0x7945('0x9')](_0x35423e,_0x2ef7e2)[_0x7945('0xa')](function(_0x1a36d7){logger['info'](_0x7945('0xb'),_0x18f79b,_0x7945('0xc'));logger[_0x7945('0xd')](_0x7945('0xe'),_0x18f79b,_0x7945('0xc'),JSON['stringify'](_0x1a36d7));if(_0x1a36d7[_0x7945('0xf')]){if(_0x1a36d7[_0x7945('0xf')]['code']===0x1f4){logger[_0x7945('0xf')](_0x7945('0xb'),_0x18f79b,_0x1a36d7[_0x7945('0xf')][_0x7945('0x10')]);return _0x16ceb6(_0x1a36d7[_0x7945('0xf')][_0x7945('0x10')]);}logger['error'](_0x7945('0xb'),_0x18f79b,_0x1a36d7[_0x7945('0xf')][_0x7945('0x10')]);return _0x2f7a39(_0x1a36d7[_0x7945('0xf')]['message']);}else{logger[_0x7945('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x18f79b,'request\x20sent');_0x2f7a39(_0x1a36d7[_0x7945('0x12')]['message']);}})[_0x7945('0x13')](function(_0xa25731){logger[_0x7945('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x18f79b,_0xa25731);_0x16ceb6(_0xa25731);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 409a180..c21e602 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(_0x45dd9e,_0xad4da0){var _0x35a357=function(_0x32a1d0){while(--_0x32a1d0){_0x45dd9e['push'](_0x45dd9e['shift']());}};_0x35a357(++_0xad4da0);}(_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(_0x11c2f9,_0x4bdad9){var _0x584aef=function(_0x5dd884){while(--_0x5dd884){_0x11c2f9['push'](_0x11c2f9['shift']());}};_0x584aef(++_0x4bdad9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 946c958..e4b017c 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 _0xbd5f=['exports','STRING','sequelize'];(function(_0x1f28c8,_0xf20f08){var _0x1cdef4=function(_0x195fdd){while(--_0x195fdd){_0x1f28c8['push'](_0x1f28c8['shift']());}};_0x1cdef4(++_0xf20f08);}(_0xbd5f,0x1c7));var _0xfbd5=function(_0x103a07,_0x35acb4){_0x103a07=_0x103a07-0x0;var _0x404596=_0xbd5f[_0x103a07];return _0x404596;};'use strict';var Sequelize=require(_0xfbd5('0x0'));module[_0xfbd5('0x1')]={'name':{'type':Sequelize[_0xfbd5('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xfbd5('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xfbd5('0x2')]}}; \ No newline at end of file +var _0x3cfb=['sequelize','exports','STRING','name','TEXT'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x334f65,_0x45597e){_0x334f65=_0x334f65-0x0;var _0x21f6d2=_0x3cfb[_0x334f65];return _0x21f6d2;};'use strict';var Sequelize=require(_0xb3cf('0x0'));module[_0xb3cf('0x1')]={'name':{'type':Sequelize[_0xb3cf('0x2')],'allowNull':![],'unique':_0xb3cf('0x3')},'table':{'type':Sequelize[_0xb3cf('0x2')]},'metric':{'type':Sequelize[_0xb3cf('0x4')]},'description':{'type':Sequelize[_0xb3cf('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e0e4535..98f25af 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 _0x34e8=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','Metrics','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5e31e2,_0x273090){var _0x294e2c=function(_0x20ab82){while(--_0x20ab82){_0x5e31e2['push'](_0x5e31e2['shift']());}};_0x294e2c(++_0x273090);}(_0x34e8,0x12c));var _0x834e=function(_0x2a315c,_0x25a197){_0x2a315c=_0x2a315c-0x0;var _0x464eab=_0x34e8[_0x2a315c];return _0x464eab;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){var _0x338636=_0x58f4fd['get']({'plain':!![]});var _0x24fcf7=_0x834e('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x24fcf7,'resourceId':_0x338636['id']}})[_0x834e('0x2a')](function(){return _0x58f4fd;});})['then'](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3db026,_0x2cc2eb){return function(_0x3cd928){if(!_0x3cd928){_0x3db026[_0x834e('0x1c')](0x194);}return _0x3cd928;};}function handleError(_0x491919,_0x510780){_0x510780=_0x510780||0x1f4;return function(_0x4dc64a){logger['error'](_0x4dc64a[_0x834e('0x2d')]);if(_0x4dc64a[_0x834e('0x2e')]){delete _0x4dc64a[_0x834e('0x2e')];}_0x491919['status'](_0x510780)[_0x834e('0x2f')](_0x4dc64a);};}exports[_0x834e('0x30')]=function(_0x1f3671,_0x1e026a){var _0x4551f5={},_0x390119={},_0x3d149d={'count':0x0,'rows':[]};var _0xfaf716=_[_0x834e('0x31')](db['AnalyticMetric'][_0x834e('0x32')],function(_0x5cad11){return{'name':_0x5cad11[_0x834e('0x33')],'type':_0x5cad11[_0x834e('0x34')][_0x834e('0x35')]};});_0x390119[_0x834e('0x36')]=_[_0x834e('0x31')](_0xfaf716,_0x834e('0x2e'));_0x390119[_0x834e('0x37')]=_[_0x834e('0x38')](_0x1f3671[_0x834e('0x37')]);_0x390119[_0x834e('0x39')]=_['intersection'](_0x390119[_0x834e('0x36')],_0x390119[_0x834e('0x37')]);_0x4551f5[_0x834e('0x3a')]=_[_0x834e('0x3b')](_0x390119['model'],qs[_0x834e('0x3c')](_0x1f3671[_0x834e('0x37')]['fields']));_0x4551f5['attributes']=_0x4551f5['attributes'][_0x834e('0x3d')]?_0x4551f5[_0x834e('0x3a')]:_0x390119[_0x834e('0x36')];if(!_0x1f3671[_0x834e('0x37')][_0x834e('0x3e')](_0x834e('0x3f'))){_0x4551f5['limit']=qs[_0x834e('0x20')](_0x1f3671['query'][_0x834e('0x20')]);_0x4551f5[_0x834e('0x22')]=qs['offset'](_0x1f3671[_0x834e('0x37')][_0x834e('0x22')]);}_0x4551f5['order']=qs['sort'](_0x1f3671[_0x834e('0x37')][_0x834e('0x40')]);_0x4551f5[_0x834e('0x41')]=qs[_0x834e('0x39')](_[_0x834e('0x42')](_0x1f3671['query'],_0x390119[_0x834e('0x39')]),_0xfaf716);if(_0x1f3671['query']['filter']){_0x4551f5[_0x834e('0x41')]=_['merge'](_0x4551f5[_0x834e('0x41')],{'$or':_[_0x834e('0x31')](_0xfaf716,function(_0x16aea6){if(_0x16aea6[_0x834e('0x34')]!==_0x834e('0x43')){var _0x574ea8={};_0x574ea8[_0x16aea6[_0x834e('0x2e')]]={'$like':'%'+_0x1f3671[_0x834e('0x37')][_0x834e('0x44')]+'%'};return _0x574ea8;}})});}_0x4551f5=_['merge']({},_0x4551f5,_0x1f3671[_0x834e('0x45')]);var _0x16ac45={'where':_0x4551f5['where']};return db[_0x834e('0x46')]['count'](_0x16ac45)[_0x834e('0x2a')](function(_0x585335){_0x3d149d['count']=_0x585335;if(_0x1f3671['query'][_0x834e('0x47')]){_0x4551f5[_0x834e('0x48')]=[{'all':!![]}];}return db[_0x834e('0x46')][_0x834e('0x49')](_0x4551f5);})[_0x834e('0x2a')](function(_0x23feea){_0x3d149d[_0x834e('0x4a')]=_0x23feea;return _0x3d149d;})['then'](respondWithFilteredResult(_0x1e026a,_0x4551f5))[_0x834e('0x4b')](handleError(_0x1e026a,null));};exports['show']=function(_0x321efa,_0x540685){var _0x1df5b0={'raw':!![],'where':{'id':_0x321efa[_0x834e('0x4c')]['id']}},_0x5a5807={};_0x5a5807[_0x834e('0x36')]=_['keys'](db[_0x834e('0x46')][_0x834e('0x32')]);_0x5a5807[_0x834e('0x37')]=_[_0x834e('0x38')](_0x321efa[_0x834e('0x37')]);_0x5a5807[_0x834e('0x39')]=_[_0x834e('0x3b')](_0x5a5807[_0x834e('0x36')],_0x5a5807[_0x834e('0x37')]);_0x1df5b0[_0x834e('0x3a')]=_['intersection'](_0x5a5807[_0x834e('0x36')],qs[_0x834e('0x3c')](_0x321efa['query'][_0x834e('0x3c')]));_0x1df5b0[_0x834e('0x3a')]=_0x1df5b0[_0x834e('0x3a')][_0x834e('0x3d')]?_0x1df5b0[_0x834e('0x3a')]:_0x5a5807[_0x834e('0x36')];if(_0x321efa['query']['includeAll']){_0x1df5b0[_0x834e('0x48')]=[{'all':!![]}];}_0x1df5b0=_[_0x834e('0x4d')]({},_0x1df5b0,_0x321efa[_0x834e('0x45')]);return db[_0x834e('0x46')][_0x834e('0x4e')](_0x1df5b0)[_0x834e('0x2a')](handleEntityNotFound(_0x540685,null))[_0x834e('0x2a')](respondWithResult(_0x540685,null))[_0x834e('0x4b')](handleError(_0x540685,null));};exports[_0x834e('0x4f')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x46')][_0x834e('0x4f')](_0x390c45[_0x834e('0x50')],{})[_0x834e('0x2a')](function(_0x1a3855){var _0x3df078=_0x390c45[_0x834e('0x51')][_0x834e('0x52')]({'plain':!![]});if(!_0x3df078)throw new Error(_0x834e('0x53'));if(_0x3df078['role']===_0x834e('0x51')){var _0x1f08b9=_0x1a3855['get']({'plain':!![]});var _0x3c00a3=_0x834e('0x2c');return db['UserProfileSection'][_0x834e('0x4e')]({'where':{'name':_0x3c00a3,'userProfileId':_0x3df078[_0x834e('0x54')]},'raw':!![]})[_0x834e('0x2a')](function(_0x35636e){if(_0x35636e&&_0x35636e[_0x834e('0x55')]===0x0){return db[_0x834e('0x56')][_0x834e('0x4f')]({'name':_0x1f08b9['name'],'resourceId':_0x1f08b9['id'],'type':_0x35636e[_0x834e('0x2e')],'sectionId':_0x35636e['id']},{})[_0x834e('0x2a')](function(){return _0x1a3855;});}else{return _0x1a3855;}})[_0x834e('0x4b')](function(_0x363675){logger[_0x834e('0x57')](_0x834e('0x58'),_0x363675);throw _0x363675;});}return _0x1a3855;})[_0x834e('0x2a')](respondWithResult(_0xf02f0d,0xc9))[_0x834e('0x4b')](handleError(_0xf02f0d,null));};exports['update']=function(_0x11778e,_0x4dc104){if(_0x11778e[_0x834e('0x50')]['id']){delete _0x11778e['body']['id'];}return db[_0x834e('0x46')]['find']({'where':{'id':_0x11778e['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4dc104,null))[_0x834e('0x2a')](saveUpdates(_0x11778e['body'],null))['then'](respondWithResult(_0x4dc104,null))[_0x834e('0x4b')](handleError(_0x4dc104,null));};exports[_0x834e('0x2b')]=function(_0x138ed2,_0x387365){return db[_0x834e('0x46')][_0x834e('0x4e')]({'where':{'id':_0x138ed2[_0x834e('0x4c')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x387365,null))['then'](removeEntity(_0x387365,null))[_0x834e('0x4b')](handleError(_0x387365,null));}; \ No newline at end of file +var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x33a573,_0x5e88b2){var _0xa8c4c0=function(_0x17fe11){while(--_0x17fe11){_0x33a573['push'](_0x33a573['shift']());}};_0xa8c4c0(++_0x5e88b2);}(_0x6aa7,0x178));var _0x76aa=function(_0x4218c9,_0x147e71){_0x4218c9=_0x4218c9-0x0;var _0x3ae811=_0x6aa7[_0x4218c9];return _0x3ae811;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 366937e..f9e270a 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 _0x3f27=['lodash','util','../../config/logger','api','moment','request-promise','path','exports','define','AnalyticMetric'];(function(_0x381ba2,_0x134303){var _0x82bc24=function(_0x15378a){while(--_0x15378a){_0x381ba2['push'](_0x381ba2['shift']());}};_0x82bc24(++_0x134303);}(_0x3f27,0x1f4));var _0x73f2=function(_0x30505e,_0x2bc754){_0x30505e=_0x30505e-0x0;var _0x2f6a22=_0x3f27[_0x30505e];return _0x2f6a22;};'use strict';var _=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var logger=require(_0x73f2('0x2'))(_0x73f2('0x3'));var moment=require(_0x73f2('0x4'));var BPromise=require('bluebird');var rp=require(_0x73f2('0x5'));var fs=require('fs');var path=require(_0x73f2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x73f2('0x7')]=function(_0x54631b,_0x17f054){return _0x54631b[_0x73f2('0x8')](_0x73f2('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cc7=['exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0xd1c88e,_0x4f8685){var _0x47fc56=function(_0x418a76){while(--_0x418a76){_0xd1c88e['push'](_0xd1c88e['shift']());}};_0x47fc56(++_0x4f8685);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x30febf,_0x4f8792){_0x30febf=_0x30febf-0x0;var _0x1acd77=_0x4cc7[_0x30febf];return _0x1acd77;};'use strict';var _=require(_0x74cc('0x0'));var util=require(_0x74cc('0x1'));var logger=require(_0x74cc('0x2'))(_0x74cc('0x3'));var moment=require(_0x74cc('0x4'));var BPromise=require(_0x74cc('0x5'));var rp=require(_0x74cc('0x6'));var fs=require('fs');var path=require(_0x74cc('0x7'));var rimraf=require('rimraf');var config=require(_0x74cc('0x8'));var attributes=require(_0x74cc('0x9'));module[_0x74cc('0xa')]=function(_0x3b5d01,_0x225d38){return _0x3b5d01[_0x74cc('0xb')](_0x74cc('0xc'),attributes,{'tableName':_0x74cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 1be7881..3be80ad 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 _0xf0ce=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34a977,_0x304192){var _0x294039=function(_0x1ad770){while(--_0x1ad770){_0x34a977['push'](_0x34a977['shift']());}};_0x294039(++_0x304192);}(_0xf0ce,0x1d9));var _0xef0c=function(_0x181d2e,_0x6f532b){_0x181d2e=_0x181d2e-0x0;var _0x46d68e=_0xf0ce[_0x181d2e];return _0x46d68e;};'use strict';var _=require('lodash');var util=require(_0xef0c('0x0'));var moment=require(_0xef0c('0x1'));var BPromise=require(_0xef0c('0x2'));var rs=require(_0xef0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef0c('0x4'))['db'];var utils=require(_0xef0c('0x5'));var logger=require(_0xef0c('0x6'))(_0xef0c('0x7'));var config=require(_0xef0c('0x8'));var jayson=require(_0xef0c('0x9'));var client=jayson['client'][_0xef0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222874,_0x3fc142,_0x322df9){return new BPromise(function(_0x567c8c,_0x333ea7){return client[_0xef0c('0xb')](_0x222874,_0x322df9)[_0xef0c('0xc')](function(_0x5e16f4){logger[_0xef0c('0xd')](_0xef0c('0xe'),_0x3fc142,_0xef0c('0xf'));logger['debug'](_0xef0c('0x10'),_0x3fc142,_0xef0c('0xf'),JSON[_0xef0c('0x11')](_0x5e16f4));if(_0x5e16f4['error']){if(_0x5e16f4[_0xef0c('0x12')][_0xef0c('0x13')]===0x1f4){logger[_0xef0c('0x12')](_0xef0c('0xe'),_0x3fc142,_0x5e16f4['error']['message']);return _0x333ea7(_0x5e16f4[_0xef0c('0x12')][_0xef0c('0x14')]);}logger[_0xef0c('0x12')](_0xef0c('0xe'),_0x3fc142,_0x5e16f4[_0xef0c('0x12')][_0xef0c('0x14')]);return _0x567c8c(_0x5e16f4['error'][_0xef0c('0x14')]);}else{logger[_0xef0c('0xd')](_0xef0c('0xe'),_0x3fc142,_0xef0c('0xf'));_0x567c8c(_0x5e16f4[_0xef0c('0x15')][_0xef0c('0x14')]);}})[_0xef0c('0x16')](function(_0x513d7a){logger[_0xef0c('0x12')](_0xef0c('0xe'),_0x3fc142,_0x513d7a);_0x333ea7(_0x513d7a);});});} \ No newline at end of file +var _0xda1b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0xda1b,0xfc));var _0xbda1=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xda1b[_0x500419];return _0x241c1a;};'use strict';var _=require(_0xbda1('0x0'));var util=require(_0xbda1('0x1'));var moment=require('moment');var BPromise=require(_0xbda1('0x2'));var rs=require(_0xbda1('0x3'));var fs=require('fs');var Redis=require(_0xbda1('0x4'));var db=require(_0xbda1('0x5'))['db'];var utils=require(_0xbda1('0x6'));var logger=require('../../config/logger')(_0xbda1('0x7'));var config=require(_0xbda1('0x8'));var jayson=require(_0xbda1('0x9'));var client=jayson['client'][_0xbda1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c13a2,_0x1d312a,_0x5da88b){return new BPromise(function(_0x54981e,_0x53a1da){return client[_0xbda1('0xb')](_0x5c13a2,_0x5da88b)[_0xbda1('0xc')](function(_0x50e5e2){logger[_0xbda1('0xd')](_0xbda1('0xe'),_0x1d312a,_0xbda1('0xf'));logger[_0xbda1('0x10')](_0xbda1('0x11'),_0x1d312a,_0xbda1('0xf'),JSON[_0xbda1('0x12')](_0x50e5e2));if(_0x50e5e2['error']){if(_0x50e5e2[_0xbda1('0x13')][_0xbda1('0x14')]===0x1f4){logger[_0xbda1('0x13')](_0xbda1('0xe'),_0x1d312a,_0x50e5e2[_0xbda1('0x13')]['message']);return _0x53a1da(_0x50e5e2[_0xbda1('0x13')]['message']);}logger['error'](_0xbda1('0xe'),_0x1d312a,_0x50e5e2['error'][_0xbda1('0x15')]);return _0x54981e(_0x50e5e2[_0xbda1('0x13')][_0xbda1('0x15')]);}else{logger[_0xbda1('0xd')](_0xbda1('0xe'),_0x1d312a,_0xbda1('0xf'));_0x54981e(_0x50e5e2['result'][_0xbda1('0x15')]);}})[_0xbda1('0x16')](function(_0x3be8b0){logger[_0xbda1('0x13')](_0xbda1('0xe'),_0x1d312a,_0x3be8b0);_0x53a1da(_0x3be8b0);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 6600a55..2446ce5 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 _0x9879=['./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56eb98,_0x15c96c){var _0x63939e=function(_0x40e34a){while(--_0x40e34a){_0x56eb98['push'](_0x56eb98['shift']());}};_0x63939e(++_0x15c96c);}(_0x9879,0x98));var _0x9987=function(_0x3779dc,_0x40909f){_0x3779dc=_0x3779dc-0x0;var _0x40c32b=_0x9879[_0x3779dc];return _0x40c32b;};'use strict';var multer=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var path=require(_0x9987('0x2'));var timeout=require('connect-timeout');var express=require(_0x9987('0x3'));var router=express['Router']();var fs_extra=require(_0x9987('0x4'));var auth=require(_0x9987('0x5'));var interaction=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var controller=require(_0x9987('0x8'));router[_0x9987('0x9')]('/',auth[_0x9987('0xa')](),controller['index']);router[_0x9987('0x9')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0xb')]);router[_0x9987('0xc')]('/',auth[_0x9987('0xa')](),controller[_0x9987('0xd')]);router[_0x9987('0xe')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x10')]);router[_0x9987('0x11')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x12')]);module[_0x9987('0x13')]=router; \ No newline at end of file +var _0xd8ee=['isAuthenticated','show','post','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x531bda,_0x3e4479){_0x531bda=_0x531bda-0x0;var _0x43fa2c=_0xd8ee[_0x531bda];return _0x43fa2c;};'use strict';var multer=require(_0xed8e('0x0'));var util=require('util');var path=require(_0xed8e('0x1'));var timeout=require(_0xed8e('0x2'));var express=require(_0xed8e('0x3'));var router=express['Router']();var fs_extra=require(_0xed8e('0x4'));var auth=require(_0xed8e('0x5'));var interaction=require(_0xed8e('0x6'));var config=require(_0xed8e('0x7'));var controller=require(_0xed8e('0x8'));router[_0xed8e('0x9')]('/',auth['isAuthenticated'](),controller[_0xed8e('0xa')]);router[_0xed8e('0x9')](_0xed8e('0xb'),auth[_0xed8e('0xc')](),controller[_0xed8e('0xd')]);router[_0xed8e('0xe')]('/',auth[_0xed8e('0xc')](),controller['create']);router['put'](_0xed8e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xed8e('0xf')]('/:id',auth[_0xed8e('0xc')](),controller[_0xed8e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 2bd456d..8064297 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 _0x30cf=['sequelize','exports','TEXT'];(function(_0x21ded0,_0x509371){var _0x4bb2e7=function(_0x385a95){while(--_0x385a95){_0x21ded0['push'](_0x21ded0['shift']());}};_0x4bb2e7(++_0x509371);}(_0x30cf,0x8a));var _0xf30c=function(_0x4eba5c,_0x59a4c7){_0x4eba5c=_0x4eba5c-0x0;var _0xf8e41d=_0x30cf[_0x4eba5c];return _0xf8e41d;};'use strict';var Sequelize=require(_0xf30c('0x0'));module[_0xf30c('0x1')]={'tree':{'type':Sequelize[_0xf30c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0ef7=['TEXT','sequelize','exports'];(function(_0x34d533,_0x161449){var _0x4731f5=function(_0x46fbb4){while(--_0x46fbb4){_0x34d533['push'](_0x34d533['shift']());}};_0x4731f5(++_0x161449);}(_0x0ef7,0x163));var _0x70ef=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x0ef7[_0x5c4f6b];return _0x104c4e;};'use strict';var Sequelize=require(_0x70ef('0x0'));module[_0x70ef('0x1')]={'tree':{'type':Sequelize[_0x70ef('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 996a87d..77eb127 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 _0x2a9f=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','sendStatus','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','then','rows','catch','show','includeAll','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x2a9f,0x1f3));var _0xf2a9=function(_0x48cad3,_0x39f7a2){_0x48cad3=_0x48cad3-0x0;var _0x37f399=_0x2a9f[_0x48cad3];return _0x37f399;};'use strict';var emlformat=require(_0xf2a9('0x0'));var rimraf=require(_0xf2a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2a9('0x2'));var rp=require(_0xf2a9('0x3'));var moment=require(_0xf2a9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf2a9('0x5'));var sox=require(_0xf2a9('0x6'));var csv=require(_0xf2a9('0x7'));var ejs=require(_0xf2a9('0x8'));var fs=require('fs');var fs_extra=require(_0xf2a9('0x9'));var _=require(_0xf2a9('0xa'));var squel=require(_0xf2a9('0xb'));var crypto=require(_0xf2a9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf2a9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf2a9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf2a9('0xf'));var qs=require(_0xf2a9('0x10'));var as=require(_0xf2a9('0x11'));var hardwareService=require(_0xf2a9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf2a9('0x13'));var config=require(_0xf2a9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2a9('0x15'))['db'];function respondWithStatusCode(_0x33b2d5,_0x54e30d){_0x54e30d=_0x54e30d||0xcc;return function(_0x284eae){if(_0x284eae){return _0x33b2d5['sendStatus'](_0x54e30d);}return _0x33b2d5[_0xf2a9('0x16')](_0x54e30d)[_0xf2a9('0x17')]();};}function respondWithResult(_0x4a9944,_0x26a9b2){_0x26a9b2=_0x26a9b2||0xc8;return function(_0x451e01){if(_0x451e01){return _0x4a9944['status'](_0x26a9b2)[_0xf2a9('0x18')](_0x451e01);}};}function respondWithFilteredResult(_0x53a785,_0x154ada){return function(_0x18e134){if(_0x18e134){var _0x590f01=typeof _0x154ada[_0xf2a9('0x19')]==='undefined'&&typeof _0x154ada[_0xf2a9('0x1a')]===_0xf2a9('0x1b');var _0x7633b7=_0x18e134[_0xf2a9('0x1c')];var _0xae9191=_0x590f01?0x0:_0x154ada[_0xf2a9('0x19')];var _0xe9d10a=_0x590f01?_0x18e134[_0xf2a9('0x1c')]:_0x154ada[_0xf2a9('0x19')]+_0x154ada[_0xf2a9('0x1a')];var _0x482fe2;if(_0xe9d10a>=_0x7633b7){_0xe9d10a=_0x7633b7;_0x482fe2=0xc8;}else{_0x482fe2=0xce;}_0x53a785[_0xf2a9('0x16')](_0x482fe2);return _0x53a785[_0xf2a9('0x1d')](_0xf2a9('0x1e'),_0xae9191+'-'+_0xe9d10a+'/'+_0x7633b7)[_0xf2a9('0x18')](_0x18e134);}return null;};}function patchUpdates(_0x13b12a){return function(_0x38f00f){try{jsonpatch[_0xf2a9('0x1f')](_0x38f00f,_0x13b12a,!![]);}catch(_0x15bb9b){return BPromise['reject'](_0x15bb9b);}return _0x38f00f[_0xf2a9('0x20')]();};}function saveUpdates(_0x4318f9,_0x2cc800){return function(_0x45f741){if(_0x45f741){return _0x45f741[_0xf2a9('0x21')](_0x4318f9)['then'](function(_0x65eded){return _0x65eded;});}return null;};}function removeEntity(_0x9d57f2,_0x4d065f){return function(_0x13dc1d){if(_0x13dc1d){return _0x13dc1d['destroy']()['then'](function(){_0x9d57f2[_0xf2a9('0x16')](0xcc)[_0xf2a9('0x17')]();});}};}function handleEntityNotFound(_0x2dce23,_0x2c09f8){return function(_0x6175d5){if(!_0x6175d5){_0x2dce23[_0xf2a9('0x22')](0x194);}return _0x6175d5;};}function handleError(_0x3b118e,_0x321e8c){_0x321e8c=_0x321e8c||0x1f4;return function(_0x212333){logger['error'](_0x212333['stack']);if(_0x212333['name']){delete _0x212333[_0xf2a9('0x23')];}_0x3b118e['status'](_0x321e8c)[_0xf2a9('0x24')](_0x212333);};}exports[_0xf2a9('0x25')]=function(_0x20637d,_0x3533d8){var _0x22284b={},_0x25c281={},_0x5b0d16={'count':0x0,'rows':[]};var _0x4596fb=_['map'](db[_0xf2a9('0x26')][_0xf2a9('0x27')],function(_0x2f5253){return{'name':_0x2f5253[_0xf2a9('0x28')],'type':_0x2f5253['type'][_0xf2a9('0x29')]};});_0x25c281[_0xf2a9('0x2a')]=_[_0xf2a9('0x2b')](_0x4596fb,_0xf2a9('0x23'));_0x25c281[_0xf2a9('0x2c')]=_['keys'](_0x20637d[_0xf2a9('0x2c')]);_0x25c281[_0xf2a9('0x2d')]=_[_0xf2a9('0x2e')](_0x25c281[_0xf2a9('0x2a')],_0x25c281[_0xf2a9('0x2c')]);_0x22284b[_0xf2a9('0x2f')]=_[_0xf2a9('0x2e')](_0x25c281[_0xf2a9('0x2a')],qs[_0xf2a9('0x30')](_0x20637d['query'][_0xf2a9('0x30')]));_0x22284b[_0xf2a9('0x2f')]=_0x22284b[_0xf2a9('0x2f')][_0xf2a9('0x31')]?_0x22284b['attributes']:_0x25c281[_0xf2a9('0x2a')];if(!_0x20637d[_0xf2a9('0x2c')][_0xf2a9('0x32')](_0xf2a9('0x33'))){_0x22284b[_0xf2a9('0x1a')]=qs[_0xf2a9('0x1a')](_0x20637d['query'][_0xf2a9('0x1a')]);_0x22284b[_0xf2a9('0x19')]=qs[_0xf2a9('0x19')](_0x20637d[_0xf2a9('0x2c')][_0xf2a9('0x19')]);}_0x22284b[_0xf2a9('0x34')]=qs[_0xf2a9('0x35')](_0x20637d[_0xf2a9('0x2c')]['sort']);_0x22284b[_0xf2a9('0x36')]=qs[_0xf2a9('0x2d')](_['pick'](_0x20637d[_0xf2a9('0x2c')],_0x25c281[_0xf2a9('0x2d')]),_0x4596fb);if(_0x20637d[_0xf2a9('0x2c')][_0xf2a9('0x37')]){_0x22284b['where']=_[_0xf2a9('0x38')](_0x22284b[_0xf2a9('0x36')],{'$or':_[_0xf2a9('0x2b')](_0x4596fb,function(_0x1482a7){if(_0x1482a7[_0xf2a9('0x39')]!==_0xf2a9('0x3a')){var _0x3e5d38={};_0x3e5d38[_0x1482a7[_0xf2a9('0x23')]]={'$like':'%'+_0x20637d[_0xf2a9('0x2c')][_0xf2a9('0x37')]+'%'};return _0x3e5d38;}})});}_0x22284b=_[_0xf2a9('0x38')]({},_0x22284b,_0x20637d[_0xf2a9('0x3b')]);var _0x48c51e={'where':_0x22284b[_0xf2a9('0x36')]};return db[_0xf2a9('0x26')][_0xf2a9('0x1c')](_0x48c51e)['then'](function(_0x44b4c9){_0x5b0d16[_0xf2a9('0x1c')]=_0x44b4c9;if(_0x20637d[_0xf2a9('0x2c')]['includeAll']){_0x22284b[_0xf2a9('0x3c')]=[{'all':!![]}];}return db[_0xf2a9('0x26')][_0xf2a9('0x3d')](_0x22284b);})[_0xf2a9('0x3e')](function(_0x295e31){_0x5b0d16[_0xf2a9('0x3f')]=_0x295e31;return _0x5b0d16;})[_0xf2a9('0x3e')](respondWithFilteredResult(_0x3533d8,_0x22284b))[_0xf2a9('0x40')](handleError(_0x3533d8,null));};exports[_0xf2a9('0x41')]=function(_0x4ab3bd,_0x39890a){var _0x55a00b={'raw':!![],'where':{'id':_0x4ab3bd['params']['id']}},_0x3a4b01={};_0x3a4b01['model']=_['keys'](db[_0xf2a9('0x26')]['rawAttributes']);_0x3a4b01[_0xf2a9('0x2c')]=_['keys'](_0x4ab3bd['query']);_0x3a4b01[_0xf2a9('0x2d')]=_[_0xf2a9('0x2e')](_0x3a4b01[_0xf2a9('0x2a')],_0x3a4b01[_0xf2a9('0x2c')]);_0x55a00b[_0xf2a9('0x2f')]=_[_0xf2a9('0x2e')](_0x3a4b01['model'],qs[_0xf2a9('0x30')](_0x4ab3bd[_0xf2a9('0x2c')][_0xf2a9('0x30')]));_0x55a00b['attributes']=_0x55a00b[_0xf2a9('0x2f')]['length']?_0x55a00b[_0xf2a9('0x2f')]:_0x3a4b01['model'];if(_0x4ab3bd[_0xf2a9('0x2c')][_0xf2a9('0x42')]){_0x55a00b[_0xf2a9('0x3c')]=[{'all':!![]}];}_0x55a00b=_[_0xf2a9('0x38')]({},_0x55a00b,_0x4ab3bd[_0xf2a9('0x3b')]);return db['AnalyticTreeReport'][_0xf2a9('0x43')](_0x55a00b)[_0xf2a9('0x3e')](handleEntityNotFound(_0x39890a,null))[_0xf2a9('0x3e')](respondWithResult(_0x39890a,null))[_0xf2a9('0x40')](handleError(_0x39890a,null));};exports[_0xf2a9('0x44')]=function(_0x48748b,_0x58de5a){return db[_0xf2a9('0x26')][_0xf2a9('0x44')](_0x48748b[_0xf2a9('0x45')],{})[_0xf2a9('0x3e')](respondWithResult(_0x58de5a,0xc9))[_0xf2a9('0x40')](handleError(_0x58de5a,null));};exports[_0xf2a9('0x21')]=function(_0x4edb3e,_0x4dff48){if(_0x4edb3e['body']['id']){delete _0x4edb3e[_0xf2a9('0x45')]['id'];}return db[_0xf2a9('0x26')][_0xf2a9('0x43')]({'where':{'id':_0x4edb3e[_0xf2a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dff48,null))[_0xf2a9('0x3e')](saveUpdates(_0x4edb3e[_0xf2a9('0x45')],null))[_0xf2a9('0x3e')](respondWithResult(_0x4dff48,null))[_0xf2a9('0x40')](handleError(_0x4dff48,null));};exports[_0xf2a9('0x47')]=function(_0x556561,_0x17c7a3){return db['AnalyticTreeReport'][_0xf2a9('0x43')]({'where':{'id':_0x556561[_0xf2a9('0x46')]['id']}})[_0xf2a9('0x3e')](handleEntityNotFound(_0x17c7a3,null))[_0xf2a9('0x3e')](removeEntity(_0x17c7a3,null))[_0xf2a9('0x40')](handleError(_0x17c7a3,null));}; \ No newline at end of file +var _0xffb4=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','update','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x42be9a,_0x6bfd77){var _0x3b6c9c=function(_0x374305){while(--_0x374305){_0x42be9a['push'](_0x42be9a['shift']());}};_0x3b6c9c(++_0x6bfd77);}(_0xffb4,0xc8));var _0x4ffb=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xffb4[_0x2e4e19];return _0x9ba20b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ffb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ffb('0x1'));var rp=require(_0x4ffb('0x2'));var moment=require('moment');var BPromise=require(_0x4ffb('0x3'));var Mustache=require('mustache');var util=require(_0x4ffb('0x4'));var path=require(_0x4ffb('0x5'));var sox=require(_0x4ffb('0x6'));var csv=require(_0x4ffb('0x7'));var ejs=require(_0x4ffb('0x8'));var fs=require('fs');var fs_extra=require(_0x4ffb('0x9'));var _=require(_0x4ffb('0xa'));var squel=require(_0x4ffb('0xb'));var crypto=require('crypto');var jsforce=require(_0x4ffb('0xc'));var deskjs=require(_0x4ffb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4ffb('0xe'));var Papa=require(_0x4ffb('0xf'));var Redis=require('ioredis');var authService=require(_0x4ffb('0x10'));var qs=require(_0x4ffb('0x11'));var as=require(_0x4ffb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ffb('0x13'))('api');var utils=require(_0x4ffb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7e12a3,_0x32187a){_0x32187a=_0x32187a||0xcc;return function(_0x879f34){if(_0x879f34){return _0x7e12a3[_0x4ffb('0x15')](_0x32187a);}return _0x7e12a3[_0x4ffb('0x16')](_0x32187a)['end']();};}function respondWithResult(_0x4497ba,_0x372c2a){_0x372c2a=_0x372c2a||0xc8;return function(_0x1f68c6){if(_0x1f68c6){return _0x4497ba['status'](_0x372c2a)['json'](_0x1f68c6);}};}function respondWithFilteredResult(_0xc92988,_0x1097bf){return function(_0x455f30){if(_0x455f30){var _0x585e01=typeof _0x1097bf[_0x4ffb('0x17')]===_0x4ffb('0x18')&&typeof _0x1097bf[_0x4ffb('0x19')]==='undefined';var _0x5677e3=_0x455f30[_0x4ffb('0x1a')];var _0x9c075a=_0x585e01?0x0:_0x1097bf['offset'];var _0x4fd91a=_0x585e01?_0x455f30[_0x4ffb('0x1a')]:_0x1097bf['offset']+_0x1097bf[_0x4ffb('0x19')];var _0x307a36;if(_0x4fd91a>=_0x5677e3){_0x4fd91a=_0x5677e3;_0x307a36=0xc8;}else{_0x307a36=0xce;}_0xc92988[_0x4ffb('0x16')](_0x307a36);return _0xc92988[_0x4ffb('0x1b')](_0x4ffb('0x1c'),_0x9c075a+'-'+_0x4fd91a+'/'+_0x5677e3)['json'](_0x455f30);}return null;};}function patchUpdates(_0x2434e9){return function(_0x39ed6c){try{jsonpatch[_0x4ffb('0x1d')](_0x39ed6c,_0x2434e9,!![]);}catch(_0xf704b6){return BPromise[_0x4ffb('0x1e')](_0xf704b6);}return _0x39ed6c[_0x4ffb('0x1f')]();};}function saveUpdates(_0x555ba6,_0x3b8e13){return function(_0x4a926c){if(_0x4a926c){return _0x4a926c['update'](_0x555ba6)[_0x4ffb('0x20')](function(_0x3bd981){return _0x3bd981;});}return null;};}function removeEntity(_0x1ed8cf,_0xdfae2b){return function(_0x41707a){if(_0x41707a){return _0x41707a[_0x4ffb('0x21')]()[_0x4ffb('0x20')](function(){_0x1ed8cf[_0x4ffb('0x16')](0xcc)[_0x4ffb('0x22')]();});}};}function handleEntityNotFound(_0x251b61,_0xd8dcd9){return function(_0x1b80c8){if(!_0x1b80c8){_0x251b61[_0x4ffb('0x15')](0x194);}return _0x1b80c8;};}function handleError(_0x132216,_0x3ac4d8){_0x3ac4d8=_0x3ac4d8||0x1f4;return function(_0x4a0ec7){logger[_0x4ffb('0x23')](_0x4a0ec7['stack']);if(_0x4a0ec7['name']){delete _0x4a0ec7[_0x4ffb('0x24')];}_0x132216[_0x4ffb('0x16')](_0x3ac4d8)[_0x4ffb('0x25')](_0x4a0ec7);};}exports[_0x4ffb('0x26')]=function(_0x195e49,_0x36c4b3){var _0x3cc917={},_0x17ab3b={},_0x348233={'count':0x0,'rows':[]};var _0x559182=_[_0x4ffb('0x27')](db[_0x4ffb('0x28')][_0x4ffb('0x29')],function(_0x2d595a){return{'name':_0x2d595a[_0x4ffb('0x2a')],'type':_0x2d595a[_0x4ffb('0x2b')][_0x4ffb('0x2c')]};});_0x17ab3b[_0x4ffb('0x2d')]=_[_0x4ffb('0x27')](_0x559182,'name');_0x17ab3b['query']=_[_0x4ffb('0x2e')](_0x195e49[_0x4ffb('0x2f')]);_0x17ab3b[_0x4ffb('0x30')]=_['intersection'](_0x17ab3b[_0x4ffb('0x2d')],_0x17ab3b[_0x4ffb('0x2f')]);_0x3cc917[_0x4ffb('0x31')]=_[_0x4ffb('0x32')](_0x17ab3b[_0x4ffb('0x2d')],qs['fields'](_0x195e49['query']['fields']));_0x3cc917[_0x4ffb('0x31')]=_0x3cc917['attributes'][_0x4ffb('0x33')]?_0x3cc917[_0x4ffb('0x31')]:_0x17ab3b[_0x4ffb('0x2d')];if(!_0x195e49[_0x4ffb('0x2f')][_0x4ffb('0x34')]('nolimit')){_0x3cc917['limit']=qs['limit'](_0x195e49['query'][_0x4ffb('0x19')]);_0x3cc917[_0x4ffb('0x17')]=qs['offset'](_0x195e49['query'][_0x4ffb('0x17')]);}_0x3cc917[_0x4ffb('0x35')]=qs['sort'](_0x195e49[_0x4ffb('0x2f')][_0x4ffb('0x36')]);_0x3cc917[_0x4ffb('0x37')]=qs[_0x4ffb('0x30')](_['pick'](_0x195e49[_0x4ffb('0x2f')],_0x17ab3b['filters']),_0x559182);if(_0x195e49[_0x4ffb('0x2f')][_0x4ffb('0x38')]){_0x3cc917['where']=_[_0x4ffb('0x39')](_0x3cc917[_0x4ffb('0x37')],{'$or':_['map'](_0x559182,function(_0x477f0e){if(_0x477f0e['type']!==_0x4ffb('0x3a')){var _0x23a414={};_0x23a414[_0x477f0e['name']]={'$like':'%'+_0x195e49[_0x4ffb('0x2f')]['filter']+'%'};return _0x23a414;}})});}_0x3cc917=_[_0x4ffb('0x39')]({},_0x3cc917,_0x195e49[_0x4ffb('0x3b')]);var _0x4fd3eb={'where':_0x3cc917['where']};return db[_0x4ffb('0x28')][_0x4ffb('0x1a')](_0x4fd3eb)[_0x4ffb('0x20')](function(_0x265ee1){_0x348233[_0x4ffb('0x1a')]=_0x265ee1;if(_0x195e49[_0x4ffb('0x2f')][_0x4ffb('0x3c')]){_0x3cc917[_0x4ffb('0x3d')]=[{'all':!![]}];}return db[_0x4ffb('0x28')][_0x4ffb('0x3e')](_0x3cc917);})[_0x4ffb('0x20')](function(_0x37f114){_0x348233[_0x4ffb('0x3f')]=_0x37f114;return _0x348233;})[_0x4ffb('0x20')](respondWithFilteredResult(_0x36c4b3,_0x3cc917))[_0x4ffb('0x40')](handleError(_0x36c4b3,null));};exports['show']=function(_0x197b22,_0x3be440){var _0x13cd4d={'raw':!![],'where':{'id':_0x197b22[_0x4ffb('0x41')]['id']}},_0x51801b={};_0x51801b['model']=_[_0x4ffb('0x2e')](db['AnalyticTreeReport'][_0x4ffb('0x29')]);_0x51801b[_0x4ffb('0x2f')]=_['keys'](_0x197b22['query']);_0x51801b[_0x4ffb('0x30')]=_[_0x4ffb('0x32')](_0x51801b[_0x4ffb('0x2d')],_0x51801b[_0x4ffb('0x2f')]);_0x13cd4d['attributes']=_[_0x4ffb('0x32')](_0x51801b[_0x4ffb('0x2d')],qs[_0x4ffb('0x42')](_0x197b22[_0x4ffb('0x2f')][_0x4ffb('0x42')]));_0x13cd4d['attributes']=_0x13cd4d[_0x4ffb('0x31')][_0x4ffb('0x33')]?_0x13cd4d[_0x4ffb('0x31')]:_0x51801b[_0x4ffb('0x2d')];if(_0x197b22[_0x4ffb('0x2f')][_0x4ffb('0x3c')]){_0x13cd4d[_0x4ffb('0x3d')]=[{'all':!![]}];}_0x13cd4d=_[_0x4ffb('0x39')]({},_0x13cd4d,_0x197b22['options']);return db[_0x4ffb('0x28')][_0x4ffb('0x43')](_0x13cd4d)[_0x4ffb('0x20')](handleEntityNotFound(_0x3be440,null))['then'](respondWithResult(_0x3be440,null))[_0x4ffb('0x40')](handleError(_0x3be440,null));};exports['create']=function(_0x37b519,_0x5bceb8){return db[_0x4ffb('0x28')][_0x4ffb('0x44')](_0x37b519[_0x4ffb('0x45')],{})[_0x4ffb('0x20')](respondWithResult(_0x5bceb8,0xc9))[_0x4ffb('0x40')](handleError(_0x5bceb8,null));};exports[_0x4ffb('0x46')]=function(_0x3064a5,_0x2f306a){if(_0x3064a5[_0x4ffb('0x45')]['id']){delete _0x3064a5[_0x4ffb('0x45')]['id'];}return db[_0x4ffb('0x28')]['find']({'where':{'id':_0x3064a5[_0x4ffb('0x41')]['id']}})[_0x4ffb('0x20')](handleEntityNotFound(_0x2f306a,null))[_0x4ffb('0x20')](saveUpdates(_0x3064a5[_0x4ffb('0x45')],null))['then'](respondWithResult(_0x2f306a,null))[_0x4ffb('0x40')](handleError(_0x2f306a,null));};exports['destroy']=function(_0x14ed6e,_0x5735a9){return db[_0x4ffb('0x28')][_0x4ffb('0x43')]({'where':{'id':_0x14ed6e[_0x4ffb('0x41')]['id']}})['then'](handleEntityNotFound(_0x5735a9,null))['then'](removeEntity(_0x5735a9,null))[_0x4ffb('0x40')](handleError(_0x5735a9,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 790ec22..7a1c32d 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 _0x953d=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x112a8b,_0x44768c){var _0x5f1fdb=function(_0x48f826){while(--_0x48f826){_0x112a8b['push'](_0x112a8b['shift']());}};_0x5f1fdb(++_0x44768c);}(_0x953d,0x17f));var _0xd953=function(_0x529bde,_0x32d640){_0x529bde=_0x529bde-0x0;var _0xb7109c=_0x953d[_0x529bde];return _0xb7109c;};'use strict';var _=require('lodash');var util=require(_0xd953('0x0'));var logger=require(_0xd953('0x1'))(_0xd953('0x2'));var moment=require(_0xd953('0x3'));var BPromise=require(_0xd953('0x4'));var rp=require(_0xd953('0x5'));var fs=require('fs');var path=require(_0xd953('0x6'));var rimraf=require(_0xd953('0x7'));var config=require(_0xd953('0x8'));var attributes=require(_0xd953('0x9'));module['exports']=function(_0x2b1a76,_0x1bd8fd){return _0x2b1a76[_0xd953('0xa')](_0xd953('0xb'),attributes,{'tableName':_0xd953('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f84=['./analyticTreeReport.attributes','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f0057,_0x23c77a){var _0x45e03a=function(_0xf280a8){while(--_0xf280a8){_0x4f0057['push'](_0x4f0057['shift']());}};_0x45e03a(++_0x23c77a);}(_0x7f84,0xd3));var _0x47f8=function(_0x2e4033,_0x4b3b49){_0x2e4033=_0x2e4033-0x0;var _0x47690d=_0x7f84[_0x2e4033];return _0x47690d;};'use strict';var _=require(_0x47f8('0x0'));var util=require(_0x47f8('0x1'));var logger=require(_0x47f8('0x2'))(_0x47f8('0x3'));var moment=require(_0x47f8('0x4'));var BPromise=require(_0x47f8('0x5'));var rp=require(_0x47f8('0x6'));var fs=require('fs');var path=require(_0x47f8('0x7'));var rimraf=require(_0x47f8('0x8'));var config=require(_0x47f8('0x9'));var attributes=require(_0x47f8('0xa'));module['exports']=function(_0x28eaaa,_0x27ddfa){return _0x28eaaa[_0x47f8('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x47f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index df121af..7d3e81f 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x27fec1,_0x441437){var _0xebbcb7=function(_0x2fcd34){while(--_0x2fcd34){_0x27fec1['push'](_0x27fec1['shift']());}};_0xebbcb7(++_0x441437);}(_0x1261,0x144));var _0x1126=function(_0x5f2ed0,_0xaf721b){_0x5f2ed0=_0x5f2ed0-0x0;var _0x4f2eed=_0x1261[_0x5f2ed0];return _0x4f2eed;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5ce8d5,_0x5d3cab){var _0x31b249=function(_0xa230af){while(--_0xa230af){_0x5ce8d5['push'](_0x5ce8d5['shift']());}};_0x31b249(++_0x5d3cab);}(_0x1261,0x144));var _0x1126=function(_0xb5a041,_0x394f01){_0xb5a041=_0xb5a041-0x0;var _0x187974=_0x1261[_0xb5a041];return _0x187974;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f27f98f..ba6d1fa 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 _0xee76=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x25d9cb,_0x55c849){var _0x575b2a=function(_0x13224a){while(--_0x13224a){_0x25d9cb['push'](_0x25d9cb['shift']());}};_0x575b2a(++_0x55c849);}(_0xee76,0x14d));var _0x6ee7=function(_0x4f7fe0,_0x18201f){_0x4f7fe0=_0x4f7fe0-0x0;var _0x1e2851=_0xee76[_0x4f7fe0];return _0x1e2851;};'use strict';var multer=require(_0x6ee7('0x0'));var util=require(_0x6ee7('0x1'));var path=require('path');var timeout=require(_0x6ee7('0x2'));var express=require(_0x6ee7('0x3'));var router=express[_0x6ee7('0x4')]();var fs_extra=require(_0x6ee7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6ee7('0x6'));var config=require(_0x6ee7('0x7'));var controller=require(_0x6ee7('0x8'));router[_0x6ee7('0x9')]('/',auth[_0x6ee7('0xa')](),controller['index']);router[_0x6ee7('0x9')](_0x6ee7('0xb'),auth[_0x6ee7('0xa')](),controller[_0x6ee7('0xc')]);router[_0x6ee7('0xd')]('/',auth[_0x6ee7('0xa')](),controller[_0x6ee7('0xe')]);router[_0x6ee7('0xf')](_0x6ee7('0xb'),auth['isAuthenticated'](),controller[_0x6ee7('0x10')]);router[_0x6ee7('0x11')]('/:id',auth[_0x6ee7('0xa')](),controller[_0x6ee7('0x12')]);module[_0x6ee7('0x13')]=router; \ No newline at end of file +var _0x8751=['../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x18805f,_0x9973b){var _0x54edbb=function(_0x4686e8){while(--_0x4686e8){_0x18805f['push'](_0x18805f['shift']());}};_0x54edbb(++_0x9973b);}(_0x8751,0xdd));var _0x1875=function(_0x1f0884,_0x68d1ed){_0x1f0884=_0x1f0884-0x0;var _0x251809=_0x8751[_0x1f0884];return _0x251809;};'use strict';var multer=require(_0x1875('0x0'));var util=require(_0x1875('0x1'));var path=require(_0x1875('0x2'));var timeout=require(_0x1875('0x3'));var express=require(_0x1875('0x4'));var router=express[_0x1875('0x5')]();var fs_extra=require(_0x1875('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1875('0x7'));var controller=require(_0x1875('0x8'));router[_0x1875('0x9')]('/',auth['isAuthenticated'](),controller[_0x1875('0xa')]);router['get']('/:id',auth[_0x1875('0xb')](),controller[_0x1875('0xc')]);router[_0x1875('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1875('0xe')](_0x1875('0xf'),auth[_0x1875('0xb')](),controller['update']);router[_0x1875('0x10')](_0x1875('0xf'),auth[_0x1875('0xb')](),controller[_0x1875('0x11')]);module[_0x1875('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 8a7320c..d67449f 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 _0x0434=['sequelize','exports','STRING'];(function(_0x54a1ab,_0x50b153){var _0xee1b02=function(_0x7fbb1){while(--_0x7fbb1){_0x54a1ab['push'](_0x54a1ab['shift']());}};_0xee1b02(++_0x50b153);}(_0x0434,0x1ad));var _0x4043=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x0434[_0x32f9ca];return _0x52e083;};'use strict';var Sequelize=require(_0x4043('0x0'));module[_0x4043('0x1')]={'name':{'type':Sequelize[_0x4043('0x2')]},'basename':{'type':Sequelize[_0x4043('0x2')]},'type':{'type':Sequelize[_0x4043('0x2')]}}; \ No newline at end of file +var _0x7e16=['STRING','sequelize','exports'];(function(_0x5a8ecb,_0x590a83){var _0x3df52c=function(_0x5b6792){while(--_0x5b6792){_0x5a8ecb['push'](_0x5a8ecb['shift']());}};_0x3df52c(++_0x590a83);}(_0x7e16,0x16f));var _0x67e1=function(_0x394d1c,_0x44b6c5){_0x394d1c=_0x394d1c-0x0;var _0x47583c=_0x7e16[_0x394d1c];return _0x47583c;};'use strict';var Sequelize=require(_0x67e1('0x0'));module[_0x67e1('0x1')]={'name':{'type':Sequelize[_0x67e1('0x2')]},'basename':{'type':Sequelize[_0x67e1('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b0d54e9..5b4b0e7 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 _0xfe40=['reject','save','update','then','stack','name','send','index','map','Attachment','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','catch','clone','rawAttributes','get','omit','createdAt','updatedAt','body','create','destroy','file','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply'];(function(_0x1f5857,_0x43b0b7){var _0x1d752a=function(_0x3c638f){while(--_0x3c638f){_0x1f5857['push'](_0x1f5857['shift']());}};_0x1d752a(++_0x43b0b7);}(_0xfe40,0xf2));var _0x0fe4=function(_0x2f2a81,_0x1cdfbe){_0x2f2a81=_0x2f2a81-0x0;var _0xecefe8=_0xfe40[_0x2f2a81];return _0xecefe8;};'use strict';var emlformat=require(_0x0fe4('0x0'));var rimraf=require(_0x0fe4('0x1'));var zipdir=require(_0x0fe4('0x2'));var jsonpatch=require(_0x0fe4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0fe4('0x4'));var Mustache=require(_0x0fe4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0fe4('0x6'));var csv=require('to-csv');var ejs=require(_0x0fe4('0x7'));var fs=require('fs');var fs_extra=require(_0x0fe4('0x8'));var _=require(_0x0fe4('0x9'));var squel=require(_0x0fe4('0xa'));var crypto=require(_0x0fe4('0xb'));var jsforce=require(_0x0fe4('0xc'));var deskjs=require(_0x0fe4('0xd'));var toCsv=require(_0x0fe4('0xe'));var querystring=require(_0x0fe4('0xf'));var Papa=require(_0x0fe4('0x10'));var Redis=require(_0x0fe4('0x11'));var authService=require(_0x0fe4('0x12'));var qs=require(_0x0fe4('0x13'));var as=require(_0x0fe4('0x14'));var hardwareService=require(_0x0fe4('0x15'));var logger=require(_0x0fe4('0x16'))(_0x0fe4('0x17'));var utils=require(_0x0fe4('0x18'));var config=require(_0x0fe4('0x19'));var licenseUtil=require(_0x0fe4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x95d3dd,_0x63a449){_0x63a449=_0x63a449||0xcc;return function(_0x4b20b8){if(_0x4b20b8){return _0x95d3dd[_0x0fe4('0x1b')](_0x63a449);}return _0x95d3dd[_0x0fe4('0x1c')](_0x63a449)[_0x0fe4('0x1d')]();};}function respondWithResult(_0x2f066b,_0xd85f92){_0xd85f92=_0xd85f92||0xc8;return function(_0x45e463){if(_0x45e463){return _0x2f066b['status'](_0xd85f92)[_0x0fe4('0x1e')](_0x45e463);}};}function respondWithFilteredResult(_0x507ab5,_0x15dded){return function(_0x29104e){if(_0x29104e){var _0x17d5c2=typeof _0x15dded[_0x0fe4('0x1f')]===_0x0fe4('0x20')&&typeof _0x15dded['limit']===_0x0fe4('0x20');var _0x1618db=_0x29104e[_0x0fe4('0x21')];var _0x5b8bee=_0x17d5c2?0x0:_0x15dded[_0x0fe4('0x1f')];var _0xecc3f9=_0x17d5c2?_0x29104e[_0x0fe4('0x21')]:_0x15dded['offset']+_0x15dded['limit'];var _0x260d42;if(_0xecc3f9>=_0x1618db){_0xecc3f9=_0x1618db;_0x260d42=0xc8;}else{_0x260d42=0xce;}_0x507ab5[_0x0fe4('0x1c')](_0x260d42);return _0x507ab5[_0x0fe4('0x22')](_0x0fe4('0x23'),_0x5b8bee+'-'+_0xecc3f9+'/'+_0x1618db)[_0x0fe4('0x1e')](_0x29104e);}return null;};}function patchUpdates(_0x12a45a){return function(_0x2e7d43){try{jsonpatch[_0x0fe4('0x24')](_0x2e7d43,_0x12a45a,!![]);}catch(_0x470b71){return BPromise[_0x0fe4('0x25')](_0x470b71);}return _0x2e7d43[_0x0fe4('0x26')]();};}function saveUpdates(_0x1d38ad,_0x420349){return function(_0x1da477){if(_0x1da477){return _0x1da477[_0x0fe4('0x27')](_0x1d38ad)[_0x0fe4('0x28')](function(_0x3bfde9){return _0x3bfde9;});}return null;};}function removeEntity(_0x5c6af8,_0x134802){return function(_0x4526db){if(_0x4526db){return _0x4526db['destroy']()['then'](function(){_0x5c6af8['status'](0xcc)[_0x0fe4('0x1d')]();});}};}function handleEntityNotFound(_0x2cd80f,_0x588c22){return function(_0x230f8f){if(!_0x230f8f){_0x2cd80f['sendStatus'](0x194);}return _0x230f8f;};}function handleError(_0x20f72f,_0x41454d){_0x41454d=_0x41454d||0x1f4;return function(_0x11ea75){logger['error'](_0x11ea75[_0x0fe4('0x29')]);if(_0x11ea75['name']){delete _0x11ea75[_0x0fe4('0x2a')];}_0x20f72f['status'](_0x41454d)[_0x0fe4('0x2b')](_0x11ea75);};}exports[_0x0fe4('0x2c')]=function(_0x33797d,_0x5affd5){var _0x1a3647={},_0x5c0f3e={},_0x1f4bc3={'count':0x0,'rows':[]};var _0x1af70a=_[_0x0fe4('0x2d')](db[_0x0fe4('0x2e')]['rawAttributes'],function(_0x5adad6){return{'name':_0x5adad6[_0x0fe4('0x2f')],'type':_0x5adad6[_0x0fe4('0x30')][_0x0fe4('0x31')]};});_0x5c0f3e['model']=_[_0x0fe4('0x2d')](_0x1af70a,_0x0fe4('0x2a'));_0x5c0f3e[_0x0fe4('0x32')]=_[_0x0fe4('0x33')](_0x33797d[_0x0fe4('0x32')]);_0x5c0f3e[_0x0fe4('0x34')]=_[_0x0fe4('0x35')](_0x5c0f3e[_0x0fe4('0x36')],_0x5c0f3e[_0x0fe4('0x32')]);_0x1a3647[_0x0fe4('0x37')]=_[_0x0fe4('0x35')](_0x5c0f3e['model'],qs[_0x0fe4('0x38')](_0x33797d[_0x0fe4('0x32')][_0x0fe4('0x38')]));_0x1a3647[_0x0fe4('0x37')]=_0x1a3647[_0x0fe4('0x37')]['length']?_0x1a3647['attributes']:_0x5c0f3e[_0x0fe4('0x36')];if(!_0x33797d['query']['hasOwnProperty'](_0x0fe4('0x39'))){_0x1a3647[_0x0fe4('0x3a')]=qs[_0x0fe4('0x3a')](_0x33797d[_0x0fe4('0x32')][_0x0fe4('0x3a')]);_0x1a3647[_0x0fe4('0x1f')]=qs[_0x0fe4('0x1f')](_0x33797d[_0x0fe4('0x32')]['offset']);}_0x1a3647[_0x0fe4('0x3b')]=qs[_0x0fe4('0x3c')](_0x33797d[_0x0fe4('0x32')][_0x0fe4('0x3c')]);_0x1a3647[_0x0fe4('0x3d')]=qs[_0x0fe4('0x34')](_[_0x0fe4('0x3e')](_0x33797d['query'],_0x5c0f3e['filters']),_0x1af70a);if(_0x33797d[_0x0fe4('0x32')]['filter']){_0x1a3647[_0x0fe4('0x3d')]=_[_0x0fe4('0x3f')](_0x1a3647[_0x0fe4('0x3d')],{'$or':_[_0x0fe4('0x2d')](_0x1af70a,function(_0x58915a){if(_0x58915a['type']!==_0x0fe4('0x40')){var _0x473899={};_0x473899[_0x58915a[_0x0fe4('0x2a')]]={'$like':'%'+_0x33797d[_0x0fe4('0x32')][_0x0fe4('0x41')]+'%'};return _0x473899;}})});}_0x1a3647=_[_0x0fe4('0x3f')]({},_0x1a3647,_0x33797d[_0x0fe4('0x42')]);var _0x325152={'where':_0x1a3647[_0x0fe4('0x3d')]};return db['Attachment'][_0x0fe4('0x21')](_0x325152)[_0x0fe4('0x28')](function(_0x5996f3){_0x1f4bc3[_0x0fe4('0x21')]=_0x5996f3;if(_0x33797d['query'][_0x0fe4('0x43')]){_0x1a3647[_0x0fe4('0x44')]=[{'all':!![]}];}return db[_0x0fe4('0x2e')][_0x0fe4('0x45')](_0x1a3647);})[_0x0fe4('0x28')](function(_0x3017df){_0x1f4bc3[_0x0fe4('0x46')]=_0x3017df;return _0x1f4bc3;})[_0x0fe4('0x28')](respondWithFilteredResult(_0x5affd5,_0x1a3647))['catch'](handleError(_0x5affd5,null));};exports['show']=function(_0x405408,_0x1a985e){var _0x23c41e={'raw':!![],'where':{'id':_0x405408[_0x0fe4('0x47')]['id']}},_0x2087ed={};_0x2087ed[_0x0fe4('0x36')]=_[_0x0fe4('0x33')](db[_0x0fe4('0x2e')]['rawAttributes']);_0x2087ed[_0x0fe4('0x32')]=_[_0x0fe4('0x33')](_0x405408[_0x0fe4('0x32')]);_0x2087ed['filters']=_['intersection'](_0x2087ed['model'],_0x2087ed[_0x0fe4('0x32')]);_0x23c41e[_0x0fe4('0x37')]=_[_0x0fe4('0x35')](_0x2087ed['model'],qs[_0x0fe4('0x38')](_0x405408['query'][_0x0fe4('0x38')]));_0x23c41e[_0x0fe4('0x37')]=_0x23c41e['attributes'][_0x0fe4('0x48')]?_0x23c41e['attributes']:_0x2087ed[_0x0fe4('0x36')];if(_0x405408['query']['includeAll']){_0x23c41e[_0x0fe4('0x44')]=[{'all':!![]}];}_0x23c41e=_[_0x0fe4('0x3f')]({},_0x23c41e,_0x405408[_0x0fe4('0x42')]);return db[_0x0fe4('0x2e')][_0x0fe4('0x49')](_0x23c41e)['then'](handleEntityNotFound(_0x1a985e,null))[_0x0fe4('0x28')](respondWithResult(_0x1a985e,null))[_0x0fe4('0x4a')](handleError(_0x1a985e,null));};exports[_0x0fe4('0x4b')]=function(_0x548cf9,_0x36f1f4){var _0xd6778e={'where':{'id':_0x548cf9['params']['id']}},_0x4466b3={};_0x4466b3[_0x0fe4('0x36')]=_[_0x0fe4('0x33')](db[_0x0fe4('0x2e')][_0x0fe4('0x4c')]);_0xd6778e[_0x0fe4('0x37')]=_[_0x0fe4('0x35')](_0x4466b3[_0x0fe4('0x36')],qs['fields'](_0x548cf9[_0x0fe4('0x32')][_0x0fe4('0x38')]));_0xd6778e['attributes']=_0xd6778e[_0x0fe4('0x37')][_0x0fe4('0x48')]?_0xd6778e[_0x0fe4('0x37')]:_0x4466b3[_0x0fe4('0x36')];if(_0x548cf9['query']['includeAll']){_0xd6778e[_0x0fe4('0x44')]=[{'all':!![]}];}_0xd6778e=_['merge']({},_0xd6778e,_0x548cf9[_0x0fe4('0x42')]);return db['Attachment'][_0x0fe4('0x49')](_0xd6778e)[_0x0fe4('0x28')](handleEntityNotFound(_0x36f1f4,null))[_0x0fe4('0x28')](function(_0x33149f){if(_0x33149f){var _0x354ecf=_0x33149f[_0x0fe4('0x4d')]({'plain':!![]});_0x354ecf=qs[_0x0fe4('0x4e')](_0x354ecf,['id',_0x0fe4('0x4f'),_0x0fe4('0x50')]);_0x548cf9[_0x0fe4('0x51')]=_[_0x0fe4('0x4e')](_0x548cf9[_0x0fe4('0x51')],['id','createdAt','updatedAt']);return db[_0x0fe4('0x2e')][_0x0fe4('0x52')](_[_0x0fe4('0x3f')](_0x354ecf,_0x548cf9[_0x0fe4('0x51')]),{'include':_0x548cf9['query'][_0x0fe4('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x36f1f4,0xc9))[_0x0fe4('0x4a')](handleError(_0x36f1f4,null));};exports[_0x0fe4('0x27')]=function(_0x76293f,_0x173a6c){if(_0x76293f[_0x0fe4('0x51')]['id']){delete _0x76293f['body']['id'];}return db[_0x0fe4('0x2e')][_0x0fe4('0x49')]({'where':{'id':_0x76293f[_0x0fe4('0x47')]['id']}})[_0x0fe4('0x28')](handleEntityNotFound(_0x173a6c,null))[_0x0fe4('0x28')](saveUpdates(_0x76293f[_0x0fe4('0x51')],null))['then'](respondWithResult(_0x173a6c,null))[_0x0fe4('0x4a')](handleError(_0x173a6c,null));};exports[_0x0fe4('0x53')]=function(_0x97d96c,_0x12bd6f){return db['Attachment'][_0x0fe4('0x49')]({'where':{'id':_0x97d96c[_0x0fe4('0x47')]['id']}})[_0x0fe4('0x28')](handleEntityNotFound(_0x12bd6f,null))[_0x0fe4('0x28')](removeEntity(_0x12bd6f,null))[_0x0fe4('0x4a')](handleError(_0x12bd6f,null));};exports[_0x0fe4('0x52')]=function(_0x4b36c7,_0x1e271d,_0x3d83ae){_0x4b36c7[_0x0fe4('0x51')]['name']=_0x4b36c7[_0x0fe4('0x54')]['originalname'];_0x4b36c7[_0x0fe4('0x51')]['basename']=_0x4b36c7[_0x0fe4('0x54')]['filename'];_0x4b36c7[_0x0fe4('0x51')][_0x0fe4('0x30')]=_0x4b36c7[_0x0fe4('0x54')][_0x0fe4('0x55')];return db[_0x0fe4('0x2e')]['create'](_0x4b36c7[_0x0fe4('0x51')])['then'](respondWithResult(_0x1e271d,0xc9))['catch'](handleError(_0x1e271d,null));};exports['download']=function(_0x15ed25,_0x520350,_0x13dc11){return db[_0x0fe4('0x2e')][_0x0fe4('0x56')]({'where':{'id':_0x15ed25[_0x0fe4('0x47')]['id']},'raw':!![]})[_0x0fe4('0x28')](handleEntityNotFound(_0x520350,null))[_0x0fe4('0x28')](function(_0x5a3e91){if(_0x5a3e91){var _0x1642d7=_0x5a3e91[_0x0fe4('0x57')]!==null;var _0x59fa87=path['join'](config[_0x0fe4('0x58')],_0x0fe4('0x59'));if(_0x1642d7){_0x59fa87=path[_0x0fe4('0x5a')](_0x59fa87,_0x0fe4('0x5b'));}var _0x4f47b0=path['join'](_0x59fa87,_0x5a3e91['basename']);return _0x520350[_0x0fe4('0x5c')](_0x4f47b0);}})['catch'](handleError(_0x520350,null));}; \ No newline at end of file +var _0x2865=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','stack','name','send','map','Attachment','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','clone','get','updatedAt','body','omit','create','destroy','file','originalname','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs'];(function(_0x183d7d,_0x3838e3){var _0x4de863=function(_0x3f74c5){while(--_0x3f74c5){_0x183d7d['push'](_0x183d7d['shift']());}};_0x4de863(++_0x3838e3);}(_0x2865,0x14d));var _0x5286=function(_0xd017ee,_0x2f999e){_0xd017ee=_0xd017ee-0x0;var _0x6236fc=_0x2865[_0xd017ee];return _0x6236fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5286('0x0'));var zipdir=require(_0x5286('0x1'));var jsonpatch=require(_0x5286('0x2'));var rp=require(_0x5286('0x3'));var moment=require(_0x5286('0x4'));var BPromise=require(_0x5286('0x5'));var Mustache=require(_0x5286('0x6'));var util=require(_0x5286('0x7'));var path=require(_0x5286('0x8'));var sox=require(_0x5286('0x9'));var csv=require(_0x5286('0xa'));var ejs=require(_0x5286('0xb'));var fs=require('fs');var fs_extra=require(_0x5286('0xc'));var _=require(_0x5286('0xd'));var squel=require(_0x5286('0xe'));var crypto=require(_0x5286('0xf'));var jsforce=require(_0x5286('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5286('0xa'));var querystring=require('querystring');var Papa=require(_0x5286('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5286('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5286('0x13'));var logger=require(_0x5286('0x14'))(_0x5286('0x15'));var utils=require(_0x5286('0x16'));var config=require(_0x5286('0x17'));var licenseUtil=require(_0x5286('0x18'));var db=require(_0x5286('0x19'))['db'];function respondWithStatusCode(_0x57a290,_0xda5bcd){_0xda5bcd=_0xda5bcd||0xcc;return function(_0x115467){if(_0x115467){return _0x57a290[_0x5286('0x1a')](_0xda5bcd);}return _0x57a290[_0x5286('0x1b')](_0xda5bcd)['end']();};}function respondWithResult(_0x33d6c0,_0x504025){_0x504025=_0x504025||0xc8;return function(_0xa6c7e5){if(_0xa6c7e5){return _0x33d6c0['status'](_0x504025)[_0x5286('0x1c')](_0xa6c7e5);}};}function respondWithFilteredResult(_0x3bffef,_0x4b86cd){return function(_0x511729){if(_0x511729){var _0x1c6379=typeof _0x4b86cd[_0x5286('0x1d')]===_0x5286('0x1e')&&typeof _0x4b86cd[_0x5286('0x1f')]==='undefined';var _0x119810=_0x511729[_0x5286('0x20')];var _0x531b8f=_0x1c6379?0x0:_0x4b86cd[_0x5286('0x1d')];var _0x5366ff=_0x1c6379?_0x511729[_0x5286('0x20')]:_0x4b86cd['offset']+_0x4b86cd[_0x5286('0x1f')];var _0x16dab1;if(_0x5366ff>=_0x119810){_0x5366ff=_0x119810;_0x16dab1=0xc8;}else{_0x16dab1=0xce;}_0x3bffef[_0x5286('0x1b')](_0x16dab1);return _0x3bffef['set'](_0x5286('0x21'),_0x531b8f+'-'+_0x5366ff+'/'+_0x119810)['json'](_0x511729);}return null;};}function patchUpdates(_0x3e93de){return function(_0xcfd42b){try{jsonpatch[_0x5286('0x22')](_0xcfd42b,_0x3e93de,!![]);}catch(_0x52bd3b){return BPromise['reject'](_0x52bd3b);}return _0xcfd42b[_0x5286('0x23')]();};}function saveUpdates(_0x3e5d9c,_0x3f279a){return function(_0xb76166){if(_0xb76166){return _0xb76166[_0x5286('0x24')](_0x3e5d9c)[_0x5286('0x25')](function(_0x53b3db){return _0x53b3db;});}return null;};}function removeEntity(_0x3f223d,_0x9e948f){return function(_0x931ecf){if(_0x931ecf){return _0x931ecf['destroy']()[_0x5286('0x25')](function(){_0x3f223d[_0x5286('0x1b')](0xcc)[_0x5286('0x26')]();});}};}function handleEntityNotFound(_0x5ee5bd,_0x2ecfd1){return function(_0x4d934f){if(!_0x4d934f){_0x5ee5bd['sendStatus'](0x194);}return _0x4d934f;};}function handleError(_0x331fa9,_0x13377a){_0x13377a=_0x13377a||0x1f4;return function(_0x11482a){logger['error'](_0x11482a[_0x5286('0x27')]);if(_0x11482a[_0x5286('0x28')]){delete _0x11482a[_0x5286('0x28')];}_0x331fa9[_0x5286('0x1b')](_0x13377a)[_0x5286('0x29')](_0x11482a);};}exports['index']=function(_0x4099e4,_0x2f78c2){var _0x448f60={},_0x567acb={},_0x1a3fbd={'count':0x0,'rows':[]};var _0x2a4ce7=_[_0x5286('0x2a')](db[_0x5286('0x2b')][_0x5286('0x2c')],function(_0x2a5b25){return{'name':_0x2a5b25[_0x5286('0x2d')],'type':_0x2a5b25[_0x5286('0x2e')]['key']};});_0x567acb[_0x5286('0x2f')]=_[_0x5286('0x2a')](_0x2a4ce7,_0x5286('0x28'));_0x567acb[_0x5286('0x30')]=_[_0x5286('0x31')](_0x4099e4[_0x5286('0x30')]);_0x567acb[_0x5286('0x32')]=_[_0x5286('0x33')](_0x567acb[_0x5286('0x2f')],_0x567acb[_0x5286('0x30')]);_0x448f60[_0x5286('0x34')]=_['intersection'](_0x567acb[_0x5286('0x2f')],qs[_0x5286('0x35')](_0x4099e4[_0x5286('0x30')]['fields']));_0x448f60[_0x5286('0x34')]=_0x448f60[_0x5286('0x34')]['length']?_0x448f60[_0x5286('0x34')]:_0x567acb[_0x5286('0x2f')];if(!_0x4099e4[_0x5286('0x30')][_0x5286('0x36')](_0x5286('0x37'))){_0x448f60[_0x5286('0x1f')]=qs[_0x5286('0x1f')](_0x4099e4[_0x5286('0x30')][_0x5286('0x1f')]);_0x448f60[_0x5286('0x1d')]=qs[_0x5286('0x1d')](_0x4099e4[_0x5286('0x30')]['offset']);}_0x448f60[_0x5286('0x38')]=qs[_0x5286('0x39')](_0x4099e4['query'][_0x5286('0x39')]);_0x448f60[_0x5286('0x3a')]=qs['filters'](_[_0x5286('0x3b')](_0x4099e4['query'],_0x567acb['filters']),_0x2a4ce7);if(_0x4099e4[_0x5286('0x30')][_0x5286('0x3c')]){_0x448f60[_0x5286('0x3a')]=_[_0x5286('0x3d')](_0x448f60[_0x5286('0x3a')],{'$or':_[_0x5286('0x2a')](_0x2a4ce7,function(_0x4459c4){if(_0x4459c4[_0x5286('0x2e')]!==_0x5286('0x3e')){var _0x59b598={};_0x59b598[_0x4459c4['name']]={'$like':'%'+_0x4099e4[_0x5286('0x30')][_0x5286('0x3c')]+'%'};return _0x59b598;}})});}_0x448f60=_[_0x5286('0x3d')]({},_0x448f60,_0x4099e4[_0x5286('0x3f')]);var _0x5a2207={'where':_0x448f60[_0x5286('0x3a')]};return db[_0x5286('0x2b')][_0x5286('0x20')](_0x5a2207)[_0x5286('0x25')](function(_0x1ff58c){_0x1a3fbd[_0x5286('0x20')]=_0x1ff58c;if(_0x4099e4['query'][_0x5286('0x40')]){_0x448f60[_0x5286('0x41')]=[{'all':!![]}];}return db[_0x5286('0x2b')][_0x5286('0x42')](_0x448f60);})['then'](function(_0xc8bbb1){_0x1a3fbd[_0x5286('0x43')]=_0xc8bbb1;return _0x1a3fbd;})['then'](respondWithFilteredResult(_0x2f78c2,_0x448f60))[_0x5286('0x44')](handleError(_0x2f78c2,null));};exports[_0x5286('0x45')]=function(_0x58a71e,_0x145871){var _0x39a856={'raw':!![],'where':{'id':_0x58a71e[_0x5286('0x46')]['id']}},_0x2ab5cf={};_0x2ab5cf[_0x5286('0x2f')]=_[_0x5286('0x31')](db[_0x5286('0x2b')][_0x5286('0x2c')]);_0x2ab5cf[_0x5286('0x30')]=_[_0x5286('0x31')](_0x58a71e[_0x5286('0x30')]);_0x2ab5cf[_0x5286('0x32')]=_[_0x5286('0x33')](_0x2ab5cf[_0x5286('0x2f')],_0x2ab5cf[_0x5286('0x30')]);_0x39a856[_0x5286('0x34')]=_[_0x5286('0x33')](_0x2ab5cf[_0x5286('0x2f')],qs[_0x5286('0x35')](_0x58a71e[_0x5286('0x30')]['fields']));_0x39a856[_0x5286('0x34')]=_0x39a856['attributes'][_0x5286('0x47')]?_0x39a856['attributes']:_0x2ab5cf['model'];if(_0x58a71e[_0x5286('0x30')][_0x5286('0x40')]){_0x39a856[_0x5286('0x41')]=[{'all':!![]}];}_0x39a856=_[_0x5286('0x3d')]({},_0x39a856,_0x58a71e[_0x5286('0x3f')]);return db[_0x5286('0x2b')][_0x5286('0x48')](_0x39a856)[_0x5286('0x25')](handleEntityNotFound(_0x145871,null))[_0x5286('0x25')](respondWithResult(_0x145871,null))[_0x5286('0x44')](handleError(_0x145871,null));};exports[_0x5286('0x49')]=function(_0x542fa4,_0xcae2f1){var _0x250297={'where':{'id':_0x542fa4['params']['id']}},_0xebb5e3={};_0xebb5e3[_0x5286('0x2f')]=_[_0x5286('0x31')](db[_0x5286('0x2b')][_0x5286('0x2c')]);_0x250297[_0x5286('0x34')]=_['intersection'](_0xebb5e3[_0x5286('0x2f')],qs[_0x5286('0x35')](_0x542fa4[_0x5286('0x30')][_0x5286('0x35')]));_0x250297[_0x5286('0x34')]=_0x250297['attributes'][_0x5286('0x47')]?_0x250297[_0x5286('0x34')]:_0xebb5e3['model'];if(_0x542fa4[_0x5286('0x30')][_0x5286('0x40')]){_0x250297[_0x5286('0x41')]=[{'all':!![]}];}_0x250297=_['merge']({},_0x250297,_0x542fa4[_0x5286('0x3f')]);return db[_0x5286('0x2b')][_0x5286('0x48')](_0x250297)[_0x5286('0x25')](handleEntityNotFound(_0xcae2f1,null))[_0x5286('0x25')](function(_0x1b70d2){if(_0x1b70d2){var _0x19fae9=_0x1b70d2[_0x5286('0x4a')]({'plain':!![]});_0x19fae9=qs['omit'](_0x19fae9,['id','createdAt',_0x5286('0x4b')]);_0x542fa4[_0x5286('0x4c')]=_[_0x5286('0x4d')](_0x542fa4[_0x5286('0x4c')],['id','createdAt',_0x5286('0x4b')]);return db[_0x5286('0x2b')][_0x5286('0x4e')](_[_0x5286('0x3d')](_0x19fae9,_0x542fa4[_0x5286('0x4c')]),{'include':_0x542fa4['query'][_0x5286('0x40')]?[{'all':!![]}]:undefined});}})[_0x5286('0x25')](respondWithResult(_0xcae2f1,0xc9))[_0x5286('0x44')](handleError(_0xcae2f1,null));};exports['update']=function(_0x21b861,_0x53f4c0){if(_0x21b861['body']['id']){delete _0x21b861[_0x5286('0x4c')]['id'];}return db['Attachment'][_0x5286('0x48')]({'where':{'id':_0x21b861[_0x5286('0x46')]['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x53f4c0,null))['then'](saveUpdates(_0x21b861['body'],null))[_0x5286('0x25')](respondWithResult(_0x53f4c0,null))[_0x5286('0x44')](handleError(_0x53f4c0,null));};exports[_0x5286('0x4f')]=function(_0x5e11b3,_0x163a80){return db[_0x5286('0x2b')][_0x5286('0x48')]({'where':{'id':_0x5e11b3[_0x5286('0x46')]['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x163a80,null))[_0x5286('0x25')](removeEntity(_0x163a80,null))[_0x5286('0x44')](handleError(_0x163a80,null));};exports[_0x5286('0x4e')]=function(_0x45db95,_0x2fea98,_0x2654a0){_0x45db95['body'][_0x5286('0x28')]=_0x45db95[_0x5286('0x50')][_0x5286('0x51')];_0x45db95['body']['basename']=_0x45db95[_0x5286('0x50')]['filename'];_0x45db95[_0x5286('0x4c')]['type']=_0x45db95[_0x5286('0x50')]['mimetype'];return db[_0x5286('0x2b')][_0x5286('0x4e')](_0x45db95[_0x5286('0x4c')])[_0x5286('0x25')](respondWithResult(_0x2fea98,0xc9))[_0x5286('0x44')](handleError(_0x2fea98,null));};exports[_0x5286('0x52')]=function(_0x199c34,_0x38072c,_0x4eefe2){return db[_0x5286('0x2b')]['findOne']({'where':{'id':_0x199c34[_0x5286('0x46')]['id']},'raw':!![]})[_0x5286('0x25')](handleEntityNotFound(_0x38072c,null))['then'](function(_0x405961){if(_0x405961){var _0x47ca51=_0x405961[_0x5286('0x53')]!==null;var _0x36ed77=path[_0x5286('0x54')](config['root'],_0x5286('0x55'));if(_0x47ca51){_0x36ed77=path[_0x5286('0x54')](_0x36ed77,_0x5286('0x56'));}var _0x4fb963=path[_0x5286('0x54')](_0x36ed77,_0x405961[_0x5286('0x57')]);return _0x38072c[_0x5286('0x52')](_0x4fb963);}})[_0x5286('0x44')](handleError(_0x38072c,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 93eaec6..37bccc9 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 _0x3451=['exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3451,0xd4));var _0x1345=function(_0xf77d7d,_0x5c170a){_0xf77d7d=_0xf77d7d-0x0;var _0x25d379=_0x3451[_0xf77d7d];return _0x25d379;};'use strict';var _=require(_0x1345('0x0'));var util=require('util');var logger=require(_0x1345('0x1'))(_0x1345('0x2'));var moment=require(_0x1345('0x3'));var BPromise=require(_0x1345('0x4'));var rp=require(_0x1345('0x5'));var fs=require('fs');var path=require(_0x1345('0x6'));var rimraf=require(_0x1345('0x7'));var config=require(_0x1345('0x8'));var attributes=require('./attachment.attributes');module[_0x1345('0x9')]=function(_0x11a693,_0xf58f5d){return _0x11a693[_0x1345('0xa')](_0x1345('0xb'),attributes,{'tableName':_0x1345('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aaf=['rimraf','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x38d455,_0x593ac8){var _0x22f36b=function(_0x43dcac){while(--_0x43dcac){_0x38d455['push'](_0x38d455['shift']());}};_0x22f36b(++_0x593ac8);}(_0x7aaf,0x198));var _0xf7aa=function(_0x17a5e4,_0x232546){_0x17a5e4=_0x17a5e4-0x0;var _0x4de4dd=_0x7aaf[_0x17a5e4];return _0x4de4dd;};'use strict';var _=require(_0xf7aa('0x0'));var util=require(_0xf7aa('0x1'));var logger=require(_0xf7aa('0x2'))(_0xf7aa('0x3'));var moment=require(_0xf7aa('0x4'));var BPromise=require(_0xf7aa('0x5'));var rp=require(_0xf7aa('0x6'));var fs=require('fs');var path=require(_0xf7aa('0x7'));var rimraf=require(_0xf7aa('0x8'));var config=require('../../config/environment');var attributes=require(_0xf7aa('0x9'));module[_0xf7aa('0xa')]=function(_0x508e43,_0x4df1f6){return _0x508e43[_0xf7aa('0xb')](_0xf7aa('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 21760b8..4c78320 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 _0xd382=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','Attachment,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird'];(function(_0x2dc091,_0x328678){var _0x442c3e=function(_0x57461a){while(--_0x57461a){_0x2dc091['push'](_0x2dc091['shift']());}};_0x442c3e(++_0x328678);}(_0xd382,0x1b6));var _0x2d38=function(_0x164f06,_0x17632f){_0x164f06=_0x164f06-0x0;var _0x311b7a=_0xd382[_0x164f06];return _0x311b7a;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var moment=require(_0x2d38('0x2'));var BPromise=require(_0x2d38('0x3'));var rs=require(_0x2d38('0x4'));var fs=require('fs');var Redis=require(_0x2d38('0x5'));var db=require(_0x2d38('0x6'))['db'];var utils=require(_0x2d38('0x7'));var logger=require(_0x2d38('0x8'))(_0x2d38('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2919,_0x55ae65,_0x1296cb){return new BPromise(function(_0x3fb88f,_0x39ebfd){return client['request'](_0x1e2919,_0x1296cb)['then'](function(_0x5f20a4){logger[_0x2d38('0xb')](_0x2d38('0xc'),_0x55ae65,'request\x20sent');logger[_0x2d38('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x55ae65,_0x2d38('0xe'),JSON[_0x2d38('0xf')](_0x5f20a4));if(_0x5f20a4[_0x2d38('0x10')]){if(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x11')]===0x1f4){logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x5f20a4['error'][_0x2d38('0x12')]);return _0x39ebfd(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x12')]);}logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x5f20a4['error'][_0x2d38('0x12')]);return _0x3fb88f(_0x5f20a4[_0x2d38('0x10')][_0x2d38('0x12')]);}else{logger[_0x2d38('0xb')](_0x2d38('0xc'),_0x55ae65,_0x2d38('0xe'));_0x3fb88f(_0x5f20a4[_0x2d38('0x13')][_0x2d38('0x12')]);}})[_0x2d38('0x14')](function(_0x6d2a9a){logger[_0x2d38('0x10')](_0x2d38('0xc'),_0x55ae65,_0x6d2a9a);_0x39ebfd(_0x6d2a9a);});});}exports[_0x2d38('0x15')]=function(_0x1e3028){var _0x45c7a8=this;return new Promise(function(_0x9904e0,_0x56016e){return db[_0x2d38('0x16')][_0x2d38('0x17')](_0x1e3028['body'],{'raw':_0x1e3028[_0x2d38('0x18')]?_0x1e3028[_0x2d38('0x18')][_0x2d38('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x46f8be){logger['info']('CreateAttachment',_0x1e3028);logger[_0x2d38('0xd')](_0x2d38('0x15'),_0x1e3028,JSON[_0x2d38('0xf')](_0x46f8be));_0x9904e0(_0x46f8be);})[_0x2d38('0x14')](function(_0x19e658){logger[_0x2d38('0x10')](_0x2d38('0x15'),_0x19e658[_0x2d38('0x12')],_0x1e3028);_0x56016e(_0x45c7a8[_0x2d38('0x10')](0x1f4,_0x19e658[_0x2d38('0x12')]));});});}; \ No newline at end of file +var _0x9aea=['body','options','raw','CreateAttachment','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','Attachment','create'];(function(_0x923c72,_0x5cdc55){var _0x1bcce4=function(_0x29c82d){while(--_0x29c82d){_0x923c72['push'](_0x923c72['shift']());}};_0x1bcce4(++_0x5cdc55);}(_0x9aea,0xdd));var _0xa9ae=function(_0x235b89,_0x166728){_0x235b89=_0x235b89-0x0;var _0x533a92=_0x9aea[_0x235b89];return _0x533a92;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});}exports['CreateAttachment']=function(_0x4dbb30){var _0xb078d2=this;return new Promise(function(_0x581345,_0x59e7dd){return db[_0xa9ae('0x14')][_0xa9ae('0x15')](_0x4dbb30[_0xa9ae('0x16')],{'raw':_0x4dbb30[_0xa9ae('0x17')]?_0x4dbb30['options'][_0xa9ae('0x18')]===undefined?!![]:![]:!![]})[_0xa9ae('0xb')](function(_0x39f133){logger[_0xa9ae('0xc')](_0xa9ae('0x19'),_0x4dbb30);logger[_0xa9ae('0xf')](_0xa9ae('0x19'),_0x4dbb30,JSON['stringify'](_0x39f133));_0x581345(_0x39f133);})[_0xa9ae('0x1a')](function(_0x4ca9a9){logger['error']('CreateAttachment',_0x4ca9a9['message'],_0x4dbb30);_0x59e7dd(_0xb078d2[_0xa9ae('0x10')](0x1f4,_0x4ca9a9['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index ba2a5fb..a0a42b6 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x1ad8f4,_0x27b804){_0x1ad8f4=_0x1ad8f4-0x0;var _0x2512e7=_0xdb28[_0x1ad8f4];return _0x2512e7;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x76887e,_0x29ae89){var _0x149f98=function(_0x37dcdc){while(--_0x37dcdc){_0x76887e['push'](_0x76887e['shift']());}};_0x149f98(++_0x29ae89);}(_0x5f2f,0x73));var _0xf5f2=function(_0x730850,_0x56ce74){_0x730850=_0x730850-0x0;var _0x1ac6e2=_0x5f2f[_0x730850];return _0x1ac6e2;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index db79783..8636409 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 _0x1f7e=['login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','online','admin','agent','name','blockDuration','clearBlockUser','getLicense','catch','status','send'];(function(_0x5a577f,_0x4aba92){var _0x434a73=function(_0x21b21f){while(--_0x21b21f){_0x5a577f['push'](_0x5a577f['shift']());}};_0x434a73(++_0x4aba92);}(_0x1f7e,0xc6));var _0xe1f7=function(_0x1e8fe2,_0x31e8ea){_0x1e8fe2=_0x1e8fe2-0x0;var _0x5bf337=_0x1f7e[_0x1e8fe2];return _0x5bf337;};'use strict';var passport=require(_0xe1f7('0x0'));var LocalStrategy=require(_0xe1f7('0x1'))[_0xe1f7('0x2')];var moment=require(_0xe1f7('0x3'));var ActiveDirectory=require(_0xe1f7('0x4'));var BPromise=require(_0xe1f7('0x5'));var util=require(_0xe1f7('0x6'));var db=require(_0xe1f7('0x7'))['db'];var authService=require(_0xe1f7('0x8'));var utils=require(_0xe1f7('0x9'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xe1f7('0xa'));function isActiveDirectoryConfigured(_0x2067ce){var _0x38186f=![];if(typeof _0x2067ce['activedirectory']!==_0xe1f7('0xb')){_0x38186f=_0x2067ce[_0xe1f7('0xc')][_0xe1f7('0xd')]&&_0x2067ce[_0xe1f7('0xc')][_0xe1f7('0xe')]&&_0x2067ce[_0xe1f7('0xc')][_0xe1f7('0xf')];}return _0x38186f;}function adAuthenticate(_0x5b09a0,_0x367826,_0xac9c2b){return new BPromise(function(_0x178abe,_0x55f8d0){try{var _0x165d7d=new ActiveDirectory(_0x5b09a0);_0x165d7d[_0xe1f7('0x10')](_0x367826,_0xac9c2b,function(_0x2c5897,_0x52f09c){if(_0x2c5897){logger[_0xe1f7('0x11')]('Error\x20authenticate\x20%s:\x20%s',_0x367826,util[_0xe1f7('0x12')](_0x2c5897,{'showHidden':![],'depth':null}));_0x55f8d0('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x52f09c){logger['error'](_0xe1f7('0x13'),_0x367826);_0x55f8d0(_0xe1f7('0x14'));}else{_0x178abe(_0x52f09c);}});}catch(_0x456772){_0x55f8d0(_0x456772);}});}function ActiveDirectoryAuthenticate(_0x1e9ad6,_0x37df79,_0x1d650f,_0x47b504){var _0x147856,_0x8187ae;if(!isActiveDirectoryConfigured(config)){logger[_0xe1f7('0x11')](_0xe1f7('0x15'),_0x37df79);return _0x47b504(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xe1f7('0x16')][_0xe1f7('0x17')]({'where':{'id':0x1},'attributes':[_0xe1f7('0x18'),'blockDuration'],'raw':!![]})[_0xe1f7('0x19')](function(_0x45bb5f){_0x147856=_0x45bb5f;if(!_0x147856[_0xe1f7('0x18')]){logger[_0xe1f7('0x11')](_0xe1f7('0x1a'),_0x37df79);throw new Error(_0xe1f7('0x14'));}return _0x1e9ad6['findOne']({'attributes':['id','name',_0xe1f7('0x1b'),_0xe1f7('0x1c'),_0xe1f7('0x1d'),_0xe1f7('0x1e'),_0xe1f7('0x1f'),'blockedAt',_0xe1f7('0x20')],'where':{'name':_0x37df79,'role':{'$or':[_0xe1f7('0x21'),'user',_0xe1f7('0x22')]},'adSsoEnabled':!![]}});})[_0xe1f7('0x19')](function(_0x4a22b1){if(!_0x4a22b1||_0x4a22b1&&_0x4a22b1[_0xe1f7('0x23')]!==_0x37df79){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x8187ae=_0x4a22b1;var _0x7afe29=_0x8187ae[_0xe1f7('0x23')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x7afe29,_0x1d650f);})[_0xe1f7('0x19')](function(_0x2ffc1c){if(_0x8187ae[_0xe1f7('0x1e')]){throw new Error(_0xe1f7('0x14'));}if(_0x147856[_0xe1f7('0x24')]>0x0){if(_0x8187ae[_0xe1f7('0x1f')]){if(moment(_0x8187ae['blockedAt'])['add'](_0x147856['blockDuration'],'minutes')>moment()){throw new Error(_0xe1f7('0x14'));}return utils[_0xe1f7('0x25')](_0x8187ae,0x0,![],null)[_0xe1f7('0x19')](function(){return utils[_0xe1f7('0x26')](_0x8187ae);})['then'](function(){return _0x47b504(null,_0x8187ae);});}else{return utils[_0xe1f7('0x26')](_0x8187ae)[_0xe1f7('0x19')](function(){return _0x47b504(null,_0x8187ae);});}}else{return utils[_0xe1f7('0x26')](_0x8187ae)['then'](function(){return _0x47b504(null,_0x8187ae);});}})[_0xe1f7('0x27')](function(_0x1d40f8){return _0x47b504(null,![],_0x1d40f8);});}function handleError(_0x5a4722,_0x2a479b,_0xec3f7){return _0x5a4722[_0xe1f7('0x28')](_0x2a479b||0x1f4)[_0xe1f7('0x29')]({'message':_0xec3f7?_0xec3f7['message']||_0xec3f7:''});}exports[_0xe1f7('0x2a')]=function(_0x2c627d,_0x2fbc85,_0xce2b5c){passport[_0xe1f7('0x10')](_0xe1f7('0x2b'),function(_0x2ab05d,_0x221eef,_0x3083f0){var _0x37b35e=_0x2ab05d||_0x3083f0;if(_0x37b35e){return handleError(_0x2fbc85,0x191,_0x37b35e);}if(!_0x221eef){return handleError(_0x2fbc85,0x194,{'message':_0xe1f7('0x2c')});}else{var _0x875bb8={'payload':{'id':_0x221eef['id'],'role':_0x221eef[_0xe1f7('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0xe1f7('0x2d')](_0x875bb8)[_0xe1f7('0x19')](function(_0x19ce18){_0x2fbc85['json']({'id':_0x221eef['id'],'token':_0x19ce18,'statusCall':'','isAlreadyLogged':_0x221eef['online']});});}})(_0x2c627d,_0x2fbc85,_0xce2b5c);};passport[_0xe1f7('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0xe1f7('0x23'),'passwordField':'password'},function(_0x4cc496,_0x4aa449,_0x31bf1d){return ActiveDirectoryAuthenticate(db[_0xe1f7('0x2f')],_0x4cc496,_0x4aa449,_0x31bf1d);})); \ No newline at end of file +var _0x2a14=['blockedAt','online','admin','user','agent','then','name','minutes','clearBlockUser','getLicense','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','disabled','blocked'];(function(_0x313ab6,_0x54e0f0){var _0x143804=function(_0x3e66de){while(--_0x3e66de){_0x313ab6['push'](_0x313ab6['shift']());}};_0x143804(++_0x54e0f0);}(_0x2a14,0xc3));var _0x42a1=function(_0x5328ed,_0xad2a30){_0x5328ed=_0x5328ed-0x0;var _0x28308e=_0x2a14[_0x5328ed];return _0x28308e;};'use strict';var passport=require(_0x42a1('0x0'));var LocalStrategy=require(_0x42a1('0x1'))[_0x42a1('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x42a1('0x3'));var BPromise=require(_0x42a1('0x4'));var util=require(_0x42a1('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x42a1('0x6'));var utils=require(_0x42a1('0x7'));var config=require(_0x42a1('0x8'));var logger=require(_0x42a1('0x9'))(_0x42a1('0xa'));function isActiveDirectoryConfigured(_0x37729d){var _0x33895c=![];if(typeof _0x37729d[_0x42a1('0xb')]!==_0x42a1('0xc')){_0x33895c=_0x37729d[_0x42a1('0xb')]['baseDN']&&_0x37729d[_0x42a1('0xb')][_0x42a1('0xd')]&&_0x37729d['activedirectory']['domain'];}return _0x33895c;}function adAuthenticate(_0x518fad,_0x160d47,_0x11b157){return new BPromise(function(_0x458927,_0x2f2a11){try{var _0x462357=new ActiveDirectory(_0x518fad);_0x462357[_0x42a1('0xe')](_0x160d47,_0x11b157,function(_0x23505e,_0x2caa18){if(_0x23505e){logger[_0x42a1('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x160d47,util['inspect'](_0x23505e,{'showHidden':![],'depth':null}));_0x2f2a11('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2caa18){logger[_0x42a1('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x160d47);_0x2f2a11(_0x42a1('0x10'));}else{_0x458927(_0x2caa18);}});}catch(_0x4e164f){_0x2f2a11(_0x4e164f);}});}function ActiveDirectoryAuthenticate(_0x5dd12d,_0x405343,_0x2b60a5,_0x39116f){var _0x1eba4a,_0x2fe2ce;if(!isActiveDirectoryConfigured(config)){logger[_0x42a1('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x405343);return _0x39116f(null,![],{'message':_0x42a1('0x10')});}return db[_0x42a1('0x11')]['findOne']({'where':{'id':0x1},'attributes':[_0x42a1('0x12'),_0x42a1('0x13')],'raw':!![]})['then'](function(_0x1a4835){_0x1eba4a=_0x1a4835;if(!_0x1eba4a[_0x42a1('0x12')]){logger[_0x42a1('0xf')](_0x42a1('0x14'),_0x405343);throw new Error(_0x42a1('0x10'));}return _0x5dd12d[_0x42a1('0x15')]({'attributes':['id','name',_0x42a1('0x16'),'salt','role',_0x42a1('0x17'),_0x42a1('0x18'),_0x42a1('0x19'),_0x42a1('0x1a')],'where':{'name':_0x405343,'role':{'$or':[_0x42a1('0x1b'),_0x42a1('0x1c'),_0x42a1('0x1d')]},'adSsoEnabled':!![]}});})[_0x42a1('0x1e')](function(_0x18c519){if(!_0x18c519||_0x18c519&&_0x18c519[_0x42a1('0x1f')]!==_0x405343){throw new Error(_0x42a1('0x10'));}_0x2fe2ce=_0x18c519;var _0x456fef=_0x2fe2ce['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x42a1('0xb')],_0x456fef,_0x2b60a5);})[_0x42a1('0x1e')](function(_0x574c4e){if(_0x2fe2ce[_0x42a1('0x17')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x1eba4a[_0x42a1('0x13')]>0x0){if(_0x2fe2ce[_0x42a1('0x18')]){if(moment(_0x2fe2ce['blockedAt'])['add'](_0x1eba4a[_0x42a1('0x13')],_0x42a1('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x42a1('0x21')](_0x2fe2ce,0x0,![],null)[_0x42a1('0x1e')](function(){return utils['getLicense'](_0x2fe2ce);})[_0x42a1('0x1e')](function(){return _0x39116f(null,_0x2fe2ce);});}else{return utils[_0x42a1('0x22')](_0x2fe2ce)[_0x42a1('0x1e')](function(){return _0x39116f(null,_0x2fe2ce);});}}else{return utils[_0x42a1('0x22')](_0x2fe2ce)[_0x42a1('0x1e')](function(){return _0x39116f(null,_0x2fe2ce);});}})['catch'](function(_0x440fe1){return _0x39116f(null,![],_0x440fe1);});}function handleError(_0x268c54,_0x3fc38f,_0x41deeb){return _0x268c54['status'](_0x3fc38f||0x1f4)[_0x42a1('0x23')]({'message':_0x41deeb?_0x41deeb[_0x42a1('0x24')]||_0x41deeb:''});}exports[_0x42a1('0x25')]=function(_0x254026,_0x2272ec,_0x650b30){passport[_0x42a1('0xe')](_0x42a1('0x26'),function(_0x4f551a,_0x188d78,_0x159854){var _0x239c0a=_0x4f551a||_0x159854;if(_0x239c0a){return handleError(_0x2272ec,0x191,_0x239c0a);}if(!_0x188d78){return handleError(_0x2272ec,0x194,{'message':_0x42a1('0x27')});}else{var _0x163c77={'payload':{'id':_0x188d78['id'],'role':_0x188d78[_0x42a1('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x42a1('0x29')](_0x163c77)[_0x42a1('0x1e')](function(_0x10d484){_0x2272ec[_0x42a1('0x2a')]({'id':_0x188d78['id'],'token':_0x10d484,'statusCall':'','isAlreadyLogged':_0x188d78['online']});});}})(_0x254026,_0x2272ec,_0x650b30);};passport['use'](_0x42a1('0x26'),new LocalStrategy({'usernameField':_0x42a1('0x1f'),'passwordField':'password'},function(_0x2d269a,_0x5916ef,_0x340000){return ActiveDirectoryAuthenticate(db[_0x42a1('0x2b')],_0x2d269a,_0x5916ef,_0x340000);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 8c985f4..12e56e1 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 _0x975e=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x25e7e9,_0x2bd639){var _0x27a634=function(_0x334c8b){while(--_0x334c8b){_0x25e7e9['push'](_0x25e7e9['shift']());}};_0x27a634(++_0x2bd639);}(_0x975e,0x1cf));var _0xe975=function(_0x13ca76,_0x11dfbd){_0x13ca76=_0x13ca76-0x0;var _0xcc9566=_0x975e[_0x13ca76];return _0xcc9566;};'use strict';var express=require(_0xe975('0x0'));var router=express[_0xe975('0x1')]();var controller=require(_0xe975('0x2'));router[_0xe975('0x3')]('/',controller[_0xe975('0x4')]);module[_0xe975('0x5')]=router; \ No newline at end of file +var _0x1e39=['exports','post','login'];(function(_0xc3293f,_0x3232d4){var _0x2e20c2=function(_0xe4ac45){while(--_0xe4ac45){_0xc3293f['push'](_0xc3293f['shift']());}};_0x2e20c2(++_0x3232d4);}(_0x1e39,0xd0));var _0x91e3=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x1e39[_0x298ed3];return _0x5aad28;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x91e3('0x0')]('/',controller[_0x91e3('0x1')]);module[_0x91e3('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 34b15ef..b9eacf4 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(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x7a54,0x106));var _0x47a5=function(_0x49abc3,_0x2c46c7){_0x49abc3=_0x49abc3-0x0;var _0x1b6f5f=_0x7a54[_0x49abc3];return _0x1b6f5f;};'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(_0x2ee6fa,_0x36de40){var _0x515931=function(_0xfed780){while(--_0xfed780){_0x2ee6fa['push'](_0x2ee6fa['shift']());}};_0x515931(++_0x36de40);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 9fad823..c820cad 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 _0x0793=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports'];(function(_0x2e591e,_0x24a94d){var _0x38d745=function(_0x47ec18){while(--_0x47ec18){_0x2e591e['push'](_0x2e591e['shift']());}};_0x38d745(++_0x24a94d);}(_0x0793,0x1a0));var _0x3079=function(_0x52f0a6,_0xa3c19f){_0x52f0a6=_0x52f0a6-0x0;var _0x2dcee6=_0x0793[_0x52f0a6];return _0x2dcee6;};'use strict';var express=require(_0x3079('0x0'));var passport=require(_0x3079('0x1'));var router=express[_0x3079('0x2')]();var controller=require(_0x3079('0x3'));var userController=require(_0x3079('0x4'));var authService=require(_0x3079('0x5'));router[_0x3079('0x6')]('/',controller['login']);router['get'](_0x3079('0x7'),controller[_0x3079('0x8')],authService[_0x3079('0x9')],userController[_0x3079('0xa')],authService[_0x3079('0xb')]);module[_0x3079('0xc')]=router; \ No newline at end of file +var _0x76e4=['callback','isMiddleware','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get'];(function(_0x40e74b,_0x36f6ec){var _0x3da510=function(_0x2c942e){while(--_0x2c942e){_0x40e74b['push'](_0x40e74b['shift']());}};_0x3da510(++_0x36f6ec);}(_0x76e4,0x12d));var _0x476e=function(_0x9a0c86,_0x37f5df){_0x9a0c86=_0x9a0c86-0x0;var _0x355af8=_0x76e4[_0x9a0c86];return _0x355af8;};'use strict';var express=require(_0x476e('0x0'));var passport=require('passport');var router=express[_0x476e('0x1')]();var controller=require(_0x476e('0x2'));var userController=require(_0x476e('0x3'));var authService=require(_0x476e('0x4'));router['get']('/',controller[_0x476e('0x5')]);router[_0x476e('0x6')]('/callback',controller[_0x476e('0x7')],authService[_0x476e('0x8')],userController[_0x476e('0x5')],authService[_0x476e('0x9')]);module[_0x476e('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index a1532ef..ab5718f 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 _0x1989=['\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','status','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','send','Password\x20reset!','use','util','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x5c28ac,_0x30024d){var _0x157a23=function(_0x240353){while(--_0x240353){_0x5c28ac['push'](_0x5c28ac['shift']());}};_0x157a23(++_0x30024d);}(_0x1989,0x110));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9198('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x9198('0x1')];var jayson=require(_0x9198('0x2'));var _=require(_0x9198('0x3'));var rs=require(_0x9198('0x4'));var moment=require('moment');var db=require(_0x9198('0x5'))['db'];var authService=require(_0x9198('0x6'));var utils=require(_0x9198('0x7'));var client=jayson[_0x9198('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x164ed8,_0x5003f8,_0x13c4f7,_0x3c9511){var _0x4a5745,_0xd28d18;return db[_0x9198('0x9')][_0x9198('0xa')]({'where':{'id':0x1},'attributes':[_0x9198('0xb'),_0x9198('0xc')],'raw':!![]})[_0x9198('0xd')](function(_0x401a07){_0x4a5745=_0x401a07;return _0x164ed8[_0x9198('0xa')]({'attributes':['id',_0x9198('0xe'),_0x9198('0xf'),_0x9198('0x10'),'role','disabled',_0x9198('0x11'),_0x9198('0x12'),_0x9198('0x13')],'where':{'name':_0x5003f8,'role':{'$or':[_0x9198('0x14'),_0x9198('0x15'),_0x9198('0x16')]}}});})['then'](function(_0x2cec87){if(!_0x2cec87||_0x2cec87&&_0x2cec87[_0x9198('0xe')]!==_0x5003f8){throw new Error(_0x9198('0x17'));}else{_0xd28d18=_0x2cec87;return _0xd28d18;}})[_0x9198('0xd')](function(){_0xd28d18[_0x9198('0x18')](_0x13c4f7,function(_0x7ad5a,_0x4aff27){var _0x7bef70=_0xd28d18[_0x9198('0x13')]+0x1;if(_0x7ad5a){return _0x3c9511(_0x7ad5a);}else if(!_0x4aff27){if(_0xd28d18[_0x9198('0x19')]){return _0x3c9511(null,![],{'message':_0x9198('0x17')});}else if(_0x4a5745[_0x9198('0xb')]>0x0){if(_0xd28d18['blocked']){if(_0x4a5745[_0x9198('0xc')]>0x0){if(moment(_0xd28d18[_0x9198('0x12')])[_0x9198('0x1a')](_0x4a5745[_0x9198('0xc')],_0x9198('0x1b'))>moment()){return _0x3c9511(null,![],{'message':_0x9198('0x17')});}else{return utils['clearBlockUser'](_0xd28d18,_0x7bef70,![],null)['then'](function(){return _0x3c9511(null,![],{'message':_0x9198('0x17')});});}}else{return _0x3c9511(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x7bef70>=_0x4a5745[_0x9198('0xb')]){return utils[_0x9198('0x1c')](_0xd28d18,0x0,!![],moment())['then'](function(){return _0x3c9511(null,![],{'message':_0x9198('0x17')});});}else{return utils[_0x9198('0x1c')](_0xd28d18,_0x7bef70,![],null)['then'](function(){return _0x3c9511(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3c9511(null,![],{'message':_0x9198('0x17')});}}else{if(_0xd28d18[_0x9198('0x19')]){return _0x3c9511(null,![],{'message':_0x9198('0x17')});}else if(_0x4a5745[_0x9198('0xb')]>0x0){if(_0xd28d18['blocked']){if(_0x4a5745[_0x9198('0xc')]>0x0){if(moment(_0xd28d18[_0x9198('0x12')])['add'](_0x4a5745[_0x9198('0xc')],_0x9198('0x1b'))>moment()){return _0x3c9511(null,![],{'message':_0x9198('0x17')});}else{return utils['clearBlockUser'](_0xd28d18,0x0,![],null)[_0x9198('0xd')](function(){return utils[_0x9198('0x1d')](_0xd28d18);})[_0x9198('0xd')](function(){return _0x3c9511(null,_0xd28d18);});}}else{return _0x3c9511(null,![],{'message':_0x9198('0x17')});}}else{return utils[_0x9198('0x1c')](_0xd28d18,0x0,![],null)['then'](function(){return utils[_0x9198('0x1d')](_0xd28d18);})[_0x9198('0xd')](function(){return _0x3c9511(null,_0xd28d18);})[_0x9198('0x1e')](function(_0x204b01){return _0x3c9511(null,![],_0x204b01);});}}else{if(_0xd28d18[_0x9198('0x11')]){return _0x3c9511(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0xd28d18)[_0x9198('0xd')](function(){return _0x3c9511(null,_0xd28d18);});}}}});})[_0x9198('0x1e')](function(_0x667152){return _0x3c9511(null,![],_0x667152);});}function sendServiceMail(_0x37f109){return db[_0x9198('0x1f')]['find']({'where':{'service':!![]},'attributes':['id','name',_0x9198('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x9198('0x21'),'include':[{'model':db['CloudProvider'],'as':_0x9198('0x22')}]}]})['then'](function(_0x48f23d){if(!_0x48f23d){throw new Error(_0x9198('0x23'));}var _0x4c717c=_0x48f23d['getSmtpOptions']();var _0x4f5ca9={'account':_0x4c717c,'message':_['merge']({'from':util['format'](_0x9198('0x24'),_0x48f23d[_0x9198('0xe')],_0x48f23d['email']||_0x48f23d['Smtp'][_0x9198('0x15')])},_0x37f109)};return client[_0x9198('0x25')]('SendMail',_0x4f5ca9);})[_0x9198('0xd')](function(_0x4bafdc){if(_0x4bafdc[_0x9198('0x26')]){throw new Error(util[_0x9198('0x27')](_0x9198('0x28'),_0x4bafdc[_0x9198('0x26')][_0x9198('0x29')]||JSON[_0x9198('0x2a')](_0x4bafdc[_0x9198('0x26')])));}return!![];});}function handleError(_0x5c48fa,_0x4c1e13,_0x2c591d){return _0x5c48fa['status'](_0x4c1e13||0x1f4)['send']({'message':_0x2c591d?_0x2c591d[_0x9198('0x29')]||_0x2c591d:''});}exports[_0x9198('0x2b')]=function(_0x442e1b,_0x58ca0d,_0x521a17){passport[_0x9198('0x18')](_0x9198('0x2c'),function(_0x5491ce,_0x37df99,_0x4be4a9){var _0x4885c1=_0x5491ce||_0x4be4a9;if(_0x4885c1){return handleError(_0x58ca0d,0x191,_0x4885c1);}if(!_0x37df99){return handleError(_0x58ca0d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x36bda5={'payload':{'id':_0x37df99['id'],'role':_0x37df99[_0x9198('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0x9198('0x2e')](_0x36bda5)[_0x9198('0xd')](function(_0x1e0fe8){_0x58ca0d['json']({'id':_0x37df99['id'],'token':_0x1e0fe8,'statusCall':'','isAlreadyLogged':_0x37df99[_0x9198('0x2f')]});});}})(_0x442e1b,_0x58ca0d,_0x521a17);};exports[_0x9198('0x30')]=function(_0x15a6d5,_0x1c1468){if(!_0x15a6d5[_0x9198('0x31')][_0x9198('0x20')]){return handleError(_0x1c1468,0x1f4,{'message':_0x9198('0x32')});}var _0x663cb3=rs[_0x9198('0x33')]();_0x15a6d5['body']['email']=_0x15a6d5['body'][_0x9198('0x20')]['trim']()['toLowerCase']();var _0x5185ad;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x9198('0xb'),'blockDuration'],'raw':!![]})[_0x9198('0xd')](function(_0x358e15){_0x5185ad=_0x358e15;return db[_0x9198('0x34')][_0x9198('0x35')]({'where':{'email':_0x15a6d5[_0x9198('0x31')][_0x9198('0x20')]}});})[_0x9198('0xd')](function(_0x3f7e24){if(!_0x3f7e24){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3f7e24['disabled']){throw new Error(_0x9198('0x36'));}if(_0x3f7e24['blocked']){if(moment(_0x3f7e24[_0x9198('0x12')])[_0x9198('0x1a')](_0x5185ad['blockDuration'],'minutes')>moment()){throw new Error(_0x9198('0x37'));}else{_0x3f7e24[_0x9198('0x11')]=![];_0x3f7e24[_0x9198('0x12')]=null;}}_0x3f7e24[_0x9198('0x38')]=_0x663cb3;_0x3f7e24[_0x9198('0x39')]=Date['now']()+0x36ee80;return _0x3f7e24[_0x9198('0x3a')]();})[_0x9198('0xd')](function(){return sendServiceMail({'to':_0x15a6d5[_0x9198('0x31')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x9198('0x3b')+_0x9198('0x3c')+_0x15a6d5[_0x9198('0x3d')][_0x9198('0x3e')]+'/reset/'+_0x663cb3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x9198('0xd')](function(){_0x1c1468[_0x9198('0x3f')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x15a83d){return handleError(_0x1c1468,0x1f4,_0x15a83d);});};exports[_0x9198('0x40')]=function(_0x26e84d,_0x497c80){return db['User']['find']({'where':{'resetPasswordToken':_0x26e84d[_0x9198('0x41')][_0x9198('0x42')],'resetPasswordExpires':{'$gt':Date[_0x9198('0x43')]()}}})[_0x9198('0xd')](function(_0x3ade28){if(!_0x3ade28){throw new Error(_0x9198('0x44'));}return db[_0x9198('0x9')]['findOne']({'attributes':['id',_0x9198('0x45'),_0x9198('0x46'),_0x9198('0x47')]})[_0x9198('0xd')](function(_0x1320a6){if(_0x1320a6[_0x9198('0x45')])authService[_0x9198('0x48')](_0x26e84d['body'][_0x9198('0xf')]);if(!_0x1320a6[_0x9198('0x46')]||!_0x3ade28[_0x9198('0x49')])return _0x3ade28;authService['validatePasswordHistory'](_0x26e84d[_0x9198('0x31')]['password'],_0x3ade28['previousPasswords'],_0x1320a6[_0x9198('0x47')]);return _0x3ade28;})['then'](function(){_0x3ade28['password']=_0x26e84d['body'][_0x9198('0xf')];_0x3ade28[_0x9198('0x38')]=null;_0x3ade28[_0x9198('0x39')]=null;return _0x3ade28[_0x9198('0x3a')]();});})[_0x9198('0xd')](function(){_0x497c80[_0x9198('0x3f')](0xc8)[_0x9198('0x4a')]({'message':_0x9198('0x4b')});})[_0x9198('0x1e')](function(_0x559a1c){return handleError(_0x497c80,0x1f4,_0x559a1c);});};passport[_0x9198('0x4c')](_0x9198('0x2c'),new LocalStrategy({'usernameField':'name','passwordField':_0x9198('0xf')},function(_0xf42a8b,_0x35df84,_0x18d02a){return localAuthenticate(db[_0x9198('0x34')],_0xf42a8b,_0x35df84,_0x18d02a);})); \ No newline at end of file +var _0x4023=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','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','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request'];(function(_0x496046,_0x6d5fd9){var _0x5f3e3b=function(_0x11d815){while(--_0x11d815){_0x496046['push'](_0x496046['shift']());}};_0x5f3e3b(++_0x6d5fd9);}(_0x4023,0x17c));var _0x3402=function(_0x541566,_0x5e8799){_0x541566=_0x541566-0x0;var _0xa99e29=_0x4023[_0x541566];return _0xa99e29;};'use strict';var util=require(_0x3402('0x0'));var passport=require(_0x3402('0x1'));var LocalStrategy=require(_0x3402('0x2'))[_0x3402('0x3')];var jayson=require(_0x3402('0x4'));var _=require('lodash');var rs=require(_0x3402('0x5'));var moment=require(_0x3402('0x6'));var db=require(_0x3402('0x7'))['db'];var authService=require(_0x3402('0x8'));var utils=require(_0x3402('0x9'));var client=jayson[_0x3402('0xa')][_0x3402('0xb')]({'port':0x232b});function localAuthenticate(_0x53824a,_0x1adb9a,_0x1255d4,_0x1122f6){var _0x18d4a3,_0x3780ee;return db[_0x3402('0xc')][_0x3402('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x3402('0xe')],'raw':!![]})['then'](function(_0x1def71){_0x18d4a3=_0x1def71;return _0x53824a['findOne']({'attributes':['id',_0x3402('0xf'),_0x3402('0x10'),'salt',_0x3402('0x11'),_0x3402('0x12'),_0x3402('0x13'),_0x3402('0x14'),_0x3402('0x15')],'where':{'name':_0x1adb9a,'role':{'$or':[_0x3402('0x16'),_0x3402('0x17'),_0x3402('0x18')]}}});})[_0x3402('0x19')](function(_0x4e9e87){if(!_0x4e9e87||_0x4e9e87&&_0x4e9e87[_0x3402('0xf')]!==_0x1adb9a){throw new Error(_0x3402('0x1a'));}else{_0x3780ee=_0x4e9e87;return _0x3780ee;}})[_0x3402('0x19')](function(){_0x3780ee[_0x3402('0x1b')](_0x1255d4,function(_0x5ba7a6,_0xd277d8){var _0x3b58ee=_0x3780ee['loginAttempts']+0x1;if(_0x5ba7a6){return _0x1122f6(_0x5ba7a6);}else if(!_0xd277d8){if(_0x3780ee[_0x3402('0x12')]){return _0x1122f6(null,![],{'message':_0x3402('0x1a')});}else if(_0x18d4a3['allowedLoginAttempts']>0x0){if(_0x3780ee[_0x3402('0x13')]){if(_0x18d4a3['blockDuration']>0x0){if(moment(_0x3780ee[_0x3402('0x14')])[_0x3402('0x1c')](_0x18d4a3['blockDuration'],_0x3402('0x1d'))>moment()){return _0x1122f6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3402('0x1e')](_0x3780ee,_0x3b58ee,![],null)['then'](function(){return _0x1122f6(null,![],{'message':_0x3402('0x1a')});});}}else{return _0x1122f6(null,![],{'message':_0x3402('0x1a')});}}else{if(_0x3b58ee>=_0x18d4a3['allowedLoginAttempts']){return utils[_0x3402('0x1e')](_0x3780ee,0x0,!![],moment())[_0x3402('0x19')](function(){return _0x1122f6(null,![],{'message':_0x3402('0x1a')});});}else{return utils[_0x3402('0x1e')](_0x3780ee,_0x3b58ee,![],null)[_0x3402('0x19')](function(){return _0x1122f6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1122f6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3780ee[_0x3402('0x12')]){return _0x1122f6(null,![],{'message':_0x3402('0x1a')});}else if(_0x18d4a3[_0x3402('0x1f')]>0x0){if(_0x3780ee[_0x3402('0x13')]){if(_0x18d4a3[_0x3402('0xe')]>0x0){if(moment(_0x3780ee[_0x3402('0x14')])[_0x3402('0x1c')](_0x18d4a3[_0x3402('0xe')],'minutes')>moment()){return _0x1122f6(null,![],{'message':_0x3402('0x1a')});}else{return utils[_0x3402('0x1e')](_0x3780ee,0x0,![],null)['then'](function(){return utils[_0x3402('0x20')](_0x3780ee);})['then'](function(){return _0x1122f6(null,_0x3780ee);});}}else{return _0x1122f6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3402('0x1e')](_0x3780ee,0x0,![],null)[_0x3402('0x19')](function(){return utils[_0x3402('0x20')](_0x3780ee);})[_0x3402('0x19')](function(){return _0x1122f6(null,_0x3780ee);})[_0x3402('0x21')](function(_0x6c2baf){return _0x1122f6(null,![],_0x6c2baf);});}}else{if(_0x3780ee[_0x3402('0x13')]){return _0x1122f6(null,![],{'message':_0x3402('0x1a')});}else{return utils['getLicense'](_0x3780ee)[_0x3402('0x19')](function(){return _0x1122f6(null,_0x3780ee);});}}}});})[_0x3402('0x21')](function(_0x4972dc){return _0x1122f6(null,![],_0x4972dc);});}function sendServiceMail(_0x256cfe){return db[_0x3402('0x22')][_0x3402('0x23')]({'where':{'service':!![]},'attributes':['id',_0x3402('0xf'),_0x3402('0x24')],'include':[{'model':db[_0x3402('0x25')],'as':_0x3402('0x26'),'include':[{'model':db[_0x3402('0x27')],'as':_0x3402('0x27')}]}]})[_0x3402('0x19')](function(_0x322931){if(!_0x322931){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4d22e7=_0x322931[_0x3402('0x28')]();var _0x48e7c2={'account':_0x4d22e7,'message':_[_0x3402('0x29')]({'from':util[_0x3402('0x2a')](_0x3402('0x2b'),_0x322931[_0x3402('0xf')],_0x322931[_0x3402('0x24')]||_0x322931[_0x3402('0x26')][_0x3402('0x17')])},_0x256cfe)};return client[_0x3402('0x2c')]('SendMail',_0x48e7c2);})[_0x3402('0x19')](function(_0x2a2132){if(_0x2a2132[_0x3402('0x2d')]){throw new Error(util['format'](_0x3402('0x2e'),_0x2a2132[_0x3402('0x2d')][_0x3402('0x2f')]||JSON['stringify'](_0x2a2132['error'])));}return!![];});}function handleError(_0x2fb3a2,_0x4f3f8e,_0x333b79){return _0x2fb3a2[_0x3402('0x30')](_0x4f3f8e||0x1f4)[_0x3402('0x31')]({'message':_0x333b79?_0x333b79[_0x3402('0x2f')]||_0x333b79:''});}exports[_0x3402('0x32')]=function(_0x389ca9,_0x586bf8,_0x5789a4){passport['authenticate'](_0x3402('0x33'),function(_0x50ecc2,_0x46d25f,_0x2b8642){var _0x3d066d=_0x50ecc2||_0x2b8642;if(_0x3d066d){return handleError(_0x586bf8,0x191,_0x3d066d);}if(!_0x46d25f){return handleError(_0x586bf8,0x194,{'message':_0x3402('0x34')});}else{var _0x51dfcf={'payload':{'id':_0x46d25f['id'],'role':_0x46d25f[_0x3402('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x3402('0x35')](_0x51dfcf)['then'](function(_0x256be9){_0x586bf8[_0x3402('0x36')]({'id':_0x46d25f['id'],'token':_0x256be9,'statusCall':'','isAlreadyLogged':_0x46d25f[_0x3402('0x37')]});});}})(_0x389ca9,_0x586bf8,_0x5789a4);};exports[_0x3402('0x38')]=function(_0x2455dd,_0x23502c){if(!_0x2455dd[_0x3402('0x39')][_0x3402('0x24')]){return handleError(_0x23502c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x56de73=rs[_0x3402('0x3a')]();_0x2455dd[_0x3402('0x39')][_0x3402('0x24')]=_0x2455dd['body'][_0x3402('0x24')][_0x3402('0x3b')]()[_0x3402('0x3c')]();var _0x37bda8;return db['Setting'][_0x3402('0xd')]({'where':{'id':0x1},'attributes':[_0x3402('0x1f'),_0x3402('0xe')],'raw':!![]})[_0x3402('0x19')](function(_0x5ae2e8){_0x37bda8=_0x5ae2e8;return db[_0x3402('0x3d')]['find']({'where':{'email':_0x2455dd[_0x3402('0x39')]['email']}});})[_0x3402('0x19')](function(_0x6417e7){if(!_0x6417e7){throw new Error(_0x3402('0x3e'));}if(_0x6417e7[_0x3402('0x12')]){throw new Error(_0x3402('0x3f'));}if(_0x6417e7[_0x3402('0x13')]){if(moment(_0x6417e7[_0x3402('0x14')])['add'](_0x37bda8[_0x3402('0xe')],_0x3402('0x1d'))>moment()){throw new Error(_0x3402('0x40'));}else{_0x6417e7[_0x3402('0x13')]=![];_0x6417e7['blockedAt']=null;}}_0x6417e7[_0x3402('0x41')]=_0x56de73;_0x6417e7[_0x3402('0x42')]=Date['now']()+0x36ee80;return _0x6417e7[_0x3402('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x2455dd[_0x3402('0x39')][_0x3402('0x24')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3402('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x3402('0x45')+_0x2455dd[_0x3402('0x46')]['host']+_0x3402('0x47')+_0x56de73+'\x0a\x0a'+_0x3402('0x48')});})[_0x3402('0x19')](function(){_0x23502c[_0x3402('0x30')](0xc8)[_0x3402('0x31')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x1a27ed){return handleError(_0x23502c,0x1f4,_0x1a27ed);});};exports[_0x3402('0x49')]=function(_0x269ec8,_0x46349d){return db[_0x3402('0x3d')][_0x3402('0x23')]({'where':{'resetPasswordToken':_0x269ec8[_0x3402('0x4a')][_0x3402('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x3402('0x4c')]()}}})[_0x3402('0x19')](function(_0x5dcd0a){if(!_0x5dcd0a){throw new Error(_0x3402('0x4d'));}return db[_0x3402('0xc')][_0x3402('0xd')]({'attributes':['id',_0x3402('0x4e'),_0x3402('0x4f'),_0x3402('0x50')]})[_0x3402('0x19')](function(_0x3083ba){if(_0x3083ba[_0x3402('0x4e')])authService['validatePasswordPattern'](_0x269ec8[_0x3402('0x39')][_0x3402('0x10')]);if(!_0x3083ba[_0x3402('0x4f')]||!_0x5dcd0a[_0x3402('0x51')])return _0x5dcd0a;authService[_0x3402('0x52')](_0x269ec8['body'][_0x3402('0x10')],_0x5dcd0a[_0x3402('0x51')],_0x3083ba[_0x3402('0x50')]);return _0x5dcd0a;})['then'](function(){_0x5dcd0a[_0x3402('0x10')]=_0x269ec8[_0x3402('0x39')][_0x3402('0x10')];_0x5dcd0a['resetPasswordToken']=null;_0x5dcd0a['resetPasswordExpires']=null;return _0x5dcd0a[_0x3402('0x43')]();});})[_0x3402('0x19')](function(){_0x46349d[_0x3402('0x30')](0xc8)[_0x3402('0x31')]({'message':_0x3402('0x53')});})[_0x3402('0x21')](function(_0x10f7a3){return handleError(_0x46349d,0x1f4,_0x10f7a3);});};passport[_0x3402('0x54')](_0x3402('0x33'),new LocalStrategy({'usernameField':_0x3402('0xf'),'passwordField':'password'},function(_0x3ab5f6,_0x469b32,_0x3bd96f){return localAuthenticate(db[_0x3402('0x3d')],_0x3ab5f6,_0x469b32,_0x3bd96f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4dcb31e..eaa99db 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 _0x92f7=['forgot','post','/reset/:token','reset','Router','./authLocal.controller','/forgot'];(function(_0x440bf4,_0x461a52){var _0x5317e0=function(_0x520dd6){while(--_0x520dd6){_0x440bf4['push'](_0x440bf4['shift']());}};_0x5317e0(++_0x461a52);}(_0x92f7,0x107));var _0x792f=function(_0x3400ca,_0x27c04d){_0x3400ca=_0x3400ca-0x0;var _0x26e8d1=_0x92f7[_0x3400ca];return _0x26e8d1;};'use strict';var express=require('express');var router=express[_0x792f('0x0')]();var controller=require(_0x792f('0x1'));router['post']('/',controller['login']);router['post'](_0x792f('0x2'),controller[_0x792f('0x3')]);router[_0x792f('0x4')](_0x792f('0x5'),controller[_0x792f('0x6')]);module['exports']=router; \ No newline at end of file +var _0xb057=['./authLocal.controller','post','login','/forgot','reset','exports','express'];(function(_0x2a00dd,_0x10da34){var _0x54613f=function(_0x457c2f){while(--_0x457c2f){_0x2a00dd['push'](_0x2a00dd['shift']());}};_0x54613f(++_0x10da34);}(_0xb057,0x6f));var _0x7b05=function(_0x54cdb4,_0xa66fe3){_0x54cdb4=_0x54cdb4-0x0;var _0x1c05aa=_0xb057[_0x54cdb4];return _0x1c05aa;};'use strict';var express=require(_0x7b05('0x0'));var router=express['Router']();var controller=require(_0x7b05('0x1'));router[_0x7b05('0x2')]('/',controller[_0x7b05('0x3')]);router[_0x7b05('0x2')](_0x7b05('0x4'),controller['forgot']);router['post']('/reset/:token',controller[_0x7b05('0x5')]);module[_0x7b05('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 8ebfcac..65f4818 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 _0x1c54=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1af242,_0x5be981){var _0x1023d8=function(_0x2cab3c){while(--_0x2cab3c){_0x1af242['push'](_0x1af242['shift']());}};_0x1023d8(++_0x5be981);}(_0x1c54,0x1bb));var _0x41c5=function(_0x46aa6f,_0xf7b072){_0x46aa6f=_0x46aa6f-0x0;var _0x44759c=_0x1c54[_0x46aa6f];return _0x44759c;};'use strict';var Sequelize=require(_0x41c5('0x0'));module[_0x41c5('0x1')]={'name':{'type':Sequelize[_0x41c5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x41c5('0x2')]},'status':{'type':Sequelize[_0x41c5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xeded=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x5a0a09,_0x407c34){var _0x2a7e3e=function(_0x44482d){while(--_0x44482d){_0x5a0a09['push'](_0x5a0a09['shift']());}};_0x2a7e3e(++_0x407c34);}(_0xeded,0x97));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdede('0x0'));module[_0xdede('0x1')]={'name':{'type':Sequelize[_0xdede('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xdede('0x2')]},'description':{'type':Sequelize[_0xdede('0x2')]},'status':{'type':Sequelize[_0xdede('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xdede('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 3ef2349..af7df04 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 _0xc16a=['params','includeAll','merge','find','catch','create','body','update','addConditions','ids','getConditions','findOne','Condition','Action','addActions','omit','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','then','include','findAll','show'];(function(_0x199a2a,_0x527a17){var _0x2537d4=function(_0x303d66){while(--_0x303d66){_0x199a2a['push'](_0x199a2a['shift']());}};_0x2537d4(++_0x527a17);}(_0xc16a,0xc1));var _0xac16=function(_0x28c0ea,_0x50566a){_0x28c0ea=_0x28c0ea-0x0;var _0x173cb1=_0xc16a[_0x28c0ea];return _0x173cb1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xac16('0x0'));var jsonpatch=require(_0xac16('0x1'));var rp=require(_0xac16('0x2'));var moment=require(_0xac16('0x3'));var BPromise=require(_0xac16('0x4'));var Mustache=require('mustache');var util=require(_0xac16('0x5'));var path=require('path');var sox=require(_0xac16('0x6'));var csv=require(_0xac16('0x7'));var ejs=require(_0xac16('0x8'));var fs=require('fs');var fs_extra=require(_0xac16('0x9'));var _=require(_0xac16('0xa'));var squel=require(_0xac16('0xb'));var crypto=require(_0xac16('0xc'));var jsforce=require(_0xac16('0xd'));var deskjs=require(_0xac16('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac16('0xf'));var Redis=require(_0xac16('0x10'));var authService=require(_0xac16('0x11'));var qs=require(_0xac16('0x12'));var as=require(_0xac16('0x13'));var hardwareService=require(_0xac16('0x14'));var logger=require(_0xac16('0x15'))(_0xac16('0x16'));var utils=require(_0xac16('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xac16('0x18'));var db=require(_0xac16('0x19'))['db'];function respondWithStatusCode(_0x32ddee,_0x4b29dc){_0x4b29dc=_0x4b29dc||0xcc;return function(_0x456872){if(_0x456872){return _0x32ddee[_0xac16('0x1a')](_0x4b29dc);}return _0x32ddee[_0xac16('0x1b')](_0x4b29dc)[_0xac16('0x1c')]();};}function respondWithResult(_0x2b67f4,_0x806767){_0x806767=_0x806767||0xc8;return function(_0x27a694){if(_0x27a694){return _0x2b67f4[_0xac16('0x1b')](_0x806767)[_0xac16('0x1d')](_0x27a694);}};}function respondWithFilteredResult(_0x4e7f9b,_0x2ed032){return function(_0x39584d){if(_0x39584d){var _0x925a66=typeof _0x2ed032[_0xac16('0x1e')]===_0xac16('0x1f')&&typeof _0x2ed032[_0xac16('0x20')]===_0xac16('0x1f');var _0x12add1=_0x39584d[_0xac16('0x21')];var _0x3dad76=_0x925a66?0x0:_0x2ed032[_0xac16('0x1e')];var _0x38a095=_0x925a66?_0x39584d[_0xac16('0x21')]:_0x2ed032['offset']+_0x2ed032[_0xac16('0x20')];var _0x2521bb;if(_0x38a095>=_0x12add1){_0x38a095=_0x12add1;_0x2521bb=0xc8;}else{_0x2521bb=0xce;}_0x4e7f9b[_0xac16('0x1b')](_0x2521bb);return _0x4e7f9b[_0xac16('0x22')](_0xac16('0x23'),_0x3dad76+'-'+_0x38a095+'/'+_0x12add1)[_0xac16('0x1d')](_0x39584d);}return null;};}function patchUpdates(_0x387757){return function(_0xa5547a){try{jsonpatch[_0xac16('0x24')](_0xa5547a,_0x387757,!![]);}catch(_0x4ad037){return BPromise[_0xac16('0x25')](_0x4ad037);}return _0xa5547a[_0xac16('0x26')]();};}function saveUpdates(_0x59381d,_0x4bcd73){return function(_0xb39326){if(_0xb39326){return _0xb39326['update'](_0x59381d)['then'](function(_0x2e617d){return _0x2e617d;});}return null;};}function removeEntity(_0x1cca43,_0x1a44f2){return function(_0x2fecc0){if(_0x2fecc0){return _0x2fecc0[_0xac16('0x27')]()['then'](function(){_0x1cca43[_0xac16('0x1b')](0xcc)[_0xac16('0x1c')]();});}};}function handleEntityNotFound(_0xa16175,_0x3f9dea){return function(_0x34d254){if(!_0x34d254){_0xa16175[_0xac16('0x1a')](0x194);}return _0x34d254;};}function handleError(_0x327edf,_0x4adb6d){_0x4adb6d=_0x4adb6d||0x1f4;return function(_0xe248c4){logger[_0xac16('0x28')](_0xe248c4[_0xac16('0x29')]);if(_0xe248c4['name']){delete _0xe248c4[_0xac16('0x2a')];}_0x327edf[_0xac16('0x1b')](_0x4adb6d)['send'](_0xe248c4);};}exports[_0xac16('0x2b')]=function(_0x401a1e,_0x31f9be){var _0x47496e={},_0x3eeadc={},_0x9257a={'count':0x0,'rows':[]};var _0x19b5dd=_[_0xac16('0x2c')](db[_0xac16('0x2d')][_0xac16('0x2e')],function(_0x575b34){return{'name':_0x575b34[_0xac16('0x2f')],'type':_0x575b34[_0xac16('0x30')][_0xac16('0x31')]};});_0x3eeadc[_0xac16('0x32')]=_['map'](_0x19b5dd,_0xac16('0x2a'));_0x3eeadc[_0xac16('0x33')]=_[_0xac16('0x34')](_0x401a1e[_0xac16('0x33')]);_0x3eeadc[_0xac16('0x35')]=_['intersection'](_0x3eeadc[_0xac16('0x32')],_0x3eeadc[_0xac16('0x33')]);_0x47496e['attributes']=_[_0xac16('0x36')](_0x3eeadc['model'],qs[_0xac16('0x37')](_0x401a1e[_0xac16('0x33')]['fields']));_0x47496e[_0xac16('0x38')]=_0x47496e['attributes'][_0xac16('0x39')]?_0x47496e['attributes']:_0x3eeadc[_0xac16('0x32')];if(!_0x401a1e[_0xac16('0x33')][_0xac16('0x3a')](_0xac16('0x3b'))){_0x47496e[_0xac16('0x20')]=qs[_0xac16('0x20')](_0x401a1e[_0xac16('0x33')]['limit']);_0x47496e['offset']=qs['offset'](_0x401a1e[_0xac16('0x33')][_0xac16('0x1e')]);}_0x47496e[_0xac16('0x3c')]=qs[_0xac16('0x3d')](_0x401a1e[_0xac16('0x33')][_0xac16('0x3d')]);_0x47496e[_0xac16('0x3e')]=qs['filters'](_[_0xac16('0x3f')](_0x401a1e['query'],_0x3eeadc[_0xac16('0x35')]),_0x19b5dd);if(_0x401a1e[_0xac16('0x33')][_0xac16('0x40')]){_0x47496e[_0xac16('0x3e')]=_['merge'](_0x47496e['where'],{'$or':_[_0xac16('0x2c')](_0x19b5dd,function(_0xacc70c){if(_0xacc70c[_0xac16('0x30')]!==_0xac16('0x41')){var _0x191ba4={};_0x191ba4[_0xacc70c[_0xac16('0x2a')]]={'$like':'%'+_0x401a1e[_0xac16('0x33')]['filter']+'%'};return _0x191ba4;}})});}_0x47496e=_['merge']({},_0x47496e,_0x401a1e[_0xac16('0x42')]);var _0x4792fb={'where':_0x47496e['where']};return db[_0xac16('0x2d')][_0xac16('0x21')](_0x4792fb)[_0xac16('0x43')](function(_0x576aa6){_0x9257a[_0xac16('0x21')]=_0x576aa6;if(_0x401a1e[_0xac16('0x33')]['includeAll']){_0x47496e[_0xac16('0x44')]=[{'all':!![]}];}return db['Automation'][_0xac16('0x45')](_0x47496e);})['then'](function(_0x1eb06d){_0x9257a['rows']=_0x1eb06d;return _0x9257a;})['then'](respondWithFilteredResult(_0x31f9be,_0x47496e))['catch'](handleError(_0x31f9be,null));};exports[_0xac16('0x46')]=function(_0x286d60,_0x2425fd){var _0x2119bb={'raw':![],'where':{'id':_0x286d60[_0xac16('0x47')]['id']}},_0x249400={};_0x249400[_0xac16('0x32')]=_[_0xac16('0x34')](db[_0xac16('0x2d')][_0xac16('0x2e')]);_0x249400[_0xac16('0x33')]=_[_0xac16('0x34')](_0x286d60['query']);_0x249400[_0xac16('0x35')]=_[_0xac16('0x36')](_0x249400[_0xac16('0x32')],_0x249400[_0xac16('0x33')]);_0x2119bb[_0xac16('0x38')]=_[_0xac16('0x36')](_0x249400['model'],qs[_0xac16('0x37')](_0x286d60[_0xac16('0x33')]['fields']));_0x2119bb[_0xac16('0x38')]=_0x2119bb[_0xac16('0x38')]['length']?_0x2119bb[_0xac16('0x38')]:_0x249400[_0xac16('0x32')];if(_0x286d60[_0xac16('0x33')][_0xac16('0x48')]){_0x2119bb['include']=[{'all':!![]}];}_0x2119bb=_[_0xac16('0x49')]({},_0x2119bb,_0x286d60[_0xac16('0x42')]);return db['Automation'][_0xac16('0x4a')](_0x2119bb)['then'](handleEntityNotFound(_0x2425fd,null))[_0xac16('0x43')](respondWithResult(_0x2425fd,null))[_0xac16('0x4b')](handleError(_0x2425fd,null));};exports[_0xac16('0x4c')]=function(_0x3db955,_0x14b7cb){return db[_0xac16('0x2d')]['create'](_0x3db955[_0xac16('0x4d')],{})[_0xac16('0x43')](respondWithResult(_0x14b7cb,0xc9))[_0xac16('0x4b')](handleError(_0x14b7cb,null));};exports[_0xac16('0x4e')]=function(_0x5a7260,_0x34dae0){if(_0x5a7260['body']['id']){delete _0x5a7260[_0xac16('0x4d')]['id'];}return db[_0xac16('0x2d')][_0xac16('0x4a')]({'where':{'id':_0x5a7260['params']['id']}})[_0xac16('0x43')](handleEntityNotFound(_0x34dae0,null))[_0xac16('0x43')](saveUpdates(_0x5a7260[_0xac16('0x4d')],null))[_0xac16('0x43')](respondWithResult(_0x34dae0,null))[_0xac16('0x4b')](handleError(_0x34dae0,null));};exports['destroy']=function(_0x4034d6,_0x23cbf2){return db[_0xac16('0x2d')][_0xac16('0x4a')]({'where':{'id':_0x4034d6['params']['id']}})[_0xac16('0x43')](handleEntityNotFound(_0x23cbf2,null))[_0xac16('0x43')](removeEntity(_0x23cbf2,null))[_0xac16('0x4b')](handleError(_0x23cbf2,null));};exports[_0xac16('0x4f')]=function(_0x392975,_0xdb3c12,_0x3083c2){return db['Condition']['find']({'where':{'id':_0x392975['params']['id']}})[_0xac16('0x43')](handleEntityNotFound(_0xdb3c12,null))[_0xac16('0x43')](function(_0x5c811c){if(_0x5c811c){return _0x5c811c[_0xac16('0x4f')](_0x392975[_0xac16('0x4d')]['ids'],_['omit'](_0x392975['body'],[_0xac16('0x50'),'id'])||{});}})['then'](respondWithResult(_0xdb3c12,null))[_0xac16('0x4b')](handleError(_0xdb3c12,null));};exports[_0xac16('0x51')]=function(_0x59b474,_0x46097c,_0x4a6ede){var _0x49d896={};var _0x2c398a={};var _0x43bbfe;var _0x4aa77a;return db[_0xac16('0x2d')][_0xac16('0x52')]({'where':{'id':_0x59b474['params']['id']}})['then'](handleEntityNotFound(_0x46097c,null))[_0xac16('0x43')](function(_0x57c003){if(_0x57c003){_0x43bbfe=_0x57c003;_0x2c398a[_0xac16('0x32')]=_[_0xac16('0x34')](db[_0xac16('0x53')][_0xac16('0x2e')]);_0x2c398a[_0xac16('0x33')]=_['keys'](_0x59b474[_0xac16('0x33')]);_0x2c398a[_0xac16('0x35')]=_[_0xac16('0x36')](_0x2c398a[_0xac16('0x32')],_0x2c398a['query']);_0x49d896[_0xac16('0x38')]=_[_0xac16('0x36')](_0x2c398a[_0xac16('0x32')],qs[_0xac16('0x37')](_0x59b474['query'][_0xac16('0x37')]));_0x49d896[_0xac16('0x38')]=_0x49d896[_0xac16('0x38')][_0xac16('0x39')]?_0x49d896[_0xac16('0x38')]:_0x2c398a[_0xac16('0x32')];_0x49d896[_0xac16('0x3c')]=qs['sort'](_0x59b474[_0xac16('0x33')]['sort']);_0x49d896[_0xac16('0x3e')]=qs['filters'](_[_0xac16('0x3f')](_0x59b474[_0xac16('0x33')],_0x2c398a[_0xac16('0x35')]));if(_0x59b474[_0xac16('0x33')]['filter']){_0x49d896[_0xac16('0x3e')]=_[_0xac16('0x49')](_0x49d896['where'],{'$or':_[_0xac16('0x2c')](_0x49d896[_0xac16('0x38')],function(_0x3d6166){var _0x597937={};_0x597937[_0x3d6166]={'$like':'%'+_0x59b474[_0xac16('0x33')][_0xac16('0x40')]+'%'};return _0x597937;})});}_0x49d896=_[_0xac16('0x49')]({},_0x49d896,_0x59b474[_0xac16('0x42')]);return _0x43bbfe[_0xac16('0x51')](_0x49d896);}})[_0xac16('0x43')](function(_0x22efbc){if(_0x22efbc){_0x4aa77a=_0x22efbc['length'];if(!_0x59b474['query']['hasOwnProperty'](_0xac16('0x3b'))){_0x49d896[_0xac16('0x20')]=qs[_0xac16('0x20')](_0x59b474[_0xac16('0x33')][_0xac16('0x20')]);_0x49d896[_0xac16('0x1e')]=qs['offset'](_0x59b474['query'][_0xac16('0x1e')]);}return _0x43bbfe[_0xac16('0x51')](_0x49d896);}})['then'](function(_0x2184b8){if(_0x2184b8){return _0x2184b8?{'count':_0x4aa77a,'rows':_0x2184b8}:null;}})['then'](respondWithResult(_0x46097c,null))['catch'](handleError(_0x46097c,null));};exports['addActions']=function(_0x1befa7,_0x8c1d7c,_0x2d6063){return db[_0xac16('0x54')][_0xac16('0x4a')]({'where':{'id':_0x1befa7[_0xac16('0x47')]['id']}})[_0xac16('0x43')](handleEntityNotFound(_0x8c1d7c,null))[_0xac16('0x43')](function(_0x56feaa){if(_0x56feaa){return _0x56feaa[_0xac16('0x55')](_0x1befa7['body'][_0xac16('0x50')],_[_0xac16('0x56')](_0x1befa7[_0xac16('0x4d')],[_0xac16('0x50'),'id'])||{});}})[_0xac16('0x43')](respondWithResult(_0x8c1d7c,null))[_0xac16('0x4b')](handleError(_0x8c1d7c,null));};exports['getActions']=function(_0x47276c,_0x51b714,_0xa37dde){var _0x3a0480={};var _0xfef942={};var _0x26d31f;var _0x376aa4;return db[_0xac16('0x2d')][_0xac16('0x52')]({'where':{'id':_0x47276c[_0xac16('0x47')]['id']}})['then'](handleEntityNotFound(_0x51b714,null))['then'](function(_0x8a47d5){if(_0x8a47d5){_0x26d31f=_0x8a47d5;_0xfef942[_0xac16('0x32')]=_[_0xac16('0x34')](db[_0xac16('0x54')][_0xac16('0x2e')]);_0xfef942['query']=_[_0xac16('0x34')](_0x47276c[_0xac16('0x33')]);_0xfef942[_0xac16('0x35')]=_['intersection'](_0xfef942[_0xac16('0x32')],_0xfef942[_0xac16('0x33')]);_0x3a0480['attributes']=_[_0xac16('0x36')](_0xfef942[_0xac16('0x32')],qs['fields'](_0x47276c[_0xac16('0x33')]['fields']));_0x3a0480[_0xac16('0x38')]=_0x3a0480[_0xac16('0x38')][_0xac16('0x39')]?_0x3a0480[_0xac16('0x38')]:_0xfef942[_0xac16('0x32')];_0x3a0480[_0xac16('0x3c')]=qs[_0xac16('0x3d')](_0x47276c[_0xac16('0x33')][_0xac16('0x3d')]);_0x3a0480[_0xac16('0x3e')]=qs['filters'](_[_0xac16('0x3f')](_0x47276c[_0xac16('0x33')],_0xfef942['filters']));if(_0x47276c[_0xac16('0x33')][_0xac16('0x40')]){_0x3a0480[_0xac16('0x3e')]=_[_0xac16('0x49')](_0x3a0480[_0xac16('0x3e')],{'$or':_[_0xac16('0x2c')](_0x3a0480['attributes'],function(_0x4e8ef4){var _0x3d9424={};_0x3d9424[_0x4e8ef4]={'$like':'%'+_0x47276c[_0xac16('0x33')]['filter']+'%'};return _0x3d9424;})});}_0x3a0480=_['merge']({},_0x3a0480,_0x47276c[_0xac16('0x42')]);return _0x26d31f[_0xac16('0x57')](_0x3a0480);}})[_0xac16('0x43')](function(_0x1f72bb){if(_0x1f72bb){_0x376aa4=_0x1f72bb[_0xac16('0x39')];if(!_0x47276c[_0xac16('0x33')]['hasOwnProperty'](_0xac16('0x3b'))){_0x3a0480[_0xac16('0x20')]=qs[_0xac16('0x20')](_0x47276c['query']['limit']);_0x3a0480[_0xac16('0x1e')]=qs['offset'](_0x47276c[_0xac16('0x33')][_0xac16('0x1e')]);}return _0x26d31f[_0xac16('0x57')](_0x3a0480);}})['then'](function(_0x4159f4){if(_0x4159f4){return _0x4159f4?{'count':_0x376aa4,'rows':_0x4159f4}:null;}})[_0xac16('0x43')](respondWithResult(_0x51b714,null))[_0xac16('0x4b')](handleError(_0x51b714,null));}; \ No newline at end of file +var _0x8710=['map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','VIRTUAL','filter','merge','options','include','rows','catch','show','params','Automation','rawAttributes','includeAll','find','create','body','destroy','addConditions','ids','omit','getConditions','findOne','Condition','order','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','save','update','then','end','stack','name','send','fieldName','type','key'];(function(_0x120ab8,_0x4565ad){var _0x1cc203=function(_0x427657){while(--_0x427657){_0x120ab8['push'](_0x120ab8['shift']());}};_0x1cc203(++_0x4565ad);}(_0x8710,0x123));var _0x0871=function(_0x17df21,_0x278a55){_0x17df21=_0x17df21-0x0;var _0x211ccc=_0x8710[_0x17df21];return _0x211ccc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0871('0x0'));var zipdir=require(_0x0871('0x1'));var jsonpatch=require(_0x0871('0x2'));var rp=require(_0x0871('0x3'));var moment=require(_0x0871('0x4'));var BPromise=require(_0x0871('0x5'));var Mustache=require(_0x0871('0x6'));var util=require('util');var path=require(_0x0871('0x7'));var sox=require(_0x0871('0x8'));var csv=require(_0x0871('0x9'));var ejs=require(_0x0871('0xa'));var fs=require('fs');var fs_extra=require(_0x0871('0xb'));var _=require(_0x0871('0xc'));var squel=require(_0x0871('0xd'));var crypto=require(_0x0871('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0871('0xf'));var toCsv=require(_0x0871('0x9'));var querystring=require(_0x0871('0x10'));var Papa=require(_0x0871('0x11'));var Redis=require(_0x0871('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0871('0x13'));var as=require(_0x0871('0x14'));var hardwareService=require(_0x0871('0x15'));var logger=require(_0x0871('0x16'))('api');var utils=require(_0x0871('0x17'));var config=require(_0x0871('0x18'));var licenseUtil=require(_0x0871('0x19'));var db=require(_0x0871('0x1a'))['db'];function respondWithStatusCode(_0x6e0fd8,_0x5c89fc){_0x5c89fc=_0x5c89fc||0xcc;return function(_0x436eaa){if(_0x436eaa){return _0x6e0fd8[_0x0871('0x1b')](_0x5c89fc);}return _0x6e0fd8[_0x0871('0x1c')](_0x5c89fc)['end']();};}function respondWithResult(_0x20a431,_0xd71192){_0xd71192=_0xd71192||0xc8;return function(_0x15c90f){if(_0x15c90f){return _0x20a431[_0x0871('0x1c')](_0xd71192)['json'](_0x15c90f);}};}function respondWithFilteredResult(_0x1bacaf,_0x1d940d){return function(_0x584df6){if(_0x584df6){var _0x5af2dd=typeof _0x1d940d[_0x0871('0x1d')]==='undefined'&&typeof _0x1d940d[_0x0871('0x1e')]===_0x0871('0x1f');var _0x334a20=_0x584df6[_0x0871('0x20')];var _0x293615=_0x5af2dd?0x0:_0x1d940d['offset'];var _0x5dd728=_0x5af2dd?_0x584df6[_0x0871('0x20')]:_0x1d940d[_0x0871('0x1d')]+_0x1d940d['limit'];var _0x508079;if(_0x5dd728>=_0x334a20){_0x5dd728=_0x334a20;_0x508079=0xc8;}else{_0x508079=0xce;}_0x1bacaf[_0x0871('0x1c')](_0x508079);return _0x1bacaf['set'](_0x0871('0x21'),_0x293615+'-'+_0x5dd728+'/'+_0x334a20)['json'](_0x584df6);}return null;};}function patchUpdates(_0x5b402b){return function(_0x2e2590){try{jsonpatch[_0x0871('0x22')](_0x2e2590,_0x5b402b,!![]);}catch(_0x10fdd0){return BPromise['reject'](_0x10fdd0);}return _0x2e2590[_0x0871('0x23')]();};}function saveUpdates(_0x1dfad3,_0x1160dc){return function(_0x3b6f85){if(_0x3b6f85){return _0x3b6f85[_0x0871('0x24')](_0x1dfad3)[_0x0871('0x25')](function(_0x87636c){return _0x87636c;});}return null;};}function removeEntity(_0x54c865,_0x2ffe5d){return function(_0x171e94){if(_0x171e94){return _0x171e94['destroy']()['then'](function(){_0x54c865[_0x0871('0x1c')](0xcc)[_0x0871('0x26')]();});}};}function handleEntityNotFound(_0x502351,_0x2e7be3){return function(_0x18596d){if(!_0x18596d){_0x502351[_0x0871('0x1b')](0x194);}return _0x18596d;};}function handleError(_0x36d57b,_0x2ce418){_0x2ce418=_0x2ce418||0x1f4;return function(_0x2ce590){logger['error'](_0x2ce590[_0x0871('0x27')]);if(_0x2ce590[_0x0871('0x28')]){delete _0x2ce590[_0x0871('0x28')];}_0x36d57b[_0x0871('0x1c')](_0x2ce418)[_0x0871('0x29')](_0x2ce590);};}exports['index']=function(_0x3b41df,_0x1e420c){var _0x168492={},_0x336ab4={},_0x444384={'count':0x0,'rows':[]};var _0x4c28cb=_['map'](db['Automation']['rawAttributes'],function(_0x5b1aa4){return{'name':_0x5b1aa4[_0x0871('0x2a')],'type':_0x5b1aa4[_0x0871('0x2b')][_0x0871('0x2c')]};});_0x336ab4['model']=_[_0x0871('0x2d')](_0x4c28cb,_0x0871('0x28'));_0x336ab4[_0x0871('0x2e')]=_[_0x0871('0x2f')](_0x3b41df[_0x0871('0x2e')]);_0x336ab4['filters']=_[_0x0871('0x30')](_0x336ab4['model'],_0x336ab4[_0x0871('0x2e')]);_0x168492[_0x0871('0x31')]=_[_0x0871('0x30')](_0x336ab4[_0x0871('0x32')],qs[_0x0871('0x33')](_0x3b41df['query']['fields']));_0x168492[_0x0871('0x31')]=_0x168492['attributes'][_0x0871('0x34')]?_0x168492['attributes']:_0x336ab4[_0x0871('0x32')];if(!_0x3b41df[_0x0871('0x2e')][_0x0871('0x35')](_0x0871('0x36'))){_0x168492[_0x0871('0x1e')]=qs['limit'](_0x3b41df[_0x0871('0x2e')]['limit']);_0x168492[_0x0871('0x1d')]=qs['offset'](_0x3b41df[_0x0871('0x2e')]['offset']);}_0x168492['order']=qs[_0x0871('0x37')](_0x3b41df['query'][_0x0871('0x37')]);_0x168492['where']=qs[_0x0871('0x38')](_[_0x0871('0x39')](_0x3b41df[_0x0871('0x2e')],_0x336ab4[_0x0871('0x38')]),_0x4c28cb);if(_0x3b41df[_0x0871('0x2e')]['filter']){_0x168492[_0x0871('0x3a')]=_['merge'](_0x168492[_0x0871('0x3a')],{'$or':_[_0x0871('0x2d')](_0x4c28cb,function(_0x49ae39){if(_0x49ae39[_0x0871('0x2b')]!==_0x0871('0x3b')){var _0x2c1057={};_0x2c1057[_0x49ae39[_0x0871('0x28')]]={'$like':'%'+_0x3b41df[_0x0871('0x2e')][_0x0871('0x3c')]+'%'};return _0x2c1057;}})});}_0x168492=_[_0x0871('0x3d')]({},_0x168492,_0x3b41df[_0x0871('0x3e')]);var _0x2d135b={'where':_0x168492['where']};return db['Automation'][_0x0871('0x20')](_0x2d135b)['then'](function(_0x1c7380){_0x444384[_0x0871('0x20')]=_0x1c7380;if(_0x3b41df[_0x0871('0x2e')]['includeAll']){_0x168492[_0x0871('0x3f')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x168492);})['then'](function(_0x27961a){_0x444384[_0x0871('0x40')]=_0x27961a;return _0x444384;})['then'](respondWithFilteredResult(_0x1e420c,_0x168492))[_0x0871('0x41')](handleError(_0x1e420c,null));};exports[_0x0871('0x42')]=function(_0x2252e5,_0x112255){var _0x5dcf84={'raw':![],'where':{'id':_0x2252e5[_0x0871('0x43')]['id']}},_0x241197={};_0x241197[_0x0871('0x32')]=_[_0x0871('0x2f')](db[_0x0871('0x44')][_0x0871('0x45')]);_0x241197[_0x0871('0x2e')]=_[_0x0871('0x2f')](_0x2252e5[_0x0871('0x2e')]);_0x241197[_0x0871('0x38')]=_['intersection'](_0x241197['model'],_0x241197[_0x0871('0x2e')]);_0x5dcf84[_0x0871('0x31')]=_[_0x0871('0x30')](_0x241197[_0x0871('0x32')],qs[_0x0871('0x33')](_0x2252e5['query'][_0x0871('0x33')]));_0x5dcf84[_0x0871('0x31')]=_0x5dcf84[_0x0871('0x31')][_0x0871('0x34')]?_0x5dcf84[_0x0871('0x31')]:_0x241197[_0x0871('0x32')];if(_0x2252e5['query'][_0x0871('0x46')]){_0x5dcf84[_0x0871('0x3f')]=[{'all':!![]}];}_0x5dcf84=_[_0x0871('0x3d')]({},_0x5dcf84,_0x2252e5[_0x0871('0x3e')]);return db[_0x0871('0x44')][_0x0871('0x47')](_0x5dcf84)[_0x0871('0x25')](handleEntityNotFound(_0x112255,null))[_0x0871('0x25')](respondWithResult(_0x112255,null))[_0x0871('0x41')](handleError(_0x112255,null));};exports[_0x0871('0x48')]=function(_0x4cb353,_0xce4273){return db[_0x0871('0x44')]['create'](_0x4cb353[_0x0871('0x49')],{})[_0x0871('0x25')](respondWithResult(_0xce4273,0xc9))[_0x0871('0x41')](handleError(_0xce4273,null));};exports[_0x0871('0x24')]=function(_0x3c57ee,_0x5c8f49){if(_0x3c57ee['body']['id']){delete _0x3c57ee[_0x0871('0x49')]['id'];}return db['Automation'][_0x0871('0x47')]({'where':{'id':_0x3c57ee['params']['id']}})[_0x0871('0x25')](handleEntityNotFound(_0x5c8f49,null))['then'](saveUpdates(_0x3c57ee[_0x0871('0x49')],null))[_0x0871('0x25')](respondWithResult(_0x5c8f49,null))[_0x0871('0x41')](handleError(_0x5c8f49,null));};exports[_0x0871('0x4a')]=function(_0x4dc4a0,_0x1f06ba){return db['Automation'][_0x0871('0x47')]({'where':{'id':_0x4dc4a0[_0x0871('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f06ba,null))[_0x0871('0x25')](removeEntity(_0x1f06ba,null))[_0x0871('0x41')](handleError(_0x1f06ba,null));};exports[_0x0871('0x4b')]=function(_0x1e96bf,_0x585746,_0x16cc46){return db['Condition'][_0x0871('0x47')]({'where':{'id':_0x1e96bf[_0x0871('0x43')]['id']}})[_0x0871('0x25')](handleEntityNotFound(_0x585746,null))[_0x0871('0x25')](function(_0x5cdc90){if(_0x5cdc90){return _0x5cdc90[_0x0871('0x4b')](_0x1e96bf[_0x0871('0x49')][_0x0871('0x4c')],_[_0x0871('0x4d')](_0x1e96bf[_0x0871('0x49')],[_0x0871('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x585746,null))[_0x0871('0x41')](handleError(_0x585746,null));};exports[_0x0871('0x4e')]=function(_0x3b4f9f,_0x2d2d03,_0x204982){var _0x327bc3={};var _0x50bf90={};var _0x180db8;var _0x3b3a9b;return db['Automation'][_0x0871('0x4f')]({'where':{'id':_0x3b4f9f['params']['id']}})['then'](handleEntityNotFound(_0x2d2d03,null))[_0x0871('0x25')](function(_0x504348){if(_0x504348){_0x180db8=_0x504348;_0x50bf90[_0x0871('0x32')]=_[_0x0871('0x2f')](db[_0x0871('0x50')][_0x0871('0x45')]);_0x50bf90['query']=_['keys'](_0x3b4f9f[_0x0871('0x2e')]);_0x50bf90['filters']=_['intersection'](_0x50bf90[_0x0871('0x32')],_0x50bf90[_0x0871('0x2e')]);_0x327bc3[_0x0871('0x31')]=_['intersection'](_0x50bf90[_0x0871('0x32')],qs[_0x0871('0x33')](_0x3b4f9f[_0x0871('0x2e')]['fields']));_0x327bc3['attributes']=_0x327bc3['attributes'][_0x0871('0x34')]?_0x327bc3[_0x0871('0x31')]:_0x50bf90[_0x0871('0x32')];_0x327bc3[_0x0871('0x51')]=qs[_0x0871('0x37')](_0x3b4f9f[_0x0871('0x2e')][_0x0871('0x37')]);_0x327bc3[_0x0871('0x3a')]=qs[_0x0871('0x38')](_['pick'](_0x3b4f9f[_0x0871('0x2e')],_0x50bf90['filters']));if(_0x3b4f9f[_0x0871('0x2e')][_0x0871('0x3c')]){_0x327bc3[_0x0871('0x3a')]=_['merge'](_0x327bc3[_0x0871('0x3a')],{'$or':_['map'](_0x327bc3['attributes'],function(_0x2925c7){var _0x119314={};_0x119314[_0x2925c7]={'$like':'%'+_0x3b4f9f[_0x0871('0x2e')]['filter']+'%'};return _0x119314;})});}_0x327bc3=_['merge']({},_0x327bc3,_0x3b4f9f[_0x0871('0x3e')]);return _0x180db8[_0x0871('0x4e')](_0x327bc3);}})['then'](function(_0x2f963f){if(_0x2f963f){_0x3b3a9b=_0x2f963f[_0x0871('0x34')];if(!_0x3b4f9f[_0x0871('0x2e')][_0x0871('0x35')](_0x0871('0x36'))){_0x327bc3['limit']=qs[_0x0871('0x1e')](_0x3b4f9f['query'][_0x0871('0x1e')]);_0x327bc3['offset']=qs[_0x0871('0x1d')](_0x3b4f9f['query'][_0x0871('0x1d')]);}return _0x180db8['getConditions'](_0x327bc3);}})['then'](function(_0x12b34d){if(_0x12b34d){return _0x12b34d?{'count':_0x3b3a9b,'rows':_0x12b34d}:null;}})[_0x0871('0x25')](respondWithResult(_0x2d2d03,null))[_0x0871('0x41')](handleError(_0x2d2d03,null));};exports['addActions']=function(_0x3f94f1,_0x11de5a,_0x3d3c2b){return db[_0x0871('0x52')]['find']({'where':{'id':_0x3f94f1[_0x0871('0x43')]['id']}})[_0x0871('0x25')](handleEntityNotFound(_0x11de5a,null))[_0x0871('0x25')](function(_0x388f39){if(_0x388f39){return _0x388f39['addActions'](_0x3f94f1[_0x0871('0x49')][_0x0871('0x4c')],_[_0x0871('0x4d')](_0x3f94f1[_0x0871('0x49')],[_0x0871('0x4c'),'id'])||{});}})[_0x0871('0x25')](respondWithResult(_0x11de5a,null))[_0x0871('0x41')](handleError(_0x11de5a,null));};exports[_0x0871('0x53')]=function(_0x182a32,_0x3c5999,_0x495b0e){var _0x57a79e={};var _0x917235={};var _0x5d7dbf;var _0x94feb0;return db[_0x0871('0x44')][_0x0871('0x4f')]({'where':{'id':_0x182a32['params']['id']}})[_0x0871('0x25')](handleEntityNotFound(_0x3c5999,null))['then'](function(_0x40dfc1){if(_0x40dfc1){_0x5d7dbf=_0x40dfc1;_0x917235[_0x0871('0x32')]=_[_0x0871('0x2f')](db[_0x0871('0x52')][_0x0871('0x45')]);_0x917235[_0x0871('0x2e')]=_[_0x0871('0x2f')](_0x182a32[_0x0871('0x2e')]);_0x917235[_0x0871('0x38')]=_['intersection'](_0x917235[_0x0871('0x32')],_0x917235[_0x0871('0x2e')]);_0x57a79e[_0x0871('0x31')]=_[_0x0871('0x30')](_0x917235[_0x0871('0x32')],qs[_0x0871('0x33')](_0x182a32[_0x0871('0x2e')]['fields']));_0x57a79e[_0x0871('0x31')]=_0x57a79e[_0x0871('0x31')][_0x0871('0x34')]?_0x57a79e[_0x0871('0x31')]:_0x917235['model'];_0x57a79e[_0x0871('0x51')]=qs['sort'](_0x182a32[_0x0871('0x2e')][_0x0871('0x37')]);_0x57a79e[_0x0871('0x3a')]=qs[_0x0871('0x38')](_['pick'](_0x182a32[_0x0871('0x2e')],_0x917235[_0x0871('0x38')]));if(_0x182a32[_0x0871('0x2e')][_0x0871('0x3c')]){_0x57a79e[_0x0871('0x3a')]=_[_0x0871('0x3d')](_0x57a79e['where'],{'$or':_['map'](_0x57a79e[_0x0871('0x31')],function(_0xd586f8){var _0x2ca521={};_0x2ca521[_0xd586f8]={'$like':'%'+_0x182a32[_0x0871('0x2e')]['filter']+'%'};return _0x2ca521;})});}_0x57a79e=_['merge']({},_0x57a79e,_0x182a32['options']);return _0x5d7dbf[_0x0871('0x53')](_0x57a79e);}})[_0x0871('0x25')](function(_0x1e3692){if(_0x1e3692){_0x94feb0=_0x1e3692['length'];if(!_0x182a32[_0x0871('0x2e')][_0x0871('0x35')](_0x0871('0x36'))){_0x57a79e[_0x0871('0x1e')]=qs['limit'](_0x182a32[_0x0871('0x2e')][_0x0871('0x1e')]);_0x57a79e[_0x0871('0x1d')]=qs['offset'](_0x182a32[_0x0871('0x2e')][_0x0871('0x1d')]);}return _0x5d7dbf[_0x0871('0x53')](_0x57a79e);}})[_0x0871('0x25')](function(_0x25b462){if(_0x25b462){return _0x25b462?{'count':_0x94feb0,'rows':_0x25b462}:null;}})[_0x0871('0x25')](respondWithResult(_0x3c5999,null))[_0x0871('0x41')](handleError(_0x3c5999,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 17998db..9a279d7 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 _0xc738=['./automation.attributes','exports','define','tools_automations','lodash','util','api','request-promise','path','rimraf'];(function(_0x200058,_0xb3c07){var _0x3032c2=function(_0x22f858){while(--_0x22f858){_0x200058['push'](_0x200058['shift']());}};_0x3032c2(++_0xb3c07);}(_0xc738,0xb8));var _0x8c73=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xc738[_0x133277];return _0x5b4a22;};'use strict';var _=require(_0x8c73('0x0'));var util=require(_0x8c73('0x1'));var logger=require('../../config/logger')(_0x8c73('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8c73('0x3'));var fs=require('fs');var path=require(_0x8c73('0x4'));var rimraf=require(_0x8c73('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c73('0x6'));module[_0x8c73('0x7')]=function(_0x4d035a,_0x25c397){return _0x4d035a[_0x8c73('0x8')]('Automation',attributes,{'tableName':_0x8c73('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcfa=['exports','define','Automation','tools_automations','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x406a91,_0x53b45e){var _0x3d9a12=function(_0x3fb75d){while(--_0x3fb75d){_0x406a91['push'](_0x406a91['shift']());}};_0x3d9a12(++_0x53b45e);}(_0xbcfa,0x64));var _0xabcf=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbcfa[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xabcf('0x0'))('api');var moment=require(_0xabcf('0x1'));var BPromise=require(_0xabcf('0x2'));var rp=require(_0xabcf('0x3'));var fs=require('fs');var path=require(_0xabcf('0x4'));var rimraf=require(_0xabcf('0x5'));var config=require(_0xabcf('0x6'));var attributes=require(_0xabcf('0x7'));module[_0xabcf('0x8')]=function(_0x2bdb10,_0xe94cb2){return _0x2bdb10[_0xabcf('0x9')](_0xabcf('0xa'),attributes,{'tableName':_0xabcf('0xb'),'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 bfbbe46..bbf24cb 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 _0x9123=['lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch'];(function(_0x15f13d,_0x51795d){var _0x206d0c=function(_0x493450){while(--_0x493450){_0x15f13d['push'](_0x15f13d['shift']());}};_0x206d0c(++_0x51795d);}(_0x9123,0x140));var _0x3912=function(_0x44b57e,_0xdabac4){_0x44b57e=_0x44b57e-0x0;var _0x24d1e1=_0x9123[_0x44b57e];return _0x24d1e1;};'use strict';var _=require(_0x3912('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3912('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3912('0x2'))['db'];var utils=require(_0x3912('0x3'));var logger=require(_0x3912('0x4'))(_0x3912('0x5'));var config=require('../../config/environment');var jayson=require(_0x3912('0x6'));var client=jayson[_0x3912('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea5cf,_0x2b3ac0,_0x2d75b6){return new BPromise(function(_0x2325d0,_0x51fb5b){return client[_0x3912('0x8')](_0x4ea5cf,_0x2d75b6)[_0x3912('0x9')](function(_0x2f5910){logger[_0x3912('0xa')]('Automation,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'));logger[_0x3912('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'),JSON[_0x3912('0xd')](_0x2f5910));if(_0x2f5910[_0x3912('0xe')]){if(_0x2f5910[_0x3912('0xe')][_0x3912('0xf')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x2b3ac0,_0x2f5910[_0x3912('0xe')][_0x3912('0x10')]);return _0x51fb5b(_0x2f5910[_0x3912('0xe')]['message']);}logger[_0x3912('0xe')](_0x3912('0x11'),_0x2b3ac0,_0x2f5910['error'][_0x3912('0x10')]);return _0x2325d0(_0x2f5910[_0x3912('0xe')][_0x3912('0x10')]);}else{logger[_0x3912('0xa')]('Automation,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'));_0x2325d0(_0x2f5910[_0x3912('0x12')][_0x3912('0x10')]);}})[_0x3912('0x13')](function(_0x4658b6){logger['error'](_0x3912('0x11'),_0x2b3ac0,_0x4658b6);_0x51fb5b(_0x4658b6);});});} \ No newline at end of file +var _0xcd2f=['stringify','error','message','Automation,\x20%s,\x20%s','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0xf8ee88,_0x1dce44){var _0xb39174=function(_0x1bd7b9){while(--_0x1bd7b9){_0xf8ee88['push'](_0xf8ee88['shift']());}};_0xb39174(++_0x1dce44);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcd2f[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfcd2('0x0'));var rs=require(_0xfcd2('0x1'));var fs=require('fs');var Redis=require(_0xfcd2('0x2'));var db=require(_0xfcd2('0x3'))['db'];var utils=require(_0xfcd2('0x4'));var logger=require(_0xfcd2('0x5'))(_0xfcd2('0x6'));var config=require(_0xfcd2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfcd2('0x8')][_0xfcd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41e836,_0x20ac59,_0x467e4f){return new BPromise(function(_0x13d9fa,_0xae2219){return client[_0xfcd2('0xa')](_0x41e836,_0x467e4f)[_0xfcd2('0xb')](function(_0x358fb4){logger[_0xfcd2('0xc')]('Automation,\x20%s,\x20%s',_0x20ac59,_0xfcd2('0xd'));logger[_0xfcd2('0xe')](_0xfcd2('0xf'),_0x20ac59,_0xfcd2('0xd'),JSON[_0xfcd2('0x10')](_0x358fb4));if(_0x358fb4['error']){if(_0x358fb4['error']['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x20ac59,_0x358fb4[_0xfcd2('0x11')][_0xfcd2('0x12')]);return _0xae2219(_0x358fb4['error'][_0xfcd2('0x12')]);}logger[_0xfcd2('0x11')]('Automation,\x20%s,\x20%s',_0x20ac59,_0x358fb4['error'][_0xfcd2('0x12')]);return _0x13d9fa(_0x358fb4[_0xfcd2('0x11')][_0xfcd2('0x12')]);}else{logger[_0xfcd2('0xc')](_0xfcd2('0x13'),_0x20ac59,'request\x20sent');_0x13d9fa(_0x358fb4[_0xfcd2('0x14')][_0xfcd2('0x12')]);}})[_0xfcd2('0x15')](function(_0x34aa38){logger[_0xfcd2('0x11')](_0xfcd2('0x13'),_0x20ac59,_0x34aa38);_0xae2219(_0x34aa38);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2770339..27efaaf 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 _0x5343=['addActions','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','post','create','addConditions','/:id/actions'];(function(_0x3489ac,_0x335423){var _0x38032c=function(_0x523191){while(--_0x523191){_0x3489ac['push'](_0x3489ac['shift']());}};_0x38032c(++_0x335423);}(_0x5343,0x123));var _0x3534=function(_0x1b27e0,_0x231030){_0x1b27e0=_0x1b27e0-0x0;var _0x5482fe=_0x5343[_0x1b27e0];return _0x5482fe;};'use strict';var multer=require(_0x3534('0x0'));var util=require(_0x3534('0x1'));var path=require(_0x3534('0x2'));var timeout=require(_0x3534('0x3'));var express=require('express');var router=express[_0x3534('0x4')]();var fs_extra=require(_0x3534('0x5'));var auth=require(_0x3534('0x6'));var interaction=require(_0x3534('0x7'));var config=require(_0x3534('0x8'));var controller=require(_0x3534('0x9'));router[_0x3534('0xa')]('/',auth[_0x3534('0xb')](),controller[_0x3534('0xc')]);router[_0x3534('0xa')](_0x3534('0xd'),auth[_0x3534('0xb')](),controller[_0x3534('0xe')]);router[_0x3534('0xa')](_0x3534('0xf'),auth[_0x3534('0xb')](),controller[_0x3534('0x10')]);router[_0x3534('0xa')]('/:id/actions',auth[_0x3534('0xb')](),controller['getActions']);router[_0x3534('0x11')]('/',auth['isAuthenticated'](),controller[_0x3534('0x12')]);router[_0x3534('0x11')](_0x3534('0xf'),auth[_0x3534('0xb')](),controller[_0x3534('0x13')]);router[_0x3534('0x11')](_0x3534('0x14'),auth[_0x3534('0xb')](),controller[_0x3534('0x15')]);router['put'](_0x3534('0xd'),auth[_0x3534('0xb')](),controller['update']);router[_0x3534('0x16')](_0x3534('0xd'),auth[_0x3534('0xb')](),controller['destroy']);module[_0x3534('0x17')]=router; \ No newline at end of file +var _0x9ec3=['addConditions','addActions','put','update','delete','/:id','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getActions','create','post'];(function(_0x214b8a,_0x4684e2){var _0x29729c=function(_0x21b69c){while(--_0x21b69c){_0x214b8a['push'](_0x214b8a['shift']());}};_0x29729c(++_0x4684e2);}(_0x9ec3,0xcd));var _0x39ec=function(_0x1b30ef,_0x198a1c){_0x1b30ef=_0x1b30ef-0x0;var _0x3b33b1=_0x9ec3[_0x1b30ef];return _0x3b33b1;};'use strict';var multer=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39ec('0x2'));var router=express['Router']();var fs_extra=require(_0x39ec('0x3'));var auth=require(_0x39ec('0x4'));var interaction=require(_0x39ec('0x5'));var config=require(_0x39ec('0x6'));var controller=require(_0x39ec('0x7'));router[_0x39ec('0x8')]('/',auth[_0x39ec('0x9')](),controller[_0x39ec('0xa')]);router['get']('/:id',auth[_0x39ec('0x9')](),controller['show']);router[_0x39ec('0x8')](_0x39ec('0xb'),auth[_0x39ec('0x9')](),controller['getConditions']);router[_0x39ec('0x8')]('/:id/actions',auth[_0x39ec('0x9')](),controller[_0x39ec('0xc')]);router['post']('/',auth[_0x39ec('0x9')](),controller[_0x39ec('0xd')]);router[_0x39ec('0xe')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x39ec('0xf')]);router[_0x39ec('0xe')]('/:id/actions',auth[_0x39ec('0x9')](),controller[_0x39ec('0x10')]);router[_0x39ec('0x11')]('/:id',auth[_0x39ec('0x9')](),controller[_0x39ec('0x12')]);router[_0x39ec('0x13')](_0x39ec('0x14'),auth[_0x39ec('0x9')](),controller['destroy']);module[_0x39ec('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b4dfd0d..0cb4255 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 _0xb520=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x18222b,_0x19b028){var _0x4404a7=function(_0x3d63dd){while(--_0x3d63dd){_0x18222b['push'](_0x18222b['shift']());}};_0x4404a7(++_0x19b028);}(_0xb520,0x162));var _0x0b52=function(_0x3bc030,_0x272450){_0x3bc030=_0x3bc030-0x0;var _0x5a14df=_0xb520[_0x3bc030];return _0x5a14df;};'use strict';var Sequelize=require(_0x0b52('0x0'));module[_0x0b52('0x1')]={'name':{'type':Sequelize[_0x0b52('0x2')],'unique':_0x0b52('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b52('0x4')](_0x0b52('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0b52('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0b52('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0b52('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b52('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b52('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0b52('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b52('0xf')},'dialTimezone':{'type':Sequelize[_0x0b52('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b52('0x2')],'defaultValue':_0x0b52('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x0b52('0x4')](_0x0b52('0x11'),_0x0b52('0x12'),_0x0b52('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0b52('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0b52('0x9')](0x9)[_0x0b52('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b52('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b52('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b52('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b52('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b52('0x9')](0x9)[_0x0b52('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b52('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b52('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b52('0x9')](0x5)[_0x0b52('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0b52('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b52('0x9')](0x9)[_0x0b52('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b52('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0b52('0x4')](_0x0b52('0x19'),_0x0b52('0x1a')),'defaultValue':_0x0b52('0x19')},'dialPrefix':{'type':Sequelize[_0x0b52('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b52('0x9')](0x3)[_0x0b52('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b52('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0b52('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b52('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b52('0x9')](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0b52('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x0b52('0x9')](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b52('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b52('0x9')](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b52('0x9')](0x5)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x0b52('0x9')](0x3)[_0x0b52('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b52('0x9')](0x5)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0b52('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b52('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b52('0x9')](0x5)[_0x0b52('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b52('0x26')}}; \ No newline at end of file +var _0x2ec4=['07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)'];(function(_0xeca3ab,_0x3ee17e){var _0x3e72a6=function(_0x8a0d81){while(--_0x8a0d81){_0xeca3ab['push'](_0xeca3ab['shift']());}};_0x3e72a6(++_0x3ee17e);}(_0x2ec4,0x111));var _0x42ec=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2ec4[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module[_0x42ec('0x0')]={'name':{'type':Sequelize[_0x42ec('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x42ec('0x2')),'allowNull':![],'defaultValue':_0x42ec('0x2')},'description':{'type':Sequelize[_0x42ec('0x1')]},'active':{'type':Sequelize[_0x42ec('0x3')],'defaultValue':0x0,'comment':_0x42ec('0x4')},'limitCalls':{'type':Sequelize[_0x42ec('0x5')](0x4)[_0x42ec('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x42ec('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x42ec('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x42ec('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42ec('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42ec('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42ec('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42ec('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)[_0x42ec('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42ec('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'defaultValue':0x3,'comment':_0x42ec('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)[_0x42ec('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42ec('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x42ec('0xe')},'dialTimezone':{'type':Sequelize[_0x42ec('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x42ec('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x42ec('0x10')]('always',_0x42ec('0x11'),_0x42ec('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x42ec('0x3')],'defaultValue':0x0,'comment':_0x42ec('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x42ec('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x42ec('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x42ec('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x42ec('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x42ec('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x42ec('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x42ec('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x42ec('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x42ec('0x5')](0x9)[_0x42ec('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x42ec('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x42ec('0x10')]('DESC',_0x42ec('0x1b')),'defaultValue':_0x42ec('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x42ec('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)[_0x42ec('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42ec('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42ec('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42ec('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x42ec('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)[_0x42ec('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42ec('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x42ec('0x5')](0x3)[_0x42ec('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x42ec('0x5')](0x5)[_0x42ec('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x42ec('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index a963e14..445be15 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 _0x56dc=['then','destroy','IvrCampaigns','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','body','omit','autoAssociation','update','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','field','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','phone','NOW()','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','all','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','save'];(function(_0x20bdca,_0x527404){var _0x5ed657=function(_0x4af651){while(--_0x4af651){_0x20bdca['push'](_0x20bdca['shift']());}};_0x5ed657(++_0x527404);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc56d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc56d('0x1'));var jsonpatch=require(_0xc56d('0x2'));var rp=require(_0xc56d('0x3'));var moment=require(_0xc56d('0x4'));var BPromise=require(_0xc56d('0x5'));var Mustache=require('mustache');var util=require(_0xc56d('0x6'));var path=require(_0xc56d('0x7'));var sox=require(_0xc56d('0x8'));var csv=require(_0xc56d('0x9'));var ejs=require(_0xc56d('0xa'));var fs=require('fs');var fs_extra=require(_0xc56d('0xb'));var _=require('lodash');var squel=require(_0xc56d('0xc'));var crypto=require(_0xc56d('0xd'));var jsforce=require(_0xc56d('0xe'));var deskjs=require(_0xc56d('0xf'));var toCsv=require(_0xc56d('0x9'));var querystring=require(_0xc56d('0x10'));var Papa=require(_0xc56d('0x11'));var Redis=require(_0xc56d('0x12'));var authService=require(_0xc56d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc56d('0x14'));var hardwareService=require(_0xc56d('0x15'));var logger=require(_0xc56d('0x16'))('api');var utils=require(_0xc56d('0x17'));var config=require(_0xc56d('0x18'));var licenseUtil=require(_0xc56d('0x19'));var db=require(_0xc56d('0x1a'))['db'];function respondWithStatusCode(_0x585ca5,_0xf82e05){_0xf82e05=_0xf82e05||0xcc;return function(_0x2f120a){if(_0x2f120a){return _0x585ca5[_0xc56d('0x1b')](_0xf82e05);}return _0x585ca5['status'](_0xf82e05)[_0xc56d('0x1c')]();};}function respondWithResult(_0x3c0bb5,_0xf3e4eb){_0xf3e4eb=_0xf3e4eb||0xc8;return function(_0x13a712){if(_0x13a712){return _0x3c0bb5['status'](_0xf3e4eb)[_0xc56d('0x1d')](_0x13a712);}};}function respondWithFilteredResult(_0x372724,_0x4aedd3){return function(_0x4c5651){if(_0x4c5651){var _0x259967=typeof _0x4aedd3[_0xc56d('0x1e')]===_0xc56d('0x1f')&&typeof _0x4aedd3[_0xc56d('0x20')]==='undefined';var _0x432f28=_0x4c5651['count'];var _0x25df28=_0x259967?0x0:_0x4aedd3[_0xc56d('0x1e')];var _0x523cfd=_0x259967?_0x4c5651[_0xc56d('0x21')]:_0x4aedd3[_0xc56d('0x1e')]+_0x4aedd3[_0xc56d('0x20')];var _0x2bdb45;if(_0x523cfd>=_0x432f28){_0x523cfd=_0x432f28;_0x2bdb45=0xc8;}else{_0x2bdb45=0xce;}_0x372724[_0xc56d('0x22')](_0x2bdb45);return _0x372724['set'](_0xc56d('0x23'),_0x25df28+'-'+_0x523cfd+'/'+_0x432f28)[_0xc56d('0x1d')](_0x4c5651);}return null;};}function patchUpdates(_0x1dcc97){return function(_0x109254){try{jsonpatch['apply'](_0x109254,_0x1dcc97,!![]);}catch(_0x4ad703){return BPromise['reject'](_0x4ad703);}return _0x109254[_0xc56d('0x24')]();};}function saveUpdates(_0x1c9a1c,_0x44a380){return function(_0x52a5f1){if(_0x52a5f1){return _0x52a5f1['update'](_0x1c9a1c)[_0xc56d('0x25')](function(_0x22d927){return _0x22d927;});}return null;};}function removeEntity(_0x5edf2c,_0x446792){return function(_0x41e336){if(_0x41e336){return _0x41e336[_0xc56d('0x26')]()[_0xc56d('0x25')](function(){var _0x527929=_0x41e336['get']({'plain':!![]});var _0x2a769c=_0xc56d('0x27');return db['UserProfileResource'][_0xc56d('0x26')]({'where':{'type':_0x2a769c,'resourceId':_0x527929['id']}})[_0xc56d('0x25')](function(){return _0x41e336;});})[_0xc56d('0x25')](function(){_0x5edf2c['status'](0xcc)[_0xc56d('0x1c')]();});}};}function handleEntityNotFound(_0x2e48ae,_0x30dbd9){return function(_0x2fff7c){if(!_0x2fff7c){_0x2e48ae[_0xc56d('0x1b')](0x194);}return _0x2fff7c;};}function handleError(_0x130fd7,_0x5e27fb){_0x5e27fb=_0x5e27fb||0x1f4;return function(_0x5a50fb){logger['error'](_0x5a50fb[_0xc56d('0x28')]);if(_0x5a50fb[_0xc56d('0x29')]){delete _0x5a50fb[_0xc56d('0x29')];}_0x130fd7[_0xc56d('0x22')](_0x5e27fb)[_0xc56d('0x2a')](_0x5a50fb);};}exports['index']=function(_0x4765ce,_0x53faa2){var _0x4e3df8={},_0x4ddf1f={},_0x296cab={'count':0x0,'rows':[]};var _0x56326a=_[_0xc56d('0x2b')](db[_0xc56d('0x2c')][_0xc56d('0x2d')],function(_0x5affc6){return{'name':_0x5affc6[_0xc56d('0x2e')],'type':_0x5affc6[_0xc56d('0x2f')][_0xc56d('0x30')]};});_0x4ddf1f[_0xc56d('0x31')]=_['map'](_0x56326a,'name');_0x4ddf1f['query']=_[_0xc56d('0x32')](_0x4765ce[_0xc56d('0x33')]);_0x4ddf1f[_0xc56d('0x34')]=_[_0xc56d('0x35')](_0x4ddf1f[_0xc56d('0x31')],_0x4ddf1f['query']);_0x4e3df8[_0xc56d('0x36')]=_[_0xc56d('0x35')](_0x4ddf1f[_0xc56d('0x31')],qs[_0xc56d('0x37')](_0x4765ce[_0xc56d('0x33')][_0xc56d('0x37')]));_0x4e3df8[_0xc56d('0x36')]=_0x4e3df8['attributes'][_0xc56d('0x38')]?_0x4e3df8['attributes']:_0x4ddf1f[_0xc56d('0x31')];if(!_0x4765ce[_0xc56d('0x33')]['hasOwnProperty'](_0xc56d('0x39'))){_0x4e3df8[_0xc56d('0x20')]=qs[_0xc56d('0x20')](_0x4765ce[_0xc56d('0x33')][_0xc56d('0x20')]);_0x4e3df8[_0xc56d('0x1e')]=qs[_0xc56d('0x1e')](_0x4765ce[_0xc56d('0x33')][_0xc56d('0x1e')]);}_0x4e3df8[_0xc56d('0x3a')]=qs[_0xc56d('0x3b')](_0x4765ce[_0xc56d('0x33')][_0xc56d('0x3b')]);_0x4e3df8[_0xc56d('0x3c')]=qs[_0xc56d('0x34')](_[_0xc56d('0x3d')](_0x4765ce[_0xc56d('0x33')],_0x4ddf1f[_0xc56d('0x34')]),_0x56326a);if(_0x4765ce[_0xc56d('0x33')][_0xc56d('0x3e')]){_0x4e3df8[_0xc56d('0x3c')]=_[_0xc56d('0x3f')](_0x4e3df8[_0xc56d('0x3c')],{'$or':_[_0xc56d('0x2b')](_0x56326a,function(_0x437d7a){if(_0x437d7a[_0xc56d('0x2f')]!==_0xc56d('0x40')){var _0x47a4af={};_0x47a4af[_0x437d7a[_0xc56d('0x29')]]={'$like':'%'+_0x4765ce['query'][_0xc56d('0x3e')]+'%'};return _0x47a4af;}})});}_0x4e3df8=_[_0xc56d('0x3f')]({},_0x4e3df8,_0x4765ce[_0xc56d('0x41')]);var _0x596217={'where':_0x4e3df8['where']};return db[_0xc56d('0x2c')]['count'](_0x596217)['then'](function(_0x5e9035){_0x296cab['count']=_0x5e9035;if(_0x4765ce['query'][_0xc56d('0x42')]){_0x4e3df8[_0xc56d('0x43')]=[{'all':!![]}];}return db[_0xc56d('0x2c')][_0xc56d('0x44')](_0x4e3df8);})[_0xc56d('0x25')](function(_0x19f09a){_0x296cab[_0xc56d('0x45')]=_0x19f09a;return _0x296cab;})[_0xc56d('0x25')](respondWithFilteredResult(_0x53faa2,_0x4e3df8))[_0xc56d('0x46')](handleError(_0x53faa2,null));};exports[_0xc56d('0x47')]=function(_0x56c89c,_0x14b82a){var _0x25da4b={'raw':![],'where':{'id':_0x56c89c['params']['id']}},_0x109a14={};_0x109a14[_0xc56d('0x31')]=_[_0xc56d('0x32')](db[_0xc56d('0x2c')][_0xc56d('0x2d')]);_0x109a14[_0xc56d('0x33')]=_[_0xc56d('0x32')](_0x56c89c[_0xc56d('0x33')]);_0x109a14[_0xc56d('0x34')]=_['intersection'](_0x109a14[_0xc56d('0x31')],_0x109a14[_0xc56d('0x33')]);_0x25da4b[_0xc56d('0x36')]=_[_0xc56d('0x35')](_0x109a14[_0xc56d('0x31')],qs[_0xc56d('0x37')](_0x56c89c[_0xc56d('0x33')]['fields']));_0x25da4b[_0xc56d('0x36')]=_0x25da4b[_0xc56d('0x36')][_0xc56d('0x38')]?_0x25da4b['attributes']:_0x109a14[_0xc56d('0x31')];if(_0x56c89c[_0xc56d('0x33')][_0xc56d('0x42')]){_0x25da4b[_0xc56d('0x43')]=[{'all':!![]}];}_0x25da4b=_[_0xc56d('0x3f')]({},_0x25da4b,_0x56c89c[_0xc56d('0x41')]);return db[_0xc56d('0x2c')]['find'](_0x25da4b)[_0xc56d('0x25')](handleEntityNotFound(_0x14b82a,null))['then'](respondWithResult(_0x14b82a,null))[_0xc56d('0x46')](handleError(_0x14b82a,null));};exports[_0xc56d('0x48')]=function(_0x5280d1,_0x2ab5ad){return db[_0xc56d('0x2c')][_0xc56d('0x48')](_0x5280d1['body'],{})[_0xc56d('0x25')](function(_0xcdc714){var _0x1a919e=_0x5280d1['user'][_0xc56d('0x49')]({'plain':!![]});if(!_0x1a919e)throw new Error(_0xc56d('0x4a'));if(_0x1a919e[_0xc56d('0x4b')]===_0xc56d('0x4c')){var _0x4451a5=_0xcdc714['get']({'plain':!![]});var _0x25f72d=_0xc56d('0x27');return db[_0xc56d('0x4d')][_0xc56d('0x4e')]({'where':{'name':_0x25f72d,'userProfileId':_0x1a919e[_0xc56d('0x4f')]},'raw':!![]})[_0xc56d('0x25')](function(_0x514c7d){if(_0x514c7d&&_0x514c7d['autoAssociation']===0x0){return db[_0xc56d('0x50')][_0xc56d('0x48')]({'name':_0x4451a5[_0xc56d('0x29')],'resourceId':_0x4451a5['id'],'type':_0x514c7d[_0xc56d('0x29')],'sectionId':_0x514c7d['id']},{})['then'](function(){return _0xcdc714;});}else{return _0xcdc714;}})[_0xc56d('0x46')](function(_0xa54d26){logger[_0xc56d('0x51')](_0xc56d('0x52'),_0xa54d26);throw _0xa54d26;});}return _0xcdc714;})[_0xc56d('0x25')](respondWithResult(_0x2ab5ad,0xc9))['catch'](handleError(_0x2ab5ad,null));};exports[_0xc56d('0x53')]=function(_0x366da6,_0x1689bd){var _0x4da3c1={'where':{'id':_0x366da6[_0xc56d('0x54')]['id']}},_0x1f2bd7={};_0x1f2bd7['model']=_[_0xc56d('0x32')](db[_0xc56d('0x2c')][_0xc56d('0x2d')]);_0x4da3c1['attributes']=_[_0xc56d('0x35')](_0x1f2bd7[_0xc56d('0x31')],qs[_0xc56d('0x37')](_0x366da6[_0xc56d('0x33')][_0xc56d('0x37')]));_0x4da3c1[_0xc56d('0x36')]=_0x4da3c1['attributes']['length']?_0x4da3c1['attributes']:_0x1f2bd7[_0xc56d('0x31')];if(_0x366da6['query'][_0xc56d('0x42')]){_0x4da3c1[_0xc56d('0x43')]=[{'all':!![]}];}_0x4da3c1=_[_0xc56d('0x3f')]({},_0x4da3c1,_0x366da6[_0xc56d('0x41')]);return db[_0xc56d('0x2c')][_0xc56d('0x4e')](_0x4da3c1)[_0xc56d('0x25')](handleEntityNotFound(_0x1689bd,null))['then'](function(_0x56e313){if(_0x56e313){var _0x43eff0=_0x56e313[_0xc56d('0x49')]({'plain':!![]});_0x43eff0=qs['omit'](_0x43eff0,['id',_0xc56d('0x55'),_0xc56d('0x56')]);_0x366da6[_0xc56d('0x57')]=_[_0xc56d('0x58')](_0x366da6[_0xc56d('0x57')],['id','createdAt',_0xc56d('0x56')]);return db['Campaign'][_0xc56d('0x48')](_[_0xc56d('0x3f')](_0x43eff0,_0x366da6[_0xc56d('0x57')]),{'include':_0x366da6[_0xc56d('0x33')][_0xc56d('0x42')]?[{'all':!![]}]:undefined})[_0xc56d('0x25')](function(_0x3d0c39){var _0x10681d=_0x366da6['user'][_0xc56d('0x49')]({'plain':!![]});if(!_0x10681d)throw new Error(_0xc56d('0x4a'));if(_0x10681d['role']===_0xc56d('0x4c')){var _0x42319b=_0x3d0c39[_0xc56d('0x49')]({'plain':!![]});var _0x195d5a=_0xc56d('0x27');return db[_0xc56d('0x4d')][_0xc56d('0x4e')]({'where':{'name':_0x195d5a,'userProfileId':_0x10681d[_0xc56d('0x4f')]},'raw':!![]})[_0xc56d('0x25')](function(_0x3f9f00){if(_0x3f9f00&&_0x3f9f00[_0xc56d('0x59')]===0x0){return db[_0xc56d('0x50')]['create']({'name':_0x42319b[_0xc56d('0x29')],'resourceId':_0x42319b['id'],'type':_0x3f9f00[_0xc56d('0x29')],'sectionId':_0x3f9f00['id']},{})[_0xc56d('0x25')](function(){return _0x3d0c39;});}else{return _0x3d0c39;}})['catch'](function(_0x4ded79){logger[_0xc56d('0x51')](_0xc56d('0x52'),_0x4ded79);throw _0x4ded79;});}return _0x3d0c39;});}})[_0xc56d('0x25')](respondWithResult(_0x1689bd,0xc9))[_0xc56d('0x46')](handleError(_0x1689bd,null));};exports[_0xc56d('0x5a')]=function(_0x38c67f,_0x33c3c7){if(_0x38c67f[_0xc56d('0x57')]['id']){delete _0x38c67f[_0xc56d('0x57')]['id'];}return db['Campaign']['find']({'where':{'id':_0x38c67f[_0xc56d('0x54')]['id']}})['then'](handleEntityNotFound(_0x33c3c7,null))[_0xc56d('0x25')](saveUpdates(_0x38c67f[_0xc56d('0x57')],null))['then'](respondWithResult(_0x33c3c7,null))[_0xc56d('0x46')](handleError(_0x33c3c7,null));};exports[_0xc56d('0x26')]=function(_0x38611c,_0x3ebeff){return db[_0xc56d('0x2c')][_0xc56d('0x4e')]({'where':{'id':_0x38611c['params']['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x3ebeff,null))['then'](removeEntity(_0x3ebeff,null))[_0xc56d('0x46')](handleError(_0x3ebeff,null));};exports['getHoppers']=function(_0x1f64d9,_0xfbb321,_0x9da6){var _0x53e8a8={'raw':!![],'where':{}};var _0x48a511={};var _0x5d6ebf={'count':0x0,'rows':[]};return db[_0xc56d('0x2c')][_0xc56d('0x5b')]({'where':{'id':_0x1f64d9[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0xfbb321,null))[_0xc56d('0x25')](function(_0xa3d4d6){if(_0xa3d4d6){_0x48a511[_0xc56d('0x31')]=_[_0xc56d('0x32')](db[_0xc56d('0x5c')][_0xc56d('0x2d')]);_0x48a511[_0xc56d('0x33')]=_['keys'](_0x1f64d9[_0xc56d('0x33')]);_0x48a511[_0xc56d('0x34')]=_['intersection'](_0x48a511[_0xc56d('0x31')],_0x48a511['query']);_0x53e8a8[_0xc56d('0x36')]=_[_0xc56d('0x35')](_0x48a511[_0xc56d('0x31')],qs[_0xc56d('0x37')](_0x1f64d9[_0xc56d('0x33')][_0xc56d('0x37')]));_0x53e8a8[_0xc56d('0x36')]=_0x53e8a8[_0xc56d('0x36')]['length']?_0x53e8a8[_0xc56d('0x36')]:_0x48a511['model'];if(!_0x1f64d9[_0xc56d('0x33')][_0xc56d('0x5d')](_0xc56d('0x39'))){_0x53e8a8[_0xc56d('0x20')]=qs['limit'](_0x1f64d9[_0xc56d('0x33')][_0xc56d('0x20')]);_0x53e8a8['offset']=qs['offset'](_0x1f64d9['query'][_0xc56d('0x1e')]);}_0x53e8a8[_0xc56d('0x3a')]=qs[_0xc56d('0x3b')](_0x1f64d9[_0xc56d('0x33')][_0xc56d('0x3b')]);_0x53e8a8[_0xc56d('0x3c')]=qs['filters'](_[_0xc56d('0x3d')](_0x1f64d9[_0xc56d('0x33')],_0x48a511[_0xc56d('0x34')]));_0x53e8a8[_0xc56d('0x3c')][_0xc56d('0x5e')]=_0xa3d4d6['id'];if(_0x1f64d9[_0xc56d('0x33')][_0xc56d('0x3e')]){_0x53e8a8[_0xc56d('0x3c')]=_['merge'](_0x53e8a8[_0xc56d('0x3c')],{'$or':_['map'](_0x53e8a8[_0xc56d('0x36')],function(_0x2b6a3f){var _0x3bb0bc={};_0x3bb0bc[_0x2b6a3f]={'$like':'%'+_0x1f64d9[_0xc56d('0x33')][_0xc56d('0x3e')]+'%'};return _0x3bb0bc;})});}_0x53e8a8=_[_0xc56d('0x3f')]({},_0x53e8a8,_0x1f64d9[_0xc56d('0x41')]);return db[_0xc56d('0x5c')][_0xc56d('0x21')]({'where':_0x53e8a8['where']})[_0xc56d('0x25')](function(_0x429593){_0x5d6ebf[_0xc56d('0x21')]=_0x429593;if(_0x1f64d9['query'][_0xc56d('0x42')]){_0x53e8a8[_0xc56d('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xc56d('0x44')](_0x53e8a8);})[_0xc56d('0x25')](function(_0x223abe){_0x5d6ebf[_0xc56d('0x45')]=_0x223abe;return _0x5d6ebf;});}})[_0xc56d('0x25')](respondWithFilteredResult(_0xfbb321,_0x53e8a8))['catch'](handleError(_0xfbb321,null));};exports[_0xc56d('0x5f')]=function(_0x5a14bd,_0x13cd92,_0x28dca2){var _0x554ebd={'raw':!![],'where':{}};var _0x4a6947={};var _0x19e22c={'count':0x0,'rows':[]};return db[_0xc56d('0x2c')][_0xc56d('0x5b')]({'where':{'id':_0x5a14bd[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x13cd92,null))[_0xc56d('0x25')](function(_0x28b48e){if(_0x28b48e){_0x4a6947[_0xc56d('0x31')]=_[_0xc56d('0x32')](db[_0xc56d('0x60')]['rawAttributes']);_0x4a6947[_0xc56d('0x33')]=_['keys'](_0x5a14bd[_0xc56d('0x33')]);_0x4a6947[_0xc56d('0x34')]=_[_0xc56d('0x35')](_0x4a6947[_0xc56d('0x31')],_0x4a6947[_0xc56d('0x33')]);_0x554ebd['attributes']=_[_0xc56d('0x35')](_0x4a6947[_0xc56d('0x31')],qs[_0xc56d('0x37')](_0x5a14bd[_0xc56d('0x33')]['fields']));_0x554ebd[_0xc56d('0x36')]=_0x554ebd[_0xc56d('0x36')]['length']?_0x554ebd[_0xc56d('0x36')]:_0x4a6947[_0xc56d('0x31')];if(!_0x5a14bd[_0xc56d('0x33')]['hasOwnProperty'](_0xc56d('0x39'))){_0x554ebd[_0xc56d('0x20')]=qs[_0xc56d('0x20')](_0x5a14bd[_0xc56d('0x33')][_0xc56d('0x20')]);_0x554ebd[_0xc56d('0x1e')]=qs['offset'](_0x5a14bd[_0xc56d('0x33')][_0xc56d('0x1e')]);}_0x554ebd[_0xc56d('0x3a')]=qs[_0xc56d('0x3b')](_0x5a14bd[_0xc56d('0x33')][_0xc56d('0x3b')]);_0x554ebd['where']=qs[_0xc56d('0x34')](_[_0xc56d('0x3d')](_0x5a14bd[_0xc56d('0x33')],_0x4a6947[_0xc56d('0x34')]));_0x554ebd[_0xc56d('0x3c')][_0xc56d('0x5e')]=_0x28b48e['id'];if(_0x5a14bd[_0xc56d('0x33')]['filter']){_0x554ebd[_0xc56d('0x3c')]=_[_0xc56d('0x3f')](_0x554ebd[_0xc56d('0x3c')],{'$or':_[_0xc56d('0x2b')](_0x554ebd['attributes'],function(_0x518189){var _0x573310={};_0x573310[_0x518189]={'$like':'%'+_0x5a14bd[_0xc56d('0x33')][_0xc56d('0x3e')]+'%'};return _0x573310;})});}_0x554ebd=_[_0xc56d('0x3f')]({},_0x554ebd,_0x5a14bd[_0xc56d('0x41')]);return db[_0xc56d('0x60')][_0xc56d('0x21')]({'where':_0x554ebd['where']})[_0xc56d('0x25')](function(_0x1ab903){_0x19e22c['count']=_0x1ab903;if(_0x5a14bd['query']['includeAll']){_0x554ebd[_0xc56d('0x43')]=[{'all':!![]}];}return db[_0xc56d('0x60')][_0xc56d('0x44')](_0x554ebd);})[_0xc56d('0x25')](function(_0x2be4a1){_0x19e22c[_0xc56d('0x45')]=_0x2be4a1;return _0x19e22c;});}})[_0xc56d('0x25')](respondWithFilteredResult(_0x13cd92,_0x554ebd))[_0xc56d('0x46')](handleError(_0x13cd92,null));};exports[_0xc56d('0x61')]=function(_0x167e75,_0x1971f7,_0x2dd50e){var _0x493584={'raw':!![],'where':{}};var _0x3e0ad8={};var _0x3df2bc={'count':0x0,'rows':[]};return db[_0xc56d('0x2c')][_0xc56d('0x5b')]({'where':{'id':_0x167e75[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x1971f7,null))[_0xc56d('0x25')](function(_0x5edab9){if(_0x5edab9){_0x3e0ad8['model']=_[_0xc56d('0x32')](db[_0xc56d('0x62')][_0xc56d('0x2d')]);_0x3e0ad8[_0xc56d('0x33')]=_[_0xc56d('0x32')](_0x167e75['query']);_0x3e0ad8['filters']=_[_0xc56d('0x35')](_0x3e0ad8[_0xc56d('0x31')],_0x3e0ad8['query']);_0x493584['attributes']=_['intersection'](_0x3e0ad8[_0xc56d('0x31')],qs['fields'](_0x167e75['query'][_0xc56d('0x37')]));_0x493584[_0xc56d('0x36')]=_0x493584[_0xc56d('0x36')]['length']?_0x493584[_0xc56d('0x36')]:_0x3e0ad8[_0xc56d('0x31')];if(!_0x167e75[_0xc56d('0x33')][_0xc56d('0x5d')](_0xc56d('0x39'))){_0x493584[_0xc56d('0x20')]=qs[_0xc56d('0x20')](_0x167e75[_0xc56d('0x33')]['limit']);_0x493584[_0xc56d('0x1e')]=qs['offset'](_0x167e75[_0xc56d('0x33')]['offset']);}_0x493584[_0xc56d('0x3a')]=qs[_0xc56d('0x3b')](_0x167e75[_0xc56d('0x33')][_0xc56d('0x3b')]);_0x493584['where']=qs['filters'](_[_0xc56d('0x3d')](_0x167e75[_0xc56d('0x33')],_0x3e0ad8[_0xc56d('0x34')]));_0x493584[_0xc56d('0x3c')]['CampaignId']=_0x5edab9['id'];if(_0x167e75[_0xc56d('0x33')]['filter']){_0x493584[_0xc56d('0x3c')]=_[_0xc56d('0x3f')](_0x493584['where'],{'$or':_['map'](_0x493584[_0xc56d('0x36')],function(_0x6061f8){var _0x45b4dd={};_0x45b4dd[_0x6061f8]={'$like':'%'+_0x167e75[_0xc56d('0x33')]['filter']+'%'};return _0x45b4dd;})});}_0x493584=_['merge']({},_0x493584,_0x167e75[_0xc56d('0x41')]);return db['CmHopperFinal']['count']({'where':_0x493584[_0xc56d('0x3c')]})[_0xc56d('0x25')](function(_0x5803c6){_0x3df2bc[_0xc56d('0x21')]=_0x5803c6;if(_0x167e75[_0xc56d('0x33')][_0xc56d('0x42')]){_0x493584[_0xc56d('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xc56d('0x44')](_0x493584);})['then'](function(_0x3c44b4){_0x3df2bc[_0xc56d('0x45')]=_0x3c44b4;return _0x3df2bc;});}})[_0xc56d('0x25')](respondWithFilteredResult(_0x1971f7,_0x493584))[_0xc56d('0x46')](handleError(_0x1971f7,null));};exports['getHopperBlacks']=function(_0x3c995c,_0x5e30e9,_0x2d5394){var _0x34fe2e={'raw':!![],'where':{}};var _0x36a2e4={};var _0x2d869a={'count':0x0,'rows':[]};return db[_0xc56d('0x2c')][_0xc56d('0x5b')]({'where':{'id':_0x3c995c[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x5e30e9,null))[_0xc56d('0x25')](function(_0x288cbd){if(_0x288cbd){_0x36a2e4['model']=_[_0xc56d('0x32')](db['CmHopperBlack'][_0xc56d('0x2d')]);_0x36a2e4[_0xc56d('0x33')]=_['keys'](_0x3c995c[_0xc56d('0x33')]);_0x36a2e4['filters']=_[_0xc56d('0x35')](_0x36a2e4[_0xc56d('0x31')],_0x36a2e4['query']);_0x34fe2e[_0xc56d('0x36')]=_[_0xc56d('0x35')](_0x36a2e4['model'],qs[_0xc56d('0x37')](_0x3c995c['query'][_0xc56d('0x37')]));_0x34fe2e[_0xc56d('0x36')]=_0x34fe2e[_0xc56d('0x36')][_0xc56d('0x38')]?_0x34fe2e['attributes']:_0x36a2e4['model'];if(!_0x3c995c[_0xc56d('0x33')]['hasOwnProperty']('nolimit')){_0x34fe2e[_0xc56d('0x20')]=qs[_0xc56d('0x20')](_0x3c995c[_0xc56d('0x33')][_0xc56d('0x20')]);_0x34fe2e[_0xc56d('0x1e')]=qs[_0xc56d('0x1e')](_0x3c995c[_0xc56d('0x33')][_0xc56d('0x1e')]);}_0x34fe2e['order']=qs['sort'](_0x3c995c['query'][_0xc56d('0x3b')]);_0x34fe2e[_0xc56d('0x3c')]=qs[_0xc56d('0x34')](_['pick'](_0x3c995c['query'],_0x36a2e4[_0xc56d('0x34')]));_0x34fe2e[_0xc56d('0x3c')][_0xc56d('0x5e')]=_0x288cbd['id'];if(_0x3c995c[_0xc56d('0x33')][_0xc56d('0x3e')]){_0x34fe2e[_0xc56d('0x3c')]=_[_0xc56d('0x3f')](_0x34fe2e['where'],{'$or':_['map'](_0x34fe2e['attributes'],function(_0x5a0b74){var _0x12a494={};_0x12a494[_0x5a0b74]={'$like':'%'+_0x3c995c[_0xc56d('0x33')][_0xc56d('0x3e')]+'%'};return _0x12a494;})});}_0x34fe2e=_[_0xc56d('0x3f')]({},_0x34fe2e,_0x3c995c[_0xc56d('0x41')]);return db[_0xc56d('0x63')][_0xc56d('0x21')]({'where':_0x34fe2e[_0xc56d('0x3c')]})[_0xc56d('0x25')](function(_0x4a45e4){_0x2d869a[_0xc56d('0x21')]=_0x4a45e4;if(_0x3c995c[_0xc56d('0x33')][_0xc56d('0x42')]){_0x34fe2e['include']=[{'all':!![]}];}return db[_0xc56d('0x63')][_0xc56d('0x44')](_0x34fe2e);})[_0xc56d('0x25')](function(_0x4aca75){_0x2d869a[_0xc56d('0x45')]=_0x4aca75;return _0x2d869a;});}})[_0xc56d('0x25')](respondWithFilteredResult(_0x5e30e9,_0x34fe2e))[_0xc56d('0x46')](handleError(_0x5e30e9,null));};exports['getLists']=function(_0x4e79d0,_0xa47508,_0x18e061){var _0x503107={};var _0x1e144e={};var _0x4e8e18;var _0x1a9340;return db[_0xc56d('0x2c')][_0xc56d('0x5b')]({'where':{'id':_0x4e79d0[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0xa47508,null))[_0xc56d('0x25')](function(_0x3bb572){if(_0x3bb572){_0x4e8e18=_0x3bb572;_0x1e144e[_0xc56d('0x31')]=_[_0xc56d('0x32')](db[_0xc56d('0x64')][_0xc56d('0x2d')]);_0x1e144e[_0xc56d('0x33')]=_[_0xc56d('0x32')](_0x4e79d0[_0xc56d('0x33')]);_0x1e144e[_0xc56d('0x34')]=_['intersection'](_0x1e144e['model'],_0x1e144e['query']);_0x503107[_0xc56d('0x36')]=_[_0xc56d('0x35')](_0x1e144e['model'],qs[_0xc56d('0x37')](_0x4e79d0[_0xc56d('0x33')][_0xc56d('0x37')]));_0x503107[_0xc56d('0x36')]=_0x503107['attributes'][_0xc56d('0x38')]?_0x503107['attributes']:_0x1e144e[_0xc56d('0x31')];_0x503107[_0xc56d('0x3a')]=qs['sort'](_0x4e79d0[_0xc56d('0x33')][_0xc56d('0x3b')]);_0x503107[_0xc56d('0x3c')]=qs[_0xc56d('0x34')](_['pick'](_0x4e79d0[_0xc56d('0x33')],_0x1e144e[_0xc56d('0x34')]));if(_0x4e79d0['query'][_0xc56d('0x3e')]){_0x503107[_0xc56d('0x3c')]=_[_0xc56d('0x3f')](_0x503107[_0xc56d('0x3c')],{'$or':_[_0xc56d('0x2b')](_0x503107[_0xc56d('0x36')],function(_0x1b3526){var _0x2f61e9={};_0x2f61e9[_0x1b3526]={'$like':'%'+_0x4e79d0[_0xc56d('0x33')][_0xc56d('0x3e')]+'%'};return _0x2f61e9;})});}_0x503107=_[_0xc56d('0x3f')]({},_0x503107,_0x4e79d0[_0xc56d('0x41')]);return _0x4e8e18[_0xc56d('0x65')](_0x503107);}})[_0xc56d('0x25')](function(_0x3b92fd){if(_0x3b92fd){_0x1a9340=_0x3b92fd[_0xc56d('0x38')];if(!_0x4e79d0[_0xc56d('0x33')][_0xc56d('0x5d')](_0xc56d('0x39'))){_0x503107[_0xc56d('0x20')]=qs[_0xc56d('0x20')](_0x4e79d0[_0xc56d('0x33')][_0xc56d('0x20')]);_0x503107[_0xc56d('0x1e')]=qs['offset'](_0x4e79d0[_0xc56d('0x33')]['offset']);}return _0x4e8e18[_0xc56d('0x65')](_0x503107);}})[_0xc56d('0x25')](function(_0x2f440){if(_0x2f440){return _0x2f440?{'count':_0x1a9340,'rows':_0x2f440}:null;}})[_0xc56d('0x25')](respondWithResult(_0xa47508,null))[_0xc56d('0x46')](handleError(_0xa47508,null));};exports[_0xc56d('0x66')]=function(_0x595be5,_0x4e8fd4,_0x54e3fa){var _0x3b2265,_0x408141;var _0x181786=[];var _0x534241=moment()['format'](_0xc56d('0x67'));return db[_0xc56d('0x2c')][_0xc56d('0x4e')]({'where':{'id':_0x595be5[_0xc56d('0x54')]['id']}})['then'](handleEntityNotFound(_0x4e8fd4,null))[_0xc56d('0x25')](function(_0x43a50e){if(_0x43a50e){_0x408141=_0x43a50e;return _0x43a50e[_0xc56d('0x66')](_0x595be5['body'][_0xc56d('0x68')],_[_0xc56d('0x58')](_0x595be5[_0xc56d('0x57')],[_0xc56d('0x68'),'id'])||{});}return null;})['spread'](function(_0x23455c){var _0x99f9a;var _0x18b095;_0x3b2265=_0x23455c||[];var _0x574d95=[];if(_0x23455c){for(var _0x38ad10=0x0;_0x38ad10<_0x23455c[_0xc56d('0x38')];_0x38ad10+=0x1){var _0x3c58b7=_0x23455c[_0x38ad10]['get']({'plain':!![]});_0x408141['dialCheckDuplicateType']=_0x595be5[_0xc56d('0x57')][_0xc56d('0x69')]?_0x595be5['body'][_0xc56d('0x69')]:_0x408141[_0xc56d('0x69')];switch(_0x408141[_0xc56d('0x69')]){case _0xc56d('0x6a'):_0x99f9a=squel[_0xc56d('0x6b')]()[_0xc56d('0x6c')]('cm_hopper')[_0xc56d('0x6d')](['phone',_0xc56d('0x6e'),_0xc56d('0x6f'),_0xc56d('0x70'),'CampaignId',_0xc56d('0x55'),_0xc56d('0x56')],squel['select']()[_0xc56d('0x71')]('phone','phone')[_0xc56d('0x71')]('NOW()',_0xc56d('0x6e'))[_0xc56d('0x71')]('id',_0xc56d('0x6f'))[_0xc56d('0x71')](_0x3c58b7['CmListId'][_0xc56d('0x72')](),_0xc56d('0x70'))['field'](_0x595be5[_0xc56d('0x54')]['id'][_0xc56d('0x72')](),_0xc56d('0x5e'))[_0xc56d('0x71')]('\x27'+_0x534241+'\x27',_0xc56d('0x55'))[_0xc56d('0x71')]('\x27'+_0x534241+'\x27',_0xc56d('0x56'))[_0xc56d('0x73')](_0xc56d('0x74'))[_0xc56d('0x3c')]('deletedAt\x20IS\x20NULL')[_0xc56d('0x3c')](_0xc56d('0x75'),_0x3c58b7[_0xc56d('0x76')][_0xc56d('0x72')]())[_0xc56d('0x3c')](_0xc56d('0x77'))[_0xc56d('0x3c')](_0xc56d('0x78'),squel[_0xc56d('0x79')]()[_0xc56d('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0xc56d('0x73')]('cm_hopper_final')['where'](_0xc56d('0x7a'),_0x595be5['params']['id'][_0xc56d('0x72')]()))[_0xc56d('0x3c')](_0xc56d('0x78'),squel[_0xc56d('0x79')]()[_0xc56d('0x71')](_0xc56d('0x7b'))[_0xc56d('0x73')]('cm_hopper')['where'](_0xc56d('0x7a'),_0x595be5[_0xc56d('0x54')]['id'][_0xc56d('0x72')]())))[_0xc56d('0x72')]();break;case'onlyIfOpen':_0x99f9a=squel['insert']()[_0xc56d('0x6c')](_0xc56d('0x7c'))[_0xc56d('0x6d')]([_0xc56d('0x7d'),_0xc56d('0x6e'),_0xc56d('0x6f'),_0xc56d('0x70'),_0xc56d('0x5e'),_0xc56d('0x55'),_0xc56d('0x56')],squel[_0xc56d('0x79')]()[_0xc56d('0x71')](_0xc56d('0x7d'),_0xc56d('0x7d'))['field'](_0xc56d('0x7e'),_0xc56d('0x6e'))[_0xc56d('0x71')]('id',_0xc56d('0x6f'))[_0xc56d('0x71')](_0x3c58b7['CmListId'][_0xc56d('0x72')](),_0xc56d('0x70'))[_0xc56d('0x71')](_0x595be5[_0xc56d('0x54')]['id'][_0xc56d('0x72')](),_0xc56d('0x5e'))[_0xc56d('0x71')]('\x27'+_0x534241+'\x27',_0xc56d('0x55'))[_0xc56d('0x71')]('\x27'+_0x534241+'\x27','updatedAt')[_0xc56d('0x73')]('cm_contacts')[_0xc56d('0x3c')](_0xc56d('0x7f'))[_0xc56d('0x3c')](_0xc56d('0x75'),_0x3c58b7[_0xc56d('0x76')][_0xc56d('0x72')]())[_0xc56d('0x3c')](_0xc56d('0x77'))['where'](_0xc56d('0x78'),squel[_0xc56d('0x79')]()[_0xc56d('0x71')](_0xc56d('0x7b'))[_0xc56d('0x73')](_0xc56d('0x7c'))[_0xc56d('0x3c')](_0xc56d('0x7a'),_0x595be5[_0xc56d('0x54')]['id'][_0xc56d('0x72')]())))[_0xc56d('0x72')]();break;default:_0x99f9a=squel[_0xc56d('0x6b')]()[_0xc56d('0x6c')](_0xc56d('0x7c'))[_0xc56d('0x6d')]([_0xc56d('0x7d'),_0xc56d('0x6e'),_0xc56d('0x6f'),_0xc56d('0x70'),'CampaignId','createdAt',_0xc56d('0x56')],squel[_0xc56d('0x79')]()[_0xc56d('0x71')](_0xc56d('0x7d'),_0xc56d('0x7d'))[_0xc56d('0x71')](_0xc56d('0x7e'),'scheduledAt')[_0xc56d('0x71')]('id','ContactId')[_0xc56d('0x71')](_0x3c58b7['CmListId'][_0xc56d('0x72')](),'ListId')['field'](_0x595be5[_0xc56d('0x54')]['id'][_0xc56d('0x72')](),'CampaignId')['field']('\x27'+_0x534241+'\x27',_0xc56d('0x55'))[_0xc56d('0x71')]('\x27'+_0x534241+'\x27','updatedAt')[_0xc56d('0x73')]('cm_contacts')[_0xc56d('0x3c')](_0xc56d('0x7f'))[_0xc56d('0x3c')](_0xc56d('0x75'),_0x3c58b7[_0xc56d('0x76')][_0xc56d('0x72')]())[_0xc56d('0x3c')](_0xc56d('0x77')))[_0xc56d('0x72')]();}_0x18b095=squel[_0xc56d('0x6b')]()[_0xc56d('0x6c')](_0xc56d('0x80'))['fromQuery']([_0xc56d('0x81'),_0xc56d('0x6e'),_0xc56d('0x7d'),_0xc56d('0x82'),'createdAt',_0xc56d('0x56')],squel[_0xc56d('0x79')]()[_0xc56d('0x71')](_0xc56d('0x83'),'id')[_0xc56d('0x71')]('NOW()','scheduledAt')[_0xc56d('0x71')]('ci.item',_0xc56d('0x7d'))[_0xc56d('0x71')](_0xc56d('0x84'),_0xc56d('0x82'))[_0xc56d('0x71')]('\x27'+_0x534241+'\x27','createdAt')['field']('\x27'+_0x534241+'\x27',_0xc56d('0x56'))['from']('cm_contact_has_items','ci')['join']('cm_hopper','h',_0xc56d('0x85'))[_0xc56d('0x3c')]('h.ListId\x20=\x20?',_0x3c58b7[_0xc56d('0x76')][_0xc56d('0x72')]())[_0xc56d('0x3c')](_0xc56d('0x86'),_0x595be5[_0xc56d('0x54')]['id']['toString']())['where'](_0xc56d('0x87'),_0x534241))[_0xc56d('0x72')]();_0x574d95[_0xc56d('0x88')](db[_0xc56d('0x89')][_0xc56d('0x33')](_0x99f9a));_0x181786['push'](db[_0xc56d('0x89')][_0xc56d('0x33')](_0x18b095));}return BPromise['all'](_0x574d95);}})[_0xc56d('0x25')](function(){return BPromise['all'](_0x181786);})[_0xc56d('0x25')](function(){return _0x3b2265;})[_0xc56d('0x25')](respondWithResult(_0x4e8fd4,null))[_0xc56d('0x46')](handleError(_0x4e8fd4,null));};exports[_0xc56d('0x8a')]=function(_0x258f3d,_0x1513bb,_0x57de94){return db[_0xc56d('0x2c')][_0xc56d('0x4e')]({'where':{'id':_0x258f3d['params']['id']}})['then'](handleEntityNotFound(_0x1513bb,null))['then'](function(_0x35db76){if(_0x35db76){return _0x35db76[_0xc56d('0x8a')](_0x258f3d[_0xc56d('0x33')]['ids']);}})[_0xc56d('0x25')](function(_0x3f082c){if(_0x3f082c){return db[_0xc56d('0x5c')]['destroy']({'where':{'ListId':_0x258f3d[_0xc56d('0x33')]['ids'],'CampaignId':_0x258f3d[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](function(){return _0x3f082c;});}})['then'](respondWithStatusCode(_0x1513bb,null))[_0xc56d('0x46')](handleError(_0x1513bb,null));};exports[_0xc56d('0x8b')]=function(_0x3b44c7,_0x41969e,_0x39f885){var _0x2d05a6={};var _0x11abbb={};var _0x3037fa;var _0x3e7232;return db[_0xc56d('0x2c')]['findOne']({'where':{'id':_0x3b44c7[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x41969e,null))[_0xc56d('0x25')](function(_0x1dafb2){if(_0x1dafb2){_0x3037fa=_0x1dafb2;_0x11abbb[_0xc56d('0x31')]=_['keys'](db[_0xc56d('0x64')][_0xc56d('0x2d')]);_0x11abbb[_0xc56d('0x33')]=_['keys'](_0x3b44c7['query']);_0x11abbb[_0xc56d('0x34')]=_['intersection'](_0x11abbb[_0xc56d('0x31')],_0x11abbb[_0xc56d('0x33')]);_0x2d05a6[_0xc56d('0x36')]=_[_0xc56d('0x35')](_0x11abbb[_0xc56d('0x31')],qs[_0xc56d('0x37')](_0x3b44c7[_0xc56d('0x33')][_0xc56d('0x37')]));_0x2d05a6[_0xc56d('0x36')]=_0x2d05a6[_0xc56d('0x36')]['length']?_0x2d05a6[_0xc56d('0x36')]:_0x11abbb[_0xc56d('0x31')];_0x2d05a6[_0xc56d('0x3a')]=qs[_0xc56d('0x3b')](_0x3b44c7['query'][_0xc56d('0x3b')]);_0x2d05a6[_0xc56d('0x3c')]=qs[_0xc56d('0x34')](_[_0xc56d('0x3d')](_0x3b44c7[_0xc56d('0x33')],_0x11abbb[_0xc56d('0x34')]));if(_0x3b44c7[_0xc56d('0x33')][_0xc56d('0x3e')]){_0x2d05a6['where']=_[_0xc56d('0x3f')](_0x2d05a6[_0xc56d('0x3c')],{'$or':_['map'](_0x2d05a6[_0xc56d('0x36')],function(_0x317589){var _0x402b4a={};_0x402b4a[_0x317589]={'$like':'%'+_0x3b44c7[_0xc56d('0x33')][_0xc56d('0x3e')]+'%'};return _0x402b4a;})});}_0x2d05a6=_[_0xc56d('0x3f')]({},_0x2d05a6,_0x3b44c7[_0xc56d('0x41')]);return _0x3037fa[_0xc56d('0x8b')](_0x2d05a6);}})[_0xc56d('0x25')](function(_0x117ded){if(_0x117ded){_0x3e7232=_0x117ded[_0xc56d('0x38')];if(!_0x3b44c7['query'][_0xc56d('0x5d')](_0xc56d('0x39'))){_0x2d05a6['limit']=qs['limit'](_0x3b44c7['query'][_0xc56d('0x20')]);_0x2d05a6[_0xc56d('0x1e')]=qs['offset'](_0x3b44c7[_0xc56d('0x33')][_0xc56d('0x1e')]);}return _0x3037fa[_0xc56d('0x8b')](_0x2d05a6);}})[_0xc56d('0x25')](function(_0x317621){if(_0x317621){return _0x317621?{'count':_0x3e7232,'rows':_0x317621}:null;}})[_0xc56d('0x25')](respondWithResult(_0x41969e,null))['catch'](handleError(_0x41969e,null));};exports[_0xc56d('0x8c')]=function(_0x4c949f,_0xdf6a04,_0x10d615){var _0x3eb2be,_0x51ed54;var _0x38c423=[];var _0x38c807=moment()['format'](_0xc56d('0x67'));return db[_0xc56d('0x2c')]['find']({'where':{'id':_0x4c949f[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0xdf6a04,null))[_0xc56d('0x25')](function(_0x593f6c){if(_0x593f6c){_0x51ed54=_0x593f6c;return _0x593f6c['addBlackLists'](_0x4c949f[_0xc56d('0x57')][_0xc56d('0x68')],_['omit'](_0x4c949f[_0xc56d('0x57')],[_0xc56d('0x68'),'id'])||{});}return null;})[_0xc56d('0x8d')](function(_0x49f2a8){var _0x18196f;var _0x489e69;_0x3eb2be=_0x49f2a8||[];var _0x530cc6=[];if(_0x49f2a8){for(var _0x4087d8=0x0;_0x4087d8<_0x49f2a8[_0xc56d('0x38')];_0x4087d8+=0x1){var _0x37bf5d=_0x49f2a8[_0x4087d8][_0xc56d('0x49')]({'plain':!![]});_0x18196f=squel[_0xc56d('0x6b')]()['into'](_0xc56d('0x8e'))[_0xc56d('0x6d')](['phone',_0xc56d('0x6f'),_0xc56d('0x70'),_0xc56d('0x5e'),_0xc56d('0x55'),_0xc56d('0x56')],squel[_0xc56d('0x79')]()[_0xc56d('0x71')](_0xc56d('0x7d'),_0xc56d('0x7d'))[_0xc56d('0x71')]('id','ContactId')[_0xc56d('0x71')](_0x37bf5d['CmListId']['toString'](),_0xc56d('0x70'))[_0xc56d('0x71')](_0x4c949f[_0xc56d('0x54')]['id']['toString'](),_0xc56d('0x5e'))[_0xc56d('0x71')]('NOW()','createdAt')['field'](_0xc56d('0x7e'),'updatedAt')[_0xc56d('0x73')](_0xc56d('0x74'))[_0xc56d('0x3c')](_0xc56d('0x7f'))[_0xc56d('0x3c')]('ListId\x20=\x20?',_0x37bf5d['CmListId']['toString']())[_0xc56d('0x3c')](_0xc56d('0x77')))[_0xc56d('0x72')]();_0x530cc6[_0xc56d('0x88')](db[_0xc56d('0x89')][_0xc56d('0x33')](_0x18196f));}return BPromise[_0xc56d('0x8f')](_0x530cc6);}})['then'](function(){return _0x3eb2be;})[_0xc56d('0x25')](respondWithResult(_0xdf6a04,null))[_0xc56d('0x46')](handleError(_0xdf6a04,null));};exports[_0xc56d('0x90')]=function(_0x1e41bd,_0x34ddd3,_0x34948b){return db['Campaign'][_0xc56d('0x4e')]({'where':{'id':_0x1e41bd[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](handleEntityNotFound(_0x34ddd3,null))[_0xc56d('0x25')](function(_0xa6e2eb){if(_0xa6e2eb){return _0xa6e2eb['removeBlackLists'](_0x1e41bd[_0xc56d('0x33')][_0xc56d('0x68')]);}})[_0xc56d('0x25')](function(_0x1d56d5){if(_0x1d56d5){return db['CmHopperBlack'][_0xc56d('0x26')]({'where':{'ListId':_0x1e41bd[_0xc56d('0x33')][_0xc56d('0x68')],'CampaignId':_0x1e41bd[_0xc56d('0x54')]['id']}})[_0xc56d('0x25')](function(){return _0x1d56d5;});}})[_0xc56d('0x25')](respondWithStatusCode(_0x34ddd3,null))['catch'](handleError(_0x34ddd3,null));}; \ No newline at end of file +var _0xab75=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Campaign','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','order','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','into','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3e6586,_0x1cf159){var _0x20f696=function(_0x5d9aa7){while(--_0x5d9aa7){_0x3e6586['push'](_0x3e6586['shift']());}};_0x20f696(++_0x1cf159);}(_0xab75,0x11f));var _0x5ab7=function(_0x441cdc,_0x43eb97){_0x441cdc=_0x441cdc-0x0;var _0x1ca97f=_0xab75[_0x441cdc];return _0x1ca97f;};'use strict';var emlformat=require(_0x5ab7('0x0'));var rimraf=require(_0x5ab7('0x1'));var zipdir=require(_0x5ab7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ab7('0x3'));var BPromise=require(_0x5ab7('0x4'));var Mustache=require(_0x5ab7('0x5'));var util=require('util');var path=require(_0x5ab7('0x6'));var sox=require(_0x5ab7('0x7'));var csv=require(_0x5ab7('0x8'));var ejs=require(_0x5ab7('0x9'));var fs=require('fs');var fs_extra=require(_0x5ab7('0xa'));var _=require(_0x5ab7('0xb'));var squel=require(_0x5ab7('0xc'));var crypto=require(_0x5ab7('0xd'));var jsforce=require(_0x5ab7('0xe'));var deskjs=require(_0x5ab7('0xf'));var toCsv=require(_0x5ab7('0x8'));var querystring=require('querystring');var Papa=require(_0x5ab7('0x10'));var Redis=require(_0x5ab7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5ab7('0x12'));var as=require(_0x5ab7('0x13'));var hardwareService=require(_0x5ab7('0x14'));var logger=require(_0x5ab7('0x15'))(_0x5ab7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5ab7('0x17'));var db=require(_0x5ab7('0x18'))['db'];function respondWithStatusCode(_0x574502,_0x457c24){_0x457c24=_0x457c24||0xcc;return function(_0x1d6ae0){if(_0x1d6ae0){return _0x574502[_0x5ab7('0x19')](_0x457c24);}return _0x574502[_0x5ab7('0x1a')](_0x457c24)[_0x5ab7('0x1b')]();};}function respondWithResult(_0x350bd9,_0xdca16b){_0xdca16b=_0xdca16b||0xc8;return function(_0xd3255d){if(_0xd3255d){return _0x350bd9['status'](_0xdca16b)[_0x5ab7('0x1c')](_0xd3255d);}};}function respondWithFilteredResult(_0x10daf0,_0x477d0d){return function(_0x456a4b){if(_0x456a4b){var _0x3ad6c9=typeof _0x477d0d[_0x5ab7('0x1d')]===_0x5ab7('0x1e')&&typeof _0x477d0d[_0x5ab7('0x1f')]===_0x5ab7('0x1e');var _0x168443=_0x456a4b['count'];var _0x207a79=_0x3ad6c9?0x0:_0x477d0d[_0x5ab7('0x1d')];var _0xdb94d3=_0x3ad6c9?_0x456a4b['count']:_0x477d0d[_0x5ab7('0x1d')]+_0x477d0d[_0x5ab7('0x1f')];var _0xf0a8a9;if(_0xdb94d3>=_0x168443){_0xdb94d3=_0x168443;_0xf0a8a9=0xc8;}else{_0xf0a8a9=0xce;}_0x10daf0[_0x5ab7('0x1a')](_0xf0a8a9);return _0x10daf0['set'](_0x5ab7('0x20'),_0x207a79+'-'+_0xdb94d3+'/'+_0x168443)[_0x5ab7('0x1c')](_0x456a4b);}return null;};}function patchUpdates(_0x38dc30){return function(_0x1975fc){try{jsonpatch['apply'](_0x1975fc,_0x38dc30,!![]);}catch(_0x219e02){return BPromise['reject'](_0x219e02);}return _0x1975fc[_0x5ab7('0x21')]();};}function saveUpdates(_0x1ed9b9,_0x44bda3){return function(_0x5eca9d){if(_0x5eca9d){return _0x5eca9d['update'](_0x1ed9b9)[_0x5ab7('0x22')](function(_0x5519c3){return _0x5519c3;});}return null;};}function removeEntity(_0x8eb814,_0x6d36b5){return function(_0x3301f0){if(_0x3301f0){return _0x3301f0[_0x5ab7('0x23')]()['then'](function(){var _0x26f118=_0x3301f0[_0x5ab7('0x24')]({'plain':!![]});var _0x509130='IvrCampaigns';return db[_0x5ab7('0x25')]['destroy']({'where':{'type':_0x509130,'resourceId':_0x26f118['id']}})['then'](function(){return _0x3301f0;});})[_0x5ab7('0x22')](function(){_0x8eb814[_0x5ab7('0x1a')](0xcc)[_0x5ab7('0x1b')]();});}};}function handleEntityNotFound(_0x25bf65,_0x140a95){return function(_0x340298){if(!_0x340298){_0x25bf65[_0x5ab7('0x19')](0x194);}return _0x340298;};}function handleError(_0x5aece3,_0x38767d){_0x38767d=_0x38767d||0x1f4;return function(_0x20f930){logger[_0x5ab7('0x26')](_0x20f930[_0x5ab7('0x27')]);if(_0x20f930['name']){delete _0x20f930['name'];}_0x5aece3[_0x5ab7('0x1a')](_0x38767d)[_0x5ab7('0x28')](_0x20f930);};}exports[_0x5ab7('0x29')]=function(_0x55d02b,_0x4b2467){var _0x30667b={},_0x51ae7a={},_0xad975b={'count':0x0,'rows':[]};var _0x10ba78=_[_0x5ab7('0x2a')](db['Campaign'][_0x5ab7('0x2b')],function(_0x2b4a00){return{'name':_0x2b4a00[_0x5ab7('0x2c')],'type':_0x2b4a00[_0x5ab7('0x2d')][_0x5ab7('0x2e')]};});_0x51ae7a[_0x5ab7('0x2f')]=_['map'](_0x10ba78,_0x5ab7('0x30'));_0x51ae7a['query']=_['keys'](_0x55d02b['query']);_0x51ae7a[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0x51ae7a[_0x5ab7('0x2f')],_0x51ae7a[_0x5ab7('0x33')]);_0x30667b['attributes']=_[_0x5ab7('0x32')](_0x51ae7a['model'],qs[_0x5ab7('0x34')](_0x55d02b[_0x5ab7('0x33')]['fields']));_0x30667b[_0x5ab7('0x35')]=_0x30667b[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x30667b[_0x5ab7('0x35')]:_0x51ae7a['model'];if(!_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x30667b[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x55d02b['query'][_0x5ab7('0x1f')]);_0x30667b[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x1d')]);}_0x30667b['order']=qs[_0x5ab7('0x39')](_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x30667b[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x55d02b[_0x5ab7('0x33')],_0x51ae7a[_0x5ab7('0x31')]),_0x10ba78);if(_0x55d02b['query'][_0x5ab7('0x3c')]){_0x30667b[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x30667b['where'],{'$or':_['map'](_0x10ba78,function(_0x253d7d){if(_0x253d7d['type']!==_0x5ab7('0x3e')){var _0x1c612c={};_0x1c612c[_0x253d7d[_0x5ab7('0x30')]]={'$like':'%'+_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x1c612c;}})});}_0x30667b=_['merge']({},_0x30667b,_0x55d02b['options']);var _0x731544={'where':_0x30667b[_0x5ab7('0x3a')]};return db[_0x5ab7('0x3f')][_0x5ab7('0x40')](_0x731544)[_0x5ab7('0x22')](function(_0x1d7aa5){_0xad975b[_0x5ab7('0x40')]=_0x1d7aa5;if(_0x55d02b[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x30667b[_0x5ab7('0x42')]=[{'all':!![]}];}return db[_0x5ab7('0x3f')][_0x5ab7('0x43')](_0x30667b);})[_0x5ab7('0x22')](function(_0x3c0c0d){_0xad975b['rows']=_0x3c0c0d;return _0xad975b;})['then'](respondWithFilteredResult(_0x4b2467,_0x30667b))[_0x5ab7('0x44')](handleError(_0x4b2467,null));};exports[_0x5ab7('0x45')]=function(_0x26829a,_0x3673e6){var _0x570c65={'raw':![],'where':{'id':_0x26829a[_0x5ab7('0x46')]['id']}},_0x5c42c6={};_0x5c42c6['model']=_[_0x5ab7('0x47')](db[_0x5ab7('0x3f')][_0x5ab7('0x2b')]);_0x5c42c6['query']=_[_0x5ab7('0x47')](_0x26829a['query']);_0x5c42c6['filters']=_[_0x5ab7('0x32')](_0x5c42c6[_0x5ab7('0x2f')],_0x5c42c6[_0x5ab7('0x33')]);_0x570c65[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x5c42c6[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x26829a['query']['fields']));_0x570c65[_0x5ab7('0x35')]=_0x570c65[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x570c65[_0x5ab7('0x35')]:_0x5c42c6[_0x5ab7('0x2f')];if(_0x26829a[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x570c65[_0x5ab7('0x42')]=[{'all':!![]}];}_0x570c65=_[_0x5ab7('0x3d')]({},_0x570c65,_0x26829a[_0x5ab7('0x48')]);return db[_0x5ab7('0x3f')][_0x5ab7('0x49')](_0x570c65)[_0x5ab7('0x22')](handleEntityNotFound(_0x3673e6,null))[_0x5ab7('0x22')](respondWithResult(_0x3673e6,null))[_0x5ab7('0x44')](handleError(_0x3673e6,null));};exports[_0x5ab7('0x4a')]=function(_0x55e231,_0x2679c2){return db['Campaign'][_0x5ab7('0x4a')](_0x55e231[_0x5ab7('0x4b')],{})['then'](function(_0x1990ad){var _0x468224=_0x55e231[_0x5ab7('0x4c')]['get']({'plain':!![]});if(!_0x468224)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x468224['role']===_0x5ab7('0x4c')){var _0x467a17=_0x1990ad[_0x5ab7('0x24')]({'plain':!![]});var _0x1198dc=_0x5ab7('0x4d');return db[_0x5ab7('0x4e')][_0x5ab7('0x49')]({'where':{'name':_0x1198dc,'userProfileId':_0x468224[_0x5ab7('0x4f')]},'raw':!![]})[_0x5ab7('0x22')](function(_0x2bd10e){if(_0x2bd10e&&_0x2bd10e[_0x5ab7('0x50')]===0x0){return db[_0x5ab7('0x25')][_0x5ab7('0x4a')]({'name':_0x467a17['name'],'resourceId':_0x467a17['id'],'type':_0x2bd10e[_0x5ab7('0x30')],'sectionId':_0x2bd10e['id']},{})[_0x5ab7('0x22')](function(){return _0x1990ad;});}else{return _0x1990ad;}})[_0x5ab7('0x44')](function(_0x14c5ad){logger[_0x5ab7('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14c5ad);throw _0x14c5ad;});}return _0x1990ad;})[_0x5ab7('0x22')](respondWithResult(_0x2679c2,0xc9))[_0x5ab7('0x44')](handleError(_0x2679c2,null));};exports[_0x5ab7('0x51')]=function(_0x37c162,_0x18a41c){var _0x28abfb={'where':{'id':_0x37c162['params']['id']}},_0x13a92a={};_0x13a92a[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db['Campaign'][_0x5ab7('0x2b')]);_0x28abfb['attributes']=_[_0x5ab7('0x32')](_0x13a92a[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x37c162[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x28abfb[_0x5ab7('0x35')]=_0x28abfb[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x28abfb['attributes']:_0x13a92a[_0x5ab7('0x2f')];if(_0x37c162[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x28abfb[_0x5ab7('0x42')]=[{'all':!![]}];}_0x28abfb=_[_0x5ab7('0x3d')]({},_0x28abfb,_0x37c162[_0x5ab7('0x48')]);return db[_0x5ab7('0x3f')][_0x5ab7('0x49')](_0x28abfb)[_0x5ab7('0x22')](handleEntityNotFound(_0x18a41c,null))['then'](function(_0x594f02){if(_0x594f02){var _0x2a7cf3=_0x594f02[_0x5ab7('0x24')]({'plain':!![]});_0x2a7cf3=qs[_0x5ab7('0x52')](_0x2a7cf3,['id',_0x5ab7('0x53'),'updatedAt']);_0x37c162[_0x5ab7('0x4b')]=_[_0x5ab7('0x52')](_0x37c162[_0x5ab7('0x4b')],['id',_0x5ab7('0x53'),_0x5ab7('0x54')]);return db[_0x5ab7('0x3f')][_0x5ab7('0x4a')](_[_0x5ab7('0x3d')](_0x2a7cf3,_0x37c162[_0x5ab7('0x4b')]),{'include':_0x37c162['query'][_0x5ab7('0x41')]?[{'all':!![]}]:undefined})[_0x5ab7('0x22')](function(_0x44dddc){var _0x23dfe6=_0x37c162[_0x5ab7('0x4c')]['get']({'plain':!![]});if(!_0x23dfe6)throw new Error(_0x5ab7('0x55'));if(_0x23dfe6['role']==='user'){var _0x4eac40=_0x44dddc[_0x5ab7('0x24')]({'plain':!![]});var _0x31a47a=_0x5ab7('0x4d');return db['UserProfileSection'][_0x5ab7('0x49')]({'where':{'name':_0x31a47a,'userProfileId':_0x23dfe6[_0x5ab7('0x4f')]},'raw':!![]})['then'](function(_0x4d5bef){if(_0x4d5bef&&_0x4d5bef[_0x5ab7('0x50')]===0x0){return db[_0x5ab7('0x25')]['create']({'name':_0x4eac40[_0x5ab7('0x30')],'resourceId':_0x4eac40['id'],'type':_0x4d5bef[_0x5ab7('0x30')],'sectionId':_0x4d5bef['id']},{})[_0x5ab7('0x22')](function(){return _0x44dddc;});}else{return _0x44dddc;}})['catch'](function(_0x3d388f){logger[_0x5ab7('0x26')](_0x5ab7('0x56'),_0x3d388f);throw _0x3d388f;});}return _0x44dddc;});}})[_0x5ab7('0x22')](respondWithResult(_0x18a41c,0xc9))[_0x5ab7('0x44')](handleError(_0x18a41c,null));};exports[_0x5ab7('0x57')]=function(_0x158587,_0x1c411c){if(_0x158587['body']['id']){delete _0x158587[_0x5ab7('0x4b')]['id'];}return db[_0x5ab7('0x3f')]['find']({'where':{'id':_0x158587[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x1c411c,null))[_0x5ab7('0x22')](saveUpdates(_0x158587['body'],null))[_0x5ab7('0x22')](respondWithResult(_0x1c411c,null))[_0x5ab7('0x44')](handleError(_0x1c411c,null));};exports['destroy']=function(_0x59dc04,_0x33f3c4){return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x59dc04[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x33f3c4,null))[_0x5ab7('0x22')](removeEntity(_0x33f3c4,null))[_0x5ab7('0x44')](handleError(_0x33f3c4,null));};exports['getHoppers']=function(_0x3b101f,_0x141ff8,_0x40d85c){var _0x1f9eff={'raw':!![],'where':{}};var _0x4bf414={};var _0x5d5c29={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x3b101f[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x141ff8,null))['then'](function(_0x11547a){if(_0x11547a){_0x4bf414['model']=_[_0x5ab7('0x47')](db[_0x5ab7('0x59')][_0x5ab7('0x2b')]);_0x4bf414[_0x5ab7('0x33')]=_[_0x5ab7('0x47')](_0x3b101f['query']);_0x4bf414[_0x5ab7('0x31')]=_['intersection'](_0x4bf414['model'],_0x4bf414['query']);_0x1f9eff['attributes']=_[_0x5ab7('0x32')](_0x4bf414[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x3b101f[_0x5ab7('0x33')]['fields']));_0x1f9eff['attributes']=_0x1f9eff[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x1f9eff['attributes']:_0x4bf414['model'];if(!_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x37')]('nolimit')){_0x1f9eff[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x3b101f['query'][_0x5ab7('0x1f')]);_0x1f9eff[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x3b101f['query'][_0x5ab7('0x1d')]);}_0x1f9eff[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x1f9eff[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x3b101f[_0x5ab7('0x33')],_0x4bf414[_0x5ab7('0x31')]));_0x1f9eff['where'][_0x5ab7('0x5b')]=_0x11547a['id'];if(_0x3b101f['query'][_0x5ab7('0x3c')]){_0x1f9eff[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x1f9eff['where'],{'$or':_[_0x5ab7('0x2a')](_0x1f9eff['attributes'],function(_0x1d76d0){var _0x5b9887={};_0x5b9887[_0x1d76d0]={'$like':'%'+_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x5b9887;})});}_0x1f9eff=_[_0x5ab7('0x3d')]({},_0x1f9eff,_0x3b101f[_0x5ab7('0x48')]);return db[_0x5ab7('0x59')][_0x5ab7('0x40')]({'where':_0x1f9eff['where']})[_0x5ab7('0x22')](function(_0x32e0e9){_0x5d5c29['count']=_0x32e0e9;if(_0x3b101f[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x1f9eff['include']=[{'all':!![]}];}return db[_0x5ab7('0x59')]['findAll'](_0x1f9eff);})[_0x5ab7('0x22')](function(_0x555113){_0x5d5c29[_0x5ab7('0x5c')]=_0x555113;return _0x5d5c29;});}})['then'](respondWithFilteredResult(_0x141ff8,_0x1f9eff))[_0x5ab7('0x44')](handleError(_0x141ff8,null));};exports[_0x5ab7('0x5d')]=function(_0x419af4,_0x589db7,_0x6ee259){var _0x56555e={'raw':!![],'where':{}};var _0x1c9810={};var _0xbd1b79={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x419af4[_0x5ab7('0x46')]['id']}})['then'](handleEntityNotFound(_0x589db7,null))['then'](function(_0x49c7db){if(_0x49c7db){_0x1c9810[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db[_0x5ab7('0x5e')][_0x5ab7('0x2b')]);_0x1c9810[_0x5ab7('0x33')]=_['keys'](_0x419af4[_0x5ab7('0x33')]);_0x1c9810[_0x5ab7('0x31')]=_['intersection'](_0x1c9810[_0x5ab7('0x2f')],_0x1c9810[_0x5ab7('0x33')]);_0x56555e[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x1c9810[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x419af4['query'][_0x5ab7('0x34')]));_0x56555e[_0x5ab7('0x35')]=_0x56555e['attributes']['length']?_0x56555e[_0x5ab7('0x35')]:_0x1c9810[_0x5ab7('0x2f')];if(!_0x419af4['query'][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x56555e[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0x56555e[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x419af4[_0x5ab7('0x33')]['offset']);}_0x56555e[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x56555e[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x419af4[_0x5ab7('0x33')],_0x1c9810[_0x5ab7('0x31')]));_0x56555e[_0x5ab7('0x3a')]['CampaignId']=_0x49c7db['id'];if(_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0x56555e[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x56555e[_0x5ab7('0x3a')],{'$or':_[_0x5ab7('0x2a')](_0x56555e[_0x5ab7('0x35')],function(_0x79f4f0){var _0x3af97b={};_0x3af97b[_0x79f4f0]={'$like':'%'+_0x419af4[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x3af97b;})});}_0x56555e=_['merge']({},_0x56555e,_0x419af4[_0x5ab7('0x48')]);return db[_0x5ab7('0x5e')][_0x5ab7('0x40')]({'where':_0x56555e[_0x5ab7('0x3a')]})[_0x5ab7('0x22')](function(_0x50da5f){_0xbd1b79['count']=_0x50da5f;if(_0x419af4['query'][_0x5ab7('0x41')]){_0x56555e['include']=[{'all':!![]}];}return db[_0x5ab7('0x5e')][_0x5ab7('0x43')](_0x56555e);})[_0x5ab7('0x22')](function(_0x365800){_0xbd1b79['rows']=_0x365800;return _0xbd1b79;});}})[_0x5ab7('0x22')](respondWithFilteredResult(_0x589db7,_0x56555e))['catch'](handleError(_0x589db7,null));};exports[_0x5ab7('0x5f')]=function(_0x5c3306,_0x5a6d52,_0x34c66d){var _0x54ecc5={'raw':!![],'where':{}};var _0x288553={};var _0x4ac4e5={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x5c3306[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x5a6d52,null))[_0x5ab7('0x22')](function(_0x54ca11){if(_0x54ca11){_0x288553[_0x5ab7('0x2f')]=_['keys'](db[_0x5ab7('0x60')][_0x5ab7('0x2b')]);_0x288553[_0x5ab7('0x33')]=_['keys'](_0x5c3306[_0x5ab7('0x33')]);_0x288553[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0x288553[_0x5ab7('0x2f')],_0x288553[_0x5ab7('0x33')]);_0x54ecc5[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x288553[_0x5ab7('0x2f')],qs[_0x5ab7('0x34')](_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x54ecc5[_0x5ab7('0x35')]=_0x54ecc5[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0x54ecc5[_0x5ab7('0x35')]:_0x288553['model'];if(!_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x54ecc5['limit']=qs[_0x5ab7('0x1f')](_0x5c3306[_0x5ab7('0x33')]['limit']);_0x54ecc5[_0x5ab7('0x1d')]=qs['offset'](_0x5c3306[_0x5ab7('0x33')]['offset']);}_0x54ecc5[_0x5ab7('0x5a')]=qs['sort'](_0x5c3306['query'][_0x5ab7('0x39')]);_0x54ecc5[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_['pick'](_0x5c3306[_0x5ab7('0x33')],_0x288553[_0x5ab7('0x31')]));_0x54ecc5[_0x5ab7('0x3a')][_0x5ab7('0x5b')]=_0x54ca11['id'];if(_0x5c3306[_0x5ab7('0x33')]['filter']){_0x54ecc5[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0x54ecc5['where'],{'$or':_[_0x5ab7('0x2a')](_0x54ecc5[_0x5ab7('0x35')],function(_0xa2652f){var _0x39df84={};_0x39df84[_0xa2652f]={'$like':'%'+_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x39df84;})});}_0x54ecc5=_[_0x5ab7('0x3d')]({},_0x54ecc5,_0x5c3306[_0x5ab7('0x48')]);return db[_0x5ab7('0x60')][_0x5ab7('0x40')]({'where':_0x54ecc5['where']})['then'](function(_0x39a276){_0x4ac4e5[_0x5ab7('0x40')]=_0x39a276;if(_0x5c3306[_0x5ab7('0x33')][_0x5ab7('0x41')]){_0x54ecc5[_0x5ab7('0x42')]=[{'all':!![]}];}return db[_0x5ab7('0x60')][_0x5ab7('0x43')](_0x54ecc5);})[_0x5ab7('0x22')](function(_0x4c19f8){_0x4ac4e5[_0x5ab7('0x5c')]=_0x4c19f8;return _0x4ac4e5;});}})[_0x5ab7('0x22')](respondWithFilteredResult(_0x5a6d52,_0x54ecc5))[_0x5ab7('0x44')](handleError(_0x5a6d52,null));};exports[_0x5ab7('0x61')]=function(_0x3217c,_0xd04342,_0x18dbd2){var _0x16a96e={'raw':!![],'where':{}};var _0x13492e={};var _0x4a5cca={'count':0x0,'rows':[]};return db[_0x5ab7('0x3f')][_0x5ab7('0x58')]({'where':{'id':_0x3217c[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0xd04342,null))['then'](function(_0x76c041){if(_0x76c041){_0x13492e[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db[_0x5ab7('0x62')]['rawAttributes']);_0x13492e[_0x5ab7('0x33')]=_['keys'](_0x3217c[_0x5ab7('0x33')]);_0x13492e[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0x13492e['model'],_0x13492e['query']);_0x16a96e[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x13492e[_0x5ab7('0x2f')],qs['fields'](_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x16a96e['attributes']=_0x16a96e['attributes'][_0x5ab7('0x36')]?_0x16a96e[_0x5ab7('0x35')]:_0x13492e[_0x5ab7('0x2f')];if(!_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x16a96e[_0x5ab7('0x1f')]=qs['limit'](_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0x16a96e['offset']=qs[_0x5ab7('0x1d')](_0x3217c['query']['offset']);}_0x16a96e[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0x16a96e[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x3217c[_0x5ab7('0x33')],_0x13492e['filters']));_0x16a96e[_0x5ab7('0x3a')]['CampaignId']=_0x76c041['id'];if(_0x3217c[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0x16a96e[_0x5ab7('0x3a')]=_['merge'](_0x16a96e[_0x5ab7('0x3a')],{'$or':_['map'](_0x16a96e[_0x5ab7('0x35')],function(_0x43ade1){var _0x53a879={};_0x53a879[_0x43ade1]={'$like':'%'+_0x3217c['query'][_0x5ab7('0x3c')]+'%'};return _0x53a879;})});}_0x16a96e=_['merge']({},_0x16a96e,_0x3217c[_0x5ab7('0x48')]);return db[_0x5ab7('0x62')][_0x5ab7('0x40')]({'where':_0x16a96e['where']})[_0x5ab7('0x22')](function(_0x4f26ff){_0x4a5cca[_0x5ab7('0x40')]=_0x4f26ff;if(_0x3217c['query']['includeAll']){_0x16a96e[_0x5ab7('0x42')]=[{'all':!![]}];}return db[_0x5ab7('0x62')][_0x5ab7('0x43')](_0x16a96e);})['then'](function(_0x52b3df){_0x4a5cca['rows']=_0x52b3df;return _0x4a5cca;});}})[_0x5ab7('0x22')](respondWithFilteredResult(_0xd04342,_0x16a96e))['catch'](handleError(_0xd04342,null));};exports[_0x5ab7('0x63')]=function(_0xcdebd,_0x1ca922,_0x33b3dc){var _0xabc5eb={};var _0x19ae24={};var _0xe316de;var _0x53dc1d;return db[_0x5ab7('0x3f')]['findOne']({'where':{'id':_0xcdebd[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x1ca922,null))['then'](function(_0x96c201){if(_0x96c201){_0xe316de=_0x96c201;_0x19ae24[_0x5ab7('0x2f')]=_[_0x5ab7('0x47')](db[_0x5ab7('0x64')][_0x5ab7('0x2b')]);_0x19ae24[_0x5ab7('0x33')]=_[_0x5ab7('0x47')](_0xcdebd['query']);_0x19ae24[_0x5ab7('0x31')]=_['intersection'](_0x19ae24[_0x5ab7('0x2f')],_0x19ae24['query']);_0xabc5eb[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0x19ae24['model'],qs[_0x5ab7('0x34')](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0xabc5eb[_0x5ab7('0x35')]=_0xabc5eb[_0x5ab7('0x35')][_0x5ab7('0x36')]?_0xabc5eb[_0x5ab7('0x35')]:_0x19ae24[_0x5ab7('0x2f')];_0xabc5eb[_0x5ab7('0x5a')]=qs['sort'](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x39')]);_0xabc5eb['where']=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0xcdebd['query'],_0x19ae24[_0x5ab7('0x31')]));if(_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0xabc5eb[_0x5ab7('0x3a')]=_[_0x5ab7('0x3d')](_0xabc5eb['where'],{'$or':_[_0x5ab7('0x2a')](_0xabc5eb[_0x5ab7('0x35')],function(_0x558611){var _0x1d0d1f={};_0x1d0d1f[_0x558611]={'$like':'%'+_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x1d0d1f;})});}_0xabc5eb=_['merge']({},_0xabc5eb,_0xcdebd[_0x5ab7('0x48')]);return _0xe316de['getLists'](_0xabc5eb);}})[_0x5ab7('0x22')](function(_0x5a71de){if(_0x5a71de){_0x53dc1d=_0x5a71de[_0x5ab7('0x36')];if(!_0xcdebd[_0x5ab7('0x33')]['hasOwnProperty'](_0x5ab7('0x38'))){_0xabc5eb[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0xabc5eb['offset']=qs[_0x5ab7('0x1d')](_0xcdebd[_0x5ab7('0x33')][_0x5ab7('0x1d')]);}return _0xe316de[_0x5ab7('0x63')](_0xabc5eb);}})[_0x5ab7('0x22')](function(_0x5b6655){if(_0x5b6655){return _0x5b6655?{'count':_0x53dc1d,'rows':_0x5b6655}:null;}})[_0x5ab7('0x22')](respondWithResult(_0x1ca922,null))[_0x5ab7('0x44')](handleError(_0x1ca922,null));};exports[_0x5ab7('0x65')]=function(_0x3c6dfa,_0x30555f,_0x50cd03){var _0x244715,_0x4be3b4;var _0x367038=[];var _0x4e4147=moment()[_0x5ab7('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x3c6dfa[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x30555f,null))['then'](function(_0x5587f5){if(_0x5587f5){_0x4be3b4=_0x5587f5;return _0x5587f5['addLists'](_0x3c6dfa[_0x5ab7('0x4b')][_0x5ab7('0x67')],_['omit'](_0x3c6dfa[_0x5ab7('0x4b')],['ids','id'])||{});}return null;})[_0x5ab7('0x68')](function(_0x303bf7){var _0x13d39b;var _0x20e151;_0x244715=_0x303bf7||[];var _0x546a5b=[];if(_0x303bf7){for(var _0x481aa8=0x0;_0x481aa8<_0x303bf7[_0x5ab7('0x36')];_0x481aa8+=0x1){var _0x21c2e6=_0x303bf7[_0x481aa8][_0x5ab7('0x24')]({'plain':!![]});_0x4be3b4[_0x5ab7('0x69')]=_0x3c6dfa[_0x5ab7('0x4b')][_0x5ab7('0x69')]?_0x3c6dfa[_0x5ab7('0x4b')]['dialCheckDuplicateType']:_0x4be3b4[_0x5ab7('0x69')];switch(_0x4be3b4['dialCheckDuplicateType']){case _0x5ab7('0x6a'):_0x13d39b=squel['insert']()['into'](_0x5ab7('0x6b'))[_0x5ab7('0x6c')](['phone',_0x5ab7('0x6d'),_0x5ab7('0x6e'),_0x5ab7('0x6f'),'CampaignId',_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x72'),_0x5ab7('0x72'))[_0x5ab7('0x71')](_0x5ab7('0x73'),_0x5ab7('0x6d'))[_0x5ab7('0x71')]('id',_0x5ab7('0x6e'))['field'](_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')](),_0x5ab7('0x6f'))[_0x5ab7('0x71')](_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27',_0x5ab7('0x53'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','updatedAt')[_0x5ab7('0x76')](_0x5ab7('0x77'))[_0x5ab7('0x3a')](_0x5ab7('0x78'))[_0x5ab7('0x3a')](_0x5ab7('0x79'),_0x21c2e6[_0x5ab7('0x74')]['toString']())[_0x5ab7('0x3a')](_0x5ab7('0x7a'))['where'](_0x5ab7('0x7b'),squel[_0x5ab7('0x70')]()['field'](_0x5ab7('0x7c'))['from'](_0x5ab7('0x7d'))['where']('CampaignId\x20=\x20?',_0x3c6dfa[_0x5ab7('0x46')]['id']['toString']()))[_0x5ab7('0x3a')](_0x5ab7('0x7b'),squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x7e'))[_0x5ab7('0x76')](_0x5ab7('0x6b'))['where'](_0x5ab7('0x7f'),_0x3c6dfa[_0x5ab7('0x46')]['id']['toString']())))['toString']();break;case _0x5ab7('0x80'):_0x13d39b=squel[_0x5ab7('0x81')]()[_0x5ab7('0x82')](_0x5ab7('0x6b'))['fromQuery']([_0x5ab7('0x72'),'scheduledAt',_0x5ab7('0x6e'),_0x5ab7('0x6f'),_0x5ab7('0x5b'),_0x5ab7('0x53'),_0x5ab7('0x54')],squel['select']()['field'](_0x5ab7('0x72'),'phone')[_0x5ab7('0x71')](_0x5ab7('0x73'),_0x5ab7('0x6d'))[_0x5ab7('0x71')]('id',_0x5ab7('0x6e'))['field'](_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')](),_0x5ab7('0x6f'))[_0x5ab7('0x71')](_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','createdAt')[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','updatedAt')[_0x5ab7('0x76')]('cm_contacts')[_0x5ab7('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x5ab7('0x79'),_0x21c2e6[_0x5ab7('0x74')]['toString']())[_0x5ab7('0x3a')](_0x5ab7('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x7e'))[_0x5ab7('0x76')]('cm_hopper')[_0x5ab7('0x3a')](_0x5ab7('0x7f'),_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')]())))[_0x5ab7('0x75')]();break;default:_0x13d39b=squel[_0x5ab7('0x81')]()[_0x5ab7('0x82')]('cm_hopper')[_0x5ab7('0x6c')]([_0x5ab7('0x72'),_0x5ab7('0x6d'),_0x5ab7('0x6e'),_0x5ab7('0x6f'),_0x5ab7('0x5b'),_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')]('phone',_0x5ab7('0x72'))['field'](_0x5ab7('0x73'),_0x5ab7('0x6d'))['field']('id',_0x5ab7('0x6e'))[_0x5ab7('0x71')](_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')](),_0x5ab7('0x6f'))['field'](_0x3c6dfa[_0x5ab7('0x46')]['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','createdAt')[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27','updatedAt')[_0x5ab7('0x76')](_0x5ab7('0x77'))['where'](_0x5ab7('0x78'))[_0x5ab7('0x3a')]('ListId\x20=\x20?',_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')]())[_0x5ab7('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x5ab7('0x75')]();}_0x20e151=squel['insert']()[_0x5ab7('0x82')](_0x5ab7('0x83'))[_0x5ab7('0x6c')]([_0x5ab7('0x84'),_0x5ab7('0x6d'),_0x5ab7('0x72'),'OrderBy',_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')](_0x5ab7('0x85'),'id')[_0x5ab7('0x71')]('NOW()',_0x5ab7('0x6d'))[_0x5ab7('0x71')](_0x5ab7('0x86'),'phone')['field'](_0x5ab7('0x87'),_0x5ab7('0x88'))['field']('\x27'+_0x4e4147+'\x27',_0x5ab7('0x53'))[_0x5ab7('0x71')]('\x27'+_0x4e4147+'\x27',_0x5ab7('0x54'))[_0x5ab7('0x76')](_0x5ab7('0x89'),'ci')['join'](_0x5ab7('0x6b'),'h',_0x5ab7('0x8a'))[_0x5ab7('0x3a')](_0x5ab7('0x8b'),_0x21c2e6[_0x5ab7('0x74')][_0x5ab7('0x75')]())['where'](_0x5ab7('0x8c'),_0x3c6dfa[_0x5ab7('0x46')]['id']['toString']())[_0x5ab7('0x3a')](_0x5ab7('0x8d'),_0x4e4147))[_0x5ab7('0x75')]();_0x546a5b[_0x5ab7('0x8e')](db[_0x5ab7('0x8f')][_0x5ab7('0x33')](_0x13d39b));_0x367038['push'](db[_0x5ab7('0x8f')][_0x5ab7('0x33')](_0x20e151));}return BPromise[_0x5ab7('0x90')](_0x546a5b);}})[_0x5ab7('0x22')](function(){return BPromise['all'](_0x367038);})[_0x5ab7('0x22')](function(){return _0x244715;})[_0x5ab7('0x22')](respondWithResult(_0x30555f,null))[_0x5ab7('0x44')](handleError(_0x30555f,null));};exports[_0x5ab7('0x91')]=function(_0x48710a,_0x429a9f,_0x21f4b7){return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x48710a[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x429a9f,null))['then'](function(_0x502245){if(_0x502245){return _0x502245[_0x5ab7('0x91')](_0x48710a[_0x5ab7('0x33')]['ids']);}})['then'](function(_0x1e6783){if(_0x1e6783){return db[_0x5ab7('0x59')][_0x5ab7('0x23')]({'where':{'ListId':_0x48710a[_0x5ab7('0x33')]['ids'],'CampaignId':_0x48710a['params']['id']}})['then'](function(){return _0x1e6783;});}})[_0x5ab7('0x22')](respondWithStatusCode(_0x429a9f,null))[_0x5ab7('0x44')](handleError(_0x429a9f,null));};exports[_0x5ab7('0x92')]=function(_0x349f87,_0x3e410b,_0x3f54c3){var _0x2f427e={};var _0xbe126d={};var _0x321fa3;var _0x4c741b;return db[_0x5ab7('0x3f')]['findOne']({'where':{'id':_0x349f87['params']['id']}})['then'](handleEntityNotFound(_0x3e410b,null))[_0x5ab7('0x22')](function(_0x904fea){if(_0x904fea){_0x321fa3=_0x904fea;_0xbe126d[_0x5ab7('0x2f')]=_['keys'](db['CmList'][_0x5ab7('0x2b')]);_0xbe126d['query']=_[_0x5ab7('0x47')](_0x349f87[_0x5ab7('0x33')]);_0xbe126d[_0x5ab7('0x31')]=_[_0x5ab7('0x32')](_0xbe126d['model'],_0xbe126d['query']);_0x2f427e[_0x5ab7('0x35')]=_[_0x5ab7('0x32')](_0xbe126d['model'],qs['fields'](_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x34')]));_0x2f427e[_0x5ab7('0x35')]=_0x2f427e[_0x5ab7('0x35')]['length']?_0x2f427e[_0x5ab7('0x35')]:_0xbe126d['model'];_0x2f427e[_0x5ab7('0x5a')]=qs[_0x5ab7('0x39')](_0x349f87['query']['sort']);_0x2f427e[_0x5ab7('0x3a')]=qs[_0x5ab7('0x31')](_[_0x5ab7('0x3b')](_0x349f87['query'],_0xbe126d[_0x5ab7('0x31')]));if(_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x3c')]){_0x2f427e['where']=_[_0x5ab7('0x3d')](_0x2f427e[_0x5ab7('0x3a')],{'$or':_[_0x5ab7('0x2a')](_0x2f427e[_0x5ab7('0x35')],function(_0x947e21){var _0x166145={};_0x166145[_0x947e21]={'$like':'%'+_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x3c')]+'%'};return _0x166145;})});}_0x2f427e=_['merge']({},_0x2f427e,_0x349f87[_0x5ab7('0x48')]);return _0x321fa3[_0x5ab7('0x92')](_0x2f427e);}})[_0x5ab7('0x22')](function(_0x816db){if(_0x816db){_0x4c741b=_0x816db[_0x5ab7('0x36')];if(!_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x37')](_0x5ab7('0x38'))){_0x2f427e[_0x5ab7('0x1f')]=qs[_0x5ab7('0x1f')](_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x1f')]);_0x2f427e[_0x5ab7('0x1d')]=qs[_0x5ab7('0x1d')](_0x349f87[_0x5ab7('0x33')][_0x5ab7('0x1d')]);}return _0x321fa3[_0x5ab7('0x92')](_0x2f427e);}})['then'](function(_0x561647){if(_0x561647){return _0x561647?{'count':_0x4c741b,'rows':_0x561647}:null;}})['then'](respondWithResult(_0x3e410b,null))[_0x5ab7('0x44')](handleError(_0x3e410b,null));};exports[_0x5ab7('0x93')]=function(_0x394324,_0x214d37,_0x21d32b){var _0x51c231,_0x3b126e;var _0x3780b7=[];var _0x20ae13=moment()[_0x5ab7('0x66')](_0x5ab7('0x94'));return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x394324[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x214d37,null))[_0x5ab7('0x22')](function(_0x4e4a43){if(_0x4e4a43){_0x3b126e=_0x4e4a43;return _0x4e4a43[_0x5ab7('0x93')](_0x394324['body'][_0x5ab7('0x67')],_[_0x5ab7('0x52')](_0x394324[_0x5ab7('0x4b')],[_0x5ab7('0x67'),'id'])||{});}return null;})[_0x5ab7('0x68')](function(_0x4a37cc){var _0x2063c4;var _0x57a1b3;_0x51c231=_0x4a37cc||[];var _0x9295a0=[];if(_0x4a37cc){for(var _0x5ade22=0x0;_0x5ade22<_0x4a37cc[_0x5ab7('0x36')];_0x5ade22+=0x1){var _0xbc3696=_0x4a37cc[_0x5ade22][_0x5ab7('0x24')]({'plain':!![]});_0x2063c4=squel[_0x5ab7('0x81')]()[_0x5ab7('0x82')](_0x5ab7('0x95'))[_0x5ab7('0x6c')](['phone',_0x5ab7('0x6e'),_0x5ab7('0x6f'),_0x5ab7('0x5b'),_0x5ab7('0x53'),_0x5ab7('0x54')],squel[_0x5ab7('0x70')]()[_0x5ab7('0x71')]('phone',_0x5ab7('0x72'))[_0x5ab7('0x71')]('id','ContactId')[_0x5ab7('0x71')](_0xbc3696['CmListId'][_0x5ab7('0x75')](),_0x5ab7('0x6f'))[_0x5ab7('0x71')](_0x394324['params']['id'][_0x5ab7('0x75')](),_0x5ab7('0x5b'))['field']('NOW()',_0x5ab7('0x53'))[_0x5ab7('0x71')]('NOW()',_0x5ab7('0x54'))['from']('cm_contacts')[_0x5ab7('0x3a')](_0x5ab7('0x78'))[_0x5ab7('0x3a')](_0x5ab7('0x79'),_0xbc3696['CmListId'][_0x5ab7('0x75')]())[_0x5ab7('0x3a')](_0x5ab7('0x7a')))[_0x5ab7('0x75')]();_0x9295a0[_0x5ab7('0x8e')](db['sequelize']['query'](_0x2063c4));}return BPromise[_0x5ab7('0x90')](_0x9295a0);}})['then'](function(){return _0x51c231;})[_0x5ab7('0x22')](respondWithResult(_0x214d37,null))['catch'](handleError(_0x214d37,null));};exports[_0x5ab7('0x96')]=function(_0x265a06,_0x107a8b,_0x2f02de){return db[_0x5ab7('0x3f')][_0x5ab7('0x49')]({'where':{'id':_0x265a06[_0x5ab7('0x46')]['id']}})[_0x5ab7('0x22')](handleEntityNotFound(_0x107a8b,null))[_0x5ab7('0x22')](function(_0x501a68){if(_0x501a68){return _0x501a68[_0x5ab7('0x96')](_0x265a06[_0x5ab7('0x33')][_0x5ab7('0x67')]);}})[_0x5ab7('0x22')](function(_0x385013){if(_0x385013){return db[_0x5ab7('0x62')][_0x5ab7('0x23')]({'where':{'ListId':_0x265a06[_0x5ab7('0x33')][_0x5ab7('0x67')],'CampaignId':_0x265a06[_0x5ab7('0x46')]['id']}})['then'](function(){return _0x385013;});}})[_0x5ab7('0x22')](respondWithStatusCode(_0x107a8b,null))[_0x5ab7('0x44')](handleError(_0x107a8b,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5daaec1..53065f2 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1d7b16,_0x168739){var _0x59d484=function(_0x3701f4){while(--_0x3701f4){_0x1d7b16['push'](_0x1d7b16['shift']());}};_0x59d484(++_0x168739);}(_0x7a54,0x106));var _0x47a5=function(_0x1bc1f0,_0x55e83e){_0x1bc1f0=_0x1bc1f0-0x0;var _0x2c03fa=_0x7a54[_0x1bc1f0];return _0x2c03fa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index b1668f1..60cf852 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 _0x9f94=['attributes','limit','include','model','map','then','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Campaign,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw'];(function(_0x23c570,_0x409767){var _0x332765=function(_0x2d5448){while(--_0x2d5448){_0x23c570['push'](_0x23c570['shift']());}};_0x332765(++_0x409767);}(_0x9f94,0x1e7));var _0x49f9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9f94[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Campaign,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Campaign,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Campaign,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});}exports[_0x49f9('0x14')]=function(_0x509610){var _0x3cc45e=this;return new Promise(function(_0x359d48,_0x32568b){return db[_0x49f9('0x15')][_0x49f9('0x16')]({'raw':_0x509610[_0x49f9('0x17')]?_0x509610[_0x49f9('0x17')][_0x49f9('0x18')]===undefined?!![]:![]:!![],'where':_0x509610[_0x49f9('0x17')]?_0x509610['options']['where']||null:null,'attributes':_0x509610[_0x49f9('0x17')]?_0x509610['options'][_0x49f9('0x19')]||null:null,'limit':_0x509610['options']?_0x509610['options'][_0x49f9('0x1a')]||null:null,'include':_0x509610[_0x49f9('0x17')]?_0x509610['options'][_0x49f9('0x1b')]?_['map'](_0x509610['options'][_0x49f9('0x1b')],function(_0xaadbfc){return{'model':db[_0xaadbfc['model']],'as':_0xaadbfc['as'],'attributes':_0xaadbfc[_0x49f9('0x19')],'include':_0xaadbfc[_0x49f9('0x1b')]?_['map'](_0xaadbfc[_0x49f9('0x1b')],function(_0x184b85){return{'model':db[_0x184b85[_0x49f9('0x1c')]],'as':_0x184b85['as'],'attributes':_0x184b85[_0x49f9('0x19')],'include':_0x184b85['include']?_[_0x49f9('0x1d')](_0x184b85[_0x49f9('0x1b')],function(_0x126aa2){return{'model':db[_0x126aa2[_0x49f9('0x1c')]],'as':_0x126aa2['as'],'attributes':_0x126aa2[_0x49f9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x49f9('0x1e')](function(_0x271ad2){logger['info']('GetCampaign',_0x509610);logger[_0x49f9('0xd')](_0x49f9('0x14'),_0x509610,JSON[_0x49f9('0x1f')](_0x271ad2));_0x359d48(_0x271ad2);})[_0x49f9('0x13')](function(_0x51adc3){logger[_0x49f9('0xe')](_0x49f9('0x14'),_0x51adc3[_0x49f9('0x10')],_0x509610);_0x32568b(_0x3cc45e['error'](0x1f4,_0x51adc3[_0x49f9('0x10')]));});});}; \ No newline at end of file +var _0x0cee=['stringify','error','code','message','result','catch','GetCampaign','options','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x4d4a6e,_0x5c53cc){var _0x3a4b64=function(_0x407be7){while(--_0x407be7){_0x4d4a6e['push'](_0x4d4a6e['shift']());}};_0x3a4b64(++_0x5c53cc);}(_0x0cee,0x12f));var _0xe0ce=function(_0x5dab2c,_0x22f580){_0x5dab2c=_0x5dab2c-0x0;var _0x499aae=_0x0cee[_0x5dab2c];return _0x499aae;};'use strict';var _=require(_0xe0ce('0x0'));var util=require(_0xe0ce('0x1'));var moment=require(_0xe0ce('0x2'));var BPromise=require(_0xe0ce('0x3'));var rs=require(_0xe0ce('0x4'));var fs=require('fs');var Redis=require(_0xe0ce('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe0ce('0x6'))(_0xe0ce('0x7'));var config=require(_0xe0ce('0x8'));var jayson=require(_0xe0ce('0x9'));var client=jayson[_0xe0ce('0xa')][_0xe0ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x64f82c,_0x415f34,_0x494eca){return new BPromise(function(_0x27eea3,_0x2fa936){return client['request'](_0x64f82c,_0x494eca)[_0xe0ce('0xc')](function(_0x94afeb){logger[_0xe0ce('0xd')](_0xe0ce('0xe'),_0x415f34,'request\x20sent');logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x415f34,_0xe0ce('0xf'),JSON[_0xe0ce('0x10')](_0x94afeb));if(_0x94afeb[_0xe0ce('0x11')]){if(_0x94afeb[_0xe0ce('0x11')][_0xe0ce('0x12')]===0x1f4){logger[_0xe0ce('0x11')](_0xe0ce('0xe'),_0x415f34,_0x94afeb[_0xe0ce('0x11')][_0xe0ce('0x13')]);return _0x2fa936(_0x94afeb[_0xe0ce('0x11')][_0xe0ce('0x13')]);}logger[_0xe0ce('0x11')]('Campaign,\x20%s,\x20%s',_0x415f34,_0x94afeb['error'][_0xe0ce('0x13')]);return _0x27eea3(_0x94afeb[_0xe0ce('0x11')]['message']);}else{logger['info'](_0xe0ce('0xe'),_0x415f34,_0xe0ce('0xf'));_0x27eea3(_0x94afeb[_0xe0ce('0x14')][_0xe0ce('0x13')]);}})[_0xe0ce('0x15')](function(_0x4e82bc){logger[_0xe0ce('0x11')]('Campaign,\x20%s,\x20%s',_0x415f34,_0x4e82bc);_0x2fa936(_0x4e82bc);});});}exports[_0xe0ce('0x16')]=function(_0x2b5ec6){var _0x2182e1=this;return new Promise(function(_0x412b52,_0x39f2c5){return db['Campaign']['findAll']({'raw':_0x2b5ec6[_0xe0ce('0x17')]?_0x2b5ec6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b5ec6[_0xe0ce('0x17')]?_0x2b5ec6[_0xe0ce('0x17')]['where']||null:null,'attributes':_0x2b5ec6[_0xe0ce('0x17')]?_0x2b5ec6[_0xe0ce('0x17')][_0xe0ce('0x18')]||null:null,'limit':_0x2b5ec6[_0xe0ce('0x17')]?_0x2b5ec6[_0xe0ce('0x17')]['limit']||null:null,'include':_0x2b5ec6[_0xe0ce('0x17')]?_0x2b5ec6['options'][_0xe0ce('0x19')]?_['map'](_0x2b5ec6['options']['include'],function(_0x5b8c86){return{'model':db[_0x5b8c86[_0xe0ce('0x1a')]],'as':_0x5b8c86['as'],'attributes':_0x5b8c86['attributes'],'include':_0x5b8c86[_0xe0ce('0x19')]?_[_0xe0ce('0x1b')](_0x5b8c86[_0xe0ce('0x19')],function(_0x19ad73){return{'model':db[_0x19ad73[_0xe0ce('0x1a')]],'as':_0x19ad73['as'],'attributes':_0x19ad73[_0xe0ce('0x18')],'include':_0x19ad73[_0xe0ce('0x19')]?_[_0xe0ce('0x1b')](_0x19ad73[_0xe0ce('0x19')],function(_0x188c56){return{'model':db[_0x188c56[_0xe0ce('0x1a')]],'as':_0x188c56['as'],'attributes':_0x188c56[_0xe0ce('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x300a8e){logger[_0xe0ce('0xd')](_0xe0ce('0x16'),_0x2b5ec6);logger[_0xe0ce('0x1c')]('GetCampaign',_0x2b5ec6,JSON[_0xe0ce('0x10')](_0x300a8e));_0x412b52(_0x300a8e);})[_0xe0ce('0x15')](function(_0x5ea327){logger[_0xe0ce('0x11')](_0xe0ce('0x16'),_0x5ea327[_0xe0ce('0x13')],_0x2b5ec6);_0x39f2c5(_0x2182e1[_0xe0ce('0x11')](0x1f4,_0x5ea327[_0xe0ce('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index cb88311..fd049ef 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 _0xc923=['getHopperFinals','/:id/hopper_black','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','addLists','/:id/blacklists','put','update','delete','destroy','removeBlackLists','multer','util','path','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x347c31,_0x5b41b5){var _0xbb6ffa=function(_0x5318b2){while(--_0x5318b2){_0x347c31['push'](_0x347c31['shift']());}};_0xbb6ffa(++_0x5b41b5);}(_0xc923,0x1ef));var _0x3c92=function(_0x5757d1,_0x5d96a4){_0x5757d1=_0x5757d1-0x0;var _0x4bf50a=_0xc923[_0x5757d1];return _0x4bf50a;};'use strict';var multer=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var path=require(_0x3c92('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3c92('0x3'));var config=require(_0x3c92('0x4'));var controller=require(_0x3c92('0x5'));router[_0x3c92('0x6')]('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0x8')]);router[_0x3c92('0x6')](_0x3c92('0x9'),auth[_0x3c92('0x7')](),controller['show']);router[_0x3c92('0x6')](_0x3c92('0xa'),auth[_0x3c92('0x7')](),controller[_0x3c92('0xb')]);router['get'](_0x3c92('0xc'),auth['isAuthenticated'](),controller[_0x3c92('0xd')]);router['get'](_0x3c92('0xe'),auth[_0x3c92('0x7')](),controller[_0x3c92('0xf')]);router[_0x3c92('0x6')](_0x3c92('0x10'),auth[_0x3c92('0x7')](),controller['getHopperBlacks']);router[_0x3c92('0x6')](_0x3c92('0x11'),auth['isAuthenticated'](),controller[_0x3c92('0x12')]);router[_0x3c92('0x6')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x3c92('0x13')]);router[_0x3c92('0x14')]('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0x15')]);router[_0x3c92('0x14')](_0x3c92('0x16'),auth[_0x3c92('0x7')](),controller['clone']);router[_0x3c92('0x14')](_0x3c92('0x11'),auth['isAuthenticated'](),controller[_0x3c92('0x17')]);router[_0x3c92('0x14')](_0x3c92('0x18'),auth[_0x3c92('0x7')](),controller['addBlackLists']);router[_0x3c92('0x19')](_0x3c92('0x9'),auth['isAuthenticated'](),controller[_0x3c92('0x1a')]);router[_0x3c92('0x1b')](_0x3c92('0x9'),auth[_0x3c92('0x7')](),controller[_0x3c92('0x1c')]);router[_0x3c92('0x1b')](_0x3c92('0x11'),auth[_0x3c92('0x7')](),controller['removeLists']);router[_0x3c92('0x1b')]('/:id/blacklists',auth[_0x3c92('0x7')](),controller[_0x3c92('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x5b4b=['addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','clone'];(function(_0x3b62e2,_0x5ad589){var _0x3874cf=function(_0x235c58){while(--_0x235c58){_0x3b62e2['push'](_0x3b62e2['shift']());}};_0x3874cf(++_0x5ad589);}(_0x5b4b,0xdb));var _0xb5b4=function(_0x2e6dfb,_0x319a2b){_0x2e6dfb=_0x2e6dfb-0x0;var _0x54dece=_0x5b4b[_0x2e6dfb];return _0x54dece;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5b4('0x0'));var timeout=require(_0xb5b4('0x1'));var express=require(_0xb5b4('0x2'));var router=express['Router']();var fs_extra=require(_0xb5b4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb5b4('0x4'));var config=require('../../config/environment');var controller=require(_0xb5b4('0x5'));router[_0xb5b4('0x6')]('/',auth[_0xb5b4('0x7')](),controller['index']);router[_0xb5b4('0x6')]('/:id',auth[_0xb5b4('0x7')](),controller['show']);router[_0xb5b4('0x6')](_0xb5b4('0x8'),auth[_0xb5b4('0x7')](),controller[_0xb5b4('0x9')]);router[_0xb5b4('0x6')]('/:id/hopper_histories',auth[_0xb5b4('0x7')](),controller[_0xb5b4('0xa')]);router[_0xb5b4('0x6')](_0xb5b4('0xb'),auth[_0xb5b4('0x7')](),controller[_0xb5b4('0xc')]);router[_0xb5b4('0x6')](_0xb5b4('0xd'),auth[_0xb5b4('0x7')](),controller[_0xb5b4('0xe')]);router[_0xb5b4('0x6')](_0xb5b4('0xf'),auth['isAuthenticated'](),controller[_0xb5b4('0x10')]);router[_0xb5b4('0x6')](_0xb5b4('0x11'),auth[_0xb5b4('0x7')](),controller['getBlackLists']);router['post']('/',auth[_0xb5b4('0x7')](),controller[_0xb5b4('0x12')]);router[_0xb5b4('0x13')]('/:id/clone',auth[_0xb5b4('0x7')](),controller[_0xb5b4('0x14')]);router[_0xb5b4('0x13')]('/:id/lists',auth[_0xb5b4('0x7')](),controller[_0xb5b4('0x15')]);router[_0xb5b4('0x13')](_0xb5b4('0x11'),auth['isAuthenticated'](),controller[_0xb5b4('0x16')]);router[_0xb5b4('0x17')](_0xb5b4('0x18'),auth['isAuthenticated'](),controller[_0xb5b4('0x19')]);router[_0xb5b4('0x1a')](_0xb5b4('0x18'),auth[_0xb5b4('0x7')](),controller['destroy']);router['delete'](_0xb5b4('0xf'),auth[_0xb5b4('0x7')](),controller[_0xb5b4('0x1b')]);router['delete'](_0xb5b4('0x11'),auth[_0xb5b4('0x7')](),controller[_0xb5b4('0x1c')]);module[_0xb5b4('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f10153f..bd09f3f 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 _0xd137=['VIRTUAL','getDataValue','key','STRING','TEXT','medium'];(function(_0x2aeae1,_0x4b9e44){var _0x59ed25=function(_0x6d6abb){while(--_0x6d6abb){_0x2aeae1['push'](_0x2aeae1['shift']());}};_0x59ed25(++_0x4b9e44);}(_0xd137,0x87));var _0x7d13=function(_0xbd99fb,_0x3a904){_0xbd99fb=_0xbd99fb-0x0;var _0x1d4a44=_0xd137[_0xbd99fb];return _0x1d4a44;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x7d13('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x7d13('0x1')],'length':_0x7d13('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7d13('0x0')]},'name':{'type':Sequelize[_0x7d13('0x3')],'get':function(){return this[_0x7d13('0x4')](_0x7d13('0x5'));}}}; \ No newline at end of file +var _0x78f1=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize'];(function(_0x19d337,_0x1c633c){var _0x11956b=function(_0x4ddc3b){while(--_0x4ddc3b){_0x19d337['push'](_0x19d337['shift']());}};_0x11956b(++_0x1c633c);}(_0x78f1,0x141));var _0x178f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x78f1[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0x178f('0x0'));module['exports']={'key':{'type':Sequelize[_0x178f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x178f('0x2')],'length':_0x178f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x178f('0x1')]},'name':{'type':Sequelize[_0x178f('0x4')],'get':function(){return this[_0x178f('0x5')](_0x178f('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b0f3bc7..067ff83 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 _0x4d32=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','jsforce','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','index','CannedAnswer','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','keys','length','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x4d32,0xad));var _0x24d3=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x4d32[_0x3cc9d9];return _0x1a425d;};'use strict';var emlformat=require(_0x24d3('0x0'));var rimraf=require(_0x24d3('0x1'));var zipdir=require(_0x24d3('0x2'));var jsonpatch=require(_0x24d3('0x3'));var rp=require(_0x24d3('0x4'));var moment=require(_0x24d3('0x5'));var BPromise=require(_0x24d3('0x6'));var Mustache=require(_0x24d3('0x7'));var util=require('util');var path=require('path');var sox=require(_0x24d3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x24d3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x24d3('0xa'));var querystring=require(_0x24d3('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24d3('0xc'));var hardwareService=require(_0x24d3('0xd'));var logger=require(_0x24d3('0xe'))(_0x24d3('0xf'));var utils=require(_0x24d3('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x24d3('0x11'));var db=require(_0x24d3('0x12'))['db'];function respondWithStatusCode(_0x200a2d,_0x2b1671){_0x2b1671=_0x2b1671||0xcc;return function(_0x5e3782){if(_0x5e3782){return _0x200a2d[_0x24d3('0x13')](_0x2b1671);}return _0x200a2d[_0x24d3('0x14')](_0x2b1671)['end']();};}function respondWithResult(_0x53f27c,_0x4c5694){_0x4c5694=_0x4c5694||0xc8;return function(_0x521c5d){if(_0x521c5d){return _0x53f27c[_0x24d3('0x14')](_0x4c5694)[_0x24d3('0x15')](_0x521c5d);}};}function respondWithFilteredResult(_0x1394dc,_0x3e07b1){return function(_0x16adf3){if(_0x16adf3){var _0x26450b=typeof _0x3e07b1[_0x24d3('0x16')]===_0x24d3('0x17')&&typeof _0x3e07b1[_0x24d3('0x18')]===_0x24d3('0x17');var _0x5466a2=_0x16adf3['count'];var _0x16bc48=_0x26450b?0x0:_0x3e07b1[_0x24d3('0x16')];var _0x54c509=_0x26450b?_0x16adf3[_0x24d3('0x19')]:_0x3e07b1['offset']+_0x3e07b1[_0x24d3('0x18')];var _0x334f26;if(_0x54c509>=_0x5466a2){_0x54c509=_0x5466a2;_0x334f26=0xc8;}else{_0x334f26=0xce;}_0x1394dc[_0x24d3('0x14')](_0x334f26);return _0x1394dc[_0x24d3('0x1a')]('Content-Range',_0x16bc48+'-'+_0x54c509+'/'+_0x5466a2)[_0x24d3('0x15')](_0x16adf3);}return null;};}function patchUpdates(_0x3f03be){return function(_0x1e84c2){try{jsonpatch[_0x24d3('0x1b')](_0x1e84c2,_0x3f03be,!![]);}catch(_0x59056a){return BPromise[_0x24d3('0x1c')](_0x59056a);}return _0x1e84c2[_0x24d3('0x1d')]();};}function saveUpdates(_0x303f77,_0x3d43fd){return function(_0x49930d){if(_0x49930d){return _0x49930d[_0x24d3('0x1e')](_0x303f77)[_0x24d3('0x1f')](function(_0x35f928){return _0x35f928;});}return null;};}function removeEntity(_0x555764,_0x5e55dc){return function(_0x331e1e){if(_0x331e1e){return _0x331e1e[_0x24d3('0x20')]()[_0x24d3('0x1f')](function(){var _0x558e47=_0x331e1e[_0x24d3('0x21')]({'plain':!![]});var _0x56a1ab=_0x24d3('0x22');return db[_0x24d3('0x23')][_0x24d3('0x20')]({'where':{'type':_0x56a1ab,'resourceId':_0x558e47['id']}})['then'](function(){return _0x331e1e;});})['then'](function(){_0x555764[_0x24d3('0x14')](0xcc)[_0x24d3('0x24')]();});}};}function handleEntityNotFound(_0x5a76bd,_0x2d1120){return function(_0x46914e){if(!_0x46914e){_0x5a76bd[_0x24d3('0x13')](0x194);}return _0x46914e;};}function handleError(_0x5e806a,_0x1169d5){_0x1169d5=_0x1169d5||0x1f4;return function(_0x48eca1){logger[_0x24d3('0x25')](_0x48eca1['stack']);if(_0x48eca1[_0x24d3('0x26')]){delete _0x48eca1[_0x24d3('0x26')];}_0x5e806a[_0x24d3('0x14')](_0x1169d5)['send'](_0x48eca1);};}exports[_0x24d3('0x27')]=function(_0x3ed229,_0xc8c81){var _0x7f26d9={},_0x2ae51={},_0x4baf10={'count':0x0,'rows':[]};var _0x38369a=_['map'](db[_0x24d3('0x28')][_0x24d3('0x29')],function(_0x55d1ba){return{'name':_0x55d1ba[_0x24d3('0x2a')],'type':_0x55d1ba[_0x24d3('0x2b')]['key']};});_0x2ae51[_0x24d3('0x2c')]=_[_0x24d3('0x2d')](_0x38369a,_0x24d3('0x26'));_0x2ae51[_0x24d3('0x2e')]=_['keys'](_0x3ed229[_0x24d3('0x2e')]);_0x2ae51[_0x24d3('0x2f')]=_[_0x24d3('0x30')](_0x2ae51[_0x24d3('0x2c')],_0x2ae51[_0x24d3('0x2e')]);_0x7f26d9[_0x24d3('0x31')]=_[_0x24d3('0x30')](_0x2ae51['model'],qs[_0x24d3('0x32')](_0x3ed229[_0x24d3('0x2e')]['fields']));_0x7f26d9[_0x24d3('0x31')]=_0x7f26d9['attributes']['length']?_0x7f26d9[_0x24d3('0x31')]:_0x2ae51[_0x24d3('0x2c')];if(!_0x3ed229[_0x24d3('0x2e')][_0x24d3('0x33')](_0x24d3('0x34'))){_0x7f26d9[_0x24d3('0x18')]=qs[_0x24d3('0x18')](_0x3ed229[_0x24d3('0x2e')]['limit']);_0x7f26d9['offset']=qs[_0x24d3('0x16')](_0x3ed229[_0x24d3('0x2e')][_0x24d3('0x16')]);}_0x7f26d9[_0x24d3('0x35')]=qs[_0x24d3('0x36')](_0x3ed229['query'][_0x24d3('0x36')]);_0x7f26d9[_0x24d3('0x37')]=qs[_0x24d3('0x2f')](_[_0x24d3('0x38')](_0x3ed229[_0x24d3('0x2e')],_0x2ae51[_0x24d3('0x2f')]),_0x38369a);if(_0x3ed229[_0x24d3('0x2e')][_0x24d3('0x39')]){_0x7f26d9['where']=_[_0x24d3('0x3a')](_0x7f26d9[_0x24d3('0x37')],{'$or':[{'key':{'$like':'%'+_0x3ed229[_0x24d3('0x2e')][_0x24d3('0x39')]+'%'}},{'value':{'$like':'%'+_0x3ed229[_0x24d3('0x2e')][_0x24d3('0x39')]+'%'}}]});}_0x7f26d9=_[_0x24d3('0x3a')]({},_0x7f26d9,_0x3ed229[_0x24d3('0x3b')]);var _0x3100e1={'where':_0x7f26d9[_0x24d3('0x37')]};return db[_0x24d3('0x28')]['count'](_0x3100e1)[_0x24d3('0x1f')](function(_0x2d4372){_0x4baf10[_0x24d3('0x19')]=_0x2d4372;if(_0x3ed229[_0x24d3('0x2e')][_0x24d3('0x3c')]){_0x7f26d9[_0x24d3('0x3d')]=[{'all':!![]}];}return db[_0x24d3('0x28')][_0x24d3('0x3e')](_0x7f26d9);})[_0x24d3('0x1f')](function(_0x3713b1){_0x4baf10['rows']=_0x3713b1;return _0x4baf10;})['then'](respondWithFilteredResult(_0xc8c81,_0x7f26d9))['catch'](handleError(_0xc8c81,null));};exports[_0x24d3('0x3f')]=function(_0x14b263,_0x46dfc5){var _0x21c150={'raw':!![],'where':{'id':_0x14b263[_0x24d3('0x40')]['id']}},_0x9fb19f={};_0x9fb19f[_0x24d3('0x2c')]=_[_0x24d3('0x41')](db[_0x24d3('0x28')][_0x24d3('0x29')]);_0x9fb19f[_0x24d3('0x2e')]=_[_0x24d3('0x41')](_0x14b263[_0x24d3('0x2e')]);_0x9fb19f[_0x24d3('0x2f')]=_['intersection'](_0x9fb19f[_0x24d3('0x2c')],_0x9fb19f[_0x24d3('0x2e')]);_0x21c150['attributes']=_[_0x24d3('0x30')](_0x9fb19f['model'],qs[_0x24d3('0x32')](_0x14b263[_0x24d3('0x2e')][_0x24d3('0x32')]));_0x21c150[_0x24d3('0x31')]=_0x21c150[_0x24d3('0x31')][_0x24d3('0x42')]?_0x21c150[_0x24d3('0x31')]:_0x9fb19f[_0x24d3('0x2c')];if(_0x14b263[_0x24d3('0x2e')][_0x24d3('0x3c')]){_0x21c150['include']=[{'all':!![]}];}_0x21c150=_[_0x24d3('0x3a')]({},_0x21c150,_0x14b263['options']);return db['CannedAnswer']['find'](_0x21c150)['then'](handleEntityNotFound(_0x46dfc5,null))[_0x24d3('0x1f')](respondWithResult(_0x46dfc5,null))[_0x24d3('0x43')](handleError(_0x46dfc5,null));};exports[_0x24d3('0x1e')]=function(_0x2e1f8a,_0x16deb6){if(_0x2e1f8a[_0x24d3('0x44')]['id']){delete _0x2e1f8a['body']['id'];}return db[_0x24d3('0x28')]['find']({'where':{'id':_0x2e1f8a['params']['id']}})[_0x24d3('0x1f')](handleEntityNotFound(_0x16deb6,null))[_0x24d3('0x1f')](saveUpdates(_0x2e1f8a[_0x24d3('0x44')],null))[_0x24d3('0x1f')](respondWithResult(_0x16deb6,null))[_0x24d3('0x43')](handleError(_0x16deb6,null));};exports[_0x24d3('0x20')]=function(_0x20269b,_0x3ee7a2){return db[_0x24d3('0x28')]['find']({'where':{'id':_0x20269b[_0x24d3('0x40')]['id']}})[_0x24d3('0x1f')](handleEntityNotFound(_0x3ee7a2,null))[_0x24d3('0x1f')](removeEntity(_0x3ee7a2,null))[_0x24d3('0x43')](handleError(_0x3ee7a2,null));};exports['create']=function(_0x38a475,_0x3ea204){var _0x2459aa={'key':_0x38a475[_0x24d3('0x44')]['key']};if(_0x38a475[_0x24d3('0x44')][_0x24d3('0x45')]){_0x2459aa[_0x24d3('0x45')]=_0x38a475['body']['MailAccountId'];}else if(_0x38a475[_0x24d3('0x44')][_0x24d3('0x46')]){_0x2459aa['SmsAccountId']=_0x38a475[_0x24d3('0x44')][_0x24d3('0x46')];}else if(_0x38a475[_0x24d3('0x44')][_0x24d3('0x47')]){_0x2459aa[_0x24d3('0x47')]=_0x38a475[_0x24d3('0x44')][_0x24d3('0x47')];}else if(_0x38a475[_0x24d3('0x44')][_0x24d3('0x48')]){_0x2459aa[_0x24d3('0x48')]=_0x38a475[_0x24d3('0x44')][_0x24d3('0x48')];}return db[_0x24d3('0x28')][_0x24d3('0x49')]({'where':_0x2459aa})[_0x24d3('0x1f')](function(_0x1f4aa6){if(_0x1f4aa6){throw new db['Sequelize'][(_0x24d3('0x4a'))](_0x24d3('0x4b'));}return db[_0x24d3('0x28')][_0x24d3('0x4c')](_0x38a475['body']);})[_0x24d3('0x1f')](function(_0x3bfd69){var _0x2946d8=_0x38a475[_0x24d3('0x4d')]['get']({'plain':!![]});if(!_0x2946d8)throw new Error(_0x24d3('0x4e'));if(_0x2946d8[_0x24d3('0x4f')]===_0x24d3('0x4d')){var _0x45e2cc=_0x3bfd69[_0x24d3('0x21')]({'plain':!![]});return db[_0x24d3('0x50')][_0x24d3('0x49')]({'where':{'name':_0x24d3('0x22'),'userProfileId':_0x2946d8['userProfileId']},'raw':!![]})['then'](function(_0x4d6de6){if(_0x4d6de6&&_0x4d6de6[_0x24d3('0x51')]===0x0){return db[_0x24d3('0x23')]['create']({'name':_0x45e2cc[_0x24d3('0x26')],'resourceId':_0x45e2cc['id'],'type':_0x4d6de6[_0x24d3('0x26')],'sectionId':_0x4d6de6['id']},{})[_0x24d3('0x1f')](function(){return _0x3bfd69;});}else{return _0x3bfd69;}})[_0x24d3('0x43')](function(_0x37c784){logger[_0x24d3('0x25')](_0x24d3('0x52'),_0x37c784);throw _0x37c784;});}return _0x3bfd69;})[_0x24d3('0x1f')](respondWithResult(_0x3ea204,0xc9))[_0x24d3('0x43')](handleError(_0x3ea204,null));}; \ No newline at end of file +var _0x7553=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','stack','name','send','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7553,0x169));var _0x3755=function(_0x37db9f,_0x4c93ed){_0x37db9f=_0x37db9f-0x0;var _0x48fb29=_0x7553[_0x37db9f];return _0x48fb29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3755('0x0'));var zipdir=require(_0x3755('0x1'));var jsonpatch=require(_0x3755('0x2'));var rp=require(_0x3755('0x3'));var moment=require(_0x3755('0x4'));var BPromise=require(_0x3755('0x5'));var Mustache=require(_0x3755('0x6'));var util=require(_0x3755('0x7'));var path=require(_0x3755('0x8'));var sox=require(_0x3755('0x9'));var csv=require(_0x3755('0xa'));var ejs=require(_0x3755('0xb'));var fs=require('fs');var fs_extra=require(_0x3755('0xc'));var _=require(_0x3755('0xd'));var squel=require(_0x3755('0xe'));var crypto=require(_0x3755('0xf'));var jsforce=require(_0x3755('0x10'));var deskjs=require(_0x3755('0x11'));var toCsv=require(_0x3755('0xa'));var querystring=require('querystring');var Papa=require(_0x3755('0x12'));var Redis=require(_0x3755('0x13'));var authService=require(_0x3755('0x14'));var qs=require(_0x3755('0x15'));var as=require(_0x3755('0x16'));var hardwareService=require(_0x3755('0x17'));var logger=require(_0x3755('0x18'))(_0x3755('0x19'));var utils=require('../../config/utils');var config=require(_0x3755('0x1a'));var licenseUtil=require(_0x3755('0x1b'));var db=require(_0x3755('0x1c'))['db'];function respondWithStatusCode(_0x2d5d67,_0x5c99ff){_0x5c99ff=_0x5c99ff||0xcc;return function(_0x154009){if(_0x154009){return _0x2d5d67[_0x3755('0x1d')](_0x5c99ff);}return _0x2d5d67[_0x3755('0x1e')](_0x5c99ff)[_0x3755('0x1f')]();};}function respondWithResult(_0x226e2d,_0x349097){_0x349097=_0x349097||0xc8;return function(_0x1062c7){if(_0x1062c7){return _0x226e2d[_0x3755('0x1e')](_0x349097)[_0x3755('0x20')](_0x1062c7);}};}function respondWithFilteredResult(_0x10b7f2,_0x13e8e9){return function(_0x557bc1){if(_0x557bc1){var _0x378ace=typeof _0x13e8e9[_0x3755('0x21')]===_0x3755('0x22')&&typeof _0x13e8e9[_0x3755('0x23')]===_0x3755('0x22');var _0x8b915f=_0x557bc1['count'];var _0x18b741=_0x378ace?0x0:_0x13e8e9[_0x3755('0x21')];var _0x498a17=_0x378ace?_0x557bc1[_0x3755('0x24')]:_0x13e8e9[_0x3755('0x21')]+_0x13e8e9['limit'];var _0x11d61f;if(_0x498a17>=_0x8b915f){_0x498a17=_0x8b915f;_0x11d61f=0xc8;}else{_0x11d61f=0xce;}_0x10b7f2[_0x3755('0x1e')](_0x11d61f);return _0x10b7f2['set'](_0x3755('0x25'),_0x18b741+'-'+_0x498a17+'/'+_0x8b915f)[_0x3755('0x20')](_0x557bc1);}return null;};}function patchUpdates(_0xc88aeb){return function(_0x175a47){try{jsonpatch[_0x3755('0x26')](_0x175a47,_0xc88aeb,!![]);}catch(_0x341839){return BPromise[_0x3755('0x27')](_0x341839);}return _0x175a47['save']();};}function saveUpdates(_0x51c5b7,_0x5c28dc){return function(_0x553f63){if(_0x553f63){return _0x553f63[_0x3755('0x28')](_0x51c5b7)[_0x3755('0x29')](function(_0x4997b4){return _0x4997b4;});}return null;};}function removeEntity(_0x4cbc88,_0x529404){return function(_0xbb0e32){if(_0xbb0e32){return _0xbb0e32[_0x3755('0x2a')]()[_0x3755('0x29')](function(){var _0x1d5694=_0xbb0e32['get']({'plain':!![]});var _0x5535f7='CannedAnswers';return db[_0x3755('0x2b')][_0x3755('0x2a')]({'where':{'type':_0x5535f7,'resourceId':_0x1d5694['id']}})[_0x3755('0x29')](function(){return _0xbb0e32;});})[_0x3755('0x29')](function(){_0x4cbc88[_0x3755('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb9010e,_0x497153){return function(_0x25015d){if(!_0x25015d){_0xb9010e[_0x3755('0x1d')](0x194);}return _0x25015d;};}function handleError(_0xcd53a4,_0x19c863){_0x19c863=_0x19c863||0x1f4;return function(_0x374243){logger[_0x3755('0x2c')](_0x374243[_0x3755('0x2d')]);if(_0x374243[_0x3755('0x2e')]){delete _0x374243[_0x3755('0x2e')];}_0xcd53a4[_0x3755('0x1e')](_0x19c863)[_0x3755('0x2f')](_0x374243);};}exports['index']=function(_0x309211,_0x14eba1){var _0x53416d={},_0xbcdf55={},_0xbf8a49={'count':0x0,'rows':[]};var _0x3dcb15=_['map'](db[_0x3755('0x30')][_0x3755('0x31')],function(_0x2aae27){return{'name':_0x2aae27[_0x3755('0x32')],'type':_0x2aae27['type'][_0x3755('0x33')]};});_0xbcdf55[_0x3755('0x34')]=_[_0x3755('0x35')](_0x3dcb15,_0x3755('0x2e'));_0xbcdf55[_0x3755('0x36')]=_[_0x3755('0x37')](_0x309211[_0x3755('0x36')]);_0xbcdf55[_0x3755('0x38')]=_[_0x3755('0x39')](_0xbcdf55[_0x3755('0x34')],_0xbcdf55['query']);_0x53416d[_0x3755('0x3a')]=_['intersection'](_0xbcdf55['model'],qs[_0x3755('0x3b')](_0x309211[_0x3755('0x36')]['fields']));_0x53416d[_0x3755('0x3a')]=_0x53416d[_0x3755('0x3a')]['length']?_0x53416d['attributes']:_0xbcdf55[_0x3755('0x34')];if(!_0x309211[_0x3755('0x36')]['hasOwnProperty']('nolimit')){_0x53416d[_0x3755('0x23')]=qs['limit'](_0x309211['query'][_0x3755('0x23')]);_0x53416d[_0x3755('0x21')]=qs['offset'](_0x309211[_0x3755('0x36')][_0x3755('0x21')]);}_0x53416d[_0x3755('0x3c')]=qs[_0x3755('0x3d')](_0x309211[_0x3755('0x36')]['sort']);_0x53416d[_0x3755('0x3e')]=qs[_0x3755('0x38')](_[_0x3755('0x3f')](_0x309211[_0x3755('0x36')],_0xbcdf55[_0x3755('0x38')]),_0x3dcb15);if(_0x309211['query'][_0x3755('0x40')]){_0x53416d[_0x3755('0x3e')]=_[_0x3755('0x41')](_0x53416d['where'],{'$or':[{'key':{'$like':'%'+_0x309211[_0x3755('0x36')][_0x3755('0x40')]+'%'}},{'value':{'$like':'%'+_0x309211[_0x3755('0x36')][_0x3755('0x40')]+'%'}}]});}_0x53416d=_[_0x3755('0x41')]({},_0x53416d,_0x309211[_0x3755('0x42')]);var _0x1ea2ff={'where':_0x53416d[_0x3755('0x3e')]};return db[_0x3755('0x30')]['count'](_0x1ea2ff)['then'](function(_0x3348d0){_0xbf8a49[_0x3755('0x24')]=_0x3348d0;if(_0x309211['query'][_0x3755('0x43')]){_0x53416d[_0x3755('0x44')]=[{'all':!![]}];}return db[_0x3755('0x30')]['findAll'](_0x53416d);})['then'](function(_0x25d55f){_0xbf8a49[_0x3755('0x45')]=_0x25d55f;return _0xbf8a49;})[_0x3755('0x29')](respondWithFilteredResult(_0x14eba1,_0x53416d))['catch'](handleError(_0x14eba1,null));};exports[_0x3755('0x46')]=function(_0x513f0e,_0x1828f4){var _0x164e61={'raw':!![],'where':{'id':_0x513f0e[_0x3755('0x47')]['id']}},_0x2c670d={};_0x2c670d[_0x3755('0x34')]=_[_0x3755('0x37')](db[_0x3755('0x30')]['rawAttributes']);_0x2c670d[_0x3755('0x36')]=_[_0x3755('0x37')](_0x513f0e[_0x3755('0x36')]);_0x2c670d[_0x3755('0x38')]=_['intersection'](_0x2c670d[_0x3755('0x34')],_0x2c670d[_0x3755('0x36')]);_0x164e61[_0x3755('0x3a')]=_[_0x3755('0x39')](_0x2c670d['model'],qs[_0x3755('0x3b')](_0x513f0e[_0x3755('0x36')][_0x3755('0x3b')]));_0x164e61[_0x3755('0x3a')]=_0x164e61[_0x3755('0x3a')]['length']?_0x164e61[_0x3755('0x3a')]:_0x2c670d[_0x3755('0x34')];if(_0x513f0e[_0x3755('0x36')][_0x3755('0x43')]){_0x164e61[_0x3755('0x44')]=[{'all':!![]}];}_0x164e61=_[_0x3755('0x41')]({},_0x164e61,_0x513f0e[_0x3755('0x42')]);return db[_0x3755('0x30')][_0x3755('0x48')](_0x164e61)[_0x3755('0x29')](handleEntityNotFound(_0x1828f4,null))[_0x3755('0x29')](respondWithResult(_0x1828f4,null))['catch'](handleError(_0x1828f4,null));};exports[_0x3755('0x28')]=function(_0x10020a,_0x447f52){if(_0x10020a[_0x3755('0x49')]['id']){delete _0x10020a['body']['id'];}return db[_0x3755('0x30')][_0x3755('0x48')]({'where':{'id':_0x10020a['params']['id']}})['then'](handleEntityNotFound(_0x447f52,null))[_0x3755('0x29')](saveUpdates(_0x10020a['body'],null))[_0x3755('0x29')](respondWithResult(_0x447f52,null))[_0x3755('0x4a')](handleError(_0x447f52,null));};exports['destroy']=function(_0x200a74,_0x9ed230){return db[_0x3755('0x30')][_0x3755('0x48')]({'where':{'id':_0x200a74[_0x3755('0x47')]['id']}})[_0x3755('0x29')](handleEntityNotFound(_0x9ed230,null))['then'](removeEntity(_0x9ed230,null))[_0x3755('0x4a')](handleError(_0x9ed230,null));};exports[_0x3755('0x4b')]=function(_0x2873e9,_0x69c9b5){var _0xfd9010={'key':_0x2873e9[_0x3755('0x49')][_0x3755('0x33')]};if(_0x2873e9[_0x3755('0x49')][_0x3755('0x4c')]){_0xfd9010[_0x3755('0x4c')]=_0x2873e9[_0x3755('0x49')][_0x3755('0x4c')];}else if(_0x2873e9[_0x3755('0x49')][_0x3755('0x4d')]){_0xfd9010[_0x3755('0x4d')]=_0x2873e9['body'][_0x3755('0x4d')];}else if(_0x2873e9[_0x3755('0x49')]['OpenchannelAccountId']){_0xfd9010[_0x3755('0x4e')]=_0x2873e9['body']['OpenchannelAccountId'];}else if(_0x2873e9[_0x3755('0x49')][_0x3755('0x4f')]){_0xfd9010['ChatWebsiteId']=_0x2873e9['body']['ChatWebsiteId'];}return db['CannedAnswer'][_0x3755('0x48')]({'where':_0xfd9010})[_0x3755('0x29')](function(_0x32a2db){if(_0x32a2db){throw new db[(_0x3755('0x50'))][(_0x3755('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x3755('0x4b')](_0x2873e9['body']);})[_0x3755('0x29')](function(_0x300814){var _0x52e825=_0x2873e9[_0x3755('0x52')][_0x3755('0x53')]({'plain':!![]});if(!_0x52e825)throw new Error(_0x3755('0x54'));if(_0x52e825[_0x3755('0x55')]===_0x3755('0x52')){var _0x444f55=_0x300814['get']({'plain':!![]});return db[_0x3755('0x56')][_0x3755('0x48')]({'where':{'name':_0x3755('0x57'),'userProfileId':_0x52e825[_0x3755('0x58')]},'raw':!![]})[_0x3755('0x29')](function(_0x326174){if(_0x326174&&_0x326174[_0x3755('0x59')]===0x0){return db[_0x3755('0x2b')][_0x3755('0x4b')]({'name':_0x444f55[_0x3755('0x2e')],'resourceId':_0x444f55['id'],'type':_0x326174[_0x3755('0x2e')],'sectionId':_0x326174['id']},{})[_0x3755('0x29')](function(){return _0x300814;});}else{return _0x300814;}})['catch'](function(_0x2def67){logger[_0x3755('0x2c')](_0x3755('0x5a'),_0x2def67);throw _0x2def67;});}return _0x300814;})[_0x3755('0x29')](respondWithResult(_0x69c9b5,0xc9))[_0x3755('0x4a')](handleError(_0x69c9b5,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9c0dcd6..ecbfbed 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 _0x1a58=['api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x5634df,_0x2486a5){var _0xee84b8=function(_0x3f2d1a){while(--_0x3f2d1a){_0x5634df['push'](_0x5634df['shift']());}};_0xee84b8(++_0x2486a5);}(_0x1a58,0x193));var _0x81a5=function(_0x59ae56,_0x56e0e0){_0x59ae56=_0x59ae56-0x0;var _0x85b88f=_0x1a58[_0x59ae56];return _0x85b88f;};'use strict';var _=require(_0x81a5('0x0'));var util=require(_0x81a5('0x1'));var logger=require(_0x81a5('0x2'))(_0x81a5('0x3'));var moment=require(_0x81a5('0x4'));var BPromise=require(_0x81a5('0x5'));var rp=require(_0x81a5('0x6'));var fs=require('fs');var path=require(_0x81a5('0x7'));var rimraf=require('rimraf');var config=require(_0x81a5('0x8'));var attributes=require(_0x81a5('0x9'));module[_0x81a5('0xa')]=function(_0x576008,_0x297575){return _0x576008['define'](_0x81a5('0xb'),attributes,{'tableName':_0x81a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x81a5('0xd')});}; \ No newline at end of file +var _0x4c71=['exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes'];(function(_0x3e48ab,_0x397085){var _0xee03b1=function(_0x4c2069){while(--_0x4c2069){_0x3e48ab['push'](_0x3e48ab['shift']());}};_0xee03b1(++_0x397085);}(_0x4c71,0x12b));var _0x14c7=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4c71[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var logger=require('../../config/logger')(_0x14c7('0x2'));var moment=require(_0x14c7('0x3'));var BPromise=require(_0x14c7('0x4'));var rp=require(_0x14c7('0x5'));var fs=require('fs');var path=require(_0x14c7('0x6'));var rimraf=require('rimraf');var config=require(_0x14c7('0x7'));var attributes=require(_0x14c7('0x8'));module[_0x14c7('0x9')]=function(_0x3c6929,_0x5b50b6){return _0x3c6929['define'](_0x14c7('0xa'),attributes,{'tableName':_0x14c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x14c7('0xc'),'collate':_0x14c7('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 67573a5..7a3df3e 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(_0x2cdf40,_0x55062f){var _0x2874cc=function(_0x20b1dc){while(--_0x20b1dc){_0x2cdf40['push'](_0x2cdf40['shift']());}};_0x2874cc(++_0x55062f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3b815b,_0x170210){var _0x16df87=function(_0x2954a3){while(--_0x2954a3){_0x3b815b['push'](_0x3b815b['shift']());}};_0x16df87(++_0x170210);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 cf33922..b70b84f 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 _0x5669=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3cf854,_0x28eddb){var _0x403cfd=function(_0x2f0058){while(--_0x2f0058){_0x3cf854['push'](_0x3cf854['shift']());}};_0x403cfd(++_0x28eddb);}(_0x5669,0x178));var _0x9566=function(_0x5e39d0,_0x15516e){_0x5e39d0=_0x5e39d0-0x0;var _0xfd2079=_0x5669[_0x5e39d0];return _0xfd2079;};'use strict';var multer=require(_0x9566('0x0'));var util=require(_0x9566('0x1'));var path=require(_0x9566('0x2'));var timeout=require(_0x9566('0x3'));var express=require('express');var router=express[_0x9566('0x4')]();var fs_extra=require(_0x9566('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9566('0x6'));var config=require(_0x9566('0x7'));var controller=require('./cannedAnswer.controller');router[_0x9566('0x8')]('/',auth[_0x9566('0x9')](),controller[_0x9566('0xa')]);router[_0x9566('0x8')](_0x9566('0xb'),auth[_0x9566('0x9')](),controller['show']);router[_0x9566('0xc')]('/',auth[_0x9566('0x9')](),controller[_0x9566('0xd')]);router[_0x9566('0xe')](_0x9566('0xb'),auth[_0x9566('0x9')](),controller[_0x9566('0xf')]);router[_0x9566('0x10')]('/:id',auth[_0x9566('0x9')](),controller[_0x9566('0x11')]);module[_0x9566('0x12')]=router; \ No newline at end of file +var _0x79eb=['destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x3decbd,_0x16f955){var _0x3b673a=function(_0x37904a){while(--_0x37904a){_0x3decbd['push'](_0x3decbd['shift']());}};_0x3b673a(++_0x16f955);}(_0x79eb,0x14b));var _0xb79e=function(_0x4ff8ed,_0x27e044){_0x4ff8ed=_0x4ff8ed-0x0;var _0x4ff67a=_0x79eb[_0x4ff8ed];return _0x4ff67a;};'use strict';var multer=require('multer');var util=require(_0xb79e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb79e('0x1'));var router=express[_0xb79e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb79e('0x3'));var interaction=require(_0xb79e('0x4'));var config=require(_0xb79e('0x5'));var controller=require(_0xb79e('0x6'));router[_0xb79e('0x7')]('/',auth[_0xb79e('0x8')](),controller[_0xb79e('0x9')]);router[_0xb79e('0x7')](_0xb79e('0xa'),auth[_0xb79e('0x8')](),controller[_0xb79e('0xb')]);router[_0xb79e('0xc')]('/',auth[_0xb79e('0x8')](),controller['create']);router[_0xb79e('0xd')]('/:id',auth[_0xb79e('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb79e('0x8')](),controller[_0xb79e('0xe')]);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 b18b56a..f5b0608 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 _0x0b25=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x0b25,0x155));var _0x50b2=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0x0b25[_0x28509b];return _0x1e0b6;};'use strict';var Sequelize=require(_0x50b2('0x0'));module[_0x50b2('0x1')]={'calldate':{'type':Sequelize[_0x50b2('0x2')],'allowNull':![],'defaultValue':_0x50b2('0x3')},'clid':{'type':Sequelize[_0x50b2('0x4')]},'src':{'type':Sequelize[_0x50b2('0x4')]},'dst':{'type':Sequelize[_0x50b2('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x50b2('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x50b2('0x4')]},'duration':{'type':Sequelize[_0x50b2('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x50b2('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x50b2('0x4')]},'amaflags':{'type':Sequelize[_0x50b2('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x50b2('0x4')]},'uniqueid':{'type':Sequelize[_0x50b2('0x4')]},'linkedid':{'type':Sequelize[_0x50b2('0x4')]},'sequence':{'type':Sequelize[_0x50b2('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x50b2('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1e9f=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x38a228,_0x267b91){var _0x55483d=function(_0x48572f){while(--_0x48572f){_0x38a228['push'](_0x38a228['shift']());}};_0x55483d(++_0x267b91);}(_0x1e9f,0x107));var _0xf1e9=function(_0x2a7d57,_0x27a648){_0x2a7d57=_0x2a7d57-0x0;var _0x5daa90=_0x1e9f[_0x2a7d57];return _0x5daa90;};'use strict';var Sequelize=require(_0xf1e9('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf1e9('0x1')],'allowNull':![],'defaultValue':_0xf1e9('0x2')},'clid':{'type':Sequelize[_0xf1e9('0x3')]},'src':{'type':Sequelize[_0xf1e9('0x3')]},'dst':{'type':Sequelize[_0xf1e9('0x3')]},'dcontext':{'type':Sequelize[_0xf1e9('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xf1e9('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xf1e9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf1e9('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf1e9('0x3')]},'userfield':{'type':Sequelize[_0xf1e9('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xf1e9('0x3')]},'sequence':{'type':Sequelize[_0xf1e9('0x3')]},'peeraccount':{'type':Sequelize[_0xf1e9('0x3')]},'type':{'type':Sequelize[_0xf1e9('0x3')]},'tag':{'type':Sequelize[_0xf1e9('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e83c3c5..2d91a04 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 _0x4006=['findAll','catch','show','keys','include','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','end','error','stack','name','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll'];(function(_0x10d135,_0x30d197){var _0xe26f4d=function(_0x20b9ac){while(--_0x20b9ac){_0x10d135['push'](_0x10d135['shift']());}};_0xe26f4d(++_0x30d197);}(_0x4006,0x1c7));var _0x6400=function(_0x291965,_0x30825f){_0x291965=_0x291965-0x0;var _0x3f03a8=_0x4006[_0x291965];return _0x3f03a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6400('0x0'));var zipdir=require(_0x6400('0x1'));var jsonpatch=require(_0x6400('0x2'));var rp=require(_0x6400('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6400('0x4'));var util=require('util');var path=require(_0x6400('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6400('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6400('0x7'));var squel=require(_0x6400('0x8'));var crypto=require(_0x6400('0x9'));var jsforce=require(_0x6400('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6400('0xb'));var querystring=require(_0x6400('0xc'));var Papa=require(_0x6400('0xd'));var Redis=require(_0x6400('0xe'));var authService=require(_0x6400('0xf'));var qs=require(_0x6400('0x10'));var as=require(_0x6400('0x11'));var hardwareService=require(_0x6400('0x12'));var logger=require(_0x6400('0x13'))(_0x6400('0x14'));var utils=require(_0x6400('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6400('0x16'));var db=require(_0x6400('0x17'))['db'];function respondWithStatusCode(_0x230c94,_0x36bf00){_0x36bf00=_0x36bf00||0xcc;return function(_0x5a6d31){if(_0x5a6d31){return _0x230c94[_0x6400('0x18')](_0x36bf00);}return _0x230c94[_0x6400('0x19')](_0x36bf00)['end']();};}function respondWithResult(_0x4f8133,_0x559312){_0x559312=_0x559312||0xc8;return function(_0x268f93){if(_0x268f93){return _0x4f8133[_0x6400('0x19')](_0x559312)['json'](_0x268f93);}};}function respondWithFilteredResult(_0x191696,_0x4ae3ea){return function(_0x28eb67){if(_0x28eb67){var _0x5a0c1c=typeof _0x4ae3ea[_0x6400('0x1a')]===_0x6400('0x1b')&&typeof _0x4ae3ea[_0x6400('0x1c')]===_0x6400('0x1b');var _0x49d412=_0x28eb67[_0x6400('0x1d')];var _0x14c036=_0x5a0c1c?0x0:_0x4ae3ea[_0x6400('0x1a')];var _0x50524f=_0x5a0c1c?_0x28eb67[_0x6400('0x1d')]:_0x4ae3ea[_0x6400('0x1a')]+_0x4ae3ea['limit'];var _0x36a8f5;if(_0x50524f>=_0x49d412){_0x50524f=_0x49d412;_0x36a8f5=0xc8;}else{_0x36a8f5=0xce;}_0x191696[_0x6400('0x19')](_0x36a8f5);return _0x191696[_0x6400('0x1e')]('Content-Range',_0x14c036+'-'+_0x50524f+'/'+_0x49d412)[_0x6400('0x1f')](_0x28eb67);}return null;};}function patchUpdates(_0x23c1cd){return function(_0x325bde){try{jsonpatch[_0x6400('0x20')](_0x325bde,_0x23c1cd,!![]);}catch(_0x1c8b72){return BPromise[_0x6400('0x21')](_0x1c8b72);}return _0x325bde[_0x6400('0x22')]();};}function saveUpdates(_0x171e39,_0x22eb63){return function(_0x212f0f){if(_0x212f0f){return _0x212f0f['update'](_0x171e39)[_0x6400('0x23')](function(_0x50c29e){return _0x50c29e;});}return null;};}function removeEntity(_0x589b7c,_0x257d80){return function(_0xb79c62){if(_0xb79c62){return _0xb79c62[_0x6400('0x24')]()[_0x6400('0x23')](function(){_0x589b7c['status'](0xcc)[_0x6400('0x25')]();});}};}function handleEntityNotFound(_0x56d9e6,_0x1acff2){return function(_0x506732){if(!_0x506732){_0x56d9e6[_0x6400('0x18')](0x194);}return _0x506732;};}function handleError(_0x246433,_0x577156){_0x577156=_0x577156||0x1f4;return function(_0x434550){logger[_0x6400('0x26')](_0x434550[_0x6400('0x27')]);if(_0x434550['name']){delete _0x434550[_0x6400('0x28')];}_0x246433['status'](_0x577156)['send'](_0x434550);};}exports[_0x6400('0x29')]=function(_0x4bb214,_0x234670){var _0x197b9d={},_0x50f5e9={},_0x452a2c={'count':0x0,'rows':[]};var _0x52eba1=_['map'](db[_0x6400('0x2a')][_0x6400('0x2b')],function(_0x10005a){return{'name':_0x10005a[_0x6400('0x2c')],'type':_0x10005a[_0x6400('0x2d')]['key']};});_0x50f5e9[_0x6400('0x2e')]=_[_0x6400('0x2f')](_0x52eba1,_0x6400('0x28'));_0x50f5e9[_0x6400('0x30')]=_['keys'](_0x4bb214[_0x6400('0x30')]);_0x50f5e9[_0x6400('0x31')]=_[_0x6400('0x32')](_0x50f5e9['model'],_0x50f5e9[_0x6400('0x30')]);_0x197b9d[_0x6400('0x33')]=_[_0x6400('0x32')](_0x50f5e9[_0x6400('0x2e')],qs['fields'](_0x4bb214[_0x6400('0x30')][_0x6400('0x34')]));_0x197b9d['attributes']=_0x197b9d[_0x6400('0x33')][_0x6400('0x35')]?_0x197b9d['attributes']:_0x50f5e9['model'];if(!_0x4bb214[_0x6400('0x30')][_0x6400('0x36')](_0x6400('0x37'))){_0x197b9d['limit']=qs['limit'](_0x4bb214['query'][_0x6400('0x1c')]);_0x197b9d[_0x6400('0x1a')]=qs[_0x6400('0x1a')](_0x4bb214[_0x6400('0x30')][_0x6400('0x1a')]);}_0x197b9d['order']=qs[_0x6400('0x38')](_0x4bb214[_0x6400('0x30')]['sort']);_0x197b9d['where']=qs[_0x6400('0x31')](_[_0x6400('0x39')](_0x4bb214[_0x6400('0x30')],_0x50f5e9['filters']),_0x52eba1);if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3a')]){_0x197b9d[_0x6400('0x3b')]=_['merge'](_0x197b9d[_0x6400('0x3b')],{'$or':_[_0x6400('0x2f')](_0x52eba1,function(_0xd824bf){if(_0xd824bf['type']!=='VIRTUAL'){var _0x5a0973={};_0x5a0973[_0xd824bf[_0x6400('0x28')]]={'$like':'%'+_0x4bb214['query']['filter']+'%'};return _0x5a0973;}})});}_0x197b9d=_[_0x6400('0x3c')]({},_0x197b9d,_0x4bb214[_0x6400('0x3d')]);var _0x565942={'where':_0x197b9d[_0x6400('0x3b')]};return db[_0x6400('0x2a')][_0x6400('0x1d')](_0x565942)['then'](function(_0x9536e5){_0x452a2c[_0x6400('0x1d')]=_0x9536e5;if(_0x4bb214[_0x6400('0x30')][_0x6400('0x3e')]){_0x197b9d['include']=[{'all':!![]}];}return db['Cdr'][_0x6400('0x3f')](_0x197b9d);})[_0x6400('0x23')](function(_0x1bf820){_0x452a2c['rows']=_0x1bf820;return _0x452a2c;})[_0x6400('0x23')](respondWithFilteredResult(_0x234670,_0x197b9d))[_0x6400('0x40')](handleError(_0x234670,null));};exports[_0x6400('0x41')]=function(_0xe50c96,_0x3069f0){var _0x557133={'raw':!![],'where':{'id':_0xe50c96['params']['id']}},_0x24d0c7={};_0x24d0c7[_0x6400('0x2e')]=_[_0x6400('0x42')](db[_0x6400('0x2a')][_0x6400('0x2b')]);_0x24d0c7['query']=_[_0x6400('0x42')](_0xe50c96[_0x6400('0x30')]);_0x24d0c7[_0x6400('0x31')]=_[_0x6400('0x32')](_0x24d0c7['model'],_0x24d0c7[_0x6400('0x30')]);_0x557133['attributes']=_[_0x6400('0x32')](_0x24d0c7['model'],qs[_0x6400('0x34')](_0xe50c96[_0x6400('0x30')][_0x6400('0x34')]));_0x557133['attributes']=_0x557133[_0x6400('0x33')]['length']?_0x557133[_0x6400('0x33')]:_0x24d0c7[_0x6400('0x2e')];if(_0xe50c96[_0x6400('0x30')][_0x6400('0x3e')]){_0x557133[_0x6400('0x43')]=[{'all':!![]}];}_0x557133=_[_0x6400('0x3c')]({},_0x557133,_0xe50c96[_0x6400('0x3d')]);return db[_0x6400('0x2a')][_0x6400('0x44')](_0x557133)[_0x6400('0x23')](handleEntityNotFound(_0x3069f0,null))[_0x6400('0x23')](respondWithResult(_0x3069f0,null))['catch'](handleError(_0x3069f0,null));};exports[_0x6400('0x45')]=function(_0x3340c7,_0x59a8f2){return db['Cdr'][_0x6400('0x45')](_0x3340c7[_0x6400('0x46')],{})[_0x6400('0x23')](respondWithResult(_0x59a8f2,0xc9))['catch'](handleError(_0x59a8f2,null));};exports[_0x6400('0x47')]=function(_0x54cbfb,_0x518ee4){if(_0x54cbfb['body']['id']){delete _0x54cbfb[_0x6400('0x46')]['id'];}return db[_0x6400('0x2a')]['find']({'where':{'id':_0x54cbfb[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x518ee4,null))['then'](saveUpdates(_0x54cbfb['body'],null))[_0x6400('0x23')](respondWithResult(_0x518ee4,null))[_0x6400('0x40')](handleError(_0x518ee4,null));};exports['destroy']=function(_0x3421b5,_0x205233){return db[_0x6400('0x2a')][_0x6400('0x44')]({'where':{'id':_0x3421b5[_0x6400('0x48')]['id']}})[_0x6400('0x23')](handleEntityNotFound(_0x205233,null))[_0x6400('0x23')](removeEntity(_0x205233,null))['catch'](handleError(_0x205233,null));};exports[_0x6400('0x49')]=function(_0x801179,_0x6905bb){return db[_0x6400('0x2a')][_0x6400('0x49')]()[_0x6400('0x23')](respondWithResult(_0x6905bb,null))[_0x6400('0x40')](handleError(_0x6905bb,null));}; \ No newline at end of file +var _0x41fe=['fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','keys','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x33ffac,_0xd72ef4){var _0x1611ba=function(_0x214cb7){while(--_0x214cb7){_0x33ffac['push'](_0x33ffac['shift']());}};_0x1611ba(++_0xd72ef4);}(_0x41fe,0xd1));var _0xe41f=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x41fe[_0x37b7b6];return _0x10c4c3;};'use strict';var emlformat=require(_0xe41f('0x0'));var rimraf=require(_0xe41f('0x1'));var zipdir=require(_0xe41f('0x2'));var jsonpatch=require(_0xe41f('0x3'));var rp=require(_0xe41f('0x4'));var moment=require(_0xe41f('0x5'));var BPromise=require(_0xe41f('0x6'));var Mustache=require(_0xe41f('0x7'));var util=require(_0xe41f('0x8'));var path=require(_0xe41f('0x9'));var sox=require(_0xe41f('0xa'));var csv=require(_0xe41f('0xb'));var ejs=require(_0xe41f('0xc'));var fs=require('fs');var fs_extra=require(_0xe41f('0xd'));var _=require(_0xe41f('0xe'));var squel=require(_0xe41f('0xf'));var crypto=require(_0xe41f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xe41f('0x11'));var toCsv=require(_0xe41f('0xb'));var querystring=require('querystring');var Papa=require(_0xe41f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe41f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe41f('0x14'));var config=require(_0xe41f('0x15'));var licenseUtil=require(_0xe41f('0x16'));var db=require(_0xe41f('0x17'))['db'];function respondWithStatusCode(_0x2ed268,_0x139162){_0x139162=_0x139162||0xcc;return function(_0x34ae3a){if(_0x34ae3a){return _0x2ed268[_0xe41f('0x18')](_0x139162);}return _0x2ed268[_0xe41f('0x19')](_0x139162)[_0xe41f('0x1a')]();};}function respondWithResult(_0x53e2f6,_0x445e1c){_0x445e1c=_0x445e1c||0xc8;return function(_0x13a2dd){if(_0x13a2dd){return _0x53e2f6['status'](_0x445e1c)[_0xe41f('0x1b')](_0x13a2dd);}};}function respondWithFilteredResult(_0x9cb27c,_0x3b5992){return function(_0x1fb373){if(_0x1fb373){var _0x194653=typeof _0x3b5992[_0xe41f('0x1c')]===_0xe41f('0x1d')&&typeof _0x3b5992['limit']==='undefined';var _0x2b5688=_0x1fb373['count'];var _0x5b5dd7=_0x194653?0x0:_0x3b5992[_0xe41f('0x1c')];var _0x15f6c1=_0x194653?_0x1fb373[_0xe41f('0x1e')]:_0x3b5992[_0xe41f('0x1c')]+_0x3b5992[_0xe41f('0x1f')];var _0x5bd220;if(_0x15f6c1>=_0x2b5688){_0x15f6c1=_0x2b5688;_0x5bd220=0xc8;}else{_0x5bd220=0xce;}_0x9cb27c[_0xe41f('0x19')](_0x5bd220);return _0x9cb27c['set'](_0xe41f('0x20'),_0x5b5dd7+'-'+_0x15f6c1+'/'+_0x2b5688)[_0xe41f('0x1b')](_0x1fb373);}return null;};}function patchUpdates(_0x4dcb21){return function(_0x3ce4d8){try{jsonpatch[_0xe41f('0x21')](_0x3ce4d8,_0x4dcb21,!![]);}catch(_0x171851){return BPromise['reject'](_0x171851);}return _0x3ce4d8[_0xe41f('0x22')]();};}function saveUpdates(_0x3666c3,_0x37fce9){return function(_0x10ee63){if(_0x10ee63){return _0x10ee63[_0xe41f('0x23')](_0x3666c3)[_0xe41f('0x24')](function(_0x9c0c33){return _0x9c0c33;});}return null;};}function removeEntity(_0x520136,_0x18c6ba){return function(_0x5a443f){if(_0x5a443f){return _0x5a443f['destroy']()[_0xe41f('0x24')](function(){_0x520136[_0xe41f('0x19')](0xcc)[_0xe41f('0x1a')]();});}};}function handleEntityNotFound(_0x4f7965,_0x1ac25a){return function(_0x573b3){if(!_0x573b3){_0x4f7965[_0xe41f('0x18')](0x194);}return _0x573b3;};}function handleError(_0x479387,_0x15ccae){_0x15ccae=_0x15ccae||0x1f4;return function(_0x5790ae){logger[_0xe41f('0x25')](_0x5790ae[_0xe41f('0x26')]);if(_0x5790ae['name']){delete _0x5790ae[_0xe41f('0x27')];}_0x479387[_0xe41f('0x19')](_0x15ccae)[_0xe41f('0x28')](_0x5790ae);};}exports[_0xe41f('0x29')]=function(_0x348531,_0x2a7bf4){var _0x1a182b={},_0x4438cf={},_0x6ec664={'count':0x0,'rows':[]};var _0x1c3c38=_[_0xe41f('0x2a')](db[_0xe41f('0x2b')][_0xe41f('0x2c')],function(_0xbca5b0){return{'name':_0xbca5b0[_0xe41f('0x2d')],'type':_0xbca5b0['type'][_0xe41f('0x2e')]};});_0x4438cf[_0xe41f('0x2f')]=_[_0xe41f('0x2a')](_0x1c3c38,_0xe41f('0x27'));_0x4438cf[_0xe41f('0x30')]=_['keys'](_0x348531[_0xe41f('0x30')]);_0x4438cf[_0xe41f('0x31')]=_[_0xe41f('0x32')](_0x4438cf[_0xe41f('0x2f')],_0x4438cf['query']);_0x1a182b['attributes']=_['intersection'](_0x4438cf[_0xe41f('0x2f')],qs[_0xe41f('0x33')](_0x348531[_0xe41f('0x30')]['fields']));_0x1a182b[_0xe41f('0x34')]=_0x1a182b[_0xe41f('0x34')][_0xe41f('0x35')]?_0x1a182b[_0xe41f('0x34')]:_0x4438cf[_0xe41f('0x2f')];if(!_0x348531[_0xe41f('0x30')][_0xe41f('0x36')](_0xe41f('0x37'))){_0x1a182b[_0xe41f('0x1f')]=qs[_0xe41f('0x1f')](_0x348531[_0xe41f('0x30')][_0xe41f('0x1f')]);_0x1a182b['offset']=qs[_0xe41f('0x1c')](_0x348531['query'][_0xe41f('0x1c')]);}_0x1a182b['order']=qs[_0xe41f('0x38')](_0x348531['query']['sort']);_0x1a182b[_0xe41f('0x39')]=qs[_0xe41f('0x31')](_[_0xe41f('0x3a')](_0x348531[_0xe41f('0x30')],_0x4438cf[_0xe41f('0x31')]),_0x1c3c38);if(_0x348531['query'][_0xe41f('0x3b')]){_0x1a182b[_0xe41f('0x39')]=_[_0xe41f('0x3c')](_0x1a182b[_0xe41f('0x39')],{'$or':_[_0xe41f('0x2a')](_0x1c3c38,function(_0x10083c){if(_0x10083c[_0xe41f('0x3d')]!=='VIRTUAL'){var _0x438ead={};_0x438ead[_0x10083c[_0xe41f('0x27')]]={'$like':'%'+_0x348531[_0xe41f('0x30')][_0xe41f('0x3b')]+'%'};return _0x438ead;}})});}_0x1a182b=_[_0xe41f('0x3c')]({},_0x1a182b,_0x348531[_0xe41f('0x3e')]);var _0x2d0cf7={'where':_0x1a182b[_0xe41f('0x39')]};return db[_0xe41f('0x2b')]['count'](_0x2d0cf7)['then'](function(_0x537fbf){_0x6ec664['count']=_0x537fbf;if(_0x348531[_0xe41f('0x30')][_0xe41f('0x3f')]){_0x1a182b[_0xe41f('0x40')]=[{'all':!![]}];}return db['Cdr'][_0xe41f('0x41')](_0x1a182b);})[_0xe41f('0x24')](function(_0x55bf6f){_0x6ec664['rows']=_0x55bf6f;return _0x6ec664;})[_0xe41f('0x24')](respondWithFilteredResult(_0x2a7bf4,_0x1a182b))[_0xe41f('0x42')](handleError(_0x2a7bf4,null));};exports[_0xe41f('0x43')]=function(_0x384001,_0x27bdee){var _0x56e180={'raw':!![],'where':{'id':_0x384001['params']['id']}},_0x82727b={};_0x82727b[_0xe41f('0x2f')]=_[_0xe41f('0x44')](db['Cdr'][_0xe41f('0x2c')]);_0x82727b['query']=_[_0xe41f('0x44')](_0x384001[_0xe41f('0x30')]);_0x82727b[_0xe41f('0x31')]=_['intersection'](_0x82727b[_0xe41f('0x2f')],_0x82727b['query']);_0x56e180[_0xe41f('0x34')]=_[_0xe41f('0x32')](_0x82727b[_0xe41f('0x2f')],qs[_0xe41f('0x33')](_0x384001[_0xe41f('0x30')][_0xe41f('0x33')]));_0x56e180[_0xe41f('0x34')]=_0x56e180[_0xe41f('0x34')]['length']?_0x56e180[_0xe41f('0x34')]:_0x82727b['model'];if(_0x384001[_0xe41f('0x30')]['includeAll']){_0x56e180[_0xe41f('0x40')]=[{'all':!![]}];}_0x56e180=_[_0xe41f('0x3c')]({},_0x56e180,_0x384001[_0xe41f('0x3e')]);return db[_0xe41f('0x2b')]['find'](_0x56e180)[_0xe41f('0x24')](handleEntityNotFound(_0x27bdee,null))['then'](respondWithResult(_0x27bdee,null))[_0xe41f('0x42')](handleError(_0x27bdee,null));};exports[_0xe41f('0x45')]=function(_0x6154a,_0x3a5974){return db['Cdr'][_0xe41f('0x45')](_0x6154a['body'],{})['then'](respondWithResult(_0x3a5974,0xc9))['catch'](handleError(_0x3a5974,null));};exports[_0xe41f('0x23')]=function(_0x25b374,_0x59ef57){if(_0x25b374[_0xe41f('0x46')]['id']){delete _0x25b374[_0xe41f('0x46')]['id'];}return db[_0xe41f('0x2b')][_0xe41f('0x47')]({'where':{'id':_0x25b374[_0xe41f('0x48')]['id']}})[_0xe41f('0x24')](handleEntityNotFound(_0x59ef57,null))[_0xe41f('0x24')](saveUpdates(_0x25b374[_0xe41f('0x46')],null))[_0xe41f('0x24')](respondWithResult(_0x59ef57,null))[_0xe41f('0x42')](handleError(_0x59ef57,null));};exports['destroy']=function(_0x119e32,_0x97c6c6){return db[_0xe41f('0x2b')]['find']({'where':{'id':_0x119e32[_0xe41f('0x48')]['id']}})[_0xe41f('0x24')](handleEntityNotFound(_0x97c6c6,null))[_0xe41f('0x24')](removeEntity(_0x97c6c6,null))[_0xe41f('0x42')](handleError(_0x97c6c6,null));};exports[_0xe41f('0x49')]=function(_0x4f8f47,_0x23cb73){return db[_0xe41f('0x2b')]['describe']()['then'](respondWithResult(_0x23cb73,null))['catch'](handleError(_0x23cb73,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6474421..8ac7a22 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(_0x4a3874,_0x58b7c9){var _0x296a51=function(_0x4dd64a){while(--_0x4dd64a){_0x4a3874['push'](_0x4a3874['shift']());}};_0x296a51(++_0x58b7c9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x8c8715,_0xa2b6d1){var _0x78f54f=function(_0x21f547){while(--_0x21f547){_0x8c8715['push'](_0x8c8715['shift']());}};_0x78f54f(++_0xa2b6d1);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 726bda9..f546a18 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 _0x4614=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x588df1,_0x50b85e){var _0x5dd791=function(_0x53d3cb){while(--_0x53d3cb){_0x588df1['push'](_0x588df1['shift']());}};_0x5dd791(++_0x50b85e);}(_0x4614,0x77));var _0x4461=function(_0x51bbcf,_0x3324e4){_0x51bbcf=_0x51bbcf-0x0;var _0x179548=_0x4614[_0x51bbcf];return _0x179548;};'use strict';var _=require('lodash');var util=require(_0x4461('0x0'));var moment=require(_0x4461('0x1'));var BPromise=require(_0x4461('0x2'));var rs=require(_0x4461('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4461('0x4'));var logger=require(_0x4461('0x5'))(_0x4461('0x6'));var config=require(_0x4461('0x7'));var jayson=require(_0x4461('0x8'));var client=jayson[_0x4461('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20ae58,_0x1050ff,_0x190263){return new BPromise(function(_0x5ecfc2,_0x31f688){return client[_0x4461('0xa')](_0x20ae58,_0x190263)[_0x4461('0xb')](function(_0x1775da){logger[_0x4461('0xc')]('Cdr,\x20%s,\x20%s',_0x1050ff,_0x4461('0xd'));logger[_0x4461('0xe')](_0x4461('0xf'),_0x1050ff,'request\x20sent',JSON[_0x4461('0x10')](_0x1775da));if(_0x1775da['error']){if(_0x1775da[_0x4461('0x11')][_0x4461('0x12')]===0x1f4){logger[_0x4461('0x11')](_0x4461('0x13'),_0x1050ff,_0x1775da[_0x4461('0x11')][_0x4461('0x14')]);return _0x31f688(_0x1775da[_0x4461('0x11')][_0x4461('0x14')]);}logger[_0x4461('0x11')]('Cdr,\x20%s,\x20%s',_0x1050ff,_0x1775da[_0x4461('0x11')]['message']);return _0x5ecfc2(_0x1775da[_0x4461('0x11')]['message']);}else{logger['info'](_0x4461('0x13'),_0x1050ff,_0x4461('0xd'));_0x5ecfc2(_0x1775da['result'][_0x4461('0x14')]);}})[_0x4461('0x15')](function(_0x5715e3){logger['error'](_0x4461('0x13'),_0x1050ff,_0x5715e3);_0x31f688(_0x5715e3);});});} \ No newline at end of file +var _0xb414=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xb6d3d6,_0x5988da){var _0xc3e590=function(_0x45ca39){while(--_0x45ca39){_0xb6d3d6['push'](_0xb6d3d6['shift']());}};_0xc3e590(++_0x5988da);}(_0xb414,0x1dd));var _0x4b41=function(_0x36708e,_0x548a97){_0x36708e=_0x36708e-0x0;var _0x24fed0=_0xb414[_0x36708e];return _0x24fed0;};'use strict';var _=require(_0x4b41('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4b41('0x1'));var rs=require(_0x4b41('0x2'));var fs=require('fs');var Redis=require(_0x4b41('0x3'));var db=require(_0x4b41('0x4'))['db'];var utils=require(_0x4b41('0x5'));var logger=require(_0x4b41('0x6'))(_0x4b41('0x7'));var config=require(_0x4b41('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b41('0x9')][_0x4b41('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c6cb6,_0x30d111,_0x307926){return new BPromise(function(_0x493de7,_0x1de6d6){return client[_0x4b41('0xb')](_0x9c6cb6,_0x307926)[_0x4b41('0xc')](function(_0x2019cb){logger[_0x4b41('0xd')]('Cdr,\x20%s,\x20%s',_0x30d111,_0x4b41('0xe'));logger[_0x4b41('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x30d111,_0x4b41('0xe'),JSON[_0x4b41('0x10')](_0x2019cb));if(_0x2019cb[_0x4b41('0x11')]){if(_0x2019cb[_0x4b41('0x11')][_0x4b41('0x12')]===0x1f4){logger[_0x4b41('0x11')]('Cdr,\x20%s,\x20%s',_0x30d111,_0x2019cb['error']['message']);return _0x1de6d6(_0x2019cb['error']['message']);}logger[_0x4b41('0x11')](_0x4b41('0x13'),_0x30d111,_0x2019cb[_0x4b41('0x11')][_0x4b41('0x14')]);return _0x493de7(_0x2019cb['error'][_0x4b41('0x14')]);}else{logger[_0x4b41('0xd')](_0x4b41('0x13'),_0x30d111,_0x4b41('0xe'));_0x493de7(_0x2019cb[_0x4b41('0x15')][_0x4b41('0x14')]);}})[_0x4b41('0x16')](function(_0x3461b6){logger['error']('Cdr,\x20%s,\x20%s',_0x30d111,_0x3461b6);_0x1de6d6(_0x3461b6);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index ba054ab..65eb256 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x36aa05,_0x3117cc){var _0x293263=function(_0x1bdc70){while(--_0x1bdc70){_0x36aa05['push'](_0x36aa05['shift']());}};_0x293263(++_0x3117cc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 5118f58..5ff870b 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 _0x152b=['sequelize','STRING','noop','*,*,*,*'];(function(_0x14b268,_0x51e2b7){var _0x14f94c=function(_0x37e377){while(--_0x37e377){_0x14b268['push'](_0x14b268['shift']());}};_0x14f94c(++_0x51e2b7);}(_0x152b,0x128));var _0xb152=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x152b[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0xb152('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb152('0x1')],'allowNull':![],'defaultValue':_0xb152('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb152('0x1')]},'interval':{'type':Sequelize[_0xb152('0x1')],'defaultValue':_0xb152('0x3')}}; \ No newline at end of file +var _0xc99d=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc99d,0x1ae));var _0xdc99=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xc99d[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0xdc99('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdc99('0x1')],'allowNull':![],'defaultValue':_0xdc99('0x2')},'appdata':{'type':Sequelize[_0xdc99('0x3')]()},'description':{'type':Sequelize[_0xdc99('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdc99('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 3eeda7e..cb2ee4c 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 _0x4a3d=['params','eml-format','rimraf','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','show','model','ChatApplication','rawAttributes','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','catch','body','find'];(function(_0x33e370,_0x3d702a){var _0x27249d=function(_0x49ae88){while(--_0x49ae88){_0x33e370['push'](_0x33e370['shift']());}};_0x27249d(++_0x3d702a);}(_0x4a3d,0x79));var _0xd4a3=function(_0x2e8202,_0x4fc5eb){_0x2e8202=_0x2e8202-0x0;var _0x1a4220=_0x4a3d[_0x2e8202];return _0x1a4220;};'use strict';var emlformat=require(_0xd4a3('0x0'));var rimraf=require(_0xd4a3('0x1'));var zipdir=require(_0xd4a3('0x2'));var jsonpatch=require(_0xd4a3('0x3'));var rp=require(_0xd4a3('0x4'));var moment=require(_0xd4a3('0x5'));var BPromise=require(_0xd4a3('0x6'));var Mustache=require(_0xd4a3('0x7'));var util=require(_0xd4a3('0x8'));var path=require(_0xd4a3('0x9'));var sox=require(_0xd4a3('0xa'));var csv=require(_0xd4a3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4a3('0xc'));var squel=require(_0xd4a3('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd4a3('0xe'));var toCsv=require(_0xd4a3('0xb'));var querystring=require(_0xd4a3('0xf'));var Papa=require(_0xd4a3('0x10'));var Redis=require(_0xd4a3('0x11'));var authService=require(_0xd4a3('0x12'));var qs=require(_0xd4a3('0x13'));var as=require(_0xd4a3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4a3('0x15'))(_0xd4a3('0x16'));var utils=require(_0xd4a3('0x17'));var config=require(_0xd4a3('0x18'));var licenseUtil=require(_0xd4a3('0x19'));var db=require(_0xd4a3('0x1a'))['db'];function respondWithStatusCode(_0x3e7728,_0x57bd90){_0x57bd90=_0x57bd90||0xcc;return function(_0x3548e4){if(_0x3548e4){return _0x3e7728[_0xd4a3('0x1b')](_0x57bd90);}return _0x3e7728[_0xd4a3('0x1c')](_0x57bd90)[_0xd4a3('0x1d')]();};}function respondWithResult(_0xd28551,_0x11f325){_0x11f325=_0x11f325||0xc8;return function(_0x2bfeb6){if(_0x2bfeb6){return _0xd28551[_0xd4a3('0x1c')](_0x11f325)['json'](_0x2bfeb6);}};}function respondWithFilteredResult(_0x5d16e8,_0x140379){return function(_0x2f96bb){if(_0x2f96bb){var _0x124d03=typeof _0x140379[_0xd4a3('0x1e')]===_0xd4a3('0x1f')&&typeof _0x140379[_0xd4a3('0x20')]==='undefined';var _0x2a3b7e=_0x2f96bb['count'];var _0xf9fc3c=_0x124d03?0x0:_0x140379['offset'];var _0x21fa36=_0x124d03?_0x2f96bb['count']:_0x140379[_0xd4a3('0x1e')]+_0x140379[_0xd4a3('0x20')];var _0x4be8b7;if(_0x21fa36>=_0x2a3b7e){_0x21fa36=_0x2a3b7e;_0x4be8b7=0xc8;}else{_0x4be8b7=0xce;}_0x5d16e8[_0xd4a3('0x1c')](_0x4be8b7);return _0x5d16e8[_0xd4a3('0x21')](_0xd4a3('0x22'),_0xf9fc3c+'-'+_0x21fa36+'/'+_0x2a3b7e)['json'](_0x2f96bb);}return null;};}function patchUpdates(_0x4a1cf0){return function(_0x21efd7){try{jsonpatch['apply'](_0x21efd7,_0x4a1cf0,!![]);}catch(_0x402201){return BPromise[_0xd4a3('0x23')](_0x402201);}return _0x21efd7['save']();};}function saveUpdates(_0x5bc708,_0x4f957f){return function(_0x40535d){if(_0x40535d){return _0x40535d[_0xd4a3('0x24')](_0x5bc708)[_0xd4a3('0x25')](function(_0x5717f7){return _0x5717f7;});}return null;};}function removeEntity(_0x2de130,_0x137bba){return function(_0x1a4ced){if(_0x1a4ced){return _0x1a4ced[_0xd4a3('0x26')]()[_0xd4a3('0x25')](function(){_0x2de130[_0xd4a3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35a871,_0x1dea89){return function(_0x50c8ac){if(!_0x50c8ac){_0x35a871[_0xd4a3('0x1b')](0x194);}return _0x50c8ac;};}function handleError(_0x42f100,_0x26cb96){_0x26cb96=_0x26cb96||0x1f4;return function(_0x4ce98a){logger[_0xd4a3('0x27')](_0x4ce98a[_0xd4a3('0x28')]);if(_0x4ce98a[_0xd4a3('0x29')]){delete _0x4ce98a['name'];}_0x42f100[_0xd4a3('0x1c')](_0x26cb96)['send'](_0x4ce98a);};}exports[_0xd4a3('0x2a')]=function(_0x523871,_0x3019a4){var _0x5d84f2={'raw':!![],'where':{'id':_0x523871['params']['id']}},_0x2769b7={};_0x2769b7[_0xd4a3('0x2b')]=_['keys'](db[_0xd4a3('0x2c')][_0xd4a3('0x2d')]);_0x2769b7[_0xd4a3('0x2e')]=_[_0xd4a3('0x2f')](_0x523871[_0xd4a3('0x2e')]);_0x2769b7['filters']=_['intersection'](_0x2769b7[_0xd4a3('0x2b')],_0x2769b7[_0xd4a3('0x2e')]);_0x5d84f2[_0xd4a3('0x30')]=_[_0xd4a3('0x31')](_0x2769b7['model'],qs[_0xd4a3('0x32')](_0x523871[_0xd4a3('0x2e')]['fields']));_0x5d84f2[_0xd4a3('0x30')]=_0x5d84f2['attributes'][_0xd4a3('0x33')]?_0x5d84f2[_0xd4a3('0x30')]:_0x2769b7[_0xd4a3('0x2b')];if(_0x523871[_0xd4a3('0x2e')][_0xd4a3('0x34')]){_0x5d84f2[_0xd4a3('0x35')]=[{'all':!![]}];}_0x5d84f2=_[_0xd4a3('0x36')]({},_0x5d84f2,_0x523871[_0xd4a3('0x37')]);return db[_0xd4a3('0x2c')]['find'](_0x5d84f2)[_0xd4a3('0x25')](handleEntityNotFound(_0x3019a4,null))[_0xd4a3('0x25')](respondWithResult(_0x3019a4,null))[_0xd4a3('0x38')](handleError(_0x3019a4,null));};exports['update']=function(_0x124400,_0x1f579b){if(_0x124400[_0xd4a3('0x39')]['id']){delete _0x124400[_0xd4a3('0x39')]['id'];}return db[_0xd4a3('0x2c')][_0xd4a3('0x3a')]({'where':{'id':_0x124400[_0xd4a3('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1f579b,null))[_0xd4a3('0x25')](saveUpdates(_0x124400['body'],null))['then'](respondWithResult(_0x1f579b,null))[_0xd4a3('0x38')](handleError(_0x1f579b,null));};exports[_0xd4a3('0x26')]=function(_0x2c0d62,_0x3e8c7d){return db['ChatApplication'][_0xd4a3('0x3a')]({'where':{'id':_0x2c0d62['params']['id']}})[_0xd4a3('0x25')](handleEntityNotFound(_0x3e8c7d,null))[_0xd4a3('0x25')](removeEntity(_0x3e8c7d,null))[_0xd4a3('0x38')](handleError(_0x3e8c7d,null));}; \ No newline at end of file +var _0x8ba2=['reject','save','update','then','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x3e7b86,_0x3a4c16){var _0x56ef5d=function(_0x29c0f0){while(--_0x29c0f0){_0x3e7b86['push'](_0x3e7b86['shift']());}};_0x56ef5d(++_0x3a4c16);}(_0x8ba2,0x13f));var _0x28ba=function(_0x416efd,_0x3085d9){_0x416efd=_0x416efd-0x0;var _0x44f804=_0x8ba2[_0x416efd];return _0x44f804;};'use strict';var emlformat=require(_0x28ba('0x0'));var rimraf=require(_0x28ba('0x1'));var zipdir=require(_0x28ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ba('0x3'));var moment=require(_0x28ba('0x4'));var BPromise=require(_0x28ba('0x5'));var Mustache=require('mustache');var util=require(_0x28ba('0x6'));var path=require(_0x28ba('0x7'));var sox=require(_0x28ba('0x8'));var csv=require(_0x28ba('0x9'));var ejs=require(_0x28ba('0xa'));var fs=require('fs');var fs_extra=require(_0x28ba('0xb'));var _=require('lodash');var squel=require(_0x28ba('0xc'));var crypto=require(_0x28ba('0xd'));var jsforce=require(_0x28ba('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x28ba('0x9'));var querystring=require(_0x28ba('0xf'));var Papa=require(_0x28ba('0x10'));var Redis=require(_0x28ba('0x11'));var authService=require(_0x28ba('0x12'));var qs=require(_0x28ba('0x13'));var as=require(_0x28ba('0x14'));var hardwareService=require(_0x28ba('0x15'));var logger=require(_0x28ba('0x16'))(_0x28ba('0x17'));var utils=require('../../config/utils');var config=require(_0x28ba('0x18'));var licenseUtil=require(_0x28ba('0x19'));var db=require(_0x28ba('0x1a'))['db'];function respondWithStatusCode(_0x299f63,_0x1204af){_0x1204af=_0x1204af||0xcc;return function(_0x3a9644){if(_0x3a9644){return _0x299f63[_0x28ba('0x1b')](_0x1204af);}return _0x299f63['status'](_0x1204af)[_0x28ba('0x1c')]();};}function respondWithResult(_0x3cf923,_0x4ebcd6){_0x4ebcd6=_0x4ebcd6||0xc8;return function(_0x29cd51){if(_0x29cd51){return _0x3cf923[_0x28ba('0x1d')](_0x4ebcd6)[_0x28ba('0x1e')](_0x29cd51);}};}function respondWithFilteredResult(_0x1c5998,_0x563797){return function(_0x24b3f3){if(_0x24b3f3){var _0x38df4f=typeof _0x563797[_0x28ba('0x1f')]===_0x28ba('0x20')&&typeof _0x563797[_0x28ba('0x21')]==='undefined';var _0x571c92=_0x24b3f3[_0x28ba('0x22')];var _0x182824=_0x38df4f?0x0:_0x563797[_0x28ba('0x1f')];var _0x2cf1cf=_0x38df4f?_0x24b3f3[_0x28ba('0x22')]:_0x563797[_0x28ba('0x1f')]+_0x563797[_0x28ba('0x21')];var _0x31a45b;if(_0x2cf1cf>=_0x571c92){_0x2cf1cf=_0x571c92;_0x31a45b=0xc8;}else{_0x31a45b=0xce;}_0x1c5998[_0x28ba('0x1d')](_0x31a45b);return _0x1c5998['set']('Content-Range',_0x182824+'-'+_0x2cf1cf+'/'+_0x571c92)[_0x28ba('0x1e')](_0x24b3f3);}return null;};}function patchUpdates(_0x4352a4){return function(_0x5d3d33){try{jsonpatch['apply'](_0x5d3d33,_0x4352a4,!![]);}catch(_0xf9e0f4){return BPromise[_0x28ba('0x23')](_0xf9e0f4);}return _0x5d3d33[_0x28ba('0x24')]();};}function saveUpdates(_0x17b1f4,_0x425732){return function(_0x4ff05c){if(_0x4ff05c){return _0x4ff05c[_0x28ba('0x25')](_0x17b1f4)[_0x28ba('0x26')](function(_0x1684af){return _0x1684af;});}return null;};}function removeEntity(_0x3eec5d,_0x27a579){return function(_0x256892){if(_0x256892){return _0x256892['destroy']()[_0x28ba('0x26')](function(){_0x3eec5d[_0x28ba('0x1d')](0xcc)[_0x28ba('0x1c')]();});}};}function handleEntityNotFound(_0x1d3fd1,_0x43e6c1){return function(_0x35ed28){if(!_0x35ed28){_0x1d3fd1['sendStatus'](0x194);}return _0x35ed28;};}function handleError(_0x3a06ae,_0x362254){_0x362254=_0x362254||0x1f4;return function(_0x599b88){logger['error'](_0x599b88[_0x28ba('0x27')]);if(_0x599b88[_0x28ba('0x28')]){delete _0x599b88['name'];}_0x3a06ae['status'](_0x362254)[_0x28ba('0x29')](_0x599b88);};}exports[_0x28ba('0x2a')]=function(_0x39cd83,_0x30afd){var _0x3b3d3c={'raw':!![],'where':{'id':_0x39cd83[_0x28ba('0x2b')]['id']}},_0x1176a7={};_0x1176a7[_0x28ba('0x2c')]=_[_0x28ba('0x2d')](db[_0x28ba('0x2e')][_0x28ba('0x2f')]);_0x1176a7[_0x28ba('0x30')]=_[_0x28ba('0x2d')](_0x39cd83[_0x28ba('0x30')]);_0x1176a7['filters']=_[_0x28ba('0x31')](_0x1176a7[_0x28ba('0x2c')],_0x1176a7[_0x28ba('0x30')]);_0x3b3d3c['attributes']=_[_0x28ba('0x31')](_0x1176a7[_0x28ba('0x2c')],qs[_0x28ba('0x32')](_0x39cd83['query'][_0x28ba('0x32')]));_0x3b3d3c[_0x28ba('0x33')]=_0x3b3d3c[_0x28ba('0x33')][_0x28ba('0x34')]?_0x3b3d3c[_0x28ba('0x33')]:_0x1176a7[_0x28ba('0x2c')];if(_0x39cd83[_0x28ba('0x30')][_0x28ba('0x35')]){_0x3b3d3c[_0x28ba('0x36')]=[{'all':!![]}];}_0x3b3d3c=_[_0x28ba('0x37')]({},_0x3b3d3c,_0x39cd83['options']);return db[_0x28ba('0x2e')][_0x28ba('0x38')](_0x3b3d3c)[_0x28ba('0x26')](handleEntityNotFound(_0x30afd,null))['then'](respondWithResult(_0x30afd,null))[_0x28ba('0x39')](handleError(_0x30afd,null));};exports[_0x28ba('0x25')]=function(_0x418ce2,_0x3618f6){if(_0x418ce2[_0x28ba('0x3a')]['id']){delete _0x418ce2[_0x28ba('0x3a')]['id'];}return db[_0x28ba('0x2e')][_0x28ba('0x38')]({'where':{'id':_0x418ce2[_0x28ba('0x2b')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x3618f6,null))[_0x28ba('0x26')](saveUpdates(_0x418ce2[_0x28ba('0x3a')],null))['then'](respondWithResult(_0x3618f6,null))['catch'](handleError(_0x3618f6,null));};exports['destroy']=function(_0x1c3ca2,_0x3f3ff2){return db['ChatApplication'][_0x28ba('0x38')]({'where':{'id':_0x1c3ca2[_0x28ba('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3f3ff2,null))['then'](removeEntity(_0x3f3ff2,null))[_0x28ba('0x39')](handleError(_0x3f3ff2,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 1120527..421c70c 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 _0x7eea=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1dfab0,_0x38bce3){var _0x5f041a=function(_0x42efb2){while(--_0x42efb2){_0x1dfab0['push'](_0x1dfab0['shift']());}};_0x5f041a(++_0x38bce3);}(_0x7eea,0x7e));var _0xa7ee=function(_0x11d889,_0x878a1f){_0x11d889=_0x11d889-0x0;var _0x5e02a8=_0x7eea[_0x11d889];return _0x5e02a8;};'use strict';var _=require(_0xa7ee('0x0'));var util=require(_0xa7ee('0x1'));var logger=require(_0xa7ee('0x2'))(_0xa7ee('0x3'));var moment=require(_0xa7ee('0x4'));var BPromise=require(_0xa7ee('0x5'));var rp=require(_0xa7ee('0x6'));var fs=require('fs');var path=require(_0xa7ee('0x7'));var rimraf=require(_0xa7ee('0x8'));var config=require(_0xa7ee('0x9'));var attributes=require(_0xa7ee('0xa'));module['exports']=function(_0x2c726c,_0x3f3417){return _0x2c726c[_0xa7ee('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa7ee('0xc'),'collate':_0xa7ee('0xd')});}; \ No newline at end of file +var _0x4eca=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication'];(function(_0x303526,_0x58865d){var _0x2be0be=function(_0x2a32ad){while(--_0x2a32ad){_0x303526['push'](_0x303526['shift']());}};_0x2be0be(++_0x58865d);}(_0x4eca,0xab));var _0xa4ec=function(_0x8863e4,_0xd43197){_0x8863e4=_0x8863e4-0x0;var _0x292e75=_0x4eca[_0x8863e4];return _0x292e75;};'use strict';var _=require(_0xa4ec('0x0'));var util=require(_0xa4ec('0x1'));var logger=require('../../config/logger')(_0xa4ec('0x2'));var moment=require(_0xa4ec('0x3'));var BPromise=require(_0xa4ec('0x4'));var rp=require(_0xa4ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4ec('0x6'));var config=require(_0xa4ec('0x7'));var attributes=require(_0xa4ec('0x8'));module[_0xa4ec('0x9')]=function(_0x453e75,_0x193d19){return _0x453e75['define'](_0xa4ec('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa4ec('0xb'),'collate':_0xa4ec('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5664d28..0ae74cc 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 _0xa488=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x5ea08c,_0x4152fa){var _0x56edb7=function(_0x12b22d){while(--_0x12b22d){_0x5ea08c['push'](_0x5ea08c['shift']());}};_0x56edb7(++_0x4152fa);}(_0xa488,0xd7));var _0x8a48=function(_0x23a299,_0x30e49c){_0x23a299=_0x23a299-0x0;var _0x560bb3=_0xa488[_0x23a299];return _0x560bb3;};'use strict';var _=require(_0x8a48('0x0'));var util=require(_0x8a48('0x1'));var moment=require('moment');var BPromise=require(_0x8a48('0x2'));var rs=require(_0x8a48('0x3'));var fs=require('fs');var Redis=require(_0x8a48('0x4'));var db=require(_0x8a48('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8a48('0x6'));var config=require(_0x8a48('0x7'));var jayson=require(_0x8a48('0x8'));var client=jayson[_0x8a48('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f3e3,_0x5dc725,_0x59a80f){return new BPromise(function(_0x4b7997,_0x49a7ee){return client[_0x8a48('0xa')](_0x35f3e3,_0x59a80f)[_0x8a48('0xb')](function(_0x471a3b){logger[_0x8a48('0xc')](_0x8a48('0xd'),_0x5dc725,_0x8a48('0xe'));logger[_0x8a48('0xf')](_0x8a48('0x10'),_0x5dc725,_0x8a48('0xe'),JSON[_0x8a48('0x11')](_0x471a3b));if(_0x471a3b['error']){if(_0x471a3b[_0x8a48('0x12')][_0x8a48('0x13')]===0x1f4){logger[_0x8a48('0x12')](_0x8a48('0xd'),_0x5dc725,_0x471a3b[_0x8a48('0x12')][_0x8a48('0x14')]);return _0x49a7ee(_0x471a3b['error'][_0x8a48('0x14')]);}logger['error'](_0x8a48('0xd'),_0x5dc725,_0x471a3b[_0x8a48('0x12')][_0x8a48('0x14')]);return _0x4b7997(_0x471a3b[_0x8a48('0x12')]['message']);}else{logger[_0x8a48('0xc')](_0x8a48('0xd'),_0x5dc725,'request\x20sent');_0x4b7997(_0x471a3b[_0x8a48('0x15')][_0x8a48('0x14')]);}})[_0x8a48('0x16')](function(_0x2bf2e1){logger[_0x8a48('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5dc725,_0x2bf2e1);_0x49a7ee(_0x2bf2e1);});});} \ No newline at end of file +var _0xeace=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xeace,0xef));var _0xeeac=function(_0xa351da,_0x3aa8f8){_0xa351da=_0xa351da-0x0;var _0xd60f35=_0xeace[_0xa351da];return _0xd60f35;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeeac('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeeac('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xeeac('0x2'));var logger=require(_0xeeac('0x3'))(_0xeeac('0x4'));var config=require(_0xeeac('0x5'));var jayson=require(_0xeeac('0x6'));var client=jayson[_0xeeac('0x7')][_0xeeac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfeb3ac,_0x261609,_0x4fd8d4){return new BPromise(function(_0x47401b,_0x5be1ee){return client[_0xeeac('0x9')](_0xfeb3ac,_0x4fd8d4)['then'](function(_0x4f5694){logger[_0xeeac('0xa')](_0xeeac('0xb'),_0x261609,_0xeeac('0xc'));logger[_0xeeac('0xd')](_0xeeac('0xe'),_0x261609,'request\x20sent',JSON[_0xeeac('0xf')](_0x4f5694));if(_0x4f5694[_0xeeac('0x10')]){if(_0x4f5694[_0xeeac('0x10')]['code']===0x1f4){logger[_0xeeac('0x10')]('ChatApplication,\x20%s,\x20%s',_0x261609,_0x4f5694[_0xeeac('0x10')][_0xeeac('0x11')]);return _0x5be1ee(_0x4f5694[_0xeeac('0x10')][_0xeeac('0x11')]);}logger[_0xeeac('0x10')](_0xeeac('0xb'),_0x261609,_0x4f5694[_0xeeac('0x10')]['message']);return _0x47401b(_0x4f5694['error'][_0xeeac('0x11')]);}else{logger[_0xeeac('0xa')]('ChatApplication,\x20%s,\x20%s',_0x261609,_0xeeac('0xc'));_0x47401b(_0x4f5694[_0xeeac('0x12')]['message']);}})[_0xeeac('0x13')](function(_0x112141){logger[_0xeeac('0x10')]('ChatApplication,\x20%s,\x20%s',_0x261609,_0x112141);_0x5be1ee(_0x112141);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 7a2082e..51fa19a 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 _0x2df5=['destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','update','delete'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x2df5,0x11f));var _0x52df=function(_0x5b4949,_0xe9f0e9){_0x5b4949=_0x5b4949-0x0;var _0x58939f=_0x2df5[_0x5b4949];return _0x58939f;};'use strict';var multer=require(_0x52df('0x0'));var util=require(_0x52df('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x52df('0x2'));var router=express[_0x52df('0x3')]();var fs_extra=require(_0x52df('0x4'));var auth=require(_0x52df('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x52df('0x6'));var controller=require(_0x52df('0x7'));router[_0x52df('0x8')]('/:id',auth[_0x52df('0x9')](),controller[_0x52df('0xa')]);router['put']('/:id',auth[_0x52df('0x9')](),controller[_0x52df('0xb')]);router[_0x52df('0xc')]('/:id',auth[_0x52df('0x9')](),controller[_0x52df('0xd')]);module[_0x52df('0xe')]=router; \ No newline at end of file +var _0xb405=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update'];(function(_0x2f9849,_0x209c0e){var _0x1aefac=function(_0x127084){while(--_0x127084){_0x2f9849['push'](_0x2f9849['shift']());}};_0x1aefac(++_0x209c0e);}(_0xb405,0x1c1));var _0x5b40=function(_0x3308bc,_0x4dc63b){_0x3308bc=_0x3308bc-0x0;var _0x2f13d4=_0xb405[_0x3308bc];return _0x2f13d4;};'use strict';var multer=require('multer');var util=require(_0x5b40('0x0'));var path=require(_0x5b40('0x1'));var timeout=require(_0x5b40('0x2'));var express=require('express');var router=express[_0x5b40('0x3')]();var fs_extra=require(_0x5b40('0x4'));var auth=require(_0x5b40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b40('0x6'));var controller=require(_0x5b40('0x7'));router[_0x5b40('0x8')](_0x5b40('0x9'),auth[_0x5b40('0xa')](),controller[_0x5b40('0xb')]);router['put']('/:id',auth[_0x5b40('0xa')](),controller[_0x5b40('0xc')]);router['delete'](_0x5b40('0x9'),auth[_0x5b40('0xa')](),controller['destroy']);module[_0x5b40('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 401d70b..1097169 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 _0x8d59=['BOOLEAN','sequelize','exports','STRING'];(function(_0x28cf20,_0x11a21d){var _0x1f69e1=function(_0x1f649a){while(--_0x1f649a){_0x28cf20['push'](_0x28cf20['shift']());}};_0x1f69e1(++_0x11a21d);}(_0x8d59,0x109));var _0x98d5=function(_0x461edf,_0x55a4b5){_0x461edf=_0x461edf-0x0;var _0x2260ae=_0x8d59[_0x461edf];return _0x2260ae;};'use strict';var Sequelize=require(_0x98d5('0x0'));module[_0x98d5('0x1')]={'name':{'type':Sequelize[_0x98d5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x98d5('0x2')]},'write':{'type':Sequelize[_0x98d5('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa428=['STRING','BOOLEAN','sequelize'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xa428,0x7a));var _0x8a42=function(_0x2ccf5e,_0x3ce224){_0x2ccf5e=_0x2ccf5e-0x0;var _0x63e859=_0xa428[_0x2ccf5e];return _0x63e859;};'use strict';var Sequelize=require(_0x8a42('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8a42('0x1')]},'write':{'type':Sequelize[_0x8a42('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 da7c86b..dbd8edb 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 _0x3c6c=['sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','ChatGroup','includeAll','include','findAll','rows','catch','params','find','create','body','describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','order','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xcb4aa9,_0x1a2203){var _0x585a69=function(_0x25aeb4){while(--_0x25aeb4){_0xcb4aa9['push'](_0xcb4aa9['shift']());}};_0x585a69(++_0x1a2203);}(_0x3c6c,0xb3));var _0xc3c6=function(_0x3a48bf,_0x11af40){_0x3a48bf=_0x3a48bf-0x0;var _0x3d5c23=_0x3c6c[_0x3a48bf];return _0x3d5c23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3c6('0x0'));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(_0xc3c6('0x9'));var csv=require(_0xc3c6('0xa'));var ejs=require(_0xc3c6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc3c6('0xc'));var crypto=require(_0xc3c6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc3c6('0xe'));var Redis=require('ioredis');var authService=require(_0xc3c6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc3c6('0x10'));var hardwareService=require(_0xc3c6('0x11'));var logger=require(_0xc3c6('0x12'))(_0xc3c6('0x13'));var utils=require(_0xc3c6('0x14'));var config=require(_0xc3c6('0x15'));var licenseUtil=require(_0xc3c6('0x16'));var db=require('../../mysqldb')['db'];config[_0xc3c6('0x17')]=_['defaults'](config['redis'],{'host':_0xc3c6('0x18'),'port':0x18eb});var socket=require(_0xc3c6('0x19'))(new Redis(config[_0xc3c6('0x17')]));require(_0xc3c6('0x1a'))[_0xc3c6('0x1b')](socket);function respondWithStatusCode(_0x43693,_0x433350){_0x433350=_0x433350||0xcc;return function(_0x430ddc){if(_0x430ddc){return _0x43693['sendStatus'](_0x433350);}return _0x43693[_0xc3c6('0x1c')](_0x433350)[_0xc3c6('0x1d')]();};}function respondWithResult(_0x16bb77,_0x3a4ec1){_0x3a4ec1=_0x3a4ec1||0xc8;return function(_0x1eba2c){if(_0x1eba2c){return _0x16bb77['status'](_0x3a4ec1)[_0xc3c6('0x1e')](_0x1eba2c);}};}function respondWithFilteredResult(_0x24fc29,_0x4c0ba5){return function(_0x314872){if(_0x314872){var _0x4329e8=typeof _0x4c0ba5[_0xc3c6('0x1f')]===_0xc3c6('0x20')&&typeof _0x4c0ba5[_0xc3c6('0x21')]==='undefined';var _0x49b140=_0x314872[_0xc3c6('0x22')];var _0x319cda=_0x4329e8?0x0:_0x4c0ba5[_0xc3c6('0x1f')];var _0x13a2de=_0x4329e8?_0x314872[_0xc3c6('0x22')]:_0x4c0ba5[_0xc3c6('0x1f')]+_0x4c0ba5[_0xc3c6('0x21')];var _0x3948b3;if(_0x13a2de>=_0x49b140){_0x13a2de=_0x49b140;_0x3948b3=0xc8;}else{_0x3948b3=0xce;}_0x24fc29[_0xc3c6('0x1c')](_0x3948b3);return _0x24fc29['set'](_0xc3c6('0x23'),_0x319cda+'-'+_0x13a2de+'/'+_0x49b140)[_0xc3c6('0x1e')](_0x314872);}return null;};}function patchUpdates(_0x2262d1){return function(_0x30623b){try{jsonpatch[_0xc3c6('0x24')](_0x30623b,_0x2262d1,!![]);}catch(_0x2d0ab8){return BPromise[_0xc3c6('0x25')](_0x2d0ab8);}return _0x30623b[_0xc3c6('0x26')]();};}function saveUpdates(_0x5abcbe,_0x4b9239){return function(_0x29f0a3){if(_0x29f0a3){return _0x29f0a3[_0xc3c6('0x27')](_0x5abcbe)['then'](function(_0x4e5ef9){return _0x4e5ef9;});}return null;};}function removeEntity(_0x16a183,_0x355496){return function(_0x247822){if(_0x247822){return _0x247822[_0xc3c6('0x28')]()[_0xc3c6('0x29')](function(){_0x16a183[_0xc3c6('0x1c')](0xcc)[_0xc3c6('0x1d')]();});}};}function handleEntityNotFound(_0x1def9e,_0x52e2c7){return function(_0x3ea91d){if(!_0x3ea91d){_0x1def9e[_0xc3c6('0x2a')](0x194);}return _0x3ea91d;};}function handleError(_0x28f2bb,_0x4e42cb){_0x4e42cb=_0x4e42cb||0x1f4;return function(_0x3cf22e){logger[_0xc3c6('0x2b')](_0x3cf22e[_0xc3c6('0x2c')]);if(_0x3cf22e['name']){delete _0x3cf22e[_0xc3c6('0x2d')];}_0x28f2bb[_0xc3c6('0x1c')](_0x4e42cb)['send'](_0x3cf22e);};}exports[_0xc3c6('0x2e')]=function(_0x118042,_0x37fb0c){var _0x5d496f={},_0xf87a71={},_0x754098={'count':0x0,'rows':[]};var _0x21c1c3=_['map'](db['ChatGroup'][_0xc3c6('0x2f')],function(_0x44a917){return{'name':_0x44a917['fieldName'],'type':_0x44a917['type'][_0xc3c6('0x30')]};});_0xf87a71[_0xc3c6('0x31')]=_[_0xc3c6('0x32')](_0x21c1c3,'name');_0xf87a71[_0xc3c6('0x33')]=_[_0xc3c6('0x34')](_0x118042[_0xc3c6('0x33')]);_0xf87a71[_0xc3c6('0x35')]=_[_0xc3c6('0x36')](_0xf87a71[_0xc3c6('0x31')],_0xf87a71[_0xc3c6('0x33')]);_0x5d496f[_0xc3c6('0x37')]=_['intersection'](_0xf87a71[_0xc3c6('0x31')],qs['fields'](_0x118042[_0xc3c6('0x33')][_0xc3c6('0x38')]));_0x5d496f['attributes']=_0x5d496f[_0xc3c6('0x37')][_0xc3c6('0x39')]?_0x5d496f[_0xc3c6('0x37')]:_0xf87a71[_0xc3c6('0x31')];if(!_0x118042['query']['hasOwnProperty'](_0xc3c6('0x3a'))){_0x5d496f[_0xc3c6('0x21')]=qs[_0xc3c6('0x21')](_0x118042['query']['limit']);_0x5d496f[_0xc3c6('0x1f')]=qs[_0xc3c6('0x1f')](_0x118042['query'][_0xc3c6('0x1f')]);}_0x5d496f['order']=qs[_0xc3c6('0x3b')](_0x118042[_0xc3c6('0x33')]['sort']);_0x5d496f[_0xc3c6('0x3c')]=qs[_0xc3c6('0x35')](_[_0xc3c6('0x3d')](_0x118042[_0xc3c6('0x33')],_0xf87a71['filters']),_0x21c1c3);if(_0x118042[_0xc3c6('0x33')][_0xc3c6('0x3e')]){_0x5d496f[_0xc3c6('0x3c')]=_['merge'](_0x5d496f[_0xc3c6('0x3c')],{'$or':_['map'](_0x21c1c3,function(_0x361d6b){if(_0x361d6b[_0xc3c6('0x3f')]!==_0xc3c6('0x40')){var _0x3b735f={};_0x3b735f[_0x361d6b['name']]={'$like':'%'+_0x118042['query'][_0xc3c6('0x3e')]+'%'};return _0x3b735f;}})});}_0x5d496f=_[_0xc3c6('0x41')]({},_0x5d496f,_0x118042[_0xc3c6('0x42')]);var _0xdada0c={'where':_0x5d496f[_0xc3c6('0x3c')]};return db[_0xc3c6('0x43')][_0xc3c6('0x22')](_0xdada0c)[_0xc3c6('0x29')](function(_0x2a794f){_0x754098[_0xc3c6('0x22')]=_0x2a794f;if(_0x118042[_0xc3c6('0x33')][_0xc3c6('0x44')]){_0x5d496f[_0xc3c6('0x45')]=[{'all':!![]}];}return db[_0xc3c6('0x43')][_0xc3c6('0x46')](_0x5d496f);})[_0xc3c6('0x29')](function(_0x48a777){_0x754098[_0xc3c6('0x47')]=_0x48a777;return _0x754098;})[_0xc3c6('0x29')](respondWithFilteredResult(_0x37fb0c,_0x5d496f))[_0xc3c6('0x48')](handleError(_0x37fb0c,null));};exports['show']=function(_0x300639,_0x5b318c){var _0x3c6fa5={'raw':!![],'where':{'id':_0x300639[_0xc3c6('0x49')]['id']}},_0x244498={};_0x244498[_0xc3c6('0x31')]=_[_0xc3c6('0x34')](db['ChatGroup'][_0xc3c6('0x2f')]);_0x244498[_0xc3c6('0x33')]=_[_0xc3c6('0x34')](_0x300639[_0xc3c6('0x33')]);_0x244498[_0xc3c6('0x35')]=_[_0xc3c6('0x36')](_0x244498[_0xc3c6('0x31')],_0x244498[_0xc3c6('0x33')]);_0x3c6fa5['attributes']=_[_0xc3c6('0x36')](_0x244498[_0xc3c6('0x31')],qs[_0xc3c6('0x38')](_0x300639[_0xc3c6('0x33')][_0xc3c6('0x38')]));_0x3c6fa5[_0xc3c6('0x37')]=_0x3c6fa5[_0xc3c6('0x37')][_0xc3c6('0x39')]?_0x3c6fa5[_0xc3c6('0x37')]:_0x244498[_0xc3c6('0x31')];if(_0x300639[_0xc3c6('0x33')][_0xc3c6('0x44')]){_0x3c6fa5[_0xc3c6('0x45')]=[{'all':!![]}];}_0x3c6fa5=_[_0xc3c6('0x41')]({},_0x3c6fa5,_0x300639['options']);return db[_0xc3c6('0x43')][_0xc3c6('0x4a')](_0x3c6fa5)[_0xc3c6('0x29')](handleEntityNotFound(_0x5b318c,null))[_0xc3c6('0x29')](respondWithResult(_0x5b318c,null))[_0xc3c6('0x48')](handleError(_0x5b318c,null));};exports['create']=function(_0x592b9c,_0x44ab5f){return db[_0xc3c6('0x43')][_0xc3c6('0x4b')](_0x592b9c[_0xc3c6('0x4c')],{})[_0xc3c6('0x29')](respondWithResult(_0x44ab5f,0xc9))[_0xc3c6('0x48')](handleError(_0x44ab5f,null));};exports[_0xc3c6('0x27')]=function(_0x187ad9,_0x12c593){if(_0x187ad9[_0xc3c6('0x4c')]['id']){delete _0x187ad9[_0xc3c6('0x4c')]['id'];}return db[_0xc3c6('0x43')][_0xc3c6('0x4a')]({'where':{'id':_0x187ad9[_0xc3c6('0x49')]['id']}})[_0xc3c6('0x29')](handleEntityNotFound(_0x12c593,null))[_0xc3c6('0x29')](saveUpdates(_0x187ad9[_0xc3c6('0x4c')],null))['then'](respondWithResult(_0x12c593,null))[_0xc3c6('0x48')](handleError(_0x12c593,null));};exports[_0xc3c6('0x28')]=function(_0x4863c0,_0x4a8ba5){return db[_0xc3c6('0x43')]['find']({'where':{'id':_0x4863c0[_0xc3c6('0x49')]['id']}})[_0xc3c6('0x29')](handleEntityNotFound(_0x4a8ba5,null))[_0xc3c6('0x29')](removeEntity(_0x4a8ba5,null))[_0xc3c6('0x48')](handleError(_0x4a8ba5,null));};exports['describe']=function(_0x3da964,_0xfc1b2f){return db[_0xc3c6('0x43')][_0xc3c6('0x4d')]()[_0xc3c6('0x29')](respondWithResult(_0xfc1b2f,null))[_0xc3c6('0x48')](handleError(_0xfc1b2f,null));};exports['getUnread']=function(_0x4dd22d,_0x255560,_0x4cf8f8){return db[_0xc3c6('0x4e')][_0xc3c6('0x22')]({'where':{'ChatGroupId':_0x4dd22d[_0xc3c6('0x49')]['id'],'ToId':_0x4dd22d[_0xc3c6('0x4f')]['id'],'read':![]}})['then'](function(_0x582345){return{'id':_['toInteger'](_0x4dd22d[_0xc3c6('0x49')]['id']),'count':_0x582345};})[_0xc3c6('0x29')](respondWithResult(_0x255560,null))[_0xc3c6('0x48')](handleError(_0x255560,null));};exports[_0xc3c6('0x50')]=function(_0x264d25,_0x3a409a,_0x13a0a3){return db['ChatGroup']['find']({'where':{'id':_0x264d25[_0xc3c6('0x49')]['id']}})[_0xc3c6('0x29')](handleEntityNotFound(_0x3a409a,null))['then'](function(_0x3db9e8){if(_0x3db9e8){return _0x3db9e8[_0xc3c6('0x50')](_0x264d25[_0xc3c6('0x4c')][_0xc3c6('0x51')],_[_0xc3c6('0x52')](_0x264d25[_0xc3c6('0x4c')],[_0xc3c6('0x51'),'id'])||{});}})[_0xc3c6('0x29')](respondWithResult(_0x3a409a,null))[_0xc3c6('0x48')](handleError(_0x3a409a,null));};exports[_0xc3c6('0x53')]=function(_0x43956f,_0x524edd,_0x46e625){var _0x25cbc2={};var _0x5ac0e9={};var _0x132940;var _0x27ae64;return db[_0xc3c6('0x43')][_0xc3c6('0x54')]({'where':{'id':_0x43956f[_0xc3c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x524edd,null))[_0xc3c6('0x29')](function(_0x4fbb1b){if(_0x4fbb1b){_0x132940=_0x4fbb1b;_0x5ac0e9[_0xc3c6('0x31')]=_['keys'](db['User'][_0xc3c6('0x2f')]);_0x5ac0e9[_0xc3c6('0x33')]=_[_0xc3c6('0x34')](_0x43956f['query']);_0x5ac0e9[_0xc3c6('0x35')]=_['intersection'](_0x5ac0e9[_0xc3c6('0x31')],_0x5ac0e9[_0xc3c6('0x33')]);_0x25cbc2['attributes']=_[_0xc3c6('0x36')](_0x5ac0e9['model'],qs['fields'](_0x43956f['query']['fields']));_0x25cbc2[_0xc3c6('0x37')]=_0x25cbc2[_0xc3c6('0x37')][_0xc3c6('0x39')]?_0x25cbc2['attributes']:_0x5ac0e9[_0xc3c6('0x31')];_0x25cbc2[_0xc3c6('0x55')]=qs[_0xc3c6('0x3b')](_0x43956f[_0xc3c6('0x33')][_0xc3c6('0x3b')]);_0x25cbc2[_0xc3c6('0x3c')]=qs[_0xc3c6('0x35')](_['pick'](_0x43956f[_0xc3c6('0x33')],_0x5ac0e9[_0xc3c6('0x35')]));if(_0x43956f['query'][_0xc3c6('0x3e')]){_0x25cbc2[_0xc3c6('0x3c')]=_[_0xc3c6('0x41')](_0x25cbc2[_0xc3c6('0x3c')],{'$or':_['map'](_0x25cbc2[_0xc3c6('0x37')],function(_0x584fe7){var _0x5ece0b={};_0x5ece0b[_0x584fe7]={'$like':'%'+_0x43956f[_0xc3c6('0x33')][_0xc3c6('0x3e')]+'%'};return _0x5ece0b;})});}_0x25cbc2=_[_0xc3c6('0x41')]({},_0x25cbc2,_0x43956f[_0xc3c6('0x42')]);return _0x132940[_0xc3c6('0x53')](_0x25cbc2);}})[_0xc3c6('0x29')](function(_0x3baacc){if(_0x3baacc){_0x27ae64=_0x3baacc[_0xc3c6('0x39')];if(!_0x43956f[_0xc3c6('0x33')][_0xc3c6('0x56')]('nolimit')){_0x25cbc2['limit']=qs['limit'](_0x43956f['query'][_0xc3c6('0x21')]);_0x25cbc2[_0xc3c6('0x1f')]=qs['offset'](_0x43956f['query'][_0xc3c6('0x1f')]);}return _0x132940['getMembers'](_0x25cbc2);}})[_0xc3c6('0x29')](function(_0x37bbf9){if(_0x37bbf9){return _0x37bbf9?{'count':_0x27ae64,'rows':_0x37bbf9}:null;}})[_0xc3c6('0x29')](respondWithResult(_0x524edd,null))[_0xc3c6('0x48')](handleError(_0x524edd,null));};exports['removeMembers']=function(_0x51d3fd,_0x5a316e,_0x406d7f){return db[_0xc3c6('0x43')][_0xc3c6('0x4a')]({'where':{'id':_0x51d3fd[_0xc3c6('0x49')]['id']}})[_0xc3c6('0x29')](handleEntityNotFound(_0x5a316e,null))[_0xc3c6('0x29')](function(_0x3c99b6){if(_0x3c99b6){return _0x3c99b6[_0xc3c6('0x57')](_0x51d3fd[_0xc3c6('0x33')][_0xc3c6('0x51')]);}})[_0xc3c6('0x29')](respondWithStatusCode(_0x5a316e,null))[_0xc3c6('0x48')](handleError(_0x5a316e,null));};exports[_0xc3c6('0x58')]=function(_0x5565f3,_0x3a5e54,_0x57dc73){if(_0x5565f3['body']['id']){delete _0x5565f3['body']['id'];}return db[_0xc3c6('0x43')][_0xc3c6('0x4a')]({'where':{'id':_0x5565f3[_0xc3c6('0x49')]['id']}})[_0xc3c6('0x29')](handleEntityNotFound(_0x3a5e54,null))[_0xc3c6('0x29')](function(_0x27dded){if(_0x27dded){_0x5565f3['body'][_0xc3c6('0x59')]=_0x27dded['id'];return db[_0xc3c6('0x4e')][_0xc3c6('0x4b')](_0x5565f3['body']);}})['then'](respondWithResult(_0x3a5e54,null))[_0xc3c6('0x48')](handleError(_0x3a5e54,null));};exports[_0xc3c6('0x5a')]=function(_0x46edaf,_0x5a70b4,_0x4540f3){var _0x1c7b82={};var _0x19cabc={};var _0x44434d;var _0x5e3720;return db['ChatGroup'][_0xc3c6('0x54')]({'where':{'id':_0x46edaf[_0xc3c6('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a70b4,null))[_0xc3c6('0x29')](function(_0x44be0f){if(_0x44be0f){_0x44434d=_0x44be0f;_0x19cabc['model']=_[_0xc3c6('0x34')](db[_0xc3c6('0x4e')][_0xc3c6('0x2f')]);_0x19cabc[_0xc3c6('0x33')]=_[_0xc3c6('0x34')](_0x46edaf[_0xc3c6('0x33')]);_0x19cabc[_0xc3c6('0x35')]=_[_0xc3c6('0x36')](_0x19cabc[_0xc3c6('0x31')],_0x19cabc[_0xc3c6('0x33')]);_0x1c7b82['attributes']=_[_0xc3c6('0x36')](_0x19cabc['model'],qs['fields'](_0x46edaf[_0xc3c6('0x33')][_0xc3c6('0x38')]));_0x1c7b82['attributes']=_0x1c7b82[_0xc3c6('0x37')][_0xc3c6('0x39')]?_0x1c7b82['attributes']:_0x19cabc['model'];_0x1c7b82[_0xc3c6('0x55')]=qs[_0xc3c6('0x3b')](_0x46edaf[_0xc3c6('0x33')][_0xc3c6('0x3b')]);_0x1c7b82['where']=qs[_0xc3c6('0x35')](_[_0xc3c6('0x3d')](_0x46edaf['query'],_0x19cabc[_0xc3c6('0x35')]));if(_0x46edaf[_0xc3c6('0x33')]['filter']){_0x1c7b82[_0xc3c6('0x3c')]=_[_0xc3c6('0x41')](_0x1c7b82[_0xc3c6('0x3c')],{'$or':_[_0xc3c6('0x32')](_0x1c7b82[_0xc3c6('0x37')],function(_0x1c9dfc){var _0x1e309f={};_0x1e309f[_0x1c9dfc]={'$like':'%'+_0x46edaf[_0xc3c6('0x33')][_0xc3c6('0x3e')]+'%'};return _0x1e309f;})});}if(_0x46edaf[_0xc3c6('0x33')][_0xc3c6('0x5b')]){var _0x38a218=_0x46edaf['query'][_0xc3c6('0x5b')][_0xc3c6('0x5c')](',');var _0x45d78c={};_0x45d78c[_0x38a218[0x0]]={'$gte':moment(_0x38a218[0x1])['format'](_0xc3c6('0x5d'))};_0x1c7b82[_0xc3c6('0x3c')]=_[_0xc3c6('0x41')](_0x1c7b82['where'],_0x45d78c);}_0x1c7b82=_[_0xc3c6('0x41')]({},_0x1c7b82,_0x46edaf[_0xc3c6('0x42')]);return _0x44434d[_0xc3c6('0x5a')](_0x1c7b82);}})[_0xc3c6('0x29')](function(_0x150809){if(_0x150809){_0x5e3720=_0x150809[_0xc3c6('0x39')];if(!_0x46edaf['query'][_0xc3c6('0x56')]('nolimit')){_0x1c7b82[_0xc3c6('0x21')]=qs[_0xc3c6('0x21')](_0x46edaf['query'][_0xc3c6('0x21')]);_0x1c7b82[_0xc3c6('0x1f')]=qs[_0xc3c6('0x1f')](_0x46edaf[_0xc3c6('0x33')][_0xc3c6('0x1f')]);}return _0x44434d['getMessages'](_0x1c7b82);}})[_0xc3c6('0x29')](function(_0x530ac3){if(_0x530ac3){return _0x530ac3?{'count':_0x5e3720,'rows':_0x530ac3}:null;}})[_0xc3c6('0x29')](respondWithResult(_0x5a70b4,null))['catch'](handleError(_0x5a70b4,null));}; \ No newline at end of file +var _0xc68a=['sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','ChatGroup','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','update','find','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','sort','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x33dcba,_0x419a55){var _0x4a4e1c=function(_0x3ddd90){while(--_0x3ddd90){_0x33dcba['push'](_0x33dcba['shift']());}};_0x4a4e1c(++_0x419a55);}(_0xc68a,0x104));var _0xac68=function(_0x194cf8,_0x536123){_0x194cf8=_0x194cf8-0x0;var _0x17444f=_0xc68a[_0x194cf8];return _0x17444f;};'use strict';var emlformat=require(_0xac68('0x0'));var rimraf=require(_0xac68('0x1'));var zipdir=require(_0xac68('0x2'));var jsonpatch=require(_0xac68('0x3'));var rp=require(_0xac68('0x4'));var moment=require('moment');var BPromise=require(_0xac68('0x5'));var Mustache=require(_0xac68('0x6'));var util=require(_0xac68('0x7'));var path=require(_0xac68('0x8'));var sox=require(_0xac68('0x9'));var csv=require(_0xac68('0xa'));var ejs=require(_0xac68('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac68('0xc'));var squel=require(_0xac68('0xd'));var crypto=require('crypto');var jsforce=require(_0xac68('0xe'));var deskjs=require(_0xac68('0xf'));var toCsv=require('to-csv');var querystring=require(_0xac68('0x10'));var Papa=require('papaparse');var Redis=require(_0xac68('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xac68('0x12'));var as=require(_0xac68('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac68('0x14'))('api');var utils=require(_0xac68('0x15'));var config=require(_0xac68('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xac68('0x17'))['db'];config[_0xac68('0x18')]=_['defaults'](config[_0xac68('0x18')],{'host':_0xac68('0x19'),'port':0x18eb});var socket=require(_0xac68('0x1a'))(new Redis(config['redis']));require(_0xac68('0x1b'))['register'](socket);function respondWithStatusCode(_0x1ab5db,_0x5c7166){_0x5c7166=_0x5c7166||0xcc;return function(_0x5980b6){if(_0x5980b6){return _0x1ab5db[_0xac68('0x1c')](_0x5c7166);}return _0x1ab5db[_0xac68('0x1d')](_0x5c7166)[_0xac68('0x1e')]();};}function respondWithResult(_0x2f39a5,_0x3140bf){_0x3140bf=_0x3140bf||0xc8;return function(_0x6f1661){if(_0x6f1661){return _0x2f39a5[_0xac68('0x1d')](_0x3140bf)[_0xac68('0x1f')](_0x6f1661);}};}function respondWithFilteredResult(_0x43d49a,_0x40b606){return function(_0x43f212){if(_0x43f212){var _0x49a402=typeof _0x40b606['offset']==='undefined'&&typeof _0x40b606[_0xac68('0x20')]==='undefined';var _0x207c08=_0x43f212[_0xac68('0x21')];var _0x9b9a5d=_0x49a402?0x0:_0x40b606['offset'];var _0x310593=_0x49a402?_0x43f212[_0xac68('0x21')]:_0x40b606[_0xac68('0x22')]+_0x40b606[_0xac68('0x20')];var _0x5360a6;if(_0x310593>=_0x207c08){_0x310593=_0x207c08;_0x5360a6=0xc8;}else{_0x5360a6=0xce;}_0x43d49a[_0xac68('0x1d')](_0x5360a6);return _0x43d49a[_0xac68('0x23')](_0xac68('0x24'),_0x9b9a5d+'-'+_0x310593+'/'+_0x207c08)[_0xac68('0x1f')](_0x43f212);}return null;};}function patchUpdates(_0x38e0c4){return function(_0xec7cf8){try{jsonpatch[_0xac68('0x25')](_0xec7cf8,_0x38e0c4,!![]);}catch(_0x302863){return BPromise[_0xac68('0x26')](_0x302863);}return _0xec7cf8['save']();};}function saveUpdates(_0xbcbdc8,_0x4515fa){return function(_0x2e37ad){if(_0x2e37ad){return _0x2e37ad['update'](_0xbcbdc8)[_0xac68('0x27')](function(_0x390877){return _0x390877;});}return null;};}function removeEntity(_0x48fcf7,_0x34ac76){return function(_0x3f119d){if(_0x3f119d){return _0x3f119d[_0xac68('0x28')]()[_0xac68('0x27')](function(){_0x48fcf7[_0xac68('0x1d')](0xcc)[_0xac68('0x1e')]();});}};}function handleEntityNotFound(_0x1716fa,_0x2c84a6){return function(_0x5617a6){if(!_0x5617a6){_0x1716fa[_0xac68('0x1c')](0x194);}return _0x5617a6;};}function handleError(_0xfd16f8,_0xe1ad41){_0xe1ad41=_0xe1ad41||0x1f4;return function(_0x2e73a6){logger[_0xac68('0x29')](_0x2e73a6[_0xac68('0x2a')]);if(_0x2e73a6[_0xac68('0x2b')]){delete _0x2e73a6[_0xac68('0x2b')];}_0xfd16f8[_0xac68('0x1d')](_0xe1ad41)[_0xac68('0x2c')](_0x2e73a6);};}exports[_0xac68('0x2d')]=function(_0x4d6278,_0x5070cb){var _0x20347a={},_0x277c4b={},_0x9951f3={'count':0x0,'rows':[]};var _0x44cbd4=_[_0xac68('0x2e')](db[_0xac68('0x2f')]['rawAttributes'],function(_0x52880c){return{'name':_0x52880c[_0xac68('0x30')],'type':_0x52880c['type'][_0xac68('0x31')]};});_0x277c4b['model']=_[_0xac68('0x2e')](_0x44cbd4,_0xac68('0x2b'));_0x277c4b[_0xac68('0x32')]=_[_0xac68('0x33')](_0x4d6278[_0xac68('0x32')]);_0x277c4b[_0xac68('0x34')]=_[_0xac68('0x35')](_0x277c4b[_0xac68('0x36')],_0x277c4b[_0xac68('0x32')]);_0x20347a[_0xac68('0x37')]=_[_0xac68('0x35')](_0x277c4b[_0xac68('0x36')],qs['fields'](_0x4d6278[_0xac68('0x32')][_0xac68('0x38')]));_0x20347a[_0xac68('0x37')]=_0x20347a[_0xac68('0x37')][_0xac68('0x39')]?_0x20347a['attributes']:_0x277c4b[_0xac68('0x36')];if(!_0x4d6278[_0xac68('0x32')]['hasOwnProperty'](_0xac68('0x3a'))){_0x20347a[_0xac68('0x20')]=qs['limit'](_0x4d6278['query'][_0xac68('0x20')]);_0x20347a[_0xac68('0x22')]=qs['offset'](_0x4d6278['query'][_0xac68('0x22')]);}_0x20347a[_0xac68('0x3b')]=qs['sort'](_0x4d6278[_0xac68('0x32')]['sort']);_0x20347a['where']=qs[_0xac68('0x34')](_[_0xac68('0x3c')](_0x4d6278['query'],_0x277c4b[_0xac68('0x34')]),_0x44cbd4);if(_0x4d6278['query'][_0xac68('0x3d')]){_0x20347a[_0xac68('0x3e')]=_['merge'](_0x20347a[_0xac68('0x3e')],{'$or':_[_0xac68('0x2e')](_0x44cbd4,function(_0x2b128b){if(_0x2b128b['type']!==_0xac68('0x3f')){var _0x1b1a6f={};_0x1b1a6f[_0x2b128b[_0xac68('0x2b')]]={'$like':'%'+_0x4d6278[_0xac68('0x32')][_0xac68('0x3d')]+'%'};return _0x1b1a6f;}})});}_0x20347a=_[_0xac68('0x40')]({},_0x20347a,_0x4d6278[_0xac68('0x41')]);var _0x1bf78f={'where':_0x20347a[_0xac68('0x3e')]};return db[_0xac68('0x2f')][_0xac68('0x21')](_0x1bf78f)['then'](function(_0x3e69de){_0x9951f3[_0xac68('0x21')]=_0x3e69de;if(_0x4d6278[_0xac68('0x32')][_0xac68('0x42')]){_0x20347a[_0xac68('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x20347a);})['then'](function(_0x35e9af){_0x9951f3[_0xac68('0x44')]=_0x35e9af;return _0x9951f3;})[_0xac68('0x27')](respondWithFilteredResult(_0x5070cb,_0x20347a))[_0xac68('0x45')](handleError(_0x5070cb,null));};exports[_0xac68('0x46')]=function(_0x4e3f95,_0x5730ec){var _0x4eb6a9={'raw':!![],'where':{'id':_0x4e3f95[_0xac68('0x47')]['id']}},_0xa6376={};_0xa6376[_0xac68('0x36')]=_['keys'](db['ChatGroup']['rawAttributes']);_0xa6376[_0xac68('0x32')]=_[_0xac68('0x33')](_0x4e3f95['query']);_0xa6376[_0xac68('0x34')]=_[_0xac68('0x35')](_0xa6376[_0xac68('0x36')],_0xa6376[_0xac68('0x32')]);_0x4eb6a9[_0xac68('0x37')]=_[_0xac68('0x35')](_0xa6376[_0xac68('0x36')],qs[_0xac68('0x38')](_0x4e3f95['query']['fields']));_0x4eb6a9[_0xac68('0x37')]=_0x4eb6a9[_0xac68('0x37')][_0xac68('0x39')]?_0x4eb6a9[_0xac68('0x37')]:_0xa6376['model'];if(_0x4e3f95[_0xac68('0x32')][_0xac68('0x42')]){_0x4eb6a9['include']=[{'all':!![]}];}_0x4eb6a9=_[_0xac68('0x40')]({},_0x4eb6a9,_0x4e3f95[_0xac68('0x41')]);return db[_0xac68('0x2f')]['find'](_0x4eb6a9)[_0xac68('0x27')](handleEntityNotFound(_0x5730ec,null))['then'](respondWithResult(_0x5730ec,null))['catch'](handleError(_0x5730ec,null));};exports['create']=function(_0x4aee31,_0x338181){return db[_0xac68('0x2f')][_0xac68('0x48')](_0x4aee31[_0xac68('0x49')],{})[_0xac68('0x27')](respondWithResult(_0x338181,0xc9))[_0xac68('0x45')](handleError(_0x338181,null));};exports[_0xac68('0x4a')]=function(_0x12c84e,_0x40bc5a){if(_0x12c84e['body']['id']){delete _0x12c84e[_0xac68('0x49')]['id'];}return db[_0xac68('0x2f')][_0xac68('0x4b')]({'where':{'id':_0x12c84e['params']['id']}})[_0xac68('0x27')](handleEntityNotFound(_0x40bc5a,null))[_0xac68('0x27')](saveUpdates(_0x12c84e[_0xac68('0x49')],null))[_0xac68('0x27')](respondWithResult(_0x40bc5a,null))[_0xac68('0x45')](handleError(_0x40bc5a,null));};exports[_0xac68('0x28')]=function(_0x2a711f,_0x582a51){return db[_0xac68('0x2f')][_0xac68('0x4b')]({'where':{'id':_0x2a711f[_0xac68('0x47')]['id']}})[_0xac68('0x27')](handleEntityNotFound(_0x582a51,null))[_0xac68('0x27')](removeEntity(_0x582a51,null))['catch'](handleError(_0x582a51,null));};exports['describe']=function(_0xe0e6d0,_0x110b2c){return db[_0xac68('0x2f')]['describe']()[_0xac68('0x27')](respondWithResult(_0x110b2c,null))[_0xac68('0x45')](handleError(_0x110b2c,null));};exports[_0xac68('0x4c')]=function(_0x4b59f3,_0x215153,_0x41fd02){return db[_0xac68('0x4d')][_0xac68('0x21')]({'where':{'ChatGroupId':_0x4b59f3['params']['id'],'ToId':_0x4b59f3['user']['id'],'read':![]}})[_0xac68('0x27')](function(_0x3c0b9a){return{'id':_[_0xac68('0x4e')](_0x4b59f3[_0xac68('0x47')]['id']),'count':_0x3c0b9a};})['then'](respondWithResult(_0x215153,null))[_0xac68('0x45')](handleError(_0x215153,null));};exports['addMembers']=function(_0x391995,_0x1d78ff,_0x4878f4){return db[_0xac68('0x2f')][_0xac68('0x4b')]({'where':{'id':_0x391995[_0xac68('0x47')]['id']}})[_0xac68('0x27')](handleEntityNotFound(_0x1d78ff,null))[_0xac68('0x27')](function(_0x1ffd65){if(_0x1ffd65){return _0x1ffd65[_0xac68('0x4f')](_0x391995['body'][_0xac68('0x50')],_[_0xac68('0x51')](_0x391995[_0xac68('0x49')],[_0xac68('0x50'),'id'])||{});}})[_0xac68('0x27')](respondWithResult(_0x1d78ff,null))['catch'](handleError(_0x1d78ff,null));};exports[_0xac68('0x52')]=function(_0x295f17,_0x263bda,_0x168709){var _0xf1177c={};var _0x58e684={};var _0x12fa99;var _0x5c9d0a;return db['ChatGroup'][_0xac68('0x53')]({'where':{'id':_0x295f17[_0xac68('0x47')]['id']}})[_0xac68('0x27')](handleEntityNotFound(_0x263bda,null))[_0xac68('0x27')](function(_0x4ae40c){if(_0x4ae40c){_0x12fa99=_0x4ae40c;_0x58e684[_0xac68('0x36')]=_[_0xac68('0x33')](db[_0xac68('0x54')][_0xac68('0x55')]);_0x58e684[_0xac68('0x32')]=_[_0xac68('0x33')](_0x295f17[_0xac68('0x32')]);_0x58e684['filters']=_[_0xac68('0x35')](_0x58e684[_0xac68('0x36')],_0x58e684[_0xac68('0x32')]);_0xf1177c[_0xac68('0x37')]=_[_0xac68('0x35')](_0x58e684['model'],qs[_0xac68('0x38')](_0x295f17[_0xac68('0x32')][_0xac68('0x38')]));_0xf1177c[_0xac68('0x37')]=_0xf1177c['attributes'][_0xac68('0x39')]?_0xf1177c[_0xac68('0x37')]:_0x58e684['model'];_0xf1177c['order']=qs['sort'](_0x295f17['query'][_0xac68('0x56')]);_0xf1177c[_0xac68('0x3e')]=qs[_0xac68('0x34')](_[_0xac68('0x3c')](_0x295f17[_0xac68('0x32')],_0x58e684[_0xac68('0x34')]));if(_0x295f17['query'][_0xac68('0x3d')]){_0xf1177c[_0xac68('0x3e')]=_['merge'](_0xf1177c[_0xac68('0x3e')],{'$or':_[_0xac68('0x2e')](_0xf1177c[_0xac68('0x37')],function(_0x18b777){var _0x148679={};_0x148679[_0x18b777]={'$like':'%'+_0x295f17[_0xac68('0x32')][_0xac68('0x3d')]+'%'};return _0x148679;})});}_0xf1177c=_[_0xac68('0x40')]({},_0xf1177c,_0x295f17[_0xac68('0x41')]);return _0x12fa99[_0xac68('0x52')](_0xf1177c);}})['then'](function(_0x3407f3){if(_0x3407f3){_0x5c9d0a=_0x3407f3[_0xac68('0x39')];if(!_0x295f17[_0xac68('0x32')][_0xac68('0x57')](_0xac68('0x3a'))){_0xf1177c[_0xac68('0x20')]=qs['limit'](_0x295f17['query'][_0xac68('0x20')]);_0xf1177c['offset']=qs['offset'](_0x295f17['query'][_0xac68('0x22')]);}return _0x12fa99['getMembers'](_0xf1177c);}})[_0xac68('0x27')](function(_0x5563b7){if(_0x5563b7){return _0x5563b7?{'count':_0x5c9d0a,'rows':_0x5563b7}:null;}})[_0xac68('0x27')](respondWithResult(_0x263bda,null))[_0xac68('0x45')](handleError(_0x263bda,null));};exports[_0xac68('0x58')]=function(_0x51982d,_0x5120d0,_0x54b91c){return db[_0xac68('0x2f')]['find']({'where':{'id':_0x51982d['params']['id']}})['then'](handleEntityNotFound(_0x5120d0,null))[_0xac68('0x27')](function(_0x1c8ea9){if(_0x1c8ea9){return _0x1c8ea9[_0xac68('0x58')](_0x51982d['query'][_0xac68('0x50')]);}})[_0xac68('0x27')](respondWithStatusCode(_0x5120d0,null))[_0xac68('0x45')](handleError(_0x5120d0,null));};exports[_0xac68('0x59')]=function(_0x9588b6,_0x2bc354,_0x4236dd){if(_0x9588b6[_0xac68('0x49')]['id']){delete _0x9588b6[_0xac68('0x49')]['id'];}return db[_0xac68('0x2f')][_0xac68('0x4b')]({'where':{'id':_0x9588b6[_0xac68('0x47')]['id']}})[_0xac68('0x27')](handleEntityNotFound(_0x2bc354,null))[_0xac68('0x27')](function(_0x40fe94){if(_0x40fe94){_0x9588b6[_0xac68('0x49')][_0xac68('0x5a')]=_0x40fe94['id'];return db[_0xac68('0x4d')][_0xac68('0x48')](_0x9588b6['body']);}})[_0xac68('0x27')](respondWithResult(_0x2bc354,null))[_0xac68('0x45')](handleError(_0x2bc354,null));};exports['getMessages']=function(_0x46fcd2,_0x108a3c,_0x2225cb){var _0x54fff6={};var _0x43311e={};var _0x5a266d;var _0xc83ba8;return db[_0xac68('0x2f')]['findOne']({'where':{'id':_0x46fcd2[_0xac68('0x47')]['id']}})['then'](handleEntityNotFound(_0x108a3c,null))[_0xac68('0x27')](function(_0x37714d){if(_0x37714d){_0x5a266d=_0x37714d;_0x43311e[_0xac68('0x36')]=_[_0xac68('0x33')](db['ChatInternalMessage'][_0xac68('0x55')]);_0x43311e[_0xac68('0x32')]=_[_0xac68('0x33')](_0x46fcd2[_0xac68('0x32')]);_0x43311e[_0xac68('0x34')]=_[_0xac68('0x35')](_0x43311e[_0xac68('0x36')],_0x43311e[_0xac68('0x32')]);_0x54fff6['attributes']=_[_0xac68('0x35')](_0x43311e[_0xac68('0x36')],qs['fields'](_0x46fcd2['query'][_0xac68('0x38')]));_0x54fff6['attributes']=_0x54fff6['attributes'][_0xac68('0x39')]?_0x54fff6[_0xac68('0x37')]:_0x43311e[_0xac68('0x36')];_0x54fff6[_0xac68('0x3b')]=qs[_0xac68('0x56')](_0x46fcd2[_0xac68('0x32')]['sort']);_0x54fff6[_0xac68('0x3e')]=qs['filters'](_[_0xac68('0x3c')](_0x46fcd2['query'],_0x43311e['filters']));if(_0x46fcd2[_0xac68('0x32')][_0xac68('0x3d')]){_0x54fff6[_0xac68('0x3e')]=_[_0xac68('0x40')](_0x54fff6[_0xac68('0x3e')],{'$or':_[_0xac68('0x2e')](_0x54fff6[_0xac68('0x37')],function(_0x478f90){var _0x2baacb={};_0x2baacb[_0x478f90]={'$like':'%'+_0x46fcd2[_0xac68('0x32')][_0xac68('0x3d')]+'%'};return _0x2baacb;})});}if(_0x46fcd2[_0xac68('0x32')][_0xac68('0x5b')]){var _0x16c5e4=_0x46fcd2[_0xac68('0x32')][_0xac68('0x5b')][_0xac68('0x5c')](',');var _0x564b4f={};_0x564b4f[_0x16c5e4[0x0]]={'$gte':moment(_0x16c5e4[0x1])[_0xac68('0x5d')](_0xac68('0x5e'))};_0x54fff6[_0xac68('0x3e')]=_[_0xac68('0x40')](_0x54fff6[_0xac68('0x3e')],_0x564b4f);}_0x54fff6=_[_0xac68('0x40')]({},_0x54fff6,_0x46fcd2[_0xac68('0x41')]);return _0x5a266d[_0xac68('0x5f')](_0x54fff6);}})['then'](function(_0x50f4b8){if(_0x50f4b8){_0xc83ba8=_0x50f4b8[_0xac68('0x39')];if(!_0x46fcd2['query'][_0xac68('0x57')](_0xac68('0x3a'))){_0x54fff6[_0xac68('0x20')]=qs[_0xac68('0x20')](_0x46fcd2[_0xac68('0x32')][_0xac68('0x20')]);_0x54fff6[_0xac68('0x22')]=qs[_0xac68('0x22')](_0x46fcd2[_0xac68('0x32')]['offset']);}return _0x5a266d['getMessages'](_0x54fff6);}})[_0xac68('0x27')](function(_0x5c084e){if(_0x5c084e){return _0x5c084e?{'count':_0xc83ba8,'rows':_0x5c084e}:null;}})[_0xac68('0x27')](respondWithResult(_0x108a3c,null))[_0xac68('0x45')](handleError(_0x108a3c,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 0115be5..cbe217f 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 _0xc022=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x8e0d6c,_0x2f0a30){var _0x4924a4=function(_0x11fa97){while(--_0x11fa97){_0x8e0d6c['push'](_0x8e0d6c['shift']());}};_0x4924a4(++_0x2f0a30);}(_0xc022,0x173));var _0x2c02=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0xc022[_0x4045ff];return _0x5797ac;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2c02('0x0'))['db'][_0x2c02('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2c02('0x2')](0x0);var events={'afterCreate':_0x2c02('0x3'),'afterUpdate':_0x2c02('0x4'),'afterDestroy':_0x2c02('0x5')};function emitEvent(_0x55b3be){return function(_0x736bd1,_0x517336,_0x33a5fc){ChatGroupEvents['emit'](_0x55b3be+':'+_0x736bd1['id'],_0x736bd1);ChatGroupEvents['emit'](_0x55b3be,_0x736bd1);_0x33a5fc(null);};}for(var e in events){if(events[_0x2c02('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xadbb=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4ce289,_0x560bd8){var _0x10f874=function(_0x1dbdb8){while(--_0x1dbdb8){_0x4ce289['push'](_0x4ce289['shift']());}};_0x10f874(++_0x560bd8);}(_0xadbb,0x97));var _0xbadb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xadbb[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xbadb('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbadb('0x1')](0x0);var events={'afterCreate':_0xbadb('0x2'),'afterUpdate':_0xbadb('0x3'),'afterDestroy':_0xbadb('0x4')};function emitEvent(_0x20fe2b){return function(_0x36d79f,_0x232761,_0x11944d){ChatGroupEvents[_0xbadb('0x5')](_0x20fe2b+':'+_0x36d79f['id'],_0x36d79f);ChatGroupEvents[_0xbadb('0x5')](_0x20fe2b,_0x36d79f);_0x11944d(null);};}for(var e in events){if(events[_0xbadb('0x6')](e)){var event=events[e];ChatGroup[_0xbadb('0x7')](e,emitEvent(event));}}module[_0xbadb('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 33cf880..bcb0701 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 _0x43a4=['rimraf','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x518d01,_0x11fa1d){var _0x2a512a=function(_0x231865){while(--_0x231865){_0x518d01['push'](_0x518d01['shift']());}};_0x2a512a(++_0x11fa1d);}(_0x43a4,0x14e));var _0x443a=function(_0x213b44,_0x46bb8f){_0x213b44=_0x213b44-0x0;var _0x4c1ddb=_0x43a4[_0x213b44];return _0x4c1ddb;};'use strict';var _=require(_0x443a('0x0'));var util=require(_0x443a('0x1'));var logger=require(_0x443a('0x2'))('api');var moment=require(_0x443a('0x3'));var BPromise=require(_0x443a('0x4'));var rp=require(_0x443a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x443a('0x6'));var config=require('../../config/environment');var attributes=require(_0x443a('0x7'));module['exports']=function(_0x5b162f,_0x256ccc){return _0x5b162f['define'](_0x443a('0x8'),attributes,{'tableName':_0x443a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5678=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ChatGroup','chat_groups'];(function(_0x30f8f0,_0x3498d6){var _0x57b853=function(_0xed92f6){while(--_0xed92f6){_0x30f8f0['push'](_0x30f8f0['shift']());}};_0x57b853(++_0x3498d6);}(_0x5678,0x14a));var _0x8567=function(_0x17a2d2,_0x52e5eb){_0x17a2d2=_0x17a2d2-0x0;var _0x4f7e32=_0x5678[_0x17a2d2];return _0x4f7e32;};'use strict';var _=require(_0x8567('0x0'));var util=require(_0x8567('0x1'));var logger=require(_0x8567('0x2'))('api');var moment=require(_0x8567('0x3'));var BPromise=require(_0x8567('0x4'));var rp=require(_0x8567('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8567('0x6'));var config=require(_0x8567('0x7'));var attributes=require('./chatGroup.attributes');module[_0x8567('0x8')]=function(_0x30e181,_0x5f26ef){return _0x30e181['define'](_0x8567('0x9'),attributes,{'tableName':_0x8567('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 8a4d675..c6ae092 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 _0xa44a=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost','./chatGroup.socket','request','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch'];(function(_0x870adc,_0x3d8ce8){var _0x345115=function(_0x544278){while(--_0x544278){_0x870adc['push'](_0x870adc['shift']());}};_0x345115(++_0x3d8ce8);}(_0xa44a,0x9a));var _0xaa44=function(_0x12ffad,_0x8435a4){_0x12ffad=_0x12ffad-0x0;var _0x5d05a2=_0xa44a[_0x12ffad];return _0x5d05a2;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa44('0x1'));var rs=require(_0xaa44('0x2'));var fs=require('fs');var Redis=require(_0xaa44('0x3'));var db=require(_0xaa44('0x4'))['db'];var utils=require(_0xaa44('0x5'));var logger=require(_0xaa44('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa44('0x7'));var client=jayson[_0xaa44('0x8')]['http']({'port':0x232a});config[_0xaa44('0x9')]=_['defaults'](config[_0xaa44('0x9')],{'host':_0xaa44('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa44('0x9')]));require(_0xaa44('0xb'))['register'](socket);function respondWithRpcPromise(_0x11dbf5,_0x231a4f,_0x2e1c50){return new BPromise(function(_0x3d4fe8,_0x4c6e70){return client[_0xaa44('0xc')](_0x11dbf5,_0x2e1c50)['then'](function(_0x119a08){logger['info']('ChatGroup,\x20%s,\x20%s',_0x231a4f,'request\x20sent');logger[_0xaa44('0xd')](_0xaa44('0xe'),_0x231a4f,_0xaa44('0xf'),JSON['stringify'](_0x119a08));if(_0x119a08[_0xaa44('0x10')]){if(_0x119a08[_0xaa44('0x10')]['code']===0x1f4){logger['error'](_0xaa44('0x11'),_0x231a4f,_0x119a08[_0xaa44('0x10')]['message']);return _0x4c6e70(_0x119a08['error'][_0xaa44('0x12')]);}logger['error'](_0xaa44('0x11'),_0x231a4f,_0x119a08['error'][_0xaa44('0x12')]);return _0x3d4fe8(_0x119a08[_0xaa44('0x10')][_0xaa44('0x12')]);}else{logger[_0xaa44('0x13')](_0xaa44('0x11'),_0x231a4f,'request\x20sent');_0x3d4fe8(_0x119a08[_0xaa44('0x14')][_0xaa44('0x12')]);}})[_0xaa44('0x15')](function(_0x6358ce){logger[_0xaa44('0x10')](_0xaa44('0x11'),_0x231a4f,_0x6358ce);_0x4c6e70(_0x6358ce);});});} \ No newline at end of file +var _0xe539=['message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e57c2,_0x2f6391){var _0x3cb46c=function(_0x2853ea){while(--_0x2853ea){_0x1e57c2['push'](_0x1e57c2['shift']());}};_0x3cb46c(++_0x2f6391);}(_0xe539,0x164));var _0x9e53=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xe539[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x9e53('0x0'));var util=require('util');var moment=require(_0x9e53('0x1'));var BPromise=require(_0x9e53('0x2'));var rs=require(_0x9e53('0x3'));var fs=require('fs');var Redis=require(_0x9e53('0x4'));var db=require(_0x9e53('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e53('0x6'));var config=require(_0x9e53('0x7'));var jayson=require(_0x9e53('0x8'));var client=jayson[_0x9e53('0x9')][_0x9e53('0xa')]({'port':0x232a});config[_0x9e53('0xb')]=_[_0x9e53('0xc')](config[_0x9e53('0xb')],{'host':_0x9e53('0xd'),'port':0x18eb});var socket=require(_0x9e53('0xe'))(new Redis(config[_0x9e53('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x1561a4,_0x584190,_0xfbf0c3){return new BPromise(function(_0x37f85e,_0x3260fc){return client[_0x9e53('0xf')](_0x1561a4,_0xfbf0c3)['then'](function(_0x34bb71){logger['info'](_0x9e53('0x10'),_0x584190,'request\x20sent');logger[_0x9e53('0x11')](_0x9e53('0x12'),_0x584190,'request\x20sent',JSON[_0x9e53('0x13')](_0x34bb71));if(_0x34bb71[_0x9e53('0x14')]){if(_0x34bb71[_0x9e53('0x14')][_0x9e53('0x15')]===0x1f4){logger[_0x9e53('0x14')]('ChatGroup,\x20%s,\x20%s',_0x584190,_0x34bb71[_0x9e53('0x14')][_0x9e53('0x16')]);return _0x3260fc(_0x34bb71['error'][_0x9e53('0x16')]);}logger[_0x9e53('0x14')](_0x9e53('0x10'),_0x584190,_0x34bb71[_0x9e53('0x14')][_0x9e53('0x16')]);return _0x37f85e(_0x34bb71[_0x9e53('0x14')]['message']);}else{logger[_0x9e53('0x17')](_0x9e53('0x10'),_0x584190,_0x9e53('0x18'));_0x37f85e(_0x34bb71[_0x9e53('0x19')][_0x9e53('0x16')]);}})[_0x9e53('0x1a')](function(_0x3896f9){logger[_0x9e53('0x14')](_0x9e53('0x10'),_0x584190,_0x3896f9);_0x3260fc(_0x3896f9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ec87552..49d325c 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 _0xa070=['update','emit','removeListener','length'];(function(_0x153ab3,_0x5c7acb){var _0x4e2455=function(_0xa306d7){while(--_0xa306d7){_0x153ab3['push'](_0x153ab3['shift']());}};_0x4e2455(++_0x5c7acb);}(_0xa070,0xf8));var _0x0a07=function(_0x216497,_0x48fd22){_0x216497=_0x216497-0x0;var _0x417cc0=_0xa070[_0x216497];return _0x417cc0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove',_0x0a07('0x0')];function createListener(_0x88e93f,_0x1e2db1){return function(_0x20f9dd){_0x1e2db1[_0x0a07('0x1')](_0x88e93f,_0x20f9dd);};}function removeListener(_0x526d4b,_0x3159fe){return function(){ChatGroupEvents[_0x0a07('0x2')](_0x526d4b,_0x3159fe);};}exports['register']=function(_0x1eea86){for(var _0x54c46f=0x0,_0x511798=events[_0x0a07('0x3')];_0x54c46f<_0x511798;_0x54c46f++){var _0x4a3558=events[_0x54c46f];var _0x3e7cb7=createListener('chatGroup:'+_0x4a3558,_0x1eea86);ChatGroupEvents['on'](_0x4a3558,_0x3e7cb7);}}; \ No newline at end of file +var _0x1af4=['./chatGroup.events','remove','update','emit','length','chatGroup:'];(function(_0x4e833d,_0x217611){var _0x1b0984=function(_0x3d97ae){while(--_0x3d97ae){_0x4e833d['push'](_0x4e833d['shift']());}};_0x1b0984(++_0x217611);}(_0x1af4,0x78));var _0x41af=function(_0x1f9b08,_0x4c59c6){_0x1f9b08=_0x1f9b08-0x0;var _0x109024=_0x1af4[_0x1f9b08];return _0x109024;};'use strict';var ChatGroupEvents=require(_0x41af('0x0'));var events=['save',_0x41af('0x1'),_0x41af('0x2')];function createListener(_0x1a8bce,_0x135753){return function(_0x3b295a){_0x135753[_0x41af('0x3')](_0x1a8bce,_0x3b295a);};}function removeListener(_0x4ccc8a,_0x71523){return function(){ChatGroupEvents['removeListener'](_0x4ccc8a,_0x71523);};}exports['register']=function(_0x2d4d15){for(var _0x4e9c3e=0x0,_0x535dca=events[_0x41af('0x4')];_0x4e9c3e<_0x535dca;_0x4e9c3e++){var _0x53335f=events[_0x4e9c3e];var _0x1fad1f=createListener(_0x41af('0x5')+_0x53335f,_0x2d4d15);ChatGroupEvents['on'](_0x53335f,_0x1fad1f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 506ef63..b9099b3 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 _0xc65d=['addMessage','put','update','delete','/:id','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers'];(function(_0x509f4e,_0x172c4f){var _0x1c6051=function(_0x9820ba){while(--_0x9820ba){_0x509f4e['push'](_0x509f4e['shift']());}};_0x1c6051(++_0x172c4f);}(_0xc65d,0x166));var _0xdc65=function(_0x19665a,_0x1b4624){_0x19665a=_0x19665a-0x0;var _0x478db8=_0xc65d[_0x19665a];return _0x478db8;};'use strict';var multer=require(_0xdc65('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdc65('0x1'));var express=require('express');var router=express[_0xdc65('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdc65('0x3'));var interaction=require(_0xdc65('0x4'));var config=require(_0xdc65('0x5'));var controller=require(_0xdc65('0x6'));router[_0xdc65('0x7')]('/',auth['isAuthenticated'](),controller[_0xdc65('0x8')]);router[_0xdc65('0x7')]('/describe',auth[_0xdc65('0x9')](),controller[_0xdc65('0xa')]);router['get']('/:id',auth[_0xdc65('0x9')](),controller[_0xdc65('0xb')]);router[_0xdc65('0x7')](_0xdc65('0xc'),auth[_0xdc65('0x9')](),controller[_0xdc65('0xd')]);router[_0xdc65('0x7')](_0xdc65('0xe'),auth[_0xdc65('0x9')](),controller[_0xdc65('0xf')]);router['get'](_0xdc65('0x10'),auth[_0xdc65('0x9')](),controller[_0xdc65('0x11')]);router[_0xdc65('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdc65('0x12')](_0xdc65('0xe'),auth[_0xdc65('0x9')](),controller[_0xdc65('0x13')]);router[_0xdc65('0x12')](_0xdc65('0x10'),auth[_0xdc65('0x9')](),controller[_0xdc65('0x14')]);router[_0xdc65('0x15')]('/:id',auth[_0xdc65('0x9')](),controller[_0xdc65('0x16')]);router[_0xdc65('0x17')](_0xdc65('0x18'),auth['isAuthenticated'](),controller[_0xdc65('0x19')]);router['delete'](_0xdc65('0xe'),auth[_0xdc65('0x9')](),controller['removeMembers']);module[_0xdc65('0x1a')]=router; \ No newline at end of file +var _0xf34b=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','getUnread','create','post','/:id/members','addMembers','/:id/messages','addMessage'];(function(_0x1a1e51,_0x29b75b){var _0x2a43af=function(_0x419439){while(--_0x419439){_0x1a1e51['push'](_0x1a1e51['shift']());}};_0x2a43af(++_0x29b75b);}(_0xf34b,0x1d0));var _0xbf34=function(_0x22d8e8,_0x25619a){_0x22d8e8=_0x22d8e8-0x0;var _0x8fbde0=_0xf34b[_0x22d8e8];return _0x8fbde0;};'use strict';var multer=require(_0xbf34('0x0'));var util=require('util');var path=require(_0xbf34('0x1'));var timeout=require(_0xbf34('0x2'));var express=require(_0xbf34('0x3'));var router=express[_0xbf34('0x4')]();var fs_extra=require(_0xbf34('0x5'));var auth=require(_0xbf34('0x6'));var interaction=require(_0xbf34('0x7'));var config=require('../../config/environment');var controller=require(_0xbf34('0x8'));router['get']('/',auth[_0xbf34('0x9')](),controller[_0xbf34('0xa')]);router[_0xbf34('0xb')](_0xbf34('0xc'),auth['isAuthenticated'](),controller[_0xbf34('0xd')]);router[_0xbf34('0xb')](_0xbf34('0xe'),auth[_0xbf34('0x9')](),controller['show']);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0xbf34('0xf')]);router[_0xbf34('0xb')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xbf34('0xb')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0xbf34('0x9')](),controller[_0xbf34('0x10')]);router[_0xbf34('0x11')](_0xbf34('0x12'),auth[_0xbf34('0x9')](),controller[_0xbf34('0x13')]);router[_0xbf34('0x11')](_0xbf34('0x14'),auth['isAuthenticated'](),controller[_0xbf34('0x15')]);router[_0xbf34('0x16')]('/:id',auth[_0xbf34('0x9')](),controller[_0xbf34('0x17')]);router[_0xbf34('0x18')](_0xbf34('0xe'),auth[_0xbf34('0x9')](),controller[_0xbf34('0x19')]);router['delete'](_0xbf34('0x12'),auth[_0xbf34('0x9')](),controller['removeMembers']);module[_0xbf34('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 bc028f3..ccf3979 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 _0x8d80=['BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x3d1580,_0x546d86){var _0x3de566=function(_0x3fd0a2){while(--_0x3fd0a2){_0x3d1580['push'](_0x3d1580['shift']());}};_0x3de566(++_0x546d86);}(_0x8d80,0x15a));var _0x08d8=function(_0x3686f8,_0x512638){_0x3686f8=_0x3686f8-0x0;var _0x159b3d=_0x8d80[_0x3686f8];return _0x159b3d;};'use strict';var Sequelize=require(_0x08d8('0x0'));module[_0x08d8('0x1')]={'closed':{'type':Sequelize[_0x08d8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x08d8('0x3')]},'ratingType':{'type':Sequelize[_0x08d8('0x4')]('star',_0x08d8('0x5')),'defaultValue':_0x08d8('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x08d8('0x7')]},'mailTranscript':{'type':Sequelize[_0x08d8('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x08d8('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x08d8('0x8')]},'thirdDisposition':{'type':Sequelize[_0x08d8('0x8')]},'note':{'type':Sequelize[_0x08d8('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x08d8('0x8')]},'osVersion':{'type':Sequelize[_0x08d8('0x8')]},'deviceModel':{'type':Sequelize[_0x08d8('0x8')]},'deviceVendor':{'type':Sequelize[_0x08d8('0x8')]},'deviceType':{'type':Sequelize[_0x08d8('0x8')]},'referer':{'type':Sequelize[_0x08d8('0x7')]},'customerIp':{'type':Sequelize[_0x08d8('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x08d8('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x08d8('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x08d8('0x4')]('in',_0x08d8('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x08d8('0x8')]},'customerPort':{'type':Sequelize[_0x08d8('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x08d8('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x08d8('0x3')]}}; \ No newline at end of file +var _0x3542=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x16f361,_0x57c702){var _0x2db56e=function(_0x178a4b){while(--_0x178a4b){_0x16f361['push'](_0x16f361['shift']());}};_0x2db56e(++_0x57c702);}(_0x3542,0x85));var _0x2354=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x3542[_0x15fa77];return _0x1385ff;};'use strict';var Sequelize=require(_0x2354('0x0'));module[_0x2354('0x1')]={'closed':{'type':Sequelize[_0x2354('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2354('0x3')]},'ratingType':{'type':Sequelize[_0x2354('0x4')](_0x2354('0x5'),'thumb'),'defaultValue':_0x2354('0x5')},'ratingMessage':{'type':Sequelize[_0x2354('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2354('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2354('0x8')]},'disposition':{'type':Sequelize[_0x2354('0x7')]},'secondDisposition':{'type':Sequelize[_0x2354('0x7')]},'thirdDisposition':{'type':Sequelize[_0x2354('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x2354('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2354('0x7')]},'deviceModel':{'type':Sequelize[_0x2354('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x2354('0x9'))},'read1stAt':{'type':Sequelize[_0x2354('0x8')]},'lastMsgAt':{'type':Sequelize[_0x2354('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2354('0x4')]('in',_0x2354('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2354('0x7')]},'customerPort':{'type':Sequelize[_0x2354('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x2354('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 5c801aa..b328888 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 _0x74a2=['direction','firstName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','offset','undefined','limit','set','Content-Range','json','update','name','send','merge','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','key','getOptions','findAll','chat','query','user','then','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','destroy','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','closed','Unauthorized','attachId','ChatOfflineMessageId','join','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','Messages','User','ContactId','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','appendFileSync','MailServerOut','Smtp','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','addMessage','ids','omit','getMessages','hasOwnProperty','sort','where','pick','ChatInteractionId','filter','$gte','split','count','getMyMessages','order','push','rows','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','root','server','files','Contact','lastName','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x74a2,0xdb));var _0x274a=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x74a2[_0x350aeb];return _0x3c5273;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x274a('0x0'));var rp=require('request-promise');var moment=require(_0x274a('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x274a('0x2'));var path=require(_0x274a('0x3'));var ejs=require(_0x274a('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x274a('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x274a('0x6'));var pdf=require(_0x274a('0x7'));var logger=require('../../config/logger')(_0x274a('0x8'));var config=require(_0x274a('0x9'));var db=require(_0x274a('0xa'))['db'];config[_0x274a('0xb')]=_['defaults'](config[_0x274a('0xb')],{'host':_0x274a('0xc'),'port':0x18eb});var socket=require(_0x274a('0xd'))(new Redis(config[_0x274a('0xb')]));require(_0x274a('0xe'))[_0x274a('0xf')](socket);var jayson=require(_0x274a('0x10'));var client=jayson[_0x274a('0x11')]['http']({'port':0x232b});var client9004=jayson[_0x274a('0x11')][_0x274a('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x10f202,_0x218b81,_0x1bbb19,_0x334825){return new BPromise(function(_0x3d2d74,_0x4470d9){var _0x22fcf0=_0x334825||client;return _0x22fcf0['request'](_0x10f202,_0x1bbb19)['then'](function(_0x167258){logger[_0x274a('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x218b81,_0x274a('0x14'));logger['debug'](_0x274a('0x15'),_0x218b81,_0x274a('0x14'),JSON[_0x274a('0x16')](_0x167258));if(_0x167258[_0x274a('0x17')]){if(_0x167258[_0x274a('0x17')][_0x274a('0x18')]===0x1f4){logger[_0x274a('0x17')](_0x274a('0x19'),_0x218b81,_0x167258[_0x274a('0x17')]['message']);return _0x4470d9(_0x167258[_0x274a('0x17')][_0x274a('0x1a')]);}logger[_0x274a('0x17')](_0x274a('0x19'),_0x218b81,_0x167258[_0x274a('0x17')][_0x274a('0x1a')]);return _0x3d2d74(_0x167258[_0x274a('0x17')][_0x274a('0x1a')]);}else{logger[_0x274a('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x218b81,_0x274a('0x14'));_0x3d2d74(_0x167258[_0x274a('0x1b')][_0x274a('0x1a')]);}})['catch'](function(_0x346692){logger[_0x274a('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x218b81,_0x346692);_0x4470d9(_0x346692);});});}function respondWithStatusCode(_0x3c7ccd,_0x47e3d9){_0x47e3d9=_0x47e3d9||0xcc;return function(_0xf22bd4){if(_0xf22bd4){return _0x3c7ccd[_0x274a('0x1c')](_0x47e3d9);}return _0x3c7ccd[_0x274a('0x1d')](_0x47e3d9)['end']();};}function respondWithResult(_0x443e28,_0x614a26){_0x614a26=_0x614a26||0xc8;return function(_0x2c6571){if(_0x2c6571){return _0x443e28['status'](_0x614a26)['json'](_0x2c6571);}};}function respondWithFilteredResult(_0x32ad2d,_0x365866){return function(_0x346795){if(_0x346795){var _0x16439d=typeof _0x365866[_0x274a('0x1e')]===_0x274a('0x1f')&&typeof _0x365866['limit']===_0x274a('0x1f');var _0x17f591=_0x346795['count'];var _0x1c6a4a=_0x16439d?0x0:_0x365866['offset'];var _0x1aaca7=_0x16439d?_0x346795['count']:_0x365866['offset']+_0x365866[_0x274a('0x20')];var _0x5752b5;if(_0x1aaca7>=_0x17f591){_0x1aaca7=_0x17f591;_0x5752b5=0xc8;}else{_0x5752b5=0xce;}_0x32ad2d[_0x274a('0x1d')](_0x5752b5);return _0x32ad2d[_0x274a('0x21')](_0x274a('0x22'),_0x1c6a4a+'-'+_0x1aaca7+'/'+_0x17f591)[_0x274a('0x23')](_0x346795);}return null;};}function saveUpdates(_0x42a9eb){return function(_0xf25aa0){if(_0xf25aa0){return _0xf25aa0[_0x274a('0x24')](_0x42a9eb)['then'](function(_0x2f343c){return _0x2f343c;});}return null;};}function removeEntity(_0x2fb6a0){return function(_0xe03732){if(_0xe03732){return _0xe03732['destroy']()['then'](function(){_0x2fb6a0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8d1d){return function(_0x4e1bc7){if(!_0x4e1bc7){_0x4b8d1d[_0x274a('0x1c')](0x194);}return _0x4e1bc7;};}function handleError(_0x1bdca9,_0x55d84a){_0x55d84a=_0x55d84a||0x1f4;return function(_0x2c7af9){logger[_0x274a('0x17')](_0x2c7af9['stack']);if(_0x2c7af9[_0x274a('0x25')]){delete _0x2c7af9[_0x274a('0x25')];}_0x1bdca9['status'](_0x55d84a)[_0x274a('0x26')](_0x2c7af9);};}function getMustacheRender(_0x1fc241,_0xab1360){return Mustache['render'](_0x1fc241,_[_0x274a('0x27')](_0xab1360['body'],{'contact':_0xab1360[_0x274a('0x28')],'message':_0xab1360['message'],'agent':_0xab1360[_0x274a('0x29')],'interaction':_0xab1360[_0x274a('0x2a')],'account':_0xab1360[_0x274a('0x2b')]}))||'';}exports['index']=function(_0x862659,_0x55ca04){var _0x20e5d1={};var _0x30ace0=_[_0x274a('0x2c')](db[_0x274a('0x2d')][_0x274a('0x2e')],function(_0x355ce4){return{'name':_0x355ce4['fieldName'],'type':_0x355ce4['type'][_0x274a('0x2f')]};});_0x20e5d1=qs[_0x274a('0x30')](_0x30ace0,_0x862659);return interaction[_0x274a('0x31')](_0x274a('0x32'),_0x862659[_0x274a('0x33')],_0x862659[_0x274a('0x34')],_0x20e5d1,_0x30ace0)[_0x274a('0x35')](respondWithFilteredResult(_0x55ca04,_0x20e5d1))[_0x274a('0x36')](handleError(_0x55ca04,null));};exports[_0x274a('0x37')]=function(_0x4199d5,_0x51b82b){var _0x269b83={'raw':![],'where':{'id':_0x4199d5[_0x274a('0x38')]['id']}},_0x3275dc={};_0x3275dc[_0x274a('0x39')]=_['keys'](db['ChatInteraction'][_0x274a('0x2e')]);_0x3275dc['query']=_[_0x274a('0x3a')](_0x4199d5[_0x274a('0x33')]);_0x3275dc[_0x274a('0x3b')]=_[_0x274a('0x3c')](_0x3275dc[_0x274a('0x39')],_0x3275dc[_0x274a('0x33')]);_0x269b83['attributes']=_[_0x274a('0x3c')](_0x3275dc[_0x274a('0x39')],qs[_0x274a('0x3d')](_0x4199d5[_0x274a('0x33')][_0x274a('0x3d')]));_0x269b83[_0x274a('0x3e')]=_0x269b83[_0x274a('0x3e')][_0x274a('0x3f')]?_0x269b83[_0x274a('0x3e')]:_0x3275dc[_0x274a('0x39')];if(_0x4199d5[_0x274a('0x33')][_0x274a('0x40')]){_0x269b83[_0x274a('0x41')]=[{'all':!![]}];}_0x269b83=_[_0x274a('0x27')]({},_0x269b83,_0x4199d5[_0x274a('0x42')]);return db[_0x274a('0x2d')][_0x274a('0x43')](_0x269b83)[_0x274a('0x35')](handleEntityNotFound(_0x51b82b,null))[_0x274a('0x35')](respondWithResult(_0x51b82b,null))[_0x274a('0x36')](handleError(_0x51b82b,null));};exports[_0x274a('0x44')]=function(_0x51a205,_0x103c29){return db[_0x274a('0x2d')]['create'](_0x51a205[_0x274a('0x45')],{})[_0x274a('0x35')](respondWithResult(_0x103c29,0xc9))[_0x274a('0x36')](handleError(_0x103c29,null));};exports['update']=function(_0x4d5f39,_0x27db9e){if(_0x4d5f39['body']['id']){delete _0x4d5f39['body']['id'];}return db[_0x274a('0x2d')][_0x274a('0x43')]({'where':{'id':_0x4d5f39[_0x274a('0x38')]['id']}})[_0x274a('0x35')](handleEntityNotFound(_0x27db9e,null))[_0x274a('0x35')](saveUpdates(_0x4d5f39['body'],null))[_0x274a('0x35')](respondWithResult(_0x27db9e,null))['catch'](handleError(_0x27db9e,null));};exports[_0x274a('0x46')]=function(_0x2ba892,_0x3d23ea){return db[_0x274a('0x2d')][_0x274a('0x43')]({'where':{'id':_0x2ba892[_0x274a('0x38')]['id']}})[_0x274a('0x35')](handleEntityNotFound(_0x3d23ea,null))[_0x274a('0x35')](removeEntity(_0x3d23ea,null))[_0x274a('0x36')](handleError(_0x3d23ea,null));};exports[_0x274a('0x47')]=function(_0x184e40,_0x148f2e){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x148f2e,null))[_0x274a('0x36')](handleError(_0x148f2e,null));};exports['createVidaooSession']=function(_0x425b0d,_0x2d8238){var _0x29e016=_0x425b0d[_0x274a('0x38')]['id'];var _0x1aef29;var _0x5c3077;var _0x371506;return db[_0x274a('0x2d')][_0x274a('0x48')]({'where':{'id':_0x29e016}})['then'](function(_0x17c3f6){_0x1aef29=_0x17c3f6;return db['ChatWebsite'][_0x274a('0x48')]({'where':{'id':_0x17c3f6[_0x274a('0x49')]},'attributes':['id',_0x274a('0x4a'),_0x274a('0x4b'),_0x274a('0x4c'),_0x274a('0x4d'),_0x274a('0x4e')],'raw':!![]});})[_0x274a('0x35')](function(_0x7597d0){if(_0x7597d0&&_0x7597d0[_0x274a('0x4a')]&&_0x7597d0[_0x274a('0x4b')]){_0x5c3077=_0x7597d0;var _0x16faea={'interaction':{'id':_0x29e016},'agent':{'id':_0x425b0d[_0x274a('0x34')]['id'],'name':_0x425b0d[_0x274a('0x34')]['name'],'fullname':_0x425b0d[_0x274a('0x34')][_0x274a('0x4f')],'email':_0x425b0d[_0x274a('0x34')][_0x274a('0x50')]},'contact':_0x425b0d[_0x274a('0x45')]['contact'],'account':_0x425b0d[_0x274a('0x45')][_0x274a('0x2b')]};var _0x48329b={'rejectUnauthorized':![],'method':_0x274a('0x51'),'url':_0x274a('0x52'),'headers':{'X-APIKEY':_0x7597d0[_0x274a('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x425b0d[_0x274a('0x34')]['email']],'buttons':null,'topic':_0x5c3077[_0x274a('0x4c')],'note':_[_0x274a('0x53')](_0x5c3077[_0x274a('0x4d')])?null:getMustacheRender(_0x5c3077[_0x274a('0x4d')],_0x16faea),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x274a('0x53')](_0x5c3077[_0x274a('0x4e')])){var _0x1b05e3=getMustacheRender(_0x5c3077['vidaooMetadata'],_0x16faea);var _0x548c67=JSON[_0x274a('0x54')](_0x1b05e3);_0x48329b[_0x274a('0x45')]['metadata']=_0x548c67;}}catch(_0x5de26a){throw new db[(_0x274a('0x55'))][(_0x274a('0x56'))](_0x274a('0x57'));}return rp(_0x48329b);}else{throw new db[(_0x274a('0x55'))][(_0x274a('0x56'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x274a('0x35')](function(_0x54a7ca){_0x371506=_0x54a7ca;if(_0x371506['id']){var _0x2ef282={'body':_0x371506[_0x274a('0x58')],'ChatWebsiteId':_0x5c3077['id'],'ChatInteractionId':_0x1aef29['id'],'direction':_0x274a('0x59'),'UserId':_0x425b0d[_0x274a('0x34')]['id']};return db['ChatMessage'][_0x274a('0x44')](_0x2ef282,{});}else{throw new db[(_0x274a('0x55'))][(_0x274a('0x56'))](_0x274a('0x5a'));}})[_0x274a('0x35')](function(){return _0x1aef29[_0x274a('0x5b')]({'vidaooSessionId':_0x371506['id']});})['then'](respondWithResult(_0x2d8238,null))['catch'](handleError(_0x2d8238,null));};exports[_0x274a('0x5c')]=function(_0x147371,_0x57ec92){if(_0x147371[_0x274a('0x45')]['id']){delete _0x147371['body']['id'];}return db[_0x274a('0x2d')]['find']({'where':{'id':_0x147371[_0x274a('0x38')]['id']},'include':[{'model':db[_0x274a('0x5d')],'as':'Contact'}]})[_0x274a('0x35')](handleEntityNotFound(_0x57ec92,null))['then'](saveUpdates(_0x147371[_0x274a('0x45')],null))['then'](respondWithResult(_0x57ec92,null))['catch'](handleError(_0x57ec92,null));};exports[_0x274a('0x5e')]=function(_0x288937,_0x138634){if(_0x288937[_0x274a('0x45')]['id']){delete _0x288937[_0x274a('0x45')]['id'];}return db[_0x274a('0x2d')][_0x274a('0x43')]({'where':{'id':_0x288937['params']['id']}})[_0x274a('0x35')](function(_0x18b66c){if(!_0x18b66c){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x274a('0x5e'),0x194,_0x274a('0x5f'));_0x138634['sendStatus'](0x194);}else{if(_0x18b66c[_0x274a('0x60')]){throw new db['Sequelize'][(_0x274a('0x56'))](_0x274a('0x61'));}}return _0x18b66c;})[_0x274a('0x35')](function(_0x8a91d6){if(_0x8a91d6){return _0x8a91d6['update']({'closed':_0x288937[_0x274a('0x45')]['closed'],'disposition':_0x288937[_0x274a('0x45')][_0x274a('0x62')]})[_0x274a('0x35')](function(_0xecf61c){return _0xecf61c;});}})['then'](function(){return respondWithRpcPromise(_0x274a('0x63'),'abandon',_0x288937[_0x274a('0x45')],client9004);})['then'](respondWithResult(_0x138634,null))[_0x274a('0x36')](handleError(_0x138634,null));};exports[_0x274a('0x64')]=function(_0x4b19d2,_0x57cb49){_0x4b19d2[_0x274a('0x45')][_0x274a('0x25')]=_0x4b19d2[_0x274a('0x65')][_0x274a('0x66')];_0x4b19d2[_0x274a('0x45')][_0x274a('0x67')]=_0x4b19d2[_0x274a('0x65')][_0x274a('0x68')];_0x4b19d2['body'][_0x274a('0x69')]=_0x4b19d2[_0x274a('0x65')][_0x274a('0x6a')];return db[_0x274a('0x6b')][_0x274a('0x44')](_0x4b19d2[_0x274a('0x45')])[_0x274a('0x35')](respondWithResult(_0x57cb49,0xc9))[_0x274a('0x36')](handleError(_0x57cb49,null));};exports['attachmentDownload']=function(_0x23915e,_0x3085b9){return db['ChatInteraction'][_0x274a('0x48')]({'where':{'id':_0x23915e[_0x274a('0x38')]['id']},'raw':!![]})[_0x274a('0x35')](handleEntityNotFound(_0x3085b9,null))[_0x274a('0x35')](function(_0x4eaeb0){if(_0x4eaeb0){if(_0x4eaeb0[_0x274a('0x6c')]){return _0x3085b9[_0x274a('0x1d')](0x193)[_0x274a('0x23')]({'status':0x193,'message':_0x274a('0x6d')});}return db[_0x274a('0x6b')][_0x274a('0x48')]({'where':{'id':_0x23915e[_0x274a('0x33')][_0x274a('0x6e')]},'raw':!![]})[_0x274a('0x35')](handleEntityNotFound(_0x3085b9,null));}})[_0x274a('0x35')](function(_0x5d2d7d){if(_0x5d2d7d){var _0x53204c=_0x5d2d7d[_0x274a('0x6f')]!==null;var _0x294f75=path[_0x274a('0x70')](config['root'],'server/files/attachments/');if(_0x53204c){_0x294f75=path[_0x274a('0x70')](_0x294f75,'offline-chat/');}var _0x41e893=path[_0x274a('0x70')](_0x294f75,_0x5d2d7d['basename']);return _0x3085b9[_0x274a('0x71')](_0x41e893);}})[_0x274a('0x36')](handleError(_0x3085b9,null));};exports[_0x274a('0x72')]=function(_0x323bd9,_0x47c2e7){var _0x5c32cd=null;var _0x5b1239=null;var _0x275c49=null;if(_0x323bd9[_0x274a('0x45')]['id']){delete _0x323bd9[_0x274a('0x45')]['id'];}if(_0x323bd9[_0x274a('0x45')][_0x274a('0x73')]){_0x275c49=path[_0x274a('0x70')](config['root'],_0x274a('0x74'),util[_0x274a('0x75')](_0x274a('0x76'),Date[_0x274a('0x77')]()));_0x323bd9[_0x274a('0x45')]['pathTranscript']=_0x275c49;}return db[_0x274a('0x2d')]['find']({'where':{'id':_0x323bd9[_0x274a('0x38')]['id']},'include':[{'model':db[_0x274a('0x78')],'as':_0x274a('0x79'),'include':[{'model':db['User'],'as':_0x274a('0x7a')}]}]})[_0x274a('0x35')](handleEntityNotFound(_0x47c2e7,null))['then'](saveUpdates(_0x323bd9[_0x274a('0x45')],null))[_0x274a('0x35')](function(_0x2cf7c4){if(_0x2cf7c4){_0x5c32cd=_0x2cf7c4;return db['ChatWebsite'][_0x274a('0x43')]({'where':{'id':_0x5c32cd[_0x274a('0x49')]}});}})[_0x274a('0x35')](function(_0x4734d3){if(_0x4734d3){_0x5b1239=_0x4734d3;return db[_0x274a('0x5d')][_0x274a('0x43')]({'where':{'id':_0x5c32cd[_0x274a('0x7b')]}});}})[_0x274a('0x35')](function(_0x1565bc){if(_0x1565bc){if(_0x275c49){var _0x65aa4a=null;for(var _0x1e9bd1=0x1;_0x1e9bd1<_0x5c32cd[_0x274a('0x79')][_0x274a('0x3f')];++_0x1e9bd1){_0x65aa4a=_0x5c32cd[_0x274a('0x79')][_0x1e9bd1];var _0x140bba=_0x65aa4a[_0x274a('0x60')]?util[_0x274a('0x75')]('%s%d',_0x5b1239['agentAlias'],_0x65aa4a[_0x274a('0x60')]):_0x274a('0x7c');var _0x3917a3=_0x323bd9[_0x274a('0x45')][_0x274a('0x7d')]||util[_0x274a('0x75')](_0x274a('0x7e'),_0x274a('0x7f'),_0x65aa4a[_0x274a('0x7b')]);switch(_0x5b1239[_0x274a('0x80')]){case _0x274a('0x81'):_0x140bba=_0x65aa4a['UserId']?util[_0x274a('0x75')](_0x274a('0x7e'),_0x5b1239[_0x274a('0x82')],_0x65aa4a['UserId']):'System';break;case _0x274a('0x83'):_0x140bba=_0x65aa4a[_0x274a('0x60')]?_0x65aa4a[_0x274a('0x7a')][_0x274a('0x84')]||_0x65aa4a['User']['fullname']:_0x274a('0x7c');break;case _0x274a('0x85'):_0x140bba=_0x65aa4a['UserId']?_0x65aa4a[_0x274a('0x7a')][_0x274a('0x4f')]:_0x274a('0x7c');break;default:_0x140bba=_0x65aa4a[_0x274a('0x60')]?util[_0x274a('0x75')](_0x274a('0x7e'),_0x5b1239[_0x274a('0x82')],_0x65aa4a[_0x274a('0x60')]):_0x274a('0x7c');}var _0x16d627=util[_0x274a('0x75')](_0x274a('0x86'),moment(_0x65aa4a[_0x274a('0x87')])[_0x274a('0x75')]('MM/DD/YYYY\x20HH:mm:ss'),_0x65aa4a['direction']==='in'?_0x3917a3:_0x140bba,_0x65aa4a[_0x274a('0x45')]);if(!_0x65aa4a[_0x274a('0x88')]){fs[_0x274a('0x89')](_0x275c49,_0x16d627);}}return db['MailAccount'][_0x274a('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x274a('0x8a')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x274a('0x35')](function(_0x217dc6){if(!_0x217dc6||!_0x217dc6[_0x274a('0x8b')]||!_0x323bd9[_0x274a('0x45')])return _0x5c32cd;var _0x310989=_0x217dc6[_0x274a('0x8c')]();return respondWithRpcPromise(_0x274a('0x8d'),_0x274a('0x8e'),{'account':_0x310989,'message':{'from':util['format'](_0x274a('0x8f'),_0x217dc6[_0x274a('0x25')],_0x217dc6[_0x274a('0x50')]||_0x217dc6[_0x274a('0x8b')]['user']),'to':_0x323bd9[_0x274a('0x45')][_0x274a('0x73')],'subject':_0x274a('0x90'),'text':util['format'](_0x274a('0x91'),_0x323bd9['body']['mailTranscript']),'attachments':[{'path':_0x275c49}]}})['then'](function(){return _0x5c32cd;})['catch'](function(_0x479343){logger[_0x274a('0x17')](_0x479343);});})[_0x274a('0x35')](respondWithStatusCode(_0x47c2e7,0xc8))[_0x274a('0x36')](handleError(_0x47c2e7,null));};exports['addMessage']=function(_0x88342e,_0x1f7ce7){return db[_0x274a('0x78')]['find']({'where':{'id':_0x88342e['params']['id']}})[_0x274a('0x35')](handleEntityNotFound(_0x1f7ce7,null))[_0x274a('0x35')](function(_0x2dc215){if(_0x2dc215){return _0x2dc215[_0x274a('0x92')](_0x88342e[_0x274a('0x45')][_0x274a('0x93')],_[_0x274a('0x94')](_0x88342e['body'],[_0x274a('0x93'),'id'])||{});}})[_0x274a('0x35')](respondWithResult(_0x1f7ce7,null))[_0x274a('0x36')](handleError(_0x1f7ce7,null));};exports[_0x274a('0x95')]=function(_0x48a49c,_0x243372){var _0xcb6d2f={'raw':![],'where':{}};var _0x27b2ff={};var _0x17a6b1={'count':0x0,'rows':[]};return db[_0x274a('0x2d')][_0x274a('0x48')]({'where':{'id':_0x48a49c[_0x274a('0x38')]['id']}})['then'](handleEntityNotFound(_0x243372,null))[_0x274a('0x35')](function(_0x80fc20){if(_0x80fc20){_0x27b2ff[_0x274a('0x39')]=_[_0x274a('0x3a')](db['ChatMessage'][_0x274a('0x2e')]);_0x27b2ff['query']=_['keys'](_0x48a49c[_0x274a('0x33')]);_0x27b2ff[_0x274a('0x3b')]=_[_0x274a('0x3c')](_0x27b2ff[_0x274a('0x39')],_0x27b2ff[_0x274a('0x33')]);_0xcb6d2f[_0x274a('0x3e')]=_['intersection'](_0x27b2ff[_0x274a('0x39')],qs['fields'](_0x48a49c[_0x274a('0x33')][_0x274a('0x3d')]));_0xcb6d2f['attributes']=_0xcb6d2f[_0x274a('0x3e')][_0x274a('0x3f')]?_0xcb6d2f[_0x274a('0x3e')]:_0x27b2ff[_0x274a('0x39')];if(!_0x48a49c[_0x274a('0x33')][_0x274a('0x96')]('nolimit')){_0xcb6d2f[_0x274a('0x20')]=qs['limit'](_0x48a49c[_0x274a('0x33')][_0x274a('0x20')]);_0xcb6d2f[_0x274a('0x1e')]=qs[_0x274a('0x1e')](_0x48a49c[_0x274a('0x33')][_0x274a('0x1e')]);}_0xcb6d2f['order']=qs[_0x274a('0x97')](_0x48a49c['query']['sort']);_0xcb6d2f[_0x274a('0x98')]=qs[_0x274a('0x3b')](_[_0x274a('0x99')](_0x48a49c['query'],_0x27b2ff[_0x274a('0x3b')]));_0xcb6d2f[_0x274a('0x98')][_0x274a('0x9a')]=_0x80fc20['id'];if(_0x48a49c[_0x274a('0x33')][_0x274a('0x9b')]){_0xcb6d2f[_0x274a('0x98')]=_[_0x274a('0x27')](_0xcb6d2f['where'],{'$or':_[_0x274a('0x2c')](_0xcb6d2f['attributes'],function(_0x268aab){var _0x30c8dd={};_0x30c8dd[_0x268aab]={'$like':'%'+_0x48a49c[_0x274a('0x33')][_0x274a('0x9b')]+'%'};return _0x30c8dd;})});}if(_0x48a49c[_0x274a('0x33')]['$gte']){var _0x357b1a=_0x48a49c[_0x274a('0x33')][_0x274a('0x9c')][_0x274a('0x9d')](',');var _0x4a1316={};_0x4a1316[_0x357b1a[0x0]]={'$gte':moment(_0x357b1a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xcb6d2f[_0x274a('0x98')]=_[_0x274a('0x27')](_0xcb6d2f['where'],_0x4a1316);}_0xcb6d2f=_[_0x274a('0x27')]({},_0xcb6d2f,_0x48a49c[_0x274a('0x42')]);return db[_0x274a('0x78')][_0x274a('0x9e')]({'where':_0xcb6d2f[_0x274a('0x98')]})[_0x274a('0x35')](function(_0x40cab8){_0x17a6b1[_0x274a('0x9e')]=_0x40cab8;if(_0x48a49c[_0x274a('0x33')]['includeAll']){_0xcb6d2f['include']=[{'all':!![]}];}return db[_0x274a('0x78')][_0x274a('0x31')](_0xcb6d2f);})[_0x274a('0x35')](function(_0x317520){_0x17a6b1['rows']=_0x317520;return _0x17a6b1;});}})[_0x274a('0x35')](respondWithFilteredResult(_0x243372,_0xcb6d2f))['catch'](handleError(_0x243372,null));};exports[_0x274a('0x9f')]=function(_0x1895d2,_0x87402e){var _0x4dc705={'where':{}},_0x3bb70a={},_0x1d8674={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1895d2[_0x274a('0x38')]['id']}})[_0x274a('0x35')](handleEntityNotFound(_0x87402e,null))[_0x274a('0x35')](function(_0x4ad983){if(_0x4ad983){_0x3bb70a[_0x274a('0x39')]=_[_0x274a('0x3a')](db['ChatMessage'][_0x274a('0x2e')]);_0x3bb70a[_0x274a('0x33')]=_[_0x274a('0x3a')](_0x1895d2[_0x274a('0x33')]);_0x3bb70a[_0x274a('0x3b')]=_[_0x274a('0x3c')](_0x3bb70a[_0x274a('0x39')],_0x3bb70a[_0x274a('0x33')]);_0x4dc705[_0x274a('0x3e')]=_['intersection'](_0x3bb70a[_0x274a('0x39')],qs[_0x274a('0x3d')](_0x1895d2[_0x274a('0x33')][_0x274a('0x3d')]));_0x4dc705[_0x274a('0x3e')]=_0x4dc705[_0x274a('0x3e')][_0x274a('0x3f')]?_0x4dc705[_0x274a('0x3e')]:_0x3bb70a[_0x274a('0x39')];if(!_0x1895d2[_0x274a('0x33')][_0x274a('0x96')]('nolimit')){_0x4dc705[_0x274a('0x20')]=qs['limit'](_0x1895d2[_0x274a('0x33')][_0x274a('0x20')]);_0x4dc705[_0x274a('0x1e')]=qs[_0x274a('0x1e')](_0x1895d2[_0x274a('0x33')][_0x274a('0x1e')]);}_0x4dc705[_0x274a('0xa0')]=qs[_0x274a('0x97')](_0x1895d2[_0x274a('0x33')][_0x274a('0x97')]);_0x4dc705['where']=qs[_0x274a('0x3b')](_[_0x274a('0x99')](_0x1895d2[_0x274a('0x33')],_0x3bb70a[_0x274a('0x3b')]));_0x4dc705[_0x274a('0x98')][_0x274a('0x9a')]=_0x4ad983['id'];if(_0x1895d2[_0x274a('0x33')]['filter']){_0x4dc705[_0x274a('0x98')]=_[_0x274a('0x27')](_0x4dc705[_0x274a('0x98')],{'$or':_[_0x274a('0x2c')](_0x4dc705[_0x274a('0x3e')],function(_0x200bf5){var _0x19bf56={};_0x19bf56[_0x200bf5]={'$like':'%'+_0x1895d2[_0x274a('0x33')][_0x274a('0x9b')]+'%'};return _0x19bf56;})});}_0x4dc705[_0x274a('0x98')][_0x274a('0x88')]=![];if(_0x1895d2[_0x274a('0x33')]['id']){_0x4dc705[_0x274a('0x98')]['id']={'$gt':_0x1895d2[_0x274a('0x33')]['id']};}_0x4dc705=_['merge']({},_0x4dc705,_0x1895d2['options']);return db[_0x274a('0x78')][_0x274a('0x9e')]({'where':_0x4dc705[_0x274a('0x98')]})['then'](function(_0xad7fb5){_0x1d8674[_0x274a('0x9e')]=_0xad7fb5;_0x4dc705['include']=[];if(_0x1895d2[_0x274a('0x33')]['includeAgent']){_0x4dc705[_0x274a('0x41')][_0x274a('0xa1')]({'model':db[_0x274a('0x7a')],'as':_0x274a('0x7a'),'attributes':['id','fullname',_0x274a('0x84')]});}if(_0x1895d2[_0x274a('0x33')][_0x274a('0x40')]){_0x4dc705[_0x274a('0x41')]=[{'all':!![]}];}return db[_0x274a('0x78')][_0x274a('0x31')](_0x4dc705);})[_0x274a('0x35')](function(_0x1145e0){_0x1d8674[_0x274a('0xa2')]=_0x1145e0;return _0x1d8674;});}})[_0x274a('0x35')](respondWithFilteredResult(_0x87402e,_0x4dc705))['catch'](handleError(_0x87402e,null));};exports[_0x274a('0xa3')]=function(_0x59f499,_0x5c5089){return db[_0x274a('0x2d')]['find']({'where':{'id':_0x59f499[_0x274a('0x38')]['id']}})[_0x274a('0x35')](handleEntityNotFound(_0x5c5089,null))[_0x274a('0x35')](function(_0x362005){if(_0x362005){return _0x362005[_0x274a('0xa4')](_0x59f499[_0x274a('0x45')][_0x274a('0x93')],_['omit'](_0x59f499[_0x274a('0x45')],[_0x274a('0x93'),'id'])||{})[_0x274a('0xa5')](function(){return db[_0x274a('0xa6')][_0x274a('0x31')]({'attributes':['id','name','color'],'where':{'id':_0x59f499['body'][_0x274a('0x93')]}});})['then'](function(_0x111c72){socket[_0x274a('0xa7')](_0x274a('0xa8'),{'id':Number(_0x59f499[_0x274a('0x38')]['id']),'tags':_0x111c72||[]});return{'id':Number(_0x59f499['params']['id']),'tags':_0x111c72||[]};});}})['then'](respondWithResult(_0x5c5089,null))[_0x274a('0x36')](handleError(_0x5c5089,null));};exports[_0x274a('0xa9')]=function(_0x537d13,_0x18a752){return db['ChatInteraction'][_0x274a('0x43')]({'where':{'id':_0x537d13[_0x274a('0x38')]['id']}})['then'](handleEntityNotFound(_0x18a752,null))['then'](function(_0x30bfd0){if(_0x30bfd0){return _0x30bfd0['removeTags'](_0x537d13['query'][_0x274a('0x93')]);}})['then'](respondWithStatusCode(_0x18a752,null))[_0x274a('0x36')](handleError(_0x18a752,null));};exports[_0x274a('0x71')]=function(_0x1d02a9,_0x2b7126){var _0x283503=moment()['unix']()['toString']();var _0x5afbe4=path[_0x274a('0x70')](config[_0x274a('0xaa')],_0x274a('0xab'),_0x274a('0xac'),'tmp');var _0x51e5e4=path[_0x274a('0x70')](config[_0x274a('0xaa')],_0x274a('0xab'),_0x274a('0xac'),'attachments');var _0x3f8d64=path[_0x274a('0x70')](_0x5afbe4,_0x283503);var _0x2f9db5=util[_0x274a('0x75')]('transcript-%d-%s.zip',_0x1d02a9[_0x274a('0x38')]['id'],_0x283503);var _0x309927=path['join'](_0x5afbe4,_0x2f9db5);var _0x3d8734=[];_0x3d8734[_0x274a('0xa1')]({'model':db[_0x274a('0x7a')],'as':_0x274a('0x7a'),'attributes':['id',_0x274a('0x4f')],'raw':!![]});_0x3d8734[_0x274a('0xa1')]({'model':db[_0x274a('0x5d')],'as':_0x274a('0xad'),'attributes':['id','firstName',_0x274a('0xae')],'raw':!![]});if(_0x1d02a9[_0x274a('0x33')]['attachments']){_0x3d8734[_0x274a('0xa1')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x5e1194=[{'model':db[_0x274a('0x78')],'as':_0x274a('0x79'),'attributes':['id',_0x274a('0x45'),_0x274a('0x87'),'direction','secret','read'],'include':_0x3d8734}];_0x5e1194['push']({'model':db[_0x274a('0xaf')],'as':_0x274a('0xb0'),'attributes':['id',_0x274a('0x25')]});_0x5e1194[_0x274a('0xa1')]({'model':db[_0x274a('0x7a')],'as':_0x274a('0xb1'),'attributes':['id',_0x274a('0x4f')]});return db[_0x274a('0x2d')][_0x274a('0x43')]({'where':{'id':_0x1d02a9[_0x274a('0x38')]['id']},'include':_0x5e1194})['then'](handleEntityNotFound(_0x2b7126,null))[_0x274a('0x35')](function(_0x581a85){if(_0x581a85){var _0x5df0bb=_0x581a85[_0x274a('0xb2')]({'plain':!![]});fs[_0x274a('0xb3')](_0x3f8d64);var _0x2bd9cb={'channel':_0x274a('0xb4'),'account':_0x5df0bb['Account']['name'],'agent':_0x5df0bb[_0x274a('0xb1')]?_0x5df0bb['Owner'][_0x274a('0x4f')]:_0x274a('0xb5'),'createdAt':moment(_0x5df0bb[_0x274a('0x87')])[_0x274a('0x75')](_0x274a('0xb6'))[_0x274a('0xb7')](),'closedAt':_0x5df0bb[_0x274a('0x6c')]?moment(_0x5df0bb[_0x274a('0xb8')])[_0x274a('0x75')](_0x274a('0xb6'))[_0x274a('0xb7')]():'','disposition':_0x5df0bb[_0x274a('0x62')],'chatInfo':{'browser':_0x5df0bb[_0x274a('0xb9')],'os':_0x5df0bb[_0x274a('0xba')],'referer':_0x5df0bb[_0x274a('0xbb')],'customerIp':_0x5df0bb[_0x274a('0xbc')],'customerPort':_0x5df0bb[_0x274a('0xbd')]?_0x5df0bb[_0x274a('0xbd')]:'N.A.'},'messages':_(_0x5df0bb[_0x274a('0x79')])[_0x274a('0xbe')]()['filter']({'secret':![]})[_0x274a('0x2c')](function(_0x5616a1){if(_0x5616a1[_0x274a('0x6b')]){var _0x2760c3=path[_0x274a('0x70')](_0x51e5e4,_0x5616a1['Attachment'][_0x274a('0x67')]);if(fs[_0x274a('0xbf')](_0x2760c3)){fs[_0x274a('0xc0')](_0x2760c3)[_0x274a('0xc1')](fs[_0x274a('0xc2')](path[_0x274a('0x70')](_0x3f8d64,_0x5616a1[_0x274a('0x6b')][_0x274a('0x67')])));}}return{'date':moment(_0x5616a1[_0x274a('0x87')])[_0x274a('0x75')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x5616a1[_0x274a('0xc3')]===_0x274a('0x59')?_0x5616a1[_0x274a('0x7a')]?_0x5616a1['User'][_0x274a('0x4f')]:_0x274a('0x7c'):_0x5616a1[_0x274a('0xad')][_0x274a('0xc4')]+(_0x5616a1[_0x274a('0xad')][_0x274a('0xae')]?'\x20'+_0x5616a1['Contact'][_0x274a('0xae')]:''),'body':_0x5616a1[_0x274a('0x6b')]?_0x5616a1[_0x274a('0x6b')]['basename']:_0x5616a1[_0x274a('0x45')],'direction':_0x5616a1[_0x274a('0xc3')]==='out'?'A':'C','secret':_0x5616a1[_0x274a('0x88')],'read':_0x5616a1[_0x274a('0xc5')],'attachment':_0x5616a1[_0x274a('0x6b')]};})[_0x274a('0xc6')]()};return ejs[_0x274a('0xc7')](path[_0x274a('0x70')](config[_0x274a('0xaa')],_0x274a('0xab'),_0x274a('0xc8'),_0x274a('0xc9')),{'interaction':_0x2bd9cb})[_0x274a('0x35')](function(_0x3e0f65){var _0x30e3d6=path['join'](_0x3f8d64,_0x274a('0xca')+_0x5df0bb['id']+'-'+_0x283503+_0x274a('0xcb'));var _0x3ec3c1={'path':_0x30e3d6,'channel':_0x274a('0xb4'),'interactionId':_0x5df0bb['id']};return pdf[_0x274a('0xcc')](_0x3e0f65,_0x3ec3c1);})[_0x274a('0x35')](function(){return new Promise(function(_0x2fecce,_0x1c70f9){zipdir(_0x3f8d64,{'saveTo':_0x309927},function(_0x2ab6a0,_0x4878c1){if(_0x2ab6a0)return _0x1c70f9(_0x2ab6a0);return _0x2fecce(_0x4878c1);});})[_0x274a('0x35')](function(){return new BPromise(function(_0x268daf,_0x4af108){rimraf(_0x3f8d64,function(_0x27876d){if(_0x27876d)_0x4af108(_0x27876d);return _0x268daf();});});})[_0x274a('0x35')](function(){return _0x2b7126[_0x274a('0x71')](_0x309927,_0x2f9db5,function(_0x52e6bf){if(_0x52e6bf){logger[_0x274a('0x17')](_0x274a('0xcd'),_0x52e6bf);}else{fs[_0x274a('0xce')](_0x309927);}});});});}else{return _0x2b7126['sendStatus'](0xc8);}})[_0x274a('0x36')](handleError(_0x2b7126,null));}; \ No newline at end of file +var _0x4967=['customer','%s%d','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','include','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','files','transcript-%d-%s.zip','push','lastName','attachments','read','Account','Owner','get','mkdirSync','N.A.','toString','closedAt','browserName','osName','referer','customerIp','createReadStream','pipe','Contact','firstName','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','unlinkSync','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','count','set','Content-Range','update','destroy','sendStatus','stack','send','merge','body','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','chat','query','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','length','includeAll','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','user','name','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ContactId','Messages','format','agentAlias','System'];(function(_0x8c7878,_0x3dd23e){var _0x4b8a55=function(_0x99ee28){while(--_0x99ee28){_0x8c7878['push'](_0x8c7878['shift']());}};_0x4b8a55(++_0x3dd23e);}(_0x4967,0x11b));var _0x7496=function(_0xa34cd7,_0x589125){_0xa34cd7=_0xa34cd7-0x0;var _0x45bb92=_0x4967[_0xa34cd7];return _0x45bb92;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x7496('0x0'));var moment=require(_0x7496('0x1'));var BPromise=require(_0x7496('0x2'));var Mustache=require(_0x7496('0x3'));var util=require(_0x7496('0x4'));var path=require(_0x7496('0x5'));var ejs=require(_0x7496('0x6'));var fs=require('fs');var _=require(_0x7496('0x7'));var Redis=require('ioredis');var interaction=require(_0x7496('0x8'));var qs=require(_0x7496('0x9'));var pdf=require(_0x7496('0xa'));var logger=require(_0x7496('0xb'))(_0x7496('0xc'));var config=require(_0x7496('0xd'));var db=require(_0x7496('0xe'))['db'];config['redis']=_[_0x7496('0xf')](config['redis'],{'host':_0x7496('0x10'),'port':0x18eb});var socket=require(_0x7496('0x11'))(new Redis(config[_0x7496('0x12')]));require(_0x7496('0x13'))[_0x7496('0x14')](socket);var jayson=require(_0x7496('0x15'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x7496('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3eb3d1,_0x1f42eb,_0x485283,_0x217f71){return new BPromise(function(_0x510a11,_0x310810){var _0x5140be=_0x217f71||client;return _0x5140be['request'](_0x3eb3d1,_0x485283)[_0x7496('0x17')](function(_0x273417){logger['info'](_0x7496('0x18'),_0x1f42eb,_0x7496('0x19'));logger['debug'](_0x7496('0x1a'),_0x1f42eb,'request\x20sent',JSON[_0x7496('0x1b')](_0x273417));if(_0x273417[_0x7496('0x1c')]){if(_0x273417[_0x7496('0x1c')][_0x7496('0x1d')]===0x1f4){logger['error'](_0x7496('0x18'),_0x1f42eb,_0x273417[_0x7496('0x1c')][_0x7496('0x1e')]);return _0x310810(_0x273417['error'][_0x7496('0x1e')]);}logger[_0x7496('0x1c')](_0x7496('0x18'),_0x1f42eb,_0x273417[_0x7496('0x1c')][_0x7496('0x1e')]);return _0x510a11(_0x273417[_0x7496('0x1c')][_0x7496('0x1e')]);}else{logger[_0x7496('0x1f')](_0x7496('0x18'),_0x1f42eb,'request\x20sent');_0x510a11(_0x273417[_0x7496('0x20')]['message']);}})[_0x7496('0x21')](function(_0x804770){logger[_0x7496('0x1c')](_0x7496('0x18'),_0x1f42eb,_0x804770);_0x310810(_0x804770);});});}function respondWithStatusCode(_0x402b45,_0x13270f){_0x13270f=_0x13270f||0xcc;return function(_0x52f3bd){if(_0x52f3bd){return _0x402b45['sendStatus'](_0x13270f);}return _0x402b45[_0x7496('0x22')](_0x13270f)[_0x7496('0x23')]();};}function respondWithResult(_0x114877,_0x582819){_0x582819=_0x582819||0xc8;return function(_0x4333f5){if(_0x4333f5){return _0x114877['status'](_0x582819)[_0x7496('0x24')](_0x4333f5);}};}function respondWithFilteredResult(_0x246c3a,_0x80f921){return function(_0x22b11f){if(_0x22b11f){var _0x3b299f=typeof _0x80f921[_0x7496('0x25')]==='undefined'&&typeof _0x80f921[_0x7496('0x26')]==='undefined';var _0x2a37f9=_0x22b11f[_0x7496('0x27')];var _0x2458d0=_0x3b299f?0x0:_0x80f921['offset'];var _0x44a3f5=_0x3b299f?_0x22b11f[_0x7496('0x27')]:_0x80f921[_0x7496('0x25')]+_0x80f921[_0x7496('0x26')];var _0x29249d;if(_0x44a3f5>=_0x2a37f9){_0x44a3f5=_0x2a37f9;_0x29249d=0xc8;}else{_0x29249d=0xce;}_0x246c3a[_0x7496('0x22')](_0x29249d);return _0x246c3a[_0x7496('0x28')](_0x7496('0x29'),_0x2458d0+'-'+_0x44a3f5+'/'+_0x2a37f9)[_0x7496('0x24')](_0x22b11f);}return null;};}function saveUpdates(_0x127af3){return function(_0x4fe376){if(_0x4fe376){return _0x4fe376[_0x7496('0x2a')](_0x127af3)[_0x7496('0x17')](function(_0x355b7f){return _0x355b7f;});}return null;};}function removeEntity(_0x1dfe8b){return function(_0x7cf62f){if(_0x7cf62f){return _0x7cf62f[_0x7496('0x2b')]()[_0x7496('0x17')](function(){_0x1dfe8b['status'](0xcc)[_0x7496('0x23')]();});}};}function handleEntityNotFound(_0x384540){return function(_0x4f8df6){if(!_0x4f8df6){_0x384540[_0x7496('0x2c')](0x194);}return _0x4f8df6;};}function handleError(_0x5ea966,_0x7dfc9b){_0x7dfc9b=_0x7dfc9b||0x1f4;return function(_0x5c7790){logger[_0x7496('0x1c')](_0x5c7790[_0x7496('0x2d')]);if(_0x5c7790['name']){delete _0x5c7790['name'];}_0x5ea966[_0x7496('0x22')](_0x7dfc9b)[_0x7496('0x2e')](_0x5c7790);};}function getMustacheRender(_0x4f4d4c,_0x8aff61){return Mustache['render'](_0x4f4d4c,_[_0x7496('0x2f')](_0x8aff61[_0x7496('0x30')],{'contact':_0x8aff61['contact'],'message':_0x8aff61[_0x7496('0x1e')],'agent':_0x8aff61['agent'],'interaction':_0x8aff61[_0x7496('0x31')],'account':_0x8aff61[_0x7496('0x32')]}))||'';}exports[_0x7496('0x33')]=function(_0x577ae4,_0x448f49){var _0x17c5e0={};var _0x1cc69d=_[_0x7496('0x34')](db['ChatInteraction'][_0x7496('0x35')],function(_0xc14239){return{'name':_0xc14239[_0x7496('0x36')],'type':_0xc14239[_0x7496('0x37')]['key']};});_0x17c5e0=qs[_0x7496('0x38')](_0x1cc69d,_0x577ae4);return interaction['findAll'](_0x7496('0x39'),_0x577ae4[_0x7496('0x3a')],_0x577ae4['user'],_0x17c5e0,_0x1cc69d)[_0x7496('0x17')](respondWithFilteredResult(_0x448f49,_0x17c5e0))[_0x7496('0x21')](handleError(_0x448f49,null));};exports[_0x7496('0x3b')]=function(_0x4a2147,_0x407b9b){var _0x10c5c2={'raw':![],'where':{'id':_0x4a2147[_0x7496('0x3c')]['id']}},_0x301716={};_0x301716[_0x7496('0x3d')]=_[_0x7496('0x3e')](db[_0x7496('0x3f')][_0x7496('0x35')]);_0x301716[_0x7496('0x3a')]=_['keys'](_0x4a2147[_0x7496('0x3a')]);_0x301716[_0x7496('0x40')]=_[_0x7496('0x41')](_0x301716[_0x7496('0x3d')],_0x301716[_0x7496('0x3a')]);_0x10c5c2['attributes']=_[_0x7496('0x41')](_0x301716['model'],qs[_0x7496('0x42')](_0x4a2147[_0x7496('0x3a')][_0x7496('0x42')]));_0x10c5c2[_0x7496('0x43')]=_0x10c5c2[_0x7496('0x43')][_0x7496('0x44')]?_0x10c5c2[_0x7496('0x43')]:_0x301716[_0x7496('0x3d')];if(_0x4a2147[_0x7496('0x3a')][_0x7496('0x45')]){_0x10c5c2['include']=[{'all':!![]}];}_0x10c5c2=_['merge']({},_0x10c5c2,_0x4a2147[_0x7496('0x46')]);return db[_0x7496('0x3f')]['find'](_0x10c5c2)[_0x7496('0x17')](handleEntityNotFound(_0x407b9b,null))[_0x7496('0x17')](respondWithResult(_0x407b9b,null))[_0x7496('0x21')](handleError(_0x407b9b,null));};exports['create']=function(_0x2d164b,_0x1d7fa8){return db[_0x7496('0x3f')][_0x7496('0x47')](_0x2d164b['body'],{})[_0x7496('0x17')](respondWithResult(_0x1d7fa8,0xc9))[_0x7496('0x21')](handleError(_0x1d7fa8,null));};exports[_0x7496('0x2a')]=function(_0x4a7157,_0x27dc51){if(_0x4a7157['body']['id']){delete _0x4a7157[_0x7496('0x30')]['id'];}return db[_0x7496('0x3f')]['find']({'where':{'id':_0x4a7157[_0x7496('0x3c')]['id']}})['then'](handleEntityNotFound(_0x27dc51,null))['then'](saveUpdates(_0x4a7157[_0x7496('0x30')],null))[_0x7496('0x17')](respondWithResult(_0x27dc51,null))[_0x7496('0x21')](handleError(_0x27dc51,null));};exports['destroy']=function(_0x39de01,_0x208d6f){return db[_0x7496('0x3f')][_0x7496('0x48')]({'where':{'id':_0x39de01[_0x7496('0x3c')]['id']}})[_0x7496('0x17')](handleEntityNotFound(_0x208d6f,null))[_0x7496('0x17')](removeEntity(_0x208d6f,null))['catch'](handleError(_0x208d6f,null));};exports['describe']=function(_0x4c20a8,_0x56024b){return db[_0x7496('0x3f')][_0x7496('0x49')]()[_0x7496('0x17')](respondWithResult(_0x56024b,null))[_0x7496('0x21')](handleError(_0x56024b,null));};exports[_0x7496('0x4a')]=function(_0x25f8a9,_0x448731){var _0xea12f2=_0x25f8a9['params']['id'];var _0x580d14;var _0x5680f9;var _0x21db91;return db['ChatInteraction'][_0x7496('0x4b')]({'where':{'id':_0xea12f2}})[_0x7496('0x17')](function(_0x21ee6e){_0x580d14=_0x21ee6e;return db[_0x7496('0x4c')][_0x7496('0x4b')]({'where':{'id':_0x21ee6e[_0x7496('0x4d')]},'attributes':['id',_0x7496('0x4e'),_0x7496('0x4f'),'vidaooTopic',_0x7496('0x50'),_0x7496('0x51')],'raw':!![]});})['then'](function(_0x4dc5b0){if(_0x4dc5b0&&_0x4dc5b0[_0x7496('0x4e')]&&_0x4dc5b0[_0x7496('0x4f')]){_0x5680f9=_0x4dc5b0;var _0x8d4196={'interaction':{'id':_0xea12f2},'agent':{'id':_0x25f8a9[_0x7496('0x52')]['id'],'name':_0x25f8a9[_0x7496('0x52')][_0x7496('0x53')],'fullname':_0x25f8a9[_0x7496('0x52')][_0x7496('0x54')],'email':_0x25f8a9[_0x7496('0x52')]['email']},'contact':_0x25f8a9['body'][_0x7496('0x55')],'account':_0x25f8a9[_0x7496('0x30')][_0x7496('0x32')]};var _0x2c0a02={'rejectUnauthorized':![],'method':_0x7496('0x56'),'url':_0x7496('0x57'),'headers':{'X-APIKEY':_0x4dc5b0[_0x7496('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x25f8a9['user'][_0x7496('0x58')]],'buttons':null,'topic':_0x5680f9['vidaooTopic'],'note':_[_0x7496('0x59')](_0x5680f9['vidaooNote'])?null:getMustacheRender(_0x5680f9[_0x7496('0x50')],_0x8d4196),'metadata':null},'redirect':_0x7496('0x5a'),'json':!![]};try{if(!_['isNull'](_0x5680f9[_0x7496('0x51')])){var _0x1cf12c=getMustacheRender(_0x5680f9[_0x7496('0x51')],_0x8d4196);var _0x29cbd4=JSON['parse'](_0x1cf12c);_0x2c0a02[_0x7496('0x30')]['metadata']=_0x29cbd4;}}catch(_0x3e66f1){throw new db[(_0x7496('0x5b'))][(_0x7496('0x5c'))](_0x7496('0x5d'));}return rp(_0x2c0a02);}else{throw new db[(_0x7496('0x5b'))][(_0x7496('0x5c'))](_0x7496('0x5e'));}})[_0x7496('0x17')](function(_0x7fe48d){_0x21db91=_0x7fe48d;if(_0x21db91['id']){var _0x2b25bc={'body':_0x21db91[_0x7496('0x5f')],'ChatWebsiteId':_0x5680f9['id'],'ChatInteractionId':_0x580d14['id'],'direction':_0x7496('0x60'),'UserId':_0x25f8a9[_0x7496('0x52')]['id']};return db['ChatMessage']['create'](_0x2b25bc,{});}else{throw new db['Sequelize'][(_0x7496('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x7496('0x17')](function(){return _0x580d14['updateAttributes']({'vidaooSessionId':_0x21db91['id']});})['then'](respondWithResult(_0x448731,null))[_0x7496('0x21')](handleError(_0x448731,null));};exports[_0x7496('0x61')]=function(_0x54c37c,_0x357507){if(_0x54c37c[_0x7496('0x30')]['id']){delete _0x54c37c['body']['id'];}return db['ChatInteraction'][_0x7496('0x48')]({'where':{'id':_0x54c37c[_0x7496('0x3c')]['id']},'include':[{'model':db[_0x7496('0x62')],'as':'Contact'}]})[_0x7496('0x17')](handleEntityNotFound(_0x357507,null))[_0x7496('0x17')](saveUpdates(_0x54c37c['body'],null))['then'](respondWithResult(_0x357507,null))['catch'](handleError(_0x357507,null));};exports[_0x7496('0x63')]=function(_0x5d5948,_0x502601){if(_0x5d5948[_0x7496('0x30')]['id']){delete _0x5d5948['body']['id'];}return db[_0x7496('0x3f')]['find']({'where':{'id':_0x5d5948['params']['id']}})[_0x7496('0x17')](function(_0x44f0de){if(!_0x44f0de){logger[_0x7496('0x1c')](_0x7496('0x64'),_0x7496('0x63'),0x194,_0x7496('0x65'));_0x502601[_0x7496('0x2c')](0x194);}else{if(_0x44f0de[_0x7496('0x66')]){throw new db[(_0x7496('0x5b'))][(_0x7496('0x5c'))](_0x7496('0x67'));}}return _0x44f0de;})[_0x7496('0x17')](function(_0x44716c){if(_0x44716c){return _0x44716c[_0x7496('0x2a')]({'closed':_0x5d5948['body']['closed'],'disposition':_0x5d5948[_0x7496('0x30')][_0x7496('0x68')]})['then'](function(_0x2215fa){return _0x2215fa;});}})['then'](function(){return respondWithRpcPromise(_0x7496('0x69'),'abandon',_0x5d5948[_0x7496('0x30')],client9004);})[_0x7496('0x17')](respondWithResult(_0x502601,null))[_0x7496('0x21')](handleError(_0x502601,null));};exports[_0x7496('0x6a')]=function(_0x45bbf8,_0x4e3a4d){_0x45bbf8[_0x7496('0x30')][_0x7496('0x53')]=_0x45bbf8[_0x7496('0x6b')][_0x7496('0x6c')];_0x45bbf8[_0x7496('0x30')]['basename']=_0x45bbf8[_0x7496('0x6b')][_0x7496('0x6d')];_0x45bbf8[_0x7496('0x30')][_0x7496('0x37')]=_0x45bbf8[_0x7496('0x6b')][_0x7496('0x6e')];return db[_0x7496('0x6f')][_0x7496('0x47')](_0x45bbf8[_0x7496('0x30')])[_0x7496('0x17')](respondWithResult(_0x4e3a4d,0xc9))['catch'](handleError(_0x4e3a4d,null));};exports[_0x7496('0x70')]=function(_0x296162,_0xcc2c8d){return db[_0x7496('0x3f')][_0x7496('0x4b')]({'where':{'id':_0x296162[_0x7496('0x3c')]['id']},'raw':!![]})[_0x7496('0x17')](handleEntityNotFound(_0xcc2c8d,null))[_0x7496('0x17')](function(_0x42f23c){if(_0x42f23c){if(_0x42f23c[_0x7496('0x71')]){return _0xcc2c8d[_0x7496('0x22')](0x193)['json']({'status':0x193,'message':_0x7496('0x72')});}return db[_0x7496('0x6f')]['findOne']({'where':{'id':_0x296162[_0x7496('0x3a')][_0x7496('0x73')]},'raw':!![]})[_0x7496('0x17')](handleEntityNotFound(_0xcc2c8d,null));}})[_0x7496('0x17')](function(_0x573771){if(_0x573771){var _0x5ef3f8=_0x573771[_0x7496('0x74')]!==null;var _0x264be8=path[_0x7496('0x75')](config[_0x7496('0x76')],_0x7496('0x77'));if(_0x5ef3f8){_0x264be8=path[_0x7496('0x75')](_0x264be8,'offline-chat/');}var _0x37af96=path[_0x7496('0x75')](_0x264be8,_0x573771[_0x7496('0x78')]);return _0xcc2c8d[_0x7496('0x79')](_0x37af96);}})[_0x7496('0x21')](handleError(_0xcc2c8d,null));};exports[_0x7496('0x7a')]=function(_0x2decef,_0x4a8fb3){var _0x1ff7a4=null;var _0x334f36=null;var _0xc8fef1=null;if(_0x2decef[_0x7496('0x30')]['id']){delete _0x2decef[_0x7496('0x30')]['id'];}if(_0x2decef[_0x7496('0x30')]['mailTranscript']){_0xc8fef1=path[_0x7496('0x75')](config[_0x7496('0x76')],'server/files/chat/upload/',util['format'](_0x7496('0x7b'),Date[_0x7496('0x7c')]()));_0x2decef[_0x7496('0x30')][_0x7496('0x7d')]=_0xc8fef1;}return db[_0x7496('0x3f')][_0x7496('0x48')]({'where':{'id':_0x2decef['params']['id']},'include':[{'model':db[_0x7496('0x7e')],'as':'Messages','include':[{'model':db[_0x7496('0x7f')],'as':'User'}]}]})[_0x7496('0x17')](handleEntityNotFound(_0x4a8fb3,null))[_0x7496('0x17')](saveUpdates(_0x2decef[_0x7496('0x30')],null))[_0x7496('0x17')](function(_0x2a1e0c){if(_0x2a1e0c){_0x1ff7a4=_0x2a1e0c;return db[_0x7496('0x4c')][_0x7496('0x48')]({'where':{'id':_0x1ff7a4[_0x7496('0x4d')]}});}})[_0x7496('0x17')](function(_0x5eb879){if(_0x5eb879){_0x334f36=_0x5eb879;return db[_0x7496('0x62')][_0x7496('0x48')]({'where':{'id':_0x1ff7a4[_0x7496('0x80')]}});}})[_0x7496('0x17')](function(_0x4b1092){if(_0x4b1092){if(_0xc8fef1){var _0x135687=null;for(var _0x66fd8c=0x1;_0x66fd8c<_0x1ff7a4[_0x7496('0x81')][_0x7496('0x44')];++_0x66fd8c){_0x135687=_0x1ff7a4[_0x7496('0x81')][_0x66fd8c];var _0x379b5f=_0x135687[_0x7496('0x66')]?util[_0x7496('0x82')]('%s%d',_0x334f36[_0x7496('0x83')],_0x135687[_0x7496('0x66')]):_0x7496('0x84');var _0x4e726e=_0x2decef['body'][_0x7496('0x85')]||util[_0x7496('0x82')](_0x7496('0x86'),'Visitor',_0x135687[_0x7496('0x80')]);switch(_0x334f36[_0x7496('0x87')]){case _0x7496('0x88'):_0x379b5f=_0x135687[_0x7496('0x66')]?util['format'](_0x7496('0x86'),_0x334f36[_0x7496('0x83')],_0x135687[_0x7496('0x66')]):_0x7496('0x84');break;case'agent_alias':_0x379b5f=_0x135687[_0x7496('0x66')]?_0x135687[_0x7496('0x7f')][_0x7496('0x89')]||_0x135687[_0x7496('0x7f')][_0x7496('0x54')]:'System';break;case _0x7496('0x8a'):_0x379b5f=_0x135687['UserId']?_0x135687['User'][_0x7496('0x54')]:_0x7496('0x84');break;default:_0x379b5f=_0x135687[_0x7496('0x66')]?util[_0x7496('0x82')](_0x7496('0x86'),_0x334f36[_0x7496('0x83')],_0x135687[_0x7496('0x66')]):_0x7496('0x84');}var _0x247910=util[_0x7496('0x82')](_0x7496('0x8b'),moment(_0x135687[_0x7496('0x8c')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x135687[_0x7496('0x8d')]==='in'?_0x4e726e:_0x379b5f,_0x135687[_0x7496('0x30')]);if(!_0x135687[_0x7496('0x8e')]){fs[_0x7496('0x8f')](_0xc8fef1,_0x247910);}}return db[_0x7496('0x90')][_0x7496('0x4b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x7496('0x91'),'raw':!![],'include':[{'model':db[_0x7496('0x92')],'as':_0x7496('0x92'),'raw':!![]}]}]});}}})[_0x7496('0x17')](function(_0x218ce9){if(!_0x218ce9||!_0x218ce9['Smtp']||!_0x2decef['body'])return _0x1ff7a4;var _0xdb36fa=_0x218ce9[_0x7496('0x93')]();return respondWithRpcPromise(_0x7496('0x94'),'sendMail',{'account':_0xdb36fa,'message':{'from':util[_0x7496('0x82')](_0x7496('0x95'),_0x218ce9[_0x7496('0x53')],_0x218ce9[_0x7496('0x58')]||_0x218ce9[_0x7496('0x91')][_0x7496('0x52')]),'to':_0x2decef[_0x7496('0x30')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0x7496('0x96'),_0x2decef[_0x7496('0x30')][_0x7496('0x97')]),'attachments':[{'path':_0xc8fef1}]}})[_0x7496('0x17')](function(){return _0x1ff7a4;})['catch'](function(_0x558a1b){logger[_0x7496('0x1c')](_0x558a1b);});})['then'](respondWithStatusCode(_0x4a8fb3,0xc8))[_0x7496('0x21')](handleError(_0x4a8fb3,null));};exports[_0x7496('0x98')]=function(_0x2a549f,_0x51d40d){return db['ChatMessage'][_0x7496('0x48')]({'where':{'id':_0x2a549f[_0x7496('0x3c')]['id']}})[_0x7496('0x17')](handleEntityNotFound(_0x51d40d,null))[_0x7496('0x17')](function(_0x41057e){if(_0x41057e){return _0x41057e[_0x7496('0x98')](_0x2a549f[_0x7496('0x30')][_0x7496('0x99')],_['omit'](_0x2a549f[_0x7496('0x30')],[_0x7496('0x99'),'id'])||{});}})[_0x7496('0x17')](respondWithResult(_0x51d40d,null))[_0x7496('0x21')](handleError(_0x51d40d,null));};exports[_0x7496('0x9a')]=function(_0x3e0edc,_0x1d6930){var _0x1e9122={'raw':![],'where':{}};var _0x3fe7c4={};var _0x4d322d={'count':0x0,'rows':[]};return db[_0x7496('0x3f')][_0x7496('0x4b')]({'where':{'id':_0x3e0edc[_0x7496('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1d6930,null))['then'](function(_0x4d6fd9){if(_0x4d6fd9){_0x3fe7c4[_0x7496('0x3d')]=_['keys'](db[_0x7496('0x7e')][_0x7496('0x35')]);_0x3fe7c4[_0x7496('0x3a')]=_[_0x7496('0x3e')](_0x3e0edc[_0x7496('0x3a')]);_0x3fe7c4['filters']=_['intersection'](_0x3fe7c4[_0x7496('0x3d')],_0x3fe7c4[_0x7496('0x3a')]);_0x1e9122[_0x7496('0x43')]=_[_0x7496('0x41')](_0x3fe7c4[_0x7496('0x3d')],qs[_0x7496('0x42')](_0x3e0edc[_0x7496('0x3a')]['fields']));_0x1e9122[_0x7496('0x43')]=_0x1e9122[_0x7496('0x43')][_0x7496('0x44')]?_0x1e9122[_0x7496('0x43')]:_0x3fe7c4[_0x7496('0x3d')];if(!_0x3e0edc['query'][_0x7496('0x9b')](_0x7496('0x9c'))){_0x1e9122[_0x7496('0x26')]=qs[_0x7496('0x26')](_0x3e0edc['query']['limit']);_0x1e9122[_0x7496('0x25')]=qs['offset'](_0x3e0edc[_0x7496('0x3a')][_0x7496('0x25')]);}_0x1e9122[_0x7496('0x9d')]=qs[_0x7496('0x9e')](_0x3e0edc['query'][_0x7496('0x9e')]);_0x1e9122[_0x7496('0x9f')]=qs['filters'](_['pick'](_0x3e0edc[_0x7496('0x3a')],_0x3fe7c4[_0x7496('0x40')]));_0x1e9122[_0x7496('0x9f')][_0x7496('0xa0')]=_0x4d6fd9['id'];if(_0x3e0edc['query'][_0x7496('0xa1')]){_0x1e9122[_0x7496('0x9f')]=_[_0x7496('0x2f')](_0x1e9122[_0x7496('0x9f')],{'$or':_[_0x7496('0x34')](_0x1e9122[_0x7496('0x43')],function(_0x5d1306){var _0x4c083d={};_0x4c083d[_0x5d1306]={'$like':'%'+_0x3e0edc[_0x7496('0x3a')][_0x7496('0xa1')]+'%'};return _0x4c083d;})});}if(_0x3e0edc[_0x7496('0x3a')][_0x7496('0xa2')]){var _0x468b0b=_0x3e0edc[_0x7496('0x3a')][_0x7496('0xa2')][_0x7496('0xa3')](',');var _0x2340db={};_0x2340db[_0x468b0b[0x0]]={'$gte':moment(_0x468b0b[0x1])[_0x7496('0x82')](_0x7496('0xa4'))};_0x1e9122[_0x7496('0x9f')]=_[_0x7496('0x2f')](_0x1e9122[_0x7496('0x9f')],_0x2340db);}_0x1e9122=_['merge']({},_0x1e9122,_0x3e0edc[_0x7496('0x46')]);return db[_0x7496('0x7e')][_0x7496('0x27')]({'where':_0x1e9122[_0x7496('0x9f')]})[_0x7496('0x17')](function(_0x3c4af8){_0x4d322d[_0x7496('0x27')]=_0x3c4af8;if(_0x3e0edc[_0x7496('0x3a')][_0x7496('0x45')]){_0x1e9122['include']=[{'all':!![]}];}return db['ChatMessage'][_0x7496('0xa5')](_0x1e9122);})[_0x7496('0x17')](function(_0x5cf929){_0x4d322d[_0x7496('0xa6')]=_0x5cf929;return _0x4d322d;});}})[_0x7496('0x17')](respondWithFilteredResult(_0x1d6930,_0x1e9122))[_0x7496('0x21')](handleError(_0x1d6930,null));};exports[_0x7496('0xa7')]=function(_0x25697a,_0x3e076a){var _0x11cfc4={'where':{}},_0x55c103={},_0x156112={'count':0x0,'rows':[]};return db[_0x7496('0x3f')][_0x7496('0x4b')]({'where':{'id':_0x25697a[_0x7496('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3e076a,null))[_0x7496('0x17')](function(_0x56aa17){if(_0x56aa17){_0x55c103[_0x7496('0x3d')]=_[_0x7496('0x3e')](db['ChatMessage'][_0x7496('0x35')]);_0x55c103[_0x7496('0x3a')]=_[_0x7496('0x3e')](_0x25697a[_0x7496('0x3a')]);_0x55c103[_0x7496('0x40')]=_[_0x7496('0x41')](_0x55c103[_0x7496('0x3d')],_0x55c103[_0x7496('0x3a')]);_0x11cfc4['attributes']=_[_0x7496('0x41')](_0x55c103['model'],qs[_0x7496('0x42')](_0x25697a[_0x7496('0x3a')][_0x7496('0x42')]));_0x11cfc4[_0x7496('0x43')]=_0x11cfc4['attributes']['length']?_0x11cfc4[_0x7496('0x43')]:_0x55c103[_0x7496('0x3d')];if(!_0x25697a[_0x7496('0x3a')][_0x7496('0x9b')](_0x7496('0x9c'))){_0x11cfc4[_0x7496('0x26')]=qs[_0x7496('0x26')](_0x25697a[_0x7496('0x3a')][_0x7496('0x26')]);_0x11cfc4[_0x7496('0x25')]=qs[_0x7496('0x25')](_0x25697a[_0x7496('0x3a')][_0x7496('0x25')]);}_0x11cfc4['order']=qs[_0x7496('0x9e')](_0x25697a[_0x7496('0x3a')][_0x7496('0x9e')]);_0x11cfc4[_0x7496('0x9f')]=qs['filters'](_['pick'](_0x25697a[_0x7496('0x3a')],_0x55c103['filters']));_0x11cfc4['where'][_0x7496('0xa0')]=_0x56aa17['id'];if(_0x25697a[_0x7496('0x3a')]['filter']){_0x11cfc4['where']=_[_0x7496('0x2f')](_0x11cfc4[_0x7496('0x9f')],{'$or':_[_0x7496('0x34')](_0x11cfc4['attributes'],function(_0x4aad83){var _0x294527={};_0x294527[_0x4aad83]={'$like':'%'+_0x25697a['query'][_0x7496('0xa1')]+'%'};return _0x294527;})});}_0x11cfc4[_0x7496('0x9f')][_0x7496('0x8e')]=![];if(_0x25697a['query']['id']){_0x11cfc4[_0x7496('0x9f')]['id']={'$gt':_0x25697a[_0x7496('0x3a')]['id']};}_0x11cfc4=_[_0x7496('0x2f')]({},_0x11cfc4,_0x25697a[_0x7496('0x46')]);return db[_0x7496('0x7e')]['count']({'where':_0x11cfc4[_0x7496('0x9f')]})[_0x7496('0x17')](function(_0x3bfc02){_0x156112[_0x7496('0x27')]=_0x3bfc02;_0x11cfc4[_0x7496('0xa8')]=[];if(_0x25697a[_0x7496('0x3a')]['includeAgent']){_0x11cfc4['include']['push']({'model':db[_0x7496('0x7f')],'as':_0x7496('0x7f'),'attributes':['id',_0x7496('0x54'),_0x7496('0x89')]});}if(_0x25697a[_0x7496('0x3a')][_0x7496('0x45')]){_0x11cfc4['include']=[{'all':!![]}];}return db[_0x7496('0x7e')]['findAll'](_0x11cfc4);})['then'](function(_0x5be560){_0x156112[_0x7496('0xa6')]=_0x5be560;return _0x156112;});}})[_0x7496('0x17')](respondWithFilteredResult(_0x3e076a,_0x11cfc4))[_0x7496('0x21')](handleError(_0x3e076a,null));};exports[_0x7496('0xa9')]=function(_0xcd6eaf,_0x412116){return db[_0x7496('0x3f')][_0x7496('0x48')]({'where':{'id':_0xcd6eaf[_0x7496('0x3c')]['id']}})[_0x7496('0x17')](handleEntityNotFound(_0x412116,null))['then'](function(_0x4de951){if(_0x4de951){return _0x4de951[_0x7496('0xaa')](_0xcd6eaf['body'][_0x7496('0x99')],_['omit'](_0xcd6eaf[_0x7496('0x30')],['ids','id'])||{})[_0x7496('0xab')](function(){return db[_0x7496('0xac')]['findAll']({'attributes':['id',_0x7496('0x53'),'color'],'where':{'id':_0xcd6eaf[_0x7496('0x30')][_0x7496('0x99')]}});})[_0x7496('0x17')](function(_0x1445ee){socket[_0x7496('0xad')](_0x7496('0xae'),{'id':Number(_0xcd6eaf[_0x7496('0x3c')]['id']),'tags':_0x1445ee||[]});return{'id':Number(_0xcd6eaf[_0x7496('0x3c')]['id']),'tags':_0x1445ee||[]};});}})[_0x7496('0x17')](respondWithResult(_0x412116,null))[_0x7496('0x21')](handleError(_0x412116,null));};exports[_0x7496('0xaf')]=function(_0x1d9307,_0x3e7e5b){return db['ChatInteraction'][_0x7496('0x48')]({'where':{'id':_0x1d9307[_0x7496('0x3c')]['id']}})[_0x7496('0x17')](handleEntityNotFound(_0x3e7e5b,null))[_0x7496('0x17')](function(_0x2f0d02){if(_0x2f0d02){return _0x2f0d02['removeTags'](_0x1d9307[_0x7496('0x3a')][_0x7496('0x99')]);}})[_0x7496('0x17')](respondWithStatusCode(_0x3e7e5b,null))[_0x7496('0x21')](handleError(_0x3e7e5b,null));};exports[_0x7496('0x79')]=function(_0x59adbf,_0x39dc05){var _0x5ad57a=moment()[_0x7496('0xb0')]()['toString']();var _0x3c883f=path[_0x7496('0x75')](config['root'],'server','files',_0x7496('0xb1'));var _0x341903=path[_0x7496('0x75')](config['root'],'server',_0x7496('0xb2'),'attachments');var _0x33bf1e=path[_0x7496('0x75')](_0x3c883f,_0x5ad57a);var _0x3df2d8=util['format'](_0x7496('0xb3'),_0x59adbf[_0x7496('0x3c')]['id'],_0x5ad57a);var _0x150a91=path['join'](_0x3c883f,_0x3df2d8);var _0x5dcfb6=[];_0x5dcfb6[_0x7496('0xb4')]({'model':db[_0x7496('0x7f')],'as':_0x7496('0x7f'),'attributes':['id',_0x7496('0x54')],'raw':!![]});_0x5dcfb6[_0x7496('0xb4')]({'model':db[_0x7496('0x62')],'as':'Contact','attributes':['id','firstName',_0x7496('0xb5')],'raw':!![]});if(_0x59adbf[_0x7496('0x3a')][_0x7496('0xb6')]){_0x5dcfb6[_0x7496('0xb4')]({'model':db[_0x7496('0x6f')],'as':_0x7496('0x6f'),'raw':!![]});}var _0x2c5a17=[{'model':db['ChatMessage'],'as':_0x7496('0x81'),'attributes':['id',_0x7496('0x30'),_0x7496('0x8c'),_0x7496('0x8d'),_0x7496('0x8e'),_0x7496('0xb7')],'include':_0x5dcfb6}];_0x2c5a17[_0x7496('0xb4')]({'model':db[_0x7496('0x4c')],'as':_0x7496('0xb8'),'attributes':['id',_0x7496('0x53')]});_0x2c5a17[_0x7496('0xb4')]({'model':db[_0x7496('0x7f')],'as':_0x7496('0xb9'),'attributes':['id',_0x7496('0x54')]});return db[_0x7496('0x3f')][_0x7496('0x48')]({'where':{'id':_0x59adbf['params']['id']},'include':_0x2c5a17})[_0x7496('0x17')](handleEntityNotFound(_0x39dc05,null))[_0x7496('0x17')](function(_0x4d4484){if(_0x4d4484){var _0x40a825=_0x4d4484[_0x7496('0xba')]({'plain':!![]});fs[_0x7496('0xbb')](_0x33bf1e);var _0x4e750f={'channel':'Chat','account':_0x40a825[_0x7496('0xb8')][_0x7496('0x53')],'agent':_0x40a825[_0x7496('0xb9')]?_0x40a825[_0x7496('0xb9')]['fullname']:_0x7496('0xbc'),'createdAt':moment(_0x40a825[_0x7496('0x8c')])[_0x7496('0x82')](_0x7496('0xa4'))[_0x7496('0xbd')](),'closedAt':_0x40a825[_0x7496('0x71')]?moment(_0x40a825[_0x7496('0xbe')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7496('0xbd')]():'','disposition':_0x40a825[_0x7496('0x68')],'chatInfo':{'browser':_0x40a825[_0x7496('0xbf')],'os':_0x40a825[_0x7496('0xc0')],'referer':_0x40a825[_0x7496('0xc1')],'customerIp':_0x40a825[_0x7496('0xc2')],'customerPort':_0x40a825['customerPort']?_0x40a825['customerPort']:_0x7496('0xbc')},'messages':_(_0x40a825['Messages'])['tail']()[_0x7496('0xa1')]({'secret':![]})[_0x7496('0x34')](function(_0x2b9810){if(_0x2b9810[_0x7496('0x6f')]){var _0x166f0d=path[_0x7496('0x75')](_0x341903,_0x2b9810[_0x7496('0x6f')]['basename']);if(fs['existsSync'](_0x166f0d)){fs[_0x7496('0xc3')](_0x166f0d)[_0x7496('0xc4')](fs['createWriteStream'](path['join'](_0x33bf1e,_0x2b9810[_0x7496('0x6f')][_0x7496('0x78')])));}}return{'date':moment(_0x2b9810[_0x7496('0x8c')])[_0x7496('0x82')](_0x7496('0xa4'))[_0x7496('0xbd')](),'sender':_0x2b9810[_0x7496('0x8d')]==='out'?_0x2b9810[_0x7496('0x7f')]?_0x2b9810[_0x7496('0x7f')]['fullname']:_0x7496('0x84'):_0x2b9810[_0x7496('0xc5')][_0x7496('0xc6')]+(_0x2b9810[_0x7496('0xc5')]['lastName']?'\x20'+_0x2b9810['Contact']['lastName']:''),'body':_0x2b9810['Attachment']?_0x2b9810[_0x7496('0x6f')][_0x7496('0x78')]:_0x2b9810[_0x7496('0x30')],'direction':_0x2b9810[_0x7496('0x8d')]===_0x7496('0x60')?'A':'C','secret':_0x2b9810[_0x7496('0x8e')],'read':_0x2b9810['read'],'attachment':_0x2b9810[_0x7496('0x6f')]};})['value']()};return ejs[_0x7496('0xc7')](path[_0x7496('0x75')](config[_0x7496('0x76')],_0x7496('0xc8'),_0x7496('0xc9'),_0x7496('0xca')),{'interaction':_0x4e750f})[_0x7496('0x17')](function(_0x3c9a07){var _0x6abade=path[_0x7496('0x75')](_0x33bf1e,_0x7496('0xcb')+_0x40a825['id']+'-'+_0x5ad57a+_0x7496('0xcc'));var _0x37b02e={'path':_0x6abade,'channel':_0x7496('0xcd'),'interactionId':_0x40a825['id']};return pdf[_0x7496('0xce')](_0x3c9a07,_0x37b02e);})[_0x7496('0x17')](function(){return new Promise(function(_0x5284f7,_0x20acf1){zipdir(_0x33bf1e,{'saveTo':_0x150a91},function(_0x3bd693,_0x64e210){if(_0x3bd693)return _0x20acf1(_0x3bd693);return _0x5284f7(_0x64e210);});})[_0x7496('0x17')](function(){return new BPromise(function(_0x821cd8,_0x599e36){rimraf(_0x33bf1e,function(_0x277a8b){if(_0x277a8b)_0x599e36(_0x277a8b);return _0x821cd8();});});})[_0x7496('0x17')](function(){return _0x39dc05[_0x7496('0x79')](_0x150a91,_0x3df2d8,function(_0x433c8f){if(_0x433c8f){logger[_0x7496('0x1c')]('err',_0x433c8f);}else{fs[_0x7496('0xcf')](_0x150a91);}});});});}else{return _0x39dc05[_0x7496('0x2c')](0xc8);}})[_0x7496('0x21')](handleError(_0x39dc05,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9901178..ec143c9 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 _0xb5ae=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hook'];(function(_0x490f26,_0x528e53){var _0x3adeef=function(_0xd8679c){while(--_0xd8679c){_0x490f26['push'](_0x490f26['shift']());}};_0x3adeef(++_0x528e53);}(_0xb5ae,0x1ee));var _0xeb5a=function(_0x2620c3,_0x4f113d){_0x2620c3=_0x2620c3-0x0;var _0x2d0a8b=_0xb5ae[_0x2620c3];return _0x2d0a8b;};'use strict';var EventEmitter=require(_0xeb5a('0x0'));var ChatInteraction=require(_0xeb5a('0x1'))['db'][_0xeb5a('0x2')];var ChatMessage=require(_0xeb5a('0x1'))['db'][_0xeb5a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb5a('0x4'),'afterUpdate':'update','afterDestroy':_0xeb5a('0x5')};function emitEvent(_0x1f97f0){return function(_0x1c9e0c,_0x1683e0,_0x4b17e7){_0x1c9e0c[_0xeb5a('0x6')]({'attributes':['id'],'raw':!![]})[_0xeb5a('0x7')](function(_0x43233d){_0x1c9e0c[_0xeb5a('0x8')]('Users',_0x43233d[_0xeb5a('0x9')](function(_0x2c2598){return{'id':_0x2c2598['id']};}));return ChatMessage[_0xeb5a('0xa')]({'where':{'ChatInteractionId':_0x1c9e0c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4688ce){_0x1c9e0c[_0xeb5a('0x8')](_0xeb5a('0xb'),_0x4688ce[_0xeb5a('0xc')]);ChatInteractionEvents['emit'](_0x1f97f0+':'+_0x1c9e0c['id'],_0x1c9e0c);ChatInteractionEvents[_0xeb5a('0xd')](_0x1f97f0,_0x1c9e0c);_0x4b17e7(null);})[_0xeb5a('0xe')](_0x4b17e7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xeb5a('0xf')](e,emitEvent(event));}}module[_0xeb5a('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xd0d0=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0xd0d0,0x1a7));var _0x0d0d=function(_0x43080b,_0x1edf95){_0x43080b=_0x43080b-0x0;var _0x48c21f=_0xd0d0[_0x43080b];return _0x48c21f;};'use strict';var EventEmitter=require(_0x0d0d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x0d0d('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0d0d('0x2')](0x0);var events={'afterCreate':_0x0d0d('0x3'),'afterUpdate':_0x0d0d('0x4'),'afterDestroy':_0x0d0d('0x5')};function emitEvent(_0x156921){return function(_0x4a0583,_0x1ab57d,_0x165d8d){_0x4a0583[_0x0d0d('0x6')]({'attributes':['id'],'raw':!![]})[_0x0d0d('0x7')](function(_0xa18cbb){_0x4a0583['setDataValue'](_0x0d0d('0x8'),_0xa18cbb[_0x0d0d('0x9')](function(_0x3c395e){return{'id':_0x3c395e['id']};}));return ChatMessage[_0x0d0d('0xa')]({'where':{'ChatInteractionId':_0x4a0583['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0d0d('0x7')](function(_0x1c568f){_0x4a0583['setDataValue'](_0x0d0d('0xb'),_0x1c568f[_0x0d0d('0xc')]);ChatInteractionEvents[_0x0d0d('0xd')](_0x156921+':'+_0x4a0583['id'],_0x4a0583);ChatInteractionEvents['emit'](_0x156921,_0x4a0583);_0x165d8d(null);})[_0x0d0d('0xe')](_0x165d8d(null));};}for(var e in events){if(events[_0x0d0d('0xf')](e)){var event=events[e];ChatInteraction[_0x0d0d('0x10')](e,emitEvent(event));}}module[_0x0d0d('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 26fdb2a..fc03a20 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 _0x751e=['chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x751e,0xf5));var _0xe751=function(_0x5178ca,_0x85065a){_0x5178ca=_0x5178ca-0x0;var _0x3636c3=_0x751e[_0x5178ca];return _0x3636c3;};'use strict';var _=require('lodash');var util=require(_0xe751('0x0'));var logger=require(_0xe751('0x1'))(_0xe751('0x2'));var moment=require(_0xe751('0x3'));var BPromise=require(_0xe751('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe751('0x5'));var config=require(_0xe751('0x6'));var attributes=require(_0xe751('0x7'));module[_0xe751('0x8')]=function(_0xf1e99e,_0xebbdc6){return _0xf1e99e[_0xe751('0x9')](_0xe751('0xa'),attributes,{'tableName':_0xe751('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13bab7,_0x3e84ca,_0x41a74b){if(_0x13bab7[_0xe751('0xc')]('closed')){_0x13bab7['closedAt']=moment()[_0xe751('0xd')](_0xe751('0xe'));}_0x41a74b(null,_0x13bab7);}},'charset':'utf8mb4','collate':_0xe751('0xf')});}; \ No newline at end of file +var _0xfa68=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','define','changed','closed'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xfa68,0xba));var _0x8fa6=function(_0x13e32a,_0x281314){_0x13e32a=_0x13e32a-0x0;var _0x3597e9=_0xfa68[_0x13e32a];return _0x3597e9;};'use strict';var _=require(_0x8fa6('0x0'));var util=require(_0x8fa6('0x1'));var logger=require(_0x8fa6('0x2'))('api');var moment=require(_0x8fa6('0x3'));var BPromise=require(_0x8fa6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fa6('0x5'));var rimraf=require('rimraf');var config=require(_0x8fa6('0x6'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x41a76b,_0x562dc0){return _0x41a76b[_0x8fa6('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f1d0e,_0xfe913,_0x1023bd){if(_0x4f1d0e[_0x8fa6('0x8')](_0x8fa6('0x9'))){_0x4f1d0e[_0x8fa6('0xa')]=moment()['format'](_0x8fa6('0xb'));}_0x1023bd(null,_0x4f1d0e);}},'charset':_0x8fa6('0xc'),'collate':_0x8fa6('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7a1517f..bf63f1b 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 _0xb08f=['client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','attributes','limit','stringify','AddTagsToChatInteraction','where','then','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x489a7b,_0x2a4b87){var _0x245dfe=function(_0x41d1be){while(--_0x41d1be){_0x489a7b['push'](_0x489a7b['shift']());}};_0x245dfe(++_0x2a4b87);}(_0xb08f,0x1ef));var _0xfb08=function(_0x1e140b,_0x3c7d81){_0x1e140b=_0x1e140b-0x0;var _0x4502e6=_0xb08f[_0x1e140b];return _0x4502e6;};'use strict';var _=require(_0xfb08('0x0'));var util=require(_0xfb08('0x1'));var moment=require(_0xfb08('0x2'));var BPromise=require(_0xfb08('0x3'));var rs=require(_0xfb08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb08('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb08('0x6'));var config=require(_0xfb08('0x7'));var jayson=require(_0xfb08('0x8'));var client=jayson[_0xfb08('0x9')][_0xfb08('0xa')]({'port':0x232a});config[_0xfb08('0xb')]=_[_0xfb08('0xc')](config[_0xfb08('0xb')],{'host':_0xfb08('0xd'),'port':0x18eb});var socket=require(_0xfb08('0xe'))(new Redis(config['redis']));require(_0xfb08('0xf'))[_0xfb08('0x10')](socket);function respondWithRpcPromise(_0x306a02,_0x112fbf,_0x18ec27){return new BPromise(function(_0x3636bf,_0x49400a){return client[_0xfb08('0x11')](_0x306a02,_0x18ec27)['then'](function(_0x350731){logger[_0xfb08('0x12')](_0xfb08('0x13'),_0x112fbf,_0xfb08('0x14'));logger[_0xfb08('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x112fbf,_0xfb08('0x14'),JSON['stringify'](_0x350731));if(_0x350731[_0xfb08('0x16')]){if(_0x350731[_0xfb08('0x16')]['code']===0x1f4){logger[_0xfb08('0x16')](_0xfb08('0x13'),_0x112fbf,_0x350731[_0xfb08('0x16')][_0xfb08('0x17')]);return _0x49400a(_0x350731[_0xfb08('0x16')][_0xfb08('0x17')]);}logger[_0xfb08('0x16')](_0xfb08('0x13'),_0x112fbf,_0x350731[_0xfb08('0x16')][_0xfb08('0x17')]);return _0x3636bf(_0x350731[_0xfb08('0x16')][_0xfb08('0x17')]);}else{logger['info'](_0xfb08('0x13'),_0x112fbf,'request\x20sent');_0x3636bf(_0x350731[_0xfb08('0x18')]['message']);}})[_0xfb08('0x19')](function(_0x1ec279){logger[_0xfb08('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x112fbf,_0x1ec279);_0x49400a(_0x1ec279);});});}exports[_0xfb08('0x1a')]=function(_0xb78a6c){var _0x39aa20=this;return new Promise(function(_0x1b36c2,_0x16fd3e){return db[_0xfb08('0x1b')][_0xfb08('0x1c')](_0xb78a6c['body'],{'raw':_0xb78a6c[_0xfb08('0x1d')]?_0xb78a6c[_0xfb08('0x1d')][_0xfb08('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb78a6c['options']?_0xb78a6c[_0xfb08('0x1d')]['where']||null:null,'attributes':_0xb78a6c[_0xfb08('0x1d')]?_0xb78a6c['options'][_0xfb08('0x1f')]||null:null,'limit':_0xb78a6c['options']?_0xb78a6c[_0xfb08('0x1d')][_0xfb08('0x20')]||null:null})['then'](function(_0x8f4972){logger[_0xfb08('0x12')](_0xfb08('0x1a'),_0xb78a6c);logger[_0xfb08('0x15')](_0xfb08('0x1a'),_0xb78a6c,JSON[_0xfb08('0x21')](_0x8f4972));_0x1b36c2(_0x8f4972);})['catch'](function(_0x1f6f2){logger[_0xfb08('0x16')](_0xfb08('0x1a'),_0x1f6f2[_0xfb08('0x17')],_0xb78a6c);_0x16fd3e(_0x39aa20['error'](0x1f4,_0x1f6f2[_0xfb08('0x17')]));});});};exports[_0xfb08('0x22')]=function(_0x1a4f8b){return new Promise(function(_0x45bcbb,_0x4507b5){return db[_0xfb08('0x1b')]['find']({'where':_0x1a4f8b[_0xfb08('0x1d')]?_0x1a4f8b[_0xfb08('0x1d')][_0xfb08('0x23')]||null:null})[_0xfb08('0x24')](function(_0x5ede74){if(_0x5ede74){return _0x5ede74['addTags'](_0x1a4f8b[_0xfb08('0x25')][_0xfb08('0x26')],_[_0xfb08('0x27')](_0x1a4f8b[_0xfb08('0x25')],[_0xfb08('0x26'),'id'])||{});}})[_0xfb08('0x28')](function(_0x2702f3){logger[_0xfb08('0x12')]('AddTags',_0x1a4f8b);logger[_0xfb08('0x15')](_0xfb08('0x29'),_0x1a4f8b,JSON['stringify'](_0x2702f3));_0x45bcbb(_0x2702f3);})[_0xfb08('0x19')](function(_0x18f9c1){logger['error'](_0xfb08('0x29'),_0x18f9c1[_0xfb08('0x17')],_0x1a4f8b);_0x4507b5(_this[_0xfb08('0x16')](0x1f4,_0x18f9c1[_0xfb08('0x17')]));});});}; \ No newline at end of file +var _0xf75e=['client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4eb74e,_0x5df5ab){var _0x1928d4=function(_0x3958c9){while(--_0x3958c9){_0x4eb74e['push'](_0x4eb74e['shift']());}};_0x1928d4(++_0x5df5ab);}(_0xf75e,0x1d8));var _0xef75=function(_0x569381,_0x1933cd){_0x569381=_0x569381-0x0;var _0x47e9f5=_0xf75e[_0x569381];return _0x47e9f5;};'use strict';var _=require(_0xef75('0x0'));var util=require('util');var moment=require(_0xef75('0x1'));var BPromise=require(_0xef75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef75('0x3'));var db=require(_0xef75('0x4'))['db'];var utils=require(_0xef75('0x5'));var logger=require('../../config/logger')(_0xef75('0x6'));var config=require(_0xef75('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xef75('0x8')][_0xef75('0x9')]({'port':0x232a});config[_0xef75('0xa')]=_[_0xef75('0xb')](config[_0xef75('0xa')],{'host':_0xef75('0xc'),'port':0x18eb});var socket=require(_0xef75('0xd'))(new Redis(config[_0xef75('0xa')]));require('./chatInteraction.socket')[_0xef75('0xe')](socket);function respondWithRpcPromise(_0x339b87,_0xbb846b,_0x5c2e8d){return new BPromise(function(_0x2ba8dc,_0x3d854f){return client['request'](_0x339b87,_0x5c2e8d)[_0xef75('0xf')](function(_0x2af555){logger[_0xef75('0x10')](_0xef75('0x11'),_0xbb846b,_0xef75('0x12'));logger['debug'](_0xef75('0x13'),_0xbb846b,_0xef75('0x12'),JSON[_0xef75('0x14')](_0x2af555));if(_0x2af555['error']){if(_0x2af555[_0xef75('0x15')][_0xef75('0x16')]===0x1f4){logger['error'](_0xef75('0x11'),_0xbb846b,_0x2af555[_0xef75('0x15')][_0xef75('0x17')]);return _0x3d854f(_0x2af555['error']['message']);}logger[_0xef75('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xbb846b,_0x2af555[_0xef75('0x15')][_0xef75('0x17')]);return _0x2ba8dc(_0x2af555[_0xef75('0x15')]['message']);}else{logger[_0xef75('0x10')](_0xef75('0x11'),_0xbb846b,'request\x20sent');_0x2ba8dc(_0x2af555[_0xef75('0x18')][_0xef75('0x17')]);}})[_0xef75('0x19')](function(_0x3c1ba0){logger[_0xef75('0x15')](_0xef75('0x11'),_0xbb846b,_0x3c1ba0);_0x3d854f(_0x3c1ba0);});});}exports[_0xef75('0x1a')]=function(_0x589ff9){var _0x55bc30=this;return new Promise(function(_0x51ee4b,_0x478bc4){return db[_0xef75('0x1b')][_0xef75('0x1c')](_0x589ff9[_0xef75('0x1d')],{'raw':_0x589ff9[_0xef75('0x1e')]?_0x589ff9[_0xef75('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x589ff9['options']?_0x589ff9['options'][_0xef75('0x1f')]||null:null,'attributes':_0x589ff9[_0xef75('0x1e')]?_0x589ff9[_0xef75('0x1e')]['attributes']||null:null,'limit':_0x589ff9[_0xef75('0x1e')]?_0x589ff9[_0xef75('0x1e')][_0xef75('0x20')]||null:null})[_0xef75('0xf')](function(_0x4c1f48){logger[_0xef75('0x10')](_0xef75('0x1a'),_0x589ff9);logger['debug']('UpdateChatInteraction',_0x589ff9,JSON[_0xef75('0x14')](_0x4c1f48));_0x51ee4b(_0x4c1f48);})[_0xef75('0x19')](function(_0x543b2c){logger['error'](_0xef75('0x1a'),_0x543b2c[_0xef75('0x17')],_0x589ff9);_0x478bc4(_0x55bc30[_0xef75('0x15')](0x1f4,_0x543b2c[_0xef75('0x17')]));});});};exports[_0xef75('0x21')]=function(_0x197b3d){return new Promise(function(_0x2f6b97,_0x35d1e2){return db[_0xef75('0x1b')][_0xef75('0x22')]({'where':_0x197b3d[_0xef75('0x1e')]?_0x197b3d[_0xef75('0x1e')][_0xef75('0x1f')]||null:null})['then'](function(_0x59e01b){if(_0x59e01b){return _0x59e01b[_0xef75('0x23')](_0x197b3d[_0xef75('0x1d')][_0xef75('0x24')],_[_0xef75('0x25')](_0x197b3d['body'],[_0xef75('0x24'),'id'])||{});}})[_0xef75('0x26')](function(_0x21047a){logger[_0xef75('0x10')](_0xef75('0x27'),_0x197b3d);logger['debug'](_0xef75('0x27'),_0x197b3d,JSON[_0xef75('0x14')](_0x21047a));_0x2f6b97(_0x21047a);})['catch'](function(_0x196200){logger[_0xef75('0x15')]('AddTags',_0x196200['message'],_0x197b3d);_0x35d1e2(_this[_0xef75('0x15')](0x1f4,_0x196200['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 74bfffe..7d5ef3e 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 _0x202c=['emit','removeListener','length','chatInteraction:','./chatInteraction.events','update'];(function(_0x4abf13,_0x28742a){var _0x27b0e5=function(_0x3a0aa5){while(--_0x3a0aa5){_0x4abf13['push'](_0x4abf13['shift']());}};_0x27b0e5(++_0x28742a);}(_0x202c,0x178));var _0xc202=function(_0x280828,_0x1bf47f){_0x280828=_0x280828-0x0;var _0x352eff=_0x202c[_0x280828];return _0x352eff;};'use strict';var ChatInteractionEvents=require(_0xc202('0x0'));var events=['save','remove',_0xc202('0x1')];function createListener(_0x1ab6a1,_0x27b3b2){return function(_0x5c5dec){_0x27b3b2[_0xc202('0x2')](_0x1ab6a1,_0x5c5dec);};}function removeListener(_0x155c3b,_0x1763f5){return function(){ChatInteractionEvents[_0xc202('0x3')](_0x155c3b,_0x1763f5);};}exports['register']=function(_0x28e51c){for(var _0x68d363=0x0,_0x59563a=events[_0xc202('0x4')];_0x68d363<_0x59563a;_0x68d363++){var _0x574549=events[_0x68d363];var _0x872c1a=createListener(_0xc202('0x5')+_0x574549,_0x28e51c);ChatInteractionEvents['on'](_0x574549,_0x872c1a);}}; \ No newline at end of file +var _0x11fe=['length','./chatInteraction.events','save','remove','removeListener'];(function(_0x4a8bf2,_0x17e3de){var _0x5dca6f=function(_0x236168){while(--_0x236168){_0x4a8bf2['push'](_0x4a8bf2['shift']());}};_0x5dca6f(++_0x17e3de);}(_0x11fe,0x1b9));var _0xe11f=function(_0x3e38ca,_0x502084){_0x3e38ca=_0x3e38ca-0x0;var _0x5a6b7f=_0x11fe[_0x3e38ca];return _0x5a6b7f;};'use strict';var ChatInteractionEvents=require(_0xe11f('0x0'));var events=[_0xe11f('0x1'),_0xe11f('0x2'),'update'];function createListener(_0x180b27,_0x3555fa){return function(_0x20a293){_0x3555fa['emit'](_0x180b27,_0x20a293);};}function removeListener(_0x1197e1,_0x4b9502){return function(){ChatInteractionEvents[_0xe11f('0x3')](_0x1197e1,_0x4b9502);};}exports['register']=function(_0x3ea754){for(var _0x12b424=0x0,_0x437d8b=events[_0xe11f('0x4')];_0x12b424<_0x437d8b;_0x12b424++){var _0x1c0e27=events[_0x12b424];var _0x3093f7=createListener('chatInteraction:'+_0x1c0e27,_0x3ea754);ChatInteractionEvents['on'](_0x1c0e27,_0x3093f7);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 9b5f69f..3d0b455 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 _0xef17=['/:id/tags','chat','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','delete','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','create','post','/:id/vidaoo','join','root','format','%s-%s','now','originalname','single','attachmentUpload','addMessage'];(function(_0x46aa4a,_0x43363d){var _0x5d9535=function(_0x5313c1){while(--_0x5313c1){_0x46aa4a['push'](_0x46aa4a['shift']());}};_0x5d9535(++_0x43363d);}(_0xef17,0xd4));var _0x7ef1=function(_0x593796,_0x242080){_0x593796=_0x593796-0x0;var _0x2f20fc=_0xef17[_0x593796];return _0x2f20fc;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7ef1('0x3')]();var fs_extra=require(_0x7ef1('0x4'));var auth=require(_0x7ef1('0x5'));var interaction=require(_0x7ef1('0x6'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x7'));router[_0x7ef1('0x8')]('/',auth[_0x7ef1('0x9')](),controller[_0x7ef1('0xa')]);router[_0x7ef1('0x8')](_0x7ef1('0xb'),auth[_0x7ef1('0x9')](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0x8')](_0x7ef1('0xd'),auth[_0x7ef1('0xe')](),controller['show']);router['get'](_0x7ef1('0xf'),auth[_0x7ef1('0xe')](),controller[_0x7ef1('0x10')]);router[_0x7ef1('0x8')](_0x7ef1('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7ef1('0x8')](_0x7ef1('0x12'),auth[_0x7ef1('0xe')](),controller[_0x7ef1('0x13')]);router[_0x7ef1('0x8')]('/:id/download',auth[_0x7ef1('0x9')](),controller[_0x7ef1('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x16')](_0x7ef1('0x17'),auth[_0x7ef1('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b0467,_0x9d8ae8,_0x113d64){_0x113d64(null,path[_0x7ef1('0x18')](config[_0x7ef1('0x19')],'server/files/attachments/'));},'filename':function(_0x512c64,_0x4e5319,_0x27863e){_0x27863e(null,util[_0x7ef1('0x1a')](_0x7ef1('0x1b'),Date[_0x7ef1('0x1c')](),_0x4e5319[_0x7ef1('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7ef1('0x16')]('/:id/attachment_upload',upload[_0x7ef1('0x1e')]('file'),controller[_0x7ef1('0x1f')]);router['post']('/:id/messages',auth[_0x7ef1('0xe')](),controller[_0x7ef1('0x20')]);router[_0x7ef1('0x16')](_0x7ef1('0x21'),auth[_0x7ef1('0x9')](),interaction['tracked'](_0x7ef1('0x22'),'chatinteraction:addtags'),controller['addTags']);router[_0x7ef1('0x23')](_0x7ef1('0xd'),auth[_0x7ef1('0x9')](),interaction[_0x7ef1('0x24')](_0x7ef1('0x22'),_0x7ef1('0x25')),controller[_0x7ef1('0x26')]);router[_0x7ef1('0x23')](_0x7ef1('0x27'),controller[_0x7ef1('0x28')]);router[_0x7ef1('0x23')](_0x7ef1('0x29'),auth[_0x7ef1('0xe')](),controller[_0x7ef1('0x2a')]);router['put'](_0x7ef1('0x2b'),controller[_0x7ef1('0x2c')]);router['delete']('/:id',auth[_0x7ef1('0x9')](),interaction[_0x7ef1('0x24')](_0x7ef1('0x22'),'chatinteraction:destroy'),controller[_0x7ef1('0x2d')]);router[_0x7ef1('0x2e')](_0x7ef1('0x21'),auth[_0x7ef1('0x9')](),controller[_0x7ef1('0x2f')]);module[_0x7ef1('0x30')]=router; \ No newline at end of file +var _0x575f=['addMessage','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','isAuthenticated','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','attachmentUpload'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x575f,0x1d3));var _0xf575=function(_0x5b19b9,_0x22a323){_0x5b19b9=_0x5b19b9-0x0;var _0x3fa9df=_0x575f[_0x5b19b9];return _0x3fa9df;};'use strict';var multer=require(_0xf575('0x0'));var util=require(_0xf575('0x1'));var path=require(_0xf575('0x2'));var timeout=require(_0xf575('0x3'));var express=require('express');var router=express[_0xf575('0x4')]();var fs_extra=require(_0xf575('0x5'));var auth=require(_0xf575('0x6'));var interaction=require(_0xf575('0x7'));var config=require(_0xf575('0x8'));var controller=require(_0xf575('0x9'));router[_0xf575('0xa')]('/',auth['isAuthenticated'](),controller[_0xf575('0xb')]);router[_0xf575('0xa')]('/describe',auth[_0xf575('0xc')](),controller[_0xf575('0xd')]);router['get'](_0xf575('0xe'),auth[_0xf575('0xf')](),controller['show']);router['get']('/:id/attachment_download',auth[_0xf575('0xf')](),controller[_0xf575('0x10')]);router[_0xf575('0xa')](_0xf575('0x11'),auth[_0xf575('0xc')](),controller['getMessages']);router[_0xf575('0xa')](_0xf575('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xf575('0xa')](_0xf575('0x13'),auth[_0xf575('0xc')](),controller[_0xf575('0x14')]);router[_0xf575('0x15')]('/',auth[_0xf575('0xc')](),controller['create']);router['post'](_0xf575('0x16'),auth[_0xf575('0xc')](),controller[_0xf575('0x17')]);var upload=multer({'storage':multer[_0xf575('0x18')]({'destination':function(_0x70660c,_0x218c51,_0x505e0a){_0x505e0a(null,path[_0xf575('0x19')](config['root'],_0xf575('0x1a')));},'filename':function(_0x11fbb9,_0x1f64cb,_0xeb89a4){_0xeb89a4(null,util[_0xf575('0x1b')]('%s-%s',Date['now'](),_0x1f64cb[_0xf575('0x1c')][_0xf575('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf575('0x1e'),upload[_0xf575('0x1f')]('file'),controller[_0xf575('0x20')]);router[_0xf575('0x15')]('/:id/messages',auth[_0xf575('0xf')](),controller[_0xf575('0x21')]);router[_0xf575('0x15')](_0xf575('0x22'),auth[_0xf575('0xc')](),interaction[_0xf575('0x23')]('chat','chatinteraction:addtags'),controller[_0xf575('0x24')]);router[_0xf575('0x25')](_0xf575('0xe'),auth[_0xf575('0xc')](),interaction[_0xf575('0x23')](_0xf575('0x26'),_0xf575('0x27')),controller['update']);router[_0xf575('0x25')](_0xf575('0x28'),controller[_0xf575('0x29')]);router[_0xf575('0x25')](_0xf575('0x2a'),auth[_0xf575('0xf')](),controller[_0xf575('0x2b')]);router[_0xf575('0x25')](_0xf575('0x2c'),controller[_0xf575('0x2d')]);router[_0xf575('0x2e')](_0xf575('0xe'),auth[_0xf575('0xc')](),interaction[_0xf575('0x23')]('chat',_0xf575('0x2f')),controller[_0xf575('0x30')]);router[_0xf575('0x2e')]('/:id/tags',auth[_0xf575('0xc')](),controller[_0xf575('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 19d8c79..eb53f35 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 _0x7009=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7009,0x1c3));var _0x9700=function(_0x570a14,_0x34e430){_0x570a14=_0x570a14-0x0;var _0x21819e=_0x7009[_0x570a14];return _0x21819e;};'use strict';var Sequelize=require(_0x9700('0x0'));module[_0x9700('0x1')]={'body':{'type':Sequelize[_0x9700('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9700('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9700('0x4')]}}; \ No newline at end of file +var _0x5b23=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x388e14,_0x4ce3e7){var _0x2ad349=function(_0x115182){while(--_0x115182){_0x388e14['push'](_0x388e14['shift']());}};_0x2ad349(++_0x4ce3e7);}(_0x5b23,0x1c0));var _0x35b2=function(_0x4b9d59,_0x910c53){_0x4b9d59=_0x4b9d59-0x0;var _0x2426ba=_0x5b23[_0x4b9d59];return _0x2426ba;};'use strict';var Sequelize=require(_0x35b2('0x0'));module['exports']={'body':{'type':Sequelize[_0x35b2('0x1')](_0x35b2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x35b2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x35b2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 54dfc0c..b5a7ea5 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 _0xfa21=['online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','all','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','error','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','ChatInternalMessage','find','create','update','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal'];(function(_0x2d5805,_0x21954e){var _0x1cae4f=function(_0x53ff24){while(--_0x53ff24){_0x2d5805['push'](_0x2d5805['shift']());}};_0x1cae4f(++_0x21954e);}(_0xfa21,0x1ad));var _0x1fa2=function(_0x2ed3d5,_0x491591){_0x2ed3d5=_0x2ed3d5-0x0;var _0x3241e8=_0xfa21[_0x2ed3d5];return _0x3241e8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1fa2('0x0'));var jsonpatch=require(_0x1fa2('0x1'));var rp=require('request-promise');var moment=require(_0x1fa2('0x2'));var BPromise=require(_0x1fa2('0x3'));var Mustache=require(_0x1fa2('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1fa2('0x5'));var csv=require(_0x1fa2('0x6'));var ejs=require(_0x1fa2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1fa2('0x8'));var jsforce=require(_0x1fa2('0x9'));var deskjs=require(_0x1fa2('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1fa2('0xb'));var Redis=require(_0x1fa2('0xc'));var authService=require(_0x1fa2('0xd'));var qs=require(_0x1fa2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fa2('0xf'))(_0x1fa2('0x10'));var utils=require('../../config/utils');var config=require(_0x1fa2('0x11'));var licenseUtil=require(_0x1fa2('0x12'));var db=require(_0x1fa2('0x13'))['db'];config[_0x1fa2('0x14')]=_[_0x1fa2('0x15')](config[_0x1fa2('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x1fa2('0x16'))(new Redis(config[_0x1fa2('0x14')]));require(_0x1fa2('0x17'))[_0x1fa2('0x18')](socket);function respondWithStatusCode(_0x24c1db,_0x191ba9){_0x191ba9=_0x191ba9||0xcc;return function(_0x32eab7){if(_0x32eab7){return _0x24c1db[_0x1fa2('0x19')](_0x191ba9);}return _0x24c1db['status'](_0x191ba9)['end']();};}function respondWithResult(_0x390d26,_0x39ff58){_0x39ff58=_0x39ff58||0xc8;return function(_0x30fad9){if(_0x30fad9){return _0x390d26[_0x1fa2('0x1a')](_0x39ff58)[_0x1fa2('0x1b')](_0x30fad9);}};}function respondWithFilteredResult(_0x1eee49,_0x259b2c){return function(_0x80a25){if(_0x80a25){var _0x1334b3=typeof _0x259b2c[_0x1fa2('0x1c')]===_0x1fa2('0x1d')&&typeof _0x259b2c[_0x1fa2('0x1e')]===_0x1fa2('0x1d');var _0x1c846a=_0x80a25[_0x1fa2('0x1f')];var _0x25dc42=_0x1334b3?0x0:_0x259b2c[_0x1fa2('0x1c')];var _0x5abec7=_0x1334b3?_0x80a25['count']:_0x259b2c[_0x1fa2('0x1c')]+_0x259b2c[_0x1fa2('0x1e')];var _0x503315;if(_0x5abec7>=_0x1c846a){_0x5abec7=_0x1c846a;_0x503315=0xc8;}else{_0x503315=0xce;}_0x1eee49[_0x1fa2('0x1a')](_0x503315);return _0x1eee49['set']('Content-Range',_0x25dc42+'-'+_0x5abec7+'/'+_0x1c846a)[_0x1fa2('0x1b')](_0x80a25);}return null;};}function patchUpdates(_0xf73efd){return function(_0x5b02e7){try{jsonpatch['apply'](_0x5b02e7,_0xf73efd,!![]);}catch(_0x1b1af6){return BPromise[_0x1fa2('0x20')](_0x1b1af6);}return _0x5b02e7[_0x1fa2('0x21')]();};}function saveUpdates(_0x358e62,_0x14af8e){return function(_0x420185){if(_0x420185){return _0x420185['update'](_0x358e62)[_0x1fa2('0x22')](function(_0x67ad47){return _0x67ad47;});}return null;};}function removeEntity(_0x49b36e,_0x36aa8a){return function(_0x222859){if(_0x222859){return _0x222859['destroy']()[_0x1fa2('0x22')](function(){_0x49b36e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x176825,_0x46bd6b){return function(_0x35c9fc){if(!_0x35c9fc){_0x176825[_0x1fa2('0x19')](0x194);}return _0x35c9fc;};}function handleError(_0x329f47,_0xa7a51c){_0xa7a51c=_0xa7a51c||0x1f4;return function(_0x1a74d8){logger[_0x1fa2('0x23')](_0x1a74d8['stack']);if(_0x1a74d8[_0x1fa2('0x24')]){delete _0x1a74d8[_0x1fa2('0x24')];}_0x329f47[_0x1fa2('0x1a')](_0xa7a51c)['send'](_0x1a74d8);};}exports[_0x1fa2('0x25')]=function(_0x3adf83,_0x35ea8a){var _0x19e11a={},_0x1d50b4={},_0x47aace={'count':0x0,'rows':[]};var _0x6900f4=_[_0x1fa2('0x26')](db['ChatInternalMessage'][_0x1fa2('0x27')],function(_0x591ab1){return{'name':_0x591ab1[_0x1fa2('0x28')],'type':_0x591ab1[_0x1fa2('0x29')]['key']};});_0x1d50b4[_0x1fa2('0x2a')]=_['map'](_0x6900f4,'name');_0x1d50b4[_0x1fa2('0x2b')]=_[_0x1fa2('0x2c')](_0x3adf83[_0x1fa2('0x2b')]);_0x1d50b4[_0x1fa2('0x2d')]=_['intersection'](_0x1d50b4[_0x1fa2('0x2a')],_0x1d50b4[_0x1fa2('0x2b')]);_0x19e11a[_0x1fa2('0x2e')]=_[_0x1fa2('0x2f')](_0x1d50b4['model'],qs['fields'](_0x3adf83[_0x1fa2('0x2b')][_0x1fa2('0x30')]));_0x19e11a[_0x1fa2('0x2e')]=_0x19e11a['attributes'][_0x1fa2('0x31')]?_0x19e11a[_0x1fa2('0x2e')]:_0x1d50b4[_0x1fa2('0x2a')];if(!_0x3adf83[_0x1fa2('0x2b')]['hasOwnProperty']('nolimit')){_0x19e11a[_0x1fa2('0x1e')]=qs[_0x1fa2('0x1e')](_0x3adf83['query'][_0x1fa2('0x1e')]);_0x19e11a[_0x1fa2('0x1c')]=qs['offset'](_0x3adf83[_0x1fa2('0x2b')][_0x1fa2('0x1c')]);}_0x19e11a[_0x1fa2('0x32')]=qs[_0x1fa2('0x33')](_0x3adf83[_0x1fa2('0x2b')][_0x1fa2('0x33')]);_0x19e11a[_0x1fa2('0x34')]=qs[_0x1fa2('0x2d')](_['pick'](_0x3adf83[_0x1fa2('0x2b')],_0x1d50b4['filters']),_0x6900f4);if(_0x3adf83[_0x1fa2('0x2b')][_0x1fa2('0x35')]){_0x19e11a[_0x1fa2('0x34')]=_[_0x1fa2('0x36')](_0x19e11a[_0x1fa2('0x34')],{'$or':_[_0x1fa2('0x26')](_0x6900f4,function(_0x3125f9){if(_0x3125f9['type']!==_0x1fa2('0x37')){var _0x54467a={};_0x54467a[_0x3125f9[_0x1fa2('0x24')]]={'$like':'%'+_0x3adf83[_0x1fa2('0x2b')][_0x1fa2('0x35')]+'%'};return _0x54467a;}})});}_0x19e11a=_[_0x1fa2('0x36')]({},_0x19e11a,_0x3adf83[_0x1fa2('0x38')]);var _0x4eee34={'where':_0x19e11a[_0x1fa2('0x34')]};return db['ChatInternalMessage'][_0x1fa2('0x1f')](_0x4eee34)[_0x1fa2('0x22')](function(_0xa99256){_0x47aace[_0x1fa2('0x1f')]=_0xa99256;if(_0x3adf83[_0x1fa2('0x2b')][_0x1fa2('0x39')]){_0x19e11a[_0x1fa2('0x3a')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x1fa2('0x3b')](_0x19e11a);})[_0x1fa2('0x22')](function(_0x5676ec){_0x47aace[_0x1fa2('0x3c')]=_0x5676ec;return _0x47aace;})[_0x1fa2('0x22')](respondWithFilteredResult(_0x35ea8a,_0x19e11a))[_0x1fa2('0x3d')](handleError(_0x35ea8a,null));};exports[_0x1fa2('0x3e')]=function(_0x2b86e9,_0x4bec37){var _0x2666b9={'raw':!![],'where':{'id':_0x2b86e9['params']['id']}},_0x2fe2a0={};_0x2fe2a0['model']=_['keys'](db['ChatInternalMessage'][_0x1fa2('0x27')]);_0x2fe2a0[_0x1fa2('0x2b')]=_[_0x1fa2('0x2c')](_0x2b86e9['query']);_0x2fe2a0[_0x1fa2('0x2d')]=_['intersection'](_0x2fe2a0[_0x1fa2('0x2a')],_0x2fe2a0['query']);_0x2666b9[_0x1fa2('0x2e')]=_['intersection'](_0x2fe2a0['model'],qs['fields'](_0x2b86e9['query']['fields']));_0x2666b9[_0x1fa2('0x2e')]=_0x2666b9['attributes'][_0x1fa2('0x31')]?_0x2666b9[_0x1fa2('0x2e')]:_0x2fe2a0[_0x1fa2('0x2a')];if(_0x2b86e9[_0x1fa2('0x2b')][_0x1fa2('0x39')]){_0x2666b9[_0x1fa2('0x3a')]=[{'all':!![]}];}_0x2666b9=_[_0x1fa2('0x36')]({},_0x2666b9,_0x2b86e9[_0x1fa2('0x38')]);return db[_0x1fa2('0x3f')][_0x1fa2('0x40')](_0x2666b9)[_0x1fa2('0x22')](handleEntityNotFound(_0x4bec37,null))[_0x1fa2('0x22')](respondWithResult(_0x4bec37,null))[_0x1fa2('0x3d')](handleError(_0x4bec37,null));};exports[_0x1fa2('0x41')]=function(_0x1cc621,_0x5a57e6){return db[_0x1fa2('0x3f')][_0x1fa2('0x41')](_0x1cc621['body'],{})[_0x1fa2('0x22')](respondWithResult(_0x5a57e6,0xc9))[_0x1fa2('0x3d')](handleError(_0x5a57e6,null));};exports[_0x1fa2('0x42')]=function(_0x35049b,_0xcddcdd){if(_0x35049b[_0x1fa2('0x43')]['id']){delete _0x35049b[_0x1fa2('0x43')]['id'];}return db['ChatInternalMessage'][_0x1fa2('0x40')]({'where':{'id':_0x35049b['params']['id']}})[_0x1fa2('0x22')](handleEntityNotFound(_0xcddcdd,null))[_0x1fa2('0x22')](saveUpdates(_0x35049b[_0x1fa2('0x43')],null))['then'](respondWithResult(_0xcddcdd,null))[_0x1fa2('0x3d')](handleError(_0xcddcdd,null));};exports[_0x1fa2('0x44')]=function(_0x21bdcd,_0x1d3b84){return db['ChatInternalMessage']['find']({'where':{'id':_0x21bdcd['params']['id']}})[_0x1fa2('0x22')](handleEntityNotFound(_0x1d3b84,null))[_0x1fa2('0x22')](removeEntity(_0x1d3b84,null))[_0x1fa2('0x3d')](handleError(_0x1d3b84,null));};exports[_0x1fa2('0x45')]=function(_0x3f188f,_0xb898ed){return db[_0x1fa2('0x3f')][_0x1fa2('0x45')]()[_0x1fa2('0x22')](respondWithResult(_0xb898ed,null))[_0x1fa2('0x3d')](handleError(_0xb898ed,null));};function wrapUser(_0x5c3e42){return function(_0x22495c){var _0x1a2dc4=_0x5c3e42[_0x1fa2('0x46')]({'plain':!![]});_0x1a2dc4[_0x1fa2('0x47')]=[];if(_0x22495c){_0x1a2dc4[_0x1fa2('0x48')]=_0x22495c[_0x1fa2('0x49')];_0x1a2dc4[_0x1fa2('0x4a')]=_0x22495c;}else{_0x1a2dc4[_0x1fa2('0x48')]=moment(0x0)[_0x1fa2('0x4b')](_0x1fa2('0x4c'));_0x1a2dc4[_0x1fa2('0x4a')]={};}return _0x1a2dc4;};}exports[_0x1fa2('0x4d')]=function(_0x2974c9,_0x5f11f5,_0x4c47d1){var _0x2381ed=[];return db[_0x1fa2('0x4e')][_0x1fa2('0x3b')]({'where':{'role':[_0x1fa2('0x4f'),_0x1fa2('0x50'),_0x1fa2('0x51')]},'attributes':['id',_0x1fa2('0x52'),_0x1fa2('0x24'),_0x1fa2('0x53'),_0x1fa2('0x54'),_0x1fa2('0x55'),_0x1fa2('0x56'),_0x1fa2('0x57'),_0x1fa2('0x58'),_0x1fa2('0x59')],'order':qs[_0x1fa2('0x33')]('-online'),'include':[{'model':db[_0x1fa2('0x5a')],'as':_0x1fa2('0x5b'),'attributes':['id',_0x1fa2('0x24'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x11a43f){if(_0x11a43f){var _0x539ab6=_0x2974c9[_0x1fa2('0x51')]['get']({'plain':!![]});if(!_0x539ab6)throw new Error(_0x1fa2('0x5c'));if(_0x539ab6[_0x1fa2('0x53')]===_0x1fa2('0x51')){return db['UserProfileSection']['find']({'where':{'name':_0x1fa2('0x5d'),'userProfileId':_0x539ab6['userProfileId']},'raw':!![]})['then'](function(_0x23b85b){if(_0x23b85b){if(_0x23b85b[_0x1fa2('0x5e')]===0x0){return db[_0x1fa2('0x5f')][_0x1fa2('0x3b')]({'where':{'sectionId':_0x23b85b['id']},'raw':!![]})[_0x1fa2('0x22')](function(_0x1270c9){var _0x3c79ed=[];if(_[_0x1fa2('0x60')](_0x1270c9)){_0x3c79ed=_['filter'](_0x11a43f,function(_0xa1d9ca){if(_0xa1d9ca[_0x1fa2('0x53')]!=='agent'){return _0xa1d9ca;}});return _0x3c79ed;}else{for(var _0x2a3fd0=0x0;_0x2a3fd0<_0x11a43f[_0x1fa2('0x31')];_0x2a3fd0++){var _0x4daa44=_0x11a43f[_0x2a3fd0];if(_0x4daa44[_0x1fa2('0x53')]==='agent'){var _0x3188b9=_['find'](_0x1270c9,function(_0x512234){return _0x512234[_0x1fa2('0x61')]===_0x4daa44['id'];});if(_0x3188b9)_0x3c79ed[_0x1fa2('0x62')](_0x4daa44);}else{_0x3c79ed['push'](_0x4daa44);}}return _0x3c79ed;}});}else{return _0x11a43f;}}else{var _0x207c2e=_[_0x1fa2('0x35')](_0x11a43f,function(_0x16a90c){if(_0x16a90c[_0x1fa2('0x53')]!==_0x1fa2('0x4f')){return _0x16a90c;}});return _0x207c2e;}});}else{return _0x11a43f;}}})[_0x1fa2('0x22')](function(_0x282420){var _0xc874e2=[];if(_0x282420){_0x2381ed=_0x282420;for(var _0x37d4ab=0x0;_0x37d4ab<_0x282420[_0x1fa2('0x31')];_0x37d4ab+=0x1){_0x2381ed[_0x37d4ab][_0x1fa2('0x47')]=[];_0xc874e2[_0x1fa2('0x62')](db['ChatInternalMessage'][_0x1fa2('0x40')]({'where':{'FromId':[_0x2974c9[_0x1fa2('0x51')]['id'],_0x282420[_0x37d4ab]['id']],'ToId':[_0x2974c9[_0x1fa2('0x51')]['id'],_0x282420[_0x37d4ab]['id']],'ChatGroupId':null},'attributes':['id',_0x1fa2('0x49'),_0x1fa2('0x63'),_0x1fa2('0x64'),_0x1fa2('0x65'),_0x1fa2('0x43')],'order':qs[_0x1fa2('0x33')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x282420[_0x37d4ab])));}return BPromise[_0x1fa2('0x66')](_0xc874e2);}return[];})[_0x1fa2('0x22')](function(_0x4be331){return{'rows':_0x4be331,'count':_0x4be331['length']};})[_0x1fa2('0x22')](respondWithResult(_0x5f11f5,null))[_0x1fa2('0x3d')](handleError(_0x5f11f5,null));}; \ No newline at end of file +var _0x4a49=['include','findAll','rows','catch','show','params','intersection','find','body','describe','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','createdAt','FromId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','keys','query','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll'];(function(_0x527a18,_0xba4171){var _0x430d04=function(_0x423d9f){while(--_0x423d9f){_0x527a18['push'](_0x527a18['shift']());}};_0x430d04(++_0xba4171);}(_0x4a49,0x100));var _0x94a4=function(_0x27e3a0,_0x53c5d3){_0x27e3a0=_0x27e3a0-0x0;var _0x5dd3d6=_0x4a49[_0x27e3a0];return _0x5dd3d6;};'use strict';var emlformat=require(_0x94a4('0x0'));var rimraf=require(_0x94a4('0x1'));var zipdir=require(_0x94a4('0x2'));var jsonpatch=require(_0x94a4('0x3'));var rp=require(_0x94a4('0x4'));var moment=require('moment');var BPromise=require(_0x94a4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x94a4('0x6'));var sox=require('sox');var csv=require(_0x94a4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94a4('0x8'));var squel=require(_0x94a4('0x9'));var crypto=require('crypto');var jsforce=require(_0x94a4('0xa'));var deskjs=require(_0x94a4('0xb'));var toCsv=require(_0x94a4('0x7'));var querystring=require(_0x94a4('0xc'));var Papa=require(_0x94a4('0xd'));var Redis=require(_0x94a4('0xe'));var authService=require(_0x94a4('0xf'));var qs=require(_0x94a4('0x10'));var as=require(_0x94a4('0x11'));var hardwareService=require(_0x94a4('0x12'));var logger=require('../../config/logger')(_0x94a4('0x13'));var utils=require(_0x94a4('0x14'));var config=require(_0x94a4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x94a4('0x16'))['db'];config['redis']=_[_0x94a4('0x17')](config[_0x94a4('0x18')],{'host':_0x94a4('0x19'),'port':0x18eb});var socket=require(_0x94a4('0x1a'))(new Redis(config[_0x94a4('0x18')]));require('./chatInternalMessage.socket')[_0x94a4('0x1b')](socket);function respondWithStatusCode(_0x1d20fd,_0x4c13d5){_0x4c13d5=_0x4c13d5||0xcc;return function(_0x530a9f){if(_0x530a9f){return _0x1d20fd[_0x94a4('0x1c')](_0x4c13d5);}return _0x1d20fd[_0x94a4('0x1d')](_0x4c13d5)[_0x94a4('0x1e')]();};}function respondWithResult(_0x16855f,_0x6081a9){_0x6081a9=_0x6081a9||0xc8;return function(_0x4a9818){if(_0x4a9818){return _0x16855f[_0x94a4('0x1d')](_0x6081a9)[_0x94a4('0x1f')](_0x4a9818);}};}function respondWithFilteredResult(_0x3819e1,_0x59de37){return function(_0x3517e8){if(_0x3517e8){var _0x4f5511=typeof _0x59de37[_0x94a4('0x20')]===_0x94a4('0x21')&&typeof _0x59de37[_0x94a4('0x22')]===_0x94a4('0x21');var _0x3ceeed=_0x3517e8[_0x94a4('0x23')];var _0x26acf8=_0x4f5511?0x0:_0x59de37[_0x94a4('0x20')];var _0x2af69b=_0x4f5511?_0x3517e8[_0x94a4('0x23')]:_0x59de37[_0x94a4('0x20')]+_0x59de37['limit'];var _0x48c324;if(_0x2af69b>=_0x3ceeed){_0x2af69b=_0x3ceeed;_0x48c324=0xc8;}else{_0x48c324=0xce;}_0x3819e1[_0x94a4('0x1d')](_0x48c324);return _0x3819e1[_0x94a4('0x24')](_0x94a4('0x25'),_0x26acf8+'-'+_0x2af69b+'/'+_0x3ceeed)[_0x94a4('0x1f')](_0x3517e8);}return null;};}function patchUpdates(_0x950d9e){return function(_0x46dbb6){try{jsonpatch[_0x94a4('0x26')](_0x46dbb6,_0x950d9e,!![]);}catch(_0x278aec){return BPromise[_0x94a4('0x27')](_0x278aec);}return _0x46dbb6['save']();};}function saveUpdates(_0x57f3df,_0x33cc91){return function(_0x459417){if(_0x459417){return _0x459417[_0x94a4('0x28')](_0x57f3df)[_0x94a4('0x29')](function(_0x3079b3){return _0x3079b3;});}return null;};}function removeEntity(_0x575269,_0x1a94ec){return function(_0x15cec9){if(_0x15cec9){return _0x15cec9['destroy']()[_0x94a4('0x29')](function(){_0x575269['status'](0xcc)[_0x94a4('0x1e')]();});}};}function handleEntityNotFound(_0x404b80,_0x14ce4f){return function(_0xaf247a){if(!_0xaf247a){_0x404b80[_0x94a4('0x1c')](0x194);}return _0xaf247a;};}function handleError(_0x3ae25d,_0x24641b){_0x24641b=_0x24641b||0x1f4;return function(_0x498471){logger[_0x94a4('0x2a')](_0x498471[_0x94a4('0x2b')]);if(_0x498471[_0x94a4('0x2c')]){delete _0x498471[_0x94a4('0x2c')];}_0x3ae25d[_0x94a4('0x1d')](_0x24641b)[_0x94a4('0x2d')](_0x498471);};}exports[_0x94a4('0x2e')]=function(_0x24dd08,_0x3036eb){var _0x214de1={},_0x2a8195={},_0x2e66e1={'count':0x0,'rows':[]};var _0x47efc0=_[_0x94a4('0x2f')](db[_0x94a4('0x30')][_0x94a4('0x31')],function(_0x2415d3){return{'name':_0x2415d3['fieldName'],'type':_0x2415d3[_0x94a4('0x32')][_0x94a4('0x33')]};});_0x2a8195[_0x94a4('0x34')]=_['map'](_0x47efc0,_0x94a4('0x2c'));_0x2a8195['query']=_[_0x94a4('0x35')](_0x24dd08[_0x94a4('0x36')]);_0x2a8195['filters']=_['intersection'](_0x2a8195[_0x94a4('0x34')],_0x2a8195[_0x94a4('0x36')]);_0x214de1[_0x94a4('0x37')]=_['intersection'](_0x2a8195[_0x94a4('0x34')],qs[_0x94a4('0x38')](_0x24dd08[_0x94a4('0x36')][_0x94a4('0x38')]));_0x214de1[_0x94a4('0x37')]=_0x214de1[_0x94a4('0x37')][_0x94a4('0x39')]?_0x214de1[_0x94a4('0x37')]:_0x2a8195[_0x94a4('0x34')];if(!_0x24dd08[_0x94a4('0x36')]['hasOwnProperty'](_0x94a4('0x3a'))){_0x214de1[_0x94a4('0x22')]=qs['limit'](_0x24dd08[_0x94a4('0x36')][_0x94a4('0x22')]);_0x214de1[_0x94a4('0x20')]=qs[_0x94a4('0x20')](_0x24dd08[_0x94a4('0x36')]['offset']);}_0x214de1[_0x94a4('0x3b')]=qs[_0x94a4('0x3c')](_0x24dd08['query'][_0x94a4('0x3c')]);_0x214de1['where']=qs[_0x94a4('0x3d')](_[_0x94a4('0x3e')](_0x24dd08[_0x94a4('0x36')],_0x2a8195[_0x94a4('0x3d')]),_0x47efc0);if(_0x24dd08[_0x94a4('0x36')][_0x94a4('0x3f')]){_0x214de1[_0x94a4('0x40')]=_[_0x94a4('0x41')](_0x214de1[_0x94a4('0x40')],{'$or':_[_0x94a4('0x2f')](_0x47efc0,function(_0x1344e2){if(_0x1344e2[_0x94a4('0x32')]!=='VIRTUAL'){var _0xcf35cb={};_0xcf35cb[_0x1344e2[_0x94a4('0x2c')]]={'$like':'%'+_0x24dd08[_0x94a4('0x36')][_0x94a4('0x3f')]+'%'};return _0xcf35cb;}})});}_0x214de1=_[_0x94a4('0x41')]({},_0x214de1,_0x24dd08[_0x94a4('0x42')]);var _0x370556={'where':_0x214de1[_0x94a4('0x40')]};return db['ChatInternalMessage'][_0x94a4('0x23')](_0x370556)[_0x94a4('0x29')](function(_0x2f1fe1){_0x2e66e1[_0x94a4('0x23')]=_0x2f1fe1;if(_0x24dd08[_0x94a4('0x36')][_0x94a4('0x43')]){_0x214de1[_0x94a4('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x94a4('0x45')](_0x214de1);})[_0x94a4('0x29')](function(_0x323242){_0x2e66e1[_0x94a4('0x46')]=_0x323242;return _0x2e66e1;})['then'](respondWithFilteredResult(_0x3036eb,_0x214de1))[_0x94a4('0x47')](handleError(_0x3036eb,null));};exports[_0x94a4('0x48')]=function(_0x316dcb,_0x2b3fdd){var _0x308805={'raw':!![],'where':{'id':_0x316dcb[_0x94a4('0x49')]['id']}},_0x631ae7={};_0x631ae7[_0x94a4('0x34')]=_[_0x94a4('0x35')](db[_0x94a4('0x30')][_0x94a4('0x31')]);_0x631ae7[_0x94a4('0x36')]=_[_0x94a4('0x35')](_0x316dcb[_0x94a4('0x36')]);_0x631ae7['filters']=_[_0x94a4('0x4a')](_0x631ae7['model'],_0x631ae7[_0x94a4('0x36')]);_0x308805[_0x94a4('0x37')]=_[_0x94a4('0x4a')](_0x631ae7[_0x94a4('0x34')],qs[_0x94a4('0x38')](_0x316dcb[_0x94a4('0x36')][_0x94a4('0x38')]));_0x308805[_0x94a4('0x37')]=_0x308805[_0x94a4('0x37')][_0x94a4('0x39')]?_0x308805[_0x94a4('0x37')]:_0x631ae7['model'];if(_0x316dcb[_0x94a4('0x36')][_0x94a4('0x43')]){_0x308805[_0x94a4('0x44')]=[{'all':!![]}];}_0x308805=_['merge']({},_0x308805,_0x316dcb[_0x94a4('0x42')]);return db['ChatInternalMessage'][_0x94a4('0x4b')](_0x308805)[_0x94a4('0x29')](handleEntityNotFound(_0x2b3fdd,null))[_0x94a4('0x29')](respondWithResult(_0x2b3fdd,null))[_0x94a4('0x47')](handleError(_0x2b3fdd,null));};exports['create']=function(_0x5eea8a,_0x69d6cf){return db[_0x94a4('0x30')]['create'](_0x5eea8a[_0x94a4('0x4c')],{})[_0x94a4('0x29')](respondWithResult(_0x69d6cf,0xc9))[_0x94a4('0x47')](handleError(_0x69d6cf,null));};exports[_0x94a4('0x28')]=function(_0x1deb4a,_0x4588bd){if(_0x1deb4a[_0x94a4('0x4c')]['id']){delete _0x1deb4a['body']['id'];}return db[_0x94a4('0x30')]['find']({'where':{'id':_0x1deb4a['params']['id']}})['then'](handleEntityNotFound(_0x4588bd,null))[_0x94a4('0x29')](saveUpdates(_0x1deb4a[_0x94a4('0x4c')],null))[_0x94a4('0x29')](respondWithResult(_0x4588bd,null))[_0x94a4('0x47')](handleError(_0x4588bd,null));};exports['destroy']=function(_0x2cf83d,_0x1348ef){return db[_0x94a4('0x30')][_0x94a4('0x4b')]({'where':{'id':_0x2cf83d[_0x94a4('0x49')]['id']}})['then'](handleEntityNotFound(_0x1348ef,null))[_0x94a4('0x29')](removeEntity(_0x1348ef,null))[_0x94a4('0x47')](handleError(_0x1348ef,null));};exports[_0x94a4('0x4d')]=function(_0x5aed85,_0x3b91f9){return db['ChatInternalMessage'][_0x94a4('0x4d')]()[_0x94a4('0x29')](respondWithResult(_0x3b91f9,null))[_0x94a4('0x47')](handleError(_0x3b91f9,null));};function wrapUser(_0x248151){return function(_0x212673){var _0x218396=_0x248151['get']({'plain':!![]});_0x218396[_0x94a4('0x4e')]=[];if(_0x212673){_0x218396[_0x94a4('0x4f')]=_0x212673['createdAt'];_0x218396['lastMessage']=_0x212673;}else{_0x218396[_0x94a4('0x4f')]=moment(0x0)[_0x94a4('0x50')](_0x94a4('0x51'));_0x218396['lastMessage']={};}return _0x218396;};}exports[_0x94a4('0x52')]=function(_0x44bd9f,_0x21ebe8,_0x21cebe){var _0x49a3a8=[];return db['User'][_0x94a4('0x45')]({'where':{'role':[_0x94a4('0x53'),_0x94a4('0x54'),'user']},'attributes':['id',_0x94a4('0x55'),_0x94a4('0x2c'),_0x94a4('0x56'),_0x94a4('0x57'),_0x94a4('0x58'),_0x94a4('0x59'),'lastLoginAt','allowmessenger',_0x94a4('0x5a')],'order':qs['sort'](_0x94a4('0x5b')),'include':[{'model':db[_0x94a4('0x5c')],'as':_0x94a4('0x5d'),'attributes':['id',_0x94a4('0x2c'),_0x94a4('0x32')],'through':{'attributes':[]}}]})[_0x94a4('0x29')](function(_0x21d495){if(_0x21d495){var _0xcff6c0=_0x44bd9f['user'][_0x94a4('0x5e')]({'plain':!![]});if(!_0xcff6c0)throw new Error(_0x94a4('0x5f'));if(_0xcff6c0['role']===_0x94a4('0x60')){return db[_0x94a4('0x61')][_0x94a4('0x4b')]({'where':{'name':_0x94a4('0x62'),'userProfileId':_0xcff6c0[_0x94a4('0x63')]},'raw':!![]})[_0x94a4('0x29')](function(_0xe51e11){if(_0xe51e11){if(_0xe51e11[_0x94a4('0x64')]===0x0){return db[_0x94a4('0x65')][_0x94a4('0x45')]({'where':{'sectionId':_0xe51e11['id']},'raw':!![]})[_0x94a4('0x29')](function(_0x2819ac){var _0x58f62d=[];if(_[_0x94a4('0x66')](_0x2819ac)){_0x58f62d=_['filter'](_0x21d495,function(_0x58eafe){if(_0x58eafe[_0x94a4('0x56')]!==_0x94a4('0x53')){return _0x58eafe;}});return _0x58f62d;}else{for(var _0x5f4224=0x0;_0x5f4224<_0x21d495[_0x94a4('0x39')];_0x5f4224++){var _0x5a114c=_0x21d495[_0x5f4224];if(_0x5a114c[_0x94a4('0x56')]===_0x94a4('0x53')){var _0x591dab=_[_0x94a4('0x4b')](_0x2819ac,function(_0x2a315c){return _0x2a315c['resourceId']===_0x5a114c['id'];});if(_0x591dab)_0x58f62d[_0x94a4('0x67')](_0x5a114c);}else{_0x58f62d['push'](_0x5a114c);}}return _0x58f62d;}});}else{return _0x21d495;}}else{var _0xd3ebba=_[_0x94a4('0x3f')](_0x21d495,function(_0x33f9f3){if(_0x33f9f3['role']!==_0x94a4('0x53')){return _0x33f9f3;}});return _0xd3ebba;}});}else{return _0x21d495;}}})['then'](function(_0xe7fcff){var _0x14053b=[];if(_0xe7fcff){_0x49a3a8=_0xe7fcff;for(var _0x12f63d=0x0;_0x12f63d<_0xe7fcff['length'];_0x12f63d+=0x1){_0x49a3a8[_0x12f63d][_0x94a4('0x4e')]=[];_0x14053b[_0x94a4('0x67')](db[_0x94a4('0x30')][_0x94a4('0x4b')]({'where':{'FromId':[_0x44bd9f[_0x94a4('0x60')]['id'],_0xe7fcff[_0x12f63d]['id']],'ToId':[_0x44bd9f[_0x94a4('0x60')]['id'],_0xe7fcff[_0x12f63d]['id']],'ChatGroupId':null},'attributes':['id',_0x94a4('0x68'),_0x94a4('0x69'),'ToId',_0x94a4('0x6a'),'body'],'order':qs[_0x94a4('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x94a4('0x29')](wrapUser(_0xe7fcff[_0x12f63d])));}return BPromise[_0x94a4('0x6b')](_0x14053b);}return[];})['then'](function(_0x3f278c){return{'rows':_0x3f278c,'count':_0x3f278c[_0x94a4('0x39')]};})[_0x94a4('0x29')](respondWithResult(_0x21ebe8,null))[_0x94a4('0x47')](handleError(_0x21ebe8,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2209dd4..2821fd1 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 _0x0ca4=['ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0ca4,0x142));var _0x40ca=function(_0x28ac82,_0x475bc0){_0x28ac82=_0x28ac82-0x0;var _0x42018e=_0x0ca4[_0x28ac82];return _0x42018e;};'use strict';var EventEmitter=require(_0x40ca('0x0'));var ChatInternalMessage=require(_0x40ca('0x1'))['db'][_0x40ca('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x40ca('0x3')](0x0);var events={'afterCreate':_0x40ca('0x4'),'afterUpdate':_0x40ca('0x5'),'afterDestroy':'remove'};function emitEvent(_0x17da02){return function(_0x4c5643,_0x69f683,_0x394f63){ChatInternalMessageEvents[_0x40ca('0x6')](_0x17da02+':'+_0x4c5643['id'],_0x4c5643);ChatInternalMessageEvents[_0x40ca('0x6')](_0x17da02,_0x4c5643);_0x394f63(null);};}for(var e in events){if(events[_0x40ca('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x40ca('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x407d=['setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x44d159,_0x5be762){var _0x2425c1=function(_0xee42de){while(--_0xee42de){_0x44d159['push'](_0x44d159['shift']());}};_0x2425c1(++_0x5be762);}(_0x407d,0x137));var _0xd407=function(_0x30c4fd,_0x55987a){_0x30c4fd=_0x30c4fd-0x0;var _0x3c68b4=_0x407d[_0x30c4fd];return _0x3c68b4;};'use strict';var EventEmitter=require(_0xd407('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd407('0x1')](0x0);var events={'afterCreate':_0xd407('0x2'),'afterUpdate':_0xd407('0x3'),'afterDestroy':_0xd407('0x4')};function emitEvent(_0x45b0ed){return function(_0x362464,_0x291227,_0x5d33d3){ChatInternalMessageEvents[_0xd407('0x5')](_0x45b0ed+':'+_0x362464['id'],_0x362464);ChatInternalMessageEvents[_0xd407('0x5')](_0x45b0ed,_0x362464);_0x5d33d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xd407('0x6')](e,emitEvent(event));}}module[_0xd407('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 462b7b8..c81b328 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 _0x6797=['moment','request-promise','path','rimraf','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x57f95f,_0x2df438){var _0x300bd4=function(_0x39b89f){while(--_0x39b89f){_0x57f95f['push'](_0x57f95f['shift']());}};_0x300bd4(++_0x2df438);}(_0x6797,0x195));var _0x7679=function(_0x41fffc,_0xb0023){_0x41fffc=_0x41fffc-0x0;var _0x334c3e=_0x6797[_0x41fffc];return _0x334c3e;};'use strict';var _=require(_0x7679('0x0'));var util=require(_0x7679('0x1'));var logger=require('../../config/logger')(_0x7679('0x2'));var moment=require(_0x7679('0x3'));var BPromise=require('bluebird');var rp=require(_0x7679('0x4'));var fs=require('fs');var path=require(_0x7679('0x5'));var rimraf=require(_0x7679('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x7679('0x7')]=function(_0x465c45,_0x414d80){return _0x465c45[_0x7679('0x8')](_0x7679('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7679('0xa'),'collate':_0x7679('0xb')});}; \ No newline at end of file +var _0xb776=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','util'];(function(_0x307ae9,_0x2cf267){var _0x48332c=function(_0x717c8b){while(--_0x717c8b){_0x307ae9['push'](_0x307ae9['shift']());}};_0x48332c(++_0x2cf267);}(_0xb776,0x16b));var _0x6b77=function(_0x1a31ed,_0x34de0b){_0x1a31ed=_0x1a31ed-0x0;var _0x51d535=_0xb776[_0x1a31ed];return _0x51d535;};'use strict';var _=require('lodash');var util=require(_0x6b77('0x0'));var logger=require(_0x6b77('0x1'))(_0x6b77('0x2'));var moment=require(_0x6b77('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b77('0x4'));var fs=require('fs');var path=require(_0x6b77('0x5'));var rimraf=require(_0x6b77('0x6'));var config=require(_0x6b77('0x7'));var attributes=require(_0x6b77('0x8'));module[_0x6b77('0x9')]=function(_0x5bfe96,_0x52da4e){return _0x5bfe96[_0x6b77('0xa')]('ChatInternalMessage',attributes,{'tableName':_0x6b77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6b77('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f0d00c5..cf0c65b 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 _0x7ba0=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7ba0,0x1bc));var _0x07ba=function(_0x4081e1,_0xb397ae){_0x4081e1=_0x4081e1-0x0;var _0xdf9ece=_0x7ba0[_0x4081e1];return _0xdf9ece;};'use strict';var _=require(_0x07ba('0x0'));var util=require(_0x07ba('0x1'));var moment=require(_0x07ba('0x2'));var BPromise=require(_0x07ba('0x3'));var rs=require(_0x07ba('0x4'));var fs=require('fs');var Redis=require(_0x07ba('0x5'));var db=require(_0x07ba('0x6'))['db'];var utils=require(_0x07ba('0x7'));var logger=require(_0x07ba('0x8'))(_0x07ba('0x9'));var config=require(_0x07ba('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x07ba('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x07ba('0xc')],{'host':_0x07ba('0xd'),'port':0x18eb});var socket=require(_0x07ba('0xe'))(new Redis(config[_0x07ba('0xc')]));require(_0x07ba('0xf'))[_0x07ba('0x10')](socket);function respondWithRpcPromise(_0x311a1f,_0xe7332f,_0x245fda){return new BPromise(function(_0x210a37,_0x392839){return client[_0x07ba('0x11')](_0x311a1f,_0x245fda)['then'](function(_0xad6dcc){logger[_0x07ba('0x12')](_0x07ba('0x13'),_0xe7332f,'request\x20sent');logger[_0x07ba('0x14')](_0x07ba('0x15'),_0xe7332f,'request\x20sent',JSON[_0x07ba('0x16')](_0xad6dcc));if(_0xad6dcc[_0x07ba('0x17')]){if(_0xad6dcc[_0x07ba('0x17')][_0x07ba('0x18')]===0x1f4){logger[_0x07ba('0x17')](_0x07ba('0x13'),_0xe7332f,_0xad6dcc[_0x07ba('0x17')][_0x07ba('0x19')]);return _0x392839(_0xad6dcc['error'][_0x07ba('0x19')]);}logger['error'](_0x07ba('0x13'),_0xe7332f,_0xad6dcc['error'][_0x07ba('0x19')]);return _0x210a37(_0xad6dcc[_0x07ba('0x17')][_0x07ba('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xe7332f,_0x07ba('0x1a'));_0x210a37(_0xad6dcc[_0x07ba('0x1b')][_0x07ba('0x19')]);}})[_0x07ba('0x1c')](function(_0x37f870){logger['error'](_0x07ba('0x13'),_0xe7332f,_0x37f870);_0x392839(_0x37f870);});});} \ No newline at end of file +var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x20ce,0x10d));var _0xe20c=function(_0x568dce,_0xd353b5){_0x568dce=_0x568dce-0x0;var _0x4d8cf1=_0x20ce[_0x568dce];return _0x4d8cf1;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});config[_0xe20c('0xd')]=_[_0xe20c('0xe')](config[_0xe20c('0xd')],{'host':_0xe20c('0xf'),'port':0x18eb});var socket=require(_0xe20c('0x10'))(new Redis(config[_0xe20c('0xd')]));require(_0xe20c('0x11'))[_0xe20c('0x12')](socket);function respondWithRpcPromise(_0x41379b,_0x16aaaa,_0xb46255){return new BPromise(function(_0x17ecc8,_0x4517d7){return client[_0xe20c('0x13')](_0x41379b,_0xb46255)['then'](function(_0x201b08){logger[_0xe20c('0x14')](_0xe20c('0x15'),_0x16aaaa,_0xe20c('0x16'));logger[_0xe20c('0x17')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x16aaaa,_0xe20c('0x16'),JSON[_0xe20c('0x18')](_0x201b08));if(_0x201b08['error']){if(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1a')]===0x1f4){logger[_0xe20c('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x16aaaa,_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);return _0x4517d7(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);}logger['error'](_0xe20c('0x15'),_0x16aaaa,_0x201b08['error'][_0xe20c('0x1b')]);return _0x17ecc8(_0x201b08[_0xe20c('0x19')][_0xe20c('0x1b')]);}else{logger[_0xe20c('0x14')](_0xe20c('0x15'),_0x16aaaa,_0xe20c('0x16'));_0x17ecc8(_0x201b08[_0xe20c('0x1c')][_0xe20c('0x1b')]);}})[_0xe20c('0x1d')](function(_0x3768b0){logger['error'](_0xe20c('0x15'),_0x16aaaa,_0x3768b0);_0x4517d7(_0x3768b0);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7a524ba..6031258 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 _0x65cc=['remove','update','register','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x2c6c93,_0x11aba9){var _0x539de4=function(_0x2d4635){while(--_0x2d4635){_0x2c6c93['push'](_0x2c6c93['shift']());}};_0x539de4(++_0x11aba9);}(_0x65cc,0x8b));var _0xc65c=function(_0x53b304,_0x1efbab){_0x53b304=_0x53b304-0x0;var _0x471654=_0x65cc[_0x53b304];return _0x471654;};'use strict';var ChatInternalMessageEvents=require(_0xc65c('0x0'));var events=['save',_0xc65c('0x1'),_0xc65c('0x2')];function createListener(_0x57ee23,_0x3b954a){return function(_0x1f4500){_0x3b954a['emit'](_0x57ee23,_0x1f4500);};}function removeListener(_0x2b7eb6,_0x5cc14a){return function(){ChatInternalMessageEvents['removeListener'](_0x2b7eb6,_0x5cc14a);};}exports[_0xc65c('0x3')]=function(_0x2ce0bb){for(var _0x4016a7=0x0,_0x1a6dcf=events['length'];_0x4016a7<_0x1a6dcf;_0x4016a7++){var _0x5be687=events[_0x4016a7];var _0x122a27=createListener(_0xc65c('0x4')+_0x5be687,_0x2ce0bb);ChatInternalMessageEvents['on'](_0x5be687,_0x122a27);}}; \ No newline at end of file +var _0xe3d2=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x47c1ff,_0x4a0beb){var _0x21428d=function(_0x465494){while(--_0x465494){_0x47c1ff['push'](_0x47c1ff['shift']());}};_0x21428d(++_0x4a0beb);}(_0xe3d2,0xcd));var _0x2e3d=function(_0x1c9fc4,_0x240343){_0x1c9fc4=_0x1c9fc4-0x0;var _0x2efcba=_0xe3d2[_0x1c9fc4];return _0x2efcba;};'use strict';var ChatInternalMessageEvents=require(_0x2e3d('0x0'));var events=[_0x2e3d('0x1'),_0x2e3d('0x2'),_0x2e3d('0x3')];function createListener(_0x14fce4,_0x5af99c){return function(_0x4d672c){_0x5af99c[_0x2e3d('0x4')](_0x14fce4,_0x4d672c);};}function removeListener(_0x44b1cf,_0xb1c7e4){return function(){ChatInternalMessageEvents['removeListener'](_0x44b1cf,_0xb1c7e4);};}exports['register']=function(_0x556774){for(var _0x4bf428=0x0,_0x465033=events['length'];_0x4bf428<_0x465033;_0x4bf428++){var _0x210155=events[_0x4bf428];var _0x30b30d=createListener(_0x2e3d('0x5')+_0x210155,_0x556774);ChatInternalMessageEvents['on'](_0x210155,_0x30b30d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 6bd79cc..8405296 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 _0x9368=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x9368,0x181));var _0x8936=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9368[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x8936('0x0'));var util=require(_0x8936('0x1'));var path=require('path');var timeout=require(_0x8936('0x2'));var express=require(_0x8936('0x3'));var router=express['Router']();var fs_extra=require(_0x8936('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8936('0x5'));var config=require(_0x8936('0x6'));var controller=require(_0x8936('0x7'));router[_0x8936('0x8')]('/',auth[_0x8936('0x9')](),controller[_0x8936('0xa')]);router[_0x8936('0x8')](_0x8936('0xb'),auth['isAuthenticated'](),controller[_0x8936('0xc')]);router[_0x8936('0x8')]('/users',auth[_0x8936('0x9')](),controller['getUsers']);router[_0x8936('0x8')](_0x8936('0xd'),auth[_0x8936('0x9')](),controller[_0x8936('0xe')]);router[_0x8936('0xf')]('/',auth[_0x8936('0x9')](),controller[_0x8936('0x10')]);router[_0x8936('0x11')](_0x8936('0xd'),controller[_0x8936('0x12')]);router[_0x8936('0x13')](_0x8936('0xd'),auth[_0x8936('0x9')](),controller[_0x8936('0x14')]);module[_0x8936('0x15')]=router; \ No newline at end of file +var _0x7c5b=['describe','getUsers','/:id','show','post','create','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x3f9433,_0xfb7fa2){var _0xd53a2c=function(_0x4c5706){while(--_0x4c5706){_0x3f9433['push'](_0x3f9433['shift']());}};_0xd53a2c(++_0xfb7fa2);}(_0x7c5b,0x127));var _0xb7c5=function(_0x2280cd,_0xbc772b){_0x2280cd=_0x2280cd-0x0;var _0x3c275c=_0x7c5b[_0x2280cd];return _0x3c275c;};'use strict';var multer=require(_0xb7c5('0x0'));var util=require('util');var path=require(_0xb7c5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb7c5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb7c5('0x3'));var interaction=require(_0xb7c5('0x4'));var config=require(_0xb7c5('0x5'));var controller=require(_0xb7c5('0x6'));router[_0xb7c5('0x7')]('/',auth[_0xb7c5('0x8')](),controller[_0xb7c5('0x9')]);router['get'](_0xb7c5('0xa'),auth[_0xb7c5('0x8')](),controller[_0xb7c5('0xb')]);router[_0xb7c5('0x7')]('/users',auth[_0xb7c5('0x8')](),controller[_0xb7c5('0xc')]);router['get'](_0xb7c5('0xd'),auth[_0xb7c5('0x8')](),controller[_0xb7c5('0xe')]);router[_0xb7c5('0xf')]('/',auth['isAuthenticated'](),controller[_0xb7c5('0x10')]);router['put'](_0xb7c5('0xd'),controller['update']);router['delete'](_0xb7c5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb7c5('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index e783ab1..65ee2ca 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 _0x235b=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x1ed16f,_0x4d93dc){var _0x3cfdbc=function(_0x3c8ab0){while(--_0x3c8ab0){_0x1ed16f['push'](_0x1ed16f['shift']());}};_0x3cfdbc(++_0x4d93dc);}(_0x235b,0x1ed));var _0xb235=function(_0xf75c37,_0x2fa1c7){_0xf75c37=_0xf75c37-0x0;var _0x568a1f=_0x235b[_0xf75c37];return _0x568a1f;};'use strict';var Sequelize=require(_0xb235('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb235('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb235('0x3')]('in',_0xb235('0x4')),'defaultValue':_0xb235('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb235('0x5')]},'providerResponse':{'type':Sequelize[_0xb235('0x6')]}}; \ No newline at end of file +var _0xdc9b=['TEXT','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x4de29c,_0x2acdd3){var _0xfbbaf6=function(_0x2e78f0){while(--_0x2e78f0){_0x4de29c['push'](_0x4de29c['shift']());}};_0xfbbaf6(++_0x2acdd3);}(_0xdc9b,0x70));var _0xbdc9=function(_0x1da5af,_0x4518ed){_0x1da5af=_0x1da5af-0x0;var _0x372821=_0xdc9b[_0x1da5af];return _0x372821;};'use strict';var Sequelize=require(_0xbdc9('0x0'));module[_0xbdc9('0x1')]={'body':{'type':Sequelize[_0xbdc9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbdc9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbdc9('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbdc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 57a7c06..9585e60 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 _0x0e6f=['destroy','sendStatus','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','rows','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','sequelize','QueryTypes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x638bb9,_0x34cb2f){var _0x40b7f9=function(_0x296713){while(--_0x296713){_0x638bb9['push'](_0x638bb9['shift']());}};_0x40b7f9(++_0x34cb2f);}(_0x0e6f,0xc8));var _0xf0e6=function(_0x1569bd,_0x1a1461){_0x1569bd=_0x1569bd-0x0;var _0x40e370=_0x0e6f[_0x1569bd];return _0x40e370;};'use strict';var emlformat=require(_0xf0e6('0x0'));var rimraf=require(_0xf0e6('0x1'));var zipdir=require(_0xf0e6('0x2'));var jsonpatch=require(_0xf0e6('0x3'));var rp=require(_0xf0e6('0x4'));var moment=require(_0xf0e6('0x5'));var BPromise=require(_0xf0e6('0x6'));var Mustache=require(_0xf0e6('0x7'));var util=require(_0xf0e6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf0e6('0x9'));var ejs=require(_0xf0e6('0xa'));var fs=require('fs');var fs_extra=require(_0xf0e6('0xb'));var _=require('lodash');var squel=require(_0xf0e6('0xc'));var crypto=require(_0xf0e6('0xd'));var jsforce=require(_0xf0e6('0xe'));var deskjs=require(_0xf0e6('0xf'));var toCsv=require(_0xf0e6('0x9'));var querystring=require(_0xf0e6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0e6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf0e6('0x12'));var hardwareService=require(_0xf0e6('0x13'));var logger=require(_0xf0e6('0x14'))(_0xf0e6('0x15'));var utils=require('../../config/utils');var config=require(_0xf0e6('0x16'));var licenseUtil=require(_0xf0e6('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf0e6('0x18')](config[_0xf0e6('0x19')],{'host':_0xf0e6('0x1a'),'port':0x18eb});var socket=require(_0xf0e6('0x1b'))(new Redis(config[_0xf0e6('0x19')]));require('./chatMessage.socket')[_0xf0e6('0x1c')](socket);var jayson=require(_0xf0e6('0x1d'));var client=jayson['client'][_0xf0e6('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fb938,_0x5a31ee,_0x6ea6a6,_0x12817d){return new BPromise(function(_0x54cca5,_0x688e98){var _0x4658b5=_0x12817d||client;return _0x4658b5[_0xf0e6('0x1f')](_0x4fb938,_0x6ea6a6)[_0xf0e6('0x20')](function(_0x456f68){logger['info'](_0xf0e6('0x21'),_0x5a31ee,'request\x20sent');logger[_0xf0e6('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5a31ee,_0xf0e6('0x23'),JSON['stringify'](_0x456f68));if(_0x456f68[_0xf0e6('0x24')]){if(_0x456f68[_0xf0e6('0x24')]['code']===0x1f4){logger[_0xf0e6('0x24')](_0xf0e6('0x21'),_0x5a31ee,_0x456f68[_0xf0e6('0x24')][_0xf0e6('0x25')]);return _0x688e98(_0x456f68[_0xf0e6('0x24')][_0xf0e6('0x25')]);}logger['error'](_0xf0e6('0x21'),_0x5a31ee,_0x456f68[_0xf0e6('0x24')][_0xf0e6('0x25')]);return _0x54cca5(_0x456f68[_0xf0e6('0x24')][_0xf0e6('0x25')]);}else{logger[_0xf0e6('0x26')](_0xf0e6('0x21'),_0x5a31ee,'request\x20sent');_0x54cca5(_0x456f68[_0xf0e6('0x27')]['message']);}})[_0xf0e6('0x28')](function(_0x1adb6f){logger[_0xf0e6('0x24')](_0xf0e6('0x21'),_0x5a31ee,_0x1adb6f);_0x688e98(_0x1adb6f);});});}function respondWithStatusCode(_0xc8fddb,_0x7a6e9a){_0x7a6e9a=_0x7a6e9a||0xcc;return function(_0x141769){if(_0x141769){return _0xc8fddb['sendStatus'](_0x7a6e9a);}return _0xc8fddb[_0xf0e6('0x29')](_0x7a6e9a)[_0xf0e6('0x2a')]();};}function respondWithResult(_0x281b5a,_0x257549){_0x257549=_0x257549||0xc8;return function(_0x4b55ee){if(_0x4b55ee){return _0x281b5a['status'](_0x257549)[_0xf0e6('0x2b')](_0x4b55ee);}};}function respondWithFilteredResult(_0x325ae9,_0x395778){return function(_0x16b5db){if(_0x16b5db){var _0x537049=typeof _0x395778['offset']===_0xf0e6('0x2c')&&typeof _0x395778[_0xf0e6('0x2d')]===_0xf0e6('0x2c');var _0x3a9174=_0x16b5db[_0xf0e6('0x2e')];var _0x2c5160=_0x537049?0x0:_0x395778[_0xf0e6('0x2f')];var _0x357219=_0x537049?_0x16b5db[_0xf0e6('0x2e')]:_0x395778[_0xf0e6('0x2f')]+_0x395778[_0xf0e6('0x2d')];var _0x20064f;if(_0x357219>=_0x3a9174){_0x357219=_0x3a9174;_0x20064f=0xc8;}else{_0x20064f=0xce;}_0x325ae9[_0xf0e6('0x29')](_0x20064f);return _0x325ae9[_0xf0e6('0x30')](_0xf0e6('0x31'),_0x2c5160+'-'+_0x357219+'/'+_0x3a9174)[_0xf0e6('0x2b')](_0x16b5db);}return null;};}function patchUpdates(_0x57cec1){return function(_0x343a41){try{jsonpatch[_0xf0e6('0x32')](_0x343a41,_0x57cec1,!![]);}catch(_0x59db39){return BPromise[_0xf0e6('0x33')](_0x59db39);}return _0x343a41[_0xf0e6('0x34')]();};}function saveUpdates(_0x8e7960,_0x541491){return function(_0xdb6666){if(_0xdb6666){return _0xdb6666[_0xf0e6('0x35')](_0x8e7960)[_0xf0e6('0x20')](function(_0x4fcd36){return _0x4fcd36;});}return null;};}function removeEntity(_0x19d568,_0x82e96){return function(_0x212404){if(_0x212404){return _0x212404[_0xf0e6('0x36')]()[_0xf0e6('0x20')](function(){_0x19d568['status'](0xcc)[_0xf0e6('0x2a')]();});}};}function handleEntityNotFound(_0x54b3b2,_0x23503a){return function(_0x657589){if(!_0x657589){_0x54b3b2[_0xf0e6('0x37')](0x194);}return _0x657589;};}function handleError(_0xdedf1e,_0x3fc657){_0x3fc657=_0x3fc657||0x1f4;return function(_0x1494dd){logger['error'](_0x1494dd['stack']);if(_0x1494dd['name']){delete _0x1494dd[_0xf0e6('0x38')];}_0xdedf1e[_0xf0e6('0x29')](_0x3fc657)[_0xf0e6('0x39')](_0x1494dd);};}exports['index']=function(_0x338d04,_0x548d2c){var _0x201dad={},_0x21577a={},_0x3f9c50={'count':0x0,'rows':[]};var _0x5779b6=_[_0xf0e6('0x3a')](db[_0xf0e6('0x3b')][_0xf0e6('0x3c')],function(_0x365641){return{'name':_0x365641[_0xf0e6('0x3d')],'type':_0x365641[_0xf0e6('0x3e')][_0xf0e6('0x3f')]};});_0x21577a['model']=_[_0xf0e6('0x3a')](_0x5779b6,_0xf0e6('0x38'));_0x21577a[_0xf0e6('0x40')]=_[_0xf0e6('0x41')](_0x338d04[_0xf0e6('0x40')]);_0x21577a['filters']=_[_0xf0e6('0x42')](_0x21577a[_0xf0e6('0x43')],_0x21577a['query']);_0x201dad['attributes']=_[_0xf0e6('0x42')](_0x21577a[_0xf0e6('0x43')],qs['fields'](_0x338d04[_0xf0e6('0x40')][_0xf0e6('0x44')]));_0x201dad[_0xf0e6('0x45')]=_0x201dad[_0xf0e6('0x45')][_0xf0e6('0x46')]?_0x201dad[_0xf0e6('0x45')]:_0x21577a[_0xf0e6('0x43')];if(!_0x338d04[_0xf0e6('0x40')][_0xf0e6('0x47')]('nolimit')){_0x201dad['limit']=qs[_0xf0e6('0x2d')](_0x338d04[_0xf0e6('0x40')][_0xf0e6('0x2d')]);_0x201dad[_0xf0e6('0x2f')]=qs['offset'](_0x338d04[_0xf0e6('0x40')][_0xf0e6('0x2f')]);}_0x201dad[_0xf0e6('0x48')]=qs['sort'](_0x338d04[_0xf0e6('0x40')][_0xf0e6('0x49')]);_0x201dad[_0xf0e6('0x4a')]=qs[_0xf0e6('0x4b')](_[_0xf0e6('0x4c')](_0x338d04[_0xf0e6('0x40')],_0x21577a[_0xf0e6('0x4b')]),_0x5779b6);if(_0x338d04[_0xf0e6('0x40')]['filter']){_0x201dad['where']=_[_0xf0e6('0x4d')](_0x201dad['where'],{'$or':_[_0xf0e6('0x3a')](_0x5779b6,function(_0x11f379){if(_0x11f379[_0xf0e6('0x3e')]!==_0xf0e6('0x4e')){var _0x4d2467={};_0x4d2467[_0x11f379[_0xf0e6('0x38')]]={'$like':'%'+_0x338d04['query'][_0xf0e6('0x4f')]+'%'};return _0x4d2467;}})});}_0x201dad=_['merge']({},_0x201dad,_0x338d04[_0xf0e6('0x50')]);var _0x31f76f={'where':_0x201dad[_0xf0e6('0x4a')]};return db[_0xf0e6('0x3b')]['count'](_0x31f76f)[_0xf0e6('0x20')](function(_0x18edfb){_0x3f9c50[_0xf0e6('0x2e')]=_0x18edfb;if(_0x338d04[_0xf0e6('0x40')]['includeAll']){_0x201dad[_0xf0e6('0x51')]=[{'all':!![]}];}return db[_0xf0e6('0x3b')]['findAll'](_0x201dad);})[_0xf0e6('0x20')](function(_0x537e7a){_0x3f9c50[_0xf0e6('0x52')]=_0x537e7a;return _0x3f9c50;})['then'](respondWithFilteredResult(_0x548d2c,_0x201dad))[_0xf0e6('0x28')](handleError(_0x548d2c,null));};exports['show']=function(_0x3b1b06,_0x1ad412){var _0x96f852={'raw':!![],'where':{'id':_0x3b1b06[_0xf0e6('0x53')]['id']}},_0x436931={};_0x436931[_0xf0e6('0x43')]=_[_0xf0e6('0x41')](db[_0xf0e6('0x3b')][_0xf0e6('0x3c')]);_0x436931[_0xf0e6('0x40')]=_[_0xf0e6('0x41')](_0x3b1b06[_0xf0e6('0x40')]);_0x436931[_0xf0e6('0x4b')]=_[_0xf0e6('0x42')](_0x436931[_0xf0e6('0x43')],_0x436931[_0xf0e6('0x40')]);_0x96f852[_0xf0e6('0x45')]=_[_0xf0e6('0x42')](_0x436931[_0xf0e6('0x43')],qs[_0xf0e6('0x44')](_0x3b1b06['query'][_0xf0e6('0x44')]));_0x96f852[_0xf0e6('0x45')]=_0x96f852[_0xf0e6('0x45')]['length']?_0x96f852[_0xf0e6('0x45')]:_0x436931[_0xf0e6('0x43')];if(_0x3b1b06[_0xf0e6('0x40')]['includeAll']){_0x96f852['include']=[{'all':!![]}];}_0x96f852=_[_0xf0e6('0x4d')]({},_0x96f852,_0x3b1b06[_0xf0e6('0x50')]);return db['ChatMessage'][_0xf0e6('0x54')](_0x96f852)[_0xf0e6('0x20')](handleEntityNotFound(_0x1ad412,null))[_0xf0e6('0x20')](respondWithResult(_0x1ad412,null))[_0xf0e6('0x28')](handleError(_0x1ad412,null));};exports[_0xf0e6('0x55')]=function(_0x1db1a8,_0x84d3d){return db[_0xf0e6('0x3b')][_0xf0e6('0x55')](_0x1db1a8[_0xf0e6('0x56')],{})[_0xf0e6('0x20')](respondWithResult(_0x84d3d,0xc9))[_0xf0e6('0x28')](handleError(_0x84d3d,null));};exports[_0xf0e6('0x35')]=function(_0xf59f36,_0x7bf073){if(_0xf59f36['body']['id']){delete _0xf59f36[_0xf0e6('0x56')]['id'];}return db[_0xf0e6('0x3b')]['find']({'where':{'id':_0xf59f36[_0xf0e6('0x53')]['id']}})['then'](handleEntityNotFound(_0x7bf073,null))[_0xf0e6('0x20')](saveUpdates(_0xf59f36['body'],null))[_0xf0e6('0x20')](respondWithResult(_0x7bf073,null))[_0xf0e6('0x28')](handleError(_0x7bf073,null));};exports[_0xf0e6('0x36')]=function(_0xfd9e7c,_0x49db88){return db[_0xf0e6('0x3b')][_0xf0e6('0x54')]({'where':{'id':_0xfd9e7c[_0xf0e6('0x53')]['id']}})[_0xf0e6('0x20')](handleEntityNotFound(_0x49db88,null))[_0xf0e6('0x20')](removeEntity(_0x49db88,null))[_0xf0e6('0x28')](handleError(_0x49db88,null));};exports[_0xf0e6('0x57')]=function(_0x28f740,_0x558409){return db['ChatMessage'][_0xf0e6('0x57')]()[_0xf0e6('0x20')](respondWithResult(_0x558409,null))[_0xf0e6('0x28')](handleError(_0x558409,null));};var interaction_log=require('../../config/logger')(_0xf0e6('0x58'));exports[_0xf0e6('0x59')]=function(_0x4d5a31,_0x297265,_0x5da1aa){var _0x6f282d={'agent':{},'channel':_0xf0e6('0x5a')};if(_0x4d5a31[_0xf0e6('0x56')]['id']){delete _0x4d5a31['body']['id'];}_0x4d5a31[_0xf0e6('0x56')][_0xf0e6('0x5b')]=!![];_0x4d5a31['body'][_0xf0e6('0x5c')]=moment()[_0xf0e6('0x5d')](_0xf0e6('0x5e'));_0x4d5a31[_0xf0e6('0x56')][_0xf0e6('0x5f')]=_0x4d5a31[_0xf0e6('0x56')][_0xf0e6('0x5f')]||_0x4d5a31[_0xf0e6('0x60')]['id'];_0x6f282d[_0xf0e6('0x61')]['id']=_0x4d5a31[_0xf0e6('0x56')]['UserId'];return db[_0xf0e6('0x3b')][_0xf0e6('0x54')]({'where':{'id':_0x4d5a31['params']['id'],'UserId':null}})[_0xf0e6('0x20')](handleEntityNotFound(_0x297265,null))[_0xf0e6('0x20')](saveUpdates(_0x4d5a31[_0xf0e6('0x56')],null))['then'](function(_0x44cf57){if(_0x44cf57){_0x6f282d[_0xf0e6('0x25')]=_0x44cf57[_0xf0e6('0x62')]({'plain':!![]});return db['ChatInteraction'][_0xf0e6('0x54')]({'where':{'id':_0x44cf57[_0xf0e6('0x63')]}});}return null;})[_0xf0e6('0x20')](handleEntityNotFound(_0x297265,null))['then'](function(_0x4ca310){if(_0x4ca310){return _0x4ca310[_0xf0e6('0x35')]({'UserId':_0x4d5a31['body'][_0xf0e6('0x5f')],'read1stAt':_[_0xf0e6('0x64')](_0x4ca310['read1stAt'])?moment()[_0xf0e6('0x5d')](_0xf0e6('0x5e')):undefined});}return null;})[_0xf0e6('0x20')](function(_0x108f2e){if(_0x108f2e){_0x6f282d[_0xf0e6('0x65')]=_0x108f2e[_0xf0e6('0x62')]({'plain':!![]});interaction_log[_0xf0e6('0x26')](_0xf0e6('0x66'),_0x4d5a31['user']['id'],_0x4d5a31[_0xf0e6('0x60')]['name'],_0x4d5a31[_0xf0e6('0x60')]['role'],_0x6f282d[_0xf0e6('0x65')]['id'],_0x4d5a31[_0xf0e6('0x56')]?JSON[_0xf0e6('0x67')](_0x4d5a31[_0xf0e6('0x56')]):'null');return respondWithRpcPromise(_0xf0e6('0x68'),_0xf0e6('0x69'),_0x6f282d);}return null;})['then'](function(_0x4f14cc){var _0x410029=_0xf0e6('0x6a')+_0x4f14cc[_0xf0e6('0x25')][_0xf0e6('0x6b')];return db['sequelize']['query'](_0x410029,{'type':db[_0xf0e6('0x6c')]['QueryTypes'][_0xf0e6('0x6d')],'raw':!![]})[_0xf0e6('0x20')](function(_0x37d217){return _0x37d217;});})[_0xf0e6('0x20')](function(_0x334486){if(_0x334486){_0x6f282d[_0xf0e6('0x25')][_0xf0e6('0x6e')]=_0x334486[0x0];if(!_0x4d5a31['body']['UserId'])return;return db[_0xf0e6('0x6f')][_0xf0e6('0x54')]({'where':{'id':_0x4d5a31['body']['UserId'],'role':_0xf0e6('0x61')},'attributes':['id','name',_0xf0e6('0x70'),_0xf0e6('0x71'),_0xf0e6('0x72')],'raw':!![]});}return null;})[_0xf0e6('0x20')](function(_0x13ede0){if(!_0x13ede0)return null;_0x6f282d['message'][_0xf0e6('0x61')]=_0x13ede0;return _0x6f282d;})[_0xf0e6('0x20')](function(_0x2abba0){if(_0x2abba0){if(_0x4d5a31[_0xf0e6('0x56')]['manual']){_0x6f282d[_0xf0e6('0x25')][_0xf0e6('0x73')]=util[_0xf0e6('0x5d')](_0xf0e6('0x74'),_0x4d5a31[_0xf0e6('0x60')]['name']);_0x6f282d[_0xf0e6('0x25')]['channel']=_0x6f282d[_0xf0e6('0x75')];_0x6f282d[_0xf0e6('0x25')]['motionChannel']=_0x6f282d[_0xf0e6('0x75')];_0x6f282d['message']['event']=_0xf0e6('0x59');return respondWithRpcPromise('EventManager',_0xf0e6('0x76'),{'event':_0xf0e6('0x77'),'message':_[_0xf0e6('0x4d')](_0x6f282d[_0xf0e6('0x25')],JSON[_0xf0e6('0x78')](_0x6f282d['interaction'][_0xf0e6('0x79')]))},client9002)['then'](function(){return _0x6f282d;});}return _0x6f282d;}return null;})[_0xf0e6('0x20')](respondWithResult(_0x297265,null))['catch'](handleError(_0x297265,null));};var interaction_log=require(_0xf0e6('0x14'))(_0xf0e6('0x58'));exports[_0xf0e6('0x33')]=function(_0x281aa3,_0x49c479,_0x3194ae){var _0x5a1991={'agent':{},'channel':_0xf0e6('0x5a')};if(_0x281aa3[_0xf0e6('0x56')]['id']){delete _0x281aa3[_0xf0e6('0x56')]['id'];}_0x281aa3[_0xf0e6('0x56')]['UserId']=_0x281aa3[_0xf0e6('0x56')]['UserId']||_0x281aa3['user']['id'];_0x5a1991['agent']['id']=_0x281aa3['body']['UserId'];return db[_0xf0e6('0x3b')][_0xf0e6('0x54')]({'where':{'id':_0x281aa3[_0xf0e6('0x53')]['id'],'UserId':null}})[_0xf0e6('0x20')](handleEntityNotFound(_0x49c479,null))[_0xf0e6('0x20')](function(_0x14cc3e){if(_0x14cc3e){_0x5a1991[_0xf0e6('0x25')]=_0x14cc3e['get']({'plain':!![]});return db[_0xf0e6('0x7a')][_0xf0e6('0x54')]({'where':{'id':_0x14cc3e[_0xf0e6('0x63')]}});}return null;})[_0xf0e6('0x20')](handleEntityNotFound(_0x49c479,null))[_0xf0e6('0x20')](function(_0x4f369c){if(_0x4f369c){_0x5a1991[_0xf0e6('0x65')]=_0x4f369c[_0xf0e6('0x62')]({'plain':!![]});interaction_log[_0xf0e6('0x26')](_0xf0e6('0x7b'),_0x281aa3[_0xf0e6('0x60')]['id'],_0x281aa3[_0xf0e6('0x60')][_0xf0e6('0x38')],_0x281aa3['user']['role'],_0x5a1991[_0xf0e6('0x65')]['id'],_0x281aa3['body']?JSON[_0xf0e6('0x67')](_0x281aa3[_0xf0e6('0x56')]):_0xf0e6('0x7c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5a1991);}return null;})['then'](function(_0x2590cf){var _0x121aa2=_0xf0e6('0x6a')+_0x2590cf[_0xf0e6('0x25')]['ContactId'];return db[_0xf0e6('0x7d')][_0xf0e6('0x40')](_0x121aa2,{'type':db[_0xf0e6('0x6c')][_0xf0e6('0x7e')][_0xf0e6('0x6d')],'raw':!![]})[_0xf0e6('0x20')](function(_0x4dcefd){return _0x4dcefd;});})[_0xf0e6('0x20')](function(_0x25047e){if(_0x25047e){_0x5a1991[_0xf0e6('0x25')][_0xf0e6('0x6e')]=_0x25047e[0x0];if(!_0x281aa3['body'][_0xf0e6('0x5f')])return;return db['User'][_0xf0e6('0x54')]({'where':{'id':_0x281aa3[_0xf0e6('0x56')][_0xf0e6('0x5f')],'role':_0xf0e6('0x61')},'attributes':['id',_0xf0e6('0x38'),_0xf0e6('0x70'),_0xf0e6('0x71'),_0xf0e6('0x72')],'raw':!![]});}return null;})[_0xf0e6('0x20')](function(_0x144e32){if(!_0x144e32)return null;_0x5a1991[_0xf0e6('0x25')][_0xf0e6('0x61')]=_0x144e32;return _0x5a1991;})[_0xf0e6('0x20')](function(_0x270642){if(_0x270642){_0x270642['message'][_0xf0e6('0x73')]=util['format']('SIP/%s',_0x281aa3['user'][_0xf0e6('0x38')]);_0x270642['message'][_0xf0e6('0x75')]=_0x5a1991[_0xf0e6('0x75')];_0x270642[_0xf0e6('0x25')]['motionChannel']=_0x5a1991[_0xf0e6('0x75')];_0x270642[_0xf0e6('0x25')]['event']=_0xf0e6('0x33');respondWithRpcPromise(_0xf0e6('0x76'),_0xf0e6('0x76'),{'event':'rejectmessage','message':_[_0xf0e6('0x4d')](_0x5a1991['message'],JSON[_0xf0e6('0x78')](_0x5a1991['interaction'][_0xf0e6('0x79')]))},client9002);return _0x5a1991;}return null;})['then'](respondWithResult(_0x49c479,null))['catch'](handleError(_0x49c479,null));}; \ No newline at end of file +var _0x0b1f=['find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','agent','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','Sequelize','contact','User','fullname','event','reject','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','offset','limit','undefined','count','status','set','Content-Range','json','apply','update','then','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','fields','length','attributes','hasOwnProperty','nolimit','sort','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','intersection','include'];(function(_0x50b6ae,_0x73ddcf){var _0xf69659=function(_0x6bc03e){while(--_0x6bc03e){_0x50b6ae['push'](_0x50b6ae['shift']());}};_0xf69659(++_0x73ddcf);}(_0x0b1f,0x13d));var _0xf0b1=function(_0x4cde8c,_0x3edf65){_0x4cde8c=_0x4cde8c-0x0;var _0x52c345=_0x0b1f[_0x4cde8c];return _0x52c345;};'use strict';var emlformat=require(_0xf0b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0b1('0x1'));var jsonpatch=require(_0xf0b1('0x2'));var rp=require(_0xf0b1('0x3'));var moment=require(_0xf0b1('0x4'));var BPromise=require(_0xf0b1('0x5'));var Mustache=require('mustache');var util=require(_0xf0b1('0x6'));var path=require(_0xf0b1('0x7'));var sox=require(_0xf0b1('0x8'));var csv=require(_0xf0b1('0x9'));var ejs=require(_0xf0b1('0xa'));var fs=require('fs');var fs_extra=require(_0xf0b1('0xb'));var _=require(_0xf0b1('0xc'));var squel=require(_0xf0b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xf0b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf0b1('0xf'));var Papa=require(_0xf0b1('0x10'));var Redis=require(_0xf0b1('0x11'));var authService=require(_0xf0b1('0x12'));var qs=require(_0xf0b1('0x13'));var as=require(_0xf0b1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0b1('0x15'))(_0xf0b1('0x16'));var utils=require(_0xf0b1('0x17'));var config=require(_0xf0b1('0x18'));var licenseUtil=require(_0xf0b1('0x19'));var db=require('../../mysqldb')['db'];config[_0xf0b1('0x1a')]=_[_0xf0b1('0x1b')](config[_0xf0b1('0x1a')],{'host':_0xf0b1('0x1c'),'port':0x18eb});var socket=require(_0xf0b1('0x1d'))(new Redis(config[_0xf0b1('0x1a')]));require(_0xf0b1('0x1e'))[_0xf0b1('0x1f')](socket);var jayson=require(_0xf0b1('0x20'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xf0b1('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x195f1f,_0x544d72,_0x4318e5,_0x12fd5b){return new BPromise(function(_0x144337,_0x30bda3){var _0x3e9149=_0x12fd5b||client;return _0x3e9149[_0xf0b1('0x22')](_0x195f1f,_0x4318e5)['then'](function(_0x455869){logger['info'](_0xf0b1('0x23'),_0x544d72,'request\x20sent');logger['debug'](_0xf0b1('0x24'),_0x544d72,_0xf0b1('0x25'),JSON['stringify'](_0x455869));if(_0x455869['error']){if(_0x455869['error'][_0xf0b1('0x26')]===0x1f4){logger[_0xf0b1('0x27')](_0xf0b1('0x23'),_0x544d72,_0x455869[_0xf0b1('0x27')][_0xf0b1('0x28')]);return _0x30bda3(_0x455869[_0xf0b1('0x27')][_0xf0b1('0x28')]);}logger[_0xf0b1('0x27')](_0xf0b1('0x23'),_0x544d72,_0x455869[_0xf0b1('0x27')]['message']);return _0x144337(_0x455869[_0xf0b1('0x27')][_0xf0b1('0x28')]);}else{logger[_0xf0b1('0x29')]('ChatMessage,\x20%s,\x20%s',_0x544d72,_0xf0b1('0x25'));_0x144337(_0x455869[_0xf0b1('0x2a')][_0xf0b1('0x28')]);}})[_0xf0b1('0x2b')](function(_0x38d06a){logger[_0xf0b1('0x27')](_0xf0b1('0x23'),_0x544d72,_0x38d06a);_0x30bda3(_0x38d06a);});});}function respondWithStatusCode(_0x3cc154,_0x2451df){_0x2451df=_0x2451df||0xcc;return function(_0x1c4328){if(_0x1c4328){return _0x3cc154[_0xf0b1('0x2c')](_0x2451df);}return _0x3cc154['status'](_0x2451df)['end']();};}function respondWithResult(_0x284b2d,_0x29ade7){_0x29ade7=_0x29ade7||0xc8;return function(_0xfc1ca0){if(_0xfc1ca0){return _0x284b2d['status'](_0x29ade7)['json'](_0xfc1ca0);}};}function respondWithFilteredResult(_0xf9e84c,_0xf91222){return function(_0x83a435){if(_0x83a435){var _0x38d6c6=typeof _0xf91222[_0xf0b1('0x2d')]==='undefined'&&typeof _0xf91222[_0xf0b1('0x2e')]===_0xf0b1('0x2f');var _0x43cac6=_0x83a435[_0xf0b1('0x30')];var _0x4c471a=_0x38d6c6?0x0:_0xf91222[_0xf0b1('0x2d')];var _0x4b2158=_0x38d6c6?_0x83a435[_0xf0b1('0x30')]:_0xf91222[_0xf0b1('0x2d')]+_0xf91222[_0xf0b1('0x2e')];var _0x33233e;if(_0x4b2158>=_0x43cac6){_0x4b2158=_0x43cac6;_0x33233e=0xc8;}else{_0x33233e=0xce;}_0xf9e84c[_0xf0b1('0x31')](_0x33233e);return _0xf9e84c[_0xf0b1('0x32')](_0xf0b1('0x33'),_0x4c471a+'-'+_0x4b2158+'/'+_0x43cac6)[_0xf0b1('0x34')](_0x83a435);}return null;};}function patchUpdates(_0x2ea01a){return function(_0x258a99){try{jsonpatch[_0xf0b1('0x35')](_0x258a99,_0x2ea01a,!![]);}catch(_0x380f64){return BPromise['reject'](_0x380f64);}return _0x258a99['save']();};}function saveUpdates(_0x32cc1b,_0x114d03){return function(_0x5742fb){if(_0x5742fb){return _0x5742fb[_0xf0b1('0x36')](_0x32cc1b)[_0xf0b1('0x37')](function(_0x3f6887){return _0x3f6887;});}return null;};}function removeEntity(_0x5f3801,_0x2cdcc4){return function(_0x5f4722){if(_0x5f4722){return _0x5f4722[_0xf0b1('0x38')]()[_0xf0b1('0x37')](function(){_0x5f3801[_0xf0b1('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5175eb,_0x2feac8){return function(_0x4f7f65){if(!_0x4f7f65){_0x5175eb[_0xf0b1('0x2c')](0x194);}return _0x4f7f65;};}function handleError(_0x191f0d,_0x3a697b){_0x3a697b=_0x3a697b||0x1f4;return function(_0x405088){logger[_0xf0b1('0x27')](_0x405088[_0xf0b1('0x39')]);if(_0x405088[_0xf0b1('0x3a')]){delete _0x405088[_0xf0b1('0x3a')];}_0x191f0d[_0xf0b1('0x31')](_0x3a697b)[_0xf0b1('0x3b')](_0x405088);};}exports['index']=function(_0x34f105,_0x2a78c0){var _0x193a65={},_0x58ef5a={},_0x2bb5b8={'count':0x0,'rows':[]};var _0x36bf93=_[_0xf0b1('0x3c')](db[_0xf0b1('0x3d')][_0xf0b1('0x3e')],function(_0x38b082){return{'name':_0x38b082[_0xf0b1('0x3f')],'type':_0x38b082[_0xf0b1('0x40')]['key']};});_0x58ef5a[_0xf0b1('0x41')]=_['map'](_0x36bf93,_0xf0b1('0x3a'));_0x58ef5a[_0xf0b1('0x42')]=_[_0xf0b1('0x43')](_0x34f105[_0xf0b1('0x42')]);_0x58ef5a['filters']=_['intersection'](_0x58ef5a[_0xf0b1('0x41')],_0x58ef5a['query']);_0x193a65['attributes']=_['intersection'](_0x58ef5a[_0xf0b1('0x41')],qs['fields'](_0x34f105[_0xf0b1('0x42')][_0xf0b1('0x44')]));_0x193a65['attributes']=_0x193a65['attributes'][_0xf0b1('0x45')]?_0x193a65[_0xf0b1('0x46')]:_0x58ef5a['model'];if(!_0x34f105[_0xf0b1('0x42')][_0xf0b1('0x47')](_0xf0b1('0x48'))){_0x193a65[_0xf0b1('0x2e')]=qs[_0xf0b1('0x2e')](_0x34f105[_0xf0b1('0x42')]['limit']);_0x193a65[_0xf0b1('0x2d')]=qs['offset'](_0x34f105[_0xf0b1('0x42')]['offset']);}_0x193a65['order']=qs[_0xf0b1('0x49')](_0x34f105[_0xf0b1('0x42')][_0xf0b1('0x49')]);_0x193a65['where']=qs[_0xf0b1('0x4a')](_['pick'](_0x34f105[_0xf0b1('0x42')],_0x58ef5a[_0xf0b1('0x4a')]),_0x36bf93);if(_0x34f105[_0xf0b1('0x42')][_0xf0b1('0x4b')]){_0x193a65['where']=_[_0xf0b1('0x4c')](_0x193a65['where'],{'$or':_[_0xf0b1('0x3c')](_0x36bf93,function(_0x3b8f9d){if(_0x3b8f9d[_0xf0b1('0x40')]!==_0xf0b1('0x4d')){var _0x5104a1={};_0x5104a1[_0x3b8f9d[_0xf0b1('0x3a')]]={'$like':'%'+_0x34f105[_0xf0b1('0x42')][_0xf0b1('0x4b')]+'%'};return _0x5104a1;}})});}_0x193a65=_['merge']({},_0x193a65,_0x34f105[_0xf0b1('0x4e')]);var _0x319b63={'where':_0x193a65['where']};return db['ChatMessage'][_0xf0b1('0x30')](_0x319b63)['then'](function(_0xfc97f5){_0x2bb5b8[_0xf0b1('0x30')]=_0xfc97f5;if(_0x34f105['query'][_0xf0b1('0x4f')]){_0x193a65['include']=[{'all':!![]}];}return db[_0xf0b1('0x3d')][_0xf0b1('0x50')](_0x193a65);})[_0xf0b1('0x37')](function(_0x494684){_0x2bb5b8[_0xf0b1('0x51')]=_0x494684;return _0x2bb5b8;})[_0xf0b1('0x37')](respondWithFilteredResult(_0x2a78c0,_0x193a65))[_0xf0b1('0x2b')](handleError(_0x2a78c0,null));};exports['show']=function(_0x550166,_0x56875e){var _0x5e8cd9={'raw':!![],'where':{'id':_0x550166[_0xf0b1('0x52')]['id']}},_0x1870c1={};_0x1870c1[_0xf0b1('0x41')]=_[_0xf0b1('0x43')](db[_0xf0b1('0x3d')][_0xf0b1('0x3e')]);_0x1870c1[_0xf0b1('0x42')]=_[_0xf0b1('0x43')](_0x550166[_0xf0b1('0x42')]);_0x1870c1['filters']=_[_0xf0b1('0x53')](_0x1870c1[_0xf0b1('0x41')],_0x1870c1[_0xf0b1('0x42')]);_0x5e8cd9[_0xf0b1('0x46')]=_['intersection'](_0x1870c1[_0xf0b1('0x41')],qs[_0xf0b1('0x44')](_0x550166[_0xf0b1('0x42')][_0xf0b1('0x44')]));_0x5e8cd9[_0xf0b1('0x46')]=_0x5e8cd9['attributes'][_0xf0b1('0x45')]?_0x5e8cd9[_0xf0b1('0x46')]:_0x1870c1[_0xf0b1('0x41')];if(_0x550166[_0xf0b1('0x42')][_0xf0b1('0x4f')]){_0x5e8cd9[_0xf0b1('0x54')]=[{'all':!![]}];}_0x5e8cd9=_[_0xf0b1('0x4c')]({},_0x5e8cd9,_0x550166[_0xf0b1('0x4e')]);return db[_0xf0b1('0x3d')][_0xf0b1('0x55')](_0x5e8cd9)[_0xf0b1('0x37')](handleEntityNotFound(_0x56875e,null))[_0xf0b1('0x37')](respondWithResult(_0x56875e,null))['catch'](handleError(_0x56875e,null));};exports[_0xf0b1('0x56')]=function(_0x57a82b,_0x5a2fea){return db[_0xf0b1('0x3d')][_0xf0b1('0x56')](_0x57a82b['body'],{})[_0xf0b1('0x37')](respondWithResult(_0x5a2fea,0xc9))[_0xf0b1('0x2b')](handleError(_0x5a2fea,null));};exports[_0xf0b1('0x36')]=function(_0x236fcf,_0x28051d){if(_0x236fcf[_0xf0b1('0x57')]['id']){delete _0x236fcf['body']['id'];}return db['ChatMessage'][_0xf0b1('0x55')]({'where':{'id':_0x236fcf['params']['id']}})[_0xf0b1('0x37')](handleEntityNotFound(_0x28051d,null))['then'](saveUpdates(_0x236fcf['body'],null))[_0xf0b1('0x37')](respondWithResult(_0x28051d,null))[_0xf0b1('0x2b')](handleError(_0x28051d,null));};exports['destroy']=function(_0x4cc85e,_0x59c161){return db[_0xf0b1('0x3d')][_0xf0b1('0x55')]({'where':{'id':_0x4cc85e['params']['id']}})[_0xf0b1('0x37')](handleEntityNotFound(_0x59c161,null))[_0xf0b1('0x37')](removeEntity(_0x59c161,null))[_0xf0b1('0x2b')](handleError(_0x59c161,null));};exports[_0xf0b1('0x58')]=function(_0x14411a,_0x1aa0cd){return db['ChatMessage'][_0xf0b1('0x58')]()['then'](respondWithResult(_0x1aa0cd,null))[_0xf0b1('0x2b')](handleError(_0x1aa0cd,null));};var interaction_log=require(_0xf0b1('0x15'))(_0xf0b1('0x59'));exports[_0xf0b1('0x5a')]=function(_0x4eca1e,_0x5a27c2,_0x400af7){var _0x39b766={'agent':{},'channel':'chat'};if(_0x4eca1e[_0xf0b1('0x57')]['id']){delete _0x4eca1e[_0xf0b1('0x57')]['id'];}_0x4eca1e[_0xf0b1('0x57')]['read']=!![];_0x4eca1e[_0xf0b1('0x57')][_0xf0b1('0x5b')]=moment()[_0xf0b1('0x5c')](_0xf0b1('0x5d'));_0x4eca1e['body'][_0xf0b1('0x5e')]=_0x4eca1e[_0xf0b1('0x57')][_0xf0b1('0x5e')]||_0x4eca1e[_0xf0b1('0x5f')]['id'];_0x39b766['agent']['id']=_0x4eca1e[_0xf0b1('0x57')]['UserId'];return db['ChatMessage'][_0xf0b1('0x55')]({'where':{'id':_0x4eca1e[_0xf0b1('0x52')]['id'],'UserId':null}})[_0xf0b1('0x37')](handleEntityNotFound(_0x5a27c2,null))[_0xf0b1('0x37')](saveUpdates(_0x4eca1e[_0xf0b1('0x57')],null))['then'](function(_0x14af47){if(_0x14af47){_0x39b766[_0xf0b1('0x28')]=_0x14af47[_0xf0b1('0x60')]({'plain':!![]});return db[_0xf0b1('0x61')][_0xf0b1('0x55')]({'where':{'id':_0x14af47[_0xf0b1('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5a27c2,null))[_0xf0b1('0x37')](function(_0x5f06e0){if(_0x5f06e0){return _0x5f06e0[_0xf0b1('0x36')]({'UserId':_0x4eca1e[_0xf0b1('0x57')][_0xf0b1('0x5e')],'read1stAt':_[_0xf0b1('0x63')](_0x5f06e0[_0xf0b1('0x64')])?moment()[_0xf0b1('0x5c')](_0xf0b1('0x5d')):undefined});}return null;})[_0xf0b1('0x37')](function(_0x4932cb){if(_0x4932cb){_0x39b766[_0xf0b1('0x65')]=_0x4932cb[_0xf0b1('0x60')]({'plain':!![]});interaction_log[_0xf0b1('0x29')](_0xf0b1('0x66'),_0x4eca1e[_0xf0b1('0x5f')]['id'],_0x4eca1e[_0xf0b1('0x5f')]['name'],_0x4eca1e[_0xf0b1('0x5f')][_0xf0b1('0x67')],_0x39b766[_0xf0b1('0x65')]['id'],_0x4eca1e[_0xf0b1('0x57')]?JSON[_0xf0b1('0x68')](_0x4eca1e['body']):_0xf0b1('0x69'));return respondWithRpcPromise(_0xf0b1('0x6a'),_0xf0b1('0x6b'),_0x39b766);}return null;})[_0xf0b1('0x37')](function(_0x192cbe){var _0x2c918e=_0xf0b1('0x6c')+_0x192cbe[_0xf0b1('0x28')][_0xf0b1('0x6d')];return db['sequelize'][_0xf0b1('0x42')](_0x2c918e,{'type':db['Sequelize'][_0xf0b1('0x6e')][_0xf0b1('0x6f')],'raw':!![]})[_0xf0b1('0x37')](function(_0x4d7161){return _0x4d7161;});})['then'](function(_0x59c670){if(_0x59c670){_0x39b766[_0xf0b1('0x28')]['contact']=_0x59c670[0x0];if(!_0x4eca1e['body'][_0xf0b1('0x5e')])return;return db['User'][_0xf0b1('0x55')]({'where':{'id':_0x4eca1e[_0xf0b1('0x57')]['UserId'],'role':_0xf0b1('0x70')},'attributes':['id',_0xf0b1('0x3a'),'fullname',_0xf0b1('0x71'),_0xf0b1('0x72')],'raw':!![]});}return null;})[_0xf0b1('0x37')](function(_0x3cb12c){if(!_0x3cb12c)return null;_0x39b766['message'][_0xf0b1('0x70')]=_0x3cb12c;return _0x39b766;})['then'](function(_0x1fae20){if(_0x1fae20){if(_0x4eca1e[_0xf0b1('0x57')]['manual']){_0x39b766[_0xf0b1('0x28')][_0xf0b1('0x73')]=util[_0xf0b1('0x5c')](_0xf0b1('0x74'),_0x4eca1e[_0xf0b1('0x5f')][_0xf0b1('0x3a')]);_0x39b766[_0xf0b1('0x28')]['channel']=_0x39b766[_0xf0b1('0x75')];_0x39b766[_0xf0b1('0x28')][_0xf0b1('0x76')]=_0x39b766[_0xf0b1('0x75')];_0x39b766['message']['event']=_0xf0b1('0x5a');return respondWithRpcPromise(_0xf0b1('0x77'),_0xf0b1('0x77'),{'event':_0xf0b1('0x78'),'message':_[_0xf0b1('0x4c')](_0x39b766[_0xf0b1('0x28')],JSON[_0xf0b1('0x79')](_0x39b766['interaction'][_0xf0b1('0x7a')]))},client9002)[_0xf0b1('0x37')](function(){return _0x39b766;});}return _0x39b766;}return null;})[_0xf0b1('0x37')](respondWithResult(_0x5a27c2,null))[_0xf0b1('0x2b')](handleError(_0x5a27c2,null));};var interaction_log=require(_0xf0b1('0x15'))(_0xf0b1('0x59'));exports['reject']=function(_0x407f0e,_0x4b41a6,_0x3abf97){var _0x3f72fa={'agent':{},'channel':_0xf0b1('0x7b')};if(_0x407f0e[_0xf0b1('0x57')]['id']){delete _0x407f0e[_0xf0b1('0x57')]['id'];}_0x407f0e[_0xf0b1('0x57')][_0xf0b1('0x5e')]=_0x407f0e[_0xf0b1('0x57')][_0xf0b1('0x5e')]||_0x407f0e[_0xf0b1('0x5f')]['id'];_0x3f72fa[_0xf0b1('0x70')]['id']=_0x407f0e[_0xf0b1('0x57')][_0xf0b1('0x5e')];return db[_0xf0b1('0x3d')][_0xf0b1('0x55')]({'where':{'id':_0x407f0e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b41a6,null))[_0xf0b1('0x37')](function(_0x6e5ef1){if(_0x6e5ef1){_0x3f72fa['message']=_0x6e5ef1[_0xf0b1('0x60')]({'plain':!![]});return db['ChatInteraction'][_0xf0b1('0x55')]({'where':{'id':_0x6e5ef1[_0xf0b1('0x62')]}});}return null;})[_0xf0b1('0x37')](handleEntityNotFound(_0x4b41a6,null))[_0xf0b1('0x37')](function(_0x24fe4c){if(_0x24fe4c){_0x3f72fa[_0xf0b1('0x65')]=_0x24fe4c['get']({'plain':!![]});interaction_log[_0xf0b1('0x29')](_0xf0b1('0x7c'),_0x407f0e['user']['id'],_0x407f0e[_0xf0b1('0x5f')][_0xf0b1('0x3a')],_0x407f0e[_0xf0b1('0x5f')]['role'],_0x3f72fa[_0xf0b1('0x65')]['id'],_0x407f0e[_0xf0b1('0x57')]?JSON['stringify'](_0x407f0e['body']):'null');return respondWithRpcPromise('RejectMessage',_0xf0b1('0x7d'),_0x3f72fa);}return null;})[_0xf0b1('0x37')](function(_0xd37ef3){var _0x43484b=_0xf0b1('0x6c')+_0xd37ef3[_0xf0b1('0x28')][_0xf0b1('0x6d')];return db[_0xf0b1('0x7e')][_0xf0b1('0x42')](_0x43484b,{'type':db[_0xf0b1('0x7f')][_0xf0b1('0x6e')]['SELECT'],'raw':!![]})[_0xf0b1('0x37')](function(_0x21d39f){return _0x21d39f;});})['then'](function(_0x59af65){if(_0x59af65){_0x3f72fa[_0xf0b1('0x28')][_0xf0b1('0x80')]=_0x59af65[0x0];if(!_0x407f0e[_0xf0b1('0x57')][_0xf0b1('0x5e')])return;return db[_0xf0b1('0x81')][_0xf0b1('0x55')]({'where':{'id':_0x407f0e['body'][_0xf0b1('0x5e')],'role':_0xf0b1('0x70')},'attributes':['id','name',_0xf0b1('0x82'),_0xf0b1('0x71'),_0xf0b1('0x72')],'raw':!![]});}return null;})[_0xf0b1('0x37')](function(_0x2b046d){if(!_0x2b046d)return null;_0x3f72fa[_0xf0b1('0x28')][_0xf0b1('0x70')]=_0x2b046d;return _0x3f72fa;})[_0xf0b1('0x37')](function(_0x4695ab){if(_0x4695ab){_0x4695ab[_0xf0b1('0x28')][_0xf0b1('0x73')]=util[_0xf0b1('0x5c')](_0xf0b1('0x74'),_0x407f0e[_0xf0b1('0x5f')][_0xf0b1('0x3a')]);_0x4695ab[_0xf0b1('0x28')][_0xf0b1('0x75')]=_0x3f72fa[_0xf0b1('0x75')];_0x4695ab[_0xf0b1('0x28')][_0xf0b1('0x76')]=_0x3f72fa[_0xf0b1('0x75')];_0x4695ab[_0xf0b1('0x28')][_0xf0b1('0x83')]=_0xf0b1('0x84');respondWithRpcPromise(_0xf0b1('0x77'),_0xf0b1('0x77'),{'event':_0xf0b1('0x85'),'message':_[_0xf0b1('0x4c')](_0x3f72fa[_0xf0b1('0x28')],JSON[_0xf0b1('0x79')](_0x3f72fa['interaction'][_0xf0b1('0x7a')]))},client9002);return _0x3f72fa;}return null;})[_0xf0b1('0x37')](respondWithResult(_0x4b41a6,null))[_0xf0b1('0x2b')](handleError(_0x4b41a6,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0ff8298..2c385d3 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 _0x8b05=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5dcdca,_0x5777ac){var _0xba2bf4=function(_0x3e2d2d){while(--_0x3e2d2d){_0x5dcdca['push'](_0x5dcdca['shift']());}};_0xba2bf4(++_0x5777ac);}(_0x8b05,0x13f));var _0x58b0=function(_0x169a05,_0x27b5a1){_0x169a05=_0x169a05-0x0;var _0x1b21cd=_0x8b05[_0x169a05];return _0x1b21cd;};'use strict';var EventEmitter=require(_0x58b0('0x0'));var ChatMessage=require(_0x58b0('0x1'))['db'][_0x58b0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x58b0('0x3')](0x0);var events={'afterCreate':_0x58b0('0x4'),'afterUpdate':_0x58b0('0x5'),'afterDestroy':_0x58b0('0x6')};function emitEvent(_0x14c1a7){return function(_0x92b6f7,_0x65a4a8,_0x3c8223){ChatMessageEvents[_0x58b0('0x7')](_0x14c1a7+':'+_0x92b6f7['id'],_0x92b6f7);ChatMessageEvents[_0x58b0('0x7')](_0x14c1a7,_0x92b6f7);_0x3c8223(null);};}for(var e in events){if(events[_0x58b0('0x8')](e)){var event=events[e];ChatMessage[_0x58b0('0x9')](e,emitEvent(event));}}module[_0x58b0('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x8a14=['ChatMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8a14,0xf1));var _0x48a1=function(_0x1da588,_0x38c457){_0x1da588=_0x1da588-0x0;var _0x177ead=_0x8a14[_0x1da588];return _0x177ead;};'use strict';var EventEmitter=require(_0x48a1('0x0'));var ChatMessage=require(_0x48a1('0x1'))['db'][_0x48a1('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48a1('0x3'),'afterUpdate':_0x48a1('0x4'),'afterDestroy':_0x48a1('0x5')};function emitEvent(_0x23e667){return function(_0x1cc613,_0x72851,_0x1564e5){ChatMessageEvents['emit'](_0x23e667+':'+_0x1cc613['id'],_0x1cc613);ChatMessageEvents[_0x48a1('0x6')](_0x23e667,_0x1cc613);_0x1564e5(null);};}for(var e in events){if(events[_0x48a1('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x48a1('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b6a8d11..f0b000e 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 _0xb4e5=['FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','createdAt','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body'];(function(_0x271e8f,_0x11d9df){var _0xbebc63=function(_0x44ccf9){while(--_0x44ccf9){_0x271e8f['push'](_0x271e8f['shift']());}};_0xbebc63(++_0x11d9df);}(_0xb4e5,0x17a));var _0x5b4e=function(_0x38f3a6,_0x4c9679){_0x38f3a6=_0x38f3a6-0x0;var _0x3a6070=_0xb4e5[_0x38f3a6];return _0x3a6070;};'use strict';var _=require('lodash');var util=require(_0x5b4e('0x0'));var logger=require(_0x5b4e('0x1'))(_0x5b4e('0x2'));var moment=require(_0x5b4e('0x3'));var BPromise=require(_0x5b4e('0x4'));var rp=require(_0x5b4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b4e('0x6'));var config=require(_0x5b4e('0x7'));var attributes=require(_0x5b4e('0x8'));module[_0x5b4e('0x9')]=function(_0x3c5c6b,_0x5420b8){return _0x3c5c6b[_0x5b4e('0xa')](_0x5b4e('0xb'),attributes,{'tableName':_0x5b4e('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5b4e('0xd')],'type':_0x5b4e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4df5fe,_0x1d6ebe,_0x4a1abf){var _0x5501b2=_0x3c5c6b[_0x5b4e('0xf')];var _0x12b231=_0x4df5fe[_0x5b4e('0x10')]({'plain':!![]});if(_0x12b231[_0x5b4e('0x11')][_0x5b4e('0x12')]()==='in'||_0x12b231[_0x5b4e('0x11')][_0x5b4e('0x12')]()===_0x5b4e('0x13')&&!_0x12b231[_0x5b4e('0x14')]&&!_['isNil'](_0x12b231[_0x5b4e('0x15')])){_0x5501b2[_0x5b4e('0x16')][_0x5b4e('0x17')]({'where':{'id':_0x12b231['ChatInteractionId']}})[_0x5b4e('0x18')](function(_0x4ef56f){if(_0x4ef56f){_0x4ef56f['update']({'lastMsgAt':_0x12b231[_0x5b4e('0x19')],'lastMsgDirection':_0x12b231['direction'][_0x5b4e('0x12')]()});}})[_0x5b4e('0x1a')](function(_0x56210f){console['error'](_0x56210f);});}_0x4a1abf();}},'charset':'utf8mb4','collate':_0x5b4e('0x1b')});}; \ No newline at end of file +var _0x1be3=['fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','utf8mb4','lodash','../../config/logger','moment','bluebird','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x4512df,_0x3ebc31){var _0x3b3805=function(_0xc8a2b6){while(--_0xc8a2b6){_0x4512df['push'](_0x4512df['shift']());}};_0x3b3805(++_0x3ebc31);}(_0x1be3,0x13c));var _0x31be=function(_0x1a7068,_0x33e74f){_0x1a7068=_0x1a7068-0x0;var _0x38763f=_0x1be3[_0x1a7068];return _0x38763f;};'use strict';var _=require(_0x31be('0x0'));var util=require('util');var logger=require(_0x31be('0x1'))('api');var moment=require(_0x31be('0x2'));var BPromise=require(_0x31be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x31be('0x4'));var attributes=require(_0x31be('0x5'));module[_0x31be('0x6')]=function(_0x528c97,_0x3983ae){return _0x528c97[_0x31be('0x7')](_0x31be('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x31be('0x9'),'fields':[_0x31be('0xa')],'type':_0x31be('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x142d38,_0x2f6f17,_0x4d3810){var _0x178373=_0x528c97[_0x31be('0xc')];var _0x221cd8=_0x142d38[_0x31be('0xd')]({'plain':!![]});if(_0x221cd8[_0x31be('0xe')][_0x31be('0xf')]()==='in'||_0x221cd8[_0x31be('0xe')][_0x31be('0xf')]()==='out'&&!_0x221cd8[_0x31be('0x10')]&&!_[_0x31be('0x11')](_0x221cd8[_0x31be('0x12')])){_0x178373[_0x31be('0x13')][_0x31be('0x14')]({'where':{'id':_0x221cd8[_0x31be('0x15')]}})['then'](function(_0x59216f){if(_0x59216f){_0x59216f['update']({'lastMsgAt':_0x221cd8[_0x31be('0x16')],'lastMsgDirection':_0x221cd8[_0x31be('0xe')][_0x31be('0xf')]()});}})[_0x31be('0x17')](function(_0xadea5c){console['error'](_0xadea5c);});}_0x4d3810();}},'charset':_0x31be('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 62b4776..bf272c1 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 _0x8ead=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x8ead,0x133));var _0xd8ea=function(_0x20663b,_0x56840f){_0x20663b=_0x20663b-0x0;var _0x1f502b=_0x8ead[_0x20663b];return _0x1f502b;};'use strict';var _=require(_0xd8ea('0x0'));var util=require('util');var moment=require(_0xd8ea('0x1'));var BPromise=require(_0xd8ea('0x2'));var rs=require(_0xd8ea('0x3'));var fs=require('fs');var Redis=require(_0xd8ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd8ea('0x5'))(_0xd8ea('0x6'));var config=require(_0xd8ea('0x7'));var jayson=require(_0xd8ea('0x8'));var client=jayson[_0xd8ea('0x9')][_0xd8ea('0xa')]({'port':0x232a});config[_0xd8ea('0xb')]=_[_0xd8ea('0xc')](config['redis'],{'host':_0xd8ea('0xd'),'port':0x18eb});var socket=require(_0xd8ea('0xe'))(new Redis(config[_0xd8ea('0xb')]));require(_0xd8ea('0xf'))['register'](socket);function respondWithRpcPromise(_0x570f57,_0x171080,_0x2a986a){return new BPromise(function(_0x37ece3,_0x42983c){return client[_0xd8ea('0x10')](_0x570f57,_0x2a986a)[_0xd8ea('0x11')](function(_0x196fb5){logger[_0xd8ea('0x12')]('ChatMessage,\x20%s,\x20%s',_0x171080,_0xd8ea('0x13'));logger[_0xd8ea('0x14')](_0xd8ea('0x15'),_0x171080,'request\x20sent',JSON[_0xd8ea('0x16')](_0x196fb5));if(_0x196fb5['error']){if(_0x196fb5[_0xd8ea('0x17')][_0xd8ea('0x18')]===0x1f4){logger[_0xd8ea('0x17')](_0xd8ea('0x19'),_0x171080,_0x196fb5[_0xd8ea('0x17')]['message']);return _0x42983c(_0x196fb5[_0xd8ea('0x17')][_0xd8ea('0x1a')]);}logger[_0xd8ea('0x17')]('ChatMessage,\x20%s,\x20%s',_0x171080,_0x196fb5[_0xd8ea('0x17')]['message']);return _0x37ece3(_0x196fb5[_0xd8ea('0x17')][_0xd8ea('0x1a')]);}else{logger[_0xd8ea('0x12')](_0xd8ea('0x19'),_0x171080,'request\x20sent');_0x37ece3(_0x196fb5[_0xd8ea('0x1b')][_0xd8ea('0x1a')]);}})[_0xd8ea('0x1c')](function(_0x5d2cbe){logger[_0xd8ea('0x17')]('ChatMessage,\x20%s,\x20%s',_0x171080,_0x5d2cbe);_0x42983c(_0x5d2cbe);});});}exports[_0xd8ea('0x1d')]=function(_0x8399ba){var _0x1657c7=this;return new Promise(function(_0xd0138d,_0x19eb04){return db[_0xd8ea('0x1e')][_0xd8ea('0x1f')](_0x8399ba[_0xd8ea('0x20')],{'raw':_0x8399ba[_0xd8ea('0x21')]?_0x8399ba['options'][_0xd8ea('0x22')]===undefined?!![]:![]:!![]})[_0xd8ea('0x11')](function(_0x5ec22f){logger['info'](_0xd8ea('0x1d'),_0x8399ba);logger[_0xd8ea('0x14')](_0xd8ea('0x1d'),_0x8399ba,JSON[_0xd8ea('0x16')](_0x5ec22f));_0xd0138d(_0x5ec22f);})[_0xd8ea('0x1c')](function(_0x1b35b0){logger[_0xd8ea('0x17')](_0xd8ea('0x1d'),_0x1b35b0['message'],_0x8399ba);_0x19eb04(_0x1657c7[_0xd8ea('0x17')](0x1f4,_0x1b35b0['message']));});});}; \ No newline at end of file +var _0x00bc=['register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','defaults','socket.io-emitter','./chatMessage.socket'];(function(_0x2aadfa,_0x52f21e){var _0x3df269=function(_0x392d66){while(--_0x392d66){_0x2aadfa['push'](_0x2aadfa['shift']());}};_0x3df269(++_0x52f21e);}(_0x00bc,0x17c));var _0xc00b=function(_0xc04cc2,_0x566fe8){_0xc04cc2=_0xc04cc2-0x0;var _0x5ae70d=_0x00bc[_0xc04cc2];return _0x5ae70d;};'use strict';var _=require(_0xc00b('0x0'));var util=require(_0xc00b('0x1'));var moment=require(_0xc00b('0x2'));var BPromise=require(_0xc00b('0x3'));var rs=require(_0xc00b('0x4'));var fs=require('fs');var Redis=require(_0xc00b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc00b('0x6'));var config=require('../../config/environment');var jayson=require(_0xc00b('0x7'));var client=jayson['client'][_0xc00b('0x8')]({'port':0x232a});config['redis']=_[_0xc00b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc00b('0xa'))(new Redis(config['redis']));require(_0xc00b('0xb'))[_0xc00b('0xc')](socket);function respondWithRpcPromise(_0x582dc5,_0xf6382d,_0x4ca354){return new BPromise(function(_0x357cb4,_0x1e0848){return client[_0xc00b('0xd')](_0x582dc5,_0x4ca354)[_0xc00b('0xe')](function(_0xcef4b7){logger[_0xc00b('0xf')](_0xc00b('0x10'),_0xf6382d,_0xc00b('0x11'));logger[_0xc00b('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xf6382d,_0xc00b('0x11'),JSON[_0xc00b('0x13')](_0xcef4b7));if(_0xcef4b7[_0xc00b('0x14')]){if(_0xcef4b7['error']['code']===0x1f4){logger[_0xc00b('0x14')](_0xc00b('0x10'),_0xf6382d,_0xcef4b7['error']['message']);return _0x1e0848(_0xcef4b7['error']['message']);}logger['error'](_0xc00b('0x10'),_0xf6382d,_0xcef4b7[_0xc00b('0x14')][_0xc00b('0x15')]);return _0x357cb4(_0xcef4b7[_0xc00b('0x14')]['message']);}else{logger[_0xc00b('0xf')](_0xc00b('0x10'),_0xf6382d,_0xc00b('0x11'));_0x357cb4(_0xcef4b7[_0xc00b('0x16')][_0xc00b('0x15')]);}})[_0xc00b('0x17')](function(_0x5d8afa){logger['error'](_0xc00b('0x10'),_0xf6382d,_0x5d8afa);_0x1e0848(_0x5d8afa);});});}exports[_0xc00b('0x18')]=function(_0x79d129){var _0x5aa4c6=this;return new Promise(function(_0x5414f0,_0x2347bc){return db['ChatMessage'][_0xc00b('0x19')](_0x79d129[_0xc00b('0x1a')],{'raw':_0x79d129[_0xc00b('0x1b')]?_0x79d129['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5322d4){logger[_0xc00b('0xf')](_0xc00b('0x18'),_0x79d129);logger['debug'](_0xc00b('0x18'),_0x79d129,JSON[_0xc00b('0x13')](_0x5322d4));_0x5414f0(_0x5322d4);})['catch'](function(_0x32572c){logger[_0xc00b('0x14')](_0xc00b('0x18'),_0x32572c[_0xc00b('0x15')],_0x79d129);_0x2347bc(_0x5aa4c6[_0xc00b('0x14')](0x1f4,_0x32572c['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 5c71e0c..3e81c69 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 _0xf3cc=['update','emit','removeListener','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0xf3cc,0x10d));var _0xcf3c=function(_0xae7883,_0xabf9c8){_0xae7883=_0xae7883-0x0;var _0xd55326=_0xf3cc[_0xae7883];return _0xd55326;};'use strict';var ChatMessageEvents=require(_0xcf3c('0x0'));var events=[_0xcf3c('0x1'),_0xcf3c('0x2'),_0xcf3c('0x3')];function createListener(_0x48d2a6,_0x3b60ce){return function(_0x14ec9a){_0x3b60ce[_0xcf3c('0x4')](_0x48d2a6,_0x14ec9a);};}function removeListener(_0x582153,_0x2e0b47){return function(){ChatMessageEvents[_0xcf3c('0x5')](_0x582153,_0x2e0b47);};}exports['register']=function(_0x41f804){for(var _0x2b5cae=0x0,_0x35cb18=events[_0xcf3c('0x6')];_0x2b5cae<_0x35cb18;_0x2b5cae++){var _0x11deda=events[_0x2b5cae];var _0x147e12=createListener(_0xcf3c('0x7')+_0x11deda,_0x41f804);ChatMessageEvents['on'](_0x11deda,_0x147e12);}}; \ No newline at end of file +var _0x7412=['update','chatMessage:','./chatMessage.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7412,0x161));var _0x2741=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x7412[_0x44946b];return _0x249bc4;};'use strict';var ChatMessageEvents=require(_0x2741('0x0'));var events=['save','remove',_0x2741('0x1')];function createListener(_0x5866ac,_0x3897d4){return function(_0x50a90f){_0x3897d4['emit'](_0x5866ac,_0x50a90f);};}function removeListener(_0x509ce6,_0x552836){return function(){ChatMessageEvents['removeListener'](_0x509ce6,_0x552836);};}exports['register']=function(_0x23985b){for(var _0xcc6e28=0x0,_0x415623=events['length'];_0xcc6e28<_0x415623;_0xcc6e28++){var _0x1f1f0d=events[_0xcc6e28];var _0x1f1451=createListener(_0x2741('0x2')+_0x1f1f0d,_0x23985b);ChatMessageEvents['on'](_0x1f1f0d,_0x1f1451);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index d8f0ec9..1b4e00c 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 _0xb4cc=['create','put','/:id','update','/:id/accept','reject','delete','destroy','exports','multer','util','path','Router','fs-extra','./chatMessage.controller','get','isAuthenticated','index','show','post','chat','chatmessage:create'];(function(_0xc749c1,_0x55133f){var _0x3f4865=function(_0x7a9476){while(--_0x7a9476){_0xc749c1['push'](_0xc749c1['shift']());}};_0x3f4865(++_0x55133f);}(_0xb4cc,0x77));var _0xcb4c=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xb4cc[_0x39cf70];return _0x580424;};'use strict';var multer=require(_0xcb4c('0x0'));var util=require(_0xcb4c('0x1'));var path=require(_0xcb4c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcb4c('0x3')]();var fs_extra=require(_0xcb4c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcb4c('0x5'));router[_0xcb4c('0x6')]('/',auth[_0xcb4c('0x7')](),controller[_0xcb4c('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xcb4c('0x7')](),controller[_0xcb4c('0x9')]);router[_0xcb4c('0xa')]('/',auth[_0xcb4c('0x7')](),interaction['tracked'](_0xcb4c('0xb'),_0xcb4c('0xc')),controller[_0xcb4c('0xd')]);router[_0xcb4c('0xe')](_0xcb4c('0xf'),controller[_0xcb4c('0x10')]);router[_0xcb4c('0xe')](_0xcb4c('0x11'),auth[_0xcb4c('0x7')](),controller['accept']);router[_0xcb4c('0xe')]('/:id/reject',auth[_0xcb4c('0x7')](),controller[_0xcb4c('0x12')]);router[_0xcb4c('0x13')]('/:id',auth[_0xcb4c('0x7')](),controller[_0xcb4c('0x14')]);module[_0xcb4c('0x15')]=router; \ No newline at end of file +var _0x45c8=['accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','tracked','chat','chatmessage:create','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45c8,0x1ae));var _0x845c=function(_0xfce8c3,_0x2be5d8){_0xfce8c3=_0xfce8c3-0x0;var _0x25f676=_0x45c8[_0xfce8c3];return _0x25f676;};'use strict';var multer=require(_0x845c('0x0'));var util=require(_0x845c('0x1'));var path=require(_0x845c('0x2'));var timeout=require(_0x845c('0x3'));var express=require(_0x845c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x845c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x845c('0x6'));var controller=require(_0x845c('0x7'));router[_0x845c('0x8')]('/',auth[_0x845c('0x9')](),controller[_0x845c('0xa')]);router[_0x845c('0x8')](_0x845c('0xb'),auth[_0x845c('0x9')](),controller['describe']);router[_0x845c('0x8')](_0x845c('0xc'),auth['isAuthenticated'](),controller[_0x845c('0xd')]);router['post']('/',auth[_0x845c('0x9')](),interaction[_0x845c('0xe')](_0x845c('0xf'),_0x845c('0x10')),controller[_0x845c('0x11')]);router[_0x845c('0x12')](_0x845c('0xc'),controller[_0x845c('0x13')]);router[_0x845c('0x12')]('/:id/accept',auth[_0x845c('0x9')](),controller[_0x845c('0x14')]);router['put'](_0x845c('0x15'),auth[_0x845c('0x9')](),controller[_0x845c('0x16')]);router[_0x845c('0x17')](_0x845c('0xc'),auth['isAuthenticated'](),controller[_0x845c('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index d79fcb1..eb8d8e2 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4c1b76,_0x2cdc2d){_0x4c1b76=_0x4c1b76-0x0;var _0x3ace6b=_0x0b0e[_0x4c1b76];return _0x3ace6b;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['medium','TEXT','exports'];(function(_0x507f1f,_0x20c468){var _0x7e311d=function(_0x345628){while(--_0x345628){_0x507f1f['push'](_0x507f1f['shift']());}};_0x7e311d(++_0x20c468);}(_0xadb5,0xad));var _0x5adb=function(_0x5cb838,_0x46a87e){_0x5cb838=_0x5cb838-0x0;var _0x50b772=_0xadb5[_0x5cb838];return _0x50b772;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index e912f08..841a799 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x11b9ba,_0x38f21d){_0x11b9ba=_0x11b9ba-0x0;var _0x2c478f=_0x7a54[_0x11b9ba];return _0x2c478f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7a54,0x106));var _0x47a5=function(_0xa820aa,_0x50a39e){_0xa820aa=_0xa820aa-0x0;var _0x1d4836=_0x7a54[_0xa820aa];return _0x1d4836;};'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 11a901c..d656108 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 _0xee3a=['hook','exports','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xee3a,0xb8));var _0xaee3=function(_0x570f55,_0x5e8903){_0x570f55=_0x570f55-0x0;var _0x4ad6d1=_0xee3a[_0x570f55];return _0x4ad6d1;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xaee3('0x0')](0x0);var events={'afterCreate':_0xaee3('0x1'),'afterUpdate':_0xaee3('0x2'),'afterDestroy':'remove'};function emitEvent(_0x142a57){return function(_0x439c09,_0x46649e,_0x4ae54c){ChatOfflineMessageEvents[_0xaee3('0x3')](_0x142a57+':'+_0x439c09['id'],_0x439c09);ChatOfflineMessageEvents[_0xaee3('0x3')](_0x142a57,_0x439c09);_0x4ae54c(null);};}for(var e in events){if(events[_0xaee3('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xaee3('0x5')](e,emitEvent(event));}}module[_0xaee3('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xc7e7=['ChatOfflineMessage','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x315002,_0x4ee032){var _0x54e480=function(_0x4683bc){while(--_0x4683bc){_0x315002['push'](_0x315002['shift']());}};_0x54e480(++_0x4ee032);}(_0xc7e7,0x13a));var _0x7c7e=function(_0x307fac,_0x33a85a){_0x307fac=_0x307fac-0x0;var _0x547232=_0xc7e7[_0x307fac];return _0x547232;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7c7e('0x0'))['db'][_0x7c7e('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7c7e('0x2'),'afterUpdate':_0x7c7e('0x3'),'afterDestroy':_0x7c7e('0x4')};function emitEvent(_0x3313bc){return function(_0x51bdc5,_0x340e4,_0x3bbe68){ChatOfflineMessageEvents['emit'](_0x3313bc+':'+_0x51bdc5['id'],_0x51bdc5);ChatOfflineMessageEvents[_0x7c7e('0x5')](_0x3313bc,_0x51bdc5);_0x3bbe68(null);};}for(var e in events){if(events[_0x7c7e('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x7c7e('0x7')](e,emitEvent(event));}}module[_0x7c7e('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 8c03e83..fe35400 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 _0xa563=['utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x4fb59d,_0x274291){var _0x192b42=function(_0xae0abc){while(--_0xae0abc){_0x4fb59d['push'](_0x4fb59d['shift']());}};_0x192b42(++_0x274291);}(_0xa563,0x18d));var _0x3a56=function(_0x3a5808,_0x5aab8e){_0x3a5808=_0x3a5808-0x0;var _0x58ab08=_0xa563[_0x3a5808];return _0x58ab08;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x3a56('0x0')]=function(_0x3adb66){return _0x3adb66[_0x3a56('0x1')](_0x3a56('0x2'),attributes,{'tableName':_0x3a56('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a56('0x4'),'collate':_0x3a56('0x5')});}; \ No newline at end of file +var _0xd2ef=['./chatOfflineMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0xd2ef,0x163));var _0xfd2e=function(_0x4cb521,_0x33a3f6){_0x4cb521=_0x4cb521-0x0;var _0x4b8b5e=_0xd2ef[_0x4cb521];return _0x4b8b5e;};'use strict';var attributes=require(_0xfd2e('0x0'));module[_0xfd2e('0x1')]=function(_0x329380){return _0x329380[_0xfd2e('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd2e('0x3'),'collate':_0xfd2e('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 154b86d..d465629 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 _0xb7a8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb7a8,0xec));var _0x8b7a=function(_0x77854,_0x4316a6){_0x77854=_0x77854-0x0;var _0x4a1916=_0xb7a8[_0x77854];return _0x4a1916;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var moment=require(_0x8b7a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b7a('0x2'));var fs=require('fs');var Redis=require(_0x8b7a('0x3'));var db=require(_0x8b7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b7a('0x5'))(_0x8b7a('0x6'));var config=require(_0x8b7a('0x7'));var jayson=require(_0x8b7a('0x8'));var client=jayson[_0x8b7a('0x9')][_0x8b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa539dd,_0x4045d9,_0x3e7238){return new BPromise(function(_0xec0881,_0x15b930){return client[_0x8b7a('0xb')](_0xa539dd,_0x3e7238)['then'](function(_0x138031){logger['info'](_0x8b7a('0xc'),_0x4045d9,_0x8b7a('0xd'));logger['debug'](_0x8b7a('0xe'),_0x4045d9,_0x8b7a('0xd'),JSON[_0x8b7a('0xf')](_0x138031));if(_0x138031['error']){if(_0x138031[_0x8b7a('0x10')]['code']===0x1f4){logger[_0x8b7a('0x10')](_0x8b7a('0xc'),_0x4045d9,_0x138031[_0x8b7a('0x10')][_0x8b7a('0x11')]);return _0x15b930(_0x138031['error'][_0x8b7a('0x11')]);}logger['error'](_0x8b7a('0xc'),_0x4045d9,_0x138031[_0x8b7a('0x10')][_0x8b7a('0x11')]);return _0xec0881(_0x138031['error']['message']);}else{logger['info'](_0x8b7a('0xc'),_0x4045d9,'request\x20sent');_0xec0881(_0x138031[_0x8b7a('0x12')][_0x8b7a('0x11')]);}})[_0x8b7a('0x13')](function(_0x21a0be){logger[_0x8b7a('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4045d9,_0x21a0be);_0x15b930(_0x21a0be);});});} \ No newline at end of file +var _0xa1a3=['message','catch','util','randomstring','ioredis','rpc','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xa1a3,0x1d2));var _0x3a1a=function(_0x4da688,_0x2c1e94){_0x4da688=_0x4da688-0x0;var _0x4c3488=_0xa1a3[_0x4da688];return _0x4c3488;};'use strict';var _=require('lodash');var util=require(_0x3a1a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a1a('0x1'));var fs=require('fs');var Redis=require(_0x3a1a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a1a('0x3'));var config=require('../../config/environment');var jayson=require(_0x3a1a('0x4'));var client=jayson[_0x3a1a('0x5')][_0x3a1a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x759172,_0x4123f8,_0xe8dd4f){return new BPromise(function(_0x25a3a5,_0x37591f){return client[_0x3a1a('0x7')](_0x759172,_0xe8dd4f)['then'](function(_0x11bc04){logger[_0x3a1a('0x8')](_0x3a1a('0x9'),_0x4123f8,_0x3a1a('0xa'));logger['debug'](_0x3a1a('0xb'),_0x4123f8,_0x3a1a('0xa'),JSON['stringify'](_0x11bc04));if(_0x11bc04[_0x3a1a('0xc')]){if(_0x11bc04[_0x3a1a('0xc')][_0x3a1a('0xd')]===0x1f4){logger[_0x3a1a('0xc')](_0x3a1a('0x9'),_0x4123f8,_0x11bc04['error'][_0x3a1a('0xe')]);return _0x37591f(_0x11bc04[_0x3a1a('0xc')][_0x3a1a('0xe')]);}logger[_0x3a1a('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4123f8,_0x11bc04['error'][_0x3a1a('0xe')]);return _0x25a3a5(_0x11bc04[_0x3a1a('0xc')][_0x3a1a('0xe')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x4123f8,_0x3a1a('0xa'));_0x25a3a5(_0x11bc04['result']['message']);}})[_0x3a1a('0xf')](function(_0x3b6c58){logger[_0x3a1a('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4123f8,_0x3b6c58);_0x37591f(_0x3b6c58);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 01f7be7..6e37d43 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 _0x79d4=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update'];(function(_0x2ef400,_0x56eb50){var _0x3e35eb=function(_0x2623b9){while(--_0x2623b9){_0x2ef400['push'](_0x2ef400['shift']());}};_0x3e35eb(++_0x56eb50);}(_0x79d4,0x95));var _0x479d=function(_0x36b663,_0x42ba56){_0x36b663=_0x36b663-0x0;var _0x15c59d=_0x79d4[_0x36b663];return _0x15c59d;};'use strict';var multer=require(_0x479d('0x0'));var util=require('util');var path=require(_0x479d('0x1'));var timeout=require('connect-timeout');var express=require(_0x479d('0x2'));var router=express[_0x479d('0x3')]();var fs_extra=require(_0x479d('0x4'));var auth=require(_0x479d('0x5'));var interaction=require(_0x479d('0x6'));var config=require(_0x479d('0x7'));var controller=require(_0x479d('0x8'));router[_0x479d('0x9')]('/',auth[_0x479d('0xa')](),controller[_0x479d('0xb')]);router[_0x479d('0x9')](_0x479d('0xc'),auth[_0x479d('0xa')](),controller[_0x479d('0xd')]);router[_0x479d('0x9')](_0x479d('0xe'),auth[_0x479d('0xa')](),controller[_0x479d('0xf')]);router[_0x479d('0x10')]('/',auth[_0x479d('0xa')](),controller['create']);router[_0x479d('0x11')](_0x479d('0xe'),auth[_0x479d('0xa')](),controller[_0x479d('0x12')]);router['delete'](_0x479d('0xe'),auth[_0x479d('0xa')](),controller[_0x479d('0x13')]);module[_0x479d('0x14')]=router; \ No newline at end of file +var _0x5831=['create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3d0c12,_0x1470fb){var _0x2b0747=function(_0x77ee25){while(--_0x77ee25){_0x3d0c12['push'](_0x3d0c12['shift']());}};_0x2b0747(++_0x1470fb);}(_0x5831,0x64));var _0x1583=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0x5831[_0x12a62c];return _0x268a58;};'use strict';var multer=require(_0x1583('0x0'));var util=require(_0x1583('0x1'));var path=require('path');var timeout=require(_0x1583('0x2'));var express=require(_0x1583('0x3'));var router=express[_0x1583('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1583('0x5'));var interaction=require(_0x1583('0x6'));var config=require('../../config/environment');var controller=require(_0x1583('0x7'));router[_0x1583('0x8')]('/',auth[_0x1583('0x9')](),controller[_0x1583('0xa')]);router[_0x1583('0x8')]('/describe',auth[_0x1583('0x9')](),controller[_0x1583('0xb')]);router[_0x1583('0x8')](_0x1583('0xc'),auth[_0x1583('0x9')](),controller[_0x1583('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1583('0xe')]);router[_0x1583('0xf')](_0x1583('0xc'),auth['isAuthenticated'](),controller[_0x1583('0x10')]);router[_0x1583('0x11')](_0x1583('0xc'),auth[_0x1583('0x9')](),controller['destroy']);module[_0x1583('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 95eabc4..267fe86 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 _0x5a44=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x21b8f0,_0x25fb02){var _0x97ebf5=function(_0x1f82a2){while(--_0x1f82a2){_0x21b8f0['push'](_0x21b8f0['shift']());}};_0x97ebf5(++_0x25fb02);}(_0x5a44,0x120));var _0x45a4=function(_0x407b8b,_0x436007){_0x407b8b=_0x407b8b-0x0;var _0x332e32=_0x5a44[_0x407b8b];return _0x332e32;};'use strict';var Sequelize=require('sequelize');module[_0x45a4('0x0')]={'name':{'type':Sequelize[_0x45a4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x45a4('0x2')](_0x45a4('0x3'),_0x45a4('0x4')),'defaultValue':_0x45a4('0x3')},'selector':{'type':Sequelize[_0x45a4('0x1')]},'timeout':{'type':Sequelize[_0x45a4('0x5')]}}; \ No newline at end of file +var _0x9af2=['INTEGER','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x19cb1a,_0x4ce1b2){var _0x399650=function(_0x3bfcde){while(--_0x3bfcde){_0x19cb1a['push'](_0x19cb1a['shift']());}};_0x399650(++_0x4ce1b2);}(_0x9af2,0x175));var _0x29af=function(_0x7a3e87,_0x4d01bb){_0x7a3e87=_0x7a3e87-0x0;var _0x132530=_0x9af2[_0x7a3e87];return _0x132530;};'use strict';var Sequelize=require('sequelize');module[_0x29af('0x0')]={'name':{'type':Sequelize[_0x29af('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x29af('0x2')]('mouseOver',_0x29af('0x3')),'defaultValue':_0x29af('0x4')},'selector':{'type':Sequelize[_0x29af('0x1')]},'timeout':{'type':Sequelize[_0x29af('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index a27a1fe..9bc8ab0 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 _0x425d=['keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options','catch','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','show','params'];(function(_0x109f99,_0x3aaba9){var _0x1496d7=function(_0x1c78aa){while(--_0x1c78aa){_0x109f99['push'](_0x109f99['shift']());}};_0x1496d7(++_0x3aaba9);}(_0x425d,0x1e0));var _0xd425=function(_0x5df7e6,_0x12d771){_0x5df7e6=_0x5df7e6-0x0;var _0xfaba1b=_0x425d[_0x5df7e6];return _0xfaba1b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={'raw':!![],'where':{'id':_0x185d7e[_0xd425('0x2f')]['id']}},_0x24da23={};_0x24da23['model']=_[_0xd425('0x30')](db[_0xd425('0x31')][_0xd425('0x32')]);_0x24da23[_0xd425('0x33')]=_[_0xd425('0x30')](_0x185d7e[_0xd425('0x33')]);_0x24da23[_0xd425('0x34')]=_[_0xd425('0x35')](_0x24da23[_0xd425('0x36')],_0x24da23[_0xd425('0x33')]);_0x37b63c[_0xd425('0x37')]=_['intersection'](_0x24da23[_0xd425('0x36')],qs[_0xd425('0x38')](_0x185d7e[_0xd425('0x33')][_0xd425('0x38')]));_0x37b63c[_0xd425('0x37')]=_0x37b63c['attributes'][_0xd425('0x39')]?_0x37b63c[_0xd425('0x37')]:_0x24da23['model'];if(_0x185d7e['query']['includeAll']){_0x37b63c[_0xd425('0x3a')]=[{'all':!![]}];}_0x37b63c=_[_0xd425('0x3b')]({},_0x37b63c,_0x185d7e[_0xd425('0x3c')]);return db[_0xd425('0x31')]['find'](_0x37b63c)[_0xd425('0x2a')](handleEntityNotFound(_0x2fd17a,null))[_0xd425('0x2a')](respondWithResult(_0x2fd17a,null))[_0xd425('0x3d')](handleError(_0x2fd17a,null));};exports[_0xd425('0x3e')]=function(_0x27b9e2,_0x1e12f2){return db[_0xd425('0x31')]['create'](_0x27b9e2[_0xd425('0x3f')],{})['then'](respondWithResult(_0x1e12f2,0xc9))[_0xd425('0x3d')](handleError(_0x1e12f2,null));};exports[_0xd425('0x29')]=function(_0x36c8da,_0x4ef4ab){if(_0x36c8da[_0xd425('0x3f')]['id']){delete _0x36c8da[_0xd425('0x3f')]['id'];}return db[_0xd425('0x31')][_0xd425('0x40')]({'where':{'id':_0x36c8da['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x4ef4ab,null))[_0xd425('0x2a')](saveUpdates(_0x36c8da['body'],null))['then'](respondWithResult(_0x4ef4ab,null))['catch'](handleError(_0x4ef4ab,null));};exports[_0xd425('0x41')]=function(_0x400d57,_0x1f30c1){return db['ChatProactiveAction']['find']({'where':{'id':_0x400d57['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1f30c1,null))[_0xd425('0x2a')](removeEntity(_0x1f30c1,null))[_0xd425('0x3d')](handleError(_0x1f30c1,null));}; \ No newline at end of file +var _0xa2c8=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','show','model','ChatProactiveAction','keys','query','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5c0c03,_0x3b1277){var _0x304326=function(_0x3150f6){while(--_0x3150f6){_0x5c0c03['push'](_0x5c0c03['shift']());}};_0x304326(++_0x3b1277);}(_0xa2c8,0x99));var _0x8a2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2c8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x8a2c('0x0'));var rimraf=require(_0x8a2c('0x1'));var zipdir=require(_0x8a2c('0x2'));var jsonpatch=require(_0x8a2c('0x3'));var rp=require(_0x8a2c('0x4'));var moment=require(_0x8a2c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a2c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8a2c('0x7'));var ejs=require(_0x8a2c('0x8'));var fs=require('fs');var fs_extra=require(_0x8a2c('0x9'));var _=require(_0x8a2c('0xa'));var squel=require('squel');var crypto=require(_0x8a2c('0xb'));var jsforce=require(_0x8a2c('0xc'));var deskjs=require(_0x8a2c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a2c('0xe'));var authService=require(_0x8a2c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8a2c('0x10'));var hardwareService=require(_0x8a2c('0x11'));var logger=require(_0x8a2c('0x12'))(_0x8a2c('0x13'));var utils=require(_0x8a2c('0x14'));var config=require(_0x8a2c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a2c('0x16'))['db'];function respondWithStatusCode(_0x27f040,_0x4b18eb){_0x4b18eb=_0x4b18eb||0xcc;return function(_0xec4883){if(_0xec4883){return _0x27f040[_0x8a2c('0x17')](_0x4b18eb);}return _0x27f040['status'](_0x4b18eb)['end']();};}function respondWithResult(_0x545fb0,_0x4c7eac){_0x4c7eac=_0x4c7eac||0xc8;return function(_0x16bff7){if(_0x16bff7){return _0x545fb0[_0x8a2c('0x18')](_0x4c7eac)[_0x8a2c('0x19')](_0x16bff7);}};}function respondWithFilteredResult(_0x4f02e1,_0x4e8d08){return function(_0xc9d4c7){if(_0xc9d4c7){var _0x8594b4=typeof _0x4e8d08[_0x8a2c('0x1a')]===_0x8a2c('0x1b')&&typeof _0x4e8d08[_0x8a2c('0x1c')]===_0x8a2c('0x1b');var _0x3d82a5=_0xc9d4c7[_0x8a2c('0x1d')];var _0x48d922=_0x8594b4?0x0:_0x4e8d08['offset'];var _0x41226b=_0x8594b4?_0xc9d4c7[_0x8a2c('0x1d')]:_0x4e8d08[_0x8a2c('0x1a')]+_0x4e8d08[_0x8a2c('0x1c')];var _0x2e7e0b;if(_0x41226b>=_0x3d82a5){_0x41226b=_0x3d82a5;_0x2e7e0b=0xc8;}else{_0x2e7e0b=0xce;}_0x4f02e1[_0x8a2c('0x18')](_0x2e7e0b);return _0x4f02e1[_0x8a2c('0x1e')]('Content-Range',_0x48d922+'-'+_0x41226b+'/'+_0x3d82a5)[_0x8a2c('0x19')](_0xc9d4c7);}return null;};}function patchUpdates(_0x4a8d1e){return function(_0x29efe9){try{jsonpatch[_0x8a2c('0x1f')](_0x29efe9,_0x4a8d1e,!![]);}catch(_0x17a645){return BPromise[_0x8a2c('0x20')](_0x17a645);}return _0x29efe9[_0x8a2c('0x21')]();};}function saveUpdates(_0x292c02,_0xa77550){return function(_0x10c951){if(_0x10c951){return _0x10c951[_0x8a2c('0x22')](_0x292c02)[_0x8a2c('0x23')](function(_0x49454f){return _0x49454f;});}return null;};}function removeEntity(_0x2d89cb,_0x5acc49){return function(_0x26c80c){if(_0x26c80c){return _0x26c80c[_0x8a2c('0x24')]()[_0x8a2c('0x23')](function(){_0x2d89cb[_0x8a2c('0x18')](0xcc)[_0x8a2c('0x25')]();});}};}function handleEntityNotFound(_0x305949,_0x53fdb3){return function(_0x4be02e){if(!_0x4be02e){_0x305949[_0x8a2c('0x17')](0x194);}return _0x4be02e;};}function handleError(_0x2a2758,_0x1a2ea6){_0x1a2ea6=_0x1a2ea6||0x1f4;return function(_0x292103){logger['error'](_0x292103[_0x8a2c('0x26')]);if(_0x292103[_0x8a2c('0x27')]){delete _0x292103[_0x8a2c('0x27')];}_0x2a2758[_0x8a2c('0x18')](_0x1a2ea6)[_0x8a2c('0x28')](_0x292103);};}exports[_0x8a2c('0x29')]=function(_0x57c59e,_0x326da5){var _0x28ad48={'raw':!![],'where':{'id':_0x57c59e['params']['id']}},_0xbe6057={};_0xbe6057[_0x8a2c('0x2a')]=_['keys'](db[_0x8a2c('0x2b')]['rawAttributes']);_0xbe6057['query']=_[_0x8a2c('0x2c')](_0x57c59e[_0x8a2c('0x2d')]);_0xbe6057['filters']=_[_0x8a2c('0x2e')](_0xbe6057[_0x8a2c('0x2a')],_0xbe6057[_0x8a2c('0x2d')]);_0x28ad48['attributes']=_[_0x8a2c('0x2e')](_0xbe6057[_0x8a2c('0x2a')],qs[_0x8a2c('0x2f')](_0x57c59e[_0x8a2c('0x2d')][_0x8a2c('0x2f')]));_0x28ad48['attributes']=_0x28ad48[_0x8a2c('0x30')][_0x8a2c('0x31')]?_0x28ad48[_0x8a2c('0x30')]:_0xbe6057[_0x8a2c('0x2a')];if(_0x57c59e[_0x8a2c('0x2d')][_0x8a2c('0x32')]){_0x28ad48['include']=[{'all':!![]}];}_0x28ad48=_[_0x8a2c('0x33')]({},_0x28ad48,_0x57c59e[_0x8a2c('0x34')]);return db['ChatProactiveAction'][_0x8a2c('0x35')](_0x28ad48)[_0x8a2c('0x23')](handleEntityNotFound(_0x326da5,null))[_0x8a2c('0x23')](respondWithResult(_0x326da5,null))[_0x8a2c('0x36')](handleError(_0x326da5,null));};exports[_0x8a2c('0x37')]=function(_0x23a250,_0x35ad76){return db[_0x8a2c('0x2b')][_0x8a2c('0x37')](_0x23a250['body'],{})[_0x8a2c('0x23')](respondWithResult(_0x35ad76,0xc9))[_0x8a2c('0x36')](handleError(_0x35ad76,null));};exports[_0x8a2c('0x22')]=function(_0x46245a,_0x1cdda8){if(_0x46245a[_0x8a2c('0x38')]['id']){delete _0x46245a['body']['id'];}return db[_0x8a2c('0x2b')][_0x8a2c('0x35')]({'where':{'id':_0x46245a[_0x8a2c('0x39')]['id']}})['then'](handleEntityNotFound(_0x1cdda8,null))[_0x8a2c('0x23')](saveUpdates(_0x46245a[_0x8a2c('0x38')],null))[_0x8a2c('0x23')](respondWithResult(_0x1cdda8,null))[_0x8a2c('0x36')](handleError(_0x1cdda8,null));};exports[_0x8a2c('0x24')]=function(_0x4b71f6,_0x4f254a){return db[_0x8a2c('0x2b')][_0x8a2c('0x35')]({'where':{'id':_0x4b71f6['params']['id']}})[_0x8a2c('0x23')](handleEntityNotFound(_0x4f254a,null))[_0x8a2c('0x23')](removeEntity(_0x4f254a,null))['catch'](handleError(_0x4f254a,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7c82473..3a2b55b 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 _0xe1c4=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','bluebird','rimraf'];(function(_0x172720,_0x4b6b45){var _0x46813d=function(_0x503d81){while(--_0x503d81){_0x172720['push'](_0x172720['shift']());}};_0x46813d(++_0x4b6b45);}(_0xe1c4,0x145));var _0x4e1c=function(_0xf94b98,_0x5c3699){_0xf94b98=_0xf94b98-0x0;var _0x2a694c=_0xe1c4[_0xf94b98];return _0x2a694c;};'use strict';var _=require(_0x4e1c('0x0'));var util=require(_0x4e1c('0x1'));var logger=require(_0x4e1c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4e1c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4e1c('0x4'));var config=require(_0x4e1c('0x5'));var attributes=require(_0x4e1c('0x6'));module[_0x4e1c('0x7')]=function(_0x209a0b,_0x56024a){return _0x209a0b[_0x4e1c('0x8')](_0x4e1c('0x9'),attributes,{'tableName':_0x4e1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf26d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x1c9ac0,_0x217beb){var _0x1de71c=function(_0x107850){while(--_0x107850){_0x1c9ac0['push'](_0x1c9ac0['shift']());}};_0x1de71c(++_0x217beb);}(_0xf26d,0x11c));var _0xdf26=function(_0x80ff87,_0x3dc4aa){_0x80ff87=_0x80ff87-0x0;var _0x2ea308=_0xf26d[_0x80ff87];return _0x2ea308;};'use strict';var _=require(_0xdf26('0x0'));var util=require(_0xdf26('0x1'));var logger=require(_0xdf26('0x2'))(_0xdf26('0x3'));var moment=require(_0xdf26('0x4'));var BPromise=require(_0xdf26('0x5'));var rp=require(_0xdf26('0x6'));var fs=require('fs');var path=require(_0xdf26('0x7'));var rimraf=require('rimraf');var config=require(_0xdf26('0x8'));var attributes=require(_0xdf26('0x9'));module[_0xdf26('0xa')]=function(_0x1e7c8d,_0x20f9dc){return _0x1e7c8d['define'](_0xdf26('0xb'),attributes,{'tableName':_0xdf26('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 5bb829f..4b14388 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 _0x904c=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x5739dd,_0x484cf0){var _0xfb62b0=function(_0x47f100){while(--_0x47f100){_0x5739dd['push'](_0x5739dd['shift']());}};_0xfb62b0(++_0x484cf0);}(_0x904c,0x119));var _0xc904=function(_0x10b45c,_0x1e54d2){_0x10b45c=_0x10b45c-0x0;var _0x38df88=_0x904c[_0x10b45c];return _0x38df88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc904('0x0'));var BPromise=require(_0xc904('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc904('0x2'))['db'];var utils=require(_0xc904('0x3'));var logger=require(_0xc904('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc904('0x5'));var client=jayson['client'][_0xc904('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1bebd9,_0x5ec7ae,_0x158123){return new BPromise(function(_0x3783a1,_0x50df86){return client[_0xc904('0x7')](_0x1bebd9,_0x158123)[_0xc904('0x8')](function(_0x3a4f10){logger[_0xc904('0x9')](_0xc904('0xa'),_0x5ec7ae,'request\x20sent');logger[_0xc904('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5ec7ae,'request\x20sent',JSON[_0xc904('0xc')](_0x3a4f10));if(_0x3a4f10[_0xc904('0xd')]){if(_0x3a4f10[_0xc904('0xd')][_0xc904('0xe')]===0x1f4){logger[_0xc904('0xd')](_0xc904('0xa'),_0x5ec7ae,_0x3a4f10[_0xc904('0xd')][_0xc904('0xf')]);return _0x50df86(_0x3a4f10[_0xc904('0xd')]['message']);}logger[_0xc904('0xd')](_0xc904('0xa'),_0x5ec7ae,_0x3a4f10[_0xc904('0xd')]['message']);return _0x3783a1(_0x3a4f10[_0xc904('0xd')][_0xc904('0xf')]);}else{logger[_0xc904('0x9')](_0xc904('0xa'),_0x5ec7ae,'request\x20sent');_0x3783a1(_0x3a4f10[_0xc904('0x10')]['message']);}})[_0xc904('0x11')](function(_0x4dfbb5){logger[_0xc904('0xd')](_0xc904('0xa'),_0x5ec7ae,_0x4dfbb5);_0x50df86(_0x4dfbb5);});});} \ No newline at end of file +var _0xe5a3=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x22b6e5,_0x2819c8){var _0x1c21e5=function(_0x18a52c){while(--_0x18a52c){_0x22b6e5['push'](_0x22b6e5['shift']());}};_0x1c21e5(++_0x2819c8);}(_0xe5a3,0x9c));var _0x3e5a=function(_0x1c23ee,_0x590de0){_0x1c23ee=_0x1c23ee-0x0;var _0x10afb7=_0xe5a3[_0x1c23ee];return _0x10afb7;};'use strict';var _=require(_0x3e5a('0x0'));var util=require(_0x3e5a('0x1'));var moment=require(_0x3e5a('0x2'));var BPromise=require(_0x3e5a('0x3'));var rs=require(_0x3e5a('0x4'));var fs=require('fs');var Redis=require(_0x3e5a('0x5'));var db=require(_0x3e5a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e5a('0x7'))(_0x3e5a('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e5a('0x9'));var client=jayson[_0x3e5a('0xa')][_0x3e5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be94e,_0x245f8f,_0x2544f2){return new BPromise(function(_0x25e6ad,_0x3babe3){return client[_0x3e5a('0xc')](_0x2be94e,_0x2544f2)[_0x3e5a('0xd')](function(_0x3a8c4f){logger['info'](_0x3e5a('0xe'),_0x245f8f,_0x3e5a('0xf'));logger['debug'](_0x3e5a('0x10'),_0x245f8f,_0x3e5a('0xf'),JSON['stringify'](_0x3a8c4f));if(_0x3a8c4f[_0x3e5a('0x11')]){if(_0x3a8c4f[_0x3e5a('0x11')][_0x3e5a('0x12')]===0x1f4){logger[_0x3e5a('0x11')](_0x3e5a('0xe'),_0x245f8f,_0x3a8c4f[_0x3e5a('0x11')][_0x3e5a('0x13')]);return _0x3babe3(_0x3a8c4f[_0x3e5a('0x11')][_0x3e5a('0x13')]);}logger[_0x3e5a('0x11')](_0x3e5a('0xe'),_0x245f8f,_0x3a8c4f[_0x3e5a('0x11')][_0x3e5a('0x13')]);return _0x25e6ad(_0x3a8c4f['error'][_0x3e5a('0x13')]);}else{logger[_0x3e5a('0x14')](_0x3e5a('0xe'),_0x245f8f,_0x3e5a('0xf'));_0x25e6ad(_0x3a8c4f[_0x3e5a('0x15')]['message']);}})[_0x3e5a('0x16')](function(_0x398bb4){logger[_0x3e5a('0x11')](_0x3e5a('0xe'),_0x245f8f,_0x398bb4);_0x3babe3(_0x398bb4);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 57b3fe9..8b9b66d 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4520fc,_0x2fc615){_0x4520fc=_0x4520fc-0x0;var _0x1836bc=_0xb4c7[_0x4520fc];return _0x1836bc;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file +var _0xbd51=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','./chatProactiveAction.controller','get','/:id'];(function(_0x4c31a0,_0x5d39c8){var _0x20e812=function(_0x1c4c9c){while(--_0x1c4c9c){_0x4c31a0['push'](_0x4c31a0['shift']());}};_0x20e812(++_0x5d39c8);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x17d99f,_0x4e6616){_0x17d99f=_0x17d99f-0x0;var _0x48f24b=_0xbd51[_0x17d99f];return _0x48f24b;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')](_0x1bd5('0x7'),auth['isAuthenticated'](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/:id',auth[_0x1bd5('0xa')](),controller['update']);router[_0x1bd5('0xd')](_0x1bd5('0x7'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);module[_0x1bd5('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 6b832db..7ef31fe 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 _0x9752=['exports','STRING','name','rrmemory','beepall','sequelize'];(function(_0x530f31,_0xf86a0b){var _0x3543f8=function(_0x73a8c9){while(--_0x73a8c9){_0x530f31['push'](_0x530f31['shift']());}};_0x3543f8(++_0xf86a0b);}(_0x9752,0x1af));var _0x2975=function(_0x264bd4,_0x8722fc){_0x264bd4=_0x264bd4-0x0;var _0xd8bc8=_0x9752[_0x264bd4];return _0xd8bc8;};'use strict';var Sequelize=require(_0x2975('0x0'));module[_0x2975('0x1')]={'name':{'type':Sequelize[_0x2975('0x2')],'unique':_0x2975('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2975('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2975('0x4'),_0x2975('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xb2b4=['STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x5d95d4,_0x161edc){var _0x3fa1b9=function(_0x2eaffa){while(--_0x2eaffa){_0x5d95d4['push'](_0x5d95d4['shift']());}};_0x3fa1b9(++_0x161edc);}(_0xb2b4,0x191));var _0x4b2b=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xb2b4[_0x215e65];return _0xa85842;};'use strict';var Sequelize=require(_0x4b2b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b2b('0x1')],'unique':_0x4b2b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b2b('0x1')]},'timeout':{'type':Sequelize[_0x4b2b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b2b('0x4')]('rrmemory','beepall',_0x4b2b('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 726ee46..d524604 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 _0xdac0=['format','%s/%s','getTeams','findOne','Team','map','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','forEach','emit','userChatQueue:save','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','isEmpty','removeAgents','userChatQueue:remove','addAgents','ids','omit','spread','isArray','getAgents','bluebird','util','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','register','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','status','stack','name','send','index','ChatQueue','rawAttributes','type','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','attributes','model','fields','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','describe','getMembers','UserChatQueue','length','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','options','User','findAndCountAll','agent','chatPause','updatedAt','createdAt'];(function(_0x32c4d5,_0x16f1a1){var _0x4851f0=function(_0x1f6d9e){while(--_0x1f6d9e){_0x32c4d5['push'](_0x32c4d5['shift']());}};_0x4851f0(++_0x16f1a1);}(_0xdac0,0x18d));var _0x0dac=function(_0x1f3d56,_0x3cd9c5){_0x1f3d56=_0x1f3d56-0x0;var _0x563bce=_0xdac0[_0x1f3d56];return _0x563bce;};'use strict';var BPromise=require(_0x0dac('0x0'));var util=require(_0x0dac('0x1'));var _=require('lodash');var squel=require(_0x0dac('0x2'));var Redis=require(_0x0dac('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x0dac('0x4'))(_0x0dac('0x5'));var config=require('../../config/environment');var db=require(_0x0dac('0x6'))['db'];config[_0x0dac('0x7')]=_[_0x0dac('0x8')](config[_0x0dac('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0dac('0x7')]));require('./chatQueue.socket')[_0x0dac('0x9')](socket);function respondWithStatusCode(_0x217943,_0xd92358){_0xd92358=_0xd92358||0xcc;return function(_0x4c938c){if(_0x4c938c){return _0x217943[_0x0dac('0xa')](_0xd92358);}return _0x217943['status'](_0xd92358)[_0x0dac('0xb')]();};}function respondWithResult(_0x5a2494,_0x493fdb){_0x493fdb=_0x493fdb||0xc8;return function(_0x4d4784){if(_0x4d4784){return _0x5a2494['status'](_0x493fdb)[_0x0dac('0xc')](_0x4d4784);}};}function respondWithFilteredResult(_0x1ed933,_0x2dc02b){return function(_0x55ad8f){if(_0x55ad8f){var _0x1f6e89=typeof _0x2dc02b[_0x0dac('0xd')]===_0x0dac('0xe')&&typeof _0x2dc02b[_0x0dac('0xf')]==='undefined';var _0x543358=_0x55ad8f[_0x0dac('0x10')];var _0x565d2d=_0x1f6e89?0x0:_0x2dc02b[_0x0dac('0xd')];var _0x2ccef7=_0x1f6e89?_0x55ad8f[_0x0dac('0x10')]:_0x2dc02b[_0x0dac('0xd')]+_0x2dc02b['limit'];var _0x2909bb;if(_0x2ccef7>=_0x543358){_0x2ccef7=_0x543358;_0x2909bb=0xc8;}else{_0x2909bb=0xce;}_0x1ed933['status'](_0x2909bb);return _0x1ed933[_0x0dac('0x11')](_0x0dac('0x12'),_0x565d2d+'-'+_0x2ccef7+'/'+_0x543358)[_0x0dac('0xc')](_0x55ad8f);}return null;};}function saveUpdates(_0x33fac){return function(_0x304221){if(_0x304221){return _0x304221[_0x0dac('0x13')](_0x33fac)[_0x0dac('0x14')](function(_0x22d201){return _0x22d201;});}return null;};}function removeEntity(_0xe29bd0){return function(_0x18d995){if(_0x18d995){return _0x18d995[_0x0dac('0x15')]()[_0x0dac('0x14')](function(){var _0x5ac5a3=_0x18d995[_0x0dac('0x16')]({'plain':!![]});var _0x516904=_0x0dac('0x17');return db[_0x0dac('0x18')]['destroy']({'where':{'type':_0x516904,'resourceId':_0x5ac5a3['id']}})[_0x0dac('0x14')](function(){return _0x18d995;});})['then'](function(){_0xe29bd0[_0x0dac('0x19')](0xcc)[_0x0dac('0xb')]();});}};}function handleEntityNotFound(_0x42eac5){return function(_0x5cf7e3){if(!_0x5cf7e3){_0x42eac5[_0x0dac('0xa')](0x194);}return _0x5cf7e3;};}function handleError(_0x162279,_0x657f22){_0x657f22=_0x657f22||0x1f4;return function(_0x15d6f2){logger['error'](_0x15d6f2[_0x0dac('0x1a')]);if(_0x15d6f2[_0x0dac('0x1b')]){delete _0x15d6f2['name'];}_0x162279[_0x0dac('0x19')](_0x657f22)[_0x0dac('0x1c')](_0x15d6f2);};}exports[_0x0dac('0x1d')]=function(_0x1e216f,_0x278a26){var _0x872558={};var _0x1634fe={'count':0x0,'rows':[]};var _0x14401c=_['map'](db[_0x0dac('0x1e')][_0x0dac('0x1f')],function(_0x5a86f6){return{'name':_0x5a86f6['fieldName'],'type':_0x5a86f6[_0x0dac('0x20')]['key']};});_0x872558=qs['getOptions'](_0x14401c,_0x1e216f);var _0x565d28={'where':_0x872558[_0x0dac('0x21')]};return db['ChatQueue'][_0x0dac('0x10')](_0x565d28)[_0x0dac('0x14')](function(_0x2cd620){_0x1634fe['count']=_0x2cd620;_0x872558[_0x0dac('0x22')]=qs['include'](_0x1e216f[_0x0dac('0x23')]);return db[_0x0dac('0x1e')][_0x0dac('0x24')](_0x872558);})[_0x0dac('0x14')](function(_0x55f6d5){_0x1634fe[_0x0dac('0x25')]=_0x55f6d5;return _0x1634fe;})[_0x0dac('0x14')](respondWithFilteredResult(_0x278a26,_0x872558))[_0x0dac('0x26')](handleError(_0x278a26,null));};exports[_0x0dac('0x27')]=function(_0x46087e,_0x186875){var _0x4053dc={'raw':!![],'where':{'id':_0x46087e[_0x0dac('0x28')]['id']}},_0xdfcdf4={};_0xdfcdf4['model']=_[_0x0dac('0x29')](db[_0x0dac('0x1e')][_0x0dac('0x1f')]);_0xdfcdf4[_0x0dac('0x23')]=_['keys'](_0x46087e[_0x0dac('0x23')]);_0xdfcdf4[_0x0dac('0x2a')]=_[_0x0dac('0x2b')](_0xdfcdf4['model'],_0xdfcdf4[_0x0dac('0x23')]);_0x4053dc[_0x0dac('0x2c')]=_[_0x0dac('0x2b')](_0xdfcdf4[_0x0dac('0x2d')],qs['fields'](_0x46087e[_0x0dac('0x23')][_0x0dac('0x2e')]));_0x4053dc['attributes']=_0x4053dc[_0x0dac('0x2c')]['length']?_0x4053dc[_0x0dac('0x2c')]:_0xdfcdf4[_0x0dac('0x2d')];if(_0x46087e[_0x0dac('0x23')][_0x0dac('0x2f')]){_0x4053dc[_0x0dac('0x22')]=[{'all':!![]}];}_0x4053dc=_[_0x0dac('0x30')]({},_0x4053dc,_0x46087e['options']);return db[_0x0dac('0x1e')]['find'](_0x4053dc)['then'](handleEntityNotFound(_0x186875,null))['then'](respondWithResult(_0x186875,null))['catch'](handleError(_0x186875,null));};exports[_0x0dac('0x31')]=function(_0x53095f,_0x1cde04){return db[_0x0dac('0x1e')][_0x0dac('0x31')](_0x53095f[_0x0dac('0x32')],{})['then'](function(_0x3844f8){var _0x2373de=_0x53095f[_0x0dac('0x33')][_0x0dac('0x16')]({'plain':!![]});if(!_0x2373de)throw new Error(_0x0dac('0x34'));if(_0x2373de['role']===_0x0dac('0x33')){var _0x562d72=_0x3844f8[_0x0dac('0x16')]({'plain':!![]});var _0x143039=_0x0dac('0x17');return db[_0x0dac('0x35')][_0x0dac('0x36')]({'where':{'name':_0x143039,'userProfileId':_0x2373de[_0x0dac('0x37')]},'raw':!![]})[_0x0dac('0x14')](function(_0x3cce86){if(_0x3cce86&&_0x3cce86['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x562d72['name'],'resourceId':_0x562d72['id'],'type':_0x3cce86[_0x0dac('0x1b')],'sectionId':_0x3cce86['id']},{})[_0x0dac('0x14')](function(){return _0x3844f8;});}else{return _0x3844f8;}})[_0x0dac('0x26')](function(_0x1514aa){logger[_0x0dac('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1514aa);throw _0x1514aa;});}return _0x3844f8;})['then'](respondWithResult(_0x1cde04,0xc9))[_0x0dac('0x26')](handleError(_0x1cde04,null));};exports[_0x0dac('0x13')]=function(_0x30684a,_0x1c6eff){if(_0x30684a['body']['id']){delete _0x30684a[_0x0dac('0x32')]['id'];}return db[_0x0dac('0x1e')][_0x0dac('0x36')]({'where':{'id':_0x30684a[_0x0dac('0x28')]['id']}})[_0x0dac('0x14')](handleEntityNotFound(_0x1c6eff,null))[_0x0dac('0x14')](saveUpdates(_0x30684a[_0x0dac('0x32')],null))[_0x0dac('0x14')](respondWithResult(_0x1c6eff,null))[_0x0dac('0x26')](handleError(_0x1c6eff,null));};exports['destroy']=function(_0x544227,_0x3b9dac){return db['ChatQueue']['find']({'where':{'id':_0x544227['params']['id']}})[_0x0dac('0x14')](handleEntityNotFound(_0x3b9dac,null))[_0x0dac('0x14')](removeEntity(_0x3b9dac,null))['catch'](handleError(_0x3b9dac,null));};exports[_0x0dac('0x39')]=function(_0x119164,_0x145df2){return db[_0x0dac('0x1e')][_0x0dac('0x39')]()[_0x0dac('0x14')](respondWithResult(_0x145df2,null))[_0x0dac('0x26')](handleError(_0x145df2,null));};exports[_0x0dac('0x3a')]=function(_0x1e5fa8,_0x17d325){var _0x54b0d3={'raw':!![],'where':{}},_0x4b972b={},_0xb08beb;return db[_0x0dac('0x1e')]['findOne']({'where':{'id':_0x1e5fa8[_0x0dac('0x28')]['id']}})[_0x0dac('0x14')](handleEntityNotFound(_0x17d325,null))[_0x0dac('0x14')](function(_0x54cd69){if(_0x54cd69){_0xb08beb=_0x54cd69[_0x0dac('0x16')]({'plain':!![]});_0x4b972b[_0x0dac('0x2d')]=_[_0x0dac('0x29')](db[_0x0dac('0x3b')][_0x0dac('0x1f')]);_0x4b972b['query']=_[_0x0dac('0x29')](_0x1e5fa8[_0x0dac('0x23')]);_0x4b972b['filters']=_[_0x0dac('0x2b')](_0x4b972b['model'],_0x4b972b[_0x0dac('0x23')]);_0x54b0d3[_0x0dac('0x2c')]=_[_0x0dac('0x2b')](_0x4b972b[_0x0dac('0x2d')],qs[_0x0dac('0x2e')](_0x1e5fa8[_0x0dac('0x23')]['fields']));_0x54b0d3[_0x0dac('0x2c')]=_0x54b0d3[_0x0dac('0x2c')][_0x0dac('0x3c')]?_0x54b0d3[_0x0dac('0x2c')]:_0x4b972b[_0x0dac('0x2d')];if(!_0x1e5fa8['query'][_0x0dac('0x3d')](_0x0dac('0x3e'))){_0x54b0d3[_0x0dac('0xf')]=qs[_0x0dac('0xf')](_0x1e5fa8[_0x0dac('0x23')][_0x0dac('0xf')]);_0x54b0d3[_0x0dac('0xd')]=qs[_0x0dac('0xd')](_0x1e5fa8[_0x0dac('0x23')][_0x0dac('0xd')]);}_0x54b0d3[_0x0dac('0x3f')]=qs[_0x0dac('0x40')](_0x1e5fa8[_0x0dac('0x23')][_0x0dac('0x40')]);_0x54b0d3[_0x0dac('0x21')]=qs[_0x0dac('0x2a')](_[_0x0dac('0x41')](_0x1e5fa8[_0x0dac('0x23')],_0x4b972b[_0x0dac('0x2a')]));_0x54b0d3[_0x0dac('0x21')][_0x0dac('0x42')]=_0x54cd69['id'];if(_0x1e5fa8[_0x0dac('0x23')][_0x0dac('0x43')]){_0x54b0d3['where']=_[_0x0dac('0x30')](_0x54b0d3[_0x0dac('0x21')],{'$or':_['map'](_0x54b0d3[_0x0dac('0x2c')],function(_0x299d8f){var _0x15beca={};_0x15beca[_0x299d8f]={'$like':'%'+_0x1e5fa8['query'][_0x0dac('0x43')]+'%'};return _0x15beca;})});}_0x54b0d3=_[_0x0dac('0x30')]({},_0x54b0d3,_0x1e5fa8[_0x0dac('0x44')]);return db[_0x0dac('0x3b')][_0x0dac('0x24')](_0x54b0d3);}})[_0x0dac('0x14')](function(_0x344268){if(_0x344268){return db[_0x0dac('0x45')][_0x0dac('0x46')]({'where':{'id':_['map'](_0x344268,'UserId'),'role':_0x0dac('0x47')},'attributes':['id',_0x0dac('0x1b'),_0x0dac('0x48'),_0x0dac('0x49'),_0x0dac('0x4a')]});}})[_0x0dac('0x14')](function(_0x1c6ad5){if(_0x1c6ad5){return{'count':_0x1c6ad5[_0x0dac('0x10')],'rows':_['map'](_0x1c6ad5['rows'],function(_0x371de0){return{'membername':_0x371de0['name'],'UserId':_0x371de0['id'],'queue_name':_0xb08beb[_0x0dac('0x1b')],'ChatQueueId':_0xb08beb['id'],'interface':util[_0x0dac('0x4b')](_0x0dac('0x4c'),'SIP',_0x371de0[_0x0dac('0x1b')]),'penalty':0x0,'paused':_0x371de0[_0x0dac('0x48')],'createdAt':_0x371de0[_0x0dac('0x4a')],'updatedAt':_0x371de0[_0x0dac('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17d325,_0x54b0d3))['catch'](handleError(_0x17d325,null));};exports[_0x0dac('0x4d')]=function(_0x5d1f68,_0x317ec3){var _0x45f44a={};var _0x676934={};var _0x4ee3ba;var _0x540070;return db[_0x0dac('0x1e')][_0x0dac('0x4e')]({'where':{'id':_0x5d1f68['params']['id']}})[_0x0dac('0x14')](handleEntityNotFound(_0x317ec3,null))['then'](function(_0x18a742){if(_0x18a742){_0x4ee3ba=_0x18a742;_0x676934[_0x0dac('0x2d')]=_[_0x0dac('0x29')](db[_0x0dac('0x4f')][_0x0dac('0x1f')]);_0x676934[_0x0dac('0x23')]=_[_0x0dac('0x29')](_0x5d1f68['query']);_0x676934[_0x0dac('0x2a')]=_[_0x0dac('0x2b')](_0x676934[_0x0dac('0x2d')],_0x676934['query']);_0x45f44a[_0x0dac('0x2c')]=_['intersection'](_0x676934['model'],qs[_0x0dac('0x2e')](_0x5d1f68[_0x0dac('0x23')][_0x0dac('0x2e')]));_0x45f44a['attributes']=_0x45f44a[_0x0dac('0x2c')]['length']?_0x45f44a[_0x0dac('0x2c')]:_0x676934[_0x0dac('0x2d')];_0x45f44a[_0x0dac('0x3f')]=qs['sort'](_0x5d1f68[_0x0dac('0x23')][_0x0dac('0x40')]);_0x45f44a[_0x0dac('0x21')]=qs['filters'](_['pick'](_0x5d1f68[_0x0dac('0x23')],_0x676934[_0x0dac('0x2a')]));if(_0x5d1f68[_0x0dac('0x23')][_0x0dac('0x43')]){_0x45f44a[_0x0dac('0x21')]=_[_0x0dac('0x30')](_0x45f44a['where'],{'$or':_[_0x0dac('0x50')](_0x45f44a[_0x0dac('0x2c')],function(_0xca4839){var _0x520800={};_0x520800[_0xca4839]={'$like':'%'+_0x5d1f68[_0x0dac('0x23')][_0x0dac('0x43')]+'%'};return _0x520800;})});}_0x45f44a=_[_0x0dac('0x30')]({},_0x45f44a,_0x5d1f68['options']);return _0x4ee3ba[_0x0dac('0x4d')](_0x45f44a);}})[_0x0dac('0x14')](function(_0x3e544b){if(_0x3e544b){_0x540070=_0x3e544b[_0x0dac('0x3c')];if(!_0x5d1f68['query']['hasOwnProperty'](_0x0dac('0x3e'))){_0x45f44a[_0x0dac('0xf')]=qs[_0x0dac('0xf')](_0x5d1f68['query'][_0x0dac('0xf')]);_0x45f44a[_0x0dac('0xd')]=qs['offset'](_0x5d1f68['query'][_0x0dac('0xd')]);}return _0x4ee3ba[_0x0dac('0x4d')](_0x45f44a);}})[_0x0dac('0x14')](function(_0x2350b4){if(_0x2350b4){return _0x2350b4?{'count':_0x540070,'rows':_0x2350b4}:null;}})[_0x0dac('0x14')](respondWithResult(_0x317ec3,null))['catch'](handleError(_0x317ec3,null));};exports['addTeams']=function(_0x4099ef,_0x38be5c){var _0x51218f=_0x4099ef['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x51218f},'attributes':['id'],'include':[{'model':db[_0x0dac('0x45')],'as':_0x0dac('0x51'),'attributes':['id',_0x0dac('0x1b'),_0x0dac('0x52'),_0x0dac('0x53'),'interface'],'raw':!![]}]})[_0x0dac('0x14')](function(_0x3893a0){if(_0x3893a0){var _0x352057=_[_0x0dac('0x54')](_0x3893a0,function(_0x34cd9d){var _0x3ff49c=_0x34cd9d[_0x0dac('0x16')]({'plain':!![]});return _0x3ff49c['Agents'];});return db[_0x0dac('0x1e')][_0x0dac('0x36')]({'where':{'id':_0x4099ef[_0x0dac('0x28')]['id']}})[_0x0dac('0x14')](function(_0x32439e){return db[_0x0dac('0x55')][_0x0dac('0x56')](function(_0x13bffc){return _0x32439e[_0x0dac('0x57')](_0x51218f,{'transaction':_0x13bffc})[_0x0dac('0x14')](function(){return BPromise['each'](_0x352057,function(_0x262314){return db[_0x0dac('0x3b')]['findOrCreate']({'where':{'UserId':_0x262314['id'],'ChatQueueId':_0x4099ef['params']['id']},'transaction':_0x13bffc});});})[_0x0dac('0x14')](function(){_0x352057[_0x0dac('0x58')](function(_0x53aed4){socket[_0x0dac('0x59')](_0x0dac('0x5a'),{'UserId':_0x53aed4['id'],'ChatQueueId':_0x32439e['id']});});});});});}})[_0x0dac('0x14')](respondWithStatusCode(_0x38be5c,null))[_0x0dac('0x26')](handleError(_0x38be5c,null));};exports[_0x0dac('0x5b')]=function(_0x333597,_0x3b52ab){return db[_0x0dac('0x4f')][_0x0dac('0x24')]({'where':{'id':_0x333597[_0x0dac('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0dac('0x45')],'as':_0x0dac('0x51'),'attributes':['id'],'raw':!![]}]})[_0x0dac('0x14')](handleEntityNotFound(_0x3b52ab,null))['then'](function(_0x4701ac){var _0x5b7764=_[_0x0dac('0x50')](_0x4701ac,'id');var _0x4df7ba=[];var _0x1e338a=[];var _0x48bb11=squel[_0x0dac('0x5c')]();_0x48bb11[_0x0dac('0x5d')]('tq.TeamId')[_0x0dac('0x5e')]('team_has_chat_queues','tq')[_0x0dac('0x5f')](_0x0dac('0x60'),'ut',_0x0dac('0x61'))['where'](_0x0dac('0x62'),_0x333597['params']['id']);for(var _0x3364a0=0x0;_0x3364a0<_0x4701ac[_0x0dac('0x3c')];_0x3364a0+=0x1){let _0x4bb510=_0x4701ac[_0x3364a0];for(var _0x42e6cb=0x0;_0x42e6cb<_0x4bb510[_0x0dac('0x51')][_0x0dac('0x3c')];_0x42e6cb+=0x1){let _0x31bde8=_0x4bb510[_0x0dac('0x51')][_0x42e6cb];var _0x17f1c5=_0x48bb11[_0x0dac('0x63')]();_0x17f1c5[_0x0dac('0x21')](_0x0dac('0x64'),_0x31bde8['id']);_0x1e338a[_0x0dac('0x65')](db['sequelize'][_0x0dac('0x23')](_0x17f1c5[_0x0dac('0x66')](),{'type':db['sequelize'][_0x0dac('0x67')]['SELECT']})[_0x0dac('0x14')](function(_0x5acd47){if(_0x5acd47['length']===0x1){return _0x31bde8['id'];}else{var _0x57c210=_[_0x0dac('0x68')](_[_0x0dac('0x50')](_0x5acd47,_0x0dac('0x69')),function(_0x40d7b1){return _[_0x0dac('0x6a')](_0x5b7764,_0x40d7b1);});if(_0x57c210){return _0x31bde8['id'];}}}));}}return BPromise[_0x0dac('0x6b')](_0x1e338a)[_0x0dac('0x14')](function(_0x57156a){_0x4df7ba=_(_0x4df7ba)[_0x0dac('0x6c')](_0x57156a)['compact']()['value']();return db[_0x0dac('0x1e')][_0x0dac('0x36')]({'where':{'id':_0x333597[_0x0dac('0x28')]['id']}})[_0x0dac('0x14')](function(_0x142038){return db[_0x0dac('0x55')]['transaction'](function(_0x4bc312){return _0x142038[_0x0dac('0x5b')](_0x333597[_0x0dac('0x23')]['ids'],{'transaction':_0x4bc312})[_0x0dac('0x14')](function(){if(!_[_0x0dac('0x6d')](_0x4df7ba)){return _0x142038[_0x0dac('0x6e')](_0x4df7ba,{'transaction':_0x4bc312});}})['then'](function(){_0x4df7ba[_0x0dac('0x58')](function(_0x3f586b){socket[_0x0dac('0x59')](_0x0dac('0x6f'),{'UserId':_0x3f586b,'ChatQueueId':_0x142038['id']});});});});});});})[_0x0dac('0x14')](respondWithStatusCode(_0x3b52ab,null))[_0x0dac('0x26')](handleError(_0x3b52ab,null));};exports[_0x0dac('0x70')]=function(_0x33316f,_0x2b3d8f){return db['ChatQueue'][_0x0dac('0x36')]({'where':{'id':_0x33316f[_0x0dac('0x28')]['id']}})[_0x0dac('0x14')](handleEntityNotFound(_0x2b3d8f,null))[_0x0dac('0x14')](function(_0x35f6af){if(_0x35f6af){return _0x35f6af[_0x0dac('0x70')](_0x33316f['body'][_0x0dac('0x71')],_[_0x0dac('0x72')](_0x33316f[_0x0dac('0x32')],['ids','id'])||{})[_0x0dac('0x73')](function(_0x1f9a41){for(var _0x5f2204=0x0;_0x5f2204<_0x33316f[_0x0dac('0x32')]['ids'][_0x0dac('0x3c')];_0x5f2204+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x33316f[_0x0dac('0x32')][_0x0dac('0x71')][_0x5f2204]),'ChatQueueId':Number(_0x33316f[_0x0dac('0x28')]['id'])});}return _0x1f9a41;});}})['then'](respondWithResult(_0x2b3d8f,null))[_0x0dac('0x26')](handleError(_0x2b3d8f,null));};exports['removeAgents']=function(_0x50ad08,_0x46fbb4){return db['ChatQueue'][_0x0dac('0x36')]({'where':{'id':_0x50ad08['params']['id']}})[_0x0dac('0x14')](handleEntityNotFound(_0x46fbb4,null))[_0x0dac('0x14')](function(_0x44bc28){if(_0x44bc28){return _0x44bc28[_0x0dac('0x6e')](_0x50ad08[_0x0dac('0x23')]['ids'])[_0x0dac('0x14')](function(){if(_[_0x0dac('0x74')](_0x50ad08[_0x0dac('0x23')][_0x0dac('0x71')])){for(var _0x3ee1cc=0x0;_0x3ee1cc<_0x50ad08[_0x0dac('0x23')][_0x0dac('0x71')][_0x0dac('0x3c')];_0x3ee1cc+=0x1){socket[_0x0dac('0x59')](_0x0dac('0x6f'),{'UserId':Number(_0x50ad08[_0x0dac('0x23')][_0x0dac('0x71')][_0x3ee1cc]),'ChatQueueId':Number(_0x50ad08[_0x0dac('0x28')]['id'])});}}else{socket['emit'](_0x0dac('0x6f'),{'UserId':Number(_0x50ad08[_0x0dac('0x23')][_0x0dac('0x71')]),'ChatQueueId':Number(_0x50ad08[_0x0dac('0x28')]['id'])});}});}})[_0x0dac('0x14')](respondWithStatusCode(_0x46fbb4,null))[_0x0dac('0x26')](handleError(_0x46fbb4,null));};exports[_0x0dac('0x75')]=function(_0x22e456,_0x159b7b){var _0x432ac6={};var _0x588ced={};var _0x4ed65c;var _0x2e63f3;return db[_0x0dac('0x1e')]['findOne']({'where':{'id':_0x22e456[_0x0dac('0x28')]['id']}})['then'](handleEntityNotFound(_0x159b7b,null))[_0x0dac('0x14')](function(_0x23ccdc){if(_0x23ccdc){_0x4ed65c=_0x23ccdc;_0x588ced[_0x0dac('0x2d')]=_[_0x0dac('0x29')](db[_0x0dac('0x45')][_0x0dac('0x1f')]);_0x588ced[_0x0dac('0x23')]=_[_0x0dac('0x29')](_0x22e456['query']);_0x588ced['filters']=_['intersection'](_0x588ced['model'],_0x588ced[_0x0dac('0x23')]);_0x432ac6[_0x0dac('0x2c')]=_[_0x0dac('0x2b')](_0x588ced[_0x0dac('0x2d')],qs[_0x0dac('0x2e')](_0x22e456[_0x0dac('0x23')][_0x0dac('0x2e')]));_0x432ac6[_0x0dac('0x2c')]=_0x432ac6[_0x0dac('0x2c')][_0x0dac('0x3c')]?_0x432ac6[_0x0dac('0x2c')]:_0x588ced['model'];_0x432ac6[_0x0dac('0x3f')]=qs[_0x0dac('0x40')](_0x22e456[_0x0dac('0x23')]['sort']);_0x432ac6['where']=qs['filters'](_[_0x0dac('0x41')](_0x22e456[_0x0dac('0x23')],_0x588ced[_0x0dac('0x2a')]));if(_0x22e456[_0x0dac('0x23')][_0x0dac('0x43')]){_0x432ac6[_0x0dac('0x21')]=_['merge'](_0x432ac6[_0x0dac('0x21')],{'$or':_[_0x0dac('0x50')](_0x432ac6[_0x0dac('0x2c')],function(_0x240f7e){var _0x56f6ee={};_0x56f6ee[_0x240f7e]={'$like':'%'+_0x22e456[_0x0dac('0x23')][_0x0dac('0x43')]+'%'};return _0x56f6ee;})});}_0x432ac6=_[_0x0dac('0x30')]({},_0x432ac6,_0x22e456['options']);return _0x4ed65c[_0x0dac('0x75')](_0x432ac6);}})['then'](function(_0x1b6ff4){if(_0x1b6ff4){_0x2e63f3=_0x1b6ff4[_0x0dac('0x3c')];if(!_0x22e456['query'][_0x0dac('0x3d')](_0x0dac('0x3e'))){_0x432ac6[_0x0dac('0xf')]=qs['limit'](_0x22e456[_0x0dac('0x23')][_0x0dac('0xf')]);_0x432ac6[_0x0dac('0xd')]=qs[_0x0dac('0xd')](_0x22e456[_0x0dac('0x23')]['offset']);}return _0x4ed65c[_0x0dac('0x75')](_0x432ac6);}})['then'](function(_0x48e1e4){if(_0x48e1e4){return _0x48e1e4?{'count':_0x2e63f3,'rows':_0x48e1e4}:null;}})[_0x0dac('0x14')](respondWithResult(_0x159b7b,null))[_0x0dac('0x26')](handleError(_0x159b7b,null));}; \ No newline at end of file +var _0x00d9=['UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','ids','voicePause','Agents','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','get','ChatQueues','UserProfileResource','destroy','error','stack','name','send','ChatQueue','type','where','include','query','findAll','rows','catch','show','params','keys','rawAttributes','filters','model','attributes','intersection','fields','length','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','User'];(function(_0x487b6a,_0x59e736){var _0x2f5b86=function(_0x4fc15e){while(--_0x4fc15e){_0x487b6a['push'](_0x487b6a['shift']());}};_0x2f5b86(++_0x59e736);}(_0x00d9,0xa7));var _0x900d=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x00d9[_0x164eca];return _0x2ce562;};'use strict';var BPromise=require('bluebird');var util=require(_0x900d('0x0'));var _=require(_0x900d('0x1'));var squel=require(_0x900d('0x2'));var Redis=require('ioredis');var qs=require(_0x900d('0x3'));var logger=require(_0x900d('0x4'))(_0x900d('0x5'));var config=require(_0x900d('0x6'));var db=require(_0x900d('0x7'))['db'];config[_0x900d('0x8')]=_['defaults'](config[_0x900d('0x8')],{'host':_0x900d('0x9'),'port':0x18eb});var socket=require(_0x900d('0xa'))(new Redis(config[_0x900d('0x8')]));require(_0x900d('0xb'))['register'](socket);function respondWithStatusCode(_0x2d5997,_0x3c3aea){_0x3c3aea=_0x3c3aea||0xcc;return function(_0x2eefe9){if(_0x2eefe9){return _0x2d5997[_0x900d('0xc')](_0x3c3aea);}return _0x2d5997[_0x900d('0xd')](_0x3c3aea)[_0x900d('0xe')]();};}function respondWithResult(_0x56d2d4,_0x493d89){_0x493d89=_0x493d89||0xc8;return function(_0xcd9843){if(_0xcd9843){return _0x56d2d4['status'](_0x493d89)[_0x900d('0xf')](_0xcd9843);}};}function respondWithFilteredResult(_0x341c4a,_0x515501){return function(_0x18443e){if(_0x18443e){var _0x4ac6cb=typeof _0x515501[_0x900d('0x10')]===_0x900d('0x11')&&typeof _0x515501['limit']===_0x900d('0x11');var _0x223cac=_0x18443e[_0x900d('0x12')];var _0x5f337c=_0x4ac6cb?0x0:_0x515501[_0x900d('0x10')];var _0x363f89=_0x4ac6cb?_0x18443e['count']:_0x515501['offset']+_0x515501[_0x900d('0x13')];var _0x554869;if(_0x363f89>=_0x223cac){_0x363f89=_0x223cac;_0x554869=0xc8;}else{_0x554869=0xce;}_0x341c4a[_0x900d('0xd')](_0x554869);return _0x341c4a['set'](_0x900d('0x14'),_0x5f337c+'-'+_0x363f89+'/'+_0x223cac)[_0x900d('0xf')](_0x18443e);}return null;};}function saveUpdates(_0x53f84f){return function(_0x437a8c){if(_0x437a8c){return _0x437a8c[_0x900d('0x15')](_0x53f84f)[_0x900d('0x16')](function(_0x47a44a){return _0x47a44a;});}return null;};}function removeEntity(_0x521652){return function(_0x465244){if(_0x465244){return _0x465244['destroy']()['then'](function(){var _0x1a1126=_0x465244[_0x900d('0x17')]({'plain':!![]});var _0xf78d1f=_0x900d('0x18');return db[_0x900d('0x19')][_0x900d('0x1a')]({'where':{'type':_0xf78d1f,'resourceId':_0x1a1126['id']}})[_0x900d('0x16')](function(){return _0x465244;});})[_0x900d('0x16')](function(){_0x521652[_0x900d('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f64f){return function(_0x49397b){if(!_0x49397b){_0x54f64f[_0x900d('0xc')](0x194);}return _0x49397b;};}function handleError(_0x2f7490,_0x4ca4b5){_0x4ca4b5=_0x4ca4b5||0x1f4;return function(_0x665934){logger[_0x900d('0x1b')](_0x665934[_0x900d('0x1c')]);if(_0x665934[_0x900d('0x1d')]){delete _0x665934[_0x900d('0x1d')];}_0x2f7490[_0x900d('0xd')](_0x4ca4b5)[_0x900d('0x1e')](_0x665934);};}exports['index']=function(_0x1998bf,_0x59f7d0){var _0xd453e1={};var _0x3806bc={'count':0x0,'rows':[]};var _0x32f313=_['map'](db[_0x900d('0x1f')]['rawAttributes'],function(_0x3d70ec){return{'name':_0x3d70ec['fieldName'],'type':_0x3d70ec[_0x900d('0x20')]['key']};});_0xd453e1=qs['getOptions'](_0x32f313,_0x1998bf);var _0x5479aa={'where':_0xd453e1[_0x900d('0x21')]};return db[_0x900d('0x1f')]['count'](_0x5479aa)[_0x900d('0x16')](function(_0x20e0af){_0x3806bc['count']=_0x20e0af;_0xd453e1[_0x900d('0x22')]=qs['include'](_0x1998bf[_0x900d('0x23')]);return db[_0x900d('0x1f')][_0x900d('0x24')](_0xd453e1);})['then'](function(_0x46578f){_0x3806bc[_0x900d('0x25')]=_0x46578f;return _0x3806bc;})[_0x900d('0x16')](respondWithFilteredResult(_0x59f7d0,_0xd453e1))[_0x900d('0x26')](handleError(_0x59f7d0,null));};exports[_0x900d('0x27')]=function(_0x34a0cd,_0x17b857){var _0x38aad8={'raw':!![],'where':{'id':_0x34a0cd[_0x900d('0x28')]['id']}},_0x20a8b9={};_0x20a8b9['model']=_[_0x900d('0x29')](db[_0x900d('0x1f')][_0x900d('0x2a')]);_0x20a8b9[_0x900d('0x23')]=_[_0x900d('0x29')](_0x34a0cd[_0x900d('0x23')]);_0x20a8b9[_0x900d('0x2b')]=_['intersection'](_0x20a8b9[_0x900d('0x2c')],_0x20a8b9[_0x900d('0x23')]);_0x38aad8[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x20a8b9[_0x900d('0x2c')],qs[_0x900d('0x2f')](_0x34a0cd['query'][_0x900d('0x2f')]));_0x38aad8[_0x900d('0x2d')]=_0x38aad8[_0x900d('0x2d')][_0x900d('0x30')]?_0x38aad8[_0x900d('0x2d')]:_0x20a8b9[_0x900d('0x2c')];if(_0x34a0cd[_0x900d('0x23')][_0x900d('0x31')]){_0x38aad8['include']=[{'all':!![]}];}_0x38aad8=_['merge']({},_0x38aad8,_0x34a0cd[_0x900d('0x32')]);return db['ChatQueue'][_0x900d('0x33')](_0x38aad8)[_0x900d('0x16')](handleEntityNotFound(_0x17b857,null))['then'](respondWithResult(_0x17b857,null))['catch'](handleError(_0x17b857,null));};exports[_0x900d('0x34')]=function(_0x3cc19a,_0x56f84b){return db[_0x900d('0x1f')][_0x900d('0x34')](_0x3cc19a[_0x900d('0x35')],{})[_0x900d('0x16')](function(_0x442862){var _0xa8709a=_0x3cc19a['user'][_0x900d('0x17')]({'plain':!![]});if(!_0xa8709a)throw new Error(_0x900d('0x36'));if(_0xa8709a[_0x900d('0x37')]===_0x900d('0x38')){var _0x3aac54=_0x442862[_0x900d('0x17')]({'plain':!![]});var _0x54b13a=_0x900d('0x18');return db['UserProfileSection'][_0x900d('0x33')]({'where':{'name':_0x54b13a,'userProfileId':_0xa8709a[_0x900d('0x39')]},'raw':!![]})[_0x900d('0x16')](function(_0x214549){if(_0x214549&&_0x214549[_0x900d('0x3a')]===0x0){return db[_0x900d('0x19')]['create']({'name':_0x3aac54[_0x900d('0x1d')],'resourceId':_0x3aac54['id'],'type':_0x214549[_0x900d('0x1d')],'sectionId':_0x214549['id']},{})['then'](function(){return _0x442862;});}else{return _0x442862;}})[_0x900d('0x26')](function(_0xbd5f4c){logger[_0x900d('0x1b')](_0x900d('0x3b'),_0xbd5f4c);throw _0xbd5f4c;});}return _0x442862;})[_0x900d('0x16')](respondWithResult(_0x56f84b,0xc9))[_0x900d('0x26')](handleError(_0x56f84b,null));};exports[_0x900d('0x15')]=function(_0x1b30ef,_0x1b556a){if(_0x1b30ef['body']['id']){delete _0x1b30ef[_0x900d('0x35')]['id'];}return db[_0x900d('0x1f')][_0x900d('0x33')]({'where':{'id':_0x1b30ef[_0x900d('0x28')]['id']}})[_0x900d('0x16')](handleEntityNotFound(_0x1b556a,null))['then'](saveUpdates(_0x1b30ef[_0x900d('0x35')],null))[_0x900d('0x16')](respondWithResult(_0x1b556a,null))[_0x900d('0x26')](handleError(_0x1b556a,null));};exports[_0x900d('0x1a')]=function(_0x3791c5,_0x3f6591){return db[_0x900d('0x1f')]['find']({'where':{'id':_0x3791c5[_0x900d('0x28')]['id']}})[_0x900d('0x16')](handleEntityNotFound(_0x3f6591,null))['then'](removeEntity(_0x3f6591,null))['catch'](handleError(_0x3f6591,null));};exports[_0x900d('0x3c')]=function(_0x2db40e,_0x41dca7){return db['ChatQueue'][_0x900d('0x3c')]()['then'](respondWithResult(_0x41dca7,null))[_0x900d('0x26')](handleError(_0x41dca7,null));};exports[_0x900d('0x3d')]=function(_0x274bee,_0x3fc3dc){var _0x32bb1d={'raw':!![],'where':{}},_0x33f751={},_0x2f112c;return db[_0x900d('0x1f')][_0x900d('0x3e')]({'where':{'id':_0x274bee[_0x900d('0x28')]['id']}})[_0x900d('0x16')](handleEntityNotFound(_0x3fc3dc,null))['then'](function(_0x3e624a){if(_0x3e624a){_0x2f112c=_0x3e624a['get']({'plain':!![]});_0x33f751[_0x900d('0x2c')]=_[_0x900d('0x29')](db[_0x900d('0x3f')][_0x900d('0x2a')]);_0x33f751[_0x900d('0x23')]=_[_0x900d('0x29')](_0x274bee[_0x900d('0x23')]);_0x33f751[_0x900d('0x2b')]=_['intersection'](_0x33f751[_0x900d('0x2c')],_0x33f751['query']);_0x32bb1d[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x33f751[_0x900d('0x2c')],qs[_0x900d('0x2f')](_0x274bee[_0x900d('0x23')][_0x900d('0x2f')]));_0x32bb1d[_0x900d('0x2d')]=_0x32bb1d[_0x900d('0x2d')][_0x900d('0x30')]?_0x32bb1d[_0x900d('0x2d')]:_0x33f751[_0x900d('0x2c')];if(!_0x274bee[_0x900d('0x23')][_0x900d('0x40')](_0x900d('0x41'))){_0x32bb1d[_0x900d('0x13')]=qs[_0x900d('0x13')](_0x274bee[_0x900d('0x23')][_0x900d('0x13')]);_0x32bb1d[_0x900d('0x10')]=qs[_0x900d('0x10')](_0x274bee[_0x900d('0x23')][_0x900d('0x10')]);}_0x32bb1d[_0x900d('0x42')]=qs[_0x900d('0x43')](_0x274bee[_0x900d('0x23')]['sort']);_0x32bb1d[_0x900d('0x21')]=qs[_0x900d('0x2b')](_[_0x900d('0x44')](_0x274bee[_0x900d('0x23')],_0x33f751[_0x900d('0x2b')]));_0x32bb1d[_0x900d('0x21')]['ChatQueueId']=_0x3e624a['id'];if(_0x274bee['query'][_0x900d('0x45')]){_0x32bb1d[_0x900d('0x21')]=_[_0x900d('0x46')](_0x32bb1d['where'],{'$or':_[_0x900d('0x47')](_0x32bb1d[_0x900d('0x2d')],function(_0x1f9d18){var _0x4a62dd={};_0x4a62dd[_0x1f9d18]={'$like':'%'+_0x274bee[_0x900d('0x23')][_0x900d('0x45')]+'%'};return _0x4a62dd;})});}_0x32bb1d=_[_0x900d('0x46')]({},_0x32bb1d,_0x274bee[_0x900d('0x32')]);return db[_0x900d('0x3f')][_0x900d('0x24')](_0x32bb1d);}})['then'](function(_0x55a85c){if(_0x55a85c){return db[_0x900d('0x48')]['findAndCountAll']({'where':{'id':_[_0x900d('0x47')](_0x55a85c,_0x900d('0x49')),'role':_0x900d('0x4a')},'attributes':['id',_0x900d('0x1d'),_0x900d('0x4b'),_0x900d('0x4c'),_0x900d('0x4d')]});}})[_0x900d('0x16')](function(_0x59ce07){if(_0x59ce07){return{'count':_0x59ce07['count'],'rows':_['map'](_0x59ce07['rows'],function(_0xb6333c){return{'membername':_0xb6333c[_0x900d('0x1d')],'UserId':_0xb6333c['id'],'queue_name':_0x2f112c[_0x900d('0x1d')],'ChatQueueId':_0x2f112c['id'],'interface':util['format'](_0x900d('0x4e'),_0x900d('0x4f'),_0xb6333c['name']),'penalty':0x0,'paused':_0xb6333c[_0x900d('0x4b')],'createdAt':_0xb6333c['createdAt'],'updatedAt':_0xb6333c[_0x900d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x900d('0x16')](respondWithFilteredResult(_0x3fc3dc,_0x32bb1d))[_0x900d('0x26')](handleError(_0x3fc3dc,null));};exports['getTeams']=function(_0x4593b8,_0x466a74){var _0x49f8eb={};var _0x50acd2={};var _0x475fa7;var _0x45040c;return db[_0x900d('0x1f')]['findOne']({'where':{'id':_0x4593b8[_0x900d('0x28')]['id']}})[_0x900d('0x16')](handleEntityNotFound(_0x466a74,null))[_0x900d('0x16')](function(_0x42703d){if(_0x42703d){_0x475fa7=_0x42703d;_0x50acd2['model']=_['keys'](db[_0x900d('0x50')]['rawAttributes']);_0x50acd2[_0x900d('0x23')]=_[_0x900d('0x29')](_0x4593b8[_0x900d('0x23')]);_0x50acd2[_0x900d('0x2b')]=_[_0x900d('0x2e')](_0x50acd2[_0x900d('0x2c')],_0x50acd2[_0x900d('0x23')]);_0x49f8eb[_0x900d('0x2d')]=_['intersection'](_0x50acd2[_0x900d('0x2c')],qs['fields'](_0x4593b8['query'][_0x900d('0x2f')]));_0x49f8eb[_0x900d('0x2d')]=_0x49f8eb['attributes'][_0x900d('0x30')]?_0x49f8eb[_0x900d('0x2d')]:_0x50acd2['model'];_0x49f8eb[_0x900d('0x42')]=qs[_0x900d('0x43')](_0x4593b8[_0x900d('0x23')][_0x900d('0x43')]);_0x49f8eb[_0x900d('0x21')]=qs['filters'](_['pick'](_0x4593b8[_0x900d('0x23')],_0x50acd2[_0x900d('0x2b')]));if(_0x4593b8[_0x900d('0x23')][_0x900d('0x45')]){_0x49f8eb['where']=_[_0x900d('0x46')](_0x49f8eb[_0x900d('0x21')],{'$or':_['map'](_0x49f8eb['attributes'],function(_0xabf71a){var _0x5694e4={};_0x5694e4[_0xabf71a]={'$like':'%'+_0x4593b8[_0x900d('0x23')][_0x900d('0x45')]+'%'};return _0x5694e4;})});}_0x49f8eb=_[_0x900d('0x46')]({},_0x49f8eb,_0x4593b8[_0x900d('0x32')]);return _0x475fa7['getTeams'](_0x49f8eb);}})['then'](function(_0x41eaef){if(_0x41eaef){_0x45040c=_0x41eaef['length'];if(!_0x4593b8[_0x900d('0x23')][_0x900d('0x40')](_0x900d('0x41'))){_0x49f8eb['limit']=qs['limit'](_0x4593b8['query'][_0x900d('0x13')]);_0x49f8eb[_0x900d('0x10')]=qs[_0x900d('0x10')](_0x4593b8[_0x900d('0x23')][_0x900d('0x10')]);}return _0x475fa7[_0x900d('0x51')](_0x49f8eb);}})['then'](function(_0x4aab39){if(_0x4aab39){return _0x4aab39?{'count':_0x45040c,'rows':_0x4aab39}:null;}})[_0x900d('0x16')](respondWithResult(_0x466a74,null))['catch'](handleError(_0x466a74,null));};exports[_0x900d('0x52')]=function(_0x2aafc0,_0x4c1b92){var _0x5927b2=_0x2aafc0[_0x900d('0x35')][_0x900d('0x53')];return db['Team'][_0x900d('0x24')]({'where':{'id':_0x5927b2},'attributes':['id'],'include':[{'model':db[_0x900d('0x48')],'as':'Agents','attributes':['id','name','online',_0x900d('0x54'),'interface'],'raw':!![]}]})[_0x900d('0x16')](function(_0x49b5f8){if(_0x49b5f8){var _0x512ffa=_['flatMap'](_0x49b5f8,function(_0x2813ee){var _0x4dc106=_0x2813ee[_0x900d('0x17')]({'plain':!![]});return _0x4dc106[_0x900d('0x55')];});return db[_0x900d('0x1f')][_0x900d('0x33')]({'where':{'id':_0x2aafc0['params']['id']}})[_0x900d('0x16')](function(_0xab2546){return db[_0x900d('0x56')]['transaction'](function(_0x34e221){return _0xab2546[_0x900d('0x52')](_0x5927b2,{'transaction':_0x34e221})[_0x900d('0x16')](function(){return BPromise[_0x900d('0x57')](_0x512ffa,function(_0x3ac86b){return db['UserChatQueue'][_0x900d('0x58')]({'where':{'UserId':_0x3ac86b['id'],'ChatQueueId':_0x2aafc0[_0x900d('0x28')]['id']},'transaction':_0x34e221});});})[_0x900d('0x16')](function(){_0x512ffa[_0x900d('0x59')](function(_0x6c90f3){socket[_0x900d('0x5a')](_0x900d('0x5b'),{'UserId':_0x6c90f3['id'],'ChatQueueId':_0xab2546['id']});});});});});}})[_0x900d('0x16')](respondWithStatusCode(_0x4c1b92,null))[_0x900d('0x26')](handleError(_0x4c1b92,null));};exports[_0x900d('0x5c')]=function(_0xf62cfc,_0x4dde0b){return db[_0x900d('0x50')][_0x900d('0x24')]({'where':{'id':_0xf62cfc[_0x900d('0x23')][_0x900d('0x53')]},'attributes':['id'],'include':[{'model':db[_0x900d('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x900d('0x16')](handleEntityNotFound(_0x4dde0b,null))['then'](function(_0x8442f6){var _0x5b1a93=_[_0x900d('0x47')](_0x8442f6,'id');var _0x1d9714=[];var _0x35c052=[];var _0x326034=squel[_0x900d('0x5d')]();_0x326034[_0x900d('0x5e')](_0x900d('0x5f'))[_0x900d('0x60')](_0x900d('0x61'),'tq')[_0x900d('0x62')](_0x900d('0x63'),'ut',_0x900d('0x64'))['where']('ChatQueueId\x20=\x20?',_0xf62cfc[_0x900d('0x28')]['id']);for(var _0x1c0867=0x0;_0x1c0867<_0x8442f6[_0x900d('0x30')];_0x1c0867+=0x1){let _0x48f158=_0x8442f6[_0x1c0867];for(var _0x409cc3=0x0;_0x409cc3<_0x48f158['Agents'][_0x900d('0x30')];_0x409cc3+=0x1){let _0x221834=_0x48f158[_0x900d('0x55')][_0x409cc3];var _0x2b7b30=_0x326034[_0x900d('0x65')]();_0x2b7b30[_0x900d('0x21')](_0x900d('0x66'),_0x221834['id']);_0x35c052[_0x900d('0x67')](db['sequelize'][_0x900d('0x23')](_0x2b7b30[_0x900d('0x68')](),{'type':db['sequelize'][_0x900d('0x69')][_0x900d('0x6a')]})[_0x900d('0x16')](function(_0x51efdf){if(_0x51efdf[_0x900d('0x30')]===0x1){return _0x221834['id'];}else{var _0x54e6fb=_[_0x900d('0x6b')](_['map'](_0x51efdf,_0x900d('0x6c')),function(_0x1e2085){return _['includes'](_0x5b1a93,_0x1e2085);});if(_0x54e6fb){return _0x221834['id'];}}}));}}return BPromise['all'](_0x35c052)['then'](function(_0x3dc99d){_0x1d9714=_(_0x1d9714)[_0x900d('0x6d')](_0x3dc99d)[_0x900d('0x6e')]()[_0x900d('0x6f')]();return db[_0x900d('0x1f')][_0x900d('0x33')]({'where':{'id':_0xf62cfc[_0x900d('0x28')]['id']}})[_0x900d('0x16')](function(_0xaf1616){return db[_0x900d('0x56')][_0x900d('0x70')](function(_0xc3c07c){return _0xaf1616[_0x900d('0x5c')](_0xf62cfc[_0x900d('0x23')][_0x900d('0x53')],{'transaction':_0xc3c07c})['then'](function(){if(!_[_0x900d('0x71')](_0x1d9714)){return _0xaf1616[_0x900d('0x72')](_0x1d9714,{'transaction':_0xc3c07c});}})[_0x900d('0x16')](function(){_0x1d9714['forEach'](function(_0x368795){socket['emit'](_0x900d('0x73'),{'UserId':_0x368795,'ChatQueueId':_0xaf1616['id']});});});});});});})[_0x900d('0x16')](respondWithStatusCode(_0x4dde0b,null))['catch'](handleError(_0x4dde0b,null));};exports[_0x900d('0x74')]=function(_0xf4c985,_0x452cb5){return db[_0x900d('0x1f')]['find']({'where':{'id':_0xf4c985[_0x900d('0x28')]['id']}})[_0x900d('0x16')](handleEntityNotFound(_0x452cb5,null))[_0x900d('0x16')](function(_0xac02fc){if(_0xac02fc){return _0xac02fc[_0x900d('0x74')](_0xf4c985['body'][_0x900d('0x53')],_['omit'](_0xf4c985[_0x900d('0x35')],[_0x900d('0x53'),'id'])||{})[_0x900d('0x75')](function(_0x176177){for(var _0x2fbd8c=0x0;_0x2fbd8c<_0xf4c985[_0x900d('0x35')][_0x900d('0x53')][_0x900d('0x30')];_0x2fbd8c+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0xf4c985[_0x900d('0x35')]['ids'][_0x2fbd8c]),'ChatQueueId':Number(_0xf4c985[_0x900d('0x28')]['id'])});}return _0x176177;});}})[_0x900d('0x16')](respondWithResult(_0x452cb5,null))[_0x900d('0x26')](handleError(_0x452cb5,null));};exports[_0x900d('0x72')]=function(_0x298ad2,_0x455800){return db[_0x900d('0x1f')]['find']({'where':{'id':_0x298ad2[_0x900d('0x28')]['id']}})[_0x900d('0x16')](handleEntityNotFound(_0x455800,null))[_0x900d('0x16')](function(_0x2218d8){if(_0x2218d8){return _0x2218d8[_0x900d('0x72')](_0x298ad2[_0x900d('0x23')][_0x900d('0x53')])[_0x900d('0x16')](function(){if(_[_0x900d('0x76')](_0x298ad2[_0x900d('0x23')][_0x900d('0x53')])){for(var _0x5c07b4=0x0;_0x5c07b4<_0x298ad2[_0x900d('0x23')]['ids']['length'];_0x5c07b4+=0x1){socket[_0x900d('0x5a')](_0x900d('0x73'),{'UserId':Number(_0x298ad2[_0x900d('0x23')][_0x900d('0x53')][_0x5c07b4]),'ChatQueueId':Number(_0x298ad2[_0x900d('0x28')]['id'])});}}else{socket[_0x900d('0x5a')](_0x900d('0x73'),{'UserId':Number(_0x298ad2[_0x900d('0x23')][_0x900d('0x53')]),'ChatQueueId':Number(_0x298ad2[_0x900d('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x455800,null))['catch'](handleError(_0x455800,null));};exports[_0x900d('0x77')]=function(_0x90e37,_0x208087){var _0x4b70d1={};var _0x3ab41e={};var _0x349805;var _0x245f1e;return db[_0x900d('0x1f')]['findOne']({'where':{'id':_0x90e37[_0x900d('0x28')]['id']}})['then'](handleEntityNotFound(_0x208087,null))[_0x900d('0x16')](function(_0x2a00e2){if(_0x2a00e2){_0x349805=_0x2a00e2;_0x3ab41e[_0x900d('0x2c')]=_['keys'](db[_0x900d('0x48')]['rawAttributes']);_0x3ab41e[_0x900d('0x23')]=_['keys'](_0x90e37['query']);_0x3ab41e['filters']=_[_0x900d('0x2e')](_0x3ab41e[_0x900d('0x2c')],_0x3ab41e[_0x900d('0x23')]);_0x4b70d1[_0x900d('0x2d')]=_[_0x900d('0x2e')](_0x3ab41e[_0x900d('0x2c')],qs['fields'](_0x90e37[_0x900d('0x23')]['fields']));_0x4b70d1[_0x900d('0x2d')]=_0x4b70d1[_0x900d('0x2d')][_0x900d('0x30')]?_0x4b70d1[_0x900d('0x2d')]:_0x3ab41e['model'];_0x4b70d1[_0x900d('0x42')]=qs[_0x900d('0x43')](_0x90e37[_0x900d('0x23')][_0x900d('0x43')]);_0x4b70d1[_0x900d('0x21')]=qs[_0x900d('0x2b')](_[_0x900d('0x44')](_0x90e37[_0x900d('0x23')],_0x3ab41e['filters']));if(_0x90e37[_0x900d('0x23')][_0x900d('0x45')]){_0x4b70d1[_0x900d('0x21')]=_[_0x900d('0x46')](_0x4b70d1[_0x900d('0x21')],{'$or':_[_0x900d('0x47')](_0x4b70d1['attributes'],function(_0x2955b7){var _0x2329dd={};_0x2329dd[_0x2955b7]={'$like':'%'+_0x90e37[_0x900d('0x23')][_0x900d('0x45')]+'%'};return _0x2329dd;})});}_0x4b70d1=_['merge']({},_0x4b70d1,_0x90e37[_0x900d('0x32')]);return _0x349805[_0x900d('0x77')](_0x4b70d1);}})[_0x900d('0x16')](function(_0x389a78){if(_0x389a78){_0x245f1e=_0x389a78[_0x900d('0x30')];if(!_0x90e37['query'][_0x900d('0x40')](_0x900d('0x41'))){_0x4b70d1['limit']=qs['limit'](_0x90e37[_0x900d('0x23')]['limit']);_0x4b70d1[_0x900d('0x10')]=qs[_0x900d('0x10')](_0x90e37[_0x900d('0x23')][_0x900d('0x10')]);}return _0x349805[_0x900d('0x77')](_0x4b70d1);}})[_0x900d('0x16')](function(_0x2219e1){if(_0x2219e1){return _0x2219e1?{'count':_0x245f1e,'rows':_0x2219e1}:null;}})[_0x900d('0x16')](respondWithResult(_0x208087,null))[_0x900d('0x26')](handleError(_0x208087,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 51460ef..a357692 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 _0x5d53=['remove','emit','hook','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x2391e9,_0x5ee700){var _0x4c7bc4=function(_0x2b3084){while(--_0x2b3084){_0x2391e9['push'](_0x2391e9['shift']());}};_0x4c7bc4(++_0x5ee700);}(_0x5d53,0x81));var _0x35d5=function(_0x40e3e6,_0x141bc1){_0x40e3e6=_0x40e3e6-0x0;var _0x601283=_0x5d53[_0x40e3e6];return _0x601283;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x35d5('0x0'))['db'][_0x35d5('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x35d5('0x2')](0x0);var events={'afterCreate':_0x35d5('0x3'),'afterUpdate':'update','afterDestroy':_0x35d5('0x4')};function emitEvent(_0x43b95c){return function(_0x5e52b2,_0x98024b,_0x443097){ChatQueueEvents[_0x35d5('0x5')](_0x43b95c+':'+_0x5e52b2['id'],_0x5e52b2);ChatQueueEvents[_0x35d5('0x5')](_0x43b95c,_0x5e52b2);_0x443097(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x35d5('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xa55a=['remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update'];(function(_0x5988b2,_0x576b8e){var _0x255c38=function(_0x19b28d){while(--_0x19b28d){_0x5988b2['push'](_0x5988b2['shift']());}};_0x255c38(++_0x576b8e);}(_0xa55a,0x1b4));var _0xaa55=function(_0x53ba03,_0x18377a){_0x53ba03=_0x53ba03-0x0;var _0x25ac83=_0xa55a[_0x53ba03];return _0x25ac83;};'use strict';var EventEmitter=require(_0xaa55('0x0'));var ChatQueue=require(_0xaa55('0x1'))['db'][_0xaa55('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaa55('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa55('0x4'),'afterDestroy':_0xaa55('0x5')};function emitEvent(_0x109fd8){return function(_0x52142b,_0x4deda6,_0x457b78){ChatQueueEvents[_0xaa55('0x6')](_0x109fd8+':'+_0x52142b['id'],_0x52142b);ChatQueueEvents[_0xaa55('0x6')](_0x109fd8,_0x52142b);_0x457b78(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xaa55('0x7')](e,emitEvent(event));}}module[_0xaa55('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 3474028..a5caf2d 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 _0xbc6f=['ChatQueue','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xbc6f,0x1ae));var _0xfbc6=function(_0xbfc560,_0x311fba){_0xbfc560=_0xbfc560-0x0;var _0x47b022=_0xbc6f[_0xbfc560];return _0x47b022;};'use strict';var _=require(_0xfbc6('0x0'));var util=require(_0xfbc6('0x1'));var logger=require(_0xfbc6('0x2'))('api');var moment=require(_0xfbc6('0x3'));var BPromise=require(_0xfbc6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbc6('0x5'));var rimraf=require('rimraf');var config=require(_0xfbc6('0x6'));var attributes=require(_0xfbc6('0x7'));module[_0xfbc6('0x8')]=function(_0x28bf09,_0x552342){return _0x28bf09[_0xfbc6('0x9')](_0xfbc6('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e6f=['../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x140c66,_0x2df6cf){var _0x31397c=function(_0x26d64b){while(--_0x26d64b){_0x140c66['push'](_0x140c66['shift']());}};_0x31397c(++_0x2df6cf);}(_0x2e6f,0x82));var _0xf2e6=function(_0x84a664,_0x3f3799){_0x84a664=_0x84a664-0x0;var _0x4e1ecf=_0x2e6f[_0x84a664];return _0x4e1ecf;};'use strict';var _=require(_0xf2e6('0x0'));var util=require(_0xf2e6('0x1'));var logger=require(_0xf2e6('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf2e6('0x3'));var fs=require('fs');var path=require(_0xf2e6('0x4'));var rimraf=require(_0xf2e6('0x5'));var config=require(_0xf2e6('0x6'));var attributes=require(_0xf2e6('0x7'));module[_0xf2e6('0x8')]=function(_0x47fcc7,_0x16d236){return _0x47fcc7[_0xf2e6('0x9')](_0xf2e6('0xa'),attributes,{'tableName':_0xf2e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index cf6ce50..0ce7fce 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 _0x00f4=['http','redis','defaults','localhost','socket.io-emitter','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowChatQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2bdcca,_0x1dbcb8){var _0x5ecca4=function(_0x2868e3){while(--_0x2868e3){_0x2bdcca['push'](_0x2bdcca['shift']());}};_0x5ecca4(++_0x1dbcb8);}(_0x00f4,0x137));var _0x400f=function(_0x526fef,_0x184b8e){_0x526fef=_0x526fef-0x0;var _0x113af2=_0x00f4[_0x526fef];return _0x113af2;};'use strict';var _=require(_0x400f('0x0'));var util=require('util');var moment=require(_0x400f('0x1'));var BPromise=require(_0x400f('0x2'));var rs=require(_0x400f('0x3'));var fs=require('fs');var Redis=require(_0x400f('0x4'));var db=require(_0x400f('0x5'))['db'];var utils=require(_0x400f('0x6'));var logger=require(_0x400f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x400f('0x8'));var client=jayson['client'][_0x400f('0x9')]({'port':0x232a});config[_0x400f('0xa')]=_[_0x400f('0xb')](config[_0x400f('0xa')],{'host':_0x400f('0xc'),'port':0x18eb});var socket=require(_0x400f('0xd'))(new Redis(config[_0x400f('0xa')]));require('./chatQueue.socket')[_0x400f('0xe')](socket);function respondWithRpcPromise(_0x3ad157,_0x162379,_0x448d43){return new BPromise(function(_0x481b05,_0x96bdae){return client[_0x400f('0xf')](_0x3ad157,_0x448d43)['then'](function(_0x2d65b4){logger['info'](_0x400f('0x10'),_0x162379,_0x400f('0x11'));logger[_0x400f('0x12')](_0x400f('0x13'),_0x162379,'request\x20sent',JSON['stringify'](_0x2d65b4));if(_0x2d65b4['error']){if(_0x2d65b4[_0x400f('0x14')][_0x400f('0x15')]===0x1f4){logger[_0x400f('0x14')](_0x400f('0x10'),_0x162379,_0x2d65b4['error'][_0x400f('0x16')]);return _0x96bdae(_0x2d65b4[_0x400f('0x14')][_0x400f('0x16')]);}logger[_0x400f('0x14')](_0x400f('0x10'),_0x162379,_0x2d65b4['error'][_0x400f('0x16')]);return _0x481b05(_0x2d65b4[_0x400f('0x14')]['message']);}else{logger['info'](_0x400f('0x10'),_0x162379,'request\x20sent');_0x481b05(_0x2d65b4[_0x400f('0x17')][_0x400f('0x16')]);}})[_0x400f('0x18')](function(_0x24e1ef){logger['error'](_0x400f('0x10'),_0x162379,_0x24e1ef);_0x96bdae(_0x24e1ef);});});}exports[_0x400f('0x19')]=function(_0x84d0fd){var _0x747b41=this;return new Promise(function(_0x3a9e2c,_0x1245ef){return db[_0x400f('0x1a')]['findAll']({'raw':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1c')]===undefined?!![]:![]:!![],'where':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1d')]||null:null,'attributes':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x1e')]||null:null,'limit':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd['options'][_0x400f('0x1f')]||null:null,'include':_0x84d0fd[_0x400f('0x1b')]?_0x84d0fd[_0x400f('0x1b')][_0x400f('0x20')]?_[_0x400f('0x21')](_0x84d0fd[_0x400f('0x1b')][_0x400f('0x20')],function(_0x4e279f){return{'model':db[_0x4e279f[_0x400f('0x22')]],'as':_0x4e279f['as'],'attributes':_0x4e279f[_0x400f('0x1e')],'include':_0x4e279f[_0x400f('0x20')]?_[_0x400f('0x21')](_0x4e279f[_0x400f('0x20')],function(_0x1b62be){return{'model':db[_0x1b62be[_0x400f('0x22')]],'as':_0x1b62be['as'],'attributes':_0x1b62be[_0x400f('0x1e')],'include':_0x1b62be[_0x400f('0x20')]?_[_0x400f('0x21')](_0x1b62be[_0x400f('0x20')],function(_0x5c52f2){return{'model':db[_0x5c52f2[_0x400f('0x22')]],'as':_0x5c52f2['as'],'attributes':_0x5c52f2[_0x400f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x400f('0x23')](function(_0x49c993){logger['info'](_0x400f('0x19'),_0x84d0fd);logger[_0x400f('0x12')](_0x400f('0x19'),_0x84d0fd,JSON[_0x400f('0x24')](_0x49c993));_0x3a9e2c(_0x49c993);})[_0x400f('0x18')](function(_0x218c58){logger[_0x400f('0x14')](_0x400f('0x19'),_0x218c58['message'],_0x84d0fd);_0x1245ef(_0x747b41['error'](0x1f4,_0x218c58[_0x400f('0x16')]));});});};exports[_0x400f('0x25')]=function(_0xc83b4f){var _0x208d33=this;return new Promise(function(_0x8549ec,_0x5d1975){return db[_0x400f('0x1a')][_0x400f('0x26')]({'raw':_0xc83b4f['options']?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x1c')]===undefined?!![]:![]:!![],'where':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f['options'][_0x400f('0x1d')]||null:null,'attributes':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x1e')]||null:null,'include':_0xc83b4f[_0x400f('0x1b')]?_0xc83b4f[_0x400f('0x1b')][_0x400f('0x20')]?_[_0x400f('0x21')](_0xc83b4f[_0x400f('0x1b')][_0x400f('0x20')],function(_0x534d64){return{'model':db[_0x534d64[_0x400f('0x22')]],'as':_0x534d64['as'],'attributes':_0x534d64[_0x400f('0x1e')],'include':_0x534d64[_0x400f('0x20')]?_[_0x400f('0x21')](_0x534d64['include'],function(_0x52e747){return{'model':db[_0x52e747['model']],'as':_0x52e747['as'],'attributes':_0x52e747[_0x400f('0x1e')],'include':_0x52e747[_0x400f('0x20')]?_[_0x400f('0x21')](_0x52e747['include'],function(_0x4d44b0){return{'model':db[_0x4d44b0[_0x400f('0x22')]],'as':_0x4d44b0['as'],'attributes':_0x4d44b0[_0x400f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x400f('0x23')](function(_0x15461a){logger[_0x400f('0x27')]('ShowChatQueue',_0xc83b4f);logger[_0x400f('0x12')](_0x400f('0x25'),_0xc83b4f,JSON[_0x400f('0x24')](_0x15461a));_0x8549ec(_0x15461a);})['catch'](function(_0x3b9d35){logger[_0x400f('0x14')](_0x400f('0x25'),_0x3b9d35[_0x400f('0x16')],_0xc83b4f);_0x5d1975(_0x208d33[_0x400f('0x14')](0x1f4,_0x3b9d35[_0x400f('0x16')]));});});}; \ No newline at end of file +var _0xa887=['options','where','attributes','limit','include','map','model','debug','catch','find','ShowChatQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xa887,0x89));var _0x7a88=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xa887[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x7a88('0x0'));var util=require('util');var moment=require(_0x7a88('0x1'));var BPromise=require(_0x7a88('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a88('0x3'));var db=require(_0x7a88('0x4'))['db'];var utils=require(_0x7a88('0x5'));var logger=require(_0x7a88('0x6'))(_0x7a88('0x7'));var config=require(_0x7a88('0x8'));var jayson=require(_0x7a88('0x9'));var client=jayson[_0x7a88('0xa')][_0x7a88('0xb')]({'port':0x232a});config['redis']=_[_0x7a88('0xc')](config[_0x7a88('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a88('0xe'))(new Redis(config['redis']));require(_0x7a88('0xf'))[_0x7a88('0x10')](socket);function respondWithRpcPromise(_0x2d0893,_0x4b4568,_0x59f61a){return new BPromise(function(_0x11c10e,_0x3c324b){return client[_0x7a88('0x11')](_0x2d0893,_0x59f61a)[_0x7a88('0x12')](function(_0x8ccfc){logger[_0x7a88('0x13')](_0x7a88('0x14'),_0x4b4568,_0x7a88('0x15'));logger['debug'](_0x7a88('0x16'),_0x4b4568,'request\x20sent',JSON[_0x7a88('0x17')](_0x8ccfc));if(_0x8ccfc[_0x7a88('0x18')]){if(_0x8ccfc[_0x7a88('0x18')][_0x7a88('0x19')]===0x1f4){logger['error'](_0x7a88('0x14'),_0x4b4568,_0x8ccfc['error'][_0x7a88('0x1a')]);return _0x3c324b(_0x8ccfc['error']['message']);}logger['error'](_0x7a88('0x14'),_0x4b4568,_0x8ccfc['error'][_0x7a88('0x1a')]);return _0x11c10e(_0x8ccfc[_0x7a88('0x18')][_0x7a88('0x1a')]);}else{logger[_0x7a88('0x13')](_0x7a88('0x14'),_0x4b4568,'request\x20sent');_0x11c10e(_0x8ccfc[_0x7a88('0x1b')]['message']);}})['catch'](function(_0x2de466){logger[_0x7a88('0x18')](_0x7a88('0x14'),_0x4b4568,_0x2de466);_0x3c324b(_0x2de466);});});}exports[_0x7a88('0x1c')]=function(_0x1ec86f){var _0x1341ca=this;return new Promise(function(_0x263813,_0x9d9d08){return db[_0x7a88('0x1d')][_0x7a88('0x1e')]({'raw':_0x1ec86f[_0x7a88('0x1f')]?_0x1ec86f[_0x7a88('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec86f['options']?_0x1ec86f[_0x7a88('0x1f')][_0x7a88('0x20')]||null:null,'attributes':_0x1ec86f['options']?_0x1ec86f['options'][_0x7a88('0x21')]||null:null,'limit':_0x1ec86f[_0x7a88('0x1f')]?_0x1ec86f[_0x7a88('0x1f')][_0x7a88('0x22')]||null:null,'include':_0x1ec86f['options']?_0x1ec86f[_0x7a88('0x1f')][_0x7a88('0x23')]?_[_0x7a88('0x24')](_0x1ec86f[_0x7a88('0x1f')]['include'],function(_0x4a1d65){return{'model':db[_0x4a1d65[_0x7a88('0x25')]],'as':_0x4a1d65['as'],'attributes':_0x4a1d65['attributes'],'include':_0x4a1d65[_0x7a88('0x23')]?_['map'](_0x4a1d65['include'],function(_0x22029a){return{'model':db[_0x22029a[_0x7a88('0x25')]],'as':_0x22029a['as'],'attributes':_0x22029a[_0x7a88('0x21')],'include':_0x22029a[_0x7a88('0x23')]?_[_0x7a88('0x24')](_0x22029a['include'],function(_0x5f48a7){return{'model':db[_0x5f48a7[_0x7a88('0x25')]],'as':_0x5f48a7['as'],'attributes':_0x5f48a7[_0x7a88('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7a88('0x12')](function(_0x217756){logger[_0x7a88('0x13')](_0x7a88('0x1c'),_0x1ec86f);logger[_0x7a88('0x26')](_0x7a88('0x1c'),_0x1ec86f,JSON[_0x7a88('0x17')](_0x217756));_0x263813(_0x217756);})[_0x7a88('0x27')](function(_0x37de84){logger[_0x7a88('0x18')](_0x7a88('0x1c'),_0x37de84[_0x7a88('0x1a')],_0x1ec86f);_0x9d9d08(_0x1341ca[_0x7a88('0x18')](0x1f4,_0x37de84[_0x7a88('0x1a')]));});});};exports['ShowChatQueue']=function(_0x1b77e3){var _0x450fbd=this;return new Promise(function(_0x174215,_0x12964b){return db[_0x7a88('0x1d')][_0x7a88('0x28')]({'raw':_0x1b77e3[_0x7a88('0x1f')]?_0x1b77e3[_0x7a88('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1b77e3['options']?_0x1b77e3[_0x7a88('0x1f')]['where']||null:null,'attributes':_0x1b77e3[_0x7a88('0x1f')]?_0x1b77e3[_0x7a88('0x1f')][_0x7a88('0x21')]||null:null,'include':_0x1b77e3[_0x7a88('0x1f')]?_0x1b77e3['options'][_0x7a88('0x23')]?_['map'](_0x1b77e3[_0x7a88('0x1f')][_0x7a88('0x23')],function(_0x1f9a4f){return{'model':db[_0x1f9a4f['model']],'as':_0x1f9a4f['as'],'attributes':_0x1f9a4f[_0x7a88('0x21')],'include':_0x1f9a4f[_0x7a88('0x23')]?_[_0x7a88('0x24')](_0x1f9a4f['include'],function(_0x115016){return{'model':db[_0x115016[_0x7a88('0x25')]],'as':_0x115016['as'],'attributes':_0x115016[_0x7a88('0x21')],'include':_0x115016[_0x7a88('0x23')]?_['map'](_0x115016[_0x7a88('0x23')],function(_0x257293){return{'model':db[_0x257293[_0x7a88('0x25')]],'as':_0x257293['as'],'attributes':_0x257293[_0x7a88('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7a88('0x12')](function(_0x555db7){logger['info']('ShowChatQueue',_0x1b77e3);logger[_0x7a88('0x26')]('ShowChatQueue',_0x1b77e3,JSON[_0x7a88('0x17')](_0x555db7));_0x174215(_0x555db7);})[_0x7a88('0x27')](function(_0x34e729){logger[_0x7a88('0x18')](_0x7a88('0x29'),_0x34e729[_0x7a88('0x1a')],_0x1b77e3);_0x12964b(_0x450fbd[_0x7a88('0x18')](0x1f4,_0x34e729[_0x7a88('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d736e8b..bc39af4 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 _0x702d=['remove','update','emit','register','length','./chatQueue.events','save'];(function(_0x543330,_0xd22a7a){var _0x566789=function(_0x50f03c){while(--_0x50f03c){_0x543330['push'](_0x543330['shift']());}};_0x566789(++_0xd22a7a);}(_0x702d,0x147));var _0xd702=function(_0x118a4f,_0x4acdf7){_0x118a4f=_0x118a4f-0x0;var _0x24fed9=_0x702d[_0x118a4f];return _0x24fed9;};'use strict';var ChatQueueEvents=require(_0xd702('0x0'));var events=[_0xd702('0x1'),_0xd702('0x2'),_0xd702('0x3')];function createListener(_0x37ed5c,_0x5c2b9e){return function(_0x20c11a){_0x5c2b9e[_0xd702('0x4')](_0x37ed5c,_0x20c11a);};}function removeListener(_0x27b260,_0x1c5a32){return function(){ChatQueueEvents['removeListener'](_0x27b260,_0x1c5a32);};}exports[_0xd702('0x5')]=function(_0x544e94){for(var _0x1aecfc=0x0,_0x3a2c03=events[_0xd702('0x6')];_0x1aecfc<_0x3a2c03;_0x1aecfc++){var _0x5af246=events[_0x1aecfc];var _0x12bb75=createListener('chatQueue:'+_0x5af246,_0x544e94);ChatQueueEvents['on'](_0x5af246,_0x12bb75);}}; \ No newline at end of file +var _0x2bc6=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x9709cb,_0x5a972d){var _0x596db5=function(_0x51cb96){while(--_0x51cb96){_0x9709cb['push'](_0x9709cb['shift']());}};_0x596db5(++_0x5a972d);}(_0x2bc6,0x163));var _0x62bc=function(_0x3b7dce,_0x1c5ada){_0x3b7dce=_0x3b7dce-0x0;var _0x9e7579=_0x2bc6[_0x3b7dce];return _0x9e7579;};'use strict';var ChatQueueEvents=require(_0x62bc('0x0'));var events=[_0x62bc('0x1'),_0x62bc('0x2'),'update'];function createListener(_0x4b4e73,_0x5a2676){return function(_0x5c5a2a){_0x5a2676[_0x62bc('0x3')](_0x4b4e73,_0x5c5a2a);};}function removeListener(_0x576608,_0x2a1959){return function(){ChatQueueEvents[_0x62bc('0x4')](_0x576608,_0x2a1959);};}exports['register']=function(_0x3cce26){for(var _0x450cb6=0x0,_0x40af10=events[_0x62bc('0x5')];_0x450cb6<_0x40af10;_0x450cb6++){var _0x3ed6ad=events[_0x450cb6];var _0x3f625c=createListener('chatQueue:'+_0x3ed6ad,_0x3cce26);ChatQueueEvents['on'](_0x3ed6ad,_0x3f625c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 36b21eb..473a6be 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x145d05,_0xfa7441){var _0x39710d=function(_0x565177){while(--_0x565177){_0x145d05['push'](_0x145d05['shift']());}};_0x39710d(++_0xfa7441);}(_0xe14b,0x93));var _0xbe14=function(_0x4d957c,_0x446fa1){_0x4d957c=_0x4d957c-0x0;var _0x57029f=_0xe14b[_0x4d957c];return _0x57029f;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b5067,_0x28e5c6){var _0x36d229=function(_0x549a5d){while(--_0x549a5d){_0x2b5067['push'](_0x2b5067['shift']());}};_0x36d229(++_0x28e5c6);}(_0x7217,0x19e));var _0x7721=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7217[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 4072865..dbde523 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 _0x1052=['sequelize','exports','STRING','DATE','moment'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x1052,0xf4));var _0x2105=function(_0x4956f2,_0xb602ca){_0x4956f2=_0x4956f2-0x0;var _0x1da579=_0x1052[_0x4956f2];return _0x1da579;};'use strict';var moment=require(_0x2105('0x0'));var Sequelize=require(_0x2105('0x1'));module[_0x2105('0x2')]={'uniqueid':{'type':Sequelize[_0x2105('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2105('0x3')]},'joinAt':{'type':Sequelize[_0x2105('0x4')]},'leaveAt':{'type':Sequelize[_0x2105('0x4')]},'acceptAt':{'type':Sequelize[_0x2105('0x4')]},'exitAt':{'type':Sequelize[_0x2105('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbc3a=['moment','sequelize','exports','STRING','DATE'];(function(_0x6e44aa,_0x4d94f1){var _0x59811b=function(_0x533d75){while(--_0x533d75){_0x6e44aa['push'](_0x6e44aa['shift']());}};_0x59811b(++_0x4d94f1);}(_0xbc3a,0xb4));var _0xabc3=function(_0x44ba82,_0x2ac956){_0x44ba82=_0x44ba82-0x0;var _0x29b5da=_0xbc3a[_0x44ba82];return _0x29b5da;};'use strict';var moment=require(_0xabc3('0x0'));var Sequelize=require(_0xabc3('0x1'));module[_0xabc3('0x2')]={'uniqueid':{'type':Sequelize[_0xabc3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xabc3('0x3')]},'joinAt':{'type':Sequelize[_0xabc3('0x4')]},'leaveAt':{'type':Sequelize[_0xabc3('0x4')]},'acceptAt':{'type':Sequelize[_0xabc3('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index bfcb547..25226e6 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 _0x8e20=['includeAll','catch','show','params','length','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','apply','reject','update','then','end','error','name','send','index','map','ChatQueueReport','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8e20,0x1af));var _0x08e2=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0x8e20[_0x134d5e];return _0x1e166a;};'use strict';var emlformat=require(_0x08e2('0x0'));var rimraf=require(_0x08e2('0x1'));var zipdir=require(_0x08e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08e2('0x3'));var moment=require(_0x08e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x08e2('0x5'));var util=require(_0x08e2('0x6'));var path=require(_0x08e2('0x7'));var sox=require(_0x08e2('0x8'));var csv=require(_0x08e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08e2('0xa'));var _=require(_0x08e2('0xb'));var squel=require('squel');var crypto=require(_0x08e2('0xc'));var jsforce=require(_0x08e2('0xd'));var deskjs=require(_0x08e2('0xe'));var toCsv=require(_0x08e2('0x9'));var querystring=require(_0x08e2('0xf'));var Papa=require(_0x08e2('0x10'));var Redis=require('ioredis');var authService=require(_0x08e2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08e2('0x12'));var logger=require(_0x08e2('0x13'))(_0x08e2('0x14'));var utils=require(_0x08e2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x08e2('0x16'))['db'];function respondWithStatusCode(_0x4e104a,_0x5ae6ec){_0x5ae6ec=_0x5ae6ec||0xcc;return function(_0x401fea){if(_0x401fea){return _0x4e104a['sendStatus'](_0x5ae6ec);}return _0x4e104a[_0x08e2('0x17')](_0x5ae6ec)['end']();};}function respondWithResult(_0x42b1c0,_0x4cffce){_0x4cffce=_0x4cffce||0xc8;return function(_0x53a428){if(_0x53a428){return _0x42b1c0['status'](_0x4cffce)[_0x08e2('0x18')](_0x53a428);}};}function respondWithFilteredResult(_0x19c892,_0x191ba8){return function(_0x5c4ee1){if(_0x5c4ee1){var _0x549025=typeof _0x191ba8['offset']==='undefined'&&typeof _0x191ba8['limit']==='undefined';var _0x38a080=_0x5c4ee1[_0x08e2('0x19')];var _0x300934=_0x549025?0x0:_0x191ba8[_0x08e2('0x1a')];var _0xb1e01a=_0x549025?_0x5c4ee1[_0x08e2('0x19')]:_0x191ba8[_0x08e2('0x1a')]+_0x191ba8[_0x08e2('0x1b')];var _0x2a1c80;if(_0xb1e01a>=_0x38a080){_0xb1e01a=_0x38a080;_0x2a1c80=0xc8;}else{_0x2a1c80=0xce;}_0x19c892[_0x08e2('0x17')](_0x2a1c80);return _0x19c892[_0x08e2('0x1c')]('Content-Range',_0x300934+'-'+_0xb1e01a+'/'+_0x38a080)['json'](_0x5c4ee1);}return null;};}function patchUpdates(_0x52787e){return function(_0x1a441a){try{jsonpatch[_0x08e2('0x1d')](_0x1a441a,_0x52787e,!![]);}catch(_0x59b200){return BPromise[_0x08e2('0x1e')](_0x59b200);}return _0x1a441a['save']();};}function saveUpdates(_0x375e3f,_0x53f3ab){return function(_0x416e6c){if(_0x416e6c){return _0x416e6c[_0x08e2('0x1f')](_0x375e3f)[_0x08e2('0x20')](function(_0x3dbd7e){return _0x3dbd7e;});}return null;};}function removeEntity(_0x98b217,_0x5a8a4e){return function(_0x5878a9){if(_0x5878a9){return _0x5878a9['destroy']()[_0x08e2('0x20')](function(){_0x98b217[_0x08e2('0x17')](0xcc)[_0x08e2('0x21')]();});}};}function handleEntityNotFound(_0x1ef5ef,_0x155bea){return function(_0x4dbf2c){if(!_0x4dbf2c){_0x1ef5ef['sendStatus'](0x194);}return _0x4dbf2c;};}function handleError(_0x4cbe10,_0x3d5d37){_0x3d5d37=_0x3d5d37||0x1f4;return function(_0x202f84){logger[_0x08e2('0x22')](_0x202f84['stack']);if(_0x202f84[_0x08e2('0x23')]){delete _0x202f84['name'];}_0x4cbe10[_0x08e2('0x17')](_0x3d5d37)[_0x08e2('0x24')](_0x202f84);};}exports[_0x08e2('0x25')]=function(_0x5cdfb2,_0x1fc933){var _0x2d3549={},_0x442105={},_0x24a633={'count':0x0,'rows':[]};var _0x5b371b=_[_0x08e2('0x26')](db[_0x08e2('0x27')][_0x08e2('0x28')],function(_0x37d416){return{'name':_0x37d416['fieldName'],'type':_0x37d416[_0x08e2('0x29')][_0x08e2('0x2a')]};});_0x442105['model']=_[_0x08e2('0x26')](_0x5b371b,'name');_0x442105['query']=_[_0x08e2('0x2b')](_0x5cdfb2[_0x08e2('0x2c')]);_0x442105[_0x08e2('0x2d')]=_[_0x08e2('0x2e')](_0x442105[_0x08e2('0x2f')],_0x442105['query']);_0x2d3549[_0x08e2('0x30')]=_[_0x08e2('0x2e')](_0x442105['model'],qs[_0x08e2('0x31')](_0x5cdfb2[_0x08e2('0x2c')]['fields']));_0x2d3549[_0x08e2('0x30')]=_0x2d3549[_0x08e2('0x30')]['length']?_0x2d3549[_0x08e2('0x30')]:_0x442105[_0x08e2('0x2f')];if(!_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x32')](_0x08e2('0x33'))){_0x2d3549['limit']=qs[_0x08e2('0x1b')](_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x1b')]);_0x2d3549['offset']=qs[_0x08e2('0x1a')](_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x1a')]);}_0x2d3549[_0x08e2('0x34')]=qs[_0x08e2('0x35')](_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x35')]);_0x2d3549['where']=qs['filters'](_[_0x08e2('0x36')](_0x5cdfb2[_0x08e2('0x2c')],_0x442105[_0x08e2('0x2d')]),_0x5b371b);if(_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x37')]){_0x2d3549[_0x08e2('0x38')]=_[_0x08e2('0x39')](_0x2d3549['where'],{'$or':_['map'](_0x5b371b,function(_0x56e712){if(_0x56e712['type']!==_0x08e2('0x3a')){var _0xf30321={};_0xf30321[_0x56e712[_0x08e2('0x23')]]={'$like':'%'+_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x37')]+'%'};return _0xf30321;}})});}_0x2d3549=_[_0x08e2('0x39')]({},_0x2d3549,_0x5cdfb2['options']);var _0x42f062={'where':_0x2d3549[_0x08e2('0x38')]};return db[_0x08e2('0x27')]['count'](_0x42f062)[_0x08e2('0x20')](function(_0x5b07c3){_0x24a633[_0x08e2('0x19')]=_0x5b07c3;if(_0x5cdfb2[_0x08e2('0x2c')][_0x08e2('0x3b')]){_0x2d3549['include']=[{'all':!![]}];}return db[_0x08e2('0x27')]['findAll'](_0x2d3549);})[_0x08e2('0x20')](function(_0x3d41f7){_0x24a633['rows']=_0x3d41f7;return _0x24a633;})[_0x08e2('0x20')](respondWithFilteredResult(_0x1fc933,_0x2d3549))[_0x08e2('0x3c')](handleError(_0x1fc933,null));};exports[_0x08e2('0x3d')]=function(_0x3d23f4,_0x3ce642){var _0x2e9c12={'raw':!![],'where':{'id':_0x3d23f4[_0x08e2('0x3e')]['id']}},_0x3db80b={};_0x3db80b[_0x08e2('0x2f')]=_[_0x08e2('0x2b')](db[_0x08e2('0x27')][_0x08e2('0x28')]);_0x3db80b[_0x08e2('0x2c')]=_[_0x08e2('0x2b')](_0x3d23f4[_0x08e2('0x2c')]);_0x3db80b[_0x08e2('0x2d')]=_[_0x08e2('0x2e')](_0x3db80b['model'],_0x3db80b[_0x08e2('0x2c')]);_0x2e9c12['attributes']=_[_0x08e2('0x2e')](_0x3db80b[_0x08e2('0x2f')],qs[_0x08e2('0x31')](_0x3d23f4[_0x08e2('0x2c')][_0x08e2('0x31')]));_0x2e9c12[_0x08e2('0x30')]=_0x2e9c12[_0x08e2('0x30')][_0x08e2('0x3f')]?_0x2e9c12['attributes']:_0x3db80b[_0x08e2('0x2f')];if(_0x3d23f4[_0x08e2('0x2c')][_0x08e2('0x3b')]){_0x2e9c12[_0x08e2('0x40')]=[{'all':!![]}];}_0x2e9c12=_[_0x08e2('0x39')]({},_0x2e9c12,_0x3d23f4['options']);return db[_0x08e2('0x27')]['find'](_0x2e9c12)[_0x08e2('0x20')](handleEntityNotFound(_0x3ce642,null))[_0x08e2('0x20')](respondWithResult(_0x3ce642,null))[_0x08e2('0x3c')](handleError(_0x3ce642,null));};exports[_0x08e2('0x41')]=function(_0x3f9e3b,_0x4475d0){return db[_0x08e2('0x27')][_0x08e2('0x41')](_0x3f9e3b[_0x08e2('0x42')],{})[_0x08e2('0x20')](respondWithResult(_0x4475d0,0xc9))[_0x08e2('0x3c')](handleError(_0x4475d0,null));};exports[_0x08e2('0x1f')]=function(_0x18cb28,_0x12939f){if(_0x18cb28['body']['id']){delete _0x18cb28[_0x08e2('0x42')]['id'];}return db[_0x08e2('0x27')][_0x08e2('0x43')]({'where':{'id':_0x18cb28[_0x08e2('0x3e')]['id']}})[_0x08e2('0x20')](handleEntityNotFound(_0x12939f,null))[_0x08e2('0x20')](saveUpdates(_0x18cb28[_0x08e2('0x42')],null))[_0x08e2('0x20')](respondWithResult(_0x12939f,null))[_0x08e2('0x3c')](handleError(_0x12939f,null));};exports[_0x08e2('0x44')]=function(_0x296020,_0x3f1a98){return db[_0x08e2('0x27')]['find']({'where':{'id':_0x296020[_0x08e2('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3f1a98,null))[_0x08e2('0x20')](removeEntity(_0x3f1a98,null))['catch'](handleError(_0x3f1a98,null));};exports[_0x08e2('0x45')]=function(_0x3b6cd9,_0x349873){return db['ChatQueueReport'][_0x08e2('0x45')]()[_0x08e2('0x20')](respondWithResult(_0x349873,null))['catch'](handleError(_0x349873,null));}; \ No newline at end of file +var _0xe08b=['undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','length','include','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0xe08b,0x10e));var _0xbe08=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe08b[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require(_0xbe08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe08('0x1'));var jsonpatch=require(_0xbe08('0x2'));var rp=require('request-promise');var moment=require(_0xbe08('0x3'));var BPromise=require(_0xbe08('0x4'));var Mustache=require(_0xbe08('0x5'));var util=require(_0xbe08('0x6'));var path=require(_0xbe08('0x7'));var sox=require(_0xbe08('0x8'));var csv=require(_0xbe08('0x9'));var ejs=require(_0xbe08('0xa'));var fs=require('fs');var fs_extra=require(_0xbe08('0xb'));var _=require(_0xbe08('0xc'));var squel=require(_0xbe08('0xd'));var crypto=require(_0xbe08('0xe'));var jsforce=require(_0xbe08('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbe08('0x9'));var querystring=require(_0xbe08('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe08('0x11'));var authService=require(_0xbe08('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbe08('0x13'));var hardwareService=require(_0xbe08('0x14'));var logger=require('../../config/logger')(_0xbe08('0x15'));var utils=require(_0xbe08('0x16'));var config=require(_0xbe08('0x17'));var licenseUtil=require(_0xbe08('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ab71,_0x49410b){_0x49410b=_0x49410b||0xcc;return function(_0x18ee13){if(_0x18ee13){return _0x42ab71[_0xbe08('0x19')](_0x49410b);}return _0x42ab71[_0xbe08('0x1a')](_0x49410b)[_0xbe08('0x1b')]();};}function respondWithResult(_0xe1dafa,_0x3050f1){_0x3050f1=_0x3050f1||0xc8;return function(_0x434646){if(_0x434646){return _0xe1dafa[_0xbe08('0x1a')](_0x3050f1)[_0xbe08('0x1c')](_0x434646);}};}function respondWithFilteredResult(_0x191f51,_0x457129){return function(_0x2b0901){if(_0x2b0901){var _0x122f44=typeof _0x457129[_0xbe08('0x1d')]===_0xbe08('0x1e')&&typeof _0x457129[_0xbe08('0x1f')]===_0xbe08('0x1e');var _0x344019=_0x2b0901['count'];var _0x2fa9b3=_0x122f44?0x0:_0x457129[_0xbe08('0x1d')];var _0x154559=_0x122f44?_0x2b0901[_0xbe08('0x20')]:_0x457129[_0xbe08('0x1d')]+_0x457129[_0xbe08('0x1f')];var _0x1f9808;if(_0x154559>=_0x344019){_0x154559=_0x344019;_0x1f9808=0xc8;}else{_0x1f9808=0xce;}_0x191f51['status'](_0x1f9808);return _0x191f51[_0xbe08('0x21')](_0xbe08('0x22'),_0x2fa9b3+'-'+_0x154559+'/'+_0x344019)['json'](_0x2b0901);}return null;};}function patchUpdates(_0x5ab5f5){return function(_0x439a78){try{jsonpatch[_0xbe08('0x23')](_0x439a78,_0x5ab5f5,!![]);}catch(_0x3785e4){return BPromise['reject'](_0x3785e4);}return _0x439a78[_0xbe08('0x24')]();};}function saveUpdates(_0x25ce24,_0x42143c){return function(_0x45697b){if(_0x45697b){return _0x45697b[_0xbe08('0x25')](_0x25ce24)[_0xbe08('0x26')](function(_0xf1c94a){return _0xf1c94a;});}return null;};}function removeEntity(_0x451732,_0x2d6493){return function(_0x493d13){if(_0x493d13){return _0x493d13[_0xbe08('0x27')]()[_0xbe08('0x26')](function(){_0x451732[_0xbe08('0x1a')](0xcc)[_0xbe08('0x1b')]();});}};}function handleEntityNotFound(_0x3310be,_0x28d47b){return function(_0x368122){if(!_0x368122){_0x3310be[_0xbe08('0x19')](0x194);}return _0x368122;};}function handleError(_0x628624,_0x361b06){_0x361b06=_0x361b06||0x1f4;return function(_0x5e470c){logger[_0xbe08('0x28')](_0x5e470c[_0xbe08('0x29')]);if(_0x5e470c[_0xbe08('0x2a')]){delete _0x5e470c[_0xbe08('0x2a')];}_0x628624[_0xbe08('0x1a')](_0x361b06)[_0xbe08('0x2b')](_0x5e470c);};}exports['index']=function(_0x415da3,_0x2aaa12){var _0x3b77bb={},_0x465b7b={},_0x1135c3={'count':0x0,'rows':[]};var _0x523be0=_[_0xbe08('0x2c')](db[_0xbe08('0x2d')][_0xbe08('0x2e')],function(_0x54c913){return{'name':_0x54c913[_0xbe08('0x2f')],'type':_0x54c913[_0xbe08('0x30')]['key']};});_0x465b7b[_0xbe08('0x31')]=_[_0xbe08('0x2c')](_0x523be0,'name');_0x465b7b[_0xbe08('0x32')]=_[_0xbe08('0x33')](_0x415da3[_0xbe08('0x32')]);_0x465b7b[_0xbe08('0x34')]=_[_0xbe08('0x35')](_0x465b7b[_0xbe08('0x31')],_0x465b7b[_0xbe08('0x32')]);_0x3b77bb[_0xbe08('0x36')]=_[_0xbe08('0x35')](_0x465b7b[_0xbe08('0x31')],qs[_0xbe08('0x37')](_0x415da3[_0xbe08('0x32')][_0xbe08('0x37')]));_0x3b77bb[_0xbe08('0x36')]=_0x3b77bb[_0xbe08('0x36')]['length']?_0x3b77bb['attributes']:_0x465b7b[_0xbe08('0x31')];if(!_0x415da3[_0xbe08('0x32')]['hasOwnProperty'](_0xbe08('0x38'))){_0x3b77bb[_0xbe08('0x1f')]=qs[_0xbe08('0x1f')](_0x415da3[_0xbe08('0x32')]['limit']);_0x3b77bb[_0xbe08('0x1d')]=qs[_0xbe08('0x1d')](_0x415da3['query']['offset']);}_0x3b77bb[_0xbe08('0x39')]=qs[_0xbe08('0x3a')](_0x415da3[_0xbe08('0x32')][_0xbe08('0x3a')]);_0x3b77bb['where']=qs[_0xbe08('0x34')](_['pick'](_0x415da3[_0xbe08('0x32')],_0x465b7b[_0xbe08('0x34')]),_0x523be0);if(_0x415da3['query'][_0xbe08('0x3b')]){_0x3b77bb[_0xbe08('0x3c')]=_[_0xbe08('0x3d')](_0x3b77bb[_0xbe08('0x3c')],{'$or':_[_0xbe08('0x2c')](_0x523be0,function(_0x56db9c){if(_0x56db9c[_0xbe08('0x30')]!==_0xbe08('0x3e')){var _0x2c80d7={};_0x2c80d7[_0x56db9c[_0xbe08('0x2a')]]={'$like':'%'+_0x415da3[_0xbe08('0x32')][_0xbe08('0x3b')]+'%'};return _0x2c80d7;}})});}_0x3b77bb=_[_0xbe08('0x3d')]({},_0x3b77bb,_0x415da3[_0xbe08('0x3f')]);var _0x357158={'where':_0x3b77bb['where']};return db[_0xbe08('0x2d')][_0xbe08('0x20')](_0x357158)['then'](function(_0x4f0bbe){_0x1135c3[_0xbe08('0x20')]=_0x4f0bbe;if(_0x415da3['query'][_0xbe08('0x40')]){_0x3b77bb['include']=[{'all':!![]}];}return db[_0xbe08('0x2d')][_0xbe08('0x41')](_0x3b77bb);})[_0xbe08('0x26')](function(_0x337c2b){_0x1135c3[_0xbe08('0x42')]=_0x337c2b;return _0x1135c3;})[_0xbe08('0x26')](respondWithFilteredResult(_0x2aaa12,_0x3b77bb))[_0xbe08('0x43')](handleError(_0x2aaa12,null));};exports['show']=function(_0x274139,_0x16d412){var _0x4b4d7a={'raw':!![],'where':{'id':_0x274139['params']['id']}},_0x59179f={};_0x59179f[_0xbe08('0x31')]=_[_0xbe08('0x33')](db['ChatQueueReport']['rawAttributes']);_0x59179f[_0xbe08('0x32')]=_[_0xbe08('0x33')](_0x274139[_0xbe08('0x32')]);_0x59179f[_0xbe08('0x34')]=_[_0xbe08('0x35')](_0x59179f[_0xbe08('0x31')],_0x59179f[_0xbe08('0x32')]);_0x4b4d7a[_0xbe08('0x36')]=_['intersection'](_0x59179f[_0xbe08('0x31')],qs[_0xbe08('0x37')](_0x274139[_0xbe08('0x32')][_0xbe08('0x37')]));_0x4b4d7a[_0xbe08('0x36')]=_0x4b4d7a[_0xbe08('0x36')][_0xbe08('0x44')]?_0x4b4d7a['attributes']:_0x59179f['model'];if(_0x274139[_0xbe08('0x32')][_0xbe08('0x40')]){_0x4b4d7a[_0xbe08('0x45')]=[{'all':!![]}];}_0x4b4d7a=_[_0xbe08('0x3d')]({},_0x4b4d7a,_0x274139[_0xbe08('0x3f')]);return db['ChatQueueReport']['find'](_0x4b4d7a)['then'](handleEntityNotFound(_0x16d412,null))[_0xbe08('0x26')](respondWithResult(_0x16d412,null))['catch'](handleError(_0x16d412,null));};exports['create']=function(_0x1e6e6e,_0x9a9e38){return db[_0xbe08('0x2d')][_0xbe08('0x46')](_0x1e6e6e[_0xbe08('0x47')],{})[_0xbe08('0x26')](respondWithResult(_0x9a9e38,0xc9))[_0xbe08('0x43')](handleError(_0x9a9e38,null));};exports[_0xbe08('0x25')]=function(_0x592a7e,_0x2bd33a){if(_0x592a7e[_0xbe08('0x47')]['id']){delete _0x592a7e[_0xbe08('0x47')]['id'];}return db['ChatQueueReport'][_0xbe08('0x48')]({'where':{'id':_0x592a7e[_0xbe08('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bd33a,null))[_0xbe08('0x26')](saveUpdates(_0x592a7e[_0xbe08('0x47')],null))['then'](respondWithResult(_0x2bd33a,null))[_0xbe08('0x43')](handleError(_0x2bd33a,null));};exports[_0xbe08('0x27')]=function(_0x50c0ec,_0x52c6f1){return db['ChatQueueReport']['find']({'where':{'id':_0x50c0ec['params']['id']}})[_0xbe08('0x26')](handleEntityNotFound(_0x52c6f1,null))[_0xbe08('0x26')](removeEntity(_0x52c6f1,null))['catch'](handleError(_0x52c6f1,null));};exports['describe']=function(_0x2ecf8d,_0x3b0488){return db[_0xbe08('0x2d')][_0xbe08('0x4a')]()[_0xbe08('0x26')](respondWithResult(_0x3b0488,null))[_0xbe08('0x43')](handleError(_0x3b0488,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index c331c5a..8588198 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_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 +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2c7102,_0x50797c){var _0x370ecf=function(_0x5f0c45){while(--_0x5f0c45){_0x2c7102['push'](_0x2c7102['shift']());}};_0x370ecf(++_0x50797c);}(_0x757a,0xde));var _0xa757=function(_0x4ff949,_0x5630f8){_0x4ff949=_0x4ff949-0x0;var _0x371eb3=_0x757a[_0x4ff949];return _0x371eb3;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c2ae32a..49dc640 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 _0xfaec=['message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','debug','stringify','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x59bab0,_0x561486){var _0x3cfa44=function(_0x3db2cf){while(--_0x3db2cf){_0x59bab0['push'](_0x59bab0['shift']());}};_0x3cfa44(++_0x561486);}(_0xfaec,0x139));var _0xcfae=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfaec[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcfae('0x0'));var util=require(_0xcfae('0x1'));var moment=require(_0xcfae('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfae('0x3'));var fs=require('fs');var Redis=require(_0xcfae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcfae('0x5'))(_0xcfae('0x6'));var config=require(_0xcfae('0x7'));var jayson=require(_0xcfae('0x8'));var client=jayson[_0xcfae('0x9')][_0xcfae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345e43,_0x32bbb9,_0x333162){return new BPromise(function(_0x56a4c6,_0x2ea7e9){return client[_0xcfae('0xb')](_0x345e43,_0x333162)[_0xcfae('0xc')](function(_0x2eea0e){logger['info'](_0xcfae('0xd'),_0x32bbb9,_0xcfae('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x32bbb9,_0xcfae('0xe'),JSON['stringify'](_0x2eea0e));if(_0x2eea0e[_0xcfae('0xf')]){if(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x10')]===0x1f4){logger[_0xcfae('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x32bbb9,_0x2eea0e[_0xcfae('0xf')]['message']);return _0x2ea7e9(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x11')]);}logger['error'](_0xcfae('0xd'),_0x32bbb9,_0x2eea0e['error'][_0xcfae('0x11')]);return _0x56a4c6(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x11')]);}else{logger[_0xcfae('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x32bbb9,'request\x20sent');_0x56a4c6(_0x2eea0e[_0xcfae('0x13')][_0xcfae('0x11')]);}})[_0xcfae('0x14')](function(_0x463351){logger[_0xcfae('0xf')](_0xcfae('0xd'),_0x32bbb9,_0x463351);_0x2ea7e9(_0x463351);});});}exports[_0xcfae('0x15')]=function(_0x15614c){var _0x2c7a8a=this;return new Promise(function(_0x2abca1,_0x99409f){return db[_0xcfae('0x16')][_0xcfae('0x17')](_0x15614c[_0xcfae('0x18')],{'raw':_0x15614c[_0xcfae('0x19')]?_0x15614c['options'][_0xcfae('0x1a')]===undefined?!![]:![]:!![]})[_0xcfae('0xc')](function(_0x881b5e){logger[_0xcfae('0x12')]('CreateChatQueueReport',_0x15614c);logger['debug'](_0xcfae('0x15'),_0x15614c,JSON['stringify'](_0x881b5e));_0x2abca1(_0x881b5e);})[_0xcfae('0x14')](function(_0x53ade9){logger['error']('CreateChatQueueReport',_0x53ade9[_0xcfae('0x11')],_0x15614c);_0x99409f(_0x2c7a8a[_0xcfae('0xf')](0x1f4,_0x53ade9[_0xcfae('0x11')]));});});};exports[_0xcfae('0x1b')]=function(_0x1f719f){var _0x13ef82=this;return new Promise(function(_0x3170bc,_0x406400){return db[_0xcfae('0x16')]['update'](_0x1f719f[_0xcfae('0x18')],{'raw':_0x1f719f['options']?_0x1f719f['options'][_0xcfae('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f719f[_0xcfae('0x19')]?_0x1f719f[_0xcfae('0x19')][_0xcfae('0x1c')]||null:null,'attributes':_0x1f719f[_0xcfae('0x19')]?_0x1f719f[_0xcfae('0x19')][_0xcfae('0x1d')]||null:null,'limit':_0x1f719f[_0xcfae('0x19')]?_0x1f719f[_0xcfae('0x19')][_0xcfae('0x1e')]||null:null})['then'](function(_0x396329){logger[_0xcfae('0x12')]('UpdateChatQueueReport',_0x1f719f);logger[_0xcfae('0x1f')]('UpdateChatQueueReport',_0x1f719f,JSON[_0xcfae('0x20')](_0x396329));_0x3170bc(_0x396329);})[_0xcfae('0x14')](function(_0x2ab545){logger['error'](_0xcfae('0x1b'),_0x2ab545[_0xcfae('0x11')],_0x1f719f);_0x406400(_0x13ef82[_0xcfae('0xf')](0x1f4,_0x2ab545[_0xcfae('0x11')]));});});}; \ No newline at end of file +var _0x4273=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','options','raw','update','body','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4273,0xc5));var _0x3427=function(_0x3191ed,_0x170d93){_0x3191ed=_0x3191ed-0x0;var _0x19c2d7=_0x4273[_0x3191ed];return _0x19c2d7;};'use strict';var _=require(_0x3427('0x0'));var util=require(_0x3427('0x1'));var moment=require(_0x3427('0x2'));var BPromise=require('bluebird');var rs=require(_0x3427('0x3'));var fs=require('fs');var Redis=require(_0x3427('0x4'));var db=require(_0x3427('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3427('0x6'));var client=jayson[_0x3427('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33850e,_0x51fd04,_0x763889){return new BPromise(function(_0x21637a,_0x50c06d){return client[_0x3427('0x8')](_0x33850e,_0x763889)['then'](function(_0x4ea179){logger[_0x3427('0x9')](_0x3427('0xa'),_0x51fd04,_0x3427('0xb'));logger[_0x3427('0xc')](_0x3427('0xd'),_0x51fd04,_0x3427('0xb'),JSON[_0x3427('0xe')](_0x4ea179));if(_0x4ea179[_0x3427('0xf')]){if(_0x4ea179[_0x3427('0xf')][_0x3427('0x10')]===0x1f4){logger[_0x3427('0xf')](_0x3427('0xa'),_0x51fd04,_0x4ea179[_0x3427('0xf')][_0x3427('0x11')]);return _0x50c06d(_0x4ea179['error'][_0x3427('0x11')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x51fd04,_0x4ea179[_0x3427('0xf')][_0x3427('0x11')]);return _0x21637a(_0x4ea179[_0x3427('0xf')][_0x3427('0x11')]);}else{logger['info'](_0x3427('0xa'),_0x51fd04,_0x3427('0xb'));_0x21637a(_0x4ea179[_0x3427('0x12')][_0x3427('0x11')]);}})[_0x3427('0x13')](function(_0x54cc38){logger['error'](_0x3427('0xa'),_0x51fd04,_0x54cc38);_0x50c06d(_0x54cc38);});});}exports[_0x3427('0x14')]=function(_0xc8886f){var _0x1bf7e7=this;return new Promise(function(_0x3901cf,_0x5e89d3){return db['ChatQueueReport'][_0x3427('0x15')](_0xc8886f['body'],{'raw':_0xc8886f['options']?_0xc8886f[_0x3427('0x16')][_0x3427('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2b8cff){logger[_0x3427('0x9')](_0x3427('0x14'),_0xc8886f);logger[_0x3427('0xc')](_0x3427('0x14'),_0xc8886f,JSON['stringify'](_0x2b8cff));_0x3901cf(_0x2b8cff);})['catch'](function(_0x504508){logger[_0x3427('0xf')](_0x3427('0x14'),_0x504508[_0x3427('0x11')],_0xc8886f);_0x5e89d3(_0x1bf7e7[_0x3427('0xf')](0x1f4,_0x504508['message']));});});};exports['UpdateChatQueueReport']=function(_0x380786){var _0x31beef=this;return new Promise(function(_0x1242a8,_0x54b708){return db['ChatQueueReport'][_0x3427('0x18')](_0x380786[_0x3427('0x19')],{'raw':_0x380786[_0x3427('0x16')]?_0x380786[_0x3427('0x16')][_0x3427('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380786[_0x3427('0x16')]?_0x380786[_0x3427('0x16')][_0x3427('0x1a')]||null:null,'attributes':_0x380786[_0x3427('0x16')]?_0x380786['options'][_0x3427('0x1b')]||null:null,'limit':_0x380786[_0x3427('0x16')]?_0x380786['options'][_0x3427('0x1c')]||null:null})['then'](function(_0x209757){logger[_0x3427('0x9')](_0x3427('0x1d'),_0x380786);logger[_0x3427('0xc')]('UpdateChatQueueReport',_0x380786,JSON[_0x3427('0xe')](_0x209757));_0x1242a8(_0x209757);})[_0x3427('0x13')](function(_0x9136c3){logger[_0x3427('0xf')](_0x3427('0x1d'),_0x9136c3[_0x3427('0x11')],_0x380786);_0x54b708(_0x31beef[_0x3427('0xf')](0x1f4,_0x9136c3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 722d72a..7232ec4 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 _0x9700=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x45dd4d,_0x3c0698){var _0xf762bc=function(_0x12e06b){while(--_0x12e06b){_0x45dd4d['push'](_0x45dd4d['shift']());}};_0xf762bc(++_0x3c0698);}(_0x9700,0x64));var _0x0970=function(_0x57b87e,_0x14ee90){_0x57b87e=_0x57b87e-0x0;var _0x46902d=_0x9700[_0x57b87e];return _0x46902d;};'use strict';var multer=require(_0x0970('0x0'));var util=require('util');var path=require(_0x0970('0x1'));var timeout=require(_0x0970('0x2'));var express=require(_0x0970('0x3'));var router=express[_0x0970('0x4')]();var fs_extra=require(_0x0970('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0970('0x6'));var config=require('../../config/environment');var controller=require(_0x0970('0x7'));router[_0x0970('0x8')]('/',auth['isAuthenticated'](),controller[_0x0970('0x9')]);router[_0x0970('0x8')](_0x0970('0xa'),auth[_0x0970('0xb')](),controller['describe']);router[_0x0970('0x8')](_0x0970('0xc'),auth['isAuthenticated'](),controller[_0x0970('0xd')]);router['post']('/',auth[_0x0970('0xb')](),controller['create']);router[_0x0970('0xe')]('/:id',auth[_0x0970('0xb')](),controller[_0x0970('0xf')]);router[_0x0970('0x10')](_0x0970('0xc'),auth['isAuthenticated'](),controller[_0x0970('0x11')]);module[_0x0970('0x12')]=router; \ No newline at end of file +var _0xb7b7=['Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x407da1,_0x4a79e5){var _0x1a7274=function(_0x5d1b44){while(--_0x5d1b44){_0x407da1['push'](_0x407da1['shift']());}};_0x1a7274(++_0x4a79e5);}(_0xb7b7,0xc2));var _0x7b7b=function(_0x5391c6,_0x1c5ff0){_0x5391c6=_0x5391c6-0x0;var _0x327f14=_0xb7b7[_0x5391c6];return _0x327f14;};'use strict';var multer=require(_0x7b7b('0x0'));var util=require('util');var path=require(_0x7b7b('0x1'));var timeout=require(_0x7b7b('0x2'));var express=require(_0x7b7b('0x3'));var router=express[_0x7b7b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7b('0x6'));var controller=require(_0x7b7b('0x7'));router['get']('/',auth[_0x7b7b('0x8')](),controller[_0x7b7b('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7b7b('0xa')](_0x7b7b('0xb'),auth[_0x7b7b('0x8')](),controller[_0x7b7b('0xc')]);router['post']('/',auth[_0x7b7b('0x8')](),controller[_0x7b7b('0xd')]);router[_0x7b7b('0xe')](_0x7b7b('0xb'),auth[_0x7b7b('0x8')](),controller[_0x7b7b('0xf')]);router['delete'](_0x7b7b('0xb'),auth[_0x7b7b('0x8')](),controller[_0x7b7b('0x10')]);module[_0x7b7b('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d57db74..d203987 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0x9bde,0xe1));var _0xe9bd=function(_0x7399ce,_0x14d0fc){_0x7399ce=_0x7399ce-0x0;var _0x5cf4e5=_0x9bde[_0x7399ce];return _0x5cf4e5;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x294c42,_0xbd23ad){var _0x4c73d9=function(_0x4f140e){while(--_0x4f140e){_0x294c42['push'](_0x294c42['shift']());}};_0x4c73d9(++_0xbd23ad);}(_0x008c,0x188));var _0xc008=function(_0xf6763d,_0x1ee231){_0xf6763d=_0xf6763d-0x0;var _0x212ae2=_0x008c[_0xf6763d];return _0x212ae2;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 0203dc0..87d324c 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 _0x7e12=['destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then'];(function(_0xa12476,_0x364cae){var _0x1016e2=function(_0xfdaeb6){while(--_0xfdaeb6){_0xa12476['push'](_0xa12476['shift']());}};_0x1016e2(++_0x364cae);}(_0x7e12,0xb3));var _0x27e1=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x7e12[_0x4a6cf8];return _0x22205e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27e1('0x0'));var jsonpatch=require(_0x27e1('0x1'));var rp=require(_0x27e1('0x2'));var moment=require(_0x27e1('0x3'));var BPromise=require(_0x27e1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x27e1('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27e1('0x6'));var _=require(_0x27e1('0x7'));var squel=require(_0x27e1('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x27e1('0x9'));var toCsv=require('to-csv');var querystring=require(_0x27e1('0xa'));var Papa=require(_0x27e1('0xb'));var Redis=require(_0x27e1('0xc'));var authService=require(_0x27e1('0xd'));var qs=require(_0x27e1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27e1('0xf'));var logger=require(_0x27e1('0x10'))('api');var utils=require(_0x27e1('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x27e1('0x12'));var db=require(_0x27e1('0x13'))['db'];function respondWithStatusCode(_0x31cf55,_0x152f05){_0x152f05=_0x152f05||0xcc;return function(_0x2a390c){if(_0x2a390c){return _0x31cf55[_0x27e1('0x14')](_0x152f05);}return _0x31cf55[_0x27e1('0x15')](_0x152f05)[_0x27e1('0x16')]();};}function respondWithResult(_0x1e1d49,_0x275f5c){_0x275f5c=_0x275f5c||0xc8;return function(_0x10ff50){if(_0x10ff50){return _0x1e1d49[_0x27e1('0x15')](_0x275f5c)[_0x27e1('0x17')](_0x10ff50);}};}function respondWithFilteredResult(_0x4baf74,_0x190733){return function(_0x5864b3){if(_0x5864b3){var _0x256cae=typeof _0x190733[_0x27e1('0x18')]===_0x27e1('0x19')&&typeof _0x190733[_0x27e1('0x1a')]==='undefined';var _0x3bc7e3=_0x5864b3[_0x27e1('0x1b')];var _0xd96e22=_0x256cae?0x0:_0x190733['offset'];var _0x1ccf71=_0x256cae?_0x5864b3[_0x27e1('0x1b')]:_0x190733[_0x27e1('0x18')]+_0x190733['limit'];var _0xa1aa7b;if(_0x1ccf71>=_0x3bc7e3){_0x1ccf71=_0x3bc7e3;_0xa1aa7b=0xc8;}else{_0xa1aa7b=0xce;}_0x4baf74['status'](_0xa1aa7b);return _0x4baf74[_0x27e1('0x1c')](_0x27e1('0x1d'),_0xd96e22+'-'+_0x1ccf71+'/'+_0x3bc7e3)[_0x27e1('0x17')](_0x5864b3);}return null;};}function patchUpdates(_0x142a8f){return function(_0xba350d){try{jsonpatch[_0x27e1('0x1e')](_0xba350d,_0x142a8f,!![]);}catch(_0x48cf8b){return BPromise[_0x27e1('0x1f')](_0x48cf8b);}return _0xba350d['save']();};}function saveUpdates(_0x1dd5d4,_0x3c69a6){return function(_0x3caf48){if(_0x3caf48){return _0x3caf48[_0x27e1('0x20')](_0x1dd5d4)[_0x27e1('0x21')](function(_0x53271f){return _0x53271f;});}return null;};}function removeEntity(_0x2dd24a,_0xfd4307){return function(_0x22763e){if(_0x22763e){return _0x22763e[_0x27e1('0x22')]()[_0x27e1('0x21')](function(){_0x2dd24a['status'](0xcc)[_0x27e1('0x16')]();});}};}function handleEntityNotFound(_0x57d883,_0x1a091e){return function(_0x377b2a){if(!_0x377b2a){_0x57d883['sendStatus'](0x194);}return _0x377b2a;};}function handleError(_0x5390d8,_0x35c219){_0x35c219=_0x35c219||0x1f4;return function(_0x19c9a3){logger[_0x27e1('0x23')](_0x19c9a3['stack']);if(_0x19c9a3[_0x27e1('0x24')]){delete _0x19c9a3[_0x27e1('0x24')];}_0x5390d8['status'](_0x35c219)[_0x27e1('0x25')](_0x19c9a3);};}exports[_0x27e1('0x26')]=function(_0xd94518,_0x155ac4){var _0x51973d={},_0x507d7b={},_0x506ec5={'count':0x0,'rows':[]};var _0x1b8fb2=_[_0x27e1('0x27')](db[_0x27e1('0x28')][_0x27e1('0x29')],function(_0x3c227b){return{'name':_0x3c227b[_0x27e1('0x2a')],'type':_0x3c227b[_0x27e1('0x2b')]['key']};});_0x507d7b[_0x27e1('0x2c')]=_['map'](_0x1b8fb2,'name');_0x507d7b[_0x27e1('0x2d')]=_[_0x27e1('0x2e')](_0xd94518[_0x27e1('0x2d')]);_0x507d7b['filters']=_[_0x27e1('0x2f')](_0x507d7b['model'],_0x507d7b[_0x27e1('0x2d')]);_0x51973d['attributes']=_['intersection'](_0x507d7b[_0x27e1('0x2c')],qs[_0x27e1('0x30')](_0xd94518[_0x27e1('0x2d')]['fields']));_0x51973d[_0x27e1('0x31')]=_0x51973d[_0x27e1('0x31')]['length']?_0x51973d['attributes']:_0x507d7b['model'];if(!_0xd94518[_0x27e1('0x2d')][_0x27e1('0x32')]('nolimit')){_0x51973d[_0x27e1('0x1a')]=qs[_0x27e1('0x1a')](_0xd94518['query']['limit']);_0x51973d[_0x27e1('0x18')]=qs[_0x27e1('0x18')](_0xd94518[_0x27e1('0x2d')][_0x27e1('0x18')]);}_0x51973d[_0x27e1('0x33')]=qs[_0x27e1('0x34')](_0xd94518[_0x27e1('0x2d')]['sort']);_0x51973d['where']=qs[_0x27e1('0x35')](_[_0x27e1('0x36')](_0xd94518[_0x27e1('0x2d')],_0x507d7b[_0x27e1('0x35')]),_0x1b8fb2);if(_0xd94518[_0x27e1('0x2d')][_0x27e1('0x37')]){_0x51973d['where']=_[_0x27e1('0x38')](_0x51973d['where'],{'$or':_[_0x27e1('0x27')](_0x1b8fb2,function(_0x3e4e50){if(_0x3e4e50[_0x27e1('0x2b')]!==_0x27e1('0x39')){var _0x620b71={};_0x620b71[_0x3e4e50['name']]={'$like':'%'+_0xd94518[_0x27e1('0x2d')]['filter']+'%'};return _0x620b71;}})});}_0x51973d=_[_0x27e1('0x38')]({},_0x51973d,_0xd94518[_0x27e1('0x3a')]);var _0x37bfdd={'where':_0x51973d[_0x27e1('0x3b')]};return db['ChatTransferReport'][_0x27e1('0x1b')](_0x37bfdd)[_0x27e1('0x21')](function(_0x5441f0){_0x506ec5['count']=_0x5441f0;if(_0xd94518[_0x27e1('0x2d')][_0x27e1('0x3c')]){_0x51973d['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x27e1('0x3d')](_0x51973d);})['then'](function(_0x4b805c){_0x506ec5['rows']=_0x4b805c;return _0x506ec5;})[_0x27e1('0x21')](respondWithFilteredResult(_0x155ac4,_0x51973d))[_0x27e1('0x3e')](handleError(_0x155ac4,null));};exports[_0x27e1('0x3f')]=function(_0x367b3a,_0x1f3c3c){var _0x4ec2a1={'raw':!![],'where':{'id':_0x367b3a[_0x27e1('0x40')]['id']}},_0x67d002={};_0x67d002[_0x27e1('0x2c')]=_[_0x27e1('0x2e')](db['ChatTransferReport'][_0x27e1('0x29')]);_0x67d002['query']=_['keys'](_0x367b3a[_0x27e1('0x2d')]);_0x67d002['filters']=_[_0x27e1('0x2f')](_0x67d002[_0x27e1('0x2c')],_0x67d002[_0x27e1('0x2d')]);_0x4ec2a1[_0x27e1('0x31')]=_[_0x27e1('0x2f')](_0x67d002['model'],qs[_0x27e1('0x30')](_0x367b3a[_0x27e1('0x2d')][_0x27e1('0x30')]));_0x4ec2a1[_0x27e1('0x31')]=_0x4ec2a1[_0x27e1('0x31')][_0x27e1('0x41')]?_0x4ec2a1[_0x27e1('0x31')]:_0x67d002[_0x27e1('0x2c')];if(_0x367b3a[_0x27e1('0x2d')][_0x27e1('0x3c')]){_0x4ec2a1[_0x27e1('0x42')]=[{'all':!![]}];}_0x4ec2a1=_[_0x27e1('0x38')]({},_0x4ec2a1,_0x367b3a[_0x27e1('0x3a')]);return db[_0x27e1('0x28')][_0x27e1('0x43')](_0x4ec2a1)[_0x27e1('0x21')](handleEntityNotFound(_0x1f3c3c,null))[_0x27e1('0x21')](respondWithResult(_0x1f3c3c,null))[_0x27e1('0x3e')](handleError(_0x1f3c3c,null));};exports[_0x27e1('0x44')]=function(_0x579e93,_0x2948c2){return db[_0x27e1('0x28')][_0x27e1('0x44')](_0x579e93[_0x27e1('0x45')],{})[_0x27e1('0x21')](respondWithResult(_0x2948c2,0xc9))[_0x27e1('0x3e')](handleError(_0x2948c2,null));};exports[_0x27e1('0x20')]=function(_0x41639a,_0x110bd8){if(_0x41639a['body']['id']){delete _0x41639a[_0x27e1('0x45')]['id'];}return db[_0x27e1('0x28')][_0x27e1('0x43')]({'where':{'id':_0x41639a[_0x27e1('0x40')]['id']}})[_0x27e1('0x21')](handleEntityNotFound(_0x110bd8,null))[_0x27e1('0x21')](saveUpdates(_0x41639a[_0x27e1('0x45')],null))[_0x27e1('0x21')](respondWithResult(_0x110bd8,null))[_0x27e1('0x3e')](handleError(_0x110bd8,null));};exports[_0x27e1('0x22')]=function(_0x22876a,_0x7be871){return db[_0x27e1('0x28')]['find']({'where':{'id':_0x22876a[_0x27e1('0x40')]['id']}})[_0x27e1('0x21')](handleEntityNotFound(_0x7be871,null))['then'](removeEntity(_0x7be871,null))['catch'](handleError(_0x7be871,null));};exports['describe']=function(_0x11040d,_0x247265){return db[_0x27e1('0x28')][_0x27e1('0x46')]()[_0x27e1('0x21')](respondWithResult(_0x247265,null))['catch'](handleError(_0x247265,null));}; \ No newline at end of file +var _0x96f8=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','options','include','findAll','rows','catch','show','params','includeAll','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys'];(function(_0x438803,_0xb07992){var _0x34756b=function(_0x57ca53){while(--_0x57ca53){_0x438803['push'](_0x438803['shift']());}};_0x34756b(++_0xb07992);}(_0x96f8,0xf1));var _0x896f=function(_0x2feae6,_0x464a62){_0x2feae6=_0x2feae6-0x0;var _0x2d25c9=_0x96f8[_0x2feae6];return _0x2d25c9;};'use strict';var emlformat=require(_0x896f('0x0'));var rimraf=require(_0x896f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x896f('0x2'));var rp=require(_0x896f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x896f('0x4'));var sox=require(_0x896f('0x5'));var csv=require(_0x896f('0x6'));var ejs=require(_0x896f('0x7'));var fs=require('fs');var fs_extra=require(_0x896f('0x8'));var _=require(_0x896f('0x9'));var squel=require(_0x896f('0xa'));var crypto=require('crypto');var jsforce=require(_0x896f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x896f('0x6'));var querystring=require(_0x896f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x896f('0xd'));var qs=require(_0x896f('0xe'));var as=require(_0x896f('0xf'));var hardwareService=require(_0x896f('0x10'));var logger=require(_0x896f('0x11'))('api');var utils=require(_0x896f('0x12'));var config=require(_0x896f('0x13'));var licenseUtil=require(_0x896f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x410eac,_0x79c783){_0x79c783=_0x79c783||0xcc;return function(_0x578a42){if(_0x578a42){return _0x410eac[_0x896f('0x15')](_0x79c783);}return _0x410eac['status'](_0x79c783)[_0x896f('0x16')]();};}function respondWithResult(_0x5b2135,_0x246353){_0x246353=_0x246353||0xc8;return function(_0x152a38){if(_0x152a38){return _0x5b2135[_0x896f('0x17')](_0x246353)[_0x896f('0x18')](_0x152a38);}};}function respondWithFilteredResult(_0x4f7c51,_0x505d68){return function(_0x3839ec){if(_0x3839ec){var _0x353ad4=typeof _0x505d68['offset']===_0x896f('0x19')&&typeof _0x505d68['limit']===_0x896f('0x19');var _0x389ff4=_0x3839ec[_0x896f('0x1a')];var _0x3df858=_0x353ad4?0x0:_0x505d68[_0x896f('0x1b')];var _0x175198=_0x353ad4?_0x3839ec[_0x896f('0x1a')]:_0x505d68['offset']+_0x505d68[_0x896f('0x1c')];var _0x3c865b;if(_0x175198>=_0x389ff4){_0x175198=_0x389ff4;_0x3c865b=0xc8;}else{_0x3c865b=0xce;}_0x4f7c51[_0x896f('0x17')](_0x3c865b);return _0x4f7c51[_0x896f('0x1d')](_0x896f('0x1e'),_0x3df858+'-'+_0x175198+'/'+_0x389ff4)['json'](_0x3839ec);}return null;};}function patchUpdates(_0x454490){return function(_0x264667){try{jsonpatch[_0x896f('0x1f')](_0x264667,_0x454490,!![]);}catch(_0x25e1c8){return BPromise[_0x896f('0x20')](_0x25e1c8);}return _0x264667[_0x896f('0x21')]();};}function saveUpdates(_0x14603a,_0x398529){return function(_0x1f1399){if(_0x1f1399){return _0x1f1399[_0x896f('0x22')](_0x14603a)[_0x896f('0x23')](function(_0x430c9c){return _0x430c9c;});}return null;};}function removeEntity(_0x43f84e,_0x44c638){return function(_0x2a6ed8){if(_0x2a6ed8){return _0x2a6ed8[_0x896f('0x24')]()[_0x896f('0x23')](function(){_0x43f84e['status'](0xcc)[_0x896f('0x16')]();});}};}function handleEntityNotFound(_0xc693a4,_0x5677aa){return function(_0x782bcf){if(!_0x782bcf){_0xc693a4['sendStatus'](0x194);}return _0x782bcf;};}function handleError(_0x313962,_0x15e1c7){_0x15e1c7=_0x15e1c7||0x1f4;return function(_0x330def){logger[_0x896f('0x25')](_0x330def['stack']);if(_0x330def[_0x896f('0x26')]){delete _0x330def['name'];}_0x313962['status'](_0x15e1c7)[_0x896f('0x27')](_0x330def);};}exports['index']=function(_0x981d4a,_0x1a1ab1){var _0x1fbfa5={},_0x70615e={},_0x408de4={'count':0x0,'rows':[]};var _0x450135=_[_0x896f('0x28')](db[_0x896f('0x29')][_0x896f('0x2a')],function(_0x4d5bc1){return{'name':_0x4d5bc1[_0x896f('0x2b')],'type':_0x4d5bc1['type'][_0x896f('0x2c')]};});_0x70615e[_0x896f('0x2d')]=_[_0x896f('0x28')](_0x450135,_0x896f('0x26'));_0x70615e['query']=_[_0x896f('0x2e')](_0x981d4a[_0x896f('0x2f')]);_0x70615e[_0x896f('0x30')]=_[_0x896f('0x31')](_0x70615e[_0x896f('0x2d')],_0x70615e[_0x896f('0x2f')]);_0x1fbfa5['attributes']=_['intersection'](_0x70615e[_0x896f('0x2d')],qs[_0x896f('0x32')](_0x981d4a[_0x896f('0x2f')][_0x896f('0x32')]));_0x1fbfa5[_0x896f('0x33')]=_0x1fbfa5['attributes'][_0x896f('0x34')]?_0x1fbfa5[_0x896f('0x33')]:_0x70615e['model'];if(!_0x981d4a[_0x896f('0x2f')][_0x896f('0x35')](_0x896f('0x36'))){_0x1fbfa5[_0x896f('0x1c')]=qs[_0x896f('0x1c')](_0x981d4a[_0x896f('0x2f')][_0x896f('0x1c')]);_0x1fbfa5[_0x896f('0x1b')]=qs[_0x896f('0x1b')](_0x981d4a[_0x896f('0x2f')][_0x896f('0x1b')]);}_0x1fbfa5['order']=qs[_0x896f('0x37')](_0x981d4a[_0x896f('0x2f')]['sort']);_0x1fbfa5['where']=qs[_0x896f('0x30')](_[_0x896f('0x38')](_0x981d4a['query'],_0x70615e[_0x896f('0x30')]),_0x450135);if(_0x981d4a[_0x896f('0x2f')][_0x896f('0x39')]){_0x1fbfa5['where']=_[_0x896f('0x3a')](_0x1fbfa5[_0x896f('0x3b')],{'$or':_[_0x896f('0x28')](_0x450135,function(_0x355d51){if(_0x355d51[_0x896f('0x3c')]!=='VIRTUAL'){var _0x583967={};_0x583967[_0x355d51['name']]={'$like':'%'+_0x981d4a[_0x896f('0x2f')][_0x896f('0x39')]+'%'};return _0x583967;}})});}_0x1fbfa5=_[_0x896f('0x3a')]({},_0x1fbfa5,_0x981d4a[_0x896f('0x3d')]);var _0x1267f8={'where':_0x1fbfa5[_0x896f('0x3b')]};return db[_0x896f('0x29')][_0x896f('0x1a')](_0x1267f8)['then'](function(_0x483a8d){_0x408de4['count']=_0x483a8d;if(_0x981d4a[_0x896f('0x2f')]['includeAll']){_0x1fbfa5[_0x896f('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x896f('0x3f')](_0x1fbfa5);})[_0x896f('0x23')](function(_0x42574c){_0x408de4[_0x896f('0x40')]=_0x42574c;return _0x408de4;})[_0x896f('0x23')](respondWithFilteredResult(_0x1a1ab1,_0x1fbfa5))[_0x896f('0x41')](handleError(_0x1a1ab1,null));};exports[_0x896f('0x42')]=function(_0x3583ab,_0xb108b3){var _0x2e9a3a={'raw':!![],'where':{'id':_0x3583ab[_0x896f('0x43')]['id']}},_0x434ecb={};_0x434ecb['model']=_[_0x896f('0x2e')](db[_0x896f('0x29')]['rawAttributes']);_0x434ecb['query']=_['keys'](_0x3583ab[_0x896f('0x2f')]);_0x434ecb[_0x896f('0x30')]=_[_0x896f('0x31')](_0x434ecb[_0x896f('0x2d')],_0x434ecb[_0x896f('0x2f')]);_0x2e9a3a['attributes']=_[_0x896f('0x31')](_0x434ecb[_0x896f('0x2d')],qs[_0x896f('0x32')](_0x3583ab[_0x896f('0x2f')][_0x896f('0x32')]));_0x2e9a3a[_0x896f('0x33')]=_0x2e9a3a['attributes'][_0x896f('0x34')]?_0x2e9a3a[_0x896f('0x33')]:_0x434ecb[_0x896f('0x2d')];if(_0x3583ab['query'][_0x896f('0x44')]){_0x2e9a3a[_0x896f('0x3e')]=[{'all':!![]}];}_0x2e9a3a=_['merge']({},_0x2e9a3a,_0x3583ab[_0x896f('0x3d')]);return db[_0x896f('0x29')][_0x896f('0x45')](_0x2e9a3a)['then'](handleEntityNotFound(_0xb108b3,null))['then'](respondWithResult(_0xb108b3,null))[_0x896f('0x41')](handleError(_0xb108b3,null));};exports['create']=function(_0xc110e1,_0x5a0822){return db[_0x896f('0x29')]['create'](_0xc110e1[_0x896f('0x46')],{})[_0x896f('0x23')](respondWithResult(_0x5a0822,0xc9))[_0x896f('0x41')](handleError(_0x5a0822,null));};exports['update']=function(_0x4812cf,_0x4e7170){if(_0x4812cf[_0x896f('0x46')]['id']){delete _0x4812cf[_0x896f('0x46')]['id'];}return db[_0x896f('0x29')][_0x896f('0x45')]({'where':{'id':_0x4812cf['params']['id']}})[_0x896f('0x23')](handleEntityNotFound(_0x4e7170,null))[_0x896f('0x23')](saveUpdates(_0x4812cf[_0x896f('0x46')],null))[_0x896f('0x23')](respondWithResult(_0x4e7170,null))[_0x896f('0x41')](handleError(_0x4e7170,null));};exports[_0x896f('0x24')]=function(_0x1b5a62,_0x1493ad){return db[_0x896f('0x29')][_0x896f('0x45')]({'where':{'id':_0x1b5a62['params']['id']}})['then'](handleEntityNotFound(_0x1493ad,null))['then'](removeEntity(_0x1493ad,null))['catch'](handleError(_0x1493ad,null));};exports[_0x896f('0x47')]=function(_0x4fce80,_0x3561ec){return db['ChatTransferReport'][_0x896f('0x47')]()[_0x896f('0x23')](respondWithResult(_0x3561ec,null))[_0x896f('0x41')](handleError(_0x3561ec,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index fb664f7..9838e7f 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 _0x758a=['uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x758a,0x1c8));var _0xa758=function(_0x1f7b11,_0x4feb6b){_0x1f7b11=_0x1f7b11-0x0;var _0x52306a=_0x758a[_0x1f7b11];return _0x52306a;};'use strict';var _=require(_0xa758('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa758('0x1'));var moment=require(_0xa758('0x2'));var BPromise=require(_0xa758('0x3'));var rp=require(_0xa758('0x4'));var fs=require('fs');var path=require(_0xa758('0x5'));var rimraf=require(_0xa758('0x6'));var config=require(_0xa758('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xa758('0x8')]=function(_0x49067e,_0x63be42){return _0x49067e[_0xa758('0x9')](_0xa758('0xa'),attributes,{'tableName':_0xa758('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa758('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e9e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','util'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x1e9e,0x103));var _0xe1e9=function(_0xcb3e9b,_0x180849){_0xcb3e9b=_0xcb3e9b-0x0;var _0x2512a8=_0x1e9e[_0xcb3e9b];return _0x2512a8;};'use strict';var _=require('lodash');var util=require(_0xe1e9('0x0'));var logger=require(_0xe1e9('0x1'))(_0xe1e9('0x2'));var moment=require(_0xe1e9('0x3'));var BPromise=require(_0xe1e9('0x4'));var rp=require(_0xe1e9('0x5'));var fs=require('fs');var path=require(_0xe1e9('0x6'));var rimraf=require(_0xe1e9('0x7'));var config=require(_0xe1e9('0x8'));var attributes=require(_0xe1e9('0x9'));module[_0xe1e9('0xa')]=function(_0x41fcd4,_0x3d9f3){return _0x41fcd4['define']('ChatTransferReport',attributes,{'tableName':_0xe1e9('0xb'),'paranoid':![],'indexes':[{'name':_0xe1e9('0xc'),'fields':[_0xe1e9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 8c9c9dd..47b8cd0 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 _0x8392=['request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8392,0x91));var _0x2839=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8392[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2839('0x0'));var util=require(_0x2839('0x1'));var moment=require('moment');var BPromise=require(_0x2839('0x2'));var rs=require(_0x2839('0x3'));var fs=require('fs');var Redis=require(_0x2839('0x4'));var db=require(_0x2839('0x5'))['db'];var utils=require(_0x2839('0x6'));var logger=require(_0x2839('0x7'))(_0x2839('0x8'));var config=require('../../config/environment');var jayson=require(_0x2839('0x9'));var client=jayson[_0x2839('0xa')][_0x2839('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c47c6,_0x433639,_0x560a29){return new BPromise(function(_0x24dfcf,_0x42369e){return client['request'](_0x4c47c6,_0x560a29)[_0x2839('0xc')](function(_0x67f43a){logger[_0x2839('0xd')](_0x2839('0xe'),_0x433639,_0x2839('0xf'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x433639,_0x2839('0xf'),JSON[_0x2839('0x10')](_0x67f43a));if(_0x67f43a[_0x2839('0x11')]){if(_0x67f43a['error']['code']===0x1f4){logger['error'](_0x2839('0xe'),_0x433639,_0x67f43a[_0x2839('0x11')]['message']);return _0x42369e(_0x67f43a[_0x2839('0x11')][_0x2839('0x12')]);}logger[_0x2839('0x11')](_0x2839('0xe'),_0x433639,_0x67f43a['error'][_0x2839('0x12')]);return _0x24dfcf(_0x67f43a[_0x2839('0x11')][_0x2839('0x12')]);}else{logger[_0x2839('0xd')](_0x2839('0xe'),_0x433639,'request\x20sent');_0x24dfcf(_0x67f43a['result'][_0x2839('0x12')]);}})[_0x2839('0x13')](function(_0x20e146){logger[_0x2839('0x11')](_0x2839('0xe'),_0x433639,_0x20e146);_0x42369e(_0x20e146);});});} \ No newline at end of file +var _0x1ac6=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x33f614,_0x5242a8){var _0x564db2=function(_0x16d3e0){while(--_0x16d3e0){_0x33f614['push'](_0x33f614['shift']());}};_0x564db2(++_0x5242a8);}(_0x1ac6,0x1d3));var _0x61ac=function(_0x131390,_0xd0846e){_0x131390=_0x131390-0x0;var _0x550870=_0x1ac6[_0x131390];return _0x550870;};'use strict';var _=require(_0x61ac('0x0'));var util=require('util');var moment=require(_0x61ac('0x1'));var BPromise=require(_0x61ac('0x2'));var rs=require(_0x61ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x61ac('0x5'))(_0x61ac('0x6'));var config=require('../../config/environment');var jayson=require(_0x61ac('0x7'));var client=jayson['client'][_0x61ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21a18d,_0xa67a0f,_0x2d5aac){return new BPromise(function(_0x51c1b6,_0x565545){return client[_0x61ac('0x9')](_0x21a18d,_0x2d5aac)['then'](function(_0x1d4481){logger[_0x61ac('0xa')](_0x61ac('0xb'),_0xa67a0f,_0x61ac('0xc'));logger[_0x61ac('0xd')](_0x61ac('0xe'),_0xa67a0f,_0x61ac('0xc'),JSON[_0x61ac('0xf')](_0x1d4481));if(_0x1d4481[_0x61ac('0x10')]){if(_0x1d4481[_0x61ac('0x10')][_0x61ac('0x11')]===0x1f4){logger[_0x61ac('0x10')](_0x61ac('0xb'),_0xa67a0f,_0x1d4481[_0x61ac('0x10')][_0x61ac('0x12')]);return _0x565545(_0x1d4481[_0x61ac('0x10')]['message']);}logger[_0x61ac('0x10')](_0x61ac('0xb'),_0xa67a0f,_0x1d4481[_0x61ac('0x10')]['message']);return _0x51c1b6(_0x1d4481[_0x61ac('0x10')][_0x61ac('0x12')]);}else{logger[_0x61ac('0xa')](_0x61ac('0xb'),_0xa67a0f,_0x61ac('0xc'));_0x51c1b6(_0x1d4481[_0x61ac('0x13')]['message']);}})['catch'](function(_0x1d5f43){logger[_0x61ac('0x10')](_0x61ac('0xb'),_0xa67a0f,_0x1d5f43);_0x565545(_0x1d5f43);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index e976432..da4b214 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 _0x289b=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','post','create','put','destroy','exports','multer','util'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x289b,0x1b8));var _0xb289=function(_0x21c81e,_0x5de28f){_0x21c81e=_0x21c81e-0x0;var _0x16a6d7=_0x289b[_0x21c81e];return _0x16a6d7;};'use strict';var multer=require(_0xb289('0x0'));var util=require(_0xb289('0x1'));var path=require(_0xb289('0x2'));var timeout=require('connect-timeout');var express=require(_0xb289('0x3'));var router=express[_0xb289('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb289('0x5'));var interaction=require(_0xb289('0x6'));var config=require(_0xb289('0x7'));var controller=require('./chatTransferReport.controller');router[_0xb289('0x8')]('/',auth[_0xb289('0x9')](),controller['index']);router[_0xb289('0x8')](_0xb289('0xa'),auth[_0xb289('0x9')](),controller['describe']);router[_0xb289('0x8')](_0xb289('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb289('0xc')]('/',auth[_0xb289('0x9')](),controller[_0xb289('0xd')]);router[_0xb289('0xe')](_0xb289('0xb'),auth[_0xb289('0x9')](),controller['update']);router['delete'](_0xb289('0xb'),auth[_0xb289('0x9')](),controller[_0xb289('0xf')]);module[_0xb289('0x10')]=router; \ No newline at end of file +var _0x2189=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x4cfab8,_0x5ce03b){var _0x5e8ef8=function(_0x5e866a){while(--_0x5e866a){_0x4cfab8['push'](_0x4cfab8['shift']());}};_0x5e8ef8(++_0x5ce03b);}(_0x2189,0xa9));var _0x9218=function(_0x319501,_0xb08f2f){_0x319501=_0x319501-0x0;var _0x1a6bff=_0x2189[_0x319501];return _0x1a6bff;};'use strict';var multer=require(_0x9218('0x0'));var util=require(_0x9218('0x1'));var path=require(_0x9218('0x2'));var timeout=require(_0x9218('0x3'));var express=require(_0x9218('0x4'));var router=express[_0x9218('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9218('0x6'));var config=require(_0x9218('0x7'));var controller=require('./chatTransferReport.controller');router[_0x9218('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9218('0x8')](_0x9218('0x9'),auth[_0x9218('0xa')](),controller[_0x9218('0xb')]);router[_0x9218('0x8')](_0x9218('0xc'),auth[_0x9218('0xa')](),controller[_0x9218('0xd')]);router[_0x9218('0xe')]('/',auth['isAuthenticated'](),controller[_0x9218('0xf')]);router[_0x9218('0x10')](_0x9218('0xc'),auth[_0x9218('0xa')](),controller[_0x9218('0x11')]);router[_0x9218('0x12')](_0x9218('0xc'),auth[_0x9218('0xa')](),controller[_0x9218('0x13')]);module[_0x9218('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index fe313a8..ac805e5 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 _0xec81=['parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','text','name','email','getDataValue'];(function(_0x1c258f,_0x4d95d8){var _0x59908c=function(_0x3f310c){while(--_0x3f310c){_0x1c258f['push'](_0x1c258f['shift']());}};_0x59908c(++_0x4d95d8);}(_0xec81,0x1d3));var _0x1ec8=function(_0x39a0da,_0x5abf14){_0x39a0da=_0x39a0da-0x0;var _0x59dcdd=_0xec81[_0x39a0da];return _0x59dcdd;};'use strict';var Sequelize=require(_0x1ec8('0x0'));var rs=require('randomstring');module[_0x1ec8('0x1')]={'name':{'type':Sequelize[_0x1ec8('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x1ec8('0x2')],'allowNull':![],'unique':_0x1ec8('0x3')},'description':{'type':Sequelize[_0x1ec8('0x2')]},'mapKey':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x1ec8('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec8('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1ec8('0x2')],'allowNull':![],'defaultValue':_0x1ec8('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1ec8('0x2')],'allowNull':![],'defaultValue':_0x1ec8('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec8('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ec8('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1ec8('0x2')]},'animation':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1ec8('0x8')](_0x1ec8('0x9'),'squared'),'defaultValue':_0x1ec8('0x9')},'header_online':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0xb')},'offline_chat_button':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0xc')},'header_offline':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0xd')},'download_transcript':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1ec8('0xf')]},'closingQuestion':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0x11')},'placeholderMessage':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x12')},'closingMessage':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x13')},'closingMessageButton':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0xc')},'skipMessageButton':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x1ec8('0x8')](_0x1ec8('0x14'),_0x1ec8('0x15')),'defaultValue':_0x1ec8('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x1ec8('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1ec8('0xf')],'defaultValue':function(){return JSON[_0x1ec8('0x16')]({'items':[{'type':_0x1ec8('0x17'),'variable':null,'config':{'placeholder':'name','type':_0x1ec8('0x18'),'required':!![]},'props':{'title':_0x1ec8('0x19'),'helpText':''}},{'type':_0x1ec8('0x17'),'props':{'title':_0x1ec8('0x1a'),'helpText':''},'config':{'required':!![],'placeholder':_0x1ec8('0x1a'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ec8('0x1b')]('onlineForm')?JSON[_0x1ec8('0x1c')](this['getDataValue'](_0x1ec8('0x1d'))):{};},'set':function(_0x4dca1d){return this[_0x1ec8('0x1e')]('onlineForm',JSON[_0x1ec8('0x16')](_0x4dca1d));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1ec8('0x16')]({'items':[{'type':_0x1ec8('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1ec8('0x1a'),'type':_0x1ec8('0x1a')},'variable':null},{'type':'textarea','config':{'placeholder':_0x1ec8('0x1f')},'props':{'title':_0x1ec8('0x1f'),'helpText':_0x1ec8('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1ec8('0x1b')]('offlineForm')?JSON[_0x1ec8('0x1c')](this[_0x1ec8('0x1b')]('offlineForm')):{};},'set':function(_0x5e7a3f){return this[_0x1ec8('0x1e')]('offlineForm',JSON['stringify'](_0x5e7a3f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1ec8('0x2')]},'forwardOffline':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1ec8('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x23')},'skipUnmanaged':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x24')},'sendUnmanaged':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ec8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1ec8('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x1ec8('0x25')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1ec8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x26')},'verticalAlignment':{'type':Sequelize[_0x1ec8('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':_0x1ec8('0x27')},'messagesAlignment':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x1ec8('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1ec8('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1ec8('0x2')],'allowNull':![],'defaultValue':_0x1ec8('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ec8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x1ec8('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ec8('0x6')],'comment':_0x1ec8('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![],'comment':_0x1ec8('0x2a'),'set':function(_0x46495c){if(!_0x46495c)this[_0x1ec8('0x1e')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x46495c);}},'vidaooEscalation':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1ec8('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec8('0x2b')},'vidaooNote':{'type':Sequelize[_0x1ec8('0x2')],'defaultValue':function(){return _0x1ec8('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x1ec8('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1ec8('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6f48=['star','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','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','address','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6f48,0xf5));var _0x86f4=function(_0x2b7c49,_0xf70249){_0x2b7c49=_0x2b7c49-0x0;var _0x24fc03=_0x6f48[_0x2b7c49];return _0x24fc03;};'use strict';var Sequelize=require(_0x86f4('0x0'));var rs=require('randomstring');module[_0x86f4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x86f4('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x4')},'mapKeyOffline':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x4')},'key':{'type':Sequelize[_0x86f4('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x86f4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x86f4('0x3')],'allowNull':![],'defaultValue':_0x86f4('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86f4('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x86f4('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x86f4('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x86f4('0x3')]},'animation':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x86f4('0x9')),'defaultValue':_0x86f4('0xa')},'header_online':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xb')},'start_chat_button':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xc')},'offline_chat_button':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xd')},'header_offline':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xe')},'download_transcript':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x86f4('0x10')]},'closingQuestion':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x86f4('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x86f4('0x15')},'closingMessageButton':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xd')},'skipMessageButton':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x16')},'conditionAgreement':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x17')},'ratingType':{'type':Sequelize['ENUM']('star',_0x86f4('0x18')),'defaultValue':_0x86f4('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x86f4('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x86f4('0x1a')]({'items':[{'type':_0x86f4('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x86f4('0x1c'),'required':!![]},'props':{'title':_0x86f4('0x1d'),'helpText':''}},{'type':_0x86f4('0x1b'),'props':{'title':_0x86f4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x86f4('0x4'),'type':_0x86f4('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x86f4('0x1e')](_0x86f4('0x1f'))?JSON[_0x86f4('0x20')](this[_0x86f4('0x1e')](_0x86f4('0x1f'))):{};},'set':function(_0x3dc215){return this[_0x86f4('0x21')]('onlineForm',JSON[_0x86f4('0x1a')](_0x3dc215));}},'offlineForm':{'type':Sequelize[_0x86f4('0x10')],'defaultValue':function(){return JSON[_0x86f4('0x1a')]({'items':[{'type':_0x86f4('0x1b'),'props':{'title':_0x86f4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x86f4('0x4'),'type':'email'},'variable':null},{'type':_0x86f4('0x22'),'config':{'placeholder':_0x86f4('0x23')},'props':{'title':_0x86f4('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x86f4('0x1e')]('offlineForm')?JSON[_0x86f4('0x20')](this['getDataValue'](_0x86f4('0x24'))):{};},'set':function(_0x3023e2){return this[_0x86f4('0x21')](_0x86f4('0x24'),JSON['stringify'](_0x3023e2));}},'token':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x86f4('0x3')]},'forwardOffline':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x25')},'waitingMessage':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x27')},'offlineMessageBody':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x29')},'skipUnmanaged':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x86f4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x86f4('0x10')],'defaultValue':function(){return _0x86f4('0x2a');}},'notificationSound':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x86f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x86f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x2c')},'verticalAlignment':{'type':Sequelize[_0x86f4('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x2d')},'defaultTitle':{'type':Sequelize[_0x86f4('0x3')]},'customerAvatar':{'type':Sequelize[_0x86f4('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x86f4('0x3')],'allowNull':![],'defaultValue':_0x86f4('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x86f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x86f4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x86f4('0x3')],'defaultValue':_0x86f4('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x86f4('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![],'comment':_0x86f4('0x31'),'set':function(_0x2043ec){if(!_0x2043ec)this[_0x86f4('0x21')](_0x86f4('0x32'),null);this['setDataValue'](_0x86f4('0x33'),_0x2043ec);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x86f4('0x3')]},'vidaooTopic':{'type':Sequelize[_0x86f4('0x3')],'allowNull':![],'defaultValue':_0x86f4('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x86f4('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x86f4('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x86f4('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x86f4('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 40d0c00..304d631 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 _0x33a3=['getAnswers','findOne','hasOwnProperty','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','server/files/images/logos/','download','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','from','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','CmList','ChatApplication','Applications','Interval','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','ifTime','account','list','List','applications','orderBy','priority','asc','Contacts','defaults','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','ChatMessage','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','from\x20is\x20mandatory','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','offlineMessageBody','ChatOfflineMessage','fromString','originalname','files','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','toPairsIn','mapValues','subjectOffline','Chat','MailAccountId','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','internal','Tags','tag','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','timezone','readFileSync','server/files/chat/iframe.ejs','3.7.0','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','color','labelText','textColor','color_button','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','mustache','util','fs-extra','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','api','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','redis','socket.io-emitter','./chatWebsite.socket','register','http','client','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','update','destroy','get','stack','name','send','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','model','device','vendor','%s\x20%s\x20%s','type','stringify','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','userProfileId','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','removeDispositions','ids','CannedAnswer'];(function(_0x533893,_0x240aa3){var _0xdc7c10=function(_0x7e6223){while(--_0x7e6223){_0x533893['push'](_0x533893['shift']());}};_0xdc7c10(++_0x240aa3);}(_0x33a3,0x1d5));var _0x333a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x33a3[_0x2dafbe];return _0x58a45a;};'use strict';var Mustache=require(_0x333a('0x0'));var util=require(_0x333a('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x333a('0x2'));var _=require(_0x333a('0x3'));var querystring=require(_0x333a('0x4'));var htmlToText=require(_0x333a('0x5'));var Redis=require(_0x333a('0x6'));var jayson=require('jayson/promise');var url=require(_0x333a('0x7'));var qs=require(_0x333a('0x8'));var logger=require('../../config/logger')(_0x333a('0x9'));var config=require('../../config/environment');var APIBadRequestError=require(_0x333a('0xa'))['APIBadRequestError'];var APINotFoundError=require(_0x333a('0xa'))[_0x333a('0xb')];var APIOutOfIntervalError=require(_0x333a('0xa'))[_0x333a('0xc')];var APIHandleError=require(_0x333a('0xa'))[_0x333a('0xd')];var db=require('../../mysqldb')['db'];config[_0x333a('0xe')]=_['defaults'](config[_0x333a('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x333a('0xf'))(new Redis(config[_0x333a('0xe')]));require(_0x333a('0x10'))[_0x333a('0x11')](socket);var client=jayson['client'][_0x333a('0x12')]({'port':0x232c});var client9002=jayson[_0x333a('0x13')][_0x333a('0x12')]({'port':0x232a});var client9003=jayson[_0x333a('0x13')][_0x333a('0x12')]({'port':0x232b});var client9001=jayson[_0x333a('0x13')][_0x333a('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x267257,_0x1d6ba0,_0x23ecb7,_0x51eaf5){return new Promise(function(_0x3b748a,_0x240c22){var _0x272216=_0x51eaf5||client;return _0x272216['request'](_0x267257,_0x23ecb7)[_0x333a('0x14')](function(_0x5c2a7c){logger['info'](_0x333a('0x15'),_0x1d6ba0,'request\x20sent');logger[_0x333a('0x16')](_0x333a('0x17'),_0x1d6ba0,'request\x20sent',JSON['stringify'](_0x5c2a7c));if(_0x5c2a7c[_0x333a('0x18')]){if(_0x5c2a7c[_0x333a('0x18')][_0x333a('0x19')]===0x1f4){logger['error'](_0x333a('0x15'),_0x1d6ba0,_0x5c2a7c[_0x333a('0x18')][_0x333a('0x1a')]);return _0x240c22(_0x5c2a7c[_0x333a('0x18')][_0x333a('0x1a')]);}logger[_0x333a('0x18')](_0x333a('0x15'),_0x1d6ba0,_0x5c2a7c[_0x333a('0x18')][_0x333a('0x1a')]);return _0x3b748a(_0x5c2a7c[_0x333a('0x18')][_0x333a('0x1a')]);}else{logger['info'](_0x333a('0x15'),_0x1d6ba0,'request\x20sent');_0x3b748a(_0x5c2a7c[_0x333a('0x1b')]['message']);}})['catch'](function(_0x213a7a){logger[_0x333a('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x1d6ba0,_0x213a7a);_0x240c22(_0x213a7a);});});}function respondWithStatusCode(_0x1b4351,_0x189d96){_0x189d96=_0x189d96||0xcc;return function(_0x182039){if(_0x182039){return _0x1b4351[_0x333a('0x1c')](_0x189d96);}return _0x1b4351[_0x333a('0x1d')](_0x189d96)[_0x333a('0x1e')]();};}function respondWithResult(_0x5d9f2e,_0x12faf7){_0x12faf7=_0x12faf7||0xc8;return function(_0x11645d){if(_0x11645d){return _0x5d9f2e[_0x333a('0x1d')](_0x12faf7)[_0x333a('0x1f')](_0x11645d);}};}function respondWithFilteredResult(_0x146b50,_0x57c2cb){return function(_0x56cbad){if(_0x56cbad){var _0x209bf3=typeof _0x57c2cb[_0x333a('0x20')]===_0x333a('0x21')&&typeof _0x57c2cb['limit']==='undefined';var _0xc93cfe=_0x56cbad[_0x333a('0x22')];var _0x147826=_0x209bf3?0x0:_0x57c2cb['offset'];var _0x9875d1=_0x209bf3?_0x56cbad[_0x333a('0x22')]:_0x57c2cb[_0x333a('0x20')]+_0x57c2cb[_0x333a('0x23')];var _0x10f3d2;if(_0x9875d1>=_0xc93cfe){_0x9875d1=_0xc93cfe;_0x10f3d2=0xc8;}else{_0x10f3d2=0xce;}_0x146b50['status'](_0x10f3d2);return _0x146b50[_0x333a('0x24')]('Content-Range',_0x147826+'-'+_0x9875d1+'/'+_0xc93cfe)[_0x333a('0x1f')](_0x56cbad);}return null;};}function saveUpdates(_0x3a5ae8){return function(_0x2a5df0){if(_0x2a5df0){return _0x2a5df0[_0x333a('0x25')](_0x3a5ae8)['then'](function(_0x247f4d){return _0x247f4d;});}return null;};}function removeEntity(_0x5010e1){return function(_0x469a0d){if(_0x469a0d){return _0x469a0d[_0x333a('0x26')]()['then'](function(){var _0x2d0c22=_0x469a0d[_0x333a('0x27')]({'plain':!![]});var _0xd1576e='ChatWebsites';return db['UserProfileResource'][_0x333a('0x26')]({'where':{'type':_0xd1576e,'resourceId':_0x2d0c22['id']}})[_0x333a('0x14')](function(){return _0x469a0d;});})[_0x333a('0x14')](function(){_0x5010e1['status'](0xcc)[_0x333a('0x1e')]();});}};}function handleEntityNotFound(_0x5e7873){return function(_0x4c8d45){if(!_0x4c8d45){_0x5e7873[_0x333a('0x1c')](0x194);}return _0x4c8d45;};}function handleError(_0x24d5a6,_0x37ed8f){_0x37ed8f=_0x37ed8f||0x1f4;return function(_0x437c8b){logger[_0x333a('0x18')](_0x437c8b[_0x333a('0x28')]);if(_0x437c8b['name']){delete _0x437c8b[_0x333a('0x29')];}_0x24d5a6[_0x333a('0x1d')](_0x37ed8f)[_0x333a('0x2a')](_0x437c8b);};}function createInteractionObject(_0x3d098f,_0x6999b0,_0x32f8c6,_0x5e5d19){var _0x128243=require('user-agent-parser');var _0x92d77=new _0x128243();var _0x3f9208=_0x92d77['setUA'](_0x32f8c6['user-agent'])[_0x333a('0x2b')]();var _0x543b07=_0x6999b0[_0x333a('0x2c')];if(_0x32f8c6[_0x333a('0x2d')]){_0x543b07=_0x32f8c6[_0x333a('0x2d')];}else if(_0x32f8c6[_0x333a('0x2e')]){_0x543b07=_[_0x333a('0x2f')](_0x32f8c6[_0x333a('0x2e')][_0x333a('0x30')](','));}return{'ContactId':_0x5e5d19['id'],'ChatWebsiteId':_0x3d098f,'from':(_0x5e5d19[_0x333a('0x31')]||'')+'\x20'+(_0x5e5d19[_0x333a('0x32')]||''),'customerIp':_0x543b07,'customerPort':_0x32f8c6[_0x333a('0x33')]?_0x32f8c6['x-real-port']:null,'referer':_0x6999b0[_0x333a('0x34')],'browserName':_0x3f9208[_0x333a('0x35')]['name']&&_0x3f9208[_0x333a('0x35')]['version']?util[_0x333a('0x36')](_0x333a('0x37'),_0x3f9208[_0x333a('0x35')]['name'],_0x3f9208[_0x333a('0x35')][_0x333a('0x38')]):_0x333a('0x39'),'browserVersion':_0x3f9208[_0x333a('0x35')]['version']||_0x333a('0x39'),'osName':util[_0x333a('0x36')](_0x333a('0x37'),_0x3f9208['os'][_0x333a('0x29')],_0x3f9208['os'][_0x333a('0x38')]),'osVersion':_0x3f9208['os'][_0x333a('0x38')],'deviceModel':_0x3f9208['device'][_0x333a('0x3a')]&&_0x3f9208[_0x333a('0x3b')][_0x333a('0x3c')]?util[_0x333a('0x36')](_0x333a('0x3d'),_0x3f9208[_0x333a('0x3b')][_0x333a('0x3a')],_0x3f9208[_0x333a('0x3b')][_0x333a('0x3c')],_0x3f9208[_0x333a('0x3b')][_0x333a('0x3e')]):null,'deviceVendor':_0x3f9208[_0x333a('0x3b')][_0x333a('0x3c')],'deviceType':_0x3f9208[_0x333a('0x3b')][_0x333a('0x3e')],'formData':JSON[_0x333a('0x3f')](_0x6999b0)};}exports[_0x333a('0x40')]=function(_0x95e0ae,_0x4c1402){var _0x17e99a={'include':[{'model':db['Pause'],'as':_0x333a('0x41')}]},_0xd0e12a={},_0x32773d={'count':0x0,'rows':[]};var _0x446aa7=_[_0x333a('0x42')](db[_0x333a('0x43')][_0x333a('0x44')],function(_0x6dd270){return{'name':_0x6dd270[_0x333a('0x45')],'type':_0x6dd270[_0x333a('0x3e')][_0x333a('0x46')]};});_0xd0e12a[_0x333a('0x3a')]=_[_0x333a('0x42')](_0x446aa7,_0x333a('0x29'));_0xd0e12a[_0x333a('0x47')]=_[_0x333a('0x48')](_0x95e0ae[_0x333a('0x47')]);_0xd0e12a[_0x333a('0x49')]=_[_0x333a('0x4a')](_0xd0e12a[_0x333a('0x3a')],_0xd0e12a[_0x333a('0x47')]);_0x17e99a[_0x333a('0x4b')]=_[_0x333a('0x4a')](_0xd0e12a['model'],qs[_0x333a('0x4c')](_0x95e0ae[_0x333a('0x47')]['fields']));_0x17e99a[_0x333a('0x4b')]=_0x17e99a[_0x333a('0x4b')][_0x333a('0x4d')]?_0x17e99a[_0x333a('0x4b')]:_0xd0e12a['model'];if(!_0x95e0ae[_0x333a('0x47')]['hasOwnProperty'](_0x333a('0x4e'))){_0x17e99a['limit']=qs[_0x333a('0x23')](_0x95e0ae[_0x333a('0x47')]['limit']);_0x17e99a[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x95e0ae[_0x333a('0x47')][_0x333a('0x20')]);}_0x17e99a[_0x333a('0x4f')]=qs[_0x333a('0x50')](_0x95e0ae['query'][_0x333a('0x50')]);_0x17e99a[_0x333a('0x51')]=qs[_0x333a('0x49')](_['pick'](_0x95e0ae[_0x333a('0x47')],_0xd0e12a[_0x333a('0x49')]),_0x446aa7);if(_0x95e0ae[_0x333a('0x47')][_0x333a('0x52')]){_0x17e99a[_0x333a('0x51')]=_['merge'](_0x17e99a['where'],{'$or':_[_0x333a('0x42')](_0x446aa7,function(_0x2e6338){if(_0x2e6338['type']!==_0x333a('0x53')){var _0xa6b9c3={};_0xa6b9c3[_0x2e6338[_0x333a('0x29')]]={'$like':'%'+_0x95e0ae[_0x333a('0x47')][_0x333a('0x52')]+'%'};return _0xa6b9c3;}})});}_0x17e99a=_[_0x333a('0x54')]({},_0x17e99a,_0x95e0ae[_0x333a('0x55')]);var _0x4cb583={'where':_0x17e99a[_0x333a('0x51')]};return db['ChatWebsite'][_0x333a('0x22')](_0x4cb583)[_0x333a('0x14')](function(_0x3c641a){_0x32773d[_0x333a('0x22')]=_0x3c641a;if(_0x95e0ae[_0x333a('0x47')][_0x333a('0x56')]){_0x17e99a[_0x333a('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0x333a('0x58')](_0x17e99a);})['then'](function(_0x5c9ab2){_0x32773d[_0x333a('0x59')]=_0x5c9ab2;return _0x32773d;})[_0x333a('0x14')](respondWithFilteredResult(_0x4c1402,_0x17e99a))['catch'](handleError(_0x4c1402,null));};exports[_0x333a('0x5a')]=function(_0x11f3ea,_0x25c1c2){var _0x5129dc={'raw':![],'where':{'id':_0x11f3ea[_0x333a('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x333a('0x41')}]},_0x38d482={};_0x38d482[_0x333a('0x3a')]=_[_0x333a('0x48')](db[_0x333a('0x43')]['rawAttributes']);_0x38d482[_0x333a('0x47')]=_[_0x333a('0x48')](_0x11f3ea['query']);_0x38d482[_0x333a('0x49')]=_['intersection'](_0x38d482[_0x333a('0x3a')],_0x38d482[_0x333a('0x47')]);_0x5129dc[_0x333a('0x4b')]=_[_0x333a('0x4a')](_0x38d482[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x11f3ea[_0x333a('0x47')][_0x333a('0x4c')]));_0x5129dc[_0x333a('0x4b')]=_0x5129dc[_0x333a('0x4b')][_0x333a('0x4d')]?_0x5129dc[_0x333a('0x4b')]:_0x38d482[_0x333a('0x3a')];if(_0x11f3ea[_0x333a('0x47')]['includeAll']){_0x5129dc['include']=[{'all':!![]}];}_0x5129dc=_['merge']({},_0x5129dc,_0x11f3ea[_0x333a('0x55')]);return db[_0x333a('0x43')][_0x333a('0x5c')](_0x5129dc)['then'](handleEntityNotFound(_0x25c1c2,null))[_0x333a('0x14')](respondWithResult(_0x25c1c2,null))[_0x333a('0x5d')](handleError(_0x25c1c2,null));};exports[_0x333a('0x5e')]=function(_0x2f92a4,_0x5c8c4b){return db[_0x333a('0x43')][_0x333a('0x5e')](_0x2f92a4[_0x333a('0x5f')],{})[_0x333a('0x14')](function(_0x1ae1f3){var _0x5a5a9a=_0x2f92a4[_0x333a('0x60')][_0x333a('0x27')]({'plain':!![]});if(!_0x5a5a9a)throw new Error(_0x333a('0x61'));if(_0x5a5a9a[_0x333a('0x62')]===_0x333a('0x60')){var _0x1ad03e=_0x1ae1f3[_0x333a('0x27')]({'plain':!![]});var _0xf0be6d=_0x333a('0x63');return db['UserProfileSection'][_0x333a('0x5c')]({'where':{'name':_0xf0be6d,'userProfileId':_0x5a5a9a[_0x333a('0x64')]},'raw':!![]})[_0x333a('0x14')](function(_0x23a915){if(_0x23a915&&_0x23a915['autoAssociation']===0x0){return db[_0x333a('0x65')][_0x333a('0x5e')]({'name':_0x1ad03e['name'],'resourceId':_0x1ad03e['id'],'type':_0x23a915[_0x333a('0x29')],'sectionId':_0x23a915['id']},{})['then'](function(){return _0x1ae1f3;});}else{return _0x1ae1f3;}})[_0x333a('0x5d')](function(_0x24a859){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24a859);throw _0x24a859;});}return _0x1ae1f3;})[_0x333a('0x14')](respondWithResult(_0x5c8c4b,0xc9))[_0x333a('0x5d')](handleError(_0x5c8c4b,null));};exports[_0x333a('0x25')]=function(_0x55fcf4,_0x25ea33){if(_0x55fcf4[_0x333a('0x5f')]['id']){delete _0x55fcf4[_0x333a('0x5f')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x55fcf4['params']['id']},'include':[{'model':db['Pause'],'as':_0x333a('0x41')}]})[_0x333a('0x14')](handleEntityNotFound(_0x25ea33,null))['then'](saveUpdates(_0x55fcf4[_0x333a('0x5f')],null))[_0x333a('0x14')](respondWithResult(_0x25ea33,null))[_0x333a('0x5d')](handleError(_0x25ea33,null));};exports[_0x333a('0x26')]=function(_0xe5150d,_0x1caffa){return db[_0x333a('0x43')]['find']({'where':{'id':_0xe5150d['params']['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x1caffa,null))[_0x333a('0x14')](removeEntity(_0x1caffa,null))[_0x333a('0x5d')](handleError(_0x1caffa,null));};exports[_0x333a('0x66')]=function(_0x3cacb7,_0x477af8){return db['ChatWebsite'][_0x333a('0x66')]()[_0x333a('0x14')](respondWithResult(_0x477af8,null))['catch'](handleError(_0x477af8,null));};exports[_0x333a('0x67')]=function(_0x3b38df,_0x4592f2){if(_0x3b38df[_0x333a('0x5f')]['id']){delete _0x3b38df['body']['id'];}return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x3b38df[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x4592f2,null))[_0x333a('0x14')](function(_0x29e69d){if(_0x29e69d){_0x3b38df['body'][_0x333a('0x68')]=_0x29e69d['id'];return db[_0x333a('0x69')]['create'](_0x3b38df[_0x333a('0x5f')]);}})[_0x333a('0x14')](respondWithResult(_0x4592f2,null))[_0x333a('0x5d')](handleError(_0x4592f2,null));};exports[_0x333a('0x6a')]=function(_0x2003a1,_0x4eec30){var _0x5b2900={'raw':![],'where':{}};var _0x3bdd3d={};var _0x49c96b={'count':0x0,'rows':[]};return db[_0x333a('0x43')]['findOne']({'where':{'id':_0x2003a1['params']['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x4eec30,null))[_0x333a('0x14')](function(_0x1d4c2e){if(_0x1d4c2e){_0x3bdd3d[_0x333a('0x3a')]=_['keys'](db[_0x333a('0x69')][_0x333a('0x44')]);_0x3bdd3d[_0x333a('0x47')]=_[_0x333a('0x48')](_0x2003a1[_0x333a('0x47')]);_0x3bdd3d[_0x333a('0x49')]=_['intersection'](_0x3bdd3d[_0x333a('0x3a')],_0x3bdd3d[_0x333a('0x47')]);_0x5b2900['attributes']=_[_0x333a('0x4a')](_0x3bdd3d[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x2003a1[_0x333a('0x47')][_0x333a('0x4c')]));_0x5b2900[_0x333a('0x4b')]=_0x5b2900[_0x333a('0x4b')]['length']?_0x5b2900[_0x333a('0x4b')]:_0x3bdd3d[_0x333a('0x3a')];if(!_0x2003a1[_0x333a('0x47')]['hasOwnProperty'](_0x333a('0x4e'))){_0x5b2900['limit']=qs[_0x333a('0x23')](_0x2003a1['query'][_0x333a('0x23')]);_0x5b2900[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x2003a1[_0x333a('0x47')][_0x333a('0x20')]);}_0x5b2900[_0x333a('0x4f')]=qs[_0x333a('0x50')](_0x2003a1[_0x333a('0x47')][_0x333a('0x50')]);_0x5b2900[_0x333a('0x51')]=qs['filters'](_[_0x333a('0x6b')](_0x2003a1[_0x333a('0x47')],_0x3bdd3d[_0x333a('0x49')]));_0x5b2900[_0x333a('0x51')][_0x333a('0x68')]=_0x1d4c2e['id'];if(_0x2003a1[_0x333a('0x47')][_0x333a('0x52')]){_0x5b2900[_0x333a('0x51')]=_[_0x333a('0x54')](_0x5b2900[_0x333a('0x51')],{'$or':_[_0x333a('0x42')](_0x5b2900[_0x333a('0x4b')],function(_0x3f3c52){var _0x382cdf={};_0x382cdf[_0x3f3c52]={'$like':'%'+_0x2003a1[_0x333a('0x47')]['filter']+'%'};return _0x382cdf;})});}_0x5b2900=_['merge']({},_0x5b2900,_0x2003a1[_0x333a('0x55')]);return db[_0x333a('0x69')][_0x333a('0x22')]({'where':_0x5b2900[_0x333a('0x51')]})['then'](function(_0x141b6b){_0x49c96b[_0x333a('0x22')]=_0x141b6b;if(_0x2003a1[_0x333a('0x47')][_0x333a('0x56')]){_0x5b2900[_0x333a('0x57')]=[{'all':!![]}];}return db[_0x333a('0x69')][_0x333a('0x58')](_0x5b2900);})[_0x333a('0x14')](function(_0x2875c0){_0x49c96b['rows']=_0x2875c0;return _0x49c96b;});}})['then'](respondWithFilteredResult(_0x4eec30,_0x5b2900))[_0x333a('0x5d')](handleError(_0x4eec30,null));};exports[_0x333a('0x6c')]=function(_0x313bc7,_0x59339e){return db[_0x333a('0x43')]['find']({'where':{'id':_0x313bc7['params']['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x59339e,null))['then'](function(_0x17b87e){if(_0x17b87e){return _0x17b87e[_0x333a('0x6c')](_0x313bc7[_0x333a('0x47')][_0x333a('0x6d')]);}})[_0x333a('0x14')](respondWithStatusCode(_0x59339e,null))[_0x333a('0x5d')](handleError(_0x59339e,null));};exports['addAnswer']=function(_0xcd724f,_0x124d34){if(_0xcd724f[_0x333a('0x5f')]['id']){delete _0xcd724f[_0x333a('0x5f')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xcd724f[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x124d34,null))['then'](function(_0x47c2a5){if(_0x47c2a5){_0xcd724f[_0x333a('0x5f')]['ChatWebsiteId']=_0x47c2a5['id'];return db[_0x333a('0x6e')]['create'](_0xcd724f[_0x333a('0x5f')]);}})[_0x333a('0x14')](respondWithResult(_0x124d34,null))[_0x333a('0x5d')](handleError(_0x124d34,null));};exports[_0x333a('0x6f')]=function(_0x338281,_0x2eae8d){var _0x2abc58={'raw':![],'where':{}};var _0x3881a3={};var _0x504559={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x333a('0x70')]({'where':{'id':_0x338281['params']['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x2eae8d,null))[_0x333a('0x14')](function(_0x2d7392){if(_0x2d7392){_0x3881a3[_0x333a('0x3a')]=_['keys'](db[_0x333a('0x6e')][_0x333a('0x44')]);_0x3881a3[_0x333a('0x47')]=_[_0x333a('0x48')](_0x338281['query']);_0x3881a3['filters']=_[_0x333a('0x4a')](_0x3881a3['model'],_0x3881a3[_0x333a('0x47')]);_0x2abc58[_0x333a('0x4b')]=_[_0x333a('0x4a')](_0x3881a3[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x338281[_0x333a('0x47')][_0x333a('0x4c')]));_0x2abc58[_0x333a('0x4b')]=_0x2abc58[_0x333a('0x4b')][_0x333a('0x4d')]?_0x2abc58['attributes']:_0x3881a3['model'];if(!_0x338281[_0x333a('0x47')][_0x333a('0x71')](_0x333a('0x4e'))){_0x2abc58['limit']=qs[_0x333a('0x23')](_0x338281['query'][_0x333a('0x23')]);_0x2abc58[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x338281[_0x333a('0x47')][_0x333a('0x20')]);}_0x2abc58[_0x333a('0x4f')]=qs['sort'](_0x338281['query'][_0x333a('0x50')]);_0x2abc58[_0x333a('0x51')]=qs[_0x333a('0x49')](_[_0x333a('0x6b')](_0x338281[_0x333a('0x47')],_0x3881a3['filters']));_0x2abc58[_0x333a('0x51')][_0x333a('0x68')]=_0x2d7392['id'];if(_0x338281[_0x333a('0x47')]['filter']){_0x2abc58[_0x333a('0x51')]=_['merge'](_0x2abc58[_0x333a('0x51')],{'$or':_[_0x333a('0x42')](_0x2abc58[_0x333a('0x4b')],function(_0x1da237){var _0x1eb850={};_0x1eb850[_0x1da237]={'$like':'%'+_0x338281[_0x333a('0x47')]['filter']+'%'};return _0x1eb850;})});}_0x2abc58=_['merge']({},_0x2abc58,_0x338281[_0x333a('0x55')]);return db['CannedAnswer'][_0x333a('0x22')]({'where':_0x2abc58['where']})[_0x333a('0x14')](function(_0x295166){_0x504559[_0x333a('0x22')]=_0x295166;if(_0x338281[_0x333a('0x47')][_0x333a('0x56')]){_0x2abc58[_0x333a('0x57')]=[{'all':!![]}];}return db[_0x333a('0x6e')]['findAll'](_0x2abc58);})['then'](function(_0x293a07){_0x504559['rows']=_0x293a07;return _0x504559;});}})['then'](respondWithFilteredResult(_0x2eae8d,_0x2abc58))[_0x333a('0x5d')](handleError(_0x2eae8d,null));};exports[_0x333a('0x72')]=function(_0x5fe0c2,_0x5cf4b6){return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x5fe0c2['params']['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x5cf4b6,null))[_0x333a('0x14')](function(_0x6d4801){if(_0x6d4801){return _0x6d4801[_0x333a('0x72')](_0x5fe0c2[_0x333a('0x47')][_0x333a('0x6d')]);}})[_0x333a('0x14')](respondWithStatusCode(_0x5cf4b6,null))[_0x333a('0x5d')](handleError(_0x5cf4b6,null));};exports['addLogo']=function(_0x43a01d,_0x517a64){_0x43a01d[_0x333a('0x5f')]['sitepic']=_0x43a01d[_0x333a('0x73')][_0x333a('0x74')];return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x43a01d[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x517a64,null))[_0x333a('0x14')](saveUpdates(_0x43a01d[_0x333a('0x5f')],null))[_0x333a('0x14')](respondWithResult(_0x517a64,null))['catch'](handleError(_0x517a64,null));};exports[_0x333a('0x75')]=function(_0x346583,_0xe39614){_0x346583[_0x333a('0x5f')][_0x333a('0x76')]=_0x346583[_0x333a('0x73')][_0x333a('0x74')];return db[_0x333a('0x43')]['find']({'where':{'id':_0x346583[_0x333a('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe39614,null))['then'](saveUpdates(_0x346583[_0x333a('0x5f')],null))[_0x333a('0x14')](respondWithResult(_0xe39614,null))[_0x333a('0x5d')](handleError(_0xe39614,null));};exports[_0x333a('0x77')]=function(_0x2be5bb,_0x488480){_0x2be5bb[_0x333a('0x5f')]['customerAvatar']=_0x2be5bb[_0x333a('0x73')]['filename'];return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x2be5bb[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x488480,null))[_0x333a('0x14')](saveUpdates(_0x2be5bb[_0x333a('0x5f')],null))[_0x333a('0x14')](respondWithResult(_0x488480,null))[_0x333a('0x5d')](handleError(_0x488480,null));};exports[_0x333a('0x78')]=function(_0x45386b,_0x10cd76){_0x45386b[_0x333a('0x5f')][_0x333a('0x79')]=_0x45386b[_0x333a('0x73')]['filename'];return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x45386b[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x10cd76,null))[_0x333a('0x14')](saveUpdates(_0x45386b['body'],null))[_0x333a('0x14')](respondWithResult(_0x10cd76,null))['catch'](handleError(_0x10cd76,null));};exports[_0x333a('0x7a')]=function(_0x4fbc5f,_0x3d5bc8){var _0x240c86=path[_0x333a('0x7b')](config[_0x333a('0x7c')],_0x333a('0x7d'));var _0x2545d3={'where':{'id':_0x4fbc5f[_0x333a('0x5b')]['id']},'attributes':['id',_0x333a('0x7e')],'raw':!![]};var _0x3b20af=![];return require('../../config/license/util')[_0x333a('0x7f')]()[_0x333a('0x14')](function(_0xcaa50c){if(_0xcaa50c){_0x3b20af=_0xcaa50c[_0x333a('0x80')];}})[_0x333a('0x14')](function(){return db[_0x333a('0x43')]['find'](_0x2545d3);})[_0x333a('0x14')](handleEntityNotFound(_0x3d5bc8,null))[_0x333a('0x14')](function(_0x2779eb){if(_0x2779eb){if(!_['isNil'](_0x2779eb[_0x333a('0x7e')])){if(fs['existsSync'](path[_0x333a('0x7b')](config[_0x333a('0x7c')],_0x333a('0x81'),_0x2779eb[_0x333a('0x7e')]))&&_0x3b20af){_0x240c86=path['join'](config['root'],'server/files/images/logos/',_0x2779eb[_0x333a('0x7e')]);}}return _0x3d5bc8[_0x333a('0x82')](_0x240c86);}})['catch'](handleError(_0x3d5bc8,null));};exports['getAvatar']=function(_0x5e1c93,_0x3084f7){var _0x4cb12b=path['join'](config[_0x333a('0x7c')],'server/files/images/avatars/default_avatar.png');var _0x588ae2={'where':{'id':_0x5e1c93[_0x333a('0x5b')]['id']},'attributes':['id',_0x333a('0x76')],'raw':!![]};return db[_0x333a('0x43')]['find'](_0x588ae2)[_0x333a('0x14')](handleEntityNotFound(_0x3084f7,null))[_0x333a('0x14')](function(_0x419ac1){if(_0x419ac1){if(!_['isNil'](_0x419ac1[_0x333a('0x76')])){if(fs[_0x333a('0x83')](path[_0x333a('0x7b')](config[_0x333a('0x7c')],_0x333a('0x84'),_0x419ac1[_0x333a('0x76')]))){_0x4cb12b=path['join'](config[_0x333a('0x7c')],_0x333a('0x84'),_0x419ac1[_0x333a('0x76')]);}}return _0x3084f7[_0x333a('0x82')](_0x4cb12b);}})['catch'](handleError(_0x3084f7,null));};exports[_0x333a('0x85')]=function(_0x43b682,_0x2e876d){var _0x5c87a8=path[_0x333a('0x7b')](config[_0x333a('0x7c')],_0x333a('0x86'));var _0x1a8ef9={'where':{'id':_0x43b682[_0x333a('0x5b')]['id']},'attributes':['id','customerAvatar',_0x333a('0x87')],'raw':!![]};return db[_0x333a('0x43')][_0x333a('0x5c')](_0x1a8ef9)[_0x333a('0x14')](handleEntityNotFound(_0x2e876d,null))[_0x333a('0x14')](function(_0x4a8aec){if(_0x4a8aec){if(!_[_0x333a('0x88')](_0x4a8aec[_0x333a('0x89')])){if(fs['existsSync'](path[_0x333a('0x7b')](config['root'],'server/files/images/avatars/',_0x4a8aec[_0x333a('0x89')]))&&_0x4a8aec[_0x333a('0x87')]){_0x5c87a8=path[_0x333a('0x7b')](config['root'],_0x333a('0x84'),_0x4a8aec[_0x333a('0x89')]);}}return _0x2e876d[_0x333a('0x82')](_0x5c87a8);}})[_0x333a('0x5d')](handleError(_0x2e876d,null));};exports[_0x333a('0x8a')]=function(_0x4ca6dd,_0xe24700){var _0x53d8f7=path[_0x333a('0x7b')](config['root'],_0x333a('0x8b'));var _0x205d6f={'where':{'id':_0x4ca6dd[_0x333a('0x5b')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x333a('0x43')][_0x333a('0x5c')](_0x205d6f)[_0x333a('0x14')](handleEntityNotFound(_0xe24700,null))[_0x333a('0x14')](function(_0x37a8be){if(_0x37a8be){if(!_[_0x333a('0x88')](_0x37a8be['systemAvatar'])){if(fs[_0x333a('0x83')](path[_0x333a('0x7b')](config[_0x333a('0x7c')],_0x333a('0x84'),_0x37a8be[_0x333a('0x79')]))){_0x53d8f7=path[_0x333a('0x7b')](config['root'],_0x333a('0x84'),_0x37a8be[_0x333a('0x79')]);}}return _0xe24700[_0x333a('0x82')](_0x53d8f7);}})[_0x333a('0x5d')](handleError(_0xe24700,null));};exports[_0x333a('0x8c')]=function(_0x3af25c,_0x5499c4){var _0x1e02fb={'body':_0x3af25c[_0x333a('0x5f')],'channel':'chat'};var _0xbb5bdd=[];var _0x11bf94=[];var _0x5e9488={};var _0x81e4dc=![];if(_0x3af25c['body']['id']){delete _0x3af25c[_0x333a('0x5f')]['id'];}if(_[_0x333a('0x88')](_0x3af25c[_0x333a('0x5f')][_0x333a('0x8d')])){throw new APIBadRequestError(_0x333a('0x8e'));}if(_[_0x333a('0x88')](_0x3af25c[_0x333a('0x5f')][_0x333a('0x8f')])){throw new APIBadRequestError(_0x333a('0x90'));}if(_[_0x333a('0x91')](_0x3af25c[_0x333a('0x5f')][_0x333a('0x5f')])){throw new APIBadRequestError(_0x333a('0x92'));}return db[_0x333a('0x93')][_0x333a('0x66')]()['then'](function(_0x2e7a4f){if(!_0x2e7a4f){throw new Error(_0x333a('0x94'));}_0xbb5bdd=Object[_0x333a('0x48')](_0x2e7a4f)[_0x333a('0x52')](function(_0x581dc4){return![_0x333a('0x95'),_0x333a('0x96')]['includes'](_0x581dc4);});_0x11bf94=Object[_0x333a('0x48')](_0x2e7a4f)['filter'](function(_0x5a92b6){return![_0x333a('0x95'),'updatedAt',_0x333a('0x97'),_0x333a('0x98')]['includes'](_0x5a92b6);});if(!_[_0x333a('0x99')](_0x11bf94,_0x3af25c[_0x333a('0x5f')][_0x333a('0x8f')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x11bf94['join'](',\x20'));}_0x5e9488[_0x3af25c[_0x333a('0x5f')][_0x333a('0x8f')]]=_0x3af25c['body']['from'];})['then'](function(){return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x3af25c[_0x333a('0x5b')]['id']},'include':[{'model':db[_0x333a('0x9a')],'as':'List','include':[{'model':db[_0x333a('0x93')],'as':'Contacts','where':_0x5e9488,'limit':0x1,'order':[[_0x333a('0x96'),'DESC']]}]},{'model':db[_0x333a('0x9b')],'as':_0x333a('0x9c')},{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x333a('0x9d')],'as':'Intervals','attributes':['id',_0x333a('0x9e')],'raw':!![]}]}]});})[_0x333a('0x14')](function(_0x1f20de){if(!_0x1f20de){throw new APINotFoundError(util['format'](_0x333a('0x9f'),_0x3af25c[_0x333a('0x5b')]['id']));}var _0x3fecd4=_0x1f20de[_0x333a('0x9d')];if(_0x3fecd4){var _0x4276b0=_0x1f20de['timezone']||undefined;return _0x3fecd4[_0x333a('0xa0')](_0x4276b0)[_0x333a('0x14')](function(_0x1e28be){if(!_0x1e28be){throw new APIOutOfIntervalError();}return _0x1f20de;});}else{return _0x1f20de;}})[_0x333a('0x14')](function(_0xa29d1){if(!_0xa29d1['List']){return;}_0x1e02fb[_0x333a('0xa1')]=_0xa29d1;_0x1e02fb[_0x333a('0xa2')]=_0xa29d1[_0x333a('0xa3')];_0x1e02fb[_0x333a('0xa4')]=_[_0x333a('0xa5')](_0xa29d1[_0x333a('0x9c')],[_0x333a('0xa6')],[_0x333a('0xa7')]);if(_0x1e02fb[_0x333a('0xa1')]['Applications']){delete _0x1e02fb[_0x333a('0xa1')][_0x333a('0x9c')];}if(_0x1e02fb[_0x333a('0xa1')][_0x333a('0xa3')]&&_0x1e02fb['account'][_0x333a('0xa3')]['Contacts'][_0x333a('0x4d')]){return _0x1e02fb[_0x333a('0xa1')][_0x333a('0xa3')][_0x333a('0xa8')][0x0];}var _0x47967c=_[_0x333a('0xa9')](_0x3af25c['body'],{'firstName':_0x3af25c[_0x333a('0x5f')][_0x333a('0x8d')],'ListId':_0xa29d1['ListId']});_0x47967c[_0x3af25c['body'][_0x333a('0x8f')]]=_0x3af25c[_0x333a('0x5f')][_0x333a('0x8d')];return db['CmContact'][_0x333a('0x5e')](_0x47967c,{'fields':_0xbb5bdd,'raw':!![]});})[_0x333a('0x14')](function(_0x32cf10){_0x1e02fb[_0x333a('0xaa')]=_0x32cf10;var _0x269da8=createInteractionObject(_0x3af25c[_0x333a('0x5b')]['id'],_0x3af25c[_0x333a('0x5f')],_0x3af25c[_0x333a('0xab')],_0x32cf10);var _0x3ca139={'ChatWebsiteId':_0x3af25c[_0x333a('0x5b')]['id'],'closed':![]};if(_0x3af25c[_0x333a('0x5f')][_0x333a('0xac')]){_0x3ca139[_0x333a('0xac')]=_0x3af25c[_0x333a('0x5f')][_0x333a('0xac')];return db[_0x333a('0xad')][_0x333a('0x5c')]({'where':_0x3ca139})[_0x333a('0x14')](function(_0x14530d){if(_0x14530d){_0x81e4dc=!![];return _0x14530d;}_0x269da8[_0x333a('0xac')]=_0x3af25c['body'][_0x333a('0xac')];_0x269da8[_0x333a('0xae')]=_0x3af25c[_0x333a('0x5f')]['externalUrl'];return db[_0x333a('0xad')][_0x333a('0x5e')](_0x269da8);});}_0x3ca139[_0x333a('0xaf')]=_0x32cf10['id'];if(_0x3af25c['body'][_0x333a('0xb0')]&&_0x3af25c[_0x333a('0x5f')][_0x333a('0xb0')]['id']){_0x3ca139['id']=_0x3af25c[_0x333a('0x5f')][_0x333a('0xb0')]['id'];return db[_0x333a('0xad')][_0x333a('0x5c')]({'where':_0x3ca139})[_0x333a('0x14')](function(_0x2c0f99){if(_0x2c0f99){_0x81e4dc=!![];return _0x2c0f99;}return db[_0x333a('0xad')][_0x333a('0x5e')](_0x269da8);});}return db['ChatInteraction'][_0x333a('0x5e')](_0x269da8);})['then'](function(_0x2cf3a7){if(!_0x81e4dc){return _0x2cf3a7;}var _0x1b88e4={'from':(_0x1e02fb[_0x333a('0xaa')]['firstName']||'')+'\x20'+(_0x1e02fb[_0x333a('0xaa')][_0x333a('0x32')]||'')};if(_0x3af25c['body'][_0x333a('0xac')]&&_0x3af25c['body'][_0x333a('0xb1')]&&_0x3af25c['body'][_0x333a('0xac')]!=_0x3af25c[_0x333a('0x5f')][_0x333a('0xb1')]){_0x1b88e4['threadId']=_0x3af25c['body'][_0x333a('0xb1')];}return _0x2cf3a7['update'](_0x1b88e4);})[_0x333a('0x14')](function(_0x57e98e){_0x1e02fb['interaction']=_0x57e98e[_0x333a('0x27')]({'plain':!![]});_0x1e02fb[_0x333a('0xb0')][_0x333a('0xb2')]=!_0x81e4dc;if(_0x1e02fb[_0x333a('0xb0')][_0x333a('0xb2')]){if(_0x1e02fb[_0x333a('0xa1')]['autoclose']){_0x1e02fb['applications'][_0x333a('0xb3')]({'id':0x0,'priority':_0x1e02fb[_0x333a('0xa4')][_0x333a('0x4d')]+0x1,'app':_0x333a('0xb4'),'appdata':_0x333a('0xb5'),'interval':'*,*,*,*'});}}return db[_0x333a('0xb6')][_0x333a('0x5e')]({'body':_0x3af25c['body']['body'],'ChatWebsiteId':_0x3af25c[_0x333a('0x5b')]['id'],'ChatInteractionId':_0x57e98e['id'],'direction':'in','ContactId':_0x1e02fb[_0x333a('0xaa')]['id'],'AttachmentId':_0x3af25c['body']['AttachmentId']});})[_0x333a('0x14')](function(_0x317f84){_0x1e02fb[_0x333a('0x1a')]=_0x317f84;if(!_0x1e02fb[_0x333a('0xb0')]['UserId']){return;}return db['User'][_0x333a('0x5c')]({'attributes':['id',_0x333a('0x29')],'where':{'id':_0x1e02fb[_0x333a('0xb0')]['UserId']}});})['then'](function(_0x391df8){if(_0x391df8){_0x1e02fb['applications'][_0x333a('0xb7')]({'id':0x0,'priority':0x0,'app':_0x333a('0xb8'),'appdata':_0x391df8[_0x333a('0x29')]+','+(_0x1e02fb[_0x333a('0xa1')][_0x333a('0xb9')]||0xa),'interval':'*,*,*,*'});_0x1e02fb[_0x333a('0xba')]=!![];}if(!_0x1e02fb[_0x333a('0xb0')][_0x333a('0xbb')]){return;}return db[_0x333a('0xbc')]['find']({'attributes':['id','name'],'where':{'id':_0x1e02fb[_0x333a('0xb0')][_0x333a('0xbb')]}});})['then'](function(_0x34c630){if(_0x34c630){_0x1e02fb['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x333a('0xbd'),'appdata':_0x34c630[_0x333a('0x29')]+','+(_0x1e02fb['account'][_0x333a('0xbe')]||0x12c),'interval':_0x333a('0xbf')});}return respondWithRpcPromise(_0x333a('0xc0'),_0x333a('0xc1'),_0x1e02fb);})[_0x333a('0x14')](function(_0x5e6c7f){respondWithRpcPromise('EventManager',_0x333a('0xc2'),{'event':_0x333a('0x8c'),'message':_0x5e6c7f},client9002);return _0x5e6c7f;})['then'](respondWithResult(_0x5499c4,null))['catch'](APIHandleError(_0x5499c4));};exports[_0x333a('0xc3')]=function(_0x34dfbd,_0x3bc9b4){var _0x38f944,_0x9d86f,_0x58d2b9;var _0x304583=[];var _0x56b337={};var _0x41382f=_0x34dfbd['files']||[];var _0x2ecb56=[];var _0x50cdc6;return db[_0x333a('0x93')]['describe']()['then'](function(_0x276327){if(!_0x276327){throw new db[(_0x333a('0xc4'))][(_0x333a('0xc5'))](_0x333a('0xc6'));}_0x304583=_['difference'](_[_0x333a('0x48')](_0x276327),['createdAt',_0x333a('0x96'),_0x333a('0x97'),_0x333a('0x98')]);if(_0x34dfbd[_0x333a('0x5f')]['id']){delete _0x34dfbd[_0x333a('0x5f')]['id'];}if(_[_0x333a('0x88')](_0x34dfbd['body'][_0x333a('0x8d')])){throw _0x3bc9b4[_0x333a('0x1d')](0x1f4)['send'](new db[(_0x333a('0xc4'))][(_0x333a('0xc5'))](_0x333a('0xc7')));}if(_['isNil'](_0x34dfbd[_0x333a('0x5f')]['body'])||_0x34dfbd[_0x333a('0x5f')]['body']===''){throw _0x3bc9b4['status'](0x1f4)[_0x333a('0x2a')](new db[(_0x333a('0xc4'))][(_0x333a('0xc5'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x333a('0x88')](_0x34dfbd['body'][_0x333a('0xc8')])){throw _0x3bc9b4[_0x333a('0x1d')](0x1f4)[_0x333a('0x2a')](new db['Sequelize']['ValidationError'](_0x333a('0xc9')+_0x304583));}if(!_['includes'](_0x304583,_0x34dfbd[_0x333a('0x5f')]['mapKeyOffline'])){throw _0x3bc9b4[_0x333a('0x1d')](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0x333a('0xca')+_0x304583));}_0x56b337[_0x34dfbd['body']['mapKeyOffline']]=_0x34dfbd[_0x333a('0x5f')]['from'];})[_0x333a('0x14')](function(){return db['ChatWebsite'][_0x333a('0x5c')]({'where':{'id':_0x34dfbd[_0x333a('0x5b')]['id']},'include':[{'model':db[_0x333a('0x9a')],'as':'List'},{'model':db[_0x333a('0xcb')],'as':_0x333a('0xcb')}]});})[_0x333a('0x14')](handleEntityNotFound(_0x3bc9b4,null))[_0x333a('0x14')](function(_0x386b26){if(_0x386b26&&_0x386b26[_0x333a('0xa3')]){_0x9d86f=_0x386b26;var _0x53a484=_['defaults'](_0x34dfbd[_0x333a('0x5f')],{'firstName':_0x34dfbd['body'][_0x333a('0x8d')],'phone':_0x34dfbd[_0x333a('0x5f')]['from'],'ListId':_0x386b26[_0x333a('0x98')]});_0x53a484[_0x34dfbd[_0x333a('0x5f')][_0x333a('0xc8')]]=_0x34dfbd[_0x333a('0x5f')][_0x333a('0x8d')];return db[_0x333a('0x93')][_0x333a('0xcc')]({'where':_0x56b337,'defaults':_0x53a484});}})['spread'](function(_0xb4445c){if(_0xb4445c){_0x58d2b9=_0xb4445c;var _0x36807b=fs['readFileSync'](path['join'](config[_0x333a('0x7c')],_0x333a('0xcd')),_0x333a('0xce'));var _0x2948ee=ejs[_0x333a('0xcf')](_0x36807b,{'body':_['toPairs'](_0x34dfbd[_0x333a('0x5f')]['body']),'bodyTitle':_0x9d86f[_0x333a('0xd0')]});return db[_0x333a('0xd1')][_0x333a('0x5e')]({'body':_0x2948ee,'plainBody':htmlToText[_0x333a('0xd2')](_0x2948ee),'ContactId':_0xb4445c['id'],'ChatWebsiteId':_0x9d86f['id']});}})['then'](function(_0x2f97ee){_0x50cdc6=_0x2f97ee;if(_0x41382f['length']){var _0x37be4c=_0x41382f[_0x333a('0x42')](function(_0x49ddeb){return{'name':_0x49ddeb[_0x333a('0xd3')],'basename':_0x49ddeb[_0x333a('0x74')],'type':_0x49ddeb['mimetype'],'ChatOfflineMessageId':_0x2f97ee['id']};});_0x2ecb56=_0x37be4c[_0x333a('0x42')](_0x380268=>{var _0x2cc3cd={'filename':_0x380268[_0x333a('0x29')],'path':path[_0x333a('0x7b')](config[_0x333a('0x7c')],'server',_0x333a('0xd4'),_0x333a('0xd5'),_0x333a('0xd6'),_0x380268[_0x333a('0xd7')])};return _0x2cc3cd;});if(!_0x9d86f[_0x333a('0xd8')]){return db['sequelize'][_0x333a('0xd9')](function(_0x46eb52){return db[_0x333a('0xda')]['bulkCreate'](_0x37be4c,{'transaction':_0x46eb52});});}}})[_0x333a('0x14')](function(){if(_0x50cdc6){_0x38f944=_0x50cdc6;return db[_0x333a('0xcb')][_0x333a('0x70')]({'where':{'service':!![]},'include':[{'model':db[_0x333a('0xdb')],'as':_0x333a('0xdc'),'raw':!![],'include':[{'model':db[_0x333a('0xdd')],'as':_0x333a('0xdd'),'raw':!![]}]}]});}})[_0x333a('0x14')](function(_0x287903){if(_0x287903&&_0x287903[_0x333a('0xdc')]&&_0x9d86f[_0x333a('0xde')]&&_0x9d86f[_0x333a('0xdf')]){var _0x557fd6=_0x287903['getSmtpOptions']();return respondWithRpcPromise(_0x333a('0xe0'),_0x333a('0xe1'),{'account':_0x557fd6,'message':{'from':util[_0x333a('0x36')](_0x333a('0xe2'),_0x287903[_0x333a('0x29')],_0x287903[_0x333a('0xe3')]||_0x287903[_0x333a('0xdc')][_0x333a('0x60')]),'to':_0x9d86f[_0x333a('0xdf')],'subject':_0x9d86f['offlineMessageSubject'],'html':_0x38f944[_0x333a('0x5f')],'attachments':_0x2ecb56}},client9003)[_0x333a('0x14')](function(){return _0x38f944;})['catch'](function(_0x67afe){logger[_0x333a('0x18')](_0x67afe);});}})['then'](function(){if(_0x9d86f&&_0x9d86f[_0x333a('0xd8')]&&_0x9d86f['MailAccountId']){var _0x506d70=[];if(_0x41382f['length']){_0x506d70=_0x41382f[_0x333a('0x42')](function(_0x4303fd){return{'name':_0x4303fd[_0x333a('0xd3')],'basename':_0x4303fd[_0x333a('0x74')],'type':_0x4303fd['mimetype'],'ChatOfflineMessageId':_0x50cdc6['id']};});}var _0x2232d2;if(!_[_0x333a('0x88')](_0x9d86f['subjectOffline'])){var _0x1d5da9=_[_0x333a('0x42')](_0x34dfbd[_0x333a('0x5f')],function(_0x4a9701){return _0x4a9701;});var _0x21662a=_[_0x333a('0xe4')](_0x1d5da9)[0x0];var _0x385096=_[_0x333a('0xe5')](_0x21662a,function(_0x1f0ca1){return _0x1f0ca1;});_0x2232d2=_0x385096[0x1][_0x9d86f[_0x333a('0xe6')]];}var _0x50455d={'from':_0x58d2b9[_0x333a('0xe3')],'firstName':_0x58d2b9[_0x333a('0x31')],'lastName':_0x58d2b9[_0x333a('0x32')],'mapKey':_0x333a('0xe3'),'message':{'from':_0x58d2b9[_0x333a('0xe3')],'to':_0x9d86f[_0x333a('0xcb')][_0x333a('0xe3')],'cc':'','subject':_[_0x333a('0x88')](_0x2232d2)?_0x9d86f['offlineMessageSubject']:_0x2232d2,'messageId':'','sentAt':new Date(),'attach':_0x506d70['length'],'attachments':_0x506d70,'originChannel':_0x333a('0xe7'),'ChatWebsiteId':_0x9d86f['id'],'ChatOfflineMessageId':_0x38f944['id'],'originTo':_0x9d86f[_0x333a('0xcb')]['email']},'body':_0x38f944['body']};var _0x3b68bb={'account':{'id':_0x9d86f[_0x333a('0xe8')]},'body':_0x50455d,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x333a('0xe9'),_0x3b68bb,client9001)[_0x333a('0x14')](function(){return _0x38f944;})[_0x333a('0x5d')](function(_0x1bf257){logger[_0x333a('0x18')](_0x1bf257);});}return;})[_0x333a('0x14')](function(){if(_0x38f944){return _0x38f944;}})[_0x333a('0x14')](respondWithResult(_0x3bc9b4,null))[_0x333a('0x5d')](function(){for(var _0x21ca12 of _0x41382f){var _0xfe1dc4=path['join'](config[_0x333a('0x7c')],_0x333a('0xea'),_0x333a('0xd4'),_0x333a('0xd5'),_0x333a('0xd6'),_0x21ca12[_0x333a('0x74')]);fs_extra['remove'](_0xfe1dc4)[_0x333a('0x5d')](function(_0x4986b9){logger[_0x333a('0x18')](_0x333a('0xeb'),_0xfe1dc4,_0x4986b9);});}});};exports[_0x333a('0xec')]=function(_0x4580be,_0x3674ff){return db[_0x333a('0xad')][_0x333a('0x5c')]({'where':{'id':_0x4580be[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x3674ff,null))[_0x333a('0x14')](function(_0x25df08){if(_0x25df08){return _0x25df08[_0x333a('0xec')](_0x4580be[_0x333a('0x5f')][_0x333a('0x6d')],_['omit'](_0x4580be[_0x333a('0x5f')],[_0x333a('0x6d'),'id'])||{});}})[_0x333a('0x14')](respondWithResult(_0x3674ff,null))[_0x333a('0x5d')](handleError(_0x3674ff,null));};exports[_0x333a('0xed')]=function(_0x10bdc7,_0x41f466){var _0x63ea01={'raw':![],'where':{}};var _0x1a1141={};var _0x458bb1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x333a('0x70')]({'where':{'id':_0x10bdc7[_0x333a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x41f466,null))[_0x333a('0x14')](function(_0x3b37f6){if(_0x3b37f6){_0x1a1141[_0x333a('0x3a')]=_[_0x333a('0x48')](db[_0x333a('0xad')]['rawAttributes']);_0x1a1141[_0x333a('0x47')]=_[_0x333a('0x48')](_0x10bdc7[_0x333a('0x47')]);_0x1a1141[_0x333a('0x49')]=_[_0x333a('0x4a')](_0x1a1141[_0x333a('0x3a')],_0x1a1141[_0x333a('0x47')]);_0x63ea01[_0x333a('0x4b')]=_[_0x333a('0x4a')](_0x1a1141[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x10bdc7[_0x333a('0x47')][_0x333a('0x4c')]));_0x63ea01['attributes']=_0x63ea01[_0x333a('0x4b')][_0x333a('0x4d')]?_0x63ea01['attributes']:_0x1a1141[_0x333a('0x3a')];if(!_0x10bdc7['query'][_0x333a('0x71')](_0x333a('0x4e'))){_0x63ea01[_0x333a('0x23')]=qs['limit'](_0x10bdc7['query'][_0x333a('0x23')]);_0x63ea01[_0x333a('0x20')]=qs['offset'](_0x10bdc7['query'][_0x333a('0x20')]);}_0x63ea01[_0x333a('0x4f')]=qs[_0x333a('0x50')](_0x10bdc7[_0x333a('0x47')][_0x333a('0x50')]);_0x63ea01['where']=qs['filters'](_[_0x333a('0x6b')](_0x10bdc7[_0x333a('0x47')],_0x1a1141['filters']));_0x63ea01[_0x333a('0x51')]['ChatWebsiteId']=_0x3b37f6['id'];if(_0x10bdc7[_0x333a('0x47')][_0x333a('0x52')]){_0x63ea01[_0x333a('0x51')]=_[_0x333a('0x54')](_0x63ea01['where'],{'$or':_[_0x333a('0x42')](_0x63ea01['attributes'],function(_0x4d9d93){var _0x3ca27b={};_0x3ca27b[_0x4d9d93]={'$like':'%'+_0x10bdc7[_0x333a('0x47')]['filter']+'%'};return _0x3ca27b;})});}_0x63ea01=_[_0x333a('0x54')]({},_0x63ea01,_0x10bdc7[_0x333a('0x55')]);return db[_0x333a('0xad')][_0x333a('0x22')]({'where':_0x63ea01[_0x333a('0x51')]})[_0x333a('0x14')](function(_0x3bdee4){_0x458bb1['count']=_0x3bdee4;if(_0x10bdc7['query'][_0x333a('0x56')]){_0x63ea01[_0x333a('0x57')]=[{'model':db[_0x333a('0x93')],'as':_0x333a('0xee'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x333a('0x29'),_0x333a('0xef'),_0x333a('0xf0')],'required':![]},{'model':db['Tag'],'as':_0x333a('0xf1'),'attributes':['id',_0x333a('0x29'),'color'],'where':_0x10bdc7[_0x333a('0x47')][_0x333a('0xf2')]?{'id':_0x10bdc7[_0x333a('0x47')][_0x333a('0xf2')]}:undefined,'required':_0x10bdc7['query'][_0x333a('0xf2')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x63ea01);})[_0x333a('0x14')](function(_0x455ef7){_0x458bb1[_0x333a('0x59')]=_0x455ef7;return _0x458bb1;});}})[_0x333a('0x14')](respondWithFilteredResult(_0x41f466,_0x63ea01))[_0x333a('0x5d')](handleError(_0x41f466,null));};exports['getSnippet']=function(_0x394551,_0x48115e){var _0x3b8619=0x0;var _0x483417=0x0;var _0x13b674=![];var _0x3a0dd3;var _0x53b7ba;return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x394551[_0x333a('0x5b')]['id']},'include':[{'model':db['Interval'],'as':_0x333a('0x9d'),'include':[{'model':db[_0x333a('0x9d')],'as':_0x333a('0xf3'),'attributes':['id',_0x333a('0x9e')]}]}]})[_0x333a('0x14')](handleEntityNotFound(_0x48115e,null))[_0x333a('0x14')](function(_0x1f09cb){if(_0x1f09cb){_0x3a0dd3=_0x1f09cb;return _0x1f09cb[_0x333a('0xf4')]({'raw':!![]});}})[_0x333a('0x14')](function(_0x5f0d20){if(_0x3a0dd3){if(_0x5f0d20){_0x53b7ba=_0x5f0d20;}}return require('../../config/license/util')['getLicense']();})[_0x333a('0x14')](function(_0x54ed72){if(_0x54ed72){_0x483417=_0x54ed72[_0x333a('0xf5')];_0x13b674=_0x54ed72[_0x333a('0x80')];}})['then'](function(){return db[_0x333a('0xad')][_0x333a('0x22')]({'where':{'closed':![]}});})[_0x333a('0x14')](function(_0x32c860){_0x3b8619=_0x32c860;if(_0x483417&&_0x32c860>_0x483417){return db[_0x333a('0xf6')]['findOne']({'where':{'id':0x1}})[_0x333a('0x14')](function(_0x596252){if(_0x596252){_0x596252[_0x333a('0xf7')](_0x333a('0xf8'));}});}})['then'](function(){var _0xfb3919=_0x3a0dd3[_0x333a('0x9d')];var _0x4330ba=_0x3a0dd3[_0x333a('0xf9')]||undefined;return _0xfb3919?_0xfb3919['ifTime'](_0x4330ba):!![];})[_0x333a('0x14')](function(_0x5e2895){var _0x17d798=fs[_0x333a('0xfa')](path[_0x333a('0x7b')](config[_0x333a('0x7c')],_0x333a('0xfb')),_0x333a('0xce'));var _0x250591=new url['URL'](_0x3a0dd3['address'])['origin'];var _0x13dd42=_0x333a('0xfc');var _0x3a2148=![];var _0x470d5b={'chatVersion':_0x13dd42,'chatWebsiteAddressOrigin':_0x250591,'remote':_0x3a0dd3['remote'],'query':querystring[_0x333a('0x3f')](_[_0x333a('0x54')](_0x3a0dd3[_0x333a('0x27')]({'plain':!![]}),{'customerIp':_0x394551[_0x333a('0xab')][_0x333a('0x2e')]||_0x394551['headers'][_0x333a('0xfd')]||_0x394551[_0x333a('0xfe')][_0x333a('0xff')]||_0x394551['ip'],'referer':_0x394551[_0x333a('0xab')][_0x333a('0x34')],'openedInteractions':_0x3b8619,'maxInteractions':_0x483417,'virtual':_0x13b674[_0x333a('0xf5')],'online':_0x5e2895,'custom':_0x13b674}))[_0x333a('0x100')](/'/g,'\x5c\x27')};_0x48115e['send'](ejs[_0x333a('0xcf')](Mustache['render'](_0x17d798,_0x470d5b),{'proactiveActions':_0x53b7ba,'alignment':_0x3a0dd3[_0x333a('0x101')],'verticalAlignment':_0x3a0dd3[_0x333a('0x102')],'div_color':_0x3a0dd3[_0x333a('0x103')],'labelText':_0x3a0dd3[_0x333a('0x104')],'text_color':_0x3a0dd3[_0x333a('0x105')],'text_button_color':_0x3a0dd3['textButtonColor'],'button_color':_0x3a0dd3[_0x333a('0x106')],'background_color':_0x3a0dd3['backgroundColor'],'hideWhenOffline':_0x3a0dd3['hideWhenOffline'],'intervalId':_0x3a0dd3['IntervalId'],'isDevelopment':_0x3a2148,'chatVersion':_0x13dd42}));})[_0x333a('0x5d')](handleError(_0x48115e,null));};exports[_0x333a('0x107')]=function(_0x1dc3c8,_0x733f10){var _0x57821e=_0x1dc3c8['params']['id'];var _0x436c20=_0x1dc3c8[_0x333a('0x5f')];var _0x4506f4=0xc8;var _0x4a7284=null;return db['sequelize'][_0x333a('0xd9')]({'isolationLevel':db['sequelize'][_0x333a('0x108')][_0x333a('0x109')][_0x333a('0x10a')]},function(_0x76f4f5){return db[_0x333a('0x43')]['findOne']({'where':{'id':_0x57821e},'transaction':_0x76f4f5})[_0x333a('0x14')](function(_0x5cb9a6){if(_0x5cb9a6){return db[_0x333a('0x9b')]['destroy']({'where':{'ChatWebsiteId':_0x57821e},'transaction':_0x76f4f5})[_0x333a('0x14')](function(){var _0x1571ad=_[_0x333a('0x42')](_0x436c20,function(_0x1f9efd){_0x1f9efd['ChatWebsiteId']=_0x57821e;return _0x1f9efd;});return db['ChatApplication'][_0x333a('0x10b')](_0x1571ad,{'transaction':_0x76f4f5});});}else{_0x4506f4=0x194;_0x4a7284=[];}});})['then'](function(){if(_0x4506f4!==0x194){return db[_0x333a('0x9b')][_0x333a('0x10c')]({'where':{'ChatWebsiteId':_0x57821e},'order':'priority'})['then'](function(_0x273009){_0x4a7284=_0x273009;});}})[_0x333a('0x5d')](function(_0x2700f0){_0x4506f4=0x1f4;logger['error'](_0x2700f0[_0x333a('0x28')]);if(_0x2700f0[_0x333a('0x29')]){delete _0x2700f0[_0x333a('0x29')];}_0x4a7284=_0x2700f0;})[_0x333a('0x10d')](function(){if(_0x4a7284===null){_0x733f10[_0x333a('0x1c')](_0x4506f4);}else{if(_0x4506f4===0x1f4){_0x733f10[_0x333a('0x1d')](_0x4506f4)[_0x333a('0x2a')](_0x4a7284);}else{_0x733f10[_0x333a('0x1d')](_0x4506f4)[_0x333a('0x1f')](_0x4a7284);}}});};exports[_0x333a('0x10e')]=function(_0x8816e3,_0x4597ed){var _0x5659d6={};var _0x572dfa={};var _0x237685;var _0x4d8312;return db[_0x333a('0x43')][_0x333a('0x70')]({'where':{'id':_0x8816e3[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x4597ed,null))[_0x333a('0x14')](function(_0x41842b){if(_0x41842b){_0x237685=_0x41842b;_0x572dfa[_0x333a('0x3a')]=_[_0x333a('0x48')](db['ChatApplication'][_0x333a('0x44')]);_0x572dfa[_0x333a('0x47')]=_['keys'](_0x8816e3['query']);_0x572dfa[_0x333a('0x49')]=_[_0x333a('0x4a')](_0x572dfa[_0x333a('0x3a')],_0x572dfa[_0x333a('0x47')]);_0x5659d6[_0x333a('0x4b')]=_['intersection'](_0x572dfa[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x8816e3[_0x333a('0x47')][_0x333a('0x4c')]));_0x5659d6[_0x333a('0x4b')]=_0x5659d6[_0x333a('0x4b')][_0x333a('0x4d')]?_0x5659d6[_0x333a('0x4b')]:_0x572dfa['model'];_0x5659d6['order']=qs[_0x333a('0x50')](_0x8816e3['query']['sort']);_0x5659d6[_0x333a('0x51')]=qs['filters'](_[_0x333a('0x6b')](_0x8816e3[_0x333a('0x47')],_0x572dfa['filters']));if(_0x8816e3[_0x333a('0x47')][_0x333a('0x52')]){_0x5659d6[_0x333a('0x51')]=_[_0x333a('0x54')](_0x5659d6['where'],{'$or':_['map'](_0x5659d6[_0x333a('0x4b')],function(_0x40d11a){var _0x128028={};_0x128028[_0x40d11a]={'$like':'%'+_0x8816e3[_0x333a('0x47')][_0x333a('0x52')]+'%'};return _0x128028;})});}_0x5659d6=_[_0x333a('0x54')]({},_0x5659d6,_0x8816e3['options']);return _0x237685['getApplications'](_0x5659d6);}})[_0x333a('0x14')](function(_0xb7696a){if(_0xb7696a){_0x4d8312=_0xb7696a[_0x333a('0x4d')];if(!_0x8816e3[_0x333a('0x47')][_0x333a('0x71')]('nolimit')){_0x5659d6[_0x333a('0x23')]=qs['limit'](_0x8816e3[_0x333a('0x47')][_0x333a('0x23')]);_0x5659d6[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x8816e3[_0x333a('0x47')][_0x333a('0x20')]);}return _0x237685[_0x333a('0x10e')](_0x5659d6);}})['then'](function(_0x17adc1){if(_0x17adc1){return _0x17adc1?{'count':_0x4d8312,'rows':_0x17adc1}:null;}})['then'](respondWithResult(_0x4597ed,null))[_0x333a('0x5d')](handleError(_0x4597ed,null));};exports[_0x333a('0x10f')]=function(_0x16f5c6,_0x3bb62c){return db[_0x333a('0x110')][_0x333a('0x5c')]({'where':{'id':_0x16f5c6[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x3bb62c,null))['then'](function(_0x1fe01e){if(_0x1fe01e){return _0x1fe01e[_0x333a('0x10f')](_0x16f5c6['body'][_0x333a('0x6d')],_['omit'](_0x16f5c6[_0x333a('0x5f')],[_0x333a('0x6d'),'id'])||{});}})[_0x333a('0x14')](respondWithResult(_0x3bb62c,null))[_0x333a('0x5d')](handleError(_0x3bb62c,null));};exports['getProactiveActions']=function(_0x2bf575,_0x564703){var _0x2c674d={};var _0x25f320={};var _0x3f3299;var _0x305410;return db[_0x333a('0x43')][_0x333a('0x70')]({'where':{'id':_0x2bf575[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x564703,null))[_0x333a('0x14')](function(_0x210d36){if(_0x210d36){_0x3f3299=_0x210d36;_0x25f320['model']=_[_0x333a('0x48')](db[_0x333a('0x111')][_0x333a('0x44')]);_0x25f320[_0x333a('0x47')]=_[_0x333a('0x48')](_0x2bf575['query']);_0x25f320[_0x333a('0x49')]=_[_0x333a('0x4a')](_0x25f320['model'],_0x25f320[_0x333a('0x47')]);_0x2c674d[_0x333a('0x4b')]=_[_0x333a('0x4a')](_0x25f320[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x2bf575[_0x333a('0x47')][_0x333a('0x4c')]));_0x2c674d['attributes']=_0x2c674d[_0x333a('0x4b')][_0x333a('0x4d')]?_0x2c674d[_0x333a('0x4b')]:_0x25f320[_0x333a('0x3a')];_0x2c674d[_0x333a('0x4f')]=qs['sort'](_0x2bf575[_0x333a('0x47')][_0x333a('0x50')]);_0x2c674d[_0x333a('0x51')]=qs['filters'](_[_0x333a('0x6b')](_0x2bf575['query'],_0x25f320[_0x333a('0x49')]));if(_0x2bf575[_0x333a('0x47')]['filter']){_0x2c674d[_0x333a('0x51')]=_[_0x333a('0x54')](_0x2c674d[_0x333a('0x51')],{'$or':_[_0x333a('0x42')](_0x2c674d['attributes'],function(_0x22fc96){var _0x4ed764={};_0x4ed764[_0x22fc96]={'$like':'%'+_0x2bf575[_0x333a('0x47')][_0x333a('0x52')]+'%'};return _0x4ed764;})});}_0x2c674d=_[_0x333a('0x54')]({},_0x2c674d,_0x2bf575[_0x333a('0x55')]);return _0x3f3299[_0x333a('0xf4')](_0x2c674d);}})[_0x333a('0x14')](function(_0x393198){if(_0x393198){_0x305410=_0x393198[_0x333a('0x4d')];if(!_0x2bf575[_0x333a('0x47')]['hasOwnProperty'](_0x333a('0x4e'))){_0x2c674d[_0x333a('0x23')]=qs[_0x333a('0x23')](_0x2bf575[_0x333a('0x47')][_0x333a('0x23')]);_0x2c674d[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x2bf575['query'][_0x333a('0x20')]);}return _0x3f3299[_0x333a('0xf4')](_0x2c674d);}})['then'](function(_0x4a3c0e){if(_0x4a3c0e){return _0x4a3c0e?{'count':_0x305410,'rows':_0x4a3c0e}:null;}})[_0x333a('0x14')](respondWithResult(_0x564703,null))['catch'](handleError(_0x564703,null));};exports[_0x333a('0x112')]=function(_0x5d9432,_0xbf7eb){var _0x1acda2=_0x5d9432[_0x333a('0x47')][_0x333a('0x113')]===_0x333a('0x114')?_0x333a('0x115'):'onlineForm';return db[_0x333a('0x43')]['find']({'attributes':['id',_0x1acda2],'where':{'id':_0x5d9432['params']['id']}})[_0x333a('0x14')](handleEntityNotFound(_0xbf7eb,null))[_0x333a('0x14')](function(_0x4096a4){if(_0x4096a4){var _0xb31812=_0x4096a4[_0x1acda2];var _0x1616a6=_0xb31812&&_0xb31812[_0x333a('0x116')]?_0xb31812['items']:[];_0xbf7eb['send']({'fromKey':_[_0x333a('0x88')](_0xb31812[_0x333a('0x117')])?undefined:_0xb31812['fromKey'],'count':_0x1616a6[_0x333a('0x4d')],'rows':_0x1616a6});}})[_0x333a('0x5d')](handleError(_0xbf7eb,null));};exports['getOfflineMessages']=function(_0x19863c,_0x1d4fce){var _0x3cff34={'raw':![],'where':{}};var _0x228ecf={};var _0xef76da={'count':0x0,'rows':[]};return db[_0x333a('0x43')][_0x333a('0x70')]({'where':{'id':_0x19863c[_0x333a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1d4fce,null))[_0x333a('0x14')](function(_0x143b33){if(_0x143b33){_0x228ecf[_0x333a('0x3a')]=_[_0x333a('0x48')](db[_0x333a('0xd1')]['rawAttributes']);_0x228ecf[_0x333a('0x47')]=_[_0x333a('0x48')](_0x19863c['query']);_0x228ecf['filters']=_[_0x333a('0x4a')](_0x228ecf[_0x333a('0x3a')],_0x228ecf['query']);_0x3cff34['attributes']=_[_0x333a('0x4a')](_0x228ecf[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x19863c[_0x333a('0x47')]['fields']));_0x3cff34['attributes']=_0x3cff34[_0x333a('0x4b')]['length']?_0x3cff34[_0x333a('0x4b')]:_0x228ecf['model'];if(!_0x19863c[_0x333a('0x47')][_0x333a('0x71')](_0x333a('0x4e'))){_0x3cff34[_0x333a('0x23')]=qs['limit'](_0x19863c[_0x333a('0x47')][_0x333a('0x23')]);_0x3cff34[_0x333a('0x20')]=qs[_0x333a('0x20')](_0x19863c[_0x333a('0x47')][_0x333a('0x20')]);}_0x3cff34['order']=qs[_0x333a('0x50')](_0x19863c[_0x333a('0x47')][_0x333a('0x50')]);_0x3cff34['where']=qs[_0x333a('0x49')](_[_0x333a('0x6b')](_0x19863c['query'],_0x228ecf[_0x333a('0x49')]));_0x3cff34[_0x333a('0x51')][_0x333a('0x68')]=_0x143b33['id'];if(_0x19863c['query'][_0x333a('0x52')]){_0x3cff34[_0x333a('0x51')]=_['merge'](_0x3cff34[_0x333a('0x51')],{'$or':_['map'](_0x3cff34[_0x333a('0x4b')],function(_0x4926ee){var _0x436f0e={};_0x436f0e[_0x4926ee]={'$like':'%'+_0x19863c[_0x333a('0x47')][_0x333a('0x52')]+'%'};return _0x436f0e;})});}_0x3cff34=_[_0x333a('0x54')]({},_0x3cff34,_0x19863c[_0x333a('0x55')]);return db[_0x333a('0xd1')][_0x333a('0x22')]({'where':_0x3cff34[_0x333a('0x51')]})[_0x333a('0x14')](function(_0x207773){_0xef76da[_0x333a('0x22')]=_0x207773;if(_0x19863c[_0x333a('0x47')][_0x333a('0x56')]){_0x3cff34[_0x333a('0x57')]=[{'all':!![]}];}else{_0x3cff34[_0x333a('0x57')]=[{'model':db[_0x333a('0x93')],'as':'Contact','required':![]},{'model':db[_0x333a('0xda')],'as':_0x333a('0x118'),'required':![]}];}return db[_0x333a('0xd1')]['findAll'](_0x3cff34);})[_0x333a('0x14')](function(_0x474272){_0xef76da[_0x333a('0x59')]=_0x474272;return _0xef76da;});}})['then'](respondWithFilteredResult(_0x1d4fce,_0x3cff34))[_0x333a('0x5d')](handleError(_0x1d4fce,null));};exports['addAgents']=function(_0x40b1fe,_0x1f89de){return db['ChatWebsite'][_0x333a('0x5c')]({'where':{'id':_0x40b1fe[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0x1f89de,null))['then'](function(_0x59d2b7){if(_0x59d2b7){return _0x59d2b7[_0x333a('0x119')](_0x40b1fe[_0x333a('0x5f')][_0x333a('0x6d')],_['omit'](_0x40b1fe[_0x333a('0x5f')],['ids','id'])||{})[_0x333a('0x11a')](function(_0x114eb2){for(var _0x161dc3=0x0;_0x161dc3<_0x40b1fe['body'][_0x333a('0x6d')][_0x333a('0x4d')];_0x161dc3+=0x1){socket[_0x333a('0x11b')](_0x333a('0x11c'),{'UserId':Number(_0x40b1fe['body'][_0x333a('0x6d')][_0x161dc3]),'ChatWebsiteId':Number(_0x40b1fe[_0x333a('0x5b')]['id'])});}return _0x114eb2;});}})[_0x333a('0x14')](respondWithResult(_0x1f89de,null))[_0x333a('0x5d')](handleError(_0x1f89de,null));};exports[_0x333a('0x11d')]=function(_0x1f5959,_0x34f67b){return db[_0x333a('0x43')][_0x333a('0x5c')]({'where':{'id':_0x1f5959[_0x333a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x34f67b,null))['then'](function(_0x1c4de5){if(_0x1c4de5){return _0x1c4de5[_0x333a('0x11d')](_0x1f5959['query'][_0x333a('0x6d')])[_0x333a('0x14')](function(){if(_[_0x333a('0x11e')](_0x1f5959[_0x333a('0x47')][_0x333a('0x6d')])){for(var _0x123874=0x0;_0x123874<_0x1f5959['query'][_0x333a('0x6d')][_0x333a('0x4d')];_0x123874+=0x1){socket[_0x333a('0x11b')](_0x333a('0x11f'),{'UserId':Number(_0x1f5959[_0x333a('0x47')]['ids'][_0x123874]),'ChatWebsiteId':Number(_0x1f5959[_0x333a('0x5b')]['id'])});}}else{socket[_0x333a('0x11b')](_0x333a('0x11f'),{'UserId':Number(_0x1f5959['query'][_0x333a('0x6d')]),'ChatWebsiteId':Number(_0x1f5959['params']['id'])});}});}})[_0x333a('0x14')](respondWithStatusCode(_0x34f67b,null))[_0x333a('0x5d')](handleError(_0x34f67b,null));};exports[_0x333a('0x120')]=function(_0x55110b,_0xe5b0d6){var _0x507bb5={};var _0x3a0651={};var _0x3520e0;var _0x62bccc;return db['ChatWebsite']['findOne']({'where':{'id':_0x55110b[_0x333a('0x5b')]['id']}})[_0x333a('0x14')](handleEntityNotFound(_0xe5b0d6,null))['then'](function(_0x1ae95d){if(_0x1ae95d){_0x3520e0=_0x1ae95d;_0x3a0651['model']=_[_0x333a('0x48')](db[_0x333a('0x121')][_0x333a('0x44')]);_0x3a0651[_0x333a('0x47')]=_[_0x333a('0x48')](_0x55110b[_0x333a('0x47')]);_0x3a0651[_0x333a('0x49')]=_['intersection'](_0x3a0651[_0x333a('0x3a')],_0x3a0651[_0x333a('0x47')]);_0x507bb5['attributes']=_[_0x333a('0x4a')](_0x3a0651[_0x333a('0x3a')],qs[_0x333a('0x4c')](_0x55110b[_0x333a('0x47')][_0x333a('0x4c')]));_0x507bb5['attributes']=_0x507bb5['attributes'][_0x333a('0x4d')]?_0x507bb5[_0x333a('0x4b')]:_0x3a0651[_0x333a('0x3a')];_0x507bb5[_0x333a('0x4f')]=qs['sort'](_0x55110b[_0x333a('0x47')][_0x333a('0x50')]);_0x507bb5[_0x333a('0x51')]=qs[_0x333a('0x49')](_['pick'](_0x55110b[_0x333a('0x47')],_0x3a0651[_0x333a('0x49')]));if(_0x55110b[_0x333a('0x47')][_0x333a('0x52')]){_0x507bb5[_0x333a('0x51')]=_[_0x333a('0x54')](_0x507bb5[_0x333a('0x51')],{'$or':_[_0x333a('0x42')](_0x507bb5[_0x333a('0x4b')],function(_0x55ae75){var _0x4a4216={};_0x4a4216[_0x55ae75]={'$like':'%'+_0x55110b['query'][_0x333a('0x52')]+'%'};return _0x4a4216;})});}_0x507bb5=_['merge']({},_0x507bb5,_0x55110b['options']);return _0x3520e0[_0x333a('0x120')](_0x507bb5);}})[_0x333a('0x14')](function(_0x21a6d6){if(_0x21a6d6){_0x62bccc=_0x21a6d6[_0x333a('0x4d')];if(!_0x55110b[_0x333a('0x47')][_0x333a('0x71')](_0x333a('0x4e'))){_0x507bb5[_0x333a('0x23')]=qs[_0x333a('0x23')](_0x55110b[_0x333a('0x47')][_0x333a('0x23')]);_0x507bb5[_0x333a('0x20')]=qs['offset'](_0x55110b[_0x333a('0x47')][_0x333a('0x20')]);}return _0x3520e0[_0x333a('0x120')](_0x507bb5);}})[_0x333a('0x14')](function(_0xe0e4a1){if(_0xe0e4a1){return _0xe0e4a1?{'count':_0x62bccc,'rows':_0xe0e4a1}:null;}})[_0x333a('0x14')](respondWithResult(_0xe5b0d6,null))[_0x333a('0x5d')](handleError(_0xe5b0d6,null));}; \ No newline at end of file +var _0x8b56=['includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','list','applications','orderBy','priority','asc','account','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','startRouting','EventManager','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','transaction','bulkCreate','Smtp','CloudProvider','forwardOfflineAddress','SendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','../../config/license/util','License','chatLicenseExceeded','server/files/chat/iframe.ejs','address','origin','remote','x-real-ip','connection','remoteAddress','virtual','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','update','then','destroy','get','ChatWebsites','UserProfileResource','end','send','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','all','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','referer','browser','name','version','unknown','%s\x20%s','model','device','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x3cfba9,_0x3b6d72){var _0x389a0d=function(_0x235cf0){while(--_0x235cf0){_0x3cfba9['push'](_0x3cfba9['shift']());}};_0x389a0d(++_0x3b6d72);}(_0x8b56,0x1ed));var _0x68b5=function(_0x383c27,_0x490498){_0x383c27=_0x383c27-0x0;var _0x519064=_0x8b56[_0x383c27];return _0x519064;};'use strict';var Mustache=require(_0x68b5('0x0'));var util=require('util');var path=require(_0x68b5('0x1'));var ejs=require(_0x68b5('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68b5('0x3'));var querystring=require('querystring');var htmlToText=require(_0x68b5('0x4'));var Redis=require(_0x68b5('0x5'));var jayson=require(_0x68b5('0x6'));var url=require('url');var qs=require(_0x68b5('0x7'));var logger=require(_0x68b5('0x8'))(_0x68b5('0x9'));var config=require(_0x68b5('0xa'));var APIOutOfIntervalError=require(_0x68b5('0xb'))[_0x68b5('0xc')];var APINotFoundError=require('../../errors/api')[_0x68b5('0xd')];var APIHandleError=require('../../errors/api')[_0x68b5('0xe')];var db=require(_0x68b5('0xf'))['db'];config['redis']=_[_0x68b5('0x10')](config['redis'],{'host':_0x68b5('0x11'),'port':0x18eb});var socket=require(_0x68b5('0x12'))(new Redis(config[_0x68b5('0x13')]));require(_0x68b5('0x14'))[_0x68b5('0x15')](socket);var client=jayson[_0x68b5('0x16')]['http']({'port':0x232c});var client9002=jayson[_0x68b5('0x16')][_0x68b5('0x17')]({'port':0x232a});var client9003=jayson[_0x68b5('0x16')][_0x68b5('0x17')]({'port':0x232b});var client9001=jayson[_0x68b5('0x16')][_0x68b5('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x1e3dfc,_0x33aa7e,_0x501d4b,_0x1b047a){return new Promise(function(_0x412c0d,_0x33d862){var _0x5c9d32=_0x1b047a||client;return _0x5c9d32[_0x68b5('0x18')](_0x1e3dfc,_0x501d4b)['then'](function(_0x52e20d){logger[_0x68b5('0x19')](_0x68b5('0x1a'),_0x33aa7e,_0x68b5('0x1b'));logger[_0x68b5('0x1c')](_0x68b5('0x1d'),_0x33aa7e,_0x68b5('0x1b'),JSON[_0x68b5('0x1e')](_0x52e20d));if(_0x52e20d[_0x68b5('0x1f')]){if(_0x52e20d[_0x68b5('0x1f')][_0x68b5('0x20')]===0x1f4){logger[_0x68b5('0x1f')](_0x68b5('0x1a'),_0x33aa7e,_0x52e20d[_0x68b5('0x1f')][_0x68b5('0x21')]);return _0x33d862(_0x52e20d[_0x68b5('0x1f')][_0x68b5('0x21')]);}logger[_0x68b5('0x1f')](_0x68b5('0x1a'),_0x33aa7e,_0x52e20d[_0x68b5('0x1f')][_0x68b5('0x21')]);return _0x412c0d(_0x52e20d[_0x68b5('0x1f')][_0x68b5('0x21')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x33aa7e,_0x68b5('0x1b'));_0x412c0d(_0x52e20d[_0x68b5('0x22')][_0x68b5('0x21')]);}})['catch'](function(_0x5d0bf6){logger[_0x68b5('0x1f')](_0x68b5('0x1a'),_0x33aa7e,_0x5d0bf6);_0x33d862(_0x5d0bf6);});});}function respondWithStatusCode(_0x4877fa,_0x345c09){_0x345c09=_0x345c09||0xcc;return function(_0x384f8c){if(_0x384f8c){return _0x4877fa[_0x68b5('0x23')](_0x345c09);}return _0x4877fa[_0x68b5('0x24')](_0x345c09)['end']();};}function respondWithResult(_0x3b57ad,_0x48b49f){_0x48b49f=_0x48b49f||0xc8;return function(_0x222603){if(_0x222603){return _0x3b57ad[_0x68b5('0x24')](_0x48b49f)[_0x68b5('0x25')](_0x222603);}};}function respondWithFilteredResult(_0x49d5d0,_0x3d9c05){return function(_0x475359){if(_0x475359){var _0x15c3ad=typeof _0x3d9c05['offset']==='undefined'&&typeof _0x3d9c05[_0x68b5('0x26')]===_0x68b5('0x27');var _0x5754e0=_0x475359['count'];var _0x5e6619=_0x15c3ad?0x0:_0x3d9c05[_0x68b5('0x28')];var _0x288402=_0x15c3ad?_0x475359[_0x68b5('0x29')]:_0x3d9c05[_0x68b5('0x28')]+_0x3d9c05[_0x68b5('0x26')];var _0x4d1e29;if(_0x288402>=_0x5754e0){_0x288402=_0x5754e0;_0x4d1e29=0xc8;}else{_0x4d1e29=0xce;}_0x49d5d0[_0x68b5('0x24')](_0x4d1e29);return _0x49d5d0[_0x68b5('0x2a')](_0x68b5('0x2b'),_0x5e6619+'-'+_0x288402+'/'+_0x5754e0)[_0x68b5('0x25')](_0x475359);}return null;};}function saveUpdates(_0x217fd5){return function(_0xe759e){if(_0xe759e){return _0xe759e[_0x68b5('0x2c')](_0x217fd5)[_0x68b5('0x2d')](function(_0x4675b1){return _0x4675b1;});}return null;};}function removeEntity(_0x195ad5){return function(_0x4fd084){if(_0x4fd084){return _0x4fd084[_0x68b5('0x2e')]()['then'](function(){var _0x3b3600=_0x4fd084[_0x68b5('0x2f')]({'plain':!![]});var _0xc0fd2c=_0x68b5('0x30');return db[_0x68b5('0x31')][_0x68b5('0x2e')]({'where':{'type':_0xc0fd2c,'resourceId':_0x3b3600['id']}})[_0x68b5('0x2d')](function(){return _0x4fd084;});})['then'](function(){_0x195ad5['status'](0xcc)[_0x68b5('0x32')]();});}};}function handleEntityNotFound(_0x3a3e18){return function(_0x31b0a1){if(!_0x31b0a1){_0x3a3e18[_0x68b5('0x23')](0x194);}return _0x31b0a1;};}function handleError(_0x455473,_0x5c45ca){_0x5c45ca=_0x5c45ca||0x1f4;return function(_0x5251a6){logger['error'](_0x5251a6['stack']);if(_0x5251a6['name']){delete _0x5251a6['name'];}_0x455473['status'](_0x5c45ca)[_0x68b5('0x33')](_0x5251a6);};}function iftimePromise(_0x862c54,_0x437c49){return respondWithRpcPromise('Command',_0x68b5('0x34'),{'command':_0x437c49[_0x68b5('0x35')]?util[_0x68b5('0x36')](_0x68b5('0x37'),_0x862c54[_0x68b5('0x38')],_0x437c49[_0x68b5('0x35')]):util[_0x68b5('0x36')](_0x68b5('0x39'),_0x862c54['interval'])},client9002)[_0x68b5('0x2d')](function(_0x48de4d){var _0x11701d=_0x48de4d&&_0x48de4d['indexOf'](_0x68b5('0x3a'))>=0x0?!![]:![];logger[_0x68b5('0x19')](_0x68b5('0x3b'),_0x437c49['id'],_0x862c54['id'],_0x862c54[_0x68b5('0x38')],_0x11701d?_0x68b5('0x3c'):_0x68b5('0x3d'),_0x437c49[_0x68b5('0x35')]?_0x437c49[_0x68b5('0x35')]:'No\x20timezone');return _0x11701d;})['catch'](function(_0x362be0){logger[_0x68b5('0x1f')](_0x68b5('0x3b'),_0x437c49['id'],_0x862c54['id'],_0x862c54[_0x68b5('0x38')],util[_0x68b5('0x3e')](_0x362be0,{'showHidden':![],'depth':null}),_0x437c49[_0x68b5('0x35')]?_0x437c49[_0x68b5('0x35')]:_0x68b5('0x3f'));return![];});}function checkWebsiteIntervals(_0x59599b){var _0x19a275=_['map'](_0x59599b[_0x68b5('0x40')]['Intervals'],function(_0x27b6bf){var _0x55a2f8=_0x27b6bf[_0x68b5('0x2f')]({'plain':!![]});return iftimePromise(_0x55a2f8,_0x59599b);});return Promise[_0x68b5('0x41')](_0x19a275)['then'](function(_0x4c08c4){return _[_0x68b5('0x42')](_0x4c08c4);});}function createInteractionObject(_0x760b4e,_0x18ee14,_0x1bdd87,_0x55912f){var _0xbdbd=require(_0x68b5('0x43'));var _0xbbd2e=new _0xbdbd();var _0x4eb821=_0xbbd2e['setUA'](_0x1bdd87[_0x68b5('0x44')])[_0x68b5('0x45')]();var _0x4edb3a=_0x18ee14[_0x68b5('0x46')];if(_0x1bdd87[_0x68b5('0x47')]){_0x4edb3a=_0x1bdd87[_0x68b5('0x47')];}else if(_0x1bdd87[_0x68b5('0x48')]){_0x4edb3a=_['first'](_0x1bdd87['x-forwarded-for'][_0x68b5('0x49')](','));}return{'ContactId':_0x55912f['id'],'ChatWebsiteId':_0x760b4e,'from':(_0x55912f['firstName']||'')+'\x20'+(_0x55912f[_0x68b5('0x4a')]||''),'customerIp':_0x4edb3a,'customerPort':_0x1bdd87[_0x68b5('0x4b')]?_0x1bdd87['x-real-port']:null,'referer':_0x18ee14[_0x68b5('0x4c')],'browserName':_0x4eb821[_0x68b5('0x4d')][_0x68b5('0x4e')]&&_0x4eb821['browser'][_0x68b5('0x4f')]?util[_0x68b5('0x36')]('%s\x20%s',_0x4eb821[_0x68b5('0x4d')][_0x68b5('0x4e')],_0x4eb821['browser'][_0x68b5('0x4f')]):_0x68b5('0x50'),'browserVersion':_0x4eb821['browser'][_0x68b5('0x4f')]||'unknown','osName':util['format'](_0x68b5('0x51'),_0x4eb821['os']['name'],_0x4eb821['os']['version']),'osVersion':_0x4eb821['os'][_0x68b5('0x4f')],'deviceModel':_0x4eb821['device'][_0x68b5('0x52')]&&_0x4eb821[_0x68b5('0x53')][_0x68b5('0x54')]?util[_0x68b5('0x36')]('%s\x20%s\x20%s',_0x4eb821[_0x68b5('0x53')]['model'],_0x4eb821['device'][_0x68b5('0x54')],_0x4eb821[_0x68b5('0x53')]['type']):null,'deviceVendor':_0x4eb821[_0x68b5('0x53')][_0x68b5('0x54')],'deviceType':_0x4eb821[_0x68b5('0x53')][_0x68b5('0x55')],'formData':JSON[_0x68b5('0x1e')](_0x18ee14)};}exports[_0x68b5('0x56')]=function(_0x10da20,_0x2bcabc){var _0x61df8a={'include':[{'model':db[_0x68b5('0x57')],'as':_0x68b5('0x58')}]},_0x129801={},_0x4a49d4={'count':0x0,'rows':[]};var _0x3b2543=_[_0x68b5('0x59')](db[_0x68b5('0x5a')][_0x68b5('0x5b')],function(_0x1f171b){return{'name':_0x1f171b[_0x68b5('0x5c')],'type':_0x1f171b[_0x68b5('0x55')][_0x68b5('0x5d')]};});_0x129801['model']=_[_0x68b5('0x59')](_0x3b2543,_0x68b5('0x4e'));_0x129801[_0x68b5('0x5e')]=_['keys'](_0x10da20['query']);_0x129801['filters']=_[_0x68b5('0x5f')](_0x129801[_0x68b5('0x52')],_0x129801[_0x68b5('0x5e')]);_0x61df8a[_0x68b5('0x60')]=_[_0x68b5('0x5f')](_0x129801['model'],qs[_0x68b5('0x61')](_0x10da20[_0x68b5('0x5e')][_0x68b5('0x61')]));_0x61df8a[_0x68b5('0x60')]=_0x61df8a[_0x68b5('0x60')][_0x68b5('0x62')]?_0x61df8a[_0x68b5('0x60')]:_0x129801[_0x68b5('0x52')];if(!_0x10da20[_0x68b5('0x5e')][_0x68b5('0x63')](_0x68b5('0x64'))){_0x61df8a[_0x68b5('0x26')]=qs[_0x68b5('0x26')](_0x10da20[_0x68b5('0x5e')]['limit']);_0x61df8a['offset']=qs['offset'](_0x10da20['query'][_0x68b5('0x28')]);}_0x61df8a[_0x68b5('0x65')]=qs[_0x68b5('0x66')](_0x10da20[_0x68b5('0x5e')][_0x68b5('0x66')]);_0x61df8a[_0x68b5('0x67')]=qs['filters'](_['pick'](_0x10da20[_0x68b5('0x5e')],_0x129801[_0x68b5('0x68')]),_0x3b2543);if(_0x10da20[_0x68b5('0x5e')][_0x68b5('0x69')]){_0x61df8a['where']=_[_0x68b5('0x6a')](_0x61df8a[_0x68b5('0x67')],{'$or':_[_0x68b5('0x59')](_0x3b2543,function(_0x8111d5){if(_0x8111d5['type']!==_0x68b5('0x6b')){var _0x50aa29={};_0x50aa29[_0x8111d5['name']]={'$like':'%'+_0x10da20['query'][_0x68b5('0x69')]+'%'};return _0x50aa29;}})});}_0x61df8a=_[_0x68b5('0x6a')]({},_0x61df8a,_0x10da20[_0x68b5('0x6c')]);var _0x280d9={'where':_0x61df8a[_0x68b5('0x67')]};return db[_0x68b5('0x5a')][_0x68b5('0x29')](_0x280d9)[_0x68b5('0x2d')](function(_0x4a9d17){_0x4a49d4[_0x68b5('0x29')]=_0x4a9d17;if(_0x10da20[_0x68b5('0x5e')][_0x68b5('0x6d')]){_0x61df8a[_0x68b5('0x6e')]=[{'all':!![]}];}return db[_0x68b5('0x5a')][_0x68b5('0x6f')](_0x61df8a);})['then'](function(_0x2e0c97){_0x4a49d4[_0x68b5('0x70')]=_0x2e0c97;return _0x4a49d4;})[_0x68b5('0x2d')](respondWithFilteredResult(_0x2bcabc,_0x61df8a))[_0x68b5('0x71')](handleError(_0x2bcabc,null));};exports[_0x68b5('0x72')]=function(_0x3e9581,_0x2f2bcc){var _0x314f5e={'raw':![],'where':{'id':_0x3e9581[_0x68b5('0x73')]['id']},'include':[{'model':db['Pause'],'as':_0x68b5('0x58')}]},_0x239892={};_0x239892[_0x68b5('0x52')]=_[_0x68b5('0x74')](db[_0x68b5('0x5a')][_0x68b5('0x5b')]);_0x239892[_0x68b5('0x5e')]=_[_0x68b5('0x74')](_0x3e9581[_0x68b5('0x5e')]);_0x239892['filters']=_[_0x68b5('0x5f')](_0x239892[_0x68b5('0x52')],_0x239892[_0x68b5('0x5e')]);_0x314f5e[_0x68b5('0x60')]=_[_0x68b5('0x5f')](_0x239892[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x3e9581[_0x68b5('0x5e')][_0x68b5('0x61')]));_0x314f5e['attributes']=_0x314f5e[_0x68b5('0x60')]['length']?_0x314f5e['attributes']:_0x239892[_0x68b5('0x52')];if(_0x3e9581[_0x68b5('0x5e')][_0x68b5('0x6d')]){_0x314f5e[_0x68b5('0x6e')]=[{'all':!![]}];}_0x314f5e=_[_0x68b5('0x6a')]({},_0x314f5e,_0x3e9581['options']);return db['ChatWebsite'][_0x68b5('0x75')](_0x314f5e)['then'](handleEntityNotFound(_0x2f2bcc,null))[_0x68b5('0x2d')](respondWithResult(_0x2f2bcc,null))[_0x68b5('0x71')](handleError(_0x2f2bcc,null));};exports[_0x68b5('0x76')]=function(_0x12c860,_0x5d0a37){return db['ChatWebsite'][_0x68b5('0x76')](_0x12c860[_0x68b5('0x77')],{})[_0x68b5('0x2d')](function(_0x465820){var _0x1096de=_0x12c860[_0x68b5('0x78')][_0x68b5('0x2f')]({'plain':!![]});if(!_0x1096de)throw new Error(_0x68b5('0x79'));if(_0x1096de['role']===_0x68b5('0x78')){var _0xfcc8b8=_0x465820[_0x68b5('0x2f')]({'plain':!![]});var _0x5c6bad=_0x68b5('0x30');return db[_0x68b5('0x7a')][_0x68b5('0x75')]({'where':{'name':_0x5c6bad,'userProfileId':_0x1096de['userProfileId']},'raw':!![]})[_0x68b5('0x2d')](function(_0x61ca90){if(_0x61ca90&&_0x61ca90[_0x68b5('0x7b')]===0x0){return db['UserProfileResource'][_0x68b5('0x76')]({'name':_0xfcc8b8[_0x68b5('0x4e')],'resourceId':_0xfcc8b8['id'],'type':_0x61ca90[_0x68b5('0x4e')],'sectionId':_0x61ca90['id']},{})['then'](function(){return _0x465820;});}else{return _0x465820;}})[_0x68b5('0x71')](function(_0x135bed){logger[_0x68b5('0x1f')](_0x68b5('0x7c'),_0x135bed);throw _0x135bed;});}return _0x465820;})[_0x68b5('0x2d')](respondWithResult(_0x5d0a37,0xc9))[_0x68b5('0x71')](handleError(_0x5d0a37,null));};exports[_0x68b5('0x2c')]=function(_0x3e4cbf,_0x3d5439){if(_0x3e4cbf[_0x68b5('0x77')]['id']){delete _0x3e4cbf[_0x68b5('0x77')]['id'];}return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x3e4cbf[_0x68b5('0x73')]['id']},'include':[{'model':db[_0x68b5('0x57')],'as':_0x68b5('0x58')}]})['then'](handleEntityNotFound(_0x3d5439,null))[_0x68b5('0x2d')](saveUpdates(_0x3e4cbf['body'],null))[_0x68b5('0x2d')](respondWithResult(_0x3d5439,null))[_0x68b5('0x71')](handleError(_0x3d5439,null));};exports[_0x68b5('0x2e')]=function(_0x26b629,_0x4d6a67){return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x26b629[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x4d6a67,null))[_0x68b5('0x2d')](removeEntity(_0x4d6a67,null))[_0x68b5('0x71')](handleError(_0x4d6a67,null));};exports['describe']=function(_0x5061c8,_0x5d2129){return db['ChatWebsite'][_0x68b5('0x7d')]()['then'](respondWithResult(_0x5d2129,null))[_0x68b5('0x71')](handleError(_0x5d2129,null));};exports[_0x68b5('0x7e')]=function(_0x7baf20,_0x27f1c2){if(_0x7baf20[_0x68b5('0x77')]['id']){delete _0x7baf20[_0x68b5('0x77')]['id'];}return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x7baf20[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x27f1c2,null))['then'](function(_0x5f25ea){if(_0x5f25ea){_0x7baf20['body'][_0x68b5('0x7f')]=_0x5f25ea['id'];return db['Disposition']['create'](_0x7baf20[_0x68b5('0x77')]);}})[_0x68b5('0x2d')](respondWithResult(_0x27f1c2,null))[_0x68b5('0x71')](handleError(_0x27f1c2,null));};exports[_0x68b5('0x80')]=function(_0x15bd80,_0x24f0c8){var _0x38f67e={'raw':![],'where':{}};var _0x3b5c32={};var _0x33c428={'count':0x0,'rows':[]};return db[_0x68b5('0x5a')][_0x68b5('0x81')]({'where':{'id':_0x15bd80[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x24f0c8,null))[_0x68b5('0x2d')](function(_0x2634f5){if(_0x2634f5){_0x3b5c32['model']=_['keys'](db[_0x68b5('0x82')][_0x68b5('0x5b')]);_0x3b5c32[_0x68b5('0x5e')]=_[_0x68b5('0x74')](_0x15bd80['query']);_0x3b5c32[_0x68b5('0x68')]=_[_0x68b5('0x5f')](_0x3b5c32[_0x68b5('0x52')],_0x3b5c32[_0x68b5('0x5e')]);_0x38f67e[_0x68b5('0x60')]=_[_0x68b5('0x5f')](_0x3b5c32['model'],qs['fields'](_0x15bd80[_0x68b5('0x5e')][_0x68b5('0x61')]));_0x38f67e[_0x68b5('0x60')]=_0x38f67e[_0x68b5('0x60')][_0x68b5('0x62')]?_0x38f67e[_0x68b5('0x60')]:_0x3b5c32[_0x68b5('0x52')];if(!_0x15bd80[_0x68b5('0x5e')]['hasOwnProperty'](_0x68b5('0x64'))){_0x38f67e[_0x68b5('0x26')]=qs['limit'](_0x15bd80['query'][_0x68b5('0x26')]);_0x38f67e[_0x68b5('0x28')]=qs['offset'](_0x15bd80[_0x68b5('0x5e')]['offset']);}_0x38f67e[_0x68b5('0x65')]=qs[_0x68b5('0x66')](_0x15bd80['query'][_0x68b5('0x66')]);_0x38f67e[_0x68b5('0x67')]=qs[_0x68b5('0x68')](_[_0x68b5('0x83')](_0x15bd80[_0x68b5('0x5e')],_0x3b5c32[_0x68b5('0x68')]));_0x38f67e[_0x68b5('0x67')][_0x68b5('0x7f')]=_0x2634f5['id'];if(_0x15bd80[_0x68b5('0x5e')][_0x68b5('0x69')]){_0x38f67e[_0x68b5('0x67')]=_[_0x68b5('0x6a')](_0x38f67e[_0x68b5('0x67')],{'$or':_[_0x68b5('0x59')](_0x38f67e[_0x68b5('0x60')],function(_0x172b98){var _0x22bf2c={};_0x22bf2c[_0x172b98]={'$like':'%'+_0x15bd80[_0x68b5('0x5e')]['filter']+'%'};return _0x22bf2c;})});}_0x38f67e=_['merge']({},_0x38f67e,_0x15bd80[_0x68b5('0x6c')]);return db['Disposition'][_0x68b5('0x29')]({'where':_0x38f67e[_0x68b5('0x67')]})[_0x68b5('0x2d')](function(_0x1d8c5f){_0x33c428[_0x68b5('0x29')]=_0x1d8c5f;if(_0x15bd80[_0x68b5('0x5e')][_0x68b5('0x6d')]){_0x38f67e[_0x68b5('0x6e')]=[{'all':!![]}];}return db[_0x68b5('0x82')][_0x68b5('0x6f')](_0x38f67e);})[_0x68b5('0x2d')](function(_0x2a81a3){_0x33c428[_0x68b5('0x70')]=_0x2a81a3;return _0x33c428;});}})[_0x68b5('0x2d')](respondWithFilteredResult(_0x24f0c8,_0x38f67e))['catch'](handleError(_0x24f0c8,null));};exports[_0x68b5('0x84')]=function(_0x208ccd,_0x5e2825){return db['ChatWebsite'][_0x68b5('0x75')]({'where':{'id':_0x208ccd[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x5e2825,null))[_0x68b5('0x2d')](function(_0x1f42db){if(_0x1f42db){return _0x1f42db[_0x68b5('0x84')](_0x208ccd[_0x68b5('0x5e')][_0x68b5('0x85')]);}})[_0x68b5('0x2d')](respondWithStatusCode(_0x5e2825,null))[_0x68b5('0x71')](handleError(_0x5e2825,null));};exports['addAnswer']=function(_0x4ca2f9,_0x2dc8d9){if(_0x4ca2f9['body']['id']){delete _0x4ca2f9[_0x68b5('0x77')]['id'];}return db[_0x68b5('0x5a')]['find']({'where':{'id':_0x4ca2f9['params']['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x2dc8d9,null))[_0x68b5('0x2d')](function(_0x4f00a6){if(_0x4f00a6){_0x4ca2f9[_0x68b5('0x77')][_0x68b5('0x7f')]=_0x4f00a6['id'];return db['CannedAnswer'][_0x68b5('0x76')](_0x4ca2f9[_0x68b5('0x77')]);}})[_0x68b5('0x2d')](respondWithResult(_0x2dc8d9,null))[_0x68b5('0x71')](handleError(_0x2dc8d9,null));};exports[_0x68b5('0x86')]=function(_0x402e78,_0x165197){var _0x3b913e={'raw':![],'where':{}};var _0x49bb87={};var _0x596c02={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x68b5('0x81')]({'where':{'id':_0x402e78[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x165197,null))[_0x68b5('0x2d')](function(_0x46cd11){if(_0x46cd11){_0x49bb87[_0x68b5('0x52')]=_['keys'](db[_0x68b5('0x87')][_0x68b5('0x5b')]);_0x49bb87['query']=_[_0x68b5('0x74')](_0x402e78[_0x68b5('0x5e')]);_0x49bb87['filters']=_[_0x68b5('0x5f')](_0x49bb87[_0x68b5('0x52')],_0x49bb87[_0x68b5('0x5e')]);_0x3b913e['attributes']=_['intersection'](_0x49bb87[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x402e78[_0x68b5('0x5e')][_0x68b5('0x61')]));_0x3b913e['attributes']=_0x3b913e['attributes'][_0x68b5('0x62')]?_0x3b913e[_0x68b5('0x60')]:_0x49bb87[_0x68b5('0x52')];if(!_0x402e78[_0x68b5('0x5e')]['hasOwnProperty'](_0x68b5('0x64'))){_0x3b913e['limit']=qs['limit'](_0x402e78[_0x68b5('0x5e')]['limit']);_0x3b913e['offset']=qs[_0x68b5('0x28')](_0x402e78[_0x68b5('0x5e')]['offset']);}_0x3b913e[_0x68b5('0x65')]=qs[_0x68b5('0x66')](_0x402e78[_0x68b5('0x5e')][_0x68b5('0x66')]);_0x3b913e['where']=qs[_0x68b5('0x68')](_[_0x68b5('0x83')](_0x402e78[_0x68b5('0x5e')],_0x49bb87[_0x68b5('0x68')]));_0x3b913e[_0x68b5('0x67')][_0x68b5('0x7f')]=_0x46cd11['id'];if(_0x402e78['query'][_0x68b5('0x69')]){_0x3b913e['where']=_['merge'](_0x3b913e[_0x68b5('0x67')],{'$or':_[_0x68b5('0x59')](_0x3b913e[_0x68b5('0x60')],function(_0xeb38ac){var _0x16b6ee={};_0x16b6ee[_0xeb38ac]={'$like':'%'+_0x402e78[_0x68b5('0x5e')][_0x68b5('0x69')]+'%'};return _0x16b6ee;})});}_0x3b913e=_[_0x68b5('0x6a')]({},_0x3b913e,_0x402e78[_0x68b5('0x6c')]);return db[_0x68b5('0x87')][_0x68b5('0x29')]({'where':_0x3b913e[_0x68b5('0x67')]})[_0x68b5('0x2d')](function(_0x2f7db4){_0x596c02['count']=_0x2f7db4;if(_0x402e78[_0x68b5('0x5e')][_0x68b5('0x6d')]){_0x3b913e['include']=[{'all':!![]}];}return db[_0x68b5('0x87')]['findAll'](_0x3b913e);})[_0x68b5('0x2d')](function(_0x31d943){_0x596c02['rows']=_0x31d943;return _0x596c02;});}})[_0x68b5('0x2d')](respondWithFilteredResult(_0x165197,_0x3b913e))[_0x68b5('0x71')](handleError(_0x165197,null));};exports[_0x68b5('0x88')]=function(_0x102bd0,_0x5276f7){return db['ChatWebsite']['find']({'where':{'id':_0x102bd0[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x5276f7,null))[_0x68b5('0x2d')](function(_0x30ea8a){if(_0x30ea8a){return _0x30ea8a[_0x68b5('0x88')](_0x102bd0[_0x68b5('0x5e')][_0x68b5('0x85')]);}})[_0x68b5('0x2d')](respondWithStatusCode(_0x5276f7,null))[_0x68b5('0x71')](handleError(_0x5276f7,null));};exports[_0x68b5('0x89')]=function(_0x18140d,_0x1d2412){_0x18140d[_0x68b5('0x77')][_0x68b5('0x8a')]=_0x18140d[_0x68b5('0x8b')][_0x68b5('0x8c')];return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x18140d[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x1d2412,null))[_0x68b5('0x2d')](saveUpdates(_0x18140d['body'],null))['then'](respondWithResult(_0x1d2412,null))[_0x68b5('0x71')](handleError(_0x1d2412,null));};exports[_0x68b5('0x8d')]=function(_0x145e84,_0x100f40){_0x145e84[_0x68b5('0x77')][_0x68b5('0x8e')]=_0x145e84[_0x68b5('0x8b')]['filename'];return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x145e84[_0x68b5('0x73')]['id']}})['then'](handleEntityNotFound(_0x100f40,null))[_0x68b5('0x2d')](saveUpdates(_0x145e84[_0x68b5('0x77')],null))[_0x68b5('0x2d')](respondWithResult(_0x100f40,null))['catch'](handleError(_0x100f40,null));};exports['addCustomerAvatar']=function(_0x53c357,_0x57bc0d){_0x53c357[_0x68b5('0x77')][_0x68b5('0x8f')]=_0x53c357['file']['filename'];return db['ChatWebsite'][_0x68b5('0x75')]({'where':{'id':_0x53c357[_0x68b5('0x73')]['id']}})['then'](handleEntityNotFound(_0x57bc0d,null))['then'](saveUpdates(_0x53c357['body'],null))['then'](respondWithResult(_0x57bc0d,null))['catch'](handleError(_0x57bc0d,null));};exports[_0x68b5('0x90')]=function(_0x7c6872,_0x442eb2){_0x7c6872[_0x68b5('0x77')][_0x68b5('0x91')]=_0x7c6872[_0x68b5('0x8b')]['filename'];return db[_0x68b5('0x5a')]['find']({'where':{'id':_0x7c6872[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x442eb2,null))[_0x68b5('0x2d')](saveUpdates(_0x7c6872[_0x68b5('0x77')],null))[_0x68b5('0x2d')](respondWithResult(_0x442eb2,null))[_0x68b5('0x71')](handleError(_0x442eb2,null));};exports[_0x68b5('0x92')]=function(_0x223c0f,_0x1fb32e){var _0x1618ea=path[_0x68b5('0x93')](config[_0x68b5('0x94')],_0x68b5('0x95'));var _0x583822={'where':{'id':_0x223c0f[_0x68b5('0x73')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4e9b19=![];return require('../../config/license/util')[_0x68b5('0x96')]()[_0x68b5('0x2d')](function(_0x5d5170){if(_0x5d5170){_0x4e9b19=_0x5d5170['custom'];}})[_0x68b5('0x2d')](function(){return db['ChatWebsite'][_0x68b5('0x75')](_0x583822);})['then'](handleEntityNotFound(_0x1fb32e,null))[_0x68b5('0x2d')](function(_0x2095d8){if(_0x2095d8){if(!_[_0x68b5('0x97')](_0x2095d8[_0x68b5('0x8a')])){if(fs[_0x68b5('0x98')](path[_0x68b5('0x93')](config[_0x68b5('0x94')],'server/files/images/logos/',_0x2095d8[_0x68b5('0x8a')]))&&_0x4e9b19){_0x1618ea=path[_0x68b5('0x93')](config['root'],_0x68b5('0x99'),_0x2095d8[_0x68b5('0x8a')]);}}return _0x1fb32e[_0x68b5('0x9a')](_0x1618ea);}})[_0x68b5('0x71')](handleError(_0x1fb32e,null));};exports['getAvatar']=function(_0x2e6bd4,_0x706c72){var _0x4fb031=path[_0x68b5('0x93')](config[_0x68b5('0x94')],'server/files/images/avatars/default_avatar.png');var _0x318fe1={'where':{'id':_0x2e6bd4[_0x68b5('0x73')]['id']},'attributes':['id',_0x68b5('0x8e')],'raw':!![]};return db[_0x68b5('0x5a')][_0x68b5('0x75')](_0x318fe1)[_0x68b5('0x2d')](handleEntityNotFound(_0x706c72,null))[_0x68b5('0x2d')](function(_0x2a7682){if(_0x2a7682){if(!_[_0x68b5('0x97')](_0x2a7682[_0x68b5('0x8e')])){if(fs[_0x68b5('0x98')](path[_0x68b5('0x93')](config[_0x68b5('0x94')],_0x68b5('0x9b'),_0x2a7682[_0x68b5('0x8e')]))){_0x4fb031=path[_0x68b5('0x93')](config[_0x68b5('0x94')],_0x68b5('0x9b'),_0x2a7682[_0x68b5('0x8e')]);}}return _0x706c72['download'](_0x4fb031);}})['catch'](handleError(_0x706c72,null));};exports[_0x68b5('0x9c')]=function(_0x329f84,_0x4d2f40){var _0x3b513b=path[_0x68b5('0x93')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x316041={'where':{'id':_0x329f84[_0x68b5('0x73')]['id']},'attributes':['id',_0x68b5('0x8f'),_0x68b5('0x9d')],'raw':!![]};return db[_0x68b5('0x5a')][_0x68b5('0x75')](_0x316041)[_0x68b5('0x2d')](handleEntityNotFound(_0x4d2f40,null))[_0x68b5('0x2d')](function(_0x42db4e){if(_0x42db4e){if(!_[_0x68b5('0x97')](_0x42db4e[_0x68b5('0x8f')])){if(fs['existsSync'](path[_0x68b5('0x93')](config['root'],_0x68b5('0x9b'),_0x42db4e['customerAvatar']))&&_0x42db4e[_0x68b5('0x9d')]){_0x3b513b=path[_0x68b5('0x93')](config['root'],_0x68b5('0x9b'),_0x42db4e[_0x68b5('0x8f')]);}}return _0x4d2f40['download'](_0x3b513b);}})[_0x68b5('0x71')](handleError(_0x4d2f40,null));};exports[_0x68b5('0x9e')]=function(_0xf89206,_0x2df3ec){var _0x450d11=path[_0x68b5('0x93')](config[_0x68b5('0x94')],_0x68b5('0x9f'));var _0x1e1ecc={'where':{'id':_0xf89206[_0x68b5('0x73')]['id']},'attributes':['id',_0x68b5('0x91')],'raw':!![]};return db[_0x68b5('0x5a')][_0x68b5('0x75')](_0x1e1ecc)[_0x68b5('0x2d')](handleEntityNotFound(_0x2df3ec,null))[_0x68b5('0x2d')](function(_0x33d9e1){if(_0x33d9e1){if(!_[_0x68b5('0x97')](_0x33d9e1[_0x68b5('0x91')])){if(fs['existsSync'](path[_0x68b5('0x93')](config[_0x68b5('0x94')],_0x68b5('0x9b'),_0x33d9e1[_0x68b5('0x91')]))){_0x450d11=path[_0x68b5('0x93')](config[_0x68b5('0x94')],_0x68b5('0x9b'),_0x33d9e1[_0x68b5('0x91')]);}}return _0x2df3ec['download'](_0x450d11);}})[_0x68b5('0x71')](handleError(_0x2df3ec,null));};exports[_0x68b5('0xa0')]=function(_0x1930ab,_0x3fed32){var _0x35a0e7={'body':_0x1930ab[_0x68b5('0x77')],'channel':_0x68b5('0xa1')};var _0x3b2e38=[];var _0x928c45=[];var _0x54bba9={};var _0x395e6d=![];return db[_0x68b5('0xa2')][_0x68b5('0x7d')]()['then'](function(_0x5bfde8){if(!_0x5bfde8){throw new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))]('no\x20available\x20attributes');}_0x3b2e38=_[_0x68b5('0xa5')](_['keys'](_0x5bfde8),['createdAt',_0x68b5('0xa6')]);_0x928c45=_['difference'](_[_0x68b5('0x74')](_0x5bfde8),[_0x68b5('0xa7'),_0x68b5('0xa6'),_0x68b5('0xa8'),_0x68b5('0xa9')]);if(_0x1930ab[_0x68b5('0x77')]['id']){delete _0x1930ab[_0x68b5('0x77')]['id'];}if(_['isNil'](_0x1930ab[_0x68b5('0x77')][_0x68b5('0xaa')])){throw new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))](_0x68b5('0xab'));}if(_['isNil'](_0x1930ab[_0x68b5('0x77')][_0x68b5('0x77')])||_0x1930ab['body'][_0x68b5('0x77')]===''){throw new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x68b5('0x97')](_0x1930ab[_0x68b5('0x77')][_0x68b5('0xac')])){throw new db[(_0x68b5('0xa3'))]['ValidationError'](_0x68b5('0xad')+_0x928c45);}if(!_[_0x68b5('0xae')](_0x928c45,_0x1930ab['body']['mapKey'])){throw new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x928c45);}_0x54bba9[_0x1930ab['body'][_0x68b5('0xac')]]=_0x1930ab['body']['from'];})['then'](function(){return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x1930ab[_0x68b5('0x73')]['id']},'include':[{'model':db[_0x68b5('0xaf')],'as':_0x68b5('0xb0'),'include':[{'model':db[_0x68b5('0xa2')],'as':_0x68b5('0xb1'),'where':_0x54bba9,'limit':0x1,'order':[[_0x68b5('0xa6'),'DESC']]}]},{'model':db[_0x68b5('0xb2')],'as':_0x68b5('0xb3')},{'model':db[_0x68b5('0x40')],'as':'Interval','include':[{'model':db[_0x68b5('0x40')],'as':_0x68b5('0xb4'),'attributes':['id',_0x68b5('0x38')],'raw':!![]}]}]});})[_0x68b5('0x2d')](function(_0x23124a){if(!_0x23124a)throw new APINotFoundError(util[_0x68b5('0x36')](_0x68b5('0xb5'),_0x1930ab[_0x68b5('0x73')]['id']));if(!_0x23124a['Interval']||!_0x23124a[_0x68b5('0x40')][_0x68b5('0xb4')])return[_0x23124a,!![]];return[_0x23124a,checkWebsiteIntervals(_0x23124a)];})['spread'](function(_0x3a83ba,_0x378dab){if(!_0x378dab)throw new APIOutOfIntervalError();if(!_0x3a83ba[_0x68b5('0xb0')])return;_0x35a0e7['account']=_0x3a83ba;_0x35a0e7[_0x68b5('0xb6')]=_0x3a83ba['List'];_0x35a0e7[_0x68b5('0xb7')]=_[_0x68b5('0xb8')](_0x3a83ba[_0x68b5('0xb3')],[_0x68b5('0xb9')],[_0x68b5('0xba')]);if(_0x35a0e7[_0x68b5('0xbb')][_0x68b5('0xb3')]){delete _0x35a0e7[_0x68b5('0xbb')]['Applications'];}if(_0x35a0e7[_0x68b5('0xbb')]['List']&&_0x35a0e7[_0x68b5('0xbb')][_0x68b5('0xb0')][_0x68b5('0xb1')]['length']){return _0x35a0e7['account'][_0x68b5('0xb0')][_0x68b5('0xb1')][0x0];}var _0x379d49=_[_0x68b5('0x10')](_0x1930ab[_0x68b5('0x77')],{'firstName':_0x1930ab[_0x68b5('0x77')]['from'],'ListId':_0x3a83ba[_0x68b5('0xa9')]});_0x379d49[_0x1930ab['body'][_0x68b5('0xac')]]=_0x1930ab['body'][_0x68b5('0xaa')];return db['CmContact'][_0x68b5('0x76')](_0x379d49,{'fields':_0x3b2e38,'raw':!![]});})[_0x68b5('0x2d')](function(_0x346c22){_0x35a0e7['contact']=_0x346c22;var _0x3187a3=createInteractionObject(_0x1930ab['params']['id'],_0x1930ab[_0x68b5('0x77')],_0x1930ab[_0x68b5('0xbc')],_0x346c22);var _0x1bf8bd={'ChatWebsiteId':_0x1930ab[_0x68b5('0x73')]['id'],'closed':![]};if(_0x1930ab[_0x68b5('0x77')][_0x68b5('0xbd')]){_0x1bf8bd[_0x68b5('0xbd')]=_0x1930ab['body'][_0x68b5('0xbd')];return db[_0x68b5('0xbe')]['find']({'where':_0x1bf8bd})[_0x68b5('0x2d')](function(_0x59ef7c){if(_0x59ef7c){_0x395e6d=!![];return _0x59ef7c;}_0x3187a3[_0x68b5('0xbd')]=_0x1930ab['body'][_0x68b5('0xbd')];_0x3187a3['externalUrl']=_0x1930ab[_0x68b5('0x77')][_0x68b5('0xbf')];return db[_0x68b5('0xbe')]['create'](_0x3187a3);});}_0x1bf8bd[_0x68b5('0xc0')]=_0x346c22['id'];if(_0x1930ab[_0x68b5('0x77')][_0x68b5('0xc1')]&&_0x1930ab[_0x68b5('0x77')]['interaction']['id']){_0x1bf8bd['id']=_0x1930ab['body'][_0x68b5('0xc1')]['id'];return db['ChatInteraction'][_0x68b5('0x75')]({'where':_0x1bf8bd})[_0x68b5('0x2d')](function(_0x3321f1){if(_0x3321f1){_0x395e6d=!![];return _0x3321f1;}return db[_0x68b5('0xbe')]['create'](_0x3187a3);});}return db[_0x68b5('0xbe')][_0x68b5('0x76')](_0x3187a3);})[_0x68b5('0x2d')](function(_0x1adb3c){if(!_0x395e6d)return _0x1adb3c;var _0x873997={'from':(_0x35a0e7[_0x68b5('0xc2')][_0x68b5('0xc3')]||'')+'\x20'+(_0x35a0e7[_0x68b5('0xc2')][_0x68b5('0x4a')]||'')};if(_0x1930ab['body']['threadId']&&_0x1930ab[_0x68b5('0x77')][_0x68b5('0xc4')]&&_0x1930ab[_0x68b5('0x77')][_0x68b5('0xbd')]!=_0x1930ab['body'][_0x68b5('0xc4')]){_0x873997[_0x68b5('0xbd')]=_0x1930ab[_0x68b5('0x77')][_0x68b5('0xc4')];}return _0x1adb3c[_0x68b5('0x2c')](_0x873997);})[_0x68b5('0x2d')](function(_0x42d1e8){_0x35a0e7[_0x68b5('0xc1')]=_0x42d1e8[_0x68b5('0x2f')]({'plain':!![]});_0x35a0e7['interaction']['created']=!_0x395e6d;if(_0x35a0e7[_0x68b5('0xc1')][_0x68b5('0xc5')]){if(_0x35a0e7[_0x68b5('0xbb')][_0x68b5('0xc6')]){_0x35a0e7[_0x68b5('0xb7')][_0x68b5('0xc7')]({'id':0x0,'priority':_0x35a0e7[_0x68b5('0xb7')][_0x68b5('0x62')]+0x1,'app':_0x68b5('0xc8'),'appdata':_0x68b5('0xc9'),'interval':_0x68b5('0xca')});}}return db[_0x68b5('0xcb')][_0x68b5('0x76')]({'body':_0x1930ab['body'][_0x68b5('0x77')],'ChatWebsiteId':_0x1930ab[_0x68b5('0x73')]['id'],'ChatInteractionId':_0x42d1e8['id'],'direction':'in','ContactId':_0x35a0e7['contact']['id'],'AttachmentId':_0x1930ab[_0x68b5('0x77')]['AttachmentId']});})[_0x68b5('0x2d')](function(_0x573d48){_0x35a0e7['message']=_0x573d48;if(!_0x35a0e7[_0x68b5('0xc1')][_0x68b5('0xcc')]){return;}return db[_0x68b5('0xcd')]['find']({'attributes':['id',_0x68b5('0x4e')],'where':{'id':_0x35a0e7[_0x68b5('0xc1')][_0x68b5('0xcc')]}});})['then'](function(_0x303c34){if(_0x303c34){_0x35a0e7[_0x68b5('0xb7')][_0x68b5('0xce')]({'id':0x0,'priority':0x0,'app':_0x68b5('0xcf'),'appdata':_0x303c34['name']+','+(_0x35a0e7[_0x68b5('0xbb')][_0x68b5('0xd0')]||0xa),'interval':'*,*,*,*'});_0x35a0e7[_0x68b5('0xd1')]=!![];}if(!_0x35a0e7['interaction'][_0x68b5('0xd2')]){return;}return db[_0x68b5('0xd3')][_0x68b5('0x75')]({'attributes':['id',_0x68b5('0x4e')],'where':{'id':_0x35a0e7['interaction'][_0x68b5('0xd2')]}});})[_0x68b5('0x2d')](function(_0x2fea6a){if(_0x2fea6a){_0x35a0e7[_0x68b5('0xb7')][_0x68b5('0xce')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2fea6a['name']+','+(_0x35a0e7[_0x68b5('0xbb')][_0x68b5('0xd4')]||0x12c),'interval':_0x68b5('0xca')});}return respondWithRpcPromise('Start',_0x68b5('0xd5'),_0x35a0e7);})[_0x68b5('0x2d')](function(_0x1167c8){respondWithRpcPromise(_0x68b5('0xd6'),'EventManager',{'event':_0x68b5('0xa0'),'message':_0x1167c8},client9002);return _0x1167c8;})['then'](respondWithResult(_0x3fed32,null))[_0x68b5('0x71')](APIHandleError(_0x3fed32));};exports['offline']=function(_0x49dab9,_0x3421dc){var _0x555bcb,_0x4cd9ee,_0xf0f70a;var _0x2ee5a7=[];var _0x16e400={};var _0x1aac19=_0x49dab9[_0x68b5('0xd7')]||[];var _0x3efedd=[];var _0x25e3cd;return db[_0x68b5('0xa2')][_0x68b5('0x7d')]()[_0x68b5('0x2d')](function(_0x2ea0a0){if(!_0x2ea0a0){throw new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))](_0x68b5('0xd8'));}_0x2ee5a7=_[_0x68b5('0xa5')](_['keys'](_0x2ea0a0),[_0x68b5('0xa7'),_0x68b5('0xa6'),_0x68b5('0xa8'),_0x68b5('0xa9')]);if(_0x49dab9[_0x68b5('0x77')]['id']){delete _0x49dab9[_0x68b5('0x77')]['id'];}if(_[_0x68b5('0x97')](_0x49dab9['body'][_0x68b5('0xaa')])){throw _0x3421dc['status'](0x1f4)[_0x68b5('0x33')](new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))](_0x68b5('0xab')));}if(_[_0x68b5('0x97')](_0x49dab9['body'][_0x68b5('0x77')])||_0x49dab9[_0x68b5('0x77')][_0x68b5('0x77')]===''){throw _0x3421dc[_0x68b5('0x24')](0x1f4)[_0x68b5('0x33')](new db['Sequelize'][(_0x68b5('0xa4'))](_0x68b5('0xd9')));}if(_[_0x68b5('0x97')](_0x49dab9['body'][_0x68b5('0xda')])){throw _0x3421dc[_0x68b5('0x24')](0x1f4)['send'](new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))](_0x68b5('0xdb')+_0x2ee5a7));}if(!_[_0x68b5('0xae')](_0x2ee5a7,_0x49dab9[_0x68b5('0x77')]['mapKeyOffline'])){throw _0x3421dc[_0x68b5('0x24')](0x1f4)[_0x68b5('0x33')](new db[(_0x68b5('0xa3'))][(_0x68b5('0xa4'))](_0x68b5('0xdc')+_0x2ee5a7));}_0x16e400[_0x49dab9['body'][_0x68b5('0xda')]]=_0x49dab9[_0x68b5('0x77')][_0x68b5('0xaa')];})['then'](function(){return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x49dab9[_0x68b5('0x73')]['id']},'include':[{'model':db[_0x68b5('0xaf')],'as':_0x68b5('0xb0')},{'model':db[_0x68b5('0xdd')],'as':_0x68b5('0xdd')}]});})[_0x68b5('0x2d')](handleEntityNotFound(_0x3421dc,null))['then'](function(_0x50cb86){if(_0x50cb86&&_0x50cb86[_0x68b5('0xb0')]){_0x4cd9ee=_0x50cb86;var _0x22f2cb=_[_0x68b5('0x10')](_0x49dab9[_0x68b5('0x77')],{'firstName':_0x49dab9[_0x68b5('0x77')][_0x68b5('0xaa')],'phone':_0x49dab9[_0x68b5('0x77')][_0x68b5('0xaa')],'ListId':_0x50cb86[_0x68b5('0xa9')]});_0x22f2cb[_0x49dab9['body'][_0x68b5('0xda')]]=_0x49dab9['body'][_0x68b5('0xaa')];return db[_0x68b5('0xa2')][_0x68b5('0xde')]({'where':_0x16e400,'defaults':_0x22f2cb});}})[_0x68b5('0xdf')](function(_0x7875b1){if(_0x7875b1){_0xf0f70a=_0x7875b1;var _0x1a9057=fs[_0x68b5('0xe0')](path[_0x68b5('0x93')](config[_0x68b5('0x94')],'server/files/templates/chatOfflineMessage.ejs'),_0x68b5('0xe1'));var _0x14e874=ejs[_0x68b5('0xe2')](_0x1a9057,{'body':_[_0x68b5('0xe3')](_0x49dab9['body']['body']),'bodyTitle':_0x4cd9ee['offlineMessageBody']});return db[_0x68b5('0xe4')][_0x68b5('0x76')]({'body':_0x14e874,'plainBody':htmlToText['fromString'](_0x14e874),'ContactId':_0x7875b1['id'],'ChatWebsiteId':_0x4cd9ee['id']});}})['then'](function(_0x2b2ee9){_0x25e3cd=_0x2b2ee9;if(_0x1aac19[_0x68b5('0x62')]){var _0x56b1d7=_0x1aac19[_0x68b5('0x59')](function(_0x545914){return{'name':_0x545914[_0x68b5('0xe5')],'basename':_0x545914[_0x68b5('0x8c')],'type':_0x545914[_0x68b5('0xe6')],'ChatOfflineMessageId':_0x2b2ee9['id']};});_0x3efedd=_0x56b1d7[_0x68b5('0x59')](_0x4bdc7e=>{var _0x22a583={'filename':_0x4bdc7e[_0x68b5('0x4e')],'path':path[_0x68b5('0x93')](config[_0x68b5('0x94')],'server',_0x68b5('0xd7'),_0x68b5('0xe7'),'offline-chat',_0x4bdc7e[_0x68b5('0xe8')])};return _0x22a583;});if(!_0x4cd9ee[_0x68b5('0xe9')]){return db[_0x68b5('0xea')][_0x68b5('0xeb')](function(_0x18345e){return db['Attachment'][_0x68b5('0xec')](_0x56b1d7,{'transaction':_0x18345e});});}}})[_0x68b5('0x2d')](function(){if(_0x25e3cd){_0x555bcb=_0x25e3cd;return db['MailAccount'][_0x68b5('0x81')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x68b5('0xed'),'raw':!![],'include':[{'model':db[_0x68b5('0xee')],'as':_0x68b5('0xee'),'raw':!![]}]}]});}})['then'](function(_0x2ff253){if(_0x2ff253&&_0x2ff253[_0x68b5('0xed')]&&_0x4cd9ee['forwardOffline']&&_0x4cd9ee[_0x68b5('0xef')]){var _0x5b3252=_0x2ff253['getSmtpOptions']();return respondWithRpcPromise(_0x68b5('0xf0'),'sendMail',{'account':_0x5b3252,'message':{'from':util[_0x68b5('0x36')]('\x22%s\x22\x20<%s>',_0x2ff253['name'],_0x2ff253[_0x68b5('0xf1')]||_0x2ff253[_0x68b5('0xed')]['user']),'to':_0x4cd9ee['forwardOfflineAddress'],'subject':_0x4cd9ee[_0x68b5('0xf2')],'html':_0x555bcb[_0x68b5('0x77')],'attachments':_0x3efedd}},client9003)[_0x68b5('0x2d')](function(){return _0x555bcb;})[_0x68b5('0x71')](function(_0x1e1a81){logger['error'](_0x1e1a81);});}})[_0x68b5('0x2d')](function(){if(_0x4cd9ee&&_0x4cd9ee[_0x68b5('0xe9')]&&_0x4cd9ee[_0x68b5('0xf3')]){var _0x90edf9=[];if(_0x1aac19['length']){_0x90edf9=_0x1aac19[_0x68b5('0x59')](function(_0x100efc){return{'name':_0x100efc[_0x68b5('0xe5')],'basename':_0x100efc[_0x68b5('0x8c')],'type':_0x100efc['mimetype'],'ChatOfflineMessageId':_0x25e3cd['id']};});}var _0x35d593;if(!_[_0x68b5('0x97')](_0x4cd9ee[_0x68b5('0xf4')])){var _0x332300=_[_0x68b5('0x59')](_0x49dab9[_0x68b5('0x77')],function(_0x4ae12b){return _0x4ae12b;});var _0x16dbef=_[_0x68b5('0xf5')](_0x332300)[0x0];var _0x44ac8d=_[_0x68b5('0xf6')](_0x16dbef,function(_0x4dbe3e){return _0x4dbe3e;});_0x35d593=_0x44ac8d[0x1][_0x4cd9ee['subjectOffline']];}var _0x359de0={'from':_0xf0f70a['email'],'firstName':_0xf0f70a['firstName'],'lastName':_0xf0f70a[_0x68b5('0x4a')],'mapKey':'email','message':{'from':_0xf0f70a[_0x68b5('0xf1')],'to':_0x4cd9ee[_0x68b5('0xdd')][_0x68b5('0xf1')],'cc':'','subject':_[_0x68b5('0x97')](_0x35d593)?_0x4cd9ee['offlineMessageSubject']:_0x35d593,'messageId':'','sentAt':new Date(),'attach':_0x90edf9['length'],'attachments':_0x90edf9,'originChannel':_0x68b5('0xf7'),'ChatWebsiteId':_0x4cd9ee['id'],'ChatOfflineMessageId':_0x555bcb['id'],'originTo':_0x4cd9ee[_0x68b5('0xdd')][_0x68b5('0xf1')]},'body':_0x555bcb[_0x68b5('0x77')]};var _0x185a0e={'account':{'id':_0x4cd9ee[_0x68b5('0xf3')]},'body':_0x359de0,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x68b5('0xf8'),_0x68b5('0xf9'),_0x185a0e,client9001)[_0x68b5('0x2d')](function(){return _0x555bcb;})[_0x68b5('0x71')](function(_0x3a3ac9){logger[_0x68b5('0x1f')](_0x3a3ac9);});}return;})[_0x68b5('0x2d')](function(){if(_0x555bcb){return _0x555bcb;}})[_0x68b5('0x2d')](respondWithResult(_0x3421dc,null))['catch'](function(){for(var _0x2b0a00 of _0x1aac19){var _0x4a2305=path[_0x68b5('0x93')](config['root'],_0x68b5('0xfa'),_0x68b5('0xd7'),'attachments','offline-chat',_0x2b0a00[_0x68b5('0x8c')]);fs_extra['remove'](_0x4a2305)[_0x68b5('0x71')](function(_0x2adc32){logger['error'](_0x68b5('0xfb'),_0x4a2305,_0x2adc32);});}});};exports[_0x68b5('0xfc')]=function(_0x436634,_0x1c6e9c){return db[_0x68b5('0xbe')][_0x68b5('0x75')]({'where':{'id':_0x436634[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x1c6e9c,null))[_0x68b5('0x2d')](function(_0xb829d1){if(_0xb829d1){return _0xb829d1[_0x68b5('0xfc')](_0x436634[_0x68b5('0x77')][_0x68b5('0x85')],_[_0x68b5('0xfd')](_0x436634[_0x68b5('0x77')],[_0x68b5('0x85'),'id'])||{});}})[_0x68b5('0x2d')](respondWithResult(_0x1c6e9c,null))[_0x68b5('0x71')](handleError(_0x1c6e9c,null));};exports[_0x68b5('0xfe')]=function(_0x51d101,_0x14b30f){var _0x9b9c13={'raw':![],'where':{}};var _0x3b166e={};var _0x554dc0={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x51d101[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x14b30f,null))[_0x68b5('0x2d')](function(_0x1852a5){if(_0x1852a5){_0x3b166e[_0x68b5('0x52')]=_['keys'](db[_0x68b5('0xbe')][_0x68b5('0x5b')]);_0x3b166e[_0x68b5('0x5e')]=_[_0x68b5('0x74')](_0x51d101[_0x68b5('0x5e')]);_0x3b166e[_0x68b5('0x68')]=_[_0x68b5('0x5f')](_0x3b166e[_0x68b5('0x52')],_0x3b166e[_0x68b5('0x5e')]);_0x9b9c13[_0x68b5('0x60')]=_[_0x68b5('0x5f')](_0x3b166e[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x51d101[_0x68b5('0x5e')][_0x68b5('0x61')]));_0x9b9c13[_0x68b5('0x60')]=_0x9b9c13['attributes']['length']?_0x9b9c13[_0x68b5('0x60')]:_0x3b166e[_0x68b5('0x52')];if(!_0x51d101[_0x68b5('0x5e')][_0x68b5('0x63')](_0x68b5('0x64'))){_0x9b9c13['limit']=qs[_0x68b5('0x26')](_0x51d101[_0x68b5('0x5e')][_0x68b5('0x26')]);_0x9b9c13[_0x68b5('0x28')]=qs['offset'](_0x51d101[_0x68b5('0x5e')][_0x68b5('0x28')]);}_0x9b9c13['order']=qs[_0x68b5('0x66')](_0x51d101[_0x68b5('0x5e')][_0x68b5('0x66')]);_0x9b9c13[_0x68b5('0x67')]=qs['filters'](_[_0x68b5('0x83')](_0x51d101[_0x68b5('0x5e')],_0x3b166e[_0x68b5('0x68')]));_0x9b9c13[_0x68b5('0x67')][_0x68b5('0x7f')]=_0x1852a5['id'];if(_0x51d101[_0x68b5('0x5e')][_0x68b5('0x69')]){_0x9b9c13['where']=_[_0x68b5('0x6a')](_0x9b9c13[_0x68b5('0x67')],{'$or':_[_0x68b5('0x59')](_0x9b9c13['attributes'],function(_0x3b3e32){var _0x209bfa={};_0x209bfa[_0x3b3e32]={'$like':'%'+_0x51d101[_0x68b5('0x5e')][_0x68b5('0x69')]+'%'};return _0x209bfa;})});}_0x9b9c13=_[_0x68b5('0x6a')]({},_0x9b9c13,_0x51d101[_0x68b5('0x6c')]);return db[_0x68b5('0xbe')][_0x68b5('0x29')]({'where':_0x9b9c13[_0x68b5('0x67')]})[_0x68b5('0x2d')](function(_0x57efe9){_0x554dc0['count']=_0x57efe9;if(_0x51d101['query'][_0x68b5('0x6d')]){_0x9b9c13[_0x68b5('0x6e')]=[{'model':db[_0x68b5('0xa2')],'as':_0x68b5('0xff'),'required':![]},{'model':db[_0x68b5('0xcd')],'as':_0x68b5('0x100'),'attributes':['name',_0x68b5('0x101'),'internal'],'required':![]},{'model':db[_0x68b5('0x102')],'as':_0x68b5('0x103'),'attributes':['id',_0x68b5('0x4e'),_0x68b5('0x104')],'where':_0x51d101['query']['tag']?{'id':_0x51d101[_0x68b5('0x5e')][_0x68b5('0x105')]}:undefined,'required':_0x51d101['query']['tag']?!![]:![]}];}return db[_0x68b5('0xbe')][_0x68b5('0x6f')](_0x9b9c13);})['then'](function(_0x3bac9a){_0x554dc0[_0x68b5('0x70')]=_0x3bac9a;return _0x554dc0;});}})[_0x68b5('0x2d')](respondWithFilteredResult(_0x14b30f,_0x9b9c13))['catch'](handleError(_0x14b30f,null));};exports[_0x68b5('0x34')]=function(_0x1fa6dc,_0x5c8f3c){var _0x56588c=0x0;var _0xbc804d=0x0;var _0x191730=![];var _0x36ac27;var _0x195d11;return db[_0x68b5('0x5a')]['find']({'where':{'id':_0x1fa6dc[_0x68b5('0x73')]['id']},'include':[{'model':db[_0x68b5('0x40')],'as':_0x68b5('0x40'),'include':[{'model':db[_0x68b5('0x40')],'as':_0x68b5('0xb4'),'attributes':['id',_0x68b5('0x38')]}]}]})[_0x68b5('0x2d')](handleEntityNotFound(_0x5c8f3c,null))[_0x68b5('0x2d')](function(_0x14980b){if(_0x14980b){_0x36ac27=_0x14980b;return _0x14980b['getProactiveActions']({'raw':!![]});}})[_0x68b5('0x2d')](function(_0x68ef16){if(_0x36ac27){if(_0x68ef16){_0x195d11=_0x68ef16;}}return require(_0x68b5('0x106'))[_0x68b5('0x96')]();})['then'](function(_0x379f45){if(_0x379f45){_0xbc804d=_0x379f45['virtual'];_0x191730=_0x379f45['custom'];}})[_0x68b5('0x2d')](function(){return db['ChatInteraction'][_0x68b5('0x29')]({'where':{'closed':![]}});})['then'](function(_0x2b57f1){_0x56588c=_0x2b57f1;if(_0xbc804d&&_0x2b57f1>_0xbc804d){return db[_0x68b5('0x107')][_0x68b5('0x81')]({'where':{'id':0x1}})[_0x68b5('0x2d')](function(_0x308ef1){if(_0x308ef1){_0x308ef1['increment'](_0x68b5('0x108'));}});}})[_0x68b5('0x2d')](function(){if(!_0x36ac27[_0x68b5('0x40')]||!_0x36ac27[_0x68b5('0x40')][_0x68b5('0xb4')])return!![];return checkWebsiteIntervals(_0x36ac27);})[_0x68b5('0x2d')](function(_0x4aa380){var _0x7d1f21=fs['readFileSync'](path[_0x68b5('0x93')](config['root'],_0x68b5('0x109')),_0x68b5('0xe1'));var _0xfe8cdc=new url['URL'](_0x36ac27[_0x68b5('0x10a')])[_0x68b5('0x10b')];var _0x239f77='3.5.0';var _0x28d34b=![];var _0x4a972e={'chatVersion':_0x239f77,'chatWebsiteAddressOrigin':_0xfe8cdc,'remote':_0x36ac27[_0x68b5('0x10c')],'query':querystring[_0x68b5('0x1e')](_['merge'](_0x36ac27[_0x68b5('0x2f')]({'plain':!![]}),{'customerIp':_0x1fa6dc[_0x68b5('0xbc')][_0x68b5('0x48')]||_0x1fa6dc[_0x68b5('0xbc')][_0x68b5('0x10d')]||_0x1fa6dc[_0x68b5('0x10e')][_0x68b5('0x10f')]||_0x1fa6dc['ip'],'referer':_0x1fa6dc['headers']['referer'],'openedInteractions':_0x56588c,'maxInteractions':_0xbc804d,'virtual':_0x191730[_0x68b5('0x110')],'online':_0x4aa380,'custom':_0x191730}))['replace'](/'/g,'\x5c\x27')};_0x5c8f3c[_0x68b5('0x33')](ejs[_0x68b5('0xe2')](Mustache[_0x68b5('0xe2')](_0x7d1f21,_0x4a972e),{'proactiveActions':_0x195d11,'alignment':_0x36ac27['alignment'],'verticalAlignment':_0x36ac27['verticalAlignment'],'div_color':_0x36ac27[_0x68b5('0x104')],'labelText':_0x36ac27['labelText'],'text_color':_0x36ac27[_0x68b5('0x111')],'text_button_color':_0x36ac27[_0x68b5('0x112')],'button_color':_0x36ac27['color_button'],'background_color':_0x36ac27[_0x68b5('0x113')],'hideWhenOffline':_0x36ac27[_0x68b5('0x114')],'intervalId':_0x36ac27[_0x68b5('0x115')],'isDevelopment':_0x28d34b,'chatVersion':_0x239f77}));})[_0x68b5('0x71')](handleError(_0x5c8f3c,null));};exports[_0x68b5('0x116')]=function(_0x550101,_0xd60f46){var _0x394523=_0x550101['params']['id'];var _0x21ad75=_0x550101[_0x68b5('0x77')];var _0x45803f=0xc8;var _0x81e97a=null;return db['sequelize'][_0x68b5('0xeb')]({'isolationLevel':db['sequelize'][_0x68b5('0x117')][_0x68b5('0x118')][_0x68b5('0x119')]},function(_0x34a862){return db['ChatWebsite'][_0x68b5('0x81')]({'where':{'id':_0x394523},'transaction':_0x34a862})[_0x68b5('0x2d')](function(_0x521ec8){if(_0x521ec8){return db[_0x68b5('0xb2')][_0x68b5('0x2e')]({'where':{'ChatWebsiteId':_0x394523},'transaction':_0x34a862})['then'](function(){var _0x5ed6b3=_[_0x68b5('0x59')](_0x21ad75,function(_0x2bb484){_0x2bb484[_0x68b5('0x7f')]=_0x394523;return _0x2bb484;});return db[_0x68b5('0xb2')]['bulkCreate'](_0x5ed6b3,{'transaction':_0x34a862});});}else{_0x45803f=0x194;_0x81e97a=[];}});})[_0x68b5('0x2d')](function(){if(_0x45803f!==0x194){return db['ChatApplication'][_0x68b5('0x11a')]({'where':{'ChatWebsiteId':_0x394523},'order':_0x68b5('0xb9')})[_0x68b5('0x2d')](function(_0x1c8c7f){_0x81e97a=_0x1c8c7f;});}})[_0x68b5('0x71')](function(_0x5ab543){_0x45803f=0x1f4;logger['error'](_0x5ab543[_0x68b5('0x11b')]);if(_0x5ab543['name']){delete _0x5ab543[_0x68b5('0x4e')];}_0x81e97a=_0x5ab543;})['finally'](function(){if(_0x81e97a===null){_0xd60f46[_0x68b5('0x23')](_0x45803f);}else{if(_0x45803f===0x1f4){_0xd60f46[_0x68b5('0x24')](_0x45803f)['send'](_0x81e97a);}else{_0xd60f46[_0x68b5('0x24')](_0x45803f)['json'](_0x81e97a);}}});};exports[_0x68b5('0x11c')]=function(_0x24e392,_0x2d8f95){var _0x5da3d1={};var _0x40a405={};var _0x540739;var _0x4da9e3;return db[_0x68b5('0x5a')][_0x68b5('0x81')]({'where':{'id':_0x24e392['params']['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x2d8f95,null))[_0x68b5('0x2d')](function(_0x5d44a8){if(_0x5d44a8){_0x540739=_0x5d44a8;_0x40a405['model']=_['keys'](db[_0x68b5('0xb2')][_0x68b5('0x5b')]);_0x40a405[_0x68b5('0x5e')]=_[_0x68b5('0x74')](_0x24e392['query']);_0x40a405[_0x68b5('0x68')]=_['intersection'](_0x40a405[_0x68b5('0x52')],_0x40a405['query']);_0x5da3d1[_0x68b5('0x60')]=_[_0x68b5('0x5f')](_0x40a405[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x24e392[_0x68b5('0x5e')]['fields']));_0x5da3d1[_0x68b5('0x60')]=_0x5da3d1['attributes'][_0x68b5('0x62')]?_0x5da3d1[_0x68b5('0x60')]:_0x40a405[_0x68b5('0x52')];_0x5da3d1[_0x68b5('0x65')]=qs['sort'](_0x24e392[_0x68b5('0x5e')][_0x68b5('0x66')]);_0x5da3d1[_0x68b5('0x67')]=qs[_0x68b5('0x68')](_[_0x68b5('0x83')](_0x24e392[_0x68b5('0x5e')],_0x40a405[_0x68b5('0x68')]));if(_0x24e392[_0x68b5('0x5e')]['filter']){_0x5da3d1[_0x68b5('0x67')]=_['merge'](_0x5da3d1[_0x68b5('0x67')],{'$or':_[_0x68b5('0x59')](_0x5da3d1[_0x68b5('0x60')],function(_0x556d42){var _0xef1ac3={};_0xef1ac3[_0x556d42]={'$like':'%'+_0x24e392[_0x68b5('0x5e')][_0x68b5('0x69')]+'%'};return _0xef1ac3;})});}_0x5da3d1=_[_0x68b5('0x6a')]({},_0x5da3d1,_0x24e392[_0x68b5('0x6c')]);return _0x540739[_0x68b5('0x11c')](_0x5da3d1);}})[_0x68b5('0x2d')](function(_0x249a9a){if(_0x249a9a){_0x4da9e3=_0x249a9a[_0x68b5('0x62')];if(!_0x24e392[_0x68b5('0x5e')][_0x68b5('0x63')](_0x68b5('0x64'))){_0x5da3d1['limit']=qs[_0x68b5('0x26')](_0x24e392[_0x68b5('0x5e')]['limit']);_0x5da3d1['offset']=qs['offset'](_0x24e392[_0x68b5('0x5e')]['offset']);}return _0x540739[_0x68b5('0x11c')](_0x5da3d1);}})[_0x68b5('0x2d')](function(_0x342380){if(_0x342380){return _0x342380?{'count':_0x4da9e3,'rows':_0x342380}:null;}})[_0x68b5('0x2d')](respondWithResult(_0x2d8f95,null))[_0x68b5('0x71')](handleError(_0x2d8f95,null));};exports[_0x68b5('0x11d')]=function(_0x5c8f92,_0x1206c1){return db[_0x68b5('0x11e')]['find']({'where':{'id':_0x5c8f92['params']['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x1206c1,null))[_0x68b5('0x2d')](function(_0xf61af6){if(_0xf61af6){return _0xf61af6[_0x68b5('0x11d')](_0x5c8f92['body'][_0x68b5('0x85')],_['omit'](_0x5c8f92['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1206c1,null))['catch'](handleError(_0x1206c1,null));};exports['getProactiveActions']=function(_0x39ee88,_0x420b94){var _0xb002fd={};var _0x5d0653={};var _0x2fefb4;var _0x111a72;return db[_0x68b5('0x5a')][_0x68b5('0x81')]({'where':{'id':_0x39ee88[_0x68b5('0x73')]['id']}})['then'](handleEntityNotFound(_0x420b94,null))['then'](function(_0x5d4910){if(_0x5d4910){_0x2fefb4=_0x5d4910;_0x5d0653[_0x68b5('0x52')]=_[_0x68b5('0x74')](db['ChatProactiveAction'][_0x68b5('0x5b')]);_0x5d0653[_0x68b5('0x5e')]=_[_0x68b5('0x74')](_0x39ee88[_0x68b5('0x5e')]);_0x5d0653['filters']=_[_0x68b5('0x5f')](_0x5d0653[_0x68b5('0x52')],_0x5d0653[_0x68b5('0x5e')]);_0xb002fd[_0x68b5('0x60')]=_['intersection'](_0x5d0653[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x39ee88[_0x68b5('0x5e')][_0x68b5('0x61')]));_0xb002fd[_0x68b5('0x60')]=_0xb002fd['attributes']['length']?_0xb002fd[_0x68b5('0x60')]:_0x5d0653[_0x68b5('0x52')];_0xb002fd[_0x68b5('0x65')]=qs['sort'](_0x39ee88['query'][_0x68b5('0x66')]);_0xb002fd[_0x68b5('0x67')]=qs['filters'](_[_0x68b5('0x83')](_0x39ee88[_0x68b5('0x5e')],_0x5d0653[_0x68b5('0x68')]));if(_0x39ee88['query'][_0x68b5('0x69')]){_0xb002fd['where']=_[_0x68b5('0x6a')](_0xb002fd[_0x68b5('0x67')],{'$or':_['map'](_0xb002fd['attributes'],function(_0x38b56f){var _0x49680b={};_0x49680b[_0x38b56f]={'$like':'%'+_0x39ee88['query'][_0x68b5('0x69')]+'%'};return _0x49680b;})});}_0xb002fd=_['merge']({},_0xb002fd,_0x39ee88['options']);return _0x2fefb4[_0x68b5('0x11f')](_0xb002fd);}})[_0x68b5('0x2d')](function(_0x4ed035){if(_0x4ed035){_0x111a72=_0x4ed035['length'];if(!_0x39ee88[_0x68b5('0x5e')]['hasOwnProperty']('nolimit')){_0xb002fd[_0x68b5('0x26')]=qs[_0x68b5('0x26')](_0x39ee88[_0x68b5('0x5e')]['limit']);_0xb002fd['offset']=qs[_0x68b5('0x28')](_0x39ee88[_0x68b5('0x5e')]['offset']);}return _0x2fefb4['getProactiveActions'](_0xb002fd);}})[_0x68b5('0x2d')](function(_0x4b5edc){if(_0x4b5edc){return _0x4b5edc?{'count':_0x111a72,'rows':_0x4b5edc}:null;}})[_0x68b5('0x2d')](respondWithResult(_0x420b94,null))[_0x68b5('0x71')](handleError(_0x420b94,null));};exports[_0x68b5('0x120')]=function(_0x4a7efc,_0x25f0ac){var _0x3a77e2=_0x4a7efc[_0x68b5('0x5e')]['online']===_0x68b5('0x121')?_0x68b5('0x122'):_0x68b5('0x123');return db[_0x68b5('0x5a')]['find']({'attributes':['id',_0x3a77e2],'where':{'id':_0x4a7efc[_0x68b5('0x73')]['id']}})['then'](handleEntityNotFound(_0x25f0ac,null))['then'](function(_0x1a6d7a){if(_0x1a6d7a){var _0x48f7bd=_0x1a6d7a[_0x3a77e2];var _0x4fbc2b=_0x48f7bd&&_0x48f7bd['items']?_0x48f7bd['items']:[];_0x25f0ac[_0x68b5('0x33')]({'fromKey':_[_0x68b5('0x97')](_0x48f7bd[_0x68b5('0x124')])?undefined:_0x48f7bd['fromKey'],'count':_0x4fbc2b[_0x68b5('0x62')],'rows':_0x4fbc2b});}})['catch'](handleError(_0x25f0ac,null));};exports[_0x68b5('0x125')]=function(_0x5e5150,_0x20b6a2){var _0x583b6d={'raw':![],'where':{}};var _0x5982c1={};var _0x1a75a2={'count':0x0,'rows':[]};return db[_0x68b5('0x5a')][_0x68b5('0x81')]({'where':{'id':_0x5e5150[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x20b6a2,null))[_0x68b5('0x2d')](function(_0xd4a2f7){if(_0xd4a2f7){_0x5982c1[_0x68b5('0x52')]=_[_0x68b5('0x74')](db[_0x68b5('0xe4')][_0x68b5('0x5b')]);_0x5982c1['query']=_[_0x68b5('0x74')](_0x5e5150[_0x68b5('0x5e')]);_0x5982c1[_0x68b5('0x68')]=_[_0x68b5('0x5f')](_0x5982c1[_0x68b5('0x52')],_0x5982c1[_0x68b5('0x5e')]);_0x583b6d['attributes']=_[_0x68b5('0x5f')](_0x5982c1[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x5e5150[_0x68b5('0x5e')]['fields']));_0x583b6d[_0x68b5('0x60')]=_0x583b6d['attributes'][_0x68b5('0x62')]?_0x583b6d[_0x68b5('0x60')]:_0x5982c1[_0x68b5('0x52')];if(!_0x5e5150[_0x68b5('0x5e')][_0x68b5('0x63')](_0x68b5('0x64'))){_0x583b6d[_0x68b5('0x26')]=qs[_0x68b5('0x26')](_0x5e5150[_0x68b5('0x5e')][_0x68b5('0x26')]);_0x583b6d[_0x68b5('0x28')]=qs[_0x68b5('0x28')](_0x5e5150[_0x68b5('0x5e')]['offset']);}_0x583b6d[_0x68b5('0x65')]=qs[_0x68b5('0x66')](_0x5e5150[_0x68b5('0x5e')][_0x68b5('0x66')]);_0x583b6d[_0x68b5('0x67')]=qs[_0x68b5('0x68')](_['pick'](_0x5e5150['query'],_0x5982c1[_0x68b5('0x68')]));_0x583b6d[_0x68b5('0x67')][_0x68b5('0x7f')]=_0xd4a2f7['id'];if(_0x5e5150[_0x68b5('0x5e')]['filter']){_0x583b6d[_0x68b5('0x67')]=_[_0x68b5('0x6a')](_0x583b6d['where'],{'$or':_[_0x68b5('0x59')](_0x583b6d[_0x68b5('0x60')],function(_0x4a01f8){var _0x3a7878={};_0x3a7878[_0x4a01f8]={'$like':'%'+_0x5e5150[_0x68b5('0x5e')]['filter']+'%'};return _0x3a7878;})});}_0x583b6d=_[_0x68b5('0x6a')]({},_0x583b6d,_0x5e5150[_0x68b5('0x6c')]);return db['ChatOfflineMessage']['count']({'where':_0x583b6d[_0x68b5('0x67')]})[_0x68b5('0x2d')](function(_0x3124ac){_0x1a75a2[_0x68b5('0x29')]=_0x3124ac;if(_0x5e5150[_0x68b5('0x5e')][_0x68b5('0x6d')]){_0x583b6d[_0x68b5('0x6e')]=[{'all':!![]}];}else{_0x583b6d[_0x68b5('0x6e')]=[{'model':db[_0x68b5('0xa2')],'as':_0x68b5('0xff'),'required':![]},{'model':db[_0x68b5('0x126')],'as':'Attachments','required':![]}];}return db[_0x68b5('0xe4')][_0x68b5('0x6f')](_0x583b6d);})[_0x68b5('0x2d')](function(_0x57cb0c){_0x1a75a2[_0x68b5('0x70')]=_0x57cb0c;return _0x1a75a2;});}})[_0x68b5('0x2d')](respondWithFilteredResult(_0x20b6a2,_0x583b6d))[_0x68b5('0x71')](handleError(_0x20b6a2,null));};exports[_0x68b5('0x127')]=function(_0x58304d,_0x49a1c9){return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x58304d[_0x68b5('0x73')]['id']}})['then'](handleEntityNotFound(_0x49a1c9,null))['then'](function(_0x3f9154){if(_0x3f9154){return _0x3f9154[_0x68b5('0x127')](_0x58304d[_0x68b5('0x77')]['ids'],_[_0x68b5('0xfd')](_0x58304d[_0x68b5('0x77')],[_0x68b5('0x85'),'id'])||{})[_0x68b5('0xdf')](function(_0x19aec0){for(var _0x2cf17d=0x0;_0x2cf17d<_0x58304d[_0x68b5('0x77')][_0x68b5('0x85')][_0x68b5('0x62')];_0x2cf17d+=0x1){socket[_0x68b5('0x128')](_0x68b5('0x129'),{'UserId':Number(_0x58304d[_0x68b5('0x77')][_0x68b5('0x85')][_0x2cf17d]),'ChatWebsiteId':Number(_0x58304d['params']['id'])});}return _0x19aec0;});}})[_0x68b5('0x2d')](respondWithResult(_0x49a1c9,null))['catch'](handleError(_0x49a1c9,null));};exports[_0x68b5('0x12a')]=function(_0x22537a,_0x1e8ea8){return db[_0x68b5('0x5a')][_0x68b5('0x75')]({'where':{'id':_0x22537a[_0x68b5('0x73')]['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x1e8ea8,null))['then'](function(_0x59f163){if(_0x59f163){return _0x59f163['removeAgents'](_0x22537a[_0x68b5('0x5e')]['ids'])[_0x68b5('0x2d')](function(){if(_['isArray'](_0x22537a[_0x68b5('0x5e')][_0x68b5('0x85')])){for(var _0x371fc3=0x0;_0x371fc3<_0x22537a[_0x68b5('0x5e')][_0x68b5('0x85')][_0x68b5('0x62')];_0x371fc3+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x22537a[_0x68b5('0x5e')]['ids'][_0x371fc3]),'ChatWebsiteId':Number(_0x22537a[_0x68b5('0x73')]['id'])});}}else{socket[_0x68b5('0x128')](_0x68b5('0x12b'),{'UserId':Number(_0x22537a[_0x68b5('0x5e')][_0x68b5('0x85')]),'ChatWebsiteId':Number(_0x22537a[_0x68b5('0x73')]['id'])});}});}})[_0x68b5('0x2d')](respondWithStatusCode(_0x1e8ea8,null))[_0x68b5('0x71')](handleError(_0x1e8ea8,null));};exports[_0x68b5('0x12c')]=function(_0x1748c1,_0x3a930b){var _0x4a4eb2={};var _0x202860={};var _0x443e7a;var _0x14e8b3;return db[_0x68b5('0x5a')][_0x68b5('0x81')]({'where':{'id':_0x1748c1['params']['id']}})[_0x68b5('0x2d')](handleEntityNotFound(_0x3a930b,null))[_0x68b5('0x2d')](function(_0x1ffd3c){if(_0x1ffd3c){_0x443e7a=_0x1ffd3c;_0x202860[_0x68b5('0x52')]=_['keys'](db[_0x68b5('0xcd')][_0x68b5('0x5b')]);_0x202860[_0x68b5('0x5e')]=_['keys'](_0x1748c1[_0x68b5('0x5e')]);_0x202860['filters']=_[_0x68b5('0x5f')](_0x202860['model'],_0x202860[_0x68b5('0x5e')]);_0x4a4eb2[_0x68b5('0x60')]=_[_0x68b5('0x5f')](_0x202860[_0x68b5('0x52')],qs[_0x68b5('0x61')](_0x1748c1[_0x68b5('0x5e')][_0x68b5('0x61')]));_0x4a4eb2['attributes']=_0x4a4eb2[_0x68b5('0x60')][_0x68b5('0x62')]?_0x4a4eb2[_0x68b5('0x60')]:_0x202860[_0x68b5('0x52')];_0x4a4eb2[_0x68b5('0x65')]=qs['sort'](_0x1748c1['query']['sort']);_0x4a4eb2[_0x68b5('0x67')]=qs['filters'](_[_0x68b5('0x83')](_0x1748c1[_0x68b5('0x5e')],_0x202860[_0x68b5('0x68')]));if(_0x1748c1[_0x68b5('0x5e')]['filter']){_0x4a4eb2[_0x68b5('0x67')]=_['merge'](_0x4a4eb2[_0x68b5('0x67')],{'$or':_[_0x68b5('0x59')](_0x4a4eb2[_0x68b5('0x60')],function(_0x481724){var _0x17eb04={};_0x17eb04[_0x481724]={'$like':'%'+_0x1748c1[_0x68b5('0x5e')][_0x68b5('0x69')]+'%'};return _0x17eb04;})});}_0x4a4eb2=_[_0x68b5('0x6a')]({},_0x4a4eb2,_0x1748c1[_0x68b5('0x6c')]);return _0x443e7a[_0x68b5('0x12c')](_0x4a4eb2);}})['then'](function(_0x4eed82){if(_0x4eed82){_0x14e8b3=_0x4eed82[_0x68b5('0x62')];if(!_0x1748c1[_0x68b5('0x5e')][_0x68b5('0x63')](_0x68b5('0x64'))){_0x4a4eb2[_0x68b5('0x26')]=qs[_0x68b5('0x26')](_0x1748c1[_0x68b5('0x5e')][_0x68b5('0x26')]);_0x4a4eb2[_0x68b5('0x28')]=qs[_0x68b5('0x28')](_0x1748c1[_0x68b5('0x5e')][_0x68b5('0x28')]);}return _0x443e7a[_0x68b5('0x12c')](_0x4a4eb2);}})['then'](function(_0x3a9e64){if(_0x3a9e64){return _0x3a9e64?{'count':_0x14e8b3,'rows':_0x3a9e64}:null;}})[_0x68b5('0x2d')](respondWithResult(_0x3a930b,null))[_0x68b5('0x71')](handleError(_0x3a930b,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 05c9cb1..6c2478f 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 _0x8388=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit','hook'];(function(_0x50f31f,_0x93ba1f){var _0x7d0379=function(_0x484d16){while(--_0x484d16){_0x50f31f['push'](_0x50f31f['shift']());}};_0x7d0379(++_0x93ba1f);}(_0x8388,0x18d));var _0x8838=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x8388[_0x4ed32d];return _0xf624df;};'use strict';var EventEmitter=require(_0x8838('0x0'));var ChatWebsite=require(_0x8838('0x1'))['db'][_0x8838('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8838('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8838('0x4'),'afterDestroy':_0x8838('0x5')};function emitEvent(_0x316297){return function(_0x20a813,_0xd474f2,_0x5036bd){ChatWebsiteEvents[_0x8838('0x6')](_0x316297+':'+_0x20a813['id'],_0x20a813);ChatWebsiteEvents[_0x8838('0x6')](_0x316297,_0x20a813);_0x5036bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x8838('0x7')](e,emitEvent(event));}}module[_0x8838('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5455=['hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x2362e5,_0x1ee3d7){var _0x18bf19=function(_0x218c69){while(--_0x218c69){_0x2362e5['push'](_0x2362e5['shift']());}};_0x18bf19(++_0x1ee3d7);}(_0x5455,0x197));var _0x5545=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5455[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5545('0x0'))['db'][_0x5545('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5545('0x2')](0x0);var events={'afterCreate':_0x5545('0x3'),'afterUpdate':_0x5545('0x4'),'afterDestroy':_0x5545('0x5')};function emitEvent(_0x39db57){return function(_0x4cd466,_0x48fce5,_0xc4bdd5){ChatWebsiteEvents[_0x5545('0x6')](_0x39db57+':'+_0x4cd466['id'],_0x4cd466);ChatWebsiteEvents['emit'](_0x39db57,_0x4cd466);_0xc4bdd5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x5545('0x7')](e,emitEvent(event));}}module[_0x5545('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 ce5d8ce..ffd0f9a 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 _0x660b=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x660b,0x176));var _0xb660=function(_0x3f6baa,_0xf4a6f){_0x3f6baa=_0x3f6baa-0x0;var _0xd22bcc=_0x660b[_0x3f6baa];return _0xd22bcc;};'use strict';var _=require(_0xb660('0x0'));var util=require(_0xb660('0x1'));var logger=require(_0xb660('0x2'))('api');var moment=require(_0xb660('0x3'));var BPromise=require(_0xb660('0x4'));var rp=require(_0xb660('0x5'));var fs=require('fs');var path=require(_0xb660('0x6'));var rimraf=require(_0xb660('0x7'));var config=require(_0xb660('0x8'));var attributes=require(_0xb660('0x9'));module[_0xb660('0xa')]=function(_0x2a46ab,_0x5cf196){return _0x2a46ab[_0xb660('0xb')](_0xb660('0xc'),attributes,{'tableName':_0xb660('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xede8=['./chatWebsite.attributes','exports','define','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xede8,0xeb));var _0x8ede=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xede8[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8ede('0x0'));var util=require('util');var logger=require(_0x8ede('0x1'))(_0x8ede('0x2'));var moment=require(_0x8ede('0x3'));var BPromise=require(_0x8ede('0x4'));var rp=require(_0x8ede('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ede('0x6'));var config=require('../../config/environment');var attributes=require(_0x8ede('0x7'));module[_0x8ede('0x8')]=function(_0x135834,_0xebe696){return _0x135834[_0x8ede('0x9')]('ChatWebsite',attributes,{'tableName':_0x8ede('0xa'),'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 90ce0c2..b6e9910 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 _0x76ae=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment'];(function(_0x52d64f,_0x55739c){var _0x41fc84=function(_0x2ade16){while(--_0x2ade16){_0x52d64f['push'](_0x52d64f['shift']());}};_0x41fc84(++_0x55739c);}(_0x76ae,0x15d));var _0xe76a=function(_0x4e8e0e,_0x5bd823){_0x4e8e0e=_0x4e8e0e-0x0;var _0x41ad44=_0x76ae[_0x4e8e0e];return _0x41ad44;};'use strict';var _=require(_0xe76a('0x0'));var util=require(_0xe76a('0x1'));var moment=require(_0xe76a('0x2'));var BPromise=require('bluebird');var rs=require(_0xe76a('0x3'));var fs=require('fs');var Redis=require(_0xe76a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe76a('0x5'));var logger=require(_0xe76a('0x6'))('rpc');var config=require(_0xe76a('0x7'));var jayson=require(_0xe76a('0x8'));var client=jayson[_0xe76a('0x9')]['http']({'port':0x232a});config[_0xe76a('0xa')]=_['defaults'](config[_0xe76a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe76a('0xb'))[_0xe76a('0xc')](socket);function respondWithRpcPromise(_0x2c290f,_0x5c9fd4,_0x51e7ea){return new BPromise(function(_0x26b877,_0x119be0){return client[_0xe76a('0xd')](_0x2c290f,_0x51e7ea)['then'](function(_0x460945){logger[_0xe76a('0xe')](_0xe76a('0xf'),_0x5c9fd4,_0xe76a('0x10'));logger[_0xe76a('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5c9fd4,_0xe76a('0x10'),JSON['stringify'](_0x460945));if(_0x460945[_0xe76a('0x12')]){if(_0x460945[_0xe76a('0x12')][_0xe76a('0x13')]===0x1f4){logger[_0xe76a('0x12')](_0xe76a('0xf'),_0x5c9fd4,_0x460945[_0xe76a('0x12')][_0xe76a('0x14')]);return _0x119be0(_0x460945['error']['message']);}logger[_0xe76a('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x5c9fd4,_0x460945[_0xe76a('0x12')][_0xe76a('0x14')]);return _0x26b877(_0x460945[_0xe76a('0x12')][_0xe76a('0x14')]);}else{logger[_0xe76a('0xe')](_0xe76a('0xf'),_0x5c9fd4,_0xe76a('0x10'));_0x26b877(_0x460945[_0xe76a('0x15')]['message']);}})['catch'](function(_0x5552e3){logger[_0xe76a('0x12')](_0xe76a('0xf'),_0x5c9fd4,_0x5552e3);_0x119be0(_0x5552e3);});});} \ No newline at end of file +var _0xc1ce=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4baac8,_0x5f1dc7){var _0x56ebc5=function(_0x23d717){while(--_0x23d717){_0x4baac8['push'](_0x4baac8['shift']());}};_0x56ebc5(++_0x5f1dc7);}(_0xc1ce,0x76));var _0xec1c=function(_0x4a64b4,_0x48245e){_0x4a64b4=_0x4a64b4-0x0;var _0x1083fa=_0xc1ce[_0x4a64b4];return _0x1083fa;};'use strict';var _=require(_0xec1c('0x0'));var util=require(_0xec1c('0x1'));var moment=require(_0xec1c('0x2'));var BPromise=require(_0xec1c('0x3'));var rs=require(_0xec1c('0x4'));var fs=require('fs');var Redis=require(_0xec1c('0x5'));var db=require(_0xec1c('0x6'))['db'];var utils=require(_0xec1c('0x7'));var logger=require(_0xec1c('0x8'))(_0xec1c('0x9'));var config=require(_0xec1c('0xa'));var jayson=require(_0xec1c('0xb'));var client=jayson[_0xec1c('0xc')][_0xec1c('0xd')]({'port':0x232a});config['redis']=_[_0xec1c('0xe')](config[_0xec1c('0xf')],{'host':_0xec1c('0x10'),'port':0x18eb});var socket=require(_0xec1c('0x11'))(new Redis(config[_0xec1c('0xf')]));require(_0xec1c('0x12'))['register'](socket);function respondWithRpcPromise(_0x252599,_0x515e9d,_0x3ec668){return new BPromise(function(_0x5f0eb8,_0x594cdd){return client[_0xec1c('0x13')](_0x252599,_0x3ec668)[_0xec1c('0x14')](function(_0x103c9d){logger[_0xec1c('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x515e9d,'request\x20sent');logger[_0xec1c('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x515e9d,_0xec1c('0x17'),JSON[_0xec1c('0x18')](_0x103c9d));if(_0x103c9d[_0xec1c('0x19')]){if(_0x103c9d[_0xec1c('0x19')][_0xec1c('0x1a')]===0x1f4){logger['error'](_0xec1c('0x1b'),_0x515e9d,_0x103c9d[_0xec1c('0x19')][_0xec1c('0x1c')]);return _0x594cdd(_0x103c9d['error'][_0xec1c('0x1c')]);}logger[_0xec1c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x515e9d,_0x103c9d['error'][_0xec1c('0x1c')]);return _0x5f0eb8(_0x103c9d['error'][_0xec1c('0x1c')]);}else{logger['info'](_0xec1c('0x1b'),_0x515e9d,_0xec1c('0x17'));_0x5f0eb8(_0x103c9d[_0xec1c('0x1d')][_0xec1c('0x1c')]);}})[_0xec1c('0x1e')](function(_0x1d7354){logger[_0xec1c('0x19')](_0xec1c('0x1b'),_0x515e9d,_0x1d7354);_0x594cdd(_0x1d7354);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e861196..51ebe7a 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 _0x2b80=['register','length','save','remove','emit'];(function(_0x3bcd27,_0x32480d){var _0x44470f=function(_0x548bd5){while(--_0x548bd5){_0x3bcd27['push'](_0x3bcd27['shift']());}};_0x44470f(++_0x32480d);}(_0x2b80,0x151));var _0x02b8=function(_0x5a85bb,_0x21902c){_0x5a85bb=_0x5a85bb-0x0;var _0x2fa909=_0x2b80[_0x5a85bb];return _0x2fa909;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x02b8('0x0'),_0x02b8('0x1'),'update'];function createListener(_0x8b4a53,_0x58589d){return function(_0x29a7f2){_0x58589d[_0x02b8('0x2')](_0x8b4a53,_0x29a7f2);};}function removeListener(_0x5ee7e0,_0x4df9e1){return function(){ChatWebsiteEvents['removeListener'](_0x5ee7e0,_0x4df9e1);};}exports[_0x02b8('0x3')]=function(_0x407cd1){for(var _0x150af1=0x0,_0x55b61f=events[_0x02b8('0x4')];_0x150af1<_0x55b61f;_0x150af1++){var _0x22ecbb=events[_0x150af1];var _0x58870e=createListener('chatWebsite:'+_0x22ecbb,_0x407cd1);ChatWebsiteEvents['on'](_0x22ecbb,_0x58870e);}}; \ No newline at end of file +var _0x6d4a=['removeListener','register','chatWebsite:','remove','update','emit'];(function(_0x245f1e,_0x458173){var _0x1acb20=function(_0x130518){while(--_0x130518){_0x245f1e['push'](_0x245f1e['shift']());}};_0x1acb20(++_0x458173);}(_0x6d4a,0x1a1));var _0xa6d4=function(_0x528597,_0x3961e7){_0x528597=_0x528597-0x0;var _0x1ca8e4=_0x6d4a[_0x528597];return _0x1ca8e4;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xa6d4('0x0'),_0xa6d4('0x1')];function createListener(_0x38b650,_0x40402d){return function(_0x4ea98e){_0x40402d[_0xa6d4('0x2')](_0x38b650,_0x4ea98e);};}function removeListener(_0x1c2f7b,_0x5ecb48){return function(){ChatWebsiteEvents[_0xa6d4('0x3')](_0x1c2f7b,_0x5ecb48);};}exports[_0xa6d4('0x4')]=function(_0x44f2fc){for(var _0x57d5d4=0x0,_0x4b5fb8=events['length'];_0x57d5d4<_0x4b5fb8;_0x57d5d4++){var _0x5a10c0=events[_0x57d5d4];var _0x1d14d4=createListener(_0xa6d4('0x5')+_0x5a10c0,_0x44f2fc);ChatWebsiteEvents['on'](_0x5a10c0,_0x1d14d4);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 44a41d6..31acabb 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 _0x78f0=['../../config/environment','./chatWebsite.controller','get','index','describe','/:id','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','diskStorage','join','server/files/images/logos/','format','%s-%s','single','file','addLogo','root','now','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x574797,_0x15f63b){var _0x1bed4f=function(_0x4c118d){while(--_0x4c118d){_0x574797['push'](_0x574797['shift']());}};_0x1bed4f(++_0x15f63b);}(_0x78f0,0x12b));var _0x078f=function(_0x4fc76d,_0x1c0db9){_0x4fc76d=_0x4fc76d-0x0;var _0x29dd72=_0x78f0[_0x4fc76d];return _0x29dd72;};'use strict';var multer=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var path=require(_0x078f('0x2'));var timeout=require(_0x078f('0x3'));var express=require(_0x078f('0x4'));var router=express[_0x078f('0x5')]();var fs_extra=require(_0x078f('0x6'));var auth=require(_0x078f('0x7'));var interaction=require(_0x078f('0x8'));var config=require(_0x078f('0x9'));var controller=require(_0x078f('0xa'));router[_0x078f('0xb')]('/',auth['isAuthenticated'](),controller[_0x078f('0xc')]);router[_0x078f('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x078f('0xd')]);router['get'](_0x078f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x078f('0xb')](_0x078f('0xf'),auth[_0x078f('0x10')](),controller[_0x078f('0x11')]);router[_0x078f('0xb')](_0x078f('0x12'),auth[_0x078f('0x10')](),controller[_0x078f('0x13')]);router[_0x078f('0xb')](_0x078f('0x14'),controller[_0x078f('0x15')]);router[_0x078f('0xb')](_0x078f('0x16'),controller[_0x078f('0x17')]);router[_0x078f('0xb')]('/:id/customer_avatar',controller[_0x078f('0x18')]);router[_0x078f('0xb')](_0x078f('0x19'),controller[_0x078f('0x1a')]);router[_0x078f('0xb')](_0x078f('0x1b'),auth[_0x078f('0x10')](),controller[_0x078f('0x1c')]);router['get'](_0x078f('0x1d'),controller[_0x078f('0x1e')]);router['get']('/:id/applications',auth[_0x078f('0x10')](),controller[_0x078f('0x1f')]);router['get'](_0x078f('0x20'),auth[_0x078f('0x10')](),controller[_0x078f('0x21')]);router['get'](_0x078f('0x22'),controller[_0x078f('0x23')]);router[_0x078f('0xb')](_0x078f('0x24'),auth[_0x078f('0x10')](),controller[_0x078f('0x25')]);router[_0x078f('0xb')](_0x078f('0x26'),auth[_0x078f('0x10')](),controller[_0x078f('0x27')]);router[_0x078f('0x28')]('/',auth[_0x078f('0x10')](),controller['create']);router['post'](_0x078f('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x078f('0x12'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x078f('0x29')]({'destination':function(_0x4dce9d,_0xb8c377,_0x16a22a){_0x16a22a(null,path[_0x078f('0x2a')](config['root'],_0x078f('0x2b')));},'filename':function(_0x5818bc,_0x23fb87,_0x27f8df){_0x27f8df(null,util[_0x078f('0x2c')](_0x078f('0x2d'),Date['now'](),_0x23fb87['originalname']));}})});router[_0x078f('0x28')](_0x078f('0x14'),upload[_0x078f('0x2e')](_0x078f('0x2f')),controller[_0x078f('0x30')]);var upload=multer({'storage':multer[_0x078f('0x29')]({'destination':function(_0x2fbd6c,_0x40dcc2,_0x1c393f){_0x1c393f(null,path[_0x078f('0x2a')](config[_0x078f('0x31')],'server/files/images/avatars/'));},'filename':function(_0x1f0f98,_0x36558d,_0x4e128d){_0x4e128d(null,util[_0x078f('0x2c')]('%s-%s',Date[_0x078f('0x32')](),_0x36558d[_0x078f('0x33')]));}})});router[_0x078f('0x28')](_0x078f('0x16'),upload[_0x078f('0x2e')](_0x078f('0x2f')),controller[_0x078f('0x34')]);var upload=multer({'storage':multer[_0x078f('0x29')]({'destination':function(_0x3cd8d4,_0x4bcc41,_0x2cf66d){_0x2cf66d(null,path['join'](config[_0x078f('0x31')],_0x078f('0x35')));},'filename':function(_0x18c336,_0x1a362a,_0x34adbc){_0x34adbc(null,util[_0x078f('0x2c')](_0x078f('0x2d'),Date[_0x078f('0x32')](),_0x1a362a[_0x078f('0x33')]));}})});router['post']('/:id/customer_avatar',upload[_0x078f('0x2e')](_0x078f('0x2f')),controller[_0x078f('0x36')]);var upload=multer({'storage':multer[_0x078f('0x29')]({'destination':function(_0x473823,_0x2aa6ca,_0xd338ad){_0xd338ad(null,path[_0x078f('0x2a')](config[_0x078f('0x31')],_0x078f('0x35')));},'filename':function(_0x354458,_0x54fe59,_0x4f64c7){_0x4f64c7(null,util['format'](_0x078f('0x2d'),Date['now'](),_0x54fe59['originalname']));}})});router[_0x078f('0x28')](_0x078f('0x19'),upload[_0x078f('0x2e')](_0x078f('0x2f')),controller[_0x078f('0x37')]);router[_0x078f('0x28')]('/:id/notify',controller[_0x078f('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x078f('0x29')]({'destination':function(_0x122194,_0x2179b1,_0x29cca2){const _0xa4a142=path['join'](config[_0x078f('0x31')],_0x078f('0x39'),'attachments',_0x078f('0x3a'));fs_extra[_0x078f('0x3b')](_0xa4a142,function(){_0x29cca2(null,_0xa4a142);});},'filename':function(_0x433fb0,_0x540330,_0x3c388d){const _0x46c841=_0x540330[_0x078f('0x33')][_0x078f('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5ef315=path[_0x078f('0x3d')](_0x46c841);const _0x12ec63=Date[_0x078f('0x32')]()+'-'+_0x46c841[_0x078f('0x3c')](_0x5ef315,'')+_0x5ef315;_0x3c388d(null,_0x12ec63);}})});router['post'](_0x078f('0x3e'),offlineUploadMulter[_0x078f('0x3f')](),controller[_0x078f('0x40')]);router['post'](_0x078f('0x1b'),auth[_0x078f('0x10')](),controller['addInteraction']);router['post'](_0x078f('0x41'),auth[_0x078f('0x10')](),controller[_0x078f('0x42')]);router[_0x078f('0x28')](_0x078f('0x20'),auth[_0x078f('0x10')](),controller[_0x078f('0x43')]);router[_0x078f('0x28')]('/:id/users',auth['isAuthenticated'](),controller[_0x078f('0x44')]);router[_0x078f('0x45')](_0x078f('0xe'),auth[_0x078f('0x10')](),controller[_0x078f('0x46')]);router[_0x078f('0x47')](_0x078f('0xe'),auth[_0x078f('0x10')](),controller[_0x078f('0x48')]);router[_0x078f('0x47')]('/:id/dispositions',auth[_0x078f('0x10')](),controller[_0x078f('0x49')]);router[_0x078f('0x47')](_0x078f('0x12'),auth[_0x078f('0x10')](),controller[_0x078f('0x4a')]);router[_0x078f('0x47')]('/:id/users',auth['isAuthenticated'](),controller[_0x078f('0x4b')]);module[_0x078f('0x4c')]=router; \ No newline at end of file +var _0x8677=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','server/files/images/avatars/','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addAgents','put','delete','destroy','removeDispositions','removeAnswers','/:id/users','exports'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x8677,0x96));var _0x7867=function(_0x4056e2,_0x9b04a5){_0x4056e2=_0x4056e2-0x0;var _0x10c1cc=_0x8677[_0x4056e2];return _0x10c1cc;};'use strict';var multer=require(_0x7867('0x0'));var util=require(_0x7867('0x1'));var path=require(_0x7867('0x2'));var timeout=require(_0x7867('0x3'));var express=require(_0x7867('0x4'));var router=express[_0x7867('0x5')]();var fs_extra=require(_0x7867('0x6'));var auth=require(_0x7867('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7867('0x8'));var controller=require(_0x7867('0x9'));router[_0x7867('0xa')]('/',auth[_0x7867('0xb')](),controller[_0x7867('0xc')]);router[_0x7867('0xa')](_0x7867('0xd'),auth[_0x7867('0xb')](),controller['describe']);router[_0x7867('0xa')](_0x7867('0xe'),auth[_0x7867('0xb')](),controller[_0x7867('0xf')]);router[_0x7867('0xa')](_0x7867('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7867('0xa')](_0x7867('0x11'),auth['isAuthenticated'](),controller[_0x7867('0x12')]);router[_0x7867('0xa')](_0x7867('0x13'),controller[_0x7867('0x14')]);router[_0x7867('0xa')](_0x7867('0x15'),controller['getAvatar']);router[_0x7867('0xa')](_0x7867('0x16'),controller[_0x7867('0x17')]);router['get'](_0x7867('0x18'),controller[_0x7867('0x19')]);router[_0x7867('0xa')](_0x7867('0x1a'),auth[_0x7867('0xb')](),controller[_0x7867('0x1b')]);router['get'](_0x7867('0x1c'),controller['getSnippet']);router[_0x7867('0xa')]('/:id/applications',auth[_0x7867('0xb')](),controller[_0x7867('0x1d')]);router[_0x7867('0xa')](_0x7867('0x1e'),auth[_0x7867('0xb')](),controller[_0x7867('0x1f')]);router[_0x7867('0xa')](_0x7867('0x20'),controller[_0x7867('0x21')]);router['get'](_0x7867('0x22'),auth['isAuthenticated'](),controller[_0x7867('0x23')]);router[_0x7867('0xa')]('/:id/users',auth[_0x7867('0xb')](),controller[_0x7867('0x24')]);router[_0x7867('0x25')]('/',auth[_0x7867('0xb')](),controller[_0x7867('0x26')]);router['post'](_0x7867('0x10'),auth['isAuthenticated'](),controller[_0x7867('0x27')]);router[_0x7867('0x25')](_0x7867('0x11'),auth[_0x7867('0xb')](),controller[_0x7867('0x28')]);var upload=multer({'storage':multer[_0x7867('0x29')]({'destination':function(_0x1bfb74,_0x325b04,_0x1f7e45){_0x1f7e45(null,path[_0x7867('0x2a')](config[_0x7867('0x2b')],_0x7867('0x2c')));},'filename':function(_0x5c9af5,_0xf32bf0,_0x52005c){_0x52005c(null,util[_0x7867('0x2d')](_0x7867('0x2e'),Date['now'](),_0xf32bf0[_0x7867('0x2f')]));}})});router[_0x7867('0x25')](_0x7867('0x13'),upload[_0x7867('0x30')](_0x7867('0x31')),controller['addLogo']);var upload=multer({'storage':multer[_0x7867('0x29')]({'destination':function(_0xf1a00e,_0xf77db4,_0x526519){_0x526519(null,path[_0x7867('0x2a')](config[_0x7867('0x2b')],_0x7867('0x32')));},'filename':function(_0x3ac390,_0x21c156,_0xbfa2ce){_0xbfa2ce(null,util[_0x7867('0x2d')](_0x7867('0x2e'),Date['now'](),_0x21c156['originalname']));}})});router[_0x7867('0x25')](_0x7867('0x15'),upload[_0x7867('0x30')](_0x7867('0x31')),controller[_0x7867('0x33')]);var upload=multer({'storage':multer[_0x7867('0x29')]({'destination':function(_0x124db2,_0x5a2738,_0x4d62c8){_0x4d62c8(null,path['join'](config['root'],_0x7867('0x32')));},'filename':function(_0x5946e5,_0x50b545,_0x1b0127){_0x1b0127(null,util['format'](_0x7867('0x2e'),Date[_0x7867('0x34')](),_0x50b545[_0x7867('0x2f')]));}})});router[_0x7867('0x25')](_0x7867('0x16'),upload[_0x7867('0x30')](_0x7867('0x31')),controller[_0x7867('0x35')]);var upload=multer({'storage':multer[_0x7867('0x29')]({'destination':function(_0xb56b90,_0xe550ff,_0xb9cb3d){_0xb9cb3d(null,path['join'](config[_0x7867('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x856666,_0x4b6c89,_0x111635){_0x111635(null,util[_0x7867('0x2d')](_0x7867('0x2e'),Date[_0x7867('0x34')](),_0x4b6c89['originalname']));}})});router[_0x7867('0x25')]('/:id/system_avatar',upload['single'](_0x7867('0x31')),controller[_0x7867('0x36')]);router['post'](_0x7867('0x37'),controller[_0x7867('0x38')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5affe9,_0x623a95,_0x15582c){const _0x881296=path[_0x7867('0x2a')](config[_0x7867('0x2b')],_0x7867('0x39'),'attachments',_0x7867('0x3a'));fs_extra['ensureDir'](_0x881296,function(){_0x15582c(null,_0x881296);});},'filename':function(_0x528782,_0x4105a5,_0x41d08e){const _0x2b9348=_0x4105a5[_0x7867('0x2f')][_0x7867('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4d4c61=path[_0x7867('0x3c')](_0x2b9348);const _0x2ab4e9=Date['now']()+'-'+_0x2b9348['replace'](_0x4d4c61,'')+_0x4d4c61;_0x41d08e(null,_0x2ab4e9);}})});router[_0x7867('0x25')](_0x7867('0x3d'),offlineUploadMulter[_0x7867('0x3e')](),controller[_0x7867('0x3f')]);router[_0x7867('0x25')](_0x7867('0x1a'),auth[_0x7867('0xb')](),controller[_0x7867('0x40')]);router['post'](_0x7867('0x41'),auth[_0x7867('0xb')](),controller[_0x7867('0x42')]);router['post']('/:id/proactive_actions',auth[_0x7867('0xb')](),controller['addProactiveActions']);router[_0x7867('0x25')]('/:id/users',auth[_0x7867('0xb')](),controller[_0x7867('0x43')]);router[_0x7867('0x44')](_0x7867('0xe'),auth[_0x7867('0xb')](),controller['update']);router[_0x7867('0x45')](_0x7867('0xe'),auth[_0x7867('0xb')](),controller[_0x7867('0x46')]);router[_0x7867('0x45')](_0x7867('0x10'),auth[_0x7867('0xb')](),controller[_0x7867('0x47')]);router[_0x7867('0x45')](_0x7867('0x11'),auth[_0x7867('0xb')](),controller[_0x7867('0x48')]);router[_0x7867('0x45')](_0x7867('0x49'),auth[_0x7867('0xb')](),controller['removeAgents']);module[_0x7867('0x4a')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 7975ed1..7c0983a 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 _0x2851=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','../config/environment','Router','app','get'];(function(_0x24db45,_0x4d9027){var _0x577849=function(_0x2511ad){while(--_0x2511ad){_0x24db45['push'](_0x24db45['shift']());}};_0x577849(++_0x4d9027);}(_0x2851,0x19d));var _0x1285=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2851[_0x4565bf];return _0x5610ba;};var beaverLogger=require(_0x1285('0x0'));var express=require(_0x1285('0x1'));var auth=require(_0x1285('0x2'));var config=require(_0x1285('0x3'));var router=express[_0x1285('0x4')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x49d70e,_0x3d0aab,_0x4673ca){var _0x742fd1=_0x49d70e[_0x1285('0x5')][_0x1285('0x6')](_0x1285('0x7'));if(!_0x742fd1){throw new Error(_0x1285('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x1285('0x9'),'logger':_0x742fd1,'enableCors':!isProduction})(_0x49d70e,_0x3d0aab,_0x4673ca);}router[_0x1285('0xa')](auth[_0x1285('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x82d7=['isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x82d7,0xf4));var _0x782d=function(_0x326e5e,_0x491c33){_0x326e5e=_0x326e5e-0x0;var _0x4d0fde=_0x82d7[_0x326e5e];return _0x4d0fde;};var beaverLogger=require(_0x782d('0x0'));var express=require(_0x782d('0x1'));var auth=require('../components/auth/service');var config=require(_0x782d('0x2'));var router=express['Router']();var isProduction=config[_0x782d('0x3')]===_0x782d('0x4')||![];function clientSideLogs(_0x586376,_0x255ae9,_0x223d6c){var _0x37a082=_0x586376['app'][_0x782d('0x5')]('client-side-logger');if(!_0x37a082){throw new Error(_0x782d('0x6'));}return beaverLogger[_0x782d('0x7')]({'uri':_0x782d('0x8'),'logger':_0x37a082,'enableCors':!isProduction})(_0x586376,_0x255ae9,_0x223d6c);}router['use'](auth[_0x782d('0x9')](),clientSideLogs);module[_0x782d('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 01c08eb..9b22913 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 _0xd576=['ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING'];(function(_0xde89be,_0x541f03){var _0x54a69c=function(_0x22a8e7){while(--_0x22a8e7){_0xde89be['push'](_0xde89be['shift']());}};_0x54a69c(++_0x541f03);}(_0xd576,0x123));var _0x6d57=function(_0x46dfbe,_0x422528){_0x46dfbe=_0x46dfbe-0x0;var _0xff940=_0xd576[_0x46dfbe];return _0xff940;};'use strict';var Sequelize=require(_0x6d57('0x0'));module[_0x6d57('0x1')]={'name':{'type':Sequelize[_0x6d57('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6d57('0x3')]('AmazonAWS','Google',_0x6d57('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6d57('0x3')](_0x6d57('0x5'),_0x6d57('0x6'))},'data1':{'type':Sequelize[_0x6d57('0x2')],'comment':_0x6d57('0x7')},'data2':{'type':Sequelize[_0x6d57('0x2')],'comment':_0x6d57('0x8')},'data3':{'type':Sequelize[_0x6d57('0x2')],'comment':_0x6d57('0x9')},'data4':{'type':Sequelize[_0x6d57('0x2')],'comment':_0x6d57('0xa')},'data5':{'type':Sequelize[_0x6d57('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x6d57('0xb')],'comment':_0x6d57('0xc')},'data7':{'type':Sequelize[_0x6d57('0xb')],'comment':_0x6d57('0xd')}}; \ No newline at end of file +var _0xcc63=['ENUM','AmazonAWS','Google','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x57cd89,_0x2551d5){var _0x327140=function(_0x3d20a3){while(--_0x3d20a3){_0x57cd89['push'](_0x57cd89['shift']());}};_0x327140(++_0x2551d5);}(_0xcc63,0x9a));var _0x3cc6=function(_0x5be2cf,_0x5809b7){_0x5be2cf=_0x5be2cf-0x0;var _0x3726ad=_0xcc63[_0x5be2cf];return _0x3726ad;};'use strict';var Sequelize=require(_0x3cc6('0x0'));module[_0x3cc6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3cc6('0x2')](_0x3cc6('0x3'),_0x3cc6('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3cc6('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x3cc6('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x3cc6('0x6')],'comment':_0x3cc6('0x7')},'data3':{'type':Sequelize[_0x3cc6('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x3cc6('0x8')],'comment':_0x3cc6('0x9')},'data6':{'type':Sequelize[_0x3cc6('0x8')],'comment':_0x3cc6('0xa')},'data7':{'type':Sequelize[_0x3cc6('0x8')],'comment':_0x3cc6('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a026405..c5f6996 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 _0xf662=['Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end','json','offset','undefined','limit','count','Content-Range','then','error','name','send','slice','index','CloudProvider','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','MicrosoftAzure','data3','catch','show','params','find','service','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','encryptString','update','oauth2MicrosoftAuthorize','findOne','sendStatus','user','oauth2MicrosoftCallback','get','state','parse','from','toString','isValidIdToken','id_token','oauth2Claims'];(function(_0x40f689,_0x36aa68){var _0x1b4003=function(_0x202a71){while(--_0x202a71){_0x40f689['push'](_0x40f689['shift']());}};_0x1b4003(++_0x36aa68);}(_0xf662,0x11f));var _0x2f66=function(_0x1d2f15,_0x1107c6){_0x1d2f15=_0x1d2f15-0x0;var _0x19efd2=_0xf662[_0x1d2f15];return _0x19efd2;};'use strict';var _=require(_0x2f66('0x0'));var Redis=require(_0x2f66('0x1'));var qs=require(_0x2f66('0x2'));var encryptor=require(_0x2f66('0x3'));var config=require(_0x2f66('0x4'));var logger=require(_0x2f66('0x5'))(_0x2f66('0x6'));var db=require(_0x2f66('0x7'))['db'];var oauth=require(_0x2f66('0x8'));config[_0x2f66('0x9')]=_[_0x2f66('0xa')](config[_0x2f66('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f66('0xb'))(new Redis(config[_0x2f66('0x9')]));var redis=new Redis(config[_0x2f66('0x9')]);function respondWithStatusCode(_0x5359e,_0x1ba6e3){_0x1ba6e3=_0x1ba6e3||0xcc;return function(_0x22528d){if(_0x22528d){return _0x5359e['sendStatus'](_0x1ba6e3);}return _0x5359e[_0x2f66('0xc')](_0x1ba6e3)[_0x2f66('0xd')]();};}function respondWithResult(_0x421f04,_0x140548){_0x140548=_0x140548||0xc8;return function(_0x186f1e){if(_0x186f1e){return _0x421f04['status'](_0x140548)[_0x2f66('0xe')](_0x186f1e);}};}function respondWithFilteredResult(_0x16648d,_0x4feeaa){return function(_0x3dd3e3){if(_0x3dd3e3){var _0x5be860=typeof _0x4feeaa[_0x2f66('0xf')]===_0x2f66('0x10')&&typeof _0x4feeaa[_0x2f66('0x11')]===_0x2f66('0x10');var _0x15525e=_0x3dd3e3[_0x2f66('0x12')];var _0xf9bd8c=_0x5be860?0x0:_0x4feeaa['offset'];var _0x1ae518=_0x5be860?_0x3dd3e3[_0x2f66('0x12')]:_0x4feeaa[_0x2f66('0xf')]+_0x4feeaa[_0x2f66('0x11')];var _0x4ee7da;if(_0x1ae518>=_0x15525e){_0x1ae518=_0x15525e;_0x4ee7da=0xc8;}else{_0x4ee7da=0xce;}_0x16648d[_0x2f66('0xc')](_0x4ee7da);return _0x16648d['set'](_0x2f66('0x13'),_0xf9bd8c+'-'+_0x1ae518+'/'+_0x15525e)[_0x2f66('0xe')](_0x3dd3e3);}return null;};}function saveUpdates(_0xec247){return function(_0x90ea2b){if(_0x90ea2b){return _0x90ea2b['update'](_0xec247)[_0x2f66('0x14')](function(_0x3cb7cd){return _0x3cb7cd;});}return null;};}function removeEntity(_0x15c8b7){return function(_0x39396e){if(_0x39396e){return _0x39396e['destroy']()['then'](function(){_0x15c8b7['status'](0xcc)[_0x2f66('0xd')]();});}};}function handleEntityNotFound(_0x3544b3){return function(_0x21c1d1){if(!_0x21c1d1){_0x3544b3['sendStatus'](0x194);}return _0x21c1d1;};}function handleError(_0x31aec7,_0x1dcb59){_0x1dcb59=_0x1dcb59||0x1f4;return function(_0x1cabfb){logger[_0x2f66('0x15')](_0x1cabfb['stack']);if(_0x1cabfb['name']){delete _0x1cabfb[_0x2f66('0x16')];}_0x31aec7[_0x2f66('0xc')](_0x1dcb59)[_0x2f66('0x17')](_0x1cabfb);};}function maskClientSecret(_0x1da6a9){return _['padEnd'](_0x1da6a9[_0x2f66('0x18')](0x0,0x3),0x14,'*');}exports[_0x2f66('0x19')]=function(_0x582185,_0x27cc4f){var _0x267318={},_0x2fa876={},_0x2d0b90={'count':0x0,'rows':[]};var _0x599cce=_['map'](db[_0x2f66('0x1a')][_0x2f66('0x1b')],function(_0xa90edc){return{'name':_0xa90edc[_0x2f66('0x1c')],'type':_0xa90edc['type'][_0x2f66('0x1d')]};});_0x2fa876[_0x2f66('0x1e')]=_[_0x2f66('0x1f')](_0x599cce,_0x2f66('0x16'));_0x2fa876[_0x2f66('0x20')]=_[_0x2f66('0x21')](_0x582185['query']);_0x2fa876[_0x2f66('0x22')]=_[_0x2f66('0x23')](_0x2fa876[_0x2f66('0x1e')],_0x2fa876[_0x2f66('0x20')]);_0x267318[_0x2f66('0x24')]=_[_0x2f66('0x23')](_0x2fa876['model'],qs[_0x2f66('0x25')](_0x582185['query']['fields']));_0x267318[_0x2f66('0x24')]=_0x267318[_0x2f66('0x24')][_0x2f66('0x26')]?_0x267318['attributes']:_0x2fa876[_0x2f66('0x1e')];if(!_0x582185[_0x2f66('0x20')][_0x2f66('0x27')](_0x2f66('0x28'))){_0x267318[_0x2f66('0x11')]=qs['limit'](_0x582185['query'][_0x2f66('0x11')]);_0x267318[_0x2f66('0xf')]=qs['offset'](_0x582185['query']['offset']);}_0x267318[_0x2f66('0x29')]=qs[_0x2f66('0x2a')](_0x582185['query']['sort']);_0x267318[_0x2f66('0x2b')]=qs['filters'](_[_0x2f66('0x2c')](_0x582185[_0x2f66('0x20')],_0x2fa876[_0x2f66('0x22')]),_0x599cce);if(_0x582185['query'][_0x2f66('0x2d')]){_0x267318[_0x2f66('0x2b')]=_[_0x2f66('0x2e')](_0x267318[_0x2f66('0x2b')],{'$or':_['map'](_0x599cce,function(_0xfc2b14){if(_0xfc2b14[_0x2f66('0x2f')]!=='VIRTUAL'){var _0x262564={};_0x262564[_0xfc2b14[_0x2f66('0x16')]]={'$like':'%'+_0x582185[_0x2f66('0x20')][_0x2f66('0x2d')]+'%'};return _0x262564;}})});}_0x267318=_[_0x2f66('0x2e')]({},_0x267318,_0x582185[_0x2f66('0x30')]);var _0x43933b={'where':_0x267318['where']};return db['CloudProvider'][_0x2f66('0x12')](_0x43933b)[_0x2f66('0x14')](function(_0xcf2995){_0x2d0b90[_0x2f66('0x12')]=_0xcf2995;if(_0x582185[_0x2f66('0x20')][_0x2f66('0x31')]){_0x267318[_0x2f66('0x32')]=[{'all':!![]}];}return db[_0x2f66('0x1a')][_0x2f66('0x33')](_0x267318);})[_0x2f66('0x14')](function(_0x3988f5){_0x2d0b90[_0x2f66('0x34')]=_[_0x2f66('0x1f')](_0x3988f5,function(_0x2d88e2){if(_0x2d88e2['service']===_0x2f66('0x35')){var _0x127045=encryptor['decryptString'](_0x2d88e2[_0x2f66('0x36')]);_0x2d88e2[_0x2f66('0x36')]=maskClientSecret(_0x127045);}return _0x2d88e2;});return _0x2d0b90;})[_0x2f66('0x14')](respondWithFilteredResult(_0x27cc4f,_0x267318))[_0x2f66('0x37')](handleError(_0x27cc4f,null));};exports[_0x2f66('0x38')]=function(_0x46079f,_0x174ca9){var _0x2dd6a5={'raw':!![],'where':{'id':_0x46079f[_0x2f66('0x39')]['id']}},_0x1a8ce3={};_0x1a8ce3[_0x2f66('0x1e')]=_['keys'](db[_0x2f66('0x1a')][_0x2f66('0x1b')]);_0x1a8ce3['query']=_[_0x2f66('0x21')](_0x46079f[_0x2f66('0x20')]);_0x1a8ce3['filters']=_[_0x2f66('0x23')](_0x1a8ce3[_0x2f66('0x1e')],_0x1a8ce3[_0x2f66('0x20')]);_0x2dd6a5[_0x2f66('0x24')]=_[_0x2f66('0x23')](_0x1a8ce3['model'],qs[_0x2f66('0x25')](_0x46079f[_0x2f66('0x20')][_0x2f66('0x25')]));_0x2dd6a5[_0x2f66('0x24')]=_0x2dd6a5['attributes'][_0x2f66('0x26')]?_0x2dd6a5['attributes']:_0x1a8ce3['model'];if(_0x46079f[_0x2f66('0x20')]['includeAll']){_0x2dd6a5[_0x2f66('0x32')]=[{'all':!![]}];}_0x2dd6a5=_['merge']({},_0x2dd6a5,_0x46079f[_0x2f66('0x30')]);return db['CloudProvider'][_0x2f66('0x3a')](_0x2dd6a5)[_0x2f66('0x14')](handleEntityNotFound(_0x174ca9,null))[_0x2f66('0x14')](function(_0x44b218){if(_0x44b218[_0x2f66('0x3b')]===_0x2f66('0x35')){var _0x3bf784=encryptor[_0x2f66('0x3c')](_0x44b218['data3']);_0x44b218[_0x2f66('0x36')]=maskClientSecret(_0x3bf784);}return _0x44b218;})[_0x2f66('0x14')](respondWithResult(_0x174ca9,null))[_0x2f66('0x37')](handleError(_0x174ca9,null));};exports[_0x2f66('0x3d')]=function(_0x199572,_0x17616e){if(!_0x199572[_0x2f66('0x3e')][_0x2f66('0x16')])throw new Error(_0x2f66('0x3f'));if(!_0x199572[_0x2f66('0x3e')]['service'])throw new Error(_0x2f66('0x40'));var _0x5819bd=db[_0x2f66('0x1a')]['rawAttributes'][_0x2f66('0x3b')]['values'];if(!_0x5819bd[_0x2f66('0x41')](_0x199572['body'][_0x2f66('0x3b')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5819bd['join'](',\x20'));if(_0x199572[_0x2f66('0x3e')][_0x2f66('0x3b')]===_0x2f66('0x35')&&_0x199572[_0x2f66('0x3e')][_0x2f66('0x36')]){_0x199572['body'][_0x2f66('0x36')]=encryptor[_0x2f66('0x42')](_0x199572[_0x2f66('0x3e')][_0x2f66('0x36')]);}return db[_0x2f66('0x1a')]['create'](_0x199572[_0x2f66('0x3e')],{})[_0x2f66('0x14')](respondWithResult(_0x17616e,0xc9))[_0x2f66('0x37')](handleError(_0x17616e,null));};exports[_0x2f66('0x43')]=function(_0x2c0bf9,_0x1df127){if(_0x2c0bf9[_0x2f66('0x3e')]['id']){delete _0x2c0bf9[_0x2f66('0x3e')]['id'];}return db[_0x2f66('0x1a')][_0x2f66('0x3a')]({'where':{'id':_0x2c0bf9[_0x2f66('0x39')]['id']}})[_0x2f66('0x14')](handleEntityNotFound(_0x1df127,null))[_0x2f66('0x14')](function(_0x47aad5){if(_0x47aad5[_0x2f66('0x3b')]===_0x2f66('0x35')&&_0x2c0bf9[_0x2f66('0x3e')][_0x2f66('0x36')]){_0x2c0bf9[_0x2f66('0x3e')]['data3']=encryptor['encryptString'](_0x2c0bf9[_0x2f66('0x3e')][_0x2f66('0x36')]);}return _0x47aad5;})[_0x2f66('0x14')](saveUpdates(_0x2c0bf9[_0x2f66('0x3e')],null))[_0x2f66('0x14')](respondWithResult(_0x1df127,null))['catch'](handleError(_0x1df127,null));};exports['destroy']=function(_0xb3bc34,_0x4cb337){return db[_0x2f66('0x1a')][_0x2f66('0x3a')]({'where':{'id':_0xb3bc34[_0x2f66('0x39')]['id']}})[_0x2f66('0x14')](handleEntityNotFound(_0x4cb337,null))['then'](removeEntity(_0x4cb337,null))[_0x2f66('0x37')](handleError(_0x4cb337,null));};exports[_0x2f66('0x44')]=function(_0x4613c8,_0x36975e){return db['CloudProvider'][_0x2f66('0x45')]({'where':{'id':_0x4613c8[_0x2f66('0x39')]['id']},'raw':!![]})[_0x2f66('0x14')](function(_0x1dc670){if(!_0x1dc670)return _0x36975e[_0x2f66('0x46')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1dc670,_0x4613c8[_0x2f66('0x47')]['id'])};})['then'](respondWithResult(_0x36975e,null))['catch'](handleError(_0x36975e,null));};exports[_0x2f66('0x48')]=function(_0x5c66f2,_0x635efb){var _0x18f065=_0x5c66f2['body'];var _0x23371a;var _0x1bcef8;if(_0x18f065[_0x2f66('0x15')])throw _0x18f065;redis[_0x2f66('0x49')](_0x18f065[_0x2f66('0x4a')])[_0x2f66('0x14')](function(_0x345ac7){if(!_0x345ac7)throw new Error('Invalid\x20state\x20parameter');_0x23371a=JSON[_0x2f66('0x4b')](_0x345ac7);var _0x4bb2a6=Buffer[_0x2f66('0x4c')](_0x18f065[_0x2f66('0x4a')],'base64')[_0x2f66('0x4d')]('ascii');_0x1bcef8=JSON[_0x2f66('0x4b')](_0x4bb2a6);if(!oauth[_0x2f66('0x4e')](_0x18f065[_0x2f66('0x4f')],_0x23371a[_0x2f66('0x50')]))throw new Error(_0x2f66('0x51'));redis['del'](_0x18f065[_0x2f66('0x4a')]);return oauth[_0x2f66('0x52')](_0x18f065['code'],_0x23371a);})['then'](function(_0xb1d2b9){_0x23371a[_0x2f66('0x53')]=_0xb1d2b9[_0x2f66('0x54')];_0x23371a['data6']=_0xb1d2b9['refresh_token'];return db[_0x2f66('0x1a')]['update']({'data5':_0x23371a[_0x2f66('0x53')],'data6':_0x23371a[_0x2f66('0x55')]},{'where':{'id':_0x23371a['id']}});})[_0x2f66('0x14')](function(){oauth[_0x2f66('0x56')](_0x23371a);socket[_0x2f66('0x57')](_0x2f66('0x58'),{'id':_0x1bcef8['id']});return;})['then'](respondWithStatusCode(_0x635efb,null))[_0x2f66('0x37')](function(_0x30210b){if(_0x1bcef8){socket[_0x2f66('0x57')]('microsoftAuthorization:error',{'id':_0x1bcef8['id']});}if(!_0x23371a){logger[_0x2f66('0x15')](_0x2f66('0x59'),_0x30210b);return _0x635efb[_0x2f66('0xc')](0x1f4)[_0x2f66('0x17')](_0x30210b[_0x2f66('0x5a')]);}logger[_0x2f66('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x23371a['id'],JSON[_0x2f66('0x5b')](_0x30210b));});}; \ No newline at end of file +var _0x2d72=['findAll','rows','service','MicrosoftAzure','data3','catch','show','find','Name\x20parameter\x20not\x20specified','body','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','update','params','destroy','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','json','undefined','limit','count','offset','status','then','sendStatus','error','name','send','slice','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','CloudProvider','includeAll','include'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0x2d72,0x1eb));var _0x22d7=function(_0x326d66,_0x4bd108){_0x326d66=_0x326d66-0x0;var _0x244856=_0x2d72[_0x326d66];return _0x244856;};'use strict';var _=require(_0x22d7('0x0'));var Redis=require(_0x22d7('0x1'));var qs=require(_0x22d7('0x2'));var encryptor=require(_0x22d7('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0x22d7('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x22d7('0x5')]=_[_0x22d7('0x6')](config['redis'],{'host':_0x22d7('0x7'),'port':0x18eb});var socket=require(_0x22d7('0x8'))(new Redis(config[_0x22d7('0x5')]));var redis=new Redis(config[_0x22d7('0x5')]);function respondWithStatusCode(_0x3599ca,_0x54e3b3){_0x54e3b3=_0x54e3b3||0xcc;return function(_0x4d2d2f){if(_0x4d2d2f){return _0x3599ca['sendStatus'](_0x54e3b3);}return _0x3599ca['status'](_0x54e3b3)[_0x22d7('0x9')]();};}function respondWithResult(_0x2223bd,_0x41f3f8){_0x41f3f8=_0x41f3f8||0xc8;return function(_0x3f39ea){if(_0x3f39ea){return _0x2223bd['status'](_0x41f3f8)[_0x22d7('0xa')](_0x3f39ea);}};}function respondWithFilteredResult(_0x511ad8,_0x5bf494){return function(_0x1d6e72){if(_0x1d6e72){var _0x2a94ea=typeof _0x5bf494['offset']===_0x22d7('0xb')&&typeof _0x5bf494[_0x22d7('0xc')]===_0x22d7('0xb');var _0x2df1bb=_0x1d6e72[_0x22d7('0xd')];var _0x269a29=_0x2a94ea?0x0:_0x5bf494[_0x22d7('0xe')];var _0x150b67=_0x2a94ea?_0x1d6e72['count']:_0x5bf494['offset']+_0x5bf494[_0x22d7('0xc')];var _0x2c0bef;if(_0x150b67>=_0x2df1bb){_0x150b67=_0x2df1bb;_0x2c0bef=0xc8;}else{_0x2c0bef=0xce;}_0x511ad8[_0x22d7('0xf')](_0x2c0bef);return _0x511ad8['set']('Content-Range',_0x269a29+'-'+_0x150b67+'/'+_0x2df1bb)[_0x22d7('0xa')](_0x1d6e72);}return null;};}function saveUpdates(_0x42447d){return function(_0x6b74e3){if(_0x6b74e3){return _0x6b74e3['update'](_0x42447d)[_0x22d7('0x10')](function(_0x3f1611){return _0x3f1611;});}return null;};}function removeEntity(_0x1b935d){return function(_0x4c2c00){if(_0x4c2c00){return _0x4c2c00['destroy']()[_0x22d7('0x10')](function(){_0x1b935d[_0x22d7('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12535d){return function(_0x319be2){if(!_0x319be2){_0x12535d[_0x22d7('0x11')](0x194);}return _0x319be2;};}function handleError(_0x3037fd,_0x59a67d){_0x59a67d=_0x59a67d||0x1f4;return function(_0x36ba13){logger[_0x22d7('0x12')](_0x36ba13['stack']);if(_0x36ba13[_0x22d7('0x13')]){delete _0x36ba13['name'];}_0x3037fd[_0x22d7('0xf')](_0x59a67d)[_0x22d7('0x14')](_0x36ba13);};}function maskClientSecret(_0x2a5428){return _['padEnd'](_0x2a5428[_0x22d7('0x15')](0x0,0x3),0x14,'*');}exports['index']=function(_0x22487d,_0x42f5cf){var _0x1f3fb4={},_0x4d3a3b={},_0x337edf={'count':0x0,'rows':[]};var _0x27fa59=_['map'](db['CloudProvider'][_0x22d7('0x16')],function(_0x11b246){return{'name':_0x11b246[_0x22d7('0x17')],'type':_0x11b246[_0x22d7('0x18')]['key']};});_0x4d3a3b[_0x22d7('0x19')]=_[_0x22d7('0x1a')](_0x27fa59,_0x22d7('0x13'));_0x4d3a3b[_0x22d7('0x1b')]=_[_0x22d7('0x1c')](_0x22487d[_0x22d7('0x1b')]);_0x4d3a3b[_0x22d7('0x1d')]=_[_0x22d7('0x1e')](_0x4d3a3b['model'],_0x4d3a3b['query']);_0x1f3fb4[_0x22d7('0x1f')]=_[_0x22d7('0x1e')](_0x4d3a3b['model'],qs[_0x22d7('0x20')](_0x22487d['query']['fields']));_0x1f3fb4[_0x22d7('0x1f')]=_0x1f3fb4[_0x22d7('0x1f')][_0x22d7('0x21')]?_0x1f3fb4[_0x22d7('0x1f')]:_0x4d3a3b['model'];if(!_0x22487d[_0x22d7('0x1b')][_0x22d7('0x22')]('nolimit')){_0x1f3fb4[_0x22d7('0xc')]=qs[_0x22d7('0xc')](_0x22487d[_0x22d7('0x1b')][_0x22d7('0xc')]);_0x1f3fb4[_0x22d7('0xe')]=qs[_0x22d7('0xe')](_0x22487d[_0x22d7('0x1b')][_0x22d7('0xe')]);}_0x1f3fb4['order']=qs[_0x22d7('0x23')](_0x22487d[_0x22d7('0x1b')][_0x22d7('0x23')]);_0x1f3fb4[_0x22d7('0x24')]=qs[_0x22d7('0x1d')](_[_0x22d7('0x25')](_0x22487d['query'],_0x4d3a3b[_0x22d7('0x1d')]),_0x27fa59);if(_0x22487d[_0x22d7('0x1b')][_0x22d7('0x26')]){_0x1f3fb4[_0x22d7('0x24')]=_[_0x22d7('0x27')](_0x1f3fb4[_0x22d7('0x24')],{'$or':_['map'](_0x27fa59,function(_0x8de2e1){if(_0x8de2e1[_0x22d7('0x18')]!=='VIRTUAL'){var _0x49cdc4={};_0x49cdc4[_0x8de2e1[_0x22d7('0x13')]]={'$like':'%'+_0x22487d['query']['filter']+'%'};return _0x49cdc4;}})});}_0x1f3fb4=_[_0x22d7('0x27')]({},_0x1f3fb4,_0x22487d['options']);var _0x11c02f={'where':_0x1f3fb4['where']};return db[_0x22d7('0x28')][_0x22d7('0xd')](_0x11c02f)[_0x22d7('0x10')](function(_0x53777d){_0x337edf[_0x22d7('0xd')]=_0x53777d;if(_0x22487d['query'][_0x22d7('0x29')]){_0x1f3fb4[_0x22d7('0x2a')]=[{'all':!![]}];}return db[_0x22d7('0x28')][_0x22d7('0x2b')](_0x1f3fb4);})[_0x22d7('0x10')](function(_0x18f447){_0x337edf[_0x22d7('0x2c')]=_[_0x22d7('0x1a')](_0x18f447,function(_0x18d8be){if(_0x18d8be[_0x22d7('0x2d')]===_0x22d7('0x2e')){var _0x1f2037=encryptor['decryptString'](_0x18d8be['data3']);_0x18d8be[_0x22d7('0x2f')]=maskClientSecret(_0x1f2037);}return _0x18d8be;});return _0x337edf;})[_0x22d7('0x10')](respondWithFilteredResult(_0x42f5cf,_0x1f3fb4))[_0x22d7('0x30')](handleError(_0x42f5cf,null));};exports[_0x22d7('0x31')]=function(_0x5daea2,_0x2e2c56){var _0x16e6e4={'raw':!![],'where':{'id':_0x5daea2['params']['id']}},_0x13853b={};_0x13853b[_0x22d7('0x19')]=_['keys'](db[_0x22d7('0x28')][_0x22d7('0x16')]);_0x13853b['query']=_[_0x22d7('0x1c')](_0x5daea2['query']);_0x13853b[_0x22d7('0x1d')]=_['intersection'](_0x13853b['model'],_0x13853b[_0x22d7('0x1b')]);_0x16e6e4[_0x22d7('0x1f')]=_[_0x22d7('0x1e')](_0x13853b[_0x22d7('0x19')],qs[_0x22d7('0x20')](_0x5daea2[_0x22d7('0x1b')][_0x22d7('0x20')]));_0x16e6e4[_0x22d7('0x1f')]=_0x16e6e4[_0x22d7('0x1f')][_0x22d7('0x21')]?_0x16e6e4['attributes']:_0x13853b[_0x22d7('0x19')];if(_0x5daea2[_0x22d7('0x1b')][_0x22d7('0x29')]){_0x16e6e4[_0x22d7('0x2a')]=[{'all':!![]}];}_0x16e6e4=_[_0x22d7('0x27')]({},_0x16e6e4,_0x5daea2['options']);return db[_0x22d7('0x28')][_0x22d7('0x32')](_0x16e6e4)[_0x22d7('0x10')](handleEntityNotFound(_0x2e2c56,null))[_0x22d7('0x10')](function(_0x13019c){if(_0x13019c[_0x22d7('0x2d')]===_0x22d7('0x2e')){var _0x21ccb8=encryptor['decryptString'](_0x13019c[_0x22d7('0x2f')]);_0x13019c[_0x22d7('0x2f')]=maskClientSecret(_0x21ccb8);}return _0x13019c;})['then'](respondWithResult(_0x2e2c56,null))[_0x22d7('0x30')](handleError(_0x2e2c56,null));};exports['create']=function(_0x53bc37,_0x334b57){if(!_0x53bc37['body']['name'])throw new Error(_0x22d7('0x33'));if(!_0x53bc37[_0x22d7('0x34')][_0x22d7('0x2d')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x131a07=db[_0x22d7('0x28')][_0x22d7('0x16')][_0x22d7('0x2d')][_0x22d7('0x35')];if(!_0x131a07['includes'](_0x53bc37[_0x22d7('0x34')][_0x22d7('0x2d')]))throw new Error(_0x22d7('0x36')+_0x131a07[_0x22d7('0x37')](',\x20'));if(_0x53bc37['body'][_0x22d7('0x2d')]===_0x22d7('0x2e')&&_0x53bc37[_0x22d7('0x34')]['data3']){_0x53bc37[_0x22d7('0x34')][_0x22d7('0x2f')]=encryptor[_0x22d7('0x38')](_0x53bc37['body'][_0x22d7('0x2f')]);}return db[_0x22d7('0x28')][_0x22d7('0x39')](_0x53bc37['body'],{})[_0x22d7('0x10')](respondWithResult(_0x334b57,0xc9))['catch'](handleError(_0x334b57,null));};exports[_0x22d7('0x3a')]=function(_0x484194,_0x5843ad){if(_0x484194[_0x22d7('0x34')]['id']){delete _0x484194[_0x22d7('0x34')]['id'];}return db[_0x22d7('0x28')]['find']({'where':{'id':_0x484194[_0x22d7('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5843ad,null))[_0x22d7('0x10')](function(_0x59e001){if(_0x59e001[_0x22d7('0x2d')]==='MicrosoftAzure'&&_0x484194[_0x22d7('0x34')]['data3']){_0x484194['body']['data3']=encryptor[_0x22d7('0x38')](_0x484194[_0x22d7('0x34')][_0x22d7('0x2f')]);}return _0x59e001;})[_0x22d7('0x10')](saveUpdates(_0x484194[_0x22d7('0x34')],null))[_0x22d7('0x10')](respondWithResult(_0x5843ad,null))[_0x22d7('0x30')](handleError(_0x5843ad,null));};exports[_0x22d7('0x3c')]=function(_0x2b91b9,_0x4cb77e){return db['CloudProvider']['find']({'where':{'id':_0x2b91b9['params']['id']}})[_0x22d7('0x10')](handleEntityNotFound(_0x4cb77e,null))['then'](removeEntity(_0x4cb77e,null))[_0x22d7('0x30')](handleError(_0x4cb77e,null));};exports['oauth2MicrosoftAuthorize']=function(_0x558cd6,_0x332df0){return db[_0x22d7('0x28')][_0x22d7('0x3d')]({'where':{'id':_0x558cd6[_0x22d7('0x3b')]['id']},'raw':!![]})['then'](function(_0x2f4284){if(!_0x2f4284)return _0x332df0[_0x22d7('0x11')](0x194);return{'url':oauth[_0x22d7('0x3e')](_0x2f4284,_0x558cd6['user']['id'])};})[_0x22d7('0x10')](respondWithResult(_0x332df0,null))[_0x22d7('0x30')](handleError(_0x332df0,null));};exports[_0x22d7('0x3f')]=function(_0x3d2c25,_0x25327e){var _0x2b893d=_0x3d2c25[_0x22d7('0x34')];var _0x4fea9f;var _0x3b6dba;if(_0x2b893d[_0x22d7('0x12')])throw _0x2b893d;redis[_0x22d7('0x40')](_0x2b893d[_0x22d7('0x41')])['then'](function(_0x29aeac){if(!_0x29aeac)throw new Error('Invalid\x20state\x20parameter');_0x4fea9f=JSON['parse'](_0x29aeac);var _0x21b9f5=Buffer[_0x22d7('0x42')](_0x2b893d[_0x22d7('0x41')],_0x22d7('0x43'))[_0x22d7('0x44')](_0x22d7('0x45'));_0x3b6dba=JSON[_0x22d7('0x46')](_0x21b9f5);if(!oauth[_0x22d7('0x47')](_0x2b893d[_0x22d7('0x48')],_0x4fea9f[_0x22d7('0x49')]))throw new Error(_0x22d7('0x4a'));redis[_0x22d7('0x4b')](_0x2b893d[_0x22d7('0x41')]);return oauth[_0x22d7('0x4c')](_0x2b893d[_0x22d7('0x4d')],_0x4fea9f);})[_0x22d7('0x10')](function(_0x5b7ced){_0x4fea9f[_0x22d7('0x4e')]=_0x5b7ced[_0x22d7('0x4f')];_0x4fea9f[_0x22d7('0x50')]=_0x5b7ced[_0x22d7('0x51')];return db[_0x22d7('0x28')][_0x22d7('0x3a')]({'data5':_0x4fea9f[_0x22d7('0x4e')],'data6':_0x4fea9f[_0x22d7('0x50')]},{'where':{'id':_0x4fea9f['id']}});})[_0x22d7('0x10')](function(){oauth[_0x22d7('0x52')](_0x4fea9f);socket['emit'](_0x22d7('0x53'),{'id':_0x3b6dba['id']});return;})[_0x22d7('0x10')](respondWithStatusCode(_0x25327e,null))[_0x22d7('0x30')](function(_0x3cae77){if(_0x3b6dba){socket[_0x22d7('0x54')](_0x22d7('0x55'),{'id':_0x3b6dba['id']});}if(!_0x4fea9f){logger[_0x22d7('0x12')](_0x22d7('0x56'),_0x3cae77);return _0x25327e[_0x22d7('0xf')](0x1f4)['send'](_0x3cae77[_0x22d7('0x57')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4fea9f['id'],JSON[_0x22d7('0x58')](_0x3cae77));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index c6e158e..8dc826f 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 _0x83ee=['../../config/environment','./cloudProvider.attributes','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x83ee,0xca));var _0xe83e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x83ee[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xe83e('0x0'));var util=require(_0xe83e('0x1'));var logger=require(_0xe83e('0x2'))(_0xe83e('0x3'));var moment=require(_0xe83e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe83e('0x5'));var rimraf=require(_0xe83e('0x6'));var config=require(_0xe83e('0x7'));var attributes=require(_0xe83e('0x8'));module['exports']=function(_0x444dc3,_0x11d02a){return _0x444dc3['define'](_0xe83e('0x9'),attributes,{'tableName':_0xe83e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7d2=['CloudProvider','lodash','../../config/logger','moment','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x44278,_0x1bd66f){var _0x2d97f9=function(_0x18a1a3){while(--_0x18a1a3){_0x44278['push'](_0x44278['shift']());}};_0x2d97f9(++_0x1bd66f);}(_0xb7d2,0x106));var _0x2b7d=function(_0x1215ff,_0x2303fb){_0x1215ff=_0x1215ff-0x0;var _0x4168ac=_0xb7d2[_0x1215ff];return _0x4168ac;};'use strict';var _=require(_0x2b7d('0x0'));var util=require('util');var logger=require(_0x2b7d('0x1'))('api');var moment=require(_0x2b7d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b7d('0x3'));var rimraf=require(_0x2b7d('0x4'));var config=require('../../config/environment');var attributes=require(_0x2b7d('0x5'));module[_0x2b7d('0x6')]=function(_0x5f0e03,_0x339c9a){return _0x5f0e03[_0x2b7d('0x7')](_0x2b7d('0x8'),attributes,{'tableName':'cloud_providers','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 7303e6d..d42d97d 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 _0x7349=['Dynamics365','data7','/.default','Outlook365','replace','{TENANT_ID}','code','id_token','from','stringify','toString','base64','randomBytes','hex','join','redirect_uri','response_mode','form_post','state','nonce','prompt','oauth2Claims','payload','iss','issuer','aud','audience','unix','exp','resolve','then','data3','refresh_token','data4','data1','decryptString','POST','data2','data5','access_token','update','data6','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','CloudProvider','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7349,0x1ef));var _0x9734=function(_0x11c7a1,_0x1fa47f){_0x11c7a1=_0x11c7a1-0x0;var _0x213d26=_0x7349[_0x11c7a1];return _0x213d26;};'use strict';var _=require(_0x9734('0x0'));var crypto=require(_0x9734('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x9734('0x2'));var Redis=require(_0x9734('0x3'));var rp=require(_0x9734('0x4'));var util=require(_0x9734('0x5'));var encryptor=require(_0x9734('0x6'));var config=require(_0x9734('0x7'));var logger=require('../../config/logger')(_0x9734('0x8'));var schedule=require(_0x9734('0x9'));var db=require('../../mysqldb')['db'];config[_0x9734('0xa')]=_['defaults'](config['redis'],{'host':_0x9734('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x9734('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x9734('0xd'),_0x9734('0xe'),_0x9734('0xf'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x9734('0x10'),_0x9734('0x11')],'Dynamics365':[_0x9734('0xd'),_0x9734('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x9734('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x9734('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x567c4c){var _0x56f7f7=_[_0x9734('0x15')](AZURE_AUTH_SCOPES[_0x567c4c['type']]);if(_0x567c4c[_0x9734('0x16')]===_0x9734('0x17'))_0x56f7f7['push'](_0x567c4c[_0x9734('0x18')]+_0x9734('0x19'));return _0x56f7f7['join']('\x20');}function getAccessTokenScope(_0x13c2d0){if(_0x13c2d0[_0x9734('0x16')]===_0x9734('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x13c2d0['type']===_0x9734('0x17'))return _0x13c2d0[_0x9734('0x18')]+_0x9734('0x19');}function generateMicrosoftAuthorizationUrl(_0x3372bf,_0x207765){var _0x1ed008=MICROSOFT_AUTH_URL[_0x9734('0x1b')](_0x9734('0x1c'),_0x3372bf['data2']);var _0x57ac05=[_0x9734('0x1d'),_0x9734('0x1e')];var _0x105317=Buffer[_0x9734('0x1f')](JSON[_0x9734('0x20')]({'id':_0x207765}))[_0x9734('0x21')](_0x9734('0x22'));var _0x18e376=crypto[_0x9734('0x23')](0x10)[_0x9734('0x21')](_0x9734('0x24'));var _0x3192a8=getAuthorizationScopes(_0x3372bf);var _0x40b772=[{'key':'client_id','value':_0x3372bf['data1']},{'key':'response_type','value':encodeURIComponent(_0x57ac05[_0x9734('0x25')]('\x20'))},{'key':_0x9734('0x26'),'value':_0x3372bf['data4']},{'key':_0x9734('0x27'),'value':_0x9734('0x28')},{'key':'scope','value':encodeURIComponent(_0x3192a8)},{'key':_0x9734('0x29'),'value':_0x105317},{'key':_0x9734('0x2a'),'value':_0x18e376},{'key':_0x9734('0x2b'),'value':'login'}];var _0x38fbfa=_0x1ed008+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x40b772,function(_0x398d99){return _0x398d99['key']+'='+_0x398d99['value'];})[_0x9734('0x25')]('&');_0x3372bf[_0x9734('0x2c')]={'issuer':_0x1ed008[_0x9734('0x1b')]('oauth2/',''),'audience':_0x3372bf['data1'],'state':_0x105317,'nonce':_0x18e376};redis['set'](_0x105317,JSON[_0x9734('0x20')](_0x3372bf));return _0x38fbfa;}function isValidIdToken(_0x4d3882,_0x1d60b5){try{var _0xf05841=jwt['decode'](_0x4d3882,{'complete':!![]});var _0x1f07c3=_0xf05841[_0x9734('0x2d')];if(_0x1f07c3[_0x9734('0x2e')]!==_0x1d60b5[_0x9734('0x2f')])return![];if(_0x1f07c3[_0x9734('0x30')]!==_0x1d60b5[_0x9734('0x31')])return![];if(_0x1f07c3[_0x9734('0x2a')]!==_0x1d60b5[_0x9734('0x2a')])return![];if(moment()['isAfter'](moment[_0x9734('0x32')](_0x1f07c3[_0x9734('0x33')])))return![];return!![];}catch(_0x5b382c){throw _0x5b382c;}}function refreshOauth2MicrosoftAccessToken(_0x3b89a6){return Promise[_0x9734('0x34')]()[_0x9734('0x35')](function(){if(_0x3b89a6[_0x9734('0x36')])return _0x3b89a6;return db['CloudProvider']['findOne']({'where':{'id':_0x3b89a6['id']},'raw':!![]});})[_0x9734('0x35')](function(_0x3c2200){var _0x5a240a={'grant_type':_0x9734('0x37'),'refresh_token':_0x3c2200['data6'],'scope':getAccessTokenScope(_0x3c2200),'redirect_uri':_0x3c2200[_0x9734('0x38')],'client_id':_0x3c2200[_0x9734('0x39')],'client_secret':encryptor[_0x9734('0x3a')](_0x3c2200['data3'])};var _0x1e53dc={'method':_0x9734('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x9734('0x1b')](_0x9734('0x1c'),_0x3c2200[_0x9734('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5a240a,'json':!![]};return rp(_0x1e53dc);})[_0x9734('0x35')](function(_0x272590){_0x3b89a6[_0x9734('0x3d')]=_0x272590[_0x9734('0x3e')];_0x3b89a6['data6']=_0x272590[_0x9734('0x37')];return db['CloudProvider'][_0x9734('0x3f')]({'data5':_0x3b89a6[_0x9734('0x3d')],'data6':_0x3b89a6[_0x9734('0x40')]},{'where':{'id':_0x3b89a6['id']}});})[_0x9734('0x35')](function(){return _0x3b89a6;})[_0x9734('0x41')](function(_0x42e64b){logger[_0x9734('0x42')](_0x9734('0x43'),_0x3b89a6['id'],_0x42e64b);});}function getOauth2MicrosoftAccessToken(_0x1f6ffd,_0x259e3a){var _0x10a6cf={'grant_type':_0x9734('0x44'),'code':_0x1f6ffd,'scope':getAccessTokenScope(_0x259e3a),'redirect_uri':_0x259e3a[_0x9734('0x38')],'client_id':_0x259e3a['data1'],'client_secret':encryptor['decryptString'](_0x259e3a[_0x9734('0x36')])};var _0x2b4bea={'method':_0x9734('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x9734('0x1b')]('{TENANT_ID}',_0x259e3a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10a6cf,'json':!![]};return rp(_0x2b4bea);}function startRefreshInterval(_0x23146a){var _0x1b6416=schedule[_0x9734('0x45')];if(_0x1b6416[_0x23146a['id']])clearInterval(_0x1b6416[_0x23146a['id']]);_0x1b6416[_0x23146a['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x23146a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9734('0x45')]=_0x1b6416;}function startAllRefreshIntervals(){return db[_0x9734('0x46')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9734('0x35')](function(_0xae0472){var _0x2e1c98=_0xae0472[_0x9734('0x15')](function(_0x1d6be2){return refreshOauth2MicrosoftAccessToken(_0x1d6be2)[_0x9734('0x35')](function(_0x5cac26){startRefreshInterval(_0x5cac26);});});return Promise[_0x9734('0x47')](_0x2e1c98);})['catch'](function(_0x2afed8){var _0x15de2a=_0x2afed8?util[_0x9734('0x48')](_0x2afed8,{'showHidden':![],'depth':null}):'';logger[_0x9734('0x42')](_0x9734('0x49'),_0x15de2a);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x996d=['https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','response_mode','form_post','scope','state','login','value','oauth2Claims','oauth2/','set','iss','issuer','aud','audience','nonce','isAfter','unix','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','intervals','bind','findAll','all','catch','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost'];(function(_0x35a156,_0x52f6d1){var _0x585716=function(_0x43698b){while(--_0x43698b){_0x35a156['push'](_0x35a156['shift']());}};_0x585716(++_0x52f6d1);}(_0x996d,0x12e));var _0xd996=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x996d[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xd996('0x0'));var crypto=require(_0xd996('0x1'));var jwt=require(_0xd996('0x2'));var moment=require(_0xd996('0x3'));var Redis=require(_0xd996('0x4'));var rp=require(_0xd996('0x5'));var util=require(_0xd996('0x6'));var encryptor=require(_0xd996('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xd996('0x8'));var schedule=require(_0xd996('0x9'));var db=require(_0xd996('0xa'))['db'];config['redis']=_[_0xd996('0xb')](config[_0xd996('0xc')],{'host':_0xd996('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xd996('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xd996('0xf'),_0xd996('0x10'),_0xd996('0x11'),_0xd996('0x12'),_0xd996('0x13'),_0xd996('0x14')],'Dynamics365':[_0xd996('0x15'),_0xd996('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xd996('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0xd996('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1d9d8a){var _0x43a064=_[_0xd996('0x18')](AZURE_AUTH_SCOPES[_0x1d9d8a[_0xd996('0x19')]]);if(_0x1d9d8a['type']===_0xd996('0x1a'))_0x43a064['push'](_0x1d9d8a[_0xd996('0x1b')]+_0xd996('0x1c'));return _0x43a064[_0xd996('0x1d')]('\x20');}function getAccessTokenScope(_0xd18e1f){if(_0xd18e1f[_0xd996('0x19')]===_0xd996('0x1e'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0xd18e1f['type']==='Dynamics365')return _0xd18e1f['data7']+_0xd996('0x1c');}function generateMicrosoftAuthorizationUrl(_0x4d0d47,_0x593cae){var _0x2ceeed=MICROSOFT_AUTH_URL[_0xd996('0x1f')]('{TENANT_ID}',_0x4d0d47[_0xd996('0x20')]);var _0x577fb2=[_0xd996('0x21'),_0xd996('0x22')];var _0x1657d5=Buffer[_0xd996('0x23')](JSON[_0xd996('0x24')]({'id':_0x593cae}))[_0xd996('0x25')](_0xd996('0x26'));var _0x9a5f19=crypto[_0xd996('0x27')](0x10)[_0xd996('0x25')](_0xd996('0x28'));var _0x2e2160=getAuthorizationScopes(_0x4d0d47);var _0x28331c=[{'key':_0xd996('0x29'),'value':_0x4d0d47[_0xd996('0x2a')]},{'key':'response_type','value':encodeURIComponent(_0x577fb2[_0xd996('0x1d')]('\x20'))},{'key':_0xd996('0x2b'),'value':_0x4d0d47['data4']},{'key':_0xd996('0x2c'),'value':_0xd996('0x2d')},{'key':_0xd996('0x2e'),'value':encodeURIComponent(_0x2e2160)},{'key':_0xd996('0x2f'),'value':_0x1657d5},{'key':'nonce','value':_0x9a5f19},{'key':'prompt','value':_0xd996('0x30')}];var _0x5db36e=_0x2ceeed+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd996('0x18')](_0x28331c,function(_0x17582f){return _0x17582f['key']+'='+_0x17582f[_0xd996('0x31')];})['join']('&');_0x4d0d47[_0xd996('0x32')]={'issuer':_0x2ceeed[_0xd996('0x1f')](_0xd996('0x33'),''),'audience':_0x4d0d47[_0xd996('0x2a')],'state':_0x1657d5,'nonce':_0x9a5f19};redis[_0xd996('0x34')](_0x1657d5,JSON[_0xd996('0x24')](_0x4d0d47));return _0x5db36e;}function isValidIdToken(_0x378ba0,_0x366f88){try{var _0x2127e2=jwt['decode'](_0x378ba0,{'complete':!![]});var _0x21c265=_0x2127e2['payload'];if(_0x21c265[_0xd996('0x35')]!==_0x366f88[_0xd996('0x36')])return![];if(_0x21c265[_0xd996('0x37')]!==_0x366f88[_0xd996('0x38')])return![];if(_0x21c265[_0xd996('0x39')]!==_0x366f88[_0xd996('0x39')])return![];if(moment()[_0xd996('0x3a')](moment[_0xd996('0x3b')](_0x21c265['exp'])))return![];return!![];}catch(_0x21cf69){throw _0x21cf69;}}function refreshOauth2MicrosoftAccessToken(_0x237163){return Promise[_0xd996('0x3c')]()[_0xd996('0x3d')](function(){if(_0x237163['data3'])return _0x237163;return db[_0xd996('0x3e')][_0xd996('0x3f')]({'where':{'id':_0x237163['id']},'raw':!![]});})['then'](function(_0x4e7d7e){var _0x472c64={'grant_type':_0xd996('0x40'),'refresh_token':_0x4e7d7e[_0xd996('0x41')],'scope':getAccessTokenScope(_0x4e7d7e),'redirect_uri':_0x4e7d7e[_0xd996('0x42')],'client_id':_0x4e7d7e['data1'],'client_secret':encryptor[_0xd996('0x43')](_0x4e7d7e['data3'])};var _0x41e48c={'method':_0xd996('0x44'),'uri':MICROSOFT_AUTH_URL[_0xd996('0x1f')]('{TENANT_ID}',_0x4e7d7e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x472c64,'json':!![]};return rp(_0x41e48c);})[_0xd996('0x3d')](function(_0x55e7a0){_0x237163[_0xd996('0x45')]=_0x55e7a0['access_token'];_0x237163[_0xd996('0x41')]=_0x55e7a0['refresh_token'];return db[_0xd996('0x3e')]['update']({'data5':_0x237163[_0xd996('0x45')],'data6':_0x237163[_0xd996('0x41')]},{'where':{'id':_0x237163['id']}});})[_0xd996('0x3d')](function(){return _0x237163;})['catch'](function(_0x3f994a){logger['error'](_0xd996('0x46'),_0x237163['id'],_0x3f994a);});}function getOauth2MicrosoftAccessToken(_0x53bb56,_0x3ae8d4){var _0x3aa0a9={'grant_type':_0xd996('0x47'),'code':_0x53bb56,'scope':getAccessTokenScope(_0x3ae8d4),'redirect_uri':_0x3ae8d4[_0xd996('0x42')],'client_id':_0x3ae8d4['data1'],'client_secret':encryptor[_0xd996('0x43')](_0x3ae8d4[_0xd996('0x48')])};var _0x38898d={'method':_0xd996('0x44'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3ae8d4[_0xd996('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3aa0a9,'json':!![]};return rp(_0x38898d);}function startRefreshInterval(_0xadf6a3){var _0x3b33d4=schedule[_0xd996('0x49')];if(_0x3b33d4[_0xadf6a3['id']])clearInterval(_0x3b33d4[_0xadf6a3['id']]);_0x3b33d4[_0xadf6a3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd996('0x4a')](this,{'id':_0xadf6a3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd996('0x49')]=_0x3b33d4;}function startAllRefreshIntervals(){return db[_0xd996('0x3e')][_0xd996('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd996('0x3d')](function(_0x10c1bc){var _0x242632=_0x10c1bc['map'](function(_0xa64be6){return refreshOauth2MicrosoftAccessToken(_0xa64be6)[_0xd996('0x3d')](function(_0x468d99){startRefreshInterval(_0x468d99);});});return Promise[_0xd996('0x4c')](_0x242632);})[_0xd996('0x4d')](function(_0x4094f9){var _0x412ef0=_0x4094f9?util['inspect'](_0x4094f9,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x412ef0);});}module[_0xd996('0x4e')]={'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 0243ee5..5bdfb45 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 _0xdfdd=['request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s'];(function(_0x38d499,_0x1cbb6b){var _0x274b18=function(_0x488d64){while(--_0x488d64){_0x38d499['push'](_0x38d499['shift']());}};_0x274b18(++_0x1cbb6b);}(_0xdfdd,0x104));var _0xddfd=function(_0x4f18db,_0x171f26){_0x4f18db=_0x4f18db-0x0;var _0x324e7d=_0xdfdd[_0x4f18db];return _0x324e7d;};'use strict';var _=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var moment=require(_0xddfd('0x2'));var BPromise=require(_0xddfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddfd('0x5'));var logger=require('../../config/logger')(_0xddfd('0x6'));var config=require(_0xddfd('0x7'));var jayson=require(_0xddfd('0x8'));var client=jayson[_0xddfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fcbc,_0x485ede,_0x2e8f21){return new BPromise(function(_0x45bdd0,_0xf134d7){return client[_0xddfd('0xa')](_0x25fcbc,_0x2e8f21)[_0xddfd('0xb')](function(_0x2a3b1e){logger['info'](_0xddfd('0xc'),_0x485ede,_0xddfd('0xd'));logger['debug'](_0xddfd('0xe'),_0x485ede,_0xddfd('0xd'),JSON[_0xddfd('0xf')](_0x2a3b1e));if(_0x2a3b1e[_0xddfd('0x10')]){if(_0x2a3b1e[_0xddfd('0x10')]['code']===0x1f4){logger[_0xddfd('0x10')]('CloudProvider,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')]['message']);return _0xf134d7(_0x2a3b1e[_0xddfd('0x10')]['message']);}logger[_0xddfd('0x10')]('CloudProvider,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);return _0x45bdd0(_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);}else{logger[_0xddfd('0x12')]('CloudProvider,\x20%s,\x20%s',_0x485ede,_0xddfd('0xd'));_0x45bdd0(_0x2a3b1e[_0xddfd('0x13')][_0xddfd('0x11')]);}})[_0xddfd('0x14')](function(_0xa85d01){logger[_0xddfd('0x10')](_0xddfd('0xc'),_0x485ede,_0xa85d01);_0xf134d7(_0xa85d01);});});} \ No newline at end of file +var _0x119c=['rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x592ac7,_0x22d05f){var _0x122bcd=function(_0x42edda){while(--_0x42edda){_0x592ac7['push'](_0x592ac7['shift']());}};_0x122bcd(++_0x22d05f);}(_0x119c,0xea));var _0xc119=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x119c[_0x3e8270];return _0x1ccde9;};'use strict';var _=require('lodash');var util=require(_0xc119('0x0'));var moment=require('moment');var BPromise=require(_0xc119('0x1'));var rs=require(_0xc119('0x2'));var fs=require('fs');var Redis=require(_0xc119('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc119('0x4'));var logger=require(_0xc119('0x5'))(_0xc119('0x6'));var config=require('../../config/environment');var jayson=require(_0xc119('0x7'));var client=jayson['client'][_0xc119('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57bc8a,_0x16b3d2,_0x3dbd20){return new BPromise(function(_0x900301,_0x312f19){return client[_0xc119('0x9')](_0x57bc8a,_0x3dbd20)[_0xc119('0xa')](function(_0x367745){logger[_0xc119('0xb')](_0xc119('0xc'),_0x16b3d2,_0xc119('0xd'));logger[_0xc119('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x16b3d2,_0xc119('0xd'),JSON['stringify'](_0x367745));if(_0x367745[_0xc119('0xf')]){if(_0x367745[_0xc119('0xf')][_0xc119('0x10')]===0x1f4){logger[_0xc119('0xf')](_0xc119('0xc'),_0x16b3d2,_0x367745[_0xc119('0xf')]['message']);return _0x312f19(_0x367745['error'][_0xc119('0x11')]);}logger[_0xc119('0xf')](_0xc119('0xc'),_0x16b3d2,_0x367745[_0xc119('0xf')][_0xc119('0x11')]);return _0x900301(_0x367745['error'][_0xc119('0x11')]);}else{logger['info'](_0xc119('0xc'),_0x16b3d2,_0xc119('0xd'));_0x900301(_0x367745[_0xc119('0x12')][_0xc119('0x11')]);}})[_0xc119('0x13')](function(_0x3645e9){logger[_0xc119('0xf')](_0xc119('0xc'),_0x16b3d2,_0x3645e9);_0x312f19(_0x3645e9);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index fac9197..6ee765a 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 _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(_0x1d5163,_0x379b8f){var _0x13c8a1=function(_0x15a1cc){while(--_0x15a1cc){_0x1d5163['push'](_0x1d5163['shift']());}};_0x13c8a1(++_0x379b8f);}(_0xdb28,0x106));var _0x8db2=function(_0x282efd,_0x25b1d2){_0x282efd=_0x282efd-0x0;var _0x4996d4=_0xdb28[_0x282efd];return _0x4996d4;};'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 +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0xd3ed32,_0x4a0173){var _0x4efdbe=function(_0x2943cc){while(--_0x2943cc){_0xd3ed32['push'](_0xd3ed32['shift']());}};_0x4efdbe(++_0x4a0173);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index f06f0ed..1f1357e 100644 --- a/server/api/cmCompany/cmCompany.attributes.js +++ b/server/api/cmCompany/cmCompany.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x76aa=['exports','STRING','name'];(function(_0xf65af5,_0x105a0e){var _0x35b1a1=function(_0xcce241){while(--_0xcce241){_0xf65af5['push'](_0xf65af5['shift']());}};_0x35b1a1(++_0x105a0e);}(_0x76aa,0xc0));var _0xa76a=function(_0x130282,_0x45538f){_0x130282=_0x130282-0x0;var _0x43aec3=_0x76aa[_0x130282];return _0x43aec3;};'use strict';var Sequelize=require('sequelize');module[_0xa76a('0x0')]={'name':{'type':Sequelize[_0xa76a('0x1')],'unique':_0xa76a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa76a('0x1')]},'companyId':{'type':Sequelize[_0xa76a('0x1')]},'website':{'type':Sequelize[_0xa76a('0x1')]},'phone':{'type':Sequelize[_0xa76a('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa76a('0x1')]},'street':{'type':Sequelize[_0xa76a('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa76a('0x1')]},'country':{'type':Sequelize[_0xa76a('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa76a('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa76a('0x1')]},'sCountry':{'type':Sequelize[_0xa76a('0x1')]},'description':{'type':Sequelize[_0xa76a('0x1')]}}; \ No newline at end of file +var _0x7271=['STRING','name','sequelize','exports'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7271,0x14a));var _0x1727=function(_0x34db63,_0x171a9b){_0x34db63=_0x34db63-0x0;var _0x1cd44d=_0x7271[_0x34db63];return _0x1cd44d;};'use strict';var Sequelize=require(_0x1727('0x0'));module[_0x1727('0x1')]={'name':{'type':Sequelize[_0x1727('0x2')],'unique':_0x1727('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1727('0x2')]},'companyId':{'type':Sequelize[_0x1727('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1727('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x1727('0x2')]},'postalCode':{'type':Sequelize[_0x1727('0x2')]},'city':{'type':Sequelize[_0x1727('0x2')]},'country':{'type':Sequelize[_0x1727('0x2')]},'email':{'type':Sequelize[_0x1727('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1727('0x2')]},'sStreet':{'type':Sequelize[_0x1727('0x2')]},'sPostalCode':{'type':Sequelize[_0x1727('0x2')]},'sCity':{'type':Sequelize[_0x1727('0x2')]},'sCountry':{'type':Sequelize[_0x1727('0x2')]},'description':{'type':Sequelize[_0x1727('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 292a804..89e5e33 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 _0x180d=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x180d,0xf4));var _0xd180=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x180d[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0xd180('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd180('0x1'));var rp=require(_0xd180('0x2'));var moment=require(_0xd180('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd180('0x4'));var path=require('path');var sox=require(_0xd180('0x5'));var csv=require(_0xd180('0x6'));var ejs=require(_0xd180('0x7'));var fs=require('fs');var fs_extra=require(_0xd180('0x8'));var _=require(_0xd180('0x9'));var squel=require(_0xd180('0xa'));var crypto=require(_0xd180('0xb'));var jsforce=require(_0xd180('0xc'));var deskjs=require(_0xd180('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd180('0xe'));var Papa=require('papaparse');var Redis=require(_0xd180('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd180('0x10'));var as=require(_0xd180('0x11'));var hardwareService=require(_0xd180('0x12'));var logger=require('../../config/logger')(_0xd180('0x13'));var utils=require('../../config/utils');var config=require(_0xd180('0x14'));var licenseUtil=require(_0xd180('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aa098,_0x1e011d){_0x1e011d=_0x1e011d||0xcc;return function(_0x531121){if(_0x531121){return _0x4aa098[_0xd180('0x16')](_0x1e011d);}return _0x4aa098[_0xd180('0x17')](_0x1e011d)[_0xd180('0x18')]();};}function respondWithResult(_0x24c6ac,_0x53e949){_0x53e949=_0x53e949||0xc8;return function(_0x2580ea){if(_0x2580ea){return _0x24c6ac[_0xd180('0x17')](_0x53e949)[_0xd180('0x19')](_0x2580ea);}};}function respondWithFilteredResult(_0xebed2e,_0x181e40){return function(_0xd04274){if(_0xd04274){var _0x44490b=typeof _0x181e40[_0xd180('0x1a')]===_0xd180('0x1b')&&typeof _0x181e40[_0xd180('0x1c')]===_0xd180('0x1b');var _0x258747=_0xd04274[_0xd180('0x1d')];var _0x57aed9=_0x44490b?0x0:_0x181e40['offset'];var _0x14e2c9=_0x44490b?_0xd04274[_0xd180('0x1d')]:_0x181e40['offset']+_0x181e40[_0xd180('0x1c')];var _0x6769b7;if(_0x14e2c9>=_0x258747){_0x14e2c9=_0x258747;_0x6769b7=0xc8;}else{_0x6769b7=0xce;}_0xebed2e['status'](_0x6769b7);return _0xebed2e[_0xd180('0x1e')]('Content-Range',_0x57aed9+'-'+_0x14e2c9+'/'+_0x258747)[_0xd180('0x19')](_0xd04274);}return null;};}function patchUpdates(_0x271135){return function(_0x347e94){try{jsonpatch[_0xd180('0x1f')](_0x347e94,_0x271135,!![]);}catch(_0x472d7f){return BPromise[_0xd180('0x20')](_0x472d7f);}return _0x347e94[_0xd180('0x21')]();};}function saveUpdates(_0x16b078,_0x189dd3){return function(_0x493222){if(_0x493222){return _0x493222[_0xd180('0x22')](_0x16b078)[_0xd180('0x23')](function(_0x1c903e){return _0x1c903e;});}return null;};}function removeEntity(_0x2d7ad1,_0x5592a4){return function(_0x31c2af){if(_0x31c2af){return _0x31c2af[_0xd180('0x24')]()['then'](function(){var _0x2026ca=_0x31c2af[_0xd180('0x25')]({'plain':!![]});var _0x3b4f20=_0xd180('0x26');return db[_0xd180('0x27')][_0xd180('0x24')]({'where':{'type':_0x3b4f20,'resourceId':_0x2026ca['id']}})[_0xd180('0x23')](function(){return _0x31c2af;});})[_0xd180('0x23')](function(){_0x2d7ad1[_0xd180('0x17')](0xcc)[_0xd180('0x18')]();});}};}function handleEntityNotFound(_0x4f5893,_0xffc871){return function(_0x36f81b){if(!_0x36f81b){_0x4f5893['sendStatus'](0x194);}return _0x36f81b;};}function handleError(_0x39a6ac,_0x36dcae){_0x36dcae=_0x36dcae||0x1f4;return function(_0x48f0f3){logger['error'](_0x48f0f3[_0xd180('0x28')]);if(_0x48f0f3[_0xd180('0x29')]){delete _0x48f0f3[_0xd180('0x29')];}_0x39a6ac['status'](_0x36dcae)[_0xd180('0x2a')](_0x48f0f3);};}exports[_0xd180('0x2b')]=function(_0x3e6c57,_0x3c7e24){var _0x4f35ba={},_0x5430e8={},_0x4bb029={'count':0x0,'rows':[]};return db[_0xd180('0x2c')][_0xd180('0x2d')]()['then'](function(_0x146620){_0x5430e8[_0xd180('0x2e')]=_[_0xd180('0x2f')](_0x146620);_0x5430e8[_0xd180('0x30')]=_[_0xd180('0x2f')](_0x3e6c57[_0xd180('0x30')]);_0x5430e8[_0xd180('0x31')]=_[_0xd180('0x32')](_0x5430e8[_0xd180('0x2e')],_0x5430e8['query']);_0x4f35ba[_0xd180('0x33')]=_[_0xd180('0x32')](_0x5430e8['model'],qs['fields'](_0x3e6c57[_0xd180('0x30')][_0xd180('0x34')]));_0x4f35ba[_0xd180('0x33')]=_0x4f35ba[_0xd180('0x33')][_0xd180('0x35')]?_0x4f35ba[_0xd180('0x33')]:_0x5430e8[_0xd180('0x2e')];if(!_0x3e6c57['query']['hasOwnProperty'](_0xd180('0x36'))){_0x4f35ba[_0xd180('0x1c')]=qs[_0xd180('0x1c')](_0x3e6c57[_0xd180('0x30')][_0xd180('0x1c')]);_0x4f35ba[_0xd180('0x1a')]=qs[_0xd180('0x1a')](_0x3e6c57['query'][_0xd180('0x1a')]);}_0x4f35ba[_0xd180('0x37')]=qs[_0xd180('0x38')](_0x3e6c57['query']['sort']);_0x4f35ba['where']=qs[_0xd180('0x31')](_[_0xd180('0x39')](_0x3e6c57['query'],_0x5430e8[_0xd180('0x31')]),_0x146620);if(_0x3e6c57[_0xd180('0x30')][_0xd180('0x3a')]){_0x4f35ba[_0xd180('0x3b')]=_[_0xd180('0x3c')](_0x4f35ba[_0xd180('0x3b')],{'$or':_[_0xd180('0x3d')](_0x4f35ba['attributes'],function(_0x3e623e){var _0x1b0bd0={};_0x1b0bd0[_0x3e623e]={'$like':'%'+_0x3e6c57[_0xd180('0x30')][_0xd180('0x3a')]+'%'};return _0x1b0bd0;})});}_0x4f35ba=_['merge']({},_0x4f35ba,_0x3e6c57[_0xd180('0x3e')]);var _0x4b7935={'where':_0x4f35ba['where']};return db[_0xd180('0x2c')][_0xd180('0x1d')](_0x4b7935)[_0xd180('0x23')](function(_0x187029){_0x4bb029[_0xd180('0x1d')]=_0x187029;if(_0x3e6c57[_0xd180('0x30')][_0xd180('0x3f')]){_0x4f35ba[_0xd180('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0xd180('0x41')](_0x4f35ba);})['then'](function(_0x41f105){_0x4bb029[_0xd180('0x42')]=_0x41f105;return _0x4bb029;})[_0xd180('0x23')](respondWithFilteredResult(_0x3c7e24,_0x4f35ba))[_0xd180('0x43')](handleError(_0x3c7e24,null));})[_0xd180('0x43')](handleError(_0x3c7e24,null));};exports[_0xd180('0x44')]=function(_0x226255,_0x4d9a2d){var _0x397d44={'raw':![],'where':{'id':_0x226255[_0xd180('0x45')]['id']}},_0x5c4cba={};_0x5c4cba['model']=_['keys'](db[_0xd180('0x2c')][_0xd180('0x46')]);_0x5c4cba['query']=_[_0xd180('0x2f')](_0x226255[_0xd180('0x30')]);_0x5c4cba[_0xd180('0x31')]=_[_0xd180('0x32')](_0x5c4cba['model'],_0x5c4cba[_0xd180('0x30')]);_0x397d44[_0xd180('0x33')]=_[_0xd180('0x32')](_0x5c4cba[_0xd180('0x2e')],qs[_0xd180('0x34')](_0x226255['query']['fields']));_0x397d44[_0xd180('0x33')]=_0x397d44[_0xd180('0x33')][_0xd180('0x35')]?_0x397d44[_0xd180('0x33')]:_0x5c4cba['model'];if(_0x226255[_0xd180('0x30')][_0xd180('0x3f')]){_0x397d44['include']=[{'all':!![]}];}_0x397d44=_[_0xd180('0x3c')]({},_0x397d44,_0x226255['options']);return db[_0xd180('0x2c')][_0xd180('0x47')](_0x397d44)[_0xd180('0x23')](handleEntityNotFound(_0x4d9a2d,null))[_0xd180('0x23')](respondWithResult(_0x4d9a2d,null))[_0xd180('0x43')](handleError(_0x4d9a2d,null));};exports[_0xd180('0x48')]=function(_0x2529ad,_0x1455f){return db['CmCompany'][_0xd180('0x48')](_0x2529ad[_0xd180('0x49')],{})[_0xd180('0x23')](function(_0x5f528f){var _0x1d22bd=_0x2529ad[_0xd180('0x4a')][_0xd180('0x25')]({'plain':!![]});if(!_0x1d22bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d22bd[_0xd180('0x4b')]===_0xd180('0x4a')){var _0x406ec8=_0x5f528f[_0xd180('0x25')]({'plain':!![]});var _0x2546de=_0xd180('0x26');return db['UserProfileSection'][_0xd180('0x47')]({'where':{'name':_0x2546de,'userProfileId':_0x1d22bd[_0xd180('0x4c')]},'raw':!![]})[_0xd180('0x23')](function(_0x5f1378){if(_0x5f1378&&_0x5f1378[_0xd180('0x4d')]===0x0){return db[_0xd180('0x27')][_0xd180('0x48')]({'name':_0x406ec8[_0xd180('0x29')],'resourceId':_0x406ec8['id'],'type':_0x5f1378[_0xd180('0x29')],'sectionId':_0x5f1378['id']},{})['then'](function(){return _0x5f528f;});}else{return _0x5f528f;}})[_0xd180('0x43')](function(_0x42adcf){logger[_0xd180('0x4e')](_0xd180('0x4f'),_0x42adcf);throw _0x42adcf;});}return _0x5f528f;})[_0xd180('0x23')](respondWithResult(_0x1455f,0xc9))[_0xd180('0x43')](handleError(_0x1455f,null));};exports[_0xd180('0x22')]=function(_0x150dbd,_0x2c82c4){if(_0x150dbd[_0xd180('0x49')]['id']){delete _0x150dbd[_0xd180('0x49')]['id'];}return db['CmCompany'][_0xd180('0x47')]({'where':{'id':_0x150dbd[_0xd180('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c82c4,null))['then'](saveUpdates(_0x150dbd['body'],null))[_0xd180('0x23')](respondWithResult(_0x2c82c4,null))[_0xd180('0x43')](handleError(_0x2c82c4,null));};exports['destroy']=function(_0x3c27f1,_0x482ec0){return db[_0xd180('0x2c')][_0xd180('0x47')]({'where':{'id':_0x3c27f1[_0xd180('0x45')]['id']}})['then'](handleEntityNotFound(_0x482ec0,null))['then'](removeEntity(_0x482ec0,null))[_0xd180('0x43')](handleError(_0x482ec0,null));};exports['describe']=function(_0x3e498f,_0x300608){return db[_0xd180('0x2c')]['describe']()['then'](respondWithResult(_0x300608,null))[_0xd180('0x43')](handleError(_0x300608,null));};exports[_0xd180('0x50')]=function(_0x15ea62,_0x118a72,_0x587533){return db['CmContact'][_0xd180('0x47')]({'where':{'id':_0x15ea62['params']['id']}})[_0xd180('0x23')](handleEntityNotFound(_0x118a72,null))[_0xd180('0x23')](function(_0x458d19){if(_0x458d19){return _0x458d19[_0xd180('0x50')](_0x15ea62[_0xd180('0x49')][_0xd180('0x51')],_[_0xd180('0x52')](_0x15ea62['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x118a72,null))[_0xd180('0x43')](handleError(_0x118a72,null));};exports[_0xd180('0x53')]=function(_0x296ab5,_0x185905,_0x2d7253){var _0x8eaeb3={};var _0xdc7bd8={};var _0x556ab6;var _0xb1c6b0;return db[_0xd180('0x2c')][_0xd180('0x54')]({'where':{'id':_0x296ab5[_0xd180('0x45')]['id']}})[_0xd180('0x23')](handleEntityNotFound(_0x185905,null))[_0xd180('0x23')](function(_0x3fae54){if(_0x3fae54){_0x556ab6=_0x3fae54;_0xdc7bd8[_0xd180('0x2e')]=_[_0xd180('0x2f')](db[_0xd180('0x55')][_0xd180('0x46')]);_0xdc7bd8['query']=_[_0xd180('0x2f')](_0x296ab5[_0xd180('0x30')]);_0xdc7bd8[_0xd180('0x31')]=_[_0xd180('0x32')](_0xdc7bd8[_0xd180('0x2e')],_0xdc7bd8[_0xd180('0x30')]);_0x8eaeb3[_0xd180('0x33')]=_[_0xd180('0x32')](_0xdc7bd8['model'],qs[_0xd180('0x34')](_0x296ab5[_0xd180('0x30')]['fields']));_0x8eaeb3[_0xd180('0x33')]=_0x8eaeb3['attributes'][_0xd180('0x35')]?_0x8eaeb3['attributes']:_0xdc7bd8[_0xd180('0x2e')];_0x8eaeb3[_0xd180('0x37')]=qs['sort'](_0x296ab5[_0xd180('0x30')]['sort']);_0x8eaeb3[_0xd180('0x3b')]=qs['filters'](_[_0xd180('0x39')](_0x296ab5[_0xd180('0x30')],_0xdc7bd8[_0xd180('0x31')]));if(_0x296ab5[_0xd180('0x30')][_0xd180('0x3a')]){_0x8eaeb3['where']=_[_0xd180('0x3c')](_0x8eaeb3['where'],{'$or':_[_0xd180('0x3d')](_0x8eaeb3[_0xd180('0x33')],function(_0x56d411){var _0x728992={};_0x728992[_0x56d411]={'$like':'%'+_0x296ab5[_0xd180('0x30')]['filter']+'%'};return _0x728992;})});}_0x8eaeb3=_['merge']({},_0x8eaeb3,_0x296ab5[_0xd180('0x3e')]);return _0x556ab6['getContacts'](_0x8eaeb3);}})[_0xd180('0x23')](function(_0x4f87d5){if(_0x4f87d5){_0xb1c6b0=_0x4f87d5[_0xd180('0x35')];if(!_0x296ab5[_0xd180('0x30')][_0xd180('0x56')](_0xd180('0x36'))){_0x8eaeb3[_0xd180('0x1c')]=qs['limit'](_0x296ab5[_0xd180('0x30')][_0xd180('0x1c')]);_0x8eaeb3[_0xd180('0x1a')]=qs[_0xd180('0x1a')](_0x296ab5[_0xd180('0x30')][_0xd180('0x1a')]);}return _0x556ab6[_0xd180('0x53')](_0x8eaeb3);}})['then'](function(_0x328587){if(_0x328587){return _0x328587?{'count':_0xb1c6b0,'rows':_0x328587}:null;}})[_0xd180('0x23')](respondWithResult(_0x185905,null))[_0xd180('0x43')](handleError(_0x185905,null));}; \ No newline at end of file +var _0x4838=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','addContacts','ids','omit','getContacts','findOne','CmContact','pick','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','name','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','filter','merge','map','where','CmCompany','include','findAll','rows','catch','rawAttributes','includeAll','options'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x4838,0x1d8));var _0x8483=function(_0x129308,_0x37ad5b){_0x129308=_0x129308-0x0;var _0xdd37de=_0x4838[_0x129308];return _0xdd37de;};'use strict';var emlformat=require(_0x8483('0x0'));var rimraf=require(_0x8483('0x1'));var zipdir=require(_0x8483('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8483('0x3'));var moment=require(_0x8483('0x4'));var BPromise=require(_0x8483('0x5'));var Mustache=require(_0x8483('0x6'));var util=require('util');var path=require(_0x8483('0x7'));var sox=require(_0x8483('0x8'));var csv=require(_0x8483('0x9'));var ejs=require(_0x8483('0xa'));var fs=require('fs');var fs_extra=require(_0x8483('0xb'));var _=require('lodash');var squel=require(_0x8483('0xc'));var crypto=require(_0x8483('0xd'));var jsforce=require(_0x8483('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8483('0x9'));var querystring=require('querystring');var Papa=require(_0x8483('0xf'));var Redis=require(_0x8483('0x10'));var authService=require(_0x8483('0x11'));var qs=require(_0x8483('0x12'));var as=require(_0x8483('0x13'));var hardwareService=require(_0x8483('0x14'));var logger=require(_0x8483('0x15'))(_0x8483('0x16'));var utils=require(_0x8483('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8483('0x18'));var db=require(_0x8483('0x19'))['db'];function respondWithStatusCode(_0x4114d0,_0x1a757b){_0x1a757b=_0x1a757b||0xcc;return function(_0x2e43d5){if(_0x2e43d5){return _0x4114d0[_0x8483('0x1a')](_0x1a757b);}return _0x4114d0[_0x8483('0x1b')](_0x1a757b)[_0x8483('0x1c')]();};}function respondWithResult(_0x337e71,_0x423206){_0x423206=_0x423206||0xc8;return function(_0x4883d7){if(_0x4883d7){return _0x337e71['status'](_0x423206)['json'](_0x4883d7);}};}function respondWithFilteredResult(_0x1a5ef6,_0x297e30){return function(_0x32cac9){if(_0x32cac9){var _0x150981=typeof _0x297e30[_0x8483('0x1d')]==='undefined'&&typeof _0x297e30['limit']===_0x8483('0x1e');var _0x3f4ecb=_0x32cac9[_0x8483('0x1f')];var _0x1919d0=_0x150981?0x0:_0x297e30['offset'];var _0x16d8f7=_0x150981?_0x32cac9[_0x8483('0x1f')]:_0x297e30[_0x8483('0x1d')]+_0x297e30['limit'];var _0xb84277;if(_0x16d8f7>=_0x3f4ecb){_0x16d8f7=_0x3f4ecb;_0xb84277=0xc8;}else{_0xb84277=0xce;}_0x1a5ef6[_0x8483('0x1b')](_0xb84277);return _0x1a5ef6[_0x8483('0x20')](_0x8483('0x21'),_0x1919d0+'-'+_0x16d8f7+'/'+_0x3f4ecb)[_0x8483('0x22')](_0x32cac9);}return null;};}function patchUpdates(_0x2681d9){return function(_0x4512dd){try{jsonpatch[_0x8483('0x23')](_0x4512dd,_0x2681d9,!![]);}catch(_0x5db1e7){return BPromise[_0x8483('0x24')](_0x5db1e7);}return _0x4512dd[_0x8483('0x25')]();};}function saveUpdates(_0x1a6c75,_0x1838b1){return function(_0x239153){if(_0x239153){return _0x239153[_0x8483('0x26')](_0x1a6c75)[_0x8483('0x27')](function(_0x4e2fbc){return _0x4e2fbc;});}return null;};}function removeEntity(_0x2ba9b7,_0x378e63){return function(_0x58fdd4){if(_0x58fdd4){return _0x58fdd4['destroy']()['then'](function(){var _0x208875=_0x58fdd4[_0x8483('0x28')]({'plain':!![]});var _0x2d92dc=_0x8483('0x29');return db[_0x8483('0x2a')][_0x8483('0x2b')]({'where':{'type':_0x2d92dc,'resourceId':_0x208875['id']}})[_0x8483('0x27')](function(){return _0x58fdd4;});})[_0x8483('0x27')](function(){_0x2ba9b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e61e,_0x190765){return function(_0x1eb96d){if(!_0x1eb96d){_0x14e61e[_0x8483('0x1a')](0x194);}return _0x1eb96d;};}function handleError(_0x2b5a2f,_0x107578){_0x107578=_0x107578||0x1f4;return function(_0x1496f0){logger[_0x8483('0x2c')](_0x1496f0[_0x8483('0x2d')]);if(_0x1496f0[_0x8483('0x2e')]){delete _0x1496f0['name'];}_0x2b5a2f['status'](_0x107578)[_0x8483('0x2f')](_0x1496f0);};}exports[_0x8483('0x30')]=function(_0x35d6dd,_0x18b87c){var _0x4fef28={},_0x121ac2={},_0x3c08fa={'count':0x0,'rows':[]};return db['CmCompany'][_0x8483('0x31')]()[_0x8483('0x27')](function(_0x4745dd){_0x121ac2[_0x8483('0x32')]=_[_0x8483('0x33')](_0x4745dd);_0x121ac2[_0x8483('0x34')]=_[_0x8483('0x33')](_0x35d6dd['query']);_0x121ac2[_0x8483('0x35')]=_['intersection'](_0x121ac2[_0x8483('0x32')],_0x121ac2['query']);_0x4fef28['attributes']=_[_0x8483('0x36')](_0x121ac2[_0x8483('0x32')],qs['fields'](_0x35d6dd[_0x8483('0x34')][_0x8483('0x37')]));_0x4fef28[_0x8483('0x38')]=_0x4fef28[_0x8483('0x38')][_0x8483('0x39')]?_0x4fef28['attributes']:_0x121ac2[_0x8483('0x32')];if(!_0x35d6dd[_0x8483('0x34')]['hasOwnProperty'](_0x8483('0x3a'))){_0x4fef28[_0x8483('0x3b')]=qs[_0x8483('0x3b')](_0x35d6dd[_0x8483('0x34')][_0x8483('0x3b')]);_0x4fef28['offset']=qs[_0x8483('0x1d')](_0x35d6dd[_0x8483('0x34')][_0x8483('0x1d')]);}_0x4fef28[_0x8483('0x3c')]=qs[_0x8483('0x3d')](_0x35d6dd[_0x8483('0x34')][_0x8483('0x3d')]);_0x4fef28['where']=qs['filters'](_['pick'](_0x35d6dd[_0x8483('0x34')],_0x121ac2[_0x8483('0x35')]),_0x4745dd);if(_0x35d6dd[_0x8483('0x34')][_0x8483('0x3e')]){_0x4fef28['where']=_[_0x8483('0x3f')](_0x4fef28['where'],{'$or':_[_0x8483('0x40')](_0x4fef28[_0x8483('0x38')],function(_0x582ccf){var _0x522e26={};_0x522e26[_0x582ccf]={'$like':'%'+_0x35d6dd['query']['filter']+'%'};return _0x522e26;})});}_0x4fef28=_[_0x8483('0x3f')]({},_0x4fef28,_0x35d6dd['options']);var _0x16908c={'where':_0x4fef28[_0x8483('0x41')]};return db[_0x8483('0x42')][_0x8483('0x1f')](_0x16908c)[_0x8483('0x27')](function(_0x64a9c2){_0x3c08fa[_0x8483('0x1f')]=_0x64a9c2;if(_0x35d6dd[_0x8483('0x34')]['includeAll']){_0x4fef28[_0x8483('0x43')]=[{'all':!![]}];}return db['CmCompany'][_0x8483('0x44')](_0x4fef28);})['then'](function(_0x405905){_0x3c08fa[_0x8483('0x45')]=_0x405905;return _0x3c08fa;})['then'](respondWithFilteredResult(_0x18b87c,_0x4fef28))[_0x8483('0x46')](handleError(_0x18b87c,null));})['catch'](handleError(_0x18b87c,null));};exports['show']=function(_0x8677dc,_0x3d7ec0){var _0xff5a91={'raw':![],'where':{'id':_0x8677dc['params']['id']}},_0x35d03a={};_0x35d03a['model']=_[_0x8483('0x33')](db[_0x8483('0x42')][_0x8483('0x47')]);_0x35d03a[_0x8483('0x34')]=_[_0x8483('0x33')](_0x8677dc[_0x8483('0x34')]);_0x35d03a[_0x8483('0x35')]=_[_0x8483('0x36')](_0x35d03a[_0x8483('0x32')],_0x35d03a[_0x8483('0x34')]);_0xff5a91[_0x8483('0x38')]=_[_0x8483('0x36')](_0x35d03a[_0x8483('0x32')],qs[_0x8483('0x37')](_0x8677dc[_0x8483('0x34')][_0x8483('0x37')]));_0xff5a91[_0x8483('0x38')]=_0xff5a91[_0x8483('0x38')][_0x8483('0x39')]?_0xff5a91['attributes']:_0x35d03a[_0x8483('0x32')];if(_0x8677dc[_0x8483('0x34')][_0x8483('0x48')]){_0xff5a91['include']=[{'all':!![]}];}_0xff5a91=_[_0x8483('0x3f')]({},_0xff5a91,_0x8677dc[_0x8483('0x49')]);return db[_0x8483('0x42')][_0x8483('0x4a')](_0xff5a91)[_0x8483('0x27')](handleEntityNotFound(_0x3d7ec0,null))[_0x8483('0x27')](respondWithResult(_0x3d7ec0,null))[_0x8483('0x46')](handleError(_0x3d7ec0,null));};exports['create']=function(_0x2c1328,_0x357bb4){return db[_0x8483('0x42')][_0x8483('0x4b')](_0x2c1328[_0x8483('0x4c')],{})[_0x8483('0x27')](function(_0x3237c2){var _0x2c0b65=_0x2c1328['user'][_0x8483('0x28')]({'plain':!![]});if(!_0x2c0b65)throw new Error(_0x8483('0x4d'));if(_0x2c0b65[_0x8483('0x4e')]==='user'){var _0x18f9f=_0x3237c2[_0x8483('0x28')]({'plain':!![]});var _0x566eda=_0x8483('0x29');return db[_0x8483('0x4f')][_0x8483('0x4a')]({'where':{'name':_0x566eda,'userProfileId':_0x2c0b65[_0x8483('0x50')]},'raw':!![]})[_0x8483('0x27')](function(_0x5641c6){if(_0x5641c6&&_0x5641c6[_0x8483('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x18f9f['name'],'resourceId':_0x18f9f['id'],'type':_0x5641c6[_0x8483('0x2e')],'sectionId':_0x5641c6['id']},{})[_0x8483('0x27')](function(){return _0x3237c2;});}else{return _0x3237c2;}})[_0x8483('0x46')](function(_0x15da4d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15da4d);throw _0x15da4d;});}return _0x3237c2;})[_0x8483('0x27')](respondWithResult(_0x357bb4,0xc9))[_0x8483('0x46')](handleError(_0x357bb4,null));};exports['update']=function(_0x55e337,_0x36c52c){if(_0x55e337[_0x8483('0x4c')]['id']){delete _0x55e337[_0x8483('0x4c')]['id'];}return db['CmCompany'][_0x8483('0x4a')]({'where':{'id':_0x55e337[_0x8483('0x52')]['id']}})[_0x8483('0x27')](handleEntityNotFound(_0x36c52c,null))['then'](saveUpdates(_0x55e337[_0x8483('0x4c')],null))[_0x8483('0x27')](respondWithResult(_0x36c52c,null))[_0x8483('0x46')](handleError(_0x36c52c,null));};exports[_0x8483('0x2b')]=function(_0x5e0981,_0x13f31e){return db['CmCompany'][_0x8483('0x4a')]({'where':{'id':_0x5e0981[_0x8483('0x52')]['id']}})[_0x8483('0x27')](handleEntityNotFound(_0x13f31e,null))[_0x8483('0x27')](removeEntity(_0x13f31e,null))['catch'](handleError(_0x13f31e,null));};exports[_0x8483('0x31')]=function(_0x32d4a6,_0x373118){return db['CmCompany']['describe']()['then'](respondWithResult(_0x373118,null))[_0x8483('0x46')](handleError(_0x373118,null));};exports[_0x8483('0x53')]=function(_0x45fd53,_0x364c12,_0x26573c){return db['CmContact']['find']({'where':{'id':_0x45fd53['params']['id']}})[_0x8483('0x27')](handleEntityNotFound(_0x364c12,null))[_0x8483('0x27')](function(_0x20c9e4){if(_0x20c9e4){return _0x20c9e4[_0x8483('0x53')](_0x45fd53['body'][_0x8483('0x54')],_[_0x8483('0x55')](_0x45fd53['body'],[_0x8483('0x54'),'id'])||{});}})['then'](respondWithResult(_0x364c12,null))[_0x8483('0x46')](handleError(_0x364c12,null));};exports[_0x8483('0x56')]=function(_0x3c5493,_0x484ad7,_0x5822f2){var _0x5d0489={};var _0x42f551={};var _0x42e545;var _0x26c6f0;return db[_0x8483('0x42')][_0x8483('0x57')]({'where':{'id':_0x3c5493[_0x8483('0x52')]['id']}})[_0x8483('0x27')](handleEntityNotFound(_0x484ad7,null))[_0x8483('0x27')](function(_0xfc11e0){if(_0xfc11e0){_0x42e545=_0xfc11e0;_0x42f551[_0x8483('0x32')]=_[_0x8483('0x33')](db[_0x8483('0x58')][_0x8483('0x47')]);_0x42f551[_0x8483('0x34')]=_['keys'](_0x3c5493[_0x8483('0x34')]);_0x42f551[_0x8483('0x35')]=_['intersection'](_0x42f551[_0x8483('0x32')],_0x42f551[_0x8483('0x34')]);_0x5d0489['attributes']=_['intersection'](_0x42f551[_0x8483('0x32')],qs['fields'](_0x3c5493[_0x8483('0x34')][_0x8483('0x37')]));_0x5d0489[_0x8483('0x38')]=_0x5d0489[_0x8483('0x38')][_0x8483('0x39')]?_0x5d0489[_0x8483('0x38')]:_0x42f551[_0x8483('0x32')];_0x5d0489[_0x8483('0x3c')]=qs[_0x8483('0x3d')](_0x3c5493[_0x8483('0x34')][_0x8483('0x3d')]);_0x5d0489[_0x8483('0x41')]=qs['filters'](_[_0x8483('0x59')](_0x3c5493[_0x8483('0x34')],_0x42f551[_0x8483('0x35')]));if(_0x3c5493['query'][_0x8483('0x3e')]){_0x5d0489[_0x8483('0x41')]=_[_0x8483('0x3f')](_0x5d0489[_0x8483('0x41')],{'$or':_[_0x8483('0x40')](_0x5d0489[_0x8483('0x38')],function(_0x45eaf4){var _0x43dd1b={};_0x43dd1b[_0x45eaf4]={'$like':'%'+_0x3c5493[_0x8483('0x34')][_0x8483('0x3e')]+'%'};return _0x43dd1b;})});}_0x5d0489=_[_0x8483('0x3f')]({},_0x5d0489,_0x3c5493[_0x8483('0x49')]);return _0x42e545['getContacts'](_0x5d0489);}})[_0x8483('0x27')](function(_0x526d0e){if(_0x526d0e){_0x26c6f0=_0x526d0e[_0x8483('0x39')];if(!_0x3c5493['query'][_0x8483('0x5a')](_0x8483('0x3a'))){_0x5d0489['limit']=qs[_0x8483('0x3b')](_0x3c5493['query']['limit']);_0x5d0489[_0x8483('0x1d')]=qs[_0x8483('0x1d')](_0x3c5493[_0x8483('0x34')][_0x8483('0x1d')]);}return _0x42e545[_0x8483('0x56')](_0x5d0489);}})['then'](function(_0x51604c){if(_0x51604c){return _0x51604c?{'count':_0x26c6f0,'rows':_0x51604c}:null;}})['then'](respondWithResult(_0x484ad7,null))[_0x8483('0x46')](handleError(_0x484ad7,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 2d51dac..53242d5 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 _0x73b4=['CmCompany','cm_companies','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x73b4,0x182));var _0x473b=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x73b4[_0x2f3848];return _0x102668;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x473b('0x0'))(_0x473b('0x1'));var moment=require(_0x473b('0x2'));var BPromise=require(_0x473b('0x3'));var rp=require(_0x473b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x473b('0x5'));var config=require(_0x473b('0x6'));var attributes=require(_0x473b('0x7'));module[_0x473b('0x8')]=function(_0x24fc95,_0x5a34e6){return _0x24fc95[_0x473b('0x9')](_0x473b('0xa'),attributes,{'tableName':_0x473b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf98f=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4ab16b,_0x37c329){var _0x599880=function(_0x460bb6){while(--_0x460bb6){_0x4ab16b['push'](_0x4ab16b['shift']());}};_0x599880(++_0x37c329);}(_0xf98f,0x155));var _0xff98=function(_0x2500f8,_0x1dae67){_0x2500f8=_0x2500f8-0x0;var _0x2e1fd2=_0xf98f[_0x2500f8];return _0x2e1fd2;};'use strict';var _=require(_0xff98('0x0'));var util=require('util');var logger=require(_0xff98('0x1'))(_0xff98('0x2'));var moment=require(_0xff98('0x3'));var BPromise=require(_0xff98('0x4'));var rp=require(_0xff98('0x5'));var fs=require('fs');var path=require(_0xff98('0x6'));var rimraf=require(_0xff98('0x7'));var config=require(_0xff98('0x8'));var attributes=require(_0xff98('0x9'));module[_0xff98('0xa')]=function(_0x123a3a,_0x25db4a){return _0x123a3a[_0xff98('0xb')](_0xff98('0xc'),attributes,{'tableName':_0xff98('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 53a8ea2..ed3e03b 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 _0x1e0a=['CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','message'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x1e0a,0x1d1));var _0xa1e0=function(_0x398299,_0x2f3b68){_0x398299=_0x398299-0x0;var _0x49edc6=_0x1e0a[_0x398299];return _0x49edc6;};'use strict';var _=require(_0xa1e0('0x0'));var util=require(_0xa1e0('0x1'));var moment=require(_0xa1e0('0x2'));var BPromise=require(_0xa1e0('0x3'));var rs=require(_0xa1e0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1e0('0x6'))('rpc');var config=require(_0xa1e0('0x7'));var jayson=require(_0xa1e0('0x8'));var client=jayson[_0xa1e0('0x9')][_0xa1e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cf53e,_0x4cb64d,_0x348159){return new BPromise(function(_0x188882,_0x589f94){return client[_0xa1e0('0xb')](_0x3cf53e,_0x348159)[_0xa1e0('0xc')](function(_0x52fe70){logger['info']('CmCompany,\x20%s,\x20%s',_0x4cb64d,'request\x20sent');logger[_0xa1e0('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4cb64d,_0xa1e0('0xe'),JSON[_0xa1e0('0xf')](_0x52fe70));if(_0x52fe70[_0xa1e0('0x10')]){if(_0x52fe70[_0xa1e0('0x10')][_0xa1e0('0x11')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x4cb64d,_0x52fe70[_0xa1e0('0x10')]['message']);return _0x589f94(_0x52fe70[_0xa1e0('0x10')][_0xa1e0('0x12')]);}logger['error'](_0xa1e0('0x13'),_0x4cb64d,_0x52fe70[_0xa1e0('0x10')][_0xa1e0('0x12')]);return _0x188882(_0x52fe70[_0xa1e0('0x10')][_0xa1e0('0x12')]);}else{logger['info'](_0xa1e0('0x13'),_0x4cb64d,_0xa1e0('0xe'));_0x188882(_0x52fe70[_0xa1e0('0x14')]['message']);}})[_0xa1e0('0x15')](function(_0x1c71be){logger['error'](_0xa1e0('0x13'),_0x4cb64d,_0x1c71be);_0x589f94(_0x1c71be);});});} \ No newline at end of file +var _0xcf33=['message','CmCompany,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','then','info','request\x20sent','error','code'];(function(_0x26e699,_0x879597){var _0x46a38c=function(_0x579a60){while(--_0x579a60){_0x26e699['push'](_0x26e699['shift']());}};_0x46a38c(++_0x879597);}(_0xcf33,0xc3));var _0x3cf3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcf33[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x3cf3('0x0'));var moment=require(_0x3cf3('0x1'));var BPromise=require(_0x3cf3('0x2'));var rs=require(_0x3cf3('0x3'));var fs=require('fs');var Redis=require(_0x3cf3('0x4'));var db=require(_0x3cf3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cf3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3cf3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d2e16,_0x4fc0c1,_0x1c52cf){return new BPromise(function(_0x526b2b,_0x2c917f){return client['request'](_0x5d2e16,_0x1c52cf)[_0x3cf3('0x8')](function(_0x4d7d91){logger[_0x3cf3('0x9')]('CmCompany,\x20%s,\x20%s',_0x4fc0c1,_0x3cf3('0xa'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x4fc0c1,_0x3cf3('0xa'),JSON['stringify'](_0x4d7d91));if(_0x4d7d91[_0x3cf3('0xb')]){if(_0x4d7d91[_0x3cf3('0xb')][_0x3cf3('0xc')]===0x1f4){logger[_0x3cf3('0xb')]('CmCompany,\x20%s,\x20%s',_0x4fc0c1,_0x4d7d91[_0x3cf3('0xb')][_0x3cf3('0xd')]);return _0x2c917f(_0x4d7d91[_0x3cf3('0xb')]['message']);}logger[_0x3cf3('0xb')](_0x3cf3('0xe'),_0x4fc0c1,_0x4d7d91[_0x3cf3('0xb')][_0x3cf3('0xd')]);return _0x526b2b(_0x4d7d91[_0x3cf3('0xb')][_0x3cf3('0xd')]);}else{logger[_0x3cf3('0x9')](_0x3cf3('0xe'),_0x4fc0c1,_0x3cf3('0xa'));_0x526b2b(_0x4d7d91[_0x3cf3('0xf')][_0x3cf3('0xd')]);}})['catch'](function(_0x18723b){logger['error']('CmCompany,\x20%s,\x20%s',_0x4fc0c1,_0x18723b);_0x2c917f(_0x18723b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 138b18d..d8c45c6 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 _0x994c=['/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','/describe','/:id','isAuthenticated','show'];(function(_0xb2d90a,_0x3347cd){var _0xc7111c=function(_0x2a24b3){while(--_0x2a24b3){_0xb2d90a['push'](_0xb2d90a['shift']());}};_0xc7111c(++_0x3347cd);}(_0x994c,0x128));var _0xc994=function(_0x3515ef,_0x492932){_0x3515ef=_0x3515ef-0x0;var _0x213cd5=_0x994c[_0x3515ef];return _0x213cd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc994('0x0'));var timeout=require(_0xc994('0x1'));var express=require(_0xc994('0x2'));var router=express[_0xc994('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc994('0x4'));var config=require(_0xc994('0x5'));var controller=require(_0xc994('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc994('0x7')]);router['get'](_0xc994('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc994('0x9'),auth[_0xc994('0xa')](),controller[_0xc994('0xb')]);router['get'](_0xc994('0xc'),auth[_0xc994('0xa')](),controller[_0xc994('0xd')]);router[_0xc994('0xe')]('/',auth[_0xc994('0xa')](),controller[_0xc994('0xf')]);router[_0xc994('0xe')]('/:id/contacts',auth[_0xc994('0xa')](),controller[_0xc994('0x10')]);router[_0xc994('0x11')](_0xc994('0x9'),auth[_0xc994('0xa')](),controller[_0xc994('0x12')]);router[_0xc994('0x13')](_0xc994('0x9'),auth['isAuthenticated'](),controller[_0xc994('0x14')]);module[_0xc994('0x15')]=router; \ No newline at end of file +var _0xc561=['/:id/contacts','getContacts','create','post','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0xd6c6bb,_0x46776e){var _0x3623cc=function(_0x341181){while(--_0x341181){_0xd6c6bb['push'](_0xd6c6bb['shift']());}};_0x3623cc(++_0x46776e);}(_0xc561,0x81));var _0x1c56=function(_0x45778a,_0x3e96af){_0x45778a=_0x45778a-0x0;var _0x2b7457=_0xc561[_0x45778a];return _0x2b7457;};'use strict';var multer=require(_0x1c56('0x0'));var util=require(_0x1c56('0x1'));var path=require(_0x1c56('0x2'));var timeout=require(_0x1c56('0x3'));var express=require(_0x1c56('0x4'));var router=express['Router']();var fs_extra=require(_0x1c56('0x5'));var auth=require(_0x1c56('0x6'));var interaction=require(_0x1c56('0x7'));var config=require(_0x1c56('0x8'));var controller=require('./cmCompany.controller');router[_0x1c56('0x9')]('/',auth['isAuthenticated'](),controller[_0x1c56('0xa')]);router['get'](_0x1c56('0xb'),auth[_0x1c56('0xc')](),controller[_0x1c56('0xd')]);router[_0x1c56('0x9')](_0x1c56('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1c56('0x9')](_0x1c56('0xf'),auth[_0x1c56('0xc')](),controller[_0x1c56('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1c56('0x11')]);router[_0x1c56('0x12')](_0x1c56('0xf'),auth[_0x1c56('0xc')](),controller[_0x1c56('0x13')]);router[_0x1c56('0x14')](_0x1c56('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1c56('0x15')](_0x1c56('0xe'),auth['isAuthenticated'](),controller[_0x1c56('0x16')]);module[_0x1c56('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 913244c..b686238 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 _0x3390=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x4a6c93,_0x40b055){var _0x2be157=function(_0x442a2d){while(--_0x442a2d){_0x4a6c93['push'](_0x4a6c93['shift']());}};_0x2be157(++_0x40b055);}(_0x3390,0x71));var _0x0339=function(_0x4bec5a,_0xf930a0){_0x4bec5a=_0x4bec5a-0x0;var _0x1a3b43=_0x3390[_0x4bec5a];return _0x1a3b43;};'use strict';var _=require(_0x0339('0x0'));var Sequelize=require(_0x0339('0x1'));module[_0x0339('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0339('0x3')]},'postalCode':{'type':Sequelize[_0x0339('0x3')]},'city':{'type':Sequelize[_0x0339('0x3')]},'country':{'type':Sequelize[_0x0339('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0339('0x4')]},'phone':{'type':Sequelize[_0x0339('0x3')]},'mobile':{'type':Sequelize[_0x0339('0x3')]},'fax':{'type':Sequelize[_0x0339('0x3')]},'email':{'type':Sequelize[_0x0339('0x3')]},'url':{'type':Sequelize[_0x0339('0x3')]},'facebook':{'type':Sequelize[_0x0339('0x3')]},'fb_data':{'type':Sequelize[_0x0339('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x0339('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x0339('0x3')]},'wechat':{'type':Sequelize[_0x0339('0x3')]},'telegram':{'type':Sequelize[_0x0339('0x3')]},'UserId':{'type':Sequelize[_0x0339('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x0339('0x3')]},'priority':{'type':Sequelize[_0x0339('0x5')](0x2)[_0x0339('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0339('0x7')],'defaultValue':Sequelize[_0x0339('0x8')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcc83=['lodash','sequelize','STRING','TEXT','UNSIGNED','DATE','INTEGER'];(function(_0x338349,_0x21c3cc){var _0x2a13b8=function(_0x3d6ae9){while(--_0x3d6ae9){_0x338349['push'](_0x338349['shift']());}};_0x2a13b8(++_0x21c3cc);}(_0xcc83,0xcb));var _0x3cc8=function(_0x559233,_0x4f4408){_0x559233=_0x559233-0x0;var _0x1a9acb=_0xcc83[_0x559233];return _0x1a9acb;};'use strict';var _=require(_0x3cc8('0x0'));var Sequelize=require(_0x3cc8('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x3cc8('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3cc8('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3cc8('0x2')]},'dateOfBirth':{'type':Sequelize[_0x3cc8('0x2')]},'description':{'type':Sequelize[_0x3cc8('0x3')]},'phone':{'type':Sequelize[_0x3cc8('0x2')]},'mobile':{'type':Sequelize[_0x3cc8('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3cc8('0x2')]},'url':{'type':Sequelize[_0x3cc8('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3cc8('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x3cc8('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x3cc8('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x3cc8('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3cc8('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3cc8('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x3cc8('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 11f92ca..0a530a6 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 _0x3616=['binding','child_process','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','getJourney','mail','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','key','Tags','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','openchannel','externalUrl','threadId','Owner','flatten','sortBy','reverse','slice','moment','bluebird','util','path','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','undefined','count','offset','limit','set','Content-Range','update','destroy','then','end','name','send','describe','findAll','query','user','params','catch','CmContact','tags','keys','length','startsWith','cf_','columnName','CmCustomField','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappQueueReport','join','isNil','utcOffset','timezones','additionalPhones','each','duplicates','where','$or','push','ListId','findOrCreate','contact','all','show','find','Tag','color','tag','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','omit','map','format','cf_%d','dialTimezone','$and','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','filter','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','literal','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','includeAll','include','rows','getHopperHistories','CmHopperHistory','ContactId','getHopperFinals','pick','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','0777','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','agent'];(function(_0x4a2183,_0x53e74d){var _0xc7c01d=function(_0x526d67){while(--_0x526d67){_0x4a2183['push'](_0x4a2183['shift']());}};_0xc7c01d(++_0x53e74d);}(_0x3616,0x13f));var _0x6361=function(_0x4756b5,_0x2e510f){_0x4756b5=_0x4756b5-0x0;var _0x2be85a=_0x3616[_0x4756b5];return _0x2be85a;};'use strict';var moment=require(_0x6361('0x0'));var BPromise=require(_0x6361('0x1'));var util=require(_0x6361('0x2'));var path=require(_0x6361('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6361('0x4'));var Papa=require('papaparse');var Redis=require(_0x6361('0x5'));var contacts=require(_0x6361('0x6'));var qs=require(_0x6361('0x7'));var logger=require(_0x6361('0x8'))('api');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require(_0x6361('0x9'))['db'];config[_0x6361('0xa')]=_[_0x6361('0xb')](config[_0x6361('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6361('0xc'))(new Redis(config[_0x6361('0xa')]));require(_0x6361('0xd'))[_0x6361('0xe')](socket);function respondWithResult(_0xbf692f,_0x138735){_0x138735=_0x138735||0xc8;return function(_0x1a1492){if(_0x1a1492){return _0xbf692f[_0x6361('0xf')](_0x138735)[_0x6361('0x10')](_0x1a1492);}};}function respondWithFilteredResult(_0x9588e8,_0x23c32d){return function(_0x2ca179){if(_0x2ca179){var _0x10b99e=typeof _0x23c32d['offset']===_0x6361('0x11')&&typeof _0x23c32d['limit']===_0x6361('0x11');var _0x15a955=_0x2ca179[_0x6361('0x12')];var _0x43e8ce=_0x10b99e?0x0:_0x23c32d['offset'];var _0x14a5c4=_0x10b99e?_0x2ca179[_0x6361('0x12')]:_0x23c32d[_0x6361('0x13')]+_0x23c32d[_0x6361('0x14')];var _0x19763b;if(_0x14a5c4>=_0x15a955){_0x14a5c4=_0x15a955;_0x19763b=0xc8;}else{_0x19763b=0xce;}_0x9588e8[_0x6361('0xf')](_0x19763b);return _0x9588e8[_0x6361('0x15')](_0x6361('0x16'),_0x43e8ce+'-'+_0x14a5c4+'/'+_0x15a955)['json'](_0x2ca179);}return null;};}function saveUpdates(_0x3b2fde){return function(_0x497e0f){if(_0x497e0f){return _0x497e0f[_0x6361('0x17')](_0x3b2fde)['then'](function(_0x123bf3){return _0x123bf3;});}return null;};}function removeEntity(_0x519e8e){return function(_0x4da088){if(_0x4da088){return _0x4da088[_0x6361('0x18')]()[_0x6361('0x19')](function(){_0x519e8e[_0x6361('0xf')](0xcc)[_0x6361('0x1a')]();});}};}function handleEntityNotFound(_0x2f8fb5){return function(_0x30affc){if(!_0x30affc){_0x2f8fb5['sendStatus'](0x194);}return _0x30affc;};}function handleError(_0x138d0d,_0x5e2e5b){_0x5e2e5b=_0x5e2e5b||0x1f4;return function(_0x2b5620){logger['error'](_0x2b5620['stack']);if(_0x2b5620[_0x6361('0x1b')]){delete _0x2b5620[_0x6361('0x1b')];}_0x138d0d['status'](_0x5e2e5b)[_0x6361('0x1c')](_0x2b5620);};}exports['index']=function(_0x1b1bbc,_0x289a4d){var _0x4212ed={};return contacts[_0x6361('0x1d')]()[_0x6361('0x19')](function(_0x495bc6){_0x4212ed=qs['getOptions'](_0x495bc6,_0x1b1bbc);return contacts[_0x6361('0x1e')](_0x1b1bbc[_0x6361('0x1f')],_0x1b1bbc[_0x6361('0x20')],_0x4212ed,_0x495bc6);})['then'](respondWithFilteredResult(_0x289a4d,_0x4212ed))['catch'](handleError(_0x289a4d,null));};exports['destroy']=function(_0xb494dd,_0x74f1af){return db['CmContact']['find']({'where':{'id':_0xb494dd[_0x6361('0x21')]['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x74f1af,null))[_0x6361('0x19')](removeEntity(_0x74f1af,null))[_0x6361('0x22')](handleError(_0x74f1af,null));};exports[_0x6361('0x1d')]=function(_0x9f58c2,_0x2edeac){return db[_0x6361('0x23')]['describe']()[_0x6361('0x19')](function(_0x28c187){delete _0x28c187[_0x6361('0x24')];for(var _0x3882bb=0x0;_0x3882bb0x0){return new Promise(function(_0x1753b4){var _0x9af5b4=[];for(var _0x2e6af0=0x0;_0x2e6af0<_0x5578d1['length'];_0x2e6af0++){_0x9af5b4[_0x6361('0x57')](insertAdditionalPhones(_0x5578d1[_0x2e6af0][_0x6361('0x5a')],_0x5578d1[_0x2e6af0]['additionalPhones']));}Promise[_0x6361('0x5b')](_0x9af5b4)[_0x6361('0x19')](function(){_0x1753b4(0x1);});})[_0x6361('0x19')](function(){return{'success':_0x3cf0cb,'failure':_0x3b23d2,'duplicates':_0x165a14};});}else{return{'success':_0x3cf0cb,'failure':_0x3b23d2,'duplicates':_0x165a14};}}})[_0x6361('0x19')](respondWithResult(_0x41666c,0xc9))[_0x6361('0x22')](handleError(_0x41666c,null));};exports[_0x6361('0x5c')]=function(_0x2db904,_0x4707f9){var _0x6b1902;return db[_0x6361('0x23')][_0x6361('0x1d')]()[_0x6361('0x19')](function(_0x1e5fd5){return db[_0x6361('0x23')][_0x6361('0x5d')]({'where':{'id':_0x2db904[_0x6361('0x21')]['id']},'include':[{'model':db[_0x6361('0x5e')],'as':'Tags','attributes':['id',_0x6361('0x1b'),_0x6361('0x5f')],'required':_0x2db904['query'][_0x6361('0x60')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x6361('0x61'),'where':{'CmContactId':_0x2db904['params']['id']},'required':![],'include':[{'model':db[_0x6361('0x62')],'as':_0x6361('0x63')}]}],'order':[db[_0x6361('0x64')]['literal'](_0x6361('0x65'))],'attributes':_[_0x6361('0x25')](_0x1e5fd5)});})[_0x6361('0x19')](function(_0xc5b491){if(!_[_0x6361('0x4f')](_0xc5b491)){_0x6b1902=_0xc5b491[_0x6361('0x36')]({'plain':!![]});var _0x38e904={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xc5b491&&_0xc5b491[_0x6361('0x58')]){if(_0xc5b491[_0x6361('0x58')]){_0x38e904['where']['$and']['push']({'ListId':{'$ne':_0xc5b491[_0x6361('0x58')]}});}}return db[_0x6361('0x2a')][_0x6361('0x1e')](_0x38e904);}})['then'](function(_0x45523e){if(!_[_0x6361('0x4f')](_0x45523e)){return _[_0x6361('0x66')](_0x6b1902,_[_0x6361('0x67')](_0x45523e,function(_0x417654){return util[_0x6361('0x68')](_0x6361('0x69'),_0x417654['id']);}));}})[_0x6361('0x19')](handleEntityNotFound(_0x4707f9,null))['then'](respondWithResult(_0x4707f9,null))['catch'](handleError(_0x4707f9,null));};exports[_0x6361('0x17')]=function(_0x1b8d2e,_0x398360){var _0x507e5f;if(_0x1b8d2e['body']['id']){delete _0x1b8d2e['body']['id'];}if(!_[_0x6361('0x4f')](_0x1b8d2e['body'][_0x6361('0x6a')])){var _0x4b9bab=_0x1b8d2e[_0x6361('0x34')][_0x6361('0x6a')];if(!_[_0x6361('0x4f')](shared[_0x6361('0x51')][_0x4b9bab]))_0x1b8d2e[_0x6361('0x34')][_0x6361('0x50')]=shared[_0x6361('0x51')][_0x4b9bab][_0x6361('0x50')];}return db['CmContact'][_0x6361('0x5d')]({'where':{'id':_0x1b8d2e[_0x6361('0x21')]['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x398360,null))[_0x6361('0x19')](saveUpdates(_0x1b8d2e[_0x6361('0x34')],null))[_0x6361('0x19')](function(_0x5cdeb7){_0x507e5f=_0x5cdeb7;var _0x2b832f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5cdeb7&&_0x5cdeb7['ListId']){if(_0x5cdeb7['ListId']){_0x2b832f['where'][_0x6361('0x6b')][_0x6361('0x57')]({'ListId':{'$ne':_0x5cdeb7[_0x6361('0x58')]}});}}return db[_0x6361('0x2a')][_0x6361('0x1e')](_0x2b832f);})[_0x6361('0x19')](function(_0x4194b9){if(_0x4194b9){return _['omit'](_[_0x6361('0x6c')](_0x1b8d2e[_0x6361('0x34')],function(_0x574206,_0x333e40){return _[_0x6361('0x27')](_0x333e40,'cf_');}),_[_0x6361('0x67')](_0x4194b9,function(_0x13e27e){return util['format']('cf_%d',_0x13e27e['id']);}));}})[_0x6361('0x19')](function(_0x20ad37){if(_0x20ad37&&!_['isEmpty'](_0x20ad37)){var _0x11efef=squel[_0x6361('0x17')]()[_0x6361('0x6d')](_0x6361('0x6e'))[_0x6361('0x6f')](_0x20ad37)[_0x6361('0x55')](_0x6361('0x70'),_0x1b8d2e[_0x6361('0x21')]['id'])[_0x6361('0x71')]();return db[_0x6361('0x64')][_0x6361('0x1f')](_0x11efef[_0x6361('0x72')],{'replacements':_0x11efef[_0x6361('0x2e')]});}})[_0x6361('0x19')](function(){if(_0x1b8d2e[_0x6361('0x34')][_0x6361('0x73')]&&_0x507e5f){return db['CmHopper'][_0x6361('0x17')]({'phone':_0x1b8d2e[_0x6361('0x34')][_0x6361('0x73')],'OrderBy':0x0},{'where':{'ContactId':_0x507e5f['id']}});}})[_0x6361('0x19')](function(){return _0x507e5f;})[_0x6361('0x19')](respondWithResult(_0x398360,null))[_0x6361('0x22')](handleError(_0x398360,null));};exports[_0x6361('0x74')]=function(_0x26c533,_0x4987ef){var _0x277a91={};var _0x3715b1={};var _0x3f6952;var _0x28dcf2;return db[_0x6361('0x23')][_0x6361('0x75')]({'where':{'id':_0x26c533['params']['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x4987ef,null))[_0x6361('0x19')](function(_0x4dc656){if(_0x4dc656){_0x3f6952=_0x4dc656;_0x3715b1[_0x6361('0x76')]=_[_0x6361('0x25')](db[_0x6361('0x5e')][_0x6361('0x77')]);_0x3715b1[_0x6361('0x1f')]=_['keys'](_0x26c533['query']);_0x3715b1[_0x6361('0x78')]=_[_0x6361('0x79')](_0x3715b1[_0x6361('0x76')],_0x3715b1[_0x6361('0x1f')]);_0x277a91[_0x6361('0x7a')]=_[_0x6361('0x79')](_0x3715b1[_0x6361('0x76')],qs[_0x6361('0x7b')](_0x26c533['query'][_0x6361('0x7b')]));_0x277a91['attributes']=_0x277a91['attributes'][_0x6361('0x26')]?_0x277a91['attributes']:_0x3715b1['model'];_0x277a91[_0x6361('0x7c')]=qs['sort'](_0x26c533[_0x6361('0x1f')][_0x6361('0x7d')]);_0x277a91[_0x6361('0x55')]=qs[_0x6361('0x78')](_['pick'](_0x26c533[_0x6361('0x1f')],_0x3715b1[_0x6361('0x78')]));if(_0x26c533[_0x6361('0x1f')][_0x6361('0x7e')]){_0x277a91[_0x6361('0x55')]=_[_0x6361('0x33')](_0x277a91[_0x6361('0x55')],{'$or':_[_0x6361('0x67')](_0x277a91[_0x6361('0x7a')],function(_0x5070ac){var _0x39e25c={};_0x39e25c[_0x5070ac]={'$like':'%'+_0x26c533[_0x6361('0x1f')][_0x6361('0x7e')]+'%'};return _0x39e25c;})});}_0x277a91=_['merge']({},_0x277a91,_0x26c533[_0x6361('0x7f')]);return _0x3f6952[_0x6361('0x74')](_0x277a91);}})[_0x6361('0x19')](function(_0x5b42b4){if(_0x5b42b4){_0x28dcf2=_0x5b42b4[_0x6361('0x26')];if(!_0x26c533[_0x6361('0x1f')][_0x6361('0x32')](_0x6361('0x80'))){_0x277a91[_0x6361('0x14')]=qs['limit'](_0x26c533['query'][_0x6361('0x14')]);_0x277a91[_0x6361('0x13')]=qs[_0x6361('0x13')](_0x26c533['query'][_0x6361('0x13')]);}return _0x3f6952[_0x6361('0x74')](_0x277a91);}})[_0x6361('0x19')](function(_0x2eb949){if(_0x2eb949){return _0x2eb949?{'count':_0x28dcf2,'rows':_0x2eb949}:null;}})[_0x6361('0x19')](respondWithResult(_0x4987ef,null))[_0x6361('0x22')](handleError(_0x4987ef,null));};exports[_0x6361('0x81')]=function(_0xcfed48,_0x59b5b6){if(_0xcfed48[_0x6361('0x34')]['id']){delete _0xcfed48[_0x6361('0x34')]['id'];}return db[_0x6361('0x23')][_0x6361('0x75')]({'where':{'id':_0xcfed48[_0x6361('0x21')]['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x59b5b6,null))[_0x6361('0x19')](function(_0x321236){if(_0x321236){return _0x321236[_0x6361('0x81')](_0xcfed48[_0x6361('0x34')][_0x6361('0x82')]||[]);}return null;})[_0x6361('0x19')](respondWithResult(_0x59b5b6,null))[_0x6361('0x22')](handleError(_0x59b5b6,null));};exports[_0x6361('0x83')]=function(_0x2ce27a,_0x29453b){var _0x332c29=[];_0x332c29[_0x6361('0x57')](addAdditionalPhones(_0x2ce27a[_0x6361('0x34')]));Promise['all'](_0x332c29)['then'](function(){_0x332c29=[];_0x332c29[_0x6361('0x57')](deleteCmHopperPhones(_0x2ce27a[_0x6361('0x34')]['id']));_0x332c29['push'](addCmHopperPhones(_0x2ce27a['body']['id']));Promise[_0x6361('0x5b')](_0x332c29)[_0x6361('0x19')](function(){return[0x1];})[_0x6361('0x19')](respondWithResult(_0x29453b,null));});};function addAdditionalPhones(_0x3a065d){var _0x118c90;return new Promise(function(_0x1a9f04){return db[_0x6361('0x45')][_0x6361('0x18')]({'where':{'CmContactId':_0x3a065d['id']}})[_0x6361('0x19')](function(){db[_0x6361('0x62')][_0x6361('0x1e')]({'raw':!![],'attributes':['id',_0x6361('0x84')]})['then'](function(_0x321523){var _0x1a686e=[];for(var _0x1d65bf=0x0;_0x1d65bf<_0x3a065d[_0x6361('0x85')][_0x6361('0x26')];_0x1d65bf++){var _0x554261=_0x3a065d[_0x6361('0x86')]?_[_0x6361('0x4f')](_0x3a065d['item_types'][_0x1d65bf])?'':_0x3a065d[_0x6361('0x86')][_0x1d65bf]:_0x3a065d[_0x6361('0x85')][_0x1d65bf][_0x6361('0x87')]?_0x3a065d[_0x6361('0x85')][_0x1d65bf][_0x6361('0x87')]:'';var _0x16de6a=_[_0x6361('0x4f')](_0x3a065d[_0x6361('0x85')][_0x1d65bf]['description'])?'':_0x3a065d[_0x6361('0x85')][_0x1d65bf]['description'];var _0x5e307e=_0x554261+':'+_0x3a065d[_0x6361('0x85')][_0x1d65bf]['phone']+'§'+_0x16de6a;if(_[_0x6361('0x4f')](_0x118c90))_0x118c90=_0x5e307e;else _0x118c90+=';'+_0x5e307e;var _0x5b226f=null;var _0x442947=null;if(_0x3a065d[_0x6361('0x86')]){if(!_[_0x6361('0x4f')](_0x3a065d[_0x6361('0x86')][_0x1d65bf])){_0x442947=_[_0x6361('0x5d')](_0x321523,function(_0x2167b9){return _0x2167b9['id']===_0x3a065d['item_types'][_0x1d65bf];});if(!_[_0x6361('0x4f')](_0x442947)){_0x5b226f=_0x442947['OrderBy'];}}}else{if(!_[_0x6361('0x4f')](_0x3a065d['items'][_0x1d65bf])){_0x442947=_[_0x6361('0x5d')](_0x321523,function(_0x4128a4){return _0x4128a4['id']===_0x3a065d['items'][_0x1d65bf][_0x6361('0x87')];});if(!_[_0x6361('0x4f')](_0x442947)){_0x5b226f=_0x1d65bf;}}}if(_[_0x6361('0x4f')](_0x5b226f)){_0x5b226f=0x64;}_0x1a686e[_0x6361('0x57')](addAdditionalPhone(_0x3a065d['id'],_0x3a065d['items'][_0x1d65bf]['phone'],_0x3a065d[_0x6361('0x86')]?_[_0x6361('0x4f')](_0x3a065d[_0x6361('0x86')][_0x1d65bf])?null:_0x3a065d[_0x6361('0x86')][_0x1d65bf]:_0x3a065d[_0x6361('0x85')][_0x1d65bf]['ItemTypeId']?_0x3a065d[_0x6361('0x85')][_0x1d65bf][_0x6361('0x87')]:null,_0x5b226f,_0x16de6a));}Promise[_0x6361('0x5b')](_0x1a686e)[_0x6361('0x19')](function(){db[_0x6361('0x23')]['update']({'AdditionalPhones':_0x118c90},{'where':{'id':_0x3a065d['id']}})[_0x6361('0x19')](function(){_0x1a9f04(0x1);});});});});});}function addAdditionalPhone(_0x35d948,_0x3c51c8,_0x3e5b71,_0x5ee619,_0x4309f6){return db[_0x6361('0x45')][_0x6361('0x5d')]({'where':{'CmContactId':_0x35d948,'item':_0x3c51c8}})['then'](function(_0x4afd6e){if(_0x4afd6e)logger[_0x6361('0x2f')](_0x6361('0x88'),_0x4afd6e);else{db[_0x6361('0x45')][_0x6361('0x3c')]({'CmContactId':_0x35d948,'item':_0x3c51c8,'ItemTypeId':_0x3e5b71,'OrderBy':_0x5ee619,'ItemClass':_0x6361('0x89'),'description':_0x4309f6});}});}function deleteCmHopperPhones(_0xa45607){return new Promise(function(_0x2c72bc){return db['CmHopper'][_0x6361('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xa45607}})[_0x6361('0x19')](function(_0x307f26){db[_0x6361('0x8a')][_0x6361('0x18')]({'where':{'CmHopperId':{'$in':_[_0x6361('0x67')](_0x307f26,'id')}}});})['then'](function(){_0x2c72bc(0x1);});});}function addCmHopperPhones(_0x1c58a0){return new Promise(function(_0x18d46b){return db[_0x6361('0x3a')][_0x6361('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1c58a0}})['then'](function(_0x5e4bd0){var _0x3285c8=[];_[_0x6361('0x67')](_0x5e4bd0,function(_0x3148ae){_0x3285c8[_0x6361('0x57')](createCmHopperPhone(_0x1c58a0,_0x3148ae['id']));});Promise[_0x6361('0x5b')](_0x3285c8)[_0x6361('0x19')](function(){_0x18d46b(0x1);});});});}function createCmHopperPhone(_0x45798b,_0x52dceb){return new Promise(function(_0x1bd800){db[_0x6361('0x45')][_0x6361('0x1e')]({'raw':!![],'attributes':[_0x6361('0x8b'),_0x6361('0x84')],'where':{'CmContactId':_0x45798b,'ItemClass':_0x6361('0x89')},'include':[{'model':db['ContactItemType'],'attributes':[_0x6361('0x84')],'as':_0x6361('0x63')}],'order':[_0x6361('0x84'),db[_0x6361('0x64')]['literal'](_0x6361('0x8c'))]})['then'](function(_0x3240fd){var _0x4dc748=0x1;var _0x551304=_[_0x6361('0x67')](_0x3240fd,function(_0x2adc25){_0x2adc25[_0x6361('0x8d')]=_0x52dceb;_0x2adc25[_0x6361('0x73')]=_0x2adc25[_0x6361('0x8b')];_0x2adc25[_0x6361('0x84')]=_0x4dc748;delete _0x2adc25[_0x6361('0x8e')];_0x4dc748=_0x4dc748+0x1;return _0x2adc25;});return db['CmHopperAdditionalPhone'][_0x6361('0x8f')](_0x551304,{});})['then'](function(){_0x1bd800(0x1);});});}function insertAdditionalPhones(_0x5f3c63,_0x3f0749){return new Promise(function(_0x3110a4){var _0x152f6f=[];for(var _0x297736=0x0;_0x297736<_0x3f0749[_0x6361('0x26')];_0x297736++){var _0x3113ba=_0x3f0749[_0x297736];_0x152f6f[_0x6361('0x57')](parseContactItemType(_0x3113ba));}Promise['all'](_0x152f6f)[_0x6361('0x19')](function(){var _0x52f671={'id':_0x5f3c63['id'],'items':_0x3f0749};return addAdditionalPhones(_0x52f671)[_0x6361('0x19')](function(){return addCmHopperPhones(_0x5f3c63['id']);});})[_0x6361('0x19')](function(){_0x3110a4(_0x5f3c63);});});}function parseContactItemType(_0x3aa2c8){return new Promise(function(_0x4ddc08){if(_0x3aa2c8[_0x6361('0x32')]('ItemTypeId')){_0x4ddc08(_0x3aa2c8);}else{return db[_0x6361('0x62')][_0x6361('0x5d')]({'where':{'name':_0x3aa2c8[_0x6361('0x63')]}})[_0x6361('0x19')](function(_0x26480b){if(_[_0x6361('0x4f')](_0x26480b))_0x3aa2c8[_0x6361('0x87')]=null;else _0x3aa2c8[_0x6361('0x87')]=_0x26480b['id'];_0x4ddc08(_0x3aa2c8);});}});}exports[_0x6361('0x90')]=function(_0x34ffca,_0x36dd99){return db['CmContactHasItem'][_0x6361('0x1e')]({'raw':!![],'where':{'CmContactId':_0x34ffca[_0x6361('0x21')]['id'],'ItemClass':_0x6361('0x89')},'include':[{'model':db[_0x6361('0x62')],'as':_0x6361('0x63')}],'order':[[_0x6361('0x84')],[db['sequelize'][_0x6361('0x91')](_0x6361('0x8c'))]]})[_0x6361('0x19')](function(_0x31776c){return _0x31776c;})['then'](respondWithResult(_0x36dd99,null))[_0x6361('0x22')](handleError(_0x36dd99,null));};exports[_0x6361('0x92')]=function(_0x3b76de,_0x26d203){return db[_0x6361('0x45')][_0x6361('0x1e')]({'raw':!![],'where':{'CmContactId':_0x3b76de[_0x6361('0x34')]['fromContactId']}})[_0x6361('0x19')](function(_0x32eb3b){var _0x5c1dc6=_[_0x6361('0x67')](_0x32eb3b,function(_0x530603){_0x530603[_0x6361('0x93')]=_0x3b76de[_0x6361('0x34')][_0x6361('0x94')];return _0x530603;});return db['CmContactHasItem']['bulkCreate'](_0x5c1dc6,{});})['then'](function(){return addCmHopperPhones(_0x3b76de[_0x6361('0x34')][_0x6361('0x94')]);})[_0x6361('0x19')](function(){return['ok'];})[_0x6361('0x19')](respondWithResult(_0x26d203,null))[_0x6361('0x22')](handleError(_0x26d203,null));};exports[_0x6361('0x95')]=function(_0x3713b0,_0x3665f8){var _0x24c6bd=[];_0x24c6bd[_0x6361('0x57')](createCmHopperPhone(_0x3713b0[_0x6361('0x34')]['id'],_0x3713b0[_0x6361('0x34')][_0x6361('0x96')]));Promise[_0x6361('0x5b')](_0x24c6bd)[_0x6361('0x19')](function(){return[0x1];})['then'](respondWithResult(_0x3665f8,null));};exports['getHoppers']=function(_0x58ed3a,_0x47df45){var _0x3fdfea={'raw':![],'where':{}};var _0x27ad86={};var _0xd9562a={'count':0x0,'rows':[]};return db[_0x6361('0x23')][_0x6361('0x75')]({'where':{'id':_0x58ed3a['params']['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x47df45,null))[_0x6361('0x19')](function(_0xd1ba1a){if(_0xd1ba1a){_0x27ad86['model']=_[_0x6361('0x25')](db[_0x6361('0x3a')][_0x6361('0x77')]);_0x27ad86[_0x6361('0x1f')]=_[_0x6361('0x25')](_0x58ed3a[_0x6361('0x1f')]);_0x27ad86[_0x6361('0x78')]=_['intersection'](_0x27ad86[_0x6361('0x76')],_0x27ad86[_0x6361('0x1f')]);_0x3fdfea[_0x6361('0x7a')]=_[_0x6361('0x79')](_0x27ad86[_0x6361('0x76')],qs[_0x6361('0x7b')](_0x58ed3a[_0x6361('0x1f')][_0x6361('0x7b')]));_0x3fdfea['attributes']=_0x3fdfea['attributes']['length']?_0x3fdfea['attributes']:_0x27ad86['model'];if(!_0x58ed3a[_0x6361('0x1f')][_0x6361('0x32')](_0x6361('0x80'))){_0x3fdfea['limit']=qs[_0x6361('0x14')](_0x58ed3a[_0x6361('0x1f')][_0x6361('0x14')]);_0x3fdfea['offset']=qs[_0x6361('0x13')](_0x58ed3a['query'][_0x6361('0x13')]);}_0x3fdfea[_0x6361('0x7c')]=qs[_0x6361('0x7d')](_0x58ed3a[_0x6361('0x1f')][_0x6361('0x7d')]);_0x3fdfea[_0x6361('0x55')]=qs['filters'](_['pick'](_0x58ed3a[_0x6361('0x1f')],_0x27ad86[_0x6361('0x78')]));_0x3fdfea[_0x6361('0x55')]['ContactId']=_0xd1ba1a['id'];if(_0x58ed3a['query'][_0x6361('0x7e')]){_0x3fdfea[_0x6361('0x55')]=_[_0x6361('0x33')](_0x3fdfea[_0x6361('0x55')],{'$or':_[_0x6361('0x67')](_0x3fdfea[_0x6361('0x7a')],function(_0x1ef7ff){var _0x15fa23={};_0x15fa23[_0x1ef7ff]={'$like':'%'+_0x58ed3a[_0x6361('0x1f')][_0x6361('0x7e')]+'%'};return _0x15fa23;})});}_0x3fdfea=_[_0x6361('0x33')]({},_0x3fdfea,_0x58ed3a[_0x6361('0x7f')]);return db[_0x6361('0x3a')]['count']({'where':_0x3fdfea[_0x6361('0x55')]})[_0x6361('0x19')](function(_0x30509a){_0xd9562a[_0x6361('0x12')]=_0x30509a;if(_0x58ed3a[_0x6361('0x1f')][_0x6361('0x97')]){_0x3fdfea[_0x6361('0x98')]=[{'all':!![]}];}return db[_0x6361('0x3a')][_0x6361('0x1e')](_0x3fdfea);})[_0x6361('0x19')](function(_0x1b8ee9){_0xd9562a[_0x6361('0x99')]=_0x1b8ee9;return _0xd9562a;});}})[_0x6361('0x19')](respondWithFilteredResult(_0x47df45,_0x3fdfea))[_0x6361('0x22')](handleError(_0x47df45,null));};exports[_0x6361('0x9a')]=function(_0x58eb89,_0x531096){var _0x321be3={'raw':!![],'where':{}};var _0x33aa7f={};var _0x4fbf22={'count':0x0,'rows':[]};return db[_0x6361('0x23')][_0x6361('0x75')]({'where':{'id':_0x58eb89[_0x6361('0x21')]['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x531096,null))[_0x6361('0x19')](function(_0x1bee38){if(_0x1bee38){_0x33aa7f[_0x6361('0x76')]=_[_0x6361('0x25')](db[_0x6361('0x9b')][_0x6361('0x77')]);_0x33aa7f[_0x6361('0x1f')]=_[_0x6361('0x25')](_0x58eb89[_0x6361('0x1f')]);_0x33aa7f[_0x6361('0x78')]=_[_0x6361('0x79')](_0x33aa7f[_0x6361('0x76')],_0x33aa7f[_0x6361('0x1f')]);_0x321be3[_0x6361('0x7a')]=_[_0x6361('0x79')](_0x33aa7f[_0x6361('0x76')],qs[_0x6361('0x7b')](_0x58eb89[_0x6361('0x1f')][_0x6361('0x7b')]));_0x321be3[_0x6361('0x7a')]=_0x321be3[_0x6361('0x7a')]['length']?_0x321be3[_0x6361('0x7a')]:_0x33aa7f[_0x6361('0x76')];if(!_0x58eb89[_0x6361('0x1f')][_0x6361('0x32')]('nolimit')){_0x321be3[_0x6361('0x14')]=qs[_0x6361('0x14')](_0x58eb89[_0x6361('0x1f')][_0x6361('0x14')]);_0x321be3['offset']=qs[_0x6361('0x13')](_0x58eb89[_0x6361('0x1f')]['offset']);}_0x321be3[_0x6361('0x7c')]=qs[_0x6361('0x7d')](_0x58eb89['query']['sort']);_0x321be3[_0x6361('0x55')]=qs[_0x6361('0x78')](_['pick'](_0x58eb89[_0x6361('0x1f')],_0x33aa7f[_0x6361('0x78')]));_0x321be3['where'][_0x6361('0x9c')]=_0x1bee38['id'];if(_0x58eb89['query'][_0x6361('0x7e')]){_0x321be3['where']=_[_0x6361('0x33')](_0x321be3[_0x6361('0x55')],{'$or':_['map'](_0x321be3[_0x6361('0x7a')],function(_0x5d7718){var _0x436fc6={};_0x436fc6[_0x5d7718]={'$like':'%'+_0x58eb89[_0x6361('0x1f')][_0x6361('0x7e')]+'%'};return _0x436fc6;})});}_0x321be3=_[_0x6361('0x33')]({},_0x321be3,_0x58eb89[_0x6361('0x7f')]);return db[_0x6361('0x9b')][_0x6361('0x12')]({'where':_0x321be3[_0x6361('0x55')]})['then'](function(_0x36e987){_0x4fbf22['count']=_0x36e987;if(_0x58eb89[_0x6361('0x1f')][_0x6361('0x97')]){_0x321be3[_0x6361('0x98')]=[{'all':!![]}];}return db[_0x6361('0x9b')][_0x6361('0x1e')](_0x321be3);})['then'](function(_0x16c5bf){_0x4fbf22['rows']=_0x16c5bf;return _0x4fbf22;});}})[_0x6361('0x19')](respondWithFilteredResult(_0x531096,_0x321be3))['catch'](handleError(_0x531096,null));};exports[_0x6361('0x9d')]=function(_0x59748e,_0x559f39){var _0x114d9f={'raw':!![],'where':{}};var _0xd671b={};var _0x5db9c4={'count':0x0,'rows':[]};return db['CmContact'][_0x6361('0x75')]({'where':{'id':_0x59748e[_0x6361('0x21')]['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x559f39,null))[_0x6361('0x19')](function(_0x540b86){if(_0x540b86){_0xd671b[_0x6361('0x76')]=_[_0x6361('0x25')](db[_0x6361('0x46')][_0x6361('0x77')]);_0xd671b[_0x6361('0x1f')]=_[_0x6361('0x25')](_0x59748e[_0x6361('0x1f')]);_0xd671b[_0x6361('0x78')]=_[_0x6361('0x79')](_0xd671b['model'],_0xd671b['query']);_0x114d9f[_0x6361('0x7a')]=_['intersection'](_0xd671b[_0x6361('0x76')],qs['fields'](_0x59748e[_0x6361('0x1f')][_0x6361('0x7b')]));_0x114d9f[_0x6361('0x7a')]=_0x114d9f[_0x6361('0x7a')][_0x6361('0x26')]?_0x114d9f['attributes']:_0xd671b['model'];if(!_0x59748e[_0x6361('0x1f')]['hasOwnProperty']('nolimit')){_0x114d9f['limit']=qs[_0x6361('0x14')](_0x59748e[_0x6361('0x1f')][_0x6361('0x14')]);_0x114d9f[_0x6361('0x13')]=qs[_0x6361('0x13')](_0x59748e[_0x6361('0x1f')][_0x6361('0x13')]);}_0x114d9f[_0x6361('0x7c')]=qs['sort'](_0x59748e[_0x6361('0x1f')][_0x6361('0x7d')]);_0x114d9f[_0x6361('0x55')]=qs[_0x6361('0x78')](_[_0x6361('0x9e')](_0x59748e[_0x6361('0x1f')],_0xd671b[_0x6361('0x78')]));_0x114d9f[_0x6361('0x55')]['ContactId']=_0x540b86['id'];if(_0x59748e[_0x6361('0x1f')][_0x6361('0x7e')]){_0x114d9f[_0x6361('0x55')]=_['merge'](_0x114d9f['where'],{'$or':_[_0x6361('0x67')](_0x114d9f['attributes'],function(_0x3c3e63){var _0x537340={};_0x537340[_0x3c3e63]={'$like':'%'+_0x59748e[_0x6361('0x1f')][_0x6361('0x7e')]+'%'};return _0x537340;})});}_0x114d9f=_['merge']({},_0x114d9f,_0x59748e['options']);return db[_0x6361('0x46')]['count']({'where':_0x114d9f['where']})[_0x6361('0x19')](function(_0x22a37c){_0x5db9c4[_0x6361('0x12')]=_0x22a37c;if(_0x59748e[_0x6361('0x1f')]['includeAll']){_0x114d9f['include']=[{'all':!![]}];}return db[_0x6361('0x46')][_0x6361('0x1e')](_0x114d9f);})[_0x6361('0x19')](function(_0x289eec){_0x5db9c4[_0x6361('0x99')]=_0x289eec;return _0x5db9c4;});}})[_0x6361('0x19')](respondWithFilteredResult(_0x559f39,_0x114d9f))[_0x6361('0x22')](handleError(_0x559f39,null));};exports[_0x6361('0x9f')]=function(_0x2409e4,_0x3e405c){var _0x5d807d={'raw':!![],'where':{}};var _0x493574={};var _0x5e2c57={'count':0x0,'rows':[]};return db['CmContact'][_0x6361('0x75')]({'where':{'id':_0x2409e4['params']['id']}})[_0x6361('0x19')](handleEntityNotFound(_0x3e405c,null))['then'](function(_0x559107){if(_0x559107){_0x493574[_0x6361('0x76')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x493574['query']=_[_0x6361('0x25')](_0x2409e4[_0x6361('0x1f')]);_0x493574[_0x6361('0x78')]=_['intersection'](_0x493574['model'],_0x493574[_0x6361('0x1f')]);_0x5d807d[_0x6361('0x7a')]=_[_0x6361('0x79')](_0x493574[_0x6361('0x76')],qs[_0x6361('0x7b')](_0x2409e4[_0x6361('0x1f')][_0x6361('0x7b')]));_0x5d807d['attributes']=_0x5d807d['attributes']['length']?_0x5d807d[_0x6361('0x7a')]:_0x493574[_0x6361('0x76')];if(!_0x2409e4[_0x6361('0x1f')][_0x6361('0x32')](_0x6361('0x80'))){_0x5d807d[_0x6361('0x14')]=qs['limit'](_0x2409e4['query'][_0x6361('0x14')]);_0x5d807d['offset']=qs['offset'](_0x2409e4[_0x6361('0x1f')][_0x6361('0x13')]);}_0x5d807d['order']=qs[_0x6361('0x7d')](_0x2409e4[_0x6361('0x1f')][_0x6361('0x7d')]);_0x5d807d[_0x6361('0x55')]=qs['filters'](_['pick'](_0x2409e4['query'],_0x493574[_0x6361('0x78')]));_0x5d807d[_0x6361('0x55')][_0x6361('0x9c')]=_0x559107['id'];if(_0x2409e4[_0x6361('0x1f')][_0x6361('0x7e')]){_0x5d807d[_0x6361('0x55')]=_[_0x6361('0x33')](_0x5d807d['where'],{'$or':_['map'](_0x5d807d[_0x6361('0x7a')],function(_0x1650c5){var _0x21bd7e={};_0x21bd7e[_0x1650c5]={'$like':'%'+_0x2409e4[_0x6361('0x1f')][_0x6361('0x7e')]+'%'};return _0x21bd7e;})});}_0x5d807d=_[_0x6361('0x33')]({},_0x5d807d,_0x2409e4['options']);return db['JscriptySessionReport'][_0x6361('0x12')]({'where':_0x5d807d['where']})['then'](function(_0x5479ca){_0x5e2c57[_0x6361('0x12')]=_0x5479ca;if(_0x2409e4[_0x6361('0x1f')]['includeAll']){_0x5d807d['include']=[{'all':!![]}];}return db[_0x6361('0x4c')][_0x6361('0x1e')](_0x5d807d);})[_0x6361('0x19')](function(_0x50ee2f){_0x5e2c57[_0x6361('0x99')]=_0x50ee2f;return _0x5e2c57;});}})['then'](respondWithFilteredResult(_0x3e405c,_0x5d807d))[_0x6361('0x22')](handleError(_0x3e405c,null));};exports[_0x6361('0xa0')]=function(_0xe32125,_0xccd03d){try{if(!_0xe32125['body'][_0x6361('0x58')]){throw new Error('No\x20ListId\x20specified');}if(!_0xe32125[_0x6361('0x34')][_0x6361('0xa1')]){throw new Error(_0x6361('0xa2'));}if(!_0xe32125[_0x6361('0x34')]['binding_values']){throw new Error(_0x6361('0xa3'));}if(!_0xe32125[_0x6361('0x34')][_0x6361('0xa4')]){throw new Error(_0x6361('0xa5'));}var _0xaaf064=_0xe32125[_0x6361('0x34')][_0x6361('0xa1')][_0x6361('0xa6')](',');var _0x1b5944=_0xe32125[_0x6361('0x34')][_0x6361('0xa7')][_0x6361('0xa6')](',');if(!_0xaaf064[_0x6361('0x26')]||!_0x1b5944[_0x6361('0x26')]||_0xaaf064[_0x6361('0x26')]!==_0x1b5944['length']){throw new Error(_0x6361('0xa8'));}_0xe32125['body'][_0x6361('0x7b')]=_[_0x6361('0xa9')](_0xaaf064,_0x1b5944);if(!_0xe32125[_0x6361('0x34')][_0x6361('0x7b')][_0x6361('0x73')]){throw new Error(_0x6361('0xaa'));}if(!_0xe32125['body'][_0x6361('0x7b')][_0x6361('0xab')]){throw new Error(_0x6361('0xac'));}var _0x1e0c5e=path['join'](config['root'],_0x6361('0xad'),_0xe32125[_0x6361('0xae')][_0x6361('0xaf')]);fs['chmodSync'](_0x1e0c5e,parseInt(_0x6361('0xb0'),0x8));var _0xe79b2=require('child_process')['fork'](path[_0x6361('0x4e')](__dirname,'../../components/import/cm/csv'),[_0x1e0c5e,_0xe32125[_0x6361('0x34')][_0x6361('0xa1')],_0xe32125['body'][_0x6361('0xa7')],_0xe32125[_0x6361('0x34')]['ListId'],_0xe32125['body'][_0x6361('0xb1')],_0xe32125[_0x6361('0x34')][_0x6361('0x54')],_0xe32125[_0x6361('0x34')][_0x6361('0xa4')]]);return _0xccd03d[_0x6361('0xf')](0xc8)[_0x6361('0x10')]({'message':_0x6361('0xb2'),'pid':_0xe79b2[_0x6361('0xb3')]});}catch(_0x2f8fc2){return _0xccd03d[_0x6361('0xf')](0x1f4)[_0x6361('0x1c')](_0x2f8fc2);}};exports[_0x6361('0xb4')]=function(_0x1e4a2c,_0x3e0d5c){var _0x223aaf=fs[_0x6361('0xb5')](_0x1e4a2c[_0x6361('0xae')][_0x6361('0x3')]);Papa[_0x6361('0xb6')](_0x223aaf,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x49753c){return _0x3e0d5c[_0x6361('0xf')](0xc8)['json']({'file':_0x1e4a2c[_0x6361('0xae')],'fields':_0x49753c[_0x6361('0xb7')][_0x6361('0x7b')]});}});};exports['import']=function(_0x2e73ed,_0x34fa40){return db['User'][_0x6361('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x6361('0xb8')}})[_0x6361('0x19')](function(_0x5701c2){var _0x35f7bf=![];if(!_0x2e73ed[_0x6361('0x34')][_0x6361('0x58')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2e73ed[_0x6361('0x34')][_0x6361('0xb9')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2e73ed[_0x6361('0x34')][_0x6361('0xb9')][_0x6361('0xab')]){throw new Error(_0x6361('0xac'));}if(!_0x2e73ed[_0x6361('0x34')][_0x6361('0xa4')]){throw new Error(_0x6361('0xa5'));}var _0x5054de=require(_0x6361('0xba'))[_0x6361('0xbb')](path[_0x6361('0x4e')](__dirname,_0x6361('0xbc')),[_0x2e73ed[_0x6361('0x21')]['id'],JSON[_0x6361('0xbd')](_0x2e73ed['body']),JSON[_0x6361('0xbd')](_0x5701c2)]);_0x5054de['on'](_0x6361('0xbe'),function(){_0x35f7bf=!![];return _0x34fa40[_0x6361('0xf')](0xc8)[_0x6361('0x10')]({'message':_0x6361('0xbf'),'pid':_0x5054de[_0x6361('0xb3')]});});_0x5054de['on'](_0x6361('0xc0'),function(_0x3c6e48){if(_0x3c6e48&&!_0x35f7bf){return _0x34fa40[_0x6361('0xf')](0x1f4)['json']({'message':_0x6361('0xc1'),'pid':_0x5054de[_0x6361('0xb3')]});}});})[_0x6361('0x22')](handleError(_0x34fa40,null));};exports[_0x6361('0xc2')]=function(_0x4dc75a,_0xe769a){return db[_0x6361('0xc3')][_0x6361('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x6361('0xb8')}})[_0x6361('0x19')](function(_0x3f298c){var _0x3b3ca1=![];if(!_0x4dc75a[_0x6361('0x34')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x4dc75a[_0x6361('0x34')][_0x6361('0xb9')][_0x6361('0x73')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4dc75a[_0x6361('0x34')][_0x6361('0xb9')][_0x6361('0xab')]){throw new Error(_0x6361('0xac'));}if(!_0x4dc75a[_0x6361('0x34')]['socket_timestamp']){throw new Error(_0x6361('0xa5'));}var _0x563728=require('child_process')[_0x6361('0xbb')](path['join'](__dirname,'../../components/import/cm/csvUpdates'),[_0x4dc75a[_0x6361('0x21')]['id'],JSON[_0x6361('0xbd')](_0x4dc75a[_0x6361('0x34')]),JSON[_0x6361('0xbd')](_0x3f298c)]);_0x563728['on'](_0x6361('0xbe'),function(){_0x3b3ca1=!![];return _0xe769a[_0x6361('0xf')](0xc8)[_0x6361('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x563728[_0x6361('0xb3')]});});_0x563728['on'](_0x6361('0xc0'),function(_0x1e1603){if(_0x1e1603&&!_0x3b3ca1){return _0xe769a[_0x6361('0xf')](0x1f4)[_0x6361('0x10')]({'message':_0x6361('0xc1'),'pid':_0x563728[_0x6361('0xb3')]});}});})[_0x6361('0x22')](handleError(_0xe769a,null));};exports[_0x6361('0xc4')]=function(_0x22df70,_0xe9af5d){var _0x979e28=[_0x6361('0xc5'),'chat',_0x6361('0xc6'),'openchannel',_0x6361('0xc7'),_0x6361('0xc8'),_0x6361('0xc9')];var _0x4538dc={'offset':0x0,'order':qs[_0x6361('0x7d')](_0x6361('0xca'))},_0x7f0516={'count':0x0,'rows':[]};Promise[_0x6361('0xcb')]()[_0x6361('0x19')](function(){if(_0x22df70[_0x6361('0x1f')][_0x6361('0xcc')]){if(!_[_0x6361('0xcd')](_0x979e28,_0x22df70[_0x6361('0x1f')]['channel'][_0x6361('0xce')]())){throw new Error(_0x6361('0xcf'));}_0x979e28=[_0x22df70['query']['channel'][_0x6361('0xce')]()];}if(_0x22df70[_0x6361('0x1f')][_0x6361('0xd0')]){try{var _0x55e111=JSON['parse'](_0x22df70[_0x6361('0x1f')][_0x6361('0xd0')]);if(!moment(_0x55e111[_0x6361('0x35')])[_0x6361('0xd1')]()){throw new Error(_0x6361('0xd2'));}if(!moment(_0x55e111['to'])[_0x6361('0xd1')]()){throw new Error(_0x6361('0xd3'));}}catch(_0x5a54fe){throw new Error(_0x6361('0xd4'));}}if(!_0x22df70[_0x6361('0x1f')]['hasOwnProperty'](_0x6361('0x80'))){_0x4538dc[_0x6361('0x14')]=qs[_0x6361('0x14')](_0x22df70['query'][_0x6361('0x14')]||0xa);_0x4538dc[_0x6361('0x13')]=qs[_0x6361('0x13')](_0x22df70[_0x6361('0x1f')][_0x6361('0x13')]);}var _0x4ea02e=_0x979e28[_0x6361('0x67')](function(_0x318032){if(_0x318032==='voice'){var _0x127b7a={'attributes':['id',_0x6361('0xd5'),'type',_0x6361('0xd6'),_0x6361('0xd7'),_0x6361('0xd8'),'starttime',_0x6361('0xd9'),_0x6361('0xda'),'note',_0x6361('0xdb'),_0x6361('0xdc'),_0x6361('0xdd'),_0x6361('0xde'),_0x6361('0xdf')],'where':{'ContactId':_0x22df70['params']['id']},'include':[{'model':db[_0x6361('0xc3')],'as':_0x6361('0xc3'),'attributes':['id','name',_0x6361('0xe0'),_0x6361('0x2b')]}],'order':[['createdAt',_0x6361('0xe1')]]};if(_0x22df70[_0x6361('0x1f')][_0x6361('0xd0')]){_0x127b7a[_0x6361('0x55')][_0x6361('0xdb')]={'$gte':_0x55e111[_0x6361('0x35')],'$lte':_0x55e111['to']};}return db[_0x6361('0xe2')][_0x6361('0xe3')](_0x127b7a)[_0x6361('0x19')](function(_0x1a754a){_0x7f0516['count']+=_0x1a754a[_0x6361('0x12')];return _[_0x6361('0x67')](_0x1a754a[_0x6361('0x99')],function(_0x320958){var _0x16181d=_0x320958[_0x6361('0x36')]({'plain':!![]});_0x16181d[_0x6361('0xcc')]=_0x318032;if(_0x16181d[_0x6361('0xc3')]){_0x16181d[_0x6361('0xc3')]={'id':_0x16181d[_0x6361('0xc3')]['id'],'name':_0x16181d[_0x6361('0xc3')][_0x6361('0x1b')],'fullname':_0x16181d[_0x6361('0xc3')]['fullname'],'alias':_0x16181d[_0x6361('0xc3')][_0x6361('0x2b')]};}return _0x16181d;});});}else{var _0x49c823=_[_0x6361('0xe4')](_0x318032)+(_0x318032==='chat'?_0x6361('0xe5'):_0x6361('0xe6'));var _0x1bcbdd={'attributes':['id',_0x6361('0xe7'),_0x6361('0xe8'),_0x6361('0xdb'),'note',_0x6361('0xe9'),'secondDisposition',_0x6361('0xea'),'UserId',_0x49c823+'Id'],'where':{'ContactId':_0x22df70[_0x6361('0x21')]['id']},'include':[{'model':db[_0x49c823],'as':'Account','attributes':['id','name',_0x6361('0xeb')]},{'model':db[_0x6361('0xc3')],'as':'Owner','attributes':['id',_0x6361('0x1b'),_0x6361('0xe0')]},{'model':db[_0x6361('0x5e')],'as':_0x6361('0xec'),'attributes':['id','name',_0x6361('0x5f')],'through':{'attributes':[]}}],'order':[['createdAt',_0x6361('0xe1')]]};if(_0x22df70[_0x6361('0x1f')][_0x6361('0xd0')]){_0x1bcbdd['where']['createdAt']={'$gte':_0x55e111[_0x6361('0x35')],'$lte':_0x55e111['to']};}switch(_0x318032){case'chat':_0x1bcbdd[_0x6361('0x7a')][_0x6361('0x57')]('browserName',_0x6361('0xed'),_0x6361('0xee'),_0x6361('0xef'),_0x6361('0xf0'),_0x6361('0xf1'),'ratingType',_0x6361('0xf2'),_0x6361('0xf3'));break;case _0x6361('0xc5'):_0x1bcbdd[_0x6361('0x7a')]['push']('subject','substatus');break;case _0x6361('0xf4'):_0x1bcbdd[_0x6361('0x7a')]['push'](_0x6361('0xf5'),_0x6361('0xf6'));break;}return db[_['startCase'](_0x318032)+'Interaction'][_0x6361('0xe3')](_0x1bcbdd)['then'](function(_0x33bbf3){_0x7f0516['count']+=_0x33bbf3[_0x6361('0x12')];return _[_0x6361('0x67')](_0x33bbf3[_0x6361('0x99')],function(_0xd1e636){var _0x33c011=_0xd1e636[_0x6361('0x36')]({'plain':!![]});_0x33c011['channel']=_0x318032;if(_0x33c011[_0x6361('0xf7')]){_0x33c011['Owner']={'id':_0x33c011[_0x6361('0xf7')]['id'],'name':_0x33c011[_0x6361('0xf7')]['name'],'fullname':_0x33c011[_0x6361('0xf7')][_0x6361('0xe0')]};}return _0x33c011;});});}});return Promise[_0x6361('0x5b')](_0x4ea02e);})[_0x6361('0x19')](function(_0x566338){return _(_0x566338)[_0x6361('0xf8')]()[_0x6361('0xf9')](_0x6361('0xdb'))[_0x6361('0xfa')]()['value']();})[_0x6361('0x19')](function(_0x3304ae){_0x7f0516[_0x6361('0x99')]=_0x4538dc[_0x6361('0x14')]?_0x3304ae[_0x6361('0xfb')](_0x4538dc['offset'],_0x4538dc[_0x6361('0x13')]+_0x4538dc[_0x6361('0x14')]):_0x3304ae;return _0x7f0516;})['then'](respondWithFilteredResult(_0xe9af5d,_0x4538dc))[_0x6361('0x22')](handleError(_0xe9af5d,null));}; \ No newline at end of file +var _0x4a19=['order','options','includeAll','include','getHopperHistories','findOne','nolimit','rows','getHopperFinals','ContactId','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','createReadStream','path','parse','meta','agent','binding','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','message','mail','chat','sms','openchannel','whatsapp','voice','resolve','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','note','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel','osName','ratingValue','referer','substatus','externalUrl','threadId','flatten','sortBy','reverse','value','slice','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','localhost','socket.io-emitter','./cmContact.socket','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','status','end','sendStatus','error','stack','name','send','index','describe','getOptions','findAll','catch','CmContact','find','params','tags','keys','length','cf_','columnName','displayName','query','analytics','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','isArray','join','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','hasOwnProperty','contact','all','show','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','CmCustomField','pickBy','startsWith','isEmpty','id\x20=\x20?','toParam','text','values','phone','CmHopper','getTags','Tag','rawAttributes','filters','model','attributes','fields','sort','pick','filter','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','intersection'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x4a19,0x169));var _0x94a1=function(_0x178719,_0x54c30c){_0x178719=_0x178719-0x0;var _0x2b3b56=_0x4a19[_0x178719];return _0x2b3b56;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x94a1('0x0'));var Papa=require(_0x94a1('0x1'));var Redis=require(_0x94a1('0x2'));var contacts=require(_0x94a1('0x3'));var qs=require(_0x94a1('0x4'));var logger=require(_0x94a1('0x5'))(_0x94a1('0x6'));var config=require(_0x94a1('0x7'));var shared=require(_0x94a1('0x8'));var db=require('../../mysqldb')['db'];config[_0x94a1('0x9')]=_['defaults'](config[_0x94a1('0x9')],{'host':_0x94a1('0xa'),'port':0x18eb});var socket=require(_0x94a1('0xb'))(new Redis(config['redis']));require(_0x94a1('0xc'))['register'](socket);function respondWithResult(_0x218fcc,_0xf87866){_0xf87866=_0xf87866||0xc8;return function(_0x52547c){if(_0x52547c){return _0x218fcc['status'](_0xf87866)['json'](_0x52547c);}};}function respondWithFilteredResult(_0x4ecf08,_0x1d0f32){return function(_0x568c5f){if(_0x568c5f){var _0x30d005=typeof _0x1d0f32['offset']===_0x94a1('0xd')&&typeof _0x1d0f32[_0x94a1('0xe')]===_0x94a1('0xd');var _0x50a953=_0x568c5f[_0x94a1('0xf')];var _0x2ea2af=_0x30d005?0x0:_0x1d0f32[_0x94a1('0x10')];var _0x455883=_0x30d005?_0x568c5f[_0x94a1('0xf')]:_0x1d0f32[_0x94a1('0x10')]+_0x1d0f32[_0x94a1('0xe')];var _0x1e2488;if(_0x455883>=_0x50a953){_0x455883=_0x50a953;_0x1e2488=0xc8;}else{_0x1e2488=0xce;}_0x4ecf08['status'](_0x1e2488);return _0x4ecf08[_0x94a1('0x11')](_0x94a1('0x12'),_0x2ea2af+'-'+_0x455883+'/'+_0x50a953)[_0x94a1('0x13')](_0x568c5f);}return null;};}function saveUpdates(_0x3954e4){return function(_0x4176f6){if(_0x4176f6){return _0x4176f6[_0x94a1('0x14')](_0x3954e4)[_0x94a1('0x15')](function(_0x396bc9){return _0x396bc9;});}return null;};}function removeEntity(_0x49c7fc){return function(_0x3aa6f7){if(_0x3aa6f7){return _0x3aa6f7[_0x94a1('0x16')]()[_0x94a1('0x15')](function(){_0x49c7fc[_0x94a1('0x17')](0xcc)[_0x94a1('0x18')]();});}};}function handleEntityNotFound(_0x4be2af){return function(_0x533384){if(!_0x533384){_0x4be2af[_0x94a1('0x19')](0x194);}return _0x533384;};}function handleError(_0xe58882,_0x172402){_0x172402=_0x172402||0x1f4;return function(_0x34cf2a){logger[_0x94a1('0x1a')](_0x34cf2a[_0x94a1('0x1b')]);if(_0x34cf2a['name']){delete _0x34cf2a[_0x94a1('0x1c')];}_0xe58882['status'](_0x172402)[_0x94a1('0x1d')](_0x34cf2a);};}exports[_0x94a1('0x1e')]=function(_0x3a17b2,_0x42ce61){var _0x4b11d9={};return contacts[_0x94a1('0x1f')]()[_0x94a1('0x15')](function(_0x278ffe){_0x4b11d9=qs[_0x94a1('0x20')](_0x278ffe,_0x3a17b2);return contacts[_0x94a1('0x21')](_0x3a17b2['query'],_0x3a17b2['user'],_0x4b11d9,_0x278ffe);})[_0x94a1('0x15')](respondWithFilteredResult(_0x42ce61,_0x4b11d9))[_0x94a1('0x22')](handleError(_0x42ce61,null));};exports[_0x94a1('0x16')]=function(_0x244bc2,_0x3e5668){return db[_0x94a1('0x23')][_0x94a1('0x24')]({'where':{'id':_0x244bc2[_0x94a1('0x25')]['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x3e5668,null))['then'](removeEntity(_0x3e5668,null))[_0x94a1('0x22')](handleError(_0x3e5668,null));};exports[_0x94a1('0x1f')]=function(_0x549725,_0x249439){return db['CmContact'][_0x94a1('0x1f')]()[_0x94a1('0x15')](function(_0x2e6c3c){delete _0x2e6c3c[_0x94a1('0x26')];for(var _0x1ec328=0x0;_0x1ec3280x0){return new Promise(function(_0x104207){var _0x62dbe5=[];for(var _0x1fd295=0x0;_0x1fd295<_0x52570e[_0x94a1('0x28')];_0x1fd295++){_0x62dbe5['push'](insertAdditionalPhones(_0x52570e[_0x1fd295][_0x94a1('0x5f')],_0x52570e[_0x1fd295][_0x94a1('0x55')]));}Promise[_0x94a1('0x60')](_0x62dbe5)[_0x94a1('0x15')](function(){_0x104207(0x1);});})[_0x94a1('0x15')](function(){return{'success':_0x1a3884,'failure':_0x3b6e16,'duplicates':_0x2e22f7};});}else{return{'success':_0x1a3884,'failure':_0x3b6e16,'duplicates':_0x2e22f7};}}})[_0x94a1('0x15')](respondWithResult(_0x58111b,0xc9))[_0x94a1('0x22')](handleError(_0x58111b,null));};exports[_0x94a1('0x61')]=function(_0x1fa4c7,_0x522bd0){var _0x2897e5;return db[_0x94a1('0x23')][_0x94a1('0x1f')]()[_0x94a1('0x15')](function(_0x5d1926){return db[_0x94a1('0x23')]['find']({'where':{'id':_0x1fa4c7[_0x94a1('0x25')]['id']},'include':[{'model':db['Tag'],'as':_0x94a1('0x62'),'attributes':['id','name',_0x94a1('0x63')],'required':_0x1fa4c7[_0x94a1('0x2c')][_0x94a1('0x64')]?!![]:![]},{'model':db[_0x94a1('0x45')],'as':_0x94a1('0x65'),'where':{'CmContactId':_0x1fa4c7['params']['id']},'required':![],'include':[{'model':db[_0x94a1('0x66')],'as':_0x94a1('0x67')}]}],'order':[db[_0x94a1('0x68')][_0x94a1('0x69')](_0x94a1('0x6a'))],'attributes':_[_0x94a1('0x27')](_0x5d1926)});})[_0x94a1('0x15')](function(_0xa1183){if(!_[_0x94a1('0x51')](_0xa1183)){_0x2897e5=_0xa1183[_0x94a1('0x36')]({'plain':!![]});var _0x27c537={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xa1183&&_0xa1183['ListId']){if(_0xa1183[_0x94a1('0x5c')]){_0x27c537[_0x94a1('0x59')][_0x94a1('0x6b')][_0x94a1('0x5b')]({'ListId':{'$ne':_0xa1183[_0x94a1('0x5c')]}});}}return db['CmCustomField'][_0x94a1('0x21')](_0x27c537);}})[_0x94a1('0x15')](function(_0x9d8a09){if(!_[_0x94a1('0x51')](_0x9d8a09)){return _[_0x94a1('0x6c')](_0x2897e5,_[_0x94a1('0x6d')](_0x9d8a09,function(_0x22021e){return util[_0x94a1('0x6e')]('cf_%d',_0x22021e['id']);}));}})[_0x94a1('0x15')](handleEntityNotFound(_0x522bd0,null))[_0x94a1('0x15')](respondWithResult(_0x522bd0,null))[_0x94a1('0x22')](handleError(_0x522bd0,null));};exports['update']=function(_0x219f12,_0x26069f){var _0x3d0687;if(_0x219f12['body']['id']){delete _0x219f12[_0x94a1('0x34')]['id'];}if(!_[_0x94a1('0x51')](_0x219f12[_0x94a1('0x34')]['dialTimezone'])){var _0x3d1456=_0x219f12['body'][_0x94a1('0x52')];if(!_[_0x94a1('0x51')](shared['timezones'][_0x3d1456]))_0x219f12[_0x94a1('0x34')]['utcOffset']=shared['timezones'][_0x3d1456][_0x94a1('0x54')];}return db[_0x94a1('0x23')][_0x94a1('0x24')]({'where':{'id':_0x219f12[_0x94a1('0x25')]['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x26069f,null))[_0x94a1('0x15')](saveUpdates(_0x219f12['body'],null))['then'](function(_0x34f1d4){_0x3d0687=_0x34f1d4;var _0x360bce={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x34f1d4&&_0x34f1d4['ListId']){if(_0x34f1d4[_0x94a1('0x5c')]){_0x360bce[_0x94a1('0x59')]['$and']['push']({'ListId':{'$ne':_0x34f1d4[_0x94a1('0x5c')]}});}}return db[_0x94a1('0x6f')][_0x94a1('0x21')](_0x360bce);})[_0x94a1('0x15')](function(_0x592c02){if(_0x592c02){return _['omit'](_[_0x94a1('0x70')](_0x219f12[_0x94a1('0x34')],function(_0x51044b,_0x2e6def){return _[_0x94a1('0x71')](_0x2e6def,_0x94a1('0x29'));}),_[_0x94a1('0x6d')](_0x592c02,function(_0x381955){return util['format']('cf_%d',_0x381955['id']);}));}})['then'](function(_0x28814a){if(_0x28814a&&!_[_0x94a1('0x72')](_0x28814a)){var _0x5b21d8=squel['update']()['table']('cm_contacts')['setFields'](_0x28814a)[_0x94a1('0x59')](_0x94a1('0x73'),_0x219f12['params']['id'])[_0x94a1('0x74')]();return db[_0x94a1('0x68')][_0x94a1('0x2c')](_0x5b21d8[_0x94a1('0x75')],{'replacements':_0x5b21d8[_0x94a1('0x76')]});}})[_0x94a1('0x15')](function(){if(_0x219f12[_0x94a1('0x34')][_0x94a1('0x77')]&&_0x3d0687){return db[_0x94a1('0x78')][_0x94a1('0x14')]({'phone':_0x219f12[_0x94a1('0x34')][_0x94a1('0x77')],'OrderBy':0x0},{'where':{'ContactId':_0x3d0687['id']}});}})[_0x94a1('0x15')](function(){return _0x3d0687;})[_0x94a1('0x15')](respondWithResult(_0x26069f,null))[_0x94a1('0x22')](handleError(_0x26069f,null));};exports[_0x94a1('0x79')]=function(_0x31b5c9,_0x401a67){var _0x33d8db={};var _0x388f77={};var _0x641db2;var _0x383a91;return db[_0x94a1('0x23')]['findOne']({'where':{'id':_0x31b5c9[_0x94a1('0x25')]['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x401a67,null))['then'](function(_0x222a18){if(_0x222a18){_0x641db2=_0x222a18;_0x388f77['model']=_[_0x94a1('0x27')](db[_0x94a1('0x7a')][_0x94a1('0x7b')]);_0x388f77[_0x94a1('0x2c')]=_[_0x94a1('0x27')](_0x31b5c9[_0x94a1('0x2c')]);_0x388f77[_0x94a1('0x7c')]=_['intersection'](_0x388f77[_0x94a1('0x7d')],_0x388f77[_0x94a1('0x2c')]);_0x33d8db[_0x94a1('0x7e')]=_['intersection'](_0x388f77[_0x94a1('0x7d')],qs[_0x94a1('0x7f')](_0x31b5c9[_0x94a1('0x2c')][_0x94a1('0x7f')]));_0x33d8db['attributes']=_0x33d8db['attributes']['length']?_0x33d8db[_0x94a1('0x7e')]:_0x388f77[_0x94a1('0x7d')];_0x33d8db['order']=qs['sort'](_0x31b5c9['query'][_0x94a1('0x80')]);_0x33d8db[_0x94a1('0x59')]=qs[_0x94a1('0x7c')](_[_0x94a1('0x81')](_0x31b5c9[_0x94a1('0x2c')],_0x388f77[_0x94a1('0x7c')]));if(_0x31b5c9['query'][_0x94a1('0x82')]){_0x33d8db[_0x94a1('0x59')]=_[_0x94a1('0x33')](_0x33d8db[_0x94a1('0x59')],{'$or':_[_0x94a1('0x6d')](_0x33d8db[_0x94a1('0x7e')],function(_0xebe89e){var _0x5b23e7={};_0x5b23e7[_0xebe89e]={'$like':'%'+_0x31b5c9[_0x94a1('0x2c')][_0x94a1('0x82')]+'%'};return _0x5b23e7;})});}_0x33d8db=_[_0x94a1('0x33')]({},_0x33d8db,_0x31b5c9['options']);return _0x641db2['getTags'](_0x33d8db);}})['then'](function(_0x955963){if(_0x955963){_0x383a91=_0x955963[_0x94a1('0x28')];if(!_0x31b5c9[_0x94a1('0x2c')][_0x94a1('0x5e')]('nolimit')){_0x33d8db[_0x94a1('0xe')]=qs[_0x94a1('0xe')](_0x31b5c9[_0x94a1('0x2c')][_0x94a1('0xe')]);_0x33d8db['offset']=qs[_0x94a1('0x10')](_0x31b5c9[_0x94a1('0x2c')][_0x94a1('0x10')]);}return _0x641db2['getTags'](_0x33d8db);}})[_0x94a1('0x15')](function(_0x5ccdaf){if(_0x5ccdaf){return _0x5ccdaf?{'count':_0x383a91,'rows':_0x5ccdaf}:null;}})[_0x94a1('0x15')](respondWithResult(_0x401a67,null))[_0x94a1('0x22')](handleError(_0x401a67,null));};exports[_0x94a1('0x83')]=function(_0x3fef00,_0x3fba53){if(_0x3fef00[_0x94a1('0x34')]['id']){delete _0x3fef00[_0x94a1('0x34')]['id'];}return db[_0x94a1('0x23')]['findOne']({'where':{'id':_0x3fef00['params']['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x3fba53,null))[_0x94a1('0x15')](function(_0x3c4e5a){if(_0x3c4e5a){return _0x3c4e5a[_0x94a1('0x83')](_0x3fef00['body'][_0x94a1('0x84')]||[]);}return null;})[_0x94a1('0x15')](respondWithResult(_0x3fba53,null))[_0x94a1('0x22')](handleError(_0x3fba53,null));};exports[_0x94a1('0x85')]=function(_0x4efcc2,_0x5de7d3){var _0x4ab7d2=[];_0x4ab7d2[_0x94a1('0x5b')](addAdditionalPhones(_0x4efcc2['body']));Promise[_0x94a1('0x60')](_0x4ab7d2)[_0x94a1('0x15')](function(){_0x4ab7d2=[];_0x4ab7d2[_0x94a1('0x5b')](deleteCmHopperPhones(_0x4efcc2[_0x94a1('0x34')]['id']));_0x4ab7d2['push'](addCmHopperPhones(_0x4efcc2[_0x94a1('0x34')]['id']));Promise[_0x94a1('0x60')](_0x4ab7d2)[_0x94a1('0x15')](function(){return[0x1];})['then'](respondWithResult(_0x5de7d3,null));});};function addAdditionalPhones(_0x3ab9f3){var _0x5547b4;return new Promise(function(_0x5bdb15){return db[_0x94a1('0x45')][_0x94a1('0x16')]({'where':{'CmContactId':_0x3ab9f3['id']}})[_0x94a1('0x15')](function(){db[_0x94a1('0x66')][_0x94a1('0x21')]({'raw':!![],'attributes':['id',_0x94a1('0x86')]})[_0x94a1('0x15')](function(_0x302c52){var _0x1d7583=[];for(var _0x58cb4a=0x0;_0x58cb4a<_0x3ab9f3[_0x94a1('0x87')]['length'];_0x58cb4a++){var _0x237d96=_0x3ab9f3[_0x94a1('0x88')]?_[_0x94a1('0x51')](_0x3ab9f3[_0x94a1('0x88')][_0x58cb4a])?'':_0x3ab9f3[_0x94a1('0x88')][_0x58cb4a]:_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a]['ItemTypeId']?_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x89')]:'';var _0x5ede51=_[_0x94a1('0x51')](_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x8a')])?'':_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x8a')];var _0x14cfef=_0x237d96+':'+_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x77')]+'§'+_0x5ede51;if(_['isNil'](_0x5547b4))_0x5547b4=_0x14cfef;else _0x5547b4+=';'+_0x14cfef;var _0x3b09ea=null;var _0x74ce91=null;if(_0x3ab9f3[_0x94a1('0x88')]){if(!_['isNil'](_0x3ab9f3[_0x94a1('0x88')][_0x58cb4a])){_0x74ce91=_['find'](_0x302c52,function(_0x328910){return _0x328910['id']===_0x3ab9f3['item_types'][_0x58cb4a];});if(!_[_0x94a1('0x51')](_0x74ce91)){_0x3b09ea=_0x74ce91['OrderBy'];}}}else{if(!_[_0x94a1('0x51')](_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a])){_0x74ce91=_[_0x94a1('0x24')](_0x302c52,function(_0x3b5664){return _0x3b5664['id']===_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x89')];});if(!_[_0x94a1('0x51')](_0x74ce91)){_0x3b09ea=_0x58cb4a;}}}if(_[_0x94a1('0x51')](_0x3b09ea)){_0x3b09ea=0x64;}_0x1d7583[_0x94a1('0x5b')](addAdditionalPhone(_0x3ab9f3['id'],_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x77')],_0x3ab9f3['item_types']?_['isNil'](_0x3ab9f3[_0x94a1('0x88')][_0x58cb4a])?null:_0x3ab9f3[_0x94a1('0x88')][_0x58cb4a]:_0x3ab9f3['items'][_0x58cb4a][_0x94a1('0x89')]?_0x3ab9f3[_0x94a1('0x87')][_0x58cb4a][_0x94a1('0x89')]:null,_0x3b09ea,_0x5ede51));}Promise[_0x94a1('0x60')](_0x1d7583)[_0x94a1('0x15')](function(){db[_0x94a1('0x23')][_0x94a1('0x14')]({'AdditionalPhones':_0x5547b4},{'where':{'id':_0x3ab9f3['id']}})['then'](function(){_0x5bdb15(0x1);});});});});});}function addAdditionalPhone(_0x4c4a89,_0x123122,_0x5b1297,_0x384644,_0x59b0d6){return db['CmContactHasItem'][_0x94a1('0x24')]({'where':{'CmContactId':_0x4c4a89,'item':_0x123122}})[_0x94a1('0x15')](function(_0x50ce39){if(_0x50ce39)logger[_0x94a1('0x30')](_0x94a1('0x8b'),_0x50ce39);else{db[_0x94a1('0x45')][_0x94a1('0x3c')]({'CmContactId':_0x4c4a89,'item':_0x123122,'ItemTypeId':_0x5b1297,'OrderBy':_0x384644,'ItemClass':_0x94a1('0x8c'),'description':_0x59b0d6});}});}function deleteCmHopperPhones(_0x3cfcd5){return new Promise(function(_0x52b653){return db[_0x94a1('0x78')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3cfcd5}})[_0x94a1('0x15')](function(_0x13a429){db[_0x94a1('0x8d')][_0x94a1('0x16')]({'where':{'CmHopperId':{'$in':_[_0x94a1('0x6d')](_0x13a429,'id')}}});})[_0x94a1('0x15')](function(){_0x52b653(0x1);});});}function addCmHopperPhones(_0x1cfd95){return new Promise(function(_0x59c558){return db[_0x94a1('0x78')][_0x94a1('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1cfd95}})[_0x94a1('0x15')](function(_0x448780){var _0x5bb4a3=[];_[_0x94a1('0x6d')](_0x448780,function(_0x43a64d){_0x5bb4a3[_0x94a1('0x5b')](createCmHopperPhone(_0x1cfd95,_0x43a64d['id']));});Promise[_0x94a1('0x60')](_0x5bb4a3)[_0x94a1('0x15')](function(){_0x59c558(0x1);});});});}function createCmHopperPhone(_0x4cd0a4,_0x585880){return new Promise(function(_0x1c652a){db[_0x94a1('0x45')][_0x94a1('0x21')]({'raw':!![],'attributes':[_0x94a1('0x8e'),_0x94a1('0x86')],'where':{'CmContactId':_0x4cd0a4,'ItemClass':_0x94a1('0x8c')},'include':[{'model':db[_0x94a1('0x66')],'attributes':[_0x94a1('0x86')],'as':_0x94a1('0x67')}],'order':['OrderBy',db[_0x94a1('0x68')][_0x94a1('0x69')](_0x94a1('0x8f'))]})[_0x94a1('0x15')](function(_0x1aa6de){var _0x52ac55=0x1;var _0x4f0660=_['map'](_0x1aa6de,function(_0x4f264e){_0x4f264e[_0x94a1('0x90')]=_0x585880;_0x4f264e['phone']=_0x4f264e[_0x94a1('0x8e')];_0x4f264e[_0x94a1('0x86')]=_0x52ac55;delete _0x4f264e['ItemType.OrderBy'];_0x52ac55=_0x52ac55+0x1;return _0x4f264e;});return db['CmHopperAdditionalPhone'][_0x94a1('0x56')](_0x4f0660,{});})[_0x94a1('0x15')](function(){_0x1c652a(0x1);});});}function insertAdditionalPhones(_0x34f8c4,_0x5553c9){return new Promise(function(_0x4cd835){var _0x5e57e2=[];for(var _0x391ef6=0x0;_0x391ef6<_0x5553c9[_0x94a1('0x28')];_0x391ef6++){var _0xfd4af7=_0x5553c9[_0x391ef6];_0x5e57e2[_0x94a1('0x5b')](parseContactItemType(_0xfd4af7));}Promise['all'](_0x5e57e2)[_0x94a1('0x15')](function(){var _0x39c117={'id':_0x34f8c4['id'],'items':_0x5553c9};return addAdditionalPhones(_0x39c117)[_0x94a1('0x15')](function(){return addCmHopperPhones(_0x34f8c4['id']);});})[_0x94a1('0x15')](function(){_0x4cd835(_0x34f8c4);});});}function parseContactItemType(_0x469538){return new Promise(function(_0x567334){if(_0x469538[_0x94a1('0x5e')](_0x94a1('0x89'))){_0x567334(_0x469538);}else{return db[_0x94a1('0x66')]['find']({'where':{'name':_0x469538[_0x94a1('0x67')]}})['then'](function(_0x13e0bf){if(_['isNil'](_0x13e0bf))_0x469538[_0x94a1('0x89')]=null;else _0x469538[_0x94a1('0x89')]=_0x13e0bf['id'];_0x567334(_0x469538);});}});}exports['getAdditionalPhones']=function(_0x109e0d,_0x489dd6){return db[_0x94a1('0x45')][_0x94a1('0x21')]({'raw':!![],'where':{'CmContactId':_0x109e0d[_0x94a1('0x25')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x94a1('0x66')],'as':_0x94a1('0x67')}],'order':[[_0x94a1('0x86')],[db[_0x94a1('0x68')]['literal'](_0x94a1('0x8f'))]]})[_0x94a1('0x15')](function(_0x85050b){return _0x85050b;})['then'](respondWithResult(_0x489dd6,null))[_0x94a1('0x22')](handleError(_0x489dd6,null));};exports[_0x94a1('0x91')]=function(_0x4c0764,_0x5ef2bd){return db['CmContactHasItem'][_0x94a1('0x21')]({'raw':!![],'where':{'CmContactId':_0x4c0764[_0x94a1('0x34')][_0x94a1('0x92')]}})[_0x94a1('0x15')](function(_0x5e9d75){var _0x56226f=_[_0x94a1('0x6d')](_0x5e9d75,function(_0x4a38b8){_0x4a38b8[_0x94a1('0x93')]=_0x4c0764[_0x94a1('0x34')][_0x94a1('0x94')];return _0x4a38b8;});return db['CmContactHasItem'][_0x94a1('0x56')](_0x56226f,{});})[_0x94a1('0x15')](function(){return addCmHopperPhones(_0x4c0764['body']['toContactId']);})['then'](function(){return['ok'];})['then'](respondWithResult(_0x5ef2bd,null))[_0x94a1('0x22')](handleError(_0x5ef2bd,null));};exports[_0x94a1('0x95')]=function(_0x37dc74,_0x1e5d79){var _0x1080b6=[];_0x1080b6['push'](createCmHopperPhone(_0x37dc74[_0x94a1('0x34')]['id'],_0x37dc74[_0x94a1('0x34')][_0x94a1('0x96')]));Promise[_0x94a1('0x60')](_0x1080b6)[_0x94a1('0x15')](function(){return[0x1];})['then'](respondWithResult(_0x1e5d79,null));};exports[_0x94a1('0x97')]=function(_0x4278ea,_0x3e11c4){var _0xbdc164={'raw':![],'where':{}};var _0x56a86d={};var _0x14b6a7={'count':0x0,'rows':[]};return db[_0x94a1('0x23')]['findOne']({'where':{'id':_0x4278ea[_0x94a1('0x25')]['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x3e11c4,null))[_0x94a1('0x15')](function(_0x2b64ae){if(_0x2b64ae){_0x56a86d[_0x94a1('0x7d')]=_[_0x94a1('0x27')](db[_0x94a1('0x78')][_0x94a1('0x7b')]);_0x56a86d[_0x94a1('0x2c')]=_['keys'](_0x4278ea[_0x94a1('0x2c')]);_0x56a86d[_0x94a1('0x7c')]=_[_0x94a1('0x98')](_0x56a86d[_0x94a1('0x7d')],_0x56a86d['query']);_0xbdc164[_0x94a1('0x7e')]=_[_0x94a1('0x98')](_0x56a86d['model'],qs[_0x94a1('0x7f')](_0x4278ea[_0x94a1('0x2c')]['fields']));_0xbdc164[_0x94a1('0x7e')]=_0xbdc164[_0x94a1('0x7e')][_0x94a1('0x28')]?_0xbdc164[_0x94a1('0x7e')]:_0x56a86d[_0x94a1('0x7d')];if(!_0x4278ea[_0x94a1('0x2c')][_0x94a1('0x5e')]('nolimit')){_0xbdc164['limit']=qs[_0x94a1('0xe')](_0x4278ea[_0x94a1('0x2c')]['limit']);_0xbdc164['offset']=qs['offset'](_0x4278ea[_0x94a1('0x2c')]['offset']);}_0xbdc164[_0x94a1('0x99')]=qs[_0x94a1('0x80')](_0x4278ea[_0x94a1('0x2c')][_0x94a1('0x80')]);_0xbdc164[_0x94a1('0x59')]=qs[_0x94a1('0x7c')](_[_0x94a1('0x81')](_0x4278ea['query'],_0x56a86d[_0x94a1('0x7c')]));_0xbdc164[_0x94a1('0x59')]['ContactId']=_0x2b64ae['id'];if(_0x4278ea[_0x94a1('0x2c')][_0x94a1('0x82')]){_0xbdc164['where']=_['merge'](_0xbdc164[_0x94a1('0x59')],{'$or':_[_0x94a1('0x6d')](_0xbdc164[_0x94a1('0x7e')],function(_0x12a6ed){var _0x104421={};_0x104421[_0x12a6ed]={'$like':'%'+_0x4278ea[_0x94a1('0x2c')][_0x94a1('0x82')]+'%'};return _0x104421;})});}_0xbdc164=_['merge']({},_0xbdc164,_0x4278ea[_0x94a1('0x9a')]);return db['CmHopper'][_0x94a1('0xf')]({'where':_0xbdc164['where']})[_0x94a1('0x15')](function(_0x1e5d89){_0x14b6a7[_0x94a1('0xf')]=_0x1e5d89;if(_0x4278ea['query'][_0x94a1('0x9b')]){_0xbdc164[_0x94a1('0x9c')]=[{'all':!![]}];}return db[_0x94a1('0x78')][_0x94a1('0x21')](_0xbdc164);})['then'](function(_0x193d86){_0x14b6a7['rows']=_0x193d86;return _0x14b6a7;});}})['then'](respondWithFilteredResult(_0x3e11c4,_0xbdc164))[_0x94a1('0x22')](handleError(_0x3e11c4,null));};exports[_0x94a1('0x9d')]=function(_0xbb5d10,_0x4111cb){var _0x30dcfa={'raw':!![],'where':{}};var _0x3f785e={};var _0x1663f6={'count':0x0,'rows':[]};return db[_0x94a1('0x23')][_0x94a1('0x9e')]({'where':{'id':_0xbb5d10[_0x94a1('0x25')]['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x4111cb,null))[_0x94a1('0x15')](function(_0x106db3){if(_0x106db3){_0x3f785e[_0x94a1('0x7d')]=_[_0x94a1('0x27')](db[_0x94a1('0x47')][_0x94a1('0x7b')]);_0x3f785e[_0x94a1('0x2c')]=_['keys'](_0xbb5d10[_0x94a1('0x2c')]);_0x3f785e[_0x94a1('0x7c')]=_[_0x94a1('0x98')](_0x3f785e['model'],_0x3f785e[_0x94a1('0x2c')]);_0x30dcfa[_0x94a1('0x7e')]=_[_0x94a1('0x98')](_0x3f785e[_0x94a1('0x7d')],qs[_0x94a1('0x7f')](_0xbb5d10[_0x94a1('0x2c')]['fields']));_0x30dcfa[_0x94a1('0x7e')]=_0x30dcfa[_0x94a1('0x7e')][_0x94a1('0x28')]?_0x30dcfa[_0x94a1('0x7e')]:_0x3f785e[_0x94a1('0x7d')];if(!_0xbb5d10['query'][_0x94a1('0x5e')](_0x94a1('0x9f'))){_0x30dcfa[_0x94a1('0xe')]=qs[_0x94a1('0xe')](_0xbb5d10[_0x94a1('0x2c')][_0x94a1('0xe')]);_0x30dcfa['offset']=qs[_0x94a1('0x10')](_0xbb5d10[_0x94a1('0x2c')]['offset']);}_0x30dcfa[_0x94a1('0x99')]=qs[_0x94a1('0x80')](_0xbb5d10[_0x94a1('0x2c')][_0x94a1('0x80')]);_0x30dcfa[_0x94a1('0x59')]=qs[_0x94a1('0x7c')](_[_0x94a1('0x81')](_0xbb5d10[_0x94a1('0x2c')],_0x3f785e[_0x94a1('0x7c')]));_0x30dcfa[_0x94a1('0x59')]['ContactId']=_0x106db3['id'];if(_0xbb5d10[_0x94a1('0x2c')][_0x94a1('0x82')]){_0x30dcfa[_0x94a1('0x59')]=_['merge'](_0x30dcfa[_0x94a1('0x59')],{'$or':_[_0x94a1('0x6d')](_0x30dcfa[_0x94a1('0x7e')],function(_0x4b389a){var _0xcd64b={};_0xcd64b[_0x4b389a]={'$like':'%'+_0xbb5d10[_0x94a1('0x2c')][_0x94a1('0x82')]+'%'};return _0xcd64b;})});}_0x30dcfa=_[_0x94a1('0x33')]({},_0x30dcfa,_0xbb5d10[_0x94a1('0x9a')]);return db['CmHopperHistory']['count']({'where':_0x30dcfa['where']})[_0x94a1('0x15')](function(_0xf2fe15){_0x1663f6[_0x94a1('0xf')]=_0xf2fe15;if(_0xbb5d10[_0x94a1('0x2c')][_0x94a1('0x9b')]){_0x30dcfa[_0x94a1('0x9c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x94a1('0x21')](_0x30dcfa);})['then'](function(_0x192028){_0x1663f6[_0x94a1('0xa0')]=_0x192028;return _0x1663f6;});}})['then'](respondWithFilteredResult(_0x4111cb,_0x30dcfa))[_0x94a1('0x22')](handleError(_0x4111cb,null));};exports[_0x94a1('0xa1')]=function(_0x4edd90,_0x518ef9){var _0x45c439={'raw':!![],'where':{}};var _0x36e474={};var _0x365664={'count':0x0,'rows':[]};return db[_0x94a1('0x23')][_0x94a1('0x9e')]({'where':{'id':_0x4edd90[_0x94a1('0x25')]['id']}})[_0x94a1('0x15')](handleEntityNotFound(_0x518ef9,null))['then'](function(_0x2075e6){if(_0x2075e6){_0x36e474['model']=_[_0x94a1('0x27')](db[_0x94a1('0x46')][_0x94a1('0x7b')]);_0x36e474[_0x94a1('0x2c')]=_[_0x94a1('0x27')](_0x4edd90['query']);_0x36e474[_0x94a1('0x7c')]=_[_0x94a1('0x98')](_0x36e474[_0x94a1('0x7d')],_0x36e474[_0x94a1('0x2c')]);_0x45c439[_0x94a1('0x7e')]=_['intersection'](_0x36e474['model'],qs[_0x94a1('0x7f')](_0x4edd90[_0x94a1('0x2c')][_0x94a1('0x7f')]));_0x45c439[_0x94a1('0x7e')]=_0x45c439['attributes'][_0x94a1('0x28')]?_0x45c439[_0x94a1('0x7e')]:_0x36e474[_0x94a1('0x7d')];if(!_0x4edd90[_0x94a1('0x2c')]['hasOwnProperty']('nolimit')){_0x45c439[_0x94a1('0xe')]=qs[_0x94a1('0xe')](_0x4edd90[_0x94a1('0x2c')][_0x94a1('0xe')]);_0x45c439[_0x94a1('0x10')]=qs[_0x94a1('0x10')](_0x4edd90[_0x94a1('0x2c')][_0x94a1('0x10')]);}_0x45c439['order']=qs['sort'](_0x4edd90[_0x94a1('0x2c')][_0x94a1('0x80')]);_0x45c439['where']=qs[_0x94a1('0x7c')](_[_0x94a1('0x81')](_0x4edd90['query'],_0x36e474[_0x94a1('0x7c')]));_0x45c439['where'][_0x94a1('0xa2')]=_0x2075e6['id'];if(_0x4edd90[_0x94a1('0x2c')][_0x94a1('0x82')]){_0x45c439[_0x94a1('0x59')]=_[_0x94a1('0x33')](_0x45c439[_0x94a1('0x59')],{'$or':_[_0x94a1('0x6d')](_0x45c439['attributes'],function(_0x2391e6){var _0x35ed6={};_0x35ed6[_0x2391e6]={'$like':'%'+_0x4edd90[_0x94a1('0x2c')][_0x94a1('0x82')]+'%'};return _0x35ed6;})});}_0x45c439=_[_0x94a1('0x33')]({},_0x45c439,_0x4edd90[_0x94a1('0x9a')]);return db[_0x94a1('0x46')]['count']({'where':_0x45c439[_0x94a1('0x59')]})[_0x94a1('0x15')](function(_0xc12d39){_0x365664['count']=_0xc12d39;if(_0x4edd90[_0x94a1('0x2c')][_0x94a1('0x9b')]){_0x45c439['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x94a1('0x21')](_0x45c439);})[_0x94a1('0x15')](function(_0x135b02){_0x365664[_0x94a1('0xa0')]=_0x135b02;return _0x365664;});}})[_0x94a1('0x15')](respondWithFilteredResult(_0x518ef9,_0x45c439))[_0x94a1('0x22')](handleError(_0x518ef9,null));};exports[_0x94a1('0xa3')]=function(_0x563924,_0x25a882){var _0x26541d={'raw':!![],'where':{}};var _0x2ba035={};var _0x2b3cf3={'count':0x0,'rows':[]};return db[_0x94a1('0x23')][_0x94a1('0x9e')]({'where':{'id':_0x563924[_0x94a1('0x25')]['id']}})['then'](handleEntityNotFound(_0x25a882,null))['then'](function(_0x169081){if(_0x169081){_0x2ba035[_0x94a1('0x7d')]=_['keys'](db[_0x94a1('0x4e')][_0x94a1('0x7b')]);_0x2ba035['query']=_[_0x94a1('0x27')](_0x563924[_0x94a1('0x2c')]);_0x2ba035[_0x94a1('0x7c')]=_[_0x94a1('0x98')](_0x2ba035['model'],_0x2ba035[_0x94a1('0x2c')]);_0x26541d[_0x94a1('0x7e')]=_[_0x94a1('0x98')](_0x2ba035[_0x94a1('0x7d')],qs[_0x94a1('0x7f')](_0x563924[_0x94a1('0x2c')][_0x94a1('0x7f')]));_0x26541d[_0x94a1('0x7e')]=_0x26541d[_0x94a1('0x7e')]['length']?_0x26541d['attributes']:_0x2ba035[_0x94a1('0x7d')];if(!_0x563924[_0x94a1('0x2c')]['hasOwnProperty'](_0x94a1('0x9f'))){_0x26541d[_0x94a1('0xe')]=qs[_0x94a1('0xe')](_0x563924[_0x94a1('0x2c')]['limit']);_0x26541d[_0x94a1('0x10')]=qs[_0x94a1('0x10')](_0x563924[_0x94a1('0x2c')][_0x94a1('0x10')]);}_0x26541d['order']=qs['sort'](_0x563924['query'][_0x94a1('0x80')]);_0x26541d[_0x94a1('0x59')]=qs[_0x94a1('0x7c')](_[_0x94a1('0x81')](_0x563924[_0x94a1('0x2c')],_0x2ba035[_0x94a1('0x7c')]));_0x26541d['where'][_0x94a1('0xa2')]=_0x169081['id'];if(_0x563924[_0x94a1('0x2c')][_0x94a1('0x82')]){_0x26541d[_0x94a1('0x59')]=_['merge'](_0x26541d[_0x94a1('0x59')],{'$or':_[_0x94a1('0x6d')](_0x26541d['attributes'],function(_0x5af7a6){var _0x14d33f={};_0x14d33f[_0x5af7a6]={'$like':'%'+_0x563924['query'][_0x94a1('0x82')]+'%'};return _0x14d33f;})});}_0x26541d=_['merge']({},_0x26541d,_0x563924[_0x94a1('0x9a')]);return db[_0x94a1('0x4e')][_0x94a1('0xf')]({'where':_0x26541d['where']})['then'](function(_0x1fb189){_0x2b3cf3[_0x94a1('0xf')]=_0x1fb189;if(_0x563924[_0x94a1('0x2c')][_0x94a1('0x9b')]){_0x26541d[_0x94a1('0x9c')]=[{'all':!![]}];}return db[_0x94a1('0x4e')][_0x94a1('0x21')](_0x26541d);})[_0x94a1('0x15')](function(_0x388362){_0x2b3cf3[_0x94a1('0xa0')]=_0x388362;return _0x2b3cf3;});}})[_0x94a1('0x15')](respondWithFilteredResult(_0x25a882,_0x26541d))[_0x94a1('0x22')](handleError(_0x25a882,null));};exports[_0x94a1('0xa4')]=function(_0x422263,_0x23b713){try{if(!_0x422263[_0x94a1('0x34')]['ListId']){throw new Error(_0x94a1('0xa5'));}if(!_0x422263[_0x94a1('0x34')][_0x94a1('0xa6')]){throw new Error(_0x94a1('0xa7'));}if(!_0x422263[_0x94a1('0x34')]['binding_values']){throw new Error(_0x94a1('0xa8'));}if(!_0x422263['body']['socket_timestamp']){throw new Error(_0x94a1('0xa9'));}var _0x3db7ff=_0x422263['body'][_0x94a1('0xa6')][_0x94a1('0xaa')](',');var _0x51b931=_0x422263[_0x94a1('0x34')][_0x94a1('0xab')]['split'](',');if(!_0x3db7ff['length']||!_0x51b931[_0x94a1('0x28')]||_0x3db7ff[_0x94a1('0x28')]!==_0x51b931['length']){throw new Error(_0x94a1('0xac'));}_0x422263[_0x94a1('0x34')][_0x94a1('0x7f')]=_[_0x94a1('0xad')](_0x3db7ff,_0x51b931);if(!_0x422263[_0x94a1('0x34')]['fields'][_0x94a1('0x77')]){throw new Error(_0x94a1('0xae'));}if(!_0x422263[_0x94a1('0x34')][_0x94a1('0x7f')][_0x94a1('0xaf')]){throw new Error(_0x94a1('0xb0'));}var _0x2de6aa=path[_0x94a1('0x38')](config[_0x94a1('0xb1')],_0x94a1('0xb2'),_0x422263[_0x94a1('0xb3')][_0x94a1('0xb4')]);fs[_0x94a1('0xb5')](_0x2de6aa,parseInt(_0x94a1('0xb6'),0x8));var _0x560ac7=require(_0x94a1('0xb7'))[_0x94a1('0xb8')](path[_0x94a1('0x38')](__dirname,_0x94a1('0xb9')),[_0x2de6aa,_0x422263[_0x94a1('0x34')][_0x94a1('0xa6')],_0x422263['body'][_0x94a1('0xab')],_0x422263['body'][_0x94a1('0x5c')],_0x422263[_0x94a1('0x34')][_0x94a1('0xba')],_0x422263[_0x94a1('0x34')][_0x94a1('0x58')],_0x422263['body'][_0x94a1('0xbb')]]);return _0x23b713['status'](0xc8)[_0x94a1('0x13')]({'message':_0x94a1('0xbc'),'pid':_0x560ac7[_0x94a1('0xbd')]});}catch(_0x301a9c){return _0x23b713['status'](0x1f4)[_0x94a1('0x1d')](_0x301a9c);}};exports['upload']=function(_0xb6dbaf,_0x51573f){var _0x519554=fs[_0x94a1('0xbe')](_0xb6dbaf[_0x94a1('0xb3')][_0x94a1('0xbf')]);Papa[_0x94a1('0xc0')](_0x519554,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x212bc8){return _0x51573f[_0x94a1('0x17')](0xc8)['json']({'file':_0xb6dbaf['file'],'fields':_0x212bc8[_0x94a1('0xc1')]['fields']});}});};exports['import']=function(_0x5f4517,_0x2e0535){return db['User'][_0x94a1('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x94a1('0xc2')}})[_0x94a1('0x15')](function(_0x520863){var _0x1fab5f=![];if(!_0x5f4517[_0x94a1('0x34')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x5f4517[_0x94a1('0x34')][_0x94a1('0xc3')]['phone']){throw new Error(_0x94a1('0xae'));}if(!_0x5f4517[_0x94a1('0x34')][_0x94a1('0xc3')][_0x94a1('0xaf')]){throw new Error(_0x94a1('0xb0'));}if(!_0x5f4517[_0x94a1('0x34')][_0x94a1('0xbb')]){throw new Error(_0x94a1('0xa9'));}var _0xf0570c=require(_0x94a1('0xb7'))[_0x94a1('0xb8')](path[_0x94a1('0x38')](__dirname,'../../components/import/cm/csv2'),[_0x5f4517['params']['id'],JSON['stringify'](_0x5f4517[_0x94a1('0x34')]),JSON[_0x94a1('0xc4')](_0x520863)]);_0xf0570c['on']('message',function(){_0x1fab5f=!![];return _0x2e0535[_0x94a1('0x17')](0xc8)['json']({'message':_0x94a1('0xc5'),'pid':_0xf0570c['pid']});});_0xf0570c['on'](_0x94a1('0xc6'),function(_0x1f8ce0){if(_0x1f8ce0&&!_0x1fab5f){return _0x2e0535[_0x94a1('0x17')](0x1f4)['json']({'message':_0x94a1('0xc7'),'pid':_0xf0570c['pid']});}});})[_0x94a1('0x22')](handleError(_0x2e0535,null));};exports[_0x94a1('0xc8')]=function(_0x56a117,_0x285ef8){return db[_0x94a1('0xc9')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x94a1('0xc2')}})['then'](function(_0x34361d){var _0x310d10=![];if(!_0x56a117['body'][_0x94a1('0x5c')]){throw new Error(_0x94a1('0xa5'));}if(!_0x56a117[_0x94a1('0x34')]['binding'][_0x94a1('0x77')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x56a117[_0x94a1('0x34')][_0x94a1('0xc3')][_0x94a1('0xaf')]){throw new Error(_0x94a1('0xb0'));}if(!_0x56a117[_0x94a1('0x34')][_0x94a1('0xbb')]){throw new Error(_0x94a1('0xa9'));}var _0x11b075=require(_0x94a1('0xb7'))['fork'](path[_0x94a1('0x38')](__dirname,_0x94a1('0xca')),[_0x56a117[_0x94a1('0x25')]['id'],JSON[_0x94a1('0xc4')](_0x56a117[_0x94a1('0x34')]),JSON[_0x94a1('0xc4')](_0x34361d)]);_0x11b075['on'](_0x94a1('0xcb'),function(){_0x310d10=!![];return _0x285ef8[_0x94a1('0x17')](0xc8)['json']({'message':_0x94a1('0xc5'),'pid':_0x11b075[_0x94a1('0xbd')]});});_0x11b075['on'](_0x94a1('0xc6'),function(_0x25404a){if(_0x25404a&&!_0x310d10){return _0x285ef8[_0x94a1('0x17')](0x1f4)[_0x94a1('0x13')]({'message':_0x94a1('0xc7'),'pid':_0x11b075[_0x94a1('0xbd')]});}});})['catch'](handleError(_0x285ef8,null));};exports['getJourney']=function(_0x52228e,_0xba91d8){var _0x4d858f=[_0x94a1('0xcc'),_0x94a1('0xcd'),_0x94a1('0xce'),_0x94a1('0xcf'),'fax',_0x94a1('0xd0'),_0x94a1('0xd1')];var _0x1706b4={'offset':0x0,'order':qs[_0x94a1('0x80')]('-createdAt')},_0x11bd36={'count':0x0,'rows':[]};Promise[_0x94a1('0xd2')]()[_0x94a1('0x15')](function(){if(_0x52228e[_0x94a1('0x2c')][_0x94a1('0xd3')]){if(!_['includes'](_0x4d858f,_0x52228e[_0x94a1('0x2c')][_0x94a1('0xd3')][_0x94a1('0xd4')]())){throw new Error(_0x94a1('0xd5'));}_0x4d858f=[_0x52228e['query'][_0x94a1('0xd3')][_0x94a1('0xd4')]()];}if(_0x52228e[_0x94a1('0x2c')][_0x94a1('0xd6')]){try{var _0x45a67a=JSON['parse'](_0x52228e['query'][_0x94a1('0xd6')]);if(!moment(_0x45a67a[_0x94a1('0x35')])[_0x94a1('0xd7')]()){throw new Error(_0x94a1('0xd8'));}if(!moment(_0x45a67a['to'])['isValid']()){throw new Error(_0x94a1('0xd9'));}}catch(_0x3c196a){throw new Error(_0x94a1('0xda'));}}if(!_0x52228e[_0x94a1('0x2c')]['hasOwnProperty']('nolimit')){_0x1706b4[_0x94a1('0xe')]=qs[_0x94a1('0xe')](_0x52228e[_0x94a1('0x2c')][_0x94a1('0xe')]||0xa);_0x1706b4[_0x94a1('0x10')]=qs[_0x94a1('0x10')](_0x52228e[_0x94a1('0x2c')][_0x94a1('0x10')]);}var _0x1d0567=_0x4d858f['map'](function(_0x5a59d7){if(_0x5a59d7===_0x94a1('0xd1')){var _0x10d8d7={'attributes':['id','uniqueid',_0x94a1('0x2f'),_0x94a1('0xdb'),_0x94a1('0xdc'),_0x94a1('0xdd'),_0x94a1('0xde'),_0x94a1('0xdf'),_0x94a1('0xe0'),'note',_0x94a1('0xe1'),'userDisposition',_0x94a1('0xe2'),_0x94a1('0xe3'),_0x94a1('0xe4')],'where':{'ContactId':_0x52228e[_0x94a1('0x25')]['id']},'include':[{'model':db[_0x94a1('0xc9')],'as':_0x94a1('0xc9'),'attributes':['id','name',_0x94a1('0xe5'),_0x94a1('0xe6')]}],'order':[['createdAt',_0x94a1('0xe7')]]};if(_0x52228e[_0x94a1('0x2c')][_0x94a1('0xd6')]){_0x10d8d7[_0x94a1('0x59')]['createdAt']={'$gte':_0x45a67a[_0x94a1('0x35')],'$lte':_0x45a67a['to']};}return db['VoiceCallReport'][_0x94a1('0xe8')](_0x10d8d7)[_0x94a1('0x15')](function(_0x1373fb){_0x11bd36[_0x94a1('0xf')]+=_0x1373fb['count'];return _[_0x94a1('0x6d')](_0x1373fb[_0x94a1('0xa0')],function(_0x307f66){var _0x5537ba=_0x307f66[_0x94a1('0x36')]({'plain':!![]});_0x5537ba[_0x94a1('0xd3')]=_0x5a59d7;if(_0x5537ba['User']){_0x5537ba[_0x94a1('0xc9')]={'id':_0x5537ba['User']['id'],'name':_0x5537ba[_0x94a1('0xc9')][_0x94a1('0x1c')],'fullname':_0x5537ba[_0x94a1('0xc9')][_0x94a1('0xe5')],'alias':_0x5537ba[_0x94a1('0xc9')][_0x94a1('0xe6')]};}return _0x5537ba;});});}else{var _0x4e6881=_[_0x94a1('0xe9')](_0x5a59d7)+(_0x5a59d7==='chat'?_0x94a1('0xea'):_0x94a1('0xeb'));var _0x27bbd4={'attributes':['id',_0x94a1('0xec'),_0x94a1('0xed'),_0x94a1('0xe1'),_0x94a1('0xee'),'disposition',_0x94a1('0xef'),_0x94a1('0xf0'),_0x94a1('0xe4'),_0x4e6881+'Id'],'where':{'ContactId':_0x52228e[_0x94a1('0x25')]['id']},'include':[{'model':db[_0x4e6881],'as':_0x94a1('0xeb'),'attributes':['id',_0x94a1('0x1c'),_0x94a1('0xf1')]},{'model':db[_0x94a1('0xc9')],'as':_0x94a1('0xf2'),'attributes':['id',_0x94a1('0x1c'),_0x94a1('0xe5')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x94a1('0x1c'),_0x94a1('0x63')],'through':{'attributes':[]}}],'order':[[_0x94a1('0xe1'),_0x94a1('0xe7')]]};if(_0x52228e[_0x94a1('0x2c')]['range']){_0x27bbd4[_0x94a1('0x59')][_0x94a1('0xe1')]={'$gte':_0x45a67a[_0x94a1('0x35')],'$lte':_0x45a67a['to']};}switch(_0x5a59d7){case'chat':_0x27bbd4['attributes'][_0x94a1('0x5b')](_0x94a1('0xf3'),_0x94a1('0xf4'),'customerPort',_0x94a1('0xf5'),_0x94a1('0xf6'),'ratingMessage','ratingType',_0x94a1('0xf7'),_0x94a1('0xf8'));break;case _0x94a1('0xcc'):_0x27bbd4[_0x94a1('0x7e')]['push']('subject',_0x94a1('0xf9'));break;case _0x94a1('0xcf'):_0x27bbd4['attributes'][_0x94a1('0x5b')](_0x94a1('0xfa'),_0x94a1('0xfb'));break;}return db[_[_0x94a1('0xe9')](_0x5a59d7)+'Interaction'][_0x94a1('0xe8')](_0x27bbd4)['then'](function(_0x190998){_0x11bd36[_0x94a1('0xf')]+=_0x190998[_0x94a1('0xf')];return _[_0x94a1('0x6d')](_0x190998['rows'],function(_0x1e1308){var _0x197fda=_0x1e1308[_0x94a1('0x36')]({'plain':!![]});_0x197fda[_0x94a1('0xd3')]=_0x5a59d7;if(_0x197fda[_0x94a1('0xf2')]){_0x197fda[_0x94a1('0xf2')]={'id':_0x197fda[_0x94a1('0xf2')]['id'],'name':_0x197fda[_0x94a1('0xf2')][_0x94a1('0x1c')],'fullname':_0x197fda['Owner']['fullname']};}return _0x197fda;});});}});return Promise[_0x94a1('0x60')](_0x1d0567);})['then'](function(_0x1865bc){return _(_0x1865bc)[_0x94a1('0xfc')]()[_0x94a1('0xfd')](_0x94a1('0xe1'))[_0x94a1('0xfe')]()[_0x94a1('0xff')]();})[_0x94a1('0x15')](function(_0x398461){_0x11bd36[_0x94a1('0xa0')]=_0x1706b4['limit']?_0x398461[_0x94a1('0x100')](_0x1706b4[_0x94a1('0x10')],_0x1706b4[_0x94a1('0x10')]+_0x1706b4[_0x94a1('0xe')]):_0x398461;return _0x11bd36;})[_0x94a1('0x15')](respondWithFilteredResult(_0xba91d8,_0x1706b4))[_0x94a1('0x22')](handleError(_0xba91d8,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 56e58e6..e929afa 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8178=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x8178,0x11e));var _0x8817=function(_0x356102,_0xdb5cc8){_0x356102=_0x356102-0x0;var _0x4faa04=_0x8178[_0x356102];return _0x4faa04;};'use strict';var EventEmitter=require(_0x8817('0x0'));var CmContact=require(_0x8817('0x1'))['db'][_0x8817('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8817('0x3')](0x0);var events={'afterCreate':_0x8817('0x4'),'afterUpdate':_0x8817('0x5'),'afterDestroy':_0x8817('0x6')};function emitEvent(_0x124687){return function(_0x1738b3,_0x33390f,_0x16ddbb){CmContactEvents[_0x8817('0x7')](_0x124687+':'+_0x1738b3['id'],_0x1738b3);CmContactEvents[_0x8817('0x7')](_0x124687,_0x1738b3);_0x16ddbb(null);};}for(var e in events){if(events[_0x8817('0x8')](e)){var event=events[e];CmContact[_0x8817('0x9')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0xc210=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc210,0xfe));var _0x0c21=function(_0x5de1b6,_0x4fb33d){_0x5de1b6=_0x5de1b6-0x0;var _0x3bc1a6=_0xc210[_0x5de1b6];return _0x3bc1a6;};'use strict';var EventEmitter=require(_0x0c21('0x0'));var CmContact=require(_0x0c21('0x1'))['db'][_0x0c21('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0c21('0x3')](0x0);var events={'afterCreate':_0x0c21('0x4'),'afterUpdate':_0x0c21('0x5'),'afterDestroy':_0x0c21('0x6')};function emitEvent(_0x140ba5){return function(_0x28e368,_0x2e9968,_0x312041){CmContactEvents[_0x0c21('0x7')](_0x140ba5+':'+_0x28e368['id'],_0x28e368);CmContactEvents[_0x0c21('0x7')](_0x140ba5,_0x28e368);_0x312041(null);};}for(var e in events){if(events[_0x0c21('0x8')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x0c21('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 7d59133..27d01a4 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x782d=['lastName','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','minutes','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','create','timezones','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','catch','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','findAll','BlackLists','CmHopperBlack','error','cmContact,\x20%s,\x20%s','Campaign','models','isEmpty','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','phone'];(function(_0x4b7f28,_0x27d23a){var _0xf5b553=function(_0x1cb9c1){while(--_0x1cb9c1){_0x4b7f28['push'](_0x4b7f28['shift']());}};_0xf5b553(++_0x27d23a);}(_0x782d,0x10e));var _0xd782=function(_0x43153a,_0xba8a2c){_0x43153a=_0x43153a-0x0;var _0x2ce985=_0x782d[_0x43153a];return _0x2ce985;};'use strict';var _=require('lodash');var util=require(_0xd782('0x0'));var logger=require(_0xd782('0x1'))(_0xd782('0x2'));var moment=require(_0xd782('0x3'));var BPromise=require(_0xd782('0x4'));var rp=require(_0xd782('0x5'));var fs=require('fs');var path=require(_0xd782('0x6'));var rimraf=require(_0xd782('0x7'));var config=require(_0xd782('0x8'));var shared=require(_0xd782('0x9'));var attributes=require(_0xd782('0xa'));module[_0xd782('0xb')]=function(_0x272860,_0x337390){return _0x272860['define'](_0xd782('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xd782('0xd'),'fields':[_0xd782('0xd')]},{'name':'fti_cm_contacts','fields':['firstName',_0xd782('0xe'),_0xd782('0xd'),'mobile',_0xd782('0xf'),'email'],'type':_0xd782('0x10')}],'timestamps':!![],'charset':_0xd782('0x11'),'collate':_0xd782('0x12'),'hooks':{'afterCreate':function(_0x19a82a,_0x171b7c,_0x2ae2e9){var _0x1d5846=_0x272860['models'];var _0x1a857e=_0x19a82a[_0xd782('0x13')]({'plain':!![]});function _0x3d8327(){return function(_0x52132a){logger['error'](_0xd782('0x14'),_0xd782('0x15'),util[_0xd782('0x16')](_0x52132a,{'showHidden':![],'depth':null}));};}function _0x5a345c(_0x562126,_0x5415b6){var _0x2d95b4=_0x5415b6[_0xd782('0x17')]?_0x5415b6[_0xd782('0x17')]:moment()[_0xd782('0x18')](_0xd782('0x19'));return new BPromise(function(_0xd3186b,_0x404c25){if(_[_0xd782('0x1a')](_0x5415b6[_0xd782('0x1b')])){_0xd3186b({'ret':_0x2d95b4});}else{_0x1d5846[_0xd782('0x1c')][_0xd782('0x1d')]({'where':{'id':_0x562126['id']}})[_0xd782('0x1e')](function(_0x170d4e){if(!_[_0xd782('0x1a')](_0x170d4e)){var _0x5e337b=_0x170d4e[_0xd782('0x1b')];if(!_[_0xd782('0x1a')](_0x5e337b)){var _0x23b7f8=shared['timezones'];var _0x329c03=_0x23b7f8[_0x5e337b];var _0x4c099d=_0x23b7f8[_0x5415b6[_0xd782('0x1b')]];if(!_[_0xd782('0x1a')](_0x329c03)&&!_[_0xd782('0x1a')](_0x4c099d)){var _0x13f0da=_0x329c03[_0xd782('0x1f')]-_0x4c099d[_0xd782('0x1f')];_0x2d95b4=_0x5415b6[_0xd782('0x17')]?_0x5415b6[_0xd782('0x17')]:moment();var _0x57c7ab=moment(_0x2d95b4)[_0xd782('0x20')](_0x13f0da,_0xd782('0x21'));_0xd3186b({'ret':_0x57c7ab[_0xd782('0x18')](_0xd782('0x19'))});}else _0xd3186b({'ret':_0x2d95b4});}else _0xd3186b({'ret':_0x2d95b4});}else{_0xd3186b({'ret':_0x2d95b4});}});}});return 0xa;}var _0x390212=function(_0xd83865){return new BPromise(function(_0x2ef9bc,_0x2cb4c0){_0x5a345c(_0xd83865,_0x1a857e)[_0xd782('0x1e')](function(_0x22f6f4){_0x1a857e[_0xd782('0x17')]=_0x22f6f4['ret'];_0x1d5846['CmHopper'][_0xd782('0x1d')]({'where':{'phone':_0x1a857e['phone'],'VoiceQueueId':_0xd83865['id']}})[_0xd782('0x1e')](function(_0x40305b){if(!_[_0xd782('0x1a')](_0x40305b)){throw new Error(_0xd782('0x22')+_0x1a857e[_0xd782('0xd')]+_0xd782('0x23')+_0xd83865['id']);}return _0x1d5846['CmHopper']['create']({'phone':_0x1a857e[_0xd782('0xd')],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'priority':_0x1a857e['priority']?_0x1a857e[_0xd782('0x25')]:0x2,'scheduledat':_0x1a857e[_0xd782('0x17')]?_0x1a857e[_0xd782('0x17')]:moment()['format'](_0xd782('0x19')),'callback':_0x1a857e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1a857e[_0xd782('0x26')]?_0x1a857e[_0xd782('0x26')]:undefined,'callbackat':_0x1a857e['callbackUniqueid']?moment()['format'](_0xd782('0x19')):undefined,'VoiceQueueId':_0xd83865['id']});})['catch'](function(_0x389c3f){_0x2cb4c0(_0x389c3f);});});});};var _0x5b4b59=function(_0x2af4a6){return new BPromise(function(_0x1698a9,_0x21fb31){_0x5a345c(_0x2af4a6,_0x1a857e)[_0xd782('0x1e')](function(_0x2d0b97){_0x1a857e[_0xd782('0x17')]=_0x2d0b97['ret'];_0x1d5846[_0xd782('0x27')]['findOne']({'where':{'phone':_0x1a857e[_0xd782('0xd')],'VoiceQueueId':_0x2af4a6['id']}})[_0xd782('0x1e')](function(_0x463ebd){if(!_['isNil'](_0x463ebd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1a857e[_0xd782('0xd')]+_0xd782('0x28')+_0x2af4a6['id']);}return _0x1d5846['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x1a857e[_0xd782('0xd')],'VoiceQueueId':_0x2af4a6['id']}});})[_0xd782('0x1e')](function(_0x1f8f82){if(!_[_0xd782('0x1a')](_0x1f8f82)){throw new Error(_0xd782('0x29')+_0x1a857e[_0xd782('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2af4a6['id']);}return _0x1d5846['CmHopper'][_0xd782('0x2a')]({'phone':_0x1a857e['phone'],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'priority':_0x1a857e[_0xd782('0x25')]?_0x1a857e[_0xd782('0x25')]:0x2,'scheduledat':_0x1a857e[_0xd782('0x17')]?_0x1a857e[_0xd782('0x17')]:moment()['format'](_0xd782('0x19')),'callback':_0x1a857e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1a857e['callbackUniqueid']?_0x1a857e['callbackUniqueid']:undefined,'callbackat':_0x1a857e[_0xd782('0x26')]?moment()[_0xd782('0x18')](_0xd782('0x19')):undefined,'VoiceQueueId':_0x2af4a6['id']});})['catch'](function(_0x9049e9){_0x21fb31(_0x9049e9);});});});};function _0x25566f(){return function(_0x4cffc6){logger['error'](_0xd782('0x14'),_0xd782('0x15'),util[_0xd782('0x16')](_0x4cffc6,{'showHidden':![],'depth':null}));};}function _0x3209ea(_0x240b71,_0xbde07d){var _0x34ea31=_0xbde07d[_0xd782('0x17')]?_0xbde07d[_0xd782('0x17')]:moment()[_0xd782('0x18')](_0xd782('0x19'));return new BPromise(function(_0x2539ec,_0x338fbb){if(_[_0xd782('0x1a')](_0xbde07d[_0xd782('0x1b')])){_0x2539ec({'ret':_0x34ea31});}else{_0x1d5846['Campaign'][_0xd782('0x1d')]({'where':{'id':_0x240b71['id']}})['then'](function(_0x54edc0){if(!_['isNil'](_0x54edc0)){var _0x46195a=_0x54edc0[_0xd782('0x1b')];if(!_[_0xd782('0x1a')](_0x46195a)){var _0x55f567=shared[_0xd782('0x2b')];var _0x1f2fdb=_0x55f567[_0x46195a];var _0x314d4a=_0x55f567[_0xbde07d[_0xd782('0x1b')]];if(!_[_0xd782('0x1a')](_0x1f2fdb)&&!_[_0xd782('0x1a')](_0x314d4a)){var _0x1dc0e9=_0x1f2fdb[_0xd782('0x1f')]-_0x314d4a[_0xd782('0x1f')];_0x34ea31=_0xbde07d[_0xd782('0x17')]?_0xbde07d[_0xd782('0x17')]:moment();var _0x4ef306=moment(_0x34ea31)['add'](_0x1dc0e9,'minutes');_0x2539ec({'ret':_0x4ef306[_0xd782('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2539ec({'ret':_0x34ea31});}else _0x2539ec({'ret':_0x34ea31});}else{_0x2539ec({'ret':_0x34ea31});}});}});return 0xa;}var _0x4a3d8b=function(_0x482a74){return new BPromise(function(_0x7ee7aa,_0x2f2e07){_0x3209ea(_0x482a74,_0x1a857e)[_0xd782('0x1e')](function(_0x3fd2db){_0x1a857e[_0xd782('0x17')]=_0x3fd2db[_0xd782('0x2c')];_0x1d5846[_0xd782('0x27')][_0xd782('0x1d')]({'where':{'phone':_0x1a857e[_0xd782('0xd')],'CampaignId':_0x482a74['id']}})[_0xd782('0x1e')](function(_0x57c4a6){if(!_[_0xd782('0x1a')](_0x57c4a6)){throw new Error(_0xd782('0x22')+_0x1a857e[_0xd782('0xd')]+_0xd782('0x2d')+_0x482a74['id']);}return _0x1d5846[_0xd782('0x27')][_0xd782('0x2a')]({'phone':_0x1a857e['phone'],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'priority':_0x1a857e[_0xd782('0x25')]?_0x1a857e[_0xd782('0x25')]:0x2,'scheduledat':_0x1a857e[_0xd782('0x17')]?_0x1a857e[_0xd782('0x17')]:moment()[_0xd782('0x18')](_0xd782('0x19')),'callback':_0x1a857e[_0xd782('0x26')]?!![]:![],'callbackuniqueid':_0x1a857e[_0xd782('0x26')]?_0x1a857e[_0xd782('0x26')]:undefined,'callbackat':_0x1a857e['callbackUniqueid']?moment()[_0xd782('0x18')](_0xd782('0x19')):undefined,'CampaignId':_0x482a74['id']});})['catch'](function(_0x10f622){_0x2f2e07(_0x10f622);});});});};var _0x512de7=function(_0x545e9e){return new BPromise(function(_0x2b6308,_0x2d6fde){_0x3209ea(_0x545e9e,_0x1a857e)[_0xd782('0x1e')](function(_0x594882){_0x1a857e['scheduledat']=_0x594882[_0xd782('0x2c')];_0x1d5846[_0xd782('0x27')][_0xd782('0x1d')]({'where':{'phone':_0x1a857e[_0xd782('0xd')],'CampaignId':_0x545e9e['id']}})[_0xd782('0x1e')](function(_0x5aecbd){if(!_['isNil'](_0x5aecbd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1a857e[_0xd782('0xd')]+_0xd782('0x2e')+_0x545e9e['id']);}return _0x1d5846[_0xd782('0x2f')]['findOne']({'where':{'calleridnum':_0x1a857e[_0xd782('0xd')],'CampaignId':_0x545e9e['id']}});})[_0xd782('0x1e')](function(_0x4bc15b){if(!_['isNil'](_0x4bc15b)){throw new Error(_0xd782('0x29')+_0x1a857e[_0xd782('0xd')]+_0xd782('0x30')+_0x545e9e['id']);}return _0x1d5846[_0xd782('0x27')][_0xd782('0x2a')]({'phone':_0x1a857e[_0xd782('0xd')],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'priority':_0x1a857e[_0xd782('0x25')]?_0x1a857e[_0xd782('0x25')]:0x2,'scheduledat':_0x1a857e[_0xd782('0x17')]?_0x1a857e['scheduledat']:moment()[_0xd782('0x18')](_0xd782('0x19')),'callback':_0x1a857e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1a857e['callbackUniqueid']?_0x1a857e['callbackUniqueid']:undefined,'callbackat':_0x1a857e['callbackUniqueid']?moment()[_0xd782('0x18')](_0xd782('0x19')):undefined,'CampaignId':_0x545e9e['id']});})[_0xd782('0x31')](function(_0x49c27e){_0x2d6fde(_0x49c27e);});});});};if(_0x1a857e[_0xd782('0x24')]){_0x1d5846[_0xd782('0x1c')]['findAll']({'where':{'type':_0xd782('0x32')},'attributes':['id',_0xd782('0x33'),_0xd782('0x1b')],'include':[{'model':_0x1d5846[_0xd782('0x34')],'as':_0xd782('0x35'),'where':{'id':_0x1a857e[_0xd782('0x24')]}}]})['then'](function(_0x3a47fc){if(_0x3a47fc){var _0x261201=[];for(var _0x4f90c2=0x0,_0xe655d3;_0x4f90c2<_0x3a47fc[_0xd782('0x36')];_0x4f90c2+=0x1){_0xe655d3=_0x3a47fc[_0x4f90c2][_0xd782('0x13')]({'plain':!![]});switch(_0xe655d3[_0xd782('0x33')]){case _0xd782('0x37'):_0x5b4b59(_0xe655d3)[_0xd782('0x31')](_0x3d8327());break;case _0xd782('0x38'):_0x390212(_0xe655d3)[_0xd782('0x31')](_0x3d8327());break;default:_0x3209ea(_0xe655d3,_0x1a857e)[_0xd782('0x1e')](function(_0x56f7bb){_0x1a857e[_0xd782('0x17')]=_0x56f7bb['ret'];_0x1d5846['CmHopper'][_0xd782('0x2a')]({'phone':_0x1a857e[_0xd782('0xd')],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'scheduledat':_0x1a857e['scheduledat']?_0x1a857e['scheduledat']:moment()[_0xd782('0x18')](_0xd782('0x19')),'priority':_0x1a857e[_0xd782('0x25')]?_0x1a857e[_0xd782('0x25')]:0x2,'callback':_0x1a857e[_0xd782('0x26')]?!![]:![],'callbackuniqueid':_0x1a857e[_0xd782('0x26')]?_0x1a857e[_0xd782('0x26')]:undefined,'callbackat':_0x1a857e[_0xd782('0x26')]?moment()[_0xd782('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xe655d3['id']})[_0xd782('0x31')](_0x3d8327());});}}}})[_0xd782('0x1e')](function(){return _0x1d5846[_0xd782('0x1c')][_0xd782('0x39')]({'where':{'type':_0xd782('0x32')},'attributes':['id'],'include':[{'model':_0x1d5846[_0xd782('0x34')],'as':_0xd782('0x3a'),'where':{'id':_0x1a857e['ListId']}}]})[_0xd782('0x1e')](function(_0x45b641){if(_0x45b641){var _0x57391c=[];for(var _0x1bb0c1=0x0,_0x4db38b;_0x1bb0c1<_0x45b641[_0xd782('0x36')];_0x1bb0c1+=0x1){_0x4db38b=_0x45b641[_0x1bb0c1]['get']({'plain':!![]});_0x1d5846[_0xd782('0x3b')][_0xd782('0x2a')]({'phone':_0x1a857e[_0xd782('0xd')],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'VoiceQueueId':_0x4db38b['id']})[_0xd782('0x31')](function(_0x1def45){logger[_0xd782('0x3c')](_0xd782('0x3d'),_0xd782('0x15'),_0x1def45['message']);});}}});})[_0xd782('0x1e')](function(){return _0x1d5846[_0xd782('0x3e')][_0xd782('0x39')]({'attributes':['id',_0xd782('0x33'),_0xd782('0x1b')],'include':[{'model':_0x1d5846[_0xd782('0x34')],'as':_0xd782('0x35'),'where':{'id':_0x1a857e[_0xd782('0x24')]}}]})[_0xd782('0x1e')](function(_0x5bbc84){if(_0x5bbc84){var _0x4940b3=[];for(var _0x24f40a=0x0,_0x5df671;_0x24f40a<_0x5bbc84[_0xd782('0x36')];_0x24f40a+=0x1){_0x5df671=_0x5bbc84[_0x24f40a][_0xd782('0x13')]({'plain':!![]});switch(_0x5df671[_0xd782('0x33')]){case'always':_0x512de7(_0x5df671)[_0xd782('0x31')](_0x25566f());break;case'onlyIfOpen':_0x4a3d8b(_0x5df671)[_0xd782('0x31')](_0x25566f());break;default:_0x1d5846[_0xd782('0x27')][_0xd782('0x2a')]({'phone':_0x1a857e['phone'],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'scheduledat':_0x1a857e[_0xd782('0x17')]?_0x1a857e[_0xd782('0x17')]:moment()[_0xd782('0x18')](_0xd782('0x19')),'priority':_0x1a857e[_0xd782('0x25')]?_0x1a857e[_0xd782('0x25')]:0x2,'callback':_0x1a857e[_0xd782('0x26')]?!![]:![],'callbackuniqueid':_0x1a857e[_0xd782('0x26')]?_0x1a857e['callbackUniqueid']:undefined,'callbackat':_0x1a857e[_0xd782('0x26')]?moment()[_0xd782('0x18')](_0xd782('0x19')):undefined,'CampaignId':_0x5df671['id']})[_0xd782('0x31')](_0x25566f());}}}});})[_0xd782('0x1e')](function(){return _0x1d5846['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x1d5846['CmList'],'as':_0xd782('0x3a'),'where':{'id':_0x1a857e[_0xd782('0x24')]}}]})['then'](function(_0x5c0c18){if(_0x5c0c18){var _0x56d5b0=[];for(var _0x5c35b2=0x0,_0x53dc38;_0x5c35b2<_0x5c0c18['length'];_0x5c35b2+=0x1){_0x53dc38=_0x5c0c18[_0x5c35b2][_0xd782('0x13')]({'plain':!![]});_0x1d5846[_0xd782('0x3b')][_0xd782('0x2a')]({'phone':_0x1a857e[_0xd782('0xd')],'ContactId':_0x1a857e['id'],'ListId':_0x1a857e[_0xd782('0x24')],'CampaignId':_0x53dc38['id']})[_0xd782('0x31')](function(_0x1946dd){logger[_0xd782('0x3c')]('cmContact,\x20%s,\x20%s',_0xd782('0x15'),_0x1946dd['message']);});}}});})[_0xd782('0x1e')](function(){_0x2ae2e9();})[_0xd782('0x31')](function(_0x1352ba){logger[_0xd782('0x3c')](_0xd782('0x3d'),_0xd782('0x15'),_0x1352ba['message']);_0x2ae2e9(_0x1352ba);});}else{_0x2ae2e9(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x4d92f0,_0x230c50,_0x4e2441){var _0x2c6dc7=_0x272860[_0xd782('0x3f')];var _0x48c20a=_0x4d92f0[_0xd782('0x13')]({'plain':!![]});return _0x2c6dc7[_0xd782('0x27')][_0xd782('0x39')]({'raw':!![],'where':{'ListId':_0x48c20a[_0xd782('0x24')],'ContactId':_0x48c20a['id']}})['then'](function(_0x19e42d){if(!_[_0xd782('0x40')](_0x19e42d)){var _0x235510=[];for(var _0x48c70f=0x0;_0x48c70f<_0x19e42d[_0xd782('0x36')];_0x48c70f+=0x1){var _0x260702=_0x2c6dc7[_0xd782('0x27')]['destroy']({'where':{'ListId':_0x19e42d[_0x48c70f][_0xd782('0x24')],'ContactId':_0x19e42d[_0x48c70f][_0xd782('0x41')],'VoiceQueueId':_0x19e42d[_0x48c70f][_0xd782('0x42')],'CampaignId':_0x19e42d[_0x48c70f][_0xd782('0x43')]}});_0x235510[_0xd782('0x44')](_0x260702);}return BPromise['all'](_0x235510);}})[_0xd782('0x1e')](function(_0x21f14b){logger[_0xd782('0x45')](_0xd782('0x46'),util[_0xd782('0x16')](_0x21f14b,{'showHidden':![],'depth':null}));_0x4e2441();})[_0xd782('0x31')](function(_0x33bb22){logger[_0xd782('0x3c')]('[CmContact][afterDestroy][Error]',util[_0xd782('0x16')](_0x33bb22,{'showHidden':![],'depth':null}));_0x4e2441(_0x33bb22);});}}});}; \ No newline at end of file +var _0xa824=['utcOffset','add','minutes','ret','CmHopper','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','format','callbackUniqueid','cmContact,\x20afterCreate\x20','cmContact,\x20afterCreate,\x20','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','CmList','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','afterCreate','message','dialCheckDuplicateType','Lists','isEmpty','destroy','VoiceQueueId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','path','./cmContact.attributes','exports','define','phone','fti_cm_contacts','firstName','fax','email','utf8mb4_unicode_ci','models','get','error','cmContact','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones'];(function(_0x1e9cf6,_0x3db47e){var _0xf10e2b=function(_0x2c4a25){while(--_0x2c4a25){_0x1e9cf6['push'](_0x1e9cf6['shift']());}};_0xf10e2b(++_0x3db47e);}(_0xa824,0x133));var _0x4a82=function(_0x47ad67,_0x22f7b6){_0x47ad67=_0x47ad67-0x0;var _0x1fb591=_0xa824[_0x47ad67];return _0x1fb591;};'use strict';var _=require(_0x4a82('0x0'));var util=require(_0x4a82('0x1'));var logger=require('../../config/logger')(_0x4a82('0x2'));var moment=require(_0x4a82('0x3'));var BPromise=require(_0x4a82('0x4'));var rp=require(_0x4a82('0x5'));var fs=require('fs');var path=require(_0x4a82('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0x4a82('0x7'));module[_0x4a82('0x8')]=function(_0x4da4d3,_0x4cd636){return _0x4da4d3[_0x4a82('0x9')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x4a82('0xa'),'fields':[_0x4a82('0xa')]},{'name':_0x4a82('0xb'),'fields':[_0x4a82('0xc'),'lastName',_0x4a82('0xa'),'mobile',_0x4a82('0xd'),_0x4a82('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0x4a82('0xf'),'hooks':{'afterCreate':function(_0x53f4ec,_0x42f0fc,_0x5500fe){var _0x56e869=_0x4da4d3[_0x4a82('0x10')];var _0x1172f5=_0x53f4ec[_0x4a82('0x11')]({'plain':!![]});function _0x1985b9(){return function(_0xfbae9d){logger[_0x4a82('0x12')](_0x4a82('0x13'),'afterCreate',util[_0x4a82('0x14')](_0xfbae9d,{'showHidden':![],'depth':null}));};}function _0x2f76f8(_0x2e605e,_0x26fefd){var _0x243c6f=_0x26fefd[_0x4a82('0x15')]?_0x26fefd['scheduledat']:moment()['format'](_0x4a82('0x16'));return new BPromise(function(_0x24d9ea,_0x57b55b){if(_[_0x4a82('0x17')](_0x26fefd[_0x4a82('0x18')])){_0x24d9ea({'ret':_0x243c6f});}else{_0x56e869[_0x4a82('0x19')]['findOne']({'where':{'id':_0x2e605e['id']}})[_0x4a82('0x1a')](function(_0x533b5e){if(!_[_0x4a82('0x17')](_0x533b5e)){var _0x5074d2=_0x533b5e[_0x4a82('0x18')];if(!_[_0x4a82('0x17')](_0x5074d2)){var _0x525873=shared[_0x4a82('0x1b')];var _0x560574=_0x525873[_0x5074d2];var _0x53e3e1=_0x525873[_0x26fefd[_0x4a82('0x18')]];if(!_[_0x4a82('0x17')](_0x560574)&&!_[_0x4a82('0x17')](_0x53e3e1)){var _0x586caa=_0x560574[_0x4a82('0x1c')]-_0x53e3e1[_0x4a82('0x1c')];_0x243c6f=_0x26fefd[_0x4a82('0x15')]?_0x26fefd[_0x4a82('0x15')]:moment();var _0x450661=moment(_0x243c6f)[_0x4a82('0x1d')](_0x586caa,_0x4a82('0x1e'));_0x24d9ea({'ret':_0x450661['format'](_0x4a82('0x16'))});}else _0x24d9ea({'ret':_0x243c6f});}else _0x24d9ea({'ret':_0x243c6f});}else{_0x24d9ea({'ret':_0x243c6f});}});}});return 0xa;}var _0x311e5a=function(_0xbd9a8b){return new BPromise(function(_0x50d849,_0x1966e3){_0x2f76f8(_0xbd9a8b,_0x1172f5)['then'](function(_0x2c37dd){_0x1172f5[_0x4a82('0x15')]=_0x2c37dd[_0x4a82('0x1f')];_0x56e869[_0x4a82('0x20')][_0x4a82('0x21')]({'where':{'phone':_0x1172f5[_0x4a82('0xa')],'VoiceQueueId':_0xbd9a8b['id']}})['then'](function(_0x1bfdc6){if(!_[_0x4a82('0x17')](_0x1bfdc6)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1172f5[_0x4a82('0xa')]+_0x4a82('0x22')+_0xbd9a8b['id']);}return _0x56e869[_0x4a82('0x20')][_0x4a82('0x23')]({'phone':_0x1172f5[_0x4a82('0xa')],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'priority':_0x1172f5[_0x4a82('0x25')]?_0x1172f5[_0x4a82('0x25')]:0x2,'scheduledat':_0x1172f5[_0x4a82('0x15')]?_0x1172f5[_0x4a82('0x15')]:moment()[_0x4a82('0x26')](_0x4a82('0x16')),'callback':_0x1172f5[_0x4a82('0x27')]?!![]:![],'callbackuniqueid':_0x1172f5['callbackUniqueid']?_0x1172f5[_0x4a82('0x27')]:undefined,'callbackat':_0x1172f5[_0x4a82('0x27')]?moment()[_0x4a82('0x26')](_0x4a82('0x16')):undefined,'VoiceQueueId':_0xbd9a8b['id']});})['catch'](function(_0x5ea005){_0x1966e3(_0x5ea005);});});});};var _0x3ce704=function(_0x37b668){return new BPromise(function(_0xaea069,_0x41abb7){_0x2f76f8(_0x37b668,_0x1172f5)[_0x4a82('0x1a')](function(_0xf6679a){_0x1172f5[_0x4a82('0x15')]=_0xf6679a[_0x4a82('0x1f')];_0x56e869[_0x4a82('0x20')]['findOne']({'where':{'phone':_0x1172f5[_0x4a82('0xa')],'VoiceQueueId':_0x37b668['id']}})[_0x4a82('0x1a')](function(_0x20514f){if(!_[_0x4a82('0x17')](_0x20514f)){throw new Error(_0x4a82('0x28')+_0x1172f5[_0x4a82('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x37b668['id']);}return _0x56e869['CmHopperFinal'][_0x4a82('0x21')]({'where':{'calleridnum':_0x1172f5[_0x4a82('0xa')],'VoiceQueueId':_0x37b668['id']}});})['then'](function(_0x4373c3){if(!_[_0x4a82('0x17')](_0x4373c3)){throw new Error(_0x4a82('0x29')+_0x1172f5[_0x4a82('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x37b668['id']);}return _0x56e869['CmHopper'][_0x4a82('0x23')]({'phone':_0x1172f5[_0x4a82('0xa')],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'priority':_0x1172f5[_0x4a82('0x25')]?_0x1172f5[_0x4a82('0x25')]:0x2,'scheduledat':_0x1172f5[_0x4a82('0x15')]?_0x1172f5[_0x4a82('0x15')]:moment()[_0x4a82('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1172f5[_0x4a82('0x27')]?!![]:![],'callbackuniqueid':_0x1172f5[_0x4a82('0x27')]?_0x1172f5[_0x4a82('0x27')]:undefined,'callbackat':_0x1172f5[_0x4a82('0x27')]?moment()[_0x4a82('0x26')](_0x4a82('0x16')):undefined,'VoiceQueueId':_0x37b668['id']});})['catch'](function(_0x18f093){_0x41abb7(_0x18f093);});});});};function _0x4a2a20(){return function(_0x589f38){logger[_0x4a82('0x12')](_0x4a82('0x13'),'afterCreate',util['inspect'](_0x589f38,{'showHidden':![],'depth':null}));};}function _0x4bce63(_0x5b0448,_0x5a98eb){var _0x30441a=_0x5a98eb[_0x4a82('0x15')]?_0x5a98eb[_0x4a82('0x15')]:moment()['format'](_0x4a82('0x16'));return new BPromise(function(_0x2edad4,_0x3a4d18){if(_[_0x4a82('0x17')](_0x5a98eb['dialTimezone'])){_0x2edad4({'ret':_0x30441a});}else{_0x56e869[_0x4a82('0x2a')][_0x4a82('0x21')]({'where':{'id':_0x5b0448['id']}})[_0x4a82('0x1a')](function(_0x410cc8){if(!_[_0x4a82('0x17')](_0x410cc8)){var _0x262f3f=_0x410cc8[_0x4a82('0x18')];if(!_[_0x4a82('0x17')](_0x262f3f)){var _0x28ed65=shared[_0x4a82('0x1b')];var _0x4965ac=_0x28ed65[_0x262f3f];var _0x413a11=_0x28ed65[_0x5a98eb['dialTimezone']];if(!_[_0x4a82('0x17')](_0x4965ac)&&!_['isNil'](_0x413a11)){var _0x24ad46=_0x4965ac['utcOffset']-_0x413a11[_0x4a82('0x1c')];_0x30441a=_0x5a98eb[_0x4a82('0x15')]?_0x5a98eb['scheduledat']:moment();var _0x6461b5=moment(_0x30441a)[_0x4a82('0x1d')](_0x24ad46,_0x4a82('0x1e'));_0x2edad4({'ret':_0x6461b5[_0x4a82('0x26')](_0x4a82('0x16'))});}else _0x2edad4({'ret':_0x30441a});}else _0x2edad4({'ret':_0x30441a});}else{_0x2edad4({'ret':_0x30441a});}});}});return 0xa;}var _0x11985e=function(_0x5cb3a9){return new BPromise(function(_0x1563af,_0x163122){_0x4bce63(_0x5cb3a9,_0x1172f5)[_0x4a82('0x1a')](function(_0x27dcce){_0x1172f5[_0x4a82('0x15')]=_0x27dcce[_0x4a82('0x1f')];_0x56e869['CmHopper']['findOne']({'where':{'phone':_0x1172f5[_0x4a82('0xa')],'CampaignId':_0x5cb3a9['id']}})[_0x4a82('0x1a')](function(_0x34af70){if(!_[_0x4a82('0x17')](_0x34af70)){throw new Error(_0x4a82('0x28')+_0x1172f5[_0x4a82('0xa')]+_0x4a82('0x2b')+_0x5cb3a9['id']);}return _0x56e869['CmHopper'][_0x4a82('0x23')]({'phone':_0x1172f5[_0x4a82('0xa')],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'priority':_0x1172f5[_0x4a82('0x25')]?_0x1172f5[_0x4a82('0x25')]:0x2,'scheduledat':_0x1172f5[_0x4a82('0x15')]?_0x1172f5['scheduledat']:moment()['format'](_0x4a82('0x16')),'callback':_0x1172f5[_0x4a82('0x27')]?!![]:![],'callbackuniqueid':_0x1172f5[_0x4a82('0x27')]?_0x1172f5['callbackUniqueid']:undefined,'callbackat':_0x1172f5[_0x4a82('0x27')]?moment()[_0x4a82('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5cb3a9['id']});})[_0x4a82('0x2c')](function(_0x5d88ac){_0x163122(_0x5d88ac);});});});};var _0x18ae11=function(_0x559270){return new BPromise(function(_0x16236b,_0x1e96a0){_0x4bce63(_0x559270,_0x1172f5)[_0x4a82('0x1a')](function(_0x462d01){_0x1172f5[_0x4a82('0x15')]=_0x462d01[_0x4a82('0x1f')];_0x56e869['CmHopper'][_0x4a82('0x21')]({'where':{'phone':_0x1172f5[_0x4a82('0xa')],'CampaignId':_0x559270['id']}})[_0x4a82('0x1a')](function(_0x29cd9e){if(!_[_0x4a82('0x17')](_0x29cd9e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1172f5['phone']+_0x4a82('0x2d')+_0x559270['id']);}return _0x56e869[_0x4a82('0x2e')][_0x4a82('0x21')]({'where':{'calleridnum':_0x1172f5[_0x4a82('0xa')],'CampaignId':_0x559270['id']}});})['then'](function(_0x4fc17e){if(!_[_0x4a82('0x17')](_0x4fc17e)){throw new Error(_0x4a82('0x29')+_0x1172f5['phone']+_0x4a82('0x2f')+_0x559270['id']);}return _0x56e869[_0x4a82('0x20')][_0x4a82('0x23')]({'phone':_0x1172f5['phone'],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'priority':_0x1172f5[_0x4a82('0x25')]?_0x1172f5[_0x4a82('0x25')]:0x2,'scheduledat':_0x1172f5[_0x4a82('0x15')]?_0x1172f5[_0x4a82('0x15')]:moment()[_0x4a82('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1172f5[_0x4a82('0x27')]?!![]:![],'callbackuniqueid':_0x1172f5['callbackUniqueid']?_0x1172f5[_0x4a82('0x27')]:undefined,'callbackat':_0x1172f5[_0x4a82('0x27')]?moment()[_0x4a82('0x26')](_0x4a82('0x16')):undefined,'CampaignId':_0x559270['id']});})['catch'](function(_0x2c2927){_0x1e96a0(_0x2c2927);});});});};if(_0x1172f5['ListId']){_0x56e869['VoiceQueue'][_0x4a82('0x30')]({'where':{'type':_0x4a82('0x31')},'attributes':['id','dialCheckDuplicateType',_0x4a82('0x18')],'include':[{'model':_0x56e869[_0x4a82('0x32')],'as':'Lists','where':{'id':_0x1172f5[_0x4a82('0x24')]}}]})[_0x4a82('0x1a')](function(_0x10f7de){if(_0x10f7de){var _0x2044c6=[];for(var _0x4955e0=0x0,_0x5b2c08;_0x4955e0<_0x10f7de[_0x4a82('0x33')];_0x4955e0+=0x1){_0x5b2c08=_0x10f7de[_0x4955e0][_0x4a82('0x11')]({'plain':!![]});switch(_0x5b2c08['dialCheckDuplicateType']){case _0x4a82('0x34'):_0x3ce704(_0x5b2c08)[_0x4a82('0x2c')](_0x1985b9());break;case _0x4a82('0x35'):_0x311e5a(_0x5b2c08)['catch'](_0x1985b9());break;default:_0x4bce63(_0x5b2c08,_0x1172f5)[_0x4a82('0x1a')](function(_0x7996b){_0x1172f5[_0x4a82('0x15')]=_0x7996b[_0x4a82('0x1f')];_0x56e869[_0x4a82('0x20')][_0x4a82('0x23')]({'phone':_0x1172f5['phone'],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'scheduledat':_0x1172f5[_0x4a82('0x15')]?_0x1172f5[_0x4a82('0x15')]:moment()[_0x4a82('0x26')](_0x4a82('0x16')),'priority':_0x1172f5[_0x4a82('0x25')]?_0x1172f5[_0x4a82('0x25')]:0x2,'callback':_0x1172f5[_0x4a82('0x27')]?!![]:![],'callbackuniqueid':_0x1172f5[_0x4a82('0x27')]?_0x1172f5[_0x4a82('0x27')]:undefined,'callbackat':_0x1172f5[_0x4a82('0x27')]?moment()['format'](_0x4a82('0x16')):undefined,'VoiceQueueId':_0x5b2c08['id']})[_0x4a82('0x2c')](_0x1985b9());});}}}})[_0x4a82('0x1a')](function(){return _0x56e869[_0x4a82('0x19')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x56e869[_0x4a82('0x32')],'as':_0x4a82('0x36'),'where':{'id':_0x1172f5['ListId']}}]})['then'](function(_0x29c523){if(_0x29c523){var _0x1aa9bc=[];for(var _0x119055=0x0,_0x343b59;_0x119055<_0x29c523['length'];_0x119055+=0x1){_0x343b59=_0x29c523[_0x119055][_0x4a82('0x11')]({'plain':!![]});_0x56e869[_0x4a82('0x37')][_0x4a82('0x23')]({'phone':_0x1172f5[_0x4a82('0xa')],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5['ListId'],'VoiceQueueId':_0x343b59['id']})[_0x4a82('0x2c')](function(_0x226db2){logger[_0x4a82('0x12')](_0x4a82('0x38'),_0x4a82('0x39'),_0x226db2[_0x4a82('0x3a')]);});}}});})[_0x4a82('0x1a')](function(){return _0x56e869['Campaign'][_0x4a82('0x30')]({'attributes':['id',_0x4a82('0x3b'),_0x4a82('0x18')],'include':[{'model':_0x56e869[_0x4a82('0x32')],'as':_0x4a82('0x3c'),'where':{'id':_0x1172f5[_0x4a82('0x24')]}}]})[_0x4a82('0x1a')](function(_0x40d715){if(_0x40d715){var _0xeec6cf=[];for(var _0x199bf8=0x0,_0x2f42b5;_0x199bf8<_0x40d715[_0x4a82('0x33')];_0x199bf8+=0x1){_0x2f42b5=_0x40d715[_0x199bf8][_0x4a82('0x11')]({'plain':!![]});switch(_0x2f42b5[_0x4a82('0x3b')]){case'always':_0x18ae11(_0x2f42b5)['catch'](_0x4a2a20());break;case _0x4a82('0x35'):_0x11985e(_0x2f42b5)[_0x4a82('0x2c')](_0x4a2a20());break;default:_0x56e869['CmHopper'][_0x4a82('0x23')]({'phone':_0x1172f5[_0x4a82('0xa')],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'scheduledat':_0x1172f5['scheduledat']?_0x1172f5['scheduledat']:moment()['format'](_0x4a82('0x16')),'priority':_0x1172f5[_0x4a82('0x25')]?_0x1172f5[_0x4a82('0x25')]:0x2,'callback':_0x1172f5['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1172f5[_0x4a82('0x27')]?_0x1172f5['callbackUniqueid']:undefined,'callbackat':_0x1172f5[_0x4a82('0x27')]?moment()[_0x4a82('0x26')](_0x4a82('0x16')):undefined,'CampaignId':_0x2f42b5['id']})[_0x4a82('0x2c')](_0x4a2a20());}}}});})[_0x4a82('0x1a')](function(){return _0x56e869[_0x4a82('0x2a')][_0x4a82('0x30')]({'attributes':['id'],'include':[{'model':_0x56e869[_0x4a82('0x32')],'as':_0x4a82('0x36'),'where':{'id':_0x1172f5[_0x4a82('0x24')]}}]})[_0x4a82('0x1a')](function(_0x556d3c){if(_0x556d3c){var _0xf49000=[];for(var _0x59c23b=0x0,_0x4a6be2;_0x59c23b<_0x556d3c[_0x4a82('0x33')];_0x59c23b+=0x1){_0x4a6be2=_0x556d3c[_0x59c23b][_0x4a82('0x11')]({'plain':!![]});_0x56e869[_0x4a82('0x37')][_0x4a82('0x23')]({'phone':_0x1172f5[_0x4a82('0xa')],'ContactId':_0x1172f5['id'],'ListId':_0x1172f5[_0x4a82('0x24')],'CampaignId':_0x4a6be2['id']})[_0x4a82('0x2c')](function(_0x327411){logger[_0x4a82('0x12')](_0x4a82('0x38'),_0x4a82('0x39'),_0x327411[_0x4a82('0x3a')]);});}}});})[_0x4a82('0x1a')](function(){_0x5500fe();})[_0x4a82('0x2c')](function(_0x2a4321){logger[_0x4a82('0x12')](_0x4a82('0x38'),_0x4a82('0x39'),_0x2a4321[_0x4a82('0x3a')]);_0x5500fe(_0x2a4321);});}else{_0x5500fe(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x3793cf,_0xac2d6a,_0x300cff){var _0x430fb3=_0x4da4d3[_0x4a82('0x10')];var _0x53bb20=_0x3793cf[_0x4a82('0x11')]({'plain':!![]});return _0x430fb3[_0x4a82('0x20')][_0x4a82('0x30')]({'raw':!![],'where':{'ListId':_0x53bb20[_0x4a82('0x24')],'ContactId':_0x53bb20['id']}})[_0x4a82('0x1a')](function(_0x5c09bf){if(!_[_0x4a82('0x3d')](_0x5c09bf)){var _0x35ea6d=[];for(var _0xb0db=0x0;_0xb0db<_0x5c09bf[_0x4a82('0x33')];_0xb0db+=0x1){var _0x144b59=_0x430fb3[_0x4a82('0x20')][_0x4a82('0x3e')]({'where':{'ListId':_0x5c09bf[_0xb0db][_0x4a82('0x24')],'ContactId':_0x5c09bf[_0xb0db]['ContactId'],'VoiceQueueId':_0x5c09bf[_0xb0db][_0x4a82('0x3f')],'CampaignId':_0x5c09bf[_0xb0db]['CampaignId']}});_0x35ea6d['push'](_0x144b59);}return BPromise['all'](_0x35ea6d);}})[_0x4a82('0x1a')](function(_0x3a651b){logger[_0x4a82('0x40')](_0x4a82('0x41'),util[_0x4a82('0x14')](_0x3a651b,{'showHidden':![],'depth':null}));_0x300cff();})[_0x4a82('0x2c')](function(_0x2e9890){logger[_0x4a82('0x12')](_0x4a82('0x42'),util[_0x4a82('0x14')](_0x2e9890,{'showHidden':![],'depth':null}));_0x300cff(_0x2e9890);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 4c0d201..f510c08 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x140342,_0x1728b0){var _0x5d5451=function(_0x479fd2){while(--_0x479fd2){_0x140342['push'](_0x140342['shift']());}};_0x5d5451(++_0x1728b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 5275374..7232af8 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f37=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x22ddd,_0x3a02fc){var _0x712c2e=function(_0x4d97a7){while(--_0x4d97a7){_0x22ddd['push'](_0x22ddd['shift']());}};_0x712c2e(++_0x3a02fc);}(_0x8f37,0x190));var _0x78f3=function(_0x71256e,_0x11371d){_0x71256e=_0x71256e-0x0;var _0x18421a=_0x8f37[_0x71256e];return _0x18421a;};'use strict';var Sequelize=require(_0x78f3('0x0'));module[_0x78f3('0x1')]={'CmContactId':{'type':Sequelize[_0x78f3('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x78f3('0x3')],'defaultValue':_0x78f3('0x4')},'OrderBy':{'type':Sequelize[_0x78f3('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x1782=['STRING','PHONE','sequelize','INTEGER'];(function(_0x28c0cb,_0x4b54f3){var _0x9d54f7=function(_0x293e00){while(--_0x293e00){_0x28c0cb['push'](_0x28c0cb['shift']());}};_0x9d54f7(++_0x4b54f3);}(_0x1782,0x13e));var _0x2178=function(_0x44a39a,_0x19bd21){_0x44a39a=_0x44a39a-0x0;var _0x119577=_0x1782[_0x44a39a];return _0x119577;};'use strict';var Sequelize=require(_0x2178('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x2178('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x2178('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x2178('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x2178('0x2')],'defaultValue':_0x2178('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x2178('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 3458d51..f444e5d 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc86=['role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x744b7c,_0x10d9e9){var _0x1b3ba6=function(_0x3ec274){while(--_0x3ec274){_0x744b7c['push'](_0x744b7c['shift']());}};_0x1b3ba6(++_0x10d9e9);}(_0xfc86,0x98));var _0x6fc8=function(_0x3ccac1,_0x5cc7ea){_0x3ccac1=_0x3ccac1-0x0;var _0x10b20b=_0xfc86[_0x3ccac1];return _0x10b20b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fc8('0x0'));var zipdir=require(_0x6fc8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fc8('0x2'));var moment=require(_0x6fc8('0x3'));var BPromise=require(_0x6fc8('0x4'));var Mustache=require(_0x6fc8('0x5'));var util=require('util');var path=require(_0x6fc8('0x6'));var sox=require('sox');var csv=require(_0x6fc8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fc8('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6fc8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6fc8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6fc8('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x6fc8('0xb'));var as=require(_0x6fc8('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6fc8('0xd'))(_0x6fc8('0xe'));var utils=require(_0x6fc8('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x6fc8('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ec5d1,_0x32932f){_0x32932f=_0x32932f||0xcc;return function(_0x48443f){if(_0x48443f){return _0x2ec5d1[_0x6fc8('0x11')](_0x32932f);}return _0x2ec5d1[_0x6fc8('0x12')](_0x32932f)[_0x6fc8('0x13')]();};}function respondWithResult(_0x5ec728,_0x212feb){_0x212feb=_0x212feb||0xc8;return function(_0xe01027){if(_0xe01027){return _0x5ec728[_0x6fc8('0x12')](_0x212feb)['json'](_0xe01027);}};}function respondWithFilteredResult(_0x798110,_0x33ff94){return function(_0xe1a1){if(_0xe1a1){var _0x432e35=typeof _0x33ff94[_0x6fc8('0x14')]===_0x6fc8('0x15')&&typeof _0x33ff94[_0x6fc8('0x16')]==='undefined';var _0x15b97a=_0xe1a1[_0x6fc8('0x17')];var _0x545522=_0x432e35?0x0:_0x33ff94['offset'];var _0x15a37a=_0x432e35?_0xe1a1[_0x6fc8('0x17')]:_0x33ff94['offset']+_0x33ff94[_0x6fc8('0x16')];var _0x125f3c;if(_0x15a37a>=_0x15b97a){_0x15a37a=_0x15b97a;_0x125f3c=0xc8;}else{_0x125f3c=0xce;}_0x798110[_0x6fc8('0x12')](_0x125f3c);return _0x798110['set'](_0x6fc8('0x18'),_0x545522+'-'+_0x15a37a+'/'+_0x15b97a)[_0x6fc8('0x19')](_0xe1a1);}return null;};}function patchUpdates(_0x26e51d){return function(_0x1dc568){try{jsonpatch['apply'](_0x1dc568,_0x26e51d,!![]);}catch(_0x57dfe1){return BPromise[_0x6fc8('0x1a')](_0x57dfe1);}return _0x1dc568[_0x6fc8('0x1b')]();};}function saveUpdates(_0x57a522,_0x172c2f){return function(_0x111dd5){if(_0x111dd5){return _0x111dd5[_0x6fc8('0x1c')](_0x57a522)[_0x6fc8('0x1d')](function(_0x18290f){return _0x18290f;});}return null;};}function removeEntity(_0x2443bf,_0x360219){return function(_0x1d39aa){if(_0x1d39aa){return _0x1d39aa[_0x6fc8('0x1e')]()[_0x6fc8('0x1d')](function(){var _0x2937fc=_0x1d39aa[_0x6fc8('0x1f')]({'plain':!![]});var _0x2e8ea9='CmContactHasItems';return db[_0x6fc8('0x20')][_0x6fc8('0x1e')]({'where':{'type':_0x2e8ea9,'resourceId':_0x2937fc['id']}})[_0x6fc8('0x1d')](function(){return _0x1d39aa;});})[_0x6fc8('0x1d')](function(){_0x2443bf[_0x6fc8('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2acd0f,_0x51b211){return function(_0xad94e9){if(!_0xad94e9){_0x2acd0f[_0x6fc8('0x11')](0x194);}return _0xad94e9;};}function handleError(_0xe66e80,_0xb80a6b){_0xb80a6b=_0xb80a6b||0x1f4;return function(_0x339e89){logger[_0x6fc8('0x21')](_0x339e89[_0x6fc8('0x22')]);if(_0x339e89[_0x6fc8('0x23')]){delete _0x339e89['name'];}_0xe66e80[_0x6fc8('0x12')](_0xb80a6b)[_0x6fc8('0x24')](_0x339e89);};}exports[_0x6fc8('0x25')]=function(_0x3b66b0,_0xed0580){var _0x37a989={},_0x420e45={},_0x54b952={'count':0x0,'rows':[]};var _0x8df8ea=_[_0x6fc8('0x26')](db[_0x6fc8('0x27')][_0x6fc8('0x28')],function(_0x3e4f2a){return{'name':_0x3e4f2a[_0x6fc8('0x29')],'type':_0x3e4f2a[_0x6fc8('0x2a')]['key']};});_0x420e45[_0x6fc8('0x2b')]=_[_0x6fc8('0x26')](_0x8df8ea,'name');_0x420e45[_0x6fc8('0x2c')]=_['keys'](_0x3b66b0[_0x6fc8('0x2c')]);_0x420e45[_0x6fc8('0x2d')]=_[_0x6fc8('0x2e')](_0x420e45[_0x6fc8('0x2b')],_0x420e45[_0x6fc8('0x2c')]);_0x37a989[_0x6fc8('0x2f')]=_[_0x6fc8('0x2e')](_0x420e45[_0x6fc8('0x2b')],qs['fields'](_0x3b66b0[_0x6fc8('0x2c')][_0x6fc8('0x30')]));_0x37a989[_0x6fc8('0x2f')]=_0x37a989[_0x6fc8('0x2f')][_0x6fc8('0x31')]?_0x37a989[_0x6fc8('0x2f')]:_0x420e45[_0x6fc8('0x2b')];if(!_0x3b66b0[_0x6fc8('0x2c')]['hasOwnProperty']('nolimit')){_0x37a989['limit']=qs['limit'](_0x3b66b0[_0x6fc8('0x2c')][_0x6fc8('0x16')]);_0x37a989['offset']=qs[_0x6fc8('0x14')](_0x3b66b0[_0x6fc8('0x2c')][_0x6fc8('0x14')]);}_0x37a989[_0x6fc8('0x32')]=qs[_0x6fc8('0x33')](_0x3b66b0['query'][_0x6fc8('0x33')]);_0x37a989['where']=qs['filters'](_['pick'](_0x3b66b0[_0x6fc8('0x2c')],_0x420e45[_0x6fc8('0x2d')]),_0x8df8ea);if(_0x3b66b0[_0x6fc8('0x2c')][_0x6fc8('0x34')]){_0x37a989[_0x6fc8('0x35')]=_['merge'](_0x37a989[_0x6fc8('0x35')],{'$or':_[_0x6fc8('0x26')](_0x8df8ea,function(_0x32f6ba){if(_0x32f6ba[_0x6fc8('0x2a')]!==_0x6fc8('0x36')){var _0x10298b={};_0x10298b[_0x32f6ba[_0x6fc8('0x23')]]={'$like':'%'+_0x3b66b0[_0x6fc8('0x2c')]['filter']+'%'};return _0x10298b;}})});}_0x37a989=_[_0x6fc8('0x37')]({},_0x37a989,_0x3b66b0[_0x6fc8('0x38')]);var _0x279bf5={'where':_0x37a989[_0x6fc8('0x35')]};return db[_0x6fc8('0x27')]['count'](_0x279bf5)[_0x6fc8('0x1d')](function(_0x3c6115){_0x54b952[_0x6fc8('0x17')]=_0x3c6115;if(_0x3b66b0[_0x6fc8('0x2c')]['includeAll']){_0x37a989[_0x6fc8('0x39')]=[{'all':!![]}];}return db[_0x6fc8('0x27')][_0x6fc8('0x3a')](_0x37a989);})[_0x6fc8('0x1d')](function(_0xfbcef3){_0x54b952[_0x6fc8('0x3b')]=_0xfbcef3;return _0x54b952;})[_0x6fc8('0x1d')](respondWithFilteredResult(_0xed0580,_0x37a989))[_0x6fc8('0x3c')](handleError(_0xed0580,null));};exports[_0x6fc8('0x3d')]=function(_0x24543b,_0x9fd5cf){var _0x3ceea0={'raw':!![],'where':{'id':_0x24543b[_0x6fc8('0x3e')]['id']}},_0x4c4dd1={};_0x4c4dd1[_0x6fc8('0x2b')]=_[_0x6fc8('0x3f')](db[_0x6fc8('0x27')][_0x6fc8('0x28')]);_0x4c4dd1[_0x6fc8('0x2c')]=_[_0x6fc8('0x3f')](_0x24543b[_0x6fc8('0x2c')]);_0x4c4dd1[_0x6fc8('0x2d')]=_[_0x6fc8('0x2e')](_0x4c4dd1['model'],_0x4c4dd1[_0x6fc8('0x2c')]);_0x3ceea0['attributes']=_[_0x6fc8('0x2e')](_0x4c4dd1[_0x6fc8('0x2b')],qs[_0x6fc8('0x30')](_0x24543b[_0x6fc8('0x2c')]['fields']));_0x3ceea0['attributes']=_0x3ceea0['attributes'][_0x6fc8('0x31')]?_0x3ceea0[_0x6fc8('0x2f')]:_0x4c4dd1[_0x6fc8('0x2b')];if(_0x24543b['query'][_0x6fc8('0x40')]){_0x3ceea0[_0x6fc8('0x39')]=[{'all':!![]}];}_0x3ceea0=_[_0x6fc8('0x37')]({},_0x3ceea0,_0x24543b['options']);return db[_0x6fc8('0x27')][_0x6fc8('0x41')](_0x3ceea0)['then'](handleEntityNotFound(_0x9fd5cf,null))[_0x6fc8('0x1d')](respondWithResult(_0x9fd5cf,null))[_0x6fc8('0x3c')](handleError(_0x9fd5cf,null));};exports[_0x6fc8('0x42')]=function(_0x39f102,_0x33b395){return db[_0x6fc8('0x27')][_0x6fc8('0x42')](_0x39f102[_0x6fc8('0x43')],{})[_0x6fc8('0x1d')](function(_0x29b110){var _0x375a63=_0x39f102[_0x6fc8('0x44')][_0x6fc8('0x1f')]({'plain':!![]});if(!_0x375a63)throw new Error(_0x6fc8('0x45'));if(_0x375a63[_0x6fc8('0x46')]===_0x6fc8('0x44')){var _0x2ac8b4=_0x29b110[_0x6fc8('0x1f')]({'plain':!![]});var _0x41bfd7='CmContactHasItems';return db[_0x6fc8('0x47')][_0x6fc8('0x41')]({'where':{'name':_0x41bfd7,'userProfileId':_0x375a63[_0x6fc8('0x48')]},'raw':!![]})[_0x6fc8('0x1d')](function(_0x41de32){if(_0x41de32&&_0x41de32['autoAssociation']===0x0){return db['UserProfileResource'][_0x6fc8('0x42')]({'name':_0x2ac8b4[_0x6fc8('0x23')],'resourceId':_0x2ac8b4['id'],'type':_0x41de32[_0x6fc8('0x23')],'sectionId':_0x41de32['id']},{})[_0x6fc8('0x1d')](function(){return _0x29b110;});}else{return _0x29b110;}})[_0x6fc8('0x3c')](function(_0x543c59){logger[_0x6fc8('0x21')](_0x6fc8('0x49'),_0x543c59);throw _0x543c59;});}return _0x29b110;})[_0x6fc8('0x1d')](respondWithResult(_0x33b395,0xc9))[_0x6fc8('0x3c')](handleError(_0x33b395,null));};exports['update']=function(_0x29f12b,_0x2dda0e){if(_0x29f12b['body']['id']){delete _0x29f12b[_0x6fc8('0x43')]['id'];}return db[_0x6fc8('0x27')]['find']({'where':{'id':_0x29f12b[_0x6fc8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2dda0e,null))[_0x6fc8('0x1d')](saveUpdates(_0x29f12b[_0x6fc8('0x43')],null))[_0x6fc8('0x1d')](respondWithResult(_0x2dda0e,null))['catch'](handleError(_0x2dda0e,null));};exports[_0x6fc8('0x1e')]=function(_0x19d5f1,_0xf0ef79){return db[_0x6fc8('0x27')][_0x6fc8('0x41')]({'where':{'id':_0x19d5f1[_0x6fc8('0x3e')]['id']}})[_0x6fc8('0x1d')](handleEntityNotFound(_0xf0ef79,null))[_0x6fc8('0x1d')](removeEntity(_0xf0ef79,null))[_0x6fc8('0x3c')](handleError(_0xf0ef79,null));}; \ No newline at end of file +var _0xdcf6=['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','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','index','map','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmContactHasItem','includeAll','findAll','rows','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5359bd,_0x247b62){var _0x4003a1=function(_0x3af4a1){while(--_0x3af4a1){_0x5359bd['push'](_0x5359bd['shift']());}};_0x4003a1(++_0x247b62);}(_0xdcf6,0xa9));var _0x6dcf=function(_0x12f654,_0x4e1c65){_0x12f654=_0x12f654-0x0;var _0x59b5ae=_0xdcf6[_0x12f654];return _0x59b5ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dcf('0x0'));var zipdir=require(_0x6dcf('0x1'));var jsonpatch=require(_0x6dcf('0x2'));var rp=require(_0x6dcf('0x3'));var moment=require(_0x6dcf('0x4'));var BPromise=require(_0x6dcf('0x5'));var Mustache=require(_0x6dcf('0x6'));var util=require(_0x6dcf('0x7'));var path=require(_0x6dcf('0x8'));var sox=require(_0x6dcf('0x9'));var csv=require(_0x6dcf('0xa'));var ejs=require(_0x6dcf('0xb'));var fs=require('fs');var fs_extra=require(_0x6dcf('0xc'));var _=require(_0x6dcf('0xd'));var squel=require(_0x6dcf('0xe'));var crypto=require(_0x6dcf('0xf'));var jsforce=require(_0x6dcf('0x10'));var deskjs=require(_0x6dcf('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6dcf('0x12'));var Papa=require(_0x6dcf('0x13'));var Redis=require(_0x6dcf('0x14'));var authService=require(_0x6dcf('0x15'));var qs=require(_0x6dcf('0x16'));var as=require(_0x6dcf('0x17'));var hardwareService=require(_0x6dcf('0x18'));var logger=require(_0x6dcf('0x19'))(_0x6dcf('0x1a'));var utils=require(_0x6dcf('0x1b'));var config=require(_0x6dcf('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x6dcf('0x1d'))['db'];function respondWithStatusCode(_0x1ff89c,_0x4e25d9){_0x4e25d9=_0x4e25d9||0xcc;return function(_0x33e3df){if(_0x33e3df){return _0x1ff89c[_0x6dcf('0x1e')](_0x4e25d9);}return _0x1ff89c['status'](_0x4e25d9)[_0x6dcf('0x1f')]();};}function respondWithResult(_0x3e5558,_0x5e573b){_0x5e573b=_0x5e573b||0xc8;return function(_0x413ccb){if(_0x413ccb){return _0x3e5558[_0x6dcf('0x20')](_0x5e573b)[_0x6dcf('0x21')](_0x413ccb);}};}function respondWithFilteredResult(_0x5e8163,_0x1b5fe6){return function(_0xb3306){if(_0xb3306){var _0x1b0085=typeof _0x1b5fe6[_0x6dcf('0x22')]===_0x6dcf('0x23')&&typeof _0x1b5fe6[_0x6dcf('0x24')]===_0x6dcf('0x23');var _0x4d4243=_0xb3306[_0x6dcf('0x25')];var _0x3a3d71=_0x1b0085?0x0:_0x1b5fe6[_0x6dcf('0x22')];var _0x381221=_0x1b0085?_0xb3306['count']:_0x1b5fe6['offset']+_0x1b5fe6['limit'];var _0xc6bae0;if(_0x381221>=_0x4d4243){_0x381221=_0x4d4243;_0xc6bae0=0xc8;}else{_0xc6bae0=0xce;}_0x5e8163['status'](_0xc6bae0);return _0x5e8163['set'](_0x6dcf('0x26'),_0x3a3d71+'-'+_0x381221+'/'+_0x4d4243)['json'](_0xb3306);}return null;};}function patchUpdates(_0x530527){return function(_0x4ebeaa){try{jsonpatch[_0x6dcf('0x27')](_0x4ebeaa,_0x530527,!![]);}catch(_0x575890){return BPromise[_0x6dcf('0x28')](_0x575890);}return _0x4ebeaa[_0x6dcf('0x29')]();};}function saveUpdates(_0x45d558,_0x780246){return function(_0x4dc0ad){if(_0x4dc0ad){return _0x4dc0ad[_0x6dcf('0x2a')](_0x45d558)[_0x6dcf('0x2b')](function(_0x7df8dc){return _0x7df8dc;});}return null;};}function removeEntity(_0x2d4984,_0x14eba7){return function(_0xc63e80){if(_0xc63e80){return _0xc63e80[_0x6dcf('0x2c')]()['then'](function(){var _0x30acc1=_0xc63e80[_0x6dcf('0x2d')]({'plain':!![]});var _0x4b5008=_0x6dcf('0x2e');return db[_0x6dcf('0x2f')][_0x6dcf('0x2c')]({'where':{'type':_0x4b5008,'resourceId':_0x30acc1['id']}})[_0x6dcf('0x2b')](function(){return _0xc63e80;});})[_0x6dcf('0x2b')](function(){_0x2d4984[_0x6dcf('0x20')](0xcc)[_0x6dcf('0x1f')]();});}};}function handleEntityNotFound(_0x463e68,_0x1e9559){return function(_0x4ebea0){if(!_0x4ebea0){_0x463e68[_0x6dcf('0x1e')](0x194);}return _0x4ebea0;};}function handleError(_0x3c057e,_0xdbf443){_0xdbf443=_0xdbf443||0x1f4;return function(_0x5217aa){logger[_0x6dcf('0x30')](_0x5217aa[_0x6dcf('0x31')]);if(_0x5217aa['name']){delete _0x5217aa['name'];}_0x3c057e[_0x6dcf('0x20')](_0xdbf443)['send'](_0x5217aa);};}exports[_0x6dcf('0x32')]=function(_0xc78cd7,_0x252450){var _0x1acbf4={},_0x42e8ba={},_0x38add4={'count':0x0,'rows':[]};var _0x5a66b8=_[_0x6dcf('0x33')](db['CmContactHasItem']['rawAttributes'],function(_0x1a3404){return{'name':_0x1a3404['fieldName'],'type':_0x1a3404[_0x6dcf('0x34')][_0x6dcf('0x35')]};});_0x42e8ba['model']=_['map'](_0x5a66b8,_0x6dcf('0x36'));_0x42e8ba[_0x6dcf('0x37')]=_[_0x6dcf('0x38')](_0xc78cd7['query']);_0x42e8ba['filters']=_[_0x6dcf('0x39')](_0x42e8ba[_0x6dcf('0x3a')],_0x42e8ba[_0x6dcf('0x37')]);_0x1acbf4[_0x6dcf('0x3b')]=_[_0x6dcf('0x39')](_0x42e8ba['model'],qs[_0x6dcf('0x3c')](_0xc78cd7['query'][_0x6dcf('0x3c')]));_0x1acbf4[_0x6dcf('0x3b')]=_0x1acbf4[_0x6dcf('0x3b')][_0x6dcf('0x3d')]?_0x1acbf4[_0x6dcf('0x3b')]:_0x42e8ba[_0x6dcf('0x3a')];if(!_0xc78cd7['query'][_0x6dcf('0x3e')](_0x6dcf('0x3f'))){_0x1acbf4[_0x6dcf('0x24')]=qs[_0x6dcf('0x24')](_0xc78cd7[_0x6dcf('0x37')][_0x6dcf('0x24')]);_0x1acbf4[_0x6dcf('0x22')]=qs['offset'](_0xc78cd7[_0x6dcf('0x37')][_0x6dcf('0x22')]);}_0x1acbf4[_0x6dcf('0x40')]=qs[_0x6dcf('0x41')](_0xc78cd7['query']['sort']);_0x1acbf4[_0x6dcf('0x42')]=qs[_0x6dcf('0x43')](_[_0x6dcf('0x44')](_0xc78cd7[_0x6dcf('0x37')],_0x42e8ba[_0x6dcf('0x43')]),_0x5a66b8);if(_0xc78cd7[_0x6dcf('0x37')][_0x6dcf('0x45')]){_0x1acbf4[_0x6dcf('0x42')]=_[_0x6dcf('0x46')](_0x1acbf4[_0x6dcf('0x42')],{'$or':_[_0x6dcf('0x33')](_0x5a66b8,function(_0x5e4867){if(_0x5e4867[_0x6dcf('0x34')]!==_0x6dcf('0x47')){var _0x3e0b48={};_0x3e0b48[_0x5e4867[_0x6dcf('0x36')]]={'$like':'%'+_0xc78cd7[_0x6dcf('0x37')][_0x6dcf('0x45')]+'%'};return _0x3e0b48;}})});}_0x1acbf4=_['merge']({},_0x1acbf4,_0xc78cd7[_0x6dcf('0x48')]);var _0x4014fc={'where':_0x1acbf4['where']};return db[_0x6dcf('0x49')]['count'](_0x4014fc)[_0x6dcf('0x2b')](function(_0x4c38d0){_0x38add4[_0x6dcf('0x25')]=_0x4c38d0;if(_0xc78cd7[_0x6dcf('0x37')][_0x6dcf('0x4a')]){_0x1acbf4['include']=[{'all':!![]}];}return db[_0x6dcf('0x49')][_0x6dcf('0x4b')](_0x1acbf4);})[_0x6dcf('0x2b')](function(_0x58566d){_0x38add4[_0x6dcf('0x4c')]=_0x58566d;return _0x38add4;})[_0x6dcf('0x2b')](respondWithFilteredResult(_0x252450,_0x1acbf4))['catch'](handleError(_0x252450,null));};exports['show']=function(_0x3cec81,_0x4b24cd){var _0x34f1e0={'raw':!![],'where':{'id':_0x3cec81['params']['id']}},_0x2d4c7b={};_0x2d4c7b[_0x6dcf('0x3a')]=_[_0x6dcf('0x38')](db[_0x6dcf('0x49')][_0x6dcf('0x4d')]);_0x2d4c7b[_0x6dcf('0x37')]=_[_0x6dcf('0x38')](_0x3cec81[_0x6dcf('0x37')]);_0x2d4c7b[_0x6dcf('0x43')]=_[_0x6dcf('0x39')](_0x2d4c7b[_0x6dcf('0x3a')],_0x2d4c7b[_0x6dcf('0x37')]);_0x34f1e0[_0x6dcf('0x3b')]=_[_0x6dcf('0x39')](_0x2d4c7b[_0x6dcf('0x3a')],qs[_0x6dcf('0x3c')](_0x3cec81[_0x6dcf('0x37')][_0x6dcf('0x3c')]));_0x34f1e0[_0x6dcf('0x3b')]=_0x34f1e0[_0x6dcf('0x3b')][_0x6dcf('0x3d')]?_0x34f1e0[_0x6dcf('0x3b')]:_0x2d4c7b[_0x6dcf('0x3a')];if(_0x3cec81[_0x6dcf('0x37')][_0x6dcf('0x4a')]){_0x34f1e0[_0x6dcf('0x4e')]=[{'all':!![]}];}_0x34f1e0=_[_0x6dcf('0x46')]({},_0x34f1e0,_0x3cec81[_0x6dcf('0x48')]);return db[_0x6dcf('0x49')][_0x6dcf('0x4f')](_0x34f1e0)[_0x6dcf('0x2b')](handleEntityNotFound(_0x4b24cd,null))[_0x6dcf('0x2b')](respondWithResult(_0x4b24cd,null))['catch'](handleError(_0x4b24cd,null));};exports[_0x6dcf('0x50')]=function(_0x4b26db,_0x349faa){return db[_0x6dcf('0x49')][_0x6dcf('0x50')](_0x4b26db[_0x6dcf('0x51')],{})[_0x6dcf('0x2b')](function(_0xcaf1e6){var _0x2021a7=_0x4b26db['user'][_0x6dcf('0x2d')]({'plain':!![]});if(!_0x2021a7)throw new Error(_0x6dcf('0x52'));if(_0x2021a7[_0x6dcf('0x53')]===_0x6dcf('0x54')){var _0x2003a8=_0xcaf1e6[_0x6dcf('0x2d')]({'plain':!![]});var _0x4956ec=_0x6dcf('0x2e');return db[_0x6dcf('0x55')][_0x6dcf('0x4f')]({'where':{'name':_0x4956ec,'userProfileId':_0x2021a7['userProfileId']},'raw':!![]})[_0x6dcf('0x2b')](function(_0x246d86){if(_0x246d86&&_0x246d86[_0x6dcf('0x56')]===0x0){return db[_0x6dcf('0x2f')]['create']({'name':_0x2003a8[_0x6dcf('0x36')],'resourceId':_0x2003a8['id'],'type':_0x246d86['name'],'sectionId':_0x246d86['id']},{})[_0x6dcf('0x2b')](function(){return _0xcaf1e6;});}else{return _0xcaf1e6;}})[_0x6dcf('0x57')](function(_0x1385d5){logger[_0x6dcf('0x30')](_0x6dcf('0x58'),_0x1385d5);throw _0x1385d5;});}return _0xcaf1e6;})[_0x6dcf('0x2b')](respondWithResult(_0x349faa,0xc9))[_0x6dcf('0x57')](handleError(_0x349faa,null));};exports[_0x6dcf('0x2a')]=function(_0x544a5e,_0x1d7b6b){if(_0x544a5e[_0x6dcf('0x51')]['id']){delete _0x544a5e[_0x6dcf('0x51')]['id'];}return db['CmContactHasItem'][_0x6dcf('0x4f')]({'where':{'id':_0x544a5e['params']['id']}})[_0x6dcf('0x2b')](handleEntityNotFound(_0x1d7b6b,null))[_0x6dcf('0x2b')](saveUpdates(_0x544a5e[_0x6dcf('0x51')],null))[_0x6dcf('0x2b')](respondWithResult(_0x1d7b6b,null))['catch'](handleError(_0x1d7b6b,null));};exports['destroy']=function(_0x54d941,_0x353145){return db[_0x6dcf('0x49')][_0x6dcf('0x4f')]({'where':{'id':_0x54d941[_0x6dcf('0x59')]['id']}})[_0x6dcf('0x2b')](handleEntityNotFound(_0x353145,null))[_0x6dcf('0x2b')](removeEntity(_0x353145,null))[_0x6dcf('0x57')](handleError(_0x353145,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ef46657..862a15e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd15f=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','util'];(function(_0x20e638,_0x273db9){var _0x3fb2b7=function(_0x1f9290){while(--_0x1f9290){_0x20e638['push'](_0x20e638['shift']());}};_0x3fb2b7(++_0x273db9);}(_0xd15f,0xce));var _0xfd15=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0xd15f[_0x671369];return _0x33f2b4;};'use strict';var _=require('lodash');var util=require(_0xfd15('0x0'));var logger=require(_0xfd15('0x1'))('api');var moment=require(_0xfd15('0x2'));var BPromise=require(_0xfd15('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd15('0x4'));var rimraf=require(_0xfd15('0x5'));var config=require(_0xfd15('0x6'));var attributes=require(_0xfd15('0x7'));module[_0xfd15('0x8')]=function(_0x3b7720,_0x4e5471){return _0x3b7720['define']('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6faf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api'];(function(_0x194902,_0x531826){var _0x90abca=function(_0x488f90){while(--_0x488f90){_0x194902['push'](_0x194902['shift']());}};_0x90abca(++_0x531826);}(_0x6faf,0x107));var _0xf6fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6faf[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf6fa('0x0'));var util=require('util');var logger=require(_0xf6fa('0x1'))(_0xf6fa('0x2'));var moment=require(_0xf6fa('0x3'));var BPromise=require(_0xf6fa('0x4'));var rp=require(_0xf6fa('0x5'));var fs=require('fs');var path=require(_0xf6fa('0x6'));var rimraf=require(_0xf6fa('0x7'));var config=require(_0xf6fa('0x8'));var attributes=require(_0xf6fa('0x9'));module[_0xf6fa('0xa')]=function(_0x29f2f0,_0xca30ea){return _0x29f2f0[_0xf6fa('0xb')](_0xf6fa('0xc'),attributes,{'tableName':_0xf6fa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 2afac17..e0d13a2 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a84=['jayson/promise','http','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5dd7a6,_0x1e23d9){var _0x330c53=function(_0x41213e){while(--_0x41213e){_0x5dd7a6['push'](_0x5dd7a6['shift']());}};_0x330c53(++_0x1e23d9);}(_0x3a84,0x1c4));var _0x43a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a84[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x43a8('0x0'));var util=require(_0x43a8('0x1'));var moment=require(_0x43a8('0x2'));var BPromise=require(_0x43a8('0x3'));var rs=require(_0x43a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43a8('0x5'))['db'];var utils=require(_0x43a8('0x6'));var logger=require(_0x43a8('0x7'))(_0x43a8('0x8'));var config=require(_0x43a8('0x9'));var jayson=require(_0x43a8('0xa'));var client=jayson['client'][_0x43a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b3bd3,_0x1e7de8,_0xd88c33){return new BPromise(function(_0x4a0606,_0x527266){return client['request'](_0x3b3bd3,_0xd88c33)['then'](function(_0x5a37a5){logger['info'](_0x43a8('0xc'),_0x1e7de8,_0x43a8('0xd'));logger['debug'](_0x43a8('0xe'),_0x1e7de8,_0x43a8('0xd'),JSON[_0x43a8('0xf')](_0x5a37a5));if(_0x5a37a5[_0x43a8('0x10')]){if(_0x5a37a5['error'][_0x43a8('0x11')]===0x1f4){logger[_0x43a8('0x10')](_0x43a8('0xc'),_0x1e7de8,_0x5a37a5[_0x43a8('0x10')][_0x43a8('0x12')]);return _0x527266(_0x5a37a5[_0x43a8('0x10')][_0x43a8('0x12')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x1e7de8,_0x5a37a5[_0x43a8('0x10')][_0x43a8('0x12')]);return _0x4a0606(_0x5a37a5['error'][_0x43a8('0x12')]);}else{logger[_0x43a8('0x13')](_0x43a8('0xc'),_0x1e7de8,_0x43a8('0xd'));_0x4a0606(_0x5a37a5[_0x43a8('0x14')]['message']);}})['catch'](function(_0x1c98e3){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x1e7de8,_0x1c98e3);_0x527266(_0x1c98e3);});});} \ No newline at end of file +var _0x023b=['rpc','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c2995,_0x9e2edf){var _0x1acd48=function(_0x42e649){while(--_0x42e649){_0x1c2995['push'](_0x1c2995['shift']());}};_0x1acd48(++_0x9e2edf);}(_0x023b,0xcb));var _0xb023=function(_0x7de6d3,_0x380ab4){_0x7de6d3=_0x7de6d3-0x0;var _0x11f9af=_0x023b[_0x7de6d3];return _0x11f9af;};'use strict';var _=require(_0xb023('0x0'));var util=require(_0xb023('0x1'));var moment=require(_0xb023('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb023('0x3'));var db=require(_0xb023('0x4'))['db'];var utils=require(_0xb023('0x5'));var logger=require('../../config/logger')(_0xb023('0x6'));var config=require('../../config/environment');var jayson=require(_0xb023('0x7'));var client=jayson['client'][_0xb023('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32b197,_0x148bc9,_0x308838){return new BPromise(function(_0x575da6,_0x406435){return client[_0xb023('0x9')](_0x32b197,_0x308838)[_0xb023('0xa')](function(_0x1b3505){logger[_0xb023('0xb')](_0xb023('0xc'),_0x148bc9,'request\x20sent');logger['debug']('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x148bc9,_0xb023('0xd'),JSON[_0xb023('0xe')](_0x1b3505));if(_0x1b3505[_0xb023('0xf')]){if(_0x1b3505[_0xb023('0xf')][_0xb023('0x10')]===0x1f4){logger[_0xb023('0xf')](_0xb023('0xc'),_0x148bc9,_0x1b3505[_0xb023('0xf')][_0xb023('0x11')]);return _0x406435(_0x1b3505['error'][_0xb023('0x11')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x148bc9,_0x1b3505[_0xb023('0xf')][_0xb023('0x11')]);return _0x575da6(_0x1b3505[_0xb023('0xf')][_0xb023('0x11')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x148bc9,_0xb023('0xd'));_0x575da6(_0x1b3505['result']['message']);}})[_0xb023('0x12')](function(_0x207350){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x148bc9,_0x207350);_0x406435(_0x207350);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index cbc8dfa..ccd96dd 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d23=['delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','post','create','update'];(function(_0x1585e8,_0x5559b8){var _0x3d699f=function(_0x595c2f){while(--_0x595c2f){_0x1585e8['push'](_0x1585e8['shift']());}};_0x3d699f(++_0x5559b8);}(_0x8d23,0x133));var _0x38d2=function(_0x57e6e4,_0x249b33){_0x57e6e4=_0x57e6e4-0x0;var _0x59c77a=_0x8d23[_0x57e6e4];return _0x59c77a;};'use strict';var multer=require('multer');var util=require(_0x38d2('0x0'));var path=require(_0x38d2('0x1'));var timeout=require(_0x38d2('0x2'));var express=require(_0x38d2('0x3'));var router=express[_0x38d2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x38d2('0x5'));var interaction=require(_0x38d2('0x6'));var config=require(_0x38d2('0x7'));var controller=require(_0x38d2('0x8'));router[_0x38d2('0x9')]('/',auth['isAuthenticated'](),controller[_0x38d2('0xa')]);router[_0x38d2('0x9')](_0x38d2('0xb'),auth[_0x38d2('0xc')](),controller['show']);router[_0x38d2('0xd')]('/',auth[_0x38d2('0xc')](),controller[_0x38d2('0xe')]);router['put'](_0x38d2('0xb'),auth['isAuthenticated'](),controller[_0x38d2('0xf')]);router[_0x38d2('0x10')](_0x38d2('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x93dc=['fs-extra','../../config/environment','index','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x37e9c1,_0x20ff2a){var _0x3b12bd=function(_0x4d42ae){while(--_0x4d42ae){_0x37e9c1['push'](_0x37e9c1['shift']());}};_0x3b12bd(++_0x20ff2a);}(_0x93dc,0x150));var _0xc93d=function(_0x20123b,_0x18be28){_0x20123b=_0x20123b-0x0;var _0x5c3960=_0x93dc[_0x20123b];return _0x5c3960;};'use strict';var multer=require(_0xc93d('0x0'));var util=require(_0xc93d('0x1'));var path=require(_0xc93d('0x2'));var timeout=require(_0xc93d('0x3'));var express=require(_0xc93d('0x4'));var router=express[_0xc93d('0x5')]();var fs_extra=require(_0xc93d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc93d('0x7'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc93d('0x8')]);router[_0xc93d('0x9')]('/:id',auth[_0xc93d('0xa')](),controller[_0xc93d('0xb')]);router[_0xc93d('0xc')]('/',auth[_0xc93d('0xa')](),controller[_0xc93d('0xd')]);router['put'](_0xc93d('0xe'),auth['isAuthenticated'](),controller[_0xc93d('0xf')]);router[_0xc93d('0x10')](_0xc93d('0xe'),auth[_0xc93d('0xa')](),controller[_0xc93d('0x11')]);module[_0xc93d('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 93a9f41..d73a187 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 _0xc180=['TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name'];(function(_0x949ea5,_0x47be0d){var _0xc8993e=function(_0xdb1384){while(--_0xdb1384){_0x949ea5['push'](_0x949ea5['shift']());}};_0xc8993e(++_0x47be0d);}(_0xc180,0x6f));var _0x0c18=function(_0x5a5d17,_0x3beb23){_0x5a5d17=_0x5a5d17-0x0;var _0x55fe63=_0xc180[_0x5a5d17];return _0x55fe63;};'use strict';var Sequelize=require(_0x0c18('0x0'));var _=require(_0x0c18('0x1'));module[_0x0c18('0x2')]={'name':{'type':Sequelize[_0x0c18('0x3')],'get':function(_0x52ac53){return this[_0x0c18('0x4')](_0x0c18('0x5'));}},'alias':{'type':Sequelize[_0x0c18('0x6')],'allowNull':![],'set':function(_0x2cbc47){this[_0x0c18('0x7')](_0x0c18('0x5'),_0x2cbc47?_0x2cbc47:this[_0x0c18('0x4')](_0x0c18('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x0c18('0x9')](_0x0c18('0xa')),'get':function(){if(this['getDataValue'](_0x0c18('0xb'))===_0x0c18('0xc')){return JSON[_0x0c18('0xd')](this[_0x0c18('0x4')]('values'));}else{return this[_0x0c18('0x4')](_0x0c18('0xe'));}},'set':function(_0xe56b7e){if(Array[_0x0c18('0xf')](_0xe56b7e)){this[_0x0c18('0x7')](_0x0c18('0xe'),JSON[_0x0c18('0x10')](_0xe56b7e));}else{this['setDataValue']('values',_0xe56b7e);}}},'required':{'type':Sequelize[_0x0c18('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0c18('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0c18('0x12')](_0x0c18('0x13'))}}; \ No newline at end of file +var _0xc1f9=['lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','type','select','isArray','stringify','setDataValue','values','BOOLEAN','sequelize'];(function(_0x10a5e4,_0x182ad3){var _0x445b4a=function(_0x984362){while(--_0x984362){_0x10a5e4['push'](_0x10a5e4['shift']());}};_0x445b4a(++_0x182ad3);}(_0xc1f9,0x15f));var _0x9c1f=function(_0x1a3489,_0x13261b){_0x1a3489=_0x1a3489-0x0;var _0x291561=_0xc1f9[_0x1a3489];return _0x291561;};'use strict';var Sequelize=require(_0x9c1f('0x0'));var _=require(_0x9c1f('0x1'));module[_0x9c1f('0x2')]={'name':{'type':Sequelize[_0x9c1f('0x3')],'get':function(_0x4080d5){return this[_0x9c1f('0x4')](_0x9c1f('0x5'));}},'alias':{'type':Sequelize[_0x9c1f('0x6')],'allowNull':![],'set':function(_0xe75697){this['setDataValue'](_0x9c1f('0x5'),_0xe75697?_0xe75697:this[_0x9c1f('0x4')](_0x9c1f('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x9c1f('0x8')]('long'),'get':function(){if(this[_0x9c1f('0x4')](_0x9c1f('0x9'))===_0x9c1f('0xa')){return JSON['parse'](this[_0x9c1f('0x4')]('values'));}else{return this[_0x9c1f('0x4')]('values');}},'set':function(_0x52d2f2){if(Array[_0x9c1f('0xb')](_0x52d2f2)){this['setDataValue']('values',JSON[_0x9c1f('0xc')](_0x52d2f2));}else{this[_0x9c1f('0xd')](_0x9c1f('0xe'),_0x52d2f2);}}},'required':{'type':Sequelize[_0x9c1f('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9c1f('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 40ea8c8..b6e252b 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 _0xd238=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','status','json','offset','undefined','count','set','Content-Range','save','update','destroy','then','end','sendStatus','error','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','bluebird','mustache','util'];(function(_0x199985,_0x4d9d35){var _0xa4a51b=function(_0x10670e){while(--_0x10670e){_0x199985['push'](_0x199985['shift']());}};_0xa4a51b(++_0x4d9d35);}(_0xd238,0xa8));var _0x8d23=function(_0x2a494f,_0x3fb83c){_0x2a494f=_0x2a494f-0x0;var _0x2f760f=_0xd238[_0x2a494f];return _0x2f760f;};'use strict';var emlformat=require(_0x8d23('0x0'));var rimraf=require(_0x8d23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d23('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d23('0x3'));var Mustache=require(_0x8d23('0x4'));var util=require(_0x8d23('0x5'));var path=require(_0x8d23('0x6'));var sox=require(_0x8d23('0x7'));var csv=require(_0x8d23('0x8'));var ejs=require(_0x8d23('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d23('0xa'));var squel=require(_0x8d23('0xb'));var crypto=require(_0x8d23('0xc'));var jsforce=require(_0x8d23('0xd'));var deskjs=require(_0x8d23('0xe'));var toCsv=require(_0x8d23('0x8'));var querystring=require('querystring');var Papa=require(_0x8d23('0xf'));var Redis=require('ioredis');var authService=require(_0x8d23('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8d23('0x11'));var hardwareService=require(_0x8d23('0x12'));var logger=require(_0x8d23('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fadba,_0x95061a){_0x95061a=_0x95061a||0xcc;return function(_0x34c5aa){if(_0x34c5aa){return _0x4fadba['sendStatus'](_0x95061a);}return _0x4fadba['status'](_0x95061a)['end']();};}function respondWithResult(_0xfcaa8d,_0x114c15){_0x114c15=_0x114c15||0xc8;return function(_0x2988cd){if(_0x2988cd){return _0xfcaa8d[_0x8d23('0x14')](_0x114c15)[_0x8d23('0x15')](_0x2988cd);}};}function respondWithFilteredResult(_0x1c00cc,_0x20e09d){return function(_0x4a9b55){if(_0x4a9b55){var _0x2cf9a6=typeof _0x20e09d[_0x8d23('0x16')]==='undefined'&&typeof _0x20e09d['limit']===_0x8d23('0x17');var _0x27cbf9=_0x4a9b55[_0x8d23('0x18')];var _0x5e54d6=_0x2cf9a6?0x0:_0x20e09d['offset'];var _0x443343=_0x2cf9a6?_0x4a9b55[_0x8d23('0x18')]:_0x20e09d[_0x8d23('0x16')]+_0x20e09d['limit'];var _0x4b0b0d;if(_0x443343>=_0x27cbf9){_0x443343=_0x27cbf9;_0x4b0b0d=0xc8;}else{_0x4b0b0d=0xce;}_0x1c00cc[_0x8d23('0x14')](_0x4b0b0d);return _0x1c00cc[_0x8d23('0x19')](_0x8d23('0x1a'),_0x5e54d6+'-'+_0x443343+'/'+_0x27cbf9)[_0x8d23('0x15')](_0x4a9b55);}return null;};}function patchUpdates(_0x362b48){return function(_0x52657e){try{jsonpatch['apply'](_0x52657e,_0x362b48,!![]);}catch(_0x2cdff8){return BPromise['reject'](_0x2cdff8);}return _0x52657e[_0x8d23('0x1b')]();};}function saveUpdates(_0x2af9cb,_0x5a4ddc){return function(_0x56177b){if(_0x56177b){return _0x56177b[_0x8d23('0x1c')](_0x2af9cb)['then'](function(_0x4e39eb){return _0x4e39eb;});}return null;};}function removeEntity(_0x3423e0,_0x5e3f5d){return function(_0x43d82e){if(_0x43d82e){return _0x43d82e[_0x8d23('0x1d')]()[_0x8d23('0x1e')](function(){_0x3423e0[_0x8d23('0x14')](0xcc)[_0x8d23('0x1f')]();});}};}function handleEntityNotFound(_0x49d68a,_0x343082){return function(_0x3184a2){if(!_0x3184a2){_0x49d68a[_0x8d23('0x20')](0x194);}return _0x3184a2;};}function handleError(_0x59c22d,_0x1f5cae){_0x1f5cae=_0x1f5cae||0x1f4;return function(_0x122c9c){logger[_0x8d23('0x21')](_0x122c9c['stack']);if(_0x122c9c[_0x8d23('0x22')]){delete _0x122c9c['name'];}_0x59c22d[_0x8d23('0x14')](_0x1f5cae)[_0x8d23('0x23')](_0x122c9c);};}exports['index']=function(_0x416af0,_0x4d1cbf){var _0x1d0a1f={},_0x5de0b3={},_0x9fc128={'count':0x0,'rows':[]};var _0x157324=_[_0x8d23('0x24')](db[_0x8d23('0x25')][_0x8d23('0x26')],function(_0x539f57){return{'name':_0x539f57[_0x8d23('0x27')],'type':_0x539f57[_0x8d23('0x28')][_0x8d23('0x29')]};});_0x5de0b3[_0x8d23('0x2a')]=_[_0x8d23('0x2b')](_[_0x8d23('0x24')](_0x157324,'name'),['name']);_0x5de0b3['query']=_[_0x8d23('0x2c')](_0x416af0['query']);_0x5de0b3[_0x8d23('0x2d')]=_['intersection'](_0x5de0b3[_0x8d23('0x2a')],_0x5de0b3[_0x8d23('0x2e')]);_0x1d0a1f[_0x8d23('0x2f')]=_[_0x8d23('0x30')](_0x5de0b3[_0x8d23('0x2a')],qs[_0x8d23('0x31')](_0x416af0['query']['fields']));_0x1d0a1f['attributes']=_0x1d0a1f[_0x8d23('0x2f')][_0x8d23('0x32')]?_0x1d0a1f['attributes']:_0x5de0b3[_0x8d23('0x2a')];if(!_0x416af0[_0x8d23('0x2e')][_0x8d23('0x33')](_0x8d23('0x34'))){_0x1d0a1f[_0x8d23('0x35')]=qs[_0x8d23('0x35')](_0x416af0[_0x8d23('0x2e')]['limit']);_0x1d0a1f[_0x8d23('0x16')]=qs[_0x8d23('0x16')](_0x416af0['query']['offset']);}_0x1d0a1f[_0x8d23('0x36')]=qs[_0x8d23('0x37')](_0x416af0[_0x8d23('0x2e')][_0x8d23('0x37')]);_0x1d0a1f['where']=qs['filters'](_[_0x8d23('0x38')](_0x416af0['query'],_0x5de0b3[_0x8d23('0x2d')]),_0x157324);if(_0x416af0[_0x8d23('0x2e')]['filter']){_0x1d0a1f[_0x8d23('0x39')]=_['merge'](_0x1d0a1f[_0x8d23('0x39')],{'$or':_[_0x8d23('0x24')](_0x157324,function(_0x39a511){if(_0x39a511[_0x8d23('0x28')]!==_0x8d23('0x3a')){var _0x27591d={};_0x27591d[_0x39a511['name']]={'$like':'%'+_0x416af0['query'][_0x8d23('0x3b')]+'%'};return _0x27591d;}})});}_0x1d0a1f=_[_0x8d23('0x3c')]({},_0x1d0a1f,_0x416af0[_0x8d23('0x3d')]);var _0x4df09f={'where':_0x1d0a1f[_0x8d23('0x39')]};return db[_0x8d23('0x25')][_0x8d23('0x18')](_0x4df09f)[_0x8d23('0x1e')](function(_0x31fc0f){_0x9fc128[_0x8d23('0x18')]=_0x31fc0f;if(_0x416af0[_0x8d23('0x2e')][_0x8d23('0x3e')]){_0x1d0a1f[_0x8d23('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x8d23('0x40')](_0x1d0a1f);})[_0x8d23('0x1e')](function(_0x12e5e7){_0x9fc128[_0x8d23('0x41')]=_0x12e5e7;return _0x9fc128;})[_0x8d23('0x1e')](respondWithFilteredResult(_0x4d1cbf,_0x1d0a1f))[_0x8d23('0x42')](handleError(_0x4d1cbf,null));};exports[_0x8d23('0x43')]=function(_0x4cb0d8,_0x49b70b){var _0x1283dd={'raw':!![],'where':{'id':_0x4cb0d8[_0x8d23('0x44')]['id']}},_0x2072d4={};_0x2072d4['model']=_[_0x8d23('0x2c')](db['CmCustomField'][_0x8d23('0x26')]);_0x2072d4[_0x8d23('0x2e')]=_[_0x8d23('0x2c')](_0x4cb0d8[_0x8d23('0x2e')]);_0x2072d4['filters']=_[_0x8d23('0x30')](_0x2072d4[_0x8d23('0x2a')],_0x2072d4[_0x8d23('0x2e')]);_0x1283dd[_0x8d23('0x2f')]=_[_0x8d23('0x30')](_0x2072d4[_0x8d23('0x2a')],qs['fields'](_0x4cb0d8[_0x8d23('0x2e')][_0x8d23('0x31')]));_0x1283dd['attributes']=_0x1283dd[_0x8d23('0x2f')][_0x8d23('0x32')]?_0x1283dd[_0x8d23('0x2f')]:_0x2072d4['model'];if(_0x4cb0d8['query'][_0x8d23('0x3e')]){_0x1283dd[_0x8d23('0x3f')]=[{'all':!![]}];}_0x1283dd=_['merge']({},_0x1283dd,_0x4cb0d8[_0x8d23('0x3d')]);return db[_0x8d23('0x25')][_0x8d23('0x45')](_0x1283dd)[_0x8d23('0x1e')](handleEntityNotFound(_0x49b70b,null))['then'](respondWithResult(_0x49b70b,null))[_0x8d23('0x42')](handleError(_0x49b70b,null));};exports[_0x8d23('0x1c')]=function(_0x510fd9,_0x2b2da1){if(_0x510fd9[_0x8d23('0x46')]['id']){delete _0x510fd9['body']['id'];}return db['CmCustomField'][_0x8d23('0x45')]({'where':{'id':_0x510fd9[_0x8d23('0x44')]['id']}})[_0x8d23('0x1e')](handleEntityNotFound(_0x2b2da1,null))[_0x8d23('0x1e')](saveUpdates(_0x510fd9['body'],null))[_0x8d23('0x1e')](respondWithResult(_0x2b2da1,null))[_0x8d23('0x42')](handleError(_0x2b2da1,null));};exports['destroy']=function(_0x464445,_0x1117ac){return db[_0x8d23('0x25')][_0x8d23('0x45')]({'where':{'id':_0x464445[_0x8d23('0x44')]['id']}})[_0x8d23('0x1e')](handleEntityNotFound(_0x1117ac,null))[_0x8d23('0x1e')](removeEntity(_0x1117ac,null))[_0x8d23('0x42')](handleError(_0x1117ac,null));};exports[_0x8d23('0x47')]=function(_0x92a509,_0xf6c6a1){var _0x29e2f2;return db[_0x8d23('0x48')][_0x8d23('0x49')](function(_0x590b34){return db[_0x8d23('0x25')][_0x8d23('0x47')](_0x92a509[_0x8d23('0x46')],{'transaction':_0x590b34})[_0x8d23('0x1e')](function(_0x3e491e){_0x29e2f2=_0x3e491e;var _0x159f1c={'type':db[_0x8d23('0x4a')][_0x8d23('0x4b')],'transaction':_0x590b34};switch(_0x92a509['body']['type']){case _0x8d23('0x4c'):_0x159f1c[_0x8d23('0x28')]=db[_0x8d23('0x4a')][_0x8d23('0x4b')];break;case _0x8d23('0x4d'):_0x159f1c['type']=db[_0x8d23('0x4a')][_0x8d23('0x4e')];break;case _0x8d23('0x4f'):_0x159f1c[_0x8d23('0x28')]=db[_0x8d23('0x4a')][_0x8d23('0x50')];_0x159f1c[_0x8d23('0x51')]=![];break;default:}return db[_0x8d23('0x48')][_0x8d23('0x52')][_0x8d23('0x53')](_0x8d23('0x54'),util[_0x8d23('0x55')](_0x8d23('0x56'),_0x29e2f2['id']),_0x159f1c);})[_0x8d23('0x1e')](function(){return _0x29e2f2;});})['then'](respondWithResult(_0xf6c6a1,0xc9))[_0x8d23('0x42')](handleError(_0xf6c6a1,null));}; \ No newline at end of file +var _0xdef9=['where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','destroy','sequelize','create','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','end','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5f04b9,_0x304165){var _0x1bf927=function(_0x159ac3){while(--_0x159ac3){_0x5f04b9['push'](_0x5f04b9['shift']());}};_0x1bf927(++_0x304165);}(_0xdef9,0x1ed));var _0x9def=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xdef9[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require(_0x9def('0x0'));var rimraf=require(_0x9def('0x1'));var zipdir=require(_0x9def('0x2'));var jsonpatch=require(_0x9def('0x3'));var rp=require(_0x9def('0x4'));var moment=require(_0x9def('0x5'));var BPromise=require(_0x9def('0x6'));var Mustache=require(_0x9def('0x7'));var util=require(_0x9def('0x8'));var path=require(_0x9def('0x9'));var sox=require(_0x9def('0xa'));var csv=require(_0x9def('0xb'));var ejs=require(_0x9def('0xc'));var fs=require('fs');var fs_extra=require(_0x9def('0xd'));var _=require(_0x9def('0xe'));var squel=require(_0x9def('0xf'));var crypto=require(_0x9def('0x10'));var jsforce=require(_0x9def('0x11'));var deskjs=require(_0x9def('0x12'));var toCsv=require('to-csv');var querystring=require(_0x9def('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9def('0x14'));var qs=require(_0x9def('0x15'));var as=require(_0x9def('0x16'));var hardwareService=require(_0x9def('0x17'));var logger=require('../../config/logger')(_0x9def('0x18'));var utils=require(_0x9def('0x19'));var config=require(_0x9def('0x1a'));var licenseUtil=require(_0x9def('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20cd44,_0x1f908f){_0x1f908f=_0x1f908f||0xcc;return function(_0x550be5){if(_0x550be5){return _0x20cd44[_0x9def('0x1c')](_0x1f908f);}return _0x20cd44['status'](_0x1f908f)['end']();};}function respondWithResult(_0x30c751,_0x2fd956){_0x2fd956=_0x2fd956||0xc8;return function(_0x4649dd){if(_0x4649dd){return _0x30c751['status'](_0x2fd956)[_0x9def('0x1d')](_0x4649dd);}};}function respondWithFilteredResult(_0x5ea825,_0x4c4ea4){return function(_0x2d3604){if(_0x2d3604){var _0x29dce4=typeof _0x4c4ea4[_0x9def('0x1e')]===_0x9def('0x1f')&&typeof _0x4c4ea4[_0x9def('0x20')]===_0x9def('0x1f');var _0x162e7e=_0x2d3604[_0x9def('0x21')];var _0x2d3f63=_0x29dce4?0x0:_0x4c4ea4[_0x9def('0x1e')];var _0x5294fe=_0x29dce4?_0x2d3604[_0x9def('0x21')]:_0x4c4ea4[_0x9def('0x1e')]+_0x4c4ea4['limit'];var _0x47150a;if(_0x5294fe>=_0x162e7e){_0x5294fe=_0x162e7e;_0x47150a=0xc8;}else{_0x47150a=0xce;}_0x5ea825[_0x9def('0x22')](_0x47150a);return _0x5ea825['set'](_0x9def('0x23'),_0x2d3f63+'-'+_0x5294fe+'/'+_0x162e7e)['json'](_0x2d3604);}return null;};}function patchUpdates(_0x2edbb2){return function(_0x4a6504){try{jsonpatch[_0x9def('0x24')](_0x4a6504,_0x2edbb2,!![]);}catch(_0x354f14){return BPromise['reject'](_0x354f14);}return _0x4a6504[_0x9def('0x25')]();};}function saveUpdates(_0x1f4399,_0x400fed){return function(_0x5a99ab){if(_0x5a99ab){return _0x5a99ab[_0x9def('0x26')](_0x1f4399)['then'](function(_0x4366de){return _0x4366de;});}return null;};}function removeEntity(_0x1053a7,_0x3bd31d){return function(_0x2e61e8){if(_0x2e61e8){return _0x2e61e8['destroy']()[_0x9def('0x27')](function(){_0x1053a7['status'](0xcc)[_0x9def('0x28')]();});}};}function handleEntityNotFound(_0x19b4ea,_0x5f2846){return function(_0x273779){if(!_0x273779){_0x19b4ea[_0x9def('0x1c')](0x194);}return _0x273779;};}function handleError(_0x3e20e5,_0x5aa701){_0x5aa701=_0x5aa701||0x1f4;return function(_0x4e7d84){logger[_0x9def('0x29')](_0x4e7d84[_0x9def('0x2a')]);if(_0x4e7d84[_0x9def('0x2b')]){delete _0x4e7d84[_0x9def('0x2b')];}_0x3e20e5['status'](_0x5aa701)[_0x9def('0x2c')](_0x4e7d84);};}exports[_0x9def('0x2d')]=function(_0x1aa212,_0x45cf95){var _0x54d532={},_0x51750e={},_0xa59cef={'count':0x0,'rows':[]};var _0x22d1d2=_['map'](db[_0x9def('0x2e')][_0x9def('0x2f')],function(_0x4ba5f8){return{'name':_0x4ba5f8[_0x9def('0x30')],'type':_0x4ba5f8[_0x9def('0x31')][_0x9def('0x32')]};});_0x51750e[_0x9def('0x33')]=_[_0x9def('0x34')](_[_0x9def('0x35')](_0x22d1d2,'name'),[_0x9def('0x2b')]);_0x51750e['query']=_[_0x9def('0x36')](_0x1aa212[_0x9def('0x37')]);_0x51750e[_0x9def('0x38')]=_[_0x9def('0x39')](_0x51750e[_0x9def('0x33')],_0x51750e['query']);_0x54d532[_0x9def('0x3a')]=_[_0x9def('0x39')](_0x51750e[_0x9def('0x33')],qs[_0x9def('0x3b')](_0x1aa212['query'][_0x9def('0x3b')]));_0x54d532[_0x9def('0x3a')]=_0x54d532[_0x9def('0x3a')][_0x9def('0x3c')]?_0x54d532[_0x9def('0x3a')]:_0x51750e[_0x9def('0x33')];if(!_0x1aa212[_0x9def('0x37')][_0x9def('0x3d')](_0x9def('0x3e'))){_0x54d532[_0x9def('0x20')]=qs[_0x9def('0x20')](_0x1aa212[_0x9def('0x37')][_0x9def('0x20')]);_0x54d532['offset']=qs[_0x9def('0x1e')](_0x1aa212[_0x9def('0x37')][_0x9def('0x1e')]);}_0x54d532[_0x9def('0x3f')]=qs[_0x9def('0x40')](_0x1aa212[_0x9def('0x37')]['sort']);_0x54d532[_0x9def('0x41')]=qs[_0x9def('0x38')](_['pick'](_0x1aa212['query'],_0x51750e['filters']),_0x22d1d2);if(_0x1aa212[_0x9def('0x37')][_0x9def('0x42')]){_0x54d532[_0x9def('0x41')]=_[_0x9def('0x43')](_0x54d532[_0x9def('0x41')],{'$or':_[_0x9def('0x35')](_0x22d1d2,function(_0x59ee04){if(_0x59ee04[_0x9def('0x31')]!=='VIRTUAL'){var _0xb1d1c6={};_0xb1d1c6[_0x59ee04[_0x9def('0x2b')]]={'$like':'%'+_0x1aa212[_0x9def('0x37')][_0x9def('0x42')]+'%'};return _0xb1d1c6;}})});}_0x54d532=_[_0x9def('0x43')]({},_0x54d532,_0x1aa212['options']);var _0x5e761b={'where':_0x54d532['where']};return db['CmCustomField']['count'](_0x5e761b)[_0x9def('0x27')](function(_0x526802){_0xa59cef[_0x9def('0x21')]=_0x526802;if(_0x1aa212[_0x9def('0x37')][_0x9def('0x44')]){_0x54d532[_0x9def('0x45')]=[{'all':!![]}];}return db[_0x9def('0x2e')][_0x9def('0x46')](_0x54d532);})[_0x9def('0x27')](function(_0x1a967b){_0xa59cef[_0x9def('0x47')]=_0x1a967b;return _0xa59cef;})[_0x9def('0x27')](respondWithFilteredResult(_0x45cf95,_0x54d532))[_0x9def('0x48')](handleError(_0x45cf95,null));};exports[_0x9def('0x49')]=function(_0x16836f,_0x44ced8){var _0xc03cb2={'raw':!![],'where':{'id':_0x16836f[_0x9def('0x4a')]['id']}},_0x760f1b={};_0x760f1b[_0x9def('0x33')]=_[_0x9def('0x36')](db[_0x9def('0x2e')][_0x9def('0x2f')]);_0x760f1b[_0x9def('0x37')]=_[_0x9def('0x36')](_0x16836f[_0x9def('0x37')]);_0x760f1b[_0x9def('0x38')]=_['intersection'](_0x760f1b[_0x9def('0x33')],_0x760f1b[_0x9def('0x37')]);_0xc03cb2[_0x9def('0x3a')]=_[_0x9def('0x39')](_0x760f1b[_0x9def('0x33')],qs[_0x9def('0x3b')](_0x16836f[_0x9def('0x37')][_0x9def('0x3b')]));_0xc03cb2[_0x9def('0x3a')]=_0xc03cb2['attributes'][_0x9def('0x3c')]?_0xc03cb2[_0x9def('0x3a')]:_0x760f1b[_0x9def('0x33')];if(_0x16836f[_0x9def('0x37')]['includeAll']){_0xc03cb2['include']=[{'all':!![]}];}_0xc03cb2=_[_0x9def('0x43')]({},_0xc03cb2,_0x16836f[_0x9def('0x4b')]);return db['CmCustomField'][_0x9def('0x4c')](_0xc03cb2)[_0x9def('0x27')](handleEntityNotFound(_0x44ced8,null))['then'](respondWithResult(_0x44ced8,null))['catch'](handleError(_0x44ced8,null));};exports[_0x9def('0x26')]=function(_0x3fba87,_0x1f45e9){if(_0x3fba87[_0x9def('0x4d')]['id']){delete _0x3fba87[_0x9def('0x4d')]['id'];}return db[_0x9def('0x2e')][_0x9def('0x4c')]({'where':{'id':_0x3fba87[_0x9def('0x4a')]['id']}})[_0x9def('0x27')](handleEntityNotFound(_0x1f45e9,null))[_0x9def('0x27')](saveUpdates(_0x3fba87[_0x9def('0x4d')],null))['then'](respondWithResult(_0x1f45e9,null))[_0x9def('0x48')](handleError(_0x1f45e9,null));};exports[_0x9def('0x4e')]=function(_0x313b53,_0x539eba){return db['CmCustomField'][_0x9def('0x4c')]({'where':{'id':_0x313b53[_0x9def('0x4a')]['id']}})[_0x9def('0x27')](handleEntityNotFound(_0x539eba,null))[_0x9def('0x27')](removeEntity(_0x539eba,null))['catch'](handleError(_0x539eba,null));};exports['create']=function(_0x3c5e7a,_0xd9b8c8){var _0xaa0e17;return db[_0x9def('0x4f')]['transaction'](function(_0x98ffd0){return db[_0x9def('0x2e')][_0x9def('0x50')](_0x3c5e7a[_0x9def('0x4d')],{'transaction':_0x98ffd0})[_0x9def('0x27')](function(_0x465911){_0xaa0e17=_0x465911;var _0x5eb25a={'type':db[_0x9def('0x51')][_0x9def('0x52')],'transaction':_0x98ffd0};switch(_0x3c5e7a[_0x9def('0x4d')]['type']){case _0x9def('0x53'):_0x5eb25a['type']=db[_0x9def('0x51')]['TEXT'];break;case _0x9def('0x54'):_0x5eb25a[_0x9def('0x31')]=db[_0x9def('0x51')][_0x9def('0x55')];break;case _0x9def('0x56'):_0x5eb25a[_0x9def('0x31')]=db[_0x9def('0x51')][_0x9def('0x57')];_0x5eb25a[_0x9def('0x58')]=![];break;default:}return db[_0x9def('0x4f')]['queryInterface'][_0x9def('0x59')](_0x9def('0x5a'),util[_0x9def('0x5b')](_0x9def('0x5c'),_0xaa0e17['id']),_0x5eb25a);})[_0x9def('0x27')](function(){return _0xaa0e17;});})[_0x9def('0x27')](respondWithResult(_0xd9b8c8,0xc9))[_0x9def('0x48')](handleError(_0xd9b8c8,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 26d272a..8212100 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 _0x5c29=['cm_custom_fields','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x112c70,_0x3e8b92){var _0xeb86df=function(_0x4df91d){while(--_0x4df91d){_0x112c70['push'](_0x112c70['shift']());}};_0xeb86df(++_0x3e8b92);}(_0x5c29,0xa9));var _0x95c2=function(_0xd12a36,_0x19a43c){_0xd12a36=_0xd12a36-0x0;var _0x3521f1=_0x5c29[_0xd12a36];return _0x3521f1;};'use strict';var _=require('lodash');var util=require(_0x95c2('0x0'));var logger=require(_0x95c2('0x1'))(_0x95c2('0x2'));var moment=require('moment');var BPromise=require(_0x95c2('0x3'));var rp=require(_0x95c2('0x4'));var fs=require('fs');var path=require(_0x95c2('0x5'));var rimraf=require('rimraf');var config=require(_0x95c2('0x6'));var attributes=require(_0x95c2('0x7'));module[_0x95c2('0x8')]=function(_0x4df75f,_0x5f03d8){return _0x4df75f[_0x95c2('0x9')](_0x95c2('0xa'),attributes,{'tableName':_0x95c2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccb1=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash'];(function(_0x36bf46,_0x3d8db9){var _0x1d0a72=function(_0x328e8d){while(--_0x328e8d){_0x36bf46['push'](_0x36bf46['shift']());}};_0x1d0a72(++_0x3d8db9);}(_0xccb1,0x1af));var _0x1ccb=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xccb1[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x1ccb('0x0'));var util=require(_0x1ccb('0x1'));var logger=require(_0x1ccb('0x2'))(_0x1ccb('0x3'));var moment=require(_0x1ccb('0x4'));var BPromise=require(_0x1ccb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1ccb('0x6'));var config=require(_0x1ccb('0x7'));var attributes=require(_0x1ccb('0x8'));module[_0x1ccb('0x9')]=function(_0xec70d,_0x1d70d3){return _0xec70d[_0x1ccb('0xa')]('CmCustomField',attributes,{'tableName':_0x1ccb('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 9a8c726..6c203a0 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 _0x6365=['rpc','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xd1c5eb,_0x2f1b73){var _0x1bb245=function(_0x1c7a88){while(--_0x1c7a88){_0xd1c5eb['push'](_0xd1c5eb['shift']());}};_0x1bb245(++_0x2f1b73);}(_0x6365,0x148));var _0x5636=function(_0x135b6f,_0x4b9cfe){_0x135b6f=_0x135b6f-0x0;var _0x471a9b=_0x6365[_0x135b6f];return _0x471a9b;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var moment=require(_0x5636('0x2'));var BPromise=require(_0x5636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5636('0x4'));var db=require(_0x5636('0x5'))['db'];var utils=require(_0x5636('0x6'));var logger=require(_0x5636('0x7'))(_0x5636('0x8'));var config=require('../../config/environment');var jayson=require(_0x5636('0x9'));var client=jayson[_0x5636('0xa')][_0x5636('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3575b7,_0x53d5b4,_0x17439f){return new BPromise(function(_0x10769f,_0x54eb5c){return client['request'](_0x3575b7,_0x17439f)[_0x5636('0xc')](function(_0x43e880){logger[_0x5636('0xd')](_0x5636('0xe'),_0x53d5b4,'request\x20sent');logger['debug'](_0x5636('0xf'),_0x53d5b4,'request\x20sent',JSON[_0x5636('0x10')](_0x43e880));if(_0x43e880[_0x5636('0x11')]){if(_0x43e880[_0x5636('0x11')][_0x5636('0x12')]===0x1f4){logger[_0x5636('0x11')](_0x5636('0xe'),_0x53d5b4,_0x43e880['error'][_0x5636('0x13')]);return _0x54eb5c(_0x43e880[_0x5636('0x11')]['message']);}logger[_0x5636('0x11')](_0x5636('0xe'),_0x53d5b4,_0x43e880['error']['message']);return _0x10769f(_0x43e880[_0x5636('0x11')][_0x5636('0x13')]);}else{logger[_0x5636('0xd')](_0x5636('0xe'),_0x53d5b4,_0x5636('0x14'));_0x10769f(_0x43e880['result'][_0x5636('0x13')]);}})['catch'](function(_0x55de40){logger[_0x5636('0x11')](_0x5636('0xe'),_0x53d5b4,_0x55de40);_0x54eb5c(_0x55de40);});});} \ No newline at end of file +var _0xef2a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x13f439,_0x39fbf7){var _0x171967=function(_0x521a1e){while(--_0x521a1e){_0x13f439['push'](_0x13f439['shift']());}};_0x171967(++_0x39fbf7);}(_0xef2a,0xf9));var _0xaef2=function(_0x4e0550,_0x2fe807){_0x4e0550=_0x4e0550-0x0;var _0xc9efae=_0xef2a[_0x4e0550];return _0xc9efae;};'use strict';var _=require(_0xaef2('0x0'));var util=require(_0xaef2('0x1'));var moment=require('moment');var BPromise=require(_0xaef2('0x2'));var rs=require(_0xaef2('0x3'));var fs=require('fs');var Redis=require(_0xaef2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaef2('0x5'));var logger=require(_0xaef2('0x6'))(_0xaef2('0x7'));var config=require(_0xaef2('0x8'));var jayson=require(_0xaef2('0x9'));var client=jayson[_0xaef2('0xa')][_0xaef2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1933f8,_0x594d55,_0x119810){return new BPromise(function(_0x496854,_0x546b5c){return client[_0xaef2('0xc')](_0x1933f8,_0x119810)['then'](function(_0x41e996){logger[_0xaef2('0xd')](_0xaef2('0xe'),_0x594d55,'request\x20sent');logger[_0xaef2('0xf')](_0xaef2('0x10'),_0x594d55,_0xaef2('0x11'),JSON['stringify'](_0x41e996));if(_0x41e996[_0xaef2('0x12')]){if(_0x41e996[_0xaef2('0x12')][_0xaef2('0x13')]===0x1f4){logger[_0xaef2('0x12')](_0xaef2('0xe'),_0x594d55,_0x41e996[_0xaef2('0x12')][_0xaef2('0x14')]);return _0x546b5c(_0x41e996[_0xaef2('0x12')]['message']);}logger[_0xaef2('0x12')](_0xaef2('0xe'),_0x594d55,_0x41e996[_0xaef2('0x12')][_0xaef2('0x14')]);return _0x496854(_0x41e996['error'][_0xaef2('0x14')]);}else{logger[_0xaef2('0xd')]('CmCustomField,\x20%s,\x20%s',_0x594d55,_0xaef2('0x11'));_0x496854(_0x41e996[_0xaef2('0x15')]['message']);}})[_0xaef2('0x16')](function(_0x1af161){logger[_0xaef2('0x12')](_0xaef2('0xe'),_0x594d55,_0x1af161);_0x546b5c(_0x1af161);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 934f9f5..fe44c78 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 _0xa13d=['update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','post','create','put'];(function(_0x28bcd9,_0x833481){var _0x20069f=function(_0x2fcaf6){while(--_0x2fcaf6){_0x28bcd9['push'](_0x28bcd9['shift']());}};_0x20069f(++_0x833481);}(_0xa13d,0x154));var _0xda13=function(_0x2351d0,_0x49cbf9){_0x2351d0=_0x2351d0-0x0;var _0x482695=_0xa13d[_0x2351d0];return _0x482695;};'use strict';var multer=require(_0xda13('0x0'));var util=require('util');var path=require(_0xda13('0x1'));var timeout=require(_0xda13('0x2'));var express=require('express');var router=express[_0xda13('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda13('0x4'));var interaction=require(_0xda13('0x5'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xda13('0x6')]('/',auth[_0xda13('0x7')](),controller['index']);router[_0xda13('0x6')](_0xda13('0x8'),auth[_0xda13('0x7')](),controller['show']);router[_0xda13('0x9')]('/',auth[_0xda13('0x7')](),controller[_0xda13('0xa')]);router[_0xda13('0xb')](_0xda13('0x8'),auth[_0xda13('0x7')](),controller[_0xda13('0xc')]);router[_0xda13('0xd')](_0xda13('0x8'),auth[_0xda13('0x7')](),controller[_0xda13('0xe')]);module[_0xda13('0xf')]=router; \ No newline at end of file +var _0xb0df=['/:id','create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3364fc,_0x559233){var _0x10df36=function(_0x28d38d){while(--_0x28d38d){_0x3364fc['push'](_0x3364fc['shift']());}};_0x10df36(++_0x559233);}(_0xb0df,0x85));var _0xfb0d=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0xb0df[_0xe4bb3d];return _0xd9e51;};'use strict';var multer=require('multer');var util=require(_0xfb0d('0x0'));var path=require(_0xfb0d('0x1'));var timeout=require(_0xfb0d('0x2'));var express=require(_0xfb0d('0x3'));var router=express[_0xfb0d('0x4')]();var fs_extra=require(_0xfb0d('0x5'));var auth=require(_0xfb0d('0x6'));var interaction=require(_0xfb0d('0x7'));var config=require(_0xfb0d('0x8'));var controller=require('./cmCustomField.controller');router[_0xfb0d('0x9')]('/',auth[_0xfb0d('0xa')](),controller['index']);router['get'](_0xfb0d('0xb'),auth[_0xfb0d('0xa')](),controller['show']);router['post']('/',auth[_0xfb0d('0xa')](),controller[_0xfb0d('0xc')]);router['put'](_0xfb0d('0xb'),auth[_0xfb0d('0xa')](),controller[_0xfb0d('0xd')]);router[_0xfb0d('0xe')](_0xfb0d('0xb'),auth[_0xfb0d('0xa')](),controller['destroy']);module[_0xfb0d('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8443354..3fcce34 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 _0x9b68=['INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','exports','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9b68,0xca));var _0x89b6=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x9b68[_0x29e2af];return _0x1ea06a;};'use strict';var moment=require(_0x89b6('0x0'));var Sequelize=require('sequelize');module[_0x89b6('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x89b6('0x2')],'defaultValue':moment()[_0x89b6('0x3')](_0x89b6('0x4'))},'countbusyretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x89b6('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x89b6('0x5')](0x2)[_0x89b6('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x89b6('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x89b6('0x5')],'unique':_0x89b6('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x89b6('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x89b6('0x8')},'CampaignId':{'type':Sequelize[_0x89b6('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x89b6('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x89b6('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x89b6('0x2')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x5960=['INTEGER','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x312155,_0x33f792){var _0xfc75a6=function(_0xde17b5){while(--_0xde17b5){_0x312155['push'](_0x312155['shift']());}};_0xfc75a6(++_0x33f792);}(_0x5960,0x134));var _0x0596=function(_0x2888e1,_0x3b5424){_0x2888e1=_0x2888e1-0x0;var _0x464cd1=_0x5960[_0x2888e1];return _0x464cd1;};'use strict';var moment=require(_0x0596('0x0'));var Sequelize=require(_0x0596('0x1'));module[_0x0596('0x2')]={'phone':{'type':Sequelize[_0x0596('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x0596('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0596('0x5')],'defaultValue':moment()[_0x0596('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0596('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0596('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0596('0x5')]},'priority':{'type':Sequelize[_0x0596('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0596('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0596('0x7')],'unique':_0x0596('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x0596('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x0596('0x7')],'unique':_0x0596('0x8')},'CampaignId':{'type':Sequelize[_0x0596('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0596('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'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 b835106..067a033 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 _0xaa7c=['$lte','$ne','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contained','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmList','List','dialActive','CmCompany','Company','isNumber','getOpenContacts','entity\x20not\x20found','sendStatus','timezones','getTimezone','moment','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','update','then','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','intersection','concat','$and','$or','$gte','$lt'];(function(_0x5c355e,_0x3c7cf9){var _0x42f7ed=function(_0x339894){while(--_0x339894){_0x5c355e['push'](_0x5c355e['shift']());}};_0x42f7ed(++_0x3c7cf9);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x39ef5d,_0x2f5658){_0x39ef5d=_0x39ef5d-0x0;var _0x5ca9cf=_0xaa7c[_0x39ef5d];return _0x5ca9cf;};'use strict';var moment=require(_0xcaa7('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require(_0xcaa7('0x1'));var db=require(_0xcaa7('0x2'))['db'];function respondWithResult(_0x4f837e,_0xd4ca36){_0xd4ca36=_0xd4ca36||0xc8;return function(_0xc85ba0){if(_0xc85ba0){return _0x4f837e[_0xcaa7('0x3')](_0xd4ca36)[_0xcaa7('0x4')](_0xc85ba0);}};}function respondWithFilteredResult(_0x27e610,_0x5a3674){return function(_0x4b9df0){if(_0x4b9df0){var _0x5bd940=typeof _0x5a3674['offset']===_0xcaa7('0x5')&&typeof _0x5a3674[_0xcaa7('0x6')]===_0xcaa7('0x5');var _0x5d2ca8=_0x4b9df0[_0xcaa7('0x7')];var _0x1de70a=_0x5bd940?0x0:_0x5a3674[_0xcaa7('0x8')];var _0x38a42d=_0x5bd940?_0x4b9df0[_0xcaa7('0x7')]:_0x5a3674['offset']+_0x5a3674[_0xcaa7('0x6')];var _0x39d53a;if(_0x38a42d>=_0x5d2ca8){_0x38a42d=_0x5d2ca8;_0x39d53a=0xc8;}else{_0x39d53a=0xce;}_0x27e610[_0xcaa7('0x3')](_0x39d53a);return _0x27e610[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x1de70a+'-'+_0x38a42d+'/'+_0x5d2ca8)[_0xcaa7('0x4')](_0x4b9df0);}return null;};}function saveUpdates(_0x563f57,_0x24d3b0){return function(_0x128cfb){if(_0x128cfb){return _0x128cfb[_0xcaa7('0xb')](_0x563f57)[_0xcaa7('0xc')](function(_0x2bbc71){return _0x2bbc71;});}return null;};}function handleEntityNotFound(_0x2eb4ff,_0x299490){return function(_0x4a1d5a){if(!_0x4a1d5a){_0x2eb4ff['sendStatus'](0x194);}return _0x4a1d5a;};}function handleError(_0x314b7c,_0x1c1286){_0x1c1286=_0x1c1286||0x1f4;return function(_0x1155fb){logger[_0xcaa7('0xd')](_0x1155fb['stack']);if(_0x1155fb[_0xcaa7('0xe')]){delete _0x1155fb[_0xcaa7('0xe')];}_0x314b7c[_0xcaa7('0x3')](_0x1c1286)[_0xcaa7('0xf')](_0x1155fb);};}exports[_0xcaa7('0x10')]=function(_0xc46e37,_0x20ede0){var _0x5c2a74={},_0x53e1cb={},_0x4309e0={'count':0x0,'rows':[]};var _0x4491d1=_[_0xcaa7('0x11')](db[_0xcaa7('0x12')][_0xcaa7('0x13')],function(_0x2a0416){return{'name':_0x2a0416[_0xcaa7('0x14')],'type':_0x2a0416['type'][_0xcaa7('0x15')]};});_0x53e1cb[_0xcaa7('0x16')]=_[_0xcaa7('0x11')](_0x4491d1,_0xcaa7('0xe'));_0x53e1cb[_0xcaa7('0x17')]=_[_0xcaa7('0x18')](_0xc46e37[_0xcaa7('0x17')]);_0x53e1cb[_0xcaa7('0x19')]=_[_0xcaa7('0x1a')](_0x53e1cb[_0xcaa7('0x16')],_0x53e1cb[_0xcaa7('0x17')]);_0x53e1cb[_0xcaa7('0x19')]=_[_0xcaa7('0x1b')](_0x53e1cb['filters'],[_0xcaa7('0x1c'),_0xcaa7('0x1d'),'$gt',_0xcaa7('0x1e'),_0xcaa7('0x1f'),_0xcaa7('0x20'),_0xcaa7('0x21'),'$eq','$not',_0xcaa7('0x22'),_0xcaa7('0x23'),_0xcaa7('0x24'),_0xcaa7('0x25'),_0xcaa7('0x26'),'$notLike',_0xcaa7('0x27'),'$notILike','$like',_0xcaa7('0x28'),'$contains',_0xcaa7('0x29'),_0xcaa7('0x2a')]);_0x5c2a74[_0xcaa7('0x2b')]=_[_0xcaa7('0x1a')](_0x53e1cb[_0xcaa7('0x16')],qs[_0xcaa7('0x2c')](_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x2c')]));_0x5c2a74['attributes']=_0x5c2a74[_0xcaa7('0x2b')][_0xcaa7('0x2d')]?_0x5c2a74[_0xcaa7('0x2b')]:_0x53e1cb[_0xcaa7('0x16')];if(!_0xc46e37[_0xcaa7('0x17')]['hasOwnProperty'](_0xcaa7('0x2e'))){_0x5c2a74[_0xcaa7('0x6')]=qs[_0xcaa7('0x6')](_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x6')]);_0x5c2a74['offset']=qs[_0xcaa7('0x8')](_0xc46e37['query'][_0xcaa7('0x8')]);}_0x5c2a74[_0xcaa7('0x2f')]=qs[_0xcaa7('0x30')](_0xc46e37['query'][_0xcaa7('0x30')]);_0x5c2a74[_0xcaa7('0x31')]=qs[_0xcaa7('0x19')](_[_0xcaa7('0x32')](_0xc46e37[_0xcaa7('0x17')],_0x53e1cb[_0xcaa7('0x19')]),_0x4491d1);if(_0xc46e37['query'][_0xcaa7('0x33')]){_0x5c2a74[_0xcaa7('0x31')]=_['merge'](_0x5c2a74[_0xcaa7('0x31')],{'$or':_[_0xcaa7('0x11')](_0x4491d1,function(_0x444add){if(_0x444add[_0xcaa7('0x34')]!=='VIRTUAL'){var _0x16af20={};_0x16af20[_0x444add[_0xcaa7('0xe')]]={'$like':'%'+_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x33')]+'%'};return _0x16af20;}})});}_0x5c2a74=_[_0xcaa7('0x35')]({},_0x5c2a74,_0xc46e37[_0xcaa7('0x36')]);var _0xcb5439={'where':_0x5c2a74[_0xcaa7('0x31')]};return db[_0xcaa7('0x12')][_0xcaa7('0x7')](_0xcb5439)[_0xcaa7('0xc')](function(_0x266d5f){_0x4309e0['count']=_0x266d5f;if(_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x37')]){_0x5c2a74[_0xcaa7('0x38')]=[{'all':!![]}];}return db[_0xcaa7('0x12')][_0xcaa7('0x39')](_0x5c2a74);})['then'](function(_0x3d3c13){_0x4309e0[_0xcaa7('0x3a')]=_0x3d3c13;return _0x4309e0;})[_0xcaa7('0xc')](respondWithFilteredResult(_0x20ede0,_0x5c2a74))['catch'](handleError(_0x20ede0,null));};exports[_0xcaa7('0x3b')]=function(_0x3016f1,_0x320b46){var _0x1138a6={'raw':!![],'where':{'id':_0x3016f1[_0xcaa7('0x3c')]['id']}},_0x569c5f={};_0x569c5f['model']=_[_0xcaa7('0x18')](db['CmHopper'][_0xcaa7('0x13')]);_0x569c5f['query']=_['keys'](_0x3016f1[_0xcaa7('0x17')]);_0x569c5f[_0xcaa7('0x19')]=_['intersection'](_0x569c5f[_0xcaa7('0x16')],_0x569c5f[_0xcaa7('0x17')]);_0x1138a6[_0xcaa7('0x2b')]=_[_0xcaa7('0x1a')](_0x569c5f[_0xcaa7('0x16')],qs[_0xcaa7('0x2c')](_0x3016f1[_0xcaa7('0x17')][_0xcaa7('0x2c')]));_0x1138a6['attributes']=_0x1138a6[_0xcaa7('0x2b')][_0xcaa7('0x2d')]?_0x1138a6[_0xcaa7('0x2b')]:_0x569c5f[_0xcaa7('0x16')];if(_0x3016f1[_0xcaa7('0x17')][_0xcaa7('0x37')]){_0x1138a6['include']=[{'all':!![]}];}_0x1138a6=_[_0xcaa7('0x35')]({},_0x1138a6,_0x3016f1[_0xcaa7('0x36')]);return db[_0xcaa7('0x12')][_0xcaa7('0x3d')](_0x1138a6)[_0xcaa7('0xc')](handleEntityNotFound(_0x320b46,null))['then'](respondWithResult(_0x320b46,null))[_0xcaa7('0x3e')](handleError(_0x320b46,null));};exports[_0xcaa7('0x3f')]=function(_0x33c748,_0x490b0d){return db[_0xcaa7('0x12')]['create'](_0x33c748[_0xcaa7('0x40')],{})[_0xcaa7('0xc')](respondWithResult(_0x490b0d,0xc9))[_0xcaa7('0x3e')](handleError(_0x490b0d,null));};exports[_0xcaa7('0xb')]=function(_0x94e72d,_0x208495){if(_0x94e72d[_0xcaa7('0x40')]['id']){delete _0x94e72d['body']['id'];}return db['CmHopper'][_0xcaa7('0x3d')]({'where':{'id':_0x94e72d['params']['id']}})[_0xcaa7('0xc')](handleEntityNotFound(_0x208495,null))['then'](saveUpdates(_0x94e72d[_0xcaa7('0x40')],null))['then'](respondWithResult(_0x208495,null))[_0xcaa7('0x3e')](handleError(_0x208495,null));};exports[_0xcaa7('0x41')]=function(_0x1304a1,_0x32ec2d){return db[_0xcaa7('0x12')][_0xcaa7('0x41')]()['then'](respondWithResult(_0x32ec2d,null))['catch'](handleError(_0x32ec2d,null));};exports[_0xcaa7('0x42')]=function(_0x3a5f1f,_0x4f162c){var _0x417aaa;var _0x8a94a8=_0x3a5f1f[_0xcaa7('0x3c')]['id'];return db[_0xcaa7('0x12')][_0xcaa7('0x3d')]({'where':{'id':_0x3a5f1f[_0xcaa7('0x3c')]['id']}})[_0xcaa7('0xc')](handleEntityNotFound(_0x4f162c,null))[_0xcaa7('0xc')](function(_0x30d75c){if(_0x30d75c){return _0x30d75c[_0xcaa7('0x42')]()[_0xcaa7('0xc')](function(_0x3cc7ae){return _0x3cc7ae;});}})[_0xcaa7('0xc')](function(_0x3e77a9){_0x417aaa=_0x3e77a9;if(_0x3e77a9){if(_0x3e77a9[_0xcaa7('0x43')]||_0x3e77a9[_0xcaa7('0x44')]){return db[_0x3e77a9['VoiceQueueId']?_0xcaa7('0x45'):'Campaign'][_0xcaa7('0x3d')]({'where':{'id':_0x3e77a9[_0xcaa7('0x43')]?_0x3e77a9[_0xcaa7('0x43')]:_0x3e77a9[_0xcaa7('0x44')]},'attributes':['id',_0xcaa7('0xe')],'raw':!![]});}}})[_0xcaa7('0xc')](function(_0x1a2e55){var _0x2a263e={};if(_0x1a2e55){_[_0xcaa7('0x35')](_0x2a263e,_[_0xcaa7('0x46')](_0x417aaa[_0xcaa7('0x47')],['createdAt',_0xcaa7('0x48'),'id']));_0x2a263e[_0xcaa7('0x49')]=0x15;_0x2a263e[_0xcaa7('0x4a')]='deleted';_0x2a263e[_0xcaa7('0x4b')]=_0x1a2e55['name'];_0x2a263e[_0xcaa7('0x4c')]=_0x3a5f1f[_0xcaa7('0x4d')][_0xcaa7('0xe')];_0x2a263e[_0xcaa7('0x4e')]=_0x3a5f1f['user']['id'];_0x2a263e[_0xcaa7('0x4f')]=!![];_0x2a263e[_0xcaa7('0x50')]=moment()[_0xcaa7('0x51')](_0xcaa7('0x52'));_0x2a263e[_0xcaa7('0x53')]=_0x417aaa[_0xcaa7('0x54')];_0x2a263e[_0xcaa7('0x55')]=_0x417aaa[_0xcaa7('0x43')]?'queue':_0xcaa7('0x56');return db[_0xcaa7('0x57')][_0xcaa7('0x3d')]({'where':{'id':_0x2a263e[_0xcaa7('0x58')]},'attributes':[_0xcaa7('0x59'),_0xcaa7('0x5a')]})['then'](function(_0xcf623b){if(!_[_0xcaa7('0x5b')](_0x4f162c)&&!_['isNil'](_0xcf623b[_0xcaa7('0x59')])){_0x2a263e[_0xcaa7('0x5c')]=_0xcf623b[_0xcaa7('0x59')];if(!_['isNil'](_0xcf623b[_0xcaa7('0x5a')])){_0x2a263e[_0xcaa7('0x5c')]+='\x20'+_0xcf623b['lastName'];}}})[_0xcaa7('0x5d')](function(){return db[_0xcaa7('0x5e')][_0xcaa7('0x3f')](_0x2a263e);});}})[_0xcaa7('0xc')](function(_0xa6be83){return db[_0xcaa7('0x5f')][_0xcaa7('0x42')]({'where':{'CmHopperId':_0x8a94a8}});})[_0xcaa7('0xc')](function(){return _0x4f162c[_0xcaa7('0x3')](0xcc)[_0xcaa7('0x60')]();})[_0xcaa7('0x3e')](handleError(_0x4f162c,null));};exports[_0xcaa7('0x61')]=function(_0x3a6793,_0x1b494a){var _0x2c2df3=[];return db[_0xcaa7('0x57')][_0xcaa7('0x41')]()[_0xcaa7('0xc')](function(_0x596c65){_0x2c2df3=_[_0xcaa7('0x18')](_0x596c65);return _0x3a6793['user'][_0xcaa7('0x62')]({'where':{'type':_0xcaa7('0x63'),'dialActive':!![],'dialMethod':_0xcaa7('0x64')},'attributes':['id','dialOrderByScheduledAt',_0xcaa7('0x65')],'raw':!![]});})[_0xcaa7('0xc')](function(_0x1cf62d){if(_0x1cf62d&&_0x1cf62d[_0xcaa7('0x2d')]){return db[_0xcaa7('0x66')][_0xcaa7('0x67')](function(_0x322423){var _0x188480={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcaa7('0x51')](_0xcaa7('0x52'))},'VoiceQueueId':{'$in':_['map'](_0x1cf62d,'id')},'$or':[{'UserId':null},{'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']}]};var _0x22a605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1cf62d)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xcaa7('0x11')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']}]};var _0x53c13c={'$or':[_0x188480,_0x22a605]};var _0x3dfb2d=[];if(_0x3a6793['body'][_0xcaa7('0x68')]&&_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x68')]===_0xcaa7('0x69')){if(!_[_0xcaa7('0x6a')](_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')])){_0x53c13c['id']={'$in':_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')]};}_0x3dfb2d=[[_0xcaa7('0x6c'),'ASC'],[_0xcaa7('0x6d'),_0x1cf62d[0x0][_0xcaa7('0x6e')]===_0xcaa7('0x6f')?_0xcaa7('0x70'):_0xcaa7('0x6f')],db[_0xcaa7('0x66')][_0xcaa7('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xcaa7('0x70')]];}else{if(!_[_0xcaa7('0x6a')](_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')])){_0x53c13c['id']={'$notIn':_0x3a6793[_0xcaa7('0x40')]['hopperIds']};}_0x3dfb2d=[[_0xcaa7('0x6c'),'DESC'],['scheduledAt',_0x1cf62d[0x0][_0xcaa7('0x6e')]],db[_0xcaa7('0x66')][_0xcaa7('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xcaa7('0x6f')]];}return db['CmHopper'][_0xcaa7('0x72')]({'attributes':['id',_0xcaa7('0x73'),'phone',_0xcaa7('0x74')],'where':_0x53c13c,'order':_0x3dfb2d,'transaction':_0x322423,'lock':_0x322423[_0xcaa7('0x75')][_0xcaa7('0x76')],'include':[{'model':db[_0xcaa7('0x57')],'as':_0xcaa7('0x77'),'attributes':_0x2c2df3,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xcaa7('0xe')]}]},{'model':db[_0xcaa7('0x78')],'as':_0xcaa7('0x79'),'attributes':['id',_0xcaa7('0xe')]},{'model':db[_0xcaa7('0x45')],'as':'Queue','attributes':['id',_0xcaa7('0xe'),_0xcaa7('0x7a')]}]})['then'](function(_0x22841e){if(_0x22841e){return _0x22841e[_0xcaa7('0xb')]({'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']},{'transaction':_0x322423});}});});}})[_0xcaa7('0xc')](handleEntityNotFound(_0x1b494a,null))[_0xcaa7('0xc')](respondWithResult(_0x1b494a,null))[_0xcaa7('0x3e')](handleError(_0x1b494a,null));};exports['getPreviewRecall']=function(_0x4af581,_0x3cbe09,_0x3ea57c){var _0x2b1e92=[];var _0x2381ce=_0x4af581['params']['id'];var _0x5c0380=_0x4af581[_0xcaa7('0x4d')]['id'];return db[_0xcaa7('0x57')][_0xcaa7('0x41')]()[_0xcaa7('0xc')](function(_0x30517b){_0x2b1e92=_['keys'](_0x30517b);return db[_0xcaa7('0x66')][_0xcaa7('0x67')](function(_0x273efe){const _0x2b4c26={'id':_0x2381ce};return db['CmHopper'][_0xcaa7('0x72')]({'attributes':['id',_0xcaa7('0x73'),_0xcaa7('0x74')],'where':_0x2b4c26,'transaction':_0x273efe,'lock':_0x273efe['LOCK'][_0xcaa7('0x76')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x2b1e92,'include':[{'model':db[_0xcaa7('0x7b')],'as':_0xcaa7('0x7c'),'attributes':['id',_0xcaa7('0xe')]}]},{'model':db[_0xcaa7('0x78')],'as':'List','attributes':['id',_0xcaa7('0xe')]},{'model':db[_0xcaa7('0x45')],'as':'Queue','attributes':['id',_0xcaa7('0xe'),_0xcaa7('0x7a')]}]})[_0xcaa7('0xc')](function(_0x5399d3){if(_0x5399d3){return _0x5399d3[_0xcaa7('0xb')]({'UserId':_0x5c0380},{'transaction':_0x273efe});}});});})[_0xcaa7('0xc')](handleEntityNotFound(_0x3cbe09,null))['then'](respondWithResult(_0x3cbe09,null))[_0xcaa7('0x3e')](handleError(_0x3cbe09,null));};exports['getOpenContacts']=function(_0xdc48b8,_0xa3fcb3){return _0xdc48b8['user'][_0xcaa7('0x62')]({'where':{'type':_0xcaa7('0x63'),'dialActive':!![],'dialMethod':_0xcaa7('0x64')},'attributes':['id'],'raw':!![]})['then'](function(_0x1499e9){if(_0x1499e9&&_0x1499e9[_0xcaa7('0x2d')]){return db[_0xcaa7('0x12')][_0xcaa7('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xcaa7('0x52'))},'VoiceQueueId':{'$in':_[_0xcaa7('0x11')](_0x1499e9,'id')},'$or':[{'UserId':null},{'UserId':_0xdc48b8[_0xcaa7('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x505d43){if(!_[_0xcaa7('0x5b')](_0x505d43)&&_[_0xcaa7('0x7d')](_0x505d43)){return _0xa3fcb3[_0xcaa7('0x3')](0xc8)[_0xcaa7('0x4')]({'contacts':_0x505d43});}else{logger[_0xcaa7('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xcaa7('0x7e'),0x194,_0xcaa7('0x7f'));_0xa3fcb3[_0xcaa7('0x80')](0x194);}})[_0xcaa7('0x3e')](handleError(_0xa3fcb3,null));};exports['getTimezones']=function(_0x3e74be,_0x358643){var _0x332433=shared[_0xcaa7('0x81')];var _0x32c6bc=[];_[_0xcaa7('0x11')](_0x332433,function(_0x16559e){_0x32c6bc['push']({'id':_0x16559e[_0xcaa7('0xe')],'name':_0x16559e[_0xcaa7('0xe')],'utcOffset':_0x16559e['utcOffset']});});return _0x358643['status'](0xc8)[_0xcaa7('0x4')]({'tz':_0x32c6bc});};exports[_0xcaa7('0x82')]=function(_0x3797fc,_0x4dfb92){var _0x1a7f2a=shared[_0xcaa7('0x81')];var _0x28cfa4={};if(!_[_0xcaa7('0x5b')](_0x1a7f2a[_0x3797fc[_0xcaa7('0x40')]['id']]))_0x28cfa4=_0x1a7f2a[_0x3797fc[_0xcaa7('0x40')]['id']];return _0x4dfb92[_0xcaa7('0x3')](0xc8)[_0xcaa7('0x4')](_0x28cfa4);}; \ No newline at end of file +var _0xb458=['update','then','error','stack','name','send','index','map','CmHopper','fieldName','type','key','model','query','filters','concat','$and','$or','$lt','$lte','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','createdAt','updatedAt','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','sequelize','dialPreviewAutoRecallMe','value','direction','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','transaction','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','sendStatus','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','status','offset','undefined','count','Content-Range','json'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb458,0x103));var _0x8b45=function(_0x16ef78,_0x251f60){_0x16ef78=_0x16ef78-0x0;var _0x352117=_0xb458[_0x16ef78];return _0x352117;};'use strict';var moment=require(_0x8b45('0x0'));var _=require(_0x8b45('0x1'));var qs=require(_0x8b45('0x2'));var logger=require('../../config/logger')('api');var shared=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];function respondWithResult(_0x141a44,_0x13a8c6){_0x13a8c6=_0x13a8c6||0xc8;return function(_0x5d51e4){if(_0x5d51e4){return _0x141a44[_0x8b45('0x5')](_0x13a8c6)['json'](_0x5d51e4);}};}function respondWithFilteredResult(_0x5cc2d5,_0xe8d774){return function(_0x12bd05){if(_0x12bd05){var _0x2daa9a=typeof _0xe8d774[_0x8b45('0x6')]===_0x8b45('0x7')&&typeof _0xe8d774['limit']===_0x8b45('0x7');var _0x12bea8=_0x12bd05[_0x8b45('0x8')];var _0x2bc809=_0x2daa9a?0x0:_0xe8d774[_0x8b45('0x6')];var _0x499899=_0x2daa9a?_0x12bd05[_0x8b45('0x8')]:_0xe8d774[_0x8b45('0x6')]+_0xe8d774['limit'];var _0x5316af;if(_0x499899>=_0x12bea8){_0x499899=_0x12bea8;_0x5316af=0xc8;}else{_0x5316af=0xce;}_0x5cc2d5['status'](_0x5316af);return _0x5cc2d5['set'](_0x8b45('0x9'),_0x2bc809+'-'+_0x499899+'/'+_0x12bea8)[_0x8b45('0xa')](_0x12bd05);}return null;};}function saveUpdates(_0x37c220,_0x52c4db){return function(_0x30d38c){if(_0x30d38c){return _0x30d38c[_0x8b45('0xb')](_0x37c220)[_0x8b45('0xc')](function(_0x2e5ec3){return _0x2e5ec3;});}return null;};}function handleEntityNotFound(_0x32babc,_0x2ad2ae){return function(_0x5f0b20){if(!_0x5f0b20){_0x32babc['sendStatus'](0x194);}return _0x5f0b20;};}function handleError(_0x45881c,_0x23f1dd){_0x23f1dd=_0x23f1dd||0x1f4;return function(_0x445170){logger[_0x8b45('0xd')](_0x445170[_0x8b45('0xe')]);if(_0x445170[_0x8b45('0xf')]){delete _0x445170[_0x8b45('0xf')];}_0x45881c[_0x8b45('0x5')](_0x23f1dd)[_0x8b45('0x10')](_0x445170);};}exports[_0x8b45('0x11')]=function(_0x287a3b,_0x21d5b2){var _0x1ed5ca={},_0x43ffb7={},_0x1623d8={'count':0x0,'rows':[]};var _0x31c6b4=_[_0x8b45('0x12')](db[_0x8b45('0x13')]['rawAttributes'],function(_0x25e8a1){return{'name':_0x25e8a1[_0x8b45('0x14')],'type':_0x25e8a1[_0x8b45('0x15')][_0x8b45('0x16')]};});_0x43ffb7[_0x8b45('0x17')]=_[_0x8b45('0x12')](_0x31c6b4,_0x8b45('0xf'));_0x43ffb7[_0x8b45('0x18')]=_['keys'](_0x287a3b['query']);_0x43ffb7[_0x8b45('0x19')]=_['intersection'](_0x43ffb7[_0x8b45('0x17')],_0x43ffb7[_0x8b45('0x18')]);_0x43ffb7[_0x8b45('0x19')]=_[_0x8b45('0x1a')](_0x43ffb7[_0x8b45('0x19')],[_0x8b45('0x1b'),_0x8b45('0x1c'),'$gt','$gte',_0x8b45('0x1d'),_0x8b45('0x1e'),'$ne','$eq',_0x8b45('0x1f'),_0x8b45('0x20'),_0x8b45('0x21'),_0x8b45('0x22'),'$notIn',_0x8b45('0x23'),_0x8b45('0x24'),_0x8b45('0x25'),_0x8b45('0x26'),_0x8b45('0x23'),_0x8b45('0x27'),_0x8b45('0x28'),_0x8b45('0x29'),_0x8b45('0x2a')]);_0x1ed5ca[_0x8b45('0x2b')]=_[_0x8b45('0x2c')](_0x43ffb7[_0x8b45('0x17')],qs[_0x8b45('0x2d')](_0x287a3b['query'][_0x8b45('0x2d')]));_0x1ed5ca[_0x8b45('0x2b')]=_0x1ed5ca[_0x8b45('0x2b')][_0x8b45('0x2e')]?_0x1ed5ca[_0x8b45('0x2b')]:_0x43ffb7[_0x8b45('0x17')];if(!_0x287a3b[_0x8b45('0x18')][_0x8b45('0x2f')]('nolimit')){_0x1ed5ca[_0x8b45('0x30')]=qs[_0x8b45('0x30')](_0x287a3b[_0x8b45('0x18')][_0x8b45('0x30')]);_0x1ed5ca[_0x8b45('0x6')]=qs['offset'](_0x287a3b[_0x8b45('0x18')]['offset']);}_0x1ed5ca['order']=qs[_0x8b45('0x31')](_0x287a3b[_0x8b45('0x18')][_0x8b45('0x31')]);_0x1ed5ca[_0x8b45('0x32')]=qs[_0x8b45('0x19')](_[_0x8b45('0x33')](_0x287a3b['query'],_0x43ffb7[_0x8b45('0x19')]),_0x31c6b4);if(_0x287a3b[_0x8b45('0x18')][_0x8b45('0x34')]){_0x1ed5ca[_0x8b45('0x32')]=_['merge'](_0x1ed5ca[_0x8b45('0x32')],{'$or':_[_0x8b45('0x12')](_0x31c6b4,function(_0x191db0){if(_0x191db0['type']!==_0x8b45('0x35')){var _0x475401={};_0x475401[_0x191db0[_0x8b45('0xf')]]={'$like':'%'+_0x287a3b['query'][_0x8b45('0x34')]+'%'};return _0x475401;}})});}_0x1ed5ca=_[_0x8b45('0x36')]({},_0x1ed5ca,_0x287a3b[_0x8b45('0x37')]);var _0x4016b7={'where':_0x1ed5ca['where']};return db[_0x8b45('0x13')][_0x8b45('0x8')](_0x4016b7)[_0x8b45('0xc')](function(_0x15df7c){_0x1623d8[_0x8b45('0x8')]=_0x15df7c;if(_0x287a3b[_0x8b45('0x18')]['includeAll']){_0x1ed5ca['include']=[{'all':!![]}];}return db[_0x8b45('0x13')][_0x8b45('0x38')](_0x1ed5ca);})[_0x8b45('0xc')](function(_0x12d4b2){_0x1623d8[_0x8b45('0x39')]=_0x12d4b2;return _0x1623d8;})['then'](respondWithFilteredResult(_0x21d5b2,_0x1ed5ca))[_0x8b45('0x3a')](handleError(_0x21d5b2,null));};exports['show']=function(_0x67c59a,_0x17e9a8){var _0x5fae26={'raw':!![],'where':{'id':_0x67c59a[_0x8b45('0x3b')]['id']}},_0x280bb0={};_0x280bb0[_0x8b45('0x17')]=_[_0x8b45('0x3c')](db[_0x8b45('0x13')][_0x8b45('0x3d')]);_0x280bb0[_0x8b45('0x18')]=_[_0x8b45('0x3c')](_0x67c59a['query']);_0x280bb0[_0x8b45('0x19')]=_['intersection'](_0x280bb0[_0x8b45('0x17')],_0x280bb0['query']);_0x5fae26[_0x8b45('0x2b')]=_[_0x8b45('0x2c')](_0x280bb0[_0x8b45('0x17')],qs[_0x8b45('0x2d')](_0x67c59a[_0x8b45('0x18')][_0x8b45('0x2d')]));_0x5fae26['attributes']=_0x5fae26[_0x8b45('0x2b')]['length']?_0x5fae26['attributes']:_0x280bb0[_0x8b45('0x17')];if(_0x67c59a[_0x8b45('0x18')][_0x8b45('0x3e')]){_0x5fae26['include']=[{'all':!![]}];}_0x5fae26=_[_0x8b45('0x36')]({},_0x5fae26,_0x67c59a['options']);return db[_0x8b45('0x13')][_0x8b45('0x3f')](_0x5fae26)[_0x8b45('0xc')](handleEntityNotFound(_0x17e9a8,null))[_0x8b45('0xc')](respondWithResult(_0x17e9a8,null))[_0x8b45('0x3a')](handleError(_0x17e9a8,null));};exports[_0x8b45('0x40')]=function(_0x526c90,_0x3cebd2){return db[_0x8b45('0x13')][_0x8b45('0x40')](_0x526c90[_0x8b45('0x41')],{})[_0x8b45('0xc')](respondWithResult(_0x3cebd2,0xc9))[_0x8b45('0x3a')](handleError(_0x3cebd2,null));};exports[_0x8b45('0xb')]=function(_0x3de3c2,_0x37b94a){if(_0x3de3c2[_0x8b45('0x41')]['id']){delete _0x3de3c2[_0x8b45('0x41')]['id'];}return db[_0x8b45('0x13')][_0x8b45('0x3f')]({'where':{'id':_0x3de3c2[_0x8b45('0x3b')]['id']}})[_0x8b45('0xc')](handleEntityNotFound(_0x37b94a,null))[_0x8b45('0xc')](saveUpdates(_0x3de3c2['body'],null))['then'](respondWithResult(_0x37b94a,null))['catch'](handleError(_0x37b94a,null));};exports[_0x8b45('0x42')]=function(_0x214e28,_0x3a1621){return db[_0x8b45('0x13')][_0x8b45('0x42')]()[_0x8b45('0xc')](respondWithResult(_0x3a1621,null))[_0x8b45('0x3a')](handleError(_0x3a1621,null));};exports[_0x8b45('0x43')]=function(_0x5e2a03,_0x102d01){var _0x5d5be2;var _0x23b5c6=_0x5e2a03[_0x8b45('0x3b')]['id'];return db[_0x8b45('0x13')][_0x8b45('0x3f')]({'where':{'id':_0x5e2a03['params']['id']}})[_0x8b45('0xc')](handleEntityNotFound(_0x102d01,null))[_0x8b45('0xc')](function(_0x5e42e6){if(_0x5e42e6){return _0x5e42e6[_0x8b45('0x43')]()[_0x8b45('0xc')](function(_0x52970c){return _0x52970c;});}})[_0x8b45('0xc')](function(_0x5758c){_0x5d5be2=_0x5758c;if(_0x5758c){if(_0x5758c[_0x8b45('0x44')]||_0x5758c[_0x8b45('0x45')]){return db[_0x5758c[_0x8b45('0x44')]?_0x8b45('0x46'):'Campaign']['find']({'where':{'id':_0x5758c[_0x8b45('0x44')]?_0x5758c[_0x8b45('0x44')]:_0x5758c[_0x8b45('0x45')]},'attributes':['id','name'],'raw':!![]});}}})[_0x8b45('0xc')](function(_0x11d1a5){var _0x20a68b={};if(_0x11d1a5){_[_0x8b45('0x36')](_0x20a68b,_[_0x8b45('0x47')](_0x5d5be2['dataValues'],[_0x8b45('0x48'),_0x8b45('0x49'),'id']));_0x20a68b['state']=0x15;_0x20a68b[_0x8b45('0x4a')]='deleted';_0x20a68b[_0x8b45('0x4b')]=_0x11d1a5[_0x8b45('0xf')];_0x20a68b[_0x8b45('0x4c')]=_0x5e2a03[_0x8b45('0x4d')]['name'];_0x20a68b[_0x8b45('0x4e')]=_0x5e2a03[_0x8b45('0x4d')]['id'];_0x20a68b[_0x8b45('0x4f')]=!![];_0x20a68b[_0x8b45('0x50')]=moment()[_0x8b45('0x51')](_0x8b45('0x52'));_0x20a68b[_0x8b45('0x53')]=_0x5d5be2[_0x8b45('0x54')];_0x20a68b[_0x8b45('0x55')]=_0x5d5be2[_0x8b45('0x44')]?_0x8b45('0x56'):_0x8b45('0x57');return db[_0x8b45('0x58')][_0x8b45('0x3f')]({'where':{'id':_0x20a68b[_0x8b45('0x59')]},'attributes':['firstName',_0x8b45('0x5a')]})[_0x8b45('0xc')](function(_0x15c9ae){if(!_['isNil'](_0x102d01)&&!_[_0x8b45('0x5b')](_0x15c9ae[_0x8b45('0x5c')])){_0x20a68b[_0x8b45('0x5d')]=_0x15c9ae[_0x8b45('0x5c')];if(!_['isNil'](_0x15c9ae[_0x8b45('0x5a')])){_0x20a68b[_0x8b45('0x5d')]+='\x20'+_0x15c9ae[_0x8b45('0x5a')];}}})[_0x8b45('0x5e')](function(){return db['CmHopperFinal'][_0x8b45('0x40')](_0x20a68b);});}})[_0x8b45('0xc')](function(_0x417778){return db[_0x8b45('0x5f')][_0x8b45('0x43')]({'where':{'CmHopperId':_0x23b5c6}});})['then'](function(){return _0x102d01[_0x8b45('0x5')](0xcc)['end']();})[_0x8b45('0x3a')](handleError(_0x102d01,null));};exports[_0x8b45('0x60')]=function(_0x19152b,_0x19c80e){var _0x6a77bd=[];return db[_0x8b45('0x58')]['describe']()['then'](function(_0x5ace1){_0x6a77bd=_[_0x8b45('0x3c')](_0x5ace1);return _0x19152b['user'][_0x8b45('0x61')]({'where':{'type':_0x8b45('0x62'),'dialActive':!![],'dialMethod':_0x8b45('0x63')},'attributes':['id','dialOrderByScheduledAt','dialPreviewAutoRecallMe'],'raw':!![]});})[_0x8b45('0xc')](function(_0x8e5a41){if(_0x8e5a41&&_0x8e5a41['length']){return db[_0x8b45('0x64')]['transaction'](function(_0xf1ab37){var _0x560c51={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x8b45('0x52'))},'VoiceQueueId':{'$in':_[_0x8b45('0x12')](_0x8e5a41,'id')},'$or':[{'UserId':null},{'UserId':_0x19152b['user']['id']}]};var _0x324592={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x8e5a41)[_0x8b45('0x34')]([_0x8b45('0x65'),0x0])[_0x8b45('0x12')]('id')[_0x8b45('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x19152b['user']['id']}]};var _0x37f580={'$or':[_0x560c51,_0x324592]};var _0x3b3d21=[];if(_0x19152b[_0x8b45('0x41')]['direction']&&_0x19152b['body'][_0x8b45('0x67')]==='prev'){if(!_[_0x8b45('0x68')](_0x19152b['body']['hopperIds'])){_0x37f580['id']={'$in':_0x19152b['body'][_0x8b45('0x69')]};}_0x3b3d21=[['priority',_0x8b45('0x6a')],[_0x8b45('0x6b'),_0x8e5a41[0x0]['dialOrderByScheduledAt']===_0x8b45('0x6a')?_0x8b45('0x6c'):'ASC'],db[_0x8b45('0x64')][_0x8b45('0x6d')](_0x8b45('0x6e')),['id',_0x8b45('0x6c')]];}else{if(!_[_0x8b45('0x68')](_0x19152b[_0x8b45('0x41')][_0x8b45('0x69')])){_0x37f580['id']={'$notIn':_0x19152b[_0x8b45('0x41')][_0x8b45('0x69')]};}_0x3b3d21=[[_0x8b45('0x6f'),_0x8b45('0x6c')],[_0x8b45('0x6b'),_0x8e5a41[0x0]['dialOrderByScheduledAt']],db[_0x8b45('0x64')][_0x8b45('0x6d')](_0x8b45('0x70')),['id',_0x8b45('0x6a')]];}return db[_0x8b45('0x13')][_0x8b45('0x71')]({'attributes':['id',_0x8b45('0x72'),_0x8b45('0x54'),_0x8b45('0x73')],'where':_0x37f580,'order':_0x3b3d21,'transaction':_0xf1ab37,'lock':_0xf1ab37[_0x8b45('0x74')][_0x8b45('0x75')],'include':[{'model':db[_0x8b45('0x58')],'as':_0x8b45('0x76'),'attributes':_0x6a77bd,'include':[{'model':db[_0x8b45('0x77')],'as':_0x8b45('0x78'),'attributes':['id','name']}]},{'model':db[_0x8b45('0x79')],'as':_0x8b45('0x7a'),'attributes':['id',_0x8b45('0xf')]},{'model':db[_0x8b45('0x46')],'as':_0x8b45('0x7b'),'attributes':['id',_0x8b45('0xf'),_0x8b45('0x7c')]}]})[_0x8b45('0xc')](function(_0x47d8f7){if(_0x47d8f7){return _0x47d8f7[_0x8b45('0xb')]({'UserId':_0x19152b[_0x8b45('0x4d')]['id']},{'transaction':_0xf1ab37});}});});}})[_0x8b45('0xc')](handleEntityNotFound(_0x19c80e,null))[_0x8b45('0xc')](respondWithResult(_0x19c80e,null))[_0x8b45('0x3a')](handleError(_0x19c80e,null));};exports[_0x8b45('0x7d')]=function(_0xd5a325,_0x9b123d,_0x2a6fee){var _0xd19d7c=[];var _0x2d0045=_0xd5a325['params']['id'];var _0x4b5cd7=_0xd5a325[_0x8b45('0x4d')]['id'];return db[_0x8b45('0x58')][_0x8b45('0x42')]()[_0x8b45('0xc')](function(_0x6a235a){_0xd19d7c=_[_0x8b45('0x3c')](_0x6a235a);return db[_0x8b45('0x64')][_0x8b45('0x7e')](function(_0x63ab53){const _0x4b3fb3={'id':_0x2d0045};return db['CmHopper'][_0x8b45('0x71')]({'attributes':['id',_0x8b45('0x72'),_0x8b45('0x73')],'where':_0x4b3fb3,'transaction':_0x63ab53,'lock':_0x63ab53[_0x8b45('0x74')]['UPDATE'],'include':[{'model':db[_0x8b45('0x58')],'as':_0x8b45('0x76'),'attributes':_0xd19d7c,'include':[{'model':db[_0x8b45('0x77')],'as':_0x8b45('0x78'),'attributes':['id',_0x8b45('0xf')]}]},{'model':db[_0x8b45('0x79')],'as':'List','attributes':['id','name']},{'model':db[_0x8b45('0x46')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0x8b45('0xc')](function(_0x170b95){if(_0x170b95){return _0x170b95[_0x8b45('0xb')]({'UserId':_0x4b5cd7},{'transaction':_0x63ab53});}});});})[_0x8b45('0xc')](handleEntityNotFound(_0x9b123d,null))[_0x8b45('0xc')](respondWithResult(_0x9b123d,null))[_0x8b45('0x3a')](handleError(_0x9b123d,null));};exports[_0x8b45('0x7f')]=function(_0xc9be77,_0xc89fc6){return _0xc9be77[_0x8b45('0x4d')][_0x8b45('0x61')]({'where':{'type':_0x8b45('0x62'),'dialActive':!![],'dialMethod':_0x8b45('0x63')},'attributes':['id'],'raw':!![]})[_0x8b45('0xc')](function(_0x42b192){if(_0x42b192&&_0x42b192['length']){return db[_0x8b45('0x13')][_0x8b45('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8b45('0x51')](_0x8b45('0x52'))},'VoiceQueueId':{'$in':_[_0x8b45('0x12')](_0x42b192,'id')},'$or':[{'UserId':null},{'UserId':_0xc9be77[_0x8b45('0x4d')]['id']}]}});}return 0x0;})[_0x8b45('0xc')](function(_0x251584){if(!_[_0x8b45('0x5b')](_0x251584)&&_[_0x8b45('0x80')](_0x251584)){return _0xc89fc6['status'](0xc8)[_0x8b45('0xa')]({'contacts':_0x251584});}else{logger[_0x8b45('0xd')](_0x8b45('0x81'),_0x8b45('0x7f'),0x194,'entity\x20not\x20found');_0xc89fc6[_0x8b45('0x82')](0x194);}})['catch'](handleError(_0xc89fc6,null));};exports[_0x8b45('0x83')]=function(_0x55acc4,_0x2d3b89){var _0x6966ea=shared[_0x8b45('0x84')];var _0x3e4437=[];_[_0x8b45('0x12')](_0x6966ea,function(_0x45beb9){_0x3e4437['push']({'id':_0x45beb9[_0x8b45('0xf')],'name':_0x45beb9[_0x8b45('0xf')],'utcOffset':_0x45beb9[_0x8b45('0x85')]});});return _0x2d3b89[_0x8b45('0x5')](0xc8)['json']({'tz':_0x3e4437});};exports[_0x8b45('0x86')]=function(_0x3bdd64,_0x4adb06){var _0x5c3dbd=shared[_0x8b45('0x84')];var _0x24a570={};if(!_[_0x8b45('0x5b')](_0x5c3dbd[_0x3bdd64['body']['id']]))_0x24a570=_0x5c3dbd[_0x3bdd64[_0x8b45('0x41')]['id']];return _0x4adb06['status'](0xc8)[_0x8b45('0xa')](_0x24a570);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1517a1f..2ee92f3 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 _0x31f0=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone'];(function(_0x4c0b04,_0xa76db){var _0x42d0d8=function(_0x3e435f){while(--_0x3e435f){_0x4c0b04['push'](_0x4c0b04['shift']());}};_0x42d0d8(++_0xa76db);}(_0x31f0,0xb7));var _0x031f=function(_0x333a1d,_0x2df2c7){_0x333a1d=_0x333a1d-0x0;var _0x163389=_0x31f0[_0x333a1d];return _0x163389;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('CmHopper',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]},{'name':_0x031f('0xb'),'fields':['phone']},{'name':_0x031f('0xc'),'fields':[_0x031f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','priority','lodash','util','../../config/logger'];(function(_0x9c71e8,_0x30db09){var _0x5c6004=function(_0x5e84a9){while(--_0x5e84a9){_0x9c71e8['push'](_0x9c71e8['shift']());}};_0x5c6004(++_0x30db09);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'phone','fields':['phone']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c79d120..795fdd2 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 _0xa168=['raw','where','attributes','include','map','model','then','info','debug','catch','error','find','ShowCmHopper','stringify','message','CreateCmHopper','create','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','bluebird','../../mysqldb','GetCmHopper','CmHopper','findAll','options'];(function(_0x431899,_0x27c798){var _0x39db00=function(_0x4e2f33){while(--_0x4e2f33){_0x431899['push'](_0x431899['shift']());}};_0x39db00(++_0x27c798);}(_0xa168,0x95));var _0x8a16=function(_0x5bc28b,_0x5bf1a0){_0x5bc28b=_0x5bc28b-0x0;var _0x27a1d9=_0xa168[_0x5bc28b];return _0x27a1d9;};'use strict';var _=require(_0x8a16('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a16('0x1'));var db=require(_0x8a16('0x2'))['db'];var logger=require('../../config/logger')('rpc');exports[_0x8a16('0x3')]=function(_0xe2a5a4){var _0x1a2150=this;return new Promise(function(_0x5b4c71,_0x501e11){return db[_0x8a16('0x4')][_0x8a16('0x5')]({'raw':_0xe2a5a4['options']?_0xe2a5a4[_0x8a16('0x6')][_0x8a16('0x7')]===undefined?!![]:![]:!![],'where':_0xe2a5a4[_0x8a16('0x6')]?_0xe2a5a4[_0x8a16('0x6')][_0x8a16('0x8')]||null:null,'attributes':_0xe2a5a4[_0x8a16('0x6')]?_0xe2a5a4['options'][_0x8a16('0x9')]||null:null,'limit':_0xe2a5a4['options']?_0xe2a5a4['options']['limit']||null:null,'include':_0xe2a5a4[_0x8a16('0x6')]?_0xe2a5a4[_0x8a16('0x6')][_0x8a16('0xa')]?_[_0x8a16('0xb')](_0xe2a5a4[_0x8a16('0x6')]['include'],function(_0x688c8f){return{'model':db[_0x688c8f[_0x8a16('0xc')]],'as':_0x688c8f['as'],'attributes':_0x688c8f[_0x8a16('0x9')],'include':_0x688c8f[_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x688c8f['include'],function(_0x5317b7){return{'model':db[_0x5317b7[_0x8a16('0xc')]],'as':_0x5317b7['as'],'attributes':_0x5317b7[_0x8a16('0x9')],'include':_0x5317b7[_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x5317b7[_0x8a16('0xa')],function(_0x300fbd){return{'model':db[_0x300fbd['model']],'as':_0x300fbd['as'],'attributes':_0x300fbd[_0x8a16('0x9')]};}):[]};}):[]};}):[]:[]})[_0x8a16('0xd')](function(_0x59a0b7){logger[_0x8a16('0xe')](_0x8a16('0x3'),_0xe2a5a4);logger[_0x8a16('0xf')](_0x8a16('0x3'),_0xe2a5a4,JSON['stringify'](_0x59a0b7));_0x5b4c71(_0x59a0b7);})[_0x8a16('0x10')](function(_0x1eb20b){logger['error']('GetCmHopper',_0x1eb20b['message'],_0xe2a5a4);_0x501e11(_0x1a2150[_0x8a16('0x11')](0x1f4,_0x1eb20b['message']));});});};exports['ShowCmHopper']=function(_0x463629){var _0x3f6ab6=this;return new Promise(function(_0x3d6465,_0x5583fe){return db[_0x8a16('0x4')][_0x8a16('0x12')]({'raw':_0x463629[_0x8a16('0x6')]?_0x463629[_0x8a16('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x463629[_0x8a16('0x6')]?_0x463629[_0x8a16('0x6')][_0x8a16('0x8')]||null:null,'attributes':_0x463629[_0x8a16('0x6')]?_0x463629['options'][_0x8a16('0x9')]||null:null,'include':_0x463629[_0x8a16('0x6')]?_0x463629[_0x8a16('0x6')][_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x463629[_0x8a16('0x6')][_0x8a16('0xa')],function(_0x386e6e){return{'model':db[_0x386e6e[_0x8a16('0xc')]],'as':_0x386e6e['as'],'attributes':_0x386e6e['attributes'],'include':_0x386e6e['include']?_[_0x8a16('0xb')](_0x386e6e[_0x8a16('0xa')],function(_0x4698f8){return{'model':db[_0x4698f8[_0x8a16('0xc')]],'as':_0x4698f8['as'],'attributes':_0x4698f8[_0x8a16('0x9')],'include':_0x4698f8[_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x4698f8[_0x8a16('0xa')],function(_0x1f10a3){return{'model':db[_0x1f10a3['model']],'as':_0x1f10a3['as'],'attributes':_0x1f10a3[_0x8a16('0x9')]};}):[]};}):[]};}):[]:[]})[_0x8a16('0xd')](function(_0x62549f){logger['info'](_0x8a16('0x13'),_0x463629);logger[_0x8a16('0xf')](_0x8a16('0x13'),_0x463629,JSON[_0x8a16('0x14')](_0x62549f));_0x3d6465(_0x62549f);})[_0x8a16('0x10')](function(_0x40d3da){logger[_0x8a16('0x11')](_0x8a16('0x13'),_0x40d3da[_0x8a16('0x15')],_0x463629);_0x5583fe(_0x3f6ab6[_0x8a16('0x11')](0x1f4,_0x40d3da[_0x8a16('0x15')]));});});};exports[_0x8a16('0x16')]=function(_0x3c95a){var _0x3b8845=this;return new Promise(function(_0x350a87,_0x2be378){return db['CmHopper'][_0x8a16('0x17')](_0x3c95a[_0x8a16('0x18')],{'raw':_0x3c95a[_0x8a16('0x6')]?_0x3c95a[_0x8a16('0x6')][_0x8a16('0x7')]===undefined?!![]:![]:!![]})['then'](function(_0x120112){logger['info'](_0x8a16('0x16'),_0x3c95a);logger[_0x8a16('0xf')](_0x8a16('0x16'),_0x3c95a,JSON[_0x8a16('0x14')](_0x120112));_0x350a87(_0x120112);})[_0x8a16('0x10')](function(_0x1b0b5b){logger[_0x8a16('0x11')]('CreateCmHopper',_0x1b0b5b[_0x8a16('0x15')],_0x3c95a);_0x2be378(_0x3b8845['error'](0x1f4,_0x1b0b5b[_0x8a16('0x15')]));});});};exports[_0x8a16('0x19')]=function(_0x59f0e4){var _0x47b241=this;return new Promise(function(_0x5f4c65,_0x42c3c6){return db[_0x8a16('0x4')]['update'](_0x59f0e4[_0x8a16('0x18')],{'raw':_0x59f0e4[_0x8a16('0x6')]?_0x59f0e4[_0x8a16('0x6')][_0x8a16('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f0e4['options']?_0x59f0e4[_0x8a16('0x6')][_0x8a16('0x8')]||null:null,'attributes':_0x59f0e4[_0x8a16('0x6')]?_0x59f0e4[_0x8a16('0x6')][_0x8a16('0x9')]||null:null,'limit':_0x59f0e4[_0x8a16('0x6')]?_0x59f0e4[_0x8a16('0x6')][_0x8a16('0x1a')]||null:null})['then'](function(_0x4a4fa3){logger[_0x8a16('0xe')](_0x8a16('0x19'),_0x59f0e4);logger[_0x8a16('0xe')](_0x8a16('0x1b'),JSON['stringify'](_0x59f0e4[_0x8a16('0x6')]['where']),_0x59f0e4[_0x8a16('0x18')][_0x8a16('0x1c')]);logger[_0x8a16('0xf')](_0x8a16('0x19'),_0x59f0e4,JSON['stringify'](_0x4a4fa3));_0x5f4c65(_0x4a4fa3);})['catch'](function(_0x39332a){logger['error'](_0x8a16('0x19'),_0x39332a[_0x8a16('0x15')],_0x59f0e4);_0x42c3c6(_0x47b241[_0x8a16('0x11')](0x1f4,_0x39332a['message']));});});};exports[_0x8a16('0x1d')]=function(_0x315a0){var _0x3a5c08=this;return new Promise(function(_0x2691e8,_0x1b5a50){return db[_0x8a16('0x4')][_0x8a16('0x1e')]({'where':_0x315a0['options']?_0x315a0[_0x8a16('0x6')]['where']||null:null})[_0x8a16('0xd')](function(_0x1b2514){logger[_0x8a16('0xe')](_0x8a16('0x1d'),_0x315a0);logger[_0x8a16('0xf')](_0x8a16('0x1d'),_0x315a0,JSON['stringify'](_0x1b2514));_0x2691e8(_0x1b2514);})[_0x8a16('0x10')](function(_0x202673){logger[_0x8a16('0x11')](_0x8a16('0x1d'),_0x202673[_0x8a16('0x15')],_0x315a0);_0x1b5a50(_0x3a5c08[_0x8a16('0x11')](0x1f4,_0x202673[_0x8a16('0x15')]));});});};exports[_0x8a16('0x1f')]=function(_0x2f6d2c){var _0x56d16f=this;return new Promise(function(_0xfd9267,_0x13f1d6){return db[_0x8a16('0x20')][_0x8a16('0x21')]()[_0x8a16('0xd')](function(_0x3bb514){return db[_0x8a16('0x22')][_0x8a16('0x23')](function(_0x422271){return db[_0x8a16('0x4')][_0x8a16('0x5')]({'where':_0x2f6d2c[_0x8a16('0x6')]?_0x2f6d2c['options'][_0x8a16('0x8')]||null:null,'attributes':_0x2f6d2c['options']?_0x2f6d2c['options'][_0x8a16('0x9')]||null:null,'limit':_0x2f6d2c[_0x8a16('0x6')]?_0x2f6d2c[_0x8a16('0x6')][_0x8a16('0x1a')]||null:null,'order':_0x2f6d2c[_0x8a16('0x6')]?_0x2f6d2c[_0x8a16('0x6')][_0x8a16('0x24')]||null:null,'transaction':_0x422271,'lock':_0x422271[_0x8a16('0x25')][_0x8a16('0x26')],'include':[{'model':db[_0x8a16('0x20')],'as':_0x8a16('0x27'),'attributes':_[_0x8a16('0x28')](_0x3bb514)},{'model':db[_0x8a16('0x29')],'as':_0x8a16('0x2a'),'attributes':['id',_0x8a16('0x2b'),_0x8a16('0x2c')]}]})['then'](function(_0x42255c){var _0xf23c3d=[];var _0x4cae43=[];for(var _0x255ec8=0x0;_0x255ec8<_0x42255c[_0x8a16('0x2d')];_0x255ec8+=0x1){var _0x32f5b3=_0x42255c[_0x255ec8][_0x8a16('0x2e')];if(_0x32f5b3===null){_0xf23c3d[_0x8a16('0x2f')](_0x42255c[_0x255ec8][_0x8a16('0x30')](_0x2f6d2c[_0x8a16('0x18')],{'transaction':_0x422271}));}else if(!_0x4cae43[_0x8a16('0x31')](_0x32f5b3)){_0x4cae43[_0x8a16('0x2f')](_0x32f5b3);_0xf23c3d['push'](_0x42255c[_0x255ec8][_0x8a16('0x30')](_0x2f6d2c[_0x8a16('0x18')],{'transaction':_0x422271}));}}return BPromise[_0x8a16('0x32')](_0xf23c3d);});})['then'](function(_0x378299){logger[_0x8a16('0xe')](_0x8a16('0x1f'),_0x2f6d2c);if(_0x378299[_0x8a16('0x2d')]>0x0){logger[_0x8a16('0xe')](_0x8a16('0x33'),_0x378299[0x0]['dataValues']['id'],_0x378299[0x0][_0x8a16('0x34')][_0x8a16('0x35')],_0x378299[0x0][_0x8a16('0x34')][_0x8a16('0x1c')]);}logger[_0x8a16('0xf')](_0x8a16('0x1f'),_0x2f6d2c,JSON[_0x8a16('0x14')](_0x378299));_0xfd9267(_0x378299);})['catch'](function(_0x492b0e){logger[_0x8a16('0x11')]('GetContactDialer',_0x492b0e[_0x8a16('0x15')],_0x2f6d2c);_0x13f1d6(_0x56d16f[_0x8a16('0x11')](0x1f4,_0x492b0e[_0x8a16('0x15')]));});});});};exports[_0x8a16('0x36')]=function(_0x512d24){var _0x40ee1c=this;return new Promise(function(_0x3a01d2,_0x319ccf){return db[_0x8a16('0x22')][_0x8a16('0x23')](function(_0xd67ca7){return db['CmHopperFinal']['create'](_0x512d24[_0x8a16('0x18')],{'raw':_0x512d24[_0x8a16('0x6')]?_0x512d24[_0x8a16('0x6')][_0x8a16('0x7')]===undefined?!![]:![]:!![],'transaction':_0xd67ca7})['then'](function(){logger['info'](_0x8a16('0x37'),JSON['stringify'](_0x512d24['options'][_0x8a16('0x8')]),_0x512d24[_0x8a16('0x6')][_0x8a16('0x8')][_0x8a16('0x1c')]);return db[_0x8a16('0x4')][_0x8a16('0x1e')]({'where':_0x512d24[_0x8a16('0x6')]?_0x512d24[_0x8a16('0x6')][_0x8a16('0x8')]||null:null,'transaction':_0xd67ca7});});})['then'](function(_0x284eb9){logger[_0x8a16('0xe')](_0x8a16('0x36'),_0x512d24);logger[_0x8a16('0xf')]('MoveContactManagedDialer',_0x512d24,JSON[_0x8a16('0x14')](_0x284eb9));_0x3a01d2(_0x284eb9);})['catch'](function(_0x2c4f33){logger[_0x8a16('0x11')](_0x8a16('0x36'),_0x2c4f33[_0x8a16('0x15')],_0x512d24);_0x319ccf(_0x40ee1c[_0x8a16('0x11')](0x1f4,_0x2c4f33[_0x8a16('0x15')]));});});};exports[_0x8a16('0x38')]=function(_0x9628c3){var _0x289705=this;return new Promise(function(_0x8fbbfc,_0x2c2b92){return db[_0x8a16('0x4')][_0x8a16('0x5')]({'raw':_0x9628c3[_0x8a16('0x6')]?_0x9628c3[_0x8a16('0x6')][_0x8a16('0x7')]===undefined?!![]:![]:!![],'where':_0x9628c3[_0x8a16('0x6')]?_0x9628c3[_0x8a16('0x6')][_0x8a16('0x8')]||null:null,'attributes':[[db[_0x8a16('0x22')]['fn'](_0x8a16('0x39'),db[_0x8a16('0x22')]['fn']('IF',db[_0x8a16('0x22')][_0x8a16('0x3a')](_0x8a16('0x3b')+util[_0x8a16('0x3c')]('\x22%s\x22',moment()[_0x8a16('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x8a16('0x3d')))),'contactsRescheduled']]})['then'](function(_0x40e224){logger[_0x8a16('0xe')](_0x8a16('0x38'),_0x9628c3);logger['debug'](_0x8a16('0x38'),_0x9628c3,JSON[_0x8a16('0x14')](_0x40e224));_0x8fbbfc(_0x40e224);})[_0x8a16('0x10')](function(_0x4d5f87){logger[_0x8a16('0x11')](_0x8a16('0x38'),_0x4d5f87['message'],_0x9628c3);_0x2c2b92(_0x289705[_0x8a16('0x11')](0x1f4,_0x4d5f87['message']));});});};exports[_0x8a16('0x3e')]=function(_0x7bbe89){var _0x384de1=this;return new Promise(function(_0x8055fc,_0x11fb63){return db[_0x8a16('0x20')][_0x8a16('0x21')]()[_0x8a16('0xd')](function(){return db['sequelize'][_0x8a16('0x23')](function(_0x309adb){return db[_0x8a16('0x4')][_0x8a16('0x5')]({'where':_0x7bbe89[_0x8a16('0x6')]?_0x7bbe89['options'][_0x8a16('0x8')]||null:null,'attributes':_0x7bbe89['options']?_0x7bbe89[_0x8a16('0x6')]['attributes']||null:null,'limit':0x1,'order':_0x7bbe89[_0x8a16('0x6')]?_0x7bbe89[_0x8a16('0x6')][_0x8a16('0x24')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x309adb,'lock':_0x309adb[_0x8a16('0x25')][_0x8a16('0x26')],'include':_0x7bbe89[_0x8a16('0x6')]?_0x7bbe89[_0x8a16('0x6')][_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x7bbe89['options']['include'],function(_0x2cbdda){return{'model':db[_0x2cbdda['model']],'as':_0x2cbdda['as'],'attributes':_0x2cbdda[_0x8a16('0x9')],'include':_0x2cbdda[_0x8a16('0xa')]?_['map'](_0x2cbdda[_0x8a16('0xa')],function(_0x1fe779){return{'model':db[_0x1fe779['model']],'as':_0x1fe779['as'],'attributes':_0x1fe779[_0x8a16('0x9')],'include':_0x1fe779[_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x1fe779[_0x8a16('0xa')],function(_0x4de116){return{'model':db[_0x4de116['model']],'as':_0x4de116['as'],'attributes':_0x4de116[_0x8a16('0x9')]};}):[]};}):[]};}):[]:[]})[_0x8a16('0xd')](function(_0xd646f2){var _0x5dd2e4=[];for(var _0x50f89b=0x0;_0x50f89b<_0xd646f2['length'];_0x50f89b+=0x1){_0x5dd2e4[_0x8a16('0x2f')](_0xd646f2[_0x50f89b][_0x8a16('0x30')](_0x7bbe89[_0x8a16('0x18')],{'transaction':_0x309adb}));}return BPromise[_0x8a16('0x32')](_0x5dd2e4);});})['then'](function(_0x5e4a92){logger[_0x8a16('0xe')](_0x8a16('0x3e'),_0x7bbe89);logger[_0x8a16('0xf')](_0x8a16('0x3e'),_0x7bbe89,JSON[_0x8a16('0x14')](_0x5e4a92));_0x8055fc(_0x5e4a92);})[_0x8a16('0x10')](function(_0x2f454d){logger[_0x8a16('0x11')]('GetContactRecallMe',_0x2f454d['message'],_0x7bbe89);_0x11fb63(_0x384de1[_0x8a16('0x11')](0x1f4,_0x2f454d['message']));});});});};exports[_0x8a16('0x3f')]=function(_0x21eb4d){var _0x2ad77a=this;return new Promise(function(_0x4c0d3c,_0x253daa){db[_0x8a16('0x20')][_0x8a16('0x21')]()[_0x8a16('0xd')](function(_0x3d10ff){return db[_0x8a16('0x4')][_0x8a16('0x5')]({'raw':_0x21eb4d[_0x8a16('0x6')]?_0x21eb4d[_0x8a16('0x6')][_0x8a16('0x7')]===undefined?!![]:![]:!![],'where':_0x21eb4d[_0x8a16('0x6')]?_0x21eb4d[_0x8a16('0x6')][_0x8a16('0x8')]||null:null,'attributes':_0x21eb4d[_0x8a16('0x6')]?_0x21eb4d[_0x8a16('0x6')][_0x8a16('0x9')]||null:null,'limit':_0x21eb4d[_0x8a16('0x6')]?_0x21eb4d[_0x8a16('0x6')][_0x8a16('0x1a')]||null:null,'include':_0x21eb4d['options']?_0x21eb4d[_0x8a16('0x6')][_0x8a16('0xa')]?_[_0x8a16('0xb')](_0x21eb4d[_0x8a16('0x6')][_0x8a16('0xa')],function(_0x4227bb){return{'model':db[_0x4227bb[_0x8a16('0xc')]],'as':_0x4227bb['as'],'attributes':_0x4227bb['as']===_0x8a16('0x27')?_['keys'](_0x3d10ff):_0x4227bb[_0x8a16('0x9')],'include':_0x4227bb['include']?_[_0x8a16('0xb')](_0x4227bb[_0x8a16('0xa')],function(_0x4ab27d){return{'model':db[_0x4ab27d['model']],'as':_0x4ab27d['as'],'attributes':_0x4ab27d['attributes'],'include':_0x4ab27d[_0x8a16('0xa')]?_['map'](_0x4ab27d[_0x8a16('0xa')],function(_0x557377){return{'model':db[_0x557377[_0x8a16('0xc')]],'as':_0x557377['as'],'attributes':_0x557377[_0x8a16('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3605aa){logger['info'](_0x8a16('0x3'),_0x21eb4d);logger[_0x8a16('0xf')](_0x8a16('0x3'),_0x21eb4d,JSON[_0x8a16('0x14')](_0x3605aa));_0x4c0d3c(_0x3605aa);})[_0x8a16('0x10')](function(_0x4793dd){logger[_0x8a16('0x11')]('GetCmHopper',_0x4793dd['message'],_0x21eb4d);_0x253daa(_0x2ad77a['error'](0x1f4,_0x4793dd[_0x8a16('0x15')]));});});});};exports[_0x8a16('0x40')]=function(_0x1ec906){var _0x489bce=this;return new Promise(function(_0xe2b23b,_0x1d46f4){return db[_0x8a16('0x20')][_0x8a16('0x41')]({'raw':!![],'where':{'phone':_0x1ec906['options'][_0x8a16('0x8')]['phone']},'attributes':['id',_0x8a16('0x42')],'order':[['id',_0x8a16('0x43')]]})['then'](function(_0x5964a1){logger[_0x8a16('0xe')](_0x8a16('0x44'),_0x1ec906);logger['debug'](_0x8a16('0x44'),_0x1ec906,JSON[_0x8a16('0x14')](_0x5964a1));_0xe2b23b(_0x5964a1);})[_0x8a16('0x10')](function(_0x42f291){logger[_0x8a16('0x11')](_0x8a16('0x44'),_0x42f291['message'],_0x1ec906);_0x1d46f4(_0x489bce[_0x8a16('0x11')](0x1f4,_0x42f291[_0x8a16('0x15')]));});});};exports['ResetActiveCalls']=function(_0x10a21e){var _0xeead85=this;return new Promise(function(_0x2c0645,_0x1de92b){return db[_0x8a16('0x22')][_0x8a16('0x23')](function(_0x589754){var _0x6769f=_0x10a21e[_0x8a16('0x6')]&&_0x10a21e[_0x8a16('0x6')][_0x8a16('0x8')]?_0x10a21e[_0x8a16('0x6')]['where']:{};return db[_0x8a16('0x4')][_0x8a16('0x30')](_0x10a21e[_0x8a16('0x18')],{'where':_0x6769f,'transaction':_0x589754})[_0x8a16('0xd')](function(_0x4df608){logger[_0x8a16('0xe')]('ResetActiveCalls',_0x10a21e);logger['debug'](_0x8a16('0x45'),_0x10a21e,JSON['stringify'](_0x4df608));_0x2c0645(_0x4df608);})[_0x8a16('0x10')](function(_0x15087a){logger['error'](_0x8a16('0x45'),_0x15087a[_0x8a16('0x15')],_0x10a21e);_0x1de92b(_0xeead85[_0x8a16('0x11')](0x1f4,_0x15087a['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x469ad9){var _0x37ea7a=this;var _0x28b360=_0x469ad9['body']['where']['voiceQueueIds'];var _0x37e1fe=_0x469ad9['body'][_0x8a16('0x8')][_0x8a16('0x46')];var _0x1ce2fd=_0x469ad9[_0x8a16('0x18')]['where'][_0x8a16('0x47')];return new Promise(function(_0x238e01,_0xf6cc46){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x28b360},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0x8a16('0x48')+_0x37e1fe+_0x8a16('0x49')),'$gt':db[_0x8a16('0x22')][_0x8a16('0x3a')](_0x8a16('0x4a'))}},'UserId':{'$in':_0x1ce2fd}},'include':[{'model':db[_0x8a16('0x20')],'as':_0x8a16('0x27')},{'model':db['User'],'as':_0x8a16('0x2a'),'attributes':['id',_0x8a16('0x2b'),_0x8a16('0x2c')]},{'model':db[_0x8a16('0x4b')],'as':_0x8a16('0x4c')}]})['then'](function(_0x3cd6da){if(_0x3cd6da[_0x8a16('0x2d')]>0x0){return db['sequelize']['transaction'](function(_0x17f1b3){return db['CmHopper'][_0x8a16('0x30')]({'recallmeNotifiedDate':db['sequelize'][_0x8a16('0x3a')](_0x8a16('0x4a'))},{'where':{'id':{'$in':_[_0x8a16('0xb')](_0x3cd6da,'id')}},'transaction':_0x17f1b3})[_0x8a16('0xd')](function(){_0x238e01(_0x3cd6da);})[_0x8a16('0x10')](function(_0x5205d6){logger[_0x8a16('0x11')](_0x8a16('0x4d'),_0x5205d6[_0x8a16('0x15')],_0x469ad9);_0xf6cc46(_0x37ea7a['error'](0x1f4,_0x5205d6[_0x8a16('0x15')]));});})[_0x8a16('0x10')](function(_0x449500){logger['error'](_0x8a16('0x4d'),_0x449500[_0x8a16('0x15')],_0x469ad9);_0xf6cc46(_0x37ea7a[_0x8a16('0x11')](0x1f4,_0x449500['message']));});}else{_0x238e01(_0x3cd6da);}});});}; \ No newline at end of file +var _0xba8e=['keys','GetContactByPhone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','CmList','List','lodash','util','moment','bluebird','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','info','stringify','catch','error','message','find','then','debug','ShowCmHopper','CreateCmHopper','create','update','UpdateCmHopper','body','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','LOCK','Contact','User','Agent','name','voicePause','length','UserId','push','all','dataValues','active','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview'];(function(_0x3c662a,_0xa95e3d){var _0x53a747=function(_0x519b3a){while(--_0x519b3a){_0x3c662a['push'](_0x3c662a['shift']());}};_0x53a747(++_0xa95e3d);}(_0xba8e,0xa1));var _0xeba8=function(_0x33ad1f,_0xfc2fc8){_0x33ad1f=_0x33ad1f-0x0;var _0x26ef22=_0xba8e[_0x33ad1f];return _0x26ef22;};'use strict';var _=require(_0xeba8('0x0'));var util=require(_0xeba8('0x1'));var moment=require(_0xeba8('0x2'));var BPromise=require(_0xeba8('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xeba8('0x4'))('rpc');exports[_0xeba8('0x5')]=function(_0x40a757){var _0x3afa5c=this;return new Promise(function(_0x152f8b,_0x39d137){return db[_0xeba8('0x6')][_0xeba8('0x7')]({'raw':_0x40a757[_0xeba8('0x8')]?_0x40a757[_0xeba8('0x8')][_0xeba8('0x9')]===undefined?!![]:![]:!![],'where':_0x40a757['options']?_0x40a757[_0xeba8('0x8')][_0xeba8('0xa')]||null:null,'attributes':_0x40a757[_0xeba8('0x8')]?_0x40a757[_0xeba8('0x8')][_0xeba8('0xb')]||null:null,'limit':_0x40a757[_0xeba8('0x8')]?_0x40a757[_0xeba8('0x8')][_0xeba8('0xc')]||null:null,'include':_0x40a757[_0xeba8('0x8')]?_0x40a757[_0xeba8('0x8')][_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x40a757['options']['include'],function(_0x5b3b74){return{'model':db[_0x5b3b74[_0xeba8('0xf')]],'as':_0x5b3b74['as'],'attributes':_0x5b3b74[_0xeba8('0xb')],'include':_0x5b3b74['include']?_[_0xeba8('0xe')](_0x5b3b74[_0xeba8('0xd')],function(_0x3641ef){return{'model':db[_0x3641ef['model']],'as':_0x3641ef['as'],'attributes':_0x3641ef[_0xeba8('0xb')],'include':_0x3641ef[_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x3641ef[_0xeba8('0xd')],function(_0x5755a1){return{'model':db[_0x5755a1[_0xeba8('0xf')]],'as':_0x5755a1['as'],'attributes':_0x5755a1[_0xeba8('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x531d63){logger[_0xeba8('0x10')]('GetCmHopper',_0x40a757);logger['debug'](_0xeba8('0x5'),_0x40a757,JSON[_0xeba8('0x11')](_0x531d63));_0x152f8b(_0x531d63);})[_0xeba8('0x12')](function(_0x4eec0b){logger[_0xeba8('0x13')]('GetCmHopper',_0x4eec0b[_0xeba8('0x14')],_0x40a757);_0x39d137(_0x3afa5c[_0xeba8('0x13')](0x1f4,_0x4eec0b[_0xeba8('0x14')]));});});};exports['ShowCmHopper']=function(_0xf2c6aa){var _0x169dd7=this;return new Promise(function(_0xf43638,_0x257697){return db[_0xeba8('0x6')][_0xeba8('0x15')]({'raw':_0xf2c6aa[_0xeba8('0x8')]?_0xf2c6aa[_0xeba8('0x8')][_0xeba8('0x9')]===undefined?!![]:![]:!![],'where':_0xf2c6aa['options']?_0xf2c6aa['options'][_0xeba8('0xa')]||null:null,'attributes':_0xf2c6aa[_0xeba8('0x8')]?_0xf2c6aa[_0xeba8('0x8')][_0xeba8('0xb')]||null:null,'include':_0xf2c6aa['options']?_0xf2c6aa[_0xeba8('0x8')][_0xeba8('0xd')]?_[_0xeba8('0xe')](_0xf2c6aa['options']['include'],function(_0x272c40){return{'model':db[_0x272c40[_0xeba8('0xf')]],'as':_0x272c40['as'],'attributes':_0x272c40[_0xeba8('0xb')],'include':_0x272c40[_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x272c40['include'],function(_0x3edd8f){return{'model':db[_0x3edd8f[_0xeba8('0xf')]],'as':_0x3edd8f['as'],'attributes':_0x3edd8f['attributes'],'include':_0x3edd8f[_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x3edd8f[_0xeba8('0xd')],function(_0x9616c8){return{'model':db[_0x9616c8[_0xeba8('0xf')]],'as':_0x9616c8['as'],'attributes':_0x9616c8[_0xeba8('0xb')]};}):[]};}):[]};}):[]:[]})[_0xeba8('0x16')](function(_0x44053b){logger['info']('ShowCmHopper',_0xf2c6aa);logger[_0xeba8('0x17')](_0xeba8('0x18'),_0xf2c6aa,JSON['stringify'](_0x44053b));_0xf43638(_0x44053b);})[_0xeba8('0x12')](function(_0xbe98df){logger[_0xeba8('0x13')]('ShowCmHopper',_0xbe98df['message'],_0xf2c6aa);_0x257697(_0x169dd7[_0xeba8('0x13')](0x1f4,_0xbe98df[_0xeba8('0x14')]));});});};exports[_0xeba8('0x19')]=function(_0x7d41aa){var _0x49f434=this;return new Promise(function(_0x4851e1,_0x42f8f7){return db[_0xeba8('0x6')][_0xeba8('0x1a')](_0x7d41aa['body'],{'raw':_0x7d41aa['options']?_0x7d41aa[_0xeba8('0x8')][_0xeba8('0x9')]===undefined?!![]:![]:!![]})[_0xeba8('0x16')](function(_0x113863){logger[_0xeba8('0x10')](_0xeba8('0x19'),_0x7d41aa);logger[_0xeba8('0x17')](_0xeba8('0x19'),_0x7d41aa,JSON[_0xeba8('0x11')](_0x113863));_0x4851e1(_0x113863);})['catch'](function(_0x2a3c3){logger[_0xeba8('0x13')]('CreateCmHopper',_0x2a3c3[_0xeba8('0x14')],_0x7d41aa);_0x42f8f7(_0x49f434[_0xeba8('0x13')](0x1f4,_0x2a3c3[_0xeba8('0x14')]));});});};exports['UpdateCmHopper']=function(_0x352168){var _0x2cbc6b=this;return new Promise(function(_0x54f79b,_0x3b06d6){return db[_0xeba8('0x6')][_0xeba8('0x1b')](_0x352168['body'],{'raw':_0x352168[_0xeba8('0x8')]?_0x352168[_0xeba8('0x8')][_0xeba8('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x352168['options']?_0x352168[_0xeba8('0x8')][_0xeba8('0xa')]||null:null,'attributes':_0x352168[_0xeba8('0x8')]?_0x352168[_0xeba8('0x8')][_0xeba8('0xb')]||null:null,'limit':_0x352168[_0xeba8('0x8')]?_0x352168[_0xeba8('0x8')][_0xeba8('0xc')]||null:null})[_0xeba8('0x16')](function(_0xb5c551){logger[_0xeba8('0x10')](_0xeba8('0x1c'),_0x352168);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xeba8('0x11')](_0x352168['options'][_0xeba8('0xa')]),_0x352168[_0xeba8('0x1d')]['active']);logger['debug'](_0xeba8('0x1c'),_0x352168,JSON[_0xeba8('0x11')](_0xb5c551));_0x54f79b(_0xb5c551);})[_0xeba8('0x12')](function(_0x173e31){logger[_0xeba8('0x13')](_0xeba8('0x1c'),_0x173e31[_0xeba8('0x14')],_0x352168);_0x3b06d6(_0x2cbc6b[_0xeba8('0x13')](0x1f4,_0x173e31['message']));});});};exports['DestroyCmHopper']=function(_0x402b16){var _0x19997a=this;return new Promise(function(_0x400df8,_0x2ace7d){return db['CmHopper']['destroy']({'where':_0x402b16[_0xeba8('0x8')]?_0x402b16[_0xeba8('0x8')]['where']||null:null})[_0xeba8('0x16')](function(_0x2fffa6){logger[_0xeba8('0x10')](_0xeba8('0x1e'),_0x402b16);logger[_0xeba8('0x17')](_0xeba8('0x1e'),_0x402b16,JSON[_0xeba8('0x11')](_0x2fffa6));_0x400df8(_0x2fffa6);})[_0xeba8('0x12')](function(_0x27b312){logger['error']('DestroyCmHopper',_0x27b312[_0xeba8('0x14')],_0x402b16);_0x2ace7d(_0x19997a[_0xeba8('0x13')](0x1f4,_0x27b312[_0xeba8('0x14')]));});});};exports['GetContactDialer']=function(_0x7a224d){var _0x599a2c=this;return new Promise(function(_0x367350,_0x17a8c4){return db[_0xeba8('0x1f')][_0xeba8('0x20')]()['then'](function(_0x3036c1){return db[_0xeba8('0x21')][_0xeba8('0x22')](function(_0x1dba09){return db[_0xeba8('0x6')][_0xeba8('0x7')]({'where':_0x7a224d['options']?_0x7a224d[_0xeba8('0x8')][_0xeba8('0xa')]||null:null,'attributes':_0x7a224d['options']?_0x7a224d[_0xeba8('0x8')][_0xeba8('0xb')]||null:null,'limit':_0x7a224d[_0xeba8('0x8')]?_0x7a224d[_0xeba8('0x8')][_0xeba8('0xc')]||null:null,'order':_0x7a224d['options']?_0x7a224d['options'][_0xeba8('0x23')]||null:null,'transaction':_0x1dba09,'lock':_0x1dba09[_0xeba8('0x24')]['UPDATE'],'include':[{'model':db[_0xeba8('0x1f')],'as':_0xeba8('0x25'),'attributes':_['keys'](_0x3036c1)},{'model':db[_0xeba8('0x26')],'as':_0xeba8('0x27'),'attributes':['id',_0xeba8('0x28'),_0xeba8('0x29')]}]})[_0xeba8('0x16')](function(_0x594cd1){var _0x8e7776=[];var _0x535cae=[];for(var _0x1274d5=0x0;_0x1274d5<_0x594cd1[_0xeba8('0x2a')];_0x1274d5+=0x1){var _0x5e7e24=_0x594cd1[_0x1274d5][_0xeba8('0x2b')];if(_0x5e7e24===null){_0x8e7776['push'](_0x594cd1[_0x1274d5]['update'](_0x7a224d[_0xeba8('0x1d')],{'transaction':_0x1dba09}));}else if(!_0x535cae['includes'](_0x5e7e24)){_0x535cae[_0xeba8('0x2c')](_0x5e7e24);_0x8e7776[_0xeba8('0x2c')](_0x594cd1[_0x1274d5][_0xeba8('0x1b')](_0x7a224d['body'],{'transaction':_0x1dba09}));}}return BPromise[_0xeba8('0x2d')](_0x8e7776);});})[_0xeba8('0x16')](function(_0x10bec4){logger[_0xeba8('0x10')]('GetContactDialer',_0x7a224d);if(_0x10bec4[_0xeba8('0x2a')]>0x0){logger[_0xeba8('0x10')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x10bec4[0x0]['dataValues']['id'],_0x10bec4[0x0][_0xeba8('0x2e')]['ContactId'],_0x10bec4[0x0][_0xeba8('0x2e')][_0xeba8('0x2f')]);}logger[_0xeba8('0x17')](_0xeba8('0x30'),_0x7a224d,JSON[_0xeba8('0x11')](_0x10bec4));_0x367350(_0x10bec4);})[_0xeba8('0x12')](function(_0x51e1b4){logger[_0xeba8('0x13')](_0xeba8('0x30'),_0x51e1b4['message'],_0x7a224d);_0x17a8c4(_0x599a2c[_0xeba8('0x13')](0x1f4,_0x51e1b4['message']));});});});};exports[_0xeba8('0x31')]=function(_0x3ebbc9){var _0x44c82a=this;return new Promise(function(_0xcd6e2,_0x5f579b){return db[_0xeba8('0x21')][_0xeba8('0x22')](function(_0x4d59ed){return db[_0xeba8('0x32')][_0xeba8('0x1a')](_0x3ebbc9['body'],{'raw':_0x3ebbc9[_0xeba8('0x8')]?_0x3ebbc9[_0xeba8('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4d59ed})['then'](function(){logger[_0xeba8('0x10')](_0xeba8('0x33'),JSON['stringify'](_0x3ebbc9[_0xeba8('0x8')][_0xeba8('0xa')]),_0x3ebbc9[_0xeba8('0x8')][_0xeba8('0xa')]['active']);return db[_0xeba8('0x6')]['destroy']({'where':_0x3ebbc9['options']?_0x3ebbc9['options']['where']||null:null,'transaction':_0x4d59ed});});})[_0xeba8('0x16')](function(_0x506092){logger[_0xeba8('0x10')]('MoveContactManagedDialer',_0x3ebbc9);logger[_0xeba8('0x17')](_0xeba8('0x31'),_0x3ebbc9,JSON[_0xeba8('0x11')](_0x506092));_0xcd6e2(_0x506092);})[_0xeba8('0x12')](function(_0x231cd0){logger['error'](_0xeba8('0x31'),_0x231cd0[_0xeba8('0x14')],_0x3ebbc9);_0x5f579b(_0x44c82a['error'](0x1f4,_0x231cd0[_0xeba8('0x14')]));});});};exports[_0xeba8('0x34')]=function(_0x4ac807){var _0x4bca58=this;return new Promise(function(_0x37fc37,_0x3d7724){return db['CmHopper'][_0xeba8('0x7')]({'raw':_0x4ac807[_0xeba8('0x8')]?_0x4ac807[_0xeba8('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x4ac807[_0xeba8('0x8')]?_0x4ac807['options']['where']||null:null,'attributes':[[db[_0xeba8('0x21')]['fn']('COUNT',db[_0xeba8('0x21')]['fn']('IF',db[_0xeba8('0x21')][_0xeba8('0x35')](_0xeba8('0x36')+util['format'](_0xeba8('0x37'),moment()[_0xeba8('0x38')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xeba8('0x39')))),_0xeba8('0x3a')]]})['then'](function(_0x2dcbc2){logger[_0xeba8('0x10')](_0xeba8('0x34'),_0x4ac807);logger[_0xeba8('0x17')](_0xeba8('0x34'),_0x4ac807,JSON['stringify'](_0x2dcbc2));_0x37fc37(_0x2dcbc2);})[_0xeba8('0x12')](function(_0x1121c2){logger[_0xeba8('0x13')](_0xeba8('0x34'),_0x1121c2['message'],_0x4ac807);_0x3d7724(_0x4bca58[_0xeba8('0x13')](0x1f4,_0x1121c2['message']));});});};exports[_0xeba8('0x3b')]=function(_0x22c81c){var _0xf545b2=this;return new Promise(function(_0x440f1e,_0x2e55bb){return db[_0xeba8('0x1f')]['describe']()[_0xeba8('0x16')](function(){return db['sequelize'][_0xeba8('0x22')](function(_0x18b3f1){return db[_0xeba8('0x6')][_0xeba8('0x7')]({'where':_0x22c81c[_0xeba8('0x8')]?_0x22c81c['options'][_0xeba8('0xa')]||null:null,'attributes':_0x22c81c[_0xeba8('0x8')]?_0x22c81c[_0xeba8('0x8')][_0xeba8('0xb')]||null:null,'limit':0x1,'order':_0x22c81c[_0xeba8('0x8')]?_0x22c81c[_0xeba8('0x8')][_0xeba8('0x23')]||null:null,'group':db[_0xeba8('0x6')][_0xeba8('0x2b')],'transaction':_0x18b3f1,'lock':_0x18b3f1[_0xeba8('0x24')]['UPDATE'],'include':_0x22c81c[_0xeba8('0x8')]?_0x22c81c[_0xeba8('0x8')][_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x22c81c[_0xeba8('0x8')]['include'],function(_0x428230){return{'model':db[_0x428230['model']],'as':_0x428230['as'],'attributes':_0x428230[_0xeba8('0xb')],'include':_0x428230[_0xeba8('0xd')]?_['map'](_0x428230[_0xeba8('0xd')],function(_0x4b86dc){return{'model':db[_0x4b86dc[_0xeba8('0xf')]],'as':_0x4b86dc['as'],'attributes':_0x4b86dc[_0xeba8('0xb')],'include':_0x4b86dc[_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x4b86dc[_0xeba8('0xd')],function(_0x3fa88f){return{'model':db[_0x3fa88f['model']],'as':_0x3fa88f['as'],'attributes':_0x3fa88f[_0xeba8('0xb')]};}):[]};}):[]};}):[]:[]})[_0xeba8('0x16')](function(_0xa2911e){var _0x207714=[];for(var _0x447cfa=0x0;_0x447cfa<_0xa2911e[_0xeba8('0x2a')];_0x447cfa+=0x1){_0x207714['push'](_0xa2911e[_0x447cfa][_0xeba8('0x1b')](_0x22c81c[_0xeba8('0x1d')],{'transaction':_0x18b3f1}));}return BPromise[_0xeba8('0x2d')](_0x207714);});})[_0xeba8('0x16')](function(_0x2aaf6e){logger[_0xeba8('0x10')](_0xeba8('0x3b'),_0x22c81c);logger[_0xeba8('0x17')](_0xeba8('0x3b'),_0x22c81c,JSON['stringify'](_0x2aaf6e));_0x440f1e(_0x2aaf6e);})['catch'](function(_0x2de9d6){logger[_0xeba8('0x13')](_0xeba8('0x3b'),_0x2de9d6[_0xeba8('0x14')],_0x22c81c);_0x2e55bb(_0xf545b2[_0xeba8('0x13')](0x1f4,_0x2de9d6[_0xeba8('0x14')]));});});});};exports[_0xeba8('0x3c')]=function(_0x558e94){var _0x570a23=this;return new Promise(function(_0x1740fe,_0x198ac4){db[_0xeba8('0x1f')][_0xeba8('0x20')]()[_0xeba8('0x16')](function(_0x8b059){return db[_0xeba8('0x6')][_0xeba8('0x7')]({'raw':_0x558e94[_0xeba8('0x8')]?_0x558e94[_0xeba8('0x8')][_0xeba8('0x9')]===undefined?!![]:![]:!![],'where':_0x558e94[_0xeba8('0x8')]?_0x558e94['options'][_0xeba8('0xa')]||null:null,'attributes':_0x558e94[_0xeba8('0x8')]?_0x558e94[_0xeba8('0x8')]['attributes']||null:null,'limit':_0x558e94['options']?_0x558e94[_0xeba8('0x8')][_0xeba8('0xc')]||null:null,'include':_0x558e94[_0xeba8('0x8')]?_0x558e94[_0xeba8('0x8')][_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x558e94[_0xeba8('0x8')][_0xeba8('0xd')],function(_0x45a1f5){return{'model':db[_0x45a1f5[_0xeba8('0xf')]],'as':_0x45a1f5['as'],'attributes':_0x45a1f5['as']==='Contact'?_[_0xeba8('0x3d')](_0x8b059):_0x45a1f5[_0xeba8('0xb')],'include':_0x45a1f5[_0xeba8('0xd')]?_[_0xeba8('0xe')](_0x45a1f5[_0xeba8('0xd')],function(_0x7757e9){return{'model':db[_0x7757e9[_0xeba8('0xf')]],'as':_0x7757e9['as'],'attributes':_0x7757e9[_0xeba8('0xb')],'include':_0x7757e9[_0xeba8('0xd')]?_['map'](_0x7757e9[_0xeba8('0xd')],function(_0x4d3f86){return{'model':db[_0x4d3f86[_0xeba8('0xf')]],'as':_0x4d3f86['as'],'attributes':_0x4d3f86[_0xeba8('0xb')]};}):[]};}):[]};}):[]:[]})[_0xeba8('0x16')](function(_0x9ae7eb){logger[_0xeba8('0x10')](_0xeba8('0x5'),_0x558e94);logger[_0xeba8('0x17')](_0xeba8('0x5'),_0x558e94,JSON[_0xeba8('0x11')](_0x9ae7eb));_0x1740fe(_0x9ae7eb);})[_0xeba8('0x12')](function(_0x4f16a5){logger[_0xeba8('0x13')](_0xeba8('0x5'),_0x4f16a5['message'],_0x558e94);_0x198ac4(_0x570a23[_0xeba8('0x13')](0x1f4,_0x4f16a5[_0xeba8('0x14')]));});});});};exports[_0xeba8('0x3e')]=function(_0x2cab4c){var _0x5aa0d4=this;return new Promise(function(_0x213d63,_0x5a55eb){return db[_0xeba8('0x1f')]['findOne']({'raw':!![],'where':{'phone':_0x2cab4c[_0xeba8('0x8')][_0xeba8('0xa')]['phone']},'attributes':['id',_0xeba8('0x3f')],'order':[['id',_0xeba8('0x40')]]})[_0xeba8('0x16')](function(_0x2c1748){logger[_0xeba8('0x10')]('getContactByPhone',_0x2cab4c);logger[_0xeba8('0x17')]('getContactByPhone',_0x2cab4c,JSON[_0xeba8('0x11')](_0x2c1748));_0x213d63(_0x2c1748);})['catch'](function(_0x4b5bab){logger[_0xeba8('0x13')](_0xeba8('0x41'),_0x4b5bab[_0xeba8('0x14')],_0x2cab4c);_0x5a55eb(_0x5aa0d4['error'](0x1f4,_0x4b5bab[_0xeba8('0x14')]));});});};exports[_0xeba8('0x42')]=function(_0x68dfe3){var _0x3f88e6=this;return new Promise(function(_0x2280dc,_0x44d2ce){return db[_0xeba8('0x21')][_0xeba8('0x22')](function(_0x1cce6f){var _0x20e774=_0x68dfe3[_0xeba8('0x8')]&&_0x68dfe3['options']['where']?_0x68dfe3[_0xeba8('0x8')]['where']:{};return db[_0xeba8('0x6')][_0xeba8('0x1b')](_0x68dfe3[_0xeba8('0x1d')],{'where':_0x20e774,'transaction':_0x1cce6f})[_0xeba8('0x16')](function(_0x5d1072){logger[_0xeba8('0x10')](_0xeba8('0x42'),_0x68dfe3);logger[_0xeba8('0x17')]('ResetActiveCalls',_0x68dfe3,JSON[_0xeba8('0x11')](_0x5d1072));_0x2280dc(_0x5d1072);})[_0xeba8('0x12')](function(_0x2fb8e7){logger[_0xeba8('0x13')](_0xeba8('0x42'),_0x2fb8e7[_0xeba8('0x14')],_0x68dfe3);_0x44d2ce(_0x3f88e6['error'](0x1f4,_0x2fb8e7[_0xeba8('0x14')]));});});});};exports[_0xeba8('0x43')]=function(_0x446e8e){var _0x1e50d2=this;var _0x4d097d=_0x446e8e[_0xeba8('0x1d')][_0xeba8('0xa')][_0xeba8('0x44')];var _0x186636=_0x446e8e[_0xeba8('0x1d')][_0xeba8('0xa')]['interval'];var _0x1419af=_0x446e8e[_0xeba8('0x1d')]['where'][_0xeba8('0x45')];return new Promise(function(_0xa2d594,_0x41cbff){return db[_0xeba8('0x6')][_0xeba8('0x7')]({'where':{'voiceQueueId':{'$in':_0x4d097d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xeba8('0x21')][_0xeba8('0x35')](_0xeba8('0x46')+_0x186636+'\x20MINUTE'),'$gt':db['sequelize'][_0xeba8('0x35')](_0xeba8('0x47'))}},'UserId':{'$in':_0x1419af}},'include':[{'model':db['CmContact'],'as':_0xeba8('0x25')},{'model':db[_0xeba8('0x26')],'as':'Agent','attributes':['id','name',_0xeba8('0x29')]},{'model':db[_0xeba8('0x48')],'as':_0xeba8('0x49')}]})['then'](function(_0x4b907e){if(_0x4b907e[_0xeba8('0x2a')]>0x0){return db[_0xeba8('0x21')][_0xeba8('0x22')](function(_0x1def49){return db[_0xeba8('0x6')][_0xeba8('0x1b')]({'recallmeNotifiedDate':db[_0xeba8('0x21')][_0xeba8('0x35')](_0xeba8('0x47'))},{'where':{'id':{'$in':_[_0xeba8('0xe')](_0x4b907e,'id')}},'transaction':_0x1def49})[_0xeba8('0x16')](function(){_0xa2d594(_0x4b907e);})[_0xeba8('0x12')](function(_0xad5d4f){logger[_0xeba8('0x13')](_0xeba8('0x43'),_0xad5d4f[_0xeba8('0x14')],_0x446e8e);_0x41cbff(_0x1e50d2['error'](0x1f4,_0xad5d4f[_0xeba8('0x14')]));});})[_0xeba8('0x12')](function(_0x291b64){logger[_0xeba8('0x13')](_0xeba8('0x43'),_0x291b64[_0xeba8('0x14')],_0x446e8e);_0x41cbff(_0x1e50d2['error'](0x1f4,_0x291b64[_0xeba8('0x14')]));});}else{_0xa2d594(_0x4b907e);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index db6df0b..fc8c955 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 _0xa54d=['delete','exports','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/timezones','/:id','/:id/previewrecall','create','post','/preview','getPreview','/timezone','getTimezone'];(function(_0x42b896,_0x415869){var _0x506fa9=function(_0x39b05b){while(--_0x39b05b){_0x42b896['push'](_0x42b896['shift']());}};_0x506fa9(++_0x415869);}(_0xa54d,0xb6));var _0xda54=function(_0x4116a1,_0x436f94){_0x4116a1=_0x4116a1-0x0;var _0xd22e12=_0xa54d[_0x4116a1];return _0xd22e12;};'use strict';var express=require(_0xda54('0x0'));var router=express['Router']();var auth=require(_0xda54('0x1'));var controller=require(_0xda54('0x2'));router[_0xda54('0x3')]('/',auth[_0xda54('0x4')](),controller[_0xda54('0x5')]);router[_0xda54('0x3')](_0xda54('0x6'),auth[_0xda54('0x4')](),controller['describe']);router['get'](_0xda54('0x7'),auth[_0xda54('0x4')](),controller[_0xda54('0x8')]);router[_0xda54('0x3')](_0xda54('0x9'),auth[_0xda54('0x4')](),controller['getTimezones']);router[_0xda54('0x3')](_0xda54('0xa'),auth[_0xda54('0x4')](),controller['show']);router['get'](_0xda54('0xb'),auth[_0xda54('0x4')](),controller['getPreviewRecall']);router['post']('/',auth['isAuthenticated'](),controller[_0xda54('0xc')]);router[_0xda54('0xd')](_0xda54('0xe'),auth['isAuthenticated'](),controller[_0xda54('0xf')]);router[_0xda54('0xd')](_0xda54('0x10'),auth[_0xda54('0x4')](),controller[_0xda54('0x11')]);router['put'](_0xda54('0xa'),auth[_0xda54('0x4')](),controller['update']);router[_0xda54('0x12')](_0xda54('0xa'),auth[_0xda54('0x4')](),controller['destroy']);module[_0xda54('0x13')]=router; \ No newline at end of file +var _0xf3ac=['/describe','isAuthenticated','describe','get','/opencontacts','getOpenContacts','/timezones','show','/:id/previewrecall','post','create','/preview','/timezone','getTimezone','put','/:id','update','exports','express','Router','../../components/auth/service','index'];(function(_0x4d2a56,_0x4aa8a5){var _0x55752b=function(_0x284368){while(--_0x284368){_0x4d2a56['push'](_0x4d2a56['shift']());}};_0x55752b(++_0x4aa8a5);}(_0xf3ac,0x172));var _0xcf3a=function(_0x29c4a6,_0x10a15f){_0x29c4a6=_0x29c4a6-0x0;var _0x39abd=_0xf3ac[_0x29c4a6];return _0x39abd;};'use strict';var express=require(_0xcf3a('0x0'));var router=express[_0xcf3a('0x1')]();var auth=require(_0xcf3a('0x2'));var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcf3a('0x3')]);router['get'](_0xcf3a('0x4'),auth[_0xcf3a('0x5')](),controller[_0xcf3a('0x6')]);router[_0xcf3a('0x7')](_0xcf3a('0x8'),auth[_0xcf3a('0x5')](),controller[_0xcf3a('0x9')]);router[_0xcf3a('0x7')](_0xcf3a('0xa'),auth[_0xcf3a('0x5')](),controller['getTimezones']);router[_0xcf3a('0x7')]('/:id',auth[_0xcf3a('0x5')](),controller[_0xcf3a('0xb')]);router['get'](_0xcf3a('0xc'),auth[_0xcf3a('0x5')](),controller['getPreviewRecall']);router[_0xcf3a('0xd')]('/',auth[_0xcf3a('0x5')](),controller[_0xcf3a('0xe')]);router[_0xcf3a('0xd')](_0xcf3a('0xf'),auth['isAuthenticated'](),controller['getPreview']);router[_0xcf3a('0xd')](_0xcf3a('0x10'),auth[_0xcf3a('0x5')](),controller[_0xcf3a('0x11')]);router[_0xcf3a('0x12')](_0xcf3a('0x13'),auth['isAuthenticated'](),controller[_0xcf3a('0x14')]);router['delete'](_0xcf3a('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xcf3a('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index e9ecf91..e1b2901 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a6=['sequelize','INTEGER','DATE','moment'];(function(_0xd9a2d4,_0x790d61){var _0x33c64f=function(_0x2f107e){while(--_0x2f107e){_0xd9a2d4['push'](_0xd9a2d4['shift']());}};_0x33c64f(++_0x790d61);}(_0x98a6,0x1df));var _0x698a=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x98a6[_0x2b10c6];return _0x3789d2;};'use strict';var moment=require(_0x698a('0x0'));var Sequelize=require(_0x698a('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x698a('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x698a('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x698a('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x698a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x698a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x698a('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x698a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x698a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x49ea=['sequelize','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f4aa6,_0x2ed693){var _0x4b4c0a=function(_0x49ac08){while(--_0x49ac08){_0x3f4aa6['push'](_0x3f4aa6['shift']());}};_0x4b4c0a(++_0x2ed693);}(_0x49ea,0x1d4));var _0xa49e=function(_0x4d7333,_0x27661f){_0x4d7333=_0x4d7333-0x0;var _0x45453c=_0x49ea[_0x4d7333];return _0x45453c;};'use strict';var moment=require('moment');var Sequelize=require(_0xa49e('0x0'));module['exports']={'CmHopperId':{'type':Sequelize[_0xa49e('0x1')]},'phone':{'type':Sequelize[_0xa49e('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa49e('0x3')],'defaultValue':moment()[_0xa49e('0x4')](_0xa49e('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa49e('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa49e('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa49e('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa49e('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa49e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 543d924..24ad31b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd483=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','sendStatus','name','send','index','map','CmHopperAdditionalPhone','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0xe087c9,_0xd1ec1f){var _0x38672a=function(_0xb31467){while(--_0xb31467){_0xe087c9['push'](_0xe087c9['shift']());}};_0x38672a(++_0xd1ec1f);}(_0xd483,0x1e4));var _0x3d48=function(_0x3fd6ad,_0x543ab2){_0x3fd6ad=_0x3fd6ad-0x0;var _0x1048b7=_0xd483[_0x3fd6ad];return _0x1048b7;};'use strict';var emlformat=require(_0x3d48('0x0'));var rimraf=require(_0x3d48('0x1'));var zipdir=require(_0x3d48('0x2'));var jsonpatch=require(_0x3d48('0x3'));var rp=require(_0x3d48('0x4'));var moment=require(_0x3d48('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3d48('0x6'));var util=require('util');var path=require(_0x3d48('0x7'));var sox=require('sox');var csv=require(_0x3d48('0x8'));var ejs=require(_0x3d48('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3d48('0xa'));var crypto=require(_0x3d48('0xb'));var jsforce=require(_0x3d48('0xc'));var deskjs=require(_0x3d48('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3d48('0xe'));var Papa=require(_0x3d48('0xf'));var Redis=require('ioredis');var authService=require(_0x3d48('0x10'));var qs=require(_0x3d48('0x11'));var as=require(_0x3d48('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d48('0x13'))(_0x3d48('0x14'));var utils=require('../../config/utils');var config=require(_0x3d48('0x15'));var licenseUtil=require(_0x3d48('0x16'));var db=require(_0x3d48('0x17'))['db'];function respondWithStatusCode(_0x412697,_0x360966){_0x360966=_0x360966||0xcc;return function(_0x632a30){if(_0x632a30){return _0x412697['sendStatus'](_0x360966);}return _0x412697[_0x3d48('0x18')](_0x360966)[_0x3d48('0x19')]();};}function respondWithResult(_0x397ede,_0x28b773){_0x28b773=_0x28b773||0xc8;return function(_0x1dd735){if(_0x1dd735){return _0x397ede[_0x3d48('0x18')](_0x28b773)[_0x3d48('0x1a')](_0x1dd735);}};}function respondWithFilteredResult(_0x420981,_0xaccad){return function(_0x558ba5){if(_0x558ba5){var _0x20a439=typeof _0xaccad['offset']===_0x3d48('0x1b')&&typeof _0xaccad[_0x3d48('0x1c')]===_0x3d48('0x1b');var _0x48a651=_0x558ba5[_0x3d48('0x1d')];var _0x6a30d4=_0x20a439?0x0:_0xaccad[_0x3d48('0x1e')];var _0xd2fecb=_0x20a439?_0x558ba5[_0x3d48('0x1d')]:_0xaccad[_0x3d48('0x1e')]+_0xaccad[_0x3d48('0x1c')];var _0x167352;if(_0xd2fecb>=_0x48a651){_0xd2fecb=_0x48a651;_0x167352=0xc8;}else{_0x167352=0xce;}_0x420981['status'](_0x167352);return _0x420981[_0x3d48('0x1f')]('Content-Range',_0x6a30d4+'-'+_0xd2fecb+'/'+_0x48a651)['json'](_0x558ba5);}return null;};}function patchUpdates(_0x1dfe1d){return function(_0x21d53b){try{jsonpatch[_0x3d48('0x20')](_0x21d53b,_0x1dfe1d,!![]);}catch(_0x46a21d){return BPromise[_0x3d48('0x21')](_0x46a21d);}return _0x21d53b[_0x3d48('0x22')]();};}function saveUpdates(_0x2fe597,_0x431461){return function(_0x56117c){if(_0x56117c){return _0x56117c[_0x3d48('0x23')](_0x2fe597)[_0x3d48('0x24')](function(_0x3b251e){return _0x3b251e;});}return null;};}function removeEntity(_0xf26091,_0x2505be){return function(_0x4d467e){if(_0x4d467e){return _0x4d467e['destroy']()[_0x3d48('0x24')](function(){var _0xa3a0b1=_0x4d467e[_0x3d48('0x25')]({'plain':!![]});var _0x2f2977=_0x3d48('0x26');return db[_0x3d48('0x27')][_0x3d48('0x28')]({'where':{'type':_0x2f2977,'resourceId':_0xa3a0b1['id']}})[_0x3d48('0x24')](function(){return _0x4d467e;});})[_0x3d48('0x24')](function(){_0xf26091[_0x3d48('0x18')](0xcc)[_0x3d48('0x19')]();});}};}function handleEntityNotFound(_0x409f80,_0x1096c3){return function(_0x1e5fec){if(!_0x1e5fec){_0x409f80[_0x3d48('0x29')](0x194);}return _0x1e5fec;};}function handleError(_0x1021ca,_0x4a8890){_0x4a8890=_0x4a8890||0x1f4;return function(_0x316188){logger['error'](_0x316188['stack']);if(_0x316188[_0x3d48('0x2a')]){delete _0x316188[_0x3d48('0x2a')];}_0x1021ca[_0x3d48('0x18')](_0x4a8890)[_0x3d48('0x2b')](_0x316188);};}exports[_0x3d48('0x2c')]=function(_0x11a34b,_0x5b5946){var _0x2072db={},_0x2d0d4d={},_0x2d2cd0={'count':0x0,'rows':[]};var _0x246bfd=_[_0x3d48('0x2d')](db[_0x3d48('0x2e')]['rawAttributes'],function(_0x4623ae){return{'name':_0x4623ae[_0x3d48('0x2f')],'type':_0x4623ae[_0x3d48('0x30')][_0x3d48('0x31')]};});_0x2d0d4d[_0x3d48('0x32')]=_[_0x3d48('0x2d')](_0x246bfd,_0x3d48('0x2a'));_0x2d0d4d[_0x3d48('0x33')]=_[_0x3d48('0x34')](_0x11a34b[_0x3d48('0x33')]);_0x2d0d4d['filters']=_[_0x3d48('0x35')](_0x2d0d4d[_0x3d48('0x32')],_0x2d0d4d[_0x3d48('0x33')]);_0x2072db[_0x3d48('0x36')]=_[_0x3d48('0x35')](_0x2d0d4d[_0x3d48('0x32')],qs['fields'](_0x11a34b['query'][_0x3d48('0x37')]));_0x2072db[_0x3d48('0x36')]=_0x2072db[_0x3d48('0x36')][_0x3d48('0x38')]?_0x2072db[_0x3d48('0x36')]:_0x2d0d4d[_0x3d48('0x32')];if(!_0x11a34b[_0x3d48('0x33')]['hasOwnProperty'](_0x3d48('0x39'))){_0x2072db[_0x3d48('0x1c')]=qs[_0x3d48('0x1c')](_0x11a34b[_0x3d48('0x33')][_0x3d48('0x1c')]);_0x2072db[_0x3d48('0x1e')]=qs[_0x3d48('0x1e')](_0x11a34b['query'][_0x3d48('0x1e')]);}_0x2072db[_0x3d48('0x3a')]=qs[_0x3d48('0x3b')](_0x11a34b[_0x3d48('0x33')][_0x3d48('0x3b')]);_0x2072db[_0x3d48('0x3c')]=qs[_0x3d48('0x3d')](_[_0x3d48('0x3e')](_0x11a34b['query'],_0x2d0d4d[_0x3d48('0x3d')]),_0x246bfd);if(_0x11a34b[_0x3d48('0x33')][_0x3d48('0x3f')]){_0x2072db[_0x3d48('0x3c')]=_[_0x3d48('0x40')](_0x2072db['where'],{'$or':_[_0x3d48('0x2d')](_0x246bfd,function(_0x1d914d){if(_0x1d914d[_0x3d48('0x30')]!=='VIRTUAL'){var _0x2c7b2a={};_0x2c7b2a[_0x1d914d['name']]={'$like':'%'+_0x11a34b[_0x3d48('0x33')][_0x3d48('0x3f')]+'%'};return _0x2c7b2a;}})});}_0x2072db=_['merge']({},_0x2072db,_0x11a34b[_0x3d48('0x41')]);var _0x33bffe={'where':_0x2072db[_0x3d48('0x3c')]};return db[_0x3d48('0x2e')][_0x3d48('0x1d')](_0x33bffe)[_0x3d48('0x24')](function(_0x5cf866){_0x2d2cd0[_0x3d48('0x1d')]=_0x5cf866;if(_0x11a34b[_0x3d48('0x33')][_0x3d48('0x42')]){_0x2072db[_0x3d48('0x43')]=[{'all':!![]}];}return db[_0x3d48('0x2e')]['findAll'](_0x2072db);})[_0x3d48('0x24')](function(_0x53fa1f){_0x2d2cd0[_0x3d48('0x44')]=_0x53fa1f;return _0x2d2cd0;})['then'](respondWithFilteredResult(_0x5b5946,_0x2072db))['catch'](handleError(_0x5b5946,null));};exports[_0x3d48('0x45')]=function(_0x2ad736,_0x1e1c0e){var _0x34f053={'raw':!![],'where':{'id':_0x2ad736[_0x3d48('0x46')]['id']}},_0x288dbf={};_0x288dbf['model']=_[_0x3d48('0x34')](db[_0x3d48('0x2e')][_0x3d48('0x47')]);_0x288dbf[_0x3d48('0x33')]=_[_0x3d48('0x34')](_0x2ad736[_0x3d48('0x33')]);_0x288dbf[_0x3d48('0x3d')]=_['intersection'](_0x288dbf[_0x3d48('0x32')],_0x288dbf[_0x3d48('0x33')]);_0x34f053[_0x3d48('0x36')]=_[_0x3d48('0x35')](_0x288dbf['model'],qs[_0x3d48('0x37')](_0x2ad736[_0x3d48('0x33')]['fields']));_0x34f053[_0x3d48('0x36')]=_0x34f053[_0x3d48('0x36')][_0x3d48('0x38')]?_0x34f053[_0x3d48('0x36')]:_0x288dbf[_0x3d48('0x32')];if(_0x2ad736['query'][_0x3d48('0x42')]){_0x34f053[_0x3d48('0x43')]=[{'all':!![]}];}_0x34f053=_['merge']({},_0x34f053,_0x2ad736['options']);return db[_0x3d48('0x2e')][_0x3d48('0x48')](_0x34f053)[_0x3d48('0x24')](handleEntityNotFound(_0x1e1c0e,null))['then'](respondWithResult(_0x1e1c0e,null))[_0x3d48('0x49')](handleError(_0x1e1c0e,null));};exports['create']=function(_0x54b39c,_0x24e3f5){return db[_0x3d48('0x2e')]['create'](_0x54b39c[_0x3d48('0x4a')],{})[_0x3d48('0x24')](function(_0x23ce21){var _0x59da39=_0x54b39c[_0x3d48('0x4b')][_0x3d48('0x25')]({'plain':!![]});if(!_0x59da39)throw new Error(_0x3d48('0x4c'));if(_0x59da39['role']==='user'){var _0x5ec1a2=_0x23ce21[_0x3d48('0x25')]({'plain':!![]});var _0x1e249b=_0x3d48('0x26');return db[_0x3d48('0x4d')][_0x3d48('0x48')]({'where':{'name':_0x1e249b,'userProfileId':_0x59da39[_0x3d48('0x4e')]},'raw':!![]})['then'](function(_0x339f7d){if(_0x339f7d&&_0x339f7d[_0x3d48('0x4f')]===0x0){return db['UserProfileResource'][_0x3d48('0x50')]({'name':_0x5ec1a2[_0x3d48('0x2a')],'resourceId':_0x5ec1a2['id'],'type':_0x339f7d['name'],'sectionId':_0x339f7d['id']},{})[_0x3d48('0x24')](function(){return _0x23ce21;});}else{return _0x23ce21;}})['catch'](function(_0x1d29f1){logger[_0x3d48('0x51')](_0x3d48('0x52'),_0x1d29f1);throw _0x1d29f1;});}return _0x23ce21;})[_0x3d48('0x24')](respondWithResult(_0x24e3f5,0xc9))[_0x3d48('0x49')](handleError(_0x24e3f5,null));};exports['update']=function(_0x5b7ba0,_0x19a8a8){if(_0x5b7ba0[_0x3d48('0x4a')]['id']){delete _0x5b7ba0['body']['id'];}return db[_0x3d48('0x2e')][_0x3d48('0x48')]({'where':{'id':_0x5b7ba0[_0x3d48('0x46')]['id']}})['then'](handleEntityNotFound(_0x19a8a8,null))[_0x3d48('0x24')](saveUpdates(_0x5b7ba0[_0x3d48('0x4a')],null))['then'](respondWithResult(_0x19a8a8,null))['catch'](handleError(_0x19a8a8,null));};exports[_0x3d48('0x28')]=function(_0x1e1470,_0x1d8ce4){return db[_0x3d48('0x2e')][_0x3d48('0x48')]({'where':{'id':_0x1e1470['params']['id']}})[_0x3d48('0x24')](handleEntityNotFound(_0x1d8ce4,null))[_0x3d48('0x24')](removeEntity(_0x1d8ce4,null))[_0x3d48('0x49')](handleError(_0x1d8ce4,null));}; \ No newline at end of file +var _0x3339=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','params','intersection','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv'];(function(_0x2b079b,_0x1db7eb){var _0x360db2=function(_0xe9b331){while(--_0xe9b331){_0x2b079b['push'](_0x2b079b['shift']());}};_0x360db2(++_0x1db7eb);}(_0x3339,0x1f0));var _0x9333=function(_0x32bad1,_0x5b8bc5){_0x32bad1=_0x32bad1-0x0;var _0x1af393=_0x3339[_0x32bad1];return _0x1af393;};'use strict';var emlformat=require(_0x9333('0x0'));var rimraf=require(_0x9333('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9333('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9333('0x3'));var Mustache=require('mustache');var util=require(_0x9333('0x4'));var path=require(_0x9333('0x5'));var sox=require(_0x9333('0x6'));var csv=require(_0x9333('0x7'));var ejs=require(_0x9333('0x8'));var fs=require('fs');var fs_extra=require(_0x9333('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9333('0xa'));var jsforce=require(_0x9333('0xb'));var deskjs=require(_0x9333('0xc'));var toCsv=require(_0x9333('0x7'));var querystring=require(_0x9333('0xd'));var Papa=require(_0x9333('0xe'));var Redis=require('ioredis');var authService=require(_0x9333('0xf'));var qs=require(_0x9333('0x10'));var as=require(_0x9333('0x11'));var hardwareService=require(_0x9333('0x12'));var logger=require(_0x9333('0x13'))(_0x9333('0x14'));var utils=require('../../config/utils');var config=require(_0x9333('0x15'));var licenseUtil=require(_0x9333('0x16'));var db=require(_0x9333('0x17'))['db'];function respondWithStatusCode(_0x40d32b,_0x46d96f){_0x46d96f=_0x46d96f||0xcc;return function(_0x5b2e77){if(_0x5b2e77){return _0x40d32b[_0x9333('0x18')](_0x46d96f);}return _0x40d32b[_0x9333('0x19')](_0x46d96f)[_0x9333('0x1a')]();};}function respondWithResult(_0x9d0957,_0x52aef7){_0x52aef7=_0x52aef7||0xc8;return function(_0x7c2a59){if(_0x7c2a59){return _0x9d0957[_0x9333('0x19')](_0x52aef7)['json'](_0x7c2a59);}};}function respondWithFilteredResult(_0x2b9418,_0x4197b6){return function(_0x2b837c){if(_0x2b837c){var _0x11da8f=typeof _0x4197b6[_0x9333('0x1b')]==='undefined'&&typeof _0x4197b6[_0x9333('0x1c')]===_0x9333('0x1d');var _0x38d781=_0x2b837c[_0x9333('0x1e')];var _0x57b9d8=_0x11da8f?0x0:_0x4197b6[_0x9333('0x1b')];var _0x1d1f2c=_0x11da8f?_0x2b837c[_0x9333('0x1e')]:_0x4197b6[_0x9333('0x1b')]+_0x4197b6[_0x9333('0x1c')];var _0x31ee73;if(_0x1d1f2c>=_0x38d781){_0x1d1f2c=_0x38d781;_0x31ee73=0xc8;}else{_0x31ee73=0xce;}_0x2b9418['status'](_0x31ee73);return _0x2b9418[_0x9333('0x1f')](_0x9333('0x20'),_0x57b9d8+'-'+_0x1d1f2c+'/'+_0x38d781)['json'](_0x2b837c);}return null;};}function patchUpdates(_0x2dec02){return function(_0x6ceaf){try{jsonpatch['apply'](_0x6ceaf,_0x2dec02,!![]);}catch(_0x88217c){return BPromise[_0x9333('0x21')](_0x88217c);}return _0x6ceaf[_0x9333('0x22')]();};}function saveUpdates(_0x3312cc,_0x5a6e2c){return function(_0x2b3641){if(_0x2b3641){return _0x2b3641[_0x9333('0x23')](_0x3312cc)[_0x9333('0x24')](function(_0x1281e4){return _0x1281e4;});}return null;};}function removeEntity(_0x466577,_0x2f02b6){return function(_0x9f36e5){if(_0x9f36e5){return _0x9f36e5['destroy']()[_0x9333('0x24')](function(){var _0x2a6593=_0x9f36e5[_0x9333('0x25')]({'plain':!![]});var _0x978986=_0x9333('0x26');return db[_0x9333('0x27')][_0x9333('0x28')]({'where':{'type':_0x978986,'resourceId':_0x2a6593['id']}})['then'](function(){return _0x9f36e5;});})[_0x9333('0x24')](function(){_0x466577[_0x9333('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c9548,_0x50eb69){return function(_0x213556){if(!_0x213556){_0x1c9548[_0x9333('0x18')](0x194);}return _0x213556;};}function handleError(_0x14845d,_0x127fb9){_0x127fb9=_0x127fb9||0x1f4;return function(_0x2861b3){logger['error'](_0x2861b3[_0x9333('0x29')]);if(_0x2861b3[_0x9333('0x2a')]){delete _0x2861b3['name'];}_0x14845d['status'](_0x127fb9)[_0x9333('0x2b')](_0x2861b3);};}exports[_0x9333('0x2c')]=function(_0x2cc592,_0x5d9e67){var _0x3b5694={},_0x42beff={},_0x34040d={'count':0x0,'rows':[]};var _0x5265ef=_['map'](db['CmHopperAdditionalPhone'][_0x9333('0x2d')],function(_0x87e313){return{'name':_0x87e313[_0x9333('0x2e')],'type':_0x87e313[_0x9333('0x2f')][_0x9333('0x30')]};});_0x42beff[_0x9333('0x31')]=_[_0x9333('0x32')](_0x5265ef,_0x9333('0x2a'));_0x42beff['query']=_[_0x9333('0x33')](_0x2cc592['query']);_0x42beff[_0x9333('0x34')]=_['intersection'](_0x42beff[_0x9333('0x31')],_0x42beff['query']);_0x3b5694[_0x9333('0x35')]=_['intersection'](_0x42beff[_0x9333('0x31')],qs[_0x9333('0x36')](_0x2cc592['query']['fields']));_0x3b5694[_0x9333('0x35')]=_0x3b5694[_0x9333('0x35')][_0x9333('0x37')]?_0x3b5694['attributes']:_0x42beff[_0x9333('0x31')];if(!_0x2cc592[_0x9333('0x38')][_0x9333('0x39')](_0x9333('0x3a'))){_0x3b5694['limit']=qs[_0x9333('0x1c')](_0x2cc592['query'][_0x9333('0x1c')]);_0x3b5694['offset']=qs[_0x9333('0x1b')](_0x2cc592[_0x9333('0x38')]['offset']);}_0x3b5694[_0x9333('0x3b')]=qs['sort'](_0x2cc592['query'][_0x9333('0x3c')]);_0x3b5694[_0x9333('0x3d')]=qs[_0x9333('0x34')](_[_0x9333('0x3e')](_0x2cc592[_0x9333('0x38')],_0x42beff[_0x9333('0x34')]),_0x5265ef);if(_0x2cc592['query'][_0x9333('0x3f')]){_0x3b5694[_0x9333('0x3d')]=_['merge'](_0x3b5694[_0x9333('0x3d')],{'$or':_[_0x9333('0x32')](_0x5265ef,function(_0x514b82){if(_0x514b82[_0x9333('0x2f')]!==_0x9333('0x40')){var _0x46fd08={};_0x46fd08[_0x514b82[_0x9333('0x2a')]]={'$like':'%'+_0x2cc592[_0x9333('0x38')]['filter']+'%'};return _0x46fd08;}})});}_0x3b5694=_['merge']({},_0x3b5694,_0x2cc592['options']);var _0x261ea2={'where':_0x3b5694['where']};return db[_0x9333('0x41')][_0x9333('0x1e')](_0x261ea2)[_0x9333('0x24')](function(_0x4b42f6){_0x34040d[_0x9333('0x1e')]=_0x4b42f6;if(_0x2cc592[_0x9333('0x38')][_0x9333('0x42')]){_0x3b5694[_0x9333('0x43')]=[{'all':!![]}];}return db[_0x9333('0x41')][_0x9333('0x44')](_0x3b5694);})[_0x9333('0x24')](function(_0x1ad45){_0x34040d[_0x9333('0x45')]=_0x1ad45;return _0x34040d;})[_0x9333('0x24')](respondWithFilteredResult(_0x5d9e67,_0x3b5694))[_0x9333('0x46')](handleError(_0x5d9e67,null));};exports[_0x9333('0x47')]=function(_0x272982,_0x597cbe){var _0x161522={'raw':!![],'where':{'id':_0x272982[_0x9333('0x48')]['id']}},_0x234587={};_0x234587['model']=_['keys'](db['CmHopperAdditionalPhone'][_0x9333('0x2d')]);_0x234587['query']=_[_0x9333('0x33')](_0x272982['query']);_0x234587[_0x9333('0x34')]=_[_0x9333('0x49')](_0x234587[_0x9333('0x31')],_0x234587[_0x9333('0x38')]);_0x161522['attributes']=_[_0x9333('0x49')](_0x234587[_0x9333('0x31')],qs[_0x9333('0x36')](_0x272982[_0x9333('0x38')][_0x9333('0x36')]));_0x161522['attributes']=_0x161522[_0x9333('0x35')][_0x9333('0x37')]?_0x161522['attributes']:_0x234587[_0x9333('0x31')];if(_0x272982[_0x9333('0x38')][_0x9333('0x42')]){_0x161522['include']=[{'all':!![]}];}_0x161522=_[_0x9333('0x4a')]({},_0x161522,_0x272982['options']);return db[_0x9333('0x41')][_0x9333('0x4b')](_0x161522)[_0x9333('0x24')](handleEntityNotFound(_0x597cbe,null))[_0x9333('0x24')](respondWithResult(_0x597cbe,null))[_0x9333('0x46')](handleError(_0x597cbe,null));};exports['create']=function(_0x58697a,_0x1ca1de){return db[_0x9333('0x41')][_0x9333('0x4c')](_0x58697a[_0x9333('0x4d')],{})['then'](function(_0x95f52f){var _0xa33e55=_0x58697a[_0x9333('0x4e')]['get']({'plain':!![]});if(!_0xa33e55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa33e55[_0x9333('0x4f')]===_0x9333('0x4e')){var _0x5915b6=_0x95f52f['get']({'plain':!![]});var _0x465fb2='CmHopperAdditionalPhones';return db[_0x9333('0x50')]['find']({'where':{'name':_0x465fb2,'userProfileId':_0xa33e55[_0x9333('0x51')]},'raw':!![]})[_0x9333('0x24')](function(_0xf8547){if(_0xf8547&&_0xf8547[_0x9333('0x52')]===0x0){return db[_0x9333('0x27')]['create']({'name':_0x5915b6[_0x9333('0x2a')],'resourceId':_0x5915b6['id'],'type':_0xf8547[_0x9333('0x2a')],'sectionId':_0xf8547['id']},{})[_0x9333('0x24')](function(){return _0x95f52f;});}else{return _0x95f52f;}})[_0x9333('0x46')](function(_0x53cc06){logger[_0x9333('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53cc06);throw _0x53cc06;});}return _0x95f52f;})[_0x9333('0x24')](respondWithResult(_0x1ca1de,0xc9))[_0x9333('0x46')](handleError(_0x1ca1de,null));};exports['update']=function(_0x13af28,_0x11120c){if(_0x13af28[_0x9333('0x4d')]['id']){delete _0x13af28['body']['id'];}return db[_0x9333('0x41')][_0x9333('0x4b')]({'where':{'id':_0x13af28[_0x9333('0x48')]['id']}})['then'](handleEntityNotFound(_0x11120c,null))[_0x9333('0x24')](saveUpdates(_0x13af28['body'],null))['then'](respondWithResult(_0x11120c,null))[_0x9333('0x46')](handleError(_0x11120c,null));};exports[_0x9333('0x28')]=function(_0x5e8180,_0x30e9ac){return db[_0x9333('0x41')][_0x9333('0x4b')]({'where':{'id':_0x5e8180[_0x9333('0x48')]['id']}})[_0x9333('0x24')](handleEntityNotFound(_0x30e9ac,null))[_0x9333('0x24')](removeEntity(_0x30e9ac,null))['catch'](handleError(_0x30e9ac,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index cfcc944..a64bab3 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2af6=['api','bluebird','path','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone','../../config/logger'];(function(_0x2125e9,_0x21d8c0){var _0x499201=function(_0x49b9ca){while(--_0x49b9ca){_0x2125e9['push'](_0x2125e9['shift']());}};_0x499201(++_0x21d8c0);}(_0x2af6,0x170));var _0x62af=function(_0x3281b7,_0x1687cb){_0x3281b7=_0x3281b7-0x0;var _0x455da9=_0x2af6[_0x3281b7];return _0x455da9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x62af('0x0'))(_0x62af('0x1'));var moment=require('moment');var BPromise=require(_0x62af('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62af('0x3'));var rimraf=require(_0x62af('0x4'));var config=require(_0x62af('0x5'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x62af('0x6')]=function(_0x554e5f,_0xebcd04){return _0x554e5f[_0x62af('0x7')](_0x62af('0x8'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0578=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone'];(function(_0x271229,_0x3b1751){var _0x568946=function(_0x55d143){while(--_0x55d143){_0x271229['push'](_0x271229['shift']());}};_0x568946(++_0x3b1751);}(_0x0578,0x1b8));var _0x8057=function(_0x591961,_0x1419d5){_0x591961=_0x591961-0x0;var _0x3658bf=_0x0578[_0x591961];return _0x3658bf;};'use strict';var _=require(_0x8057('0x0'));var util=require(_0x8057('0x1'));var logger=require(_0x8057('0x2'))(_0x8057('0x3'));var moment=require(_0x8057('0x4'));var BPromise=require('bluebird');var rp=require(_0x8057('0x5'));var fs=require('fs');var path=require(_0x8057('0x6'));var rimraf=require('rimraf');var config=require(_0x8057('0x7'));var attributes=require(_0x8057('0x8'));module['exports']=function(_0x1b142e,_0x5753ab){return _0x1b142e[_0x8057('0x9')](_0x8057('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 4497258..d4c8294 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8381=['duration','waitTime','isNil','scheduledat','minutes','add','phone','countdropretry','createdAt','updatedAt','sequelize','transaction','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countnoanswerretry','countmachineretry','countagentrejectretry','entity','countcongestionretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','SwapAdditionalPhones','CmHopper'];(function(_0x28cb1c,_0x5f1ed5){var _0x4aa305=function(_0x4017f4){while(--_0x4017f4){_0x28cb1c['push'](_0x28cb1c['shift']());}};_0x4aa305(++_0x5f1ed5);}(_0x8381,0x17d));var _0x1838=function(_0x976e8f,_0x2ec7a6){_0x976e8f=_0x976e8f-0x0;var _0x46d33b=_0x8381[_0x976e8f];return _0x46d33b;};'use strict';var _=require(_0x1838('0x0'));var util=require(_0x1838('0x1'));var moment=require(_0x1838('0x2'));var BPromise=require(_0x1838('0x3'));var rs=require(_0x1838('0x4'));var fs=require('fs');var Redis=require(_0x1838('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1838('0x6'));var logger=require(_0x1838('0x7'))(_0x1838('0x8'));var config=require(_0x1838('0x9'));var jayson=require(_0x1838('0xa'));var client=jayson[_0x1838('0xb')][_0x1838('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5682b5,_0x880a49,_0x2c6d04){return new BPromise(function(_0x57dc62,_0x25be03){return client['request'](_0x5682b5,_0x2c6d04)['then'](function(_0x1205a1){logger[_0x1838('0xd')](_0x1838('0xe'),_0x880a49,'request\x20sent');logger[_0x1838('0xf')](_0x1838('0x10'),_0x880a49,_0x1838('0x11'),JSON[_0x1838('0x12')](_0x1205a1));if(_0x1205a1[_0x1838('0x13')]){if(_0x1205a1[_0x1838('0x13')][_0x1838('0x14')]===0x1f4){logger[_0x1838('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x880a49,_0x1205a1[_0x1838('0x13')][_0x1838('0x15')]);return _0x25be03(_0x1205a1[_0x1838('0x13')][_0x1838('0x15')]);}logger[_0x1838('0x13')](_0x1838('0xe'),_0x880a49,_0x1205a1[_0x1838('0x13')]['message']);return _0x57dc62(_0x1205a1[_0x1838('0x13')][_0x1838('0x15')]);}else{logger[_0x1838('0xd')](_0x1838('0xe'),_0x880a49,_0x1838('0x11'));_0x57dc62(_0x1205a1[_0x1838('0x16')][_0x1838('0x15')]);}})[_0x1838('0x17')](function(_0x409bfd){logger[_0x1838('0x13')](_0x1838('0xe'),_0x880a49,_0x409bfd);_0x25be03(_0x409bfd);});});}exports[_0x1838('0x18')]=function(_0x39cd75){var _0x160b48=this;return new Promise(function(_0x2f78d7,_0x4d86a2){return db['CmHopper'][_0x1838('0x19')]({'raw':!![],'where':{'ContactId':_0x39cd75[_0x1838('0x1a')][_0x1838('0x1b')],'ListId':_0x39cd75[_0x1838('0x1a')][_0x1838('0x1c')],'VoiceQueueId':_0x39cd75[_0x1838('0x1a')][_0x1838('0x1d')]===undefined?null:_0x39cd75[_0x1838('0x1a')]['VoiceQueueId'],'CampaignId':_0x39cd75[_0x1838('0x1a')][_0x1838('0x1e')]===undefined?null:_0x39cd75[_0x1838('0x1a')][_0x1838('0x1e')]}})['then'](function(_0xda93ce){if(_0xda93ce!=null){return db[_0x1838('0x1f')][_0x1838('0x19')]({'raw':!![],'where':{'CmHopperId':_0xda93ce['id'],'OrderBy':{'$gt':_0xda93ce[_0x1838('0x20')]}},'order':[['OrderBy',_0x1838('0x21')]]})[_0x1838('0x22')](function(_0x2e105c){var _0x5d6510=0x0;if(_0x2e105c){if(_0x2e105c[_0x1838('0x23')]+_0x2e105c['countcongestionretry']+_0x2e105c[_0x1838('0x24')]+_0x2e105c['countnosuchnumberretry']+_0x2e105c['countdropretry']+_0x2e105c['countabandonedretry']+_0x2e105c[_0x1838('0x25')]+_0x2e105c[_0x1838('0x26')]<_0x39cd75[_0x1838('0x27')]['dialGlobalMaxRetry'])_0x5d6510=0x1;_0x2f78d7({'additional':_0x5d6510});}else{return db[_0x1838('0x1f')][_0x1838('0x19')]({'raw':!![],'where':{'CmHopperId':_0xda93ce['id']},'order':[[_0x1838('0x20'),_0x1838('0x21')]]})[_0x1838('0x22')](function(_0x96e49e){var _0x421238=0x0;if(_0x96e49e){if(_0x96e49e['countbusyretry']+_0x96e49e[_0x1838('0x28')]+_0x96e49e[_0x1838('0x24')]+_0x96e49e[_0x1838('0x29')]+_0x96e49e['countdropretry']+_0x96e49e[_0x1838('0x2a')]+_0x96e49e[_0x1838('0x25')]+_0x96e49e[_0x1838('0x26')]<_0x39cd75[_0x1838('0x27')][_0x1838('0x2b')])_0x421238=0x1;_0x2f78d7({'additional':_0x421238});}else{_0x2f78d7({'additional':0x0});}})[_0x1838('0x17')](function(_0xd36e7d){logger[_0x1838('0x13')](_0x1838('0x18'),_0xd36e7d[_0x1838('0x15')]);_0x4d86a2(_0x160b48[_0x1838('0x13')](0x1f4,_0xd36e7d[_0x1838('0x15')]));});}})[_0x1838('0x17')](function(_0x56b6dd){logger[_0x1838('0x13')](_0x1838('0x18'),_0x56b6dd['message']);_0x4d86a2(_0x160b48[_0x1838('0x13')](0x1f4,_0x56b6dd[_0x1838('0x15')]));});}else _0x2f78d7({'additional':0x0});});});};exports[_0x1838('0x2c')]=function(_0x41710b){var _0x469f8d=this;return new Promise(function(_0x28ad4d,_0x1aaa76){return db[_0x1838('0x2d')][_0x1838('0x19')]({'raw':!![],'where':{'ContactId':_0x41710b['body'][_0x1838('0x1b')],'ListId':_0x41710b[_0x1838('0x1a')][_0x1838('0x1c')],'VoiceQueueId':_0x41710b[_0x1838('0x1a')][_0x1838('0x1d')]===undefined?null:_0x41710b['body'][_0x1838('0x1d')],'CampaignId':_0x41710b[_0x1838('0x1a')]['CampaignId']===undefined?null:_0x41710b[_0x1838('0x1a')][_0x1838('0x1e')]}})['then'](function(_0x206d47){if(_0x206d47!=null){return db['CmHopperAdditionalPhone'][_0x1838('0x19')]({'raw':!![],'where':{'CmHopperId':_0x206d47['id'],'OrderBy':{'$gte':_0x206d47[_0x1838('0x20')]}},'order':[['OrderBy','ASC']]})[_0x1838('0x22')](function(_0x30e829){if(_0x30e829)return activateAdditionalPhone(_0x206d47,_0x41710b['body'],_0x30e829,_0x41710b[_0x1838('0x2e')],_0x41710b[_0x1838('0x2f')])[_0x1838('0x22')](function(_0xa9328f){_0x28ad4d(_0xa9328f);});else{return db[_0x1838('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x206d47['id']},'order':[[_0x1838('0x20'),_0x1838('0x21')]]})[_0x1838('0x22')](function(_0x2b6829){if(_0x2b6829)return activateAdditionalPhone(_0x206d47,_0x41710b[_0x1838('0x1a')],_0x2b6829,_0x41710b[_0x1838('0x2e')],_0x41710b[_0x1838('0x2f')])[_0x1838('0x22')](function(_0x42fed2){_0x28ad4d(_0x42fed2);});else{_0x28ad4d({'id':_0x206d47['id'],'phone':''});}})[_0x1838('0x17')](function(_0x52365b){logger[_0x1838('0x13')]('VerifyAdditionalPhones',_0x52365b[_0x1838('0x15')]);_0x1aaa76(_0x469f8d[_0x1838('0x13')](0x1f4,_0x52365b[_0x1838('0x15')]));});}})[_0x1838('0x17')](function(_0x4c70d2){logger[_0x1838('0x13')](_0x1838('0x18'),_0x4c70d2['message']);_0x1aaa76(_0x469f8d[_0x1838('0x13')](0x1f4,_0x4c70d2[_0x1838('0x15')]));});}else _0x28ad4d(0x1);});});};function activateAdditionalPhone(_0x5a61e0,_0x37a446,_0x10b318,_0x8184fc,_0x4ef0f){return new Promise(function(_0x2cb041,_0x9221ee){var _0x4e48a6;if(_[_0x1838('0x30')](_0x10b318['scheduledat'])){_0x10b318[_0x1838('0x31')]=moment();}if(moment()>moment(_0x10b318[_0x1838('0x31')])){_0x4e48a6=moment()['add'](_0x4ef0f||0x3,_0x1838('0x32'));}else{if(_0x10b318[_0x1838('0x20')]==0x0){_0x4e48a6=moment(_0x10b318[_0x1838('0x31')]);}else{_0x4e48a6=moment()[_0x1838('0x33')](_0x4ef0f||0x3,'minutes');}}if(_[_0x1838('0x30')](_0x4e48a6)){_0x4e48a6=moment()[_0x1838('0x33')](_0x4ef0f||0x3,'minutes');}var _0x331d4d={'phone':_0x5a61e0[_0x1838('0x34')],'active':0x0,'OrderBy':_['isNil'](_0x5a61e0[_0x1838('0x20')])?0x0:_0x5a61e0[_0x1838('0x20')],'scheduledat':moment()[_0x1838('0x33')](_0x8184fc||0x1,_0x1838('0x32')),'countbusyretry':_0x37a446[_0x1838('0x23')],'countcongestionretry':_0x37a446[_0x1838('0x28')],'countnoanswerretry':_0x37a446[_0x1838('0x24')],'countnosuchnumberretry':_0x37a446[_0x1838('0x29')],'countdropretry':_0x37a446[_0x1838('0x35')],'countabandonedretry':_0x37a446[_0x1838('0x2a')],'countmachineretry':_0x37a446['countmachineretry'],'countagentrejectretry':_0x37a446[_0x1838('0x26')],'createdAt':_0x37a446[_0x1838('0x36')],'updatedAt':_0x37a446['updatedAt']};var _0x3fa077={'CmHopperId':_0x5a61e0['id'],'phone':_0x10b318[_0x1838('0x34')],'active':0x0,'OrderBy':_[_0x1838('0x30')](_0x10b318[_0x1838('0x20')])?0x0:_0x10b318[_0x1838('0x20')],'scheduledat':_0x4e48a6,'countbusyretry':_0x10b318[_0x1838('0x23')],'countcongestionretry':_0x10b318[_0x1838('0x28')],'countnoanswerretry':_0x10b318[_0x1838('0x24')],'countnosuchnumberretry':_0x10b318['countnosuchnumberretry'],'countdropretry':_0x10b318[_0x1838('0x35')],'countabandonedretry':_0x10b318[_0x1838('0x2a')],'countmachineretry':_0x10b318[_0x1838('0x25')],'countagentrejectretry':_0x10b318[_0x1838('0x26')],'createdAt':_0x10b318[_0x1838('0x36')],'updatedAt':_0x10b318[_0x1838('0x37')]};return db[_0x1838('0x38')][_0x1838('0x39')](function(_0x52406e){return db[_0x1838('0x1f')]['update'](_0x331d4d,{'where':{'id':_0x10b318['id']}},{'transaction':_0x52406e})[_0x1838('0x22')](function(){return db[_0x1838('0x2d')]['update'](_0x3fa077,{'where':{'id':_0x5a61e0['id']}},{'transaction':_0x52406e});});})[_0x1838('0x22')](function(_0x204032){_0x2cb041({'id':_0x5a61e0['id'],'phone':_0x10b318[_0x1838('0x34')]});})[_0x1838('0x17')](function(_0x3eae1a){logger[_0x1838('0x13')](_0x1838('0x3a'),_0x3eae1a['message']);_0x9221ee({'error':_0x3eae1a['message']});});});}exports[_0x1838('0x3b')]=function(_0x1aadd9){var _0x3ae86c=this;return new Promise(function(_0x40e819,_0x3a75d0){return db[_0x1838('0x2d')]['update'](_0x1aadd9[_0x1838('0x1a')][_0x1838('0x3c')],{'where':{'id':_0x1aadd9[_0x1838('0x1a')]['id']}})[_0x1838('0x22')](function(_0x2ffebe){_0x40e819(_0x2ffebe);})[_0x1838('0x17')](function(_0x36d2d2){logger['error'](_0x1838('0x3b'),_0x36d2d2[_0x1838('0x15')]);_0x3a75d0(_0x3ae86c['error'](0x1f4,_0x36d2d2[_0x1838('0x15')]));});});}; \ No newline at end of file +var _0xee1f=['countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','OrderBy','countnoanswerretry','countmachineretry','entity','catch','SwapAdditionalPhones','ContactId','duration','waitTime','isNil','scheduledat','add','minutes','countdropretry','updatedAt','phone','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','ASC','countbusyretry','countcongestionretry'];(function(_0x43f20f,_0x2ccce2){var _0x1a3386=function(_0x24f9af){while(--_0x24f9af){_0x43f20f['push'](_0x43f20f['shift']());}};_0x1a3386(++_0x2ccce2);}(_0xee1f,0x8f));var _0xfee1=function(_0x53e60c,_0xf4f52f){_0x53e60c=_0x53e60c-0x0;var _0x1da97a=_0xee1f[_0x53e60c];return _0x1da97a;};'use strict';var _=require(_0xfee1('0x0'));var util=require('util');var moment=require(_0xfee1('0x1'));var BPromise=require('bluebird');var rs=require(_0xfee1('0x2'));var fs=require('fs');var Redis=require(_0xfee1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfee1('0x4'))(_0xfee1('0x5'));var config=require(_0xfee1('0x6'));var jayson=require(_0xfee1('0x7'));var client=jayson[_0xfee1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46db22,_0x10e7fc,_0x34774a){return new BPromise(function(_0x472ea2,_0x535d24){return client[_0xfee1('0x9')](_0x46db22,_0x34774a)['then'](function(_0x87b06d){logger[_0xfee1('0xa')](_0xfee1('0xb'),_0x10e7fc,'request\x20sent');logger[_0xfee1('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x10e7fc,_0xfee1('0xd'),JSON[_0xfee1('0xe')](_0x87b06d));if(_0x87b06d[_0xfee1('0xf')]){if(_0x87b06d[_0xfee1('0xf')][_0xfee1('0x10')]===0x1f4){logger[_0xfee1('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x10e7fc,_0x87b06d[_0xfee1('0xf')]['message']);return _0x535d24(_0x87b06d[_0xfee1('0xf')]['message']);}logger[_0xfee1('0xf')](_0xfee1('0xb'),_0x10e7fc,_0x87b06d['error'][_0xfee1('0x11')]);return _0x472ea2(_0x87b06d['error']['message']);}else{logger[_0xfee1('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x10e7fc,_0xfee1('0xd'));_0x472ea2(_0x87b06d[_0xfee1('0x12')]['message']);}})['catch'](function(_0x11a72f){logger['error'](_0xfee1('0xb'),_0x10e7fc,_0x11a72f);_0x535d24(_0x11a72f);});});}exports[_0xfee1('0x13')]=function(_0x35cc8f){var _0x5e56cf=this;return new Promise(function(_0x5729a3,_0x381321){return db[_0xfee1('0x14')][_0xfee1('0x15')]({'raw':!![],'where':{'ContactId':_0x35cc8f['body']['ContactId'],'ListId':_0x35cc8f[_0xfee1('0x16')][_0xfee1('0x17')],'VoiceQueueId':_0x35cc8f[_0xfee1('0x16')]['VoiceQueueId']===undefined?null:_0x35cc8f[_0xfee1('0x16')][_0xfee1('0x18')],'CampaignId':_0x35cc8f[_0xfee1('0x16')][_0xfee1('0x19')]===undefined?null:_0x35cc8f[_0xfee1('0x16')][_0xfee1('0x19')]}})[_0xfee1('0x1a')](function(_0x3d5c61){if(_0x3d5c61!=null){return db[_0xfee1('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3d5c61['id'],'OrderBy':{'$gt':_0x3d5c61['OrderBy']}},'order':[['OrderBy',_0xfee1('0x1c')]]})[_0xfee1('0x1a')](function(_0x4bc0fe){var _0x4e837f=0x0;if(_0x4bc0fe){if(_0x4bc0fe[_0xfee1('0x1d')]+_0x4bc0fe[_0xfee1('0x1e')]+_0x4bc0fe['countnoanswerretry']+_0x4bc0fe[_0xfee1('0x1f')]+_0x4bc0fe['countdropretry']+_0x4bc0fe[_0xfee1('0x20')]+_0x4bc0fe['countmachineretry']+_0x4bc0fe[_0xfee1('0x21')]<_0x35cc8f['entity'][_0xfee1('0x22')])_0x4e837f=0x1;_0x5729a3({'additional':_0x4e837f});}else{return db[_0xfee1('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3d5c61['id']},'order':[[_0xfee1('0x23'),_0xfee1('0x1c')]]})[_0xfee1('0x1a')](function(_0x2b4b9b){var _0x11262b=0x0;if(_0x2b4b9b){if(_0x2b4b9b[_0xfee1('0x1d')]+_0x2b4b9b[_0xfee1('0x1e')]+_0x2b4b9b[_0xfee1('0x24')]+_0x2b4b9b['countnosuchnumberretry']+_0x2b4b9b['countdropretry']+_0x2b4b9b[_0xfee1('0x20')]+_0x2b4b9b[_0xfee1('0x25')]+_0x2b4b9b[_0xfee1('0x21')]<_0x35cc8f[_0xfee1('0x26')]['dialGlobalMaxRetry'])_0x11262b=0x1;_0x5729a3({'additional':_0x11262b});}else{_0x5729a3({'additional':0x0});}})[_0xfee1('0x27')](function(_0x22879a){logger[_0xfee1('0xf')](_0xfee1('0x13'),_0x22879a[_0xfee1('0x11')]);_0x381321(_0x5e56cf[_0xfee1('0xf')](0x1f4,_0x22879a['message']));});}})[_0xfee1('0x27')](function(_0xcf8ba){logger[_0xfee1('0xf')](_0xfee1('0x13'),_0xcf8ba[_0xfee1('0x11')]);_0x381321(_0x5e56cf[_0xfee1('0xf')](0x1f4,_0xcf8ba['message']));});}else _0x5729a3({'additional':0x0});});});};exports[_0xfee1('0x28')]=function(_0x681328){var _0x2a2820=this;return new Promise(function(_0xc4e295,_0x3803df){return db['CmHopper'][_0xfee1('0x15')]({'raw':!![],'where':{'ContactId':_0x681328[_0xfee1('0x16')][_0xfee1('0x29')],'ListId':_0x681328[_0xfee1('0x16')][_0xfee1('0x17')],'VoiceQueueId':_0x681328[_0xfee1('0x16')]['VoiceQueueId']===undefined?null:_0x681328['body'][_0xfee1('0x18')],'CampaignId':_0x681328[_0xfee1('0x16')][_0xfee1('0x19')]===undefined?null:_0x681328['body'][_0xfee1('0x19')]}})['then'](function(_0x3c7cd4){if(_0x3c7cd4!=null){return db[_0xfee1('0x1b')][_0xfee1('0x15')]({'raw':!![],'where':{'CmHopperId':_0x3c7cd4['id'],'OrderBy':{'$gte':_0x3c7cd4[_0xfee1('0x23')]}},'order':[[_0xfee1('0x23'),_0xfee1('0x1c')]]})[_0xfee1('0x1a')](function(_0x6d3fb5){if(_0x6d3fb5)return activateAdditionalPhone(_0x3c7cd4,_0x681328['body'],_0x6d3fb5,_0x681328[_0xfee1('0x2a')],_0x681328[_0xfee1('0x2b')])[_0xfee1('0x1a')](function(_0x12a7da){_0xc4e295(_0x12a7da);});else{return db['CmHopperAdditionalPhone'][_0xfee1('0x15')]({'raw':!![],'where':{'CmHopperId':_0x3c7cd4['id']},'order':[[_0xfee1('0x23'),'ASC']]})['then'](function(_0x356e01){if(_0x356e01)return activateAdditionalPhone(_0x3c7cd4,_0x681328[_0xfee1('0x16')],_0x356e01,_0x681328[_0xfee1('0x2a')],_0x681328['waitTime'])[_0xfee1('0x1a')](function(_0x3f592f){_0xc4e295(_0x3f592f);});else{_0xc4e295({'id':_0x3c7cd4['id'],'phone':''});}})[_0xfee1('0x27')](function(_0x2538fa){logger[_0xfee1('0xf')]('VerifyAdditionalPhones',_0x2538fa['message']);_0x3803df(_0x2a2820[_0xfee1('0xf')](0x1f4,_0x2538fa[_0xfee1('0x11')]));});}})['catch'](function(_0x282335){logger[_0xfee1('0xf')](_0xfee1('0x13'),_0x282335[_0xfee1('0x11')]);_0x3803df(_0x2a2820['error'](0x1f4,_0x282335['message']));});}else _0xc4e295(0x1);});});};function activateAdditionalPhone(_0x502e78,_0x53e24d,_0x4618a7,_0x5b7bf0,_0x4dd362){return new Promise(function(_0x5c11ab,_0x5758ba){var _0x1b712e;if(_[_0xfee1('0x2c')](_0x4618a7['scheduledat'])){_0x4618a7[_0xfee1('0x2d')]=moment();}if(moment()>moment(_0x4618a7['scheduledat'])){_0x1b712e=moment()[_0xfee1('0x2e')](_0x4dd362||0x3,_0xfee1('0x2f'));}else{if(_0x4618a7[_0xfee1('0x23')]==0x0){_0x1b712e=moment(_0x4618a7[_0xfee1('0x2d')]);}else{_0x1b712e=moment()[_0xfee1('0x2e')](_0x4dd362||0x3,_0xfee1('0x2f'));}}if(_['isNil'](_0x1b712e)){_0x1b712e=moment()[_0xfee1('0x2e')](_0x4dd362||0x3,_0xfee1('0x2f'));}var _0x2e8e54={'phone':_0x502e78['phone'],'active':0x0,'OrderBy':_['isNil'](_0x502e78[_0xfee1('0x23')])?0x0:_0x502e78[_0xfee1('0x23')],'scheduledat':moment()[_0xfee1('0x2e')](_0x5b7bf0||0x1,_0xfee1('0x2f')),'countbusyretry':_0x53e24d[_0xfee1('0x1d')],'countcongestionretry':_0x53e24d[_0xfee1('0x1e')],'countnoanswerretry':_0x53e24d[_0xfee1('0x24')],'countnosuchnumberretry':_0x53e24d[_0xfee1('0x1f')],'countdropretry':_0x53e24d[_0xfee1('0x30')],'countabandonedretry':_0x53e24d[_0xfee1('0x20')],'countmachineretry':_0x53e24d['countmachineretry'],'countagentrejectretry':_0x53e24d[_0xfee1('0x21')],'createdAt':_0x53e24d['createdAt'],'updatedAt':_0x53e24d[_0xfee1('0x31')]};var _0x5942e6={'CmHopperId':_0x502e78['id'],'phone':_0x4618a7[_0xfee1('0x32')],'active':0x0,'OrderBy':_[_0xfee1('0x2c')](_0x4618a7[_0xfee1('0x23')])?0x0:_0x4618a7[_0xfee1('0x23')],'scheduledat':_0x1b712e,'countbusyretry':_0x4618a7[_0xfee1('0x1d')],'countcongestionretry':_0x4618a7[_0xfee1('0x1e')],'countnoanswerretry':_0x4618a7['countnoanswerretry'],'countnosuchnumberretry':_0x4618a7['countnosuchnumberretry'],'countdropretry':_0x4618a7[_0xfee1('0x30')],'countabandonedretry':_0x4618a7[_0xfee1('0x20')],'countmachineretry':_0x4618a7['countmachineretry'],'countagentrejectretry':_0x4618a7['countagentrejectretry'],'createdAt':_0x4618a7[_0xfee1('0x33')],'updatedAt':_0x4618a7['updatedAt']};return db[_0xfee1('0x34')][_0xfee1('0x35')](function(_0x256ad1){return db[_0xfee1('0x1b')][_0xfee1('0x36')](_0x2e8e54,{'where':{'id':_0x4618a7['id']}},{'transaction':_0x256ad1})['then'](function(){return db[_0xfee1('0x14')][_0xfee1('0x36')](_0x5942e6,{'where':{'id':_0x502e78['id']}},{'transaction':_0x256ad1});});})[_0xfee1('0x1a')](function(_0x4048b2){_0x5c11ab({'id':_0x502e78['id'],'phone':_0x4618a7[_0xfee1('0x32')]});})['catch'](function(_0x5cbd66){logger[_0xfee1('0xf')](_0xfee1('0x37'),_0x5cbd66[_0xfee1('0x11')]);_0x5758ba({'error':_0x5cbd66[_0xfee1('0x11')]});});});}exports[_0xfee1('0x38')]=function(_0x1076cd){var _0x205275=this;return new Promise(function(_0xab49e4,_0x4b55ec){return db[_0xfee1('0x14')]['update'](_0x1076cd[_0xfee1('0x16')][_0xfee1('0x39')],{'where':{'id':_0x1076cd[_0xfee1('0x16')]['id']}})[_0xfee1('0x1a')](function(_0x14b4bd){_0xab49e4(_0x14b4bd);})[_0xfee1('0x27')](function(_0x39a0e2){logger[_0xfee1('0xf')](_0xfee1('0x38'),_0x39a0e2['message']);_0x4b55ec(_0x205275[_0xfee1('0xf')](0x1f4,_0x39a0e2[_0xfee1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index f395d9f..0eb75dd 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb16=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util'];(function(_0x5346af,_0x1cb284){var _0x581155=function(_0x5584bc){while(--_0x5584bc){_0x5346af['push'](_0x5346af['shift']());}};_0x581155(++_0x1cb284);}(_0xcb16,0x12e));var _0x6cb1=function(_0x599e97,_0xaedf2){_0x599e97=_0x599e97-0x0;var _0x4b44bb=_0xcb16[_0x599e97];return _0x4b44bb;};'use strict';var multer=require(_0x6cb1('0x0'));var util=require(_0x6cb1('0x1'));var path=require('path');var timeout=require(_0x6cb1('0x2'));var express=require(_0x6cb1('0x3'));var router=express[_0x6cb1('0x4')]();var fs_extra=require(_0x6cb1('0x5'));var auth=require(_0x6cb1('0x6'));var interaction=require(_0x6cb1('0x7'));var config=require('../../config/environment');var controller=require(_0x6cb1('0x8'));router[_0x6cb1('0x9')]('/',auth[_0x6cb1('0xa')](),controller[_0x6cb1('0xb')]);router[_0x6cb1('0x9')](_0x6cb1('0xc'),auth[_0x6cb1('0xa')](),controller[_0x6cb1('0xd')]);router['post']('/',auth[_0x6cb1('0xa')](),controller['create']);router[_0x6cb1('0xe')](_0x6cb1('0xc'),auth[_0x6cb1('0xa')](),controller[_0x6cb1('0xf')]);router[_0x6cb1('0x10')]('/:id',auth[_0x6cb1('0xa')](),controller[_0x6cb1('0x11')]);module[_0x6cb1('0x12')]=router; \ No newline at end of file +var _0x7cc7=['../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','express','fs-extra'];(function(_0x398130,_0x3820cc){var _0x39d3cf=function(_0x31e26b){while(--_0x31e26b){_0x398130['push'](_0x398130['shift']());}};_0x39d3cf(++_0x3820cc);}(_0x7cc7,0x161));var _0x77cc=function(_0x5b2ff8,_0xec45d8){_0x5b2ff8=_0x5b2ff8-0x0;var _0x4ca1f8=_0x7cc7[_0x5b2ff8];return _0x4ca1f8;};'use strict';var multer=require(_0x77cc('0x0'));var util=require(_0x77cc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77cc('0x2'));var router=express['Router']();var fs_extra=require(_0x77cc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x77cc('0x4'));var config=require(_0x77cc('0x5'));var controller=require(_0x77cc('0x6'));router[_0x77cc('0x7')]('/',auth[_0x77cc('0x8')](),controller[_0x77cc('0x9')]);router[_0x77cc('0x7')](_0x77cc('0xa'),auth['isAuthenticated'](),controller[_0x77cc('0xb')]);router[_0x77cc('0xc')]('/',auth[_0x77cc('0x8')](),controller[_0x77cc('0xd')]);router[_0x77cc('0xe')](_0x77cc('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x77cc('0xa'),auth['isAuthenticated'](),controller[_0x77cc('0xf')]);module[_0x77cc('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 84e809a..158ff32 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 _0x8e08=['contactListQueue','sequelize','STRING','INTEGER'];(function(_0x3e8de1,_0x5e8a5a){var _0x1de4b3=function(_0xb6cb4f){while(--_0xb6cb4f){_0x3e8de1['push'](_0x3e8de1['shift']());}};_0x1de4b3(++_0x5e8a5a);}(_0x8e08,0xf9));var _0x88e0=function(_0x53524a,_0x420899){_0x53524a=_0x53524a-0x0;var _0x2c85b0=_0x8e08[_0x53524a];return _0x2c85b0;};'use strict';var moment=require('moment');var Sequelize=require(_0x88e0('0x0'));module['exports']={'phone':{'type':Sequelize[_0x88e0('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x88e0('0x2')],'unique':_0x88e0('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x88e0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x88e0('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x952a=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x48a935,_0x41dc95){var _0x945c93=function(_0x157eca){while(--_0x157eca){_0x48a935['push'](_0x48a935['shift']());}};_0x945c93(++_0x41dc95);}(_0x952a,0x1b1));var _0xa952=function(_0x40bbeb,_0x5c540e){_0x40bbeb=_0x40bbeb-0x0;var _0x2ba1f4=_0x952a[_0x40bbeb];return _0x2ba1f4;};'use strict';var moment=require(_0xa952('0x0'));var Sequelize=require(_0xa952('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa952('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa952('0x3')],'unique':_0xa952('0x4')},'ListId':{'type':Sequelize[_0xa952('0x3')],'unique':_0xa952('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa952('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index f83c01c..e06f237 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 _0xcb1a=['Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','CmHopperBlack','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','catch','show','params','includeAll','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xcb1a,0xb6));var _0xacb1=function(_0x84f672,_0x24a2da){_0x84f672=_0x84f672-0x0;var _0x57643d=_0xcb1a[_0x84f672];return _0x57643d;};'use strict';var emlformat=require(_0xacb1('0x0'));var rimraf=require(_0xacb1('0x1'));var zipdir=require(_0xacb1('0x2'));var jsonpatch=require(_0xacb1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xacb1('0x4'));var Mustache=require('mustache');var util=require(_0xacb1('0x5'));var path=require(_0xacb1('0x6'));var sox=require('sox');var csv=require(_0xacb1('0x7'));var ejs=require(_0xacb1('0x8'));var fs=require('fs');var fs_extra=require(_0xacb1('0x9'));var _=require(_0xacb1('0xa'));var squel=require(_0xacb1('0xb'));var crypto=require(_0xacb1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xacb1('0xd'));var toCsv=require(_0xacb1('0x7'));var querystring=require(_0xacb1('0xe'));var Papa=require(_0xacb1('0xf'));var Redis=require(_0xacb1('0x10'));var authService=require(_0xacb1('0x11'));var qs=require(_0xacb1('0x12'));var as=require(_0xacb1('0x13'));var hardwareService=require(_0xacb1('0x14'));var logger=require(_0xacb1('0x15'))(_0xacb1('0x16'));var utils=require('../../config/utils');var config=require(_0xacb1('0x17'));var licenseUtil=require(_0xacb1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b868c,_0x436df5){_0x436df5=_0x436df5||0xcc;return function(_0x471798){if(_0x471798){return _0x5b868c[_0xacb1('0x19')](_0x436df5);}return _0x5b868c[_0xacb1('0x1a')](_0x436df5)[_0xacb1('0x1b')]();};}function respondWithResult(_0x40c6cc,_0x5eab1c){_0x5eab1c=_0x5eab1c||0xc8;return function(_0x1806a0){if(_0x1806a0){return _0x40c6cc['status'](_0x5eab1c)[_0xacb1('0x1c')](_0x1806a0);}};}function respondWithFilteredResult(_0xe7067d,_0x458b63){return function(_0x1d1b7b){if(_0x1d1b7b){var _0x48016a=typeof _0x458b63['offset']===_0xacb1('0x1d')&&typeof _0x458b63[_0xacb1('0x1e')]===_0xacb1('0x1d');var _0x235f31=_0x1d1b7b[_0xacb1('0x1f')];var _0x687132=_0x48016a?0x0:_0x458b63[_0xacb1('0x20')];var _0x393c83=_0x48016a?_0x1d1b7b[_0xacb1('0x1f')]:_0x458b63[_0xacb1('0x20')]+_0x458b63[_0xacb1('0x1e')];var _0x224e85;if(_0x393c83>=_0x235f31){_0x393c83=_0x235f31;_0x224e85=0xc8;}else{_0x224e85=0xce;}_0xe7067d[_0xacb1('0x1a')](_0x224e85);return _0xe7067d[_0xacb1('0x21')](_0xacb1('0x22'),_0x687132+'-'+_0x393c83+'/'+_0x235f31)[_0xacb1('0x1c')](_0x1d1b7b);}return null;};}function patchUpdates(_0x29d5cb){return function(_0x337636){try{jsonpatch[_0xacb1('0x23')](_0x337636,_0x29d5cb,!![]);}catch(_0x389ce8){return BPromise[_0xacb1('0x24')](_0x389ce8);}return _0x337636[_0xacb1('0x25')]();};}function saveUpdates(_0x237fe0,_0x1d8d28){return function(_0xed7084){if(_0xed7084){return _0xed7084['update'](_0x237fe0)[_0xacb1('0x26')](function(_0x2f9eb8){return _0x2f9eb8;});}return null;};}function removeEntity(_0x4ae884,_0x4c96f6){return function(_0x33265d){if(_0x33265d){return _0x33265d[_0xacb1('0x27')]()['then'](function(){_0x4ae884[_0xacb1('0x1a')](0xcc)[_0xacb1('0x1b')]();});}};}function handleEntityNotFound(_0x11374f,_0x3df055){return function(_0x5030a0){if(!_0x5030a0){_0x11374f['sendStatus'](0x194);}return _0x5030a0;};}function handleError(_0x4ca249,_0xf91e25){_0xf91e25=_0xf91e25||0x1f4;return function(_0x5dd30e){logger[_0xacb1('0x28')](_0x5dd30e[_0xacb1('0x29')]);if(_0x5dd30e[_0xacb1('0x2a')]){delete _0x5dd30e[_0xacb1('0x2a')];}_0x4ca249[_0xacb1('0x1a')](_0xf91e25)['send'](_0x5dd30e);};}exports[_0xacb1('0x2b')]=function(_0xa7f5e,_0x5bf95c){var _0x1398b7={},_0x2e41bd={},_0x14064e={'count':0x0,'rows':[]};var _0x4a0932=_[_0xacb1('0x2c')](db[_0xacb1('0x2d')]['rawAttributes'],function(_0x1e3c87){return{'name':_0x1e3c87[_0xacb1('0x2e')],'type':_0x1e3c87[_0xacb1('0x2f')]['key']};});_0x2e41bd['model']=_[_0xacb1('0x2c')](_0x4a0932,'name');_0x2e41bd[_0xacb1('0x30')]=_[_0xacb1('0x31')](_0xa7f5e[_0xacb1('0x30')]);_0x2e41bd[_0xacb1('0x32')]=_[_0xacb1('0x33')](_0x2e41bd[_0xacb1('0x34')],_0x2e41bd[_0xacb1('0x30')]);_0x1398b7[_0xacb1('0x35')]=_[_0xacb1('0x33')](_0x2e41bd[_0xacb1('0x34')],qs[_0xacb1('0x36')](_0xa7f5e[_0xacb1('0x30')][_0xacb1('0x36')]));_0x1398b7[_0xacb1('0x35')]=_0x1398b7[_0xacb1('0x35')][_0xacb1('0x37')]?_0x1398b7['attributes']:_0x2e41bd[_0xacb1('0x34')];if(!_0xa7f5e[_0xacb1('0x30')]['hasOwnProperty'](_0xacb1('0x38'))){_0x1398b7[_0xacb1('0x1e')]=qs['limit'](_0xa7f5e[_0xacb1('0x30')][_0xacb1('0x1e')]);_0x1398b7[_0xacb1('0x20')]=qs['offset'](_0xa7f5e[_0xacb1('0x30')][_0xacb1('0x20')]);}_0x1398b7[_0xacb1('0x39')]=qs[_0xacb1('0x3a')](_0xa7f5e[_0xacb1('0x30')][_0xacb1('0x3a')]);_0x1398b7[_0xacb1('0x3b')]=qs[_0xacb1('0x32')](_['pick'](_0xa7f5e[_0xacb1('0x30')],_0x2e41bd[_0xacb1('0x32')]),_0x4a0932);if(_0xa7f5e[_0xacb1('0x30')]['filter']){_0x1398b7[_0xacb1('0x3b')]=_[_0xacb1('0x3c')](_0x1398b7['where'],{'$or':_[_0xacb1('0x2c')](_0x4a0932,function(_0x3ea078){if(_0x3ea078[_0xacb1('0x2f')]!==_0xacb1('0x3d')){var _0x5db911={};_0x5db911[_0x3ea078[_0xacb1('0x2a')]]={'$like':'%'+_0xa7f5e[_0xacb1('0x30')][_0xacb1('0x3e')]+'%'};return _0x5db911;}})});}_0x1398b7=_[_0xacb1('0x3c')]({},_0x1398b7,_0xa7f5e['options']);var _0x7050fb={'where':_0x1398b7[_0xacb1('0x3b')]};return db[_0xacb1('0x2d')][_0xacb1('0x1f')](_0x7050fb)[_0xacb1('0x26')](function(_0x30838f){_0x14064e[_0xacb1('0x1f')]=_0x30838f;if(_0xa7f5e[_0xacb1('0x30')]['includeAll']){_0x1398b7[_0xacb1('0x3f')]=[{'all':!![]}];}return db[_0xacb1('0x2d')][_0xacb1('0x40')](_0x1398b7);})[_0xacb1('0x26')](function(_0x17157b){_0x14064e['rows']=_0x17157b;return _0x14064e;})['then'](respondWithFilteredResult(_0x5bf95c,_0x1398b7))[_0xacb1('0x41')](handleError(_0x5bf95c,null));};exports[_0xacb1('0x42')]=function(_0x202b16,_0x66244){var _0x47c1a2={'raw':!![],'where':{'id':_0x202b16[_0xacb1('0x43')]['id']}},_0x30c5b8={};_0x30c5b8[_0xacb1('0x34')]=_[_0xacb1('0x31')](db[_0xacb1('0x2d')]['rawAttributes']);_0x30c5b8[_0xacb1('0x30')]=_[_0xacb1('0x31')](_0x202b16[_0xacb1('0x30')]);_0x30c5b8[_0xacb1('0x32')]=_[_0xacb1('0x33')](_0x30c5b8[_0xacb1('0x34')],_0x30c5b8['query']);_0x47c1a2[_0xacb1('0x35')]=_['intersection'](_0x30c5b8[_0xacb1('0x34')],qs[_0xacb1('0x36')](_0x202b16[_0xacb1('0x30')]['fields']));_0x47c1a2[_0xacb1('0x35')]=_0x47c1a2[_0xacb1('0x35')][_0xacb1('0x37')]?_0x47c1a2[_0xacb1('0x35')]:_0x30c5b8['model'];if(_0x202b16[_0xacb1('0x30')][_0xacb1('0x44')]){_0x47c1a2[_0xacb1('0x3f')]=[{'all':!![]}];}_0x47c1a2=_[_0xacb1('0x3c')]({},_0x47c1a2,_0x202b16['options']);return db['CmHopperBlack']['find'](_0x47c1a2)[_0xacb1('0x26')](handleEntityNotFound(_0x66244,null))['then'](respondWithResult(_0x66244,null))[_0xacb1('0x41')](handleError(_0x66244,null));};exports['update']=function(_0x208df0,_0x432885){if(_0x208df0[_0xacb1('0x45')]['id']){delete _0x208df0[_0xacb1('0x45')]['id'];}return db['CmHopperBlack'][_0xacb1('0x46')]({'where':{'id':_0x208df0[_0xacb1('0x43')]['id']}})[_0xacb1('0x26')](handleEntityNotFound(_0x432885,null))[_0xacb1('0x26')](saveUpdates(_0x208df0[_0xacb1('0x45')],null))[_0xacb1('0x26')](respondWithResult(_0x432885,null))[_0xacb1('0x41')](handleError(_0x432885,null));};exports[_0xacb1('0x27')]=function(_0x35c25f,_0x33c043){return db[_0xacb1('0x2d')]['find']({'where':{'id':_0x35c25f['params']['id']}})[_0xacb1('0x26')](handleEntityNotFound(_0x33c043,null))[_0xacb1('0x26')](removeEntity(_0x33c043,null))[_0xacb1('0x41')](handleError(_0x33c043,null));};exports[_0xacb1('0x47')]=function(_0x35ffd5,_0x759a75){return db[_0xacb1('0x2d')][_0xacb1('0x47')]()[_0xacb1('0x26')](respondWithResult(_0x759a75,null))[_0xacb1('0x41')](handleError(_0x759a75,null));}; \ No newline at end of file +var _0x42eb=['then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','show','keys','find','catch','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','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','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x3b3c0e,_0x99b3f6){var _0x1b0d25=function(_0x82fa06){while(--_0x82fa06){_0x3b3c0e['push'](_0x3b3c0e['shift']());}};_0x1b0d25(++_0x99b3f6);}(_0x42eb,0x74));var _0xb42e=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x42eb[_0xf73c09];return _0xa8923c;};'use strict';var emlformat=require(_0xb42e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb42e('0x1'));var rp=require(_0xb42e('0x2'));var moment=require(_0xb42e('0x3'));var BPromise=require(_0xb42e('0x4'));var Mustache=require(_0xb42e('0x5'));var util=require(_0xb42e('0x6'));var path=require(_0xb42e('0x7'));var sox=require(_0xb42e('0x8'));var csv=require(_0xb42e('0x9'));var ejs=require(_0xb42e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb42e('0xb'));var crypto=require('crypto');var jsforce=require(_0xb42e('0xc'));var deskjs=require(_0xb42e('0xd'));var toCsv=require(_0xb42e('0x9'));var querystring=require('querystring');var Papa=require(_0xb42e('0xe'));var Redis=require('ioredis');var authService=require(_0xb42e('0xf'));var qs=require(_0xb42e('0x10'));var as=require(_0xb42e('0x11'));var hardwareService=require(_0xb42e('0x12'));var logger=require(_0xb42e('0x13'))(_0xb42e('0x14'));var utils=require(_0xb42e('0x15'));var config=require(_0xb42e('0x16'));var licenseUtil=require(_0xb42e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x240bfa,_0x5556f6){_0x5556f6=_0x5556f6||0xcc;return function(_0x56a870){if(_0x56a870){return _0x240bfa[_0xb42e('0x18')](_0x5556f6);}return _0x240bfa[_0xb42e('0x19')](_0x5556f6)[_0xb42e('0x1a')]();};}function respondWithResult(_0x1a0cf2,_0x5bb4ff){_0x5bb4ff=_0x5bb4ff||0xc8;return function(_0x4cc211){if(_0x4cc211){return _0x1a0cf2['status'](_0x5bb4ff)['json'](_0x4cc211);}};}function respondWithFilteredResult(_0x1eea14,_0x48be4d){return function(_0x9f7db5){if(_0x9f7db5){var _0x3b05b2=typeof _0x48be4d['offset']===_0xb42e('0x1b')&&typeof _0x48be4d[_0xb42e('0x1c')]===_0xb42e('0x1b');var _0xedd1eb=_0x9f7db5['count'];var _0x1e46f2=_0x3b05b2?0x0:_0x48be4d[_0xb42e('0x1d')];var _0x26ad8a=_0x3b05b2?_0x9f7db5[_0xb42e('0x1e')]:_0x48be4d[_0xb42e('0x1d')]+_0x48be4d[_0xb42e('0x1c')];var _0x4ad4c8;if(_0x26ad8a>=_0xedd1eb){_0x26ad8a=_0xedd1eb;_0x4ad4c8=0xc8;}else{_0x4ad4c8=0xce;}_0x1eea14['status'](_0x4ad4c8);return _0x1eea14[_0xb42e('0x1f')](_0xb42e('0x20'),_0x1e46f2+'-'+_0x26ad8a+'/'+_0xedd1eb)[_0xb42e('0x21')](_0x9f7db5);}return null;};}function patchUpdates(_0x291f0f){return function(_0x45e718){try{jsonpatch[_0xb42e('0x22')](_0x45e718,_0x291f0f,!![]);}catch(_0x5722f0){return BPromise[_0xb42e('0x23')](_0x5722f0);}return _0x45e718[_0xb42e('0x24')]();};}function saveUpdates(_0x3ab286,_0x2f99d7){return function(_0x89f8ae){if(_0x89f8ae){return _0x89f8ae[_0xb42e('0x25')](_0x3ab286)[_0xb42e('0x26')](function(_0x3fee06){return _0x3fee06;});}return null;};}function removeEntity(_0x10a5e8,_0x5ac9a4){return function(_0x3681c1){if(_0x3681c1){return _0x3681c1[_0xb42e('0x27')]()['then'](function(){_0x10a5e8[_0xb42e('0x19')](0xcc)[_0xb42e('0x1a')]();});}};}function handleEntityNotFound(_0xcb78bf,_0x41845a){return function(_0x5b19fd){if(!_0x5b19fd){_0xcb78bf[_0xb42e('0x18')](0x194);}return _0x5b19fd;};}function handleError(_0x15c738,_0x58fd48){_0x58fd48=_0x58fd48||0x1f4;return function(_0xc1a014){logger[_0xb42e('0x28')](_0xc1a014[_0xb42e('0x29')]);if(_0xc1a014[_0xb42e('0x2a')]){delete _0xc1a014[_0xb42e('0x2a')];}_0x15c738[_0xb42e('0x19')](_0x58fd48)[_0xb42e('0x2b')](_0xc1a014);};}exports['index']=function(_0x276a96,_0x15c9aa){var _0x4f43b8={},_0x51275e={},_0x2797bd={'count':0x0,'rows':[]};var _0x313c71=_[_0xb42e('0x2c')](db['CmHopperBlack'][_0xb42e('0x2d')],function(_0x143eb4){return{'name':_0x143eb4[_0xb42e('0x2e')],'type':_0x143eb4['type'][_0xb42e('0x2f')]};});_0x51275e[_0xb42e('0x30')]=_['map'](_0x313c71,_0xb42e('0x2a'));_0x51275e[_0xb42e('0x31')]=_['keys'](_0x276a96['query']);_0x51275e[_0xb42e('0x32')]=_[_0xb42e('0x33')](_0x51275e[_0xb42e('0x30')],_0x51275e[_0xb42e('0x31')]);_0x4f43b8[_0xb42e('0x34')]=_[_0xb42e('0x33')](_0x51275e[_0xb42e('0x30')],qs[_0xb42e('0x35')](_0x276a96[_0xb42e('0x31')][_0xb42e('0x35')]));_0x4f43b8['attributes']=_0x4f43b8[_0xb42e('0x34')][_0xb42e('0x36')]?_0x4f43b8[_0xb42e('0x34')]:_0x51275e['model'];if(!_0x276a96[_0xb42e('0x31')][_0xb42e('0x37')](_0xb42e('0x38'))){_0x4f43b8['limit']=qs[_0xb42e('0x1c')](_0x276a96[_0xb42e('0x31')]['limit']);_0x4f43b8['offset']=qs[_0xb42e('0x1d')](_0x276a96[_0xb42e('0x31')][_0xb42e('0x1d')]);}_0x4f43b8[_0xb42e('0x39')]=qs[_0xb42e('0x3a')](_0x276a96[_0xb42e('0x31')][_0xb42e('0x3a')]);_0x4f43b8[_0xb42e('0x3b')]=qs['filters'](_[_0xb42e('0x3c')](_0x276a96[_0xb42e('0x31')],_0x51275e[_0xb42e('0x32')]),_0x313c71);if(_0x276a96[_0xb42e('0x31')][_0xb42e('0x3d')]){_0x4f43b8[_0xb42e('0x3b')]=_[_0xb42e('0x3e')](_0x4f43b8[_0xb42e('0x3b')],{'$or':_[_0xb42e('0x2c')](_0x313c71,function(_0x3f68fd){if(_0x3f68fd[_0xb42e('0x3f')]!==_0xb42e('0x40')){var _0x1c0ded={};_0x1c0ded[_0x3f68fd[_0xb42e('0x2a')]]={'$like':'%'+_0x276a96[_0xb42e('0x31')]['filter']+'%'};return _0x1c0ded;}})});}_0x4f43b8=_[_0xb42e('0x3e')]({},_0x4f43b8,_0x276a96[_0xb42e('0x41')]);var _0x5583cc={'where':_0x4f43b8[_0xb42e('0x3b')]};return db[_0xb42e('0x42')][_0xb42e('0x1e')](_0x5583cc)[_0xb42e('0x26')](function(_0x565bcd){_0x2797bd[_0xb42e('0x1e')]=_0x565bcd;if(_0x276a96[_0xb42e('0x31')][_0xb42e('0x43')]){_0x4f43b8[_0xb42e('0x44')]=[{'all':!![]}];}return db[_0xb42e('0x42')][_0xb42e('0x45')](_0x4f43b8);})[_0xb42e('0x26')](function(_0x18d345){_0x2797bd['rows']=_0x18d345;return _0x2797bd;})[_0xb42e('0x26')](respondWithFilteredResult(_0x15c9aa,_0x4f43b8))['catch'](handleError(_0x15c9aa,null));};exports[_0xb42e('0x46')]=function(_0x12acda,_0x241f93){var _0x54890a={'raw':!![],'where':{'id':_0x12acda['params']['id']}},_0x434fc1={};_0x434fc1[_0xb42e('0x30')]=_[_0xb42e('0x47')](db['CmHopperBlack'][_0xb42e('0x2d')]);_0x434fc1[_0xb42e('0x31')]=_[_0xb42e('0x47')](_0x12acda['query']);_0x434fc1['filters']=_[_0xb42e('0x33')](_0x434fc1[_0xb42e('0x30')],_0x434fc1[_0xb42e('0x31')]);_0x54890a[_0xb42e('0x34')]=_['intersection'](_0x434fc1[_0xb42e('0x30')],qs[_0xb42e('0x35')](_0x12acda[_0xb42e('0x31')][_0xb42e('0x35')]));_0x54890a[_0xb42e('0x34')]=_0x54890a[_0xb42e('0x34')][_0xb42e('0x36')]?_0x54890a['attributes']:_0x434fc1['model'];if(_0x12acda[_0xb42e('0x31')][_0xb42e('0x43')]){_0x54890a['include']=[{'all':!![]}];}_0x54890a=_['merge']({},_0x54890a,_0x12acda[_0xb42e('0x41')]);return db[_0xb42e('0x42')][_0xb42e('0x48')](_0x54890a)['then'](handleEntityNotFound(_0x241f93,null))[_0xb42e('0x26')](respondWithResult(_0x241f93,null))[_0xb42e('0x49')](handleError(_0x241f93,null));};exports[_0xb42e('0x25')]=function(_0x4dcbaf,_0x33ddc2){if(_0x4dcbaf[_0xb42e('0x4a')]['id']){delete _0x4dcbaf[_0xb42e('0x4a')]['id'];}return db['CmHopperBlack'][_0xb42e('0x48')]({'where':{'id':_0x4dcbaf['params']['id']}})[_0xb42e('0x26')](handleEntityNotFound(_0x33ddc2,null))['then'](saveUpdates(_0x4dcbaf['body'],null))[_0xb42e('0x26')](respondWithResult(_0x33ddc2,null))['catch'](handleError(_0x33ddc2,null));};exports[_0xb42e('0x27')]=function(_0x34254b,_0x126c3e){return db[_0xb42e('0x42')][_0xb42e('0x48')]({'where':{'id':_0x34254b[_0xb42e('0x4b')]['id']}})[_0xb42e('0x26')](handleEntityNotFound(_0x126c3e,null))[_0xb42e('0x26')](removeEntity(_0x126c3e,null))[_0xb42e('0x49')](handleError(_0x126c3e,null));};exports['describe']=function(_0x5247a6,_0x536463){return db[_0xb42e('0x42')][_0xb42e('0x4c')]()[_0xb42e('0x26')](respondWithResult(_0x536463,null))['catch'](handleError(_0x536463,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3966a4d..5511d13 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 _0x6a12=['request-promise','path','rimraf','exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','moment','bluebird'];(function(_0x1e5341,_0x2a882a){var _0x5d89bd=function(_0x255efa){while(--_0x255efa){_0x1e5341['push'](_0x1e5341['shift']());}};_0x5d89bd(++_0x2a882a);}(_0x6a12,0x1b4));var _0x26a1=function(_0x48650e,_0x1de45e){_0x48650e=_0x48650e-0x0;var _0x1e0cdb=_0x6a12[_0x48650e];return _0x1e0cdb;};'use strict';var _=require(_0x26a1('0x0'));var util=require('util');var logger=require(_0x26a1('0x1'))('api');var moment=require(_0x26a1('0x2'));var BPromise=require(_0x26a1('0x3'));var rp=require(_0x26a1('0x4'));var fs=require('fs');var path=require(_0x26a1('0x5'));var rimraf=require(_0x26a1('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x26a1('0x7')]=function(_0xd7d2d9,_0x5bfa4e){return _0xd7d2d9[_0x26a1('0x8')](_0x26a1('0x9'),attributes,{'tableName':_0x26a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c1b=['lodash','../../config/logger','api','moment','bluebird','path','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black'];(function(_0x1fc1c4,_0x12e2fb){var _0x52fc4b=function(_0x442595){while(--_0x442595){_0x1fc1c4['push'](_0x1fc1c4['shift']());}};_0x52fc4b(++_0x12e2fb);}(_0x8c1b,0xa0));var _0xb8c1=function(_0x1e856a,_0x24867d){_0x1e856a=_0x1e856a-0x0;var _0x2234ea=_0x8c1b[_0x1e856a];return _0x2234ea;};'use strict';var _=require(_0xb8c1('0x0'));var util=require('util');var logger=require(_0xb8c1('0x1'))(_0xb8c1('0x2'));var moment=require(_0xb8c1('0x3'));var BPromise=require(_0xb8c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8c1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb8c1('0x6'));module['exports']=function(_0x58815e,_0x3f1274){return _0x58815e[_0xb8c1('0x7')](_0xb8c1('0x8'),attributes,{'tableName':_0xb8c1('0x9'),'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 58ec489..d21d83b 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 _0x82cd=['stringify','error','code','message','info','request\x20sent','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x376ee8,_0x741bfd){var _0x29ad2a=function(_0x43d4bd){while(--_0x43d4bd){_0x376ee8['push'](_0x376ee8['shift']());}};_0x29ad2a(++_0x741bfd);}(_0x82cd,0xca));var _0xd82c=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x82cd[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0xd82c('0x0'));var moment=require(_0xd82c('0x1'));var BPromise=require(_0xd82c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd82c('0x3'))['db'];var utils=require(_0xd82c('0x4'));var logger=require(_0xd82c('0x5'))(_0xd82c('0x6'));var config=require(_0xd82c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd82c('0x8')][_0xd82c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de229,_0x24479c,_0x546123){return new BPromise(function(_0x778fc9,_0x57a7d6){return client['request'](_0x4de229,_0x546123)[_0xd82c('0xa')](function(_0x1da62d){logger['info'](_0xd82c('0xb'),_0x24479c,'request\x20sent');logger[_0xd82c('0xc')](_0xd82c('0xd'),_0x24479c,'request\x20sent',JSON[_0xd82c('0xe')](_0x1da62d));if(_0x1da62d[_0xd82c('0xf')]){if(_0x1da62d[_0xd82c('0xf')][_0xd82c('0x10')]===0x1f4){logger['error'](_0xd82c('0xb'),_0x24479c,_0x1da62d['error'][_0xd82c('0x11')]);return _0x57a7d6(_0x1da62d['error'][_0xd82c('0x11')]);}logger[_0xd82c('0xf')](_0xd82c('0xb'),_0x24479c,_0x1da62d[_0xd82c('0xf')][_0xd82c('0x11')]);return _0x778fc9(_0x1da62d['error'][_0xd82c('0x11')]);}else{logger[_0xd82c('0x12')](_0xd82c('0xb'),_0x24479c,_0xd82c('0x13'));_0x778fc9(_0x1da62d['result'][_0xd82c('0x11')]);}})[_0xd82c('0x14')](function(_0x50e2a0){logger['error'](_0xd82c('0xb'),_0x24479c,_0x50e2a0);_0x57a7d6(_0x50e2a0);});});}exports[_0xd82c('0x15')]=function(_0x1c0d51){var _0x120ed3=this;return new Promise(function(_0xcc7516,_0x3aa86b){return db[_0xd82c('0x16')][_0xd82c('0x17')]({'raw':_0x1c0d51[_0xd82c('0x18')]?_0x1c0d51[_0xd82c('0x18')][_0xd82c('0x19')]===undefined?!![]:![]:!![],'where':_0x1c0d51['options']?_0x1c0d51[_0xd82c('0x18')][_0xd82c('0x1a')]||null:null,'attributes':_0x1c0d51[_0xd82c('0x18')]?_0x1c0d51['options'][_0xd82c('0x1b')]||null:null,'limit':_0x1c0d51['options']?_0x1c0d51[_0xd82c('0x18')][_0xd82c('0x1c')]||null:null,'include':_0x1c0d51[_0xd82c('0x18')]?_0x1c0d51[_0xd82c('0x18')]['include']?_['map'](_0x1c0d51[_0xd82c('0x18')]['include'],function(_0x251ac0){return{'model':db[_0x251ac0['model']],'as':_0x251ac0['as'],'attributes':_0x251ac0[_0xd82c('0x1b')],'include':_0x251ac0[_0xd82c('0x1d')]?_['map'](_0x251ac0[_0xd82c('0x1d')],function(_0x443492){return{'model':db[_0x443492[_0xd82c('0x1e')]],'as':_0x443492['as'],'attributes':_0x443492['attributes'],'include':_0x443492['include']?_[_0xd82c('0x1f')](_0x443492[_0xd82c('0x1d')],function(_0x3c32a7){return{'model':db[_0x3c32a7['model']],'as':_0x3c32a7['as'],'attributes':_0x3c32a7[_0xd82c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd82c('0xa')](function(_0x3b3564){logger['info'](_0xd82c('0x15'),_0x1c0d51);logger[_0xd82c('0xc')]('GetCmHopperBlack',_0x1c0d51,JSON[_0xd82c('0xe')](_0x3b3564));_0xcc7516(_0x3b3564);})['catch'](function(_0x1a1c2b){logger[_0xd82c('0xf')](_0xd82c('0x15'),_0x1a1c2b[_0xd82c('0x11')],_0x1c0d51);_0x3aa86b(_0x120ed3['error'](0x1f4,_0x1a1c2b['message']));});});};exports[_0xd82c('0x20')]=function(_0x3ce9f9){var _0x4500be=this;return new Promise(function(_0xae42f8,_0xf0a447){return db[_0xd82c('0x16')]['update'](_0x3ce9f9[_0xd82c('0x21')],{'raw':_0x3ce9f9[_0xd82c('0x18')]?_0x3ce9f9['options'][_0xd82c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce9f9[_0xd82c('0x18')]?_0x3ce9f9[_0xd82c('0x18')]['where']||null:null,'attributes':_0x3ce9f9['options']?_0x3ce9f9[_0xd82c('0x18')][_0xd82c('0x1b')]||null:null,'limit':_0x3ce9f9[_0xd82c('0x18')]?_0x3ce9f9['options'][_0xd82c('0x1c')]||null:null})['then'](function(_0x2c16bf){logger[_0xd82c('0x12')](_0xd82c('0x20'),_0x3ce9f9);logger[_0xd82c('0xc')](_0xd82c('0x20'),_0x3ce9f9,JSON['stringify'](_0x2c16bf));_0xae42f8(_0x2c16bf);})[_0xd82c('0x14')](function(_0x495871){logger['error'](_0xd82c('0x20'),_0x495871['message'],_0x3ce9f9);_0xf0a447(_0x4500be[_0xd82c('0xf')](0x1f4,_0x495871[_0xd82c('0x11')]));});});};exports[_0xd82c('0x22')]=function(_0x47b004){var _0x5e1187=this;return new Promise(function(_0x11dd00,_0x2ee673){return db[_0xd82c('0x16')][_0xd82c('0x23')]({'where':_0x47b004['options']?_0x47b004[_0xd82c('0x18')]['where']||null:null})[_0xd82c('0xa')](function(_0x17af0a){logger[_0xd82c('0x12')](_0xd82c('0x22'),_0x47b004);logger[_0xd82c('0xc')](_0xd82c('0x22'),_0x47b004,JSON[_0xd82c('0xe')](_0x17af0a));_0x11dd00(_0x17af0a);})[_0xd82c('0x14')](function(_0x5b9abb){logger[_0xd82c('0xf')](_0xd82c('0x22'),_0x5b9abb[_0xd82c('0x11')],_0x47b004);_0x2ee673(_0x5e1187[_0xd82c('0xf')](0x1f4,_0x5b9abb[_0xd82c('0x11')]));});});}; \ No newline at end of file +var _0x96a8=['catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5c608a,_0x22054b){var _0x9b206e=function(_0x26c722){while(--_0x26c722){_0x5c608a['push'](_0x5c608a['shift']());}};_0x9b206e(++_0x22054b);}(_0x96a8,0x112));var _0x896a=function(_0x34e17a,_0x118bcc){_0x34e17a=_0x34e17a-0x0;var _0xbed956=_0x96a8[_0x34e17a];return _0xbed956;};'use strict';var _=require('lodash');var util=require(_0x896a('0x0'));var moment=require(_0x896a('0x1'));var BPromise=require(_0x896a('0x2'));var rs=require(_0x896a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x896a('0x4'))['db'];var utils=require(_0x896a('0x5'));var logger=require(_0x896a('0x6'))(_0x896a('0x7'));var config=require('../../config/environment');var jayson=require(_0x896a('0x8'));var client=jayson[_0x896a('0x9')][_0x896a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d2b5b,_0x781df3,_0x330140){return new BPromise(function(_0x15edfe,_0x1d4d0b){return client[_0x896a('0xb')](_0x4d2b5b,_0x330140)[_0x896a('0xc')](function(_0x27238f){logger[_0x896a('0xd')](_0x896a('0xe'),_0x781df3,_0x896a('0xf'));logger[_0x896a('0x10')](_0x896a('0x11'),_0x781df3,_0x896a('0xf'),JSON[_0x896a('0x12')](_0x27238f));if(_0x27238f[_0x896a('0x13')]){if(_0x27238f[_0x896a('0x13')][_0x896a('0x14')]===0x1f4){logger[_0x896a('0x13')](_0x896a('0xe'),_0x781df3,_0x27238f[_0x896a('0x13')][_0x896a('0x15')]);return _0x1d4d0b(_0x27238f[_0x896a('0x13')][_0x896a('0x15')]);}logger[_0x896a('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x781df3,_0x27238f[_0x896a('0x13')]['message']);return _0x15edfe(_0x27238f[_0x896a('0x13')]['message']);}else{logger[_0x896a('0xd')](_0x896a('0xe'),_0x781df3,'request\x20sent');_0x15edfe(_0x27238f['result'][_0x896a('0x15')]);}})[_0x896a('0x16')](function(_0x2a1856){logger[_0x896a('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x781df3,_0x2a1856);_0x1d4d0b(_0x2a1856);});});}exports['GetCmHopperBlack']=function(_0x34b694){var _0x3e7d74=this;return new Promise(function(_0x25d4ac,_0x2ab255){return db[_0x896a('0x17')][_0x896a('0x18')]({'raw':_0x34b694[_0x896a('0x19')]?_0x34b694[_0x896a('0x19')][_0x896a('0x1a')]===undefined?!![]:![]:!![],'where':_0x34b694[_0x896a('0x19')]?_0x34b694['options'][_0x896a('0x1b')]||null:null,'attributes':_0x34b694[_0x896a('0x19')]?_0x34b694[_0x896a('0x19')][_0x896a('0x1c')]||null:null,'limit':_0x34b694[_0x896a('0x19')]?_0x34b694[_0x896a('0x19')][_0x896a('0x1d')]||null:null,'include':_0x34b694['options']?_0x34b694[_0x896a('0x19')][_0x896a('0x1e')]?_[_0x896a('0x1f')](_0x34b694[_0x896a('0x19')][_0x896a('0x1e')],function(_0x5a43b5){return{'model':db[_0x5a43b5[_0x896a('0x20')]],'as':_0x5a43b5['as'],'attributes':_0x5a43b5['attributes'],'include':_0x5a43b5['include']?_['map'](_0x5a43b5[_0x896a('0x1e')],function(_0x1937a1){return{'model':db[_0x1937a1[_0x896a('0x20')]],'as':_0x1937a1['as'],'attributes':_0x1937a1[_0x896a('0x1c')],'include':_0x1937a1['include']?_['map'](_0x1937a1[_0x896a('0x1e')],function(_0x2b2ebf){return{'model':db[_0x2b2ebf[_0x896a('0x20')]],'as':_0x2b2ebf['as'],'attributes':_0x2b2ebf[_0x896a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x896a('0xc')](function(_0x164020){logger['info'](_0x896a('0x21'),_0x34b694);logger[_0x896a('0x10')](_0x896a('0x21'),_0x34b694,JSON[_0x896a('0x12')](_0x164020));_0x25d4ac(_0x164020);})['catch'](function(_0x187d3f){logger[_0x896a('0x13')](_0x896a('0x21'),_0x187d3f[_0x896a('0x15')],_0x34b694);_0x2ab255(_0x3e7d74[_0x896a('0x13')](0x1f4,_0x187d3f[_0x896a('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x16619a){var _0x16e506=this;return new Promise(function(_0x5b2f5d,_0xa4e895){return db['CmHopperBlack']['update'](_0x16619a['body'],{'raw':_0x16619a[_0x896a('0x19')]?_0x16619a['options'][_0x896a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16619a[_0x896a('0x19')]?_0x16619a[_0x896a('0x19')][_0x896a('0x1b')]||null:null,'attributes':_0x16619a[_0x896a('0x19')]?_0x16619a['options'][_0x896a('0x1c')]||null:null,'limit':_0x16619a[_0x896a('0x19')]?_0x16619a[_0x896a('0x19')][_0x896a('0x1d')]||null:null})[_0x896a('0xc')](function(_0x5d3d22){logger[_0x896a('0xd')](_0x896a('0x22'),_0x16619a);logger[_0x896a('0x10')]('UpdateCmHopperBlack',_0x16619a,JSON['stringify'](_0x5d3d22));_0x5b2f5d(_0x5d3d22);})[_0x896a('0x16')](function(_0x354d67){logger[_0x896a('0x13')]('UpdateCmHopperBlack',_0x354d67[_0x896a('0x15')],_0x16619a);_0xa4e895(_0x16e506['error'](0x1f4,_0x354d67[_0x896a('0x15')]));});});};exports[_0x896a('0x23')]=function(_0x51bd1a){var _0x5e9c9a=this;return new Promise(function(_0x202f11,_0x3c1058){return db[_0x896a('0x17')][_0x896a('0x24')]({'where':_0x51bd1a['options']?_0x51bd1a[_0x896a('0x19')][_0x896a('0x1b')]||null:null})[_0x896a('0xc')](function(_0x2ebbd0){logger['info'](_0x896a('0x23'),_0x51bd1a);logger['debug'](_0x896a('0x23'),_0x51bd1a,JSON['stringify'](_0x2ebbd0));_0x202f11(_0x2ebbd0);})[_0x896a('0x16')](function(_0x43ecc4){logger[_0x896a('0x13')](_0x896a('0x23'),_0x43ecc4['message'],_0x51bd1a);_0x3c1058(_0x5e9c9a[_0x896a('0x13')](0x1f4,_0x43ecc4['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2d6ac9b..32f4ba2 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 _0x7278=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x7278,0x161));var _0x8727=function(_0x1704b6,_0xe479fe){_0x1704b6=_0x1704b6-0x0;var _0x132e86=_0x7278[_0x1704b6];return _0x132e86;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xe')](_0x8727('0xf'),auth[_0x8727('0xb')](),controller[_0x8727('0x10')]);router[_0x8727('0x11')](_0x8727('0xf'),auth[_0x8727('0xb')](),controller[_0x8727('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1967=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x335fff,_0x86276e){var _0x4b0500=function(_0x5679d8){while(--_0x5679d8){_0x335fff['push'](_0x335fff['shift']());}};_0x4b0500(++_0x86276e);}(_0x1967,0x173));var _0x7196=function(_0x337f02,_0x4ebdac){_0x337f02=_0x337f02-0x0;var _0x305bae=_0x1967[_0x337f02];return _0x305bae;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')](_0x7196('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x7196('0x12')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);module[_0x7196('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7294703..d89f9d2 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 _0xe925=['STRING','followuptime','diff','BOOLEAN','moment','exports','INTEGER','DATE'];(function(_0x4b4090,_0x3a64ac){var _0xb90451=function(_0x5ba3f8){while(--_0x5ba3f8){_0x4b4090['push'](_0x4b4090['shift']());}};_0xb90451(++_0x3a64ac);}(_0xe925,0x18c));var _0x5e92=function(_0x2bfc9f,_0x570407){_0x2bfc9f=_0x2bfc9f-0x0;var _0x36ba81=_0xe925[_0x2bfc9f];return _0x36ba81;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5e92('0x0'));module[_0x5e92('0x1')]={'state':{'type':Sequelize[_0x5e92('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5e92('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5e92('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x5e92('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5e92('0x4')]},'starttime':{'type':Sequelize[_0x5e92('0x3')]},'responsetime':{'type':Sequelize[_0x5e92('0x3')]},'answertime':{'type':Sequelize[_0x5e92('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5e92('0x3')]},'ringtime':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x5e92('0x4')]},'campaigntype':{'type':Sequelize[_0x5e92('0x4')]},'membername':{'type':Sequelize[_0x5e92('0x4')]},'reason':{'type':Sequelize[_0x5e92('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5e92('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5e92('0x4')]},'dispositionat':{'type':Sequelize[_0x5e92('0x3')],'set':function(_0x2ede27){var _0x1b278d=this['getDataValue']('endtime');if(_0x1b278d&&_0x2ede27){this['setDataValue'](_0x5e92('0x5'),moment(_0x2ede27)[_0x5e92('0x6')](moment(_0x1b278d),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x5e92('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5e92('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5e92('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5e92('0x3')]},'callback':{'type':Sequelize[_0x5e92('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5e92('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5e92('0x3')]},'deleted':{'type':Sequelize[_0x5e92('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5e92('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5e92('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5e92('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4d9b=['sequelize','moment','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN'];(function(_0x34715e,_0x3cab46){var _0x54df89=function(_0x15bee4){while(--_0x15bee4){_0x34715e['push'](_0x34715e['shift']());}};_0x54df89(++_0x3cab46);}(_0x4d9b,0x79));var _0xb4d9=function(_0x1bb161,_0x25b93c){_0x1bb161=_0x1bb161-0x0;var _0x2d4246=_0x4d9b[_0x1bb161];return _0x2d4246;};'use strict';var Sequelize=require(_0xb4d9('0x0'));var moment=require(_0xb4d9('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb4d9('0x2')]},'scheduledat':{'type':Sequelize[_0xb4d9('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb4d9('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb4d9('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb4d9('0x2')]},'calleridnum':{'type':Sequelize[_0xb4d9('0x2')]},'calleridname':{'type':Sequelize[_0xb4d9('0x2')]},'starttime':{'type':Sequelize[_0xb4d9('0x3')]},'responsetime':{'type':Sequelize[_0xb4d9('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xb4d9('0x3')]},'endtime':{'type':Sequelize[_0xb4d9('0x3')]},'ringtime':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb4d9('0x2')]},'campaigntype':{'type':Sequelize[_0xb4d9('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb4d9('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb4d9('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb4d9('0x2')]},'dispositionat':{'type':Sequelize[_0xb4d9('0x3')],'set':function(_0x1d8964){var _0x54b759=this[_0xb4d9('0x5')](_0xb4d9('0x6'));if(_0x54b759&&_0x1d8964){this[_0xb4d9('0x7')]('followuptime',moment(_0x1d8964)[_0xb4d9('0x8')](moment(_0x54b759),_0xb4d9('0x9')));}}},'amd':{'type':Sequelize[_0xb4d9('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb4d9('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb4d9('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb4d9('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb4d9('0x3')]},'callback':{'type':Sequelize[_0xb4d9('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb4d9('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb4d9('0x3')]},'deleted':{'type':Sequelize[_0xb4d9('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb4d9('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb4d9('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb4d9('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb4d9('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 d33f38b..42fe47d 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 _0x1261=['attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','CmHopperFinal','model','map','name','keys','query','intersection'];(function(_0x362d40,_0x2fb08f){var _0x43a265=function(_0x5af9fd){while(--_0x5af9fd){_0x362d40['push'](_0x362d40['shift']());}};_0x43a265(++_0x2fb08f);}(_0x1261,0x144));var _0x1126=function(_0x140202,_0x4245c7){_0x140202=_0x140202-0x0;var _0x3037c2=_0x1261[_0x140202];return _0x3037c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['CmHopperFinal'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['CmHopperFinal']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')]()['then'](respondWithResult(_0x5111d3,null))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports[_0x1126('0x24')]=function(_0x518e0a,_0x3e4eeb){if(_0x518e0a[_0x1126('0x44')][_0x1126('0x45')]){delete _0x518e0a['body'][_0x1126('0x45')];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'uniqueid':_0x518e0a[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x25')](saveUpdates(_0x518e0a[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0x3e4eeb,null))['catch'](handleError(_0x3e4eeb,null));};exports[_0x1126('0x46')]=function(_0x5a2287,_0x40168e,_0x2ad118){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x5a2287[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4a')))),_0x1126('0x4b')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x4e')))),_0x1126('0x4f')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1126('0x50')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1126('0x51')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),_0x1126('0x53')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x25')](respondWithResult(_0x40168e,null))[_0x1126('0x43')](handleError(_0x40168e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xcc1a95,_0x315386,_0x5e0ea1){return db[_0x1126('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0xcc1a95[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x1126('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x56')))),_0x1126('0x57')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x58')))),'dropContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x59')))),_0x1126('0x51')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x315386,null))[_0x1126('0x25')](respondWithResult(_0x315386,null))[_0x1126('0x43')](handleError(_0x315386,null));};exports[_0x1126('0x5a')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){return db[_0x1126('0x5b')][_0x1126('0x41')]({'where':{'id':_0x247f12[_0x1126('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x25')](function(_0x274343){var _0x2b61ae;if(_0x274343){_0x2b61ae=squel['insert']()['into'](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),'ContactId','ListId','VoiceQueueId',_0x1126('0x60'),_0x1126('0x61')],squel[_0x1126('0x62')]()[_0x1126('0x63')]('ANY_VALUE(calleridnum)',_0x1126('0x5e'))['field'](_0x1126('0x64'),_0x1126('0x5f'))[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),'ListId')[_0x1126('0x63')]('ANY_VALUE(VoiceQueueId)',_0x1126('0x68'))[_0x1126('0x63')]('NOW()',_0x1126('0x60'))[_0x1126('0x63')]('NOW()',_0x1126('0x61'))[_0x1126('0x69')]('cm_hopper_final')['where'](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())['where']('state\x20=\x20?',_0x247f12['body'][_0x1126('0x6c')]['toString']())['where'](_0x1126('0x6d'))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()['field'](_0x1126('0x5e'))[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12['params']['id'][_0x1126('0x6b')]()))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')](_0x1126('0x71')))[_0x1126('0x72')](_0x1126('0x66')))[_0x1126('0x6b')]();return db[_0x1126('0x47')][_0x1126('0x2e')](_0x2b61ae);}return[];})['then'](respondWithResult(_0xd20fbe,null))[_0x1126('0x43')](handleError(_0xd20fbe,null));};exports[_0x1126('0x73')]=function(_0x33cccf,_0x1483f4,_0x3be5bf){return db['Campaign'][_0x1126('0x41')]({'where':{'id':_0x33cccf['params']['id']}})['then'](handleEntityNotFound(_0x1483f4,null))[_0x1126('0x25')](function(_0x2b1884){var _0x55f366;if(_0x2b1884){_0x55f366=squel['insert']()[_0x1126('0x74')](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),_0x1126('0x66'),_0x1126('0x75'),_0x1126('0x76'),_0x1126('0x60'),'updatedAt'],squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x77'),_0x1126('0x5e'))[_0x1126('0x63')](_0x1126('0x64'),'scheduledAt')[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),_0x1126('0x75'))[_0x1126('0x63')](_0x1126('0x78'),_0x1126('0x76'))[_0x1126('0x63')]('NOW()','createdAt')[_0x1126('0x63')]('NOW()',_0x1126('0x61'))['from'](_0x1126('0x70'))['where'](_0x1126('0x79'),_0x33cccf['params']['id']['toString']())['where'](_0x1126('0x7a'),_0x33cccf[_0x1126('0x44')]['state']['toString']())[_0x1126('0x37')](_0x1126('0x6d'))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1126('0x63')]('phone')[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id']['toString']()))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')]('state\x20=\x204'))[_0x1126('0x72')]('ContactId'))[_0x1126('0x6b')]();return db['sequelize'][_0x1126('0x2e')](_0x55f366);}return[];})[_0x1126('0x25')](respondWithResult(_0x1483f4,null))[_0x1126('0x43')](handleError(_0x1483f4,null));};exports[_0x1126('0x7b')]=function(_0x59c04b,_0x429183,_0x834360){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x59c04b[_0x1126('0x44')][_0x1126('0x68')],'CampaignId':_0x59c04b[_0x1126('0x44')]['CampaignId'],'ContactId':_0x59c04b[_0x1126('0x44')]['ContactId']}})[_0x1126('0x25')](handleEntityNotFound(_0x429183,null))[_0x1126('0x25')](function(_0x4d6bb2){if(_0x4d6bb2){return _0x4d6bb2;}return null;})[_0x1126('0x25')](respondWithResult(_0x429183,null))[_0x1126('0x43')](handleError(_0x429183,null));}; \ No newline at end of file +var _0x9536=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','CmHopperFinal','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ListId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ListId)','CampaignId\x20=\x20?','cm_hopper_final','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0xb86aec,_0x850563){var _0x4d14a6=function(_0x154f5c){while(--_0x154f5c){_0xb86aec['push'](_0xb86aec['shift']());}};_0x4d14a6(++_0x850563);}(_0x9536,0x179));var _0x6953=function(_0x4b1665,_0xb0c095){_0x4b1665=_0x4b1665-0x0;var _0x5850c0=_0x9536[_0x4b1665];return _0x5850c0;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':!![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['describe']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['describe']()[_0x6953('0x3c')](respondWithResult(_0x1d5979,null))[_0x6953('0x41')](handleError(_0x1d5979,null));};exports['update']=function(_0x525145,_0xbf5b61){if(_0x525145[_0x6953('0x48')][_0x6953('0x49')]){delete _0x525145[_0x6953('0x48')][_0x6953('0x49')];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'uniqueid':_0x525145[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xbf5b61,null))[_0x6953('0x3c')](saveUpdates(_0x525145[_0x6953('0x48')],null))['then'](respondWithResult(_0xbf5b61,null))['catch'](handleError(_0xbf5b61,null));};exports[_0x6953('0x4a')]=function(_0x38e3e8,_0x68ab5d,_0x7bcd92){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x38e3e8[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db['sequelize']['fn']('COUNT',db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db['sequelize']['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db['sequelize']['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x57')))),'reCallContacts'],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x58')))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x68ab5d,null))['then'](respondWithResult(_0x68ab5d,null))[_0x6953('0x41')](handleError(_0x68ab5d,null));};exports[_0x6953('0x5a')]=function(_0x35ac0e,_0x57ffab,_0x479ab4){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'CampaignId':_0x35ac0e[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5b')))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5c')))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5d')))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x57')))),_0x6953('0x5e')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x57ffab,null))['then'](respondWithResult(_0x57ffab,null))[_0x6953('0x41')](handleError(_0x57ffab,null));};exports[_0x6953('0x5f')]=function(_0x41d74d,_0x5063ac,_0x4cb8a4){return db[_0x6953('0x60')][_0x6953('0x47')]({'where':{'id':_0x41d74d[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x5063ac,null))[_0x6953('0x3c')](function(_0x43a39f){var _0x3cf1c0;if(_0x43a39f){_0x3cf1c0=squel[_0x6953('0x61')]()[_0x6953('0x62')]('cm_hopper')[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),_0x6953('0x66'),'ListId',_0x6953('0x67'),_0x6953('0x68'),_0x6953('0x69')],squel['select']()[_0x6953('0x6a')](_0x6953('0x6b'),_0x6953('0x64'))[_0x6953('0x6a')]('NOW()',_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field']('ANY_VALUE(ListId)',_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x68'))[_0x6953('0x6a')]('NOW()',_0x6953('0x69'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id']['toString']())['where'](_0x6953('0x71'),_0x41d74d[_0x6953('0x48')][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x64'))[_0x6953('0x6f')](_0x6953('0x76'))[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id'][_0x6953('0x73')]()))['where'](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x77'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))['group'](_0x6953('0x66')))[_0x6953('0x73')]();return db[_0x6953('0x4b')][_0x6953('0x2e')](_0x3cf1c0);}return[];})[_0x6953('0x3c')](respondWithResult(_0x5063ac,null))[_0x6953('0x41')](handleError(_0x5063ac,null));};exports[_0x6953('0x79')]=function(_0xa26241,_0xefb593,_0x216b92){return db[_0x6953('0x7a')]['find']({'where':{'id':_0xa26241[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xefb593,null))[_0x6953('0x3c')](function(_0x396a9f){var _0x92c0bc;if(_0x396a9f){_0x92c0bc=squel[_0x6953('0x61')]()[_0x6953('0x62')](_0x6953('0x76'))[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),'ContactId',_0x6953('0x6d'),_0x6953('0x7b'),_0x6953('0x68'),'updatedAt'],squel[_0x6953('0x7c')]()['field']('ANY_VALUE(calleridnum)',_0x6953('0x64'))[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field'](_0x6953('0x7d'),_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(CampaignId)',_0x6953('0x7b'))[_0x6953('0x6a')]('NOW()',_0x6953('0x68'))['field']('NOW()',_0x6953('0x69'))['from']('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id']['toString']())[_0x6953('0x39')](_0x6953('0x71'),_0xa26241['body'][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x64'))['from'](_0x6953('0x76'))[_0x6953('0x39')]('CampaignId\x20=\x20?',_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]()))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x77'))['from'](_0x6953('0x7f'))[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))[_0x6953('0x80')](_0x6953('0x66')))['toString']();return db[_0x6953('0x4b')]['query'](_0x92c0bc);}return[];})[_0x6953('0x3c')](respondWithResult(_0xefb593,null))['catch'](handleError(_0xefb593,null));};exports[_0x6953('0x81')]=function(_0x7215ed,_0x3cb96a,_0x46bcec){return db[_0x6953('0x82')]['findOne']({'where':{'VoiceQueueId':_0x7215ed[_0x6953('0x48')]['VoiceQueueId'],'CampaignId':_0x7215ed[_0x6953('0x48')][_0x6953('0x7b')],'ContactId':_0x7215ed[_0x6953('0x48')][_0x6953('0x66')]}})['then'](handleEntityNotFound(_0x3cb96a,null))[_0x6953('0x3c')](function(_0x50f019){if(_0x50f019){return _0x50f019;}return null;})[_0x6953('0x3c')](respondWithResult(_0x3cb96a,null))[_0x6953('0x41')](handleError(_0x3cb96a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a74af49..2a3010b 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 _0xfda9=['request-promise','path','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3d4f9b,_0x1db509){var _0xecbc47=function(_0x5cdc1e){while(--_0x5cdc1e){_0x3d4f9b['push'](_0x3d4f9b['shift']());}};_0xecbc47(++_0x1db509);}(_0xfda9,0x157));var _0x9fda=function(_0x1b209f,_0x5e75ee){_0x1b209f=_0x1b209f-0x0;var _0x20446f=_0xfda9[_0x1b209f];return _0x20446f;};'use strict';var _=require(_0x9fda('0x0'));var util=require('util');var logger=require(_0x9fda('0x1'))(_0x9fda('0x2'));var moment=require(_0x9fda('0x3'));var BPromise=require(_0x9fda('0x4'));var rp=require(_0x9fda('0x5'));var fs=require('fs');var path=require(_0x9fda('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9fda('0x7'));module[_0x9fda('0x8')]=function(_0xb1f20e,_0x718369){return _0xb1f20e['define'](_0x9fda('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x9fda('0xa'),'fields':[_0x9fda('0xa')]},{'name':'uniqueid','fields':[_0x9fda('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe794=['../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','request-promise'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xe794,0x1c3));var _0x4e79=function(_0x3ef7f3,_0xbe54d9){_0x3ef7f3=_0x3ef7f3-0x0;var _0x4a0c5c=_0xe794[_0x3ef7f3];return _0x4a0c5c;};'use strict';var _=require('lodash');var util=require(_0x4e79('0x0'));var logger=require(_0x4e79('0x1'))(_0x4e79('0x2'));var moment=require(_0x4e79('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e79('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e79('0x5'));var attributes=require(_0x4e79('0x6'));module[_0x4e79('0x7')]=function(_0x1af3f9,_0x32c9a9){return _0x1af3f9[_0x4e79('0x8')]('CmHopperFinal',attributes,{'tableName':_0x4e79('0x9'),'paranoid':![],'indexes':[{'name':_0x4e79('0xa'),'fields':[_0x4e79('0xa')]},{'name':_0x4e79('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 1686f48..f72275d 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(_0x57f424,_0x3d9150){var _0x1b0ef0=function(_0x4f9356){while(--_0x4f9356){_0x57f424['push'](_0x57f424['shift']());}};_0x1b0ef0(++_0x3d9150);}(_0x7a54,0x106));var _0x47a5=function(_0x28b328,_0x2a04e0){_0x28b328=_0x28b328-0x0;var _0x3a58a4=_0x7a54[_0x28b328];return _0x3a58a4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2fa248,_0x4ec741){var _0x39668c=function(_0x4f15a7){while(--_0x4f15a7){_0x2fa248['push'](_0x2fa248['shift']());}};_0x39668c(++_0x4ec741);}(_0x7a54,0x106));var _0x47a5=function(_0xf8cd01,_0x3ff327){_0xf8cd01=_0xf8cd01-0x0;var _0x5ca99d=_0x7a54[_0xf8cd01];return _0x5ca99d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 80cd972..aa3f737 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 _0xcd78=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','multer','util','connect-timeout','express','Router','fs-extra','./cmHopperFinal.controller','isAuthenticated','index','get','/:id'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xcd78,0xa9));var _0x8cd7=function(_0x312818,_0x3e40ac){_0x312818=_0x312818-0x0;var _0x20a841=_0xcd78[_0x312818];return _0x20a841;};'use strict';var multer=require(_0x8cd7('0x0'));var util=require(_0x8cd7('0x1'));var path=require('path');var timeout=require(_0x8cd7('0x2'));var express=require(_0x8cd7('0x3'));var router=express[_0x8cd7('0x4')]();var fs_extra=require(_0x8cd7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8cd7('0x6'));router['get']('/',auth[_0x8cd7('0x7')](),controller[_0x8cd7('0x8')]);router[_0x8cd7('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8cd7('0x9')](_0x8cd7('0xa'),auth[_0x8cd7('0x7')](),controller['show']);router['get'](_0x8cd7('0xb'),auth[_0x8cd7('0x7')](),controller[_0x8cd7('0xc')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x8cd7('0xd')](_0x8cd7('0xe'),auth[_0x8cd7('0x7')](),controller[_0x8cd7('0xf')]);router[_0x8cd7('0xd')](_0x8cd7('0x10'),auth[_0x8cd7('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x8cd7('0xd')](_0x8cd7('0x11'),auth['isAuthenticated'](),controller[_0x8cd7('0x12')]);router['put'](_0x8cd7('0xa'),auth[_0x8cd7('0x7')](),controller[_0x8cd7('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc2c5=['/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index'];(function(_0x266945,_0x5c5e8c){var _0x4477d5=function(_0x18c0b2){while(--_0x18c0b2){_0x266945['push'](_0x266945['shift']());}};_0x4477d5(++_0x5c5e8c);}(_0xc2c5,0xe2));var _0x5c2c=function(_0x4f6395,_0x38d77a){_0x4f6395=_0x4f6395-0x0;var _0x13dc86=_0xc2c5[_0x4f6395];return _0x13dc86;};'use strict';var multer=require(_0x5c2c('0x0'));var util=require(_0x5c2c('0x1'));var path=require(_0x5c2c('0x2'));var timeout=require(_0x5c2c('0x3'));var express=require(_0x5c2c('0x4'));var router=express[_0x5c2c('0x5')]();var fs_extra=require(_0x5c2c('0x6'));var auth=require(_0x5c2c('0x7'));var interaction=require(_0x5c2c('0x8'));var config=require(_0x5c2c('0x9'));var controller=require(_0x5c2c('0xa'));router[_0x5c2c('0xb')]('/',auth[_0x5c2c('0xc')](),controller[_0x5c2c('0xd')]);router[_0x5c2c('0xb')](_0x5c2c('0xe'),auth['isAuthenticated'](),controller[_0x5c2c('0xf')]);router['get'](_0x5c2c('0x10'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x11')]);router[_0x5c2c('0xb')](_0x5c2c('0x12'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x13')]);router[_0x5c2c('0xb')](_0x5c2c('0x14'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x15')]);router[_0x5c2c('0x16')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x5c2c('0x17')]);router[_0x5c2c('0x16')](_0x5c2c('0x18'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x19')]);router[_0x5c2c('0x16')]('/checkContactHopper',auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x1a')]);router[_0x5c2c('0x1b')](_0x5c2c('0x10'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x1c')]);module[_0x5c2c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 444dc87..b6907a3 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 _0x2687=['INTEGER','STRING','BOOLEAN','sequelize','DATE'];(function(_0x4b31d5,_0x20934d){var _0x59f0c5=function(_0x197196){while(--_0x197196){_0x4b31d5['push'](_0x4b31d5['shift']());}};_0x59f0c5(++_0x20934d);}(_0x2687,0xbc));var _0x7268=function(_0x545a02,_0x2efaab){_0x545a02=_0x545a02-0x0;var _0x70e3e=_0x2687[_0x545a02];return _0x70e3e;};'use strict';var Sequelize=require(_0x7268('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7268('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7268('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x7268('0x3')]},'calleridnum':{'type':Sequelize[_0x7268('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7268('0x1')]},'responsetime':{'type':Sequelize[_0x7268('0x1')]},'answertime':{'type':Sequelize[_0x7268('0x1')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7268('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7268('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x7268('0x3')]},'membername':{'type':Sequelize[_0x7268('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x7268('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x7268('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7268('0x1')]},'recallme':{'type':Sequelize[_0x7268('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7268('0x1')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7268('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7268('0x3')]}}; \ No newline at end of file +var _0xa046=['DATE','STRING','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x26f9b7,_0x44adca){var _0x2a6eec=function(_0x253a07){while(--_0x253a07){_0x26f9b7['push'](_0x26f9b7['shift']());}};_0x2a6eec(++_0x44adca);}(_0xa046,0xab));var _0x6a04=function(_0x4607fe,_0x3124ef){_0x4607fe=_0x4607fe-0x0;var _0xf24567=_0xa046[_0x4607fe];return _0xf24567;};'use strict';var Sequelize=require(_0x6a04('0x0'));module[_0x6a04('0x1')]={'state':{'type':Sequelize[_0x6a04('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6a04('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6a04('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x6a04('0x4')]},'originatecalleridname':{'type':Sequelize[_0x6a04('0x4')]},'calleridnum':{'type':Sequelize[_0x6a04('0x4')]},'calleridname':{'type':Sequelize[_0x6a04('0x4')]},'starttime':{'type':Sequelize[_0x6a04('0x3')]},'responsetime':{'type':Sequelize[_0x6a04('0x3')]},'answertime':{'type':Sequelize[_0x6a04('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6a04('0x3')]},'ringtime':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6a04('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6a04('0x4')]},'membername':{'type':Sequelize[_0x6a04('0x4')]},'reason':{'type':Sequelize[_0x6a04('0x4')]},'amd':{'type':Sequelize[_0x6a04('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6a04('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6a04('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6a04('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6a04('0x3')]},'recallme':{'type':Sequelize[_0x6a04('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x6a04('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6a04('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6a04('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 17bd7fe..b5ac376 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 _0x8f01=['key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','CmHopperHistory','includeAll','include','findAll','rows','params','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','type'];(function(_0x32a18f,_0x1cacdf){var _0x29d31c=function(_0x48ae77){while(--_0x48ae77){_0x32a18f['push'](_0x32a18f['shift']());}};_0x29d31c(++_0x1cacdf);}(_0x8f01,0xfb));var _0x18f0=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x8f01[_0x1ebe90];return _0x447c82;};'use strict';var emlformat=require(_0x18f0('0x0'));var rimraf=require(_0x18f0('0x1'));var zipdir=require(_0x18f0('0x2'));var jsonpatch=require(_0x18f0('0x3'));var rp=require(_0x18f0('0x4'));var moment=require('moment');var BPromise=require(_0x18f0('0x5'));var Mustache=require(_0x18f0('0x6'));var util=require(_0x18f0('0x7'));var path=require(_0x18f0('0x8'));var sox=require(_0x18f0('0x9'));var csv=require(_0x18f0('0xa'));var ejs=require(_0x18f0('0xb'));var fs=require('fs');var fs_extra=require(_0x18f0('0xc'));var _=require('lodash');var squel=require(_0x18f0('0xd'));var crypto=require(_0x18f0('0xe'));var jsforce=require(_0x18f0('0xf'));var deskjs=require(_0x18f0('0x10'));var toCsv=require(_0x18f0('0xa'));var querystring=require(_0x18f0('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x18f0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x18f0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18f0('0x14'))(_0x18f0('0x15'));var utils=require(_0x18f0('0x16'));var config=require(_0x18f0('0x17'));var licenseUtil=require(_0x18f0('0x18'));var db=require(_0x18f0('0x19'))['db'];function respondWithStatusCode(_0x1d0fc3,_0x5256fa){_0x5256fa=_0x5256fa||0xcc;return function(_0x443e5b){if(_0x443e5b){return _0x1d0fc3[_0x18f0('0x1a')](_0x5256fa);}return _0x1d0fc3[_0x18f0('0x1b')](_0x5256fa)[_0x18f0('0x1c')]();};}function respondWithResult(_0x134792,_0x10fbbf){_0x10fbbf=_0x10fbbf||0xc8;return function(_0x1048f6){if(_0x1048f6){return _0x134792[_0x18f0('0x1b')](_0x10fbbf)[_0x18f0('0x1d')](_0x1048f6);}};}function respondWithFilteredResult(_0x89bc07,_0x55cadd){return function(_0x2c7767){if(_0x2c7767){var _0x53213e=typeof _0x55cadd[_0x18f0('0x1e')]==='undefined'&&typeof _0x55cadd[_0x18f0('0x1f')]==='undefined';var _0x42a874=_0x2c7767[_0x18f0('0x20')];var _0x101254=_0x53213e?0x0:_0x55cadd[_0x18f0('0x1e')];var _0x5e3c0b=_0x53213e?_0x2c7767['count']:_0x55cadd[_0x18f0('0x1e')]+_0x55cadd[_0x18f0('0x1f')];var _0x5578ad;if(_0x5e3c0b>=_0x42a874){_0x5e3c0b=_0x42a874;_0x5578ad=0xc8;}else{_0x5578ad=0xce;}_0x89bc07[_0x18f0('0x1b')](_0x5578ad);return _0x89bc07[_0x18f0('0x21')]('Content-Range',_0x101254+'-'+_0x5e3c0b+'/'+_0x42a874)[_0x18f0('0x1d')](_0x2c7767);}return null;};}function patchUpdates(_0x5251f2){return function(_0x375179){try{jsonpatch[_0x18f0('0x22')](_0x375179,_0x5251f2,!![]);}catch(_0x3e34ab){return BPromise['reject'](_0x3e34ab);}return _0x375179['save']();};}function saveUpdates(_0x3ab66a,_0x5dd9e3){return function(_0x5241b4){if(_0x5241b4){return _0x5241b4[_0x18f0('0x23')](_0x3ab66a)[_0x18f0('0x24')](function(_0x3bcc3f){return _0x3bcc3f;});}return null;};}function removeEntity(_0x314994,_0x53db8f){return function(_0x216dbf){if(_0x216dbf){return _0x216dbf[_0x18f0('0x25')]()['then'](function(){_0x314994['status'](0xcc)[_0x18f0('0x1c')]();});}};}function handleEntityNotFound(_0x58e830,_0x1e01aa){return function(_0x404882){if(!_0x404882){_0x58e830['sendStatus'](0x194);}return _0x404882;};}function handleError(_0x420585,_0xa04fea){_0xa04fea=_0xa04fea||0x1f4;return function(_0x174ddc){logger[_0x18f0('0x26')](_0x174ddc[_0x18f0('0x27')]);if(_0x174ddc[_0x18f0('0x28')]){delete _0x174ddc['name'];}_0x420585[_0x18f0('0x1b')](_0xa04fea)['send'](_0x174ddc);};}exports[_0x18f0('0x29')]=function(_0x6159b4,_0x3b7e58){var _0x11bc01={},_0x158c65={},_0x4d08f3={'count':0x0,'rows':[]};var _0x56a0d7=_[_0x18f0('0x2a')](db['CmHopperHistory'][_0x18f0('0x2b')],function(_0x4c95d9){return{'name':_0x4c95d9['fieldName'],'type':_0x4c95d9[_0x18f0('0x2c')][_0x18f0('0x2d')]};});_0x158c65['model']=_['map'](_0x56a0d7,_0x18f0('0x28'));_0x158c65[_0x18f0('0x2e')]=_[_0x18f0('0x2f')](_0x6159b4[_0x18f0('0x2e')]);_0x158c65[_0x18f0('0x30')]=_[_0x18f0('0x31')](_0x158c65[_0x18f0('0x32')],_0x158c65['query']);_0x11bc01[_0x18f0('0x33')]=_['intersection'](_0x158c65[_0x18f0('0x32')],qs[_0x18f0('0x34')](_0x6159b4[_0x18f0('0x2e')]['fields']));_0x11bc01[_0x18f0('0x33')]=_0x11bc01[_0x18f0('0x33')]['length']?_0x11bc01[_0x18f0('0x33')]:_0x158c65[_0x18f0('0x32')];if(!_0x6159b4[_0x18f0('0x2e')][_0x18f0('0x35')](_0x18f0('0x36'))){_0x11bc01[_0x18f0('0x1f')]=qs[_0x18f0('0x1f')](_0x6159b4[_0x18f0('0x2e')][_0x18f0('0x1f')]);_0x11bc01[_0x18f0('0x1e')]=qs[_0x18f0('0x1e')](_0x6159b4['query'][_0x18f0('0x1e')]);}_0x11bc01['order']=qs[_0x18f0('0x37')](_0x6159b4['query'][_0x18f0('0x37')]);_0x11bc01[_0x18f0('0x38')]=qs[_0x18f0('0x30')](_[_0x18f0('0x39')](_0x6159b4[_0x18f0('0x2e')],_0x158c65['filters']),_0x56a0d7);if(_0x6159b4['query'][_0x18f0('0x3a')]){_0x11bc01[_0x18f0('0x38')]=_['merge'](_0x11bc01[_0x18f0('0x38')],{'$or':_[_0x18f0('0x2a')](_0x56a0d7,function(_0x56f13c){if(_0x56f13c[_0x18f0('0x2c')]!==_0x18f0('0x3b')){var _0x5d8661={};_0x5d8661[_0x56f13c['name']]={'$like':'%'+_0x6159b4[_0x18f0('0x2e')][_0x18f0('0x3a')]+'%'};return _0x5d8661;}})});}_0x11bc01=_[_0x18f0('0x3c')]({},_0x11bc01,_0x6159b4[_0x18f0('0x3d')]);var _0x1e6db2={'where':_0x11bc01[_0x18f0('0x38')]};return db[_0x18f0('0x3e')][_0x18f0('0x20')](_0x1e6db2)['then'](function(_0x25d614){_0x4d08f3['count']=_0x25d614;if(_0x6159b4['query'][_0x18f0('0x3f')]){_0x11bc01[_0x18f0('0x40')]=[{'all':!![]}];}return db[_0x18f0('0x3e')][_0x18f0('0x41')](_0x11bc01);})[_0x18f0('0x24')](function(_0xd79bdf){_0x4d08f3[_0x18f0('0x42')]=_0xd79bdf;return _0x4d08f3;})[_0x18f0('0x24')](respondWithFilteredResult(_0x3b7e58,_0x11bc01))['catch'](handleError(_0x3b7e58,null));};exports['show']=function(_0x4de251,_0x4f0e38){var _0x2debf0={'raw':!![],'where':{'id':_0x4de251[_0x18f0('0x43')]['id']}},_0x51b415={};_0x51b415[_0x18f0('0x32')]=_['keys'](db[_0x18f0('0x3e')][_0x18f0('0x2b')]);_0x51b415[_0x18f0('0x2e')]=_[_0x18f0('0x2f')](_0x4de251['query']);_0x51b415[_0x18f0('0x30')]=_[_0x18f0('0x31')](_0x51b415[_0x18f0('0x32')],_0x51b415[_0x18f0('0x2e')]);_0x2debf0[_0x18f0('0x33')]=_[_0x18f0('0x31')](_0x51b415[_0x18f0('0x32')],qs[_0x18f0('0x34')](_0x4de251[_0x18f0('0x2e')][_0x18f0('0x34')]));_0x2debf0[_0x18f0('0x33')]=_0x2debf0[_0x18f0('0x33')]['length']?_0x2debf0[_0x18f0('0x33')]:_0x51b415['model'];if(_0x4de251[_0x18f0('0x2e')][_0x18f0('0x3f')]){_0x2debf0[_0x18f0('0x40')]=[{'all':!![]}];}_0x2debf0=_[_0x18f0('0x3c')]({},_0x2debf0,_0x4de251['options']);return db[_0x18f0('0x3e')][_0x18f0('0x44')](_0x2debf0)['then'](handleEntityNotFound(_0x4f0e38,null))[_0x18f0('0x24')](respondWithResult(_0x4f0e38,null))[_0x18f0('0x45')](handleError(_0x4f0e38,null));};exports[_0x18f0('0x46')]=function(_0x5cf2c4,_0x11f2f2){return db[_0x18f0('0x3e')][_0x18f0('0x46')](_0x5cf2c4[_0x18f0('0x47')],{})['then'](respondWithResult(_0x11f2f2,0xc9))['catch'](handleError(_0x11f2f2,null));};exports[_0x18f0('0x48')]=function(_0xdbdd16,_0x373b35){return db[_0x18f0('0x3e')]['describe']()[_0x18f0('0x24')](respondWithResult(_0x373b35,null))[_0x18f0('0x45')](handleError(_0x373b35,null));};exports[_0x18f0('0x23')]=function(_0x16a402,_0x59ea90){if(_0x16a402['body'][_0x18f0('0x49')]){delete _0x16a402['body'][_0x18f0('0x49')];}return db['CmHopperHistory'][_0x18f0('0x44')]({'where':{'uniqueid':_0x16a402[_0x18f0('0x43')]['id']}})[_0x18f0('0x24')](handleEntityNotFound(_0x59ea90,null))[_0x18f0('0x24')](saveUpdates(_0x16a402[_0x18f0('0x47')],null))[_0x18f0('0x24')](respondWithResult(_0x59ea90,null))[_0x18f0('0x45')](handleError(_0x59ea90,null));}; \ No newline at end of file +var _0x656a=['set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','filter','merge','includeAll','include','findAll','catch','show','keys','find','create','body','describe','uniqueid','params','eml-format','zip-dir','request-promise','moment','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','limit','count'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x656a,0x184));var _0xa656=function(_0x5285f9,_0x2bd7d7){_0x5285f9=_0x5285f9-0x0;var _0x6edc0c=_0x656a[_0x5285f9];return _0x6edc0c;};'use strict';var emlformat=require(_0xa656('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa656('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa656('0x2'));var moment=require(_0xa656('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa656('0x4'));var util=require('util');var path=require(_0xa656('0x5'));var sox=require(_0xa656('0x6'));var csv=require('to-csv');var ejs=require(_0xa656('0x7'));var fs=require('fs');var fs_extra=require(_0xa656('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa656('0x9'));var jsforce=require(_0xa656('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa656('0xb'));var querystring=require(_0xa656('0xc'));var Papa=require(_0xa656('0xd'));var Redis=require('ioredis');var authService=require(_0xa656('0xe'));var qs=require(_0xa656('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa656('0x10'));var logger=require(_0xa656('0x11'))(_0xa656('0x12'));var utils=require(_0xa656('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa656('0x14'))['db'];function respondWithStatusCode(_0xd80386,_0x3bd2f5){_0x3bd2f5=_0x3bd2f5||0xcc;return function(_0x11458e){if(_0x11458e){return _0xd80386['sendStatus'](_0x3bd2f5);}return _0xd80386[_0xa656('0x15')](_0x3bd2f5)['end']();};}function respondWithResult(_0x1bdb0b,_0x1cfd98){_0x1cfd98=_0x1cfd98||0xc8;return function(_0x3fe673){if(_0x3fe673){return _0x1bdb0b['status'](_0x1cfd98)['json'](_0x3fe673);}};}function respondWithFilteredResult(_0x496444,_0x32a3d8){return function(_0x5326db){if(_0x5326db){var _0x3674a3=typeof _0x32a3d8[_0xa656('0x16')]===_0xa656('0x17')&&typeof _0x32a3d8[_0xa656('0x18')]===_0xa656('0x17');var _0x9f185e=_0x5326db[_0xa656('0x19')];var _0x3abf32=_0x3674a3?0x0:_0x32a3d8[_0xa656('0x16')];var _0x419cda=_0x3674a3?_0x5326db[_0xa656('0x19')]:_0x32a3d8[_0xa656('0x16')]+_0x32a3d8[_0xa656('0x18')];var _0x4250aa;if(_0x419cda>=_0x9f185e){_0x419cda=_0x9f185e;_0x4250aa=0xc8;}else{_0x4250aa=0xce;}_0x496444[_0xa656('0x15')](_0x4250aa);return _0x496444[_0xa656('0x1a')](_0xa656('0x1b'),_0x3abf32+'-'+_0x419cda+'/'+_0x9f185e)[_0xa656('0x1c')](_0x5326db);}return null;};}function patchUpdates(_0x597190){return function(_0x277927){try{jsonpatch[_0xa656('0x1d')](_0x277927,_0x597190,!![]);}catch(_0x7126a0){return BPromise['reject'](_0x7126a0);}return _0x277927[_0xa656('0x1e')]();};}function saveUpdates(_0x389e02,_0x48feef){return function(_0x14c7ee){if(_0x14c7ee){return _0x14c7ee[_0xa656('0x1f')](_0x389e02)[_0xa656('0x20')](function(_0x39dfd7){return _0x39dfd7;});}return null;};}function removeEntity(_0x47269b,_0x2a4e62){return function(_0x1b5d54){if(_0x1b5d54){return _0x1b5d54[_0xa656('0x21')]()['then'](function(){_0x47269b['status'](0xcc)[_0xa656('0x22')]();});}};}function handleEntityNotFound(_0x4aad87,_0x5d4e58){return function(_0x4800e1){if(!_0x4800e1){_0x4aad87['sendStatus'](0x194);}return _0x4800e1;};}function handleError(_0x1f369a,_0x5bfc3e){_0x5bfc3e=_0x5bfc3e||0x1f4;return function(_0x4ee43b){logger[_0xa656('0x23')](_0x4ee43b[_0xa656('0x24')]);if(_0x4ee43b[_0xa656('0x25')]){delete _0x4ee43b['name'];}_0x1f369a[_0xa656('0x15')](_0x5bfc3e)[_0xa656('0x26')](_0x4ee43b);};}exports[_0xa656('0x27')]=function(_0x27e611,_0x741718){var _0x1ea330={},_0x13118b={},_0x1eebcc={'count':0x0,'rows':[]};var _0x21d953=_[_0xa656('0x28')](db[_0xa656('0x29')][_0xa656('0x2a')],function(_0x20cb04){return{'name':_0x20cb04[_0xa656('0x2b')],'type':_0x20cb04[_0xa656('0x2c')][_0xa656('0x2d')]};});_0x13118b[_0xa656('0x2e')]=_['map'](_0x21d953,_0xa656('0x25'));_0x13118b[_0xa656('0x2f')]=_['keys'](_0x27e611[_0xa656('0x2f')]);_0x13118b[_0xa656('0x30')]=_[_0xa656('0x31')](_0x13118b[_0xa656('0x2e')],_0x13118b[_0xa656('0x2f')]);_0x1ea330[_0xa656('0x32')]=_[_0xa656('0x31')](_0x13118b['model'],qs[_0xa656('0x33')](_0x27e611[_0xa656('0x2f')][_0xa656('0x33')]));_0x1ea330[_0xa656('0x32')]=_0x1ea330['attributes'][_0xa656('0x34')]?_0x1ea330[_0xa656('0x32')]:_0x13118b[_0xa656('0x2e')];if(!_0x27e611[_0xa656('0x2f')]['hasOwnProperty']('nolimit')){_0x1ea330[_0xa656('0x18')]=qs[_0xa656('0x18')](_0x27e611[_0xa656('0x2f')][_0xa656('0x18')]);_0x1ea330[_0xa656('0x16')]=qs[_0xa656('0x16')](_0x27e611[_0xa656('0x2f')][_0xa656('0x16')]);}_0x1ea330['order']=qs[_0xa656('0x35')](_0x27e611['query'][_0xa656('0x35')]);_0x1ea330[_0xa656('0x36')]=qs[_0xa656('0x30')](_['pick'](_0x27e611[_0xa656('0x2f')],_0x13118b['filters']),_0x21d953);if(_0x27e611[_0xa656('0x2f')][_0xa656('0x37')]){_0x1ea330[_0xa656('0x36')]=_[_0xa656('0x38')](_0x1ea330[_0xa656('0x36')],{'$or':_[_0xa656('0x28')](_0x21d953,function(_0x521e9d){if(_0x521e9d[_0xa656('0x2c')]!=='VIRTUAL'){var _0x47918d={};_0x47918d[_0x521e9d['name']]={'$like':'%'+_0x27e611[_0xa656('0x2f')][_0xa656('0x37')]+'%'};return _0x47918d;}})});}_0x1ea330=_['merge']({},_0x1ea330,_0x27e611['options']);var _0x48bfa3={'where':_0x1ea330[_0xa656('0x36')]};return db[_0xa656('0x29')][_0xa656('0x19')](_0x48bfa3)[_0xa656('0x20')](function(_0x143000){_0x1eebcc[_0xa656('0x19')]=_0x143000;if(_0x27e611[_0xa656('0x2f')][_0xa656('0x39')]){_0x1ea330[_0xa656('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa656('0x3b')](_0x1ea330);})['then'](function(_0x21833f){_0x1eebcc['rows']=_0x21833f;return _0x1eebcc;})[_0xa656('0x20')](respondWithFilteredResult(_0x741718,_0x1ea330))[_0xa656('0x3c')](handleError(_0x741718,null));};exports[_0xa656('0x3d')]=function(_0x283f04,_0x5a237f){var _0x1df17a={'raw':!![],'where':{'id':_0x283f04['params']['id']}},_0x548ac8={};_0x548ac8['model']=_[_0xa656('0x3e')](db[_0xa656('0x29')][_0xa656('0x2a')]);_0x548ac8[_0xa656('0x2f')]=_['keys'](_0x283f04[_0xa656('0x2f')]);_0x548ac8[_0xa656('0x30')]=_[_0xa656('0x31')](_0x548ac8[_0xa656('0x2e')],_0x548ac8['query']);_0x1df17a[_0xa656('0x32')]=_[_0xa656('0x31')](_0x548ac8[_0xa656('0x2e')],qs[_0xa656('0x33')](_0x283f04['query']['fields']));_0x1df17a['attributes']=_0x1df17a[_0xa656('0x32')][_0xa656('0x34')]?_0x1df17a[_0xa656('0x32')]:_0x548ac8[_0xa656('0x2e')];if(_0x283f04[_0xa656('0x2f')][_0xa656('0x39')]){_0x1df17a[_0xa656('0x3a')]=[{'all':!![]}];}_0x1df17a=_[_0xa656('0x38')]({},_0x1df17a,_0x283f04['options']);return db[_0xa656('0x29')][_0xa656('0x3f')](_0x1df17a)[_0xa656('0x20')](handleEntityNotFound(_0x5a237f,null))[_0xa656('0x20')](respondWithResult(_0x5a237f,null))[_0xa656('0x3c')](handleError(_0x5a237f,null));};exports[_0xa656('0x40')]=function(_0x5ef2bc,_0x2a1349){return db[_0xa656('0x29')][_0xa656('0x40')](_0x5ef2bc[_0xa656('0x41')],{})['then'](respondWithResult(_0x2a1349,0xc9))[_0xa656('0x3c')](handleError(_0x2a1349,null));};exports[_0xa656('0x42')]=function(_0x254099,_0x4f4c18){return db[_0xa656('0x29')][_0xa656('0x42')]()[_0xa656('0x20')](respondWithResult(_0x4f4c18,null))[_0xa656('0x3c')](handleError(_0x4f4c18,null));};exports['update']=function(_0x2c92d0,_0x3fccc1){if(_0x2c92d0['body'][_0xa656('0x43')]){delete _0x2c92d0[_0xa656('0x41')][_0xa656('0x43')];}return db['CmHopperHistory'][_0xa656('0x3f')]({'where':{'uniqueid':_0x2c92d0[_0xa656('0x44')]['id']}})['then'](handleEntityNotFound(_0x3fccc1,null))[_0xa656('0x20')](saveUpdates(_0x2c92d0[_0xa656('0x41')],null))['then'](respondWithResult(_0x3fccc1,null))[_0xa656('0x3c')](handleError(_0x3fccc1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7391d77..5ff5cd5 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 _0xdfb1=['bluebird','request-promise','path','rimraf','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x48478f,_0x537acd){var _0x10af50=function(_0x4cf0ac){while(--_0x4cf0ac){_0x48478f['push'](_0x48478f['shift']());}};_0x10af50(++_0x537acd);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2dcb1a,_0x2c834e){_0x2dcb1a=_0x2dcb1a-0x0;var _0x58e7eb=_0xdfb1[_0x2dcb1a];return _0x58e7eb;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var logger=require(_0x1dfb('0x2'))(_0x1dfb('0x3'));var moment=require('moment');var BPromise=require(_0x1dfb('0x4'));var rp=require(_0x1dfb('0x5'));var fs=require('fs');var path=require(_0x1dfb('0x6'));var rimraf=require(_0x1dfb('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x31f0ff,_0x36bf77){return _0x31f0ff[_0x1dfb('0x8')]('CmHopperHistory',attributes,{'tableName':_0x1dfb('0x9'),'paranoid':![],'indexes':[{'name':_0x1dfb('0xa'),'fields':[_0x1dfb('0xa')]},{'name':_0x1dfb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6822=['request-promise','path','rimraf','./cmHopperHistory.attributes','define','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x6822,0xca));var _0x2682=function(_0xfe88e4,_0x45055d){_0xfe88e4=_0xfe88e4-0x0;var _0x5bfc46=_0x6822[_0xfe88e4];return _0x5bfc46;};'use strict';var _=require(_0x2682('0x0'));var util=require(_0x2682('0x1'));var logger=require(_0x2682('0x2'))(_0x2682('0x3'));var moment=require(_0x2682('0x4'));var BPromise=require(_0x2682('0x5'));var rp=require(_0x2682('0x6'));var fs=require('fs');var path=require(_0x2682('0x7'));var rimraf=require(_0x2682('0x8'));var config=require('../../config/environment');var attributes=require(_0x2682('0x9'));module['exports']=function(_0x30fcd9,_0x39d4f7){return _0x30fcd9[_0x2682('0xa')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x2682('0xb')]},{'name':_0x2682('0xc'),'fields':[_0x2682('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 7e2bbab..65f2132 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 _0x3299=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','create','options','raw','stringify','AvgHandleTime','CmHopperHistory','findAll','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null'];(function(_0x5e4232,_0xa7dd93){var _0x2918d0=function(_0x4f484b){while(--_0x4f484b){_0x5e4232['push'](_0x5e4232['shift']());}};_0x2918d0(++_0xa7dd93);}(_0x3299,0x1bc));var _0x9329=function(_0x3f10a0,_0x62eb6a){_0x3f10a0=_0x3f10a0-0x0;var _0x2e90ab=_0x3299[_0x3f10a0];return _0x2e90ab;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['CmHopperHistory'][_0x9329('0x1a')](_0x1b5eed['body'],{'raw':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x6676d7){logger[_0x9329('0xf')](_0x9329('0x19'),_0x1b5eed);logger[_0x9329('0x11')](_0x9329('0x19'),_0x1b5eed,JSON[_0x9329('0x1d')](_0x6676d7));_0x41db73(_0x6676d7);})['catch'](function(_0x1fa600){logger[_0x9329('0x13')](_0x9329('0x19'),_0x1fa600[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x1fa600['message']));});});};exports[_0x9329('0x1e')]=function(_0x46019b){var _0x528927=this;return new Promise(function(_0x425240,_0x84dacf){return db[_0x9329('0x1f')][_0x9329('0x20')]({'raw':_0x46019b['options']?_0x46019b['options'][_0x9329('0x1c')]===undefined?!![]:![]:!![],'where':_0x46019b[_0x9329('0x1b')]?_0x46019b[_0x9329('0x1b')]['where']||null:null,'attributes':[[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')][_0x9329('0x22')]('id')),_0x9329('0x23')],[db['sequelize']['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9329('0x25')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9329('0x21')]['fn']('AVG',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x9329('0x21')]['fn'](_0x9329('0x29'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')]['literal'](_0x9329('0x2a')))),_0x9329('0x2b')]]})[_0x9329('0xe')](function(_0x1d7d20){logger[_0x9329('0xf')](_0x9329('0x1e'),_0x46019b);logger['debug'](_0x9329('0x1e'),_0x46019b,JSON[_0x9329('0x1d')](_0x1d7d20));_0x425240(_0x1d7d20);})[_0x9329('0x18')](function(_0x3ae0a5){logger[_0x9329('0x13')](_0x9329('0x1e'),_0x3ae0a5[_0x9329('0x15')],_0x46019b);_0x84dacf(_0x528927[_0x9329('0x13')](0x1f4,_0x3ae0a5['message']));});});};exports[_0x9329('0x2c')]=function(_0x4f5202){var _0x11dc44=this;return new Promise(function(_0x22086e,_0x37475b){return db[_0x9329('0x1f')][_0x9329('0x20')]({'raw':_0x4f5202[_0x9329('0x1b')]?_0x4f5202['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f5202[_0x9329('0x1b')]?_0x4f5202[_0x9329('0x1b')][_0x9329('0x2d')]||null:null,'attributes':[[_0x9329('0x2e'),_0x9329('0x2f')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x30')))),_0x9329('0x31')],[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x203,\x201,\x20null'))),_0x9329('0x32')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x9329('0x33')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x34')))),'outboundBusyCallsDay'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x9329('0x35')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x36')))),_0x9329('0x37')],[db['sequelize']['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db['sequelize'][_0x9329('0x24')](_0x9329('0x38')))),_0x9329('0x39')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x3a')))),_0x9329('0x3b')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db['sequelize']['fn']('IF',db['sequelize'][_0x9329('0x24')]('`state`\x20=\x2013,\x201,\x20null'))),_0x9329('0x3c')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x2014,\x201,\x20null'))),_0x9329('0x3d')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db['sequelize']['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x3e')))),'outboundRejectCallsDay'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x9329('0x3f')],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x40')))),_0x9329('0x41')],[db[_0x9329('0x21')]['fn']('COUNT',db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x42')))),_0x9329('0x43')]],'group':[_0x9329('0x2e')]})[_0x9329('0xe')](function(_0x54431c){logger[_0x9329('0xf')](_0x9329('0x2c'),_0x4f5202);logger[_0x9329('0x11')](_0x9329('0x2c'),_0x4f5202,JSON[_0x9329('0x1d')](_0x54431c));_0x22086e(_0x54431c);})[_0x9329('0x18')](function(_0x2cdff6){logger[_0x9329('0x13')](_0x9329('0x2c'),_0x2cdff6[_0x9329('0x15')],_0x4f5202);_0x37475b(_0x11dc44[_0x9329('0x13')](0x1f4,_0x2cdff6[_0x9329('0x15')]));});});};exports[_0x9329('0x44')]=function(_0x3551b5){var _0x83c24a=this;return new Promise(function(_0x1aec36,_0x4ac39c){return db['CmHopperHistory'][_0x9329('0x20')]({'raw':_0x3551b5[_0x9329('0x1b')]?_0x3551b5[_0x9329('0x1b')][_0x9329('0x1c')]===undefined?!![]:![]:!![],'where':_0x3551b5[_0x9329('0x1b')]?_0x3551b5['options'][_0x9329('0x2d')]||null:null,'attributes':[[_0x9329('0x2e'),_0x9329('0x2f')],[db['sequelize']['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['col']('id')),'ivrTotalCallsDays'],[db[_0x9329('0x21')]['fn'](_0x9329('0x26'),db[_0x9329('0x21')]['fn']('IF',db[_0x9329('0x21')][_0x9329('0x24')](_0x9329('0x45')))),_0x9329('0x46')]],'group':[_0x9329('0x2e')]})['then'](function(_0x1e26d9){logger[_0x9329('0xf')](_0x9329('0x44'),_0x3551b5);logger[_0x9329('0x11')]('GetCampaignHopperHistory',_0x3551b5,JSON['stringify'](_0x1e26d9));_0x1aec36(_0x1e26d9);})[_0x9329('0x18')](function(_0x1fa2a2){logger[_0x9329('0x13')](_0x9329('0x44'),_0x1fa2a2[_0x9329('0x15')],_0x3551b5);_0x4ac39c(_0x83c24a[_0x9329('0x13')](0x1f4,_0x1fa2a2[_0x9329('0x15')]));});});}; \ No newline at end of file +var _0xe148=['GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','options','raw','stringify','catch','AvgHandleTime','where','sequelize','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrAnswerCallsDay'];(function(_0x24893b,_0x56b7f7){var _0x48c8a7=function(_0x10cd3f){while(--_0x10cd3f){_0x24893b['push'](_0x24893b['shift']());}};_0x48c8a7(++_0x56b7f7);}(_0xe148,0x109));var _0x8e14=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xe148[_0x261b8a];return _0x3455e8;};'use strict';var _=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var moment=require(_0x8e14('0x2'));var BPromise=require(_0x8e14('0x3'));var rs=require(_0x8e14('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e14('0x5'));var logger=require(_0x8e14('0x6'))(_0x8e14('0x7'));var config=require(_0x8e14('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd4a812,_0x1c4b4c,_0x4f595d){return new BPromise(function(_0x4bb4f0,_0x13599a){return client['request'](_0xd4a812,_0x4f595d)[_0x8e14('0x9')](function(_0x1d454c){logger[_0x8e14('0xa')](_0x8e14('0xb'),_0x1c4b4c,_0x8e14('0xc'));logger[_0x8e14('0xd')](_0x8e14('0xe'),_0x1c4b4c,_0x8e14('0xc'),JSON['stringify'](_0x1d454c));if(_0x1d454c[_0x8e14('0xf')]){if(_0x1d454c['error'][_0x8e14('0x10')]===0x1f4){logger[_0x8e14('0xf')](_0x8e14('0xb'),_0x1c4b4c,_0x1d454c[_0x8e14('0xf')][_0x8e14('0x11')]);return _0x13599a(_0x1d454c['error'][_0x8e14('0x11')]);}logger[_0x8e14('0xf')](_0x8e14('0xb'),_0x1c4b4c,_0x1d454c[_0x8e14('0xf')]['message']);return _0x4bb4f0(_0x1d454c[_0x8e14('0xf')]['message']);}else{logger[_0x8e14('0xa')](_0x8e14('0xb'),_0x1c4b4c,_0x8e14('0xc'));_0x4bb4f0(_0x1d454c[_0x8e14('0x12')][_0x8e14('0x11')]);}})['catch'](function(_0x4af728){logger[_0x8e14('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1c4b4c,_0x4af728);_0x13599a(_0x4af728);});});}exports[_0x8e14('0x13')]=function(_0x55b9ed){var _0x48c83e=this;return new Promise(function(_0x241903,_0xbb748c){return db[_0x8e14('0x14')][_0x8e14('0x15')](_0x55b9ed['body'],{'raw':_0x55b9ed[_0x8e14('0x16')]?_0x55b9ed[_0x8e14('0x16')][_0x8e14('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5ea351){logger['info'](_0x8e14('0x13'),_0x55b9ed);logger['debug']('CreateCmHopperHistory',_0x55b9ed,JSON[_0x8e14('0x18')](_0x5ea351));_0x241903(_0x5ea351);})[_0x8e14('0x19')](function(_0x463a3c){logger[_0x8e14('0xf')](_0x8e14('0x13'),_0x463a3c['message'],_0x55b9ed);_0xbb748c(_0x48c83e['error'](0x1f4,_0x463a3c[_0x8e14('0x11')]));});});};exports[_0x8e14('0x1a')]=function(_0x3fbe30){var _0x2eda12=this;return new Promise(function(_0xa53fef,_0xa927c2){return db[_0x8e14('0x14')]['findAll']({'raw':_0x3fbe30[_0x8e14('0x16')]?_0x3fbe30[_0x8e14('0x16')][_0x8e14('0x17')]===undefined?!![]:![]:!![],'where':_0x3fbe30['options']?_0x3fbe30[_0x8e14('0x16')][_0x8e14('0x1b')]||null:null,'attributes':[[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db['sequelize']['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x8e14('0x1c')]['fn']('COUNT',db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')](_0x8e14('0x1f')))),_0x8e14('0x20')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')](_0x8e14('0x21')))),_0x8e14('0x22')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x23'),db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')]['literal'](_0x8e14('0x24')))),_0x8e14('0x25')],[db['sequelize']['fn'](_0x8e14('0x23'),db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')](_0x8e14('0x26')))),_0x8e14('0x27')]]})[_0x8e14('0x9')](function(_0x4f8f18){logger[_0x8e14('0xa')](_0x8e14('0x1a'),_0x3fbe30);logger['debug'](_0x8e14('0x1a'),_0x3fbe30,JSON['stringify'](_0x4f8f18));_0xa53fef(_0x4f8f18);})[_0x8e14('0x19')](function(_0x515cd9){logger[_0x8e14('0xf')](_0x8e14('0x1a'),_0x515cd9[_0x8e14('0x11')],_0x3fbe30);_0xa927c2(_0x2eda12[_0x8e14('0xf')](0x1f4,_0x515cd9[_0x8e14('0x11')]));});});};exports[_0x8e14('0x28')]=function(_0x13ed6e){var _0x49d187=this;return new Promise(function(_0xf59ce7,_0x8f4afc){return db['CmHopperHistory'][_0x8e14('0x29')]({'raw':_0x13ed6e['options']?_0x13ed6e[_0x8e14('0x16')][_0x8e14('0x17')]===undefined?!![]:![]:!![],'where':_0x13ed6e[_0x8e14('0x16')]?_0x13ed6e[_0x8e14('0x16')][_0x8e14('0x1b')]||null:null,'attributes':[[_0x8e14('0x2a'),_0x8e14('0x2b')],[db[_0x8e14('0x1c')]['fn']('COUNT',db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')]('`state`\x20=\x200,\x201,\x20null'))),_0x8e14('0x2c')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x8e14('0x1e')](_0x8e14('0x2d')))),_0x8e14('0x2e')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db['sequelize'][_0x8e14('0x1e')](_0x8e14('0x2f')))),_0x8e14('0x30')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')]['literal'](_0x8e14('0x31')))),'outboundBusyCallsDay'],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db['sequelize'][_0x8e14('0x1e')](_0x8e14('0x32')))),'outboundCongestionCallsDay'],[db[_0x8e14('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8e14('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8e14('0x33')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')](_0x8e14('0x34')))),_0x8e14('0x35')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db['sequelize'][_0x8e14('0x1e')]('`state`\x20=\x2012,\x201,\x20null'))),_0x8e14('0x36')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x8e14('0x1e')](_0x8e14('0x37')))),_0x8e14('0x38')],[db['sequelize']['fn'](_0x8e14('0x1d'),db['sequelize']['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')](_0x8e14('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db['sequelize'][_0x8e14('0x1e')](_0x8e14('0x3a')))),_0x8e14('0x3b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8e14('0x1c')]['literal'](_0x8e14('0x3c')))),_0x8e14('0x3d')],[db[_0x8e14('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')](_0x8e14('0x3e')))),_0x8e14('0x3b')],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db[_0x8e14('0x1c')][_0x8e14('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x8e14('0x3f')]],'group':[_0x8e14('0x2a')]})[_0x8e14('0x9')](function(_0x15842e){logger[_0x8e14('0xa')](_0x8e14('0x28'),_0x13ed6e);logger[_0x8e14('0xd')](_0x8e14('0x28'),_0x13ed6e,JSON[_0x8e14('0x18')](_0x15842e));_0xf59ce7(_0x15842e);})[_0x8e14('0x19')](function(_0x34b8ad){logger[_0x8e14('0xf')](_0x8e14('0x28'),_0x34b8ad[_0x8e14('0x11')],_0x13ed6e);_0x8f4afc(_0x49d187[_0x8e14('0xf')](0x1f4,_0x34b8ad[_0x8e14('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x19e14d){var _0x45f6d8=this;return new Promise(function(_0x5b0065,_0x4aff5d){return db[_0x8e14('0x14')][_0x8e14('0x29')]({'raw':_0x19e14d['options']?_0x19e14d['options']['raw']===undefined?!![]:![]:!![],'where':_0x19e14d[_0x8e14('0x16')]?_0x19e14d['options']['where']||null:null,'attributes':[[_0x8e14('0x2a'),_0x8e14('0x2b')],[db['sequelize']['fn']('COUNT',db[_0x8e14('0x1c')]['col']('id')),'ivrTotalCallsDays'],[db[_0x8e14('0x1c')]['fn'](_0x8e14('0x1d'),db[_0x8e14('0x1c')]['fn']('IF',db['sequelize'][_0x8e14('0x1e')](_0x8e14('0x2f')))),_0x8e14('0x40')]],'group':[_0x8e14('0x2a')]})['then'](function(_0x14688b){logger[_0x8e14('0xa')](_0x8e14('0x41'),_0x19e14d);logger[_0x8e14('0xd')](_0x8e14('0x41'),_0x19e14d,JSON['stringify'](_0x14688b));_0x5b0065(_0x14688b);})[_0x8e14('0x19')](function(_0x42b478){logger['error'](_0x8e14('0x41'),_0x42b478[_0x8e14('0x11')],_0x19e14d);_0x4aff5d(_0x45f6d8[_0x8e14('0xf')](0x1f4,_0x42b478[_0x8e14('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index aa72213..d965ace 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 _0xae8e=['show','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0xae8e,0xe4));var _0xeae8=function(_0x1cd2a3,_0x553211){_0x1cd2a3=_0x1cd2a3-0x0;var _0x1069dd=_0xae8e[_0x1cd2a3];return _0x1069dd;};'use strict';var multer=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var path=require(_0xeae8('0x2'));var timeout=require(_0xeae8('0x3'));var express=require('express');var router=express[_0xeae8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeae8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeae8('0x6'));var controller=require(_0xeae8('0x7'));router[_0xeae8('0x8')]('/',auth[_0xeae8('0x9')](),controller[_0xeae8('0xa')]);router[_0xeae8('0x8')]('/describe',auth[_0xeae8('0x9')](),controller[_0xeae8('0xb')]);router['get']('/:id',auth[_0xeae8('0x9')](),controller[_0xeae8('0xc')]);router['post']('/',auth[_0xeae8('0x9')](),controller['create']);router['put'](_0xeae8('0xd'),auth[_0xeae8('0x9')](),controller[_0xeae8('0xe')]);module[_0xeae8('0xf')]=router; \ No newline at end of file +var _0x4d8e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','exports'];(function(_0x80973e,_0x161f4e){var _0x42747f=function(_0x3629d5){while(--_0x3629d5){_0x80973e['push'](_0x80973e['shift']());}};_0x42747f(++_0x161f4e);}(_0x4d8e,0x1ce));var _0xe4d8=function(_0x16ff18,_0x234597){_0x16ff18=_0x16ff18-0x0;var _0x5aab6f=_0x4d8e[_0x16ff18];return _0x5aab6f;};'use strict';var multer=require(_0xe4d8('0x0'));var util=require(_0xe4d8('0x1'));var path=require(_0xe4d8('0x2'));var timeout=require(_0xe4d8('0x3'));var express=require(_0xe4d8('0x4'));var router=express[_0xe4d8('0x5')]();var fs_extra=require(_0xe4d8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe4d8('0x7'));var config=require(_0xe4d8('0x8'));var controller=require(_0xe4d8('0x9'));router['get']('/',auth[_0xe4d8('0xa')](),controller['index']);router[_0xe4d8('0xb')](_0xe4d8('0xc'),auth[_0xe4d8('0xa')](),controller[_0xe4d8('0xd')]);router['get'](_0xe4d8('0xe'),auth[_0xe4d8('0xa')](),controller[_0xe4d8('0xf')]);router[_0xe4d8('0x10')]('/',auth['isAuthenticated'](),controller[_0xe4d8('0x11')]);router[_0xe4d8('0x12')](_0xe4d8('0xe'),auth[_0xe4d8('0xa')](),controller[_0xe4d8('0x13')]);module[_0xe4d8('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 4e29eea..080b2c7 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 _0x9ef8=['exports','name','STRING','sequelize'];(function(_0x5b1b07,_0x119df6){var _0x59fbbc=function(_0xc8f58a){while(--_0xc8f58a){_0x5b1b07['push'](_0x5b1b07['shift']());}};_0x59fbbc(++_0x119df6);}(_0x9ef8,0x17f));var _0x89ef=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x9ef8[_0x235f49];return _0x551139;};'use strict';var Sequelize=require(_0x89ef('0x0'));module[_0x89ef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x89ef('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x89ef('0x3')]},'dialPrefix':{'type':Sequelize[_0x89ef('0x3')]}}; \ No newline at end of file +var _0xcea5=['name','sequelize','exports','STRING'];(function(_0x1b776b,_0x247d48){var _0x45cac1=function(_0x645a15){while(--_0x645a15){_0x1b776b['push'](_0x1b776b['shift']());}};_0x45cac1(++_0x247d48);}(_0xcea5,0xed));var _0x5cea=function(_0x2631dc,_0x5ada91){_0x2631dc=_0x2631dc-0x0;var _0x3e72d9=_0xcea5[_0x2631dc];return _0x3e72d9;};'use strict';var Sequelize=require(_0x5cea('0x0'));module[_0x5cea('0x1')]={'name':{'type':Sequelize[_0x5cea('0x2')],'unique':_0x5cea('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5cea('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 884d2a1..c2a0fbf 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 _0x514c=['destroy','Lists','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','order','removeDispositions','CmContact','tags','isArray','join','push','each','omit','ids','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','getContactsCsv','OrderBy','alias','select','from','cm_contacts','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','sequelize','CmCustomField','addCustomFields','Sequelize','text','TEXT','switch','defaultValue','queryInterface','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','message','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x514c,0x1b2));var _0xc514=function(_0x5f5b21,_0x5d9006){_0x5f5b21=_0x5f5b21-0x0;var _0x5565f5=_0x514c[_0x5f5b21];return _0x5565f5;};'use strict';var emlformat=require(_0xc514('0x0'));var rimraf=require(_0xc514('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc514('0x2'));var rp=require(_0xc514('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc514('0x4'));var sox=require(_0xc514('0x5'));var csv=require(_0xc514('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc514('0x7'));var _=require(_0xc514('0x8'));var squel=require('squel');var crypto=require(_0xc514('0x9'));var jsforce=require(_0xc514('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc514('0x6'));var querystring=require(_0xc514('0xb'));var Papa=require('papaparse');var Redis=require(_0xc514('0xc'));var authService=require(_0xc514('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc514('0xe'));var hardwareService=require(_0xc514('0xf'));var logger=require(_0xc514('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xc514('0x11'));var licenseUtil=require(_0xc514('0x12'));var db=require(_0xc514('0x13'))['db'];var csv_results;config[_0xc514('0x14')]=_[_0xc514('0x15')](config[_0xc514('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xc514('0x16'))(new Redis(config[_0xc514('0x14')]));require('./cmList.socket')[_0xc514('0x17')](socket);function respondWithStatusCode(_0x2eecf8,_0x48069a){_0x48069a=_0x48069a||0xcc;return function(_0x326faa){if(_0x326faa){return _0x2eecf8[_0xc514('0x18')](_0x48069a);}return _0x2eecf8[_0xc514('0x19')](_0x48069a)[_0xc514('0x1a')]();};}function respondWithResult(_0x2589e8,_0x3ddb5e){_0x3ddb5e=_0x3ddb5e||0xc8;return function(_0x340583){if(_0x340583){return _0x2589e8[_0xc514('0x19')](_0x3ddb5e)[_0xc514('0x1b')](_0x340583);}};}function respondWithFilteredResult(_0x3a5245,_0x1ba654){return function(_0x1081fb){if(_0x1081fb){var _0x5e9503=typeof _0x1ba654[_0xc514('0x1c')]===_0xc514('0x1d')&&typeof _0x1ba654['limit']===_0xc514('0x1d');var _0x22659d=_0x1081fb[_0xc514('0x1e')];var _0x55bf2c=_0x5e9503?0x0:_0x1ba654['offset'];var _0x4adc6e=_0x5e9503?_0x1081fb[_0xc514('0x1e')]:_0x1ba654['offset']+_0x1ba654[_0xc514('0x1f')];var _0x567785;if(_0x4adc6e>=_0x22659d){_0x4adc6e=_0x22659d;_0x567785=0xc8;}else{_0x567785=0xce;}_0x3a5245['status'](_0x567785);return _0x3a5245[_0xc514('0x20')]('Content-Range',_0x55bf2c+'-'+_0x4adc6e+'/'+_0x22659d)['json'](_0x1081fb);}return null;};}function patchUpdates(_0x51ec2f){return function(_0x3b45fb){try{jsonpatch[_0xc514('0x21')](_0x3b45fb,_0x51ec2f,!![]);}catch(_0x1c22ab){return BPromise[_0xc514('0x22')](_0x1c22ab);}return _0x3b45fb['save']();};}function saveUpdates(_0x25411d,_0x478c2f){return function(_0x3390c6){if(_0x3390c6){return _0x3390c6[_0xc514('0x23')](_0x25411d)[_0xc514('0x24')](function(_0x2ea8c5){return _0x2ea8c5;});}return null;};}function removeEntity(_0x9b065f,_0x2f3dbd){return function(_0x5e2ecf){if(_0x5e2ecf){return _0x5e2ecf[_0xc514('0x25')]()[_0xc514('0x24')](function(){var _0x337500=_0x5e2ecf['get']({'plain':!![]});var _0x169411=_0xc514('0x26');return db[_0xc514('0x27')]['destroy']({'where':{'type':_0x169411,'resourceId':_0x337500['id']}})[_0xc514('0x24')](function(){return _0x5e2ecf;});})[_0xc514('0x24')](function(){_0x9b065f[_0xc514('0x19')](0xcc)[_0xc514('0x1a')]();});}};}function handleEntityNotFound(_0x472d7d,_0x4575bc){return function(_0x104ab6){if(!_0x104ab6){_0x472d7d[_0xc514('0x18')](0x194);}return _0x104ab6;};}function handleError(_0x11b64c,_0x21a2be){_0x21a2be=_0x21a2be||0x1f4;return function(_0x4ea2de){logger[_0xc514('0x28')](_0x4ea2de['stack']);if(_0x4ea2de[_0xc514('0x29')]){delete _0x4ea2de[_0xc514('0x29')];}_0x11b64c[_0xc514('0x19')](_0x21a2be)[_0xc514('0x2a')](_0x4ea2de);};}exports[_0xc514('0x2b')]=function(_0x421142,_0xc79b03){var _0x9b7867={},_0x461f09={},_0x4381e9={'count':0x0,'rows':[]};var _0x2f8bac=_[_0xc514('0x2c')](db['CmList']['rawAttributes'],function(_0x1d6caf){return{'name':_0x1d6caf[_0xc514('0x2d')],'type':_0x1d6caf[_0xc514('0x2e')][_0xc514('0x2f')]};});_0x461f09[_0xc514('0x30')]=_[_0xc514('0x2c')](_0x2f8bac,'name');_0x461f09[_0xc514('0x31')]=_[_0xc514('0x32')](_0x421142[_0xc514('0x31')]);_0x461f09[_0xc514('0x33')]=_[_0xc514('0x34')](_0x461f09[_0xc514('0x30')],_0x461f09['query']);_0x9b7867['attributes']=_[_0xc514('0x34')](_0x461f09[_0xc514('0x30')],qs[_0xc514('0x35')](_0x421142[_0xc514('0x31')]['fields']));_0x9b7867[_0xc514('0x36')]=_0x9b7867[_0xc514('0x36')][_0xc514('0x37')]?_0x9b7867[_0xc514('0x36')]:_0x461f09[_0xc514('0x30')];if(!_0x421142['query'][_0xc514('0x38')](_0xc514('0x39'))){_0x9b7867[_0xc514('0x1f')]=qs[_0xc514('0x1f')](_0x421142[_0xc514('0x31')][_0xc514('0x1f')]);_0x9b7867[_0xc514('0x1c')]=qs[_0xc514('0x1c')](_0x421142[_0xc514('0x31')][_0xc514('0x1c')]);}_0x9b7867['order']=qs[_0xc514('0x3a')](_0x421142[_0xc514('0x31')][_0xc514('0x3a')]);_0x9b7867['where']=qs[_0xc514('0x33')](_[_0xc514('0x3b')](_0x421142[_0xc514('0x31')],_0x461f09[_0xc514('0x33')]),_0x2f8bac);if(_0x421142[_0xc514('0x31')][_0xc514('0x3c')]){_0x9b7867[_0xc514('0x3d')]=_[_0xc514('0x3e')](_0x9b7867[_0xc514('0x3d')],{'$or':_[_0xc514('0x2c')](_0x2f8bac,function(_0x2b2d3a){if(_0x2b2d3a[_0xc514('0x2e')]!==_0xc514('0x3f')){var _0xb0a20c={};_0xb0a20c[_0x2b2d3a[_0xc514('0x29')]]={'$like':'%'+_0x421142['query'][_0xc514('0x3c')]+'%'};return _0xb0a20c;}})});}_0x9b7867=_['merge']({},_0x9b7867,_0x421142[_0xc514('0x40')]);var _0x173e45={'where':_0x9b7867[_0xc514('0x3d')]};return db[_0xc514('0x41')]['count'](_0x173e45)['then'](function(_0x4baf13){_0x4381e9[_0xc514('0x1e')]=_0x4baf13;if(_0x421142[_0xc514('0x31')][_0xc514('0x42')]){_0x9b7867[_0xc514('0x43')]=[{'all':!![]}];}return db[_0xc514('0x41')][_0xc514('0x44')](_0x9b7867);})['then'](function(_0x56ae26){_0x4381e9[_0xc514('0x45')]=_0x56ae26;return _0x4381e9;})[_0xc514('0x24')](respondWithFilteredResult(_0xc79b03,_0x9b7867))[_0xc514('0x46')](handleError(_0xc79b03,null));};exports[_0xc514('0x47')]=function(_0x44fb5a,_0x67a1cb){var _0xcfe432={'raw':![],'where':{'id':_0x44fb5a[_0xc514('0x48')]['id']}},_0x20760f={};_0x20760f['model']=_[_0xc514('0x32')](db[_0xc514('0x41')][_0xc514('0x49')]);_0x20760f[_0xc514('0x31')]=_[_0xc514('0x32')](_0x44fb5a[_0xc514('0x31')]);_0x20760f[_0xc514('0x33')]=_[_0xc514('0x34')](_0x20760f[_0xc514('0x30')],_0x20760f[_0xc514('0x31')]);_0xcfe432['attributes']=_[_0xc514('0x34')](_0x20760f[_0xc514('0x30')],qs[_0xc514('0x35')](_0x44fb5a[_0xc514('0x31')][_0xc514('0x35')]));_0xcfe432['attributes']=_0xcfe432[_0xc514('0x36')][_0xc514('0x37')]?_0xcfe432['attributes']:_0x20760f['model'];if(_0x44fb5a[_0xc514('0x31')][_0xc514('0x42')]){_0xcfe432[_0xc514('0x43')]=[{'all':!![]}];}_0xcfe432=_['merge']({},_0xcfe432,_0x44fb5a[_0xc514('0x40')]);return db[_0xc514('0x41')][_0xc514('0x4a')](_0xcfe432)['then'](handleEntityNotFound(_0x67a1cb,null))['then'](respondWithResult(_0x67a1cb,null))[_0xc514('0x46')](handleError(_0x67a1cb,null));};exports[_0xc514('0x4b')]=function(_0x564ed7,_0xbe91e8){return db[_0xc514('0x41')]['create'](_0x564ed7[_0xc514('0x4c')],{})[_0xc514('0x24')](function(_0x2be295){var _0x284c02=_0x564ed7[_0xc514('0x4d')]['get']({'plain':!![]});if(!_0x284c02)throw new Error(_0xc514('0x4e'));if(_0x284c02[_0xc514('0x4f')]===_0xc514('0x4d')){var _0x459270=_0x2be295['get']({'plain':!![]});var _0x5e9626=_0xc514('0x26');return db[_0xc514('0x50')][_0xc514('0x4a')]({'where':{'name':_0x5e9626,'userProfileId':_0x284c02[_0xc514('0x51')]},'raw':!![]})[_0xc514('0x24')](function(_0x4cbab7){if(_0x4cbab7&&_0x4cbab7[_0xc514('0x52')]===0x0){return db[_0xc514('0x27')]['create']({'name':_0x459270['name'],'resourceId':_0x459270['id'],'type':_0x4cbab7['name'],'sectionId':_0x4cbab7['id']},{})[_0xc514('0x24')](function(){return _0x2be295;});}else{return _0x2be295;}})[_0xc514('0x46')](function(_0x2e26d5){logger[_0xc514('0x28')](_0xc514('0x53'),_0x2e26d5);throw _0x2e26d5;});}return _0x2be295;})['then'](respondWithResult(_0xbe91e8,0xc9))[_0xc514('0x46')](handleError(_0xbe91e8,null));};exports[_0xc514('0x23')]=function(_0xbdfbae,_0x32cdc9){if(_0xbdfbae[_0xc514('0x4c')]['id']){delete _0xbdfbae['body']['id'];}return db[_0xc514('0x41')][_0xc514('0x4a')]({'where':{'id':_0xbdfbae['params']['id']}})['then'](handleEntityNotFound(_0x32cdc9,null))[_0xc514('0x24')](saveUpdates(_0xbdfbae['body'],null))[_0xc514('0x24')](respondWithResult(_0x32cdc9,null))['catch'](handleError(_0x32cdc9,null));};exports['destroy']=function(_0x2e89e9,_0x2c1253){return db[_0xc514('0x41')]['find']({'where':{'id':_0x2e89e9[_0xc514('0x48')]['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x2c1253,null))[_0xc514('0x24')](removeEntity(_0x2c1253,null))[_0xc514('0x46')](handleError(_0x2c1253,null));};exports[_0xc514('0x54')]=function(_0x7d61b9,_0x47b07f){return db[_0xc514('0x41')][_0xc514('0x54')]()['then'](respondWithResult(_0x47b07f,null))[_0xc514('0x46')](handleError(_0x47b07f,null));};exports[_0xc514('0x55')]=function(_0x581359,_0x163f19,_0x2d2b44){if(_0x581359[_0xc514('0x4c')]['id']){delete _0x581359['body']['id'];}return db['CmList'][_0xc514('0x4a')]({'where':{'id':_0x581359[_0xc514('0x48')]['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x163f19,null))[_0xc514('0x24')](function(_0x3e3db2){if(_0x3e3db2){_0x581359[_0xc514('0x4c')][_0xc514('0x56')]=_0x3e3db2['id'];return db[_0xc514('0x57')]['create'](_0x581359[_0xc514('0x4c')]);}})['then'](respondWithResult(_0x163f19,null))[_0xc514('0x46')](handleError(_0x163f19,null));};exports['getDispositions']=function(_0x2742fe,_0x3a9ef2,_0x5dcd89){var _0x57f783={'raw':![],'where':{}};var _0x26a9d0={};var _0x53b74d={'count':0x0,'rows':[]};return db[_0xc514('0x41')]['findOne']({'where':{'id':_0x2742fe['params']['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x3a9ef2,null))[_0xc514('0x24')](function(_0x163b9a){if(_0x163b9a){_0x26a9d0['model']=_[_0xc514('0x32')](db['Disposition'][_0xc514('0x49')]);_0x26a9d0[_0xc514('0x31')]=_[_0xc514('0x32')](_0x2742fe[_0xc514('0x31')]);_0x26a9d0[_0xc514('0x33')]=_[_0xc514('0x34')](_0x26a9d0[_0xc514('0x30')],_0x26a9d0['query']);_0x57f783['attributes']=_[_0xc514('0x34')](_0x26a9d0[_0xc514('0x30')],qs[_0xc514('0x35')](_0x2742fe[_0xc514('0x31')][_0xc514('0x35')]));_0x57f783[_0xc514('0x36')]=_0x57f783['attributes'][_0xc514('0x37')]?_0x57f783[_0xc514('0x36')]:_0x26a9d0[_0xc514('0x30')];if(!_0x2742fe[_0xc514('0x31')]['hasOwnProperty'](_0xc514('0x39'))){_0x57f783[_0xc514('0x1f')]=qs[_0xc514('0x1f')](_0x2742fe[_0xc514('0x31')][_0xc514('0x1f')]);_0x57f783[_0xc514('0x1c')]=qs[_0xc514('0x1c')](_0x2742fe['query']['offset']);}_0x57f783[_0xc514('0x58')]=qs[_0xc514('0x3a')](_0x2742fe[_0xc514('0x31')][_0xc514('0x3a')]);_0x57f783[_0xc514('0x3d')]=qs[_0xc514('0x33')](_[_0xc514('0x3b')](_0x2742fe[_0xc514('0x31')],_0x26a9d0[_0xc514('0x33')]));_0x57f783[_0xc514('0x3d')][_0xc514('0x56')]=_0x163b9a['id'];if(_0x2742fe[_0xc514('0x31')]['filter']){_0x57f783['where']=_['merge'](_0x57f783[_0xc514('0x3d')],{'$or':_['map'](_0x57f783[_0xc514('0x36')],function(_0x3b0ea5){var _0x23bbcf={};_0x23bbcf[_0x3b0ea5]={'$like':'%'+_0x2742fe[_0xc514('0x31')][_0xc514('0x3c')]+'%'};return _0x23bbcf;})});}_0x57f783=_[_0xc514('0x3e')]({},_0x57f783,_0x2742fe[_0xc514('0x40')]);return db[_0xc514('0x57')][_0xc514('0x1e')]({'where':_0x57f783[_0xc514('0x3d')]})['then'](function(_0x599f37){_0x53b74d[_0xc514('0x1e')]=_0x599f37;if(_0x2742fe[_0xc514('0x31')][_0xc514('0x42')]){_0x57f783[_0xc514('0x43')]=[{'all':!![]}];}return db[_0xc514('0x57')][_0xc514('0x44')](_0x57f783);})['then'](function(_0x1cc99c){_0x53b74d[_0xc514('0x45')]=_0x1cc99c;return _0x53b74d;});}})[_0xc514('0x24')](respondWithFilteredResult(_0x3a9ef2,_0x57f783))[_0xc514('0x46')](handleError(_0x3a9ef2,null));};exports[_0xc514('0x59')]=function(_0x1d1d0a,_0x3b541d,_0x5e9ec8){return db[_0xc514('0x41')]['find']({'where':{'id':_0x1d1d0a[_0xc514('0x48')]['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x3b541d,null))[_0xc514('0x24')](function(_0x1c0ef1){if(_0x1c0ef1){return _0x1c0ef1['removeDispositions'](_0x1d1d0a[_0xc514('0x31')]['ids']);}})[_0xc514('0x24')](respondWithStatusCode(_0x3b541d,null))[_0xc514('0x46')](handleError(_0x3b541d,null));};exports['addContacts']=function(_0x58d77e,_0x532108,_0x54ac08){return db[_0xc514('0x41')][_0xc514('0x4a')]({'where':{'id':_0x58d77e[_0xc514('0x48')]['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x532108,null))[_0xc514('0x24')](function(_0x12bf5b){if(_0x12bf5b){var _0x2d3491=[];var _0xedf601={'success':[],'errors':[]};return db[_0xc514('0x5a')][_0xc514('0x54')]()[_0xc514('0x24')](function(_0x215344){if(_0x58d77e[_0xc514('0x4c')][_0xc514('0x5b')]&&_[_0xc514('0x5c')](_0x58d77e[_0xc514('0x4c')]['tags'])){if(_0x58d77e[_0xc514('0x4c')][_0xc514('0x5b')][_0xc514('0x37')]){_0x58d77e[_0xc514('0x4c')]['tags']=_0x58d77e['body'][_0xc514('0x5b')][_0xc514('0x5d')](';')+';';}else{_0x58d77e[_0xc514('0x4c')][_0xc514('0x5b')]=null;}}else{_0x58d77e[_0xc514('0x4c')][_0xc514('0x5b')]=null;}if(_0x58d77e[_0xc514('0x4c')]&&_[_0xc514('0x5c')](_0x58d77e[_0xc514('0x4c')])){for(var _0x4a8c42=0x0;_0x4a8c42<_0x58d77e['body'][_0xc514('0x37')];_0x4a8c42+=0x1){_0x58d77e[_0xc514('0x4c')][_0x4a8c42][_0xc514('0x56')]=_0x58d77e[_0xc514('0x48')]['id'];_0x2d3491[_0xc514('0x5e')](_0x58d77e[_0xc514('0x4c')][_0x4a8c42]);}return BPromise[_0xc514('0x5f')](_0x2d3491,function(_0x41f49b){return db[_0xc514('0x5a')][_0xc514('0x4b')](_[_0xc514('0x60')](_0x41f49b,[_0xc514('0x61'),'id'])||{},{'fields':_[_0xc514('0x32')](_0x215344),'raw':!![]})['then'](function(_0x89f0e6){_0xedf601[_0xc514('0x62')][_0xc514('0x5e')](_0x89f0e6[_0xc514('0x63')]);})[_0xc514('0x46')](function(_0x4f7b48){_0xedf601[_0xc514('0x64')][_0xc514('0x5e')]({'data':_0x41f49b,'error':_0x4f7b48['message']});});})[_0xc514('0x24')](function(_0x1a20c9){return _0xedf601;})[_0xc514('0x46')](function(_0x56b9e7){return _0x56b9e7;});}else{_0x532108[_0xc514('0x19')](0x190)[_0xc514('0x1b')]({'message':_0xc514('0x65')});}});}})['then'](respondWithResult(_0x532108,null))[_0xc514('0x46')](handleError(_0x532108,null));};exports[_0xc514('0x66')]=function(_0x3d1223,_0x5d7a22,_0x42b574){var _0x47e1dd;return db['CmList'][_0xc514('0x4a')]({'where':{'id':_0x3d1223[_0xc514('0x48')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xc514('0x67')}]})[_0xc514('0x24')](handleEntityNotFound(_0x5d7a22,null))[_0xc514('0x24')](function(_0x436fc1){if(_0x436fc1){_0x47e1dd=_0x436fc1;return db[_0xc514('0x5a')]['rawAttributes'];}})[_0xc514('0x24')](function(_0x1b8866){if(_0x1b8866){var _0x59ece7={};var _0xffb887={};_0xffb887['model']=_[_0xc514('0x68')](_[_0xc514('0x32')](_0x1b8866),_['map'](_0x47e1dd[_0xc514('0x67')],function(_0x1360ce){return util[_0xc514('0x69')](_0xc514('0x6a'),_0x1360ce['id']);}));_0xffb887[_0xc514('0x31')]=_['keys'](_0x3d1223['query']);_0xffb887[_0xc514('0x33')]=_[_0xc514('0x34')](_0xffb887['model'],_0xffb887['query']);_0x59ece7['attributes']=_[_0xc514('0x34')](_0xffb887[_0xc514('0x30')],qs[_0xc514('0x35')](_0x3d1223['query'][_0xc514('0x35')]));_0x59ece7['attributes']=_0x59ece7[_0xc514('0x36')][_0xc514('0x37')]?_0x59ece7[_0xc514('0x36')]:_0xffb887[_0xc514('0x30')];if(!_0x3d1223[_0xc514('0x31')][_0xc514('0x38')]('nolimit')){_0x59ece7[_0xc514('0x1f')]=qs[_0xc514('0x1f')](_0x3d1223[_0xc514('0x31')][_0xc514('0x1f')]);_0x59ece7[_0xc514('0x1c')]=qs['offset'](_0x3d1223['query']['offset']);}_0x59ece7[_0xc514('0x58')]=qs[_0xc514('0x3a')](_0x3d1223[_0xc514('0x31')][_0xc514('0x3a')]);_0x59ece7[_0xc514('0x3d')]=qs[_0xc514('0x33')](_[_0xc514('0x3b')](_0x3d1223[_0xc514('0x31')],_0xffb887['filters']));_0x59ece7['raw']=!![];if(_0x3d1223[_0xc514('0x31')][_0xc514('0x3c')]){_0x59ece7['where']=_['merge'](_0x59ece7[_0xc514('0x3d')],{'$or':_[_0xc514('0x2c')](_0x59ece7['attributes'],function(_0x198a82){var _0x3f6ce7={};_0x3f6ce7[_0x198a82]={'$like':'%'+_0x3d1223[_0xc514('0x31')][_0xc514('0x3c')]+'%'};return _0x3f6ce7;})});}_0x59ece7=_[_0xc514('0x3e')]({},_0x59ece7,_0x3d1223[_0xc514('0x40')]);return _0x47e1dd[_0xc514('0x66')](_0x59ece7);}})[_0xc514('0x24')](respondWithResult(_0x5d7a22,null))[_0xc514('0x46')](handleError(_0x5d7a22,null));};exports[_0xc514('0x6b')]=function(_0x2105a8,_0x2bcbba,_0x12d617){var _0x5dcbbf;var _0xe2a0a4;var _0x54cb2b;var _0x2b70c1=_0x2105a8['params']['id'];csv_results=[];return db['ContactItemType'][_0xc514('0x44')]({'attributes':['id','name'],'raw':!![],'order':[_0xc514('0x6c')]})[_0xc514('0x24')](function(_0x489507){_0x5dcbbf=_0x489507;var _0x321d22=_[_0xc514('0x32')](db[_0xc514('0x5a')][_0xc514('0x49')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xc514('0x6d')]})[_0xc514('0x24')](function(_0x30c0f6){_0xe2a0a4=_0x30c0f6;var _0x529644=squel[_0xc514('0x6e')]()['fields'](_0x321d22)[_0xc514('0x6f')](_0xc514('0x70'),'c')[_0xc514('0x3d')]('c.ListId\x20=\x20?',_0x2b70c1)['where']('c.deletedAt\x20is\x20null')['distinct']();for(var _0x4841ca=0x0;_0x4841ca<_0xe2a0a4[_0xc514('0x37')];_0x4841ca++){_0x529644[_0xc514('0x71')](_0xc514('0x72')+_0xe2a0a4[_0x4841ca]['id'],_0xc514('0x73')+_0xe2a0a4[_0x4841ca][_0xc514('0x6d')]);}for(var _0x4841ca=0x0;_0x4841ca<_0x5dcbbf[_0xc514('0x37')];_0x4841ca++){_0x529644[_0xc514('0x71')](squel[_0xc514('0x6e')]()['field'](_0xc514('0x74'))[_0xc514('0x6f')](_0xc514('0x75'))['where'](_0xc514('0x76'),_0x5dcbbf[_0x4841ca]['id'])[_0xc514('0x3d')](_0xc514('0x77')),_0xc514('0x78')+_0x5dcbbf[_0x4841ca][_0xc514('0x29')]);_0x529644[_0xc514('0x71')](squel[_0xc514('0x6e')]()[_0xc514('0x71')]('description')[_0xc514('0x6f')](_0xc514('0x75'))['where'](_0xc514('0x76'),_0x5dcbbf[_0x4841ca]['id'])['where'](_0xc514('0x77')),_0xc514('0x79')+_0x5dcbbf[_0x4841ca][_0xc514('0x29')]);}var _0xc20460=[];_0xc20460[_0xc514('0x5e')](_0x529644[_0xc514('0x7a')]());BPromise['each'](_0xc20460,handleQuery)[_0xc514('0x24')](function(_0x201ba8){handleQuery(_0x529644[_0xc514('0x7a')]());var _0x181e90=csv_results[0x0];if(!_[_0xc514('0x7b')](_0x181e90)){var _0x2470ee=toCsv(_0x181e90);var _0x3e7763=Date[_0xc514('0x7c')]();fs[_0xc514('0x7d')](util[_0xc514('0x69')]('/tmp/list_%d_%s.csv',_0x2b70c1,_0x3e7763),_0x2470ee);_0x2bcbba[_0xc514('0x7e')](_0xc514('0x7f'),_0xc514('0x80')+util[_0xc514('0x69')](_0xc514('0x81'),_0x2b70c1,_0x3e7763));_0x2bcbba[_0xc514('0x7e')](_0xc514('0x82'),_0xc514('0x83'));return _0x2bcbba[_0xc514('0x84')](util[_0xc514('0x69')]('/tmp/list_%d_%s.csv',_0x2b70c1,_0x3e7763));}else{return _0x2bcbba[_0xc514('0x18')](0xcc);}});});});};exports[_0xc514('0x85')]=function(_0x466b7d,_0xad52c8,_0x5e5c3d){var _0x457c8c;delete _0x466b7d[_0xc514('0x4c')]['id'];return db[_0xc514('0x41')][_0xc514('0x86')]({'where':{'id':_0x466b7d[_0xc514('0x48')]['id']}})['then'](handleEntityNotFound(_0xad52c8,null))[_0xc514('0x24')](function(_0x2e5da1){if(_0x2e5da1){return db[_0xc514('0x87')]['transaction'](function(_0x491e9d){return db[_0xc514('0x88')][_0xc514('0x4b')](_0x466b7d[_0xc514('0x4c')],{'transaction':_0x491e9d})['then'](function(_0x3efd2d){_0x457c8c=_0x3efd2d;return _0x2e5da1[_0xc514('0x89')](_0x3efd2d,{'transaction':_0x491e9d});})[_0xc514('0x24')](function(){var _0xc36d0f={'type':db[_0xc514('0x8a')]['TEXT'],'transaction':_0x491e9d};switch(_0x466b7d[_0xc514('0x4c')]['type']){case _0xc514('0x8b'):_0xc36d0f['type']=db[_0xc514('0x8a')][_0xc514('0x8c')];break;case'number':_0xc36d0f[_0xc514('0x2e')]=db[_0xc514('0x8a')]['INTEGER'];break;case _0xc514('0x8d'):_0xc36d0f[_0xc514('0x2e')]=db['Sequelize']['BOOLEAN'];_0xc36d0f[_0xc514('0x8e')]=![];break;default:}return db[_0xc514('0x87')][_0xc514('0x8f')]['addColumn'](_0xc514('0x70'),util[_0xc514('0x69')](_0xc514('0x90'),_0x457c8c['id']),_0xc36d0f);})[_0xc514('0x24')](function(){return _0x457c8c;});});}})[_0xc514('0x24')](respondWithResult(_0xad52c8,null))[_0xc514('0x46')](handleError(_0xad52c8,null));};exports['getCustomFields']=function(_0x54a4b3,_0x3113a5,_0x5c25b9){var _0x105696={};var _0x793654={};var _0x21c916;var _0x2e1f8d;return db[_0xc514('0x41')][_0xc514('0x86')]({'where':{'id':_0x54a4b3[_0xc514('0x48')]['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x3113a5,null))[_0xc514('0x24')](function(_0x278666){if(_0x278666){_0x21c916=_0x278666;_0x793654[_0xc514('0x30')]=_[_0xc514('0x32')](db[_0xc514('0x88')][_0xc514('0x49')]);_0x793654['query']=_[_0xc514('0x32')](_0x54a4b3[_0xc514('0x31')]);_0x793654[_0xc514('0x33')]=_['intersection'](_0x793654[_0xc514('0x30')],_0x793654[_0xc514('0x31')]);_0x105696[_0xc514('0x36')]=_[_0xc514('0x34')](_0x793654[_0xc514('0x30')],qs[_0xc514('0x35')](_0x54a4b3['query'][_0xc514('0x35')]));_0x105696['attributes']=_0x105696['attributes'][_0xc514('0x37')]?_0x105696[_0xc514('0x36')]:_0x793654[_0xc514('0x30')];_0x105696[_0xc514('0x58')]=qs[_0xc514('0x3a')](_0x54a4b3[_0xc514('0x31')][_0xc514('0x3a')]);_0x105696[_0xc514('0x3d')]=qs[_0xc514('0x33')](_['pick'](_0x54a4b3[_0xc514('0x31')],_0x793654[_0xc514('0x33')]));_0x105696['where']=_[_0xc514('0x3e')](_0x105696[_0xc514('0x3d')],{'$or':[{'ListId':_0x278666['id']},{'ListId':null}]});if(_0x54a4b3[_0xc514('0x31')][_0xc514('0x3c')]){_0x105696[_0xc514('0x3d')]=_[_0xc514('0x3e')](_0x105696[_0xc514('0x3d')],{'$or':_[_0xc514('0x2c')](_0x105696['attributes'],function(_0xc8f2d1){var _0x44ed40={};_0x44ed40[_0xc8f2d1]={'$like':'%'+_0x54a4b3['query']['filter']+'%'};return _0x44ed40;})});}_0x105696=_[_0xc514('0x3e')]({},_0x105696,_0x54a4b3[_0xc514('0x40')]);return db[_0xc514('0x88')][_0xc514('0x91')](_0x105696);}})[_0xc514('0x24')](respondWithResult(_0x3113a5,null))[_0xc514('0x46')](handleError(_0x3113a5,null));};exports[_0xc514('0x92')]=function(_0x15a11b,_0x3fed47){return db['CmCustomField'][_0xc514('0x91')]({'where':{'ListId':null}})[_0xc514('0x24')](handleEntityNotFound(_0x3fed47,null))['then'](function(_0x23c4e3){return _0x23c4e3;})['then'](respondWithResult(_0x3fed47,null))['catch'](handleError(_0x3fed47,null));};exports['addAgents']=function(_0x2b77bd,_0x5b8c64,_0x5a307f){return db[_0xc514('0x41')][_0xc514('0x4a')]({'where':{'id':_0x2b77bd[_0xc514('0x48')]['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x5b8c64,null))['then'](function(_0x5f1575){if(_0x5f1575){return _0x5f1575[_0xc514('0x93')](_0x2b77bd[_0xc514('0x4c')][_0xc514('0x61')],_[_0xc514('0x60')](_0x2b77bd[_0xc514('0x4c')],[_0xc514('0x61'),'id'])||{})[_0xc514('0x94')](function(_0x12bf82){for(var _0x1c01e2=0x0;_0x1c01e2<_0x2b77bd[_0xc514('0x4c')][_0xc514('0x61')][_0xc514('0x37')];_0x1c01e2+=0x1){socket['emit'](_0xc514('0x95'),{'UserId':Number(_0x2b77bd[_0xc514('0x4c')][_0xc514('0x61')][_0x1c01e2]),'CmListId':Number(_0x2b77bd[_0xc514('0x48')]['id'])});}return _0x12bf82;});}})[_0xc514('0x24')](respondWithResult(_0x5b8c64,null))['catch'](handleError(_0x5b8c64,null));};exports[_0xc514('0x96')]=function(_0x1da493,_0x3cba36,_0x7491b6){return db['CmList'][_0xc514('0x4a')]({'where':{'id':_0x1da493['params']['id']}})[_0xc514('0x24')](handleEntityNotFound(_0x3cba36,null))[_0xc514('0x24')](function(_0x372c91){if(_0x372c91){return _0x372c91[_0xc514('0x96')](_0x1da493['query'][_0xc514('0x61')])[_0xc514('0x24')](function(){if(_['isArray'](_0x1da493[_0xc514('0x31')][_0xc514('0x61')])){for(var _0x3d3b1a=0x0;_0x3d3b1a<_0x1da493[_0xc514('0x31')][_0xc514('0x61')][_0xc514('0x37')];_0x3d3b1a+=0x1){socket[_0xc514('0x97')](_0xc514('0x98'),{'UserId':Number(_0x1da493['query'][_0xc514('0x61')][_0x3d3b1a]),'CmListId':Number(_0x1da493[_0xc514('0x48')]['id'])});}}else{socket[_0xc514('0x97')](_0xc514('0x98'),{'UserId':Number(_0x1da493[_0xc514('0x31')]['ids']),'CmListId':Number(_0x1da493[_0xc514('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cba36,null))['catch'](handleError(_0x3cba36,null));};exports[_0xc514('0x99')]=function(_0x1b9bde,_0x1ee59b,_0x24022d){var _0xb57d93={};var _0x3db5f5={};var _0x44d525;var _0x5272b0;return db[_0xc514('0x41')][_0xc514('0x86')]({'where':{'id':_0x1b9bde[_0xc514('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ee59b,null))[_0xc514('0x24')](function(_0x5404d6){if(_0x5404d6){_0x44d525=_0x5404d6;_0x3db5f5[_0xc514('0x30')]=_[_0xc514('0x32')](db[_0xc514('0x9a')][_0xc514('0x49')]);_0x3db5f5[_0xc514('0x31')]=_[_0xc514('0x32')](_0x1b9bde[_0xc514('0x31')]);_0x3db5f5[_0xc514('0x33')]=_[_0xc514('0x34')](_0x3db5f5[_0xc514('0x30')],_0x3db5f5[_0xc514('0x31')]);_0xb57d93[_0xc514('0x36')]=_[_0xc514('0x34')](_0x3db5f5['model'],qs[_0xc514('0x35')](_0x1b9bde['query'][_0xc514('0x35')]));_0xb57d93[_0xc514('0x36')]=_0xb57d93[_0xc514('0x36')][_0xc514('0x37')]?_0xb57d93[_0xc514('0x36')]:_0x3db5f5[_0xc514('0x30')];_0xb57d93[_0xc514('0x58')]=qs[_0xc514('0x3a')](_0x1b9bde[_0xc514('0x31')]['sort']);_0xb57d93[_0xc514('0x3d')]=qs['filters'](_[_0xc514('0x3b')](_0x1b9bde['query'],_0x3db5f5[_0xc514('0x33')]));if(_0x1b9bde[_0xc514('0x31')][_0xc514('0x3c')]){_0xb57d93[_0xc514('0x3d')]=_[_0xc514('0x3e')](_0xb57d93[_0xc514('0x3d')],{'$or':_[_0xc514('0x2c')](_0xb57d93['attributes'],function(_0xfe6922){var _0x10db38={};_0x10db38[_0xfe6922]={'$like':'%'+_0x1b9bde[_0xc514('0x31')][_0xc514('0x3c')]+'%'};return _0x10db38;})});}_0xb57d93=_[_0xc514('0x3e')]({},_0xb57d93,_0x1b9bde['options']);return _0x44d525[_0xc514('0x99')](_0xb57d93);}})[_0xc514('0x24')](function(_0x356129){if(_0x356129){_0x5272b0=_0x356129['length'];if(!_0x1b9bde['query'][_0xc514('0x38')]('nolimit')){_0xb57d93[_0xc514('0x1f')]=qs[_0xc514('0x1f')](_0x1b9bde[_0xc514('0x31')][_0xc514('0x1f')]);_0xb57d93[_0xc514('0x1c')]=qs[_0xc514('0x1c')](_0x1b9bde['query'][_0xc514('0x1c')]);}return _0x44d525[_0xc514('0x99')](_0xb57d93);}})[_0xc514('0x24')](function(_0x3f1f17){if(_0x3f1f17){return _0x3f1f17?{'count':_0x5272b0,'rows':_0x3f1f17}:null;}})[_0xc514('0x24')](respondWithResult(_0x1ee59b,null))[_0xc514('0x46')](handleError(_0x1ee59b,null));};function handleQuery(_0x2dfac1){logger[_0xc514('0x9b')](_0x2dfac1);return db['sequelize'][_0xc514('0x31')](_0x2dfac1)[_0xc514('0x94')](function(_0x247ead){csv_results[_0xc514('0x5e')](_0x247ead);})[_0xc514('0x46')](function(_0x1bf53b){logger[_0xc514('0x28')](_0x1bf53b[_0xc514('0x9c')]);});} \ No newline at end of file +var _0x4921=['getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','raw','ContactItemType','findAll','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','alias','field','cm_contact_has_items','CmContactId\x20=\x20c.id','description','ItemTypeId\x20=\x20?','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','TEXT','text','Sequelize','number','INTEGER','switch','sequelize','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','error','name','send','map','CmList','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0x4921,0xe6));var _0x1492=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x4921[_0x57cc22];return _0x6f7bdc;};'use strict';var emlformat=require(_0x1492('0x0'));var rimraf=require(_0x1492('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1492('0x2'));var rp=require(_0x1492('0x3'));var moment=require(_0x1492('0x4'));var BPromise=require(_0x1492('0x5'));var Mustache=require(_0x1492('0x6'));var util=require('util');var path=require(_0x1492('0x7'));var sox=require('sox');var csv=require(_0x1492('0x8'));var ejs=require(_0x1492('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1492('0xa'));var squel=require(_0x1492('0xb'));var crypto=require(_0x1492('0xc'));var jsforce=require(_0x1492('0xd'));var deskjs=require(_0x1492('0xe'));var toCsv=require(_0x1492('0x8'));var querystring=require(_0x1492('0xf'));var Papa=require('papaparse');var Redis=require(_0x1492('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1492('0x11'));var as=require(_0x1492('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1492('0x13'))(_0x1492('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1492('0x15'));var db=require(_0x1492('0x16'))['db'];var csv_results;config[_0x1492('0x17')]=_['defaults'](config[_0x1492('0x17')],{'host':_0x1492('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1492('0x17')]));require(_0x1492('0x19'))[_0x1492('0x1a')](socket);function respondWithStatusCode(_0x17a027,_0x1cddcd){_0x1cddcd=_0x1cddcd||0xcc;return function(_0x4955d1){if(_0x4955d1){return _0x17a027[_0x1492('0x1b')](_0x1cddcd);}return _0x17a027[_0x1492('0x1c')](_0x1cddcd)[_0x1492('0x1d')]();};}function respondWithResult(_0x574347,_0x4ab47d){_0x4ab47d=_0x4ab47d||0xc8;return function(_0x36079f){if(_0x36079f){return _0x574347[_0x1492('0x1c')](_0x4ab47d)['json'](_0x36079f);}};}function respondWithFilteredResult(_0x2a0e80,_0x1e7e7d){return function(_0x55af43){if(_0x55af43){var _0x42a015=typeof _0x1e7e7d[_0x1492('0x1e')]===_0x1492('0x1f')&&typeof _0x1e7e7d[_0x1492('0x20')]===_0x1492('0x1f');var _0x130d18=_0x55af43[_0x1492('0x21')];var _0x23017d=_0x42a015?0x0:_0x1e7e7d[_0x1492('0x1e')];var _0x1a7c59=_0x42a015?_0x55af43[_0x1492('0x21')]:_0x1e7e7d[_0x1492('0x1e')]+_0x1e7e7d[_0x1492('0x20')];var _0xd00ad7;if(_0x1a7c59>=_0x130d18){_0x1a7c59=_0x130d18;_0xd00ad7=0xc8;}else{_0xd00ad7=0xce;}_0x2a0e80[_0x1492('0x1c')](_0xd00ad7);return _0x2a0e80[_0x1492('0x22')](_0x1492('0x23'),_0x23017d+'-'+_0x1a7c59+'/'+_0x130d18)[_0x1492('0x24')](_0x55af43);}return null;};}function patchUpdates(_0x52c2d2){return function(_0x54ce06){try{jsonpatch[_0x1492('0x25')](_0x54ce06,_0x52c2d2,!![]);}catch(_0x213a33){return BPromise['reject'](_0x213a33);}return _0x54ce06[_0x1492('0x26')]();};}function saveUpdates(_0x107b8e,_0x39648c){return function(_0x4c6442){if(_0x4c6442){return _0x4c6442[_0x1492('0x27')](_0x107b8e)[_0x1492('0x28')](function(_0x279831){return _0x279831;});}return null;};}function removeEntity(_0x562b64,_0x4df81e){return function(_0x10e394){if(_0x10e394){return _0x10e394[_0x1492('0x29')]()[_0x1492('0x28')](function(){var _0x131a73=_0x10e394[_0x1492('0x2a')]({'plain':!![]});var _0xa22e25=_0x1492('0x2b');return db[_0x1492('0x2c')][_0x1492('0x29')]({'where':{'type':_0xa22e25,'resourceId':_0x131a73['id']}})['then'](function(){return _0x10e394;});})['then'](function(){_0x562b64['status'](0xcc)[_0x1492('0x1d')]();});}};}function handleEntityNotFound(_0x1b5d07,_0x1d32cf){return function(_0x5f330e){if(!_0x5f330e){_0x1b5d07['sendStatus'](0x194);}return _0x5f330e;};}function handleError(_0x3c7091,_0x3beff2){_0x3beff2=_0x3beff2||0x1f4;return function(_0x1731e){logger[_0x1492('0x2d')](_0x1731e['stack']);if(_0x1731e[_0x1492('0x2e')]){delete _0x1731e[_0x1492('0x2e')];}_0x3c7091[_0x1492('0x1c')](_0x3beff2)[_0x1492('0x2f')](_0x1731e);};}exports['index']=function(_0x21994a,_0x319358){var _0x30d001={},_0x42eaf9={},_0x26e969={'count':0x0,'rows':[]};var _0x40c9a9=_[_0x1492('0x30')](db[_0x1492('0x31')][_0x1492('0x32')],function(_0x33dbe1){return{'name':_0x33dbe1['fieldName'],'type':_0x33dbe1['type'][_0x1492('0x33')]};});_0x42eaf9[_0x1492('0x34')]=_[_0x1492('0x30')](_0x40c9a9,_0x1492('0x2e'));_0x42eaf9[_0x1492('0x35')]=_[_0x1492('0x36')](_0x21994a['query']);_0x42eaf9['filters']=_['intersection'](_0x42eaf9[_0x1492('0x34')],_0x42eaf9[_0x1492('0x35')]);_0x30d001['attributes']=_[_0x1492('0x37')](_0x42eaf9['model'],qs['fields'](_0x21994a[_0x1492('0x35')][_0x1492('0x38')]));_0x30d001[_0x1492('0x39')]=_0x30d001[_0x1492('0x39')][_0x1492('0x3a')]?_0x30d001['attributes']:_0x42eaf9['model'];if(!_0x21994a[_0x1492('0x35')][_0x1492('0x3b')](_0x1492('0x3c'))){_0x30d001[_0x1492('0x20')]=qs['limit'](_0x21994a[_0x1492('0x35')]['limit']);_0x30d001[_0x1492('0x1e')]=qs[_0x1492('0x1e')](_0x21994a[_0x1492('0x35')][_0x1492('0x1e')]);}_0x30d001[_0x1492('0x3d')]=qs['sort'](_0x21994a[_0x1492('0x35')][_0x1492('0x3e')]);_0x30d001[_0x1492('0x3f')]=qs[_0x1492('0x40')](_[_0x1492('0x41')](_0x21994a[_0x1492('0x35')],_0x42eaf9[_0x1492('0x40')]),_0x40c9a9);if(_0x21994a['query'][_0x1492('0x42')]){_0x30d001[_0x1492('0x3f')]=_[_0x1492('0x43')](_0x30d001['where'],{'$or':_[_0x1492('0x30')](_0x40c9a9,function(_0x5a4be7){if(_0x5a4be7[_0x1492('0x44')]!==_0x1492('0x45')){var _0x2e31d4={};_0x2e31d4[_0x5a4be7[_0x1492('0x2e')]]={'$like':'%'+_0x21994a[_0x1492('0x35')][_0x1492('0x42')]+'%'};return _0x2e31d4;}})});}_0x30d001=_['merge']({},_0x30d001,_0x21994a['options']);var _0x9e2efb={'where':_0x30d001[_0x1492('0x3f')]};return db['CmList'][_0x1492('0x21')](_0x9e2efb)[_0x1492('0x28')](function(_0x5025ac){_0x26e969[_0x1492('0x21')]=_0x5025ac;if(_0x21994a[_0x1492('0x35')][_0x1492('0x46')]){_0x30d001[_0x1492('0x47')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x30d001);})[_0x1492('0x28')](function(_0x492870){_0x26e969[_0x1492('0x48')]=_0x492870;return _0x26e969;})[_0x1492('0x28')](respondWithFilteredResult(_0x319358,_0x30d001))['catch'](handleError(_0x319358,null));};exports[_0x1492('0x49')]=function(_0x587647,_0x5b5de9){var _0x2ab6dc={'raw':![],'where':{'id':_0x587647['params']['id']}},_0x4b9cf3={};_0x4b9cf3[_0x1492('0x34')]=_[_0x1492('0x36')](db[_0x1492('0x31')][_0x1492('0x32')]);_0x4b9cf3['query']=_[_0x1492('0x36')](_0x587647[_0x1492('0x35')]);_0x4b9cf3['filters']=_['intersection'](_0x4b9cf3['model'],_0x4b9cf3[_0x1492('0x35')]);_0x2ab6dc['attributes']=_['intersection'](_0x4b9cf3[_0x1492('0x34')],qs[_0x1492('0x38')](_0x587647[_0x1492('0x35')][_0x1492('0x38')]));_0x2ab6dc[_0x1492('0x39')]=_0x2ab6dc[_0x1492('0x39')][_0x1492('0x3a')]?_0x2ab6dc[_0x1492('0x39')]:_0x4b9cf3[_0x1492('0x34')];if(_0x587647[_0x1492('0x35')]['includeAll']){_0x2ab6dc['include']=[{'all':!![]}];}_0x2ab6dc=_[_0x1492('0x43')]({},_0x2ab6dc,_0x587647[_0x1492('0x4a')]);return db[_0x1492('0x31')][_0x1492('0x4b')](_0x2ab6dc)[_0x1492('0x28')](handleEntityNotFound(_0x5b5de9,null))['then'](respondWithResult(_0x5b5de9,null))[_0x1492('0x4c')](handleError(_0x5b5de9,null));};exports[_0x1492('0x4d')]=function(_0x51ee2d,_0x35a071){return db[_0x1492('0x31')][_0x1492('0x4d')](_0x51ee2d[_0x1492('0x4e')],{})[_0x1492('0x28')](function(_0x1d94f0){var _0x2fcb55=_0x51ee2d[_0x1492('0x4f')][_0x1492('0x2a')]({'plain':!![]});if(!_0x2fcb55)throw new Error(_0x1492('0x50'));if(_0x2fcb55['role']===_0x1492('0x4f')){var _0x1ca895=_0x1d94f0[_0x1492('0x2a')]({'plain':!![]});var _0x4713fd='Lists';return db[_0x1492('0x51')][_0x1492('0x4b')]({'where':{'name':_0x4713fd,'userProfileId':_0x2fcb55[_0x1492('0x52')]},'raw':!![]})[_0x1492('0x28')](function(_0x4d9c4c){if(_0x4d9c4c&&_0x4d9c4c[_0x1492('0x53')]===0x0){return db['UserProfileResource'][_0x1492('0x4d')]({'name':_0x1ca895[_0x1492('0x2e')],'resourceId':_0x1ca895['id'],'type':_0x4d9c4c['name'],'sectionId':_0x4d9c4c['id']},{})['then'](function(){return _0x1d94f0;});}else{return _0x1d94f0;}})['catch'](function(_0x273cf7){logger[_0x1492('0x2d')](_0x1492('0x54'),_0x273cf7);throw _0x273cf7;});}return _0x1d94f0;})['then'](respondWithResult(_0x35a071,0xc9))['catch'](handleError(_0x35a071,null));};exports['update']=function(_0x1780c6,_0x39b6fa){if(_0x1780c6[_0x1492('0x4e')]['id']){delete _0x1780c6[_0x1492('0x4e')]['id'];}return db[_0x1492('0x31')][_0x1492('0x4b')]({'where':{'id':_0x1780c6[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x39b6fa,null))[_0x1492('0x28')](saveUpdates(_0x1780c6[_0x1492('0x4e')],null))['then'](respondWithResult(_0x39b6fa,null))[_0x1492('0x4c')](handleError(_0x39b6fa,null));};exports[_0x1492('0x29')]=function(_0x376592,_0x32560d){return db[_0x1492('0x31')][_0x1492('0x4b')]({'where':{'id':_0x376592[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x32560d,null))[_0x1492('0x28')](removeEntity(_0x32560d,null))[_0x1492('0x4c')](handleError(_0x32560d,null));};exports['describe']=function(_0x2051e6,_0x9ea363){return db[_0x1492('0x31')][_0x1492('0x56')]()['then'](respondWithResult(_0x9ea363,null))['catch'](handleError(_0x9ea363,null));};exports[_0x1492('0x57')]=function(_0x347b39,_0x2483b1,_0x5705ee){if(_0x347b39[_0x1492('0x4e')]['id']){delete _0x347b39[_0x1492('0x4e')]['id'];}return db['CmList'][_0x1492('0x4b')]({'where':{'id':_0x347b39[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x2483b1,null))['then'](function(_0x2ccbc4){if(_0x2ccbc4){_0x347b39[_0x1492('0x4e')][_0x1492('0x58')]=_0x2ccbc4['id'];return db[_0x1492('0x59')][_0x1492('0x4d')](_0x347b39[_0x1492('0x4e')]);}})[_0x1492('0x28')](respondWithResult(_0x2483b1,null))['catch'](handleError(_0x2483b1,null));};exports[_0x1492('0x5a')]=function(_0x42c870,_0x29382c,_0x224db6){var _0x4913ef={'raw':![],'where':{}};var _0x33ffe7={};var _0x206b54={'count':0x0,'rows':[]};return db['CmList'][_0x1492('0x5b')]({'where':{'id':_0x42c870[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x29382c,null))[_0x1492('0x28')](function(_0x5e2674){if(_0x5e2674){_0x33ffe7[_0x1492('0x34')]=_[_0x1492('0x36')](db[_0x1492('0x59')][_0x1492('0x32')]);_0x33ffe7['query']=_[_0x1492('0x36')](_0x42c870[_0x1492('0x35')]);_0x33ffe7[_0x1492('0x40')]=_[_0x1492('0x37')](_0x33ffe7['model'],_0x33ffe7[_0x1492('0x35')]);_0x4913ef[_0x1492('0x39')]=_[_0x1492('0x37')](_0x33ffe7[_0x1492('0x34')],qs[_0x1492('0x38')](_0x42c870[_0x1492('0x35')][_0x1492('0x38')]));_0x4913ef[_0x1492('0x39')]=_0x4913ef[_0x1492('0x39')][_0x1492('0x3a')]?_0x4913ef[_0x1492('0x39')]:_0x33ffe7[_0x1492('0x34')];if(!_0x42c870[_0x1492('0x35')][_0x1492('0x3b')](_0x1492('0x3c'))){_0x4913ef[_0x1492('0x20')]=qs[_0x1492('0x20')](_0x42c870[_0x1492('0x35')][_0x1492('0x20')]);_0x4913ef[_0x1492('0x1e')]=qs[_0x1492('0x1e')](_0x42c870[_0x1492('0x35')][_0x1492('0x1e')]);}_0x4913ef['order']=qs[_0x1492('0x3e')](_0x42c870['query'][_0x1492('0x3e')]);_0x4913ef[_0x1492('0x3f')]=qs['filters'](_[_0x1492('0x41')](_0x42c870[_0x1492('0x35')],_0x33ffe7[_0x1492('0x40')]));_0x4913ef[_0x1492('0x3f')]['ListId']=_0x5e2674['id'];if(_0x42c870[_0x1492('0x35')]['filter']){_0x4913ef['where']=_['merge'](_0x4913ef[_0x1492('0x3f')],{'$or':_[_0x1492('0x30')](_0x4913ef[_0x1492('0x39')],function(_0x33a501){var _0x2d8212={};_0x2d8212[_0x33a501]={'$like':'%'+_0x42c870[_0x1492('0x35')]['filter']+'%'};return _0x2d8212;})});}_0x4913ef=_['merge']({},_0x4913ef,_0x42c870[_0x1492('0x4a')]);return db['Disposition'][_0x1492('0x21')]({'where':_0x4913ef['where']})[_0x1492('0x28')](function(_0x1d0f17){_0x206b54[_0x1492('0x21')]=_0x1d0f17;if(_0x42c870['query'][_0x1492('0x46')]){_0x4913ef[_0x1492('0x47')]=[{'all':!![]}];}return db[_0x1492('0x59')]['findAll'](_0x4913ef);})['then'](function(_0x1d5aad){_0x206b54[_0x1492('0x48')]=_0x1d5aad;return _0x206b54;});}})[_0x1492('0x28')](respondWithFilteredResult(_0x29382c,_0x4913ef))[_0x1492('0x4c')](handleError(_0x29382c,null));};exports[_0x1492('0x5c')]=function(_0x4002ca,_0x475d33,_0x59e3dc){return db[_0x1492('0x31')][_0x1492('0x4b')]({'where':{'id':_0x4002ca['params']['id']}})['then'](handleEntityNotFound(_0x475d33,null))[_0x1492('0x28')](function(_0x25029e){if(_0x25029e){return _0x25029e[_0x1492('0x5c')](_0x4002ca[_0x1492('0x35')][_0x1492('0x5d')]);}})[_0x1492('0x28')](respondWithStatusCode(_0x475d33,null))[_0x1492('0x4c')](handleError(_0x475d33,null));};exports[_0x1492('0x5e')]=function(_0x5d55cd,_0xc2b844,_0x3c5544){return db[_0x1492('0x31')]['find']({'where':{'id':_0x5d55cd[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0xc2b844,null))[_0x1492('0x28')](function(_0x5d8c8b){if(_0x5d8c8b){var _0x2184e3=[];var _0xc9c2b4={'success':[],'errors':[]};return db[_0x1492('0x5f')][_0x1492('0x56')]()[_0x1492('0x28')](function(_0x2aec59){if(_0x5d55cd[_0x1492('0x4e')][_0x1492('0x60')]&&_['isArray'](_0x5d55cd['body'][_0x1492('0x60')])){if(_0x5d55cd[_0x1492('0x4e')][_0x1492('0x60')][_0x1492('0x3a')]){_0x5d55cd[_0x1492('0x4e')][_0x1492('0x60')]=_0x5d55cd[_0x1492('0x4e')][_0x1492('0x60')][_0x1492('0x61')](';')+';';}else{_0x5d55cd['body'][_0x1492('0x60')]=null;}}else{_0x5d55cd['body']['tags']=null;}if(_0x5d55cd[_0x1492('0x4e')]&&_[_0x1492('0x62')](_0x5d55cd['body'])){for(var _0x56d0d3=0x0;_0x56d0d3<_0x5d55cd['body'][_0x1492('0x3a')];_0x56d0d3+=0x1){_0x5d55cd['body'][_0x56d0d3][_0x1492('0x58')]=_0x5d55cd[_0x1492('0x55')]['id'];_0x2184e3[_0x1492('0x63')](_0x5d55cd[_0x1492('0x4e')][_0x56d0d3]);}return BPromise['each'](_0x2184e3,function(_0x188a5b){return db[_0x1492('0x5f')][_0x1492('0x4d')](_['omit'](_0x188a5b,[_0x1492('0x5d'),'id'])||{},{'fields':_[_0x1492('0x36')](_0x2aec59),'raw':!![]})['then'](function(_0x565330){_0xc9c2b4[_0x1492('0x64')][_0x1492('0x63')](_0x565330[_0x1492('0x65')]);})[_0x1492('0x4c')](function(_0x24f821){_0xc9c2b4[_0x1492('0x66')]['push']({'data':_0x188a5b,'error':_0x24f821[_0x1492('0x67')]});});})[_0x1492('0x28')](function(_0x2e2b2f){return _0xc9c2b4;})['catch'](function(_0x122c5c){return _0x122c5c;});}else{_0xc2b844[_0x1492('0x1c')](0x190)[_0x1492('0x24')]({'message':_0x1492('0x68')});}});}})[_0x1492('0x28')](respondWithResult(_0xc2b844,null))[_0x1492('0x4c')](handleError(_0xc2b844,null));};exports[_0x1492('0x69')]=function(_0x3f748b,_0x335ed5,_0x4da2d6){var _0x411d89;return db[_0x1492('0x31')][_0x1492('0x4b')]({'where':{'id':_0x3f748b[_0x1492('0x55')]['id']},'include':[{'model':db[_0x1492('0x6a')],'as':_0x1492('0x6b')}]})['then'](handleEntityNotFound(_0x335ed5,null))['then'](function(_0x62fff0){if(_0x62fff0){_0x411d89=_0x62fff0;return db[_0x1492('0x5f')]['rawAttributes'];}})[_0x1492('0x28')](function(_0x46dae3){if(_0x46dae3){var _0x49e8d9={};var _0x558057={};_0x558057['model']=_['concat'](_[_0x1492('0x36')](_0x46dae3),_[_0x1492('0x30')](_0x411d89[_0x1492('0x6b')],function(_0x38c12f){return util['format'](_0x1492('0x6c'),_0x38c12f['id']);}));_0x558057['query']=_['keys'](_0x3f748b[_0x1492('0x35')]);_0x558057[_0x1492('0x40')]=_['intersection'](_0x558057[_0x1492('0x34')],_0x558057[_0x1492('0x35')]);_0x49e8d9[_0x1492('0x39')]=_[_0x1492('0x37')](_0x558057[_0x1492('0x34')],qs[_0x1492('0x38')](_0x3f748b[_0x1492('0x35')][_0x1492('0x38')]));_0x49e8d9[_0x1492('0x39')]=_0x49e8d9[_0x1492('0x39')][_0x1492('0x3a')]?_0x49e8d9[_0x1492('0x39')]:_0x558057['model'];if(!_0x3f748b['query'][_0x1492('0x3b')](_0x1492('0x3c'))){_0x49e8d9[_0x1492('0x20')]=qs['limit'](_0x3f748b[_0x1492('0x35')][_0x1492('0x20')]);_0x49e8d9[_0x1492('0x1e')]=qs[_0x1492('0x1e')](_0x3f748b[_0x1492('0x35')][_0x1492('0x1e')]);}_0x49e8d9[_0x1492('0x3d')]=qs[_0x1492('0x3e')](_0x3f748b[_0x1492('0x35')][_0x1492('0x3e')]);_0x49e8d9[_0x1492('0x3f')]=qs[_0x1492('0x40')](_['pick'](_0x3f748b[_0x1492('0x35')],_0x558057['filters']));_0x49e8d9[_0x1492('0x6d')]=!![];if(_0x3f748b[_0x1492('0x35')][_0x1492('0x42')]){_0x49e8d9[_0x1492('0x3f')]=_['merge'](_0x49e8d9[_0x1492('0x3f')],{'$or':_[_0x1492('0x30')](_0x49e8d9[_0x1492('0x39')],function(_0x50a1a1){var _0x111cf2={};_0x111cf2[_0x50a1a1]={'$like':'%'+_0x3f748b['query']['filter']+'%'};return _0x111cf2;})});}_0x49e8d9=_[_0x1492('0x43')]({},_0x49e8d9,_0x3f748b[_0x1492('0x4a')]);return _0x411d89[_0x1492('0x69')](_0x49e8d9);}})[_0x1492('0x28')](respondWithResult(_0x335ed5,null))[_0x1492('0x4c')](handleError(_0x335ed5,null));};exports['getContactsCsv']=function(_0x6abd11,_0xf6e75a,_0x217fa5){var _0x8a0de;var _0x5c3a90;var _0x2a02a6;var _0x2bf7e6=_0x6abd11[_0x1492('0x55')]['id'];csv_results=[];return db[_0x1492('0x6e')][_0x1492('0x6f')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x1492('0x28')](function(_0x27d4ef){_0x8a0de=_0x27d4ef;var _0x3d3955=_[_0x1492('0x36')](db['CmContact'][_0x1492('0x32')]);return db[_0x1492('0x6a')][_0x1492('0x6f')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x26a93){_0x5c3a90=_0x26a93;var _0x410af7=squel[_0x1492('0x70')]()[_0x1492('0x38')](_0x3d3955)[_0x1492('0x71')]('cm_contacts','c')['where'](_0x1492('0x72'),_0x2bf7e6)[_0x1492('0x3f')](_0x1492('0x73'))[_0x1492('0x74')]();for(var _0x329167=0x0;_0x329167<_0x5c3a90[_0x1492('0x3a')];_0x329167++){_0x410af7['field'](_0x1492('0x75')+_0x5c3a90[_0x329167]['id'],_0x1492('0x76')+_0x5c3a90[_0x329167][_0x1492('0x77')]);}for(var _0x329167=0x0;_0x329167<_0x8a0de[_0x1492('0x3a')];_0x329167++){_0x410af7[_0x1492('0x78')](squel['select']()[_0x1492('0x78')]('item')[_0x1492('0x71')](_0x1492('0x79'))[_0x1492('0x3f')]('ItemTypeId\x20=\x20?',_0x8a0de[_0x329167]['id'])[_0x1492('0x3f')](_0x1492('0x7a')),'additionalPhone_'+_0x8a0de[_0x329167]['name']);_0x410af7[_0x1492('0x78')](squel['select']()[_0x1492('0x78')](_0x1492('0x7b'))[_0x1492('0x71')](_0x1492('0x79'))[_0x1492('0x3f')](_0x1492('0x7c'),_0x8a0de[_0x329167]['id'])[_0x1492('0x3f')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x8a0de[_0x329167][_0x1492('0x2e')]);}var _0x5cccfa=[];_0x5cccfa[_0x1492('0x63')](_0x410af7['toString']());BPromise['each'](_0x5cccfa,handleQuery)[_0x1492('0x28')](function(_0x3e6226){handleQuery(_0x410af7[_0x1492('0x7d')]());var _0x2d52df=csv_results[0x0];if(!_[_0x1492('0x7e')](_0x2d52df)){var _0x40695d=toCsv(_0x2d52df);var _0x3a2959=Date[_0x1492('0x7f')]();fs[_0x1492('0x80')](util['format'](_0x1492('0x81'),_0x2bf7e6,_0x3a2959),_0x40695d);_0xf6e75a[_0x1492('0x82')]('Content-disposition',_0x1492('0x83')+util[_0x1492('0x84')](_0x1492('0x85'),_0x2bf7e6,_0x3a2959));_0xf6e75a[_0x1492('0x82')](_0x1492('0x86'),_0x1492('0x87'));return _0xf6e75a[_0x1492('0x88')](util[_0x1492('0x84')]('/tmp/list_%d_%s.csv',_0x2bf7e6,_0x3a2959));}else{return _0xf6e75a[_0x1492('0x1b')](0xcc);}});});});};exports[_0x1492('0x89')]=function(_0x18d94a,_0x461a1d,_0x30cb97){var _0x543a84;delete _0x18d94a[_0x1492('0x4e')]['id'];return db['CmList'][_0x1492('0x5b')]({'where':{'id':_0x18d94a[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x461a1d,null))[_0x1492('0x28')](function(_0x1b5a59){if(_0x1b5a59){return db['sequelize']['transaction'](function(_0x565461){return db[_0x1492('0x6a')][_0x1492('0x4d')](_0x18d94a[_0x1492('0x4e')],{'transaction':_0x565461})['then'](function(_0x37408b){_0x543a84=_0x37408b;return _0x1b5a59['addCustomFields'](_0x37408b,{'transaction':_0x565461});})['then'](function(){var _0x1d461e={'type':db['Sequelize'][_0x1492('0x8a')],'transaction':_0x565461};switch(_0x18d94a['body']['type']){case _0x1492('0x8b'):_0x1d461e[_0x1492('0x44')]=db[_0x1492('0x8c')][_0x1492('0x8a')];break;case _0x1492('0x8d'):_0x1d461e[_0x1492('0x44')]=db[_0x1492('0x8c')][_0x1492('0x8e')];break;case _0x1492('0x8f'):_0x1d461e[_0x1492('0x44')]=db[_0x1492('0x8c')]['BOOLEAN'];_0x1d461e['defaultValue']=![];break;default:}return db[_0x1492('0x90')][_0x1492('0x91')]['addColumn'](_0x1492('0x92'),util[_0x1492('0x84')](_0x1492('0x93'),_0x543a84['id']),_0x1d461e);})[_0x1492('0x28')](function(){return _0x543a84;});});}})[_0x1492('0x28')](respondWithResult(_0x461a1d,null))[_0x1492('0x4c')](handleError(_0x461a1d,null));};exports[_0x1492('0x94')]=function(_0x423891,_0x410262,_0x9c1836){var _0x3f07e5={};var _0x328442={};var _0x58c192;var _0x24c39c;return db[_0x1492('0x31')][_0x1492('0x5b')]({'where':{'id':_0x423891[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x410262,null))[_0x1492('0x28')](function(_0x2a5891){if(_0x2a5891){_0x58c192=_0x2a5891;_0x328442[_0x1492('0x34')]=_[_0x1492('0x36')](db[_0x1492('0x6a')][_0x1492('0x32')]);_0x328442[_0x1492('0x35')]=_[_0x1492('0x36')](_0x423891['query']);_0x328442[_0x1492('0x40')]=_[_0x1492('0x37')](_0x328442[_0x1492('0x34')],_0x328442[_0x1492('0x35')]);_0x3f07e5[_0x1492('0x39')]=_[_0x1492('0x37')](_0x328442[_0x1492('0x34')],qs['fields'](_0x423891[_0x1492('0x35')][_0x1492('0x38')]));_0x3f07e5[_0x1492('0x39')]=_0x3f07e5[_0x1492('0x39')][_0x1492('0x3a')]?_0x3f07e5[_0x1492('0x39')]:_0x328442[_0x1492('0x34')];_0x3f07e5[_0x1492('0x3d')]=qs[_0x1492('0x3e')](_0x423891[_0x1492('0x35')][_0x1492('0x3e')]);_0x3f07e5[_0x1492('0x3f')]=qs[_0x1492('0x40')](_[_0x1492('0x41')](_0x423891[_0x1492('0x35')],_0x328442['filters']));_0x3f07e5[_0x1492('0x3f')]=_['merge'](_0x3f07e5[_0x1492('0x3f')],{'$or':[{'ListId':_0x2a5891['id']},{'ListId':null}]});if(_0x423891[_0x1492('0x35')][_0x1492('0x42')]){_0x3f07e5[_0x1492('0x3f')]=_['merge'](_0x3f07e5['where'],{'$or':_[_0x1492('0x30')](_0x3f07e5[_0x1492('0x39')],function(_0x427da8){var _0x17b541={};_0x17b541[_0x427da8]={'$like':'%'+_0x423891[_0x1492('0x35')][_0x1492('0x42')]+'%'};return _0x17b541;})});}_0x3f07e5=_['merge']({},_0x3f07e5,_0x423891[_0x1492('0x4a')]);return db[_0x1492('0x6a')][_0x1492('0x95')](_0x3f07e5);}})[_0x1492('0x28')](respondWithResult(_0x410262,null))['catch'](handleError(_0x410262,null));};exports['getGlobalCustomFields']=function(_0x521706,_0x28ad5e){return db[_0x1492('0x6a')][_0x1492('0x95')]({'where':{'ListId':null}})[_0x1492('0x28')](handleEntityNotFound(_0x28ad5e,null))['then'](function(_0x57d877){return _0x57d877;})[_0x1492('0x28')](respondWithResult(_0x28ad5e,null))[_0x1492('0x4c')](handleError(_0x28ad5e,null));};exports[_0x1492('0x96')]=function(_0x2a0589,_0x516012,_0xeae0c6){return db[_0x1492('0x31')]['find']({'where':{'id':_0x2a0589[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x516012,null))[_0x1492('0x28')](function(_0x5e921e){if(_0x5e921e){return _0x5e921e['addAgents'](_0x2a0589[_0x1492('0x4e')]['ids'],_[_0x1492('0x97')](_0x2a0589[_0x1492('0x4e')],[_0x1492('0x5d'),'id'])||{})[_0x1492('0x98')](function(_0x175bbe){for(var _0x427c30=0x0;_0x427c30<_0x2a0589[_0x1492('0x4e')][_0x1492('0x5d')][_0x1492('0x3a')];_0x427c30+=0x1){socket[_0x1492('0x99')](_0x1492('0x9a'),{'UserId':Number(_0x2a0589[_0x1492('0x4e')][_0x1492('0x5d')][_0x427c30]),'CmListId':Number(_0x2a0589[_0x1492('0x55')]['id'])});}return _0x175bbe;});}})[_0x1492('0x28')](respondWithResult(_0x516012,null))[_0x1492('0x4c')](handleError(_0x516012,null));};exports[_0x1492('0x9b')]=function(_0x2c1f59,_0x1cea87,_0x2158d8){return db[_0x1492('0x31')][_0x1492('0x4b')]({'where':{'id':_0x2c1f59[_0x1492('0x55')]['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x1cea87,null))[_0x1492('0x28')](function(_0x5a1347){if(_0x5a1347){return _0x5a1347['removeAgents'](_0x2c1f59[_0x1492('0x35')]['ids'])[_0x1492('0x28')](function(){if(_[_0x1492('0x62')](_0x2c1f59[_0x1492('0x35')][_0x1492('0x5d')])){for(var _0x7f4cde=0x0;_0x7f4cde<_0x2c1f59[_0x1492('0x35')]['ids'][_0x1492('0x3a')];_0x7f4cde+=0x1){socket['emit'](_0x1492('0x9c'),{'UserId':Number(_0x2c1f59[_0x1492('0x35')][_0x1492('0x5d')][_0x7f4cde]),'CmListId':Number(_0x2c1f59[_0x1492('0x55')]['id'])});}}else{socket[_0x1492('0x99')]('userCmList:remove',{'UserId':Number(_0x2c1f59[_0x1492('0x35')][_0x1492('0x5d')]),'CmListId':Number(_0x2c1f59[_0x1492('0x55')]['id'])});}});}})[_0x1492('0x28')](respondWithStatusCode(_0x1cea87,null))[_0x1492('0x4c')](handleError(_0x1cea87,null));};exports[_0x1492('0x9d')]=function(_0x1834ca,_0x47773c,_0x1c1cc1){var _0xd6257f={};var _0x2d0d1f={};var _0x36ce43;var _0x2b9f51;return db[_0x1492('0x31')][_0x1492('0x5b')]({'where':{'id':_0x1834ca['params']['id']}})[_0x1492('0x28')](handleEntityNotFound(_0x47773c,null))[_0x1492('0x28')](function(_0x39e5de){if(_0x39e5de){_0x36ce43=_0x39e5de;_0x2d0d1f['model']=_[_0x1492('0x36')](db[_0x1492('0x9e')][_0x1492('0x32')]);_0x2d0d1f[_0x1492('0x35')]=_[_0x1492('0x36')](_0x1834ca[_0x1492('0x35')]);_0x2d0d1f[_0x1492('0x40')]=_['intersection'](_0x2d0d1f[_0x1492('0x34')],_0x2d0d1f[_0x1492('0x35')]);_0xd6257f[_0x1492('0x39')]=_[_0x1492('0x37')](_0x2d0d1f['model'],qs[_0x1492('0x38')](_0x1834ca[_0x1492('0x35')][_0x1492('0x38')]));_0xd6257f[_0x1492('0x39')]=_0xd6257f['attributes'][_0x1492('0x3a')]?_0xd6257f[_0x1492('0x39')]:_0x2d0d1f[_0x1492('0x34')];_0xd6257f[_0x1492('0x3d')]=qs[_0x1492('0x3e')](_0x1834ca[_0x1492('0x35')][_0x1492('0x3e')]);_0xd6257f[_0x1492('0x3f')]=qs['filters'](_[_0x1492('0x41')](_0x1834ca[_0x1492('0x35')],_0x2d0d1f['filters']));if(_0x1834ca['query'][_0x1492('0x42')]){_0xd6257f[_0x1492('0x3f')]=_[_0x1492('0x43')](_0xd6257f[_0x1492('0x3f')],{'$or':_[_0x1492('0x30')](_0xd6257f[_0x1492('0x39')],function(_0x13ffae){var _0x3e1209={};_0x3e1209[_0x13ffae]={'$like':'%'+_0x1834ca['query']['filter']+'%'};return _0x3e1209;})});}_0xd6257f=_['merge']({},_0xd6257f,_0x1834ca[_0x1492('0x4a')]);return _0x36ce43[_0x1492('0x9d')](_0xd6257f);}})['then'](function(_0x3e2c1b){if(_0x3e2c1b){_0x2b9f51=_0x3e2c1b['length'];if(!_0x1834ca['query'][_0x1492('0x3b')]('nolimit')){_0xd6257f[_0x1492('0x20')]=qs['limit'](_0x1834ca[_0x1492('0x35')][_0x1492('0x20')]);_0xd6257f[_0x1492('0x1e')]=qs['offset'](_0x1834ca[_0x1492('0x35')][_0x1492('0x1e')]);}return _0x36ce43['getAgents'](_0xd6257f);}})[_0x1492('0x28')](function(_0x3f984f){if(_0x3f984f){return _0x3f984f?{'count':_0x2b9f51,'rows':_0x3f984f}:null;}})[_0x1492('0x28')](respondWithResult(_0x47773c,null))[_0x1492('0x4c')](handleError(_0x47773c,null));};function handleQuery(_0x187cf7){logger[_0x1492('0x9f')](_0x187cf7);return db[_0x1492('0x90')][_0x1492('0x35')](_0x187cf7)[_0x1492('0x98')](function(_0x108f79){csv_results['push'](_0x108f79);})['catch'](function(_0x19e9a0){logger[_0x1492('0x2d')](_0x19e9a0['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 2d4f20e..57a3bc8 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x45c96f,_0x2ade75){var _0x3008d2=function(_0x125d19){while(--_0x125d19){_0x45c96f['push'](_0x45c96f['shift']());}};_0x3008d2(++_0x2ade75);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x5fc3,0xa8));var _0x35fc=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x5fc3[_0x211fef];return _0x5447bf;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ff36d76..cc5befd 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 _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x2030f1,_0x23a046){var _0x2ba655=function(_0xe78e97){while(--_0xe78e97){_0x2030f1['push'](_0x2030f1['shift']());}};_0x2ba655(++_0x23a046);}(_0xbec5,0xe5));var _0x5bec=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xbec5[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x4173af,_0x1b4ac1){var _0x2e8877=function(_0x4c6b98){while(--_0x4c6b98){_0x4173af['push'](_0x4173af['shift']());}};_0x2e8877(++_0x1b4ac1);}(_0x2dae,0xc3));var _0xe2da=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x2dae[_0x2f5a22];return _0x326b70;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'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 60ff483..8a27129 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 _0xc5a0=['rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','info','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ed31e,_0x48f63d){var _0x2a9de5=function(_0x2f7286){while(--_0x2f7286){_0x1ed31e['push'](_0x1ed31e['shift']());}};_0x2a9de5(++_0x48f63d);}(_0xc5a0,0xf3));var _0x0c5a=function(_0x199389,_0x1b8d82){_0x199389=_0x199389-0x0;var _0x434995=_0xc5a0[_0x199389];return _0x434995;};'use strict';var _=require(_0x0c5a('0x0'));var util=require(_0x0c5a('0x1'));var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var rs=require(_0x0c5a('0x4'));var fs=require('fs');var Redis=require(_0x0c5a('0x5'));var db=require(_0x0c5a('0x6'))['db'];var utils=require(_0x0c5a('0x7'));var logger=require(_0x0c5a('0x8'))(_0x0c5a('0x9'));var config=require(_0x0c5a('0xa'));var jayson=require(_0x0c5a('0xb'));var client=jayson['client'][_0x0c5a('0xc')]({'port':0x232a});config[_0x0c5a('0xd')]=_['defaults'](config[_0x0c5a('0xd')],{'host':_0x0c5a('0xe'),'port':0x18eb});var socket=require(_0x0c5a('0xf'))(new Redis(config[_0x0c5a('0xd')]));require('./cmList.socket')[_0x0c5a('0x10')](socket);function respondWithRpcPromise(_0x233376,_0x4c4237,_0x146598){return new BPromise(function(_0x1283a8,_0x4db63f){return client[_0x0c5a('0x11')](_0x233376,_0x146598)['then'](function(_0x4c9c5b){logger[_0x0c5a('0x12')]('CmList,\x20%s,\x20%s',_0x4c4237,'request\x20sent');logger[_0x0c5a('0x13')](_0x0c5a('0x14'),_0x4c4237,_0x0c5a('0x15'),JSON['stringify'](_0x4c9c5b));if(_0x4c9c5b[_0x0c5a('0x16')]){if(_0x4c9c5b[_0x0c5a('0x16')][_0x0c5a('0x17')]===0x1f4){logger[_0x0c5a('0x16')](_0x0c5a('0x18'),_0x4c4237,_0x4c9c5b['error'][_0x0c5a('0x19')]);return _0x4db63f(_0x4c9c5b[_0x0c5a('0x16')][_0x0c5a('0x19')]);}logger[_0x0c5a('0x16')](_0x0c5a('0x18'),_0x4c4237,_0x4c9c5b[_0x0c5a('0x16')]['message']);return _0x1283a8(_0x4c9c5b[_0x0c5a('0x16')]['message']);}else{logger[_0x0c5a('0x12')]('CmList,\x20%s,\x20%s',_0x4c4237,_0x0c5a('0x15'));_0x1283a8(_0x4c9c5b[_0x0c5a('0x1a')]['message']);}})[_0x0c5a('0x1b')](function(_0x59cab5){logger[_0x0c5a('0x16')](_0x0c5a('0x18'),_0x4c4237,_0x59cab5);_0x4db63f(_0x59cab5);});});} \ No newline at end of file +var _0x4606=['error','code','message','info','result','lodash','moment','bluebird','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4606,0x147));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6460('0x0'));var util=require('util');var moment=require(_0x6460('0x1'));var BPromise=require(_0x6460('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6460('0x3'));var config=require(_0x6460('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x6460('0x5')][_0x6460('0x6')]({'port':0x232a});config[_0x6460('0x7')]=_['defaults'](config[_0x6460('0x7')],{'host':_0x6460('0x8'),'port':0x18eb});var socket=require(_0x6460('0x9'))(new Redis(config[_0x6460('0x7')]));require(_0x6460('0xa'))[_0x6460('0xb')](socket);function respondWithRpcPromise(_0x1f8389,_0x59e7f5,_0x9fa379){return new BPromise(function(_0x5e3035,_0x111e43){return client['request'](_0x1f8389,_0x9fa379)[_0x6460('0xc')](function(_0x5455d5){logger['info'](_0x6460('0xd'),_0x59e7f5,_0x6460('0xe'));logger[_0x6460('0xf')](_0x6460('0x10'),_0x59e7f5,'request\x20sent',JSON[_0x6460('0x11')](_0x5455d5));if(_0x5455d5['error']){if(_0x5455d5[_0x6460('0x12')][_0x6460('0x13')]===0x1f4){logger['error'](_0x6460('0xd'),_0x59e7f5,_0x5455d5[_0x6460('0x12')]['message']);return _0x111e43(_0x5455d5[_0x6460('0x12')][_0x6460('0x14')]);}logger[_0x6460('0x12')]('CmList,\x20%s,\x20%s',_0x59e7f5,_0x5455d5[_0x6460('0x12')][_0x6460('0x14')]);return _0x5e3035(_0x5455d5[_0x6460('0x12')][_0x6460('0x14')]);}else{logger[_0x6460('0x15')]('CmList,\x20%s,\x20%s',_0x59e7f5,'request\x20sent');_0x5e3035(_0x5455d5[_0x6460('0x16')][_0x6460('0x14')]);}})['catch'](function(_0x36eae8){logger[_0x6460('0x12')](_0x6460('0xd'),_0x59e7f5,_0x36eae8);_0x111e43(_0x36eae8);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 2234aae..a47b8bb 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 _0xd062=['emit','removeListener','register','length','cmList:','./cmList.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd062,0x1eb));var _0x2d06=function(_0x176393,_0x406e62){_0x176393=_0x176393-0x0;var _0x485487=_0xd062[_0x176393];return _0x485487;};'use strict';var CmListEvents=require(_0x2d06('0x0'));var events=[_0x2d06('0x1'),_0x2d06('0x2'),_0x2d06('0x3')];function createListener(_0x2c695e,_0x3970aa){return function(_0x23e3b4){_0x3970aa[_0x2d06('0x4')](_0x2c695e,_0x23e3b4);};}function removeListener(_0x2f174a,_0x562fec){return function(){CmListEvents[_0x2d06('0x5')](_0x2f174a,_0x562fec);};}exports[_0x2d06('0x6')]=function(_0xf0b48){for(var _0x531dc7=0x0,_0x31696d=events[_0x2d06('0x7')];_0x531dc7<_0x31696d;_0x531dc7++){var _0x3cb097=events[_0x531dc7];var _0x1f9277=createListener(_0x2d06('0x8')+_0x3cb097,_0xf0b48);CmListEvents['on'](_0x3cb097,_0x1f9277);}}; \ No newline at end of file +var _0x9e56=['update','removeListener','length','./cmList.events','remove'];(function(_0x27a8d4,_0x103ae6){var _0x5ec88e=function(_0x5e0acf){while(--_0x5e0acf){_0x27a8d4['push'](_0x27a8d4['shift']());}};_0x5ec88e(++_0x103ae6);}(_0x9e56,0x1cf));var _0x69e5=function(_0x5aff19,_0x1b2577){_0x5aff19=_0x5aff19-0x0;var _0x30d5ff=_0x9e56[_0x5aff19];return _0x30d5ff;};'use strict';var CmListEvents=require(_0x69e5('0x0'));var events=['save',_0x69e5('0x1'),_0x69e5('0x2')];function createListener(_0x51be2a,_0x1342ad){return function(_0x2270c7){_0x1342ad['emit'](_0x51be2a,_0x2270c7);};}function removeListener(_0x75932a,_0x50cd47){return function(){CmListEvents[_0x69e5('0x3')](_0x75932a,_0x50cd47);};}exports['register']=function(_0xd6cb26){for(var _0x5b6c21=0x0,_0x4102ce=events[_0x69e5('0x4')];_0x5b6c21<_0x4102ce;_0x5b6c21++){var _0x11b370=events[_0x5b6c21];var _0x57cb9e=createListener('cmList:'+_0x11b370,_0xd6cb26);CmListEvents['on'](_0x11b370,_0x57cb9e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 7556a96..a4ea29d 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 _0x8c58=['/:id/users','post','create','addContacts','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields'];(function(_0x20423f,_0x725d21){var _0x54d41f=function(_0x393df8){while(--_0x393df8){_0x20423f['push'](_0x20423f['shift']());}};_0x54d41f(++_0x725d21);}(_0x8c58,0xba));var _0x88c5=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x8c58[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0x88c5('0x0'));var util=require(_0x88c5('0x1'));var path=require('path');var timeout=require(_0x88c5('0x2'));var express=require(_0x88c5('0x3'));var router=express[_0x88c5('0x4')]();var fs_extra=require(_0x88c5('0x5'));var auth=require(_0x88c5('0x6'));var interaction=require(_0x88c5('0x7'));var config=require(_0x88c5('0x8'));var controller=require(_0x88c5('0x9'));router[_0x88c5('0xa')]('/',auth[_0x88c5('0xb')](),controller[_0x88c5('0xc')]);router[_0x88c5('0xa')](_0x88c5('0xd'),auth[_0x88c5('0xb')](),controller['describe']);router['get'](_0x88c5('0xe'),auth[_0x88c5('0xb')](),controller[_0x88c5('0xf')]);router['get'](_0x88c5('0x10'),auth[_0x88c5('0xb')](),controller['show']);router[_0x88c5('0xa')](_0x88c5('0x11'),auth[_0x88c5('0xb')](),controller[_0x88c5('0x12')]);router['get'](_0x88c5('0x13'),auth[_0x88c5('0xb')](),controller['getContacts']);router[_0x88c5('0xa')](_0x88c5('0x14'),auth[_0x88c5('0xb')](),controller[_0x88c5('0x15')]);router[_0x88c5('0xa')](_0x88c5('0x16'),auth['isAuthenticated'](),controller[_0x88c5('0x17')]);router[_0x88c5('0xa')](_0x88c5('0x18'),auth[_0x88c5('0xb')](),controller['getAgents']);router[_0x88c5('0x19')]('/',auth[_0x88c5('0xb')](),controller[_0x88c5('0x1a')]);router[_0x88c5('0x19')](_0x88c5('0x11'),auth[_0x88c5('0xb')](),controller['addDisposition']);router[_0x88c5('0x19')](_0x88c5('0x13'),auth[_0x88c5('0xb')](),controller[_0x88c5('0x1b')]);router[_0x88c5('0x19')](_0x88c5('0x16'),auth[_0x88c5('0xb')](),controller['addCustomField']);router[_0x88c5('0x19')](_0x88c5('0x18'),auth[_0x88c5('0xb')](),controller[_0x88c5('0x1c')]);router[_0x88c5('0x1d')](_0x88c5('0x10'),auth[_0x88c5('0xb')](),controller['update']);router[_0x88c5('0x1e')]('/:id',auth[_0x88c5('0xb')](),controller[_0x88c5('0x1f')]);router[_0x88c5('0x1e')](_0x88c5('0x11'),auth[_0x88c5('0xb')](),controller[_0x88c5('0x20')]);router[_0x88c5('0x1e')](_0x88c5('0x18'),auth[_0x88c5('0xb')](),controller[_0x88c5('0x21')]);module[_0x88c5('0x22')]=router; \ No newline at end of file +var _0xaced=['/:id/fields','getCustomFields','post','create','addDisposition','addCustomField','/:id/users','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv'];(function(_0x3bdd18,_0x2f1af8){var _0x2f9fd2=function(_0xb65006){while(--_0xb65006){_0x3bdd18['push'](_0x3bdd18['shift']());}};_0x2f9fd2(++_0x2f1af8);}(_0xaced,0x18c));var _0xdace=function(_0x1575e2,_0x2051db){_0x1575e2=_0x1575e2-0x0;var _0x2c1792=_0xaced[_0x1575e2];return _0x2c1792;};'use strict';var multer=require(_0xdace('0x0'));var util=require(_0xdace('0x1'));var path=require(_0xdace('0x2'));var timeout=require(_0xdace('0x3'));var express=require(_0xdace('0x4'));var router=express['Router']();var fs_extra=require(_0xdace('0x5'));var auth=require(_0xdace('0x6'));var interaction=require(_0xdace('0x7'));var config=require(_0xdace('0x8'));var controller=require('./cmList.controller');router[_0xdace('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdace('0x9')](_0xdace('0xa'),auth[_0xdace('0xb')](),controller[_0xdace('0xc')]);router['get']('/global_fields',auth[_0xdace('0xb')](),controller[_0xdace('0xd')]);router[_0xdace('0x9')](_0xdace('0xe'),auth['isAuthenticated'](),controller[_0xdace('0xf')]);router[_0xdace('0x9')](_0xdace('0x10'),auth[_0xdace('0xb')](),controller['getDispositions']);router[_0xdace('0x9')](_0xdace('0x11'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0xdace('0x12'),auth['isAuthenticated'](),controller[_0xdace('0x13')]);router[_0xdace('0x9')](_0xdace('0x14'),auth[_0xdace('0xb')](),controller[_0xdace('0x15')]);router[_0xdace('0x9')]('/:id/users',auth[_0xdace('0xb')](),controller['getAgents']);router[_0xdace('0x16')]('/',auth[_0xdace('0xb')](),controller[_0xdace('0x17')]);router[_0xdace('0x16')](_0xdace('0x10'),auth[_0xdace('0xb')](),controller[_0xdace('0x18')]);router[_0xdace('0x16')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0xdace('0x16')]('/:id/fields',auth[_0xdace('0xb')](),controller[_0xdace('0x19')]);router[_0xdace('0x16')](_0xdace('0x1a'),auth[_0xdace('0xb')](),controller['addAgents']);router['put'](_0xdace('0xe'),auth[_0xdace('0xb')](),controller[_0xdace('0x1b')]);router[_0xdace('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xdace('0x1d')]);router[_0xdace('0x1c')](_0xdace('0x10'),auth[_0xdace('0xb')](),controller[_0xdace('0x1e')]);router['delete']('/:id/users',auth[_0xdace('0xb')](),controller['removeAgents']);module[_0xdace('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 8d79c7a..d588dd6 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 _0xba06=['field','STRING','sequelize','getDataValue'];(function(_0x3e1ed1,_0x4506fa){var _0xc192f0=function(_0x14e666){while(--_0x14e666){_0x3e1ed1['push'](_0x3e1ed1['shift']());}};_0xc192f0(++_0x4506fa);}(_0xba06,0x18e));var _0x6ba0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xba06[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6ba0('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x58ddfa){return this[_0x6ba0('0x1')](_0x6ba0('0x2'));}},'field':{'type':Sequelize[_0x6ba0('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x6ba0('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x6ba0('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x4806=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x15c9a6,_0x5c9d18){var _0x3c13ec=function(_0x1f1be8){while(--_0x1f1be8){_0x15c9a6['push'](_0x15c9a6['shift']());}};_0x3c13ec(++_0x5c9d18);}(_0x4806,0x8c));var _0x6480=function(_0x43f8a4,_0x2c3833){_0x43f8a4=_0x43f8a4-0x0;var _0x2276b6=_0x4806[_0x43f8a4];return _0x2276b6;};'use strict';var Sequelize=require(_0x6480('0x0'));module[_0x6480('0x1')]={'name':{'type':Sequelize[_0x6480('0x2')],'get':function(_0x9293ab){return this[_0x6480('0x3')](_0x6480('0x4'));}},'field':{'type':Sequelize[_0x6480('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x6480('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0733761..8ed77fd 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(_0xdea1f0,_0x41cbad){var _0x1974b8=function(_0x56fb9f){while(--_0x56fb9f){_0xdea1f0['push'](_0xdea1f0['shift']());}};_0x1974b8(++_0x41cbad);}(_0x7a54,0x106));var _0x47a5=function(_0x28a4c2,_0xd17875){_0x28a4c2=_0x28a4c2-0x0;var _0x37fc18=_0x7a54[_0x28a4c2];return _0x37fc18;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x529c53,_0x4d2991){var _0x53261f=function(_0xea3eda){while(--_0xea3eda){_0x529c53['push'](_0x529c53['shift']());}};_0x53261f(++_0x4d2991);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index e6544bb..3f31872 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 _0x232a=['lodash','util','../../config/logger','api','moment','rimraf','./condition.attributes','exports','tools_conditions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x232a,0xcf));var _0xa232=function(_0x12239a,_0x20ad16){_0x12239a=_0x12239a-0x0;var _0x4c63a2=_0x232a[_0x12239a];return _0x4c63a2;};'use strict';var _=require(_0xa232('0x0'));var util=require(_0xa232('0x1'));var logger=require(_0xa232('0x2'))(_0xa232('0x3'));var moment=require(_0xa232('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa232('0x5'));var config=require('../../config/environment');var attributes=require(_0xa232('0x6'));module[_0xa232('0x7')]=function(_0x1612d5,_0x1a5e9d){return _0x1612d5['define']('Condition',attributes,{'tableName':_0xa232('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d3a=['../../config/environment','define','tools_conditions','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x54234a,_0x423799){var _0x491f17=function(_0x3064d4){while(--_0x3064d4){_0x54234a['push'](_0x54234a['shift']());}};_0x491f17(++_0x423799);}(_0x1d3a,0xc1));var _0xa1d3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x1d3a[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xa1d3('0x0'));var util=require(_0xa1d3('0x1'));var logger=require('../../config/logger')(_0xa1d3('0x2'));var moment=require(_0xa1d3('0x3'));var BPromise=require(_0xa1d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1d3('0x5'));var rimraf=require(_0xa1d3('0x6'));var config=require(_0xa1d3('0x7'));var attributes=require('./condition.attributes');module['exports']=function(_0x5b7870,_0x253df5){return _0x5b7870[_0xa1d3('0x8')]('Condition',attributes,{'tableName':_0xa1d3('0x9'),'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 25b9ad7..3062e76 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 _0x82cc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x82cc,0x1f4));var _0xc82c=function(_0x3a7a01,_0x44a9f2){_0x3a7a01=_0x3a7a01-0x0;var _0x520dde=_0x82cc[_0x3a7a01];return _0x520dde;};'use strict';var _=require(_0xc82c('0x0'));var util=require(_0xc82c('0x1'));var moment=require(_0xc82c('0x2'));var BPromise=require(_0xc82c('0x3'));var rs=require(_0xc82c('0x4'));var fs=require('fs');var Redis=require(_0xc82c('0x5'));var db=require(_0xc82c('0x6'))['db'];var utils=require(_0xc82c('0x7'));var logger=require(_0xc82c('0x8'))('rpc');var config=require(_0xc82c('0x9'));var jayson=require(_0xc82c('0xa'));var client=jayson['client'][_0xc82c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x137f5b,_0xb503dc,_0x38e71d){return new BPromise(function(_0x5cd36d,_0x2a3a3){return client[_0xc82c('0xc')](_0x137f5b,_0x38e71d)['then'](function(_0x526ef9){logger['info'](_0xc82c('0xd'),_0xb503dc,'request\x20sent');logger[_0xc82c('0xe')](_0xc82c('0xf'),_0xb503dc,_0xc82c('0x10'),JSON[_0xc82c('0x11')](_0x526ef9));if(_0x526ef9[_0xc82c('0x12')]){if(_0x526ef9['error'][_0xc82c('0x13')]===0x1f4){logger[_0xc82c('0x12')](_0xc82c('0xd'),_0xb503dc,_0x526ef9[_0xc82c('0x12')][_0xc82c('0x14')]);return _0x2a3a3(_0x526ef9['error']['message']);}logger[_0xc82c('0x12')]('Condition,\x20%s,\x20%s',_0xb503dc,_0x526ef9[_0xc82c('0x12')]['message']);return _0x5cd36d(_0x526ef9[_0xc82c('0x12')][_0xc82c('0x14')]);}else{logger[_0xc82c('0x15')](_0xc82c('0xd'),_0xb503dc,_0xc82c('0x10'));_0x5cd36d(_0x526ef9[_0xc82c('0x16')][_0xc82c('0x14')]);}})[_0xc82c('0x17')](function(_0x448d00){logger[_0xc82c('0x12')](_0xc82c('0xd'),_0xb503dc,_0x448d00);_0x2a3a3(_0x448d00);});});} \ No newline at end of file +var _0xe3f4=['rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x564c90,_0x1609d5){var _0x1fa23d=function(_0x3dfca3){while(--_0x3dfca3){_0x564c90['push'](_0x564c90['shift']());}};_0x1fa23d(++_0x1609d5);}(_0xe3f4,0x101));var _0x4e3f=function(_0x392c21,_0x37e85b){_0x392c21=_0x392c21-0x0;var _0x22b1d9=_0xe3f4[_0x392c21];return _0x22b1d9;};'use strict';var _=require(_0x4e3f('0x0'));var util=require(_0x4e3f('0x1'));var moment=require('moment');var BPromise=require(_0x4e3f('0x2'));var rs=require(_0x4e3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e3f('0x4'))['db'];var utils=require(_0x4e3f('0x5'));var logger=require(_0x4e3f('0x6'))(_0x4e3f('0x7'));var config=require(_0x4e3f('0x8'));var jayson=require(_0x4e3f('0x9'));var client=jayson[_0x4e3f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30459e,_0x1bf57f,_0x2bb3ae){return new BPromise(function(_0x363611,_0x286d0a){return client[_0x4e3f('0xb')](_0x30459e,_0x2bb3ae)[_0x4e3f('0xc')](function(_0x5e25c8){logger[_0x4e3f('0xd')]('Condition,\x20%s,\x20%s',_0x1bf57f,'request\x20sent');logger[_0x4e3f('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x1bf57f,_0x4e3f('0xf'),JSON[_0x4e3f('0x10')](_0x5e25c8));if(_0x5e25c8['error']){if(_0x5e25c8[_0x4e3f('0x11')]['code']===0x1f4){logger[_0x4e3f('0x11')](_0x4e3f('0x12'),_0x1bf57f,_0x5e25c8['error'][_0x4e3f('0x13')]);return _0x286d0a(_0x5e25c8[_0x4e3f('0x11')]['message']);}logger[_0x4e3f('0x11')](_0x4e3f('0x12'),_0x1bf57f,_0x5e25c8[_0x4e3f('0x11')][_0x4e3f('0x13')]);return _0x363611(_0x5e25c8[_0x4e3f('0x11')]['message']);}else{logger[_0x4e3f('0xd')](_0x4e3f('0x12'),_0x1bf57f,'request\x20sent');_0x363611(_0x5e25c8[_0x4e3f('0x14')][_0x4e3f('0x13')]);}})[_0x4e3f('0x15')](function(_0x2e6e06){logger['error'](_0x4e3f('0x12'),_0x1bf57f,_0x2e6e06);_0x286d0a(_0x2e6e06);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 588394f..7937fe6 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 _0x8bea=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','delete','isAuthenticated','exports','multer','util'];(function(_0x39676c,_0x10239b){var _0x2a362d=function(_0x31a80b){while(--_0x31a80b){_0x39676c['push'](_0x39676c['shift']());}};_0x2a362d(++_0x10239b);}(_0x8bea,0xa6));var _0xa8be=function(_0x57beaf,_0x165fb5){_0x57beaf=_0x57beaf-0x0;var _0x1f23c6=_0x8bea[_0x57beaf];return _0x1f23c6;};'use strict';var multer=require(_0xa8be('0x0'));var util=require(_0xa8be('0x1'));var path=require(_0xa8be('0x2'));var timeout=require(_0xa8be('0x3'));var express=require(_0xa8be('0x4'));var router=express[_0xa8be('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa8be('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa8be('0x7'));var controller=require(_0xa8be('0x8'));router[_0xa8be('0x9')](_0xa8be('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xa8be('0xb')](_0xa8be('0xa'),auth[_0xa8be('0xc')](),controller['destroy']);module[_0xa8be('0xd')]=router; \ No newline at end of file +var _0xe402=['delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','isAuthenticated','update'];(function(_0x29632e,_0x5ecba4){var _0x426e04=function(_0x4eb357){while(--_0x4eb357){_0x29632e['push'](_0x29632e['shift']());}};_0x426e04(++_0x5ecba4);}(_0xe402,0x1c5));var _0x2e40=function(_0x152882,_0x8d5c5c){_0x152882=_0x152882-0x0;var _0x29b882=_0xe402[_0x152882];return _0x29b882;};'use strict';var multer=require(_0x2e40('0x0'));var util=require(_0x2e40('0x1'));var path=require(_0x2e40('0x2'));var timeout=require(_0x2e40('0x3'));var express=require(_0x2e40('0x4'));var router=express[_0x2e40('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2e40('0x6'));var interaction=require(_0x2e40('0x7'));var config=require('../../config/environment');var controller=require(_0x2e40('0x8'));router[_0x2e40('0x9')]('/:id',auth[_0x2e40('0xa')](),controller[_0x2e40('0xb')]);router[_0x2e40('0xc')](_0x2e40('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x2e40('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 58af926..b12ba8e 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cfd=['STRING','name','INTEGER','sequelize','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x8cfd[_0x2b8347];return _0x15e93e;};'use strict';var Sequelize=require(_0xd8cf('0x0'));module[_0xd8cf('0x1')]={'name':{'type':Sequelize[_0xd8cf('0x2')],'allowNull':![],'unique':_0xd8cf('0x3')},'OrderBy':{'type':Sequelize[_0xd8cf('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xd8cf('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa3f2=['STRING','name','INTEGER','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa3f2,0x73));var _0x2a3f=function(_0x3d68cb,_0x1de1e9){_0x3d68cb=_0x3d68cb-0x0;var _0x5b7a36=_0xa3f2[_0x3d68cb];return _0x5b7a36;};'use strict';var Sequelize=require(_0x2a3f('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a3f('0x1')],'allowNull':![],'unique':_0x2a3f('0x2')},'OrderBy':{'type':Sequelize[_0x2a3f('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x2a3f('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index c82c950..4448c72 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab40=['error','stack','name','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','ContactItemType','count','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','update','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','then','get','UserProfileResource','destroy'];(function(_0xbb7c69,_0x573d62){var _0x4ab8c5=function(_0x187d74){while(--_0x187d74){_0xbb7c69['push'](_0xbb7c69['shift']());}};_0x4ab8c5(++_0x573d62);}(_0xab40,0xcd));var _0x0ab4=function(_0x6fc49,_0x205a27){_0x6fc49=_0x6fc49-0x0;var _0x58e4aa=_0xab40[_0x6fc49];return _0x58e4aa;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249dc3,_0x45e6fd){_0x45e6fd=_0x45e6fd||0xcc;return function(_0x1e7555){if(_0x1e7555){return _0x249dc3[_0x0ab4('0x15')](_0x45e6fd);}return _0x249dc3[_0x0ab4('0x16')](_0x45e6fd)[_0x0ab4('0x17')]();};}function respondWithResult(_0x112162,_0x2cc644){_0x2cc644=_0x2cc644||0xc8;return function(_0x3cb1df){if(_0x3cb1df){return _0x112162[_0x0ab4('0x16')](_0x2cc644)[_0x0ab4('0x18')](_0x3cb1df);}};}function respondWithFilteredResult(_0x36d246,_0x293e20){return function(_0x45fad1){if(_0x45fad1){var _0x2a83a8=typeof _0x293e20[_0x0ab4('0x19')]===_0x0ab4('0x1a')&&typeof _0x293e20[_0x0ab4('0x1b')]==='undefined';var _0x5000d4=_0x45fad1['count'];var _0x17422f=_0x2a83a8?0x0:_0x293e20[_0x0ab4('0x19')];var _0x2f50d2=_0x2a83a8?_0x45fad1['count']:_0x293e20[_0x0ab4('0x19')]+_0x293e20[_0x0ab4('0x1b')];var _0x212ebd;if(_0x2f50d2>=_0x5000d4){_0x2f50d2=_0x5000d4;_0x212ebd=0xc8;}else{_0x212ebd=0xce;}_0x36d246[_0x0ab4('0x16')](_0x212ebd);return _0x36d246['set']('Content-Range',_0x17422f+'-'+_0x2f50d2+'/'+_0x5000d4)[_0x0ab4('0x18')](_0x45fad1);}return null;};}function patchUpdates(_0x5b1ed5){return function(_0x2b0e29){try{jsonpatch[_0x0ab4('0x1c')](_0x2b0e29,_0x5b1ed5,!![]);}catch(_0x5bb1d0){return BPromise[_0x0ab4('0x1d')](_0x5bb1d0);}return _0x2b0e29[_0x0ab4('0x1e')]();};}function saveUpdates(_0x2c55b3,_0x1d5c14){return function(_0x12d06d){if(_0x12d06d){return _0x12d06d['update'](_0x2c55b3)['then'](function(_0x24b929){return _0x24b929;});}return null;};}function removeEntity(_0x14087f,_0x392afe){return function(_0x13c882){if(_0x13c882){return _0x13c882['destroy']()[_0x0ab4('0x1f')](function(){var _0x3caa9d=_0x13c882[_0x0ab4('0x20')]({'plain':!![]});var _0x4ea9aa='ContactItemTypes';return db[_0x0ab4('0x21')][_0x0ab4('0x22')]({'where':{'type':_0x4ea9aa,'resourceId':_0x3caa9d['id']}})[_0x0ab4('0x1f')](function(){return _0x13c882;});})['then'](function(){_0x14087f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ecc6,_0x5ba3a2){return function(_0x3bf844){if(!_0x3bf844){_0x19ecc6[_0x0ab4('0x15')](0x194);}return _0x3bf844;};}function handleError(_0x4f1aeb,_0x4bd747){_0x4bd747=_0x4bd747||0x1f4;return function(_0x4d0cc1){logger[_0x0ab4('0x23')](_0x4d0cc1[_0x0ab4('0x24')]);if(_0x4d0cc1[_0x0ab4('0x25')]){delete _0x4d0cc1[_0x0ab4('0x25')];}_0x4f1aeb[_0x0ab4('0x16')](_0x4bd747)['send'](_0x4d0cc1);};}exports['index']=function(_0x580d56,_0x2e7a97){var _0x2b66d5={},_0x155d96={},_0x182bbe={'count':0x0,'rows':[]};var _0x46eda7=_['map'](db['ContactItemType'][_0x0ab4('0x26')],function(_0xe6682){return{'name':_0xe6682[_0x0ab4('0x27')],'type':_0xe6682['type']['key']};});_0x155d96[_0x0ab4('0x28')]=_['map'](_0x46eda7,_0x0ab4('0x25'));_0x155d96[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x580d56[_0x0ab4('0x29')]);_0x155d96[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x155d96['model'],_0x155d96[_0x0ab4('0x29')]);_0x2b66d5[_0x0ab4('0x2d')]=_[_0x0ab4('0x2c')](_0x155d96[_0x0ab4('0x28')],qs['fields'](_0x580d56['query'][_0x0ab4('0x2e')]));_0x2b66d5[_0x0ab4('0x2d')]=_0x2b66d5[_0x0ab4('0x2d')]['length']?_0x2b66d5['attributes']:_0x155d96['model'];if(!_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x2f')](_0x0ab4('0x30'))){_0x2b66d5['limit']=qs['limit'](_0x580d56['query'][_0x0ab4('0x1b')]);_0x2b66d5[_0x0ab4('0x19')]=qs[_0x0ab4('0x19')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x19')]);}_0x2b66d5[_0x0ab4('0x31')]=qs[_0x0ab4('0x32')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x2b66d5[_0x0ab4('0x33')]=qs['filters'](_[_0x0ab4('0x34')](_0x580d56[_0x0ab4('0x29')],_0x155d96[_0x0ab4('0x2b')]),_0x46eda7);if(_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]){_0x2b66d5[_0x0ab4('0x33')]=_[_0x0ab4('0x36')](_0x2b66d5[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x46eda7,function(_0x3774ca){if(_0x3774ca[_0x0ab4('0x38')]!==_0x0ab4('0x39')){var _0x4a05c4={};_0x4a05c4[_0x3774ca[_0x0ab4('0x25')]]={'$like':'%'+_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]+'%'};return _0x4a05c4;}})});}_0x2b66d5=_[_0x0ab4('0x36')]({},_0x2b66d5,_0x580d56['options']);var _0x42bece={'where':_0x2b66d5['where']};return db[_0x0ab4('0x3a')][_0x0ab4('0x3b')](_0x42bece)[_0x0ab4('0x1f')](function(_0x245021){_0x182bbe[_0x0ab4('0x3b')]=_0x245021;if(_0x580d56[_0x0ab4('0x29')]['includeAll']){_0x2b66d5[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3a')][_0x0ab4('0x3d')](_0x2b66d5);})['then'](function(_0x395e0b){_0x182bbe[_0x0ab4('0x3e')]=_0x395e0b;return _0x182bbe;})[_0x0ab4('0x1f')](respondWithFilteredResult(_0x2e7a97,_0x2b66d5))[_0x0ab4('0x3f')](handleError(_0x2e7a97,null));};exports[_0x0ab4('0x40')]=function(_0x5aa047,_0x5d70eb){var _0x498845={'raw':!![],'where':{'id':_0x5aa047[_0x0ab4('0x41')]['id']}},_0x2f54dd={};_0x2f54dd['model']=_[_0x0ab4('0x2a')](db['ContactItemType'][_0x0ab4('0x26')]);_0x2f54dd['query']=_[_0x0ab4('0x2a')](_0x5aa047[_0x0ab4('0x29')]);_0x2f54dd[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],_0x2f54dd[_0x0ab4('0x29')]);_0x498845['attributes']=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],qs[_0x0ab4('0x2e')](_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x498845[_0x0ab4('0x2d')]=_0x498845['attributes'][_0x0ab4('0x42')]?_0x498845['attributes']:_0x2f54dd[_0x0ab4('0x28')];if(_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x43')]){_0x498845['include']=[{'all':!![]}];}_0x498845=_[_0x0ab4('0x36')]({},_0x498845,_0x5aa047[_0x0ab4('0x44')]);return db[_0x0ab4('0x3a')][_0x0ab4('0x45')](_0x498845)[_0x0ab4('0x1f')](handleEntityNotFound(_0x5d70eb,null))[_0x0ab4('0x1f')](respondWithResult(_0x5d70eb,null))['catch'](handleError(_0x5d70eb,null));};exports[_0x0ab4('0x46')]=function(_0xdcc118,_0x302894){return db[_0x0ab4('0x3a')][_0x0ab4('0x46')](_0xdcc118[_0x0ab4('0x47')],{})[_0x0ab4('0x1f')](function(_0x356bc9){var _0x22402e=_0xdcc118[_0x0ab4('0x48')][_0x0ab4('0x20')]({'plain':!![]});if(!_0x22402e)throw new Error(_0x0ab4('0x49'));if(_0x22402e[_0x0ab4('0x4a')]==='user'){var _0x2c3a0a=_0x356bc9[_0x0ab4('0x20')]({'plain':!![]});var _0x5800cc=_0x0ab4('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x5800cc,'userProfileId':_0x22402e[_0x0ab4('0x4c')]},'raw':!![]})[_0x0ab4('0x1f')](function(_0x156e22){if(_0x156e22&&_0x156e22['autoAssociation']===0x0){return db[_0x0ab4('0x21')][_0x0ab4('0x46')]({'name':_0x2c3a0a[_0x0ab4('0x25')],'resourceId':_0x2c3a0a['id'],'type':_0x156e22[_0x0ab4('0x25')],'sectionId':_0x156e22['id']},{})[_0x0ab4('0x1f')](function(){return _0x356bc9;});}else{return _0x356bc9;}})[_0x0ab4('0x3f')](function(_0x1eea3b){logger['error'](_0x0ab4('0x4d'),_0x1eea3b);throw _0x1eea3b;});}return _0x356bc9;})['then'](respondWithResult(_0x302894,0xc9))[_0x0ab4('0x3f')](handleError(_0x302894,null));};exports['update']=function(_0x2597f2,_0x5550ff){if(_0x2597f2['body']['id']){delete _0x2597f2[_0x0ab4('0x47')]['id'];}return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2597f2[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5550ff,null))[_0x0ab4('0x1f')](saveUpdates(_0x2597f2[_0x0ab4('0x47')],null))[_0x0ab4('0x1f')](respondWithResult(_0x5550ff,null))[_0x0ab4('0x3f')](handleError(_0x5550ff,null));};exports[_0x0ab4('0x22')]=function(_0x2354fa,_0x134437){return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2354fa[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x1f')](handleEntityNotFound(_0x134437,null))[_0x0ab4('0x1f')](db[_0x0ab4('0x4e')][_0x0ab4('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2354fa[_0x0ab4('0x41')]['id']}}))[_0x0ab4('0x1f')](removeEntity(_0x134437,null))[_0x0ab4('0x3f')](handleError(_0x134437,null));}; \ No newline at end of file +var _0x6343=['status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','get','ContactItemTypes','UserProfileResource','then','error','name','send','map','ContactItemType','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x29edf2,_0x1a652a){var _0xbf04c0=function(_0x53a146){while(--_0x53a146){_0x29edf2['push'](_0x29edf2['shift']());}};_0xbf04c0(++_0x1a652a);}(_0x6343,0x168));var _0x3634=function(_0x49be95,_0x34fbe0){_0x49be95=_0x49be95-0x0;var _0x26b4c6=_0x6343[_0x49be95];return _0x26b4c6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){var _0x1b25be=_0x3a8c41[_0x3634('0x21')]({'plain':!![]});var _0x17db44=_0x3634('0x22');return db[_0x3634('0x23')][_0x3634('0x20')]({'where':{'type':_0x17db44,'resourceId':_0x1b25be['id']}})[_0x3634('0x24')](function(){return _0x3a8c41;});})[_0x3634('0x24')](function(){_0x596acb[_0x3634('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0a44,_0x552cc3){return function(_0x58841d){if(!_0x58841d){_0x1b0a44['sendStatus'](0x194);}return _0x58841d;};}function handleError(_0x7a35c4,_0x576977){_0x576977=_0x576977||0x1f4;return function(_0x3bf28b){logger[_0x3634('0x25')](_0x3bf28b['stack']);if(_0x3bf28b['name']){delete _0x3bf28b[_0x3634('0x26')];}_0x7a35c4['status'](_0x576977)[_0x3634('0x27')](_0x3bf28b);};}exports['index']=function(_0x1e04cc,_0x3d7322){var _0x1d88f7={},_0x17a0fd={},_0x1f46d9={'count':0x0,'rows':[]};var _0x20b062=_[_0x3634('0x28')](db[_0x3634('0x29')]['rawAttributes'],function(_0x535215){return{'name':_0x535215['fieldName'],'type':_0x535215[_0x3634('0x2a')]['key']};});_0x17a0fd[_0x3634('0x2b')]=_[_0x3634('0x28')](_0x20b062,_0x3634('0x26'));_0x17a0fd[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x1e04cc[_0x3634('0x2c')]);_0x17a0fd['filters']=_[_0x3634('0x2e')](_0x17a0fd[_0x3634('0x2b')],_0x17a0fd[_0x3634('0x2c')]);_0x1d88f7[_0x3634('0x2f')]=_[_0x3634('0x2e')](_0x17a0fd[_0x3634('0x2b')],qs[_0x3634('0x30')](_0x1e04cc[_0x3634('0x2c')][_0x3634('0x30')]));_0x1d88f7['attributes']=_0x1d88f7[_0x3634('0x2f')][_0x3634('0x31')]?_0x1d88f7[_0x3634('0x2f')]:_0x17a0fd[_0x3634('0x2b')];if(!_0x1e04cc['query'][_0x3634('0x32')](_0x3634('0x33'))){_0x1d88f7[_0x3634('0x18')]=qs['limit'](_0x1e04cc['query']['limit']);_0x1d88f7[_0x3634('0x16')]=qs[_0x3634('0x16')](_0x1e04cc['query'][_0x3634('0x16')]);}_0x1d88f7[_0x3634('0x34')]=qs[_0x3634('0x35')](_0x1e04cc[_0x3634('0x2c')][_0x3634('0x35')]);_0x1d88f7[_0x3634('0x36')]=qs[_0x3634('0x37')](_['pick'](_0x1e04cc[_0x3634('0x2c')],_0x17a0fd['filters']),_0x20b062);if(_0x1e04cc[_0x3634('0x2c')][_0x3634('0x38')]){_0x1d88f7[_0x3634('0x36')]=_[_0x3634('0x39')](_0x1d88f7[_0x3634('0x36')],{'$or':_['map'](_0x20b062,function(_0x10ff70){if(_0x10ff70[_0x3634('0x2a')]!==_0x3634('0x3a')){var _0x242a6c={};_0x242a6c[_0x10ff70[_0x3634('0x26')]]={'$like':'%'+_0x1e04cc[_0x3634('0x2c')][_0x3634('0x38')]+'%'};return _0x242a6c;}})});}_0x1d88f7=_[_0x3634('0x39')]({},_0x1d88f7,_0x1e04cc[_0x3634('0x3b')]);var _0x523555={'where':_0x1d88f7['where']};return db[_0x3634('0x29')]['count'](_0x523555)['then'](function(_0x5948db){_0x1f46d9[_0x3634('0x19')]=_0x5948db;if(_0x1e04cc['query'][_0x3634('0x3c')]){_0x1d88f7[_0x3634('0x3d')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x1d88f7);})['then'](function(_0x324970){_0x1f46d9[_0x3634('0x3e')]=_0x324970;return _0x1f46d9;})['then'](respondWithFilteredResult(_0x3d7322,_0x1d88f7))[_0x3634('0x3f')](handleError(_0x3d7322,null));};exports[_0x3634('0x40')]=function(_0x3ff2fb,_0x18ce5a){var _0x123a91={'raw':!![],'where':{'id':_0x3ff2fb['params']['id']}},_0x5f0711={};_0x5f0711[_0x3634('0x2b')]=_[_0x3634('0x2d')](db[_0x3634('0x29')][_0x3634('0x41')]);_0x5f0711[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x3ff2fb['query']);_0x5f0711[_0x3634('0x37')]=_[_0x3634('0x2e')](_0x5f0711[_0x3634('0x2b')],_0x5f0711['query']);_0x123a91['attributes']=_[_0x3634('0x2e')](_0x5f0711[_0x3634('0x2b')],qs[_0x3634('0x30')](_0x3ff2fb[_0x3634('0x2c')][_0x3634('0x30')]));_0x123a91[_0x3634('0x2f')]=_0x123a91[_0x3634('0x2f')][_0x3634('0x31')]?_0x123a91['attributes']:_0x5f0711[_0x3634('0x2b')];if(_0x3ff2fb[_0x3634('0x2c')][_0x3634('0x3c')]){_0x123a91[_0x3634('0x3d')]=[{'all':!![]}];}_0x123a91=_[_0x3634('0x39')]({},_0x123a91,_0x3ff2fb[_0x3634('0x3b')]);return db[_0x3634('0x29')][_0x3634('0x42')](_0x123a91)[_0x3634('0x24')](handleEntityNotFound(_0x18ce5a,null))['then'](respondWithResult(_0x18ce5a,null))[_0x3634('0x3f')](handleError(_0x18ce5a,null));};exports[_0x3634('0x43')]=function(_0x4a4a94,_0x3c356b){return db[_0x3634('0x29')][_0x3634('0x43')](_0x4a4a94[_0x3634('0x44')],{})[_0x3634('0x24')](function(_0x1ca58d){var _0x5cc8d1=_0x4a4a94[_0x3634('0x45')][_0x3634('0x21')]({'plain':!![]});if(!_0x5cc8d1)throw new Error(_0x3634('0x46'));if(_0x5cc8d1[_0x3634('0x47')]===_0x3634('0x45')){var _0x582475=_0x1ca58d[_0x3634('0x21')]({'plain':!![]});var _0x20f9f8='ContactItemTypes';return db['UserProfileSection'][_0x3634('0x42')]({'where':{'name':_0x20f9f8,'userProfileId':_0x5cc8d1['userProfileId']},'raw':!![]})[_0x3634('0x24')](function(_0x475b37){if(_0x475b37&&_0x475b37[_0x3634('0x48')]===0x0){return db[_0x3634('0x23')]['create']({'name':_0x582475[_0x3634('0x26')],'resourceId':_0x582475['id'],'type':_0x475b37[_0x3634('0x26')],'sectionId':_0x475b37['id']},{})[_0x3634('0x24')](function(){return _0x1ca58d;});}else{return _0x1ca58d;}})[_0x3634('0x3f')](function(_0x1ac9a9){logger[_0x3634('0x25')](_0x3634('0x49'),_0x1ac9a9);throw _0x1ac9a9;});}return _0x1ca58d;})[_0x3634('0x24')](respondWithResult(_0x3c356b,0xc9))[_0x3634('0x3f')](handleError(_0x3c356b,null));};exports[_0x3634('0x1f')]=function(_0xcedbb6,_0x4265eb){if(_0xcedbb6['body']['id']){delete _0xcedbb6[_0x3634('0x44')]['id'];}return db[_0x3634('0x29')][_0x3634('0x42')]({'where':{'id':_0xcedbb6[_0x3634('0x4a')]['id']}})[_0x3634('0x24')](handleEntityNotFound(_0x4265eb,null))[_0x3634('0x24')](saveUpdates(_0xcedbb6[_0x3634('0x44')],null))[_0x3634('0x24')](respondWithResult(_0x4265eb,null))[_0x3634('0x3f')](handleError(_0x4265eb,null));};exports['destroy']=function(_0x2bcb9e,_0x2ea4b0){return db['ContactItemType'][_0x3634('0x42')]({'where':{'id':_0x2bcb9e[_0x3634('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ea4b0,null))[_0x3634('0x24')](db[_0x3634('0x4b')][_0x3634('0x1f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2bcb9e['params']['id']}}))[_0x3634('0x24')](removeEntity(_0x2ea4b0,null))['catch'](handleError(_0x2ea4b0,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index a513690..257fb94 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfdd=['./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x11cb8b,_0x38057b){var _0xa67f01=function(_0x4d7ab0){while(--_0x4d7ab0){_0x11cb8b['push'](_0x11cb8b['shift']());}};_0xa67f01(++_0x38057b);}(_0xcfdd,0xe2));var _0xdcfd=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0xcfdd[_0x19d24c];return _0x2fae8d;};'use strict';var _=require('lodash');var util=require(_0xdcfd('0x0'));var logger=require(_0xdcfd('0x1'))(_0xdcfd('0x2'));var moment=require(_0xdcfd('0x3'));var BPromise=require(_0xdcfd('0x4'));var rp=require(_0xdcfd('0x5'));var fs=require('fs');var path=require(_0xdcfd('0x6'));var rimraf=require('rimraf');var config=require(_0xdcfd('0x7'));var attributes=require(_0xdcfd('0x8'));module[_0xdcfd('0x9')]=function(_0x4da1f2,_0x928da8){return _0x4da1f2[_0xdcfd('0xa')](_0xdcfd('0xb'),attributes,{'tableName':_0xdcfd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e35=['bluebird','request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4e35,0xe6));var _0x54e3=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x4e35[_0xf51c06];return _0x1d5420;};'use strict';var _=require(_0x54e3('0x0'));var util=require(_0x54e3('0x1'));var logger=require('../../config/logger')(_0x54e3('0x2'));var moment=require(_0x54e3('0x3'));var BPromise=require(_0x54e3('0x4'));var rp=require(_0x54e3('0x5'));var fs=require('fs');var path=require(_0x54e3('0x6'));var rimraf=require('rimraf');var config=require(_0x54e3('0x7'));var attributes=require(_0x54e3('0x8'));module[_0x54e3('0x9')]=function(_0x48587e,_0x52800c){return _0x48587e[_0x54e3('0xa')](_0x54e3('0xb'),attributes,{'tableName':_0x54e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 54895df..8aa563f 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdafa=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3568f7,_0x3f1eea){var _0x16e8e9=function(_0x276cfd){while(--_0x276cfd){_0x3568f7['push'](_0x3568f7['shift']());}};_0x16e8e9(++_0x3f1eea);}(_0xdafa,0x113));var _0xadaf=function(_0x2fe8aa,_0x580309){_0x2fe8aa=_0x2fe8aa-0x0;var _0x5e6c81=_0xdafa[_0x2fe8aa];return _0x5e6c81;};'use strict';var _=require('lodash');var util=require(_0xadaf('0x0'));var moment=require(_0xadaf('0x1'));var BPromise=require(_0xadaf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadaf('0x3'));var db=require(_0xadaf('0x4'))['db'];var utils=require(_0xadaf('0x5'));var logger=require(_0xadaf('0x6'))(_0xadaf('0x7'));var config=require(_0xadaf('0x8'));var jayson=require(_0xadaf('0x9'));var client=jayson[_0xadaf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x283994,_0x1bd19b,_0x2ac1e9){return new BPromise(function(_0x3f3b44,_0x171aad){return client[_0xadaf('0xb')](_0x283994,_0x2ac1e9)['then'](function(_0x420764){logger[_0xadaf('0xc')](_0xadaf('0xd'),_0x1bd19b,_0xadaf('0xe'));logger['debug'](_0xadaf('0xf'),_0x1bd19b,'request\x20sent',JSON[_0xadaf('0x10')](_0x420764));if(_0x420764[_0xadaf('0x11')]){if(_0x420764[_0xadaf('0x11')]['code']===0x1f4){logger[_0xadaf('0x11')](_0xadaf('0xd'),_0x1bd19b,_0x420764[_0xadaf('0x11')][_0xadaf('0x12')]);return _0x171aad(_0x420764[_0xadaf('0x11')][_0xadaf('0x12')]);}logger['error'](_0xadaf('0xd'),_0x1bd19b,_0x420764[_0xadaf('0x11')]['message']);return _0x3f3b44(_0x420764[_0xadaf('0x11')][_0xadaf('0x12')]);}else{logger[_0xadaf('0xc')]('ContactItemType,\x20%s,\x20%s',_0x1bd19b,_0xadaf('0xe'));_0x3f3b44(_0x420764[_0xadaf('0x13')]['message']);}})['catch'](function(_0x6c857b){logger[_0xadaf('0x11')](_0xadaf('0xd'),_0x1bd19b,_0x6c857b);_0x171aad(_0x6c857b);});});} \ No newline at end of file +var _0xa713=['debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x3914c5,_0x191de1){var _0x66f673=function(_0x44973c){while(--_0x44973c){_0x3914c5['push'](_0x3914c5['shift']());}};_0x66f673(++_0x191de1);}(_0xa713,0x7d));var _0x3a71=function(_0x4dddce,_0x2294df){_0x4dddce=_0x4dddce-0x0;var _0x4eee4a=_0xa713[_0x4dddce];return _0x4eee4a;};'use strict';var _=require(_0x3a71('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a71('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a71('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a71('0x3'))('rpc');var config=require(_0x3a71('0x4'));var jayson=require(_0x3a71('0x5'));var client=jayson['client'][_0x3a71('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x48b695,_0x435eaf,_0x8d742d){return new BPromise(function(_0x33ce27,_0x1f2fc3){return client[_0x3a71('0x7')](_0x48b695,_0x8d742d)['then'](function(_0x46a52b){logger[_0x3a71('0x8')](_0x3a71('0x9'),_0x435eaf,_0x3a71('0xa'));logger[_0x3a71('0xb')](_0x3a71('0xc'),_0x435eaf,'request\x20sent',JSON['stringify'](_0x46a52b));if(_0x46a52b[_0x3a71('0xd')]){if(_0x46a52b[_0x3a71('0xd')][_0x3a71('0xe')]===0x1f4){logger[_0x3a71('0xd')](_0x3a71('0x9'),_0x435eaf,_0x46a52b['error'][_0x3a71('0xf')]);return _0x1f2fc3(_0x46a52b[_0x3a71('0xd')]['message']);}logger['error'](_0x3a71('0x9'),_0x435eaf,_0x46a52b[_0x3a71('0xd')][_0x3a71('0xf')]);return _0x33ce27(_0x46a52b[_0x3a71('0xd')]['message']);}else{logger[_0x3a71('0x8')]('ContactItemType,\x20%s,\x20%s',_0x435eaf,_0x3a71('0xa'));_0x33ce27(_0x46a52b['result'][_0x3a71('0xf')]);}})[_0x3a71('0x10')](function(_0xb92be0){logger['error'](_0x3a71('0x9'),_0x435eaf,_0xb92be0);_0x1f2fc3(_0xb92be0);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 134586f..1b11066 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd2f=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x14b5d9,_0x3cd0a7){var _0x1a2cbb=function(_0x4122d4){while(--_0x4122d4){_0x14b5d9['push'](_0x14b5d9['shift']());}};_0x1a2cbb(++_0x3cd0a7);}(_0xbd2f,0x18c));var _0xfbd2=function(_0x205af5,_0x5e32fc){_0x205af5=_0x205af5-0x0;var _0x522b3b=_0xbd2f[_0x205af5];return _0x522b3b;};'use strict';var multer=require(_0xfbd2('0x0'));var util=require(_0xfbd2('0x1'));var path=require(_0xfbd2('0x2'));var timeout=require(_0xfbd2('0x3'));var express=require('express');var router=express[_0xfbd2('0x4')]();var fs_extra=require(_0xfbd2('0x5'));var auth=require(_0xfbd2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./contactItemType.controller');router[_0xfbd2('0x7')]('/',auth[_0xfbd2('0x8')](),controller[_0xfbd2('0x9')]);router[_0xfbd2('0x7')](_0xfbd2('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xfbd2('0x8')](),controller['create']);router[_0xfbd2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xfbd2('0xc')]);router[_0xfbd2('0xd')](_0xfbd2('0xa'),auth[_0xfbd2('0x8')](),controller[_0xfbd2('0xe')]);module[_0xfbd2('0xf')]=router; \ No newline at end of file +var _0x5f50=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','put','update','delete','/:id','exports'];(function(_0x2b4c00,_0x1b426b){var _0x4fc4e5=function(_0xef824e){while(--_0xef824e){_0x2b4c00['push'](_0x2b4c00['shift']());}};_0x4fc4e5(++_0x1b426b);}(_0x5f50,0x1b5));var _0x05f5=function(_0x58d14a,_0x2f15e6){_0x58d14a=_0x58d14a-0x0;var _0x5748ff=_0x5f50[_0x58d14a];return _0x5748ff;};'use strict';var multer=require('multer');var util=require(_0x05f5('0x0'));var path=require(_0x05f5('0x1'));var timeout=require(_0x05f5('0x2'));var express=require(_0x05f5('0x3'));var router=express[_0x05f5('0x4')]();var fs_extra=require(_0x05f5('0x5'));var auth=require(_0x05f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x05f5('0x7'));var controller=require(_0x05f5('0x8'));router[_0x05f5('0x9')]('/',auth[_0x05f5('0xa')](),controller['index']);router[_0x05f5('0x9')]('/:id',auth[_0x05f5('0xa')](),controller[_0x05f5('0xb')]);router[_0x05f5('0xc')]('/',auth['isAuthenticated'](),controller[_0x05f5('0xd')]);router[_0x05f5('0xe')]('/:id',auth[_0x05f5('0xa')](),controller[_0x05f5('0xf')]);router[_0x05f5('0x10')](_0x05f5('0x11'),auth[_0x05f5('0xa')](),controller['destroy']);module[_0x05f5('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index a962a6c..4a2836b 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 _0xb10b=['name','sequelize','STRING'];(function(_0x1bd4e7,_0x377488){var _0x33532c=function(_0x5069dd){while(--_0x5069dd){_0x1bd4e7['push'](_0x1bd4e7['shift']());}};_0x33532c(++_0x377488);}(_0xb10b,0x12a));var _0xbb10=function(_0x126a10,_0x7bde76){_0x126a10=_0x126a10-0x0;var _0x15a853=_0xb10b[_0x126a10];return _0x15a853;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x5c4ca2,_0x295fee){var _0x47c971=function(_0x12c38e){while(--_0x12c38e){_0x5c4ca2['push'](_0x5c4ca2['shift']());}};_0x47c971(++_0x295fee);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index d21717e..52af03d 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 _0x47fe=['moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','end','json','undefined','limit','count','offset','set','apply','reject','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','findAll','catch','intersection','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','autoAssociation','update','params','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order'];(function(_0x9d7f37,_0x56244d){var _0x495b74=function(_0x4e6b9e){while(--_0x4e6b9e){_0x9d7f37['push'](_0x9d7f37['shift']());}};_0x495b74(++_0x56244d);}(_0x47fe,0xfe));var _0xe47f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x47fe[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe47f('0x0'));var BPromise=require('bluebird');var Mustache=require(_0xe47f('0x1'));var util=require(_0xe47f('0x2'));var path=require('path');var sox=require(_0xe47f('0x3'));var csv=require(_0xe47f('0x4'));var ejs=require(_0xe47f('0x5'));var fs=require('fs');var fs_extra=require(_0xe47f('0x6'));var _=require('lodash');var squel=require(_0xe47f('0x7'));var crypto=require('crypto');var jsforce=require(_0xe47f('0x8'));var deskjs=require(_0xe47f('0x9'));var toCsv=require('to-csv');var querystring=require(_0xe47f('0xa'));var Papa=require(_0xe47f('0xb'));var Redis=require(_0xe47f('0xc'));var authService=require(_0xe47f('0xd'));var qs=require(_0xe47f('0xe'));var as=require(_0xe47f('0xf'));var hardwareService=require(_0xe47f('0x10'));var logger=require(_0xe47f('0x11'))(_0xe47f('0x12'));var utils=require('../../config/utils');var config=require(_0xe47f('0x13'));var licenseUtil=require(_0xe47f('0x14'));var db=require('../../mysqldb')['db'];config[_0xe47f('0x15')]=_[_0xe47f('0x16')](config[_0xe47f('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xe47f('0x17'))(new Redis(config[_0xe47f('0x15')]));require(_0xe47f('0x18'))[_0xe47f('0x19')](socket);function respondWithStatusCode(_0x520e40,_0xf48a0a){_0xf48a0a=_0xf48a0a||0xcc;return function(_0x184a9a){if(_0x184a9a){return _0x520e40['sendStatus'](_0xf48a0a);}return _0x520e40[_0xe47f('0x1a')](_0xf48a0a)[_0xe47f('0x1b')]();};}function respondWithResult(_0x130fc6,_0x1f490d){_0x1f490d=_0x1f490d||0xc8;return function(_0x3802aa){if(_0x3802aa){return _0x130fc6[_0xe47f('0x1a')](_0x1f490d)[_0xe47f('0x1c')](_0x3802aa);}};}function respondWithFilteredResult(_0x370253,_0x1b299d){return function(_0x4abb81){if(_0x4abb81){var _0x6221da=typeof _0x1b299d['offset']===_0xe47f('0x1d')&&typeof _0x1b299d[_0xe47f('0x1e')]===_0xe47f('0x1d');var _0x40ccab=_0x4abb81[_0xe47f('0x1f')];var _0x3bbf8d=_0x6221da?0x0:_0x1b299d[_0xe47f('0x20')];var _0x4a2055=_0x6221da?_0x4abb81[_0xe47f('0x1f')]:_0x1b299d[_0xe47f('0x20')]+_0x1b299d['limit'];var _0x524a06;if(_0x4a2055>=_0x40ccab){_0x4a2055=_0x40ccab;_0x524a06=0xc8;}else{_0x524a06=0xce;}_0x370253[_0xe47f('0x1a')](_0x524a06);return _0x370253[_0xe47f('0x21')]('Content-Range',_0x3bbf8d+'-'+_0x4a2055+'/'+_0x40ccab)[_0xe47f('0x1c')](_0x4abb81);}return null;};}function patchUpdates(_0xe95af3){return function(_0x90789c){try{jsonpatch[_0xe47f('0x22')](_0x90789c,_0xe95af3,!![]);}catch(_0x2e909c){return BPromise[_0xe47f('0x23')](_0x2e909c);}return _0x90789c['save']();};}function saveUpdates(_0x896138,_0x51c12b){return function(_0x344902){if(_0x344902){return _0x344902['update'](_0x896138)[_0xe47f('0x24')](function(_0x5b6ba4){return _0x5b6ba4;});}return null;};}function removeEntity(_0x29d9ad,_0x217c3b){return function(_0x6e7f98){if(_0x6e7f98){return _0x6e7f98[_0xe47f('0x25')]()['then'](function(){var _0x40e8ce=_0x6e7f98[_0xe47f('0x26')]({'plain':!![]});var _0x45ad4d='CustomDashboards';return db[_0xe47f('0x27')]['destroy']({'where':{'type':_0x45ad4d,'resourceId':_0x40e8ce['id']}})[_0xe47f('0x24')](function(){return _0x6e7f98;});})[_0xe47f('0x24')](function(){_0x29d9ad[_0xe47f('0x1a')](0xcc)[_0xe47f('0x1b')]();});}};}function handleEntityNotFound(_0x2c3b97,_0x558917){return function(_0xa0572f){if(!_0xa0572f){_0x2c3b97[_0xe47f('0x28')](0x194);}return _0xa0572f;};}function handleError(_0x368b49,_0xb06e97){_0xb06e97=_0xb06e97||0x1f4;return function(_0x1e542b){logger[_0xe47f('0x29')](_0x1e542b[_0xe47f('0x2a')]);if(_0x1e542b[_0xe47f('0x2b')]){delete _0x1e542b[_0xe47f('0x2b')];}_0x368b49[_0xe47f('0x1a')](_0xb06e97)[_0xe47f('0x2c')](_0x1e542b);};}exports[_0xe47f('0x2d')]=function(_0x342021,_0x577cd8){var _0x2da096={},_0x5f4022={},_0xb699e4={'count':0x0,'rows':[]};var _0x27d8e6=_['map'](db['Dashboard'][_0xe47f('0x2e')],function(_0x4ac1a2){return{'name':_0x4ac1a2[_0xe47f('0x2f')],'type':_0x4ac1a2['type']['key']};});_0x5f4022[_0xe47f('0x30')]=_[_0xe47f('0x31')](_0x27d8e6,_0xe47f('0x2b'));_0x5f4022[_0xe47f('0x32')]=_[_0xe47f('0x33')](_0x342021[_0xe47f('0x32')]);_0x5f4022[_0xe47f('0x34')]=_['intersection'](_0x5f4022[_0xe47f('0x30')],_0x5f4022[_0xe47f('0x32')]);_0x2da096[_0xe47f('0x35')]=_['intersection'](_0x5f4022[_0xe47f('0x30')],qs[_0xe47f('0x36')](_0x342021[_0xe47f('0x32')][_0xe47f('0x36')]));_0x2da096[_0xe47f('0x35')]=_0x2da096[_0xe47f('0x35')][_0xe47f('0x37')]?_0x2da096['attributes']:_0x5f4022[_0xe47f('0x30')];if(!_0x342021['query'][_0xe47f('0x38')](_0xe47f('0x39'))){_0x2da096['limit']=qs[_0xe47f('0x1e')](_0x342021[_0xe47f('0x32')][_0xe47f('0x1e')]);_0x2da096[_0xe47f('0x20')]=qs[_0xe47f('0x20')](_0x342021[_0xe47f('0x32')][_0xe47f('0x20')]);}_0x2da096['order']=qs[_0xe47f('0x3a')](_0x342021['query'][_0xe47f('0x3a')]);_0x2da096[_0xe47f('0x3b')]=qs[_0xe47f('0x34')](_[_0xe47f('0x3c')](_0x342021[_0xe47f('0x32')],_0x5f4022[_0xe47f('0x34')]),_0x27d8e6);if(_0x342021[_0xe47f('0x32')][_0xe47f('0x3d')]){_0x2da096[_0xe47f('0x3b')]=_[_0xe47f('0x3e')](_0x2da096[_0xe47f('0x3b')],{'$or':_[_0xe47f('0x31')](_0x27d8e6,function(_0x5531ae){if(_0x5531ae['type']!==_0xe47f('0x3f')){var _0x284cf0={};_0x284cf0[_0x5531ae['name']]={'$like':'%'+_0x342021['query'][_0xe47f('0x3d')]+'%'};return _0x284cf0;}})});}_0x2da096=_[_0xe47f('0x3e')]({},_0x2da096,_0x342021[_0xe47f('0x40')]);var _0x7cb6e2={'where':_0x2da096[_0xe47f('0x3b')]};return db[_0xe47f('0x41')][_0xe47f('0x1f')](_0x7cb6e2)[_0xe47f('0x24')](function(_0x24a0b8){_0xb699e4[_0xe47f('0x1f')]=_0x24a0b8;if(_0x342021['query'][_0xe47f('0x42')]){_0x2da096[_0xe47f('0x43')]=[{'all':!![]}];}return db['Dashboard'][_0xe47f('0x44')](_0x2da096);})[_0xe47f('0x24')](function(_0x515f61){_0xb699e4['rows']=_0x515f61;return _0xb699e4;})[_0xe47f('0x24')](respondWithFilteredResult(_0x577cd8,_0x2da096))[_0xe47f('0x45')](handleError(_0x577cd8,null));};exports['show']=function(_0x65bb34,_0x27f4c4){var _0x22f681={'raw':![],'where':{'id':_0x65bb34['params']['id']}},_0x46133d={};_0x46133d[_0xe47f('0x30')]=_[_0xe47f('0x33')](db[_0xe47f('0x41')][_0xe47f('0x2e')]);_0x46133d[_0xe47f('0x32')]=_[_0xe47f('0x33')](_0x65bb34[_0xe47f('0x32')]);_0x46133d[_0xe47f('0x34')]=_['intersection'](_0x46133d[_0xe47f('0x30')],_0x46133d[_0xe47f('0x32')]);_0x22f681[_0xe47f('0x35')]=_[_0xe47f('0x46')](_0x46133d[_0xe47f('0x30')],qs[_0xe47f('0x36')](_0x65bb34['query'][_0xe47f('0x36')]));_0x22f681[_0xe47f('0x35')]=_0x22f681[_0xe47f('0x35')][_0xe47f('0x37')]?_0x22f681['attributes']:_0x46133d[_0xe47f('0x30')];if(_0x65bb34[_0xe47f('0x32')]['includeAll']){_0x22f681[_0xe47f('0x43')]=[{'all':!![]}];}_0x22f681=_[_0xe47f('0x3e')]({},_0x22f681,_0x65bb34[_0xe47f('0x40')]);return db[_0xe47f('0x41')]['find'](_0x22f681)[_0xe47f('0x24')](handleEntityNotFound(_0x27f4c4,null))['then'](respondWithResult(_0x27f4c4,null))[_0xe47f('0x45')](handleError(_0x27f4c4,null));};exports[_0xe47f('0x47')]=function(_0x2a3bcd,_0x36bd4d){return db[_0xe47f('0x41')][_0xe47f('0x47')](_0x2a3bcd['body'],{})[_0xe47f('0x24')](function(_0xe4efe1){var _0x64e7fb=_0x2a3bcd[_0xe47f('0x48')]['get']({'plain':!![]});if(!_0x64e7fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x64e7fb['role']===_0xe47f('0x48')){var _0x40807d=_0xe4efe1[_0xe47f('0x26')]({'plain':!![]});var _0x25540a='CustomDashboards';return db[_0xe47f('0x49')]['find']({'where':{'name':_0x25540a,'userProfileId':_0x64e7fb[_0xe47f('0x4a')]},'raw':!![]})[_0xe47f('0x24')](function(_0x23c35a){if(_0x23c35a&&_0x23c35a['autoAssociation']===0x0){return db[_0xe47f('0x27')][_0xe47f('0x47')]({'name':_0x40807d[_0xe47f('0x2b')],'resourceId':_0x40807d['id'],'type':_0x23c35a['name'],'sectionId':_0x23c35a['id']},{})['then'](function(){return _0xe4efe1;});}else{return _0xe4efe1;}})[_0xe47f('0x45')](function(_0x15e08d){logger[_0xe47f('0x29')](_0xe47f('0x4b'),_0x15e08d);throw _0x15e08d;});}return _0xe4efe1;})[_0xe47f('0x24')](respondWithResult(_0x36bd4d,0xc9))[_0xe47f('0x45')](handleError(_0x36bd4d,null));};exports[_0xe47f('0x4c')]=function(_0x5a4e6a,_0x1e8b13){var _0x259e59={'where':{'id':_0x5a4e6a['params']['id']}},_0x13fae8={};_0x13fae8[_0xe47f('0x30')]=_['keys'](db['Dashboard']['rawAttributes']);_0x259e59[_0xe47f('0x35')]=_[_0xe47f('0x46')](_0x13fae8['model'],qs[_0xe47f('0x36')](_0x5a4e6a[_0xe47f('0x32')][_0xe47f('0x36')]));_0x259e59[_0xe47f('0x35')]=_0x259e59['attributes'][_0xe47f('0x37')]?_0x259e59[_0xe47f('0x35')]:_0x13fae8[_0xe47f('0x30')];if(_0x5a4e6a['query'][_0xe47f('0x42')]){_0x259e59[_0xe47f('0x43')]=[{'all':!![]}];}_0x259e59=_[_0xe47f('0x3e')]({},_0x259e59,_0x5a4e6a[_0xe47f('0x40')]);return db[_0xe47f('0x41')][_0xe47f('0x4d')](_0x259e59)['then'](handleEntityNotFound(_0x1e8b13,null))[_0xe47f('0x24')](function(_0x24bc37){if(_0x24bc37){var _0x12905c=_0x24bc37[_0xe47f('0x26')]({'plain':!![]});_0x12905c=qs['omit'](_0x12905c,['id',_0xe47f('0x4e'),_0xe47f('0x4f')]);_0x5a4e6a[_0xe47f('0x50')]=_[_0xe47f('0x51')](_0x5a4e6a[_0xe47f('0x50')],['id',_0xe47f('0x4e'),_0xe47f('0x4f')]);return db[_0xe47f('0x41')][_0xe47f('0x47')](_[_0xe47f('0x3e')](_0x12905c,_0x5a4e6a[_0xe47f('0x50')]),{'include':_0x5a4e6a[_0xe47f('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xe47f('0x24')](function(_0x34ee35){var _0xe37599=_0x5a4e6a[_0xe47f('0x48')][_0xe47f('0x26')]({'plain':!![]});if(!_0xe37599)throw new Error(_0xe47f('0x52'));if(_0xe37599['role']==='user'){var _0x5a6f3e=_0x34ee35[_0xe47f('0x26')]({'plain':!![]});var _0x1a8852=_0xe47f('0x53');return db[_0xe47f('0x49')][_0xe47f('0x4d')]({'where':{'name':_0x1a8852,'userProfileId':_0xe37599['userProfileId']},'raw':!![]})['then'](function(_0x3228d7){if(_0x3228d7&&_0x3228d7[_0xe47f('0x54')]===0x0){return db['UserProfileResource'][_0xe47f('0x47')]({'name':_0x5a6f3e[_0xe47f('0x2b')],'resourceId':_0x5a6f3e['id'],'type':_0x3228d7[_0xe47f('0x2b')],'sectionId':_0x3228d7['id']},{})[_0xe47f('0x24')](function(){return _0x34ee35;});}else{return _0x34ee35;}})[_0xe47f('0x45')](function(_0x290f53){logger[_0xe47f('0x29')](_0xe47f('0x4b'),_0x290f53);throw _0x290f53;});}return _0x34ee35;});}})[_0xe47f('0x24')](respondWithResult(_0x1e8b13,0xc9))[_0xe47f('0x45')](handleError(_0x1e8b13,null));};exports[_0xe47f('0x55')]=function(_0x2bab7d,_0x25b9a4){if(_0x2bab7d[_0xe47f('0x50')]['id']){delete _0x2bab7d['body']['id'];}return db[_0xe47f('0x41')]['find']({'where':{'id':_0x2bab7d[_0xe47f('0x56')]['id']}})['then'](handleEntityNotFound(_0x25b9a4,null))['then'](saveUpdates(_0x2bab7d[_0xe47f('0x50')],null))[_0xe47f('0x24')](respondWithResult(_0x25b9a4,null))[_0xe47f('0x45')](handleError(_0x25b9a4,null));};exports[_0xe47f('0x25')]=function(_0x469921,_0xb4933a){return db[_0xe47f('0x41')][_0xe47f('0x4d')]({'where':{'id':_0x469921[_0xe47f('0x56')]['id']}})[_0xe47f('0x24')](handleEntityNotFound(_0xb4933a,null))[_0xe47f('0x24')](removeEntity(_0xb4933a,null))['catch'](handleError(_0xb4933a,null));};function widgetAttributes(_0x40af2a){try{switch(_0x40af2a[_0xe47f('0x57')]){case _0xe47f('0x58'):return[{'name':_0xe47f('0x59'),'value':_0x40af2a[_0xe47f('0x59')]||(_0x40af2a['attrs']&&_0x40af2a[_0xe47f('0x5a')][0x0]?_0x40af2a['attrs'][0x0][_0xe47f('0x5b')]:undefined)||'https://'}];case _0xe47f('0x5c'):return[{'name':_0xe47f('0x5d'),'value':_0x40af2a[_0xe47f('0x5d')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x0]?_0x40af2a['attrs'][0x0]['value']:undefined)||''}];case _0xe47f('0x5e'):return[{'name':_0xe47f('0x5f'),'value':_0x40af2a[_0xe47f('0x5f')]||(_0x40af2a['attrs']&&_0x40af2a[_0xe47f('0x5a')][0x0]?_0x40af2a[_0xe47f('0x5a')][0x0][_0xe47f('0x5b')]:undefined)||_0xe47f('0x60')},{'name':_0xe47f('0x61'),'value':_0x40af2a[_0xe47f('0x61')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x1]?_0x40af2a[_0xe47f('0x5a')][0x1]['value']:undefined)||_0xe47f('0x62')},{'name':_0xe47f('0x63'),'value':_0x40af2a[_0xe47f('0x63')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x2]?_0x40af2a[_0xe47f('0x5a')][0x2][_0xe47f('0x5b')]:undefined)||0xc}];case'counter':return[{'name':_0xe47f('0x64'),'value':_0x40af2a[_0xe47f('0x64')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x0]?_0x40af2a[_0xe47f('0x5a')][0x0][_0xe47f('0x5b')]:undefined)||_0xe47f('0x65')},{'name':_0xe47f('0x66'),'value':_0x40af2a['attrVoiceQueues']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x1]?_0x40af2a[_0xe47f('0x5a')][0x1][_0xe47f('0x5b')]:undefined)||[]},{'name':'attrFontSize','value':_0x40af2a[_0xe47f('0x63')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x2]?_0x40af2a[_0xe47f('0x5a')][0x2]['value']:undefined)||0x14},{'name':_0xe47f('0x67'),'value':_0x40af2a[_0xe47f('0x67')]||(_0x40af2a['attrs']&&_0x40af2a[_0xe47f('0x5a')][0x3]?_0x40af2a[_0xe47f('0x5a')][0x3]['value']:undefined)||'voice'},{'name':_0xe47f('0x68'),'value':_0x40af2a[_0xe47f('0x68')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a['attrs'][0x4]?_0x40af2a[_0xe47f('0x5a')][0x4][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x69'),'value':_0x40af2a[_0xe47f('0x69')]||(_0x40af2a['attrs']&&_0x40af2a[_0xe47f('0x5a')][0x5]?_0x40af2a['attrs'][0x5][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6a'),'value':_0x40af2a[_0xe47f('0x6a')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a['attrs'][0x6]?_0x40af2a['attrs'][0x6][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6b'),'value':_0x40af2a['attrOpenchannelAccounts']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x7]?_0x40af2a['attrs'][0x7][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6c'),'value':_0x40af2a[_0xe47f('0x6c')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x8]?_0x40af2a['attrs'][0x8][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6d'),'value':_0x40af2a[_0xe47f('0x6d')]||(_0x40af2a['attrs']&&_0x40af2a['attrs'][0x9]?_0x40af2a[_0xe47f('0x5a')][0x9][_0xe47f('0x5b')]:undefined)||''}];case _0xe47f('0x6e'):case _0xe47f('0x6f'):return[{'name':_0xe47f('0x70'),'value':_0x40af2a[_0xe47f('0x70')]||(_0x40af2a['attrs']&&_0x40af2a[_0xe47f('0x5a')][0x0]?_0x40af2a[_0xe47f('0x5a')][0x0][_0xe47f('0x5b')]:undefined)||_0xe47f('0x65')},{'name':'attrSerie2','value':_0x40af2a[_0xe47f('0x71')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x1]?_0x40af2a[_0xe47f('0x5a')][0x1][_0xe47f('0x5b')]:undefined)||null},{'name':'attrSerie3','value':_0x40af2a[_0xe47f('0x72')]||(_0x40af2a['attrs']&&_0x40af2a[_0xe47f('0x5a')][0x2]?_0x40af2a[_0xe47f('0x5a')][0x2][_0xe47f('0x5b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x40af2a['attrVoiceQueues']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a['attrs'][0x3]?_0x40af2a[_0xe47f('0x5a')][0x3]['value']:undefined)||[]},{'name':_0xe47f('0x67'),'value':_0x40af2a['attrChannel']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x4]?_0x40af2a[_0xe47f('0x5a')][0x4][_0xe47f('0x5b')]:undefined)||_0xe47f('0x73')},{'name':_0xe47f('0x68'),'value':_0x40af2a[_0xe47f('0x68')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x5]?_0x40af2a[_0xe47f('0x5a')][0x5][_0xe47f('0x5b')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x40af2a[_0xe47f('0x69')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a['attrs'][0x6]?_0x40af2a[_0xe47f('0x5a')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x40af2a['attrSmsAccounts']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x7]?_0x40af2a[_0xe47f('0x5a')][0x7][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6b'),'value':_0x40af2a['attrOpenchannelAccounts']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x8]?_0x40af2a[_0xe47f('0x5a')][0x8][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6c'),'value':_0x40af2a['attrWhatsappAccounts']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x9]?_0x40af2a['attrs'][0x9][_0xe47f('0x5b')]:undefined)||''},{'name':_0xe47f('0x6d'),'value':_0x40af2a['attrChatWebsites']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0xa]?_0x40af2a[_0xe47f('0x5a')][0xa][_0xe47f('0x5b')]:undefined)||''}];case _0xe47f('0x74'):return[{'name':_0xe47f('0x75'),'type':_0x40af2a[_0xe47f('0x76')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a['attrs'][0x0]?_0x40af2a['attrs'][0x0]['type']:undefined)||null,'value':_0x40af2a[_0xe47f('0x75')]||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a['attrs'][0x0]?_0x40af2a[_0xe47f('0x5a')][0x0][_0xe47f('0x5b')]:undefined)||null},{'name':'attrRefresh','value':_0x40af2a['attrRefresh']||(_0x40af2a[_0xe47f('0x5a')]&&_0x40af2a[_0xe47f('0x5a')][0x1]?_0x40af2a['attrs'][0x1][_0xe47f('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x6fad2b){logger[_0xe47f('0x29')](_0xe47f('0x77'),JSON[_0xe47f('0x78')](_0x6fad2b));return[];}}exports[_0xe47f('0x79')]=function(_0x2c2fdc,_0x4fb139,_0x20981c){if(_0x2c2fdc[_0xe47f('0x50')]['id']){delete _0x2c2fdc['body']['id'];}return db[_0xe47f('0x41')][_0xe47f('0x4d')]({'where':{'id':_0x2c2fdc[_0xe47f('0x56')]['id']}})[_0xe47f('0x24')](handleEntityNotFound(_0x4fb139,null))[_0xe47f('0x24')](function(_0x321bd7){if(_0x321bd7){_0x2c2fdc[_0xe47f('0x50')][_0xe47f('0x7a')]=_0x321bd7['id'];_0x2c2fdc[_0xe47f('0x50')][_0xe47f('0x5a')]=widgetAttributes(_0x2c2fdc['body']);return db[_0xe47f('0x7b')][_0xe47f('0x47')](_0x2c2fdc[_0xe47f('0x50')]);}})[_0xe47f('0x24')](respondWithResult(_0x4fb139,null))[_0xe47f('0x45')](handleError(_0x4fb139,null));};exports[_0xe47f('0x7c')]=function(_0x578828,_0x1c8146,_0x4fd8a4){var _0xba62b1={};var _0x5b5953={};var _0x27e032;var _0x518d5b;return db[_0xe47f('0x41')][_0xe47f('0x7d')]({'where':{'id':_0x578828['params']['id']}})[_0xe47f('0x24')](handleEntityNotFound(_0x1c8146,null))[_0xe47f('0x24')](function(_0xf76e01){if(_0xf76e01){_0x27e032=_0xf76e01;_0x5b5953['model']=_[_0xe47f('0x33')](db[_0xe47f('0x7b')][_0xe47f('0x2e')]);_0x5b5953[_0xe47f('0x32')]=_[_0xe47f('0x33')](_0x578828['query']);_0x5b5953[_0xe47f('0x34')]=_['intersection'](_0x5b5953[_0xe47f('0x30')],_0x5b5953['query']);_0xba62b1[_0xe47f('0x35')]=_[_0xe47f('0x46')](_0x5b5953[_0xe47f('0x30')],qs[_0xe47f('0x36')](_0x578828['query'][_0xe47f('0x36')]));_0xba62b1[_0xe47f('0x35')]=_0xba62b1['attributes'][_0xe47f('0x37')]?_0xba62b1[_0xe47f('0x35')]:_0x5b5953[_0xe47f('0x30')];_0xba62b1[_0xe47f('0x7e')]=qs[_0xe47f('0x3a')](_0x578828[_0xe47f('0x32')][_0xe47f('0x3a')]);_0xba62b1['where']=qs['filters'](_['pick'](_0x578828[_0xe47f('0x32')],_0x5b5953[_0xe47f('0x34')]));if(_0x578828[_0xe47f('0x32')]['filter']){_0xba62b1['where']=_[_0xe47f('0x3e')](_0xba62b1['where'],{'$or':_[_0xe47f('0x31')](_0xba62b1[_0xe47f('0x35')],function(_0x48ce14){var _0x410e8a={};_0x410e8a[_0x48ce14]={'$like':'%'+_0x578828['query'][_0xe47f('0x3d')]+'%'};return _0x410e8a;})});}_0xba62b1=_['merge']({},_0xba62b1,_0x578828[_0xe47f('0x40')]);return _0x27e032['getItems'](_0xba62b1);}})['then'](function(_0x1e2bc6){if(_0x1e2bc6){_0x518d5b=_0x1e2bc6[_0xe47f('0x37')];if(!_0x578828[_0xe47f('0x32')][_0xe47f('0x38')](_0xe47f('0x39'))){_0xba62b1['limit']=qs[_0xe47f('0x1e')](_0x578828[_0xe47f('0x32')][_0xe47f('0x1e')]);_0xba62b1[_0xe47f('0x20')]=qs[_0xe47f('0x20')](_0x578828['query'][_0xe47f('0x20')]);}return _0x27e032['getItems'](_0xba62b1);}})[_0xe47f('0x24')](function(_0x32f373){if(_0x32f373){return _0x32f373?{'count':_0x518d5b,'rows':_0x32f373}:null;}})['then'](respondWithResult(_0x1c8146,null))[_0xe47f('0x45')](handleError(_0x1c8146,null));}; \ No newline at end of file +var _0x2fef=['socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','error','name','index','fieldName','type','key','map','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','Dashboard','include','findAll','catch','show','params','rawAttributes','keys','intersection','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrOpenchannelAccounts','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','order','options','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost'];(function(_0x2e5db8,_0x223a8d){var _0x4a9a81=function(_0x385a1b){while(--_0x385a1b){_0x2e5db8['push'](_0x2e5db8['shift']());}};_0x4a9a81(++_0x223a8d);}(_0x2fef,0xec));var _0xf2fe=function(_0xf24f30,_0x77205b){_0xf24f30=_0xf24f30-0x0;var _0x364bea=_0x2fef[_0xf24f30];return _0x364bea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf2fe('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2fe('0x1'));var moment=require(_0xf2fe('0x2'));var BPromise=require(_0xf2fe('0x3'));var Mustache=require(_0xf2fe('0x4'));var util=require(_0xf2fe('0x5'));var path=require(_0xf2fe('0x6'));var sox=require(_0xf2fe('0x7'));var csv=require(_0xf2fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2fe('0x9'));var _=require(_0xf2fe('0xa'));var squel=require(_0xf2fe('0xb'));var crypto=require(_0xf2fe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf2fe('0xd'));var toCsv=require(_0xf2fe('0x8'));var querystring=require(_0xf2fe('0xe'));var Papa=require('papaparse');var Redis=require(_0xf2fe('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf2fe('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2fe('0x11'));var logger=require('../../config/logger')(_0xf2fe('0x12'));var utils=require(_0xf2fe('0x13'));var config=require(_0xf2fe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2fe('0x15'))['db'];config['redis']=_['defaults'](config[_0xf2fe('0x16')],{'host':_0xf2fe('0x17'),'port':0x18eb});var socket=require(_0xf2fe('0x18'))(new Redis(config[_0xf2fe('0x16')]));require(_0xf2fe('0x19'))[_0xf2fe('0x1a')](socket);function respondWithStatusCode(_0x36561b,_0xcdfacf){_0xcdfacf=_0xcdfacf||0xcc;return function(_0x4d05f6){if(_0x4d05f6){return _0x36561b[_0xf2fe('0x1b')](_0xcdfacf);}return _0x36561b[_0xf2fe('0x1c')](_0xcdfacf)['end']();};}function respondWithResult(_0x296862,_0x18fc57){_0x18fc57=_0x18fc57||0xc8;return function(_0x367dd8){if(_0x367dd8){return _0x296862[_0xf2fe('0x1c')](_0x18fc57)[_0xf2fe('0x1d')](_0x367dd8);}};}function respondWithFilteredResult(_0x172635,_0x43506c){return function(_0x4af938){if(_0x4af938){var _0x11bf00=typeof _0x43506c[_0xf2fe('0x1e')]===_0xf2fe('0x1f')&&typeof _0x43506c['limit']===_0xf2fe('0x1f');var _0x44c249=_0x4af938['count'];var _0x47746e=_0x11bf00?0x0:_0x43506c[_0xf2fe('0x1e')];var _0x981c7b=_0x11bf00?_0x4af938[_0xf2fe('0x20')]:_0x43506c[_0xf2fe('0x1e')]+_0x43506c[_0xf2fe('0x21')];var _0x306574;if(_0x981c7b>=_0x44c249){_0x981c7b=_0x44c249;_0x306574=0xc8;}else{_0x306574=0xce;}_0x172635['status'](_0x306574);return _0x172635[_0xf2fe('0x22')](_0xf2fe('0x23'),_0x47746e+'-'+_0x981c7b+'/'+_0x44c249)[_0xf2fe('0x1d')](_0x4af938);}return null;};}function patchUpdates(_0x8b0d3){return function(_0xec6b7f){try{jsonpatch[_0xf2fe('0x24')](_0xec6b7f,_0x8b0d3,!![]);}catch(_0x5b0036){return BPromise[_0xf2fe('0x25')](_0x5b0036);}return _0xec6b7f[_0xf2fe('0x26')]();};}function saveUpdates(_0x1a149c,_0x10667e){return function(_0x2115e0){if(_0x2115e0){return _0x2115e0[_0xf2fe('0x27')](_0x1a149c)[_0xf2fe('0x28')](function(_0x4690dc){return _0x4690dc;});}return null;};}function removeEntity(_0x285d3f,_0x2275c9){return function(_0x28d643){if(_0x28d643){return _0x28d643['destroy']()[_0xf2fe('0x28')](function(){var _0x2c92da=_0x28d643[_0xf2fe('0x29')]({'plain':!![]});var _0x31a4af=_0xf2fe('0x2a');return db[_0xf2fe('0x2b')][_0xf2fe('0x2c')]({'where':{'type':_0x31a4af,'resourceId':_0x2c92da['id']}})[_0xf2fe('0x28')](function(){return _0x28d643;});})[_0xf2fe('0x28')](function(){_0x285d3f['status'](0xcc)[_0xf2fe('0x2d')]();});}};}function handleEntityNotFound(_0xe5e7da,_0x21a9dc){return function(_0xbef304){if(!_0xbef304){_0xe5e7da[_0xf2fe('0x1b')](0x194);}return _0xbef304;};}function handleError(_0x13e8ea,_0x5c6a89){_0x5c6a89=_0x5c6a89||0x1f4;return function(_0x5bfebe){logger[_0xf2fe('0x2e')](_0x5bfebe['stack']);if(_0x5bfebe['name']){delete _0x5bfebe[_0xf2fe('0x2f')];}_0x13e8ea['status'](_0x5c6a89)['send'](_0x5bfebe);};}exports[_0xf2fe('0x30')]=function(_0x1a97d2,_0x309c9a){var _0x27d0dc={},_0x16d0d3={},_0x3da579={'count':0x0,'rows':[]};var _0x1392f2=_['map'](db['Dashboard']['rawAttributes'],function(_0x102107){return{'name':_0x102107[_0xf2fe('0x31')],'type':_0x102107[_0xf2fe('0x32')][_0xf2fe('0x33')]};});_0x16d0d3['model']=_[_0xf2fe('0x34')](_0x1392f2,_0xf2fe('0x2f'));_0x16d0d3[_0xf2fe('0x35')]=_['keys'](_0x1a97d2[_0xf2fe('0x35')]);_0x16d0d3[_0xf2fe('0x36')]=_['intersection'](_0x16d0d3[_0xf2fe('0x37')],_0x16d0d3[_0xf2fe('0x35')]);_0x27d0dc[_0xf2fe('0x38')]=_['intersection'](_0x16d0d3['model'],qs[_0xf2fe('0x39')](_0x1a97d2['query'][_0xf2fe('0x39')]));_0x27d0dc[_0xf2fe('0x38')]=_0x27d0dc[_0xf2fe('0x38')][_0xf2fe('0x3a')]?_0x27d0dc['attributes']:_0x16d0d3['model'];if(!_0x1a97d2['query'][_0xf2fe('0x3b')](_0xf2fe('0x3c'))){_0x27d0dc[_0xf2fe('0x21')]=qs[_0xf2fe('0x21')](_0x1a97d2[_0xf2fe('0x35')][_0xf2fe('0x21')]);_0x27d0dc['offset']=qs[_0xf2fe('0x1e')](_0x1a97d2[_0xf2fe('0x35')][_0xf2fe('0x1e')]);}_0x27d0dc['order']=qs[_0xf2fe('0x3d')](_0x1a97d2[_0xf2fe('0x35')][_0xf2fe('0x3d')]);_0x27d0dc[_0xf2fe('0x3e')]=qs['filters'](_[_0xf2fe('0x3f')](_0x1a97d2[_0xf2fe('0x35')],_0x16d0d3[_0xf2fe('0x36')]),_0x1392f2);if(_0x1a97d2['query'][_0xf2fe('0x40')]){_0x27d0dc[_0xf2fe('0x3e')]=_['merge'](_0x27d0dc[_0xf2fe('0x3e')],{'$or':_[_0xf2fe('0x34')](_0x1392f2,function(_0x47be5c){if(_0x47be5c[_0xf2fe('0x32')]!==_0xf2fe('0x41')){var _0xe1eda={};_0xe1eda[_0x47be5c[_0xf2fe('0x2f')]]={'$like':'%'+_0x1a97d2[_0xf2fe('0x35')][_0xf2fe('0x40')]+'%'};return _0xe1eda;}})});}_0x27d0dc=_[_0xf2fe('0x42')]({},_0x27d0dc,_0x1a97d2['options']);var _0x2f1632={'where':_0x27d0dc[_0xf2fe('0x3e')]};return db[_0xf2fe('0x43')][_0xf2fe('0x20')](_0x2f1632)[_0xf2fe('0x28')](function(_0x432a91){_0x3da579[_0xf2fe('0x20')]=_0x432a91;if(_0x1a97d2[_0xf2fe('0x35')]['includeAll']){_0x27d0dc[_0xf2fe('0x44')]=[{'all':!![]}];}return db[_0xf2fe('0x43')][_0xf2fe('0x45')](_0x27d0dc);})['then'](function(_0x235ee8){_0x3da579['rows']=_0x235ee8;return _0x3da579;})[_0xf2fe('0x28')](respondWithFilteredResult(_0x309c9a,_0x27d0dc))[_0xf2fe('0x46')](handleError(_0x309c9a,null));};exports[_0xf2fe('0x47')]=function(_0x590476,_0x4cc8a2){var _0x42ab59={'raw':![],'where':{'id':_0x590476[_0xf2fe('0x48')]['id']}},_0x4e8732={};_0x4e8732[_0xf2fe('0x37')]=_['keys'](db['Dashboard'][_0xf2fe('0x49')]);_0x4e8732[_0xf2fe('0x35')]=_[_0xf2fe('0x4a')](_0x590476[_0xf2fe('0x35')]);_0x4e8732[_0xf2fe('0x36')]=_[_0xf2fe('0x4b')](_0x4e8732['model'],_0x4e8732[_0xf2fe('0x35')]);_0x42ab59[_0xf2fe('0x38')]=_[_0xf2fe('0x4b')](_0x4e8732[_0xf2fe('0x37')],qs[_0xf2fe('0x39')](_0x590476['query'][_0xf2fe('0x39')]));_0x42ab59[_0xf2fe('0x38')]=_0x42ab59[_0xf2fe('0x38')][_0xf2fe('0x3a')]?_0x42ab59[_0xf2fe('0x38')]:_0x4e8732['model'];if(_0x590476[_0xf2fe('0x35')][_0xf2fe('0x4c')]){_0x42ab59['include']=[{'all':!![]}];}_0x42ab59=_[_0xf2fe('0x42')]({},_0x42ab59,_0x590476['options']);return db[_0xf2fe('0x43')][_0xf2fe('0x4d')](_0x42ab59)[_0xf2fe('0x28')](handleEntityNotFound(_0x4cc8a2,null))[_0xf2fe('0x28')](respondWithResult(_0x4cc8a2,null))[_0xf2fe('0x46')](handleError(_0x4cc8a2,null));};exports[_0xf2fe('0x4e')]=function(_0x40208e,_0x162856){return db[_0xf2fe('0x43')][_0xf2fe('0x4e')](_0x40208e[_0xf2fe('0x4f')],{})['then'](function(_0x5aef72){var _0x490e12=_0x40208e['user'][_0xf2fe('0x29')]({'plain':!![]});if(!_0x490e12)throw new Error(_0xf2fe('0x50'));if(_0x490e12['role']===_0xf2fe('0x51')){var _0x3e5f83=_0x5aef72[_0xf2fe('0x29')]({'plain':!![]});var _0xd1944a=_0xf2fe('0x2a');return db[_0xf2fe('0x52')][_0xf2fe('0x4d')]({'where':{'name':_0xd1944a,'userProfileId':_0x490e12[_0xf2fe('0x53')]},'raw':!![]})['then'](function(_0x58a420){if(_0x58a420&&_0x58a420[_0xf2fe('0x54')]===0x0){return db[_0xf2fe('0x2b')][_0xf2fe('0x4e')]({'name':_0x3e5f83[_0xf2fe('0x2f')],'resourceId':_0x3e5f83['id'],'type':_0x58a420[_0xf2fe('0x2f')],'sectionId':_0x58a420['id']},{})[_0xf2fe('0x28')](function(){return _0x5aef72;});}else{return _0x5aef72;}})[_0xf2fe('0x46')](function(_0x135dee){logger['error'](_0xf2fe('0x55'),_0x135dee);throw _0x135dee;});}return _0x5aef72;})[_0xf2fe('0x28')](respondWithResult(_0x162856,0xc9))[_0xf2fe('0x46')](handleError(_0x162856,null));};exports[_0xf2fe('0x56')]=function(_0x57c44b,_0x1a6278){var _0x5371b2={'where':{'id':_0x57c44b['params']['id']}},_0x59d61a={};_0x59d61a[_0xf2fe('0x37')]=_[_0xf2fe('0x4a')](db[_0xf2fe('0x43')][_0xf2fe('0x49')]);_0x5371b2[_0xf2fe('0x38')]=_['intersection'](_0x59d61a['model'],qs['fields'](_0x57c44b[_0xf2fe('0x35')][_0xf2fe('0x39')]));_0x5371b2[_0xf2fe('0x38')]=_0x5371b2[_0xf2fe('0x38')][_0xf2fe('0x3a')]?_0x5371b2[_0xf2fe('0x38')]:_0x59d61a[_0xf2fe('0x37')];if(_0x57c44b[_0xf2fe('0x35')][_0xf2fe('0x4c')]){_0x5371b2['include']=[{'all':!![]}];}_0x5371b2=_[_0xf2fe('0x42')]({},_0x5371b2,_0x57c44b['options']);return db['Dashboard'][_0xf2fe('0x4d')](_0x5371b2)[_0xf2fe('0x28')](handleEntityNotFound(_0x1a6278,null))['then'](function(_0x126e73){if(_0x126e73){var _0x57fcba=_0x126e73[_0xf2fe('0x29')]({'plain':!![]});_0x57fcba=qs[_0xf2fe('0x57')](_0x57fcba,['id',_0xf2fe('0x58'),'updatedAt']);_0x57c44b[_0xf2fe('0x4f')]=_[_0xf2fe('0x57')](_0x57c44b[_0xf2fe('0x4f')],['id',_0xf2fe('0x58'),_0xf2fe('0x59')]);return db[_0xf2fe('0x43')][_0xf2fe('0x4e')](_[_0xf2fe('0x42')](_0x57fcba,_0x57c44b[_0xf2fe('0x4f')]),{'include':_0x57c44b[_0xf2fe('0x35')][_0xf2fe('0x4c')]?[{'all':!![]}]:undefined})[_0xf2fe('0x28')](function(_0x2dd8af){var _0x54a0a1=_0x57c44b[_0xf2fe('0x51')][_0xf2fe('0x29')]({'plain':!![]});if(!_0x54a0a1)throw new Error(_0xf2fe('0x50'));if(_0x54a0a1['role']===_0xf2fe('0x51')){var _0x38361a=_0x2dd8af[_0xf2fe('0x29')]({'plain':!![]});var _0xdfe6a8='CustomDashboards';return db['UserProfileSection'][_0xf2fe('0x4d')]({'where':{'name':_0xdfe6a8,'userProfileId':_0x54a0a1[_0xf2fe('0x53')]},'raw':!![]})[_0xf2fe('0x28')](function(_0x307341){if(_0x307341&&_0x307341[_0xf2fe('0x54')]===0x0){return db['UserProfileResource'][_0xf2fe('0x4e')]({'name':_0x38361a[_0xf2fe('0x2f')],'resourceId':_0x38361a['id'],'type':_0x307341[_0xf2fe('0x2f')],'sectionId':_0x307341['id']},{})[_0xf2fe('0x28')](function(){return _0x2dd8af;});}else{return _0x2dd8af;}})[_0xf2fe('0x46')](function(_0x418e4b){logger[_0xf2fe('0x2e')](_0xf2fe('0x55'),_0x418e4b);throw _0x418e4b;});}return _0x2dd8af;});}})[_0xf2fe('0x28')](respondWithResult(_0x1a6278,0xc9))[_0xf2fe('0x46')](handleError(_0x1a6278,null));};exports[_0xf2fe('0x27')]=function(_0x231758,_0x56e913){if(_0x231758[_0xf2fe('0x4f')]['id']){delete _0x231758[_0xf2fe('0x4f')]['id'];}return db['Dashboard'][_0xf2fe('0x4d')]({'where':{'id':_0x231758[_0xf2fe('0x48')]['id']}})[_0xf2fe('0x28')](handleEntityNotFound(_0x56e913,null))['then'](saveUpdates(_0x231758[_0xf2fe('0x4f')],null))[_0xf2fe('0x28')](respondWithResult(_0x56e913,null))[_0xf2fe('0x46')](handleError(_0x56e913,null));};exports[_0xf2fe('0x2c')]=function(_0x3039bc,_0x1b1cd0){return db[_0xf2fe('0x43')][_0xf2fe('0x4d')]({'where':{'id':_0x3039bc[_0xf2fe('0x48')]['id']}})[_0xf2fe('0x28')](handleEntityNotFound(_0x1b1cd0,null))['then'](removeEntity(_0x1b1cd0,null))[_0xf2fe('0x46')](handleError(_0x1b1cd0,null));};function widgetAttributes(_0x3943d5){try{switch(_0x3943d5[_0xf2fe('0x32')]){case'iframe':return[{'name':'attrUrl','value':_0x3943d5[_0xf2fe('0x5a')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5['attrs'][0x0]?_0x3943d5['attrs'][0x0]['value']:undefined)||_0xf2fe('0x5c')}];case _0xf2fe('0x5d'):return[{'name':_0xf2fe('0x5e'),'value':_0x3943d5[_0xf2fe('0x5e')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x0]?_0x3943d5[_0xf2fe('0x5b')][0x0][_0xf2fe('0x5f')]:undefined)||''}];case _0xf2fe('0x60'):return[{'name':_0xf2fe('0x61'),'value':_0x3943d5['attrHourFormat']||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x0]?_0x3943d5[_0xf2fe('0x5b')][0x0][_0xf2fe('0x5f')]:undefined)||_0xf2fe('0x62')},{'name':_0xf2fe('0x63'),'value':_0x3943d5[_0xf2fe('0x63')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x1]?_0x3943d5[_0xf2fe('0x5b')][0x1][_0xf2fe('0x5f')]:undefined)||_0xf2fe('0x64')},{'name':_0xf2fe('0x65'),'value':_0x3943d5[_0xf2fe('0x65')]||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x2]?_0x3943d5['attrs'][0x2][_0xf2fe('0x5f')]:undefined)||0xc}];case _0xf2fe('0x66'):return[{'name':_0xf2fe('0x67'),'value':_0x3943d5['attrMetric']||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x0]?_0x3943d5[_0xf2fe('0x5b')][0x0]['value']:undefined)||_0xf2fe('0x68')},{'name':'attrVoiceQueues','value':_0x3943d5['attrVoiceQueues']||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x1]?_0x3943d5[_0xf2fe('0x5b')][0x1][_0xf2fe('0x5f')]:undefined)||[]},{'name':_0xf2fe('0x65'),'value':_0x3943d5[_0xf2fe('0x65')]||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x2]?_0x3943d5['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x3943d5[_0xf2fe('0x69')]||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x3]?_0x3943d5[_0xf2fe('0x5b')][0x3][_0xf2fe('0x5f')]:undefined)||_0xf2fe('0x6a')},{'name':_0xf2fe('0x6b'),'value':_0x3943d5[_0xf2fe('0x6b')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x4]?_0x3943d5[_0xf2fe('0x5b')][0x4]['value']:undefined)||''},{'name':_0xf2fe('0x6c'),'value':_0x3943d5[_0xf2fe('0x6c')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x5]?_0x3943d5[_0xf2fe('0x5b')][0x5][_0xf2fe('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3943d5[_0xf2fe('0x6d')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x6]?_0x3943d5[_0xf2fe('0x5b')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3943d5['attrOpenchannelAccounts']||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x7]?_0x3943d5[_0xf2fe('0x5b')][0x7][_0xf2fe('0x5f')]:undefined)||''},{'name':_0xf2fe('0x6e'),'value':_0x3943d5[_0xf2fe('0x6e')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x8]?_0x3943d5['attrs'][0x8][_0xf2fe('0x5f')]:undefined)||''},{'name':_0xf2fe('0x6f'),'value':_0x3943d5['attrChatWebsites']||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x9]?_0x3943d5['attrs'][0x9]['value']:undefined)||''}];case _0xf2fe('0x70'):case'pie-chart':return[{'name':_0xf2fe('0x71'),'value':_0x3943d5[_0xf2fe('0x71')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x0]?_0x3943d5[_0xf2fe('0x5b')][0x0][_0xf2fe('0x5f')]:undefined)||_0xf2fe('0x68')},{'name':_0xf2fe('0x72'),'value':_0x3943d5['attrSerie2']||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x1]?_0x3943d5[_0xf2fe('0x5b')][0x1][_0xf2fe('0x5f')]:undefined)||null},{'name':_0xf2fe('0x73'),'value':_0x3943d5[_0xf2fe('0x73')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x2]?_0x3943d5['attrs'][0x2][_0xf2fe('0x5f')]:undefined)||null},{'name':_0xf2fe('0x74'),'value':_0x3943d5[_0xf2fe('0x74')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5['attrs'][0x3]?_0x3943d5[_0xf2fe('0x5b')][0x3]['value']:undefined)||[]},{'name':_0xf2fe('0x69'),'value':_0x3943d5[_0xf2fe('0x69')]||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x4]?_0x3943d5[_0xf2fe('0x5b')][0x4][_0xf2fe('0x5f')]:undefined)||_0xf2fe('0x6a')},{'name':_0xf2fe('0x6b'),'value':_0x3943d5[_0xf2fe('0x6b')]||(_0x3943d5['attrs']&&_0x3943d5[_0xf2fe('0x5b')][0x5]?_0x3943d5[_0xf2fe('0x5b')][0x5][_0xf2fe('0x5f')]:undefined)||''},{'name':_0xf2fe('0x6c'),'value':_0x3943d5[_0xf2fe('0x6c')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x6]?_0x3943d5['attrs'][0x6]['value']:undefined)||''},{'name':_0xf2fe('0x6d'),'value':_0x3943d5[_0xf2fe('0x6d')]||(_0x3943d5['attrs']&&_0x3943d5['attrs'][0x7]?_0x3943d5[_0xf2fe('0x5b')][0x7][_0xf2fe('0x5f')]:undefined)||''},{'name':_0xf2fe('0x75'),'value':_0x3943d5[_0xf2fe('0x75')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x8]?_0x3943d5['attrs'][0x8]['value']:undefined)||''},{'name':_0xf2fe('0x6e'),'value':_0x3943d5[_0xf2fe('0x6e')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5['attrs'][0x9]?_0x3943d5[_0xf2fe('0x5b')][0x9][_0xf2fe('0x5f')]:undefined)||''},{'name':_0xf2fe('0x6f'),'value':_0x3943d5['attrChatWebsites']||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0xa]?_0x3943d5[_0xf2fe('0x5b')][0xa][_0xf2fe('0x5f')]:undefined)||''}];case _0xf2fe('0x76'):return[{'name':_0xf2fe('0x77'),'type':_0x3943d5[_0xf2fe('0x78')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x0]?_0x3943d5[_0xf2fe('0x5b')][0x0]['type']:undefined)||null,'value':_0x3943d5[_0xf2fe('0x77')]||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5['attrs'][0x0]?_0x3943d5['attrs'][0x0][_0xf2fe('0x5f')]:undefined)||null},{'name':_0xf2fe('0x79'),'value':_0x3943d5['attrRefresh']||(_0x3943d5[_0xf2fe('0x5b')]&&_0x3943d5[_0xf2fe('0x5b')][0x1]?_0x3943d5['attrs'][0x1][_0xf2fe('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x5bf6f7){logger['error']('widgetAttributes:\x20%s',JSON[_0xf2fe('0x7a')](_0x5bf6f7));return[];}}exports[_0xf2fe('0x7b')]=function(_0x490065,_0x38c250,_0x1fa830){if(_0x490065[_0xf2fe('0x4f')]['id']){delete _0x490065['body']['id'];}return db[_0xf2fe('0x43')]['find']({'where':{'id':_0x490065[_0xf2fe('0x48')]['id']}})[_0xf2fe('0x28')](handleEntityNotFound(_0x38c250,null))[_0xf2fe('0x28')](function(_0x4f442e){if(_0x4f442e){_0x490065['body'][_0xf2fe('0x7c')]=_0x4f442e['id'];_0x490065[_0xf2fe('0x4f')][_0xf2fe('0x5b')]=widgetAttributes(_0x490065[_0xf2fe('0x4f')]);return db['DashboardItem'][_0xf2fe('0x4e')](_0x490065['body']);}})[_0xf2fe('0x28')](respondWithResult(_0x38c250,null))[_0xf2fe('0x46')](handleError(_0x38c250,null));};exports[_0xf2fe('0x7d')]=function(_0xa1e497,_0x5520e2,_0x3f2264){var _0x4276e9={};var _0x4828cd={};var _0x56d3e8;var _0x55f0b3;return db[_0xf2fe('0x43')][_0xf2fe('0x7e')]({'where':{'id':_0xa1e497[_0xf2fe('0x48')]['id']}})['then'](handleEntityNotFound(_0x5520e2,null))[_0xf2fe('0x28')](function(_0x27f70f){if(_0x27f70f){_0x56d3e8=_0x27f70f;_0x4828cd[_0xf2fe('0x37')]=_[_0xf2fe('0x4a')](db[_0xf2fe('0x7f')]['rawAttributes']);_0x4828cd[_0xf2fe('0x35')]=_[_0xf2fe('0x4a')](_0xa1e497[_0xf2fe('0x35')]);_0x4828cd[_0xf2fe('0x36')]=_[_0xf2fe('0x4b')](_0x4828cd[_0xf2fe('0x37')],_0x4828cd[_0xf2fe('0x35')]);_0x4276e9[_0xf2fe('0x38')]=_['intersection'](_0x4828cd[_0xf2fe('0x37')],qs[_0xf2fe('0x39')](_0xa1e497[_0xf2fe('0x35')][_0xf2fe('0x39')]));_0x4276e9['attributes']=_0x4276e9[_0xf2fe('0x38')][_0xf2fe('0x3a')]?_0x4276e9['attributes']:_0x4828cd[_0xf2fe('0x37')];_0x4276e9[_0xf2fe('0x80')]=qs[_0xf2fe('0x3d')](_0xa1e497[_0xf2fe('0x35')][_0xf2fe('0x3d')]);_0x4276e9['where']=qs['filters'](_[_0xf2fe('0x3f')](_0xa1e497[_0xf2fe('0x35')],_0x4828cd['filters']));if(_0xa1e497['query'][_0xf2fe('0x40')]){_0x4276e9[_0xf2fe('0x3e')]=_[_0xf2fe('0x42')](_0x4276e9[_0xf2fe('0x3e')],{'$or':_[_0xf2fe('0x34')](_0x4276e9[_0xf2fe('0x38')],function(_0x1e9174){var _0x2f81ff={};_0x2f81ff[_0x1e9174]={'$like':'%'+_0xa1e497['query'][_0xf2fe('0x40')]+'%'};return _0x2f81ff;})});}_0x4276e9=_['merge']({},_0x4276e9,_0xa1e497[_0xf2fe('0x81')]);return _0x56d3e8['getItems'](_0x4276e9);}})[_0xf2fe('0x28')](function(_0x22f1ff){if(_0x22f1ff){_0x55f0b3=_0x22f1ff[_0xf2fe('0x3a')];if(!_0xa1e497['query'][_0xf2fe('0x3b')](_0xf2fe('0x3c'))){_0x4276e9[_0xf2fe('0x21')]=qs['limit'](_0xa1e497[_0xf2fe('0x35')][_0xf2fe('0x21')]);_0x4276e9[_0xf2fe('0x1e')]=qs[_0xf2fe('0x1e')](_0xa1e497[_0xf2fe('0x35')]['offset']);}return _0x56d3e8[_0xf2fe('0x7d')](_0x4276e9);}})[_0xf2fe('0x28')](function(_0x8ecd6b){if(_0x8ecd6b){return _0x8ecd6b?{'count':_0x55f0b3,'rows':_0x8ecd6b}:null;}})[_0xf2fe('0x28')](respondWithResult(_0x5520e2,null))['catch'](handleError(_0x5520e2,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index feea3a5..858cd03 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 _0x0810=['update','remove','emit','hasOwnProperty','hook','exports','Dashboard','save'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x0810,0x1e6));var _0x0081=function(_0x339eee,_0x38d50e){_0x339eee=_0x339eee-0x0;var _0x111b0e=_0x0810[_0x339eee];return _0x111b0e;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x0081('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0081('0x1'),'afterUpdate':_0x0081('0x2'),'afterDestroy':_0x0081('0x3')};function emitEvent(_0x5018a7){return function(_0x3ca3cc,_0xd62f7c,_0x1c34db){DashboardEvents[_0x0081('0x4')](_0x5018a7+':'+_0x3ca3cc['id'],_0x3ca3cc);DashboardEvents[_0x0081('0x4')](_0x5018a7,_0x3ca3cc);_0x1c34db(null);};}for(var e in events){if(events[_0x0081('0x5')](e)){var event=events[e];Dashboard[_0x0081('0x6')](e,emitEvent(event));}}module[_0x0081('0x7')]=DashboardEvents; \ No newline at end of file +var _0x5153=['remove','emit','exports','events','save','update'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x5153,0x159));var _0x3515=function(_0x2aa407,_0x41ef5b){_0x2aa407=_0x2aa407-0x0;var _0x11a8cf=_0x5153[_0x2aa407];return _0x11a8cf;};'use strict';var EventEmitter=require(_0x3515('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3515('0x1'),'afterUpdate':_0x3515('0x2'),'afterDestroy':_0x3515('0x3')};function emitEvent(_0x4a3292){return function(_0xb829be,_0x113fd9,_0x257f85){DashboardEvents['emit'](_0x4a3292+':'+_0xb829be['id'],_0xb829be);DashboardEvents[_0x3515('0x4')](_0x4a3292,_0xb829be);_0x257f85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x3515('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index a6b4065..f70e127 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 _0xe075=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','util','../../config/logger'];(function(_0x485ed6,_0x5f4f9d){var _0x41c250=function(_0x3beff6){while(--_0x3beff6){_0x485ed6['push'](_0x485ed6['shift']());}};_0x41c250(++_0x5f4f9d);}(_0xe075,0x143));var _0x5e07=function(_0x4eea5a,_0x12df85){_0x4eea5a=_0x4eea5a-0x0;var _0x53d8a5=_0xe075[_0x4eea5a];return _0x53d8a5;};'use strict';var _=require('lodash');var util=require(_0x5e07('0x0'));var logger=require(_0x5e07('0x1'))(_0x5e07('0x2'));var moment=require(_0x5e07('0x3'));var BPromise=require(_0x5e07('0x4'));var rp=require(_0x5e07('0x5'));var fs=require('fs');var path=require(_0x5e07('0x6'));var rimraf=require(_0x5e07('0x7'));var config=require(_0x5e07('0x8'));var attributes=require(_0x5e07('0x9'));module[_0x5e07('0xa')]=function(_0x2a466b,_0x5b9b46){return _0x2a466b[_0x5e07('0xb')](_0x5e07('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84d1=['rimraf','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x84d1,0x119));var _0x184d=function(_0x450d4e,_0xcacc3){_0x450d4e=_0x450d4e-0x0;var _0x300304=_0x84d1[_0x450d4e];return _0x300304;};'use strict';var _=require(_0x184d('0x0'));var util=require(_0x184d('0x1'));var logger=require('../../config/logger')(_0x184d('0x2'));var moment=require(_0x184d('0x3'));var BPromise=require(_0x184d('0x4'));var rp=require(_0x184d('0x5'));var fs=require('fs');var path=require(_0x184d('0x6'));var rimraf=require(_0x184d('0x7'));var config=require('../../config/environment');var attributes=require(_0x184d('0x8'));module[_0x184d('0x9')]=function(_0x7eafd3,_0x46ae9f){return _0x7eafd3['define'](_0x184d('0xa'),attributes,{'tableName':_0x184d('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 2d3b63b..315a3fb 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 _0x0347=['http','redis','defaults','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x5a979b,_0x2ca750){var _0x35f85a=function(_0x2a6706){while(--_0x2a6706){_0x5a979b['push'](_0x5a979b['shift']());}};_0x35f85a(++_0x2ca750);}(_0x0347,0x15f));var _0x7034=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0347[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x7034('0x0'));var util=require(_0x7034('0x1'));var moment=require(_0x7034('0x2'));var BPromise=require('bluebird');var rs=require(_0x7034('0x3'));var fs=require('fs');var Redis=require(_0x7034('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7034('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7034('0x6'));var jayson=require(_0x7034('0x7'));var client=jayson[_0x7034('0x8')][_0x7034('0x9')]({'port':0x232a});config[_0x7034('0xa')]=_[_0x7034('0xb')](config[_0x7034('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7034('0xa')]));require(_0x7034('0xc'))[_0x7034('0xd')](socket);function respondWithRpcPromise(_0x208f80,_0x2316de,_0x44b8f5){return new BPromise(function(_0x192470,_0x1a5bcf){return client[_0x7034('0xe')](_0x208f80,_0x44b8f5)[_0x7034('0xf')](function(_0x38e41e){logger[_0x7034('0x10')](_0x7034('0x11'),_0x2316de,'request\x20sent');logger[_0x7034('0x12')](_0x7034('0x13'),_0x2316de,_0x7034('0x14'),JSON['stringify'](_0x38e41e));if(_0x38e41e[_0x7034('0x15')]){if(_0x38e41e[_0x7034('0x15')]['code']===0x1f4){logger[_0x7034('0x15')]('Dashboard,\x20%s,\x20%s',_0x2316de,_0x38e41e[_0x7034('0x15')][_0x7034('0x16')]);return _0x1a5bcf(_0x38e41e[_0x7034('0x15')][_0x7034('0x16')]);}logger['error'](_0x7034('0x11'),_0x2316de,_0x38e41e[_0x7034('0x15')]['message']);return _0x192470(_0x38e41e[_0x7034('0x15')][_0x7034('0x16')]);}else{logger[_0x7034('0x10')]('Dashboard,\x20%s,\x20%s',_0x2316de,_0x7034('0x14'));_0x192470(_0x38e41e['result'][_0x7034('0x16')]);}})[_0x7034('0x17')](function(_0x17a3f4){logger[_0x7034('0x15')](_0x7034('0x11'),_0x2316de,_0x17a3f4);_0x1a5bcf(_0x17a3f4);});});} \ No newline at end of file +var _0x82ee=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x1ebf97,_0x2a2f07){var _0x22ef2a=function(_0x269295){while(--_0x269295){_0x1ebf97['push'](_0x1ebf97['shift']());}};_0x22ef2a(++_0x2a2f07);}(_0x82ee,0x199));var _0xe82e=function(_0x2a158a,_0x293669){_0x2a158a=_0x2a158a-0x0;var _0x577405=_0x82ee[_0x2a158a];return _0x577405;};'use strict';var _=require('lodash');var util=require(_0xe82e('0x0'));var moment=require('moment');var BPromise=require(_0xe82e('0x1'));var rs=require(_0xe82e('0x2'));var fs=require('fs');var Redis=require(_0xe82e('0x3'));var db=require(_0xe82e('0x4'))['db'];var utils=require(_0xe82e('0x5'));var logger=require(_0xe82e('0x6'))(_0xe82e('0x7'));var config=require(_0xe82e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe82e('0x9')][_0xe82e('0xa')]({'port':0x232a});config[_0xe82e('0xb')]=_[_0xe82e('0xc')](config[_0xe82e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe82e('0xd'))(new Redis(config[_0xe82e('0xb')]));require('./dashboard.socket')[_0xe82e('0xe')](socket);function respondWithRpcPromise(_0x4865db,_0x4cde61,_0xcc1cc){return new BPromise(function(_0x350cd1,_0x49a875){return client[_0xe82e('0xf')](_0x4865db,_0xcc1cc)[_0xe82e('0x10')](function(_0x180372){logger[_0xe82e('0x11')](_0xe82e('0x12'),_0x4cde61,_0xe82e('0x13'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x4cde61,_0xe82e('0x13'),JSON[_0xe82e('0x14')](_0x180372));if(_0x180372[_0xe82e('0x15')]){if(_0x180372['error'][_0xe82e('0x16')]===0x1f4){logger[_0xe82e('0x15')](_0xe82e('0x12'),_0x4cde61,_0x180372[_0xe82e('0x15')][_0xe82e('0x17')]);return _0x49a875(_0x180372['error'][_0xe82e('0x17')]);}logger['error'](_0xe82e('0x12'),_0x4cde61,_0x180372['error'][_0xe82e('0x17')]);return _0x350cd1(_0x180372[_0xe82e('0x15')][_0xe82e('0x17')]);}else{logger['info'](_0xe82e('0x12'),_0x4cde61,_0xe82e('0x13'));_0x350cd1(_0x180372[_0xe82e('0x18')][_0xe82e('0x17')]);}})['catch'](function(_0x24d1f2){logger[_0xe82e('0x15')](_0xe82e('0x12'),_0x4cde61,_0x24d1f2);_0x49a875(_0x24d1f2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 0705760..3f66237 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 _0xe14c=['emit','removeListener','register','length','dashboard:','save','remove','update'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0xe14c,0x9d));var _0xce14=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe14c[_0x2dafbe];return _0x58a45a;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xce14('0x0'),_0xce14('0x1'),_0xce14('0x2')];function createListener(_0x1747b3,_0x53abab){return function(_0x34c65e){_0x53abab[_0xce14('0x3')](_0x1747b3,_0x34c65e);};}function removeListener(_0x4bedf7,_0x34feb2){return function(){DashboardEvents[_0xce14('0x4')](_0x4bedf7,_0x34feb2);};}exports[_0xce14('0x5')]=function(_0x3b91f6){for(var _0x2721aa=0x0,_0x40eecd=events[_0xce14('0x6')];_0x2721aa<_0x40eecd;_0x2721aa++){var _0x18b755=events[_0x2721aa];var _0x3d3abc=createListener(_0xce14('0x7')+_0x18b755,_0x3b91f6);DashboardEvents['on'](_0x18b755,_0x3d3abc);}}; \ No newline at end of file +var _0x10d9=['removeListener','length','dashboard:','./dashboard.events','save','remove'];(function(_0x3f283a,_0x5ac55e){var _0xa6f5ff=function(_0x200875){while(--_0x200875){_0x3f283a['push'](_0x3f283a['shift']());}};_0xa6f5ff(++_0x5ac55e);}(_0x10d9,0x1dd));var _0x910d=function(_0x3dbec6,_0x331852){_0x3dbec6=_0x3dbec6-0x0;var _0x144943=_0x10d9[_0x3dbec6];return _0x144943;};'use strict';var DashboardEvents=require(_0x910d('0x0'));var events=[_0x910d('0x1'),_0x910d('0x2'),'update'];function createListener(_0x480d16,_0x320679){return function(_0x50b752){_0x320679['emit'](_0x480d16,_0x50b752);};}function removeListener(_0x510462,_0x2aa0c0){return function(){DashboardEvents[_0x910d('0x3')](_0x510462,_0x2aa0c0);};}exports['register']=function(_0x4bedce){for(var _0x37c1d4=0x0,_0x22c330=events[_0x910d('0x4')];_0x37c1d4<_0x22c330;_0x37c1d4++){var _0x15c220=events[_0x37c1d4];var _0x1e6fff=createListener(_0x910d('0x5')+_0x15c220,_0x4bedce);DashboardEvents['on'](_0x15c220,_0x1e6fff);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index a568809..fb963b4 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 _0x28ff=['put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem'];(function(_0x5673c4,_0x5b672d){var _0x32b859=function(_0x4aa620){while(--_0x4aa620){_0x5673c4['push'](_0x5673c4['shift']());}};_0x32b859(++_0x5b672d);}(_0x28ff,0x1de));var _0xf28f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x28ff[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xf28f('0x0'));var util=require(_0xf28f('0x1'));var path=require(_0xf28f('0x2'));var timeout=require(_0xf28f('0x3'));var express=require(_0xf28f('0x4'));var router=express['Router']();var fs_extra=require(_0xf28f('0x5'));var auth=require(_0xf28f('0x6'));var interaction=require(_0xf28f('0x7'));var config=require(_0xf28f('0x8'));var controller=require(_0xf28f('0x9'));router['get']('/',auth[_0xf28f('0xa')](),controller[_0xf28f('0xb')]);router[_0xf28f('0xc')](_0xf28f('0xd'),auth[_0xf28f('0xa')](),controller[_0xf28f('0xe')]);router[_0xf28f('0xc')](_0xf28f('0xf'),auth[_0xf28f('0xa')](),controller[_0xf28f('0x10')]);router[_0xf28f('0x11')]('/',auth[_0xf28f('0xa')](),controller[_0xf28f('0x12')]);router['post'](_0xf28f('0x13'),auth[_0xf28f('0xa')](),controller[_0xf28f('0x14')]);router[_0xf28f('0x11')]('/:id/items',auth[_0xf28f('0xa')](),controller[_0xf28f('0x15')]);router[_0xf28f('0x16')](_0xf28f('0xd'),auth[_0xf28f('0xa')](),controller['update']);router[_0xf28f('0x17')]('/:id',auth[_0xf28f('0xa')](),controller[_0xf28f('0x18')]);module['exports']=router; \ No newline at end of file +var _0x715a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','post','create','/:id/clone','clone','addItem','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0xc522,_0x2e0bfd){var _0x32849e=function(_0x398e90){while(--_0x398e90){_0xc522['push'](_0xc522['shift']());}};_0x32849e(++_0x2e0bfd);}(_0x715a,0x110));var _0xa715=function(_0x10c98d,_0x1e5cbf){_0x10c98d=_0x10c98d-0x0;var _0x509663=_0x715a[_0x10c98d];return _0x509663;};'use strict';var multer=require('multer');var util=require(_0xa715('0x0'));var path=require(_0xa715('0x1'));var timeout=require(_0xa715('0x2'));var express=require(_0xa715('0x3'));var router=express[_0xa715('0x4')]();var fs_extra=require(_0xa715('0x5'));var auth=require(_0xa715('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa715('0x7'));var controller=require('./dashboard.controller');router[_0xa715('0x8')]('/',auth['isAuthenticated'](),controller[_0xa715('0x9')]);router[_0xa715('0x8')]('/:id',auth[_0xa715('0xa')](),controller[_0xa715('0xb')]);router['get']('/:id/items',auth[_0xa715('0xa')](),controller['getItems']);router[_0xa715('0xc')]('/',auth['isAuthenticated'](),controller[_0xa715('0xd')]);router[_0xa715('0xc')](_0xa715('0xe'),auth['isAuthenticated'](),controller[_0xa715('0xf')]);router[_0xa715('0xc')]('/:id/items',auth[_0xa715('0xa')](),controller[_0xa715('0x10')]);router[_0xa715('0x11')]('/:id',auth[_0xa715('0xa')](),controller[_0xa715('0x12')]);router[_0xa715('0x13')](_0xa715('0x14'),auth[_0xa715('0xa')](),controller[_0xa715('0x15')]);module[_0xa715('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index d6d5692..53b6c1f 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 _0x0295=['#ffffff','sequelize','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','STRING'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0x0295,0x1f0));var _0x5029=function(_0x233ab2,_0x43cd05){_0x233ab2=_0x233ab2-0x0;var _0x4d893f=_0x0295[_0x233ab2];return _0x4d893f;};'use strict';var Sequelize=require(_0x5029('0x0'));var squel=require('squel');var _=require('lodash');module[_0x5029('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5029('0x2')](_0x5029('0x3')),'get':function(){try{return JSON[_0x5029('0x4')](this[_0x5029('0x5')](_0x5029('0x6')));}catch(_0x69a497){return[];}},'set':function(_0x200217){try{this[_0x5029('0x7')](_0x5029('0x6'),JSON['stringify'](_0x200217));}catch(_0x54978f){this['setDataValue'](_0x5029('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5029('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5029('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':_0x5029('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5029('0x9')]},'titleFontSize':{'type':Sequelize[_0x5029('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0x31f0=['INTEGER','#ffffff','#2196f3','sequelize','lodash','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify'];(function(_0x202094,_0x3be3e3){var _0x3fb4ae=function(_0x5b9ae5){while(--_0x5b9ae5){_0x202094['push'](_0x202094['shift']());}};_0x3fb4ae(++_0x3be3e3);}(_0x31f0,0xb7));var _0x031f=function(_0x23375c,_0x4b0e8e){_0x23375c=_0x23375c-0x0;var _0x3dd431=_0x31f0[_0x23375c];return _0x3dd431;};'use strict';var Sequelize=require(_0x031f('0x0'));var squel=require('squel');var _=require(_0x031f('0x1'));module['exports']={'title':{'type':Sequelize[_0x031f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x031f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x031f('0x3')](_0x031f('0x4')),'get':function(){try{return JSON['parse'](this[_0x031f('0x5')](_0x031f('0x6')));}catch(_0x4f6059){return[];}},'set':function(_0x4c0f94){try{this['setDataValue'](_0x031f('0x6'),JSON['stringify'](_0x4c0f94));}catch(_0x365f59){this[_0x031f('0x7')](_0x031f('0x6'),JSON[_0x031f('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x031f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x031f('0x9')]},'col':{'type':Sequelize[_0x031f('0x9')]},'background':{'type':Sequelize[_0x031f('0x2')],'allowNull':![],'defaultValue':_0x031f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x031f('0x2')],'allowNull':![],'defaultValue':_0x031f('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x031f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 227e745..c1f72d4 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 _0xe9e7=['params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','model','keys','query','intersection','attributes','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','iframe','attrs','https://','custom','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','reportType','type','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body'];(function(_0x1ca993,_0x243c1e){var _0x150e5e=function(_0xaf1a3e){while(--_0xaf1a3e){_0x1ca993['push'](_0x1ca993['shift']());}};_0x150e5e(++_0x243c1e);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x4c7866,_0xe0c06d){_0x4c7866=_0x4c7866-0x0;var _0x29053e=_0xe9e7[_0x4c7866];return _0x29053e;};'use strict';var emlformat=require(_0x7e9e('0x0'));var rimraf=require(_0x7e9e('0x1'));var zipdir=require(_0x7e9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e9e('0x3'));var moment=require(_0x7e9e('0x4'));var BPromise=require(_0x7e9e('0x5'));var Mustache=require(_0x7e9e('0x6'));var util=require(_0x7e9e('0x7'));var path=require(_0x7e9e('0x8'));var sox=require(_0x7e9e('0x9'));var csv=require('to-csv');var ejs=require(_0x7e9e('0xa'));var fs=require('fs');var fs_extra=require(_0x7e9e('0xb'));var _=require(_0x7e9e('0xc'));var squel=require('squel');var crypto=require(_0x7e9e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7e9e('0xe'));var toCsv=require(_0x7e9e('0xf'));var querystring=require(_0x7e9e('0x10'));var Papa=require(_0x7e9e('0x11'));var Redis=require(_0x7e9e('0x12'));var authService=require(_0x7e9e('0x13'));var qs=require(_0x7e9e('0x14'));var as=require(_0x7e9e('0x15'));var hardwareService=require(_0x7e9e('0x16'));var logger=require(_0x7e9e('0x17'))(_0x7e9e('0x18'));var utils=require(_0x7e9e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7e9e('0x1a')]=_[_0x7e9e('0x1b')](config[_0x7e9e('0x1a')],{'host':_0x7e9e('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e9e('0x1d'))[_0x7e9e('0x1e')](socket);function respondWithStatusCode(_0x1b59d1,_0x299be7){_0x299be7=_0x299be7||0xcc;return function(_0x3eeae2){if(_0x3eeae2){return _0x1b59d1[_0x7e9e('0x1f')](_0x299be7);}return _0x1b59d1[_0x7e9e('0x20')](_0x299be7)['end']();};}function respondWithResult(_0x428312,_0x4f38d5){_0x4f38d5=_0x4f38d5||0xc8;return function(_0x3a1a89){if(_0x3a1a89){return _0x428312[_0x7e9e('0x20')](_0x4f38d5)[_0x7e9e('0x21')](_0x3a1a89);}};}function respondWithFilteredResult(_0x1d973c,_0x35af37){return function(_0x11f414){if(_0x11f414){var _0x15cd67=typeof _0x35af37['offset']===_0x7e9e('0x22')&&typeof _0x35af37[_0x7e9e('0x23')]==='undefined';var _0x52358b=_0x11f414[_0x7e9e('0x24')];var _0x58eef4=_0x15cd67?0x0:_0x35af37['offset'];var _0x21a466=_0x15cd67?_0x11f414[_0x7e9e('0x24')]:_0x35af37[_0x7e9e('0x25')]+_0x35af37[_0x7e9e('0x23')];var _0x2654d3;if(_0x21a466>=_0x52358b){_0x21a466=_0x52358b;_0x2654d3=0xc8;}else{_0x2654d3=0xce;}_0x1d973c[_0x7e9e('0x20')](_0x2654d3);return _0x1d973c[_0x7e9e('0x26')](_0x7e9e('0x27'),_0x58eef4+'-'+_0x21a466+'/'+_0x52358b)[_0x7e9e('0x21')](_0x11f414);}return null;};}function patchUpdates(_0x5206df){return function(_0x3d7d43){try{jsonpatch[_0x7e9e('0x28')](_0x3d7d43,_0x5206df,!![]);}catch(_0x1dc4c9){return BPromise[_0x7e9e('0x29')](_0x1dc4c9);}return _0x3d7d43['save']();};}function saveUpdates(_0x15bb40,_0x10910d){return function(_0x1e0a32){if(_0x1e0a32){return _0x1e0a32[_0x7e9e('0x2a')](_0x15bb40)[_0x7e9e('0x2b')](function(_0xeaa799){return _0xeaa799;});}return null;};}function removeEntity(_0x3df586,_0x54f7b5){return function(_0x2b4df6){if(_0x2b4df6){return _0x2b4df6[_0x7e9e('0x2c')]()[_0x7e9e('0x2b')](function(){_0x3df586[_0x7e9e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b61b4,_0x3f6655){return function(_0x1e7ece){if(!_0x1e7ece){_0x1b61b4[_0x7e9e('0x1f')](0x194);}return _0x1e7ece;};}function handleError(_0x4a2a1c,_0x398025){_0x398025=_0x398025||0x1f4;return function(_0x5da39e){logger[_0x7e9e('0x2d')](_0x5da39e[_0x7e9e('0x2e')]);if(_0x5da39e[_0x7e9e('0x2f')]){delete _0x5da39e[_0x7e9e('0x2f')];}_0x4a2a1c[_0x7e9e('0x20')](_0x398025)[_0x7e9e('0x30')](_0x5da39e);};}exports[_0x7e9e('0x31')]=function(_0x25774c,_0x52634e){var _0x5c33e1={'raw':![],'where':{'id':_0x25774c['params']['id']}},_0x2d9c81={};_0x2d9c81[_0x7e9e('0x32')]=_[_0x7e9e('0x33')](db['DashboardItem']['rawAttributes']);_0x2d9c81[_0x7e9e('0x34')]=_[_0x7e9e('0x33')](_0x25774c['query']);_0x2d9c81['filters']=_[_0x7e9e('0x35')](_0x2d9c81['model'],_0x2d9c81[_0x7e9e('0x34')]);_0x5c33e1[_0x7e9e('0x36')]=_['intersection'](_0x2d9c81[_0x7e9e('0x32')],qs[_0x7e9e('0x37')](_0x25774c['query'][_0x7e9e('0x37')]));_0x5c33e1[_0x7e9e('0x36')]=_0x5c33e1[_0x7e9e('0x36')][_0x7e9e('0x38')]?_0x5c33e1['attributes']:_0x2d9c81[_0x7e9e('0x32')];if(_0x25774c['query'][_0x7e9e('0x39')]){_0x5c33e1[_0x7e9e('0x3a')]=[{'all':!![]}];}_0x5c33e1=_[_0x7e9e('0x3b')]({},_0x5c33e1,_0x25774c[_0x7e9e('0x3c')]);return db[_0x7e9e('0x3d')][_0x7e9e('0x3e')](_0x5c33e1)['then'](handleEntityNotFound(_0x52634e,null))[_0x7e9e('0x2b')](respondWithResult(_0x52634e,null))['catch'](handleError(_0x52634e,null));};exports[_0x7e9e('0x2c')]=function(_0x3aeead,_0x19fb3b){return db['DashboardItem']['find']({'where':{'id':_0x3aeead['params']['id']}})[_0x7e9e('0x2b')](handleEntityNotFound(_0x19fb3b,null))[_0x7e9e('0x2b')](removeEntity(_0x19fb3b,null))[_0x7e9e('0x3f')](handleError(_0x19fb3b,null));};function widgetAttributes(_0x261ce9){try{switch(_0x261ce9['type']){case _0x7e9e('0x40'):return[{'name':'attrUrl','value':_0x261ce9['attrUrl']||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9[_0x7e9e('0x41')][0x0]['value']:undefined)||_0x7e9e('0x42')}];case _0x7e9e('0x43'):return[{'name':_0x7e9e('0x44'),'value':_0x261ce9['attrPath']||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9[_0x7e9e('0x41')][0x0][_0x7e9e('0x45')]:undefined)||''}];case _0x7e9e('0x46'):return[{'name':'attrHourFormat','value':_0x261ce9['attrHourFormat']||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9['attrs'][0x0][_0x7e9e('0x45')]:undefined)||_0x7e9e('0x47')},{'name':_0x7e9e('0x48'),'value':_0x261ce9[_0x7e9e('0x48')]||(_0x261ce9['attrs']&&_0x261ce9[_0x7e9e('0x41')][0x1]?_0x261ce9[_0x7e9e('0x41')][0x1]['value']:undefined)||_0x7e9e('0x49')},{'name':_0x7e9e('0x4a'),'value':_0x261ce9[_0x7e9e('0x4a')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9['attrs'][0x2]?_0x261ce9['attrs'][0x2][_0x7e9e('0x45')]:undefined)||0xc}];case _0x7e9e('0x4b'):return[{'name':_0x7e9e('0x4c'),'value':_0x261ce9[_0x7e9e('0x4c')]||(_0x261ce9['attrs']&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9[_0x7e9e('0x41')][0x0][_0x7e9e('0x45')]:undefined)||_0x7e9e('0x4d')},{'name':'attrVoiceQueues','value':_0x261ce9['attrVoiceQueues']||(_0x261ce9['attrs']&&_0x261ce9[_0x7e9e('0x41')][0x1]?_0x261ce9[_0x7e9e('0x41')][0x1][_0x7e9e('0x45')]:undefined)||[]},{'name':_0x7e9e('0x4a'),'value':_0x261ce9[_0x7e9e('0x4a')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x2]?_0x261ce9['attrs'][0x2][_0x7e9e('0x45')]:undefined)||0x14},{'name':_0x7e9e('0x4e'),'value':_0x261ce9[_0x7e9e('0x4e')]||(_0x261ce9['attrs']&&_0x261ce9['attrs'][0x3]?_0x261ce9[_0x7e9e('0x41')][0x3][_0x7e9e('0x45')]:undefined)||_0x7e9e('0x4f')},{'name':_0x7e9e('0x50'),'value':_0x261ce9[_0x7e9e('0x50')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x4]?_0x261ce9[_0x7e9e('0x41')][0x4][_0x7e9e('0x45')]:undefined)||''},{'name':_0x7e9e('0x51'),'value':_0x261ce9[_0x7e9e('0x51')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x5]?_0x261ce9['attrs'][0x5][_0x7e9e('0x45')]:undefined)||''},{'name':_0x7e9e('0x52'),'value':_0x261ce9[_0x7e9e('0x52')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x6]?_0x261ce9[_0x7e9e('0x41')][0x6][_0x7e9e('0x45')]:undefined)||''},{'name':_0x7e9e('0x53'),'value':_0x261ce9[_0x7e9e('0x53')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9['attrs'][0x7]?_0x261ce9[_0x7e9e('0x41')][0x7][_0x7e9e('0x45')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x261ce9[_0x7e9e('0x54')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x8]?_0x261ce9[_0x7e9e('0x41')][0x8][_0x7e9e('0x45')]:undefined)||''},{'name':_0x7e9e('0x55'),'value':_0x261ce9[_0x7e9e('0x55')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x9]?_0x261ce9[_0x7e9e('0x41')][0x9][_0x7e9e('0x45')]:undefined)||''}];case'multibar-chart':case _0x7e9e('0x56'):return[{'name':_0x7e9e('0x57'),'value':_0x261ce9[_0x7e9e('0x57')]||(_0x261ce9['attrs']&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9[_0x7e9e('0x41')][0x0][_0x7e9e('0x45')]:undefined)||_0x7e9e('0x4d')},{'name':_0x7e9e('0x58'),'value':_0x261ce9[_0x7e9e('0x58')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x1]?_0x261ce9[_0x7e9e('0x41')][0x1][_0x7e9e('0x45')]:undefined)||null},{'name':_0x7e9e('0x59'),'value':_0x261ce9[_0x7e9e('0x59')]||(_0x261ce9['attrs']&&_0x261ce9[_0x7e9e('0x41')][0x2]?_0x261ce9[_0x7e9e('0x41')][0x2][_0x7e9e('0x45')]:undefined)||null},{'name':_0x7e9e('0x5a'),'value':_0x261ce9[_0x7e9e('0x5a')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x3]?_0x261ce9['attrs'][0x3][_0x7e9e('0x45')]:undefined)||[]},{'name':'attrChannel','value':_0x261ce9['attrChannel']||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x4]?_0x261ce9['attrs'][0x4][_0x7e9e('0x45')]:undefined)||_0x7e9e('0x4f')},{'name':_0x7e9e('0x50'),'value':_0x261ce9[_0x7e9e('0x50')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9['attrs'][0x5]?_0x261ce9['attrs'][0x5]['value']:undefined)||''},{'name':_0x7e9e('0x51'),'value':_0x261ce9[_0x7e9e('0x51')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x6]?_0x261ce9[_0x7e9e('0x41')][0x6]['value']:undefined)||''},{'name':_0x7e9e('0x52'),'value':_0x261ce9[_0x7e9e('0x52')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x7]?_0x261ce9['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x261ce9[_0x7e9e('0x53')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x8]?_0x261ce9['attrs'][0x8][_0x7e9e('0x45')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x261ce9[_0x7e9e('0x54')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x9]?_0x261ce9[_0x7e9e('0x41')][0x9][_0x7e9e('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x261ce9['attrChatWebsites']||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0xa]?_0x261ce9[_0x7e9e('0x41')][0xa][_0x7e9e('0x45')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x261ce9[_0x7e9e('0x5b')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9[_0x7e9e('0x41')][0x0][_0x7e9e('0x5c')]:undefined)||null,'value':_0x261ce9[_0x7e9e('0x5d')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x0]?_0x261ce9[_0x7e9e('0x41')][0x0][_0x7e9e('0x45')]:undefined)||null},{'name':_0x7e9e('0x5e'),'value':_0x261ce9[_0x7e9e('0x5e')]||(_0x261ce9[_0x7e9e('0x41')]&&_0x261ce9[_0x7e9e('0x41')][0x1]?_0x261ce9[_0x7e9e('0x41')][0x1][_0x7e9e('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x4b94b9){logger[_0x7e9e('0x2d')](_0x7e9e('0x5f'),JSON['stringify'](_0x4b94b9));return[];}}exports[_0x7e9e('0x60')]=function(_0x1abcb2,_0x2d8ebc){if(_0x1abcb2['body']){_0x1abcb2['body'][_0x7e9e('0x41')]=widgetAttributes(_0x1abcb2[_0x7e9e('0x61')]);}return db[_0x7e9e('0x3d')][_0x7e9e('0x60')](_0x1abcb2[_0x7e9e('0x61')],{})[_0x7e9e('0x2b')](respondWithResult(_0x2d8ebc,0xc9))[_0x7e9e('0x3f')](handleError(_0x2d8ebc,null));};exports[_0x7e9e('0x2a')]=function(_0xe86cf6,_0x5ad81d){if(_0xe86cf6[_0x7e9e('0x61')]['id']){delete _0xe86cf6[_0x7e9e('0x61')]['id'];}_0xe86cf6[_0x7e9e('0x61')][_0x7e9e('0x41')]=widgetAttributes(_0xe86cf6[_0x7e9e('0x61')]);return db[_0x7e9e('0x3d')]['find']({'where':{'id':_0xe86cf6[_0x7e9e('0x62')]['id']}})['then'](handleEntityNotFound(_0x5ad81d,null))[_0x7e9e('0x2b')](saveUpdates(_0xe86cf6[_0x7e9e('0x61')],null))[_0x7e9e('0x2b')](respondWithResult(_0x5ad81d,null))[_0x7e9e('0x3f')](handleError(_0x5ad81d,null));}; \ No newline at end of file +var _0x741c=['attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','stack','name','send','show','params','model','DashboardItem','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter'];(function(_0x20cd49,_0x4ddeda){var _0x2a549e=function(_0x5ca39d){while(--_0x5ca39d){_0x20cd49['push'](_0x20cd49['shift']());}};_0x2a549e(++_0x4ddeda);}(_0x741c,0x196));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xc741('0x0'));var rimraf=require(_0xc741('0x1'));var zipdir=require(_0xc741('0x2'));var jsonpatch=require(_0xc741('0x3'));var rp=require(_0xc741('0x4'));var moment=require(_0xc741('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc741('0x6'));var path=require('path');var sox=require(_0xc741('0x7'));var csv=require(_0xc741('0x8'));var ejs=require(_0xc741('0x9'));var fs=require('fs');var fs_extra=require(_0xc741('0xa'));var _=require(_0xc741('0xb'));var squel=require(_0xc741('0xc'));var crypto=require(_0xc741('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc741('0xe'));var toCsv=require(_0xc741('0x8'));var querystring=require('querystring');var Papa=require(_0xc741('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc741('0x10'));var as=require(_0xc741('0x11'));var hardwareService=require(_0xc741('0x12'));var logger=require(_0xc741('0x13'))(_0xc741('0x14'));var utils=require(_0xc741('0x15'));var config=require(_0xc741('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc741('0x17')](config[_0xc741('0x18')],{'host':_0xc741('0x19'),'port':0x18eb});var socket=require(_0xc741('0x1a'))(new Redis(config[_0xc741('0x18')]));require('./dashboardItem.socket')[_0xc741('0x1b')](socket);function respondWithStatusCode(_0x3d2f62,_0x4c190d){_0x4c190d=_0x4c190d||0xcc;return function(_0xc0383){if(_0xc0383){return _0x3d2f62[_0xc741('0x1c')](_0x4c190d);}return _0x3d2f62[_0xc741('0x1d')](_0x4c190d)[_0xc741('0x1e')]();};}function respondWithResult(_0x21514e,_0x5bbe86){_0x5bbe86=_0x5bbe86||0xc8;return function(_0x4dcf16){if(_0x4dcf16){return _0x21514e[_0xc741('0x1d')](_0x5bbe86)['json'](_0x4dcf16);}};}function respondWithFilteredResult(_0x1c4f3a,_0x3903c6){return function(_0x575184){if(_0x575184){var _0x552ecf=typeof _0x3903c6[_0xc741('0x1f')]===_0xc741('0x20')&&typeof _0x3903c6[_0xc741('0x21')]==='undefined';var _0x19d598=_0x575184[_0xc741('0x22')];var _0x475348=_0x552ecf?0x0:_0x3903c6[_0xc741('0x1f')];var _0x16cd1b=_0x552ecf?_0x575184[_0xc741('0x22')]:_0x3903c6[_0xc741('0x1f')]+_0x3903c6[_0xc741('0x21')];var _0x2a74da;if(_0x16cd1b>=_0x19d598){_0x16cd1b=_0x19d598;_0x2a74da=0xc8;}else{_0x2a74da=0xce;}_0x1c4f3a['status'](_0x2a74da);return _0x1c4f3a[_0xc741('0x23')]('Content-Range',_0x475348+'-'+_0x16cd1b+'/'+_0x19d598)[_0xc741('0x24')](_0x575184);}return null;};}function patchUpdates(_0x4b5b31){return function(_0xd498b){try{jsonpatch[_0xc741('0x25')](_0xd498b,_0x4b5b31,!![]);}catch(_0x38e752){return BPromise['reject'](_0x38e752);}return _0xd498b[_0xc741('0x26')]();};}function saveUpdates(_0x5a89bd,_0x1b19c5){return function(_0x28a041){if(_0x28a041){return _0x28a041[_0xc741('0x27')](_0x5a89bd)['then'](function(_0x53bdad){return _0x53bdad;});}return null;};}function removeEntity(_0x4ac9e3,_0x178a57){return function(_0x33ba51){if(_0x33ba51){return _0x33ba51[_0xc741('0x28')]()[_0xc741('0x29')](function(){_0x4ac9e3[_0xc741('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f63db,_0x183764){return function(_0x11c65e){if(!_0x11c65e){_0x4f63db[_0xc741('0x1c')](0x194);}return _0x11c65e;};}function handleError(_0x328793,_0x57f6fc){_0x57f6fc=_0x57f6fc||0x1f4;return function(_0x378ab5){logger['error'](_0x378ab5[_0xc741('0x2a')]);if(_0x378ab5[_0xc741('0x2b')]){delete _0x378ab5['name'];}_0x328793[_0xc741('0x1d')](_0x57f6fc)[_0xc741('0x2c')](_0x378ab5);};}exports[_0xc741('0x2d')]=function(_0x1ce361,_0x3b66ae){var _0x3bb9b1={'raw':![],'where':{'id':_0x1ce361[_0xc741('0x2e')]['id']}},_0x3b3703={};_0x3b3703[_0xc741('0x2f')]=_['keys'](db[_0xc741('0x30')]['rawAttributes']);_0x3b3703[_0xc741('0x31')]=_['keys'](_0x1ce361['query']);_0x3b3703[_0xc741('0x32')]=_[_0xc741('0x33')](_0x3b3703[_0xc741('0x2f')],_0x3b3703['query']);_0x3bb9b1[_0xc741('0x34')]=_[_0xc741('0x33')](_0x3b3703[_0xc741('0x2f')],qs['fields'](_0x1ce361[_0xc741('0x31')][_0xc741('0x35')]));_0x3bb9b1[_0xc741('0x34')]=_0x3bb9b1[_0xc741('0x34')][_0xc741('0x36')]?_0x3bb9b1[_0xc741('0x34')]:_0x3b3703[_0xc741('0x2f')];if(_0x1ce361['query']['includeAll']){_0x3bb9b1[_0xc741('0x37')]=[{'all':!![]}];}_0x3bb9b1=_[_0xc741('0x38')]({},_0x3bb9b1,_0x1ce361[_0xc741('0x39')]);return db[_0xc741('0x30')][_0xc741('0x3a')](_0x3bb9b1)[_0xc741('0x29')](handleEntityNotFound(_0x3b66ae,null))['then'](respondWithResult(_0x3b66ae,null))[_0xc741('0x3b')](handleError(_0x3b66ae,null));};exports[_0xc741('0x28')]=function(_0x4f2791,_0x221744){return db[_0xc741('0x30')][_0xc741('0x3a')]({'where':{'id':_0x4f2791['params']['id']}})[_0xc741('0x29')](handleEntityNotFound(_0x221744,null))[_0xc741('0x29')](removeEntity(_0x221744,null))[_0xc741('0x3b')](handleError(_0x221744,null));};function widgetAttributes(_0x39e9fb){try{switch(_0x39e9fb[_0xc741('0x3c')]){case _0xc741('0x3d'):return[{'name':_0xc741('0x3e'),'value':_0x39e9fb['attrUrl']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x0]?_0x39e9fb[_0xc741('0x3f')][0x0][_0xc741('0x40')]:undefined)||_0xc741('0x41')}];case _0xc741('0x42'):return[{'name':_0xc741('0x43'),'value':_0x39e9fb[_0xc741('0x43')]||(_0x39e9fb['attrs']&&_0x39e9fb[_0xc741('0x3f')][0x0]?_0x39e9fb[_0xc741('0x3f')][0x0][_0xc741('0x40')]:undefined)||''}];case _0xc741('0x44'):return[{'name':'attrHourFormat','value':_0x39e9fb[_0xc741('0x45')]||(_0x39e9fb['attrs']&&_0x39e9fb[_0xc741('0x3f')][0x0]?_0x39e9fb[_0xc741('0x3f')][0x0][_0xc741('0x40')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x39e9fb[_0xc741('0x46')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x1]?_0x39e9fb[_0xc741('0x3f')][0x1][_0xc741('0x40')]:undefined)||_0xc741('0x47')},{'name':_0xc741('0x48'),'value':_0x39e9fb[_0xc741('0x48')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x2]?_0x39e9fb[_0xc741('0x3f')][0x2][_0xc741('0x40')]:undefined)||0xc}];case _0xc741('0x49'):return[{'name':_0xc741('0x4a'),'value':_0x39e9fb[_0xc741('0x4a')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x0]?_0x39e9fb['attrs'][0x0][_0xc741('0x40')]:undefined)||'total'},{'name':_0xc741('0x4b'),'value':_0x39e9fb['attrVoiceQueues']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x1]?_0x39e9fb['attrs'][0x1][_0xc741('0x40')]:undefined)||[]},{'name':_0xc741('0x48'),'value':_0x39e9fb['attrFontSize']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x2]?_0x39e9fb[_0xc741('0x3f')][0x2][_0xc741('0x40')]:undefined)||0x14},{'name':_0xc741('0x4c'),'value':_0x39e9fb[_0xc741('0x4c')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0x3]?_0x39e9fb[_0xc741('0x3f')][0x3]['value']:undefined)||'voice'},{'name':_0xc741('0x4d'),'value':_0x39e9fb['attrEmailAccounts']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x4]?_0x39e9fb[_0xc741('0x3f')][0x4][_0xc741('0x40')]:undefined)||''},{'name':_0xc741('0x4e'),'value':_0x39e9fb[_0xc741('0x4e')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x5]?_0x39e9fb[_0xc741('0x3f')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x39e9fb[_0xc741('0x4f')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x6]?_0x39e9fb[_0xc741('0x3f')][0x6]['value']:undefined)||''},{'name':_0xc741('0x50'),'value':_0x39e9fb['attrOpenchannelAccounts']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x7]?_0x39e9fb[_0xc741('0x3f')][0x7][_0xc741('0x40')]:undefined)||''},{'name':_0xc741('0x51'),'value':_0x39e9fb[_0xc741('0x51')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x8]?_0x39e9fb[_0xc741('0x3f')][0x8][_0xc741('0x40')]:undefined)||''},{'name':_0xc741('0x52'),'value':_0x39e9fb[_0xc741('0x52')]||(_0x39e9fb['attrs']&&_0x39e9fb[_0xc741('0x3f')][0x9]?_0x39e9fb[_0xc741('0x3f')][0x9][_0xc741('0x40')]:undefined)||''}];case'multibar-chart':case _0xc741('0x53'):return[{'name':_0xc741('0x54'),'value':_0x39e9fb[_0xc741('0x54')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0x0]?_0x39e9fb[_0xc741('0x3f')][0x0][_0xc741('0x40')]:undefined)||_0xc741('0x55')},{'name':_0xc741('0x56'),'value':_0x39e9fb['attrSerie2']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0x1]?_0x39e9fb[_0xc741('0x3f')][0x1][_0xc741('0x40')]:undefined)||null},{'name':_0xc741('0x57'),'value':_0x39e9fb[_0xc741('0x57')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x2]?_0x39e9fb['attrs'][0x2][_0xc741('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x39e9fb[_0xc741('0x4b')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x3]?_0x39e9fb[_0xc741('0x3f')][0x3][_0xc741('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x39e9fb['attrChannel']||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0x4]?_0x39e9fb[_0xc741('0x3f')][0x4][_0xc741('0x40')]:undefined)||_0xc741('0x58')},{'name':_0xc741('0x4d'),'value':_0x39e9fb[_0xc741('0x4d')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x5]?_0x39e9fb[_0xc741('0x3f')][0x5][_0xc741('0x40')]:undefined)||''},{'name':_0xc741('0x4e'),'value':_0x39e9fb[_0xc741('0x4e')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0x6]?_0x39e9fb['attrs'][0x6][_0xc741('0x40')]:undefined)||''},{'name':_0xc741('0x4f'),'value':_0x39e9fb[_0xc741('0x4f')]||(_0x39e9fb['attrs']&&_0x39e9fb['attrs'][0x7]?_0x39e9fb[_0xc741('0x3f')][0x7]['value']:undefined)||''},{'name':_0xc741('0x50'),'value':_0x39e9fb[_0xc741('0x50')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x8]?_0x39e9fb[_0xc741('0x3f')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x39e9fb[_0xc741('0x51')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0x9]?_0x39e9fb[_0xc741('0x3f')][0x9][_0xc741('0x40')]:undefined)||''},{'name':_0xc741('0x52'),'value':_0x39e9fb[_0xc741('0x52')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb['attrs'][0xa]?_0x39e9fb['attrs'][0xa][_0xc741('0x40')]:undefined)||''}];case'web-report':return[{'name':_0xc741('0x59'),'type':_0x39e9fb[_0xc741('0x5a')]||(_0x39e9fb['attrs']&&_0x39e9fb[_0xc741('0x3f')][0x0]?_0x39e9fb[_0xc741('0x3f')][0x0][_0xc741('0x3c')]:undefined)||null,'value':_0x39e9fb[_0xc741('0x59')]||(_0x39e9fb[_0xc741('0x3f')]&&_0x39e9fb[_0xc741('0x3f')][0x0]?_0x39e9fb[_0xc741('0x3f')][0x0]['value']:undefined)||null},{'name':_0xc741('0x5b'),'value':_0x39e9fb[_0xc741('0x5b')]||(_0x39e9fb['attrs']&&_0x39e9fb[_0xc741('0x3f')][0x1]?_0x39e9fb[_0xc741('0x3f')][0x1][_0xc741('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x5aa443){logger[_0xc741('0x5c')](_0xc741('0x5d'),JSON['stringify'](_0x5aa443));return[];}}exports[_0xc741('0x5e')]=function(_0x3768ef,_0xfa0e86){if(_0x3768ef[_0xc741('0x5f')]){_0x3768ef['body']['attrs']=widgetAttributes(_0x3768ef[_0xc741('0x5f')]);}return db['DashboardItem'][_0xc741('0x5e')](_0x3768ef[_0xc741('0x5f')],{})[_0xc741('0x29')](respondWithResult(_0xfa0e86,0xc9))[_0xc741('0x3b')](handleError(_0xfa0e86,null));};exports[_0xc741('0x27')]=function(_0x1845b5,_0x5eab1a){if(_0x1845b5[_0xc741('0x5f')]['id']){delete _0x1845b5['body']['id'];}_0x1845b5[_0xc741('0x5f')][_0xc741('0x3f')]=widgetAttributes(_0x1845b5[_0xc741('0x5f')]);return db[_0xc741('0x30')]['find']({'where':{'id':_0x1845b5[_0xc741('0x2e')]['id']}})[_0xc741('0x29')](handleEntityNotFound(_0x5eab1a,null))[_0xc741('0x29')](saveUpdates(_0x1845b5[_0xc741('0x5f')],null))[_0xc741('0x29')](respondWithResult(_0x5eab1a,null))[_0xc741('0x3b')](handleError(_0x5eab1a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 0458ebf..82cf3a1 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 _0x2899=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2899,0xc4));var _0x9289=function(_0xde23a6,_0x5f5cd8){_0xde23a6=_0xde23a6-0x0;var _0x2abc81=_0x2899[_0xde23a6];return _0x2abc81;};'use strict';var EventEmitter=require(_0x9289('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9289('0x1')](0x0);var events={'afterCreate':_0x9289('0x2'),'afterUpdate':_0x9289('0x3'),'afterDestroy':_0x9289('0x4')};function emitEvent(_0x26e190){return function(_0x12be61,_0x130034,_0x29cf86){DashboardItemEvents[_0x9289('0x5')](_0x26e190+':'+_0x12be61['id'],_0x12be61);DashboardItemEvents[_0x9289('0x5')](_0x26e190,_0x12be61);_0x29cf86(null);};}for(var e in events){if(events[_0x9289('0x6')](e)){var event=events[e];DashboardItem[_0x9289('0x7')](e,emitEvent(event));}}module[_0x9289('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x28ef=['update','remove','emit','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x23b6ef,_0x3bb6c2){var _0x462fc7=function(_0x4de7a4){while(--_0x4de7a4){_0x23b6ef['push'](_0x23b6ef['shift']());}};_0x462fc7(++_0x3bb6c2);}(_0x28ef,0x1ac));var _0xf28e=function(_0x4e7e6c,_0x3a44c3){_0x4e7e6c=_0x4e7e6c-0x0;var _0x37a98e=_0x28ef[_0x4e7e6c];return _0x37a98e;};'use strict';var EventEmitter=require(_0xf28e('0x0'));var DashboardItem=require(_0xf28e('0x1'))['db'][_0xf28e('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf28e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf28e('0x4'),'afterDestroy':_0xf28e('0x5')};function emitEvent(_0x518e64){return function(_0x274ca5,_0x1117fc,_0x4308ca){DashboardItemEvents[_0xf28e('0x6')](_0x518e64+':'+_0x274ca5['id'],_0x274ca5);DashboardItemEvents['emit'](_0x518e64,_0x274ca5);_0x4308ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf28e('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2ac89e1..5b4e808 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 _0x7cca=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','moment','bluebird','request-promise'];(function(_0x4c4d07,_0x48512b){var _0x278851=function(_0x507727){while(--_0x507727){_0x4c4d07['push'](_0x4c4d07['shift']());}};_0x278851(++_0x48512b);}(_0x7cca,0xff));var _0xa7cc=function(_0x2a9fc7,_0x227a45){_0x2a9fc7=_0x2a9fc7-0x0;var _0x1b1e7f=_0x7cca[_0x2a9fc7];return _0x1b1e7f;};'use strict';var _=require(_0xa7cc('0x0'));var util=require(_0xa7cc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa7cc('0x2'));var BPromise=require(_0xa7cc('0x3'));var rp=require(_0xa7cc('0x4'));var fs=require('fs');var path=require(_0xa7cc('0x5'));var rimraf=require(_0xa7cc('0x6'));var config=require(_0xa7cc('0x7'));var attributes=require(_0xa7cc('0x8'));module[_0xa7cc('0x9')]=function(_0x16d9a6,_0xb0f7a7){return _0x16d9a6[_0xa7cc('0xa')](_0xa7cc('0xb'),attributes,{'tableName':_0xa7cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a12=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','DashboardItem','dashboard_items'];(function(_0x20598e,_0x559fa9){var _0x484c79=function(_0x286be0){while(--_0x286be0){_0x20598e['push'](_0x20598e['shift']());}};_0x484c79(++_0x559fa9);}(_0x3a12,0x1ce));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x23a1('0x0'));var util=require(_0x23a1('0x1'));var logger=require(_0x23a1('0x2'))('api');var moment=require(_0x23a1('0x3'));var BPromise=require(_0x23a1('0x4'));var rp=require(_0x23a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23a1('0x6'));var config=require(_0x23a1('0x7'));var attributes=require(_0x23a1('0x8'));module['exports']=function(_0x29775a,_0x3f41d6){return _0x29775a['define'](_0x23a1('0x9'),attributes,{'tableName':_0x23a1('0xa'),'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 0d7b805..f795d95 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 _0xd2a8=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0xd2a8,0xb1));var _0x8d2a=function(_0x137f6f,_0x1cf534){_0x137f6f=_0x137f6f-0x0;var _0x5394dc=_0xd2a8[_0x137f6f];return _0x5394dc;};'use strict';var _=require(_0x8d2a('0x0'));var util=require(_0x8d2a('0x1'));var moment=require(_0x8d2a('0x2'));var BPromise=require(_0x8d2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d2a('0x4'));var db=require(_0x8d2a('0x5'))['db'];var utils=require(_0x8d2a('0x6'));var logger=require(_0x8d2a('0x7'))(_0x8d2a('0x8'));var config=require(_0x8d2a('0x9'));var jayson=require(_0x8d2a('0xa'));var client=jayson[_0x8d2a('0xb')]['http']({'port':0x232a});config[_0x8d2a('0xc')]=_[_0x8d2a('0xd')](config[_0x8d2a('0xc')],{'host':_0x8d2a('0xe'),'port':0x18eb});var socket=require(_0x8d2a('0xf'))(new Redis(config['redis']));require(_0x8d2a('0x10'))[_0x8d2a('0x11')](socket);function respondWithRpcPromise(_0x8790c8,_0x56b7f0,_0x5250e7){return new BPromise(function(_0x274022,_0x119ec5){return client[_0x8d2a('0x12')](_0x8790c8,_0x5250e7)[_0x8d2a('0x13')](function(_0x42a930){logger['info']('DashboardItem,\x20%s,\x20%s',_0x56b7f0,_0x8d2a('0x14'));logger[_0x8d2a('0x15')](_0x8d2a('0x16'),_0x56b7f0,'request\x20sent',JSON[_0x8d2a('0x17')](_0x42a930));if(_0x42a930[_0x8d2a('0x18')]){if(_0x42a930[_0x8d2a('0x18')][_0x8d2a('0x19')]===0x1f4){logger['error'](_0x8d2a('0x1a'),_0x56b7f0,_0x42a930['error']['message']);return _0x119ec5(_0x42a930[_0x8d2a('0x18')]['message']);}logger[_0x8d2a('0x18')](_0x8d2a('0x1a'),_0x56b7f0,_0x42a930['error']['message']);return _0x274022(_0x42a930['error'][_0x8d2a('0x1b')]);}else{logger[_0x8d2a('0x1c')](_0x8d2a('0x1a'),_0x56b7f0,'request\x20sent');_0x274022(_0x42a930[_0x8d2a('0x1d')]['message']);}})[_0x8d2a('0x1e')](function(_0x1d4a99){logger[_0x8d2a('0x18')]('DashboardItem,\x20%s,\x20%s',_0x56b7f0,_0x1d4a99);_0x119ec5(_0x1d4a99);});});} \ No newline at end of file +var _0xbdee=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','info','DashboardItem,\x20%s,\x20%s'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xbdee,0xc0));var _0xebde=function(_0x5b0179,_0x3ee37e){_0x5b0179=_0x5b0179-0x0;var _0x419d78=_0xbdee[_0x5b0179];return _0x419d78;};'use strict';var _=require(_0xebde('0x0'));var util=require(_0xebde('0x1'));var moment=require(_0xebde('0x2'));var BPromise=require(_0xebde('0x3'));var rs=require(_0xebde('0x4'));var fs=require('fs');var Redis=require(_0xebde('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xebde('0x6'));var jayson=require(_0xebde('0x7'));var client=jayson[_0xebde('0x8')][_0xebde('0x9')]({'port':0x232a});config['redis']=_[_0xebde('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xebde('0xb'))(new Redis(config[_0xebde('0xc')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x46e8a5,_0x5b2465,_0x20c12a){return new BPromise(function(_0x57fa92,_0x3f300c){return client['request'](_0x46e8a5,_0x20c12a)['then'](function(_0xfeb8c9){logger[_0xebde('0xd')](_0xebde('0xe'),_0x5b2465,'request\x20sent');logger[_0xebde('0xf')](_0xebde('0x10'),_0x5b2465,_0xebde('0x11'),JSON[_0xebde('0x12')](_0xfeb8c9));if(_0xfeb8c9[_0xebde('0x13')]){if(_0xfeb8c9[_0xebde('0x13')]['code']===0x1f4){logger['error'](_0xebde('0xe'),_0x5b2465,_0xfeb8c9[_0xebde('0x13')][_0xebde('0x14')]);return _0x3f300c(_0xfeb8c9[_0xebde('0x13')][_0xebde('0x14')]);}logger[_0xebde('0x13')](_0xebde('0xe'),_0x5b2465,_0xfeb8c9['error'][_0xebde('0x14')]);return _0x57fa92(_0xfeb8c9[_0xebde('0x13')][_0xebde('0x14')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x5b2465,_0xebde('0x11'));_0x57fa92(_0xfeb8c9[_0xebde('0x15')][_0xebde('0x14')]);}})[_0xebde('0x16')](function(_0x2dee80){logger[_0xebde('0x13')](_0xebde('0xe'),_0x5b2465,_0x2dee80);_0x3f300c(_0x2dee80);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 82b6918..a36e2b4 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 _0xa9bb=['length','./dashboardItem.events','update','removeListener','register'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xa9bb,0x100));var _0xba9b=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xa9bb[_0x119d5a];return _0x15bff4;};'use strict';var DashboardItemEvents=require(_0xba9b('0x0'));var events=['save','remove',_0xba9b('0x1')];function createListener(_0x3c8b99,_0x4fb5fa){return function(_0x491648){_0x4fb5fa['emit'](_0x3c8b99,_0x491648);};}function removeListener(_0x10c1ce,_0xcc6207){return function(){DashboardItemEvents[_0xba9b('0x2')](_0x10c1ce,_0xcc6207);};}exports[_0xba9b('0x3')]=function(_0x169cc8){for(var _0x3adf0e=0x0,_0x518783=events[_0xba9b('0x4')];_0x3adf0e<_0x518783;_0x3adf0e++){var _0x12da30=events[_0x3adf0e];var _0x13468c=createListener('dashboardItem:'+_0x12da30,_0x169cc8);DashboardItemEvents['on'](_0x12da30,_0x13468c);}}; \ No newline at end of file +var _0x706d=['emit','length','remove','update'];(function(_0x1f6ce6,_0x2c4cac){var _0x11a332=function(_0x3c8bf0){while(--_0x3c8bf0){_0x1f6ce6['push'](_0x1f6ce6['shift']());}};_0x11a332(++_0x2c4cac);}(_0x706d,0x112));var _0xd706=function(_0x372a25,_0xbc2b52){_0x372a25=_0x372a25-0x0;var _0x4359b2=_0x706d[_0x372a25];return _0x4359b2;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0xd706('0x0'),_0xd706('0x1')];function createListener(_0x455ca1,_0x17e444){return function(_0x190276){_0x17e444[_0xd706('0x2')](_0x455ca1,_0x190276);};}function removeListener(_0x48a3fb,_0x20860b){return function(){DashboardItemEvents['removeListener'](_0x48a3fb,_0x20860b);};}exports['register']=function(_0x9d9b39){for(var _0x1ab47a=0x0,_0x4c55db=events[_0xd706('0x3')];_0x1ab47a<_0x4c55db;_0x1ab47a++){var _0x450a07=events[_0x1ab47a];var _0x38c98c=createListener('dashboardItem:'+_0x450a07,_0x9d9b39);DashboardItemEvents['on'](_0x450a07,_0x38c98c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index cbc0587..c62bb63 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 _0x4b54=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','exports','util','path'];(function(_0x1462e0,_0x3684e9){var _0x23514d=function(_0x2935d0){while(--_0x2935d0){_0x1462e0['push'](_0x1462e0['shift']());}};_0x23514d(++_0x3684e9);}(_0x4b54,0xb9));var _0x44b5=function(_0x5192a3,_0x13238e){_0x5192a3=_0x5192a3-0x0;var _0x16cd81=_0x4b54[_0x5192a3];return _0x16cd81;};'use strict';var multer=require('multer');var util=require(_0x44b5('0x0'));var path=require(_0x44b5('0x1'));var timeout=require(_0x44b5('0x2'));var express=require(_0x44b5('0x3'));var router=express[_0x44b5('0x4')]();var fs_extra=require(_0x44b5('0x5'));var auth=require(_0x44b5('0x6'));var interaction=require(_0x44b5('0x7'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x44b5('0x8')](_0x44b5('0x9'),auth[_0x44b5('0xa')](),controller[_0x44b5('0xb')]);router[_0x44b5('0xc')]('/',auth[_0x44b5('0xa')](),controller[_0x44b5('0xd')]);router[_0x44b5('0xe')]('/:id',auth[_0x44b5('0xa')](),controller[_0x44b5('0xf')]);router['delete']('/:id',auth[_0x44b5('0xa')](),controller['destroy']);module[_0x44b5('0x10')]=router; \ No newline at end of file +var _0x1ea9=['post','put','/:id','update','delete','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1ea9,0x115));var _0x91ea=function(_0x47c53e,_0x35f7f3){_0x47c53e=_0x47c53e-0x0;var _0x306afd=_0x1ea9[_0x47c53e];return _0x306afd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91ea('0x0'));var express=require(_0x91ea('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x91ea('0x2'));var interaction=require(_0x91ea('0x3'));var config=require(_0x91ea('0x4'));var controller=require('./dashboardItem.controller');router[_0x91ea('0x5')]('/:id',auth[_0x91ea('0x6')](),controller[_0x91ea('0x7')]);router[_0x91ea('0x8')]('/',auth[_0x91ea('0x6')](),controller['create']);router[_0x91ea('0x9')](_0x91ea('0xa'),auth[_0x91ea('0x6')](),controller[_0x91ea('0xb')]);router[_0x91ea('0xc')](_0x91ea('0xa'),auth[_0x91ea('0x6')](),controller[_0x91ea('0xd')]);module[_0x91ea('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 01401bf..ccbe4a2 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 _0x1ca6=['ENUM','first','second','third','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1ca6,0x1df));var _0x61ca=function(_0x2b7627,_0x326fb8){_0x2b7627=_0x2b7627-0x0;var _0x3a2ba8=_0x1ca6[_0x2b7627];return _0x3a2ba8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x61ca('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x61ca('0x1')](_0x61ca('0x2'),_0x61ca('0x3'),_0x61ca('0x4')),'allowNull':![],'defaultValue':_0x61ca('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a84=['third','first','sequelize','STRING','ENUM','second'];(function(_0x2ccd68,_0x140321){var _0x340ded=function(_0x14cf4f){while(--_0x14cf4f){_0x2ccd68['push'](_0x2ccd68['shift']());}};_0x340ded(++_0x140321);}(_0x4a84,0x1c4));var _0x44a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4a84[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x44a8('0x0'));module['exports']={'name':{'type':Sequelize[_0x44a8('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x44a8('0x2')]('first',_0x44a8('0x3'),_0x44a8('0x4')),'allowNull':![],'defaultValue':_0x44a8('0x5')},'description':{'type':Sequelize[_0x44a8('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d74cc51..67908f2 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 _0x11ec=['model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','Dispositions','error','stack','name','send','map','Disposition','type','key'];(function(_0x25b459,_0x347064){var _0x4da043=function(_0x408140){while(--_0x408140){_0x25b459['push'](_0x25b459['shift']());}};_0x4da043(++_0x347064);}(_0x11ec,0xd1));var _0xc11e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x11ec[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc11e('0x0'));var jsonpatch=require(_0xc11e('0x1'));var rp=require(_0xc11e('0x2'));var moment=require('moment');var BPromise=require(_0xc11e('0x3'));var Mustache=require('mustache');var util=require(_0xc11e('0x4'));var path=require(_0xc11e('0x5'));var sox=require(_0xc11e('0x6'));var csv=require(_0xc11e('0x7'));var ejs=require(_0xc11e('0x8'));var fs=require('fs');var fs_extra=require(_0xc11e('0x9'));var _=require('lodash');var squel=require(_0xc11e('0xa'));var crypto=require(_0xc11e('0xb'));var jsforce=require(_0xc11e('0xc'));var deskjs=require(_0xc11e('0xd'));var toCsv=require(_0xc11e('0x7'));var querystring=require(_0xc11e('0xe'));var Papa=require('papaparse');var Redis=require(_0xc11e('0xf'));var authService=require(_0xc11e('0x10'));var qs=require(_0xc11e('0x11'));var as=require(_0xc11e('0x12'));var hardwareService=require(_0xc11e('0x13'));var logger=require(_0xc11e('0x14'))(_0xc11e('0x15'));var utils=require(_0xc11e('0x16'));var config=require(_0xc11e('0x17'));var licenseUtil=require(_0xc11e('0x18'));var db=require(_0xc11e('0x19'))['db'];function respondWithStatusCode(_0x55868a,_0x16f94a){_0x16f94a=_0x16f94a||0xcc;return function(_0x8292f4){if(_0x8292f4){return _0x55868a[_0xc11e('0x1a')](_0x16f94a);}return _0x55868a[_0xc11e('0x1b')](_0x16f94a)[_0xc11e('0x1c')]();};}function respondWithResult(_0x1b8c55,_0x5937c7){_0x5937c7=_0x5937c7||0xc8;return function(_0x6a3c78){if(_0x6a3c78){return _0x1b8c55[_0xc11e('0x1b')](_0x5937c7)[_0xc11e('0x1d')](_0x6a3c78);}};}function respondWithFilteredResult(_0x149a12,_0x4d6be4){return function(_0x4ca562){if(_0x4ca562){var _0x2c6136=typeof _0x4d6be4[_0xc11e('0x1e')]===_0xc11e('0x1f')&&typeof _0x4d6be4['limit']==='undefined';var _0x4d2312=_0x4ca562[_0xc11e('0x20')];var _0x21566d=_0x2c6136?0x0:_0x4d6be4['offset'];var _0xa63390=_0x2c6136?_0x4ca562[_0xc11e('0x20')]:_0x4d6be4['offset']+_0x4d6be4['limit'];var _0x337f62;if(_0xa63390>=_0x4d2312){_0xa63390=_0x4d2312;_0x337f62=0xc8;}else{_0x337f62=0xce;}_0x149a12[_0xc11e('0x1b')](_0x337f62);return _0x149a12[_0xc11e('0x21')]('Content-Range',_0x21566d+'-'+_0xa63390+'/'+_0x4d2312)[_0xc11e('0x1d')](_0x4ca562);}return null;};}function patchUpdates(_0x5995e5){return function(_0x5e43a7){try{jsonpatch[_0xc11e('0x22')](_0x5e43a7,_0x5995e5,!![]);}catch(_0x25cec2){return BPromise[_0xc11e('0x23')](_0x25cec2);}return _0x5e43a7[_0xc11e('0x24')]();};}function saveUpdates(_0xb148ca,_0xac60d0){return function(_0x590c0e){if(_0x590c0e){return _0x590c0e[_0xc11e('0x25')](_0xb148ca)['then'](function(_0x2b8e0d){return _0x2b8e0d;});}return null;};}function removeEntity(_0x4834a0,_0x826275){return function(_0x487eaa){if(_0x487eaa){return _0x487eaa[_0xc11e('0x26')]()[_0xc11e('0x27')](function(){var _0x1e6a69=_0x487eaa['get']({'plain':!![]});var _0x13fd07=_0xc11e('0x28');return db['UserProfileResource'][_0xc11e('0x26')]({'where':{'type':_0x13fd07,'resourceId':_0x1e6a69['id']}})[_0xc11e('0x27')](function(){return _0x487eaa;});})[_0xc11e('0x27')](function(){_0x4834a0[_0xc11e('0x1b')](0xcc)[_0xc11e('0x1c')]();});}};}function handleEntityNotFound(_0x2d6670,_0x38a9de){return function(_0x214c16){if(!_0x214c16){_0x2d6670[_0xc11e('0x1a')](0x194);}return _0x214c16;};}function handleError(_0x34aae1,_0xaa5863){_0xaa5863=_0xaa5863||0x1f4;return function(_0x325f15){logger[_0xc11e('0x29')](_0x325f15[_0xc11e('0x2a')]);if(_0x325f15[_0xc11e('0x2b')]){delete _0x325f15[_0xc11e('0x2b')];}_0x34aae1['status'](_0xaa5863)[_0xc11e('0x2c')](_0x325f15);};}exports['index']=function(_0x5dcc49,_0x162ec4){var _0x592e4d={},_0x407810={},_0x5c68ba={'count':0x0,'rows':[]};var _0x4f81a9=_[_0xc11e('0x2d')](db[_0xc11e('0x2e')]['rawAttributes'],function(_0xbff994){return{'name':_0xbff994['fieldName'],'type':_0xbff994[_0xc11e('0x2f')][_0xc11e('0x30')]};});_0x407810[_0xc11e('0x31')]=_[_0xc11e('0x2d')](_0x4f81a9,_0xc11e('0x2b'));_0x407810[_0xc11e('0x32')]=_['keys'](_0x5dcc49['query']);_0x407810[_0xc11e('0x33')]=_[_0xc11e('0x34')](_0x407810[_0xc11e('0x31')],_0x407810['query']);_0x592e4d['attributes']=_[_0xc11e('0x34')](_0x407810[_0xc11e('0x31')],qs['fields'](_0x5dcc49[_0xc11e('0x32')][_0xc11e('0x35')]));_0x592e4d[_0xc11e('0x36')]=_0x592e4d[_0xc11e('0x36')][_0xc11e('0x37')]?_0x592e4d[_0xc11e('0x36')]:_0x407810[_0xc11e('0x31')];if(!_0x5dcc49['query'][_0xc11e('0x38')](_0xc11e('0x39'))){_0x592e4d[_0xc11e('0x3a')]=qs[_0xc11e('0x3a')](_0x5dcc49[_0xc11e('0x32')]['limit']);_0x592e4d[_0xc11e('0x1e')]=qs[_0xc11e('0x1e')](_0x5dcc49[_0xc11e('0x32')][_0xc11e('0x1e')]);}_0x592e4d[_0xc11e('0x3b')]=qs[_0xc11e('0x3c')](_0x5dcc49[_0xc11e('0x32')]['sort']);_0x592e4d[_0xc11e('0x3d')]=qs[_0xc11e('0x33')](_['pick'](_0x5dcc49[_0xc11e('0x32')],_0x407810[_0xc11e('0x33')]),_0x4f81a9);if(_0x5dcc49[_0xc11e('0x32')]['filter']){_0x592e4d['where']=_[_0xc11e('0x3e')](_0x592e4d[_0xc11e('0x3d')],{'$or':_[_0xc11e('0x2d')](_0x4f81a9,function(_0x40f993){if(_0x40f993[_0xc11e('0x2f')]!==_0xc11e('0x3f')){var _0x121765={};_0x121765[_0x40f993[_0xc11e('0x2b')]]={'$like':'%'+_0x5dcc49[_0xc11e('0x32')][_0xc11e('0x40')]+'%'};return _0x121765;}})});}_0x592e4d=_[_0xc11e('0x3e')]({},_0x592e4d,_0x5dcc49[_0xc11e('0x41')]);var _0x1d19bf={'where':_0x592e4d['where']};return db[_0xc11e('0x2e')][_0xc11e('0x20')](_0x1d19bf)['then'](function(_0x5ce1fa){_0x5c68ba[_0xc11e('0x20')]=_0x5ce1fa;if(_0x5dcc49[_0xc11e('0x32')][_0xc11e('0x42')]){_0x592e4d['include']=[{'all':!![]}];}return db[_0xc11e('0x2e')][_0xc11e('0x43')](_0x592e4d);})[_0xc11e('0x27')](function(_0x19a452){_0x5c68ba[_0xc11e('0x44')]=_0x19a452;return _0x5c68ba;})[_0xc11e('0x27')](respondWithFilteredResult(_0x162ec4,_0x592e4d))[_0xc11e('0x45')](handleError(_0x162ec4,null));};exports[_0xc11e('0x46')]=function(_0x5a7b9a,_0xaa38ec){var _0x4eabb7={'raw':!![],'where':{'id':_0x5a7b9a[_0xc11e('0x47')]['id']}},_0x53594a={};_0x53594a[_0xc11e('0x31')]=_['keys'](db[_0xc11e('0x2e')][_0xc11e('0x48')]);_0x53594a[_0xc11e('0x32')]=_[_0xc11e('0x49')](_0x5a7b9a[_0xc11e('0x32')]);_0x53594a[_0xc11e('0x33')]=_[_0xc11e('0x34')](_0x53594a[_0xc11e('0x31')],_0x53594a[_0xc11e('0x32')]);_0x4eabb7['attributes']=_[_0xc11e('0x34')](_0x53594a[_0xc11e('0x31')],qs[_0xc11e('0x35')](_0x5a7b9a[_0xc11e('0x32')][_0xc11e('0x35')]));_0x4eabb7[_0xc11e('0x36')]=_0x4eabb7[_0xc11e('0x36')]['length']?_0x4eabb7['attributes']:_0x53594a[_0xc11e('0x31')];if(_0x5a7b9a[_0xc11e('0x32')][_0xc11e('0x42')]){_0x4eabb7['include']=[{'all':!![]}];}_0x4eabb7=_[_0xc11e('0x3e')]({},_0x4eabb7,_0x5a7b9a[_0xc11e('0x41')]);return db[_0xc11e('0x2e')]['find'](_0x4eabb7)[_0xc11e('0x27')](handleEntityNotFound(_0xaa38ec,null))[_0xc11e('0x27')](respondWithResult(_0xaa38ec,null))['catch'](handleError(_0xaa38ec,null));};exports[_0xc11e('0x4a')]=function(_0x3d8f9f,_0x2a3fed){return db[_0xc11e('0x2e')][_0xc11e('0x4a')](_0x3d8f9f[_0xc11e('0x4b')],{})[_0xc11e('0x27')](function(_0x7b3e22){var _0x2602aa=_0x3d8f9f[_0xc11e('0x4c')][_0xc11e('0x4d')]({'plain':!![]});if(!_0x2602aa)throw new Error(_0xc11e('0x4e'));if(_0x2602aa[_0xc11e('0x4f')]==='user'){var _0x196c4d=_0x7b3e22['get']({'plain':!![]});var _0x1a1789='Dispositions';return db[_0xc11e('0x50')][_0xc11e('0x51')]({'where':{'name':_0x1a1789,'userProfileId':_0x2602aa[_0xc11e('0x52')]},'raw':!![]})[_0xc11e('0x27')](function(_0x1f91b3){if(_0x1f91b3&&_0x1f91b3[_0xc11e('0x53')]===0x0){return db[_0xc11e('0x54')]['create']({'name':_0x196c4d[_0xc11e('0x2b')],'resourceId':_0x196c4d['id'],'type':_0x1f91b3[_0xc11e('0x2b')],'sectionId':_0x1f91b3['id']},{})[_0xc11e('0x27')](function(){return _0x7b3e22;});}else{return _0x7b3e22;}})['catch'](function(_0x1b5efe){logger[_0xc11e('0x29')](_0xc11e('0x55'),_0x1b5efe);throw _0x1b5efe;});}return _0x7b3e22;})[_0xc11e('0x27')](respondWithResult(_0x2a3fed,0xc9))[_0xc11e('0x45')](handleError(_0x2a3fed,null));};exports[_0xc11e('0x25')]=function(_0x24a72e,_0x4d038e){if(_0x24a72e[_0xc11e('0x4b')]['id']){delete _0x24a72e[_0xc11e('0x4b')]['id'];}return db[_0xc11e('0x2e')][_0xc11e('0x51')]({'where':{'id':_0x24a72e[_0xc11e('0x47')]['id']}})[_0xc11e('0x27')](handleEntityNotFound(_0x4d038e,null))['then'](saveUpdates(_0x24a72e[_0xc11e('0x4b')],null))[_0xc11e('0x27')](respondWithResult(_0x4d038e,null))[_0xc11e('0x45')](handleError(_0x4d038e,null));};exports[_0xc11e('0x26')]=function(_0x4dc9f8,_0x3f5dc3){return db[_0xc11e('0x2e')][_0xc11e('0x51')]({'where':{'id':_0x4dc9f8[_0xc11e('0x47')]['id']}})[_0xc11e('0x27')](handleEntityNotFound(_0x3f5dc3,null))[_0xc11e('0x27')](removeEntity(_0x3f5dc3,null))['catch'](handleError(_0x3f5dc3,null));}; \ No newline at end of file +var _0xaffe=['show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Disposition','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','catch'];(function(_0x269897,_0x2b9c01){var _0x1f432d=function(_0x4f3112){while(--_0x4f3112){_0x269897['push'](_0x269897['shift']());}};_0x1f432d(++_0x2b9c01);}(_0xaffe,0x158));var _0xeaff=function(_0x25b5a9,_0x5de487){_0x25b5a9=_0x25b5a9-0x0;var _0x1d6580=_0xaffe[_0x25b5a9];return _0x1d6580;};'use strict';var emlformat=require(_0xeaff('0x0'));var rimraf=require(_0xeaff('0x1'));var zipdir=require(_0xeaff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeaff('0x3'));var moment=require(_0xeaff('0x4'));var BPromise=require(_0xeaff('0x5'));var Mustache=require(_0xeaff('0x6'));var util=require(_0xeaff('0x7'));var path=require(_0xeaff('0x8'));var sox=require(_0xeaff('0x9'));var csv=require(_0xeaff('0xa'));var ejs=require(_0xeaff('0xb'));var fs=require('fs');var fs_extra=require(_0xeaff('0xc'));var _=require(_0xeaff('0xd'));var squel=require(_0xeaff('0xe'));var crypto=require('crypto');var jsforce=require(_0xeaff('0xf'));var deskjs=require(_0xeaff('0x10'));var toCsv=require(_0xeaff('0xa'));var querystring=require('querystring');var Papa=require(_0xeaff('0x11'));var Redis=require(_0xeaff('0x12'));var authService=require(_0xeaff('0x13'));var qs=require(_0xeaff('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaff('0x15'))(_0xeaff('0x16'));var utils=require(_0xeaff('0x17'));var config=require(_0xeaff('0x18'));var licenseUtil=require(_0xeaff('0x19'));var db=require(_0xeaff('0x1a'))['db'];function respondWithStatusCode(_0x2f8168,_0x230c88){_0x230c88=_0x230c88||0xcc;return function(_0x107443){if(_0x107443){return _0x2f8168[_0xeaff('0x1b')](_0x230c88);}return _0x2f8168[_0xeaff('0x1c')](_0x230c88)[_0xeaff('0x1d')]();};}function respondWithResult(_0x4540ad,_0x19be37){_0x19be37=_0x19be37||0xc8;return function(_0x36ab6d){if(_0x36ab6d){return _0x4540ad[_0xeaff('0x1c')](_0x19be37)[_0xeaff('0x1e')](_0x36ab6d);}};}function respondWithFilteredResult(_0x465bbe,_0x57fa48){return function(_0x5d25b5){if(_0x5d25b5){var _0x4a81c9=typeof _0x57fa48[_0xeaff('0x1f')]===_0xeaff('0x20')&&typeof _0x57fa48[_0xeaff('0x21')]===_0xeaff('0x20');var _0x1aabae=_0x5d25b5['count'];var _0x4c63a4=_0x4a81c9?0x0:_0x57fa48[_0xeaff('0x1f')];var _0x4b6cc2=_0x4a81c9?_0x5d25b5['count']:_0x57fa48[_0xeaff('0x1f')]+_0x57fa48[_0xeaff('0x21')];var _0x3dd531;if(_0x4b6cc2>=_0x1aabae){_0x4b6cc2=_0x1aabae;_0x3dd531=0xc8;}else{_0x3dd531=0xce;}_0x465bbe[_0xeaff('0x1c')](_0x3dd531);return _0x465bbe[_0xeaff('0x22')](_0xeaff('0x23'),_0x4c63a4+'-'+_0x4b6cc2+'/'+_0x1aabae)[_0xeaff('0x1e')](_0x5d25b5);}return null;};}function patchUpdates(_0x56d705){return function(_0x5f5808){try{jsonpatch['apply'](_0x5f5808,_0x56d705,!![]);}catch(_0x2ef6be){return BPromise['reject'](_0x2ef6be);}return _0x5f5808[_0xeaff('0x24')]();};}function saveUpdates(_0xff722a,_0x2b753f){return function(_0x2cfcab){if(_0x2cfcab){return _0x2cfcab[_0xeaff('0x25')](_0xff722a)[_0xeaff('0x26')](function(_0x27654b){return _0x27654b;});}return null;};}function removeEntity(_0x8abe34,_0x43f67d){return function(_0x37f1cf){if(_0x37f1cf){return _0x37f1cf['destroy']()[_0xeaff('0x26')](function(){var _0x49abdf=_0x37f1cf[_0xeaff('0x27')]({'plain':!![]});var _0x283e38='Dispositions';return db[_0xeaff('0x28')][_0xeaff('0x29')]({'where':{'type':_0x283e38,'resourceId':_0x49abdf['id']}})[_0xeaff('0x26')](function(){return _0x37f1cf;});})['then'](function(){_0x8abe34[_0xeaff('0x1c')](0xcc)[_0xeaff('0x1d')]();});}};}function handleEntityNotFound(_0x3bccd7,_0x457cca){return function(_0x312aac){if(!_0x312aac){_0x3bccd7[_0xeaff('0x1b')](0x194);}return _0x312aac;};}function handleError(_0x6c3c02,_0x5dc7b3){_0x5dc7b3=_0x5dc7b3||0x1f4;return function(_0x319dd2){logger[_0xeaff('0x2a')](_0x319dd2[_0xeaff('0x2b')]);if(_0x319dd2[_0xeaff('0x2c')]){delete _0x319dd2[_0xeaff('0x2c')];}_0x6c3c02[_0xeaff('0x1c')](_0x5dc7b3)[_0xeaff('0x2d')](_0x319dd2);};}exports[_0xeaff('0x2e')]=function(_0x331473,_0x9f96c2){var _0x5bbe41={},_0x517b64={},_0x1ece19={'count':0x0,'rows':[]};var _0x2905e6=_['map'](db[_0xeaff('0x2f')]['rawAttributes'],function(_0x13f4f1){return{'name':_0x13f4f1['fieldName'],'type':_0x13f4f1[_0xeaff('0x30')][_0xeaff('0x31')]};});_0x517b64[_0xeaff('0x32')]=_['map'](_0x2905e6,_0xeaff('0x2c'));_0x517b64['query']=_['keys'](_0x331473['query']);_0x517b64[_0xeaff('0x33')]=_['intersection'](_0x517b64[_0xeaff('0x32')],_0x517b64[_0xeaff('0x34')]);_0x5bbe41[_0xeaff('0x35')]=_[_0xeaff('0x36')](_0x517b64['model'],qs[_0xeaff('0x37')](_0x331473[_0xeaff('0x34')][_0xeaff('0x37')]));_0x5bbe41[_0xeaff('0x35')]=_0x5bbe41['attributes'][_0xeaff('0x38')]?_0x5bbe41['attributes']:_0x517b64[_0xeaff('0x32')];if(!_0x331473['query'][_0xeaff('0x39')]('nolimit')){_0x5bbe41[_0xeaff('0x21')]=qs[_0xeaff('0x21')](_0x331473['query'][_0xeaff('0x21')]);_0x5bbe41[_0xeaff('0x1f')]=qs[_0xeaff('0x1f')](_0x331473[_0xeaff('0x34')][_0xeaff('0x1f')]);}_0x5bbe41[_0xeaff('0x3a')]=qs[_0xeaff('0x3b')](_0x331473['query']['sort']);_0x5bbe41[_0xeaff('0x3c')]=qs[_0xeaff('0x33')](_['pick'](_0x331473['query'],_0x517b64[_0xeaff('0x33')]),_0x2905e6);if(_0x331473[_0xeaff('0x34')][_0xeaff('0x3d')]){_0x5bbe41[_0xeaff('0x3c')]=_[_0xeaff('0x3e')](_0x5bbe41[_0xeaff('0x3c')],{'$or':_[_0xeaff('0x3f')](_0x2905e6,function(_0x30abb2){if(_0x30abb2[_0xeaff('0x30')]!==_0xeaff('0x40')){var _0x1a571c={};_0x1a571c[_0x30abb2[_0xeaff('0x2c')]]={'$like':'%'+_0x331473[_0xeaff('0x34')][_0xeaff('0x3d')]+'%'};return _0x1a571c;}})});}_0x5bbe41=_[_0xeaff('0x3e')]({},_0x5bbe41,_0x331473[_0xeaff('0x41')]);var _0x515031={'where':_0x5bbe41[_0xeaff('0x3c')]};return db[_0xeaff('0x2f')][_0xeaff('0x42')](_0x515031)[_0xeaff('0x26')](function(_0x5f5111){_0x1ece19['count']=_0x5f5111;if(_0x331473['query'][_0xeaff('0x43')]){_0x5bbe41[_0xeaff('0x44')]=[{'all':!![]}];}return db[_0xeaff('0x2f')][_0xeaff('0x45')](_0x5bbe41);})[_0xeaff('0x26')](function(_0xd5fbc2){_0x1ece19['rows']=_0xd5fbc2;return _0x1ece19;})[_0xeaff('0x26')](respondWithFilteredResult(_0x9f96c2,_0x5bbe41))[_0xeaff('0x46')](handleError(_0x9f96c2,null));};exports[_0xeaff('0x47')]=function(_0x4c3eb1,_0x4acfa0){var _0x16b7b7={'raw':!![],'where':{'id':_0x4c3eb1[_0xeaff('0x48')]['id']}},_0xfc8a8b={};_0xfc8a8b[_0xeaff('0x32')]=_[_0xeaff('0x49')](db['Disposition']['rawAttributes']);_0xfc8a8b['query']=_[_0xeaff('0x49')](_0x4c3eb1[_0xeaff('0x34')]);_0xfc8a8b[_0xeaff('0x33')]=_[_0xeaff('0x36')](_0xfc8a8b[_0xeaff('0x32')],_0xfc8a8b[_0xeaff('0x34')]);_0x16b7b7[_0xeaff('0x35')]=_['intersection'](_0xfc8a8b['model'],qs['fields'](_0x4c3eb1['query'][_0xeaff('0x37')]));_0x16b7b7[_0xeaff('0x35')]=_0x16b7b7['attributes']['length']?_0x16b7b7[_0xeaff('0x35')]:_0xfc8a8b[_0xeaff('0x32')];if(_0x4c3eb1[_0xeaff('0x34')]['includeAll']){_0x16b7b7[_0xeaff('0x44')]=[{'all':!![]}];}_0x16b7b7=_[_0xeaff('0x3e')]({},_0x16b7b7,_0x4c3eb1['options']);return db[_0xeaff('0x2f')][_0xeaff('0x4a')](_0x16b7b7)['then'](handleEntityNotFound(_0x4acfa0,null))['then'](respondWithResult(_0x4acfa0,null))['catch'](handleError(_0x4acfa0,null));};exports[_0xeaff('0x4b')]=function(_0x32b03f,_0x399703){return db[_0xeaff('0x2f')][_0xeaff('0x4b')](_0x32b03f[_0xeaff('0x4c')],{})[_0xeaff('0x26')](function(_0x38d5b1){var _0x2ae3aa=_0x32b03f[_0xeaff('0x4d')][_0xeaff('0x27')]({'plain':!![]});if(!_0x2ae3aa)throw new Error(_0xeaff('0x4e'));if(_0x2ae3aa[_0xeaff('0x4f')]===_0xeaff('0x4d')){var _0x19fd72=_0x38d5b1[_0xeaff('0x27')]({'plain':!![]});var _0xeff921=_0xeaff('0x50');return db['UserProfileSection'][_0xeaff('0x4a')]({'where':{'name':_0xeff921,'userProfileId':_0x2ae3aa['userProfileId']},'raw':!![]})[_0xeaff('0x26')](function(_0x3bfede){if(_0x3bfede&&_0x3bfede[_0xeaff('0x51')]===0x0){return db['UserProfileResource'][_0xeaff('0x4b')]({'name':_0x19fd72['name'],'resourceId':_0x19fd72['id'],'type':_0x3bfede[_0xeaff('0x2c')],'sectionId':_0x3bfede['id']},{})[_0xeaff('0x26')](function(){return _0x38d5b1;});}else{return _0x38d5b1;}})['catch'](function(_0x41d68f){logger['error'](_0xeaff('0x52'),_0x41d68f);throw _0x41d68f;});}return _0x38d5b1;})['then'](respondWithResult(_0x399703,0xc9))[_0xeaff('0x46')](handleError(_0x399703,null));};exports[_0xeaff('0x25')]=function(_0x51b3cf,_0x15cb60){if(_0x51b3cf['body']['id']){delete _0x51b3cf[_0xeaff('0x4c')]['id'];}return db[_0xeaff('0x2f')][_0xeaff('0x4a')]({'where':{'id':_0x51b3cf['params']['id']}})['then'](handleEntityNotFound(_0x15cb60,null))[_0xeaff('0x26')](saveUpdates(_0x51b3cf[_0xeaff('0x4c')],null))[_0xeaff('0x26')](respondWithResult(_0x15cb60,null))['catch'](handleError(_0x15cb60,null));};exports[_0xeaff('0x29')]=function(_0x46f88b,_0xfd18b4){return db[_0xeaff('0x2f')][_0xeaff('0x4a')]({'where':{'id':_0x46f88b['params']['id']}})[_0xeaff('0x26')](handleEntityNotFound(_0xfd18b4,null))[_0xeaff('0x26')](removeEntity(_0xfd18b4,null))[_0xeaff('0x46')](handleError(_0xfd18b4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 9dc09d9..2adbcc6 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 _0xc22d=['WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp'];(function(_0x13d878,_0x3ac33){var _0x4f9280=function(_0x3e59e4){while(--_0x3e59e4){_0x13d878['push'](_0x13d878['shift']());}};_0x4f9280(++_0x3ac33);}(_0xc22d,0x88));var _0xdc22=function(_0x2033fc,_0x4a851a){_0x2033fc=_0x2033fc-0x0;var _0x334c8f=_0xc22d[_0x2033fc];return _0x334c8f;};'use strict';var _=require(_0xdc22('0x0'));var util=require(_0xdc22('0x1'));var logger=require(_0xdc22('0x2'))(_0xdc22('0x3'));var moment=require(_0xdc22('0x4'));var BPromise=require(_0xdc22('0x5'));var rp=require(_0xdc22('0x6'));var fs=require('fs');var path=require(_0xdc22('0x7'));var rimraf=require(_0xdc22('0x8'));var config=require(_0xdc22('0x9'));var attributes=require(_0xdc22('0xa'));module['exports']=function(_0x106e65,_0x564645){return _0x106e65['define'](_0xdc22('0xb'),attributes,{'tableName':_0xdc22('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xdc22('0xd'),'fields':['name',_0xdc22('0xe')]},{'unique':!![],'name':_0xdc22('0xf'),'fields':[_0xdc22('0x10'),_0xdc22('0x11')]},{'unique':!![],'name':_0xdc22('0x12'),'fields':[_0xdc22('0x10'),_0xdc22('0x13')]},{'unique':!![],'name':_0xdc22('0x14'),'fields':[_0xdc22('0x10'),_0xdc22('0x15')]},{'unique':!![],'name':_0xdc22('0x16'),'fields':['name',_0xdc22('0x17')]},{'unique':!![],'name':_0xdc22('0x18'),'fields':[_0xdc22('0x10'),'OpenchannelAccountId']},{'unique':!![],'name':_0xdc22('0x19'),'fields':[_0xdc22('0x10'),_0xdc22('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe09b=['exports','define','Disposition','name_voice','ListId','name_chat','name','ChatWebsiteId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','rimraf','../../config/environment','./disposition.attributes'];(function(_0x1b9541,_0x21b1cf){var _0x69cbea=function(_0x5c7941){while(--_0x5c7941){_0x1b9541['push'](_0x1b9541['shift']());}};_0x69cbea(++_0x21b1cf);}(_0xe09b,0x1c7));var _0xbe09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe09b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbe09('0x0'));var util=require(_0xbe09('0x1'));var logger=require('../../config/logger')(_0xbe09('0x2'));var moment=require(_0xbe09('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbe09('0x4'));var config=require(_0xbe09('0x5'));var attributes=require(_0xbe09('0x6'));module[_0xbe09('0x7')]=function(_0x1cb938,_0x502fa4){return _0x1cb938[_0xbe09('0x8')](_0xbe09('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xbe09('0xa'),'fields':['name',_0xbe09('0xb')]},{'unique':!![],'name':_0xbe09('0xc'),'fields':[_0xbe09('0xd'),_0xbe09('0xe')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0xbe09('0xf'),'fields':[_0xbe09('0xd'),_0xbe09('0x10')]},{'unique':!![],'name':_0xbe09('0x11'),'fields':[_0xbe09('0xd'),_0xbe09('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0xbe09('0xd'),_0xbe09('0x13')]},{'unique':!![],'name':_0xbe09('0x14'),'fields':[_0xbe09('0xd'),_0xbe09('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5a2e1b9..66dd10c 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(_0x4d032f,_0x1dfd3e){var _0x39d3fd=function(_0x4226cf){while(--_0x4226cf){_0x4d032f['push'](_0x4d032f['shift']());}};_0x39d3fd(++_0x1dfd3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x563471,_0x363561){var _0x5321d6=function(_0x5d5cf2){while(--_0x5d5cf2){_0x563471['push'](_0x563471['shift']());}};_0x5321d6(++_0x363561);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 7518c50..6b933c1 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 _0x272e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./disposition.controller','isAuthenticated','index','get','/:id','show','update','destroy','exports','util'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x272e,0x158));var _0xe272=function(_0x7da55b,_0x4f2fef){_0x7da55b=_0x7da55b-0x0;var _0x50319f=_0x272e[_0x7da55b];return _0x50319f;};'use strict';var multer=require('multer');var util=require(_0xe272('0x0'));var path=require('path');var timeout=require(_0xe272('0x1'));var express=require(_0xe272('0x2'));var router=express[_0xe272('0x3')]();var fs_extra=require(_0xe272('0x4'));var auth=require(_0xe272('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe272('0x6'));router['get']('/',auth[_0xe272('0x7')](),controller[_0xe272('0x8')]);router[_0xe272('0x9')](_0xe272('0xa'),auth['isAuthenticated'](),controller[_0xe272('0xb')]);router['post']('/',auth[_0xe272('0x7')](),controller['create']);router['put'](_0xe272('0xa'),auth[_0xe272('0x7')](),controller[_0xe272('0xc')]);router['delete'](_0xe272('0xa'),auth[_0xe272('0x7')](),controller[_0xe272('0xd')]);module[_0xe272('0xe')]=router; \ No newline at end of file +var _0x615d=['../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','post','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x466808,_0x151e4b){var _0xbd87c9=function(_0x1a0f55){while(--_0x1a0f55){_0x466808['push'](_0x466808['shift']());}};_0xbd87c9(++_0x151e4b);}(_0x615d,0x180));var _0xd615=function(_0x11fbaa,_0x52dc16){_0x11fbaa=_0x11fbaa-0x0;var _0x1831fd=_0x615d[_0x11fbaa];return _0x1831fd;};'use strict';var multer=require(_0xd615('0x0'));var util=require(_0xd615('0x1'));var path=require(_0xd615('0x2'));var timeout=require(_0xd615('0x3'));var express=require(_0xd615('0x4'));var router=express[_0xd615('0x5')]();var fs_extra=require(_0xd615('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd615('0x7'));var config=require(_0xd615('0x8'));var controller=require(_0xd615('0x9'));router[_0xd615('0xa')]('/',auth[_0xd615('0xb')](),controller[_0xd615('0xc')]);router[_0xd615('0xa')]('/:id',auth[_0xd615('0xb')](),controller['show']);router[_0xd615('0xd')]('/',auth[_0xd615('0xb')](),controller['create']);router['put'](_0xd615('0xe'),auth[_0xd615('0xb')](),controller[_0xd615('0xf')]);router['delete'](_0xd615('0xe'),auth[_0xd615('0xb')](),controller[_0xd615('0x10')]);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 0d9fd0c..8494f2e 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 _0x723e=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','INTEGER','SIP','DADHI','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x50247c,_0x115d4d){var _0x20e2fa=function(_0x238fbf){while(--_0x238fbf){_0x50247c['push'](_0x50247c['shift']());}};_0x20e2fa(++_0x115d4d);}(_0x723e,0x179));var _0xe723=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x723e[_0x30182f];return _0x5207db;};'use strict';var Sequelize=require('sequelize');module[_0xe723('0x0')]={'name':{'type':Sequelize[_0xe723('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe723('0x1')]},'ecm':{'type':Sequelize[_0xe723('0x2')](_0xe723('0x3'),'no'),'defaultValue':_0xe723('0x3')},'headerinfo':{'type':Sequelize[_0xe723('0x1')],'defaultValue':_0xe723('0x4')},'localstationid':{'type':Sequelize[_0xe723('0x1')],'unique':_0xe723('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xe723('0x6'),_0xe723('0x7'),_0xe723('0x8'),_0xe723('0x9'),_0xe723('0xa'),_0xe723('0xb')),'defaultValue':_0xe723('0x7')},'maxrate':{'type':Sequelize[_0xe723('0x2')]('2400',_0xe723('0x7'),_0xe723('0x8'),_0xe723('0x9'),'12000',_0xe723('0xb')),'defaultValue':_0xe723('0xb')},'modem':{'type':Sequelize[_0xe723('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xe723('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe723('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe723('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe723('0x2')](_0xe723('0xd'),'IAX',_0xe723('0xe'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe723('0xf');}},'notificationSound':{'type':Sequelize[_0xe723('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe723('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe723('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe723('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe723('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe723('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe723('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe723('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xe723('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xe723('0x10')],'defaultValue':![],'comment':_0xe723('0x12'),'set':function(_0x4a6f95){if(!_0x4a6f95)this[_0xe723('0x13')](_0xe723('0x14'),null);this[_0xe723('0x13')](_0xe723('0x15'),_0x4a6f95);}}}; \ No newline at end of file +var _0xaa37=['7200','12000','14400','2400','9600','v17,v27,v29','INTEGER','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800'];(function(_0xec9262,_0x3e62bd){var _0x19aeff=function(_0x39c18a){while(--_0x39c18a){_0xec9262['push'](_0xec9262['shift']());}};_0x19aeff(++_0x3e62bd);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xaa37[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0x7aa3('0x0'));module[_0x7aa3('0x1')]={'name':{'type':Sequelize[_0x7aa3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7aa3('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x7aa3('0x3'),'no'),'defaultValue':_0x7aa3('0x3')},'headerinfo':{'type':Sequelize[_0x7aa3('0x2')],'defaultValue':_0x7aa3('0x4')},'localstationid':{'type':Sequelize[_0x7aa3('0x2')],'unique':_0x7aa3('0x5')},'minrate':{'type':Sequelize[_0x7aa3('0x6')]('2400',_0x7aa3('0x7'),_0x7aa3('0x8'),'9600',_0x7aa3('0x9'),_0x7aa3('0xa')),'defaultValue':_0x7aa3('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x7aa3('0xb'),_0x7aa3('0x7'),_0x7aa3('0x8'),_0x7aa3('0xc'),_0x7aa3('0x9'),_0x7aa3('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x7aa3('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7aa3('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7aa3('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x7aa3('0xf'),_0x7aa3('0x10'),'DADHI','KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x7aa3('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7aa3('0x11')],'defaultValue':function(){return _0x7aa3('0x12');}},'notificationSound':{'type':Sequelize[_0x7aa3('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7aa3('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7aa3('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7aa3('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7aa3('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7aa3('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x7aa3('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7aa3('0x15'),'set':function(_0x3f9a75){if(!_0x3f9a75)this['setDataValue'](_0x7aa3('0x16'),null);this[_0x7aa3('0x17')](_0x7aa3('0x18'),_0x3f9a75);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 0c3ea73..cbfc3d4 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 _0xb52f=['FaxApplication','bulkCreate','priority','finally','getApplications','context','from-voip-provider','exten','app','system','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','defaults','redis','localhost','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','include','findAll','rows','show','params','Pause','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','Disposition','pick','filter','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','FaxInteraction','order','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne'];(function(_0x314b10,_0x36f615){var _0x8a7c06=function(_0x2a5e77){while(--_0x2a5e77){_0x314b10['push'](_0x314b10['shift']());}};_0x8a7c06(++_0x36f615);}(_0xb52f,0x1dc));var _0xfb52=function(_0x335a57,_0x3476f4){_0x335a57=_0x335a57-0x0;var _0x4c420e=_0xb52f[_0x335a57];return _0x4c420e;};'use strict';var emlformat=require(_0xfb52('0x0'));var rimraf=require(_0xfb52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb52('0x2'));var rp=require(_0xfb52('0x3'));var moment=require(_0xfb52('0x4'));var BPromise=require(_0xfb52('0x5'));var Mustache=require(_0xfb52('0x6'));var util=require(_0xfb52('0x7'));var path=require(_0xfb52('0x8'));var sox=require(_0xfb52('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb52('0xa'));var squel=require(_0xfb52('0xb'));var crypto=require(_0xfb52('0xc'));var jsforce=require(_0xfb52('0xd'));var deskjs=require(_0xfb52('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb52('0xf'));var authService=require(_0xfb52('0x10'));var qs=require(_0xfb52('0x11'));var as=require(_0xfb52('0x12'));var hardwareService=require(_0xfb52('0x13'));var logger=require(_0xfb52('0x14'))(_0xfb52('0x15'));var utils=require(_0xfb52('0x16'));var config=require(_0xfb52('0x17'));var licenseUtil=require(_0xfb52('0x18'));var db=require(_0xfb52('0x19'))['db'];config['redis']=_[_0xfb52('0x1a')](config[_0xfb52('0x1b')],{'host':_0xfb52('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfb52('0x1d'))[_0xfb52('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfb52('0x1f')][_0xfb52('0x20')]({'port':0x232c});var client9002=jayson[_0xfb52('0x1f')][_0xfb52('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1148dc,_0x53397c,_0x5a8662,_0xe5a2d1){return new BPromise(function(_0x20573c,_0x579656){var _0x52261f=_0xe5a2d1||client;return _0x52261f[_0xfb52('0x21')](_0x1148dc,_0x5a8662)['then'](function(_0x1803f6){logger[_0xfb52('0x22')](_0xfb52('0x23'),_0x53397c,_0xfb52('0x24'));logger[_0xfb52('0x25')](_0xfb52('0x26'),_0x53397c,_0xfb52('0x24'),JSON['stringify'](_0x1803f6));if(_0x1803f6[_0xfb52('0x27')]){if(_0x1803f6[_0xfb52('0x27')][_0xfb52('0x28')]===0x1f4){logger[_0xfb52('0x27')]('FaxAccount,\x20%s,\x20%s',_0x53397c,_0x1803f6[_0xfb52('0x27')]['message']);return _0x579656(_0x1803f6['error'][_0xfb52('0x29')]);}logger['error'](_0xfb52('0x23'),_0x53397c,_0x1803f6[_0xfb52('0x27')][_0xfb52('0x29')]);return _0x20573c(_0x1803f6[_0xfb52('0x27')][_0xfb52('0x29')]);}else{logger[_0xfb52('0x22')](_0xfb52('0x23'),_0x53397c,_0xfb52('0x24'));_0x20573c(_0x1803f6[_0xfb52('0x2a')][_0xfb52('0x29')]);}})[_0xfb52('0x2b')](function(_0x245731){logger[_0xfb52('0x27')](_0xfb52('0x23'),_0x53397c,_0x245731);_0x579656(_0x245731);});});}function respondWithStatusCode(_0x95d661,_0x49bb82){_0x49bb82=_0x49bb82||0xcc;return function(_0x625d61){if(_0x625d61){return _0x95d661[_0xfb52('0x2c')](_0x49bb82);}return _0x95d661[_0xfb52('0x2d')](_0x49bb82)[_0xfb52('0x2e')]();};}function respondWithResult(_0x1dbdc6,_0x573e17){_0x573e17=_0x573e17||0xc8;return function(_0x31ca4f){if(_0x31ca4f){return _0x1dbdc6[_0xfb52('0x2d')](_0x573e17)['json'](_0x31ca4f);}};}function respondWithFilteredResult(_0x392e82,_0x3e8086){return function(_0xb5f063){if(_0xb5f063){var _0x19c149=typeof _0x3e8086[_0xfb52('0x2f')]===_0xfb52('0x30')&&typeof _0x3e8086[_0xfb52('0x31')]==='undefined';var _0x4cf4b4=_0xb5f063['count'];var _0x131fb3=_0x19c149?0x0:_0x3e8086[_0xfb52('0x2f')];var _0x42d108=_0x19c149?_0xb5f063[_0xfb52('0x32')]:_0x3e8086[_0xfb52('0x2f')]+_0x3e8086[_0xfb52('0x31')];var _0x339309;if(_0x42d108>=_0x4cf4b4){_0x42d108=_0x4cf4b4;_0x339309=0xc8;}else{_0x339309=0xce;}_0x392e82['status'](_0x339309);return _0x392e82[_0xfb52('0x33')](_0xfb52('0x34'),_0x131fb3+'-'+_0x42d108+'/'+_0x4cf4b4)[_0xfb52('0x35')](_0xb5f063);}return null;};}function patchUpdates(_0x17b95e){return function(_0x478405){try{jsonpatch[_0xfb52('0x36')](_0x478405,_0x17b95e,!![]);}catch(_0x3e77ee){return BPromise[_0xfb52('0x37')](_0x3e77ee);}return _0x478405[_0xfb52('0x38')]();};}function saveUpdates(_0x5202f2,_0x506dee){return function(_0xc28ef4){if(_0xc28ef4){return _0xc28ef4[_0xfb52('0x39')](_0x5202f2)[_0xfb52('0x3a')](function(_0xb31cd7){return _0xb31cd7;});}return null;};}function removeEntity(_0x16b69c,_0x34979d){return function(_0x52a048){if(_0x52a048){return _0x52a048['destroy']()[_0xfb52('0x3a')](function(){var _0x2f98bb=_0x52a048[_0xfb52('0x3b')]({'plain':!![]});var _0x5fd272='FaxAccounts';return db[_0xfb52('0x3c')][_0xfb52('0x3d')]({'where':{'type':_0x5fd272,'resourceId':_0x2f98bb['id']}})[_0xfb52('0x3a')](function(){return _0x52a048;});})[_0xfb52('0x3a')](function(){_0x16b69c[_0xfb52('0x2d')](0xcc)[_0xfb52('0x2e')]();});}};}function handleEntityNotFound(_0x2bffef,_0x346049){return function(_0x10a402){if(!_0x10a402){_0x2bffef['sendStatus'](0x194);}return _0x10a402;};}function handleError(_0x346fe6,_0x3c8168){_0x3c8168=_0x3c8168||0x1f4;return function(_0x195aaf){logger[_0xfb52('0x27')](_0x195aaf[_0xfb52('0x3e')]);if(_0x195aaf[_0xfb52('0x3f')]){delete _0x195aaf['name'];}_0x346fe6[_0xfb52('0x2d')](_0x3c8168)[_0xfb52('0x40')](_0x195aaf);};}exports[_0xfb52('0x41')]=function(_0x589a84,_0x114945){var _0x2a486d={'include':[{'model':db['Pause'],'as':_0xfb52('0x42')}]},_0x50c81f={},_0x448eb6={'count':0x0,'rows':[]};var _0x4700f2=_[_0xfb52('0x43')](db[_0xfb52('0x44')][_0xfb52('0x45')],function(_0x4217b3){return{'name':_0x4217b3[_0xfb52('0x46')],'type':_0x4217b3[_0xfb52('0x47')][_0xfb52('0x48')]};});_0x50c81f[_0xfb52('0x49')]=_[_0xfb52('0x43')](_0x4700f2,_0xfb52('0x3f'));_0x50c81f[_0xfb52('0x4a')]=_[_0xfb52('0x4b')](_0x589a84[_0xfb52('0x4a')]);_0x50c81f[_0xfb52('0x4c')]=_[_0xfb52('0x4d')](_0x50c81f[_0xfb52('0x49')],_0x50c81f[_0xfb52('0x4a')]);_0x2a486d[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x50c81f[_0xfb52('0x49')],qs[_0xfb52('0x4f')](_0x589a84[_0xfb52('0x4a')][_0xfb52('0x4f')]));_0x2a486d[_0xfb52('0x4e')]=_0x2a486d['attributes']['length']?_0x2a486d['attributes']:_0x50c81f[_0xfb52('0x49')];if(!_0x589a84[_0xfb52('0x4a')][_0xfb52('0x50')](_0xfb52('0x51'))){_0x2a486d['limit']=qs[_0xfb52('0x31')](_0x589a84[_0xfb52('0x4a')]['limit']);_0x2a486d[_0xfb52('0x2f')]=qs[_0xfb52('0x2f')](_0x589a84[_0xfb52('0x4a')][_0xfb52('0x2f')]);}_0x2a486d['order']=qs[_0xfb52('0x52')](_0x589a84[_0xfb52('0x4a')][_0xfb52('0x52')]);_0x2a486d['where']=qs[_0xfb52('0x4c')](_['pick'](_0x589a84[_0xfb52('0x4a')],_0x50c81f[_0xfb52('0x4c')]),_0x4700f2);if(_0x589a84[_0xfb52('0x4a')]['filter']){_0x2a486d[_0xfb52('0x53')]=_['merge'](_0x2a486d[_0xfb52('0x53')],{'$or':_[_0xfb52('0x43')](_0x4700f2,function(_0x355c1e){if(_0x355c1e[_0xfb52('0x47')]!==_0xfb52('0x54')){var _0x2f992a={};_0x2f992a[_0x355c1e['name']]={'$like':'%'+_0x589a84[_0xfb52('0x4a')]['filter']+'%'};return _0x2f992a;}})});}_0x2a486d=_[_0xfb52('0x55')]({},_0x2a486d,_0x589a84[_0xfb52('0x56')]);var _0x5429cf={'where':_0x2a486d['where']};return db[_0xfb52('0x44')]['count'](_0x5429cf)[_0xfb52('0x3a')](function(_0x39e7bd){_0x448eb6[_0xfb52('0x32')]=_0x39e7bd;if(_0x589a84['query']['includeAll']){_0x2a486d[_0xfb52('0x57')]=[{'all':!![]}];}return db[_0xfb52('0x44')][_0xfb52('0x58')](_0x2a486d);})[_0xfb52('0x3a')](function(_0xe427de){_0x448eb6[_0xfb52('0x59')]=_0xe427de;return _0x448eb6;})['then'](respondWithFilteredResult(_0x114945,_0x2a486d))[_0xfb52('0x2b')](handleError(_0x114945,null));};exports[_0xfb52('0x5a')]=function(_0x3607e2,_0x5d1d57){var _0x44df80={'raw':![],'where':{'id':_0x3607e2[_0xfb52('0x5b')]['id']},'include':[{'model':db[_0xfb52('0x5c')],'as':_0xfb52('0x42')}]},_0x541b89={};_0x541b89[_0xfb52('0x49')]=_[_0xfb52('0x4b')](db[_0xfb52('0x44')][_0xfb52('0x45')]);_0x541b89[_0xfb52('0x4a')]=_[_0xfb52('0x4b')](_0x3607e2['query']);_0x541b89[_0xfb52('0x4c')]=_[_0xfb52('0x4d')](_0x541b89[_0xfb52('0x49')],_0x541b89['query']);_0x44df80[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x541b89[_0xfb52('0x49')],qs[_0xfb52('0x4f')](_0x3607e2[_0xfb52('0x4a')]['fields']));_0x44df80[_0xfb52('0x4e')]=_0x44df80[_0xfb52('0x4e')][_0xfb52('0x5d')]?_0x44df80[_0xfb52('0x4e')]:_0x541b89['model'];if(_0x3607e2[_0xfb52('0x4a')][_0xfb52('0x5e')]){_0x44df80[_0xfb52('0x57')]=[{'all':!![]}];}_0x44df80=_[_0xfb52('0x55')]({},_0x44df80,_0x3607e2[_0xfb52('0x56')]);return db['FaxAccount'][_0xfb52('0x5f')](_0x44df80)[_0xfb52('0x3a')](handleEntityNotFound(_0x5d1d57,null))['then'](respondWithResult(_0x5d1d57,null))[_0xfb52('0x2b')](handleError(_0x5d1d57,null));};exports[_0xfb52('0x60')]=function(_0x288fd0,_0x5a11db){return db[_0xfb52('0x44')][_0xfb52('0x60')](_0x288fd0[_0xfb52('0x61')],{})[_0xfb52('0x3a')](function(_0x5a72df){var _0x457170=_0x288fd0[_0xfb52('0x62')][_0xfb52('0x3b')]({'plain':!![]});if(!_0x457170)throw new Error(_0xfb52('0x63'));if(_0x457170[_0xfb52('0x64')]===_0xfb52('0x62')){var _0x446683=_0x5a72df[_0xfb52('0x3b')]({'plain':!![]});var _0x2d0715=_0xfb52('0x65');return db['UserProfileSection'][_0xfb52('0x5f')]({'where':{'name':_0x2d0715,'userProfileId':_0x457170[_0xfb52('0x66')]},'raw':!![]})[_0xfb52('0x3a')](function(_0x12ce0a){if(_0x12ce0a&&_0x12ce0a[_0xfb52('0x67')]===0x0){return db[_0xfb52('0x3c')]['create']({'name':_0x446683[_0xfb52('0x3f')],'resourceId':_0x446683['id'],'type':_0x12ce0a['name'],'sectionId':_0x12ce0a['id']},{})[_0xfb52('0x3a')](function(){return _0x5a72df;});}else{return _0x5a72df;}})[_0xfb52('0x2b')](function(_0x383535){logger[_0xfb52('0x27')](_0xfb52('0x68'),_0x383535);throw _0x383535;});}return _0x5a72df;})[_0xfb52('0x3a')](respondWithResult(_0x5a11db,0xc9))[_0xfb52('0x2b')](handleError(_0x5a11db,null));};exports['update']=function(_0x1e7afc,_0x4ad72e){if(_0x1e7afc['body']['id']){delete _0x1e7afc[_0xfb52('0x61')]['id'];}return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0x1e7afc['params']['id']},'include':[{'model':db['Pause'],'as':_0xfb52('0x42')}]})['then'](handleEntityNotFound(_0x4ad72e,null))[_0xfb52('0x3a')](saveUpdates(_0x1e7afc['body'],null))[_0xfb52('0x3a')](respondWithResult(_0x4ad72e,null))[_0xfb52('0x2b')](handleError(_0x4ad72e,null));};exports[_0xfb52('0x3d')]=function(_0x665fab,_0xc97bfe){return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0x665fab[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0xc97bfe,null))[_0xfb52('0x3a')](removeEntity(_0xc97bfe,null))['catch'](handleError(_0xc97bfe,null));};exports[_0xfb52('0x69')]=function(_0x39de27,_0x380982){return db[_0xfb52('0x44')][_0xfb52('0x69')]()[_0xfb52('0x3a')](respondWithResult(_0x380982,null))[_0xfb52('0x2b')](handleError(_0x380982,null));};exports[_0xfb52('0x6a')]=function(_0x2e3c63,_0x246e87,_0x4b3ce1){if(_0x2e3c63[_0xfb52('0x61')]['id']){delete _0x2e3c63['body']['id'];}return db[_0xfb52('0x44')]['find']({'where':{'id':_0x2e3c63[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x246e87,null))['then'](function(_0x668815){if(_0x668815){_0x2e3c63['body'][_0xfb52('0x6b')]=_0x668815['id'];return db['Disposition'][_0xfb52('0x60')](_0x2e3c63[_0xfb52('0x61')]);}})['then'](respondWithResult(_0x246e87,null))[_0xfb52('0x2b')](handleError(_0x246e87,null));};exports[_0xfb52('0x6c')]=function(_0x3cb998,_0x110f63,_0x4b50b9){var _0x500fc5={'raw':![],'where':{}};var _0x1094e1={};var _0x1652e7={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3cb998['params']['id']}})['then'](handleEntityNotFound(_0x110f63,null))[_0xfb52('0x3a')](function(_0x2b53c5){if(_0x2b53c5){_0x1094e1[_0xfb52('0x49')]=_['keys'](db[_0xfb52('0x6d')][_0xfb52('0x45')]);_0x1094e1[_0xfb52('0x4a')]=_['keys'](_0x3cb998[_0xfb52('0x4a')]);_0x1094e1[_0xfb52('0x4c')]=_['intersection'](_0x1094e1[_0xfb52('0x49')],_0x1094e1[_0xfb52('0x4a')]);_0x500fc5[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x1094e1[_0xfb52('0x49')],qs[_0xfb52('0x4f')](_0x3cb998[_0xfb52('0x4a')][_0xfb52('0x4f')]));_0x500fc5[_0xfb52('0x4e')]=_0x500fc5['attributes'][_0xfb52('0x5d')]?_0x500fc5[_0xfb52('0x4e')]:_0x1094e1['model'];if(!_0x3cb998[_0xfb52('0x4a')][_0xfb52('0x50')](_0xfb52('0x51'))){_0x500fc5[_0xfb52('0x31')]=qs[_0xfb52('0x31')](_0x3cb998[_0xfb52('0x4a')][_0xfb52('0x31')]);_0x500fc5['offset']=qs[_0xfb52('0x2f')](_0x3cb998[_0xfb52('0x4a')]['offset']);}_0x500fc5['order']=qs[_0xfb52('0x52')](_0x3cb998[_0xfb52('0x4a')][_0xfb52('0x52')]);_0x500fc5[_0xfb52('0x53')]=qs[_0xfb52('0x4c')](_[_0xfb52('0x6e')](_0x3cb998['query'],_0x1094e1[_0xfb52('0x4c')]));_0x500fc5[_0xfb52('0x53')][_0xfb52('0x6b')]=_0x2b53c5['id'];if(_0x3cb998[_0xfb52('0x4a')]['filter']){_0x500fc5['where']=_['merge'](_0x500fc5['where'],{'$or':_[_0xfb52('0x43')](_0x500fc5[_0xfb52('0x4e')],function(_0x33e206){var _0x3e62c7={};_0x3e62c7[_0x33e206]={'$like':'%'+_0x3cb998[_0xfb52('0x4a')][_0xfb52('0x6f')]+'%'};return _0x3e62c7;})});}_0x500fc5=_[_0xfb52('0x55')]({},_0x500fc5,_0x3cb998[_0xfb52('0x56')]);return db['Disposition'][_0xfb52('0x32')]({'where':_0x500fc5[_0xfb52('0x53')]})[_0xfb52('0x3a')](function(_0x340c2b){_0x1652e7['count']=_0x340c2b;if(_0x3cb998['query'][_0xfb52('0x5e')]){_0x500fc5[_0xfb52('0x57')]=[{'all':!![]}];}return db[_0xfb52('0x6d')]['findAll'](_0x500fc5);})[_0xfb52('0x3a')](function(_0x46f4f1){_0x1652e7[_0xfb52('0x59')]=_0x46f4f1;return _0x1652e7;});}})[_0xfb52('0x3a')](respondWithFilteredResult(_0x110f63,_0x500fc5))[_0xfb52('0x2b')](handleError(_0x110f63,null));};exports[_0xfb52('0x70')]=function(_0x39e485,_0x47c72d,_0xfdb427){return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0x39e485[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x47c72d,null))[_0xfb52('0x3a')](function(_0x5a4def){if(_0x5a4def){return _0x5a4def['removeDispositions'](_0x39e485[_0xfb52('0x4a')][_0xfb52('0x71')]);}})[_0xfb52('0x3a')](respondWithStatusCode(_0x47c72d,null))[_0xfb52('0x2b')](handleError(_0x47c72d,null));};exports['addAnswer']=function(_0x3fddbb,_0x3ff186,_0x5c8bf3){if(_0x3fddbb[_0xfb52('0x61')]['id']){delete _0x3fddbb[_0xfb52('0x61')]['id'];}return db['FaxAccount'][_0xfb52('0x5f')]({'where':{'id':_0x3fddbb[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x3ff186,null))[_0xfb52('0x3a')](function(_0x3f6cf5){if(_0x3f6cf5){_0x3fddbb[_0xfb52('0x61')][_0xfb52('0x6b')]=_0x3f6cf5['id'];return db[_0xfb52('0x72')]['create'](_0x3fddbb[_0xfb52('0x61')]);}})[_0xfb52('0x3a')](respondWithResult(_0x3ff186,null))[_0xfb52('0x2b')](handleError(_0x3ff186,null));};exports[_0xfb52('0x73')]=function(_0x23b719,_0x357c19,_0x33fdda){var _0x13f6ed={'raw':![],'where':{}};var _0x5ad9d5={};var _0x5b54d7={'count':0x0,'rows':[]};return db[_0xfb52('0x44')]['findOne']({'where':{'id':_0x23b719[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x357c19,null))['then'](function(_0x883efb){if(_0x883efb){_0x5ad9d5[_0xfb52('0x49')]=_[_0xfb52('0x4b')](db[_0xfb52('0x72')][_0xfb52('0x45')]);_0x5ad9d5[_0xfb52('0x4a')]=_['keys'](_0x23b719[_0xfb52('0x4a')]);_0x5ad9d5[_0xfb52('0x4c')]=_['intersection'](_0x5ad9d5[_0xfb52('0x49')],_0x5ad9d5[_0xfb52('0x4a')]);_0x13f6ed[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x5ad9d5[_0xfb52('0x49')],qs[_0xfb52('0x4f')](_0x23b719[_0xfb52('0x4a')]['fields']));_0x13f6ed[_0xfb52('0x4e')]=_0x13f6ed['attributes'][_0xfb52('0x5d')]?_0x13f6ed[_0xfb52('0x4e')]:_0x5ad9d5[_0xfb52('0x49')];if(!_0x23b719[_0xfb52('0x4a')][_0xfb52('0x50')]('nolimit')){_0x13f6ed[_0xfb52('0x31')]=qs[_0xfb52('0x31')](_0x23b719[_0xfb52('0x4a')][_0xfb52('0x31')]);_0x13f6ed[_0xfb52('0x2f')]=qs[_0xfb52('0x2f')](_0x23b719[_0xfb52('0x4a')][_0xfb52('0x2f')]);}_0x13f6ed['order']=qs[_0xfb52('0x52')](_0x23b719[_0xfb52('0x4a')]['sort']);_0x13f6ed[_0xfb52('0x53')]=qs['filters'](_[_0xfb52('0x6e')](_0x23b719['query'],_0x5ad9d5[_0xfb52('0x4c')]));_0x13f6ed[_0xfb52('0x53')][_0xfb52('0x6b')]=_0x883efb['id'];if(_0x23b719['query']['filter']){_0x13f6ed[_0xfb52('0x53')]=_['merge'](_0x13f6ed[_0xfb52('0x53')],{'$or':_['map'](_0x13f6ed[_0xfb52('0x4e')],function(_0x4441f4){var _0x3d1c07={};_0x3d1c07[_0x4441f4]={'$like':'%'+_0x23b719['query'][_0xfb52('0x6f')]+'%'};return _0x3d1c07;})});}_0x13f6ed=_[_0xfb52('0x55')]({},_0x13f6ed,_0x23b719['options']);return db[_0xfb52('0x72')][_0xfb52('0x32')]({'where':_0x13f6ed['where']})['then'](function(_0x4633d6){_0x5b54d7[_0xfb52('0x32')]=_0x4633d6;if(_0x23b719[_0xfb52('0x4a')][_0xfb52('0x5e')]){_0x13f6ed[_0xfb52('0x57')]=[{'all':!![]}];}return db[_0xfb52('0x72')]['findAll'](_0x13f6ed);})[_0xfb52('0x3a')](function(_0x15992d){_0x5b54d7[_0xfb52('0x59')]=_0x15992d;return _0x5b54d7;});}})[_0xfb52('0x3a')](respondWithFilteredResult(_0x357c19,_0x13f6ed))['catch'](handleError(_0x357c19,null));};exports[_0xfb52('0x74')]=function(_0x3fd328,_0x537cd8,_0x2c6fe2){return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0x3fd328['params']['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x537cd8,null))['then'](function(_0x48e4fa){if(_0x48e4fa){return _0x48e4fa[_0xfb52('0x74')](_0x3fd328[_0xfb52('0x4a')][_0xfb52('0x71')]);}})[_0xfb52('0x3a')](respondWithStatusCode(_0x537cd8,null))[_0xfb52('0x2b')](handleError(_0x537cd8,null));};exports[_0xfb52('0x75')]=function(_0x23b2e3,_0x599a82,_0x366a73){return db['FaxInteraction'][_0xfb52('0x5f')]({'where':{'id':_0x23b2e3['params']['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x599a82,null))[_0xfb52('0x3a')](function(_0x46ba63){if(_0x46ba63){return _0x46ba63['addInteraction'](_0x23b2e3[_0xfb52('0x61')]['ids'],_[_0xfb52('0x76')](_0x23b2e3[_0xfb52('0x61')],['ids','id'])||{});}})[_0xfb52('0x3a')](respondWithResult(_0x599a82,null))['catch'](handleError(_0x599a82,null));};exports['getInteractions']=function(_0x51583c,_0x597084,_0x1c577f){var _0x46df49={'raw':![],'where':{}};var _0x313d99={};var _0x50582c={'count':0x0,'rows':[]};return db[_0xfb52('0x44')]['findOne']({'where':{'id':_0x51583c[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x597084,null))['then'](function(_0x35a813){if(_0x35a813){_0x313d99[_0xfb52('0x49')]=_[_0xfb52('0x4b')](db[_0xfb52('0x77')][_0xfb52('0x45')]);_0x313d99[_0xfb52('0x4a')]=_[_0xfb52('0x4b')](_0x51583c['query']);_0x313d99[_0xfb52('0x4c')]=_[_0xfb52('0x4d')](_0x313d99[_0xfb52('0x49')],_0x313d99[_0xfb52('0x4a')]);_0x46df49[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x313d99[_0xfb52('0x49')],qs[_0xfb52('0x4f')](_0x51583c[_0xfb52('0x4a')][_0xfb52('0x4f')]));_0x46df49[_0xfb52('0x4e')]=_0x46df49[_0xfb52('0x4e')][_0xfb52('0x5d')]?_0x46df49[_0xfb52('0x4e')]:_0x313d99[_0xfb52('0x49')];if(!_0x51583c[_0xfb52('0x4a')][_0xfb52('0x50')](_0xfb52('0x51'))){_0x46df49[_0xfb52('0x31')]=qs[_0xfb52('0x31')](_0x51583c[_0xfb52('0x4a')][_0xfb52('0x31')]);_0x46df49[_0xfb52('0x2f')]=qs[_0xfb52('0x2f')](_0x51583c['query'][_0xfb52('0x2f')]);}_0x46df49[_0xfb52('0x78')]=qs[_0xfb52('0x52')](_0x51583c[_0xfb52('0x4a')][_0xfb52('0x52')]);_0x46df49['where']=qs[_0xfb52('0x4c')](_[_0xfb52('0x6e')](_0x51583c['query'],_0x313d99['filters']));_0x46df49[_0xfb52('0x53')][_0xfb52('0x6b')]=_0x35a813['id'];if(_0x51583c['query'][_0xfb52('0x6f')]){_0x46df49[_0xfb52('0x53')]=_['merge'](_0x46df49[_0xfb52('0x53')],{'$or':_[_0xfb52('0x43')](_0x46df49['attributes'],function(_0x448abd){var _0x56e23e={};_0x56e23e[_0x448abd]={'$like':'%'+_0x51583c[_0xfb52('0x4a')]['filter']+'%'};return _0x56e23e;})});}_0x46df49=_[_0xfb52('0x55')]({},_0x46df49,_0x51583c[_0xfb52('0x56')]);return db[_0xfb52('0x77')]['count']({'where':_0x46df49[_0xfb52('0x53')]})[_0xfb52('0x3a')](function(_0x2560bd){_0x50582c[_0xfb52('0x32')]=_0x2560bd;if(_0x51583c[_0xfb52('0x4a')]['includeAll']){_0x46df49[_0xfb52('0x57')]=[{'model':db[_0xfb52('0x79')],'as':_0xfb52('0x7a'),'required':![]},{'model':db[_0xfb52('0x7b')],'as':_0xfb52('0x7c'),'attributes':[_0xfb52('0x3f'),_0xfb52('0x7d'),_0xfb52('0x7e')],'required':![]},{'model':db['Tag'],'as':_0xfb52('0x7f'),'attributes':['id',_0xfb52('0x3f'),_0xfb52('0x80')],'where':_0x51583c[_0xfb52('0x4a')][_0xfb52('0x81')]?{'id':_0x51583c[_0xfb52('0x4a')][_0xfb52('0x81')]}:undefined,'required':_0x51583c['query'][_0xfb52('0x81')]?!![]:![]}];}return db['FaxInteraction'][_0xfb52('0x58')](_0x46df49);})['then'](function(_0x5bf39d){_0x50582c[_0xfb52('0x59')]=_0x5bf39d;return _0x50582c;});}})['then'](respondWithFilteredResult(_0x597084,_0x46df49))['catch'](handleError(_0x597084,null));};exports[_0xfb52('0x82')]=function(_0x57cf0e,_0x167726){var _0x15ddb8=_0x57cf0e[_0xfb52('0x5b')]['id'];var _0x2484c1=_0x57cf0e['body'];var _0x10365b=0xc8;var _0x3dddac=null;return db[_0xfb52('0x83')][_0xfb52('0x84')]({'isolationLevel':db['sequelize']['Transaction'][_0xfb52('0x85')][_0xfb52('0x86')]},function(_0x410239){return db[_0xfb52('0x44')][_0xfb52('0x87')]({'where':{'id':_0x15ddb8},'transaction':_0x410239})[_0xfb52('0x3a')](function(_0x427177){if(_0x427177){return db[_0xfb52('0x88')][_0xfb52('0x3d')]({'where':{'FaxAccountId':_0x15ddb8},'transaction':_0x410239})[_0xfb52('0x3a')](function(){var _0x1b17c3=_[_0xfb52('0x43')](_0x2484c1,function(_0x15b03e){_0x15b03e[_0xfb52('0x6b')]=_0x15ddb8;return _0x15b03e;});return db[_0xfb52('0x88')][_0xfb52('0x89')](_0x1b17c3,{'transaction':_0x410239});});}else{_0x10365b=0x194;_0x3dddac=[];}});})[_0xfb52('0x3a')](function(){if(_0x10365b!==0x194){return db[_0xfb52('0x88')]['findAndCountAll']({'where':{'FaxAccountId':_0x15ddb8},'order':_0xfb52('0x8a')})['then'](function(_0x2c1e3b){_0x3dddac=_0x2c1e3b;});}})[_0xfb52('0x2b')](function(_0x279f72){_0x10365b=0x1f4;logger[_0xfb52('0x27')](_0x279f72[_0xfb52('0x3e')]);if(_0x279f72[_0xfb52('0x3f')]){delete _0x279f72['name'];}_0x3dddac=_0x279f72;})[_0xfb52('0x8b')](function(){if(_0x3dddac===null){_0x167726['sendStatus'](_0x10365b);}else{if(_0x10365b===0x1f4){_0x167726['status'](_0x10365b)[_0xfb52('0x40')](_0x3dddac);}else{_0x167726[_0xfb52('0x2d')](_0x10365b)[_0xfb52('0x35')](_0x3dddac);}}});};exports[_0xfb52('0x8c')]=function(_0x109c87,_0x5c6013,_0x5e7639){var _0x479f00={};var _0x1485b3={};var _0x509a43;var _0x1c92db;return db['FaxAccount'][_0xfb52('0x87')]({'where':{'id':_0x109c87[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x5c6013,null))[_0xfb52('0x3a')](function(_0x3bd739){if(_0x3bd739){_0x509a43=_0x3bd739;_0x1485b3[_0xfb52('0x49')]=_['keys'](db[_0xfb52('0x88')][_0xfb52('0x45')]);_0x1485b3[_0xfb52('0x4a')]=_[_0xfb52('0x4b')](_0x109c87['query']);_0x1485b3[_0xfb52('0x4c')]=_[_0xfb52('0x4d')](_0x1485b3['model'],_0x1485b3[_0xfb52('0x4a')]);_0x479f00[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x1485b3[_0xfb52('0x49')],qs['fields'](_0x109c87[_0xfb52('0x4a')][_0xfb52('0x4f')]));_0x479f00[_0xfb52('0x4e')]=_0x479f00[_0xfb52('0x4e')][_0xfb52('0x5d')]?_0x479f00[_0xfb52('0x4e')]:_0x1485b3[_0xfb52('0x49')];_0x479f00[_0xfb52('0x78')]=qs[_0xfb52('0x52')](_0x109c87[_0xfb52('0x4a')][_0xfb52('0x52')]);_0x479f00['where']=qs[_0xfb52('0x4c')](_[_0xfb52('0x6e')](_0x109c87[_0xfb52('0x4a')],_0x1485b3[_0xfb52('0x4c')]));if(_0x109c87['query'][_0xfb52('0x6f')]){_0x479f00[_0xfb52('0x53')]=_[_0xfb52('0x55')](_0x479f00[_0xfb52('0x53')],{'$or':_['map'](_0x479f00[_0xfb52('0x4e')],function(_0x244a14){var _0x251f0e={};_0x251f0e[_0x244a14]={'$like':'%'+_0x109c87[_0xfb52('0x4a')][_0xfb52('0x6f')]+'%'};return _0x251f0e;})});}_0x479f00=_['merge']({},_0x479f00,_0x109c87[_0xfb52('0x56')]);return _0x509a43[_0xfb52('0x8c')](_0x479f00);}})[_0xfb52('0x3a')](function(_0x359076){if(_0x359076){_0x1c92db=_0x359076[_0xfb52('0x5d')];if(!_0x109c87[_0xfb52('0x4a')][_0xfb52('0x50')](_0xfb52('0x51'))){_0x479f00[_0xfb52('0x31')]=qs['limit'](_0x109c87[_0xfb52('0x4a')][_0xfb52('0x31')]);_0x479f00[_0xfb52('0x2f')]=qs[_0xfb52('0x2f')](_0x109c87['query']['offset']);}return _0x509a43[_0xfb52('0x8c')](_0x479f00);}})[_0xfb52('0x3a')](function(_0x22f0b1){if(_0x22f0b1){return _0x22f0b1?{'count':_0x1c92db,'rows':_0x22f0b1}:null;}})[_0xfb52('0x3a')](respondWithResult(_0x5c6013,null))[_0xfb52('0x2b')](handleError(_0x5c6013,null));};function Extension(_0x513555,_0x34d51e,_0x35ab91,_0x440532){this[_0xfb52('0x8d')]=_0xfb52('0x8e');this[_0xfb52('0x8f')]=_0x513555['localstationid'];this[_0xfb52('0x90')]=_0x440532;this[_0xfb52('0x47')]=_0xfb52('0x91');this['description']=_0xfb52('0x92');this[_0xfb52('0x6b')]=_0x513555['id'];this[_0xfb52('0x8a')]=_0x34d51e;this[_0xfb52('0x93')]=_0x35ab91;}function createExtensionsReciveFax(_0x3ebcab){var _0x333ad1=0x1;var _0x1553b9=[];_0x1553b9['push'](new Extension(_0x3ebcab,_0x333ad1,'',_0xfb52('0x94')));_0x333ad1+=0x1;_0x1553b9[_0xfb52('0x95')](new Extension(_0x3ebcab,_0x333ad1,_0xfb52('0x96'),_0xfb52('0x97')));_0x333ad1+=0x1;for(var _0xb22c0c in _0x3ebcab){if(_0x3ebcab[_0xfb52('0x50')](_0xb22c0c)&&(_0xb22c0c===_0xfb52('0x98')||_0xb22c0c===_0xfb52('0x99')||_0xb22c0c===_0xfb52('0x9a')||_0xb22c0c===_0xfb52('0x9b')||_0xb22c0c==='headerinfo'||_0xb22c0c===_0xfb52('0x9c')||_0xb22c0c===_0xfb52('0x9d')||_0xb22c0c===_0xfb52('0x9e')||_0xb22c0c===_0xfb52('0x9f'))){_0x1553b9[_0xfb52('0x95')](new Extension(_0x3ebcab,_0x333ad1,_0xfb52('0xa0')+_0xb22c0c+')='+_0x3ebcab[_0xb22c0c],'Set'));_0x333ad1+=0x1;}}_0x1553b9[_0xfb52('0x95')](new Extension(_0x3ebcab,_0x333ad1,'6',_0xfb52('0xa1')));_0x333ad1+=0x1;_0x1553b9['push'](new Extension(_0x3ebcab,_0x333ad1,_0xfb52('0xa2'),_0xfb52('0xa3')));_0x333ad1=0x0;return _0x1553b9;}exports[_0xfb52('0xa4')]=function(_0x5e44f3,_0x5d720e,_0x57a000){var _0x23728b;return db['sequelize']['transaction'](function(_0x570678){return db['FaxAccount'][_0xfb52('0x60')](_0x5e44f3[_0xfb52('0x61')],{'transaction':_0x570678})[_0xfb52('0x3a')](function(_0xdafb0c){_0x23728b=_0xdafb0c[_0xfb52('0x3b')]({'plain':!![]});return db[_0xfb52('0xa5')][_0xfb52('0x89')](createExtensionsReciveFax(_0x23728b),{'transaction':_0x570678});});})[_0xfb52('0x3a')](function(){return _0x23728b;})[_0xfb52('0x3a')](respondWithResult(_0x5d720e,null))[_0xfb52('0x2b')](handleError(_0x5d720e,null));};exports['updateAccountApplications']=function(_0x3359e2,_0x7c58c8,_0x31cf28){var _0x381894;return db[_0xfb52('0x83')][_0xfb52('0x84')](function(_0x1f27be){return db[_0xfb52('0x44')][_0xfb52('0x39')](_0x3359e2[_0xfb52('0x61')],{'where':{'id':_0x3359e2['body']['id']},'transaction':_0x1f27be})[_0xfb52('0x3a')](function(_0x49e749){return db[_0xfb52('0xa5')][_0xfb52('0x3d')]({'where':{'FaxAccountId':_0x3359e2[_0xfb52('0x61')]['id']},'transaction':_0x1f27be})[_0xfb52('0x3a')](function(_0x60b0fb){return db[_0xfb52('0xa5')][_0xfb52('0x89')](createExtensionsReciveFax(_[_0xfb52('0x76')](_0x3359e2[_0xfb52('0x61')],[_0xfb52('0xa6'),_0xfb52('0x48'),_0xfb52('0xa7'),_0xfb52('0xa8'),_0xfb52('0xa9'),_0xfb52('0xaa')])),{'transaction':_0x1f27be});});});})['then'](function(){return db[_0xfb52('0x44')][_0xfb52('0xab')](_0x3359e2[_0xfb52('0x61')]['id']);})[_0xfb52('0x3a')](respondWithResult(_0x7c58c8,null))[_0xfb52('0x2b')](handleError(_0x7c58c8,null));};exports['getMessages']=function(_0x13aadd,_0x138456,_0x2f52d6){var _0x38a1ea={'raw':!![],'where':{}};var _0x5f0ccb={};var _0x5c7057={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x13aadd[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x138456,null))[_0xfb52('0x3a')](function(_0x4ca679){if(_0x4ca679){_0x5f0ccb[_0xfb52('0x49')]=_[_0xfb52('0x4b')](db[_0xfb52('0xac')][_0xfb52('0x45')]);_0x5f0ccb[_0xfb52('0x4a')]=_[_0xfb52('0x4b')](_0x13aadd[_0xfb52('0x4a')]);_0x5f0ccb[_0xfb52('0x4c')]=_[_0xfb52('0x4d')](_0x5f0ccb['model'],_0x5f0ccb[_0xfb52('0x4a')]);_0x38a1ea['attributes']=_[_0xfb52('0x4d')](_0x5f0ccb[_0xfb52('0x49')],qs[_0xfb52('0x4f')](_0x13aadd[_0xfb52('0x4a')]['fields']));_0x38a1ea[_0xfb52('0x4e')]=_0x38a1ea[_0xfb52('0x4e')][_0xfb52('0x5d')]?_0x38a1ea[_0xfb52('0x4e')]:_0x5f0ccb[_0xfb52('0x49')];if(!_0x13aadd['query']['hasOwnProperty'](_0xfb52('0x51'))){_0x38a1ea[_0xfb52('0x31')]=qs[_0xfb52('0x31')](_0x13aadd[_0xfb52('0x4a')][_0xfb52('0x31')]);_0x38a1ea[_0xfb52('0x2f')]=qs['offset'](_0x13aadd[_0xfb52('0x4a')][_0xfb52('0x2f')]);}_0x38a1ea[_0xfb52('0x78')]=qs[_0xfb52('0x52')](_0x13aadd[_0xfb52('0x4a')][_0xfb52('0x52')]);_0x38a1ea[_0xfb52('0x53')]=qs[_0xfb52('0x4c')](_[_0xfb52('0x6e')](_0x13aadd[_0xfb52('0x4a')],_0x5f0ccb[_0xfb52('0x4c')]));_0x38a1ea['where'][_0xfb52('0x6b')]=_0x4ca679['id'];if(_0x13aadd[_0xfb52('0x4a')][_0xfb52('0x6f')]){_0x38a1ea['where']=_[_0xfb52('0x55')](_0x38a1ea[_0xfb52('0x53')],{'$or':_[_0xfb52('0x43')](_0x38a1ea[_0xfb52('0x4e')],function(_0x23beec){var _0x2487d1={};_0x2487d1[_0x23beec]={'$like':'%'+_0x13aadd['query'][_0xfb52('0x6f')]+'%'};return _0x2487d1;})});}if(_0x13aadd[_0xfb52('0x4a')][_0xfb52('0xad')]){var _0x5e63a4=_0x13aadd['query'][_0xfb52('0xad')][_0xfb52('0xae')](',');var _0x538737={};_0x538737[_0x5e63a4[0x0]]={'$gte':moment(_0x5e63a4[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x38a1ea['where']=_['merge'](_0x38a1ea[_0xfb52('0x53')],_0x538737);}_0x38a1ea=_['merge']({},_0x38a1ea,_0x13aadd[_0xfb52('0x56')]);return db[_0xfb52('0xac')][_0xfb52('0x32')]({'where':_0x38a1ea[_0xfb52('0x53')]})['then'](function(_0x252e54){_0x5c7057[_0xfb52('0x32')]=_0x252e54;if(_0x13aadd[_0xfb52('0x4a')]['includeAll']){_0x38a1ea[_0xfb52('0x57')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x38a1ea);})[_0xfb52('0x3a')](function(_0x1ae6cc){_0x5c7057[_0xfb52('0x59')]=_0x1ae6cc;return _0x5c7057;});}})[_0xfb52('0x3a')](respondWithFilteredResult(_0x138456,_0x38a1ea))[_0xfb52('0x2b')](handleError(_0x138456,null));};exports['send']=function(_0xb2c6af,_0x583218,_0x3a322b){var _0x65a69f,_0x53e98b={},_0x360628;if(_0xb2c6af[_0xfb52('0x61')]['to']){_0x360628=_0xb2c6af[_0xfb52('0x61')]['to'][0x0];}return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0xb2c6af[_0xfb52('0x5b')]['id']},'include':[{'model':db[_0xfb52('0xaf')],'as':_0xfb52('0xb0'),'include':[{'model':db[_0xfb52('0x79')],'as':_0xfb52('0xb1'),'where':{'fax':_0x360628},'limit':0x1,'order':[[_0xfb52('0xa8'),_0xfb52('0xb2')]]}]}]})[_0xfb52('0x3a')](handleEntityNotFound(_0x583218,null))['then'](function(_0x5138a7){_0x65a69f=_0x5138a7;if(_0xb2c6af[_0xfb52('0x61')]['attachments']&&_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][_0xfb52('0x5d')]){for(var _0x4af522=0x0;_0x4af522<_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][_0xfb52('0x5d')];_0x4af522+=0x1){_0xb2c6af['body']['attachments'][_0x4af522]={'filename':_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][_0x4af522][_0xfb52('0x3f')],'id':_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][_0x4af522]['id'],'path':path[_0xfb52('0xb4')](config['root'],_0xfb52('0xb5'),_0xb2c6af['body'][_0xfb52('0xb3')][_0x4af522][_0xfb52('0xb6')])};}}return respondWithRpcPromise('CheckAfterSend',_0xfb52('0xb7'),{'FaxAccountId':_[_0xfb52('0xb8')](_0xb2c6af[_0xfb52('0x5b')]['id'])?undefined:_0xb2c6af['params']['id'],'path':_[_0xfb52('0xb8')](_0xb2c6af['body']['attachments'][0x0][_0xfb52('0x8')])?undefined:_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][0x0][_0xfb52('0x8')],'fax':_[_0xfb52('0xb8')](_0xb2c6af['body']['to'][0x0])?undefined:_0xb2c6af['body']['to'][0x0]},client9002);})['then'](function(){if(_0x65a69f){if(_[_0xfb52('0xb8')](_0xb2c6af['body'][_0xfb52('0xb9')])){_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb9')]=util[_0xfb52('0xba')](_0xfb52('0xbb'),_0x65a69f['name'],_0x65a69f[_0xfb52('0xbc')]);}if(_0x65a69f[_0xfb52('0xb0')]){if(_0x65a69f['List'][_0xfb52('0xb1')][_0xfb52('0x5d')]){return _0x65a69f[_0xfb52('0xb0')][_0xfb52('0xb1')][0x0];}else{return db[_0xfb52('0x79')][_0xfb52('0x60')](_[_0xfb52('0x1a')](_0xb2c6af[_0xfb52('0x61')],{'firstName':_0xb2c6af[_0xfb52('0x61')]['to'][0x0],'phone':_0xb2c6af[_0xfb52('0x61')]['to'][0x0],'fax':_0xb2c6af['body']['to'][0x0],'ListId':_0x65a69f['ListId']}));}}else{throw new Error(_0xfb52('0xbd'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x3b6d73){if(_0x3b6d73){return db[_0xfb52('0x77')][_0xfb52('0x5f')]({'where':{'ContactId':_0x3b6d73['id'],'closed':![],'FaxAccountId':_0x65a69f['id']}})[_0xfb52('0x3a')](function(_0x266fef){if(_0x266fef){return[_0x266fef,![]];}return db['FaxInteraction']['create']({'UserId':_0xb2c6af['user']['id'],'ContactId':_0x3b6d73['id'],'FaxAccountId':_0x65a69f['id'],'fax':_0xb2c6af[_0xfb52('0x61')]['to'][0x0],'firstMsgDirection':_0xfb52('0xbe'),'Messages':[_['merge'](_0xb2c6af['body'],{'read':![],'body':_0xb2c6af[_0xfb52('0x61')]['attachments'][0x0]['filename'],'FaxAccountId':_0x65a69f['id'],'UserId':_0xb2c6af[_0xfb52('0x62')]['id'],'ContactId':_0x3b6d73['id'],'AttachmentId':_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xfb52('0xbf')}]})[_0xfb52('0x3a')](function(_0x2b1d98){return[_0x2b1d98,!![]];});});}else{throw new Error(_0xfb52('0xc0'));}})[_0xfb52('0xc1')](function(_0x4fbf7e,_0x5ee3ae){if(_0x5ee3ae){return _0x4fbf7e;}return db[_0xfb52('0xac')][_0xfb52('0x60')]({'direction':_0xfb52('0xbe'),'read':![],'body':_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][0x0][_0xfb52('0xc2')],'FaxAccountId':_0x65a69f['id'],'FaxInteractionId':_0x4fbf7e['id'],'UserId':_0xb2c6af[_0xfb52('0x62')]['id'],'ContactId':_0x4fbf7e[_0xfb52('0xc3')],'AttachmentId':_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][0x0]['id']})[_0xfb52('0x3a')](function(_0x32a934){_0x4fbf7e[_0xfb52('0xc4')][_0xfb52('0xbf')]=[];_0x4fbf7e[_0xfb52('0xc4')][_0xfb52('0xbf')][_0xfb52('0x95')](_0x32a934[_0xfb52('0xc4')]);return _0x4fbf7e;});})[_0xfb52('0x3a')](function(_0x3bfd87){respondWithRpcPromise(_0xfb52('0xc5'),_0xfb52('0xc5'),{'FaxAccountId':_[_0xfb52('0xb8')](_0xb2c6af[_0xfb52('0x5b')]['id'])?undefined:_0xb2c6af['params']['id'],'path':_['isNil'](_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][0x0][_0xfb52('0x8')])?undefined:_0xb2c6af['body'][_0xfb52('0xb3')][0x0][_0xfb52('0x8')],'fax':_[_0xfb52('0xb8')](_0xb2c6af[_0xfb52('0x61')]['to'][0x0])?undefined:_0xb2c6af['body']['to'][0x0],'AttachmentId':_0xb2c6af[_0xfb52('0x61')][_0xfb52('0xb3')][0x0]['id']},client9002)[_0xfb52('0x3a')](function(_0x2f3aa7){logger[_0xfb52('0x22')]('SendFaxRpc,\x20%s',_0x2f3aa7);})[_0xfb52('0x2b')](function(_0x30717d){logger[_0xfb52('0x22')](_0xfb52('0xc6'),_0x30717d);});return _0x3bfd87;})[_0xfb52('0x3a')](respondWithResult(_0x583218,null))['catch'](handleError(_0x583218,null));};exports[_0xfb52('0xc7')]=function(_0x59b00e,_0x3682ef,_0x309936){return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0x59b00e[_0xfb52('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3682ef,null))['then'](function(_0x2b7915){if(_0x2b7915){return _0x2b7915['addAgents'](_0x59b00e['body'][_0xfb52('0x71')],_['omit'](_0x59b00e[_0xfb52('0x61')],[_0xfb52('0x71'),'id'])||{})['spread'](function(_0x5b3586){for(var _0x1976b4=0x0;_0x1976b4<_0x59b00e[_0xfb52('0x61')]['ids'][_0xfb52('0x5d')];_0x1976b4+=0x1){socket['emit'](_0xfb52('0xc8'),{'UserId':Number(_0x59b00e[_0xfb52('0x61')]['ids'][_0x1976b4]),'FaxAccountId':Number(_0x59b00e[_0xfb52('0x5b')]['id'])});}return _0x5b3586;});}})[_0xfb52('0x3a')](respondWithResult(_0x3682ef,null))[_0xfb52('0x2b')](handleError(_0x3682ef,null));};exports[_0xfb52('0xc9')]=function(_0x399d7c,_0x559963,_0x4aaf88){return db[_0xfb52('0x44')][_0xfb52('0x5f')]({'where':{'id':_0x399d7c['params']['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x559963,null))[_0xfb52('0x3a')](function(_0x475423){if(_0x475423){return _0x475423[_0xfb52('0xc9')](_0x399d7c['query'][_0xfb52('0x71')])[_0xfb52('0x3a')](function(){if(_['isArray'](_0x399d7c[_0xfb52('0x4a')][_0xfb52('0x71')])){for(var _0x10892d=0x0;_0x10892d<_0x399d7c[_0xfb52('0x4a')][_0xfb52('0x71')][_0xfb52('0x5d')];_0x10892d+=0x1){socket['emit'](_0xfb52('0xca'),{'UserId':Number(_0x399d7c[_0xfb52('0x4a')][_0xfb52('0x71')][_0x10892d]),'FaxAccountId':Number(_0x399d7c[_0xfb52('0x5b')]['id'])});}}else{socket['emit'](_0xfb52('0xca'),{'UserId':Number(_0x399d7c[_0xfb52('0x4a')][_0xfb52('0x71')]),'FaxAccountId':Number(_0x399d7c['params']['id'])});}});}})[_0xfb52('0x3a')](respondWithStatusCode(_0x559963,null))[_0xfb52('0x2b')](handleError(_0x559963,null));};exports['getAgents']=function(_0x5a1e37,_0x58ad71,_0x3b4e59){var _0xc4ee80={};var _0x1989da={};var _0x35f002;var _0x47803a;return db[_0xfb52('0x44')][_0xfb52('0x87')]({'where':{'id':_0x5a1e37[_0xfb52('0x5b')]['id']}})[_0xfb52('0x3a')](handleEntityNotFound(_0x58ad71,null))[_0xfb52('0x3a')](function(_0x38f5d7){if(_0x38f5d7){_0x35f002=_0x38f5d7;_0x1989da[_0xfb52('0x49')]=_['keys'](db[_0xfb52('0x7b')]['rawAttributes']);_0x1989da[_0xfb52('0x4a')]=_[_0xfb52('0x4b')](_0x5a1e37[_0xfb52('0x4a')]);_0x1989da[_0xfb52('0x4c')]=_[_0xfb52('0x4d')](_0x1989da['model'],_0x1989da[_0xfb52('0x4a')]);_0xc4ee80[_0xfb52('0x4e')]=_[_0xfb52('0x4d')](_0x1989da['model'],qs['fields'](_0x5a1e37['query'][_0xfb52('0x4f')]));_0xc4ee80['attributes']=_0xc4ee80[_0xfb52('0x4e')][_0xfb52('0x5d')]?_0xc4ee80[_0xfb52('0x4e')]:_0x1989da[_0xfb52('0x49')];_0xc4ee80[_0xfb52('0x78')]=qs['sort'](_0x5a1e37['query'][_0xfb52('0x52')]);_0xc4ee80['where']=qs[_0xfb52('0x4c')](_[_0xfb52('0x6e')](_0x5a1e37[_0xfb52('0x4a')],_0x1989da[_0xfb52('0x4c')]));if(_0x5a1e37[_0xfb52('0x4a')]['filter']){_0xc4ee80[_0xfb52('0x53')]=_[_0xfb52('0x55')](_0xc4ee80[_0xfb52('0x53')],{'$or':_[_0xfb52('0x43')](_0xc4ee80[_0xfb52('0x4e')],function(_0x1d2a4d){var _0x360fd9={};_0x360fd9[_0x1d2a4d]={'$like':'%'+_0x5a1e37[_0xfb52('0x4a')][_0xfb52('0x6f')]+'%'};return _0x360fd9;})});}_0xc4ee80=_['merge']({},_0xc4ee80,_0x5a1e37[_0xfb52('0x56')]);return _0x35f002[_0xfb52('0xcb')](_0xc4ee80);}})[_0xfb52('0x3a')](function(_0x52b11b){if(_0x52b11b){_0x47803a=_0x52b11b['length'];if(!_0x5a1e37['query']['hasOwnProperty']('nolimit')){_0xc4ee80[_0xfb52('0x31')]=qs['limit'](_0x5a1e37[_0xfb52('0x4a')][_0xfb52('0x31')]);_0xc4ee80[_0xfb52('0x2f')]=qs[_0xfb52('0x2f')](_0x5a1e37[_0xfb52('0x4a')][_0xfb52('0x2f')]);}return _0x35f002[_0xfb52('0xcb')](_0xc4ee80);}})['then'](function(_0x419c0d){if(_0x419c0d){return _0x419c0d?{'count':_0x47803a,'rows':_0x419c0d}:null;}})[_0xfb52('0x3a')](respondWithResult(_0x58ad71,null))[_0xfb52('0x2b')](handleError(_0x58ad71,null));}; \ No newline at end of file +var _0xac94=['ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','userProfileId','autoAssociation','update','find','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rawAttributes','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','addInteraction','getInteractions','FaxInteraction','CmContact','Owner','internal','Tag','Tags','tag','addApplications','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','localstationid','app','appdata','push','Answer','ecm','faxdetect','headerinfo','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','transaction','omit','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xac94,0xcb));var _0x4ac9=function(_0x1487af,_0x10e319){_0x1487af=_0x1487af-0x0;var _0x3fb821=_0xac94[_0x1487af];return _0x3fb821;};'use strict';var emlformat=require(_0x4ac9('0x0'));var rimraf=require(_0x4ac9('0x1'));var zipdir=require(_0x4ac9('0x2'));var jsonpatch=require(_0x4ac9('0x3'));var rp=require('request-promise');var moment=require(_0x4ac9('0x4'));var BPromise=require(_0x4ac9('0x5'));var Mustache=require(_0x4ac9('0x6'));var util=require('util');var path=require(_0x4ac9('0x7'));var sox=require(_0x4ac9('0x8'));var csv=require(_0x4ac9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ac9('0xa'));var _=require(_0x4ac9('0xb'));var squel=require(_0x4ac9('0xc'));var crypto=require(_0x4ac9('0xd'));var jsforce=require(_0x4ac9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4ac9('0x9'));var querystring=require(_0x4ac9('0xf'));var Papa=require('papaparse');var Redis=require(_0x4ac9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4ac9('0x11'));var as=require(_0x4ac9('0x12'));var hardwareService=require(_0x4ac9('0x13'));var logger=require(_0x4ac9('0x14'))(_0x4ac9('0x15'));var utils=require(_0x4ac9('0x16'));var config=require(_0x4ac9('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4ac9('0x18')]=_[_0x4ac9('0x19')](config['redis'],{'host':_0x4ac9('0x1a'),'port':0x18eb});var socket=require(_0x4ac9('0x1b'))(new Redis(config['redis']));require(_0x4ac9('0x1c'))[_0x4ac9('0x1d')](socket);var jayson=require(_0x4ac9('0x1e'));var client=jayson['client'][_0x4ac9('0x1f')]({'port':0x232c});var client9002=jayson[_0x4ac9('0x20')][_0x4ac9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x44b128,_0x5c2e72,_0x29bf0d,_0x5a4958){return new BPromise(function(_0x2a0d7e,_0x4d6c03){var _0x47f6a8=_0x5a4958||client;return _0x47f6a8['request'](_0x44b128,_0x29bf0d)[_0x4ac9('0x21')](function(_0x1ecc11){logger['info'](_0x4ac9('0x22'),_0x5c2e72,_0x4ac9('0x23'));logger[_0x4ac9('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5c2e72,_0x4ac9('0x23'),JSON['stringify'](_0x1ecc11));if(_0x1ecc11[_0x4ac9('0x25')]){if(_0x1ecc11['error'][_0x4ac9('0x26')]===0x1f4){logger[_0x4ac9('0x25')](_0x4ac9('0x22'),_0x5c2e72,_0x1ecc11[_0x4ac9('0x25')][_0x4ac9('0x27')]);return _0x4d6c03(_0x1ecc11[_0x4ac9('0x25')][_0x4ac9('0x27')]);}logger[_0x4ac9('0x25')]('FaxAccount,\x20%s,\x20%s',_0x5c2e72,_0x1ecc11[_0x4ac9('0x25')][_0x4ac9('0x27')]);return _0x2a0d7e(_0x1ecc11[_0x4ac9('0x25')][_0x4ac9('0x27')]);}else{logger[_0x4ac9('0x28')](_0x4ac9('0x22'),_0x5c2e72,'request\x20sent');_0x2a0d7e(_0x1ecc11[_0x4ac9('0x29')]['message']);}})[_0x4ac9('0x2a')](function(_0x39fa71){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5c2e72,_0x39fa71);_0x4d6c03(_0x39fa71);});});}function respondWithStatusCode(_0x2f43,_0x7f6232){_0x7f6232=_0x7f6232||0xcc;return function(_0x5e0a9b){if(_0x5e0a9b){return _0x2f43[_0x4ac9('0x2b')](_0x7f6232);}return _0x2f43[_0x4ac9('0x2c')](_0x7f6232)[_0x4ac9('0x2d')]();};}function respondWithResult(_0x2fd51c,_0x9f9975){_0x9f9975=_0x9f9975||0xc8;return function(_0x29bb71){if(_0x29bb71){return _0x2fd51c['status'](_0x9f9975)[_0x4ac9('0x2e')](_0x29bb71);}};}function respondWithFilteredResult(_0x5a71c7,_0x5e3c05){return function(_0x53c6b0){if(_0x53c6b0){var _0xbdc187=typeof _0x5e3c05['offset']===_0x4ac9('0x2f')&&typeof _0x5e3c05[_0x4ac9('0x30')]===_0x4ac9('0x2f');var _0xb5a73a=_0x53c6b0[_0x4ac9('0x31')];var _0x1f4807=_0xbdc187?0x0:_0x5e3c05[_0x4ac9('0x32')];var _0x17378f=_0xbdc187?_0x53c6b0[_0x4ac9('0x31')]:_0x5e3c05[_0x4ac9('0x32')]+_0x5e3c05[_0x4ac9('0x30')];var _0x229cf6;if(_0x17378f>=_0xb5a73a){_0x17378f=_0xb5a73a;_0x229cf6=0xc8;}else{_0x229cf6=0xce;}_0x5a71c7[_0x4ac9('0x2c')](_0x229cf6);return _0x5a71c7[_0x4ac9('0x33')](_0x4ac9('0x34'),_0x1f4807+'-'+_0x17378f+'/'+_0xb5a73a)[_0x4ac9('0x2e')](_0x53c6b0);}return null;};}function patchUpdates(_0x21c32){return function(_0xff5e26){try{jsonpatch[_0x4ac9('0x35')](_0xff5e26,_0x21c32,!![]);}catch(_0x374b55){return BPromise[_0x4ac9('0x36')](_0x374b55);}return _0xff5e26[_0x4ac9('0x37')]();};}function saveUpdates(_0x4515d1,_0x374ff2){return function(_0x4bbaac){if(_0x4bbaac){return _0x4bbaac['update'](_0x4515d1)[_0x4ac9('0x21')](function(_0x5ca346){return _0x5ca346;});}return null;};}function removeEntity(_0x58bbe9,_0x1eb27d){return function(_0x4fbf87){if(_0x4fbf87){return _0x4fbf87[_0x4ac9('0x38')]()['then'](function(){var _0x2e7ba2=_0x4fbf87['get']({'plain':!![]});var _0x1692c8='FaxAccounts';return db[_0x4ac9('0x39')][_0x4ac9('0x38')]({'where':{'type':_0x1692c8,'resourceId':_0x2e7ba2['id']}})['then'](function(){return _0x4fbf87;});})['then'](function(){_0x58bbe9[_0x4ac9('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474a14,_0x5013fe){return function(_0x122fc4){if(!_0x122fc4){_0x474a14[_0x4ac9('0x2b')](0x194);}return _0x122fc4;};}function handleError(_0x2e0667,_0x3aae6a){_0x3aae6a=_0x3aae6a||0x1f4;return function(_0x51a9bd){logger[_0x4ac9('0x25')](_0x51a9bd[_0x4ac9('0x3a')]);if(_0x51a9bd['name']){delete _0x51a9bd[_0x4ac9('0x3b')];}_0x2e0667[_0x4ac9('0x2c')](_0x3aae6a)[_0x4ac9('0x3c')](_0x51a9bd);};}exports['index']=function(_0x4ea955,_0x497c84){var _0x171ada={'include':[{'model':db[_0x4ac9('0x3d')],'as':_0x4ac9('0x3e')}]},_0x32c86f={},_0x297710={'count':0x0,'rows':[]};var _0x9d3241=_[_0x4ac9('0x3f')](db[_0x4ac9('0x40')]['rawAttributes'],function(_0x212f19){return{'name':_0x212f19[_0x4ac9('0x41')],'type':_0x212f19['type'][_0x4ac9('0x42')]};});_0x32c86f[_0x4ac9('0x43')]=_[_0x4ac9('0x3f')](_0x9d3241,_0x4ac9('0x3b'));_0x32c86f['query']=_[_0x4ac9('0x44')](_0x4ea955[_0x4ac9('0x45')]);_0x32c86f[_0x4ac9('0x46')]=_[_0x4ac9('0x47')](_0x32c86f[_0x4ac9('0x43')],_0x32c86f[_0x4ac9('0x45')]);_0x171ada[_0x4ac9('0x48')]=_[_0x4ac9('0x47')](_0x32c86f['model'],qs[_0x4ac9('0x49')](_0x4ea955[_0x4ac9('0x45')]['fields']));_0x171ada['attributes']=_0x171ada['attributes'][_0x4ac9('0x4a')]?_0x171ada[_0x4ac9('0x48')]:_0x32c86f['model'];if(!_0x4ea955['query'][_0x4ac9('0x4b')](_0x4ac9('0x4c'))){_0x171ada['limit']=qs['limit'](_0x4ea955[_0x4ac9('0x45')][_0x4ac9('0x30')]);_0x171ada['offset']=qs[_0x4ac9('0x32')](_0x4ea955[_0x4ac9('0x45')][_0x4ac9('0x32')]);}_0x171ada[_0x4ac9('0x4d')]=qs[_0x4ac9('0x4e')](_0x4ea955['query']['sort']);_0x171ada[_0x4ac9('0x4f')]=qs[_0x4ac9('0x46')](_['pick'](_0x4ea955[_0x4ac9('0x45')],_0x32c86f[_0x4ac9('0x46')]),_0x9d3241);if(_0x4ea955['query']['filter']){_0x171ada[_0x4ac9('0x4f')]=_[_0x4ac9('0x50')](_0x171ada[_0x4ac9('0x4f')],{'$or':_['map'](_0x9d3241,function(_0x29b979){if(_0x29b979[_0x4ac9('0x51')]!=='VIRTUAL'){var _0x5ac8e5={};_0x5ac8e5[_0x29b979[_0x4ac9('0x3b')]]={'$like':'%'+_0x4ea955[_0x4ac9('0x45')][_0x4ac9('0x52')]+'%'};return _0x5ac8e5;}})});}_0x171ada=_['merge']({},_0x171ada,_0x4ea955[_0x4ac9('0x53')]);var _0x5be5fd={'where':_0x171ada['where']};return db[_0x4ac9('0x40')][_0x4ac9('0x31')](_0x5be5fd)[_0x4ac9('0x21')](function(_0x35b98e){_0x297710['count']=_0x35b98e;if(_0x4ea955[_0x4ac9('0x45')][_0x4ac9('0x54')]){_0x171ada[_0x4ac9('0x55')]=[{'all':!![]}];}return db[_0x4ac9('0x40')][_0x4ac9('0x56')](_0x171ada);})[_0x4ac9('0x21')](function(_0x1e9a64){_0x297710['rows']=_0x1e9a64;return _0x297710;})[_0x4ac9('0x21')](respondWithFilteredResult(_0x497c84,_0x171ada))[_0x4ac9('0x2a')](handleError(_0x497c84,null));};exports[_0x4ac9('0x57')]=function(_0x19dbb9,_0xabbd3e){var _0x4d26f7={'raw':![],'where':{'id':_0x19dbb9[_0x4ac9('0x58')]['id']},'include':[{'model':db[_0x4ac9('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2cf938={};_0x2cf938['model']=_[_0x4ac9('0x44')](db['FaxAccount']['rawAttributes']);_0x2cf938[_0x4ac9('0x45')]=_[_0x4ac9('0x44')](_0x19dbb9['query']);_0x2cf938['filters']=_[_0x4ac9('0x47')](_0x2cf938['model'],_0x2cf938[_0x4ac9('0x45')]);_0x4d26f7['attributes']=_[_0x4ac9('0x47')](_0x2cf938[_0x4ac9('0x43')],qs[_0x4ac9('0x49')](_0x19dbb9[_0x4ac9('0x45')][_0x4ac9('0x49')]));_0x4d26f7[_0x4ac9('0x48')]=_0x4d26f7[_0x4ac9('0x48')]['length']?_0x4d26f7[_0x4ac9('0x48')]:_0x2cf938[_0x4ac9('0x43')];if(_0x19dbb9[_0x4ac9('0x45')][_0x4ac9('0x54')]){_0x4d26f7[_0x4ac9('0x55')]=[{'all':!![]}];}_0x4d26f7=_[_0x4ac9('0x50')]({},_0x4d26f7,_0x19dbb9[_0x4ac9('0x53')]);return db[_0x4ac9('0x40')]['find'](_0x4d26f7)['then'](handleEntityNotFound(_0xabbd3e,null))[_0x4ac9('0x21')](respondWithResult(_0xabbd3e,null))[_0x4ac9('0x2a')](handleError(_0xabbd3e,null));};exports[_0x4ac9('0x59')]=function(_0x5c6ead,_0x307f6f){return db[_0x4ac9('0x40')]['create'](_0x5c6ead[_0x4ac9('0x5a')],{})[_0x4ac9('0x21')](function(_0x4f1a42){var _0x96e7f6=_0x5c6ead[_0x4ac9('0x5b')][_0x4ac9('0x5c')]({'plain':!![]});if(!_0x96e7f6)throw new Error(_0x4ac9('0x5d'));if(_0x96e7f6[_0x4ac9('0x5e')]==='user'){var _0x44146e=_0x4f1a42['get']({'plain':!![]});var _0x343b22=_0x4ac9('0x5f');return db['UserProfileSection']['find']({'where':{'name':_0x343b22,'userProfileId':_0x96e7f6[_0x4ac9('0x60')]},'raw':!![]})['then'](function(_0x1d5f62){if(_0x1d5f62&&_0x1d5f62[_0x4ac9('0x61')]===0x0){return db['UserProfileResource'][_0x4ac9('0x59')]({'name':_0x44146e['name'],'resourceId':_0x44146e['id'],'type':_0x1d5f62[_0x4ac9('0x3b')],'sectionId':_0x1d5f62['id']},{})[_0x4ac9('0x21')](function(){return _0x4f1a42;});}else{return _0x4f1a42;}})[_0x4ac9('0x2a')](function(_0x560f9d){logger[_0x4ac9('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560f9d);throw _0x560f9d;});}return _0x4f1a42;})[_0x4ac9('0x21')](respondWithResult(_0x307f6f,0xc9))[_0x4ac9('0x2a')](handleError(_0x307f6f,null));};exports[_0x4ac9('0x62')]=function(_0x3181cc,_0xdd6e34){if(_0x3181cc[_0x4ac9('0x5a')]['id']){delete _0x3181cc[_0x4ac9('0x5a')]['id'];}return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0x3181cc['params']['id']},'include':[{'model':db[_0x4ac9('0x3d')],'as':_0x4ac9('0x3e')}]})[_0x4ac9('0x21')](handleEntityNotFound(_0xdd6e34,null))[_0x4ac9('0x21')](saveUpdates(_0x3181cc['body'],null))['then'](respondWithResult(_0xdd6e34,null))[_0x4ac9('0x2a')](handleError(_0xdd6e34,null));};exports['destroy']=function(_0x5a3bb6,_0xd7a886){return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0x5a3bb6[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0xd7a886,null))[_0x4ac9('0x21')](removeEntity(_0xd7a886,null))[_0x4ac9('0x2a')](handleError(_0xd7a886,null));};exports[_0x4ac9('0x64')]=function(_0x36da0a,_0x268363){return db[_0x4ac9('0x40')][_0x4ac9('0x64')]()[_0x4ac9('0x21')](respondWithResult(_0x268363,null))[_0x4ac9('0x2a')](handleError(_0x268363,null));};exports[_0x4ac9('0x65')]=function(_0x5ddaeb,_0x40089d,_0x389416){if(_0x5ddaeb[_0x4ac9('0x5a')]['id']){delete _0x5ddaeb[_0x4ac9('0x5a')]['id'];}return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0x5ddaeb[_0x4ac9('0x58')]['id']}})['then'](handleEntityNotFound(_0x40089d,null))[_0x4ac9('0x21')](function(_0x318e62){if(_0x318e62){_0x5ddaeb[_0x4ac9('0x5a')][_0x4ac9('0x66')]=_0x318e62['id'];return db[_0x4ac9('0x67')]['create'](_0x5ddaeb['body']);}})[_0x4ac9('0x21')](respondWithResult(_0x40089d,null))[_0x4ac9('0x2a')](handleError(_0x40089d,null));};exports[_0x4ac9('0x68')]=function(_0x368b47,_0x297c66,_0x5e7e65){var _0x2f5c25={'raw':![],'where':{}};var _0x2c89b4={};var _0x2fb77d={'count':0x0,'rows':[]};return db[_0x4ac9('0x40')][_0x4ac9('0x69')]({'where':{'id':_0x368b47[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x297c66,null))[_0x4ac9('0x21')](function(_0x2e3449){if(_0x2e3449){_0x2c89b4['model']=_['keys'](db[_0x4ac9('0x67')][_0x4ac9('0x6a')]);_0x2c89b4[_0x4ac9('0x45')]=_[_0x4ac9('0x44')](_0x368b47[_0x4ac9('0x45')]);_0x2c89b4[_0x4ac9('0x46')]=_[_0x4ac9('0x47')](_0x2c89b4['model'],_0x2c89b4['query']);_0x2f5c25[_0x4ac9('0x48')]=_[_0x4ac9('0x47')](_0x2c89b4[_0x4ac9('0x43')],qs[_0x4ac9('0x49')](_0x368b47[_0x4ac9('0x45')][_0x4ac9('0x49')]));_0x2f5c25[_0x4ac9('0x48')]=_0x2f5c25[_0x4ac9('0x48')][_0x4ac9('0x4a')]?_0x2f5c25['attributes']:_0x2c89b4[_0x4ac9('0x43')];if(!_0x368b47[_0x4ac9('0x45')][_0x4ac9('0x4b')](_0x4ac9('0x4c'))){_0x2f5c25[_0x4ac9('0x30')]=qs[_0x4ac9('0x30')](_0x368b47[_0x4ac9('0x45')][_0x4ac9('0x30')]);_0x2f5c25[_0x4ac9('0x32')]=qs[_0x4ac9('0x32')](_0x368b47[_0x4ac9('0x45')][_0x4ac9('0x32')]);}_0x2f5c25[_0x4ac9('0x4d')]=qs[_0x4ac9('0x4e')](_0x368b47[_0x4ac9('0x45')][_0x4ac9('0x4e')]);_0x2f5c25[_0x4ac9('0x4f')]=qs['filters'](_['pick'](_0x368b47['query'],_0x2c89b4[_0x4ac9('0x46')]));_0x2f5c25['where'][_0x4ac9('0x66')]=_0x2e3449['id'];if(_0x368b47[_0x4ac9('0x45')][_0x4ac9('0x52')]){_0x2f5c25[_0x4ac9('0x4f')]=_[_0x4ac9('0x50')](_0x2f5c25[_0x4ac9('0x4f')],{'$or':_['map'](_0x2f5c25[_0x4ac9('0x48')],function(_0x33e01e){var _0x3126eb={};_0x3126eb[_0x33e01e]={'$like':'%'+_0x368b47[_0x4ac9('0x45')]['filter']+'%'};return _0x3126eb;})});}_0x2f5c25=_['merge']({},_0x2f5c25,_0x368b47[_0x4ac9('0x53')]);return db[_0x4ac9('0x67')]['count']({'where':_0x2f5c25['where']})['then'](function(_0x5c1e6d){_0x2fb77d[_0x4ac9('0x31')]=_0x5c1e6d;if(_0x368b47['query'][_0x4ac9('0x54')]){_0x2f5c25[_0x4ac9('0x55')]=[{'all':!![]}];}return db[_0x4ac9('0x67')][_0x4ac9('0x56')](_0x2f5c25);})[_0x4ac9('0x21')](function(_0x4f1ef6){_0x2fb77d[_0x4ac9('0x6b')]=_0x4f1ef6;return _0x2fb77d;});}})[_0x4ac9('0x21')](respondWithFilteredResult(_0x297c66,_0x2f5c25))[_0x4ac9('0x2a')](handleError(_0x297c66,null));};exports[_0x4ac9('0x6c')]=function(_0x401bf6,_0x123d16,_0x22929c){return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0x401bf6[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x123d16,null))[_0x4ac9('0x21')](function(_0x45a1b4){if(_0x45a1b4){return _0x45a1b4[_0x4ac9('0x6c')](_0x401bf6['query'][_0x4ac9('0x6d')]);}})[_0x4ac9('0x21')](respondWithStatusCode(_0x123d16,null))[_0x4ac9('0x2a')](handleError(_0x123d16,null));};exports[_0x4ac9('0x6e')]=function(_0x3a0aae,_0x132ee8,_0x27425a){if(_0x3a0aae[_0x4ac9('0x5a')]['id']){delete _0x3a0aae[_0x4ac9('0x5a')]['id'];}return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0x3a0aae[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x132ee8,null))['then'](function(_0xccf60d){if(_0xccf60d){_0x3a0aae[_0x4ac9('0x5a')]['FaxAccountId']=_0xccf60d['id'];return db[_0x4ac9('0x6f')][_0x4ac9('0x59')](_0x3a0aae[_0x4ac9('0x5a')]);}})[_0x4ac9('0x21')](respondWithResult(_0x132ee8,null))[_0x4ac9('0x2a')](handleError(_0x132ee8,null));};exports[_0x4ac9('0x70')]=function(_0x464a5a,_0xf707d3,_0x42d3c9){var _0x1a41dd={'raw':![],'where':{}};var _0x2deea3={};var _0x51bfcd={'count':0x0,'rows':[]};return db[_0x4ac9('0x40')][_0x4ac9('0x69')]({'where':{'id':_0x464a5a[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0xf707d3,null))[_0x4ac9('0x21')](function(_0x239a05){if(_0x239a05){_0x2deea3[_0x4ac9('0x43')]=_['keys'](db[_0x4ac9('0x6f')][_0x4ac9('0x6a')]);_0x2deea3[_0x4ac9('0x45')]=_[_0x4ac9('0x44')](_0x464a5a['query']);_0x2deea3[_0x4ac9('0x46')]=_[_0x4ac9('0x47')](_0x2deea3[_0x4ac9('0x43')],_0x2deea3[_0x4ac9('0x45')]);_0x1a41dd['attributes']=_[_0x4ac9('0x47')](_0x2deea3['model'],qs[_0x4ac9('0x49')](_0x464a5a[_0x4ac9('0x45')][_0x4ac9('0x49')]));_0x1a41dd[_0x4ac9('0x48')]=_0x1a41dd[_0x4ac9('0x48')][_0x4ac9('0x4a')]?_0x1a41dd['attributes']:_0x2deea3[_0x4ac9('0x43')];if(!_0x464a5a[_0x4ac9('0x45')][_0x4ac9('0x4b')](_0x4ac9('0x4c'))){_0x1a41dd[_0x4ac9('0x30')]=qs[_0x4ac9('0x30')](_0x464a5a['query']['limit']);_0x1a41dd[_0x4ac9('0x32')]=qs[_0x4ac9('0x32')](_0x464a5a[_0x4ac9('0x45')]['offset']);}_0x1a41dd[_0x4ac9('0x4d')]=qs['sort'](_0x464a5a[_0x4ac9('0x45')][_0x4ac9('0x4e')]);_0x1a41dd[_0x4ac9('0x4f')]=qs['filters'](_[_0x4ac9('0x71')](_0x464a5a[_0x4ac9('0x45')],_0x2deea3[_0x4ac9('0x46')]));_0x1a41dd[_0x4ac9('0x4f')]['FaxAccountId']=_0x239a05['id'];if(_0x464a5a['query'][_0x4ac9('0x52')]){_0x1a41dd[_0x4ac9('0x4f')]=_['merge'](_0x1a41dd[_0x4ac9('0x4f')],{'$or':_[_0x4ac9('0x3f')](_0x1a41dd[_0x4ac9('0x48')],function(_0x28ace7){var _0x5b19ee={};_0x5b19ee[_0x28ace7]={'$like':'%'+_0x464a5a[_0x4ac9('0x45')]['filter']+'%'};return _0x5b19ee;})});}_0x1a41dd=_[_0x4ac9('0x50')]({},_0x1a41dd,_0x464a5a['options']);return db['CannedAnswer'][_0x4ac9('0x31')]({'where':_0x1a41dd['where']})[_0x4ac9('0x21')](function(_0x2c7a4b){_0x51bfcd[_0x4ac9('0x31')]=_0x2c7a4b;if(_0x464a5a[_0x4ac9('0x45')]['includeAll']){_0x1a41dd['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4ac9('0x56')](_0x1a41dd);})[_0x4ac9('0x21')](function(_0x536777){_0x51bfcd[_0x4ac9('0x6b')]=_0x536777;return _0x51bfcd;});}})[_0x4ac9('0x21')](respondWithFilteredResult(_0xf707d3,_0x1a41dd))['catch'](handleError(_0xf707d3,null));};exports[_0x4ac9('0x72')]=function(_0x4f02ed,_0x154f20,_0x2b1600){return db['FaxAccount']['find']({'where':{'id':_0x4f02ed[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x154f20,null))[_0x4ac9('0x21')](function(_0xae117e){if(_0xae117e){return _0xae117e['removeAnswers'](_0x4f02ed['query'][_0x4ac9('0x6d')]);}})[_0x4ac9('0x21')](respondWithStatusCode(_0x154f20,null))['catch'](handleError(_0x154f20,null));};exports[_0x4ac9('0x73')]=function(_0x3955f6,_0x58b1cb,_0x43c589){return db['FaxInteraction'][_0x4ac9('0x63')]({'where':{'id':_0x3955f6['params']['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x58b1cb,null))[_0x4ac9('0x21')](function(_0x36f5c1){if(_0x36f5c1){return _0x36f5c1['addInteraction'](_0x3955f6[_0x4ac9('0x5a')][_0x4ac9('0x6d')],_['omit'](_0x3955f6['body'],['ids','id'])||{});}})[_0x4ac9('0x21')](respondWithResult(_0x58b1cb,null))[_0x4ac9('0x2a')](handleError(_0x58b1cb,null));};exports[_0x4ac9('0x74')]=function(_0x120b55,_0x5cf87d,_0x411dbd){var _0x5cfcf1={'raw':![],'where':{}};var _0x46cc80={};var _0x32d774={'count':0x0,'rows':[]};return db[_0x4ac9('0x40')][_0x4ac9('0x69')]({'where':{'id':_0x120b55[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x5cf87d,null))[_0x4ac9('0x21')](function(_0x51f0f8){if(_0x51f0f8){_0x46cc80[_0x4ac9('0x43')]=_[_0x4ac9('0x44')](db[_0x4ac9('0x75')][_0x4ac9('0x6a')]);_0x46cc80['query']=_[_0x4ac9('0x44')](_0x120b55[_0x4ac9('0x45')]);_0x46cc80[_0x4ac9('0x46')]=_[_0x4ac9('0x47')](_0x46cc80[_0x4ac9('0x43')],_0x46cc80[_0x4ac9('0x45')]);_0x5cfcf1[_0x4ac9('0x48')]=_[_0x4ac9('0x47')](_0x46cc80['model'],qs[_0x4ac9('0x49')](_0x120b55[_0x4ac9('0x45')][_0x4ac9('0x49')]));_0x5cfcf1[_0x4ac9('0x48')]=_0x5cfcf1[_0x4ac9('0x48')][_0x4ac9('0x4a')]?_0x5cfcf1[_0x4ac9('0x48')]:_0x46cc80[_0x4ac9('0x43')];if(!_0x120b55[_0x4ac9('0x45')]['hasOwnProperty'](_0x4ac9('0x4c'))){_0x5cfcf1[_0x4ac9('0x30')]=qs[_0x4ac9('0x30')](_0x120b55['query'][_0x4ac9('0x30')]);_0x5cfcf1[_0x4ac9('0x32')]=qs[_0x4ac9('0x32')](_0x120b55[_0x4ac9('0x45')][_0x4ac9('0x32')]);}_0x5cfcf1['order']=qs[_0x4ac9('0x4e')](_0x120b55[_0x4ac9('0x45')][_0x4ac9('0x4e')]);_0x5cfcf1[_0x4ac9('0x4f')]=qs[_0x4ac9('0x46')](_[_0x4ac9('0x71')](_0x120b55['query'],_0x46cc80['filters']));_0x5cfcf1['where'][_0x4ac9('0x66')]=_0x51f0f8['id'];if(_0x120b55[_0x4ac9('0x45')]['filter']){_0x5cfcf1[_0x4ac9('0x4f')]=_[_0x4ac9('0x50')](_0x5cfcf1[_0x4ac9('0x4f')],{'$or':_['map'](_0x5cfcf1[_0x4ac9('0x48')],function(_0x4ebac8){var _0x563579={};_0x563579[_0x4ebac8]={'$like':'%'+_0x120b55[_0x4ac9('0x45')]['filter']+'%'};return _0x563579;})});}_0x5cfcf1=_[_0x4ac9('0x50')]({},_0x5cfcf1,_0x120b55[_0x4ac9('0x53')]);return db[_0x4ac9('0x75')][_0x4ac9('0x31')]({'where':_0x5cfcf1['where']})[_0x4ac9('0x21')](function(_0x83d364){_0x32d774[_0x4ac9('0x31')]=_0x83d364;if(_0x120b55['query'][_0x4ac9('0x54')]){_0x5cfcf1[_0x4ac9('0x55')]=[{'model':db[_0x4ac9('0x76')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x4ac9('0x77'),'attributes':[_0x4ac9('0x3b'),'fullname',_0x4ac9('0x78')],'required':![]},{'model':db[_0x4ac9('0x79')],'as':_0x4ac9('0x7a'),'attributes':['id','name','color'],'where':_0x120b55[_0x4ac9('0x45')][_0x4ac9('0x7b')]?{'id':_0x120b55[_0x4ac9('0x45')]['tag']}:undefined,'required':_0x120b55['query'][_0x4ac9('0x7b')]?!![]:![]}];}return db[_0x4ac9('0x75')][_0x4ac9('0x56')](_0x5cfcf1);})['then'](function(_0x20e843){_0x32d774[_0x4ac9('0x6b')]=_0x20e843;return _0x32d774;});}})[_0x4ac9('0x21')](respondWithFilteredResult(_0x5cf87d,_0x5cfcf1))[_0x4ac9('0x2a')](handleError(_0x5cf87d,null));};exports[_0x4ac9('0x7c')]=function(_0x558cf8,_0x560bc4){var _0x1549d7=_0x558cf8[_0x4ac9('0x58')]['id'];var _0x29f492=_0x558cf8['body'];var _0xb20dbe=0xc8;var _0x5074b4=null;return db[_0x4ac9('0x7d')]['transaction']({'isolationLevel':db[_0x4ac9('0x7d')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3c376c){return db[_0x4ac9('0x40')][_0x4ac9('0x69')]({'where':{'id':_0x1549d7},'transaction':_0x3c376c})[_0x4ac9('0x21')](function(_0x3c6502){if(_0x3c6502){return db['FaxApplication'][_0x4ac9('0x38')]({'where':{'FaxAccountId':_0x1549d7},'transaction':_0x3c376c})[_0x4ac9('0x21')](function(){var _0x3bdded=_[_0x4ac9('0x3f')](_0x29f492,function(_0x36350f){_0x36350f[_0x4ac9('0x66')]=_0x1549d7;return _0x36350f;});return db[_0x4ac9('0x7e')][_0x4ac9('0x7f')](_0x3bdded,{'transaction':_0x3c376c});});}else{_0xb20dbe=0x194;_0x5074b4=[];}});})['then'](function(){if(_0xb20dbe!==0x194){return db[_0x4ac9('0x7e')][_0x4ac9('0x80')]({'where':{'FaxAccountId':_0x1549d7},'order':_0x4ac9('0x81')})[_0x4ac9('0x21')](function(_0x324361){_0x5074b4=_0x324361;});}})[_0x4ac9('0x2a')](function(_0x175554){_0xb20dbe=0x1f4;logger[_0x4ac9('0x25')](_0x175554[_0x4ac9('0x3a')]);if(_0x175554['name']){delete _0x175554['name'];}_0x5074b4=_0x175554;})[_0x4ac9('0x82')](function(){if(_0x5074b4===null){_0x560bc4[_0x4ac9('0x2b')](_0xb20dbe);}else{if(_0xb20dbe===0x1f4){_0x560bc4[_0x4ac9('0x2c')](_0xb20dbe)[_0x4ac9('0x3c')](_0x5074b4);}else{_0x560bc4[_0x4ac9('0x2c')](_0xb20dbe)[_0x4ac9('0x2e')](_0x5074b4);}}});};exports[_0x4ac9('0x83')]=function(_0x1cb40f,_0x234d28,_0x4c15de){var _0x39e0c7={};var _0x4959ec={};var _0x451c96;var _0x12e970;return db[_0x4ac9('0x40')][_0x4ac9('0x69')]({'where':{'id':_0x1cb40f[_0x4ac9('0x58')]['id']}})['then'](handleEntityNotFound(_0x234d28,null))[_0x4ac9('0x21')](function(_0x545de5){if(_0x545de5){_0x451c96=_0x545de5;_0x4959ec[_0x4ac9('0x43')]=_['keys'](db['FaxApplication'][_0x4ac9('0x6a')]);_0x4959ec['query']=_[_0x4ac9('0x44')](_0x1cb40f[_0x4ac9('0x45')]);_0x4959ec[_0x4ac9('0x46')]=_[_0x4ac9('0x47')](_0x4959ec['model'],_0x4959ec[_0x4ac9('0x45')]);_0x39e0c7['attributes']=_[_0x4ac9('0x47')](_0x4959ec['model'],qs['fields'](_0x1cb40f[_0x4ac9('0x45')]['fields']));_0x39e0c7[_0x4ac9('0x48')]=_0x39e0c7[_0x4ac9('0x48')][_0x4ac9('0x4a')]?_0x39e0c7['attributes']:_0x4959ec['model'];_0x39e0c7[_0x4ac9('0x4d')]=qs['sort'](_0x1cb40f[_0x4ac9('0x45')]['sort']);_0x39e0c7[_0x4ac9('0x4f')]=qs[_0x4ac9('0x46')](_['pick'](_0x1cb40f['query'],_0x4959ec[_0x4ac9('0x46')]));if(_0x1cb40f['query'][_0x4ac9('0x52')]){_0x39e0c7[_0x4ac9('0x4f')]=_['merge'](_0x39e0c7[_0x4ac9('0x4f')],{'$or':_['map'](_0x39e0c7[_0x4ac9('0x48')],function(_0x33332f){var _0x41adf8={};_0x41adf8[_0x33332f]={'$like':'%'+_0x1cb40f[_0x4ac9('0x45')]['filter']+'%'};return _0x41adf8;})});}_0x39e0c7=_['merge']({},_0x39e0c7,_0x1cb40f[_0x4ac9('0x53')]);return _0x451c96[_0x4ac9('0x83')](_0x39e0c7);}})[_0x4ac9('0x21')](function(_0x9e8490){if(_0x9e8490){_0x12e970=_0x9e8490['length'];if(!_0x1cb40f[_0x4ac9('0x45')]['hasOwnProperty']('nolimit')){_0x39e0c7[_0x4ac9('0x30')]=qs[_0x4ac9('0x30')](_0x1cb40f[_0x4ac9('0x45')]['limit']);_0x39e0c7[_0x4ac9('0x32')]=qs['offset'](_0x1cb40f[_0x4ac9('0x45')][_0x4ac9('0x32')]);}return _0x451c96[_0x4ac9('0x83')](_0x39e0c7);}})['then'](function(_0x37d2be){if(_0x37d2be){return _0x37d2be?{'count':_0x12e970,'rows':_0x37d2be}:null;}})['then'](respondWithResult(_0x234d28,null))['catch'](handleError(_0x234d28,null));};function Extension(_0x25ea16,_0x50615d,_0x470dc3,_0x4580cf){this['context']='from-voip-provider';this['exten']=_0x25ea16[_0x4ac9('0x84')];this[_0x4ac9('0x85')]=_0x4580cf;this['type']='system';this['description']='Fax\x20Extension';this[_0x4ac9('0x66')]=_0x25ea16['id'];this[_0x4ac9('0x81')]=_0x50615d;this[_0x4ac9('0x86')]=_0x470dc3;}function createExtensionsReciveFax(_0x1b39b5){var _0xa2f73d=0x1;var _0xd9af4e=[];_0xd9af4e[_0x4ac9('0x87')](new Extension(_0x1b39b5,_0xa2f73d,'',_0x4ac9('0x88')));_0xa2f73d+=0x1;_0xd9af4e[_0x4ac9('0x87')](new Extension(_0x1b39b5,_0xa2f73d,'CDR(type)=inbound-fax','Set'));_0xa2f73d+=0x1;for(var _0x2327b0 in _0x1b39b5){if(_0x1b39b5[_0x4ac9('0x4b')](_0x2327b0)&&(_0x2327b0===_0x4ac9('0x89')||_0x2327b0==='localstationid'||_0x2327b0==='gateway'||_0x2327b0===_0x4ac9('0x8a')||_0x2327b0===_0x4ac9('0x8b')||_0x2327b0==='maxrate'||_0x2327b0==='minrate'||_0x2327b0==='modem'||_0x2327b0===_0x4ac9('0x8c'))){_0xd9af4e[_0x4ac9('0x87')](new Extension(_0x1b39b5,_0xa2f73d,_0x4ac9('0x8d')+_0x2327b0+')='+_0x1b39b5[_0x2327b0],_0x4ac9('0x8e')));_0xa2f73d+=0x1;}}_0xd9af4e['push'](new Extension(_0x1b39b5,_0xa2f73d,'6',_0x4ac9('0x8f')));_0xa2f73d+=0x1;_0xd9af4e[_0x4ac9('0x87')](new Extension(_0x1b39b5,_0xa2f73d,_0x4ac9('0x90'),_0x4ac9('0x91')));_0xa2f73d=0x0;return _0xd9af4e;}exports[_0x4ac9('0x92')]=function(_0x2c8187,_0x3ca142,_0x4b72d3){var _0x55957b;return db['sequelize']['transaction'](function(_0x4fa176){return db[_0x4ac9('0x40')]['create'](_0x2c8187[_0x4ac9('0x5a')],{'transaction':_0x4fa176})['then'](function(_0x59a858){_0x55957b=_0x59a858[_0x4ac9('0x5c')]({'plain':!![]});return db[_0x4ac9('0x93')][_0x4ac9('0x7f')](createExtensionsReciveFax(_0x55957b),{'transaction':_0x4fa176});});})[_0x4ac9('0x21')](function(){return _0x55957b;})[_0x4ac9('0x21')](respondWithResult(_0x3ca142,null))[_0x4ac9('0x2a')](handleError(_0x3ca142,null));};exports[_0x4ac9('0x94')]=function(_0xf0eb45,_0x13ba8a,_0x38207e){var _0x5ca572;return db[_0x4ac9('0x7d')][_0x4ac9('0x95')](function(_0x9d866d){return db[_0x4ac9('0x40')][_0x4ac9('0x62')](_0xf0eb45[_0x4ac9('0x5a')],{'where':{'id':_0xf0eb45[_0x4ac9('0x5a')]['id']},'transaction':_0x9d866d})[_0x4ac9('0x21')](function(_0x50a9d4){return db[_0x4ac9('0x93')][_0x4ac9('0x38')]({'where':{'FaxAccountId':_0xf0eb45['body']['id']},'transaction':_0x9d866d})['then'](function(_0x18764d){return db[_0x4ac9('0x93')][_0x4ac9('0x7f')](createExtensionsReciveFax(_[_0x4ac9('0x96')](_0xf0eb45['body'],['tech',_0x4ac9('0x42'),'createdAt','updatedAt',_0x4ac9('0x97'),_0x4ac9('0x98')])),{'transaction':_0x9d866d});});});})[_0x4ac9('0x21')](function(){return db[_0x4ac9('0x40')][_0x4ac9('0x99')](_0xf0eb45['body']['id']);})[_0x4ac9('0x21')](respondWithResult(_0x13ba8a,null))[_0x4ac9('0x2a')](handleError(_0x13ba8a,null));};exports[_0x4ac9('0x9a')]=function(_0x38d650,_0x4085c6,_0xf81647){var _0xdfbb6d={'raw':!![],'where':{}};var _0x43c53a={};var _0x342643={'count':0x0,'rows':[]};return db[_0x4ac9('0x40')][_0x4ac9('0x69')]({'where':{'id':_0x38d650['params']['id']}})['then'](handleEntityNotFound(_0x4085c6,null))[_0x4ac9('0x21')](function(_0x408e59){if(_0x408e59){_0x43c53a['model']=_[_0x4ac9('0x44')](db[_0x4ac9('0x9b')][_0x4ac9('0x6a')]);_0x43c53a[_0x4ac9('0x45')]=_[_0x4ac9('0x44')](_0x38d650['query']);_0x43c53a[_0x4ac9('0x46')]=_['intersection'](_0x43c53a['model'],_0x43c53a[_0x4ac9('0x45')]);_0xdfbb6d[_0x4ac9('0x48')]=_[_0x4ac9('0x47')](_0x43c53a['model'],qs[_0x4ac9('0x49')](_0x38d650[_0x4ac9('0x45')][_0x4ac9('0x49')]));_0xdfbb6d['attributes']=_0xdfbb6d[_0x4ac9('0x48')]['length']?_0xdfbb6d[_0x4ac9('0x48')]:_0x43c53a[_0x4ac9('0x43')];if(!_0x38d650[_0x4ac9('0x45')]['hasOwnProperty'](_0x4ac9('0x4c'))){_0xdfbb6d['limit']=qs[_0x4ac9('0x30')](_0x38d650[_0x4ac9('0x45')][_0x4ac9('0x30')]);_0xdfbb6d[_0x4ac9('0x32')]=qs[_0x4ac9('0x32')](_0x38d650[_0x4ac9('0x45')][_0x4ac9('0x32')]);}_0xdfbb6d['order']=qs[_0x4ac9('0x4e')](_0x38d650['query'][_0x4ac9('0x4e')]);_0xdfbb6d[_0x4ac9('0x4f')]=qs[_0x4ac9('0x46')](_[_0x4ac9('0x71')](_0x38d650[_0x4ac9('0x45')],_0x43c53a[_0x4ac9('0x46')]));_0xdfbb6d[_0x4ac9('0x4f')][_0x4ac9('0x66')]=_0x408e59['id'];if(_0x38d650[_0x4ac9('0x45')][_0x4ac9('0x52')]){_0xdfbb6d['where']=_[_0x4ac9('0x50')](_0xdfbb6d['where'],{'$or':_['map'](_0xdfbb6d[_0x4ac9('0x48')],function(_0xc7e7ff){var _0x1c9fa1={};_0x1c9fa1[_0xc7e7ff]={'$like':'%'+_0x38d650[_0x4ac9('0x45')]['filter']+'%'};return _0x1c9fa1;})});}if(_0x38d650['query']['$gte']){var _0x10a840=_0x38d650[_0x4ac9('0x45')][_0x4ac9('0x9c')][_0x4ac9('0x9d')](',');var _0x46d8bc={};_0x46d8bc[_0x10a840[0x0]]={'$gte':moment(_0x10a840[0x1])[_0x4ac9('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0xdfbb6d[_0x4ac9('0x4f')]=_[_0x4ac9('0x50')](_0xdfbb6d[_0x4ac9('0x4f')],_0x46d8bc);}_0xdfbb6d=_[_0x4ac9('0x50')]({},_0xdfbb6d,_0x38d650[_0x4ac9('0x53')]);return db['FaxMessage'][_0x4ac9('0x31')]({'where':_0xdfbb6d[_0x4ac9('0x4f')]})['then'](function(_0xc33c14){_0x342643['count']=_0xc33c14;if(_0x38d650['query'][_0x4ac9('0x54')]){_0xdfbb6d['include']=[{'all':!![]}];}return db[_0x4ac9('0x9b')]['findAll'](_0xdfbb6d);})[_0x4ac9('0x21')](function(_0x2b8c8b){_0x342643[_0x4ac9('0x6b')]=_0x2b8c8b;return _0x342643;});}})[_0x4ac9('0x21')](respondWithFilteredResult(_0x4085c6,_0xdfbb6d))[_0x4ac9('0x2a')](handleError(_0x4085c6,null));};exports['send']=function(_0x3c25a8,_0x3d2b7e,_0xd5322e){var _0x23adac,_0xc162d2={},_0x59a12e;if(_0x3c25a8[_0x4ac9('0x5a')]['to']){_0x59a12e=_0x3c25a8['body']['to'][0x0];}return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0x3c25a8[_0x4ac9('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x4ac9('0x9f'),'include':[{'model':db['CmContact'],'as':_0x4ac9('0xa0'),'where':{'fax':_0x59a12e},'limit':0x1,'order':[['updatedAt',_0x4ac9('0xa1')]]}]}]})[_0x4ac9('0x21')](handleEntityNotFound(_0x3d2b7e,null))[_0x4ac9('0x21')](function(_0x198c4e){_0x23adac=_0x198c4e;if(_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')]&&_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][_0x4ac9('0x4a')]){for(var _0x276a8d=0x0;_0x276a8d<_0x3c25a8['body'][_0x4ac9('0xa2')]['length'];_0x276a8d+=0x1){_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][_0x276a8d]={'filename':_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][_0x276a8d]['name'],'id':_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][_0x276a8d]['id'],'path':path[_0x4ac9('0xa3')](config[_0x4ac9('0xa4')],'server/files/attachments',_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][_0x276a8d][_0x4ac9('0xa5')])};}}return respondWithRpcPromise(_0x4ac9('0xa6'),_0x4ac9('0xa6'),{'FaxAccountId':_[_0x4ac9('0xa7')](_0x3c25a8[_0x4ac9('0x58')]['id'])?undefined:_0x3c25a8[_0x4ac9('0x58')]['id'],'path':_['isNil'](_0x3c25a8['body'][_0x4ac9('0xa2')][0x0][_0x4ac9('0x7')])?undefined:_0x3c25a8[_0x4ac9('0x5a')]['attachments'][0x0][_0x4ac9('0x7')],'fax':_['isNil'](_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0])?undefined:_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0]},client9002);})[_0x4ac9('0x21')](function(){if(_0x23adac){if(_[_0x4ac9('0xa7')](_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa8')])){_0x3c25a8[_0x4ac9('0x5a')]['from']=util[_0x4ac9('0x9e')](_0x4ac9('0xa9'),_0x23adac['name'],_0x23adac[_0x4ac9('0xaa')]);}if(_0x23adac['List']){if(_0x23adac['List']['Contacts']['length']){return _0x23adac[_0x4ac9('0x9f')]['Contacts'][0x0];}else{return db['CmContact'][_0x4ac9('0x59')](_[_0x4ac9('0x19')](_0x3c25a8[_0x4ac9('0x5a')],{'firstName':_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0],'phone':_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0],'fax':_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0],'ListId':_0x23adac[_0x4ac9('0x98')]}));}}else{throw new Error(_0x4ac9('0xab'));}}else{throw new Error(_0x4ac9('0xac'));}})[_0x4ac9('0x21')](function(_0x6cae97){if(_0x6cae97){return db[_0x4ac9('0x75')][_0x4ac9('0x63')]({'where':{'ContactId':_0x6cae97['id'],'closed':![],'FaxAccountId':_0x23adac['id']}})[_0x4ac9('0x21')](function(_0x552ade){if(_0x552ade){return[_0x552ade,![]];}return db['FaxInteraction'][_0x4ac9('0x59')]({'UserId':_0x3c25a8['user']['id'],'ContactId':_0x6cae97['id'],'FaxAccountId':_0x23adac['id'],'fax':_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0],'firstMsgDirection':_0x4ac9('0xad'),'Messages':[_[_0x4ac9('0x50')](_0x3c25a8[_0x4ac9('0x5a')],{'read':![],'body':_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][0x0][_0x4ac9('0xae')],'FaxAccountId':_0x23adac['id'],'UserId':_0x3c25a8[_0x4ac9('0x5b')]['id'],'ContactId':_0x6cae97['id'],'AttachmentId':_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x4ac9('0xaf')}]})[_0x4ac9('0x21')](function(_0x27cf05){return[_0x27cf05,!![]];});});}else{throw new Error(_0x4ac9('0xb0'));}})['spread'](function(_0x91d159,_0x1dd690){if(_0x1dd690){return _0x91d159;}return db[_0x4ac9('0x9b')][_0x4ac9('0x59')]({'direction':'out','read':![],'body':_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][0x0][_0x4ac9('0xae')],'FaxAccountId':_0x23adac['id'],'FaxInteractionId':_0x91d159['id'],'UserId':_0x3c25a8['user']['id'],'ContactId':_0x91d159[_0x4ac9('0xb1')],'AttachmentId':_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][0x0]['id']})[_0x4ac9('0x21')](function(_0xbd44e9){_0x91d159[_0x4ac9('0xb2')][_0x4ac9('0xaf')]=[];_0x91d159[_0x4ac9('0xb2')][_0x4ac9('0xaf')]['push'](_0xbd44e9[_0x4ac9('0xb2')]);return _0x91d159;});})[_0x4ac9('0x21')](function(_0x14170b){respondWithRpcPromise(_0x4ac9('0xb3'),_0x4ac9('0xb3'),{'FaxAccountId':_['isNil'](_0x3c25a8[_0x4ac9('0x58')]['id'])?undefined:_0x3c25a8[_0x4ac9('0x58')]['id'],'path':_[_0x4ac9('0xa7')](_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][0x0][_0x4ac9('0x7')])?undefined:_0x3c25a8[_0x4ac9('0x5a')][_0x4ac9('0xa2')][0x0][_0x4ac9('0x7')],'fax':_[_0x4ac9('0xa7')](_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0])?undefined:_0x3c25a8[_0x4ac9('0x5a')]['to'][0x0],'AttachmentId':_0x3c25a8['body'][_0x4ac9('0xa2')][0x0]['id']},client9002)['then'](function(_0x437078){logger['info'](_0x4ac9('0xb4'),_0x437078);})['catch'](function(_0x219b4f){logger[_0x4ac9('0x28')](_0x4ac9('0xb4'),_0x219b4f);});return _0x14170b;})[_0x4ac9('0x21')](respondWithResult(_0x3d2b7e,null))[_0x4ac9('0x2a')](handleError(_0x3d2b7e,null));};exports[_0x4ac9('0xb5')]=function(_0xdc703e,_0x56a9e7,_0x2efff2){return db[_0x4ac9('0x40')][_0x4ac9('0x63')]({'where':{'id':_0xdc703e['params']['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x56a9e7,null))['then'](function(_0x5771c7){if(_0x5771c7){return _0x5771c7[_0x4ac9('0xb5')](_0xdc703e['body']['ids'],_[_0x4ac9('0x96')](_0xdc703e['body'],[_0x4ac9('0x6d'),'id'])||{})[_0x4ac9('0xb6')](function(_0x11446b){for(var _0x3b07f1=0x0;_0x3b07f1<_0xdc703e[_0x4ac9('0x5a')][_0x4ac9('0x6d')]['length'];_0x3b07f1+=0x1){socket[_0x4ac9('0xb7')](_0x4ac9('0xb8'),{'UserId':Number(_0xdc703e[_0x4ac9('0x5a')][_0x4ac9('0x6d')][_0x3b07f1]),'FaxAccountId':Number(_0xdc703e['params']['id'])});}return _0x11446b;});}})['then'](respondWithResult(_0x56a9e7,null))[_0x4ac9('0x2a')](handleError(_0x56a9e7,null));};exports[_0x4ac9('0xb9')]=function(_0x1210fc,_0xb14c79,_0xe75d3a){return db[_0x4ac9('0x40')]['find']({'where':{'id':_0x1210fc[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0xb14c79,null))[_0x4ac9('0x21')](function(_0x2fcd2b){if(_0x2fcd2b){return _0x2fcd2b[_0x4ac9('0xb9')](_0x1210fc[_0x4ac9('0x45')]['ids'])['then'](function(){if(_[_0x4ac9('0xba')](_0x1210fc['query'][_0x4ac9('0x6d')])){for(var _0x2fb574=0x0;_0x2fb574<_0x1210fc[_0x4ac9('0x45')][_0x4ac9('0x6d')][_0x4ac9('0x4a')];_0x2fb574+=0x1){socket[_0x4ac9('0xb7')](_0x4ac9('0xbb'),{'UserId':Number(_0x1210fc[_0x4ac9('0x45')][_0x4ac9('0x6d')][_0x2fb574]),'FaxAccountId':Number(_0x1210fc[_0x4ac9('0x58')]['id'])});}}else{socket[_0x4ac9('0xb7')](_0x4ac9('0xbb'),{'UserId':Number(_0x1210fc['query']['ids']),'FaxAccountId':Number(_0x1210fc[_0x4ac9('0x58')]['id'])});}});}})[_0x4ac9('0x21')](respondWithStatusCode(_0xb14c79,null))[_0x4ac9('0x2a')](handleError(_0xb14c79,null));};exports[_0x4ac9('0xbc')]=function(_0x482769,_0x37c671,_0x134447){var _0x322672={};var _0x5582d3={};var _0x42ecab;var _0x18b3b7;return db[_0x4ac9('0x40')]['findOne']({'where':{'id':_0x482769[_0x4ac9('0x58')]['id']}})[_0x4ac9('0x21')](handleEntityNotFound(_0x37c671,null))[_0x4ac9('0x21')](function(_0x402de8){if(_0x402de8){_0x42ecab=_0x402de8;_0x5582d3[_0x4ac9('0x43')]=_[_0x4ac9('0x44')](db[_0x4ac9('0xbd')]['rawAttributes']);_0x5582d3[_0x4ac9('0x45')]=_[_0x4ac9('0x44')](_0x482769[_0x4ac9('0x45')]);_0x5582d3['filters']=_[_0x4ac9('0x47')](_0x5582d3[_0x4ac9('0x43')],_0x5582d3[_0x4ac9('0x45')]);_0x322672['attributes']=_[_0x4ac9('0x47')](_0x5582d3[_0x4ac9('0x43')],qs[_0x4ac9('0x49')](_0x482769[_0x4ac9('0x45')][_0x4ac9('0x49')]));_0x322672[_0x4ac9('0x48')]=_0x322672[_0x4ac9('0x48')][_0x4ac9('0x4a')]?_0x322672[_0x4ac9('0x48')]:_0x5582d3[_0x4ac9('0x43')];_0x322672['order']=qs['sort'](_0x482769[_0x4ac9('0x45')][_0x4ac9('0x4e')]);_0x322672['where']=qs[_0x4ac9('0x46')](_[_0x4ac9('0x71')](_0x482769[_0x4ac9('0x45')],_0x5582d3[_0x4ac9('0x46')]));if(_0x482769[_0x4ac9('0x45')][_0x4ac9('0x52')]){_0x322672[_0x4ac9('0x4f')]=_[_0x4ac9('0x50')](_0x322672['where'],{'$or':_[_0x4ac9('0x3f')](_0x322672['attributes'],function(_0x1b605b){var _0x4b5312={};_0x4b5312[_0x1b605b]={'$like':'%'+_0x482769['query'][_0x4ac9('0x52')]+'%'};return _0x4b5312;})});}_0x322672=_['merge']({},_0x322672,_0x482769['options']);return _0x42ecab[_0x4ac9('0xbc')](_0x322672);}})['then'](function(_0x1702b7){if(_0x1702b7){_0x18b3b7=_0x1702b7['length'];if(!_0x482769[_0x4ac9('0x45')]['hasOwnProperty'](_0x4ac9('0x4c'))){_0x322672[_0x4ac9('0x30')]=qs['limit'](_0x482769['query']['limit']);_0x322672[_0x4ac9('0x32')]=qs[_0x4ac9('0x32')](_0x482769[_0x4ac9('0x45')]['offset']);}return _0x42ecab[_0x4ac9('0xbc')](_0x322672);}})['then'](function(_0x1e62ce){if(_0x1e62ce){return _0x1e62ce?{'count':_0x18b3b7,'rows':_0x1e62ce}:null;}})[_0x4ac9('0x21')](respondWithResult(_0x37c671,null))[_0x4ac9('0x2a')](handleError(_0x37c671,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 0760642..59e37bc 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 _0xadbb=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','FaxAccount'];(function(_0xe00c48,_0x57005e){var _0x334157=function(_0x17f15e){while(--_0x17f15e){_0xe00c48['push'](_0xe00c48['shift']());}};_0x334157(++_0x57005e);}(_0xadbb,0x66));var _0xbadb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xadbb[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xbadb('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xbadb('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbadb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbadb('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd80010){return function(_0x115f32,_0x460a9e,_0x564684){FaxAccountEvents[_0xbadb('0x4')](_0xd80010+':'+_0x115f32['id'],_0x115f32);FaxAccountEvents[_0xbadb('0x4')](_0xd80010,_0x115f32);_0x564684(null);};}for(var e in events){if(events[_0xbadb('0x5')](e)){var event=events[e];FaxAccount[_0xbadb('0x6')](e,emitEvent(event));}}module[_0xbadb('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x9a66=['hasOwnProperty','FaxAccount','setMaxListeners','save','remove','emit'];(function(_0x10e715,_0x1aa8a8){var _0x20509f=function(_0x26e555){while(--_0x26e555){_0x10e715['push'](_0x10e715['shift']());}};_0x20509f(++_0x1aa8a8);}(_0x9a66,0xfd));var _0x69a6=function(_0x3116b0,_0x4e368e){_0x3116b0=_0x3116b0-0x0;var _0x142b5d=_0x9a66[_0x3116b0];return _0x142b5d;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x69a6('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x69a6('0x1')](0x0);var events={'afterCreate':_0x69a6('0x2'),'afterUpdate':'update','afterDestroy':_0x69a6('0x3')};function emitEvent(_0x221198){return function(_0x2b501c,_0x3346a1,_0x5c6f32){FaxAccountEvents[_0x69a6('0x4')](_0x221198+':'+_0x2b501c['id'],_0x2b501c);FaxAccountEvents['emit'](_0x221198,_0x2b501c);_0x5c6f32(null);};}for(var e in events){if(events[_0x69a6('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index cdf015e..ccd70e8 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 _0x3295=['define','FaxAccount','lodash','api','path','../../config/environment','./faxAccount.attributes'];(function(_0x8f9512,_0xe5d5a9){var _0x49b0f6=function(_0x34dd8b){while(--_0x34dd8b){_0x8f9512['push'](_0x8f9512['shift']());}};_0x49b0f6(++_0xe5d5a9);}(_0x3295,0xfe));var _0x5329=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x3295[_0x17406e];return _0x2bfc5a;};'use strict';var _=require(_0x5329('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5329('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5329('0x2'));var rimraf=require('rimraf');var config=require(_0x5329('0x3'));var attributes=require(_0x5329('0x4'));module['exports']=function(_0x137958,_0x1ffda5){return _0x137958[_0x5329('0x5')](_0x5329('0x6'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c53=['define','FaxAccount','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x1cc2f8,_0x1deaf7){var _0x266b52=function(_0x500fb7){while(--_0x500fb7){_0x1cc2f8['push'](_0x1cc2f8['shift']());}};_0x266b52(++_0x1deaf7);}(_0x4c53,0x116));var _0x34c5=function(_0x4badbc,_0x4457e9){_0x4badbc=_0x4badbc-0x0;var _0x518450=_0x4c53[_0x4badbc];return _0x518450;};'use strict';var _=require(_0x34c5('0x0'));var util=require(_0x34c5('0x1'));var logger=require(_0x34c5('0x2'))(_0x34c5('0x3'));var moment=require(_0x34c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x34c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x34c5('0x6'));var config=require(_0x34c5('0x7'));var attributes=require(_0x34c5('0x8'));module[_0x34c5('0x9')]=function(_0x450a48,_0x845916){return _0x450a48[_0x34c5('0xa')](_0x34c5('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 0a76466..9ed1027 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 _0x777a=['push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','FaxQueue','waitForTheAssignedQueue','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','then','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','account','applications','priority','asc','create','contact','FaxInteraction','autoclose'];(function(_0x4f1dea,_0x36e02b){var _0x5e6fd0=function(_0x22f392){while(--_0x22f392){_0x4f1dea['push'](_0x4f1dea['shift']());}};_0x5e6fd0(++_0x36e02b);}(_0x777a,0x75));var _0xa777=function(_0x258a15,_0x1298a1){_0x258a15=_0x258a15-0x0;var _0x4a8c01=_0x777a[_0x258a15];return _0x4a8c01;};'use strict';var _=require(_0xa777('0x0'));var util=require(_0xa777('0x1'));var moment=require(_0xa777('0x2'));var BPromise=require(_0xa777('0x3'));var rs=require(_0xa777('0x4'));var fs=require('fs');var Redis=require(_0xa777('0x5'));var db=require(_0xa777('0x6'))['db'];var utils=require(_0xa777('0x7'));var logger=require(_0xa777('0x8'))(_0xa777('0x9'));var config=require(_0xa777('0xa'));var jayson=require(_0xa777('0xb'));var client=jayson['client'][_0xa777('0xc')]({'port':0x232c});config[_0xa777('0xd')]=_[_0xa777('0xe')](config['redis'],{'host':_0xa777('0xf'),'port':0x18eb});var socket=require(_0xa777('0x10'))(new Redis(config[_0xa777('0xd')]));require(_0xa777('0x11'))[_0xa777('0x12')](socket);function respondWithRpcPromise(_0x120a57,_0x222970,_0xf6c7cd){return new BPromise(function(_0x11ef55,_0x3dfb5d){return client[_0xa777('0x13')](_0x120a57,_0xf6c7cd)['then'](function(_0x51318d){logger[_0xa777('0x14')](_0xa777('0x15'),_0x222970,_0xa777('0x16'));logger[_0xa777('0x17')](_0xa777('0x18'),_0x222970,'request\x20sent',JSON[_0xa777('0x19')](_0x51318d));if(_0x51318d[_0xa777('0x1a')]){if(_0x51318d['error'][_0xa777('0x1b')]===0x1f4){logger[_0xa777('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x222970,_0x51318d[_0xa777('0x1a')][_0xa777('0x1c')]);return _0x3dfb5d(_0x51318d[_0xa777('0x1a')]['message']);}logger[_0xa777('0x1a')](_0xa777('0x15'),_0x222970,_0x51318d['error'][_0xa777('0x1c')]);return _0x11ef55(_0x51318d[_0xa777('0x1a')]['message']);}else{logger['info'](_0xa777('0x15'),_0x222970,_0xa777('0x16'));_0x11ef55(_0x51318d[_0xa777('0x1d')][_0xa777('0x1c')]);}})[_0xa777('0x1e')](function(_0x12d365){logger[_0xa777('0x1a')](_0xa777('0x15'),_0x222970,_0x12d365);_0x3dfb5d(_0x12d365);});});}exports[_0xa777('0x1f')]=function(_0x56a9fc){var _0x208b80=this;return new Promise(function(_0x225964,_0x598eb3){return db[_0xa777('0x20')][_0xa777('0x21')]({'raw':_0x56a9fc[_0xa777('0x22')]?_0x56a9fc['options'][_0xa777('0x23')]===undefined?!![]:![]:!![],'where':_0x56a9fc[_0xa777('0x22')]?_0x56a9fc[_0xa777('0x22')][_0xa777('0x24')]||null:null,'attributes':_0x56a9fc[_0xa777('0x22')]?_0x56a9fc['options'][_0xa777('0x25')]||null:null,'limit':_0x56a9fc[_0xa777('0x22')]?_0x56a9fc[_0xa777('0x22')][_0xa777('0x26')]||null:null,'include':_0x56a9fc[_0xa777('0x22')]?_0x56a9fc[_0xa777('0x22')][_0xa777('0x27')]?_[_0xa777('0x28')](_0x56a9fc[_0xa777('0x22')][_0xa777('0x27')],function(_0x1008dd){return{'model':db[_0x1008dd['model']],'as':_0x1008dd['as'],'attributes':_0x1008dd['attributes'],'include':_0x1008dd[_0xa777('0x27')]?_[_0xa777('0x28')](_0x1008dd[_0xa777('0x27')],function(_0x53eef1){return{'model':db[_0x53eef1['model']],'as':_0x53eef1['as'],'attributes':_0x53eef1[_0xa777('0x25')],'include':_0x53eef1[_0xa777('0x27')]?_[_0xa777('0x28')](_0x53eef1[_0xa777('0x27')],function(_0x8c5e47){return{'model':db[_0x8c5e47[_0xa777('0x29')]],'as':_0x8c5e47['as'],'attributes':_0x8c5e47['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d6a4){logger[_0xa777('0x14')](_0xa777('0x1f'),_0x56a9fc);logger[_0xa777('0x17')]('GetFaxAccount',_0x56a9fc,JSON[_0xa777('0x19')](_0x46d6a4));_0x225964(_0x46d6a4);})[_0xa777('0x1e')](function(_0xebfe97){logger[_0xa777('0x1a')](_0xa777('0x1f'),_0xebfe97['message'],_0x56a9fc);_0x598eb3(_0x208b80['error'](0x1f4,_0xebfe97[_0xa777('0x1c')]));});});};exports[_0xa777('0x2a')]=function(_0x44fea0,_0x42f4a5,_0x510461){var _0x5d6cbe=this;return new Promise(function(_0x53b3b1,_0x446ab7){var _0x298987={'body':_0x44fea0[_0xa777('0x2b')],'channel':_0xa777('0x2c')};var _0x234984=[];var _0x5ad798=[];var _0x43a581={};return db['CmContact']['describe']()[_0xa777('0x2d')](function(_0x39fadf){if(!_0x39fadf){throw new db[(_0xa777('0x2e'))][(_0xa777('0x2f'))](_0xa777('0x30'));}_0x234984=_[_0xa777('0x31')](_[_0xa777('0x32')](_0x39fadf),[_0xa777('0x33'),'updatedAt']);_0x5ad798=_['difference'](_['keys'](_0x39fadf),[_0xa777('0x33'),_0xa777('0x34'),'CompanyId',_0xa777('0x35')]);if(_0x44fea0[_0xa777('0x2b')]['id']){delete _0x44fea0[_0xa777('0x2b')]['id'];}if(_[_0xa777('0x36')](_0x44fea0[_0xa777('0x2b')][_0xa777('0x37')])){throw new db[(_0xa777('0x2e'))][(_0xa777('0x2f'))](_0xa777('0x38'));}if(_[_0xa777('0x36')](_0x44fea0[_0xa777('0x2b')]['body'])||_0x44fea0[_0xa777('0x2b')]['body']===''){throw new db[(_0xa777('0x2e'))][(_0xa777('0x2f'))](_0xa777('0x39'));}if(_[_0xa777('0x36')](_0x44fea0[_0xa777('0x2b')]['mapKey'])){throw new db[(_0xa777('0x2e'))][(_0xa777('0x2f'))](_0xa777('0x3a')+_0x5ad798);}if(!_[_0xa777('0x3b')](_0x5ad798,_0x44fea0[_0xa777('0x2b')][_0xa777('0x3c')])){throw new db[(_0xa777('0x2e'))][(_0xa777('0x2f'))](_0xa777('0x3d')+_0x5ad798);}_0x43a581[_0x44fea0[_0xa777('0x2b')]['mapKey']]=_0x44fea0['body'][_0xa777('0x37')];})[_0xa777('0x2d')](function(){return db[_0xa777('0x20')][_0xa777('0x3e')]({'where':{'id':_0x44fea0['account']['id']},'include':[{'model':db[_0xa777('0x3f')],'as':_0xa777('0x40'),'include':[{'model':db[_0xa777('0x41')],'as':_0xa777('0x42'),'where':_0x43a581,'limit':0x1,'order':[[_0xa777('0x34'),_0xa777('0x43')]]}]},{'model':db[_0xa777('0x44')],'as':_0xa777('0x45')}]});})[_0xa777('0x2d')](function(_0x2a4142){if(_0x2a4142&&_0x2a4142[_0xa777('0x40')]){var _0x4a2ab7=_0x2a4142[_0xa777('0x46')]({'plain':!![]});_0x298987[_0xa777('0x47')]=_0x4a2ab7;_0x298987['applications']=_0x4a2ab7['Applications'];_0x298987['list']=_0x4a2ab7[_0xa777('0x40')];_0x298987['applications']=_['orderBy'](_0x298987[_0xa777('0x48')],[_0xa777('0x49')],[_0xa777('0x4a')]);if(_0x298987[_0xa777('0x47')][_0xa777('0x45')]){delete _0x298987[_0xa777('0x47')][_0xa777('0x45')];}if(_0x298987[_0xa777('0x47')]['List']&&_0x298987['account'][_0xa777('0x40')]['Contacts']['length']){return _0x298987[_0xa777('0x47')][_0xa777('0x40')][_0xa777('0x42')][0x0];}var _0x1030b0=_['defaults'](_0x44fea0[_0xa777('0x2b')],{'firstName':_0x44fea0[_0xa777('0x2b')][_0xa777('0x37')],'ListId':_0x4a2ab7[_0xa777('0x35')]});_0x1030b0[_0x44fea0['body'][_0xa777('0x3c')]]=_0x44fea0['body'][_0xa777('0x37')];return db[_0xa777('0x41')][_0xa777('0x4b')](_0x1030b0,{'fields':_0x234984,'raw':!![]});}})['then'](function(_0x367e93){_0x298987[_0xa777('0x4c')]=_0x367e93;if(_0x367e93){var _0x3254af={'ContactId':_0x367e93['id'],'FaxAccountId':_0x44fea0[_0xa777('0x47')]['id'],'fax':_0x367e93[_0xa777('0x2c')]};return db[_0xa777('0x4d')]['find']({'where':{'ContactId':_0x367e93['id'],'closed':![],'FaxAccountId':_0x44fea0[_0xa777('0x47')]['id']}})['then'](function(_0x440434){if(_0x440434){return[_0x440434,![]];}return db[_0xa777('0x4d')][_0xa777('0x4b')](_0x3254af)[_0xa777('0x2d')](function(_0x15f1cf){return[_0x15f1cf,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x43f32f,_0x9eb9f3){var _0x4be66d=_0x43f32f[_0xa777('0x46')]({'plain':!![]});if(_0x9eb9f3){if(_0x298987[_0xa777('0x47')][_0xa777('0x4e')]){_0x298987[_0xa777('0x48')][_0xa777('0x4f')]({'id':0x0,'priority':_0x298987[_0xa777('0x48')]['length']+0x1,'app':_0xa777('0x50'),'appdata':_0xa777('0x51'),'interval':_0xa777('0x52')});}_0x4be66d[_0xa777('0x53')]=!![];}else{_0x4be66d['created']=![];}_0x298987['interaction']=_0x4be66d;return db[_0xa777('0x54')][_0xa777('0x4b')]({'body':_0x44fea0[_0xa777('0x2b')][_0xa777('0x2b')],'FaxAccountId':_0x44fea0[_0xa777('0x47')]['id'],'FaxInteractionId':_0x43f32f['id'],'direction':'in','ContactId':_0x43f32f[_0xa777('0x55')],'AttachmentId':_0x44fea0[_0xa777('0x2b')][_0xa777('0x56')]});})[_0xa777('0x2d')](function(_0x14e9b2){_0x298987[_0xa777('0x1c')]=_0x14e9b2;if(!_0x298987[_0xa777('0x57')][_0xa777('0x58')])return;return db[_0xa777('0x59')][_0xa777('0x3e')]({'attributes':['id',_0xa777('0x5a')],'where':{'id':_0x298987[_0xa777('0x57')][_0xa777('0x58')]}});})['then'](function(_0x4bd300){if(_0x4bd300){_0x298987[_0xa777('0x48')][_0xa777('0x5b')]({'id':0x0,'priority':0x0,'app':_0xa777('0x5c'),'appdata':_0x4bd300[_0xa777('0x5a')]+','+(_0x298987[_0xa777('0x47')][_0xa777('0x5d')]||0xa),'interval':'*,*,*,*'});}if(!_0x298987[_0xa777('0x57')][_0xa777('0x5e')])return;return db[_0xa777('0x5f')][_0xa777('0x3e')]({'attributes':['id',_0xa777('0x5a')],'where':{'id':_0x298987[_0xa777('0x57')][_0xa777('0x5e')]}});})['then'](function(_0x3b361a){if(_0x3b361a){_0x298987['applications'][_0xa777('0x5b')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3b361a[_0xa777('0x5a')]+','+(_0x298987[_0xa777('0x47')][_0xa777('0x60')]||0x12c),'interval':_0xa777('0x52')});}return respondWithRpcPromise('Start',_0xa777('0x61'),_0x298987);})['then'](function(_0x254eb9){_0x53b3b1(_0x254eb9);})[_0xa777('0x1e')](function(_0x13770d){_0x446ab7(_0x5d6cbe[_0xa777('0x1a')](0x1f4,_0x13770d[_0xa777('0x1c')]));});});}; \ No newline at end of file +var _0xe8c5=['GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','body','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','CmList','List','DESC','applications','list','orderBy','priority','asc','Applications','length','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','get','push','close','unmanaged','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','FaxQueue','queue','waitForTheAssignedQueue','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch'];(function(_0x36625f,_0x727bd6){var _0x135981=function(_0x1d8f24){while(--_0x1d8f24){_0x36625f['push'](_0x36625f['shift']());}};_0x135981(++_0x727bd6);}(_0xe8c5,0xf1));var _0x5e8c=function(_0x48a932,_0x2b149a){_0x48a932=_0x48a932-0x0;var _0x4e95ba=_0xe8c5[_0x48a932];return _0x4e95ba;};'use strict';var _=require(_0x5e8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e8c('0x1'));var rs=require(_0x5e8c('0x2'));var fs=require('fs');var Redis=require(_0x5e8c('0x3'));var db=require(_0x5e8c('0x4'))['db'];var utils=require(_0x5e8c('0x5'));var logger=require(_0x5e8c('0x6'))(_0x5e8c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5e8c('0x8')]({'port':0x232c});config[_0x5e8c('0x9')]=_[_0x5e8c('0xa')](config[_0x5e8c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e8c('0x9')]));require(_0x5e8c('0xb'))[_0x5e8c('0xc')](socket);function respondWithRpcPromise(_0x550c51,_0x829570,_0x11ccc9){return new BPromise(function(_0x36f74c,_0x16065c){return client[_0x5e8c('0xd')](_0x550c51,_0x11ccc9)[_0x5e8c('0xe')](function(_0x5f5db8){logger[_0x5e8c('0xf')](_0x5e8c('0x10'),_0x829570,_0x5e8c('0x11'));logger[_0x5e8c('0x12')](_0x5e8c('0x13'),_0x829570,_0x5e8c('0x11'),JSON[_0x5e8c('0x14')](_0x5f5db8));if(_0x5f5db8['error']){if(_0x5f5db8['error'][_0x5e8c('0x15')]===0x1f4){logger[_0x5e8c('0x16')](_0x5e8c('0x10'),_0x829570,_0x5f5db8[_0x5e8c('0x16')][_0x5e8c('0x17')]);return _0x16065c(_0x5f5db8[_0x5e8c('0x16')]['message']);}logger[_0x5e8c('0x16')]('FaxAccount,\x20%s,\x20%s',_0x829570,_0x5f5db8[_0x5e8c('0x16')][_0x5e8c('0x17')]);return _0x36f74c(_0x5f5db8[_0x5e8c('0x16')][_0x5e8c('0x17')]);}else{logger[_0x5e8c('0xf')](_0x5e8c('0x10'),_0x829570,'request\x20sent');_0x36f74c(_0x5f5db8[_0x5e8c('0x18')][_0x5e8c('0x17')]);}})[_0x5e8c('0x19')](function(_0x336b1e){logger['error'](_0x5e8c('0x10'),_0x829570,_0x336b1e);_0x16065c(_0x336b1e);});});}exports[_0x5e8c('0x1a')]=function(_0xf2f6cd){var _0x539701=this;return new Promise(function(_0x25a3a9,_0x19f6ca){return db[_0x5e8c('0x1b')][_0x5e8c('0x1c')]({'raw':_0xf2f6cd[_0x5e8c('0x1d')]?_0xf2f6cd['options'][_0x5e8c('0x1e')]===undefined?!![]:![]:!![],'where':_0xf2f6cd[_0x5e8c('0x1d')]?_0xf2f6cd[_0x5e8c('0x1d')]['where']||null:null,'attributes':_0xf2f6cd['options']?_0xf2f6cd[_0x5e8c('0x1d')][_0x5e8c('0x1f')]||null:null,'limit':_0xf2f6cd[_0x5e8c('0x1d')]?_0xf2f6cd[_0x5e8c('0x1d')][_0x5e8c('0x20')]||null:null,'include':_0xf2f6cd['options']?_0xf2f6cd[_0x5e8c('0x1d')][_0x5e8c('0x21')]?_[_0x5e8c('0x22')](_0xf2f6cd[_0x5e8c('0x1d')][_0x5e8c('0x21')],function(_0x285b5e){return{'model':db[_0x285b5e['model']],'as':_0x285b5e['as'],'attributes':_0x285b5e[_0x5e8c('0x1f')],'include':_0x285b5e['include']?_[_0x5e8c('0x22')](_0x285b5e[_0x5e8c('0x21')],function(_0xb8df5a){return{'model':db[_0xb8df5a[_0x5e8c('0x23')]],'as':_0xb8df5a['as'],'attributes':_0xb8df5a[_0x5e8c('0x1f')],'include':_0xb8df5a[_0x5e8c('0x21')]?_[_0x5e8c('0x22')](_0xb8df5a[_0x5e8c('0x21')],function(_0x4b78ae){return{'model':db[_0x4b78ae[_0x5e8c('0x23')]],'as':_0x4b78ae['as'],'attributes':_0x4b78ae['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30c097){logger[_0x5e8c('0xf')](_0x5e8c('0x1a'),_0xf2f6cd);logger[_0x5e8c('0x12')](_0x5e8c('0x1a'),_0xf2f6cd,JSON[_0x5e8c('0x14')](_0x30c097));_0x25a3a9(_0x30c097);})[_0x5e8c('0x19')](function(_0x5e224c){logger['error'](_0x5e8c('0x1a'),_0x5e224c['message'],_0xf2f6cd);_0x19f6ca(_0x539701['error'](0x1f4,_0x5e224c[_0x5e8c('0x17')]));});});};exports[_0x5e8c('0x24')]=function(_0x206b2e,_0xa9e3f1,_0x516a94){var _0x24d510=this;return new Promise(function(_0x1637ac,_0x2a3b5a){var _0x296e06={'body':_0x206b2e['body'],'channel':_0x5e8c('0x25')};var _0x37c29d=[];var _0x2ca075=[];var _0x18311b={};return db[_0x5e8c('0x26')]['describe']()['then'](function(_0x19c421){if(!_0x19c421){throw new db[(_0x5e8c('0x27'))][(_0x5e8c('0x28'))](_0x5e8c('0x29'));}_0x37c29d=_['difference'](_['keys'](_0x19c421),[_0x5e8c('0x2a'),'updatedAt']);_0x2ca075=_[_0x5e8c('0x2b')](_['keys'](_0x19c421),['createdAt',_0x5e8c('0x2c'),_0x5e8c('0x2d'),'ListId']);if(_0x206b2e['body']['id']){delete _0x206b2e[_0x5e8c('0x2e')]['id'];}if(_['isNil'](_0x206b2e[_0x5e8c('0x2e')]['from'])){throw new db['Sequelize'][(_0x5e8c('0x28'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x206b2e['body'][_0x5e8c('0x2e')])||_0x206b2e['body'][_0x5e8c('0x2e')]===''){throw new db[(_0x5e8c('0x27'))]['ValidationError'](_0x5e8c('0x2f'));}if(_['isNil'](_0x206b2e['body'][_0x5e8c('0x30')])){throw new db['Sequelize'][(_0x5e8c('0x28'))](_0x5e8c('0x31')+_0x2ca075);}if(!_[_0x5e8c('0x32')](_0x2ca075,_0x206b2e[_0x5e8c('0x2e')][_0x5e8c('0x30')])){throw new db[(_0x5e8c('0x27'))][(_0x5e8c('0x28'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2ca075);}_0x18311b[_0x206b2e[_0x5e8c('0x2e')]['mapKey']]=_0x206b2e[_0x5e8c('0x2e')][_0x5e8c('0x33')];})[_0x5e8c('0xe')](function(){return db['FaxAccount']['find']({'where':{'id':_0x206b2e[_0x5e8c('0x34')]['id']},'include':[{'model':db[_0x5e8c('0x35')],'as':_0x5e8c('0x36'),'include':[{'model':db[_0x5e8c('0x26')],'as':'Contacts','where':_0x18311b,'limit':0x1,'order':[['updatedAt',_0x5e8c('0x37')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x5e8c('0xe')](function(_0x2eacf2){if(_0x2eacf2&&_0x2eacf2[_0x5e8c('0x36')]){var _0xaeab8b=_0x2eacf2['get']({'plain':!![]});_0x296e06[_0x5e8c('0x34')]=_0xaeab8b;_0x296e06[_0x5e8c('0x38')]=_0xaeab8b['Applications'];_0x296e06[_0x5e8c('0x39')]=_0xaeab8b[_0x5e8c('0x36')];_0x296e06['applications']=_[_0x5e8c('0x3a')](_0x296e06[_0x5e8c('0x38')],[_0x5e8c('0x3b')],[_0x5e8c('0x3c')]);if(_0x296e06['account'][_0x5e8c('0x3d')]){delete _0x296e06[_0x5e8c('0x34')]['Applications'];}if(_0x296e06[_0x5e8c('0x34')][_0x5e8c('0x36')]&&_0x296e06['account'][_0x5e8c('0x36')]['Contacts'][_0x5e8c('0x3e')]){return _0x296e06[_0x5e8c('0x34')][_0x5e8c('0x36')]['Contacts'][0x0];}var _0x4fc228=_[_0x5e8c('0xa')](_0x206b2e[_0x5e8c('0x2e')],{'firstName':_0x206b2e[_0x5e8c('0x2e')]['from'],'ListId':_0xaeab8b[_0x5e8c('0x3f')]});_0x4fc228[_0x206b2e['body'][_0x5e8c('0x30')]]=_0x206b2e[_0x5e8c('0x2e')]['from'];return db['CmContact'][_0x5e8c('0x40')](_0x4fc228,{'fields':_0x37c29d,'raw':!![]});}})['then'](function(_0x473995){_0x296e06[_0x5e8c('0x41')]=_0x473995;if(_0x473995){var _0x1aa6b6={'ContactId':_0x473995['id'],'FaxAccountId':_0x206b2e[_0x5e8c('0x34')]['id'],'fax':_0x473995['fax']};return db[_0x5e8c('0x42')][_0x5e8c('0x43')]({'where':{'ContactId':_0x473995['id'],'closed':![],'FaxAccountId':_0x206b2e['account']['id']}})[_0x5e8c('0xe')](function(_0x4a9590){if(_0x4a9590){return[_0x4a9590,![]];}return db[_0x5e8c('0x42')][_0x5e8c('0x40')](_0x1aa6b6)[_0x5e8c('0xe')](function(_0x4abb5b){return[_0x4abb5b,!![]];});});}else{throw new Error(_0x5e8c('0x44'));}})['spread'](function(_0x54bedc,_0x3d4069){var _0x22959e=_0x54bedc[_0x5e8c('0x45')]({'plain':!![]});if(_0x3d4069){if(_0x296e06[_0x5e8c('0x34')]['autoclose']){_0x296e06['applications'][_0x5e8c('0x46')]({'id':0x0,'priority':_0x296e06['applications']['length']+0x1,'app':_0x5e8c('0x47'),'appdata':_0x5e8c('0x48'),'interval':'*,*,*,*'});}_0x22959e['created']=!![];}else{_0x22959e[_0x5e8c('0x49')]=![];}_0x296e06[_0x5e8c('0x4a')]=_0x22959e;return db[_0x5e8c('0x4b')]['create']({'body':_0x206b2e['body'][_0x5e8c('0x2e')],'FaxAccountId':_0x206b2e[_0x5e8c('0x34')]['id'],'FaxInteractionId':_0x54bedc['id'],'direction':'in','ContactId':_0x54bedc['ContactId'],'AttachmentId':_0x206b2e[_0x5e8c('0x2e')][_0x5e8c('0x4c')]});})[_0x5e8c('0xe')](function(_0x1932ce){_0x296e06[_0x5e8c('0x17')]=_0x1932ce;if(!_0x296e06[_0x5e8c('0x4a')][_0x5e8c('0x4d')])return;return db[_0x5e8c('0x4e')][_0x5e8c('0x43')]({'attributes':['id',_0x5e8c('0x4f')],'where':{'id':_0x296e06['interaction'][_0x5e8c('0x4d')]}});})[_0x5e8c('0xe')](function(_0x47de98){if(_0x47de98){_0x296e06[_0x5e8c('0x38')][_0x5e8c('0x50')]({'id':0x0,'priority':0x0,'app':_0x5e8c('0x51'),'appdata':_0x47de98['name']+','+(_0x296e06[_0x5e8c('0x34')][_0x5e8c('0x52')]||0xa),'interval':_0x5e8c('0x53')});}if(!_0x296e06[_0x5e8c('0x4a')][_0x5e8c('0x54')])return;return db[_0x5e8c('0x55')]['find']({'attributes':['id',_0x5e8c('0x4f')],'where':{'id':_0x296e06['interaction']['queueId']}});})[_0x5e8c('0xe')](function(_0x4a3d82){if(_0x4a3d82){_0x296e06['applications'][_0x5e8c('0x50')]({'id':0x0,'priority':0x1,'app':_0x5e8c('0x56'),'appdata':_0x4a3d82[_0x5e8c('0x4f')]+','+(_0x296e06['account'][_0x5e8c('0x57')]||0x12c),'interval':_0x5e8c('0x53')});}return respondWithRpcPromise('Start',_0x5e8c('0x58'),_0x296e06);})[_0x5e8c('0xe')](function(_0x1f2b1d){_0x1637ac(_0x1f2b1d);})[_0x5e8c('0x19')](function(_0x32b6ff){_0x2a3b5a(_0x24d510[_0x5e8c('0x16')](0x1f4,_0x32b6ff['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6da00ac..ea1b4f4 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 _0x665b=['remove','removeListener','faxAccount:','save'];(function(_0x4dc708,_0x53ec85){var _0x886931=function(_0x5824c9){while(--_0x5824c9){_0x4dc708['push'](_0x4dc708['shift']());}};_0x886931(++_0x53ec85);}(_0x665b,0x1b7));var _0xb665=function(_0x3e99e5,_0x195570){_0x3e99e5=_0x3e99e5-0x0;var _0x97ff93=_0x665b[_0x3e99e5];return _0x97ff93;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xb665('0x0'),_0xb665('0x1'),'update'];function createListener(_0x48460f,_0x59f7b1){return function(_0x38b993){_0x59f7b1['emit'](_0x48460f,_0x38b993);};}function removeListener(_0x37eb1c,_0xf229da){return function(){FaxAccountEvents[_0xb665('0x2')](_0x37eb1c,_0xf229da);};}exports['register']=function(_0x32b267){for(var _0x1644ad=0x0,_0x44ce0f=events['length'];_0x1644ad<_0x44ce0f;_0x1644ad++){var _0x590732=events[_0x1644ad];var _0x302bb9=createListener(_0xb665('0x3')+_0x590732,_0x32b267);FaxAccountEvents['on'](_0x590732,_0x302bb9);}}; \ No newline at end of file +var _0xae22=['register','faxAccount:','./faxAccount.events','save','update','emit','removeListener'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xae22,0x6b));var _0x2ae2=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xae22[_0x47e7cb];return _0x2a8874;};'use strict';var FaxAccountEvents=require(_0x2ae2('0x0'));var events=[_0x2ae2('0x1'),'remove',_0x2ae2('0x2')];function createListener(_0x27b18a,_0x184e0d){return function(_0x431009){_0x184e0d[_0x2ae2('0x3')](_0x27b18a,_0x431009);};}function removeListener(_0x7fbb19,_0x446c22){return function(){FaxAccountEvents[_0x2ae2('0x4')](_0x7fbb19,_0x446c22);};}exports[_0x2ae2('0x5')]=function(_0x34a9fe){for(var _0x5f2ff8=0x0,_0x2e137b=events['length'];_0x5f2ff8<_0x2e137b;_0x5f2ff8++){var _0x34ab61=events[_0x5f2ff8];var _0x22abaf=createListener(_0x2ae2('0x6')+_0x34ab61,_0x34a9fe);FaxAccountEvents['on'](_0x34ab61,_0x22abaf);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1d84046..9dd70d1 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 _0xfb60=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getApplications','/:id/users','getAgents','post','create','addDisposition','addInteraction','/:id/applications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','delete','destroy','removeDispositions','removeAnswers','exports','util'];(function(_0x84b156,_0xfebfa2){var _0x296033=function(_0x152123){while(--_0x152123){_0x84b156['push'](_0x84b156['shift']());}};_0x296033(++_0xfebfa2);}(_0xfb60,0x110));var _0x0fb6=function(_0x599bd0,_0x3e4cf3){_0x599bd0=_0x599bd0-0x0;var _0x41355b=_0xfb60[_0x599bd0];return _0x41355b;};'use strict';var multer=require('multer');var util=require(_0x0fb6('0x0'));var path=require(_0x0fb6('0x1'));var timeout=require(_0x0fb6('0x2'));var express=require(_0x0fb6('0x3'));var router=express[_0x0fb6('0x4')]();var fs_extra=require(_0x0fb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fb6('0x6'));var config=require('../../config/environment');var controller=require(_0x0fb6('0x7'));router[_0x0fb6('0x8')]('/',auth[_0x0fb6('0x9')](),controller[_0x0fb6('0xa')]);router[_0x0fb6('0x8')](_0x0fb6('0xb'),auth[_0x0fb6('0x9')](),controller['describe']);router[_0x0fb6('0x8')](_0x0fb6('0xc'),auth[_0x0fb6('0x9')](),controller[_0x0fb6('0xd')]);router['get'](_0x0fb6('0xe'),auth[_0x0fb6('0x9')](),controller[_0x0fb6('0xf')]);router[_0x0fb6('0x8')](_0x0fb6('0x10'),auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x11')]);router[_0x0fb6('0x8')](_0x0fb6('0x12'),auth['isAuthenticated'](),controller[_0x0fb6('0x13')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x0fb6('0x14')]);router[_0x0fb6('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x0fb6('0x8')](_0x0fb6('0x15'),auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x16')]);router[_0x0fb6('0x17')]('/',auth['isAuthenticated'](),controller[_0x0fb6('0x18')]);router[_0x0fb6('0x17')](_0x0fb6('0xe'),auth['isAuthenticated'](),controller[_0x0fb6('0x19')]);router[_0x0fb6('0x17')](_0x0fb6('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x0fb6('0x17')]('/:id/interactions',auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x1a')]);router[_0x0fb6('0x17')](_0x0fb6('0x1b'),auth[_0x0fb6('0x9')](),controller['addApplications']);router[_0x0fb6('0x17')]('/addaccountapplications',auth['isAuthenticated'](),controller[_0x0fb6('0x1c')]);router[_0x0fb6('0x17')]('/updateaccountapplications',auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x1d')]);router[_0x0fb6('0x17')](_0x0fb6('0x1e'),auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x1f')]);router[_0x0fb6('0x17')](_0x0fb6('0x15'),auth['isAuthenticated'](),controller[_0x0fb6('0x20')]);router[_0x0fb6('0x21')](_0x0fb6('0xc'),auth[_0x0fb6('0x9')](),controller['update']);router[_0x0fb6('0x22')](_0x0fb6('0xc'),auth['isAuthenticated'](),controller[_0x0fb6('0x23')]);router['delete']('/:id/dispositions',auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x24')]);router[_0x0fb6('0x22')](_0x0fb6('0x10'),auth[_0x0fb6('0x9')](),controller[_0x0fb6('0x25')]);router['delete'](_0x0fb6('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0fb6('0x26')]=router; \ No newline at end of file +var _0x4233=['addAgents','put','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','send'];(function(_0xe56790,_0x5f304d){var _0x145cf7=function(_0x49aeb1){while(--_0x49aeb1){_0xe56790['push'](_0xe56790['shift']());}};_0x145cf7(++_0x5f304d);}(_0x4233,0x199));var _0x3423=function(_0x5d34bc,_0x40dec7){_0x5d34bc=_0x5d34bc-0x0;var _0x4ca50e=_0x4233[_0x5d34bc];return _0x4ca50e;};'use strict';var multer=require('multer');var util=require(_0x3423('0x0'));var path=require(_0x3423('0x1'));var timeout=require(_0x3423('0x2'));var express=require('express');var router=express[_0x3423('0x3')]();var fs_extra=require(_0x3423('0x4'));var auth=require(_0x3423('0x5'));var interaction=require(_0x3423('0x6'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x3423('0x7')]('/',auth[_0x3423('0x8')](),controller['index']);router['get'](_0x3423('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3423('0xa'),auth[_0x3423('0x8')](),controller[_0x3423('0xb')]);router[_0x3423('0x7')](_0x3423('0xc'),auth[_0x3423('0x8')](),controller[_0x3423('0xd')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3423('0xe')]);router[_0x3423('0x7')](_0x3423('0xf'),auth[_0x3423('0x8')](),controller[_0x3423('0x10')]);router[_0x3423('0x7')](_0x3423('0x11'),auth[_0x3423('0x8')](),controller['getApplications']);router[_0x3423('0x7')](_0x3423('0x12'),auth[_0x3423('0x8')](),controller[_0x3423('0x13')]);router[_0x3423('0x7')](_0x3423('0x14'),auth[_0x3423('0x8')](),controller[_0x3423('0x15')]);router[_0x3423('0x16')]('/',auth[_0x3423('0x8')](),controller['create']);router[_0x3423('0x16')](_0x3423('0xc'),auth[_0x3423('0x8')](),controller[_0x3423('0x17')]);router[_0x3423('0x16')]('/:id/canned_answers',auth[_0x3423('0x8')](),controller[_0x3423('0x18')]);router[_0x3423('0x16')](_0x3423('0xf'),auth[_0x3423('0x8')](),controller[_0x3423('0x19')]);router[_0x3423('0x16')](_0x3423('0x11'),auth[_0x3423('0x8')](),controller[_0x3423('0x1a')]);router['post'](_0x3423('0x1b'),auth[_0x3423('0x8')](),controller['addAccountApplications']);router[_0x3423('0x16')](_0x3423('0x1c'),auth[_0x3423('0x8')](),controller[_0x3423('0x1d')]);router[_0x3423('0x16')]('/:id/send',auth['isAuthenticated'](),controller[_0x3423('0x1e')]);router[_0x3423('0x16')](_0x3423('0x14'),auth[_0x3423('0x8')](),controller[_0x3423('0x1f')]);router[_0x3423('0x20')]('/:id',auth[_0x3423('0x8')](),controller[_0x3423('0x21')]);router[_0x3423('0x22')]('/:id',auth[_0x3423('0x8')](),controller[_0x3423('0x23')]);router[_0x3423('0x22')]('/:id/dispositions',auth[_0x3423('0x8')](),controller['removeDispositions']);router['delete'](_0x3423('0x24'),auth['isAuthenticated'](),controller[_0x3423('0x25')]);router[_0x3423('0x22')](_0x3423('0x14'),auth['isAuthenticated'](),controller[_0x3423('0x26')]);module[_0x3423('0x27')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 8389e8a..1ddb925 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 _0x279d=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x240d83,_0x39071c){var _0x4652e6=function(_0x24241e){while(--_0x24241e){_0x240d83['push'](_0x240d83['shift']());}};_0x4652e6(++_0x39071c);}(_0x279d,0x127));var _0xd279=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x279d[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0xd279('0x0'));module[_0xd279('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd279('0x2')],'allowNull':![],'defaultValue':_0xd279('0x3')},'appdata':{'type':Sequelize[_0xd279('0x4')]()},'description':{'type':Sequelize[_0xd279('0x2')]},'interval':{'type':Sequelize[_0xd279('0x2')],'defaultValue':_0xd279('0x5')}}; \ No newline at end of file +var _0x8416=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x16a7bd,_0x4725f7){var _0x5ddcfc=function(_0x227293){while(--_0x227293){_0x16a7bd['push'](_0x16a7bd['shift']());}};_0x5ddcfc(++_0x4725f7);}(_0x8416,0x150));var _0x6841=function(_0x5db0ee,_0x30d52e){_0x5db0ee=_0x5db0ee-0x0;var _0x3d5b60=_0x8416[_0x5db0ee];return _0x3d5b60;};'use strict';var Sequelize=require(_0x6841('0x0'));module[_0x6841('0x1')]={'priority':{'type':Sequelize[_0x6841('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6841('0x3')},'appdata':{'type':Sequelize[_0x6841('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6841('0x5')],'defaultValue':_0x6841('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 8b4756e..b7d53d6 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 _0x05bb=['find','catch','create','body','params','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','limit','undefined','count','set','reject','update','then','destroy','sendStatus','error','stack','send','index','map','FaxApplication','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes'];(function(_0xe371f0,_0x43e562){var _0x41d35b=function(_0x570754){while(--_0x570754){_0xe371f0['push'](_0xe371f0['shift']());}};_0x41d35b(++_0x43e562);}(_0x05bb,0x197));var _0xb05b=function(_0x4b66a0,_0x632b2a){_0x4b66a0=_0x4b66a0-0x0;var _0x42b74d=_0x05bb[_0x4b66a0];return _0x42b74d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb05b('0x0'));var zipdir=require(_0xb05b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb05b('0x2'));var moment=require(_0xb05b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb05b('0x4'));var sox=require(_0xb05b('0x5'));var csv=require(_0xb05b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb05b('0x7'));var _=require(_0xb05b('0x8'));var squel=require('squel');var crypto=require(_0xb05b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb05b('0x6'));var querystring=require(_0xb05b('0xa'));var Papa=require('papaparse');var Redis=require(_0xb05b('0xb'));var authService=require(_0xb05b('0xc'));var qs=require(_0xb05b('0xd'));var as=require(_0xb05b('0xe'));var hardwareService=require(_0xb05b('0xf'));var logger=require(_0xb05b('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb05b('0x11'))['db'];function respondWithStatusCode(_0x20e720,_0x37d5a5){_0x37d5a5=_0x37d5a5||0xcc;return function(_0x463334){if(_0x463334){return _0x20e720['sendStatus'](_0x37d5a5);}return _0x20e720[_0xb05b('0x12')](_0x37d5a5)[_0xb05b('0x13')]();};}function respondWithResult(_0x1d9233,_0x1c6082){_0x1c6082=_0x1c6082||0xc8;return function(_0xfc1d4f){if(_0xfc1d4f){return _0x1d9233[_0xb05b('0x12')](_0x1c6082)[_0xb05b('0x14')](_0xfc1d4f);}};}function respondWithFilteredResult(_0x5c2b50,_0x5dafeb){return function(_0x7bb944){if(_0x7bb944){var _0x219c70=typeof _0x5dafeb['offset']==='undefined'&&typeof _0x5dafeb[_0xb05b('0x15')]===_0xb05b('0x16');var _0xb72f1a=_0x7bb944[_0xb05b('0x17')];var _0xf9a65a=_0x219c70?0x0:_0x5dafeb['offset'];var _0x502bba=_0x219c70?_0x7bb944[_0xb05b('0x17')]:_0x5dafeb['offset']+_0x5dafeb[_0xb05b('0x15')];var _0x567a39;if(_0x502bba>=_0xb72f1a){_0x502bba=_0xb72f1a;_0x567a39=0xc8;}else{_0x567a39=0xce;}_0x5c2b50[_0xb05b('0x12')](_0x567a39);return _0x5c2b50[_0xb05b('0x18')]('Content-Range',_0xf9a65a+'-'+_0x502bba+'/'+_0xb72f1a)['json'](_0x7bb944);}return null;};}function patchUpdates(_0x323cb2){return function(_0x2ee9ad){try{jsonpatch['apply'](_0x2ee9ad,_0x323cb2,!![]);}catch(_0x59378c){return BPromise[_0xb05b('0x19')](_0x59378c);}return _0x2ee9ad['save']();};}function saveUpdates(_0x1f631f,_0x143417){return function(_0x2f3f1e){if(_0x2f3f1e){return _0x2f3f1e[_0xb05b('0x1a')](_0x1f631f)[_0xb05b('0x1b')](function(_0x2f690b){return _0x2f690b;});}return null;};}function removeEntity(_0x28c459,_0x4ed03d){return function(_0x276042){if(_0x276042){return _0x276042[_0xb05b('0x1c')]()[_0xb05b('0x1b')](function(){_0x28c459[_0xb05b('0x12')](0xcc)[_0xb05b('0x13')]();});}};}function handleEntityNotFound(_0x5e87e6,_0x4fb87b){return function(_0x192644){if(!_0x192644){_0x5e87e6[_0xb05b('0x1d')](0x194);}return _0x192644;};}function handleError(_0x26820a,_0x338a5f){_0x338a5f=_0x338a5f||0x1f4;return function(_0x18ba4b){logger[_0xb05b('0x1e')](_0x18ba4b[_0xb05b('0x1f')]);if(_0x18ba4b['name']){delete _0x18ba4b['name'];}_0x26820a[_0xb05b('0x12')](_0x338a5f)[_0xb05b('0x20')](_0x18ba4b);};}exports[_0xb05b('0x21')]=function(_0x3ef6e9,_0x53b309){var _0x2b8fd6={},_0x4eac29={},_0x2be9ba={'count':0x0,'rows':[]};var _0x4e0595=_[_0xb05b('0x22')](db[_0xb05b('0x23')]['rawAttributes'],function(_0x447ebc){return{'name':_0x447ebc['fieldName'],'type':_0x447ebc[_0xb05b('0x24')][_0xb05b('0x25')]};});_0x4eac29[_0xb05b('0x26')]=_[_0xb05b('0x22')](_0x4e0595,_0xb05b('0x27'));_0x4eac29[_0xb05b('0x28')]=_[_0xb05b('0x29')](_0x3ef6e9[_0xb05b('0x28')]);_0x4eac29[_0xb05b('0x2a')]=_[_0xb05b('0x2b')](_0x4eac29[_0xb05b('0x26')],_0x4eac29[_0xb05b('0x28')]);_0x2b8fd6[_0xb05b('0x2c')]=_[_0xb05b('0x2b')](_0x4eac29['model'],qs[_0xb05b('0x2d')](_0x3ef6e9['query'][_0xb05b('0x2d')]));_0x2b8fd6[_0xb05b('0x2c')]=_0x2b8fd6[_0xb05b('0x2c')][_0xb05b('0x2e')]?_0x2b8fd6[_0xb05b('0x2c')]:_0x4eac29[_0xb05b('0x26')];if(!_0x3ef6e9[_0xb05b('0x28')]['hasOwnProperty'](_0xb05b('0x2f'))){_0x2b8fd6[_0xb05b('0x15')]=qs[_0xb05b('0x15')](_0x3ef6e9[_0xb05b('0x28')]['limit']);_0x2b8fd6['offset']=qs[_0xb05b('0x30')](_0x3ef6e9[_0xb05b('0x28')][_0xb05b('0x30')]);}_0x2b8fd6[_0xb05b('0x31')]=qs[_0xb05b('0x32')](_0x3ef6e9[_0xb05b('0x28')]['sort']);_0x2b8fd6[_0xb05b('0x33')]=qs[_0xb05b('0x2a')](_[_0xb05b('0x34')](_0x3ef6e9['query'],_0x4eac29[_0xb05b('0x2a')]),_0x4e0595);if(_0x3ef6e9[_0xb05b('0x28')][_0xb05b('0x35')]){_0x2b8fd6[_0xb05b('0x33')]=_[_0xb05b('0x36')](_0x2b8fd6['where'],{'$or':_[_0xb05b('0x22')](_0x4e0595,function(_0x42cc77){if(_0x42cc77['type']!==_0xb05b('0x37')){var _0x3e847a={};_0x3e847a[_0x42cc77['name']]={'$like':'%'+_0x3ef6e9[_0xb05b('0x28')][_0xb05b('0x35')]+'%'};return _0x3e847a;}})});}_0x2b8fd6=_[_0xb05b('0x36')]({},_0x2b8fd6,_0x3ef6e9[_0xb05b('0x38')]);var _0xe919eb={'where':_0x2b8fd6['where']};return db[_0xb05b('0x23')]['count'](_0xe919eb)[_0xb05b('0x1b')](function(_0x22374b){_0x2be9ba[_0xb05b('0x17')]=_0x22374b;if(_0x3ef6e9[_0xb05b('0x28')][_0xb05b('0x39')]){_0x2b8fd6['include']=[{'all':!![]}];}return db[_0xb05b('0x23')][_0xb05b('0x3a')](_0x2b8fd6);})[_0xb05b('0x1b')](function(_0x2cc6e2){_0x2be9ba[_0xb05b('0x3b')]=_0x2cc6e2;return _0x2be9ba;})[_0xb05b('0x1b')](respondWithFilteredResult(_0x53b309,_0x2b8fd6))['catch'](handleError(_0x53b309,null));};exports[_0xb05b('0x3c')]=function(_0x139c2f,_0x1fdedf){var _0x650231={'raw':!![],'where':{'id':_0x139c2f['params']['id']}},_0x40ec17={};_0x40ec17[_0xb05b('0x26')]=_['keys'](db[_0xb05b('0x23')][_0xb05b('0x3d')]);_0x40ec17['query']=_['keys'](_0x139c2f['query']);_0x40ec17[_0xb05b('0x2a')]=_['intersection'](_0x40ec17[_0xb05b('0x26')],_0x40ec17['query']);_0x650231[_0xb05b('0x2c')]=_[_0xb05b('0x2b')](_0x40ec17[_0xb05b('0x26')],qs[_0xb05b('0x2d')](_0x139c2f[_0xb05b('0x28')][_0xb05b('0x2d')]));_0x650231[_0xb05b('0x2c')]=_0x650231[_0xb05b('0x2c')]['length']?_0x650231['attributes']:_0x40ec17[_0xb05b('0x26')];if(_0x139c2f[_0xb05b('0x28')][_0xb05b('0x39')]){_0x650231['include']=[{'all':!![]}];}_0x650231=_[_0xb05b('0x36')]({},_0x650231,_0x139c2f['options']);return db[_0xb05b('0x23')][_0xb05b('0x3e')](_0x650231)[_0xb05b('0x1b')](handleEntityNotFound(_0x1fdedf,null))[_0xb05b('0x1b')](respondWithResult(_0x1fdedf,null))[_0xb05b('0x3f')](handleError(_0x1fdedf,null));};exports[_0xb05b('0x40')]=function(_0x449413,_0x57eaa4){return db[_0xb05b('0x23')]['create'](_0x449413[_0xb05b('0x41')],{})[_0xb05b('0x1b')](respondWithResult(_0x57eaa4,0xc9))[_0xb05b('0x3f')](handleError(_0x57eaa4,null));};exports[_0xb05b('0x1a')]=function(_0x396ca0,_0x114ede){if(_0x396ca0[_0xb05b('0x41')]['id']){delete _0x396ca0[_0xb05b('0x41')]['id'];}return db[_0xb05b('0x23')][_0xb05b('0x3e')]({'where':{'id':_0x396ca0[_0xb05b('0x42')]['id']}})[_0xb05b('0x1b')](handleEntityNotFound(_0x114ede,null))[_0xb05b('0x1b')](saveUpdates(_0x396ca0['body'],null))[_0xb05b('0x1b')](respondWithResult(_0x114ede,null))['catch'](handleError(_0x114ede,null));};exports['destroy']=function(_0x5a5752,_0x372eef){return db[_0xb05b('0x23')][_0xb05b('0x3e')]({'where':{'id':_0x5a5752[_0xb05b('0x42')]['id']}})[_0xb05b('0x1b')](handleEntityNotFound(_0x372eef,null))[_0xb05b('0x1b')](removeEntity(_0x372eef,null))['catch'](handleError(_0x372eef,null));}; \ No newline at end of file +var _0x1e58=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','error','name','send','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','FaxApplication','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1c44a8,_0x39644b){var _0x2c0848=function(_0xb6a4fb){while(--_0xb6a4fb){_0x1c44a8['push'](_0x1c44a8['shift']());}};_0x2c0848(++_0x39644b);}(_0x1e58,0x1b0));var _0x81e5=function(_0x299497,_0x3a421c){_0x299497=_0x299497-0x0;var _0x164221=_0x1e58[_0x299497];return _0x164221;};'use strict';var emlformat=require(_0x81e5('0x0'));var rimraf=require(_0x81e5('0x1'));var zipdir=require(_0x81e5('0x2'));var jsonpatch=require(_0x81e5('0x3'));var rp=require(_0x81e5('0x4'));var moment=require(_0x81e5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x81e5('0x6'));var util=require(_0x81e5('0x7'));var path=require(_0x81e5('0x8'));var sox=require(_0x81e5('0x9'));var csv=require(_0x81e5('0xa'));var ejs=require(_0x81e5('0xb'));var fs=require('fs');var fs_extra=require(_0x81e5('0xc'));var _=require(_0x81e5('0xd'));var squel=require(_0x81e5('0xe'));var crypto=require(_0x81e5('0xf'));var jsforce=require(_0x81e5('0x10'));var deskjs=require(_0x81e5('0x11'));var toCsv=require(_0x81e5('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x81e5('0x12'));var qs=require(_0x81e5('0x13'));var as=require(_0x81e5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81e5('0x15'))(_0x81e5('0x16'));var utils=require(_0x81e5('0x17'));var config=require(_0x81e5('0x18'));var licenseUtil=require(_0x81e5('0x19'));var db=require(_0x81e5('0x1a'))['db'];function respondWithStatusCode(_0x398d30,_0x552dc6){_0x552dc6=_0x552dc6||0xcc;return function(_0x120be9){if(_0x120be9){return _0x398d30[_0x81e5('0x1b')](_0x552dc6);}return _0x398d30[_0x81e5('0x1c')](_0x552dc6)[_0x81e5('0x1d')]();};}function respondWithResult(_0x26885d,_0x3107b3){_0x3107b3=_0x3107b3||0xc8;return function(_0x52f35d){if(_0x52f35d){return _0x26885d[_0x81e5('0x1c')](_0x3107b3)[_0x81e5('0x1e')](_0x52f35d);}};}function respondWithFilteredResult(_0x2e901c,_0x5d41b4){return function(_0x429f09){if(_0x429f09){var _0x490241=typeof _0x5d41b4[_0x81e5('0x1f')]===_0x81e5('0x20')&&typeof _0x5d41b4['limit']===_0x81e5('0x20');var _0xb02376=_0x429f09['count'];var _0x54fada=_0x490241?0x0:_0x5d41b4[_0x81e5('0x1f')];var _0x1b21d3=_0x490241?_0x429f09[_0x81e5('0x21')]:_0x5d41b4['offset']+_0x5d41b4[_0x81e5('0x22')];var _0x3ce2da;if(_0x1b21d3>=_0xb02376){_0x1b21d3=_0xb02376;_0x3ce2da=0xc8;}else{_0x3ce2da=0xce;}_0x2e901c[_0x81e5('0x1c')](_0x3ce2da);return _0x2e901c[_0x81e5('0x23')](_0x81e5('0x24'),_0x54fada+'-'+_0x1b21d3+'/'+_0xb02376)[_0x81e5('0x1e')](_0x429f09);}return null;};}function patchUpdates(_0xf2e896){return function(_0x3510b4){try{jsonpatch['apply'](_0x3510b4,_0xf2e896,!![]);}catch(_0x459d74){return BPromise['reject'](_0x459d74);}return _0x3510b4['save']();};}function saveUpdates(_0x4424ae,_0x34677f){return function(_0x27ae84){if(_0x27ae84){return _0x27ae84[_0x81e5('0x25')](_0x4424ae)[_0x81e5('0x26')](function(_0xb074da){return _0xb074da;});}return null;};}function removeEntity(_0x20217a,_0x5ed0d7){return function(_0x1d0c51){if(_0x1d0c51){return _0x1d0c51['destroy']()['then'](function(){_0x20217a[_0x81e5('0x1c')](0xcc)[_0x81e5('0x1d')]();});}};}function handleEntityNotFound(_0xb09149,_0x4ac98c){return function(_0x5a5f6f){if(!_0x5a5f6f){_0xb09149[_0x81e5('0x1b')](0x194);}return _0x5a5f6f;};}function handleError(_0x2a9045,_0xd144a6){_0xd144a6=_0xd144a6||0x1f4;return function(_0x4021bd){logger[_0x81e5('0x27')](_0x4021bd['stack']);if(_0x4021bd[_0x81e5('0x28')]){delete _0x4021bd[_0x81e5('0x28')];}_0x2a9045[_0x81e5('0x1c')](_0xd144a6)[_0x81e5('0x29')](_0x4021bd);};}exports[_0x81e5('0x2a')]=function(_0x28dd8d,_0x5612aa){var _0x280d78={},_0x473b2c={},_0x4a0796={'count':0x0,'rows':[]};var _0x2ac997=_['map'](db['FaxApplication'][_0x81e5('0x2b')],function(_0x207d2c){return{'name':_0x207d2c[_0x81e5('0x2c')],'type':_0x207d2c['type'][_0x81e5('0x2d')]};});_0x473b2c[_0x81e5('0x2e')]=_[_0x81e5('0x2f')](_0x2ac997,_0x81e5('0x28'));_0x473b2c[_0x81e5('0x30')]=_['keys'](_0x28dd8d[_0x81e5('0x30')]);_0x473b2c[_0x81e5('0x31')]=_[_0x81e5('0x32')](_0x473b2c[_0x81e5('0x2e')],_0x473b2c[_0x81e5('0x30')]);_0x280d78[_0x81e5('0x33')]=_['intersection'](_0x473b2c[_0x81e5('0x2e')],qs[_0x81e5('0x34')](_0x28dd8d[_0x81e5('0x30')][_0x81e5('0x34')]));_0x280d78['attributes']=_0x280d78[_0x81e5('0x33')][_0x81e5('0x35')]?_0x280d78[_0x81e5('0x33')]:_0x473b2c['model'];if(!_0x28dd8d['query'][_0x81e5('0x36')]('nolimit')){_0x280d78[_0x81e5('0x22')]=qs[_0x81e5('0x22')](_0x28dd8d[_0x81e5('0x30')]['limit']);_0x280d78[_0x81e5('0x1f')]=qs[_0x81e5('0x1f')](_0x28dd8d['query']['offset']);}_0x280d78[_0x81e5('0x37')]=qs[_0x81e5('0x38')](_0x28dd8d[_0x81e5('0x30')][_0x81e5('0x38')]);_0x280d78['where']=qs[_0x81e5('0x31')](_['pick'](_0x28dd8d[_0x81e5('0x30')],_0x473b2c[_0x81e5('0x31')]),_0x2ac997);if(_0x28dd8d[_0x81e5('0x30')][_0x81e5('0x39')]){_0x280d78[_0x81e5('0x3a')]=_[_0x81e5('0x3b')](_0x280d78['where'],{'$or':_[_0x81e5('0x2f')](_0x2ac997,function(_0x47afed){if(_0x47afed[_0x81e5('0x3c')]!==_0x81e5('0x3d')){var _0x55b23e={};_0x55b23e[_0x47afed[_0x81e5('0x28')]]={'$like':'%'+_0x28dd8d[_0x81e5('0x30')]['filter']+'%'};return _0x55b23e;}})});}_0x280d78=_['merge']({},_0x280d78,_0x28dd8d[_0x81e5('0x3e')]);var _0x41af2f={'where':_0x280d78[_0x81e5('0x3a')]};return db[_0x81e5('0x3f')][_0x81e5('0x21')](_0x41af2f)[_0x81e5('0x26')](function(_0x3d06fd){_0x4a0796[_0x81e5('0x21')]=_0x3d06fd;if(_0x28dd8d[_0x81e5('0x30')][_0x81e5('0x40')]){_0x280d78[_0x81e5('0x41')]=[{'all':!![]}];}return db[_0x81e5('0x3f')]['findAll'](_0x280d78);})[_0x81e5('0x26')](function(_0x6fefdc){_0x4a0796[_0x81e5('0x42')]=_0x6fefdc;return _0x4a0796;})[_0x81e5('0x26')](respondWithFilteredResult(_0x5612aa,_0x280d78))[_0x81e5('0x43')](handleError(_0x5612aa,null));};exports[_0x81e5('0x44')]=function(_0x50234d,_0x1ff218){var _0x2d0799={'raw':!![],'where':{'id':_0x50234d[_0x81e5('0x45')]['id']}},_0x3b3edb={};_0x3b3edb[_0x81e5('0x2e')]=_[_0x81e5('0x46')](db[_0x81e5('0x3f')][_0x81e5('0x2b')]);_0x3b3edb[_0x81e5('0x30')]=_[_0x81e5('0x46')](_0x50234d[_0x81e5('0x30')]);_0x3b3edb[_0x81e5('0x31')]=_[_0x81e5('0x32')](_0x3b3edb[_0x81e5('0x2e')],_0x3b3edb['query']);_0x2d0799['attributes']=_['intersection'](_0x3b3edb[_0x81e5('0x2e')],qs[_0x81e5('0x34')](_0x50234d[_0x81e5('0x30')][_0x81e5('0x34')]));_0x2d0799['attributes']=_0x2d0799[_0x81e5('0x33')][_0x81e5('0x35')]?_0x2d0799['attributes']:_0x3b3edb['model'];if(_0x50234d[_0x81e5('0x30')][_0x81e5('0x40')]){_0x2d0799[_0x81e5('0x41')]=[{'all':!![]}];}_0x2d0799=_[_0x81e5('0x3b')]({},_0x2d0799,_0x50234d[_0x81e5('0x3e')]);return db[_0x81e5('0x3f')][_0x81e5('0x47')](_0x2d0799)[_0x81e5('0x26')](handleEntityNotFound(_0x1ff218,null))[_0x81e5('0x26')](respondWithResult(_0x1ff218,null))['catch'](handleError(_0x1ff218,null));};exports[_0x81e5('0x48')]=function(_0x9c431,_0x537073){return db[_0x81e5('0x3f')][_0x81e5('0x48')](_0x9c431[_0x81e5('0x49')],{})[_0x81e5('0x26')](respondWithResult(_0x537073,0xc9))[_0x81e5('0x43')](handleError(_0x537073,null));};exports[_0x81e5('0x25')]=function(_0x4e69a5,_0x5d56d2){if(_0x4e69a5[_0x81e5('0x49')]['id']){delete _0x4e69a5['body']['id'];}return db[_0x81e5('0x3f')][_0x81e5('0x47')]({'where':{'id':_0x4e69a5['params']['id']}})[_0x81e5('0x26')](handleEntityNotFound(_0x5d56d2,null))[_0x81e5('0x26')](saveUpdates(_0x4e69a5[_0x81e5('0x49')],null))[_0x81e5('0x26')](respondWithResult(_0x5d56d2,null))[_0x81e5('0x43')](handleError(_0x5d56d2,null));};exports[_0x81e5('0x4a')]=function(_0x2c406a,_0xb3259f){return db['FaxApplication'][_0x81e5('0x47')]({'where':{'id':_0x2c406a[_0x81e5('0x45')]['id']}})['then'](handleEntityNotFound(_0xb3259f,null))[_0x81e5('0x26')](removeEntity(_0xb3259f,null))[_0x81e5('0x43')](handleError(_0xb3259f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index bc72c01..ad0d321 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 _0x8776=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x13635d,_0x14d83e){var _0x3505b9=function(_0x514839){while(--_0x514839){_0x13635d['push'](_0x13635d['shift']());}};_0x3505b9(++_0x14d83e);}(_0x8776,0x1c3));var _0x6877=function(_0x54dce,_0xfc1248){_0x54dce=_0x54dce-0x0;var _0x52caff=_0x8776[_0x54dce];return _0x52caff;};'use strict';var _=require(_0x6877('0x0'));var util=require('util');var logger=require(_0x6877('0x1'))('api');var moment=require(_0x6877('0x2'));var BPromise=require(_0x6877('0x3'));var rp=require(_0x6877('0x4'));var fs=require('fs');var path=require(_0x6877('0x5'));var rimraf=require('rimraf');var config=require(_0x6877('0x6'));var attributes=require(_0x6877('0x7'));module[_0x6877('0x8')]=function(_0x277450,_0x214eda){return _0x277450[_0x6877('0x9')](_0x6877('0xa'),attributes,{'tableName':_0x6877('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6877('0xc'),'collate':_0x6877('0xd')});}; \ No newline at end of file +var _0x9c07=['../../config/logger','api','request-promise','path','rimraf','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x43cba5,_0x4a2f83){var _0x359d1a=function(_0x888a02){while(--_0x888a02){_0x43cba5['push'](_0x43cba5['shift']());}};_0x359d1a(++_0x4a2f83);}(_0x9c07,0x8f));var _0x79c0=function(_0x225502,_0x85c7ba){_0x225502=_0x225502-0x0;var _0x81077c=_0x9c07[_0x225502];return _0x81077c;};'use strict';var _=require('lodash');var util=require(_0x79c0('0x0'));var logger=require(_0x79c0('0x1'))(_0x79c0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79c0('0x3'));var fs=require('fs');var path=require(_0x79c0('0x4'));var rimraf=require(_0x79c0('0x5'));var config=require('../../config/environment');var attributes=require(_0x79c0('0x6'));module[_0x79c0('0x7')]=function(_0x48da9f,_0x14e074){return _0x48da9f[_0x79c0('0x8')]('FaxApplication',attributes,{'tableName':_0x79c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x79c0('0xa'),'collate':_0x79c0('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 183543c..cf57075 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 _0xcad5=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','body','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1245dc,_0x5f3c28){var _0x336587=function(_0x6d8262){while(--_0x6d8262){_0x1245dc['push'](_0x1245dc['shift']());}};_0x336587(++_0x5f3c28);}(_0xcad5,0x1ae));var _0x5cad=function(_0x39f234,_0x296a11){_0x39f234=_0x39f234-0x0;var _0x11f084=_0xcad5[_0x39f234];return _0x11f084;};'use strict';var _=require(_0x5cad('0x0'));var util=require(_0x5cad('0x1'));var moment=require(_0x5cad('0x2'));var BPromise=require(_0x5cad('0x3'));var rs=require(_0x5cad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cad('0x6'))(_0x5cad('0x7'));var config=require(_0x5cad('0x8'));var jayson=require(_0x5cad('0x9'));var client=jayson[_0x5cad('0xa')][_0x5cad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x138b24,_0x57bd87,_0x47ee27){return new BPromise(function(_0x3ec9b9,_0x1fceb9){return client[_0x5cad('0xc')](_0x138b24,_0x47ee27)[_0x5cad('0xd')](function(_0x25ae92){logger[_0x5cad('0xe')](_0x5cad('0xf'),_0x57bd87,_0x5cad('0x10'));logger[_0x5cad('0x11')](_0x5cad('0x12'),_0x57bd87,_0x5cad('0x10'),JSON[_0x5cad('0x13')](_0x25ae92));if(_0x25ae92[_0x5cad('0x14')]){if(_0x25ae92['error']['code']===0x1f4){logger[_0x5cad('0x14')](_0x5cad('0xf'),_0x57bd87,_0x25ae92[_0x5cad('0x14')][_0x5cad('0x15')]);return _0x1fceb9(_0x25ae92['error'][_0x5cad('0x15')]);}logger[_0x5cad('0x14')](_0x5cad('0xf'),_0x57bd87,_0x25ae92[_0x5cad('0x14')][_0x5cad('0x15')]);return _0x3ec9b9(_0x25ae92['error']['message']);}else{logger[_0x5cad('0xe')]('FaxApplication,\x20%s,\x20%s',_0x57bd87,_0x5cad('0x10'));_0x3ec9b9(_0x25ae92[_0x5cad('0x16')]['message']);}})[_0x5cad('0x17')](function(_0x3f56ad){logger[_0x5cad('0x14')](_0x5cad('0xf'),_0x57bd87,_0x3f56ad);_0x1fceb9(_0x3f56ad);});});}exports['UpdateFaxApplication']=function(_0x362b43){var _0x234c20=this;return new Promise(function(_0x222916,_0x1e9e31){return db['FaxApplication']['update'](_0x362b43[_0x5cad('0x18')],{'raw':_0x362b43[_0x5cad('0x19')]?_0x362b43[_0x5cad('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x362b43[_0x5cad('0x19')]?_0x362b43['options'][_0x5cad('0x1a')]||null:null,'attributes':_0x362b43['options']?_0x362b43[_0x5cad('0x19')][_0x5cad('0x1b')]||null:null,'limit':_0x362b43[_0x5cad('0x19')]?_0x362b43[_0x5cad('0x19')]['limit']||null:null})[_0x5cad('0xd')](function(_0x20ec51){logger['info']('UpdateFaxApplication',_0x362b43);logger[_0x5cad('0x11')]('UpdateFaxApplication',_0x362b43,JSON['stringify'](_0x20ec51));_0x222916(_0x20ec51);})[_0x5cad('0x17')](function(_0x1c0636){logger[_0x5cad('0x14')]('UpdateFaxApplication',_0x1c0636[_0x5cad('0x15')],_0x362b43);_0x1e9e31(_0x234c20[_0x5cad('0x14')](0x1f4,_0x1c0636[_0x5cad('0x15')]));});});}; \ No newline at end of file +var _0xcd97=['limit','stringify','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxApplication','FaxApplication','update','options','raw','attributes'];(function(_0x40f723,_0x217d61){var _0xaf895d=function(_0xbc8cc7){while(--_0xbc8cc7){_0x40f723['push'](_0x40f723['shift']());}};_0xaf895d(++_0x217d61);}(_0xcd97,0x189));var _0x7cd9=function(_0x402b1f,_0x3df329){_0x402b1f=_0x402b1f-0x0;var _0x5d22f2=_0xcd97[_0x402b1f];return _0x5d22f2;};'use strict';var _=require(_0x7cd9('0x0'));var util=require('util');var moment=require(_0x7cd9('0x1'));var BPromise=require('bluebird');var rs=require(_0x7cd9('0x2'));var fs=require('fs');var Redis=require(_0x7cd9('0x3'));var db=require(_0x7cd9('0x4'))['db'];var utils=require(_0x7cd9('0x5'));var logger=require(_0x7cd9('0x6'))(_0x7cd9('0x7'));var config=require(_0x7cd9('0x8'));var jayson=require(_0x7cd9('0x9'));var client=jayson[_0x7cd9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5cad,_0x4de560,_0x27032a){return new BPromise(function(_0x5d63ee,_0x594fdc){return client['request'](_0x1e5cad,_0x27032a)[_0x7cd9('0xb')](function(_0x5ecdcb){logger[_0x7cd9('0xc')](_0x7cd9('0xd'),_0x4de560,_0x7cd9('0xe'));logger[_0x7cd9('0xf')](_0x7cd9('0x10'),_0x4de560,_0x7cd9('0xe'),JSON['stringify'](_0x5ecdcb));if(_0x5ecdcb[_0x7cd9('0x11')]){if(_0x5ecdcb['error'][_0x7cd9('0x12')]===0x1f4){logger[_0x7cd9('0x11')](_0x7cd9('0xd'),_0x4de560,_0x5ecdcb[_0x7cd9('0x11')]['message']);return _0x594fdc(_0x5ecdcb[_0x7cd9('0x11')][_0x7cd9('0x13')]);}logger[_0x7cd9('0x11')]('FaxApplication,\x20%s,\x20%s',_0x4de560,_0x5ecdcb[_0x7cd9('0x11')][_0x7cd9('0x13')]);return _0x5d63ee(_0x5ecdcb[_0x7cd9('0x11')][_0x7cd9('0x13')]);}else{logger[_0x7cd9('0xc')](_0x7cd9('0xd'),_0x4de560,'request\x20sent');_0x5d63ee(_0x5ecdcb[_0x7cd9('0x14')]['message']);}})['catch'](function(_0x1a9ec2){logger['error'](_0x7cd9('0xd'),_0x4de560,_0x1a9ec2);_0x594fdc(_0x1a9ec2);});});}exports[_0x7cd9('0x15')]=function(_0x49a565){var _0x3396d2=this;return new Promise(function(_0x44bb7e,_0x33dcf8){return db[_0x7cd9('0x16')][_0x7cd9('0x17')](_0x49a565['body'],{'raw':_0x49a565[_0x7cd9('0x18')]?_0x49a565[_0x7cd9('0x18')][_0x7cd9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49a565[_0x7cd9('0x18')]?_0x49a565[_0x7cd9('0x18')]['where']||null:null,'attributes':_0x49a565[_0x7cd9('0x18')]?_0x49a565[_0x7cd9('0x18')][_0x7cd9('0x1a')]||null:null,'limit':_0x49a565[_0x7cd9('0x18')]?_0x49a565[_0x7cd9('0x18')][_0x7cd9('0x1b')]||null:null})[_0x7cd9('0xb')](function(_0x1e859d){logger['info']('UpdateFaxApplication',_0x49a565);logger['debug'](_0x7cd9('0x15'),_0x49a565,JSON[_0x7cd9('0x1c')](_0x1e859d));_0x44bb7e(_0x1e859d);})[_0x7cd9('0x1d')](function(_0x1d3ef0){logger['error'](_0x7cd9('0x15'),_0x1d3ef0[_0x7cd9('0x13')],_0x49a565);_0x33dcf8(_0x3396d2[_0x7cd9('0x11')](0x1f4,_0x1d3ef0[_0x7cd9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 89bed5a..a3521d1 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','/:id'];(function(_0x419b6a,_0x265b43){var _0x229232=function(_0x514a3e){while(--_0x514a3e){_0x419b6a['push'](_0x419b6a['shift']());}};_0x229232(++_0x265b43);}(_0x4fc2,0x111));var _0x24fc=function(_0x3dec80,_0x3b9e93){_0x3dec80=_0x3dec80-0x0;var _0x7b391f=_0x4fc2[_0x3dec80];return _0x7b391f;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x3052cd,_0x2e85e8){var _0x429434=function(_0x3c12e0){while(--_0x3c12e0){_0x3052cd['push'](_0x3052cd['shift']());}};_0x429434(++_0x2e85e8);}(_0x757a,0xde));var _0xa757=function(_0x454ab2,_0x4aad2f){_0x454ab2=_0x454ab2-0x0;var _0x25a1cd=_0x757a[_0x454ab2];return _0x25a1cd;};'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('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);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 54cbe4d..8190628 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 _0x2a07=['STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x3fa4c8,_0xe1617){var _0x16104c=function(_0x2d6ff2){while(--_0x2d6ff2){_0x3fa4c8['push'](_0x3fa4c8['shift']());}};_0x16104c(++_0xe1617);}(_0x2a07,0x74));var _0x72a0=function(_0x54514c,_0xf1c84a){_0x54514c=_0x54514c-0x0;var _0x5cd80e=_0x2a07[_0x54514c];return _0x5cd80e;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'closed':{'type':Sequelize[_0x72a0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x72a0('0x3')]},'disposition':{'type':Sequelize[_0x72a0('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x72a0('0x4')]},'note':{'type':Sequelize[_0x72a0('0x4')]},'read1stAt':{'type':Sequelize[_0x72a0('0x3')]},'fax':{'type':Sequelize[_0x72a0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x72a0('0x5')]('in',_0x72a0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x72a0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x72a0('0x5')]('in',_0x72a0('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x72a0('0x7')]}}; \ No newline at end of file +var _0x9582=['DATE','STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x4793ad,_0x19302d){var _0x438044=function(_0x393fa7){while(--_0x393fa7){_0x4793ad['push'](_0x4793ad['shift']());}};_0x438044(++_0x19302d);}(_0x9582,0x95));var _0x2958=function(_0xb45863,_0x5382c0){_0xb45863=_0xb45863-0x0;var _0xa62233=_0x9582[_0xb45863];return _0xa62233;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'closed':{'type':Sequelize[_0x2958('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2958('0x3')]},'disposition':{'type':Sequelize[_0x2958('0x4')]},'secondDisposition':{'type':Sequelize[_0x2958('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2958('0x4')]},'read1stAt':{'type':Sequelize[_0x2958('0x3')]},'fax':{'type':Sequelize[_0x2958('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2958('0x5')]('in',_0x2958('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2958('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2958('0x5')]('in',_0x2958('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x2958('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 088252a..87e9018 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 _0xaad9=['files','attachments','transcript-%d-%s.zip','push','Attachment','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','rimraf','zip-dir','util','path','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','map','FaxInteraction','rawAttributes','type','getOptions','findAll','fax','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','find','create','body','destroy','describe','addMessage','FaxMessage','ids','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','omit','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','root','tmp','join','server'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0xaad9,0x145));var _0x9aad=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xaad9[_0x40a045];return _0x1a687c;};'use strict';var rimraf=require(_0x9aad('0x0'));var zipdir=require(_0x9aad('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x9aad('0x2'));var path=require(_0x9aad('0x3'));var fs=require('fs');var _=require(_0x9aad('0x4'));var Redis=require(_0x9aad('0x5'));var interaction=require(_0x9aad('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x9aad('0x7'));var config=require(_0x9aad('0x8'));var db=require(_0x9aad('0x9'))['db'];config[_0x9aad('0xa')]=_[_0x9aad('0xb')](config[_0x9aad('0xa')],{'host':_0x9aad('0xc'),'port':0x18eb});var socket=require(_0x9aad('0xd'))(new Redis(config[_0x9aad('0xa')]));require(_0x9aad('0xe'))['register'](socket);function respondWithStatusCode(_0x27ea99,_0x12cc9e){_0x12cc9e=_0x12cc9e||0xcc;return function(_0x3475a7){if(_0x3475a7){return _0x27ea99[_0x9aad('0xf')](_0x12cc9e);}return _0x27ea99['status'](_0x12cc9e)[_0x9aad('0x10')]();};}function respondWithResult(_0x36eb86,_0x5b4785){_0x5b4785=_0x5b4785||0xc8;return function(_0x558eb4){if(_0x558eb4){return _0x36eb86[_0x9aad('0x11')](_0x5b4785)[_0x9aad('0x12')](_0x558eb4);}};}function respondWithFilteredResult(_0x5f3951,_0x8e9526){return function(_0x29e2c1){if(_0x29e2c1){var _0x3acc29=typeof _0x8e9526[_0x9aad('0x13')]===_0x9aad('0x14')&&typeof _0x8e9526[_0x9aad('0x15')]===_0x9aad('0x14');var _0xa4e2db=_0x29e2c1[_0x9aad('0x16')];var _0x148437=_0x3acc29?0x0:_0x8e9526[_0x9aad('0x13')];var _0x22f1c2=_0x3acc29?_0x29e2c1[_0x9aad('0x16')]:_0x8e9526[_0x9aad('0x13')]+_0x8e9526['limit'];var _0x2a9971;if(_0x22f1c2>=_0xa4e2db){_0x22f1c2=_0xa4e2db;_0x2a9971=0xc8;}else{_0x2a9971=0xce;}_0x5f3951[_0x9aad('0x11')](_0x2a9971);return _0x5f3951[_0x9aad('0x17')](_0x9aad('0x18'),_0x148437+'-'+_0x22f1c2+'/'+_0xa4e2db)[_0x9aad('0x12')](_0x29e2c1);}return null;};}function saveUpdates(_0x4db556){return function(_0x4827e0){if(_0x4827e0){return _0x4827e0[_0x9aad('0x19')](_0x4db556)[_0x9aad('0x1a')](function(_0x708737){return _0x708737;});}return null;};}function removeEntity(_0x4137a4){return function(_0x506676){if(_0x506676){return _0x506676['destroy']()[_0x9aad('0x1a')](function(){_0x4137a4[_0x9aad('0x11')](0xcc)[_0x9aad('0x10')]();});}};}function handleEntityNotFound(_0x34aa04){return function(_0x453e12){if(!_0x453e12){_0x34aa04[_0x9aad('0xf')](0x194);}return _0x453e12;};}function handleError(_0x279fa3,_0x1c566c){_0x1c566c=_0x1c566c||0x1f4;return function(_0x2c4e6a){logger[_0x9aad('0x1b')](_0x2c4e6a[_0x9aad('0x1c')]);if(_0x2c4e6a[_0x9aad('0x1d')]){delete _0x2c4e6a[_0x9aad('0x1d')];}_0x279fa3[_0x9aad('0x11')](_0x1c566c)[_0x9aad('0x1e')](_0x2c4e6a);};}exports['index']=function(_0x20159b,_0x4cf2e7){var _0x4ff0c1={};var _0x4f1772=_[_0x9aad('0x1f')](db[_0x9aad('0x20')][_0x9aad('0x21')],function(_0x27bc60){return{'name':_0x27bc60['fieldName'],'type':_0x27bc60[_0x9aad('0x22')]['key']};});_0x4ff0c1=qs[_0x9aad('0x23')](_0x4f1772,_0x20159b);return interaction[_0x9aad('0x24')](_0x9aad('0x25'),_0x20159b[_0x9aad('0x26')],_0x20159b[_0x9aad('0x27')],_0x4ff0c1,_0x4f1772)['then'](respondWithFilteredResult(_0x4cf2e7,_0x4ff0c1))[_0x9aad('0x28')](handleError(_0x4cf2e7,null));};exports[_0x9aad('0x29')]=function(_0x4c81cd,_0x8a9eae){var _0x7acd9e={'raw':![],'where':{'id':_0x4c81cd[_0x9aad('0x2a')]['id']}},_0x6c5c0a={};_0x6c5c0a[_0x9aad('0x2b')]=_['keys'](db[_0x9aad('0x20')][_0x9aad('0x21')]);_0x6c5c0a[_0x9aad('0x26')]=_[_0x9aad('0x2c')](_0x4c81cd['query']);_0x6c5c0a[_0x9aad('0x2d')]=_[_0x9aad('0x2e')](_0x6c5c0a[_0x9aad('0x2b')],_0x6c5c0a[_0x9aad('0x26')]);_0x7acd9e['attributes']=_[_0x9aad('0x2e')](_0x6c5c0a[_0x9aad('0x2b')],qs[_0x9aad('0x2f')](_0x4c81cd['query'][_0x9aad('0x2f')]));_0x7acd9e['attributes']=_0x7acd9e[_0x9aad('0x30')][_0x9aad('0x31')]?_0x7acd9e[_0x9aad('0x30')]:_0x6c5c0a[_0x9aad('0x2b')];if(_0x4c81cd[_0x9aad('0x26')][_0x9aad('0x32')]){_0x7acd9e[_0x9aad('0x33')]=[{'all':!![]}];}_0x7acd9e=_[_0x9aad('0x34')]({},_0x7acd9e,_0x4c81cd['options']);return db[_0x9aad('0x20')][_0x9aad('0x35')](_0x7acd9e)[_0x9aad('0x1a')](handleEntityNotFound(_0x8a9eae,null))[_0x9aad('0x1a')](respondWithResult(_0x8a9eae,null))['catch'](handleError(_0x8a9eae,null));};exports['create']=function(_0x4f15ca,_0x237093){return db[_0x9aad('0x20')][_0x9aad('0x36')](_0x4f15ca['body'],{})['then'](respondWithResult(_0x237093,0xc9))['catch'](handleError(_0x237093,null));};exports['update']=function(_0x474d7f,_0x33a642){if(_0x474d7f[_0x9aad('0x37')]['id']){delete _0x474d7f[_0x9aad('0x37')]['id'];}return db[_0x9aad('0x20')][_0x9aad('0x35')]({'where':{'id':_0x474d7f[_0x9aad('0x2a')]['id']}})[_0x9aad('0x1a')](handleEntityNotFound(_0x33a642,null))[_0x9aad('0x1a')](saveUpdates(_0x474d7f[_0x9aad('0x37')],null))[_0x9aad('0x1a')](respondWithResult(_0x33a642,null))[_0x9aad('0x28')](handleError(_0x33a642,null));};exports[_0x9aad('0x38')]=function(_0x4ffaca,_0x1594d0){return db[_0x9aad('0x20')][_0x9aad('0x35')]({'where':{'id':_0x4ffaca[_0x9aad('0x2a')]['id']}})[_0x9aad('0x1a')](handleEntityNotFound(_0x1594d0,null))[_0x9aad('0x1a')](removeEntity(_0x1594d0,null))['catch'](handleError(_0x1594d0,null));};exports[_0x9aad('0x39')]=function(_0x142173,_0x4a8407){return db[_0x9aad('0x20')][_0x9aad('0x39')]()['then'](respondWithResult(_0x4a8407,null))[_0x9aad('0x28')](handleError(_0x4a8407,null));};exports[_0x9aad('0x3a')]=function(_0x1e28c2,_0x3c8429){return db[_0x9aad('0x3b')][_0x9aad('0x35')]({'where':{'id':_0x1e28c2['params']['id']}})['then'](handleEntityNotFound(_0x3c8429,null))[_0x9aad('0x1a')](function(_0xf58261){if(_0xf58261){return _0xf58261['addMessage'](_0x1e28c2['body'][_0x9aad('0x3c')],_['omit'](_0x1e28c2[_0x9aad('0x37')],[_0x9aad('0x3c'),'id'])||{});}})[_0x9aad('0x1a')](respondWithResult(_0x3c8429,null))['catch'](handleError(_0x3c8429,null));};exports['getMessages']=function(_0x142215,_0x4b3d7d){var _0x3d26d7={'raw':![],'where':{}};var _0x45a999={};var _0x22be8a={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x142215[_0x9aad('0x2a')]['id']}})[_0x9aad('0x1a')](handleEntityNotFound(_0x4b3d7d,null))[_0x9aad('0x1a')](function(_0x4fe665){if(_0x4fe665){_0x45a999[_0x9aad('0x2b')]=_[_0x9aad('0x2c')](db[_0x9aad('0x3b')][_0x9aad('0x21')]);_0x45a999['query']=_[_0x9aad('0x2c')](_0x142215[_0x9aad('0x26')]);_0x45a999[_0x9aad('0x2d')]=_['intersection'](_0x45a999['model'],_0x45a999[_0x9aad('0x26')]);_0x3d26d7[_0x9aad('0x30')]=_['intersection'](_0x45a999['model'],qs[_0x9aad('0x2f')](_0x142215[_0x9aad('0x26')][_0x9aad('0x2f')]));_0x3d26d7[_0x9aad('0x30')]=_0x3d26d7[_0x9aad('0x30')][_0x9aad('0x31')]?_0x3d26d7[_0x9aad('0x30')]:_0x45a999['model'];if(!_0x142215[_0x9aad('0x26')][_0x9aad('0x3d')](_0x9aad('0x3e'))){_0x3d26d7[_0x9aad('0x15')]=qs[_0x9aad('0x15')](_0x142215[_0x9aad('0x26')][_0x9aad('0x15')]);_0x3d26d7[_0x9aad('0x13')]=qs[_0x9aad('0x13')](_0x142215[_0x9aad('0x26')]['offset']);}_0x3d26d7[_0x9aad('0x3f')]=qs[_0x9aad('0x40')](_0x142215[_0x9aad('0x26')][_0x9aad('0x40')]);_0x3d26d7[_0x9aad('0x41')]=qs[_0x9aad('0x2d')](_[_0x9aad('0x42')](_0x142215[_0x9aad('0x26')],_0x45a999[_0x9aad('0x2d')]));_0x3d26d7[_0x9aad('0x41')][_0x9aad('0x43')]=_0x4fe665['id'];if(_0x142215[_0x9aad('0x26')][_0x9aad('0x44')]){_0x3d26d7['where']=_[_0x9aad('0x34')](_0x3d26d7[_0x9aad('0x41')],{'$or':_[_0x9aad('0x1f')](_0x3d26d7[_0x9aad('0x30')],function(_0x39cbc7){var _0x50198a={};_0x50198a[_0x39cbc7]={'$like':'%'+_0x142215['query'][_0x9aad('0x44')]+'%'};return _0x50198a;})});}if(_0x142215[_0x9aad('0x26')][_0x9aad('0x45')]){var _0x400903=_0x142215[_0x9aad('0x26')][_0x9aad('0x45')][_0x9aad('0x46')](',');var _0x52ede9={};_0x52ede9[_0x400903[0x0]]={'$gte':moment(_0x400903[0x1])['format'](_0x9aad('0x47'))};_0x3d26d7[_0x9aad('0x41')]=_[_0x9aad('0x34')](_0x3d26d7[_0x9aad('0x41')],_0x52ede9);}_0x3d26d7=_[_0x9aad('0x34')]({},_0x3d26d7,_0x142215[_0x9aad('0x48')]);return db[_0x9aad('0x3b')][_0x9aad('0x16')]({'where':_0x3d26d7[_0x9aad('0x41')]})[_0x9aad('0x1a')](function(_0x3b564e){_0x22be8a[_0x9aad('0x16')]=_0x3b564e;if(_0x142215[_0x9aad('0x26')]['includeAll']){_0x3d26d7[_0x9aad('0x33')]=[{'all':!![]}];}return db[_0x9aad('0x3b')]['findAll'](_0x3d26d7);})[_0x9aad('0x1a')](function(_0x2f0b6f){_0x22be8a['rows']=_0x2f0b6f;return _0x22be8a;});}})['then'](respondWithFilteredResult(_0x4b3d7d,_0x3d26d7))[_0x9aad('0x28')](handleError(_0x4b3d7d,null));};exports[_0x9aad('0x49')]=function(_0x405197,_0x15f119){return db[_0x9aad('0x20')][_0x9aad('0x35')]({'where':{'id':_0x405197['params']['id']}})[_0x9aad('0x1a')](handleEntityNotFound(_0x15f119,null))[_0x9aad('0x1a')](function(_0x18beca){if(_0x18beca){return _0x18beca[_0x9aad('0x4a')](_0x405197['body']['ids'],_[_0x9aad('0x4b')](_0x405197['body'],[_0x9aad('0x3c'),'id'])||{})[_0x9aad('0x4c')](function(){return db[_0x9aad('0x4d')][_0x9aad('0x24')]({'attributes':['id',_0x9aad('0x1d'),'color'],'where':{'id':_0x405197[_0x9aad('0x37')][_0x9aad('0x3c')]}});})[_0x9aad('0x1a')](function(_0x3223db){socket[_0x9aad('0x4e')](_0x9aad('0x4f'),{'id':Number(_0x405197[_0x9aad('0x2a')]['id']),'tags':_0x3223db||[]});return{'id':Number(_0x405197[_0x9aad('0x2a')]['id']),'tags':_0x3223db||[]};});}})['then'](respondWithResult(_0x15f119,null))[_0x9aad('0x28')](handleError(_0x15f119,null));};exports[_0x9aad('0x50')]=function(_0x4070f4,_0x5771bb){return db[_0x9aad('0x20')][_0x9aad('0x35')]({'where':{'id':_0x4070f4[_0x9aad('0x2a')]['id']}})[_0x9aad('0x1a')](handleEntityNotFound(_0x5771bb,null))[_0x9aad('0x1a')](function(_0x3042a7){if(_0x3042a7){return _0x3042a7[_0x9aad('0x50')](_0x4070f4['query'][_0x9aad('0x3c')]);}})[_0x9aad('0x1a')](respondWithStatusCode(_0x5771bb,null))[_0x9aad('0x28')](handleError(_0x5771bb,null));};exports[_0x9aad('0x51')]=function(_0x303613,_0x392821){var _0x2cd4c7=moment()[_0x9aad('0x52')]()['toString']();var _0x1fe1ab=path['join'](config[_0x9aad('0x53')],'server','files',_0x9aad('0x54'));var _0x175736=path[_0x9aad('0x55')](config[_0x9aad('0x53')],_0x9aad('0x56'),_0x9aad('0x57'),_0x9aad('0x58'));var _0x5a2719=path[_0x9aad('0x55')](_0x1fe1ab,_0x2cd4c7);var _0xf0e76c=util['format'](_0x9aad('0x59'),_0x303613[_0x9aad('0x2a')]['id'],_0x2cd4c7);var _0x56a624=path['join'](_0x1fe1ab,_0xf0e76c);var _0x19bd36=[];_0x19bd36[_0x9aad('0x5a')]({'model':db[_0x9aad('0x5b')],'as':_0x9aad('0x5b'),'raw':!![]});var _0x18534e=[{'model':db[_0x9aad('0x3b')],'as':'Messages','attributes':['id',_0x9aad('0x37'),_0x9aad('0x5c')],'include':_0x19bd36}];return db['FaxInteraction'][_0x9aad('0x35')]({'where':{'id':_0x303613[_0x9aad('0x2a')]['id']},'include':_0x18534e})[_0x9aad('0x1a')](handleEntityNotFound(_0x392821,null))[_0x9aad('0x1a')](function(_0xc675e){if(_0xc675e&&_0xc675e['Messages']){var _0x230224=_0xc675e[_0x9aad('0x5d')]({'plain':!![]});fs[_0x9aad('0x5e')](_0x5a2719);for(var _0x2c4509=0x0;_0x2c4509<_0x230224['Messages'][_0x9aad('0x31')];_0x2c4509++){var _0x4e746c=_0x230224['Messages'][_0x2c4509][_0x9aad('0x5b')];if(_0x4e746c){var _0x550c07=path[_0x9aad('0x55')](_0x175736,_0x4e746c[_0x9aad('0x5f')]);if(fs[_0x9aad('0x60')](_0x550c07)){fs[_0x9aad('0x61')](_0x550c07)[_0x9aad('0x62')](fs[_0x9aad('0x63')](path[_0x9aad('0x55')](_0x5a2719,_0x4e746c[_0x9aad('0x5f')])));}}}return BPromise[_0x9aad('0x64')]()[_0x9aad('0x1a')](function(){return new BPromise(function(_0x3c0cd5,_0x3ddffe){zipdir(_0x5a2719,{'saveTo':_0x56a624},function(_0x5e3a4f,_0x5f2561){if(_0x5e3a4f)return _0x3ddffe(_0x5e3a4f);return _0x3c0cd5(_0x5f2561);});})[_0x9aad('0x1a')](function(){return new BPromise(function(_0x329ef9,_0x29fce3){rimraf(_0x5a2719,function(_0x11b5c0){if(_0x11b5c0)_0x29fce3(_0x11b5c0);return _0x329ef9();});});})[_0x9aad('0x1a')](function(){return _0x392821[_0x9aad('0x51')](_0x56a624,_0xf0e76c,function(_0x1e1e82){if(_0x1e1e82){console[_0x9aad('0x65')](_0x9aad('0x66'),_0x1e1e82);}else{fs['unlinkSync'](_0x56a624);}});});});}else{return _0x392821['sendStatus'](0xc8);}})[_0x9aad('0x28')](handleError(_0x392821,null));}; \ No newline at end of file +var _0xbd68=['findAll','fax','user','catch','show','params','keys','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','nolimit','order','sort','where','filters','pick','filter','$gte','split','format','rows','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','pipe','createWriteStream','resolve','err','unlinkSync','rimraf','zip-dir','path','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','sendStatus','error','name','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xbd68,0x104));var _0x8bd6=function(_0x37e60b,_0x5c751c){_0x37e60b=_0x37e60b-0x0;var _0x310135=_0xbd68[_0x37e60b];return _0x310135;};'use strict';var rimraf=require(_0x8bd6('0x0'));var zipdir=require(_0x8bd6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x8bd6('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x8bd6('0x3'));var qs=require(_0x8bd6('0x4'));var logger=require(_0x8bd6('0x5'))(_0x8bd6('0x6'));var config=require(_0x8bd6('0x7'));var db=require(_0x8bd6('0x8'))['db'];config[_0x8bd6('0x9')]=_['defaults'](config[_0x8bd6('0x9')],{'host':_0x8bd6('0xa'),'port':0x18eb});var socket=require(_0x8bd6('0xb'))(new Redis(config[_0x8bd6('0x9')]));require(_0x8bd6('0xc'))[_0x8bd6('0xd')](socket);function respondWithStatusCode(_0x44dc19,_0x114b90){_0x114b90=_0x114b90||0xcc;return function(_0x565e2b){if(_0x565e2b){return _0x44dc19['sendStatus'](_0x114b90);}return _0x44dc19['status'](_0x114b90)[_0x8bd6('0xe')]();};}function respondWithResult(_0x10cb5e,_0x2aa9f4){_0x2aa9f4=_0x2aa9f4||0xc8;return function(_0x322975){if(_0x322975){return _0x10cb5e[_0x8bd6('0xf')](_0x2aa9f4)[_0x8bd6('0x10')](_0x322975);}};}function respondWithFilteredResult(_0x2d9c40,_0x24e4c5){return function(_0x266d73){if(_0x266d73){var _0x532260=typeof _0x24e4c5[_0x8bd6('0x11')]===_0x8bd6('0x12')&&typeof _0x24e4c5[_0x8bd6('0x13')]==='undefined';var _0x380500=_0x266d73[_0x8bd6('0x14')];var _0x39005e=_0x532260?0x0:_0x24e4c5[_0x8bd6('0x11')];var _0x55e899=_0x532260?_0x266d73[_0x8bd6('0x14')]:_0x24e4c5[_0x8bd6('0x11')]+_0x24e4c5[_0x8bd6('0x13')];var _0x6758a9;if(_0x55e899>=_0x380500){_0x55e899=_0x380500;_0x6758a9=0xc8;}else{_0x6758a9=0xce;}_0x2d9c40[_0x8bd6('0xf')](_0x6758a9);return _0x2d9c40[_0x8bd6('0x15')](_0x8bd6('0x16'),_0x39005e+'-'+_0x55e899+'/'+_0x380500)[_0x8bd6('0x10')](_0x266d73);}return null;};}function saveUpdates(_0x16b0af){return function(_0x386ba9){if(_0x386ba9){return _0x386ba9[_0x8bd6('0x17')](_0x16b0af)['then'](function(_0x5ea13f){return _0x5ea13f;});}return null;};}function removeEntity(_0x53768f){return function(_0x3d80fd){if(_0x3d80fd){return _0x3d80fd[_0x8bd6('0x18')]()[_0x8bd6('0x19')](function(){_0x53768f[_0x8bd6('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x193fd5){return function(_0x504d9a){if(!_0x504d9a){_0x193fd5[_0x8bd6('0x1a')](0x194);}return _0x504d9a;};}function handleError(_0x3161ad,_0x535456){_0x535456=_0x535456||0x1f4;return function(_0x2624fa){logger[_0x8bd6('0x1b')](_0x2624fa['stack']);if(_0x2624fa[_0x8bd6('0x1c')]){delete _0x2624fa['name'];}_0x3161ad[_0x8bd6('0xf')](_0x535456)['send'](_0x2624fa);};}exports[_0x8bd6('0x1d')]=function(_0x26f006,_0x5c642a){var _0x48a6ae={};var _0x2200c3=_[_0x8bd6('0x1e')](db[_0x8bd6('0x1f')][_0x8bd6('0x20')],function(_0x23b0f1){return{'name':_0x23b0f1[_0x8bd6('0x21')],'type':_0x23b0f1[_0x8bd6('0x22')][_0x8bd6('0x23')]};});_0x48a6ae=qs[_0x8bd6('0x24')](_0x2200c3,_0x26f006);return interaction[_0x8bd6('0x25')](_0x8bd6('0x26'),_0x26f006['query'],_0x26f006[_0x8bd6('0x27')],_0x48a6ae,_0x2200c3)[_0x8bd6('0x19')](respondWithFilteredResult(_0x5c642a,_0x48a6ae))[_0x8bd6('0x28')](handleError(_0x5c642a,null));};exports[_0x8bd6('0x29')]=function(_0x5142d7,_0x25c068){var _0x5c4c01={'raw':![],'where':{'id':_0x5142d7[_0x8bd6('0x2a')]['id']}},_0x176c0b={};_0x176c0b['model']=_[_0x8bd6('0x2b')](db[_0x8bd6('0x1f')]['rawAttributes']);_0x176c0b[_0x8bd6('0x2c')]=_[_0x8bd6('0x2b')](_0x5142d7[_0x8bd6('0x2c')]);_0x176c0b['filters']=_[_0x8bd6('0x2d')](_0x176c0b[_0x8bd6('0x2e')],_0x176c0b[_0x8bd6('0x2c')]);_0x5c4c01[_0x8bd6('0x2f')]=_[_0x8bd6('0x2d')](_0x176c0b[_0x8bd6('0x2e')],qs[_0x8bd6('0x30')](_0x5142d7['query'][_0x8bd6('0x30')]));_0x5c4c01[_0x8bd6('0x2f')]=_0x5c4c01[_0x8bd6('0x2f')][_0x8bd6('0x31')]?_0x5c4c01['attributes']:_0x176c0b[_0x8bd6('0x2e')];if(_0x5142d7[_0x8bd6('0x2c')][_0x8bd6('0x32')]){_0x5c4c01[_0x8bd6('0x33')]=[{'all':!![]}];}_0x5c4c01=_[_0x8bd6('0x34')]({},_0x5c4c01,_0x5142d7[_0x8bd6('0x35')]);return db[_0x8bd6('0x1f')][_0x8bd6('0x36')](_0x5c4c01)[_0x8bd6('0x19')](handleEntityNotFound(_0x25c068,null))[_0x8bd6('0x19')](respondWithResult(_0x25c068,null))[_0x8bd6('0x28')](handleError(_0x25c068,null));};exports[_0x8bd6('0x37')]=function(_0x15eb57,_0x39e2ce){return db[_0x8bd6('0x1f')]['create'](_0x15eb57['body'],{})['then'](respondWithResult(_0x39e2ce,0xc9))[_0x8bd6('0x28')](handleError(_0x39e2ce,null));};exports[_0x8bd6('0x17')]=function(_0x59cc8b,_0x115ed1){if(_0x59cc8b[_0x8bd6('0x38')]['id']){delete _0x59cc8b[_0x8bd6('0x38')]['id'];}return db['FaxInteraction'][_0x8bd6('0x36')]({'where':{'id':_0x59cc8b[_0x8bd6('0x2a')]['id']}})[_0x8bd6('0x19')](handleEntityNotFound(_0x115ed1,null))[_0x8bd6('0x19')](saveUpdates(_0x59cc8b[_0x8bd6('0x38')],null))[_0x8bd6('0x19')](respondWithResult(_0x115ed1,null))['catch'](handleError(_0x115ed1,null));};exports['destroy']=function(_0x46c34f,_0x4d7cc9){return db[_0x8bd6('0x1f')][_0x8bd6('0x36')]({'where':{'id':_0x46c34f[_0x8bd6('0x2a')]['id']}})[_0x8bd6('0x19')](handleEntityNotFound(_0x4d7cc9,null))[_0x8bd6('0x19')](removeEntity(_0x4d7cc9,null))['catch'](handleError(_0x4d7cc9,null));};exports[_0x8bd6('0x39')]=function(_0xbfd370,_0x35a1d7){return db[_0x8bd6('0x1f')][_0x8bd6('0x39')]()[_0x8bd6('0x19')](respondWithResult(_0x35a1d7,null))['catch'](handleError(_0x35a1d7,null));};exports[_0x8bd6('0x3a')]=function(_0x5ce4c3,_0x294ced){return db[_0x8bd6('0x3b')][_0x8bd6('0x36')]({'where':{'id':_0x5ce4c3[_0x8bd6('0x2a')]['id']}})[_0x8bd6('0x19')](handleEntityNotFound(_0x294ced,null))[_0x8bd6('0x19')](function(_0x4785f0){if(_0x4785f0){return _0x4785f0[_0x8bd6('0x3a')](_0x5ce4c3[_0x8bd6('0x38')][_0x8bd6('0x3c')],_[_0x8bd6('0x3d')](_0x5ce4c3[_0x8bd6('0x38')],[_0x8bd6('0x3c'),'id'])||{});}})[_0x8bd6('0x19')](respondWithResult(_0x294ced,null))['catch'](handleError(_0x294ced,null));};exports[_0x8bd6('0x3e')]=function(_0x40bcd4,_0x5a4ede){var _0x36a1d6={'raw':![],'where':{}};var _0x1a2dbd={};var _0x365d01={'count':0x0,'rows':[]};return db[_0x8bd6('0x1f')]['findOne']({'where':{'id':_0x40bcd4[_0x8bd6('0x2a')]['id']}})[_0x8bd6('0x19')](handleEntityNotFound(_0x5a4ede,null))[_0x8bd6('0x19')](function(_0x3d50b3){if(_0x3d50b3){_0x1a2dbd[_0x8bd6('0x2e')]=_['keys'](db[_0x8bd6('0x3b')][_0x8bd6('0x20')]);_0x1a2dbd[_0x8bd6('0x2c')]=_[_0x8bd6('0x2b')](_0x40bcd4[_0x8bd6('0x2c')]);_0x1a2dbd['filters']=_['intersection'](_0x1a2dbd[_0x8bd6('0x2e')],_0x1a2dbd[_0x8bd6('0x2c')]);_0x36a1d6['attributes']=_['intersection'](_0x1a2dbd[_0x8bd6('0x2e')],qs[_0x8bd6('0x30')](_0x40bcd4[_0x8bd6('0x2c')][_0x8bd6('0x30')]));_0x36a1d6['attributes']=_0x36a1d6['attributes'][_0x8bd6('0x31')]?_0x36a1d6[_0x8bd6('0x2f')]:_0x1a2dbd[_0x8bd6('0x2e')];if(!_0x40bcd4[_0x8bd6('0x2c')]['hasOwnProperty'](_0x8bd6('0x3f'))){_0x36a1d6[_0x8bd6('0x13')]=qs[_0x8bd6('0x13')](_0x40bcd4[_0x8bd6('0x2c')][_0x8bd6('0x13')]);_0x36a1d6['offset']=qs['offset'](_0x40bcd4[_0x8bd6('0x2c')]['offset']);}_0x36a1d6[_0x8bd6('0x40')]=qs['sort'](_0x40bcd4[_0x8bd6('0x2c')][_0x8bd6('0x41')]);_0x36a1d6[_0x8bd6('0x42')]=qs[_0x8bd6('0x43')](_[_0x8bd6('0x44')](_0x40bcd4[_0x8bd6('0x2c')],_0x1a2dbd['filters']));_0x36a1d6[_0x8bd6('0x42')]['FaxInteractionId']=_0x3d50b3['id'];if(_0x40bcd4[_0x8bd6('0x2c')][_0x8bd6('0x45')]){_0x36a1d6[_0x8bd6('0x42')]=_['merge'](_0x36a1d6[_0x8bd6('0x42')],{'$or':_['map'](_0x36a1d6[_0x8bd6('0x2f')],function(_0x5e0eb0){var _0x506bc5={};_0x506bc5[_0x5e0eb0]={'$like':'%'+_0x40bcd4[_0x8bd6('0x2c')][_0x8bd6('0x45')]+'%'};return _0x506bc5;})});}if(_0x40bcd4[_0x8bd6('0x2c')]['$gte']){var _0x2d2d6d=_0x40bcd4[_0x8bd6('0x2c')][_0x8bd6('0x46')][_0x8bd6('0x47')](',');var _0x27edd2={};_0x27edd2[_0x2d2d6d[0x0]]={'$gte':moment(_0x2d2d6d[0x1])[_0x8bd6('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x36a1d6[_0x8bd6('0x42')]=_[_0x8bd6('0x34')](_0x36a1d6[_0x8bd6('0x42')],_0x27edd2);}_0x36a1d6=_['merge']({},_0x36a1d6,_0x40bcd4[_0x8bd6('0x35')]);return db[_0x8bd6('0x3b')][_0x8bd6('0x14')]({'where':_0x36a1d6[_0x8bd6('0x42')]})[_0x8bd6('0x19')](function(_0x3889ad){_0x365d01[_0x8bd6('0x14')]=_0x3889ad;if(_0x40bcd4['query'][_0x8bd6('0x32')]){_0x36a1d6[_0x8bd6('0x33')]=[{'all':!![]}];}return db[_0x8bd6('0x3b')][_0x8bd6('0x25')](_0x36a1d6);})[_0x8bd6('0x19')](function(_0x15531d){_0x365d01[_0x8bd6('0x49')]=_0x15531d;return _0x365d01;});}})['then'](respondWithFilteredResult(_0x5a4ede,_0x36a1d6))[_0x8bd6('0x28')](handleError(_0x5a4ede,null));};exports[_0x8bd6('0x4a')]=function(_0x5c6968,_0x4611ec){return db[_0x8bd6('0x1f')][_0x8bd6('0x36')]({'where':{'id':_0x5c6968[_0x8bd6('0x2a')]['id']}})[_0x8bd6('0x19')](handleEntityNotFound(_0x4611ec,null))[_0x8bd6('0x19')](function(_0xc61f6d){if(_0xc61f6d){return _0xc61f6d[_0x8bd6('0x4b')](_0x5c6968[_0x8bd6('0x38')][_0x8bd6('0x3c')],_[_0x8bd6('0x3d')](_0x5c6968[_0x8bd6('0x38')],[_0x8bd6('0x3c'),'id'])||{})[_0x8bd6('0x4c')](function(){return db['Tag'][_0x8bd6('0x25')]({'attributes':['id',_0x8bd6('0x1c'),'color'],'where':{'id':_0x5c6968[_0x8bd6('0x38')][_0x8bd6('0x3c')]}});})['then'](function(_0x172d8e){socket[_0x8bd6('0x4d')](_0x8bd6('0x4e'),{'id':Number(_0x5c6968[_0x8bd6('0x2a')]['id']),'tags':_0x172d8e||[]});return{'id':Number(_0x5c6968[_0x8bd6('0x2a')]['id']),'tags':_0x172d8e||[]};});}})[_0x8bd6('0x19')](respondWithResult(_0x4611ec,null))[_0x8bd6('0x28')](handleError(_0x4611ec,null));};exports[_0x8bd6('0x4f')]=function(_0x11dafc,_0x17342d){return db[_0x8bd6('0x1f')][_0x8bd6('0x36')]({'where':{'id':_0x11dafc['params']['id']}})[_0x8bd6('0x19')](handleEntityNotFound(_0x17342d,null))[_0x8bd6('0x19')](function(_0x4ad82f){if(_0x4ad82f){return _0x4ad82f[_0x8bd6('0x4f')](_0x11dafc[_0x8bd6('0x2c')]['ids']);}})[_0x8bd6('0x19')](respondWithStatusCode(_0x17342d,null))['catch'](handleError(_0x17342d,null));};exports[_0x8bd6('0x50')]=function(_0x480bea,_0x214560){var _0x427dcb=moment()['unix']()['toString']();var _0x2bc0f1=path[_0x8bd6('0x51')](config[_0x8bd6('0x52')],_0x8bd6('0x53'),_0x8bd6('0x54'),'tmp');var _0x54c4f2=path[_0x8bd6('0x51')](config[_0x8bd6('0x52')],_0x8bd6('0x53'),_0x8bd6('0x54'),_0x8bd6('0x55'));var _0x1769b6=path[_0x8bd6('0x51')](_0x2bc0f1,_0x427dcb);var _0x83db4e=util[_0x8bd6('0x48')](_0x8bd6('0x56'),_0x480bea[_0x8bd6('0x2a')]['id'],_0x427dcb);var _0x3cb55e=path[_0x8bd6('0x51')](_0x2bc0f1,_0x83db4e);var _0x4496e8=[];_0x4496e8['push']({'model':db[_0x8bd6('0x57')],'as':_0x8bd6('0x57'),'raw':!![]});var _0x1c4860=[{'model':db[_0x8bd6('0x3b')],'as':_0x8bd6('0x58'),'attributes':['id','body',_0x8bd6('0x59')],'include':_0x4496e8}];return db[_0x8bd6('0x1f')][_0x8bd6('0x36')]({'where':{'id':_0x480bea[_0x8bd6('0x2a')]['id']},'include':_0x1c4860})[_0x8bd6('0x19')](handleEntityNotFound(_0x214560,null))[_0x8bd6('0x19')](function(_0x1263f6){if(_0x1263f6&&_0x1263f6[_0x8bd6('0x58')]){var _0x3fbbbe=_0x1263f6[_0x8bd6('0x5a')]({'plain':!![]});fs[_0x8bd6('0x5b')](_0x1769b6);for(var _0x536a8b=0x0;_0x536a8b<_0x3fbbbe[_0x8bd6('0x58')][_0x8bd6('0x31')];_0x536a8b++){var _0xaa56b8=_0x3fbbbe[_0x8bd6('0x58')][_0x536a8b]['Attachment'];if(_0xaa56b8){var _0x3bae06=path['join'](_0x54c4f2,_0xaa56b8[_0x8bd6('0x5c')]);if(fs[_0x8bd6('0x5d')](_0x3bae06)){fs['createReadStream'](_0x3bae06)[_0x8bd6('0x5e')](fs[_0x8bd6('0x5f')](path[_0x8bd6('0x51')](_0x1769b6,_0xaa56b8[_0x8bd6('0x5c')])));}}}return BPromise[_0x8bd6('0x60')]()[_0x8bd6('0x19')](function(){return new BPromise(function(_0x4111ea,_0x343103){zipdir(_0x1769b6,{'saveTo':_0x3cb55e},function(_0x48eb18,_0x276bd1){if(_0x48eb18)return _0x343103(_0x48eb18);return _0x4111ea(_0x276bd1);});})[_0x8bd6('0x19')](function(){return new BPromise(function(_0x798756,_0x559ca3){rimraf(_0x1769b6,function(_0x365d3d){if(_0x365d3d)_0x559ca3(_0x365d3d);return _0x798756();});});})[_0x8bd6('0x19')](function(){return _0x214560['download'](_0x3cb55e,_0x83db4e,function(_0x1f7746){if(_0x1f7746){console['log'](_0x8bd6('0x61'),_0x1f7746);}else{fs[_0x8bd6('0x62')](_0x3cb55e);}});});});}else{return _0x214560[_0x8bd6('0x1a')](0xc8);}})[_0x8bd6('0x28')](handleError(_0x214560,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index ddcd253..6086023 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 _0x16ad=['FaxInteraction','../../mysqldb','setMaxListeners','save','remove','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x17b7d,_0x4e9bdc){var _0x1fc22d=function(_0x997157){while(--_0x997157){_0x17b7d['push'](_0x17b7d['shift']());}};_0x1fc22d(++_0x4e9bdc);}(_0x16ad,0xe0));var _0xd16a=function(_0x49c3b1,_0x15b955){_0x49c3b1=_0x49c3b1-0x0;var _0x5e2760=_0x16ad[_0x49c3b1];return _0x5e2760;};'use strict';var EventEmitter=require(_0xd16a('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xd16a('0x1')];var FaxMessage=require(_0xd16a('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd16a('0x3')](0x0);var events={'afterCreate':_0xd16a('0x4'),'afterUpdate':'update','afterDestroy':_0xd16a('0x5')};function emitEvent(_0x57fc7e){return function(_0x4d4a81,_0x2e89a8,_0x5bb3ee){_0x4d4a81['getUsers']({'attributes':['id'],'raw':!![]})[_0xd16a('0x6')](function(_0x482d8f){_0x4d4a81[_0xd16a('0x7')]('Users',_0x482d8f[_0xd16a('0x8')](function(_0x5da0a8){return{'id':_0x5da0a8['id']};}));return FaxMessage[_0xd16a('0x9')]({'where':{'FaxInteractionId':_0x4d4a81['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd16a('0x6')](function(_0xdafd27){_0x4d4a81['setDataValue']('unreadMessages',_0xdafd27[_0xd16a('0xa')]);FaxInteractionEvents[_0xd16a('0xb')](_0x57fc7e+':'+_0x4d4a81['id'],_0x4d4a81);FaxInteractionEvents['emit'](_0x57fc7e,_0x4d4a81);_0x5bb3ee(null);})[_0xd16a('0xc')](_0x5bb3ee(null));};}for(var e in events){if(events[_0xd16a('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xd16a('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0xe172=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','save','update','remove','getUsers','then'];(function(_0x34ca5a,_0x2f14b1){var _0x38c2be=function(_0x239f61){while(--_0x239f61){_0x34ca5a['push'](_0x34ca5a['shift']());}};_0x38c2be(++_0x2f14b1);}(_0xe172,0x1cc));var _0x2e17=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xe172[_0x36ed3c];return _0x52a2e0;};'use strict';var EventEmitter=require(_0x2e17('0x0'));var FaxInteraction=require(_0x2e17('0x1'))['db'][_0x2e17('0x2')];var FaxMessage=require(_0x2e17('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e17('0x3'),'afterUpdate':_0x2e17('0x4'),'afterDestroy':_0x2e17('0x5')};function emitEvent(_0x3cd0a3){return function(_0x39a65a,_0x4c74f6,_0x23b560){_0x39a65a[_0x2e17('0x6')]({'attributes':['id'],'raw':!![]})[_0x2e17('0x7')](function(_0x37dfd4){_0x39a65a[_0x2e17('0x8')](_0x2e17('0x9'),_0x37dfd4[_0x2e17('0xa')](function(_0xd86f6e){return{'id':_0xd86f6e['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x39a65a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e17('0x7')](function(_0x13edc9){_0x39a65a['setDataValue'](_0x2e17('0xb'),_0x13edc9[_0x2e17('0xc')]);FaxInteractionEvents[_0x2e17('0xd')](_0x3cd0a3+':'+_0x39a65a['id'],_0x39a65a);FaxInteractionEvents[_0x2e17('0xd')](_0x3cd0a3,_0x39a65a);_0x23b560(null);})[_0x2e17('0xe')](_0x23b560(null));};}for(var e in events){if(events[_0x2e17('0xf')](e)){var event=events[e];FaxInteraction[_0x2e17('0x10')](e,emitEvent(event));}}module[_0x2e17('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 544f450..885335a 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 _0x4fa8=['./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','lodash','util','bluebird','path','rimraf','../../config/environment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4fa8,0x13c));var _0x84fa=function(_0xb66e35,_0x525bf8){_0xb66e35=_0xb66e35-0x0;var _0x22f0cc=_0x4fa8[_0xb66e35];return _0x22f0cc;};'use strict';var _=require(_0x84fa('0x0'));var util=require(_0x84fa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x84fa('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84fa('0x3'));var rimraf=require(_0x84fa('0x4'));var config=require(_0x84fa('0x5'));var attributes=require(_0x84fa('0x6'));module[_0x84fa('0x7')]=function(_0xa7504d,_0x30e37c){return _0xa7504d[_0x84fa('0x8')]('FaxInteraction',attributes,{'tableName':_0x84fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d6863,_0x105d26,_0x31cfdb){if(_0x4d6863[_0x84fa('0xa')](_0x84fa('0xb'))){_0x4d6863[_0x84fa('0xc')]=moment()[_0x84fa('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31cfdb(null,_0x4d6863);}}});}; \ No newline at end of file +var _0x9689=['format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','fax_interactions','changed','closed','closedAt'];(function(_0x47e157,_0x8c73d0){var _0x25fc43=function(_0x556b3b){while(--_0x556b3b){_0x47e157['push'](_0x47e157['shift']());}};_0x25fc43(++_0x8c73d0);}(_0x9689,0xd4));var _0x9968=function(_0x887bde,_0x47df22){_0x887bde=_0x887bde-0x0;var _0x4f106a=_0x9689[_0x887bde];return _0x4f106a;};'use strict';var _=require('lodash');var util=require(_0x9968('0x0'));var logger=require('../../config/logger')(_0x9968('0x1'));var moment=require(_0x9968('0x2'));var BPromise=require(_0x9968('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9968('0x4'));var rimraf=require(_0x9968('0x5'));var config=require(_0x9968('0x6'));var attributes=require(_0x9968('0x7'));module['exports']=function(_0x1ba3af,_0xdf7da1){return _0x1ba3af['define']('FaxInteraction',attributes,{'tableName':_0x9968('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c02f1,_0x2e1b9a,_0x24393c){if(_0x1c02f1[_0x9968('0x9')](_0x9968('0xa'))){_0x1c02f1[_0x9968('0xb')]=moment()[_0x9968('0xc')](_0x9968('0xd'));}_0x24393c(null,_0x1c02f1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 59ed5f0..279d54a 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 _0xc91a=['client','http','redis','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateFaxInteraction','FaxInteraction','body','raw','options','where','attributes','limit','info','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x184b5a,_0x361b38){var _0x46f122=function(_0x3aee57){while(--_0x3aee57){_0x184b5a['push'](_0x184b5a['shift']());}};_0x46f122(++_0x361b38);}(_0xc91a,0xee));var _0xac91=function(_0x14c81e,_0x298ab0){_0x14c81e=_0x14c81e-0x0;var _0x43a01a=_0xc91a[_0x14c81e];return _0x43a01a;};'use strict';var _=require('lodash');var util=require(_0xac91('0x0'));var moment=require(_0xac91('0x1'));var BPromise=require(_0xac91('0x2'));var rs=require(_0xac91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac91('0x4'))(_0xac91('0x5'));var config=require(_0xac91('0x6'));var jayson=require(_0xac91('0x7'));var client=jayson[_0xac91('0x8')][_0xac91('0x9')]({'port':0x232a});config[_0xac91('0xa')]=_['defaults'](config[_0xac91('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xac91('0xb'))(new Redis(config[_0xac91('0xa')]));require(_0xac91('0xc'))[_0xac91('0xd')](socket);function respondWithRpcPromise(_0x2f6392,_0x420c98,_0x18add5){return new BPromise(function(_0x49665b,_0x29de37){return client[_0xac91('0xe')](_0x2f6392,_0x18add5)[_0xac91('0xf')](function(_0x5b545d){logger['info'](_0xac91('0x10'),_0x420c98,'request\x20sent');logger[_0xac91('0x11')](_0xac91('0x12'),_0x420c98,_0xac91('0x13'),JSON[_0xac91('0x14')](_0x5b545d));if(_0x5b545d[_0xac91('0x15')]){if(_0x5b545d[_0xac91('0x15')][_0xac91('0x16')]===0x1f4){logger[_0xac91('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x420c98,_0x5b545d[_0xac91('0x15')][_0xac91('0x17')]);return _0x29de37(_0x5b545d['error'][_0xac91('0x17')]);}logger[_0xac91('0x15')](_0xac91('0x10'),_0x420c98,_0x5b545d[_0xac91('0x15')][_0xac91('0x17')]);return _0x49665b(_0x5b545d['error'][_0xac91('0x17')]);}else{logger['info'](_0xac91('0x10'),_0x420c98,'request\x20sent');_0x49665b(_0x5b545d['result'][_0xac91('0x17')]);}})['catch'](function(_0xb509ac){logger[_0xac91('0x15')](_0xac91('0x10'),_0x420c98,_0xb509ac);_0x29de37(_0xb509ac);});});}exports[_0xac91('0x18')]=function(_0x2f703c){var _0x5da149=this;return new Promise(function(_0x21dd3a,_0x41955c){return db[_0xac91('0x19')]['update'](_0x2f703c[_0xac91('0x1a')],{'raw':_0x2f703c['options']?_0x2f703c['options'][_0xac91('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f703c[_0xac91('0x1c')]?_0x2f703c[_0xac91('0x1c')][_0xac91('0x1d')]||null:null,'attributes':_0x2f703c[_0xac91('0x1c')]?_0x2f703c['options'][_0xac91('0x1e')]||null:null,'limit':_0x2f703c[_0xac91('0x1c')]?_0x2f703c[_0xac91('0x1c')][_0xac91('0x1f')]||null:null})[_0xac91('0xf')](function(_0x23e340){logger[_0xac91('0x20')](_0xac91('0x18'),_0x2f703c);logger[_0xac91('0x11')]('UpdateFaxInteraction',_0x2f703c,JSON['stringify'](_0x23e340));_0x21dd3a(_0x23e340);})[_0xac91('0x21')](function(_0x5c9352){logger[_0xac91('0x15')](_0xac91('0x18'),_0x5c9352[_0xac91('0x17')],_0x2f703c);_0x41955c(_0x5da149['error'](0x1f4,_0x5c9352[_0xac91('0x17')]));});});};exports[_0xac91('0x22')]=function(_0x52e727){return new Promise(function(_0x2ef744,_0x306f82){return db['FaxInteraction'][_0xac91('0x23')]({'where':_0x52e727[_0xac91('0x1c')]?_0x52e727[_0xac91('0x1c')][_0xac91('0x1d')]||null:null})[_0xac91('0xf')](function(_0x58bfc6){if(_0x58bfc6){return _0x58bfc6[_0xac91('0x24')](_0x52e727['body'][_0xac91('0x25')],_[_0xac91('0x26')](_0x52e727[_0xac91('0x1a')],['ids','id'])||{});}})[_0xac91('0x27')](function(_0x244275){logger['info'](_0xac91('0x28'),_0x52e727);logger[_0xac91('0x11')](_0xac91('0x28'),_0x52e727,JSON[_0xac91('0x14')](_0x244275));_0x2ef744(_0x244275);})['catch'](function(_0xf0c97f){logger[_0xac91('0x15')](_0xac91('0x28'),_0xf0c97f[_0xac91('0x17')],_0x52e727);_0x306f82(_this[_0xac91('0x15')](0x1f4,_0xf0c97f[_0xac91('0x17')]));});});}; \ No newline at end of file +var _0x3ff8=['attributes','limit','UpdateFaxInteraction','stringify','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','FaxInteraction','update','body','options','where'];(function(_0xca3365,_0x358724){var _0x3afe0=function(_0x2370e6){while(--_0x2370e6){_0xca3365['push'](_0xca3365['shift']());}};_0x3afe0(++_0x358724);}(_0x3ff8,0x15a));var _0x83ff=function(_0x15a569,_0x4ad6a1){_0x15a569=_0x15a569-0x0;var _0x536d3b=_0x3ff8[_0x15a569];return _0x536d3b;};'use strict';var _=require(_0x83ff('0x0'));var util=require(_0x83ff('0x1'));var moment=require(_0x83ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x83ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83ff('0x4'))['db'];var utils=require(_0x83ff('0x5'));var logger=require(_0x83ff('0x6'))('rpc');var config=require(_0x83ff('0x7'));var jayson=require(_0x83ff('0x8'));var client=jayson[_0x83ff('0x9')][_0x83ff('0xa')]({'port':0x232a});config[_0x83ff('0xb')]=_[_0x83ff('0xc')](config['redis'],{'host':_0x83ff('0xd'),'port':0x18eb});var socket=require(_0x83ff('0xe'))(new Redis(config[_0x83ff('0xb')]));require('./faxInteraction.socket')[_0x83ff('0xf')](socket);function respondWithRpcPromise(_0x444c08,_0x1cc4aa,_0x3b18ee){return new BPromise(function(_0x4b7dda,_0x264b7a){return client[_0x83ff('0x10')](_0x444c08,_0x3b18ee)[_0x83ff('0x11')](function(_0xd367ee){logger[_0x83ff('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x1cc4aa,_0x83ff('0x13'));logger[_0x83ff('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x1cc4aa,_0x83ff('0x13'),JSON['stringify'](_0xd367ee));if(_0xd367ee['error']){if(_0xd367ee[_0x83ff('0x15')][_0x83ff('0x16')]===0x1f4){logger[_0x83ff('0x15')](_0x83ff('0x17'),_0x1cc4aa,_0xd367ee[_0x83ff('0x15')][_0x83ff('0x18')]);return _0x264b7a(_0xd367ee['error'][_0x83ff('0x18')]);}logger['error'](_0x83ff('0x17'),_0x1cc4aa,_0xd367ee[_0x83ff('0x15')][_0x83ff('0x18')]);return _0x4b7dda(_0xd367ee[_0x83ff('0x15')][_0x83ff('0x18')]);}else{logger[_0x83ff('0x12')](_0x83ff('0x17'),_0x1cc4aa,_0x83ff('0x13'));_0x4b7dda(_0xd367ee[_0x83ff('0x19')][_0x83ff('0x18')]);}})[_0x83ff('0x1a')](function(_0x1c3f3d){logger[_0x83ff('0x15')](_0x83ff('0x17'),_0x1cc4aa,_0x1c3f3d);_0x264b7a(_0x1c3f3d);});});}exports['UpdateFaxInteraction']=function(_0x1bac1f){var _0x4a763c=this;return new Promise(function(_0x5bedee,_0x36ed5d){return db[_0x83ff('0x1b')][_0x83ff('0x1c')](_0x1bac1f[_0x83ff('0x1d')],{'raw':_0x1bac1f[_0x83ff('0x1e')]?_0x1bac1f[_0x83ff('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bac1f['options']?_0x1bac1f[_0x83ff('0x1e')][_0x83ff('0x1f')]||null:null,'attributes':_0x1bac1f[_0x83ff('0x1e')]?_0x1bac1f['options'][_0x83ff('0x20')]||null:null,'limit':_0x1bac1f[_0x83ff('0x1e')]?_0x1bac1f[_0x83ff('0x1e')][_0x83ff('0x21')]||null:null})[_0x83ff('0x11')](function(_0x186b61){logger[_0x83ff('0x12')](_0x83ff('0x22'),_0x1bac1f);logger[_0x83ff('0x14')]('UpdateFaxInteraction',_0x1bac1f,JSON[_0x83ff('0x23')](_0x186b61));_0x5bedee(_0x186b61);})[_0x83ff('0x1a')](function(_0x39fb67){logger[_0x83ff('0x15')](_0x83ff('0x22'),_0x39fb67['message'],_0x1bac1f);_0x36ed5d(_0x4a763c[_0x83ff('0x15')](0x1f4,_0x39fb67[_0x83ff('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4a7d26){return new Promise(function(_0x3688ba,_0x2f1ce3){return db[_0x83ff('0x1b')][_0x83ff('0x24')]({'where':_0x4a7d26['options']?_0x4a7d26[_0x83ff('0x1e')][_0x83ff('0x1f')]||null:null})[_0x83ff('0x11')](function(_0x2553b7){if(_0x2553b7){return _0x2553b7[_0x83ff('0x25')](_0x4a7d26[_0x83ff('0x1d')][_0x83ff('0x26')],_[_0x83ff('0x27')](_0x4a7d26[_0x83ff('0x1d')],[_0x83ff('0x26'),'id'])||{});}})[_0x83ff('0x28')](function(_0x4973ac){logger[_0x83ff('0x12')]('AddTags',_0x4a7d26);logger[_0x83ff('0x14')](_0x83ff('0x29'),_0x4a7d26,JSON[_0x83ff('0x23')](_0x4973ac));_0x3688ba(_0x4973ac);})[_0x83ff('0x1a')](function(_0x51a5f9){logger[_0x83ff('0x15')](_0x83ff('0x29'),_0x51a5f9['message'],_0x4a7d26);_0x2f1ce3(_this[_0x83ff('0x15')](0x1f4,_0x51a5f9[_0x83ff('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index c3d2291..cc3b28e 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 _0xd8a0=['register','length','save','remove','update','emit'];(function(_0x37a54c,_0x451203){var _0xbe66ad=function(_0x35659f){while(--_0x35659f){_0x37a54c['push'](_0x37a54c['shift']());}};_0xbe66ad(++_0x451203);}(_0xd8a0,0xf2));var _0x0d8a=function(_0x182026,_0x4d7965){_0x182026=_0x182026-0x0;var _0x1eff9d=_0xd8a0[_0x182026];return _0x1eff9d;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0d8a('0x0'),_0x0d8a('0x1'),_0x0d8a('0x2')];function createListener(_0x5c76e8,_0x2ebe6f){return function(_0x2981da){_0x2ebe6f[_0x0d8a('0x3')](_0x5c76e8,_0x2981da);};}function removeListener(_0x2d1cf0,_0x27000c){return function(){FaxInteractionEvents['removeListener'](_0x2d1cf0,_0x27000c);};}exports[_0x0d8a('0x4')]=function(_0x4d06ea){for(var _0x38c9f2=0x0,_0xab4849=events[_0x0d8a('0x5')];_0x38c9f2<_0xab4849;_0x38c9f2++){var _0x37d1ee=events[_0x38c9f2];var _0x41a2fc=createListener('faxInteraction:'+_0x37d1ee,_0x4d06ea);FaxInteractionEvents['on'](_0x37d1ee,_0x41a2fc);}}; \ No newline at end of file +var _0xa9cb=['faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','length'];(function(_0x67b075,_0x43557d){var _0x39d030=function(_0x4f25e1){while(--_0x4f25e1){_0x67b075['push'](_0x67b075['shift']());}};_0x39d030(++_0x43557d);}(_0xa9cb,0x1eb));var _0xba9c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9cb[_0x19e35c];return _0x3e1fe8;};'use strict';var FaxInteractionEvents=require(_0xba9c('0x0'));var events=[_0xba9c('0x1'),_0xba9c('0x2'),_0xba9c('0x3')];function createListener(_0x159423,_0x228fb2){return function(_0x43b1e5){_0x228fb2['emit'](_0x159423,_0x43b1e5);};}function removeListener(_0xe521db,_0x2ae52d){return function(){FaxInteractionEvents[_0xba9c('0x4')](_0xe521db,_0x2ae52d);};}exports['register']=function(_0x164b93){for(var _0x219d26=0x0,_0x5da707=events[_0xba9c('0x5')];_0x219d26<_0x5da707;_0x219d26++){var _0xabed14=events[_0x219d26];var _0x4701dc=createListener(_0xba9c('0x6')+_0xabed14,_0x164b93);FaxInteractionEvents['on'](_0xabed14,_0x4701dc);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index aa8ec9f..e42d533 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 _0x06d7=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','put','faxinteraction:update','update','delete','fax','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages'];(function(_0x5755eb,_0x415468){var _0x45239f=function(_0x35e31f){while(--_0x35e31f){_0x5755eb['push'](_0x5755eb['shift']());}};_0x45239f(++_0x415468);}(_0x06d7,0x19c));var _0x706d=function(_0x987ca1,_0x25b789){_0x987ca1=_0x987ca1-0x0;var _0x1467ff=_0x06d7[_0x987ca1];return _0x1467ff;};'use strict';var multer=require(_0x706d('0x0'));var util=require(_0x706d('0x1'));var path=require(_0x706d('0x2'));var timeout=require(_0x706d('0x3'));var express=require(_0x706d('0x4'));var router=express[_0x706d('0x5')]();var fs_extra=require(_0x706d('0x6'));var auth=require(_0x706d('0x7'));var interaction=require(_0x706d('0x8'));var config=require('../../config/environment');var controller=require(_0x706d('0x9'));router[_0x706d('0xa')]('/',auth[_0x706d('0xb')](),controller[_0x706d('0xc')]);router[_0x706d('0xa')]('/describe',auth[_0x706d('0xb')](),controller[_0x706d('0xd')]);router[_0x706d('0xa')](_0x706d('0xe'),auth[_0x706d('0xb')](),controller[_0x706d('0xf')]);router[_0x706d('0xa')](_0x706d('0x10'),auth[_0x706d('0xb')](),controller['getMessages']);router['get'](_0x706d('0x11'),auth['isAuthenticated'](),controller[_0x706d('0x12')]);router[_0x706d('0x13')]('/',auth[_0x706d('0xb')](),controller[_0x706d('0x14')]);router[_0x706d('0x13')](_0x706d('0x10'),auth[_0x706d('0xb')](),controller[_0x706d('0x15')]);router['post'](_0x706d('0x16'),auth[_0x706d('0xb')](),interaction[_0x706d('0x17')]('fax',_0x706d('0x18')),controller['addTags']);router[_0x706d('0x19')](_0x706d('0xe'),auth[_0x706d('0xb')](),interaction[_0x706d('0x17')]('fax',_0x706d('0x1a')),controller[_0x706d('0x1b')]);router[_0x706d('0x1c')](_0x706d('0xe'),auth[_0x706d('0xb')](),interaction['tracked'](_0x706d('0x1d'),_0x706d('0x1e')),controller[_0x706d('0x1f')]);router[_0x706d('0x1c')](_0x706d('0x16'),auth['isAuthenticated'](),controller['removeTags']);module[_0x706d('0x20')]=router; \ No newline at end of file +var _0x2482=['post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download'];(function(_0x40c2ba,_0x470eb5){var _0x22d168=function(_0x549ac2){while(--_0x549ac2){_0x40c2ba['push'](_0x40c2ba['shift']());}};_0x22d168(++_0x470eb5);}(_0x2482,0x194));var _0x2248=function(_0x45974d,_0x16fd32){_0x45974d=_0x45974d-0x0;var _0x7a059e=_0x2482[_0x45974d];return _0x7a059e;};'use strict';var multer=require('multer');var util=require(_0x2248('0x0'));var path=require(_0x2248('0x1'));var timeout=require(_0x2248('0x2'));var express=require('express');var router=express[_0x2248('0x3')]();var fs_extra=require(_0x2248('0x4'));var auth=require(_0x2248('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2248('0x6'));router[_0x2248('0x7')]('/',auth[_0x2248('0x8')](),controller[_0x2248('0x9')]);router[_0x2248('0x7')]('/describe',auth[_0x2248('0x8')](),controller[_0x2248('0xa')]);router[_0x2248('0x7')](_0x2248('0xb'),auth[_0x2248('0x8')](),controller[_0x2248('0xc')]);router[_0x2248('0x7')]('/:id/messages',auth[_0x2248('0x8')](),controller[_0x2248('0xd')]);router[_0x2248('0x7')](_0x2248('0xe'),auth[_0x2248('0x8')](),controller[_0x2248('0xf')]);router[_0x2248('0x10')]('/',auth['isAuthenticated'](),controller[_0x2248('0x11')]);router[_0x2248('0x10')](_0x2248('0x12'),auth[_0x2248('0x8')](),controller[_0x2248('0x13')]);router[_0x2248('0x10')](_0x2248('0x14'),auth[_0x2248('0x8')](),interaction[_0x2248('0x15')](_0x2248('0x16'),_0x2248('0x17')),controller[_0x2248('0x18')]);router['put'](_0x2248('0xb'),auth[_0x2248('0x8')](),interaction[_0x2248('0x15')]('fax',_0x2248('0x19')),controller[_0x2248('0x1a')]);router[_0x2248('0x1b')](_0x2248('0xb'),auth[_0x2248('0x8')](),interaction[_0x2248('0x15')](_0x2248('0x16'),_0x2248('0x1c')),controller['destroy']);router[_0x2248('0x1b')](_0x2248('0x14'),auth[_0x2248('0x8')](),controller[_0x2248('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index e8ecedd..62e7e55 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 _0x0f9f=['medium','ENUM','out','DATE','exports','TEXT'];(function(_0x578344,_0x4f2b1d){var _0x3bedf9=function(_0x13d62a){while(--_0x13d62a){_0x578344['push'](_0x578344['shift']());}};_0x3bedf9(++_0x4f2b1d);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x4a3baa,_0x19cb30){_0x4a3baa=_0x4a3baa-0x0;var _0x1e8aef=_0x0f9f[_0x4a3baa];return _0x1e8aef;};'use strict';var Sequelize=require('sequelize');module[_0xf0f9('0x0')]={'body':{'type':Sequelize[_0xf0f9('0x1')](_0xf0f9('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf0f9('0x3')]('in',_0xf0f9('0x4')),'defaultValue':_0xf0f9('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf0f9('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf0f9('0x5')]}}; \ No newline at end of file +var _0x19da=['out','TEXT','DATE','exports','medium','ENUM'];(function(_0x4090d0,_0x4d79e6){var _0x4ccd64=function(_0x445d58){while(--_0x445d58){_0x4090d0['push'](_0x4090d0['shift']());}};_0x4ccd64(++_0x4d79e6);}(_0x19da,0x9f));var _0xa19d=function(_0x4d6ac0,_0x201628){_0x4d6ac0=_0x4d6ac0-0x0;var _0x5296c4=_0x19da[_0x4d6ac0];return _0x5296c4;};'use strict';var Sequelize=require('sequelize');module[_0xa19d('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa19d('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa19d('0x2')]('in',_0xa19d('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xa19d('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa19d('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 44837af..02f6ab1 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 _0x4683=['name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','FaxMessage','includeAll','include','findAll','rows','show','keys','merge','options','find','body','params','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','read1stAt','role','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','agent','fullname','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','fax-interactions','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','QueryTypes','SELECT','User','email','internal','interface','event','reject','create','findOne','isNil','fax','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','stack'];(function(_0x47599c,_0x2d2e4a){var _0x10a0dd=function(_0x825aab){while(--_0x825aab){_0x47599c['push'](_0x47599c['shift']());}};_0x10a0dd(++_0x2d2e4a);}(_0x4683,0xe3));var _0x3468=function(_0xb26945,_0x3d4c0d){_0xb26945=_0xb26945-0x0;var _0x2b04b3=_0x4683[_0xb26945];return _0x2b04b3;};'use strict';var emlformat=require(_0x3468('0x0'));var rimraf=require(_0x3468('0x1'));var zipdir=require(_0x3468('0x2'));var jsonpatch=require(_0x3468('0x3'));var rp=require(_0x3468('0x4'));var moment=require(_0x3468('0x5'));var BPromise=require(_0x3468('0x6'));var Mustache=require('mustache');var util=require(_0x3468('0x7'));var path=require(_0x3468('0x8'));var sox=require(_0x3468('0x9'));var csv=require(_0x3468('0xa'));var ejs=require(_0x3468('0xb'));var fs=require('fs');var fs_extra=require(_0x3468('0xc'));var _=require(_0x3468('0xd'));var squel=require(_0x3468('0xe'));var crypto=require(_0x3468('0xf'));var jsforce=require(_0x3468('0x10'));var deskjs=require(_0x3468('0x11'));var toCsv=require(_0x3468('0xa'));var querystring=require('querystring');var Papa=require(_0x3468('0x12'));var Redis=require('ioredis');var authService=require(_0x3468('0x13'));var qs=require(_0x3468('0x14'));var as=require(_0x3468('0x15'));var hardwareService=require(_0x3468('0x16'));var logger=require(_0x3468('0x17'))(_0x3468('0x18'));var utils=require(_0x3468('0x19'));var config=require(_0x3468('0x1a'));var licenseUtil=require(_0x3468('0x1b'));var db=require(_0x3468('0x1c'))['db'];config[_0x3468('0x1d')]=_[_0x3468('0x1e')](config['redis'],{'host':_0x3468('0x1f'),'port':0x18eb});var socket=require(_0x3468('0x20'))(new Redis(config[_0x3468('0x1d')]));require(_0x3468('0x21'))['register'](socket);var jayson=require(_0x3468('0x22'));var client=jayson[_0x3468('0x23')][_0x3468('0x24')]({'port':0x232c});var client9002=jayson[_0x3468('0x23')][_0x3468('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x5a1840,_0x6a66d5,_0x6b03b5,_0x6333ba){return new BPromise(function(_0x3a2f32,_0x32c06e){var _0xa6b0cb=_0x6333ba||client;return _0xa6b0cb[_0x3468('0x25')](_0x5a1840,_0x6b03b5)[_0x3468('0x26')](function(_0x2b6207){logger[_0x3468('0x27')]('FaxMessage,\x20%s,\x20%s',_0x6a66d5,_0x3468('0x28'));logger[_0x3468('0x29')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x6a66d5,_0x3468('0x28'),JSON[_0x3468('0x2a')](_0x2b6207));if(_0x2b6207['error']){if(_0x2b6207[_0x3468('0x2b')][_0x3468('0x2c')]===0x1f4){logger[_0x3468('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x6a66d5,_0x2b6207[_0x3468('0x2b')][_0x3468('0x2d')]);return _0x32c06e(_0x2b6207[_0x3468('0x2b')][_0x3468('0x2d')]);}logger[_0x3468('0x2b')](_0x3468('0x2e'),_0x6a66d5,_0x2b6207[_0x3468('0x2b')][_0x3468('0x2d')]);return _0x3a2f32(_0x2b6207[_0x3468('0x2b')][_0x3468('0x2d')]);}else{logger[_0x3468('0x27')](_0x3468('0x2e'),_0x6a66d5,'request\x20sent');_0x3a2f32(_0x2b6207[_0x3468('0x2f')][_0x3468('0x2d')]);}})[_0x3468('0x30')](function(_0x3a261a){logger[_0x3468('0x2b')](_0x3468('0x2e'),_0x6a66d5,_0x3a261a);_0x32c06e(_0x3a261a);});});}function respondWithStatusCode(_0x994a5b,_0x5b985a){_0x5b985a=_0x5b985a||0xcc;return function(_0x1877c3){if(_0x1877c3){return _0x994a5b[_0x3468('0x31')](_0x5b985a);}return _0x994a5b[_0x3468('0x32')](_0x5b985a)[_0x3468('0x33')]();};}function respondWithResult(_0x3c2d9b,_0x3556fd){_0x3556fd=_0x3556fd||0xc8;return function(_0x237053){if(_0x237053){return _0x3c2d9b[_0x3468('0x32')](_0x3556fd)[_0x3468('0x34')](_0x237053);}};}function respondWithFilteredResult(_0x402fd2,_0x121346){return function(_0x4a270b){if(_0x4a270b){var _0x4649e8=typeof _0x121346['offset']===_0x3468('0x35')&&typeof _0x121346[_0x3468('0x36')]===_0x3468('0x35');var _0x25cd42=_0x4a270b[_0x3468('0x37')];var _0x59dc3a=_0x4649e8?0x0:_0x121346[_0x3468('0x38')];var _0x1d4f44=_0x4649e8?_0x4a270b[_0x3468('0x37')]:_0x121346[_0x3468('0x38')]+_0x121346[_0x3468('0x36')];var _0x10a6e7;if(_0x1d4f44>=_0x25cd42){_0x1d4f44=_0x25cd42;_0x10a6e7=0xc8;}else{_0x10a6e7=0xce;}_0x402fd2[_0x3468('0x32')](_0x10a6e7);return _0x402fd2[_0x3468('0x39')](_0x3468('0x3a'),_0x59dc3a+'-'+_0x1d4f44+'/'+_0x25cd42)[_0x3468('0x34')](_0x4a270b);}return null;};}function patchUpdates(_0x1aa74d){return function(_0x16b74b){try{jsonpatch['apply'](_0x16b74b,_0x1aa74d,!![]);}catch(_0x46a6c6){return BPromise['reject'](_0x46a6c6);}return _0x16b74b[_0x3468('0x3b')]();};}function saveUpdates(_0xf8c57a,_0x17dacf){return function(_0x212701){if(_0x212701){return _0x212701[_0x3468('0x3c')](_0xf8c57a)[_0x3468('0x26')](function(_0x400a1e){return _0x400a1e;});}return null;};}function removeEntity(_0x2e0c7d,_0x1ac669){return function(_0x3e7a6b){if(_0x3e7a6b){return _0x3e7a6b[_0x3468('0x3d')]()[_0x3468('0x26')](function(){_0x2e0c7d['status'](0xcc)[_0x3468('0x33')]();});}};}function handleEntityNotFound(_0x170d02,_0x5e8cda){return function(_0x3de280){if(!_0x3de280){_0x170d02[_0x3468('0x31')](0x194);}return _0x3de280;};}function handleError(_0x1f616e,_0x57094d){_0x57094d=_0x57094d||0x1f4;return function(_0x62c872){logger['error'](_0x62c872[_0x3468('0x3e')]);if(_0x62c872[_0x3468('0x3f')]){delete _0x62c872[_0x3468('0x3f')];}_0x1f616e[_0x3468('0x32')](_0x57094d)[_0x3468('0x40')](_0x62c872);};}exports[_0x3468('0x41')]=function(_0x337486,_0x4f5e13){var _0x526941={},_0x45e1bf={},_0x2e368f={'count':0x0,'rows':[]};var _0x17a3ee=_['map'](db['FaxMessage'][_0x3468('0x42')],function(_0x56a0a1){return{'name':_0x56a0a1[_0x3468('0x43')],'type':_0x56a0a1[_0x3468('0x44')]['key']};});_0x45e1bf[_0x3468('0x45')]=_[_0x3468('0x46')](_0x17a3ee,_0x3468('0x3f'));_0x45e1bf[_0x3468('0x47')]=_['keys'](_0x337486[_0x3468('0x47')]);_0x45e1bf[_0x3468('0x48')]=_[_0x3468('0x49')](_0x45e1bf[_0x3468('0x45')],_0x45e1bf[_0x3468('0x47')]);_0x526941[_0x3468('0x4a')]=_[_0x3468('0x49')](_0x45e1bf[_0x3468('0x45')],qs[_0x3468('0x4b')](_0x337486[_0x3468('0x47')][_0x3468('0x4b')]));_0x526941[_0x3468('0x4a')]=_0x526941['attributes'][_0x3468('0x4c')]?_0x526941[_0x3468('0x4a')]:_0x45e1bf['model'];if(!_0x337486['query'][_0x3468('0x4d')](_0x3468('0x4e'))){_0x526941[_0x3468('0x36')]=qs[_0x3468('0x36')](_0x337486[_0x3468('0x47')]['limit']);_0x526941[_0x3468('0x38')]=qs[_0x3468('0x38')](_0x337486['query'][_0x3468('0x38')]);}_0x526941['order']=qs[_0x3468('0x4f')](_0x337486[_0x3468('0x47')]['sort']);_0x526941[_0x3468('0x50')]=qs[_0x3468('0x48')](_[_0x3468('0x51')](_0x337486[_0x3468('0x47')],_0x45e1bf[_0x3468('0x48')]),_0x17a3ee);if(_0x337486[_0x3468('0x47')][_0x3468('0x52')]){_0x526941[_0x3468('0x50')]=_['merge'](_0x526941['where'],{'$or':_['map'](_0x17a3ee,function(_0xe6e898){if(_0xe6e898[_0x3468('0x44')]!=='VIRTUAL'){var _0x13c497={};_0x13c497[_0xe6e898[_0x3468('0x3f')]]={'$like':'%'+_0x337486[_0x3468('0x47')][_0x3468('0x52')]+'%'};return _0x13c497;}})});}_0x526941=_['merge']({},_0x526941,_0x337486['options']);var _0x380432={'where':_0x526941['where']};return db[_0x3468('0x53')][_0x3468('0x37')](_0x380432)[_0x3468('0x26')](function(_0x27e61b){_0x2e368f[_0x3468('0x37')]=_0x27e61b;if(_0x337486['query'][_0x3468('0x54')]){_0x526941[_0x3468('0x55')]=[{'all':!![]}];}return db[_0x3468('0x53')][_0x3468('0x56')](_0x526941);})[_0x3468('0x26')](function(_0x59fcaf){_0x2e368f[_0x3468('0x57')]=_0x59fcaf;return _0x2e368f;})['then'](respondWithFilteredResult(_0x4f5e13,_0x526941))[_0x3468('0x30')](handleError(_0x4f5e13,null));};exports[_0x3468('0x58')]=function(_0x23823d,_0x2765f2){var _0x5ee3a9={'raw':!![],'where':{'id':_0x23823d['params']['id']}},_0x1cd300={};_0x1cd300[_0x3468('0x45')]=_[_0x3468('0x59')](db[_0x3468('0x53')][_0x3468('0x42')]);_0x1cd300[_0x3468('0x47')]=_[_0x3468('0x59')](_0x23823d[_0x3468('0x47')]);_0x1cd300[_0x3468('0x48')]=_[_0x3468('0x49')](_0x1cd300[_0x3468('0x45')],_0x1cd300[_0x3468('0x47')]);_0x5ee3a9[_0x3468('0x4a')]=_['intersection'](_0x1cd300[_0x3468('0x45')],qs[_0x3468('0x4b')](_0x23823d[_0x3468('0x47')]['fields']));_0x5ee3a9[_0x3468('0x4a')]=_0x5ee3a9[_0x3468('0x4a')][_0x3468('0x4c')]?_0x5ee3a9[_0x3468('0x4a')]:_0x1cd300[_0x3468('0x45')];if(_0x23823d[_0x3468('0x47')][_0x3468('0x54')]){_0x5ee3a9[_0x3468('0x55')]=[{'all':!![]}];}_0x5ee3a9=_[_0x3468('0x5a')]({},_0x5ee3a9,_0x23823d[_0x3468('0x5b')]);return db['FaxMessage'][_0x3468('0x5c')](_0x5ee3a9)[_0x3468('0x26')](handleEntityNotFound(_0x2765f2,null))[_0x3468('0x26')](respondWithResult(_0x2765f2,null))[_0x3468('0x30')](handleError(_0x2765f2,null));};exports[_0x3468('0x3c')]=function(_0x218ddf,_0x52d449){if(_0x218ddf['body']['id']){delete _0x218ddf[_0x3468('0x5d')]['id'];}return db[_0x3468('0x53')][_0x3468('0x5c')]({'where':{'id':_0x218ddf[_0x3468('0x5e')]['id']}})['then'](handleEntityNotFound(_0x52d449,null))[_0x3468('0x26')](saveUpdates(_0x218ddf[_0x3468('0x5d')],null))['then'](respondWithResult(_0x52d449,null))[_0x3468('0x30')](handleError(_0x52d449,null));};exports['destroy']=function(_0x3cdcc8,_0x340a49){return db[_0x3468('0x53')][_0x3468('0x5c')]({'where':{'id':_0x3cdcc8['params']['id']}})[_0x3468('0x26')](handleEntityNotFound(_0x340a49,null))[_0x3468('0x26')](removeEntity(_0x340a49,null))[_0x3468('0x30')](handleError(_0x340a49,null));};exports[_0x3468('0x5f')]=function(_0x2485b2,_0x5d71ca){return db[_0x3468('0x53')]['describe']()[_0x3468('0x26')](respondWithResult(_0x5d71ca,null))[_0x3468('0x30')](handleError(_0x5d71ca,null));};var interaction_log=require(_0x3468('0x17'))('fax-interactions');exports[_0x3468('0x60')]=function(_0x4bcaf3,_0x26d944,_0x4264c3){var _0x41fb3d={'agent':{},'channel':'fax'};if(_0x4bcaf3[_0x3468('0x5d')]['id']){delete _0x4bcaf3['body']['id'];}_0x4bcaf3[_0x3468('0x5d')]['read']=!![];_0x4bcaf3[_0x3468('0x5d')][_0x3468('0x61')]=moment()[_0x3468('0x62')](_0x3468('0x63'));_0x4bcaf3[_0x3468('0x5d')]['UserId']=_0x4bcaf3[_0x3468('0x5d')]['UserId']||_0x4bcaf3[_0x3468('0x64')]['id'];_0x41fb3d['agent']['id']=_0x4bcaf3[_0x3468('0x5d')][_0x3468('0x65')];return db[_0x3468('0x53')][_0x3468('0x5c')]({'where':{'id':_0x4bcaf3['params']['id'],'UserId':null}})[_0x3468('0x26')](handleEntityNotFound(_0x26d944,null))[_0x3468('0x26')](saveUpdates(_0x4bcaf3[_0x3468('0x5d')],null))[_0x3468('0x26')](function(_0x281b61){if(_0x281b61){_0x41fb3d[_0x3468('0x2d')]=_0x281b61[_0x3468('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x3468('0x5c')]({'where':{'id':_0x281b61['FaxInteractionId']}});}return null;})[_0x3468('0x26')](handleEntityNotFound(_0x26d944,null))[_0x3468('0x26')](function(_0x2355f2){if(_0x2355f2){return _0x2355f2[_0x3468('0x3c')]({'UserId':_0x4bcaf3['body'][_0x3468('0x65')],'read1stAt':_['isNil'](_0x2355f2[_0x3468('0x67')])?moment()[_0x3468('0x62')](_0x3468('0x63')):undefined});}return null;})[_0x3468('0x26')](function(_0x44feb0){if(_0x44feb0){_0x41fb3d['interaction']=_0x44feb0['get']({'plain':!![]});interaction_log[_0x3468('0x27')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4bcaf3[_0x3468('0x64')]['id'],_0x4bcaf3['user']['name'],_0x4bcaf3[_0x3468('0x64')][_0x3468('0x68')],_0x41fb3d[_0x3468('0x69')]['id'],_0x4bcaf3[_0x3468('0x5d')]?JSON[_0x3468('0x2a')](_0x4bcaf3[_0x3468('0x5d')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x41fb3d);}return null;})[_0x3468('0x26')](function(_0x44fd38){var _0x2cc6bc=_0x3468('0x6a')+_0x44fd38[_0x3468('0x2d')][_0x3468('0x6b')];return db['sequelize'][_0x3468('0x47')](_0x2cc6bc,{'type':db[_0x3468('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3468('0x26')](function(_0x2d8685){return _0x2d8685;});})[_0x3468('0x26')](function(_0x11a912){if(_0x11a912){_0x41fb3d[_0x3468('0x2d')][_0x3468('0x6d')]=_0x11a912[0x0];if(!_0x4bcaf3[_0x3468('0x5d')][_0x3468('0x65')])return;return db['User'][_0x3468('0x5c')]({'where':{'id':_0x4bcaf3[_0x3468('0x5d')][_0x3468('0x65')],'role':_0x3468('0x6e')},'attributes':['id','name',_0x3468('0x6f'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x7d8dd7){if(!_0x7d8dd7)return null;_0x41fb3d['message']['agent']=_0x7d8dd7;return _0x41fb3d;})['then'](function(_0x4b314b){if(_0x4b314b){if(_0x4bcaf3[_0x3468('0x5d')][_0x3468('0x70')]){_0x41fb3d[_0x3468('0x2d')]['interface']=util[_0x3468('0x62')](_0x3468('0x71'),_0x4bcaf3['user'][_0x3468('0x3f')]);_0x41fb3d[_0x3468('0x2d')][_0x3468('0x72')]=_0x41fb3d[_0x3468('0x72')];_0x41fb3d[_0x3468('0x2d')][_0x3468('0x73')]=_0x41fb3d[_0x3468('0x72')];_0x41fb3d[_0x3468('0x2d')]['event']='accept';return respondWithRpcPromise(_0x3468('0x74'),_0x3468('0x74'),{'event':_0x3468('0x75'),'message':_0x41fb3d['message']},client9002)['then'](function(){return _0x41fb3d;});}return _0x41fb3d;}return null;})[_0x3468('0x26')](respondWithResult(_0x26d944,null))['catch'](handleError(_0x26d944,null));};var interaction_log=require(_0x3468('0x17'))(_0x3468('0x76'));exports['reject']=function(_0x34b090,_0x2bfb47,_0x823240){var _0x1cf59c={'agent':{},'channel':'fax'};if(_0x34b090[_0x3468('0x5d')]['id']){delete _0x34b090[_0x3468('0x5d')]['id'];}_0x34b090[_0x3468('0x5d')][_0x3468('0x65')]=_0x34b090['body'][_0x3468('0x65')]||_0x34b090[_0x3468('0x64')]['id'];_0x1cf59c[_0x3468('0x6e')]['id']=_0x34b090['body'][_0x3468('0x65')];return db[_0x3468('0x53')][_0x3468('0x5c')]({'where':{'id':_0x34b090[_0x3468('0x5e')]['id'],'UserId':null}})[_0x3468('0x26')](handleEntityNotFound(_0x2bfb47,null))['then'](function(_0x70b100){if(_0x70b100){_0x1cf59c['message']=_0x70b100[_0x3468('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x3468('0x5c')]({'where':{'id':_0x70b100[_0x3468('0x77')]}});}return null;})[_0x3468('0x26')](handleEntityNotFound(_0x2bfb47,null))[_0x3468('0x26')](function(_0x63c8d6){if(_0x63c8d6){_0x1cf59c[_0x3468('0x69')]=_0x63c8d6[_0x3468('0x66')]({'plain':!![]});interaction_log[_0x3468('0x27')](_0x3468('0x78'),_0x34b090[_0x3468('0x64')]['id'],_0x34b090[_0x3468('0x64')][_0x3468('0x3f')],_0x34b090[_0x3468('0x64')]['role'],_0x1cf59c['interaction']['id'],_0x34b090[_0x3468('0x5d')]?JSON[_0x3468('0x2a')](_0x34b090[_0x3468('0x5d')]):_0x3468('0x79'));return respondWithRpcPromise(_0x3468('0x7a'),_0x3468('0x7b'),_0x1cf59c);}return null;})['then'](function(_0x35d896){var _0x10d76d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x35d896[_0x3468('0x2d')][_0x3468('0x6b')];return db[_0x3468('0x7c')][_0x3468('0x47')](_0x10d76d,{'type':db[_0x3468('0x6c')][_0x3468('0x7d')][_0x3468('0x7e')],'raw':!![]})['then'](function(_0x58e842){return _0x58e842;});})[_0x3468('0x26')](function(_0x56fa59){if(_0x56fa59){_0x1cf59c['message'][_0x3468('0x6d')]=_0x56fa59[0x0];if(!_0x34b090[_0x3468('0x5d')][_0x3468('0x65')])return;return db[_0x3468('0x7f')]['find']({'where':{'id':_0x34b090['body']['UserId'],'role':_0x3468('0x6e')},'attributes':['id',_0x3468('0x3f'),_0x3468('0x6f'),_0x3468('0x80'),_0x3468('0x81')],'raw':!![]});}return null;})[_0x3468('0x26')](function(_0x1499f3){if(!_0x1499f3)return null;_0x1cf59c['message'][_0x3468('0x6e')]=_0x1499f3;return _0x1cf59c;})['then'](function(_0x28c3f0){if(_0x28c3f0){_0x28c3f0[_0x3468('0x2d')][_0x3468('0x82')]=util[_0x3468('0x62')]('SIP/%s',_0x34b090[_0x3468('0x64')]['name']);_0x28c3f0[_0x3468('0x2d')]['channel']=_0x1cf59c[_0x3468('0x72')];_0x28c3f0['message']['motionChannel']=_0x1cf59c['channel'];_0x28c3f0[_0x3468('0x2d')][_0x3468('0x83')]=_0x3468('0x84');respondWithRpcPromise(_0x3468('0x74'),_0x3468('0x74'),{'event':'rejectmessage','message':_0x28c3f0[_0x3468('0x2d')]},client9002);return _0x1cf59c;}return null;})[_0x3468('0x26')](respondWithResult(_0x2bfb47,null))[_0x3468('0x30')](handleError(_0x2bfb47,null));};exports[_0x3468('0x85')]=function(_0x1b6605,_0x498691){var _0xbd0f53;return db[_0x3468('0x53')][_0x3468('0x85')](_0x1b6605['body'],{})[_0x3468('0x26')](function(_0x5bac07){_0xbd0f53=_0x5bac07;return db['CmContact'][_0x3468('0x86')]({'where':{'id':_0xbd0f53[_0x3468('0x6b')]}});})['then'](function(_0x5afad2){if(_[_0x3468('0x87')](_0x5afad2)){return;}else{_0xbd0f53[_0x3468('0x88')]=_0x5afad2[_0x3468('0x88')];return db[_0x3468('0x89')][_0x3468('0x86')]({'where':{'id':_0xbd0f53[_0x3468('0x8a')]}});}})[_0x3468('0x26')](function(_0xfe15eb){return respondWithRpcPromise(_0x3468('0x8b'),'SendFax',{'FaxAccountId':_[_0x3468('0x87')](_0x1b6605[_0x3468('0x5d')])?undefined:_0x1b6605[_0x3468('0x5d')][_0x3468('0x8c')],'path':_[_0x3468('0x87')](_0xfe15eb)?undefined:util[_0x3468('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0xfe15eb[_0x3468('0x8d')]),'fax':_[_0x3468('0x87')](_0xbd0f53[_0x3468('0x88')])?undefined:_0xbd0f53[_0x3468('0x88')],'AttachmentId':_0xbd0f53[_0x3468('0x8a')]},client9002);})[_0x3468('0x26')](respondWithResult(_0x498691,0xc9))['catch'](handleError(_0x498691,null));};exports[_0x3468('0x8e')]=function(_0x4fe65f,_0x5cb00f){var _0x5ab01e=path[_0x3468('0x8f')](config['root'],_0x3468('0x90'),'files','attachments');return db[_0x3468('0x53')][_0x3468('0x5c')]({'where':{'id':_0x4fe65f['params']['id']},'include':[{'model':db[_0x3468('0x89')],'as':_0x3468('0x89')}]})[_0x3468('0x26')](handleEntityNotFound(_0x5cb00f,null))['then'](function(_0x98541e){if(_0x98541e){return _0x5cb00f[_0x3468('0x8e')](path[_0x3468('0x8f')](_0x5ab01e,_0x98541e[_0x3468('0x89')][_0x3468('0x8d')]));}})[_0x3468('0x30')](handleError(_0x5cb00f,null));}; \ No newline at end of file +var _0x6b1e=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','show','params','include','merge','find','body','describe','fax-interactions','accept','fax','read','format','UserId','agent','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','fullname','interface','create','CmContact','findOne','Attachment','AttachmentId','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','files','attachments','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters'];(function(_0x177781,_0x136cc1){var _0x128fa2=function(_0xc34c3a){while(--_0xc34c3a){_0x177781['push'](_0x177781['shift']());}};_0x128fa2(++_0x136cc1);}(_0x6b1e,0x172));var _0xe6b1=function(_0x58f510,_0x1807c9){_0x58f510=_0x58f510-0x0;var _0x2b035e=_0x6b1e[_0x58f510];return _0x2b035e;};'use strict';var emlformat=require(_0xe6b1('0x0'));var rimraf=require(_0xe6b1('0x1'));var zipdir=require(_0xe6b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6b1('0x3'));var moment=require(_0xe6b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe6b1('0x5'));var util=require(_0xe6b1('0x6'));var path=require('path');var sox=require(_0xe6b1('0x7'));var csv=require('to-csv');var ejs=require(_0xe6b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6b1('0x9'));var squel=require(_0xe6b1('0xa'));var crypto=require('crypto');var jsforce=require(_0xe6b1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe6b1('0xc'));var querystring=require(_0xe6b1('0xd'));var Papa=require(_0xe6b1('0xe'));var Redis=require(_0xe6b1('0xf'));var authService=require(_0xe6b1('0x10'));var qs=require(_0xe6b1('0x11'));var as=require(_0xe6b1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6b1('0x13'))(_0xe6b1('0x14'));var utils=require(_0xe6b1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe6b1('0x16'));var db=require(_0xe6b1('0x17'))['db'];config[_0xe6b1('0x18')]=_[_0xe6b1('0x19')](config[_0xe6b1('0x18')],{'host':_0xe6b1('0x1a'),'port':0x18eb});var socket=require(_0xe6b1('0x1b'))(new Redis(config[_0xe6b1('0x18')]));require('./faxMessage.socket')[_0xe6b1('0x1c')](socket);var jayson=require(_0xe6b1('0x1d'));var client=jayson[_0xe6b1('0x1e')][_0xe6b1('0x1f')]({'port':0x232c});var client9002=jayson[_0xe6b1('0x1e')][_0xe6b1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x291ba4,_0x5b1214,_0x48a00c,_0x3295b6){return new BPromise(function(_0x3bfda0,_0x44bd3d){var _0xf532cc=_0x3295b6||client;return _0xf532cc[_0xe6b1('0x20')](_0x291ba4,_0x48a00c)['then'](function(_0x567a88){logger[_0xe6b1('0x21')](_0xe6b1('0x22'),_0x5b1214,_0xe6b1('0x23'));logger[_0xe6b1('0x24')](_0xe6b1('0x25'),_0x5b1214,_0xe6b1('0x23'),JSON['stringify'](_0x567a88));if(_0x567a88[_0xe6b1('0x26')]){if(_0x567a88['error']['code']===0x1f4){logger[_0xe6b1('0x26')](_0xe6b1('0x22'),_0x5b1214,_0x567a88[_0xe6b1('0x26')][_0xe6b1('0x27')]);return _0x44bd3d(_0x567a88[_0xe6b1('0x26')][_0xe6b1('0x27')]);}logger[_0xe6b1('0x26')]('FaxMessage,\x20%s,\x20%s',_0x5b1214,_0x567a88[_0xe6b1('0x26')][_0xe6b1('0x27')]);return _0x3bfda0(_0x567a88['error'][_0xe6b1('0x27')]);}else{logger[_0xe6b1('0x21')](_0xe6b1('0x22'),_0x5b1214,_0xe6b1('0x23'));_0x3bfda0(_0x567a88['result'][_0xe6b1('0x27')]);}})[_0xe6b1('0x28')](function(_0x1248e3){logger[_0xe6b1('0x26')](_0xe6b1('0x22'),_0x5b1214,_0x1248e3);_0x44bd3d(_0x1248e3);});});}function respondWithStatusCode(_0x937e6,_0x24ce5c){_0x24ce5c=_0x24ce5c||0xcc;return function(_0x287103){if(_0x287103){return _0x937e6['sendStatus'](_0x24ce5c);}return _0x937e6[_0xe6b1('0x29')](_0x24ce5c)['end']();};}function respondWithResult(_0x3c3efa,_0x5775b2){_0x5775b2=_0x5775b2||0xc8;return function(_0x5eea12){if(_0x5eea12){return _0x3c3efa['status'](_0x5775b2)[_0xe6b1('0x2a')](_0x5eea12);}};}function respondWithFilteredResult(_0x58e26e,_0x4cd9ee){return function(_0x33ce7c){if(_0x33ce7c){var _0x281f4d=typeof _0x4cd9ee[_0xe6b1('0x2b')]===_0xe6b1('0x2c')&&typeof _0x4cd9ee['limit']==='undefined';var _0x15dba7=_0x33ce7c[_0xe6b1('0x2d')];var _0x1a0e2e=_0x281f4d?0x0:_0x4cd9ee['offset'];var _0x246f54=_0x281f4d?_0x33ce7c['count']:_0x4cd9ee[_0xe6b1('0x2b')]+_0x4cd9ee[_0xe6b1('0x2e')];var _0x18970d;if(_0x246f54>=_0x15dba7){_0x246f54=_0x15dba7;_0x18970d=0xc8;}else{_0x18970d=0xce;}_0x58e26e[_0xe6b1('0x29')](_0x18970d);return _0x58e26e[_0xe6b1('0x2f')](_0xe6b1('0x30'),_0x1a0e2e+'-'+_0x246f54+'/'+_0x15dba7)[_0xe6b1('0x2a')](_0x33ce7c);}return null;};}function patchUpdates(_0x3f00f1){return function(_0x234171){try{jsonpatch[_0xe6b1('0x31')](_0x234171,_0x3f00f1,!![]);}catch(_0x2d3218){return BPromise[_0xe6b1('0x32')](_0x2d3218);}return _0x234171[_0xe6b1('0x33')]();};}function saveUpdates(_0x30f1a7,_0x48c162){return function(_0x10a3a1){if(_0x10a3a1){return _0x10a3a1[_0xe6b1('0x34')](_0x30f1a7)[_0xe6b1('0x35')](function(_0xdd75a1){return _0xdd75a1;});}return null;};}function removeEntity(_0x15354e,_0x5cf954){return function(_0x112962){if(_0x112962){return _0x112962[_0xe6b1('0x36')]()[_0xe6b1('0x35')](function(){_0x15354e[_0xe6b1('0x29')](0xcc)[_0xe6b1('0x37')]();});}};}function handleEntityNotFound(_0x206ab2,_0x181a17){return function(_0x4fe385){if(!_0x4fe385){_0x206ab2[_0xe6b1('0x38')](0x194);}return _0x4fe385;};}function handleError(_0x4f7655,_0x25e997){_0x25e997=_0x25e997||0x1f4;return function(_0x302ba6){logger['error'](_0x302ba6[_0xe6b1('0x39')]);if(_0x302ba6[_0xe6b1('0x3a')]){delete _0x302ba6[_0xe6b1('0x3a')];}_0x4f7655[_0xe6b1('0x29')](_0x25e997)[_0xe6b1('0x3b')](_0x302ba6);};}exports[_0xe6b1('0x3c')]=function(_0x507f07,_0x474454){var _0x3363bb={},_0x5c66c1={},_0x4e2d47={'count':0x0,'rows':[]};var _0x345184=_['map'](db[_0xe6b1('0x3d')][_0xe6b1('0x3e')],function(_0x5b22f2){return{'name':_0x5b22f2[_0xe6b1('0x3f')],'type':_0x5b22f2[_0xe6b1('0x40')][_0xe6b1('0x41')]};});_0x5c66c1[_0xe6b1('0x42')]=_[_0xe6b1('0x43')](_0x345184,_0xe6b1('0x3a'));_0x5c66c1[_0xe6b1('0x44')]=_[_0xe6b1('0x45')](_0x507f07[_0xe6b1('0x44')]);_0x5c66c1[_0xe6b1('0x46')]=_[_0xe6b1('0x47')](_0x5c66c1[_0xe6b1('0x42')],_0x5c66c1[_0xe6b1('0x44')]);_0x3363bb[_0xe6b1('0x48')]=_[_0xe6b1('0x47')](_0x5c66c1['model'],qs[_0xe6b1('0x49')](_0x507f07[_0xe6b1('0x44')][_0xe6b1('0x49')]));_0x3363bb[_0xe6b1('0x48')]=_0x3363bb[_0xe6b1('0x48')][_0xe6b1('0x4a')]?_0x3363bb[_0xe6b1('0x48')]:_0x5c66c1[_0xe6b1('0x42')];if(!_0x507f07[_0xe6b1('0x44')][_0xe6b1('0x4b')](_0xe6b1('0x4c'))){_0x3363bb[_0xe6b1('0x2e')]=qs[_0xe6b1('0x2e')](_0x507f07[_0xe6b1('0x44')][_0xe6b1('0x2e')]);_0x3363bb[_0xe6b1('0x2b')]=qs[_0xe6b1('0x2b')](_0x507f07[_0xe6b1('0x44')][_0xe6b1('0x2b')]);}_0x3363bb[_0xe6b1('0x4d')]=qs[_0xe6b1('0x4e')](_0x507f07['query'][_0xe6b1('0x4e')]);_0x3363bb['where']=qs[_0xe6b1('0x46')](_[_0xe6b1('0x4f')](_0x507f07['query'],_0x5c66c1['filters']),_0x345184);if(_0x507f07[_0xe6b1('0x44')][_0xe6b1('0x50')]){_0x3363bb[_0xe6b1('0x51')]=_['merge'](_0x3363bb['where'],{'$or':_[_0xe6b1('0x43')](_0x345184,function(_0x5adf95){if(_0x5adf95[_0xe6b1('0x40')]!==_0xe6b1('0x52')){var _0x4791e9={};_0x4791e9[_0x5adf95['name']]={'$like':'%'+_0x507f07['query'][_0xe6b1('0x50')]+'%'};return _0x4791e9;}})});}_0x3363bb=_['merge']({},_0x3363bb,_0x507f07[_0xe6b1('0x53')]);var _0x472693={'where':_0x3363bb[_0xe6b1('0x51')]};return db[_0xe6b1('0x3d')]['count'](_0x472693)['then'](function(_0x22461a){_0x4e2d47['count']=_0x22461a;if(_0x507f07['query'][_0xe6b1('0x54')]){_0x3363bb['include']=[{'all':!![]}];}return db[_0xe6b1('0x3d')][_0xe6b1('0x55')](_0x3363bb);})[_0xe6b1('0x35')](function(_0x5d279a){_0x4e2d47[_0xe6b1('0x56')]=_0x5d279a;return _0x4e2d47;})[_0xe6b1('0x35')](respondWithFilteredResult(_0x474454,_0x3363bb))[_0xe6b1('0x28')](handleError(_0x474454,null));};exports[_0xe6b1('0x57')]=function(_0x306bdf,_0x523269){var _0x99c669={'raw':!![],'where':{'id':_0x306bdf[_0xe6b1('0x58')]['id']}},_0x37d8f9={};_0x37d8f9['model']=_['keys'](db[_0xe6b1('0x3d')][_0xe6b1('0x3e')]);_0x37d8f9[_0xe6b1('0x44')]=_[_0xe6b1('0x45')](_0x306bdf['query']);_0x37d8f9[_0xe6b1('0x46')]=_[_0xe6b1('0x47')](_0x37d8f9[_0xe6b1('0x42')],_0x37d8f9['query']);_0x99c669['attributes']=_[_0xe6b1('0x47')](_0x37d8f9[_0xe6b1('0x42')],qs['fields'](_0x306bdf[_0xe6b1('0x44')][_0xe6b1('0x49')]));_0x99c669[_0xe6b1('0x48')]=_0x99c669[_0xe6b1('0x48')][_0xe6b1('0x4a')]?_0x99c669[_0xe6b1('0x48')]:_0x37d8f9[_0xe6b1('0x42')];if(_0x306bdf[_0xe6b1('0x44')]['includeAll']){_0x99c669[_0xe6b1('0x59')]=[{'all':!![]}];}_0x99c669=_[_0xe6b1('0x5a')]({},_0x99c669,_0x306bdf[_0xe6b1('0x53')]);return db[_0xe6b1('0x3d')][_0xe6b1('0x5b')](_0x99c669)['then'](handleEntityNotFound(_0x523269,null))[_0xe6b1('0x35')](respondWithResult(_0x523269,null))[_0xe6b1('0x28')](handleError(_0x523269,null));};exports[_0xe6b1('0x34')]=function(_0x57888c,_0x22b4ed){if(_0x57888c[_0xe6b1('0x5c')]['id']){delete _0x57888c['body']['id'];}return db[_0xe6b1('0x3d')][_0xe6b1('0x5b')]({'where':{'id':_0x57888c[_0xe6b1('0x58')]['id']}})[_0xe6b1('0x35')](handleEntityNotFound(_0x22b4ed,null))['then'](saveUpdates(_0x57888c[_0xe6b1('0x5c')],null))[_0xe6b1('0x35')](respondWithResult(_0x22b4ed,null))[_0xe6b1('0x28')](handleError(_0x22b4ed,null));};exports[_0xe6b1('0x36')]=function(_0x59aa39,_0x5c4449){return db['FaxMessage']['find']({'where':{'id':_0x59aa39[_0xe6b1('0x58')]['id']}})[_0xe6b1('0x35')](handleEntityNotFound(_0x5c4449,null))[_0xe6b1('0x35')](removeEntity(_0x5c4449,null))['catch'](handleError(_0x5c4449,null));};exports[_0xe6b1('0x5d')]=function(_0x4368e7,_0x4ee8e6){return db[_0xe6b1('0x3d')][_0xe6b1('0x5d')]()[_0xe6b1('0x35')](respondWithResult(_0x4ee8e6,null))[_0xe6b1('0x28')](handleError(_0x4ee8e6,null));};var interaction_log=require(_0xe6b1('0x13'))(_0xe6b1('0x5e'));exports[_0xe6b1('0x5f')]=function(_0xe6a75d,_0x3520a7,_0x23f464){var _0x4d7ec6={'agent':{},'channel':_0xe6b1('0x60')};if(_0xe6a75d['body']['id']){delete _0xe6a75d['body']['id'];}_0xe6a75d['body'][_0xe6b1('0x61')]=!![];_0xe6a75d[_0xe6b1('0x5c')]['readAt']=moment()[_0xe6b1('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0xe6a75d[_0xe6b1('0x5c')][_0xe6b1('0x63')]=_0xe6a75d[_0xe6b1('0x5c')][_0xe6b1('0x63')]||_0xe6a75d['user']['id'];_0x4d7ec6[_0xe6b1('0x64')]['id']=_0xe6a75d[_0xe6b1('0x5c')][_0xe6b1('0x63')];return db[_0xe6b1('0x3d')][_0xe6b1('0x5b')]({'where':{'id':_0xe6a75d[_0xe6b1('0x58')]['id'],'UserId':null}})[_0xe6b1('0x35')](handleEntityNotFound(_0x3520a7,null))['then'](saveUpdates(_0xe6a75d[_0xe6b1('0x5c')],null))[_0xe6b1('0x35')](function(_0x42a121){if(_0x42a121){_0x4d7ec6[_0xe6b1('0x27')]=_0x42a121[_0xe6b1('0x65')]({'plain':!![]});return db[_0xe6b1('0x66')][_0xe6b1('0x5b')]({'where':{'id':_0x42a121[_0xe6b1('0x67')]}});}return null;})[_0xe6b1('0x35')](handleEntityNotFound(_0x3520a7,null))[_0xe6b1('0x35')](function(_0x4964da){if(_0x4964da){return _0x4964da[_0xe6b1('0x34')]({'UserId':_0xe6a75d['body'][_0xe6b1('0x63')],'read1stAt':_['isNil'](_0x4964da[_0xe6b1('0x68')])?moment()[_0xe6b1('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe6b1('0x35')](function(_0x38c33f){if(_0x38c33f){_0x4d7ec6[_0xe6b1('0x69')]=_0x38c33f[_0xe6b1('0x65')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe6a75d[_0xe6b1('0x6a')]['id'],_0xe6a75d[_0xe6b1('0x6a')][_0xe6b1('0x3a')],_0xe6a75d['user']['role'],_0x4d7ec6[_0xe6b1('0x69')]['id'],_0xe6a75d[_0xe6b1('0x5c')]?JSON[_0xe6b1('0x6b')](_0xe6a75d[_0xe6b1('0x5c')]):_0xe6b1('0x6c'));return respondWithRpcPromise(_0xe6b1('0x6d'),_0xe6b1('0x6e'),_0x4d7ec6);}return null;})['then'](function(_0x55f69f){var _0x400979=_0xe6b1('0x6f')+_0x55f69f[_0xe6b1('0x27')][_0xe6b1('0x70')];return db[_0xe6b1('0x71')][_0xe6b1('0x44')](_0x400979,{'type':db['Sequelize'][_0xe6b1('0x72')][_0xe6b1('0x73')],'raw':!![]})[_0xe6b1('0x35')](function(_0x9bda5e){return _0x9bda5e;});})[_0xe6b1('0x35')](function(_0x360d14){if(_0x360d14){_0x4d7ec6['message'][_0xe6b1('0x74')]=_0x360d14[0x0];if(!_0xe6a75d[_0xe6b1('0x5c')][_0xe6b1('0x63')])return;return db[_0xe6b1('0x75')]['find']({'where':{'id':_0xe6a75d['body'][_0xe6b1('0x63')],'role':'agent'},'attributes':['id','name','fullname',_0xe6b1('0x76'),_0xe6b1('0x77')],'raw':!![]});}return null;})[_0xe6b1('0x35')](function(_0x15a00c){if(!_0x15a00c)return null;_0x4d7ec6[_0xe6b1('0x27')]['agent']=_0x15a00c;return _0x4d7ec6;})[_0xe6b1('0x35')](function(_0x385698){if(_0x385698){if(_0xe6a75d[_0xe6b1('0x5c')][_0xe6b1('0x78')]){_0x4d7ec6[_0xe6b1('0x27')]['interface']=util[_0xe6b1('0x62')](_0xe6b1('0x79'),_0xe6a75d['user']['name']);_0x4d7ec6[_0xe6b1('0x27')][_0xe6b1('0x7a')]=_0x4d7ec6['channel'];_0x4d7ec6[_0xe6b1('0x27')][_0xe6b1('0x7b')]=_0x4d7ec6[_0xe6b1('0x7a')];_0x4d7ec6[_0xe6b1('0x27')][_0xe6b1('0x7c')]='accept';return respondWithRpcPromise('EventManager',_0xe6b1('0x7d'),{'event':_0xe6b1('0x7e'),'message':_0x4d7ec6[_0xe6b1('0x27')]},client9002)['then'](function(){return _0x4d7ec6;});}return _0x4d7ec6;}return null;})[_0xe6b1('0x35')](respondWithResult(_0x3520a7,null))[_0xe6b1('0x28')](handleError(_0x3520a7,null));};var interaction_log=require(_0xe6b1('0x13'))(_0xe6b1('0x5e'));exports[_0xe6b1('0x32')]=function(_0x4b20a2,_0x156cb4,_0x3c814c){var _0x351f70={'agent':{},'channel':_0xe6b1('0x60')};if(_0x4b20a2[_0xe6b1('0x5c')]['id']){delete _0x4b20a2[_0xe6b1('0x5c')]['id'];}_0x4b20a2[_0xe6b1('0x5c')][_0xe6b1('0x63')]=_0x4b20a2[_0xe6b1('0x5c')][_0xe6b1('0x63')]||_0x4b20a2[_0xe6b1('0x6a')]['id'];_0x351f70['agent']['id']=_0x4b20a2[_0xe6b1('0x5c')][_0xe6b1('0x63')];return db[_0xe6b1('0x3d')][_0xe6b1('0x5b')]({'where':{'id':_0x4b20a2['params']['id'],'UserId':null}})[_0xe6b1('0x35')](handleEntityNotFound(_0x156cb4,null))[_0xe6b1('0x35')](function(_0x3a1797){if(_0x3a1797){_0x351f70[_0xe6b1('0x27')]=_0x3a1797[_0xe6b1('0x65')]({'plain':!![]});return db[_0xe6b1('0x66')][_0xe6b1('0x5b')]({'where':{'id':_0x3a1797[_0xe6b1('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x156cb4,null))[_0xe6b1('0x35')](function(_0x1beffe){if(_0x1beffe){_0x351f70['interaction']=_0x1beffe[_0xe6b1('0x65')]({'plain':!![]});interaction_log[_0xe6b1('0x21')](_0xe6b1('0x7f'),_0x4b20a2['user']['id'],_0x4b20a2[_0xe6b1('0x6a')][_0xe6b1('0x3a')],_0x4b20a2['user'][_0xe6b1('0x80')],_0x351f70[_0xe6b1('0x69')]['id'],_0x4b20a2[_0xe6b1('0x5c')]?JSON[_0xe6b1('0x6b')](_0x4b20a2[_0xe6b1('0x5c')]):_0xe6b1('0x6c'));return respondWithRpcPromise(_0xe6b1('0x81'),_0xe6b1('0x82'),_0x351f70);}return null;})['then'](function(_0x342145){var _0x264046=_0xe6b1('0x6f')+_0x342145[_0xe6b1('0x27')]['ContactId'];return db[_0xe6b1('0x71')][_0xe6b1('0x44')](_0x264046,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xe6b1('0x35')](function(_0x443062){return _0x443062;});})[_0xe6b1('0x35')](function(_0x349ebf){if(_0x349ebf){_0x351f70['message'][_0xe6b1('0x74')]=_0x349ebf[0x0];if(!_0x4b20a2[_0xe6b1('0x5c')][_0xe6b1('0x63')])return;return db[_0xe6b1('0x75')][_0xe6b1('0x5b')]({'where':{'id':_0x4b20a2['body'][_0xe6b1('0x63')],'role':'agent'},'attributes':['id',_0xe6b1('0x3a'),_0xe6b1('0x83'),'email',_0xe6b1('0x77')],'raw':!![]});}return null;})[_0xe6b1('0x35')](function(_0x3d2bcd){if(!_0x3d2bcd)return null;_0x351f70[_0xe6b1('0x27')]['agent']=_0x3d2bcd;return _0x351f70;})[_0xe6b1('0x35')](function(_0x4bde72){if(_0x4bde72){_0x4bde72[_0xe6b1('0x27')][_0xe6b1('0x84')]=util['format'](_0xe6b1('0x79'),_0x4b20a2[_0xe6b1('0x6a')]['name']);_0x4bde72[_0xe6b1('0x27')]['channel']=_0x351f70[_0xe6b1('0x7a')];_0x4bde72[_0xe6b1('0x27')][_0xe6b1('0x7b')]=_0x351f70[_0xe6b1('0x7a')];_0x4bde72[_0xe6b1('0x27')][_0xe6b1('0x7c')]=_0xe6b1('0x32');respondWithRpcPromise(_0xe6b1('0x7d'),_0xe6b1('0x7d'),{'event':'rejectmessage','message':_0x4bde72['message']},client9002);return _0x351f70;}return null;})[_0xe6b1('0x35')](respondWithResult(_0x156cb4,null))[_0xe6b1('0x28')](handleError(_0x156cb4,null));};exports['create']=function(_0x1fd1df,_0xa27962){var _0x3f6b33;return db['FaxMessage'][_0xe6b1('0x85')](_0x1fd1df[_0xe6b1('0x5c')],{})[_0xe6b1('0x35')](function(_0x42843a){_0x3f6b33=_0x42843a;return db[_0xe6b1('0x86')][_0xe6b1('0x87')]({'where':{'id':_0x3f6b33['ContactId']}});})[_0xe6b1('0x35')](function(_0x298978){if(_['isNil'](_0x298978)){return;}else{_0x3f6b33['fax']=_0x298978[_0xe6b1('0x60')];return db[_0xe6b1('0x88')]['findOne']({'where':{'id':_0x3f6b33[_0xe6b1('0x89')]}});}})[_0xe6b1('0x35')](function(_0x38eb76){return respondWithRpcPromise(_0xe6b1('0x8a'),'SendFax',{'FaxAccountId':_[_0xe6b1('0x8b')](_0x1fd1df[_0xe6b1('0x5c')])?undefined:_0x1fd1df[_0xe6b1('0x5c')][_0xe6b1('0x8c')],'path':_['isNil'](_0x38eb76)?undefined:util[_0xe6b1('0x62')](_0xe6b1('0x8d'),_0x38eb76[_0xe6b1('0x8e')]),'fax':_[_0xe6b1('0x8b')](_0x3f6b33[_0xe6b1('0x60')])?undefined:_0x3f6b33['fax'],'AttachmentId':_0x3f6b33[_0xe6b1('0x89')]},client9002);})[_0xe6b1('0x35')](respondWithResult(_0xa27962,0xc9))['catch'](handleError(_0xa27962,null));};exports[_0xe6b1('0x8f')]=function(_0x369371,_0x18d5ac){var _0x3abd65=path[_0xe6b1('0x90')](config['root'],'server',_0xe6b1('0x91'),_0xe6b1('0x92'));return db['FaxMessage'][_0xe6b1('0x5b')]({'where':{'id':_0x369371['params']['id']},'include':[{'model':db[_0xe6b1('0x88')],'as':_0xe6b1('0x88')}]})[_0xe6b1('0x35')](handleEntityNotFound(_0x18d5ac,null))[_0xe6b1('0x35')](function(_0x14f1a1){if(_0x14f1a1){return _0x18d5ac[_0xe6b1('0x8f')](path[_0xe6b1('0x90')](_0x3abd65,_0x14f1a1[_0xe6b1('0x88')]['basename']));}})[_0xe6b1('0x28')](handleError(_0x18d5ac,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 569eb84..ab79151 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 _0xf3fe=['save','update','emit','hook','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0xaeaf7f,_0x362d18){var _0x5d0633=function(_0x45e92a){while(--_0x45e92a){_0xaeaf7f['push'](_0xaeaf7f['shift']());}};_0x5d0633(++_0x362d18);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x24e8c8,_0x5ea1fc){_0x24e8c8=_0x24e8c8-0x0;var _0x4bd3e9=_0xf3fe[_0x24e8c8];return _0x4bd3e9;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xef3f('0x0'))['db'][_0xef3f('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xef3f('0x2')](0x0);var events={'afterCreate':_0xef3f('0x3'),'afterUpdate':_0xef3f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29b501){return function(_0x18a97c,_0x171ff9,_0x431bc5){FaxMessageEvents[_0xef3f('0x5')](_0x29b501+':'+_0x18a97c['id'],_0x18a97c);FaxMessageEvents['emit'](_0x29b501,_0x18a97c);_0x431bc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xef3f('0x6')](e,emitEvent(event));}}module[_0xef3f('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x5d58=['hook','update','remove','emit','hasOwnProperty'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x5d58,0x187));var _0x85d5=function(_0x56411f,_0x520eb1){_0x56411f=_0x56411f-0x0;var _0xed7be4=_0x5d58[_0x56411f];return _0xed7be4;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x85d5('0x0'),'afterDestroy':_0x85d5('0x1')};function emitEvent(_0x53ca58){return function(_0x1469fc,_0x30bfe8,_0x54207b){FaxMessageEvents[_0x85d5('0x2')](_0x53ca58+':'+_0x1469fc['id'],_0x1469fc);FaxMessageEvents[_0x85d5('0x2')](_0x53ca58,_0x1469fc);_0x54207b(null);};}for(var e in events){if(events[_0x85d5('0x3')](e)){var event=events[e];FaxMessage[_0x85d5('0x4')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 59898c9..ef3f41f 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 _0x9559=['direction','secret','isNil','UserId','then','error','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','define','fti_fax_messages','FULLTEXT','models','get','toLowerCase'];(function(_0x30aadd,_0x20a265){var _0x428865=function(_0x40e630){while(--_0x40e630){_0x30aadd['push'](_0x30aadd['shift']());}};_0x428865(++_0x20a265);}(_0x9559,0xfe));var _0x9955=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x9559[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require(_0x9955('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9955('0x1'));var BPromise=require(_0x9955('0x2'));var rp=require(_0x9955('0x3'));var fs=require('fs');var path=require(_0x9955('0x4'));var rimraf=require(_0x9955('0x5'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module['exports']=function(_0x2a1932,_0x21d3b7){return _0x2a1932[_0x9955('0x6')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x9955('0x7'),'fields':['body'],'type':_0x9955('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1df2db,_0x2cd3c1,_0x8bba94){var _0x1cd21f=_0x2a1932[_0x9955('0x9')];var _0x196c30=_0x1df2db[_0x9955('0xa')]({'plain':!![]});if(_0x196c30['direction'][_0x9955('0xb')]()==='in'||_0x196c30[_0x9955('0xc')][_0x9955('0xb')]()==='out'&&!_0x196c30[_0x9955('0xd')]&&!_[_0x9955('0xe')](_0x196c30[_0x9955('0xf')])){_0x1cd21f['FaxInteraction']['findOne']({'where':{'id':_0x196c30['FaxInteractionId']}})[_0x9955('0x10')](function(_0x69a810){if(_0x69a810){_0x69a810['update']({'lastMsgAt':_0x196c30['createdAt'],'lastMsgDirection':_0x196c30[_0x9955('0xc')][_0x9955('0xb')]()});}})['catch'](function(_0x5175a0){console[_0x9955('0x11')](_0x5175a0);});}_0x8bba94();}},'charset':'utf8mb4','collate':_0x9955('0x12')});}; \ No newline at end of file +var _0x30f3=['../../config/environment','define','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','UserId','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path'];(function(_0xb14b26,_0x38cf9f){var _0xfdb28a=function(_0x380d1c){while(--_0x380d1c){_0xb14b26['push'](_0xb14b26['shift']());}};_0xfdb28a(++_0x38cf9f);}(_0x30f3,0x8a));var _0x330f=function(_0x2ecb26,_0x3db364){_0x2ecb26=_0x2ecb26-0x0;var _0x18e39a=_0x30f3[_0x2ecb26];return _0x18e39a;};'use strict';var _=require(_0x330f('0x0'));var util=require(_0x330f('0x1'));var logger=require('../../config/logger')(_0x330f('0x2'));var moment=require(_0x330f('0x3'));var BPromise=require('bluebird');var rp=require(_0x330f('0x4'));var fs=require('fs');var path=require(_0x330f('0x5'));var rimraf=require('rimraf');var config=require(_0x330f('0x6'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x3e0618,_0x5b4019){return _0x3e0618[_0x330f('0x7')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x330f('0x8'),'fields':[_0x330f('0x9')],'type':_0x330f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33468a,_0x1ffe0b,_0x13e799){var _0x19be87=_0x3e0618[_0x330f('0xb')];var _0x5a761e=_0x33468a[_0x330f('0xc')]({'plain':!![]});if(_0x5a761e[_0x330f('0xd')][_0x330f('0xe')]()==='in'||_0x5a761e[_0x330f('0xd')]['toLowerCase']()==='out'&&!_0x5a761e['secret']&&!_['isNil'](_0x5a761e[_0x330f('0xf')])){_0x19be87['FaxInteraction'][_0x330f('0x10')]({'where':{'id':_0x5a761e[_0x330f('0x11')]}})[_0x330f('0x12')](function(_0x317ae7){if(_0x317ae7){_0x317ae7['update']({'lastMsgAt':_0x5a761e[_0x330f('0x13')],'lastMsgDirection':_0x5a761e[_0x330f('0xd')][_0x330f('0xe')]()});}})[_0x330f('0x14')](function(_0x54219c){console[_0x330f('0x15')](_0x54219c);});}_0x13e799();}},'charset':_0x330f('0x16'),'collate':_0x330f('0x17')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 214b5eb..122221a 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 _0xfd28=['message','info','catch','create','body','options','then','CreateFaxMessage','UpdateFaxMessage','FaxMessage','raw','where','attributes','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1cdc0c,_0x29b3e7){var _0x4e659d=function(_0xdcb039){while(--_0xdcb039){_0x1cdc0c['push'](_0x1cdc0c['shift']());}};_0x4e659d(++_0x29b3e7);}(_0xfd28,0x148));var _0x8fd2=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xfd28[_0x576d8a];return _0x3dc3ef;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});config[_0x8fd2('0xa')]=_['defaults'](config['redis'],{'host':_0x8fd2('0xb'),'port':0x18eb});var socket=require(_0x8fd2('0xc'))(new Redis(config[_0x8fd2('0xa')]));require('./faxMessage.socket')[_0x8fd2('0xd')](socket);function respondWithRpcPromise(_0x49ca87,_0x2842f3,_0x5aabf0){return new BPromise(function(_0x34ae5c,_0x4fdf0b){return client[_0x8fd2('0xe')](_0x49ca87,_0x5aabf0)['then'](function(_0x1b6558){logger['info'](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));logger[_0x8fd2('0x11')](_0x8fd2('0x12'),_0x2842f3,_0x8fd2('0x10'),JSON[_0x8fd2('0x13')](_0x1b6558));if(_0x1b6558[_0x8fd2('0x14')]){if(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x15')]===0x1f4){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);return _0x4fdf0b(_0x1b6558[_0x8fd2('0x14')][_0x8fd2('0x16')]);}logger['error'](_0x8fd2('0xf'),_0x2842f3,_0x1b6558['error']['message']);return _0x34ae5c(_0x1b6558['error'][_0x8fd2('0x16')]);}else{logger[_0x8fd2('0x17')](_0x8fd2('0xf'),_0x2842f3,_0x8fd2('0x10'));_0x34ae5c(_0x1b6558['result'][_0x8fd2('0x16')]);}})[_0x8fd2('0x18')](function(_0x411943){logger[_0x8fd2('0x14')](_0x8fd2('0xf'),_0x2842f3,_0x411943);_0x4fdf0b(_0x411943);});});}exports['CreateFaxMessage']=function(_0x48ad51){var _0x3a0939=this;return new Promise(function(_0x4a2002,_0x3c03de){return db['FaxMessage'][_0x8fd2('0x19')](_0x48ad51[_0x8fd2('0x1a')],{'raw':_0x48ad51['options']?_0x48ad51[_0x8fd2('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8fd2('0x1c')](function(_0x44ee7a){logger['info'](_0x8fd2('0x1d'),_0x48ad51);logger[_0x8fd2('0x11')](_0x8fd2('0x1d'),_0x48ad51,JSON['stringify'](_0x44ee7a));_0x4a2002(_0x44ee7a);})[_0x8fd2('0x18')](function(_0x3b9e2f){logger[_0x8fd2('0x14')](_0x8fd2('0x1d'),_0x3b9e2f[_0x8fd2('0x16')],_0x48ad51);_0x3c03de(_0x3a0939[_0x8fd2('0x14')](0x1f4,_0x3b9e2f[_0x8fd2('0x16')]));});});};exports[_0x8fd2('0x1e')]=function(_0x1456b4){var _0xbc5945=this;return new Promise(function(_0x3392fb,_0x1f3237){return db[_0x8fd2('0x1f')]['update'](_0x1456b4['body'],{'raw':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1456b4['options']?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x21')]||null:null,'attributes':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')][_0x8fd2('0x22')]||null:null,'limit':_0x1456b4[_0x8fd2('0x1b')]?_0x1456b4[_0x8fd2('0x1b')]['limit']||null:null})[_0x8fd2('0x1c')](function(_0x13c9b9){logger[_0x8fd2('0x17')](_0x8fd2('0x1e'),_0x1456b4);logger[_0x8fd2('0x11')](_0x8fd2('0x1e'),_0x1456b4,JSON[_0x8fd2('0x13')](_0x13c9b9));_0x3392fb(_0x13c9b9);})['catch'](function(_0x5b992a){logger['error'](_0x8fd2('0x1e'),_0x5b992a[_0x8fd2('0x16')],_0x1456b4);_0x1f3237(_0xbc5945[_0x8fd2('0x14')](0x1f4,_0x5b992a[_0x8fd2('0x16')]));});});}; \ No newline at end of file +var _0x0a9a=['error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','CreateFaxMessage','debug','UpdateFaxMessage','update','raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5be600,_0x4e5f5d){var _0x248085=function(_0x314352){while(--_0x314352){_0x5be600['push'](_0x5be600['shift']());}};_0x248085(++_0x4e5f5d);}(_0x0a9a,0x183));var _0xa0a9=function(_0x24d65f,_0xbda6fb){_0x24d65f=_0x24d65f-0x0;var _0x3073c8=_0x0a9a[_0x24d65f];return _0x3073c8;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});config[_0xa0a9('0xa')]=_['defaults'](config[_0xa0a9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xb'))(new Redis(config[_0xa0a9('0xa')]));require(_0xa0a9('0xc'))[_0xa0a9('0xd')](socket);function respondWithRpcPromise(_0x4b9b93,_0x2ba0ac,_0x1b5bfb){return new BPromise(function(_0x5ce7e9,_0x5909cf){return client[_0xa0a9('0xe')](_0x4b9b93,_0x1b5bfb)[_0xa0a9('0xf')](function(_0x51d5a5){logger[_0xa0a9('0x10')]('FaxMessage,\x20%s,\x20%s',_0x2ba0ac,_0xa0a9('0x11'));logger['debug'](_0xa0a9('0x12'),_0x2ba0ac,_0xa0a9('0x11'),JSON[_0xa0a9('0x13')](_0x51d5a5));if(_0x51d5a5[_0xa0a9('0x14')]){if(_0x51d5a5[_0xa0a9('0x14')]['code']===0x1f4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);return _0x5909cf(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}logger['error'](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5['error']['message']);return _0x5ce7e9(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}else{logger[_0xa0a9('0x10')](_0xa0a9('0x15'),_0x2ba0ac,'request\x20sent');_0x5ce7e9(_0x51d5a5[_0xa0a9('0x17')][_0xa0a9('0x16')]);}})[_0xa0a9('0x18')](function(_0x27f8d4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x27f8d4);_0x5909cf(_0x27f8d4);});});}exports['CreateFaxMessage']=function(_0x3cdd8c){var _0x3107ce=this;return new Promise(function(_0x4a8e80,_0x53b99d){return db[_0xa0a9('0x19')][_0xa0a9('0x1a')](_0x3cdd8c[_0xa0a9('0x1b')],{'raw':_0x3cdd8c['options']?_0x3cdd8c[_0xa0a9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa0a9('0xf')](function(_0x5e6148){logger[_0xa0a9('0x10')](_0xa0a9('0x1d'),_0x3cdd8c);logger[_0xa0a9('0x1e')](_0xa0a9('0x1d'),_0x3cdd8c,JSON['stringify'](_0x5e6148));_0x4a8e80(_0x5e6148);})[_0xa0a9('0x18')](function(_0x4fb909){logger[_0xa0a9('0x14')](_0xa0a9('0x1d'),_0x4fb909[_0xa0a9('0x16')],_0x3cdd8c);_0x53b99d(_0x3107ce[_0xa0a9('0x14')](0x1f4,_0x4fb909['message']));});});};exports[_0xa0a9('0x1f')]=function(_0xe49d3b){var _0x384cd5=this;return new Promise(function(_0x3f4bea,_0x526dd1){return db[_0xa0a9('0x19')][_0xa0a9('0x20')](_0xe49d3b[_0xa0a9('0x1b')],{'raw':_0xe49d3b['options']?_0xe49d3b['options'][_0xa0a9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x22')]||null:null,'attributes':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x23')]||null:null,'limit':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x24')]||null:null})[_0xa0a9('0xf')](function(_0x554191){logger[_0xa0a9('0x10')](_0xa0a9('0x1f'),_0xe49d3b);logger['debug'](_0xa0a9('0x1f'),_0xe49d3b,JSON[_0xa0a9('0x13')](_0x554191));_0x3f4bea(_0x554191);})['catch'](function(_0x47c19b){logger[_0xa0a9('0x14')]('UpdateFaxMessage',_0x47c19b['message'],_0xe49d3b);_0x526dd1(_0x384cd5[_0xa0a9('0x14')](0x1f4,_0x47c19b[_0xa0a9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1cb6f5e..3034f3d 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 _0x067e=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x2902c2,_0x40150){var _0x16f4fb=function(_0x1ccb58){while(--_0x1ccb58){_0x2902c2['push'](_0x2902c2['shift']());}};_0x16f4fb(++_0x40150);}(_0x067e,0x9d));var _0xe067=function(_0x4ac64b,_0x2d185a){_0x4ac64b=_0x4ac64b-0x0;var _0x35dd8a=_0x067e[_0x4ac64b];return _0x35dd8a;};'use strict';var FaxMessageEvents=require(_0xe067('0x0'));var events=[_0xe067('0x1'),_0xe067('0x2'),_0xe067('0x3')];function createListener(_0x1e9487,_0x298e03){return function(_0x263231){_0x298e03[_0xe067('0x4')](_0x1e9487,_0x263231);};}function removeListener(_0x21ad0b,_0x17ef9c){return function(){FaxMessageEvents[_0xe067('0x5')](_0x21ad0b,_0x17ef9c);};}exports[_0xe067('0x6')]=function(_0x642e07){for(var _0x11649a=0x0,_0x4a6fd1=events[_0xe067('0x7')];_0x11649a<_0x4a6fd1;_0x11649a++){var _0x59e2a4=events[_0x11649a];var _0x58b065=createListener(_0xe067('0x8')+_0x59e2a4,_0x642e07);FaxMessageEvents['on'](_0x59e2a4,_0x58b065);}}; \ No newline at end of file +var _0x2a0f=['save','remove','update','removeListener','register','length','./faxMessage.events'];(function(_0x57ceef,_0x49cb02){var _0x2714d1=function(_0x41cf39){while(--_0x41cf39){_0x57ceef['push'](_0x57ceef['shift']());}};_0x2714d1(++_0x49cb02);}(_0x2a0f,0x195));var _0xf2a0=function(_0x1655e9,_0x40634a){_0x1655e9=_0x1655e9-0x0;var _0x3826b9=_0x2a0f[_0x1655e9];return _0x3826b9;};'use strict';var FaxMessageEvents=require(_0xf2a0('0x0'));var events=[_0xf2a0('0x1'),_0xf2a0('0x2'),_0xf2a0('0x3')];function createListener(_0xd75010,_0x58d805){return function(_0x633e58){_0x58d805['emit'](_0xd75010,_0x633e58);};}function removeListener(_0x59b71a,_0x517000){return function(){FaxMessageEvents[_0xf2a0('0x4')](_0x59b71a,_0x517000);};}exports[_0xf2a0('0x5')]=function(_0x12e9e2){for(var _0x567fcd=0x0,_0x55c49c=events[_0xf2a0('0x6')];_0x567fcd<_0x55c49c;_0x567fcd++){var _0x4324a3=events[_0x567fcd];var _0x17ffb8=createListener('faxMessage:'+_0x4324a3,_0x12e9e2);FaxMessageEvents['on'](_0x4324a3,_0x17ffb8);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 6fef583..bc4a02d 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 _0xe13a=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/reject','reject','delete','exports','util','path'];(function(_0x411112,_0x5a0d96){var _0x320ead=function(_0x29f5bc){while(--_0x29f5bc){_0x411112['push'](_0x411112['shift']());}};_0x320ead(++_0x5a0d96);}(_0xe13a,0x178));var _0xae13=function(_0x300193,_0x55082f){_0x300193=_0x300193-0x0;var _0xefd694=_0xe13a[_0x300193];return _0xefd694;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require(_0xae13('0x4'));var auth=require(_0xae13('0x5'));var interaction=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var controller=require(_0xae13('0x8'));router[_0xae13('0x9')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xb')]);router[_0xae13('0x9')]('/describe',auth[_0xae13('0xa')](),controller[_0xae13('0xc')]);router[_0xae13('0x9')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0xe')]);router[_0xae13('0x9')](_0xae13('0xf'),auth[_0xae13('0xa')](),controller['download']);router[_0xae13('0x10')]('/',auth[_0xae13('0xa')](),interaction[_0xae13('0x11')](_0xae13('0x12'),_0xae13('0x13')),controller[_0xae13('0x14')]);router[_0xae13('0x15')]('/:id',auth[_0xae13('0xa')](),controller[_0xae13('0x16')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put'](_0xae13('0x17'),auth[_0xae13('0xa')](),controller[_0xae13('0x18')]);router[_0xae13('0x19')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller['destroy']);module[_0xae13('0x1a')]=router; \ No newline at end of file +var _0x41bb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','connect-timeout'];(function(_0x20d15c,_0x13c52c){var _0x1f8360=function(_0x3ded31){while(--_0x3ded31){_0x20d15c['push'](_0x20d15c['shift']());}};_0x1f8360(++_0x13c52c);}(_0x41bb,0xc5));var _0xb41b=function(_0x501ea2,_0x1a4bc7){_0x501ea2=_0x501ea2-0x0;var _0x430c98=_0x41bb[_0x501ea2];return _0x430c98;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0x8')](_0xb41b('0xd'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router['post']('/',auth[_0xb41b('0x9')](),interaction['tracked'](_0xb41b('0xf'),_0xb41b('0x10')),controller[_0xb41b('0x11')]);router[_0xb41b('0x12')](_0xb41b('0xb'),auth['isAuthenticated'](),controller[_0xb41b('0x13')]);router[_0xb41b('0x12')](_0xb41b('0x14'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb41b('0x16')]);router[_0xb41b('0x17')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 5ccbfc2..bf3bb86 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 _0xc7bd=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','INTEGER'];(function(_0x115607,_0x1a0902){var _0x26ded0=function(_0xc1daec){while(--_0xc1daec){_0x115607['push'](_0x115607['shift']());}};_0x26ded0(++_0x1a0902);}(_0xc7bd,0x170));var _0xdc7b=function(_0x407eda,_0x3e27e4){_0x407eda=_0x407eda-0x0;var _0x56d633=_0xc7bd[_0x407eda];return _0x56d633;};'use strict';var Sequelize=require(_0xdc7b('0x0'));module[_0xdc7b('0x1')]={'name':{'type':Sequelize[_0xdc7b('0x2')],'unique':_0xdc7b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc7b('0x4')](_0xdc7b('0x5'),_0xdc7b('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdc7b('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdce9=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3ba813,_0x4acfd9){var _0x499b77=function(_0x1aaef8){while(--_0x1aaef8){_0x3ba813['push'](_0x3ba813['shift']());}};_0x499b77(++_0x4acfd9);}(_0xdce9,0x1e5));var _0x9dce=function(_0x201e78,_0x5766f3){_0x201e78=_0x201e78-0x0;var _0x8ab168=_0xdce9[_0x201e78];return _0x8ab168;};'use strict';var Sequelize=require(_0x9dce('0x0'));module[_0x9dce('0x1')]={'name':{'type':Sequelize[_0x9dce('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9dce('0x2')]},'timeout':{'type':Sequelize[_0x9dce('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9dce('0x4')](_0x9dce('0x5'),_0x9dce('0x6'),_0x9dce('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9dce('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 cf0d823..58a5b94 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 _0x4bd3=['addAgents','spread','isArray','getAgents','order','nolimit','bluebird','lodash','squel','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','get','FaxQueues','UserProfileResource','destroy','end','name','send','index','FaxQueue','rawAttributes','fieldName','key','getOptions','where','include','query','rows','model','keys','filters','attributes','fields','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','intersection','length','sort','pick','FaxQueueId','map','UserFaxQueue','findAll','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','filter','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4bd3,0x174));var _0x34bd=function(_0x3f3d5b,_0x973002){_0x3f3d5b=_0x3f3d5b-0x0;var _0x3a09be=_0x4bd3[_0x3f3d5b];return _0x3a09be;};'use strict';var BPromise=require(_0x34bd('0x0'));var util=require('util');var _=require(_0x34bd('0x1'));var squel=require(_0x34bd('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x34bd('0x3'));var config=require(_0x34bd('0x4'));var db=require(_0x34bd('0x5'))['db'];config['redis']=_[_0x34bd('0x6')](config[_0x34bd('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x34bd('0x8'))(new Redis(config[_0x34bd('0x7')]));require('./faxQueue.socket')[_0x34bd('0x9')](socket);function respondWithStatusCode(_0x76de8d,_0x3260ff){_0x3260ff=_0x3260ff||0xcc;return function(_0xed6181){if(_0xed6181){return _0x76de8d[_0x34bd('0xa')](_0x3260ff);}return _0x76de8d[_0x34bd('0xb')](_0x3260ff)['end']();};}function respondWithResult(_0x4102c1,_0x45322f){_0x45322f=_0x45322f||0xc8;return function(_0x282ea6){if(_0x282ea6){return _0x4102c1[_0x34bd('0xb')](_0x45322f)['json'](_0x282ea6);}};}function respondWithFilteredResult(_0x4a8622,_0x3da7a0){return function(_0x5e4ce7){if(_0x5e4ce7){var _0x4ac0dc=typeof _0x3da7a0[_0x34bd('0xc')]===_0x34bd('0xd')&&typeof _0x3da7a0[_0x34bd('0xe')]===_0x34bd('0xd');var _0x2ee180=_0x5e4ce7[_0x34bd('0xf')];var _0x4134ee=_0x4ac0dc?0x0:_0x3da7a0[_0x34bd('0xc')];var _0xf6d2f2=_0x4ac0dc?_0x5e4ce7['count']:_0x3da7a0[_0x34bd('0xc')]+_0x3da7a0['limit'];var _0x4e3886;if(_0xf6d2f2>=_0x2ee180){_0xf6d2f2=_0x2ee180;_0x4e3886=0xc8;}else{_0x4e3886=0xce;}_0x4a8622[_0x34bd('0xb')](_0x4e3886);return _0x4a8622[_0x34bd('0x10')](_0x34bd('0x11'),_0x4134ee+'-'+_0xf6d2f2+'/'+_0x2ee180)[_0x34bd('0x12')](_0x5e4ce7);}return null;};}function saveUpdates(_0x34b91b){return function(_0x1643af){if(_0x1643af){return _0x1643af[_0x34bd('0x13')](_0x34b91b)[_0x34bd('0x14')](function(_0x3b4bf8){return _0x3b4bf8;});}return null;};}function removeEntity(_0x72b197){return function(_0x4b5ebb){if(_0x4b5ebb){return _0x4b5ebb['destroy']()[_0x34bd('0x14')](function(){var _0x324f7d=_0x4b5ebb[_0x34bd('0x15')]({'plain':!![]});var _0x220666=_0x34bd('0x16');return db[_0x34bd('0x17')][_0x34bd('0x18')]({'where':{'type':_0x220666,'resourceId':_0x324f7d['id']}})[_0x34bd('0x14')](function(){return _0x4b5ebb;});})[_0x34bd('0x14')](function(){_0x72b197['status'](0xcc)[_0x34bd('0x19')]();});}};}function handleEntityNotFound(_0xe02cc5){return function(_0x49f625){if(!_0x49f625){_0xe02cc5[_0x34bd('0xa')](0x194);}return _0x49f625;};}function handleError(_0x463224,_0x5e0c06){_0x5e0c06=_0x5e0c06||0x1f4;return function(_0x582772){logger['error'](_0x582772['stack']);if(_0x582772[_0x34bd('0x1a')]){delete _0x582772['name'];}_0x463224[_0x34bd('0xb')](_0x5e0c06)[_0x34bd('0x1b')](_0x582772);};}exports[_0x34bd('0x1c')]=function(_0x5c3c85,_0x41bffd){var _0x14479a={};var _0x4f0dff={'count':0x0,'rows':[]};var _0x457006=_['map'](db[_0x34bd('0x1d')][_0x34bd('0x1e')],function(_0x264c94){return{'name':_0x264c94[_0x34bd('0x1f')],'type':_0x264c94['type'][_0x34bd('0x20')]};});_0x14479a=qs[_0x34bd('0x21')](_0x457006,_0x5c3c85);var _0x5d2e3d={'where':_0x14479a[_0x34bd('0x22')]};return db[_0x34bd('0x1d')][_0x34bd('0xf')](_0x5d2e3d)[_0x34bd('0x14')](function(_0x26b8e7){_0x4f0dff[_0x34bd('0xf')]=_0x26b8e7;_0x14479a[_0x34bd('0x23')]=qs['include'](_0x5c3c85[_0x34bd('0x24')]);return db[_0x34bd('0x1d')]['findAll'](_0x14479a);})['then'](function(_0x38bdba){_0x4f0dff[_0x34bd('0x25')]=_0x38bdba;return _0x4f0dff;})[_0x34bd('0x14')](respondWithFilteredResult(_0x41bffd,_0x14479a))['catch'](handleError(_0x41bffd,null));};exports['show']=function(_0x3cf514,_0x386ee6){var _0x1387b5={'raw':!![],'where':{'id':_0x3cf514['params']['id']}},_0x19eb5d={};_0x19eb5d[_0x34bd('0x26')]=_[_0x34bd('0x27')](db[_0x34bd('0x1d')][_0x34bd('0x1e')]);_0x19eb5d[_0x34bd('0x24')]=_[_0x34bd('0x27')](_0x3cf514['query']);_0x19eb5d[_0x34bd('0x28')]=_['intersection'](_0x19eb5d[_0x34bd('0x26')],_0x19eb5d[_0x34bd('0x24')]);_0x1387b5[_0x34bd('0x29')]=_['intersection'](_0x19eb5d[_0x34bd('0x26')],qs[_0x34bd('0x2a')](_0x3cf514['query'][_0x34bd('0x2a')]));_0x1387b5[_0x34bd('0x29')]=_0x1387b5[_0x34bd('0x29')]['length']?_0x1387b5[_0x34bd('0x29')]:_0x19eb5d[_0x34bd('0x26')];if(_0x3cf514['query'][_0x34bd('0x2b')]){_0x1387b5[_0x34bd('0x23')]=[{'all':!![]}];}_0x1387b5=_[_0x34bd('0x2c')]({},_0x1387b5,_0x3cf514[_0x34bd('0x2d')]);return db[_0x34bd('0x1d')][_0x34bd('0x2e')](_0x1387b5)['then'](handleEntityNotFound(_0x386ee6,null))['then'](respondWithResult(_0x386ee6,null))['catch'](handleError(_0x386ee6,null));};exports[_0x34bd('0x2f')]=function(_0x1258cf,_0x5e30c5){return db['FaxQueue'][_0x34bd('0x2f')](_0x1258cf['body'],{})['then'](function(_0x86b626){var _0xb5a456=_0x1258cf[_0x34bd('0x30')][_0x34bd('0x15')]({'plain':!![]});if(!_0xb5a456)throw new Error(_0x34bd('0x31'));if(_0xb5a456['role']==='user'){var _0xd4edfa=_0x86b626['get']({'plain':!![]});var _0xce6bc6=_0x34bd('0x16');return db[_0x34bd('0x32')][_0x34bd('0x2e')]({'where':{'name':_0xce6bc6,'userProfileId':_0xb5a456[_0x34bd('0x33')]},'raw':!![]})['then'](function(_0x282297){if(_0x282297&&_0x282297[_0x34bd('0x34')]===0x0){return db[_0x34bd('0x17')][_0x34bd('0x2f')]({'name':_0xd4edfa['name'],'resourceId':_0xd4edfa['id'],'type':_0x282297[_0x34bd('0x1a')],'sectionId':_0x282297['id']},{})['then'](function(){return _0x86b626;});}else{return _0x86b626;}})[_0x34bd('0x35')](function(_0x560282){logger['error'](_0x34bd('0x36'),_0x560282);throw _0x560282;});}return _0x86b626;})['then'](respondWithResult(_0x5e30c5,0xc9))[_0x34bd('0x35')](handleError(_0x5e30c5,null));};exports[_0x34bd('0x13')]=function(_0x18e9f6,_0x42a424){if(_0x18e9f6[_0x34bd('0x37')]['id']){delete _0x18e9f6[_0x34bd('0x37')]['id'];}return db[_0x34bd('0x1d')]['find']({'where':{'id':_0x18e9f6['params']['id']}})['then'](handleEntityNotFound(_0x42a424,null))[_0x34bd('0x14')](saveUpdates(_0x18e9f6[_0x34bd('0x37')],null))[_0x34bd('0x14')](respondWithResult(_0x42a424,null))[_0x34bd('0x35')](handleError(_0x42a424,null));};exports['destroy']=function(_0x412fa5,_0x148abe){return db[_0x34bd('0x1d')][_0x34bd('0x2e')]({'where':{'id':_0x412fa5[_0x34bd('0x38')]['id']}})['then'](handleEntityNotFound(_0x148abe,null))[_0x34bd('0x14')](removeEntity(_0x148abe,null))['catch'](handleError(_0x148abe,null));};exports['describe']=function(_0x1c637f,_0x53a114){return db[_0x34bd('0x1d')][_0x34bd('0x39')]()[_0x34bd('0x14')](respondWithResult(_0x53a114,null))[_0x34bd('0x35')](handleError(_0x53a114,null));};exports[_0x34bd('0x3a')]=function(_0x5b061a,_0x4d22ff){var _0x33e8e8={'raw':!![],'where':{}},_0x51f892={},_0x1f3db3;return db[_0x34bd('0x1d')][_0x34bd('0x3b')]({'where':{'id':_0x5b061a['params']['id']}})['then'](handleEntityNotFound(_0x4d22ff,null))['then'](function(_0x5a68f3){if(_0x5a68f3){_0x1f3db3=_0x5a68f3[_0x34bd('0x15')]({'plain':!![]});_0x51f892['model']=_[_0x34bd('0x27')](db['UserFaxQueue'][_0x34bd('0x1e')]);_0x51f892[_0x34bd('0x24')]=_[_0x34bd('0x27')](_0x5b061a[_0x34bd('0x24')]);_0x51f892[_0x34bd('0x28')]=_['intersection'](_0x51f892[_0x34bd('0x26')],_0x51f892[_0x34bd('0x24')]);_0x33e8e8[_0x34bd('0x29')]=_[_0x34bd('0x3c')](_0x51f892[_0x34bd('0x26')],qs['fields'](_0x5b061a[_0x34bd('0x24')][_0x34bd('0x2a')]));_0x33e8e8['attributes']=_0x33e8e8[_0x34bd('0x29')][_0x34bd('0x3d')]?_0x33e8e8['attributes']:_0x51f892['model'];if(!_0x5b061a[_0x34bd('0x24')]['hasOwnProperty']('nolimit')){_0x33e8e8[_0x34bd('0xe')]=qs[_0x34bd('0xe')](_0x5b061a['query']['limit']);_0x33e8e8['offset']=qs['offset'](_0x5b061a[_0x34bd('0x24')][_0x34bd('0xc')]);}_0x33e8e8['order']=qs['sort'](_0x5b061a['query'][_0x34bd('0x3e')]);_0x33e8e8[_0x34bd('0x22')]=qs['filters'](_[_0x34bd('0x3f')](_0x5b061a[_0x34bd('0x24')],_0x51f892[_0x34bd('0x28')]));_0x33e8e8[_0x34bd('0x22')][_0x34bd('0x40')]=_0x5a68f3['id'];if(_0x5b061a[_0x34bd('0x24')]['filter']){_0x33e8e8[_0x34bd('0x22')]=_[_0x34bd('0x2c')](_0x33e8e8[_0x34bd('0x22')],{'$or':_[_0x34bd('0x41')](_0x33e8e8['attributes'],function(_0x1b8b37){var _0x5235e4={};_0x5235e4[_0x1b8b37]={'$like':'%'+_0x5b061a[_0x34bd('0x24')]['filter']+'%'};return _0x5235e4;})});}_0x33e8e8=_[_0x34bd('0x2c')]({},_0x33e8e8,_0x5b061a[_0x34bd('0x2d')]);return db[_0x34bd('0x42')][_0x34bd('0x43')](_0x33e8e8);}})[_0x34bd('0x14')](function(_0x418fa5){if(_0x418fa5){return db[_0x34bd('0x44')][_0x34bd('0x45')]({'where':{'id':_[_0x34bd('0x41')](_0x418fa5,_0x34bd('0x46')),'role':_0x34bd('0x47')},'attributes':['id','name',_0x34bd('0x48'),'updatedAt',_0x34bd('0x49')]});}})['then'](function(_0x3fc297){if(_0x3fc297){return{'count':_0x3fc297['count'],'rows':_[_0x34bd('0x41')](_0x3fc297[_0x34bd('0x25')],function(_0x2da924){return{'membername':_0x2da924[_0x34bd('0x1a')],'UserId':_0x2da924['id'],'queue_name':_0x1f3db3[_0x34bd('0x1a')],'FaxQueueId':_0x1f3db3['id'],'interface':util[_0x34bd('0x4a')](_0x34bd('0x4b'),_0x34bd('0x4c'),_0x2da924[_0x34bd('0x1a')]),'penalty':0x0,'paused':_0x2da924[_0x34bd('0x48')],'createdAt':_0x2da924[_0x34bd('0x49')],'updatedAt':_0x2da924[_0x34bd('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x34bd('0x14')](respondWithFilteredResult(_0x4d22ff,_0x33e8e8))[_0x34bd('0x35')](handleError(_0x4d22ff,null));};exports[_0x34bd('0x4e')]=function(_0x4a0c28,_0x5c5766){var _0x246c52={};var _0x79e6b4={};var _0x352f17;var _0x3e8c8e;return db[_0x34bd('0x1d')]['findOne']({'where':{'id':_0x4a0c28['params']['id']}})['then'](handleEntityNotFound(_0x5c5766,null))['then'](function(_0x24c635){if(_0x24c635){_0x352f17=_0x24c635;_0x79e6b4[_0x34bd('0x26')]=_['keys'](db[_0x34bd('0x4f')][_0x34bd('0x1e')]);_0x79e6b4[_0x34bd('0x24')]=_['keys'](_0x4a0c28[_0x34bd('0x24')]);_0x79e6b4[_0x34bd('0x28')]=_[_0x34bd('0x3c')](_0x79e6b4[_0x34bd('0x26')],_0x79e6b4[_0x34bd('0x24')]);_0x246c52[_0x34bd('0x29')]=_[_0x34bd('0x3c')](_0x79e6b4[_0x34bd('0x26')],qs['fields'](_0x4a0c28['query'][_0x34bd('0x2a')]));_0x246c52['attributes']=_0x246c52[_0x34bd('0x29')][_0x34bd('0x3d')]?_0x246c52[_0x34bd('0x29')]:_0x79e6b4['model'];_0x246c52['order']=qs[_0x34bd('0x3e')](_0x4a0c28[_0x34bd('0x24')][_0x34bd('0x3e')]);_0x246c52['where']=qs['filters'](_[_0x34bd('0x3f')](_0x4a0c28[_0x34bd('0x24')],_0x79e6b4[_0x34bd('0x28')]));if(_0x4a0c28[_0x34bd('0x24')][_0x34bd('0x50')]){_0x246c52[_0x34bd('0x22')]=_[_0x34bd('0x2c')](_0x246c52[_0x34bd('0x22')],{'$or':_[_0x34bd('0x41')](_0x246c52['attributes'],function(_0x4d3118){var _0x3878a0={};_0x3878a0[_0x4d3118]={'$like':'%'+_0x4a0c28['query'][_0x34bd('0x50')]+'%'};return _0x3878a0;})});}_0x246c52=_[_0x34bd('0x2c')]({},_0x246c52,_0x4a0c28[_0x34bd('0x2d')]);return _0x352f17[_0x34bd('0x4e')](_0x246c52);}})['then'](function(_0x50ae2e){if(_0x50ae2e){_0x3e8c8e=_0x50ae2e[_0x34bd('0x3d')];if(!_0x4a0c28[_0x34bd('0x24')][_0x34bd('0x51')]('nolimit')){_0x246c52[_0x34bd('0xe')]=qs['limit'](_0x4a0c28[_0x34bd('0x24')][_0x34bd('0xe')]);_0x246c52[_0x34bd('0xc')]=qs['offset'](_0x4a0c28[_0x34bd('0x24')]['offset']);}return _0x352f17['getTeams'](_0x246c52);}})[_0x34bd('0x14')](function(_0x12ae13){if(_0x12ae13){return _0x12ae13?{'count':_0x3e8c8e,'rows':_0x12ae13}:null;}})[_0x34bd('0x14')](respondWithResult(_0x5c5766,null))['catch'](handleError(_0x5c5766,null));};exports[_0x34bd('0x52')]=function(_0x23ac17,_0xff33cb){var _0x50c5a2=_0x23ac17[_0x34bd('0x37')][_0x34bd('0x53')];return db[_0x34bd('0x4f')][_0x34bd('0x43')]({'where':{'id':_0x50c5a2},'attributes':['id'],'include':[{'model':db[_0x34bd('0x44')],'as':_0x34bd('0x54'),'attributes':['id',_0x34bd('0x1a'),_0x34bd('0x55'),_0x34bd('0x56'),_0x34bd('0x57')],'raw':!![]}]})[_0x34bd('0x14')](function(_0x59e377){if(_0x59e377){var _0x24e164=_['flatMap'](_0x59e377,function(_0x46e98d){var _0x51459d=_0x46e98d[_0x34bd('0x15')]({'plain':!![]});return _0x51459d[_0x34bd('0x54')];});return db[_0x34bd('0x1d')][_0x34bd('0x2e')]({'where':{'id':_0x23ac17[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](function(_0x27adad){return db[_0x34bd('0x58')][_0x34bd('0x59')](function(_0x23f5a6){return _0x27adad['addTeams'](_0x50c5a2,{'transaction':_0x23f5a6})['then'](function(){return BPromise[_0x34bd('0x5a')](_0x24e164,function(_0x31b313){return db[_0x34bd('0x42')]['findOrCreate']({'where':{'UserId':_0x31b313['id'],'FaxQueueId':_0x23ac17['params']['id']},'transaction':_0x23f5a6});});})['then'](function(){_0x24e164[_0x34bd('0x5b')](function(_0x190614){socket[_0x34bd('0x5c')](_0x34bd('0x5d'),{'UserId':_0x190614['id'],'FaxQueueId':_0x27adad['id']});});});});});}})[_0x34bd('0x14')](respondWithStatusCode(_0xff33cb,null))['catch'](handleError(_0xff33cb,null));};exports[_0x34bd('0x5e')]=function(_0x4d94d0,_0x4732f5){return db[_0x34bd('0x4f')]['findAll']({'where':{'id':_0x4d94d0[_0x34bd('0x24')]['ids']},'attributes':['id'],'include':[{'model':db[_0x34bd('0x44')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x34bd('0x14')](handleEntityNotFound(_0x4732f5,null))['then'](function(_0x397396){var _0x38f6f2=_[_0x34bd('0x41')](_0x397396,'id');var _0x35d257=[];var _0x2de8a0=[];var _0x34bb6d=squel[_0x34bd('0x5f')]();_0x34bb6d[_0x34bd('0x60')]('tq.TeamId')[_0x34bd('0x61')](_0x34bd('0x62'),'tq')[_0x34bd('0x63')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x34bd('0x64'),_0x4d94d0[_0x34bd('0x38')]['id']);for(var _0x56935e=0x0;_0x56935e<_0x397396[_0x34bd('0x3d')];_0x56935e+=0x1){let _0x5d0621=_0x397396[_0x56935e];for(var _0x2ccc12=0x0;_0x2ccc12<_0x5d0621[_0x34bd('0x54')][_0x34bd('0x3d')];_0x2ccc12+=0x1){let _0x4c6508=_0x5d0621[_0x34bd('0x54')][_0x2ccc12];var _0x4a05cb=_0x34bb6d[_0x34bd('0x65')]();_0x4a05cb[_0x34bd('0x22')](_0x34bd('0x66'),_0x4c6508['id']);_0x2de8a0[_0x34bd('0x67')](db[_0x34bd('0x58')][_0x34bd('0x24')](_0x4a05cb[_0x34bd('0x68')](),{'type':db[_0x34bd('0x58')][_0x34bd('0x69')][_0x34bd('0x6a')]})[_0x34bd('0x14')](function(_0x23ca28){if(_0x23ca28[_0x34bd('0x3d')]===0x1){return _0x4c6508['id'];}else{var _0x48d9b9=_['every'](_[_0x34bd('0x41')](_0x23ca28,_0x34bd('0x6b')),function(_0x19341e){return _[_0x34bd('0x6c')](_0x38f6f2,_0x19341e);});if(_0x48d9b9){return _0x4c6508['id'];}}}));}}return BPromise[_0x34bd('0x6d')](_0x2de8a0)['then'](function(_0x1799dd){_0x35d257=_(_0x35d257)[_0x34bd('0x6e')](_0x1799dd)[_0x34bd('0x6f')]()[_0x34bd('0x70')]();return db['FaxQueue'][_0x34bd('0x2e')]({'where':{'id':_0x4d94d0['params']['id']}})['then'](function(_0x49ba99){return db['sequelize'][_0x34bd('0x59')](function(_0x1a1111){return _0x49ba99[_0x34bd('0x5e')](_0x4d94d0['query'][_0x34bd('0x53')],{'transaction':_0x1a1111})[_0x34bd('0x14')](function(){if(!_[_0x34bd('0x71')](_0x35d257)){return _0x49ba99[_0x34bd('0x72')](_0x35d257,{'transaction':_0x1a1111});}})[_0x34bd('0x14')](function(){_0x35d257[_0x34bd('0x5b')](function(_0x4624fc){socket[_0x34bd('0x5c')](_0x34bd('0x73'),{'UserId':_0x4624fc,'FaxQueueId':_0x49ba99['id']});});});});});});})[_0x34bd('0x14')](respondWithStatusCode(_0x4732f5,null))[_0x34bd('0x35')](handleError(_0x4732f5,null));};exports['addAgents']=function(_0x5403fa,_0x26620a){return db['FaxQueue'][_0x34bd('0x2e')]({'where':{'id':_0x5403fa[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](handleEntityNotFound(_0x26620a,null))[_0x34bd('0x14')](function(_0x22aa49){if(_0x22aa49){return _0x22aa49[_0x34bd('0x74')](_0x5403fa[_0x34bd('0x37')][_0x34bd('0x53')],_['omit'](_0x5403fa[_0x34bd('0x37')],[_0x34bd('0x53'),'id'])||{})[_0x34bd('0x75')](function(_0x533f32){for(var _0x2b56eb=0x0;_0x2b56eb<_0x5403fa[_0x34bd('0x37')][_0x34bd('0x53')][_0x34bd('0x3d')];_0x2b56eb+=0x1){socket['emit'](_0x34bd('0x5d'),{'UserId':Number(_0x5403fa[_0x34bd('0x37')][_0x34bd('0x53')][_0x2b56eb]),'FaxQueueId':Number(_0x5403fa[_0x34bd('0x38')]['id'])});}return _0x533f32;});}})[_0x34bd('0x14')](respondWithResult(_0x26620a,null))[_0x34bd('0x35')](handleError(_0x26620a,null));};exports[_0x34bd('0x72')]=function(_0x193f37,_0x15651a){return db[_0x34bd('0x1d')]['find']({'where':{'id':_0x193f37[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](handleEntityNotFound(_0x15651a,null))[_0x34bd('0x14')](function(_0x1e9839){if(_0x1e9839){return _0x1e9839[_0x34bd('0x72')](_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')])[_0x34bd('0x14')](function(){if(_[_0x34bd('0x76')](_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')])){for(var _0x1d735f=0x0;_0x1d735f<_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')]['length'];_0x1d735f+=0x1){socket[_0x34bd('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')][_0x1d735f]),'FaxQueueId':Number(_0x193f37[_0x34bd('0x38')]['id'])});}}else{socket[_0x34bd('0x5c')](_0x34bd('0x73'),{'UserId':Number(_0x193f37[_0x34bd('0x24')][_0x34bd('0x53')]),'FaxQueueId':Number(_0x193f37[_0x34bd('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x15651a,null))[_0x34bd('0x35')](handleError(_0x15651a,null));};exports[_0x34bd('0x77')]=function(_0x3efd93,_0x4d510d){var _0x4519eb={};var _0x58d4b4={};var _0x288b12;var _0x44c6ae;return db['FaxQueue'][_0x34bd('0x3b')]({'where':{'id':_0x3efd93[_0x34bd('0x38')]['id']}})[_0x34bd('0x14')](handleEntityNotFound(_0x4d510d,null))[_0x34bd('0x14')](function(_0x2b8917){if(_0x2b8917){_0x288b12=_0x2b8917;_0x58d4b4['model']=_[_0x34bd('0x27')](db['User']['rawAttributes']);_0x58d4b4[_0x34bd('0x24')]=_[_0x34bd('0x27')](_0x3efd93[_0x34bd('0x24')]);_0x58d4b4['filters']=_[_0x34bd('0x3c')](_0x58d4b4['model'],_0x58d4b4[_0x34bd('0x24')]);_0x4519eb[_0x34bd('0x29')]=_['intersection'](_0x58d4b4['model'],qs['fields'](_0x3efd93[_0x34bd('0x24')][_0x34bd('0x2a')]));_0x4519eb['attributes']=_0x4519eb[_0x34bd('0x29')]['length']?_0x4519eb[_0x34bd('0x29')]:_0x58d4b4[_0x34bd('0x26')];_0x4519eb[_0x34bd('0x78')]=qs[_0x34bd('0x3e')](_0x3efd93[_0x34bd('0x24')][_0x34bd('0x3e')]);_0x4519eb[_0x34bd('0x22')]=qs[_0x34bd('0x28')](_['pick'](_0x3efd93[_0x34bd('0x24')],_0x58d4b4[_0x34bd('0x28')]));if(_0x3efd93[_0x34bd('0x24')][_0x34bd('0x50')]){_0x4519eb[_0x34bd('0x22')]=_[_0x34bd('0x2c')](_0x4519eb[_0x34bd('0x22')],{'$or':_[_0x34bd('0x41')](_0x4519eb[_0x34bd('0x29')],function(_0x7cf676){var _0x499703={};_0x499703[_0x7cf676]={'$like':'%'+_0x3efd93[_0x34bd('0x24')]['filter']+'%'};return _0x499703;})});}_0x4519eb=_['merge']({},_0x4519eb,_0x3efd93[_0x34bd('0x2d')]);return _0x288b12[_0x34bd('0x77')](_0x4519eb);}})[_0x34bd('0x14')](function(_0x19671c){if(_0x19671c){_0x44c6ae=_0x19671c['length'];if(!_0x3efd93[_0x34bd('0x24')][_0x34bd('0x51')](_0x34bd('0x79'))){_0x4519eb[_0x34bd('0xe')]=qs['limit'](_0x3efd93['query'][_0x34bd('0xe')]);_0x4519eb[_0x34bd('0xc')]=qs['offset'](_0x3efd93[_0x34bd('0x24')][_0x34bd('0xc')]);}return _0x288b12['getAgents'](_0x4519eb);}})[_0x34bd('0x14')](function(_0x268718){if(_0x268718){return _0x268718?{'count':_0x44c6ae,'rows':_0x268718}:null;}})[_0x34bd('0x14')](respondWithResult(_0x4d510d,null))[_0x34bd('0x35')](handleError(_0x4d510d,null));}; \ No newline at end of file +var _0x0a1c=['stack','name','send','index','map','FaxQueue','fieldName','type','getOptions','where','include','query','findAll','catch','show','model','keys','filters','attributes','intersection','fields','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','findOne','UserFaxQueue','hasOwnProperty','order','sort','pick','FaxQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','createdAt','getTeams','Team','rawAttributes','nolimit','addTeams','ids','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userFaxQueue:remove','getAgents','lodash','squel','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','error'];(function(_0x45e60e,_0x529bef){var _0x5717a5=function(_0x38d070){while(--_0x38d070){_0x45e60e['push'](_0x45e60e['shift']());}};_0x5717a5(++_0x529bef);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x0a1c[_0x11946c];return _0x383935;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xc0a1('0x0'));var squel=require(_0xc0a1('0x1'));var Redis=require(_0xc0a1('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc0a1('0x3'));var config=require(_0xc0a1('0x4'));var db=require(_0xc0a1('0x5'))['db'];config[_0xc0a1('0x6')]=_[_0xc0a1('0x7')](config[_0xc0a1('0x6')],{'host':_0xc0a1('0x8'),'port':0x18eb});var socket=require(_0xc0a1('0x9'))(new Redis(config[_0xc0a1('0x6')]));require(_0xc0a1('0xa'))[_0xc0a1('0xb')](socket);function respondWithStatusCode(_0x42c215,_0x14e116){_0x14e116=_0x14e116||0xcc;return function(_0x2cfd8a){if(_0x2cfd8a){return _0x42c215[_0xc0a1('0xc')](_0x14e116);}return _0x42c215[_0xc0a1('0xd')](_0x14e116)[_0xc0a1('0xe')]();};}function respondWithResult(_0x4a1238,_0x9457ef){_0x9457ef=_0x9457ef||0xc8;return function(_0x234f42){if(_0x234f42){return _0x4a1238[_0xc0a1('0xd')](_0x9457ef)['json'](_0x234f42);}};}function respondWithFilteredResult(_0x360dc4,_0x4683ab){return function(_0xd25ae5){if(_0xd25ae5){var _0x4d9b49=typeof _0x4683ab[_0xc0a1('0xf')]===_0xc0a1('0x10')&&typeof _0x4683ab['limit']===_0xc0a1('0x10');var _0x47887=_0xd25ae5[_0xc0a1('0x11')];var _0x395ade=_0x4d9b49?0x0:_0x4683ab[_0xc0a1('0xf')];var _0x517689=_0x4d9b49?_0xd25ae5['count']:_0x4683ab[_0xc0a1('0xf')]+_0x4683ab[_0xc0a1('0x12')];var _0x49a97c;if(_0x517689>=_0x47887){_0x517689=_0x47887;_0x49a97c=0xc8;}else{_0x49a97c=0xce;}_0x360dc4['status'](_0x49a97c);return _0x360dc4[_0xc0a1('0x13')](_0xc0a1('0x14'),_0x395ade+'-'+_0x517689+'/'+_0x47887)['json'](_0xd25ae5);}return null;};}function saveUpdates(_0x334cc4){return function(_0xcec062){if(_0xcec062){return _0xcec062[_0xc0a1('0x15')](_0x334cc4)[_0xc0a1('0x16')](function(_0x234067){return _0x234067;});}return null;};}function removeEntity(_0x124d0f){return function(_0x36620e){if(_0x36620e){return _0x36620e[_0xc0a1('0x17')]()[_0xc0a1('0x16')](function(){var _0x36acc2=_0x36620e[_0xc0a1('0x18')]({'plain':!![]});var _0x26ca3c=_0xc0a1('0x19');return db[_0xc0a1('0x1a')][_0xc0a1('0x17')]({'where':{'type':_0x26ca3c,'resourceId':_0x36acc2['id']}})[_0xc0a1('0x16')](function(){return _0x36620e;});})['then'](function(){_0x124d0f[_0xc0a1('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340d03){return function(_0xc9d7b0){if(!_0xc9d7b0){_0x340d03[_0xc0a1('0xc')](0x194);}return _0xc9d7b0;};}function handleError(_0x316f1a,_0x40eaa4){_0x40eaa4=_0x40eaa4||0x1f4;return function(_0x53b9ca){logger[_0xc0a1('0x1b')](_0x53b9ca[_0xc0a1('0x1c')]);if(_0x53b9ca[_0xc0a1('0x1d')]){delete _0x53b9ca[_0xc0a1('0x1d')];}_0x316f1a[_0xc0a1('0xd')](_0x40eaa4)[_0xc0a1('0x1e')](_0x53b9ca);};}exports[_0xc0a1('0x1f')]=function(_0x6b1ca5,_0x3e1a93){var _0x161bff={};var _0x5d9925={'count':0x0,'rows':[]};var _0x569816=_[_0xc0a1('0x20')](db[_0xc0a1('0x21')]['rawAttributes'],function(_0x52ba51){return{'name':_0x52ba51[_0xc0a1('0x22')],'type':_0x52ba51[_0xc0a1('0x23')]['key']};});_0x161bff=qs[_0xc0a1('0x24')](_0x569816,_0x6b1ca5);var _0x95b026={'where':_0x161bff[_0xc0a1('0x25')]};return db[_0xc0a1('0x21')][_0xc0a1('0x11')](_0x95b026)[_0xc0a1('0x16')](function(_0x114f76){_0x5d9925[_0xc0a1('0x11')]=_0x114f76;_0x161bff['include']=qs[_0xc0a1('0x26')](_0x6b1ca5[_0xc0a1('0x27')]);return db[_0xc0a1('0x21')][_0xc0a1('0x28')](_0x161bff);})[_0xc0a1('0x16')](function(_0x38750d){_0x5d9925['rows']=_0x38750d;return _0x5d9925;})['then'](respondWithFilteredResult(_0x3e1a93,_0x161bff))[_0xc0a1('0x29')](handleError(_0x3e1a93,null));};exports[_0xc0a1('0x2a')]=function(_0x5b7d77,_0xa341c0){var _0x4f1a93={'raw':!![],'where':{'id':_0x5b7d77['params']['id']}},_0x1e7317={};_0x1e7317[_0xc0a1('0x2b')]=_[_0xc0a1('0x2c')](db[_0xc0a1('0x21')]['rawAttributes']);_0x1e7317[_0xc0a1('0x27')]=_['keys'](_0x5b7d77[_0xc0a1('0x27')]);_0x1e7317[_0xc0a1('0x2d')]=_['intersection'](_0x1e7317[_0xc0a1('0x2b')],_0x1e7317[_0xc0a1('0x27')]);_0x4f1a93[_0xc0a1('0x2e')]=_[_0xc0a1('0x2f')](_0x1e7317[_0xc0a1('0x2b')],qs[_0xc0a1('0x30')](_0x5b7d77['query'][_0xc0a1('0x30')]));_0x4f1a93[_0xc0a1('0x2e')]=_0x4f1a93[_0xc0a1('0x2e')][_0xc0a1('0x31')]?_0x4f1a93[_0xc0a1('0x2e')]:_0x1e7317[_0xc0a1('0x2b')];if(_0x5b7d77['query']['includeAll']){_0x4f1a93[_0xc0a1('0x26')]=[{'all':!![]}];}_0x4f1a93=_[_0xc0a1('0x32')]({},_0x4f1a93,_0x5b7d77[_0xc0a1('0x33')]);return db['FaxQueue']['find'](_0x4f1a93)[_0xc0a1('0x16')](handleEntityNotFound(_0xa341c0,null))[_0xc0a1('0x16')](respondWithResult(_0xa341c0,null))[_0xc0a1('0x29')](handleError(_0xa341c0,null));};exports['create']=function(_0xc80b,_0x423da0){return db['FaxQueue'][_0xc0a1('0x34')](_0xc80b[_0xc0a1('0x35')],{})['then'](function(_0x3fa7cd){var _0x32f40b=_0xc80b[_0xc0a1('0x36')][_0xc0a1('0x18')]({'plain':!![]});if(!_0x32f40b)throw new Error(_0xc0a1('0x37'));if(_0x32f40b[_0xc0a1('0x38')]===_0xc0a1('0x36')){var _0x42309c=_0x3fa7cd['get']({'plain':!![]});var _0x498bf2=_0xc0a1('0x19');return db[_0xc0a1('0x39')]['find']({'where':{'name':_0x498bf2,'userProfileId':_0x32f40b[_0xc0a1('0x3a')]},'raw':!![]})[_0xc0a1('0x16')](function(_0x273b64){if(_0x273b64&&_0x273b64[_0xc0a1('0x3b')]===0x0){return db[_0xc0a1('0x1a')][_0xc0a1('0x34')]({'name':_0x42309c['name'],'resourceId':_0x42309c['id'],'type':_0x273b64[_0xc0a1('0x1d')],'sectionId':_0x273b64['id']},{})[_0xc0a1('0x16')](function(){return _0x3fa7cd;});}else{return _0x3fa7cd;}})['catch'](function(_0x289501){logger[_0xc0a1('0x1b')](_0xc0a1('0x3c'),_0x289501);throw _0x289501;});}return _0x3fa7cd;})[_0xc0a1('0x16')](respondWithResult(_0x423da0,0xc9))[_0xc0a1('0x29')](handleError(_0x423da0,null));};exports[_0xc0a1('0x15')]=function(_0x41d73d,_0x4d9b35){if(_0x41d73d['body']['id']){delete _0x41d73d[_0xc0a1('0x35')]['id'];}return db['FaxQueue'][_0xc0a1('0x3d')]({'where':{'id':_0x41d73d['params']['id']}})['then'](handleEntityNotFound(_0x4d9b35,null))[_0xc0a1('0x16')](saveUpdates(_0x41d73d[_0xc0a1('0x35')],null))[_0xc0a1('0x16')](respondWithResult(_0x4d9b35,null))[_0xc0a1('0x29')](handleError(_0x4d9b35,null));};exports[_0xc0a1('0x17')]=function(_0x23ae3a,_0x2b1730){return db[_0xc0a1('0x21')][_0xc0a1('0x3d')]({'where':{'id':_0x23ae3a[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x2b1730,null))[_0xc0a1('0x16')](removeEntity(_0x2b1730,null))[_0xc0a1('0x29')](handleError(_0x2b1730,null));};exports[_0xc0a1('0x3f')]=function(_0xdbf055,_0x2df4cf){return db['FaxQueue'][_0xc0a1('0x3f')]()[_0xc0a1('0x16')](respondWithResult(_0x2df4cf,null))['catch'](handleError(_0x2df4cf,null));};exports['getMembers']=function(_0x187e91,_0x581818){var _0xbac6ae={'raw':!![],'where':{}},_0x1bc504={},_0x796690;return db['FaxQueue'][_0xc0a1('0x40')]({'where':{'id':_0x187e91[_0xc0a1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x581818,null))[_0xc0a1('0x16')](function(_0x45c24e){if(_0x45c24e){_0x796690=_0x45c24e['get']({'plain':!![]});_0x1bc504['model']=_[_0xc0a1('0x2c')](db[_0xc0a1('0x41')]['rawAttributes']);_0x1bc504[_0xc0a1('0x27')]=_[_0xc0a1('0x2c')](_0x187e91[_0xc0a1('0x27')]);_0x1bc504[_0xc0a1('0x2d')]=_['intersection'](_0x1bc504['model'],_0x1bc504[_0xc0a1('0x27')]);_0xbac6ae['attributes']=_[_0xc0a1('0x2f')](_0x1bc504['model'],qs[_0xc0a1('0x30')](_0x187e91['query'][_0xc0a1('0x30')]));_0xbac6ae[_0xc0a1('0x2e')]=_0xbac6ae['attributes'][_0xc0a1('0x31')]?_0xbac6ae[_0xc0a1('0x2e')]:_0x1bc504[_0xc0a1('0x2b')];if(!_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x42')]('nolimit')){_0xbac6ae['limit']=qs[_0xc0a1('0x12')](_0x187e91['query'][_0xc0a1('0x12')]);_0xbac6ae['offset']=qs[_0xc0a1('0xf')](_0x187e91[_0xc0a1('0x27')][_0xc0a1('0xf')]);}_0xbac6ae[_0xc0a1('0x43')]=qs[_0xc0a1('0x44')](_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x44')]);_0xbac6ae[_0xc0a1('0x25')]=qs[_0xc0a1('0x2d')](_[_0xc0a1('0x45')](_0x187e91[_0xc0a1('0x27')],_0x1bc504[_0xc0a1('0x2d')]));_0xbac6ae[_0xc0a1('0x25')][_0xc0a1('0x46')]=_0x45c24e['id'];if(_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x47')]){_0xbac6ae[_0xc0a1('0x25')]=_['merge'](_0xbac6ae['where'],{'$or':_[_0xc0a1('0x20')](_0xbac6ae[_0xc0a1('0x2e')],function(_0x23b3e0){var _0x3d37d1={};_0x3d37d1[_0x23b3e0]={'$like':'%'+_0x187e91[_0xc0a1('0x27')][_0xc0a1('0x47')]+'%'};return _0x3d37d1;})});}_0xbac6ae=_[_0xc0a1('0x32')]({},_0xbac6ae,_0x187e91[_0xc0a1('0x33')]);return db[_0xc0a1('0x41')]['findAll'](_0xbac6ae);}})[_0xc0a1('0x16')](function(_0x2de5af){if(_0x2de5af){return db[_0xc0a1('0x48')][_0xc0a1('0x49')]({'where':{'id':_['map'](_0x2de5af,_0xc0a1('0x4a')),'role':_0xc0a1('0x4b')},'attributes':['id',_0xc0a1('0x1d'),'faxPause',_0xc0a1('0x4c'),'createdAt']});}})[_0xc0a1('0x16')](function(_0x57bcb){if(_0x57bcb){return{'count':_0x57bcb['count'],'rows':_[_0xc0a1('0x20')](_0x57bcb['rows'],function(_0x569079){return{'membername':_0x569079[_0xc0a1('0x1d')],'UserId':_0x569079['id'],'queue_name':_0x796690[_0xc0a1('0x1d')],'FaxQueueId':_0x796690['id'],'interface':util[_0xc0a1('0x4d')](_0xc0a1('0x4e'),'SIP',_0x569079['name']),'penalty':0x0,'paused':_0x569079['faxPause'],'createdAt':_0x569079[_0xc0a1('0x4f')],'updatedAt':_0x569079['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc0a1('0x16')](respondWithFilteredResult(_0x581818,_0xbac6ae))[_0xc0a1('0x29')](handleError(_0x581818,null));};exports[_0xc0a1('0x50')]=function(_0x4ef311,_0x4188a7){var _0x246a05={};var _0x20d116={};var _0x11ff04;var _0x33a06b;return db['FaxQueue'][_0xc0a1('0x40')]({'where':{'id':_0x4ef311[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x4188a7,null))['then'](function(_0x4cb4b3){if(_0x4cb4b3){_0x11ff04=_0x4cb4b3;_0x20d116['model']=_[_0xc0a1('0x2c')](db[_0xc0a1('0x51')][_0xc0a1('0x52')]);_0x20d116[_0xc0a1('0x27')]=_[_0xc0a1('0x2c')](_0x4ef311[_0xc0a1('0x27')]);_0x20d116[_0xc0a1('0x2d')]=_[_0xc0a1('0x2f')](_0x20d116[_0xc0a1('0x2b')],_0x20d116[_0xc0a1('0x27')]);_0x246a05['attributes']=_[_0xc0a1('0x2f')](_0x20d116[_0xc0a1('0x2b')],qs[_0xc0a1('0x30')](_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x30')]));_0x246a05[_0xc0a1('0x2e')]=_0x246a05[_0xc0a1('0x2e')]['length']?_0x246a05[_0xc0a1('0x2e')]:_0x20d116[_0xc0a1('0x2b')];_0x246a05['order']=qs['sort'](_0x4ef311['query']['sort']);_0x246a05[_0xc0a1('0x25')]=qs[_0xc0a1('0x2d')](_[_0xc0a1('0x45')](_0x4ef311[_0xc0a1('0x27')],_0x20d116[_0xc0a1('0x2d')]));if(_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x47')]){_0x246a05[_0xc0a1('0x25')]=_[_0xc0a1('0x32')](_0x246a05[_0xc0a1('0x25')],{'$or':_[_0xc0a1('0x20')](_0x246a05['attributes'],function(_0x8dcadd){var _0x2b99e4={};_0x2b99e4[_0x8dcadd]={'$like':'%'+_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x47')]+'%'};return _0x2b99e4;})});}_0x246a05=_[_0xc0a1('0x32')]({},_0x246a05,_0x4ef311[_0xc0a1('0x33')]);return _0x11ff04[_0xc0a1('0x50')](_0x246a05);}})[_0xc0a1('0x16')](function(_0x1ec803){if(_0x1ec803){_0x33a06b=_0x1ec803[_0xc0a1('0x31')];if(!_0x4ef311[_0xc0a1('0x27')][_0xc0a1('0x42')](_0xc0a1('0x53'))){_0x246a05['limit']=qs[_0xc0a1('0x12')](_0x4ef311['query']['limit']);_0x246a05['offset']=qs[_0xc0a1('0xf')](_0x4ef311[_0xc0a1('0x27')]['offset']);}return _0x11ff04[_0xc0a1('0x50')](_0x246a05);}})[_0xc0a1('0x16')](function(_0x6ab7b3){if(_0x6ab7b3){return _0x6ab7b3?{'count':_0x33a06b,'rows':_0x6ab7b3}:null;}})[_0xc0a1('0x16')](respondWithResult(_0x4188a7,null))[_0xc0a1('0x29')](handleError(_0x4188a7,null));};exports[_0xc0a1('0x54')]=function(_0x5345df,_0x358504){var _0x37c6b0=_0x5345df[_0xc0a1('0x35')][_0xc0a1('0x55')];return db[_0xc0a1('0x51')][_0xc0a1('0x28')]({'where':{'id':_0x37c6b0},'attributes':['id'],'include':[{'model':db[_0xc0a1('0x48')],'as':'Agents','attributes':['id',_0xc0a1('0x1d'),'online',_0xc0a1('0x56'),_0xc0a1('0x57')],'raw':!![]}]})[_0xc0a1('0x16')](function(_0x3c4c59){if(_0x3c4c59){var _0x577e18=_[_0xc0a1('0x58')](_0x3c4c59,function(_0x5813c7){var _0x3ec7f5=_0x5813c7[_0xc0a1('0x18')]({'plain':!![]});return _0x3ec7f5['Agents'];});return db[_0xc0a1('0x21')]['find']({'where':{'id':_0x5345df[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](function(_0x4423b4){return db[_0xc0a1('0x59')][_0xc0a1('0x5a')](function(_0xfd51eb){return _0x4423b4['addTeams'](_0x37c6b0,{'transaction':_0xfd51eb})[_0xc0a1('0x16')](function(){return BPromise['each'](_0x577e18,function(_0x33aa9f){return db[_0xc0a1('0x41')][_0xc0a1('0x5b')]({'where':{'UserId':_0x33aa9f['id'],'FaxQueueId':_0x5345df[_0xc0a1('0x3e')]['id']},'transaction':_0xfd51eb});});})[_0xc0a1('0x16')](function(){_0x577e18['forEach'](function(_0x300e5e){socket[_0xc0a1('0x5c')](_0xc0a1('0x5d'),{'UserId':_0x300e5e['id'],'FaxQueueId':_0x4423b4['id']});});});});});}})['then'](respondWithStatusCode(_0x358504,null))[_0xc0a1('0x29')](handleError(_0x358504,null));};exports[_0xc0a1('0x5e')]=function(_0xae97f2,_0x4c7f17){return db['Team'][_0xc0a1('0x28')]({'where':{'id':_0xae97f2[_0xc0a1('0x27')][_0xc0a1('0x55')]},'attributes':['id'],'include':[{'model':db[_0xc0a1('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc0a1('0x16')](handleEntityNotFound(_0x4c7f17,null))['then'](function(_0x3f54dd){var _0x9f9a7d=_[_0xc0a1('0x20')](_0x3f54dd,'id');var _0x63a2d=[];var _0x56950e=[];var _0x168756=squel['select']();_0x168756[_0xc0a1('0x5f')](_0xc0a1('0x60'))[_0xc0a1('0x61')]('team_has_fax_queues','tq')[_0xc0a1('0x62')](_0xc0a1('0x63'),'ut',_0xc0a1('0x64'))['where'](_0xc0a1('0x65'),_0xae97f2[_0xc0a1('0x3e')]['id']);for(var _0x411756=0x0;_0x411756<_0x3f54dd['length'];_0x411756+=0x1){let _0x26044a=_0x3f54dd[_0x411756];for(var _0x787e18=0x0;_0x787e18<_0x26044a[_0xc0a1('0x66')][_0xc0a1('0x31')];_0x787e18+=0x1){let _0x471996=_0x26044a['Agents'][_0x787e18];var _0x4a0e7f=_0x168756['clone']();_0x4a0e7f[_0xc0a1('0x25')]('ut.UserId\x20=\x20?',_0x471996['id']);_0x56950e['push'](db[_0xc0a1('0x59')][_0xc0a1('0x27')](_0x4a0e7f[_0xc0a1('0x67')](),{'type':db[_0xc0a1('0x59')]['QueryTypes'][_0xc0a1('0x68')]})[_0xc0a1('0x16')](function(_0xa8f906){if(_0xa8f906[_0xc0a1('0x31')]===0x1){return _0x471996['id'];}else{var _0x2b6f0e=_[_0xc0a1('0x69')](_[_0xc0a1('0x20')](_0xa8f906,_0xc0a1('0x6a')),function(_0x10b786){return _[_0xc0a1('0x6b')](_0x9f9a7d,_0x10b786);});if(_0x2b6f0e){return _0x471996['id'];}}}));}}return BPromise[_0xc0a1('0x6c')](_0x56950e)[_0xc0a1('0x16')](function(_0x3c232f){_0x63a2d=_(_0x63a2d)['union'](_0x3c232f)[_0xc0a1('0x6d')]()[_0xc0a1('0x6e')]();return db[_0xc0a1('0x21')][_0xc0a1('0x3d')]({'where':{'id':_0xae97f2['params']['id']}})[_0xc0a1('0x16')](function(_0x214639){return db['sequelize'][_0xc0a1('0x5a')](function(_0x2469d4){return _0x214639[_0xc0a1('0x5e')](_0xae97f2[_0xc0a1('0x27')][_0xc0a1('0x55')],{'transaction':_0x2469d4})[_0xc0a1('0x16')](function(){if(!_[_0xc0a1('0x6f')](_0x63a2d)){return _0x214639[_0xc0a1('0x70')](_0x63a2d,{'transaction':_0x2469d4});}})[_0xc0a1('0x16')](function(){_0x63a2d[_0xc0a1('0x71')](function(_0x58a2d1){socket[_0xc0a1('0x5c')]('userFaxQueue:remove',{'UserId':_0x58a2d1,'FaxQueueId':_0x214639['id']});});});});});});})['then'](respondWithStatusCode(_0x4c7f17,null))[_0xc0a1('0x29')](handleError(_0x4c7f17,null));};exports[_0xc0a1('0x72')]=function(_0x410527,_0xbccb){return db[_0xc0a1('0x21')]['find']({'where':{'id':_0x410527['params']['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0xbccb,null))[_0xc0a1('0x16')](function(_0x36803f){if(_0x36803f){return _0x36803f[_0xc0a1('0x72')](_0x410527[_0xc0a1('0x35')]['ids'],_['omit'](_0x410527[_0xc0a1('0x35')],[_0xc0a1('0x55'),'id'])||{})[_0xc0a1('0x73')](function(_0xc0d95){for(var _0x4798b7=0x0;_0x4798b7<_0x410527[_0xc0a1('0x35')]['ids'][_0xc0a1('0x31')];_0x4798b7+=0x1){socket[_0xc0a1('0x5c')](_0xc0a1('0x5d'),{'UserId':Number(_0x410527[_0xc0a1('0x35')][_0xc0a1('0x55')][_0x4798b7]),'FaxQueueId':Number(_0x410527[_0xc0a1('0x3e')]['id'])});}return _0xc0d95;});}})['then'](respondWithResult(_0xbccb,null))[_0xc0a1('0x29')](handleError(_0xbccb,null));};exports[_0xc0a1('0x70')]=function(_0x404733,_0x145a32){return db[_0xc0a1('0x21')][_0xc0a1('0x3d')]({'where':{'id':_0x404733['params']['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x145a32,null))[_0xc0a1('0x16')](function(_0x2c909e){if(_0x2c909e){return _0x2c909e[_0xc0a1('0x70')](_0x404733['query'][_0xc0a1('0x55')])['then'](function(){if(_[_0xc0a1('0x74')](_0x404733[_0xc0a1('0x27')][_0xc0a1('0x55')])){for(var _0x3b6092=0x0;_0x3b6092<_0x404733[_0xc0a1('0x27')]['ids'][_0xc0a1('0x31')];_0x3b6092+=0x1){socket[_0xc0a1('0x5c')]('userFaxQueue:remove',{'UserId':Number(_0x404733[_0xc0a1('0x27')][_0xc0a1('0x55')][_0x3b6092]),'FaxQueueId':Number(_0x404733[_0xc0a1('0x3e')]['id'])});}}else{socket[_0xc0a1('0x5c')](_0xc0a1('0x75'),{'UserId':Number(_0x404733[_0xc0a1('0x27')][_0xc0a1('0x55')]),'FaxQueueId':Number(_0x404733[_0xc0a1('0x3e')]['id'])});}});}})['then'](respondWithStatusCode(_0x145a32,null))['catch'](handleError(_0x145a32,null));};exports[_0xc0a1('0x76')]=function(_0x3ce709,_0x3d288d){var _0x48ba0d={};var _0x17efde={};var _0x3d67c7;var _0x2a6ee7;return db[_0xc0a1('0x21')][_0xc0a1('0x40')]({'where':{'id':_0x3ce709[_0xc0a1('0x3e')]['id']}})[_0xc0a1('0x16')](handleEntityNotFound(_0x3d288d,null))['then'](function(_0x11d0fc){if(_0x11d0fc){_0x3d67c7=_0x11d0fc;_0x17efde[_0xc0a1('0x2b')]=_[_0xc0a1('0x2c')](db['User'][_0xc0a1('0x52')]);_0x17efde[_0xc0a1('0x27')]=_['keys'](_0x3ce709[_0xc0a1('0x27')]);_0x17efde[_0xc0a1('0x2d')]=_[_0xc0a1('0x2f')](_0x17efde[_0xc0a1('0x2b')],_0x17efde[_0xc0a1('0x27')]);_0x48ba0d[_0xc0a1('0x2e')]=_[_0xc0a1('0x2f')](_0x17efde[_0xc0a1('0x2b')],qs['fields'](_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x30')]));_0x48ba0d['attributes']=_0x48ba0d[_0xc0a1('0x2e')][_0xc0a1('0x31')]?_0x48ba0d[_0xc0a1('0x2e')]:_0x17efde[_0xc0a1('0x2b')];_0x48ba0d[_0xc0a1('0x43')]=qs[_0xc0a1('0x44')](_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x44')]);_0x48ba0d[_0xc0a1('0x25')]=qs[_0xc0a1('0x2d')](_[_0xc0a1('0x45')](_0x3ce709['query'],_0x17efde['filters']));if(_0x3ce709[_0xc0a1('0x27')]['filter']){_0x48ba0d['where']=_['merge'](_0x48ba0d[_0xc0a1('0x25')],{'$or':_[_0xc0a1('0x20')](_0x48ba0d['attributes'],function(_0x3af85a){var _0x50520c={};_0x50520c[_0x3af85a]={'$like':'%'+_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x47')]+'%'};return _0x50520c;})});}_0x48ba0d=_[_0xc0a1('0x32')]({},_0x48ba0d,_0x3ce709['options']);return _0x3d67c7['getAgents'](_0x48ba0d);}})[_0xc0a1('0x16')](function(_0x59b6fb){if(_0x59b6fb){_0x2a6ee7=_0x59b6fb[_0xc0a1('0x31')];if(!_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0x42')]('nolimit')){_0x48ba0d[_0xc0a1('0x12')]=qs[_0xc0a1('0x12')](_0x3ce709['query'][_0xc0a1('0x12')]);_0x48ba0d[_0xc0a1('0xf')]=qs['offset'](_0x3ce709[_0xc0a1('0x27')][_0xc0a1('0xf')]);}return _0x3d67c7[_0xc0a1('0x76')](_0x48ba0d);}})[_0xc0a1('0x16')](function(_0x3f3236){if(_0x3f3236){return _0x3f3236?{'count':_0x2a6ee7,'rows':_0x3f3236}:null;}})[_0xc0a1('0x16')](respondWithResult(_0x3d288d,null))[_0xc0a1('0x29')](handleError(_0x3d288d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 308b60e..46e558d 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 _0x4d8a=['emit','hasOwnProperty','hook','events','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x4a150d,_0x1809bd){var _0x33cd3e=function(_0x31928e){while(--_0x31928e){_0x4a150d['push'](_0x4a150d['shift']());}};_0x33cd3e(++_0x1809bd);}(_0x4d8a,0xc9));var _0xa4d8=function(_0x34b089,_0x284107){_0x34b089=_0x34b089-0x0;var _0x6f594d=_0x4d8a[_0x34b089];return _0x6f594d;};'use strict';var EventEmitter=require(_0xa4d8('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xa4d8('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa4d8('0x2')](0x0);var events={'afterCreate':_0xa4d8('0x3'),'afterUpdate':_0xa4d8('0x4'),'afterDestroy':_0xa4d8('0x5')};function emitEvent(_0x685c5c){return function(_0x3c03db,_0x241840,_0x564b01){FaxQueueEvents[_0xa4d8('0x6')](_0x685c5c+':'+_0x3c03db['id'],_0x3c03db);FaxQueueEvents[_0xa4d8('0x6')](_0x685c5c,_0x3c03db);_0x564b01(null);};}for(var e in events){if(events[_0xa4d8('0x7')](e)){var event=events[e];FaxQueue[_0xa4d8('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xdd73=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd73,0x198));var _0x3dd7=function(_0x3b5ce3,_0x465fc4){_0x3b5ce3=_0x3b5ce3-0x0;var _0x3682ea=_0xdd73[_0x3b5ce3];return _0x3682ea;};'use strict';var EventEmitter=require(_0x3dd7('0x0'));var FaxQueue=require(_0x3dd7('0x1'))['db'][_0x3dd7('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3dd7('0x3')](0x0);var events={'afterCreate':_0x3dd7('0x4'),'afterUpdate':_0x3dd7('0x5'),'afterDestroy':_0x3dd7('0x6')};function emitEvent(_0x4215cf){return function(_0x6adbd2,_0x56d5b0,_0x48b48a){FaxQueueEvents[_0x3dd7('0x7')](_0x4215cf+':'+_0x6adbd2['id'],_0x6adbd2);FaxQueueEvents[_0x3dd7('0x7')](_0x4215cf,_0x6adbd2);_0x48b48a(null);};}for(var e in events){if(events[_0x3dd7('0x8')](e)){var event=events[e];FaxQueue[_0x3dd7('0x9')](e,emitEvent(event));}}module[_0x3dd7('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index caa9ee0..5f68d51 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 _0x3225=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','lodash'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x3225,0x196));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5322('0x0'));var util=require(_0x5322('0x1'));var logger=require(_0x5322('0x2'))(_0x5322('0x3'));var moment=require(_0x5322('0x4'));var BPromise=require(_0x5322('0x5'));var rp=require(_0x5322('0x6'));var fs=require('fs');var path=require(_0x5322('0x7'));var rimraf=require(_0x5322('0x8'));var config=require(_0x5322('0x9'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x26f9f5,_0x577f10){return _0x26f9f5[_0x5322('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x795d=['lodash','util','bluebird','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue'];(function(_0x5aff19,_0x1b2577){var _0x30d5ff=function(_0x18ac2e){while(--_0x18ac2e){_0x5aff19['push'](_0x5aff19['shift']());}};_0x30d5ff(++_0x1b2577);}(_0x795d,0x100));var _0xd795=function(_0x3bd2c8,_0x395b96){_0x3bd2c8=_0x3bd2c8-0x0;var _0x25374f=_0x795d[_0x3bd2c8];return _0x25374f;};'use strict';var _=require(_0xd795('0x0'));var util=require(_0xd795('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd795('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd795('0x3'));var config=require(_0xd795('0x4'));var attributes=require(_0xd795('0x5'));module['exports']=function(_0x55127b,_0x1a4c55){return _0x55127b[_0xd795('0x6')](_0xd795('0x7'),attributes,{'tableName':'fax_queues','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 c492379..c2257f7 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 _0x984c=['FaxQueue','findAll','options','raw','where','limit','include','model','map','attributes','GetFaxQueue','debug','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x984c,0xa5));var _0xc984=function(_0x3c26d9,_0x2008ac){_0x3c26d9=_0x3c26d9-0x0;var _0x278af3=_0x984c[_0x3c26d9];return _0x278af3;};'use strict';var _=require(_0xc984('0x0'));var util=require(_0xc984('0x1'));var moment=require(_0xc984('0x2'));var BPromise=require('bluebird');var rs=require(_0xc984('0x3'));var fs=require('fs');var Redis=require(_0xc984('0x4'));var db=require(_0xc984('0x5'))['db'];var utils=require(_0xc984('0x6'));var logger=require(_0xc984('0x7'))('rpc');var config=require(_0xc984('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc984('0x9')][_0xc984('0xa')]({'port':0x232a});config['redis']=_[_0xc984('0xb')](config[_0xc984('0xc')],{'host':_0xc984('0xd'),'port':0x18eb});var socket=require(_0xc984('0xe'))(new Redis(config[_0xc984('0xc')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x985a27,_0x485057,_0x273c9e){return new BPromise(function(_0x4616ef,_0x4420b0){return client[_0xc984('0xf')](_0x985a27,_0x273c9e)[_0xc984('0x10')](function(_0x30a5cb){logger[_0xc984('0x11')](_0xc984('0x12'),_0x485057,_0xc984('0x13'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x485057,_0xc984('0x13'),JSON[_0xc984('0x14')](_0x30a5cb));if(_0x30a5cb[_0xc984('0x15')]){if(_0x30a5cb[_0xc984('0x15')][_0xc984('0x16')]===0x1f4){logger[_0xc984('0x15')](_0xc984('0x12'),_0x485057,_0x30a5cb[_0xc984('0x15')][_0xc984('0x17')]);return _0x4420b0(_0x30a5cb[_0xc984('0x15')][_0xc984('0x17')]);}logger[_0xc984('0x15')](_0xc984('0x12'),_0x485057,_0x30a5cb[_0xc984('0x15')][_0xc984('0x17')]);return _0x4616ef(_0x30a5cb['error'][_0xc984('0x17')]);}else{logger[_0xc984('0x11')](_0xc984('0x12'),_0x485057,'request\x20sent');_0x4616ef(_0x30a5cb['result']['message']);}})[_0xc984('0x18')](function(_0x295a04){logger['error'](_0xc984('0x12'),_0x485057,_0x295a04);_0x4420b0(_0x295a04);});});}exports['GetFaxQueue']=function(_0x1d7b09){var _0x161422=this;return new Promise(function(_0x1fb295,_0x49f33f){return db[_0xc984('0x19')][_0xc984('0x1a')]({'raw':_0x1d7b09[_0xc984('0x1b')]?_0x1d7b09['options'][_0xc984('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d7b09['options']?_0x1d7b09['options'][_0xc984('0x1d')]||null:null,'attributes':_0x1d7b09[_0xc984('0x1b')]?_0x1d7b09[_0xc984('0x1b')]['attributes']||null:null,'limit':_0x1d7b09[_0xc984('0x1b')]?_0x1d7b09[_0xc984('0x1b')][_0xc984('0x1e')]||null:null,'include':_0x1d7b09['options']?_0x1d7b09[_0xc984('0x1b')]['include']?_['map'](_0x1d7b09[_0xc984('0x1b')][_0xc984('0x1f')],function(_0xbfcc1e){return{'model':db[_0xbfcc1e[_0xc984('0x20')]],'as':_0xbfcc1e['as'],'attributes':_0xbfcc1e['attributes'],'include':_0xbfcc1e[_0xc984('0x1f')]?_[_0xc984('0x21')](_0xbfcc1e[_0xc984('0x1f')],function(_0x50978c){return{'model':db[_0x50978c[_0xc984('0x20')]],'as':_0x50978c['as'],'attributes':_0x50978c[_0xc984('0x22')],'include':_0x50978c[_0xc984('0x1f')]?_['map'](_0x50978c['include'],function(_0x5ac4a7){return{'model':db[_0x5ac4a7['model']],'as':_0x5ac4a7['as'],'attributes':_0x5ac4a7[_0xc984('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2589d9){logger[_0xc984('0x11')](_0xc984('0x23'),_0x1d7b09);logger[_0xc984('0x24')](_0xc984('0x23'),_0x1d7b09,JSON[_0xc984('0x14')](_0x2589d9));_0x1fb295(_0x2589d9);})['catch'](function(_0x1a2f8d){logger[_0xc984('0x15')](_0xc984('0x23'),_0x1a2f8d['message'],_0x1d7b09);_0x49f33f(_0x161422[_0xc984('0x15')](0x1f4,_0x1a2f8d['message']));});});};exports[_0xc984('0x25')]=function(_0x5ac253){var _0x76a698=this;return new Promise(function(_0xa98c15,_0xf767da){return db[_0xc984('0x19')]['find']({'raw':_0x5ac253[_0xc984('0x1b')]?_0x5ac253['options'][_0xc984('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ac253[_0xc984('0x1b')]?_0x5ac253[_0xc984('0x1b')][_0xc984('0x1d')]||null:null,'attributes':_0x5ac253[_0xc984('0x1b')]?_0x5ac253[_0xc984('0x1b')][_0xc984('0x22')]||null:null,'include':_0x5ac253[_0xc984('0x1b')]?_0x5ac253[_0xc984('0x1b')]['include']?_['map'](_0x5ac253['options'][_0xc984('0x1f')],function(_0x400646){return{'model':db[_0x400646[_0xc984('0x20')]],'as':_0x400646['as'],'attributes':_0x400646[_0xc984('0x22')],'include':_0x400646[_0xc984('0x1f')]?_[_0xc984('0x21')](_0x400646['include'],function(_0x273cc7){return{'model':db[_0x273cc7[_0xc984('0x20')]],'as':_0x273cc7['as'],'attributes':_0x273cc7['attributes'],'include':_0x273cc7['include']?_[_0xc984('0x21')](_0x273cc7[_0xc984('0x1f')],function(_0x16428c){return{'model':db[_0x16428c[_0xc984('0x20')]],'as':_0x16428c['as'],'attributes':_0x16428c[_0xc984('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc984('0x10')](function(_0x1162b5){logger['info']('ShowFaxQueue',_0x5ac253);logger[_0xc984('0x24')](_0xc984('0x25'),_0x5ac253,JSON['stringify'](_0x1162b5));_0xa98c15(_0x1162b5);})['catch'](function(_0x34ef26){logger[_0xc984('0x15')](_0xc984('0x25'),_0x34ef26[_0xc984('0x17')],_0x5ac253);_0xf767da(_0x76a698[_0xc984('0x15')](0x1f4,_0x34ef26[_0xc984('0x17')]));});});}; \ No newline at end of file +var _0x2883=['include','map','model','info','ShowFaxQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2883,0x6e));var _0x3288=function(_0x5eea46,_0x149011){_0x5eea46=_0x5eea46-0x0;var _0x122184=_0x2883[_0x5eea46];return _0x122184;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3288('0x0'));var BPromise=require(_0x3288('0x1'));var rs=require(_0x3288('0x2'));var fs=require('fs');var Redis=require(_0x3288('0x3'));var db=require(_0x3288('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3288('0x5')]({'port':0x232a});config[_0x3288('0x6')]=_[_0x3288('0x7')](config[_0x3288('0x6')],{'host':_0x3288('0x8'),'port':0x18eb});var socket=require(_0x3288('0x9'))(new Redis(config['redis']));require(_0x3288('0xa'))[_0x3288('0xb')](socket);function respondWithRpcPromise(_0x1bfdb3,_0x5f5173,_0x32493d){return new BPromise(function(_0x523d33,_0x4a8448){return client['request'](_0x1bfdb3,_0x32493d)[_0x3288('0xc')](function(_0x4d15ad){logger['info'](_0x3288('0xd'),_0x5f5173,_0x3288('0xe'));logger[_0x3288('0xf')](_0x3288('0x10'),_0x5f5173,_0x3288('0xe'),JSON[_0x3288('0x11')](_0x4d15ad));if(_0x4d15ad[_0x3288('0x12')]){if(_0x4d15ad[_0x3288('0x12')][_0x3288('0x13')]===0x1f4){logger[_0x3288('0x12')](_0x3288('0xd'),_0x5f5173,_0x4d15ad[_0x3288('0x12')][_0x3288('0x14')]);return _0x4a8448(_0x4d15ad[_0x3288('0x12')]['message']);}logger[_0x3288('0x12')](_0x3288('0xd'),_0x5f5173,_0x4d15ad['error']['message']);return _0x523d33(_0x4d15ad[_0x3288('0x12')][_0x3288('0x14')]);}else{logger['info'](_0x3288('0xd'),_0x5f5173,_0x3288('0xe'));_0x523d33(_0x4d15ad['result'][_0x3288('0x14')]);}})[_0x3288('0x15')](function(_0x45fa71){logger[_0x3288('0x12')]('FaxQueue,\x20%s,\x20%s',_0x5f5173,_0x45fa71);_0x4a8448(_0x45fa71);});});}exports[_0x3288('0x16')]=function(_0x53d937){var _0x5230be=this;return new Promise(function(_0x2fdea0,_0x1fe891){return db[_0x3288('0x17')][_0x3288('0x18')]({'raw':_0x53d937[_0x3288('0x19')]?_0x53d937[_0x3288('0x19')][_0x3288('0x1a')]===undefined?!![]:![]:!![],'where':_0x53d937['options']?_0x53d937['options'][_0x3288('0x1b')]||null:null,'attributes':_0x53d937[_0x3288('0x19')]?_0x53d937['options'][_0x3288('0x1c')]||null:null,'limit':_0x53d937[_0x3288('0x19')]?_0x53d937[_0x3288('0x19')][_0x3288('0x1d')]||null:null,'include':_0x53d937['options']?_0x53d937[_0x3288('0x19')][_0x3288('0x1e')]?_[_0x3288('0x1f')](_0x53d937[_0x3288('0x19')][_0x3288('0x1e')],function(_0x34881f){return{'model':db[_0x34881f[_0x3288('0x20')]],'as':_0x34881f['as'],'attributes':_0x34881f[_0x3288('0x1c')],'include':_0x34881f['include']?_['map'](_0x34881f[_0x3288('0x1e')],function(_0x1cead5){return{'model':db[_0x1cead5[_0x3288('0x20')]],'as':_0x1cead5['as'],'attributes':_0x1cead5[_0x3288('0x1c')],'include':_0x1cead5[_0x3288('0x1e')]?_['map'](_0x1cead5[_0x3288('0x1e')],function(_0x19bde4){return{'model':db[_0x19bde4[_0x3288('0x20')]],'as':_0x19bde4['as'],'attributes':_0x19bde4['attributes']};}):[]};}):[]};}):[]:[]})[_0x3288('0xc')](function(_0x1cac8b){logger[_0x3288('0x21')](_0x3288('0x16'),_0x53d937);logger[_0x3288('0xf')](_0x3288('0x16'),_0x53d937,JSON['stringify'](_0x1cac8b));_0x2fdea0(_0x1cac8b);})['catch'](function(_0x225edc){logger[_0x3288('0x12')](_0x3288('0x16'),_0x225edc['message'],_0x53d937);_0x1fe891(_0x5230be[_0x3288('0x12')](0x1f4,_0x225edc[_0x3288('0x14')]));});});};exports['ShowFaxQueue']=function(_0x57ffb2){var _0x473b45=this;return new Promise(function(_0x140477,_0x3ead4a){return db['FaxQueue']['find']({'raw':_0x57ffb2['options']?_0x57ffb2[_0x3288('0x19')][_0x3288('0x1a')]===undefined?!![]:![]:!![],'where':_0x57ffb2[_0x3288('0x19')]?_0x57ffb2[_0x3288('0x19')]['where']||null:null,'attributes':_0x57ffb2[_0x3288('0x19')]?_0x57ffb2[_0x3288('0x19')][_0x3288('0x1c')]||null:null,'include':_0x57ffb2[_0x3288('0x19')]?_0x57ffb2[_0x3288('0x19')][_0x3288('0x1e')]?_[_0x3288('0x1f')](_0x57ffb2['options']['include'],function(_0x5f2a0e){return{'model':db[_0x5f2a0e[_0x3288('0x20')]],'as':_0x5f2a0e['as'],'attributes':_0x5f2a0e[_0x3288('0x1c')],'include':_0x5f2a0e[_0x3288('0x1e')]?_[_0x3288('0x1f')](_0x5f2a0e[_0x3288('0x1e')],function(_0x1e4fa5){return{'model':db[_0x1e4fa5[_0x3288('0x20')]],'as':_0x1e4fa5['as'],'attributes':_0x1e4fa5[_0x3288('0x1c')],'include':_0x1e4fa5[_0x3288('0x1e')]?_[_0x3288('0x1f')](_0x1e4fa5[_0x3288('0x1e')],function(_0x5392da){return{'model':db[_0x5392da['model']],'as':_0x5392da['as'],'attributes':_0x5392da[_0x3288('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ca2fc){logger[_0x3288('0x21')](_0x3288('0x22'),_0x57ffb2);logger[_0x3288('0xf')]('ShowFaxQueue',_0x57ffb2,JSON[_0x3288('0x11')](_0x2ca2fc));_0x140477(_0x2ca2fc);})['catch'](function(_0x49f9e9){logger[_0x3288('0x12')](_0x3288('0x22'),_0x49f9e9[_0x3288('0x14')],_0x57ffb2);_0x3ead4a(_0x473b45[_0x3288('0x12')](0x1f4,_0x49f9e9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a62554e..c638a98 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 _0x808a=['save','remove','update','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x219c6c,_0x4d299a){var _0x41d2d0=function(_0x3cc70e){while(--_0x3cc70e){_0x219c6c['push'](_0x219c6c['shift']());}};_0x41d2d0(++_0x4d299a);}(_0x808a,0x1b7));var _0xa808=function(_0x4e00f3,_0x4e7ccc){_0x4e00f3=_0x4e00f3-0x0;var _0x2e3471=_0x808a[_0x4e00f3];return _0x2e3471;};'use strict';var FaxQueueEvents=require(_0xa808('0x0'));var events=[_0xa808('0x1'),_0xa808('0x2'),_0xa808('0x3')];function createListener(_0x56f787,_0x552cab){return function(_0x53effe){_0x552cab['emit'](_0x56f787,_0x53effe);};}function removeListener(_0x169e1d,_0x38ed20){return function(){FaxQueueEvents[_0xa808('0x4')](_0x169e1d,_0x38ed20);};}exports[_0xa808('0x5')]=function(_0x4ff931){for(var _0x14b3bf=0x0,_0x2c4886=events[_0xa808('0x6')];_0x14b3bf<_0x2c4886;_0x14b3bf++){var _0x533152=events[_0x14b3bf];var _0x553162=createListener(_0xa808('0x7')+_0x533152,_0x4ff931);FaxQueueEvents['on'](_0x533152,_0x553162);}}; \ No newline at end of file +var _0xb714=['./faxQueue.events','save','remove','update','register','length','faxQueue:'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0xb714,0x196));var _0x4b71=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xb714[_0x29b609];return _0x54c952;};'use strict';var FaxQueueEvents=require(_0x4b71('0x0'));var events=[_0x4b71('0x1'),_0x4b71('0x2'),_0x4b71('0x3')];function createListener(_0x513ac8,_0x1381bb){return function(_0x43f836){_0x1381bb['emit'](_0x513ac8,_0x43f836);};}function removeListener(_0x376af2,_0x5cbd9){return function(){FaxQueueEvents['removeListener'](_0x376af2,_0x5cbd9);};}exports[_0x4b71('0x4')]=function(_0x32a442){for(var _0x280c18=0x0,_0x5cd530=events[_0x4b71('0x5')];_0x280c18<_0x5cd530;_0x280c18++){var _0x736bea=events[_0x280c18];var _0x55383d=createListener(_0x4b71('0x6')+_0x736bea,_0x32a442);FaxQueueEvents['on'](_0x736bea,_0x55383d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 9d84875..95c0a6e 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents'];(function(_0x5367b6,_0x4a3f0a){var _0x4f5ee4=function(_0x421d40){while(--_0x421d40){_0x5367b6['push'](_0x5367b6['shift']());}};_0x4f5ee4(++_0x4a3f0a);}(_0x2542,0x169));var _0x2254=function(_0x2f27f4,_0x314ba5){_0x2f27f4=_0x2f27f4-0x0;var _0x1726a8=_0x2542[_0x2f27f4];return _0x1726a8;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getTeams']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x15')]('/',auth[_0x2254('0xc')](),controller[_0x2254('0x16')]);router['post'](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['addTeams']);router[_0x2254('0x15')](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x18')](_0x2254('0xe'),auth['isAuthenticated'](),controller[_0x2254('0x19')]);router['delete'](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x1a')]);router[_0x2254('0x1b')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);module[_0x2254('0x1d')]=router; \ No newline at end of file +var _0x4ccb=['index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','/:id/teams','post','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x288d9c,_0x3b78c0){var _0x283477=function(_0x411942){while(--_0x411942){_0x288d9c['push'](_0x288d9c['shift']());}};_0x283477(++_0x3b78c0);}(_0x4ccb,0x196));var _0xb4cc=function(_0xc186c3,_0x5568f){_0xc186c3=_0xc186c3-0x0;var _0x2c7783=_0x4ccb[_0xc186c3];return _0x2c7783;};'use strict';var multer=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var path=require(_0xb4cc('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4cc('0x3'));var router=express[_0xb4cc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb4cc('0x5'));var interaction=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var controller=require('./faxQueue.controller');router[_0xb4cc('0x8')]('/',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xa')]);router['get'](_0xb4cc('0xb'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xc')]);router['get'](_0xb4cc('0xd'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xe')]);router[_0xb4cc('0x8')](_0xb4cc('0xf'),auth['isAuthenticated'](),controller[_0xb4cc('0x10')]);router[_0xb4cc('0x8')]('/:id/teams',auth[_0xb4cc('0x9')](),controller['getTeams']);router[_0xb4cc('0x8')](_0xb4cc('0x11'),auth[_0xb4cc('0x9')](),controller['getAgents']);router['post']('/',auth[_0xb4cc('0x9')](),controller['create']);router['post'](_0xb4cc('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0xb4cc('0x13')](_0xb4cc('0x11'),auth[_0xb4cc('0x9')](),controller['addAgents']);router[_0xb4cc('0x14')](_0xb4cc('0xd'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0x15')]);router[_0xb4cc('0x16')]('/:id',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0x17')]);router[_0xb4cc('0x16')]('/:id/teams',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0x18')]);router[_0xb4cc('0x16')](_0xb4cc('0x11'),auth[_0xb4cc('0x9')](),controller['removeAgents']);module[_0xb4cc('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 94e7bd8..f9d6fc5 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 _0xf961=['exports','STRING','DATE','moment','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf961,0x1cf));var _0x1f96=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xf961[_0x75f869];return _0x10af8b;};'use strict';var moment=require(_0x1f96('0x0'));var Sequelize=require(_0x1f96('0x1'));module[_0x1f96('0x2')]={'uniqueid':{'type':Sequelize[_0x1f96('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1f96('0x4')]},'leaveAt':{'type':Sequelize[_0x1f96('0x4')]},'acceptAt':{'type':Sequelize[_0x1f96('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1f96('0x3')]}}; \ No newline at end of file +var _0x71ab=['sequelize','exports','STRING','DATE','moment'];(function(_0x37eca7,_0x3e016e){var _0x222bce=function(_0xebd0b7){while(--_0xebd0b7){_0x37eca7['push'](_0x37eca7['shift']());}};_0x222bce(++_0x3e016e);}(_0x71ab,0x1df));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require(_0xb71a('0x0'));var Sequelize=require(_0xb71a('0x1'));module[_0xb71a('0x2')]={'uniqueid':{'type':Sequelize[_0xb71a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb71a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb71a('0x4')]},'acceptAt':{'type':Sequelize[_0xb71a('0x4')]},'exitAt':{'type':Sequelize[_0xb71a('0x4')]},'reason':{'type':Sequelize[_0xb71a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 99d7ead..d186f08 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 _0x47fd=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','name','includeAll','include','rows','params','rawAttributes','length','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','FaxQueueReport','type'];(function(_0x17aa0d,_0x12a0a0){var _0x364be1=function(_0x55f827){while(--_0x55f827){_0x17aa0d['push'](_0x17aa0d['shift']());}};_0x364be1(++_0x12a0a0);}(_0x47fd,0x13c));var _0xd47f=function(_0x29b372,_0x14a80c){_0x29b372=_0x29b372-0x0;var _0x36ba6b=_0x47fd[_0x29b372];return _0x36ba6b;};'use strict';var emlformat=require(_0xd47f('0x0'));var rimraf=require(_0xd47f('0x1'));var zipdir=require(_0xd47f('0x2'));var jsonpatch=require(_0xd47f('0x3'));var rp=require(_0xd47f('0x4'));var moment=require(_0xd47f('0x5'));var BPromise=require(_0xd47f('0x6'));var Mustache=require(_0xd47f('0x7'));var util=require(_0xd47f('0x8'));var path=require(_0xd47f('0x9'));var sox=require('sox');var csv=require(_0xd47f('0xa'));var ejs=require(_0xd47f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd47f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd47f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd47f('0xe'));var Papa=require(_0xd47f('0xf'));var Redis=require(_0xd47f('0x10'));var authService=require(_0xd47f('0x11'));var qs=require(_0xd47f('0x12'));var as=require(_0xd47f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd47f('0x14'))(_0xd47f('0x15'));var utils=require('../../config/utils');var config=require(_0xd47f('0x16'));var licenseUtil=require(_0xd47f('0x17'));var db=require(_0xd47f('0x18'))['db'];function respondWithStatusCode(_0x392009,_0x2aca02){_0x2aca02=_0x2aca02||0xcc;return function(_0x3fa73b){if(_0x3fa73b){return _0x392009['sendStatus'](_0x2aca02);}return _0x392009[_0xd47f('0x19')](_0x2aca02)[_0xd47f('0x1a')]();};}function respondWithResult(_0x18e12f,_0x38038f){_0x38038f=_0x38038f||0xc8;return function(_0xd6bb87){if(_0xd6bb87){return _0x18e12f[_0xd47f('0x19')](_0x38038f)[_0xd47f('0x1b')](_0xd6bb87);}};}function respondWithFilteredResult(_0x68fbd2,_0x3e1558){return function(_0x567f43){if(_0x567f43){var _0x4a1a6c=typeof _0x3e1558[_0xd47f('0x1c')]===_0xd47f('0x1d')&&typeof _0x3e1558['limit']===_0xd47f('0x1d');var _0x44973a=_0x567f43[_0xd47f('0x1e')];var _0x40c533=_0x4a1a6c?0x0:_0x3e1558[_0xd47f('0x1c')];var _0x5e5cf6=_0x4a1a6c?_0x567f43[_0xd47f('0x1e')]:_0x3e1558[_0xd47f('0x1c')]+_0x3e1558[_0xd47f('0x1f')];var _0x77e050;if(_0x5e5cf6>=_0x44973a){_0x5e5cf6=_0x44973a;_0x77e050=0xc8;}else{_0x77e050=0xce;}_0x68fbd2[_0xd47f('0x19')](_0x77e050);return _0x68fbd2[_0xd47f('0x20')](_0xd47f('0x21'),_0x40c533+'-'+_0x5e5cf6+'/'+_0x44973a)[_0xd47f('0x1b')](_0x567f43);}return null;};}function patchUpdates(_0x3663d3){return function(_0x1b93d3){try{jsonpatch[_0xd47f('0x22')](_0x1b93d3,_0x3663d3,!![]);}catch(_0x3f2e37){return BPromise[_0xd47f('0x23')](_0x3f2e37);}return _0x1b93d3['save']();};}function saveUpdates(_0x50f3f6,_0x336e1){return function(_0x58ee0b){if(_0x58ee0b){return _0x58ee0b[_0xd47f('0x24')](_0x50f3f6)[_0xd47f('0x25')](function(_0x117d9b){return _0x117d9b;});}return null;};}function removeEntity(_0x5695c5,_0x53a538){return function(_0x50b1d6){if(_0x50b1d6){return _0x50b1d6[_0xd47f('0x26')]()[_0xd47f('0x25')](function(){_0x5695c5[_0xd47f('0x19')](0xcc)[_0xd47f('0x1a')]();});}};}function handleEntityNotFound(_0x3f55b0,_0x5f3118){return function(_0x345f15){if(!_0x345f15){_0x3f55b0['sendStatus'](0x194);}return _0x345f15;};}function handleError(_0x5abfe5,_0x598ae8){_0x598ae8=_0x598ae8||0x1f4;return function(_0x4dc109){logger[_0xd47f('0x27')](_0x4dc109[_0xd47f('0x28')]);if(_0x4dc109['name']){delete _0x4dc109['name'];}_0x5abfe5[_0xd47f('0x19')](_0x598ae8)[_0xd47f('0x29')](_0x4dc109);};}exports['index']=function(_0x18d261,_0x375476){var _0x2bf6ab={},_0x1efde3={},_0x2c745b={'count':0x0,'rows':[]};var _0x2e4777=_['map'](db[_0xd47f('0x2a')]['rawAttributes'],function(_0x3f82b7){return{'name':_0x3f82b7['fieldName'],'type':_0x3f82b7[_0xd47f('0x2b')][_0xd47f('0x2c')]};});_0x1efde3[_0xd47f('0x2d')]=_['map'](_0x2e4777,'name');_0x1efde3[_0xd47f('0x2e')]=_[_0xd47f('0x2f')](_0x18d261[_0xd47f('0x2e')]);_0x1efde3[_0xd47f('0x30')]=_[_0xd47f('0x31')](_0x1efde3[_0xd47f('0x2d')],_0x1efde3[_0xd47f('0x2e')]);_0x2bf6ab[_0xd47f('0x32')]=_['intersection'](_0x1efde3[_0xd47f('0x2d')],qs[_0xd47f('0x33')](_0x18d261[_0xd47f('0x2e')][_0xd47f('0x33')]));_0x2bf6ab[_0xd47f('0x32')]=_0x2bf6ab[_0xd47f('0x32')]['length']?_0x2bf6ab[_0xd47f('0x32')]:_0x1efde3[_0xd47f('0x2d')];if(!_0x18d261[_0xd47f('0x2e')][_0xd47f('0x34')]('nolimit')){_0x2bf6ab[_0xd47f('0x1f')]=qs[_0xd47f('0x1f')](_0x18d261[_0xd47f('0x2e')]['limit']);_0x2bf6ab['offset']=qs[_0xd47f('0x1c')](_0x18d261[_0xd47f('0x2e')][_0xd47f('0x1c')]);}_0x2bf6ab['order']=qs[_0xd47f('0x35')](_0x18d261['query'][_0xd47f('0x35')]);_0x2bf6ab[_0xd47f('0x36')]=qs[_0xd47f('0x30')](_[_0xd47f('0x37')](_0x18d261[_0xd47f('0x2e')],_0x1efde3['filters']),_0x2e4777);if(_0x18d261['query'][_0xd47f('0x38')]){_0x2bf6ab[_0xd47f('0x36')]=_[_0xd47f('0x39')](_0x2bf6ab['where'],{'$or':_[_0xd47f('0x3a')](_0x2e4777,function(_0x17760f){if(_0x17760f[_0xd47f('0x2b')]!==_0xd47f('0x3b')){var _0x170618={};_0x170618[_0x17760f[_0xd47f('0x3c')]]={'$like':'%'+_0x18d261['query'][_0xd47f('0x38')]+'%'};return _0x170618;}})});}_0x2bf6ab=_[_0xd47f('0x39')]({},_0x2bf6ab,_0x18d261['options']);var _0x58ecc6={'where':_0x2bf6ab[_0xd47f('0x36')]};return db['FaxQueueReport'][_0xd47f('0x1e')](_0x58ecc6)[_0xd47f('0x25')](function(_0x5b918e){_0x2c745b[_0xd47f('0x1e')]=_0x5b918e;if(_0x18d261[_0xd47f('0x2e')][_0xd47f('0x3d')]){_0x2bf6ab[_0xd47f('0x3e')]=[{'all':!![]}];}return db[_0xd47f('0x2a')]['findAll'](_0x2bf6ab);})[_0xd47f('0x25')](function(_0x544a7e){_0x2c745b[_0xd47f('0x3f')]=_0x544a7e;return _0x2c745b;})[_0xd47f('0x25')](respondWithFilteredResult(_0x375476,_0x2bf6ab))['catch'](handleError(_0x375476,null));};exports['show']=function(_0x5b2dd3,_0x448177){var _0x50368c={'raw':!![],'where':{'id':_0x5b2dd3[_0xd47f('0x40')]['id']}},_0x5567e5={};_0x5567e5[_0xd47f('0x2d')]=_[_0xd47f('0x2f')](db['FaxQueueReport'][_0xd47f('0x41')]);_0x5567e5[_0xd47f('0x2e')]=_[_0xd47f('0x2f')](_0x5b2dd3[_0xd47f('0x2e')]);_0x5567e5['filters']=_[_0xd47f('0x31')](_0x5567e5['model'],_0x5567e5[_0xd47f('0x2e')]);_0x50368c[_0xd47f('0x32')]=_['intersection'](_0x5567e5[_0xd47f('0x2d')],qs[_0xd47f('0x33')](_0x5b2dd3[_0xd47f('0x2e')][_0xd47f('0x33')]));_0x50368c[_0xd47f('0x32')]=_0x50368c[_0xd47f('0x32')][_0xd47f('0x42')]?_0x50368c[_0xd47f('0x32')]:_0x5567e5[_0xd47f('0x2d')];if(_0x5b2dd3[_0xd47f('0x2e')]['includeAll']){_0x50368c['include']=[{'all':!![]}];}_0x50368c=_[_0xd47f('0x39')]({},_0x50368c,_0x5b2dd3[_0xd47f('0x43')]);return db['FaxQueueReport'][_0xd47f('0x44')](_0x50368c)[_0xd47f('0x25')](handleEntityNotFound(_0x448177,null))['then'](respondWithResult(_0x448177,null))[_0xd47f('0x45')](handleError(_0x448177,null));};exports[_0xd47f('0x46')]=function(_0x474902,_0x3fe1ce){return db[_0xd47f('0x2a')][_0xd47f('0x46')](_0x474902['body'],{})[_0xd47f('0x25')](respondWithResult(_0x3fe1ce,0xc9))[_0xd47f('0x45')](handleError(_0x3fe1ce,null));};exports['update']=function(_0x532c08,_0x174c65){if(_0x532c08['body']['id']){delete _0x532c08[_0xd47f('0x47')]['id'];}return db[_0xd47f('0x2a')][_0xd47f('0x44')]({'where':{'id':_0x532c08[_0xd47f('0x40')]['id']}})[_0xd47f('0x25')](handleEntityNotFound(_0x174c65,null))['then'](saveUpdates(_0x532c08['body'],null))[_0xd47f('0x25')](respondWithResult(_0x174c65,null))['catch'](handleError(_0x174c65,null));};exports['destroy']=function(_0x335968,_0x5e5c0a){return db[_0xd47f('0x2a')][_0xd47f('0x44')]({'where':{'id':_0x335968[_0xd47f('0x40')]['id']}})[_0xd47f('0x25')](handleEntityNotFound(_0x5e5c0a,null))[_0xd47f('0x25')](removeEntity(_0x5e5c0a,null))['catch'](handleError(_0x5e5c0a,null));};exports['describe']=function(_0x316678,_0x5655ab){return db[_0xd47f('0x2a')]['describe']()[_0xd47f('0x25')](respondWithResult(_0x5655ab,null))['catch'](handleError(_0x5655ab,null));}; \ No newline at end of file +var _0x5620=['../../config/environment','../../config/license/util','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','end','error','stack','name','index','FaxQueueReport','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x3635bd,_0x1d3c58){var _0x18fed8=function(_0x5aad5e){while(--_0x5aad5e){_0x3635bd['push'](_0x3635bd['shift']());}};_0x18fed8(++_0x1d3c58);}(_0x5620,0xbf));var _0x0562=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0x5620[_0x5090d4];return _0x56c310;};'use strict';var emlformat=require(_0x0562('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0562('0x1'));var jsonpatch=require(_0x0562('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0562('0x3'));var util=require('util');var path=require(_0x0562('0x4'));var sox=require('sox');var csv=require(_0x0562('0x5'));var ejs=require(_0x0562('0x6'));var fs=require('fs');var fs_extra=require(_0x0562('0x7'));var _=require(_0x0562('0x8'));var squel=require(_0x0562('0x9'));var crypto=require(_0x0562('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0562('0x5'));var querystring=require('querystring');var Papa=require(_0x0562('0xb'));var Redis=require(_0x0562('0xc'));var authService=require(_0x0562('0xd'));var qs=require(_0x0562('0xe'));var as=require(_0x0562('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0562('0x10'))(_0x0562('0x11'));var utils=require(_0x0562('0x12'));var config=require(_0x0562('0x13'));var licenseUtil=require(_0x0562('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57555a,_0x24989c){_0x24989c=_0x24989c||0xcc;return function(_0x30b337){if(_0x30b337){return _0x57555a[_0x0562('0x15')](_0x24989c);}return _0x57555a[_0x0562('0x16')](_0x24989c)['end']();};}function respondWithResult(_0x160656,_0xe654c7){_0xe654c7=_0xe654c7||0xc8;return function(_0x3ed2c8){if(_0x3ed2c8){return _0x160656[_0x0562('0x16')](_0xe654c7)['json'](_0x3ed2c8);}};}function respondWithFilteredResult(_0x37e9c6,_0x4ed54d){return function(_0x4711c1){if(_0x4711c1){var _0x31579e=typeof _0x4ed54d['offset']===_0x0562('0x17')&&typeof _0x4ed54d['limit']===_0x0562('0x17');var _0x16d18e=_0x4711c1[_0x0562('0x18')];var _0x554527=_0x31579e?0x0:_0x4ed54d[_0x0562('0x19')];var _0x5d6341=_0x31579e?_0x4711c1[_0x0562('0x18')]:_0x4ed54d['offset']+_0x4ed54d[_0x0562('0x1a')];var _0x1a13e5;if(_0x5d6341>=_0x16d18e){_0x5d6341=_0x16d18e;_0x1a13e5=0xc8;}else{_0x1a13e5=0xce;}_0x37e9c6['status'](_0x1a13e5);return _0x37e9c6[_0x0562('0x1b')](_0x0562('0x1c'),_0x554527+'-'+_0x5d6341+'/'+_0x16d18e)[_0x0562('0x1d')](_0x4711c1);}return null;};}function patchUpdates(_0x90626d){return function(_0x5dbc61){try{jsonpatch[_0x0562('0x1e')](_0x5dbc61,_0x90626d,!![]);}catch(_0x5819b8){return BPromise['reject'](_0x5819b8);}return _0x5dbc61['save']();};}function saveUpdates(_0x4bbcf7,_0x35f245){return function(_0x37f493){if(_0x37f493){return _0x37f493[_0x0562('0x1f')](_0x4bbcf7)[_0x0562('0x20')](function(_0x14024b){return _0x14024b;});}return null;};}function removeEntity(_0x541e82,_0x5121ee){return function(_0x3e06ab){if(_0x3e06ab){return _0x3e06ab[_0x0562('0x21')]()[_0x0562('0x20')](function(){_0x541e82[_0x0562('0x16')](0xcc)[_0x0562('0x22')]();});}};}function handleEntityNotFound(_0x57c34f,_0x4123e4){return function(_0x98ee54){if(!_0x98ee54){_0x57c34f[_0x0562('0x15')](0x194);}return _0x98ee54;};}function handleError(_0x23d10a,_0x1adf63){_0x1adf63=_0x1adf63||0x1f4;return function(_0xade948){logger[_0x0562('0x23')](_0xade948[_0x0562('0x24')]);if(_0xade948[_0x0562('0x25')]){delete _0xade948[_0x0562('0x25')];}_0x23d10a[_0x0562('0x16')](_0x1adf63)['send'](_0xade948);};}exports[_0x0562('0x26')]=function(_0x4ea641,_0x1acaff){var _0x2ec92b={},_0x5e09e1={},_0x49f584={'count':0x0,'rows':[]};var _0x51ac77=_['map'](db[_0x0562('0x27')]['rawAttributes'],function(_0x16b3bb){return{'name':_0x16b3bb[_0x0562('0x28')],'type':_0x16b3bb[_0x0562('0x29')][_0x0562('0x2a')]};});_0x5e09e1[_0x0562('0x2b')]=_[_0x0562('0x2c')](_0x51ac77,_0x0562('0x25'));_0x5e09e1[_0x0562('0x2d')]=_[_0x0562('0x2e')](_0x4ea641[_0x0562('0x2d')]);_0x5e09e1['filters']=_[_0x0562('0x2f')](_0x5e09e1[_0x0562('0x2b')],_0x5e09e1['query']);_0x2ec92b['attributes']=_[_0x0562('0x2f')](_0x5e09e1['model'],qs['fields'](_0x4ea641[_0x0562('0x2d')][_0x0562('0x30')]));_0x2ec92b['attributes']=_0x2ec92b[_0x0562('0x31')][_0x0562('0x32')]?_0x2ec92b[_0x0562('0x31')]:_0x5e09e1['model'];if(!_0x4ea641[_0x0562('0x2d')][_0x0562('0x33')](_0x0562('0x34'))){_0x2ec92b[_0x0562('0x1a')]=qs[_0x0562('0x1a')](_0x4ea641[_0x0562('0x2d')]['limit']);_0x2ec92b[_0x0562('0x19')]=qs[_0x0562('0x19')](_0x4ea641[_0x0562('0x2d')][_0x0562('0x19')]);}_0x2ec92b['order']=qs[_0x0562('0x35')](_0x4ea641['query'][_0x0562('0x35')]);_0x2ec92b[_0x0562('0x36')]=qs[_0x0562('0x37')](_[_0x0562('0x38')](_0x4ea641[_0x0562('0x2d')],_0x5e09e1[_0x0562('0x37')]),_0x51ac77);if(_0x4ea641[_0x0562('0x2d')]['filter']){_0x2ec92b['where']=_[_0x0562('0x39')](_0x2ec92b[_0x0562('0x36')],{'$or':_[_0x0562('0x2c')](_0x51ac77,function(_0x5b1584){if(_0x5b1584[_0x0562('0x29')]!=='VIRTUAL'){var _0x3aeedc={};_0x3aeedc[_0x5b1584['name']]={'$like':'%'+_0x4ea641['query']['filter']+'%'};return _0x3aeedc;}})});}_0x2ec92b=_[_0x0562('0x39')]({},_0x2ec92b,_0x4ea641[_0x0562('0x3a')]);var _0x46e0a3={'where':_0x2ec92b[_0x0562('0x36')]};return db[_0x0562('0x27')]['count'](_0x46e0a3)[_0x0562('0x20')](function(_0x17c60b){_0x49f584[_0x0562('0x18')]=_0x17c60b;if(_0x4ea641[_0x0562('0x2d')][_0x0562('0x3b')]){_0x2ec92b[_0x0562('0x3c')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x0562('0x3d')](_0x2ec92b);})['then'](function(_0x1646a7){_0x49f584[_0x0562('0x3e')]=_0x1646a7;return _0x49f584;})[_0x0562('0x20')](respondWithFilteredResult(_0x1acaff,_0x2ec92b))['catch'](handleError(_0x1acaff,null));};exports['show']=function(_0x3e66c7,_0x33e939){var _0x178857={'raw':!![],'where':{'id':_0x3e66c7[_0x0562('0x3f')]['id']}},_0x4d3ec0={};_0x4d3ec0[_0x0562('0x2b')]=_[_0x0562('0x2e')](db[_0x0562('0x27')][_0x0562('0x40')]);_0x4d3ec0[_0x0562('0x2d')]=_[_0x0562('0x2e')](_0x3e66c7['query']);_0x4d3ec0['filters']=_['intersection'](_0x4d3ec0[_0x0562('0x2b')],_0x4d3ec0[_0x0562('0x2d')]);_0x178857[_0x0562('0x31')]=_[_0x0562('0x2f')](_0x4d3ec0['model'],qs['fields'](_0x3e66c7[_0x0562('0x2d')][_0x0562('0x30')]));_0x178857[_0x0562('0x31')]=_0x178857['attributes'][_0x0562('0x32')]?_0x178857['attributes']:_0x4d3ec0[_0x0562('0x2b')];if(_0x3e66c7['query'][_0x0562('0x3b')]){_0x178857[_0x0562('0x3c')]=[{'all':!![]}];}_0x178857=_[_0x0562('0x39')]({},_0x178857,_0x3e66c7[_0x0562('0x3a')]);return db[_0x0562('0x27')][_0x0562('0x41')](_0x178857)[_0x0562('0x20')](handleEntityNotFound(_0x33e939,null))['then'](respondWithResult(_0x33e939,null))[_0x0562('0x42')](handleError(_0x33e939,null));};exports['create']=function(_0x52285a,_0x5bc8f5){return db['FaxQueueReport'][_0x0562('0x43')](_0x52285a[_0x0562('0x44')],{})[_0x0562('0x20')](respondWithResult(_0x5bc8f5,0xc9))[_0x0562('0x42')](handleError(_0x5bc8f5,null));};exports[_0x0562('0x1f')]=function(_0x4fbab8,_0x58f228){if(_0x4fbab8['body']['id']){delete _0x4fbab8[_0x0562('0x44')]['id'];}return db[_0x0562('0x27')][_0x0562('0x41')]({'where':{'id':_0x4fbab8[_0x0562('0x3f')]['id']}})['then'](handleEntityNotFound(_0x58f228,null))[_0x0562('0x20')](saveUpdates(_0x4fbab8[_0x0562('0x44')],null))[_0x0562('0x20')](respondWithResult(_0x58f228,null))[_0x0562('0x42')](handleError(_0x58f228,null));};exports['destroy']=function(_0x40759d,_0x269339){return db[_0x0562('0x27')][_0x0562('0x41')]({'where':{'id':_0x40759d['params']['id']}})[_0x0562('0x20')](handleEntityNotFound(_0x269339,null))['then'](removeEntity(_0x269339,null))['catch'](handleError(_0x269339,null));};exports[_0x0562('0x45')]=function(_0x3bb2ec,_0x2cfe0f){return db['FaxQueueReport'][_0x0562('0x45')]()['then'](respondWithResult(_0x2cfe0f,null))[_0x0562('0x42')](handleError(_0x2cfe0f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index f0070b6..54864a7 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5ddd66,_0x3d530c){_0x5ddd66=_0x5ddd66-0x0;var _0x4d74ed=_0x1cb9[_0x5ddd66];return _0x4d74ed;};'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 +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x1ab396,_0x221eca){var _0xc9bd7d=function(_0x5e7be4){while(--_0x5e7be4){_0x1ab396['push'](_0x1ab396['shift']());}};_0xc9bd7d(++_0x221eca);}(_0x5fc3,0xa8));var _0x35fc=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x5fc3[_0x6173fc];return _0x965fbe;};'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')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index d42db19..2cf3b7d 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 _0xab90=['then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateFaxQueueReport','body','options','catch','update','raw','where','attributes','limit','UpdateFaxQueueReport','stringify','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5a6f9b,_0x3f0261){var _0x5e583a=function(_0x2e5ec2){while(--_0x2e5ec2){_0x5a6f9b['push'](_0x5a6f9b['shift']());}};_0x5e583a(++_0x3f0261);}(_0xab90,0x91));var _0x0ab9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xab90[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require(_0x0ab9('0x0'));var moment=require(_0x0ab9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ab9('0x3'));var logger=require(_0x0ab9('0x4'))(_0x0ab9('0x5'));var config=require(_0x0ab9('0x6'));var jayson=require(_0x0ab9('0x7'));var client=jayson[_0x0ab9('0x8')][_0x0ab9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d2ae2,_0x2aac43,_0x2e73bb){return new BPromise(function(_0x4979cb,_0x16a3ae){return client['request'](_0x4d2ae2,_0x2e73bb)[_0x0ab9('0xa')](function(_0x47e079){logger[_0x0ab9('0xb')](_0x0ab9('0xc'),_0x2aac43,'request\x20sent');logger[_0x0ab9('0xd')](_0x0ab9('0xe'),_0x2aac43,_0x0ab9('0xf'),JSON['stringify'](_0x47e079));if(_0x47e079[_0x0ab9('0x10')]){if(_0x47e079[_0x0ab9('0x10')][_0x0ab9('0x11')]===0x1f4){logger[_0x0ab9('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x2aac43,_0x47e079[_0x0ab9('0x10')]['message']);return _0x16a3ae(_0x47e079[_0x0ab9('0x10')]['message']);}logger[_0x0ab9('0x10')](_0x0ab9('0xc'),_0x2aac43,_0x47e079[_0x0ab9('0x10')]['message']);return _0x4979cb(_0x47e079[_0x0ab9('0x10')][_0x0ab9('0x12')]);}else{logger[_0x0ab9('0xb')](_0x0ab9('0xc'),_0x2aac43,_0x0ab9('0xf'));_0x4979cb(_0x47e079[_0x0ab9('0x13')][_0x0ab9('0x12')]);}})['catch'](function(_0x11cdba){logger[_0x0ab9('0x10')](_0x0ab9('0xc'),_0x2aac43,_0x11cdba);_0x16a3ae(_0x11cdba);});});}exports[_0x0ab9('0x14')]=function(_0x4053b8){var _0x4c6f87=this;return new Promise(function(_0x224525,_0x2e51bf){return db['FaxQueueReport']['create'](_0x4053b8[_0x0ab9('0x15')],{'raw':_0x4053b8[_0x0ab9('0x16')]?_0x4053b8[_0x0ab9('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x0ab9('0xa')](function(_0xcd3a01){logger[_0x0ab9('0xb')](_0x0ab9('0x14'),_0x4053b8);logger[_0x0ab9('0xd')](_0x0ab9('0x14'),_0x4053b8,JSON['stringify'](_0xcd3a01));_0x224525(_0xcd3a01);})[_0x0ab9('0x17')](function(_0x192c31){logger[_0x0ab9('0x10')](_0x0ab9('0x14'),_0x192c31[_0x0ab9('0x12')],_0x4053b8);_0x2e51bf(_0x4c6f87[_0x0ab9('0x10')](0x1f4,_0x192c31[_0x0ab9('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x2afa0a){var _0x1de286=this;return new Promise(function(_0x23d90b,_0x119ec){return db['FaxQueueReport'][_0x0ab9('0x18')](_0x2afa0a[_0x0ab9('0x15')],{'raw':_0x2afa0a[_0x0ab9('0x16')]?_0x2afa0a[_0x0ab9('0x16')][_0x0ab9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2afa0a[_0x0ab9('0x16')]?_0x2afa0a[_0x0ab9('0x16')][_0x0ab9('0x1a')]||null:null,'attributes':_0x2afa0a['options']?_0x2afa0a[_0x0ab9('0x16')][_0x0ab9('0x1b')]||null:null,'limit':_0x2afa0a[_0x0ab9('0x16')]?_0x2afa0a[_0x0ab9('0x16')][_0x0ab9('0x1c')]||null:null})['then'](function(_0xb521a6){logger[_0x0ab9('0xb')](_0x0ab9('0x1d'),_0x2afa0a);logger[_0x0ab9('0xd')](_0x0ab9('0x1d'),_0x2afa0a,JSON[_0x0ab9('0x1e')](_0xb521a6));_0x23d90b(_0xb521a6);})[_0x0ab9('0x17')](function(_0x461fe7){logger[_0x0ab9('0x10')](_0x0ab9('0x1d'),_0x461fe7[_0x0ab9('0x12')],_0x2afa0a);_0x119ec(_0x1de286[_0x0ab9('0x10')](0x1f4,_0x461fe7[_0x0ab9('0x12')]));});});}; \ No newline at end of file +var _0x36bd=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x450f20,_0x2a3a4d){var _0x3226a7=function(_0x1feb4d){while(--_0x1feb4d){_0x450f20['push'](_0x450f20['shift']());}};_0x3226a7(++_0x2a3a4d);}(_0x36bd,0x9e));var _0xd36b=function(_0x195312,_0x5c0021){_0x195312=_0x195312-0x0;var _0x38cd72=_0x36bd[_0x195312];return _0x38cd72;};'use strict';var _=require(_0xd36b('0x0'));var util=require(_0xd36b('0x1'));var moment=require(_0xd36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd36b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd36b('0x4'))['db'];var utils=require(_0xd36b('0x5'));var logger=require(_0xd36b('0x6'))('rpc');var config=require(_0xd36b('0x7'));var jayson=require(_0xd36b('0x8'));var client=jayson['client'][_0xd36b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ffbe8,_0x32e704,_0x430e5b){return new BPromise(function(_0x19d94c,_0x226a60){return client[_0xd36b('0xa')](_0x2ffbe8,_0x430e5b)[_0xd36b('0xb')](function(_0x48ec8b){logger[_0xd36b('0xc')](_0xd36b('0xd'),_0x32e704,_0xd36b('0xe'));logger[_0xd36b('0xf')](_0xd36b('0x10'),_0x32e704,_0xd36b('0xe'),JSON[_0xd36b('0x11')](_0x48ec8b));if(_0x48ec8b[_0xd36b('0x12')]){if(_0x48ec8b['error'][_0xd36b('0x13')]===0x1f4){logger['error'](_0xd36b('0xd'),_0x32e704,_0x48ec8b[_0xd36b('0x12')]['message']);return _0x226a60(_0x48ec8b['error'][_0xd36b('0x14')]);}logger[_0xd36b('0x12')](_0xd36b('0xd'),_0x32e704,_0x48ec8b[_0xd36b('0x12')][_0xd36b('0x14')]);return _0x19d94c(_0x48ec8b[_0xd36b('0x12')][_0xd36b('0x14')]);}else{logger[_0xd36b('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x32e704,'request\x20sent');_0x19d94c(_0x48ec8b[_0xd36b('0x15')][_0xd36b('0x14')]);}})[_0xd36b('0x16')](function(_0x46a975){logger[_0xd36b('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x32e704,_0x46a975);_0x226a60(_0x46a975);});});}exports['CreateFaxQueueReport']=function(_0xb9aabf){var _0x110c9a=this;return new Promise(function(_0x359e60,_0x37729f){return db[_0xd36b('0x17')][_0xd36b('0x18')](_0xb9aabf[_0xd36b('0x19')],{'raw':_0xb9aabf['options']?_0xb9aabf[_0xd36b('0x1a')][_0xd36b('0x1b')]===undefined?!![]:![]:!![]})[_0xd36b('0xb')](function(_0x14d4bc){logger[_0xd36b('0xc')](_0xd36b('0x1c'),_0xb9aabf);logger[_0xd36b('0xf')](_0xd36b('0x1c'),_0xb9aabf,JSON['stringify'](_0x14d4bc));_0x359e60(_0x14d4bc);})['catch'](function(_0xb63603){logger['error']('CreateFaxQueueReport',_0xb63603[_0xd36b('0x14')],_0xb9aabf);_0x37729f(_0x110c9a[_0xd36b('0x12')](0x1f4,_0xb63603[_0xd36b('0x14')]));});});};exports[_0xd36b('0x1d')]=function(_0x20181e){var _0x46b79e=this;return new Promise(function(_0x330702,_0x27129c){return db[_0xd36b('0x17')][_0xd36b('0x1e')](_0x20181e['body'],{'raw':_0x20181e[_0xd36b('0x1a')]?_0x20181e['options'][_0xd36b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20181e[_0xd36b('0x1a')]?_0x20181e[_0xd36b('0x1a')][_0xd36b('0x1f')]||null:null,'attributes':_0x20181e[_0xd36b('0x1a')]?_0x20181e[_0xd36b('0x1a')][_0xd36b('0x20')]||null:null,'limit':_0x20181e['options']?_0x20181e[_0xd36b('0x1a')][_0xd36b('0x21')]||null:null})['then'](function(_0x3a2939){logger[_0xd36b('0xc')](_0xd36b('0x1d'),_0x20181e);logger[_0xd36b('0xf')](_0xd36b('0x1d'),_0x20181e,JSON[_0xd36b('0x11')](_0x3a2939));_0x330702(_0x3a2939);})['catch'](function(_0x3bdcdc){logger[_0xd36b('0x12')](_0xd36b('0x1d'),_0x3bdcdc['message'],_0x20181e);_0x27129c(_0x46b79e[_0xd36b('0x12')](0x1f4,_0x3bdcdc[_0xd36b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 4bef6d5..0a27065 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 _0x0503=['describe','/:id','show','create','update','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','isAuthenticated'];(function(_0x436081,_0x3dd45b){var _0x28c976=function(_0x520d14){while(--_0x520d14){_0x436081['push'](_0x436081['shift']());}};_0x28c976(++_0x3dd45b);}(_0x0503,0x1c1));var _0x3050=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x0503[_0x38ced4];return _0x547c07;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3050('0x0'));var express=require(_0x3050('0x1'));var router=express[_0x3050('0x2')]();var fs_extra=require(_0x3050('0x3'));var auth=require(_0x3050('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3050('0x5'));var controller=require(_0x3050('0x6'));router[_0x3050('0x7')]('/',auth['isAuthenticated'](),controller[_0x3050('0x8')]);router[_0x3050('0x7')]('/describe',auth[_0x3050('0x9')](),controller[_0x3050('0xa')]);router['get'](_0x3050('0xb'),auth[_0x3050('0x9')](),controller[_0x3050('0xc')]);router['post']('/',auth[_0x3050('0x9')](),controller[_0x3050('0xd')]);router['put'](_0x3050('0xb'),auth['isAuthenticated'](),controller[_0x3050('0xe')]);router['delete'](_0x3050('0xb'),auth[_0x3050('0x9')](),controller[_0x3050('0xf')]);module[_0x3050('0x10')]=router; \ No newline at end of file +var _0xa08d=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x757dd3,_0x4dd9bd){var _0x4336b1=function(_0x2fba5b){while(--_0x2fba5b){_0x757dd3['push'](_0x757dd3['shift']());}};_0x4336b1(++_0x4dd9bd);}(_0xa08d,0x175));var _0xda08=function(_0x4a5c30,_0x4cb24e){_0x4a5c30=_0x4a5c30-0x0;var _0x5d5cfc=_0xa08d[_0x4a5c30];return _0x5d5cfc;};'use strict';var multer=require(_0xda08('0x0'));var util=require(_0xda08('0x1'));var path=require('path');var timeout=require(_0xda08('0x2'));var express=require(_0xda08('0x3'));var router=express[_0xda08('0x4')]();var fs_extra=require(_0xda08('0x5'));var auth=require(_0xda08('0x6'));var interaction=require(_0xda08('0x7'));var config=require(_0xda08('0x8'));var controller=require('./faxQueueReport.controller');router[_0xda08('0x9')]('/',auth['isAuthenticated'](),controller[_0xda08('0xa')]);router[_0xda08('0x9')](_0xda08('0xb'),auth[_0xda08('0xc')](),controller[_0xda08('0xd')]);router['get'](_0xda08('0xe'),auth['isAuthenticated'](),controller[_0xda08('0xf')]);router['post']('/',auth[_0xda08('0xc')](),controller[_0xda08('0x10')]);router[_0xda08('0x11')](_0xda08('0xe'),auth[_0xda08('0xc')](),controller[_0xda08('0x12')]);router[_0xda08('0x13')](_0xda08('0xe'),auth[_0xda08('0xc')](),controller[_0xda08('0x14')]);module[_0xda08('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 3d2b0eb..99e3c76 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(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0x54ef,0x112));var _0xf54e=function(_0x2331d3,_0x263ce3){_0x2331d3=_0x2331d3-0x0;var _0x58888a=_0x54ef[_0x2331d3];return _0x58888a;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2aa392,_0x3c617){var _0x39d0e4=function(_0x197e82){while(--_0x197e82){_0x2aa392['push'](_0x2aa392['shift']());}};_0x39d0e4(++_0x3c617);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0xf3cd[_0x4a45b4];return _0x1a99c9;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 940b5b1..a637e2e 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 _0x6382=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model'];(function(_0x215f70,_0x23cc0c){var _0x3897e8=function(_0x3fd0e8){while(--_0x3fd0e8){_0x215f70['push'](_0x215f70['shift']());}};_0x3897e8(++_0x23cc0c);}(_0x6382,0x68));var _0x2638=function(_0x2c28ce,_0x2fdd1d){_0x2c28ce=_0x2c28ce-0x0;var _0x8a781c=_0x6382[_0x2c28ce];return _0x8a781c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2638('0x0'));var zipdir=require(_0x2638('0x1'));var jsonpatch=require(_0x2638('0x2'));var rp=require(_0x2638('0x3'));var moment=require('moment');var BPromise=require(_0x2638('0x4'));var Mustache=require(_0x2638('0x5'));var util=require(_0x2638('0x6'));var path=require('path');var sox=require(_0x2638('0x7'));var csv=require(_0x2638('0x8'));var ejs=require(_0x2638('0x9'));var fs=require('fs');var fs_extra=require(_0x2638('0xa'));var _=require('lodash');var squel=require(_0x2638('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2638('0xc'));var toCsv=require(_0x2638('0x8'));var querystring=require(_0x2638('0xd'));var Papa=require('papaparse');var Redis=require(_0x2638('0xe'));var authService=require(_0x2638('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2638('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2638('0x11'));var utils=require(_0x2638('0x12'));var config=require(_0x2638('0x13'));var licenseUtil=require(_0x2638('0x14'));var db=require(_0x2638('0x15'))['db'];function respondWithStatusCode(_0x3e51bb,_0x1d431f){_0x1d431f=_0x1d431f||0xcc;return function(_0x10e9a6){if(_0x10e9a6){return _0x3e51bb[_0x2638('0x16')](_0x1d431f);}return _0x3e51bb[_0x2638('0x17')](_0x1d431f)['end']();};}function respondWithResult(_0x142a7c,_0x20061d){_0x20061d=_0x20061d||0xc8;return function(_0x2edb42){if(_0x2edb42){return _0x142a7c[_0x2638('0x17')](_0x20061d)[_0x2638('0x18')](_0x2edb42);}};}function respondWithFilteredResult(_0x4f09e1,_0x2bcd9f){return function(_0x37c88b){if(_0x37c88b){var _0x4a7a98=typeof _0x2bcd9f['offset']===_0x2638('0x19')&&typeof _0x2bcd9f[_0x2638('0x1a')]===_0x2638('0x19');var _0x30a340=_0x37c88b[_0x2638('0x1b')];var _0x44f1c3=_0x4a7a98?0x0:_0x2bcd9f['offset'];var _0x5eb6fc=_0x4a7a98?_0x37c88b[_0x2638('0x1b')]:_0x2bcd9f[_0x2638('0x1c')]+_0x2bcd9f[_0x2638('0x1a')];var _0x4a45c1;if(_0x5eb6fc>=_0x30a340){_0x5eb6fc=_0x30a340;_0x4a45c1=0xc8;}else{_0x4a45c1=0xce;}_0x4f09e1['status'](_0x4a45c1);return _0x4f09e1['set'](_0x2638('0x1d'),_0x44f1c3+'-'+_0x5eb6fc+'/'+_0x30a340)['json'](_0x37c88b);}return null;};}function patchUpdates(_0x4b5b8e){return function(_0x5882bf){try{jsonpatch['apply'](_0x5882bf,_0x4b5b8e,!![]);}catch(_0x9963bb){return BPromise[_0x2638('0x1e')](_0x9963bb);}return _0x5882bf[_0x2638('0x1f')]();};}function saveUpdates(_0x46eed8,_0x45a815){return function(_0x1c5004){if(_0x1c5004){return _0x1c5004[_0x2638('0x20')](_0x46eed8)[_0x2638('0x21')](function(_0x51ab58){return _0x51ab58;});}return null;};}function removeEntity(_0x58262d,_0x233729){return function(_0x267ca9){if(_0x267ca9){return _0x267ca9[_0x2638('0x22')]()[_0x2638('0x21')](function(){_0x58262d[_0x2638('0x17')](0xcc)[_0x2638('0x23')]();});}};}function handleEntityNotFound(_0x48b4f8,_0x4f29fc){return function(_0x5053b8){if(!_0x5053b8){_0x48b4f8[_0x2638('0x16')](0x194);}return _0x5053b8;};}function handleError(_0x3b5a93,_0x1426a6){_0x1426a6=_0x1426a6||0x1f4;return function(_0x208567){logger[_0x2638('0x24')](_0x208567[_0x2638('0x25')]);if(_0x208567[_0x2638('0x26')]){delete _0x208567['name'];}_0x3b5a93['status'](_0x1426a6)[_0x2638('0x27')](_0x208567);};}exports[_0x2638('0x28')]=function(_0x52a279,_0x3af545){var _0x2a24cb={},_0x2418a8={},_0x37bd67={'count':0x0,'rows':[]};var _0x2eb34a=_[_0x2638('0x29')](db['FaxTransferReport'][_0x2638('0x2a')],function(_0x29ada9){return{'name':_0x29ada9['fieldName'],'type':_0x29ada9[_0x2638('0x2b')][_0x2638('0x2c')]};});_0x2418a8[_0x2638('0x2d')]=_[_0x2638('0x29')](_0x2eb34a,_0x2638('0x26'));_0x2418a8[_0x2638('0x2e')]=_[_0x2638('0x2f')](_0x52a279[_0x2638('0x2e')]);_0x2418a8['filters']=_['intersection'](_0x2418a8[_0x2638('0x2d')],_0x2418a8[_0x2638('0x2e')]);_0x2a24cb['attributes']=_[_0x2638('0x30')](_0x2418a8['model'],qs[_0x2638('0x31')](_0x52a279[_0x2638('0x2e')][_0x2638('0x31')]));_0x2a24cb[_0x2638('0x32')]=_0x2a24cb[_0x2638('0x32')][_0x2638('0x33')]?_0x2a24cb[_0x2638('0x32')]:_0x2418a8[_0x2638('0x2d')];if(!_0x52a279['query'][_0x2638('0x34')](_0x2638('0x35'))){_0x2a24cb[_0x2638('0x1a')]=qs[_0x2638('0x1a')](_0x52a279[_0x2638('0x2e')][_0x2638('0x1a')]);_0x2a24cb[_0x2638('0x1c')]=qs['offset'](_0x52a279[_0x2638('0x2e')][_0x2638('0x1c')]);}_0x2a24cb[_0x2638('0x36')]=qs[_0x2638('0x37')](_0x52a279['query']['sort']);_0x2a24cb['where']=qs[_0x2638('0x38')](_[_0x2638('0x39')](_0x52a279[_0x2638('0x2e')],_0x2418a8[_0x2638('0x38')]),_0x2eb34a);if(_0x52a279[_0x2638('0x2e')]['filter']){_0x2a24cb[_0x2638('0x3a')]=_[_0x2638('0x3b')](_0x2a24cb[_0x2638('0x3a')],{'$or':_['map'](_0x2eb34a,function(_0x248c68){if(_0x248c68['type']!==_0x2638('0x3c')){var _0x2e72ac={};_0x2e72ac[_0x248c68['name']]={'$like':'%'+_0x52a279[_0x2638('0x2e')][_0x2638('0x3d')]+'%'};return _0x2e72ac;}})});}_0x2a24cb=_[_0x2638('0x3b')]({},_0x2a24cb,_0x52a279[_0x2638('0x3e')]);var _0x5cdcbe={'where':_0x2a24cb[_0x2638('0x3a')]};return db[_0x2638('0x3f')]['count'](_0x5cdcbe)[_0x2638('0x21')](function(_0x3752a0){_0x37bd67[_0x2638('0x1b')]=_0x3752a0;if(_0x52a279[_0x2638('0x2e')][_0x2638('0x40')]){_0x2a24cb[_0x2638('0x41')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x2638('0x42')](_0x2a24cb);})['then'](function(_0x2abd96){_0x37bd67[_0x2638('0x43')]=_0x2abd96;return _0x37bd67;})[_0x2638('0x21')](respondWithFilteredResult(_0x3af545,_0x2a24cb))[_0x2638('0x44')](handleError(_0x3af545,null));};exports[_0x2638('0x45')]=function(_0x14b920,_0x11901b){var _0x350df8={'raw':!![],'where':{'id':_0x14b920[_0x2638('0x46')]['id']}},_0x1597c7={};_0x1597c7[_0x2638('0x2d')]=_[_0x2638('0x2f')](db[_0x2638('0x3f')][_0x2638('0x2a')]);_0x1597c7[_0x2638('0x2e')]=_[_0x2638('0x2f')](_0x14b920[_0x2638('0x2e')]);_0x1597c7[_0x2638('0x38')]=_[_0x2638('0x30')](_0x1597c7[_0x2638('0x2d')],_0x1597c7[_0x2638('0x2e')]);_0x350df8[_0x2638('0x32')]=_[_0x2638('0x30')](_0x1597c7['model'],qs[_0x2638('0x31')](_0x14b920[_0x2638('0x2e')]['fields']));_0x350df8[_0x2638('0x32')]=_0x350df8['attributes'][_0x2638('0x33')]?_0x350df8[_0x2638('0x32')]:_0x1597c7[_0x2638('0x2d')];if(_0x14b920[_0x2638('0x2e')][_0x2638('0x40')]){_0x350df8[_0x2638('0x41')]=[{'all':!![]}];}_0x350df8=_[_0x2638('0x3b')]({},_0x350df8,_0x14b920[_0x2638('0x3e')]);return db[_0x2638('0x3f')][_0x2638('0x47')](_0x350df8)['then'](handleEntityNotFound(_0x11901b,null))[_0x2638('0x21')](respondWithResult(_0x11901b,null))[_0x2638('0x44')](handleError(_0x11901b,null));};exports[_0x2638('0x48')]=function(_0x17fe95,_0x1ea6b2){return db['FaxTransferReport'][_0x2638('0x48')](_0x17fe95[_0x2638('0x49')],{})['then'](respondWithResult(_0x1ea6b2,0xc9))[_0x2638('0x44')](handleError(_0x1ea6b2,null));};exports[_0x2638('0x20')]=function(_0xd23fef,_0x37fb34){if(_0xd23fef[_0x2638('0x49')]['id']){delete _0xd23fef['body']['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0xd23fef[_0x2638('0x46')]['id']}})[_0x2638('0x21')](handleEntityNotFound(_0x37fb34,null))[_0x2638('0x21')](saveUpdates(_0xd23fef[_0x2638('0x49')],null))[_0x2638('0x21')](respondWithResult(_0x37fb34,null))[_0x2638('0x44')](handleError(_0x37fb34,null));};exports[_0x2638('0x22')]=function(_0x3f9c81,_0x3dbfdd){return db[_0x2638('0x3f')]['find']({'where':{'id':_0x3f9c81[_0x2638('0x46')]['id']}})[_0x2638('0x21')](handleEntityNotFound(_0x3dbfdd,null))[_0x2638('0x21')](removeEntity(_0x3dbfdd,null))[_0x2638('0x44')](handleError(_0x3dbfdd,null));};exports[_0x2638('0x4a')]=function(_0x5b59fd,_0x5196a2){return db[_0x2638('0x3f')][_0x2638('0x4a')]()[_0x2638('0x21')](respondWithResult(_0x5196a2,null))['catch'](handleError(_0x5196a2,null));}; \ No newline at end of file +var _0x52ea=['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/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment'];(function(_0x1062e3,_0x49349e){var _0x92e616=function(_0x1ca4fe){while(--_0x1ca4fe){_0x1062e3['push'](_0x1062e3['shift']());}};_0x92e616(++_0x49349e);}(_0x52ea,0x1d0));var _0xa52e=function(_0x673ea4,_0x449076){_0x673ea4=_0x673ea4-0x0;var _0x3e5938=_0x52ea[_0x673ea4];return _0x3e5938;};'use strict';var emlformat=require(_0xa52e('0x0'));var rimraf=require(_0xa52e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa52e('0x2'));var rp=require('request-promise');var moment=require(_0xa52e('0x3'));var BPromise=require(_0xa52e('0x4'));var Mustache=require(_0xa52e('0x5'));var util=require(_0xa52e('0x6'));var path=require(_0xa52e('0x7'));var sox=require(_0xa52e('0x8'));var csv=require(_0xa52e('0x9'));var ejs=require(_0xa52e('0xa'));var fs=require('fs');var fs_extra=require(_0xa52e('0xb'));var _=require(_0xa52e('0xc'));var squel=require('squel');var crypto=require(_0xa52e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa52e('0x9'));var querystring=require(_0xa52e('0xe'));var Papa=require(_0xa52e('0xf'));var Redis=require(_0xa52e('0x10'));var authService=require(_0xa52e('0x11'));var qs=require(_0xa52e('0x12'));var as=require(_0xa52e('0x13'));var hardwareService=require(_0xa52e('0x14'));var logger=require(_0xa52e('0x15'))(_0xa52e('0x16'));var utils=require(_0xa52e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa52e('0x18'))['db'];function respondWithStatusCode(_0x5c9cbd,_0x13c88c){_0x13c88c=_0x13c88c||0xcc;return function(_0x277bea){if(_0x277bea){return _0x5c9cbd[_0xa52e('0x19')](_0x13c88c);}return _0x5c9cbd[_0xa52e('0x1a')](_0x13c88c)['end']();};}function respondWithResult(_0x209319,_0x5c3550){_0x5c3550=_0x5c3550||0xc8;return function(_0x58d130){if(_0x58d130){return _0x209319[_0xa52e('0x1a')](_0x5c3550)[_0xa52e('0x1b')](_0x58d130);}};}function respondWithFilteredResult(_0x41f014,_0x4e88b6){return function(_0x50fd97){if(_0x50fd97){var _0x438a5f=typeof _0x4e88b6[_0xa52e('0x1c')]==='undefined'&&typeof _0x4e88b6[_0xa52e('0x1d')]===_0xa52e('0x1e');var _0x501fb5=_0x50fd97[_0xa52e('0x1f')];var _0x2ca428=_0x438a5f?0x0:_0x4e88b6['offset'];var _0x5f385e=_0x438a5f?_0x50fd97['count']:_0x4e88b6['offset']+_0x4e88b6[_0xa52e('0x1d')];var _0x6ec9ef;if(_0x5f385e>=_0x501fb5){_0x5f385e=_0x501fb5;_0x6ec9ef=0xc8;}else{_0x6ec9ef=0xce;}_0x41f014['status'](_0x6ec9ef);return _0x41f014[_0xa52e('0x20')](_0xa52e('0x21'),_0x2ca428+'-'+_0x5f385e+'/'+_0x501fb5)[_0xa52e('0x1b')](_0x50fd97);}return null;};}function patchUpdates(_0x115c24){return function(_0x4a9daf){try{jsonpatch[_0xa52e('0x22')](_0x4a9daf,_0x115c24,!![]);}catch(_0x4bc4e3){return BPromise[_0xa52e('0x23')](_0x4bc4e3);}return _0x4a9daf[_0xa52e('0x24')]();};}function saveUpdates(_0x2a63c1,_0x288924){return function(_0x453f52){if(_0x453f52){return _0x453f52[_0xa52e('0x25')](_0x2a63c1)[_0xa52e('0x26')](function(_0x549ec0){return _0x549ec0;});}return null;};}function removeEntity(_0x41ac98,_0x3ae6f3){return function(_0x72af4e){if(_0x72af4e){return _0x72af4e[_0xa52e('0x27')]()['then'](function(){_0x41ac98[_0xa52e('0x1a')](0xcc)[_0xa52e('0x28')]();});}};}function handleEntityNotFound(_0x5cd74d,_0x167a01){return function(_0x21c6b3){if(!_0x21c6b3){_0x5cd74d[_0xa52e('0x19')](0x194);}return _0x21c6b3;};}function handleError(_0xeba26c,_0x17ad87){_0x17ad87=_0x17ad87||0x1f4;return function(_0x1eccd2){logger[_0xa52e('0x29')](_0x1eccd2[_0xa52e('0x2a')]);if(_0x1eccd2['name']){delete _0x1eccd2[_0xa52e('0x2b')];}_0xeba26c[_0xa52e('0x1a')](_0x17ad87)[_0xa52e('0x2c')](_0x1eccd2);};}exports[_0xa52e('0x2d')]=function(_0x353956,_0x44e5f7){var _0x17a460={},_0x372fd4={},_0x1417dc={'count':0x0,'rows':[]};var _0x16c486=_[_0xa52e('0x2e')](db[_0xa52e('0x2f')]['rawAttributes'],function(_0x36fa7f){return{'name':_0x36fa7f[_0xa52e('0x30')],'type':_0x36fa7f[_0xa52e('0x31')]['key']};});_0x372fd4[_0xa52e('0x32')]=_[_0xa52e('0x2e')](_0x16c486,_0xa52e('0x2b'));_0x372fd4['query']=_[_0xa52e('0x33')](_0x353956[_0xa52e('0x34')]);_0x372fd4[_0xa52e('0x35')]=_[_0xa52e('0x36')](_0x372fd4[_0xa52e('0x32')],_0x372fd4[_0xa52e('0x34')]);_0x17a460['attributes']=_[_0xa52e('0x36')](_0x372fd4[_0xa52e('0x32')],qs[_0xa52e('0x37')](_0x353956[_0xa52e('0x34')][_0xa52e('0x37')]));_0x17a460[_0xa52e('0x38')]=_0x17a460[_0xa52e('0x38')][_0xa52e('0x39')]?_0x17a460['attributes']:_0x372fd4[_0xa52e('0x32')];if(!_0x353956['query'][_0xa52e('0x3a')](_0xa52e('0x3b'))){_0x17a460['limit']=qs[_0xa52e('0x1d')](_0x353956['query']['limit']);_0x17a460[_0xa52e('0x1c')]=qs[_0xa52e('0x1c')](_0x353956[_0xa52e('0x34')]['offset']);}_0x17a460[_0xa52e('0x3c')]=qs[_0xa52e('0x3d')](_0x353956[_0xa52e('0x34')][_0xa52e('0x3d')]);_0x17a460[_0xa52e('0x3e')]=qs[_0xa52e('0x35')](_['pick'](_0x353956[_0xa52e('0x34')],_0x372fd4[_0xa52e('0x35')]),_0x16c486);if(_0x353956[_0xa52e('0x34')][_0xa52e('0x3f')]){_0x17a460['where']=_[_0xa52e('0x40')](_0x17a460[_0xa52e('0x3e')],{'$or':_[_0xa52e('0x2e')](_0x16c486,function(_0x43f53f){if(_0x43f53f[_0xa52e('0x31')]!==_0xa52e('0x41')){var _0x2791bb={};_0x2791bb[_0x43f53f[_0xa52e('0x2b')]]={'$like':'%'+_0x353956[_0xa52e('0x34')]['filter']+'%'};return _0x2791bb;}})});}_0x17a460=_['merge']({},_0x17a460,_0x353956['options']);var _0xc567ce={'where':_0x17a460[_0xa52e('0x3e')]};return db[_0xa52e('0x2f')]['count'](_0xc567ce)[_0xa52e('0x26')](function(_0x3899ca){_0x1417dc[_0xa52e('0x1f')]=_0x3899ca;if(_0x353956[_0xa52e('0x34')][_0xa52e('0x42')]){_0x17a460['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xa52e('0x43')](_0x17a460);})[_0xa52e('0x26')](function(_0x54cddf){_0x1417dc[_0xa52e('0x44')]=_0x54cddf;return _0x1417dc;})[_0xa52e('0x26')](respondWithFilteredResult(_0x44e5f7,_0x17a460))['catch'](handleError(_0x44e5f7,null));};exports[_0xa52e('0x45')]=function(_0x387c40,_0x305a3d){var _0x53a9f4={'raw':!![],'where':{'id':_0x387c40[_0xa52e('0x46')]['id']}},_0x47c349={};_0x47c349[_0xa52e('0x32')]=_[_0xa52e('0x33')](db['FaxTransferReport'][_0xa52e('0x47')]);_0x47c349['query']=_[_0xa52e('0x33')](_0x387c40[_0xa52e('0x34')]);_0x47c349['filters']=_[_0xa52e('0x36')](_0x47c349[_0xa52e('0x32')],_0x47c349['query']);_0x53a9f4[_0xa52e('0x38')]=_['intersection'](_0x47c349[_0xa52e('0x32')],qs['fields'](_0x387c40['query']['fields']));_0x53a9f4[_0xa52e('0x38')]=_0x53a9f4['attributes'][_0xa52e('0x39')]?_0x53a9f4[_0xa52e('0x38')]:_0x47c349[_0xa52e('0x32')];if(_0x387c40[_0xa52e('0x34')][_0xa52e('0x42')]){_0x53a9f4[_0xa52e('0x48')]=[{'all':!![]}];}_0x53a9f4=_[_0xa52e('0x40')]({},_0x53a9f4,_0x387c40[_0xa52e('0x49')]);return db['FaxTransferReport'][_0xa52e('0x4a')](_0x53a9f4)['then'](handleEntityNotFound(_0x305a3d,null))[_0xa52e('0x26')](respondWithResult(_0x305a3d,null))[_0xa52e('0x4b')](handleError(_0x305a3d,null));};exports[_0xa52e('0x4c')]=function(_0x5efdeb,_0x1ab1eb){return db['FaxTransferReport'][_0xa52e('0x4c')](_0x5efdeb[_0xa52e('0x4d')],{})[_0xa52e('0x26')](respondWithResult(_0x1ab1eb,0xc9))['catch'](handleError(_0x1ab1eb,null));};exports[_0xa52e('0x25')]=function(_0xdedfce,_0x210f67){if(_0xdedfce['body']['id']){delete _0xdedfce['body']['id'];}return db[_0xa52e('0x2f')][_0xa52e('0x4a')]({'where':{'id':_0xdedfce[_0xa52e('0x46')]['id']}})[_0xa52e('0x26')](handleEntityNotFound(_0x210f67,null))[_0xa52e('0x26')](saveUpdates(_0xdedfce[_0xa52e('0x4d')],null))[_0xa52e('0x26')](respondWithResult(_0x210f67,null))[_0xa52e('0x4b')](handleError(_0x210f67,null));};exports['destroy']=function(_0x15bb9e,_0x43b68b){return db['FaxTransferReport']['find']({'where':{'id':_0x15bb9e['params']['id']}})[_0xa52e('0x26')](handleEntityNotFound(_0x43b68b,null))[_0xa52e('0x26')](removeEntity(_0x43b68b,null))['catch'](handleError(_0x43b68b,null));};exports['describe']=function(_0x2e62a1,_0x384281){return db[_0xa52e('0x2f')]['describe']()['then'](respondWithResult(_0x384281,null))[_0xa52e('0x4b')](handleError(_0x384281,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a8b892d..18fdc7f 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 _0x77b0=['request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x35cd95,_0x2c6256){var _0x58c05c=function(_0x226f15){while(--_0x226f15){_0x35cd95['push'](_0x35cd95['shift']());}};_0x58c05c(++_0x2c6256);}(_0x77b0,0xd4));var _0x077b=function(_0x35cbb5,_0x57a4b3){_0x35cbb5=_0x35cbb5-0x0;var _0x31e0a5=_0x77b0[_0x35cbb5];return _0x31e0a5;};'use strict';var _=require('lodash');var util=require(_0x077b('0x0'));var logger=require(_0x077b('0x1'))('api');var moment=require(_0x077b('0x2'));var BPromise=require(_0x077b('0x3'));var rp=require(_0x077b('0x4'));var fs=require('fs');var path=require(_0x077b('0x5'));var rimraf=require(_0x077b('0x6'));var config=require('../../config/environment');var attributes=require(_0x077b('0x7'));module[_0x077b('0x8')]=function(_0x28d2ae,_0x4848ec){return _0x28d2ae[_0x077b('0x9')](_0x077b('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x077b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bdb=['rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','api','moment','bluebird','request-promise'];(function(_0xa84a63,_0x3addc3){var _0xb4514b=function(_0x3fad15){while(--_0x3fad15){_0xa84a63['push'](_0xa84a63['shift']());}};_0xb4514b(++_0x3addc3);}(_0x6bdb,0xaf));var _0xb6bd=function(_0xa742ff,_0x48eddb){_0xa742ff=_0xa742ff-0x0;var _0x389e70=_0x6bdb[_0xa742ff];return _0x389e70;};'use strict';var _=require(_0xb6bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6bd('0x1'));var moment=require(_0xb6bd('0x2'));var BPromise=require(_0xb6bd('0x3'));var rp=require(_0xb6bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb6bd('0x5'));var config=require('../../config/environment');var attributes=require(_0xb6bd('0x6'));module[_0xb6bd('0x7')]=function(_0x2d384a,_0x5757ad){return _0x2d384a[_0xb6bd('0x8')](_0xb6bd('0x9'),attributes,{'tableName':_0xb6bd('0xa'),'paranoid':![],'indexes':[{'name':_0xb6bd('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index b105854..ead5d6d 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 _0xf11f=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x19bdf5,_0x3a6395){var _0x140930=function(_0x1b1a19){while(--_0x1b1a19){_0x19bdf5['push'](_0x19bdf5['shift']());}};_0x140930(++_0x3a6395);}(_0xf11f,0xa2));var _0xff11=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xf11f[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xff11('0x0'));var util=require(_0xff11('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xff11('0x2'));var fs=require('fs');var Redis=require(_0xff11('0x3'));var db=require(_0xff11('0x4'))['db'];var utils=require(_0xff11('0x5'));var logger=require('../../config/logger')(_0xff11('0x6'));var config=require(_0xff11('0x7'));var jayson=require(_0xff11('0x8'));var client=jayson[_0xff11('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aaac4,_0x46aeed,_0x1536a6){return new BPromise(function(_0x41c1ca,_0x1740ca){return client['request'](_0x4aaac4,_0x1536a6)[_0xff11('0xa')](function(_0x550de2){logger[_0xff11('0xb')](_0xff11('0xc'),_0x46aeed,_0xff11('0xd'));logger[_0xff11('0xe')](_0xff11('0xf'),_0x46aeed,_0xff11('0xd'),JSON[_0xff11('0x10')](_0x550de2));if(_0x550de2[_0xff11('0x11')]){if(_0x550de2[_0xff11('0x11')][_0xff11('0x12')]===0x1f4){logger[_0xff11('0x11')](_0xff11('0xc'),_0x46aeed,_0x550de2[_0xff11('0x11')][_0xff11('0x13')]);return _0x1740ca(_0x550de2[_0xff11('0x11')][_0xff11('0x13')]);}logger[_0xff11('0x11')](_0xff11('0xc'),_0x46aeed,_0x550de2[_0xff11('0x11')][_0xff11('0x13')]);return _0x41c1ca(_0x550de2['error'][_0xff11('0x13')]);}else{logger[_0xff11('0xb')](_0xff11('0xc'),_0x46aeed,'request\x20sent');_0x41c1ca(_0x550de2[_0xff11('0x14')][_0xff11('0x13')]);}})[_0xff11('0x15')](function(_0x463388){logger[_0xff11('0x11')](_0xff11('0xc'),_0x46aeed,_0x463388);_0x1740ca(_0x463388);});});} \ No newline at end of file +var _0x43c2=['http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x574752,_0x333f5b){var _0x2ecbc0=function(_0x17ffc7){while(--_0x17ffc7){_0x574752['push'](_0x574752['shift']());}};_0x2ecbc0(++_0x333f5b);}(_0x43c2,0x193));var _0x243c=function(_0x2c1110,_0x25c1ef){_0x2c1110=_0x2c1110-0x0;var _0x142407=_0x43c2[_0x2c1110];return _0x142407;};'use strict';var _=require('lodash');var util=require(_0x243c('0x0'));var moment=require(_0x243c('0x1'));var BPromise=require(_0x243c('0x2'));var rs=require(_0x243c('0x3'));var fs=require('fs');var Redis=require(_0x243c('0x4'));var db=require(_0x243c('0x5'))['db'];var utils=require(_0x243c('0x6'));var logger=require(_0x243c('0x7'))(_0x243c('0x8'));var config=require('../../config/environment');var jayson=require(_0x243c('0x9'));var client=jayson[_0x243c('0xa')][_0x243c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x870d73,_0x10f7d5,_0x10890a){return new BPromise(function(_0xd1c04e,_0x3a6270){return client[_0x243c('0xc')](_0x870d73,_0x10890a)[_0x243c('0xd')](function(_0x2887ef){logger['info'](_0x243c('0xe'),_0x10f7d5,_0x243c('0xf'));logger[_0x243c('0x10')](_0x243c('0x11'),_0x10f7d5,_0x243c('0xf'),JSON[_0x243c('0x12')](_0x2887ef));if(_0x2887ef['error']){if(_0x2887ef[_0x243c('0x13')]['code']===0x1f4){logger[_0x243c('0x13')](_0x243c('0xe'),_0x10f7d5,_0x2887ef[_0x243c('0x13')][_0x243c('0x14')]);return _0x3a6270(_0x2887ef[_0x243c('0x13')]['message']);}logger[_0x243c('0x13')](_0x243c('0xe'),_0x10f7d5,_0x2887ef[_0x243c('0x13')][_0x243c('0x14')]);return _0xd1c04e(_0x2887ef['error'][_0x243c('0x14')]);}else{logger['info'](_0x243c('0xe'),_0x10f7d5,_0x243c('0xf'));_0xd1c04e(_0x2887ef[_0x243c('0x15')]['message']);}})[_0x243c('0x16')](function(_0x48dcc6){logger['error'](_0x243c('0xe'),_0x10f7d5,_0x48dcc6);_0x3a6270(_0x48dcc6);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index fc71d69..f01753a 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 _0xf7aa=['/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','post','create','put','update','delete'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf7aa,0x12f));var _0xaf7a=function(_0x8cd742,_0x2cdd61){_0x8cd742=_0x8cd742-0x0;var _0x4f2dcd=_0xf7aa[_0x8cd742];return _0x4f2dcd;};'use strict';var multer=require(_0xaf7a('0x0'));var util=require('util');var path=require(_0xaf7a('0x1'));var timeout=require(_0xaf7a('0x2'));var express=require(_0xaf7a('0x3'));var router=express[_0xaf7a('0x4')]();var fs_extra=require(_0xaf7a('0x5'));var auth=require(_0xaf7a('0x6'));var interaction=require(_0xaf7a('0x7'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xaf7a('0x8')](),controller['index']);router[_0xaf7a('0x9')](_0xaf7a('0xa'),auth[_0xaf7a('0x8')](),controller[_0xaf7a('0xb')]);router[_0xaf7a('0x9')]('/:id',auth[_0xaf7a('0x8')](),controller['show']);router[_0xaf7a('0xc')]('/',auth[_0xaf7a('0x8')](),controller[_0xaf7a('0xd')]);router[_0xaf7a('0xe')]('/:id',auth[_0xaf7a('0x8')](),controller[_0xaf7a('0xf')]);router[_0xaf7a('0x10')](_0xaf7a('0x11'),auth['isAuthenticated'](),controller[_0xaf7a('0x12')]);module[_0xaf7a('0x13')]=router; \ No newline at end of file +var _0xdf9f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x43b1f3,_0x3840cd){var _0x4bd021=function(_0x2c06c0){while(--_0x2c06c0){_0x43b1f3['push'](_0x43b1f3['shift']());}};_0x4bd021(++_0x3840cd);}(_0xdf9f,0xfb));var _0xfdf9=function(_0x1328fe,_0x46393f){_0x1328fe=_0x1328fe-0x0;var _0x52b005=_0xdf9f[_0x1328fe];return _0x52b005;};'use strict';var multer=require('multer');var util=require(_0xfdf9('0x0'));var path=require(_0xfdf9('0x1'));var timeout=require(_0xfdf9('0x2'));var express=require(_0xfdf9('0x3'));var router=express[_0xfdf9('0x4')]();var fs_extra=require(_0xfdf9('0x5'));var auth=require(_0xfdf9('0x6'));var interaction=require(_0xfdf9('0x7'));var config=require(_0xfdf9('0x8'));var controller=require('./faxTransferReport.controller');router[_0xfdf9('0x9')]('/',auth[_0xfdf9('0xa')](),controller['index']);router[_0xfdf9('0x9')](_0xfdf9('0xb'),auth[_0xfdf9('0xa')](),controller['describe']);router['get'](_0xfdf9('0xc'),auth[_0xfdf9('0xa')](),controller[_0xfdf9('0xd')]);router['post']('/',auth[_0xfdf9('0xa')](),controller['create']);router['put']('/:id',auth[_0xfdf9('0xa')](),controller[_0xfdf9('0xe')]);router[_0xfdf9('0xf')]('/:id',auth[_0xfdf9('0xa')](),controller[_0xfdf9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 1716cbe..d45ab91 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 _0x827b=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x1db53f,_0x452343){var _0x35fd5c=function(_0x164dd4){while(--_0x164dd4){_0x1db53f['push'](_0x1db53f['shift']());}};_0x35fd5c(++_0x452343);}(_0x827b,0x135));var _0xb827=function(_0x3579ff,_0x2e3988){_0x3579ff=_0x3579ff-0x0;var _0x3eb25c=_0x827b[_0x3579ff];return _0x3eb25c;};'use strict';var multer=require(_0xb827('0x0'));var util=require(_0xb827('0x1'));var path=require(_0xb827('0x2'));var timeout=require(_0xb827('0x3'));var express=require(_0xb827('0x4'));var router=express[_0xb827('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb827('0x6'));var interaction=require(_0xb827('0x7'));var config=require(_0xb827('0x8'));var controller=require(_0xb827('0x9'));router[_0xb827('0xa')]('/',auth[_0xb827('0xb')](),controller[_0xb827('0xc')]);router[_0xb827('0xa')](_0xb827('0xd'),auth[_0xb827('0xb')](),controller[_0xb827('0xe')]);router[_0xb827('0xa')](_0xb827('0xf'),auth['isAuthenticated'](),controller[_0xb827('0x10')]);router['get'](_0xb827('0x11'),auth[_0xb827('0xb')](),controller[_0xb827('0x12')]);router[_0xb827('0x13')]('/',auth[_0xb827('0xb')](),controller[_0xb827('0x14')]);router['post']('/:id/configurations',auth[_0xb827('0xb')](),controller[_0xb827('0x15')]);router[_0xb827('0x16')]('/:id',auth[_0xb827('0xb')](),controller['update']);router[_0xb827('0x17')](_0xb827('0xd'),auth[_0xb827('0xb')](),controller[_0xb827('0x18')]);module['exports']=router; \ No newline at end of file +var _0xcc25=['isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id'];(function(_0x286d01,_0x24f8a3){var _0x1ef962=function(_0xe6f50){while(--_0xe6f50){_0x286d01['push'](_0x286d01['shift']());}};_0x1ef962(++_0x24f8a3);}(_0xcc25,0x14e));var _0x5cc2=function(_0x2275ab,_0x268eca){_0x2275ab=_0x2275ab-0x0;var _0x25b636=_0xcc25[_0x2275ab];return _0x25b636;};'use strict';var multer=require(_0x5cc2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5cc2('0x1'));var express=require(_0x5cc2('0x2'));var router=express[_0x5cc2('0x3')]();var fs_extra=require(_0x5cc2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5cc2('0x5'));var config=require(_0x5cc2('0x6'));var controller=require(_0x5cc2('0x7'));router[_0x5cc2('0x8')]('/',auth['isAuthenticated'](),controller[_0x5cc2('0x9')]);router['get'](_0x5cc2('0xa'),auth[_0x5cc2('0xb')](),controller[_0x5cc2('0xc')]);router['get']('/:id/configurations',auth[_0x5cc2('0xb')](),controller[_0x5cc2('0xd')]);router['get'](_0x5cc2('0xe'),auth[_0x5cc2('0xb')](),controller[_0x5cc2('0xf')]);router[_0x5cc2('0x10')]('/',auth[_0x5cc2('0xb')](),controller[_0x5cc2('0x11')]);router[_0x5cc2('0x10')](_0x5cc2('0x12'),auth[_0x5cc2('0xb')](),controller['addConfiguration']);router['put']('/:id',auth[_0x5cc2('0xb')](),controller[_0x5cc2('0x13')]);router[_0x5cc2('0x14')](_0x5cc2('0xa'),auth[_0x5cc2('0xb')](),controller[_0x5cc2('0x15')]);module[_0x5cc2('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 5dc94a0..6809612 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 _0x11a6=['integrationTab','newTab','sequelize','STRING','ENUM','basic'];(function(_0x1068d6,_0x54789d){var _0xe073a0=function(_0x53164b){while(--_0x53164b){_0x1068d6['push'](_0x1068d6['shift']());}};_0xe073a0(++_0x54789d);}(_0x11a6,0x1ee));var _0x611a=function(_0x1111ca,_0x589ef5){_0x1111ca=_0x1111ca-0x0;var _0x4baa5=_0x11a6[_0x1111ca];return _0x4baa5;};'use strict';var Sequelize=require(_0x611a('0x0'));module['exports']={'name':{'type':Sequelize[_0x611a('0x1')]},'description':{'type':Sequelize[_0x611a('0x1')]},'username':{'type':Sequelize[_0x611a('0x1')]},'remoteUri':{'type':Sequelize[_0x611a('0x1')]},'authType':{'type':Sequelize[_0x611a('0x2')](_0x611a('0x3')),'defaultValue':_0x611a('0x3')},'password':{'type':Sequelize[_0x611a('0x1')]},'consumerKey':{'type':Sequelize[_0x611a('0x1')]},'consumerSecret':{'type':Sequelize[_0x611a('0x1')]},'token':{'type':Sequelize[_0x611a('0x1')]},'tokenSecret':{'type':Sequelize[_0x611a('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x611a('0x4'),_0x611a('0x5')),'defaultValue':_0x611a('0x4')}}; \ No newline at end of file +var _0x3e04=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x35e3b8,_0x1f543f){var _0xae5b9a=function(_0x483dd6){while(--_0x483dd6){_0x35e3b8['push'](_0x35e3b8['shift']());}};_0xae5b9a(++_0x1f543f);}(_0x3e04,0xd9));var _0x43e0=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x3e04[_0x1e2080];return _0x260111;};'use strict';var Sequelize=require(_0x43e0('0x0'));module[_0x43e0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43e0('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x43e0('0x3')](_0x43e0('0x4')),'defaultValue':_0x43e0('0x4')},'password':{'type':Sequelize[_0x43e0('0x2')]},'consumerKey':{'type':Sequelize[_0x43e0('0x2')]},'consumerSecret':{'type':Sequelize[_0x43e0('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x43e0('0x2')]},'serverUrl':{'type':Sequelize[_0x43e0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x43e0('0x3')](_0x43e0('0x5'),_0x43e0('0x6')),'defaultValue':_0x43e0('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 0be7970..09e77f2 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 _0x7600=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','application/json','headers','Authorization','Basic\x20%s','password','toString','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json'];(function(_0x3ea4c2,_0x509435){var _0x394cd2=function(_0x5a5063){while(--_0x5a5063){_0x3ea4c2['push'](_0x3ea4c2['shift']());}};_0x394cd2(++_0x509435);}(_0x7600,0xc8));var _0x0760=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x7600[_0x24061a];return _0x82054e;};'use strict';var emlformat=require(_0x0760('0x0'));var rimraf=require(_0x0760('0x1'));var zipdir=require(_0x0760('0x2'));var jsonpatch=require(_0x0760('0x3'));var rp=require(_0x0760('0x4'));var moment=require('moment');var BPromise=require(_0x0760('0x5'));var Mustache=require(_0x0760('0x6'));var util=require(_0x0760('0x7'));var path=require(_0x0760('0x8'));var sox=require('sox');var csv=require(_0x0760('0x9'));var ejs=require(_0x0760('0xa'));var fs=require('fs');var fs_extra=require(_0x0760('0xb'));var _=require(_0x0760('0xc'));var squel=require(_0x0760('0xd'));var crypto=require('crypto');var jsforce=require(_0x0760('0xe'));var deskjs=require(_0x0760('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0760('0x10'));var Papa=require('papaparse');var Redis=require(_0x0760('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0760('0x12'));var as=require(_0x0760('0x13'));var hardwareService=require(_0x0760('0x14'));var logger=require(_0x0760('0x15'))(_0x0760('0x16'));var utils=require('../../config/utils');var config=require(_0x0760('0x17'));var licenseUtil=require(_0x0760('0x18'));var db=require(_0x0760('0x19'))['db'];var integrations=require(_0x0760('0x1a'));function respondWithStatusCode(_0x4fe20b,_0x324a8c){_0x324a8c=_0x324a8c||0xcc;return function(_0x15baec){if(_0x15baec){return _0x4fe20b[_0x0760('0x1b')](_0x324a8c);}return _0x4fe20b['status'](_0x324a8c)['end']();};}function respondWithResult(_0x11f0d0,_0x1b8842){_0x1b8842=_0x1b8842||0xc8;return function(_0x286522){if(_0x286522){return _0x11f0d0[_0x0760('0x1c')](_0x1b8842)[_0x0760('0x1d')](_0x286522);}};}function respondWithFilteredResult(_0x25448c,_0x34e37f){return function(_0x459adf){if(_0x459adf){var _0x48b946=typeof _0x34e37f[_0x0760('0x1e')]===_0x0760('0x1f')&&typeof _0x34e37f[_0x0760('0x20')]==='undefined';var _0x3539fb=_0x459adf['count'];var _0x3a105d=_0x48b946?0x0:_0x34e37f['offset'];var _0xbfade=_0x48b946?_0x459adf[_0x0760('0x21')]:_0x34e37f[_0x0760('0x1e')]+_0x34e37f[_0x0760('0x20')];var _0x349392;if(_0xbfade>=_0x3539fb){_0xbfade=_0x3539fb;_0x349392=0xc8;}else{_0x349392=0xce;}_0x25448c[_0x0760('0x1c')](_0x349392);return _0x25448c['set'](_0x0760('0x22'),_0x3a105d+'-'+_0xbfade+'/'+_0x3539fb)['json'](_0x459adf);}return null;};}function patchUpdates(_0x51680d){return function(_0x36081c){try{jsonpatch[_0x0760('0x23')](_0x36081c,_0x51680d,!![]);}catch(_0x574d52){return BPromise[_0x0760('0x24')](_0x574d52);}return _0x36081c[_0x0760('0x25')]();};}function saveUpdates(_0x190552,_0x5cacea){return function(_0x2e48ea){if(_0x2e48ea){return _0x2e48ea[_0x0760('0x26')](_0x190552)[_0x0760('0x27')](function(_0x12cbe6){return _0x12cbe6;});}return null;};}function removeEntity(_0xbba198,_0x25980d){return function(_0x210e60){if(_0x210e60){return _0x210e60[_0x0760('0x28')]()['then'](function(){_0xbba198[_0x0760('0x1c')](0xcc)[_0x0760('0x29')]();});}};}function handleEntityNotFound(_0x4cccfa,_0x5188ed){return function(_0x49dfde){if(!_0x49dfde){_0x4cccfa['sendStatus'](0x194);}return _0x49dfde;};}function handleError(_0x48ee68,_0x5b1394){_0x5b1394=_0x5b1394||0x1f4;return function(_0x312c53){logger[_0x0760('0x2a')](_0x312c53['stack']);if(_0x312c53[_0x0760('0x2b')]){delete _0x312c53[_0x0760('0x2b')];}_0x48ee68[_0x0760('0x1c')](_0x5b1394)[_0x0760('0x2c')](_0x312c53);};}exports['index']=function(_0x47165d,_0x2e7724){var _0x113804={},_0x3f0d7b={},_0x587421={'count':0x0,'rows':[]};var _0x921780=_[_0x0760('0x2d')](db[_0x0760('0x2e')][_0x0760('0x2f')],function(_0x3c8814){return{'name':_0x3c8814[_0x0760('0x30')],'type':_0x3c8814[_0x0760('0x31')][_0x0760('0x32')]};});_0x3f0d7b[_0x0760('0x33')]=_[_0x0760('0x2d')](_0x921780,_0x0760('0x2b'));_0x3f0d7b[_0x0760('0x34')]=_[_0x0760('0x35')](_0x47165d[_0x0760('0x34')]);_0x3f0d7b[_0x0760('0x36')]=_[_0x0760('0x37')](_0x3f0d7b[_0x0760('0x33')],_0x3f0d7b['query']);_0x113804[_0x0760('0x38')]=_[_0x0760('0x37')](_0x3f0d7b['model'],qs[_0x0760('0x39')](_0x47165d[_0x0760('0x34')][_0x0760('0x39')]));_0x113804[_0x0760('0x38')]=_0x113804[_0x0760('0x38')][_0x0760('0x3a')]?_0x113804[_0x0760('0x38')]:_0x3f0d7b[_0x0760('0x33')];if(!_0x47165d[_0x0760('0x34')][_0x0760('0x3b')](_0x0760('0x3c'))){_0x113804[_0x0760('0x20')]=qs[_0x0760('0x20')](_0x47165d[_0x0760('0x34')][_0x0760('0x20')]);_0x113804['offset']=qs[_0x0760('0x1e')](_0x47165d[_0x0760('0x34')][_0x0760('0x1e')]);}_0x113804[_0x0760('0x3d')]=qs['sort'](_0x47165d[_0x0760('0x34')][_0x0760('0x3e')]);_0x113804[_0x0760('0x3f')]=qs[_0x0760('0x36')](_[_0x0760('0x40')](_0x47165d[_0x0760('0x34')],_0x3f0d7b['filters']),_0x921780);if(_0x47165d[_0x0760('0x34')][_0x0760('0x41')]){_0x113804[_0x0760('0x3f')]=_[_0x0760('0x42')](_0x113804[_0x0760('0x3f')],{'$or':_[_0x0760('0x2d')](_0x921780,function(_0x522def){if(_0x522def['type']!==_0x0760('0x43')){var _0x101d21={};_0x101d21[_0x522def[_0x0760('0x2b')]]={'$like':'%'+_0x47165d['query'][_0x0760('0x41')]+'%'};return _0x101d21;}})});}_0x113804=_[_0x0760('0x42')]({},_0x113804,_0x47165d[_0x0760('0x44')]);var _0x49dfe4={'where':_0x113804[_0x0760('0x3f')]};return db[_0x0760('0x2e')][_0x0760('0x21')](_0x49dfe4)['then'](function(_0x14f1a6){_0x587421['count']=_0x14f1a6;if(_0x47165d['query'][_0x0760('0x45')]){_0x113804[_0x0760('0x46')]=[{'all':!![]}];}return db[_0x0760('0x2e')][_0x0760('0x47')](_0x113804);})[_0x0760('0x27')](function(_0x13d451){_0x587421['rows']=_0x13d451;return _0x587421;})[_0x0760('0x27')](respondWithFilteredResult(_0x2e7724,_0x113804))[_0x0760('0x48')](handleError(_0x2e7724,null));};exports['show']=function(_0x1c59c8,_0x4c80b0){var _0x318f55={'raw':![],'where':{'id':_0x1c59c8[_0x0760('0x49')]['id']}},_0x383f40={};_0x383f40[_0x0760('0x33')]=_[_0x0760('0x35')](db[_0x0760('0x2e')]['rawAttributes']);_0x383f40[_0x0760('0x34')]=_[_0x0760('0x35')](_0x1c59c8[_0x0760('0x34')]);_0x383f40[_0x0760('0x36')]=_[_0x0760('0x37')](_0x383f40[_0x0760('0x33')],_0x383f40[_0x0760('0x34')]);_0x318f55[_0x0760('0x38')]=_[_0x0760('0x37')](_0x383f40[_0x0760('0x33')],qs[_0x0760('0x39')](_0x1c59c8['query'][_0x0760('0x39')]));_0x318f55[_0x0760('0x38')]=_0x318f55[_0x0760('0x38')][_0x0760('0x3a')]?_0x318f55[_0x0760('0x38')]:_0x383f40[_0x0760('0x33')];if(_0x1c59c8[_0x0760('0x34')][_0x0760('0x45')]){_0x318f55[_0x0760('0x46')]=[{'all':!![]}];}_0x318f55=_[_0x0760('0x42')]({},_0x318f55,_0x1c59c8[_0x0760('0x44')]);return db[_0x0760('0x2e')]['find'](_0x318f55)[_0x0760('0x27')](handleEntityNotFound(_0x4c80b0,null))[_0x0760('0x27')](respondWithResult(_0x4c80b0,null))[_0x0760('0x48')](handleError(_0x4c80b0,null));};exports[_0x0760('0x4a')]=function(_0x49c015,_0x387bc4){return db['DeskAccount'][_0x0760('0x4a')](_0x49c015[_0x0760('0x4b')],{})['then'](respondWithResult(_0x387bc4,0xc9))[_0x0760('0x48')](handleError(_0x387bc4,null));};exports[_0x0760('0x26')]=function(_0xece3cb,_0x52e53b){if(_0xece3cb[_0x0760('0x4b')]['id']){delete _0xece3cb[_0x0760('0x4b')]['id'];}return db[_0x0760('0x2e')][_0x0760('0x4c')]({'where':{'id':_0xece3cb[_0x0760('0x49')]['id']}})[_0x0760('0x27')](handleEntityNotFound(_0x52e53b,null))[_0x0760('0x27')](saveUpdates(_0xece3cb[_0x0760('0x4b')],null))[_0x0760('0x27')](respondWithResult(_0x52e53b,null))[_0x0760('0x48')](handleError(_0x52e53b,null));};exports[_0x0760('0x28')]=function(_0x859cc8,_0x26761d){return db[_0x0760('0x2e')]['find']({'where':{'id':_0x859cc8['params']['id']}})['then'](handleEntityNotFound(_0x26761d,null))['then'](removeEntity(_0x26761d,null))[_0x0760('0x48')](handleError(_0x26761d,null));};exports[_0x0760('0x4d')]=function(_0x22b43b,_0x3e36f6,_0x896773){var _0x32b018={};var _0x4797a7={};var _0x8e9272;var _0x33314a;return db['DeskAccount'][_0x0760('0x4e')]({'where':{'id':_0x22b43b[_0x0760('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e36f6,null))[_0x0760('0x27')](function(_0x171709){if(_0x171709){_0x8e9272=_0x171709;_0x4797a7[_0x0760('0x33')]=_['keys'](db[_0x0760('0x4f')]['rawAttributes']);_0x4797a7['query']=_[_0x0760('0x35')](_0x22b43b[_0x0760('0x34')]);_0x4797a7[_0x0760('0x36')]=_['intersection'](_0x4797a7[_0x0760('0x33')],_0x4797a7['query']);_0x32b018['attributes']=_['intersection'](_0x4797a7[_0x0760('0x33')],qs[_0x0760('0x39')](_0x22b43b[_0x0760('0x34')][_0x0760('0x39')]));_0x32b018['attributes']=_0x32b018[_0x0760('0x38')]['length']?_0x32b018[_0x0760('0x38')]:_0x4797a7[_0x0760('0x33')];_0x32b018[_0x0760('0x3d')]=qs[_0x0760('0x3e')](_0x22b43b['query'][_0x0760('0x3e')]);_0x32b018['where']=qs[_0x0760('0x36')](_[_0x0760('0x40')](_0x22b43b[_0x0760('0x34')],_0x4797a7['filters']));if(_0x22b43b[_0x0760('0x34')][_0x0760('0x41')]){_0x32b018[_0x0760('0x3f')]=_[_0x0760('0x42')](_0x32b018['where'],{'$or':_[_0x0760('0x2d')](_0x32b018[_0x0760('0x38')],function(_0x1930d8){var _0x5209ff={};_0x5209ff[_0x1930d8]={'$like':'%'+_0x22b43b['query'][_0x0760('0x41')]+'%'};return _0x5209ff;})});}_0x32b018=_['merge']({},_0x32b018,_0x22b43b['options']);return _0x8e9272[_0x0760('0x4d')](_0x32b018);}})[_0x0760('0x27')](function(_0x2324ca){if(_0x2324ca){_0x33314a=_0x2324ca[_0x0760('0x3a')];if(!_0x22b43b[_0x0760('0x34')][_0x0760('0x3b')]('nolimit')){_0x32b018['limit']=qs[_0x0760('0x20')](_0x22b43b[_0x0760('0x34')][_0x0760('0x20')]);_0x32b018[_0x0760('0x1e')]=qs['offset'](_0x22b43b[_0x0760('0x34')][_0x0760('0x1e')]);}return _0x8e9272[_0x0760('0x4d')](_0x32b018);}})[_0x0760('0x27')](function(_0x2c71e3){if(_0x2c71e3){return _0x2c71e3?{'count':_0x33314a,'rows':_0x2c71e3}:null;}})[_0x0760('0x27')](respondWithResult(_0x3e36f6,null))[_0x0760('0x48')](handleError(_0x3e36f6,null));};exports[_0x0760('0x50')]=function(_0x2c4617,_0x514aec,_0xae5c54){if(_0x2c4617[_0x0760('0x4b')]['id']){delete _0x2c4617['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x2c4617['params']['id']}})[_0x0760('0x27')](handleEntityNotFound(_0x514aec,null))[_0x0760('0x27')](function(_0x80b4ee){if(_0x80b4ee){_0x2c4617['body'][_0x0760('0x51')]=_0x80b4ee['id'];_0x2c4617['body'][_0x0760('0x52')]=integrations[_0x0760('0x53')](_0x2c4617[_0x0760('0x4b')]['channel'],_0x2c4617[_0x0760('0x4b')][_0x0760('0x31')]);_0x2c4617[_0x0760('0x4b')][_0x0760('0x54')]=integrations['getDescriptions'](_0x2c4617[_0x0760('0x4b')]['channel'],_0x2c4617[_0x0760('0x4b')][_0x0760('0x31')]);return db['DeskConfiguration'][_0x0760('0x4a')](_0x2c4617[_0x0760('0x4b')],{'include':[{'model':db[_0x0760('0x55')],'as':_0x0760('0x52')},{'model':db[_0x0760('0x55')],'as':_0x0760('0x54')}]});}return null;})[_0x0760('0x27')](respondWithResult(_0x514aec,null))[_0x0760('0x48')](handleError(_0x514aec,null));};exports[_0x0760('0x56')]=function(_0x3d96c7,_0x331ff1,_0x5bfe13){var _0x1ceb05=[{'name':_0x0760('0x57'),'label':_0x0760('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 _0x44884b='';return db[_0x0760('0x2e')][_0x0760('0x4e')]({'where':{'id':_0x3d96c7[_0x0760('0x49')]['id']},'attributes':['id',_0x0760('0x58'),_0x0760('0x59'),_0x0760('0x5a'),'password',_0x0760('0x5b'),_0x0760('0x5c'),_0x0760('0x5d'),_0x0760('0x5e')]})[_0x0760('0x27')](handleEntityNotFound(_0x331ff1,null))[_0x0760('0x27')](function(_0x5059c2){if(_0x5059c2){_0x44884b=_0x5059c2[_0x0760('0x58')];var _0x2fcf64=_0x44884b[_0x0760('0x5f')](-0x1);if(_0x2fcf64==='/'){_0x44884b=_0x44884b[_0x0760('0x60')](0x0,_0x44884b[_0x0760('0x61')](_0x2fcf64));}var _0x5eb0cb={'method':'GET','uri':util[_0x0760('0x62')]('%s/custom_fields',_0x44884b),'headers':{'Content-Type':_0x0760('0x63'),'Accept':_0x0760('0x63')},'json':!![]};if(_0x5059c2[_0x0760('0x59')]==='basic'){_0x5eb0cb[_0x0760('0x64')][_0x0760('0x65')]=util['format'](_0x0760('0x66'),new Buffer(util[_0x0760('0x62')]('%s:%s',_0x5059c2[_0x0760('0x5a')],_0x5059c2[_0x0760('0x67')]))[_0x0760('0x68')](_0x0760('0x69')));}return rp(_0x5eb0cb)[_0x0760('0x27')](function(_0x32d061){return _0x1ceb05[_0x0760('0x6a')](_[_0x0760('0x2d')](_0x32d061['_embedded'][_0x0760('0x6b')],function(_0x556719){return{'id':_0x556719[_0x0760('0x2b')],'name':_0x556719['name'],'type':_0x556719[_0x0760('0x31')],'active':_0x556719[_0x0760('0x6c')],'label':_0x556719[_0x0760('0x6d')],'custom':!![]};}));});}})[_0x0760('0x27')](function(_0x90476b){return{'count':_0x90476b[_0x0760('0x3a')],'rows':_0x90476b};})['then'](respondWithResult(_0x331ff1,null))[_0x0760('0x48')](function(_0x2463ee){var _0x5091ee=_0x3d96c7[_0x0760('0x34')][_0x0760('0x6e')]?0x1f4:_0x2463ee[_0x0760('0x6f')]||0x1f4;logger[_0x0760('0x2a')](_0x0760('0x70'),_0x0760('0x56'),_0x5091ee,JSON[_0x0760('0x71')](_0x2463ee));delete _0x2463ee[_0x0760('0x2b')];if(_0x5091ee===0x191){_0x5091ee=0x190;}_0x331ff1[_0x0760('0x1c')](_0x5091ee)[_0x0760('0x2c')](_0x3d96c7['query']['test']?{'message':_0x0760('0x72'),'statusCode':_0x2463ee[_0x0760('0x6f')]}:_0x2463ee);});}; \ No newline at end of file +var _0x4efb=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','update','then','destroy','stack','name','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','fields','length','options','find','create','body','params','getConfigurations','DeskConfiguration','order','hasOwnProperty','addConfiguration','AccountId','channel','getDescriptions','DeskField','Subjects','Descriptions','getFields','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','base64','concat','_embedded','active','label','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','zip-dir','fast-json-patch','moment','util','to-csv','ejs','crypto'];(function(_0x27ea64,_0x476c10){var _0x49a947=function(_0x1e45eb){while(--_0x1e45eb){_0x27ea64['push'](_0x27ea64['shift']());}};_0x49a947(++_0x476c10);}(_0x4efb,0x1a4));var _0xb4ef=function(_0x1604e6,_0x32131f){_0x1604e6=_0x1604e6-0x0;var _0x5d7472=_0x4efb[_0x1604e6];return _0x5d7472;};'use strict';var emlformat=require(_0xb4ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4ef('0x1'));var jsonpatch=require(_0xb4ef('0x2'));var rp=require('request-promise');var moment=require(_0xb4ef('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb4ef('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xb4ef('0x5'));var ejs=require(_0xb4ef('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb4ef('0x7'));var jsforce=require(_0xb4ef('0x8'));var deskjs=require(_0xb4ef('0x9'));var toCsv=require(_0xb4ef('0x5'));var querystring=require('querystring');var Papa=require(_0xb4ef('0xa'));var Redis=require('ioredis');var authService=require(_0xb4ef('0xb'));var qs=require(_0xb4ef('0xc'));var as=require(_0xb4ef('0xd'));var hardwareService=require(_0xb4ef('0xe'));var logger=require('../../config/logger')(_0xb4ef('0xf'));var utils=require(_0xb4ef('0x10'));var config=require(_0xb4ef('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4ef('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3b6c44,_0x400470){_0x400470=_0x400470||0xcc;return function(_0x3128d7){if(_0x3128d7){return _0x3b6c44[_0xb4ef('0x13')](_0x400470);}return _0x3b6c44[_0xb4ef('0x14')](_0x400470)[_0xb4ef('0x15')]();};}function respondWithResult(_0x2b2d45,_0x2f0074){_0x2f0074=_0x2f0074||0xc8;return function(_0x342941){if(_0x342941){return _0x2b2d45['status'](_0x2f0074)[_0xb4ef('0x16')](_0x342941);}};}function respondWithFilteredResult(_0x4e95b9,_0x15242d){return function(_0x518843){if(_0x518843){var _0xd31c8b=typeof _0x15242d[_0xb4ef('0x17')]===_0xb4ef('0x18')&&typeof _0x15242d[_0xb4ef('0x19')]===_0xb4ef('0x18');var _0x31ef38=_0x518843['count'];var _0x2ea8c3=_0xd31c8b?0x0:_0x15242d[_0xb4ef('0x17')];var _0x14cc25=_0xd31c8b?_0x518843['count']:_0x15242d[_0xb4ef('0x17')]+_0x15242d[_0xb4ef('0x19')];var _0x56a67a;if(_0x14cc25>=_0x31ef38){_0x14cc25=_0x31ef38;_0x56a67a=0xc8;}else{_0x56a67a=0xce;}_0x4e95b9[_0xb4ef('0x14')](_0x56a67a);return _0x4e95b9[_0xb4ef('0x1a')]('Content-Range',_0x2ea8c3+'-'+_0x14cc25+'/'+_0x31ef38)['json'](_0x518843);}return null;};}function patchUpdates(_0x56665c){return function(_0x24b70a){try{jsonpatch[_0xb4ef('0x1b')](_0x24b70a,_0x56665c,!![]);}catch(_0x35b14e){return BPromise['reject'](_0x35b14e);}return _0x24b70a[_0xb4ef('0x1c')]();};}function saveUpdates(_0x4e1102,_0x496377){return function(_0x27cadb){if(_0x27cadb){return _0x27cadb[_0xb4ef('0x1d')](_0x4e1102)[_0xb4ef('0x1e')](function(_0x57c73e){return _0x57c73e;});}return null;};}function removeEntity(_0xce096e,_0x324629){return function(_0x560195){if(_0x560195){return _0x560195[_0xb4ef('0x1f')]()[_0xb4ef('0x1e')](function(){_0xce096e[_0xb4ef('0x14')](0xcc)[_0xb4ef('0x15')]();});}};}function handleEntityNotFound(_0x51d0f7,_0x316525){return function(_0x47d686){if(!_0x47d686){_0x51d0f7[_0xb4ef('0x13')](0x194);}return _0x47d686;};}function handleError(_0x491e0e,_0x525642){_0x525642=_0x525642||0x1f4;return function(_0x59da2f){logger['error'](_0x59da2f[_0xb4ef('0x20')]);if(_0x59da2f[_0xb4ef('0x21')]){delete _0x59da2f['name'];}_0x491e0e[_0xb4ef('0x14')](_0x525642)['send'](_0x59da2f);};}exports['index']=function(_0x38e6fa,_0x41fa43){var _0x3a2a77={},_0x44460b={},_0x5bdf76={'count':0x0,'rows':[]};var _0x380a65=_[_0xb4ef('0x22')](db[_0xb4ef('0x23')][_0xb4ef('0x24')],function(_0x1eb73){return{'name':_0x1eb73[_0xb4ef('0x25')],'type':_0x1eb73[_0xb4ef('0x26')][_0xb4ef('0x27')]};});_0x44460b[_0xb4ef('0x28')]=_[_0xb4ef('0x22')](_0x380a65,_0xb4ef('0x21'));_0x44460b[_0xb4ef('0x29')]=_[_0xb4ef('0x2a')](_0x38e6fa[_0xb4ef('0x29')]);_0x44460b[_0xb4ef('0x2b')]=_[_0xb4ef('0x2c')](_0x44460b[_0xb4ef('0x28')],_0x44460b[_0xb4ef('0x29')]);_0x3a2a77[_0xb4ef('0x2d')]=_[_0xb4ef('0x2c')](_0x44460b[_0xb4ef('0x28')],qs['fields'](_0x38e6fa['query']['fields']));_0x3a2a77[_0xb4ef('0x2d')]=_0x3a2a77[_0xb4ef('0x2d')]['length']?_0x3a2a77[_0xb4ef('0x2d')]:_0x44460b['model'];if(!_0x38e6fa['query']['hasOwnProperty'](_0xb4ef('0x2e'))){_0x3a2a77[_0xb4ef('0x19')]=qs['limit'](_0x38e6fa[_0xb4ef('0x29')][_0xb4ef('0x19')]);_0x3a2a77[_0xb4ef('0x17')]=qs[_0xb4ef('0x17')](_0x38e6fa[_0xb4ef('0x29')][_0xb4ef('0x17')]);}_0x3a2a77['order']=qs[_0xb4ef('0x2f')](_0x38e6fa[_0xb4ef('0x29')][_0xb4ef('0x2f')]);_0x3a2a77['where']=qs[_0xb4ef('0x2b')](_[_0xb4ef('0x30')](_0x38e6fa[_0xb4ef('0x29')],_0x44460b[_0xb4ef('0x2b')]),_0x380a65);if(_0x38e6fa[_0xb4ef('0x29')][_0xb4ef('0x31')]){_0x3a2a77[_0xb4ef('0x32')]=_[_0xb4ef('0x33')](_0x3a2a77['where'],{'$or':_[_0xb4ef('0x22')](_0x380a65,function(_0x57ddd3){if(_0x57ddd3['type']!==_0xb4ef('0x34')){var _0x52e80b={};_0x52e80b[_0x57ddd3['name']]={'$like':'%'+_0x38e6fa[_0xb4ef('0x29')][_0xb4ef('0x31')]+'%'};return _0x52e80b;}})});}_0x3a2a77=_[_0xb4ef('0x33')]({},_0x3a2a77,_0x38e6fa['options']);var _0x3fb9b5={'where':_0x3a2a77['where']};return db[_0xb4ef('0x23')][_0xb4ef('0x35')](_0x3fb9b5)[_0xb4ef('0x1e')](function(_0x496bfa){_0x5bdf76[_0xb4ef('0x35')]=_0x496bfa;if(_0x38e6fa[_0xb4ef('0x29')][_0xb4ef('0x36')]){_0x3a2a77['include']=[{'all':!![]}];}return db['DeskAccount'][_0xb4ef('0x37')](_0x3a2a77);})[_0xb4ef('0x1e')](function(_0x47161b){_0x5bdf76[_0xb4ef('0x38')]=_0x47161b;return _0x5bdf76;})[_0xb4ef('0x1e')](respondWithFilteredResult(_0x41fa43,_0x3a2a77))[_0xb4ef('0x39')](handleError(_0x41fa43,null));};exports['show']=function(_0x46c2a0,_0x4ef81d){var _0x2ec55d={'raw':![],'where':{'id':_0x46c2a0['params']['id']}},_0xc1520f={};_0xc1520f[_0xb4ef('0x28')]=_[_0xb4ef('0x2a')](db[_0xb4ef('0x23')][_0xb4ef('0x24')]);_0xc1520f['query']=_[_0xb4ef('0x2a')](_0x46c2a0[_0xb4ef('0x29')]);_0xc1520f[_0xb4ef('0x2b')]=_[_0xb4ef('0x2c')](_0xc1520f['model'],_0xc1520f['query']);_0x2ec55d['attributes']=_[_0xb4ef('0x2c')](_0xc1520f['model'],qs[_0xb4ef('0x3a')](_0x46c2a0['query'][_0xb4ef('0x3a')]));_0x2ec55d[_0xb4ef('0x2d')]=_0x2ec55d[_0xb4ef('0x2d')][_0xb4ef('0x3b')]?_0x2ec55d['attributes']:_0xc1520f[_0xb4ef('0x28')];if(_0x46c2a0[_0xb4ef('0x29')]['includeAll']){_0x2ec55d['include']=[{'all':!![]}];}_0x2ec55d=_[_0xb4ef('0x33')]({},_0x2ec55d,_0x46c2a0[_0xb4ef('0x3c')]);return db[_0xb4ef('0x23')][_0xb4ef('0x3d')](_0x2ec55d)[_0xb4ef('0x1e')](handleEntityNotFound(_0x4ef81d,null))[_0xb4ef('0x1e')](respondWithResult(_0x4ef81d,null))['catch'](handleError(_0x4ef81d,null));};exports['create']=function(_0x4dc4f5,_0x312b27){return db[_0xb4ef('0x23')][_0xb4ef('0x3e')](_0x4dc4f5[_0xb4ef('0x3f')],{})['then'](respondWithResult(_0x312b27,0xc9))[_0xb4ef('0x39')](handleError(_0x312b27,null));};exports[_0xb4ef('0x1d')]=function(_0x486def,_0x47a994){if(_0x486def['body']['id']){delete _0x486def[_0xb4ef('0x3f')]['id'];}return db['DeskAccount'][_0xb4ef('0x3d')]({'where':{'id':_0x486def['params']['id']}})[_0xb4ef('0x1e')](handleEntityNotFound(_0x47a994,null))[_0xb4ef('0x1e')](saveUpdates(_0x486def[_0xb4ef('0x3f')],null))[_0xb4ef('0x1e')](respondWithResult(_0x47a994,null))[_0xb4ef('0x39')](handleError(_0x47a994,null));};exports['destroy']=function(_0x1a8cd5,_0x256a6a){return db['DeskAccount'][_0xb4ef('0x3d')]({'where':{'id':_0x1a8cd5[_0xb4ef('0x40')]['id']}})[_0xb4ef('0x1e')](handleEntityNotFound(_0x256a6a,null))[_0xb4ef('0x1e')](removeEntity(_0x256a6a,null))[_0xb4ef('0x39')](handleError(_0x256a6a,null));};exports[_0xb4ef('0x41')]=function(_0x12a4e3,_0x3c859e,_0x5d0c28){var _0x25a20e={};var _0x194a23={};var _0x6c4c66;var _0x228bc2;return db[_0xb4ef('0x23')]['findOne']({'where':{'id':_0x12a4e3[_0xb4ef('0x40')]['id']}})[_0xb4ef('0x1e')](handleEntityNotFound(_0x3c859e,null))[_0xb4ef('0x1e')](function(_0x35aa1b){if(_0x35aa1b){_0x6c4c66=_0x35aa1b;_0x194a23[_0xb4ef('0x28')]=_['keys'](db[_0xb4ef('0x42')][_0xb4ef('0x24')]);_0x194a23[_0xb4ef('0x29')]=_[_0xb4ef('0x2a')](_0x12a4e3['query']);_0x194a23[_0xb4ef('0x2b')]=_[_0xb4ef('0x2c')](_0x194a23[_0xb4ef('0x28')],_0x194a23[_0xb4ef('0x29')]);_0x25a20e[_0xb4ef('0x2d')]=_[_0xb4ef('0x2c')](_0x194a23[_0xb4ef('0x28')],qs[_0xb4ef('0x3a')](_0x12a4e3[_0xb4ef('0x29')][_0xb4ef('0x3a')]));_0x25a20e['attributes']=_0x25a20e[_0xb4ef('0x2d')][_0xb4ef('0x3b')]?_0x25a20e[_0xb4ef('0x2d')]:_0x194a23[_0xb4ef('0x28')];_0x25a20e[_0xb4ef('0x43')]=qs[_0xb4ef('0x2f')](_0x12a4e3['query'][_0xb4ef('0x2f')]);_0x25a20e[_0xb4ef('0x32')]=qs[_0xb4ef('0x2b')](_['pick'](_0x12a4e3['query'],_0x194a23[_0xb4ef('0x2b')]));if(_0x12a4e3[_0xb4ef('0x29')]['filter']){_0x25a20e[_0xb4ef('0x32')]=_[_0xb4ef('0x33')](_0x25a20e[_0xb4ef('0x32')],{'$or':_[_0xb4ef('0x22')](_0x25a20e[_0xb4ef('0x2d')],function(_0x405b3c){var _0x4b71bf={};_0x4b71bf[_0x405b3c]={'$like':'%'+_0x12a4e3[_0xb4ef('0x29')][_0xb4ef('0x31')]+'%'};return _0x4b71bf;})});}_0x25a20e=_[_0xb4ef('0x33')]({},_0x25a20e,_0x12a4e3[_0xb4ef('0x3c')]);return _0x6c4c66[_0xb4ef('0x41')](_0x25a20e);}})[_0xb4ef('0x1e')](function(_0x1ea232){if(_0x1ea232){_0x228bc2=_0x1ea232['length'];if(!_0x12a4e3[_0xb4ef('0x29')][_0xb4ef('0x44')](_0xb4ef('0x2e'))){_0x25a20e[_0xb4ef('0x19')]=qs[_0xb4ef('0x19')](_0x12a4e3[_0xb4ef('0x29')][_0xb4ef('0x19')]);_0x25a20e[_0xb4ef('0x17')]=qs['offset'](_0x12a4e3[_0xb4ef('0x29')]['offset']);}return _0x6c4c66['getConfigurations'](_0x25a20e);}})['then'](function(_0x2ffea7){if(_0x2ffea7){return _0x2ffea7?{'count':_0x228bc2,'rows':_0x2ffea7}:null;}})[_0xb4ef('0x1e')](respondWithResult(_0x3c859e,null))[_0xb4ef('0x39')](handleError(_0x3c859e,null));};exports[_0xb4ef('0x45')]=function(_0x42a6f6,_0x299c81,_0x2a9a64){if(_0x42a6f6['body']['id']){delete _0x42a6f6[_0xb4ef('0x3f')]['id'];}return db[_0xb4ef('0x23')]['findOne']({'where':{'id':_0x42a6f6[_0xb4ef('0x40')]['id']}})[_0xb4ef('0x1e')](handleEntityNotFound(_0x299c81,null))[_0xb4ef('0x1e')](function(_0x22a55d){if(_0x22a55d){_0x42a6f6[_0xb4ef('0x3f')][_0xb4ef('0x46')]=_0x22a55d['id'];_0x42a6f6[_0xb4ef('0x3f')]['Subjects']=integrations['getSubjects'](_0x42a6f6[_0xb4ef('0x3f')][_0xb4ef('0x47')],_0x42a6f6[_0xb4ef('0x3f')][_0xb4ef('0x26')]);_0x42a6f6[_0xb4ef('0x3f')]['Descriptions']=integrations[_0xb4ef('0x48')](_0x42a6f6[_0xb4ef('0x3f')][_0xb4ef('0x47')],_0x42a6f6[_0xb4ef('0x3f')]['type']);return db[_0xb4ef('0x42')][_0xb4ef('0x3e')](_0x42a6f6[_0xb4ef('0x3f')],{'include':[{'model':db[_0xb4ef('0x49')],'as':_0xb4ef('0x4a')},{'model':db['DeskField'],'as':_0xb4ef('0x4b')}]});}return null;})['then'](respondWithResult(_0x299c81,null))[_0xb4ef('0x39')](handleError(_0x299c81,null));};exports[_0xb4ef('0x4c')]=function(_0x37d242,_0x88c4b6,_0x5b7b3a){var _0x3a67bf=[{'name':'priority','label':_0xb4ef('0x4d'),'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 _0xa786e2='';return db[_0xb4ef('0x23')]['findOne']({'where':{'id':_0x37d242['params']['id']},'attributes':['id',_0xb4ef('0x4e'),_0xb4ef('0x4f'),'username',_0xb4ef('0x50'),'consumerKey',_0xb4ef('0x51'),_0xb4ef('0x52'),_0xb4ef('0x53')]})[_0xb4ef('0x1e')](handleEntityNotFound(_0x88c4b6,null))[_0xb4ef('0x1e')](function(_0x14375b){if(_0x14375b){_0xa786e2=_0x14375b[_0xb4ef('0x4e')];var _0xbd50c=_0xa786e2[_0xb4ef('0x54')](-0x1);if(_0xbd50c==='/'){_0xa786e2=_0xa786e2[_0xb4ef('0x55')](0x0,_0xa786e2[_0xb4ef('0x56')](_0xbd50c));}var _0xca8714={'method':_0xb4ef('0x57'),'uri':util[_0xb4ef('0x58')]('%s/custom_fields',_0xa786e2),'headers':{'Content-Type':'application/json','Accept':_0xb4ef('0x59')},'json':!![]};if(_0x14375b[_0xb4ef('0x4f')]===_0xb4ef('0x5a')){_0xca8714[_0xb4ef('0x5b')][_0xb4ef('0x5c')]=util[_0xb4ef('0x58')](_0xb4ef('0x5d'),new Buffer(util['format'](_0xb4ef('0x5e'),_0x14375b[_0xb4ef('0x5f')],_0x14375b[_0xb4ef('0x50')]))['toString'](_0xb4ef('0x60')));}return rp(_0xca8714)['then'](function(_0x338f51){return _0x3a67bf[_0xb4ef('0x61')](_[_0xb4ef('0x22')](_0x338f51[_0xb4ef('0x62')]['entries'],function(_0x39465c){return{'id':_0x39465c['name'],'name':_0x39465c[_0xb4ef('0x21')],'type':_0x39465c[_0xb4ef('0x26')],'active':_0x39465c[_0xb4ef('0x63')],'label':_0x39465c[_0xb4ef('0x64')],'custom':!![]};}));});}})['then'](function(_0x1f6856){return{'count':_0x1f6856['length'],'rows':_0x1f6856};})['then'](respondWithResult(_0x88c4b6,null))[_0xb4ef('0x39')](function(_0x154365){var _0x281bfe=_0x37d242[_0xb4ef('0x29')][_0xb4ef('0x65')]?0x1f4:_0x154365['statusCode']||0x1f4;logger[_0xb4ef('0x66')](_0xb4ef('0x67'),'getFields',_0x281bfe,JSON[_0xb4ef('0x68')](_0x154365));delete _0x154365[_0xb4ef('0x21')];if(_0x281bfe===0x191){_0x281bfe=0x190;}_0x88c4b6['status'](_0x281bfe)[_0xb4ef('0x69')](_0x37d242[_0xb4ef('0x29')][_0xb4ef('0x65')]?{'message':'Wrong\x20credentials','statusCode':_0x154365[_0xb4ef('0x6a')]}:_0x154365);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 25566b1..0f9b2c4 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 _0x7c73=['api','moment','bluebird','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x1a2203,_0x47fd5d){var _0x27eb61=function(_0x13d341){while(--_0x13d341){_0x1a2203['push'](_0x1a2203['shift']());}};_0x27eb61(++_0x47fd5d);}(_0x7c73,0x129));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x37c7('0x0'));var util=require(_0x37c7('0x1'));var logger=require(_0x37c7('0x2'))(_0x37c7('0x3'));var moment=require(_0x37c7('0x4'));var BPromise=require(_0x37c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37c7('0x6'));var rimraf=require('rimraf');var config=require(_0x37c7('0x7'));var attributes=require(_0x37c7('0x8'));var integrations=require(_0x37c7('0x9'));module[_0x37c7('0xa')]=function(_0x282131,_0x1cd8c4){return _0x282131['define']('DeskAccount',attributes,{'tableName':_0x37c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e3a=['exports','define','int_desk_accounts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x6e3a,0x1b0));var _0xa6e3=function(_0x139972,_0x2ccee9){_0x139972=_0x139972-0x0;var _0xba4949=_0x6e3a[_0x139972];return _0xba4949;};'use strict';var _=require(_0xa6e3('0x0'));var util=require(_0xa6e3('0x1'));var logger=require('../../config/logger')(_0xa6e3('0x2'));var moment=require(_0xa6e3('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6e3('0x4'));var fs=require('fs');var path=require(_0xa6e3('0x5'));var rimraf=require(_0xa6e3('0x6'));var config=require(_0xa6e3('0x7'));var attributes=require(_0xa6e3('0x8'));var integrations=require(_0xa6e3('0x9'));module[_0xa6e3('0xa')]=function(_0xa60f51,_0x5220db){return _0xa60f51[_0xa6e3('0xb')]('DeskAccount',attributes,{'tableName':_0xa6e3('0xc'),'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 14c1ff3..e12945c 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 _0xb70a=['DeskAccount','options','raw','where','attributes','map','include','model','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDeskAccount'];(function(_0x3ca4a0,_0x97241){var _0x41050d=function(_0x28efc4){while(--_0x28efc4){_0x3ca4a0['push'](_0x3ca4a0['shift']());}};_0x41050d(++_0x97241);}(_0xb70a,0x1b7));var _0xab70=function(_0x2659cd,_0x2e98aa){_0x2659cd=_0x2659cd-0x0;var _0x2e5d96=_0xb70a[_0x2659cd];return _0x2e5d96;};'use strict';var _=require(_0xab70('0x0'));var util=require(_0xab70('0x1'));var moment=require(_0xab70('0x2'));var BPromise=require('bluebird');var rs=require(_0xab70('0x3'));var fs=require('fs');var Redis=require(_0xab70('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab70('0x5'));var logger=require('../../config/logger')(_0xab70('0x6'));var config=require(_0xab70('0x7'));var jayson=require(_0xab70('0x8'));var client=jayson[_0xab70('0x9')][_0xab70('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee13e,_0xcdb6a2,_0x475c8f){return new BPromise(function(_0x116b47,_0xb53275){return client['request'](_0x1ee13e,_0x475c8f)[_0xab70('0xb')](function(_0x670ac4){logger[_0xab70('0xc')](_0xab70('0xd'),_0xcdb6a2,_0xab70('0xe'));logger[_0xab70('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xcdb6a2,'request\x20sent',JSON[_0xab70('0x10')](_0x670ac4));if(_0x670ac4[_0xab70('0x11')]){if(_0x670ac4[_0xab70('0x11')][_0xab70('0x12')]===0x1f4){logger[_0xab70('0x11')](_0xab70('0xd'),_0xcdb6a2,_0x670ac4[_0xab70('0x11')][_0xab70('0x13')]);return _0xb53275(_0x670ac4[_0xab70('0x11')][_0xab70('0x13')]);}logger[_0xab70('0x11')](_0xab70('0xd'),_0xcdb6a2,_0x670ac4[_0xab70('0x11')][_0xab70('0x13')]);return _0x116b47(_0x670ac4[_0xab70('0x11')][_0xab70('0x13')]);}else{logger['info'](_0xab70('0xd'),_0xcdb6a2,_0xab70('0xe'));_0x116b47(_0x670ac4[_0xab70('0x14')][_0xab70('0x13')]);}})[_0xab70('0x15')](function(_0xd0dd80){logger[_0xab70('0x11')](_0xab70('0xd'),_0xcdb6a2,_0xd0dd80);_0xb53275(_0xd0dd80);});});}exports[_0xab70('0x16')]=function(_0x356c7a){var _0x4fc027=this;return new Promise(function(_0x20e380,_0x3487fe){return db[_0xab70('0x17')]['findAll']({'raw':_0x356c7a[_0xab70('0x18')]?_0x356c7a[_0xab70('0x18')][_0xab70('0x19')]===undefined?!![]:![]:!![],'where':_0x356c7a['options']?_0x356c7a[_0xab70('0x18')][_0xab70('0x1a')]||null:null,'attributes':_0x356c7a[_0xab70('0x18')]?_0x356c7a['options'][_0xab70('0x1b')]||null:null,'limit':_0x356c7a[_0xab70('0x18')]?_0x356c7a[_0xab70('0x18')]['limit']||null:null,'include':_0x356c7a[_0xab70('0x18')]?_0x356c7a[_0xab70('0x18')]['include']?_[_0xab70('0x1c')](_0x356c7a[_0xab70('0x18')][_0xab70('0x1d')],function(_0x240e90){return{'model':db[_0x240e90[_0xab70('0x1e')]],'as':_0x240e90['as'],'attributes':_0x240e90[_0xab70('0x1b')],'include':_0x240e90[_0xab70('0x1d')]?_[_0xab70('0x1c')](_0x240e90[_0xab70('0x1d')],function(_0x26c1e9){return{'model':db[_0x26c1e9[_0xab70('0x1e')]],'as':_0x26c1e9['as'],'attributes':_0x26c1e9['attributes'],'include':_0x26c1e9['include']?_['map'](_0x26c1e9[_0xab70('0x1d')],function(_0x50e121){return{'model':db[_0x50e121[_0xab70('0x1e')]],'as':_0x50e121['as'],'attributes':_0x50e121[_0xab70('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xab70('0xb')](function(_0x2fdadf){logger[_0xab70('0xc')](_0xab70('0x16'),_0x356c7a);logger['debug'](_0xab70('0x16'),_0x356c7a,JSON[_0xab70('0x10')](_0x2fdadf));_0x20e380(_0x2fdadf);})[_0xab70('0x15')](function(_0x1efc2b){logger[_0xab70('0x11')](_0xab70('0x16'),_0x1efc2b['message'],_0x356c7a);_0x3487fe(_0x4fc027[_0xab70('0x11')](0x1f4,_0x1efc2b[_0xab70('0x13')]));});});};exports[_0xab70('0x1f')]=function(_0x481cda){var _0x1c1864=this;return new Promise(function(_0x5b8624,_0x3edec4){return db[_0xab70('0x17')][_0xab70('0x20')]({'raw':_0x481cda[_0xab70('0x18')]?_0x481cda[_0xab70('0x18')][_0xab70('0x19')]===undefined?!![]:![]:!![],'where':_0x481cda[_0xab70('0x18')]?_0x481cda[_0xab70('0x18')]['where']||null:null,'attributes':_0x481cda[_0xab70('0x18')]?_0x481cda[_0xab70('0x18')]['attributes']||null:null,'include':_0x481cda[_0xab70('0x18')]?_0x481cda[_0xab70('0x18')][_0xab70('0x1d')]?_[_0xab70('0x1c')](_0x481cda['options']['include'],function(_0x3dafe4){return{'model':db[_0x3dafe4[_0xab70('0x1e')]],'as':_0x3dafe4['as'],'attributes':_0x3dafe4[_0xab70('0x1b')],'include':_0x3dafe4[_0xab70('0x1d')]?_[_0xab70('0x1c')](_0x3dafe4[_0xab70('0x1d')],function(_0x4e3726){return{'model':db[_0x4e3726[_0xab70('0x1e')]],'as':_0x4e3726['as'],'attributes':_0x4e3726['attributes'],'include':_0x4e3726[_0xab70('0x1d')]?_[_0xab70('0x1c')](_0x4e3726[_0xab70('0x1d')],function(_0x2c4635){return{'model':db[_0x2c4635[_0xab70('0x1e')]],'as':_0x2c4635['as'],'attributes':_0x2c4635['attributes']};}):[]};}):[]};}):[]:[]})[_0xab70('0xb')](function(_0x18b491){logger[_0xab70('0xc')](_0xab70('0x1f'),_0x481cda);logger[_0xab70('0xf')](_0xab70('0x1f'),_0x481cda,JSON['stringify'](_0x18b491));_0x5b8624(_0x18b491);})[_0xab70('0x15')](function(_0x16b6d4){logger[_0xab70('0x11')](_0xab70('0x1f'),_0x16b6d4['message'],_0x481cda);_0x3edec4(_0x1c1864[_0xab70('0x11')](0x1f4,_0x16b6d4['message']));});});}; \ No newline at end of file +var _0x0143=['limit','include','model','map','GetDeskAccount','stringify','find','where','ShowDeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','DeskAccount','findAll','options','attributes'];(function(_0x4fab8b,_0x29220a){var _0x92cde3=function(_0x1c5ba7){while(--_0x1c5ba7){_0x4fab8b['push'](_0x4fab8b['shift']());}};_0x92cde3(++_0x29220a);}(_0x0143,0x129));var _0x3014=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0143[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x3014('0x0'));var moment=require(_0x3014('0x1'));var BPromise=require(_0x3014('0x2'));var rs=require(_0x3014('0x3'));var fs=require('fs');var Redis=require(_0x3014('0x4'));var db=require(_0x3014('0x5'))['db'];var utils=require(_0x3014('0x6'));var logger=require('../../config/logger')(_0x3014('0x7'));var config=require(_0x3014('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3014('0x9')][_0x3014('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x291251,_0x33ab8e,_0x3c9c40){return new BPromise(function(_0x50b2c7,_0x22fdb8){return client[_0x3014('0xb')](_0x291251,_0x3c9c40)[_0x3014('0xc')](function(_0x3a43c6){logger[_0x3014('0xd')](_0x3014('0xe'),_0x33ab8e,'request\x20sent');logger[_0x3014('0xf')](_0x3014('0x10'),_0x33ab8e,_0x3014('0x11'),JSON['stringify'](_0x3a43c6));if(_0x3a43c6[_0x3014('0x12')]){if(_0x3a43c6[_0x3014('0x12')][_0x3014('0x13')]===0x1f4){logger[_0x3014('0x12')]('DeskAccount,\x20%s,\x20%s',_0x33ab8e,_0x3a43c6[_0x3014('0x12')][_0x3014('0x14')]);return _0x22fdb8(_0x3a43c6[_0x3014('0x12')][_0x3014('0x14')]);}logger[_0x3014('0x12')](_0x3014('0xe'),_0x33ab8e,_0x3a43c6[_0x3014('0x12')][_0x3014('0x14')]);return _0x50b2c7(_0x3a43c6[_0x3014('0x12')][_0x3014('0x14')]);}else{logger[_0x3014('0xd')](_0x3014('0xe'),_0x33ab8e,_0x3014('0x11'));_0x50b2c7(_0x3a43c6[_0x3014('0x15')][_0x3014('0x14')]);}})[_0x3014('0x16')](function(_0xf74a97){logger[_0x3014('0x12')](_0x3014('0xe'),_0x33ab8e,_0xf74a97);_0x22fdb8(_0xf74a97);});});}exports['GetDeskAccount']=function(_0x13a3d4){var _0x4e438f=this;return new Promise(function(_0x1a8ae3,_0x4c1afa){return db[_0x3014('0x17')][_0x3014('0x18')]({'raw':_0x13a3d4[_0x3014('0x19')]?_0x13a3d4['options']['raw']===undefined?!![]:![]:!![],'where':_0x13a3d4[_0x3014('0x19')]?_0x13a3d4[_0x3014('0x19')]['where']||null:null,'attributes':_0x13a3d4[_0x3014('0x19')]?_0x13a3d4['options'][_0x3014('0x1a')]||null:null,'limit':_0x13a3d4[_0x3014('0x19')]?_0x13a3d4['options'][_0x3014('0x1b')]||null:null,'include':_0x13a3d4[_0x3014('0x19')]?_0x13a3d4[_0x3014('0x19')][_0x3014('0x1c')]?_['map'](_0x13a3d4[_0x3014('0x19')][_0x3014('0x1c')],function(_0x1d713e){return{'model':db[_0x1d713e[_0x3014('0x1d')]],'as':_0x1d713e['as'],'attributes':_0x1d713e['attributes'],'include':_0x1d713e['include']?_[_0x3014('0x1e')](_0x1d713e[_0x3014('0x1c')],function(_0x26731c){return{'model':db[_0x26731c['model']],'as':_0x26731c['as'],'attributes':_0x26731c[_0x3014('0x1a')],'include':_0x26731c[_0x3014('0x1c')]?_[_0x3014('0x1e')](_0x26731c[_0x3014('0x1c')],function(_0x67191f){return{'model':db[_0x67191f[_0x3014('0x1d')]],'as':_0x67191f['as'],'attributes':_0x67191f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3014('0xc')](function(_0x4a299f){logger['info'](_0x3014('0x1f'),_0x13a3d4);logger['debug']('GetDeskAccount',_0x13a3d4,JSON[_0x3014('0x20')](_0x4a299f));_0x1a8ae3(_0x4a299f);})[_0x3014('0x16')](function(_0x5a4cbd){logger[_0x3014('0x12')](_0x3014('0x1f'),_0x5a4cbd[_0x3014('0x14')],_0x13a3d4);_0x4c1afa(_0x4e438f[_0x3014('0x12')](0x1f4,_0x5a4cbd['message']));});});};exports['ShowDeskAccount']=function(_0x1fae7b){var _0x4aa119=this;return new Promise(function(_0x547f55,_0x1d43f0){return db[_0x3014('0x17')][_0x3014('0x21')]({'raw':_0x1fae7b['options']?_0x1fae7b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1fae7b[_0x3014('0x19')]?_0x1fae7b[_0x3014('0x19')][_0x3014('0x22')]||null:null,'attributes':_0x1fae7b[_0x3014('0x19')]?_0x1fae7b[_0x3014('0x19')][_0x3014('0x1a')]||null:null,'include':_0x1fae7b[_0x3014('0x19')]?_0x1fae7b[_0x3014('0x19')][_0x3014('0x1c')]?_[_0x3014('0x1e')](_0x1fae7b[_0x3014('0x19')][_0x3014('0x1c')],function(_0xb114c){return{'model':db[_0xb114c['model']],'as':_0xb114c['as'],'attributes':_0xb114c[_0x3014('0x1a')],'include':_0xb114c[_0x3014('0x1c')]?_[_0x3014('0x1e')](_0xb114c[_0x3014('0x1c')],function(_0x1bb12c){return{'model':db[_0x1bb12c[_0x3014('0x1d')]],'as':_0x1bb12c['as'],'attributes':_0x1bb12c[_0x3014('0x1a')],'include':_0x1bb12c[_0x3014('0x1c')]?_['map'](_0x1bb12c[_0x3014('0x1c')],function(_0x1934d6){return{'model':db[_0x1934d6['model']],'as':_0x1934d6['as'],'attributes':_0x1934d6[_0x3014('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c7507){logger['info'](_0x3014('0x23'),_0x1fae7b);logger[_0x3014('0xf')](_0x3014('0x23'),_0x1fae7b,JSON[_0x3014('0x20')](_0x4c7507));_0x547f55(_0x4c7507);})[_0x3014('0x16')](function(_0xc7b69a){logger[_0x3014('0x12')](_0x3014('0x23'),_0xc7b69a['message'],_0x1fae7b);_0x1d43f0(_0x4aa119[_0x3014('0x12')](0x1f4,_0xc7b69a[_0x3014('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bc0719d..b266a87 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 _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59440a,_0x5c4723){var _0x47b3c2=function(_0x31aa79){while(--_0x31aa79){_0x59440a['push'](_0x59440a['shift']());}};_0x47b3c2(++_0x5c4723);}(_0x008c,0x188));var _0xc008=function(_0x508acd,_0x852c77){_0x508acd=_0x508acd-0x0;var _0x4e8524=_0x008c[_0x508acd];return _0x4e8524;};'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('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5eedac,_0x366877){var _0x68fada=function(_0x1c7f54){while(--_0x1c7f54){_0x5eedac['push'](_0x5eedac['shift']());}};_0x68fada(++_0x366877);}(_0x34e8,0x12c));var _0x834e=function(_0x1d068e,_0x5b0440){_0x1d068e=_0x1d068e-0x0;var _0x58aa0f=_0x34e8[_0x1d068e];return _0x58aa0f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index de9d187..24c3dc6 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 _0x2f3a=['exports','STRING','sequelize'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x2f3a,0x89));var _0xa2f3=function(_0x360292,_0x134ee1){_0x360292=_0x360292-0x0;var _0x4d3283=_0x2f3a[_0x360292];return _0x4d3283;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module[_0xa2f3('0x1')]={'name':{'type':Sequelize[_0xa2f3('0x2')]},'description':{'type':Sequelize[_0xa2f3('0x2')]}}; \ No newline at end of file +var _0xe45d=['STRING','sequelize','exports'];(function(_0x2e2884,_0x445b48){var _0x233169=function(_0x49fa04){while(--_0x49fa04){_0x2e2884['push'](_0x2e2884['shift']());}};_0x233169(++_0x445b48);}(_0xe45d,0x118));var _0xde45=function(_0x646b70,_0x53d1e8){_0x646b70=_0x646b70-0x0;var _0x3c921a=_0xe45d[_0x646b70];return _0x3c921a;};'use strict';var Sequelize=require(_0xde45('0x0'));module[_0xde45('0x1')]={'name':{'type':Sequelize[_0xde45('0x2')]},'description':{'type':Sequelize[_0xde45('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3716ce7..561b022 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 _0x38bf=['map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','findOne','DeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','moment','mustache','util','path','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/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0x42e7a6,_0xcecd53){var _0x4ac2c5=function(_0x59ef6b){while(--_0x59ef6b){_0x42e7a6['push'](_0x42e7a6['shift']());}};_0x4ac2c5(++_0xcecd53);}(_0x38bf,0xce));var _0xf38b=function(_0x46e522,_0x27c114){_0x46e522=_0x46e522-0x0;var _0x3fbf4c=_0x38bf[_0x46e522];return _0x3fbf4c;};'use strict';var emlformat=require(_0xf38b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf38b('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xf38b('0x2'));var util=require(_0xf38b('0x3'));var path=require(_0xf38b('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf38b('0x5'));var _=require(_0xf38b('0x6'));var squel=require(_0xf38b('0x7'));var crypto=require(_0xf38b('0x8'));var jsforce=require(_0xf38b('0x9'));var deskjs=require(_0xf38b('0xa'));var toCsv=require(_0xf38b('0xb'));var querystring=require('querystring');var Papa=require(_0xf38b('0xc'));var Redis=require(_0xf38b('0xd'));var authService=require(_0xf38b('0xe'));var qs=require(_0xf38b('0xf'));var as=require(_0xf38b('0x10'));var hardwareService=require(_0xf38b('0x11'));var logger=require(_0xf38b('0x12'))(_0xf38b('0x13'));var utils=require(_0xf38b('0x14'));var config=require(_0xf38b('0x15'));var licenseUtil=require(_0xf38b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10fb01,_0x122a41){_0x122a41=_0x122a41||0xcc;return function(_0x1917d3){if(_0x1917d3){return _0x10fb01[_0xf38b('0x17')](_0x122a41);}return _0x10fb01[_0xf38b('0x18')](_0x122a41)['end']();};}function respondWithResult(_0x58264f,_0x2bafaa){_0x2bafaa=_0x2bafaa||0xc8;return function(_0x25697f){if(_0x25697f){return _0x58264f[_0xf38b('0x18')](_0x2bafaa)[_0xf38b('0x19')](_0x25697f);}};}function respondWithFilteredResult(_0x2f3bbe,_0x53b328){return function(_0x3eaf2c){if(_0x3eaf2c){var _0x4f8ea2=typeof _0x53b328[_0xf38b('0x1a')]===_0xf38b('0x1b')&&typeof _0x53b328['limit']===_0xf38b('0x1b');var _0x7b4d5c=_0x3eaf2c[_0xf38b('0x1c')];var _0x4256a8=_0x4f8ea2?0x0:_0x53b328[_0xf38b('0x1a')];var _0x1c2ecd=_0x4f8ea2?_0x3eaf2c[_0xf38b('0x1c')]:_0x53b328[_0xf38b('0x1a')]+_0x53b328[_0xf38b('0x1d')];var _0x261731;if(_0x1c2ecd>=_0x7b4d5c){_0x1c2ecd=_0x7b4d5c;_0x261731=0xc8;}else{_0x261731=0xce;}_0x2f3bbe[_0xf38b('0x18')](_0x261731);return _0x2f3bbe[_0xf38b('0x1e')](_0xf38b('0x1f'),_0x4256a8+'-'+_0x1c2ecd+'/'+_0x7b4d5c)[_0xf38b('0x19')](_0x3eaf2c);}return null;};}function patchUpdates(_0x31f321){return function(_0x2574e8){try{jsonpatch[_0xf38b('0x20')](_0x2574e8,_0x31f321,!![]);}catch(_0x2a2cec){return BPromise[_0xf38b('0x21')](_0x2a2cec);}return _0x2574e8[_0xf38b('0x22')]();};}function saveUpdates(_0x2ad5a2,_0x2fe2bb){return function(_0x1da88c){if(_0x1da88c){return _0x1da88c[_0xf38b('0x23')](_0x2ad5a2)[_0xf38b('0x24')](function(_0x4bddf7){return _0x4bddf7;});}return null;};}function removeEntity(_0x45175d,_0x2156d7){return function(_0x401247){if(_0x401247){return _0x401247[_0xf38b('0x25')]()[_0xf38b('0x24')](function(){_0x45175d[_0xf38b('0x18')](0xcc)[_0xf38b('0x26')]();});}};}function handleEntityNotFound(_0x19e676,_0x505579){return function(_0x40c4df){if(!_0x40c4df){_0x19e676[_0xf38b('0x17')](0x194);}return _0x40c4df;};}function handleError(_0x563744,_0x12c726){_0x12c726=_0x12c726||0x1f4;return function(_0x46182e){logger['error'](_0x46182e[_0xf38b('0x27')]);if(_0x46182e['name']){delete _0x46182e[_0xf38b('0x28')];}_0x563744[_0xf38b('0x18')](_0x12c726)[_0xf38b('0x29')](_0x46182e);};}exports[_0xf38b('0x2a')]=function(_0x3898d9,_0x49d83f){var _0x5a07d0={},_0x458a5e={},_0x1e3e33={'count':0x0,'rows':[]};var _0x2481fe=_['map'](db[_0xf38b('0x2b')][_0xf38b('0x2c')],function(_0x5f3cd6){return{'name':_0x5f3cd6[_0xf38b('0x2d')],'type':_0x5f3cd6[_0xf38b('0x2e')][_0xf38b('0x2f')]};});_0x458a5e[_0xf38b('0x30')]=_[_0xf38b('0x31')](_0x2481fe,_0xf38b('0x28'));_0x458a5e[_0xf38b('0x32')]=_[_0xf38b('0x33')](_0x3898d9[_0xf38b('0x32')]);_0x458a5e[_0xf38b('0x34')]=_[_0xf38b('0x35')](_0x458a5e[_0xf38b('0x30')],_0x458a5e[_0xf38b('0x32')]);_0x5a07d0['attributes']=_[_0xf38b('0x35')](_0x458a5e[_0xf38b('0x30')],qs[_0xf38b('0x36')](_0x3898d9['query'][_0xf38b('0x36')]));_0x5a07d0['attributes']=_0x5a07d0['attributes']['length']?_0x5a07d0[_0xf38b('0x37')]:_0x458a5e[_0xf38b('0x30')];if(!_0x3898d9[_0xf38b('0x32')][_0xf38b('0x38')]('nolimit')){_0x5a07d0['limit']=qs[_0xf38b('0x1d')](_0x3898d9[_0xf38b('0x32')][_0xf38b('0x1d')]);_0x5a07d0[_0xf38b('0x1a')]=qs[_0xf38b('0x1a')](_0x3898d9[_0xf38b('0x32')][_0xf38b('0x1a')]);}_0x5a07d0[_0xf38b('0x39')]=qs['sort'](_0x3898d9[_0xf38b('0x32')][_0xf38b('0x3a')]);_0x5a07d0[_0xf38b('0x3b')]=qs[_0xf38b('0x34')](_[_0xf38b('0x3c')](_0x3898d9[_0xf38b('0x32')],_0x458a5e['filters']),_0x2481fe);if(_0x3898d9[_0xf38b('0x32')][_0xf38b('0x3d')]){_0x5a07d0[_0xf38b('0x3b')]=_[_0xf38b('0x3e')](_0x5a07d0[_0xf38b('0x3b')],{'$or':_[_0xf38b('0x31')](_0x2481fe,function(_0x437e45){if(_0x437e45[_0xf38b('0x2e')]!==_0xf38b('0x3f')){var _0x4ce39a={};_0x4ce39a[_0x437e45[_0xf38b('0x28')]]={'$like':'%'+_0x3898d9[_0xf38b('0x32')][_0xf38b('0x3d')]+'%'};return _0x4ce39a;}})});}_0x5a07d0=_[_0xf38b('0x3e')]({},_0x5a07d0,_0x3898d9[_0xf38b('0x40')]);var _0x587d50={'where':_0x5a07d0[_0xf38b('0x3b')]};return db[_0xf38b('0x2b')][_0xf38b('0x1c')](_0x587d50)[_0xf38b('0x24')](function(_0x71ff1){_0x1e3e33['count']=_0x71ff1;if(_0x3898d9[_0xf38b('0x32')][_0xf38b('0x41')]){_0x5a07d0[_0xf38b('0x42')]=[{'all':!![]}];}return db[_0xf38b('0x2b')][_0xf38b('0x43')](_0x5a07d0);})['then'](function(_0x37ff08){_0x1e3e33[_0xf38b('0x44')]=_0x37ff08;return _0x1e3e33;})[_0xf38b('0x24')](respondWithFilteredResult(_0x49d83f,_0x5a07d0))[_0xf38b('0x45')](handleError(_0x49d83f,null));};exports['show']=function(_0x1ad293,_0x582967){var _0x4c2720={'raw':![],'where':{'id':_0x1ad293['params']['id']}},_0x1858b7={};_0x1858b7[_0xf38b('0x30')]=_[_0xf38b('0x33')](db[_0xf38b('0x2b')]['rawAttributes']);_0x1858b7[_0xf38b('0x32')]=_[_0xf38b('0x33')](_0x1ad293[_0xf38b('0x32')]);_0x1858b7[_0xf38b('0x34')]=_['intersection'](_0x1858b7[_0xf38b('0x30')],_0x1858b7['query']);_0x4c2720[_0xf38b('0x37')]=_[_0xf38b('0x35')](_0x1858b7[_0xf38b('0x30')],qs[_0xf38b('0x36')](_0x1ad293[_0xf38b('0x32')]['fields']));_0x4c2720[_0xf38b('0x37')]=_0x4c2720[_0xf38b('0x37')][_0xf38b('0x46')]?_0x4c2720['attributes']:_0x1858b7['model'];if(_0x1ad293[_0xf38b('0x32')][_0xf38b('0x41')]){_0x4c2720[_0xf38b('0x42')]=[{'all':!![]}];}_0x4c2720=_[_0xf38b('0x3e')]({},_0x4c2720,_0x1ad293[_0xf38b('0x40')]);return db['DeskConfiguration']['find'](_0x4c2720)[_0xf38b('0x24')](handleEntityNotFound(_0x582967,null))[_0xf38b('0x24')](respondWithResult(_0x582967,null))[_0xf38b('0x45')](handleError(_0x582967,null));};exports['create']=function(_0x524a33,_0x175a4b){return db[_0xf38b('0x2b')][_0xf38b('0x47')](_0x524a33[_0xf38b('0x48')],{})[_0xf38b('0x24')](respondWithResult(_0x175a4b,0xc9))['catch'](handleError(_0x175a4b,null));};exports['update']=function(_0x5a0cb7,_0x56549a){if(_0x5a0cb7['body']['id']){delete _0x5a0cb7[_0xf38b('0x48')]['id'];}return db[_0xf38b('0x2b')][_0xf38b('0x49')]({'where':{'id':_0x5a0cb7[_0xf38b('0x4a')]['id']}})[_0xf38b('0x24')](handleEntityNotFound(_0x56549a,null))['then'](saveUpdates(_0x5a0cb7[_0xf38b('0x48')],null))[_0xf38b('0x24')](respondWithResult(_0x56549a,null))['catch'](handleError(_0x56549a,null));};exports['destroy']=function(_0x18a963,_0x359d7e){return db[_0xf38b('0x2b')][_0xf38b('0x49')]({'where':{'id':_0x18a963[_0xf38b('0x4a')]['id']}})[_0xf38b('0x24')](handleEntityNotFound(_0x359d7e,null))[_0xf38b('0x24')](removeEntity(_0x359d7e,null))[_0xf38b('0x45')](handleError(_0x359d7e,null));};exports['getFields']=function(_0x34dd81,_0x76c49,_0x205e5b){var _0x12a62b={};var _0x24405b={};var _0x155133;var _0x4a8202;return db['DeskConfiguration'][_0xf38b('0x4b')]({'where':{'id':_0x34dd81[_0xf38b('0x4a')]['id']}})[_0xf38b('0x24')](handleEntityNotFound(_0x76c49,null))[_0xf38b('0x24')](function(_0x4150f4){if(_0x4150f4){_0x155133=_0x4150f4;_0x24405b[_0xf38b('0x30')]=_[_0xf38b('0x33')](db[_0xf38b('0x4c')][_0xf38b('0x2c')]);_0x24405b['query']=_[_0xf38b('0x33')](_0x34dd81[_0xf38b('0x32')]);_0x24405b[_0xf38b('0x34')]=_['intersection'](_0x24405b['model'],_0x24405b['query']);_0x12a62b[_0xf38b('0x37')]=_['intersection'](_0x24405b[_0xf38b('0x30')],qs[_0xf38b('0x36')](_0x34dd81[_0xf38b('0x32')][_0xf38b('0x36')]));_0x12a62b['attributes']=_0x12a62b[_0xf38b('0x37')][_0xf38b('0x46')]?_0x12a62b[_0xf38b('0x37')]:_0x24405b['model'];_0x12a62b[_0xf38b('0x39')]=qs[_0xf38b('0x3a')](_0x34dd81[_0xf38b('0x32')]['sort']);_0x12a62b['where']=qs['filters'](_[_0xf38b('0x3c')](_0x34dd81[_0xf38b('0x32')],_0x24405b[_0xf38b('0x34')]));if(_0x34dd81[_0xf38b('0x32')]['filter']){_0x12a62b[_0xf38b('0x3b')]=_['merge'](_0x12a62b[_0xf38b('0x3b')],{'$or':_[_0xf38b('0x31')](_0x12a62b['attributes'],function(_0xd62a00){var _0x37b352={};_0x37b352[_0xd62a00]={'$like':'%'+_0x34dd81['query'][_0xf38b('0x3d')]+'%'};return _0x37b352;})});}_0x12a62b=_['merge']({},_0x12a62b,_0x34dd81['options']);return _0x155133[_0xf38b('0x4d')](_0x12a62b);}})[_0xf38b('0x24')](function(_0x13752e){if(_0x13752e){_0x4a8202=_0x13752e[_0xf38b('0x46')];if(!_0x34dd81[_0xf38b('0x32')][_0xf38b('0x38')](_0xf38b('0x4e'))){_0x12a62b[_0xf38b('0x1d')]=qs[_0xf38b('0x1d')](_0x34dd81[_0xf38b('0x32')][_0xf38b('0x1d')]);_0x12a62b[_0xf38b('0x1a')]=qs[_0xf38b('0x1a')](_0x34dd81[_0xf38b('0x32')][_0xf38b('0x1a')]);}return _0x155133[_0xf38b('0x4d')](_0x12a62b);}})[_0xf38b('0x24')](function(_0x5af87d){if(_0x5af87d){return _0x5af87d?{'count':_0x4a8202,'rows':_0x5af87d}:null;}})['then'](respondWithResult(_0x76c49,null))[_0xf38b('0x45')](handleError(_0x76c49,null));};exports[_0xf38b('0x4f')]=function(_0x1cb118,_0xbda418,_0x47501e){var _0xf6b68a={};var _0x5390a6={};var _0x213533;var _0x5a604e;return db[_0xf38b('0x2b')][_0xf38b('0x4b')]({'where':{'id':_0x1cb118[_0xf38b('0x4a')]['id']}})[_0xf38b('0x24')](handleEntityNotFound(_0xbda418,null))['then'](function(_0x5dc35b){if(_0x5dc35b){_0x213533=_0x5dc35b;_0x5390a6[_0xf38b('0x30')]=_[_0xf38b('0x33')](db[_0xf38b('0x4c')]['rawAttributes']);_0x5390a6[_0xf38b('0x32')]=_['keys'](_0x1cb118[_0xf38b('0x32')]);_0x5390a6[_0xf38b('0x34')]=_[_0xf38b('0x35')](_0x5390a6[_0xf38b('0x30')],_0x5390a6[_0xf38b('0x32')]);_0xf6b68a[_0xf38b('0x37')]=_['intersection'](_0x5390a6['model'],qs['fields'](_0x1cb118[_0xf38b('0x32')][_0xf38b('0x36')]));_0xf6b68a[_0xf38b('0x37')]=_0xf6b68a['attributes'][_0xf38b('0x46')]?_0xf6b68a[_0xf38b('0x37')]:_0x5390a6[_0xf38b('0x30')];_0xf6b68a[_0xf38b('0x39')]=qs[_0xf38b('0x3a')](_0x1cb118['query'][_0xf38b('0x3a')]);_0xf6b68a[_0xf38b('0x3b')]=qs[_0xf38b('0x34')](_[_0xf38b('0x3c')](_0x1cb118['query'],_0x5390a6[_0xf38b('0x34')]));if(_0x1cb118[_0xf38b('0x32')][_0xf38b('0x3d')]){_0xf6b68a[_0xf38b('0x3b')]=_[_0xf38b('0x3e')](_0xf6b68a[_0xf38b('0x3b')],{'$or':_['map'](_0xf6b68a[_0xf38b('0x37')],function(_0x12b1c6){var _0x1e2fdd={};_0x1e2fdd[_0x12b1c6]={'$like':'%'+_0x1cb118[_0xf38b('0x32')]['filter']+'%'};return _0x1e2fdd;})});}_0xf6b68a=_[_0xf38b('0x3e')]({},_0xf6b68a,_0x1cb118['options']);return _0x213533[_0xf38b('0x4f')](_0xf6b68a);}})[_0xf38b('0x24')](function(_0x2595b4){if(_0x2595b4){_0x5a604e=_0x2595b4[_0xf38b('0x46')];if(!_0x1cb118[_0xf38b('0x32')][_0xf38b('0x38')](_0xf38b('0x4e'))){_0xf6b68a[_0xf38b('0x1d')]=qs['limit'](_0x1cb118[_0xf38b('0x32')][_0xf38b('0x1d')]);_0xf6b68a[_0xf38b('0x1a')]=qs[_0xf38b('0x1a')](_0x1cb118[_0xf38b('0x32')][_0xf38b('0x1a')]);}return _0x213533[_0xf38b('0x4f')](_0xf6b68a);}})[_0xf38b('0x24')](function(_0x29dbc5){if(_0x29dbc5){return _0x29dbc5?{'count':_0x5a604e,'rows':_0x29dbc5}:null;}})[_0xf38b('0x24')](respondWithResult(_0xbda418,null))[_0xf38b('0x45')](handleError(_0xbda418,null));};exports[_0xf38b('0x50')]=function(_0x5166ee,_0x3ed2d2,_0x3b4af6){var _0x4f6cd6={};var _0x2d58ba={};var _0xe4e00f;var _0x3980a0;return db[_0xf38b('0x2b')][_0xf38b('0x4b')]({'where':{'id':_0x5166ee[_0xf38b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3ed2d2,null))['then'](function(_0x375a65){if(_0x375a65){_0xe4e00f=_0x375a65;_0x2d58ba[_0xf38b('0x30')]=_[_0xf38b('0x33')](db['DeskField'][_0xf38b('0x2c')]);_0x2d58ba[_0xf38b('0x32')]=_[_0xf38b('0x33')](_0x5166ee['query']);_0x2d58ba['filters']=_[_0xf38b('0x35')](_0x2d58ba[_0xf38b('0x30')],_0x2d58ba['query']);_0x4f6cd6['attributes']=_[_0xf38b('0x35')](_0x2d58ba[_0xf38b('0x30')],qs[_0xf38b('0x36')](_0x5166ee['query'][_0xf38b('0x36')]));_0x4f6cd6[_0xf38b('0x37')]=_0x4f6cd6['attributes'][_0xf38b('0x46')]?_0x4f6cd6[_0xf38b('0x37')]:_0x2d58ba['model'];_0x4f6cd6['order']=qs[_0xf38b('0x3a')](_0x5166ee[_0xf38b('0x32')][_0xf38b('0x3a')]);_0x4f6cd6[_0xf38b('0x3b')]=qs['filters'](_[_0xf38b('0x3c')](_0x5166ee['query'],_0x2d58ba['filters']));if(_0x5166ee['query'][_0xf38b('0x3d')]){_0x4f6cd6['where']=_[_0xf38b('0x3e')](_0x4f6cd6[_0xf38b('0x3b')],{'$or':_[_0xf38b('0x31')](_0x4f6cd6['attributes'],function(_0x508e7f){var _0x75040e={};_0x75040e[_0x508e7f]={'$like':'%'+_0x5166ee['query'][_0xf38b('0x3d')]+'%'};return _0x75040e;})});}_0x4f6cd6=_[_0xf38b('0x3e')]({},_0x4f6cd6,_0x5166ee['options']);return _0xe4e00f[_0xf38b('0x50')](_0x4f6cd6);}})[_0xf38b('0x24')](function(_0x4461f8){if(_0x4461f8){_0x3980a0=_0x4461f8[_0xf38b('0x46')];if(!_0x5166ee[_0xf38b('0x32')][_0xf38b('0x38')](_0xf38b('0x4e'))){_0x4f6cd6[_0xf38b('0x1d')]=qs['limit'](_0x5166ee[_0xf38b('0x32')]['limit']);_0x4f6cd6['offset']=qs['offset'](_0x5166ee[_0xf38b('0x32')][_0xf38b('0x1a')]);}return _0xe4e00f['getDescriptions'](_0x4f6cd6);}})[_0xf38b('0x24')](function(_0x146093){if(_0x146093){return _0x146093?{'count':_0x3980a0,'rows':_0x146093}:null;}})[_0xf38b('0x24')](respondWithResult(_0x3ed2d2,null))['catch'](handleError(_0x3ed2d2,null));};exports[_0xf38b('0x51')]=function(_0x164862,_0x32b868,_0x13e855){var _0x453b40={};var _0x40b411={};var _0x49c832;var _0x42d9d7;return db[_0xf38b('0x2b')][_0xf38b('0x4b')]({'where':{'id':_0x164862[_0xf38b('0x4a')]['id']}})[_0xf38b('0x24')](handleEntityNotFound(_0x32b868,null))['then'](function(_0x437e4b){if(_0x437e4b){_0x49c832=_0x437e4b;_0x40b411[_0xf38b('0x30')]=_[_0xf38b('0x33')](db[_0xf38b('0x52')][_0xf38b('0x2c')]);_0x40b411[_0xf38b('0x32')]=_[_0xf38b('0x33')](_0x164862[_0xf38b('0x32')]);_0x40b411[_0xf38b('0x34')]=_[_0xf38b('0x35')](_0x40b411[_0xf38b('0x30')],_0x40b411[_0xf38b('0x32')]);_0x453b40[_0xf38b('0x37')]=_[_0xf38b('0x35')](_0x40b411[_0xf38b('0x30')],qs['fields'](_0x164862[_0xf38b('0x32')][_0xf38b('0x36')]));_0x453b40[_0xf38b('0x37')]=_0x453b40[_0xf38b('0x37')][_0xf38b('0x46')]?_0x453b40['attributes']:_0x40b411[_0xf38b('0x30')];_0x453b40[_0xf38b('0x39')]=qs[_0xf38b('0x3a')](_0x164862[_0xf38b('0x32')][_0xf38b('0x3a')]);_0x453b40[_0xf38b('0x3b')]=qs[_0xf38b('0x34')](_[_0xf38b('0x3c')](_0x164862[_0xf38b('0x32')],_0x40b411[_0xf38b('0x34')]));if(_0x164862[_0xf38b('0x32')][_0xf38b('0x3d')]){_0x453b40[_0xf38b('0x3b')]=_['merge'](_0x453b40[_0xf38b('0x3b')],{'$or':_[_0xf38b('0x31')](_0x453b40[_0xf38b('0x37')],function(_0x19a1d7){var _0x1fa455={};_0x1fa455[_0x19a1d7]={'$like':'%'+_0x164862['query'][_0xf38b('0x3d')]+'%'};return _0x1fa455;})});}_0x453b40=_[_0xf38b('0x3e')]({},_0x453b40,_0x164862[_0xf38b('0x40')]);return _0x49c832[_0xf38b('0x51')](_0x453b40);}})[_0xf38b('0x24')](function(_0x5ea967){if(_0x5ea967){_0x42d9d7=_0x5ea967[_0xf38b('0x46')];if(!_0x164862[_0xf38b('0x32')][_0xf38b('0x38')]('nolimit')){_0x453b40['limit']=qs[_0xf38b('0x1d')](_0x164862[_0xf38b('0x32')][_0xf38b('0x1d')]);_0x453b40[_0xf38b('0x1a')]=qs[_0xf38b('0x1a')](_0x164862[_0xf38b('0x32')][_0xf38b('0x1a')]);}return _0x49c832[_0xf38b('0x51')](_0x453b40);}})[_0xf38b('0x24')](function(_0x49b87f){if(_0x49b87f){return _0x49b87f?{'count':_0x42d9d7,'rows':_0x49b87f}:null;}})[_0xf38b('0x24')](respondWithResult(_0x32b868,null))[_0xf38b('0x45')](handleError(_0x32b868,null));};exports['setTags']=function(_0x39554e,_0x3dcfad,_0x3a527f){if(_0x39554e[_0xf38b('0x48')]['id']){delete _0x39554e[_0xf38b('0x48')]['id'];}return db[_0xf38b('0x2b')]['findOne']({'where':{'id':_0x39554e[_0xf38b('0x4a')]['id']}})[_0xf38b('0x24')](handleEntityNotFound(_0x3dcfad,null))['then'](function(_0x2d21a3){if(_0x2d21a3){return _0x2d21a3[_0xf38b('0x53')](_0x39554e[_0xf38b('0x48')][_0xf38b('0x54')]||[]);}return null;})[_0xf38b('0x24')](respondWithResult(_0x3dcfad,null))[_0xf38b('0x45')](handleError(_0x3dcfad,null));}; \ No newline at end of file +var _0x046f=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','catch','show','length','create','body','find','params','getFields','findOne','nolimit','getSubjects','DeskField','getDescriptions','order','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x046f,0xfc));var _0xf046=function(_0x36dd33,_0x24bc83){_0x36dd33=_0x36dd33-0x0;var _0x573813=_0x046f[_0x36dd33];return _0x573813;};'use strict';var emlformat=require(_0xf046('0x0'));var rimraf=require(_0xf046('0x1'));var zipdir=require(_0xf046('0x2'));var jsonpatch=require(_0xf046('0x3'));var rp=require(_0xf046('0x4'));var moment=require(_0xf046('0x5'));var BPromise=require(_0xf046('0x6'));var Mustache=require(_0xf046('0x7'));var util=require(_0xf046('0x8'));var path=require('path');var sox=require(_0xf046('0x9'));var csv=require(_0xf046('0xa'));var ejs=require(_0xf046('0xb'));var fs=require('fs');var fs_extra=require(_0xf046('0xc'));var _=require(_0xf046('0xd'));var squel=require(_0xf046('0xe'));var crypto=require(_0xf046('0xf'));var jsforce=require(_0xf046('0x10'));var deskjs=require(_0xf046('0x11'));var toCsv=require(_0xf046('0xa'));var querystring=require('querystring');var Papa=require(_0xf046('0x12'));var Redis=require(_0xf046('0x13'));var authService=require(_0xf046('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf046('0x15'));var hardwareService=require(_0xf046('0x16'));var logger=require(_0xf046('0x17'))(_0xf046('0x18'));var utils=require(_0xf046('0x19'));var config=require(_0xf046('0x1a'));var licenseUtil=require(_0xf046('0x1b'));var db=require(_0xf046('0x1c'))['db'];function respondWithStatusCode(_0x447678,_0x5a675e){_0x5a675e=_0x5a675e||0xcc;return function(_0x1917b0){if(_0x1917b0){return _0x447678[_0xf046('0x1d')](_0x5a675e);}return _0x447678['status'](_0x5a675e)[_0xf046('0x1e')]();};}function respondWithResult(_0x51fe1a,_0xaeed11){_0xaeed11=_0xaeed11||0xc8;return function(_0x1575bc){if(_0x1575bc){return _0x51fe1a[_0xf046('0x1f')](_0xaeed11)[_0xf046('0x20')](_0x1575bc);}};}function respondWithFilteredResult(_0x5eab4f,_0xa2e666){return function(_0x236b60){if(_0x236b60){var _0x188e42=typeof _0xa2e666[_0xf046('0x21')]==='undefined'&&typeof _0xa2e666[_0xf046('0x22')]==='undefined';var _0x3c4354=_0x236b60[_0xf046('0x23')];var _0x15ecc7=_0x188e42?0x0:_0xa2e666[_0xf046('0x21')];var _0x259af0=_0x188e42?_0x236b60[_0xf046('0x23')]:_0xa2e666[_0xf046('0x21')]+_0xa2e666[_0xf046('0x22')];var _0x37f0c5;if(_0x259af0>=_0x3c4354){_0x259af0=_0x3c4354;_0x37f0c5=0xc8;}else{_0x37f0c5=0xce;}_0x5eab4f['status'](_0x37f0c5);return _0x5eab4f[_0xf046('0x24')](_0xf046('0x25'),_0x15ecc7+'-'+_0x259af0+'/'+_0x3c4354)['json'](_0x236b60);}return null;};}function patchUpdates(_0xffab80){return function(_0x487d72){try{jsonpatch[_0xf046('0x26')](_0x487d72,_0xffab80,!![]);}catch(_0x46e538){return BPromise[_0xf046('0x27')](_0x46e538);}return _0x487d72[_0xf046('0x28')]();};}function saveUpdates(_0x5e691d,_0x150b4c){return function(_0x1303e8){if(_0x1303e8){return _0x1303e8[_0xf046('0x29')](_0x5e691d)[_0xf046('0x2a')](function(_0x38881c){return _0x38881c;});}return null;};}function removeEntity(_0x264539,_0x2432a3){return function(_0x4301b9){if(_0x4301b9){return _0x4301b9[_0xf046('0x2b')]()[_0xf046('0x2a')](function(){_0x264539['status'](0xcc)[_0xf046('0x1e')]();});}};}function handleEntityNotFound(_0x474ab6,_0xa792a8){return function(_0x22bf70){if(!_0x22bf70){_0x474ab6[_0xf046('0x1d')](0x194);}return _0x22bf70;};}function handleError(_0x25fb50,_0x2fbf51){_0x2fbf51=_0x2fbf51||0x1f4;return function(_0x4effe2){logger['error'](_0x4effe2[_0xf046('0x2c')]);if(_0x4effe2[_0xf046('0x2d')]){delete _0x4effe2['name'];}_0x25fb50[_0xf046('0x1f')](_0x2fbf51)['send'](_0x4effe2);};}exports[_0xf046('0x2e')]=function(_0x563767,_0x3aa212){var _0x308088={},_0x10226b={},_0xcbba21={'count':0x0,'rows':[]};var _0x3ccb2c=_[_0xf046('0x2f')](db['DeskConfiguration'][_0xf046('0x30')],function(_0x42bacc){return{'name':_0x42bacc[_0xf046('0x31')],'type':_0x42bacc[_0xf046('0x32')][_0xf046('0x33')]};});_0x10226b[_0xf046('0x34')]=_[_0xf046('0x2f')](_0x3ccb2c,_0xf046('0x2d'));_0x10226b[_0xf046('0x35')]=_[_0xf046('0x36')](_0x563767[_0xf046('0x35')]);_0x10226b['filters']=_[_0xf046('0x37')](_0x10226b[_0xf046('0x34')],_0x10226b[_0xf046('0x35')]);_0x308088[_0xf046('0x38')]=_['intersection'](_0x10226b[_0xf046('0x34')],qs[_0xf046('0x39')](_0x563767[_0xf046('0x35')]['fields']));_0x308088[_0xf046('0x38')]=_0x308088[_0xf046('0x38')]['length']?_0x308088[_0xf046('0x38')]:_0x10226b[_0xf046('0x34')];if(!_0x563767['query'][_0xf046('0x3a')]('nolimit')){_0x308088[_0xf046('0x22')]=qs[_0xf046('0x22')](_0x563767[_0xf046('0x35')][_0xf046('0x22')]);_0x308088[_0xf046('0x21')]=qs[_0xf046('0x21')](_0x563767[_0xf046('0x35')]['offset']);}_0x308088['order']=qs[_0xf046('0x3b')](_0x563767[_0xf046('0x35')]['sort']);_0x308088[_0xf046('0x3c')]=qs[_0xf046('0x3d')](_[_0xf046('0x3e')](_0x563767['query'],_0x10226b[_0xf046('0x3d')]),_0x3ccb2c);if(_0x563767[_0xf046('0x35')][_0xf046('0x3f')]){_0x308088[_0xf046('0x3c')]=_[_0xf046('0x40')](_0x308088['where'],{'$or':_['map'](_0x3ccb2c,function(_0x188184){if(_0x188184[_0xf046('0x32')]!==_0xf046('0x41')){var _0x192d50={};_0x192d50[_0x188184[_0xf046('0x2d')]]={'$like':'%'+_0x563767['query']['filter']+'%'};return _0x192d50;}})});}_0x308088=_[_0xf046('0x40')]({},_0x308088,_0x563767[_0xf046('0x42')]);var _0xf430af={'where':_0x308088[_0xf046('0x3c')]};return db[_0xf046('0x43')]['count'](_0xf430af)[_0xf046('0x2a')](function(_0x5c227d){_0xcbba21[_0xf046('0x23')]=_0x5c227d;if(_0x563767['query'][_0xf046('0x44')]){_0x308088[_0xf046('0x45')]=[{'all':!![]}];}return db[_0xf046('0x43')][_0xf046('0x46')](_0x308088);})[_0xf046('0x2a')](function(_0x17e9fc){_0xcbba21['rows']=_0x17e9fc;return _0xcbba21;})[_0xf046('0x2a')](respondWithFilteredResult(_0x3aa212,_0x308088))[_0xf046('0x47')](handleError(_0x3aa212,null));};exports[_0xf046('0x48')]=function(_0x40cbbd,_0x864b1){var _0x4cf186={'raw':![],'where':{'id':_0x40cbbd['params']['id']}},_0xd5c9c1={};_0xd5c9c1['model']=_[_0xf046('0x36')](db[_0xf046('0x43')][_0xf046('0x30')]);_0xd5c9c1[_0xf046('0x35')]=_[_0xf046('0x36')](_0x40cbbd[_0xf046('0x35')]);_0xd5c9c1[_0xf046('0x3d')]=_['intersection'](_0xd5c9c1['model'],_0xd5c9c1[_0xf046('0x35')]);_0x4cf186[_0xf046('0x38')]=_[_0xf046('0x37')](_0xd5c9c1['model'],qs[_0xf046('0x39')](_0x40cbbd['query'][_0xf046('0x39')]));_0x4cf186['attributes']=_0x4cf186[_0xf046('0x38')][_0xf046('0x49')]?_0x4cf186[_0xf046('0x38')]:_0xd5c9c1[_0xf046('0x34')];if(_0x40cbbd[_0xf046('0x35')]['includeAll']){_0x4cf186['include']=[{'all':!![]}];}_0x4cf186=_[_0xf046('0x40')]({},_0x4cf186,_0x40cbbd['options']);return db['DeskConfiguration']['find'](_0x4cf186)['then'](handleEntityNotFound(_0x864b1,null))[_0xf046('0x2a')](respondWithResult(_0x864b1,null))['catch'](handleError(_0x864b1,null));};exports[_0xf046('0x4a')]=function(_0x4ad56a,_0xa1f4f6){return db[_0xf046('0x43')][_0xf046('0x4a')](_0x4ad56a[_0xf046('0x4b')],{})['then'](respondWithResult(_0xa1f4f6,0xc9))[_0xf046('0x47')](handleError(_0xa1f4f6,null));};exports[_0xf046('0x29')]=function(_0x57adf0,_0x2b4f61){if(_0x57adf0[_0xf046('0x4b')]['id']){delete _0x57adf0['body']['id'];}return db[_0xf046('0x43')][_0xf046('0x4c')]({'where':{'id':_0x57adf0[_0xf046('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b4f61,null))[_0xf046('0x2a')](saveUpdates(_0x57adf0[_0xf046('0x4b')],null))[_0xf046('0x2a')](respondWithResult(_0x2b4f61,null))[_0xf046('0x47')](handleError(_0x2b4f61,null));};exports[_0xf046('0x2b')]=function(_0x577d8f,_0x45952d){return db['DeskConfiguration']['find']({'where':{'id':_0x577d8f['params']['id']}})[_0xf046('0x2a')](handleEntityNotFound(_0x45952d,null))[_0xf046('0x2a')](removeEntity(_0x45952d,null))[_0xf046('0x47')](handleError(_0x45952d,null));};exports[_0xf046('0x4e')]=function(_0x24a4c3,_0x3960c6,_0x4a07c0){var _0x7f8730={};var _0xc9f04f={};var _0x4d12a3;var _0x4f1ae3;return db[_0xf046('0x43')][_0xf046('0x4f')]({'where':{'id':_0x24a4c3[_0xf046('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3960c6,null))[_0xf046('0x2a')](function(_0x56dad2){if(_0x56dad2){_0x4d12a3=_0x56dad2;_0xc9f04f['model']=_[_0xf046('0x36')](db['DeskField'][_0xf046('0x30')]);_0xc9f04f[_0xf046('0x35')]=_['keys'](_0x24a4c3[_0xf046('0x35')]);_0xc9f04f[_0xf046('0x3d')]=_[_0xf046('0x37')](_0xc9f04f[_0xf046('0x34')],_0xc9f04f['query']);_0x7f8730[_0xf046('0x38')]=_[_0xf046('0x37')](_0xc9f04f['model'],qs[_0xf046('0x39')](_0x24a4c3[_0xf046('0x35')]['fields']));_0x7f8730[_0xf046('0x38')]=_0x7f8730['attributes'][_0xf046('0x49')]?_0x7f8730[_0xf046('0x38')]:_0xc9f04f['model'];_0x7f8730['order']=qs['sort'](_0x24a4c3[_0xf046('0x35')][_0xf046('0x3b')]);_0x7f8730[_0xf046('0x3c')]=qs['filters'](_[_0xf046('0x3e')](_0x24a4c3[_0xf046('0x35')],_0xc9f04f[_0xf046('0x3d')]));if(_0x24a4c3[_0xf046('0x35')]['filter']){_0x7f8730[_0xf046('0x3c')]=_['merge'](_0x7f8730['where'],{'$or':_[_0xf046('0x2f')](_0x7f8730['attributes'],function(_0x944d82){var _0x26c33e={};_0x26c33e[_0x944d82]={'$like':'%'+_0x24a4c3[_0xf046('0x35')][_0xf046('0x3f')]+'%'};return _0x26c33e;})});}_0x7f8730=_[_0xf046('0x40')]({},_0x7f8730,_0x24a4c3['options']);return _0x4d12a3[_0xf046('0x4e')](_0x7f8730);}})[_0xf046('0x2a')](function(_0x404942){if(_0x404942){_0x4f1ae3=_0x404942['length'];if(!_0x24a4c3[_0xf046('0x35')]['hasOwnProperty'](_0xf046('0x50'))){_0x7f8730[_0xf046('0x22')]=qs[_0xf046('0x22')](_0x24a4c3['query']['limit']);_0x7f8730[_0xf046('0x21')]=qs[_0xf046('0x21')](_0x24a4c3[_0xf046('0x35')][_0xf046('0x21')]);}return _0x4d12a3[_0xf046('0x4e')](_0x7f8730);}})[_0xf046('0x2a')](function(_0x35b4a4){if(_0x35b4a4){return _0x35b4a4?{'count':_0x4f1ae3,'rows':_0x35b4a4}:null;}})[_0xf046('0x2a')](respondWithResult(_0x3960c6,null))['catch'](handleError(_0x3960c6,null));};exports[_0xf046('0x51')]=function(_0x14d728,_0x126193,_0x5aea40){var _0x143544={};var _0x239bb2={};var _0xeadb54;var _0x56cc8a;return db[_0xf046('0x43')][_0xf046('0x4f')]({'where':{'id':_0x14d728[_0xf046('0x4d')]['id']}})[_0xf046('0x2a')](handleEntityNotFound(_0x126193,null))[_0xf046('0x2a')](function(_0x72a179){if(_0x72a179){_0xeadb54=_0x72a179;_0x239bb2[_0xf046('0x34')]=_[_0xf046('0x36')](db[_0xf046('0x52')][_0xf046('0x30')]);_0x239bb2['query']=_['keys'](_0x14d728['query']);_0x239bb2['filters']=_[_0xf046('0x37')](_0x239bb2['model'],_0x239bb2['query']);_0x143544['attributes']=_[_0xf046('0x37')](_0x239bb2['model'],qs[_0xf046('0x39')](_0x14d728[_0xf046('0x35')]['fields']));_0x143544[_0xf046('0x38')]=_0x143544['attributes'][_0xf046('0x49')]?_0x143544['attributes']:_0x239bb2[_0xf046('0x34')];_0x143544['order']=qs[_0xf046('0x3b')](_0x14d728[_0xf046('0x35')][_0xf046('0x3b')]);_0x143544['where']=qs[_0xf046('0x3d')](_[_0xf046('0x3e')](_0x14d728[_0xf046('0x35')],_0x239bb2['filters']));if(_0x14d728[_0xf046('0x35')][_0xf046('0x3f')]){_0x143544[_0xf046('0x3c')]=_[_0xf046('0x40')](_0x143544['where'],{'$or':_['map'](_0x143544['attributes'],function(_0x3dce8a){var _0x2e1e4a={};_0x2e1e4a[_0x3dce8a]={'$like':'%'+_0x14d728[_0xf046('0x35')][_0xf046('0x3f')]+'%'};return _0x2e1e4a;})});}_0x143544=_[_0xf046('0x40')]({},_0x143544,_0x14d728[_0xf046('0x42')]);return _0xeadb54['getSubjects'](_0x143544);}})[_0xf046('0x2a')](function(_0xf16a6a){if(_0xf16a6a){_0x56cc8a=_0xf16a6a[_0xf046('0x49')];if(!_0x14d728[_0xf046('0x35')][_0xf046('0x3a')](_0xf046('0x50'))){_0x143544[_0xf046('0x22')]=qs[_0xf046('0x22')](_0x14d728[_0xf046('0x35')][_0xf046('0x22')]);_0x143544[_0xf046('0x21')]=qs[_0xf046('0x21')](_0x14d728['query'][_0xf046('0x21')]);}return _0xeadb54['getSubjects'](_0x143544);}})[_0xf046('0x2a')](function(_0x30e305){if(_0x30e305){return _0x30e305?{'count':_0x56cc8a,'rows':_0x30e305}:null;}})['then'](respondWithResult(_0x126193,null))['catch'](handleError(_0x126193,null));};exports[_0xf046('0x53')]=function(_0x3fe8c6,_0x4c52b8,_0x687567){var _0x117697={};var _0x474483={};var _0x3930e9;var _0x1f38ab;return db[_0xf046('0x43')][_0xf046('0x4f')]({'where':{'id':_0x3fe8c6['params']['id']}})[_0xf046('0x2a')](handleEntityNotFound(_0x4c52b8,null))[_0xf046('0x2a')](function(_0x5dea20){if(_0x5dea20){_0x3930e9=_0x5dea20;_0x474483[_0xf046('0x34')]=_[_0xf046('0x36')](db[_0xf046('0x52')][_0xf046('0x30')]);_0x474483['query']=_['keys'](_0x3fe8c6[_0xf046('0x35')]);_0x474483['filters']=_[_0xf046('0x37')](_0x474483[_0xf046('0x34')],_0x474483[_0xf046('0x35')]);_0x117697[_0xf046('0x38')]=_['intersection'](_0x474483[_0xf046('0x34')],qs[_0xf046('0x39')](_0x3fe8c6[_0xf046('0x35')][_0xf046('0x39')]));_0x117697[_0xf046('0x38')]=_0x117697[_0xf046('0x38')][_0xf046('0x49')]?_0x117697[_0xf046('0x38')]:_0x474483[_0xf046('0x34')];_0x117697[_0xf046('0x54')]=qs[_0xf046('0x3b')](_0x3fe8c6[_0xf046('0x35')][_0xf046('0x3b')]);_0x117697[_0xf046('0x3c')]=qs[_0xf046('0x3d')](_[_0xf046('0x3e')](_0x3fe8c6[_0xf046('0x35')],_0x474483[_0xf046('0x3d')]));if(_0x3fe8c6[_0xf046('0x35')][_0xf046('0x3f')]){_0x117697[_0xf046('0x3c')]=_[_0xf046('0x40')](_0x117697[_0xf046('0x3c')],{'$or':_[_0xf046('0x2f')](_0x117697[_0xf046('0x38')],function(_0x231803){var _0xe43ea4={};_0xe43ea4[_0x231803]={'$like':'%'+_0x3fe8c6[_0xf046('0x35')][_0xf046('0x3f')]+'%'};return _0xe43ea4;})});}_0x117697=_['merge']({},_0x117697,_0x3fe8c6[_0xf046('0x42')]);return _0x3930e9[_0xf046('0x53')](_0x117697);}})[_0xf046('0x2a')](function(_0x1d29dd){if(_0x1d29dd){_0x1f38ab=_0x1d29dd[_0xf046('0x49')];if(!_0x3fe8c6[_0xf046('0x35')][_0xf046('0x3a')](_0xf046('0x50'))){_0x117697[_0xf046('0x22')]=qs['limit'](_0x3fe8c6['query'][_0xf046('0x22')]);_0x117697[_0xf046('0x21')]=qs[_0xf046('0x21')](_0x3fe8c6[_0xf046('0x35')]['offset']);}return _0x3930e9[_0xf046('0x53')](_0x117697);}})[_0xf046('0x2a')](function(_0x16ff8c){if(_0x16ff8c){return _0x16ff8c?{'count':_0x1f38ab,'rows':_0x16ff8c}:null;}})[_0xf046('0x2a')](respondWithResult(_0x4c52b8,null))[_0xf046('0x47')](handleError(_0x4c52b8,null));};exports[_0xf046('0x55')]=function(_0x4c6783,_0x28b75d,_0x3d959c){var _0x1f44b2={};var _0x3d6c2f={};var _0xacc053;var _0x1db73e;return db[_0xf046('0x43')][_0xf046('0x4f')]({'where':{'id':_0x4c6783[_0xf046('0x4d')]['id']}})['then'](handleEntityNotFound(_0x28b75d,null))[_0xf046('0x2a')](function(_0x5e2d3a){if(_0x5e2d3a){_0xacc053=_0x5e2d3a;_0x3d6c2f[_0xf046('0x34')]=_[_0xf046('0x36')](db[_0xf046('0x56')][_0xf046('0x30')]);_0x3d6c2f['query']=_[_0xf046('0x36')](_0x4c6783[_0xf046('0x35')]);_0x3d6c2f[_0xf046('0x3d')]=_[_0xf046('0x37')](_0x3d6c2f[_0xf046('0x34')],_0x3d6c2f['query']);_0x1f44b2['attributes']=_['intersection'](_0x3d6c2f[_0xf046('0x34')],qs[_0xf046('0x39')](_0x4c6783[_0xf046('0x35')][_0xf046('0x39')]));_0x1f44b2[_0xf046('0x38')]=_0x1f44b2[_0xf046('0x38')][_0xf046('0x49')]?_0x1f44b2['attributes']:_0x3d6c2f['model'];_0x1f44b2[_0xf046('0x54')]=qs[_0xf046('0x3b')](_0x4c6783[_0xf046('0x35')][_0xf046('0x3b')]);_0x1f44b2[_0xf046('0x3c')]=qs['filters'](_['pick'](_0x4c6783[_0xf046('0x35')],_0x3d6c2f[_0xf046('0x3d')]));if(_0x4c6783['query'][_0xf046('0x3f')]){_0x1f44b2[_0xf046('0x3c')]=_[_0xf046('0x40')](_0x1f44b2[_0xf046('0x3c')],{'$or':_[_0xf046('0x2f')](_0x1f44b2['attributes'],function(_0x19ded0){var _0x458ef7={};_0x458ef7[_0x19ded0]={'$like':'%'+_0x4c6783[_0xf046('0x35')][_0xf046('0x3f')]+'%'};return _0x458ef7;})});}_0x1f44b2=_[_0xf046('0x40')]({},_0x1f44b2,_0x4c6783[_0xf046('0x42')]);return _0xacc053['getTags'](_0x1f44b2);}})[_0xf046('0x2a')](function(_0x3ab991){if(_0x3ab991){_0x1db73e=_0x3ab991[_0xf046('0x49')];if(!_0x4c6783['query'][_0xf046('0x3a')]('nolimit')){_0x1f44b2[_0xf046('0x22')]=qs[_0xf046('0x22')](_0x4c6783[_0xf046('0x35')][_0xf046('0x22')]);_0x1f44b2[_0xf046('0x21')]=qs['offset'](_0x4c6783[_0xf046('0x35')][_0xf046('0x21')]);}return _0xacc053[_0xf046('0x55')](_0x1f44b2);}})[_0xf046('0x2a')](function(_0x12a886){if(_0x12a886){return _0x12a886?{'count':_0x1db73e,'rows':_0x12a886}:null;}})[_0xf046('0x2a')](respondWithResult(_0x28b75d,null))[_0xf046('0x47')](handleError(_0x28b75d,null));};exports['setTags']=function(_0x3730f7,_0x3d1166,_0x11236d){if(_0x3730f7[_0xf046('0x4b')]['id']){delete _0x3730f7[_0xf046('0x4b')]['id'];}return db[_0xf046('0x43')][_0xf046('0x4f')]({'where':{'id':_0x3730f7['params']['id']}})[_0xf046('0x2a')](handleEntityNotFound(_0x3d1166,null))[_0xf046('0x2a')](function(_0x1f21a2){if(_0x1f21a2){return _0x1f21a2[_0xf046('0x57')](_0x3730f7[_0xf046('0x4b')]['ids']||[]);}return null;})[_0xf046('0x2a')](respondWithResult(_0x3d1166,null))[_0xf046('0x47')](handleError(_0x3d1166,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6e3886f..328bce7 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 _0x92e9=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x15dafa,_0x3bd9b2){var _0x390812=function(_0x505d5c){while(--_0x505d5c){_0x15dafa['push'](_0x15dafa['shift']());}};_0x390812(++_0x3bd9b2);}(_0x92e9,0x104));var _0x992e=function(_0x1be5a5,_0x104949){_0x1be5a5=_0x1be5a5-0x0;var _0x15cc73=_0x92e9[_0x1be5a5];return _0x15cc73;};'use strict';var _=require(_0x992e('0x0'));var util=require(_0x992e('0x1'));var logger=require(_0x992e('0x2'))(_0x992e('0x3'));var moment=require('moment');var BPromise=require(_0x992e('0x4'));var rp=require(_0x992e('0x5'));var fs=require('fs');var path=require(_0x992e('0x6'));var rimraf=require(_0x992e('0x7'));var config=require(_0x992e('0x8'));var attributes=require(_0x992e('0x9'));module[_0x992e('0xa')]=function(_0x284b85,_0x57f1a7){return _0x284b85[_0x992e('0xb')](_0x992e('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9434=['DeskConfiguration','int_desk_configurations','lodash','util','api','bluebird','path','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0xb3a4e9,_0x33b0fb){var _0x460ae6=function(_0x5c5444){while(--_0x5c5444){_0xb3a4e9['push'](_0xb3a4e9['shift']());}};_0x460ae6(++_0x33b0fb);}(_0x9434,0x178));var _0x4943=function(_0x2c0d11,_0x3176c7){_0x2c0d11=_0x2c0d11-0x0;var _0x28f46f=_0x9434[_0x2c0d11];return _0x28f46f;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var logger=require('../../config/logger')(_0x4943('0x2'));var moment=require('moment');var BPromise=require(_0x4943('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4943('0x4'));var rimraf=require('rimraf');var config=require(_0x4943('0x5'));var attributes=require(_0x4943('0x6'));module[_0x4943('0x7')]=function(_0x4d9740,_0x5bce8c){return _0x4d9740[_0x4943('0x8')](_0x4943('0x9'),attributes,{'tableName':_0x4943('0xa'),'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 15a9a0d..bdfc760 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 _0x583c=['../../config/environment','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x583c,0x12b));var _0xc583=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0x583c[_0x1a9e78];return _0x113e06;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});} \ No newline at end of file +var _0xc2a2=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x287d53,_0x5a189e){var _0x239cb5=function(_0x16cd31){while(--_0x16cd31){_0x287d53['push'](_0x287d53['shift']());}};_0x239cb5(++_0x5a189e);}(_0xc2a2,0x84));var _0x2c2a=function(_0x366e15,_0x22b0e7){_0x366e15=_0x366e15-0x0;var _0x493f6c=_0xc2a2[_0x366e15];return _0x493f6c;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var moment=require(_0x2c2a('0x2'));var BPromise=require(_0x2c2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2a('0x4'));var db=require(_0x2c2a('0x5'))['db'];var utils=require(_0x2c2a('0x6'));var logger=require('../../config/logger')(_0x2c2a('0x7'));var config=require(_0x2c2a('0x8'));var jayson=require(_0x2c2a('0x9'));var client=jayson[_0x2c2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f476,_0x53b0c0,_0x578a80){return new BPromise(function(_0x48a901,_0x5cc8c5){return client['request'](_0x52f476,_0x578a80)[_0x2c2a('0xb')](function(_0x48ba78){logger[_0x2c2a('0xc')](_0x2c2a('0xd'),_0x53b0c0,_0x2c2a('0xe'));logger[_0x2c2a('0xf')](_0x2c2a('0x10'),_0x53b0c0,_0x2c2a('0xe'),JSON['stringify'](_0x48ba78));if(_0x48ba78['error']){if(_0x48ba78[_0x2c2a('0x11')][_0x2c2a('0x12')]===0x1f4){logger[_0x2c2a('0x11')](_0x2c2a('0xd'),_0x53b0c0,_0x48ba78[_0x2c2a('0x11')][_0x2c2a('0x13')]);return _0x5cc8c5(_0x48ba78['error'][_0x2c2a('0x13')]);}logger[_0x2c2a('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x53b0c0,_0x48ba78[_0x2c2a('0x11')]['message']);return _0x48a901(_0x48ba78[_0x2c2a('0x11')]['message']);}else{logger[_0x2c2a('0xc')](_0x2c2a('0xd'),_0x53b0c0,'request\x20sent');_0x48a901(_0x48ba78[_0x2c2a('0x14')][_0x2c2a('0x13')]);}})[_0x2c2a('0x15')](function(_0x7af854){logger[_0x2c2a('0x11')](_0x2c2a('0xd'),_0x53b0c0,_0x7af854);_0x5cc8c5(_0x7af854);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f977d02..0be02ea 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 _0xa9a7=['index','get','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','isAuthenticated'];(function(_0x20977b,_0x3bd14c){var _0x1c5db1=function(_0xcf67ea){while(--_0xcf67ea){_0x20977b['push'](_0x20977b['shift']());}};_0x1c5db1(++_0x3bd14c);}(_0xa9a7,0x197));var _0x7a9a=function(_0xd0a88f,_0xfcf7b9){_0xd0a88f=_0xd0a88f-0x0;var _0x2898fc=_0xa9a7[_0xd0a88f];return _0x2898fc;};'use strict';var multer=require('multer');var util=require(_0x7a9a('0x0'));var path=require('path');var timeout=require(_0x7a9a('0x1'));var express=require('express');var router=express[_0x7a9a('0x2')]();var fs_extra=require(_0x7a9a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7a9a('0x4'));var config=require('../../config/environment');var controller=require(_0x7a9a('0x5'));router['get']('/',auth[_0x7a9a('0x6')](),controller[_0x7a9a('0x7')]);router[_0x7a9a('0x8')](_0x7a9a('0x9'),auth[_0x7a9a('0x6')](),controller[_0x7a9a('0xa')]);router[_0x7a9a('0xb')]('/',auth['isAuthenticated'](),controller[_0x7a9a('0xc')]);router[_0x7a9a('0xd')](_0x7a9a('0x9'),auth[_0x7a9a('0x6')](),controller[_0x7a9a('0xe')]);router[_0x7a9a('0xf')]('/:id',auth[_0x7a9a('0x6')](),controller[_0x7a9a('0x10')]);module[_0x7a9a('0x11')]=router; \ No newline at end of file +var _0xe742=['./intDeskField.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x284cc1,_0x198d07){var _0x398f9b=function(_0x23ae63){while(--_0x23ae63){_0x284cc1['push'](_0x284cc1['shift']());}};_0x398f9b(++_0x198d07);}(_0xe742,0xa4));var _0x2e74=function(_0x4401ac,_0x5912e5){_0x4401ac=_0x4401ac-0x0;var _0x3405cf=_0xe742[_0x4401ac];return _0x3405cf;};'use strict';var multer=require(_0x2e74('0x0'));var util=require('util');var path=require(_0x2e74('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e74('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2e74('0x3'));var interaction=require(_0x2e74('0x4'));var config=require(_0x2e74('0x5'));var controller=require(_0x2e74('0x6'));router['get']('/',auth[_0x2e74('0x7')](),controller[_0x2e74('0x8')]);router['get'](_0x2e74('0x9'),auth[_0x2e74('0x7')](),controller[_0x2e74('0xa')]);router['post']('/',auth[_0x2e74('0x7')](),controller[_0x2e74('0xb')]);router[_0x2e74('0xc')](_0x2e74('0x9'),auth[_0x2e74('0x7')](),controller[_0x2e74('0xd')]);router[_0x2e74('0xe')]('/:id',auth[_0x2e74('0x7')](),controller[_0x2e74('0xf')]);module[_0x2e74('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e491b88..ff2a18f 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 _0x373a=['variable','STRING','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0x182c35,_0x29296c){var _0x500650=function(_0x4d4958){while(--_0x4d4958){_0x182c35['push'](_0x182c35['shift']());}};_0x500650(++_0x29296c);}(_0x373a,0xc0));var _0xa373=function(_0x43bfb6,_0x4687ce){_0x43bfb6=_0x43bfb6-0x0;var _0x214219=_0x373a[_0x43bfb6];return _0x214219;};'use strict';var Sequelize=require(_0xa373('0x0'));module[_0xa373('0x1')]={'type':{'type':Sequelize[_0xa373('0x2')](_0xa373('0x3'),'variable','customVariable',_0xa373('0x4'),_0xa373('0x5')),'defaultValue':_0xa373('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xa373('0x3'),_0xa373('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xa373('0x7')]},'idField':{'type':Sequelize[_0xa373('0x7')]},'nameField':{'type':Sequelize[_0xa373('0x7')]},'customField':{'type':Sequelize[_0xa373('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa373('0x7')]}}; \ No newline at end of file +var _0x59f6=['string','variable','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x59f6,0xfd));var _0x659f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x59f6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x659f('0x0'));module[_0x659f('0x1')]={'type':{'type':Sequelize[_0x659f('0x2')](_0x659f('0x3'),_0x659f('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0x659f('0x3')},'content':{'type':Sequelize[_0x659f('0x5')]},'key':{'type':Sequelize[_0x659f('0x5')]},'keyType':{'type':Sequelize[_0x659f('0x2')](_0x659f('0x3'),_0x659f('0x4'),_0x659f('0x6'))},'keyContent':{'type':Sequelize[_0x659f('0x5')]},'idField':{'type':Sequelize[_0x659f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x659f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x659f('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index b3f6b48..1b12a8c 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 _0xf8af=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce'];(function(_0xf04c6d,_0xe98786){var _0x4a804e=function(_0x431a0a){while(--_0x431a0a){_0xf04c6d['push'](_0xf04c6d['shift']());}};_0x4a804e(++_0xe98786);}(_0xf8af,0x8b));var _0xff8a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf8af[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];function respondWithStatusCode(_0x252271,_0x40bf06){_0x40bf06=_0x40bf06||0xcc;return function(_0x244e69){if(_0x244e69){return _0x252271['sendStatus'](_0x40bf06);}return _0x252271[_0xff8a('0x1a')](_0x40bf06)[_0xff8a('0x1b')]();};}function respondWithResult(_0xf81533,_0x1cd47d){_0x1cd47d=_0x1cd47d||0xc8;return function(_0x5d793b){if(_0x5d793b){return _0xf81533['status'](_0x1cd47d)['json'](_0x5d793b);}};}function respondWithFilteredResult(_0x4a5e6e,_0x2f83df){return function(_0x569b15){if(_0x569b15){var _0x279441=typeof _0x2f83df[_0xff8a('0x1c')]==='undefined'&&typeof _0x2f83df[_0xff8a('0x1d')]==='undefined';var _0x5ed382=_0x569b15[_0xff8a('0x1e')];var _0x68524a=_0x279441?0x0:_0x2f83df[_0xff8a('0x1c')];var _0x55a187=_0x279441?_0x569b15[_0xff8a('0x1e')]:_0x2f83df['offset']+_0x2f83df[_0xff8a('0x1d')];var _0x4bb5ec;if(_0x55a187>=_0x5ed382){_0x55a187=_0x5ed382;_0x4bb5ec=0xc8;}else{_0x4bb5ec=0xce;}_0x4a5e6e[_0xff8a('0x1a')](_0x4bb5ec);return _0x4a5e6e[_0xff8a('0x1f')](_0xff8a('0x20'),_0x68524a+'-'+_0x55a187+'/'+_0x5ed382)[_0xff8a('0x21')](_0x569b15);}return null;};}function patchUpdates(_0x145d95){return function(_0x33ee52){try{jsonpatch[_0xff8a('0x22')](_0x33ee52,_0x145d95,!![]);}catch(_0x1ba1f1){return BPromise[_0xff8a('0x23')](_0x1ba1f1);}return _0x33ee52[_0xff8a('0x24')]();};}function saveUpdates(_0x1fc147,_0x2d0fc2){return function(_0x3bb4ac){if(_0x3bb4ac){return _0x3bb4ac[_0xff8a('0x25')](_0x1fc147)[_0xff8a('0x26')](function(_0x5e7897){return _0x5e7897;});}return null;};}function removeEntity(_0x10e205,_0x491322){return function(_0x2d6d8f){if(_0x2d6d8f){return _0x2d6d8f[_0xff8a('0x27')]()['then'](function(){_0x10e205[_0xff8a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c9ecc,_0x3f03ce){return function(_0x2c67c2){if(!_0x2c67c2){_0x1c9ecc[_0xff8a('0x28')](0x194);}return _0x2c67c2;};}function handleError(_0x375285,_0x55b267){_0x55b267=_0x55b267||0x1f4;return function(_0x2c57c9){logger[_0xff8a('0x29')](_0x2c57c9[_0xff8a('0x2a')]);if(_0x2c57c9['name']){delete _0x2c57c9[_0xff8a('0x2b')];}_0x375285[_0xff8a('0x1a')](_0x55b267)[_0xff8a('0x2c')](_0x2c57c9);};}exports[_0xff8a('0x2d')]=function(_0x38188f,_0xba33b6){var _0x20ac09={},_0x59b6d4={},_0x4ca17e={'count':0x0,'rows':[]};var _0x1fc2a8=_[_0xff8a('0x2e')](db[_0xff8a('0x2f')][_0xff8a('0x30')],function(_0x430cbd){return{'name':_0x430cbd[_0xff8a('0x31')],'type':_0x430cbd['type'][_0xff8a('0x32')]};});_0x59b6d4[_0xff8a('0x33')]=_['map'](_0x1fc2a8,_0xff8a('0x2b'));_0x59b6d4[_0xff8a('0x34')]=_[_0xff8a('0x35')](_0x38188f['query']);_0x59b6d4[_0xff8a('0x36')]=_[_0xff8a('0x37')](_0x59b6d4['model'],_0x59b6d4[_0xff8a('0x34')]);_0x20ac09[_0xff8a('0x38')]=_[_0xff8a('0x37')](_0x59b6d4[_0xff8a('0x33')],qs[_0xff8a('0x39')](_0x38188f[_0xff8a('0x34')][_0xff8a('0x39')]));_0x20ac09[_0xff8a('0x38')]=_0x20ac09[_0xff8a('0x38')]['length']?_0x20ac09[_0xff8a('0x38')]:_0x59b6d4[_0xff8a('0x33')];if(!_0x38188f['query'][_0xff8a('0x3a')](_0xff8a('0x3b'))){_0x20ac09[_0xff8a('0x1d')]=qs[_0xff8a('0x1d')](_0x38188f[_0xff8a('0x34')][_0xff8a('0x1d')]);_0x20ac09[_0xff8a('0x1c')]=qs[_0xff8a('0x1c')](_0x38188f[_0xff8a('0x34')]['offset']);}_0x20ac09['order']=qs[_0xff8a('0x3c')](_0x38188f[_0xff8a('0x34')]['sort']);_0x20ac09[_0xff8a('0x3d')]=qs[_0xff8a('0x36')](_['pick'](_0x38188f['query'],_0x59b6d4['filters']),_0x1fc2a8);if(_0x38188f[_0xff8a('0x34')][_0xff8a('0x3e')]){_0x20ac09['where']=_[_0xff8a('0x3f')](_0x20ac09[_0xff8a('0x3d')],{'$or':_[_0xff8a('0x2e')](_0x1fc2a8,function(_0x552710){if(_0x552710[_0xff8a('0x40')]!=='VIRTUAL'){var _0x2e7ac7={};_0x2e7ac7[_0x552710[_0xff8a('0x2b')]]={'$like':'%'+_0x38188f['query'][_0xff8a('0x3e')]+'%'};return _0x2e7ac7;}})});}_0x20ac09=_['merge']({},_0x20ac09,_0x38188f['options']);var _0x1ef830={'where':_0x20ac09[_0xff8a('0x3d')]};return db[_0xff8a('0x2f')][_0xff8a('0x1e')](_0x1ef830)[_0xff8a('0x26')](function(_0x4a28d0){_0x4ca17e[_0xff8a('0x1e')]=_0x4a28d0;if(_0x38188f['query'][_0xff8a('0x41')]){_0x20ac09[_0xff8a('0x42')]=[{'all':!![]}];}return db[_0xff8a('0x2f')][_0xff8a('0x43')](_0x20ac09);})[_0xff8a('0x26')](function(_0x2ab2e6){_0x4ca17e[_0xff8a('0x44')]=_0x2ab2e6;return _0x4ca17e;})['then'](respondWithFilteredResult(_0xba33b6,_0x20ac09))[_0xff8a('0x45')](handleError(_0xba33b6,null));};exports[_0xff8a('0x46')]=function(_0x2ba136,_0x273f26){var _0x2705e8={'raw':!![],'where':{'id':_0x2ba136[_0xff8a('0x47')]['id']}},_0x3a3152={};_0x3a3152[_0xff8a('0x33')]=_[_0xff8a('0x35')](db['DeskField'][_0xff8a('0x30')]);_0x3a3152['query']=_[_0xff8a('0x35')](_0x2ba136[_0xff8a('0x34')]);_0x3a3152[_0xff8a('0x36')]=_[_0xff8a('0x37')](_0x3a3152[_0xff8a('0x33')],_0x3a3152[_0xff8a('0x34')]);_0x2705e8[_0xff8a('0x38')]=_[_0xff8a('0x37')](_0x3a3152[_0xff8a('0x33')],qs[_0xff8a('0x39')](_0x2ba136[_0xff8a('0x34')]['fields']));_0x2705e8[_0xff8a('0x38')]=_0x2705e8[_0xff8a('0x38')][_0xff8a('0x48')]?_0x2705e8[_0xff8a('0x38')]:_0x3a3152[_0xff8a('0x33')];if(_0x2ba136['query'][_0xff8a('0x41')]){_0x2705e8[_0xff8a('0x42')]=[{'all':!![]}];}_0x2705e8=_[_0xff8a('0x3f')]({},_0x2705e8,_0x2ba136['options']);return db['DeskField'][_0xff8a('0x49')](_0x2705e8)[_0xff8a('0x26')](handleEntityNotFound(_0x273f26,null))[_0xff8a('0x26')](respondWithResult(_0x273f26,null))[_0xff8a('0x45')](handleError(_0x273f26,null));};exports['create']=function(_0x9873eb,_0x14c189){return db[_0xff8a('0x2f')][_0xff8a('0x4a')](_0x9873eb[_0xff8a('0x4b')],{})[_0xff8a('0x26')](respondWithResult(_0x14c189,0xc9))[_0xff8a('0x45')](handleError(_0x14c189,null));};exports[_0xff8a('0x25')]=function(_0x349573,_0x17fd91){if(_0x349573[_0xff8a('0x4b')]['id']){delete _0x349573['body']['id'];}return db[_0xff8a('0x2f')][_0xff8a('0x49')]({'where':{'id':_0x349573['params']['id']}})[_0xff8a('0x26')](handleEntityNotFound(_0x17fd91,null))[_0xff8a('0x26')](saveUpdates(_0x349573['body'],null))[_0xff8a('0x26')](respondWithResult(_0x17fd91,null))[_0xff8a('0x45')](handleError(_0x17fd91,null));};exports[_0xff8a('0x27')]=function(_0x90ea1f,_0x29cc35){return db[_0xff8a('0x2f')][_0xff8a('0x49')]({'where':{'id':_0x90ea1f[_0xff8a('0x47')]['id']}})[_0xff8a('0x26')](handleEntityNotFound(_0x29cc35,null))[_0xff8a('0x26')](removeEntity(_0x29cc35,null))[_0xff8a('0x45')](handleError(_0x29cc35,null));}; \ No newline at end of file +var _0x9ed7=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','save','update','then','error','stack','name','send','index','map','DeskField','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','create','body','catch','find','destroy','eml-format','rimraf','zip-dir','request-promise'];(function(_0x3bafcd,_0x3d217f){var _0x328466=function(_0x4ea4fc){while(--_0x4ea4fc){_0x3bafcd['push'](_0x3bafcd['shift']());}};_0x328466(++_0x3d217f);}(_0x9ed7,0x1a6));var _0x79ed=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x9ed7[_0x5d1044];return _0x3cd90e;};'use strict';var emlformat=require(_0x79ed('0x0'));var rimraf=require(_0x79ed('0x1'));var zipdir=require(_0x79ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79ed('0x3'));var moment=require('moment');var BPromise=require(_0x79ed('0x4'));var Mustache=require(_0x79ed('0x5'));var util=require(_0x79ed('0x6'));var path=require(_0x79ed('0x7'));var sox=require(_0x79ed('0x8'));var csv=require(_0x79ed('0x9'));var ejs=require(_0x79ed('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79ed('0xb'));var squel=require(_0x79ed('0xc'));var crypto=require(_0x79ed('0xd'));var jsforce=require(_0x79ed('0xe'));var deskjs=require(_0x79ed('0xf'));var toCsv=require(_0x79ed('0x9'));var querystring=require(_0x79ed('0x10'));var Papa=require('papaparse');var Redis=require(_0x79ed('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79ed('0x12'));var logger=require(_0x79ed('0x13'))(_0x79ed('0x14'));var utils=require(_0x79ed('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x79ed('0x16'))['db'];function respondWithStatusCode(_0x2c2b11,_0x198377){_0x198377=_0x198377||0xcc;return function(_0x5f3066){if(_0x5f3066){return _0x2c2b11[_0x79ed('0x17')](_0x198377);}return _0x2c2b11[_0x79ed('0x18')](_0x198377)[_0x79ed('0x19')]();};}function respondWithResult(_0x210f94,_0x309d09){_0x309d09=_0x309d09||0xc8;return function(_0x3bcdbe){if(_0x3bcdbe){return _0x210f94[_0x79ed('0x18')](_0x309d09)['json'](_0x3bcdbe);}};}function respondWithFilteredResult(_0x42680d,_0x436ed5){return function(_0x240436){if(_0x240436){var _0x1c6570=typeof _0x436ed5['offset']===_0x79ed('0x1a')&&typeof _0x436ed5[_0x79ed('0x1b')]===_0x79ed('0x1a');var _0x455cef=_0x240436[_0x79ed('0x1c')];var _0x383b75=_0x1c6570?0x0:_0x436ed5[_0x79ed('0x1d')];var _0xa9669d=_0x1c6570?_0x240436[_0x79ed('0x1c')]:_0x436ed5[_0x79ed('0x1d')]+_0x436ed5[_0x79ed('0x1b')];var _0x3f2f7f;if(_0xa9669d>=_0x455cef){_0xa9669d=_0x455cef;_0x3f2f7f=0xc8;}else{_0x3f2f7f=0xce;}_0x42680d[_0x79ed('0x18')](_0x3f2f7f);return _0x42680d['set'](_0x79ed('0x1e'),_0x383b75+'-'+_0xa9669d+'/'+_0x455cef)['json'](_0x240436);}return null;};}function patchUpdates(_0x3dc35){return function(_0x251076){try{jsonpatch[_0x79ed('0x1f')](_0x251076,_0x3dc35,!![]);}catch(_0x1326cb){return BPromise['reject'](_0x1326cb);}return _0x251076[_0x79ed('0x20')]();};}function saveUpdates(_0x13908d,_0x40912c){return function(_0x25d67e){if(_0x25d67e){return _0x25d67e[_0x79ed('0x21')](_0x13908d)[_0x79ed('0x22')](function(_0x67ef69){return _0x67ef69;});}return null;};}function removeEntity(_0xb347b1,_0x2a99ac){return function(_0x50bf07){if(_0x50bf07){return _0x50bf07['destroy']()[_0x79ed('0x22')](function(){_0xb347b1[_0x79ed('0x18')](0xcc)[_0x79ed('0x19')]();});}};}function handleEntityNotFound(_0x37b238,_0x34461b){return function(_0x3c573f){if(!_0x3c573f){_0x37b238[_0x79ed('0x17')](0x194);}return _0x3c573f;};}function handleError(_0x7b46de,_0x163f37){_0x163f37=_0x163f37||0x1f4;return function(_0x2f70a2){logger[_0x79ed('0x23')](_0x2f70a2[_0x79ed('0x24')]);if(_0x2f70a2[_0x79ed('0x25')]){delete _0x2f70a2[_0x79ed('0x25')];}_0x7b46de[_0x79ed('0x18')](_0x163f37)[_0x79ed('0x26')](_0x2f70a2);};}exports[_0x79ed('0x27')]=function(_0x1a838d,_0x305c36){var _0x159754={},_0x32b8b9={},_0x3ded32={'count':0x0,'rows':[]};var _0x351b78=_[_0x79ed('0x28')](db[_0x79ed('0x29')]['rawAttributes'],function(_0x4833b4){return{'name':_0x4833b4[_0x79ed('0x2a')],'type':_0x4833b4[_0x79ed('0x2b')][_0x79ed('0x2c')]};});_0x32b8b9[_0x79ed('0x2d')]=_[_0x79ed('0x28')](_0x351b78,_0x79ed('0x25'));_0x32b8b9['query']=_[_0x79ed('0x2e')](_0x1a838d[_0x79ed('0x2f')]);_0x32b8b9['filters']=_[_0x79ed('0x30')](_0x32b8b9[_0x79ed('0x2d')],_0x32b8b9[_0x79ed('0x2f')]);_0x159754[_0x79ed('0x31')]=_[_0x79ed('0x30')](_0x32b8b9['model'],qs[_0x79ed('0x32')](_0x1a838d[_0x79ed('0x2f')][_0x79ed('0x32')]));_0x159754[_0x79ed('0x31')]=_0x159754[_0x79ed('0x31')]['length']?_0x159754[_0x79ed('0x31')]:_0x32b8b9[_0x79ed('0x2d')];if(!_0x1a838d[_0x79ed('0x2f')][_0x79ed('0x33')](_0x79ed('0x34'))){_0x159754['limit']=qs[_0x79ed('0x1b')](_0x1a838d[_0x79ed('0x2f')]['limit']);_0x159754[_0x79ed('0x1d')]=qs['offset'](_0x1a838d[_0x79ed('0x2f')][_0x79ed('0x1d')]);}_0x159754['order']=qs[_0x79ed('0x35')](_0x1a838d[_0x79ed('0x2f')]['sort']);_0x159754['where']=qs[_0x79ed('0x36')](_['pick'](_0x1a838d[_0x79ed('0x2f')],_0x32b8b9[_0x79ed('0x36')]),_0x351b78);if(_0x1a838d[_0x79ed('0x2f')][_0x79ed('0x37')]){_0x159754[_0x79ed('0x38')]=_['merge'](_0x159754[_0x79ed('0x38')],{'$or':_[_0x79ed('0x28')](_0x351b78,function(_0x193fda){if(_0x193fda['type']!==_0x79ed('0x39')){var _0x51737a={};_0x51737a[_0x193fda[_0x79ed('0x25')]]={'$like':'%'+_0x1a838d['query'][_0x79ed('0x37')]+'%'};return _0x51737a;}})});}_0x159754=_[_0x79ed('0x3a')]({},_0x159754,_0x1a838d[_0x79ed('0x3b')]);var _0x2bcfc0={'where':_0x159754[_0x79ed('0x38')]};return db[_0x79ed('0x29')][_0x79ed('0x1c')](_0x2bcfc0)['then'](function(_0x2161af){_0x3ded32[_0x79ed('0x1c')]=_0x2161af;if(_0x1a838d[_0x79ed('0x2f')][_0x79ed('0x3c')]){_0x159754[_0x79ed('0x3d')]=[{'all':!![]}];}return db[_0x79ed('0x29')][_0x79ed('0x3e')](_0x159754);})[_0x79ed('0x22')](function(_0x21b490){_0x3ded32['rows']=_0x21b490;return _0x3ded32;})[_0x79ed('0x22')](respondWithFilteredResult(_0x305c36,_0x159754))['catch'](handleError(_0x305c36,null));};exports[_0x79ed('0x3f')]=function(_0x5572ab,_0xc8382d){var _0xc14634={'raw':!![],'where':{'id':_0x5572ab[_0x79ed('0x40')]['id']}},_0x5374c2={};_0x5374c2['model']=_[_0x79ed('0x2e')](db[_0x79ed('0x29')]['rawAttributes']);_0x5374c2[_0x79ed('0x2f')]=_[_0x79ed('0x2e')](_0x5572ab[_0x79ed('0x2f')]);_0x5374c2['filters']=_[_0x79ed('0x30')](_0x5374c2[_0x79ed('0x2d')],_0x5374c2['query']);_0xc14634[_0x79ed('0x31')]=_['intersection'](_0x5374c2['model'],qs['fields'](_0x5572ab[_0x79ed('0x2f')][_0x79ed('0x32')]));_0xc14634[_0x79ed('0x31')]=_0xc14634[_0x79ed('0x31')][_0x79ed('0x41')]?_0xc14634[_0x79ed('0x31')]:_0x5374c2[_0x79ed('0x2d')];if(_0x5572ab['query'][_0x79ed('0x3c')]){_0xc14634[_0x79ed('0x3d')]=[{'all':!![]}];}_0xc14634=_[_0x79ed('0x3a')]({},_0xc14634,_0x5572ab[_0x79ed('0x3b')]);return db[_0x79ed('0x29')]['find'](_0xc14634)[_0x79ed('0x22')](handleEntityNotFound(_0xc8382d,null))[_0x79ed('0x22')](respondWithResult(_0xc8382d,null))['catch'](handleError(_0xc8382d,null));};exports[_0x79ed('0x42')]=function(_0x26a012,_0x3e3926){return db[_0x79ed('0x29')][_0x79ed('0x42')](_0x26a012[_0x79ed('0x43')],{})['then'](respondWithResult(_0x3e3926,0xc9))[_0x79ed('0x44')](handleError(_0x3e3926,null));};exports[_0x79ed('0x21')]=function(_0x4d840c,_0x50e025){if(_0x4d840c['body']['id']){delete _0x4d840c[_0x79ed('0x43')]['id'];}return db[_0x79ed('0x29')][_0x79ed('0x45')]({'where':{'id':_0x4d840c[_0x79ed('0x40')]['id']}})[_0x79ed('0x22')](handleEntityNotFound(_0x50e025,null))[_0x79ed('0x22')](saveUpdates(_0x4d840c[_0x79ed('0x43')],null))['then'](respondWithResult(_0x50e025,null))[_0x79ed('0x44')](handleError(_0x50e025,null));};exports[_0x79ed('0x46')]=function(_0x5b33f0,_0x53dfd3){return db[_0x79ed('0x29')][_0x79ed('0x45')]({'where':{'id':_0x5b33f0[_0x79ed('0x40')]['id']}})[_0x79ed('0x22')](handleEntityNotFound(_0x53dfd3,null))[_0x79ed('0x22')](removeEntity(_0x53dfd3,null))[_0x79ed('0x44')](handleError(_0x53dfd3,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f4c4a8a..c3fdba4 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 _0x58e0=['int_desk_fields','desk_unique_index','FieldId','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','DeskField'];(function(_0x318588,_0xceaa49){var _0x4e8259=function(_0x35e65f){while(--_0x35e65f){_0x318588['push'](_0x318588['shift']());}};_0x4e8259(++_0xceaa49);}(_0x58e0,0x155));var _0x058e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x58e0[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x058e('0x0'));var logger=require('../../config/logger')(_0x058e('0x1'));var moment=require(_0x058e('0x2'));var BPromise=require(_0x058e('0x3'));var rp=require(_0x058e('0x4'));var fs=require('fs');var path=require(_0x058e('0x5'));var rimraf=require('rimraf');var config=require(_0x058e('0x6'));var attributes=require('./intDeskField.attributes');module[_0x058e('0x7')]=function(_0x142d64,_0x357342){return _0x142d64[_0x058e('0x8')](_0x058e('0x9'),attributes,{'tableName':_0x058e('0xa'),'paranoid':![],'indexes':[{'name':_0x058e('0xb'),'fields':['idField',_0x058e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce7=['lodash','../../config/logger','api','moment','bluebird','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId'];(function(_0x263486,_0x4d4c98){var _0x4f61b5=function(_0x4a666b){while(--_0x4a666b){_0x263486['push'](_0x263486['shift']());}};_0x4f61b5(++_0x4d4c98);}(_0x2ce7,0x68));var _0x72ce=function(_0x1d3d0b,_0x1a7563){_0x1d3d0b=_0x1d3d0b-0x0;var _0x506090=_0x2ce7[_0x1d3d0b];return _0x506090;};'use strict';var _=require(_0x72ce('0x0'));var util=require('util');var logger=require(_0x72ce('0x1'))(_0x72ce('0x2'));var moment=require(_0x72ce('0x3'));var BPromise=require(_0x72ce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x72ce('0x5'));var config=require('../../config/environment');var attributes=require(_0x72ce('0x6'));module[_0x72ce('0x7')]=function(_0x2c034a,_0x2792f9){return _0x2c034a[_0x72ce('0x8')](_0x72ce('0x9'),attributes,{'tableName':_0x72ce('0xa'),'paranoid':![],'indexes':[{'name':_0x72ce('0xb'),'fields':['idField',_0x72ce('0xc')],'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 5ab2d9f..a773d0b 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 _0x9310=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x27be13,_0x2f22fc){var _0x4b1447=function(_0x273b39){while(--_0x273b39){_0x27be13['push'](_0x27be13['shift']());}};_0x4b1447(++_0x2f22fc);}(_0x9310,0x148));var _0x0931=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x9310[_0x5f1cf8];return _0x27d0fa;};'use strict';var _=require(_0x0931('0x0'));var util=require(_0x0931('0x1'));var moment=require(_0x0931('0x2'));var BPromise=require(_0x0931('0x3'));var rs=require(_0x0931('0x4'));var fs=require('fs');var Redis=require(_0x0931('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0931('0x6'));var client=jayson[_0x0931('0x7')][_0x0931('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x548241,_0x2ef369,_0x2ac37e){return new BPromise(function(_0x4d5fb8,_0x29b14f){return client[_0x0931('0x9')](_0x548241,_0x2ac37e)['then'](function(_0x523267){logger[_0x0931('0xa')]('DeskField,\x20%s,\x20%s',_0x2ef369,_0x0931('0xb'));logger[_0x0931('0xc')](_0x0931('0xd'),_0x2ef369,'request\x20sent',JSON[_0x0931('0xe')](_0x523267));if(_0x523267[_0x0931('0xf')]){if(_0x523267[_0x0931('0xf')][_0x0931('0x10')]===0x1f4){logger['error'](_0x0931('0x11'),_0x2ef369,_0x523267['error'][_0x0931('0x12')]);return _0x29b14f(_0x523267['error'][_0x0931('0x12')]);}logger[_0x0931('0xf')](_0x0931('0x11'),_0x2ef369,_0x523267[_0x0931('0xf')][_0x0931('0x12')]);return _0x4d5fb8(_0x523267['error'][_0x0931('0x12')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x2ef369,'request\x20sent');_0x4d5fb8(_0x523267[_0x0931('0x13')]['message']);}})['catch'](function(_0x598a16){logger[_0x0931('0xf')](_0x0931('0x11'),_0x2ef369,_0x598a16);_0x29b14f(_0x598a16);});});} \ No newline at end of file +var _0x3be6=['../../mysqldb','jayson/promise','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','randomstring','ioredis'];(function(_0x3bfac9,_0x57ffeb){var _0x3eabed=function(_0x259791){while(--_0x259791){_0x3bfac9['push'](_0x3bfac9['shift']());}};_0x3eabed(++_0x57ffeb);}(_0x3be6,0x14c));var _0x63be=function(_0x895358,_0x32f914){_0x895358=_0x895358-0x0;var _0x26e26e=_0x3be6[_0x895358];return _0x26e26e;};'use strict';var _=require(_0x63be('0x0'));var util=require('util');var moment=require(_0x63be('0x1'));var BPromise=require('bluebird');var rs=require(_0x63be('0x2'));var fs=require('fs');var Redis=require(_0x63be('0x3'));var db=require(_0x63be('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x63be('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x174e32,_0x17a209,_0x60725c){return new BPromise(function(_0x22e747,_0x5e8625){return client['request'](_0x174e32,_0x60725c)[_0x63be('0x6')](function(_0x1f3464){logger['info'](_0x63be('0x7'),_0x17a209,_0x63be('0x8'));logger[_0x63be('0x9')](_0x63be('0xa'),_0x17a209,_0x63be('0x8'),JSON[_0x63be('0xb')](_0x1f3464));if(_0x1f3464[_0x63be('0xc')]){if(_0x1f3464[_0x63be('0xc')]['code']===0x1f4){logger[_0x63be('0xc')](_0x63be('0x7'),_0x17a209,_0x1f3464['error'][_0x63be('0xd')]);return _0x5e8625(_0x1f3464[_0x63be('0xc')][_0x63be('0xd')]);}logger[_0x63be('0xc')]('DeskField,\x20%s,\x20%s',_0x17a209,_0x1f3464[_0x63be('0xc')][_0x63be('0xd')]);return _0x22e747(_0x1f3464[_0x63be('0xc')]['message']);}else{logger[_0x63be('0xe')](_0x63be('0x7'),_0x17a209,_0x63be('0x8'));_0x22e747(_0x1f3464['result'][_0x63be('0xd')]);}})[_0x63be('0xf')](function(_0x523b68){logger[_0x63be('0xc')]('DeskField,\x20%s,\x20%s',_0x17a209,_0x523b68);_0x5e8625(_0x523b68);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6148baa..a0eb2a0 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 _0x1271=['getFields','post','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','/:id/fields'];(function(_0x43de5a,_0x11eb8a){var _0x24b18e=function(_0x48fdc9){while(--_0x48fdc9){_0x43de5a['push'](_0x43de5a['shift']());}};_0x24b18e(++_0x11eb8a);}(_0x1271,0xd5));var _0x1127=function(_0x2af99e,_0x3b12b2){_0x2af99e=_0x2af99e-0x0;var _0x167bef=_0x1271[_0x2af99e];return _0x167bef;};'use strict';var multer=require(_0x1127('0x0'));var util=require(_0x1127('0x1'));var path=require(_0x1127('0x2'));var timeout=require(_0x1127('0x3'));var express=require(_0x1127('0x4'));var router=express[_0x1127('0x5')]();var fs_extra=require(_0x1127('0x6'));var auth=require(_0x1127('0x7'));var interaction=require(_0x1127('0x8'));var config=require(_0x1127('0x9'));var controller=require('./intDynamics365Account.controller');router[_0x1127('0xa')]('/',auth[_0x1127('0xb')](),controller['index']);router[_0x1127('0xa')](_0x1127('0xc'),auth[_0x1127('0xb')](),controller['show']);router[_0x1127('0xa')](_0x1127('0xd'),auth[_0x1127('0xb')](),controller['getConfigurations']);router[_0x1127('0xa')](_0x1127('0xe'),auth[_0x1127('0xb')](),controller[_0x1127('0xf')]);router[_0x1127('0x10')]('/',auth[_0x1127('0xb')](),controller['create']);router[_0x1127('0x10')](_0x1127('0xd'),auth[_0x1127('0xb')](),controller['addConfiguration']);router['put'](_0x1127('0xc'),auth[_0x1127('0xb')](),controller['update']);router[_0x1127('0x11')]('/:id',auth[_0x1127('0xb')](),controller[_0x1127('0x12')]);module['exports']=router; \ No newline at end of file +var _0x83fb=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intDynamics365Account.controller','get'];(function(_0x330b5a,_0x1cc7ac){var _0x44ebc2=function(_0x24be96){while(--_0x24be96){_0x330b5a['push'](_0x330b5a['shift']());}};_0x44ebc2(++_0x1cc7ac);}(_0x83fb,0x1ad));var _0xb83f=function(_0x407458,_0x250763){_0x407458=_0x407458-0x0;var _0x13161d=_0x83fb[_0x407458];return _0x13161d;};'use strict';var multer=require(_0xb83f('0x0'));var util=require(_0xb83f('0x1'));var path=require('path');var timeout=require(_0xb83f('0x2'));var express=require(_0xb83f('0x3'));var router=express[_0xb83f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb83f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb83f('0x6'));router[_0xb83f('0x7')]('/',auth[_0xb83f('0x8')](),controller[_0xb83f('0x9')]);router[_0xb83f('0x7')](_0xb83f('0xa'),auth[_0xb83f('0x8')](),controller[_0xb83f('0xb')]);router['get'](_0xb83f('0xc'),auth[_0xb83f('0x8')](),controller[_0xb83f('0xd')]);router['get'](_0xb83f('0xe'),auth[_0xb83f('0x8')](),controller[_0xb83f('0xf')]);router[_0xb83f('0x10')]('/',auth['isAuthenticated'](),controller[_0xb83f('0x11')]);router[_0xb83f('0x10')](_0xb83f('0xc'),auth[_0xb83f('0x8')](),controller[_0xb83f('0x12')]);router[_0xb83f('0x13')](_0xb83f('0xa'),auth[_0xb83f('0x8')](),controller[_0xb83f('0x14')]);router[_0xb83f('0x15')]('/:id',auth[_0xb83f('0x8')](),controller['destroy']);module[_0xb83f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index fca628e..e0095d6 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 _0xc01b=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2803dc,_0x1cdaf1){var _0x552ae4=function(_0x15f1ef){while(--_0x15f1ef){_0x2803dc['push'](_0x2803dc['shift']());}};_0x552ae4(++_0x1cdaf1);}(_0xc01b,0x65));var _0xbc01=function(_0x22c615,_0x18e7fe){_0x22c615=_0x22c615-0x0;var _0x1200e1=_0xc01b[_0x22c615];return _0x1200e1;};'use strict';var Sequelize=require(_0xbc01('0x0'));module[_0xbc01('0x1')]={'name':{'type':Sequelize[_0xbc01('0x2')]},'username':{'type':Sequelize[_0xbc01('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbc01('0x2')]},'tenantId':{'type':Sequelize[_0xbc01('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xbc01('0x2')]},'modernAuthentication':{'type':Sequelize[_0xbc01('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2e88=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x2e88,0x95));var _0x82e8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2e88[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x82e8('0x0'));module[_0x82e8('0x1')]={'name':{'type':Sequelize[_0x82e8('0x2')]},'username':{'type':Sequelize[_0x82e8('0x2')]},'password':{'type':Sequelize[_0x82e8('0x2')]},'remoteUri':{'type':Sequelize[_0x82e8('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x82e8('0x2')]},'clientSecret':{'type':Sequelize[_0x82e8('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x82e8('0x2')]},'modernAuthentication':{'type':Sequelize[_0x82e8('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 16109fb..734e888 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 _0x0565=['data5','modernAuthentication','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','username','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','then','destroy','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','update','body','getConfigurations','findOne','Dynamics365Configuration','order','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','format','getFields','ticketType','incident','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientSecret','CloudProvider'];(function(_0x489a16,_0x438293){var _0x1aa645=function(_0xd08ab5){while(--_0xd08ab5){_0x489a16['push'](_0x489a16['shift']());}};_0x1aa645(++_0x438293);}(_0x0565,0xf2));var _0x5056=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x0565[_0x819464];return _0x49dcc0;};'use strict';var rp=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var _=require(_0x5056('0x2'));var qs=require(_0x5056('0x3'));var logger=require(_0x5056('0x4'))(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var integrations=require(_0x5056('0x7'));function respondWithResult(_0x3657a8,_0x2b0883){_0x2b0883=_0x2b0883||0xc8;return function(_0x554040){if(_0x554040){return _0x3657a8[_0x5056('0x8')](_0x2b0883)[_0x5056('0x9')](_0x554040);}};}function respondWithFilteredResult(_0x1143df,_0x22afb7){return function(_0x4b8280){if(_0x4b8280){var _0x52b01f=typeof _0x22afb7[_0x5056('0xa')]===_0x5056('0xb')&&typeof _0x22afb7[_0x5056('0xc')]===_0x5056('0xb');var _0x2144a9=_0x4b8280[_0x5056('0xd')];var _0x1fa531=_0x52b01f?0x0:_0x22afb7[_0x5056('0xa')];var _0x5d2e60=_0x52b01f?_0x4b8280[_0x5056('0xd')]:_0x22afb7[_0x5056('0xa')]+_0x22afb7[_0x5056('0xc')];var _0x5ab4b2;if(_0x5d2e60>=_0x2144a9){_0x5d2e60=_0x2144a9;_0x5ab4b2=0xc8;}else{_0x5ab4b2=0xce;}_0x1143df['status'](_0x5ab4b2);return _0x1143df[_0x5056('0xe')]('Content-Range',_0x1fa531+'-'+_0x5d2e60+'/'+_0x2144a9)['json'](_0x4b8280);}return null;};}function saveUpdates(_0x53e98a){return function(_0x2d44fb){if(_0x2d44fb){return _0x2d44fb['update'](_0x53e98a)[_0x5056('0xf')](function(_0x26edc1){return _0x26edc1;});}return null;};}function removeEntity(_0x7af76b){return function(_0x543cee){if(_0x543cee){return _0x543cee[_0x5056('0x10')]()[_0x5056('0xf')](function(){_0x7af76b[_0x5056('0x8')](0xcc)[_0x5056('0x11')]();});}};}function handleEntityNotFound(_0x21561d){return function(_0x6a044a){if(!_0x6a044a){_0x21561d['sendStatus'](0x194);}return _0x6a044a;};}function handleError(_0x2b7a17,_0x560d1e){_0x560d1e=_0x560d1e||0x1f4;return function(_0x43db77){logger[_0x5056('0x12')](_0x43db77[_0x5056('0x13')]);if(_0x43db77[_0x5056('0x14')]){delete _0x43db77[_0x5056('0x14')];}_0x2b7a17['status'](_0x560d1e)[_0x5056('0x15')](_0x43db77);};}exports[_0x5056('0x16')]=function(_0x4f8fa7,_0x5c1cec){var _0x20776c={},_0x517bf3={},_0x14d60e={'count':0x0,'rows':[]};var _0x250276=_[_0x5056('0x17')](db[_0x5056('0x18')][_0x5056('0x19')],function(_0x4835fd){return{'name':_0x4835fd[_0x5056('0x1a')],'type':_0x4835fd[_0x5056('0x1b')]['key']};});_0x517bf3[_0x5056('0x1c')]=_[_0x5056('0x17')](_0x250276,_0x5056('0x14'));_0x517bf3['query']=_[_0x5056('0x1d')](_0x4f8fa7[_0x5056('0x1e')]);_0x517bf3['filters']=_['intersection'](_0x517bf3[_0x5056('0x1c')],_0x517bf3[_0x5056('0x1e')]);_0x20776c[_0x5056('0x1f')]=_[_0x5056('0x20')](_0x517bf3['model'],qs[_0x5056('0x21')](_0x4f8fa7[_0x5056('0x1e')]['fields']));_0x20776c[_0x5056('0x1f')]=_0x20776c['attributes'][_0x5056('0x22')]?_0x20776c[_0x5056('0x1f')]:_0x517bf3[_0x5056('0x1c')];if(!_0x4f8fa7[_0x5056('0x1e')][_0x5056('0x23')]('nolimit')){_0x20776c[_0x5056('0xc')]=qs[_0x5056('0xc')](_0x4f8fa7[_0x5056('0x1e')][_0x5056('0xc')]);_0x20776c['offset']=qs[_0x5056('0xa')](_0x4f8fa7['query'][_0x5056('0xa')]);}_0x20776c['order']=qs['sort'](_0x4f8fa7['query'][_0x5056('0x24')]);_0x20776c[_0x5056('0x25')]=qs['filters'](_[_0x5056('0x26')](_0x4f8fa7[_0x5056('0x1e')],_0x517bf3[_0x5056('0x27')]),_0x250276);if(_0x4f8fa7[_0x5056('0x1e')][_0x5056('0x28')]){_0x20776c[_0x5056('0x25')]=_[_0x5056('0x29')](_0x20776c[_0x5056('0x25')],{'$or':_[_0x5056('0x17')](_0x250276,function(_0x2f66d3){if(_0x2f66d3[_0x5056('0x1b')]!=='VIRTUAL'){var _0x59466a={};_0x59466a[_0x2f66d3[_0x5056('0x14')]]={'$like':'%'+_0x4f8fa7[_0x5056('0x1e')]['filter']+'%'};return _0x59466a;}})});}_0x20776c=_[_0x5056('0x29')]({},_0x20776c,_0x4f8fa7[_0x5056('0x2a')]);var _0x54cf9c={'where':_0x20776c[_0x5056('0x25')]};return db[_0x5056('0x18')][_0x5056('0xd')](_0x54cf9c)[_0x5056('0xf')](function(_0x33edfb){_0x14d60e[_0x5056('0xd')]=_0x33edfb;if(_0x4f8fa7[_0x5056('0x1e')][_0x5056('0x2b')]){_0x20776c[_0x5056('0x2c')]=[{'all':!![]}];}return db[_0x5056('0x18')][_0x5056('0x2d')](_0x20776c);})[_0x5056('0xf')](function(_0x442867){_0x14d60e[_0x5056('0x2e')]=_0x442867;return _0x14d60e;})[_0x5056('0xf')](respondWithFilteredResult(_0x5c1cec,_0x20776c))['catch'](handleError(_0x5c1cec,null));};exports[_0x5056('0x2f')]=function(_0x483d1e,_0xc49a60){var _0x46ffe1={'raw':![],'where':{'id':_0x483d1e[_0x5056('0x30')]['id']}},_0x432ff7={};_0x432ff7['model']=_[_0x5056('0x1d')](db[_0x5056('0x18')]['rawAttributes']);_0x432ff7[_0x5056('0x1e')]=_['keys'](_0x483d1e[_0x5056('0x1e')]);_0x432ff7[_0x5056('0x27')]=_[_0x5056('0x20')](_0x432ff7['model'],_0x432ff7[_0x5056('0x1e')]);_0x46ffe1[_0x5056('0x1f')]=_[_0x5056('0x20')](_0x432ff7[_0x5056('0x1c')],qs[_0x5056('0x21')](_0x483d1e[_0x5056('0x1e')][_0x5056('0x21')]));_0x46ffe1[_0x5056('0x1f')]=_0x46ffe1[_0x5056('0x1f')][_0x5056('0x22')]?_0x46ffe1[_0x5056('0x1f')]:_0x432ff7[_0x5056('0x1c')];if(_0x483d1e[_0x5056('0x1e')][_0x5056('0x2b')]){_0x46ffe1[_0x5056('0x2c')]=[{'all':!![]}];}_0x46ffe1=_[_0x5056('0x29')]({},_0x46ffe1,_0x483d1e['options']);return db['Dynamics365Account'][_0x5056('0x31')](_0x46ffe1)[_0x5056('0xf')](handleEntityNotFound(_0xc49a60,null))[_0x5056('0xf')](respondWithResult(_0xc49a60,null))[_0x5056('0x32')](handleError(_0xc49a60,null));};exports[_0x5056('0x33')]=function(_0x1e2693,_0x1c2de9){return db[_0x5056('0x18')]['create'](_0x1e2693['body'],{})[_0x5056('0xf')](respondWithResult(_0x1c2de9,0xc9))[_0x5056('0x32')](handleError(_0x1c2de9,null));};exports[_0x5056('0x34')]=function(_0x4b3494,_0x351517){if(_0x4b3494['body']['id']){delete _0x4b3494[_0x5056('0x35')]['id'];}return db[_0x5056('0x18')][_0x5056('0x31')]({'where':{'id':_0x4b3494[_0x5056('0x30')]['id']}})[_0x5056('0xf')](handleEntityNotFound(_0x351517,null))[_0x5056('0xf')](saveUpdates(_0x4b3494['body'],null))[_0x5056('0xf')](respondWithResult(_0x351517,null))[_0x5056('0x32')](handleError(_0x351517,null));};exports[_0x5056('0x10')]=function(_0x5e1677,_0x586206){return db['Dynamics365Account']['find']({'where':{'id':_0x5e1677[_0x5056('0x30')]['id']}})[_0x5056('0xf')](handleEntityNotFound(_0x586206,null))[_0x5056('0xf')](removeEntity(_0x586206,null))[_0x5056('0x32')](handleError(_0x586206,null));};exports[_0x5056('0x36')]=function(_0x5985e2,_0x4e057d){var _0x3a2336={};var _0x2ac9e8={};var _0x258fd9;var _0x452dd7;return db[_0x5056('0x18')][_0x5056('0x37')]({'where':{'id':_0x5985e2[_0x5056('0x30')]['id']}})['then'](handleEntityNotFound(_0x4e057d,null))['then'](function(_0x14e3f5){if(_0x14e3f5){_0x258fd9=_0x14e3f5;_0x2ac9e8[_0x5056('0x1c')]=_['keys'](db[_0x5056('0x38')][_0x5056('0x19')]);_0x2ac9e8['query']=_['keys'](_0x5985e2[_0x5056('0x1e')]);_0x2ac9e8[_0x5056('0x27')]=_['intersection'](_0x2ac9e8['model'],_0x2ac9e8[_0x5056('0x1e')]);_0x3a2336[_0x5056('0x1f')]=_['intersection'](_0x2ac9e8['model'],qs[_0x5056('0x21')](_0x5985e2[_0x5056('0x1e')][_0x5056('0x21')]));_0x3a2336[_0x5056('0x1f')]=_0x3a2336[_0x5056('0x1f')][_0x5056('0x22')]?_0x3a2336[_0x5056('0x1f')]:_0x2ac9e8[_0x5056('0x1c')];_0x3a2336[_0x5056('0x39')]=qs[_0x5056('0x24')](_0x5985e2[_0x5056('0x1e')][_0x5056('0x24')]);_0x3a2336[_0x5056('0x25')]=qs[_0x5056('0x27')](_[_0x5056('0x26')](_0x5985e2['query'],_0x2ac9e8['filters']));if(_0x5985e2[_0x5056('0x1e')][_0x5056('0x28')]){_0x3a2336[_0x5056('0x25')]=_[_0x5056('0x29')](_0x3a2336[_0x5056('0x25')],{'$or':_[_0x5056('0x17')](_0x3a2336['attributes'],function(_0x37a592){var _0x237c7e={};_0x237c7e[_0x37a592]={'$like':'%'+_0x5985e2[_0x5056('0x1e')][_0x5056('0x28')]+'%'};return _0x237c7e;})});}_0x3a2336=_[_0x5056('0x29')]({},_0x3a2336,_0x5985e2[_0x5056('0x2a')]);return _0x258fd9[_0x5056('0x36')](_0x3a2336);}})[_0x5056('0xf')](function(_0x3a0959){if(_0x3a0959){_0x452dd7=_0x3a0959[_0x5056('0x22')];if(!_0x5985e2[_0x5056('0x1e')][_0x5056('0x23')](_0x5056('0x3a'))){_0x3a2336['limit']=qs[_0x5056('0xc')](_0x5985e2[_0x5056('0x1e')][_0x5056('0xc')]);_0x3a2336['offset']=qs[_0x5056('0xa')](_0x5985e2[_0x5056('0x1e')][_0x5056('0xa')]);}return _0x258fd9[_0x5056('0x36')](_0x3a2336);}})['then'](function(_0x51a2e8){if(_0x51a2e8){return _0x51a2e8?{'count':_0x452dd7,'rows':_0x51a2e8}:null;}})['then'](respondWithResult(_0x4e057d,null))[_0x5056('0x32')](handleError(_0x4e057d,null));};exports['addConfiguration']=function(_0x1934e1,_0x33b74b){if(_0x1934e1[_0x5056('0x35')]['id']){delete _0x1934e1[_0x5056('0x35')]['id'];}return db[_0x5056('0x18')][_0x5056('0x37')]({'where':{'id':_0x1934e1['params']['id']}})['then'](handleEntityNotFound(_0x33b74b,null))[_0x5056('0xf')](function(_0x333d22){if(_0x333d22){_0x1934e1['body'][_0x5056('0x3b')]=_0x333d22['id'];_0x1934e1[_0x5056('0x35')][_0x5056('0x3c')]=integrations[_0x5056('0x3d')](_0x1934e1[_0x5056('0x35')]['channel'],_0x1934e1[_0x5056('0x35')][_0x5056('0x1b')]);_0x1934e1['body'][_0x5056('0x3e')]=integrations[_0x5056('0x3f')](_0x1934e1[_0x5056('0x35')][_0x5056('0x40')],_0x1934e1[_0x5056('0x35')][_0x5056('0x1b')]);return db[_0x5056('0x38')][_0x5056('0x33')](_0x1934e1[_0x5056('0x35')],{'include':[{'model':db[_0x5056('0x41')],'as':_0x5056('0x3c')},{'model':db[_0x5056('0x41')],'as':_0x5056('0x3e')}]});}return null;})['then'](respondWithResult(_0x33b74b,null))[_0x5056('0x32')](handleError(_0x33b74b,null));};function sanitizeRemoteUri(_0x1e5439){var _0x2b14c0=_0x1e5439[_0x5056('0x42')](-0x1);if(_0x2b14c0==='/')return _0x1e5439[_0x5056('0x43')](0x0,_0x1e5439[_0x5056('0x44')](_0x2b14c0));return _0x1e5439;}function getWebApiUrl(_0x5635a4){return util[_0x5056('0x45')]('%s/api/data/v9.0/',_0x5635a4);}exports[_0x5056('0x46')]=function(_0x277939,_0x5e8502){var _0x4c9e3c=_0x277939[_0x5056('0x1e')][_0x5056('0x47')];var _0x2cb5d5=_0x4c9e3c===_0x5056('0x48')?'Incident':'PhoneCall';var _0x25fe6f='';var _0x3e2b93='';var _0x16c0f5='';var _0x5dcc83='';var _0x3b24d1='';var _0x5b022f='';var _0x57cb62='';var _0x1bfae9='';var _0x2dd7fa=['title',_0x5056('0x49'),_0x5056('0x4a'),_0x5056('0x4b'),_0x5056('0x4c'),_0x5056('0x4d'),_0x5056('0x4e'),_0x5056('0x4f'),'directioncode',_0x5056('0x50')];var _0x17131c=[_0x5056('0x51'),'accountidyominame',_0x5056('0x52'),'billedserviceunits',_0x5056('0x53'),_0x5056('0x54'),_0x5056('0x55'),_0x5056('0x56'),'createdbyexternalpartyname',_0x5056('0x57'),_0x5056('0x58'),'createdbyyominame',_0x5056('0x59'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x5056('0x5a'),_0x5056('0x5b'),_0x5056('0x5c'),_0x5056('0x5d'),_0x5056('0x5e'),_0x5056('0x5f'),_0x5056('0x60'),_0x5056('0x61'),_0x5056('0x62'),_0x5056('0x63'),_0x5056('0x64'),_0x5056('0x65'),'influencescore',_0x5056('0x66'),'lastonholdtime',_0x5056('0x67'),_0x5056('0x68'),'modifiedbyexternalpartyyominame',_0x5056('0x69'),_0x5056('0x6a'),_0x5056('0x6b'),_0x5056('0x6c'),_0x5056('0x6d'),_0x5056('0x6e'),_0x5056('0x6f'),_0x5056('0x70'),'onholdtime',_0x5056('0x71'),_0x5056('0x72'),_0x5056('0x73'),_0x5056('0x74'),_0x5056('0x75'),'primarycontactidname',_0x5056('0x76'),'prioritycodename',_0x5056('0x77'),_0x5056('0x78'),_0x5056('0x79'),_0x5056('0x7a'),_0x5056('0x7b'),_0x5056('0x7c'),_0x5056('0x7d'),'sentimentvalue',_0x5056('0x7e'),_0x5056('0x7f'),_0x5056('0x80'),_0x5056('0x81'),_0x5056('0x82'),_0x5056('0x83'),_0x5056('0x84'),'timezoneruleversionnumber','transactioncurrencyidname','traversedpath',_0x5056('0x85'),'versionnumber'];var _0x217529=_0x2dd7fa[_0x5056('0x86')](_0x17131c);return db[_0x5056('0x18')]['findOne']({'where':{'id':_0x277939[_0x5056('0x30')]['id']},'attributes':['id','username',_0x5056('0x87'),_0x5056('0x88'),_0x5056('0x89'),'clientId',_0x5056('0x8a'),'modernAuthentication'],'include':[{'model':db['CloudProvider'],'as':_0x5056('0x8b'),'attributes':['id',_0x5056('0x8c'),'data7']}]})[_0x5056('0xf')](handleEntityNotFound(_0x5e8502,null))['then'](function(_0x130f05){if(_0x130f05){if(_0x130f05[_0x5056('0x8d')]){_0x130f05[_0x5056('0x8e')]=_0x130f05[_0x5056('0x8b')][_0x5056('0x8c')];_0x1bfae9=sanitizeRemoteUri(_0x130f05[_0x5056('0x8b')]['data7']);_0x57cb62=getWebApiUrl(_0x1bfae9);return _0x130f05;}_0x1bfae9=sanitizeRemoteUri(_0x130f05[_0x5056('0x88')]);_0x57cb62=getWebApiUrl(_0x1bfae9);var _0x1a7084={'method':_0x5056('0x8f'),'uri':_0x5056('0x90')+_0x130f05[_0x5056('0x89')]+_0x5056('0x91'),'form':{'client_id':_0x130f05['clientId'],'resource':_0x1bfae9,'username':_0x130f05[_0x5056('0x92')],'password':_0x130f05['password'],'grant_type':_0x5056('0x87'),'client_secret':_0x130f05[_0x5056('0x8a')]},'json':!![]};return rp(_0x1a7084);}})[_0x5056('0xf')](function(_0x2e9c5d){_0x5b022f=_0x2e9c5d[_0x5056('0x8e')];var _0x577d7f={'method':_0x5056('0x93'),'uri':encodeURI(_0x57cb62+_0x5056('0x94')+_0x2cb5d5+'\x27'),'headers':{'Authorization':_0x5056('0x95')+_0x5b022f,'If-None-Match':null,'OData-Version':_0x5056('0x96')},'json':!![]};return rp(_0x577d7f);})[_0x5056('0xf')](function(_0x76304){var _0x87010e=_0x76304[_0x5056('0x97')][0x0];var _0x1acb76=_0x87010e[_0x5056('0x98')];var _0xb068f6={'method':_0x5056('0x93'),'uri':_0x57cb62+_0x5056('0x99')+_0x1acb76+_0x5056('0x9a'),'headers':{'Authorization':_0x5056('0x95')+_0x5b022f,'If-None-Match':null,'OData-Version':_0x5056('0x96')},'json':!![]};return rp(_0xb068f6);})[_0x5056('0xf')](function(_0x3a7776){_0x25fe6f=_0x3a7776;_0x3e2b93=_0x25fe6f[_0x5056('0x9b')];_0x3e2b93=_[_0x5056('0x9c')](_0x3e2b93,function(_0x17e41e){return!_0x217529['includes'](_0x17e41e[_0x5056('0x9d')]);});var _0x5d7df8=[];var _0x2e0fb5=[];_0x3e2b93[_0x5056('0x9e')](function(_0x164122){if(_0x164122[_0x5056('0x9f')]){var _0x561fe5=_0x164122[_0x5056('0x9f')][_0x5056('0x43')](_0x164122[_0x5056('0x9f')][_0x5056('0x44')]('.')+0x1);if(_0x561fe5===_0x5056('0xa0')){_0x5d7df8['push'](getSelectList(_0x57cb62,_0x4c9e3c,_0x2e0fb5,_0x25fe6f[_0x5056('0x98')],_0x164122[_0x5056('0x98')],_0x5b022f));}}});return Promise[_0x5056('0xa1')](_0x5d7df8);})['then'](function(_0xbcbd64){_0x16c0f5=_0xbcbd64[0x0];var _0x3e3e56=[];var _0x41d42d=[];_0x3e2b93[_0x5056('0x9e')](function(_0x353892){if(!_[_0x5056('0xa2')](_0x353892[_0x5056('0x9f')])){var _0x21759d=_0x353892[_0x5056('0x9f')][_0x5056('0x43')](_0x353892[_0x5056('0x9f')][_0x5056('0x44')]('.')+0x1);if(_0x21759d===_0x5056('0xa3')){_0x3e3e56[_0x5056('0xa4')](getBooleanList(_0x57cb62,_0x4c9e3c,_0x41d42d,_0x25fe6f[_0x5056('0x98')],_0x353892[_0x5056('0x98')],_0x5b022f));}}});return Promise['all'](_0x3e3e56);})['then'](function(_0x46462e){_0x5dcc83=_0x46462e[0x0];var _0x401090=[];var _0x1d8adb=[];_0x3e2b93[_0x5056('0x9e')](function(_0x2d635d){if(_0x2d635d[_0x5056('0x9f')]){var _0x13b30d=_0x2d635d[_0x5056('0x9f')][_0x5056('0x43')](_0x2d635d['@odata.type'][_0x5056('0x44')]('.')+0x1);if(_0x13b30d===_0x5056('0xa5')||_0x13b30d==='DoubleAttributeMetadata'||_0x13b30d===_0x5056('0xa6')||_0x13b30d==='IntegerAttributeMetadata'||_0x13b30d===_0x5056('0xa7')||_0x13b30d===_0x5056('0xa8')||_0x13b30d===_0x5056('0xa9')||_0x13b30d==='EntityNameAttributeMetadata'||_0x13b30d===_0x5056('0xaa')||_0x13b30d===_0x5056('0xab')){_0x401090[_0x5056('0xa4')](getInputList(_0x57cb62,_0x4c9e3c,_0x13b30d,_0x1d8adb,_0x25fe6f[_0x5056('0x98')],_0x2d635d[_0x5056('0x98')],_0x5b022f));}}});return Promise[_0x5056('0xa1')](_0x401090);})[_0x5056('0xf')](function(_0x3c362b){_0x3b24d1=_0x3c362b[0x0];var _0x1c375d=_0x16c0f5[_0x5056('0x86')](_0x5dcc83)[_0x5056('0x86')](_0x3b24d1);var _0x357dfe={'count':_0x1c375d['length'],'rows':_0x1c375d};return _0x357dfe;})[_0x5056('0xf')](respondWithResult(_0x5e8502,null))['catch'](function(_0xccf373){var _0x54ad60=_0x277939[_0x5056('0x1e')]['test']?0x1f4:_0xccf373[_0x5056('0xac')]||0x1f4;logger[_0x5056('0x12')](_0xccf373[_0x5056('0x13')]);delete _0xccf373['name'];if(_0x54ad60===0x191){_0x54ad60=0x190;}_0x5e8502['status'](_0x54ad60)[_0x5056('0x15')](_0x277939[_0x5056('0x1e')][_0x5056('0xad')]?{'message':_0x5056('0xae'),'statusCode':_0xccf373[_0x5056('0xac')]}:_0xccf373);});};function getSelectList(_0x21e51c,_0xa4bab0,_0x47a309,_0x4decd7,_0x16ab8c,_0x128546){var _0x2c02ca={'method':_0x5056('0x93'),'uri':_0x21e51c+_0x5056('0x99')+_0x4decd7+')/Attributes('+_0x16ab8c+_0x5056('0xaf')+_0x5056('0xb0'),'headers':{'Authorization':'Bearer\x20'+_0x128546,'If-None-Match':null,'OData-Version':_0x5056('0x96')},'json':!![]};return rp(_0x2c02ca)[_0x5056('0xf')](function(_0x1f93cd){var _0x35298d=[];var _0x1385b9=_0x1f93cd[_0x5056('0xb1')][_0x5056('0xb2')];_0x1385b9[_0x5056('0x9e')](function(_0x52ddd0){_0x35298d[_0x5056('0xa4')]({'name':_0x52ddd0['Label'][_0x5056('0xb3')][_0x5056('0xb4')],'value':String(_0x52ddd0[_0x5056('0xb5')])});});var _0xa55e38={'id':_0xa4bab0+'_'+_0x1f93cd['LogicalName'],'name':_0x1f93cd[_0x5056('0xb6')][_0x5056('0xb3')][_0x5056('0xb4')],'custom':![],'options':_0x35298d};_0x47a309[_0x5056('0xa4')](_0xa55e38);return _0x47a309;});}function getBooleanList(_0x3ed4e1,_0x343005,_0x2e065e,_0x170334,_0x58d059,_0x218a2b){var _0x4b36c2={'method':_0x5056('0x93'),'uri':_0x3ed4e1+'EntityDefinitions('+_0x170334+')/Attributes('+_0x58d059+_0x5056('0xb7'),'headers':{'Authorization':_0x5056('0x95')+_0x218a2b,'If-None-Match':null,'OData-Version':_0x5056('0x96')},'json':!![]};return rp(_0x4b36c2)[_0x5056('0xf')](function(_0x2b9c7c){var _0x5f091d=[];_0x5f091d[_0x5056('0xa4')]({'name':_0x2b9c7c[_0x5056('0xb1')][_0x5056('0xb8')][_0x5056('0xb4')]['UserLocalizedLabel'][_0x5056('0xb4')],'value':_0x5056('0xb9')},{'name':_0x2b9c7c['OptionSet'][_0x5056('0xba')]['Label'][_0x5056('0xb3')][_0x5056('0xb4')],'value':_0x5056('0xbb')});var _0x3ff9ff={'id':_0x343005+'_'+_0x2b9c7c[_0x5056('0x9d')],'name':_0x2b9c7c['DisplayName'][_0x5056('0xb3')][_0x5056('0xb4')],'custom':![],'options':_0x5f091d};_0x2e065e[_0x5056('0xa4')](_0x3ff9ff);return _0x2e065e;});}function getInputList(_0x753b09,_0x13a2e9,_0x19d99a,_0x1d1d9f,_0x46400b,_0x14c153,_0x431fda){var _0x229c12={'method':_0x5056('0x93'),'uri':_0x753b09+_0x5056('0x99')+_0x46400b+_0x5056('0xbc')+_0x14c153+_0x5056('0xbd')+_0x19d99a+_0x5056('0xbe'),'headers':{'Authorization':_0x5056('0x95')+_0x431fda,'If-None-Match':null,'OData-Version':_0x5056('0x96')},'json':!![]};return rp(_0x229c12)['then'](function(_0x32bca1){var _0x5dd6ad={'id':_0x13a2e9+'_'+_0x32bca1[_0x5056('0x9d')],'name':_0x32bca1[_0x5056('0xb6')][_0x5056('0xb3')]?_0x32bca1[_0x5056('0xb6')]['UserLocalizedLabel'][_0x5056('0xb4')]:_0x32bca1[_0x5056('0x9d')],'custom':![],'options':[]};_0x1d1d9f[_0x5056('0xa4')](_0x5dd6ad);return _0x1d1d9f;});} \ No newline at end of file +var _0x33e5=['format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','/oauth2/token','GET','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','LogicalName','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','forEach','isNil','BooleanAttributeMetadata','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Label','UserLocalizedLabel','Value','TrueOption','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','undefined','count','offset','limit','set','then','destroy','name','send','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','length','getConfigurations','nolimit','addConfiguration','AccountId','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','Subjects','Descriptions','slice'];(function(_0x3133a8,_0x392023){var _0x5b9875=function(_0x8f8bc3){while(--_0x8f8bc3){_0x3133a8['push'](_0x3133a8['shift']());}};_0x5b9875(++_0x392023);}(_0x33e5,0x13a));var _0x533e=function(_0x43b811,_0x241e46){_0x43b811=_0x43b811-0x0;var _0x4dea05=_0x33e5[_0x43b811];return _0x4dea05;};'use strict';var rp=require(_0x533e('0x0'));var util=require(_0x533e('0x1'));var _=require(_0x533e('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x533e('0x3'))('api');var db=require(_0x533e('0x4'))['db'];var integrations=require(_0x533e('0x5'));function respondWithResult(_0x410daf,_0x4b7fa7){_0x4b7fa7=_0x4b7fa7||0xc8;return function(_0x49957c){if(_0x49957c){return _0x410daf[_0x533e('0x6')](_0x4b7fa7)[_0x533e('0x7')](_0x49957c);}};}function respondWithFilteredResult(_0x275007,_0x2e951a){return function(_0x42189d){if(_0x42189d){var _0x197328=typeof _0x2e951a['offset']===_0x533e('0x8')&&typeof _0x2e951a['limit']===_0x533e('0x8');var _0x366e66=_0x42189d[_0x533e('0x9')];var _0x550643=_0x197328?0x0:_0x2e951a[_0x533e('0xa')];var _0x1c0741=_0x197328?_0x42189d['count']:_0x2e951a[_0x533e('0xa')]+_0x2e951a[_0x533e('0xb')];var _0x2772da;if(_0x1c0741>=_0x366e66){_0x1c0741=_0x366e66;_0x2772da=0xc8;}else{_0x2772da=0xce;}_0x275007[_0x533e('0x6')](_0x2772da);return _0x275007[_0x533e('0xc')]('Content-Range',_0x550643+'-'+_0x1c0741+'/'+_0x366e66)['json'](_0x42189d);}return null;};}function saveUpdates(_0x99059f){return function(_0x4df159){if(_0x4df159){return _0x4df159['update'](_0x99059f)[_0x533e('0xd')](function(_0x214c14){return _0x214c14;});}return null;};}function removeEntity(_0x4b3c33){return function(_0x992919){if(_0x992919){return _0x992919[_0x533e('0xe')]()[_0x533e('0xd')](function(){_0x4b3c33[_0x533e('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ef500){return function(_0x12d0bf){if(!_0x12d0bf){_0x5ef500['sendStatus'](0x194);}return _0x12d0bf;};}function handleError(_0x2821a4,_0x5d4d5f){_0x5d4d5f=_0x5d4d5f||0x1f4;return function(_0x1fb599){logger['error'](_0x1fb599['stack']);if(_0x1fb599[_0x533e('0xf')]){delete _0x1fb599[_0x533e('0xf')];}_0x2821a4['status'](_0x5d4d5f)[_0x533e('0x10')](_0x1fb599);};}exports['index']=function(_0x3aa865,_0x12197b){var _0x58342a={},_0x3e0a63={},_0x5f31ef={'count':0x0,'rows':[]};var _0x2ec937=_['map'](db[_0x533e('0x11')][_0x533e('0x12')],function(_0x4bbef8){return{'name':_0x4bbef8[_0x533e('0x13')],'type':_0x4bbef8[_0x533e('0x14')][_0x533e('0x15')]};});_0x3e0a63[_0x533e('0x16')]=_[_0x533e('0x17')](_0x2ec937,_0x533e('0xf'));_0x3e0a63[_0x533e('0x18')]=_['keys'](_0x3aa865[_0x533e('0x18')]);_0x3e0a63[_0x533e('0x19')]=_['intersection'](_0x3e0a63[_0x533e('0x16')],_0x3e0a63[_0x533e('0x18')]);_0x58342a[_0x533e('0x1a')]=_[_0x533e('0x1b')](_0x3e0a63[_0x533e('0x16')],qs['fields'](_0x3aa865['query'][_0x533e('0x1c')]));_0x58342a[_0x533e('0x1a')]=_0x58342a[_0x533e('0x1a')]['length']?_0x58342a[_0x533e('0x1a')]:_0x3e0a63['model'];if(!_0x3aa865['query'][_0x533e('0x1d')]('nolimit')){_0x58342a[_0x533e('0xb')]=qs[_0x533e('0xb')](_0x3aa865['query'][_0x533e('0xb')]);_0x58342a[_0x533e('0xa')]=qs[_0x533e('0xa')](_0x3aa865['query']['offset']);}_0x58342a[_0x533e('0x1e')]=qs[_0x533e('0x1f')](_0x3aa865['query'][_0x533e('0x1f')]);_0x58342a[_0x533e('0x20')]=qs[_0x533e('0x19')](_[_0x533e('0x21')](_0x3aa865[_0x533e('0x18')],_0x3e0a63[_0x533e('0x19')]),_0x2ec937);if(_0x3aa865['query'][_0x533e('0x22')]){_0x58342a['where']=_[_0x533e('0x23')](_0x58342a[_0x533e('0x20')],{'$or':_['map'](_0x2ec937,function(_0x581692){if(_0x581692[_0x533e('0x14')]!==_0x533e('0x24')){var _0x4fec81={};_0x4fec81[_0x581692[_0x533e('0xf')]]={'$like':'%'+_0x3aa865[_0x533e('0x18')][_0x533e('0x22')]+'%'};return _0x4fec81;}})});}_0x58342a=_['merge']({},_0x58342a,_0x3aa865[_0x533e('0x25')]);var _0x1a37c8={'where':_0x58342a[_0x533e('0x20')]};return db[_0x533e('0x11')][_0x533e('0x9')](_0x1a37c8)['then'](function(_0x12e4d6){_0x5f31ef['count']=_0x12e4d6;if(_0x3aa865['query'][_0x533e('0x26')]){_0x58342a[_0x533e('0x27')]=[{'all':!![]}];}return db[_0x533e('0x11')][_0x533e('0x28')](_0x58342a);})[_0x533e('0xd')](function(_0x5969ee){_0x5f31ef[_0x533e('0x29')]=_0x5969ee;return _0x5f31ef;})[_0x533e('0xd')](respondWithFilteredResult(_0x12197b,_0x58342a))[_0x533e('0x2a')](handleError(_0x12197b,null));};exports[_0x533e('0x2b')]=function(_0x31754f,_0x291c39){var _0x3d87a6={'raw':![],'where':{'id':_0x31754f[_0x533e('0x2c')]['id']}},_0x506aad={};_0x506aad[_0x533e('0x16')]=_[_0x533e('0x2d')](db['Dynamics365Account']['rawAttributes']);_0x506aad[_0x533e('0x18')]=_['keys'](_0x31754f['query']);_0x506aad[_0x533e('0x19')]=_[_0x533e('0x1b')](_0x506aad[_0x533e('0x16')],_0x506aad['query']);_0x3d87a6[_0x533e('0x1a')]=_[_0x533e('0x1b')](_0x506aad[_0x533e('0x16')],qs[_0x533e('0x1c')](_0x31754f[_0x533e('0x18')]['fields']));_0x3d87a6[_0x533e('0x1a')]=_0x3d87a6[_0x533e('0x1a')]['length']?_0x3d87a6[_0x533e('0x1a')]:_0x506aad[_0x533e('0x16')];if(_0x31754f[_0x533e('0x18')][_0x533e('0x26')]){_0x3d87a6[_0x533e('0x27')]=[{'all':!![]}];}_0x3d87a6=_[_0x533e('0x23')]({},_0x3d87a6,_0x31754f['options']);return db[_0x533e('0x11')][_0x533e('0x2e')](_0x3d87a6)[_0x533e('0xd')](handleEntityNotFound(_0x291c39,null))[_0x533e('0xd')](respondWithResult(_0x291c39,null))[_0x533e('0x2a')](handleError(_0x291c39,null));};exports[_0x533e('0x2f')]=function(_0x401954,_0x2d5674){return db[_0x533e('0x11')][_0x533e('0x2f')](_0x401954[_0x533e('0x30')],{})[_0x533e('0xd')](respondWithResult(_0x2d5674,0xc9))[_0x533e('0x2a')](handleError(_0x2d5674,null));};exports['update']=function(_0x1fdb46,_0x3ecaa6){if(_0x1fdb46[_0x533e('0x30')]['id']){delete _0x1fdb46['body']['id'];}return db[_0x533e('0x11')][_0x533e('0x2e')]({'where':{'id':_0x1fdb46[_0x533e('0x2c')]['id']}})[_0x533e('0xd')](handleEntityNotFound(_0x3ecaa6,null))[_0x533e('0xd')](saveUpdates(_0x1fdb46[_0x533e('0x30')],null))[_0x533e('0xd')](respondWithResult(_0x3ecaa6,null))[_0x533e('0x2a')](handleError(_0x3ecaa6,null));};exports[_0x533e('0xe')]=function(_0x39385d,_0x685c30){return db[_0x533e('0x11')][_0x533e('0x2e')]({'where':{'id':_0x39385d[_0x533e('0x2c')]['id']}})[_0x533e('0xd')](handleEntityNotFound(_0x685c30,null))['then'](removeEntity(_0x685c30,null))[_0x533e('0x2a')](handleError(_0x685c30,null));};exports['getConfigurations']=function(_0x7670aa,_0x219e20){var _0x309498={};var _0x13a6c6={};var _0x152c1a;var _0x8f93c1;return db['Dynamics365Account'][_0x533e('0x31')]({'where':{'id':_0x7670aa[_0x533e('0x2c')]['id']}})[_0x533e('0xd')](handleEntityNotFound(_0x219e20,null))[_0x533e('0xd')](function(_0x57de6f){if(_0x57de6f){_0x152c1a=_0x57de6f;_0x13a6c6['model']=_[_0x533e('0x2d')](db['Dynamics365Configuration'][_0x533e('0x12')]);_0x13a6c6[_0x533e('0x18')]=_['keys'](_0x7670aa[_0x533e('0x18')]);_0x13a6c6['filters']=_['intersection'](_0x13a6c6[_0x533e('0x16')],_0x13a6c6['query']);_0x309498[_0x533e('0x1a')]=_[_0x533e('0x1b')](_0x13a6c6[_0x533e('0x16')],qs['fields'](_0x7670aa[_0x533e('0x18')][_0x533e('0x1c')]));_0x309498['attributes']=_0x309498[_0x533e('0x1a')][_0x533e('0x32')]?_0x309498[_0x533e('0x1a')]:_0x13a6c6[_0x533e('0x16')];_0x309498[_0x533e('0x1e')]=qs[_0x533e('0x1f')](_0x7670aa[_0x533e('0x18')][_0x533e('0x1f')]);_0x309498[_0x533e('0x20')]=qs[_0x533e('0x19')](_[_0x533e('0x21')](_0x7670aa[_0x533e('0x18')],_0x13a6c6[_0x533e('0x19')]));if(_0x7670aa['query'][_0x533e('0x22')]){_0x309498['where']=_['merge'](_0x309498['where'],{'$or':_['map'](_0x309498[_0x533e('0x1a')],function(_0x30ca17){var _0x4e0448={};_0x4e0448[_0x30ca17]={'$like':'%'+_0x7670aa[_0x533e('0x18')]['filter']+'%'};return _0x4e0448;})});}_0x309498=_[_0x533e('0x23')]({},_0x309498,_0x7670aa[_0x533e('0x25')]);return _0x152c1a[_0x533e('0x33')](_0x309498);}})[_0x533e('0xd')](function(_0x36fe45){if(_0x36fe45){_0x8f93c1=_0x36fe45['length'];if(!_0x7670aa[_0x533e('0x18')][_0x533e('0x1d')](_0x533e('0x34'))){_0x309498[_0x533e('0xb')]=qs[_0x533e('0xb')](_0x7670aa[_0x533e('0x18')][_0x533e('0xb')]);_0x309498[_0x533e('0xa')]=qs[_0x533e('0xa')](_0x7670aa[_0x533e('0x18')][_0x533e('0xa')]);}return _0x152c1a[_0x533e('0x33')](_0x309498);}})[_0x533e('0xd')](function(_0x3cd9cc){if(_0x3cd9cc){return _0x3cd9cc?{'count':_0x8f93c1,'rows':_0x3cd9cc}:null;}})[_0x533e('0xd')](respondWithResult(_0x219e20,null))['catch'](handleError(_0x219e20,null));};exports[_0x533e('0x35')]=function(_0xca024e,_0x3e976a){if(_0xca024e[_0x533e('0x30')]['id']){delete _0xca024e[_0x533e('0x30')]['id'];}return db[_0x533e('0x11')][_0x533e('0x31')]({'where':{'id':_0xca024e['params']['id']}})[_0x533e('0xd')](handleEntityNotFound(_0x3e976a,null))[_0x533e('0xd')](function(_0xb5fb62){if(_0xb5fb62){_0xca024e['body'][_0x533e('0x36')]=_0xb5fb62['id'];_0xca024e[_0x533e('0x30')]['Subjects']=integrations['getSubjects'](_0xca024e[_0x533e('0x30')][_0x533e('0x37')],_0xca024e[_0x533e('0x30')]['type']);_0xca024e[_0x533e('0x30')]['Descriptions']=integrations[_0x533e('0x38')](_0xca024e[_0x533e('0x30')][_0x533e('0x37')],_0xca024e[_0x533e('0x30')]['type']);return db[_0x533e('0x39')][_0x533e('0x2f')](_0xca024e[_0x533e('0x30')],{'include':[{'model':db[_0x533e('0x3a')],'as':_0x533e('0x3b')},{'model':db[_0x533e('0x3a')],'as':_0x533e('0x3c')}]});}return null;})[_0x533e('0xd')](respondWithResult(_0x3e976a,null))[_0x533e('0x2a')](handleError(_0x3e976a,null));};function sanitizeRemoteUri(_0xe4b81b){var _0x4f8f6c=_0xe4b81b[_0x533e('0x3d')](-0x1);if(_0x4f8f6c==='/')return _0xe4b81b['substring'](0x0,_0xe4b81b['lastIndexOf'](_0x4f8f6c));return _0xe4b81b;}function getWebApiUrl(_0x3cc8a2){return util[_0x533e('0x3e')](_0x533e('0x3f'),_0x3cc8a2);}exports[_0x533e('0x40')]=function(_0x4df548,_0x48d60d){var _0x7f1bd9=_0x4df548[_0x533e('0x18')][_0x533e('0x41')];var _0x26bab5=_0x7f1bd9===_0x533e('0x42')?_0x533e('0x43'):_0x533e('0x44');var _0x567eee='';var _0x417eef='';var _0x149378='';var _0x17f4ab='';var _0xd48f11='';var _0x554da1='';var _0x21eaa4='';var _0x40d8d0='';var _0x1fe74b=['title',_0x533e('0x45'),_0x533e('0x46'),_0x533e('0x47'),_0x533e('0x48'),_0x533e('0x49'),_0x533e('0x4a'),_0x533e('0x4b'),_0x533e('0x4c'),_0x533e('0x4d')];var _0x16d655=[_0x533e('0x4e'),_0x533e('0x4f'),_0x533e('0x50'),_0x533e('0x51'),_0x533e('0x52'),'contactidyominame','contractdetailidname',_0x533e('0x53'),_0x533e('0x54'),_0x533e('0x55'),_0x533e('0x56'),'createdbyyominame',_0x533e('0x57'),_0x533e('0x58'),'createdonbehalfbyyominame',_0x533e('0x59'),_0x533e('0x5a'),_0x533e('0x5b'),_0x533e('0x5c'),_0x533e('0x5d'),_0x533e('0x5e'),_0x533e('0x5f'),_0x533e('0x60'),'exchangerate','firstresponsebykpiidname','followupby',_0x533e('0x61'),_0x533e('0x62'),_0x533e('0x63'),_0x533e('0x64'),_0x533e('0x65'),_0x533e('0x66'),_0x533e('0x67'),'modifiedbyname',_0x533e('0x68'),'modifiedon',_0x533e('0x69'),_0x533e('0x6a'),_0x533e('0x6b'),_0x533e('0x6c'),'numberofchildincidents',_0x533e('0x6d'),_0x533e('0x6e'),'owneridname','owneridtype',_0x533e('0x6f'),_0x533e('0x70'),_0x533e('0x71'),_0x533e('0x72'),'prioritycodename',_0x533e('0x73'),_0x533e('0x74'),_0x533e('0x75'),'resolvebykpiidname','responseby',_0x533e('0x76'),_0x533e('0x77'),'sentimentvalue',_0x533e('0x78'),_0x533e('0x79'),_0x533e('0x7a'),_0x533e('0x7b'),'statuscode',_0x533e('0x7c'),_0x533e('0x7d'),_0x533e('0x7e'),_0x533e('0x7f'),_0x533e('0x80'),_0x533e('0x81'),_0x533e('0x82')];var _0x25f047=_0x1fe74b[_0x533e('0x83')](_0x16d655);return db[_0x533e('0x11')][_0x533e('0x31')]({'where':{'id':_0x4df548['params']['id']},'attributes':['id',_0x533e('0x84'),_0x533e('0x85'),_0x533e('0x86'),_0x533e('0x87'),_0x533e('0x88'),_0x533e('0x89'),_0x533e('0x8a')],'include':[{'model':db[_0x533e('0x8b')],'as':_0x533e('0x8b'),'attributes':['id',_0x533e('0x8c'),_0x533e('0x8d')]}]})['then'](handleEntityNotFound(_0x48d60d,null))[_0x533e('0xd')](function(_0x29332e){if(_0x29332e){if(_0x29332e[_0x533e('0x8a')]){_0x29332e[_0x533e('0x8e')]=_0x29332e[_0x533e('0x8b')][_0x533e('0x8c')];_0x40d8d0=sanitizeRemoteUri(_0x29332e[_0x533e('0x8b')][_0x533e('0x8d')]);_0x21eaa4=getWebApiUrl(_0x40d8d0);return _0x29332e;}_0x40d8d0=sanitizeRemoteUri(_0x29332e[_0x533e('0x86')]);_0x21eaa4=getWebApiUrl(_0x40d8d0);var _0x5e2b69={'method':_0x533e('0x8f'),'uri':'https://login.microsoftonline.com/'+_0x29332e[_0x533e('0x87')]+_0x533e('0x90'),'form':{'client_id':_0x29332e[_0x533e('0x88')],'resource':_0x40d8d0,'username':_0x29332e[_0x533e('0x84')],'password':_0x29332e[_0x533e('0x85')],'grant_type':'password','client_secret':_0x29332e[_0x533e('0x89')]},'json':!![]};return rp(_0x5e2b69);}})['then'](function(_0x3ad3f5){_0x554da1=_0x3ad3f5['access_token'];var _0x4b9bc2={'method':_0x533e('0x91'),'uri':encodeURI(_0x21eaa4+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x26bab5+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x554da1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b9bc2);})[_0x533e('0xd')](function(_0x570731){var _0x7d1251=_0x570731[_0x533e('0x92')][0x0];var _0x3b5016=_0x7d1251[_0x533e('0x93')];var _0x3f9be0={'method':'GET','uri':_0x21eaa4+_0x533e('0x94')+_0x3b5016+_0x533e('0x95'),'headers':{'Authorization':_0x533e('0x96')+_0x554da1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3f9be0);})['then'](function(_0xc706c3){_0x567eee=_0xc706c3;_0x417eef=_0x567eee['Attributes'];_0x417eef=_['remove'](_0x417eef,function(_0x5da11b){return!_0x25f047['includes'](_0x5da11b[_0x533e('0x97')]);});var _0x3b3c66=[];var _0x33f651=[];_0x417eef['forEach'](function(_0x433c56){if(_0x433c56[_0x533e('0x98')]){var _0x2fad2e=_0x433c56[_0x533e('0x98')][_0x533e('0x99')](_0x433c56['@odata.type'][_0x533e('0x9a')]('.')+0x1);if(_0x2fad2e===_0x533e('0x9b')){_0x3b3c66['push'](getSelectList(_0x21eaa4,_0x7f1bd9,_0x33f651,_0x567eee[_0x533e('0x93')],_0x433c56[_0x533e('0x93')],_0x554da1));}}});return Promise['all'](_0x3b3c66);})['then'](function(_0x33788e){_0x149378=_0x33788e[0x0];var _0x3440c3=[];var _0x1ee525=[];_0x417eef[_0x533e('0x9c')](function(_0x1ae228){if(!_[_0x533e('0x9d')](_0x1ae228['@odata.type'])){var _0x18c4e6=_0x1ae228[_0x533e('0x98')][_0x533e('0x99')](_0x1ae228[_0x533e('0x98')]['lastIndexOf']('.')+0x1);if(_0x18c4e6===_0x533e('0x9e')){_0x3440c3[_0x533e('0x9f')](getBooleanList(_0x21eaa4,_0x7f1bd9,_0x1ee525,_0x567eee[_0x533e('0x93')],_0x1ae228['MetadataId'],_0x554da1));}}});return Promise[_0x533e('0xa0')](_0x3440c3);})['then'](function(_0x1e0196){_0x17f4ab=_0x1e0196[0x0];var _0x14b5c9=[];var _0x1a8751=[];_0x417eef['forEach'](function(_0x1bca2c){if(_0x1bca2c[_0x533e('0x98')]){var _0x5068af=_0x1bca2c[_0x533e('0x98')][_0x533e('0x99')](_0x1bca2c[_0x533e('0x98')][_0x533e('0x9a')]('.')+0x1);if(_0x5068af==='StringAttributeMetadata'||_0x5068af===_0x533e('0xa1')||_0x5068af===_0x533e('0xa2')||_0x5068af===_0x533e('0xa3')||_0x5068af==='MemoAttributeMetadata'||_0x5068af===_0x533e('0xa4')||_0x5068af===_0x533e('0xa5')||_0x5068af===_0x533e('0xa6')||_0x5068af===_0x533e('0xa7')||_0x5068af===_0x533e('0xa8')){_0x14b5c9[_0x533e('0x9f')](getInputList(_0x21eaa4,_0x7f1bd9,_0x5068af,_0x1a8751,_0x567eee['MetadataId'],_0x1bca2c[_0x533e('0x93')],_0x554da1));}}});return Promise['all'](_0x14b5c9);})['then'](function(_0x51ed11){_0xd48f11=_0x51ed11[0x0];var _0x3b1494=_0x149378[_0x533e('0x83')](_0x17f4ab)[_0x533e('0x83')](_0xd48f11);var _0x4f623d={'count':_0x3b1494[_0x533e('0x32')],'rows':_0x3b1494};return _0x4f623d;})[_0x533e('0xd')](respondWithResult(_0x48d60d,null))[_0x533e('0x2a')](function(_0x5de6a5){var _0x14cf7f=_0x4df548['query'][_0x533e('0xa9')]?0x1f4:_0x5de6a5[_0x533e('0xaa')]||0x1f4;logger[_0x533e('0xab')](_0x5de6a5[_0x533e('0xac')]);delete _0x5de6a5[_0x533e('0xf')];if(_0x14cf7f===0x191){_0x14cf7f=0x190;}_0x48d60d[_0x533e('0x6')](_0x14cf7f)[_0x533e('0x10')](_0x4df548[_0x533e('0x18')]['test']?{'message':_0x533e('0xad'),'statusCode':_0x5de6a5[_0x533e('0xaa')]}:_0x5de6a5);});};function getSelectList(_0x2d70a2,_0x5cf77d,_0x4f606e,_0x85be33,_0x74ae16,_0x5eae91){var _0x2052a7={'method':_0x533e('0x91'),'uri':_0x2d70a2+'EntityDefinitions('+_0x85be33+_0x533e('0xae')+_0x74ae16+_0x533e('0xaf')+_0x533e('0xb0'),'headers':{'Authorization':_0x533e('0x96')+_0x5eae91,'If-None-Match':null,'OData-Version':_0x533e('0xb1')},'json':!![]};return rp(_0x2052a7)['then'](function(_0x19378a){var _0x3740ea=[];var _0x46fe64=_0x19378a[_0x533e('0xb2')]['Options'];_0x46fe64[_0x533e('0x9c')](function(_0x431527){_0x3740ea[_0x533e('0x9f')]({'name':_0x431527[_0x533e('0xb3')][_0x533e('0xb4')][_0x533e('0xb3')],'value':String(_0x431527[_0x533e('0xb5')])});});var _0x188ec3={'id':_0x5cf77d+'_'+_0x19378a['LogicalName'],'name':_0x19378a['DisplayName']['UserLocalizedLabel'][_0x533e('0xb3')],'custom':![],'options':_0x3740ea};_0x4f606e[_0x533e('0x9f')](_0x188ec3);return _0x4f606e;});}function getBooleanList(_0x115ad1,_0x891d88,_0x277ff5,_0x47c3bd,_0xd09828,_0x5b1f4f){var _0x1fd8e8={'method':'GET','uri':_0x115ad1+_0x533e('0x94')+_0x47c3bd+')/Attributes('+_0xd09828+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x533e('0x96')+_0x5b1f4f,'If-None-Match':null,'OData-Version':_0x533e('0xb1')},'json':!![]};return rp(_0x1fd8e8)['then'](function(_0x1d9832){var _0x3eb348=[];_0x3eb348[_0x533e('0x9f')]({'name':_0x1d9832['OptionSet'][_0x533e('0xb6')][_0x533e('0xb3')][_0x533e('0xb4')]['Label'],'value':'true'},{'name':_0x1d9832[_0x533e('0xb2')][_0x533e('0xb7')]['Label'][_0x533e('0xb4')][_0x533e('0xb3')],'value':_0x533e('0xb8')});var _0x956dfe={'id':_0x891d88+'_'+_0x1d9832[_0x533e('0x97')],'name':_0x1d9832[_0x533e('0xb9')][_0x533e('0xb4')][_0x533e('0xb3')],'custom':![],'options':_0x3eb348};_0x277ff5[_0x533e('0x9f')](_0x956dfe);return _0x277ff5;});}function getInputList(_0x59ccb4,_0x168d84,_0x3adffd,_0x33ad68,_0x117539,_0x5cc489,_0x265e7c){var _0x5386db={'method':_0x533e('0x91'),'uri':_0x59ccb4+'EntityDefinitions('+_0x117539+')/Attributes('+_0x5cc489+_0x533e('0xba')+_0x3adffd+_0x533e('0xbb'),'headers':{'Authorization':_0x533e('0x96')+_0x265e7c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5386db)[_0x533e('0xd')](function(_0x21f744){var _0x1ad38f={'id':_0x168d84+'_'+_0x21f744['LogicalName'],'name':_0x21f744[_0x533e('0xb9')]['UserLocalizedLabel']?_0x21f744[_0x533e('0xb9')]['UserLocalizedLabel'][_0x533e('0xb3')]:_0x21f744[_0x533e('0x97')],'custom':![],'options':[]};_0x33ad68[_0x533e('0x9f')](_0x1ad38f);return _0x33ad68;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 31dba29..e74416c 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x720850,_0x1cb7cc){var _0x224ffe=function(_0x13937a){while(--_0x13937a){_0x720850['push'](_0x720850['shift']());}};_0x224ffe(++_0x1cb7cc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x2ee00c,_0x35b4a0){var _0x4a91b6=function(_0x1d6efe){while(--_0x1d6efe){_0x2ee00c['push'](_0x2ee00c['shift']());}};_0x4a91b6(++_0x35b4a0);}(_0xe706,0xa3));var _0x6e70=function(_0x367bad,_0x1eea19){_0x367bad=_0x367bad-0x0;var _0x3a99d3=_0xe706[_0x367bad];return _0x3a99d3;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 99bb2c4..96c4b9f 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 _0x3a85=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','Dynamics365Account','findAll','options','where','limit','include','map','attributes','model','GetDynamics365Account','stringify','catch','ShowDynamics365Account','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0x45c5f1,_0x4cabbb){var _0xaf8c7b=function(_0x4aea43){while(--_0x4aea43){_0x45c5f1['push'](_0x45c5f1['shift']());}};_0xaf8c7b(++_0x4cabbb);}(_0x3a85,0x1ce));var _0x53a8=function(_0x49a572,_0x44119a){_0x49a572=_0x49a572-0x0;var _0x4e82ae=_0x3a85[_0x49a572];return _0x4e82ae;};'use strict';var _=require(_0x53a8('0x0'));var util=require('util');var moment=require(_0x53a8('0x1'));var BPromise=require('bluebird');var rs=require(_0x53a8('0x2'));var fs=require('fs');var Redis=require(_0x53a8('0x3'));var db=require(_0x53a8('0x4'))['db'];var utils=require(_0x53a8('0x5'));var logger=require(_0x53a8('0x6'))('rpc');var config=require(_0x53a8('0x7'));var jayson=require(_0x53a8('0x8'));var client=jayson['client'][_0x53a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57906f,_0x49985a,_0x30c48f){return new BPromise(function(_0x50bbb4,_0x11cd0f){return client['request'](_0x57906f,_0x30c48f)[_0x53a8('0xa')](function(_0x10e31e){logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x49985a,_0x53a8('0xd'));logger[_0x53a8('0xe')](_0x53a8('0xf'),_0x49985a,_0x53a8('0xd'),JSON['stringify'](_0x10e31e));if(_0x10e31e[_0x53a8('0x10')]){if(_0x10e31e[_0x53a8('0x10')][_0x53a8('0x11')]===0x1f4){logger[_0x53a8('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x49985a,_0x10e31e['error'][_0x53a8('0x12')]);return _0x11cd0f(_0x10e31e[_0x53a8('0x10')]['message']);}logger[_0x53a8('0x10')](_0x53a8('0xc'),_0x49985a,_0x10e31e[_0x53a8('0x10')][_0x53a8('0x12')]);return _0x50bbb4(_0x10e31e['error'][_0x53a8('0x12')]);}else{logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x49985a,_0x53a8('0xd'));_0x50bbb4(_0x10e31e['result'][_0x53a8('0x12')]);}})['catch'](function(_0x53b1a5){logger[_0x53a8('0x10')](_0x53a8('0xc'),_0x49985a,_0x53b1a5);_0x11cd0f(_0x53b1a5);});});}exports['GetDynamics365Account']=function(_0x4a6fee){var _0x161c35=this;return new Promise(function(_0x36917c,_0x574902){return db[_0x53a8('0x13')][_0x53a8('0x14')]({'raw':_0x4a6fee[_0x53a8('0x15')]?_0x4a6fee['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a6fee[_0x53a8('0x15')]?_0x4a6fee[_0x53a8('0x15')][_0x53a8('0x16')]||null:null,'attributes':_0x4a6fee[_0x53a8('0x15')]?_0x4a6fee['options']['attributes']||null:null,'limit':_0x4a6fee['options']?_0x4a6fee['options'][_0x53a8('0x17')]||null:null,'include':_0x4a6fee[_0x53a8('0x15')]?_0x4a6fee[_0x53a8('0x15')][_0x53a8('0x18')]?_[_0x53a8('0x19')](_0x4a6fee[_0x53a8('0x15')][_0x53a8('0x18')],function(_0x2f107c){return{'model':db[_0x2f107c['model']],'as':_0x2f107c['as'],'attributes':_0x2f107c[_0x53a8('0x1a')],'include':_0x2f107c['include']?_[_0x53a8('0x19')](_0x2f107c[_0x53a8('0x18')],function(_0x431fcd){return{'model':db[_0x431fcd[_0x53a8('0x1b')]],'as':_0x431fcd['as'],'attributes':_0x431fcd[_0x53a8('0x1a')],'include':_0x431fcd[_0x53a8('0x18')]?_['map'](_0x431fcd[_0x53a8('0x18')],function(_0x4d1c95){return{'model':db[_0x4d1c95[_0x53a8('0x1b')]],'as':_0x4d1c95['as'],'attributes':_0x4d1c95[_0x53a8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x53a8('0xa')](function(_0x4ea911){logger['info'](_0x53a8('0x1c'),_0x4a6fee);logger['debug']('GetDynamics365Account',_0x4a6fee,JSON[_0x53a8('0x1d')](_0x4ea911));_0x36917c(_0x4ea911);})[_0x53a8('0x1e')](function(_0x3a90f2){logger[_0x53a8('0x10')](_0x53a8('0x1c'),_0x3a90f2[_0x53a8('0x12')],_0x4a6fee);_0x574902(_0x161c35['error'](0x1f4,_0x3a90f2[_0x53a8('0x12')]));});});};exports[_0x53a8('0x1f')]=function(_0x11a808){var _0x497db2=this;return new Promise(function(_0x36b1c0,_0x2550f8){return db['Dynamics365Account'][_0x53a8('0x20')]({'raw':_0x11a808[_0x53a8('0x15')]?_0x11a808[_0x53a8('0x15')][_0x53a8('0x21')]===undefined?!![]:![]:!![],'where':_0x11a808[_0x53a8('0x15')]?_0x11a808[_0x53a8('0x15')][_0x53a8('0x16')]||null:null,'attributes':_0x11a808[_0x53a8('0x15')]?_0x11a808[_0x53a8('0x15')][_0x53a8('0x1a')]||null:null,'include':_0x11a808[_0x53a8('0x15')]?_0x11a808[_0x53a8('0x15')][_0x53a8('0x18')]?_[_0x53a8('0x19')](_0x11a808['options'][_0x53a8('0x18')],function(_0x469e1b){return{'model':db[_0x469e1b[_0x53a8('0x1b')]],'as':_0x469e1b['as'],'attributes':_0x469e1b[_0x53a8('0x1a')],'include':_0x469e1b[_0x53a8('0x18')]?_['map'](_0x469e1b['include'],function(_0xcaa68f){return{'model':db[_0xcaa68f[_0x53a8('0x1b')]],'as':_0xcaa68f['as'],'attributes':_0xcaa68f[_0x53a8('0x1a')],'include':_0xcaa68f[_0x53a8('0x18')]?_[_0x53a8('0x19')](_0xcaa68f[_0x53a8('0x18')],function(_0x1cb577){return{'model':db[_0x1cb577['model']],'as':_0x1cb577['as'],'attributes':_0x1cb577[_0x53a8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x53a8('0xa')](function(_0x2a4644){logger[_0x53a8('0xb')](_0x53a8('0x1f'),_0x11a808);logger['debug'](_0x53a8('0x1f'),_0x11a808,JSON[_0x53a8('0x1d')](_0x2a4644));_0x36b1c0(_0x2a4644);})['catch'](function(_0x477d4e){logger['error'](_0x53a8('0x1f'),_0x477d4e[_0x53a8('0x12')],_0x11a808);_0x2550f8(_0x497db2['error'](0x1f4,_0x477d4e[_0x53a8('0x12')]));});});}; \ No newline at end of file +var _0xea1c=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','info','GetDynamics365Account','debug','where','ShowDynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea1c,0xdb));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcea1('0x0'));var util=require('util');var moment=require(_0xcea1('0x1'));var BPromise=require(_0xcea1('0x2'));var rs=require(_0xcea1('0x3'));var fs=require('fs');var Redis=require(_0xcea1('0x4'));var db=require(_0xcea1('0x5'))['db'];var utils=require(_0xcea1('0x6'));var logger=require(_0xcea1('0x7'))(_0xcea1('0x8'));var config=require(_0xcea1('0x9'));var jayson=require(_0xcea1('0xa'));var client=jayson[_0xcea1('0xb')][_0xcea1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ec75e,_0x5118e9,_0x1894e5){return new BPromise(function(_0x250ecb,_0x5580c5){return client[_0xcea1('0xd')](_0x2ec75e,_0x1894e5)[_0xcea1('0xe')](function(_0x2581f6){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5118e9,_0xcea1('0xf'));logger['debug'](_0xcea1('0x10'),_0x5118e9,_0xcea1('0xf'),JSON[_0xcea1('0x11')](_0x2581f6));if(_0x2581f6[_0xcea1('0x12')]){if(_0x2581f6[_0xcea1('0x12')][_0xcea1('0x13')]===0x1f4){logger[_0xcea1('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x5118e9,_0x2581f6['error'][_0xcea1('0x14')]);return _0x5580c5(_0x2581f6[_0xcea1('0x12')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5118e9,_0x2581f6['error']['message']);return _0x250ecb(_0x2581f6['error']['message']);}else{logger['info'](_0xcea1('0x15'),_0x5118e9,_0xcea1('0xf'));_0x250ecb(_0x2581f6[_0xcea1('0x16')][_0xcea1('0x14')]);}})[_0xcea1('0x17')](function(_0x100d6d){logger['error'](_0xcea1('0x15'),_0x5118e9,_0x100d6d);_0x5580c5(_0x100d6d);});});}exports['GetDynamics365Account']=function(_0x3e2ecf){var _0x2c3bc6=this;return new Promise(function(_0x58c324,_0x15d82c){return db[_0xcea1('0x18')][_0xcea1('0x19')]({'raw':_0x3e2ecf[_0xcea1('0x1a')]?_0x3e2ecf[_0xcea1('0x1a')][_0xcea1('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e2ecf[_0xcea1('0x1a')]?_0x3e2ecf[_0xcea1('0x1a')]['where']||null:null,'attributes':_0x3e2ecf['options']?_0x3e2ecf[_0xcea1('0x1a')][_0xcea1('0x1c')]||null:null,'limit':_0x3e2ecf['options']?_0x3e2ecf['options'][_0xcea1('0x1d')]||null:null,'include':_0x3e2ecf[_0xcea1('0x1a')]?_0x3e2ecf['options'][_0xcea1('0x1e')]?_[_0xcea1('0x1f')](_0x3e2ecf[_0xcea1('0x1a')][_0xcea1('0x1e')],function(_0x5f0162){return{'model':db[_0x5f0162[_0xcea1('0x20')]],'as':_0x5f0162['as'],'attributes':_0x5f0162[_0xcea1('0x1c')],'include':_0x5f0162[_0xcea1('0x1e')]?_[_0xcea1('0x1f')](_0x5f0162[_0xcea1('0x1e')],function(_0x49d9cd){return{'model':db[_0x49d9cd['model']],'as':_0x49d9cd['as'],'attributes':_0x49d9cd[_0xcea1('0x1c')],'include':_0x49d9cd['include']?_[_0xcea1('0x1f')](_0x49d9cd[_0xcea1('0x1e')],function(_0x25374f){return{'model':db[_0x25374f[_0xcea1('0x20')]],'as':_0x25374f['as'],'attributes':_0x25374f[_0xcea1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcea1('0xe')](function(_0x28747f){logger[_0xcea1('0x21')](_0xcea1('0x22'),_0x3e2ecf);logger[_0xcea1('0x23')](_0xcea1('0x22'),_0x3e2ecf,JSON[_0xcea1('0x11')](_0x28747f));_0x58c324(_0x28747f);})[_0xcea1('0x17')](function(_0x4a0794){logger[_0xcea1('0x12')](_0xcea1('0x22'),_0x4a0794['message'],_0x3e2ecf);_0x15d82c(_0x2c3bc6['error'](0x1f4,_0x4a0794[_0xcea1('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x464cb7){var _0x4ac698=this;return new Promise(function(_0x2822dd,_0x36b145){return db['Dynamics365Account']['find']({'raw':_0x464cb7['options']?_0x464cb7[_0xcea1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x464cb7['options']?_0x464cb7[_0xcea1('0x1a')][_0xcea1('0x24')]||null:null,'attributes':_0x464cb7['options']?_0x464cb7[_0xcea1('0x1a')][_0xcea1('0x1c')]||null:null,'include':_0x464cb7[_0xcea1('0x1a')]?_0x464cb7[_0xcea1('0x1a')][_0xcea1('0x1e')]?_[_0xcea1('0x1f')](_0x464cb7[_0xcea1('0x1a')][_0xcea1('0x1e')],function(_0x4badc5){return{'model':db[_0x4badc5[_0xcea1('0x20')]],'as':_0x4badc5['as'],'attributes':_0x4badc5[_0xcea1('0x1c')],'include':_0x4badc5[_0xcea1('0x1e')]?_[_0xcea1('0x1f')](_0x4badc5[_0xcea1('0x1e')],function(_0x205605){return{'model':db[_0x205605[_0xcea1('0x20')]],'as':_0x205605['as'],'attributes':_0x205605[_0xcea1('0x1c')],'include':_0x205605[_0xcea1('0x1e')]?_[_0xcea1('0x1f')](_0x205605['include'],function(_0x4cfa58){return{'model':db[_0x4cfa58[_0xcea1('0x20')]],'as':_0x4cfa58['as'],'attributes':_0x4cfa58[_0xcea1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcea1('0xe')](function(_0x4a4328){logger[_0xcea1('0x21')](_0xcea1('0x25'),_0x464cb7);logger[_0xcea1('0x23')](_0xcea1('0x25'),_0x464cb7,JSON[_0xcea1('0x11')](_0x4a4328));_0x2822dd(_0x4a4328);})[_0xcea1('0x17')](function(_0x2ccdd5){logger[_0xcea1('0x12')]('ShowDynamics365Account',_0x2ccdd5[_0xcea1('0x14')],_0x464cb7);_0x36b145(_0x4ac698[_0xcea1('0x12')](0x1f4,_0x2ccdd5[_0xcea1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index e3be1b8..78fd471 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 _0xd65c=['isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd65c,0x177));var _0xcd65=function(_0x59602c,_0x31958d){_0x59602c=_0x59602c-0x0;var _0x54eda2=_0xd65c[_0x59602c];return _0x54eda2;};'use strict';var multer=require(_0xcd65('0x0'));var util=require(_0xcd65('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcd65('0x2'));var router=express[_0xcd65('0x3')]();var fs_extra=require(_0xcd65('0x4'));var auth=require(_0xcd65('0x5'));var interaction=require(_0xcd65('0x6'));var config=require(_0xcd65('0x7'));var controller=require(_0xcd65('0x8'));router['get']('/',auth[_0xcd65('0x9')](),controller['index']);router[_0xcd65('0xa')](_0xcd65('0xb'),auth[_0xcd65('0x9')](),controller[_0xcd65('0xc')]);router['get'](_0xcd65('0xd'),auth['isAuthenticated'](),controller[_0xcd65('0xe')]);router['get'](_0xcd65('0xf'),auth[_0xcd65('0x9')](),controller[_0xcd65('0x10')]);router[_0xcd65('0xa')]('/:id/descriptions',auth[_0xcd65('0x9')](),controller[_0xcd65('0x11')]);router['post']('/',auth[_0xcd65('0x9')](),controller[_0xcd65('0x12')]);router[_0xcd65('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xcd65('0x14')]);router[_0xcd65('0x15')](_0xcd65('0xb'),auth[_0xcd65('0x9')](),controller[_0xcd65('0x16')]);module[_0xcd65('0x17')]=router; \ No newline at end of file +var _0xb982=['index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x464e8a,_0x369e26){var _0x1e2b68=function(_0x537f73){while(--_0x537f73){_0x464e8a['push'](_0x464e8a['shift']());}};_0x1e2b68(++_0x369e26);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b98('0x0'));var timeout=require(_0x2b98('0x1'));var express=require(_0x2b98('0x2'));var router=express[_0x2b98('0x3')]();var fs_extra=require(_0x2b98('0x4'));var auth=require(_0x2b98('0x5'));var interaction=require(_0x2b98('0x6'));var config=require(_0x2b98('0x7'));var controller=require(_0x2b98('0x8'));router[_0x2b98('0x9')]('/',auth['isAuthenticated'](),controller[_0x2b98('0xa')]);router[_0x2b98('0x9')](_0x2b98('0xb'),auth[_0x2b98('0xc')](),controller[_0x2b98('0xd')]);router[_0x2b98('0x9')]('/:id/fields',auth[_0x2b98('0xc')](),controller[_0x2b98('0xe')]);router['get'](_0x2b98('0xf'),auth['isAuthenticated'](),controller[_0x2b98('0x10')]);router[_0x2b98('0x9')](_0x2b98('0x11'),auth[_0x2b98('0xc')](),controller[_0x2b98('0x12')]);router['post']('/',auth[_0x2b98('0xc')](),controller['create']);router[_0x2b98('0x13')](_0x2b98('0xb'),auth[_0x2b98('0xc')](),controller[_0x2b98('0x14')]);router[_0x2b98('0x15')](_0x2b98('0xb'),auth['isAuthenticated'](),controller[_0x2b98('0x16')]);module[_0x2b98('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 48181b5..9cdaaa4 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 _0x5709=['phonecall','contact','nothing','sequelize','exports','STRING','incident'];(function(_0x58e1f8,_0x525a78){var _0x251e75=function(_0x5accd4){while(--_0x5accd4){_0x58e1f8['push'](_0x58e1f8['shift']());}};_0x251e75(++_0x525a78);}(_0x5709,0x8f));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9570('0x0'));module[_0x9570('0x1')]={'name':{'type':Sequelize[_0x9570('0x2')]},'description':{'type':Sequelize[_0x9570('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x9570('0x3'),_0x9570('0x4')),'defaultValue':_0x9570('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0x9570('0x5'),_0x9570('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9570('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4fa3=['exports','STRING','ENUM','incident','contact','nothing'];(function(_0x475aa9,_0x439aab){var _0x360bbc=function(_0x331a22){while(--_0x331a22){_0x475aa9['push'](_0x475aa9['shift']());}};_0x360bbc(++_0x439aab);}(_0x4fa3,0xa2));var _0x34fa=function(_0x4c2c23,_0x3d8d28){_0x4c2c23=_0x4c2c23-0x0;var _0x5c992e=_0x4fa3[_0x4c2c23];return _0x5c992e;};'use strict';var Sequelize=require('sequelize');module[_0x34fa('0x0')]={'name':{'type':Sequelize[_0x34fa('0x1')]},'description':{'type':Sequelize[_0x34fa('0x1')]},'ticketType':{'type':Sequelize[_0x34fa('0x2')]('incident','phonecall'),'defaultValue':_0x34fa('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0x34fa('0x4'),_0x34fa('0x5')),'defaultValue':_0x34fa('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x34fa('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index dc57cb7..0b06e5b 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 _0x26b0=['sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','Dynamics365Configuration','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x26b0,0x10a));var _0x026b=function(_0x12d370,_0x13ae4d){_0x12d370=_0x12d370-0x0;var _0x39748c=_0x26b0[_0x12d370];return _0x39748c;};'use strict';var emlformat=require(_0x026b('0x0'));var rimraf=require(_0x026b('0x1'));var zipdir=require(_0x026b('0x2'));var jsonpatch=require(_0x026b('0x3'));var rp=require(_0x026b('0x4'));var moment=require(_0x026b('0x5'));var BPromise=require(_0x026b('0x6'));var Mustache=require(_0x026b('0x7'));var util=require(_0x026b('0x8'));var path=require(_0x026b('0x9'));var sox=require(_0x026b('0xa'));var csv=require(_0x026b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x026b('0xc'));var _=require(_0x026b('0xd'));var squel=require(_0x026b('0xe'));var crypto=require(_0x026b('0xf'));var jsforce=require(_0x026b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x026b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x026b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x026b('0x12'));var hardwareService=require(_0x026b('0x13'));var logger=require(_0x026b('0x14'))(_0x026b('0x15'));var utils=require(_0x026b('0x16'));var config=require(_0x026b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x026b('0x18'))['db'];function respondWithStatusCode(_0x12a89e,_0xdd07f1){_0xdd07f1=_0xdd07f1||0xcc;return function(_0x1c98ca){if(_0x1c98ca){return _0x12a89e['sendStatus'](_0xdd07f1);}return _0x12a89e[_0x026b('0x19')](_0xdd07f1)[_0x026b('0x1a')]();};}function respondWithResult(_0x1e477e,_0x37d86e){_0x37d86e=_0x37d86e||0xc8;return function(_0xd792c){if(_0xd792c){return _0x1e477e['status'](_0x37d86e)[_0x026b('0x1b')](_0xd792c);}};}function respondWithFilteredResult(_0x5dfcb6,_0x376963){return function(_0x1a9674){if(_0x1a9674){var _0x27eaf3=typeof _0x376963[_0x026b('0x1c')]==='undefined'&&typeof _0x376963[_0x026b('0x1d')]===_0x026b('0x1e');var _0xe8881e=_0x1a9674[_0x026b('0x1f')];var _0x42ca16=_0x27eaf3?0x0:_0x376963[_0x026b('0x1c')];var _0x2177c8=_0x27eaf3?_0x1a9674[_0x026b('0x1f')]:_0x376963[_0x026b('0x1c')]+_0x376963[_0x026b('0x1d')];var _0x312a36;if(_0x2177c8>=_0xe8881e){_0x2177c8=_0xe8881e;_0x312a36=0xc8;}else{_0x312a36=0xce;}_0x5dfcb6['status'](_0x312a36);return _0x5dfcb6[_0x026b('0x20')](_0x026b('0x21'),_0x42ca16+'-'+_0x2177c8+'/'+_0xe8881e)[_0x026b('0x1b')](_0x1a9674);}return null;};}function patchUpdates(_0x4e0ca5){return function(_0x7a28ad){try{jsonpatch[_0x026b('0x22')](_0x7a28ad,_0x4e0ca5,!![]);}catch(_0x520fb6){return BPromise[_0x026b('0x23')](_0x520fb6);}return _0x7a28ad[_0x026b('0x24')]();};}function saveUpdates(_0x424968,_0x3d3ce5){return function(_0x523d81){if(_0x523d81){return _0x523d81['update'](_0x424968)[_0x026b('0x25')](function(_0x34b0a7){return _0x34b0a7;});}return null;};}function removeEntity(_0x517a6b,_0x2a256e){return function(_0x537d0f){if(_0x537d0f){return _0x537d0f['destroy']()[_0x026b('0x25')](function(){_0x517a6b[_0x026b('0x19')](0xcc)[_0x026b('0x1a')]();});}};}function handleEntityNotFound(_0x5c6ca4,_0x3580c8){return function(_0x5db888){if(!_0x5db888){_0x5c6ca4['sendStatus'](0x194);}return _0x5db888;};}function handleError(_0x3a3d24,_0x383cc2){_0x383cc2=_0x383cc2||0x1f4;return function(_0x12ac28){logger[_0x026b('0x26')](_0x12ac28['stack']);if(_0x12ac28['name']){delete _0x12ac28[_0x026b('0x27')];}_0x3a3d24['status'](_0x383cc2)[_0x026b('0x28')](_0x12ac28);};}exports['index']=function(_0x483b1c,_0x1cf492){var _0x9f6573={},_0x19db42={},_0x123088={'count':0x0,'rows':[]};var _0x57bfbd=_[_0x026b('0x29')](db['Dynamics365Configuration']['rawAttributes'],function(_0xe9475c){return{'name':_0xe9475c[_0x026b('0x2a')],'type':_0xe9475c[_0x026b('0x2b')][_0x026b('0x2c')]};});_0x19db42['model']=_[_0x026b('0x29')](_0x57bfbd,_0x026b('0x27'));_0x19db42[_0x026b('0x2d')]=_[_0x026b('0x2e')](_0x483b1c[_0x026b('0x2d')]);_0x19db42['filters']=_[_0x026b('0x2f')](_0x19db42[_0x026b('0x30')],_0x19db42[_0x026b('0x2d')]);_0x9f6573['attributes']=_[_0x026b('0x2f')](_0x19db42[_0x026b('0x30')],qs[_0x026b('0x31')](_0x483b1c['query'][_0x026b('0x31')]));_0x9f6573['attributes']=_0x9f6573['attributes']['length']?_0x9f6573[_0x026b('0x32')]:_0x19db42[_0x026b('0x30')];if(!_0x483b1c[_0x026b('0x2d')][_0x026b('0x33')](_0x026b('0x34'))){_0x9f6573['limit']=qs['limit'](_0x483b1c[_0x026b('0x2d')][_0x026b('0x1d')]);_0x9f6573[_0x026b('0x1c')]=qs[_0x026b('0x1c')](_0x483b1c[_0x026b('0x2d')][_0x026b('0x1c')]);}_0x9f6573[_0x026b('0x35')]=qs[_0x026b('0x36')](_0x483b1c['query']['sort']);_0x9f6573[_0x026b('0x37')]=qs[_0x026b('0x38')](_[_0x026b('0x39')](_0x483b1c['query'],_0x19db42[_0x026b('0x38')]),_0x57bfbd);if(_0x483b1c[_0x026b('0x2d')]['filter']){_0x9f6573[_0x026b('0x37')]=_[_0x026b('0x3a')](_0x9f6573[_0x026b('0x37')],{'$or':_[_0x026b('0x29')](_0x57bfbd,function(_0xfd1060){if(_0xfd1060[_0x026b('0x2b')]!==_0x026b('0x3b')){var _0x1f3dfd={};_0x1f3dfd[_0xfd1060['name']]={'$like':'%'+_0x483b1c[_0x026b('0x2d')][_0x026b('0x3c')]+'%'};return _0x1f3dfd;}})});}_0x9f6573=_[_0x026b('0x3a')]({},_0x9f6573,_0x483b1c[_0x026b('0x3d')]);var _0x4674a3={'where':_0x9f6573['where']};return db['Dynamics365Configuration'][_0x026b('0x1f')](_0x4674a3)[_0x026b('0x25')](function(_0x2a410c){_0x123088[_0x026b('0x1f')]=_0x2a410c;if(_0x483b1c['query'][_0x026b('0x3e')]){_0x9f6573[_0x026b('0x3f')]=[{'all':!![]}];}return db[_0x026b('0x40')]['findAll'](_0x9f6573);})[_0x026b('0x25')](function(_0x1b36b4){_0x123088[_0x026b('0x41')]=_0x1b36b4;return _0x123088;})[_0x026b('0x25')](respondWithFilteredResult(_0x1cf492,_0x9f6573))[_0x026b('0x42')](handleError(_0x1cf492,null));};exports[_0x026b('0x43')]=function(_0x5ec099,_0x6ba573){var _0x58beb6={'raw':![],'where':{'id':_0x5ec099[_0x026b('0x44')]['id']}},_0xd7f768={};_0xd7f768['model']=_[_0x026b('0x2e')](db[_0x026b('0x40')][_0x026b('0x45')]);_0xd7f768['query']=_[_0x026b('0x2e')](_0x5ec099[_0x026b('0x2d')]);_0xd7f768[_0x026b('0x38')]=_[_0x026b('0x2f')](_0xd7f768['model'],_0xd7f768['query']);_0x58beb6[_0x026b('0x32')]=_[_0x026b('0x2f')](_0xd7f768['model'],qs[_0x026b('0x31')](_0x5ec099[_0x026b('0x2d')]['fields']));_0x58beb6[_0x026b('0x32')]=_0x58beb6['attributes'][_0x026b('0x46')]?_0x58beb6[_0x026b('0x32')]:_0xd7f768[_0x026b('0x30')];if(_0x5ec099['query'][_0x026b('0x3e')]){_0x58beb6['include']=[{'all':!![]}];}_0x58beb6=_[_0x026b('0x3a')]({},_0x58beb6,_0x5ec099[_0x026b('0x3d')]);return db[_0x026b('0x40')][_0x026b('0x47')](_0x58beb6)[_0x026b('0x25')](handleEntityNotFound(_0x6ba573,null))['then'](respondWithResult(_0x6ba573,null))['catch'](handleError(_0x6ba573,null));};exports[_0x026b('0x48')]=function(_0x23247f,_0x1c0f46){return db[_0x026b('0x40')][_0x026b('0x48')](_0x23247f['body'],{})[_0x026b('0x25')](respondWithResult(_0x1c0f46,0xc9))['catch'](handleError(_0x1c0f46,null));};exports['update']=function(_0x10facd,_0x4dc824){if(_0x10facd[_0x026b('0x49')]['id']){delete _0x10facd[_0x026b('0x49')]['id'];}return db[_0x026b('0x40')][_0x026b('0x47')]({'where':{'id':_0x10facd[_0x026b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4dc824,null))['then'](saveUpdates(_0x10facd[_0x026b('0x49')],null))[_0x026b('0x25')](respondWithResult(_0x4dc824,null))[_0x026b('0x42')](handleError(_0x4dc824,null));};exports[_0x026b('0x4a')]=function(_0x4e09e2,_0x2692cc){return db[_0x026b('0x40')][_0x026b('0x47')]({'where':{'id':_0x4e09e2[_0x026b('0x44')]['id']}})[_0x026b('0x25')](handleEntityNotFound(_0x2692cc,null))['then'](removeEntity(_0x2692cc,null))[_0x026b('0x42')](handleError(_0x2692cc,null));};exports[_0x026b('0x4b')]=function(_0x481962,_0x1cb886,_0x417539){var _0x4b0dc0={};var _0x1ba27b={};var _0x599422;var _0x478f6c;return db[_0x026b('0x40')][_0x026b('0x4c')]({'where':{'id':_0x481962[_0x026b('0x44')]['id']}})[_0x026b('0x25')](handleEntityNotFound(_0x1cb886,null))[_0x026b('0x25')](function(_0x32bd90){if(_0x32bd90){_0x599422=_0x32bd90;_0x1ba27b['model']=_[_0x026b('0x2e')](db[_0x026b('0x4d')][_0x026b('0x45')]);_0x1ba27b[_0x026b('0x2d')]=_[_0x026b('0x2e')](_0x481962['query']);_0x1ba27b[_0x026b('0x38')]=_[_0x026b('0x2f')](_0x1ba27b[_0x026b('0x30')],_0x1ba27b[_0x026b('0x2d')]);_0x4b0dc0[_0x026b('0x32')]=_[_0x026b('0x2f')](_0x1ba27b['model'],qs[_0x026b('0x31')](_0x481962[_0x026b('0x2d')]['fields']));_0x4b0dc0[_0x026b('0x32')]=_0x4b0dc0[_0x026b('0x32')][_0x026b('0x46')]?_0x4b0dc0[_0x026b('0x32')]:_0x1ba27b[_0x026b('0x30')];_0x4b0dc0[_0x026b('0x35')]=qs[_0x026b('0x36')](_0x481962['query']['sort']);_0x4b0dc0[_0x026b('0x37')]=qs[_0x026b('0x38')](_['pick'](_0x481962['query'],_0x1ba27b['filters']));if(_0x481962[_0x026b('0x2d')][_0x026b('0x3c')]){_0x4b0dc0['where']=_[_0x026b('0x3a')](_0x4b0dc0[_0x026b('0x37')],{'$or':_[_0x026b('0x29')](_0x4b0dc0[_0x026b('0x32')],function(_0x1ce672){var _0x2fa204={};_0x2fa204[_0x1ce672]={'$like':'%'+_0x481962[_0x026b('0x2d')]['filter']+'%'};return _0x2fa204;})});}_0x4b0dc0=_['merge']({},_0x4b0dc0,_0x481962[_0x026b('0x3d')]);return _0x599422['getFields'](_0x4b0dc0);}})['then'](function(_0x10d899){if(_0x10d899){_0x478f6c=_0x10d899[_0x026b('0x46')];if(!_0x481962['query']['hasOwnProperty']('nolimit')){_0x4b0dc0['limit']=qs[_0x026b('0x1d')](_0x481962[_0x026b('0x2d')]['limit']);_0x4b0dc0[_0x026b('0x1c')]=qs[_0x026b('0x1c')](_0x481962[_0x026b('0x2d')][_0x026b('0x1c')]);}return _0x599422['getFields'](_0x4b0dc0);}})[_0x026b('0x25')](function(_0x313783){if(_0x313783){return _0x313783?{'count':_0x478f6c,'rows':_0x313783}:null;}})[_0x026b('0x25')](respondWithResult(_0x1cb886,null))[_0x026b('0x42')](handleError(_0x1cb886,null));};exports[_0x026b('0x4e')]=function(_0x962354,_0x5debc1,_0xe50974){var _0x1e6541={};var _0x396227={};var _0x292654;var _0x3ea5aa;return db[_0x026b('0x40')][_0x026b('0x4c')]({'where':{'id':_0x962354[_0x026b('0x44')]['id']}})[_0x026b('0x25')](handleEntityNotFound(_0x5debc1,null))['then'](function(_0x275f05){if(_0x275f05){_0x292654=_0x275f05;_0x396227[_0x026b('0x30')]=_[_0x026b('0x2e')](db['Dynamics365Field'][_0x026b('0x45')]);_0x396227[_0x026b('0x2d')]=_['keys'](_0x962354[_0x026b('0x2d')]);_0x396227[_0x026b('0x38')]=_['intersection'](_0x396227[_0x026b('0x30')],_0x396227[_0x026b('0x2d')]);_0x1e6541[_0x026b('0x32')]=_[_0x026b('0x2f')](_0x396227[_0x026b('0x30')],qs[_0x026b('0x31')](_0x962354[_0x026b('0x2d')]['fields']));_0x1e6541['attributes']=_0x1e6541[_0x026b('0x32')][_0x026b('0x46')]?_0x1e6541[_0x026b('0x32')]:_0x396227[_0x026b('0x30')];_0x1e6541[_0x026b('0x35')]=qs[_0x026b('0x36')](_0x962354[_0x026b('0x2d')][_0x026b('0x36')]);_0x1e6541[_0x026b('0x37')]=qs[_0x026b('0x38')](_[_0x026b('0x39')](_0x962354[_0x026b('0x2d')],_0x396227[_0x026b('0x38')]));if(_0x962354[_0x026b('0x2d')][_0x026b('0x3c')]){_0x1e6541['where']=_['merge'](_0x1e6541[_0x026b('0x37')],{'$or':_[_0x026b('0x29')](_0x1e6541['attributes'],function(_0x41d372){var _0x4b066a={};_0x4b066a[_0x41d372]={'$like':'%'+_0x962354[_0x026b('0x2d')]['filter']+'%'};return _0x4b066a;})});}_0x1e6541=_[_0x026b('0x3a')]({},_0x1e6541,_0x962354[_0x026b('0x3d')]);return _0x292654[_0x026b('0x4e')](_0x1e6541);}})[_0x026b('0x25')](function(_0x3aceca){if(_0x3aceca){_0x3ea5aa=_0x3aceca[_0x026b('0x46')];if(!_0x962354['query'][_0x026b('0x33')]('nolimit')){_0x1e6541[_0x026b('0x1d')]=qs[_0x026b('0x1d')](_0x962354[_0x026b('0x2d')][_0x026b('0x1d')]);_0x1e6541[_0x026b('0x1c')]=qs[_0x026b('0x1c')](_0x962354[_0x026b('0x2d')]['offset']);}return _0x292654[_0x026b('0x4e')](_0x1e6541);}})[_0x026b('0x25')](function(_0x41760a){if(_0x41760a){return _0x41760a?{'count':_0x3ea5aa,'rows':_0x41760a}:null;}})[_0x026b('0x25')](respondWithResult(_0x5debc1,null))['catch'](handleError(_0x5debc1,null));};exports['getDescriptions']=function(_0x5ab8f0,_0x4ca816,_0x129901){var _0x4efe71={};var _0x2b10b7={};var _0x2f461c;var _0x2325ac;return db['Dynamics365Configuration'][_0x026b('0x4c')]({'where':{'id':_0x5ab8f0[_0x026b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ca816,null))['then'](function(_0x817941){if(_0x817941){_0x2f461c=_0x817941;_0x2b10b7[_0x026b('0x30')]=_[_0x026b('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x2b10b7[_0x026b('0x2d')]=_['keys'](_0x5ab8f0[_0x026b('0x2d')]);_0x2b10b7[_0x026b('0x38')]=_[_0x026b('0x2f')](_0x2b10b7[_0x026b('0x30')],_0x2b10b7['query']);_0x4efe71[_0x026b('0x32')]=_[_0x026b('0x2f')](_0x2b10b7[_0x026b('0x30')],qs[_0x026b('0x31')](_0x5ab8f0[_0x026b('0x2d')][_0x026b('0x31')]));_0x4efe71[_0x026b('0x32')]=_0x4efe71[_0x026b('0x32')]['length']?_0x4efe71[_0x026b('0x32')]:_0x2b10b7[_0x026b('0x30')];_0x4efe71['order']=qs[_0x026b('0x36')](_0x5ab8f0[_0x026b('0x2d')][_0x026b('0x36')]);_0x4efe71[_0x026b('0x37')]=qs[_0x026b('0x38')](_[_0x026b('0x39')](_0x5ab8f0[_0x026b('0x2d')],_0x2b10b7[_0x026b('0x38')]));if(_0x5ab8f0[_0x026b('0x2d')][_0x026b('0x3c')]){_0x4efe71[_0x026b('0x37')]=_[_0x026b('0x3a')](_0x4efe71['where'],{'$or':_['map'](_0x4efe71[_0x026b('0x32')],function(_0x33c8ef){var _0x413c88={};_0x413c88[_0x33c8ef]={'$like':'%'+_0x5ab8f0[_0x026b('0x2d')][_0x026b('0x3c')]+'%'};return _0x413c88;})});}_0x4efe71=_[_0x026b('0x3a')]({},_0x4efe71,_0x5ab8f0[_0x026b('0x3d')]);return _0x2f461c['getDescriptions'](_0x4efe71);}})[_0x026b('0x25')](function(_0x176836){if(_0x176836){_0x2325ac=_0x176836[_0x026b('0x46')];if(!_0x5ab8f0[_0x026b('0x2d')][_0x026b('0x33')]('nolimit')){_0x4efe71[_0x026b('0x1d')]=qs[_0x026b('0x1d')](_0x5ab8f0['query'][_0x026b('0x1d')]);_0x4efe71[_0x026b('0x1c')]=qs[_0x026b('0x1c')](_0x5ab8f0['query']['offset']);}return _0x2f461c[_0x026b('0x4f')](_0x4efe71);}})[_0x026b('0x25')](function(_0x137109){if(_0x137109){return _0x137109?{'count':_0x2325ac,'rows':_0x137109}:null;}})[_0x026b('0x25')](respondWithResult(_0x4ca816,null))['catch'](handleError(_0x4ca816,null));}; \ No newline at end of file +var _0x68a3=['include','findAll','rows','catch','params','rawAttributes','options','find','create','body','update','destroy','findOne','order','getFields','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','then','end','error','name','send','index','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','VIRTUAL','merge','Dynamics365Configuration','includeAll'];(function(_0x220479,_0x46c525){var _0xf6cc82=function(_0x3afd59){while(--_0x3afd59){_0x220479['push'](_0x220479['shift']());}};_0xf6cc82(++_0x46c525);}(_0x68a3,0x198));var _0x368a=function(_0x120564,_0x3c18cf){_0x120564=_0x120564-0x0;var _0x579980=_0x68a3[_0x120564];return _0x579980;};'use strict';var emlformat=require(_0x368a('0x0'));var rimraf=require(_0x368a('0x1'));var zipdir=require(_0x368a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x368a('0x3'));var moment=require('moment');var BPromise=require(_0x368a('0x4'));var Mustache=require(_0x368a('0x5'));var util=require(_0x368a('0x6'));var path=require(_0x368a('0x7'));var sox=require('sox');var csv=require(_0x368a('0x8'));var ejs=require(_0x368a('0x9'));var fs=require('fs');var fs_extra=require(_0x368a('0xa'));var _=require(_0x368a('0xb'));var squel=require(_0x368a('0xc'));var crypto=require(_0x368a('0xd'));var jsforce=require(_0x368a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x368a('0x8'));var querystring=require(_0x368a('0xf'));var Papa=require(_0x368a('0x10'));var Redis=require(_0x368a('0x11'));var authService=require(_0x368a('0x12'));var qs=require(_0x368a('0x13'));var as=require(_0x368a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368a('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x368a('0x16'))['db'];function respondWithStatusCode(_0x19ab8f,_0x2f4cee){_0x2f4cee=_0x2f4cee||0xcc;return function(_0x3a295a){if(_0x3a295a){return _0x19ab8f[_0x368a('0x17')](_0x2f4cee);}return _0x19ab8f[_0x368a('0x18')](_0x2f4cee)['end']();};}function respondWithResult(_0x54ceda,_0x551029){_0x551029=_0x551029||0xc8;return function(_0x511f38){if(_0x511f38){return _0x54ceda[_0x368a('0x18')](_0x551029)[_0x368a('0x19')](_0x511f38);}};}function respondWithFilteredResult(_0x472514,_0x49ce28){return function(_0x2b7f73){if(_0x2b7f73){var _0x50dd3b=typeof _0x49ce28[_0x368a('0x1a')]==='undefined'&&typeof _0x49ce28[_0x368a('0x1b')]===_0x368a('0x1c');var _0x51f58e=_0x2b7f73[_0x368a('0x1d')];var _0x32a729=_0x50dd3b?0x0:_0x49ce28[_0x368a('0x1a')];var _0x2ff2f8=_0x50dd3b?_0x2b7f73['count']:_0x49ce28[_0x368a('0x1a')]+_0x49ce28['limit'];var _0x36dbd4;if(_0x2ff2f8>=_0x51f58e){_0x2ff2f8=_0x51f58e;_0x36dbd4=0xc8;}else{_0x36dbd4=0xce;}_0x472514[_0x368a('0x18')](_0x36dbd4);return _0x472514[_0x368a('0x1e')]('Content-Range',_0x32a729+'-'+_0x2ff2f8+'/'+_0x51f58e)[_0x368a('0x19')](_0x2b7f73);}return null;};}function patchUpdates(_0x3fc50e){return function(_0x211b91){try{jsonpatch['apply'](_0x211b91,_0x3fc50e,!![]);}catch(_0x2c0a6b){return BPromise[_0x368a('0x1f')](_0x2c0a6b);}return _0x211b91[_0x368a('0x20')]();};}function saveUpdates(_0x7820a8,_0x30411e){return function(_0xbdac14){if(_0xbdac14){return _0xbdac14['update'](_0x7820a8)[_0x368a('0x21')](function(_0x470cfd){return _0x470cfd;});}return null;};}function removeEntity(_0x590382,_0x5b579f){return function(_0x4777a4){if(_0x4777a4){return _0x4777a4['destroy']()[_0x368a('0x21')](function(){_0x590382[_0x368a('0x18')](0xcc)[_0x368a('0x22')]();});}};}function handleEntityNotFound(_0x14ab38,_0x2bc3a6){return function(_0x2ba62e){if(!_0x2ba62e){_0x14ab38['sendStatus'](0x194);}return _0x2ba62e;};}function handleError(_0x4ebb23,_0x5834eb){_0x5834eb=_0x5834eb||0x1f4;return function(_0x31a57e){logger[_0x368a('0x23')](_0x31a57e['stack']);if(_0x31a57e[_0x368a('0x24')]){delete _0x31a57e[_0x368a('0x24')];}_0x4ebb23[_0x368a('0x18')](_0x5834eb)[_0x368a('0x25')](_0x31a57e);};}exports[_0x368a('0x26')]=function(_0x3f1ad8,_0x1c170a){var _0x497cc6={},_0x242c2f={},_0x187011={'count':0x0,'rows':[]};var _0x1d3d23=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x927b2){return{'name':_0x927b2['fieldName'],'type':_0x927b2[_0x368a('0x27')][_0x368a('0x28')]};});_0x242c2f[_0x368a('0x29')]=_['map'](_0x1d3d23,_0x368a('0x24'));_0x242c2f['query']=_[_0x368a('0x2a')](_0x3f1ad8['query']);_0x242c2f[_0x368a('0x2b')]=_[_0x368a('0x2c')](_0x242c2f[_0x368a('0x29')],_0x242c2f[_0x368a('0x2d')]);_0x497cc6['attributes']=_[_0x368a('0x2c')](_0x242c2f[_0x368a('0x29')],qs[_0x368a('0x2e')](_0x3f1ad8[_0x368a('0x2d')][_0x368a('0x2e')]));_0x497cc6['attributes']=_0x497cc6[_0x368a('0x2f')][_0x368a('0x30')]?_0x497cc6[_0x368a('0x2f')]:_0x242c2f[_0x368a('0x29')];if(!_0x3f1ad8[_0x368a('0x2d')][_0x368a('0x31')](_0x368a('0x32'))){_0x497cc6[_0x368a('0x1b')]=qs['limit'](_0x3f1ad8['query'][_0x368a('0x1b')]);_0x497cc6['offset']=qs[_0x368a('0x1a')](_0x3f1ad8[_0x368a('0x2d')][_0x368a('0x1a')]);}_0x497cc6['order']=qs[_0x368a('0x33')](_0x3f1ad8['query'][_0x368a('0x33')]);_0x497cc6['where']=qs[_0x368a('0x2b')](_[_0x368a('0x34')](_0x3f1ad8[_0x368a('0x2d')],_0x242c2f[_0x368a('0x2b')]),_0x1d3d23);if(_0x3f1ad8['query'][_0x368a('0x35')]){_0x497cc6[_0x368a('0x36')]=_['merge'](_0x497cc6['where'],{'$or':_[_0x368a('0x37')](_0x1d3d23,function(_0x39a082){if(_0x39a082[_0x368a('0x27')]!==_0x368a('0x38')){var _0x4b1d47={};_0x4b1d47[_0x39a082[_0x368a('0x24')]]={'$like':'%'+_0x3f1ad8[_0x368a('0x2d')][_0x368a('0x35')]+'%'};return _0x4b1d47;}})});}_0x497cc6=_[_0x368a('0x39')]({},_0x497cc6,_0x3f1ad8['options']);var _0xeeb0ac={'where':_0x497cc6['where']};return db[_0x368a('0x3a')][_0x368a('0x1d')](_0xeeb0ac)['then'](function(_0x354820){_0x187011[_0x368a('0x1d')]=_0x354820;if(_0x3f1ad8['query'][_0x368a('0x3b')]){_0x497cc6[_0x368a('0x3c')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x368a('0x3d')](_0x497cc6);})[_0x368a('0x21')](function(_0x45f093){_0x187011[_0x368a('0x3e')]=_0x45f093;return _0x187011;})[_0x368a('0x21')](respondWithFilteredResult(_0x1c170a,_0x497cc6))[_0x368a('0x3f')](handleError(_0x1c170a,null));};exports['show']=function(_0x291569,_0x3c5ba6){var _0xee94a3={'raw':![],'where':{'id':_0x291569[_0x368a('0x40')]['id']}},_0x19db98={};_0x19db98[_0x368a('0x29')]=_[_0x368a('0x2a')](db['Dynamics365Configuration'][_0x368a('0x41')]);_0x19db98[_0x368a('0x2d')]=_[_0x368a('0x2a')](_0x291569[_0x368a('0x2d')]);_0x19db98[_0x368a('0x2b')]=_[_0x368a('0x2c')](_0x19db98[_0x368a('0x29')],_0x19db98[_0x368a('0x2d')]);_0xee94a3[_0x368a('0x2f')]=_[_0x368a('0x2c')](_0x19db98['model'],qs[_0x368a('0x2e')](_0x291569[_0x368a('0x2d')][_0x368a('0x2e')]));_0xee94a3[_0x368a('0x2f')]=_0xee94a3[_0x368a('0x2f')][_0x368a('0x30')]?_0xee94a3['attributes']:_0x19db98['model'];if(_0x291569[_0x368a('0x2d')][_0x368a('0x3b')]){_0xee94a3[_0x368a('0x3c')]=[{'all':!![]}];}_0xee94a3=_[_0x368a('0x39')]({},_0xee94a3,_0x291569[_0x368a('0x42')]);return db['Dynamics365Configuration'][_0x368a('0x43')](_0xee94a3)[_0x368a('0x21')](handleEntityNotFound(_0x3c5ba6,null))[_0x368a('0x21')](respondWithResult(_0x3c5ba6,null))[_0x368a('0x3f')](handleError(_0x3c5ba6,null));};exports[_0x368a('0x44')]=function(_0x290449,_0x24dd0e){return db['Dynamics365Configuration'][_0x368a('0x44')](_0x290449[_0x368a('0x45')],{})[_0x368a('0x21')](respondWithResult(_0x24dd0e,0xc9))['catch'](handleError(_0x24dd0e,null));};exports[_0x368a('0x46')]=function(_0x3cbacb,_0x4a26e7){if(_0x3cbacb[_0x368a('0x45')]['id']){delete _0x3cbacb[_0x368a('0x45')]['id'];}return db[_0x368a('0x3a')][_0x368a('0x43')]({'where':{'id':_0x3cbacb['params']['id']}})[_0x368a('0x21')](handleEntityNotFound(_0x4a26e7,null))[_0x368a('0x21')](saveUpdates(_0x3cbacb[_0x368a('0x45')],null))['then'](respondWithResult(_0x4a26e7,null))[_0x368a('0x3f')](handleError(_0x4a26e7,null));};exports[_0x368a('0x47')]=function(_0x57b4ab,_0x268110){return db[_0x368a('0x3a')][_0x368a('0x43')]({'where':{'id':_0x57b4ab[_0x368a('0x40')]['id']}})[_0x368a('0x21')](handleEntityNotFound(_0x268110,null))[_0x368a('0x21')](removeEntity(_0x268110,null))[_0x368a('0x3f')](handleError(_0x268110,null));};exports['getFields']=function(_0x26bd9c,_0x1e4b5e,_0x4f7463){var _0x56fc30={};var _0xe8a041={};var _0x2499f8;var _0x235d6a;return db[_0x368a('0x3a')][_0x368a('0x48')]({'where':{'id':_0x26bd9c[_0x368a('0x40')]['id']}})[_0x368a('0x21')](handleEntityNotFound(_0x1e4b5e,null))[_0x368a('0x21')](function(_0x18714c){if(_0x18714c){_0x2499f8=_0x18714c;_0xe8a041[_0x368a('0x29')]=_[_0x368a('0x2a')](db['Dynamics365Field']['rawAttributes']);_0xe8a041['query']=_[_0x368a('0x2a')](_0x26bd9c['query']);_0xe8a041['filters']=_[_0x368a('0x2c')](_0xe8a041[_0x368a('0x29')],_0xe8a041[_0x368a('0x2d')]);_0x56fc30[_0x368a('0x2f')]=_[_0x368a('0x2c')](_0xe8a041[_0x368a('0x29')],qs[_0x368a('0x2e')](_0x26bd9c[_0x368a('0x2d')]['fields']));_0x56fc30[_0x368a('0x2f')]=_0x56fc30[_0x368a('0x2f')]['length']?_0x56fc30[_0x368a('0x2f')]:_0xe8a041[_0x368a('0x29')];_0x56fc30[_0x368a('0x49')]=qs['sort'](_0x26bd9c[_0x368a('0x2d')][_0x368a('0x33')]);_0x56fc30[_0x368a('0x36')]=qs[_0x368a('0x2b')](_['pick'](_0x26bd9c[_0x368a('0x2d')],_0xe8a041[_0x368a('0x2b')]));if(_0x26bd9c[_0x368a('0x2d')]['filter']){_0x56fc30[_0x368a('0x36')]=_[_0x368a('0x39')](_0x56fc30['where'],{'$or':_[_0x368a('0x37')](_0x56fc30[_0x368a('0x2f')],function(_0x4c5a39){var _0x2f515f={};_0x2f515f[_0x4c5a39]={'$like':'%'+_0x26bd9c[_0x368a('0x2d')][_0x368a('0x35')]+'%'};return _0x2f515f;})});}_0x56fc30=_['merge']({},_0x56fc30,_0x26bd9c['options']);return _0x2499f8[_0x368a('0x4a')](_0x56fc30);}})[_0x368a('0x21')](function(_0x5a5d66){if(_0x5a5d66){_0x235d6a=_0x5a5d66[_0x368a('0x30')];if(!_0x26bd9c['query'][_0x368a('0x31')](_0x368a('0x32'))){_0x56fc30[_0x368a('0x1b')]=qs[_0x368a('0x1b')](_0x26bd9c[_0x368a('0x2d')]['limit']);_0x56fc30[_0x368a('0x1a')]=qs[_0x368a('0x1a')](_0x26bd9c[_0x368a('0x2d')]['offset']);}return _0x2499f8[_0x368a('0x4a')](_0x56fc30);}})[_0x368a('0x21')](function(_0x41ed0a){if(_0x41ed0a){return _0x41ed0a?{'count':_0x235d6a,'rows':_0x41ed0a}:null;}})[_0x368a('0x21')](respondWithResult(_0x1e4b5e,null))[_0x368a('0x3f')](handleError(_0x1e4b5e,null));};exports['getSubjects']=function(_0x38cc9e,_0x212717,_0x4d12e1){var _0x53d903={};var _0x45b0ac={};var _0x562b9b;var _0x64fe3d;return db[_0x368a('0x3a')][_0x368a('0x48')]({'where':{'id':_0x38cc9e[_0x368a('0x40')]['id']}})[_0x368a('0x21')](handleEntityNotFound(_0x212717,null))[_0x368a('0x21')](function(_0x1fe4bb){if(_0x1fe4bb){_0x562b9b=_0x1fe4bb;_0x45b0ac[_0x368a('0x29')]=_[_0x368a('0x2a')](db[_0x368a('0x4b')][_0x368a('0x41')]);_0x45b0ac[_0x368a('0x2d')]=_['keys'](_0x38cc9e[_0x368a('0x2d')]);_0x45b0ac[_0x368a('0x2b')]=_['intersection'](_0x45b0ac[_0x368a('0x29')],_0x45b0ac[_0x368a('0x2d')]);_0x53d903[_0x368a('0x2f')]=_['intersection'](_0x45b0ac[_0x368a('0x29')],qs[_0x368a('0x2e')](_0x38cc9e[_0x368a('0x2d')]['fields']));_0x53d903[_0x368a('0x2f')]=_0x53d903[_0x368a('0x2f')][_0x368a('0x30')]?_0x53d903['attributes']:_0x45b0ac[_0x368a('0x29')];_0x53d903[_0x368a('0x49')]=qs['sort'](_0x38cc9e[_0x368a('0x2d')][_0x368a('0x33')]);_0x53d903['where']=qs[_0x368a('0x2b')](_[_0x368a('0x34')](_0x38cc9e['query'],_0x45b0ac['filters']));if(_0x38cc9e[_0x368a('0x2d')][_0x368a('0x35')]){_0x53d903[_0x368a('0x36')]=_[_0x368a('0x39')](_0x53d903[_0x368a('0x36')],{'$or':_['map'](_0x53d903[_0x368a('0x2f')],function(_0x109444){var _0x3d0553={};_0x3d0553[_0x109444]={'$like':'%'+_0x38cc9e['query'][_0x368a('0x35')]+'%'};return _0x3d0553;})});}_0x53d903=_['merge']({},_0x53d903,_0x38cc9e[_0x368a('0x42')]);return _0x562b9b['getSubjects'](_0x53d903);}})[_0x368a('0x21')](function(_0x176f46){if(_0x176f46){_0x64fe3d=_0x176f46[_0x368a('0x30')];if(!_0x38cc9e[_0x368a('0x2d')][_0x368a('0x31')]('nolimit')){_0x53d903[_0x368a('0x1b')]=qs[_0x368a('0x1b')](_0x38cc9e['query'][_0x368a('0x1b')]);_0x53d903[_0x368a('0x1a')]=qs[_0x368a('0x1a')](_0x38cc9e[_0x368a('0x2d')][_0x368a('0x1a')]);}return _0x562b9b[_0x368a('0x4c')](_0x53d903);}})[_0x368a('0x21')](function(_0x4217c5){if(_0x4217c5){return _0x4217c5?{'count':_0x64fe3d,'rows':_0x4217c5}:null;}})['then'](respondWithResult(_0x212717,null))[_0x368a('0x3f')](handleError(_0x212717,null));};exports['getDescriptions']=function(_0x560130,_0x17a143,_0x1833b8){var _0x453100={};var _0x34be3b={};var _0x3074a9;var _0x3214c7;return db[_0x368a('0x3a')]['findOne']({'where':{'id':_0x560130[_0x368a('0x40')]['id']}})['then'](handleEntityNotFound(_0x17a143,null))[_0x368a('0x21')](function(_0x10fc2b){if(_0x10fc2b){_0x3074a9=_0x10fc2b;_0x34be3b[_0x368a('0x29')]=_['keys'](db[_0x368a('0x4b')][_0x368a('0x41')]);_0x34be3b[_0x368a('0x2d')]=_[_0x368a('0x2a')](_0x560130[_0x368a('0x2d')]);_0x34be3b[_0x368a('0x2b')]=_[_0x368a('0x2c')](_0x34be3b[_0x368a('0x29')],_0x34be3b[_0x368a('0x2d')]);_0x453100[_0x368a('0x2f')]=_[_0x368a('0x2c')](_0x34be3b['model'],qs['fields'](_0x560130['query']['fields']));_0x453100[_0x368a('0x2f')]=_0x453100['attributes'][_0x368a('0x30')]?_0x453100['attributes']:_0x34be3b[_0x368a('0x29')];_0x453100['order']=qs[_0x368a('0x33')](_0x560130['query'][_0x368a('0x33')]);_0x453100[_0x368a('0x36')]=qs[_0x368a('0x2b')](_[_0x368a('0x34')](_0x560130[_0x368a('0x2d')],_0x34be3b[_0x368a('0x2b')]));if(_0x560130[_0x368a('0x2d')]['filter']){_0x453100['where']=_[_0x368a('0x39')](_0x453100[_0x368a('0x36')],{'$or':_[_0x368a('0x37')](_0x453100['attributes'],function(_0x520336){var _0x1317de={};_0x1317de[_0x520336]={'$like':'%'+_0x560130['query']['filter']+'%'};return _0x1317de;})});}_0x453100=_[_0x368a('0x39')]({},_0x453100,_0x560130[_0x368a('0x42')]);return _0x3074a9[_0x368a('0x4d')](_0x453100);}})[_0x368a('0x21')](function(_0x4ae396){if(_0x4ae396){_0x3214c7=_0x4ae396[_0x368a('0x30')];if(!_0x560130[_0x368a('0x2d')][_0x368a('0x31')](_0x368a('0x32'))){_0x453100[_0x368a('0x1b')]=qs[_0x368a('0x1b')](_0x560130[_0x368a('0x2d')][_0x368a('0x1b')]);_0x453100[_0x368a('0x1a')]=qs['offset'](_0x560130[_0x368a('0x2d')]['offset']);}return _0x3074a9[_0x368a('0x4d')](_0x453100);}})[_0x368a('0x21')](function(_0x37b884){if(_0x37b884){return _0x37b884?{'count':_0x3214c7,'rows':_0x37b884}:null;}})[_0x368a('0x21')](respondWithResult(_0x17a143,null))[_0x368a('0x3f')](handleError(_0x17a143,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7befe64..70025b7 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 _0xa9e0=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x74a83f,_0x314908){var _0x38867a=function(_0x489cf7){while(--_0x489cf7){_0x74a83f['push'](_0x74a83f['shift']());}};_0x38867a(++_0x314908);}(_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 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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x38fec6,_0x4cf8ac){var _0xcad4d8=function(_0x4f5020){while(--_0x4f5020){_0x38fec6['push'](_0x38fec6['shift']());}};_0xcad4d8(++_0x4cf8ac);}(_0x5b02,0xe9));var _0x25b0=function(_0x56e699,_0x4c0330){_0x56e699=_0x56e699-0x0;var _0x365264=_0x5b02[_0x56e699];return _0x365264;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 265fad5..598e57a 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 _0x3115=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','lodash','util','randomstring'];(function(_0x757606,_0x489624){var _0x416d35=function(_0x360f0e){while(--_0x360f0e){_0x757606['push'](_0x757606['shift']());}};_0x416d35(++_0x489624);}(_0x3115,0x9d));var _0x5311=function(_0x1a0e40,_0x132da7){_0x1a0e40=_0x1a0e40-0x0;var _0x1bc002=_0x3115[_0x1a0e40];return _0x1bc002;};'use strict';var _=require(_0x5311('0x0'));var util=require(_0x5311('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5311('0x2'));var fs=require('fs');var Redis=require(_0x5311('0x3'));var db=require(_0x5311('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5311('0x5'))(_0x5311('0x6'));var config=require(_0x5311('0x7'));var jayson=require(_0x5311('0x8'));var client=jayson[_0x5311('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3afc7a,_0x527d46,_0x449c61){return new BPromise(function(_0x433f9b,_0x5d6f00){return client[_0x5311('0xa')](_0x3afc7a,_0x449c61)[_0x5311('0xb')](function(_0x292240){logger[_0x5311('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x527d46,'request\x20sent');logger[_0x5311('0xd')](_0x5311('0xe'),_0x527d46,_0x5311('0xf'),JSON[_0x5311('0x10')](_0x292240));if(_0x292240[_0x5311('0x11')]){if(_0x292240[_0x5311('0x11')]['code']===0x1f4){logger[_0x5311('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x527d46,_0x292240[_0x5311('0x11')]['message']);return _0x5d6f00(_0x292240[_0x5311('0x11')][_0x5311('0x12')]);}logger['error'](_0x5311('0x13'),_0x527d46,_0x292240['error'][_0x5311('0x12')]);return _0x433f9b(_0x292240[_0x5311('0x11')][_0x5311('0x12')]);}else{logger[_0x5311('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x527d46,'request\x20sent');_0x433f9b(_0x292240['result'][_0x5311('0x12')]);}})['catch'](function(_0x11631f){logger['error'](_0x5311('0x13'),_0x527d46,_0x11631f);_0x5d6f00(_0x11631f);});});} \ No newline at end of file +var _0xd780=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xd780,0xf3));var _0x0d78=function(_0x4f3293,_0x5293d){_0x4f3293=_0x4f3293-0x0;var _0x31111b=_0xd780[_0x4f3293];return _0x31111b;};'use strict';var _=require(_0x0d78('0x0'));var util=require(_0x0d78('0x1'));var moment=require(_0x0d78('0x2'));var BPromise=require(_0x0d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d78('0x4'));var db=require(_0x0d78('0x5'))['db'];var utils=require(_0x0d78('0x6'));var logger=require(_0x0d78('0x7'))(_0x0d78('0x8'));var config=require(_0x0d78('0x9'));var jayson=require(_0x0d78('0xa'));var client=jayson[_0x0d78('0xb')][_0x0d78('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1907f1,_0x30c33e,_0x44c808){return new BPromise(function(_0x442fdd,_0x123fad){return client[_0x0d78('0xd')](_0x1907f1,_0x44c808)['then'](function(_0x1c85e7){logger[_0x0d78('0xe')](_0x0d78('0xf'),_0x30c33e,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x30c33e,_0x0d78('0x10'),JSON[_0x0d78('0x11')](_0x1c85e7));if(_0x1c85e7[_0x0d78('0x12')]){if(_0x1c85e7['error']['code']===0x1f4){logger[_0x0d78('0x12')](_0x0d78('0xf'),_0x30c33e,_0x1c85e7['error'][_0x0d78('0x13')]);return _0x123fad(_0x1c85e7[_0x0d78('0x12')][_0x0d78('0x13')]);}logger[_0x0d78('0x12')](_0x0d78('0xf'),_0x30c33e,_0x1c85e7[_0x0d78('0x12')][_0x0d78('0x13')]);return _0x442fdd(_0x1c85e7[_0x0d78('0x12')][_0x0d78('0x13')]);}else{logger[_0x0d78('0xe')](_0x0d78('0xf'),_0x30c33e,_0x0d78('0x10'));_0x442fdd(_0x1c85e7[_0x0d78('0x14')]['message']);}})[_0x0d78('0x15')](function(_0x4a4a7f){logger['error'](_0x0d78('0xf'),_0x30c33e,_0x4a4a7f);_0x123fad(_0x4a4a7f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index eef83a7..1b6d4d4 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 _0xd44b=['delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','show','post','isAuthenticated','create','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd44b,0xca));var _0xbd44=function(_0x5dc3bf,_0x158160){_0x5dc3bf=_0x5dc3bf-0x0;var _0x12e87a=_0xd44b[_0x5dc3bf];return _0x12e87a;};'use strict';var multer=require(_0xbd44('0x0'));var util=require('util');var path=require(_0xbd44('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd44('0x2'));var router=express[_0xbd44('0x3')]();var fs_extra=require(_0xbd44('0x4'));var auth=require(_0xbd44('0x5'));var interaction=require(_0xbd44('0x6'));var config=require(_0xbd44('0x7'));var controller=require(_0xbd44('0x8'));router[_0xbd44('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd44('0xa')]);router['get'](_0xbd44('0xb'),auth['isAuthenticated'](),controller[_0xbd44('0xc')]);router[_0xbd44('0xd')]('/',auth[_0xbd44('0xe')](),controller[_0xbd44('0xf')]);router[_0xbd44('0x10')](_0xbd44('0xb'),auth[_0xbd44('0xe')](),controller[_0xbd44('0x11')]);router[_0xbd44('0x12')](_0xbd44('0xb'),auth[_0xbd44('0xe')](),controller[_0xbd44('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb08f=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x2b5700,_0x3fd55e){var _0x36dcb1=function(_0x275ce9){while(--_0x275ce9){_0x2b5700['push'](_0x2b5700['shift']());}};_0x36dcb1(++_0x3fd55e);}(_0xb08f,0x11b));var _0xfb08=function(_0x1a250c,_0xead255){_0x1a250c=_0x1a250c-0x0;var _0x2270d9=_0xb08f[_0x1a250c];return _0x2270d9;};'use strict';var multer=require('multer');var util=require(_0xfb08('0x0'));var path=require(_0xfb08('0x1'));var timeout=require(_0xfb08('0x2'));var express=require('express');var router=express[_0xfb08('0x3')]();var fs_extra=require(_0xfb08('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb08('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xfb08('0x6')]('/',auth[_0xfb08('0x7')](),controller[_0xfb08('0x8')]);router[_0xfb08('0x6')](_0xfb08('0x9'),auth[_0xfb08('0x7')](),controller[_0xfb08('0xa')]);router[_0xfb08('0xb')]('/',auth['isAuthenticated'](),controller[_0xfb08('0xc')]);router[_0xfb08('0xd')](_0xfb08('0x9'),auth[_0xfb08('0x7')](),controller[_0xfb08('0xe')]);router['delete'](_0xfb08('0x9'),auth[_0xfb08('0x7')](),controller['destroy']);module[_0xfb08('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 4ba86d1..cf39f6f 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 _0x1b3e=['STRING','ENUM','string','customVariable','sequelize','exports','variable','keyValue','picklist'];(function(_0x391a7a,_0x582091){var _0x388ca0=function(_0x3cdfbb){while(--_0x3cdfbb){_0x391a7a['push'](_0x391a7a['shift']());}};_0x388ca0(++_0x582091);}(_0x1b3e,0x148));var _0xe1b3=function(_0xbc9ed4,_0x43b239){_0xbc9ed4=_0xbc9ed4-0x0;var _0xed4ec5=_0x1b3e[_0xbc9ed4];return _0xed4ec5;};'use strict';var Sequelize=require(_0xe1b3('0x0'));module[_0xe1b3('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xe1b3('0x2'),'customVariable',_0xe1b3('0x3'),_0xe1b3('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe1b3('0x5')]},'key':{'type':Sequelize[_0xe1b3('0x5')]},'keyType':{'type':Sequelize[_0xe1b3('0x6')](_0xe1b3('0x7'),_0xe1b3('0x2'),_0xe1b3('0x8'))},'keyContent':{'type':Sequelize[_0xe1b3('0x5')]},'idField':{'type':Sequelize[_0xe1b3('0x5')]},'nameField':{'type':Sequelize[_0xe1b3('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe1b3('0x5')]}}; \ No newline at end of file +var _0xc396=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','STRING'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xc396,0x139));var _0x6c39=function(_0x21f05d,_0x5e8c44){_0x21f05d=_0x21f05d-0x0;var _0x444e08=_0xc396[_0x21f05d];return _0x444e08;};'use strict';var Sequelize=require(_0x6c39('0x0'));module[_0x6c39('0x1')]={'type':{'type':Sequelize[_0x6c39('0x2')](_0x6c39('0x3'),_0x6c39('0x4'),_0x6c39('0x5'),'keyValue','picklist'),'defaultValue':_0x6c39('0x3')},'content':{'type':Sequelize[_0x6c39('0x6')]},'key':{'type':Sequelize[_0x6c39('0x6')]},'keyType':{'type':Sequelize[_0x6c39('0x2')](_0x6c39('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x6c39('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6c39('0x6')]},'customField':{'type':Sequelize[_0x6c39('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6c39('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 394af55..2c7708a 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 _0x0774=['Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','json','offset','undefined','limit','count'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0774,0x1ee));var _0x4077=function(_0x33bb07,_0x5b1849){_0x33bb07=_0x33bb07-0x0;var _0x481c81=_0x0774[_0x33bb07];return _0x481c81;};'use strict';var emlformat=require(_0x4077('0x0'));var rimraf=require(_0x4077('0x1'));var zipdir=require(_0x4077('0x2'));var jsonpatch=require(_0x4077('0x3'));var rp=require(_0x4077('0x4'));var moment=require('moment');var BPromise=require(_0x4077('0x5'));var Mustache=require('mustache');var util=require(_0x4077('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4077('0x7'));var fs=require('fs');var fs_extra=require(_0x4077('0x8'));var _=require('lodash');var squel=require(_0x4077('0x9'));var crypto=require(_0x4077('0xa'));var jsforce=require(_0x4077('0xb'));var deskjs=require(_0x4077('0xc'));var toCsv=require(_0x4077('0xd'));var querystring=require(_0x4077('0xe'));var Papa=require(_0x4077('0xf'));var Redis=require(_0x4077('0x10'));var authService=require(_0x4077('0x11'));var qs=require(_0x4077('0x12'));var as=require(_0x4077('0x13'));var hardwareService=require(_0x4077('0x14'));var logger=require('../../config/logger')(_0x4077('0x15'));var utils=require(_0x4077('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4077('0x17'))['db'];function respondWithStatusCode(_0x406f66,_0x4e0349){_0x4e0349=_0x4e0349||0xcc;return function(_0x4674fe){if(_0x4674fe){return _0x406f66['sendStatus'](_0x4e0349);}return _0x406f66['status'](_0x4e0349)[_0x4077('0x18')]();};}function respondWithResult(_0x5e19e6,_0x26b009){_0x26b009=_0x26b009||0xc8;return function(_0x3539bc){if(_0x3539bc){return _0x5e19e6[_0x4077('0x19')](_0x26b009)[_0x4077('0x1a')](_0x3539bc);}};}function respondWithFilteredResult(_0x4f0137,_0x31632a){return function(_0x1f71f6){if(_0x1f71f6){var _0x450035=typeof _0x31632a[_0x4077('0x1b')]===_0x4077('0x1c')&&typeof _0x31632a[_0x4077('0x1d')]===_0x4077('0x1c');var _0x3ce54c=_0x1f71f6['count'];var _0x2933b4=_0x450035?0x0:_0x31632a[_0x4077('0x1b')];var _0x3a64a2=_0x450035?_0x1f71f6[_0x4077('0x1e')]:_0x31632a[_0x4077('0x1b')]+_0x31632a['limit'];var _0x6b7da9;if(_0x3a64a2>=_0x3ce54c){_0x3a64a2=_0x3ce54c;_0x6b7da9=0xc8;}else{_0x6b7da9=0xce;}_0x4f0137[_0x4077('0x19')](_0x6b7da9);return _0x4f0137['set'](_0x4077('0x1f'),_0x2933b4+'-'+_0x3a64a2+'/'+_0x3ce54c)[_0x4077('0x1a')](_0x1f71f6);}return null;};}function patchUpdates(_0x4e0844){return function(_0x28675d){try{jsonpatch['apply'](_0x28675d,_0x4e0844,!![]);}catch(_0x4b423d){return BPromise[_0x4077('0x20')](_0x4b423d);}return _0x28675d[_0x4077('0x21')]();};}function saveUpdates(_0xad62dd,_0x477b27){return function(_0x1faa79){if(_0x1faa79){return _0x1faa79[_0x4077('0x22')](_0xad62dd)['then'](function(_0x5eea35){return _0x5eea35;});}return null;};}function removeEntity(_0x5696fd,_0x37d36e){return function(_0x4972ea){if(_0x4972ea){return _0x4972ea['destroy']()[_0x4077('0x23')](function(){_0x5696fd[_0x4077('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24cde9,_0x3ed7b8){return function(_0x307966){if(!_0x307966){_0x24cde9[_0x4077('0x24')](0x194);}return _0x307966;};}function handleError(_0x3ed14c,_0x60c850){_0x60c850=_0x60c850||0x1f4;return function(_0x1d769e){logger[_0x4077('0x25')](_0x1d769e[_0x4077('0x26')]);if(_0x1d769e[_0x4077('0x27')]){delete _0x1d769e[_0x4077('0x27')];}_0x3ed14c['status'](_0x60c850)[_0x4077('0x28')](_0x1d769e);};}exports[_0x4077('0x29')]=function(_0xff0cf9,_0x55b55a){var _0x5e949d={},_0x5532ed={},_0x7d5a01={'count':0x0,'rows':[]};var _0x1207b4=_[_0x4077('0x2a')](db[_0x4077('0x2b')][_0x4077('0x2c')],function(_0xc57490){return{'name':_0xc57490[_0x4077('0x2d')],'type':_0xc57490[_0x4077('0x2e')][_0x4077('0x2f')]};});_0x5532ed[_0x4077('0x30')]=_[_0x4077('0x2a')](_0x1207b4,'name');_0x5532ed[_0x4077('0x31')]=_[_0x4077('0x32')](_0xff0cf9[_0x4077('0x31')]);_0x5532ed['filters']=_[_0x4077('0x33')](_0x5532ed[_0x4077('0x30')],_0x5532ed[_0x4077('0x31')]);_0x5e949d[_0x4077('0x34')]=_[_0x4077('0x33')](_0x5532ed[_0x4077('0x30')],qs[_0x4077('0x35')](_0xff0cf9[_0x4077('0x31')]['fields']));_0x5e949d['attributes']=_0x5e949d[_0x4077('0x34')]['length']?_0x5e949d['attributes']:_0x5532ed[_0x4077('0x30')];if(!_0xff0cf9[_0x4077('0x31')]['hasOwnProperty'](_0x4077('0x36'))){_0x5e949d[_0x4077('0x1d')]=qs['limit'](_0xff0cf9['query'][_0x4077('0x1d')]);_0x5e949d['offset']=qs[_0x4077('0x1b')](_0xff0cf9[_0x4077('0x31')][_0x4077('0x1b')]);}_0x5e949d[_0x4077('0x37')]=qs[_0x4077('0x38')](_0xff0cf9['query'][_0x4077('0x38')]);_0x5e949d[_0x4077('0x39')]=qs[_0x4077('0x3a')](_['pick'](_0xff0cf9[_0x4077('0x31')],_0x5532ed['filters']),_0x1207b4);if(_0xff0cf9[_0x4077('0x31')]['filter']){_0x5e949d[_0x4077('0x39')]=_[_0x4077('0x3b')](_0x5e949d[_0x4077('0x39')],{'$or':_['map'](_0x1207b4,function(_0xe6f6f5){if(_0xe6f6f5[_0x4077('0x2e')]!==_0x4077('0x3c')){var _0x43a3d8={};_0x43a3d8[_0xe6f6f5[_0x4077('0x27')]]={'$like':'%'+_0xff0cf9[_0x4077('0x31')][_0x4077('0x3d')]+'%'};return _0x43a3d8;}})});}_0x5e949d=_[_0x4077('0x3b')]({},_0x5e949d,_0xff0cf9[_0x4077('0x3e')]);var _0x96cd39={'where':_0x5e949d[_0x4077('0x39')]};return db[_0x4077('0x2b')][_0x4077('0x1e')](_0x96cd39)[_0x4077('0x23')](function(_0x175801){_0x7d5a01[_0x4077('0x1e')]=_0x175801;if(_0xff0cf9[_0x4077('0x31')][_0x4077('0x3f')]){_0x5e949d[_0x4077('0x40')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x4077('0x41')](_0x5e949d);})['then'](function(_0x1db127){_0x7d5a01[_0x4077('0x42')]=_0x1db127;return _0x7d5a01;})[_0x4077('0x23')](respondWithFilteredResult(_0x55b55a,_0x5e949d))['catch'](handleError(_0x55b55a,null));};exports[_0x4077('0x43')]=function(_0x5ec75f,_0x5eaea8){var _0x5c20cd={'raw':!![],'where':{'id':_0x5ec75f['params']['id']}},_0x488562={};_0x488562[_0x4077('0x30')]=_[_0x4077('0x32')](db[_0x4077('0x2b')][_0x4077('0x2c')]);_0x488562['query']=_[_0x4077('0x32')](_0x5ec75f['query']);_0x488562[_0x4077('0x3a')]=_[_0x4077('0x33')](_0x488562['model'],_0x488562[_0x4077('0x31')]);_0x5c20cd[_0x4077('0x34')]=_[_0x4077('0x33')](_0x488562['model'],qs['fields'](_0x5ec75f[_0x4077('0x31')][_0x4077('0x35')]));_0x5c20cd['attributes']=_0x5c20cd[_0x4077('0x34')][_0x4077('0x44')]?_0x5c20cd[_0x4077('0x34')]:_0x488562[_0x4077('0x30')];if(_0x5ec75f[_0x4077('0x31')]['includeAll']){_0x5c20cd[_0x4077('0x40')]=[{'all':!![]}];}_0x5c20cd=_[_0x4077('0x3b')]({},_0x5c20cd,_0x5ec75f[_0x4077('0x3e')]);return db[_0x4077('0x2b')][_0x4077('0x45')](_0x5c20cd)[_0x4077('0x23')](handleEntityNotFound(_0x5eaea8,null))[_0x4077('0x23')](respondWithResult(_0x5eaea8,null))[_0x4077('0x46')](handleError(_0x5eaea8,null));};exports[_0x4077('0x47')]=function(_0x97a6e1,_0x2fd525){return db[_0x4077('0x2b')]['create'](_0x97a6e1['body'],{})['then'](respondWithResult(_0x2fd525,0xc9))['catch'](handleError(_0x2fd525,null));};exports['update']=function(_0x4758fd,_0x2c781e){if(_0x4758fd[_0x4077('0x48')]['id']){delete _0x4758fd[_0x4077('0x48')]['id'];}return db[_0x4077('0x2b')][_0x4077('0x45')]({'where':{'id':_0x4758fd[_0x4077('0x49')]['id']}})['then'](handleEntityNotFound(_0x2c781e,null))[_0x4077('0x23')](saveUpdates(_0x4758fd[_0x4077('0x48')],null))[_0x4077('0x23')](respondWithResult(_0x2c781e,null))[_0x4077('0x46')](handleError(_0x2c781e,null));};exports[_0x4077('0x4a')]=function(_0x2ea613,_0x3dfbe7){return db['Dynamics365Field'][_0x4077('0x45')]({'where':{'id':_0x2ea613[_0x4077('0x49')]['id']}})['then'](handleEntityNotFound(_0x3dfbe7,null))[_0x4077('0x23')](removeEntity(_0x3dfbe7,null))[_0x4077('0x46')](handleError(_0x3dfbe7,null));}; \ No newline at end of file +var _0x45a9=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','Dynamics365Field','includeAll','include','catch','show','params','merge','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','index','rawAttributes','type','key','model','map','query','keys'];(function(_0x3a6d6c,_0x58ca98){var _0x2cef90=function(_0xa5703f){while(--_0xa5703f){_0x3a6d6c['push'](_0x3a6d6c['shift']());}};_0x2cef90(++_0x58ca98);}(_0x45a9,0xaf));var _0x945a=function(_0x370ee6,_0x328749){_0x370ee6=_0x370ee6-0x0;var _0x30272b=_0x45a9[_0x370ee6];return _0x30272b;};'use strict';var emlformat=require(_0x945a('0x0'));var rimraf=require(_0x945a('0x1'));var zipdir=require(_0x945a('0x2'));var jsonpatch=require(_0x945a('0x3'));var rp=require(_0x945a('0x4'));var moment=require('moment');var BPromise=require(_0x945a('0x5'));var Mustache=require(_0x945a('0x6'));var util=require(_0x945a('0x7'));var path=require(_0x945a('0x8'));var sox=require(_0x945a('0x9'));var csv=require(_0x945a('0xa'));var ejs=require(_0x945a('0xb'));var fs=require('fs');var fs_extra=require(_0x945a('0xc'));var _=require(_0x945a('0xd'));var squel=require('squel');var crypto=require(_0x945a('0xe'));var jsforce=require(_0x945a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x945a('0xa'));var querystring=require(_0x945a('0x10'));var Papa=require('papaparse');var Redis=require(_0x945a('0x11'));var authService=require(_0x945a('0x12'));var qs=require(_0x945a('0x13'));var as=require(_0x945a('0x14'));var hardwareService=require(_0x945a('0x15'));var logger=require(_0x945a('0x16'))(_0x945a('0x17'));var utils=require(_0x945a('0x18'));var config=require(_0x945a('0x19'));var licenseUtil=require(_0x945a('0x1a'));var db=require(_0x945a('0x1b'))['db'];function respondWithStatusCode(_0x17f236,_0xa1d4f2){_0xa1d4f2=_0xa1d4f2||0xcc;return function(_0x26432d){if(_0x26432d){return _0x17f236[_0x945a('0x1c')](_0xa1d4f2);}return _0x17f236[_0x945a('0x1d')](_0xa1d4f2)[_0x945a('0x1e')]();};}function respondWithResult(_0x12ef37,_0x26d8b7){_0x26d8b7=_0x26d8b7||0xc8;return function(_0x1a9d0a){if(_0x1a9d0a){return _0x12ef37['status'](_0x26d8b7)[_0x945a('0x1f')](_0x1a9d0a);}};}function respondWithFilteredResult(_0x934713,_0xda44ca){return function(_0x51fb0a){if(_0x51fb0a){var _0x1c8dd3=typeof _0xda44ca[_0x945a('0x20')]===_0x945a('0x21')&&typeof _0xda44ca[_0x945a('0x22')]===_0x945a('0x21');var _0x3c0b99=_0x51fb0a[_0x945a('0x23')];var _0x2403ca=_0x1c8dd3?0x0:_0xda44ca['offset'];var _0x5b8b58=_0x1c8dd3?_0x51fb0a[_0x945a('0x23')]:_0xda44ca[_0x945a('0x20')]+_0xda44ca[_0x945a('0x22')];var _0x58afb0;if(_0x5b8b58>=_0x3c0b99){_0x5b8b58=_0x3c0b99;_0x58afb0=0xc8;}else{_0x58afb0=0xce;}_0x934713[_0x945a('0x1d')](_0x58afb0);return _0x934713[_0x945a('0x24')]('Content-Range',_0x2403ca+'-'+_0x5b8b58+'/'+_0x3c0b99)[_0x945a('0x1f')](_0x51fb0a);}return null;};}function patchUpdates(_0x5c11ff){return function(_0x3010f0){try{jsonpatch[_0x945a('0x25')](_0x3010f0,_0x5c11ff,!![]);}catch(_0x27e0f0){return BPromise[_0x945a('0x26')](_0x27e0f0);}return _0x3010f0[_0x945a('0x27')]();};}function saveUpdates(_0x42ae25,_0x46ef72){return function(_0x47605b){if(_0x47605b){return _0x47605b[_0x945a('0x28')](_0x42ae25)[_0x945a('0x29')](function(_0x54c970){return _0x54c970;});}return null;};}function removeEntity(_0x53a988,_0x45ed74){return function(_0x50aaf1){if(_0x50aaf1){return _0x50aaf1[_0x945a('0x2a')]()[_0x945a('0x29')](function(){_0x53a988[_0x945a('0x1d')](0xcc)[_0x945a('0x1e')]();});}};}function handleEntityNotFound(_0xa32a25,_0x295fad){return function(_0x1927f6){if(!_0x1927f6){_0xa32a25[_0x945a('0x1c')](0x194);}return _0x1927f6;};}function handleError(_0x1d3341,_0x103025){_0x103025=_0x103025||0x1f4;return function(_0x48c477){logger['error'](_0x48c477[_0x945a('0x2b')]);if(_0x48c477[_0x945a('0x2c')]){delete _0x48c477[_0x945a('0x2c')];}_0x1d3341[_0x945a('0x1d')](_0x103025)['send'](_0x48c477);};}exports[_0x945a('0x2d')]=function(_0x173ffc,_0x1ae920){var _0x4b4cd7={},_0x24dece={},_0x169e8c={'count':0x0,'rows':[]};var _0x2bac30=_['map'](db['Dynamics365Field'][_0x945a('0x2e')],function(_0x496f63){return{'name':_0x496f63['fieldName'],'type':_0x496f63[_0x945a('0x2f')][_0x945a('0x30')]};});_0x24dece[_0x945a('0x31')]=_[_0x945a('0x32')](_0x2bac30,_0x945a('0x2c'));_0x24dece[_0x945a('0x33')]=_[_0x945a('0x34')](_0x173ffc[_0x945a('0x33')]);_0x24dece[_0x945a('0x35')]=_['intersection'](_0x24dece[_0x945a('0x31')],_0x24dece['query']);_0x4b4cd7[_0x945a('0x36')]=_[_0x945a('0x37')](_0x24dece[_0x945a('0x31')],qs[_0x945a('0x38')](_0x173ffc[_0x945a('0x33')][_0x945a('0x38')]));_0x4b4cd7[_0x945a('0x36')]=_0x4b4cd7['attributes'][_0x945a('0x39')]?_0x4b4cd7['attributes']:_0x24dece[_0x945a('0x31')];if(!_0x173ffc['query'][_0x945a('0x3a')](_0x945a('0x3b'))){_0x4b4cd7[_0x945a('0x22')]=qs[_0x945a('0x22')](_0x173ffc['query'][_0x945a('0x22')]);_0x4b4cd7[_0x945a('0x20')]=qs[_0x945a('0x20')](_0x173ffc['query'][_0x945a('0x20')]);}_0x4b4cd7[_0x945a('0x3c')]=qs[_0x945a('0x3d')](_0x173ffc[_0x945a('0x33')][_0x945a('0x3d')]);_0x4b4cd7[_0x945a('0x3e')]=qs[_0x945a('0x35')](_[_0x945a('0x3f')](_0x173ffc[_0x945a('0x33')],_0x24dece[_0x945a('0x35')]),_0x2bac30);if(_0x173ffc[_0x945a('0x33')][_0x945a('0x40')]){_0x4b4cd7[_0x945a('0x3e')]=_['merge'](_0x4b4cd7[_0x945a('0x3e')],{'$or':_[_0x945a('0x32')](_0x2bac30,function(_0x3fc16b){if(_0x3fc16b[_0x945a('0x2f')]!=='VIRTUAL'){var _0x2ace32={};_0x2ace32[_0x3fc16b['name']]={'$like':'%'+_0x173ffc[_0x945a('0x33')][_0x945a('0x40')]+'%'};return _0x2ace32;}})});}_0x4b4cd7=_['merge']({},_0x4b4cd7,_0x173ffc['options']);var _0x5a78a6={'where':_0x4b4cd7[_0x945a('0x3e')]};return db[_0x945a('0x41')][_0x945a('0x23')](_0x5a78a6)[_0x945a('0x29')](function(_0x35f900){_0x169e8c['count']=_0x35f900;if(_0x173ffc[_0x945a('0x33')][_0x945a('0x42')]){_0x4b4cd7[_0x945a('0x43')]=[{'all':!![]}];}return db[_0x945a('0x41')]['findAll'](_0x4b4cd7);})[_0x945a('0x29')](function(_0xa607a7){_0x169e8c['rows']=_0xa607a7;return _0x169e8c;})[_0x945a('0x29')](respondWithFilteredResult(_0x1ae920,_0x4b4cd7))[_0x945a('0x44')](handleError(_0x1ae920,null));};exports[_0x945a('0x45')]=function(_0x9d75b9,_0x5dac6b){var _0x2e5fe4={'raw':!![],'where':{'id':_0x9d75b9[_0x945a('0x46')]['id']}},_0x1378d4={};_0x1378d4[_0x945a('0x31')]=_['keys'](db[_0x945a('0x41')][_0x945a('0x2e')]);_0x1378d4[_0x945a('0x33')]=_[_0x945a('0x34')](_0x9d75b9[_0x945a('0x33')]);_0x1378d4[_0x945a('0x35')]=_[_0x945a('0x37')](_0x1378d4['model'],_0x1378d4['query']);_0x2e5fe4[_0x945a('0x36')]=_[_0x945a('0x37')](_0x1378d4['model'],qs['fields'](_0x9d75b9[_0x945a('0x33')][_0x945a('0x38')]));_0x2e5fe4[_0x945a('0x36')]=_0x2e5fe4['attributes'][_0x945a('0x39')]?_0x2e5fe4['attributes']:_0x1378d4['model'];if(_0x9d75b9[_0x945a('0x33')][_0x945a('0x42')]){_0x2e5fe4[_0x945a('0x43')]=[{'all':!![]}];}_0x2e5fe4=_[_0x945a('0x47')]({},_0x2e5fe4,_0x9d75b9[_0x945a('0x48')]);return db[_0x945a('0x41')][_0x945a('0x49')](_0x2e5fe4)[_0x945a('0x29')](handleEntityNotFound(_0x5dac6b,null))['then'](respondWithResult(_0x5dac6b,null))['catch'](handleError(_0x5dac6b,null));};exports['create']=function(_0x26895e,_0x1b39a5){return db[_0x945a('0x41')][_0x945a('0x4a')](_0x26895e[_0x945a('0x4b')],{})[_0x945a('0x29')](respondWithResult(_0x1b39a5,0xc9))[_0x945a('0x44')](handleError(_0x1b39a5,null));};exports[_0x945a('0x28')]=function(_0x170dfb,_0x368ce6){if(_0x170dfb[_0x945a('0x4b')]['id']){delete _0x170dfb[_0x945a('0x4b')]['id'];}return db['Dynamics365Field'][_0x945a('0x49')]({'where':{'id':_0x170dfb[_0x945a('0x46')]['id']}})[_0x945a('0x29')](handleEntityNotFound(_0x368ce6,null))[_0x945a('0x29')](saveUpdates(_0x170dfb['body'],null))[_0x945a('0x29')](respondWithResult(_0x368ce6,null))[_0x945a('0x44')](handleError(_0x368ce6,null));};exports[_0x945a('0x2a')]=function(_0x3b80c4,_0x31c709){return db[_0x945a('0x41')][_0x945a('0x49')]({'where':{'id':_0x3b80c4[_0x945a('0x46')]['id']}})[_0x945a('0x29')](handleEntityNotFound(_0x31c709,null))[_0x945a('0x29')](removeEntity(_0x31c709,null))[_0x945a('0x44')](handleError(_0x31c709,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index fa64492..0f9db2b 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 _0x635a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index','lodash'];(function(_0x579d12,_0x4e0d07){var _0x38188d=function(_0x8a7f7b){while(--_0x8a7f7b){_0x579d12['push'](_0x579d12['shift']());}};_0x38188d(++_0x4e0d07);}(_0x635a,0xb3));var _0xa635=function(_0x76be84,_0x5e7b73){_0x76be84=_0x76be84-0x0;var _0x25a10b=_0x635a[_0x76be84];return _0x25a10b;};'use strict';var _=require(_0xa635('0x0'));var util=require('util');var logger=require(_0xa635('0x1'))(_0xa635('0x2'));var moment=require(_0xa635('0x3'));var BPromise=require('bluebird');var rp=require(_0xa635('0x4'));var fs=require('fs');var path=require(_0xa635('0x5'));var rimraf=require(_0xa635('0x6'));var config=require(_0xa635('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0xa635('0x8')]=function(_0x75348a,_0x4a79bf){return _0x75348a[_0xa635('0x9')]('Dynamics365Field',attributes,{'tableName':_0xa635('0xa'),'paranoid':![],'indexes':[{'name':_0xa635('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53fb=['FieldId','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','idField'];(function(_0x158083,_0x495c01){var _0x22a357=function(_0x4056bd){while(--_0x4056bd){_0x158083['push'](_0x158083['shift']());}};_0x22a357(++_0x495c01);}(_0x53fb,0xbc));var _0xb53f=function(_0x2048bc,_0x11b240){_0x2048bc=_0x2048bc-0x0;var _0x1511d2=_0x53fb[_0x2048bc];return _0x1511d2;};'use strict';var _=require(_0xb53f('0x0'));var util=require(_0xb53f('0x1'));var logger=require(_0xb53f('0x2'))(_0xb53f('0x3'));var moment=require('moment');var BPromise=require(_0xb53f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb53f('0x5'));var config=require(_0xb53f('0x6'));var attributes=require(_0xb53f('0x7'));module['exports']=function(_0xd0a758,_0x51af7e){return _0xd0a758['define'](_0xb53f('0x8'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xb53f('0x9'),_0xb53f('0xa')],'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 539c3ba..645b105 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 _0x64a8=['Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s'];(function(_0x13f2ec,_0x407206){var _0x389ca9=function(_0x43d7d6){while(--_0x43d7d6){_0x13f2ec['push'](_0x13f2ec['shift']());}};_0x389ca9(++_0x407206);}(_0x64a8,0x10a));var _0x864a=function(_0x37133a,_0x4b4ec4){_0x37133a=_0x37133a-0x0;var _0x54ae89=_0x64a8[_0x37133a];return _0x54ae89;};'use strict';var _=require(_0x864a('0x0'));var util=require(_0x864a('0x1'));var moment=require('moment');var BPromise=require(_0x864a('0x2'));var rs=require(_0x864a('0x3'));var fs=require('fs');var Redis=require(_0x864a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x864a('0x5'));var logger=require(_0x864a('0x6'))(_0x864a('0x7'));var config=require(_0x864a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x864a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3162f2,_0x4c4b81,_0x520c03){return new BPromise(function(_0x4f3668,_0x17270c){return client[_0x864a('0xa')](_0x3162f2,_0x520c03)[_0x864a('0xb')](function(_0x404f69){logger[_0x864a('0xc')](_0x864a('0xd'),_0x4c4b81,'request\x20sent');logger['debug'](_0x864a('0xe'),_0x4c4b81,'request\x20sent',JSON['stringify'](_0x404f69));if(_0x404f69[_0x864a('0xf')]){if(_0x404f69[_0x864a('0xf')][_0x864a('0x10')]===0x1f4){logger[_0x864a('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x4c4b81,_0x404f69[_0x864a('0xf')][_0x864a('0x11')]);return _0x17270c(_0x404f69['error']['message']);}logger[_0x864a('0xf')](_0x864a('0xd'),_0x4c4b81,_0x404f69[_0x864a('0xf')][_0x864a('0x11')]);return _0x4f3668(_0x404f69[_0x864a('0xf')]['message']);}else{logger[_0x864a('0xc')](_0x864a('0xd'),_0x4c4b81,_0x864a('0x12'));_0x4f3668(_0x404f69['result']['message']);}})[_0x864a('0x13')](function(_0x556187){logger[_0x864a('0xf')](_0x864a('0xd'),_0x4c4b81,_0x556187);_0x17270c(_0x556187);});});} \ No newline at end of file +var _0x883e=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x883e,0x169));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe883('0x0'));var moment=require(_0xe883('0x1'));var BPromise=require(_0xe883('0x2'));var rs=require(_0xe883('0x3'));var fs=require('fs');var Redis=require(_0xe883('0x4'));var db=require(_0xe883('0x5'))['db'];var utils=require(_0xe883('0x6'));var logger=require('../../config/logger')(_0xe883('0x7'));var config=require(_0xe883('0x8'));var jayson=require(_0xe883('0x9'));var client=jayson[_0xe883('0xa')][_0xe883('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cd757,_0x5da3a9,_0x1cf6c5){return new BPromise(function(_0x30c2b8,_0x253a5c){return client['request'](_0x1cd757,_0x1cf6c5)[_0xe883('0xc')](function(_0x519e93){logger[_0xe883('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x5da3a9,_0xe883('0xe'));logger[_0xe883('0xf')](_0xe883('0x10'),_0x5da3a9,'request\x20sent',JSON[_0xe883('0x11')](_0x519e93));if(_0x519e93[_0xe883('0x12')]){if(_0x519e93[_0xe883('0x12')][_0xe883('0x13')]===0x1f4){logger[_0xe883('0x12')](_0xe883('0x14'),_0x5da3a9,_0x519e93[_0xe883('0x12')][_0xe883('0x15')]);return _0x253a5c(_0x519e93[_0xe883('0x12')]['message']);}logger['error'](_0xe883('0x14'),_0x5da3a9,_0x519e93[_0xe883('0x12')][_0xe883('0x15')]);return _0x30c2b8(_0x519e93[_0xe883('0x12')][_0xe883('0x15')]);}else{logger['info'](_0xe883('0x14'),_0x5da3a9,_0xe883('0xe'));_0x30c2b8(_0x519e93[_0xe883('0x16')]['message']);}})[_0xe883('0x17')](function(_0x21f12d){logger[_0xe883('0x12')](_0xe883('0x14'),_0x5da3a9,_0x21f12d);_0x253a5c(_0x21f12d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index c9bf4bf..35e3dfc 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 _0x74ad=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','index','/:id','isAuthenticated','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0xa69592,_0x571583){var _0x4c5ec5=function(_0x4c7050){while(--_0x4c7050){_0xa69592['push'](_0xa69592['shift']());}};_0x4c5ec5(++_0x571583);}(_0x74ad,0x16a));var _0xd74a=function(_0x57d11b,_0x2a4299){_0x57d11b=_0x57d11b-0x0;var _0x63ad6e=_0x74ad[_0x57d11b];return _0x63ad6e;};'use strict';var multer=require(_0xd74a('0x0'));var util=require(_0xd74a('0x1'));var path=require('path');var timeout=require(_0xd74a('0x2'));var express=require(_0xd74a('0x3'));var router=express['Router']();var fs_extra=require(_0xd74a('0x4'));var auth=require(_0xd74a('0x5'));var interaction=require(_0xd74a('0x6'));var config=require('../../config/environment');var controller=require(_0xd74a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd74a('0x8')]);router['get'](_0xd74a('0x9'),auth[_0xd74a('0xa')](),controller['show']);router['get']('/:id/configurations',auth[_0xd74a('0xa')](),controller['getConfigurations']);router['get'](_0xd74a('0xb'),auth['isAuthenticated'](),controller[_0xd74a('0xc')]);router[_0xd74a('0xd')]('/',auth[_0xd74a('0xa')](),controller[_0xd74a('0xe')]);router[_0xd74a('0xd')](_0xd74a('0xf'),auth[_0xd74a('0xa')](),controller['addConfiguration']);router[_0xd74a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd74a('0x11')]);router[_0xd74a('0x12')](_0xd74a('0x9'),auth[_0xd74a('0xa')](),controller[_0xd74a('0x13')]);module[_0xd74a('0x14')]=router; \ No newline at end of file +var _0x0b10=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util'];(function(_0x3512e6,_0x2dba9b){var _0x512c41=function(_0x2bbd24){while(--_0x2bbd24){_0x3512e6['push'](_0x3512e6['shift']());}};_0x512c41(++_0x2dba9b);}(_0x0b10,0x1a7));var _0x00b1=function(_0x3e7165,_0x7b3c7e){_0x3e7165=_0x3e7165-0x0;var _0x31cefd=_0x0b10[_0x3e7165];return _0x31cefd;};'use strict';var multer=require(_0x00b1('0x0'));var util=require(_0x00b1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x00b1('0x2'));var router=express[_0x00b1('0x3')]();var fs_extra=require(_0x00b1('0x4'));var auth=require(_0x00b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x00b1('0x6'));var controller=require(_0x00b1('0x7'));router[_0x00b1('0x8')]('/',auth[_0x00b1('0x9')](),controller[_0x00b1('0xa')]);router[_0x00b1('0x8')](_0x00b1('0xb'),auth['isAuthenticated'](),controller[_0x00b1('0xc')]);router[_0x00b1('0x8')](_0x00b1('0xd'),auth[_0x00b1('0x9')](),controller[_0x00b1('0xe')]);router['get'](_0x00b1('0xf'),auth[_0x00b1('0x9')](),controller[_0x00b1('0x10')]);router[_0x00b1('0x11')]('/',auth['isAuthenticated'](),controller[_0x00b1('0x12')]);router[_0x00b1('0x11')](_0x00b1('0xd'),auth[_0x00b1('0x9')](),controller[_0x00b1('0x13')]);router[_0x00b1('0x14')](_0x00b1('0xb'),auth[_0x00b1('0x9')](),controller[_0x00b1('0x15')]);router[_0x00b1('0x16')](_0x00b1('0xb'),auth[_0x00b1('0x9')](),controller[_0x00b1('0x17')]);module[_0x00b1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c57b115..cd40d9d 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 _0x8603=['remoteUri','exports','STRING'];(function(_0x282164,_0x1ff15e){var _0x516680=function(_0x461b2d){while(--_0x461b2d){_0x282164['push'](_0x282164['shift']());}};_0x516680(++_0x1ff15e);}(_0x8603,0x190));var _0x3860=function(_0x5b1097,_0x3ed62f){_0x5b1097=_0x5b1097-0x0;var _0x57979c=_0x8603[_0x5b1097];return _0x57979c;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x2542,0x169));var _0x2254=function(_0x21e403,_0x40136e){_0x21e403=_0x21e403-0x0;var _0x329250=_0x2542[_0x21e403];return _0x329250;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('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 30a8ac0..24874d1 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 _0x69e6=['custom_text','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','FreshdeskAccount','rows','catch','keys','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','subject','agent','priority','group','source','ticket_type','remove','includes','default'];(function(_0x248e4b,_0x233ed4){var _0x3aad6f=function(_0x2e9b2d){while(--_0x2e9b2d){_0x248e4b['push'](_0x248e4b['shift']());}};_0x3aad6f(++_0x233ed4);}(_0x69e6,0x1e0));var _0x669e=function(_0x2dc1d1,_0x10e0e9){_0x2dc1d1=_0x2dc1d1-0x0;var _0x120bb6=_0x69e6[_0x2dc1d1];return _0x120bb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x669e('0x0'));var zipdir=require(_0x669e('0x1'));var jsonpatch=require(_0x669e('0x2'));var rp=require(_0x669e('0x3'));var moment=require(_0x669e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x669e('0x5'));var util=require(_0x669e('0x6'));var path=require(_0x669e('0x7'));var sox=require(_0x669e('0x8'));var csv=require(_0x669e('0x9'));var ejs=require(_0x669e('0xa'));var fs=require('fs');var fs_extra=require(_0x669e('0xb'));var _=require(_0x669e('0xc'));var squel=require(_0x669e('0xd'));var crypto=require(_0x669e('0xe'));var jsforce=require(_0x669e('0xf'));var deskjs=require(_0x669e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x669e('0x11'));var Papa=require(_0x669e('0x12'));var Redis=require(_0x669e('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x669e('0x14'));var logger=require(_0x669e('0x15'))(_0x669e('0x16'));var utils=require(_0x669e('0x17'));var config=require(_0x669e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x669e('0x19'));function respondWithStatusCode(_0x1a7ea7,_0x344b70){_0x344b70=_0x344b70||0xcc;return function(_0x12e4aa){if(_0x12e4aa){return _0x1a7ea7['sendStatus'](_0x344b70);}return _0x1a7ea7['status'](_0x344b70)[_0x669e('0x1a')]();};}function respondWithResult(_0x557e55,_0x2e53db){_0x2e53db=_0x2e53db||0xc8;return function(_0x409754){if(_0x409754){return _0x557e55[_0x669e('0x1b')](_0x2e53db)['json'](_0x409754);}};}function respondWithFilteredResult(_0x648035,_0x255d4e){return function(_0x150993){if(_0x150993){var _0x151f76=typeof _0x255d4e['offset']===_0x669e('0x1c')&&typeof _0x255d4e['limit']===_0x669e('0x1c');var _0x370a82=_0x150993[_0x669e('0x1d')];var _0x81cb19=_0x151f76?0x0:_0x255d4e[_0x669e('0x1e')];var _0x47b558=_0x151f76?_0x150993['count']:_0x255d4e[_0x669e('0x1e')]+_0x255d4e[_0x669e('0x1f')];var _0x498f9d;if(_0x47b558>=_0x370a82){_0x47b558=_0x370a82;_0x498f9d=0xc8;}else{_0x498f9d=0xce;}_0x648035[_0x669e('0x1b')](_0x498f9d);return _0x648035[_0x669e('0x20')](_0x669e('0x21'),_0x81cb19+'-'+_0x47b558+'/'+_0x370a82)[_0x669e('0x22')](_0x150993);}return null;};}function patchUpdates(_0x52d60e){return function(_0x30f7b5){try{jsonpatch[_0x669e('0x23')](_0x30f7b5,_0x52d60e,!![]);}catch(_0x5ca591){return BPromise[_0x669e('0x24')](_0x5ca591);}return _0x30f7b5[_0x669e('0x25')]();};}function saveUpdates(_0x40a590,_0x58c08f){return function(_0x145f8d){if(_0x145f8d){return _0x145f8d[_0x669e('0x26')](_0x40a590)[_0x669e('0x27')](function(_0xbe2acd){return _0xbe2acd;});}return null;};}function removeEntity(_0x2eab78,_0x2f8d20){return function(_0x1cd3f4){if(_0x1cd3f4){return _0x1cd3f4[_0x669e('0x28')]()['then'](function(){_0x2eab78['status'](0xcc)[_0x669e('0x1a')]();});}};}function handleEntityNotFound(_0x4e4500,_0x343c0a){return function(_0x5dad02){if(!_0x5dad02){_0x4e4500[_0x669e('0x29')](0x194);}return _0x5dad02;};}function handleError(_0x372ea3,_0x27fa45){_0x27fa45=_0x27fa45||0x1f4;return function(_0x3b25a5){logger[_0x669e('0x2a')](_0x3b25a5[_0x669e('0x2b')]);if(_0x3b25a5['name']){delete _0x3b25a5[_0x669e('0x2c')];}_0x372ea3[_0x669e('0x1b')](_0x27fa45)[_0x669e('0x2d')](_0x3b25a5);};}exports[_0x669e('0x2e')]=function(_0x5bf9b2,_0xe3281e){var _0x283651={},_0x20142d={},_0x295859={'count':0x0,'rows':[]};var _0x5e1980=_[_0x669e('0x2f')](db['FreshdeskAccount'][_0x669e('0x30')],function(_0x400d8f){return{'name':_0x400d8f[_0x669e('0x31')],'type':_0x400d8f[_0x669e('0x32')][_0x669e('0x33')]};});_0x20142d['model']=_[_0x669e('0x2f')](_0x5e1980,_0x669e('0x2c'));_0x20142d[_0x669e('0x34')]=_['keys'](_0x5bf9b2[_0x669e('0x34')]);_0x20142d[_0x669e('0x35')]=_[_0x669e('0x36')](_0x20142d[_0x669e('0x37')],_0x20142d['query']);_0x283651[_0x669e('0x38')]=_['intersection'](_0x20142d['model'],qs[_0x669e('0x39')](_0x5bf9b2[_0x669e('0x34')][_0x669e('0x39')]));_0x283651[_0x669e('0x38')]=_0x283651[_0x669e('0x38')][_0x669e('0x3a')]?_0x283651[_0x669e('0x38')]:_0x20142d[_0x669e('0x37')];if(!_0x5bf9b2['query']['hasOwnProperty']('nolimit')){_0x283651['limit']=qs[_0x669e('0x1f')](_0x5bf9b2[_0x669e('0x34')][_0x669e('0x1f')]);_0x283651[_0x669e('0x1e')]=qs[_0x669e('0x1e')](_0x5bf9b2[_0x669e('0x34')][_0x669e('0x1e')]);}_0x283651[_0x669e('0x3b')]=qs[_0x669e('0x3c')](_0x5bf9b2['query']['sort']);_0x283651['where']=qs[_0x669e('0x35')](_[_0x669e('0x3d')](_0x5bf9b2[_0x669e('0x34')],_0x20142d['filters']),_0x5e1980);if(_0x5bf9b2[_0x669e('0x34')][_0x669e('0x3e')]){_0x283651[_0x669e('0x3f')]=_['merge'](_0x283651['where'],{'$or':_['map'](_0x5e1980,function(_0x4a7549){if(_0x4a7549[_0x669e('0x32')]!==_0x669e('0x40')){var _0x4a349c={};_0x4a349c[_0x4a7549[_0x669e('0x2c')]]={'$like':'%'+_0x5bf9b2[_0x669e('0x34')]['filter']+'%'};return _0x4a349c;}})});}_0x283651=_[_0x669e('0x41')]({},_0x283651,_0x5bf9b2[_0x669e('0x42')]);var _0x102da5={'where':_0x283651[_0x669e('0x3f')]};return db['FreshdeskAccount'][_0x669e('0x1d')](_0x102da5)['then'](function(_0x112acf){_0x295859[_0x669e('0x1d')]=_0x112acf;if(_0x5bf9b2[_0x669e('0x34')][_0x669e('0x43')]){_0x283651[_0x669e('0x44')]=[{'all':!![]}];}return db[_0x669e('0x45')]['findAll'](_0x283651);})[_0x669e('0x27')](function(_0x2711bc){_0x295859[_0x669e('0x46')]=_0x2711bc;return _0x295859;})[_0x669e('0x27')](respondWithFilteredResult(_0xe3281e,_0x283651))[_0x669e('0x47')](handleError(_0xe3281e,null));};exports['show']=function(_0x46783f,_0x4eb087){var _0x54e2a9={'raw':![],'where':{'id':_0x46783f['params']['id']}},_0x4d4a42={};_0x4d4a42[_0x669e('0x37')]=_['keys'](db[_0x669e('0x45')][_0x669e('0x30')]);_0x4d4a42['query']=_[_0x669e('0x48')](_0x46783f['query']);_0x4d4a42[_0x669e('0x35')]=_[_0x669e('0x36')](_0x4d4a42['model'],_0x4d4a42['query']);_0x54e2a9[_0x669e('0x38')]=_[_0x669e('0x36')](_0x4d4a42[_0x669e('0x37')],qs[_0x669e('0x39')](_0x46783f['query'][_0x669e('0x39')]));_0x54e2a9[_0x669e('0x38')]=_0x54e2a9[_0x669e('0x38')][_0x669e('0x3a')]?_0x54e2a9[_0x669e('0x38')]:_0x4d4a42[_0x669e('0x37')];if(_0x46783f['query']['includeAll']){_0x54e2a9['include']=[{'all':!![]}];}_0x54e2a9=_['merge']({},_0x54e2a9,_0x46783f[_0x669e('0x42')]);return db[_0x669e('0x45')][_0x669e('0x49')](_0x54e2a9)['then'](handleEntityNotFound(_0x4eb087,null))['then'](respondWithResult(_0x4eb087,null))[_0x669e('0x47')](handleError(_0x4eb087,null));};exports[_0x669e('0x4a')]=function(_0xe23432,_0x28507e){return db[_0x669e('0x45')][_0x669e('0x4a')](_0xe23432['body'],{})[_0x669e('0x27')](respondWithResult(_0x28507e,0xc9))[_0x669e('0x47')](handleError(_0x28507e,null));};exports['update']=function(_0x11d2c8,_0x1eaf9f){if(_0x11d2c8[_0x669e('0x4b')]['id']){delete _0x11d2c8['body']['id'];}return db[_0x669e('0x45')][_0x669e('0x49')]({'where':{'id':_0x11d2c8[_0x669e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1eaf9f,null))[_0x669e('0x27')](saveUpdates(_0x11d2c8[_0x669e('0x4b')],null))[_0x669e('0x27')](respondWithResult(_0x1eaf9f,null))[_0x669e('0x47')](handleError(_0x1eaf9f,null));};exports['destroy']=function(_0x4e79c0,_0x1ec48d){return db['FreshdeskAccount']['find']({'where':{'id':_0x4e79c0[_0x669e('0x4c')]['id']}})[_0x669e('0x27')](handleEntityNotFound(_0x1ec48d,null))[_0x669e('0x27')](removeEntity(_0x1ec48d,null))[_0x669e('0x47')](handleError(_0x1ec48d,null));};exports[_0x669e('0x4d')]=function(_0x43921f,_0xdd2acf,_0x2c86d4){var _0x4225d6={};var _0xa71174={};var _0x5b9c4d;var _0x3169e7;return db[_0x669e('0x45')][_0x669e('0x4e')]({'where':{'id':_0x43921f[_0x669e('0x4c')]['id']}})[_0x669e('0x27')](handleEntityNotFound(_0xdd2acf,null))[_0x669e('0x27')](function(_0x29f05a){if(_0x29f05a){_0x5b9c4d=_0x29f05a;_0xa71174[_0x669e('0x37')]=_[_0x669e('0x48')](db[_0x669e('0x4f')][_0x669e('0x30')]);_0xa71174[_0x669e('0x34')]=_[_0x669e('0x48')](_0x43921f['query']);_0xa71174[_0x669e('0x35')]=_['intersection'](_0xa71174['model'],_0xa71174[_0x669e('0x34')]);_0x4225d6[_0x669e('0x38')]=_[_0x669e('0x36')](_0xa71174[_0x669e('0x37')],qs['fields'](_0x43921f[_0x669e('0x34')][_0x669e('0x39')]));_0x4225d6['attributes']=_0x4225d6[_0x669e('0x38')][_0x669e('0x3a')]?_0x4225d6[_0x669e('0x38')]:_0xa71174[_0x669e('0x37')];_0x4225d6[_0x669e('0x3b')]=qs['sort'](_0x43921f[_0x669e('0x34')][_0x669e('0x3c')]);_0x4225d6[_0x669e('0x3f')]=qs['filters'](_[_0x669e('0x3d')](_0x43921f[_0x669e('0x34')],_0xa71174[_0x669e('0x35')]));if(_0x43921f[_0x669e('0x34')][_0x669e('0x3e')]){_0x4225d6[_0x669e('0x3f')]=_[_0x669e('0x41')](_0x4225d6['where'],{'$or':_[_0x669e('0x2f')](_0x4225d6[_0x669e('0x38')],function(_0x4e9128){var _0x4f3306={};_0x4f3306[_0x4e9128]={'$like':'%'+_0x43921f[_0x669e('0x34')][_0x669e('0x3e')]+'%'};return _0x4f3306;})});}_0x4225d6=_[_0x669e('0x41')]({},_0x4225d6,_0x43921f[_0x669e('0x42')]);return _0x5b9c4d[_0x669e('0x4d')](_0x4225d6);}})[_0x669e('0x27')](function(_0x2162ba){if(_0x2162ba){_0x3169e7=_0x2162ba[_0x669e('0x3a')];if(!_0x43921f['query'][_0x669e('0x50')](_0x669e('0x51'))){_0x4225d6[_0x669e('0x1f')]=qs[_0x669e('0x1f')](_0x43921f[_0x669e('0x34')][_0x669e('0x1f')]);_0x4225d6[_0x669e('0x1e')]=qs['offset'](_0x43921f[_0x669e('0x34')][_0x669e('0x1e')]);}return _0x5b9c4d[_0x669e('0x4d')](_0x4225d6);}})[_0x669e('0x27')](function(_0x220e0d){if(_0x220e0d){return _0x220e0d?{'count':_0x3169e7,'rows':_0x220e0d}:null;}})['then'](respondWithResult(_0xdd2acf,null))['catch'](handleError(_0xdd2acf,null));};exports[_0x669e('0x52')]=function(_0x304332,_0x233942,_0x526212){if(_0x304332[_0x669e('0x4b')]['id']){delete _0x304332[_0x669e('0x4b')]['id'];}return db[_0x669e('0x45')][_0x669e('0x4e')]({'where':{'id':_0x304332['params']['id']}})[_0x669e('0x27')](handleEntityNotFound(_0x233942,null))['then'](function(_0x31b146){if(_0x31b146){_0x304332[_0x669e('0x4b')][_0x669e('0x53')]=_0x31b146['id'];_0x304332[_0x669e('0x4b')][_0x669e('0x54')]=integrations[_0x669e('0x55')](_0x304332['body'][_0x669e('0x56')],_0x304332['body'][_0x669e('0x32')]);_0x304332[_0x669e('0x4b')]['Descriptions']=integrations[_0x669e('0x57')](_0x304332[_0x669e('0x4b')][_0x669e('0x56')],_0x304332['body']['type']);return db[_0x669e('0x4f')][_0x669e('0x4a')](_0x304332[_0x669e('0x4b')],{'include':[{'model':db[_0x669e('0x58')],'as':_0x669e('0x54')},{'model':db['FreshdeskField'],'as':_0x669e('0x59')}]});}return null;})[_0x669e('0x27')](respondWithResult(_0x233942,null))[_0x669e('0x47')](handleError(_0x233942,null));};exports[_0x669e('0x5a')]=function(_0x417cdf,_0x26fb61,_0x228241){var _0x5b6336='';return db[_0x669e('0x45')][_0x669e('0x4e')]({'where':{'id':_0x417cdf[_0x669e('0x4c')]['id']},'attributes':['id',_0x669e('0x5b'),_0x669e('0x5c')]})[_0x669e('0x27')](handleEntityNotFound(_0x26fb61,null))[_0x669e('0x27')](function(_0x541148){if(_0x541148){_0x5b6336=_0x541148[_0x669e('0x5b')];var _0x482e2f=_0x5b6336[_0x669e('0x5d')](-0x1);if(_0x482e2f==='/'){_0x5b6336=_0x5b6336[_0x669e('0x5e')](0x0,_0x5b6336[_0x669e('0x5f')](_0x482e2f));}return rp({'method':_0x669e('0x60'),'uri':util['format'](_0x669e('0x61'),_0x5b6336,_0x669e('0x62')),'headers':{'Authorization':util[_0x669e('0x63')](_0x669e('0x64'),new Buffer(util[_0x669e('0x63')]('%s:X',_0x541148[_0x669e('0x5c')]))['toString']('base64'))},'json':!![]});}})[_0x669e('0x27')](function(_0x3f89ab){if(_0x3f89ab){var _0x2b2df9=['requester',_0x669e('0x65'),_0x669e('0x66'),'description',_0x669e('0x1b'),_0x669e('0x67'),_0x669e('0x68'),_0x669e('0x69'),_0x669e('0x6a'),_0x669e('0x68'),'company'];_[_0x669e('0x6b')](_0x3f89ab,function(_0x2dffdf){return _0x2b2df9[_0x669e('0x6c')](_0x2dffdf[_0x669e('0x2c')])||!_0x2dffdf[_0x669e('0x6d')]&&_0x2dffdf[_0x669e('0x32')]!==_0x669e('0x6e')&&_0x2dffdf[_0x669e('0x32')]!=='custom_dropdown';});return{'count':_0x3f89ab[_0x669e('0x3a')],'rows':_[_0x669e('0x2f')](_0x3f89ab,function(_0x4dadce){return{'id':_0x4dadce['name'],'name':_0x4dadce['label'],'custom':!_0x4dadce[_0x669e('0x6d')],'options':_0x4dadce[_0x669e('0x6f')]?_['map'](_0x4dadce[_0x669e('0x6f')],function(_0x55a4d9){return{'name':_[_0x669e('0x70')](_0x55a4d9),'value':_0x55a4d9};}):[]};})};}})[_0x669e('0x27')](respondWithResult(_0x26fb61,null))[_0x669e('0x47')](function(_0x3318b9){var _0x3442cc=_0x417cdf[_0x669e('0x34')]['test']?0x1f4:_0x3318b9[_0x669e('0x71')]||0x1f4;logger[_0x669e('0x2a')](_0x669e('0x72'),_0x669e('0x5a'),_0x3442cc,JSON[_0x669e('0x73')](_0x3318b9));delete _0x3318b9[_0x669e('0x2c')];if(_0x3442cc===0x191){_0x3442cc=0x190;}_0x26fb61[_0x669e('0x1b')](_0x3442cc)[_0x669e('0x2d')](_0x417cdf['query'][_0x669e('0x74')]?{'message':_0x669e('0x75'),'statusCode':_0x3318b9[_0x669e('0x71')]}:_0x3318b9);});}; \ No newline at end of file +var _0xef38=['include','findAll','show','keys','intersection','length','includeAll','find','catch','create','body','params','getConfigurations','findOne','options','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','%s:X','base64','requester','subject','agent','priority','group','source','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','model','query','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x4e569b,_0x18ed02){var _0x4be36c=function(_0x3d5a51){while(--_0x3d5a51){_0x4e569b['push'](_0x4e569b['shift']());}};_0x4be36c(++_0x18ed02);}(_0xef38,0x122));var _0x8ef3=function(_0xd17dd7,_0x3ca4cc){_0xd17dd7=_0xd17dd7-0x0;var _0x402dd5=_0xef38[_0xd17dd7];return _0x402dd5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ef3('0x0'));var zipdir=require(_0x8ef3('0x1'));var jsonpatch=require(_0x8ef3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8ef3('0x3'));var Mustache=require(_0x8ef3('0x4'));var util=require(_0x8ef3('0x5'));var path=require(_0x8ef3('0x6'));var sox=require(_0x8ef3('0x7'));var csv=require('to-csv');var ejs=require(_0x8ef3('0x8'));var fs=require('fs');var fs_extra=require(_0x8ef3('0x9'));var _=require('lodash');var squel=require(_0x8ef3('0xa'));var crypto=require(_0x8ef3('0xb'));var jsforce=require(_0x8ef3('0xc'));var deskjs=require(_0x8ef3('0xd'));var toCsv=require(_0x8ef3('0xe'));var querystring=require(_0x8ef3('0xf'));var Papa=require(_0x8ef3('0x10'));var Redis=require('ioredis');var authService=require(_0x8ef3('0x11'));var qs=require(_0x8ef3('0x12'));var as=require(_0x8ef3('0x13'));var hardwareService=require(_0x8ef3('0x14'));var logger=require(_0x8ef3('0x15'))(_0x8ef3('0x16'));var utils=require(_0x8ef3('0x17'));var config=require(_0x8ef3('0x18'));var licenseUtil=require(_0x8ef3('0x19'));var db=require(_0x8ef3('0x1a'))['db'];var integrations=require(_0x8ef3('0x1b'));function respondWithStatusCode(_0x451cfe,_0x6fea77){_0x6fea77=_0x6fea77||0xcc;return function(_0x3902fb){if(_0x3902fb){return _0x451cfe[_0x8ef3('0x1c')](_0x6fea77);}return _0x451cfe[_0x8ef3('0x1d')](_0x6fea77)[_0x8ef3('0x1e')]();};}function respondWithResult(_0x20be3d,_0x398c30){_0x398c30=_0x398c30||0xc8;return function(_0x4972d9){if(_0x4972d9){return _0x20be3d[_0x8ef3('0x1d')](_0x398c30)['json'](_0x4972d9);}};}function respondWithFilteredResult(_0x472741,_0x5b0ef6){return function(_0x22feec){if(_0x22feec){var _0x40739c=typeof _0x5b0ef6['offset']==='undefined'&&typeof _0x5b0ef6[_0x8ef3('0x1f')]===_0x8ef3('0x20');var _0x25041a=_0x22feec[_0x8ef3('0x21')];var _0x5296f2=_0x40739c?0x0:_0x5b0ef6['offset'];var _0x29025b=_0x40739c?_0x22feec[_0x8ef3('0x21')]:_0x5b0ef6[_0x8ef3('0x22')]+_0x5b0ef6[_0x8ef3('0x1f')];var _0x489aa6;if(_0x29025b>=_0x25041a){_0x29025b=_0x25041a;_0x489aa6=0xc8;}else{_0x489aa6=0xce;}_0x472741[_0x8ef3('0x1d')](_0x489aa6);return _0x472741[_0x8ef3('0x23')](_0x8ef3('0x24'),_0x5296f2+'-'+_0x29025b+'/'+_0x25041a)['json'](_0x22feec);}return null;};}function patchUpdates(_0x59375c){return function(_0x19cfb5){try{jsonpatch[_0x8ef3('0x25')](_0x19cfb5,_0x59375c,!![]);}catch(_0x2daa5a){return BPromise[_0x8ef3('0x26')](_0x2daa5a);}return _0x19cfb5[_0x8ef3('0x27')]();};}function saveUpdates(_0x8fc5cd,_0x1231e8){return function(_0x547e6a){if(_0x547e6a){return _0x547e6a[_0x8ef3('0x28')](_0x8fc5cd)[_0x8ef3('0x29')](function(_0x513860){return _0x513860;});}return null;};}function removeEntity(_0xa9829e,_0x431e8c){return function(_0x2cd940){if(_0x2cd940){return _0x2cd940[_0x8ef3('0x2a')]()[_0x8ef3('0x29')](function(){_0xa9829e['status'](0xcc)[_0x8ef3('0x1e')]();});}};}function handleEntityNotFound(_0x3c4581,_0x33f885){return function(_0x46f2cb){if(!_0x46f2cb){_0x3c4581['sendStatus'](0x194);}return _0x46f2cb;};}function handleError(_0x3441ce,_0x28637a){_0x28637a=_0x28637a||0x1f4;return function(_0x188b8b){logger[_0x8ef3('0x2b')](_0x188b8b[_0x8ef3('0x2c')]);if(_0x188b8b[_0x8ef3('0x2d')]){delete _0x188b8b[_0x8ef3('0x2d')];}_0x3441ce[_0x8ef3('0x1d')](_0x28637a)[_0x8ef3('0x2e')](_0x188b8b);};}exports[_0x8ef3('0x2f')]=function(_0x23dacc,_0x594a25){var _0x4408f9={},_0x1c34d5={},_0x865252={'count':0x0,'rows':[]};var _0x2b33af=_[_0x8ef3('0x30')](db[_0x8ef3('0x31')][_0x8ef3('0x32')],function(_0x5610bf){return{'name':_0x5610bf['fieldName'],'type':_0x5610bf[_0x8ef3('0x33')]['key']};});_0x1c34d5[_0x8ef3('0x34')]=_[_0x8ef3('0x30')](_0x2b33af,_0x8ef3('0x2d'));_0x1c34d5['query']=_['keys'](_0x23dacc['query']);_0x1c34d5['filters']=_['intersection'](_0x1c34d5[_0x8ef3('0x34')],_0x1c34d5[_0x8ef3('0x35')]);_0x4408f9[_0x8ef3('0x36')]=_['intersection'](_0x1c34d5[_0x8ef3('0x34')],qs[_0x8ef3('0x37')](_0x23dacc['query'][_0x8ef3('0x37')]));_0x4408f9[_0x8ef3('0x36')]=_0x4408f9[_0x8ef3('0x36')]['length']?_0x4408f9[_0x8ef3('0x36')]:_0x1c34d5['model'];if(!_0x23dacc[_0x8ef3('0x35')]['hasOwnProperty']('nolimit')){_0x4408f9['limit']=qs['limit'](_0x23dacc['query'][_0x8ef3('0x1f')]);_0x4408f9['offset']=qs[_0x8ef3('0x22')](_0x23dacc['query'][_0x8ef3('0x22')]);}_0x4408f9[_0x8ef3('0x38')]=qs[_0x8ef3('0x39')](_0x23dacc['query']['sort']);_0x4408f9[_0x8ef3('0x3a')]=qs[_0x8ef3('0x3b')](_[_0x8ef3('0x3c')](_0x23dacc[_0x8ef3('0x35')],_0x1c34d5[_0x8ef3('0x3b')]),_0x2b33af);if(_0x23dacc['query'][_0x8ef3('0x3d')]){_0x4408f9[_0x8ef3('0x3a')]=_[_0x8ef3('0x3e')](_0x4408f9['where'],{'$or':_[_0x8ef3('0x30')](_0x2b33af,function(_0x53f411){if(_0x53f411[_0x8ef3('0x33')]!==_0x8ef3('0x3f')){var _0x2fde13={};_0x2fde13[_0x53f411[_0x8ef3('0x2d')]]={'$like':'%'+_0x23dacc['query'][_0x8ef3('0x3d')]+'%'};return _0x2fde13;}})});}_0x4408f9=_[_0x8ef3('0x3e')]({},_0x4408f9,_0x23dacc['options']);var _0x24cdc6={'where':_0x4408f9[_0x8ef3('0x3a')]};return db[_0x8ef3('0x31')][_0x8ef3('0x21')](_0x24cdc6)[_0x8ef3('0x29')](function(_0x38061a){_0x865252[_0x8ef3('0x21')]=_0x38061a;if(_0x23dacc[_0x8ef3('0x35')]['includeAll']){_0x4408f9[_0x8ef3('0x40')]=[{'all':!![]}];}return db[_0x8ef3('0x31')][_0x8ef3('0x41')](_0x4408f9);})[_0x8ef3('0x29')](function(_0x384ccd){_0x865252['rows']=_0x384ccd;return _0x865252;})[_0x8ef3('0x29')](respondWithFilteredResult(_0x594a25,_0x4408f9))['catch'](handleError(_0x594a25,null));};exports[_0x8ef3('0x42')]=function(_0xde455c,_0x3d230f){var _0x1b30f8={'raw':![],'where':{'id':_0xde455c['params']['id']}},_0x5c005f={};_0x5c005f[_0x8ef3('0x34')]=_['keys'](db[_0x8ef3('0x31')][_0x8ef3('0x32')]);_0x5c005f[_0x8ef3('0x35')]=_[_0x8ef3('0x43')](_0xde455c['query']);_0x5c005f[_0x8ef3('0x3b')]=_[_0x8ef3('0x44')](_0x5c005f[_0x8ef3('0x34')],_0x5c005f[_0x8ef3('0x35')]);_0x1b30f8[_0x8ef3('0x36')]=_['intersection'](_0x5c005f[_0x8ef3('0x34')],qs['fields'](_0xde455c[_0x8ef3('0x35')][_0x8ef3('0x37')]));_0x1b30f8[_0x8ef3('0x36')]=_0x1b30f8['attributes'][_0x8ef3('0x45')]?_0x1b30f8[_0x8ef3('0x36')]:_0x5c005f[_0x8ef3('0x34')];if(_0xde455c['query'][_0x8ef3('0x46')]){_0x1b30f8[_0x8ef3('0x40')]=[{'all':!![]}];}_0x1b30f8=_[_0x8ef3('0x3e')]({},_0x1b30f8,_0xde455c['options']);return db[_0x8ef3('0x31')][_0x8ef3('0x47')](_0x1b30f8)['then'](handleEntityNotFound(_0x3d230f,null))['then'](respondWithResult(_0x3d230f,null))[_0x8ef3('0x48')](handleError(_0x3d230f,null));};exports[_0x8ef3('0x49')]=function(_0x362f61,_0x36bb36){return db['FreshdeskAccount'][_0x8ef3('0x49')](_0x362f61[_0x8ef3('0x4a')],{})[_0x8ef3('0x29')](respondWithResult(_0x36bb36,0xc9))['catch'](handleError(_0x36bb36,null));};exports[_0x8ef3('0x28')]=function(_0x1dce6a,_0x175063){if(_0x1dce6a[_0x8ef3('0x4a')]['id']){delete _0x1dce6a[_0x8ef3('0x4a')]['id'];}return db[_0x8ef3('0x31')][_0x8ef3('0x47')]({'where':{'id':_0x1dce6a[_0x8ef3('0x4b')]['id']}})[_0x8ef3('0x29')](handleEntityNotFound(_0x175063,null))[_0x8ef3('0x29')](saveUpdates(_0x1dce6a[_0x8ef3('0x4a')],null))[_0x8ef3('0x29')](respondWithResult(_0x175063,null))['catch'](handleError(_0x175063,null));};exports[_0x8ef3('0x2a')]=function(_0x131e6b,_0x2a7a56){return db[_0x8ef3('0x31')]['find']({'where':{'id':_0x131e6b[_0x8ef3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a7a56,null))['then'](removeEntity(_0x2a7a56,null))[_0x8ef3('0x48')](handleError(_0x2a7a56,null));};exports[_0x8ef3('0x4c')]=function(_0x4322cc,_0x7fd502,_0x408ff9){var _0x3b3e60={};var _0x1bda4e={};var _0x893ad1;var _0x344d74;return db[_0x8ef3('0x31')][_0x8ef3('0x4d')]({'where':{'id':_0x4322cc[_0x8ef3('0x4b')]['id']}})[_0x8ef3('0x29')](handleEntityNotFound(_0x7fd502,null))[_0x8ef3('0x29')](function(_0x11222d){if(_0x11222d){_0x893ad1=_0x11222d;_0x1bda4e['model']=_[_0x8ef3('0x43')](db['FreshdeskConfiguration'][_0x8ef3('0x32')]);_0x1bda4e[_0x8ef3('0x35')]=_[_0x8ef3('0x43')](_0x4322cc[_0x8ef3('0x35')]);_0x1bda4e[_0x8ef3('0x3b')]=_[_0x8ef3('0x44')](_0x1bda4e[_0x8ef3('0x34')],_0x1bda4e[_0x8ef3('0x35')]);_0x3b3e60[_0x8ef3('0x36')]=_[_0x8ef3('0x44')](_0x1bda4e[_0x8ef3('0x34')],qs['fields'](_0x4322cc[_0x8ef3('0x35')]['fields']));_0x3b3e60[_0x8ef3('0x36')]=_0x3b3e60[_0x8ef3('0x36')][_0x8ef3('0x45')]?_0x3b3e60[_0x8ef3('0x36')]:_0x1bda4e[_0x8ef3('0x34')];_0x3b3e60['order']=qs['sort'](_0x4322cc[_0x8ef3('0x35')]['sort']);_0x3b3e60['where']=qs['filters'](_[_0x8ef3('0x3c')](_0x4322cc[_0x8ef3('0x35')],_0x1bda4e[_0x8ef3('0x3b')]));if(_0x4322cc['query'][_0x8ef3('0x3d')]){_0x3b3e60['where']=_[_0x8ef3('0x3e')](_0x3b3e60['where'],{'$or':_['map'](_0x3b3e60[_0x8ef3('0x36')],function(_0x380c11){var _0x7cc32c={};_0x7cc32c[_0x380c11]={'$like':'%'+_0x4322cc[_0x8ef3('0x35')]['filter']+'%'};return _0x7cc32c;})});}_0x3b3e60=_[_0x8ef3('0x3e')]({},_0x3b3e60,_0x4322cc[_0x8ef3('0x4e')]);return _0x893ad1['getConfigurations'](_0x3b3e60);}})[_0x8ef3('0x29')](function(_0x58d576){if(_0x58d576){_0x344d74=_0x58d576[_0x8ef3('0x45')];if(!_0x4322cc[_0x8ef3('0x35')][_0x8ef3('0x4f')](_0x8ef3('0x50'))){_0x3b3e60[_0x8ef3('0x1f')]=qs[_0x8ef3('0x1f')](_0x4322cc[_0x8ef3('0x35')][_0x8ef3('0x1f')]);_0x3b3e60[_0x8ef3('0x22')]=qs[_0x8ef3('0x22')](_0x4322cc[_0x8ef3('0x35')][_0x8ef3('0x22')]);}return _0x893ad1['getConfigurations'](_0x3b3e60);}})[_0x8ef3('0x29')](function(_0x30cc0e){if(_0x30cc0e){return _0x30cc0e?{'count':_0x344d74,'rows':_0x30cc0e}:null;}})[_0x8ef3('0x29')](respondWithResult(_0x7fd502,null))[_0x8ef3('0x48')](handleError(_0x7fd502,null));};exports[_0x8ef3('0x51')]=function(_0x2f40ce,_0x1701f6,_0x3ec87c){if(_0x2f40ce['body']['id']){delete _0x2f40ce[_0x8ef3('0x4a')]['id'];}return db[_0x8ef3('0x31')][_0x8ef3('0x4d')]({'where':{'id':_0x2f40ce['params']['id']}})[_0x8ef3('0x29')](handleEntityNotFound(_0x1701f6,null))[_0x8ef3('0x29')](function(_0x4caa6f){if(_0x4caa6f){_0x2f40ce[_0x8ef3('0x4a')][_0x8ef3('0x52')]=_0x4caa6f['id'];_0x2f40ce['body'][_0x8ef3('0x53')]=integrations[_0x8ef3('0x54')](_0x2f40ce['body']['channel'],_0x2f40ce[_0x8ef3('0x4a')][_0x8ef3('0x33')]);_0x2f40ce[_0x8ef3('0x4a')][_0x8ef3('0x55')]=integrations[_0x8ef3('0x56')](_0x2f40ce[_0x8ef3('0x4a')][_0x8ef3('0x57')],_0x2f40ce[_0x8ef3('0x4a')]['type']);return db[_0x8ef3('0x58')][_0x8ef3('0x49')](_0x2f40ce[_0x8ef3('0x4a')],{'include':[{'model':db[_0x8ef3('0x59')],'as':_0x8ef3('0x53')},{'model':db[_0x8ef3('0x59')],'as':_0x8ef3('0x55')}]});}return null;})['then'](respondWithResult(_0x1701f6,null))[_0x8ef3('0x48')](handleError(_0x1701f6,null));};exports[_0x8ef3('0x5a')]=function(_0xe63d95,_0x50bc62,_0x3ad5c0){var _0xefe1e7='';return db[_0x8ef3('0x31')][_0x8ef3('0x4d')]({'where':{'id':_0xe63d95['params']['id']},'attributes':['id',_0x8ef3('0x5b'),_0x8ef3('0x5c')]})[_0x8ef3('0x29')](handleEntityNotFound(_0x50bc62,null))[_0x8ef3('0x29')](function(_0x5b52c9){if(_0x5b52c9){_0xefe1e7=_0x5b52c9[_0x8ef3('0x5b')];var _0x442057=_0xefe1e7[_0x8ef3('0x5d')](-0x1);if(_0x442057==='/'){_0xefe1e7=_0xefe1e7['substring'](0x0,_0xefe1e7[_0x8ef3('0x5e')](_0x442057));}return rp({'method':_0x8ef3('0x5f'),'uri':util[_0x8ef3('0x60')](_0x8ef3('0x61'),_0xefe1e7,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x8ef3('0x60')]('Basic\x20%s',new Buffer(util[_0x8ef3('0x60')](_0x8ef3('0x62'),_0x5b52c9[_0x8ef3('0x5c')]))['toString'](_0x8ef3('0x63')))},'json':!![]});}})[_0x8ef3('0x29')](function(_0x26dc5e){if(_0x26dc5e){var _0x1765d8=[_0x8ef3('0x64'),_0x8ef3('0x65'),_0x8ef3('0x66'),'description',_0x8ef3('0x1d'),_0x8ef3('0x67'),_0x8ef3('0x68'),_0x8ef3('0x69'),'ticket_type',_0x8ef3('0x68'),_0x8ef3('0x6a')];_[_0x8ef3('0x6b')](_0x26dc5e,function(_0x4b42a7){return _0x1765d8['includes'](_0x4b42a7['name'])||!_0x4b42a7[_0x8ef3('0x6c')]&&_0x4b42a7['type']!==_0x8ef3('0x6d')&&_0x4b42a7[_0x8ef3('0x33')]!==_0x8ef3('0x6e');});return{'count':_0x26dc5e[_0x8ef3('0x45')],'rows':_[_0x8ef3('0x30')](_0x26dc5e,function(_0x160411){return{'id':_0x160411[_0x8ef3('0x2d')],'name':_0x160411[_0x8ef3('0x6f')],'custom':!_0x160411['default'],'options':_0x160411[_0x8ef3('0x70')]?_[_0x8ef3('0x30')](_0x160411[_0x8ef3('0x70')],function(_0x12a483){return{'name':_[_0x8ef3('0x71')](_0x12a483),'value':_0x12a483};}):[]};})};}})[_0x8ef3('0x29')](respondWithResult(_0x50bc62,null))[_0x8ef3('0x48')](function(_0x37d85d){var _0x3e3e44=_0xe63d95[_0x8ef3('0x35')][_0x8ef3('0x72')]?0x1f4:_0x37d85d[_0x8ef3('0x73')]||0x1f4;logger[_0x8ef3('0x2b')](_0x8ef3('0x74'),'getFields',_0x3e3e44,JSON['stringify'](_0x37d85d));delete _0x37d85d['name'];if(_0x3e3e44===0x191){_0x3e3e44=0x190;}_0x50bc62[_0x8ef3('0x1d')](_0x3e3e44)[_0x8ef3('0x2e')](_0xe63d95[_0x8ef3('0x35')][_0x8ef3('0x72')]?{'message':_0x8ef3('0x75'),'statusCode':_0x37d85d[_0x8ef3('0x73')]}:_0x37d85d);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9fe9258..cdd41de 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 _0xe8dd=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x3b606e,_0x1e94e4){var _0x14722c=function(_0x53441e){while(--_0x53441e){_0x3b606e['push'](_0x3b606e['shift']());}};_0x14722c(++_0x1e94e4);}(_0xe8dd,0x91));var _0xde8d=function(_0x1b1dc8,_0x3b037e){_0x1b1dc8=_0x1b1dc8-0x0;var _0x4687dd=_0xe8dd[_0x1b1dc8];return _0x4687dd;};'use strict';var _=require('lodash');var util=require(_0xde8d('0x0'));var logger=require(_0xde8d('0x1'))(_0xde8d('0x2'));var moment=require('moment');var BPromise=require(_0xde8d('0x3'));var rp=require(_0xde8d('0x4'));var fs=require('fs');var path=require(_0xde8d('0x5'));var rimraf=require(_0xde8d('0x6'));var config=require(_0xde8d('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xde8d('0x8'));module[_0xde8d('0x9')]=function(_0x5ae42f,_0x201fa1){return _0x5ae42f[_0xde8d('0xa')](_0xde8d('0xb'),attributes,{'tableName':_0xde8d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb63c=['FreshdeskAccount','int_freshdesk_accounts','lodash','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x55df33,_0x4fe4df){var _0x1e51bc=function(_0x9ce31d){while(--_0x9ce31d){_0x55df33['push'](_0x55df33['shift']());}};_0x1e51bc(++_0x4fe4df);}(_0xb63c,0x178));var _0xcb63=function(_0xd8200f,_0x803a26){_0xd8200f=_0xd8200f-0x0;var _0x51e0c0=_0xb63c[_0xd8200f];return _0x51e0c0;};'use strict';var _=require(_0xcb63('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcb63('0x1'));var moment=require(_0xcb63('0x2'));var BPromise=require(_0xcb63('0x3'));var rp=require(_0xcb63('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb63('0x5'));var config=require('../../config/environment');var attributes=require(_0xcb63('0x6'));var integrations=require(_0xcb63('0x7'));module['exports']=function(_0x33235a,_0x20494f){return _0x33235a[_0xcb63('0x8')](_0xcb63('0x9'),attributes,{'tableName':_0xcb63('0xa'),'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 ea13d6f..99e3835 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 _0xb8b3=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','attributes','model','then','ShowFreshdeskAccount','find','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x548e0e,_0x37834a){var _0x2ade27=function(_0x142572){while(--_0x142572){_0x548e0e['push'](_0x548e0e['shift']());}};_0x2ade27(++_0x37834a);}(_0xb8b3,0xb3));var _0x3b8b=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xb8b3[_0x4709c8];return _0x478cdd;};'use strict';var _=require(_0x3b8b('0x0'));var util=require(_0x3b8b('0x1'));var moment=require('moment');var BPromise=require(_0x3b8b('0x2'));var rs=require(_0x3b8b('0x3'));var fs=require('fs');var Redis=require(_0x3b8b('0x4'));var db=require(_0x3b8b('0x5'))['db'];var utils=require(_0x3b8b('0x6'));var logger=require(_0x3b8b('0x7'))(_0x3b8b('0x8'));var config=require(_0x3b8b('0x9'));var jayson=require(_0x3b8b('0xa'));var client=jayson[_0x3b8b('0xb')][_0x3b8b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a42c4,_0x4c0dc3,_0x18c668){return new BPromise(function(_0x23a354,_0x16afbb){return client[_0x3b8b('0xd')](_0x5a42c4,_0x18c668)['then'](function(_0x263a95){logger[_0x3b8b('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x4c0dc3,_0x3b8b('0xf'));logger[_0x3b8b('0x10')](_0x3b8b('0x11'),_0x4c0dc3,_0x3b8b('0xf'),JSON[_0x3b8b('0x12')](_0x263a95));if(_0x263a95[_0x3b8b('0x13')]){if(_0x263a95['error'][_0x3b8b('0x14')]===0x1f4){logger[_0x3b8b('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x4c0dc3,_0x263a95[_0x3b8b('0x13')][_0x3b8b('0x15')]);return _0x16afbb(_0x263a95[_0x3b8b('0x13')][_0x3b8b('0x15')]);}logger[_0x3b8b('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x4c0dc3,_0x263a95[_0x3b8b('0x13')][_0x3b8b('0x15')]);return _0x23a354(_0x263a95[_0x3b8b('0x13')][_0x3b8b('0x15')]);}else{logger[_0x3b8b('0xe')](_0x3b8b('0x16'),_0x4c0dc3,'request\x20sent');_0x23a354(_0x263a95[_0x3b8b('0x17')][_0x3b8b('0x15')]);}})[_0x3b8b('0x18')](function(_0x3d26b9){logger[_0x3b8b('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x4c0dc3,_0x3d26b9);_0x16afbb(_0x3d26b9);});});}exports[_0x3b8b('0x19')]=function(_0x358105){var _0x3c78cd=this;return new Promise(function(_0x1a7039,_0x5bf5de){return db[_0x3b8b('0x1a')][_0x3b8b('0x1b')]({'raw':_0x358105[_0x3b8b('0x1c')]?_0x358105[_0x3b8b('0x1c')][_0x3b8b('0x1d')]===undefined?!![]:![]:!![],'where':_0x358105[_0x3b8b('0x1c')]?_0x358105[_0x3b8b('0x1c')][_0x3b8b('0x1e')]||null:null,'attributes':_0x358105['options']?_0x358105[_0x3b8b('0x1c')]['attributes']||null:null,'limit':_0x358105[_0x3b8b('0x1c')]?_0x358105[_0x3b8b('0x1c')][_0x3b8b('0x1f')]||null:null,'include':_0x358105[_0x3b8b('0x1c')]?_0x358105[_0x3b8b('0x1c')][_0x3b8b('0x20')]?_['map'](_0x358105[_0x3b8b('0x1c')][_0x3b8b('0x20')],function(_0x7aa996){return{'model':db[_0x7aa996['model']],'as':_0x7aa996['as'],'attributes':_0x7aa996[_0x3b8b('0x21')],'include':_0x7aa996[_0x3b8b('0x20')]?_['map'](_0x7aa996[_0x3b8b('0x20')],function(_0xd37637){return{'model':db[_0xd37637['model']],'as':_0xd37637['as'],'attributes':_0xd37637['attributes'],'include':_0xd37637[_0x3b8b('0x20')]?_['map'](_0xd37637['include'],function(_0x438549){return{'model':db[_0x438549[_0x3b8b('0x22')]],'as':_0x438549['as'],'attributes':_0x438549[_0x3b8b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3b8b('0x23')](function(_0x1bc0b6){logger[_0x3b8b('0xe')](_0x3b8b('0x19'),_0x358105);logger[_0x3b8b('0x10')](_0x3b8b('0x19'),_0x358105,JSON[_0x3b8b('0x12')](_0x1bc0b6));_0x1a7039(_0x1bc0b6);})[_0x3b8b('0x18')](function(_0x28f6f6){logger[_0x3b8b('0x13')](_0x3b8b('0x19'),_0x28f6f6[_0x3b8b('0x15')],_0x358105);_0x5bf5de(_0x3c78cd[_0x3b8b('0x13')](0x1f4,_0x28f6f6[_0x3b8b('0x15')]));});});};exports[_0x3b8b('0x24')]=function(_0x5a5941){var _0x593d0c=this;return new Promise(function(_0x1adb3f,_0x34c771){return db[_0x3b8b('0x1a')][_0x3b8b('0x25')]({'raw':_0x5a5941[_0x3b8b('0x1c')]?_0x5a5941[_0x3b8b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5a5941[_0x3b8b('0x1c')]?_0x5a5941[_0x3b8b('0x1c')][_0x3b8b('0x1e')]||null:null,'attributes':_0x5a5941[_0x3b8b('0x1c')]?_0x5a5941['options'][_0x3b8b('0x21')]||null:null,'include':_0x5a5941['options']?_0x5a5941[_0x3b8b('0x1c')][_0x3b8b('0x20')]?_[_0x3b8b('0x26')](_0x5a5941[_0x3b8b('0x1c')]['include'],function(_0x1f321f){return{'model':db[_0x1f321f[_0x3b8b('0x22')]],'as':_0x1f321f['as'],'attributes':_0x1f321f['attributes'],'include':_0x1f321f[_0x3b8b('0x20')]?_[_0x3b8b('0x26')](_0x1f321f['include'],function(_0x45936e){return{'model':db[_0x45936e[_0x3b8b('0x22')]],'as':_0x45936e['as'],'attributes':_0x45936e[_0x3b8b('0x21')],'include':_0x45936e[_0x3b8b('0x20')]?_['map'](_0x45936e[_0x3b8b('0x20')],function(_0x40646a){return{'model':db[_0x40646a['model']],'as':_0x40646a['as'],'attributes':_0x40646a[_0x3b8b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ae50f){logger[_0x3b8b('0xe')]('ShowFreshdeskAccount',_0x5a5941);logger[_0x3b8b('0x10')]('ShowFreshdeskAccount',_0x5a5941,JSON[_0x3b8b('0x12')](_0x2ae50f));_0x1adb3f(_0x2ae50f);})[_0x3b8b('0x18')](function(_0x937e85){logger[_0x3b8b('0x13')](_0x3b8b('0x24'),_0x937e85[_0x3b8b('0x15')],_0x5a5941);_0x34c771(_0x593d0c[_0x3b8b('0x13')](0x1f4,_0x937e85['message']));});});}; \ No newline at end of file +var _0xc6aa=['limit','include','map','model','ShowFreshdeskAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes'];(function(_0x5f70fc,_0x257ef3){var _0x988e57=function(_0x48f93c){while(--_0x48f93c){_0x5f70fc['push'](_0x5f70fc['shift']());}};_0x988e57(++_0x257ef3);}(_0xc6aa,0x127));var _0xac6a=function(_0x462fc6,_0x498d2b){_0x462fc6=_0x462fc6-0x0;var _0x14b0f5=_0xc6aa[_0x462fc6];return _0x14b0f5;};'use strict';var _=require(_0xac6a('0x0'));var util=require('util');var moment=require(_0xac6a('0x1'));var BPromise=require(_0xac6a('0x2'));var rs=require(_0xac6a('0x3'));var fs=require('fs');var Redis=require(_0xac6a('0x4'));var db=require(_0xac6a('0x5'))['db'];var utils=require(_0xac6a('0x6'));var logger=require(_0xac6a('0x7'))('rpc');var config=require(_0xac6a('0x8'));var jayson=require(_0xac6a('0x9'));var client=jayson[_0xac6a('0xa')][_0xac6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a3a08,_0x267efd,_0x4e168d){return new BPromise(function(_0x5150ce,_0x928c41){return client[_0xac6a('0xc')](_0x3a3a08,_0x4e168d)[_0xac6a('0xd')](function(_0x1f3b82){logger[_0xac6a('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x267efd,_0xac6a('0xf'));logger[_0xac6a('0x10')](_0xac6a('0x11'),_0x267efd,_0xac6a('0xf'),JSON[_0xac6a('0x12')](_0x1f3b82));if(_0x1f3b82[_0xac6a('0x13')]){if(_0x1f3b82[_0xac6a('0x13')]['code']===0x1f4){logger[_0xac6a('0x13')](_0xac6a('0x14'),_0x267efd,_0x1f3b82[_0xac6a('0x13')]['message']);return _0x928c41(_0x1f3b82['error'][_0xac6a('0x15')]);}logger[_0xac6a('0x13')](_0xac6a('0x14'),_0x267efd,_0x1f3b82[_0xac6a('0x13')][_0xac6a('0x15')]);return _0x5150ce(_0x1f3b82[_0xac6a('0x13')][_0xac6a('0x15')]);}else{logger[_0xac6a('0xe')](_0xac6a('0x14'),_0x267efd,_0xac6a('0xf'));_0x5150ce(_0x1f3b82['result'][_0xac6a('0x15')]);}})[_0xac6a('0x16')](function(_0x1cc742){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x267efd,_0x1cc742);_0x928c41(_0x1cc742);});});}exports[_0xac6a('0x17')]=function(_0x21b03b){var _0x22fee9=this;return new Promise(function(_0x229b82,_0x55fbd0){return db[_0xac6a('0x18')][_0xac6a('0x19')]({'raw':_0x21b03b[_0xac6a('0x1a')]?_0x21b03b[_0xac6a('0x1a')][_0xac6a('0x1b')]===undefined?!![]:![]:!![],'where':_0x21b03b['options']?_0x21b03b['options']['where']||null:null,'attributes':_0x21b03b[_0xac6a('0x1a')]?_0x21b03b[_0xac6a('0x1a')][_0xac6a('0x1c')]||null:null,'limit':_0x21b03b[_0xac6a('0x1a')]?_0x21b03b[_0xac6a('0x1a')][_0xac6a('0x1d')]||null:null,'include':_0x21b03b[_0xac6a('0x1a')]?_0x21b03b[_0xac6a('0x1a')][_0xac6a('0x1e')]?_[_0xac6a('0x1f')](_0x21b03b[_0xac6a('0x1a')][_0xac6a('0x1e')],function(_0x380da7){return{'model':db[_0x380da7[_0xac6a('0x20')]],'as':_0x380da7['as'],'attributes':_0x380da7['attributes'],'include':_0x380da7[_0xac6a('0x1e')]?_[_0xac6a('0x1f')](_0x380da7['include'],function(_0x5178fb){return{'model':db[_0x5178fb[_0xac6a('0x20')]],'as':_0x5178fb['as'],'attributes':_0x5178fb[_0xac6a('0x1c')],'include':_0x5178fb['include']?_[_0xac6a('0x1f')](_0x5178fb[_0xac6a('0x1e')],function(_0x552473){return{'model':db[_0x552473['model']],'as':_0x552473['as'],'attributes':_0x552473[_0xac6a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac6a('0xd')](function(_0x449824){logger[_0xac6a('0xe')](_0xac6a('0x17'),_0x21b03b);logger[_0xac6a('0x10')](_0xac6a('0x17'),_0x21b03b,JSON[_0xac6a('0x12')](_0x449824));_0x229b82(_0x449824);})[_0xac6a('0x16')](function(_0x5f51fb){logger[_0xac6a('0x13')](_0xac6a('0x17'),_0x5f51fb['message'],_0x21b03b);_0x55fbd0(_0x22fee9[_0xac6a('0x13')](0x1f4,_0x5f51fb['message']));});});};exports[_0xac6a('0x21')]=function(_0x2067af){var _0x17c7a7=this;return new Promise(function(_0x41adef,_0x204f11){return db['FreshdeskAccount'][_0xac6a('0x22')]({'raw':_0x2067af[_0xac6a('0x1a')]?_0x2067af[_0xac6a('0x1a')][_0xac6a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2067af[_0xac6a('0x1a')]?_0x2067af[_0xac6a('0x1a')][_0xac6a('0x23')]||null:null,'attributes':_0x2067af['options']?_0x2067af[_0xac6a('0x1a')][_0xac6a('0x1c')]||null:null,'include':_0x2067af['options']?_0x2067af[_0xac6a('0x1a')][_0xac6a('0x1e')]?_[_0xac6a('0x1f')](_0x2067af['options'][_0xac6a('0x1e')],function(_0x48b2b0){return{'model':db[_0x48b2b0[_0xac6a('0x20')]],'as':_0x48b2b0['as'],'attributes':_0x48b2b0[_0xac6a('0x1c')],'include':_0x48b2b0['include']?_[_0xac6a('0x1f')](_0x48b2b0[_0xac6a('0x1e')],function(_0x4dea7b){return{'model':db[_0x4dea7b[_0xac6a('0x20')]],'as':_0x4dea7b['as'],'attributes':_0x4dea7b[_0xac6a('0x1c')],'include':_0x4dea7b[_0xac6a('0x1e')]?_[_0xac6a('0x1f')](_0x4dea7b[_0xac6a('0x1e')],function(_0x1cc077){return{'model':db[_0x1cc077[_0xac6a('0x20')]],'as':_0x1cc077['as'],'attributes':_0x1cc077[_0xac6a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac6a('0xd')](function(_0x58df84){logger['info'](_0xac6a('0x21'),_0x2067af);logger[_0xac6a('0x10')](_0xac6a('0x21'),_0x2067af,JSON[_0xac6a('0x12')](_0x58df84));_0x41adef(_0x58df84);})[_0xac6a('0x16')](function(_0x48e75e){logger['error'](_0xac6a('0x21'),_0x48e75e['message'],_0x2067af);_0x204f11(_0x17c7a7['error'](0x1f4,_0x48e75e['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 01f31b9..77934e5 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 _0x085d=['destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','create','setTags','put','update','delete'];(function(_0x4d99a7,_0x216059){var _0x5815a9=function(_0x376996){while(--_0x376996){_0x4d99a7['push'](_0x4d99a7['shift']());}};_0x5815a9(++_0x216059);}(_0x085d,0x1c4));var _0xd085=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x085d[_0xef4ef0];return _0x39b60b;};'use strict';var multer=require(_0xd085('0x0'));var util=require(_0xd085('0x1'));var path=require('path');var timeout=require(_0xd085('0x2'));var express=require(_0xd085('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd085('0x4'));var interaction=require(_0xd085('0x5'));var config=require('../../config/environment');var controller=require(_0xd085('0x6'));router[_0xd085('0x7')]('/',auth[_0xd085('0x8')](),controller['index']);router[_0xd085('0x7')](_0xd085('0x9'),auth[_0xd085('0x8')](),controller[_0xd085('0xa')]);router[_0xd085('0x7')](_0xd085('0xb'),auth[_0xd085('0x8')](),controller[_0xd085('0xc')]);router[_0xd085('0x7')](_0xd085('0xd'),auth[_0xd085('0x8')](),controller[_0xd085('0xe')]);router[_0xd085('0x7')](_0xd085('0xf'),auth[_0xd085('0x8')](),controller['getDescriptions']);router[_0xd085('0x7')](_0xd085('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0xd085('0x11')]('/',auth[_0xd085('0x8')](),controller[_0xd085('0x12')]);router['post'](_0xd085('0x10'),auth[_0xd085('0x8')](),controller[_0xd085('0x13')]);router[_0xd085('0x14')](_0xd085('0x9'),auth['isAuthenticated'](),controller[_0xd085('0x15')]);router[_0xd085('0x16')](_0xd085('0x9'),auth[_0xd085('0x8')](),controller[_0xd085('0x17')]);module[_0xd085('0x18')]=router; \ No newline at end of file +var _0x6f20=['/:id/descriptions','getDescriptions','/:id/tags','create','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects'];(function(_0x2b9cf5,_0x2a7804){var _0xd0cf15=function(_0x92a896){while(--_0x92a896){_0x2b9cf5['push'](_0x2b9cf5['shift']());}};_0xd0cf15(++_0x2a7804);}(_0x6f20,0x181));var _0x06f2=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x6f20[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require('multer');var util=require(_0x06f2('0x0'));var path=require(_0x06f2('0x1'));var timeout=require(_0x06f2('0x2'));var express=require('express');var router=express[_0x06f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x06f2('0x4'));var controller=require(_0x06f2('0x5'));router[_0x06f2('0x6')]('/',auth['isAuthenticated'](),controller[_0x06f2('0x7')]);router['get'](_0x06f2('0x8'),auth['isAuthenticated'](),controller[_0x06f2('0x9')]);router[_0x06f2('0x6')](_0x06f2('0xa'),auth[_0x06f2('0xb')](),controller[_0x06f2('0xc')]);router[_0x06f2('0x6')](_0x06f2('0xd'),auth[_0x06f2('0xb')](),controller[_0x06f2('0xe')]);router[_0x06f2('0x6')](_0x06f2('0xf'),auth[_0x06f2('0xb')](),controller[_0x06f2('0x10')]);router[_0x06f2('0x6')](_0x06f2('0x11'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0x06f2('0xb')](),controller[_0x06f2('0x12')]);router[_0x06f2('0x13')]('/:id/tags',auth[_0x06f2('0xb')](),controller['setTags']);router[_0x06f2('0x14')]('/:id',auth[_0x06f2('0xb')](),controller[_0x06f2('0x15')]);router[_0x06f2('0x16')](_0x06f2('0x8'),auth[_0x06f2('0xb')](),controller[_0x06f2('0x17')]);module[_0x06f2('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e6ec6c0..2dc2172 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 _0xa5d4=['STRING','sequelize','exports'];(function(_0x461e6d,_0x3bcc94){var _0x2c5e61=function(_0xea4854){while(--_0xea4854){_0x461e6d['push'](_0x461e6d['shift']());}};_0x2c5e61(++_0x3bcc94);}(_0xa5d4,0x163));var _0x4a5d=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xa5d4[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x4a5d('0x0'));module[_0x4a5d('0x1')]={'name':{'type':Sequelize[_0x4a5d('0x2')]},'description':{'type':Sequelize[_0x4a5d('0x2')]}}; \ No newline at end of file +var _0x3003=['sequelize','exports','STRING'];(function(_0x1d0024,_0x3bcd79){var _0x26e247=function(_0x4ad9ad){while(--_0x4ad9ad){_0x1d0024['push'](_0x1d0024['shift']());}};_0x26e247(++_0x3bcd79);}(_0x3003,0xf3));var _0x3300=function(_0x2b07f9,_0x562e8c){_0x2b07f9=_0x2b07f9-0x0;var _0x3b185d=_0x3003[_0x2b07f9];return _0x3b185d;};'use strict';var Sequelize=require(_0x3300('0x0'));module[_0x3300('0x1')]={'name':{'type':Sequelize[_0x3300('0x2')]},'description':{'type':Sequelize[_0x3300('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 6c01bce..132ea68 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 _0x872e=['rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','FreshdeskConfiguration'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x872e,0x117));var _0xe872=function(_0x1d1798,_0x17f616){_0x1d1798=_0x1d1798-0x0;var _0x3ba56f=_0x872e[_0x1d1798];return _0x3ba56f;};'use strict';var emlformat=require(_0xe872('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe872('0x1'));var jsonpatch=require(_0xe872('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe872('0x3'));var Mustache=require(_0xe872('0x4'));var util=require(_0xe872('0x5'));var path=require('path');var sox=require(_0xe872('0x6'));var csv=require(_0xe872('0x7'));var ejs=require(_0xe872('0x8'));var fs=require('fs');var fs_extra=require(_0xe872('0x9'));var _=require(_0xe872('0xa'));var squel=require(_0xe872('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe872('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe872('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe872('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe872('0xe'))(_0xe872('0xf'));var utils=require(_0xe872('0x10'));var config=require(_0xe872('0x11'));var licenseUtil=require(_0xe872('0x12'));var db=require(_0xe872('0x13'))['db'];function respondWithStatusCode(_0x1113bd,_0x4e7f89){_0x4e7f89=_0x4e7f89||0xcc;return function(_0x2665b2){if(_0x2665b2){return _0x1113bd[_0xe872('0x14')](_0x4e7f89);}return _0x1113bd[_0xe872('0x15')](_0x4e7f89)['end']();};}function respondWithResult(_0x140990,_0x3bbed8){_0x3bbed8=_0x3bbed8||0xc8;return function(_0x155927){if(_0x155927){return _0x140990['status'](_0x3bbed8)[_0xe872('0x16')](_0x155927);}};}function respondWithFilteredResult(_0x2f5ce4,_0x6a1daf){return function(_0x14a688){if(_0x14a688){var _0x255360=typeof _0x6a1daf[_0xe872('0x17')]===_0xe872('0x18')&&typeof _0x6a1daf['limit']===_0xe872('0x18');var _0x13953e=_0x14a688['count'];var _0x16d467=_0x255360?0x0:_0x6a1daf['offset'];var _0x512399=_0x255360?_0x14a688[_0xe872('0x19')]:_0x6a1daf[_0xe872('0x17')]+_0x6a1daf[_0xe872('0x1a')];var _0x22e7d5;if(_0x512399>=_0x13953e){_0x512399=_0x13953e;_0x22e7d5=0xc8;}else{_0x22e7d5=0xce;}_0x2f5ce4[_0xe872('0x15')](_0x22e7d5);return _0x2f5ce4[_0xe872('0x1b')](_0xe872('0x1c'),_0x16d467+'-'+_0x512399+'/'+_0x13953e)[_0xe872('0x16')](_0x14a688);}return null;};}function patchUpdates(_0x5d0161){return function(_0x512a69){try{jsonpatch[_0xe872('0x1d')](_0x512a69,_0x5d0161,!![]);}catch(_0x16e06e){return BPromise[_0xe872('0x1e')](_0x16e06e);}return _0x512a69[_0xe872('0x1f')]();};}function saveUpdates(_0x3061aa,_0x2cff5f){return function(_0x16e061){if(_0x16e061){return _0x16e061[_0xe872('0x20')](_0x3061aa)[_0xe872('0x21')](function(_0x3cd993){return _0x3cd993;});}return null;};}function removeEntity(_0x585b29,_0x4436fe){return function(_0xd1557a){if(_0xd1557a){return _0xd1557a['destroy']()[_0xe872('0x21')](function(){_0x585b29[_0xe872('0x15')](0xcc)[_0xe872('0x22')]();});}};}function handleEntityNotFound(_0x5378b1,_0x25e92a){return function(_0x4707bf){if(!_0x4707bf){_0x5378b1[_0xe872('0x14')](0x194);}return _0x4707bf;};}function handleError(_0xe7ae8e,_0x4cc0c0){_0x4cc0c0=_0x4cc0c0||0x1f4;return function(_0x2d38d8){logger[_0xe872('0x23')](_0x2d38d8[_0xe872('0x24')]);if(_0x2d38d8['name']){delete _0x2d38d8['name'];}_0xe7ae8e[_0xe872('0x15')](_0x4cc0c0)[_0xe872('0x25')](_0x2d38d8);};}exports[_0xe872('0x26')]=function(_0x348582,_0x33621f){var _0x57422d={},_0x3d05c3={},_0x195805={'count':0x0,'rows':[]};var _0x2afd93=_[_0xe872('0x27')](db[_0xe872('0x28')][_0xe872('0x29')],function(_0x32da2a){return{'name':_0x32da2a[_0xe872('0x2a')],'type':_0x32da2a[_0xe872('0x2b')]['key']};});_0x3d05c3['model']=_[_0xe872('0x27')](_0x2afd93,'name');_0x3d05c3[_0xe872('0x2c')]=_[_0xe872('0x2d')](_0x348582[_0xe872('0x2c')]);_0x3d05c3['filters']=_[_0xe872('0x2e')](_0x3d05c3['model'],_0x3d05c3['query']);_0x57422d['attributes']=_[_0xe872('0x2e')](_0x3d05c3[_0xe872('0x2f')],qs[_0xe872('0x30')](_0x348582[_0xe872('0x2c')][_0xe872('0x30')]));_0x57422d[_0xe872('0x31')]=_0x57422d[_0xe872('0x31')][_0xe872('0x32')]?_0x57422d[_0xe872('0x31')]:_0x3d05c3[_0xe872('0x2f')];if(!_0x348582[_0xe872('0x2c')]['hasOwnProperty'](_0xe872('0x33'))){_0x57422d[_0xe872('0x1a')]=qs[_0xe872('0x1a')](_0x348582[_0xe872('0x2c')][_0xe872('0x1a')]);_0x57422d[_0xe872('0x17')]=qs[_0xe872('0x17')](_0x348582['query'][_0xe872('0x17')]);}_0x57422d[_0xe872('0x34')]=qs[_0xe872('0x35')](_0x348582[_0xe872('0x2c')][_0xe872('0x35')]);_0x57422d['where']=qs[_0xe872('0x36')](_[_0xe872('0x37')](_0x348582[_0xe872('0x2c')],_0x3d05c3[_0xe872('0x36')]),_0x2afd93);if(_0x348582[_0xe872('0x2c')][_0xe872('0x38')]){_0x57422d[_0xe872('0x39')]=_[_0xe872('0x3a')](_0x57422d['where'],{'$or':_['map'](_0x2afd93,function(_0x321560){if(_0x321560[_0xe872('0x2b')]!==_0xe872('0x3b')){var _0x2b167a={};_0x2b167a[_0x321560['name']]={'$like':'%'+_0x348582[_0xe872('0x2c')][_0xe872('0x38')]+'%'};return _0x2b167a;}})});}_0x57422d=_[_0xe872('0x3a')]({},_0x57422d,_0x348582[_0xe872('0x3c')]);var _0x8985f5={'where':_0x57422d[_0xe872('0x39')]};return db[_0xe872('0x28')][_0xe872('0x19')](_0x8985f5)['then'](function(_0x1c5653){_0x195805[_0xe872('0x19')]=_0x1c5653;if(_0x348582['query'][_0xe872('0x3d')]){_0x57422d['include']=[{'all':!![]}];}return db[_0xe872('0x28')][_0xe872('0x3e')](_0x57422d);})[_0xe872('0x21')](function(_0x1ab5e8){_0x195805['rows']=_0x1ab5e8;return _0x195805;})[_0xe872('0x21')](respondWithFilteredResult(_0x33621f,_0x57422d))[_0xe872('0x3f')](handleError(_0x33621f,null));};exports[_0xe872('0x40')]=function(_0x10609f,_0x50ca5b){var _0x47f1f2={'raw':![],'where':{'id':_0x10609f[_0xe872('0x41')]['id']}},_0x5906c0={};_0x5906c0['model']=_[_0xe872('0x2d')](db[_0xe872('0x28')]['rawAttributes']);_0x5906c0[_0xe872('0x2c')]=_[_0xe872('0x2d')](_0x10609f[_0xe872('0x2c')]);_0x5906c0['filters']=_[_0xe872('0x2e')](_0x5906c0['model'],_0x5906c0[_0xe872('0x2c')]);_0x47f1f2['attributes']=_['intersection'](_0x5906c0[_0xe872('0x2f')],qs[_0xe872('0x30')](_0x10609f[_0xe872('0x2c')][_0xe872('0x30')]));_0x47f1f2[_0xe872('0x31')]=_0x47f1f2[_0xe872('0x31')]['length']?_0x47f1f2['attributes']:_0x5906c0[_0xe872('0x2f')];if(_0x10609f[_0xe872('0x2c')][_0xe872('0x3d')]){_0x47f1f2[_0xe872('0x42')]=[{'all':!![]}];}_0x47f1f2=_[_0xe872('0x3a')]({},_0x47f1f2,_0x10609f[_0xe872('0x3c')]);return db[_0xe872('0x28')][_0xe872('0x43')](_0x47f1f2)[_0xe872('0x21')](handleEntityNotFound(_0x50ca5b,null))[_0xe872('0x21')](respondWithResult(_0x50ca5b,null))[_0xe872('0x3f')](handleError(_0x50ca5b,null));};exports['create']=function(_0x246db4,_0x89c695){return db[_0xe872('0x28')][_0xe872('0x44')](_0x246db4['body'],{})['then'](respondWithResult(_0x89c695,0xc9))[_0xe872('0x3f')](handleError(_0x89c695,null));};exports[_0xe872('0x20')]=function(_0x439b4d,_0x4f5ec3){if(_0x439b4d['body']['id']){delete _0x439b4d[_0xe872('0x45')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x439b4d[_0xe872('0x41')]['id']}})[_0xe872('0x21')](handleEntityNotFound(_0x4f5ec3,null))[_0xe872('0x21')](saveUpdates(_0x439b4d[_0xe872('0x45')],null))[_0xe872('0x21')](respondWithResult(_0x4f5ec3,null))[_0xe872('0x3f')](handleError(_0x4f5ec3,null));};exports[_0xe872('0x46')]=function(_0x1e9690,_0x1108ef){return db[_0xe872('0x28')][_0xe872('0x43')]({'where':{'id':_0x1e9690[_0xe872('0x41')]['id']}})[_0xe872('0x21')](handleEntityNotFound(_0x1108ef,null))[_0xe872('0x21')](removeEntity(_0x1108ef,null))[_0xe872('0x3f')](handleError(_0x1108ef,null));};exports[_0xe872('0x47')]=function(_0x53fa10,_0x8ac734,_0x488c31){var _0x2e64ef={};var _0x5b6dac={};var _0x2cdee3;var _0x31f174;return db[_0xe872('0x28')][_0xe872('0x48')]({'where':{'id':_0x53fa10[_0xe872('0x41')]['id']}})[_0xe872('0x21')](handleEntityNotFound(_0x8ac734,null))['then'](function(_0x5c381d){if(_0x5c381d){_0x2cdee3=_0x5c381d;_0x5b6dac[_0xe872('0x2f')]=_['keys'](db[_0xe872('0x49')]['rawAttributes']);_0x5b6dac['query']=_['keys'](_0x53fa10[_0xe872('0x2c')]);_0x5b6dac[_0xe872('0x36')]=_[_0xe872('0x2e')](_0x5b6dac[_0xe872('0x2f')],_0x5b6dac['query']);_0x2e64ef['attributes']=_[_0xe872('0x2e')](_0x5b6dac[_0xe872('0x2f')],qs[_0xe872('0x30')](_0x53fa10['query']['fields']));_0x2e64ef[_0xe872('0x31')]=_0x2e64ef[_0xe872('0x31')][_0xe872('0x32')]?_0x2e64ef[_0xe872('0x31')]:_0x5b6dac[_0xe872('0x2f')];_0x2e64ef[_0xe872('0x34')]=qs['sort'](_0x53fa10[_0xe872('0x2c')][_0xe872('0x35')]);_0x2e64ef[_0xe872('0x39')]=qs['filters'](_[_0xe872('0x37')](_0x53fa10[_0xe872('0x2c')],_0x5b6dac[_0xe872('0x36')]));if(_0x53fa10['query'][_0xe872('0x38')]){_0x2e64ef[_0xe872('0x39')]=_[_0xe872('0x3a')](_0x2e64ef[_0xe872('0x39')],{'$or':_['map'](_0x2e64ef[_0xe872('0x31')],function(_0x330cd4){var _0x3de51c={};_0x3de51c[_0x330cd4]={'$like':'%'+_0x53fa10[_0xe872('0x2c')]['filter']+'%'};return _0x3de51c;})});}_0x2e64ef=_['merge']({},_0x2e64ef,_0x53fa10[_0xe872('0x3c')]);return _0x2cdee3[_0xe872('0x47')](_0x2e64ef);}})[_0xe872('0x21')](function(_0x255d6b){if(_0x255d6b){_0x31f174=_0x255d6b[_0xe872('0x32')];if(!_0x53fa10[_0xe872('0x2c')][_0xe872('0x4a')]('nolimit')){_0x2e64ef['limit']=qs['limit'](_0x53fa10['query'][_0xe872('0x1a')]);_0x2e64ef['offset']=qs[_0xe872('0x17')](_0x53fa10[_0xe872('0x2c')]['offset']);}return _0x2cdee3['getFields'](_0x2e64ef);}})[_0xe872('0x21')](function(_0x54a515){if(_0x54a515){return _0x54a515?{'count':_0x31f174,'rows':_0x54a515}:null;}})[_0xe872('0x21')](respondWithResult(_0x8ac734,null))[_0xe872('0x3f')](handleError(_0x8ac734,null));};exports[_0xe872('0x4b')]=function(_0x1ca6d8,_0x23da61,_0x14eebe){var _0x28c2a2={};var _0x3a0db3={};var _0x146bc1;var _0x520e74;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x1ca6d8[_0xe872('0x41')]['id']}})[_0xe872('0x21')](handleEntityNotFound(_0x23da61,null))[_0xe872('0x21')](function(_0x25e06b){if(_0x25e06b){_0x146bc1=_0x25e06b;_0x3a0db3['model']=_[_0xe872('0x2d')](db[_0xe872('0x49')]['rawAttributes']);_0x3a0db3[_0xe872('0x2c')]=_[_0xe872('0x2d')](_0x1ca6d8[_0xe872('0x2c')]);_0x3a0db3[_0xe872('0x36')]=_[_0xe872('0x2e')](_0x3a0db3['model'],_0x3a0db3[_0xe872('0x2c')]);_0x28c2a2[_0xe872('0x31')]=_[_0xe872('0x2e')](_0x3a0db3[_0xe872('0x2f')],qs['fields'](_0x1ca6d8['query'][_0xe872('0x30')]));_0x28c2a2[_0xe872('0x31')]=_0x28c2a2[_0xe872('0x31')]['length']?_0x28c2a2['attributes']:_0x3a0db3[_0xe872('0x2f')];_0x28c2a2[_0xe872('0x34')]=qs[_0xe872('0x35')](_0x1ca6d8['query'][_0xe872('0x35')]);_0x28c2a2['where']=qs[_0xe872('0x36')](_[_0xe872('0x37')](_0x1ca6d8[_0xe872('0x2c')],_0x3a0db3['filters']));if(_0x1ca6d8[_0xe872('0x2c')]['filter']){_0x28c2a2['where']=_['merge'](_0x28c2a2[_0xe872('0x39')],{'$or':_[_0xe872('0x27')](_0x28c2a2[_0xe872('0x31')],function(_0x2b51ad){var _0x30a7ea={};_0x30a7ea[_0x2b51ad]={'$like':'%'+_0x1ca6d8[_0xe872('0x2c')][_0xe872('0x38')]+'%'};return _0x30a7ea;})});}_0x28c2a2=_[_0xe872('0x3a')]({},_0x28c2a2,_0x1ca6d8[_0xe872('0x3c')]);return _0x146bc1[_0xe872('0x4b')](_0x28c2a2);}})['then'](function(_0x1d30d4){if(_0x1d30d4){_0x520e74=_0x1d30d4[_0xe872('0x32')];if(!_0x1ca6d8[_0xe872('0x2c')][_0xe872('0x4a')](_0xe872('0x33'))){_0x28c2a2[_0xe872('0x1a')]=qs[_0xe872('0x1a')](_0x1ca6d8[_0xe872('0x2c')][_0xe872('0x1a')]);_0x28c2a2['offset']=qs[_0xe872('0x17')](_0x1ca6d8['query']['offset']);}return _0x146bc1['getSubjects'](_0x28c2a2);}})['then'](function(_0x8b65f9){if(_0x8b65f9){return _0x8b65f9?{'count':_0x520e74,'rows':_0x8b65f9}:null;}})['then'](respondWithResult(_0x23da61,null))[_0xe872('0x3f')](handleError(_0x23da61,null));};exports[_0xe872('0x4c')]=function(_0x2b8088,_0x476e59,_0x266c07){var _0x51365e={};var _0xadc326={};var _0x2b4cce;var _0x1381c3;return db[_0xe872('0x28')][_0xe872('0x48')]({'where':{'id':_0x2b8088[_0xe872('0x41')]['id']}})[_0xe872('0x21')](handleEntityNotFound(_0x476e59,null))['then'](function(_0x193c17){if(_0x193c17){_0x2b4cce=_0x193c17;_0xadc326[_0xe872('0x2f')]=_['keys'](db[_0xe872('0x49')][_0xe872('0x29')]);_0xadc326[_0xe872('0x2c')]=_[_0xe872('0x2d')](_0x2b8088[_0xe872('0x2c')]);_0xadc326[_0xe872('0x36')]=_['intersection'](_0xadc326['model'],_0xadc326['query']);_0x51365e[_0xe872('0x31')]=_[_0xe872('0x2e')](_0xadc326[_0xe872('0x2f')],qs[_0xe872('0x30')](_0x2b8088[_0xe872('0x2c')][_0xe872('0x30')]));_0x51365e[_0xe872('0x31')]=_0x51365e['attributes'][_0xe872('0x32')]?_0x51365e[_0xe872('0x31')]:_0xadc326[_0xe872('0x2f')];_0x51365e[_0xe872('0x34')]=qs[_0xe872('0x35')](_0x2b8088[_0xe872('0x2c')]['sort']);_0x51365e[_0xe872('0x39')]=qs[_0xe872('0x36')](_[_0xe872('0x37')](_0x2b8088['query'],_0xadc326[_0xe872('0x36')]));if(_0x2b8088[_0xe872('0x2c')][_0xe872('0x38')]){_0x51365e[_0xe872('0x39')]=_['merge'](_0x51365e[_0xe872('0x39')],{'$or':_[_0xe872('0x27')](_0x51365e[_0xe872('0x31')],function(_0x5cc4cc){var _0x2fc7b0={};_0x2fc7b0[_0x5cc4cc]={'$like':'%'+_0x2b8088[_0xe872('0x2c')][_0xe872('0x38')]+'%'};return _0x2fc7b0;})});}_0x51365e=_['merge']({},_0x51365e,_0x2b8088[_0xe872('0x3c')]);return _0x2b4cce[_0xe872('0x4c')](_0x51365e);}})['then'](function(_0x38cfb7){if(_0x38cfb7){_0x1381c3=_0x38cfb7[_0xe872('0x32')];if(!_0x2b8088[_0xe872('0x2c')][_0xe872('0x4a')](_0xe872('0x33'))){_0x51365e[_0xe872('0x1a')]=qs[_0xe872('0x1a')](_0x2b8088[_0xe872('0x2c')][_0xe872('0x1a')]);_0x51365e[_0xe872('0x17')]=qs[_0xe872('0x17')](_0x2b8088[_0xe872('0x2c')][_0xe872('0x17')]);}return _0x2b4cce['getDescriptions'](_0x51365e);}})[_0xe872('0x21')](function(_0x561e5b){if(_0x561e5b){return _0x561e5b?{'count':_0x1381c3,'rows':_0x561e5b}:null;}})['then'](respondWithResult(_0x476e59,null))[_0xe872('0x3f')](handleError(_0x476e59,null));};exports[_0xe872('0x4d')]=function(_0x348159,_0x196342,_0x13198a){var _0x33e50f={};var _0x3dec01={};var _0x16123e;var _0x507b64;return db[_0xe872('0x28')]['findOne']({'where':{'id':_0x348159[_0xe872('0x41')]['id']}})['then'](handleEntityNotFound(_0x196342,null))[_0xe872('0x21')](function(_0x283ef){if(_0x283ef){_0x16123e=_0x283ef;_0x3dec01[_0xe872('0x2f')]=_['keys'](db['Tag'][_0xe872('0x29')]);_0x3dec01[_0xe872('0x2c')]=_[_0xe872('0x2d')](_0x348159[_0xe872('0x2c')]);_0x3dec01['filters']=_[_0xe872('0x2e')](_0x3dec01[_0xe872('0x2f')],_0x3dec01[_0xe872('0x2c')]);_0x33e50f[_0xe872('0x31')]=_['intersection'](_0x3dec01[_0xe872('0x2f')],qs[_0xe872('0x30')](_0x348159[_0xe872('0x2c')]['fields']));_0x33e50f['attributes']=_0x33e50f[_0xe872('0x31')]['length']?_0x33e50f[_0xe872('0x31')]:_0x3dec01[_0xe872('0x2f')];_0x33e50f['order']=qs[_0xe872('0x35')](_0x348159[_0xe872('0x2c')][_0xe872('0x35')]);_0x33e50f[_0xe872('0x39')]=qs['filters'](_[_0xe872('0x37')](_0x348159[_0xe872('0x2c')],_0x3dec01['filters']));if(_0x348159[_0xe872('0x2c')][_0xe872('0x38')]){_0x33e50f[_0xe872('0x39')]=_[_0xe872('0x3a')](_0x33e50f['where'],{'$or':_[_0xe872('0x27')](_0x33e50f[_0xe872('0x31')],function(_0x31fade){var _0x35b589={};_0x35b589[_0x31fade]={'$like':'%'+_0x348159[_0xe872('0x2c')][_0xe872('0x38')]+'%'};return _0x35b589;})});}_0x33e50f=_['merge']({},_0x33e50f,_0x348159[_0xe872('0x3c')]);return _0x16123e[_0xe872('0x4d')](_0x33e50f);}})['then'](function(_0x59a3c8){if(_0x59a3c8){_0x507b64=_0x59a3c8[_0xe872('0x32')];if(!_0x348159[_0xe872('0x2c')][_0xe872('0x4a')](_0xe872('0x33'))){_0x33e50f[_0xe872('0x1a')]=qs[_0xe872('0x1a')](_0x348159[_0xe872('0x2c')][_0xe872('0x1a')]);_0x33e50f[_0xe872('0x17')]=qs[_0xe872('0x17')](_0x348159[_0xe872('0x2c')][_0xe872('0x17')]);}return _0x16123e['getTags'](_0x33e50f);}})[_0xe872('0x21')](function(_0x22907c){if(_0x22907c){return _0x22907c?{'count':_0x507b64,'rows':_0x22907c}:null;}})['then'](respondWithResult(_0x196342,null))[_0xe872('0x3f')](handleError(_0x196342,null));};exports[_0xe872('0x4e')]=function(_0x19bf34,_0x39e6fc,_0x1d49c1){if(_0x19bf34[_0xe872('0x45')]['id']){delete _0x19bf34[_0xe872('0x45')]['id'];}return db[_0xe872('0x28')][_0xe872('0x48')]({'where':{'id':_0x19bf34[_0xe872('0x41')]['id']}})['then'](handleEntityNotFound(_0x39e6fc,null))[_0xe872('0x21')](function(_0x105d2e){if(_0x105d2e){return _0x105d2e[_0xe872('0x4e')](_0x19bf34[_0xe872('0x45')][_0xe872('0x4f')]||[]);}return null;})[_0xe872('0x21')](respondWithResult(_0x39e6fc,null))[_0xe872('0x3f')](handleError(_0x39e6fc,null));}; \ No newline at end of file +var _0xf49e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','params','keys','find','create','body','getFields','findOne','FreshdeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0xf49e,0xa6));var _0xef49=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf49e[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef49('0x0'));var zipdir=require(_0xef49('0x1'));var jsonpatch=require(_0xef49('0x2'));var rp=require(_0xef49('0x3'));var moment=require(_0xef49('0x4'));var BPromise=require(_0xef49('0x5'));var Mustache=require(_0xef49('0x6'));var util=require('util');var path=require(_0xef49('0x7'));var sox=require(_0xef49('0x8'));var csv=require(_0xef49('0x9'));var ejs=require(_0xef49('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef49('0xb'));var squel=require(_0xef49('0xc'));var crypto=require('crypto');var jsforce=require(_0xef49('0xd'));var deskjs=require(_0xef49('0xe'));var toCsv=require('to-csv');var querystring=require(_0xef49('0xf'));var Papa=require(_0xef49('0x10'));var Redis=require('ioredis');var authService=require(_0xef49('0x11'));var qs=require(_0xef49('0x12'));var as=require(_0xef49('0x13'));var hardwareService=require(_0xef49('0x14'));var logger=require(_0xef49('0x15'))(_0xef49('0x16'));var utils=require(_0xef49('0x17'));var config=require(_0xef49('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xef49('0x19'))['db'];function respondWithStatusCode(_0x2f7422,_0x38e398){_0x38e398=_0x38e398||0xcc;return function(_0xf6c8e5){if(_0xf6c8e5){return _0x2f7422[_0xef49('0x1a')](_0x38e398);}return _0x2f7422[_0xef49('0x1b')](_0x38e398)[_0xef49('0x1c')]();};}function respondWithResult(_0x8ebcd1,_0x2096ce){_0x2096ce=_0x2096ce||0xc8;return function(_0x4898fc){if(_0x4898fc){return _0x8ebcd1[_0xef49('0x1b')](_0x2096ce)[_0xef49('0x1d')](_0x4898fc);}};}function respondWithFilteredResult(_0x6ed39b,_0x59a9bc){return function(_0x4a11a9){if(_0x4a11a9){var _0x17ff68=typeof _0x59a9bc[_0xef49('0x1e')]===_0xef49('0x1f')&&typeof _0x59a9bc[_0xef49('0x20')]===_0xef49('0x1f');var _0x39c6c9=_0x4a11a9[_0xef49('0x21')];var _0x47b506=_0x17ff68?0x0:_0x59a9bc[_0xef49('0x1e')];var _0x3d5704=_0x17ff68?_0x4a11a9[_0xef49('0x21')]:_0x59a9bc[_0xef49('0x1e')]+_0x59a9bc['limit'];var _0x3f76fc;if(_0x3d5704>=_0x39c6c9){_0x3d5704=_0x39c6c9;_0x3f76fc=0xc8;}else{_0x3f76fc=0xce;}_0x6ed39b[_0xef49('0x1b')](_0x3f76fc);return _0x6ed39b[_0xef49('0x22')](_0xef49('0x23'),_0x47b506+'-'+_0x3d5704+'/'+_0x39c6c9)['json'](_0x4a11a9);}return null;};}function patchUpdates(_0x5d99a1){return function(_0x29e2f3){try{jsonpatch[_0xef49('0x24')](_0x29e2f3,_0x5d99a1,!![]);}catch(_0x5dd159){return BPromise[_0xef49('0x25')](_0x5dd159);}return _0x29e2f3[_0xef49('0x26')]();};}function saveUpdates(_0x926263,_0x13ff05){return function(_0x12988e){if(_0x12988e){return _0x12988e[_0xef49('0x27')](_0x926263)[_0xef49('0x28')](function(_0x4c03dc){return _0x4c03dc;});}return null;};}function removeEntity(_0xb1f886,_0xd69967){return function(_0x3ed2ea){if(_0x3ed2ea){return _0x3ed2ea[_0xef49('0x29')]()[_0xef49('0x28')](function(){_0xb1f886['status'](0xcc)[_0xef49('0x1c')]();});}};}function handleEntityNotFound(_0x12d4ce,_0x449eec){return function(_0x1a6861){if(!_0x1a6861){_0x12d4ce['sendStatus'](0x194);}return _0x1a6861;};}function handleError(_0x4b14a6,_0x440964){_0x440964=_0x440964||0x1f4;return function(_0x158723){logger[_0xef49('0x2a')](_0x158723[_0xef49('0x2b')]);if(_0x158723[_0xef49('0x2c')]){delete _0x158723[_0xef49('0x2c')];}_0x4b14a6['status'](_0x440964)['send'](_0x158723);};}exports[_0xef49('0x2d')]=function(_0x2c4a95,_0x501962){var _0x48248a={},_0x205aff={},_0x7db41b={'count':0x0,'rows':[]};var _0x2c5d67=_[_0xef49('0x2e')](db[_0xef49('0x2f')][_0xef49('0x30')],function(_0xcb13fd){return{'name':_0xcb13fd['fieldName'],'type':_0xcb13fd[_0xef49('0x31')]['key']};});_0x205aff['model']=_[_0xef49('0x2e')](_0x2c5d67,'name');_0x205aff[_0xef49('0x32')]=_['keys'](_0x2c4a95[_0xef49('0x32')]);_0x205aff[_0xef49('0x33')]=_[_0xef49('0x34')](_0x205aff[_0xef49('0x35')],_0x205aff[_0xef49('0x32')]);_0x48248a['attributes']=_[_0xef49('0x34')](_0x205aff[_0xef49('0x35')],qs[_0xef49('0x36')](_0x2c4a95[_0xef49('0x32')]['fields']));_0x48248a['attributes']=_0x48248a[_0xef49('0x37')][_0xef49('0x38')]?_0x48248a[_0xef49('0x37')]:_0x205aff['model'];if(!_0x2c4a95['query']['hasOwnProperty'](_0xef49('0x39'))){_0x48248a[_0xef49('0x20')]=qs[_0xef49('0x20')](_0x2c4a95['query'][_0xef49('0x20')]);_0x48248a[_0xef49('0x1e')]=qs[_0xef49('0x1e')](_0x2c4a95[_0xef49('0x32')]['offset']);}_0x48248a[_0xef49('0x3a')]=qs[_0xef49('0x3b')](_0x2c4a95[_0xef49('0x32')][_0xef49('0x3b')]);_0x48248a['where']=qs[_0xef49('0x33')](_['pick'](_0x2c4a95['query'],_0x205aff[_0xef49('0x33')]),_0x2c5d67);if(_0x2c4a95[_0xef49('0x32')][_0xef49('0x3c')]){_0x48248a[_0xef49('0x3d')]=_[_0xef49('0x3e')](_0x48248a[_0xef49('0x3d')],{'$or':_[_0xef49('0x2e')](_0x2c5d67,function(_0x1d75ec){if(_0x1d75ec['type']!=='VIRTUAL'){var _0xf7703f={};_0xf7703f[_0x1d75ec[_0xef49('0x2c')]]={'$like':'%'+_0x2c4a95['query'][_0xef49('0x3c')]+'%'};return _0xf7703f;}})});}_0x48248a=_[_0xef49('0x3e')]({},_0x48248a,_0x2c4a95[_0xef49('0x3f')]);var _0x1d083f={'where':_0x48248a[_0xef49('0x3d')]};return db[_0xef49('0x2f')][_0xef49('0x21')](_0x1d083f)[_0xef49('0x28')](function(_0x42ef28){_0x7db41b['count']=_0x42ef28;if(_0x2c4a95[_0xef49('0x32')][_0xef49('0x40')]){_0x48248a['include']=[{'all':!![]}];}return db[_0xef49('0x2f')][_0xef49('0x41')](_0x48248a);})['then'](function(_0x75a06d){_0x7db41b[_0xef49('0x42')]=_0x75a06d;return _0x7db41b;})['then'](respondWithFilteredResult(_0x501962,_0x48248a))[_0xef49('0x43')](handleError(_0x501962,null));};exports['show']=function(_0x43629a,_0x319c87){var _0x506199={'raw':![],'where':{'id':_0x43629a[_0xef49('0x44')]['id']}},_0x18d94e={};_0x18d94e['model']=_['keys'](db[_0xef49('0x2f')]['rawAttributes']);_0x18d94e[_0xef49('0x32')]=_[_0xef49('0x45')](_0x43629a['query']);_0x18d94e[_0xef49('0x33')]=_[_0xef49('0x34')](_0x18d94e['model'],_0x18d94e['query']);_0x506199[_0xef49('0x37')]=_[_0xef49('0x34')](_0x18d94e[_0xef49('0x35')],qs[_0xef49('0x36')](_0x43629a['query'][_0xef49('0x36')]));_0x506199[_0xef49('0x37')]=_0x506199[_0xef49('0x37')][_0xef49('0x38')]?_0x506199['attributes']:_0x18d94e[_0xef49('0x35')];if(_0x43629a['query']['includeAll']){_0x506199['include']=[{'all':!![]}];}_0x506199=_['merge']({},_0x506199,_0x43629a[_0xef49('0x3f')]);return db[_0xef49('0x2f')][_0xef49('0x46')](_0x506199)['then'](handleEntityNotFound(_0x319c87,null))['then'](respondWithResult(_0x319c87,null))['catch'](handleError(_0x319c87,null));};exports[_0xef49('0x47')]=function(_0x4a91e3,_0x8679d9){return db['FreshdeskConfiguration'][_0xef49('0x47')](_0x4a91e3[_0xef49('0x48')],{})[_0xef49('0x28')](respondWithResult(_0x8679d9,0xc9))[_0xef49('0x43')](handleError(_0x8679d9,null));};exports[_0xef49('0x27')]=function(_0x3f11b8,_0x13eba6){if(_0x3f11b8['body']['id']){delete _0x3f11b8[_0xef49('0x48')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3f11b8['params']['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x13eba6,null))[_0xef49('0x28')](saveUpdates(_0x3f11b8[_0xef49('0x48')],null))[_0xef49('0x28')](respondWithResult(_0x13eba6,null))[_0xef49('0x43')](handleError(_0x13eba6,null));};exports[_0xef49('0x29')]=function(_0x8830e1,_0x3f69b8){return db['FreshdeskConfiguration'][_0xef49('0x46')]({'where':{'id':_0x8830e1[_0xef49('0x44')]['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x3f69b8,null))[_0xef49('0x28')](removeEntity(_0x3f69b8,null))[_0xef49('0x43')](handleError(_0x3f69b8,null));};exports[_0xef49('0x49')]=function(_0x4e074c,_0x15e7f0,_0x2e3b06){var _0x54ab50={};var _0x3b3d89={};var _0x32ab10;var _0x449126;return db['FreshdeskConfiguration'][_0xef49('0x4a')]({'where':{'id':_0x4e074c['params']['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x15e7f0,null))[_0xef49('0x28')](function(_0x10148a){if(_0x10148a){_0x32ab10=_0x10148a;_0x3b3d89[_0xef49('0x35')]=_[_0xef49('0x45')](db[_0xef49('0x4b')][_0xef49('0x30')]);_0x3b3d89[_0xef49('0x32')]=_[_0xef49('0x45')](_0x4e074c[_0xef49('0x32')]);_0x3b3d89[_0xef49('0x33')]=_[_0xef49('0x34')](_0x3b3d89[_0xef49('0x35')],_0x3b3d89[_0xef49('0x32')]);_0x54ab50[_0xef49('0x37')]=_[_0xef49('0x34')](_0x3b3d89[_0xef49('0x35')],qs[_0xef49('0x36')](_0x4e074c[_0xef49('0x32')][_0xef49('0x36')]));_0x54ab50[_0xef49('0x37')]=_0x54ab50[_0xef49('0x37')]['length']?_0x54ab50[_0xef49('0x37')]:_0x3b3d89[_0xef49('0x35')];_0x54ab50[_0xef49('0x3a')]=qs[_0xef49('0x3b')](_0x4e074c['query']['sort']);_0x54ab50['where']=qs[_0xef49('0x33')](_[_0xef49('0x4c')](_0x4e074c['query'],_0x3b3d89[_0xef49('0x33')]));if(_0x4e074c[_0xef49('0x32')][_0xef49('0x3c')]){_0x54ab50[_0xef49('0x3d')]=_['merge'](_0x54ab50[_0xef49('0x3d')],{'$or':_[_0xef49('0x2e')](_0x54ab50[_0xef49('0x37')],function(_0x28b2ee){var _0x5642d3={};_0x5642d3[_0x28b2ee]={'$like':'%'+_0x4e074c['query'][_0xef49('0x3c')]+'%'};return _0x5642d3;})});}_0x54ab50=_[_0xef49('0x3e')]({},_0x54ab50,_0x4e074c[_0xef49('0x3f')]);return _0x32ab10['getFields'](_0x54ab50);}})[_0xef49('0x28')](function(_0x43c712){if(_0x43c712){_0x449126=_0x43c712[_0xef49('0x38')];if(!_0x4e074c['query'][_0xef49('0x4d')]('nolimit')){_0x54ab50['limit']=qs[_0xef49('0x20')](_0x4e074c['query'][_0xef49('0x20')]);_0x54ab50['offset']=qs[_0xef49('0x1e')](_0x4e074c[_0xef49('0x32')]['offset']);}return _0x32ab10[_0xef49('0x49')](_0x54ab50);}})['then'](function(_0xcf9229){if(_0xcf9229){return _0xcf9229?{'count':_0x449126,'rows':_0xcf9229}:null;}})[_0xef49('0x28')](respondWithResult(_0x15e7f0,null))['catch'](handleError(_0x15e7f0,null));};exports[_0xef49('0x4e')]=function(_0x5f19a6,_0x1080f8,_0x57a06c){var _0x42683a={};var _0x560cf9={};var _0x9b1f97;var _0x228b8f;return db[_0xef49('0x2f')][_0xef49('0x4a')]({'where':{'id':_0x5f19a6['params']['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x1080f8,null))[_0xef49('0x28')](function(_0x48d013){if(_0x48d013){_0x9b1f97=_0x48d013;_0x560cf9[_0xef49('0x35')]=_['keys'](db[_0xef49('0x4b')][_0xef49('0x30')]);_0x560cf9[_0xef49('0x32')]=_[_0xef49('0x45')](_0x5f19a6['query']);_0x560cf9[_0xef49('0x33')]=_['intersection'](_0x560cf9[_0xef49('0x35')],_0x560cf9['query']);_0x42683a['attributes']=_[_0xef49('0x34')](_0x560cf9['model'],qs[_0xef49('0x36')](_0x5f19a6[_0xef49('0x32')][_0xef49('0x36')]));_0x42683a[_0xef49('0x37')]=_0x42683a[_0xef49('0x37')][_0xef49('0x38')]?_0x42683a[_0xef49('0x37')]:_0x560cf9[_0xef49('0x35')];_0x42683a[_0xef49('0x3a')]=qs[_0xef49('0x3b')](_0x5f19a6[_0xef49('0x32')][_0xef49('0x3b')]);_0x42683a[_0xef49('0x3d')]=qs[_0xef49('0x33')](_[_0xef49('0x4c')](_0x5f19a6['query'],_0x560cf9[_0xef49('0x33')]));if(_0x5f19a6[_0xef49('0x32')]['filter']){_0x42683a['where']=_['merge'](_0x42683a['where'],{'$or':_['map'](_0x42683a[_0xef49('0x37')],function(_0x421bee){var _0x77544d={};_0x77544d[_0x421bee]={'$like':'%'+_0x5f19a6[_0xef49('0x32')][_0xef49('0x3c')]+'%'};return _0x77544d;})});}_0x42683a=_[_0xef49('0x3e')]({},_0x42683a,_0x5f19a6[_0xef49('0x3f')]);return _0x9b1f97[_0xef49('0x4e')](_0x42683a);}})[_0xef49('0x28')](function(_0x23b93b){if(_0x23b93b){_0x228b8f=_0x23b93b[_0xef49('0x38')];if(!_0x5f19a6[_0xef49('0x32')][_0xef49('0x4d')](_0xef49('0x39'))){_0x42683a[_0xef49('0x20')]=qs[_0xef49('0x20')](_0x5f19a6[_0xef49('0x32')][_0xef49('0x20')]);_0x42683a[_0xef49('0x1e')]=qs[_0xef49('0x1e')](_0x5f19a6[_0xef49('0x32')][_0xef49('0x1e')]);}return _0x9b1f97[_0xef49('0x4e')](_0x42683a);}})[_0xef49('0x28')](function(_0x22e754){if(_0x22e754){return _0x22e754?{'count':_0x228b8f,'rows':_0x22e754}:null;}})[_0xef49('0x28')](respondWithResult(_0x1080f8,null))[_0xef49('0x43')](handleError(_0x1080f8,null));};exports[_0xef49('0x4f')]=function(_0x17cdb0,_0x352bf9,_0xfb5cec){var _0x5733b8={};var _0x2cf71f={};var _0x5a65b1;var _0x5d66a4;return db[_0xef49('0x2f')][_0xef49('0x4a')]({'where':{'id':_0x17cdb0['params']['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x352bf9,null))['then'](function(_0x2c1804){if(_0x2c1804){_0x5a65b1=_0x2c1804;_0x2cf71f[_0xef49('0x35')]=_[_0xef49('0x45')](db[_0xef49('0x4b')][_0xef49('0x30')]);_0x2cf71f[_0xef49('0x32')]=_['keys'](_0x17cdb0[_0xef49('0x32')]);_0x2cf71f[_0xef49('0x33')]=_['intersection'](_0x2cf71f[_0xef49('0x35')],_0x2cf71f[_0xef49('0x32')]);_0x5733b8['attributes']=_[_0xef49('0x34')](_0x2cf71f[_0xef49('0x35')],qs[_0xef49('0x36')](_0x17cdb0['query']['fields']));_0x5733b8[_0xef49('0x37')]=_0x5733b8[_0xef49('0x37')][_0xef49('0x38')]?_0x5733b8['attributes']:_0x2cf71f[_0xef49('0x35')];_0x5733b8[_0xef49('0x3a')]=qs['sort'](_0x17cdb0[_0xef49('0x32')]['sort']);_0x5733b8[_0xef49('0x3d')]=qs[_0xef49('0x33')](_[_0xef49('0x4c')](_0x17cdb0[_0xef49('0x32')],_0x2cf71f['filters']));if(_0x17cdb0[_0xef49('0x32')][_0xef49('0x3c')]){_0x5733b8['where']=_[_0xef49('0x3e')](_0x5733b8[_0xef49('0x3d')],{'$or':_[_0xef49('0x2e')](_0x5733b8['attributes'],function(_0x23dfb0){var _0xa210a2={};_0xa210a2[_0x23dfb0]={'$like':'%'+_0x17cdb0[_0xef49('0x32')][_0xef49('0x3c')]+'%'};return _0xa210a2;})});}_0x5733b8=_[_0xef49('0x3e')]({},_0x5733b8,_0x17cdb0[_0xef49('0x3f')]);return _0x5a65b1['getDescriptions'](_0x5733b8);}})[_0xef49('0x28')](function(_0x534996){if(_0x534996){_0x5d66a4=_0x534996[_0xef49('0x38')];if(!_0x17cdb0[_0xef49('0x32')]['hasOwnProperty']('nolimit')){_0x5733b8['limit']=qs[_0xef49('0x20')](_0x17cdb0[_0xef49('0x32')][_0xef49('0x20')]);_0x5733b8[_0xef49('0x1e')]=qs['offset'](_0x17cdb0[_0xef49('0x32')][_0xef49('0x1e')]);}return _0x5a65b1[_0xef49('0x4f')](_0x5733b8);}})[_0xef49('0x28')](function(_0x1db54d){if(_0x1db54d){return _0x1db54d?{'count':_0x5d66a4,'rows':_0x1db54d}:null;}})[_0xef49('0x28')](respondWithResult(_0x352bf9,null))['catch'](handleError(_0x352bf9,null));};exports[_0xef49('0x50')]=function(_0x4a3a35,_0x21a730,_0x5062a4){var _0x85a8e1={};var _0x57742b={};var _0x16a32f;var _0x50266d;return db['FreshdeskConfiguration'][_0xef49('0x4a')]({'where':{'id':_0x4a3a35[_0xef49('0x44')]['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x21a730,null))[_0xef49('0x28')](function(_0x4168f5){if(_0x4168f5){_0x16a32f=_0x4168f5;_0x57742b['model']=_[_0xef49('0x45')](db[_0xef49('0x51')]['rawAttributes']);_0x57742b[_0xef49('0x32')]=_[_0xef49('0x45')](_0x4a3a35[_0xef49('0x32')]);_0x57742b[_0xef49('0x33')]=_['intersection'](_0x57742b[_0xef49('0x35')],_0x57742b[_0xef49('0x32')]);_0x85a8e1['attributes']=_[_0xef49('0x34')](_0x57742b[_0xef49('0x35')],qs[_0xef49('0x36')](_0x4a3a35[_0xef49('0x32')][_0xef49('0x36')]));_0x85a8e1[_0xef49('0x37')]=_0x85a8e1['attributes'][_0xef49('0x38')]?_0x85a8e1[_0xef49('0x37')]:_0x57742b[_0xef49('0x35')];_0x85a8e1['order']=qs[_0xef49('0x3b')](_0x4a3a35[_0xef49('0x32')][_0xef49('0x3b')]);_0x85a8e1['where']=qs[_0xef49('0x33')](_[_0xef49('0x4c')](_0x4a3a35['query'],_0x57742b['filters']));if(_0x4a3a35[_0xef49('0x32')]['filter']){_0x85a8e1[_0xef49('0x3d')]=_['merge'](_0x85a8e1[_0xef49('0x3d')],{'$or':_['map'](_0x85a8e1['attributes'],function(_0x51b960){var _0x4eeb30={};_0x4eeb30[_0x51b960]={'$like':'%'+_0x4a3a35['query'][_0xef49('0x3c')]+'%'};return _0x4eeb30;})});}_0x85a8e1=_[_0xef49('0x3e')]({},_0x85a8e1,_0x4a3a35[_0xef49('0x3f')]);return _0x16a32f[_0xef49('0x50')](_0x85a8e1);}})[_0xef49('0x28')](function(_0x5d5d6e){if(_0x5d5d6e){_0x50266d=_0x5d5d6e[_0xef49('0x38')];if(!_0x4a3a35[_0xef49('0x32')][_0xef49('0x4d')]('nolimit')){_0x85a8e1['limit']=qs[_0xef49('0x20')](_0x4a3a35[_0xef49('0x32')][_0xef49('0x20')]);_0x85a8e1['offset']=qs[_0xef49('0x1e')](_0x4a3a35[_0xef49('0x32')][_0xef49('0x1e')]);}return _0x16a32f[_0xef49('0x50')](_0x85a8e1);}})['then'](function(_0x21ece7){if(_0x21ece7){return _0x21ece7?{'count':_0x50266d,'rows':_0x21ece7}:null;}})[_0xef49('0x28')](respondWithResult(_0x21a730,null))[_0xef49('0x43')](handleError(_0x21a730,null));};exports[_0xef49('0x52')]=function(_0x4d21e0,_0x4d0963,_0x2b7492){if(_0x4d21e0[_0xef49('0x48')]['id']){delete _0x4d21e0[_0xef49('0x48')]['id'];}return db['FreshdeskConfiguration'][_0xef49('0x4a')]({'where':{'id':_0x4d21e0[_0xef49('0x44')]['id']}})[_0xef49('0x28')](handleEntityNotFound(_0x4d0963,null))[_0xef49('0x28')](function(_0x3e506c){if(_0x3e506c){return _0x3e506c[_0xef49('0x52')](_0x4d21e0['body']['ids']||[]);}return null;})[_0xef49('0x28')](respondWithResult(_0x4d0963,null))[_0xef49('0x43')](handleError(_0x4d0963,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c10f8d2..bf8e327 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 _0x1490=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d5df3,_0x114958){var _0xdc373=function(_0x40629e){while(--_0x40629e){_0x2d5df3['push'](_0x2d5df3['shift']());}};_0xdc373(++_0x114958);}(_0x1490,0x7e));var _0x0149=function(_0x2174e9,_0x37503b){_0x2174e9=_0x2174e9-0x0;var _0x5980ce=_0x1490[_0x2174e9];return _0x5980ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0149('0x0'))('api');var moment=require(_0x0149('0x1'));var BPromise=require(_0x0149('0x2'));var rp=require(_0x0149('0x3'));var fs=require('fs');var path=require(_0x0149('0x4'));var rimraf=require(_0x0149('0x5'));var config=require('../../config/environment');var attributes=require(_0x0149('0x6'));module[_0x0149('0x7')]=function(_0x35360b,_0x1761bf){return _0x35360b[_0x0149('0x8')](_0x0149('0x9'),attributes,{'tableName':_0x0149('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7665=['bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1940f5,_0x236f74){var _0x5c4ad2=function(_0x1ad8a8){while(--_0x1ad8a8){_0x1940f5['push'](_0x1940f5['shift']());}};_0x5c4ad2(++_0x236f74);}(_0x7665,0xff));var _0x5766=function(_0x3c649a,_0x2b6ded){_0x3c649a=_0x3c649a-0x0;var _0x20244b=_0x7665[_0x3c649a];return _0x20244b;};'use strict';var _=require(_0x5766('0x0'));var util=require(_0x5766('0x1'));var logger=require(_0x5766('0x2'))(_0x5766('0x3'));var moment=require(_0x5766('0x4'));var BPromise=require(_0x5766('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5766('0x6'));var rimraf=require('rimraf');var config=require(_0x5766('0x7'));var attributes=require(_0x5766('0x8'));module[_0x5766('0x9')]=function(_0x265feb,_0x37bfff){return _0x265feb[_0x5766('0xa')](_0x5766('0xb'),attributes,{'tableName':_0x5766('0xc'),'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 3d15d40..8f70f90 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 _0x7da8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x7da8,0x1df));var _0x87da=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7da8[_0x432682];return _0x463d05;};'use strict';var _=require(_0x87da('0x0'));var util=require(_0x87da('0x1'));var moment=require(_0x87da('0x2'));var BPromise=require(_0x87da('0x3'));var rs=require(_0x87da('0x4'));var fs=require('fs');var Redis=require(_0x87da('0x5'));var db=require(_0x87da('0x6'))['db'];var utils=require(_0x87da('0x7'));var logger=require(_0x87da('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54a1c4,_0x18b7a9,_0x49f46f){return new BPromise(function(_0x27d59e,_0x41210e){return client[_0x87da('0x9')](_0x54a1c4,_0x49f46f)[_0x87da('0xa')](function(_0x5181b2){logger[_0x87da('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x18b7a9,_0x87da('0xc'));logger['debug'](_0x87da('0xd'),_0x18b7a9,_0x87da('0xc'),JSON[_0x87da('0xe')](_0x5181b2));if(_0x5181b2[_0x87da('0xf')]){if(_0x5181b2[_0x87da('0xf')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x18b7a9,_0x5181b2['error'][_0x87da('0x10')]);return _0x41210e(_0x5181b2[_0x87da('0xf')][_0x87da('0x10')]);}logger[_0x87da('0xf')](_0x87da('0x11'),_0x18b7a9,_0x5181b2[_0x87da('0xf')][_0x87da('0x10')]);return _0x27d59e(_0x5181b2[_0x87da('0xf')]['message']);}else{logger['info'](_0x87da('0x11'),_0x18b7a9,_0x87da('0xc'));_0x27d59e(_0x5181b2[_0x87da('0x12')][_0x87da('0x10')]);}})[_0x87da('0x13')](function(_0x11e6cc){logger[_0x87da('0xf')](_0x87da('0x11'),_0x18b7a9,_0x11e6cc);_0x41210e(_0x11e6cc);});});} \ No newline at end of file +var _0x77db=['client','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x237749,_0x2ce9bb){var _0x1f6bd9=function(_0xf302b7){while(--_0xf302b7){_0x237749['push'](_0x237749['shift']());}};_0x1f6bd9(++_0x2ce9bb);}(_0x77db,0xe9));var _0xb77d=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x77db[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xb77d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb77d('0x1'));var db=require(_0xb77d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb77d('0x3'))(_0xb77d('0x4'));var config=require(_0xb77d('0x5'));var jayson=require(_0xb77d('0x6'));var client=jayson[_0xb77d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17d73f,_0x437864,_0x4472af){return new BPromise(function(_0x1e8902,_0x29a75e){return client[_0xb77d('0x8')](_0x17d73f,_0x4472af)[_0xb77d('0x9')](function(_0x136a2e){logger[_0xb77d('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x437864,_0xb77d('0xb'));logger[_0xb77d('0xc')](_0xb77d('0xd'),_0x437864,_0xb77d('0xb'),JSON[_0xb77d('0xe')](_0x136a2e));if(_0x136a2e[_0xb77d('0xf')]){if(_0x136a2e[_0xb77d('0xf')]['code']===0x1f4){logger[_0xb77d('0xf')](_0xb77d('0x10'),_0x437864,_0x136a2e[_0xb77d('0xf')][_0xb77d('0x11')]);return _0x29a75e(_0x136a2e[_0xb77d('0xf')][_0xb77d('0x11')]);}logger[_0xb77d('0xf')](_0xb77d('0x10'),_0x437864,_0x136a2e['error'][_0xb77d('0x11')]);return _0x1e8902(_0x136a2e[_0xb77d('0xf')]['message']);}else{logger[_0xb77d('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x437864,_0xb77d('0xb'));_0x1e8902(_0x136a2e[_0xb77d('0x12')]['message']);}})[_0xb77d('0x13')](function(_0x3e6960){logger[_0xb77d('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x437864,_0x3e6960);_0x29a75e(_0x3e6960);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index a15e53d..343d80d 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 _0x275f=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','post','create','put','destroy','exports'];(function(_0x2bd8f2,_0x5d236a){var _0x519a48=function(_0x2f7658){while(--_0x2f7658){_0x2bd8f2['push'](_0x2bd8f2['shift']());}};_0x519a48(++_0x5d236a);}(_0x275f,0x12c));var _0xf275=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x275f[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf275('0x0'));var timeout=require('connect-timeout');var express=require(_0xf275('0x1'));var router=express[_0xf275('0x2')]();var fs_extra=require(_0xf275('0x3'));var auth=require(_0xf275('0x4'));var interaction=require(_0xf275('0x5'));var config=require(_0xf275('0x6'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xf275('0x7')](),controller[_0xf275('0x8')]);router['get'](_0xf275('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xf275('0xa')]('/',auth[_0xf275('0x7')](),controller[_0xf275('0xb')]);router[_0xf275('0xc')](_0xf275('0x9'),auth[_0xf275('0x7')](),controller['update']);router['delete']('/:id',auth[_0xf275('0x7')](),controller[_0xf275('0xd')]);module[_0xf275('0xe')]=router; \ No newline at end of file +var _0x09a9=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x09a9,0xad));var _0x909a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x09a9[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x909a('0x0'));var util=require(_0x909a('0x1'));var path=require(_0x909a('0x2'));var timeout=require('connect-timeout');var express=require(_0x909a('0x3'));var router=express[_0x909a('0x4')]();var fs_extra=require(_0x909a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x909a('0x6'));var config=require(_0x909a('0x7'));var controller=require(_0x909a('0x8'));router[_0x909a('0x9')]('/',auth[_0x909a('0xa')](),controller[_0x909a('0xb')]);router['get'](_0x909a('0xc'),auth[_0x909a('0xa')](),controller['show']);router[_0x909a('0xd')]('/',auth[_0x909a('0xa')](),controller['create']);router[_0x909a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x909a('0xf')]);router['delete'](_0x909a('0xc'),auth[_0x909a('0xa')](),controller[_0x909a('0x10')]);module[_0x909a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 17a08da..6fb8f04 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 _0xec64=['string','variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM'];(function(_0x1ee447,_0x58fa3f){var _0x47f3f8=function(_0x35b46e){while(--_0x35b46e){_0x1ee447['push'](_0x1ee447['shift']());}};_0x47f3f8(++_0x58fa3f);}(_0xec64,0xa6));var _0x4ec6=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xec64[_0x4a82ac];return _0x58ee97;};'use strict';var Sequelize=require('sequelize');module[_0x4ec6('0x0')]={'type':{'type':Sequelize[_0x4ec6('0x1')](_0x4ec6('0x2'),_0x4ec6('0x3'),_0x4ec6('0x4'),_0x4ec6('0x5'),'picklist'),'defaultValue':_0x4ec6('0x2')},'content':{'type':Sequelize[_0x4ec6('0x6')]},'key':{'type':Sequelize[_0x4ec6('0x6')]},'keyType':{'type':Sequelize[_0x4ec6('0x1')](_0x4ec6('0x2'),_0x4ec6('0x3'),_0x4ec6('0x4'))},'keyContent':{'type':Sequelize[_0x4ec6('0x6')]},'idField':{'type':Sequelize[_0x4ec6('0x6')]},'nameField':{'type':Sequelize[_0x4ec6('0x6')]},'customField':{'type':Sequelize[_0x4ec6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ec6('0x6')]}}; \ No newline at end of file +var _0x445a=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','exports','ENUM','string'];(function(_0x2fca96,_0x231c95){var _0x2be486=function(_0x5bf032){while(--_0x5bf032){_0x2fca96['push'](_0x2fca96['shift']());}};_0x2be486(++_0x231c95);}(_0x445a,0x11d));var _0xa445=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x445a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0xa445('0x0')]={'type':{'type':Sequelize[_0xa445('0x1')](_0xa445('0x2'),_0xa445('0x3'),'customVariable',_0xa445('0x4'),_0xa445('0x5')),'defaultValue':_0xa445('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa445('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xa445('0x2'),'variable',_0xa445('0x7'))},'keyContent':{'type':Sequelize[_0xa445('0x6')]},'idField':{'type':Sequelize[_0xa445('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa445('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 6748700..c1f2547 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 _0x1306=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','type','VIRTUAL','filter','then','includeAll','include','findAll','rows','show','params','keys','length','options','find','catch','create','body','update','destroy','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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x1306,0x17a));var _0x6130=function(_0x36c396,_0x2c385d){_0x36c396=_0x36c396-0x0;var _0x22da83=_0x1306[_0x36c396];return _0x22da83;};'use strict';var emlformat=require(_0x6130('0x0'));var rimraf=require(_0x6130('0x1'));var zipdir=require(_0x6130('0x2'));var jsonpatch=require(_0x6130('0x3'));var rp=require(_0x6130('0x4'));var moment=require(_0x6130('0x5'));var BPromise=require(_0x6130('0x6'));var Mustache=require(_0x6130('0x7'));var util=require(_0x6130('0x8'));var path=require(_0x6130('0x9'));var sox=require(_0x6130('0xa'));var csv=require(_0x6130('0xb'));var ejs=require(_0x6130('0xc'));var fs=require('fs');var fs_extra=require(_0x6130('0xd'));var _=require(_0x6130('0xe'));var squel=require(_0x6130('0xf'));var crypto=require(_0x6130('0x10'));var jsforce=require(_0x6130('0x11'));var deskjs=require(_0x6130('0x12'));var toCsv=require(_0x6130('0xb'));var querystring=require(_0x6130('0x13'));var Papa=require(_0x6130('0x14'));var Redis=require(_0x6130('0x15'));var authService=require(_0x6130('0x16'));var qs=require(_0x6130('0x17'));var as=require(_0x6130('0x18'));var hardwareService=require(_0x6130('0x19'));var logger=require(_0x6130('0x1a'))(_0x6130('0x1b'));var utils=require('../../config/utils');var config=require(_0x6130('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x6130('0x1d'))['db'];function respondWithStatusCode(_0x2fbf3d,_0x5e0234){_0x5e0234=_0x5e0234||0xcc;return function(_0x1c0339){if(_0x1c0339){return _0x2fbf3d[_0x6130('0x1e')](_0x5e0234);}return _0x2fbf3d[_0x6130('0x1f')](_0x5e0234)[_0x6130('0x20')]();};}function respondWithResult(_0x1d736c,_0x3470e8){_0x3470e8=_0x3470e8||0xc8;return function(_0x4cdac6){if(_0x4cdac6){return _0x1d736c[_0x6130('0x1f')](_0x3470e8)[_0x6130('0x21')](_0x4cdac6);}};}function respondWithFilteredResult(_0x3ef4c1,_0x401a70){return function(_0x4626a2){if(_0x4626a2){var _0x39b444=typeof _0x401a70[_0x6130('0x22')]===_0x6130('0x23')&&typeof _0x401a70[_0x6130('0x24')]==='undefined';var _0x4b9a20=_0x4626a2[_0x6130('0x25')];var _0x49803e=_0x39b444?0x0:_0x401a70[_0x6130('0x22')];var _0xb6575d=_0x39b444?_0x4626a2[_0x6130('0x25')]:_0x401a70[_0x6130('0x22')]+_0x401a70[_0x6130('0x24')];var _0x4b4b35;if(_0xb6575d>=_0x4b9a20){_0xb6575d=_0x4b9a20;_0x4b4b35=0xc8;}else{_0x4b4b35=0xce;}_0x3ef4c1[_0x6130('0x1f')](_0x4b4b35);return _0x3ef4c1['set'](_0x6130('0x26'),_0x49803e+'-'+_0xb6575d+'/'+_0x4b9a20)[_0x6130('0x21')](_0x4626a2);}return null;};}function patchUpdates(_0x18bb78){return function(_0x1839db){try{jsonpatch[_0x6130('0x27')](_0x1839db,_0x18bb78,!![]);}catch(_0x5c8b08){return BPromise['reject'](_0x5c8b08);}return _0x1839db[_0x6130('0x28')]();};}function saveUpdates(_0x534390,_0x30b4f2){return function(_0x289c7b){if(_0x289c7b){return _0x289c7b['update'](_0x534390)['then'](function(_0x54fc67){return _0x54fc67;});}return null;};}function removeEntity(_0x2a8aad,_0x5369e3){return function(_0x371b84){if(_0x371b84){return _0x371b84['destroy']()['then'](function(){_0x2a8aad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5069bf,_0x140468){return function(_0x1ba07d){if(!_0x1ba07d){_0x5069bf['sendStatus'](0x194);}return _0x1ba07d;};}function handleError(_0x188657,_0x552c54){_0x552c54=_0x552c54||0x1f4;return function(_0x306935){logger['error'](_0x306935['stack']);if(_0x306935[_0x6130('0x29')]){delete _0x306935[_0x6130('0x29')];}_0x188657[_0x6130('0x1f')](_0x552c54)[_0x6130('0x2a')](_0x306935);};}exports[_0x6130('0x2b')]=function(_0x392386,_0x2aa0e3){var _0x19eb47={},_0x14dff0={},_0x5809e4={'count':0x0,'rows':[]};var _0x5363cc=_[_0x6130('0x2c')](db[_0x6130('0x2d')][_0x6130('0x2e')],function(_0x4345ac){return{'name':_0x4345ac[_0x6130('0x2f')],'type':_0x4345ac['type'][_0x6130('0x30')]};});_0x14dff0[_0x6130('0x31')]=_[_0x6130('0x2c')](_0x5363cc,_0x6130('0x29'));_0x14dff0[_0x6130('0x32')]=_['keys'](_0x392386[_0x6130('0x32')]);_0x14dff0[_0x6130('0x33')]=_[_0x6130('0x34')](_0x14dff0['model'],_0x14dff0[_0x6130('0x32')]);_0x19eb47[_0x6130('0x35')]=_[_0x6130('0x34')](_0x14dff0[_0x6130('0x31')],qs[_0x6130('0x36')](_0x392386[_0x6130('0x32')][_0x6130('0x36')]));_0x19eb47[_0x6130('0x35')]=_0x19eb47[_0x6130('0x35')]['length']?_0x19eb47[_0x6130('0x35')]:_0x14dff0['model'];if(!_0x392386['query']['hasOwnProperty'](_0x6130('0x37'))){_0x19eb47[_0x6130('0x24')]=qs[_0x6130('0x24')](_0x392386[_0x6130('0x32')][_0x6130('0x24')]);_0x19eb47[_0x6130('0x22')]=qs[_0x6130('0x22')](_0x392386[_0x6130('0x32')]['offset']);}_0x19eb47[_0x6130('0x38')]=qs[_0x6130('0x39')](_0x392386['query'][_0x6130('0x39')]);_0x19eb47[_0x6130('0x3a')]=qs[_0x6130('0x33')](_['pick'](_0x392386[_0x6130('0x32')],_0x14dff0[_0x6130('0x33')]),_0x5363cc);if(_0x392386['query']['filter']){_0x19eb47[_0x6130('0x3a')]=_[_0x6130('0x3b')](_0x19eb47[_0x6130('0x3a')],{'$or':_['map'](_0x5363cc,function(_0x596c98){if(_0x596c98[_0x6130('0x3c')]!==_0x6130('0x3d')){var _0x3c6aac={};_0x3c6aac[_0x596c98[_0x6130('0x29')]]={'$like':'%'+_0x392386[_0x6130('0x32')][_0x6130('0x3e')]+'%'};return _0x3c6aac;}})});}_0x19eb47=_[_0x6130('0x3b')]({},_0x19eb47,_0x392386['options']);var _0x45bfe0={'where':_0x19eb47[_0x6130('0x3a')]};return db[_0x6130('0x2d')][_0x6130('0x25')](_0x45bfe0)[_0x6130('0x3f')](function(_0x3249f2){_0x5809e4[_0x6130('0x25')]=_0x3249f2;if(_0x392386['query'][_0x6130('0x40')]){_0x19eb47[_0x6130('0x41')]=[{'all':!![]}];}return db[_0x6130('0x2d')][_0x6130('0x42')](_0x19eb47);})[_0x6130('0x3f')](function(_0x142385){_0x5809e4[_0x6130('0x43')]=_0x142385;return _0x5809e4;})[_0x6130('0x3f')](respondWithFilteredResult(_0x2aa0e3,_0x19eb47))['catch'](handleError(_0x2aa0e3,null));};exports[_0x6130('0x44')]=function(_0x154891,_0x6eebc6){var _0x4c727b={'raw':!![],'where':{'id':_0x154891[_0x6130('0x45')]['id']}},_0x176506={};_0x176506[_0x6130('0x31')]=_['keys'](db['FreshdeskField'][_0x6130('0x2e')]);_0x176506[_0x6130('0x32')]=_[_0x6130('0x46')](_0x154891[_0x6130('0x32')]);_0x176506[_0x6130('0x33')]=_['intersection'](_0x176506[_0x6130('0x31')],_0x176506[_0x6130('0x32')]);_0x4c727b['attributes']=_[_0x6130('0x34')](_0x176506[_0x6130('0x31')],qs[_0x6130('0x36')](_0x154891[_0x6130('0x32')][_0x6130('0x36')]));_0x4c727b[_0x6130('0x35')]=_0x4c727b[_0x6130('0x35')][_0x6130('0x47')]?_0x4c727b['attributes']:_0x176506['model'];if(_0x154891[_0x6130('0x32')]['includeAll']){_0x4c727b[_0x6130('0x41')]=[{'all':!![]}];}_0x4c727b=_[_0x6130('0x3b')]({},_0x4c727b,_0x154891[_0x6130('0x48')]);return db[_0x6130('0x2d')][_0x6130('0x49')](_0x4c727b)[_0x6130('0x3f')](handleEntityNotFound(_0x6eebc6,null))[_0x6130('0x3f')](respondWithResult(_0x6eebc6,null))[_0x6130('0x4a')](handleError(_0x6eebc6,null));};exports[_0x6130('0x4b')]=function(_0x19dcb7,_0x3936a8){return db['FreshdeskField'][_0x6130('0x4b')](_0x19dcb7[_0x6130('0x4c')],{})[_0x6130('0x3f')](respondWithResult(_0x3936a8,0xc9))[_0x6130('0x4a')](handleError(_0x3936a8,null));};exports[_0x6130('0x4d')]=function(_0x13f591,_0x35939b){if(_0x13f591[_0x6130('0x4c')]['id']){delete _0x13f591[_0x6130('0x4c')]['id'];}return db[_0x6130('0x2d')]['find']({'where':{'id':_0x13f591[_0x6130('0x45')]['id']}})[_0x6130('0x3f')](handleEntityNotFound(_0x35939b,null))[_0x6130('0x3f')](saveUpdates(_0x13f591[_0x6130('0x4c')],null))[_0x6130('0x3f')](respondWithResult(_0x35939b,null))[_0x6130('0x4a')](handleError(_0x35939b,null));};exports[_0x6130('0x4e')]=function(_0x37ee0c,_0x3a64ef){return db['FreshdeskField'][_0x6130('0x49')]({'where':{'id':_0x37ee0c[_0x6130('0x45')]['id']}})[_0x6130('0x3f')](handleEntityNotFound(_0x3a64ef,null))[_0x6130('0x3f')](removeEntity(_0x3a64ef,null))[_0x6130('0x4a')](handleError(_0x3a64ef,null));}; \ No newline at end of file +var _0x049e=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','error','stack','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x049e,0x16a));var _0xe049=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x049e[_0x4b4b0e];return _0x4c2d91;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){_0x3b0f54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aafd1,_0x1efbbe){return function(_0x53620b){if(!_0x53620b){_0x1aafd1[_0xe049('0x17')](0x194);}return _0x53620b;};}function handleError(_0x181432,_0x3e5c7f){_0x3e5c7f=_0x3e5c7f||0x1f4;return function(_0x423ba4){logger[_0xe049('0x23')](_0x423ba4[_0xe049('0x24')]);if(_0x423ba4['name']){delete _0x423ba4['name'];}_0x181432[_0xe049('0x18')](_0x3e5c7f)['send'](_0x423ba4);};}exports[_0xe049('0x25')]=function(_0x495d33,_0x3c50c3){var _0x2b79dc={},_0x5adcd6={},_0x432a6e={'count':0x0,'rows':[]};var _0x364630=_[_0xe049('0x26')](db[_0xe049('0x27')][_0xe049('0x28')],function(_0x4055fc){return{'name':_0x4055fc[_0xe049('0x29')],'type':_0x4055fc[_0xe049('0x2a')][_0xe049('0x2b')]};});_0x5adcd6[_0xe049('0x2c')]=_[_0xe049('0x26')](_0x364630,'name');_0x5adcd6[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x495d33['query']);_0x5adcd6['filters']=_['intersection'](_0x5adcd6['model'],_0x5adcd6[_0xe049('0x2d')]);_0x2b79dc[_0xe049('0x2f')]=_[_0xe049('0x30')](_0x5adcd6[_0xe049('0x2c')],qs[_0xe049('0x31')](_0x495d33['query'][_0xe049('0x31')]));_0x2b79dc[_0xe049('0x2f')]=_0x2b79dc[_0xe049('0x2f')][_0xe049('0x32')]?_0x2b79dc[_0xe049('0x2f')]:_0x5adcd6['model'];if(!_0x495d33[_0xe049('0x2d')]['hasOwnProperty'](_0xe049('0x33'))){_0x2b79dc['limit']=qs[_0xe049('0x1a')](_0x495d33[_0xe049('0x2d')][_0xe049('0x1a')]);_0x2b79dc[_0xe049('0x19')]=qs[_0xe049('0x19')](_0x495d33[_0xe049('0x2d')][_0xe049('0x19')]);}_0x2b79dc[_0xe049('0x34')]=qs[_0xe049('0x35')](_0x495d33[_0xe049('0x2d')][_0xe049('0x35')]);_0x2b79dc['where']=qs[_0xe049('0x36')](_[_0xe049('0x37')](_0x495d33[_0xe049('0x2d')],_0x5adcd6[_0xe049('0x36')]),_0x364630);if(_0x495d33[_0xe049('0x2d')][_0xe049('0x38')]){_0x2b79dc[_0xe049('0x39')]=_[_0xe049('0x3a')](_0x2b79dc['where'],{'$or':_[_0xe049('0x26')](_0x364630,function(_0x14bea3){if(_0x14bea3[_0xe049('0x2a')]!==_0xe049('0x3b')){var _0x5e9613={};_0x5e9613[_0x14bea3[_0xe049('0x3c')]]={'$like':'%'+_0x495d33[_0xe049('0x2d')][_0xe049('0x38')]+'%'};return _0x5e9613;}})});}_0x2b79dc=_[_0xe049('0x3a')]({},_0x2b79dc,_0x495d33[_0xe049('0x3d')]);var _0x54d5dd={'where':_0x2b79dc[_0xe049('0x39')]};return db[_0xe049('0x27')][_0xe049('0x1c')](_0x54d5dd)['then'](function(_0x28ae88){_0x432a6e['count']=_0x28ae88;if(_0x495d33['query'][_0xe049('0x3e')]){_0x2b79dc['include']=[{'all':!![]}];}return db[_0xe049('0x27')][_0xe049('0x3f')](_0x2b79dc);})[_0xe049('0x22')](function(_0xe4f184){_0x432a6e[_0xe049('0x40')]=_0xe4f184;return _0x432a6e;})['then'](respondWithFilteredResult(_0x3c50c3,_0x2b79dc))[_0xe049('0x41')](handleError(_0x3c50c3,null));};exports[_0xe049('0x42')]=function(_0x5e2374,_0x546137){var _0x29915f={'raw':!![],'where':{'id':_0x5e2374[_0xe049('0x43')]['id']}},_0x20d264={};_0x20d264[_0xe049('0x2c')]=_[_0xe049('0x2e')](db[_0xe049('0x27')]['rawAttributes']);_0x20d264[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x5e2374['query']);_0x20d264[_0xe049('0x36')]=_[_0xe049('0x30')](_0x20d264[_0xe049('0x2c')],_0x20d264[_0xe049('0x2d')]);_0x29915f[_0xe049('0x2f')]=_['intersection'](_0x20d264['model'],qs[_0xe049('0x31')](_0x5e2374[_0xe049('0x2d')][_0xe049('0x31')]));_0x29915f[_0xe049('0x2f')]=_0x29915f[_0xe049('0x2f')][_0xe049('0x32')]?_0x29915f['attributes']:_0x20d264[_0xe049('0x2c')];if(_0x5e2374[_0xe049('0x2d')]['includeAll']){_0x29915f[_0xe049('0x44')]=[{'all':!![]}];}_0x29915f=_['merge']({},_0x29915f,_0x5e2374[_0xe049('0x3d')]);return db['FreshdeskField'][_0xe049('0x45')](_0x29915f)['then'](handleEntityNotFound(_0x546137,null))[_0xe049('0x22')](respondWithResult(_0x546137,null))[_0xe049('0x41')](handleError(_0x546137,null));};exports[_0xe049('0x46')]=function(_0x1e3daf,_0x22eeb1){return db['FreshdeskField'][_0xe049('0x46')](_0x1e3daf[_0xe049('0x47')],{})[_0xe049('0x22')](respondWithResult(_0x22eeb1,0xc9))[_0xe049('0x41')](handleError(_0x22eeb1,null));};exports[_0xe049('0x21')]=function(_0x3c15a2,_0x12f9b8){if(_0x3c15a2[_0xe049('0x47')]['id']){delete _0x3c15a2[_0xe049('0x47')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x3c15a2[_0xe049('0x43')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x12f9b8,null))[_0xe049('0x22')](saveUpdates(_0x3c15a2[_0xe049('0x47')],null))[_0xe049('0x22')](respondWithResult(_0x12f9b8,null))[_0xe049('0x41')](handleError(_0x12f9b8,null));};exports[_0xe049('0x48')]=function(_0x2e4dce,_0x23692f){return db[_0xe049('0x27')][_0xe049('0x45')]({'where':{'id':_0x2e4dce['params']['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x23692f,null))[_0xe049('0x22')](removeEntity(_0x23692f,null))[_0xe049('0x41')](handleError(_0x23692f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 10800a7..a544aaf 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 _0x02c5=['api','request-promise','./intFreshdeskField.attributes','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util'];(function(_0x17a045,_0x496ff8){var _0x4841bc=function(_0x35f10a){while(--_0x35f10a){_0x17a045['push'](_0x17a045['shift']());}};_0x4841bc(++_0x496ff8);}(_0x02c5,0x178));var _0x502c=function(_0x58952f,_0xeed25f){_0x58952f=_0x58952f-0x0;var _0x3217ca=_0x02c5[_0x58952f];return _0x3217ca;};'use strict';var _=require(_0x502c('0x0'));var util=require(_0x502c('0x1'));var logger=require('../../config/logger')(_0x502c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x502c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x502c('0x4'));module['exports']=function(_0x59794a,_0x4f56db){return _0x59794a['define'](_0x502c('0x5'),attributes,{'tableName':_0x502c('0x6'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x502c('0x7'),_0x502c('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb0f=['exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x3b3bc4,_0x49aa89){var _0x43b28f=function(_0x14941d){while(--_0x14941d){_0x3b3bc4['push'](_0x3b3bc4['shift']());}};_0x43b28f(++_0x49aa89);}(_0xcb0f,0x7d));var _0xfcb0=function(_0x39edf1,_0x3616a9){_0x39edf1=_0x39edf1-0x0;var _0x348891=_0xcb0f[_0x39edf1];return _0x348891;};'use strict';var _=require(_0xfcb0('0x0'));var util=require(_0xfcb0('0x1'));var logger=require(_0xfcb0('0x2'))('api');var moment=require(_0xfcb0('0x3'));var BPromise=require(_0xfcb0('0x4'));var rp=require(_0xfcb0('0x5'));var fs=require('fs');var path=require(_0xfcb0('0x6'));var rimraf=require(_0xfcb0('0x7'));var config=require(_0xfcb0('0x8'));var attributes=require(_0xfcb0('0x9'));module[_0xfcb0('0xa')]=function(_0xcff05c,_0x4f5a31){return _0xcff05c[_0xfcb0('0xb')]('FreshdeskField',attributes,{'tableName':_0xfcb0('0xc'),'paranoid':![],'indexes':[{'name':_0xfcb0('0xd'),'fields':['idField',_0xfcb0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index dc00596..65f8d89 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 _0xb8b3=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x394122,_0x3589ad){var _0x199769=function(_0x25d99e){while(--_0x25d99e){_0x394122['push'](_0x394122['shift']());}};_0x199769(++_0x3589ad);}(_0xb8b3,0x169));var _0x3b8b=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xb8b3[_0x53b8e0];return _0x10630c;};'use strict';var _=require(_0x3b8b('0x0'));var util=require(_0x3b8b('0x1'));var moment=require(_0x3b8b('0x2'));var BPromise=require(_0x3b8b('0x3'));var rs=require(_0x3b8b('0x4'));var fs=require('fs');var Redis=require(_0x3b8b('0x5'));var db=require(_0x3b8b('0x6'))['db'];var utils=require(_0x3b8b('0x7'));var logger=require(_0x3b8b('0x8'))(_0x3b8b('0x9'));var config=require(_0x3b8b('0xa'));var jayson=require(_0x3b8b('0xb'));var client=jayson[_0x3b8b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x256673,_0x3604e0,_0x2c3ece){return new BPromise(function(_0x429181,_0x423edc){return client[_0x3b8b('0xd')](_0x256673,_0x2c3ece)[_0x3b8b('0xe')](function(_0x411c63){logger[_0x3b8b('0xf')](_0x3b8b('0x10'),_0x3604e0,_0x3b8b('0x11'));logger[_0x3b8b('0x12')](_0x3b8b('0x13'),_0x3604e0,_0x3b8b('0x11'),JSON[_0x3b8b('0x14')](_0x411c63));if(_0x411c63[_0x3b8b('0x15')]){if(_0x411c63[_0x3b8b('0x15')][_0x3b8b('0x16')]===0x1f4){logger[_0x3b8b('0x15')](_0x3b8b('0x10'),_0x3604e0,_0x411c63[_0x3b8b('0x15')][_0x3b8b('0x17')]);return _0x423edc(_0x411c63['error'][_0x3b8b('0x17')]);}logger['error'](_0x3b8b('0x10'),_0x3604e0,_0x411c63[_0x3b8b('0x15')][_0x3b8b('0x17')]);return _0x429181(_0x411c63[_0x3b8b('0x15')]['message']);}else{logger[_0x3b8b('0xf')](_0x3b8b('0x10'),_0x3604e0,_0x3b8b('0x11'));_0x429181(_0x411c63[_0x3b8b('0x18')][_0x3b8b('0x17')]);}})['catch'](function(_0xc73057){logger[_0x3b8b('0x15')](_0x3b8b('0x10'),_0x3604e0,_0xc73057);_0x423edc(_0xc73057);});});} \ No newline at end of file +var _0x8baf=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x3f9e41,_0x5d0edb){var _0xfd1164=function(_0x587ab7){while(--_0x587ab7){_0x3f9e41['push'](_0x3f9e41['shift']());}};_0xfd1164(++_0x5d0edb);}(_0x8baf,0xd7));var _0xf8ba=function(_0x28a6e3,_0x2450fc){_0x28a6e3=_0x28a6e3-0x0;var _0x3ae52a=_0x8baf[_0x28a6e3];return _0x3ae52a;};'use strict';var _=require(_0xf8ba('0x0'));var util=require(_0xf8ba('0x1'));var moment=require(_0xf8ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8ba('0x3'));var fs=require('fs');var Redis=require(_0xf8ba('0x4'));var db=require(_0xf8ba('0x5'))['db'];var utils=require(_0xf8ba('0x6'));var logger=require(_0xf8ba('0x7'))('rpc');var config=require(_0xf8ba('0x8'));var jayson=require(_0xf8ba('0x9'));var client=jayson[_0xf8ba('0xa')][_0xf8ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34c07a,_0x492d2a,_0x323b8c){return new BPromise(function(_0x25cb04,_0x15c7ed){return client['request'](_0x34c07a,_0x323b8c)['then'](function(_0x258d3a){logger[_0xf8ba('0xc')](_0xf8ba('0xd'),_0x492d2a,_0xf8ba('0xe'));logger[_0xf8ba('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x492d2a,'request\x20sent',JSON[_0xf8ba('0x10')](_0x258d3a));if(_0x258d3a[_0xf8ba('0x11')]){if(_0x258d3a[_0xf8ba('0x11')][_0xf8ba('0x12')]===0x1f4){logger[_0xf8ba('0x11')](_0xf8ba('0xd'),_0x492d2a,_0x258d3a[_0xf8ba('0x11')]['message']);return _0x15c7ed(_0x258d3a[_0xf8ba('0x11')]['message']);}logger[_0xf8ba('0x11')](_0xf8ba('0xd'),_0x492d2a,_0x258d3a[_0xf8ba('0x11')][_0xf8ba('0x13')]);return _0x25cb04(_0x258d3a[_0xf8ba('0x11')][_0xf8ba('0x13')]);}else{logger[_0xf8ba('0xc')](_0xf8ba('0xd'),_0x492d2a,_0xf8ba('0xe'));_0x25cb04(_0x258d3a[_0xf8ba('0x14')][_0xf8ba('0x13')]);}})[_0xf8ba('0x15')](function(_0x287558){logger[_0xf8ba('0x11')](_0xf8ba('0xd'),_0x492d2a,_0x287558);_0x15c7ed(_0x287558);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 89e8c79..acf7fd5 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 _0x57f8=['/:id','/:id/configurations','/:id/fields','post','create','addConfiguration','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x1ab84b,_0x207716){var _0x9046c1=function(_0x41b636){while(--_0x41b636){_0x1ab84b['push'](_0x1ab84b['shift']());}};_0x9046c1(++_0x207716);}(_0x57f8,0x198));var _0x857f=function(_0x4e7844,_0x30ce77){_0x4e7844=_0x4e7844-0x0;var _0x336119=_0x57f8[_0x4e7844];return _0x336119;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['getConfigurations']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['getFields']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),controller[_0x857f('0x10')]);router[_0x857f('0xf')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller[_0x857f('0x11')]);router['put'](_0x857f('0xc'),auth[_0x857f('0xb')](),controller[_0x857f('0x12')]);router[_0x857f('0x13')](_0x857f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x857f('0x14')]=router; \ No newline at end of file +var _0x4483=['../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x181a1b,_0x7510cf){var _0x3e4f44=function(_0x138d69){while(--_0x138d69){_0x181a1b['push'](_0x181a1b['shift']());}};_0x3e4f44(++_0x7510cf);}(_0x4483,0x1a3));var _0x3448=function(_0x2a8723,_0x543ddb){_0x2a8723=_0x2a8723-0x0;var _0xabb33=_0x4483[_0x2a8723];return _0xabb33;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/configurations',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x11')](_0x3448('0x13'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3448('0x14')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x16')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);module[_0x3448('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index cf55d63..142c3d7 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x3bd538,_0x225f22){var _0x596d24=function(_0x1c5036){while(--_0x1c5036){_0x3bd538['push'](_0x3bd538['shift']());}};_0x596d24(++_0x225f22);}(_0xe5af,0x9c));var _0xfe5a=function(_0x38cbb8,_0x40e4e9){_0x38cbb8=_0x38cbb8-0x0;var _0x31d587=_0xe5af[_0x38cbb8];return _0x31d587;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x958a=['sequelize','exports','STRING','username'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x958a,0x128));var _0xa958=function(_0x5591c9,_0x59ed0c){_0x5591c9=_0x5591c9-0x0;var _0x368b2a=_0x958a[_0x5591c9];return _0x368b2a;};'use strict';var Sequelize=require(_0xa958('0x0'));module[_0xa958('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa958('0x2')]},'username':{'type':Sequelize[_0xa958('0x2')],'unique':_0xa958('0x3')},'apiKey':{'type':Sequelize[_0xa958('0x2')]},'remoteUri':{'type':Sequelize[_0xa958('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa958('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 7d760cf..d0d9172 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 _0x18a1=['eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','map','FreshsalesAccount','rawAttributes','type','name','query','filters','model','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','catch','show','params','keys','includeAll','include','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','order','addConfiguration','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','apiKey','remoteUri','substring','lastIndexOf','format','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode'];(function(_0x183b21,_0x1d26f3){var _0x292721=function(_0x22b504){while(--_0x22b504){_0x183b21['push'](_0x183b21['shift']());}};_0x292721(++_0x1d26f3);}(_0x18a1,0x1c7));var _0x118a=function(_0x2919d8,_0x1fdf43){_0x2919d8=_0x2919d8-0x0;var _0x9fff00=_0x18a1[_0x2919d8];return _0x9fff00;};'use strict';var emlformat=require(_0x118a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x118a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x118a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x118a('0x3'));var util=require('util');var path=require(_0x118a('0x4'));var sox=require(_0x118a('0x5'));var csv=require(_0x118a('0x6'));var ejs=require(_0x118a('0x7'));var fs=require('fs');var fs_extra=require(_0x118a('0x8'));var _=require(_0x118a('0x9'));var squel=require(_0x118a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x118a('0x6'));var querystring=require('querystring');var Papa=require(_0x118a('0xb'));var Redis=require('ioredis');var authService=require(_0x118a('0xc'));var qs=require(_0x118a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x118a('0xe'));var logger=require(_0x118a('0xf'))('api');var utils=require(_0x118a('0x10'));var config=require(_0x118a('0x11'));var licenseUtil=require(_0x118a('0x12'));var db=require(_0x118a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x356aaa,_0x318faa){_0x318faa=_0x318faa||0xcc;return function(_0x5f4b0b){if(_0x5f4b0b){return _0x356aaa[_0x118a('0x14')](_0x318faa);}return _0x356aaa[_0x118a('0x15')](_0x318faa)[_0x118a('0x16')]();};}function respondWithResult(_0x39d02f,_0x147022){_0x147022=_0x147022||0xc8;return function(_0x458b6d){if(_0x458b6d){return _0x39d02f[_0x118a('0x15')](_0x147022)['json'](_0x458b6d);}};}function respondWithFilteredResult(_0x1095a6,_0x198d2e){return function(_0x21280b){if(_0x21280b){var _0x477958=typeof _0x198d2e['offset']===_0x118a('0x17')&&typeof _0x198d2e['limit']===_0x118a('0x17');var _0x29958b=_0x21280b[_0x118a('0x18')];var _0x315e8f=_0x477958?0x0:_0x198d2e['offset'];var _0x22603b=_0x477958?_0x21280b[_0x118a('0x18')]:_0x198d2e[_0x118a('0x19')]+_0x198d2e[_0x118a('0x1a')];var _0x1e5550;if(_0x22603b>=_0x29958b){_0x22603b=_0x29958b;_0x1e5550=0xc8;}else{_0x1e5550=0xce;}_0x1095a6[_0x118a('0x15')](_0x1e5550);return _0x1095a6[_0x118a('0x1b')](_0x118a('0x1c'),_0x315e8f+'-'+_0x22603b+'/'+_0x29958b)[_0x118a('0x1d')](_0x21280b);}return null;};}function patchUpdates(_0x2fb7c5){return function(_0x5688a4){try{jsonpatch[_0x118a('0x1e')](_0x5688a4,_0x2fb7c5,!![]);}catch(_0x401341){return BPromise[_0x118a('0x1f')](_0x401341);}return _0x5688a4['save']();};}function saveUpdates(_0x37f7a4,_0xcffe11){return function(_0x5e79cf){if(_0x5e79cf){return _0x5e79cf[_0x118a('0x20')](_0x37f7a4)[_0x118a('0x21')](function(_0x576126){return _0x576126;});}return null;};}function removeEntity(_0x43c9e5,_0x35594f){return function(_0x219129){if(_0x219129){return _0x219129[_0x118a('0x22')]()['then'](function(){_0x43c9e5[_0x118a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25716e,_0x150533){return function(_0x1cca26){if(!_0x1cca26){_0x25716e[_0x118a('0x14')](0x194);}return _0x1cca26;};}function handleError(_0x5c97ca,_0x374c89){_0x374c89=_0x374c89||0x1f4;return function(_0x1bbd32){logger[_0x118a('0x23')](_0x1bbd32[_0x118a('0x24')]);if(_0x1bbd32['name']){delete _0x1bbd32['name'];}_0x5c97ca[_0x118a('0x15')](_0x374c89)[_0x118a('0x25')](_0x1bbd32);};}exports[_0x118a('0x26')]=function(_0x182ab1,_0x3c0adc){var _0x2da8be={},_0x305023={},_0x3a9267={'count':0x0,'rows':[]};var _0xd6199d=_[_0x118a('0x27')](db[_0x118a('0x28')][_0x118a('0x29')],function(_0xbf7d43){return{'name':_0xbf7d43['fieldName'],'type':_0xbf7d43[_0x118a('0x2a')]['key']};});_0x305023['model']=_[_0x118a('0x27')](_0xd6199d,_0x118a('0x2b'));_0x305023[_0x118a('0x2c')]=_['keys'](_0x182ab1[_0x118a('0x2c')]);_0x305023[_0x118a('0x2d')]=_['intersection'](_0x305023[_0x118a('0x2e')],_0x305023[_0x118a('0x2c')]);_0x2da8be[_0x118a('0x2f')]=_[_0x118a('0x30')](_0x305023['model'],qs[_0x118a('0x31')](_0x182ab1['query']['fields']));_0x2da8be[_0x118a('0x2f')]=_0x2da8be[_0x118a('0x2f')][_0x118a('0x32')]?_0x2da8be[_0x118a('0x2f')]:_0x305023[_0x118a('0x2e')];if(!_0x182ab1[_0x118a('0x2c')]['hasOwnProperty'](_0x118a('0x33'))){_0x2da8be[_0x118a('0x1a')]=qs[_0x118a('0x1a')](_0x182ab1['query'][_0x118a('0x1a')]);_0x2da8be[_0x118a('0x19')]=qs[_0x118a('0x19')](_0x182ab1[_0x118a('0x2c')][_0x118a('0x19')]);}_0x2da8be['order']=qs[_0x118a('0x34')](_0x182ab1[_0x118a('0x2c')][_0x118a('0x34')]);_0x2da8be['where']=qs[_0x118a('0x2d')](_[_0x118a('0x35')](_0x182ab1[_0x118a('0x2c')],_0x305023['filters']),_0xd6199d);if(_0x182ab1[_0x118a('0x2c')][_0x118a('0x36')]){_0x2da8be[_0x118a('0x37')]=_[_0x118a('0x38')](_0x2da8be[_0x118a('0x37')],{'$or':_[_0x118a('0x27')](_0xd6199d,function(_0x41ae04){if(_0x41ae04[_0x118a('0x2a')]!==_0x118a('0x39')){var _0x34110d={};_0x34110d[_0x41ae04['name']]={'$like':'%'+_0x182ab1['query'][_0x118a('0x36')]+'%'};return _0x34110d;}})});}_0x2da8be=_[_0x118a('0x38')]({},_0x2da8be,_0x182ab1[_0x118a('0x3a')]);var _0x5efd8b={'where':_0x2da8be[_0x118a('0x37')]};return db[_0x118a('0x28')][_0x118a('0x18')](_0x5efd8b)[_0x118a('0x21')](function(_0x21f454){_0x3a9267[_0x118a('0x18')]=_0x21f454;if(_0x182ab1[_0x118a('0x2c')]['includeAll']){_0x2da8be['include']=[{'all':!![]}];}return db[_0x118a('0x28')]['findAll'](_0x2da8be);})['then'](function(_0x5dfcb9){_0x3a9267['rows']=_0x5dfcb9;return _0x3a9267;})[_0x118a('0x21')](respondWithFilteredResult(_0x3c0adc,_0x2da8be))[_0x118a('0x3b')](handleError(_0x3c0adc,null));};exports[_0x118a('0x3c')]=function(_0x381faf,_0x1b86f7){var _0x2f4a79={'raw':![],'where':{'id':_0x381faf[_0x118a('0x3d')]['id']}},_0x2a4746={};_0x2a4746[_0x118a('0x2e')]=_[_0x118a('0x3e')](db[_0x118a('0x28')][_0x118a('0x29')]);_0x2a4746['query']=_['keys'](_0x381faf[_0x118a('0x2c')]);_0x2a4746[_0x118a('0x2d')]=_[_0x118a('0x30')](_0x2a4746[_0x118a('0x2e')],_0x2a4746[_0x118a('0x2c')]);_0x2f4a79[_0x118a('0x2f')]=_[_0x118a('0x30')](_0x2a4746[_0x118a('0x2e')],qs[_0x118a('0x31')](_0x381faf[_0x118a('0x2c')][_0x118a('0x31')]));_0x2f4a79['attributes']=_0x2f4a79['attributes']['length']?_0x2f4a79[_0x118a('0x2f')]:_0x2a4746[_0x118a('0x2e')];if(_0x381faf[_0x118a('0x2c')][_0x118a('0x3f')]){_0x2f4a79[_0x118a('0x40')]=[{'all':!![]}];}_0x2f4a79=_[_0x118a('0x38')]({},_0x2f4a79,_0x381faf[_0x118a('0x3a')]);return db[_0x118a('0x28')]['find'](_0x2f4a79)[_0x118a('0x21')](handleEntityNotFound(_0x1b86f7,null))[_0x118a('0x21')](respondWithResult(_0x1b86f7,null))[_0x118a('0x3b')](handleError(_0x1b86f7,null));};exports[_0x118a('0x41')]=function(_0x3de640,_0x7fdf5d){return db['FreshsalesAccount']['create'](_0x3de640['body'],{})[_0x118a('0x21')](respondWithResult(_0x7fdf5d,0xc9))[_0x118a('0x3b')](handleError(_0x7fdf5d,null));};exports[_0x118a('0x20')]=function(_0x1b72a0,_0x97122e){if(_0x1b72a0['body']['id']){delete _0x1b72a0['body']['id'];}return db[_0x118a('0x28')]['find']({'where':{'id':_0x1b72a0[_0x118a('0x3d')]['id']}})[_0x118a('0x21')](handleEntityNotFound(_0x97122e,null))[_0x118a('0x21')](saveUpdates(_0x1b72a0[_0x118a('0x42')],null))[_0x118a('0x21')](respondWithResult(_0x97122e,null))[_0x118a('0x3b')](handleError(_0x97122e,null));};exports[_0x118a('0x22')]=function(_0x3eddcb,_0x4420c7){return db[_0x118a('0x28')][_0x118a('0x43')]({'where':{'id':_0x3eddcb['params']['id']}})[_0x118a('0x21')](handleEntityNotFound(_0x4420c7,null))['then'](removeEntity(_0x4420c7,null))[_0x118a('0x3b')](handleError(_0x4420c7,null));};exports[_0x118a('0x44')]=function(_0xff4bd3,_0x45c500,_0x3af1e7){var _0x180f9e={};var _0x24134f={};var _0x148c5c;var _0x4a600a;return db[_0x118a('0x28')][_0x118a('0x45')]({'where':{'id':_0xff4bd3[_0x118a('0x3d')]['id']}})[_0x118a('0x21')](handleEntityNotFound(_0x45c500,null))[_0x118a('0x21')](function(_0x5aaf47){if(_0x5aaf47){_0x148c5c=_0x5aaf47;_0x24134f[_0x118a('0x2e')]=_['keys'](db[_0x118a('0x46')][_0x118a('0x29')]);_0x24134f['query']=_[_0x118a('0x3e')](_0xff4bd3['query']);_0x24134f[_0x118a('0x2d')]=_[_0x118a('0x30')](_0x24134f[_0x118a('0x2e')],_0x24134f[_0x118a('0x2c')]);_0x180f9e[_0x118a('0x2f')]=_[_0x118a('0x30')](_0x24134f[_0x118a('0x2e')],qs[_0x118a('0x31')](_0xff4bd3[_0x118a('0x2c')]['fields']));_0x180f9e['attributes']=_0x180f9e[_0x118a('0x2f')][_0x118a('0x32')]?_0x180f9e[_0x118a('0x2f')]:_0x24134f[_0x118a('0x2e')];_0x180f9e[_0x118a('0x47')]=qs[_0x118a('0x34')](_0xff4bd3[_0x118a('0x2c')][_0x118a('0x34')]);_0x180f9e[_0x118a('0x37')]=qs[_0x118a('0x2d')](_[_0x118a('0x35')](_0xff4bd3[_0x118a('0x2c')],_0x24134f[_0x118a('0x2d')]));if(_0xff4bd3[_0x118a('0x2c')][_0x118a('0x36')]){_0x180f9e['where']=_[_0x118a('0x38')](_0x180f9e[_0x118a('0x37')],{'$or':_['map'](_0x180f9e['attributes'],function(_0x1c40cf){var _0x556a3c={};_0x556a3c[_0x1c40cf]={'$like':'%'+_0xff4bd3[_0x118a('0x2c')][_0x118a('0x36')]+'%'};return _0x556a3c;})});}_0x180f9e=_[_0x118a('0x38')]({},_0x180f9e,_0xff4bd3[_0x118a('0x3a')]);return _0x148c5c[_0x118a('0x44')](_0x180f9e);}})[_0x118a('0x21')](function(_0x4ad38a){if(_0x4ad38a){_0x4a600a=_0x4ad38a[_0x118a('0x32')];if(!_0xff4bd3['query']['hasOwnProperty'](_0x118a('0x33'))){_0x180f9e['limit']=qs[_0x118a('0x1a')](_0xff4bd3[_0x118a('0x2c')][_0x118a('0x1a')]);_0x180f9e[_0x118a('0x19')]=qs[_0x118a('0x19')](_0xff4bd3[_0x118a('0x2c')]['offset']);}return _0x148c5c[_0x118a('0x44')](_0x180f9e);}})[_0x118a('0x21')](function(_0x229ed5){if(_0x229ed5){return _0x229ed5?{'count':_0x4a600a,'rows':_0x229ed5}:null;}})['then'](respondWithResult(_0x45c500,null))[_0x118a('0x3b')](handleError(_0x45c500,null));};exports[_0x118a('0x48')]=function(_0x3ecf34,_0x595502,_0x3be21d){if(_0x3ecf34[_0x118a('0x42')]['id']){delete _0x3ecf34['body']['id'];}return db[_0x118a('0x28')]['findOne']({'where':{'id':_0x3ecf34[_0x118a('0x3d')]['id']}})[_0x118a('0x21')](handleEntityNotFound(_0x595502,null))[_0x118a('0x21')](function(_0x3073cd){if(_0x3073cd){_0x3ecf34[_0x118a('0x42')]['AccountId']=_0x3073cd['id'];_0x3ecf34[_0x118a('0x42')][_0x118a('0x49')]=integrations['getSubjects'](_0x3ecf34[_0x118a('0x42')][_0x118a('0x4a')],_0x3ecf34[_0x118a('0x42')][_0x118a('0x2a')]);_0x3ecf34[_0x118a('0x42')]['Descriptions']=integrations[_0x118a('0x4b')](_0x3ecf34[_0x118a('0x42')][_0x118a('0x4a')],_0x3ecf34[_0x118a('0x42')][_0x118a('0x2a')]);return db[_0x118a('0x46')]['create'](_0x3ecf34[_0x118a('0x42')],{'include':[{'model':db[_0x118a('0x4c')],'as':_0x118a('0x49')},{'model':db[_0x118a('0x4c')],'as':_0x118a('0x4d')}]});}return null;})['then'](respondWithResult(_0x595502,null))[_0x118a('0x3b')](handleError(_0x595502,null));};exports[_0x118a('0x4e')]=function(_0x248ee9,_0x48f5d5,_0x14ed37){var _0x48212e='';var _0x5e425e='';return db[_0x118a('0x28')][_0x118a('0x45')]({'where':{'id':_0x248ee9['params']['id']},'attributes':['id',_0x118a('0x4f'),'remoteUri',_0x118a('0x50')]})[_0x118a('0x21')](handleEntityNotFound(_0x48f5d5,null))[_0x118a('0x21')](function(_0x4999a9){if(_0x4999a9){_0x5e425e=_0x4999a9[_0x118a('0x4f')];_0x48212e=_0x4999a9['remoteUri'];var _0x3d8ca9=_0x4999a9[_0x118a('0x51')]['slice'](-0x1);if(_0x3d8ca9==='/'){_0x48212e=_0x48212e[_0x118a('0x52')](0x0,_0x48212e[_0x118a('0x53')](_0x3d8ca9));}return rp({'method':'GET','uri':util[_0x118a('0x54')]('%s%s',_0x48212e,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x4999a9[_0x118a('0x50')]},'json':!![]});}})[_0x118a('0x21')](function(_0x3ef2f2){if(_0x3ef2f2){var _0x7fdc57=_0x3ef2f2['users'];var _0x1812f6=![];var _0x20b099=null;for(_0x20b099=0x0;_0x20b099<_0x7fdc57[_0x118a('0x32')];_0x20b099++){if(_0x7fdc57[_0x20b099][_0x118a('0x55')]===_0x5e425e){_0x1812f6=!![];}}if(_0x1812f6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x118a('0x56')});}}})[_0x118a('0x21')](respondWithResult(_0x48f5d5,null))[_0x118a('0x3b')](function(_0x2e5a1a){var _0x40e57c=_0x248ee9['query'][_0x118a('0x57')]?0x1f4:_0x2e5a1a['statusCode']||0x1f4;logger['error'](_0x118a('0x58'),'getFields',_0x40e57c,JSON[_0x118a('0x59')](_0x2e5a1a));delete _0x2e5a1a[_0x118a('0x2b')];if(_0x40e57c===0x191){_0x40e57c=0x190;}_0x48f5d5['status'](_0x40e57c)[_0x118a('0x25')](_0x248ee9[_0x118a('0x2c')][_0x118a('0x57')]?{'message':'Wrong\x20credentials','statusCode':_0x2e5a1a[_0x118a('0x5a')]}:_0x2e5a1a);});}; \ No newline at end of file +var _0xd16e=['rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','end','error','name','index','map','FreshsalesAccount','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','remoteUri','apiKey','username','slice','format','%s%s','/api/selector/owners','email','test','getFields','stringify','Wrong\x20credentials','statusCode','eml-format'];(function(_0x3758b4,_0x34d4e1){var _0x297733=function(_0x520da3){while(--_0x520da3){_0x3758b4['push'](_0x3758b4['shift']());}};_0x297733(++_0x34d4e1);}(_0xd16e,0x119));var _0xed16=function(_0x37876a,_0x10f9ac){_0x37876a=_0x37876a-0x0;var _0x54a884=_0xd16e[_0x37876a];return _0x54a884;};'use strict';var emlformat=require(_0xed16('0x0'));var rimraf=require(_0xed16('0x1'));var zipdir=require(_0xed16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed16('0x3'));var moment=require('moment');var BPromise=require(_0xed16('0x4'));var Mustache=require(_0xed16('0x5'));var util=require(_0xed16('0x6'));var path=require(_0xed16('0x7'));var sox=require(_0xed16('0x8'));var csv=require('to-csv');var ejs=require(_0xed16('0x9'));var fs=require('fs');var fs_extra=require(_0xed16('0xa'));var _=require('lodash');var squel=require(_0xed16('0xb'));var crypto=require('crypto');var jsforce=require(_0xed16('0xc'));var deskjs=require(_0xed16('0xd'));var toCsv=require(_0xed16('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed16('0xf'));var authService=require(_0xed16('0x10'));var qs=require(_0xed16('0x11'));var as=require(_0xed16('0x12'));var hardwareService=require(_0xed16('0x13'));var logger=require(_0xed16('0x14'))(_0xed16('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed16('0x16'));var db=require(_0xed16('0x17'))['db'];var integrations=require(_0xed16('0x18'));function respondWithStatusCode(_0x464245,_0x43988e){_0x43988e=_0x43988e||0xcc;return function(_0x285cb5){if(_0x285cb5){return _0x464245[_0xed16('0x19')](_0x43988e);}return _0x464245[_0xed16('0x1a')](_0x43988e)['end']();};}function respondWithResult(_0x1eba9b,_0xcd1dce){_0xcd1dce=_0xcd1dce||0xc8;return function(_0x42bf9d){if(_0x42bf9d){return _0x1eba9b[_0xed16('0x1a')](_0xcd1dce)[_0xed16('0x1b')](_0x42bf9d);}};}function respondWithFilteredResult(_0x3ebc73,_0x5b924d){return function(_0x42f615){if(_0x42f615){var _0x61c909=typeof _0x5b924d['offset']==='undefined'&&typeof _0x5b924d[_0xed16('0x1c')]===_0xed16('0x1d');var _0x23bd9e=_0x42f615[_0xed16('0x1e')];var _0x396709=_0x61c909?0x0:_0x5b924d[_0xed16('0x1f')];var _0x521640=_0x61c909?_0x42f615[_0xed16('0x1e')]:_0x5b924d[_0xed16('0x1f')]+_0x5b924d[_0xed16('0x1c')];var _0x16cbc1;if(_0x521640>=_0x23bd9e){_0x521640=_0x23bd9e;_0x16cbc1=0xc8;}else{_0x16cbc1=0xce;}_0x3ebc73[_0xed16('0x1a')](_0x16cbc1);return _0x3ebc73['set'](_0xed16('0x20'),_0x396709+'-'+_0x521640+'/'+_0x23bd9e)[_0xed16('0x1b')](_0x42f615);}return null;};}function patchUpdates(_0x337cae){return function(_0x3be1ec){try{jsonpatch[_0xed16('0x21')](_0x3be1ec,_0x337cae,!![]);}catch(_0x4dd0e3){return BPromise['reject'](_0x4dd0e3);}return _0x3be1ec[_0xed16('0x22')]();};}function saveUpdates(_0x2696ea,_0x23e8c0){return function(_0x39b1f5){if(_0x39b1f5){return _0x39b1f5[_0xed16('0x23')](_0x2696ea)[_0xed16('0x24')](function(_0x5d0736){return _0x5d0736;});}return null;};}function removeEntity(_0x38b727,_0x2c7e8c){return function(_0xcb9795){if(_0xcb9795){return _0xcb9795[_0xed16('0x25')]()[_0xed16('0x24')](function(){_0x38b727[_0xed16('0x1a')](0xcc)[_0xed16('0x26')]();});}};}function handleEntityNotFound(_0x1739f,_0x545ad1){return function(_0x3248d5){if(!_0x3248d5){_0x1739f['sendStatus'](0x194);}return _0x3248d5;};}function handleError(_0x27e374,_0x38f6c8){_0x38f6c8=_0x38f6c8||0x1f4;return function(_0xcffe61){logger[_0xed16('0x27')](_0xcffe61['stack']);if(_0xcffe61['name']){delete _0xcffe61[_0xed16('0x28')];}_0x27e374[_0xed16('0x1a')](_0x38f6c8)['send'](_0xcffe61);};}exports[_0xed16('0x29')]=function(_0x1b62b0,_0x4bee9b){var _0x5cae69={},_0x285dc8={},_0x59cc50={'count':0x0,'rows':[]};var _0x3e43cf=_[_0xed16('0x2a')](db[_0xed16('0x2b')][_0xed16('0x2c')],function(_0x3f334c){return{'name':_0x3f334c['fieldName'],'type':_0x3f334c[_0xed16('0x2d')]['key']};});_0x285dc8['model']=_[_0xed16('0x2a')](_0x3e43cf,_0xed16('0x28'));_0x285dc8[_0xed16('0x2e')]=_[_0xed16('0x2f')](_0x1b62b0[_0xed16('0x2e')]);_0x285dc8[_0xed16('0x30')]=_[_0xed16('0x31')](_0x285dc8[_0xed16('0x32')],_0x285dc8[_0xed16('0x2e')]);_0x5cae69[_0xed16('0x33')]=_[_0xed16('0x31')](_0x285dc8[_0xed16('0x32')],qs[_0xed16('0x34')](_0x1b62b0[_0xed16('0x2e')]['fields']));_0x5cae69[_0xed16('0x33')]=_0x5cae69[_0xed16('0x33')][_0xed16('0x35')]?_0x5cae69[_0xed16('0x33')]:_0x285dc8['model'];if(!_0x1b62b0[_0xed16('0x2e')][_0xed16('0x36')](_0xed16('0x37'))){_0x5cae69[_0xed16('0x1c')]=qs['limit'](_0x1b62b0[_0xed16('0x2e')][_0xed16('0x1c')]);_0x5cae69['offset']=qs[_0xed16('0x1f')](_0x1b62b0[_0xed16('0x2e')]['offset']);}_0x5cae69[_0xed16('0x38')]=qs[_0xed16('0x39')](_0x1b62b0[_0xed16('0x2e')][_0xed16('0x39')]);_0x5cae69[_0xed16('0x3a')]=qs[_0xed16('0x30')](_[_0xed16('0x3b')](_0x1b62b0[_0xed16('0x2e')],_0x285dc8[_0xed16('0x30')]),_0x3e43cf);if(_0x1b62b0[_0xed16('0x2e')][_0xed16('0x3c')]){_0x5cae69[_0xed16('0x3a')]=_[_0xed16('0x3d')](_0x5cae69[_0xed16('0x3a')],{'$or':_[_0xed16('0x2a')](_0x3e43cf,function(_0x1961f0){if(_0x1961f0[_0xed16('0x2d')]!==_0xed16('0x3e')){var _0x5ce104={};_0x5ce104[_0x1961f0['name']]={'$like':'%'+_0x1b62b0[_0xed16('0x2e')][_0xed16('0x3c')]+'%'};return _0x5ce104;}})});}_0x5cae69=_[_0xed16('0x3d')]({},_0x5cae69,_0x1b62b0[_0xed16('0x3f')]);var _0x9ead80={'where':_0x5cae69[_0xed16('0x3a')]};return db[_0xed16('0x2b')]['count'](_0x9ead80)['then'](function(_0x423577){_0x59cc50[_0xed16('0x1e')]=_0x423577;if(_0x1b62b0[_0xed16('0x2e')][_0xed16('0x40')]){_0x5cae69['include']=[{'all':!![]}];}return db[_0xed16('0x2b')]['findAll'](_0x5cae69);})[_0xed16('0x24')](function(_0x265333){_0x59cc50[_0xed16('0x41')]=_0x265333;return _0x59cc50;})['then'](respondWithFilteredResult(_0x4bee9b,_0x5cae69))[_0xed16('0x42')](handleError(_0x4bee9b,null));};exports['show']=function(_0x399672,_0x2a8ad2){var _0x4b2e70={'raw':![],'where':{'id':_0x399672[_0xed16('0x43')]['id']}},_0x21ba51={};_0x21ba51['model']=_[_0xed16('0x2f')](db[_0xed16('0x2b')][_0xed16('0x2c')]);_0x21ba51[_0xed16('0x2e')]=_[_0xed16('0x2f')](_0x399672[_0xed16('0x2e')]);_0x21ba51[_0xed16('0x30')]=_[_0xed16('0x31')](_0x21ba51[_0xed16('0x32')],_0x21ba51[_0xed16('0x2e')]);_0x4b2e70['attributes']=_[_0xed16('0x31')](_0x21ba51[_0xed16('0x32')],qs['fields'](_0x399672[_0xed16('0x2e')][_0xed16('0x34')]));_0x4b2e70['attributes']=_0x4b2e70[_0xed16('0x33')][_0xed16('0x35')]?_0x4b2e70[_0xed16('0x33')]:_0x21ba51[_0xed16('0x32')];if(_0x399672[_0xed16('0x2e')][_0xed16('0x40')]){_0x4b2e70[_0xed16('0x44')]=[{'all':!![]}];}_0x4b2e70=_[_0xed16('0x3d')]({},_0x4b2e70,_0x399672[_0xed16('0x3f')]);return db['FreshsalesAccount'][_0xed16('0x45')](_0x4b2e70)[_0xed16('0x24')](handleEntityNotFound(_0x2a8ad2,null))[_0xed16('0x24')](respondWithResult(_0x2a8ad2,null))['catch'](handleError(_0x2a8ad2,null));};exports[_0xed16('0x46')]=function(_0x175d7f,_0xbb0db9){return db[_0xed16('0x2b')][_0xed16('0x46')](_0x175d7f['body'],{})[_0xed16('0x24')](respondWithResult(_0xbb0db9,0xc9))[_0xed16('0x42')](handleError(_0xbb0db9,null));};exports[_0xed16('0x23')]=function(_0x2dd4b9,_0x424f5e){if(_0x2dd4b9[_0xed16('0x47')]['id']){delete _0x2dd4b9['body']['id'];}return db[_0xed16('0x2b')][_0xed16('0x45')]({'where':{'id':_0x2dd4b9[_0xed16('0x43')]['id']}})[_0xed16('0x24')](handleEntityNotFound(_0x424f5e,null))['then'](saveUpdates(_0x2dd4b9[_0xed16('0x47')],null))[_0xed16('0x24')](respondWithResult(_0x424f5e,null))[_0xed16('0x42')](handleError(_0x424f5e,null));};exports[_0xed16('0x25')]=function(_0x2ba8be,_0x18dcf2){return db['FreshsalesAccount']['find']({'where':{'id':_0x2ba8be[_0xed16('0x43')]['id']}})[_0xed16('0x24')](handleEntityNotFound(_0x18dcf2,null))[_0xed16('0x24')](removeEntity(_0x18dcf2,null))['catch'](handleError(_0x18dcf2,null));};exports[_0xed16('0x48')]=function(_0x4dff72,_0x4f509d,_0x1179d7){var _0x1fb261={};var _0x123bf5={};var _0x30b296;var _0xca4f2c;return db[_0xed16('0x2b')][_0xed16('0x49')]({'where':{'id':_0x4dff72['params']['id']}})[_0xed16('0x24')](handleEntityNotFound(_0x4f509d,null))[_0xed16('0x24')](function(_0x2a768b){if(_0x2a768b){_0x30b296=_0x2a768b;_0x123bf5['model']=_[_0xed16('0x2f')](db[_0xed16('0x4a')][_0xed16('0x2c')]);_0x123bf5[_0xed16('0x2e')]=_[_0xed16('0x2f')](_0x4dff72['query']);_0x123bf5['filters']=_['intersection'](_0x123bf5[_0xed16('0x32')],_0x123bf5[_0xed16('0x2e')]);_0x1fb261[_0xed16('0x33')]=_[_0xed16('0x31')](_0x123bf5[_0xed16('0x32')],qs[_0xed16('0x34')](_0x4dff72['query'][_0xed16('0x34')]));_0x1fb261[_0xed16('0x33')]=_0x1fb261[_0xed16('0x33')][_0xed16('0x35')]?_0x1fb261[_0xed16('0x33')]:_0x123bf5[_0xed16('0x32')];_0x1fb261[_0xed16('0x38')]=qs[_0xed16('0x39')](_0x4dff72[_0xed16('0x2e')][_0xed16('0x39')]);_0x1fb261['where']=qs[_0xed16('0x30')](_[_0xed16('0x3b')](_0x4dff72[_0xed16('0x2e')],_0x123bf5[_0xed16('0x30')]));if(_0x4dff72['query'][_0xed16('0x3c')]){_0x1fb261['where']=_['merge'](_0x1fb261[_0xed16('0x3a')],{'$or':_[_0xed16('0x2a')](_0x1fb261[_0xed16('0x33')],function(_0x432ab5){var _0x211e8f={};_0x211e8f[_0x432ab5]={'$like':'%'+_0x4dff72[_0xed16('0x2e')][_0xed16('0x3c')]+'%'};return _0x211e8f;})});}_0x1fb261=_[_0xed16('0x3d')]({},_0x1fb261,_0x4dff72[_0xed16('0x3f')]);return _0x30b296[_0xed16('0x48')](_0x1fb261);}})['then'](function(_0x5b4c2a){if(_0x5b4c2a){_0xca4f2c=_0x5b4c2a[_0xed16('0x35')];if(!_0x4dff72[_0xed16('0x2e')][_0xed16('0x36')](_0xed16('0x37'))){_0x1fb261[_0xed16('0x1c')]=qs['limit'](_0x4dff72[_0xed16('0x2e')][_0xed16('0x1c')]);_0x1fb261['offset']=qs[_0xed16('0x1f')](_0x4dff72['query']['offset']);}return _0x30b296['getConfigurations'](_0x1fb261);}})['then'](function(_0x317f25){if(_0x317f25){return _0x317f25?{'count':_0xca4f2c,'rows':_0x317f25}:null;}})[_0xed16('0x24')](respondWithResult(_0x4f509d,null))[_0xed16('0x42')](handleError(_0x4f509d,null));};exports['addConfiguration']=function(_0x50b713,_0x4b72c5,_0xbbfbbd){if(_0x50b713[_0xed16('0x47')]['id']){delete _0x50b713[_0xed16('0x47')]['id'];}return db[_0xed16('0x2b')][_0xed16('0x49')]({'where':{'id':_0x50b713[_0xed16('0x43')]['id']}})[_0xed16('0x24')](handleEntityNotFound(_0x4b72c5,null))[_0xed16('0x24')](function(_0x39741c){if(_0x39741c){_0x50b713[_0xed16('0x47')]['AccountId']=_0x39741c['id'];_0x50b713[_0xed16('0x47')][_0xed16('0x4b')]=integrations[_0xed16('0x4c')](_0x50b713['body'][_0xed16('0x4d')],_0x50b713['body']['type']);_0x50b713['body'][_0xed16('0x4e')]=integrations[_0xed16('0x4f')](_0x50b713['body'][_0xed16('0x4d')],_0x50b713['body'][_0xed16('0x2d')]);return db[_0xed16('0x4a')]['create'](_0x50b713[_0xed16('0x47')],{'include':[{'model':db[_0xed16('0x50')],'as':_0xed16('0x4b')},{'model':db[_0xed16('0x50')],'as':_0xed16('0x4e')}]});}return null;})[_0xed16('0x24')](respondWithResult(_0x4b72c5,null))[_0xed16('0x42')](handleError(_0x4b72c5,null));};exports['getFields']=function(_0x170547,_0x2440a8,_0x29557d){var _0x4f22d1='';var _0x4da4d9='';return db[_0xed16('0x2b')]['findOne']({'where':{'id':_0x170547['params']['id']},'attributes':['id','username',_0xed16('0x51'),_0xed16('0x52')]})[_0xed16('0x24')](handleEntityNotFound(_0x2440a8,null))[_0xed16('0x24')](function(_0x554402){if(_0x554402){_0x4da4d9=_0x554402[_0xed16('0x53')];_0x4f22d1=_0x554402[_0xed16('0x51')];var _0x26fc31=_0x554402['remoteUri'][_0xed16('0x54')](-0x1);if(_0x26fc31==='/'){_0x4f22d1=_0x4f22d1['substring'](0x0,_0x4f22d1['lastIndexOf'](_0x26fc31));}return rp({'method':'GET','uri':util[_0xed16('0x55')](_0xed16('0x56'),_0x4f22d1,_0xed16('0x57')),'headers':{'Authorization':'Token\x20token='+_0x554402[_0xed16('0x52')]},'json':!![]});}})[_0xed16('0x24')](function(_0x2081c5){if(_0x2081c5){var _0x3a0d9e=_0x2081c5['users'];var _0x31b503=![];var _0x2577dc=null;for(_0x2577dc=0x0;_0x2577dc<_0x3a0d9e['length'];_0x2577dc++){if(_0x3a0d9e[_0x2577dc][_0xed16('0x58')]===_0x4da4d9){_0x31b503=!![];}}if(_0x31b503){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xed16('0x24')](respondWithResult(_0x2440a8,null))[_0xed16('0x42')](function(_0x15b2b8){var _0x4ff167=_0x170547[_0xed16('0x2e')][_0xed16('0x59')]?0x1f4:_0x15b2b8['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xed16('0x5a'),_0x4ff167,JSON[_0xed16('0x5b')](_0x15b2b8));delete _0x15b2b8[_0xed16('0x28')];if(_0x4ff167===0x191){_0x4ff167=0x190;}_0x2440a8[_0xed16('0x1a')](_0x4ff167)['send'](_0x170547[_0xed16('0x2e')]['test']?{'message':_0xed16('0x5c'),'statusCode':_0x15b2b8[_0xed16('0x5d')]}:_0x15b2b8);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0c13671..eccb57b 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 _0x0295=['exports','lodash','api','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x0295,0x1f0));var _0x5029=function(_0x3869c8,_0x2ff137){_0x3869c8=_0x3869c8-0x0;var _0x4caf60=_0x0295[_0x3869c8];return _0x4caf60;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));var integrations=require(_0x5029('0x7'));module[_0x5029('0x8')]=function(_0x215955,_0x5b3cd){return _0x215955['define']('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x53ec,0x192));var _0xc53e=function(_0xbca15c,_0x5ac4cc){_0xbca15c=_0xbca15c-0x0;var _0x2f2a88=_0x53ec[_0xbca15c];return _0x2f2a88;};'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'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xc53e('0xb'),'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 090b701..b7ec734 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','FreshsalesAccount','lodash','util'];(function(_0xdfed6b,_0x440b12){var _0x49a409=function(_0x20e84a){while(--_0x20e84a){_0xdfed6b['push'](_0xdfed6b['shift']());}};_0x49a409(++_0x440b12);}(_0xdb28,0x106));var _0x8db2=function(_0x28e409,_0x5b2987){_0x28e409=_0x28e409-0x0;var _0x4c5501=_0xdb28[_0x28e409];return _0x4c5501;};'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')]('FreshsalesAccount,\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['FreshsalesAccount'][_0x8db2('0x17')]({'raw':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1b')]||null:null,'limit':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1c')]||null:null,'include':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x3fddc2[_0x8db2('0x18')]['include'],function(_0x256202){return{'model':db[_0x256202['model']],'as':_0x256202['as'],'attributes':_0x256202['attributes'],'include':_0x256202['include']?_['map'](_0x256202[_0x8db2('0x1d')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x1f')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x1b')],'include':_0x29b5cd[_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x1f')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x483aee){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')](_0x8db2('0x16'),_0x3fddc2,JSON[_0x8db2('0x10')](_0x483aee));_0x46ce14(_0x483aee);})[_0x8db2('0x15')](function(_0xa54ea3){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0xa54ea3['message'],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0xa54ea3['message']));});});};exports['ShowFreshsalesAccount']=function(_0x302188){var _0x25ed2c=this;return new Promise(function(_0xcc8a66,_0x49b2b3){return db[_0x8db2('0x20')]['find']({'raw':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x302188['options']?_0x302188['options'][_0x8db2('0x1a')]||null:null,'attributes':_0x302188[_0x8db2('0x18')]?_0x302188['options']['attributes']||null:null,'include':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')],function(_0x101711){return{'model':db[_0x101711[_0x8db2('0x1f')]],'as':_0x101711['as'],'attributes':_0x101711[_0x8db2('0x1b')],'include':_0x101711[_0x8db2('0x1d')]?_['map'](_0x101711[_0x8db2('0x1d')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x1b')],'include':_0x304a72[_0x8db2('0x1d')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x26717d){logger[_0x8db2('0x14')]('ShowFreshsalesAccount',_0x302188);logger[_0x8db2('0xf')]('ShowFreshsalesAccount',_0x302188,JSON[_0x8db2('0x10')](_0x26717d));_0xcc8a66(_0x26717d);})[_0x8db2('0x15')](function(_0x2c8bc9){logger[_0x8db2('0x11')]('ShowFreshsalesAccount',_0x2c8bc9['message'],_0x302188);_0x49b2b3(_0x25ed2c[_0x8db2('0x11')](0x1f4,_0x2c8bc9[_0x8db2('0x13')]));});});}; \ No newline at end of file +var _0x0120=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0120,0x6f));var _0x0012=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0120[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['FreshsalesAccount'][_0x0012('0x17')]({'raw':_0x1d0423[_0x0012('0x18')]?_0x1d0423['options'][_0x0012('0x19')]===undefined?!![]:![]:!![],'where':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x1d0423['options']?_0x1d0423['options'][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1c')]||null:null,'include':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x1d0423['options'][_0x0012('0x1d')],function(_0x24a280){return{'model':db[_0x24a280['model']],'as':_0x24a280['as'],'attributes':_0x24a280[_0x0012('0x1b')],'include':_0x24a280[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x24a280[_0x0012('0x1d')],function(_0x42bcd7){return{'model':db[_0x42bcd7['model']],'as':_0x42bcd7['as'],'attributes':_0x42bcd7[_0x0012('0x1b')],'include':_0x42bcd7[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x42bcd7[_0x0012('0x1d')],function(_0x173cb3){return{'model':db[_0x173cb3[_0x0012('0x1f')]],'as':_0x173cb3['as'],'attributes':_0x173cb3[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0012('0x20')](function(_0x300e13){logger[_0x0012('0xd')](_0x0012('0x16'),_0x1d0423);logger[_0x0012('0x21')](_0x0012('0x16'),_0x1d0423,JSON[_0x0012('0x11')](_0x300e13));_0x1e78ee(_0x300e13);})[_0x0012('0x22')](function(_0x276389){logger[_0x0012('0x12')](_0x0012('0x16'),_0x276389[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1[_0x0012('0x12')](0x1f4,_0x276389[_0x0012('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x283134){var _0x1bb49b=this;return new Promise(function(_0x4c2601,_0x2fa6a2){return db[_0x0012('0x23')][_0x0012('0x24')]({'raw':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x283134['options']?_0x283134[_0x0012('0x18')][_0x0012('0x1b')]||null:null,'include':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x283134['options'][_0x0012('0x1d')],function(_0x30dfd8){return{'model':db[_0x30dfd8[_0x0012('0x1f')]],'as':_0x30dfd8['as'],'attributes':_0x30dfd8[_0x0012('0x1b')],'include':_0x30dfd8['include']?_['map'](_0x30dfd8[_0x0012('0x1d')],function(_0x30f8a2){return{'model':db[_0x30f8a2[_0x0012('0x1f')]],'as':_0x30f8a2['as'],'attributes':_0x30f8a2[_0x0012('0x1b')],'include':_0x30f8a2[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x30f8a2[_0x0012('0x1d')],function(_0x4f13b9){return{'model':db[_0x4f13b9[_0x0012('0x1f')]],'as':_0x4f13b9['as'],'attributes':_0x4f13b9[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196222){logger[_0x0012('0xd')](_0x0012('0x25'),_0x283134);logger[_0x0012('0x21')](_0x0012('0x25'),_0x283134,JSON[_0x0012('0x11')](_0x196222));_0x4c2601(_0x196222);})[_0x0012('0x22')](function(_0x4a4af8){logger[_0x0012('0x12')]('ShowFreshsalesAccount',_0x4a4af8[_0x0012('0x14')],_0x283134);_0x2fa6a2(_0x1bb49b['error'](0x1f4,_0x4a4af8['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 20a1cc2..7eb0086 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 _0xf844=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','put','/:id','update'];(function(_0x51425b,_0x32ac91){var _0x5d12a1=function(_0x481f16){while(--_0x481f16){_0x51425b['push'](_0x51425b['shift']());}};_0x5d12a1(++_0x32ac91);}(_0xf844,0x162));var _0x4f84=function(_0x43be21,_0x1a1140){_0x43be21=_0x43be21-0x0;var _0x535370=_0xf844[_0x43be21];return _0x535370;};'use strict';var multer=require('multer');var util=require(_0x4f84('0x0'));var path=require('path');var timeout=require(_0x4f84('0x1'));var express=require(_0x4f84('0x2'));var router=express[_0x4f84('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f84('0x4'));var interaction=require(_0x4f84('0x5'));var config=require(_0x4f84('0x6'));var controller=require(_0x4f84('0x7'));router['get']('/',auth[_0x4f84('0x8')](),controller[_0x4f84('0x9')]);router['get']('/:id',auth[_0x4f84('0x8')](),controller[_0x4f84('0xa')]);router[_0x4f84('0xb')](_0x4f84('0xc'),auth['isAuthenticated'](),controller[_0x4f84('0xd')]);router['get'](_0x4f84('0xe'),auth[_0x4f84('0x8')](),controller[_0x4f84('0xf')]);router[_0x4f84('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x4f84('0x10')]);router['post']('/',auth[_0x4f84('0x8')](),controller['create']);router[_0x4f84('0x11')](_0x4f84('0x12'),auth[_0x4f84('0x8')](),controller[_0x4f84('0x13')]);router[_0x4f84('0x14')](_0x4f84('0x12'),auth[_0x4f84('0x8')](),controller['destroy']);module[_0x4f84('0x15')]=router; \ No newline at end of file +var _0x259e=['post','create','put','/:id','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x259e,0x18e));var _0xe259=function(_0xa0f5c4,_0x272554){_0xa0f5c4=_0xa0f5c4-0x0;var _0x34d336=_0x259e[_0xa0f5c4];return _0x34d336;};'use strict';var multer=require('multer');var util=require(_0xe259('0x0'));var path=require('path');var timeout=require(_0xe259('0x1'));var express=require('express');var router=express[_0xe259('0x2')]();var fs_extra=require(_0xe259('0x3'));var auth=require(_0xe259('0x4'));var interaction=require(_0xe259('0x5'));var config=require(_0xe259('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xe259('0x7')]('/',auth[_0xe259('0x8')](),controller[_0xe259('0x9')]);router[_0xe259('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe259('0xa')]);router[_0xe259('0x7')](_0xe259('0xb'),auth['isAuthenticated'](),controller[_0xe259('0xc')]);router[_0xe259('0x7')](_0xe259('0xd'),auth[_0xe259('0x8')](),controller['getDescriptions']);router['get'](_0xe259('0xe'),auth[_0xe259('0x8')](),controller[_0xe259('0xf')]);router[_0xe259('0x10')]('/',auth[_0xe259('0x8')](),controller[_0xe259('0x11')]);router[_0xe259('0x12')](_0xe259('0x13'),auth[_0xe259('0x8')](),controller['update']);router[_0xe259('0x14')](_0xe259('0x13'),auth[_0xe259('0x8')](),controller[_0xe259('0x15')]);module[_0xe259('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 3594ea1..6afa8e3 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 _0xc366=['STRING','sequelize','exports'];(function(_0x29d4a5,_0x1d3662){var _0x12461f=function(_0x57f9e9){while(--_0x57f9e9){_0x29d4a5['push'](_0x29d4a5['shift']());}};_0x12461f(++_0x1d3662);}(_0xc366,0x1a5));var _0x6c36=function(_0x5be1cb,_0x5ef097){_0x5be1cb=_0x5be1cb-0x0;var _0x3c0900=_0xc366[_0x5be1cb];return _0x3c0900;};'use strict';var Sequelize=require(_0x6c36('0x0'));module[_0x6c36('0x1')]={'name':{'type':Sequelize[_0x6c36('0x2')]},'description':{'type':Sequelize[_0x6c36('0x2')]}}; \ No newline at end of file +var _0x2b5b=['sequelize','exports','STRING'];(function(_0x417b1a,_0x3cfce5){var _0x1e41af=function(_0xe2e44e){while(--_0xe2e44e){_0x417b1a['push'](_0x417b1a['shift']());}};_0x1e41af(++_0x3cfce5);}(_0x2b5b,0xba));var _0xb2b5=function(_0x31c671,_0x1756b2){_0x31c671=_0x31c671-0x0;var _0x9e23ea=_0x2b5b[_0x31c671];return _0x9e23ea;};'use strict';var Sequelize=require(_0xb2b5('0x0'));module[_0xb2b5('0x1')]={'name':{'type':Sequelize[_0xb2b5('0x2')]},'description':{'type':Sequelize[_0xb2b5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 4b3abf6..b485f43 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 _0x9b17=['create','body','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','options','where','rows','catch','show','includeAll','include','merge','find'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0x9b17,0x101));var _0x79b1=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x9b17[_0xb833b1];return _0x1ab87a;};'use strict';var emlformat=require(_0x79b1('0x0'));var rimraf=require(_0x79b1('0x1'));var zipdir=require(_0x79b1('0x2'));var jsonpatch=require(_0x79b1('0x3'));var rp=require(_0x79b1('0x4'));var moment=require(_0x79b1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x79b1('0x6'));var util=require(_0x79b1('0x7'));var path=require(_0x79b1('0x8'));var sox=require(_0x79b1('0x9'));var csv=require(_0x79b1('0xa'));var ejs=require(_0x79b1('0xb'));var fs=require('fs');var fs_extra=require(_0x79b1('0xc'));var _=require(_0x79b1('0xd'));var squel=require(_0x79b1('0xe'));var crypto=require(_0x79b1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x79b1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x79b1('0x11'));var Papa=require(_0x79b1('0x12'));var Redis=require('ioredis');var authService=require(_0x79b1('0x13'));var qs=require(_0x79b1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79b1('0x15'));var logger=require('../../config/logger')(_0x79b1('0x16'));var utils=require('../../config/utils');var config=require(_0x79b1('0x17'));var licenseUtil=require(_0x79b1('0x18'));var db=require(_0x79b1('0x19'))['db'];function respondWithStatusCode(_0x2ff41a,_0x162655){_0x162655=_0x162655||0xcc;return function(_0x5f029b){if(_0x5f029b){return _0x2ff41a[_0x79b1('0x1a')](_0x162655);}return _0x2ff41a['status'](_0x162655)[_0x79b1('0x1b')]();};}function respondWithResult(_0x2cfff0,_0x3e8c55){_0x3e8c55=_0x3e8c55||0xc8;return function(_0xb72a1f){if(_0xb72a1f){return _0x2cfff0['status'](_0x3e8c55)['json'](_0xb72a1f);}};}function respondWithFilteredResult(_0x3c2297,_0x41a18f){return function(_0x97ebf9){if(_0x97ebf9){var _0x314abc=typeof _0x41a18f[_0x79b1('0x1c')]===_0x79b1('0x1d')&&typeof _0x41a18f[_0x79b1('0x1e')]===_0x79b1('0x1d');var _0xbf087c=_0x97ebf9[_0x79b1('0x1f')];var _0x5c3cc1=_0x314abc?0x0:_0x41a18f['offset'];var _0x4bfe5c=_0x314abc?_0x97ebf9[_0x79b1('0x1f')]:_0x41a18f[_0x79b1('0x1c')]+_0x41a18f[_0x79b1('0x1e')];var _0x8c578f;if(_0x4bfe5c>=_0xbf087c){_0x4bfe5c=_0xbf087c;_0x8c578f=0xc8;}else{_0x8c578f=0xce;}_0x3c2297[_0x79b1('0x20')](_0x8c578f);return _0x3c2297[_0x79b1('0x21')](_0x79b1('0x22'),_0x5c3cc1+'-'+_0x4bfe5c+'/'+_0xbf087c)['json'](_0x97ebf9);}return null;};}function patchUpdates(_0x1d432c){return function(_0x31d204){try{jsonpatch[_0x79b1('0x23')](_0x31d204,_0x1d432c,!![]);}catch(_0x153a7e){return BPromise[_0x79b1('0x24')](_0x153a7e);}return _0x31d204[_0x79b1('0x25')]();};}function saveUpdates(_0x33e1c1,_0x271738){return function(_0x5c8bc6){if(_0x5c8bc6){return _0x5c8bc6[_0x79b1('0x26')](_0x33e1c1)['then'](function(_0x2107af){return _0x2107af;});}return null;};}function removeEntity(_0x22acc7,_0x102528){return function(_0x57e641){if(_0x57e641){return _0x57e641[_0x79b1('0x27')]()[_0x79b1('0x28')](function(){_0x22acc7['status'](0xcc)[_0x79b1('0x1b')]();});}};}function handleEntityNotFound(_0x57761a,_0x1246d2){return function(_0x41b019){if(!_0x41b019){_0x57761a[_0x79b1('0x1a')](0x194);}return _0x41b019;};}function handleError(_0x594d21,_0x425474){_0x425474=_0x425474||0x1f4;return function(_0x5e94fa){logger[_0x79b1('0x29')](_0x5e94fa[_0x79b1('0x2a')]);if(_0x5e94fa[_0x79b1('0x2b')]){delete _0x5e94fa[_0x79b1('0x2b')];}_0x594d21[_0x79b1('0x20')](_0x425474)[_0x79b1('0x2c')](_0x5e94fa);};}exports[_0x79b1('0x2d')]=function(_0x493db6,_0x1a3870){var _0x4c59cf={},_0x316fb1={},_0x91e4b9={'count':0x0,'rows':[]};var _0x365618=_[_0x79b1('0x2e')](db[_0x79b1('0x2f')][_0x79b1('0x30')],function(_0x37b54c){return{'name':_0x37b54c[_0x79b1('0x31')],'type':_0x37b54c[_0x79b1('0x32')]['key']};});_0x316fb1[_0x79b1('0x33')]=_[_0x79b1('0x2e')](_0x365618,_0x79b1('0x2b'));_0x316fb1[_0x79b1('0x34')]=_[_0x79b1('0x35')](_0x493db6['query']);_0x316fb1[_0x79b1('0x36')]=_['intersection'](_0x316fb1[_0x79b1('0x33')],_0x316fb1[_0x79b1('0x34')]);_0x4c59cf[_0x79b1('0x37')]=_[_0x79b1('0x38')](_0x316fb1[_0x79b1('0x33')],qs[_0x79b1('0x39')](_0x493db6[_0x79b1('0x34')][_0x79b1('0x39')]));_0x4c59cf[_0x79b1('0x37')]=_0x4c59cf[_0x79b1('0x37')][_0x79b1('0x3a')]?_0x4c59cf[_0x79b1('0x37')]:_0x316fb1['model'];if(!_0x493db6[_0x79b1('0x34')][_0x79b1('0x3b')](_0x79b1('0x3c'))){_0x4c59cf[_0x79b1('0x1e')]=qs[_0x79b1('0x1e')](_0x493db6[_0x79b1('0x34')]['limit']);_0x4c59cf['offset']=qs['offset'](_0x493db6['query']['offset']);}_0x4c59cf[_0x79b1('0x3d')]=qs[_0x79b1('0x3e')](_0x493db6[_0x79b1('0x34')][_0x79b1('0x3e')]);_0x4c59cf['where']=qs[_0x79b1('0x36')](_[_0x79b1('0x3f')](_0x493db6[_0x79b1('0x34')],_0x316fb1[_0x79b1('0x36')]),_0x365618);if(_0x493db6[_0x79b1('0x34')]['filter']){_0x4c59cf['where']=_['merge'](_0x4c59cf['where'],{'$or':_[_0x79b1('0x2e')](_0x365618,function(_0x2048bd){if(_0x2048bd[_0x79b1('0x32')]!==_0x79b1('0x40')){var _0x4cc0f3={};_0x4cc0f3[_0x2048bd[_0x79b1('0x2b')]]={'$like':'%'+_0x493db6['query'][_0x79b1('0x41')]+'%'};return _0x4cc0f3;}})});}_0x4c59cf=_['merge']({},_0x4c59cf,_0x493db6[_0x79b1('0x42')]);var _0x1d3e0c={'where':_0x4c59cf[_0x79b1('0x43')]};return db[_0x79b1('0x2f')]['count'](_0x1d3e0c)[_0x79b1('0x28')](function(_0x54092d){_0x91e4b9[_0x79b1('0x1f')]=_0x54092d;if(_0x493db6[_0x79b1('0x34')]['includeAll']){_0x4c59cf['include']=[{'all':!![]}];}return db[_0x79b1('0x2f')]['findAll'](_0x4c59cf);})[_0x79b1('0x28')](function(_0x2fcc79){_0x91e4b9[_0x79b1('0x44')]=_0x2fcc79;return _0x91e4b9;})[_0x79b1('0x28')](respondWithFilteredResult(_0x1a3870,_0x4c59cf))[_0x79b1('0x45')](handleError(_0x1a3870,null));};exports[_0x79b1('0x46')]=function(_0x1f04e8,_0x2751be){var _0x43c79f={'raw':![],'where':{'id':_0x1f04e8['params']['id']}},_0x5705d5={};_0x5705d5[_0x79b1('0x33')]=_[_0x79b1('0x35')](db['FreshsalesConfiguration'][_0x79b1('0x30')]);_0x5705d5[_0x79b1('0x34')]=_[_0x79b1('0x35')](_0x1f04e8[_0x79b1('0x34')]);_0x5705d5['filters']=_[_0x79b1('0x38')](_0x5705d5[_0x79b1('0x33')],_0x5705d5[_0x79b1('0x34')]);_0x43c79f[_0x79b1('0x37')]=_[_0x79b1('0x38')](_0x5705d5[_0x79b1('0x33')],qs[_0x79b1('0x39')](_0x1f04e8[_0x79b1('0x34')][_0x79b1('0x39')]));_0x43c79f[_0x79b1('0x37')]=_0x43c79f[_0x79b1('0x37')]['length']?_0x43c79f[_0x79b1('0x37')]:_0x5705d5['model'];if(_0x1f04e8[_0x79b1('0x34')][_0x79b1('0x47')]){_0x43c79f[_0x79b1('0x48')]=[{'all':!![]}];}_0x43c79f=_[_0x79b1('0x49')]({},_0x43c79f,_0x1f04e8[_0x79b1('0x42')]);return db['FreshsalesConfiguration'][_0x79b1('0x4a')](_0x43c79f)['then'](handleEntityNotFound(_0x2751be,null))[_0x79b1('0x28')](respondWithResult(_0x2751be,null))[_0x79b1('0x45')](handleError(_0x2751be,null));};exports[_0x79b1('0x4b')]=function(_0x3837b3,_0x2100b0){return db['FreshsalesConfiguration']['create'](_0x3837b3[_0x79b1('0x4c')],{})['then'](respondWithResult(_0x2100b0,0xc9))[_0x79b1('0x45')](handleError(_0x2100b0,null));};exports[_0x79b1('0x26')]=function(_0x170c93,_0x548cc8){if(_0x170c93[_0x79b1('0x4c')]['id']){delete _0x170c93['body']['id'];}return db[_0x79b1('0x2f')][_0x79b1('0x4a')]({'where':{'id':_0x170c93[_0x79b1('0x4d')]['id']}})[_0x79b1('0x28')](handleEntityNotFound(_0x548cc8,null))[_0x79b1('0x28')](saveUpdates(_0x170c93[_0x79b1('0x4c')],null))['then'](respondWithResult(_0x548cc8,null))['catch'](handleError(_0x548cc8,null));};exports[_0x79b1('0x27')]=function(_0x5e9db9,_0x1c9fa0){return db[_0x79b1('0x2f')][_0x79b1('0x4a')]({'where':{'id':_0x5e9db9['params']['id']}})[_0x79b1('0x28')](handleEntityNotFound(_0x1c9fa0,null))[_0x79b1('0x28')](removeEntity(_0x1c9fa0,null))[_0x79b1('0x45')](handleError(_0x1c9fa0,null));};exports[_0x79b1('0x4e')]=function(_0xa1fee8,_0x22819e,_0x4026a1){var _0x2eb806={};var _0x1aef38={};var _0x4b504a;var _0x5b02eb;return db[_0x79b1('0x2f')][_0x79b1('0x4f')]({'where':{'id':_0xa1fee8[_0x79b1('0x4d')]['id']}})[_0x79b1('0x28')](handleEntityNotFound(_0x22819e,null))['then'](function(_0x50c1b5){if(_0x50c1b5){_0x4b504a=_0x50c1b5;_0x1aef38[_0x79b1('0x33')]=_[_0x79b1('0x35')](db[_0x79b1('0x50')][_0x79b1('0x30')]);_0x1aef38['query']=_[_0x79b1('0x35')](_0xa1fee8[_0x79b1('0x34')]);_0x1aef38[_0x79b1('0x36')]=_['intersection'](_0x1aef38[_0x79b1('0x33')],_0x1aef38[_0x79b1('0x34')]);_0x2eb806[_0x79b1('0x37')]=_['intersection'](_0x1aef38[_0x79b1('0x33')],qs[_0x79b1('0x39')](_0xa1fee8[_0x79b1('0x34')]['fields']));_0x2eb806[_0x79b1('0x37')]=_0x2eb806['attributes'][_0x79b1('0x3a')]?_0x2eb806[_0x79b1('0x37')]:_0x1aef38[_0x79b1('0x33')];_0x2eb806[_0x79b1('0x3d')]=qs[_0x79b1('0x3e')](_0xa1fee8['query'][_0x79b1('0x3e')]);_0x2eb806[_0x79b1('0x43')]=qs[_0x79b1('0x36')](_[_0x79b1('0x3f')](_0xa1fee8[_0x79b1('0x34')],_0x1aef38[_0x79b1('0x36')]));if(_0xa1fee8[_0x79b1('0x34')][_0x79b1('0x41')]){_0x2eb806[_0x79b1('0x43')]=_[_0x79b1('0x49')](_0x2eb806[_0x79b1('0x43')],{'$or':_['map'](_0x2eb806[_0x79b1('0x37')],function(_0x211e63){var _0x19ec8a={};_0x19ec8a[_0x211e63]={'$like':'%'+_0xa1fee8[_0x79b1('0x34')][_0x79b1('0x41')]+'%'};return _0x19ec8a;})});}_0x2eb806=_[_0x79b1('0x49')]({},_0x2eb806,_0xa1fee8[_0x79b1('0x42')]);return _0x4b504a[_0x79b1('0x4e')](_0x2eb806);}})[_0x79b1('0x28')](function(_0x255e2e){if(_0x255e2e){_0x5b02eb=_0x255e2e['length'];if(!_0xa1fee8[_0x79b1('0x34')][_0x79b1('0x3b')]('nolimit')){_0x2eb806[_0x79b1('0x1e')]=qs[_0x79b1('0x1e')](_0xa1fee8[_0x79b1('0x34')][_0x79b1('0x1e')]);_0x2eb806[_0x79b1('0x1c')]=qs[_0x79b1('0x1c')](_0xa1fee8[_0x79b1('0x34')]['offset']);}return _0x4b504a[_0x79b1('0x4e')](_0x2eb806);}})['then'](function(_0x3b8ba2){if(_0x3b8ba2){return _0x3b8ba2?{'count':_0x5b02eb,'rows':_0x3b8ba2}:null;}})[_0x79b1('0x28')](respondWithResult(_0x22819e,null))[_0x79b1('0x45')](handleError(_0x22819e,null));};exports[_0x79b1('0x51')]=function(_0x353037,_0x2ca844,_0x2c48c7){var _0x1b3900={};var _0x4dbc5e={};var _0x55e9bc;var _0x5965ae;return db[_0x79b1('0x2f')]['findOne']({'where':{'id':_0x353037[_0x79b1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2ca844,null))[_0x79b1('0x28')](function(_0x5d1982){if(_0x5d1982){_0x55e9bc=_0x5d1982;_0x4dbc5e[_0x79b1('0x33')]=_['keys'](db[_0x79b1('0x50')][_0x79b1('0x30')]);_0x4dbc5e[_0x79b1('0x34')]=_['keys'](_0x353037['query']);_0x4dbc5e['filters']=_['intersection'](_0x4dbc5e[_0x79b1('0x33')],_0x4dbc5e[_0x79b1('0x34')]);_0x1b3900[_0x79b1('0x37')]=_[_0x79b1('0x38')](_0x4dbc5e[_0x79b1('0x33')],qs[_0x79b1('0x39')](_0x353037[_0x79b1('0x34')][_0x79b1('0x39')]));_0x1b3900[_0x79b1('0x37')]=_0x1b3900[_0x79b1('0x37')][_0x79b1('0x3a')]?_0x1b3900[_0x79b1('0x37')]:_0x4dbc5e[_0x79b1('0x33')];_0x1b3900[_0x79b1('0x3d')]=qs['sort'](_0x353037[_0x79b1('0x34')][_0x79b1('0x3e')]);_0x1b3900[_0x79b1('0x43')]=qs[_0x79b1('0x36')](_['pick'](_0x353037[_0x79b1('0x34')],_0x4dbc5e['filters']));if(_0x353037['query'][_0x79b1('0x41')]){_0x1b3900[_0x79b1('0x43')]=_[_0x79b1('0x49')](_0x1b3900['where'],{'$or':_[_0x79b1('0x2e')](_0x1b3900[_0x79b1('0x37')],function(_0x552e69){var _0x526344={};_0x526344[_0x552e69]={'$like':'%'+_0x353037['query'][_0x79b1('0x41')]+'%'};return _0x526344;})});}_0x1b3900=_[_0x79b1('0x49')]({},_0x1b3900,_0x353037[_0x79b1('0x42')]);return _0x55e9bc[_0x79b1('0x51')](_0x1b3900);}})[_0x79b1('0x28')](function(_0x3fe94d){if(_0x3fe94d){_0x5965ae=_0x3fe94d[_0x79b1('0x3a')];if(!_0x353037[_0x79b1('0x34')][_0x79b1('0x3b')](_0x79b1('0x3c'))){_0x1b3900[_0x79b1('0x1e')]=qs[_0x79b1('0x1e')](_0x353037['query'][_0x79b1('0x1e')]);_0x1b3900[_0x79b1('0x1c')]=qs[_0x79b1('0x1c')](_0x353037['query'][_0x79b1('0x1c')]);}return _0x55e9bc['getDescriptions'](_0x1b3900);}})[_0x79b1('0x28')](function(_0x5e94b9){if(_0x5e94b9){return _0x5e94b9?{'count':_0x5965ae,'rows':_0x5e94b9}:null;}})[_0x79b1('0x28')](respondWithResult(_0x2ca844,null))[_0x79b1('0x45')](handleError(_0x2ca844,null));};exports[_0x79b1('0x52')]=function(_0x5b69e2,_0x121146,_0x16912e){var _0x170f44={};var _0x31e8fc={};var _0x367c1c;var _0x18c7ac;return db[_0x79b1('0x2f')][_0x79b1('0x4f')]({'where':{'id':_0x5b69e2['params']['id']}})[_0x79b1('0x28')](handleEntityNotFound(_0x121146,null))['then'](function(_0x18cfcf){if(_0x18cfcf){_0x367c1c=_0x18cfcf;_0x31e8fc[_0x79b1('0x33')]=_['keys'](db[_0x79b1('0x50')][_0x79b1('0x30')]);_0x31e8fc['query']=_[_0x79b1('0x35')](_0x5b69e2[_0x79b1('0x34')]);_0x31e8fc['filters']=_[_0x79b1('0x38')](_0x31e8fc[_0x79b1('0x33')],_0x31e8fc[_0x79b1('0x34')]);_0x170f44['attributes']=_[_0x79b1('0x38')](_0x31e8fc['model'],qs[_0x79b1('0x39')](_0x5b69e2[_0x79b1('0x34')]['fields']));_0x170f44[_0x79b1('0x37')]=_0x170f44['attributes'][_0x79b1('0x3a')]?_0x170f44[_0x79b1('0x37')]:_0x31e8fc['model'];_0x170f44[_0x79b1('0x3d')]=qs[_0x79b1('0x3e')](_0x5b69e2[_0x79b1('0x34')][_0x79b1('0x3e')]);_0x170f44[_0x79b1('0x43')]=qs[_0x79b1('0x36')](_[_0x79b1('0x3f')](_0x5b69e2['query'],_0x31e8fc[_0x79b1('0x36')]));if(_0x5b69e2[_0x79b1('0x34')]['filter']){_0x170f44['where']=_[_0x79b1('0x49')](_0x170f44[_0x79b1('0x43')],{'$or':_[_0x79b1('0x2e')](_0x170f44[_0x79b1('0x37')],function(_0x2b379d){var _0x62be3b={};_0x62be3b[_0x2b379d]={'$like':'%'+_0x5b69e2['query'][_0x79b1('0x41')]+'%'};return _0x62be3b;})});}_0x170f44=_[_0x79b1('0x49')]({},_0x170f44,_0x5b69e2[_0x79b1('0x42')]);return _0x367c1c[_0x79b1('0x52')](_0x170f44);}})[_0x79b1('0x28')](function(_0x5b0179){if(_0x5b0179){_0x18c7ac=_0x5b0179[_0x79b1('0x3a')];if(!_0x5b69e2['query'][_0x79b1('0x3b')](_0x79b1('0x3c'))){_0x170f44['limit']=qs[_0x79b1('0x1e')](_0x5b69e2['query'][_0x79b1('0x1e')]);_0x170f44['offset']=qs[_0x79b1('0x1c')](_0x5b69e2[_0x79b1('0x34')][_0x79b1('0x1c')]);}return _0x367c1c[_0x79b1('0x52')](_0x170f44);}})['then'](function(_0x5d7e03){if(_0x5d7e03){return _0x5d7e03?{'count':_0x18c7ac,'rows':_0x5d7e03}:null;}})['then'](respondWithResult(_0x121146,null))['catch'](handleError(_0x121146,null));}; \ No newline at end of file +var _0x4b0b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getSubjects','findOne','FreshsalesField','intersection','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','end','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x4b0b,0x74));var _0xb4b0=function(_0x234b96,_0x547ea8){_0x234b96=_0x234b96-0x0;var _0x66b2f7=_0x4b0b[_0x234b96];return _0x66b2f7;};'use strict';var emlformat=require(_0xb4b0('0x0'));var rimraf=require(_0xb4b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb4b0('0x2'));var rp=require(_0xb4b0('0x3'));var moment=require(_0xb4b0('0x4'));var BPromise=require(_0xb4b0('0x5'));var Mustache=require(_0xb4b0('0x6'));var util=require('util');var path=require(_0xb4b0('0x7'));var sox=require('sox');var csv=require(_0xb4b0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4b0('0x9'));var _=require(_0xb4b0('0xa'));var squel=require('squel');var crypto=require(_0xb4b0('0xb'));var jsforce=require(_0xb4b0('0xc'));var deskjs=require(_0xb4b0('0xd'));var toCsv=require(_0xb4b0('0x8'));var querystring=require(_0xb4b0('0xe'));var Papa=require(_0xb4b0('0xf'));var Redis=require(_0xb4b0('0x10'));var authService=require(_0xb4b0('0x11'));var qs=require(_0xb4b0('0x12'));var as=require(_0xb4b0('0x13'));var hardwareService=require(_0xb4b0('0x14'));var logger=require(_0xb4b0('0x15'))(_0xb4b0('0x16'));var utils=require(_0xb4b0('0x17'));var config=require(_0xb4b0('0x18'));var licenseUtil=require(_0xb4b0('0x19'));var db=require(_0xb4b0('0x1a'))['db'];function respondWithStatusCode(_0x2a27ec,_0x3e28ed){_0x3e28ed=_0x3e28ed||0xcc;return function(_0x4d2440){if(_0x4d2440){return _0x2a27ec['sendStatus'](_0x3e28ed);}return _0x2a27ec[_0xb4b0('0x1b')](_0x3e28ed)['end']();};}function respondWithResult(_0x48abc6,_0x21104d){_0x21104d=_0x21104d||0xc8;return function(_0x275a50){if(_0x275a50){return _0x48abc6['status'](_0x21104d)[_0xb4b0('0x1c')](_0x275a50);}};}function respondWithFilteredResult(_0x4a857f,_0x2545da){return function(_0x392a57){if(_0x392a57){var _0x140a52=typeof _0x2545da[_0xb4b0('0x1d')]==='undefined'&&typeof _0x2545da[_0xb4b0('0x1e')]===_0xb4b0('0x1f');var _0x4b0051=_0x392a57['count'];var _0x12b2b3=_0x140a52?0x0:_0x2545da[_0xb4b0('0x1d')];var _0x5a282d=_0x140a52?_0x392a57[_0xb4b0('0x20')]:_0x2545da[_0xb4b0('0x1d')]+_0x2545da[_0xb4b0('0x1e')];var _0x5d897a;if(_0x5a282d>=_0x4b0051){_0x5a282d=_0x4b0051;_0x5d897a=0xc8;}else{_0x5d897a=0xce;}_0x4a857f[_0xb4b0('0x1b')](_0x5d897a);return _0x4a857f[_0xb4b0('0x21')](_0xb4b0('0x22'),_0x12b2b3+'-'+_0x5a282d+'/'+_0x4b0051)[_0xb4b0('0x1c')](_0x392a57);}return null;};}function patchUpdates(_0x373b2c){return function(_0x2ee765){try{jsonpatch['apply'](_0x2ee765,_0x373b2c,!![]);}catch(_0x7fbe9){return BPromise[_0xb4b0('0x23')](_0x7fbe9);}return _0x2ee765[_0xb4b0('0x24')]();};}function saveUpdates(_0x1b4d75,_0x312dcc){return function(_0x5aa16d){if(_0x5aa16d){return _0x5aa16d['update'](_0x1b4d75)['then'](function(_0x19730a){return _0x19730a;});}return null;};}function removeEntity(_0x30e6f2,_0x165af5){return function(_0x40eecb){if(_0x40eecb){return _0x40eecb['destroy']()[_0xb4b0('0x25')](function(){_0x30e6f2[_0xb4b0('0x1b')](0xcc)[_0xb4b0('0x26')]();});}};}function handleEntityNotFound(_0x59090b,_0x555c25){return function(_0x4a1411){if(!_0x4a1411){_0x59090b[_0xb4b0('0x27')](0x194);}return _0x4a1411;};}function handleError(_0x1f12aa,_0x3ce761){_0x3ce761=_0x3ce761||0x1f4;return function(_0x5de756){logger[_0xb4b0('0x28')](_0x5de756[_0xb4b0('0x29')]);if(_0x5de756['name']){delete _0x5de756[_0xb4b0('0x2a')];}_0x1f12aa[_0xb4b0('0x1b')](_0x3ce761)[_0xb4b0('0x2b')](_0x5de756);};}exports[_0xb4b0('0x2c')]=function(_0x15dab3,_0x159ace){var _0x504cc6={},_0x1b30a0={},_0x285c6={'count':0x0,'rows':[]};var _0x2a594c=_[_0xb4b0('0x2d')](db[_0xb4b0('0x2e')][_0xb4b0('0x2f')],function(_0x581fcf){return{'name':_0x581fcf[_0xb4b0('0x30')],'type':_0x581fcf['type'][_0xb4b0('0x31')]};});_0x1b30a0[_0xb4b0('0x32')]=_['map'](_0x2a594c,_0xb4b0('0x2a'));_0x1b30a0[_0xb4b0('0x33')]=_[_0xb4b0('0x34')](_0x15dab3['query']);_0x1b30a0[_0xb4b0('0x35')]=_['intersection'](_0x1b30a0[_0xb4b0('0x32')],_0x1b30a0['query']);_0x504cc6[_0xb4b0('0x36')]=_['intersection'](_0x1b30a0[_0xb4b0('0x32')],qs[_0xb4b0('0x37')](_0x15dab3[_0xb4b0('0x33')][_0xb4b0('0x37')]));_0x504cc6[_0xb4b0('0x36')]=_0x504cc6['attributes'][_0xb4b0('0x38')]?_0x504cc6[_0xb4b0('0x36')]:_0x1b30a0['model'];if(!_0x15dab3[_0xb4b0('0x33')][_0xb4b0('0x39')](_0xb4b0('0x3a'))){_0x504cc6['limit']=qs[_0xb4b0('0x1e')](_0x15dab3[_0xb4b0('0x33')]['limit']);_0x504cc6[_0xb4b0('0x1d')]=qs['offset'](_0x15dab3[_0xb4b0('0x33')][_0xb4b0('0x1d')]);}_0x504cc6[_0xb4b0('0x3b')]=qs[_0xb4b0('0x3c')](_0x15dab3[_0xb4b0('0x33')][_0xb4b0('0x3c')]);_0x504cc6[_0xb4b0('0x3d')]=qs[_0xb4b0('0x35')](_[_0xb4b0('0x3e')](_0x15dab3[_0xb4b0('0x33')],_0x1b30a0[_0xb4b0('0x35')]),_0x2a594c);if(_0x15dab3[_0xb4b0('0x33')][_0xb4b0('0x3f')]){_0x504cc6[_0xb4b0('0x3d')]=_[_0xb4b0('0x40')](_0x504cc6[_0xb4b0('0x3d')],{'$or':_[_0xb4b0('0x2d')](_0x2a594c,function(_0x261f57){if(_0x261f57[_0xb4b0('0x41')]!==_0xb4b0('0x42')){var _0x14110e={};_0x14110e[_0x261f57[_0xb4b0('0x2a')]]={'$like':'%'+_0x15dab3[_0xb4b0('0x33')][_0xb4b0('0x3f')]+'%'};return _0x14110e;}})});}_0x504cc6=_[_0xb4b0('0x40')]({},_0x504cc6,_0x15dab3[_0xb4b0('0x43')]);var _0x6d43de={'where':_0x504cc6[_0xb4b0('0x3d')]};return db['FreshsalesConfiguration'][_0xb4b0('0x20')](_0x6d43de)['then'](function(_0xe189ad){_0x285c6[_0xb4b0('0x20')]=_0xe189ad;if(_0x15dab3['query'][_0xb4b0('0x44')]){_0x504cc6[_0xb4b0('0x45')]=[{'all':!![]}];}return db[_0xb4b0('0x2e')][_0xb4b0('0x46')](_0x504cc6);})['then'](function(_0x4449a0){_0x285c6[_0xb4b0('0x47')]=_0x4449a0;return _0x285c6;})[_0xb4b0('0x25')](respondWithFilteredResult(_0x159ace,_0x504cc6))[_0xb4b0('0x48')](handleError(_0x159ace,null));};exports[_0xb4b0('0x49')]=function(_0x283645,_0x12721e){var _0x6b6b35={'raw':![],'where':{'id':_0x283645[_0xb4b0('0x4a')]['id']}},_0x1e89aa={};_0x1e89aa[_0xb4b0('0x32')]=_[_0xb4b0('0x34')](db[_0xb4b0('0x2e')][_0xb4b0('0x2f')]);_0x1e89aa[_0xb4b0('0x33')]=_[_0xb4b0('0x34')](_0x283645['query']);_0x1e89aa['filters']=_['intersection'](_0x1e89aa[_0xb4b0('0x32')],_0x1e89aa[_0xb4b0('0x33')]);_0x6b6b35[_0xb4b0('0x36')]=_['intersection'](_0x1e89aa[_0xb4b0('0x32')],qs[_0xb4b0('0x37')](_0x283645[_0xb4b0('0x33')][_0xb4b0('0x37')]));_0x6b6b35[_0xb4b0('0x36')]=_0x6b6b35[_0xb4b0('0x36')][_0xb4b0('0x38')]?_0x6b6b35[_0xb4b0('0x36')]:_0x1e89aa['model'];if(_0x283645[_0xb4b0('0x33')][_0xb4b0('0x44')]){_0x6b6b35['include']=[{'all':!![]}];}_0x6b6b35=_[_0xb4b0('0x40')]({},_0x6b6b35,_0x283645[_0xb4b0('0x43')]);return db[_0xb4b0('0x2e')][_0xb4b0('0x4b')](_0x6b6b35)['then'](handleEntityNotFound(_0x12721e,null))['then'](respondWithResult(_0x12721e,null))[_0xb4b0('0x48')](handleError(_0x12721e,null));};exports[_0xb4b0('0x4c')]=function(_0x414728,_0x2f3668){return db[_0xb4b0('0x2e')]['create'](_0x414728[_0xb4b0('0x4d')],{})[_0xb4b0('0x25')](respondWithResult(_0x2f3668,0xc9))[_0xb4b0('0x48')](handleError(_0x2f3668,null));};exports[_0xb4b0('0x4e')]=function(_0x35f7fc,_0x418653){if(_0x35f7fc[_0xb4b0('0x4d')]['id']){delete _0x35f7fc[_0xb4b0('0x4d')]['id'];}return db[_0xb4b0('0x2e')][_0xb4b0('0x4b')]({'where':{'id':_0x35f7fc['params']['id']}})[_0xb4b0('0x25')](handleEntityNotFound(_0x418653,null))['then'](saveUpdates(_0x35f7fc[_0xb4b0('0x4d')],null))[_0xb4b0('0x25')](respondWithResult(_0x418653,null))[_0xb4b0('0x48')](handleError(_0x418653,null));};exports['destroy']=function(_0x14ff5f,_0x5170d2){return db[_0xb4b0('0x2e')]['find']({'where':{'id':_0x14ff5f[_0xb4b0('0x4a')]['id']}})[_0xb4b0('0x25')](handleEntityNotFound(_0x5170d2,null))[_0xb4b0('0x25')](removeEntity(_0x5170d2,null))['catch'](handleError(_0x5170d2,null));};exports[_0xb4b0('0x4f')]=function(_0xf2121,_0x2c7b6e,_0x1f4f00){var _0x4ae06a={};var _0x2d4fb0={};var _0xe85dc9;var _0x545caf;return db[_0xb4b0('0x2e')][_0xb4b0('0x50')]({'where':{'id':_0xf2121[_0xb4b0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2c7b6e,null))[_0xb4b0('0x25')](function(_0x9329ac){if(_0x9329ac){_0xe85dc9=_0x9329ac;_0x2d4fb0['model']=_[_0xb4b0('0x34')](db[_0xb4b0('0x51')]['rawAttributes']);_0x2d4fb0[_0xb4b0('0x33')]=_[_0xb4b0('0x34')](_0xf2121[_0xb4b0('0x33')]);_0x2d4fb0['filters']=_[_0xb4b0('0x52')](_0x2d4fb0['model'],_0x2d4fb0[_0xb4b0('0x33')]);_0x4ae06a[_0xb4b0('0x36')]=_[_0xb4b0('0x52')](_0x2d4fb0[_0xb4b0('0x32')],qs[_0xb4b0('0x37')](_0xf2121[_0xb4b0('0x33')][_0xb4b0('0x37')]));_0x4ae06a[_0xb4b0('0x36')]=_0x4ae06a[_0xb4b0('0x36')][_0xb4b0('0x38')]?_0x4ae06a[_0xb4b0('0x36')]:_0x2d4fb0[_0xb4b0('0x32')];_0x4ae06a[_0xb4b0('0x3b')]=qs['sort'](_0xf2121[_0xb4b0('0x33')]['sort']);_0x4ae06a[_0xb4b0('0x3d')]=qs['filters'](_[_0xb4b0('0x3e')](_0xf2121['query'],_0x2d4fb0[_0xb4b0('0x35')]));if(_0xf2121[_0xb4b0('0x33')][_0xb4b0('0x3f')]){_0x4ae06a[_0xb4b0('0x3d')]=_['merge'](_0x4ae06a[_0xb4b0('0x3d')],{'$or':_['map'](_0x4ae06a[_0xb4b0('0x36')],function(_0x4588e3){var _0x202dc0={};_0x202dc0[_0x4588e3]={'$like':'%'+_0xf2121[_0xb4b0('0x33')][_0xb4b0('0x3f')]+'%'};return _0x202dc0;})});}_0x4ae06a=_[_0xb4b0('0x40')]({},_0x4ae06a,_0xf2121['options']);return _0xe85dc9['getSubjects'](_0x4ae06a);}})[_0xb4b0('0x25')](function(_0x4e4a8e){if(_0x4e4a8e){_0x545caf=_0x4e4a8e[_0xb4b0('0x38')];if(!_0xf2121['query'][_0xb4b0('0x39')](_0xb4b0('0x3a'))){_0x4ae06a[_0xb4b0('0x1e')]=qs['limit'](_0xf2121[_0xb4b0('0x33')][_0xb4b0('0x1e')]);_0x4ae06a['offset']=qs['offset'](_0xf2121['query']['offset']);}return _0xe85dc9[_0xb4b0('0x4f')](_0x4ae06a);}})['then'](function(_0x32fd30){if(_0x32fd30){return _0x32fd30?{'count':_0x545caf,'rows':_0x32fd30}:null;}})[_0xb4b0('0x25')](respondWithResult(_0x2c7b6e,null))[_0xb4b0('0x48')](handleError(_0x2c7b6e,null));};exports[_0xb4b0('0x53')]=function(_0xe41749,_0xae9822,_0x5286b4){var _0x4b2127={};var _0x3aa9fb={};var _0x21a1b5;var _0xe47632;return db[_0xb4b0('0x2e')][_0xb4b0('0x50')]({'where':{'id':_0xe41749[_0xb4b0('0x4a')]['id']}})[_0xb4b0('0x25')](handleEntityNotFound(_0xae9822,null))['then'](function(_0x3c38b7){if(_0x3c38b7){_0x21a1b5=_0x3c38b7;_0x3aa9fb['model']=_[_0xb4b0('0x34')](db[_0xb4b0('0x51')][_0xb4b0('0x2f')]);_0x3aa9fb[_0xb4b0('0x33')]=_[_0xb4b0('0x34')](_0xe41749[_0xb4b0('0x33')]);_0x3aa9fb[_0xb4b0('0x35')]=_[_0xb4b0('0x52')](_0x3aa9fb[_0xb4b0('0x32')],_0x3aa9fb['query']);_0x4b2127[_0xb4b0('0x36')]=_[_0xb4b0('0x52')](_0x3aa9fb[_0xb4b0('0x32')],qs[_0xb4b0('0x37')](_0xe41749[_0xb4b0('0x33')][_0xb4b0('0x37')]));_0x4b2127['attributes']=_0x4b2127[_0xb4b0('0x36')][_0xb4b0('0x38')]?_0x4b2127[_0xb4b0('0x36')]:_0x3aa9fb[_0xb4b0('0x32')];_0x4b2127[_0xb4b0('0x3b')]=qs[_0xb4b0('0x3c')](_0xe41749[_0xb4b0('0x33')][_0xb4b0('0x3c')]);_0x4b2127['where']=qs[_0xb4b0('0x35')](_[_0xb4b0('0x3e')](_0xe41749['query'],_0x3aa9fb['filters']));if(_0xe41749[_0xb4b0('0x33')][_0xb4b0('0x3f')]){_0x4b2127[_0xb4b0('0x3d')]=_[_0xb4b0('0x40')](_0x4b2127['where'],{'$or':_[_0xb4b0('0x2d')](_0x4b2127[_0xb4b0('0x36')],function(_0x3adc78){var _0x25c5ae={};_0x25c5ae[_0x3adc78]={'$like':'%'+_0xe41749['query'][_0xb4b0('0x3f')]+'%'};return _0x25c5ae;})});}_0x4b2127=_[_0xb4b0('0x40')]({},_0x4b2127,_0xe41749[_0xb4b0('0x43')]);return _0x21a1b5[_0xb4b0('0x53')](_0x4b2127);}})[_0xb4b0('0x25')](function(_0x18ccf1){if(_0x18ccf1){_0xe47632=_0x18ccf1[_0xb4b0('0x38')];if(!_0xe41749[_0xb4b0('0x33')][_0xb4b0('0x39')](_0xb4b0('0x3a'))){_0x4b2127['limit']=qs[_0xb4b0('0x1e')](_0xe41749[_0xb4b0('0x33')][_0xb4b0('0x1e')]);_0x4b2127['offset']=qs[_0xb4b0('0x1d')](_0xe41749[_0xb4b0('0x33')][_0xb4b0('0x1d')]);}return _0x21a1b5[_0xb4b0('0x53')](_0x4b2127);}})[_0xb4b0('0x25')](function(_0x22e19d){if(_0x22e19d){return _0x22e19d?{'count':_0xe47632,'rows':_0x22e19d}:null;}})[_0xb4b0('0x25')](respondWithResult(_0xae9822,null))['catch'](handleError(_0xae9822,null));};exports[_0xb4b0('0x54')]=function(_0x70da69,_0x9ab205,_0x3fab61){var _0x1ca8b5={};var _0x153bd6={};var _0x1078fd;var _0x2b437b;return db[_0xb4b0('0x2e')][_0xb4b0('0x50')]({'where':{'id':_0x70da69[_0xb4b0('0x4a')]['id']}})[_0xb4b0('0x25')](handleEntityNotFound(_0x9ab205,null))['then'](function(_0xd2f40d){if(_0xd2f40d){_0x1078fd=_0xd2f40d;_0x153bd6[_0xb4b0('0x32')]=_[_0xb4b0('0x34')](db['FreshsalesField'][_0xb4b0('0x2f')]);_0x153bd6[_0xb4b0('0x33')]=_[_0xb4b0('0x34')](_0x70da69[_0xb4b0('0x33')]);_0x153bd6[_0xb4b0('0x35')]=_[_0xb4b0('0x52')](_0x153bd6[_0xb4b0('0x32')],_0x153bd6[_0xb4b0('0x33')]);_0x1ca8b5['attributes']=_[_0xb4b0('0x52')](_0x153bd6[_0xb4b0('0x32')],qs[_0xb4b0('0x37')](_0x70da69[_0xb4b0('0x33')][_0xb4b0('0x37')]));_0x1ca8b5[_0xb4b0('0x36')]=_0x1ca8b5[_0xb4b0('0x36')]['length']?_0x1ca8b5['attributes']:_0x153bd6[_0xb4b0('0x32')];_0x1ca8b5[_0xb4b0('0x3b')]=qs['sort'](_0x70da69['query'][_0xb4b0('0x3c')]);_0x1ca8b5['where']=qs[_0xb4b0('0x35')](_['pick'](_0x70da69[_0xb4b0('0x33')],_0x153bd6[_0xb4b0('0x35')]));if(_0x70da69[_0xb4b0('0x33')][_0xb4b0('0x3f')]){_0x1ca8b5[_0xb4b0('0x3d')]=_[_0xb4b0('0x40')](_0x1ca8b5[_0xb4b0('0x3d')],{'$or':_[_0xb4b0('0x2d')](_0x1ca8b5[_0xb4b0('0x36')],function(_0x1904d1){var _0x1fe711={};_0x1fe711[_0x1904d1]={'$like':'%'+_0x70da69['query'][_0xb4b0('0x3f')]+'%'};return _0x1fe711;})});}_0x1ca8b5=_[_0xb4b0('0x40')]({},_0x1ca8b5,_0x70da69[_0xb4b0('0x43')]);return _0x1078fd[_0xb4b0('0x54')](_0x1ca8b5);}})['then'](function(_0x16e888){if(_0x16e888){_0x2b437b=_0x16e888['length'];if(!_0x70da69[_0xb4b0('0x33')][_0xb4b0('0x39')](_0xb4b0('0x3a'))){_0x1ca8b5[_0xb4b0('0x1e')]=qs[_0xb4b0('0x1e')](_0x70da69['query'][_0xb4b0('0x1e')]);_0x1ca8b5[_0xb4b0('0x1d')]=qs[_0xb4b0('0x1d')](_0x70da69[_0xb4b0('0x33')][_0xb4b0('0x1d')]);}return _0x1078fd[_0xb4b0('0x54')](_0x1ca8b5);}})[_0xb4b0('0x25')](function(_0x5a94b8){if(_0x5a94b8){return _0x5a94b8?{'count':_0x2b437b,'rows':_0x5a94b8}:null;}})[_0xb4b0('0x25')](respondWithResult(_0x9ab205,null))[_0xb4b0('0x48')](handleError(_0x9ab205,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 0ab0617..5482c4d 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 _0x1650=['../../config/logger','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x196185,_0x1a6813){var _0x3a0eb1=function(_0x545dc2){while(--_0x545dc2){_0x196185['push'](_0x196185['shift']());}};_0x3a0eb1(++_0x1a6813);}(_0x1650,0x1d5));var _0x0165=function(_0x1feb65,_0x59d59b){_0x1feb65=_0x1feb65-0x0;var _0xb2dbb3=_0x1650[_0x1feb65];return _0xb2dbb3;};'use strict';var _=require(_0x0165('0x0'));var util=require('util');var logger=require(_0x0165('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0165('0x2'));var rp=require(_0x0165('0x3'));var fs=require('fs');var path=require(_0x0165('0x4'));var rimraf=require('rimraf');var config=require(_0x0165('0x5'));var attributes=require(_0x0165('0x6'));module[_0x0165('0x7')]=function(_0x1698f4,_0x302b98){return _0x1698f4['define'](_0x0165('0x8'),attributes,{'tableName':_0x0165('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e58=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util'];(function(_0x11c8fa,_0x5dcdb9){var _0x4fb5e9=function(_0x238866){while(--_0x238866){_0x11c8fa['push'](_0x11c8fa['shift']());}};_0x4fb5e9(++_0x5dcdb9);}(_0x7e58,0x185));var _0x87e5=function(_0x67b5de,_0x27e305){_0x67b5de=_0x67b5de-0x0;var _0x291374=_0x7e58[_0x67b5de];return _0x291374;};'use strict';var _=require('lodash');var util=require(_0x87e5('0x0'));var logger=require(_0x87e5('0x1'))(_0x87e5('0x2'));var moment=require(_0x87e5('0x3'));var BPromise=require(_0x87e5('0x4'));var rp=require(_0x87e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87e5('0x6'));var config=require(_0x87e5('0x7'));var attributes=require(_0x87e5('0x8'));module[_0x87e5('0x9')]=function(_0x45bb78,_0xb5f407){return _0x45bb78[_0x87e5('0xa')](_0x87e5('0xb'),attributes,{'tableName':_0x87e5('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 7e0d0a6..c436f4d 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 _0xac29=['info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x55ac8b,_0x5a474d){var _0x47c2b5=function(_0x2f9e92){while(--_0x2f9e92){_0x55ac8b['push'](_0x55ac8b['shift']());}};_0x47c2b5(++_0x5a474d);}(_0xac29,0xfb));var _0x9ac2=function(_0x4921fb,_0x1449e6){_0x4921fb=_0x4921fb-0x0;var _0x1c7bc7=_0xac29[_0x4921fb];return _0x1c7bc7;};'use strict';var _=require(_0x9ac2('0x0'));var util=require(_0x9ac2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9ac2('0x2'));var fs=require('fs');var Redis=require(_0x9ac2('0x3'));var db=require(_0x9ac2('0x4'))['db'];var utils=require(_0x9ac2('0x5'));var logger=require('../../config/logger')(_0x9ac2('0x6'));var config=require(_0x9ac2('0x7'));var jayson=require(_0x9ac2('0x8'));var client=jayson[_0x9ac2('0x9')][_0x9ac2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328dd3,_0x11f996,_0x39dfd8){return new BPromise(function(_0x3e961b,_0x1570ff){return client[_0x9ac2('0xb')](_0x328dd3,_0x39dfd8)[_0x9ac2('0xc')](function(_0x2fa783){logger[_0x9ac2('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x11f996,_0x9ac2('0xe'));logger[_0x9ac2('0xf')](_0x9ac2('0x10'),_0x11f996,_0x9ac2('0xe'),JSON[_0x9ac2('0x11')](_0x2fa783));if(_0x2fa783[_0x9ac2('0x12')]){if(_0x2fa783[_0x9ac2('0x12')][_0x9ac2('0x13')]===0x1f4){logger[_0x9ac2('0x12')](_0x9ac2('0x14'),_0x11f996,_0x2fa783[_0x9ac2('0x12')]['message']);return _0x1570ff(_0x2fa783[_0x9ac2('0x12')]['message']);}logger[_0x9ac2('0x12')](_0x9ac2('0x14'),_0x11f996,_0x2fa783[_0x9ac2('0x12')][_0x9ac2('0x15')]);return _0x3e961b(_0x2fa783[_0x9ac2('0x12')]['message']);}else{logger[_0x9ac2('0xd')](_0x9ac2('0x14'),_0x11f996,'request\x20sent');_0x3e961b(_0x2fa783[_0x9ac2('0x16')]['message']);}})[_0x9ac2('0x17')](function(_0x2fc57c){logger['error'](_0x9ac2('0x14'),_0x11f996,_0x2fc57c);_0x1570ff(_0x2fc57c);});});} \ No newline at end of file +var _0x54d3=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x43171f,_0x43b445){var _0x1dcd07=function(_0x71e817){while(--_0x71e817){_0x43171f['push'](_0x43171f['shift']());}};_0x1dcd07(++_0x43b445);}(_0x54d3,0x18f));var _0x354d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x54d3[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x354d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x354d('0x1'));var rs=require(_0x354d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x354d('0x3'))['db'];var utils=require(_0x354d('0x4'));var logger=require(_0x354d('0x5'))(_0x354d('0x6'));var config=require(_0x354d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x354d('0x8')][_0x354d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcd6c5f,_0x1a1fb2,_0xcccd7e){return new BPromise(function(_0x2adae1,_0x4379bd){return client[_0x354d('0xa')](_0xcd6c5f,_0xcccd7e)[_0x354d('0xb')](function(_0x4771a6){logger[_0x354d('0xc')](_0x354d('0xd'),_0x1a1fb2,_0x354d('0xe'));logger['debug'](_0x354d('0xf'),_0x1a1fb2,_0x354d('0xe'),JSON[_0x354d('0x10')](_0x4771a6));if(_0x4771a6['error']){if(_0x4771a6[_0x354d('0x11')][_0x354d('0x12')]===0x1f4){logger[_0x354d('0x11')](_0x354d('0xd'),_0x1a1fb2,_0x4771a6[_0x354d('0x11')][_0x354d('0x13')]);return _0x4379bd(_0x4771a6[_0x354d('0x11')][_0x354d('0x13')]);}logger[_0x354d('0x11')](_0x354d('0xd'),_0x1a1fb2,_0x4771a6[_0x354d('0x11')][_0x354d('0x13')]);return _0x2adae1(_0x4771a6['error'][_0x354d('0x13')]);}else{logger[_0x354d('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a1fb2,_0x354d('0xe'));_0x2adae1(_0x4771a6['result']['message']);}})[_0x354d('0x14')](function(_0x3a22cf){logger[_0x354d('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a1fb2,_0x3a22cf);_0x4379bd(_0x3a22cf);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a90b9b7..4601f66 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 _0xb205=['./intFreshsalesField.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x1c5b34,_0x4c97dc){var _0x3510fd=function(_0x3bc604){while(--_0x3bc604){_0x1c5b34['push'](_0x1c5b34['shift']());}};_0x3510fd(++_0x4c97dc);}(_0xb205,0xf0));var _0x5b20=function(_0x57f36d,_0x3f73cc){_0x57f36d=_0x57f36d-0x0;var _0xf88440=_0xb205[_0x57f36d];return _0xf88440;};'use strict';var multer=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var path=require(_0x5b20('0x2'));var timeout=require(_0x5b20('0x3'));var express=require(_0x5b20('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5b20('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b20('0x6'));var controller=require(_0x5b20('0x7'));router['get']('/',auth[_0x5b20('0x8')](),controller[_0x5b20('0x9')]);router[_0x5b20('0xa')]('/:id',auth[_0x5b20('0x8')](),controller[_0x5b20('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b20('0xc')]);router[_0x5b20('0xd')](_0x5b20('0xe'),auth[_0x5b20('0x8')](),controller[_0x5b20('0xf')]);router[_0x5b20('0x10')](_0x5b20('0xe'),auth['isAuthenticated'](),controller[_0x5b20('0x11')]);module[_0x5b20('0x12')]=router; \ No newline at end of file +var _0x851e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer','util','path','Router','fs-extra'];(function(_0x421f33,_0x5d60cf){var _0x4492f7=function(_0x1a9f3a){while(--_0x1a9f3a){_0x421f33['push'](_0x421f33['shift']());}};_0x4492f7(++_0x5d60cf);}(_0x851e,0x1e8));var _0xe851=function(_0x12baed,_0x45a719){_0x12baed=_0x12baed-0x0;var _0x630772=_0x851e[_0x12baed];return _0x630772;};'use strict';var multer=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var path=require(_0xe851('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe851('0x3')]();var fs_extra=require(_0xe851('0x4'));var auth=require(_0xe851('0x5'));var interaction=require(_0xe851('0x6'));var config=require(_0xe851('0x7'));var controller=require('./intFreshsalesField.controller');router[_0xe851('0x8')]('/',auth[_0xe851('0x9')](),controller[_0xe851('0xa')]);router[_0xe851('0x8')](_0xe851('0xb'),auth['isAuthenticated'](),controller[_0xe851('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe851('0xd')]);router[_0xe851('0xe')](_0xe851('0xb'),auth[_0xe851('0x9')](),controller['update']);router[_0xe851('0xf')](_0xe851('0xb'),auth[_0xe851('0x9')](),controller['destroy']);module[_0xe851('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 eb7868a..52e627a 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 _0xbb96=['string','customVariable','keyValue','picklist','STRING','variable','sequelize','exports','ENUM'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbb96,0xf9));var _0x6bb9=function(_0x5c0dcb,_0x16cd83){_0x5c0dcb=_0x5c0dcb-0x0;var _0x183a0e=_0xbb96[_0x5c0dcb];return _0x183a0e;};'use strict';var Sequelize=require(_0x6bb9('0x0'));module[_0x6bb9('0x1')]={'type':{'type':Sequelize[_0x6bb9('0x2')](_0x6bb9('0x3'),'variable',_0x6bb9('0x4'),_0x6bb9('0x5'),_0x6bb9('0x6')),'defaultValue':_0x6bb9('0x3')},'content':{'type':Sequelize[_0x6bb9('0x7')]},'key':{'type':Sequelize[_0x6bb9('0x7')]},'keyType':{'type':Sequelize[_0x6bb9('0x2')](_0x6bb9('0x3'),_0x6bb9('0x8'),_0x6bb9('0x4'))},'keyContent':{'type':Sequelize[_0x6bb9('0x7')]},'idField':{'type':Sequelize[_0x6bb9('0x7')]},'nameField':{'type':Sequelize[_0x6bb9('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6bb9('0x7')]}}; \ No newline at end of file +var _0xe52b=['variable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xe52b,0x69));var _0xbe52=function(_0x5f02ba,_0x5c4427){_0x5f02ba=_0x5f02ba-0x0;var _0x45b6d9=_0xe52b[_0x5f02ba];return _0x45b6d9;};'use strict';var Sequelize=require(_0xbe52('0x0'));module[_0xbe52('0x1')]={'type':{'type':Sequelize[_0xbe52('0x2')]('string',_0xbe52('0x3'),'customVariable',_0xbe52('0x4'),_0xbe52('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbe52('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbe52('0x2')](_0xbe52('0x7'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbe52('0x6')]},'nameField':{'type':Sequelize[_0xbe52('0x6')]},'customField':{'type':Sequelize[_0xbe52('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 38f115c..b72229a 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 _0x5b28=['rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','keys','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','json','apply','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesField'];(function(_0x3a3673,_0x1892c1){var _0x5e4a72=function(_0x2025c7){while(--_0x2025c7){_0x3a3673['push'](_0x3a3673['shift']());}};_0x5e4a72(++_0x1892c1);}(_0x5b28,0xaa));var _0x85b2=function(_0x254bbf,_0xe039e2){_0x254bbf=_0x254bbf-0x0;var _0x5ef9b6=_0x5b28[_0x254bbf];return _0x5ef9b6;};'use strict';var emlformat=require(_0x85b2('0x0'));var rimraf=require(_0x85b2('0x1'));var zipdir=require(_0x85b2('0x2'));var jsonpatch=require(_0x85b2('0x3'));var rp=require(_0x85b2('0x4'));var moment=require(_0x85b2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85b2('0x6'));var path=require(_0x85b2('0x7'));var sox=require('sox');var csv=require(_0x85b2('0x8'));var ejs=require(_0x85b2('0x9'));var fs=require('fs');var fs_extra=require(_0x85b2('0xa'));var _=require(_0x85b2('0xb'));var squel=require(_0x85b2('0xc'));var crypto=require(_0x85b2('0xd'));var jsforce=require(_0x85b2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85b2('0x8'));var querystring=require(_0x85b2('0xf'));var Papa=require(_0x85b2('0x10'));var Redis=require(_0x85b2('0x11'));var authService=require(_0x85b2('0x12'));var qs=require(_0x85b2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85b2('0x14'));var logger=require(_0x85b2('0x15'))(_0x85b2('0x16'));var utils=require('../../config/utils');var config=require(_0x85b2('0x17'));var licenseUtil=require(_0x85b2('0x18'));var db=require(_0x85b2('0x19'))['db'];function respondWithStatusCode(_0xe12fae,_0x3fd8a9){_0x3fd8a9=_0x3fd8a9||0xcc;return function(_0xefc55d){if(_0xefc55d){return _0xe12fae['sendStatus'](_0x3fd8a9);}return _0xe12fae[_0x85b2('0x1a')](_0x3fd8a9)['end']();};}function respondWithResult(_0x1ad56e,_0xb6bee6){_0xb6bee6=_0xb6bee6||0xc8;return function(_0xcd728c){if(_0xcd728c){return _0x1ad56e['status'](_0xb6bee6)['json'](_0xcd728c);}};}function respondWithFilteredResult(_0xf4e59f,_0x1d4b6d){return function(_0x22dd06){if(_0x22dd06){var _0x459a6e=typeof _0x1d4b6d[_0x85b2('0x1b')]===_0x85b2('0x1c')&&typeof _0x1d4b6d[_0x85b2('0x1d')]==='undefined';var _0x527dbc=_0x22dd06[_0x85b2('0x1e')];var _0x25d76c=_0x459a6e?0x0:_0x1d4b6d[_0x85b2('0x1b')];var _0x443278=_0x459a6e?_0x22dd06['count']:_0x1d4b6d[_0x85b2('0x1b')]+_0x1d4b6d[_0x85b2('0x1d')];var _0x49c5b2;if(_0x443278>=_0x527dbc){_0x443278=_0x527dbc;_0x49c5b2=0xc8;}else{_0x49c5b2=0xce;}_0xf4e59f[_0x85b2('0x1a')](_0x49c5b2);return _0xf4e59f[_0x85b2('0x1f')]('Content-Range',_0x25d76c+'-'+_0x443278+'/'+_0x527dbc)[_0x85b2('0x20')](_0x22dd06);}return null;};}function patchUpdates(_0x14d4ea){return function(_0x1b5633){try{jsonpatch[_0x85b2('0x21')](_0x1b5633,_0x14d4ea,!![]);}catch(_0x2ecee2){return BPromise['reject'](_0x2ecee2);}return _0x1b5633['save']();};}function saveUpdates(_0x612dfe,_0x18aa1e){return function(_0x4f13f6){if(_0x4f13f6){return _0x4f13f6['update'](_0x612dfe)[_0x85b2('0x22')](function(_0x6ae805){return _0x6ae805;});}return null;};}function removeEntity(_0x1db9da,_0x5edf30){return function(_0x37ee36){if(_0x37ee36){return _0x37ee36[_0x85b2('0x23')]()[_0x85b2('0x22')](function(){_0x1db9da[_0x85b2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fcc85,_0xf302){return function(_0x225871){if(!_0x225871){_0x3fcc85[_0x85b2('0x24')](0x194);}return _0x225871;};}function handleError(_0x5e25d4,_0x304f6b){_0x304f6b=_0x304f6b||0x1f4;return function(_0x28340b){logger[_0x85b2('0x25')](_0x28340b[_0x85b2('0x26')]);if(_0x28340b[_0x85b2('0x27')]){delete _0x28340b[_0x85b2('0x27')];}_0x5e25d4['status'](_0x304f6b)['send'](_0x28340b);};}exports[_0x85b2('0x28')]=function(_0xaa3da1,_0x5be5d1){var _0x2a2e61={},_0x220a54={},_0x16690d={'count':0x0,'rows':[]};var _0x537ab2=_[_0x85b2('0x29')](db[_0x85b2('0x2a')][_0x85b2('0x2b')],function(_0x120463){return{'name':_0x120463['fieldName'],'type':_0x120463[_0x85b2('0x2c')][_0x85b2('0x2d')]};});_0x220a54[_0x85b2('0x2e')]=_[_0x85b2('0x29')](_0x537ab2,_0x85b2('0x27'));_0x220a54['query']=_['keys'](_0xaa3da1[_0x85b2('0x2f')]);_0x220a54[_0x85b2('0x30')]=_[_0x85b2('0x31')](_0x220a54['model'],_0x220a54[_0x85b2('0x2f')]);_0x2a2e61[_0x85b2('0x32')]=_[_0x85b2('0x31')](_0x220a54[_0x85b2('0x2e')],qs[_0x85b2('0x33')](_0xaa3da1[_0x85b2('0x2f')][_0x85b2('0x33')]));_0x2a2e61[_0x85b2('0x32')]=_0x2a2e61['attributes'][_0x85b2('0x34')]?_0x2a2e61['attributes']:_0x220a54[_0x85b2('0x2e')];if(!_0xaa3da1[_0x85b2('0x2f')]['hasOwnProperty'](_0x85b2('0x35'))){_0x2a2e61[_0x85b2('0x1d')]=qs[_0x85b2('0x1d')](_0xaa3da1[_0x85b2('0x2f')][_0x85b2('0x1d')]);_0x2a2e61['offset']=qs[_0x85b2('0x1b')](_0xaa3da1['query'][_0x85b2('0x1b')]);}_0x2a2e61['order']=qs[_0x85b2('0x36')](_0xaa3da1[_0x85b2('0x2f')][_0x85b2('0x36')]);_0x2a2e61[_0x85b2('0x37')]=qs[_0x85b2('0x30')](_[_0x85b2('0x38')](_0xaa3da1[_0x85b2('0x2f')],_0x220a54[_0x85b2('0x30')]),_0x537ab2);if(_0xaa3da1[_0x85b2('0x2f')][_0x85b2('0x39')]){_0x2a2e61[_0x85b2('0x37')]=_['merge'](_0x2a2e61['where'],{'$or':_[_0x85b2('0x29')](_0x537ab2,function(_0x4f5ef5){if(_0x4f5ef5[_0x85b2('0x2c')]!==_0x85b2('0x3a')){var _0x333dfb={};_0x333dfb[_0x4f5ef5['name']]={'$like':'%'+_0xaa3da1[_0x85b2('0x2f')][_0x85b2('0x39')]+'%'};return _0x333dfb;}})});}_0x2a2e61=_[_0x85b2('0x3b')]({},_0x2a2e61,_0xaa3da1[_0x85b2('0x3c')]);var _0x287652={'where':_0x2a2e61[_0x85b2('0x37')]};return db[_0x85b2('0x2a')][_0x85b2('0x1e')](_0x287652)[_0x85b2('0x22')](function(_0x1bcb4c){_0x16690d[_0x85b2('0x1e')]=_0x1bcb4c;if(_0xaa3da1[_0x85b2('0x2f')][_0x85b2('0x3d')]){_0x2a2e61['include']=[{'all':!![]}];}return db[_0x85b2('0x2a')][_0x85b2('0x3e')](_0x2a2e61);})[_0x85b2('0x22')](function(_0xa6b0f5){_0x16690d['rows']=_0xa6b0f5;return _0x16690d;})['then'](respondWithFilteredResult(_0x5be5d1,_0x2a2e61))['catch'](handleError(_0x5be5d1,null));};exports[_0x85b2('0x3f')]=function(_0x5cfa44,_0x56c6d1){var _0x199709={'raw':!![],'where':{'id':_0x5cfa44[_0x85b2('0x40')]['id']}},_0x50de65={};_0x50de65[_0x85b2('0x2e')]=_[_0x85b2('0x41')](db['FreshsalesField'][_0x85b2('0x2b')]);_0x50de65[_0x85b2('0x2f')]=_[_0x85b2('0x41')](_0x5cfa44[_0x85b2('0x2f')]);_0x50de65[_0x85b2('0x30')]=_[_0x85b2('0x31')](_0x50de65['model'],_0x50de65['query']);_0x199709[_0x85b2('0x32')]=_[_0x85b2('0x31')](_0x50de65[_0x85b2('0x2e')],qs[_0x85b2('0x33')](_0x5cfa44[_0x85b2('0x2f')]['fields']));_0x199709[_0x85b2('0x32')]=_0x199709[_0x85b2('0x32')][_0x85b2('0x34')]?_0x199709[_0x85b2('0x32')]:_0x50de65[_0x85b2('0x2e')];if(_0x5cfa44[_0x85b2('0x2f')][_0x85b2('0x3d')]){_0x199709['include']=[{'all':!![]}];}_0x199709=_[_0x85b2('0x3b')]({},_0x199709,_0x5cfa44[_0x85b2('0x3c')]);return db[_0x85b2('0x2a')][_0x85b2('0x42')](_0x199709)[_0x85b2('0x22')](handleEntityNotFound(_0x56c6d1,null))[_0x85b2('0x22')](respondWithResult(_0x56c6d1,null))[_0x85b2('0x43')](handleError(_0x56c6d1,null));};exports[_0x85b2('0x44')]=function(_0x383168,_0x2658c1){return db['FreshsalesField'][_0x85b2('0x44')](_0x383168[_0x85b2('0x45')],{})[_0x85b2('0x22')](respondWithResult(_0x2658c1,0xc9))['catch'](handleError(_0x2658c1,null));};exports[_0x85b2('0x46')]=function(_0x27b0d5,_0x26e4e6){if(_0x27b0d5[_0x85b2('0x45')]['id']){delete _0x27b0d5[_0x85b2('0x45')]['id'];}return db[_0x85b2('0x2a')][_0x85b2('0x42')]({'where':{'id':_0x27b0d5[_0x85b2('0x40')]['id']}})[_0x85b2('0x22')](handleEntityNotFound(_0x26e4e6,null))['then'](saveUpdates(_0x27b0d5[_0x85b2('0x45')],null))['then'](respondWithResult(_0x26e4e6,null))[_0x85b2('0x43')](handleError(_0x26e4e6,null));};exports[_0x85b2('0x23')]=function(_0x100c2a,_0x4816be){return db[_0x85b2('0x2a')][_0x85b2('0x42')]({'where':{'id':_0x100c2a['params']['id']}})[_0x85b2('0x22')](handleEntityNotFound(_0x4816be,null))[_0x85b2('0x22')](removeEntity(_0x4816be,null))[_0x85b2('0x43')](handleError(_0x4816be,null));}; \ No newline at end of file +var _0x69fe=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','error','stack','name','send','index','FreshsalesField','rawAttributes','type','key'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x69fe,0x18d));var _0xe69f=function(_0x5e98d5,_0x33d05b){_0x5e98d5=_0x5e98d5-0x0;var _0x43d3d5=_0x69fe[_0x5e98d5];return _0x43d3d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe69f('0x0'));var jsonpatch=require(_0xe69f('0x1'));var rp=require('request-promise');var moment=require(_0xe69f('0x2'));var BPromise=require(_0xe69f('0x3'));var Mustache=require(_0xe69f('0x4'));var util=require('util');var path=require(_0xe69f('0x5'));var sox=require(_0xe69f('0x6'));var csv=require(_0xe69f('0x7'));var ejs=require(_0xe69f('0x8'));var fs=require('fs');var fs_extra=require(_0xe69f('0x9'));var _=require(_0xe69f('0xa'));var squel=require('squel');var crypto=require(_0xe69f('0xb'));var jsforce=require(_0xe69f('0xc'));var deskjs=require(_0xe69f('0xd'));var toCsv=require(_0xe69f('0x7'));var querystring=require(_0xe69f('0xe'));var Papa=require(_0xe69f('0xf'));var Redis=require(_0xe69f('0x10'));var authService=require(_0xe69f('0x11'));var qs=require(_0xe69f('0x12'));var as=require(_0xe69f('0x13'));var hardwareService=require(_0xe69f('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe69f('0x15'));var licenseUtil=require(_0xe69f('0x16'));var db=require(_0xe69f('0x17'))['db'];function respondWithStatusCode(_0x2f71b0,_0xd1e65a){_0xd1e65a=_0xd1e65a||0xcc;return function(_0x5ca25a){if(_0x5ca25a){return _0x2f71b0[_0xe69f('0x18')](_0xd1e65a);}return _0x2f71b0[_0xe69f('0x19')](_0xd1e65a)['end']();};}function respondWithResult(_0x13efb3,_0xb7dfec){_0xb7dfec=_0xb7dfec||0xc8;return function(_0x4ce645){if(_0x4ce645){return _0x13efb3[_0xe69f('0x19')](_0xb7dfec)[_0xe69f('0x1a')](_0x4ce645);}};}function respondWithFilteredResult(_0x128315,_0x4aab91){return function(_0x25499b){if(_0x25499b){var _0x4d9e59=typeof _0x4aab91[_0xe69f('0x1b')]===_0xe69f('0x1c')&&typeof _0x4aab91[_0xe69f('0x1d')]==='undefined';var _0x3be390=_0x25499b['count'];var _0x43d4a1=_0x4d9e59?0x0:_0x4aab91[_0xe69f('0x1b')];var _0x3a1e89=_0x4d9e59?_0x25499b[_0xe69f('0x1e')]:_0x4aab91[_0xe69f('0x1b')]+_0x4aab91['limit'];var _0x3f5a2f;if(_0x3a1e89>=_0x3be390){_0x3a1e89=_0x3be390;_0x3f5a2f=0xc8;}else{_0x3f5a2f=0xce;}_0x128315[_0xe69f('0x19')](_0x3f5a2f);return _0x128315[_0xe69f('0x1f')]('Content-Range',_0x43d4a1+'-'+_0x3a1e89+'/'+_0x3be390)[_0xe69f('0x1a')](_0x25499b);}return null;};}function patchUpdates(_0x1c3290){return function(_0x34ff95){try{jsonpatch[_0xe69f('0x20')](_0x34ff95,_0x1c3290,!![]);}catch(_0x179bdf){return BPromise['reject'](_0x179bdf);}return _0x34ff95[_0xe69f('0x21')]();};}function saveUpdates(_0x1749d9,_0x21d5ef){return function(_0x1a95ec){if(_0x1a95ec){return _0x1a95ec[_0xe69f('0x22')](_0x1749d9)['then'](function(_0x15cc9f){return _0x15cc9f;});}return null;};}function removeEntity(_0x217146,_0x4315d4){return function(_0x52853d){if(_0x52853d){return _0x52853d[_0xe69f('0x23')]()[_0xe69f('0x24')](function(){_0x217146['status'](0xcc)[_0xe69f('0x25')]();});}};}function handleEntityNotFound(_0x1f0fe3,_0x71fd56){return function(_0x5e71ee){if(!_0x5e71ee){_0x1f0fe3['sendStatus'](0x194);}return _0x5e71ee;};}function handleError(_0xe884ee,_0x911879){_0x911879=_0x911879||0x1f4;return function(_0x27bfe3){logger[_0xe69f('0x26')](_0x27bfe3[_0xe69f('0x27')]);if(_0x27bfe3['name']){delete _0x27bfe3[_0xe69f('0x28')];}_0xe884ee['status'](_0x911879)[_0xe69f('0x29')](_0x27bfe3);};}exports[_0xe69f('0x2a')]=function(_0x3e8d73,_0xd5c90f){var _0x49d695={},_0x57512b={},_0x5bb095={'count':0x0,'rows':[]};var _0x3a9b80=_['map'](db[_0xe69f('0x2b')][_0xe69f('0x2c')],function(_0xa9401e){return{'name':_0xa9401e['fieldName'],'type':_0xa9401e[_0xe69f('0x2d')][_0xe69f('0x2e')]};});_0x57512b[_0xe69f('0x2f')]=_[_0xe69f('0x30')](_0x3a9b80,_0xe69f('0x28'));_0x57512b[_0xe69f('0x31')]=_['keys'](_0x3e8d73[_0xe69f('0x31')]);_0x57512b[_0xe69f('0x32')]=_[_0xe69f('0x33')](_0x57512b['model'],_0x57512b[_0xe69f('0x31')]);_0x49d695[_0xe69f('0x34')]=_[_0xe69f('0x33')](_0x57512b['model'],qs[_0xe69f('0x35')](_0x3e8d73[_0xe69f('0x31')][_0xe69f('0x35')]));_0x49d695[_0xe69f('0x34')]=_0x49d695['attributes'][_0xe69f('0x36')]?_0x49d695['attributes']:_0x57512b[_0xe69f('0x2f')];if(!_0x3e8d73[_0xe69f('0x31')][_0xe69f('0x37')](_0xe69f('0x38'))){_0x49d695[_0xe69f('0x1d')]=qs['limit'](_0x3e8d73[_0xe69f('0x31')][_0xe69f('0x1d')]);_0x49d695[_0xe69f('0x1b')]=qs['offset'](_0x3e8d73[_0xe69f('0x31')][_0xe69f('0x1b')]);}_0x49d695['order']=qs['sort'](_0x3e8d73[_0xe69f('0x31')]['sort']);_0x49d695[_0xe69f('0x39')]=qs[_0xe69f('0x32')](_[_0xe69f('0x3a')](_0x3e8d73[_0xe69f('0x31')],_0x57512b[_0xe69f('0x32')]),_0x3a9b80);if(_0x3e8d73[_0xe69f('0x31')][_0xe69f('0x3b')]){_0x49d695[_0xe69f('0x39')]=_['merge'](_0x49d695[_0xe69f('0x39')],{'$or':_[_0xe69f('0x30')](_0x3a9b80,function(_0x41b4d6){if(_0x41b4d6[_0xe69f('0x2d')]!==_0xe69f('0x3c')){var _0x44d820={};_0x44d820[_0x41b4d6[_0xe69f('0x28')]]={'$like':'%'+_0x3e8d73[_0xe69f('0x31')]['filter']+'%'};return _0x44d820;}})});}_0x49d695=_[_0xe69f('0x3d')]({},_0x49d695,_0x3e8d73[_0xe69f('0x3e')]);var _0x3f9648={'where':_0x49d695[_0xe69f('0x39')]};return db[_0xe69f('0x2b')][_0xe69f('0x1e')](_0x3f9648)[_0xe69f('0x24')](function(_0x1b6cda){_0x5bb095['count']=_0x1b6cda;if(_0x3e8d73[_0xe69f('0x31')][_0xe69f('0x3f')]){_0x49d695[_0xe69f('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0xe69f('0x41')](_0x49d695);})[_0xe69f('0x24')](function(_0x5522dd){_0x5bb095[_0xe69f('0x42')]=_0x5522dd;return _0x5bb095;})[_0xe69f('0x24')](respondWithFilteredResult(_0xd5c90f,_0x49d695))['catch'](handleError(_0xd5c90f,null));};exports[_0xe69f('0x43')]=function(_0x20619,_0x4954d3){var _0x445311={'raw':!![],'where':{'id':_0x20619[_0xe69f('0x44')]['id']}},_0x159bda={};_0x159bda[_0xe69f('0x2f')]=_[_0xe69f('0x45')](db[_0xe69f('0x2b')][_0xe69f('0x2c')]);_0x159bda[_0xe69f('0x31')]=_[_0xe69f('0x45')](_0x20619[_0xe69f('0x31')]);_0x159bda[_0xe69f('0x32')]=_['intersection'](_0x159bda[_0xe69f('0x2f')],_0x159bda[_0xe69f('0x31')]);_0x445311[_0xe69f('0x34')]=_[_0xe69f('0x33')](_0x159bda['model'],qs[_0xe69f('0x35')](_0x20619[_0xe69f('0x31')][_0xe69f('0x35')]));_0x445311[_0xe69f('0x34')]=_0x445311[_0xe69f('0x34')]['length']?_0x445311[_0xe69f('0x34')]:_0x159bda[_0xe69f('0x2f')];if(_0x20619[_0xe69f('0x31')][_0xe69f('0x3f')]){_0x445311[_0xe69f('0x40')]=[{'all':!![]}];}_0x445311=_[_0xe69f('0x3d')]({},_0x445311,_0x20619[_0xe69f('0x3e')]);return db[_0xe69f('0x2b')][_0xe69f('0x46')](_0x445311)[_0xe69f('0x24')](handleEntityNotFound(_0x4954d3,null))[_0xe69f('0x24')](respondWithResult(_0x4954d3,null))[_0xe69f('0x47')](handleError(_0x4954d3,null));};exports[_0xe69f('0x48')]=function(_0x3bbd56,_0x4af072){return db['FreshsalesField'][_0xe69f('0x48')](_0x3bbd56[_0xe69f('0x49')],{})[_0xe69f('0x24')](respondWithResult(_0x4af072,0xc9))[_0xe69f('0x47')](handleError(_0x4af072,null));};exports[_0xe69f('0x22')]=function(_0x2fe611,_0x268aac){if(_0x2fe611[_0xe69f('0x49')]['id']){delete _0x2fe611[_0xe69f('0x49')]['id'];}return db[_0xe69f('0x2b')][_0xe69f('0x46')]({'where':{'id':_0x2fe611[_0xe69f('0x44')]['id']}})['then'](handleEntityNotFound(_0x268aac,null))[_0xe69f('0x24')](saveUpdates(_0x2fe611[_0xe69f('0x49')],null))[_0xe69f('0x24')](respondWithResult(_0x268aac,null))[_0xe69f('0x47')](handleError(_0x268aac,null));};exports[_0xe69f('0x23')]=function(_0xa7258f,_0x5d8aaf){return db['FreshsalesField'][_0xe69f('0x46')]({'where':{'id':_0xa7258f[_0xe69f('0x44')]['id']}})[_0xe69f('0x24')](handleEntityNotFound(_0x5d8aaf,null))[_0xe69f('0x24')](removeEntity(_0x5d8aaf,null))['catch'](handleError(_0x5d8aaf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 29c3818..6450c39 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 _0x8ff9=['./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27de73,_0x3ffd10){var _0x45039b=function(_0x412fe8){while(--_0x412fe8){_0x27de73['push'](_0x27de73['shift']());}};_0x45039b(++_0x3ffd10);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x983018,_0x52c781){_0x983018=_0x983018-0x0;var _0x199268=_0x8ff9[_0x983018];return _0x199268;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var logger=require(_0x98ff('0x2'))(_0x98ff('0x3'));var moment=require(_0x98ff('0x4'));var BPromise=require(_0x98ff('0x5'));var rp=require(_0x98ff('0x6'));var fs=require('fs');var path=require(_0x98ff('0x7'));var rimraf=require(_0x98ff('0x8'));var config=require(_0x98ff('0x9'));var attributes=require(_0x98ff('0xa'));module['exports']=function(_0x3c07f5,_0xcdd5f){return _0x3c07f5[_0x98ff('0xb')](_0x98ff('0xc'),attributes,{'tableName':_0x98ff('0xd'),'paranoid':![],'indexes':[{'name':_0x98ff('0xe'),'fields':['idField',_0x98ff('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b12=['path','../../config/environment','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise'];(function(_0x5132fc,_0x1e676d){var _0x4b6502=function(_0x4f9fb3){while(--_0x4f9fb3){_0x5132fc['push'](_0x5132fc['shift']());}};_0x4b6502(++_0x1e676d);}(_0x5b12,0xa3));var _0x25b1=function(_0x2e5783,_0x416bf8){_0x2e5783=_0x2e5783-0x0;var _0x50b5ce=_0x5b12[_0x2e5783];return _0x50b5ce;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require(_0x25b1('0x2'))('api');var moment=require(_0x25b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b1('0x4'));var fs=require('fs');var path=require(_0x25b1('0x5'));var rimraf=require('rimraf');var config=require(_0x25b1('0x6'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x35d90b,_0x5523c9){return _0x35d90b['define'](_0x25b1('0x7'),attributes,{'tableName':_0x25b1('0x8'),'paranoid':![],'indexes':[{'name':_0x25b1('0x9'),'fields':[_0x25b1('0xa'),_0x25b1('0xb')],'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 f4b04b4..740b411 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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x401a5b,_0x4892c9){var _0x4a655f=function(_0x34cf81){while(--_0x34cf81){_0x401a5b['push'](_0x401a5b['shift']());}};_0x4a655f(++_0x4892c9);}(_0xeff8,0x186));var _0x8eff=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xeff8[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file +var _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x52e48e,_0x2a7032){var _0x20322b=function(_0x236eb4){while(--_0x236eb4){_0x52e48e['push'](_0x52e48e['shift']());}};_0x20322b(++_0x2a7032);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x55e005,_0x27c783){_0x55e005=_0x55e005-0x0;var _0x515a27=_0xc1c6[_0x55e005];return _0x515a27;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 22331c5..4194f88 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(_0x2f7e3e,_0x2bf0ff){var _0x115eec=function(_0x5f0b17){while(--_0x5f0b17){_0x2f7e3e['push'](_0x2f7e3e['shift']());}};_0x115eec(++_0x2bf0ff);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x588d90,_0xb2350a){var _0xc7881d=function(_0x15156b){while(--_0x15156b){_0x588d90['push'](_0x588d90['shift']());}};_0xc7881d(++_0xb2350a);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 378412f..55ee9bd 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 _0xeae6=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x248aec,_0x361ed7){var _0x4648b0=function(_0x2630b9){while(--_0x2630b9){_0x248aec['push'](_0x248aec['shift']());}};_0x4648b0(++_0x361ed7);}(_0xeae6,0xc3));var _0x6eae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeae6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6eae('0x0'));module[_0x6eae('0x1')]={'name':{'type':Sequelize[_0x6eae('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6eae('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6eae('0x2')]},'clientId':{'type':Sequelize[_0x6eae('0x2')]},'clientSecret':{'type':Sequelize[_0x6eae('0x2')]},'securityToken':{'type':Sequelize[_0x6eae('0x2')]},'serverUrl':{'type':Sequelize[_0x6eae('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6eae('0x4')](_0x6eae('0x5'),_0x6eae('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xae6e=['sequelize','exports','STRING','ENUM','integrationTab'];(function(_0x4f27f6,_0x3f728e){var _0x4a106c=function(_0x4056a8){while(--_0x4056a8){_0x4f27f6['push'](_0x4f27f6['shift']());}};_0x4a106c(++_0x3f728e);}(_0xae6e,0x1e5));var _0xeae6=function(_0xa28624,_0x11a352){_0xa28624=_0xa28624-0x0;var _0x222bdf=_0xae6e[_0xa28624];return _0x222bdf;};'use strict';var Sequelize=require(_0xeae6('0x0'));module[_0xeae6('0x1')]={'name':{'type':Sequelize[_0xeae6('0x2')]},'description':{'type':Sequelize[_0xeae6('0x2')]},'username':{'type':Sequelize[_0xeae6('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xeae6('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xeae6('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xeae6('0x3')](_0xeae6('0x4'),'newTab'),'defaultValue':_0xeae6('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4d712b3..868ceb0 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 _0xe0c9=['reject','update','then','destroy','error','stack','name','map','SalesforceAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','create','body','params','find','getConfigurations','SalesforceConfiguration','filter','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','login','concat','isNil','ticketType','OwnerId','IsReminderSet','Subject','Description','string','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x5d0110,_0x3711c9){var _0x21b3e6=function(_0x2cbbcc){while(--_0x2cbbcc){_0x5d0110['push'](_0x5d0110['shift']());}};_0x21b3e6(++_0x3711c9);}(_0xe0c9,0xd4));var _0x9e0c=function(_0x256822,_0xf0588c){_0x256822=_0x256822-0x0;var _0x2b41a9=_0xe0c9[_0x256822];return _0x2b41a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e0c('0x0'));var zipdir=require(_0x9e0c('0x1'));var jsonpatch=require(_0x9e0c('0x2'));var rp=require(_0x9e0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9e0c('0x4'));var util=require(_0x9e0c('0x5'));var path=require(_0x9e0c('0x6'));var sox=require(_0x9e0c('0x7'));var csv=require(_0x9e0c('0x8'));var ejs=require(_0x9e0c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e0c('0xa'));var squel=require(_0x9e0c('0xb'));var crypto=require(_0x9e0c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9e0c('0xd'));var toCsv=require(_0x9e0c('0x8'));var querystring=require(_0x9e0c('0xe'));var Papa=require(_0x9e0c('0xf'));var Redis=require('ioredis');var authService=require(_0x9e0c('0x10'));var qs=require(_0x9e0c('0x11'));var as=require(_0x9e0c('0x12'));var hardwareService=require(_0x9e0c('0x13'));var logger=require('../../config/logger')(_0x9e0c('0x14'));var utils=require(_0x9e0c('0x15'));var config=require(_0x9e0c('0x16'));var licenseUtil=require(_0x9e0c('0x17'));var db=require(_0x9e0c('0x18'))['db'];var integrations=require(_0x9e0c('0x19'));function respondWithStatusCode(_0x2f6929,_0x491d99){_0x491d99=_0x491d99||0xcc;return function(_0x56ed1f){if(_0x56ed1f){return _0x2f6929[_0x9e0c('0x1a')](_0x491d99);}return _0x2f6929[_0x9e0c('0x1b')](_0x491d99)[_0x9e0c('0x1c')]();};}function respondWithResult(_0x4ab11f,_0x3712e8){_0x3712e8=_0x3712e8||0xc8;return function(_0x5a2909){if(_0x5a2909){return _0x4ab11f[_0x9e0c('0x1b')](_0x3712e8)[_0x9e0c('0x1d')](_0x5a2909);}};}function respondWithFilteredResult(_0x4e8d67,_0xe59867){return function(_0x52be49){if(_0x52be49){var _0x4076e5=typeof _0xe59867[_0x9e0c('0x1e')]===_0x9e0c('0x1f')&&typeof _0xe59867[_0x9e0c('0x20')]==='undefined';var _0x597142=_0x52be49[_0x9e0c('0x21')];var _0x37f659=_0x4076e5?0x0:_0xe59867[_0x9e0c('0x1e')];var _0x5449ed=_0x4076e5?_0x52be49[_0x9e0c('0x21')]:_0xe59867['offset']+_0xe59867['limit'];var _0x45a6fe;if(_0x5449ed>=_0x597142){_0x5449ed=_0x597142;_0x45a6fe=0xc8;}else{_0x45a6fe=0xce;}_0x4e8d67[_0x9e0c('0x1b')](_0x45a6fe);return _0x4e8d67['set'](_0x9e0c('0x22'),_0x37f659+'-'+_0x5449ed+'/'+_0x597142)['json'](_0x52be49);}return null;};}function patchUpdates(_0x210067){return function(_0x552c11){try{jsonpatch[_0x9e0c('0x23')](_0x552c11,_0x210067,!![]);}catch(_0x4b2614){return BPromise[_0x9e0c('0x24')](_0x4b2614);}return _0x552c11['save']();};}function saveUpdates(_0x3fab14,_0x5e9a5d){return function(_0x5a2fab){if(_0x5a2fab){return _0x5a2fab[_0x9e0c('0x25')](_0x3fab14)[_0x9e0c('0x26')](function(_0x131b4c){return _0x131b4c;});}return null;};}function removeEntity(_0x37e095,_0x5541c3){return function(_0x5db78b){if(_0x5db78b){return _0x5db78b[_0x9e0c('0x27')]()[_0x9e0c('0x26')](function(){_0x37e095['status'](0xcc)[_0x9e0c('0x1c')]();});}};}function handleEntityNotFound(_0x3c8780,_0x515208){return function(_0x5c573a){if(!_0x5c573a){_0x3c8780[_0x9e0c('0x1a')](0x194);}return _0x5c573a;};}function handleError(_0x185b6c,_0x347c2a){_0x347c2a=_0x347c2a||0x1f4;return function(_0x30c280){logger[_0x9e0c('0x28')](_0x30c280[_0x9e0c('0x29')]);if(_0x30c280[_0x9e0c('0x2a')]){delete _0x30c280[_0x9e0c('0x2a')];}_0x185b6c[_0x9e0c('0x1b')](_0x347c2a)['send'](_0x30c280);};}exports['index']=function(_0x529e40,_0xeb3667){var _0x130e06={},_0x49e086={},_0x9f8d18={'count':0x0,'rows':[]};var _0x1a3bc5=_[_0x9e0c('0x2b')](db[_0x9e0c('0x2c')][_0x9e0c('0x2d')],function(_0xd8d904){return{'name':_0xd8d904['fieldName'],'type':_0xd8d904[_0x9e0c('0x2e')][_0x9e0c('0x2f')]};});_0x49e086[_0x9e0c('0x30')]=_[_0x9e0c('0x2b')](_0x1a3bc5,_0x9e0c('0x2a'));_0x49e086[_0x9e0c('0x31')]=_[_0x9e0c('0x32')](_0x529e40['query']);_0x49e086['filters']=_[_0x9e0c('0x33')](_0x49e086[_0x9e0c('0x30')],_0x49e086[_0x9e0c('0x31')]);_0x130e06[_0x9e0c('0x34')]=_['intersection'](_0x49e086['model'],qs[_0x9e0c('0x35')](_0x529e40[_0x9e0c('0x31')][_0x9e0c('0x35')]));_0x130e06[_0x9e0c('0x34')]=_0x130e06['attributes']['length']?_0x130e06[_0x9e0c('0x34')]:_0x49e086[_0x9e0c('0x30')];if(!_0x529e40['query'][_0x9e0c('0x36')](_0x9e0c('0x37'))){_0x130e06[_0x9e0c('0x20')]=qs[_0x9e0c('0x20')](_0x529e40[_0x9e0c('0x31')][_0x9e0c('0x20')]);_0x130e06[_0x9e0c('0x1e')]=qs['offset'](_0x529e40[_0x9e0c('0x31')][_0x9e0c('0x1e')]);}_0x130e06[_0x9e0c('0x38')]=qs['sort'](_0x529e40[_0x9e0c('0x31')][_0x9e0c('0x39')]);_0x130e06[_0x9e0c('0x3a')]=qs['filters'](_[_0x9e0c('0x3b')](_0x529e40[_0x9e0c('0x31')],_0x49e086[_0x9e0c('0x3c')]),_0x1a3bc5);if(_0x529e40[_0x9e0c('0x31')]['filter']){_0x130e06[_0x9e0c('0x3a')]=_[_0x9e0c('0x3d')](_0x130e06[_0x9e0c('0x3a')],{'$or':_[_0x9e0c('0x2b')](_0x1a3bc5,function(_0x36b929){if(_0x36b929[_0x9e0c('0x2e')]!==_0x9e0c('0x3e')){var _0x31c2a4={};_0x31c2a4[_0x36b929['name']]={'$like':'%'+_0x529e40[_0x9e0c('0x31')]['filter']+'%'};return _0x31c2a4;}})});}_0x130e06=_[_0x9e0c('0x3d')]({},_0x130e06,_0x529e40[_0x9e0c('0x3f')]);var _0x108133={'where':_0x130e06['where']};return db[_0x9e0c('0x2c')][_0x9e0c('0x21')](_0x108133)[_0x9e0c('0x26')](function(_0xfdfc0a){_0x9f8d18[_0x9e0c('0x21')]=_0xfdfc0a;if(_0x529e40[_0x9e0c('0x31')][_0x9e0c('0x40')]){_0x130e06[_0x9e0c('0x41')]=[{'all':!![]}];}return db[_0x9e0c('0x2c')][_0x9e0c('0x42')](_0x130e06);})['then'](function(_0x5790b0){_0x9f8d18['rows']=_0x5790b0;return _0x9f8d18;})[_0x9e0c('0x26')](respondWithFilteredResult(_0xeb3667,_0x130e06))[_0x9e0c('0x43')](handleError(_0xeb3667,null));};exports[_0x9e0c('0x44')]=function(_0x10ed0a,_0x19f291){var _0x35937b={'raw':![],'where':{'id':_0x10ed0a['params']['id']}},_0x139686={};_0x139686['model']=_[_0x9e0c('0x32')](db[_0x9e0c('0x2c')]['rawAttributes']);_0x139686['query']=_[_0x9e0c('0x32')](_0x10ed0a[_0x9e0c('0x31')]);_0x139686[_0x9e0c('0x3c')]=_[_0x9e0c('0x33')](_0x139686[_0x9e0c('0x30')],_0x139686[_0x9e0c('0x31')]);_0x35937b[_0x9e0c('0x34')]=_[_0x9e0c('0x33')](_0x139686[_0x9e0c('0x30')],qs['fields'](_0x10ed0a[_0x9e0c('0x31')][_0x9e0c('0x35')]));_0x35937b[_0x9e0c('0x34')]=_0x35937b[_0x9e0c('0x34')][_0x9e0c('0x45')]?_0x35937b[_0x9e0c('0x34')]:_0x139686[_0x9e0c('0x30')];if(_0x10ed0a[_0x9e0c('0x31')][_0x9e0c('0x40')]){_0x35937b[_0x9e0c('0x41')]=[{'all':!![]}];}_0x35937b=_[_0x9e0c('0x3d')]({},_0x35937b,_0x10ed0a[_0x9e0c('0x3f')]);return db['SalesforceAccount']['find'](_0x35937b)[_0x9e0c('0x26')](handleEntityNotFound(_0x19f291,null))[_0x9e0c('0x26')](respondWithResult(_0x19f291,null))[_0x9e0c('0x43')](handleError(_0x19f291,null));};exports[_0x9e0c('0x46')]=function(_0x35ca75,_0x2e2fa){return db['SalesforceAccount'][_0x9e0c('0x46')](_0x35ca75['body'],{})[_0x9e0c('0x26')](respondWithResult(_0x2e2fa,0xc9))[_0x9e0c('0x43')](handleError(_0x2e2fa,null));};exports[_0x9e0c('0x25')]=function(_0x14525b,_0x462165){if(_0x14525b[_0x9e0c('0x47')]['id']){delete _0x14525b['body']['id'];}return db[_0x9e0c('0x2c')]['find']({'where':{'id':_0x14525b[_0x9e0c('0x48')]['id']}})['then'](handleEntityNotFound(_0x462165,null))[_0x9e0c('0x26')](saveUpdates(_0x14525b[_0x9e0c('0x47')],null))[_0x9e0c('0x26')](respondWithResult(_0x462165,null))[_0x9e0c('0x43')](handleError(_0x462165,null));};exports[_0x9e0c('0x27')]=function(_0x2755f2,_0x3743f6){return db[_0x9e0c('0x2c')][_0x9e0c('0x49')]({'where':{'id':_0x2755f2[_0x9e0c('0x48')]['id']}})[_0x9e0c('0x26')](handleEntityNotFound(_0x3743f6,null))[_0x9e0c('0x26')](removeEntity(_0x3743f6,null))[_0x9e0c('0x43')](handleError(_0x3743f6,null));};exports[_0x9e0c('0x4a')]=function(_0xca3019,_0x3b5311,_0x2bc5ae){var _0x1042d3={};var _0x1c7fe5={};var _0x23d007;var _0x311033;return db[_0x9e0c('0x2c')]['findOne']({'where':{'id':_0xca3019[_0x9e0c('0x48')]['id']}})[_0x9e0c('0x26')](handleEntityNotFound(_0x3b5311,null))['then'](function(_0x569d03){if(_0x569d03){_0x23d007=_0x569d03;_0x1c7fe5['model']=_[_0x9e0c('0x32')](db[_0x9e0c('0x4b')][_0x9e0c('0x2d')]);_0x1c7fe5[_0x9e0c('0x31')]=_[_0x9e0c('0x32')](_0xca3019[_0x9e0c('0x31')]);_0x1c7fe5[_0x9e0c('0x3c')]=_[_0x9e0c('0x33')](_0x1c7fe5['model'],_0x1c7fe5[_0x9e0c('0x31')]);_0x1042d3[_0x9e0c('0x34')]=_[_0x9e0c('0x33')](_0x1c7fe5[_0x9e0c('0x30')],qs[_0x9e0c('0x35')](_0xca3019[_0x9e0c('0x31')][_0x9e0c('0x35')]));_0x1042d3['attributes']=_0x1042d3[_0x9e0c('0x34')]['length']?_0x1042d3['attributes']:_0x1c7fe5['model'];_0x1042d3[_0x9e0c('0x38')]=qs['sort'](_0xca3019[_0x9e0c('0x31')][_0x9e0c('0x39')]);_0x1042d3['where']=qs[_0x9e0c('0x3c')](_[_0x9e0c('0x3b')](_0xca3019[_0x9e0c('0x31')],_0x1c7fe5[_0x9e0c('0x3c')]));if(_0xca3019[_0x9e0c('0x31')][_0x9e0c('0x4c')]){_0x1042d3[_0x9e0c('0x3a')]=_[_0x9e0c('0x3d')](_0x1042d3[_0x9e0c('0x3a')],{'$or':_[_0x9e0c('0x2b')](_0x1042d3[_0x9e0c('0x34')],function(_0x4af1cc){var _0x10fff9={};_0x10fff9[_0x4af1cc]={'$like':'%'+_0xca3019[_0x9e0c('0x31')][_0x9e0c('0x4c')]+'%'};return _0x10fff9;})});}_0x1042d3=_[_0x9e0c('0x3d')]({},_0x1042d3,_0xca3019[_0x9e0c('0x3f')]);return _0x23d007['getConfigurations'](_0x1042d3);}})[_0x9e0c('0x26')](function(_0x207983){if(_0x207983){_0x311033=_0x207983[_0x9e0c('0x45')];if(!_0xca3019[_0x9e0c('0x31')][_0x9e0c('0x36')]('nolimit')){_0x1042d3['limit']=qs[_0x9e0c('0x20')](_0xca3019['query']['limit']);_0x1042d3[_0x9e0c('0x1e')]=qs['offset'](_0xca3019[_0x9e0c('0x31')][_0x9e0c('0x1e')]);}return _0x23d007[_0x9e0c('0x4a')](_0x1042d3);}})[_0x9e0c('0x26')](function(_0x4f7fcd){if(_0x4f7fcd){return _0x4f7fcd?{'count':_0x311033,'rows':_0x4f7fcd}:null;}})[_0x9e0c('0x26')](respondWithResult(_0x3b5311,null))[_0x9e0c('0x43')](handleError(_0x3b5311,null));};exports['addConfiguration']=function(_0x8b1d52,_0x534777,_0x11cc90){if(_0x8b1d52[_0x9e0c('0x47')]['id']){delete _0x8b1d52[_0x9e0c('0x47')]['id'];}return db[_0x9e0c('0x2c')][_0x9e0c('0x4d')]({'where':{'id':_0x8b1d52[_0x9e0c('0x48')]['id']}})[_0x9e0c('0x26')](handleEntityNotFound(_0x534777,null))['then'](function(_0x50a87d){if(_0x50a87d){_0x8b1d52[_0x9e0c('0x47')][_0x9e0c('0x4e')]=_0x50a87d['id'];_0x8b1d52['body'][_0x9e0c('0x4f')]=integrations[_0x9e0c('0x50')](_0x8b1d52[_0x9e0c('0x47')][_0x9e0c('0x51')],_0x8b1d52[_0x9e0c('0x47')]['type']);_0x8b1d52[_0x9e0c('0x47')][_0x9e0c('0x52')]=integrations[_0x9e0c('0x53')](_0x8b1d52[_0x9e0c('0x47')][_0x9e0c('0x51')],_0x8b1d52[_0x9e0c('0x47')][_0x9e0c('0x2e')]);return db[_0x9e0c('0x4b')][_0x9e0c('0x46')](_0x8b1d52[_0x9e0c('0x47')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x9e0c('0x54')],'as':_0x9e0c('0x52')}]});}return null;})[_0x9e0c('0x26')](respondWithResult(_0x534777,null))[_0x9e0c('0x43')](handleError(_0x534777,null));};exports[_0x9e0c('0x55')]=function(_0x5b3d9f,_0x55ddd5,_0x5eee4e){var _0x480ae4;var _0x40098f='';var _0x5b7961=_0x9e0c('0x56');return db[_0x9e0c('0x2c')]['findOne']({'where':{'id':_0x5b3d9f['params']['id']},'attributes':['id',_0x9e0c('0x57'),_0x9e0c('0x58'),_0x9e0c('0x59'),_0x9e0c('0x5a'),_0x9e0c('0x5b'),_0x9e0c('0x5c')]})['then'](handleEntityNotFound(_0x55ddd5,null))[_0x9e0c('0x26')](function(_0x2acaa7){if(_0x2acaa7){_0x40098f=_0x2acaa7[_0x9e0c('0x57')];var _0x4f425f=_0x40098f['slice'](-0x1);if(_0x4f425f==='/'){_0x40098f=_0x40098f[_0x9e0c('0x5d')](0x0,_0x40098f[_0x9e0c('0x5e')](_0x4f425f));}_0x480ae4=new jsforce['Connection']({'oauth2':{'loginUrl':_0x40098f,'clientId':_0x2acaa7[_0x9e0c('0x58')],'clientSecret':_0x2acaa7[_0x9e0c('0x59')]}});return _0x480ae4[_0x9e0c('0x5f')](_0x2acaa7[_0x9e0c('0x5a')],_0x2acaa7[_0x9e0c('0x5b')][_0x9e0c('0x60')](_0x2acaa7[_0x9e0c('0x5c')]));}})['then'](function(_0x132d21){if(_0x132d21){if(!_[_0x9e0c('0x61')](_0x5b3d9f[_0x9e0c('0x31')]['ticketType'])){_0x5b7961=_0x5b3d9f['query'][_0x9e0c('0x62')];}return _0x480ae4['sobject'](_0x5b7961)['describe']();}})[_0x9e0c('0x26')](function(_0x10bcda){var _0x19574f=[_0x9e0c('0x63'),'ActivityDate',_0x9e0c('0x64'),'IsRecurrence',_0x9e0c('0x65'),_0x9e0c('0x66')];var _0x5c888f=[_0x9e0c('0x67'),_0x9e0c('0x68'),'picklist',_0x9e0c('0x69'),_0x9e0c('0x6a'),_0x9e0c('0x6b'),_0x9e0c('0x6c')];if(_0x10bcda){_[_0x9e0c('0x6d')](_0x10bcda[_0x9e0c('0x35')],function(_0x4f7cab){return _0x19574f[_0x9e0c('0x6e')](_0x4f7cab[_0x9e0c('0x2a')])||!_0x5c888f['includes'](_0x4f7cab[_0x9e0c('0x2e')]);});return{'count':_0x10bcda[_0x9e0c('0x35')]['length'],'rows':_[_0x9e0c('0x2b')](_0x10bcda[_0x9e0c('0x35')],function(_0x1a9fa1){return{'id':_0x1a9fa1[_0x9e0c('0x2a')],'name':_0x1a9fa1[_0x9e0c('0x6f')],'custom':_0x1a9fa1[_0x9e0c('0x70')],'options':_0x1a9fa1[_0x9e0c('0x71')][_0x9e0c('0x45')]>0x0?_[_0x9e0c('0x2b')](_0x1a9fa1[_0x9e0c('0x71')],function(_0x3dbb96){return{'name':_0x3dbb96[_0x9e0c('0x6f')],'value':_0x3dbb96[_0x9e0c('0x72')]};}):_0x1a9fa1[_0x9e0c('0x2e')]==_0x9e0c('0x69')?[{'name':_0x9e0c('0x73'),'value':_0x9e0c('0x74')},{'name':_0x9e0c('0x75'),'value':_0x9e0c('0x76')}]:[]};})};}})[_0x9e0c('0x26')](respondWithResult(_0x55ddd5,null))[_0x9e0c('0x43')](function(_0x41c2f2){var _0x4b36ca=_0x5b3d9f[_0x9e0c('0x31')]['test']?0x1f4:_0x41c2f2[_0x9e0c('0x77')]||0x1f4;logger[_0x9e0c('0x28')](_0x9e0c('0x78'),_0x9e0c('0x55'),_0x4b36ca,JSON[_0x9e0c('0x79')](_0x41c2f2));delete _0x41c2f2[_0x9e0c('0x2a')];if(_0x4b36ca===0x191){_0x4b36ca=0x190;}_0x55ddd5[_0x9e0c('0x1b')](_0x4b36ca)[_0x9e0c('0x7a')](_0x5b3d9f[_0x9e0c('0x31')][_0x9e0c('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x41c2f2[_0x9e0c('0x77')]}:_0x41c2f2);});}; \ No newline at end of file +var _0x5eaf=['true','False','false','test','statusCode','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','params','length','merge','find','catch','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','securityToken','isNil','ticketType','sobject','describe','OwnerId','IsRecurrence','Subject','Description','string','int','boolean','textarea','phone','remove','includes','picklistValues','True'];(function(_0x71379b,_0x386498){var _0x1b56a6=function(_0x3f0e42){while(--_0x3f0e42){_0x71379b['push'](_0x71379b['shift']());}};_0x1b56a6(++_0x386498);}(_0x5eaf,0x17d));var _0xf5ea=function(_0x7bc9db,_0x1678c9){_0x7bc9db=_0x7bc9db-0x0;var _0x5af185=_0x5eaf[_0x7bc9db];return _0x5af185;};'use strict';var emlformat=require(_0xf5ea('0x0'));var rimraf=require(_0xf5ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5ea('0x2'));var rp=require(_0xf5ea('0x3'));var moment=require(_0xf5ea('0x4'));var BPromise=require(_0xf5ea('0x5'));var Mustache=require('mustache');var util=require(_0xf5ea('0x6'));var path=require(_0xf5ea('0x7'));var sox=require(_0xf5ea('0x8'));var csv=require('to-csv');var ejs=require(_0xf5ea('0x9'));var fs=require('fs');var fs_extra=require(_0xf5ea('0xa'));var _=require('lodash');var squel=require(_0xf5ea('0xb'));var crypto=require(_0xf5ea('0xc'));var jsforce=require(_0xf5ea('0xd'));var deskjs=require(_0xf5ea('0xe'));var toCsv=require(_0xf5ea('0xf'));var querystring=require(_0xf5ea('0x10'));var Papa=require(_0xf5ea('0x11'));var Redis=require(_0xf5ea('0x12'));var authService=require(_0xf5ea('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf5ea('0x14'));var hardwareService=require(_0xf5ea('0x15'));var logger=require(_0xf5ea('0x16'))('api');var utils=require(_0xf5ea('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf5ea('0x18'));var db=require(_0xf5ea('0x19'))['db'];var integrations=require(_0xf5ea('0x1a'));function respondWithStatusCode(_0x21159a,_0x4c4822){_0x4c4822=_0x4c4822||0xcc;return function(_0x5b9cc4){if(_0x5b9cc4){return _0x21159a[_0xf5ea('0x1b')](_0x4c4822);}return _0x21159a[_0xf5ea('0x1c')](_0x4c4822)['end']();};}function respondWithResult(_0xb03ca0,_0x2e29c7){_0x2e29c7=_0x2e29c7||0xc8;return function(_0x33200a){if(_0x33200a){return _0xb03ca0['status'](_0x2e29c7)[_0xf5ea('0x1d')](_0x33200a);}};}function respondWithFilteredResult(_0x52b1ba,_0x3df31b){return function(_0x44721f){if(_0x44721f){var _0x551b01=typeof _0x3df31b[_0xf5ea('0x1e')]===_0xf5ea('0x1f')&&typeof _0x3df31b[_0xf5ea('0x20')]===_0xf5ea('0x1f');var _0x496502=_0x44721f['count'];var _0x3db0fd=_0x551b01?0x0:_0x3df31b[_0xf5ea('0x1e')];var _0x3dbccf=_0x551b01?_0x44721f[_0xf5ea('0x21')]:_0x3df31b[_0xf5ea('0x1e')]+_0x3df31b[_0xf5ea('0x20')];var _0x31799b;if(_0x3dbccf>=_0x496502){_0x3dbccf=_0x496502;_0x31799b=0xc8;}else{_0x31799b=0xce;}_0x52b1ba[_0xf5ea('0x1c')](_0x31799b);return _0x52b1ba[_0xf5ea('0x22')]('Content-Range',_0x3db0fd+'-'+_0x3dbccf+'/'+_0x496502)[_0xf5ea('0x1d')](_0x44721f);}return null;};}function patchUpdates(_0x2fc7c9){return function(_0x465f0f){try{jsonpatch[_0xf5ea('0x23')](_0x465f0f,_0x2fc7c9,!![]);}catch(_0x4760f5){return BPromise[_0xf5ea('0x24')](_0x4760f5);}return _0x465f0f['save']();};}function saveUpdates(_0x1235db,_0xdd5c30){return function(_0x34064d){if(_0x34064d){return _0x34064d[_0xf5ea('0x25')](_0x1235db)['then'](function(_0x43751e){return _0x43751e;});}return null;};}function removeEntity(_0x166965,_0x212921){return function(_0x2402b6){if(_0x2402b6){return _0x2402b6[_0xf5ea('0x26')]()[_0xf5ea('0x27')](function(){_0x166965['status'](0xcc)[_0xf5ea('0x28')]();});}};}function handleEntityNotFound(_0x300d66,_0x387769){return function(_0x559caa){if(!_0x559caa){_0x300d66[_0xf5ea('0x1b')](0x194);}return _0x559caa;};}function handleError(_0x455c1f,_0x50025c){_0x50025c=_0x50025c||0x1f4;return function(_0x3d0f3c){logger[_0xf5ea('0x29')](_0x3d0f3c['stack']);if(_0x3d0f3c[_0xf5ea('0x2a')]){delete _0x3d0f3c['name'];}_0x455c1f['status'](_0x50025c)[_0xf5ea('0x2b')](_0x3d0f3c);};}exports[_0xf5ea('0x2c')]=function(_0x259fe0,_0x4ed51d){var _0x422452={},_0x372877={},_0x4f5a7a={'count':0x0,'rows':[]};var _0x137888=_[_0xf5ea('0x2d')](db[_0xf5ea('0x2e')][_0xf5ea('0x2f')],function(_0x239b6b){return{'name':_0x239b6b[_0xf5ea('0x30')],'type':_0x239b6b[_0xf5ea('0x31')][_0xf5ea('0x32')]};});_0x372877[_0xf5ea('0x33')]=_['map'](_0x137888,_0xf5ea('0x2a'));_0x372877[_0xf5ea('0x34')]=_[_0xf5ea('0x35')](_0x259fe0[_0xf5ea('0x34')]);_0x372877[_0xf5ea('0x36')]=_[_0xf5ea('0x37')](_0x372877[_0xf5ea('0x33')],_0x372877[_0xf5ea('0x34')]);_0x422452['attributes']=_[_0xf5ea('0x37')](_0x372877[_0xf5ea('0x33')],qs['fields'](_0x259fe0['query'][_0xf5ea('0x38')]));_0x422452[_0xf5ea('0x39')]=_0x422452[_0xf5ea('0x39')]['length']?_0x422452[_0xf5ea('0x39')]:_0x372877[_0xf5ea('0x33')];if(!_0x259fe0['query'][_0xf5ea('0x3a')](_0xf5ea('0x3b'))){_0x422452[_0xf5ea('0x20')]=qs['limit'](_0x259fe0[_0xf5ea('0x34')]['limit']);_0x422452['offset']=qs[_0xf5ea('0x1e')](_0x259fe0[_0xf5ea('0x34')][_0xf5ea('0x1e')]);}_0x422452[_0xf5ea('0x3c')]=qs[_0xf5ea('0x3d')](_0x259fe0[_0xf5ea('0x34')][_0xf5ea('0x3d')]);_0x422452[_0xf5ea('0x3e')]=qs['filters'](_[_0xf5ea('0x3f')](_0x259fe0[_0xf5ea('0x34')],_0x372877[_0xf5ea('0x36')]),_0x137888);if(_0x259fe0[_0xf5ea('0x34')][_0xf5ea('0x40')]){_0x422452['where']=_['merge'](_0x422452[_0xf5ea('0x3e')],{'$or':_[_0xf5ea('0x2d')](_0x137888,function(_0x580e9a){if(_0x580e9a[_0xf5ea('0x31')]!==_0xf5ea('0x41')){var _0x29aded={};_0x29aded[_0x580e9a['name']]={'$like':'%'+_0x259fe0[_0xf5ea('0x34')][_0xf5ea('0x40')]+'%'};return _0x29aded;}})});}_0x422452=_['merge']({},_0x422452,_0x259fe0[_0xf5ea('0x42')]);var _0x451be9={'where':_0x422452[_0xf5ea('0x3e')]};return db[_0xf5ea('0x2e')][_0xf5ea('0x21')](_0x451be9)[_0xf5ea('0x27')](function(_0x16f88e){_0x4f5a7a[_0xf5ea('0x21')]=_0x16f88e;if(_0x259fe0[_0xf5ea('0x34')][_0xf5ea('0x43')]){_0x422452[_0xf5ea('0x44')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xf5ea('0x45')](_0x422452);})[_0xf5ea('0x27')](function(_0x5063ba){_0x4f5a7a[_0xf5ea('0x46')]=_0x5063ba;return _0x4f5a7a;})[_0xf5ea('0x27')](respondWithFilteredResult(_0x4ed51d,_0x422452))['catch'](handleError(_0x4ed51d,null));};exports['show']=function(_0x1a29c8,_0x2c7297){var _0x1adbc3={'raw':![],'where':{'id':_0x1a29c8[_0xf5ea('0x47')]['id']}},_0x12670d={};_0x12670d[_0xf5ea('0x33')]=_[_0xf5ea('0x35')](db['SalesforceAccount'][_0xf5ea('0x2f')]);_0x12670d[_0xf5ea('0x34')]=_[_0xf5ea('0x35')](_0x1a29c8[_0xf5ea('0x34')]);_0x12670d['filters']=_['intersection'](_0x12670d['model'],_0x12670d[_0xf5ea('0x34')]);_0x1adbc3[_0xf5ea('0x39')]=_[_0xf5ea('0x37')](_0x12670d[_0xf5ea('0x33')],qs['fields'](_0x1a29c8[_0xf5ea('0x34')][_0xf5ea('0x38')]));_0x1adbc3[_0xf5ea('0x39')]=_0x1adbc3[_0xf5ea('0x39')][_0xf5ea('0x48')]?_0x1adbc3['attributes']:_0x12670d['model'];if(_0x1a29c8['query']['includeAll']){_0x1adbc3[_0xf5ea('0x44')]=[{'all':!![]}];}_0x1adbc3=_[_0xf5ea('0x49')]({},_0x1adbc3,_0x1a29c8[_0xf5ea('0x42')]);return db[_0xf5ea('0x2e')][_0xf5ea('0x4a')](_0x1adbc3)[_0xf5ea('0x27')](handleEntityNotFound(_0x2c7297,null))[_0xf5ea('0x27')](respondWithResult(_0x2c7297,null))[_0xf5ea('0x4b')](handleError(_0x2c7297,null));};exports['create']=function(_0x1392e5,_0x551b21){return db[_0xf5ea('0x2e')][_0xf5ea('0x4c')](_0x1392e5[_0xf5ea('0x4d')],{})[_0xf5ea('0x27')](respondWithResult(_0x551b21,0xc9))[_0xf5ea('0x4b')](handleError(_0x551b21,null));};exports['update']=function(_0x561d38,_0x4e8cfb){if(_0x561d38[_0xf5ea('0x4d')]['id']){delete _0x561d38[_0xf5ea('0x4d')]['id'];}return db['SalesforceAccount'][_0xf5ea('0x4a')]({'where':{'id':_0x561d38[_0xf5ea('0x47')]['id']}})[_0xf5ea('0x27')](handleEntityNotFound(_0x4e8cfb,null))['then'](saveUpdates(_0x561d38[_0xf5ea('0x4d')],null))[_0xf5ea('0x27')](respondWithResult(_0x4e8cfb,null))['catch'](handleError(_0x4e8cfb,null));};exports[_0xf5ea('0x26')]=function(_0x3f03f7,_0x229bc6){return db[_0xf5ea('0x2e')][_0xf5ea('0x4a')]({'where':{'id':_0x3f03f7[_0xf5ea('0x47')]['id']}})[_0xf5ea('0x27')](handleEntityNotFound(_0x229bc6,null))[_0xf5ea('0x27')](removeEntity(_0x229bc6,null))['catch'](handleError(_0x229bc6,null));};exports[_0xf5ea('0x4e')]=function(_0x5b7112,_0xbf91fc,_0x1adc2b){var _0x165478={};var _0x5816c5={};var _0x94a630;var _0x4d1de4;return db[_0xf5ea('0x2e')][_0xf5ea('0x4f')]({'where':{'id':_0x5b7112[_0xf5ea('0x47')]['id']}})[_0xf5ea('0x27')](handleEntityNotFound(_0xbf91fc,null))[_0xf5ea('0x27')](function(_0x1c11f0){if(_0x1c11f0){_0x94a630=_0x1c11f0;_0x5816c5[_0xf5ea('0x33')]=_['keys'](db[_0xf5ea('0x50')][_0xf5ea('0x2f')]);_0x5816c5[_0xf5ea('0x34')]=_['keys'](_0x5b7112[_0xf5ea('0x34')]);_0x5816c5[_0xf5ea('0x36')]=_[_0xf5ea('0x37')](_0x5816c5[_0xf5ea('0x33')],_0x5816c5[_0xf5ea('0x34')]);_0x165478[_0xf5ea('0x39')]=_[_0xf5ea('0x37')](_0x5816c5[_0xf5ea('0x33')],qs[_0xf5ea('0x38')](_0x5b7112[_0xf5ea('0x34')][_0xf5ea('0x38')]));_0x165478[_0xf5ea('0x39')]=_0x165478[_0xf5ea('0x39')][_0xf5ea('0x48')]?_0x165478['attributes']:_0x5816c5['model'];_0x165478['order']=qs[_0xf5ea('0x3d')](_0x5b7112[_0xf5ea('0x34')][_0xf5ea('0x3d')]);_0x165478[_0xf5ea('0x3e')]=qs[_0xf5ea('0x36')](_['pick'](_0x5b7112['query'],_0x5816c5['filters']));if(_0x5b7112[_0xf5ea('0x34')]['filter']){_0x165478[_0xf5ea('0x3e')]=_['merge'](_0x165478['where'],{'$or':_[_0xf5ea('0x2d')](_0x165478['attributes'],function(_0x2f2bee){var _0x812d45={};_0x812d45[_0x2f2bee]={'$like':'%'+_0x5b7112['query'][_0xf5ea('0x40')]+'%'};return _0x812d45;})});}_0x165478=_[_0xf5ea('0x49')]({},_0x165478,_0x5b7112[_0xf5ea('0x42')]);return _0x94a630[_0xf5ea('0x4e')](_0x165478);}})[_0xf5ea('0x27')](function(_0x4606cd){if(_0x4606cd){_0x4d1de4=_0x4606cd[_0xf5ea('0x48')];if(!_0x5b7112[_0xf5ea('0x34')][_0xf5ea('0x3a')](_0xf5ea('0x3b'))){_0x165478[_0xf5ea('0x20')]=qs[_0xf5ea('0x20')](_0x5b7112[_0xf5ea('0x34')][_0xf5ea('0x20')]);_0x165478[_0xf5ea('0x1e')]=qs[_0xf5ea('0x1e')](_0x5b7112[_0xf5ea('0x34')][_0xf5ea('0x1e')]);}return _0x94a630['getConfigurations'](_0x165478);}})[_0xf5ea('0x27')](function(_0x293872){if(_0x293872){return _0x293872?{'count':_0x4d1de4,'rows':_0x293872}:null;}})[_0xf5ea('0x27')](respondWithResult(_0xbf91fc,null))[_0xf5ea('0x4b')](handleError(_0xbf91fc,null));};exports[_0xf5ea('0x51')]=function(_0x2aa7e6,_0x315fee,_0x293d7d){if(_0x2aa7e6['body']['id']){delete _0x2aa7e6[_0xf5ea('0x4d')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x2aa7e6[_0xf5ea('0x47')]['id']}})[_0xf5ea('0x27')](handleEntityNotFound(_0x315fee,null))['then'](function(_0x4b3ca3){if(_0x4b3ca3){_0x2aa7e6[_0xf5ea('0x4d')][_0xf5ea('0x52')]=_0x4b3ca3['id'];_0x2aa7e6[_0xf5ea('0x4d')][_0xf5ea('0x53')]=integrations[_0xf5ea('0x54')](_0x2aa7e6[_0xf5ea('0x4d')]['channel'],_0x2aa7e6['body'][_0xf5ea('0x31')]);_0x2aa7e6['body'][_0xf5ea('0x55')]=integrations[_0xf5ea('0x56')](_0x2aa7e6[_0xf5ea('0x4d')][_0xf5ea('0x57')],_0x2aa7e6[_0xf5ea('0x4d')][_0xf5ea('0x31')]);return db[_0xf5ea('0x50')][_0xf5ea('0x4c')](_0x2aa7e6[_0xf5ea('0x4d')],{'include':[{'model':db[_0xf5ea('0x58')],'as':_0xf5ea('0x53')},{'model':db[_0xf5ea('0x58')],'as':_0xf5ea('0x55')}]});}return null;})['then'](respondWithResult(_0x315fee,null))['catch'](handleError(_0x315fee,null));};exports[_0xf5ea('0x59')]=function(_0x5b1973,_0x84b0d9,_0x5b9690){var _0x29d430;var _0x76d922='';var _0x56c75d=_0xf5ea('0x5a');return db[_0xf5ea('0x2e')][_0xf5ea('0x4f')]({'where':{'id':_0x5b1973[_0xf5ea('0x47')]['id']},'attributes':['id',_0xf5ea('0x5b'),_0xf5ea('0x5c'),_0xf5ea('0x5d'),_0xf5ea('0x5e'),_0xf5ea('0x5f'),'securityToken']})[_0xf5ea('0x27')](handleEntityNotFound(_0x84b0d9,null))['then'](function(_0x14e3b1){if(_0x14e3b1){_0x76d922=_0x14e3b1[_0xf5ea('0x5b')];var _0x5c26c9=_0x76d922[_0xf5ea('0x60')](-0x1);if(_0x5c26c9==='/'){_0x76d922=_0x76d922[_0xf5ea('0x61')](0x0,_0x76d922[_0xf5ea('0x62')](_0x5c26c9));}_0x29d430=new jsforce[(_0xf5ea('0x63'))]({'oauth2':{'loginUrl':_0x76d922,'clientId':_0x14e3b1[_0xf5ea('0x5c')],'clientSecret':_0x14e3b1[_0xf5ea('0x5d')]}});return _0x29d430[_0xf5ea('0x64')](_0x14e3b1[_0xf5ea('0x5e')],_0x14e3b1[_0xf5ea('0x5f')]['concat'](_0x14e3b1[_0xf5ea('0x65')]));}})['then'](function(_0x969da4){if(_0x969da4){if(!_[_0xf5ea('0x66')](_0x5b1973[_0xf5ea('0x34')][_0xf5ea('0x67')])){_0x56c75d=_0x5b1973[_0xf5ea('0x34')]['ticketType'];}return _0x29d430[_0xf5ea('0x68')](_0x56c75d)[_0xf5ea('0x69')]();}})[_0xf5ea('0x27')](function(_0x527c16){var _0x34242d=[_0xf5ea('0x6a'),'ActivityDate','IsReminderSet',_0xf5ea('0x6b'),_0xf5ea('0x6c'),_0xf5ea('0x6d')];var _0x1ea997=[_0xf5ea('0x6e'),_0xf5ea('0x6f'),'picklist',_0xf5ea('0x70'),'email',_0xf5ea('0x71'),_0xf5ea('0x72')];if(_0x527c16){_[_0xf5ea('0x73')](_0x527c16['fields'],function(_0x4f538f){return _0x34242d['includes'](_0x4f538f[_0xf5ea('0x2a')])||!_0x1ea997[_0xf5ea('0x74')](_0x4f538f['type']);});return{'count':_0x527c16[_0xf5ea('0x38')][_0xf5ea('0x48')],'rows':_[_0xf5ea('0x2d')](_0x527c16[_0xf5ea('0x38')],function(_0x2c7610){return{'id':_0x2c7610[_0xf5ea('0x2a')],'name':_0x2c7610['label'],'custom':_0x2c7610['custom'],'options':_0x2c7610[_0xf5ea('0x75')][_0xf5ea('0x48')]>0x0?_['map'](_0x2c7610[_0xf5ea('0x75')],function(_0x21d338){return{'name':_0x21d338['label'],'value':_0x21d338['value']};}):_0x2c7610[_0xf5ea('0x31')]=='boolean'?[{'name':_0xf5ea('0x76'),'value':_0xf5ea('0x77')},{'name':_0xf5ea('0x78'),'value':_0xf5ea('0x79')}]:[]};})};}})['then'](respondWithResult(_0x84b0d9,null))[_0xf5ea('0x4b')](function(_0x39333b){var _0x2edc5c=_0x5b1973['query'][_0xf5ea('0x7a')]?0x1f4:_0x39333b[_0xf5ea('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xf5ea('0x59'),_0x2edc5c,JSON['stringify'](_0x39333b));delete _0x39333b[_0xf5ea('0x2a')];if(_0x2edc5c===0x191){_0x2edc5c=0x190;}_0x84b0d9[_0xf5ea('0x1c')](_0x2edc5c)[_0xf5ea('0x2b')](_0x5b1973['query'][_0xf5ea('0x7a')]?{'message':_0xf5ea('0x7c'),'statusCode':_0x39333b[_0xf5ea('0x7b')]}:_0x39333b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 209d69c..5292e30 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 _0x4003=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0xfa7db1,_0x3fe358){var _0x1e68f0=function(_0xd6e8a1){while(--_0xd6e8a1){_0xfa7db1['push'](_0xfa7db1['shift']());}};_0x1e68f0(++_0x3fe358);}(_0x4003,0x1a1));var _0x3400=function(_0x5a38f8,_0x19e659){_0x5a38f8=_0x5a38f8-0x0;var _0xe8ab52=_0x4003[_0x5a38f8];return _0xe8ab52;};'use strict';var _=require(_0x3400('0x0'));var util=require(_0x3400('0x1'));var logger=require('../../config/logger')(_0x3400('0x2'));var moment=require(_0x3400('0x3'));var BPromise=require(_0x3400('0x4'));var rp=require(_0x3400('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3400('0x6'));var config=require(_0x3400('0x7'));var attributes=require(_0x3400('0x8'));var integrations=require(_0x3400('0x9'));module[_0x3400('0xa')]=function(_0x45563b,_0x49cbf3){return _0x45563b[_0x3400('0xb')](_0x3400('0xc'),attributes,{'tableName':_0x3400('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5002=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','api','bluebird','request-promise'];(function(_0x5e7694,_0xb85dca){var _0x24ad86=function(_0x40985d){while(--_0x40985d){_0x5e7694['push'](_0x5e7694['shift']());}};_0x24ad86(++_0xb85dca);}(_0x5002,0x189));var _0x2500=function(_0x98e64,_0x216f4d){_0x98e64=_0x98e64-0x0;var _0x48d537=_0x5002[_0x98e64];return _0x48d537;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2500('0x0'));var moment=require('moment');var BPromise=require(_0x2500('0x1'));var rp=require(_0x2500('0x2'));var fs=require('fs');var path=require(_0x2500('0x3'));var rimraf=require(_0x2500('0x4'));var config=require(_0x2500('0x5'));var attributes=require(_0x2500('0x6'));var integrations=require(_0x2500('0x7'));module[_0x2500('0x8')]=function(_0x3e7c58,_0x568492){return _0x3e7c58['define'](_0x2500('0x9'),attributes,{'tableName':_0x2500('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 e8f89f9..fbaf88c 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 _0x517b=['client','request','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','options','raw','where','map','include','attributes','model','then','GetSalesforceAccount','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x517b,0xff));var _0xb517=function(_0x35e641,_0x4b5f7e){_0x35e641=_0x35e641-0x0;var _0x24c608=_0x517b[_0x35e641];return _0x24c608;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb517('0x0'));var BPromise=require(_0xb517('0x1'));var rs=require(_0xb517('0x2'));var fs=require('fs');var Redis=require(_0xb517('0x3'));var db=require(_0xb517('0x4'))['db'];var utils=require(_0xb517('0x5'));var logger=require(_0xb517('0x6'))(_0xb517('0x7'));var config=require('../../config/environment');var jayson=require(_0xb517('0x8'));var client=jayson[_0xb517('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe41f15,_0x4f55f7,_0x80ef50){return new BPromise(function(_0x3678f9,_0x23f9e8){return client[_0xb517('0xa')](_0xe41f15,_0x80ef50)['then'](function(_0xafd8f7){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4f55f7,_0xb517('0xb'));logger[_0xb517('0xc')](_0xb517('0xd'),_0x4f55f7,_0xb517('0xb'),JSON[_0xb517('0xe')](_0xafd8f7));if(_0xafd8f7[_0xb517('0xf')]){if(_0xafd8f7[_0xb517('0xf')][_0xb517('0x10')]===0x1f4){logger['error'](_0xb517('0x11'),_0x4f55f7,_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);return _0x23f9e8(_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);}logger[_0xb517('0xf')](_0xb517('0x11'),_0x4f55f7,_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);return _0x3678f9(_0xafd8f7[_0xb517('0xf')][_0xb517('0x12')]);}else{logger[_0xb517('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4f55f7,_0xb517('0xb'));_0x3678f9(_0xafd8f7[_0xb517('0x14')][_0xb517('0x12')]);}})[_0xb517('0x15')](function(_0x7e93db){logger[_0xb517('0xf')](_0xb517('0x11'),_0x4f55f7,_0x7e93db);_0x23f9e8(_0x7e93db);});});}exports['GetSalesforceAccount']=function(_0x229adc){var _0x38de0e=this;return new Promise(function(_0x30e603,_0x3ef0cf){return db['SalesforceAccount']['findAll']({'raw':_0x229adc[_0xb517('0x16')]?_0x229adc['options'][_0xb517('0x17')]===undefined?!![]:![]:!![],'where':_0x229adc[_0xb517('0x16')]?_0x229adc['options'][_0xb517('0x18')]||null:null,'attributes':_0x229adc[_0xb517('0x16')]?_0x229adc[_0xb517('0x16')]['attributes']||null:null,'limit':_0x229adc[_0xb517('0x16')]?_0x229adc[_0xb517('0x16')]['limit']||null:null,'include':_0x229adc[_0xb517('0x16')]?_0x229adc[_0xb517('0x16')]['include']?_[_0xb517('0x19')](_0x229adc['options'][_0xb517('0x1a')],function(_0x8dfcda){return{'model':db[_0x8dfcda['model']],'as':_0x8dfcda['as'],'attributes':_0x8dfcda[_0xb517('0x1b')],'include':_0x8dfcda[_0xb517('0x1a')]?_['map'](_0x8dfcda['include'],function(_0x529cc9){return{'model':db[_0x529cc9[_0xb517('0x1c')]],'as':_0x529cc9['as'],'attributes':_0x529cc9['attributes'],'include':_0x529cc9[_0xb517('0x1a')]?_[_0xb517('0x19')](_0x529cc9[_0xb517('0x1a')],function(_0x4f7f53){return{'model':db[_0x4f7f53['model']],'as':_0x4f7f53['as'],'attributes':_0x4f7f53[_0xb517('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb517('0x1d')](function(_0x57e30a){logger[_0xb517('0x13')](_0xb517('0x1e'),_0x229adc);logger[_0xb517('0xc')](_0xb517('0x1e'),_0x229adc,JSON[_0xb517('0xe')](_0x57e30a));_0x30e603(_0x57e30a);})[_0xb517('0x15')](function(_0xfd2e89){logger[_0xb517('0xf')](_0xb517('0x1e'),_0xfd2e89[_0xb517('0x12')],_0x229adc);_0x3ef0cf(_0x38de0e[_0xb517('0xf')](0x1f4,_0xfd2e89[_0xb517('0x12')]));});});};exports[_0xb517('0x1f')]=function(_0xc467dd){var _0x48777e=this;return new Promise(function(_0x42e78f,_0x2c548e){return db['SalesforceAccount'][_0xb517('0x20')]({'raw':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')][_0xb517('0x18')]||null:null,'attributes':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')][_0xb517('0x1b')]||null:null,'include':_0xc467dd[_0xb517('0x16')]?_0xc467dd[_0xb517('0x16')]['include']?_[_0xb517('0x19')](_0xc467dd[_0xb517('0x16')][_0xb517('0x1a')],function(_0x1695b0){return{'model':db[_0x1695b0[_0xb517('0x1c')]],'as':_0x1695b0['as'],'attributes':_0x1695b0[_0xb517('0x1b')],'include':_0x1695b0[_0xb517('0x1a')]?_[_0xb517('0x19')](_0x1695b0[_0xb517('0x1a')],function(_0x3e1d37){return{'model':db[_0x3e1d37[_0xb517('0x1c')]],'as':_0x3e1d37['as'],'attributes':_0x3e1d37[_0xb517('0x1b')],'include':_0x3e1d37['include']?_[_0xb517('0x19')](_0x3e1d37['include'],function(_0x507c82){return{'model':db[_0x507c82[_0xb517('0x1c')]],'as':_0x507c82['as'],'attributes':_0x507c82['attributes']};}):[]};}):[]};}):[]:[]})[_0xb517('0x1d')](function(_0x3222a8){logger[_0xb517('0x13')](_0xb517('0x1f'),_0xc467dd);logger['debug'](_0xb517('0x1f'),_0xc467dd,JSON[_0xb517('0xe')](_0x3222a8));_0x42e78f(_0x3222a8);})[_0xb517('0x15')](function(_0x4a06e5){logger['error'](_0xb517('0x1f'),_0x4a06e5['message'],_0xc467dd);_0x2c548e(_0x48777e[_0xb517('0xf')](0x1f4,_0x4a06e5[_0xb517('0x12')]));});});}; \ No newline at end of file +var _0xea1b=['stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xea1b,0x1ab));var _0xbea1=function(_0x55c9b5,_0x5126d0){_0x55c9b5=_0x55c9b5-0x0;var _0x1f9198=_0xea1b[_0x55c9b5];return _0x1f9198;};'use strict';var _=require(_0xbea1('0x0'));var util=require(_0xbea1('0x1'));var moment=require(_0xbea1('0x2'));var BPromise=require(_0xbea1('0x3'));var rs=require(_0xbea1('0x4'));var fs=require('fs');var Redis=require(_0xbea1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbea1('0x6'));var logger=require(_0xbea1('0x7'))('rpc');var config=require(_0xbea1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbea1('0x9')][_0xbea1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22e1df,_0x3387ad,_0x897b37){return new BPromise(function(_0x22e315,_0x255547){return client[_0xbea1('0xb')](_0x22e1df,_0x897b37)[_0xbea1('0xc')](function(_0x1db315){logger['info'](_0xbea1('0xd'),_0x3387ad,'request\x20sent');logger[_0xbea1('0xe')](_0xbea1('0xf'),_0x3387ad,_0xbea1('0x10'),JSON[_0xbea1('0x11')](_0x1db315));if(_0x1db315['error']){if(_0x1db315[_0xbea1('0x12')][_0xbea1('0x13')]===0x1f4){logger[_0xbea1('0x12')](_0xbea1('0xd'),_0x3387ad,_0x1db315[_0xbea1('0x12')]['message']);return _0x255547(_0x1db315[_0xbea1('0x12')][_0xbea1('0x14')]);}logger[_0xbea1('0x12')](_0xbea1('0xd'),_0x3387ad,_0x1db315['error'][_0xbea1('0x14')]);return _0x22e315(_0x1db315[_0xbea1('0x12')][_0xbea1('0x14')]);}else{logger[_0xbea1('0x15')](_0xbea1('0xd'),_0x3387ad,'request\x20sent');_0x22e315(_0x1db315[_0xbea1('0x16')]['message']);}})[_0xbea1('0x17')](function(_0x102a5e){logger['error'](_0xbea1('0xd'),_0x3387ad,_0x102a5e);_0x255547(_0x102a5e);});});}exports[_0xbea1('0x18')]=function(_0xfb341a){var _0x3683a7=this;return new Promise(function(_0x56e19b,_0x277678){return db[_0xbea1('0x19')][_0xbea1('0x1a')]({'raw':_0xfb341a[_0xbea1('0x1b')]?_0xfb341a['options'][_0xbea1('0x1c')]===undefined?!![]:![]:!![],'where':_0xfb341a[_0xbea1('0x1b')]?_0xfb341a['options'][_0xbea1('0x1d')]||null:null,'attributes':_0xfb341a['options']?_0xfb341a[_0xbea1('0x1b')][_0xbea1('0x1e')]||null:null,'limit':_0xfb341a['options']?_0xfb341a[_0xbea1('0x1b')][_0xbea1('0x1f')]||null:null,'include':_0xfb341a[_0xbea1('0x1b')]?_0xfb341a[_0xbea1('0x1b')][_0xbea1('0x20')]?_[_0xbea1('0x21')](_0xfb341a[_0xbea1('0x1b')][_0xbea1('0x20')],function(_0x16825c){return{'model':db[_0x16825c[_0xbea1('0x22')]],'as':_0x16825c['as'],'attributes':_0x16825c[_0xbea1('0x1e')],'include':_0x16825c[_0xbea1('0x20')]?_[_0xbea1('0x21')](_0x16825c[_0xbea1('0x20')],function(_0x4a8c01){return{'model':db[_0x4a8c01['model']],'as':_0x4a8c01['as'],'attributes':_0x4a8c01[_0xbea1('0x1e')],'include':_0x4a8c01[_0xbea1('0x20')]?_[_0xbea1('0x21')](_0x4a8c01[_0xbea1('0x20')],function(_0x4a4e90){return{'model':db[_0x4a4e90['model']],'as':_0x4a4e90['as'],'attributes':_0x4a4e90['attributes']};}):[]};}):[]};}):[]:[]})[_0xbea1('0xc')](function(_0x43034c){logger[_0xbea1('0x15')](_0xbea1('0x18'),_0xfb341a);logger[_0xbea1('0xe')](_0xbea1('0x18'),_0xfb341a,JSON[_0xbea1('0x11')](_0x43034c));_0x56e19b(_0x43034c);})[_0xbea1('0x17')](function(_0x1f990c){logger[_0xbea1('0x12')](_0xbea1('0x18'),_0x1f990c[_0xbea1('0x14')],_0xfb341a);_0x277678(_0x3683a7[_0xbea1('0x12')](0x1f4,_0x1f990c[_0xbea1('0x14')]));});});};exports[_0xbea1('0x23')]=function(_0x128f9e){var _0x4ad4e7=this;return new Promise(function(_0x2ffa46,_0x73af60){return db['SalesforceAccount'][_0xbea1('0x24')]({'raw':_0x128f9e[_0xbea1('0x1b')]?_0x128f9e[_0xbea1('0x1b')][_0xbea1('0x1c')]===undefined?!![]:![]:!![],'where':_0x128f9e['options']?_0x128f9e[_0xbea1('0x1b')]['where']||null:null,'attributes':_0x128f9e['options']?_0x128f9e[_0xbea1('0x1b')]['attributes']||null:null,'include':_0x128f9e[_0xbea1('0x1b')]?_0x128f9e[_0xbea1('0x1b')][_0xbea1('0x20')]?_['map'](_0x128f9e[_0xbea1('0x1b')][_0xbea1('0x20')],function(_0x342305){return{'model':db[_0x342305['model']],'as':_0x342305['as'],'attributes':_0x342305[_0xbea1('0x1e')],'include':_0x342305['include']?_[_0xbea1('0x21')](_0x342305[_0xbea1('0x20')],function(_0x364276){return{'model':db[_0x364276['model']],'as':_0x364276['as'],'attributes':_0x364276['attributes'],'include':_0x364276[_0xbea1('0x20')]?_[_0xbea1('0x21')](_0x364276['include'],function(_0x2c4160){return{'model':db[_0x2c4160['model']],'as':_0x2c4160['as'],'attributes':_0x2c4160[_0xbea1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbea1('0xc')](function(_0x2d375e){logger[_0xbea1('0x15')](_0xbea1('0x23'),_0x128f9e);logger[_0xbea1('0xe')](_0xbea1('0x23'),_0x128f9e,JSON[_0xbea1('0x11')](_0x2d375e));_0x2ffa46(_0x2d375e);})[_0xbea1('0x17')](function(_0x1dbb1a){logger[_0xbea1('0x12')](_0xbea1('0x23'),_0x1dbb1a[_0xbea1('0x14')],_0x128f9e);_0x73af60(_0x4ad4e7[_0xbea1('0x12')](0x1f4,_0x1dbb1a['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 4215d6f..d94bc05 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x14c4e8,_0x26888e){var _0x23589f=function(_0x5b24a6){while(--_0x5b24a6){_0x14c4e8['push'](_0x14c4e8['shift']());}};_0x23589f(++_0x26888e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40b7fd,_0x1e8c68){_0x40b7fd=_0x40b7fd-0x0;var _0x4cc91b=_0x5f2f[_0x40b7fd];return _0x4cc91b;};'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/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('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(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdb28,0x106));var _0x8db2=function(_0x4aeb8e,_0x3fa94a){_0x4aeb8e=_0x4aeb8e-0x0;var _0x3d5ab4=_0xdb28[_0x4aeb8e];return _0x3d5ab4;};'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 cc9de59..088e4b4 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 _0x59ef=['STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account','nothing','exports'];(function(_0x4a7906,_0x3ef77d){var _0x558373=function(_0xd892c3){while(--_0xd892c3){_0x4a7906['push'](_0x4a7906['shift']());}};_0x558373(++_0x3ef77d);}(_0x59ef,0x12b));var _0xf59e=function(_0x31e18f,_0x2c41b9){_0x31e18f=_0x31e18f-0x0;var _0xca332b=_0x59ef[_0x31e18f];return _0xca332b;};'use strict';var Sequelize=require('sequelize');module[_0xf59e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf59e('0x1')]},'ticketType':{'type':Sequelize[_0xf59e('0x2')](_0xf59e('0x3'),'Case'),'defaultValue':_0xf59e('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf59e('0x4'),_0xf59e('0x5'),_0xf59e('0x6'),_0xf59e('0x7'),_0xf59e('0x8')),'defaultValue':_0xf59e('0x4')},'moduleCreate':{'type':Sequelize[_0xf59e('0x2')](_0xf59e('0x9'),_0xf59e('0x5'),'lead','account'),'defaultValue':_0xf59e('0x6')},'leadId':{'type':Sequelize[_0xf59e('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xf59e('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5523=['ENUM','Task','contact_lead','contact','account_contact_lead','lead','sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5523,0x96));var _0x3552=function(_0x5beba9,_0x548e84){_0x5beba9=_0x5beba9-0x0;var _0x9ab438=_0x5523[_0x5beba9];return _0x9ab438;};'use strict';var Sequelize=require(_0x3552('0x0'));module[_0x3552('0x1')]={'name':{'type':Sequelize[_0x3552('0x2')]},'description':{'type':Sequelize[_0x3552('0x2')]},'ticketType':{'type':Sequelize[_0x3552('0x3')](_0x3552('0x4'),'Case'),'defaultValue':_0x3552('0x4')},'moduleSearch':{'type':Sequelize[_0x3552('0x3')](_0x3552('0x5'),_0x3552('0x6'),'lead',_0x3552('0x7'),'account'),'defaultValue':_0x3552('0x5')},'moduleCreate':{'type':Sequelize[_0x3552('0x3')]('nothing',_0x3552('0x6'),_0x3552('0x8'),'account'),'defaultValue':_0x3552('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x3552('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x3552('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x3552('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 2fdfdaf..6773924 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 _0xf2d8=['send','index','SalesforceConfiguration','rawAttributes','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','then','includeAll','include','catch','show','params','merge','find','create','body','getFields','findOne','getSubjects','getDescriptions','SalesforceField','eml-format','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','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','status','end','json','undefined','limit','count','offset','set','apply','reject','update','destroy','sendStatus','error','stack','name'];(function(_0x5f0b1b,_0x3d63a6){var _0x5932d7=function(_0x1e6358){while(--_0x1e6358){_0x5f0b1b['push'](_0x5f0b1b['shift']());}};_0x5932d7(++_0x3d63a6);}(_0xf2d8,0xbf));var _0x8f2d=function(_0x23785c,_0x1c6e72){_0x23785c=_0x23785c-0x0;var _0x2dc080=_0xf2d8[_0x23785c];return _0x2dc080;};'use strict';var emlformat=require(_0x8f2d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8f2d('0x1'));var rp=require(_0x8f2d('0x2'));var moment=require('moment');var BPromise=require(_0x8f2d('0x3'));var Mustache=require('mustache');var util=require(_0x8f2d('0x4'));var path=require(_0x8f2d('0x5'));var sox=require('sox');var csv=require(_0x8f2d('0x6'));var ejs=require(_0x8f2d('0x7'));var fs=require('fs');var fs_extra=require(_0x8f2d('0x8'));var _=require(_0x8f2d('0x9'));var squel=require(_0x8f2d('0xa'));var crypto=require(_0x8f2d('0xb'));var jsforce=require(_0x8f2d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8f2d('0x6'));var querystring=require(_0x8f2d('0xd'));var Papa=require(_0x8f2d('0xe'));var Redis=require('ioredis');var authService=require(_0x8f2d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8f2d('0x10'));var hardwareService=require(_0x8f2d('0x11'));var logger=require(_0x8f2d('0x12'))(_0x8f2d('0x13'));var utils=require(_0x8f2d('0x14'));var config=require(_0x8f2d('0x15'));var licenseUtil=require(_0x8f2d('0x16'));var db=require(_0x8f2d('0x17'))['db'];function respondWithStatusCode(_0x249e70,_0x171f6d){_0x171f6d=_0x171f6d||0xcc;return function(_0x44bd23){if(_0x44bd23){return _0x249e70['sendStatus'](_0x171f6d);}return _0x249e70[_0x8f2d('0x18')](_0x171f6d)[_0x8f2d('0x19')]();};}function respondWithResult(_0x5b19f0,_0x36a0f7){_0x36a0f7=_0x36a0f7||0xc8;return function(_0x4caa84){if(_0x4caa84){return _0x5b19f0[_0x8f2d('0x18')](_0x36a0f7)[_0x8f2d('0x1a')](_0x4caa84);}};}function respondWithFilteredResult(_0x49c8a9,_0x4a8c30){return function(_0x264dfa){if(_0x264dfa){var _0x4f343b=typeof _0x4a8c30['offset']===_0x8f2d('0x1b')&&typeof _0x4a8c30[_0x8f2d('0x1c')]==='undefined';var _0x180dc8=_0x264dfa[_0x8f2d('0x1d')];var _0x59ba5b=_0x4f343b?0x0:_0x4a8c30[_0x8f2d('0x1e')];var _0xc045e=_0x4f343b?_0x264dfa[_0x8f2d('0x1d')]:_0x4a8c30[_0x8f2d('0x1e')]+_0x4a8c30[_0x8f2d('0x1c')];var _0xca76e9;if(_0xc045e>=_0x180dc8){_0xc045e=_0x180dc8;_0xca76e9=0xc8;}else{_0xca76e9=0xce;}_0x49c8a9[_0x8f2d('0x18')](_0xca76e9);return _0x49c8a9[_0x8f2d('0x1f')]('Content-Range',_0x59ba5b+'-'+_0xc045e+'/'+_0x180dc8)[_0x8f2d('0x1a')](_0x264dfa);}return null;};}function patchUpdates(_0xfa529a){return function(_0x52e61b){try{jsonpatch[_0x8f2d('0x20')](_0x52e61b,_0xfa529a,!![]);}catch(_0x3e7a94){return BPromise[_0x8f2d('0x21')](_0x3e7a94);}return _0x52e61b['save']();};}function saveUpdates(_0x5c03ab,_0x153ef1){return function(_0x313d57){if(_0x313d57){return _0x313d57[_0x8f2d('0x22')](_0x5c03ab)['then'](function(_0x3694f7){return _0x3694f7;});}return null;};}function removeEntity(_0x2a8750,_0x119f40){return function(_0x1c605d){if(_0x1c605d){return _0x1c605d[_0x8f2d('0x23')]()['then'](function(){_0x2a8750[_0x8f2d('0x18')](0xcc)[_0x8f2d('0x19')]();});}};}function handleEntityNotFound(_0xc7b8d6,_0x3501b6){return function(_0x1f9bcf){if(!_0x1f9bcf){_0xc7b8d6[_0x8f2d('0x24')](0x194);}return _0x1f9bcf;};}function handleError(_0xe35ef9,_0x436911){_0x436911=_0x436911||0x1f4;return function(_0x5ec9fe){logger[_0x8f2d('0x25')](_0x5ec9fe[_0x8f2d('0x26')]);if(_0x5ec9fe[_0x8f2d('0x27')]){delete _0x5ec9fe[_0x8f2d('0x27')];}_0xe35ef9[_0x8f2d('0x18')](_0x436911)[_0x8f2d('0x28')](_0x5ec9fe);};}exports[_0x8f2d('0x29')]=function(_0x4f0fea,_0x585761){var _0x2d5d7a={},_0x4ab04d={},_0x521b13={'count':0x0,'rows':[]};var _0x5d3ad3=_['map'](db[_0x8f2d('0x2a')][_0x8f2d('0x2b')],function(_0xb1c26b){return{'name':_0xb1c26b['fieldName'],'type':_0xb1c26b[_0x8f2d('0x2c')]['key']};});_0x4ab04d[_0x8f2d('0x2d')]=_[_0x8f2d('0x2e')](_0x5d3ad3,_0x8f2d('0x27'));_0x4ab04d['query']=_[_0x8f2d('0x2f')](_0x4f0fea['query']);_0x4ab04d[_0x8f2d('0x30')]=_[_0x8f2d('0x31')](_0x4ab04d['model'],_0x4ab04d[_0x8f2d('0x32')]);_0x2d5d7a[_0x8f2d('0x33')]=_[_0x8f2d('0x31')](_0x4ab04d[_0x8f2d('0x2d')],qs[_0x8f2d('0x34')](_0x4f0fea['query'][_0x8f2d('0x34')]));_0x2d5d7a[_0x8f2d('0x33')]=_0x2d5d7a['attributes'][_0x8f2d('0x35')]?_0x2d5d7a[_0x8f2d('0x33')]:_0x4ab04d[_0x8f2d('0x2d')];if(!_0x4f0fea[_0x8f2d('0x32')][_0x8f2d('0x36')](_0x8f2d('0x37'))){_0x2d5d7a[_0x8f2d('0x1c')]=qs[_0x8f2d('0x1c')](_0x4f0fea[_0x8f2d('0x32')]['limit']);_0x2d5d7a[_0x8f2d('0x1e')]=qs[_0x8f2d('0x1e')](_0x4f0fea[_0x8f2d('0x32')]['offset']);}_0x2d5d7a[_0x8f2d('0x38')]=qs[_0x8f2d('0x39')](_0x4f0fea[_0x8f2d('0x32')][_0x8f2d('0x39')]);_0x2d5d7a[_0x8f2d('0x3a')]=qs[_0x8f2d('0x30')](_[_0x8f2d('0x3b')](_0x4f0fea[_0x8f2d('0x32')],_0x4ab04d['filters']),_0x5d3ad3);if(_0x4f0fea['query'][_0x8f2d('0x3c')]){_0x2d5d7a[_0x8f2d('0x3a')]=_['merge'](_0x2d5d7a[_0x8f2d('0x3a')],{'$or':_['map'](_0x5d3ad3,function(_0x2f1c1c){if(_0x2f1c1c[_0x8f2d('0x2c')]!=='VIRTUAL'){var _0x5e9372={};_0x5e9372[_0x2f1c1c[_0x8f2d('0x27')]]={'$like':'%'+_0x4f0fea[_0x8f2d('0x32')]['filter']+'%'};return _0x5e9372;}})});}_0x2d5d7a=_['merge']({},_0x2d5d7a,_0x4f0fea[_0x8f2d('0x3d')]);var _0x232e8d={'where':_0x2d5d7a[_0x8f2d('0x3a')]};return db[_0x8f2d('0x2a')]['count'](_0x232e8d)[_0x8f2d('0x3e')](function(_0x594f45){_0x521b13[_0x8f2d('0x1d')]=_0x594f45;if(_0x4f0fea[_0x8f2d('0x32')][_0x8f2d('0x3f')]){_0x2d5d7a[_0x8f2d('0x40')]=[{'all':!![]}];}return db[_0x8f2d('0x2a')]['findAll'](_0x2d5d7a);})['then'](function(_0x5f49f3){_0x521b13['rows']=_0x5f49f3;return _0x521b13;})[_0x8f2d('0x3e')](respondWithFilteredResult(_0x585761,_0x2d5d7a))[_0x8f2d('0x41')](handleError(_0x585761,null));};exports[_0x8f2d('0x42')]=function(_0x1458f0,_0x4ada59){var _0x56851b={'raw':![],'where':{'id':_0x1458f0[_0x8f2d('0x43')]['id']}},_0x549313={};_0x549313[_0x8f2d('0x2d')]=_['keys'](db[_0x8f2d('0x2a')][_0x8f2d('0x2b')]);_0x549313[_0x8f2d('0x32')]=_[_0x8f2d('0x2f')](_0x1458f0['query']);_0x549313[_0x8f2d('0x30')]=_[_0x8f2d('0x31')](_0x549313['model'],_0x549313[_0x8f2d('0x32')]);_0x56851b['attributes']=_[_0x8f2d('0x31')](_0x549313[_0x8f2d('0x2d')],qs[_0x8f2d('0x34')](_0x1458f0['query']['fields']));_0x56851b['attributes']=_0x56851b[_0x8f2d('0x33')][_0x8f2d('0x35')]?_0x56851b[_0x8f2d('0x33')]:_0x549313[_0x8f2d('0x2d')];if(_0x1458f0[_0x8f2d('0x32')]['includeAll']){_0x56851b['include']=[{'all':!![]}];}_0x56851b=_[_0x8f2d('0x44')]({},_0x56851b,_0x1458f0['options']);return db[_0x8f2d('0x2a')][_0x8f2d('0x45')](_0x56851b)['then'](handleEntityNotFound(_0x4ada59,null))['then'](respondWithResult(_0x4ada59,null))[_0x8f2d('0x41')](handleError(_0x4ada59,null));};exports[_0x8f2d('0x46')]=function(_0x4053ad,_0x3ef2f3){return db[_0x8f2d('0x2a')][_0x8f2d('0x46')](_0x4053ad[_0x8f2d('0x47')],{})[_0x8f2d('0x3e')](respondWithResult(_0x3ef2f3,0xc9))[_0x8f2d('0x41')](handleError(_0x3ef2f3,null));};exports[_0x8f2d('0x22')]=function(_0xd2b3e0,_0x31b8be){if(_0xd2b3e0[_0x8f2d('0x47')]['id']){delete _0xd2b3e0[_0x8f2d('0x47')]['id'];}return db['SalesforceConfiguration'][_0x8f2d('0x45')]({'where':{'id':_0xd2b3e0[_0x8f2d('0x43')]['id']}})[_0x8f2d('0x3e')](handleEntityNotFound(_0x31b8be,null))[_0x8f2d('0x3e')](saveUpdates(_0xd2b3e0['body'],null))[_0x8f2d('0x3e')](respondWithResult(_0x31b8be,null))['catch'](handleError(_0x31b8be,null));};exports[_0x8f2d('0x23')]=function(_0x6f137b,_0x1385c0){return db['SalesforceConfiguration']['find']({'where':{'id':_0x6f137b[_0x8f2d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1385c0,null))[_0x8f2d('0x3e')](removeEntity(_0x1385c0,null))[_0x8f2d('0x41')](handleError(_0x1385c0,null));};exports[_0x8f2d('0x48')]=function(_0x363ee5,_0x14f3dd,_0x485523){var _0x2cece5={};var _0x217a91={};var _0x142c88;var _0x55cbed;return db[_0x8f2d('0x2a')][_0x8f2d('0x49')]({'where':{'id':_0x363ee5['params']['id']}})[_0x8f2d('0x3e')](handleEntityNotFound(_0x14f3dd,null))[_0x8f2d('0x3e')](function(_0x326708){if(_0x326708){_0x142c88=_0x326708;_0x217a91['model']=_['keys'](db['SalesforceField'][_0x8f2d('0x2b')]);_0x217a91[_0x8f2d('0x32')]=_[_0x8f2d('0x2f')](_0x363ee5[_0x8f2d('0x32')]);_0x217a91[_0x8f2d('0x30')]=_[_0x8f2d('0x31')](_0x217a91['model'],_0x217a91[_0x8f2d('0x32')]);_0x2cece5[_0x8f2d('0x33')]=_[_0x8f2d('0x31')](_0x217a91[_0x8f2d('0x2d')],qs[_0x8f2d('0x34')](_0x363ee5[_0x8f2d('0x32')][_0x8f2d('0x34')]));_0x2cece5[_0x8f2d('0x33')]=_0x2cece5[_0x8f2d('0x33')][_0x8f2d('0x35')]?_0x2cece5[_0x8f2d('0x33')]:_0x217a91['model'];_0x2cece5[_0x8f2d('0x38')]=qs[_0x8f2d('0x39')](_0x363ee5[_0x8f2d('0x32')]['sort']);_0x2cece5[_0x8f2d('0x3a')]=qs[_0x8f2d('0x30')](_[_0x8f2d('0x3b')](_0x363ee5['query'],_0x217a91[_0x8f2d('0x30')]));if(_0x363ee5['query']['filter']){_0x2cece5[_0x8f2d('0x3a')]=_[_0x8f2d('0x44')](_0x2cece5['where'],{'$or':_[_0x8f2d('0x2e')](_0x2cece5['attributes'],function(_0x5247cf){var _0x33fc91={};_0x33fc91[_0x5247cf]={'$like':'%'+_0x363ee5[_0x8f2d('0x32')][_0x8f2d('0x3c')]+'%'};return _0x33fc91;})});}_0x2cece5=_[_0x8f2d('0x44')]({},_0x2cece5,_0x363ee5[_0x8f2d('0x3d')]);return _0x142c88[_0x8f2d('0x48')](_0x2cece5);}})['then'](function(_0x4c6c9f){if(_0x4c6c9f){_0x55cbed=_0x4c6c9f['length'];if(!_0x363ee5[_0x8f2d('0x32')][_0x8f2d('0x36')]('nolimit')){_0x2cece5[_0x8f2d('0x1c')]=qs[_0x8f2d('0x1c')](_0x363ee5[_0x8f2d('0x32')][_0x8f2d('0x1c')]);_0x2cece5[_0x8f2d('0x1e')]=qs['offset'](_0x363ee5[_0x8f2d('0x32')]['offset']);}return _0x142c88['getFields'](_0x2cece5);}})[_0x8f2d('0x3e')](function(_0x2595e2){if(_0x2595e2){return _0x2595e2?{'count':_0x55cbed,'rows':_0x2595e2}:null;}})[_0x8f2d('0x3e')](respondWithResult(_0x14f3dd,null))[_0x8f2d('0x41')](handleError(_0x14f3dd,null));};exports[_0x8f2d('0x4a')]=function(_0x5d62ef,_0xfdcaa9,_0x529b44){var _0x8fabad={};var _0x510385={};var _0x30394b;var _0x1312d2;return db[_0x8f2d('0x2a')][_0x8f2d('0x49')]({'where':{'id':_0x5d62ef[_0x8f2d('0x43')]['id']}})[_0x8f2d('0x3e')](handleEntityNotFound(_0xfdcaa9,null))[_0x8f2d('0x3e')](function(_0x5aafb){if(_0x5aafb){_0x30394b=_0x5aafb;_0x510385[_0x8f2d('0x2d')]=_[_0x8f2d('0x2f')](db['SalesforceField']['rawAttributes']);_0x510385[_0x8f2d('0x32')]=_['keys'](_0x5d62ef[_0x8f2d('0x32')]);_0x510385[_0x8f2d('0x30')]=_['intersection'](_0x510385[_0x8f2d('0x2d')],_0x510385[_0x8f2d('0x32')]);_0x8fabad[_0x8f2d('0x33')]=_['intersection'](_0x510385[_0x8f2d('0x2d')],qs[_0x8f2d('0x34')](_0x5d62ef[_0x8f2d('0x32')][_0x8f2d('0x34')]));_0x8fabad['attributes']=_0x8fabad[_0x8f2d('0x33')][_0x8f2d('0x35')]?_0x8fabad[_0x8f2d('0x33')]:_0x510385[_0x8f2d('0x2d')];_0x8fabad['order']=qs['sort'](_0x5d62ef[_0x8f2d('0x32')][_0x8f2d('0x39')]);_0x8fabad[_0x8f2d('0x3a')]=qs[_0x8f2d('0x30')](_[_0x8f2d('0x3b')](_0x5d62ef[_0x8f2d('0x32')],_0x510385[_0x8f2d('0x30')]));if(_0x5d62ef[_0x8f2d('0x32')][_0x8f2d('0x3c')]){_0x8fabad[_0x8f2d('0x3a')]=_[_0x8f2d('0x44')](_0x8fabad[_0x8f2d('0x3a')],{'$or':_['map'](_0x8fabad[_0x8f2d('0x33')],function(_0x308969){var _0xcdca91={};_0xcdca91[_0x308969]={'$like':'%'+_0x5d62ef[_0x8f2d('0x32')]['filter']+'%'};return _0xcdca91;})});}_0x8fabad=_[_0x8f2d('0x44')]({},_0x8fabad,_0x5d62ef[_0x8f2d('0x3d')]);return _0x30394b[_0x8f2d('0x4a')](_0x8fabad);}})[_0x8f2d('0x3e')](function(_0x21fa6f){if(_0x21fa6f){_0x1312d2=_0x21fa6f['length'];if(!_0x5d62ef['query']['hasOwnProperty'](_0x8f2d('0x37'))){_0x8fabad['limit']=qs[_0x8f2d('0x1c')](_0x5d62ef[_0x8f2d('0x32')][_0x8f2d('0x1c')]);_0x8fabad['offset']=qs['offset'](_0x5d62ef['query']['offset']);}return _0x30394b[_0x8f2d('0x4a')](_0x8fabad);}})[_0x8f2d('0x3e')](function(_0xcc32b){if(_0xcc32b){return _0xcc32b?{'count':_0x1312d2,'rows':_0xcc32b}:null;}})[_0x8f2d('0x3e')](respondWithResult(_0xfdcaa9,null))[_0x8f2d('0x41')](handleError(_0xfdcaa9,null));};exports[_0x8f2d('0x4b')]=function(_0x3ea58a,_0x48683f,_0x283745){var _0x541dda={};var _0x14f9a8={};var _0x25773a;var _0x4261cc;return db[_0x8f2d('0x2a')][_0x8f2d('0x49')]({'where':{'id':_0x3ea58a['params']['id']}})[_0x8f2d('0x3e')](handleEntityNotFound(_0x48683f,null))['then'](function(_0x41fe20){if(_0x41fe20){_0x25773a=_0x41fe20;_0x14f9a8[_0x8f2d('0x2d')]=_[_0x8f2d('0x2f')](db[_0x8f2d('0x4c')][_0x8f2d('0x2b')]);_0x14f9a8[_0x8f2d('0x32')]=_[_0x8f2d('0x2f')](_0x3ea58a[_0x8f2d('0x32')]);_0x14f9a8['filters']=_[_0x8f2d('0x31')](_0x14f9a8[_0x8f2d('0x2d')],_0x14f9a8[_0x8f2d('0x32')]);_0x541dda[_0x8f2d('0x33')]=_[_0x8f2d('0x31')](_0x14f9a8[_0x8f2d('0x2d')],qs[_0x8f2d('0x34')](_0x3ea58a['query'][_0x8f2d('0x34')]));_0x541dda[_0x8f2d('0x33')]=_0x541dda[_0x8f2d('0x33')][_0x8f2d('0x35')]?_0x541dda[_0x8f2d('0x33')]:_0x14f9a8[_0x8f2d('0x2d')];_0x541dda[_0x8f2d('0x38')]=qs['sort'](_0x3ea58a['query'][_0x8f2d('0x39')]);_0x541dda[_0x8f2d('0x3a')]=qs[_0x8f2d('0x30')](_[_0x8f2d('0x3b')](_0x3ea58a['query'],_0x14f9a8[_0x8f2d('0x30')]));if(_0x3ea58a['query'][_0x8f2d('0x3c')]){_0x541dda['where']=_[_0x8f2d('0x44')](_0x541dda[_0x8f2d('0x3a')],{'$or':_['map'](_0x541dda['attributes'],function(_0x430067){var _0x1748cb={};_0x1748cb[_0x430067]={'$like':'%'+_0x3ea58a[_0x8f2d('0x32')][_0x8f2d('0x3c')]+'%'};return _0x1748cb;})});}_0x541dda=_['merge']({},_0x541dda,_0x3ea58a[_0x8f2d('0x3d')]);return _0x25773a[_0x8f2d('0x4b')](_0x541dda);}})[_0x8f2d('0x3e')](function(_0x8692b7){if(_0x8692b7){_0x4261cc=_0x8692b7[_0x8f2d('0x35')];if(!_0x3ea58a[_0x8f2d('0x32')][_0x8f2d('0x36')]('nolimit')){_0x541dda[_0x8f2d('0x1c')]=qs[_0x8f2d('0x1c')](_0x3ea58a['query'][_0x8f2d('0x1c')]);_0x541dda[_0x8f2d('0x1e')]=qs['offset'](_0x3ea58a[_0x8f2d('0x32')][_0x8f2d('0x1e')]);}return _0x25773a[_0x8f2d('0x4b')](_0x541dda);}})[_0x8f2d('0x3e')](function(_0x55d9e3){if(_0x55d9e3){return _0x55d9e3?{'count':_0x4261cc,'rows':_0x55d9e3}:null;}})['then'](respondWithResult(_0x48683f,null))[_0x8f2d('0x41')](handleError(_0x48683f,null));}; \ No newline at end of file +var _0x2c59=['findOne','order','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','SalesforceConfiguration','findAll','rows','catch','params','length','options','find','create','update','body','getFields','SalesforceField','pick','getSubjects'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c59,0x1e9));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x92c5('0x0'));var rimraf=require(_0x92c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x92c5('0x2'));var rp=require('request-promise');var moment=require(_0x92c5('0x3'));var BPromise=require(_0x92c5('0x4'));var Mustache=require(_0x92c5('0x5'));var util=require(_0x92c5('0x6'));var path=require(_0x92c5('0x7'));var sox=require(_0x92c5('0x8'));var csv=require(_0x92c5('0x9'));var ejs=require(_0x92c5('0xa'));var fs=require('fs');var fs_extra=require(_0x92c5('0xb'));var _=require(_0x92c5('0xc'));var squel=require(_0x92c5('0xd'));var crypto=require(_0x92c5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x92c5('0xf'));var toCsv=require(_0x92c5('0x9'));var querystring=require(_0x92c5('0x10'));var Papa=require(_0x92c5('0x11'));var Redis=require(_0x92c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x92c5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x92c5('0x14'))(_0x92c5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x92c5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cfa0f,_0x59d040){_0x59d040=_0x59d040||0xcc;return function(_0x300251){if(_0x300251){return _0x1cfa0f[_0x92c5('0x17')](_0x59d040);}return _0x1cfa0f[_0x92c5('0x18')](_0x59d040)[_0x92c5('0x19')]();};}function respondWithResult(_0x4d64f5,_0x1ddd22){_0x1ddd22=_0x1ddd22||0xc8;return function(_0x4dc9e8){if(_0x4dc9e8){return _0x4d64f5[_0x92c5('0x18')](_0x1ddd22)['json'](_0x4dc9e8);}};}function respondWithFilteredResult(_0x59f1b9,_0x45d6ef){return function(_0x125029){if(_0x125029){var _0x22bddc=typeof _0x45d6ef[_0x92c5('0x1a')]===_0x92c5('0x1b')&&typeof _0x45d6ef[_0x92c5('0x1c')]===_0x92c5('0x1b');var _0x43521=_0x125029[_0x92c5('0x1d')];var _0x26ad10=_0x22bddc?0x0:_0x45d6ef[_0x92c5('0x1a')];var _0xf1116c=_0x22bddc?_0x125029[_0x92c5('0x1d')]:_0x45d6ef['offset']+_0x45d6ef[_0x92c5('0x1c')];var _0x7ecf74;if(_0xf1116c>=_0x43521){_0xf1116c=_0x43521;_0x7ecf74=0xc8;}else{_0x7ecf74=0xce;}_0x59f1b9[_0x92c5('0x18')](_0x7ecf74);return _0x59f1b9[_0x92c5('0x1e')]('Content-Range',_0x26ad10+'-'+_0xf1116c+'/'+_0x43521)[_0x92c5('0x1f')](_0x125029);}return null;};}function patchUpdates(_0x27d227){return function(_0x18f94f){try{jsonpatch[_0x92c5('0x20')](_0x18f94f,_0x27d227,!![]);}catch(_0x11c986){return BPromise[_0x92c5('0x21')](_0x11c986);}return _0x18f94f[_0x92c5('0x22')]();};}function saveUpdates(_0xf237d2,_0x5c76ed){return function(_0x5cbbdb){if(_0x5cbbdb){return _0x5cbbdb['update'](_0xf237d2)[_0x92c5('0x23')](function(_0xb3fbb5){return _0xb3fbb5;});}return null;};}function removeEntity(_0x378cdd,_0x2e8fdf){return function(_0x473eef){if(_0x473eef){return _0x473eef[_0x92c5('0x24')]()[_0x92c5('0x23')](function(){_0x378cdd[_0x92c5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5630f5,_0x41b048){return function(_0x1ac390){if(!_0x1ac390){_0x5630f5['sendStatus'](0x194);}return _0x1ac390;};}function handleError(_0x33b0f5,_0x373a35){_0x373a35=_0x373a35||0x1f4;return function(_0x4dbcd8){logger[_0x92c5('0x25')](_0x4dbcd8[_0x92c5('0x26')]);if(_0x4dbcd8[_0x92c5('0x27')]){delete _0x4dbcd8[_0x92c5('0x27')];}_0x33b0f5[_0x92c5('0x18')](_0x373a35)[_0x92c5('0x28')](_0x4dbcd8);};}exports[_0x92c5('0x29')]=function(_0x2d2d9a,_0x9dc19){var _0x435e95={},_0x51107e={},_0x1856d0={'count':0x0,'rows':[]};var _0x10f262=_[_0x92c5('0x2a')](db['SalesforceConfiguration'][_0x92c5('0x2b')],function(_0x51101e){return{'name':_0x51101e[_0x92c5('0x2c')],'type':_0x51101e[_0x92c5('0x2d')][_0x92c5('0x2e')]};});_0x51107e['model']=_['map'](_0x10f262,_0x92c5('0x27'));_0x51107e[_0x92c5('0x2f')]=_[_0x92c5('0x30')](_0x2d2d9a[_0x92c5('0x2f')]);_0x51107e[_0x92c5('0x31')]=_[_0x92c5('0x32')](_0x51107e[_0x92c5('0x33')],_0x51107e[_0x92c5('0x2f')]);_0x435e95[_0x92c5('0x34')]=_['intersection'](_0x51107e[_0x92c5('0x33')],qs[_0x92c5('0x35')](_0x2d2d9a['query'][_0x92c5('0x35')]));_0x435e95[_0x92c5('0x34')]=_0x435e95[_0x92c5('0x34')]['length']?_0x435e95[_0x92c5('0x34')]:_0x51107e[_0x92c5('0x33')];if(!_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x36')](_0x92c5('0x37'))){_0x435e95['limit']=qs[_0x92c5('0x1c')](_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x1c')]);_0x435e95[_0x92c5('0x1a')]=qs[_0x92c5('0x1a')](_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x1a')]);}_0x435e95['order']=qs[_0x92c5('0x38')](_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x38')]);_0x435e95[_0x92c5('0x39')]=qs['filters'](_['pick'](_0x2d2d9a[_0x92c5('0x2f')],_0x51107e[_0x92c5('0x31')]),_0x10f262);if(_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x3a')]){_0x435e95[_0x92c5('0x39')]=_[_0x92c5('0x3b')](_0x435e95['where'],{'$or':_['map'](_0x10f262,function(_0x5ca12e){if(_0x5ca12e[_0x92c5('0x2d')]!==_0x92c5('0x3c')){var _0x1f7136={};_0x1f7136[_0x5ca12e['name']]={'$like':'%'+_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x3a')]+'%'};return _0x1f7136;}})});}_0x435e95=_[_0x92c5('0x3b')]({},_0x435e95,_0x2d2d9a['options']);var _0x45b45d={'where':_0x435e95['where']};return db['SalesforceConfiguration'][_0x92c5('0x1d')](_0x45b45d)['then'](function(_0x43d658){_0x1856d0[_0x92c5('0x1d')]=_0x43d658;if(_0x2d2d9a[_0x92c5('0x2f')][_0x92c5('0x3d')]){_0x435e95[_0x92c5('0x3e')]=[{'all':!![]}];}return db[_0x92c5('0x3f')][_0x92c5('0x40')](_0x435e95);})['then'](function(_0x162e0c){_0x1856d0[_0x92c5('0x41')]=_0x162e0c;return _0x1856d0;})[_0x92c5('0x23')](respondWithFilteredResult(_0x9dc19,_0x435e95))[_0x92c5('0x42')](handleError(_0x9dc19,null));};exports['show']=function(_0x3645e9,_0x4d5749){var _0x19a541={'raw':![],'where':{'id':_0x3645e9[_0x92c5('0x43')]['id']}},_0x5ddd3e={};_0x5ddd3e['model']=_['keys'](db[_0x92c5('0x3f')][_0x92c5('0x2b')]);_0x5ddd3e[_0x92c5('0x2f')]=_[_0x92c5('0x30')](_0x3645e9[_0x92c5('0x2f')]);_0x5ddd3e[_0x92c5('0x31')]=_['intersection'](_0x5ddd3e[_0x92c5('0x33')],_0x5ddd3e[_0x92c5('0x2f')]);_0x19a541['attributes']=_['intersection'](_0x5ddd3e[_0x92c5('0x33')],qs[_0x92c5('0x35')](_0x3645e9[_0x92c5('0x2f')][_0x92c5('0x35')]));_0x19a541[_0x92c5('0x34')]=_0x19a541[_0x92c5('0x34')][_0x92c5('0x44')]?_0x19a541[_0x92c5('0x34')]:_0x5ddd3e[_0x92c5('0x33')];if(_0x3645e9[_0x92c5('0x2f')][_0x92c5('0x3d')]){_0x19a541[_0x92c5('0x3e')]=[{'all':!![]}];}_0x19a541=_[_0x92c5('0x3b')]({},_0x19a541,_0x3645e9[_0x92c5('0x45')]);return db[_0x92c5('0x3f')][_0x92c5('0x46')](_0x19a541)[_0x92c5('0x23')](handleEntityNotFound(_0x4d5749,null))[_0x92c5('0x23')](respondWithResult(_0x4d5749,null))[_0x92c5('0x42')](handleError(_0x4d5749,null));};exports[_0x92c5('0x47')]=function(_0x30db1b,_0x7974eb){return db[_0x92c5('0x3f')][_0x92c5('0x47')](_0x30db1b['body'],{})['then'](respondWithResult(_0x7974eb,0xc9))[_0x92c5('0x42')](handleError(_0x7974eb,null));};exports[_0x92c5('0x48')]=function(_0x41eb40,_0x363b54){if(_0x41eb40['body']['id']){delete _0x41eb40[_0x92c5('0x49')]['id'];}return db[_0x92c5('0x3f')][_0x92c5('0x46')]({'where':{'id':_0x41eb40[_0x92c5('0x43')]['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0x363b54,null))['then'](saveUpdates(_0x41eb40[_0x92c5('0x49')],null))[_0x92c5('0x23')](respondWithResult(_0x363b54,null))['catch'](handleError(_0x363b54,null));};exports[_0x92c5('0x24')]=function(_0x2ec34d,_0x364179){return db['SalesforceConfiguration'][_0x92c5('0x46')]({'where':{'id':_0x2ec34d[_0x92c5('0x43')]['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0x364179,null))[_0x92c5('0x23')](removeEntity(_0x364179,null))[_0x92c5('0x42')](handleError(_0x364179,null));};exports[_0x92c5('0x4a')]=function(_0x4d740c,_0x5cf173,_0x1e2342){var _0x182a32={};var _0x2a065d={};var _0x2078ec;var _0x559161;return db[_0x92c5('0x3f')]['findOne']({'where':{'id':_0x4d740c[_0x92c5('0x43')]['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0x5cf173,null))[_0x92c5('0x23')](function(_0x182d7b){if(_0x182d7b){_0x2078ec=_0x182d7b;_0x2a065d[_0x92c5('0x33')]=_[_0x92c5('0x30')](db[_0x92c5('0x4b')][_0x92c5('0x2b')]);_0x2a065d['query']=_[_0x92c5('0x30')](_0x4d740c[_0x92c5('0x2f')]);_0x2a065d[_0x92c5('0x31')]=_[_0x92c5('0x32')](_0x2a065d[_0x92c5('0x33')],_0x2a065d[_0x92c5('0x2f')]);_0x182a32[_0x92c5('0x34')]=_[_0x92c5('0x32')](_0x2a065d['model'],qs['fields'](_0x4d740c[_0x92c5('0x2f')][_0x92c5('0x35')]));_0x182a32[_0x92c5('0x34')]=_0x182a32[_0x92c5('0x34')]['length']?_0x182a32[_0x92c5('0x34')]:_0x2a065d['model'];_0x182a32['order']=qs['sort'](_0x4d740c['query'][_0x92c5('0x38')]);_0x182a32['where']=qs[_0x92c5('0x31')](_[_0x92c5('0x4c')](_0x4d740c[_0x92c5('0x2f')],_0x2a065d[_0x92c5('0x31')]));if(_0x4d740c[_0x92c5('0x2f')][_0x92c5('0x3a')]){_0x182a32[_0x92c5('0x39')]=_['merge'](_0x182a32[_0x92c5('0x39')],{'$or':_[_0x92c5('0x2a')](_0x182a32[_0x92c5('0x34')],function(_0x40f2a3){var _0x41d148={};_0x41d148[_0x40f2a3]={'$like':'%'+_0x4d740c['query'][_0x92c5('0x3a')]+'%'};return _0x41d148;})});}_0x182a32=_[_0x92c5('0x3b')]({},_0x182a32,_0x4d740c['options']);return _0x2078ec[_0x92c5('0x4a')](_0x182a32);}})[_0x92c5('0x23')](function(_0x21d720){if(_0x21d720){_0x559161=_0x21d720['length'];if(!_0x4d740c[_0x92c5('0x2f')][_0x92c5('0x36')](_0x92c5('0x37'))){_0x182a32[_0x92c5('0x1c')]=qs[_0x92c5('0x1c')](_0x4d740c[_0x92c5('0x2f')][_0x92c5('0x1c')]);_0x182a32[_0x92c5('0x1a')]=qs[_0x92c5('0x1a')](_0x4d740c[_0x92c5('0x2f')][_0x92c5('0x1a')]);}return _0x2078ec[_0x92c5('0x4a')](_0x182a32);}})['then'](function(_0x2ae1cd){if(_0x2ae1cd){return _0x2ae1cd?{'count':_0x559161,'rows':_0x2ae1cd}:null;}})[_0x92c5('0x23')](respondWithResult(_0x5cf173,null))[_0x92c5('0x42')](handleError(_0x5cf173,null));};exports[_0x92c5('0x4d')]=function(_0x346611,_0x466e0f,_0x564b9c){var _0x3dbbe9={};var _0x444063={};var _0x3b7e0d;var _0xb339b0;return db['SalesforceConfiguration'][_0x92c5('0x4e')]({'where':{'id':_0x346611['params']['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0x466e0f,null))[_0x92c5('0x23')](function(_0x27fd21){if(_0x27fd21){_0x3b7e0d=_0x27fd21;_0x444063[_0x92c5('0x33')]=_[_0x92c5('0x30')](db[_0x92c5('0x4b')]['rawAttributes']);_0x444063['query']=_[_0x92c5('0x30')](_0x346611[_0x92c5('0x2f')]);_0x444063[_0x92c5('0x31')]=_[_0x92c5('0x32')](_0x444063[_0x92c5('0x33')],_0x444063[_0x92c5('0x2f')]);_0x3dbbe9[_0x92c5('0x34')]=_[_0x92c5('0x32')](_0x444063[_0x92c5('0x33')],qs[_0x92c5('0x35')](_0x346611[_0x92c5('0x2f')][_0x92c5('0x35')]));_0x3dbbe9['attributes']=_0x3dbbe9['attributes']['length']?_0x3dbbe9['attributes']:_0x444063[_0x92c5('0x33')];_0x3dbbe9[_0x92c5('0x4f')]=qs[_0x92c5('0x38')](_0x346611[_0x92c5('0x2f')][_0x92c5('0x38')]);_0x3dbbe9[_0x92c5('0x39')]=qs['filters'](_['pick'](_0x346611[_0x92c5('0x2f')],_0x444063[_0x92c5('0x31')]));if(_0x346611[_0x92c5('0x2f')][_0x92c5('0x3a')]){_0x3dbbe9[_0x92c5('0x39')]=_[_0x92c5('0x3b')](_0x3dbbe9[_0x92c5('0x39')],{'$or':_[_0x92c5('0x2a')](_0x3dbbe9[_0x92c5('0x34')],function(_0x165d7a){var _0x333b8e={};_0x333b8e[_0x165d7a]={'$like':'%'+_0x346611[_0x92c5('0x2f')]['filter']+'%'};return _0x333b8e;})});}_0x3dbbe9=_[_0x92c5('0x3b')]({},_0x3dbbe9,_0x346611[_0x92c5('0x45')]);return _0x3b7e0d[_0x92c5('0x4d')](_0x3dbbe9);}})[_0x92c5('0x23')](function(_0x17b325){if(_0x17b325){_0xb339b0=_0x17b325['length'];if(!_0x346611[_0x92c5('0x2f')][_0x92c5('0x36')](_0x92c5('0x37'))){_0x3dbbe9[_0x92c5('0x1c')]=qs['limit'](_0x346611[_0x92c5('0x2f')]['limit']);_0x3dbbe9[_0x92c5('0x1a')]=qs[_0x92c5('0x1a')](_0x346611['query']['offset']);}return _0x3b7e0d[_0x92c5('0x4d')](_0x3dbbe9);}})[_0x92c5('0x23')](function(_0xe908fe){if(_0xe908fe){return _0xe908fe?{'count':_0xb339b0,'rows':_0xe908fe}:null;}})[_0x92c5('0x23')](respondWithResult(_0x466e0f,null))[_0x92c5('0x42')](handleError(_0x466e0f,null));};exports[_0x92c5('0x50')]=function(_0x47a9ac,_0x49f737,_0x3d5224){var _0x314df4={};var _0x5bb301={};var _0x419257;var _0x59080a;return db[_0x92c5('0x3f')][_0x92c5('0x4e')]({'where':{'id':_0x47a9ac['params']['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0x49f737,null))['then'](function(_0x31ab7a){if(_0x31ab7a){_0x419257=_0x31ab7a;_0x5bb301[_0x92c5('0x33')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x5bb301[_0x92c5('0x2f')]=_[_0x92c5('0x30')](_0x47a9ac[_0x92c5('0x2f')]);_0x5bb301[_0x92c5('0x31')]=_[_0x92c5('0x32')](_0x5bb301[_0x92c5('0x33')],_0x5bb301[_0x92c5('0x2f')]);_0x314df4[_0x92c5('0x34')]=_['intersection'](_0x5bb301['model'],qs[_0x92c5('0x35')](_0x47a9ac[_0x92c5('0x2f')]['fields']));_0x314df4[_0x92c5('0x34')]=_0x314df4[_0x92c5('0x34')][_0x92c5('0x44')]?_0x314df4[_0x92c5('0x34')]:_0x5bb301['model'];_0x314df4['order']=qs[_0x92c5('0x38')](_0x47a9ac[_0x92c5('0x2f')][_0x92c5('0x38')]);_0x314df4[_0x92c5('0x39')]=qs[_0x92c5('0x31')](_[_0x92c5('0x4c')](_0x47a9ac[_0x92c5('0x2f')],_0x5bb301[_0x92c5('0x31')]));if(_0x47a9ac[_0x92c5('0x2f')][_0x92c5('0x3a')]){_0x314df4['where']=_['merge'](_0x314df4[_0x92c5('0x39')],{'$or':_[_0x92c5('0x2a')](_0x314df4[_0x92c5('0x34')],function(_0x48d2af){var _0x14f7cf={};_0x14f7cf[_0x48d2af]={'$like':'%'+_0x47a9ac[_0x92c5('0x2f')][_0x92c5('0x3a')]+'%'};return _0x14f7cf;})});}_0x314df4=_['merge']({},_0x314df4,_0x47a9ac['options']);return _0x419257[_0x92c5('0x50')](_0x314df4);}})[_0x92c5('0x23')](function(_0x25a8f4){if(_0x25a8f4){_0x59080a=_0x25a8f4['length'];if(!_0x47a9ac[_0x92c5('0x2f')][_0x92c5('0x36')](_0x92c5('0x37'))){_0x314df4[_0x92c5('0x1c')]=qs[_0x92c5('0x1c')](_0x47a9ac[_0x92c5('0x2f')][_0x92c5('0x1c')]);_0x314df4[_0x92c5('0x1a')]=qs['offset'](_0x47a9ac[_0x92c5('0x2f')][_0x92c5('0x1a')]);}return _0x419257[_0x92c5('0x50')](_0x314df4);}})[_0x92c5('0x23')](function(_0x12a604){if(_0x12a604){return _0x12a604?{'count':_0x59080a,'rows':_0x12a604}:null;}})[_0x92c5('0x23')](respondWithResult(_0x49f737,null))['catch'](handleError(_0x49f737,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7553c36..f1cc892 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 _0x50a4=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x11300b,_0x49c0ff){var _0x51e51b=function(_0x2a814b){while(--_0x2a814b){_0x11300b['push'](_0x11300b['shift']());}};_0x51e51b(++_0x49c0ff);}(_0x50a4,0x6e));var _0x450a=function(_0x4cc924,_0x23fc42){_0x4cc924=_0x4cc924-0x0;var _0xb2d3b=_0x50a4[_0x4cc924];return _0xb2d3b;};'use strict';var _=require(_0x450a('0x0'));var util=require(_0x450a('0x1'));var logger=require(_0x450a('0x2'))(_0x450a('0x3'));var moment=require('moment');var BPromise=require(_0x450a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x450a('0x5'));var rimraf=require(_0x450a('0x6'));var config=require(_0x450a('0x7'));var attributes=require(_0x450a('0x8'));module[_0x450a('0x9')]=function(_0xfc28f7,_0x24f76e){return _0xfc28f7[_0x450a('0xa')](_0x450a('0xb'),attributes,{'tableName':_0x450a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33f7=['./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x33f7,0x176));var _0x733f=function(_0x34f9a6,_0x4bf60b){_0x34f9a6=_0x34f9a6-0x0;var _0x5a94a2=_0x33f7[_0x34f9a6];return _0x5a94a2;};'use strict';var _=require(_0x733f('0x0'));var util=require(_0x733f('0x1'));var logger=require('../../config/logger')(_0x733f('0x2'));var moment=require('moment');var BPromise=require(_0x733f('0x3'));var rp=require(_0x733f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x733f('0x5'));var config=require('../../config/environment');var attributes=require(_0x733f('0x6'));module[_0x733f('0x7')]=function(_0x5e57d0,_0x2361fb){return _0x5e57d0['define'](_0x733f('0x8'),attributes,{'tableName':_0x733f('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 b3224bf..d905fc6 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 _0xaa01=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x11b3e4,_0x5a07a4){var _0x28b6bc=function(_0x2c3d0a){while(--_0x2c3d0a){_0x11b3e4['push'](_0x11b3e4['shift']());}};_0x28b6bc(++_0x5a07a4);}(_0xaa01,0x1e9));var _0x1aa0=function(_0x25016e,_0x29a019){_0x25016e=_0x25016e-0x0;var _0x3c58c2=_0xaa01[_0x25016e];return _0x3c58c2;};'use strict';var _=require(_0x1aa0('0x0'));var util=require(_0x1aa0('0x1'));var moment=require(_0x1aa0('0x2'));var BPromise=require(_0x1aa0('0x3'));var rs=require(_0x1aa0('0x4'));var fs=require('fs');var Redis=require(_0x1aa0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1aa0('0x6'));var logger=require(_0x1aa0('0x7'))(_0x1aa0('0x8'));var config=require(_0x1aa0('0x9'));var jayson=require(_0x1aa0('0xa'));var client=jayson[_0x1aa0('0xb')][_0x1aa0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51ad0e,_0x8e44c5,_0xc39734){return new BPromise(function(_0x14ca12,_0xbb96fe){return client[_0x1aa0('0xd')](_0x51ad0e,_0xc39734)[_0x1aa0('0xe')](function(_0x31cabe){logger[_0x1aa0('0xf')](_0x1aa0('0x10'),_0x8e44c5,_0x1aa0('0x11'));logger[_0x1aa0('0x12')](_0x1aa0('0x13'),_0x8e44c5,_0x1aa0('0x11'),JSON['stringify'](_0x31cabe));if(_0x31cabe[_0x1aa0('0x14')]){if(_0x31cabe[_0x1aa0('0x14')][_0x1aa0('0x15')]===0x1f4){logger[_0x1aa0('0x14')](_0x1aa0('0x10'),_0x8e44c5,_0x31cabe[_0x1aa0('0x14')][_0x1aa0('0x16')]);return _0xbb96fe(_0x31cabe[_0x1aa0('0x14')][_0x1aa0('0x16')]);}logger[_0x1aa0('0x14')](_0x1aa0('0x10'),_0x8e44c5,_0x31cabe['error'][_0x1aa0('0x16')]);return _0x14ca12(_0x31cabe['error']['message']);}else{logger[_0x1aa0('0xf')](_0x1aa0('0x10'),_0x8e44c5,_0x1aa0('0x11'));_0x14ca12(_0x31cabe['result'][_0x1aa0('0x16')]);}})[_0x1aa0('0x17')](function(_0x78e03d){logger[_0x1aa0('0x14')](_0x1aa0('0x10'),_0x8e44c5,_0x78e03d);_0xbb96fe(_0x78e03d);});});} \ No newline at end of file +var _0xac88=['error','code','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4fac0e,_0x21fec9){var _0x1f90c3=function(_0x3ce96f){while(--_0x3ce96f){_0x4fac0e['push'](_0x4fac0e['shift']());}};_0x1f90c3(++_0x21fec9);}(_0xac88,0xa5));var _0x8ac8=function(_0x5909bf,_0x3677d4){_0x5909bf=_0x5909bf-0x0;var _0x7f5c0d=_0xac88[_0x5909bf];return _0x7f5c0d;};'use strict';var _=require('lodash');var util=require(_0x8ac8('0x0'));var moment=require('moment');var BPromise=require(_0x8ac8('0x1'));var rs=require(_0x8ac8('0x2'));var fs=require('fs');var Redis=require(_0x8ac8('0x3'));var db=require(_0x8ac8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ac8('0x5'))(_0x8ac8('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ac8('0x7'));var client=jayson[_0x8ac8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd43d,_0x412af1,_0x322f62){return new BPromise(function(_0x3659f4,_0x45dc82){return client[_0x8ac8('0x9')](_0x1bd43d,_0x322f62)['then'](function(_0x15d681){logger[_0x8ac8('0xa')](_0x8ac8('0xb'),_0x412af1,'request\x20sent');logger[_0x8ac8('0xc')](_0x8ac8('0xd'),_0x412af1,'request\x20sent',JSON[_0x8ac8('0xe')](_0x15d681));if(_0x15d681[_0x8ac8('0xf')]){if(_0x15d681[_0x8ac8('0xf')][_0x8ac8('0x10')]===0x1f4){logger[_0x8ac8('0xf')](_0x8ac8('0xb'),_0x412af1,_0x15d681[_0x8ac8('0xf')][_0x8ac8('0x11')]);return _0x45dc82(_0x15d681[_0x8ac8('0xf')]['message']);}logger[_0x8ac8('0xf')](_0x8ac8('0xb'),_0x412af1,_0x15d681['error'][_0x8ac8('0x11')]);return _0x3659f4(_0x15d681[_0x8ac8('0xf')][_0x8ac8('0x11')]);}else{logger[_0x8ac8('0xa')](_0x8ac8('0xb'),_0x412af1,_0x8ac8('0x12'));_0x3659f4(_0x15d681['result'][_0x8ac8('0x11')]);}})[_0x8ac8('0x13')](function(_0x243145){logger['error'](_0x8ac8('0xb'),_0x412af1,_0x243145);_0x45dc82(_0x243145);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5ee23a1..245efa0 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 _0xd94d=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x387978,_0x34cd62){var _0x564261=function(_0x2231c0){while(--_0x2231c0){_0x387978['push'](_0x387978['shift']());}};_0x564261(++_0x34cd62);}(_0xd94d,0xff));var _0xdd94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd94d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdd94('0x0'));var timeout=require(_0xdd94('0x1'));var express=require('express');var router=express[_0xdd94('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdd94('0x3'));var interaction=require(_0xdd94('0x4'));var config=require(_0xdd94('0x5'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xdd94('0x6')](),controller[_0xdd94('0x7')]);router['get'](_0xdd94('0x8'),auth[_0xdd94('0x6')](),controller[_0xdd94('0x9')]);router[_0xdd94('0xa')]('/',auth[_0xdd94('0x6')](),controller[_0xdd94('0xb')]);router[_0xdd94('0xc')](_0xdd94('0x8'),auth[_0xdd94('0x6')](),controller[_0xdd94('0xd')]);router[_0xdd94('0xe')](_0xdd94('0x8'),auth[_0xdd94('0x6')](),controller[_0xdd94('0xf')]);module[_0xdd94('0x10')]=router; \ No newline at end of file +var _0x8325=['create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3ae9e5,_0x2464b9){var _0x5204d0=function(_0x256a32){while(--_0x256a32){_0x3ae9e5['push'](_0x3ae9e5['shift']());}};_0x5204d0(++_0x2464b9);}(_0x8325,0xe7));var _0x5832=function(_0x2a6556,_0x2ad630){_0x2a6556=_0x2a6556-0x0;var _0x284a8c=_0x8325[_0x2a6556];return _0x284a8c;};'use strict';var multer=require(_0x5832('0x0'));var util=require(_0x5832('0x1'));var path=require(_0x5832('0x2'));var timeout=require(_0x5832('0x3'));var express=require(_0x5832('0x4'));var router=express[_0x5832('0x5')]();var fs_extra=require(_0x5832('0x6'));var auth=require(_0x5832('0x7'));var interaction=require(_0x5832('0x8'));var config=require('../../config/environment');var controller=require(_0x5832('0x9'));router[_0x5832('0xa')]('/',auth['isAuthenticated'](),controller[_0x5832('0xb')]);router[_0x5832('0xa')](_0x5832('0xc'),auth[_0x5832('0xd')](),controller[_0x5832('0xe')]);router[_0x5832('0xf')]('/',auth['isAuthenticated'](),controller[_0x5832('0x10')]);router['put'](_0x5832('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5832('0x11')](_0x5832('0xc'),auth[_0x5832('0xd')](),controller['destroy']);module[_0x5832('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b202221..301e8e9 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 _0xfd0b=['sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x46af7d,_0x103d62){var _0x5deba6=function(_0x222e43){while(--_0x222e43){_0x46af7d['push'](_0x46af7d['shift']());}};_0x5deba6(++_0x103d62);}(_0xfd0b,0x69));var _0xbfd0=function(_0x529cdb,_0x3b3098){_0x529cdb=_0x529cdb-0x0;var _0x22799d=_0xfd0b[_0x529cdb];return _0x22799d;};'use strict';var Sequelize=require(_0xbfd0('0x0'));module['exports']={'type':{'type':Sequelize[_0xbfd0('0x1')](_0xbfd0('0x2'),_0xbfd0('0x3'),_0xbfd0('0x4'),'keyValue',_0xbfd0('0x5')),'defaultValue':_0xbfd0('0x2')},'content':{'type':Sequelize[_0xbfd0('0x6')]},'key':{'type':Sequelize[_0xbfd0('0x6')]},'keyType':{'type':Sequelize[_0xbfd0('0x1')](_0xbfd0('0x2'),_0xbfd0('0x3'),_0xbfd0('0x4'))},'keyContent':{'type':Sequelize[_0xbfd0('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xbfd0('0x6')]}}; \ No newline at end of file +var _0x2a45=['string','sequelize','exports','ENUM','variable','customVariable','picklist','STRING'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x2a45,0xd1));var _0x52a4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2a45[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x52a4('0x0'));module[_0x52a4('0x1')]={'type':{'type':Sequelize[_0x52a4('0x2')]('string',_0x52a4('0x3'),_0x52a4('0x4'),'keyValue',_0x52a4('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x52a4('0x6')]},'key':{'type':Sequelize[_0x52a4('0x6')]},'keyType':{'type':Sequelize[_0x52a4('0x2')](_0x52a4('0x7'),_0x52a4('0x3'),_0x52a4('0x4'))},'keyContent':{'type':Sequelize[_0x52a4('0x6')]},'idField':{'type':Sequelize[_0x52a4('0x6')]},'variableName':{'type':Sequelize[_0x52a4('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 68b6cdc..1a8ea57 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 _0x0f84=['../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','rows','catch','show','params','length','merge','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0f84,0x7a));var _0x40f8=function(_0x5482ec,_0x50f580){_0x5482ec=_0x5482ec-0x0;var _0x1058b5=_0x0f84[_0x5482ec];return _0x1058b5;};'use strict';var emlformat=require(_0x40f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40f8('0x1'));var jsonpatch=require(_0x40f8('0x2'));var rp=require('request-promise');var moment=require(_0x40f8('0x3'));var BPromise=require(_0x40f8('0x4'));var Mustache=require(_0x40f8('0x5'));var util=require(_0x40f8('0x6'));var path=require(_0x40f8('0x7'));var sox=require(_0x40f8('0x8'));var csv=require(_0x40f8('0x9'));var ejs=require(_0x40f8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x40f8('0xb'));var jsforce=require(_0x40f8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x40f8('0x9'));var querystring=require(_0x40f8('0xd'));var Papa=require(_0x40f8('0xe'));var Redis=require(_0x40f8('0xf'));var authService=require(_0x40f8('0x10'));var qs=require(_0x40f8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40f8('0x12'));var logger=require('../../config/logger')(_0x40f8('0x13'));var utils=require(_0x40f8('0x14'));var config=require(_0x40f8('0x15'));var licenseUtil=require(_0x40f8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448d11,_0x38af82){_0x38af82=_0x38af82||0xcc;return function(_0x219ca1){if(_0x219ca1){return _0x448d11['sendStatus'](_0x38af82);}return _0x448d11[_0x40f8('0x17')](_0x38af82)[_0x40f8('0x18')]();};}function respondWithResult(_0x1e0ddf,_0x2c3ff1){_0x2c3ff1=_0x2c3ff1||0xc8;return function(_0x384555){if(_0x384555){return _0x1e0ddf['status'](_0x2c3ff1)['json'](_0x384555);}};}function respondWithFilteredResult(_0x308622,_0x4e8407){return function(_0x45d0bc){if(_0x45d0bc){var _0x41162b=typeof _0x4e8407[_0x40f8('0x19')]===_0x40f8('0x1a')&&typeof _0x4e8407[_0x40f8('0x1b')]===_0x40f8('0x1a');var _0x5078fe=_0x45d0bc[_0x40f8('0x1c')];var _0x5b727e=_0x41162b?0x0:_0x4e8407['offset'];var _0x5a793b=_0x41162b?_0x45d0bc[_0x40f8('0x1c')]:_0x4e8407['offset']+_0x4e8407[_0x40f8('0x1b')];var _0x55a53c;if(_0x5a793b>=_0x5078fe){_0x5a793b=_0x5078fe;_0x55a53c=0xc8;}else{_0x55a53c=0xce;}_0x308622[_0x40f8('0x17')](_0x55a53c);return _0x308622[_0x40f8('0x1d')](_0x40f8('0x1e'),_0x5b727e+'-'+_0x5a793b+'/'+_0x5078fe)[_0x40f8('0x1f')](_0x45d0bc);}return null;};}function patchUpdates(_0x5d22f3){return function(_0x492efb){try{jsonpatch[_0x40f8('0x20')](_0x492efb,_0x5d22f3,!![]);}catch(_0x589d85){return BPromise[_0x40f8('0x21')](_0x589d85);}return _0x492efb[_0x40f8('0x22')]();};}function saveUpdates(_0x1187c1,_0x49cb40){return function(_0x2ac92f){if(_0x2ac92f){return _0x2ac92f['update'](_0x1187c1)[_0x40f8('0x23')](function(_0x47c2fb){return _0x47c2fb;});}return null;};}function removeEntity(_0x6206b7,_0x5e574a){return function(_0x5ccb41){if(_0x5ccb41){return _0x5ccb41[_0x40f8('0x24')]()[_0x40f8('0x23')](function(){_0x6206b7['status'](0xcc)[_0x40f8('0x18')]();});}};}function handleEntityNotFound(_0x5c54f8,_0x20076d){return function(_0xb3c28b){if(!_0xb3c28b){_0x5c54f8[_0x40f8('0x25')](0x194);}return _0xb3c28b;};}function handleError(_0x27db16,_0x3655bb){_0x3655bb=_0x3655bb||0x1f4;return function(_0x9df9a0){logger['error'](_0x9df9a0[_0x40f8('0x26')]);if(_0x9df9a0['name']){delete _0x9df9a0['name'];}_0x27db16['status'](_0x3655bb)[_0x40f8('0x27')](_0x9df9a0);};}exports['index']=function(_0x2e1484,_0x106d33){var _0x2d7774={},_0x3d1f2e={},_0x403157={'count':0x0,'rows':[]};var _0x56400c=_[_0x40f8('0x28')](db[_0x40f8('0x29')][_0x40f8('0x2a')],function(_0x4cd44b){return{'name':_0x4cd44b[_0x40f8('0x2b')],'type':_0x4cd44b[_0x40f8('0x2c')][_0x40f8('0x2d')]};});_0x3d1f2e[_0x40f8('0x2e')]=_[_0x40f8('0x28')](_0x56400c,_0x40f8('0x2f'));_0x3d1f2e[_0x40f8('0x30')]=_[_0x40f8('0x31')](_0x2e1484[_0x40f8('0x30')]);_0x3d1f2e[_0x40f8('0x32')]=_['intersection'](_0x3d1f2e[_0x40f8('0x2e')],_0x3d1f2e['query']);_0x2d7774[_0x40f8('0x33')]=_[_0x40f8('0x34')](_0x3d1f2e[_0x40f8('0x2e')],qs[_0x40f8('0x35')](_0x2e1484[_0x40f8('0x30')][_0x40f8('0x35')]));_0x2d7774['attributes']=_0x2d7774[_0x40f8('0x33')]['length']?_0x2d7774[_0x40f8('0x33')]:_0x3d1f2e[_0x40f8('0x2e')];if(!_0x2e1484[_0x40f8('0x30')][_0x40f8('0x36')](_0x40f8('0x37'))){_0x2d7774[_0x40f8('0x1b')]=qs[_0x40f8('0x1b')](_0x2e1484[_0x40f8('0x30')][_0x40f8('0x1b')]);_0x2d7774[_0x40f8('0x19')]=qs['offset'](_0x2e1484[_0x40f8('0x30')][_0x40f8('0x19')]);}_0x2d7774[_0x40f8('0x38')]=qs[_0x40f8('0x39')](_0x2e1484[_0x40f8('0x30')][_0x40f8('0x39')]);_0x2d7774['where']=qs[_0x40f8('0x32')](_['pick'](_0x2e1484[_0x40f8('0x30')],_0x3d1f2e['filters']),_0x56400c);if(_0x2e1484[_0x40f8('0x30')]['filter']){_0x2d7774[_0x40f8('0x3a')]=_['merge'](_0x2d7774[_0x40f8('0x3a')],{'$or':_[_0x40f8('0x28')](_0x56400c,function(_0x54baa7){if(_0x54baa7[_0x40f8('0x2c')]!=='VIRTUAL'){var _0x46a110={};_0x46a110[_0x54baa7[_0x40f8('0x2f')]]={'$like':'%'+_0x2e1484[_0x40f8('0x30')][_0x40f8('0x3b')]+'%'};return _0x46a110;}})});}_0x2d7774=_['merge']({},_0x2d7774,_0x2e1484[_0x40f8('0x3c')]);var _0x5a75fd={'where':_0x2d7774['where']};return db[_0x40f8('0x29')]['count'](_0x5a75fd)[_0x40f8('0x23')](function(_0x6cf8f8){_0x403157[_0x40f8('0x1c')]=_0x6cf8f8;if(_0x2e1484[_0x40f8('0x30')][_0x40f8('0x3d')]){_0x2d7774[_0x40f8('0x3e')]=[{'all':!![]}];}return db[_0x40f8('0x29')]['findAll'](_0x2d7774);})['then'](function(_0x5af08d){_0x403157[_0x40f8('0x3f')]=_0x5af08d;return _0x403157;})['then'](respondWithFilteredResult(_0x106d33,_0x2d7774))[_0x40f8('0x40')](handleError(_0x106d33,null));};exports[_0x40f8('0x41')]=function(_0x15a278,_0x3e22b9){var _0x3c962e={'raw':!![],'where':{'id':_0x15a278[_0x40f8('0x42')]['id']}},_0xcad1a={};_0xcad1a[_0x40f8('0x2e')]=_[_0x40f8('0x31')](db['SalesforceField'][_0x40f8('0x2a')]);_0xcad1a[_0x40f8('0x30')]=_[_0x40f8('0x31')](_0x15a278['query']);_0xcad1a[_0x40f8('0x32')]=_[_0x40f8('0x34')](_0xcad1a[_0x40f8('0x2e')],_0xcad1a['query']);_0x3c962e[_0x40f8('0x33')]=_[_0x40f8('0x34')](_0xcad1a[_0x40f8('0x2e')],qs[_0x40f8('0x35')](_0x15a278[_0x40f8('0x30')][_0x40f8('0x35')]));_0x3c962e[_0x40f8('0x33')]=_0x3c962e[_0x40f8('0x33')][_0x40f8('0x43')]?_0x3c962e['attributes']:_0xcad1a[_0x40f8('0x2e')];if(_0x15a278[_0x40f8('0x30')][_0x40f8('0x3d')]){_0x3c962e[_0x40f8('0x3e')]=[{'all':!![]}];}_0x3c962e=_[_0x40f8('0x44')]({},_0x3c962e,_0x15a278[_0x40f8('0x3c')]);return db[_0x40f8('0x29')][_0x40f8('0x45')](_0x3c962e)['then'](handleEntityNotFound(_0x3e22b9,null))[_0x40f8('0x23')](respondWithResult(_0x3e22b9,null))[_0x40f8('0x40')](handleError(_0x3e22b9,null));};exports[_0x40f8('0x46')]=function(_0x5b8b74,_0x284084){return db['SalesforceField'][_0x40f8('0x46')](_0x5b8b74['body'],{})[_0x40f8('0x23')](respondWithResult(_0x284084,0xc9))[_0x40f8('0x40')](handleError(_0x284084,null));};exports['update']=function(_0x4466c9,_0x1a09dc){if(_0x4466c9[_0x40f8('0x47')]['id']){delete _0x4466c9[_0x40f8('0x47')]['id'];}return db[_0x40f8('0x29')]['find']({'where':{'id':_0x4466c9[_0x40f8('0x42')]['id']}})[_0x40f8('0x23')](handleEntityNotFound(_0x1a09dc,null))['then'](saveUpdates(_0x4466c9['body'],null))['then'](respondWithResult(_0x1a09dc,null))[_0x40f8('0x40')](handleError(_0x1a09dc,null));};exports['destroy']=function(_0x41676f,_0x5e6f7c){return db[_0x40f8('0x29')]['find']({'where':{'id':_0x41676f[_0x40f8('0x42')]['id']}})[_0x40f8('0x23')](handleEntityNotFound(_0x5e6f7c,null))[_0x40f8('0x23')](removeEntity(_0x5e6f7c,null))[_0x40f8('0x40')](handleError(_0x5e6f7c,null));}; \ No newline at end of file +var _0xbaff=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','create','find','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x567b64,_0x40bb39){var _0x17f895=function(_0x8edef7){while(--_0x8edef7){_0x567b64['push'](_0x567b64['shift']());}};_0x17f895(++_0x40bb39);}(_0xbaff,0x1a0));var _0xfbaf=function(_0x4b7a20,_0x470a22){_0x4b7a20=_0x4b7a20-0x0;var _0x302aa4=_0xbaff[_0x4b7a20];return _0x302aa4;};'use strict';var emlformat=require(_0xfbaf('0x0'));var rimraf=require(_0xfbaf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfbaf('0x2'));var moment=require('moment');var BPromise=require(_0xfbaf('0x3'));var Mustache=require(_0xfbaf('0x4'));var util=require(_0xfbaf('0x5'));var path=require(_0xfbaf('0x6'));var sox=require(_0xfbaf('0x7'));var csv=require('to-csv');var ejs=require(_0xfbaf('0x8'));var fs=require('fs');var fs_extra=require(_0xfbaf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfbaf('0xa'));var deskjs=require(_0xfbaf('0xb'));var toCsv=require(_0xfbaf('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfbaf('0xd'));var authService=require(_0xfbaf('0xe'));var qs=require(_0xfbaf('0xf'));var as=require(_0xfbaf('0x10'));var hardwareService=require(_0xfbaf('0x11'));var logger=require('../../config/logger')(_0xfbaf('0x12'));var utils=require(_0xfbaf('0x13'));var config=require(_0xfbaf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbaf('0x15'))['db'];function respondWithStatusCode(_0x129f5b,_0x36f662){_0x36f662=_0x36f662||0xcc;return function(_0x449866){if(_0x449866){return _0x129f5b[_0xfbaf('0x16')](_0x36f662);}return _0x129f5b[_0xfbaf('0x17')](_0x36f662)[_0xfbaf('0x18')]();};}function respondWithResult(_0x8c60e3,_0x1b7530){_0x1b7530=_0x1b7530||0xc8;return function(_0x1d331c){if(_0x1d331c){return _0x8c60e3['status'](_0x1b7530)[_0xfbaf('0x19')](_0x1d331c);}};}function respondWithFilteredResult(_0x1a096f,_0x482b7d){return function(_0x2d4819){if(_0x2d4819){var _0xdb3cd0=typeof _0x482b7d[_0xfbaf('0x1a')]===_0xfbaf('0x1b')&&typeof _0x482b7d[_0xfbaf('0x1c')]===_0xfbaf('0x1b');var _0x2236a6=_0x2d4819[_0xfbaf('0x1d')];var _0x2c5ddc=_0xdb3cd0?0x0:_0x482b7d[_0xfbaf('0x1a')];var _0x59249d=_0xdb3cd0?_0x2d4819[_0xfbaf('0x1d')]:_0x482b7d[_0xfbaf('0x1a')]+_0x482b7d['limit'];var _0x1a00be;if(_0x59249d>=_0x2236a6){_0x59249d=_0x2236a6;_0x1a00be=0xc8;}else{_0x1a00be=0xce;}_0x1a096f[_0xfbaf('0x17')](_0x1a00be);return _0x1a096f['set'](_0xfbaf('0x1e'),_0x2c5ddc+'-'+_0x59249d+'/'+_0x2236a6)[_0xfbaf('0x19')](_0x2d4819);}return null;};}function patchUpdates(_0x4ff668){return function(_0x2600ed){try{jsonpatch[_0xfbaf('0x1f')](_0x2600ed,_0x4ff668,!![]);}catch(_0x1ee3ed){return BPromise[_0xfbaf('0x20')](_0x1ee3ed);}return _0x2600ed[_0xfbaf('0x21')]();};}function saveUpdates(_0x1a14a0,_0x141a07){return function(_0x19b8aa){if(_0x19b8aa){return _0x19b8aa[_0xfbaf('0x22')](_0x1a14a0)[_0xfbaf('0x23')](function(_0x56fb96){return _0x56fb96;});}return null;};}function removeEntity(_0x6688fa,_0xfb5c31){return function(_0x4f1e1d){if(_0x4f1e1d){return _0x4f1e1d[_0xfbaf('0x24')]()[_0xfbaf('0x23')](function(){_0x6688fa[_0xfbaf('0x17')](0xcc)[_0xfbaf('0x18')]();});}};}function handleEntityNotFound(_0x1c0a52,_0x8ec482){return function(_0x5716bb){if(!_0x5716bb){_0x1c0a52['sendStatus'](0x194);}return _0x5716bb;};}function handleError(_0x57c23a,_0x3bb281){_0x3bb281=_0x3bb281||0x1f4;return function(_0x1771c6){logger[_0xfbaf('0x25')](_0x1771c6[_0xfbaf('0x26')]);if(_0x1771c6[_0xfbaf('0x27')]){delete _0x1771c6[_0xfbaf('0x27')];}_0x57c23a[_0xfbaf('0x17')](_0x3bb281)[_0xfbaf('0x28')](_0x1771c6);};}exports[_0xfbaf('0x29')]=function(_0x4fd9da,_0x354925){var _0xe2fe44={},_0x16584b={},_0x13376a={'count':0x0,'rows':[]};var _0x33f4e2=_[_0xfbaf('0x2a')](db[_0xfbaf('0x2b')][_0xfbaf('0x2c')],function(_0x2ff47b){return{'name':_0x2ff47b[_0xfbaf('0x2d')],'type':_0x2ff47b[_0xfbaf('0x2e')][_0xfbaf('0x2f')]};});_0x16584b[_0xfbaf('0x30')]=_[_0xfbaf('0x2a')](_0x33f4e2,_0xfbaf('0x27'));_0x16584b[_0xfbaf('0x31')]=_['keys'](_0x4fd9da[_0xfbaf('0x31')]);_0x16584b[_0xfbaf('0x32')]=_[_0xfbaf('0x33')](_0x16584b['model'],_0x16584b['query']);_0xe2fe44[_0xfbaf('0x34')]=_[_0xfbaf('0x33')](_0x16584b[_0xfbaf('0x30')],qs[_0xfbaf('0x35')](_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x35')]));_0xe2fe44[_0xfbaf('0x34')]=_0xe2fe44['attributes']['length']?_0xe2fe44['attributes']:_0x16584b['model'];if(!_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x36')](_0xfbaf('0x37'))){_0xe2fe44[_0xfbaf('0x1c')]=qs['limit'](_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x1c')]);_0xe2fe44[_0xfbaf('0x1a')]=qs[_0xfbaf('0x1a')](_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x1a')]);}_0xe2fe44[_0xfbaf('0x38')]=qs[_0xfbaf('0x39')](_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x39')]);_0xe2fe44[_0xfbaf('0x3a')]=qs[_0xfbaf('0x32')](_['pick'](_0x4fd9da[_0xfbaf('0x31')],_0x16584b[_0xfbaf('0x32')]),_0x33f4e2);if(_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x3b')]){_0xe2fe44[_0xfbaf('0x3a')]=_[_0xfbaf('0x3c')](_0xe2fe44['where'],{'$or':_[_0xfbaf('0x2a')](_0x33f4e2,function(_0xd29fe7){if(_0xd29fe7[_0xfbaf('0x2e')]!==_0xfbaf('0x3d')){var _0x3e8bce={};_0x3e8bce[_0xd29fe7[_0xfbaf('0x27')]]={'$like':'%'+_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x3b')]+'%'};return _0x3e8bce;}})});}_0xe2fe44=_[_0xfbaf('0x3c')]({},_0xe2fe44,_0x4fd9da['options']);var _0x376c32={'where':_0xe2fe44[_0xfbaf('0x3a')]};return db[_0xfbaf('0x2b')][_0xfbaf('0x1d')](_0x376c32)['then'](function(_0x2326c5){_0x13376a[_0xfbaf('0x1d')]=_0x2326c5;if(_0x4fd9da[_0xfbaf('0x31')][_0xfbaf('0x3e')]){_0xe2fe44[_0xfbaf('0x3f')]=[{'all':!![]}];}return db[_0xfbaf('0x2b')][_0xfbaf('0x40')](_0xe2fe44);})[_0xfbaf('0x23')](function(_0x4c3643){_0x13376a['rows']=_0x4c3643;return _0x13376a;})['then'](respondWithFilteredResult(_0x354925,_0xe2fe44))[_0xfbaf('0x41')](handleError(_0x354925,null));};exports[_0xfbaf('0x42')]=function(_0x5bfc83,_0x24f62f){var _0x42a029={'raw':!![],'where':{'id':_0x5bfc83[_0xfbaf('0x43')]['id']}},_0x3a1696={};_0x3a1696[_0xfbaf('0x30')]=_[_0xfbaf('0x44')](db[_0xfbaf('0x2b')][_0xfbaf('0x2c')]);_0x3a1696[_0xfbaf('0x31')]=_[_0xfbaf('0x44')](_0x5bfc83[_0xfbaf('0x31')]);_0x3a1696[_0xfbaf('0x32')]=_[_0xfbaf('0x33')](_0x3a1696['model'],_0x3a1696[_0xfbaf('0x31')]);_0x42a029[_0xfbaf('0x34')]=_['intersection'](_0x3a1696['model'],qs[_0xfbaf('0x35')](_0x5bfc83[_0xfbaf('0x31')]['fields']));_0x42a029['attributes']=_0x42a029[_0xfbaf('0x34')]['length']?_0x42a029['attributes']:_0x3a1696['model'];if(_0x5bfc83['query'][_0xfbaf('0x3e')]){_0x42a029[_0xfbaf('0x3f')]=[{'all':!![]}];}_0x42a029=_[_0xfbaf('0x3c')]({},_0x42a029,_0x5bfc83['options']);return db['SalesforceField']['find'](_0x42a029)['then'](handleEntityNotFound(_0x24f62f,null))[_0xfbaf('0x23')](respondWithResult(_0x24f62f,null))['catch'](handleError(_0x24f62f,null));};exports[_0xfbaf('0x45')]=function(_0x16f352,_0x5dc902){return db[_0xfbaf('0x2b')][_0xfbaf('0x45')](_0x16f352['body'],{})[_0xfbaf('0x23')](respondWithResult(_0x5dc902,0xc9))[_0xfbaf('0x41')](handleError(_0x5dc902,null));};exports[_0xfbaf('0x22')]=function(_0x69a9f9,_0x4695d8){if(_0x69a9f9['body']['id']){delete _0x69a9f9['body']['id'];}return db[_0xfbaf('0x2b')][_0xfbaf('0x46')]({'where':{'id':_0x69a9f9[_0xfbaf('0x43')]['id']}})[_0xfbaf('0x23')](handleEntityNotFound(_0x4695d8,null))[_0xfbaf('0x23')](saveUpdates(_0x69a9f9[_0xfbaf('0x47')],null))[_0xfbaf('0x23')](respondWithResult(_0x4695d8,null))[_0xfbaf('0x41')](handleError(_0x4695d8,null));};exports[_0xfbaf('0x24')]=function(_0x14a456,_0x517dca){return db[_0xfbaf('0x2b')][_0xfbaf('0x46')]({'where':{'id':_0x14a456[_0xfbaf('0x43')]['id']}})[_0xfbaf('0x23')](handleEntityNotFound(_0x517dca,null))[_0xfbaf('0x23')](removeEntity(_0x517dca,null))['catch'](handleError(_0x517dca,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index a8b2103..86640d6 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 _0xb519=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41117a,_0x27c78d){var _0x1424d7=function(_0x2e4262){while(--_0x2e4262){_0x41117a['push'](_0x41117a['shift']());}};_0x1424d7(++_0x27c78d);}(_0xb519,0xf6));var _0x9b51=function(_0x32ddca,_0x1e9bf7){_0x32ddca=_0x32ddca-0x0;var _0x46e16d=_0xb519[_0x32ddca];return _0x46e16d;};'use strict';var _=require(_0x9b51('0x0'));var util=require(_0x9b51('0x1'));var logger=require('../../config/logger')(_0x9b51('0x2'));var moment=require(_0x9b51('0x3'));var BPromise=require(_0x9b51('0x4'));var rp=require(_0x9b51('0x5'));var fs=require('fs');var path=require(_0x9b51('0x6'));var rimraf=require(_0x9b51('0x7'));var config=require(_0x9b51('0x8'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x414836,_0x1f8d52){return _0x414836[_0x9b51('0x9')](_0x9b51('0xa'),attributes,{'tableName':_0x9b51('0xb'),'paranoid':![],'indexes':[{'name':_0x9b51('0xc'),'fields':[_0x9b51('0xd'),_0x9b51('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x905e=['SalesforceField','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x4fd805,_0x46dee4){var _0x4e9bbd=function(_0x44f6dc){while(--_0x44f6dc){_0x4fd805['push'](_0x4fd805['shift']());}};_0x4e9bbd(++_0x46dee4);}(_0x905e,0x1a7));var _0xe905=function(_0x34ee81,_0x31481f){_0x34ee81=_0x34ee81-0x0;var _0x4a457c=_0x905e[_0x34ee81];return _0x4a457c;};'use strict';var _=require(_0xe905('0x0'));var util=require(_0xe905('0x1'));var logger=require(_0xe905('0x2'))(_0xe905('0x3'));var moment=require(_0xe905('0x4'));var BPromise=require('bluebird');var rp=require(_0xe905('0x5'));var fs=require('fs');var path=require(_0xe905('0x6'));var rimraf=require(_0xe905('0x7'));var config=require(_0xe905('0x8'));var attributes=require(_0xe905('0x9'));module[_0xe905('0xa')]=function(_0x517f62,_0x2e699f){return _0x517f62[_0xe905('0xb')](_0xe905('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xe905('0xd'),'fields':['idField',_0xe905('0xe')],'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 61b64db..29d5ad7 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 _0xf8d3=['../../config/logger','rpc','../../config/environment','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','util','bluebird','ioredis','../../config/utils'];(function(_0x8b9e62,_0x173b44){var _0x31a9a0=function(_0x5cacf7){while(--_0x5cacf7){_0x8b9e62['push'](_0x8b9e62['shift']());}};_0x31a9a0(++_0x173b44);}(_0xf8d3,0xfb));var _0x3f8d=function(_0xc0cbf,_0x22f493){_0xc0cbf=_0xc0cbf-0x0;var _0x24a0ac=_0xf8d3[_0xc0cbf];return _0x24a0ac;};'use strict';var _=require('lodash');var util=require(_0x3f8d('0x0'));var moment=require('moment');var BPromise=require(_0x3f8d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f8d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f8d('0x3'));var logger=require(_0x3f8d('0x4'))(_0x3f8d('0x5'));var config=require(_0x3f8d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f8d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f3d9c,_0x288864,_0x3e0a41){return new BPromise(function(_0x113f66,_0x86643f){return client[_0x3f8d('0x8')](_0x4f3d9c,_0x3e0a41)[_0x3f8d('0x9')](function(_0x4cd70d){logger[_0x3f8d('0xa')](_0x3f8d('0xb'),_0x288864,_0x3f8d('0xc'));logger['debug'](_0x3f8d('0xd'),_0x288864,_0x3f8d('0xc'),JSON['stringify'](_0x4cd70d));if(_0x4cd70d[_0x3f8d('0xe')]){if(_0x4cd70d[_0x3f8d('0xe')][_0x3f8d('0xf')]===0x1f4){logger[_0x3f8d('0xe')](_0x3f8d('0xb'),_0x288864,_0x4cd70d[_0x3f8d('0xe')][_0x3f8d('0x10')]);return _0x86643f(_0x4cd70d['error'][_0x3f8d('0x10')]);}logger['error'](_0x3f8d('0xb'),_0x288864,_0x4cd70d[_0x3f8d('0xe')][_0x3f8d('0x10')]);return _0x113f66(_0x4cd70d[_0x3f8d('0xe')][_0x3f8d('0x10')]);}else{logger[_0x3f8d('0xa')](_0x3f8d('0xb'),_0x288864,'request\x20sent');_0x113f66(_0x4cd70d['result']['message']);}})['catch'](function(_0x1d6eb8){logger[_0x3f8d('0xe')](_0x3f8d('0xb'),_0x288864,_0x1d6eb8);_0x86643f(_0x1d6eb8);});});} \ No newline at end of file +var _0xdff0=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdff0,0x1d9));var _0x0dff=function(_0x6c9804,_0x44d355){_0x6c9804=_0x6c9804-0x0;var _0x281c40=_0xdff0[_0x6c9804];return _0x281c40;};'use strict';var _=require('lodash');var util=require(_0x0dff('0x0'));var moment=require(_0x0dff('0x1'));var BPromise=require(_0x0dff('0x2'));var rs=require(_0x0dff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dff('0x4'))['db'];var utils=require(_0x0dff('0x5'));var logger=require(_0x0dff('0x6'))(_0x0dff('0x7'));var config=require(_0x0dff('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0dff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9ff4e4,_0x2ba6c5,_0x243b87){return new BPromise(function(_0x1ac5e1,_0x289bf9){return client[_0x0dff('0xa')](_0x9ff4e4,_0x243b87)[_0x0dff('0xb')](function(_0x122d0a){logger[_0x0dff('0xc')](_0x0dff('0xd'),_0x2ba6c5,_0x0dff('0xe'));logger[_0x0dff('0xf')](_0x0dff('0x10'),_0x2ba6c5,_0x0dff('0xe'),JSON[_0x0dff('0x11')](_0x122d0a));if(_0x122d0a[_0x0dff('0x12')]){if(_0x122d0a['error'][_0x0dff('0x13')]===0x1f4){logger[_0x0dff('0x12')](_0x0dff('0xd'),_0x2ba6c5,_0x122d0a[_0x0dff('0x12')][_0x0dff('0x14')]);return _0x289bf9(_0x122d0a[_0x0dff('0x12')][_0x0dff('0x14')]);}logger[_0x0dff('0x12')](_0x0dff('0xd'),_0x2ba6c5,_0x122d0a[_0x0dff('0x12')][_0x0dff('0x14')]);return _0x1ac5e1(_0x122d0a[_0x0dff('0x12')][_0x0dff('0x14')]);}else{logger[_0x0dff('0xc')](_0x0dff('0xd'),_0x2ba6c5,_0x0dff('0xe'));_0x1ac5e1(_0x122d0a[_0x0dff('0x15')][_0x0dff('0x14')]);}})['catch'](function(_0xc5386e){logger[_0x0dff('0x12')]('SalesforceField,\x20%s,\x20%s',_0x2ba6c5,_0xc5386e);_0x289bf9(_0xc5386e);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7aac011..f4d3f3a 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 _0xff83=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x5ef181,_0x4f0597){var _0x5b08c8=function(_0x584af9){while(--_0x584af9){_0x5ef181['push'](_0x5ef181['shift']());}};_0x5b08c8(++_0x4f0597);}(_0xff83,0x98));var _0x3ff8=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xff83[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require('multer');var util=require(_0x3ff8('0x0'));var path=require(_0x3ff8('0x1'));var timeout=require(_0x3ff8('0x2'));var express=require(_0x3ff8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ff8('0x4'));var interaction=require(_0x3ff8('0x5'));var config=require(_0x3ff8('0x6'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x3ff8('0x7')](),controller['index']);router['get']('/:id',auth[_0x3ff8('0x7')](),controller[_0x3ff8('0x8')]);router[_0x3ff8('0x9')](_0x3ff8('0xa'),auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xb')]);router['get'](_0x3ff8('0xc'),auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xd')]);router[_0x3ff8('0xe')]('/',auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xf')]);router[_0x3ff8('0xe')]('/:id/configurations',auth[_0x3ff8('0x7')](),controller['addConfiguration']);router[_0x3ff8('0x10')](_0x3ff8('0x11'),auth[_0x3ff8('0x7')](),controller[_0x3ff8('0x12')]);router[_0x3ff8('0x13')](_0x3ff8('0x11'),auth[_0x3ff8('0x7')](),controller[_0x3ff8('0x14')]);module[_0x3ff8('0x15')]=router; \ No newline at end of file +var _0x1b08=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x1b08,0x1c5));var _0x81b0=function(_0x46af7e,_0x3e32c7){_0x46af7e=_0x46af7e-0x0;var _0x4c0447=_0x1b08[_0x46af7e];return _0x4c0447;};'use strict';var multer=require('multer');var util=require(_0x81b0('0x0'));var path=require('path');var timeout=require(_0x81b0('0x1'));var express=require(_0x81b0('0x2'));var router=express[_0x81b0('0x3')]();var fs_extra=require(_0x81b0('0x4'));var auth=require(_0x81b0('0x5'));var interaction=require(_0x81b0('0x6'));var config=require('../../config/environment');var controller=require(_0x81b0('0x7'));router[_0x81b0('0x8')]('/',auth[_0x81b0('0x9')](),controller[_0x81b0('0xa')]);router[_0x81b0('0x8')]('/:id',auth[_0x81b0('0x9')](),controller[_0x81b0('0xb')]);router[_0x81b0('0x8')](_0x81b0('0xc'),auth[_0x81b0('0x9')](),controller[_0x81b0('0xd')]);router[_0x81b0('0x8')](_0x81b0('0xe'),auth[_0x81b0('0x9')](),controller[_0x81b0('0xf')]);router[_0x81b0('0x10')]('/',auth['isAuthenticated'](),controller[_0x81b0('0x11')]);router[_0x81b0('0x10')](_0x81b0('0xc'),auth[_0x81b0('0x9')](),controller[_0x81b0('0x12')]);router[_0x81b0('0x13')](_0x81b0('0x14'),auth[_0x81b0('0x9')](),controller[_0x81b0('0x15')]);router[_0x81b0('0x16')]('/:id',auth[_0x81b0('0x9')](),controller[_0x81b0('0x17')]);module[_0x81b0('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 99ae617..a6b17c9 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 _0x3566=['exports','STRING','remoteUri','sequelize'];(function(_0x306e9f,_0x265986){var _0x420bc1=function(_0x2182f9){while(--_0x2182f9){_0x306e9f['push'](_0x306e9f['shift']());}};_0x420bc1(++_0x265986);}(_0x3566,0x197));var _0x6356=function(_0x5e4a94,_0x589a3a){_0x5e4a94=_0x5e4a94-0x0;var _0x43151a=_0x3566[_0x5e4a94];return _0x43151a;};'use strict';var Sequelize=require(_0x6356('0x0'));module[_0x6356('0x1')]={'name':{'type':Sequelize[_0x6356('0x2')]},'description':{'type':Sequelize[_0x6356('0x2')]},'username':{'type':Sequelize[_0x6356('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6356('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6356('0x3')},'serverUrl':{'type':Sequelize[_0x6356('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4b6a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4b788e,_0x46f1a2){var _0x1cc5b3=function(_0x17257a){while(--_0x17257a){_0x4b788e['push'](_0x4b788e['shift']());}};_0x1cc5b3(++_0x46f1a2);}(_0x4b6a,0x12c));var _0xa4b6=function(_0x588b0b,_0x249418){_0x588b0b=_0x588b0b-0x0;var _0x439aaf=_0x4b6a[_0x588b0b];return _0x439aaf;};'use strict';var Sequelize=require(_0xa4b6('0x0'));module[_0xa4b6('0x1')]={'name':{'type':Sequelize[_0xa4b6('0x2')]},'description':{'type':Sequelize[_0xa4b6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xa4b6('0x3')},'password':{'type':Sequelize[_0xa4b6('0x2')]},'email':{'type':Sequelize[_0xa4b6('0x2')]},'remoteUri':{'type':Sequelize[_0xa4b6('0x2')],'unique':_0xa4b6('0x4')},'serverUrl':{'type':Sequelize[_0xa4b6('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 2d71775..3ce69fc 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 _0x2526=['follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ServicenowAccount','include','findAll','rows','catch','show','params','fields','length','includeAll','create','body','find','getConfigurations','findOne','ServicenowConfiguration','AccountId','Descriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','number','opened_by','user_input','sys_created_on','sys_domain','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at','caller_id','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2526,0x1a3));var _0x6252=function(_0x5f7e61,_0x20d2e2){_0x5f7e61=_0x5f7e61-0x0;var _0xcef63c=_0x2526[_0x5f7e61];return _0xcef63c;};'use strict';var emlformat=require(_0x6252('0x0'));var rimraf=require(_0x6252('0x1'));var zipdir=require(_0x6252('0x2'));var jsonpatch=require(_0x6252('0x3'));var rp=require(_0x6252('0x4'));var moment=require('moment');var BPromise=require(_0x6252('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6252('0x6'));var sox=require(_0x6252('0x7'));var csv=require(_0x6252('0x8'));var ejs=require(_0x6252('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6252('0xa'));var crypto=require(_0x6252('0xb'));var jsforce=require(_0x6252('0xc'));var deskjs=require(_0x6252('0xd'));var toCsv=require(_0x6252('0x8'));var querystring=require(_0x6252('0xe'));var Papa=require(_0x6252('0xf'));var Redis=require(_0x6252('0x10'));var authService=require(_0x6252('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6252('0x12'))('api');var utils=require(_0x6252('0x13'));var config=require(_0x6252('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6252('0x15'))['db'];var integrations=require(_0x6252('0x16'));function respondWithStatusCode(_0x30148d,_0x548c2f){_0x548c2f=_0x548c2f||0xcc;return function(_0x24cad8){if(_0x24cad8){return _0x30148d[_0x6252('0x17')](_0x548c2f);}return _0x30148d[_0x6252('0x18')](_0x548c2f)[_0x6252('0x19')]();};}function respondWithResult(_0x3cc031,_0x4cb8db){_0x4cb8db=_0x4cb8db||0xc8;return function(_0x3af089){if(_0x3af089){return _0x3cc031['status'](_0x4cb8db)['json'](_0x3af089);}};}function respondWithFilteredResult(_0x43da8c,_0x4ec985){return function(_0x14f8a6){if(_0x14f8a6){var _0x46695b=typeof _0x4ec985[_0x6252('0x1a')]==='undefined'&&typeof _0x4ec985['limit']==='undefined';var _0x4a9b5d=_0x14f8a6[_0x6252('0x1b')];var _0x3cbc77=_0x46695b?0x0:_0x4ec985[_0x6252('0x1a')];var _0x352acd=_0x46695b?_0x14f8a6[_0x6252('0x1b')]:_0x4ec985[_0x6252('0x1a')]+_0x4ec985[_0x6252('0x1c')];var _0x720e6e;if(_0x352acd>=_0x4a9b5d){_0x352acd=_0x4a9b5d;_0x720e6e=0xc8;}else{_0x720e6e=0xce;}_0x43da8c['status'](_0x720e6e);return _0x43da8c[_0x6252('0x1d')](_0x6252('0x1e'),_0x3cbc77+'-'+_0x352acd+'/'+_0x4a9b5d)[_0x6252('0x1f')](_0x14f8a6);}return null;};}function patchUpdates(_0x3e9104){return function(_0x7c5b43){try{jsonpatch[_0x6252('0x20')](_0x7c5b43,_0x3e9104,!![]);}catch(_0x57ff26){return BPromise['reject'](_0x57ff26);}return _0x7c5b43['save']();};}function saveUpdates(_0x123d1b,_0xfb6db3){return function(_0x39c85b){if(_0x39c85b){return _0x39c85b[_0x6252('0x21')](_0x123d1b)[_0x6252('0x22')](function(_0x8a56b6){return _0x8a56b6;});}return null;};}function removeEntity(_0x1900d8,_0x2a1377){return function(_0x17e0d2){if(_0x17e0d2){return _0x17e0d2[_0x6252('0x23')]()[_0x6252('0x22')](function(){_0x1900d8[_0x6252('0x18')](0xcc)[_0x6252('0x19')]();});}};}function handleEntityNotFound(_0x4afbf4,_0x267542){return function(_0x43ae7c){if(!_0x43ae7c){_0x4afbf4['sendStatus'](0x194);}return _0x43ae7c;};}function handleError(_0x5bba88,_0xe0b6b9){_0xe0b6b9=_0xe0b6b9||0x1f4;return function(_0x6a6122){logger[_0x6252('0x24')](_0x6a6122['stack']);if(_0x6a6122['name']){delete _0x6a6122[_0x6252('0x25')];}_0x5bba88['status'](_0xe0b6b9)[_0x6252('0x26')](_0x6a6122);};}exports['index']=function(_0x178b99,_0xa1c096){var _0x4281f0={},_0x4bafd6={},_0x1b6528={'count':0x0,'rows':[]};var _0x23626e=_[_0x6252('0x27')](db['ServicenowAccount'][_0x6252('0x28')],function(_0x306367){return{'name':_0x306367[_0x6252('0x29')],'type':_0x306367[_0x6252('0x2a')]['key']};});_0x4bafd6[_0x6252('0x2b')]=_[_0x6252('0x27')](_0x23626e,'name');_0x4bafd6[_0x6252('0x2c')]=_[_0x6252('0x2d')](_0x178b99[_0x6252('0x2c')]);_0x4bafd6['filters']=_[_0x6252('0x2e')](_0x4bafd6[_0x6252('0x2b')],_0x4bafd6['query']);_0x4281f0[_0x6252('0x2f')]=_['intersection'](_0x4bafd6[_0x6252('0x2b')],qs['fields'](_0x178b99['query']['fields']));_0x4281f0['attributes']=_0x4281f0['attributes']['length']?_0x4281f0[_0x6252('0x2f')]:_0x4bafd6['model'];if(!_0x178b99[_0x6252('0x2c')][_0x6252('0x30')](_0x6252('0x31'))){_0x4281f0[_0x6252('0x1c')]=qs['limit'](_0x178b99['query'][_0x6252('0x1c')]);_0x4281f0[_0x6252('0x1a')]=qs[_0x6252('0x1a')](_0x178b99[_0x6252('0x2c')][_0x6252('0x1a')]);}_0x4281f0[_0x6252('0x32')]=qs['sort'](_0x178b99['query'][_0x6252('0x33')]);_0x4281f0[_0x6252('0x34')]=qs[_0x6252('0x35')](_[_0x6252('0x36')](_0x178b99['query'],_0x4bafd6[_0x6252('0x35')]),_0x23626e);if(_0x178b99['query'][_0x6252('0x37')]){_0x4281f0[_0x6252('0x34')]=_['merge'](_0x4281f0['where'],{'$or':_['map'](_0x23626e,function(_0x24ccf5){if(_0x24ccf5[_0x6252('0x2a')]!==_0x6252('0x38')){var _0x2d1ca5={};_0x2d1ca5[_0x24ccf5[_0x6252('0x25')]]={'$like':'%'+_0x178b99[_0x6252('0x2c')]['filter']+'%'};return _0x2d1ca5;}})});}_0x4281f0=_[_0x6252('0x39')]({},_0x4281f0,_0x178b99[_0x6252('0x3a')]);var _0x30d784={'where':_0x4281f0[_0x6252('0x34')]};return db[_0x6252('0x3b')][_0x6252('0x1b')](_0x30d784)['then'](function(_0x5f2757){_0x1b6528[_0x6252('0x1b')]=_0x5f2757;if(_0x178b99[_0x6252('0x2c')]['includeAll']){_0x4281f0[_0x6252('0x3c')]=[{'all':!![]}];}return db[_0x6252('0x3b')][_0x6252('0x3d')](_0x4281f0);})[_0x6252('0x22')](function(_0x3c4df9){_0x1b6528[_0x6252('0x3e')]=_0x3c4df9;return _0x1b6528;})[_0x6252('0x22')](respondWithFilteredResult(_0xa1c096,_0x4281f0))[_0x6252('0x3f')](handleError(_0xa1c096,null));};exports[_0x6252('0x40')]=function(_0x4bb5a7,_0x2837ee){var _0x1d804f={'raw':![],'where':{'id':_0x4bb5a7[_0x6252('0x41')]['id']}},_0x4c7bfe={};_0x4c7bfe[_0x6252('0x2b')]=_[_0x6252('0x2d')](db[_0x6252('0x3b')][_0x6252('0x28')]);_0x4c7bfe[_0x6252('0x2c')]=_[_0x6252('0x2d')](_0x4bb5a7[_0x6252('0x2c')]);_0x4c7bfe['filters']=_[_0x6252('0x2e')](_0x4c7bfe['model'],_0x4c7bfe[_0x6252('0x2c')]);_0x1d804f[_0x6252('0x2f')]=_[_0x6252('0x2e')](_0x4c7bfe[_0x6252('0x2b')],qs[_0x6252('0x42')](_0x4bb5a7[_0x6252('0x2c')]['fields']));_0x1d804f[_0x6252('0x2f')]=_0x1d804f[_0x6252('0x2f')][_0x6252('0x43')]?_0x1d804f[_0x6252('0x2f')]:_0x4c7bfe[_0x6252('0x2b')];if(_0x4bb5a7['query'][_0x6252('0x44')]){_0x1d804f[_0x6252('0x3c')]=[{'all':!![]}];}_0x1d804f=_[_0x6252('0x39')]({},_0x1d804f,_0x4bb5a7[_0x6252('0x3a')]);return db[_0x6252('0x3b')]['find'](_0x1d804f)['then'](handleEntityNotFound(_0x2837ee,null))[_0x6252('0x22')](respondWithResult(_0x2837ee,null))[_0x6252('0x3f')](handleError(_0x2837ee,null));};exports[_0x6252('0x45')]=function(_0x454f5f,_0x391e34){return db[_0x6252('0x3b')][_0x6252('0x45')](_0x454f5f['body'],{})[_0x6252('0x22')](respondWithResult(_0x391e34,0xc9))[_0x6252('0x3f')](handleError(_0x391e34,null));};exports['update']=function(_0x29d69c,_0x5b6660){if(_0x29d69c[_0x6252('0x46')]['id']){delete _0x29d69c['body']['id'];}return db['ServicenowAccount'][_0x6252('0x47')]({'where':{'id':_0x29d69c[_0x6252('0x41')]['id']}})[_0x6252('0x22')](handleEntityNotFound(_0x5b6660,null))[_0x6252('0x22')](saveUpdates(_0x29d69c['body'],null))[_0x6252('0x22')](respondWithResult(_0x5b6660,null))['catch'](handleError(_0x5b6660,null));};exports[_0x6252('0x23')]=function(_0x40547b,_0x38e958){return db['ServicenowAccount'][_0x6252('0x47')]({'where':{'id':_0x40547b[_0x6252('0x41')]['id']}})[_0x6252('0x22')](handleEntityNotFound(_0x38e958,null))[_0x6252('0x22')](removeEntity(_0x38e958,null))[_0x6252('0x3f')](handleError(_0x38e958,null));};exports[_0x6252('0x48')]=function(_0x392455,_0x1c41af,_0x576c88){var _0x58a305={};var _0x46bc6a={};var _0x43459e;var _0x2baa52;return db['ServicenowAccount'][_0x6252('0x49')]({'where':{'id':_0x392455[_0x6252('0x41')]['id']}})[_0x6252('0x22')](handleEntityNotFound(_0x1c41af,null))[_0x6252('0x22')](function(_0x1d9ca6){if(_0x1d9ca6){_0x43459e=_0x1d9ca6;_0x46bc6a[_0x6252('0x2b')]=_['keys'](db[_0x6252('0x4a')][_0x6252('0x28')]);_0x46bc6a[_0x6252('0x2c')]=_[_0x6252('0x2d')](_0x392455['query']);_0x46bc6a['filters']=_[_0x6252('0x2e')](_0x46bc6a[_0x6252('0x2b')],_0x46bc6a[_0x6252('0x2c')]);_0x58a305[_0x6252('0x2f')]=_[_0x6252('0x2e')](_0x46bc6a['model'],qs[_0x6252('0x42')](_0x392455[_0x6252('0x2c')]['fields']));_0x58a305['attributes']=_0x58a305['attributes']['length']?_0x58a305[_0x6252('0x2f')]:_0x46bc6a[_0x6252('0x2b')];_0x58a305[_0x6252('0x32')]=qs[_0x6252('0x33')](_0x392455[_0x6252('0x2c')][_0x6252('0x33')]);_0x58a305[_0x6252('0x34')]=qs['filters'](_[_0x6252('0x36')](_0x392455[_0x6252('0x2c')],_0x46bc6a[_0x6252('0x35')]));if(_0x392455[_0x6252('0x2c')][_0x6252('0x37')]){_0x58a305['where']=_[_0x6252('0x39')](_0x58a305['where'],{'$or':_[_0x6252('0x27')](_0x58a305[_0x6252('0x2f')],function(_0x56cf76){var _0x332e18={};_0x332e18[_0x56cf76]={'$like':'%'+_0x392455[_0x6252('0x2c')]['filter']+'%'};return _0x332e18;})});}_0x58a305=_[_0x6252('0x39')]({},_0x58a305,_0x392455[_0x6252('0x3a')]);return _0x43459e[_0x6252('0x48')](_0x58a305);}})[_0x6252('0x22')](function(_0x5ae311){if(_0x5ae311){_0x2baa52=_0x5ae311[_0x6252('0x43')];if(!_0x392455[_0x6252('0x2c')]['hasOwnProperty']('nolimit')){_0x58a305[_0x6252('0x1c')]=qs[_0x6252('0x1c')](_0x392455[_0x6252('0x2c')]['limit']);_0x58a305['offset']=qs[_0x6252('0x1a')](_0x392455[_0x6252('0x2c')][_0x6252('0x1a')]);}return _0x43459e[_0x6252('0x48')](_0x58a305);}})[_0x6252('0x22')](function(_0x54df92){if(_0x54df92){return _0x54df92?{'count':_0x2baa52,'rows':_0x54df92}:null;}})[_0x6252('0x22')](respondWithResult(_0x1c41af,null))['catch'](handleError(_0x1c41af,null));};exports['addConfiguration']=function(_0x52ce1e,_0x11d343,_0x4af9f1){if(_0x52ce1e['body']['id']){delete _0x52ce1e[_0x6252('0x46')]['id'];}return db[_0x6252('0x3b')][_0x6252('0x49')]({'where':{'id':_0x52ce1e['params']['id']}})[_0x6252('0x22')](handleEntityNotFound(_0x11d343,null))['then'](function(_0x1fd895){if(_0x1fd895){_0x52ce1e[_0x6252('0x46')][_0x6252('0x4b')]=_0x1fd895['id'];_0x52ce1e[_0x6252('0x46')]['Subjects']=integrations['getSubjects'](_0x52ce1e[_0x6252('0x46')]['channel'],_0x52ce1e[_0x6252('0x46')][_0x6252('0x2a')]);_0x52ce1e[_0x6252('0x46')][_0x6252('0x4c')]=integrations['getDescriptions'](_0x52ce1e[_0x6252('0x46')]['channel'],_0x52ce1e['body']['type']);return db[_0x6252('0x4a')][_0x6252('0x45')](_0x52ce1e[_0x6252('0x46')],{'include':[{'model':db[_0x6252('0x4d')],'as':_0x6252('0x4e')},{'model':db[_0x6252('0x4d')],'as':_0x6252('0x4c')}]});}return null;})[_0x6252('0x22')](respondWithResult(_0x11d343,null))[_0x6252('0x3f')](handleError(_0x11d343,null));};exports[_0x6252('0x4f')]=function(_0x2fccaf,_0x3c22ff,_0x33a3c2){var _0xdb1193=[_0x6252('0x50'),_0x6252('0x51'),_0x6252('0x52'),_0x6252('0x53'),_0x6252('0x54'),_0x6252('0x55'),'incident_state','severity',_0x6252('0x56')];var _0x107d62=[_0x6252('0x57'),_0x6252('0x50'),'caused_by',_0x6252('0x58'),_0x6252('0x59'),_0x6252('0x5a'),_0x6252('0x5b'),_0x6252('0x51'),'approval_history',_0x6252('0x5c'),'resolved_by','sys_updated_by',_0x6252('0x5d'),_0x6252('0x5e'),_0x6252('0x5f'),_0x6252('0x60'),'state','sys_created_by',_0x6252('0x52'),_0x6252('0x32'),'calendar_stc',_0x6252('0x61'),'cmdb_ci',_0x6252('0x62'),_0x6252('0x63'),_0x6252('0x64'),_0x6252('0x65'),_0x6252('0x66'),_0x6252('0x67'),_0x6252('0x68'),_0x6252('0x69'),_0x6252('0x6a'),_0x6252('0x6b'),_0x6252('0x6c'),_0x6252('0x6d'),'group_list','work_end',_0x6252('0x6e'),_0x6252('0x6f'),_0x6252('0x70'),'approval_set',_0x6252('0x53'),'work_notes','short_description','close_code',_0x6252('0x71'),_0x6252('0x72'),_0x6252('0x73'),'assignment_group','business_stc',_0x6252('0x74'),_0x6252('0x75'),_0x6252('0x76'),'notify',_0x6252('0x77'),'close_notes',_0x6252('0x78'),_0x6252('0x79'),_0x6252('0x7a'),_0x6252('0x7b'),_0x6252('0x7c'),_0x6252('0x7d'),_0x6252('0x7e'),_0x6252('0x7f'),_0x6252('0x80'),_0x6252('0x81'),_0x6252('0x82'),_0x6252('0x83'),_0x6252('0x84'),'severity',_0x6252('0x85'),_0x6252('0x86'),'approval',_0x6252('0x87'),_0x6252('0x88'),_0x6252('0x89'),_0x6252('0x8a'),_0x6252('0x8b'),_0x6252('0x8c'),'upon_approval',_0x6252('0x8d'),_0x6252('0x8e'),_0x6252('0x56')];var _0x3bbd8d='';var _0xcbdb67='';var _0x3f572a=[];var _0x19da23='';var _0x5b2a8b='';var _0x3d456a=[];var _0x3ecd75='';var _0x42559b='';var _0x3bf98b={};var _0x3be5e3='';return db[_0x6252('0x3b')][_0x6252('0x49')]({'where':{'id':_0x2fccaf[_0x6252('0x41')]['id']},'attributes':['id',_0x6252('0x8f'),_0x6252('0x90'),_0x6252('0x91'),_0x6252('0x92'),_0x6252('0x93')]})[_0x6252('0x22')](handleEntityNotFound(_0x3c22ff,null))[_0x6252('0x22')](function(_0x500afb){if(_0x500afb){_0x3be5e3=_0x500afb[_0x6252('0x92')];var _0x15ad3f=_0x3be5e3[_0x6252('0x94')](-0x1);if(_0x15ad3f==='/'){_0x3be5e3=_0x3be5e3[_0x6252('0x95')](0x0,_0x3be5e3[_0x6252('0x96')](_0x15ad3f));}_0x42559b=util[_0x6252('0x97')](_0x6252('0x98'),_0x3be5e3);_0x3ecd75=util['format'](_0x6252('0x99'),_0x3be5e3);_0x3bf98b={'user':_0x500afb[_0x6252('0x8f')],'pass':_0x500afb[_0x6252('0x90')]};var _0x2be2aa={'method':_0x6252('0x9a'),'uri':_0x42559b+_0x6252('0x9b'),'auth':_0x3bf98b,'json':!![]};return rp(_0x2be2aa);}})[_0x6252('0x22')](function(_0x5ef007){if(_0x5ef007[_0x6252('0x9c')][_0x6252('0x43')]>0x0){_0x3bbd8d=_0x5ef007['result'];}console[_0x6252('0x9d')](_0x6252('0x9e'),_0x3bbd8d);_0x3d456a=[];_0xcbdb67=Object[_0x6252('0x9f')]([],_0x3bbd8d);_[_0x6252('0xa0')](_0xcbdb67,function(_0x492177){return!_0xdb1193[_0x6252('0xa1')](_0x492177['name']);});_0xcbdb67[_0x6252('0xa2')](function(_0x31f4f5){var _0x50ce60=createFieldObject(_0x3ecd75,_0x3bf98b,_0x31f4f5['internalType'],_0x31f4f5[_0x6252('0x25')],_0x31f4f5['label'],![]);_0x3d456a[_0x6252('0xa3')](_0x50ce60);});return Promise['all'](_0x3d456a);})[_0x6252('0x22')](function(_0x2ba10f){_0x3f572a=_0x2ba10f;_0x19da23=Object[_0x6252('0x9f')]([],_0x3bbd8d);console[_0x6252('0x9d')](_0x6252('0xa4'),_0x3bbd8d);_[_0x6252('0xa0')](_0x19da23,function(_0x519035){return _0x107d62['includes'](_0x519035[_0x6252('0x25')]);});console['log'](_0x6252('0xa5'),_0x19da23);_0x3d456a=[];_0x19da23[_0x6252('0xa2')](function(_0x10e426){var _0x377baf=createFieldObject(_0x3ecd75,_0x3bf98b,_0x10e426[_0x6252('0xa6')],_0x10e426['name'],_0x10e426[_0x6252('0xa7')],!![]);_0x3d456a[_0x6252('0xa3')](_0x377baf);});return Promise['all'](_0x3d456a);})[_0x6252('0x22')](function(_0x3f2fb3){_0x5b2a8b=_0x3f2fb3;var _0x530ca8=_0x3f572a[_0x6252('0xa8')](_0x5b2a8b);return{'count':_0x530ca8[_0x6252('0x43')],'rows':_0x530ca8};})['then'](respondWithResult(_0x3c22ff,null))[_0x6252('0x3f')](function(_0x419ec0){console['log'](_0x6252('0xa9')+_0x419ec0);var _0x288bde=_0x2fccaf[_0x6252('0x2c')][_0x6252('0xaa')]?0x1f4:_0x419ec0[_0x6252('0xab')]||0x1f4;logger[_0x6252('0x24')](_0x419ec0['stack']);delete _0x419ec0[_0x6252('0x25')];if(_0x288bde===0x191){_0x288bde=0x190;}_0x3c22ff[_0x6252('0x18')](_0x288bde)[_0x6252('0x26')](_0x2fccaf[_0x6252('0x2c')][_0x6252('0xaa')]?{'message':_0x6252('0xac'),'statusCode':_0x419ec0[_0x6252('0xab')]}:_0x419ec0);});};function createFieldObject(_0x5b9d60,_0x52f611,_0xe6fd9f,_0xc4edbe,_0xbcd8a6,_0x24fa92){return new Promise(function(_0x36f7f3,_0x26e820){var _0x1c1768={'id':_0xc4edbe,'name':_0xbcd8a6,'custom':_0x24fa92};if(_0xe6fd9f===_0x6252('0xad')){_0x1c1768[_0x6252('0x3a')]=[{'name':_0x6252('0xae'),'value':_0x6252('0xaf')},{'name':'False','value':'false'}];_0x36f7f3(_0x1c1768);}else{var _0x448266={'method':_0x6252('0x9a'),'uri':_0x5b9d60+_0x6252('0xb0')+_0xc4edbe,'auth':_0x52f611,'json':!![]};return rp(_0x448266)[_0x6252('0x22')](function(_0x2ed041){var _0x85eced=[];if(_0x2ed041[_0x6252('0x9c')]['length']>0x0){_0x2ed041[_0x6252('0x9c')][_0x6252('0xa2')](function(_0x3316c9){if(_0x3316c9[_0x6252('0xb1')]===_0x6252('0xb2')){var _0x162936={'name':_0x3316c9[_0x6252('0xa7')],'value':_0x3316c9[_0x6252('0xb3')]};_0x85eced[_0x6252('0xa3')](_0x162936);}});}_0x1c1768[_0x6252('0x3a')]=_0x85eced;if(_0x1c1768['options'][_0x6252('0x43')]>0x0){_0x36f7f3(_0x1c1768);}else{if(_0x24fa92==![]){_0x36f7f3();}else{_0x36f7f3(_0x1c1768);}}});}});} \ No newline at end of file +var _0x3ab2=['TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','stack','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','options','include','findAll','params','keys','find','catch','create','body','destroy','findOne','ServicenowConfiguration','order','pick','filter','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','notify','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','severity','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','log','TCL:\x20_object'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0x3ab2,0xc2));var _0x23ab=function(_0x3b86a5,_0x52360c){_0x3b86a5=_0x3b86a5-0x0;var _0x517165=_0x3ab2[_0x3b86a5];return _0x517165;};'use strict';var emlformat=require(_0x23ab('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x23ab('0x1'));var rp=require(_0x23ab('0x2'));var moment=require(_0x23ab('0x3'));var BPromise=require(_0x23ab('0x4'));var Mustache=require(_0x23ab('0x5'));var util=require(_0x23ab('0x6'));var path=require(_0x23ab('0x7'));var sox=require(_0x23ab('0x8'));var csv=require(_0x23ab('0x9'));var ejs=require(_0x23ab('0xa'));var fs=require('fs');var fs_extra=require(_0x23ab('0xb'));var _=require('lodash');var squel=require(_0x23ab('0xc'));var crypto=require(_0x23ab('0xd'));var jsforce=require(_0x23ab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x23ab('0x9'));var querystring=require('querystring');var Papa=require(_0x23ab('0xf'));var Redis=require(_0x23ab('0x10'));var authService=require(_0x23ab('0x11'));var qs=require(_0x23ab('0x12'));var as=require(_0x23ab('0x13'));var hardwareService=require(_0x23ab('0x14'));var logger=require(_0x23ab('0x15'))(_0x23ab('0x16'));var utils=require(_0x23ab('0x17'));var config=require(_0x23ab('0x18'));var licenseUtil=require(_0x23ab('0x19'));var db=require(_0x23ab('0x1a'))['db'];var integrations=require(_0x23ab('0x1b'));function respondWithStatusCode(_0x184ed4,_0xb9d771){_0xb9d771=_0xb9d771||0xcc;return function(_0x8230c9){if(_0x8230c9){return _0x184ed4[_0x23ab('0x1c')](_0xb9d771);}return _0x184ed4[_0x23ab('0x1d')](_0xb9d771)[_0x23ab('0x1e')]();};}function respondWithResult(_0x322bc7,_0x329d6e){_0x329d6e=_0x329d6e||0xc8;return function(_0x18750e){if(_0x18750e){return _0x322bc7[_0x23ab('0x1d')](_0x329d6e)['json'](_0x18750e);}};}function respondWithFilteredResult(_0x156c9c,_0x5439c2){return function(_0x570da9){if(_0x570da9){var _0x32b987=typeof _0x5439c2[_0x23ab('0x1f')]==='undefined'&&typeof _0x5439c2[_0x23ab('0x20')]===_0x23ab('0x21');var _0x35adde=_0x570da9[_0x23ab('0x22')];var _0x16b717=_0x32b987?0x0:_0x5439c2['offset'];var _0x1b9cf8=_0x32b987?_0x570da9[_0x23ab('0x22')]:_0x5439c2[_0x23ab('0x1f')]+_0x5439c2[_0x23ab('0x20')];var _0x786324;if(_0x1b9cf8>=_0x35adde){_0x1b9cf8=_0x35adde;_0x786324=0xc8;}else{_0x786324=0xce;}_0x156c9c[_0x23ab('0x1d')](_0x786324);return _0x156c9c[_0x23ab('0x23')](_0x23ab('0x24'),_0x16b717+'-'+_0x1b9cf8+'/'+_0x35adde)['json'](_0x570da9);}return null;};}function patchUpdates(_0x10eea9){return function(_0x4346a0){try{jsonpatch[_0x23ab('0x25')](_0x4346a0,_0x10eea9,!![]);}catch(_0x3427b4){return BPromise['reject'](_0x3427b4);}return _0x4346a0[_0x23ab('0x26')]();};}function saveUpdates(_0x1205c7,_0x42bceb){return function(_0x3cc5a2){if(_0x3cc5a2){return _0x3cc5a2[_0x23ab('0x27')](_0x1205c7)[_0x23ab('0x28')](function(_0x1987cd){return _0x1987cd;});}return null;};}function removeEntity(_0x22e0e9,_0x4d50e5){return function(_0x276ad5){if(_0x276ad5){return _0x276ad5['destroy']()[_0x23ab('0x28')](function(){_0x22e0e9[_0x23ab('0x1d')](0xcc)[_0x23ab('0x1e')]();});}};}function handleEntityNotFound(_0x4dc6bd,_0x3ebb85){return function(_0x1ee190){if(!_0x1ee190){_0x4dc6bd[_0x23ab('0x1c')](0x194);}return _0x1ee190;};}function handleError(_0x15e45d,_0x257c5d){_0x257c5d=_0x257c5d||0x1f4;return function(_0x74666e){logger[_0x23ab('0x29')](_0x74666e['stack']);if(_0x74666e[_0x23ab('0x2a')]){delete _0x74666e[_0x23ab('0x2a')];}_0x15e45d[_0x23ab('0x1d')](_0x257c5d)[_0x23ab('0x2b')](_0x74666e);};}exports[_0x23ab('0x2c')]=function(_0x325594,_0x3e5bf5){var _0x975f5={},_0xd97ea6={},_0x349803={'count':0x0,'rows':[]};var _0x1500e9=_[_0x23ab('0x2d')](db[_0x23ab('0x2e')][_0x23ab('0x2f')],function(_0x34138d){return{'name':_0x34138d[_0x23ab('0x30')],'type':_0x34138d['type'][_0x23ab('0x31')]};});_0xd97ea6[_0x23ab('0x32')]=_[_0x23ab('0x2d')](_0x1500e9,_0x23ab('0x2a'));_0xd97ea6[_0x23ab('0x33')]=_['keys'](_0x325594[_0x23ab('0x33')]);_0xd97ea6[_0x23ab('0x34')]=_[_0x23ab('0x35')](_0xd97ea6[_0x23ab('0x32')],_0xd97ea6['query']);_0x975f5[_0x23ab('0x36')]=_['intersection'](_0xd97ea6[_0x23ab('0x32')],qs[_0x23ab('0x37')](_0x325594[_0x23ab('0x33')][_0x23ab('0x37')]));_0x975f5[_0x23ab('0x36')]=_0x975f5['attributes'][_0x23ab('0x38')]?_0x975f5[_0x23ab('0x36')]:_0xd97ea6[_0x23ab('0x32')];if(!_0x325594[_0x23ab('0x33')][_0x23ab('0x39')](_0x23ab('0x3a'))){_0x975f5['limit']=qs['limit'](_0x325594[_0x23ab('0x33')]['limit']);_0x975f5[_0x23ab('0x1f')]=qs[_0x23ab('0x1f')](_0x325594[_0x23ab('0x33')][_0x23ab('0x1f')]);}_0x975f5['order']=qs[_0x23ab('0x3b')](_0x325594[_0x23ab('0x33')][_0x23ab('0x3b')]);_0x975f5[_0x23ab('0x3c')]=qs[_0x23ab('0x34')](_['pick'](_0x325594['query'],_0xd97ea6['filters']),_0x1500e9);if(_0x325594[_0x23ab('0x33')]['filter']){_0x975f5[_0x23ab('0x3c')]=_[_0x23ab('0x3d')](_0x975f5['where'],{'$or':_['map'](_0x1500e9,function(_0x2a51ce){if(_0x2a51ce[_0x23ab('0x3e')]!=='VIRTUAL'){var _0x5c5196={};_0x5c5196[_0x2a51ce[_0x23ab('0x2a')]]={'$like':'%'+_0x325594[_0x23ab('0x33')]['filter']+'%'};return _0x5c5196;}})});}_0x975f5=_[_0x23ab('0x3d')]({},_0x975f5,_0x325594[_0x23ab('0x3f')]);var _0x365a02={'where':_0x975f5['where']};return db[_0x23ab('0x2e')][_0x23ab('0x22')](_0x365a02)[_0x23ab('0x28')](function(_0x2a6ba7){_0x349803['count']=_0x2a6ba7;if(_0x325594[_0x23ab('0x33')]['includeAll']){_0x975f5[_0x23ab('0x40')]=[{'all':!![]}];}return db[_0x23ab('0x2e')][_0x23ab('0x41')](_0x975f5);})[_0x23ab('0x28')](function(_0x28bb7a){_0x349803['rows']=_0x28bb7a;return _0x349803;})[_0x23ab('0x28')](respondWithFilteredResult(_0x3e5bf5,_0x975f5))['catch'](handleError(_0x3e5bf5,null));};exports['show']=function(_0x1f1cba,_0x42003e){var _0x1b0eda={'raw':![],'where':{'id':_0x1f1cba[_0x23ab('0x42')]['id']}},_0x50c3eb={};_0x50c3eb['model']=_['keys'](db['ServicenowAccount'][_0x23ab('0x2f')]);_0x50c3eb[_0x23ab('0x33')]=_[_0x23ab('0x43')](_0x1f1cba[_0x23ab('0x33')]);_0x50c3eb[_0x23ab('0x34')]=_[_0x23ab('0x35')](_0x50c3eb['model'],_0x50c3eb[_0x23ab('0x33')]);_0x1b0eda[_0x23ab('0x36')]=_[_0x23ab('0x35')](_0x50c3eb['model'],qs[_0x23ab('0x37')](_0x1f1cba[_0x23ab('0x33')][_0x23ab('0x37')]));_0x1b0eda[_0x23ab('0x36')]=_0x1b0eda[_0x23ab('0x36')]['length']?_0x1b0eda[_0x23ab('0x36')]:_0x50c3eb['model'];if(_0x1f1cba[_0x23ab('0x33')]['includeAll']){_0x1b0eda[_0x23ab('0x40')]=[{'all':!![]}];}_0x1b0eda=_[_0x23ab('0x3d')]({},_0x1b0eda,_0x1f1cba[_0x23ab('0x3f')]);return db[_0x23ab('0x2e')][_0x23ab('0x44')](_0x1b0eda)['then'](handleEntityNotFound(_0x42003e,null))[_0x23ab('0x28')](respondWithResult(_0x42003e,null))[_0x23ab('0x45')](handleError(_0x42003e,null));};exports[_0x23ab('0x46')]=function(_0x342fc2,_0x8d98da){return db[_0x23ab('0x2e')][_0x23ab('0x46')](_0x342fc2[_0x23ab('0x47')],{})[_0x23ab('0x28')](respondWithResult(_0x8d98da,0xc9))[_0x23ab('0x45')](handleError(_0x8d98da,null));};exports[_0x23ab('0x27')]=function(_0x2ce090,_0x179acc){if(_0x2ce090[_0x23ab('0x47')]['id']){delete _0x2ce090[_0x23ab('0x47')]['id'];}return db['ServicenowAccount'][_0x23ab('0x44')]({'where':{'id':_0x2ce090[_0x23ab('0x42')]['id']}})[_0x23ab('0x28')](handleEntityNotFound(_0x179acc,null))[_0x23ab('0x28')](saveUpdates(_0x2ce090[_0x23ab('0x47')],null))[_0x23ab('0x28')](respondWithResult(_0x179acc,null))['catch'](handleError(_0x179acc,null));};exports[_0x23ab('0x48')]=function(_0x5c67d9,_0x30b544){return db[_0x23ab('0x2e')][_0x23ab('0x44')]({'where':{'id':_0x5c67d9[_0x23ab('0x42')]['id']}})[_0x23ab('0x28')](handleEntityNotFound(_0x30b544,null))['then'](removeEntity(_0x30b544,null))[_0x23ab('0x45')](handleError(_0x30b544,null));};exports['getConfigurations']=function(_0x13446e,_0x307daa,_0x30d62d){var _0x3af6d6={};var _0x389f72={};var _0x520aed;var _0x2eb521;return db[_0x23ab('0x2e')][_0x23ab('0x49')]({'where':{'id':_0x13446e['params']['id']}})['then'](handleEntityNotFound(_0x307daa,null))[_0x23ab('0x28')](function(_0x3eaac4){if(_0x3eaac4){_0x520aed=_0x3eaac4;_0x389f72[_0x23ab('0x32')]=_['keys'](db[_0x23ab('0x4a')][_0x23ab('0x2f')]);_0x389f72[_0x23ab('0x33')]=_[_0x23ab('0x43')](_0x13446e[_0x23ab('0x33')]);_0x389f72[_0x23ab('0x34')]=_['intersection'](_0x389f72[_0x23ab('0x32')],_0x389f72['query']);_0x3af6d6[_0x23ab('0x36')]=_[_0x23ab('0x35')](_0x389f72[_0x23ab('0x32')],qs[_0x23ab('0x37')](_0x13446e[_0x23ab('0x33')][_0x23ab('0x37')]));_0x3af6d6['attributes']=_0x3af6d6['attributes']['length']?_0x3af6d6['attributes']:_0x389f72[_0x23ab('0x32')];_0x3af6d6[_0x23ab('0x4b')]=qs['sort'](_0x13446e['query'][_0x23ab('0x3b')]);_0x3af6d6[_0x23ab('0x3c')]=qs[_0x23ab('0x34')](_[_0x23ab('0x4c')](_0x13446e[_0x23ab('0x33')],_0x389f72[_0x23ab('0x34')]));if(_0x13446e['query']['filter']){_0x3af6d6[_0x23ab('0x3c')]=_[_0x23ab('0x3d')](_0x3af6d6[_0x23ab('0x3c')],{'$or':_[_0x23ab('0x2d')](_0x3af6d6[_0x23ab('0x36')],function(_0xc21fd4){var _0x5a3005={};_0x5a3005[_0xc21fd4]={'$like':'%'+_0x13446e[_0x23ab('0x33')][_0x23ab('0x4d')]+'%'};return _0x5a3005;})});}_0x3af6d6=_[_0x23ab('0x3d')]({},_0x3af6d6,_0x13446e[_0x23ab('0x3f')]);return _0x520aed['getConfigurations'](_0x3af6d6);}})[_0x23ab('0x28')](function(_0x370822){if(_0x370822){_0x2eb521=_0x370822[_0x23ab('0x38')];if(!_0x13446e[_0x23ab('0x33')]['hasOwnProperty'](_0x23ab('0x3a'))){_0x3af6d6['limit']=qs['limit'](_0x13446e[_0x23ab('0x33')][_0x23ab('0x20')]);_0x3af6d6[_0x23ab('0x1f')]=qs[_0x23ab('0x1f')](_0x13446e[_0x23ab('0x33')][_0x23ab('0x1f')]);}return _0x520aed[_0x23ab('0x4e')](_0x3af6d6);}})[_0x23ab('0x28')](function(_0x41a114){if(_0x41a114){return _0x41a114?{'count':_0x2eb521,'rows':_0x41a114}:null;}})[_0x23ab('0x28')](respondWithResult(_0x307daa,null))[_0x23ab('0x45')](handleError(_0x307daa,null));};exports[_0x23ab('0x4f')]=function(_0x52bd6f,_0x317c68,_0x2e5bba){if(_0x52bd6f[_0x23ab('0x47')]['id']){delete _0x52bd6f[_0x23ab('0x47')]['id'];}return db[_0x23ab('0x2e')][_0x23ab('0x49')]({'where':{'id':_0x52bd6f[_0x23ab('0x42')]['id']}})[_0x23ab('0x28')](handleEntityNotFound(_0x317c68,null))['then'](function(_0x5dd007){if(_0x5dd007){_0x52bd6f[_0x23ab('0x47')]['AccountId']=_0x5dd007['id'];_0x52bd6f[_0x23ab('0x47')][_0x23ab('0x50')]=integrations[_0x23ab('0x51')](_0x52bd6f[_0x23ab('0x47')][_0x23ab('0x52')],_0x52bd6f[_0x23ab('0x47')][_0x23ab('0x3e')]);_0x52bd6f[_0x23ab('0x47')][_0x23ab('0x53')]=integrations['getDescriptions'](_0x52bd6f[_0x23ab('0x47')][_0x23ab('0x52')],_0x52bd6f['body'][_0x23ab('0x3e')]);return db[_0x23ab('0x4a')][_0x23ab('0x46')](_0x52bd6f[_0x23ab('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0x23ab('0x50')},{'model':db[_0x23ab('0x54')],'as':_0x23ab('0x53')}]});}return null;})[_0x23ab('0x28')](respondWithResult(_0x317c68,null))[_0x23ab('0x45')](handleError(_0x317c68,null));};exports[_0x23ab('0x55')]=function(_0x5c22a2,_0x18afea,_0xe3b0f5){var _0x35996e=[_0x23ab('0x56'),_0x23ab('0x57'),_0x23ab('0x58'),_0x23ab('0x59'),_0x23ab('0x5a'),'notify',_0x23ab('0x5b'),'severity',_0x23ab('0x5c')];var _0x5df9cf=[_0x23ab('0x5d'),_0x23ab('0x56'),_0x23ab('0x5e'),_0x23ab('0x5f'),_0x23ab('0x60'),'sys_updated_on',_0x23ab('0x61'),_0x23ab('0x57'),_0x23ab('0x62'),_0x23ab('0x63'),'resolved_by',_0x23ab('0x64'),_0x23ab('0x65'),'user_input','sys_created_on',_0x23ab('0x66'),_0x23ab('0x67'),_0x23ab('0x68'),_0x23ab('0x58'),_0x23ab('0x4b'),_0x23ab('0x69'),_0x23ab('0x6a'),_0x23ab('0x6b'),_0x23ab('0x6c'),_0x23ab('0x6d'),_0x23ab('0x6e'),_0x23ab('0x6f'),'business_service',_0x23ab('0x70'),_0x23ab('0x71'),'rfc',_0x23ab('0x72'),'expected_start',_0x23ab('0x73'),_0x23ab('0x74'),_0x23ab('0x75'),_0x23ab('0x76'),_0x23ab('0x77'),_0x23ab('0x78'),'caller_id',_0x23ab('0x79'),_0x23ab('0x59'),'work_notes',_0x23ab('0x7a'),'close_code',_0x23ab('0x7b'),_0x23ab('0x7c'),_0x23ab('0x7d'),'assignment_group',_0x23ab('0x7e'),_0x23ab('0x7f'),'description',_0x23ab('0x80'),_0x23ab('0x81'),'sys_class_name','close_notes',_0x23ab('0x82'),_0x23ab('0x83'),'parent_incident',_0x23ab('0x84'),_0x23ab('0x85'),_0x23ab('0x86'),_0x23ab('0x5b'),_0x23ab('0x87'),_0x23ab('0x88'),_0x23ab('0x89'),'reassignment_count',_0x23ab('0x8a'),'assigned_to',_0x23ab('0x8b'),'comments',_0x23ab('0x8c'),'approval','comments_and_work_notes',_0x23ab('0x8d'),_0x23ab('0x8e'),_0x23ab('0x8f'),_0x23ab('0x90'),_0x23ab('0x91'),_0x23ab('0x92'),_0x23ab('0x93'),_0x23ab('0x94'),_0x23ab('0x5c')];var _0x5ef8ad='';var _0x5a33bf='';var _0x15e6be=[];var _0x5307d7='';var _0x44eb56='';var _0x45d0ba=[];var _0x5a9d31='';var _0x49afcb='';var _0x303896={};var _0xb59ab9='';return db[_0x23ab('0x2e')][_0x23ab('0x49')]({'where':{'id':_0x5c22a2[_0x23ab('0x42')]['id']},'attributes':['id',_0x23ab('0x95'),_0x23ab('0x96'),_0x23ab('0x97'),'remoteUri',_0x23ab('0x98')]})[_0x23ab('0x28')](handleEntityNotFound(_0x18afea,null))[_0x23ab('0x28')](function(_0x3f4230){if(_0x3f4230){_0xb59ab9=_0x3f4230[_0x23ab('0x99')];var _0x18c3d7=_0xb59ab9[_0x23ab('0x9a')](-0x1);if(_0x18c3d7==='/'){_0xb59ab9=_0xb59ab9['substring'](0x0,_0xb59ab9[_0x23ab('0x9b')](_0x18c3d7));}_0x49afcb=util[_0x23ab('0x9c')](_0x23ab('0x9d'),_0xb59ab9);_0x5a9d31=util[_0x23ab('0x9c')]('%s/api/now/table/',_0xb59ab9);_0x303896={'user':_0x3f4230[_0x23ab('0x95')],'pass':_0x3f4230[_0x23ab('0x96')]};var _0x3aefd3={'method':_0x23ab('0x9e'),'uri':_0x49afcb+_0x23ab('0x9f'),'auth':_0x303896,'json':!![]};return rp(_0x3aefd3);}})[_0x23ab('0x28')](function(_0x2cf57d){if(_0x2cf57d[_0x23ab('0xa0')][_0x23ab('0x38')]>0x0){_0x5ef8ad=_0x2cf57d[_0x23ab('0xa0')];}console['log'](_0x23ab('0xa1'),_0x5ef8ad);_0x45d0ba=[];_0x5a33bf=Object[_0x23ab('0xa2')]([],_0x5ef8ad);_[_0x23ab('0xa3')](_0x5a33bf,function(_0x55e4d9){return!_0x35996e[_0x23ab('0xa4')](_0x55e4d9['name']);});_0x5a33bf[_0x23ab('0xa5')](function(_0x2f8f0f){var _0x4e3af2=createFieldObject(_0x5a9d31,_0x303896,_0x2f8f0f[_0x23ab('0xa6')],_0x2f8f0f[_0x23ab('0x2a')],_0x2f8f0f[_0x23ab('0xa7')],![]);_0x45d0ba[_0x23ab('0xa8')](_0x4e3af2);});return Promise[_0x23ab('0xa9')](_0x45d0ba);})[_0x23ab('0x28')](function(_0x2c6477){_0x15e6be=_0x2c6477;_0x5307d7=Object[_0x23ab('0xa2')]([],_0x5ef8ad);console[_0x23ab('0xaa')](_0x23ab('0xab'),_0x5ef8ad);_[_0x23ab('0xa3')](_0x5307d7,function(_0x2601b9){return _0x5df9cf['includes'](_0x2601b9[_0x23ab('0x2a')]);});console['log'](_0x23ab('0xac'),_0x5307d7);_0x45d0ba=[];_0x5307d7['forEach'](function(_0x41d98c){var _0x82ef06=createFieldObject(_0x5a9d31,_0x303896,_0x41d98c['internalType'],_0x41d98c[_0x23ab('0x2a')],_0x41d98c[_0x23ab('0xa7')],!![]);_0x45d0ba[_0x23ab('0xa8')](_0x82ef06);});return Promise[_0x23ab('0xa9')](_0x45d0ba);})[_0x23ab('0x28')](function(_0x39db9f){_0x44eb56=_0x39db9f;var _0x465ef0=_0x15e6be[_0x23ab('0xad')](_0x44eb56);return{'count':_0x465ef0[_0x23ab('0x38')],'rows':_0x465ef0};})[_0x23ab('0x28')](respondWithResult(_0x18afea,null))['catch'](function(_0x11c2bd){console[_0x23ab('0xaa')](_0x23ab('0xae')+_0x11c2bd);var _0x3864ec=_0x5c22a2['query'][_0x23ab('0xaf')]?0x1f4:_0x11c2bd[_0x23ab('0xb0')]||0x1f4;logger[_0x23ab('0x29')](_0x11c2bd[_0x23ab('0xb1')]);delete _0x11c2bd[_0x23ab('0x2a')];if(_0x3864ec===0x191){_0x3864ec=0x190;}_0x18afea[_0x23ab('0x1d')](_0x3864ec)['send'](_0x5c22a2['query'][_0x23ab('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x11c2bd[_0x23ab('0xb0')]}:_0x11c2bd);});};function createFieldObject(_0x1905ad,_0x123c57,_0x5ed08b,_0x4a1337,_0x4af45d,_0x6f1ebc){return new Promise(function(_0x1ae4da,_0x5cc95a){var _0x1aadf9={'id':_0x4a1337,'name':_0x4af45d,'custom':_0x6f1ebc};if(_0x5ed08b===_0x23ab('0xb2')){_0x1aadf9[_0x23ab('0x3f')]=[{'name':_0x23ab('0xb3'),'value':'true'},{'name':'False','value':_0x23ab('0xb4')}];_0x1ae4da(_0x1aadf9);}else{var _0x1742fc={'method':_0x23ab('0x9e'),'uri':_0x1905ad+_0x23ab('0xb5')+_0x4a1337,'auth':_0x123c57,'json':!![]};return rp(_0x1742fc)[_0x23ab('0x28')](function(_0x2a1f1b){var _0x1bc352=[];if(_0x2a1f1b['result'][_0x23ab('0x38')]>0x0){_0x2a1f1b[_0x23ab('0xa0')]['forEach'](function(_0x1c3ba5){if(_0x1c3ba5['inactive']===_0x23ab('0xb4')){var _0x16bcff={'name':_0x1c3ba5[_0x23ab('0xa7')],'value':_0x1c3ba5[_0x23ab('0xb6')]};_0x1bc352['push'](_0x16bcff);}});}_0x1aadf9[_0x23ab('0x3f')]=_0x1bc352;if(_0x1aadf9['options']['length']>0x0){_0x1ae4da(_0x1aadf9);}else{if(_0x6f1ebc==![]){_0x1ae4da();}else{_0x1ae4da(_0x1aadf9);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 779dfec..b9cad39 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 _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x4b970f,_0x38efff){var _0x1d21f5=function(_0x5b7584){while(--_0x5b7584){_0x4b970f['push'](_0x4b970f['shift']());}};_0x1d21f5(++_0x38efff);}(_0xd8fb,0x99));var _0xbd8f=function(_0x25d3b6,_0x5ef2dc){_0x25d3b6=_0x25d3b6-0x0;var _0x749492=_0xd8fb[_0x25d3b6];return _0x749492;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x453bc0,_0x300419){var _0x57c9bb=function(_0x11e85e){while(--_0x11e85e){_0x453bc0['push'](_0x453bc0['shift']());}};_0x57c9bb(++_0x300419);}(_0xe14b,0x93));var _0xbe14=function(_0x344a0a,_0x59c402){_0x344a0a=_0x344a0a-0x0;var _0x589429=_0xe14b[_0x344a0a];return _0x589429;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index ac6130a..5ccddd4 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 _0x72d6=['util','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','attributes','limit','include','model','map','ShowServicenowAccount','find','where','lodash'];(function(_0xfffb9,_0x1601e2){var _0x3eb52c=function(_0x519c49){while(--_0x519c49){_0xfffb9['push'](_0xfffb9['shift']());}};_0x3eb52c(++_0x1601e2);}(_0x72d6,0xd8));var _0x672d=function(_0x4942ff,_0x7e10c6){_0x4942ff=_0x4942ff-0x0;var _0x132368=_0x72d6[_0x4942ff];return _0x132368;};'use strict';var _=require(_0x672d('0x0'));var util=require(_0x672d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x672d('0x2'));var fs=require('fs');var Redis=require(_0x672d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x672d('0x4'));var jayson=require(_0x672d('0x5'));var client=jayson[_0x672d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x442702,_0x9f9e79,_0x2bad55){return new BPromise(function(_0x273b39,_0x243806){return client['request'](_0x442702,_0x2bad55)[_0x672d('0x7')](function(_0x1bcb12){logger[_0x672d('0x8')](_0x672d('0x9'),_0x9f9e79,'request\x20sent');logger[_0x672d('0xa')](_0x672d('0xb'),_0x9f9e79,'request\x20sent',JSON[_0x672d('0xc')](_0x1bcb12));if(_0x1bcb12[_0x672d('0xd')]){if(_0x1bcb12[_0x672d('0xd')][_0x672d('0xe')]===0x1f4){logger[_0x672d('0xd')](_0x672d('0x9'),_0x9f9e79,_0x1bcb12[_0x672d('0xd')][_0x672d('0xf')]);return _0x243806(_0x1bcb12[_0x672d('0xd')][_0x672d('0xf')]);}logger[_0x672d('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x9f9e79,_0x1bcb12[_0x672d('0xd')][_0x672d('0xf')]);return _0x273b39(_0x1bcb12['error']['message']);}else{logger[_0x672d('0x8')](_0x672d('0x9'),_0x9f9e79,_0x672d('0x10'));_0x273b39(_0x1bcb12[_0x672d('0x11')][_0x672d('0xf')]);}})[_0x672d('0x12')](function(_0x379139){logger[_0x672d('0xd')](_0x672d('0x9'),_0x9f9e79,_0x379139);_0x243806(_0x379139);});});}exports[_0x672d('0x13')]=function(_0x33cf4){var _0x1ad291=this;return new Promise(function(_0x4cea79,_0x2b0adc){return db[_0x672d('0x14')][_0x672d('0x15')]({'raw':_0x33cf4[_0x672d('0x16')]?_0x33cf4['options']['raw']===undefined?!![]:![]:!![],'where':_0x33cf4[_0x672d('0x16')]?_0x33cf4[_0x672d('0x16')]['where']||null:null,'attributes':_0x33cf4[_0x672d('0x16')]?_0x33cf4[_0x672d('0x16')][_0x672d('0x17')]||null:null,'limit':_0x33cf4['options']?_0x33cf4[_0x672d('0x16')][_0x672d('0x18')]||null:null,'include':_0x33cf4[_0x672d('0x16')]?_0x33cf4[_0x672d('0x16')][_0x672d('0x19')]?_['map'](_0x33cf4[_0x672d('0x16')][_0x672d('0x19')],function(_0x332ce8){return{'model':db[_0x332ce8[_0x672d('0x1a')]],'as':_0x332ce8['as'],'attributes':_0x332ce8['attributes'],'include':_0x332ce8['include']?_[_0x672d('0x1b')](_0x332ce8[_0x672d('0x19')],function(_0x1888d8){return{'model':db[_0x1888d8[_0x672d('0x1a')]],'as':_0x1888d8['as'],'attributes':_0x1888d8[_0x672d('0x17')],'include':_0x1888d8['include']?_['map'](_0x1888d8[_0x672d('0x19')],function(_0x4b0d1a){return{'model':db[_0x4b0d1a[_0x672d('0x1a')]],'as':_0x4b0d1a['as'],'attributes':_0x4b0d1a[_0x672d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x672d('0x7')](function(_0x55e2ea){logger['info']('GetServicenowAccount',_0x33cf4);logger[_0x672d('0xa')]('GetServicenowAccount',_0x33cf4,JSON[_0x672d('0xc')](_0x55e2ea));_0x4cea79(_0x55e2ea);})[_0x672d('0x12')](function(_0x16d2bc){logger[_0x672d('0xd')](_0x672d('0x13'),_0x16d2bc[_0x672d('0xf')],_0x33cf4);_0x2b0adc(_0x1ad291[_0x672d('0xd')](0x1f4,_0x16d2bc[_0x672d('0xf')]));});});};exports[_0x672d('0x1c')]=function(_0x348d55){var _0x109584=this;return new Promise(function(_0x4106b0,_0x25c420){return db[_0x672d('0x14')][_0x672d('0x1d')]({'raw':_0x348d55[_0x672d('0x16')]?_0x348d55[_0x672d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x348d55['options']?_0x348d55[_0x672d('0x16')][_0x672d('0x1e')]||null:null,'attributes':_0x348d55[_0x672d('0x16')]?_0x348d55[_0x672d('0x16')][_0x672d('0x17')]||null:null,'include':_0x348d55['options']?_0x348d55['options'][_0x672d('0x19')]?_['map'](_0x348d55['options'][_0x672d('0x19')],function(_0x5b6d14){return{'model':db[_0x5b6d14['model']],'as':_0x5b6d14['as'],'attributes':_0x5b6d14[_0x672d('0x17')],'include':_0x5b6d14[_0x672d('0x19')]?_['map'](_0x5b6d14[_0x672d('0x19')],function(_0x2f1933){return{'model':db[_0x2f1933[_0x672d('0x1a')]],'as':_0x2f1933['as'],'attributes':_0x2f1933['attributes'],'include':_0x2f1933[_0x672d('0x19')]?_[_0x672d('0x1b')](_0x2f1933[_0x672d('0x19')],function(_0x402205){return{'model':db[_0x402205[_0x672d('0x1a')]],'as':_0x402205['as'],'attributes':_0x402205['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe50713){logger[_0x672d('0x8')](_0x672d('0x1c'),_0x348d55);logger['debug'](_0x672d('0x1c'),_0x348d55,JSON[_0x672d('0xc')](_0xe50713));_0x4106b0(_0xe50713);})[_0x672d('0x12')](function(_0x19f829){logger[_0x672d('0xd')](_0x672d('0x1c'),_0x19f829['message'],_0x348d55);_0x25c420(_0x109584[_0x672d('0xd')](0x1f4,_0x19f829[_0x672d('0xf')]));});});}; \ No newline at end of file +var _0x60b4=['error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','include','map','attributes','model','stringify','ShowServicenowAccount','ServicenowAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0x5b589,_0x2b654a){var _0x372e46=function(_0x11da95){while(--_0x11da95){_0x5b589['push'](_0x5b589['shift']());}};_0x372e46(++_0x2b654a);}(_0x60b4,0xd2));var _0x460b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x60b4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x460b('0x0'));var util=require(_0x460b('0x1'));var moment=require(_0x460b('0x2'));var BPromise=require(_0x460b('0x3'));var rs=require(_0x460b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x460b('0x5'));var logger=require('../../config/logger')(_0x460b('0x6'));var config=require('../../config/environment');var jayson=require(_0x460b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3433d0,_0x368c65,_0x3e6b41){return new BPromise(function(_0x117f71,_0x5bb6cd){return client['request'](_0x3433d0,_0x3e6b41)[_0x460b('0x8')](function(_0x410e0b){logger[_0x460b('0x9')](_0x460b('0xa'),_0x368c65,_0x460b('0xb'));logger[_0x460b('0xc')](_0x460b('0xd'),_0x368c65,'request\x20sent',JSON['stringify'](_0x410e0b));if(_0x410e0b['error']){if(_0x410e0b[_0x460b('0xe')][_0x460b('0xf')]===0x1f4){logger[_0x460b('0xe')](_0x460b('0xa'),_0x368c65,_0x410e0b[_0x460b('0xe')][_0x460b('0x10')]);return _0x5bb6cd(_0x410e0b[_0x460b('0xe')]['message']);}logger[_0x460b('0xe')](_0x460b('0xa'),_0x368c65,_0x410e0b[_0x460b('0xe')][_0x460b('0x10')]);return _0x117f71(_0x410e0b[_0x460b('0xe')][_0x460b('0x10')]);}else{logger[_0x460b('0x9')](_0x460b('0xa'),_0x368c65,_0x460b('0xb'));_0x117f71(_0x410e0b[_0x460b('0x11')][_0x460b('0x10')]);}})[_0x460b('0x12')](function(_0x5ee611){logger[_0x460b('0xe')](_0x460b('0xa'),_0x368c65,_0x5ee611);_0x5bb6cd(_0x5ee611);});});}exports[_0x460b('0x13')]=function(_0x51495d){var _0x2ca868=this;return new Promise(function(_0x23de8d,_0x55fa0d){return db['ServicenowAccount'][_0x460b('0x14')]({'raw':_0x51495d[_0x460b('0x15')]?_0x51495d[_0x460b('0x15')][_0x460b('0x16')]===undefined?!![]:![]:!![],'where':_0x51495d[_0x460b('0x15')]?_0x51495d['options'][_0x460b('0x17')]||null:null,'attributes':_0x51495d[_0x460b('0x15')]?_0x51495d[_0x460b('0x15')]['attributes']||null:null,'limit':_0x51495d[_0x460b('0x15')]?_0x51495d['options']['limit']||null:null,'include':_0x51495d[_0x460b('0x15')]?_0x51495d[_0x460b('0x15')][_0x460b('0x18')]?_[_0x460b('0x19')](_0x51495d[_0x460b('0x15')][_0x460b('0x18')],function(_0x5001c1){return{'model':db[_0x5001c1['model']],'as':_0x5001c1['as'],'attributes':_0x5001c1[_0x460b('0x1a')],'include':_0x5001c1[_0x460b('0x18')]?_['map'](_0x5001c1[_0x460b('0x18')],function(_0x84ce9c){return{'model':db[_0x84ce9c[_0x460b('0x1b')]],'as':_0x84ce9c['as'],'attributes':_0x84ce9c['attributes'],'include':_0x84ce9c[_0x460b('0x18')]?_['map'](_0x84ce9c[_0x460b('0x18')],function(_0x7a4541){return{'model':db[_0x7a4541[_0x460b('0x1b')]],'as':_0x7a4541['as'],'attributes':_0x7a4541['attributes']};}):[]};}):[]};}):[]:[]})[_0x460b('0x8')](function(_0x4c7112){logger[_0x460b('0x9')](_0x460b('0x13'),_0x51495d);logger[_0x460b('0xc')](_0x460b('0x13'),_0x51495d,JSON[_0x460b('0x1c')](_0x4c7112));_0x23de8d(_0x4c7112);})[_0x460b('0x12')](function(_0x5658a6){logger[_0x460b('0xe')](_0x460b('0x13'),_0x5658a6[_0x460b('0x10')],_0x51495d);_0x55fa0d(_0x2ca868[_0x460b('0xe')](0x1f4,_0x5658a6[_0x460b('0x10')]));});});};exports[_0x460b('0x1d')]=function(_0x1dc814){var _0x556bcb=this;return new Promise(function(_0x133f91,_0x16c86f){return db[_0x460b('0x1e')][_0x460b('0x1f')]({'raw':_0x1dc814[_0x460b('0x15')]?_0x1dc814[_0x460b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1dc814[_0x460b('0x15')]?_0x1dc814[_0x460b('0x15')]['where']||null:null,'attributes':_0x1dc814[_0x460b('0x15')]?_0x1dc814['options'][_0x460b('0x1a')]||null:null,'include':_0x1dc814[_0x460b('0x15')]?_0x1dc814['options'][_0x460b('0x18')]?_[_0x460b('0x19')](_0x1dc814[_0x460b('0x15')]['include'],function(_0x7e4c67){return{'model':db[_0x7e4c67[_0x460b('0x1b')]],'as':_0x7e4c67['as'],'attributes':_0x7e4c67[_0x460b('0x1a')],'include':_0x7e4c67[_0x460b('0x18')]?_[_0x460b('0x19')](_0x7e4c67[_0x460b('0x18')],function(_0x204a16){return{'model':db[_0x204a16[_0x460b('0x1b')]],'as':_0x204a16['as'],'attributes':_0x204a16['attributes'],'include':_0x204a16[_0x460b('0x18')]?_[_0x460b('0x19')](_0x204a16[_0x460b('0x18')],function(_0x4448fc){return{'model':db[_0x4448fc['model']],'as':_0x4448fc['as'],'attributes':_0x4448fc[_0x460b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x460b('0x8')](function(_0x6ea556){logger[_0x460b('0x9')]('ShowServicenowAccount',_0x1dc814);logger['debug'](_0x460b('0x1d'),_0x1dc814,JSON[_0x460b('0x1c')](_0x6ea556));_0x133f91(_0x6ea556);})[_0x460b('0x12')](function(_0x45c0d1){logger[_0x460b('0xe')](_0x460b('0x1d'),_0x45c0d1['message'],_0x1dc814);_0x16c86f(_0x556bcb[_0x460b('0xe')](0x1f4,_0x45c0d1[_0x460b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 125c5f9..24388bc 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 _0x3399=['../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3399,0x12c));var _0x9339=function(_0x1f9501,_0x26db9d){_0x1f9501=_0x1f9501-0x0;var _0x503adf=_0x3399[_0x1f9501];return _0x503adf;};'use strict';var multer=require(_0x9339('0x0'));var util=require(_0x9339('0x1'));var path=require(_0x9339('0x2'));var timeout=require(_0x9339('0x3'));var express=require(_0x9339('0x4'));var router=express[_0x9339('0x5')]();var fs_extra=require(_0x9339('0x6'));var auth=require(_0x9339('0x7'));var interaction=require(_0x9339('0x8'));var config=require(_0x9339('0x9'));var controller=require(_0x9339('0xa'));router[_0x9339('0xb')]('/',auth[_0x9339('0xc')](),controller[_0x9339('0xd')]);router['get'](_0x9339('0xe'),auth['isAuthenticated'](),controller[_0x9339('0xf')]);router[_0x9339('0xb')](_0x9339('0x10'),auth[_0x9339('0xc')](),controller[_0x9339('0x11')]);router['get'](_0x9339('0x12'),auth['isAuthenticated'](),controller[_0x9339('0x13')]);router['get'](_0x9339('0x14'),auth[_0x9339('0xc')](),controller[_0x9339('0x15')]);router[_0x9339('0x16')]('/',auth[_0x9339('0xc')](),controller[_0x9339('0x17')]);router[_0x9339('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x9339('0x19')]);router[_0x9339('0x1a')](_0x9339('0xe'),auth[_0x9339('0xc')](),controller['destroy']);module[_0x9339('0x1b')]=router; \ No newline at end of file +var _0xe863=['/:id/descriptions','getDescriptions','create','put','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','getFields'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe863,0x9e));var _0x3e86=function(_0x316c1d,_0x2250e5){_0x316c1d=_0x316c1d-0x0;var _0xdb8cb7=_0xe863[_0x316c1d];return _0xdb8cb7;};'use strict';var multer=require(_0x3e86('0x0'));var util=require('util');var path=require(_0x3e86('0x1'));var timeout=require(_0x3e86('0x2'));var express=require('express');var router=express[_0x3e86('0x3')]();var fs_extra=require(_0x3e86('0x4'));var auth=require(_0x3e86('0x5'));var interaction=require(_0x3e86('0x6'));var config=require('../../config/environment');var controller=require(_0x3e86('0x7'));router[_0x3e86('0x8')]('/',auth[_0x3e86('0x9')](),controller['index']);router['get'](_0x3e86('0xa'),auth['isAuthenticated'](),controller[_0x3e86('0xb')]);router['get']('/:id/fields',auth[_0x3e86('0x9')](),controller[_0x3e86('0xc')]);router['get']('/:id/subjects',auth[_0x3e86('0x9')](),controller['getSubjects']);router[_0x3e86('0x8')](_0x3e86('0xd'),auth[_0x3e86('0x9')](),controller[_0x3e86('0xe')]);router['post']('/',auth[_0x3e86('0x9')](),controller[_0x3e86('0xf')]);router[_0x3e86('0x10')]('/:id',auth[_0x3e86('0x9')](),controller['update']);router[_0x3e86('0x11')](_0x3e86('0xa'),auth[_0x3e86('0x9')](),controller['destroy']);module[_0x3e86('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 2a731c5..dce950f 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 _0x3c55=['STRING','sequelize'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x3c55,0x149));var _0x53c5=function(_0x221c74,_0x3ae394){_0x221c74=_0x221c74-0x0;var _0x48bf7d=_0x3c55[_0x221c74];return _0x48bf7d;};'use strict';var Sequelize=require(_0x53c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x53c5('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x44ef=['sequelize','exports'];(function(_0x631577,_0x38e35d){var _0x517397=function(_0x4f9228){while(--_0x4f9228){_0x631577['push'](_0x631577['shift']());}};_0x517397(++_0x38e35d);}(_0x44ef,0x8e));var _0xf44e=function(_0x50ce46,_0x3df64c){_0x50ce46=_0x50ce46-0x0;var _0x17990f=_0x44ef[_0x50ce46];return _0x17990f;};'use strict';var Sequelize=require(_0xf44e('0x0'));module[_0xf44e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 5e542c4..339a692 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 _0x4714=['status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','include','find','body','params','getFields','ServicenowField','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3538f1,_0x39601c){var _0x33eac2=function(_0x41f649){while(--_0x41f649){_0x3538f1['push'](_0x3538f1['shift']());}};_0x33eac2(++_0x39601c);}(_0x4714,0x1c0));var _0x4471=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4714[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x4471('0x0'));var rimraf=require(_0x4471('0x1'));var zipdir=require(_0x4471('0x2'));var jsonpatch=require(_0x4471('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4471('0x4'));var Mustache=require(_0x4471('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4471('0x6'));var csv=require('to-csv');var ejs=require(_0x4471('0x7'));var fs=require('fs');var fs_extra=require(_0x4471('0x8'));var _=require(_0x4471('0x9'));var squel=require(_0x4471('0xa'));var crypto=require(_0x4471('0xb'));var jsforce=require(_0x4471('0xc'));var deskjs=require(_0x4471('0xd'));var toCsv=require(_0x4471('0xe'));var querystring=require(_0x4471('0xf'));var Papa=require(_0x4471('0x10'));var Redis=require(_0x4471('0x11'));var authService=require(_0x4471('0x12'));var qs=require(_0x4471('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4471('0x14'))('api');var utils=require(_0x4471('0x15'));var config=require(_0x4471('0x16'));var licenseUtil=require(_0x4471('0x17'));var db=require(_0x4471('0x18'))['db'];function respondWithStatusCode(_0x417ae0,_0x3c038){_0x3c038=_0x3c038||0xcc;return function(_0x37ed80){if(_0x37ed80){return _0x417ae0[_0x4471('0x19')](_0x3c038);}return _0x417ae0[_0x4471('0x1a')](_0x3c038)[_0x4471('0x1b')]();};}function respondWithResult(_0x78b30b,_0xd7555a){_0xd7555a=_0xd7555a||0xc8;return function(_0x3a4bed){if(_0x3a4bed){return _0x78b30b[_0x4471('0x1a')](_0xd7555a)[_0x4471('0x1c')](_0x3a4bed);}};}function respondWithFilteredResult(_0x1fd5ca,_0x2eec3d){return function(_0x854a36){if(_0x854a36){var _0x57227b=typeof _0x2eec3d[_0x4471('0x1d')]==='undefined'&&typeof _0x2eec3d[_0x4471('0x1e')]==='undefined';var _0x28235c=_0x854a36[_0x4471('0x1f')];var _0x21dfe3=_0x57227b?0x0:_0x2eec3d[_0x4471('0x1d')];var _0x2fc8d4=_0x57227b?_0x854a36[_0x4471('0x1f')]:_0x2eec3d[_0x4471('0x1d')]+_0x2eec3d[_0x4471('0x1e')];var _0x193b92;if(_0x2fc8d4>=_0x28235c){_0x2fc8d4=_0x28235c;_0x193b92=0xc8;}else{_0x193b92=0xce;}_0x1fd5ca['status'](_0x193b92);return _0x1fd5ca['set'](_0x4471('0x20'),_0x21dfe3+'-'+_0x2fc8d4+'/'+_0x28235c)[_0x4471('0x1c')](_0x854a36);}return null;};}function patchUpdates(_0x341900){return function(_0x33a403){try{jsonpatch[_0x4471('0x21')](_0x33a403,_0x341900,!![]);}catch(_0x41b36f){return BPromise[_0x4471('0x22')](_0x41b36f);}return _0x33a403[_0x4471('0x23')]();};}function saveUpdates(_0x59e33f,_0x3b1612){return function(_0x36e445){if(_0x36e445){return _0x36e445[_0x4471('0x24')](_0x59e33f)[_0x4471('0x25')](function(_0x46a37c){return _0x46a37c;});}return null;};}function removeEntity(_0x387de9,_0x2ea605){return function(_0x514350){if(_0x514350){return _0x514350[_0x4471('0x26')]()[_0x4471('0x25')](function(){_0x387de9[_0x4471('0x1a')](0xcc)[_0x4471('0x1b')]();});}};}function handleEntityNotFound(_0x34f127,_0x41c673){return function(_0x52bb1a){if(!_0x52bb1a){_0x34f127[_0x4471('0x19')](0x194);}return _0x52bb1a;};}function handleError(_0x501539,_0x1b3386){_0x1b3386=_0x1b3386||0x1f4;return function(_0x54d774){logger[_0x4471('0x27')](_0x54d774[_0x4471('0x28')]);if(_0x54d774[_0x4471('0x29')]){delete _0x54d774[_0x4471('0x29')];}_0x501539[_0x4471('0x1a')](_0x1b3386)['send'](_0x54d774);};}exports[_0x4471('0x2a')]=function(_0x4beed5,_0xa3a2a9){var _0x1261ef={},_0x492ed6={},_0xf8a2b6={'count':0x0,'rows':[]};var _0x368bb9=_[_0x4471('0x2b')](db[_0x4471('0x2c')][_0x4471('0x2d')],function(_0x3aa122){return{'name':_0x3aa122[_0x4471('0x2e')],'type':_0x3aa122[_0x4471('0x2f')][_0x4471('0x30')]};});_0x492ed6[_0x4471('0x31')]=_['map'](_0x368bb9,_0x4471('0x29'));_0x492ed6[_0x4471('0x32')]=_[_0x4471('0x33')](_0x4beed5[_0x4471('0x32')]);_0x492ed6[_0x4471('0x34')]=_[_0x4471('0x35')](_0x492ed6[_0x4471('0x31')],_0x492ed6[_0x4471('0x32')]);_0x1261ef[_0x4471('0x36')]=_[_0x4471('0x35')](_0x492ed6[_0x4471('0x31')],qs[_0x4471('0x37')](_0x4beed5[_0x4471('0x32')]['fields']));_0x1261ef[_0x4471('0x36')]=_0x1261ef[_0x4471('0x36')][_0x4471('0x38')]?_0x1261ef[_0x4471('0x36')]:_0x492ed6[_0x4471('0x31')];if(!_0x4beed5[_0x4471('0x32')][_0x4471('0x39')]('nolimit')){_0x1261ef[_0x4471('0x1e')]=qs[_0x4471('0x1e')](_0x4beed5['query'][_0x4471('0x1e')]);_0x1261ef[_0x4471('0x1d')]=qs[_0x4471('0x1d')](_0x4beed5[_0x4471('0x32')][_0x4471('0x1d')]);}_0x1261ef[_0x4471('0x3a')]=qs[_0x4471('0x3b')](_0x4beed5[_0x4471('0x32')][_0x4471('0x3b')]);_0x1261ef[_0x4471('0x3c')]=qs['filters'](_[_0x4471('0x3d')](_0x4beed5[_0x4471('0x32')],_0x492ed6['filters']),_0x368bb9);if(_0x4beed5[_0x4471('0x32')][_0x4471('0x3e')]){_0x1261ef['where']=_[_0x4471('0x3f')](_0x1261ef[_0x4471('0x3c')],{'$or':_[_0x4471('0x2b')](_0x368bb9,function(_0x167246){if(_0x167246[_0x4471('0x2f')]!=='VIRTUAL'){var _0x4e79b4={};_0x4e79b4[_0x167246[_0x4471('0x29')]]={'$like':'%'+_0x4beed5[_0x4471('0x32')][_0x4471('0x3e')]+'%'};return _0x4e79b4;}})});}_0x1261ef=_[_0x4471('0x3f')]({},_0x1261ef,_0x4beed5[_0x4471('0x40')]);var _0x13f3fe={'where':_0x1261ef[_0x4471('0x3c')]};return db[_0x4471('0x2c')]['count'](_0x13f3fe)[_0x4471('0x25')](function(_0x4cd1a4){_0xf8a2b6['count']=_0x4cd1a4;if(_0x4beed5[_0x4471('0x32')][_0x4471('0x41')]){_0x1261ef['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x4471('0x42')](_0x1261ef);})['then'](function(_0x526dad){_0xf8a2b6[_0x4471('0x43')]=_0x526dad;return _0xf8a2b6;})[_0x4471('0x25')](respondWithFilteredResult(_0xa3a2a9,_0x1261ef))[_0x4471('0x44')](handleError(_0xa3a2a9,null));};exports['show']=function(_0x11ecec,_0x193f69){var _0x43f363={'raw':![],'where':{'id':_0x11ecec['params']['id']}},_0xb9452d={};_0xb9452d[_0x4471('0x31')]=_[_0x4471('0x33')](db[_0x4471('0x2c')][_0x4471('0x2d')]);_0xb9452d['query']=_[_0x4471('0x33')](_0x11ecec[_0x4471('0x32')]);_0xb9452d['filters']=_[_0x4471('0x35')](_0xb9452d[_0x4471('0x31')],_0xb9452d[_0x4471('0x32')]);_0x43f363[_0x4471('0x36')]=_[_0x4471('0x35')](_0xb9452d['model'],qs[_0x4471('0x37')](_0x11ecec[_0x4471('0x32')][_0x4471('0x37')]));_0x43f363[_0x4471('0x36')]=_0x43f363[_0x4471('0x36')][_0x4471('0x38')]?_0x43f363[_0x4471('0x36')]:_0xb9452d[_0x4471('0x31')];if(_0x11ecec[_0x4471('0x32')][_0x4471('0x41')]){_0x43f363[_0x4471('0x45')]=[{'all':!![]}];}_0x43f363=_['merge']({},_0x43f363,_0x11ecec[_0x4471('0x40')]);return db[_0x4471('0x2c')][_0x4471('0x46')](_0x43f363)[_0x4471('0x25')](handleEntityNotFound(_0x193f69,null))['then'](respondWithResult(_0x193f69,null))[_0x4471('0x44')](handleError(_0x193f69,null));};exports['create']=function(_0x58f730,_0x1eaa7f){return db[_0x4471('0x2c')]['create'](_0x58f730[_0x4471('0x47')],{})[_0x4471('0x25')](respondWithResult(_0x1eaa7f,0xc9))['catch'](handleError(_0x1eaa7f,null));};exports['update']=function(_0x46470c,_0x4cbaca){if(_0x46470c['body']['id']){delete _0x46470c[_0x4471('0x47')]['id'];}return db[_0x4471('0x2c')][_0x4471('0x46')]({'where':{'id':_0x46470c[_0x4471('0x48')]['id']}})[_0x4471('0x25')](handleEntityNotFound(_0x4cbaca,null))[_0x4471('0x25')](saveUpdates(_0x46470c['body'],null))['then'](respondWithResult(_0x4cbaca,null))[_0x4471('0x44')](handleError(_0x4cbaca,null));};exports[_0x4471('0x26')]=function(_0x55febb,_0x3401d4){return db['ServicenowConfiguration'][_0x4471('0x46')]({'where':{'id':_0x55febb[_0x4471('0x48')]['id']}})[_0x4471('0x25')](handleEntityNotFound(_0x3401d4,null))[_0x4471('0x25')](removeEntity(_0x3401d4,null))['catch'](handleError(_0x3401d4,null));};exports[_0x4471('0x49')]=function(_0x5b6e10,_0x4becdc,_0x688e57){var _0x2ecbb9={};var _0x1cbf38={};var _0x69f0a8;var _0x555caa;return db[_0x4471('0x2c')]['findOne']({'where':{'id':_0x5b6e10[_0x4471('0x48')]['id']}})['then'](handleEntityNotFound(_0x4becdc,null))['then'](function(_0x1c9d82){if(_0x1c9d82){_0x69f0a8=_0x1c9d82;_0x1cbf38['model']=_[_0x4471('0x33')](db[_0x4471('0x4a')][_0x4471('0x2d')]);_0x1cbf38['query']=_[_0x4471('0x33')](_0x5b6e10['query']);_0x1cbf38['filters']=_[_0x4471('0x35')](_0x1cbf38[_0x4471('0x31')],_0x1cbf38[_0x4471('0x32')]);_0x2ecbb9[_0x4471('0x36')]=_[_0x4471('0x35')](_0x1cbf38['model'],qs['fields'](_0x5b6e10[_0x4471('0x32')][_0x4471('0x37')]));_0x2ecbb9['attributes']=_0x2ecbb9[_0x4471('0x36')][_0x4471('0x38')]?_0x2ecbb9['attributes']:_0x1cbf38['model'];_0x2ecbb9[_0x4471('0x3a')]=qs[_0x4471('0x3b')](_0x5b6e10['query'][_0x4471('0x3b')]);_0x2ecbb9[_0x4471('0x3c')]=qs[_0x4471('0x34')](_[_0x4471('0x3d')](_0x5b6e10[_0x4471('0x32')],_0x1cbf38[_0x4471('0x34')]));if(_0x5b6e10['query'][_0x4471('0x3e')]){_0x2ecbb9[_0x4471('0x3c')]=_[_0x4471('0x3f')](_0x2ecbb9[_0x4471('0x3c')],{'$or':_['map'](_0x2ecbb9[_0x4471('0x36')],function(_0x1c7b5c){var _0x1d9c6a={};_0x1d9c6a[_0x1c7b5c]={'$like':'%'+_0x5b6e10[_0x4471('0x32')]['filter']+'%'};return _0x1d9c6a;})});}_0x2ecbb9=_[_0x4471('0x3f')]({},_0x2ecbb9,_0x5b6e10['options']);return _0x69f0a8[_0x4471('0x49')](_0x2ecbb9);}})[_0x4471('0x25')](function(_0x162aab){if(_0x162aab){_0x555caa=_0x162aab[_0x4471('0x38')];if(!_0x5b6e10[_0x4471('0x32')][_0x4471('0x39')](_0x4471('0x4b'))){_0x2ecbb9[_0x4471('0x1e')]=qs[_0x4471('0x1e')](_0x5b6e10[_0x4471('0x32')][_0x4471('0x1e')]);_0x2ecbb9[_0x4471('0x1d')]=qs[_0x4471('0x1d')](_0x5b6e10[_0x4471('0x32')][_0x4471('0x1d')]);}return _0x69f0a8[_0x4471('0x49')](_0x2ecbb9);}})['then'](function(_0x5558fb){if(_0x5558fb){return _0x5558fb?{'count':_0x555caa,'rows':_0x5558fb}:null;}})['then'](respondWithResult(_0x4becdc,null))[_0x4471('0x44')](handleError(_0x4becdc,null));};exports[_0x4471('0x4c')]=function(_0x210137,_0x13f418,_0x58d593){var _0x305a8b={};var _0x1663ec={};var _0x2cbfa0;var _0x1cda54;return db[_0x4471('0x2c')][_0x4471('0x4d')]({'where':{'id':_0x210137[_0x4471('0x48')]['id']}})[_0x4471('0x25')](handleEntityNotFound(_0x13f418,null))['then'](function(_0x1339e4){if(_0x1339e4){_0x2cbfa0=_0x1339e4;_0x1663ec['model']=_[_0x4471('0x33')](db[_0x4471('0x4a')][_0x4471('0x2d')]);_0x1663ec[_0x4471('0x32')]=_[_0x4471('0x33')](_0x210137['query']);_0x1663ec[_0x4471('0x34')]=_[_0x4471('0x35')](_0x1663ec[_0x4471('0x31')],_0x1663ec[_0x4471('0x32')]);_0x305a8b['attributes']=_['intersection'](_0x1663ec[_0x4471('0x31')],qs['fields'](_0x210137['query'][_0x4471('0x37')]));_0x305a8b['attributes']=_0x305a8b[_0x4471('0x36')][_0x4471('0x38')]?_0x305a8b['attributes']:_0x1663ec[_0x4471('0x31')];_0x305a8b['order']=qs['sort'](_0x210137[_0x4471('0x32')][_0x4471('0x3b')]);_0x305a8b[_0x4471('0x3c')]=qs[_0x4471('0x34')](_[_0x4471('0x3d')](_0x210137[_0x4471('0x32')],_0x1663ec[_0x4471('0x34')]));if(_0x210137['query'][_0x4471('0x3e')]){_0x305a8b[_0x4471('0x3c')]=_[_0x4471('0x3f')](_0x305a8b[_0x4471('0x3c')],{'$or':_[_0x4471('0x2b')](_0x305a8b['attributes'],function(_0x1b2c7a){var _0xeaf388={};_0xeaf388[_0x1b2c7a]={'$like':'%'+_0x210137['query'][_0x4471('0x3e')]+'%'};return _0xeaf388;})});}_0x305a8b=_['merge']({},_0x305a8b,_0x210137[_0x4471('0x40')]);return _0x2cbfa0[_0x4471('0x4c')](_0x305a8b);}})[_0x4471('0x25')](function(_0x37d05f){if(_0x37d05f){_0x1cda54=_0x37d05f[_0x4471('0x38')];if(!_0x210137[_0x4471('0x32')][_0x4471('0x39')]('nolimit')){_0x305a8b[_0x4471('0x1e')]=qs[_0x4471('0x1e')](_0x210137[_0x4471('0x32')][_0x4471('0x1e')]);_0x305a8b[_0x4471('0x1d')]=qs['offset'](_0x210137['query']['offset']);}return _0x2cbfa0['getSubjects'](_0x305a8b);}})[_0x4471('0x25')](function(_0x44d45a){if(_0x44d45a){return _0x44d45a?{'count':_0x1cda54,'rows':_0x44d45a}:null;}})['then'](respondWithResult(_0x13f418,null))[_0x4471('0x44')](handleError(_0x13f418,null));};exports['getDescriptions']=function(_0x872485,_0x1046f8,_0x565918){var _0xbad7e5={};var _0x309367={};var _0x59b1af;var _0x11300f;return db[_0x4471('0x2c')][_0x4471('0x4d')]({'where':{'id':_0x872485[_0x4471('0x48')]['id']}})[_0x4471('0x25')](handleEntityNotFound(_0x1046f8,null))[_0x4471('0x25')](function(_0x14502d){if(_0x14502d){_0x59b1af=_0x14502d;_0x309367[_0x4471('0x31')]=_[_0x4471('0x33')](db['ServicenowField']['rawAttributes']);_0x309367[_0x4471('0x32')]=_['keys'](_0x872485['query']);_0x309367[_0x4471('0x34')]=_['intersection'](_0x309367['model'],_0x309367[_0x4471('0x32')]);_0xbad7e5['attributes']=_[_0x4471('0x35')](_0x309367[_0x4471('0x31')],qs[_0x4471('0x37')](_0x872485[_0x4471('0x32')]['fields']));_0xbad7e5['attributes']=_0xbad7e5[_0x4471('0x36')][_0x4471('0x38')]?_0xbad7e5['attributes']:_0x309367[_0x4471('0x31')];_0xbad7e5[_0x4471('0x3a')]=qs[_0x4471('0x3b')](_0x872485[_0x4471('0x32')][_0x4471('0x3b')]);_0xbad7e5['where']=qs[_0x4471('0x34')](_['pick'](_0x872485[_0x4471('0x32')],_0x309367[_0x4471('0x34')]));if(_0x872485[_0x4471('0x32')]['filter']){_0xbad7e5[_0x4471('0x3c')]=_[_0x4471('0x3f')](_0xbad7e5['where'],{'$or':_[_0x4471('0x2b')](_0xbad7e5[_0x4471('0x36')],function(_0x50191a){var _0x61b7d3={};_0x61b7d3[_0x50191a]={'$like':'%'+_0x872485[_0x4471('0x32')][_0x4471('0x3e')]+'%'};return _0x61b7d3;})});}_0xbad7e5=_['merge']({},_0xbad7e5,_0x872485[_0x4471('0x40')]);return _0x59b1af[_0x4471('0x4e')](_0xbad7e5);}})[_0x4471('0x25')](function(_0x3ed555){if(_0x3ed555){_0x11300f=_0x3ed555[_0x4471('0x38')];if(!_0x872485[_0x4471('0x32')][_0x4471('0x39')](_0x4471('0x4b'))){_0xbad7e5['limit']=qs[_0x4471('0x1e')](_0x872485[_0x4471('0x32')]['limit']);_0xbad7e5['offset']=qs[_0x4471('0x1d')](_0x872485[_0x4471('0x32')]['offset']);}return _0x59b1af['getDescriptions'](_0xbad7e5);}})[_0x4471('0x25')](function(_0x568f4a){if(_0x568f4a){return _0x568f4a?{'count':_0x11300f,'rows':_0x568f4a}:null;}})[_0x4471('0x25')](respondWithResult(_0x1046f8,null))['catch'](handleError(_0x1046f8,null));}; \ No newline at end of file +var _0x5af1=['limit','count','status','set','Content-Range','reject','destroy','then','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','update','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined'];(function(_0x116c34,_0x4c499c){var _0x333551=function(_0x26f5cd){while(--_0x26f5cd){_0x116c34['push'](_0x116c34['shift']());}};_0x333551(++_0x4c499c);}(_0x5af1,0x137));var _0x15af=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5af1[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x15af('0x0'));var rimraf=require(_0x15af('0x1'));var zipdir=require(_0x15af('0x2'));var jsonpatch=require(_0x15af('0x3'));var rp=require('request-promise');var moment=require(_0x15af('0x4'));var BPromise=require(_0x15af('0x5'));var Mustache=require(_0x15af('0x6'));var util=require(_0x15af('0x7'));var path=require(_0x15af('0x8'));var sox=require(_0x15af('0x9'));var csv=require(_0x15af('0xa'));var ejs=require(_0x15af('0xb'));var fs=require('fs');var fs_extra=require(_0x15af('0xc'));var _=require(_0x15af('0xd'));var squel=require(_0x15af('0xe'));var crypto=require(_0x15af('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x15af('0x10'));var Papa=require(_0x15af('0x11'));var Redis=require(_0x15af('0x12'));var authService=require(_0x15af('0x13'));var qs=require(_0x15af('0x14'));var as=require(_0x15af('0x15'));var hardwareService=require(_0x15af('0x16'));var logger=require(_0x15af('0x17'))(_0x15af('0x18'));var utils=require(_0x15af('0x19'));var config=require(_0x15af('0x1a'));var licenseUtil=require(_0x15af('0x1b'));var db=require(_0x15af('0x1c'))['db'];function respondWithStatusCode(_0x510fe6,_0x3f3af6){_0x3f3af6=_0x3f3af6||0xcc;return function(_0x12b5ef){if(_0x12b5ef){return _0x510fe6[_0x15af('0x1d')](_0x3f3af6);}return _0x510fe6['status'](_0x3f3af6)['end']();};}function respondWithResult(_0x339540,_0x183d79){_0x183d79=_0x183d79||0xc8;return function(_0x3db2c4){if(_0x3db2c4){return _0x339540['status'](_0x183d79)[_0x15af('0x1e')](_0x3db2c4);}};}function respondWithFilteredResult(_0x1c64fe,_0x458ed3){return function(_0x357b18){if(_0x357b18){var _0x1c75a4=typeof _0x458ed3[_0x15af('0x1f')]===_0x15af('0x20')&&typeof _0x458ed3[_0x15af('0x21')]===_0x15af('0x20');var _0x272472=_0x357b18[_0x15af('0x22')];var _0x3842a5=_0x1c75a4?0x0:_0x458ed3[_0x15af('0x1f')];var _0x5d3d89=_0x1c75a4?_0x357b18['count']:_0x458ed3['offset']+_0x458ed3[_0x15af('0x21')];var _0x117412;if(_0x5d3d89>=_0x272472){_0x5d3d89=_0x272472;_0x117412=0xc8;}else{_0x117412=0xce;}_0x1c64fe[_0x15af('0x23')](_0x117412);return _0x1c64fe[_0x15af('0x24')](_0x15af('0x25'),_0x3842a5+'-'+_0x5d3d89+'/'+_0x272472)[_0x15af('0x1e')](_0x357b18);}return null;};}function patchUpdates(_0x412827){return function(_0x11eb9d){try{jsonpatch['apply'](_0x11eb9d,_0x412827,!![]);}catch(_0x4e883d){return BPromise[_0x15af('0x26')](_0x4e883d);}return _0x11eb9d['save']();};}function saveUpdates(_0x4b6c9a,_0x248c12){return function(_0x3049ba){if(_0x3049ba){return _0x3049ba['update'](_0x4b6c9a)['then'](function(_0x23c762){return _0x23c762;});}return null;};}function removeEntity(_0x1c98cd,_0x5d6214){return function(_0x1ad9bb){if(_0x1ad9bb){return _0x1ad9bb[_0x15af('0x27')]()[_0x15af('0x28')](function(){_0x1c98cd[_0x15af('0x23')](0xcc)[_0x15af('0x29')]();});}};}function handleEntityNotFound(_0x394856,_0x4827bc){return function(_0x370671){if(!_0x370671){_0x394856[_0x15af('0x1d')](0x194);}return _0x370671;};}function handleError(_0x4f2370,_0xf4d876){_0xf4d876=_0xf4d876||0x1f4;return function(_0x55c25d){logger[_0x15af('0x2a')](_0x55c25d[_0x15af('0x2b')]);if(_0x55c25d[_0x15af('0x2c')]){delete _0x55c25d[_0x15af('0x2c')];}_0x4f2370[_0x15af('0x23')](_0xf4d876)[_0x15af('0x2d')](_0x55c25d);};}exports[_0x15af('0x2e')]=function(_0x2c1719,_0x59123d){var _0x56a694={},_0xe858be={},_0xd49ef5={'count':0x0,'rows':[]};var _0xcc788e=_[_0x15af('0x2f')](db[_0x15af('0x30')][_0x15af('0x31')],function(_0x1e9863){return{'name':_0x1e9863['fieldName'],'type':_0x1e9863[_0x15af('0x32')][_0x15af('0x33')]};});_0xe858be[_0x15af('0x34')]=_[_0x15af('0x2f')](_0xcc788e,_0x15af('0x2c'));_0xe858be[_0x15af('0x35')]=_[_0x15af('0x36')](_0x2c1719[_0x15af('0x35')]);_0xe858be['filters']=_[_0x15af('0x37')](_0xe858be[_0x15af('0x34')],_0xe858be['query']);_0x56a694[_0x15af('0x38')]=_[_0x15af('0x37')](_0xe858be[_0x15af('0x34')],qs[_0x15af('0x39')](_0x2c1719[_0x15af('0x35')]['fields']));_0x56a694['attributes']=_0x56a694[_0x15af('0x38')]['length']?_0x56a694['attributes']:_0xe858be[_0x15af('0x34')];if(!_0x2c1719['query'][_0x15af('0x3a')](_0x15af('0x3b'))){_0x56a694['limit']=qs[_0x15af('0x21')](_0x2c1719[_0x15af('0x35')]['limit']);_0x56a694[_0x15af('0x1f')]=qs['offset'](_0x2c1719[_0x15af('0x35')][_0x15af('0x1f')]);}_0x56a694['order']=qs[_0x15af('0x3c')](_0x2c1719[_0x15af('0x35')][_0x15af('0x3c')]);_0x56a694[_0x15af('0x3d')]=qs['filters'](_[_0x15af('0x3e')](_0x2c1719['query'],_0xe858be[_0x15af('0x3f')]),_0xcc788e);if(_0x2c1719[_0x15af('0x35')][_0x15af('0x40')]){_0x56a694[_0x15af('0x3d')]=_[_0x15af('0x41')](_0x56a694[_0x15af('0x3d')],{'$or':_[_0x15af('0x2f')](_0xcc788e,function(_0x13044b){if(_0x13044b[_0x15af('0x32')]!==_0x15af('0x42')){var _0x47cc4b={};_0x47cc4b[_0x13044b[_0x15af('0x2c')]]={'$like':'%'+_0x2c1719['query'][_0x15af('0x40')]+'%'};return _0x47cc4b;}})});}_0x56a694=_[_0x15af('0x41')]({},_0x56a694,_0x2c1719[_0x15af('0x43')]);var _0x339c4b={'where':_0x56a694['where']};return db[_0x15af('0x30')][_0x15af('0x22')](_0x339c4b)['then'](function(_0x311c07){_0xd49ef5[_0x15af('0x22')]=_0x311c07;if(_0x2c1719[_0x15af('0x35')]['includeAll']){_0x56a694[_0x15af('0x44')]=[{'all':!![]}];}return db[_0x15af('0x30')][_0x15af('0x45')](_0x56a694);})[_0x15af('0x28')](function(_0x396ffb){_0xd49ef5[_0x15af('0x46')]=_0x396ffb;return _0xd49ef5;})[_0x15af('0x28')](respondWithFilteredResult(_0x59123d,_0x56a694))[_0x15af('0x47')](handleError(_0x59123d,null));};exports[_0x15af('0x48')]=function(_0x43a039,_0x39d5bb){var _0x17c7cf={'raw':![],'where':{'id':_0x43a039[_0x15af('0x49')]['id']}},_0x3cd343={};_0x3cd343['model']=_[_0x15af('0x36')](db[_0x15af('0x30')][_0x15af('0x31')]);_0x3cd343[_0x15af('0x35')]=_[_0x15af('0x36')](_0x43a039[_0x15af('0x35')]);_0x3cd343[_0x15af('0x3f')]=_[_0x15af('0x37')](_0x3cd343[_0x15af('0x34')],_0x3cd343[_0x15af('0x35')]);_0x17c7cf[_0x15af('0x38')]=_[_0x15af('0x37')](_0x3cd343[_0x15af('0x34')],qs['fields'](_0x43a039[_0x15af('0x35')][_0x15af('0x39')]));_0x17c7cf[_0x15af('0x38')]=_0x17c7cf[_0x15af('0x38')][_0x15af('0x4a')]?_0x17c7cf[_0x15af('0x38')]:_0x3cd343[_0x15af('0x34')];if(_0x43a039[_0x15af('0x35')][_0x15af('0x4b')]){_0x17c7cf[_0x15af('0x44')]=[{'all':!![]}];}_0x17c7cf=_[_0x15af('0x41')]({},_0x17c7cf,_0x43a039[_0x15af('0x43')]);return db[_0x15af('0x30')][_0x15af('0x4c')](_0x17c7cf)[_0x15af('0x28')](handleEntityNotFound(_0x39d5bb,null))[_0x15af('0x28')](respondWithResult(_0x39d5bb,null))[_0x15af('0x47')](handleError(_0x39d5bb,null));};exports[_0x15af('0x4d')]=function(_0x2de48c,_0x3dad12){return db[_0x15af('0x30')]['create'](_0x2de48c[_0x15af('0x4e')],{})[_0x15af('0x28')](respondWithResult(_0x3dad12,0xc9))[_0x15af('0x47')](handleError(_0x3dad12,null));};exports[_0x15af('0x4f')]=function(_0x1582cc,_0x32ac01){if(_0x1582cc[_0x15af('0x4e')]['id']){delete _0x1582cc[_0x15af('0x4e')]['id'];}return db[_0x15af('0x30')][_0x15af('0x4c')]({'where':{'id':_0x1582cc[_0x15af('0x49')]['id']}})[_0x15af('0x28')](handleEntityNotFound(_0x32ac01,null))[_0x15af('0x28')](saveUpdates(_0x1582cc[_0x15af('0x4e')],null))[_0x15af('0x28')](respondWithResult(_0x32ac01,null))[_0x15af('0x47')](handleError(_0x32ac01,null));};exports[_0x15af('0x27')]=function(_0x4a0470,_0x3dd164){return db[_0x15af('0x30')][_0x15af('0x4c')]({'where':{'id':_0x4a0470['params']['id']}})[_0x15af('0x28')](handleEntityNotFound(_0x3dd164,null))['then'](removeEntity(_0x3dd164,null))[_0x15af('0x47')](handleError(_0x3dd164,null));};exports[_0x15af('0x50')]=function(_0x4ddcab,_0x18fef8,_0x1840af){var _0x2e21fd={};var _0x4b7ae6={};var _0x249360;var _0x30d58c;return db[_0x15af('0x30')][_0x15af('0x51')]({'where':{'id':_0x4ddcab[_0x15af('0x49')]['id']}})[_0x15af('0x28')](handleEntityNotFound(_0x18fef8,null))[_0x15af('0x28')](function(_0xa9c656){if(_0xa9c656){_0x249360=_0xa9c656;_0x4b7ae6[_0x15af('0x34')]=_[_0x15af('0x36')](db[_0x15af('0x52')][_0x15af('0x31')]);_0x4b7ae6[_0x15af('0x35')]=_[_0x15af('0x36')](_0x4ddcab[_0x15af('0x35')]);_0x4b7ae6[_0x15af('0x3f')]=_[_0x15af('0x37')](_0x4b7ae6[_0x15af('0x34')],_0x4b7ae6[_0x15af('0x35')]);_0x2e21fd[_0x15af('0x38')]=_[_0x15af('0x37')](_0x4b7ae6[_0x15af('0x34')],qs[_0x15af('0x39')](_0x4ddcab[_0x15af('0x35')]['fields']));_0x2e21fd[_0x15af('0x38')]=_0x2e21fd[_0x15af('0x38')][_0x15af('0x4a')]?_0x2e21fd['attributes']:_0x4b7ae6[_0x15af('0x34')];_0x2e21fd[_0x15af('0x53')]=qs['sort'](_0x4ddcab[_0x15af('0x35')][_0x15af('0x3c')]);_0x2e21fd[_0x15af('0x3d')]=qs[_0x15af('0x3f')](_['pick'](_0x4ddcab[_0x15af('0x35')],_0x4b7ae6[_0x15af('0x3f')]));if(_0x4ddcab[_0x15af('0x35')][_0x15af('0x40')]){_0x2e21fd['where']=_[_0x15af('0x41')](_0x2e21fd[_0x15af('0x3d')],{'$or':_[_0x15af('0x2f')](_0x2e21fd['attributes'],function(_0x519e6e){var _0x323b84={};_0x323b84[_0x519e6e]={'$like':'%'+_0x4ddcab[_0x15af('0x35')][_0x15af('0x40')]+'%'};return _0x323b84;})});}_0x2e21fd=_['merge']({},_0x2e21fd,_0x4ddcab[_0x15af('0x43')]);return _0x249360['getFields'](_0x2e21fd);}})['then'](function(_0x1487cd){if(_0x1487cd){_0x30d58c=_0x1487cd[_0x15af('0x4a')];if(!_0x4ddcab[_0x15af('0x35')][_0x15af('0x3a')](_0x15af('0x3b'))){_0x2e21fd[_0x15af('0x21')]=qs[_0x15af('0x21')](_0x4ddcab['query']['limit']);_0x2e21fd[_0x15af('0x1f')]=qs[_0x15af('0x1f')](_0x4ddcab['query'][_0x15af('0x1f')]);}return _0x249360[_0x15af('0x50')](_0x2e21fd);}})['then'](function(_0x29d817){if(_0x29d817){return _0x29d817?{'count':_0x30d58c,'rows':_0x29d817}:null;}})['then'](respondWithResult(_0x18fef8,null))['catch'](handleError(_0x18fef8,null));};exports[_0x15af('0x54')]=function(_0x2d381a,_0x304113,_0x38a768){var _0x183c32={};var _0x4d5e1c={};var _0x3310e6;var _0xedcd3d;return db[_0x15af('0x30')][_0x15af('0x51')]({'where':{'id':_0x2d381a['params']['id']}})[_0x15af('0x28')](handleEntityNotFound(_0x304113,null))[_0x15af('0x28')](function(_0xec31b8){if(_0xec31b8){_0x3310e6=_0xec31b8;_0x4d5e1c[_0x15af('0x34')]=_[_0x15af('0x36')](db[_0x15af('0x52')][_0x15af('0x31')]);_0x4d5e1c[_0x15af('0x35')]=_[_0x15af('0x36')](_0x2d381a['query']);_0x4d5e1c[_0x15af('0x3f')]=_[_0x15af('0x37')](_0x4d5e1c[_0x15af('0x34')],_0x4d5e1c['query']);_0x183c32[_0x15af('0x38')]=_['intersection'](_0x4d5e1c['model'],qs[_0x15af('0x39')](_0x2d381a[_0x15af('0x35')][_0x15af('0x39')]));_0x183c32[_0x15af('0x38')]=_0x183c32[_0x15af('0x38')][_0x15af('0x4a')]?_0x183c32[_0x15af('0x38')]:_0x4d5e1c[_0x15af('0x34')];_0x183c32[_0x15af('0x53')]=qs[_0x15af('0x3c')](_0x2d381a[_0x15af('0x35')]['sort']);_0x183c32['where']=qs[_0x15af('0x3f')](_[_0x15af('0x3e')](_0x2d381a[_0x15af('0x35')],_0x4d5e1c[_0x15af('0x3f')]));if(_0x2d381a[_0x15af('0x35')][_0x15af('0x40')]){_0x183c32[_0x15af('0x3d')]=_['merge'](_0x183c32['where'],{'$or':_[_0x15af('0x2f')](_0x183c32[_0x15af('0x38')],function(_0x4a13d0){var _0x4b2a19={};_0x4b2a19[_0x4a13d0]={'$like':'%'+_0x2d381a['query'][_0x15af('0x40')]+'%'};return _0x4b2a19;})});}_0x183c32=_[_0x15af('0x41')]({},_0x183c32,_0x2d381a[_0x15af('0x43')]);return _0x3310e6[_0x15af('0x54')](_0x183c32);}})[_0x15af('0x28')](function(_0x290c97){if(_0x290c97){_0xedcd3d=_0x290c97['length'];if(!_0x2d381a[_0x15af('0x35')][_0x15af('0x3a')](_0x15af('0x3b'))){_0x183c32['limit']=qs[_0x15af('0x21')](_0x2d381a[_0x15af('0x35')][_0x15af('0x21')]);_0x183c32[_0x15af('0x1f')]=qs[_0x15af('0x1f')](_0x2d381a[_0x15af('0x35')]['offset']);}return _0x3310e6[_0x15af('0x54')](_0x183c32);}})['then'](function(_0x1ce50f){if(_0x1ce50f){return _0x1ce50f?{'count':_0xedcd3d,'rows':_0x1ce50f}:null;}})[_0x15af('0x28')](respondWithResult(_0x304113,null))[_0x15af('0x47')](handleError(_0x304113,null));};exports[_0x15af('0x55')]=function(_0x43faf6,_0x4394da,_0x1813b8){var _0x1d679f={};var _0x49bda9={};var _0x581a4b;var _0x29b8f2;return db[_0x15af('0x30')][_0x15af('0x51')]({'where':{'id':_0x43faf6['params']['id']}})[_0x15af('0x28')](handleEntityNotFound(_0x4394da,null))[_0x15af('0x28')](function(_0x509e06){if(_0x509e06){_0x581a4b=_0x509e06;_0x49bda9[_0x15af('0x34')]=_[_0x15af('0x36')](db[_0x15af('0x52')][_0x15af('0x31')]);_0x49bda9[_0x15af('0x35')]=_[_0x15af('0x36')](_0x43faf6['query']);_0x49bda9['filters']=_[_0x15af('0x37')](_0x49bda9[_0x15af('0x34')],_0x49bda9[_0x15af('0x35')]);_0x1d679f['attributes']=_[_0x15af('0x37')](_0x49bda9[_0x15af('0x34')],qs[_0x15af('0x39')](_0x43faf6[_0x15af('0x35')][_0x15af('0x39')]));_0x1d679f[_0x15af('0x38')]=_0x1d679f[_0x15af('0x38')][_0x15af('0x4a')]?_0x1d679f['attributes']:_0x49bda9[_0x15af('0x34')];_0x1d679f['order']=qs['sort'](_0x43faf6[_0x15af('0x35')]['sort']);_0x1d679f['where']=qs[_0x15af('0x3f')](_[_0x15af('0x3e')](_0x43faf6[_0x15af('0x35')],_0x49bda9[_0x15af('0x3f')]));if(_0x43faf6[_0x15af('0x35')][_0x15af('0x40')]){_0x1d679f[_0x15af('0x3d')]=_[_0x15af('0x41')](_0x1d679f['where'],{'$or':_['map'](_0x1d679f[_0x15af('0x38')],function(_0x26c36c){var _0xc2a91f={};_0xc2a91f[_0x26c36c]={'$like':'%'+_0x43faf6['query']['filter']+'%'};return _0xc2a91f;})});}_0x1d679f=_['merge']({},_0x1d679f,_0x43faf6['options']);return _0x581a4b['getDescriptions'](_0x1d679f);}})[_0x15af('0x28')](function(_0xba063a){if(_0xba063a){_0x29b8f2=_0xba063a['length'];if(!_0x43faf6[_0x15af('0x35')][_0x15af('0x3a')](_0x15af('0x3b'))){_0x1d679f[_0x15af('0x21')]=qs[_0x15af('0x21')](_0x43faf6[_0x15af('0x35')][_0x15af('0x21')]);_0x1d679f['offset']=qs[_0x15af('0x1f')](_0x43faf6['query']['offset']);}return _0x581a4b[_0x15af('0x55')](_0x1d679f);}})[_0x15af('0x28')](function(_0x3eea37){if(_0x3eea37){return _0x3eea37?{'count':_0x29b8f2,'rows':_0x3eea37}:null;}})['then'](respondWithResult(_0x4394da,null))[_0x15af('0x47')](handleError(_0x4394da,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 80f33c7..6c95614 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 _0xa693=['util','../../config/logger','api','moment','bluebird','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0xa693,0xf1));var _0x3a69=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0xa693[_0x5da0d9];return _0x4b6d2f;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var logger=require(_0x3a69('0x2'))(_0x3a69('0x3'));var moment=require(_0x3a69('0x4'));var BPromise=require(_0x3a69('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3a69('0x6'));var attributes=require(_0x3a69('0x7'));module[_0x3a69('0x8')]=function(_0x363363,_0x3a05e0){return _0x363363[_0x3a69('0x9')](_0x3a69('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb03e=['int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0xb03e,0x1eb));var _0xeb03=function(_0x78c6f6,_0x33645b){_0x78c6f6=_0x78c6f6-0x0;var _0x26897c=_0xb03e[_0x78c6f6];return _0x26897c;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 4e1890c..5cdc142 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 _0x0221=['util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x398e70,_0x59b8f8){var _0xfb56fc=function(_0x2226c3){while(--_0x2226c3){_0x398e70['push'](_0x398e70['shift']());}};_0xfb56fc(++_0x59b8f8);}(_0x0221,0xc5));var _0x1022=function(_0x178076,_0xea2e2b){_0x178076=_0x178076-0x0;var _0x2ce342=_0x0221[_0x178076];return _0x2ce342;};'use strict';var _=require(_0x1022('0x0'));var util=require(_0x1022('0x1'));var moment=require(_0x1022('0x2'));var BPromise=require(_0x1022('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1022('0x4'));var db=require(_0x1022('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1022('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1022('0x7')][_0x1022('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x267458,_0x39f393,_0xb44f8f){return new BPromise(function(_0x50031a,_0x5f676d){return client[_0x1022('0x9')](_0x267458,_0xb44f8f)[_0x1022('0xa')](function(_0x20dab1){logger[_0x1022('0xb')](_0x1022('0xc'),_0x39f393,'request\x20sent');logger[_0x1022('0xd')](_0x1022('0xe'),_0x39f393,_0x1022('0xf'),JSON[_0x1022('0x10')](_0x20dab1));if(_0x20dab1[_0x1022('0x11')]){if(_0x20dab1[_0x1022('0x11')][_0x1022('0x12')]===0x1f4){logger['error'](_0x1022('0xc'),_0x39f393,_0x20dab1[_0x1022('0x11')]['message']);return _0x5f676d(_0x20dab1[_0x1022('0x11')][_0x1022('0x13')]);}logger[_0x1022('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x39f393,_0x20dab1[_0x1022('0x11')]['message']);return _0x50031a(_0x20dab1[_0x1022('0x11')][_0x1022('0x13')]);}else{logger[_0x1022('0xb')](_0x1022('0xc'),_0x39f393,_0x1022('0xf'));_0x50031a(_0x20dab1[_0x1022('0x14')][_0x1022('0x13')]);}})[_0x1022('0x15')](function(_0x58a047){logger['error'](_0x1022('0xc'),_0x39f393,_0x58a047);_0x5f676d(_0x58a047);});});} \ No newline at end of file +var _0x304b=['ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info'];(function(_0x425c6c,_0x31926c){var _0x56c757=function(_0x162fa1){while(--_0x162fa1){_0x425c6c['push'](_0x425c6c['shift']());}};_0x56c757(++_0x31926c);}(_0x304b,0xfb));var _0xb304=function(_0x30108a,_0x2e74b8){_0x30108a=_0x30108a-0x0;var _0x500cee=_0x304b[_0x30108a];return _0x500cee;};'use strict';var _=require('lodash');var util=require(_0xb304('0x0'));var moment=require(_0xb304('0x1'));var BPromise=require(_0xb304('0x2'));var rs=require(_0xb304('0x3'));var fs=require('fs');var Redis=require(_0xb304('0x4'));var db=require(_0xb304('0x5'))['db'];var utils=require(_0xb304('0x6'));var logger=require(_0xb304('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb304('0x8'));var client=jayson[_0xb304('0x9')][_0xb304('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb6e0,_0x177964,_0xded429){return new BPromise(function(_0x1ce82e,_0x329901){return client[_0xb304('0xb')](_0x3eb6e0,_0xded429)['then'](function(_0xc2918c){logger[_0xb304('0xc')](_0xb304('0xd'),_0x177964,'request\x20sent');logger[_0xb304('0xe')](_0xb304('0xf'),_0x177964,_0xb304('0x10'),JSON[_0xb304('0x11')](_0xc2918c));if(_0xc2918c[_0xb304('0x12')]){if(_0xc2918c[_0xb304('0x12')]['code']===0x1f4){logger[_0xb304('0x12')](_0xb304('0xd'),_0x177964,_0xc2918c[_0xb304('0x12')][_0xb304('0x13')]);return _0x329901(_0xc2918c['error'][_0xb304('0x13')]);}logger[_0xb304('0x12')](_0xb304('0xd'),_0x177964,_0xc2918c[_0xb304('0x12')][_0xb304('0x13')]);return _0x1ce82e(_0xc2918c[_0xb304('0x12')][_0xb304('0x13')]);}else{logger[_0xb304('0xc')](_0xb304('0xd'),_0x177964,_0xb304('0x10'));_0x1ce82e(_0xc2918c[_0xb304('0x14')][_0xb304('0x13')]);}})[_0xb304('0x15')](function(_0x5867c0){logger[_0xb304('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x177964,_0x5867c0);_0x329901(_0x5867c0);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f0aa9aa..b93ed40 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 _0x363e=['post','create','put','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3f7057,_0x53539e){var _0x4a3e2a=function(_0x3c73ef){while(--_0x3c73ef){_0x3f7057['push'](_0x3f7057['shift']());}};_0x4a3e2a(++_0x53539e);}(_0x363e,0xaf));var _0xe363=function(_0x1be07f,_0x527bb7){_0x1be07f=_0x1be07f-0x0;var _0x2d80c5=_0x363e[_0x1be07f];return _0x2d80c5;};'use strict';var multer=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var path=require(_0xe363('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe363('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe363('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe363('0x5'));var controller=require(_0xe363('0x6'));router[_0xe363('0x7')]('/',auth[_0xe363('0x8')](),controller[_0xe363('0x9')]);router['get'](_0xe363('0xa'),auth[_0xe363('0x8')](),controller[_0xe363('0xb')]);router[_0xe363('0xc')]('/',auth[_0xe363('0x8')](),controller[_0xe363('0xd')]);router[_0xe363('0xe')](_0xe363('0xa'),auth[_0xe363('0x8')](),controller['update']);router['delete'](_0xe363('0xa'),auth['isAuthenticated'](),controller[_0xe363('0xf')]);module[_0xe363('0x10')]=router; \ No newline at end of file +var _0x1c49=['show','post','create','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1c49,0x16b));var _0x91c4=function(_0x48681d,_0x5ebf32){_0x48681d=_0x48681d-0x0;var _0x49d6b7=_0x1c49[_0x48681d];return _0x49d6b7;};'use strict';var multer=require(_0x91c4('0x0'));var util=require('util');var path=require(_0x91c4('0x1'));var timeout=require(_0x91c4('0x2'));var express=require(_0x91c4('0x3'));var router=express[_0x91c4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x91c4('0x5'));var config=require(_0x91c4('0x6'));var controller=require('./intServicenowField.controller');router[_0x91c4('0x7')]('/',auth[_0x91c4('0x8')](),controller[_0x91c4('0x9')]);router[_0x91c4('0x7')](_0x91c4('0xa'),auth[_0x91c4('0x8')](),controller[_0x91c4('0xb')]);router[_0x91c4('0xc')]('/',auth[_0x91c4('0x8')](),controller[_0x91c4('0xd')]);router[_0x91c4('0xe')]('/:id',auth[_0x91c4('0x8')](),controller[_0x91c4('0xf')]);router['delete'](_0x91c4('0xa'),auth[_0x91c4('0x8')](),controller[_0x91c4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 86c0c12..3541858 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 _0xeab6=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0xf214a5,_0x1b8c19){var _0x2f30a3=function(_0x3417ef){while(--_0x3417ef){_0xf214a5['push'](_0xf214a5['shift']());}};_0x2f30a3(++_0x1b8c19);}(_0xeab6,0xf0));var _0x6eab=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0xeab6[_0x5d07ff];return _0x5226ad;};'use strict';var Sequelize=require(_0x6eab('0x0'));module[_0x6eab('0x1')]={'type':{'type':Sequelize[_0x6eab('0x2')](_0x6eab('0x3'),_0x6eab('0x4'),'customVariable',_0x6eab('0x5'),_0x6eab('0x6')),'defaultValue':_0x6eab('0x3')},'content':{'type':Sequelize[_0x6eab('0x7')]},'key':{'type':Sequelize[_0x6eab('0x7')]},'keyType':{'type':Sequelize[_0x6eab('0x2')](_0x6eab('0x3'),_0x6eab('0x4'),_0x6eab('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6eab('0x7')]},'nameField':{'type':Sequelize[_0x6eab('0x7')]},'customField':{'type':Sequelize[_0x6eab('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4df5=['customVariable','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0x4df5,0x17c));var _0x54df=function(_0x50c5fd,_0x5773ea){_0x50c5fd=_0x50c5fd-0x0;var _0xb8d97a=_0x4df5[_0x50c5fd];return _0xb8d97a;};'use strict';var Sequelize=require('sequelize');module[_0x54df('0x0')]={'type':{'type':Sequelize[_0x54df('0x1')](_0x54df('0x2'),_0x54df('0x3'),_0x54df('0x4'),'keyValue',_0x54df('0x5')),'defaultValue':_0x54df('0x2')},'content':{'type':Sequelize[_0x54df('0x6')]},'key':{'type':Sequelize[_0x54df('0x6')]},'keyType':{'type':Sequelize[_0x54df('0x1')]('string',_0x54df('0x3'),_0x54df('0x4'))},'keyContent':{'type':Sequelize[_0x54df('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x54df('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x54df('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 16eae96..4574930 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 _0x03bf=['send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','rows','show','length','include','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x3e4832,_0x3affbf){var _0x285614=function(_0x22f3f1){while(--_0x22f3f1){_0x3e4832['push'](_0x3e4832['shift']());}};_0x285614(++_0x3affbf);}(_0x03bf,0x1df));var _0xf03b=function(_0xdb18aa,_0x1ffec1){_0xdb18aa=_0xdb18aa-0x0;var _0x25782e=_0x03bf[_0xdb18aa];return _0x25782e;};'use strict';var emlformat=require(_0xf03b('0x0'));var rimraf=require(_0xf03b('0x1'));var zipdir=require(_0xf03b('0x2'));var jsonpatch=require(_0xf03b('0x3'));var rp=require(_0xf03b('0x4'));var moment=require(_0xf03b('0x5'));var BPromise=require(_0xf03b('0x6'));var Mustache=require(_0xf03b('0x7'));var util=require(_0xf03b('0x8'));var path=require(_0xf03b('0x9'));var sox=require(_0xf03b('0xa'));var csv=require('to-csv');var ejs=require(_0xf03b('0xb'));var fs=require('fs');var fs_extra=require(_0xf03b('0xc'));var _=require('lodash');var squel=require(_0xf03b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf03b('0xe'));var Papa=require(_0xf03b('0xf'));var Redis=require(_0xf03b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf03b('0x11'));var as=require(_0xf03b('0x12'));var hardwareService=require(_0xf03b('0x13'));var logger=require(_0xf03b('0x14'))('api');var utils=require(_0xf03b('0x15'));var config=require(_0xf03b('0x16'));var licenseUtil=require(_0xf03b('0x17'));var db=require(_0xf03b('0x18'))['db'];function respondWithStatusCode(_0x5153c9,_0x113e71){_0x113e71=_0x113e71||0xcc;return function(_0x4e78e1){if(_0x4e78e1){return _0x5153c9[_0xf03b('0x19')](_0x113e71);}return _0x5153c9[_0xf03b('0x1a')](_0x113e71)['end']();};}function respondWithResult(_0x46bfd8,_0x34628e){_0x34628e=_0x34628e||0xc8;return function(_0x412a18){if(_0x412a18){return _0x46bfd8['status'](_0x34628e)[_0xf03b('0x1b')](_0x412a18);}};}function respondWithFilteredResult(_0x2462af,_0xb6e56f){return function(_0x1427ea){if(_0x1427ea){var _0x53fb87=typeof _0xb6e56f['offset']==='undefined'&&typeof _0xb6e56f[_0xf03b('0x1c')]==='undefined';var _0x4c9241=_0x1427ea[_0xf03b('0x1d')];var _0x1c8d03=_0x53fb87?0x0:_0xb6e56f['offset'];var _0x54227b=_0x53fb87?_0x1427ea[_0xf03b('0x1d')]:_0xb6e56f['offset']+_0xb6e56f[_0xf03b('0x1c')];var _0x21abf6;if(_0x54227b>=_0x4c9241){_0x54227b=_0x4c9241;_0x21abf6=0xc8;}else{_0x21abf6=0xce;}_0x2462af['status'](_0x21abf6);return _0x2462af['set']('Content-Range',_0x1c8d03+'-'+_0x54227b+'/'+_0x4c9241)[_0xf03b('0x1b')](_0x1427ea);}return null;};}function patchUpdates(_0x41b557){return function(_0x363006){try{jsonpatch['apply'](_0x363006,_0x41b557,!![]);}catch(_0x4e8e83){return BPromise[_0xf03b('0x1e')](_0x4e8e83);}return _0x363006[_0xf03b('0x1f')]();};}function saveUpdates(_0x13d87f,_0x5a1c8e){return function(_0x1c71e3){if(_0x1c71e3){return _0x1c71e3[_0xf03b('0x20')](_0x13d87f)[_0xf03b('0x21')](function(_0xf34e20){return _0xf34e20;});}return null;};}function removeEntity(_0x14a089,_0x4963d4){return function(_0x513944){if(_0x513944){return _0x513944[_0xf03b('0x22')]()['then'](function(){_0x14a089[_0xf03b('0x1a')](0xcc)[_0xf03b('0x23')]();});}};}function handleEntityNotFound(_0x404ad4,_0x5d43ad){return function(_0x1270fa){if(!_0x1270fa){_0x404ad4['sendStatus'](0x194);}return _0x1270fa;};}function handleError(_0xffff3d,_0x587661){_0x587661=_0x587661||0x1f4;return function(_0x4ca896){logger[_0xf03b('0x24')](_0x4ca896[_0xf03b('0x25')]);if(_0x4ca896[_0xf03b('0x26')]){delete _0x4ca896[_0xf03b('0x26')];}_0xffff3d[_0xf03b('0x1a')](_0x587661)[_0xf03b('0x27')](_0x4ca896);};}exports[_0xf03b('0x28')]=function(_0x3bfa84,_0x13d7a9){var _0xc95f5b={},_0x500c7f={},_0x43c93d={'count':0x0,'rows':[]};var _0x41dd20=_[_0xf03b('0x29')](db[_0xf03b('0x2a')][_0xf03b('0x2b')],function(_0x220e6d){return{'name':_0x220e6d[_0xf03b('0x2c')],'type':_0x220e6d[_0xf03b('0x2d')][_0xf03b('0x2e')]};});_0x500c7f[_0xf03b('0x2f')]=_[_0xf03b('0x29')](_0x41dd20,_0xf03b('0x26'));_0x500c7f[_0xf03b('0x30')]=_[_0xf03b('0x31')](_0x3bfa84[_0xf03b('0x30')]);_0x500c7f[_0xf03b('0x32')]=_[_0xf03b('0x33')](_0x500c7f[_0xf03b('0x2f')],_0x500c7f[_0xf03b('0x30')]);_0xc95f5b[_0xf03b('0x34')]=_[_0xf03b('0x33')](_0x500c7f['model'],qs[_0xf03b('0x35')](_0x3bfa84[_0xf03b('0x30')][_0xf03b('0x35')]));_0xc95f5b[_0xf03b('0x34')]=_0xc95f5b[_0xf03b('0x34')]['length']?_0xc95f5b[_0xf03b('0x34')]:_0x500c7f[_0xf03b('0x2f')];if(!_0x3bfa84[_0xf03b('0x30')][_0xf03b('0x36')](_0xf03b('0x37'))){_0xc95f5b[_0xf03b('0x1c')]=qs['limit'](_0x3bfa84[_0xf03b('0x30')]['limit']);_0xc95f5b[_0xf03b('0x38')]=qs[_0xf03b('0x38')](_0x3bfa84['query'][_0xf03b('0x38')]);}_0xc95f5b[_0xf03b('0x39')]=qs['sort'](_0x3bfa84[_0xf03b('0x30')][_0xf03b('0x3a')]);_0xc95f5b[_0xf03b('0x3b')]=qs[_0xf03b('0x32')](_[_0xf03b('0x3c')](_0x3bfa84[_0xf03b('0x30')],_0x500c7f['filters']),_0x41dd20);if(_0x3bfa84[_0xf03b('0x30')][_0xf03b('0x3d')]){_0xc95f5b[_0xf03b('0x3b')]=_[_0xf03b('0x3e')](_0xc95f5b[_0xf03b('0x3b')],{'$or':_[_0xf03b('0x29')](_0x41dd20,function(_0x53c6ce){if(_0x53c6ce[_0xf03b('0x2d')]!==_0xf03b('0x3f')){var _0x482bab={};_0x482bab[_0x53c6ce[_0xf03b('0x26')]]={'$like':'%'+_0x3bfa84['query'][_0xf03b('0x3d')]+'%'};return _0x482bab;}})});}_0xc95f5b=_[_0xf03b('0x3e')]({},_0xc95f5b,_0x3bfa84['options']);var _0x281482={'where':_0xc95f5b[_0xf03b('0x3b')]};return db[_0xf03b('0x2a')][_0xf03b('0x1d')](_0x281482)[_0xf03b('0x21')](function(_0x7b1e72){_0x43c93d[_0xf03b('0x1d')]=_0x7b1e72;if(_0x3bfa84[_0xf03b('0x30')]['includeAll']){_0xc95f5b['include']=[{'all':!![]}];}return db[_0xf03b('0x2a')]['findAll'](_0xc95f5b);})[_0xf03b('0x21')](function(_0x23ed56){_0x43c93d[_0xf03b('0x40')]=_0x23ed56;return _0x43c93d;})[_0xf03b('0x21')](respondWithFilteredResult(_0x13d7a9,_0xc95f5b))['catch'](handleError(_0x13d7a9,null));};exports[_0xf03b('0x41')]=function(_0x1408a5,_0x5e1cb2){var _0x1e2909={'raw':!![],'where':{'id':_0x1408a5['params']['id']}},_0x40bbd3={};_0x40bbd3[_0xf03b('0x2f')]=_[_0xf03b('0x31')](db[_0xf03b('0x2a')][_0xf03b('0x2b')]);_0x40bbd3[_0xf03b('0x30')]=_[_0xf03b('0x31')](_0x1408a5['query']);_0x40bbd3[_0xf03b('0x32')]=_[_0xf03b('0x33')](_0x40bbd3[_0xf03b('0x2f')],_0x40bbd3[_0xf03b('0x30')]);_0x1e2909['attributes']=_['intersection'](_0x40bbd3[_0xf03b('0x2f')],qs[_0xf03b('0x35')](_0x1408a5[_0xf03b('0x30')]['fields']));_0x1e2909[_0xf03b('0x34')]=_0x1e2909['attributes'][_0xf03b('0x42')]?_0x1e2909[_0xf03b('0x34')]:_0x40bbd3[_0xf03b('0x2f')];if(_0x1408a5[_0xf03b('0x30')]['includeAll']){_0x1e2909[_0xf03b('0x43')]=[{'all':!![]}];}_0x1e2909=_['merge']({},_0x1e2909,_0x1408a5[_0xf03b('0x44')]);return db[_0xf03b('0x2a')][_0xf03b('0x45')](_0x1e2909)['then'](handleEntityNotFound(_0x5e1cb2,null))[_0xf03b('0x21')](respondWithResult(_0x5e1cb2,null))[_0xf03b('0x46')](handleError(_0x5e1cb2,null));};exports[_0xf03b('0x47')]=function(_0x2d85da,_0x3c0938){return db[_0xf03b('0x2a')][_0xf03b('0x47')](_0x2d85da[_0xf03b('0x48')],{})['then'](respondWithResult(_0x3c0938,0xc9))['catch'](handleError(_0x3c0938,null));};exports['update']=function(_0x3597f5,_0x1db9c6){if(_0x3597f5[_0xf03b('0x48')]['id']){delete _0x3597f5[_0xf03b('0x48')]['id'];}return db[_0xf03b('0x2a')][_0xf03b('0x45')]({'where':{'id':_0x3597f5[_0xf03b('0x49')]['id']}})[_0xf03b('0x21')](handleEntityNotFound(_0x1db9c6,null))[_0xf03b('0x21')](saveUpdates(_0x3597f5[_0xf03b('0x48')],null))[_0xf03b('0x21')](respondWithResult(_0x1db9c6,null))[_0xf03b('0x46')](handleError(_0x1db9c6,null));};exports['destroy']=function(_0x4f5c9c,_0x37061d){return db[_0xf03b('0x2a')]['find']({'where':{'id':_0x4f5c9c[_0xf03b('0x49')]['id']}})[_0xf03b('0x21')](handleEntityNotFound(_0x37061d,null))[_0xf03b('0x21')](removeEntity(_0x37061d,null))[_0xf03b('0x46')](handleError(_0x37061d,null));}; \ No newline at end of file +var _0xa560=['error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowField','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x473401,_0xcb9d99){var _0x981b82=function(_0x2d2c23){while(--_0x2d2c23){_0x473401['push'](_0x473401['shift']());}};_0x981b82(++_0xcb9d99);}(_0xa560,0x72));var _0x0a56=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa560[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a56('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0a56('0x1'));var Mustache=require(_0x0a56('0x2'));var util=require('util');var path=require(_0x0a56('0x3'));var sox=require(_0x0a56('0x4'));var csv=require(_0x0a56('0x5'));var ejs=require(_0x0a56('0x6'));var fs=require('fs');var fs_extra=require(_0x0a56('0x7'));var _=require(_0x0a56('0x8'));var squel=require(_0x0a56('0x9'));var crypto=require('crypto');var jsforce=require(_0x0a56('0xa'));var deskjs=require(_0x0a56('0xb'));var toCsv=require(_0x0a56('0x5'));var querystring=require(_0x0a56('0xc'));var Papa=require(_0x0a56('0xd'));var Redis=require(_0x0a56('0xe'));var authService=require(_0x0a56('0xf'));var qs=require(_0x0a56('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a56('0x11'));var logger=require(_0x0a56('0x12'))(_0x0a56('0x13'));var utils=require(_0x0a56('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0a56('0x15'))['db'];function respondWithStatusCode(_0xbf96ce,_0x9ae02b){_0x9ae02b=_0x9ae02b||0xcc;return function(_0x1eb61c){if(_0x1eb61c){return _0xbf96ce[_0x0a56('0x16')](_0x9ae02b);}return _0xbf96ce[_0x0a56('0x17')](_0x9ae02b)[_0x0a56('0x18')]();};}function respondWithResult(_0x484227,_0x5bcb48){_0x5bcb48=_0x5bcb48||0xc8;return function(_0x1dc22a){if(_0x1dc22a){return _0x484227[_0x0a56('0x17')](_0x5bcb48)['json'](_0x1dc22a);}};}function respondWithFilteredResult(_0x3cb88a,_0x20d7c6){return function(_0x13e709){if(_0x13e709){var _0x3a2606=typeof _0x20d7c6[_0x0a56('0x19')]===_0x0a56('0x1a')&&typeof _0x20d7c6['limit']===_0x0a56('0x1a');var _0x43e193=_0x13e709['count'];var _0x4e78e2=_0x3a2606?0x0:_0x20d7c6['offset'];var _0x475939=_0x3a2606?_0x13e709[_0x0a56('0x1b')]:_0x20d7c6[_0x0a56('0x19')]+_0x20d7c6[_0x0a56('0x1c')];var _0x2b20a4;if(_0x475939>=_0x43e193){_0x475939=_0x43e193;_0x2b20a4=0xc8;}else{_0x2b20a4=0xce;}_0x3cb88a[_0x0a56('0x17')](_0x2b20a4);return _0x3cb88a[_0x0a56('0x1d')](_0x0a56('0x1e'),_0x4e78e2+'-'+_0x475939+'/'+_0x43e193)[_0x0a56('0x1f')](_0x13e709);}return null;};}function patchUpdates(_0x817318){return function(_0x26d767){try{jsonpatch[_0x0a56('0x20')](_0x26d767,_0x817318,!![]);}catch(_0x193c47){return BPromise[_0x0a56('0x21')](_0x193c47);}return _0x26d767[_0x0a56('0x22')]();};}function saveUpdates(_0x35919e,_0x47db65){return function(_0x434558){if(_0x434558){return _0x434558[_0x0a56('0x23')](_0x35919e)[_0x0a56('0x24')](function(_0x2d7045){return _0x2d7045;});}return null;};}function removeEntity(_0x58265b,_0x32266e){return function(_0x10fca6){if(_0x10fca6){return _0x10fca6[_0x0a56('0x25')]()[_0x0a56('0x24')](function(){_0x58265b['status'](0xcc)[_0x0a56('0x18')]();});}};}function handleEntityNotFound(_0x245c33,_0x5da396){return function(_0x414089){if(!_0x414089){_0x245c33['sendStatus'](0x194);}return _0x414089;};}function handleError(_0x1e7af8,_0x1e2db4){_0x1e2db4=_0x1e2db4||0x1f4;return function(_0x1c7e9a){logger[_0x0a56('0x26')](_0x1c7e9a['stack']);if(_0x1c7e9a[_0x0a56('0x27')]){delete _0x1c7e9a[_0x0a56('0x27')];}_0x1e7af8[_0x0a56('0x17')](_0x1e2db4)[_0x0a56('0x28')](_0x1c7e9a);};}exports[_0x0a56('0x29')]=function(_0x47c729,_0x215085){var _0x251266={},_0x4cacdd={},_0x4df71c={'count':0x0,'rows':[]};var _0xd5a919=_['map'](db['ServicenowField'][_0x0a56('0x2a')],function(_0x531c42){return{'name':_0x531c42[_0x0a56('0x2b')],'type':_0x531c42[_0x0a56('0x2c')][_0x0a56('0x2d')]};});_0x4cacdd[_0x0a56('0x2e')]=_[_0x0a56('0x2f')](_0xd5a919,_0x0a56('0x27'));_0x4cacdd['query']=_[_0x0a56('0x30')](_0x47c729[_0x0a56('0x31')]);_0x4cacdd[_0x0a56('0x32')]=_['intersection'](_0x4cacdd['model'],_0x4cacdd['query']);_0x251266['attributes']=_['intersection'](_0x4cacdd[_0x0a56('0x2e')],qs['fields'](_0x47c729['query'][_0x0a56('0x33')]));_0x251266['attributes']=_0x251266[_0x0a56('0x34')][_0x0a56('0x35')]?_0x251266[_0x0a56('0x34')]:_0x4cacdd[_0x0a56('0x2e')];if(!_0x47c729['query'][_0x0a56('0x36')](_0x0a56('0x37'))){_0x251266[_0x0a56('0x1c')]=qs[_0x0a56('0x1c')](_0x47c729['query'][_0x0a56('0x1c')]);_0x251266[_0x0a56('0x19')]=qs[_0x0a56('0x19')](_0x47c729[_0x0a56('0x31')]['offset']);}_0x251266[_0x0a56('0x38')]=qs[_0x0a56('0x39')](_0x47c729['query'][_0x0a56('0x39')]);_0x251266['where']=qs[_0x0a56('0x32')](_[_0x0a56('0x3a')](_0x47c729['query'],_0x4cacdd[_0x0a56('0x32')]),_0xd5a919);if(_0x47c729['query'][_0x0a56('0x3b')]){_0x251266[_0x0a56('0x3c')]=_[_0x0a56('0x3d')](_0x251266['where'],{'$or':_[_0x0a56('0x2f')](_0xd5a919,function(_0x4c9ead){if(_0x4c9ead[_0x0a56('0x2c')]!==_0x0a56('0x3e')){var _0x274c36={};_0x274c36[_0x4c9ead[_0x0a56('0x27')]]={'$like':'%'+_0x47c729[_0x0a56('0x31')][_0x0a56('0x3b')]+'%'};return _0x274c36;}})});}_0x251266=_[_0x0a56('0x3d')]({},_0x251266,_0x47c729[_0x0a56('0x3f')]);var _0x2c90e9={'where':_0x251266[_0x0a56('0x3c')]};return db[_0x0a56('0x40')][_0x0a56('0x1b')](_0x2c90e9)[_0x0a56('0x24')](function(_0x25acf3){_0x4df71c['count']=_0x25acf3;if(_0x47c729['query'][_0x0a56('0x41')]){_0x251266[_0x0a56('0x42')]=[{'all':!![]}];}return db[_0x0a56('0x40')][_0x0a56('0x43')](_0x251266);})[_0x0a56('0x24')](function(_0x1b9c3f){_0x4df71c[_0x0a56('0x44')]=_0x1b9c3f;return _0x4df71c;})[_0x0a56('0x24')](respondWithFilteredResult(_0x215085,_0x251266))[_0x0a56('0x45')](handleError(_0x215085,null));};exports[_0x0a56('0x46')]=function(_0xb40272,_0x4b7caf){var _0x50464e={'raw':!![],'where':{'id':_0xb40272[_0x0a56('0x47')]['id']}},_0x58e3a0={};_0x58e3a0[_0x0a56('0x2e')]=_[_0x0a56('0x30')](db[_0x0a56('0x40')][_0x0a56('0x2a')]);_0x58e3a0[_0x0a56('0x31')]=_[_0x0a56('0x30')](_0xb40272['query']);_0x58e3a0['filters']=_[_0x0a56('0x48')](_0x58e3a0[_0x0a56('0x2e')],_0x58e3a0[_0x0a56('0x31')]);_0x50464e[_0x0a56('0x34')]=_[_0x0a56('0x48')](_0x58e3a0[_0x0a56('0x2e')],qs[_0x0a56('0x33')](_0xb40272['query']['fields']));_0x50464e[_0x0a56('0x34')]=_0x50464e['attributes'][_0x0a56('0x35')]?_0x50464e[_0x0a56('0x34')]:_0x58e3a0['model'];if(_0xb40272[_0x0a56('0x31')][_0x0a56('0x41')]){_0x50464e['include']=[{'all':!![]}];}_0x50464e=_[_0x0a56('0x3d')]({},_0x50464e,_0xb40272[_0x0a56('0x3f')]);return db[_0x0a56('0x40')][_0x0a56('0x49')](_0x50464e)['then'](handleEntityNotFound(_0x4b7caf,null))[_0x0a56('0x24')](respondWithResult(_0x4b7caf,null))['catch'](handleError(_0x4b7caf,null));};exports[_0x0a56('0x4a')]=function(_0x1e7ed6,_0x332a20){return db[_0x0a56('0x40')]['create'](_0x1e7ed6[_0x0a56('0x4b')],{})[_0x0a56('0x24')](respondWithResult(_0x332a20,0xc9))[_0x0a56('0x45')](handleError(_0x332a20,null));};exports[_0x0a56('0x23')]=function(_0x4b4e68,_0x37b186){if(_0x4b4e68[_0x0a56('0x4b')]['id']){delete _0x4b4e68[_0x0a56('0x4b')]['id'];}return db[_0x0a56('0x40')][_0x0a56('0x49')]({'where':{'id':_0x4b4e68[_0x0a56('0x47')]['id']}})[_0x0a56('0x24')](handleEntityNotFound(_0x37b186,null))[_0x0a56('0x24')](saveUpdates(_0x4b4e68[_0x0a56('0x4b')],null))[_0x0a56('0x24')](respondWithResult(_0x37b186,null))['catch'](handleError(_0x37b186,null));};exports[_0x0a56('0x25')]=function(_0x432fde,_0x5b9310){return db['ServicenowField'][_0x0a56('0x49')]({'where':{'id':_0x432fde[_0x0a56('0x47')]['id']}})[_0x0a56('0x24')](handleEntityNotFound(_0x5b9310,null))[_0x0a56('0x24')](removeEntity(_0x5b9310,null))[_0x0a56('0x45')](handleError(_0x5b9310,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 529c6b3..abb8a6c 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 _0xc252=['api','bluebird','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','lodash','util','../../config/logger'];(function(_0x16f7d9,_0x12eb43){var _0x298cf4=function(_0x4ef4d8){while(--_0x4ef4d8){_0x16f7d9['push'](_0x16f7d9['shift']());}};_0x298cf4(++_0x12eb43);}(_0xc252,0x72));var _0x2c25=function(_0x313015,_0x35bba9){_0x313015=_0x313015-0x0;var _0x4b3a07=_0xc252[_0x313015];return _0x4b3a07;};'use strict';var _=require(_0x2c25('0x0'));var util=require(_0x2c25('0x1'));var logger=require(_0x2c25('0x2'))(_0x2c25('0x3'));var moment=require('moment');var BPromise=require(_0x2c25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c25('0x5'));var rimraf=require(_0x2c25('0x6'));var config=require('../../config/environment');var attributes=require(_0x2c25('0x7'));module[_0x2c25('0x8')]=function(_0x48913a,_0x515a69){return _0x48913a[_0x2c25('0x9')](_0x2c25('0xa'),attributes,{'tableName':_0x2c25('0xb'),'paranoid':![],'indexes':[{'name':_0x2c25('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0aca=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0xf069aa,_0x41dd27){var _0x30b3e4=function(_0x44c91b){while(--_0x44c91b){_0xf069aa['push'](_0xf069aa['shift']());}};_0x30b3e4(++_0x41dd27);}(_0x0aca,0x110));var _0xa0ac=function(_0x48a0b4,_0x2a4c3f){_0x48a0b4=_0x48a0b4-0x0;var _0x44b1e6=_0x0aca[_0x48a0b4];return _0x44b1e6;};'use strict';var _=require(_0xa0ac('0x0'));var util=require(_0xa0ac('0x1'));var logger=require(_0xa0ac('0x2'))(_0xa0ac('0x3'));var moment=require('moment');var BPromise=require(_0xa0ac('0x4'));var rp=require(_0xa0ac('0x5'));var fs=require('fs');var path=require(_0xa0ac('0x6'));var rimraf=require(_0xa0ac('0x7'));var config=require(_0xa0ac('0x8'));var attributes=require(_0xa0ac('0x9'));module[_0xa0ac('0xa')]=function(_0x2c361a,_0xf591d){return _0x2c361a[_0xa0ac('0xb')](_0xa0ac('0xc'),attributes,{'tableName':_0xa0ac('0xd'),'paranoid':![],'indexes':[{'name':_0xa0ac('0xe'),'fields':[_0xa0ac('0xf'),_0xa0ac('0x10')],'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 d17238b..9b3b000 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 _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0xf25c3a,_0x2bf9dd){var _0x2a095f=function(_0x3c19f4){while(--_0x3c19f4){_0xf25c3a['push'](_0xf25c3a['shift']());}};_0x2a095f(++_0x2bf9dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1e9e56,_0x34a74a){var _0x5d5e2e=function(_0x4bfcc2){while(--_0x4bfcc2){_0x1e9e56['push'](_0x1e9e56['shift']());}};_0x5d5e2e(++_0x34a74a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 80bf31a..1b70d9f 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(_0x4383b5,_0x269fbd){var _0x36925d=function(_0x247358){while(--_0x247358){_0x4383b5['push'](_0x4383b5['shift']());}};_0x36925d(++_0x269fbd);}(_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 +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(_0x28236b,_0x3ad235){var _0x22ffa4=function(_0x531b67){while(--_0x531b67){_0x28236b['push'](_0x28236b['shift']());}};_0x22ffa4(++_0x3ad235);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 080ee88..2d3d3da 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(_0xba01a0,_0x5e94bb){var _0x1ff1c8=function(_0x2dcdce){while(--_0x2dcdce){_0xba01a0['push'](_0xba01a0['shift']());}};_0x1ff1c8(++_0x5e94bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x2c26ed,_0x29084b){var _0x552e7f=function(_0x1c5c3){while(--_0x1c5c3){_0x2c26ed['push'](_0x2c26ed['shift']());}};_0x552e7f(++_0x29084b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 73ffa92..3a406b0 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 _0x0ff3=['offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','error','name','map','SugarcrmAccount','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','slice','POST','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status'];(function(_0x4723ae,_0x6ffdd6){var _0x592ca5=function(_0x4fd641){while(--_0x4fd641){_0x4723ae['push'](_0x4723ae['shift']());}};_0x592ca5(++_0x6ffdd6);}(_0x0ff3,0xcf));var _0x30ff=function(_0x8385f3,_0x53f26b){_0x8385f3=_0x8385f3-0x0;var _0x50c271=_0x0ff3[_0x8385f3];return _0x50c271;};'use strict';var emlformat=require(_0x30ff('0x0'));var rimraf=require(_0x30ff('0x1'));var zipdir=require(_0x30ff('0x2'));var jsonpatch=require(_0x30ff('0x3'));var rp=require(_0x30ff('0x4'));var moment=require(_0x30ff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x30ff('0x6'));var util=require('util');var path=require(_0x30ff('0x7'));var sox=require(_0x30ff('0x8'));var csv=require(_0x30ff('0x9'));var ejs=require(_0x30ff('0xa'));var fs=require('fs');var fs_extra=require(_0x30ff('0xb'));var _=require('lodash');var squel=require(_0x30ff('0xc'));var crypto=require('crypto');var jsforce=require(_0x30ff('0xd'));var deskjs=require(_0x30ff('0xe'));var toCsv=require(_0x30ff('0x9'));var querystring=require(_0x30ff('0xf'));var Papa=require(_0x30ff('0x10'));var Redis=require(_0x30ff('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x30ff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x30ff('0x13'));var logger=require(_0x30ff('0x14'))(_0x30ff('0x15'));var utils=require(_0x30ff('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x30ff('0x17'));var db=require(_0x30ff('0x18'))['db'];var integrations=require(_0x30ff('0x19'));function respondWithStatusCode(_0x226d99,_0x8961fb){_0x8961fb=_0x8961fb||0xcc;return function(_0x438ca1){if(_0x438ca1){return _0x226d99['sendStatus'](_0x8961fb);}return _0x226d99[_0x30ff('0x1a')](_0x8961fb)['end']();};}function respondWithResult(_0x4fde93,_0x4dc33c){_0x4dc33c=_0x4dc33c||0xc8;return function(_0x3e2bf2){if(_0x3e2bf2){return _0x4fde93[_0x30ff('0x1a')](_0x4dc33c)['json'](_0x3e2bf2);}};}function respondWithFilteredResult(_0x174ab0,_0x4ec1d9){return function(_0x3b2967){if(_0x3b2967){var _0x201c83=typeof _0x4ec1d9[_0x30ff('0x1b')]===_0x30ff('0x1c')&&typeof _0x4ec1d9[_0x30ff('0x1d')]===_0x30ff('0x1c');var _0x234339=_0x3b2967['count'];var _0x24d724=_0x201c83?0x0:_0x4ec1d9[_0x30ff('0x1b')];var _0x548540=_0x201c83?_0x3b2967[_0x30ff('0x1e')]:_0x4ec1d9[_0x30ff('0x1b')]+_0x4ec1d9[_0x30ff('0x1d')];var _0x4e0659;if(_0x548540>=_0x234339){_0x548540=_0x234339;_0x4e0659=0xc8;}else{_0x4e0659=0xce;}_0x174ab0['status'](_0x4e0659);return _0x174ab0['set'](_0x30ff('0x1f'),_0x24d724+'-'+_0x548540+'/'+_0x234339)[_0x30ff('0x20')](_0x3b2967);}return null;};}function patchUpdates(_0x63066e){return function(_0xbdfe27){try{jsonpatch[_0x30ff('0x21')](_0xbdfe27,_0x63066e,!![]);}catch(_0x21733e){return BPromise[_0x30ff('0x22')](_0x21733e);}return _0xbdfe27['save']();};}function saveUpdates(_0x1e2e08,_0x44ac4d){return function(_0x322658){if(_0x322658){return _0x322658[_0x30ff('0x23')](_0x1e2e08)[_0x30ff('0x24')](function(_0x49e91e){return _0x49e91e;});}return null;};}function removeEntity(_0x542d4c,_0x209183){return function(_0x4b89f7){if(_0x4b89f7){return _0x4b89f7[_0x30ff('0x25')]()[_0x30ff('0x24')](function(){_0x542d4c[_0x30ff('0x1a')](0xcc)[_0x30ff('0x26')]();});}};}function handleEntityNotFound(_0x37fead,_0x20c2d6){return function(_0x25faeb){if(!_0x25faeb){_0x37fead[_0x30ff('0x27')](0x194);}return _0x25faeb;};}function handleError(_0x31ceeb,_0x1366a7){_0x1366a7=_0x1366a7||0x1f4;return function(_0x44d239){logger[_0x30ff('0x28')](_0x44d239['stack']);if(_0x44d239[_0x30ff('0x29')]){delete _0x44d239[_0x30ff('0x29')];}_0x31ceeb[_0x30ff('0x1a')](_0x1366a7)['send'](_0x44d239);};}exports['index']=function(_0x44ff41,_0x15353a){var _0x3ac79c={},_0x51bd40={},_0x57ce19={'count':0x0,'rows':[]};var _0x33129f=_[_0x30ff('0x2a')](db[_0x30ff('0x2b')][_0x30ff('0x2c')],function(_0x37e90d){return{'name':_0x37e90d['fieldName'],'type':_0x37e90d['type'][_0x30ff('0x2d')]};});_0x51bd40[_0x30ff('0x2e')]=_[_0x30ff('0x2a')](_0x33129f,'name');_0x51bd40[_0x30ff('0x2f')]=_[_0x30ff('0x30')](_0x44ff41[_0x30ff('0x2f')]);_0x51bd40[_0x30ff('0x31')]=_['intersection'](_0x51bd40['model'],_0x51bd40[_0x30ff('0x2f')]);_0x3ac79c[_0x30ff('0x32')]=_['intersection'](_0x51bd40[_0x30ff('0x2e')],qs['fields'](_0x44ff41[_0x30ff('0x2f')][_0x30ff('0x33')]));_0x3ac79c[_0x30ff('0x32')]=_0x3ac79c[_0x30ff('0x32')][_0x30ff('0x34')]?_0x3ac79c['attributes']:_0x51bd40[_0x30ff('0x2e')];if(!_0x44ff41[_0x30ff('0x2f')][_0x30ff('0x35')](_0x30ff('0x36'))){_0x3ac79c[_0x30ff('0x1d')]=qs[_0x30ff('0x1d')](_0x44ff41[_0x30ff('0x2f')][_0x30ff('0x1d')]);_0x3ac79c[_0x30ff('0x1b')]=qs[_0x30ff('0x1b')](_0x44ff41['query'][_0x30ff('0x1b')]);}_0x3ac79c[_0x30ff('0x37')]=qs[_0x30ff('0x38')](_0x44ff41[_0x30ff('0x2f')][_0x30ff('0x38')]);_0x3ac79c[_0x30ff('0x39')]=qs[_0x30ff('0x31')](_[_0x30ff('0x3a')](_0x44ff41['query'],_0x51bd40[_0x30ff('0x31')]),_0x33129f);if(_0x44ff41[_0x30ff('0x2f')][_0x30ff('0x3b')]){_0x3ac79c[_0x30ff('0x39')]=_[_0x30ff('0x3c')](_0x3ac79c['where'],{'$or':_['map'](_0x33129f,function(_0x3af8d4){if(_0x3af8d4[_0x30ff('0x3d')]!==_0x30ff('0x3e')){var _0x27a4df={};_0x27a4df[_0x3af8d4[_0x30ff('0x29')]]={'$like':'%'+_0x44ff41[_0x30ff('0x2f')]['filter']+'%'};return _0x27a4df;}})});}_0x3ac79c=_['merge']({},_0x3ac79c,_0x44ff41[_0x30ff('0x3f')]);var _0xe46d2d={'where':_0x3ac79c[_0x30ff('0x39')]};return db[_0x30ff('0x2b')][_0x30ff('0x1e')](_0xe46d2d)[_0x30ff('0x24')](function(_0xbd02bb){_0x57ce19[_0x30ff('0x1e')]=_0xbd02bb;if(_0x44ff41[_0x30ff('0x2f')][_0x30ff('0x40')]){_0x3ac79c[_0x30ff('0x41')]=[{'all':!![]}];}return db[_0x30ff('0x2b')]['findAll'](_0x3ac79c);})[_0x30ff('0x24')](function(_0x427e9b){_0x57ce19[_0x30ff('0x42')]=_0x427e9b;return _0x57ce19;})[_0x30ff('0x24')](respondWithFilteredResult(_0x15353a,_0x3ac79c))[_0x30ff('0x43')](handleError(_0x15353a,null));};exports[_0x30ff('0x44')]=function(_0x4d3a8b,_0x48d2aa){var _0x3fc3ef={'raw':![],'where':{'id':_0x4d3a8b[_0x30ff('0x45')]['id']}},_0x3098b2={};_0x3098b2[_0x30ff('0x2e')]=_[_0x30ff('0x30')](db[_0x30ff('0x2b')][_0x30ff('0x2c')]);_0x3098b2[_0x30ff('0x2f')]=_[_0x30ff('0x30')](_0x4d3a8b[_0x30ff('0x2f')]);_0x3098b2[_0x30ff('0x31')]=_['intersection'](_0x3098b2[_0x30ff('0x2e')],_0x3098b2[_0x30ff('0x2f')]);_0x3fc3ef[_0x30ff('0x32')]=_[_0x30ff('0x46')](_0x3098b2[_0x30ff('0x2e')],qs[_0x30ff('0x33')](_0x4d3a8b[_0x30ff('0x2f')][_0x30ff('0x33')]));_0x3fc3ef[_0x30ff('0x32')]=_0x3fc3ef[_0x30ff('0x32')][_0x30ff('0x34')]?_0x3fc3ef[_0x30ff('0x32')]:_0x3098b2[_0x30ff('0x2e')];if(_0x4d3a8b[_0x30ff('0x2f')]['includeAll']){_0x3fc3ef[_0x30ff('0x41')]=[{'all':!![]}];}_0x3fc3ef=_[_0x30ff('0x3c')]({},_0x3fc3ef,_0x4d3a8b['options']);return db[_0x30ff('0x2b')][_0x30ff('0x47')](_0x3fc3ef)[_0x30ff('0x24')](handleEntityNotFound(_0x48d2aa,null))[_0x30ff('0x24')](respondWithResult(_0x48d2aa,null))[_0x30ff('0x43')](handleError(_0x48d2aa,null));};exports[_0x30ff('0x48')]=function(_0x1e414f,_0x4cda71){return db[_0x30ff('0x2b')]['create'](_0x1e414f['body'],{})[_0x30ff('0x24')](respondWithResult(_0x4cda71,0xc9))['catch'](handleError(_0x4cda71,null));};exports[_0x30ff('0x23')]=function(_0x4ba787,_0x421b53){if(_0x4ba787[_0x30ff('0x49')]['id']){delete _0x4ba787[_0x30ff('0x49')]['id'];}return db['SugarcrmAccount'][_0x30ff('0x47')]({'where':{'id':_0x4ba787['params']['id']}})[_0x30ff('0x24')](handleEntityNotFound(_0x421b53,null))[_0x30ff('0x24')](saveUpdates(_0x4ba787['body'],null))[_0x30ff('0x24')](respondWithResult(_0x421b53,null))[_0x30ff('0x43')](handleError(_0x421b53,null));};exports['destroy']=function(_0x4385f0,_0x376127){return db['SugarcrmAccount'][_0x30ff('0x47')]({'where':{'id':_0x4385f0[_0x30ff('0x45')]['id']}})['then'](handleEntityNotFound(_0x376127,null))[_0x30ff('0x24')](removeEntity(_0x376127,null))[_0x30ff('0x43')](handleError(_0x376127,null));};exports[_0x30ff('0x4a')]=function(_0xfc6390,_0x405851,_0xef5caa){var _0x571361={};var _0x2ca1d6={};var _0x3a47c2;var _0x1280ce;return db['SugarcrmAccount'][_0x30ff('0x4b')]({'where':{'id':_0xfc6390[_0x30ff('0x45')]['id']}})['then'](handleEntityNotFound(_0x405851,null))[_0x30ff('0x24')](function(_0x48abeb){if(_0x48abeb){_0x3a47c2=_0x48abeb;_0x2ca1d6[_0x30ff('0x2e')]=_['keys'](db[_0x30ff('0x4c')]['rawAttributes']);_0x2ca1d6[_0x30ff('0x2f')]=_['keys'](_0xfc6390[_0x30ff('0x2f')]);_0x2ca1d6[_0x30ff('0x31')]=_['intersection'](_0x2ca1d6[_0x30ff('0x2e')],_0x2ca1d6[_0x30ff('0x2f')]);_0x571361[_0x30ff('0x32')]=_[_0x30ff('0x46')](_0x2ca1d6['model'],qs[_0x30ff('0x33')](_0xfc6390[_0x30ff('0x2f')][_0x30ff('0x33')]));_0x571361['attributes']=_0x571361[_0x30ff('0x32')][_0x30ff('0x34')]?_0x571361[_0x30ff('0x32')]:_0x2ca1d6[_0x30ff('0x2e')];_0x571361[_0x30ff('0x37')]=qs[_0x30ff('0x38')](_0xfc6390[_0x30ff('0x2f')][_0x30ff('0x38')]);_0x571361[_0x30ff('0x39')]=qs[_0x30ff('0x31')](_[_0x30ff('0x3a')](_0xfc6390[_0x30ff('0x2f')],_0x2ca1d6[_0x30ff('0x31')]));if(_0xfc6390[_0x30ff('0x2f')][_0x30ff('0x3b')]){_0x571361[_0x30ff('0x39')]=_[_0x30ff('0x3c')](_0x571361[_0x30ff('0x39')],{'$or':_[_0x30ff('0x2a')](_0x571361[_0x30ff('0x32')],function(_0x519d21){var _0x17c924={};_0x17c924[_0x519d21]={'$like':'%'+_0xfc6390[_0x30ff('0x2f')][_0x30ff('0x3b')]+'%'};return _0x17c924;})});}_0x571361=_[_0x30ff('0x3c')]({},_0x571361,_0xfc6390[_0x30ff('0x3f')]);return _0x3a47c2['getConfigurations'](_0x571361);}})['then'](function(_0x3cff95){if(_0x3cff95){_0x1280ce=_0x3cff95[_0x30ff('0x34')];if(!_0xfc6390[_0x30ff('0x2f')][_0x30ff('0x35')]('nolimit')){_0x571361[_0x30ff('0x1d')]=qs[_0x30ff('0x1d')](_0xfc6390[_0x30ff('0x2f')][_0x30ff('0x1d')]);_0x571361[_0x30ff('0x1b')]=qs[_0x30ff('0x1b')](_0xfc6390[_0x30ff('0x2f')]['offset']);}return _0x3a47c2[_0x30ff('0x4a')](_0x571361);}})[_0x30ff('0x24')](function(_0x1c9ab2){if(_0x1c9ab2){return _0x1c9ab2?{'count':_0x1280ce,'rows':_0x1c9ab2}:null;}})[_0x30ff('0x24')](respondWithResult(_0x405851,null))[_0x30ff('0x43')](handleError(_0x405851,null));};exports['addConfiguration']=function(_0x27b63c,_0x163fe7,_0x4bd7bd){if(_0x27b63c[_0x30ff('0x49')]['id']){delete _0x27b63c[_0x30ff('0x49')]['id'];}return db['SugarcrmAccount'][_0x30ff('0x4b')]({'where':{'id':_0x27b63c[_0x30ff('0x45')]['id']}})['then'](handleEntityNotFound(_0x163fe7,null))[_0x30ff('0x24')](function(_0x18c695){if(_0x18c695){_0x27b63c[_0x30ff('0x49')]['AccountId']=_0x18c695['id'];_0x27b63c[_0x30ff('0x49')]['Subjects']=integrations[_0x30ff('0x4d')](_0x27b63c[_0x30ff('0x49')][_0x30ff('0x4e')],_0x27b63c[_0x30ff('0x49')][_0x30ff('0x3d')]);_0x27b63c[_0x30ff('0x49')]['Descriptions']=integrations[_0x30ff('0x4f')](_0x27b63c[_0x30ff('0x49')][_0x30ff('0x4e')],_0x27b63c['body'][_0x30ff('0x3d')]);return db[_0x30ff('0x4c')][_0x30ff('0x48')](_0x27b63c['body'],{'include':[{'model':db[_0x30ff('0x50')],'as':_0x30ff('0x51')},{'model':db[_0x30ff('0x50')],'as':_0x30ff('0x52')}]});}return null;})[_0x30ff('0x24')](respondWithResult(_0x163fe7,null))[_0x30ff('0x43')](handleError(_0x163fe7,null));};exports[_0x30ff('0x53')]=function(_0x277e95,_0xb2a25,_0x1a7796){var _0x1eddf7='';var _0x2433f8=['id','name',_0x30ff('0x54'),_0x30ff('0x55'),_0x30ff('0x56'),'date_start',_0x30ff('0x57'),_0x30ff('0x58'),_0x30ff('0x59'),_0x30ff('0x5a'),_0x30ff('0x5b'),'direction'];return db[_0x30ff('0x2b')]['findOne']({'where':{'id':_0x277e95[_0x30ff('0x45')]['id']},'attributes':['id',_0x30ff('0x5c'),_0x30ff('0x5d'),_0x30ff('0x5e')]})[_0x30ff('0x24')](handleEntityNotFound(_0xb2a25,null))['then'](function(_0x32a4fe){if(_0x32a4fe){_0x1eddf7=_0x32a4fe[_0x30ff('0x5e')];var _0x1303ff=_0x1eddf7[_0x30ff('0x5f')](-0x1);if(_0x1303ff==='/'){_0x1eddf7=_0x1eddf7['substring'](0x0,_0x1eddf7['lastIndexOf'](_0x1303ff));}return rp({'method':_0x30ff('0x60'),'uri':util['format'](_0x30ff('0x61'),_0x1eddf7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x30ff('0x62'),'input_type':_0x30ff('0x63'),'response_type':_0x30ff('0x63'),'rest_data':JSON[_0x30ff('0x64')]({'user_auth':{'user_name':_0x32a4fe[_0x30ff('0x5c')],'password':_0x32a4fe[_0x30ff('0x5d')],'encryption':_0x30ff('0x65')},'application':_0x30ff('0x66')})}});}})[_0x30ff('0x24')](function(_0x3a0ee3){if(_0x3a0ee3&&_0x3a0ee3['name']!==_0x30ff('0x67')&&_0x3a0ee3[_0x30ff('0x29')]!=='Password\x20Expired'){return rp({'method':_0x30ff('0x60'),'uri':util[_0x30ff('0x68')](_0x30ff('0x61'),_0x1eddf7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x30ff('0x63'),'response_type':_0x30ff('0x63'),'rest_data':JSON[_0x30ff('0x64')]({'session':_0x3a0ee3['id'],'module_name':_0x30ff('0x69')})}})[_0x30ff('0x24')](function(_0x385971){if(_0x385971){var _0x56003d=_[_0x30ff('0x6a')](_0x385971[_0x30ff('0x6b')]);_['remove'](_0x56003d,function(_0x58660a){return _0x2433f8[_0x30ff('0x6c')](_0x58660a[_0x30ff('0x29')]);});return{'count':_0x56003d[_0x30ff('0x34')],'rows':_[_0x30ff('0x2a')](_0x56003d,function(_0x42cae9){return{'id':_0x42cae9['name'],'name':_0x42cae9[_0x30ff('0x6d')],'custom':_[_0x30ff('0x6e')](_0x42cae9[_0x30ff('0x29')],'_c')?!![]:![],'options':_0x42cae9[_0x30ff('0x3f')]?_['map'](_[_0x30ff('0x6a')](_0x42cae9[_0x30ff('0x3f')]),function(_0x5f340b){return{'name':_0x5f340b[_0x30ff('0x6f')],'value':_0x5f340b[_0x30ff('0x29')]};}):[]};})};}})[_0x30ff('0x24')](respondWithResult(_0xb2a25,null))[_0x30ff('0x43')](function(_0x4ca0d8){var _0x1b3da8=_0x277e95[_0x30ff('0x2f')][_0x30ff('0x70')]?0x1f4:_0x4ca0d8[_0x30ff('0x71')]||0x1f4;logger[_0x30ff('0x28')](_0x30ff('0x72'),_0x30ff('0x53'),_0x1b3da8,JSON['stringify'](_0x4ca0d8));delete _0x4ca0d8[_0x30ff('0x29')];if(_0x1b3da8===0x191){_0x1b3da8=0x190;}_0xb2a25[_0x30ff('0x1a')](_0x1b3da8)['send'](_0x277e95[_0x30ff('0x2f')][_0x30ff('0x70')]?{'message':_0x30ff('0x73'),'statusCode':_0x4ca0d8['statusCode']}:_0x4ca0d8);});}else{var _0x34fe04=0x1f4;_0xb2a25[_0x30ff('0x1a')](_0x34fe04)[_0x30ff('0x74')]({'message':_0x30ff('0x73'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xa120=['params','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','duration_minutes','direction','username','remoteUri','slice','substring','lastIndexOf','POST','%s%s','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','format','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','remove','includes','endsWith','values','value','statusCode','test','Wrong\x20credentials','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x3946e6,_0xcffb16){var _0x266778=function(_0x251e06){while(--_0x251e06){_0x3946e6['push'](_0x3946e6['shift']());}};_0x266778(++_0xcffb16);}(_0xa120,0x1a9));var _0x0a12=function(_0x1f5088,_0x51baa4){_0x1f5088=_0x1f5088-0x0;var _0x4f0565=_0xa120[_0x1f5088];return _0x4f0565;};'use strict';var emlformat=require(_0x0a12('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a12('0x1'));var jsonpatch=require(_0x0a12('0x2'));var rp=require('request-promise');var moment=require(_0x0a12('0x3'));var BPromise=require(_0x0a12('0x4'));var Mustache=require(_0x0a12('0x5'));var util=require(_0x0a12('0x6'));var path=require(_0x0a12('0x7'));var sox=require(_0x0a12('0x8'));var csv=require('to-csv');var ejs=require(_0x0a12('0x9'));var fs=require('fs');var fs_extra=require(_0x0a12('0xa'));var _=require(_0x0a12('0xb'));var squel=require(_0x0a12('0xc'));var crypto=require(_0x0a12('0xd'));var jsforce=require(_0x0a12('0xe'));var deskjs=require(_0x0a12('0xf'));var toCsv=require(_0x0a12('0x10'));var querystring=require(_0x0a12('0x11'));var Papa=require(_0x0a12('0x12'));var Redis=require(_0x0a12('0x13'));var authService=require(_0x0a12('0x14'));var qs=require(_0x0a12('0x15'));var as=require(_0x0a12('0x16'));var hardwareService=require(_0x0a12('0x17'));var logger=require(_0x0a12('0x18'))(_0x0a12('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a12('0x1a'));var db=require(_0x0a12('0x1b'))['db'];var integrations=require(_0x0a12('0x1c'));function respondWithStatusCode(_0x2cc977,_0x2b8182){_0x2b8182=_0x2b8182||0xcc;return function(_0x53ab8){if(_0x53ab8){return _0x2cc977[_0x0a12('0x1d')](_0x2b8182);}return _0x2cc977[_0x0a12('0x1e')](_0x2b8182)[_0x0a12('0x1f')]();};}function respondWithResult(_0x106f07,_0x3af695){_0x3af695=_0x3af695||0xc8;return function(_0x51f0a4){if(_0x51f0a4){return _0x106f07[_0x0a12('0x1e')](_0x3af695)['json'](_0x51f0a4);}};}function respondWithFilteredResult(_0x145aee,_0x39e270){return function(_0x4c0a38){if(_0x4c0a38){var _0x523e34=typeof _0x39e270['offset']===_0x0a12('0x20')&&typeof _0x39e270['limit']===_0x0a12('0x20');var _0x2521e1=_0x4c0a38['count'];var _0x25a9ff=_0x523e34?0x0:_0x39e270[_0x0a12('0x21')];var _0x3f8194=_0x523e34?_0x4c0a38[_0x0a12('0x22')]:_0x39e270[_0x0a12('0x21')]+_0x39e270[_0x0a12('0x23')];var _0x1baae1;if(_0x3f8194>=_0x2521e1){_0x3f8194=_0x2521e1;_0x1baae1=0xc8;}else{_0x1baae1=0xce;}_0x145aee[_0x0a12('0x1e')](_0x1baae1);return _0x145aee[_0x0a12('0x24')](_0x0a12('0x25'),_0x25a9ff+'-'+_0x3f8194+'/'+_0x2521e1)['json'](_0x4c0a38);}return null;};}function patchUpdates(_0x4a0b83){return function(_0x4cd66){try{jsonpatch[_0x0a12('0x26')](_0x4cd66,_0x4a0b83,!![]);}catch(_0x1dae5d){return BPromise[_0x0a12('0x27')](_0x1dae5d);}return _0x4cd66[_0x0a12('0x28')]();};}function saveUpdates(_0x1f3837,_0x5e9520){return function(_0x5c9b31){if(_0x5c9b31){return _0x5c9b31[_0x0a12('0x29')](_0x1f3837)[_0x0a12('0x2a')](function(_0x55c052){return _0x55c052;});}return null;};}function removeEntity(_0x295795,_0x24d564){return function(_0x4fbddd){if(_0x4fbddd){return _0x4fbddd[_0x0a12('0x2b')]()[_0x0a12('0x2a')](function(){_0x295795[_0x0a12('0x1e')](0xcc)[_0x0a12('0x1f')]();});}};}function handleEntityNotFound(_0x2430ce,_0x2797ca){return function(_0x4408a2){if(!_0x4408a2){_0x2430ce[_0x0a12('0x1d')](0x194);}return _0x4408a2;};}function handleError(_0x5babfa,_0xfca5a8){_0xfca5a8=_0xfca5a8||0x1f4;return function(_0x30ec45){logger[_0x0a12('0x2c')](_0x30ec45[_0x0a12('0x2d')]);if(_0x30ec45[_0x0a12('0x2e')]){delete _0x30ec45['name'];}_0x5babfa[_0x0a12('0x1e')](_0xfca5a8)['send'](_0x30ec45);};}exports[_0x0a12('0x2f')]=function(_0x50e5d3,_0x3e3f4e){var _0x1a5738={},_0x110f94={},_0x36a62f={'count':0x0,'rows':[]};var _0x2087ec=_[_0x0a12('0x30')](db[_0x0a12('0x31')][_0x0a12('0x32')],function(_0x505c30){return{'name':_0x505c30[_0x0a12('0x33')],'type':_0x505c30[_0x0a12('0x34')][_0x0a12('0x35')]};});_0x110f94[_0x0a12('0x36')]=_['map'](_0x2087ec,_0x0a12('0x2e'));_0x110f94[_0x0a12('0x37')]=_[_0x0a12('0x38')](_0x50e5d3['query']);_0x110f94[_0x0a12('0x39')]=_[_0x0a12('0x3a')](_0x110f94[_0x0a12('0x36')],_0x110f94[_0x0a12('0x37')]);_0x1a5738[_0x0a12('0x3b')]=_[_0x0a12('0x3a')](_0x110f94[_0x0a12('0x36')],qs['fields'](_0x50e5d3[_0x0a12('0x37')][_0x0a12('0x3c')]));_0x1a5738[_0x0a12('0x3b')]=_0x1a5738[_0x0a12('0x3b')][_0x0a12('0x3d')]?_0x1a5738[_0x0a12('0x3b')]:_0x110f94[_0x0a12('0x36')];if(!_0x50e5d3[_0x0a12('0x37')][_0x0a12('0x3e')](_0x0a12('0x3f'))){_0x1a5738[_0x0a12('0x23')]=qs[_0x0a12('0x23')](_0x50e5d3['query'][_0x0a12('0x23')]);_0x1a5738['offset']=qs[_0x0a12('0x21')](_0x50e5d3[_0x0a12('0x37')]['offset']);}_0x1a5738[_0x0a12('0x40')]=qs[_0x0a12('0x41')](_0x50e5d3[_0x0a12('0x37')][_0x0a12('0x41')]);_0x1a5738['where']=qs[_0x0a12('0x39')](_['pick'](_0x50e5d3['query'],_0x110f94[_0x0a12('0x39')]),_0x2087ec);if(_0x50e5d3[_0x0a12('0x37')][_0x0a12('0x42')]){_0x1a5738[_0x0a12('0x43')]=_[_0x0a12('0x44')](_0x1a5738[_0x0a12('0x43')],{'$or':_[_0x0a12('0x30')](_0x2087ec,function(_0x1de407){if(_0x1de407[_0x0a12('0x34')]!==_0x0a12('0x45')){var _0x4bd948={};_0x4bd948[_0x1de407['name']]={'$like':'%'+_0x50e5d3[_0x0a12('0x37')]['filter']+'%'};return _0x4bd948;}})});}_0x1a5738=_[_0x0a12('0x44')]({},_0x1a5738,_0x50e5d3['options']);var _0xcbfa09={'where':_0x1a5738['where']};return db[_0x0a12('0x31')][_0x0a12('0x22')](_0xcbfa09)[_0x0a12('0x2a')](function(_0x423536){_0x36a62f[_0x0a12('0x22')]=_0x423536;if(_0x50e5d3['query'][_0x0a12('0x46')]){_0x1a5738[_0x0a12('0x47')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x0a12('0x48')](_0x1a5738);})[_0x0a12('0x2a')](function(_0x5cdaca){_0x36a62f[_0x0a12('0x49')]=_0x5cdaca;return _0x36a62f;})['then'](respondWithFilteredResult(_0x3e3f4e,_0x1a5738))[_0x0a12('0x4a')](handleError(_0x3e3f4e,null));};exports['show']=function(_0x147cba,_0x5ab3be){var _0x3cd189={'raw':![],'where':{'id':_0x147cba[_0x0a12('0x4b')]['id']}},_0x4b9655={};_0x4b9655['model']=_[_0x0a12('0x38')](db[_0x0a12('0x31')][_0x0a12('0x32')]);_0x4b9655[_0x0a12('0x37')]=_['keys'](_0x147cba[_0x0a12('0x37')]);_0x4b9655[_0x0a12('0x39')]=_[_0x0a12('0x3a')](_0x4b9655[_0x0a12('0x36')],_0x4b9655[_0x0a12('0x37')]);_0x3cd189[_0x0a12('0x3b')]=_[_0x0a12('0x3a')](_0x4b9655[_0x0a12('0x36')],qs[_0x0a12('0x3c')](_0x147cba['query'][_0x0a12('0x3c')]));_0x3cd189[_0x0a12('0x3b')]=_0x3cd189[_0x0a12('0x3b')]['length']?_0x3cd189[_0x0a12('0x3b')]:_0x4b9655[_0x0a12('0x36')];if(_0x147cba[_0x0a12('0x37')][_0x0a12('0x46')]){_0x3cd189[_0x0a12('0x47')]=[{'all':!![]}];}_0x3cd189=_[_0x0a12('0x44')]({},_0x3cd189,_0x147cba[_0x0a12('0x4c')]);return db[_0x0a12('0x31')][_0x0a12('0x4d')](_0x3cd189)[_0x0a12('0x2a')](handleEntityNotFound(_0x5ab3be,null))[_0x0a12('0x2a')](respondWithResult(_0x5ab3be,null))[_0x0a12('0x4a')](handleError(_0x5ab3be,null));};exports[_0x0a12('0x4e')]=function(_0x39652d,_0x5ef6e1){return db[_0x0a12('0x31')]['create'](_0x39652d[_0x0a12('0x4f')],{})[_0x0a12('0x2a')](respondWithResult(_0x5ef6e1,0xc9))['catch'](handleError(_0x5ef6e1,null));};exports[_0x0a12('0x29')]=function(_0x24987b,_0x2ea88e){if(_0x24987b[_0x0a12('0x4f')]['id']){delete _0x24987b[_0x0a12('0x4f')]['id'];}return db[_0x0a12('0x31')][_0x0a12('0x4d')]({'where':{'id':_0x24987b[_0x0a12('0x4b')]['id']}})[_0x0a12('0x2a')](handleEntityNotFound(_0x2ea88e,null))[_0x0a12('0x2a')](saveUpdates(_0x24987b[_0x0a12('0x4f')],null))[_0x0a12('0x2a')](respondWithResult(_0x2ea88e,null))[_0x0a12('0x4a')](handleError(_0x2ea88e,null));};exports['destroy']=function(_0x5cc236,_0x4d2b8d){return db[_0x0a12('0x31')][_0x0a12('0x4d')]({'where':{'id':_0x5cc236[_0x0a12('0x4b')]['id']}})[_0x0a12('0x2a')](handleEntityNotFound(_0x4d2b8d,null))[_0x0a12('0x2a')](removeEntity(_0x4d2b8d,null))['catch'](handleError(_0x4d2b8d,null));};exports[_0x0a12('0x50')]=function(_0x330871,_0x272148,_0x5269c6){var _0x477d01={};var _0x2c8ddb={};var _0x221966;var _0x25136c;return db[_0x0a12('0x31')][_0x0a12('0x51')]({'where':{'id':_0x330871[_0x0a12('0x4b')]['id']}})[_0x0a12('0x2a')](handleEntityNotFound(_0x272148,null))[_0x0a12('0x2a')](function(_0x34a61a){if(_0x34a61a){_0x221966=_0x34a61a;_0x2c8ddb[_0x0a12('0x36')]=_[_0x0a12('0x38')](db[_0x0a12('0x52')][_0x0a12('0x32')]);_0x2c8ddb[_0x0a12('0x37')]=_['keys'](_0x330871['query']);_0x2c8ddb[_0x0a12('0x39')]=_[_0x0a12('0x3a')](_0x2c8ddb[_0x0a12('0x36')],_0x2c8ddb[_0x0a12('0x37')]);_0x477d01[_0x0a12('0x3b')]=_[_0x0a12('0x3a')](_0x2c8ddb['model'],qs[_0x0a12('0x3c')](_0x330871['query'][_0x0a12('0x3c')]));_0x477d01['attributes']=_0x477d01[_0x0a12('0x3b')]['length']?_0x477d01[_0x0a12('0x3b')]:_0x2c8ddb['model'];_0x477d01['order']=qs[_0x0a12('0x41')](_0x330871[_0x0a12('0x37')]['sort']);_0x477d01['where']=qs[_0x0a12('0x39')](_[_0x0a12('0x53')](_0x330871[_0x0a12('0x37')],_0x2c8ddb[_0x0a12('0x39')]));if(_0x330871[_0x0a12('0x37')]['filter']){_0x477d01['where']=_[_0x0a12('0x44')](_0x477d01[_0x0a12('0x43')],{'$or':_[_0x0a12('0x30')](_0x477d01[_0x0a12('0x3b')],function(_0x5c0c5d){var _0x545cf0={};_0x545cf0[_0x5c0c5d]={'$like':'%'+_0x330871[_0x0a12('0x37')][_0x0a12('0x42')]+'%'};return _0x545cf0;})});}_0x477d01=_['merge']({},_0x477d01,_0x330871['options']);return _0x221966['getConfigurations'](_0x477d01);}})[_0x0a12('0x2a')](function(_0x426c5e){if(_0x426c5e){_0x25136c=_0x426c5e[_0x0a12('0x3d')];if(!_0x330871[_0x0a12('0x37')][_0x0a12('0x3e')](_0x0a12('0x3f'))){_0x477d01[_0x0a12('0x23')]=qs['limit'](_0x330871[_0x0a12('0x37')][_0x0a12('0x23')]);_0x477d01['offset']=qs['offset'](_0x330871['query'][_0x0a12('0x21')]);}return _0x221966[_0x0a12('0x50')](_0x477d01);}})[_0x0a12('0x2a')](function(_0x4e62cd){if(_0x4e62cd){return _0x4e62cd?{'count':_0x25136c,'rows':_0x4e62cd}:null;}})[_0x0a12('0x2a')](respondWithResult(_0x272148,null))[_0x0a12('0x4a')](handleError(_0x272148,null));};exports[_0x0a12('0x54')]=function(_0x5c6290,_0xb3a62a,_0xad718c){if(_0x5c6290[_0x0a12('0x4f')]['id']){delete _0x5c6290[_0x0a12('0x4f')]['id'];}return db[_0x0a12('0x31')]['findOne']({'where':{'id':_0x5c6290[_0x0a12('0x4b')]['id']}})['then'](handleEntityNotFound(_0xb3a62a,null))['then'](function(_0x1af455){if(_0x1af455){_0x5c6290[_0x0a12('0x4f')][_0x0a12('0x55')]=_0x1af455['id'];_0x5c6290[_0x0a12('0x4f')][_0x0a12('0x56')]=integrations[_0x0a12('0x57')](_0x5c6290[_0x0a12('0x4f')][_0x0a12('0x58')],_0x5c6290[_0x0a12('0x4f')]['type']);_0x5c6290[_0x0a12('0x4f')][_0x0a12('0x59')]=integrations[_0x0a12('0x5a')](_0x5c6290[_0x0a12('0x4f')][_0x0a12('0x58')],_0x5c6290[_0x0a12('0x4f')][_0x0a12('0x34')]);return db[_0x0a12('0x52')][_0x0a12('0x4e')](_0x5c6290['body'],{'include':[{'model':db[_0x0a12('0x5b')],'as':_0x0a12('0x56')},{'model':db[_0x0a12('0x5b')],'as':_0x0a12('0x59')}]});}return null;})[_0x0a12('0x2a')](respondWithResult(_0xb3a62a,null))[_0x0a12('0x4a')](handleError(_0xb3a62a,null));};exports[_0x0a12('0x5c')]=function(_0x41f659,_0x2b5510,_0x1a1d90){var _0x12c3a0='';var _0xe0d4cc=['id',_0x0a12('0x2e'),_0x0a12('0x5d'),'created_by','description',_0x0a12('0x5e'),_0x0a12('0x5f'),_0x0a12('0x60'),'parent_id','parent_type','parent_name',_0x0a12('0x61')];return db[_0x0a12('0x31')][_0x0a12('0x51')]({'where':{'id':_0x41f659[_0x0a12('0x4b')]['id']},'attributes':['id',_0x0a12('0x62'),'password',_0x0a12('0x63')]})[_0x0a12('0x2a')](handleEntityNotFound(_0x2b5510,null))['then'](function(_0x42e8e8){if(_0x42e8e8){_0x12c3a0=_0x42e8e8[_0x0a12('0x63')];var _0x58f91c=_0x12c3a0[_0x0a12('0x64')](-0x1);if(_0x58f91c==='/'){_0x12c3a0=_0x12c3a0[_0x0a12('0x65')](0x0,_0x12c3a0[_0x0a12('0x66')](_0x58f91c));}return rp({'method':_0x0a12('0x67'),'uri':util['format'](_0x0a12('0x68'),_0x12c3a0,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x0a12('0x69'),'response_type':_0x0a12('0x69'),'rest_data':JSON[_0x0a12('0x6a')]({'user_auth':{'user_name':_0x42e8e8[_0x0a12('0x62')],'password':_0x42e8e8[_0x0a12('0x6b')],'encryption':_0x0a12('0x6c')},'application':_0x0a12('0x6d')})}});}})[_0x0a12('0x2a')](function(_0x5fb1eb){if(_0x5fb1eb&&_0x5fb1eb[_0x0a12('0x2e')]!==_0x0a12('0x6e')&&_0x5fb1eb[_0x0a12('0x2e')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x0a12('0x6f')](_0x0a12('0x68'),_0x12c3a0,_0x0a12('0x70')),'json':!![],'form':{'method':_0x0a12('0x71'),'input_type':_0x0a12('0x69'),'response_type':_0x0a12('0x69'),'rest_data':JSON[_0x0a12('0x6a')]({'session':_0x5fb1eb['id'],'module_name':_0x0a12('0x72')})}})[_0x0a12('0x2a')](function(_0x1f8bf2){if(_0x1f8bf2){var _0x192468=_['values'](_0x1f8bf2[_0x0a12('0x73')]);_[_0x0a12('0x74')](_0x192468,function(_0x3dfd23){return _0xe0d4cc[_0x0a12('0x75')](_0x3dfd23[_0x0a12('0x2e')]);});return{'count':_0x192468[_0x0a12('0x3d')],'rows':_[_0x0a12('0x30')](_0x192468,function(_0x5a6fa3){return{'id':_0x5a6fa3['name'],'name':_0x5a6fa3['label'],'custom':_[_0x0a12('0x76')](_0x5a6fa3[_0x0a12('0x2e')],'_c')?!![]:![],'options':_0x5a6fa3['options']?_[_0x0a12('0x30')](_[_0x0a12('0x77')](_0x5a6fa3[_0x0a12('0x4c')]),function(_0x5f5dd7){return{'name':_0x5f5dd7[_0x0a12('0x78')],'value':_0x5f5dd7['name']};}):[]};})};}})[_0x0a12('0x2a')](respondWithResult(_0x2b5510,null))[_0x0a12('0x4a')](function(_0x1aaad8){var _0x4a5517=_0x41f659[_0x0a12('0x37')]['test']?0x1f4:_0x1aaad8[_0x0a12('0x79')]||0x1f4;logger[_0x0a12('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0x0a12('0x5c'),_0x4a5517,JSON['stringify'](_0x1aaad8));delete _0x1aaad8[_0x0a12('0x2e')];if(_0x4a5517===0x191){_0x4a5517=0x190;}_0x2b5510[_0x0a12('0x1e')](_0x4a5517)['send'](_0x41f659[_0x0a12('0x37')][_0x0a12('0x7a')]?{'message':_0x0a12('0x7b'),'statusCode':_0x1aaad8['statusCode']}:_0x1aaad8);});}else{var _0x6394cf=0x1f4;_0x2b5510[_0x0a12('0x1e')](_0x6394cf)[_0x0a12('0x7c')]({'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 5d2016c..fdf0c56 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 _0x8135=['util','../../config/logger','api','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash'];(function(_0x40d548,_0x233d52){var _0x1791f8=function(_0x526c95){while(--_0x526c95){_0x40d548['push'](_0x40d548['shift']());}};_0x1791f8(++_0x233d52);}(_0x8135,0x17b));var _0x5813=function(_0x32fdbe,_0x28e150){_0x32fdbe=_0x32fdbe-0x0;var _0x42d5ea=_0x8135[_0x32fdbe];return _0x42d5ea;};'use strict';var _=require(_0x5813('0x0'));var util=require(_0x5813('0x1'));var logger=require(_0x5813('0x2'))(_0x5813('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5813('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5813('0x5'));var attributes=require(_0x5813('0x6'));var integrations=require(_0x5813('0x7'));module[_0x5813('0x8')]=function(_0x5611dc,_0x17e6cb){return _0x5611dc['define']('SugarcrmAccount',attributes,{'tableName':_0x5813('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdeb2=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define'];(function(_0x531ca7,_0x1c906e){var _0x3431be=function(_0x52ca5c){while(--_0x52ca5c){_0x531ca7['push'](_0x531ca7['shift']());}};_0x3431be(++_0x1c906e);}(_0xdeb2,0x64));var _0x2deb=function(_0x5526c1,_0xdabb16){_0x5526c1=_0x5526c1-0x0;var _0xfa786a=_0xdeb2[_0x5526c1];return _0xfa786a;};'use strict';var _=require(_0x2deb('0x0'));var util=require(_0x2deb('0x1'));var logger=require(_0x2deb('0x2'))(_0x2deb('0x3'));var moment=require(_0x2deb('0x4'));var BPromise=require('bluebird');var rp=require(_0x2deb('0x5'));var fs=require('fs');var path=require(_0x2deb('0x6'));var rimraf=require(_0x2deb('0x7'));var config=require(_0x2deb('0x8'));var attributes=require(_0x2deb('0x9'));var integrations=require(_0x2deb('0xa'));module['exports']=function(_0x472c20,_0xa082c1){return _0x472c20[_0x2deb('0xb')](_0x2deb('0xc'),attributes,{'tableName':_0x2deb('0xd'),'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 5c43ebe..4c47713 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 _0xa9c8=['GetSugarcrmAccount','SugarcrmAccount','options','raw','where','limit','include','map','attributes','model','stringify','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4ec772,_0x524b7e){var _0x405499=function(_0x4df4c7){while(--_0x4df4c7){_0x4ec772['push'](_0x4ec772['shift']());}};_0x405499(++_0x524b7e);}(_0xa9c8,0x177));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a9c('0x0'));var util=require(_0x8a9c('0x1'));var moment=require('moment');var BPromise=require(_0x8a9c('0x2'));var rs=require(_0x8a9c('0x3'));var fs=require('fs');var Redis=require(_0x8a9c('0x4'));var db=require(_0x8a9c('0x5'))['db'];var utils=require(_0x8a9c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a9c('0x7')][_0x8a9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ff330,_0x5ce4fd,_0x4237a8){return new BPromise(function(_0x4b63ef,_0xe105fc){return client[_0x8a9c('0x9')](_0x2ff330,_0x4237a8)[_0x8a9c('0xa')](function(_0x1e0eb9){logger[_0x8a9c('0xb')](_0x8a9c('0xc'),_0x5ce4fd,_0x8a9c('0xd'));logger[_0x8a9c('0xe')](_0x8a9c('0xf'),_0x5ce4fd,_0x8a9c('0xd'),JSON['stringify'](_0x1e0eb9));if(_0x1e0eb9['error']){if(_0x1e0eb9[_0x8a9c('0x10')][_0x8a9c('0x11')]===0x1f4){logger[_0x8a9c('0x10')](_0x8a9c('0xc'),_0x5ce4fd,_0x1e0eb9[_0x8a9c('0x10')][_0x8a9c('0x12')]);return _0xe105fc(_0x1e0eb9[_0x8a9c('0x10')][_0x8a9c('0x12')]);}logger['error'](_0x8a9c('0xc'),_0x5ce4fd,_0x1e0eb9['error'][_0x8a9c('0x12')]);return _0x4b63ef(_0x1e0eb9['error']['message']);}else{logger[_0x8a9c('0xb')](_0x8a9c('0xc'),_0x5ce4fd,'request\x20sent');_0x4b63ef(_0x1e0eb9[_0x8a9c('0x13')][_0x8a9c('0x12')]);}})[_0x8a9c('0x14')](function(_0x3f4f57){logger[_0x8a9c('0x10')](_0x8a9c('0xc'),_0x5ce4fd,_0x3f4f57);_0xe105fc(_0x3f4f57);});});}exports[_0x8a9c('0x15')]=function(_0x1e4865){var _0x44b8f7=this;return new Promise(function(_0x4af0fe,_0x250459){return db[_0x8a9c('0x16')]['findAll']({'raw':_0x1e4865[_0x8a9c('0x17')]?_0x1e4865['options'][_0x8a9c('0x18')]===undefined?!![]:![]:!![],'where':_0x1e4865[_0x8a9c('0x17')]?_0x1e4865[_0x8a9c('0x17')][_0x8a9c('0x19')]||null:null,'attributes':_0x1e4865[_0x8a9c('0x17')]?_0x1e4865[_0x8a9c('0x17')]['attributes']||null:null,'limit':_0x1e4865[_0x8a9c('0x17')]?_0x1e4865[_0x8a9c('0x17')][_0x8a9c('0x1a')]||null:null,'include':_0x1e4865[_0x8a9c('0x17')]?_0x1e4865[_0x8a9c('0x17')][_0x8a9c('0x1b')]?_[_0x8a9c('0x1c')](_0x1e4865[_0x8a9c('0x17')]['include'],function(_0x98651d){return{'model':db[_0x98651d['model']],'as':_0x98651d['as'],'attributes':_0x98651d['attributes'],'include':_0x98651d[_0x8a9c('0x1b')]?_[_0x8a9c('0x1c')](_0x98651d[_0x8a9c('0x1b')],function(_0x315c8a){return{'model':db[_0x315c8a['model']],'as':_0x315c8a['as'],'attributes':_0x315c8a[_0x8a9c('0x1d')],'include':_0x315c8a[_0x8a9c('0x1b')]?_[_0x8a9c('0x1c')](_0x315c8a[_0x8a9c('0x1b')],function(_0xbf1b42){return{'model':db[_0xbf1b42[_0x8a9c('0x1e')]],'as':_0xbf1b42['as'],'attributes':_0xbf1b42['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a9c('0xa')](function(_0x269e7b){logger[_0x8a9c('0xb')]('GetSugarcrmAccount',_0x1e4865);logger[_0x8a9c('0xe')](_0x8a9c('0x15'),_0x1e4865,JSON[_0x8a9c('0x1f')](_0x269e7b));_0x4af0fe(_0x269e7b);})[_0x8a9c('0x14')](function(_0x1f632a){logger[_0x8a9c('0x10')]('GetSugarcrmAccount',_0x1f632a['message'],_0x1e4865);_0x250459(_0x44b8f7['error'](0x1f4,_0x1f632a[_0x8a9c('0x12')]));});});};exports[_0x8a9c('0x20')]=function(_0x511a6b){var _0x3bc3b7=this;return new Promise(function(_0xfc3b51,_0x42e67f){return db[_0x8a9c('0x16')]['find']({'raw':_0x511a6b[_0x8a9c('0x17')]?_0x511a6b[_0x8a9c('0x17')][_0x8a9c('0x18')]===undefined?!![]:![]:!![],'where':_0x511a6b[_0x8a9c('0x17')]?_0x511a6b[_0x8a9c('0x17')][_0x8a9c('0x19')]||null:null,'attributes':_0x511a6b[_0x8a9c('0x17')]?_0x511a6b[_0x8a9c('0x17')][_0x8a9c('0x1d')]||null:null,'include':_0x511a6b['options']?_0x511a6b[_0x8a9c('0x17')][_0x8a9c('0x1b')]?_[_0x8a9c('0x1c')](_0x511a6b['options'][_0x8a9c('0x1b')],function(_0x39557f){return{'model':db[_0x39557f[_0x8a9c('0x1e')]],'as':_0x39557f['as'],'attributes':_0x39557f['attributes'],'include':_0x39557f[_0x8a9c('0x1b')]?_[_0x8a9c('0x1c')](_0x39557f[_0x8a9c('0x1b')],function(_0x37fb28){return{'model':db[_0x37fb28[_0x8a9c('0x1e')]],'as':_0x37fb28['as'],'attributes':_0x37fb28[_0x8a9c('0x1d')],'include':_0x37fb28['include']?_[_0x8a9c('0x1c')](_0x37fb28[_0x8a9c('0x1b')],function(_0x41ac51){return{'model':db[_0x41ac51[_0x8a9c('0x1e')]],'as':_0x41ac51['as'],'attributes':_0x41ac51[_0x8a9c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8a9c('0xa')](function(_0x2e27ed){logger[_0x8a9c('0xb')](_0x8a9c('0x20'),_0x511a6b);logger[_0x8a9c('0xe')](_0x8a9c('0x20'),_0x511a6b,JSON['stringify'](_0x2e27ed));_0xfc3b51(_0x2e27ed);})['catch'](function(_0x47e144){logger['error'](_0x8a9c('0x20'),_0x47e144['message'],_0x511a6b);_0x42e67f(_0x3bc3b7[_0x8a9c('0x10')](0x1f4,_0x47e144[_0x8a9c('0x12')]));});});}; \ No newline at end of file +var _0xb1dc=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','find','lodash','util','moment','bluebird'];(function(_0x5462dc,_0x329c27){var _0x362156=function(_0x5cd880){while(--_0x5cd880){_0x5462dc['push'](_0x5462dc['shift']());}};_0x362156(++_0x329c27);}(_0xb1dc,0x1b6));var _0xcb1d=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0xb1dc[_0x14fad0];return _0x5c665f;};'use strict';var _=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var moment=require(_0xcb1d('0x2'));var BPromise=require(_0xcb1d('0x3'));var rs=require(_0xcb1d('0x4'));var fs=require('fs');var Redis=require(_0xcb1d('0x5'));var db=require(_0xcb1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb1d('0x7'))('rpc');var config=require(_0xcb1d('0x8'));var jayson=require(_0xcb1d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6fa8,_0x44a4ec,_0x448b11){return new BPromise(function(_0x5aa3a8,_0x4cb73c){return client[_0xcb1d('0xa')](_0x1a6fa8,_0x448b11)['then'](function(_0x144c1a){logger[_0xcb1d('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x44a4ec,_0xcb1d('0xc'));logger[_0xcb1d('0xd')](_0xcb1d('0xe'),_0x44a4ec,_0xcb1d('0xc'),JSON['stringify'](_0x144c1a));if(_0x144c1a['error']){if(_0x144c1a[_0xcb1d('0xf')][_0xcb1d('0x10')]===0x1f4){logger[_0xcb1d('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x44a4ec,_0x144c1a[_0xcb1d('0xf')][_0xcb1d('0x11')]);return _0x4cb73c(_0x144c1a[_0xcb1d('0xf')][_0xcb1d('0x11')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x44a4ec,_0x144c1a[_0xcb1d('0xf')][_0xcb1d('0x11')]);return _0x5aa3a8(_0x144c1a[_0xcb1d('0xf')]['message']);}else{logger[_0xcb1d('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x44a4ec,_0xcb1d('0xc'));_0x5aa3a8(_0x144c1a['result'][_0xcb1d('0x11')]);}})[_0xcb1d('0x12')](function(_0x1b672d){logger[_0xcb1d('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x44a4ec,_0x1b672d);_0x4cb73c(_0x1b672d);});});}exports['GetSugarcrmAccount']=function(_0x390f53){var _0x578e71=this;return new Promise(function(_0x126fe3,_0x4f2288){return db[_0xcb1d('0x13')][_0xcb1d('0x14')]({'raw':_0x390f53['options']?_0x390f53[_0xcb1d('0x15')][_0xcb1d('0x16')]===undefined?!![]:![]:!![],'where':_0x390f53[_0xcb1d('0x15')]?_0x390f53['options'][_0xcb1d('0x17')]||null:null,'attributes':_0x390f53[_0xcb1d('0x15')]?_0x390f53[_0xcb1d('0x15')][_0xcb1d('0x18')]||null:null,'limit':_0x390f53['options']?_0x390f53['options'][_0xcb1d('0x19')]||null:null,'include':_0x390f53[_0xcb1d('0x15')]?_0x390f53['options'][_0xcb1d('0x1a')]?_[_0xcb1d('0x1b')](_0x390f53[_0xcb1d('0x15')][_0xcb1d('0x1a')],function(_0xbbb7b6){return{'model':db[_0xbbb7b6[_0xcb1d('0x1c')]],'as':_0xbbb7b6['as'],'attributes':_0xbbb7b6[_0xcb1d('0x18')],'include':_0xbbb7b6['include']?_[_0xcb1d('0x1b')](_0xbbb7b6[_0xcb1d('0x1a')],function(_0x33fb5b){return{'model':db[_0x33fb5b[_0xcb1d('0x1c')]],'as':_0x33fb5b['as'],'attributes':_0x33fb5b[_0xcb1d('0x18')],'include':_0x33fb5b[_0xcb1d('0x1a')]?_[_0xcb1d('0x1b')](_0x33fb5b[_0xcb1d('0x1a')],function(_0x2003d4){return{'model':db[_0x2003d4[_0xcb1d('0x1c')]],'as':_0x2003d4['as'],'attributes':_0x2003d4['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb1d('0x1d')](function(_0x5da7b5){logger[_0xcb1d('0xb')](_0xcb1d('0x1e'),_0x390f53);logger[_0xcb1d('0xd')](_0xcb1d('0x1e'),_0x390f53,JSON[_0xcb1d('0x1f')](_0x5da7b5));_0x126fe3(_0x5da7b5);})[_0xcb1d('0x12')](function(_0x19c470){logger[_0xcb1d('0xf')](_0xcb1d('0x1e'),_0x19c470[_0xcb1d('0x11')],_0x390f53);_0x4f2288(_0x578e71[_0xcb1d('0xf')](0x1f4,_0x19c470[_0xcb1d('0x11')]));});});};exports[_0xcb1d('0x20')]=function(_0xd28c0c){var _0x367dd2=this;return new Promise(function(_0x145a82,_0x4b722c){return db[_0xcb1d('0x13')][_0xcb1d('0x21')]({'raw':_0xd28c0c[_0xcb1d('0x15')]?_0xd28c0c[_0xcb1d('0x15')][_0xcb1d('0x16')]===undefined?!![]:![]:!![],'where':_0xd28c0c['options']?_0xd28c0c[_0xcb1d('0x15')][_0xcb1d('0x17')]||null:null,'attributes':_0xd28c0c[_0xcb1d('0x15')]?_0xd28c0c[_0xcb1d('0x15')]['attributes']||null:null,'include':_0xd28c0c[_0xcb1d('0x15')]?_0xd28c0c[_0xcb1d('0x15')]['include']?_[_0xcb1d('0x1b')](_0xd28c0c[_0xcb1d('0x15')][_0xcb1d('0x1a')],function(_0x5a98b1){return{'model':db[_0x5a98b1[_0xcb1d('0x1c')]],'as':_0x5a98b1['as'],'attributes':_0x5a98b1[_0xcb1d('0x18')],'include':_0x5a98b1[_0xcb1d('0x1a')]?_[_0xcb1d('0x1b')](_0x5a98b1[_0xcb1d('0x1a')],function(_0x1f7467){return{'model':db[_0x1f7467[_0xcb1d('0x1c')]],'as':_0x1f7467['as'],'attributes':_0x1f7467[_0xcb1d('0x18')],'include':_0x1f7467[_0xcb1d('0x1a')]?_[_0xcb1d('0x1b')](_0x1f7467[_0xcb1d('0x1a')],function(_0x4b1033){return{'model':db[_0x4b1033[_0xcb1d('0x1c')]],'as':_0x4b1033['as'],'attributes':_0x4b1033[_0xcb1d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcb1d('0x1d')](function(_0x3856bf){logger[_0xcb1d('0xb')]('ShowSugarcrmAccount',_0xd28c0c);logger[_0xcb1d('0xd')](_0xcb1d('0x20'),_0xd28c0c,JSON['stringify'](_0x3856bf));_0x145a82(_0x3856bf);})[_0xcb1d('0x12')](function(_0x410db6){logger[_0xcb1d('0xf')](_0xcb1d('0x20'),_0x410db6[_0xcb1d('0x11')],_0xd28c0c);_0x4b722c(_0x367dd2[_0xcb1d('0xf')](0x1f4,_0x410db6[_0xcb1d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 0fa1791..7a01143 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 _0x8e93=['multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x63ac8a,_0x3c7e90){var _0x113be8=function(_0xe2e5cb){while(--_0xe2e5cb){_0x63ac8a['push'](_0x63ac8a['shift']());}};_0x113be8(++_0x3c7e90);}(_0x8e93,0xd8));var _0x38e9=function(_0x1dcf32,_0x55cb41){_0x1dcf32=_0x1dcf32-0x0;var _0x35fc6d=_0x8e93[_0x1dcf32];return _0x35fc6d;};'use strict';var multer=require(_0x38e9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38e9('0x1'));var router=express[_0x38e9('0x2')]();var fs_extra=require(_0x38e9('0x3'));var auth=require(_0x38e9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x38e9('0x5'));var controller=require(_0x38e9('0x6'));router[_0x38e9('0x7')]('/',auth[_0x38e9('0x8')](),controller[_0x38e9('0x9')]);router[_0x38e9('0x7')](_0x38e9('0xa'),auth[_0x38e9('0x8')](),controller[_0x38e9('0xb')]);router[_0x38e9('0x7')](_0x38e9('0xc'),auth['isAuthenticated'](),controller[_0x38e9('0xd')]);router[_0x38e9('0x7')](_0x38e9('0xe'),auth[_0x38e9('0x8')](),controller[_0x38e9('0xf')]);router[_0x38e9('0x7')](_0x38e9('0x10'),auth[_0x38e9('0x8')](),controller[_0x38e9('0x11')]);router[_0x38e9('0x12')]('/',auth['isAuthenticated'](),controller[_0x38e9('0x13')]);router[_0x38e9('0x14')](_0x38e9('0xa'),auth[_0x38e9('0x8')](),controller[_0x38e9('0x15')]);router[_0x38e9('0x16')](_0x38e9('0xa'),auth['isAuthenticated'](),controller[_0x38e9('0x17')]);module['exports']=router; \ No newline at end of file +var _0xc278=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','getFields','getSubjects','getDescriptions'];(function(_0x3b6e20,_0x3c95b6){var _0x4a5516=function(_0xcf02a0){while(--_0xcf02a0){_0x3b6e20['push'](_0x3b6e20['shift']());}};_0x4a5516(++_0x3c95b6);}(_0xc278,0xec));var _0x8c27=function(_0x5bbf05,_0x4b499c){_0x5bbf05=_0x5bbf05-0x0;var _0x134d49=_0xc278[_0x5bbf05];return _0x134d49;};'use strict';var multer=require(_0x8c27('0x0'));var util=require(_0x8c27('0x1'));var path=require(_0x8c27('0x2'));var timeout=require(_0x8c27('0x3'));var express=require(_0x8c27('0x4'));var router=express['Router']();var fs_extra=require(_0x8c27('0x5'));var auth=require(_0x8c27('0x6'));var interaction=require(_0x8c27('0x7'));var config=require(_0x8c27('0x8'));var controller=require(_0x8c27('0x9'));router[_0x8c27('0xa')]('/',auth[_0x8c27('0xb')](),controller[_0x8c27('0xc')]);router['get'](_0x8c27('0xd'),auth[_0x8c27('0xb')](),controller['show']);router['get']('/:id/fields',auth[_0x8c27('0xb')](),controller[_0x8c27('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x8c27('0xf')]);router[_0x8c27('0xa')]('/:id/descriptions',auth[_0x8c27('0xb')](),controller[_0x8c27('0x10')]);router[_0x8c27('0x11')]('/',auth['isAuthenticated'](),controller[_0x8c27('0x12')]);router[_0x8c27('0x13')](_0x8c27('0xd'),auth[_0x8c27('0xb')](),controller[_0x8c27('0x14')]);router[_0x8c27('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8c27('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 3042165..ccf9f06 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 _0x2f8c=['STRING','sequelize','exports'];(function(_0x248c78,_0x282c82){var _0x50b4d3=function(_0xff1eb8){while(--_0xff1eb8){_0x248c78['push'](_0x248c78['shift']());}};_0x50b4d3(++_0x282c82);}(_0x2f8c,0xac));var _0xc2f8=function(_0x403c07,_0x2944f6){_0x403c07=_0x403c07-0x0;var _0xf6a750=_0x2f8c[_0x403c07];return _0xf6a750;};'use strict';var Sequelize=require(_0xc2f8('0x0'));module[_0xc2f8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc2f8('0x2')]}}; \ No newline at end of file +var _0x49b1=['STRING','sequelize','exports'];(function(_0x386f14,_0x50a863){var _0x4dc876=function(_0x519510){while(--_0x519510){_0x386f14['push'](_0x386f14['shift']());}};_0x4dc876(++_0x50a863);}(_0x49b1,0x133));var _0x149b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x49b1[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x149b('0x0'));module[_0x149b('0x1')]={'name':{'type':Sequelize[_0x149b('0x2')]},'description':{'type':Sequelize[_0x149b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 8fadbff..2b8345f 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 _0xb602=['options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','findOne','order','getSubjects','SugarcrmField','pick','filter','hasOwnProperty','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','SugarcrmConfiguration','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','map','type','VIRTUAL'];(function(_0x5ec2b8,_0x14c845){var _0x54e412=function(_0x379716){while(--_0x379716){_0x5ec2b8['push'](_0x5ec2b8['shift']());}};_0x54e412(++_0x14c845);}(_0xb602,0x116));var _0x2b60=function(_0x337571,_0x195458){_0x337571=_0x337571-0x0;var _0x57d5fd=_0xb602[_0x337571];return _0x57d5fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b60('0x1'));var rp=require(_0x2b60('0x2'));var moment=require('moment');var BPromise=require(_0x2b60('0x3'));var Mustache=require(_0x2b60('0x4'));var util=require(_0x2b60('0x5'));var path=require(_0x2b60('0x6'));var sox=require(_0x2b60('0x7'));var csv=require(_0x2b60('0x8'));var ejs=require(_0x2b60('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b60('0xa'));var squel=require(_0x2b60('0xb'));var crypto=require(_0x2b60('0xc'));var jsforce=require(_0x2b60('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2b60('0x8'));var querystring=require(_0x2b60('0xe'));var Papa=require(_0x2b60('0xf'));var Redis=require(_0x2b60('0x10'));var authService=require(_0x2b60('0x11'));var qs=require(_0x2b60('0x12'));var as=require(_0x2b60('0x13'));var hardwareService=require(_0x2b60('0x14'));var logger=require('../../config/logger')(_0x2b60('0x15'));var utils=require(_0x2b60('0x16'));var config=require(_0x2b60('0x17'));var licenseUtil=require(_0x2b60('0x18'));var db=require(_0x2b60('0x19'))['db'];function respondWithStatusCode(_0x3ead34,_0x2c00fe){_0x2c00fe=_0x2c00fe||0xcc;return function(_0x57174f){if(_0x57174f){return _0x3ead34[_0x2b60('0x1a')](_0x2c00fe);}return _0x3ead34['status'](_0x2c00fe)[_0x2b60('0x1b')]();};}function respondWithResult(_0x126dee,_0x10665f){_0x10665f=_0x10665f||0xc8;return function(_0xa91ef3){if(_0xa91ef3){return _0x126dee[_0x2b60('0x1c')](_0x10665f)[_0x2b60('0x1d')](_0xa91ef3);}};}function respondWithFilteredResult(_0x12c3e7,_0x2801fc){return function(_0x38fca5){if(_0x38fca5){var _0x45574e=typeof _0x2801fc[_0x2b60('0x1e')]===_0x2b60('0x1f')&&typeof _0x2801fc['limit']===_0x2b60('0x1f');var _0x493070=_0x38fca5[_0x2b60('0x20')];var _0x1985bd=_0x45574e?0x0:_0x2801fc[_0x2b60('0x1e')];var _0x55145f=_0x45574e?_0x38fca5[_0x2b60('0x20')]:_0x2801fc[_0x2b60('0x1e')]+_0x2801fc[_0x2b60('0x21')];var _0x214e52;if(_0x55145f>=_0x493070){_0x55145f=_0x493070;_0x214e52=0xc8;}else{_0x214e52=0xce;}_0x12c3e7[_0x2b60('0x1c')](_0x214e52);return _0x12c3e7[_0x2b60('0x22')](_0x2b60('0x23'),_0x1985bd+'-'+_0x55145f+'/'+_0x493070)[_0x2b60('0x1d')](_0x38fca5);}return null;};}function patchUpdates(_0x3666d8){return function(_0x55d551){try{jsonpatch[_0x2b60('0x24')](_0x55d551,_0x3666d8,!![]);}catch(_0x174db1){return BPromise[_0x2b60('0x25')](_0x174db1);}return _0x55d551[_0x2b60('0x26')]();};}function saveUpdates(_0x5cc61d,_0x1be85d){return function(_0x566438){if(_0x566438){return _0x566438[_0x2b60('0x27')](_0x5cc61d)[_0x2b60('0x28')](function(_0x713ef2){return _0x713ef2;});}return null;};}function removeEntity(_0x2f3d03,_0x285126){return function(_0x1b432e){if(_0x1b432e){return _0x1b432e[_0x2b60('0x29')]()[_0x2b60('0x28')](function(){_0x2f3d03[_0x2b60('0x1c')](0xcc)[_0x2b60('0x1b')]();});}};}function handleEntityNotFound(_0x2ec903,_0x45d6c8){return function(_0x8bd48d){if(!_0x8bd48d){_0x2ec903[_0x2b60('0x1a')](0x194);}return _0x8bd48d;};}function handleError(_0x7d4728,_0x4f5285){_0x4f5285=_0x4f5285||0x1f4;return function(_0x4224b0){logger[_0x2b60('0x2a')](_0x4224b0[_0x2b60('0x2b')]);if(_0x4224b0['name']){delete _0x4224b0['name'];}_0x7d4728[_0x2b60('0x1c')](_0x4f5285)[_0x2b60('0x2c')](_0x4224b0);};}exports[_0x2b60('0x2d')]=function(_0x28d8e6,_0x4e42e6){var _0x1affcf={},_0xccd8d8={},_0x204935={'count':0x0,'rows':[]};var _0x1de284=_['map'](db[_0x2b60('0x2e')][_0x2b60('0x2f')],function(_0x5b5539){return{'name':_0x5b5539[_0x2b60('0x30')],'type':_0x5b5539['type'][_0x2b60('0x31')]};});_0xccd8d8[_0x2b60('0x32')]=_['map'](_0x1de284,_0x2b60('0x33'));_0xccd8d8[_0x2b60('0x34')]=_[_0x2b60('0x35')](_0x28d8e6['query']);_0xccd8d8[_0x2b60('0x36')]=_[_0x2b60('0x37')](_0xccd8d8[_0x2b60('0x32')],_0xccd8d8[_0x2b60('0x34')]);_0x1affcf['attributes']=_['intersection'](_0xccd8d8['model'],qs[_0x2b60('0x38')](_0x28d8e6[_0x2b60('0x34')][_0x2b60('0x38')]));_0x1affcf[_0x2b60('0x39')]=_0x1affcf[_0x2b60('0x39')][_0x2b60('0x3a')]?_0x1affcf[_0x2b60('0x39')]:_0xccd8d8[_0x2b60('0x32')];if(!_0x28d8e6[_0x2b60('0x34')]['hasOwnProperty'](_0x2b60('0x3b'))){_0x1affcf[_0x2b60('0x21')]=qs['limit'](_0x28d8e6[_0x2b60('0x34')][_0x2b60('0x21')]);_0x1affcf[_0x2b60('0x1e')]=qs['offset'](_0x28d8e6[_0x2b60('0x34')]['offset']);}_0x1affcf['order']=qs[_0x2b60('0x3c')](_0x28d8e6[_0x2b60('0x34')][_0x2b60('0x3c')]);_0x1affcf[_0x2b60('0x3d')]=qs[_0x2b60('0x36')](_['pick'](_0x28d8e6['query'],_0xccd8d8[_0x2b60('0x36')]),_0x1de284);if(_0x28d8e6[_0x2b60('0x34')]['filter']){_0x1affcf[_0x2b60('0x3d')]=_[_0x2b60('0x3e')](_0x1affcf['where'],{'$or':_[_0x2b60('0x3f')](_0x1de284,function(_0x4dde8d){if(_0x4dde8d[_0x2b60('0x40')]!==_0x2b60('0x41')){var _0x251f77={};_0x251f77[_0x4dde8d[_0x2b60('0x33')]]={'$like':'%'+_0x28d8e6[_0x2b60('0x34')]['filter']+'%'};return _0x251f77;}})});}_0x1affcf=_[_0x2b60('0x3e')]({},_0x1affcf,_0x28d8e6[_0x2b60('0x42')]);var _0xa1ba94={'where':_0x1affcf[_0x2b60('0x3d')]};return db[_0x2b60('0x2e')]['count'](_0xa1ba94)['then'](function(_0x1ed19e){_0x204935[_0x2b60('0x20')]=_0x1ed19e;if(_0x28d8e6['query'][_0x2b60('0x43')]){_0x1affcf[_0x2b60('0x44')]=[{'all':!![]}];}return db[_0x2b60('0x2e')][_0x2b60('0x45')](_0x1affcf);})[_0x2b60('0x28')](function(_0x292a31){_0x204935[_0x2b60('0x46')]=_0x292a31;return _0x204935;})[_0x2b60('0x28')](respondWithFilteredResult(_0x4e42e6,_0x1affcf))['catch'](handleError(_0x4e42e6,null));};exports[_0x2b60('0x47')]=function(_0xafb4b4,_0xeccd04){var _0x3fed14={'raw':![],'where':{'id':_0xafb4b4[_0x2b60('0x48')]['id']}},_0x3ab5a3={};_0x3ab5a3[_0x2b60('0x32')]=_[_0x2b60('0x35')](db['SugarcrmConfiguration'][_0x2b60('0x2f')]);_0x3ab5a3[_0x2b60('0x34')]=_['keys'](_0xafb4b4[_0x2b60('0x34')]);_0x3ab5a3[_0x2b60('0x36')]=_[_0x2b60('0x37')](_0x3ab5a3['model'],_0x3ab5a3[_0x2b60('0x34')]);_0x3fed14['attributes']=_['intersection'](_0x3ab5a3[_0x2b60('0x32')],qs[_0x2b60('0x38')](_0xafb4b4['query'][_0x2b60('0x38')]));_0x3fed14['attributes']=_0x3fed14['attributes'][_0x2b60('0x3a')]?_0x3fed14['attributes']:_0x3ab5a3[_0x2b60('0x32')];if(_0xafb4b4['query'][_0x2b60('0x43')]){_0x3fed14[_0x2b60('0x44')]=[{'all':!![]}];}_0x3fed14=_[_0x2b60('0x3e')]({},_0x3fed14,_0xafb4b4[_0x2b60('0x42')]);return db[_0x2b60('0x2e')][_0x2b60('0x49')](_0x3fed14)['then'](handleEntityNotFound(_0xeccd04,null))[_0x2b60('0x28')](respondWithResult(_0xeccd04,null))[_0x2b60('0x4a')](handleError(_0xeccd04,null));};exports[_0x2b60('0x4b')]=function(_0x419d84,_0x42e5cd){return db['SugarcrmConfiguration']['create'](_0x419d84[_0x2b60('0x4c')],{})[_0x2b60('0x28')](respondWithResult(_0x42e5cd,0xc9))['catch'](handleError(_0x42e5cd,null));};exports[_0x2b60('0x27')]=function(_0x1d80ba,_0x1f3c06){if(_0x1d80ba[_0x2b60('0x4c')]['id']){delete _0x1d80ba[_0x2b60('0x4c')]['id'];}return db['SugarcrmConfiguration'][_0x2b60('0x49')]({'where':{'id':_0x1d80ba[_0x2b60('0x48')]['id']}})[_0x2b60('0x28')](handleEntityNotFound(_0x1f3c06,null))[_0x2b60('0x28')](saveUpdates(_0x1d80ba[_0x2b60('0x4c')],null))[_0x2b60('0x28')](respondWithResult(_0x1f3c06,null))['catch'](handleError(_0x1f3c06,null));};exports[_0x2b60('0x29')]=function(_0x13f915,_0x352c3d){return db[_0x2b60('0x2e')][_0x2b60('0x49')]({'where':{'id':_0x13f915['params']['id']}})[_0x2b60('0x28')](handleEntityNotFound(_0x352c3d,null))[_0x2b60('0x28')](removeEntity(_0x352c3d,null))[_0x2b60('0x4a')](handleError(_0x352c3d,null));};exports[_0x2b60('0x4d')]=function(_0x3be8a1,_0xe34c13,_0x3c412c){var _0x5a7095={};var _0x556ce3={};var _0x148bd1;var _0x5a36d7;return db[_0x2b60('0x2e')][_0x2b60('0x4e')]({'where':{'id':_0x3be8a1[_0x2b60('0x48')]['id']}})[_0x2b60('0x28')](handleEntityNotFound(_0xe34c13,null))['then'](function(_0x29c124){if(_0x29c124){_0x148bd1=_0x29c124;_0x556ce3['model']=_['keys'](db['SugarcrmField'][_0x2b60('0x2f')]);_0x556ce3[_0x2b60('0x34')]=_[_0x2b60('0x35')](_0x3be8a1['query']);_0x556ce3[_0x2b60('0x36')]=_[_0x2b60('0x37')](_0x556ce3['model'],_0x556ce3[_0x2b60('0x34')]);_0x5a7095[_0x2b60('0x39')]=_[_0x2b60('0x37')](_0x556ce3[_0x2b60('0x32')],qs[_0x2b60('0x38')](_0x3be8a1[_0x2b60('0x34')]['fields']));_0x5a7095[_0x2b60('0x39')]=_0x5a7095[_0x2b60('0x39')][_0x2b60('0x3a')]?_0x5a7095[_0x2b60('0x39')]:_0x556ce3[_0x2b60('0x32')];_0x5a7095[_0x2b60('0x4f')]=qs['sort'](_0x3be8a1['query'][_0x2b60('0x3c')]);_0x5a7095[_0x2b60('0x3d')]=qs[_0x2b60('0x36')](_['pick'](_0x3be8a1[_0x2b60('0x34')],_0x556ce3[_0x2b60('0x36')]));if(_0x3be8a1[_0x2b60('0x34')]['filter']){_0x5a7095[_0x2b60('0x3d')]=_[_0x2b60('0x3e')](_0x5a7095[_0x2b60('0x3d')],{'$or':_[_0x2b60('0x3f')](_0x5a7095[_0x2b60('0x39')],function(_0x3ca9fb){var _0x4223ce={};_0x4223ce[_0x3ca9fb]={'$like':'%'+_0x3be8a1[_0x2b60('0x34')]['filter']+'%'};return _0x4223ce;})});}_0x5a7095=_[_0x2b60('0x3e')]({},_0x5a7095,_0x3be8a1[_0x2b60('0x42')]);return _0x148bd1[_0x2b60('0x4d')](_0x5a7095);}})[_0x2b60('0x28')](function(_0x51688d){if(_0x51688d){_0x5a36d7=_0x51688d[_0x2b60('0x3a')];if(!_0x3be8a1['query']['hasOwnProperty']('nolimit')){_0x5a7095[_0x2b60('0x21')]=qs['limit'](_0x3be8a1['query'][_0x2b60('0x21')]);_0x5a7095[_0x2b60('0x1e')]=qs['offset'](_0x3be8a1['query'][_0x2b60('0x1e')]);}return _0x148bd1['getFields'](_0x5a7095);}})['then'](function(_0x4fe407){if(_0x4fe407){return _0x4fe407?{'count':_0x5a36d7,'rows':_0x4fe407}:null;}})[_0x2b60('0x28')](respondWithResult(_0xe34c13,null))[_0x2b60('0x4a')](handleError(_0xe34c13,null));};exports[_0x2b60('0x50')]=function(_0x277643,_0x143f9c,_0x491da1){var _0x4db645={};var _0x7c01b4={};var _0x11aac2;var _0x56973a;return db[_0x2b60('0x2e')]['findOne']({'where':{'id':_0x277643['params']['id']}})['then'](handleEntityNotFound(_0x143f9c,null))['then'](function(_0xfc5831){if(_0xfc5831){_0x11aac2=_0xfc5831;_0x7c01b4[_0x2b60('0x32')]=_['keys'](db[_0x2b60('0x51')][_0x2b60('0x2f')]);_0x7c01b4[_0x2b60('0x34')]=_[_0x2b60('0x35')](_0x277643[_0x2b60('0x34')]);_0x7c01b4[_0x2b60('0x36')]=_[_0x2b60('0x37')](_0x7c01b4[_0x2b60('0x32')],_0x7c01b4[_0x2b60('0x34')]);_0x4db645[_0x2b60('0x39')]=_['intersection'](_0x7c01b4['model'],qs[_0x2b60('0x38')](_0x277643['query'][_0x2b60('0x38')]));_0x4db645[_0x2b60('0x39')]=_0x4db645[_0x2b60('0x39')][_0x2b60('0x3a')]?_0x4db645[_0x2b60('0x39')]:_0x7c01b4['model'];_0x4db645[_0x2b60('0x4f')]=qs['sort'](_0x277643[_0x2b60('0x34')][_0x2b60('0x3c')]);_0x4db645[_0x2b60('0x3d')]=qs[_0x2b60('0x36')](_[_0x2b60('0x52')](_0x277643[_0x2b60('0x34')],_0x7c01b4[_0x2b60('0x36')]));if(_0x277643[_0x2b60('0x34')][_0x2b60('0x53')]){_0x4db645['where']=_['merge'](_0x4db645['where'],{'$or':_['map'](_0x4db645[_0x2b60('0x39')],function(_0x10fea1){var _0x5df360={};_0x5df360[_0x10fea1]={'$like':'%'+_0x277643['query'][_0x2b60('0x53')]+'%'};return _0x5df360;})});}_0x4db645=_[_0x2b60('0x3e')]({},_0x4db645,_0x277643[_0x2b60('0x42')]);return _0x11aac2[_0x2b60('0x50')](_0x4db645);}})[_0x2b60('0x28')](function(_0x4f90d7){if(_0x4f90d7){_0x56973a=_0x4f90d7['length'];if(!_0x277643[_0x2b60('0x34')][_0x2b60('0x54')](_0x2b60('0x3b'))){_0x4db645[_0x2b60('0x21')]=qs[_0x2b60('0x21')](_0x277643[_0x2b60('0x34')][_0x2b60('0x21')]);_0x4db645[_0x2b60('0x1e')]=qs['offset'](_0x277643[_0x2b60('0x34')][_0x2b60('0x1e')]);}return _0x11aac2[_0x2b60('0x50')](_0x4db645);}})[_0x2b60('0x28')](function(_0x17caf1){if(_0x17caf1){return _0x17caf1?{'count':_0x56973a,'rows':_0x17caf1}:null;}})['then'](respondWithResult(_0x143f9c,null))['catch'](handleError(_0x143f9c,null));};exports[_0x2b60('0x55')]=function(_0x1393c0,_0x1f133c,_0x4f8263){var _0x46acff={};var _0x167885={};var _0x2dc9e9;var _0x1be5bc;return db[_0x2b60('0x2e')][_0x2b60('0x4e')]({'where':{'id':_0x1393c0['params']['id']}})['then'](handleEntityNotFound(_0x1f133c,null))[_0x2b60('0x28')](function(_0x4b6f52){if(_0x4b6f52){_0x2dc9e9=_0x4b6f52;_0x167885[_0x2b60('0x32')]=_[_0x2b60('0x35')](db[_0x2b60('0x51')][_0x2b60('0x2f')]);_0x167885[_0x2b60('0x34')]=_['keys'](_0x1393c0[_0x2b60('0x34')]);_0x167885[_0x2b60('0x36')]=_['intersection'](_0x167885[_0x2b60('0x32')],_0x167885[_0x2b60('0x34')]);_0x46acff[_0x2b60('0x39')]=_['intersection'](_0x167885[_0x2b60('0x32')],qs[_0x2b60('0x38')](_0x1393c0[_0x2b60('0x34')][_0x2b60('0x38')]));_0x46acff[_0x2b60('0x39')]=_0x46acff['attributes'][_0x2b60('0x3a')]?_0x46acff[_0x2b60('0x39')]:_0x167885['model'];_0x46acff[_0x2b60('0x4f')]=qs['sort'](_0x1393c0['query'][_0x2b60('0x3c')]);_0x46acff[_0x2b60('0x3d')]=qs['filters'](_[_0x2b60('0x52')](_0x1393c0[_0x2b60('0x34')],_0x167885[_0x2b60('0x36')]));if(_0x1393c0[_0x2b60('0x34')][_0x2b60('0x53')]){_0x46acff[_0x2b60('0x3d')]=_[_0x2b60('0x3e')](_0x46acff[_0x2b60('0x3d')],{'$or':_[_0x2b60('0x3f')](_0x46acff[_0x2b60('0x39')],function(_0x2af18d){var _0xe9643={};_0xe9643[_0x2af18d]={'$like':'%'+_0x1393c0['query'][_0x2b60('0x53')]+'%'};return _0xe9643;})});}_0x46acff=_['merge']({},_0x46acff,_0x1393c0[_0x2b60('0x42')]);return _0x2dc9e9[_0x2b60('0x55')](_0x46acff);}})[_0x2b60('0x28')](function(_0x157b23){if(_0x157b23){_0x1be5bc=_0x157b23['length'];if(!_0x1393c0['query']['hasOwnProperty'](_0x2b60('0x3b'))){_0x46acff['limit']=qs[_0x2b60('0x21')](_0x1393c0['query'][_0x2b60('0x21')]);_0x46acff[_0x2b60('0x1e')]=qs['offset'](_0x1393c0[_0x2b60('0x34')][_0x2b60('0x1e')]);}return _0x2dc9e9[_0x2b60('0x55')](_0x46acff);}})[_0x2b60('0x28')](function(_0x4f780b){if(_0x4f780b){return _0x4f780b?{'count':_0x1be5bc,'rows':_0x4f780b}:null;}})[_0x2b60('0x28')](respondWithResult(_0x1f133c,null))['catch'](handleError(_0x1f133c,null));}; \ No newline at end of file +var _0xcbaf=['util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','index','fieldName','type','key','map','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','name','options','where','SugarcrmConfiguration','includeAll','findAll','catch','show','intersection','include','find','create','body','destroy','params','findOne','rawAttributes','getFields','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xe12cfe,_0x4747aa){var _0x594232=function(_0x4bbab4){while(--_0x4bbab4){_0xe12cfe['push'](_0xe12cfe['shift']());}};_0x594232(++_0x4747aa);}(_0xcbaf,0x135));var _0xfcba=function(_0xa2885b,_0x115c6f){_0xa2885b=_0xa2885b-0x0;var _0x27345b=_0xcbaf[_0xa2885b];return _0x27345b;};'use strict';var emlformat=require(_0xfcba('0x0'));var rimraf=require(_0xfcba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcba('0x2'));var rp=require(_0xfcba('0x3'));var moment=require(_0xfcba('0x4'));var BPromise=require(_0xfcba('0x5'));var Mustache=require(_0xfcba('0x6'));var util=require(_0xfcba('0x7'));var path=require('path');var sox=require(_0xfcba('0x8'));var csv=require(_0xfcba('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcba('0xa'));var _=require('lodash');var squel=require(_0xfcba('0xb'));var crypto=require(_0xfcba('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfcba('0xd'));var toCsv=require(_0xfcba('0x9'));var querystring=require(_0xfcba('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcba('0xf'));var qs=require(_0xfcba('0x10'));var as=require(_0xfcba('0x11'));var hardwareService=require(_0xfcba('0x12'));var logger=require(_0xfcba('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xfcba('0x14'));var licenseUtil=require(_0xfcba('0x15'));var db=require(_0xfcba('0x16'))['db'];function respondWithStatusCode(_0x48de10,_0x42562d){_0x42562d=_0x42562d||0xcc;return function(_0x3433d7){if(_0x3433d7){return _0x48de10[_0xfcba('0x17')](_0x42562d);}return _0x48de10[_0xfcba('0x18')](_0x42562d)[_0xfcba('0x19')]();};}function respondWithResult(_0x591285,_0x119bdf){_0x119bdf=_0x119bdf||0xc8;return function(_0x115f37){if(_0x115f37){return _0x591285[_0xfcba('0x18')](_0x119bdf)[_0xfcba('0x1a')](_0x115f37);}};}function respondWithFilteredResult(_0xa0123e,_0x21fec2){return function(_0x57f31a){if(_0x57f31a){var _0x44f31a=typeof _0x21fec2[_0xfcba('0x1b')]===_0xfcba('0x1c')&&typeof _0x21fec2[_0xfcba('0x1d')]===_0xfcba('0x1c');var _0x335073=_0x57f31a[_0xfcba('0x1e')];var _0x88b36=_0x44f31a?0x0:_0x21fec2['offset'];var _0x24aca7=_0x44f31a?_0x57f31a['count']:_0x21fec2['offset']+_0x21fec2[_0xfcba('0x1d')];var _0x19a56a;if(_0x24aca7>=_0x335073){_0x24aca7=_0x335073;_0x19a56a=0xc8;}else{_0x19a56a=0xce;}_0xa0123e['status'](_0x19a56a);return _0xa0123e[_0xfcba('0x1f')](_0xfcba('0x20'),_0x88b36+'-'+_0x24aca7+'/'+_0x335073)[_0xfcba('0x1a')](_0x57f31a);}return null;};}function patchUpdates(_0x3a7a33){return function(_0x19418b){try{jsonpatch[_0xfcba('0x21')](_0x19418b,_0x3a7a33,!![]);}catch(_0x2bd361){return BPromise[_0xfcba('0x22')](_0x2bd361);}return _0x19418b['save']();};}function saveUpdates(_0x1d58d8,_0x5a63fb){return function(_0x1ae014){if(_0x1ae014){return _0x1ae014[_0xfcba('0x23')](_0x1d58d8)[_0xfcba('0x24')](function(_0x276b28){return _0x276b28;});}return null;};}function removeEntity(_0x1ab3fd,_0x3f7643){return function(_0x9cd882){if(_0x9cd882){return _0x9cd882['destroy']()[_0xfcba('0x24')](function(){_0x1ab3fd['status'](0xcc)[_0xfcba('0x19')]();});}};}function handleEntityNotFound(_0x11893b,_0x12baec){return function(_0x20ddcd){if(!_0x20ddcd){_0x11893b['sendStatus'](0x194);}return _0x20ddcd;};}function handleError(_0x210d33,_0x157189){_0x157189=_0x157189||0x1f4;return function(_0x1c13f7){logger['error'](_0x1c13f7[_0xfcba('0x25')]);if(_0x1c13f7['name']){delete _0x1c13f7['name'];}_0x210d33[_0xfcba('0x18')](_0x157189)['send'](_0x1c13f7);};}exports[_0xfcba('0x26')]=function(_0x3637e1,_0xaeedf7){var _0xd89794={},_0x24e488={},_0xac55d6={'count':0x0,'rows':[]};var _0x1a9e30=_['map'](db['SugarcrmConfiguration']['rawAttributes'],function(_0x61eabd){return{'name':_0x61eabd[_0xfcba('0x27')],'type':_0x61eabd[_0xfcba('0x28')][_0xfcba('0x29')]};});_0x24e488['model']=_[_0xfcba('0x2a')](_0x1a9e30,'name');_0x24e488['query']=_[_0xfcba('0x2b')](_0x3637e1[_0xfcba('0x2c')]);_0x24e488[_0xfcba('0x2d')]=_['intersection'](_0x24e488[_0xfcba('0x2e')],_0x24e488[_0xfcba('0x2c')]);_0xd89794[_0xfcba('0x2f')]=_['intersection'](_0x24e488[_0xfcba('0x2e')],qs[_0xfcba('0x30')](_0x3637e1[_0xfcba('0x2c')][_0xfcba('0x30')]));_0xd89794[_0xfcba('0x2f')]=_0xd89794[_0xfcba('0x2f')][_0xfcba('0x31')]?_0xd89794[_0xfcba('0x2f')]:_0x24e488['model'];if(!_0x3637e1[_0xfcba('0x2c')][_0xfcba('0x32')](_0xfcba('0x33'))){_0xd89794[_0xfcba('0x1d')]=qs[_0xfcba('0x1d')](_0x3637e1['query'][_0xfcba('0x1d')]);_0xd89794[_0xfcba('0x1b')]=qs['offset'](_0x3637e1['query'][_0xfcba('0x1b')]);}_0xd89794[_0xfcba('0x34')]=qs[_0xfcba('0x35')](_0x3637e1[_0xfcba('0x2c')][_0xfcba('0x35')]);_0xd89794['where']=qs[_0xfcba('0x2d')](_[_0xfcba('0x36')](_0x3637e1['query'],_0x24e488[_0xfcba('0x2d')]),_0x1a9e30);if(_0x3637e1[_0xfcba('0x2c')][_0xfcba('0x37')]){_0xd89794['where']=_[_0xfcba('0x38')](_0xd89794['where'],{'$or':_['map'](_0x1a9e30,function(_0xf7742b){if(_0xf7742b['type']!==_0xfcba('0x39')){var _0x313d61={};_0x313d61[_0xf7742b[_0xfcba('0x3a')]]={'$like':'%'+_0x3637e1[_0xfcba('0x2c')][_0xfcba('0x37')]+'%'};return _0x313d61;}})});}_0xd89794=_[_0xfcba('0x38')]({},_0xd89794,_0x3637e1[_0xfcba('0x3b')]);var _0x6f3d92={'where':_0xd89794[_0xfcba('0x3c')]};return db[_0xfcba('0x3d')][_0xfcba('0x1e')](_0x6f3d92)[_0xfcba('0x24')](function(_0x475e28){_0xac55d6['count']=_0x475e28;if(_0x3637e1[_0xfcba('0x2c')][_0xfcba('0x3e')]){_0xd89794['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xfcba('0x3f')](_0xd89794);})[_0xfcba('0x24')](function(_0x1be926){_0xac55d6['rows']=_0x1be926;return _0xac55d6;})['then'](respondWithFilteredResult(_0xaeedf7,_0xd89794))[_0xfcba('0x40')](handleError(_0xaeedf7,null));};exports[_0xfcba('0x41')]=function(_0x192963,_0xf380f5){var _0x50f65a={'raw':![],'where':{'id':_0x192963['params']['id']}},_0x2ff326={};_0x2ff326['model']=_['keys'](db[_0xfcba('0x3d')]['rawAttributes']);_0x2ff326[_0xfcba('0x2c')]=_[_0xfcba('0x2b')](_0x192963[_0xfcba('0x2c')]);_0x2ff326[_0xfcba('0x2d')]=_['intersection'](_0x2ff326[_0xfcba('0x2e')],_0x2ff326[_0xfcba('0x2c')]);_0x50f65a[_0xfcba('0x2f')]=_[_0xfcba('0x42')](_0x2ff326['model'],qs['fields'](_0x192963['query'][_0xfcba('0x30')]));_0x50f65a[_0xfcba('0x2f')]=_0x50f65a[_0xfcba('0x2f')][_0xfcba('0x31')]?_0x50f65a[_0xfcba('0x2f')]:_0x2ff326['model'];if(_0x192963[_0xfcba('0x2c')][_0xfcba('0x3e')]){_0x50f65a[_0xfcba('0x43')]=[{'all':!![]}];}_0x50f65a=_[_0xfcba('0x38')]({},_0x50f65a,_0x192963[_0xfcba('0x3b')]);return db[_0xfcba('0x3d')][_0xfcba('0x44')](_0x50f65a)[_0xfcba('0x24')](handleEntityNotFound(_0xf380f5,null))[_0xfcba('0x24')](respondWithResult(_0xf380f5,null))[_0xfcba('0x40')](handleError(_0xf380f5,null));};exports['create']=function(_0x2b216f,_0x1cc757){return db[_0xfcba('0x3d')][_0xfcba('0x45')](_0x2b216f[_0xfcba('0x46')],{})[_0xfcba('0x24')](respondWithResult(_0x1cc757,0xc9))['catch'](handleError(_0x1cc757,null));};exports[_0xfcba('0x23')]=function(_0x53f4a6,_0x116482){if(_0x53f4a6[_0xfcba('0x46')]['id']){delete _0x53f4a6[_0xfcba('0x46')]['id'];}return db['SugarcrmConfiguration'][_0xfcba('0x44')]({'where':{'id':_0x53f4a6['params']['id']}})['then'](handleEntityNotFound(_0x116482,null))[_0xfcba('0x24')](saveUpdates(_0x53f4a6[_0xfcba('0x46')],null))[_0xfcba('0x24')](respondWithResult(_0x116482,null))['catch'](handleError(_0x116482,null));};exports[_0xfcba('0x47')]=function(_0x2b0b60,_0x3f5c1e){return db[_0xfcba('0x3d')][_0xfcba('0x44')]({'where':{'id':_0x2b0b60[_0xfcba('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f5c1e,null))[_0xfcba('0x24')](removeEntity(_0x3f5c1e,null))[_0xfcba('0x40')](handleError(_0x3f5c1e,null));};exports['getFields']=function(_0x121709,_0x47dba1,_0x111217){var _0x1c0518={};var _0x194fee={};var _0x9bf233;var _0x4ab1bb;return db[_0xfcba('0x3d')][_0xfcba('0x49')]({'where':{'id':_0x121709[_0xfcba('0x48')]['id']}})[_0xfcba('0x24')](handleEntityNotFound(_0x47dba1,null))[_0xfcba('0x24')](function(_0x47b0fa){if(_0x47b0fa){_0x9bf233=_0x47b0fa;_0x194fee[_0xfcba('0x2e')]=_[_0xfcba('0x2b')](db['SugarcrmField'][_0xfcba('0x4a')]);_0x194fee[_0xfcba('0x2c')]=_[_0xfcba('0x2b')](_0x121709[_0xfcba('0x2c')]);_0x194fee[_0xfcba('0x2d')]=_[_0xfcba('0x42')](_0x194fee[_0xfcba('0x2e')],_0x194fee[_0xfcba('0x2c')]);_0x1c0518[_0xfcba('0x2f')]=_[_0xfcba('0x42')](_0x194fee['model'],qs[_0xfcba('0x30')](_0x121709[_0xfcba('0x2c')]['fields']));_0x1c0518[_0xfcba('0x2f')]=_0x1c0518[_0xfcba('0x2f')][_0xfcba('0x31')]?_0x1c0518['attributes']:_0x194fee[_0xfcba('0x2e')];_0x1c0518['order']=qs[_0xfcba('0x35')](_0x121709[_0xfcba('0x2c')][_0xfcba('0x35')]);_0x1c0518[_0xfcba('0x3c')]=qs[_0xfcba('0x2d')](_[_0xfcba('0x36')](_0x121709[_0xfcba('0x2c')],_0x194fee[_0xfcba('0x2d')]));if(_0x121709['query'][_0xfcba('0x37')]){_0x1c0518[_0xfcba('0x3c')]=_[_0xfcba('0x38')](_0x1c0518['where'],{'$or':_[_0xfcba('0x2a')](_0x1c0518[_0xfcba('0x2f')],function(_0x3aab3c){var _0x5c5c7f={};_0x5c5c7f[_0x3aab3c]={'$like':'%'+_0x121709[_0xfcba('0x2c')]['filter']+'%'};return _0x5c5c7f;})});}_0x1c0518=_['merge']({},_0x1c0518,_0x121709[_0xfcba('0x3b')]);return _0x9bf233[_0xfcba('0x4b')](_0x1c0518);}})[_0xfcba('0x24')](function(_0x2ab481){if(_0x2ab481){_0x4ab1bb=_0x2ab481[_0xfcba('0x31')];if(!_0x121709[_0xfcba('0x2c')][_0xfcba('0x32')]('nolimit')){_0x1c0518['limit']=qs[_0xfcba('0x1d')](_0x121709[_0xfcba('0x2c')][_0xfcba('0x1d')]);_0x1c0518[_0xfcba('0x1b')]=qs[_0xfcba('0x1b')](_0x121709[_0xfcba('0x2c')]['offset']);}return _0x9bf233[_0xfcba('0x4b')](_0x1c0518);}})[_0xfcba('0x24')](function(_0x3941d){if(_0x3941d){return _0x3941d?{'count':_0x4ab1bb,'rows':_0x3941d}:null;}})['then'](respondWithResult(_0x47dba1,null))[_0xfcba('0x40')](handleError(_0x47dba1,null));};exports['getSubjects']=function(_0x519a58,_0x146c66,_0x3ce542){var _0x2b5c5b={};var _0x2c4b44={};var _0x530f79;var _0x2cebb3;return db[_0xfcba('0x3d')][_0xfcba('0x49')]({'where':{'id':_0x519a58[_0xfcba('0x48')]['id']}})[_0xfcba('0x24')](handleEntityNotFound(_0x146c66,null))[_0xfcba('0x24')](function(_0x373b51){if(_0x373b51){_0x530f79=_0x373b51;_0x2c4b44[_0xfcba('0x2e')]=_[_0xfcba('0x2b')](db[_0xfcba('0x4c')][_0xfcba('0x4a')]);_0x2c4b44[_0xfcba('0x2c')]=_[_0xfcba('0x2b')](_0x519a58['query']);_0x2c4b44['filters']=_['intersection'](_0x2c4b44[_0xfcba('0x2e')],_0x2c4b44[_0xfcba('0x2c')]);_0x2b5c5b[_0xfcba('0x2f')]=_[_0xfcba('0x42')](_0x2c4b44[_0xfcba('0x2e')],qs['fields'](_0x519a58[_0xfcba('0x2c')][_0xfcba('0x30')]));_0x2b5c5b['attributes']=_0x2b5c5b[_0xfcba('0x2f')]['length']?_0x2b5c5b[_0xfcba('0x2f')]:_0x2c4b44[_0xfcba('0x2e')];_0x2b5c5b[_0xfcba('0x34')]=qs['sort'](_0x519a58[_0xfcba('0x2c')][_0xfcba('0x35')]);_0x2b5c5b[_0xfcba('0x3c')]=qs[_0xfcba('0x2d')](_[_0xfcba('0x36')](_0x519a58[_0xfcba('0x2c')],_0x2c4b44[_0xfcba('0x2d')]));if(_0x519a58[_0xfcba('0x2c')]['filter']){_0x2b5c5b[_0xfcba('0x3c')]=_[_0xfcba('0x38')](_0x2b5c5b[_0xfcba('0x3c')],{'$or':_[_0xfcba('0x2a')](_0x2b5c5b[_0xfcba('0x2f')],function(_0x1c654a){var _0x400103={};_0x400103[_0x1c654a]={'$like':'%'+_0x519a58['query'][_0xfcba('0x37')]+'%'};return _0x400103;})});}_0x2b5c5b=_[_0xfcba('0x38')]({},_0x2b5c5b,_0x519a58['options']);return _0x530f79[_0xfcba('0x4d')](_0x2b5c5b);}})[_0xfcba('0x24')](function(_0xfdeac3){if(_0xfdeac3){_0x2cebb3=_0xfdeac3['length'];if(!_0x519a58[_0xfcba('0x2c')]['hasOwnProperty']('nolimit')){_0x2b5c5b['limit']=qs[_0xfcba('0x1d')](_0x519a58['query'][_0xfcba('0x1d')]);_0x2b5c5b['offset']=qs[_0xfcba('0x1b')](_0x519a58['query'][_0xfcba('0x1b')]);}return _0x530f79['getSubjects'](_0x2b5c5b);}})[_0xfcba('0x24')](function(_0x476e2a){if(_0x476e2a){return _0x476e2a?{'count':_0x2cebb3,'rows':_0x476e2a}:null;}})[_0xfcba('0x24')](respondWithResult(_0x146c66,null))[_0xfcba('0x40')](handleError(_0x146c66,null));};exports['getDescriptions']=function(_0x5669bf,_0xb464b9,_0x164e2e){var _0x3f8975={};var _0x3f595d={};var _0x37fde6;var _0x2165bc;return db[_0xfcba('0x3d')][_0xfcba('0x49')]({'where':{'id':_0x5669bf[_0xfcba('0x48')]['id']}})['then'](handleEntityNotFound(_0xb464b9,null))[_0xfcba('0x24')](function(_0x1b192a){if(_0x1b192a){_0x37fde6=_0x1b192a;_0x3f595d[_0xfcba('0x2e')]=_[_0xfcba('0x2b')](db[_0xfcba('0x4c')]['rawAttributes']);_0x3f595d[_0xfcba('0x2c')]=_[_0xfcba('0x2b')](_0x5669bf['query']);_0x3f595d[_0xfcba('0x2d')]=_[_0xfcba('0x42')](_0x3f595d[_0xfcba('0x2e')],_0x3f595d['query']);_0x3f8975['attributes']=_['intersection'](_0x3f595d[_0xfcba('0x2e')],qs[_0xfcba('0x30')](_0x5669bf[_0xfcba('0x2c')]['fields']));_0x3f8975[_0xfcba('0x2f')]=_0x3f8975[_0xfcba('0x2f')]['length']?_0x3f8975[_0xfcba('0x2f')]:_0x3f595d[_0xfcba('0x2e')];_0x3f8975['order']=qs[_0xfcba('0x35')](_0x5669bf[_0xfcba('0x2c')][_0xfcba('0x35')]);_0x3f8975['where']=qs[_0xfcba('0x2d')](_[_0xfcba('0x36')](_0x5669bf[_0xfcba('0x2c')],_0x3f595d['filters']));if(_0x5669bf[_0xfcba('0x2c')][_0xfcba('0x37')]){_0x3f8975[_0xfcba('0x3c')]=_[_0xfcba('0x38')](_0x3f8975[_0xfcba('0x3c')],{'$or':_[_0xfcba('0x2a')](_0x3f8975['attributes'],function(_0x3739af){var _0x5ecb85={};_0x5ecb85[_0x3739af]={'$like':'%'+_0x5669bf[_0xfcba('0x2c')][_0xfcba('0x37')]+'%'};return _0x5ecb85;})});}_0x3f8975=_[_0xfcba('0x38')]({},_0x3f8975,_0x5669bf[_0xfcba('0x3b')]);return _0x37fde6['getDescriptions'](_0x3f8975);}})['then'](function(_0x25e279){if(_0x25e279){_0x2165bc=_0x25e279['length'];if(!_0x5669bf[_0xfcba('0x2c')][_0xfcba('0x32')](_0xfcba('0x33'))){_0x3f8975[_0xfcba('0x1d')]=qs[_0xfcba('0x1d')](_0x5669bf[_0xfcba('0x2c')]['limit']);_0x3f8975[_0xfcba('0x1b')]=qs[_0xfcba('0x1b')](_0x5669bf[_0xfcba('0x2c')][_0xfcba('0x1b')]);}return _0x37fde6[_0xfcba('0x4e')](_0x3f8975);}})[_0xfcba('0x24')](function(_0x28b00a){if(_0x28b00a){return _0x28b00a?{'count':_0x2165bc,'rows':_0x28b00a}:null;}})['then'](respondWithResult(_0xb464b9,null))[_0xfcba('0x40')](handleError(_0xb464b9,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 85378bd..6528ff7 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 _0x199c=['define','int_sugarcrm_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports'];(function(_0x1797d2,_0x1a6483){var _0x527306=function(_0x5776fe){while(--_0x5776fe){_0x1797d2['push'](_0x1797d2['shift']());}};_0x527306(++_0x1a6483);}(_0x199c,0x174));var _0xc199=function(_0x41c9ed,_0x4f0042){_0x41c9ed=_0x41c9ed-0x0;var _0x4c47e1=_0x199c[_0x41c9ed];return _0x4c47e1;};'use strict';var _=require(_0xc199('0x0'));var util=require(_0xc199('0x1'));var logger=require(_0xc199('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc199('0x3'));var fs=require('fs');var path=require(_0xc199('0x4'));var rimraf=require(_0xc199('0x5'));var config=require('../../config/environment');var attributes=require(_0xc199('0x6'));module[_0xc199('0x7')]=function(_0x55e5c8,_0x1be21f){return _0x55e5c8[_0xc199('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xc199('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1160=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intSugarcrmConfiguration.attributes'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x1160,0x9d));var _0x0116=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x1160[_0x57fa33];return _0x12e724;};'use strict';var _=require(_0x0116('0x0'));var util=require(_0x0116('0x1'));var logger=require(_0x0116('0x2'))('api');var moment=require(_0x0116('0x3'));var BPromise=require(_0x0116('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0116('0x5'));var rimraf=require(_0x0116('0x6'));var config=require('../../config/environment');var attributes=require(_0x0116('0x7'));module[_0x0116('0x8')]=function(_0x1eec5a,_0xe57037){return _0x1eec5a['define'](_0x0116('0x9'),attributes,{'tableName':_0x0116('0xa'),'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 9b8f112..07f3ce4 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 _0x8c45=['SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x8c45,0xd8));var _0x58c4=function(_0x550b65,_0xd6cda9){_0x550b65=_0x550b65-0x0;var _0x25513f=_0x8c45[_0x550b65];return _0x25513f;};'use strict';var _=require(_0x58c4('0x0'));var util=require(_0x58c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x58c4('0x2'));var fs=require('fs');var Redis=require(_0x58c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c4('0x4'));var logger=require(_0x58c4('0x5'))(_0x58c4('0x6'));var config=require('../../config/environment');var jayson=require(_0x58c4('0x7'));var client=jayson[_0x58c4('0x8')][_0x58c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1465aa,_0x29fd0b,_0x2e001c){return new BPromise(function(_0x2e3eed,_0x155215){return client[_0x58c4('0xa')](_0x1465aa,_0x2e001c)['then'](function(_0x18167c){logger[_0x58c4('0xb')](_0x58c4('0xc'),_0x29fd0b,'request\x20sent');logger[_0x58c4('0xd')](_0x58c4('0xe'),_0x29fd0b,_0x58c4('0xf'),JSON[_0x58c4('0x10')](_0x18167c));if(_0x18167c['error']){if(_0x18167c[_0x58c4('0x11')]['code']===0x1f4){logger[_0x58c4('0x11')](_0x58c4('0xc'),_0x29fd0b,_0x18167c['error'][_0x58c4('0x12')]);return _0x155215(_0x18167c[_0x58c4('0x11')][_0x58c4('0x12')]);}logger[_0x58c4('0x11')](_0x58c4('0xc'),_0x29fd0b,_0x18167c['error'][_0x58c4('0x12')]);return _0x2e3eed(_0x18167c[_0x58c4('0x11')][_0x58c4('0x12')]);}else{logger['info'](_0x58c4('0xc'),_0x29fd0b,_0x58c4('0xf'));_0x2e3eed(_0x18167c['result'][_0x58c4('0x12')]);}})['catch'](function(_0x523d8f){logger[_0x58c4('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x29fd0b,_0x523d8f);_0x155215(_0x523d8f);});});} \ No newline at end of file +var _0x8cad=['error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x233aa1,_0x37af6d){var _0x4e670d=function(_0x2fca54){while(--_0x2fca54){_0x233aa1['push'](_0x233aa1['shift']());}};_0x4e670d(++_0x37af6d);}(_0x8cad,0xf5));var _0xd8ca=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x8cad[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xd8ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd8ca('0x1'));var rs=require(_0xd8ca('0x2'));var fs=require('fs');var Redis=require(_0xd8ca('0x3'));var db=require(_0xd8ca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd8ca('0x5'))(_0xd8ca('0x6'));var config=require(_0xd8ca('0x7'));var jayson=require(_0xd8ca('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x180d5d,_0x34c195,_0xd185e8){return new BPromise(function(_0x347715,_0x32573a){return client[_0xd8ca('0x9')](_0x180d5d,_0xd185e8)[_0xd8ca('0xa')](function(_0x31d8b3){logger[_0xd8ca('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x34c195,_0xd8ca('0xc'));logger[_0xd8ca('0xd')](_0xd8ca('0xe'),_0x34c195,_0xd8ca('0xc'),JSON['stringify'](_0x31d8b3));if(_0x31d8b3[_0xd8ca('0xf')]){if(_0x31d8b3[_0xd8ca('0xf')][_0xd8ca('0x10')]===0x1f4){logger[_0xd8ca('0xf')](_0xd8ca('0x11'),_0x34c195,_0x31d8b3[_0xd8ca('0xf')]['message']);return _0x32573a(_0x31d8b3[_0xd8ca('0xf')][_0xd8ca('0x12')]);}logger[_0xd8ca('0xf')](_0xd8ca('0x11'),_0x34c195,_0x31d8b3[_0xd8ca('0xf')][_0xd8ca('0x12')]);return _0x347715(_0x31d8b3[_0xd8ca('0xf')]['message']);}else{logger[_0xd8ca('0xb')](_0xd8ca('0x11'),_0x34c195,_0xd8ca('0xc'));_0x347715(_0x31d8b3[_0xd8ca('0x13')]['message']);}})['catch'](function(_0x1a5d3e){logger[_0xd8ca('0xf')](_0xd8ca('0x11'),_0x34c195,_0x1a5d3e);_0x32573a(_0x1a5d3e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f518e69..2f6aa48 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 _0xa098=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','delete','multer','util','path','connect-timeout','express'];(function(_0x5a120c,_0x2265bc){var _0x59e6f0=function(_0x13f4ac){while(--_0x13f4ac){_0x5a120c['push'](_0x5a120c['shift']());}};_0x59e6f0(++_0x2265bc);}(_0xa098,0x163));var _0x8a09=function(_0x2e32dd,_0x52384a){_0x2e32dd=_0x2e32dd-0x0;var _0x53fb46=_0xa098[_0x2e32dd];return _0x53fb46;};'use strict';var multer=require(_0x8a09('0x0'));var util=require(_0x8a09('0x1'));var path=require(_0x8a09('0x2'));var timeout=require(_0x8a09('0x3'));var express=require(_0x8a09('0x4'));var router=express['Router']();var fs_extra=require(_0x8a09('0x5'));var auth=require(_0x8a09('0x6'));var interaction=require(_0x8a09('0x7'));var config=require(_0x8a09('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x8a09('0x9')]('/',auth[_0x8a09('0xa')](),controller[_0x8a09('0xb')]);router[_0x8a09('0x9')](_0x8a09('0xc'),auth[_0x8a09('0xa')](),controller[_0x8a09('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8a09('0xe')](_0x8a09('0xc'),auth[_0x8a09('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa0b7=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path','express','../../components/auth/service'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa0b7,0x67));var _0x7a0b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xa0b7[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0x7a0b('0x0'));var util=require(_0x7a0b('0x1'));var path=require(_0x7a0b('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a0b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7a0b('0x4'));var interaction=require(_0x7a0b('0x5'));var config=require(_0x7a0b('0x6'));var controller=require(_0x7a0b('0x7'));router[_0x7a0b('0x8')]('/',auth[_0x7a0b('0x9')](),controller[_0x7a0b('0xa')]);router[_0x7a0b('0x8')](_0x7a0b('0xb'),auth[_0x7a0b('0x9')](),controller[_0x7a0b('0xc')]);router[_0x7a0b('0xd')]('/',auth[_0x7a0b('0x9')](),controller['create']);router[_0x7a0b('0xe')](_0x7a0b('0xb'),auth[_0x7a0b('0x9')](),controller[_0x7a0b('0xf')]);router[_0x7a0b('0x10')](_0x7a0b('0xb'),auth[_0x7a0b('0x9')](),controller['destroy']);module[_0x7a0b('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2b397c7..c14c60d 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 _0x4ee5=['BOOLEAN','sequelize','ENUM','customVariable','keyValue','string','STRING'];(function(_0x1e8e75,_0xe3b66f){var _0x156c42=function(_0x22e326){while(--_0x22e326){_0x1e8e75['push'](_0x1e8e75['shift']());}};_0x156c42(++_0xe3b66f);}(_0x4ee5,0x9b));var _0x54ee=function(_0x51e762,_0x5e6124){_0x51e762=_0x51e762-0x0;var _0x1d7b21=_0x4ee5[_0x51e762];return _0x1d7b21;};'use strict';var Sequelize=require(_0x54ee('0x0'));module['exports']={'type':{'type':Sequelize[_0x54ee('0x1')]('string','variable',_0x54ee('0x2'),_0x54ee('0x3'),'picklist'),'defaultValue':_0x54ee('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x54ee('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x54ee('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x54ee('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x54ee('0x5')]},'customField':{'type':Sequelize[_0x54ee('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcdb9=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x29aaed,_0xcb877f){var _0x5367c3=function(_0x24934e){while(--_0x24934e){_0x29aaed['push'](_0x29aaed['shift']());}};_0x5367c3(++_0xcb877f);}(_0xcdb9,0xd8));var _0x9cdb=function(_0x2dbd64,_0x16bd8f){_0x2dbd64=_0x2dbd64-0x0;var _0x261855=_0xcdb9[_0x2dbd64];return _0x261855;};'use strict';var Sequelize=require(_0x9cdb('0x0'));module[_0x9cdb('0x1')]={'type':{'type':Sequelize[_0x9cdb('0x2')](_0x9cdb('0x3'),'variable',_0x9cdb('0x4'),_0x9cdb('0x5'),_0x9cdb('0x6')),'defaultValue':_0x9cdb('0x3')},'content':{'type':Sequelize[_0x9cdb('0x7')]},'key':{'type':Sequelize[_0x9cdb('0x7')]},'keyType':{'type':Sequelize[_0x9cdb('0x2')](_0x9cdb('0x3'),_0x9cdb('0x8'),_0x9cdb('0x4'))},'keyContent':{'type':Sequelize[_0x9cdb('0x7')]},'idField':{'type':Sequelize[_0x9cdb('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9cdb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9cdb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index eb45ae5..34968c3 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 _0x7f94=['rawAttributes','fields','includeAll','include','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','stack','index','map','SugarcrmField','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','params'];(function(_0x529d98,_0x5c1246){var _0x447794=function(_0x53c3f9){while(--_0x53c3f9){_0x529d98['push'](_0x529d98['shift']());}};_0x447794(++_0x5c1246);}(_0x7f94,0x175));var _0x47f9=function(_0x4fb54c,_0xc540e5){_0x4fb54c=_0x4fb54c-0x0;var _0x256a0e=_0x7f94[_0x4fb54c];return _0x256a0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47f9('0x0'));var zipdir=require(_0x47f9('0x1'));var jsonpatch=require(_0x47f9('0x2'));var rp=require(_0x47f9('0x3'));var moment=require('moment');var BPromise=require(_0x47f9('0x4'));var Mustache=require('mustache');var util=require(_0x47f9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x47f9('0x6'));var ejs=require(_0x47f9('0x7'));var fs=require('fs');var fs_extra=require(_0x47f9('0x8'));var _=require(_0x47f9('0x9'));var squel=require(_0x47f9('0xa'));var crypto=require(_0x47f9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x47f9('0xc'));var Redis=require(_0x47f9('0xd'));var authService=require(_0x47f9('0xe'));var qs=require(_0x47f9('0xf'));var as=require(_0x47f9('0x10'));var hardwareService=require(_0x47f9('0x11'));var logger=require(_0x47f9('0x12'))(_0x47f9('0x13'));var utils=require(_0x47f9('0x14'));var config=require(_0x47f9('0x15'));var licenseUtil=require(_0x47f9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16ec4e,_0x5728b7){_0x5728b7=_0x5728b7||0xcc;return function(_0x5c7e3a){if(_0x5c7e3a){return _0x16ec4e[_0x47f9('0x17')](_0x5728b7);}return _0x16ec4e['status'](_0x5728b7)['end']();};}function respondWithResult(_0x365696,_0xa42e48){_0xa42e48=_0xa42e48||0xc8;return function(_0xa604bd){if(_0xa604bd){return _0x365696[_0x47f9('0x18')](_0xa42e48)[_0x47f9('0x19')](_0xa604bd);}};}function respondWithFilteredResult(_0x39020f,_0x1d3540){return function(_0x38129e){if(_0x38129e){var _0x44a5f2=typeof _0x1d3540['offset']===_0x47f9('0x1a')&&typeof _0x1d3540[_0x47f9('0x1b')]==='undefined';var _0x5c0762=_0x38129e[_0x47f9('0x1c')];var _0x47885e=_0x44a5f2?0x0:_0x1d3540[_0x47f9('0x1d')];var _0x4fcdc4=_0x44a5f2?_0x38129e['count']:_0x1d3540[_0x47f9('0x1d')]+_0x1d3540[_0x47f9('0x1b')];var _0x2a5f80;if(_0x4fcdc4>=_0x5c0762){_0x4fcdc4=_0x5c0762;_0x2a5f80=0xc8;}else{_0x2a5f80=0xce;}_0x39020f[_0x47f9('0x18')](_0x2a5f80);return _0x39020f[_0x47f9('0x1e')](_0x47f9('0x1f'),_0x47885e+'-'+_0x4fcdc4+'/'+_0x5c0762)['json'](_0x38129e);}return null;};}function patchUpdates(_0x239a44){return function(_0x420fd1){try{jsonpatch[_0x47f9('0x20')](_0x420fd1,_0x239a44,!![]);}catch(_0x549234){return BPromise['reject'](_0x549234);}return _0x420fd1[_0x47f9('0x21')]();};}function saveUpdates(_0x10f3e1,_0x1c21fb){return function(_0x25ece6){if(_0x25ece6){return _0x25ece6['update'](_0x10f3e1)[_0x47f9('0x22')](function(_0x570642){return _0x570642;});}return null;};}function removeEntity(_0x5d590f,_0x5ceb4e){return function(_0x114560){if(_0x114560){return _0x114560[_0x47f9('0x23')]()[_0x47f9('0x22')](function(){_0x5d590f[_0x47f9('0x18')](0xcc)[_0x47f9('0x24')]();});}};}function handleEntityNotFound(_0x3608f9,_0x597f9d){return function(_0x147def){if(!_0x147def){_0x3608f9['sendStatus'](0x194);}return _0x147def;};}function handleError(_0x51151c,_0xc19f38){_0xc19f38=_0xc19f38||0x1f4;return function(_0x1a6c95){logger['error'](_0x1a6c95[_0x47f9('0x25')]);if(_0x1a6c95['name']){delete _0x1a6c95['name'];}_0x51151c['status'](_0xc19f38)['send'](_0x1a6c95);};}exports[_0x47f9('0x26')]=function(_0x1173b8,_0xe1ea82){var _0x242c09={},_0x145685={},_0xbc1b24={'count':0x0,'rows':[]};var _0x343e40=_[_0x47f9('0x27')](db[_0x47f9('0x28')]['rawAttributes'],function(_0x34ddaf){return{'name':_0x34ddaf[_0x47f9('0x29')],'type':_0x34ddaf[_0x47f9('0x2a')][_0x47f9('0x2b')]};});_0x145685[_0x47f9('0x2c')]=_['map'](_0x343e40,_0x47f9('0x2d'));_0x145685[_0x47f9('0x2e')]=_[_0x47f9('0x2f')](_0x1173b8[_0x47f9('0x2e')]);_0x145685[_0x47f9('0x30')]=_['intersection'](_0x145685[_0x47f9('0x2c')],_0x145685[_0x47f9('0x2e')]);_0x242c09['attributes']=_[_0x47f9('0x31')](_0x145685[_0x47f9('0x2c')],qs['fields'](_0x1173b8[_0x47f9('0x2e')]['fields']));_0x242c09[_0x47f9('0x32')]=_0x242c09[_0x47f9('0x32')][_0x47f9('0x33')]?_0x242c09['attributes']:_0x145685[_0x47f9('0x2c')];if(!_0x1173b8[_0x47f9('0x2e')][_0x47f9('0x34')](_0x47f9('0x35'))){_0x242c09[_0x47f9('0x1b')]=qs[_0x47f9('0x1b')](_0x1173b8[_0x47f9('0x2e')][_0x47f9('0x1b')]);_0x242c09[_0x47f9('0x1d')]=qs[_0x47f9('0x1d')](_0x1173b8[_0x47f9('0x2e')]['offset']);}_0x242c09[_0x47f9('0x36')]=qs[_0x47f9('0x37')](_0x1173b8[_0x47f9('0x2e')][_0x47f9('0x37')]);_0x242c09['where']=qs[_0x47f9('0x30')](_[_0x47f9('0x38')](_0x1173b8[_0x47f9('0x2e')],_0x145685[_0x47f9('0x30')]),_0x343e40);if(_0x1173b8[_0x47f9('0x2e')][_0x47f9('0x39')]){_0x242c09[_0x47f9('0x3a')]=_[_0x47f9('0x3b')](_0x242c09[_0x47f9('0x3a')],{'$or':_[_0x47f9('0x27')](_0x343e40,function(_0x150290){if(_0x150290[_0x47f9('0x2a')]!==_0x47f9('0x3c')){var _0x4c0a1c={};_0x4c0a1c[_0x150290['name']]={'$like':'%'+_0x1173b8[_0x47f9('0x2e')][_0x47f9('0x39')]+'%'};return _0x4c0a1c;}})});}_0x242c09=_[_0x47f9('0x3b')]({},_0x242c09,_0x1173b8[_0x47f9('0x3d')]);var _0x5eae69={'where':_0x242c09[_0x47f9('0x3a')]};return db['SugarcrmField'][_0x47f9('0x1c')](_0x5eae69)['then'](function(_0x56e5d1){_0xbc1b24[_0x47f9('0x1c')]=_0x56e5d1;if(_0x1173b8['query']['includeAll']){_0x242c09['include']=[{'all':!![]}];}return db[_0x47f9('0x28')]['findAll'](_0x242c09);})[_0x47f9('0x22')](function(_0x1fc26a){_0xbc1b24[_0x47f9('0x3e')]=_0x1fc26a;return _0xbc1b24;})[_0x47f9('0x22')](respondWithFilteredResult(_0xe1ea82,_0x242c09))[_0x47f9('0x3f')](handleError(_0xe1ea82,null));};exports['show']=function(_0x37a36f,_0x254840){var _0x55dc03={'raw':!![],'where':{'id':_0x37a36f[_0x47f9('0x40')]['id']}},_0x31a41d={};_0x31a41d['model']=_[_0x47f9('0x2f')](db[_0x47f9('0x28')][_0x47f9('0x41')]);_0x31a41d[_0x47f9('0x2e')]=_[_0x47f9('0x2f')](_0x37a36f[_0x47f9('0x2e')]);_0x31a41d[_0x47f9('0x30')]=_[_0x47f9('0x31')](_0x31a41d['model'],_0x31a41d['query']);_0x55dc03[_0x47f9('0x32')]=_[_0x47f9('0x31')](_0x31a41d['model'],qs[_0x47f9('0x42')](_0x37a36f[_0x47f9('0x2e')][_0x47f9('0x42')]));_0x55dc03[_0x47f9('0x32')]=_0x55dc03['attributes']['length']?_0x55dc03['attributes']:_0x31a41d[_0x47f9('0x2c')];if(_0x37a36f[_0x47f9('0x2e')][_0x47f9('0x43')]){_0x55dc03[_0x47f9('0x44')]=[{'all':!![]}];}_0x55dc03=_[_0x47f9('0x3b')]({},_0x55dc03,_0x37a36f['options']);return db[_0x47f9('0x28')][_0x47f9('0x45')](_0x55dc03)['then'](handleEntityNotFound(_0x254840,null))['then'](respondWithResult(_0x254840,null))[_0x47f9('0x3f')](handleError(_0x254840,null));};exports[_0x47f9('0x46')]=function(_0x3bd922,_0x3677e1){return db[_0x47f9('0x28')][_0x47f9('0x46')](_0x3bd922['body'],{})[_0x47f9('0x22')](respondWithResult(_0x3677e1,0xc9))[_0x47f9('0x3f')](handleError(_0x3677e1,null));};exports[_0x47f9('0x47')]=function(_0x4907a5,_0x2b8fd9){if(_0x4907a5[_0x47f9('0x48')]['id']){delete _0x4907a5[_0x47f9('0x48')]['id'];}return db[_0x47f9('0x28')]['find']({'where':{'id':_0x4907a5[_0x47f9('0x40')]['id']}})['then'](handleEntityNotFound(_0x2b8fd9,null))[_0x47f9('0x22')](saveUpdates(_0x4907a5[_0x47f9('0x48')],null))[_0x47f9('0x22')](respondWithResult(_0x2b8fd9,null))[_0x47f9('0x3f')](handleError(_0x2b8fd9,null));};exports['destroy']=function(_0x26c1d8,_0x4af39e){return db[_0x47f9('0x28')][_0x47f9('0x45')]({'where':{'id':_0x26c1d8['params']['id']}})[_0x47f9('0x22')](handleEntityNotFound(_0x4af39e,null))[_0x47f9('0x22')](removeEntity(_0x4af39e,null))['catch'](handleError(_0x4af39e,null));}; \ No newline at end of file +var _0x4163=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','length','find','catch','create','body','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','send','map','SugarcrmField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x5c2b52,_0x4fa1bd){var _0x2819b0=function(_0x59ffca){while(--_0x59ffca){_0x5c2b52['push'](_0x5c2b52['shift']());}};_0x2819b0(++_0x4fa1bd);}(_0x4163,0x9b));var _0x3416=function(_0x7b360c,_0x5cec49){_0x7b360c=_0x7b360c-0x0;var _0x2dad8e=_0x4163[_0x7b360c];return _0x2dad8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3416('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3416('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3416('0x2'));var Mustache=require(_0x3416('0x3'));var util=require(_0x3416('0x4'));var path=require(_0x3416('0x5'));var sox=require(_0x3416('0x6'));var csv=require(_0x3416('0x7'));var ejs=require(_0x3416('0x8'));var fs=require('fs');var fs_extra=require(_0x3416('0x9'));var _=require(_0x3416('0xa'));var squel=require('squel');var crypto=require(_0x3416('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3416('0x7'));var querystring=require(_0x3416('0xc'));var Papa=require(_0x3416('0xd'));var Redis=require(_0x3416('0xe'));var authService=require(_0x3416('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3416('0x10'));var hardwareService=require(_0x3416('0x11'));var logger=require('../../config/logger')(_0x3416('0x12'));var utils=require(_0x3416('0x13'));var config=require(_0x3416('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1003a9,_0xacdb23){_0xacdb23=_0xacdb23||0xcc;return function(_0x59daee){if(_0x59daee){return _0x1003a9[_0x3416('0x15')](_0xacdb23);}return _0x1003a9['status'](_0xacdb23)['end']();};}function respondWithResult(_0xa317e6,_0x2cf308){_0x2cf308=_0x2cf308||0xc8;return function(_0x308408){if(_0x308408){return _0xa317e6[_0x3416('0x16')](_0x2cf308)[_0x3416('0x17')](_0x308408);}};}function respondWithFilteredResult(_0x51264,_0x41b0c0){return function(_0xc46753){if(_0xc46753){var _0x41beda=typeof _0x41b0c0[_0x3416('0x18')]===_0x3416('0x19')&&typeof _0x41b0c0[_0x3416('0x1a')]===_0x3416('0x19');var _0x4e39e1=_0xc46753[_0x3416('0x1b')];var _0x13f270=_0x41beda?0x0:_0x41b0c0['offset'];var _0x343a9f=_0x41beda?_0xc46753['count']:_0x41b0c0[_0x3416('0x18')]+_0x41b0c0[_0x3416('0x1a')];var _0x469e34;if(_0x343a9f>=_0x4e39e1){_0x343a9f=_0x4e39e1;_0x469e34=0xc8;}else{_0x469e34=0xce;}_0x51264['status'](_0x469e34);return _0x51264[_0x3416('0x1c')](_0x3416('0x1d'),_0x13f270+'-'+_0x343a9f+'/'+_0x4e39e1)[_0x3416('0x17')](_0xc46753);}return null;};}function patchUpdates(_0x5663c9){return function(_0x5d1e40){try{jsonpatch[_0x3416('0x1e')](_0x5d1e40,_0x5663c9,!![]);}catch(_0x5f406b){return BPromise[_0x3416('0x1f')](_0x5f406b);}return _0x5d1e40[_0x3416('0x20')]();};}function saveUpdates(_0x5ada14,_0x1ebca2){return function(_0xe1a1f){if(_0xe1a1f){return _0xe1a1f['update'](_0x5ada14)['then'](function(_0xf350c3){return _0xf350c3;});}return null;};}function removeEntity(_0x4087d9,_0x215de0){return function(_0x40d636){if(_0x40d636){return _0x40d636[_0x3416('0x21')]()[_0x3416('0x22')](function(){_0x4087d9[_0x3416('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5f45,_0x22681a){return function(_0x4e57df){if(!_0x4e57df){_0x2c5f45[_0x3416('0x15')](0x194);}return _0x4e57df;};}function handleError(_0x4d0b02,_0xd04ee8){_0xd04ee8=_0xd04ee8||0x1f4;return function(_0x2642e4){logger['error'](_0x2642e4[_0x3416('0x23')]);if(_0x2642e4['name']){delete _0x2642e4['name'];}_0x4d0b02['status'](_0xd04ee8)[_0x3416('0x24')](_0x2642e4);};}exports['index']=function(_0x1121d8,_0x465ceb){var _0x8ecee4={},_0x5661e7={},_0x522712={'count':0x0,'rows':[]};var _0x407610=_[_0x3416('0x25')](db[_0x3416('0x26')][_0x3416('0x27')],function(_0x5094cf){return{'name':_0x5094cf[_0x3416('0x28')],'type':_0x5094cf[_0x3416('0x29')][_0x3416('0x2a')]};});_0x5661e7[_0x3416('0x2b')]=_['map'](_0x407610,_0x3416('0x2c'));_0x5661e7[_0x3416('0x2d')]=_[_0x3416('0x2e')](_0x1121d8['query']);_0x5661e7[_0x3416('0x2f')]=_['intersection'](_0x5661e7[_0x3416('0x2b')],_0x5661e7['query']);_0x8ecee4[_0x3416('0x30')]=_['intersection'](_0x5661e7[_0x3416('0x2b')],qs[_0x3416('0x31')](_0x1121d8[_0x3416('0x2d')]['fields']));_0x8ecee4['attributes']=_0x8ecee4[_0x3416('0x30')]['length']?_0x8ecee4[_0x3416('0x30')]:_0x5661e7[_0x3416('0x2b')];if(!_0x1121d8['query']['hasOwnProperty'](_0x3416('0x32'))){_0x8ecee4[_0x3416('0x1a')]=qs['limit'](_0x1121d8[_0x3416('0x2d')][_0x3416('0x1a')]);_0x8ecee4['offset']=qs[_0x3416('0x18')](_0x1121d8[_0x3416('0x2d')][_0x3416('0x18')]);}_0x8ecee4[_0x3416('0x33')]=qs[_0x3416('0x34')](_0x1121d8[_0x3416('0x2d')]['sort']);_0x8ecee4[_0x3416('0x35')]=qs[_0x3416('0x2f')](_[_0x3416('0x36')](_0x1121d8[_0x3416('0x2d')],_0x5661e7[_0x3416('0x2f')]),_0x407610);if(_0x1121d8[_0x3416('0x2d')][_0x3416('0x37')]){_0x8ecee4[_0x3416('0x35')]=_[_0x3416('0x38')](_0x8ecee4['where'],{'$or':_['map'](_0x407610,function(_0x3fd3b5){if(_0x3fd3b5[_0x3416('0x29')]!==_0x3416('0x39')){var _0x4d2f30={};_0x4d2f30[_0x3fd3b5['name']]={'$like':'%'+_0x1121d8[_0x3416('0x2d')][_0x3416('0x37')]+'%'};return _0x4d2f30;}})});}_0x8ecee4=_[_0x3416('0x38')]({},_0x8ecee4,_0x1121d8[_0x3416('0x3a')]);var _0x1da0bd={'where':_0x8ecee4['where']};return db[_0x3416('0x26')][_0x3416('0x1b')](_0x1da0bd)[_0x3416('0x22')](function(_0x1a982c){_0x522712[_0x3416('0x1b')]=_0x1a982c;if(_0x1121d8['query'][_0x3416('0x3b')]){_0x8ecee4[_0x3416('0x3c')]=[{'all':!![]}];}return db[_0x3416('0x26')][_0x3416('0x3d')](_0x8ecee4);})[_0x3416('0x22')](function(_0x56b207){_0x522712[_0x3416('0x3e')]=_0x56b207;return _0x522712;})['then'](respondWithFilteredResult(_0x465ceb,_0x8ecee4))['catch'](handleError(_0x465ceb,null));};exports['show']=function(_0x2f2669,_0x3b4cc8){var _0x183fb3={'raw':!![],'where':{'id':_0x2f2669[_0x3416('0x3f')]['id']}},_0x2b23f6={};_0x2b23f6['model']=_[_0x3416('0x2e')](db[_0x3416('0x26')][_0x3416('0x27')]);_0x2b23f6[_0x3416('0x2d')]=_['keys'](_0x2f2669[_0x3416('0x2d')]);_0x2b23f6['filters']=_[_0x3416('0x40')](_0x2b23f6[_0x3416('0x2b')],_0x2b23f6[_0x3416('0x2d')]);_0x183fb3[_0x3416('0x30')]=_[_0x3416('0x40')](_0x2b23f6[_0x3416('0x2b')],qs['fields'](_0x2f2669[_0x3416('0x2d')][_0x3416('0x31')]));_0x183fb3[_0x3416('0x30')]=_0x183fb3[_0x3416('0x30')][_0x3416('0x41')]?_0x183fb3[_0x3416('0x30')]:_0x2b23f6['model'];if(_0x2f2669[_0x3416('0x2d')][_0x3416('0x3b')]){_0x183fb3[_0x3416('0x3c')]=[{'all':!![]}];}_0x183fb3=_[_0x3416('0x38')]({},_0x183fb3,_0x2f2669[_0x3416('0x3a')]);return db[_0x3416('0x26')][_0x3416('0x42')](_0x183fb3)['then'](handleEntityNotFound(_0x3b4cc8,null))[_0x3416('0x22')](respondWithResult(_0x3b4cc8,null))[_0x3416('0x43')](handleError(_0x3b4cc8,null));};exports[_0x3416('0x44')]=function(_0x1af7e2,_0x54effb){return db[_0x3416('0x26')][_0x3416('0x44')](_0x1af7e2['body'],{})['then'](respondWithResult(_0x54effb,0xc9))[_0x3416('0x43')](handleError(_0x54effb,null));};exports['update']=function(_0x32efd7,_0x3e9c47){if(_0x32efd7[_0x3416('0x45')]['id']){delete _0x32efd7['body']['id'];}return db[_0x3416('0x26')][_0x3416('0x42')]({'where':{'id':_0x32efd7[_0x3416('0x3f')]['id']}})[_0x3416('0x22')](handleEntityNotFound(_0x3e9c47,null))['then'](saveUpdates(_0x32efd7['body'],null))['then'](respondWithResult(_0x3e9c47,null))[_0x3416('0x43')](handleError(_0x3e9c47,null));};exports[_0x3416('0x21')]=function(_0x6cede7,_0xd1b2da){return db[_0x3416('0x26')][_0x3416('0x42')]({'where':{'id':_0x6cede7[_0x3416('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd1b2da,null))['then'](removeEntity(_0xd1b2da,null))[_0x3416('0x43')](handleError(_0xd1b2da,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c2ed17d..b318e6d 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 _0x52b0=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x39aedb,_0x11ec9c){var _0x1e016f=function(_0x4bd971){while(--_0x4bd971){_0x39aedb['push'](_0x39aedb['shift']());}};_0x1e016f(++_0x11ec9c);}(_0x52b0,0xa2));var _0x052b=function(_0x1a6753,_0x42455d){_0x1a6753=_0x1a6753-0x0;var _0x404a8e=_0x52b0[_0x1a6753];return _0x404a8e;};'use strict';var _=require(_0x052b('0x0'));var util=require(_0x052b('0x1'));var logger=require(_0x052b('0x2'))(_0x052b('0x3'));var moment=require(_0x052b('0x4'));var BPromise=require(_0x052b('0x5'));var rp=require(_0x052b('0x6'));var fs=require('fs');var path=require(_0x052b('0x7'));var rimraf=require(_0x052b('0x8'));var config=require('../../config/environment');var attributes=require(_0x052b('0x9'));module[_0x052b('0xa')]=function(_0x13ea7e,_0xa4b3e4){return _0x13ea7e[_0x052b('0xb')]('SugarcrmField',attributes,{'tableName':_0x052b('0xc'),'paranoid':![],'indexes':[{'name':_0x052b('0xd'),'fields':[_0x052b('0xe'),_0x052b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb6ed=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0xfa920b,_0x4a5714){var _0x204248=function(_0x3662cd){while(--_0x3662cd){_0xfa920b['push'](_0xfa920b['shift']());}};_0x204248(++_0x4a5714);}(_0xb6ed,0xa1));var _0xdb6e=function(_0x384444,_0x3467ac){_0x384444=_0x384444-0x0;var _0x4fca70=_0xb6ed[_0x384444];return _0x4fca70;};'use strict';var _=require(_0xdb6e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdb6e('0x1'));var rp=require(_0xdb6e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb6e('0x3'));var config=require(_0xdb6e('0x4'));var attributes=require('./intSugarcrmField.attributes');module[_0xdb6e('0x5')]=function(_0xbf7aae,_0x19d2f0){return _0xbf7aae[_0xdb6e('0x6')](_0xdb6e('0x7'),attributes,{'tableName':_0xdb6e('0x8'),'paranoid':![],'indexes':[{'name':_0xdb6e('0x9'),'fields':[_0xdb6e('0xa'),_0xdb6e('0xb')],'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 3c8319f..579a92f 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 _0x0c64=['result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','error','code','SugarcrmField,\x20%s,\x20%s','message'];(function(_0x753a72,_0x265d7a){var _0x3efd3a=function(_0x142d2b){while(--_0x142d2b){_0x753a72['push'](_0x753a72['shift']());}};_0x3efd3a(++_0x265d7a);}(_0x0c64,0x191));var _0x40c6=function(_0x107b69,_0x50f717){_0x107b69=_0x107b69-0x0;var _0x4cff15=_0x0c64[_0x107b69];return _0x4cff15;};'use strict';var _=require(_0x40c6('0x0'));var util=require(_0x40c6('0x1'));var moment=require('moment');var BPromise=require(_0x40c6('0x2'));var rs=require(_0x40c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x40c6('0x4'));var logger=require(_0x40c6('0x5'))(_0x40c6('0x6'));var config=require('../../config/environment');var jayson=require(_0x40c6('0x7'));var client=jayson['client'][_0x40c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c2e36,_0x3f1234,_0x34db68){return new BPromise(function(_0x308897,_0x417406){return client['request'](_0x1c2e36,_0x34db68)[_0x40c6('0x9')](function(_0x18136f){logger[_0x40c6('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x3f1234,_0x40c6('0xb'));logger[_0x40c6('0xc')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3f1234,'request\x20sent',JSON['stringify'](_0x18136f));if(_0x18136f['error']){if(_0x18136f[_0x40c6('0xd')][_0x40c6('0xe')]===0x1f4){logger['error'](_0x40c6('0xf'),_0x3f1234,_0x18136f['error'][_0x40c6('0x10')]);return _0x417406(_0x18136f[_0x40c6('0xd')][_0x40c6('0x10')]);}logger[_0x40c6('0xd')](_0x40c6('0xf'),_0x3f1234,_0x18136f[_0x40c6('0xd')][_0x40c6('0x10')]);return _0x308897(_0x18136f[_0x40c6('0xd')][_0x40c6('0x10')]);}else{logger[_0x40c6('0xa')](_0x40c6('0xf'),_0x3f1234,_0x40c6('0xb'));_0x308897(_0x18136f[_0x40c6('0x11')]['message']);}})[_0x40c6('0x12')](function(_0x24f906){logger[_0x40c6('0xd')](_0x40c6('0xf'),_0x3f1234,_0x24f906);_0x417406(_0x24f906);});});} \ No newline at end of file +var _0xafb1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x84fd2,_0x1c6bdd){var _0x3e869e=function(_0x2f60ee){while(--_0x2f60ee){_0x84fd2['push'](_0x84fd2['shift']());}};_0x3e869e(++_0x1c6bdd);}(_0xafb1,0x189));var _0x1afb=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0xafb1[_0x2e4a0f];return _0x25a3cd;};'use strict';var _=require('lodash');var util=require(_0x1afb('0x0'));var moment=require(_0x1afb('0x1'));var BPromise=require(_0x1afb('0x2'));var rs=require(_0x1afb('0x3'));var fs=require('fs');var Redis=require(_0x1afb('0x4'));var db=require(_0x1afb('0x5'))['db'];var utils=require(_0x1afb('0x6'));var logger=require(_0x1afb('0x7'))(_0x1afb('0x8'));var config=require(_0x1afb('0x9'));var jayson=require(_0x1afb('0xa'));var client=jayson[_0x1afb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c7d47,_0x5003ef,_0x9dec07){return new BPromise(function(_0x147ddc,_0x157ff9){return client['request'](_0x1c7d47,_0x9dec07)['then'](function(_0x448704){logger[_0x1afb('0xc')](_0x1afb('0xd'),_0x5003ef,_0x1afb('0xe'));logger[_0x1afb('0xf')](_0x1afb('0x10'),_0x5003ef,_0x1afb('0xe'),JSON['stringify'](_0x448704));if(_0x448704['error']){if(_0x448704[_0x1afb('0x11')][_0x1afb('0x12')]===0x1f4){logger[_0x1afb('0x11')](_0x1afb('0xd'),_0x5003ef,_0x448704[_0x1afb('0x11')][_0x1afb('0x13')]);return _0x157ff9(_0x448704[_0x1afb('0x11')][_0x1afb('0x13')]);}logger['error'](_0x1afb('0xd'),_0x5003ef,_0x448704['error'][_0x1afb('0x13')]);return _0x147ddc(_0x448704[_0x1afb('0x11')][_0x1afb('0x13')]);}else{logger[_0x1afb('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x5003ef,_0x1afb('0xe'));_0x147ddc(_0x448704['result'][_0x1afb('0x13')]);}})[_0x1afb('0x14')](function(_0x34df2a){logger[_0x1afb('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x5003ef,_0x34df2a);_0x157ff9(_0x34df2a);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 87bf179..1d3bfec 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 _0xffcc=['index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xffcc,0x112));var _0xcffc=function(_0xba2640,_0x50928a){_0xba2640=_0xba2640-0x0;var _0xb2272b=_0xffcc[_0xba2640];return _0xb2272b;};'use strict';var multer=require('multer');var util=require(_0xcffc('0x0'));var path=require('path');var timeout=require(_0xcffc('0x1'));var express=require(_0xcffc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcffc('0x3'));var config=require('../../config/environment');var controller=require(_0xcffc('0x4'));router['get']('/',auth[_0xcffc('0x5')](),controller[_0xcffc('0x6')]);router[_0xcffc('0x7')](_0xcffc('0x8'),auth['isAuthenticated'](),controller[_0xcffc('0x9')]);router[_0xcffc('0x7')](_0xcffc('0xa'),auth['isAuthenticated'](),controller[_0xcffc('0xb')]);router['get'](_0xcffc('0xc'),auth[_0xcffc('0x5')](),controller[_0xcffc('0xd')]);router['post']('/',auth[_0xcffc('0x5')](),controller['create']);router['post'](_0xcffc('0xa'),auth[_0xcffc('0x5')](),controller[_0xcffc('0xe')]);router[_0xcffc('0xf')](_0xcffc('0x8'),auth[_0xcffc('0x5')](),controller[_0xcffc('0x10')]);router[_0xcffc('0x11')]('/:id',auth[_0xcffc('0x5')](),controller[_0xcffc('0x12')]);module[_0xcffc('0x13')]=router; \ No newline at end of file +var _0x79c6=['update','/:id','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79c6,0x81));var _0x679c=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x79c6[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x679c('0x0'));var util=require('util');var path=require(_0x679c('0x1'));var timeout=require(_0x679c('0x2'));var express=require(_0x679c('0x3'));var router=express[_0x679c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x679c('0x5'));var config=require(_0x679c('0x6'));var controller=require(_0x679c('0x7'));router[_0x679c('0x8')]('/',auth[_0x679c('0x9')](),controller[_0x679c('0xa')]);router[_0x679c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x679c('0xb')]);router[_0x679c('0x8')](_0x679c('0xc'),auth[_0x679c('0x9')](),controller[_0x679c('0xd')]);router[_0x679c('0x8')](_0x679c('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x679c('0x9')](),controller[_0x679c('0xf')]);router['post']('/:id/configurations',auth[_0x679c('0x9')](),controller[_0x679c('0x10')]);router[_0x679c('0x11')]('/:id',auth[_0x679c('0x9')](),controller[_0x679c('0x12')]);router['delete'](_0x679c('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x679c('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index e4a0d0a..ff0414c 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 _0x2dc6=['sequelize','exports','STRING','HelpDesk'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x2dc6,0xcc));var _0x62dc=function(_0x4a231a,_0x40362f){_0x4a231a=_0x4a231a-0x0;var _0x466ef2=_0x2dc6[_0x4a231a];return _0x466ef2;};'use strict';var Sequelize=require(_0x62dc('0x0'));module[_0x62dc('0x1')]={'name':{'type':Sequelize[_0x62dc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x62dc('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x62dc('0x2')],'allowNull':![],'defaultValue':_0x62dc('0x3')},'remoteUri':{'type':Sequelize[_0x62dc('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x62dc('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x60f4=['sequelize','exports','STRING'];(function(_0x2cdba8,_0x1dc6a7){var _0x5e293c=function(_0x20fa19){while(--_0x20fa19){_0x2cdba8['push'](_0x2cdba8['shift']());}};_0x5e293c(++_0x1dc6a7);}(_0x60f4,0x1e0));var _0x460f=function(_0x472439,_0x17941f){_0x472439=_0x472439-0x0;var _0x59a781=_0x60f4[_0x472439];return _0x59a781;};'use strict';var Sequelize=require(_0x460f('0x0'));module[_0x460f('0x1')]={'name':{'type':Sequelize[_0x460f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x460f('0x2')]},'username':{'type':Sequelize[_0x460f('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x460f('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x460f('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x460f('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 70e1977..e190afa 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 _0x48cc=['VtigerConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','VtigerField','md5','username','description','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','POST','login','result','token','describe','sessionName','autogenerated','owner','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','send','index','map','VtigerAccount','rawAttributes','type','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','getConfigurations','findOne'];(function(_0x3bb07d,_0x500483){var _0x459eb4=function(_0x3f4894){while(--_0x3f4894){_0x3bb07d['push'](_0x3bb07d['shift']());}};_0x459eb4(++_0x500483);}(_0x48cc,0x112));var _0xc48c=function(_0x3c7ece,_0x49c766){_0x3c7ece=_0x3c7ece-0x0;var _0x5587d5=_0x48cc[_0x3c7ece];return _0x5587d5;};'use strict';var emlformat=require(_0xc48c('0x0'));var rimraf=require(_0xc48c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc48c('0x2'));var rp=require(_0xc48c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc48c('0x4'));var util=require(_0xc48c('0x5'));var path=require(_0xc48c('0x6'));var sox=require('sox');var csv=require(_0xc48c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc48c('0x8'));var _=require('lodash');var squel=require(_0xc48c('0x9'));var crypto=require(_0xc48c('0xa'));var jsforce=require(_0xc48c('0xb'));var deskjs=require(_0xc48c('0xc'));var toCsv=require(_0xc48c('0x7'));var querystring=require(_0xc48c('0xd'));var Papa=require(_0xc48c('0xe'));var Redis=require(_0xc48c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc48c('0x10'));var as=require(_0xc48c('0x11'));var hardwareService=require(_0xc48c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc48c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc48c('0x14'));var db=require(_0xc48c('0x15'))['db'];var integrations=require(_0xc48c('0x16'));function respondWithStatusCode(_0x52bf73,_0x4f7b3f){_0x4f7b3f=_0x4f7b3f||0xcc;return function(_0xf3417e){if(_0xf3417e){return _0x52bf73[_0xc48c('0x17')](_0x4f7b3f);}return _0x52bf73[_0xc48c('0x18')](_0x4f7b3f)[_0xc48c('0x19')]();};}function respondWithResult(_0xe74967,_0x50d563){_0x50d563=_0x50d563||0xc8;return function(_0x265998){if(_0x265998){return _0xe74967[_0xc48c('0x18')](_0x50d563)[_0xc48c('0x1a')](_0x265998);}};}function respondWithFilteredResult(_0x5e7c82,_0x2fe7ab){return function(_0x350b75){if(_0x350b75){var _0x2a93ef=typeof _0x2fe7ab['offset']===_0xc48c('0x1b')&&typeof _0x2fe7ab['limit']===_0xc48c('0x1b');var _0x7c960f=_0x350b75['count'];var _0x31c6c5=_0x2a93ef?0x0:_0x2fe7ab[_0xc48c('0x1c')];var _0x3e13ef=_0x2a93ef?_0x350b75[_0xc48c('0x1d')]:_0x2fe7ab[_0xc48c('0x1c')]+_0x2fe7ab[_0xc48c('0x1e')];var _0x3f317c;if(_0x3e13ef>=_0x7c960f){_0x3e13ef=_0x7c960f;_0x3f317c=0xc8;}else{_0x3f317c=0xce;}_0x5e7c82[_0xc48c('0x18')](_0x3f317c);return _0x5e7c82[_0xc48c('0x1f')](_0xc48c('0x20'),_0x31c6c5+'-'+_0x3e13ef+'/'+_0x7c960f)['json'](_0x350b75);}return null;};}function patchUpdates(_0x40bc43){return function(_0x3d201b){try{jsonpatch[_0xc48c('0x21')](_0x3d201b,_0x40bc43,!![]);}catch(_0x42f0ba){return BPromise['reject'](_0x42f0ba);}return _0x3d201b[_0xc48c('0x22')]();};}function saveUpdates(_0xb82983,_0x39bcc3){return function(_0x293bdb){if(_0x293bdb){return _0x293bdb[_0xc48c('0x23')](_0xb82983)['then'](function(_0x17de93){return _0x17de93;});}return null;};}function removeEntity(_0x1f259f,_0x4fbcdb){return function(_0x3b3687){if(_0x3b3687){return _0x3b3687[_0xc48c('0x24')]()[_0xc48c('0x25')](function(){_0x1f259f[_0xc48c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274983,_0x4ea657){return function(_0x5c2e89){if(!_0x5c2e89){_0x274983[_0xc48c('0x17')](0x194);}return _0x5c2e89;};}function handleError(_0x1d900f,_0xf8be73){_0xf8be73=_0xf8be73||0x1f4;return function(_0x17778d){logger[_0xc48c('0x26')](_0x17778d[_0xc48c('0x27')]);if(_0x17778d['name']){delete _0x17778d['name'];}_0x1d900f[_0xc48c('0x18')](_0xf8be73)[_0xc48c('0x28')](_0x17778d);};}exports[_0xc48c('0x29')]=function(_0x2f63b4,_0xe4e2a5){var _0x5d8102={},_0x377843={},_0x22319d={'count':0x0,'rows':[]};var _0x55bcfe=_[_0xc48c('0x2a')](db[_0xc48c('0x2b')][_0xc48c('0x2c')],function(_0x39b372){return{'name':_0x39b372['fieldName'],'type':_0x39b372[_0xc48c('0x2d')]['key']};});_0x377843['model']=_['map'](_0x55bcfe,_0xc48c('0x2e'));_0x377843[_0xc48c('0x2f')]=_[_0xc48c('0x30')](_0x2f63b4[_0xc48c('0x2f')]);_0x377843['filters']=_[_0xc48c('0x31')](_0x377843[_0xc48c('0x32')],_0x377843[_0xc48c('0x2f')]);_0x5d8102[_0xc48c('0x33')]=_['intersection'](_0x377843[_0xc48c('0x32')],qs[_0xc48c('0x34')](_0x2f63b4[_0xc48c('0x2f')][_0xc48c('0x34')]));_0x5d8102[_0xc48c('0x33')]=_0x5d8102[_0xc48c('0x33')][_0xc48c('0x35')]?_0x5d8102['attributes']:_0x377843['model'];if(!_0x2f63b4[_0xc48c('0x2f')][_0xc48c('0x36')](_0xc48c('0x37'))){_0x5d8102['limit']=qs[_0xc48c('0x1e')](_0x2f63b4['query'][_0xc48c('0x1e')]);_0x5d8102[_0xc48c('0x1c')]=qs[_0xc48c('0x1c')](_0x2f63b4[_0xc48c('0x2f')]['offset']);}_0x5d8102[_0xc48c('0x38')]=qs[_0xc48c('0x39')](_0x2f63b4['query'][_0xc48c('0x39')]);_0x5d8102[_0xc48c('0x3a')]=qs[_0xc48c('0x3b')](_[_0xc48c('0x3c')](_0x2f63b4[_0xc48c('0x2f')],_0x377843[_0xc48c('0x3b')]),_0x55bcfe);if(_0x2f63b4[_0xc48c('0x2f')][_0xc48c('0x3d')]){_0x5d8102['where']=_[_0xc48c('0x3e')](_0x5d8102[_0xc48c('0x3a')],{'$or':_[_0xc48c('0x2a')](_0x55bcfe,function(_0x154949){if(_0x154949[_0xc48c('0x2d')]!==_0xc48c('0x3f')){var _0xc170a2={};_0xc170a2[_0x154949[_0xc48c('0x2e')]]={'$like':'%'+_0x2f63b4['query'][_0xc48c('0x3d')]+'%'};return _0xc170a2;}})});}_0x5d8102=_[_0xc48c('0x3e')]({},_0x5d8102,_0x2f63b4['options']);var _0x496795={'where':_0x5d8102[_0xc48c('0x3a')]};return db[_0xc48c('0x2b')][_0xc48c('0x1d')](_0x496795)[_0xc48c('0x25')](function(_0x5ad7a3){_0x22319d['count']=_0x5ad7a3;if(_0x2f63b4['query']['includeAll']){_0x5d8102[_0xc48c('0x40')]=[{'all':!![]}];}return db['VtigerAccount'][_0xc48c('0x41')](_0x5d8102);})[_0xc48c('0x25')](function(_0x365be1){_0x22319d[_0xc48c('0x42')]=_0x365be1;return _0x22319d;})[_0xc48c('0x25')](respondWithFilteredResult(_0xe4e2a5,_0x5d8102))[_0xc48c('0x43')](handleError(_0xe4e2a5,null));};exports[_0xc48c('0x44')]=function(_0x22562d,_0x13a6f3){var _0x1ca870={'raw':![],'where':{'id':_0x22562d[_0xc48c('0x45')]['id']}},_0x24f955={};_0x24f955[_0xc48c('0x32')]=_[_0xc48c('0x30')](db[_0xc48c('0x2b')][_0xc48c('0x2c')]);_0x24f955[_0xc48c('0x2f')]=_[_0xc48c('0x30')](_0x22562d[_0xc48c('0x2f')]);_0x24f955['filters']=_[_0xc48c('0x31')](_0x24f955['model'],_0x24f955[_0xc48c('0x2f')]);_0x1ca870[_0xc48c('0x33')]=_[_0xc48c('0x31')](_0x24f955['model'],qs[_0xc48c('0x34')](_0x22562d[_0xc48c('0x2f')][_0xc48c('0x34')]));_0x1ca870[_0xc48c('0x33')]=_0x1ca870['attributes'][_0xc48c('0x35')]?_0x1ca870[_0xc48c('0x33')]:_0x24f955[_0xc48c('0x32')];if(_0x22562d[_0xc48c('0x2f')][_0xc48c('0x46')]){_0x1ca870[_0xc48c('0x40')]=[{'all':!![]}];}_0x1ca870=_['merge']({},_0x1ca870,_0x22562d[_0xc48c('0x47')]);return db[_0xc48c('0x2b')][_0xc48c('0x48')](_0x1ca870)['then'](handleEntityNotFound(_0x13a6f3,null))[_0xc48c('0x25')](respondWithResult(_0x13a6f3,null))[_0xc48c('0x43')](handleError(_0x13a6f3,null));};exports[_0xc48c('0x49')]=function(_0x214a1c,_0x166e62){return db[_0xc48c('0x2b')][_0xc48c('0x49')](_0x214a1c[_0xc48c('0x4a')],{})['then'](respondWithResult(_0x166e62,0xc9))[_0xc48c('0x43')](handleError(_0x166e62,null));};exports[_0xc48c('0x23')]=function(_0x48bc5d,_0x2e53d3){if(_0x48bc5d['body']['id']){delete _0x48bc5d[_0xc48c('0x4a')]['id'];}return db[_0xc48c('0x2b')]['find']({'where':{'id':_0x48bc5d[_0xc48c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e53d3,null))[_0xc48c('0x25')](saveUpdates(_0x48bc5d[_0xc48c('0x4a')],null))[_0xc48c('0x25')](respondWithResult(_0x2e53d3,null))[_0xc48c('0x43')](handleError(_0x2e53d3,null));};exports[_0xc48c('0x24')]=function(_0x40bebe,_0x22e24f){return db[_0xc48c('0x2b')][_0xc48c('0x48')]({'where':{'id':_0x40bebe[_0xc48c('0x45')]['id']}})[_0xc48c('0x25')](handleEntityNotFound(_0x22e24f,null))[_0xc48c('0x25')](removeEntity(_0x22e24f,null))[_0xc48c('0x43')](handleError(_0x22e24f,null));};exports[_0xc48c('0x4b')]=function(_0x40eb8,_0x13cbb7,_0x202bfa){var _0xe0bf20={};var _0x1ec9a2={};var _0x4e1efd;var _0x1b5b54;return db[_0xc48c('0x2b')][_0xc48c('0x4c')]({'where':{'id':_0x40eb8[_0xc48c('0x45')]['id']}})['then'](handleEntityNotFound(_0x13cbb7,null))[_0xc48c('0x25')](function(_0x533bb9){if(_0x533bb9){_0x4e1efd=_0x533bb9;_0x1ec9a2[_0xc48c('0x32')]=_[_0xc48c('0x30')](db[_0xc48c('0x4d')][_0xc48c('0x2c')]);_0x1ec9a2[_0xc48c('0x2f')]=_[_0xc48c('0x30')](_0x40eb8[_0xc48c('0x2f')]);_0x1ec9a2[_0xc48c('0x3b')]=_['intersection'](_0x1ec9a2[_0xc48c('0x32')],_0x1ec9a2[_0xc48c('0x2f')]);_0xe0bf20['attributes']=_[_0xc48c('0x31')](_0x1ec9a2['model'],qs[_0xc48c('0x34')](_0x40eb8['query'][_0xc48c('0x34')]));_0xe0bf20[_0xc48c('0x33')]=_0xe0bf20[_0xc48c('0x33')][_0xc48c('0x35')]?_0xe0bf20[_0xc48c('0x33')]:_0x1ec9a2[_0xc48c('0x32')];_0xe0bf20['order']=qs['sort'](_0x40eb8[_0xc48c('0x2f')]['sort']);_0xe0bf20['where']=qs[_0xc48c('0x3b')](_[_0xc48c('0x3c')](_0x40eb8[_0xc48c('0x2f')],_0x1ec9a2[_0xc48c('0x3b')]));if(_0x40eb8[_0xc48c('0x2f')][_0xc48c('0x3d')]){_0xe0bf20[_0xc48c('0x3a')]=_[_0xc48c('0x3e')](_0xe0bf20[_0xc48c('0x3a')],{'$or':_[_0xc48c('0x2a')](_0xe0bf20[_0xc48c('0x33')],function(_0x3cfe07){var _0x3fbb38={};_0x3fbb38[_0x3cfe07]={'$like':'%'+_0x40eb8['query'][_0xc48c('0x3d')]+'%'};return _0x3fbb38;})});}_0xe0bf20=_['merge']({},_0xe0bf20,_0x40eb8[_0xc48c('0x47')]);return _0x4e1efd[_0xc48c('0x4b')](_0xe0bf20);}})[_0xc48c('0x25')](function(_0x3cbd9b){if(_0x3cbd9b){_0x1b5b54=_0x3cbd9b[_0xc48c('0x35')];if(!_0x40eb8[_0xc48c('0x2f')][_0xc48c('0x36')]('nolimit')){_0xe0bf20[_0xc48c('0x1e')]=qs[_0xc48c('0x1e')](_0x40eb8['query'][_0xc48c('0x1e')]);_0xe0bf20['offset']=qs[_0xc48c('0x1c')](_0x40eb8[_0xc48c('0x2f')][_0xc48c('0x1c')]);}return _0x4e1efd['getConfigurations'](_0xe0bf20);}})[_0xc48c('0x25')](function(_0x3ed1ce){if(_0x3ed1ce){return _0x3ed1ce?{'count':_0x1b5b54,'rows':_0x3ed1ce}:null;}})[_0xc48c('0x25')](respondWithResult(_0x13cbb7,null))[_0xc48c('0x43')](handleError(_0x13cbb7,null));};exports[_0xc48c('0x4e')]=function(_0x52ed7c,_0x77fbf3,_0x272104){if(_0x52ed7c[_0xc48c('0x4a')]['id']){delete _0x52ed7c[_0xc48c('0x4a')]['id'];}return db['VtigerAccount'][_0xc48c('0x4c')]({'where':{'id':_0x52ed7c[_0xc48c('0x45')]['id']}})['then'](handleEntityNotFound(_0x77fbf3,null))[_0xc48c('0x25')](function(_0x33278e){if(_0x33278e){_0x52ed7c[_0xc48c('0x4a')][_0xc48c('0x4f')]=_0x33278e['id'];_0x52ed7c[_0xc48c('0x4a')]['Subjects']=integrations[_0xc48c('0x50')](_0x52ed7c['body'][_0xc48c('0x51')],_0x52ed7c['body']['type']);_0x52ed7c[_0xc48c('0x4a')][_0xc48c('0x52')]=integrations[_0xc48c('0x53')](_0x52ed7c[_0xc48c('0x4a')]['channel'],_0x52ed7c[_0xc48c('0x4a')][_0xc48c('0x2d')]);return db[_0xc48c('0x4d')][_0xc48c('0x49')](_0x52ed7c[_0xc48c('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0xc48c('0x54')},{'model':db[_0xc48c('0x55')],'as':_0xc48c('0x52')}]});}return null;})[_0xc48c('0x25')](respondWithResult(_0x77fbf3,null))['catch'](handleError(_0x77fbf3,null));};var md5=require(_0xc48c('0x56'));exports['getFields']=function(_0x44a15b,_0xca5220,_0x387d2a){var _0x1a73a1=null;var _0x10f439=null;var _0x137f79=null;var _0x347bdb=null;var _0x33bba9='';return db[_0xc48c('0x2b')][_0xc48c('0x4c')]({'where':{'id':_0x44a15b[_0xc48c('0x45')]['id']},'attributes':['id','name',_0xc48c('0x57'),_0xc48c('0x58'),'moduleName','remoteUri',_0xc48c('0x59'),'accessKey']})[_0xc48c('0x25')](handleEntityNotFound(_0xca5220,null))[_0xc48c('0x25')](function(_0x412a29){if(_0x412a29){_0x1a73a1=_0x412a29['username'];_0x10f439=_0x412a29['accessKey'];_0x137f79=_0x412a29['moduleName'];_0x33bba9=_0x412a29[_0xc48c('0x5a')];var _0x1006a7=_0x33bba9[_0xc48c('0x5b')](-0x1);if(_0x1006a7==='/'){_0x33bba9=_0x33bba9[_0xc48c('0x5c')](0x0,_0x33bba9[_0xc48c('0x5d')](_0x1006a7));}_0x347bdb=util[_0xc48c('0x5e')](_0xc48c('0x5f'),_0x33bba9);var _0x535fde={'method':'GET','uri':_0x347bdb,'qs':{'operation':'getchallenge','username':_0x412a29[_0xc48c('0x57')]},'json':!![]};return rp(_0x535fde);}})['then'](function(_0x47f2e9){if(_0x47f2e9['success']){var _0x1add6f={'method':_0xc48c('0x60'),'uri':_0x347bdb,'form':{'operation':_0xc48c('0x61'),'username':_0x1a73a1,'accessKey':md5(_0x47f2e9[_0xc48c('0x62')][_0xc48c('0x63')]+_0x10f439)},'json':!![]};return rp(_0x1add6f);}})[_0xc48c('0x25')](function(_0x4f7c0c){if(_0x4f7c0c['success']){var _0x4ee423={'method':'GET','uri':_0x347bdb,'qs':{'operation':_0xc48c('0x64'),'username':_0x1a73a1,'sessionName':_0x4f7c0c['result'][_0xc48c('0x65')],'elementType':_0x137f79},'json':!![]};return rp(_0x4ee423);}})['then'](function(_0x79cf1d){if(_0x79cf1d['success']){var _0x33eecc=[_0xc48c('0x66'),'reference',_0xc48c('0x67')];_['remove'](_0x79cf1d[_0xc48c('0x62')][_0xc48c('0x34')],function(_0x2a97e6){return _0x33eecc[_0xc48c('0x68')](_0x2a97e6['type'][_0xc48c('0x2e')]);});_['remove'](_0x79cf1d['result'][_0xc48c('0x34')],function(_0x2bafdb){return _0x2bafdb[_0xc48c('0x69')]===_0xc48c('0x6a');});return{'count':_0x79cf1d[_0xc48c('0x62')][_0xc48c('0x34')][_0xc48c('0x35')],'rows':_[_0xc48c('0x2a')](_0x79cf1d['result'][_0xc48c('0x34')],function(_0x3a499e){return{'id':_0x3a499e[_0xc48c('0x2e')],'name':_0x3a499e[_0xc48c('0x6b')],'custom':_[_0xc48c('0x6c')](_0x3a499e[_0xc48c('0x2e')],_0xc48c('0x6d'))?!![]:![],'options':_0x3a499e[_0xc48c('0x2d')]['name']===_0xc48c('0x6e')&&_0x3a499e[_0xc48c('0x2d')]['picklistValues'][_0xc48c('0x35')]>0x0?_[_0xc48c('0x2a')](_0x3a499e[_0xc48c('0x2d')][_0xc48c('0x6f')],function(_0x1a0541){return{'name':_0x1a0541[_0xc48c('0x6b')],'value':_0x1a0541[_0xc48c('0x70')]};}):[]};})};}})[_0xc48c('0x25')](respondWithResult(_0xca5220,null))[_0xc48c('0x43')](function(_0x34a1a2){console['log'](_0xc48c('0x71')+_0x34a1a2);var _0x1c213c=_0x44a15b[_0xc48c('0x2f')][_0xc48c('0x72')]?0x1f4:_0x34a1a2[_0xc48c('0x73')]||0x1f4;logger[_0xc48c('0x26')](_0xc48c('0x74'),'getFields',_0x1c213c,JSON['stringify'](_0x34a1a2));delete _0x34a1a2[_0xc48c('0x2e')];if(_0x1c213c===0x191){_0x1c213c=0x190;}_0xca5220[_0xc48c('0x18')](_0x1c213c)[_0xc48c('0x28')](_0x44a15b[_0xc48c('0x2f')][_0xc48c('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x34a1a2[_0xc48c('0x73')]}:_0x34a1a2);});}; \ No newline at end of file +var _0xcf07=['stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','options','VtigerAccount','includeAll','findAll','rows','catch','params','include','create','body','find','getConfigurations','findOne','VtigerConfiguration','filter','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','login','describe','success','autogenerated','reference','owner','result','includes','label','startsWith','picklistValues','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy'];(function(_0x462569,_0x519b5a){var _0x3a3ccb=function(_0x39bc0f){while(--_0x39bc0f){_0x462569['push'](_0x462569['shift']());}};_0x3a3ccb(++_0x519b5a);}(_0xcf07,0x1a4));var _0x7cf0=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xcf07[_0x7feb90];return _0x3c5b33;};'use strict';var emlformat=require(_0x7cf0('0x0'));var rimraf=require(_0x7cf0('0x1'));var zipdir=require(_0x7cf0('0x2'));var jsonpatch=require(_0x7cf0('0x3'));var rp=require(_0x7cf0('0x4'));var moment=require(_0x7cf0('0x5'));var BPromise=require(_0x7cf0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7cf0('0x7'));var sox=require(_0x7cf0('0x8'));var csv=require(_0x7cf0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7cf0('0xa'));var _=require(_0x7cf0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7cf0('0xc'));var deskjs=require(_0x7cf0('0xd'));var toCsv=require(_0x7cf0('0x9'));var querystring=require(_0x7cf0('0xe'));var Papa=require('papaparse');var Redis=require(_0x7cf0('0xf'));var authService=require(_0x7cf0('0x10'));var qs=require(_0x7cf0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cf0('0x12'));var logger=require(_0x7cf0('0x13'))(_0x7cf0('0x14'));var utils=require(_0x7cf0('0x15'));var config=require(_0x7cf0('0x16'));var licenseUtil=require(_0x7cf0('0x17'));var db=require(_0x7cf0('0x18'))['db'];var integrations=require(_0x7cf0('0x19'));function respondWithStatusCode(_0x22a3f7,_0x416df3){_0x416df3=_0x416df3||0xcc;return function(_0x311374){if(_0x311374){return _0x22a3f7[_0x7cf0('0x1a')](_0x416df3);}return _0x22a3f7[_0x7cf0('0x1b')](_0x416df3)[_0x7cf0('0x1c')]();};}function respondWithResult(_0x453e1f,_0x3b8d2b){_0x3b8d2b=_0x3b8d2b||0xc8;return function(_0xae1905){if(_0xae1905){return _0x453e1f[_0x7cf0('0x1b')](_0x3b8d2b)[_0x7cf0('0x1d')](_0xae1905);}};}function respondWithFilteredResult(_0x3322d3,_0x1f0424){return function(_0x2173e6){if(_0x2173e6){var _0x28cf3f=typeof _0x1f0424['offset']===_0x7cf0('0x1e')&&typeof _0x1f0424['limit']===_0x7cf0('0x1e');var _0xafb8d1=_0x2173e6[_0x7cf0('0x1f')];var _0x3fb3a2=_0x28cf3f?0x0:_0x1f0424[_0x7cf0('0x20')];var _0x532d57=_0x28cf3f?_0x2173e6[_0x7cf0('0x1f')]:_0x1f0424[_0x7cf0('0x20')]+_0x1f0424['limit'];var _0x43ea48;if(_0x532d57>=_0xafb8d1){_0x532d57=_0xafb8d1;_0x43ea48=0xc8;}else{_0x43ea48=0xce;}_0x3322d3[_0x7cf0('0x1b')](_0x43ea48);return _0x3322d3[_0x7cf0('0x21')](_0x7cf0('0x22'),_0x3fb3a2+'-'+_0x532d57+'/'+_0xafb8d1)[_0x7cf0('0x1d')](_0x2173e6);}return null;};}function patchUpdates(_0x2cfd7c){return function(_0x22d4f8){try{jsonpatch[_0x7cf0('0x23')](_0x22d4f8,_0x2cfd7c,!![]);}catch(_0x4c1486){return BPromise['reject'](_0x4c1486);}return _0x22d4f8[_0x7cf0('0x24')]();};}function saveUpdates(_0x91e90d,_0x5b96e9){return function(_0x50f03b){if(_0x50f03b){return _0x50f03b[_0x7cf0('0x25')](_0x91e90d)[_0x7cf0('0x26')](function(_0x23aba3){return _0x23aba3;});}return null;};}function removeEntity(_0x53db69,_0x108bdf){return function(_0xf7f314){if(_0xf7f314){return _0xf7f314[_0x7cf0('0x27')]()['then'](function(){_0x53db69[_0x7cf0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460550,_0x56817f){return function(_0xdeb7ea){if(!_0xdeb7ea){_0x460550[_0x7cf0('0x1a')](0x194);}return _0xdeb7ea;};}function handleError(_0x4e07f3,_0x375519){_0x375519=_0x375519||0x1f4;return function(_0x5a6a08){logger['error'](_0x5a6a08[_0x7cf0('0x28')]);if(_0x5a6a08[_0x7cf0('0x29')]){delete _0x5a6a08[_0x7cf0('0x29')];}_0x4e07f3[_0x7cf0('0x1b')](_0x375519)[_0x7cf0('0x2a')](_0x5a6a08);};}exports['index']=function(_0x8070f0,_0x49f1b3){var _0x40da59={},_0x1a89b4={},_0x1f1730={'count':0x0,'rows':[]};var _0x40adaa=_[_0x7cf0('0x2b')](db['VtigerAccount'][_0x7cf0('0x2c')],function(_0xc4e013){return{'name':_0xc4e013[_0x7cf0('0x2d')],'type':_0xc4e013[_0x7cf0('0x2e')]['key']};});_0x1a89b4[_0x7cf0('0x2f')]=_['map'](_0x40adaa,_0x7cf0('0x29'));_0x1a89b4[_0x7cf0('0x30')]=_[_0x7cf0('0x31')](_0x8070f0['query']);_0x1a89b4[_0x7cf0('0x32')]=_[_0x7cf0('0x33')](_0x1a89b4[_0x7cf0('0x2f')],_0x1a89b4[_0x7cf0('0x30')]);_0x40da59[_0x7cf0('0x34')]=_[_0x7cf0('0x33')](_0x1a89b4['model'],qs[_0x7cf0('0x35')](_0x8070f0[_0x7cf0('0x30')]['fields']));_0x40da59['attributes']=_0x40da59[_0x7cf0('0x34')][_0x7cf0('0x36')]?_0x40da59[_0x7cf0('0x34')]:_0x1a89b4[_0x7cf0('0x2f')];if(!_0x8070f0[_0x7cf0('0x30')][_0x7cf0('0x37')](_0x7cf0('0x38'))){_0x40da59['limit']=qs['limit'](_0x8070f0['query'][_0x7cf0('0x39')]);_0x40da59[_0x7cf0('0x20')]=qs[_0x7cf0('0x20')](_0x8070f0['query'][_0x7cf0('0x20')]);}_0x40da59[_0x7cf0('0x3a')]=qs[_0x7cf0('0x3b')](_0x8070f0[_0x7cf0('0x30')][_0x7cf0('0x3b')]);_0x40da59['where']=qs[_0x7cf0('0x32')](_[_0x7cf0('0x3c')](_0x8070f0[_0x7cf0('0x30')],_0x1a89b4['filters']),_0x40adaa);if(_0x8070f0[_0x7cf0('0x30')]['filter']){_0x40da59[_0x7cf0('0x3d')]=_[_0x7cf0('0x3e')](_0x40da59[_0x7cf0('0x3d')],{'$or':_[_0x7cf0('0x2b')](_0x40adaa,function(_0x14e97c){if(_0x14e97c['type']!==_0x7cf0('0x3f')){var _0x47a1f4={};_0x47a1f4[_0x14e97c['name']]={'$like':'%'+_0x8070f0['query']['filter']+'%'};return _0x47a1f4;}})});}_0x40da59=_[_0x7cf0('0x3e')]({},_0x40da59,_0x8070f0[_0x7cf0('0x40')]);var _0x4e3eab={'where':_0x40da59[_0x7cf0('0x3d')]};return db[_0x7cf0('0x41')]['count'](_0x4e3eab)[_0x7cf0('0x26')](function(_0x55f564){_0x1f1730[_0x7cf0('0x1f')]=_0x55f564;if(_0x8070f0[_0x7cf0('0x30')][_0x7cf0('0x42')]){_0x40da59['include']=[{'all':!![]}];}return db[_0x7cf0('0x41')][_0x7cf0('0x43')](_0x40da59);})[_0x7cf0('0x26')](function(_0x423b3a){_0x1f1730[_0x7cf0('0x44')]=_0x423b3a;return _0x1f1730;})[_0x7cf0('0x26')](respondWithFilteredResult(_0x49f1b3,_0x40da59))[_0x7cf0('0x45')](handleError(_0x49f1b3,null));};exports['show']=function(_0x275bee,_0xf727e5){var _0x3271ea={'raw':![],'where':{'id':_0x275bee[_0x7cf0('0x46')]['id']}},_0x499206={};_0x499206[_0x7cf0('0x2f')]=_[_0x7cf0('0x31')](db[_0x7cf0('0x41')][_0x7cf0('0x2c')]);_0x499206[_0x7cf0('0x30')]=_[_0x7cf0('0x31')](_0x275bee[_0x7cf0('0x30')]);_0x499206['filters']=_['intersection'](_0x499206[_0x7cf0('0x2f')],_0x499206[_0x7cf0('0x30')]);_0x3271ea['attributes']=_[_0x7cf0('0x33')](_0x499206[_0x7cf0('0x2f')],qs[_0x7cf0('0x35')](_0x275bee['query']['fields']));_0x3271ea[_0x7cf0('0x34')]=_0x3271ea[_0x7cf0('0x34')][_0x7cf0('0x36')]?_0x3271ea[_0x7cf0('0x34')]:_0x499206[_0x7cf0('0x2f')];if(_0x275bee[_0x7cf0('0x30')][_0x7cf0('0x42')]){_0x3271ea[_0x7cf0('0x47')]=[{'all':!![]}];}_0x3271ea=_[_0x7cf0('0x3e')]({},_0x3271ea,_0x275bee[_0x7cf0('0x40')]);return db[_0x7cf0('0x41')]['find'](_0x3271ea)['then'](handleEntityNotFound(_0xf727e5,null))['then'](respondWithResult(_0xf727e5,null))[_0x7cf0('0x45')](handleError(_0xf727e5,null));};exports[_0x7cf0('0x48')]=function(_0x5bd562,_0x25f337){return db[_0x7cf0('0x41')][_0x7cf0('0x48')](_0x5bd562[_0x7cf0('0x49')],{})[_0x7cf0('0x26')](respondWithResult(_0x25f337,0xc9))[_0x7cf0('0x45')](handleError(_0x25f337,null));};exports[_0x7cf0('0x25')]=function(_0x3a3770,_0x5ef4f1){if(_0x3a3770['body']['id']){delete _0x3a3770['body']['id'];}return db[_0x7cf0('0x41')][_0x7cf0('0x4a')]({'where':{'id':_0x3a3770[_0x7cf0('0x46')]['id']}})[_0x7cf0('0x26')](handleEntityNotFound(_0x5ef4f1,null))[_0x7cf0('0x26')](saveUpdates(_0x3a3770['body'],null))[_0x7cf0('0x26')](respondWithResult(_0x5ef4f1,null))[_0x7cf0('0x45')](handleError(_0x5ef4f1,null));};exports[_0x7cf0('0x27')]=function(_0xd4bfe8,_0x3322d0){return db[_0x7cf0('0x41')]['find']({'where':{'id':_0xd4bfe8[_0x7cf0('0x46')]['id']}})[_0x7cf0('0x26')](handleEntityNotFound(_0x3322d0,null))['then'](removeEntity(_0x3322d0,null))['catch'](handleError(_0x3322d0,null));};exports[_0x7cf0('0x4b')]=function(_0x39c438,_0x291d08,_0x5401cf){var _0x2a52aa={};var _0x23b164={};var _0x187350;var _0x37305e;return db[_0x7cf0('0x41')][_0x7cf0('0x4c')]({'where':{'id':_0x39c438[_0x7cf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x291d08,null))[_0x7cf0('0x26')](function(_0x5f0cad){if(_0x5f0cad){_0x187350=_0x5f0cad;_0x23b164[_0x7cf0('0x2f')]=_[_0x7cf0('0x31')](db[_0x7cf0('0x4d')]['rawAttributes']);_0x23b164[_0x7cf0('0x30')]=_[_0x7cf0('0x31')](_0x39c438[_0x7cf0('0x30')]);_0x23b164[_0x7cf0('0x32')]=_['intersection'](_0x23b164[_0x7cf0('0x2f')],_0x23b164[_0x7cf0('0x30')]);_0x2a52aa[_0x7cf0('0x34')]=_[_0x7cf0('0x33')](_0x23b164['model'],qs[_0x7cf0('0x35')](_0x39c438[_0x7cf0('0x30')][_0x7cf0('0x35')]));_0x2a52aa[_0x7cf0('0x34')]=_0x2a52aa[_0x7cf0('0x34')][_0x7cf0('0x36')]?_0x2a52aa['attributes']:_0x23b164['model'];_0x2a52aa[_0x7cf0('0x3a')]=qs['sort'](_0x39c438['query'][_0x7cf0('0x3b')]);_0x2a52aa[_0x7cf0('0x3d')]=qs[_0x7cf0('0x32')](_[_0x7cf0('0x3c')](_0x39c438[_0x7cf0('0x30')],_0x23b164[_0x7cf0('0x32')]));if(_0x39c438[_0x7cf0('0x30')]['filter']){_0x2a52aa['where']=_['merge'](_0x2a52aa[_0x7cf0('0x3d')],{'$or':_[_0x7cf0('0x2b')](_0x2a52aa['attributes'],function(_0x3a07d7){var _0x3b3e84={};_0x3b3e84[_0x3a07d7]={'$like':'%'+_0x39c438[_0x7cf0('0x30')][_0x7cf0('0x4e')]+'%'};return _0x3b3e84;})});}_0x2a52aa=_[_0x7cf0('0x3e')]({},_0x2a52aa,_0x39c438[_0x7cf0('0x40')]);return _0x187350[_0x7cf0('0x4b')](_0x2a52aa);}})[_0x7cf0('0x26')](function(_0x2b93b5){if(_0x2b93b5){_0x37305e=_0x2b93b5[_0x7cf0('0x36')];if(!_0x39c438[_0x7cf0('0x30')][_0x7cf0('0x37')]('nolimit')){_0x2a52aa['limit']=qs[_0x7cf0('0x39')](_0x39c438[_0x7cf0('0x30')]['limit']);_0x2a52aa[_0x7cf0('0x20')]=qs[_0x7cf0('0x20')](_0x39c438[_0x7cf0('0x30')][_0x7cf0('0x20')]);}return _0x187350[_0x7cf0('0x4b')](_0x2a52aa);}})[_0x7cf0('0x26')](function(_0x8eb308){if(_0x8eb308){return _0x8eb308?{'count':_0x37305e,'rows':_0x8eb308}:null;}})[_0x7cf0('0x26')](respondWithResult(_0x291d08,null))[_0x7cf0('0x45')](handleError(_0x291d08,null));};exports['addConfiguration']=function(_0x1e437d,_0x31f207,_0x32d2d9){if(_0x1e437d[_0x7cf0('0x49')]['id']){delete _0x1e437d['body']['id'];}return db[_0x7cf0('0x41')][_0x7cf0('0x4c')]({'where':{'id':_0x1e437d[_0x7cf0('0x46')]['id']}})['then'](handleEntityNotFound(_0x31f207,null))[_0x7cf0('0x26')](function(_0x885de4){if(_0x885de4){_0x1e437d['body']['AccountId']=_0x885de4['id'];_0x1e437d[_0x7cf0('0x49')]['Subjects']=integrations[_0x7cf0('0x4f')](_0x1e437d[_0x7cf0('0x49')][_0x7cf0('0x50')],_0x1e437d[_0x7cf0('0x49')][_0x7cf0('0x2e')]);_0x1e437d[_0x7cf0('0x49')][_0x7cf0('0x51')]=integrations[_0x7cf0('0x52')](_0x1e437d['body'][_0x7cf0('0x50')],_0x1e437d[_0x7cf0('0x49')][_0x7cf0('0x2e')]);return db[_0x7cf0('0x4d')][_0x7cf0('0x48')](_0x1e437d[_0x7cf0('0x49')],{'include':[{'model':db[_0x7cf0('0x53')],'as':_0x7cf0('0x54')},{'model':db[_0x7cf0('0x53')],'as':'Descriptions'}]});}return null;})[_0x7cf0('0x26')](respondWithResult(_0x31f207,null))[_0x7cf0('0x45')](handleError(_0x31f207,null));};var md5=require(_0x7cf0('0x55'));exports[_0x7cf0('0x56')]=function(_0x32bd7f,_0x5cd1d9,_0x1d5e2c){var _0x4fa003=null;var _0x5a3476=null;var _0x200e2a=null;var _0x7a077f=null;var _0x23e15c='';return db[_0x7cf0('0x41')][_0x7cf0('0x4c')]({'where':{'id':_0x32bd7f['params']['id']},'attributes':['id','name',_0x7cf0('0x57'),'description',_0x7cf0('0x58'),'remoteUri',_0x7cf0('0x59'),_0x7cf0('0x5a')]})[_0x7cf0('0x26')](handleEntityNotFound(_0x5cd1d9,null))['then'](function(_0x48c418){if(_0x48c418){_0x4fa003=_0x48c418[_0x7cf0('0x57')];_0x5a3476=_0x48c418[_0x7cf0('0x5a')];_0x200e2a=_0x48c418[_0x7cf0('0x58')];_0x23e15c=_0x48c418[_0x7cf0('0x5b')];var _0xae7d3a=_0x23e15c[_0x7cf0('0x5c')](-0x1);if(_0xae7d3a==='/'){_0x23e15c=_0x23e15c[_0x7cf0('0x5d')](0x0,_0x23e15c[_0x7cf0('0x5e')](_0xae7d3a));}_0x7a077f=util['format'](_0x7cf0('0x5f'),_0x23e15c);var _0x5b2cf9={'method':_0x7cf0('0x60'),'uri':_0x7a077f,'qs':{'operation':_0x7cf0('0x61'),'username':_0x48c418[_0x7cf0('0x57')]},'json':!![]};return rp(_0x5b2cf9);}})[_0x7cf0('0x26')](function(_0x3b389a){if(_0x3b389a['success']){var _0x21466a={'method':'POST','uri':_0x7a077f,'form':{'operation':_0x7cf0('0x62'),'username':_0x4fa003,'accessKey':md5(_0x3b389a['result']['token']+_0x5a3476)},'json':!![]};return rp(_0x21466a);}})[_0x7cf0('0x26')](function(_0x360c48){if(_0x360c48['success']){var _0x3b5d89={'method':_0x7cf0('0x60'),'uri':_0x7a077f,'qs':{'operation':_0x7cf0('0x63'),'username':_0x4fa003,'sessionName':_0x360c48['result']['sessionName'],'elementType':_0x200e2a},'json':!![]};return rp(_0x3b5d89);}})[_0x7cf0('0x26')](function(_0x390a38){if(_0x390a38[_0x7cf0('0x64')]){var _0x206c2f=[_0x7cf0('0x65'),_0x7cf0('0x66'),_0x7cf0('0x67')];_['remove'](_0x390a38[_0x7cf0('0x68')][_0x7cf0('0x35')],function(_0x3ba8c2){return _0x206c2f[_0x7cf0('0x69')](_0x3ba8c2[_0x7cf0('0x2e')]['name']);});_['remove'](_0x390a38[_0x7cf0('0x68')][_0x7cf0('0x35')],function(_0x15e8ae){return _0x15e8ae['editable']==='false';});return{'count':_0x390a38[_0x7cf0('0x68')]['fields'][_0x7cf0('0x36')],'rows':_[_0x7cf0('0x2b')](_0x390a38[_0x7cf0('0x68')]['fields'],function(_0x39d171){return{'id':_0x39d171['name'],'name':_0x39d171[_0x7cf0('0x6a')],'custom':_[_0x7cf0('0x6b')](_0x39d171[_0x7cf0('0x29')],'cf_')?!![]:![],'options':_0x39d171['type'][_0x7cf0('0x29')]==='picklist'&&_0x39d171[_0x7cf0('0x2e')][_0x7cf0('0x6c')][_0x7cf0('0x36')]>0x0?_[_0x7cf0('0x2b')](_0x39d171[_0x7cf0('0x2e')]['picklistValues'],function(_0x363e26){return{'name':_0x363e26['label'],'value':_0x363e26['value']};}):[]};})};}})['then'](respondWithResult(_0x5cd1d9,null))[_0x7cf0('0x45')](function(_0x3e354c){console['log'](_0x7cf0('0x6d')+_0x3e354c);var _0x592fa2=_0x32bd7f[_0x7cf0('0x30')][_0x7cf0('0x6e')]?0x1f4:_0x3e354c[_0x7cf0('0x6f')]||0x1f4;logger[_0x7cf0('0x70')](_0x7cf0('0x71'),_0x7cf0('0x56'),_0x592fa2,JSON[_0x7cf0('0x72')](_0x3e354c));delete _0x3e354c[_0x7cf0('0x29')];if(_0x592fa2===0x191){_0x592fa2=0x190;}_0x5cd1d9[_0x7cf0('0x1b')](_0x592fa2)[_0x7cf0('0x2a')](_0x32bd7f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3e354c[_0x7cf0('0x6f')]}:_0x3e354c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index e5e5ed1..1f8cb1d 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 _0x6bb3=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x1a937d,_0x31880c){var _0x4619b5=function(_0x5573c6){while(--_0x5573c6){_0x1a937d['push'](_0x1a937d['shift']());}};_0x4619b5(++_0x31880c);}(_0x6bb3,0xc3));var _0x36bb=function(_0x6af18f,_0x1694b9){_0x6af18f=_0x6af18f-0x0;var _0x514daa=_0x6bb3[_0x6af18f];return _0x514daa;};'use strict';var _=require(_0x36bb('0x0'));var util=require('util');var logger=require(_0x36bb('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x36bb('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36bb('0x3'));var config=require(_0x36bb('0x4'));var attributes=require(_0x36bb('0x5'));var integrations=require(_0x36bb('0x6'));module[_0x36bb('0x7')]=function(_0x5ad239,_0x38adf1){return _0x5ad239[_0x36bb('0x8')]('VtigerAccount',attributes,{'tableName':_0x36bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee88=['VtigerAccount','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','exports'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0xee88,0x14b));var _0x8ee8=function(_0x355d59,_0xd57ba9){_0x355d59=_0x355d59-0x0;var _0x46e746=_0xee88[_0x355d59];return _0x46e746;};'use strict';var _=require(_0x8ee8('0x0'));var util=require(_0x8ee8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8ee8('0x2'));var BPromise=require(_0x8ee8('0x3'));var rp=require(_0x8ee8('0x4'));var fs=require('fs');var path=require(_0x8ee8('0x5'));var rimraf=require(_0x8ee8('0x6'));var config=require(_0x8ee8('0x7'));var attributes=require(_0x8ee8('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8ee8('0x9')]=function(_0x557859,_0x171419){return _0x557859['define'](_0x8ee8('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 56ba7fa..b62234b 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 _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x533054,_0x4ef945){var _0x52b0c7=function(_0x4173e3){while(--_0x4173e3){_0x533054['push'](_0x533054['shift']());}};_0x52b0c7(++_0x4ef945);}(_0x2547,0x1cd));var _0x7254=function(_0x8faf6b,_0x330d18){_0x8faf6b=_0x8faf6b-0x0;var _0x34451b=_0x2547[_0x8faf6b];return _0x34451b;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')]({'raw':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1c')]||null:null,'limit':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1d')]||null:null,'include':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x2737e0[_0x7254('0x19')]['include'],function(_0x493bfd){return{'model':db[_0x493bfd[_0x7254('0x20')]],'as':_0x493bfd['as'],'attributes':_0x493bfd[_0x7254('0x1c')],'include':_0x493bfd[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x493bfd[_0x7254('0x1e')],function(_0x36b5d5){return{'model':db[_0x36b5d5[_0x7254('0x20')]],'as':_0x36b5d5['as'],'attributes':_0x36b5d5['attributes'],'include':_0x36b5d5[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x36b5d5[_0x7254('0x1e')],function(_0x494cdb){return{'model':db[_0x494cdb[_0x7254('0x20')]],'as':_0x494cdb['as'],'attributes':_0x494cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7254('0x21')](function(_0x134a9e){logger['info'](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')]('GetVtigerAccount',_0x2737e0,JSON[_0x7254('0x11')](_0x134a9e));_0x1f48f6(_0x134a9e);})[_0x7254('0x15')](function(_0x37cb5c){logger[_0x7254('0x12')](_0x7254('0x16'),_0x37cb5c[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b['error'](0x1f4,_0x37cb5c[_0x7254('0x13')]));});});};exports[_0x7254('0x22')]=function(_0x5569be){var _0x2f75ea=this;return new Promise(function(_0x1279cd,_0x2be5fc){return db['VtigerAccount'][_0x7254('0x23')]({'raw':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x5569be['options']?_0x5569be[_0x7254('0x19')]['attributes']||null:null,'include':_0x5569be['options']?_0x5569be[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x5569be[_0x7254('0x19')][_0x7254('0x1e')],function(_0x430420){return{'model':db[_0x430420[_0x7254('0x20')]],'as':_0x430420['as'],'attributes':_0x430420[_0x7254('0x1c')],'include':_0x430420[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x430420[_0x7254('0x1e')],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0x7254('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd[_0x7254('0x1c')],'include':_0x3b0abd['include']?_[_0x7254('0x1f')](_0x3b0abd[_0x7254('0x1e')],function(_0x2ea976){return{'model':db[_0x2ea976[_0x7254('0x20')]],'as':_0x2ea976['as'],'attributes':_0x2ea976[_0x7254('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140bb2){logger['info'](_0x7254('0x22'),_0x5569be);logger[_0x7254('0xf')](_0x7254('0x22'),_0x5569be,JSON[_0x7254('0x11')](_0x140bb2));_0x1279cd(_0x140bb2);})[_0x7254('0x15')](function(_0x4e6213){logger[_0x7254('0x12')]('ShowVtigerAccount',_0x4e6213[_0x7254('0x13')],_0x5569be);_0x2be5fc(_0x2f75ea[_0x7254('0x12')](0x1f4,_0x4e6213['message']));});});}; \ No newline at end of file +var _0x351d=['findAll','options','attributes','include','map','model','then','catch','ShowVtigerAccount','find','raw','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount'];(function(_0x723733,_0x1e1d3e){var _0x314e62=function(_0x143cc0){while(--_0x143cc0){_0x723733['push'](_0x723733['shift']());}};_0x314e62(++_0x1e1d3e);}(_0x351d,0x90));var _0xd351=function(_0x1edf87,_0x5f3106){_0x1edf87=_0x1edf87-0x0;var _0x1038d0=_0x351d[_0x1edf87];return _0x1038d0;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')]({'raw':_0x4e0164['options']?_0x4e0164[_0xd351('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4e0164['options']?_0x4e0164[_0xd351('0x16')]['where']||null:null,'attributes':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')][_0xd351('0x17')]||null:null,'limit':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')]['limit']||null:null,'include':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')][_0xd351('0x18')]?_['map'](_0x4e0164[_0xd351('0x16')][_0xd351('0x18')],function(_0x365bbc){return{'model':db[_0x365bbc['model']],'as':_0x365bbc['as'],'attributes':_0x365bbc[_0xd351('0x17')],'include':_0x365bbc[_0xd351('0x18')]?_[_0xd351('0x19')](_0x365bbc[_0xd351('0x18')],function(_0x489c9a){return{'model':db[_0x489c9a[_0xd351('0x1a')]],'as':_0x489c9a['as'],'attributes':_0x489c9a['attributes'],'include':_0x489c9a[_0xd351('0x18')]?_[_0xd351('0x19')](_0x489c9a['include'],function(_0x2648d0){return{'model':db[_0x2648d0['model']],'as':_0x2648d0['as'],'attributes':_0x2648d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd351('0x1b')](function(_0x560be9){logger['info'](_0xd351('0x13'),_0x4e0164);logger['debug'](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x560be9));_0x1e1a3c(_0x560be9);})[_0xd351('0x1c')](function(_0x4d3f48){logger[_0xd351('0xf')]('GetVtigerAccount',_0x4d3f48[_0xd351('0x11')],_0x4e0164);_0x2bfc53(_0x4c6693['error'](0x1f4,_0x4d3f48['message']));});});};exports[_0xd351('0x1d')]=function(_0x38c82f){var _0x3f9ef3=this;return new Promise(function(_0x33b43d,_0x48aa96){return db[_0xd351('0x14')][_0xd351('0x1e')]({'raw':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x1f')]===undefined?!![]:![]:!![],'where':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x20')]||null:null,'attributes':_0x38c82f[_0xd351('0x16')]?_0x38c82f['options'][_0xd351('0x17')]||null:null,'include':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x18')]?_['map'](_0x38c82f[_0xd351('0x16')][_0xd351('0x18')],function(_0x3d5b7f){return{'model':db[_0x3d5b7f[_0xd351('0x1a')]],'as':_0x3d5b7f['as'],'attributes':_0x3d5b7f[_0xd351('0x17')],'include':_0x3d5b7f[_0xd351('0x18')]?_[_0xd351('0x19')](_0x3d5b7f[_0xd351('0x18')],function(_0x238663){return{'model':db[_0x238663['model']],'as':_0x238663['as'],'attributes':_0x238663['attributes'],'include':_0x238663[_0xd351('0x18')]?_[_0xd351('0x19')](_0x238663[_0xd351('0x18')],function(_0x2907b7){return{'model':db[_0x2907b7[_0xd351('0x1a')]],'as':_0x2907b7['as'],'attributes':_0x2907b7[_0xd351('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e2fa){logger[_0xd351('0xb')]('ShowVtigerAccount',_0x38c82f);logger[_0xd351('0xd')](_0xd351('0x1d'),_0x38c82f,JSON[_0xd351('0xe')](_0x47e2fa));_0x33b43d(_0x47e2fa);})[_0xd351('0x1c')](function(_0x33307){logger[_0xd351('0xf')](_0xd351('0x1d'),_0x33307[_0xd351('0x11')],_0x38c82f);_0x48aa96(_0x3f9ef3[_0xd351('0xf')](0x1f4,_0x33307[_0xd351('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ea0386d..1f91fcb 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 _0x1a69=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1cc1fd,_0x33f9f1){var _0x5e3d41=function(_0x356881){while(--_0x356881){_0x1cc1fd['push'](_0x1cc1fd['shift']());}};_0x5e3d41(++_0x33f9f1);}(_0x1a69,0x175));var _0x91a6=function(_0x51d6d3,_0x491251){_0x51d6d3=_0x51d6d3-0x0;var _0x4f0ab5=_0x1a69[_0x51d6d3];return _0x4f0ab5;};'use strict';var multer=require(_0x91a6('0x0'));var util=require(_0x91a6('0x1'));var path=require('path');var timeout=require(_0x91a6('0x2'));var express=require(_0x91a6('0x3'));var router=express[_0x91a6('0x4')]();var fs_extra=require(_0x91a6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x91a6('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x91a6('0x7')]('/',auth[_0x91a6('0x8')](),controller['index']);router[_0x91a6('0x7')](_0x91a6('0x9'),auth['isAuthenticated'](),controller[_0x91a6('0xa')]);router['get'](_0x91a6('0xb'),auth[_0x91a6('0x8')](),controller['getFields']);router[_0x91a6('0x7')](_0x91a6('0xc'),auth['isAuthenticated'](),controller[_0x91a6('0xd')]);router[_0x91a6('0x7')](_0x91a6('0xe'),auth[_0x91a6('0x8')](),controller['getDescriptions']);router[_0x91a6('0xf')]('/',auth['isAuthenticated'](),controller[_0x91a6('0x10')]);router[_0x91a6('0x11')]('/:id',auth[_0x91a6('0x8')](),controller[_0x91a6('0x12')]);router[_0x91a6('0x13')](_0x91a6('0x9'),auth[_0x91a6('0x8')](),controller[_0x91a6('0x14')]);module[_0x91a6('0x15')]=router; \ No newline at end of file +var _0x0866=['getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x27b3df,_0x34a01a){var _0x275390=function(_0x46e282){while(--_0x46e282){_0x27b3df['push'](_0x27b3df['shift']());}};_0x275390(++_0x34a01a);}(_0x0866,0x133));var _0x6086=function(_0x38e1b2,_0x37570a){_0x38e1b2=_0x38e1b2-0x0;var _0x4b0535=_0x0866[_0x38e1b2];return _0x4b0535;};'use strict';var multer=require(_0x6086('0x0'));var util=require(_0x6086('0x1'));var path=require(_0x6086('0x2'));var timeout=require('connect-timeout');var express=require(_0x6086('0x3'));var router=express['Router']();var fs_extra=require(_0x6086('0x4'));var auth=require(_0x6086('0x5'));var interaction=require(_0x6086('0x6'));var config=require(_0x6086('0x7'));var controller=require(_0x6086('0x8'));router[_0x6086('0x9')]('/',auth[_0x6086('0xa')](),controller[_0x6086('0xb')]);router[_0x6086('0x9')](_0x6086('0xc'),auth[_0x6086('0xa')](),controller['show']);router[_0x6086('0x9')](_0x6086('0xd'),auth['isAuthenticated'](),controller[_0x6086('0xe')]);router[_0x6086('0x9')](_0x6086('0xf'),auth[_0x6086('0xa')](),controller[_0x6086('0x10')]);router[_0x6086('0x9')](_0x6086('0x11'),auth[_0x6086('0xa')](),controller[_0x6086('0x12')]);router[_0x6086('0x13')]('/',auth[_0x6086('0xa')](),controller[_0x6086('0x14')]);router['put'](_0x6086('0xc'),auth['isAuthenticated'](),controller[_0x6086('0x15')]);router[_0x6086('0x16')](_0x6086('0xc'),auth[_0x6086('0xa')](),controller[_0x6086('0x17')]);module[_0x6086('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 2a366d5..2f00e6d 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 _0xb25d=['STRING','exports'];(function(_0x56ec07,_0x56a55f){var _0x3ce6f7=function(_0x1915c6){while(--_0x1915c6){_0x56ec07['push'](_0x56ec07['shift']());}};_0x3ce6f7(++_0x56a55f);}(_0xb25d,0x9b));var _0xdb25=function(_0x401274,_0x3490f2){_0x401274=_0x401274-0x0;var _0x195f0b=_0xb25d[_0x401274];return _0x195f0b;};'use strict';var Sequelize=require('sequelize');module[_0xdb25('0x0')]={'name':{'type':Sequelize[_0xdb25('0x1')]},'description':{'type':Sequelize[_0xdb25('0x1')]}}; \ No newline at end of file +var _0x0c6a=['sequelize','STRING'];(function(_0x375112,_0x472cb9){var _0x3e97a6=function(_0x440482){while(--_0x440482){_0x375112['push'](_0x375112['shift']());}};_0x3e97a6(++_0x472cb9);}(_0x0c6a,0x1ba));var _0xa0c6=function(_0x2cb642,_0x248ad5){_0x2cb642=_0x2cb642-0x0;var _0x346dad=_0x0c6a[_0x2cb642];return _0x346dad;};'use strict';var Sequelize=require(_0xa0c6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa0c6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e524386..27101aa 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 _0x78f5=['sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','update','body','destroy','catch','getFields','VtigerField','hasOwnProperty','findOne','getSubjects','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','sendStatus','error','stack','name','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order'];(function(_0x1ba171,_0x39604f){var _0x154895=function(_0x5f0858){while(--_0x5f0858){_0x1ba171['push'](_0x1ba171['shift']());}};_0x154895(++_0x39604f);}(_0x78f5,0xbc));var _0x578f=function(_0x536907,_0x4ef187){_0x536907=_0x536907-0x0;var _0x6d0484=_0x78f5[_0x536907];return _0x6d0484;};'use strict';var emlformat=require(_0x578f('0x0'));var rimraf=require(_0x578f('0x1'));var zipdir=require(_0x578f('0x2'));var jsonpatch=require(_0x578f('0x3'));var rp=require(_0x578f('0x4'));var moment=require(_0x578f('0x5'));var BPromise=require(_0x578f('0x6'));var Mustache=require('mustache');var util=require(_0x578f('0x7'));var path=require(_0x578f('0x8'));var sox=require(_0x578f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x578f('0xa'));var _=require('lodash');var squel=require(_0x578f('0xb'));var crypto=require(_0x578f('0xc'));var jsforce=require(_0x578f('0xd'));var deskjs=require(_0x578f('0xe'));var toCsv=require(_0x578f('0xf'));var querystring=require('querystring');var Papa=require(_0x578f('0x10'));var Redis=require(_0x578f('0x11'));var authService=require(_0x578f('0x12'));var qs=require(_0x578f('0x13'));var as=require(_0x578f('0x14'));var hardwareService=require(_0x578f('0x15'));var logger=require(_0x578f('0x16'))(_0x578f('0x17'));var utils=require(_0x578f('0x18'));var config=require(_0x578f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x578f('0x1a'))['db'];function respondWithStatusCode(_0x3ad79c,_0x2ac66a){_0x2ac66a=_0x2ac66a||0xcc;return function(_0x3f24c5){if(_0x3f24c5){return _0x3ad79c['sendStatus'](_0x2ac66a);}return _0x3ad79c['status'](_0x2ac66a)[_0x578f('0x1b')]();};}function respondWithResult(_0x5151cb,_0x3fffa4){_0x3fffa4=_0x3fffa4||0xc8;return function(_0x1f3e14){if(_0x1f3e14){return _0x5151cb[_0x578f('0x1c')](_0x3fffa4)[_0x578f('0x1d')](_0x1f3e14);}};}function respondWithFilteredResult(_0xa4f024,_0x16b61f){return function(_0x349b8e){if(_0x349b8e){var _0x3e0a45=typeof _0x16b61f[_0x578f('0x1e')]===_0x578f('0x1f')&&typeof _0x16b61f[_0x578f('0x20')]===_0x578f('0x1f');var _0x2ebfbe=_0x349b8e[_0x578f('0x21')];var _0x455ec8=_0x3e0a45?0x0:_0x16b61f[_0x578f('0x1e')];var _0x81ce69=_0x3e0a45?_0x349b8e[_0x578f('0x21')]:_0x16b61f['offset']+_0x16b61f[_0x578f('0x20')];var _0x58a6e3;if(_0x81ce69>=_0x2ebfbe){_0x81ce69=_0x2ebfbe;_0x58a6e3=0xc8;}else{_0x58a6e3=0xce;}_0xa4f024['status'](_0x58a6e3);return _0xa4f024[_0x578f('0x22')](_0x578f('0x23'),_0x455ec8+'-'+_0x81ce69+'/'+_0x2ebfbe)[_0x578f('0x1d')](_0x349b8e);}return null;};}function patchUpdates(_0x589380){return function(_0x41e52e){try{jsonpatch['apply'](_0x41e52e,_0x589380,!![]);}catch(_0x38fca0){return BPromise[_0x578f('0x24')](_0x38fca0);}return _0x41e52e['save']();};}function saveUpdates(_0x532ea6,_0x4f2592){return function(_0x47c1ad){if(_0x47c1ad){return _0x47c1ad['update'](_0x532ea6)[_0x578f('0x25')](function(_0xf3a368){return _0xf3a368;});}return null;};}function removeEntity(_0x844b13,_0x2ddafa){return function(_0x2d4494){if(_0x2d4494){return _0x2d4494['destroy']()['then'](function(){_0x844b13[_0x578f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52bfa1,_0x2b4f4d){return function(_0x36d027){if(!_0x36d027){_0x52bfa1[_0x578f('0x26')](0x194);}return _0x36d027;};}function handleError(_0x2c25c8,_0x5a42b6){_0x5a42b6=_0x5a42b6||0x1f4;return function(_0x1ae590){logger[_0x578f('0x27')](_0x1ae590[_0x578f('0x28')]);if(_0x1ae590[_0x578f('0x29')]){delete _0x1ae590[_0x578f('0x29')];}_0x2c25c8[_0x578f('0x1c')](_0x5a42b6)['send'](_0x1ae590);};}exports['index']=function(_0x2d8a85,_0x5d3598){var _0x57f6e7={},_0xfaf9a8={},_0x37f84b={'count':0x0,'rows':[]};var _0x50df6a=_[_0x578f('0x2a')](db[_0x578f('0x2b')][_0x578f('0x2c')],function(_0x9f1fb9){return{'name':_0x9f1fb9[_0x578f('0x2d')],'type':_0x9f1fb9[_0x578f('0x2e')][_0x578f('0x2f')]};});_0xfaf9a8['model']=_[_0x578f('0x2a')](_0x50df6a,'name');_0xfaf9a8[_0x578f('0x30')]=_[_0x578f('0x31')](_0x2d8a85[_0x578f('0x30')]);_0xfaf9a8[_0x578f('0x32')]=_['intersection'](_0xfaf9a8[_0x578f('0x33')],_0xfaf9a8[_0x578f('0x30')]);_0x57f6e7[_0x578f('0x34')]=_[_0x578f('0x35')](_0xfaf9a8['model'],qs[_0x578f('0x36')](_0x2d8a85[_0x578f('0x30')][_0x578f('0x36')]));_0x57f6e7[_0x578f('0x34')]=_0x57f6e7[_0x578f('0x34')][_0x578f('0x37')]?_0x57f6e7[_0x578f('0x34')]:_0xfaf9a8['model'];if(!_0x2d8a85[_0x578f('0x30')]['hasOwnProperty'](_0x578f('0x38'))){_0x57f6e7[_0x578f('0x20')]=qs[_0x578f('0x20')](_0x2d8a85['query'][_0x578f('0x20')]);_0x57f6e7[_0x578f('0x1e')]=qs[_0x578f('0x1e')](_0x2d8a85[_0x578f('0x30')][_0x578f('0x1e')]);}_0x57f6e7[_0x578f('0x39')]=qs['sort'](_0x2d8a85[_0x578f('0x30')][_0x578f('0x3a')]);_0x57f6e7[_0x578f('0x3b')]=qs[_0x578f('0x32')](_[_0x578f('0x3c')](_0x2d8a85[_0x578f('0x30')],_0xfaf9a8['filters']),_0x50df6a);if(_0x2d8a85['query']['filter']){_0x57f6e7['where']=_['merge'](_0x57f6e7[_0x578f('0x3b')],{'$or':_['map'](_0x50df6a,function(_0x17a65e){if(_0x17a65e[_0x578f('0x2e')]!==_0x578f('0x3d')){var _0x38a55f={};_0x38a55f[_0x17a65e[_0x578f('0x29')]]={'$like':'%'+_0x2d8a85[_0x578f('0x30')][_0x578f('0x3e')]+'%'};return _0x38a55f;}})});}_0x57f6e7=_[_0x578f('0x3f')]({},_0x57f6e7,_0x2d8a85['options']);var _0x4d12fb={'where':_0x57f6e7['where']};return db['VtigerConfiguration'][_0x578f('0x21')](_0x4d12fb)[_0x578f('0x25')](function(_0x4abb7c){_0x37f84b['count']=_0x4abb7c;if(_0x2d8a85[_0x578f('0x30')][_0x578f('0x40')]){_0x57f6e7[_0x578f('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x578f('0x42')](_0x57f6e7);})['then'](function(_0x3870e5){_0x37f84b[_0x578f('0x43')]=_0x3870e5;return _0x37f84b;})['then'](respondWithFilteredResult(_0x5d3598,_0x57f6e7))['catch'](handleError(_0x5d3598,null));};exports[_0x578f('0x44')]=function(_0x15669c,_0x448cb6){var _0x921b80={'raw':![],'where':{'id':_0x15669c[_0x578f('0x45')]['id']}},_0xe11f78={};_0xe11f78[_0x578f('0x33')]=_[_0x578f('0x31')](db[_0x578f('0x2b')]['rawAttributes']);_0xe11f78['query']=_[_0x578f('0x31')](_0x15669c[_0x578f('0x30')]);_0xe11f78[_0x578f('0x32')]=_[_0x578f('0x35')](_0xe11f78[_0x578f('0x33')],_0xe11f78['query']);_0x921b80[_0x578f('0x34')]=_['intersection'](_0xe11f78[_0x578f('0x33')],qs[_0x578f('0x36')](_0x15669c['query'][_0x578f('0x36')]));_0x921b80[_0x578f('0x34')]=_0x921b80[_0x578f('0x34')][_0x578f('0x37')]?_0x921b80[_0x578f('0x34')]:_0xe11f78[_0x578f('0x33')];if(_0x15669c[_0x578f('0x30')][_0x578f('0x40')]){_0x921b80[_0x578f('0x41')]=[{'all':!![]}];}_0x921b80=_[_0x578f('0x3f')]({},_0x921b80,_0x15669c[_0x578f('0x46')]);return db[_0x578f('0x2b')][_0x578f('0x47')](_0x921b80)['then'](handleEntityNotFound(_0x448cb6,null))[_0x578f('0x25')](respondWithResult(_0x448cb6,null))['catch'](handleError(_0x448cb6,null));};exports['create']=function(_0x13f18c,_0x1dacf1){return db[_0x578f('0x2b')][_0x578f('0x48')](_0x13f18c['body'],{})[_0x578f('0x25')](respondWithResult(_0x1dacf1,0xc9))['catch'](handleError(_0x1dacf1,null));};exports[_0x578f('0x49')]=function(_0x2f2c34,_0x341a8c){if(_0x2f2c34['body']['id']){delete _0x2f2c34[_0x578f('0x4a')]['id'];}return db['VtigerConfiguration'][_0x578f('0x47')]({'where':{'id':_0x2f2c34[_0x578f('0x45')]['id']}})[_0x578f('0x25')](handleEntityNotFound(_0x341a8c,null))[_0x578f('0x25')](saveUpdates(_0x2f2c34[_0x578f('0x4a')],null))[_0x578f('0x25')](respondWithResult(_0x341a8c,null))['catch'](handleError(_0x341a8c,null));};exports[_0x578f('0x4b')]=function(_0x2f9541,_0x1e6103){return db[_0x578f('0x2b')][_0x578f('0x47')]({'where':{'id':_0x2f9541[_0x578f('0x45')]['id']}})[_0x578f('0x25')](handleEntityNotFound(_0x1e6103,null))[_0x578f('0x25')](removeEntity(_0x1e6103,null))[_0x578f('0x4c')](handleError(_0x1e6103,null));};exports[_0x578f('0x4d')]=function(_0x198487,_0x37369d,_0x36b1ee){var _0x33b608={};var _0x5dfe3a={};var _0xd9e0ab;var _0x2e8322;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x198487['params']['id']}})[_0x578f('0x25')](handleEntityNotFound(_0x37369d,null))[_0x578f('0x25')](function(_0x40b127){if(_0x40b127){_0xd9e0ab=_0x40b127;_0x5dfe3a[_0x578f('0x33')]=_[_0x578f('0x31')](db[_0x578f('0x4e')][_0x578f('0x2c')]);_0x5dfe3a[_0x578f('0x30')]=_['keys'](_0x198487[_0x578f('0x30')]);_0x5dfe3a[_0x578f('0x32')]=_['intersection'](_0x5dfe3a[_0x578f('0x33')],_0x5dfe3a[_0x578f('0x30')]);_0x33b608[_0x578f('0x34')]=_[_0x578f('0x35')](_0x5dfe3a[_0x578f('0x33')],qs[_0x578f('0x36')](_0x198487[_0x578f('0x30')][_0x578f('0x36')]));_0x33b608[_0x578f('0x34')]=_0x33b608[_0x578f('0x34')]['length']?_0x33b608[_0x578f('0x34')]:_0x5dfe3a[_0x578f('0x33')];_0x33b608[_0x578f('0x39')]=qs[_0x578f('0x3a')](_0x198487[_0x578f('0x30')][_0x578f('0x3a')]);_0x33b608[_0x578f('0x3b')]=qs['filters'](_[_0x578f('0x3c')](_0x198487[_0x578f('0x30')],_0x5dfe3a[_0x578f('0x32')]));if(_0x198487[_0x578f('0x30')]['filter']){_0x33b608['where']=_[_0x578f('0x3f')](_0x33b608[_0x578f('0x3b')],{'$or':_[_0x578f('0x2a')](_0x33b608[_0x578f('0x34')],function(_0x2decc7){var _0x15da89={};_0x15da89[_0x2decc7]={'$like':'%'+_0x198487['query'][_0x578f('0x3e')]+'%'};return _0x15da89;})});}_0x33b608=_[_0x578f('0x3f')]({},_0x33b608,_0x198487['options']);return _0xd9e0ab['getFields'](_0x33b608);}})[_0x578f('0x25')](function(_0x21b521){if(_0x21b521){_0x2e8322=_0x21b521['length'];if(!_0x198487[_0x578f('0x30')][_0x578f('0x4f')](_0x578f('0x38'))){_0x33b608[_0x578f('0x20')]=qs[_0x578f('0x20')](_0x198487[_0x578f('0x30')][_0x578f('0x20')]);_0x33b608[_0x578f('0x1e')]=qs[_0x578f('0x1e')](_0x198487[_0x578f('0x30')][_0x578f('0x1e')]);}return _0xd9e0ab['getFields'](_0x33b608);}})[_0x578f('0x25')](function(_0x2fda69){if(_0x2fda69){return _0x2fda69?{'count':_0x2e8322,'rows':_0x2fda69}:null;}})['then'](respondWithResult(_0x37369d,null))['catch'](handleError(_0x37369d,null));};exports['getSubjects']=function(_0x201357,_0x294c59,_0x136b3b){var _0xa4e0b4={};var _0xf236df={};var _0x1cd848;var _0x1349e4;return db['VtigerConfiguration'][_0x578f('0x50')]({'where':{'id':_0x201357[_0x578f('0x45')]['id']}})[_0x578f('0x25')](handleEntityNotFound(_0x294c59,null))[_0x578f('0x25')](function(_0xac5e3e){if(_0xac5e3e){_0x1cd848=_0xac5e3e;_0xf236df[_0x578f('0x33')]=_[_0x578f('0x31')](db[_0x578f('0x4e')][_0x578f('0x2c')]);_0xf236df[_0x578f('0x30')]=_[_0x578f('0x31')](_0x201357[_0x578f('0x30')]);_0xf236df[_0x578f('0x32')]=_[_0x578f('0x35')](_0xf236df[_0x578f('0x33')],_0xf236df[_0x578f('0x30')]);_0xa4e0b4[_0x578f('0x34')]=_['intersection'](_0xf236df[_0x578f('0x33')],qs[_0x578f('0x36')](_0x201357[_0x578f('0x30')][_0x578f('0x36')]));_0xa4e0b4[_0x578f('0x34')]=_0xa4e0b4[_0x578f('0x34')][_0x578f('0x37')]?_0xa4e0b4[_0x578f('0x34')]:_0xf236df[_0x578f('0x33')];_0xa4e0b4['order']=qs['sort'](_0x201357[_0x578f('0x30')][_0x578f('0x3a')]);_0xa4e0b4[_0x578f('0x3b')]=qs[_0x578f('0x32')](_['pick'](_0x201357[_0x578f('0x30')],_0xf236df[_0x578f('0x32')]));if(_0x201357[_0x578f('0x30')][_0x578f('0x3e')]){_0xa4e0b4[_0x578f('0x3b')]=_[_0x578f('0x3f')](_0xa4e0b4[_0x578f('0x3b')],{'$or':_['map'](_0xa4e0b4[_0x578f('0x34')],function(_0x4ac4a6){var _0x28e7a1={};_0x28e7a1[_0x4ac4a6]={'$like':'%'+_0x201357['query'][_0x578f('0x3e')]+'%'};return _0x28e7a1;})});}_0xa4e0b4=_[_0x578f('0x3f')]({},_0xa4e0b4,_0x201357[_0x578f('0x46')]);return _0x1cd848[_0x578f('0x51')](_0xa4e0b4);}})[_0x578f('0x25')](function(_0xf22989){if(_0xf22989){_0x1349e4=_0xf22989[_0x578f('0x37')];if(!_0x201357[_0x578f('0x30')][_0x578f('0x4f')](_0x578f('0x38'))){_0xa4e0b4['limit']=qs[_0x578f('0x20')](_0x201357['query'][_0x578f('0x20')]);_0xa4e0b4['offset']=qs['offset'](_0x201357[_0x578f('0x30')][_0x578f('0x1e')]);}return _0x1cd848[_0x578f('0x51')](_0xa4e0b4);}})[_0x578f('0x25')](function(_0x1f0050){if(_0x1f0050){return _0x1f0050?{'count':_0x1349e4,'rows':_0x1f0050}:null;}})[_0x578f('0x25')](respondWithResult(_0x294c59,null))[_0x578f('0x4c')](handleError(_0x294c59,null));};exports['getDescriptions']=function(_0x3461dc,_0x2ffddd,_0xccd4c9){var _0x3fe528={};var _0x161a3c={};var _0x50bffb;var _0x358d3e;return db[_0x578f('0x2b')]['findOne']({'where':{'id':_0x3461dc['params']['id']}})['then'](handleEntityNotFound(_0x2ffddd,null))[_0x578f('0x25')](function(_0x5937fc){if(_0x5937fc){_0x50bffb=_0x5937fc;_0x161a3c['model']=_[_0x578f('0x31')](db[_0x578f('0x4e')][_0x578f('0x2c')]);_0x161a3c[_0x578f('0x30')]=_[_0x578f('0x31')](_0x3461dc[_0x578f('0x30')]);_0x161a3c[_0x578f('0x32')]=_[_0x578f('0x35')](_0x161a3c[_0x578f('0x33')],_0x161a3c[_0x578f('0x30')]);_0x3fe528[_0x578f('0x34')]=_[_0x578f('0x35')](_0x161a3c[_0x578f('0x33')],qs[_0x578f('0x36')](_0x3461dc[_0x578f('0x30')][_0x578f('0x36')]));_0x3fe528['attributes']=_0x3fe528['attributes'][_0x578f('0x37')]?_0x3fe528[_0x578f('0x34')]:_0x161a3c[_0x578f('0x33')];_0x3fe528[_0x578f('0x39')]=qs[_0x578f('0x3a')](_0x3461dc[_0x578f('0x30')][_0x578f('0x3a')]);_0x3fe528['where']=qs[_0x578f('0x32')](_[_0x578f('0x3c')](_0x3461dc[_0x578f('0x30')],_0x161a3c[_0x578f('0x32')]));if(_0x3461dc[_0x578f('0x30')][_0x578f('0x3e')]){_0x3fe528['where']=_['merge'](_0x3fe528[_0x578f('0x3b')],{'$or':_[_0x578f('0x2a')](_0x3fe528[_0x578f('0x34')],function(_0x2d82f3){var _0x1e5859={};_0x1e5859[_0x2d82f3]={'$like':'%'+_0x3461dc[_0x578f('0x30')]['filter']+'%'};return _0x1e5859;})});}_0x3fe528=_[_0x578f('0x3f')]({},_0x3fe528,_0x3461dc[_0x578f('0x46')]);return _0x50bffb['getDescriptions'](_0x3fe528);}})[_0x578f('0x25')](function(_0x538024){if(_0x538024){_0x358d3e=_0x538024[_0x578f('0x37')];if(!_0x3461dc[_0x578f('0x30')][_0x578f('0x4f')]('nolimit')){_0x3fe528['limit']=qs[_0x578f('0x20')](_0x3461dc[_0x578f('0x30')]['limit']);_0x3fe528[_0x578f('0x1e')]=qs[_0x578f('0x1e')](_0x3461dc['query'][_0x578f('0x1e')]);}return _0x50bffb['getDescriptions'](_0x3fe528);}})['then'](function(_0x49200d){if(_0x49200d){return _0x49200d?{'count':_0x358d3e,'rows':_0x49200d}:null;}})[_0x578f('0x25')](respondWithResult(_0x2ffddd,null))[_0x578f('0x4c')](handleError(_0x2ffddd,null));}; \ No newline at end of file +var _0x1782=['fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','VtigerConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','body','getFields','findOne','VtigerField','rawAttributes','pick','nolimit','getSubjects','getDescriptions','eml-format','zip-dir'];(function(_0x19b752,_0x519c0c){var _0x216352=function(_0x310a02){while(--_0x310a02){_0x19b752['push'](_0x19b752['shift']());}};_0x216352(++_0x519c0c);}(_0x1782,0x13e));var _0x2178=function(_0x307a28,_0x2bdd9f){_0x307a28=_0x307a28-0x0;var _0x523ac7=_0x1782[_0x307a28];return _0x523ac7;};'use strict';var emlformat=require(_0x2178('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2178('0x1'));var jsonpatch=require(_0x2178('0x2'));var rp=require(_0x2178('0x3'));var moment=require(_0x2178('0x4'));var BPromise=require(_0x2178('0x5'));var Mustache=require('mustache');var util=require(_0x2178('0x6'));var path=require(_0x2178('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2178('0x8'));var fs=require('fs');var fs_extra=require(_0x2178('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2178('0xa'));var deskjs=require(_0x2178('0xb'));var toCsv=require(_0x2178('0xc'));var querystring=require(_0x2178('0xd'));var Papa=require(_0x2178('0xe'));var Redis=require(_0x2178('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2178('0x10'));var as=require(_0x2178('0x11'));var hardwareService=require(_0x2178('0x12'));var logger=require(_0x2178('0x13'))(_0x2178('0x14'));var utils=require(_0x2178('0x15'));var config=require(_0x2178('0x16'));var licenseUtil=require(_0x2178('0x17'));var db=require(_0x2178('0x18'))['db'];function respondWithStatusCode(_0xd7dd49,_0x5f1d29){_0x5f1d29=_0x5f1d29||0xcc;return function(_0x197ce9){if(_0x197ce9){return _0xd7dd49[_0x2178('0x19')](_0x5f1d29);}return _0xd7dd49['status'](_0x5f1d29)[_0x2178('0x1a')]();};}function respondWithResult(_0x3fd74c,_0x32f65c){_0x32f65c=_0x32f65c||0xc8;return function(_0x21d6e3){if(_0x21d6e3){return _0x3fd74c[_0x2178('0x1b')](_0x32f65c)['json'](_0x21d6e3);}};}function respondWithFilteredResult(_0x5921cc,_0x535e82){return function(_0x47aac0){if(_0x47aac0){var _0x4d8f39=typeof _0x535e82[_0x2178('0x1c')]===_0x2178('0x1d')&&typeof _0x535e82['limit']==='undefined';var _0x2cbbfe=_0x47aac0[_0x2178('0x1e')];var _0x561990=_0x4d8f39?0x0:_0x535e82[_0x2178('0x1c')];var _0x39dd60=_0x4d8f39?_0x47aac0[_0x2178('0x1e')]:_0x535e82[_0x2178('0x1c')]+_0x535e82[_0x2178('0x1f')];var _0x443b2a;if(_0x39dd60>=_0x2cbbfe){_0x39dd60=_0x2cbbfe;_0x443b2a=0xc8;}else{_0x443b2a=0xce;}_0x5921cc[_0x2178('0x1b')](_0x443b2a);return _0x5921cc[_0x2178('0x20')](_0x2178('0x21'),_0x561990+'-'+_0x39dd60+'/'+_0x2cbbfe)[_0x2178('0x22')](_0x47aac0);}return null;};}function patchUpdates(_0x1d2dd5){return function(_0x45999f){try{jsonpatch['apply'](_0x45999f,_0x1d2dd5,!![]);}catch(_0x3dd119){return BPromise[_0x2178('0x23')](_0x3dd119);}return _0x45999f[_0x2178('0x24')]();};}function saveUpdates(_0x27a745,_0x4335f2){return function(_0x6f21d4){if(_0x6f21d4){return _0x6f21d4[_0x2178('0x25')](_0x27a745)[_0x2178('0x26')](function(_0x383894){return _0x383894;});}return null;};}function removeEntity(_0x2fa395,_0x3c03f7){return function(_0x1506ec){if(_0x1506ec){return _0x1506ec[_0x2178('0x27')]()[_0x2178('0x26')](function(){_0x2fa395[_0x2178('0x1b')](0xcc)[_0x2178('0x1a')]();});}};}function handleEntityNotFound(_0x393f67,_0x3ddb6d){return function(_0x27179c){if(!_0x27179c){_0x393f67[_0x2178('0x19')](0x194);}return _0x27179c;};}function handleError(_0x2d516f,_0x2b5a0f){_0x2b5a0f=_0x2b5a0f||0x1f4;return function(_0x330618){logger['error'](_0x330618[_0x2178('0x28')]);if(_0x330618[_0x2178('0x29')]){delete _0x330618['name'];}_0x2d516f['status'](_0x2b5a0f)[_0x2178('0x2a')](_0x330618);};}exports['index']=function(_0xffcd00,_0x843cf7){var _0x2bccc6={},_0x47a28f={},_0x50f596={'count':0x0,'rows':[]};var _0x2ee78a=_[_0x2178('0x2b')](db[_0x2178('0x2c')]['rawAttributes'],function(_0x4baf93){return{'name':_0x4baf93[_0x2178('0x2d')],'type':_0x4baf93[_0x2178('0x2e')][_0x2178('0x2f')]};});_0x47a28f[_0x2178('0x30')]=_[_0x2178('0x2b')](_0x2ee78a,_0x2178('0x29'));_0x47a28f[_0x2178('0x31')]=_['keys'](_0xffcd00[_0x2178('0x31')]);_0x47a28f[_0x2178('0x32')]=_['intersection'](_0x47a28f[_0x2178('0x30')],_0x47a28f[_0x2178('0x31')]);_0x2bccc6[_0x2178('0x33')]=_[_0x2178('0x34')](_0x47a28f['model'],qs[_0x2178('0x35')](_0xffcd00['query']['fields']));_0x2bccc6[_0x2178('0x33')]=_0x2bccc6[_0x2178('0x33')][_0x2178('0x36')]?_0x2bccc6[_0x2178('0x33')]:_0x47a28f[_0x2178('0x30')];if(!_0xffcd00[_0x2178('0x31')][_0x2178('0x37')]('nolimit')){_0x2bccc6[_0x2178('0x1f')]=qs['limit'](_0xffcd00[_0x2178('0x31')][_0x2178('0x1f')]);_0x2bccc6['offset']=qs[_0x2178('0x1c')](_0xffcd00[_0x2178('0x31')][_0x2178('0x1c')]);}_0x2bccc6[_0x2178('0x38')]=qs[_0x2178('0x39')](_0xffcd00[_0x2178('0x31')][_0x2178('0x39')]);_0x2bccc6['where']=qs['filters'](_['pick'](_0xffcd00['query'],_0x47a28f[_0x2178('0x32')]),_0x2ee78a);if(_0xffcd00[_0x2178('0x31')][_0x2178('0x3a')]){_0x2bccc6[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x2bccc6['where'],{'$or':_['map'](_0x2ee78a,function(_0x578277){if(_0x578277['type']!==_0x2178('0x3d')){var _0x6a430b={};_0x6a430b[_0x578277[_0x2178('0x29')]]={'$like':'%'+_0xffcd00['query'][_0x2178('0x3a')]+'%'};return _0x6a430b;}})});}_0x2bccc6=_[_0x2178('0x3c')]({},_0x2bccc6,_0xffcd00[_0x2178('0x3e')]);var _0x165167={'where':_0x2bccc6[_0x2178('0x3b')]};return db[_0x2178('0x2c')][_0x2178('0x1e')](_0x165167)[_0x2178('0x26')](function(_0x2ed3a3){_0x50f596[_0x2178('0x1e')]=_0x2ed3a3;if(_0xffcd00[_0x2178('0x31')]['includeAll']){_0x2bccc6[_0x2178('0x3f')]=[{'all':!![]}];}return db[_0x2178('0x2c')][_0x2178('0x40')](_0x2bccc6);})[_0x2178('0x26')](function(_0x5348fe){_0x50f596['rows']=_0x5348fe;return _0x50f596;})[_0x2178('0x26')](respondWithFilteredResult(_0x843cf7,_0x2bccc6))[_0x2178('0x41')](handleError(_0x843cf7,null));};exports[_0x2178('0x42')]=function(_0x2d3028,_0x14a408){var _0x2c7ed4={'raw':![],'where':{'id':_0x2d3028[_0x2178('0x43')]['id']}},_0x2fa43d={};_0x2fa43d[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x2c')]['rawAttributes']);_0x2fa43d[_0x2178('0x31')]=_['keys'](_0x2d3028[_0x2178('0x31')]);_0x2fa43d[_0x2178('0x32')]=_[_0x2178('0x34')](_0x2fa43d[_0x2178('0x30')],_0x2fa43d[_0x2178('0x31')]);_0x2c7ed4[_0x2178('0x33')]=_[_0x2178('0x34')](_0x2fa43d[_0x2178('0x30')],qs['fields'](_0x2d3028[_0x2178('0x31')][_0x2178('0x35')]));_0x2c7ed4[_0x2178('0x33')]=_0x2c7ed4[_0x2178('0x33')][_0x2178('0x36')]?_0x2c7ed4[_0x2178('0x33')]:_0x2fa43d[_0x2178('0x30')];if(_0x2d3028[_0x2178('0x31')][_0x2178('0x45')]){_0x2c7ed4[_0x2178('0x3f')]=[{'all':!![]}];}_0x2c7ed4=_[_0x2178('0x3c')]({},_0x2c7ed4,_0x2d3028[_0x2178('0x3e')]);return db[_0x2178('0x2c')][_0x2178('0x46')](_0x2c7ed4)[_0x2178('0x26')](handleEntityNotFound(_0x14a408,null))['then'](respondWithResult(_0x14a408,null))[_0x2178('0x41')](handleError(_0x14a408,null));};exports['create']=function(_0x3edff3,_0x41771c){return db[_0x2178('0x2c')]['create'](_0x3edff3[_0x2178('0x47')],{})[_0x2178('0x26')](respondWithResult(_0x41771c,0xc9))[_0x2178('0x41')](handleError(_0x41771c,null));};exports[_0x2178('0x25')]=function(_0x29c161,_0x5f150d){if(_0x29c161[_0x2178('0x47')]['id']){delete _0x29c161[_0x2178('0x47')]['id'];}return db[_0x2178('0x2c')][_0x2178('0x46')]({'where':{'id':_0x29c161[_0x2178('0x43')]['id']}})['then'](handleEntityNotFound(_0x5f150d,null))['then'](saveUpdates(_0x29c161[_0x2178('0x47')],null))[_0x2178('0x26')](respondWithResult(_0x5f150d,null))[_0x2178('0x41')](handleError(_0x5f150d,null));};exports[_0x2178('0x27')]=function(_0x52d35e,_0x4fd2e5){return db['VtigerConfiguration'][_0x2178('0x46')]({'where':{'id':_0x52d35e[_0x2178('0x43')]['id']}})[_0x2178('0x26')](handleEntityNotFound(_0x4fd2e5,null))[_0x2178('0x26')](removeEntity(_0x4fd2e5,null))[_0x2178('0x41')](handleError(_0x4fd2e5,null));};exports[_0x2178('0x48')]=function(_0x55d6ad,_0x4b743b,_0x2b2301){var _0x2972b3={};var _0x5dbf85={};var _0x50f83f;var _0x5acac4;return db[_0x2178('0x2c')][_0x2178('0x49')]({'where':{'id':_0x55d6ad[_0x2178('0x43')]['id']}})[_0x2178('0x26')](handleEntityNotFound(_0x4b743b,null))['then'](function(_0x4b516e){if(_0x4b516e){_0x50f83f=_0x4b516e;_0x5dbf85[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x4a')][_0x2178('0x4b')]);_0x5dbf85[_0x2178('0x31')]=_[_0x2178('0x44')](_0x55d6ad['query']);_0x5dbf85[_0x2178('0x32')]=_['intersection'](_0x5dbf85['model'],_0x5dbf85['query']);_0x2972b3['attributes']=_[_0x2178('0x34')](_0x5dbf85['model'],qs[_0x2178('0x35')](_0x55d6ad[_0x2178('0x31')][_0x2178('0x35')]));_0x2972b3[_0x2178('0x33')]=_0x2972b3[_0x2178('0x33')][_0x2178('0x36')]?_0x2972b3[_0x2178('0x33')]:_0x5dbf85['model'];_0x2972b3[_0x2178('0x38')]=qs['sort'](_0x55d6ad['query'][_0x2178('0x39')]);_0x2972b3[_0x2178('0x3b')]=qs[_0x2178('0x32')](_[_0x2178('0x4c')](_0x55d6ad[_0x2178('0x31')],_0x5dbf85['filters']));if(_0x55d6ad['query'][_0x2178('0x3a')]){_0x2972b3[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x2972b3[_0x2178('0x3b')],{'$or':_['map'](_0x2972b3[_0x2178('0x33')],function(_0x1ff7d0){var _0x542d79={};_0x542d79[_0x1ff7d0]={'$like':'%'+_0x55d6ad['query'][_0x2178('0x3a')]+'%'};return _0x542d79;})});}_0x2972b3=_[_0x2178('0x3c')]({},_0x2972b3,_0x55d6ad[_0x2178('0x3e')]);return _0x50f83f['getFields'](_0x2972b3);}})['then'](function(_0x2ae746){if(_0x2ae746){_0x5acac4=_0x2ae746[_0x2178('0x36')];if(!_0x55d6ad[_0x2178('0x31')][_0x2178('0x37')](_0x2178('0x4d'))){_0x2972b3[_0x2178('0x1f')]=qs[_0x2178('0x1f')](_0x55d6ad['query'][_0x2178('0x1f')]);_0x2972b3[_0x2178('0x1c')]=qs[_0x2178('0x1c')](_0x55d6ad['query'][_0x2178('0x1c')]);}return _0x50f83f[_0x2178('0x48')](_0x2972b3);}})[_0x2178('0x26')](function(_0xbf22f2){if(_0xbf22f2){return _0xbf22f2?{'count':_0x5acac4,'rows':_0xbf22f2}:null;}})[_0x2178('0x26')](respondWithResult(_0x4b743b,null))[_0x2178('0x41')](handleError(_0x4b743b,null));};exports[_0x2178('0x4e')]=function(_0x2d1e88,_0x4f8652,_0x5d6bcf){var _0x511934={};var _0x506d4c={};var _0x37b16c;var _0x19bc74;return db[_0x2178('0x2c')][_0x2178('0x49')]({'where':{'id':_0x2d1e88[_0x2178('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f8652,null))[_0x2178('0x26')](function(_0x2e478a){if(_0x2e478a){_0x37b16c=_0x2e478a;_0x506d4c[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x4a')]['rawAttributes']);_0x506d4c[_0x2178('0x31')]=_[_0x2178('0x44')](_0x2d1e88[_0x2178('0x31')]);_0x506d4c['filters']=_[_0x2178('0x34')](_0x506d4c['model'],_0x506d4c[_0x2178('0x31')]);_0x511934[_0x2178('0x33')]=_[_0x2178('0x34')](_0x506d4c[_0x2178('0x30')],qs[_0x2178('0x35')](_0x2d1e88[_0x2178('0x31')][_0x2178('0x35')]));_0x511934[_0x2178('0x33')]=_0x511934['attributes']['length']?_0x511934[_0x2178('0x33')]:_0x506d4c[_0x2178('0x30')];_0x511934['order']=qs['sort'](_0x2d1e88[_0x2178('0x31')]['sort']);_0x511934['where']=qs[_0x2178('0x32')](_[_0x2178('0x4c')](_0x2d1e88[_0x2178('0x31')],_0x506d4c[_0x2178('0x32')]));if(_0x2d1e88[_0x2178('0x31')][_0x2178('0x3a')]){_0x511934[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x511934[_0x2178('0x3b')],{'$or':_[_0x2178('0x2b')](_0x511934[_0x2178('0x33')],function(_0x23237b){var _0x329968={};_0x329968[_0x23237b]={'$like':'%'+_0x2d1e88[_0x2178('0x31')]['filter']+'%'};return _0x329968;})});}_0x511934=_[_0x2178('0x3c')]({},_0x511934,_0x2d1e88[_0x2178('0x3e')]);return _0x37b16c['getSubjects'](_0x511934);}})[_0x2178('0x26')](function(_0x49c55e){if(_0x49c55e){_0x19bc74=_0x49c55e[_0x2178('0x36')];if(!_0x2d1e88[_0x2178('0x31')][_0x2178('0x37')]('nolimit')){_0x511934[_0x2178('0x1f')]=qs[_0x2178('0x1f')](_0x2d1e88['query'][_0x2178('0x1f')]);_0x511934[_0x2178('0x1c')]=qs[_0x2178('0x1c')](_0x2d1e88[_0x2178('0x31')]['offset']);}return _0x37b16c[_0x2178('0x4e')](_0x511934);}})[_0x2178('0x26')](function(_0x5e7525){if(_0x5e7525){return _0x5e7525?{'count':_0x19bc74,'rows':_0x5e7525}:null;}})[_0x2178('0x26')](respondWithResult(_0x4f8652,null))[_0x2178('0x41')](handleError(_0x4f8652,null));};exports[_0x2178('0x4f')]=function(_0x3cc7dc,_0x155cf3,_0x56ee55){var _0x55fcd6={};var _0x35a70e={};var _0x479679;var _0x574f14;return db['VtigerConfiguration'][_0x2178('0x49')]({'where':{'id':_0x3cc7dc['params']['id']}})[_0x2178('0x26')](handleEntityNotFound(_0x155cf3,null))[_0x2178('0x26')](function(_0x66e500){if(_0x66e500){_0x479679=_0x66e500;_0x35a70e[_0x2178('0x30')]=_[_0x2178('0x44')](db[_0x2178('0x4a')]['rawAttributes']);_0x35a70e[_0x2178('0x31')]=_[_0x2178('0x44')](_0x3cc7dc[_0x2178('0x31')]);_0x35a70e[_0x2178('0x32')]=_[_0x2178('0x34')](_0x35a70e['model'],_0x35a70e[_0x2178('0x31')]);_0x55fcd6[_0x2178('0x33')]=_[_0x2178('0x34')](_0x35a70e[_0x2178('0x30')],qs['fields'](_0x3cc7dc[_0x2178('0x31')][_0x2178('0x35')]));_0x55fcd6[_0x2178('0x33')]=_0x55fcd6['attributes']['length']?_0x55fcd6[_0x2178('0x33')]:_0x35a70e[_0x2178('0x30')];_0x55fcd6[_0x2178('0x38')]=qs['sort'](_0x3cc7dc['query'][_0x2178('0x39')]);_0x55fcd6[_0x2178('0x3b')]=qs[_0x2178('0x32')](_[_0x2178('0x4c')](_0x3cc7dc[_0x2178('0x31')],_0x35a70e['filters']));if(_0x3cc7dc[_0x2178('0x31')][_0x2178('0x3a')]){_0x55fcd6[_0x2178('0x3b')]=_[_0x2178('0x3c')](_0x55fcd6[_0x2178('0x3b')],{'$or':_[_0x2178('0x2b')](_0x55fcd6[_0x2178('0x33')],function(_0x3ccb8c){var _0xc0038c={};_0xc0038c[_0x3ccb8c]={'$like':'%'+_0x3cc7dc['query'][_0x2178('0x3a')]+'%'};return _0xc0038c;})});}_0x55fcd6=_[_0x2178('0x3c')]({},_0x55fcd6,_0x3cc7dc[_0x2178('0x3e')]);return _0x479679[_0x2178('0x4f')](_0x55fcd6);}})[_0x2178('0x26')](function(_0x243d3f){if(_0x243d3f){_0x574f14=_0x243d3f[_0x2178('0x36')];if(!_0x3cc7dc['query']['hasOwnProperty']('nolimit')){_0x55fcd6[_0x2178('0x1f')]=qs[_0x2178('0x1f')](_0x3cc7dc['query'][_0x2178('0x1f')]);_0x55fcd6[_0x2178('0x1c')]=qs[_0x2178('0x1c')](_0x3cc7dc[_0x2178('0x31')][_0x2178('0x1c')]);}return _0x479679[_0x2178('0x4f')](_0x55fcd6);}})[_0x2178('0x26')](function(_0x27545d){if(_0x27545d){return _0x27545d?{'count':_0x574f14,'rows':_0x27545d}:null;}})[_0x2178('0x26')](respondWithResult(_0x155cf3,null))[_0x2178('0x41')](handleError(_0x155cf3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 363b5d6..221f807 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 _0x436d=['define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports'];(function(_0x309a7f,_0x501a13){var _0x12b2ff=function(_0x3ba24e){while(--_0x3ba24e){_0x309a7f['push'](_0x309a7f['shift']());}};_0x12b2ff(++_0x501a13);}(_0x436d,0x9f));var _0xd436=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x436d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xd436('0x0'));var logger=require(_0xd436('0x1'))(_0xd436('0x2'));var moment=require(_0xd436('0x3'));var BPromise=require(_0xd436('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd436('0x5'));var rimraf=require(_0xd436('0x6'));var config=require(_0xd436('0x7'));var attributes=require(_0xd436('0x8'));module[_0xd436('0x9')]=function(_0x5854db,_0x5814db){return _0x5854db[_0xd436('0xa')](_0xd436('0xb'),attributes,{'tableName':_0xd436('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe492=['../../config/logger','moment','path','rimraf','define','int_vtiger_configurations','lodash','util'];(function(_0x4c8dbe,_0x3ce317){var _0x457be7=function(_0x3762ce){while(--_0x3762ce){_0x4c8dbe['push'](_0x4c8dbe['shift']());}};_0x457be7(++_0x3ce317);}(_0xe492,0x1be));var _0x2e49=function(_0x221a9f,_0x2a5e1c){_0x221a9f=_0x221a9f-0x0;var _0x5976c7=_0xe492[_0x221a9f];return _0x5976c7;};'use strict';var _=require(_0x2e49('0x0'));var util=require(_0x2e49('0x1'));var logger=require(_0x2e49('0x2'))('api');var moment=require(_0x2e49('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e49('0x4'));var rimraf=require(_0x2e49('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x335d9f,_0x4e2dfc){return _0x335d9f[_0x2e49('0x6')]('VtigerConfiguration',attributes,{'tableName':_0x2e49('0x7'),'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 53e4eda..62312ef 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 _0xa1a1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x533894,_0xd46353){var _0x6bd6a=function(_0x2582d4){while(--_0x2582d4){_0x533894['push'](_0x533894['shift']());}};_0x6bd6a(++_0xd46353);}(_0xa1a1,0xd0));var _0x1a1a=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xa1a1[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0x1a1a('0x0'));var util=require(_0x1a1a('0x1'));var moment=require(_0x1a1a('0x2'));var BPromise=require(_0x1a1a('0x3'));var rs=require(_0x1a1a('0x4'));var fs=require('fs');var Redis=require(_0x1a1a('0x5'));var db=require(_0x1a1a('0x6'))['db'];var utils=require(_0x1a1a('0x7'));var logger=require(_0x1a1a('0x8'))(_0x1a1a('0x9'));var config=require(_0x1a1a('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1a1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd5ae67,_0xeeaba8,_0x3999f6){return new BPromise(function(_0x279f48,_0x2f026f){return client[_0x1a1a('0xc')](_0xd5ae67,_0x3999f6)['then'](function(_0x41ad2e){logger['info'](_0x1a1a('0xd'),_0xeeaba8,_0x1a1a('0xe'));logger[_0x1a1a('0xf')](_0x1a1a('0x10'),_0xeeaba8,_0x1a1a('0xe'),JSON[_0x1a1a('0x11')](_0x41ad2e));if(_0x41ad2e[_0x1a1a('0x12')]){if(_0x41ad2e[_0x1a1a('0x12')][_0x1a1a('0x13')]===0x1f4){logger[_0x1a1a('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0xeeaba8,_0x41ad2e[_0x1a1a('0x12')][_0x1a1a('0x14')]);return _0x2f026f(_0x41ad2e['error'][_0x1a1a('0x14')]);}logger[_0x1a1a('0x12')](_0x1a1a('0xd'),_0xeeaba8,_0x41ad2e[_0x1a1a('0x12')][_0x1a1a('0x14')]);return _0x279f48(_0x41ad2e[_0x1a1a('0x12')][_0x1a1a('0x14')]);}else{logger[_0x1a1a('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0xeeaba8,_0x1a1a('0xe'));_0x279f48(_0x41ad2e['result'][_0x1a1a('0x14')]);}})[_0x1a1a('0x16')](function(_0x25a93c){logger[_0x1a1a('0x12')](_0x1a1a('0xd'),_0xeeaba8,_0x25a93c);_0x2f026f(_0x25a93c);});});} \ No newline at end of file +var _0x95fc=['debug','request\x20sent','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x95fc,0x72));var _0xc95f=function(_0x14f54a,_0x42536b){_0x14f54a=_0x14f54a-0x0;var _0x122b3a=_0x95fc[_0x14f54a];return _0x122b3a;};'use strict';var _=require('lodash');var util=require(_0xc95f('0x0'));var moment=require('moment');var BPromise=require(_0xc95f('0x1'));var rs=require(_0xc95f('0x2'));var fs=require('fs');var Redis=require(_0xc95f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc95f('0x4'));var logger=require(_0xc95f('0x5'))('rpc');var config=require(_0xc95f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc95f('0x7')][_0xc95f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5255e3,_0x391425,_0x5c90e2){return new BPromise(function(_0x160800,_0x342052){return client[_0xc95f('0x9')](_0x5255e3,_0x5c90e2)['then'](function(_0x22e45b){logger[_0xc95f('0xa')](_0xc95f('0xb'),_0x391425,'request\x20sent');logger[_0xc95f('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x391425,_0xc95f('0xd'),JSON[_0xc95f('0xe')](_0x22e45b));if(_0x22e45b[_0xc95f('0xf')]){if(_0x22e45b['error']['code']===0x1f4){logger[_0xc95f('0xf')](_0xc95f('0xb'),_0x391425,_0x22e45b[_0xc95f('0xf')]['message']);return _0x342052(_0x22e45b['error'][_0xc95f('0x10')]);}logger[_0xc95f('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x391425,_0x22e45b[_0xc95f('0xf')][_0xc95f('0x10')]);return _0x160800(_0x22e45b[_0xc95f('0xf')][_0xc95f('0x10')]);}else{logger[_0xc95f('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x391425,_0xc95f('0xd'));_0x160800(_0x22e45b[_0xc95f('0x11')][_0xc95f('0x10')]);}})['catch'](function(_0x2f3b99){logger['error'](_0xc95f('0xb'),_0x391425,_0x2f3b99);_0x342052(_0x2f3b99);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index cfde4b7..8a52d14 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 _0xcda7=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','put','update'];(function(_0x14e5da,_0x47d33e){var _0x3762cc=function(_0x358cc4){while(--_0x358cc4){_0x14e5da['push'](_0x14e5da['shift']());}};_0x3762cc(++_0x47d33e);}(_0xcda7,0xe1));var _0x7cda=function(_0x320453,_0x253d70){_0x320453=_0x320453-0x0;var _0x4f7811=_0xcda7[_0x320453];return _0x4f7811;};'use strict';var multer=require(_0x7cda('0x0'));var util=require(_0x7cda('0x1'));var path=require('path');var timeout=require(_0x7cda('0x2'));var express=require(_0x7cda('0x3'));var router=express[_0x7cda('0x4')]();var fs_extra=require(_0x7cda('0x5'));var auth=require(_0x7cda('0x6'));var interaction=require(_0x7cda('0x7'));var config=require('../../config/environment');var controller=require(_0x7cda('0x8'));router[_0x7cda('0x9')]('/',auth[_0x7cda('0xa')](),controller[_0x7cda('0xb')]);router[_0x7cda('0x9')](_0x7cda('0xc'),auth[_0x7cda('0xa')](),controller['show']);router['post']('/',auth[_0x7cda('0xa')](),controller['create']);router[_0x7cda('0xd')](_0x7cda('0xc'),auth[_0x7cda('0xa')](),controller[_0x7cda('0xe')]);router['delete'](_0x7cda('0xc'),auth[_0x7cda('0xa')](),controller['destroy']);module[_0x7cda('0xf')]=router; \ No newline at end of file +var _0x0842=['./intVtigerField.controller','get','isAuthenticated','index','post','/:id','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2790d3,_0x49b450){var _0x4ef096=function(_0x28d3e6){while(--_0x28d3e6){_0x2790d3['push'](_0x2790d3['shift']());}};_0x4ef096(++_0x49b450);}(_0x0842,0x68));var _0x2084=function(_0x51e4bd,_0x31c995){_0x51e4bd=_0x51e4bd-0x0;var _0x3c5c7e=_0x0842[_0x51e4bd];return _0x3c5c7e;};'use strict';var multer=require(_0x2084('0x0'));var util=require(_0x2084('0x1'));var path=require(_0x2084('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2084('0x3')]();var fs_extra=require(_0x2084('0x4'));var auth=require(_0x2084('0x5'));var interaction=require(_0x2084('0x6'));var config=require(_0x2084('0x7'));var controller=require(_0x2084('0x8'));router[_0x2084('0x9')]('/',auth[_0x2084('0xa')](),controller[_0x2084('0xb')]);router[_0x2084('0x9')]('/:id',auth[_0x2084('0xa')](),controller['show']);router[_0x2084('0xc')]('/',auth[_0x2084('0xa')](),controller['create']);router['put'](_0x2084('0xd'),auth['isAuthenticated'](),controller[_0x2084('0xe')]);router['delete'](_0x2084('0xd'),auth[_0x2084('0xa')](),controller['destroy']);module[_0x2084('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index f333fd0..de2e1ac 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 _0xeea0=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xeea0,0xa4));var _0x0eea=function(_0x12df3e,_0x589d88){_0x12df3e=_0x12df3e-0x0;var _0x28fc39=_0xeea0[_0x12df3e];return _0x28fc39;};'use strict';var Sequelize=require(_0x0eea('0x0'));module[_0x0eea('0x1')]={'type':{'type':Sequelize[_0x0eea('0x2')](_0x0eea('0x3'),_0x0eea('0x4'),_0x0eea('0x5'),_0x0eea('0x6'),_0x0eea('0x7')),'defaultValue':_0x0eea('0x3')},'content':{'type':Sequelize[_0x0eea('0x8')]},'key':{'type':Sequelize[_0x0eea('0x8')]},'keyType':{'type':Sequelize[_0x0eea('0x2')](_0x0eea('0x3'),_0x0eea('0x4'),_0x0eea('0x5'))},'keyContent':{'type':Sequelize[_0x0eea('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb447=['string','STRING','BOOLEAN','sequelize','exports','variable','customVariable','picklist'];(function(_0x3cb09b,_0x31c2a5){var _0x242048=function(_0x464aba){while(--_0x464aba){_0x3cb09b['push'](_0x3cb09b['shift']());}};_0x242048(++_0x31c2a5);}(_0xb447,0x7b));var _0x7b44=function(_0x505df4,_0xd9144d){_0x505df4=_0x505df4-0x0;var _0x14c25b=_0xb447[_0x505df4];return _0x14c25b;};'use strict';var Sequelize=require(_0x7b44('0x0'));module[_0x7b44('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x7b44('0x2'),_0x7b44('0x3'),'keyValue',_0x7b44('0x4')),'defaultValue':_0x7b44('0x5')},'content':{'type':Sequelize[_0x7b44('0x6')]},'key':{'type':Sequelize[_0x7b44('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x7b44('0x5'),_0x7b44('0x2'),_0x7b44('0x3'))},'keyContent':{'type':Sequelize[_0x7b44('0x6')]},'idField':{'type':Sequelize[_0x7b44('0x6')]},'nameField':{'type':Sequelize[_0x7b44('0x6')]},'customField':{'type':Sequelize[_0x7b44('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 2c02bba..9174dc3 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 _0xc7f5=['../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VtigerField','findAll','show','params','rawAttributes','options','catch','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util'];(function(_0xe5bfe5,_0x4747d7){var _0x5084e6=function(_0x160f8e){while(--_0x160f8e){_0xe5bfe5['push'](_0xe5bfe5['shift']());}};_0x5084e6(++_0x4747d7);}(_0xc7f5,0xb8));var _0x5c7f=function(_0x1ad05b,_0x3f9409){_0x1ad05b=_0x1ad05b-0x0;var _0xe223ec=_0xc7f5[_0x1ad05b];return _0xe223ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c7f('0x0'));var zipdir=require(_0x5c7f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c7f('0x2'));var moment=require(_0x5c7f('0x3'));var BPromise=require(_0x5c7f('0x4'));var Mustache=require(_0x5c7f('0x5'));var util=require(_0x5c7f('0x6'));var path=require(_0x5c7f('0x7'));var sox=require(_0x5c7f('0x8'));var csv=require(_0x5c7f('0x9'));var ejs=require(_0x5c7f('0xa'));var fs=require('fs');var fs_extra=require(_0x5c7f('0xb'));var _=require(_0x5c7f('0xc'));var squel=require(_0x5c7f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c7f('0x9'));var querystring=require(_0x5c7f('0xe'));var Papa=require(_0x5c7f('0xf'));var Redis=require(_0x5c7f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c7f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5c7f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5c7f('0x13'));var db=require(_0x5c7f('0x14'))['db'];function respondWithStatusCode(_0x15eeb2,_0x3e59a2){_0x3e59a2=_0x3e59a2||0xcc;return function(_0x1d76e2){if(_0x1d76e2){return _0x15eeb2['sendStatus'](_0x3e59a2);}return _0x15eeb2[_0x5c7f('0x15')](_0x3e59a2)[_0x5c7f('0x16')]();};}function respondWithResult(_0x71265f,_0x4e91ba){_0x4e91ba=_0x4e91ba||0xc8;return function(_0x525a83){if(_0x525a83){return _0x71265f[_0x5c7f('0x15')](_0x4e91ba)[_0x5c7f('0x17')](_0x525a83);}};}function respondWithFilteredResult(_0x4ff309,_0x12ac43){return function(_0x2c8039){if(_0x2c8039){var _0x270d94=typeof _0x12ac43['offset']===_0x5c7f('0x18')&&typeof _0x12ac43['limit']===_0x5c7f('0x18');var _0x2923b5=_0x2c8039[_0x5c7f('0x19')];var _0x269121=_0x270d94?0x0:_0x12ac43[_0x5c7f('0x1a')];var _0x299f34=_0x270d94?_0x2c8039[_0x5c7f('0x19')]:_0x12ac43[_0x5c7f('0x1a')]+_0x12ac43[_0x5c7f('0x1b')];var _0xcd60d8;if(_0x299f34>=_0x2923b5){_0x299f34=_0x2923b5;_0xcd60d8=0xc8;}else{_0xcd60d8=0xce;}_0x4ff309['status'](_0xcd60d8);return _0x4ff309[_0x5c7f('0x1c')](_0x5c7f('0x1d'),_0x269121+'-'+_0x299f34+'/'+_0x2923b5)[_0x5c7f('0x17')](_0x2c8039);}return null;};}function patchUpdates(_0x3be3e7){return function(_0x482a5e){try{jsonpatch[_0x5c7f('0x1e')](_0x482a5e,_0x3be3e7,!![]);}catch(_0x27d77b){return BPromise[_0x5c7f('0x1f')](_0x27d77b);}return _0x482a5e[_0x5c7f('0x20')]();};}function saveUpdates(_0x9b381,_0x16869f){return function(_0x4f1812){if(_0x4f1812){return _0x4f1812[_0x5c7f('0x21')](_0x9b381)[_0x5c7f('0x22')](function(_0x32a5ef){return _0x32a5ef;});}return null;};}function removeEntity(_0x51449f,_0x3f04e9){return function(_0x4d15d3){if(_0x4d15d3){return _0x4d15d3['destroy']()[_0x5c7f('0x22')](function(){_0x51449f[_0x5c7f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b014d,_0x4b3689){return function(_0x350bec){if(!_0x350bec){_0x3b014d['sendStatus'](0x194);}return _0x350bec;};}function handleError(_0x12171,_0x37aded){_0x37aded=_0x37aded||0x1f4;return function(_0x4cfe30){logger[_0x5c7f('0x23')](_0x4cfe30[_0x5c7f('0x24')]);if(_0x4cfe30[_0x5c7f('0x25')]){delete _0x4cfe30['name'];}_0x12171[_0x5c7f('0x15')](_0x37aded)[_0x5c7f('0x26')](_0x4cfe30);};}exports[_0x5c7f('0x27')]=function(_0xc7fb5a,_0x7e7220){var _0x15ba51={},_0x264886={},_0x34ba11={'count':0x0,'rows':[]};var _0x4872e0=_['map'](db['VtigerField']['rawAttributes'],function(_0x569418){return{'name':_0x569418['fieldName'],'type':_0x569418[_0x5c7f('0x28')][_0x5c7f('0x29')]};});_0x264886[_0x5c7f('0x2a')]=_[_0x5c7f('0x2b')](_0x4872e0,_0x5c7f('0x25'));_0x264886['query']=_[_0x5c7f('0x2c')](_0xc7fb5a[_0x5c7f('0x2d')]);_0x264886['filters']=_['intersection'](_0x264886['model'],_0x264886[_0x5c7f('0x2d')]);_0x15ba51[_0x5c7f('0x2e')]=_[_0x5c7f('0x2f')](_0x264886[_0x5c7f('0x2a')],qs[_0x5c7f('0x30')](_0xc7fb5a[_0x5c7f('0x2d')]['fields']));_0x15ba51[_0x5c7f('0x2e')]=_0x15ba51[_0x5c7f('0x2e')][_0x5c7f('0x31')]?_0x15ba51['attributes']:_0x264886['model'];if(!_0xc7fb5a[_0x5c7f('0x2d')][_0x5c7f('0x32')](_0x5c7f('0x33'))){_0x15ba51['limit']=qs[_0x5c7f('0x1b')](_0xc7fb5a[_0x5c7f('0x2d')]['limit']);_0x15ba51['offset']=qs['offset'](_0xc7fb5a[_0x5c7f('0x2d')][_0x5c7f('0x1a')]);}_0x15ba51['order']=qs[_0x5c7f('0x34')](_0xc7fb5a[_0x5c7f('0x2d')]['sort']);_0x15ba51[_0x5c7f('0x35')]=qs['filters'](_[_0x5c7f('0x36')](_0xc7fb5a[_0x5c7f('0x2d')],_0x264886[_0x5c7f('0x37')]),_0x4872e0);if(_0xc7fb5a[_0x5c7f('0x2d')][_0x5c7f('0x38')]){_0x15ba51['where']=_[_0x5c7f('0x39')](_0x15ba51[_0x5c7f('0x35')],{'$or':_['map'](_0x4872e0,function(_0x32b282){if(_0x32b282[_0x5c7f('0x28')]!=='VIRTUAL'){var _0x440993={};_0x440993[_0x32b282[_0x5c7f('0x25')]]={'$like':'%'+_0xc7fb5a[_0x5c7f('0x2d')][_0x5c7f('0x38')]+'%'};return _0x440993;}})});}_0x15ba51=_[_0x5c7f('0x39')]({},_0x15ba51,_0xc7fb5a['options']);var _0x5a43e2={'where':_0x15ba51[_0x5c7f('0x35')]};return db['VtigerField'][_0x5c7f('0x19')](_0x5a43e2)[_0x5c7f('0x22')](function(_0x3793c){_0x34ba11[_0x5c7f('0x19')]=_0x3793c;if(_0xc7fb5a['query']['includeAll']){_0x15ba51['include']=[{'all':!![]}];}return db[_0x5c7f('0x3a')][_0x5c7f('0x3b')](_0x15ba51);})[_0x5c7f('0x22')](function(_0x532170){_0x34ba11['rows']=_0x532170;return _0x34ba11;})[_0x5c7f('0x22')](respondWithFilteredResult(_0x7e7220,_0x15ba51))['catch'](handleError(_0x7e7220,null));};exports[_0x5c7f('0x3c')]=function(_0x5e21d9,_0x558cac){var _0x2390c7={'raw':!![],'where':{'id':_0x5e21d9[_0x5c7f('0x3d')]['id']}},_0x2a69d4={};_0x2a69d4[_0x5c7f('0x2a')]=_[_0x5c7f('0x2c')](db['VtigerField'][_0x5c7f('0x3e')]);_0x2a69d4[_0x5c7f('0x2d')]=_[_0x5c7f('0x2c')](_0x5e21d9[_0x5c7f('0x2d')]);_0x2a69d4[_0x5c7f('0x37')]=_[_0x5c7f('0x2f')](_0x2a69d4[_0x5c7f('0x2a')],_0x2a69d4[_0x5c7f('0x2d')]);_0x2390c7[_0x5c7f('0x2e')]=_['intersection'](_0x2a69d4[_0x5c7f('0x2a')],qs[_0x5c7f('0x30')](_0x5e21d9[_0x5c7f('0x2d')][_0x5c7f('0x30')]));_0x2390c7[_0x5c7f('0x2e')]=_0x2390c7[_0x5c7f('0x2e')][_0x5c7f('0x31')]?_0x2390c7[_0x5c7f('0x2e')]:_0x2a69d4[_0x5c7f('0x2a')];if(_0x5e21d9[_0x5c7f('0x2d')]['includeAll']){_0x2390c7['include']=[{'all':!![]}];}_0x2390c7=_[_0x5c7f('0x39')]({},_0x2390c7,_0x5e21d9[_0x5c7f('0x3f')]);return db[_0x5c7f('0x3a')]['find'](_0x2390c7)[_0x5c7f('0x22')](handleEntityNotFound(_0x558cac,null))[_0x5c7f('0x22')](respondWithResult(_0x558cac,null))[_0x5c7f('0x40')](handleError(_0x558cac,null));};exports[_0x5c7f('0x41')]=function(_0x39ffb6,_0x120bc2){return db['VtigerField'][_0x5c7f('0x41')](_0x39ffb6[_0x5c7f('0x42')],{})[_0x5c7f('0x22')](respondWithResult(_0x120bc2,0xc9))[_0x5c7f('0x40')](handleError(_0x120bc2,null));};exports['update']=function(_0x373ad1,_0x270d9b){if(_0x373ad1[_0x5c7f('0x42')]['id']){delete _0x373ad1[_0x5c7f('0x42')]['id'];}return db[_0x5c7f('0x3a')][_0x5c7f('0x43')]({'where':{'id':_0x373ad1[_0x5c7f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x270d9b,null))[_0x5c7f('0x22')](saveUpdates(_0x373ad1[_0x5c7f('0x42')],null))[_0x5c7f('0x22')](respondWithResult(_0x270d9b,null))[_0x5c7f('0x40')](handleError(_0x270d9b,null));};exports['destroy']=function(_0x3f61e9,_0x4e1069){return db[_0x5c7f('0x3a')][_0x5c7f('0x43')]({'where':{'id':_0x3f61e9[_0x5c7f('0x3d')]['id']}})[_0x5c7f('0x22')](handleEntityNotFound(_0x4e1069,null))[_0x5c7f('0x22')](removeEntity(_0x4e1069,null))[_0x5c7f('0x40')](handleError(_0x4e1069,null));}; \ No newline at end of file +var _0xbdd7=['show','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','VtigerField','findAll','rows'];(function(_0x5da209,_0x428b32){var _0x163459=function(_0x30004a){while(--_0x30004a){_0x5da209['push'](_0x5da209['shift']());}};_0x163459(++_0x428b32);}(_0xbdd7,0xe4));var _0x7bdd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbdd7[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7bdd('0x0'));var rimraf=require(_0x7bdd('0x1'));var zipdir=require(_0x7bdd('0x2'));var jsonpatch=require(_0x7bdd('0x3'));var rp=require(_0x7bdd('0x4'));var moment=require(_0x7bdd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7bdd('0x6'));var util=require(_0x7bdd('0x7'));var path=require(_0x7bdd('0x8'));var sox=require('sox');var csv=require(_0x7bdd('0x9'));var ejs=require(_0x7bdd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bdd('0xb'));var squel=require(_0x7bdd('0xc'));var crypto=require('crypto');var jsforce=require(_0x7bdd('0xd'));var deskjs=require(_0x7bdd('0xe'));var toCsv=require(_0x7bdd('0x9'));var querystring=require(_0x7bdd('0xf'));var Papa=require(_0x7bdd('0x10'));var Redis=require(_0x7bdd('0x11'));var authService=require(_0x7bdd('0x12'));var qs=require(_0x7bdd('0x13'));var as=require(_0x7bdd('0x14'));var hardwareService=require(_0x7bdd('0x15'));var logger=require(_0x7bdd('0x16'))(_0x7bdd('0x17'));var utils=require('../../config/utils');var config=require(_0x7bdd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36948f,_0x196f28){_0x196f28=_0x196f28||0xcc;return function(_0x5731fd){if(_0x5731fd){return _0x36948f[_0x7bdd('0x19')](_0x196f28);}return _0x36948f[_0x7bdd('0x1a')](_0x196f28)[_0x7bdd('0x1b')]();};}function respondWithResult(_0x2ddf5c,_0xc316db){_0xc316db=_0xc316db||0xc8;return function(_0x56b0c9){if(_0x56b0c9){return _0x2ddf5c[_0x7bdd('0x1a')](_0xc316db)[_0x7bdd('0x1c')](_0x56b0c9);}};}function respondWithFilteredResult(_0x43d70e,_0x4788e7){return function(_0x42a66b){if(_0x42a66b){var _0x14fd4d=typeof _0x4788e7[_0x7bdd('0x1d')]===_0x7bdd('0x1e')&&typeof _0x4788e7[_0x7bdd('0x1f')]===_0x7bdd('0x1e');var _0x294757=_0x42a66b['count'];var _0x56e802=_0x14fd4d?0x0:_0x4788e7[_0x7bdd('0x1d')];var _0x5203c4=_0x14fd4d?_0x42a66b[_0x7bdd('0x20')]:_0x4788e7[_0x7bdd('0x1d')]+_0x4788e7[_0x7bdd('0x1f')];var _0x33b3b2;if(_0x5203c4>=_0x294757){_0x5203c4=_0x294757;_0x33b3b2=0xc8;}else{_0x33b3b2=0xce;}_0x43d70e['status'](_0x33b3b2);return _0x43d70e['set'](_0x7bdd('0x21'),_0x56e802+'-'+_0x5203c4+'/'+_0x294757)[_0x7bdd('0x1c')](_0x42a66b);}return null;};}function patchUpdates(_0x16fd42){return function(_0xdd9da7){try{jsonpatch[_0x7bdd('0x22')](_0xdd9da7,_0x16fd42,!![]);}catch(_0x45bd63){return BPromise[_0x7bdd('0x23')](_0x45bd63);}return _0xdd9da7[_0x7bdd('0x24')]();};}function saveUpdates(_0x51efa6,_0x5b1f45){return function(_0x163480){if(_0x163480){return _0x163480[_0x7bdd('0x25')](_0x51efa6)[_0x7bdd('0x26')](function(_0x39455a){return _0x39455a;});}return null;};}function removeEntity(_0x4b13d1,_0x5bd5e0){return function(_0x3a021e){if(_0x3a021e){return _0x3a021e[_0x7bdd('0x27')]()[_0x7bdd('0x26')](function(){_0x4b13d1[_0x7bdd('0x1a')](0xcc)[_0x7bdd('0x1b')]();});}};}function handleEntityNotFound(_0x535b03,_0x2aab45){return function(_0x5ce535){if(!_0x5ce535){_0x535b03[_0x7bdd('0x19')](0x194);}return _0x5ce535;};}function handleError(_0x21ae8a,_0x1b21a0){_0x1b21a0=_0x1b21a0||0x1f4;return function(_0x58b975){logger[_0x7bdd('0x28')](_0x58b975[_0x7bdd('0x29')]);if(_0x58b975[_0x7bdd('0x2a')]){delete _0x58b975['name'];}_0x21ae8a[_0x7bdd('0x1a')](_0x1b21a0)[_0x7bdd('0x2b')](_0x58b975);};}exports[_0x7bdd('0x2c')]=function(_0x138775,_0x15a3a4){var _0x364746={},_0x4efee8={},_0x2c8cfe={'count':0x0,'rows':[]};var _0x536537=_[_0x7bdd('0x2d')](db['VtigerField']['rawAttributes'],function(_0x44b0de){return{'name':_0x44b0de[_0x7bdd('0x2e')],'type':_0x44b0de[_0x7bdd('0x2f')]['key']};});_0x4efee8[_0x7bdd('0x30')]=_[_0x7bdd('0x2d')](_0x536537,'name');_0x4efee8[_0x7bdd('0x31')]=_[_0x7bdd('0x32')](_0x138775['query']);_0x4efee8[_0x7bdd('0x33')]=_[_0x7bdd('0x34')](_0x4efee8[_0x7bdd('0x30')],_0x4efee8[_0x7bdd('0x31')]);_0x364746[_0x7bdd('0x35')]=_['intersection'](_0x4efee8[_0x7bdd('0x30')],qs[_0x7bdd('0x36')](_0x138775[_0x7bdd('0x31')][_0x7bdd('0x36')]));_0x364746[_0x7bdd('0x35')]=_0x364746[_0x7bdd('0x35')][_0x7bdd('0x37')]?_0x364746[_0x7bdd('0x35')]:_0x4efee8['model'];if(!_0x138775[_0x7bdd('0x31')][_0x7bdd('0x38')](_0x7bdd('0x39'))){_0x364746[_0x7bdd('0x1f')]=qs[_0x7bdd('0x1f')](_0x138775[_0x7bdd('0x31')][_0x7bdd('0x1f')]);_0x364746[_0x7bdd('0x1d')]=qs[_0x7bdd('0x1d')](_0x138775['query'][_0x7bdd('0x1d')]);}_0x364746[_0x7bdd('0x3a')]=qs[_0x7bdd('0x3b')](_0x138775[_0x7bdd('0x31')][_0x7bdd('0x3b')]);_0x364746[_0x7bdd('0x3c')]=qs[_0x7bdd('0x33')](_['pick'](_0x138775[_0x7bdd('0x31')],_0x4efee8['filters']),_0x536537);if(_0x138775[_0x7bdd('0x31')][_0x7bdd('0x3d')]){_0x364746['where']=_['merge'](_0x364746['where'],{'$or':_[_0x7bdd('0x2d')](_0x536537,function(_0x227964){if(_0x227964[_0x7bdd('0x2f')]!=='VIRTUAL'){var _0x18c7a6={};_0x18c7a6[_0x227964[_0x7bdd('0x2a')]]={'$like':'%'+_0x138775[_0x7bdd('0x31')][_0x7bdd('0x3d')]+'%'};return _0x18c7a6;}})});}_0x364746=_['merge']({},_0x364746,_0x138775[_0x7bdd('0x3e')]);var _0x1c520b={'where':_0x364746[_0x7bdd('0x3c')]};return db['VtigerField'][_0x7bdd('0x20')](_0x1c520b)[_0x7bdd('0x26')](function(_0x1b21d1){_0x2c8cfe[_0x7bdd('0x20')]=_0x1b21d1;if(_0x138775[_0x7bdd('0x31')][_0x7bdd('0x3f')]){_0x364746[_0x7bdd('0x40')]=[{'all':!![]}];}return db[_0x7bdd('0x41')][_0x7bdd('0x42')](_0x364746);})['then'](function(_0x594114){_0x2c8cfe[_0x7bdd('0x43')]=_0x594114;return _0x2c8cfe;})['then'](respondWithFilteredResult(_0x15a3a4,_0x364746))['catch'](handleError(_0x15a3a4,null));};exports[_0x7bdd('0x44')]=function(_0x481a83,_0x221c5c){var _0x4424fb={'raw':!![],'where':{'id':_0x481a83['params']['id']}},_0x43e733={};_0x43e733[_0x7bdd('0x30')]=_[_0x7bdd('0x32')](db[_0x7bdd('0x41')]['rawAttributes']);_0x43e733['query']=_[_0x7bdd('0x32')](_0x481a83[_0x7bdd('0x31')]);_0x43e733[_0x7bdd('0x33')]=_[_0x7bdd('0x34')](_0x43e733['model'],_0x43e733[_0x7bdd('0x31')]);_0x4424fb[_0x7bdd('0x35')]=_['intersection'](_0x43e733[_0x7bdd('0x30')],qs[_0x7bdd('0x36')](_0x481a83[_0x7bdd('0x31')][_0x7bdd('0x36')]));_0x4424fb[_0x7bdd('0x35')]=_0x4424fb[_0x7bdd('0x35')][_0x7bdd('0x37')]?_0x4424fb['attributes']:_0x43e733[_0x7bdd('0x30')];if(_0x481a83['query'][_0x7bdd('0x3f')]){_0x4424fb[_0x7bdd('0x40')]=[{'all':!![]}];}_0x4424fb=_['merge']({},_0x4424fb,_0x481a83[_0x7bdd('0x3e')]);return db['VtigerField'][_0x7bdd('0x45')](_0x4424fb)[_0x7bdd('0x26')](handleEntityNotFound(_0x221c5c,null))[_0x7bdd('0x26')](respondWithResult(_0x221c5c,null))[_0x7bdd('0x46')](handleError(_0x221c5c,null));};exports[_0x7bdd('0x47')]=function(_0x5ba20b,_0x5dc2ac){return db['VtigerField'][_0x7bdd('0x47')](_0x5ba20b[_0x7bdd('0x48')],{})[_0x7bdd('0x26')](respondWithResult(_0x5dc2ac,0xc9))['catch'](handleError(_0x5dc2ac,null));};exports[_0x7bdd('0x25')]=function(_0x655ad5,_0x53405d){if(_0x655ad5[_0x7bdd('0x48')]['id']){delete _0x655ad5[_0x7bdd('0x48')]['id'];}return db[_0x7bdd('0x41')][_0x7bdd('0x45')]({'where':{'id':_0x655ad5[_0x7bdd('0x49')]['id']}})[_0x7bdd('0x26')](handleEntityNotFound(_0x53405d,null))['then'](saveUpdates(_0x655ad5[_0x7bdd('0x48')],null))[_0x7bdd('0x26')](respondWithResult(_0x53405d,null))[_0x7bdd('0x46')](handleError(_0x53405d,null));};exports[_0x7bdd('0x27')]=function(_0x1bd175,_0x441fec){return db[_0x7bdd('0x41')][_0x7bdd('0x45')]({'where':{'id':_0x1bd175[_0x7bdd('0x49')]['id']}})[_0x7bdd('0x26')](handleEntityNotFound(_0x441fec,null))[_0x7bdd('0x26')](removeEntity(_0x441fec,null))[_0x7bdd('0x46')](handleError(_0x441fec,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 9a71101..0f2c8b9 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 _0xfc2e=['request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','moment'];(function(_0x62edaf,_0x49d69f){var _0x169468=function(_0x6ffba3){while(--_0x6ffba3){_0x62edaf['push'](_0x62edaf['shift']());}};_0x169468(++_0x49d69f);}(_0xfc2e,0x72));var _0xefc2=function(_0xe11c85,_0x20ba28){_0xe11c85=_0xe11c85-0x0;var _0xdbfe83=_0xfc2e[_0xe11c85];return _0xdbfe83;};'use strict';var _=require('lodash');var util=require(_0xefc2('0x0'));var logger=require(_0xefc2('0x1'))('api');var moment=require(_0xefc2('0x2'));var BPromise=require('bluebird');var rp=require(_0xefc2('0x3'));var fs=require('fs');var path=require(_0xefc2('0x4'));var rimraf=require('rimraf');var config=require(_0xefc2('0x5'));var attributes=require(_0xefc2('0x6'));module[_0xefc2('0x7')]=function(_0x42a4c8,_0xae7428){return _0x42a4c8[_0xefc2('0x8')]('VtigerField',attributes,{'tableName':_0xefc2('0x9'),'paranoid':![],'indexes':[{'name':_0xefc2('0xa'),'fields':[_0xefc2('0xb'),_0xefc2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0cd3=['moment','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x289503,_0x479908){var _0x11efa6=function(_0x505a00){while(--_0x505a00){_0x289503['push'](_0x289503['shift']());}};_0x11efa6(++_0x479908);}(_0x0cd3,0xb0));var _0x30cd=function(_0x45628c,_0xa1260e){_0x45628c=_0x45628c-0x0;var _0xdd2315=_0x0cd3[_0x45628c];return _0xdd2315;};'use strict';var _=require(_0x30cd('0x0'));var util=require(_0x30cd('0x1'));var logger=require(_0x30cd('0x2'))(_0x30cd('0x3'));var moment=require(_0x30cd('0x4'));var BPromise=require('bluebird');var rp=require(_0x30cd('0x5'));var fs=require('fs');var path=require(_0x30cd('0x6'));var rimraf=require('rimraf');var config=require(_0x30cd('0x7'));var attributes=require(_0x30cd('0x8'));module[_0x30cd('0x9')]=function(_0x18ff00,_0x4bd79c){return _0x18ff00[_0x30cd('0xa')](_0x30cd('0xb'),attributes,{'tableName':_0x30cd('0xc'),'paranoid':![],'indexes':[{'name':_0x30cd('0xd'),'fields':[_0x30cd('0xe'),'FieldId'],'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 cddd057..80283f4 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 _0xcb4f=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4ac8fd,_0x5061cd){var _0x3ae738=function(_0x1df39b){while(--_0x1df39b){_0x4ac8fd['push'](_0x4ac8fd['shift']());}};_0x3ae738(++_0x5061cd);}(_0xcb4f,0x147));var _0xfcb4=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xcb4f[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xfcb4('0x0'));var util=require(_0xfcb4('0x1'));var moment=require('moment');var BPromise=require(_0xfcb4('0x2'));var rs=require(_0xfcb4('0x3'));var fs=require('fs');var Redis=require(_0xfcb4('0x4'));var db=require(_0xfcb4('0x5'))['db'];var utils=require(_0xfcb4('0x6'));var logger=require('../../config/logger')(_0xfcb4('0x7'));var config=require(_0xfcb4('0x8'));var jayson=require(_0xfcb4('0x9'));var client=jayson[_0xfcb4('0xa')][_0xfcb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2648b7,_0x411dd0,_0x5a2341){return new BPromise(function(_0x2b9d21,_0x5b2eff){return client[_0xfcb4('0xc')](_0x2648b7,_0x5a2341)[_0xfcb4('0xd')](function(_0x43d5c5){logger[_0xfcb4('0xe')](_0xfcb4('0xf'),_0x411dd0,_0xfcb4('0x10'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x411dd0,_0xfcb4('0x10'),JSON[_0xfcb4('0x11')](_0x43d5c5));if(_0x43d5c5[_0xfcb4('0x12')]){if(_0x43d5c5[_0xfcb4('0x12')][_0xfcb4('0x13')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x411dd0,_0x43d5c5[_0xfcb4('0x12')]['message']);return _0x5b2eff(_0x43d5c5[_0xfcb4('0x12')]['message']);}logger[_0xfcb4('0x12')](_0xfcb4('0xf'),_0x411dd0,_0x43d5c5[_0xfcb4('0x12')][_0xfcb4('0x14')]);return _0x2b9d21(_0x43d5c5[_0xfcb4('0x12')]['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x411dd0,_0xfcb4('0x10'));_0x2b9d21(_0x43d5c5['result'][_0xfcb4('0x14')]);}})['catch'](function(_0x59977a){logger[_0xfcb4('0x12')](_0xfcb4('0xf'),_0x411dd0,_0x59977a);_0x5b2eff(_0x59977a);});});} \ No newline at end of file +var _0x3c85=['info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x447f90,_0x44c14c){var _0x5ec809=function(_0xc2d947){while(--_0xc2d947){_0x447f90['push'](_0x447f90['shift']());}};_0x5ec809(++_0x44c14c);}(_0x3c85,0x78));var _0x53c8=function(_0x1e07d4,_0x207f5d){_0x1e07d4=_0x1e07d4-0x0;var _0x1ea431=_0x3c85[_0x1e07d4];return _0x1ea431;};'use strict';var _=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var moment=require(_0x53c8('0x2'));var BPromise=require(_0x53c8('0x3'));var rs=require(_0x53c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53c8('0x5'))['db'];var utils=require(_0x53c8('0x6'));var logger=require(_0x53c8('0x7'))(_0x53c8('0x8'));var config=require(_0x53c8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x53c8('0xa')][_0x53c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x158d78,_0x91aa15,_0x14a9b6){return new BPromise(function(_0x1197a9,_0x17b862){return client['request'](_0x158d78,_0x14a9b6)['then'](function(_0x1a0551){logger[_0x53c8('0xc')]('VtigerField,\x20%s,\x20%s',_0x91aa15,_0x53c8('0xd'));logger[_0x53c8('0xe')](_0x53c8('0xf'),_0x91aa15,_0x53c8('0xd'),JSON[_0x53c8('0x10')](_0x1a0551));if(_0x1a0551[_0x53c8('0x11')]){if(_0x1a0551[_0x53c8('0x11')][_0x53c8('0x12')]===0x1f4){logger[_0x53c8('0x11')](_0x53c8('0x13'),_0x91aa15,_0x1a0551[_0x53c8('0x11')][_0x53c8('0x14')]);return _0x17b862(_0x1a0551['error'][_0x53c8('0x14')]);}logger[_0x53c8('0x11')](_0x53c8('0x13'),_0x91aa15,_0x1a0551['error'][_0x53c8('0x14')]);return _0x1197a9(_0x1a0551['error'][_0x53c8('0x14')]);}else{logger[_0x53c8('0xc')](_0x53c8('0x13'),_0x91aa15,_0x53c8('0xd'));_0x1197a9(_0x1a0551['result'][_0x53c8('0x14')]);}})[_0x53c8('0x15')](function(_0x18d132){logger[_0x53c8('0x11')]('VtigerField,\x20%s,\x20%s',_0x91aa15,_0x18d132);_0x17b862(_0x18d132);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 66ded50..a81396f 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 _0xcbd3=['/:id/fields','getFields','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xcbd3,0x86));var _0x3cbd=function(_0x585599,_0xc72061){_0x585599=_0x585599-0x0;var _0x32fc61=_0xcbd3[_0x585599];return _0x32fc61;};'use strict';var multer=require('multer');var util=require(_0x3cbd('0x0'));var path=require(_0x3cbd('0x1'));var timeout=require(_0x3cbd('0x2'));var express=require(_0x3cbd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3cbd('0x4'));var interaction=require(_0x3cbd('0x5'));var config=require(_0x3cbd('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x3cbd('0x7')]('/',auth[_0x3cbd('0x8')](),controller['index']);router['get'](_0x3cbd('0x9'),auth[_0x3cbd('0x8')](),controller[_0x3cbd('0xa')]);router[_0x3cbd('0x7')](_0x3cbd('0xb'),auth['isAuthenticated'](),controller[_0x3cbd('0xc')]);router[_0x3cbd('0x7')](_0x3cbd('0xd'),auth[_0x3cbd('0x8')](),controller[_0x3cbd('0xe')]);router[_0x3cbd('0xf')]('/',auth[_0x3cbd('0x8')](),controller[_0x3cbd('0x10')]);router[_0x3cbd('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x3cbd('0x9'),auth[_0x3cbd('0x8')](),controller[_0x3cbd('0x11')]);router[_0x3cbd('0x12')](_0x3cbd('0x9'),auth['isAuthenticated'](),controller[_0x3cbd('0x13')]);module[_0x3cbd('0x14')]=router; \ No newline at end of file +var _0x78d2=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','./intZendeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x24b5d8,_0x203128){var _0x54908d=function(_0x3b0db0){while(--_0x3b0db0){_0x24b5d8['push'](_0x24b5d8['shift']());}};_0x54908d(++_0x203128);}(_0x78d2,0xdf));var _0x278d=function(_0x3ccac1,_0x5cc7ea){_0x3ccac1=_0x3ccac1-0x0;var _0x10b20b=_0x78d2[_0x3ccac1];return _0x10b20b;};'use strict';var multer=require(_0x278d('0x0'));var util=require(_0x278d('0x1'));var path=require(_0x278d('0x2'));var timeout=require(_0x278d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x278d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x278d('0x5'));router['get']('/',auth[_0x278d('0x6')](),controller[_0x278d('0x7')]);router['get'](_0x278d('0x8'),auth[_0x278d('0x6')](),controller[_0x278d('0x9')]);router[_0x278d('0xa')](_0x278d('0xb'),auth[_0x278d('0x6')](),controller[_0x278d('0xc')]);router[_0x278d('0xa')](_0x278d('0xd'),auth[_0x278d('0x6')](),controller[_0x278d('0xe')]);router[_0x278d('0xf')]('/',auth['isAuthenticated'](),controller[_0x278d('0x10')]);router[_0x278d('0xf')](_0x278d('0xb'),auth['isAuthenticated'](),controller[_0x278d('0x11')]);router[_0x278d('0x12')](_0x278d('0x8'),auth[_0x278d('0x6')](),controller['update']);router[_0x278d('0x13')](_0x278d('0x8'),auth['isAuthenticated'](),controller[_0x278d('0x14')]);module[_0x278d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b4dc233..6cf9de7 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 _0x2aa3=['password','integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM'];(function(_0x3cc4a4,_0x3a33b0){var _0x5bc1ab=function(_0x51658c){while(--_0x51658c){_0x3cc4a4['push'](_0x3cc4a4['shift']());}};_0x5bc1ab(++_0x3a33b0);}(_0x2aa3,0x83));var _0x32aa=function(_0x3e6120,_0x8a67c7){_0x3e6120=_0x3e6120-0x0;var _0x59e5cf=_0x2aa3[_0x3e6120];return _0x59e5cf;};'use strict';var Sequelize=require(_0x32aa('0x0'));module[_0x32aa('0x1')]={'name':{'type':Sequelize[_0x32aa('0x2')]},'description':{'type':Sequelize[_0x32aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x32aa('0x2')]},'token':{'type':Sequelize[_0x32aa('0x2')]},'remoteUri':{'type':Sequelize[_0x32aa('0x2')],'unique':_0x32aa('0x3')},'authType':{'type':Sequelize[_0x32aa('0x4')](_0x32aa('0x5'),'token'),'defaultValue':_0x32aa('0x5')},'serverUrl':{'type':Sequelize[_0x32aa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x32aa('0x4')](_0x32aa('0x6'),_0x32aa('0x7')),'defaultValue':_0x32aa('0x6')}}; \ No newline at end of file +var _0xe2fe=['username','remoteUri','password','token','ENUM','newTab','sequelize','STRING'];(function(_0x5d4e27,_0x1cc69b){var _0x13205e=function(_0x34d9ae){while(--_0x34d9ae){_0x5d4e27['push'](_0x5d4e27['shift']());}};_0x13205e(++_0x1cc69b);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee2f('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xee2f('0x2')},'password':{'type':Sequelize[_0xee2f('0x1')]},'token':{'type':Sequelize[_0xee2f('0x1')]},'remoteUri':{'type':Sequelize[_0xee2f('0x1')],'unique':_0xee2f('0x3')},'authType':{'type':Sequelize['ENUM'](_0xee2f('0x4'),_0xee2f('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xee2f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x6')]('integrationTab',_0xee2f('0x7')),'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 9797e19..c4dfdcf 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 _0x7916=['hasOwnProperty','order','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','findOne','password','token','remoteUri','slice','substring','GET','format','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','username','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','count','limit','status','set','apply','save','then','destroy','error','name','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x4a5758,_0x520ea6){var _0x1636d6=function(_0x86d44){while(--_0x86d44){_0x4a5758['push'](_0x4a5758['shift']());}};_0x1636d6(++_0x520ea6);}(_0x7916,0x128));var _0x6791=function(_0x2b0834,_0x127ebe){_0x2b0834=_0x2b0834-0x0;var _0x16dc89=_0x7916[_0x2b0834];return _0x16dc89;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];var integrations=require(_0x6791('0x17'));function respondWithStatusCode(_0x16c62b,_0x423e22){_0x423e22=_0x423e22||0xcc;return function(_0x11c730){if(_0x11c730){return _0x16c62b[_0x6791('0x18')](_0x423e22);}return _0x16c62b['status'](_0x423e22)['end']();};}function respondWithResult(_0x34b28d,_0x5122f9){_0x5122f9=_0x5122f9||0xc8;return function(_0x2a9151){if(_0x2a9151){return _0x34b28d['status'](_0x5122f9)[_0x6791('0x19')](_0x2a9151);}};}function respondWithFilteredResult(_0x163898,_0x517910){return function(_0x3e4792){if(_0x3e4792){var _0x4b80ed=typeof _0x517910[_0x6791('0x1a')]===_0x6791('0x1b')&&typeof _0x517910['limit']===_0x6791('0x1b');var _0x36d7a1=_0x3e4792['count'];var _0x1872f5=_0x4b80ed?0x0:_0x517910['offset'];var _0xe55dba=_0x4b80ed?_0x3e4792[_0x6791('0x1c')]:_0x517910[_0x6791('0x1a')]+_0x517910[_0x6791('0x1d')];var _0x25adbc;if(_0xe55dba>=_0x36d7a1){_0xe55dba=_0x36d7a1;_0x25adbc=0xc8;}else{_0x25adbc=0xce;}_0x163898[_0x6791('0x1e')](_0x25adbc);return _0x163898[_0x6791('0x1f')]('Content-Range',_0x1872f5+'-'+_0xe55dba+'/'+_0x36d7a1)[_0x6791('0x19')](_0x3e4792);}return null;};}function patchUpdates(_0x306acb){return function(_0x51368e){try{jsonpatch[_0x6791('0x20')](_0x51368e,_0x306acb,!![]);}catch(_0x3b57f0){return BPromise['reject'](_0x3b57f0);}return _0x51368e[_0x6791('0x21')]();};}function saveUpdates(_0x309610,_0x15b9ab){return function(_0x12d83b){if(_0x12d83b){return _0x12d83b['update'](_0x309610)[_0x6791('0x22')](function(_0x1b516d){return _0x1b516d;});}return null;};}function removeEntity(_0x4a8717,_0x53bb44){return function(_0x4b23bc){if(_0x4b23bc){return _0x4b23bc[_0x6791('0x23')]()['then'](function(){_0x4a8717[_0x6791('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a092,_0x496273){return function(_0x5cadc){if(!_0x5cadc){_0x54a092[_0x6791('0x18')](0x194);}return _0x5cadc;};}function handleError(_0xd49b84,_0x56a74e){_0x56a74e=_0x56a74e||0x1f4;return function(_0x3def2e){logger[_0x6791('0x24')](_0x3def2e['stack']);if(_0x3def2e[_0x6791('0x25')]){delete _0x3def2e['name'];}_0xd49b84[_0x6791('0x1e')](_0x56a74e)['send'](_0x3def2e);};}exports['index']=function(_0x270a1d,_0x551718){var _0x2f56a2={},_0x34b006={},_0x483d6c={'count':0x0,'rows':[]};var _0x240a9f=_[_0x6791('0x26')](db[_0x6791('0x27')][_0x6791('0x28')],function(_0x5d9d54){return{'name':_0x5d9d54['fieldName'],'type':_0x5d9d54[_0x6791('0x29')]['key']};});_0x34b006[_0x6791('0x2a')]=_[_0x6791('0x26')](_0x240a9f,_0x6791('0x25'));_0x34b006[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x270a1d[_0x6791('0x2b')]);_0x34b006[_0x6791('0x2d')]=_[_0x6791('0x2e')](_0x34b006[_0x6791('0x2a')],_0x34b006[_0x6791('0x2b')]);_0x2f56a2['attributes']=_[_0x6791('0x2e')](_0x34b006[_0x6791('0x2a')],qs[_0x6791('0x2f')](_0x270a1d[_0x6791('0x2b')][_0x6791('0x2f')]));_0x2f56a2[_0x6791('0x30')]=_0x2f56a2['attributes']['length']?_0x2f56a2['attributes']:_0x34b006[_0x6791('0x2a')];if(!_0x270a1d[_0x6791('0x2b')][_0x6791('0x31')]('nolimit')){_0x2f56a2['limit']=qs[_0x6791('0x1d')](_0x270a1d[_0x6791('0x2b')][_0x6791('0x1d')]);_0x2f56a2[_0x6791('0x1a')]=qs['offset'](_0x270a1d[_0x6791('0x2b')][_0x6791('0x1a')]);}_0x2f56a2[_0x6791('0x32')]=qs['sort'](_0x270a1d[_0x6791('0x2b')]['sort']);_0x2f56a2['where']=qs[_0x6791('0x2d')](_[_0x6791('0x33')](_0x270a1d['query'],_0x34b006[_0x6791('0x2d')]),_0x240a9f);if(_0x270a1d[_0x6791('0x2b')][_0x6791('0x34')]){_0x2f56a2[_0x6791('0x35')]=_[_0x6791('0x36')](_0x2f56a2['where'],{'$or':_[_0x6791('0x26')](_0x240a9f,function(_0xc95516){if(_0xc95516[_0x6791('0x29')]!=='VIRTUAL'){var _0x3a6062={};_0x3a6062[_0xc95516[_0x6791('0x25')]]={'$like':'%'+_0x270a1d[_0x6791('0x2b')]['filter']+'%'};return _0x3a6062;}})});}_0x2f56a2=_[_0x6791('0x36')]({},_0x2f56a2,_0x270a1d[_0x6791('0x37')]);var _0x13be81={'where':_0x2f56a2[_0x6791('0x35')]};return db['ZendeskAccount'][_0x6791('0x1c')](_0x13be81)[_0x6791('0x22')](function(_0x3e95b6){_0x483d6c[_0x6791('0x1c')]=_0x3e95b6;if(_0x270a1d[_0x6791('0x2b')][_0x6791('0x38')]){_0x2f56a2[_0x6791('0x39')]=[{'all':!![]}];}return db[_0x6791('0x27')][_0x6791('0x3a')](_0x2f56a2);})['then'](function(_0x52c03a){_0x483d6c[_0x6791('0x3b')]=_0x52c03a;return _0x483d6c;})[_0x6791('0x22')](respondWithFilteredResult(_0x551718,_0x2f56a2))['catch'](handleError(_0x551718,null));};exports[_0x6791('0x3c')]=function(_0x1c9913,_0x1c6803){var _0x3edb86={'raw':![],'where':{'id':_0x1c9913[_0x6791('0x3d')]['id']}},_0x1a922e={};_0x1a922e[_0x6791('0x2a')]=_['keys'](db[_0x6791('0x27')]['rawAttributes']);_0x1a922e[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x1c9913[_0x6791('0x2b')]);_0x1a922e[_0x6791('0x2d')]=_['intersection'](_0x1a922e[_0x6791('0x2a')],_0x1a922e[_0x6791('0x2b')]);_0x3edb86[_0x6791('0x30')]=_[_0x6791('0x2e')](_0x1a922e[_0x6791('0x2a')],qs[_0x6791('0x2f')](_0x1c9913[_0x6791('0x2b')][_0x6791('0x2f')]));_0x3edb86['attributes']=_0x3edb86[_0x6791('0x30')][_0x6791('0x3e')]?_0x3edb86[_0x6791('0x30')]:_0x1a922e[_0x6791('0x2a')];if(_0x1c9913['query'][_0x6791('0x38')]){_0x3edb86[_0x6791('0x39')]=[{'all':!![]}];}_0x3edb86=_['merge']({},_0x3edb86,_0x1c9913[_0x6791('0x37')]);return db['ZendeskAccount'][_0x6791('0x3f')](_0x3edb86)[_0x6791('0x22')](handleEntityNotFound(_0x1c6803,null))[_0x6791('0x22')](respondWithResult(_0x1c6803,null))[_0x6791('0x40')](handleError(_0x1c6803,null));};exports[_0x6791('0x41')]=function(_0xb2a2,_0x4163f5){return db[_0x6791('0x27')][_0x6791('0x41')](_0xb2a2['body'],{})[_0x6791('0x22')](respondWithResult(_0x4163f5,0xc9))['catch'](handleError(_0x4163f5,null));};exports[_0x6791('0x42')]=function(_0x2bb86a,_0x276002){if(_0x2bb86a[_0x6791('0x43')]['id']){delete _0x2bb86a[_0x6791('0x43')]['id'];}return db['ZendeskAccount'][_0x6791('0x3f')]({'where':{'id':_0x2bb86a[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x276002,null))[_0x6791('0x22')](saveUpdates(_0x2bb86a[_0x6791('0x43')],null))['then'](respondWithResult(_0x276002,null))[_0x6791('0x40')](handleError(_0x276002,null));};exports[_0x6791('0x23')]=function(_0x4ff9f4,_0x3df699){return db['ZendeskAccount'][_0x6791('0x3f')]({'where':{'id':_0x4ff9f4[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x3df699,null))[_0x6791('0x22')](removeEntity(_0x3df699,null))['catch'](handleError(_0x3df699,null));};exports[_0x6791('0x44')]=function(_0x243faf,_0x5655c8,_0x189b22){var _0x4370ab={};var _0x3a895b={};var _0x5df56e;var _0x355e97;return db[_0x6791('0x27')]['findOne']({'where':{'id':_0x243faf[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x5655c8,null))['then'](function(_0x169531){if(_0x169531){_0x5df56e=_0x169531;_0x3a895b[_0x6791('0x2a')]=_[_0x6791('0x2c')](db[_0x6791('0x45')]['rawAttributes']);_0x3a895b[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x243faf[_0x6791('0x2b')]);_0x3a895b['filters']=_['intersection'](_0x3a895b[_0x6791('0x2a')],_0x3a895b[_0x6791('0x2b')]);_0x4370ab[_0x6791('0x30')]=_[_0x6791('0x2e')](_0x3a895b[_0x6791('0x2a')],qs['fields'](_0x243faf['query'][_0x6791('0x2f')]));_0x4370ab['attributes']=_0x4370ab['attributes'][_0x6791('0x3e')]?_0x4370ab[_0x6791('0x30')]:_0x3a895b[_0x6791('0x2a')];_0x4370ab[_0x6791('0x32')]=qs[_0x6791('0x46')](_0x243faf[_0x6791('0x2b')]['sort']);_0x4370ab['where']=qs[_0x6791('0x2d')](_[_0x6791('0x33')](_0x243faf['query'],_0x3a895b[_0x6791('0x2d')]));if(_0x243faf['query'][_0x6791('0x34')]){_0x4370ab[_0x6791('0x35')]=_['merge'](_0x4370ab[_0x6791('0x35')],{'$or':_[_0x6791('0x26')](_0x4370ab[_0x6791('0x30')],function(_0x49ed65){var _0x3ba679={};_0x3ba679[_0x49ed65]={'$like':'%'+_0x243faf[_0x6791('0x2b')][_0x6791('0x34')]+'%'};return _0x3ba679;})});}_0x4370ab=_[_0x6791('0x36')]({},_0x4370ab,_0x243faf[_0x6791('0x37')]);return _0x5df56e['getConfigurations'](_0x4370ab);}})['then'](function(_0x1a9acd){if(_0x1a9acd){_0x355e97=_0x1a9acd[_0x6791('0x3e')];if(!_0x243faf['query'][_0x6791('0x31')](_0x6791('0x47'))){_0x4370ab[_0x6791('0x1d')]=qs[_0x6791('0x1d')](_0x243faf[_0x6791('0x2b')][_0x6791('0x1d')]);_0x4370ab[_0x6791('0x1a')]=qs[_0x6791('0x1a')](_0x243faf['query'][_0x6791('0x1a')]);}return _0x5df56e[_0x6791('0x44')](_0x4370ab);}})[_0x6791('0x22')](function(_0x1a9a2e){if(_0x1a9a2e){return _0x1a9a2e?{'count':_0x355e97,'rows':_0x1a9a2e}:null;}})['then'](respondWithResult(_0x5655c8,null))[_0x6791('0x40')](handleError(_0x5655c8,null));};exports[_0x6791('0x48')]=function(_0xa8a8dd,_0x5ca809,_0x205320){if(_0xa8a8dd[_0x6791('0x43')]['id']){delete _0xa8a8dd[_0x6791('0x43')]['id'];}return db[_0x6791('0x27')]['findOne']({'where':{'id':_0xa8a8dd[_0x6791('0x3d')]['id']}})[_0x6791('0x22')](handleEntityNotFound(_0x5ca809,null))['then'](function(_0x1114d4){if(_0x1114d4){_0xa8a8dd[_0x6791('0x43')][_0x6791('0x49')]=_0x1114d4['id'];_0xa8a8dd[_0x6791('0x43')][_0x6791('0x4a')]=integrations[_0x6791('0x4b')](_0xa8a8dd['body'][_0x6791('0x4c')],_0xa8a8dd[_0x6791('0x43')][_0x6791('0x29')]);_0xa8a8dd['body'][_0x6791('0x4d')]=integrations['getDescriptions'](_0xa8a8dd[_0x6791('0x43')][_0x6791('0x4c')],_0xa8a8dd[_0x6791('0x43')][_0x6791('0x29')]);return db[_0x6791('0x45')]['create'](_0xa8a8dd[_0x6791('0x43')],{'include':[{'model':db[_0x6791('0x4e')],'as':_0x6791('0x4a')},{'model':db[_0x6791('0x4e')],'as':'Descriptions'}]});}return null;})[_0x6791('0x22')](respondWithResult(_0x5ca809,null))[_0x6791('0x40')](handleError(_0x5ca809,null));};exports['getFields']=function(_0x34691c,_0x1fa44a,_0x567302){var _0x201465='';return db[_0x6791('0x27')][_0x6791('0x4f')]({'where':{'id':_0x34691c[_0x6791('0x3d')]['id']},'attributes':['id','username',_0x6791('0x50'),_0x6791('0x51'),'authType',_0x6791('0x52')]})[_0x6791('0x22')](handleEntityNotFound(_0x1fa44a,null))[_0x6791('0x22')](function(_0x20c736){if(_0x20c736){_0x201465=_0x20c736[_0x6791('0x52')];var _0x4ecf62=_0x201465[_0x6791('0x53')](-0x1);if(_0x4ecf62==='/'){_0x201465=_0x201465[_0x6791('0x54')](0x0,_0x201465['lastIndexOf'](_0x4ecf62));}var _0x4463ef={'method':_0x6791('0x55'),'uri':util[_0x6791('0x56')]('%s/%s',_0x201465,_0x6791('0x57')),'json':!![]};switch(_0x20c736[_0x6791('0x58')]){case _0x6791('0x50'):_0x4463ef[_0x6791('0x59')]={'Authorization':util[_0x6791('0x56')](_0x6791('0x5a'),new Buffer(util[_0x6791('0x56')](_0x6791('0x5b'),_0x20c736['username'],_0x20c736[_0x6791('0x50')]))[_0x6791('0x5c')]('base64'))};break;case _0x6791('0x51'):_0x4463ef[_0x6791('0x59')]={'Authorization':util[_0x6791('0x56')]('Basic\x20%s',new Buffer(util[_0x6791('0x56')]('%s/token:%s',_0x20c736[_0x6791('0x5d')],_0x20c736[_0x6791('0x51')]))[_0x6791('0x5c')](_0x6791('0x5e')))};break;default:throw new db[(_0x6791('0x5f'))][(_0x6791('0x60'))](_0x6791('0x61'));}return rp(_0x4463ef);}})[_0x6791('0x22')](function(_0x23e0d3){if(_0x23e0d3){var _0x1fa853=[_0x6791('0x62'),_0x6791('0x63'),_0x6791('0x64'),_0x6791('0x65')];_[_0x6791('0x66')](_0x23e0d3[_0x6791('0x57')],function(_0x3b53b8){return _0x1fa853[_0x6791('0x67')](_0x3b53b8[_0x6791('0x29')]);});return{'count':_0x23e0d3['ticket_fields']['length'],'rows':_['map'](_0x23e0d3[_0x6791('0x57')],function(_0x31c1a8){return{'id':_0x31c1a8['id'],'name':_0x31c1a8[_0x6791('0x68')]>0x7?_0x31c1a8[_0x6791('0x69')]:_0x31c1a8[_0x6791('0x29')],'custom':_0x31c1a8[_0x6791('0x68')]>0x7?!![]:![],'options':_0x31c1a8[_0x6791('0x6a')]?_0x31c1a8[_0x6791('0x6a')]:_0x31c1a8[_0x6791('0x6b')]?_0x31c1a8[_0x6791('0x6b')]:[]};})};}})[_0x6791('0x22')](respondWithResult(_0x1fa44a,null))[_0x6791('0x40')](function(_0x44ec4d){var _0x4047b6=_0x34691c[_0x6791('0x2b')][_0x6791('0x6c')]?0x1f4:_0x44ec4d[_0x6791('0x6d')]||0x1f4;logger[_0x6791('0x24')](_0x6791('0x6e'),_0x6791('0x6f'),_0x4047b6,JSON[_0x6791('0x70')](_0x44ec4d));delete _0x44ec4d[_0x6791('0x25')];if(_0x4047b6===0x191){_0x4047b6=0x190;}_0x1fa44a[_0x6791('0x1e')](_0x4047b6)[_0x6791('0x71')](_0x34691c[_0x6791('0x2b')]['test']?{'message':_0x6791('0x72'),'statusCode':_0x44ec4d['statusCode']}:_0x44ec4d);});}; \ No newline at end of file +var _0x3c81=['toString','base64','headers','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','name','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','ZendeskAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','ZendeskConfiguration','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','authType','Basic\x20%s','%s:%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3c81,0x102));var _0x13c8=function(_0x2c038e,_0x436d0e){_0x2c038e=_0x2c038e-0x0;var _0x4c4f0b=_0x3c81[_0x2c038e];return _0x4c4f0b;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x21442d,_0x7b6da8){_0x7b6da8=_0x7b6da8||0xcc;return function(_0x2304b5){if(_0x2304b5){return _0x21442d[_0x13c8('0x19')](_0x7b6da8);}return _0x21442d['status'](_0x7b6da8)[_0x13c8('0x1a')]();};}function respondWithResult(_0x515681,_0x4d7a88){_0x4d7a88=_0x4d7a88||0xc8;return function(_0x589636){if(_0x589636){return _0x515681[_0x13c8('0x1b')](_0x4d7a88)['json'](_0x589636);}};}function respondWithFilteredResult(_0x337397,_0x17a3c1){return function(_0x23f64e){if(_0x23f64e){var _0x7cbfb=typeof _0x17a3c1['offset']===_0x13c8('0x1c')&&typeof _0x17a3c1[_0x13c8('0x1d')]===_0x13c8('0x1c');var _0x3bc5a9=_0x23f64e[_0x13c8('0x1e')];var _0x28f07e=_0x7cbfb?0x0:_0x17a3c1[_0x13c8('0x1f')];var _0x251c38=_0x7cbfb?_0x23f64e[_0x13c8('0x1e')]:_0x17a3c1[_0x13c8('0x1f')]+_0x17a3c1[_0x13c8('0x1d')];var _0x5ac776;if(_0x251c38>=_0x3bc5a9){_0x251c38=_0x3bc5a9;_0x5ac776=0xc8;}else{_0x5ac776=0xce;}_0x337397[_0x13c8('0x1b')](_0x5ac776);return _0x337397[_0x13c8('0x20')](_0x13c8('0x21'),_0x28f07e+'-'+_0x251c38+'/'+_0x3bc5a9)[_0x13c8('0x22')](_0x23f64e);}return null;};}function patchUpdates(_0x513085){return function(_0x1fb714){try{jsonpatch[_0x13c8('0x23')](_0x1fb714,_0x513085,!![]);}catch(_0x3e3951){return BPromise[_0x13c8('0x24')](_0x3e3951);}return _0x1fb714[_0x13c8('0x25')]();};}function saveUpdates(_0x2fc123,_0x5ab47f){return function(_0x28f99c){if(_0x28f99c){return _0x28f99c[_0x13c8('0x26')](_0x2fc123)[_0x13c8('0x27')](function(_0xcf41d2){return _0xcf41d2;});}return null;};}function removeEntity(_0x577df6,_0x1770e5){return function(_0x458217){if(_0x458217){return _0x458217['destroy']()['then'](function(){_0x577df6[_0x13c8('0x1b')](0xcc)[_0x13c8('0x1a')]();});}};}function handleEntityNotFound(_0x47e8ae,_0x5ad0dc){return function(_0x288c3c){if(!_0x288c3c){_0x47e8ae[_0x13c8('0x19')](0x194);}return _0x288c3c;};}function handleError(_0x53ada9,_0x4df077){_0x4df077=_0x4df077||0x1f4;return function(_0x196983){logger['error'](_0x196983['stack']);if(_0x196983[_0x13c8('0x28')]){delete _0x196983[_0x13c8('0x28')];}_0x53ada9[_0x13c8('0x1b')](_0x4df077)['send'](_0x196983);};}exports['index']=function(_0x277a89,_0x1071a0){var _0x399840={},_0x441182={},_0x138017={'count':0x0,'rows':[]};var _0x220d40=_[_0x13c8('0x29')](db['ZendeskAccount'][_0x13c8('0x2a')],function(_0xcbc9b7){return{'name':_0xcbc9b7['fieldName'],'type':_0xcbc9b7['type'][_0x13c8('0x2b')]};});_0x441182[_0x13c8('0x2c')]=_['map'](_0x220d40,_0x13c8('0x28'));_0x441182[_0x13c8('0x2d')]=_['keys'](_0x277a89[_0x13c8('0x2d')]);_0x441182[_0x13c8('0x2e')]=_[_0x13c8('0x2f')](_0x441182[_0x13c8('0x2c')],_0x441182[_0x13c8('0x2d')]);_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x2f')](_0x441182[_0x13c8('0x2c')],qs['fields'](_0x277a89['query'][_0x13c8('0x31')]));_0x399840[_0x13c8('0x30')]=_0x399840['attributes'][_0x13c8('0x32')]?_0x399840['attributes']:_0x441182[_0x13c8('0x2c')];if(!_0x277a89['query'][_0x13c8('0x33')](_0x13c8('0x34'))){_0x399840[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x277a89[_0x13c8('0x2d')][_0x13c8('0x1d')]);_0x399840[_0x13c8('0x1f')]=qs['offset'](_0x277a89[_0x13c8('0x2d')][_0x13c8('0x1f')]);}_0x399840['order']=qs[_0x13c8('0x35')](_0x277a89[_0x13c8('0x2d')][_0x13c8('0x35')]);_0x399840['where']=qs['filters'](_['pick'](_0x277a89[_0x13c8('0x2d')],_0x441182[_0x13c8('0x2e')]),_0x220d40);if(_0x277a89[_0x13c8('0x2d')][_0x13c8('0x36')]){_0x399840[_0x13c8('0x37')]=_[_0x13c8('0x38')](_0x399840[_0x13c8('0x37')],{'$or':_[_0x13c8('0x29')](_0x220d40,function(_0xf818be){if(_0xf818be['type']!=='VIRTUAL'){var _0x27e11b={};_0x27e11b[_0xf818be[_0x13c8('0x28')]]={'$like':'%'+_0x277a89[_0x13c8('0x2d')][_0x13c8('0x36')]+'%'};return _0x27e11b;}})});}_0x399840=_['merge']({},_0x399840,_0x277a89[_0x13c8('0x39')]);var _0x4bd627={'where':_0x399840[_0x13c8('0x37')]};return db[_0x13c8('0x3a')][_0x13c8('0x1e')](_0x4bd627)[_0x13c8('0x27')](function(_0xbb1d49){_0x138017[_0x13c8('0x1e')]=_0xbb1d49;if(_0x277a89[_0x13c8('0x2d')][_0x13c8('0x3b')]){_0x399840[_0x13c8('0x3c')]=[{'all':!![]}];}return db[_0x13c8('0x3a')][_0x13c8('0x3d')](_0x399840);})[_0x13c8('0x27')](function(_0x89bbab){_0x138017[_0x13c8('0x3e')]=_0x89bbab;return _0x138017;})[_0x13c8('0x27')](respondWithFilteredResult(_0x1071a0,_0x399840))[_0x13c8('0x3f')](handleError(_0x1071a0,null));};exports[_0x13c8('0x40')]=function(_0x1505fb,_0xc5eb86){var _0x1cff99={'raw':![],'where':{'id':_0x1505fb[_0x13c8('0x41')]['id']}},_0x3622d6={};_0x3622d6[_0x13c8('0x2c')]=_[_0x13c8('0x42')](db[_0x13c8('0x3a')]['rawAttributes']);_0x3622d6[_0x13c8('0x2d')]=_[_0x13c8('0x42')](_0x1505fb[_0x13c8('0x2d')]);_0x3622d6[_0x13c8('0x2e')]=_[_0x13c8('0x2f')](_0x3622d6['model'],_0x3622d6['query']);_0x1cff99[_0x13c8('0x30')]=_[_0x13c8('0x2f')](_0x3622d6[_0x13c8('0x2c')],qs['fields'](_0x1505fb['query']['fields']));_0x1cff99[_0x13c8('0x30')]=_0x1cff99['attributes'][_0x13c8('0x32')]?_0x1cff99['attributes']:_0x3622d6[_0x13c8('0x2c')];if(_0x1505fb[_0x13c8('0x2d')][_0x13c8('0x3b')]){_0x1cff99[_0x13c8('0x3c')]=[{'all':!![]}];}_0x1cff99=_[_0x13c8('0x38')]({},_0x1cff99,_0x1505fb[_0x13c8('0x39')]);return db['ZendeskAccount'][_0x13c8('0x43')](_0x1cff99)[_0x13c8('0x27')](handleEntityNotFound(_0xc5eb86,null))['then'](respondWithResult(_0xc5eb86,null))[_0x13c8('0x3f')](handleError(_0xc5eb86,null));};exports[_0x13c8('0x44')]=function(_0x2e925f,_0x162918){return db[_0x13c8('0x3a')]['create'](_0x2e925f[_0x13c8('0x45')],{})[_0x13c8('0x27')](respondWithResult(_0x162918,0xc9))[_0x13c8('0x3f')](handleError(_0x162918,null));};exports[_0x13c8('0x26')]=function(_0x185d18,_0x59ec9f){if(_0x185d18[_0x13c8('0x45')]['id']){delete _0x185d18[_0x13c8('0x45')]['id'];}return db[_0x13c8('0x3a')][_0x13c8('0x43')]({'where':{'id':_0x185d18[_0x13c8('0x41')]['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x59ec9f,null))[_0x13c8('0x27')](saveUpdates(_0x185d18[_0x13c8('0x45')],null))[_0x13c8('0x27')](respondWithResult(_0x59ec9f,null))[_0x13c8('0x3f')](handleError(_0x59ec9f,null));};exports[_0x13c8('0x46')]=function(_0x5e1fe5,_0x10ba7c){return db[_0x13c8('0x3a')][_0x13c8('0x43')]({'where':{'id':_0x5e1fe5[_0x13c8('0x41')]['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x10ba7c,null))[_0x13c8('0x27')](removeEntity(_0x10ba7c,null))['catch'](handleError(_0x10ba7c,null));};exports[_0x13c8('0x47')]=function(_0x416e4f,_0x2f1e83,_0x481205){var _0x54e0c8={};var _0x3d4863={};var _0x14a738;var _0x55d353;return db[_0x13c8('0x3a')][_0x13c8('0x48')]({'where':{'id':_0x416e4f['params']['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x2f1e83,null))['then'](function(_0x242791){if(_0x242791){_0x14a738=_0x242791;_0x3d4863[_0x13c8('0x2c')]=_[_0x13c8('0x42')](db['ZendeskConfiguration'][_0x13c8('0x2a')]);_0x3d4863[_0x13c8('0x2d')]=_['keys'](_0x416e4f[_0x13c8('0x2d')]);_0x3d4863['filters']=_[_0x13c8('0x2f')](_0x3d4863[_0x13c8('0x2c')],_0x3d4863[_0x13c8('0x2d')]);_0x54e0c8[_0x13c8('0x30')]=_[_0x13c8('0x2f')](_0x3d4863['model'],qs[_0x13c8('0x31')](_0x416e4f['query']['fields']));_0x54e0c8['attributes']=_0x54e0c8['attributes']['length']?_0x54e0c8[_0x13c8('0x30')]:_0x3d4863[_0x13c8('0x2c')];_0x54e0c8[_0x13c8('0x49')]=qs[_0x13c8('0x35')](_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x35')]);_0x54e0c8[_0x13c8('0x37')]=qs['filters'](_['pick'](_0x416e4f[_0x13c8('0x2d')],_0x3d4863[_0x13c8('0x2e')]));if(_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x36')]){_0x54e0c8[_0x13c8('0x37')]=_[_0x13c8('0x38')](_0x54e0c8[_0x13c8('0x37')],{'$or':_[_0x13c8('0x29')](_0x54e0c8['attributes'],function(_0x371410){var _0x326f90={};_0x326f90[_0x371410]={'$like':'%'+_0x416e4f['query'][_0x13c8('0x36')]+'%'};return _0x326f90;})});}_0x54e0c8=_[_0x13c8('0x38')]({},_0x54e0c8,_0x416e4f[_0x13c8('0x39')]);return _0x14a738[_0x13c8('0x47')](_0x54e0c8);}})[_0x13c8('0x27')](function(_0x1f823f){if(_0x1f823f){_0x55d353=_0x1f823f[_0x13c8('0x32')];if(!_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x33')](_0x13c8('0x34'))){_0x54e0c8[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x1d')]);_0x54e0c8[_0x13c8('0x1f')]=qs[_0x13c8('0x1f')](_0x416e4f['query'][_0x13c8('0x1f')]);}return _0x14a738['getConfigurations'](_0x54e0c8);}})[_0x13c8('0x27')](function(_0xe861ad){if(_0xe861ad){return _0xe861ad?{'count':_0x55d353,'rows':_0xe861ad}:null;}})['then'](respondWithResult(_0x2f1e83,null))[_0x13c8('0x3f')](handleError(_0x2f1e83,null));};exports[_0x13c8('0x4a')]=function(_0x5539e8,_0x38fd82,_0x19330c){if(_0x5539e8[_0x13c8('0x45')]['id']){delete _0x5539e8[_0x13c8('0x45')]['id'];}return db[_0x13c8('0x3a')][_0x13c8('0x48')]({'where':{'id':_0x5539e8[_0x13c8('0x41')]['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x38fd82,null))[_0x13c8('0x27')](function(_0xee69b){if(_0xee69b){_0x5539e8[_0x13c8('0x45')]['AccountId']=_0xee69b['id'];_0x5539e8[_0x13c8('0x45')][_0x13c8('0x4b')]=integrations[_0x13c8('0x4c')](_0x5539e8[_0x13c8('0x45')][_0x13c8('0x4d')],_0x5539e8[_0x13c8('0x45')]['type']);_0x5539e8[_0x13c8('0x45')][_0x13c8('0x4e')]=integrations[_0x13c8('0x4f')](_0x5539e8['body'][_0x13c8('0x4d')],_0x5539e8[_0x13c8('0x45')][_0x13c8('0x50')]);return db[_0x13c8('0x51')][_0x13c8('0x44')](_0x5539e8[_0x13c8('0x45')],{'include':[{'model':db['ZendeskField'],'as':_0x13c8('0x4b')},{'model':db[_0x13c8('0x52')],'as':_0x13c8('0x4e')}]});}return null;})[_0x13c8('0x27')](respondWithResult(_0x38fd82,null))['catch'](handleError(_0x38fd82,null));};exports[_0x13c8('0x53')]=function(_0x2d552d,_0x258447,_0x308482){var _0x179a86='';return db[_0x13c8('0x3a')][_0x13c8('0x48')]({'where':{'id':_0x2d552d['params']['id']},'attributes':['id',_0x13c8('0x54'),_0x13c8('0x55'),_0x13c8('0x56'),'authType',_0x13c8('0x57')]})[_0x13c8('0x27')](handleEntityNotFound(_0x258447,null))['then'](function(_0x58728a){if(_0x58728a){_0x179a86=_0x58728a[_0x13c8('0x57')];var _0x5eb649=_0x179a86[_0x13c8('0x58')](-0x1);if(_0x5eb649==='/'){_0x179a86=_0x179a86['substring'](0x0,_0x179a86[_0x13c8('0x59')](_0x5eb649));}var _0x39aefc={'method':_0x13c8('0x5a'),'uri':util[_0x13c8('0x5b')](_0x13c8('0x5c'),_0x179a86,'ticket_fields'),'json':!![]};switch(_0x58728a[_0x13c8('0x5d')]){case _0x13c8('0x55'):_0x39aefc['headers']={'Authorization':util[_0x13c8('0x5b')](_0x13c8('0x5e'),new Buffer(util[_0x13c8('0x5b')](_0x13c8('0x5f'),_0x58728a[_0x13c8('0x54')],_0x58728a[_0x13c8('0x55')]))[_0x13c8('0x60')](_0x13c8('0x61')))};break;case _0x13c8('0x56'):_0x39aefc[_0x13c8('0x62')]={'Authorization':util['format'](_0x13c8('0x5e'),new Buffer(util[_0x13c8('0x5b')]('%s/token:%s',_0x58728a['username'],_0x58728a[_0x13c8('0x56')]))[_0x13c8('0x60')](_0x13c8('0x61')))};break;default:throw new db[(_0x13c8('0x63'))][(_0x13c8('0x64'))](_0x13c8('0x65'));}return rp(_0x39aefc);}})['then'](function(_0x18afe7){if(_0x18afe7){var _0x368f45=[_0x13c8('0x66'),_0x13c8('0x67'),_0x13c8('0x68'),'assignee'];_[_0x13c8('0x69')](_0x18afe7[_0x13c8('0x6a')],function(_0x564cc9){return _0x368f45[_0x13c8('0x6b')](_0x564cc9[_0x13c8('0x50')]);});return{'count':_0x18afe7['ticket_fields'][_0x13c8('0x32')],'rows':_['map'](_0x18afe7[_0x13c8('0x6a')],function(_0x5a4e0a){return{'id':_0x5a4e0a['id'],'name':_0x5a4e0a[_0x13c8('0x6c')]>0x7?_0x5a4e0a[_0x13c8('0x6d')]:_0x5a4e0a[_0x13c8('0x50')],'custom':_0x5a4e0a['position']>0x7?!![]:![],'options':_0x5a4e0a[_0x13c8('0x6e')]?_0x5a4e0a['system_field_options']:_0x5a4e0a['custom_field_options']?_0x5a4e0a[_0x13c8('0x6f')]:[]};})};}})[_0x13c8('0x27')](respondWithResult(_0x258447,null))[_0x13c8('0x3f')](function(_0x1e3097){var _0x4d6477=_0x2d552d['query'][_0x13c8('0x70')]?0x1f4:_0x1e3097['statusCode']||0x1f4;logger['error'](_0x13c8('0x71'),_0x13c8('0x53'),_0x4d6477,JSON[_0x13c8('0x72')](_0x1e3097));delete _0x1e3097[_0x13c8('0x28')];if(_0x4d6477===0x191){_0x4d6477=0x190;}_0x258447['status'](_0x4d6477)[_0x13c8('0x73')](_0x2d552d['query']['test']?{'message':_0x13c8('0x74'),'statusCode':_0x1e3097[_0x13c8('0x75')]}:_0x1e3097);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 131c480..1509f29 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 _0xc0b2=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2d2619,_0x2a080c){var _0x1c778a=function(_0x308720){while(--_0x308720){_0x2d2619['push'](_0x2d2619['shift']());}};_0x1c778a(++_0x2a080c);}(_0xc0b2,0x1a6));var _0x2c0b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc0b2[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x2c0b('0x0'));var util=require(_0x2c0b('0x1'));var logger=require(_0x2c0b('0x2'))(_0x2c0b('0x3'));var moment=require(_0x2c0b('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c0b('0x5'));var fs=require('fs');var path=require(_0x2c0b('0x6'));var rimraf=require(_0x2c0b('0x7'));var config=require(_0x2c0b('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x2c0b('0x9'));module[_0x2c0b('0xa')]=function(_0xcbac63,_0x27ec80){return _0xcbac63[_0x2c0b('0xb')]('ZendeskAccount',attributes,{'tableName':_0x2c0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd89=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x300a7b,_0x1b5602){var _0x3dd394=function(_0x296e0f){while(--_0x296e0f){_0x300a7b['push'](_0x300a7b['shift']());}};_0x3dd394(++_0x1b5602);}(_0xdd89,0xcb));var _0x9dd8=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0xdd89[_0x44afa4];return _0xcad289;};'use strict';var _=require(_0x9dd8('0x0'));var util=require(_0x9dd8('0x1'));var logger=require(_0x9dd8('0x2'))(_0x9dd8('0x3'));var moment=require(_0x9dd8('0x4'));var BPromise=require(_0x9dd8('0x5'));var rp=require(_0x9dd8('0x6'));var fs=require('fs');var path=require(_0x9dd8('0x7'));var rimraf=require(_0x9dd8('0x8'));var config=require(_0x9dd8('0x9'));var attributes=require(_0x9dd8('0xa'));var integrations=require(_0x9dd8('0xb'));module[_0x9dd8('0xc')]=function(_0x4fea94,_0x38daea){return _0x4fea94[_0x9dd8('0xd')](_0x9dd8('0xe'),attributes,{'tableName':_0x9dd8('0xf'),'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 12c90f5..898c902 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 _0xf0b0=['client','http','request','then','info','request\x20sent','debug','error','code','message','ZendeskAccount,\x20%s,\x20%s','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ZendeskAccount','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5efb71,_0x5eb7d1){var _0x7e3644=function(_0x1f9144){while(--_0x1f9144){_0x5efb71['push'](_0x5efb71['shift']());}};_0x7e3644(++_0x5eb7d1);}(_0xf0b0,0xc8));var _0x0f0b=function(_0xca9bb1,_0x37731a){_0xca9bb1=_0xca9bb1-0x0;var _0x3d6862=_0xf0b0[_0xca9bb1];return _0x3d6862;};'use strict';var _=require(_0x0f0b('0x0'));var util=require(_0x0f0b('0x1'));var moment=require(_0x0f0b('0x2'));var BPromise=require(_0x0f0b('0x3'));var rs=require(_0x0f0b('0x4'));var fs=require('fs');var Redis=require(_0x0f0b('0x5'));var db=require(_0x0f0b('0x6'))['db'];var utils=require(_0x0f0b('0x7'));var logger=require(_0x0f0b('0x8'))('rpc');var config=require(_0x0f0b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0f0b('0xa')][_0x0f0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eda20,_0x247eb5,_0x23b4b8){return new BPromise(function(_0x400de0,_0x57d855){return client[_0x0f0b('0xc')](_0x3eda20,_0x23b4b8)[_0x0f0b('0xd')](function(_0x46bbdc){logger[_0x0f0b('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x247eb5,_0x0f0b('0xf'));logger[_0x0f0b('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x247eb5,'request\x20sent',JSON['stringify'](_0x46bbdc));if(_0x46bbdc[_0x0f0b('0x11')]){if(_0x46bbdc['error'][_0x0f0b('0x12')]===0x1f4){logger[_0x0f0b('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x247eb5,_0x46bbdc[_0x0f0b('0x11')][_0x0f0b('0x13')]);return _0x57d855(_0x46bbdc[_0x0f0b('0x11')][_0x0f0b('0x13')]);}logger[_0x0f0b('0x11')](_0x0f0b('0x14'),_0x247eb5,_0x46bbdc[_0x0f0b('0x11')][_0x0f0b('0x13')]);return _0x400de0(_0x46bbdc[_0x0f0b('0x11')][_0x0f0b('0x13')]);}else{logger[_0x0f0b('0xe')](_0x0f0b('0x14'),_0x247eb5,_0x0f0b('0xf'));_0x400de0(_0x46bbdc[_0x0f0b('0x15')][_0x0f0b('0x13')]);}})[_0x0f0b('0x16')](function(_0x2c406d){logger[_0x0f0b('0x11')](_0x0f0b('0x14'),_0x247eb5,_0x2c406d);_0x57d855(_0x2c406d);});});}exports[_0x0f0b('0x17')]=function(_0xe8bb7e){var _0x36be02=this;return new Promise(function(_0x13a875,_0x2b66ca){return db['ZendeskAccount'][_0x0f0b('0x18')]({'raw':_0xe8bb7e['options']?_0xe8bb7e[_0x0f0b('0x19')][_0x0f0b('0x1a')]===undefined?!![]:![]:!![],'where':_0xe8bb7e[_0x0f0b('0x19')]?_0xe8bb7e[_0x0f0b('0x19')][_0x0f0b('0x1b')]||null:null,'attributes':_0xe8bb7e['options']?_0xe8bb7e['options'][_0x0f0b('0x1c')]||null:null,'limit':_0xe8bb7e['options']?_0xe8bb7e['options']['limit']||null:null,'include':_0xe8bb7e[_0x0f0b('0x19')]?_0xe8bb7e[_0x0f0b('0x19')][_0x0f0b('0x1d')]?_[_0x0f0b('0x1e')](_0xe8bb7e[_0x0f0b('0x19')][_0x0f0b('0x1d')],function(_0x423ddf){return{'model':db[_0x423ddf[_0x0f0b('0x1f')]],'as':_0x423ddf['as'],'attributes':_0x423ddf[_0x0f0b('0x1c')],'include':_0x423ddf['include']?_['map'](_0x423ddf['include'],function(_0xe86660){return{'model':db[_0xe86660[_0x0f0b('0x1f')]],'as':_0xe86660['as'],'attributes':_0xe86660[_0x0f0b('0x1c')],'include':_0xe86660[_0x0f0b('0x1d')]?_[_0x0f0b('0x1e')](_0xe86660['include'],function(_0x5094f7){return{'model':db[_0x5094f7[_0x0f0b('0x1f')]],'as':_0x5094f7['as'],'attributes':_0x5094f7[_0x0f0b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0f0b('0xd')](function(_0x46b9a7){logger['info'](_0x0f0b('0x17'),_0xe8bb7e);logger[_0x0f0b('0x10')](_0x0f0b('0x17'),_0xe8bb7e,JSON[_0x0f0b('0x20')](_0x46b9a7));_0x13a875(_0x46b9a7);})[_0x0f0b('0x16')](function(_0x3ccbb7){logger[_0x0f0b('0x11')](_0x0f0b('0x17'),_0x3ccbb7[_0x0f0b('0x13')],_0xe8bb7e);_0x2b66ca(_0x36be02[_0x0f0b('0x11')](0x1f4,_0x3ccbb7['message']));});});};exports['ShowZendeskAccount']=function(_0x12967e){var _0x36a14f=this;return new Promise(function(_0x334713,_0x387d38){return db[_0x0f0b('0x21')]['find']({'raw':_0x12967e[_0x0f0b('0x19')]?_0x12967e['options'][_0x0f0b('0x1a')]===undefined?!![]:![]:!![],'where':_0x12967e[_0x0f0b('0x19')]?_0x12967e[_0x0f0b('0x19')][_0x0f0b('0x1b')]||null:null,'attributes':_0x12967e[_0x0f0b('0x19')]?_0x12967e['options'][_0x0f0b('0x1c')]||null:null,'include':_0x12967e[_0x0f0b('0x19')]?_0x12967e[_0x0f0b('0x19')][_0x0f0b('0x1d')]?_['map'](_0x12967e[_0x0f0b('0x19')]['include'],function(_0x2d439e){return{'model':db[_0x2d439e[_0x0f0b('0x1f')]],'as':_0x2d439e['as'],'attributes':_0x2d439e[_0x0f0b('0x1c')],'include':_0x2d439e[_0x0f0b('0x1d')]?_[_0x0f0b('0x1e')](_0x2d439e['include'],function(_0x3c48eb){return{'model':db[_0x3c48eb['model']],'as':_0x3c48eb['as'],'attributes':_0x3c48eb[_0x0f0b('0x1c')],'include':_0x3c48eb[_0x0f0b('0x1d')]?_['map'](_0x3c48eb[_0x0f0b('0x1d')],function(_0x2446f8){return{'model':db[_0x2446f8[_0x0f0b('0x1f')]],'as':_0x2446f8['as'],'attributes':_0x2446f8[_0x0f0b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0f0b('0xd')](function(_0x127359){logger[_0x0f0b('0xe')](_0x0f0b('0x22'),_0x12967e);logger[_0x0f0b('0x10')]('ShowZendeskAccount',_0x12967e,JSON[_0x0f0b('0x20')](_0x127359));_0x334713(_0x127359);})[_0x0f0b('0x16')](function(_0x2a61e7){logger[_0x0f0b('0x11')]('ShowZendeskAccount',_0x2a61e7[_0x0f0b('0x13')],_0x12967e);_0x387d38(_0x36a14f[_0x0f0b('0x11')](0x1f4,_0x2a61e7[_0x0f0b('0x13')]));});});}; \ No newline at end of file +var _0x7c43=['ZendeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','then','ShowZendeskAccount','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZendeskAccount'];(function(_0x44f863,_0xa88e39){var _0x2a3d4b=function(_0x294674){while(--_0x294674){_0x44f863['push'](_0x44f863['shift']());}};_0x2a3d4b(++_0xa88e39);}(_0x7c43,0xf3));var _0x37c4=function(_0x1f960c,_0x2433c3){_0x1f960c=_0x1f960c-0x0;var _0x4bee6b=_0x7c43[_0x1f960c];return _0x4bee6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37c4('0x0'));var BPromise=require('bluebird');var rs=require(_0x37c4('0x1'));var fs=require('fs');var Redis=require(_0x37c4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x37c4('0x3'));var logger=require('../../config/logger')(_0x37c4('0x4'));var config=require(_0x37c4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x37c4('0x6')][_0x37c4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb088e2,_0x42c052,_0x20e9c8){return new BPromise(function(_0x1c9b22,_0x121ed2){return client[_0x37c4('0x8')](_0xb088e2,_0x20e9c8)['then'](function(_0x1c829c){logger['info'](_0x37c4('0x9'),_0x42c052,_0x37c4('0xa'));logger[_0x37c4('0xb')](_0x37c4('0xc'),_0x42c052,_0x37c4('0xa'),JSON[_0x37c4('0xd')](_0x1c829c));if(_0x1c829c[_0x37c4('0xe')]){if(_0x1c829c[_0x37c4('0xe')][_0x37c4('0xf')]===0x1f4){logger['error'](_0x37c4('0x9'),_0x42c052,_0x1c829c['error'][_0x37c4('0x10')]);return _0x121ed2(_0x1c829c[_0x37c4('0xe')][_0x37c4('0x10')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x42c052,_0x1c829c[_0x37c4('0xe')][_0x37c4('0x10')]);return _0x1c9b22(_0x1c829c['error'][_0x37c4('0x10')]);}else{logger[_0x37c4('0x11')](_0x37c4('0x9'),_0x42c052,_0x37c4('0xa'));_0x1c9b22(_0x1c829c[_0x37c4('0x12')]['message']);}})[_0x37c4('0x13')](function(_0x490db7){logger['error'](_0x37c4('0x9'),_0x42c052,_0x490db7);_0x121ed2(_0x490db7);});});}exports[_0x37c4('0x14')]=function(_0x3a3879){var _0x1c5b51=this;return new Promise(function(_0x576a63,_0x287ca2){return db[_0x37c4('0x15')][_0x37c4('0x16')]({'raw':_0x3a3879['options']?_0x3a3879['options'][_0x37c4('0x17')]===undefined?!![]:![]:!![],'where':_0x3a3879[_0x37c4('0x18')]?_0x3a3879['options'][_0x37c4('0x19')]||null:null,'attributes':_0x3a3879[_0x37c4('0x18')]?_0x3a3879[_0x37c4('0x18')][_0x37c4('0x1a')]||null:null,'limit':_0x3a3879[_0x37c4('0x18')]?_0x3a3879[_0x37c4('0x18')][_0x37c4('0x1b')]||null:null,'include':_0x3a3879[_0x37c4('0x18')]?_0x3a3879[_0x37c4('0x18')][_0x37c4('0x1c')]?_[_0x37c4('0x1d')](_0x3a3879[_0x37c4('0x18')]['include'],function(_0x3ca0d2){return{'model':db[_0x3ca0d2['model']],'as':_0x3ca0d2['as'],'attributes':_0x3ca0d2['attributes'],'include':_0x3ca0d2[_0x37c4('0x1c')]?_[_0x37c4('0x1d')](_0x3ca0d2[_0x37c4('0x1c')],function(_0x367ccf){return{'model':db[_0x367ccf['model']],'as':_0x367ccf['as'],'attributes':_0x367ccf['attributes'],'include':_0x367ccf['include']?_[_0x37c4('0x1d')](_0x367ccf['include'],function(_0x56d96f){return{'model':db[_0x56d96f[_0x37c4('0x1e')]],'as':_0x56d96f['as'],'attributes':_0x56d96f[_0x37c4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1db641){logger[_0x37c4('0x11')]('GetZendeskAccount',_0x3a3879);logger[_0x37c4('0xb')](_0x37c4('0x14'),_0x3a3879,JSON[_0x37c4('0xd')](_0x1db641));_0x576a63(_0x1db641);})['catch'](function(_0x58466f){logger[_0x37c4('0xe')](_0x37c4('0x14'),_0x58466f[_0x37c4('0x10')],_0x3a3879);_0x287ca2(_0x1c5b51[_0x37c4('0xe')](0x1f4,_0x58466f[_0x37c4('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x55e44d){var _0x2b8cc1=this;return new Promise(function(_0x11e5d5,_0x9cdba5){return db[_0x37c4('0x15')]['find']({'raw':_0x55e44d[_0x37c4('0x18')]?_0x55e44d[_0x37c4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x55e44d[_0x37c4('0x18')]?_0x55e44d[_0x37c4('0x18')][_0x37c4('0x19')]||null:null,'attributes':_0x55e44d[_0x37c4('0x18')]?_0x55e44d[_0x37c4('0x18')]['attributes']||null:null,'include':_0x55e44d['options']?_0x55e44d[_0x37c4('0x18')][_0x37c4('0x1c')]?_[_0x37c4('0x1d')](_0x55e44d['options'][_0x37c4('0x1c')],function(_0x43ec44){return{'model':db[_0x43ec44['model']],'as':_0x43ec44['as'],'attributes':_0x43ec44['attributes'],'include':_0x43ec44[_0x37c4('0x1c')]?_['map'](_0x43ec44[_0x37c4('0x1c')],function(_0x263e17){return{'model':db[_0x263e17[_0x37c4('0x1e')]],'as':_0x263e17['as'],'attributes':_0x263e17[_0x37c4('0x1a')],'include':_0x263e17[_0x37c4('0x1c')]?_[_0x37c4('0x1d')](_0x263e17[_0x37c4('0x1c')],function(_0x21847a){return{'model':db[_0x21847a[_0x37c4('0x1e')]],'as':_0x21847a['as'],'attributes':_0x21847a[_0x37c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x37c4('0x1f')](function(_0x3b16fa){logger[_0x37c4('0x11')]('ShowZendeskAccount',_0x55e44d);logger[_0x37c4('0xb')](_0x37c4('0x20'),_0x55e44d,JSON[_0x37c4('0xd')](_0x3b16fa));_0x11e5d5(_0x3b16fa);})[_0x37c4('0x13')](function(_0xb7a86){logger[_0x37c4('0xe')](_0x37c4('0x20'),_0xb7a86[_0x37c4('0x10')],_0x55e44d);_0x9cdba5(_0x2b8cc1[_0x37c4('0xe')](0x1f4,_0xb7a86[_0x37c4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f3aba02..1d98ad7 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 _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x5b1c52,_0xef6f85){var _0x28cfa7=function(_0x420d1b){while(--_0x420d1b){_0x5b1c52['push'](_0x5b1c52['shift']());}};_0x28cfa7(++_0xef6f85);}(_0xa571,0x107));var _0x1a57=function(_0x435b98,_0x1ba24d){_0x435b98=_0x435b98-0x0;var _0x2da41f=_0xa571[_0x435b98];return _0x2da41f;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file +var _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xd798aa,_0x1a8bcf){var _0x11af83=function(_0x36dbb0){while(--_0x36dbb0){_0xd798aa['push'](_0xd798aa['shift']());}};_0x11af83(++_0x1a8bcf);}(_0xac4a,0x13f));var _0xaac4=function(_0x41bc87,_0x14fd23){_0x41bc87=_0x41bc87-0x0;var _0x120236=_0xac4a[_0x41bc87];return _0x120236;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 1f300a1..aaae57d 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 _0xe119=['exports','STRING','sequelize'];(function(_0x51ddd1,_0x3b4da0){var _0x24e4e1=function(_0x68e845){while(--_0x68e845){_0x51ddd1['push'](_0x51ddd1['shift']());}};_0x24e4e1(++_0x3b4da0);}(_0xe119,0x13a));var _0x9e11=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0xe119[_0x45ce08];return _0x23dff2;};'use strict';var Sequelize=require(_0x9e11('0x0'));module[_0x9e11('0x1')]={'name':{'type':Sequelize[_0x9e11('0x2')]},'description':{'type':Sequelize[_0x9e11('0x2')]}}; \ No newline at end of file +var _0x50fe=['sequelize','exports','STRING'];(function(_0x527c69,_0x26db7b){var _0x4a2bda=function(_0x4dbe3b){while(--_0x4dbe3b){_0x527c69['push'](_0x527c69['shift']());}};_0x4a2bda(++_0x26db7b);}(_0x50fe,0xf6));var _0xe50f=function(_0x1951a1,_0x3272fd){_0x1951a1=_0x1951a1-0x0;var _0x240d82=_0x50fe[_0x1951a1];return _0x240d82;};'use strict';var Sequelize=require(_0xe50f('0x0'));module[_0xe50f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe50f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d753e1f..af35b87 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 _0x3a42=['filter','merge','VIRTUAL','options','includeAll','include','catch','show','intersection','fields','find','create','body','update','params','destroy','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x67c9a0,_0xa23eee){var _0x244f2c=function(_0x507a4e){while(--_0x507a4e){_0x67c9a0['push'](_0x67c9a0['shift']());}};_0x244f2c(++_0xa23eee);}(_0x3a42,0x176));var _0x23a4=function(_0x42f6ca,_0x268900){_0x42f6ca=_0x42f6ca-0x0;var _0x509ea9=_0x3a42[_0x42f6ca];return _0x509ea9;};'use strict';var emlformat=require(_0x23a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23a4('0x1'));var jsonpatch=require(_0x23a4('0x2'));var rp=require(_0x23a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x23a4('0x4'));var util=require(_0x23a4('0x5'));var path=require(_0x23a4('0x6'));var sox=require(_0x23a4('0x7'));var csv=require(_0x23a4('0x8'));var ejs=require(_0x23a4('0x9'));var fs=require('fs');var fs_extra=require(_0x23a4('0xa'));var _=require(_0x23a4('0xb'));var squel=require('squel');var crypto=require(_0x23a4('0xc'));var jsforce=require(_0x23a4('0xd'));var deskjs=require(_0x23a4('0xe'));var toCsv=require(_0x23a4('0x8'));var querystring=require(_0x23a4('0xf'));var Papa=require(_0x23a4('0x10'));var Redis=require(_0x23a4('0x11'));var authService=require(_0x23a4('0x12'));var qs=require(_0x23a4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23a4('0x14'));var logger=require(_0x23a4('0x15'))(_0x23a4('0x16'));var utils=require('../../config/utils');var config=require(_0x23a4('0x17'));var licenseUtil=require(_0x23a4('0x18'));var db=require(_0x23a4('0x19'))['db'];function respondWithStatusCode(_0x5f1313,_0x3f155e){_0x3f155e=_0x3f155e||0xcc;return function(_0x49aa84){if(_0x49aa84){return _0x5f1313[_0x23a4('0x1a')](_0x3f155e);}return _0x5f1313[_0x23a4('0x1b')](_0x3f155e)[_0x23a4('0x1c')]();};}function respondWithResult(_0x2248c7,_0x3aaf75){_0x3aaf75=_0x3aaf75||0xc8;return function(_0x27a63d){if(_0x27a63d){return _0x2248c7[_0x23a4('0x1b')](_0x3aaf75)[_0x23a4('0x1d')](_0x27a63d);}};}function respondWithFilteredResult(_0x5a7260,_0x637d78){return function(_0x54f7f0){if(_0x54f7f0){var _0x41df04=typeof _0x637d78[_0x23a4('0x1e')]==='undefined'&&typeof _0x637d78['limit']===_0x23a4('0x1f');var _0xc0ba49=_0x54f7f0['count'];var _0x5cabcb=_0x41df04?0x0:_0x637d78[_0x23a4('0x1e')];var _0x189005=_0x41df04?_0x54f7f0[_0x23a4('0x20')]:_0x637d78[_0x23a4('0x1e')]+_0x637d78[_0x23a4('0x21')];var _0x55986e;if(_0x189005>=_0xc0ba49){_0x189005=_0xc0ba49;_0x55986e=0xc8;}else{_0x55986e=0xce;}_0x5a7260['status'](_0x55986e);return _0x5a7260[_0x23a4('0x22')](_0x23a4('0x23'),_0x5cabcb+'-'+_0x189005+'/'+_0xc0ba49)[_0x23a4('0x1d')](_0x54f7f0);}return null;};}function patchUpdates(_0x2acc82){return function(_0x5032ee){try{jsonpatch[_0x23a4('0x24')](_0x5032ee,_0x2acc82,!![]);}catch(_0x5af7f0){return BPromise[_0x23a4('0x25')](_0x5af7f0);}return _0x5032ee['save']();};}function saveUpdates(_0x278e3d,_0x1ec0bd){return function(_0x460c5a){if(_0x460c5a){return _0x460c5a['update'](_0x278e3d)[_0x23a4('0x26')](function(_0x59b06b){return _0x59b06b;});}return null;};}function removeEntity(_0x178ee4,_0x261820){return function(_0x7d2144){if(_0x7d2144){return _0x7d2144['destroy']()['then'](function(){_0x178ee4[_0x23a4('0x1b')](0xcc)[_0x23a4('0x1c')]();});}};}function handleEntityNotFound(_0x565535,_0x3cc765){return function(_0x1d8db7){if(!_0x1d8db7){_0x565535[_0x23a4('0x1a')](0x194);}return _0x1d8db7;};}function handleError(_0x27b1c1,_0x574586){_0x574586=_0x574586||0x1f4;return function(_0x5e22e0){logger[_0x23a4('0x27')](_0x5e22e0[_0x23a4('0x28')]);if(_0x5e22e0[_0x23a4('0x29')]){delete _0x5e22e0['name'];}_0x27b1c1['status'](_0x574586)[_0x23a4('0x2a')](_0x5e22e0);};}exports[_0x23a4('0x2b')]=function(_0x5835d1,_0x5c5a20){var _0x29e8d7={},_0x329284={},_0x5e072c={'count':0x0,'rows':[]};var _0x237f3d=_[_0x23a4('0x2c')](db[_0x23a4('0x2d')][_0x23a4('0x2e')],function(_0xb1bf2){return{'name':_0xb1bf2[_0x23a4('0x2f')],'type':_0xb1bf2[_0x23a4('0x30')][_0x23a4('0x31')]};});_0x329284[_0x23a4('0x32')]=_[_0x23a4('0x2c')](_0x237f3d,_0x23a4('0x29'));_0x329284[_0x23a4('0x33')]=_[_0x23a4('0x34')](_0x5835d1[_0x23a4('0x33')]);_0x329284['filters']=_['intersection'](_0x329284[_0x23a4('0x32')],_0x329284['query']);_0x29e8d7[_0x23a4('0x35')]=_['intersection'](_0x329284[_0x23a4('0x32')],qs['fields'](_0x5835d1[_0x23a4('0x33')]['fields']));_0x29e8d7[_0x23a4('0x35')]=_0x29e8d7[_0x23a4('0x35')][_0x23a4('0x36')]?_0x29e8d7[_0x23a4('0x35')]:_0x329284[_0x23a4('0x32')];if(!_0x5835d1[_0x23a4('0x33')][_0x23a4('0x37')](_0x23a4('0x38'))){_0x29e8d7[_0x23a4('0x21')]=qs[_0x23a4('0x21')](_0x5835d1[_0x23a4('0x33')][_0x23a4('0x21')]);_0x29e8d7[_0x23a4('0x1e')]=qs[_0x23a4('0x1e')](_0x5835d1[_0x23a4('0x33')]['offset']);}_0x29e8d7[_0x23a4('0x39')]=qs['sort'](_0x5835d1[_0x23a4('0x33')][_0x23a4('0x3a')]);_0x29e8d7[_0x23a4('0x3b')]=qs[_0x23a4('0x3c')](_['pick'](_0x5835d1[_0x23a4('0x33')],_0x329284['filters']),_0x237f3d);if(_0x5835d1[_0x23a4('0x33')][_0x23a4('0x3d')]){_0x29e8d7[_0x23a4('0x3b')]=_[_0x23a4('0x3e')](_0x29e8d7['where'],{'$or':_[_0x23a4('0x2c')](_0x237f3d,function(_0x12c717){if(_0x12c717[_0x23a4('0x30')]!==_0x23a4('0x3f')){var _0x164057={};_0x164057[_0x12c717[_0x23a4('0x29')]]={'$like':'%'+_0x5835d1[_0x23a4('0x33')][_0x23a4('0x3d')]+'%'};return _0x164057;}})});}_0x29e8d7=_[_0x23a4('0x3e')]({},_0x29e8d7,_0x5835d1[_0x23a4('0x40')]);var _0x15ee10={'where':_0x29e8d7['where']};return db[_0x23a4('0x2d')][_0x23a4('0x20')](_0x15ee10)[_0x23a4('0x26')](function(_0x492c6b){_0x5e072c[_0x23a4('0x20')]=_0x492c6b;if(_0x5835d1[_0x23a4('0x33')][_0x23a4('0x41')]){_0x29e8d7[_0x23a4('0x42')]=[{'all':!![]}];}return db[_0x23a4('0x2d')]['findAll'](_0x29e8d7);})[_0x23a4('0x26')](function(_0x46d44c){_0x5e072c['rows']=_0x46d44c;return _0x5e072c;})[_0x23a4('0x26')](respondWithFilteredResult(_0x5c5a20,_0x29e8d7))[_0x23a4('0x43')](handleError(_0x5c5a20,null));};exports[_0x23a4('0x44')]=function(_0x12fea2,_0x2ea666){var _0x15b450={'raw':![],'where':{'id':_0x12fea2['params']['id']}},_0x67c241={};_0x67c241[_0x23a4('0x32')]=_[_0x23a4('0x34')](db[_0x23a4('0x2d')][_0x23a4('0x2e')]);_0x67c241['query']=_[_0x23a4('0x34')](_0x12fea2[_0x23a4('0x33')]);_0x67c241['filters']=_[_0x23a4('0x45')](_0x67c241[_0x23a4('0x32')],_0x67c241[_0x23a4('0x33')]);_0x15b450[_0x23a4('0x35')]=_['intersection'](_0x67c241[_0x23a4('0x32')],qs[_0x23a4('0x46')](_0x12fea2[_0x23a4('0x33')][_0x23a4('0x46')]));_0x15b450[_0x23a4('0x35')]=_0x15b450[_0x23a4('0x35')][_0x23a4('0x36')]?_0x15b450['attributes']:_0x67c241[_0x23a4('0x32')];if(_0x12fea2[_0x23a4('0x33')][_0x23a4('0x41')]){_0x15b450[_0x23a4('0x42')]=[{'all':!![]}];}_0x15b450=_[_0x23a4('0x3e')]({},_0x15b450,_0x12fea2['options']);return db[_0x23a4('0x2d')][_0x23a4('0x47')](_0x15b450)['then'](handleEntityNotFound(_0x2ea666,null))[_0x23a4('0x26')](respondWithResult(_0x2ea666,null))[_0x23a4('0x43')](handleError(_0x2ea666,null));};exports[_0x23a4('0x48')]=function(_0x1c8a8e,_0x5c220e){return db['ZendeskConfiguration']['create'](_0x1c8a8e[_0x23a4('0x49')],{})[_0x23a4('0x26')](respondWithResult(_0x5c220e,0xc9))[_0x23a4('0x43')](handleError(_0x5c220e,null));};exports[_0x23a4('0x4a')]=function(_0x1aead0,_0x108f24){if(_0x1aead0[_0x23a4('0x49')]['id']){delete _0x1aead0[_0x23a4('0x49')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x1aead0[_0x23a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x108f24,null))['then'](saveUpdates(_0x1aead0['body'],null))[_0x23a4('0x26')](respondWithResult(_0x108f24,null))[_0x23a4('0x43')](handleError(_0x108f24,null));};exports[_0x23a4('0x4c')]=function(_0x5cda45,_0xbc8b3a){return db[_0x23a4('0x2d')]['find']({'where':{'id':_0x5cda45[_0x23a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbc8b3a,null))[_0x23a4('0x26')](removeEntity(_0xbc8b3a,null))['catch'](handleError(_0xbc8b3a,null));};exports[_0x23a4('0x4d')]=function(_0x198fe3,_0x1138a0,_0x73a411){var _0x2d5110={};var _0x39b68f={};var _0x115816;var _0x4d0a8b;return db[_0x23a4('0x2d')][_0x23a4('0x4e')]({'where':{'id':_0x198fe3[_0x23a4('0x4b')]['id']}})[_0x23a4('0x26')](handleEntityNotFound(_0x1138a0,null))[_0x23a4('0x26')](function(_0x5a6cd9){if(_0x5a6cd9){_0x115816=_0x5a6cd9;_0x39b68f[_0x23a4('0x32')]=_['keys'](db[_0x23a4('0x4f')][_0x23a4('0x2e')]);_0x39b68f['query']=_['keys'](_0x198fe3[_0x23a4('0x33')]);_0x39b68f['filters']=_['intersection'](_0x39b68f[_0x23a4('0x32')],_0x39b68f[_0x23a4('0x33')]);_0x2d5110[_0x23a4('0x35')]=_[_0x23a4('0x45')](_0x39b68f['model'],qs[_0x23a4('0x46')](_0x198fe3['query'][_0x23a4('0x46')]));_0x2d5110['attributes']=_0x2d5110[_0x23a4('0x35')][_0x23a4('0x36')]?_0x2d5110[_0x23a4('0x35')]:_0x39b68f['model'];_0x2d5110[_0x23a4('0x39')]=qs['sort'](_0x198fe3[_0x23a4('0x33')]['sort']);_0x2d5110[_0x23a4('0x3b')]=qs[_0x23a4('0x3c')](_[_0x23a4('0x50')](_0x198fe3[_0x23a4('0x33')],_0x39b68f[_0x23a4('0x3c')]));if(_0x198fe3['query']['filter']){_0x2d5110[_0x23a4('0x3b')]=_[_0x23a4('0x3e')](_0x2d5110[_0x23a4('0x3b')],{'$or':_[_0x23a4('0x2c')](_0x2d5110['attributes'],function(_0x3bd390){var _0x2ccec4={};_0x2ccec4[_0x3bd390]={'$like':'%'+_0x198fe3[_0x23a4('0x33')][_0x23a4('0x3d')]+'%'};return _0x2ccec4;})});}_0x2d5110=_[_0x23a4('0x3e')]({},_0x2d5110,_0x198fe3[_0x23a4('0x40')]);return _0x115816['getFields'](_0x2d5110);}})[_0x23a4('0x26')](function(_0xc51daa){if(_0xc51daa){_0x4d0a8b=_0xc51daa['length'];if(!_0x198fe3['query'][_0x23a4('0x37')]('nolimit')){_0x2d5110[_0x23a4('0x21')]=qs[_0x23a4('0x21')](_0x198fe3[_0x23a4('0x33')][_0x23a4('0x21')]);_0x2d5110[_0x23a4('0x1e')]=qs['offset'](_0x198fe3[_0x23a4('0x33')][_0x23a4('0x1e')]);}return _0x115816[_0x23a4('0x4d')](_0x2d5110);}})[_0x23a4('0x26')](function(_0x14620f){if(_0x14620f){return _0x14620f?{'count':_0x4d0a8b,'rows':_0x14620f}:null;}})[_0x23a4('0x26')](respondWithResult(_0x1138a0,null))[_0x23a4('0x43')](handleError(_0x1138a0,null));};exports[_0x23a4('0x51')]=function(_0x27e7fe,_0x3d3f2b,_0x4ec911){var _0x254e3a={};var _0x4eafef={};var _0x3bb1ac;var _0x559673;return db[_0x23a4('0x2d')][_0x23a4('0x4e')]({'where':{'id':_0x27e7fe[_0x23a4('0x4b')]['id']}})[_0x23a4('0x26')](handleEntityNotFound(_0x3d3f2b,null))[_0x23a4('0x26')](function(_0xad1a58){if(_0xad1a58){_0x3bb1ac=_0xad1a58;_0x4eafef[_0x23a4('0x32')]=_[_0x23a4('0x34')](db[_0x23a4('0x4f')]['rawAttributes']);_0x4eafef[_0x23a4('0x33')]=_[_0x23a4('0x34')](_0x27e7fe[_0x23a4('0x33')]);_0x4eafef['filters']=_['intersection'](_0x4eafef[_0x23a4('0x32')],_0x4eafef[_0x23a4('0x33')]);_0x254e3a['attributes']=_[_0x23a4('0x45')](_0x4eafef[_0x23a4('0x32')],qs[_0x23a4('0x46')](_0x27e7fe[_0x23a4('0x33')][_0x23a4('0x46')]));_0x254e3a[_0x23a4('0x35')]=_0x254e3a[_0x23a4('0x35')][_0x23a4('0x36')]?_0x254e3a[_0x23a4('0x35')]:_0x4eafef[_0x23a4('0x32')];_0x254e3a[_0x23a4('0x39')]=qs[_0x23a4('0x3a')](_0x27e7fe[_0x23a4('0x33')][_0x23a4('0x3a')]);_0x254e3a[_0x23a4('0x3b')]=qs[_0x23a4('0x3c')](_[_0x23a4('0x50')](_0x27e7fe[_0x23a4('0x33')],_0x4eafef['filters']));if(_0x27e7fe['query']['filter']){_0x254e3a[_0x23a4('0x3b')]=_['merge'](_0x254e3a[_0x23a4('0x3b')],{'$or':_['map'](_0x254e3a['attributes'],function(_0x3946f3){var _0x338d9a={};_0x338d9a[_0x3946f3]={'$like':'%'+_0x27e7fe[_0x23a4('0x33')][_0x23a4('0x3d')]+'%'};return _0x338d9a;})});}_0x254e3a=_[_0x23a4('0x3e')]({},_0x254e3a,_0x27e7fe[_0x23a4('0x40')]);return _0x3bb1ac[_0x23a4('0x51')](_0x254e3a);}})['then'](function(_0xaa9ccb){if(_0xaa9ccb){_0x559673=_0xaa9ccb[_0x23a4('0x36')];if(!_0x27e7fe[_0x23a4('0x33')][_0x23a4('0x37')](_0x23a4('0x38'))){_0x254e3a[_0x23a4('0x21')]=qs['limit'](_0x27e7fe[_0x23a4('0x33')][_0x23a4('0x21')]);_0x254e3a[_0x23a4('0x1e')]=qs[_0x23a4('0x1e')](_0x27e7fe[_0x23a4('0x33')][_0x23a4('0x1e')]);}return _0x3bb1ac[_0x23a4('0x51')](_0x254e3a);}})['then'](function(_0x759cd7){if(_0x759cd7){return _0x759cd7?{'count':_0x559673,'rows':_0x759cd7}:null;}})[_0x23a4('0x26')](respondWithResult(_0x3d3f2b,null))[_0x23a4('0x43')](handleError(_0x3d3f2b,null));};exports['getDescriptions']=function(_0x4ab3a2,_0x3e7c59,_0x359c1a){var _0x35956b={};var _0xb93294={};var _0x4d2574;var _0x1fc9c3;return db['ZendeskConfiguration'][_0x23a4('0x4e')]({'where':{'id':_0x4ab3a2[_0x23a4('0x4b')]['id']}})[_0x23a4('0x26')](handleEntityNotFound(_0x3e7c59,null))[_0x23a4('0x26')](function(_0x1cb4a4){if(_0x1cb4a4){_0x4d2574=_0x1cb4a4;_0xb93294['model']=_['keys'](db[_0x23a4('0x4f')][_0x23a4('0x2e')]);_0xb93294[_0x23a4('0x33')]=_[_0x23a4('0x34')](_0x4ab3a2['query']);_0xb93294[_0x23a4('0x3c')]=_[_0x23a4('0x45')](_0xb93294['model'],_0xb93294[_0x23a4('0x33')]);_0x35956b[_0x23a4('0x35')]=_[_0x23a4('0x45')](_0xb93294[_0x23a4('0x32')],qs['fields'](_0x4ab3a2[_0x23a4('0x33')][_0x23a4('0x46')]));_0x35956b['attributes']=_0x35956b[_0x23a4('0x35')]['length']?_0x35956b[_0x23a4('0x35')]:_0xb93294[_0x23a4('0x32')];_0x35956b[_0x23a4('0x39')]=qs['sort'](_0x4ab3a2['query'][_0x23a4('0x3a')]);_0x35956b[_0x23a4('0x3b')]=qs[_0x23a4('0x3c')](_[_0x23a4('0x50')](_0x4ab3a2[_0x23a4('0x33')],_0xb93294[_0x23a4('0x3c')]));if(_0x4ab3a2[_0x23a4('0x33')][_0x23a4('0x3d')]){_0x35956b[_0x23a4('0x3b')]=_['merge'](_0x35956b[_0x23a4('0x3b')],{'$or':_[_0x23a4('0x2c')](_0x35956b[_0x23a4('0x35')],function(_0x351d0a){var _0x2a7827={};_0x2a7827[_0x351d0a]={'$like':'%'+_0x4ab3a2[_0x23a4('0x33')][_0x23a4('0x3d')]+'%'};return _0x2a7827;})});}_0x35956b=_[_0x23a4('0x3e')]({},_0x35956b,_0x4ab3a2[_0x23a4('0x40')]);return _0x4d2574['getDescriptions'](_0x35956b);}})['then'](function(_0x3fd982){if(_0x3fd982){_0x1fc9c3=_0x3fd982[_0x23a4('0x36')];if(!_0x4ab3a2['query']['hasOwnProperty']('nolimit')){_0x35956b[_0x23a4('0x21')]=qs[_0x23a4('0x21')](_0x4ab3a2['query'][_0x23a4('0x21')]);_0x35956b[_0x23a4('0x1e')]=qs[_0x23a4('0x1e')](_0x4ab3a2['query']['offset']);}return _0x4d2574[_0x23a4('0x52')](_0x35956b);}})[_0x23a4('0x26')](function(_0x59f7d8){if(_0x59f7d8){return _0x59f7d8?{'count':_0x1fc9c3,'rows':_0x59f7d8}:null;}})[_0x23a4('0x26')](respondWithResult(_0x3e7c59,null))[_0x23a4('0x43')](handleError(_0x3e7c59,null));};exports['getTags']=function(_0x389454,_0x1f3e67,_0x1c1aa9){var _0x1a95a2={};var _0x5dc12e={};var _0x2269ec;var _0x43f34a;return db[_0x23a4('0x2d')][_0x23a4('0x4e')]({'where':{'id':_0x389454[_0x23a4('0x4b')]['id']}})[_0x23a4('0x26')](handleEntityNotFound(_0x1f3e67,null))[_0x23a4('0x26')](function(_0x57e4dd){if(_0x57e4dd){_0x2269ec=_0x57e4dd;_0x5dc12e[_0x23a4('0x32')]=_[_0x23a4('0x34')](db[_0x23a4('0x53')][_0x23a4('0x2e')]);_0x5dc12e[_0x23a4('0x33')]=_[_0x23a4('0x34')](_0x389454[_0x23a4('0x33')]);_0x5dc12e[_0x23a4('0x3c')]=_[_0x23a4('0x45')](_0x5dc12e['model'],_0x5dc12e['query']);_0x1a95a2[_0x23a4('0x35')]=_[_0x23a4('0x45')](_0x5dc12e['model'],qs[_0x23a4('0x46')](_0x389454['query'][_0x23a4('0x46')]));_0x1a95a2[_0x23a4('0x35')]=_0x1a95a2[_0x23a4('0x35')][_0x23a4('0x36')]?_0x1a95a2[_0x23a4('0x35')]:_0x5dc12e[_0x23a4('0x32')];_0x1a95a2['order']=qs[_0x23a4('0x3a')](_0x389454[_0x23a4('0x33')][_0x23a4('0x3a')]);_0x1a95a2[_0x23a4('0x3b')]=qs[_0x23a4('0x3c')](_[_0x23a4('0x50')](_0x389454[_0x23a4('0x33')],_0x5dc12e[_0x23a4('0x3c')]));if(_0x389454[_0x23a4('0x33')][_0x23a4('0x3d')]){_0x1a95a2[_0x23a4('0x3b')]=_[_0x23a4('0x3e')](_0x1a95a2['where'],{'$or':_[_0x23a4('0x2c')](_0x1a95a2['attributes'],function(_0x476c62){var _0x922d8e={};_0x922d8e[_0x476c62]={'$like':'%'+_0x389454[_0x23a4('0x33')][_0x23a4('0x3d')]+'%'};return _0x922d8e;})});}_0x1a95a2=_[_0x23a4('0x3e')]({},_0x1a95a2,_0x389454[_0x23a4('0x40')]);return _0x2269ec[_0x23a4('0x54')](_0x1a95a2);}})[_0x23a4('0x26')](function(_0x4f53cb){if(_0x4f53cb){_0x43f34a=_0x4f53cb[_0x23a4('0x36')];if(!_0x389454[_0x23a4('0x33')]['hasOwnProperty'](_0x23a4('0x38'))){_0x1a95a2['limit']=qs[_0x23a4('0x21')](_0x389454[_0x23a4('0x33')][_0x23a4('0x21')]);_0x1a95a2['offset']=qs[_0x23a4('0x1e')](_0x389454[_0x23a4('0x33')][_0x23a4('0x1e')]);}return _0x2269ec[_0x23a4('0x54')](_0x1a95a2);}})[_0x23a4('0x26')](function(_0x29bd7f){if(_0x29bd7f){return _0x29bd7f?{'count':_0x43f34a,'rows':_0x29bd7f}:null;}})[_0x23a4('0x26')](respondWithResult(_0x1f3e67,null))[_0x23a4('0x43')](handleError(_0x1f3e67,null));};exports[_0x23a4('0x55')]=function(_0x45e9e4,_0x4c1ad2,_0x304a84){if(_0x45e9e4['body']['id']){delete _0x45e9e4[_0x23a4('0x49')]['id'];}return db[_0x23a4('0x2d')][_0x23a4('0x4e')]({'where':{'id':_0x45e9e4[_0x23a4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c1ad2,null))['then'](function(_0x5dd17f){if(_0x5dd17f){return _0x5dd17f[_0x23a4('0x55')](_0x45e9e4[_0x23a4('0x49')][_0x23a4('0x56')]||[]);}return null;})[_0x23a4('0x26')](respondWithResult(_0x4c1ad2,null))[_0x23a4('0x43')](handleError(_0x4c1ad2,null));}; \ No newline at end of file +var _0x936f=['include','catch','create','body','find','destroy','getFields','findOne','ZendeskField','length','options','hasOwnProperty','getSubjects','getDescriptions','nolimit','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','stack','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','findAll','rows','params'];(function(_0xd7b331,_0x23f99d){var _0x225ef9=function(_0x3ac16a){while(--_0x3ac16a){_0xd7b331['push'](_0xd7b331['shift']());}};_0x225ef9(++_0x23f99d);}(_0x936f,0x15f));var _0xf936=function(_0x107531,_0x479748){_0x107531=_0x107531-0x0;var _0x4319ca=_0x936f[_0x107531];return _0x4319ca;};'use strict';var emlformat=require(_0xf936('0x0'));var rimraf=require(_0xf936('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf936('0x2'));var rp=require(_0xf936('0x3'));var moment=require(_0xf936('0x4'));var BPromise=require(_0xf936('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf936('0x6'));var sox=require(_0xf936('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf936('0x8'));var _=require(_0xf936('0x9'));var squel=require(_0xf936('0xa'));var crypto=require(_0xf936('0xb'));var jsforce=require(_0xf936('0xc'));var deskjs=require(_0xf936('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf936('0xe'));var Papa=require(_0xf936('0xf'));var Redis=require(_0xf936('0x10'));var authService=require(_0xf936('0x11'));var qs=require(_0xf936('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf936('0x13'));var logger=require(_0xf936('0x14'))(_0xf936('0x15'));var utils=require(_0xf936('0x16'));var config=require(_0xf936('0x17'));var licenseUtil=require(_0xf936('0x18'));var db=require(_0xf936('0x19'))['db'];function respondWithStatusCode(_0x473dac,_0x48b5db){_0x48b5db=_0x48b5db||0xcc;return function(_0x171003){if(_0x171003){return _0x473dac[_0xf936('0x1a')](_0x48b5db);}return _0x473dac[_0xf936('0x1b')](_0x48b5db)[_0xf936('0x1c')]();};}function respondWithResult(_0x18aa87,_0x225394){_0x225394=_0x225394||0xc8;return function(_0x53b24d){if(_0x53b24d){return _0x18aa87[_0xf936('0x1b')](_0x225394)[_0xf936('0x1d')](_0x53b24d);}};}function respondWithFilteredResult(_0x530dcd,_0x2de5c4){return function(_0x18660a){if(_0x18660a){var _0x2ecf7c=typeof _0x2de5c4[_0xf936('0x1e')]==='undefined'&&typeof _0x2de5c4['limit']===_0xf936('0x1f');var _0x3a2776=_0x18660a['count'];var _0x4a2de1=_0x2ecf7c?0x0:_0x2de5c4[_0xf936('0x1e')];var _0x2f3dc2=_0x2ecf7c?_0x18660a[_0xf936('0x20')]:_0x2de5c4['offset']+_0x2de5c4[_0xf936('0x21')];var _0x421f16;if(_0x2f3dc2>=_0x3a2776){_0x2f3dc2=_0x3a2776;_0x421f16=0xc8;}else{_0x421f16=0xce;}_0x530dcd['status'](_0x421f16);return _0x530dcd[_0xf936('0x22')]('Content-Range',_0x4a2de1+'-'+_0x2f3dc2+'/'+_0x3a2776)[_0xf936('0x1d')](_0x18660a);}return null;};}function patchUpdates(_0x7dbd8d){return function(_0x512ae3){try{jsonpatch[_0xf936('0x23')](_0x512ae3,_0x7dbd8d,!![]);}catch(_0x2fbecd){return BPromise[_0xf936('0x24')](_0x2fbecd);}return _0x512ae3[_0xf936('0x25')]();};}function saveUpdates(_0xa136a7,_0x44fdf){return function(_0x121b3d){if(_0x121b3d){return _0x121b3d['update'](_0xa136a7)['then'](function(_0x2c8267){return _0x2c8267;});}return null;};}function removeEntity(_0x2f0caf,_0x1503ee){return function(_0x412d34){if(_0x412d34){return _0x412d34['destroy']()['then'](function(){_0x2f0caf[_0xf936('0x1b')](0xcc)[_0xf936('0x1c')]();});}};}function handleEntityNotFound(_0x562b4d,_0x252269){return function(_0x29fe2c){if(!_0x29fe2c){_0x562b4d[_0xf936('0x1a')](0x194);}return _0x29fe2c;};}function handleError(_0x19c2c8,_0x6a56c8){_0x6a56c8=_0x6a56c8||0x1f4;return function(_0x355072){logger['error'](_0x355072[_0xf936('0x26')]);if(_0x355072[_0xf936('0x27')]){delete _0x355072[_0xf936('0x27')];}_0x19c2c8[_0xf936('0x1b')](_0x6a56c8)['send'](_0x355072);};}exports['index']=function(_0x37185a,_0x599f88){var _0x5b2a9a={},_0x29369b={},_0x50cf4e={'count':0x0,'rows':[]};var _0x342806=_[_0xf936('0x28')](db[_0xf936('0x29')][_0xf936('0x2a')],function(_0x4391f1){return{'name':_0x4391f1[_0xf936('0x2b')],'type':_0x4391f1[_0xf936('0x2c')]['key']};});_0x29369b['model']=_[_0xf936('0x28')](_0x342806,_0xf936('0x27'));_0x29369b[_0xf936('0x2d')]=_[_0xf936('0x2e')](_0x37185a[_0xf936('0x2d')]);_0x29369b[_0xf936('0x2f')]=_[_0xf936('0x30')](_0x29369b[_0xf936('0x31')],_0x29369b[_0xf936('0x2d')]);_0x5b2a9a[_0xf936('0x32')]=_['intersection'](_0x29369b['model'],qs['fields'](_0x37185a[_0xf936('0x2d')][_0xf936('0x33')]));_0x5b2a9a[_0xf936('0x32')]=_0x5b2a9a['attributes']['length']?_0x5b2a9a['attributes']:_0x29369b[_0xf936('0x31')];if(!_0x37185a['query']['hasOwnProperty']('nolimit')){_0x5b2a9a[_0xf936('0x21')]=qs[_0xf936('0x21')](_0x37185a[_0xf936('0x2d')][_0xf936('0x21')]);_0x5b2a9a[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x37185a[_0xf936('0x2d')][_0xf936('0x1e')]);}_0x5b2a9a[_0xf936('0x34')]=qs[_0xf936('0x35')](_0x37185a['query'][_0xf936('0x35')]);_0x5b2a9a['where']=qs[_0xf936('0x2f')](_[_0xf936('0x36')](_0x37185a['query'],_0x29369b[_0xf936('0x2f')]),_0x342806);if(_0x37185a[_0xf936('0x2d')][_0xf936('0x37')]){_0x5b2a9a[_0xf936('0x38')]=_[_0xf936('0x39')](_0x5b2a9a['where'],{'$or':_[_0xf936('0x28')](_0x342806,function(_0x32de89){if(_0x32de89[_0xf936('0x2c')]!==_0xf936('0x3a')){var _0xccfbe1={};_0xccfbe1[_0x32de89['name']]={'$like':'%'+_0x37185a[_0xf936('0x2d')][_0xf936('0x37')]+'%'};return _0xccfbe1;}})});}_0x5b2a9a=_['merge']({},_0x5b2a9a,_0x37185a['options']);var _0x2d7124={'where':_0x5b2a9a['where']};return db[_0xf936('0x29')][_0xf936('0x20')](_0x2d7124)[_0xf936('0x3b')](function(_0x2a3e6c){_0x50cf4e[_0xf936('0x20')]=_0x2a3e6c;if(_0x37185a[_0xf936('0x2d')][_0xf936('0x3c')]){_0x5b2a9a['include']=[{'all':!![]}];}return db[_0xf936('0x29')][_0xf936('0x3d')](_0x5b2a9a);})[_0xf936('0x3b')](function(_0x1bca62){_0x50cf4e[_0xf936('0x3e')]=_0x1bca62;return _0x50cf4e;})[_0xf936('0x3b')](respondWithFilteredResult(_0x599f88,_0x5b2a9a))['catch'](handleError(_0x599f88,null));};exports['show']=function(_0x51b68d,_0x36ed1c){var _0x4a9e7b={'raw':![],'where':{'id':_0x51b68d[_0xf936('0x3f')]['id']}},_0x4a31ce={};_0x4a31ce[_0xf936('0x31')]=_['keys'](db[_0xf936('0x29')]['rawAttributes']);_0x4a31ce[_0xf936('0x2d')]=_['keys'](_0x51b68d['query']);_0x4a31ce['filters']=_[_0xf936('0x30')](_0x4a31ce[_0xf936('0x31')],_0x4a31ce[_0xf936('0x2d')]);_0x4a9e7b[_0xf936('0x32')]=_[_0xf936('0x30')](_0x4a31ce[_0xf936('0x31')],qs[_0xf936('0x33')](_0x51b68d[_0xf936('0x2d')][_0xf936('0x33')]));_0x4a9e7b['attributes']=_0x4a9e7b[_0xf936('0x32')]['length']?_0x4a9e7b[_0xf936('0x32')]:_0x4a31ce[_0xf936('0x31')];if(_0x51b68d['query'][_0xf936('0x3c')]){_0x4a9e7b[_0xf936('0x40')]=[{'all':!![]}];}_0x4a9e7b=_['merge']({},_0x4a9e7b,_0x51b68d['options']);return db['ZendeskConfiguration']['find'](_0x4a9e7b)[_0xf936('0x3b')](handleEntityNotFound(_0x36ed1c,null))[_0xf936('0x3b')](respondWithResult(_0x36ed1c,null))[_0xf936('0x41')](handleError(_0x36ed1c,null));};exports['create']=function(_0x193f6f,_0x1174eb){return db[_0xf936('0x29')][_0xf936('0x42')](_0x193f6f['body'],{})[_0xf936('0x3b')](respondWithResult(_0x1174eb,0xc9))[_0xf936('0x41')](handleError(_0x1174eb,null));};exports['update']=function(_0x1f0879,_0x176a1b){if(_0x1f0879[_0xf936('0x43')]['id']){delete _0x1f0879['body']['id'];}return db['ZendeskConfiguration'][_0xf936('0x44')]({'where':{'id':_0x1f0879[_0xf936('0x3f')]['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x176a1b,null))[_0xf936('0x3b')](saveUpdates(_0x1f0879[_0xf936('0x43')],null))[_0xf936('0x3b')](respondWithResult(_0x176a1b,null))[_0xf936('0x41')](handleError(_0x176a1b,null));};exports[_0xf936('0x45')]=function(_0x5368f2,_0x21cc0d){return db[_0xf936('0x29')][_0xf936('0x44')]({'where':{'id':_0x5368f2[_0xf936('0x3f')]['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x21cc0d,null))[_0xf936('0x3b')](removeEntity(_0x21cc0d,null))[_0xf936('0x41')](handleError(_0x21cc0d,null));};exports[_0xf936('0x46')]=function(_0x59a3bf,_0x1a5ea6,_0x106b3a){var _0x123475={};var _0x245696={};var _0x3ea044;var _0xa44527;return db[_0xf936('0x29')][_0xf936('0x47')]({'where':{'id':_0x59a3bf[_0xf936('0x3f')]['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x1a5ea6,null))[_0xf936('0x3b')](function(_0x16ddd3){if(_0x16ddd3){_0x3ea044=_0x16ddd3;_0x245696['model']=_[_0xf936('0x2e')](db[_0xf936('0x48')][_0xf936('0x2a')]);_0x245696[_0xf936('0x2d')]=_[_0xf936('0x2e')](_0x59a3bf[_0xf936('0x2d')]);_0x245696[_0xf936('0x2f')]=_[_0xf936('0x30')](_0x245696[_0xf936('0x31')],_0x245696[_0xf936('0x2d')]);_0x123475[_0xf936('0x32')]=_[_0xf936('0x30')](_0x245696[_0xf936('0x31')],qs[_0xf936('0x33')](_0x59a3bf[_0xf936('0x2d')][_0xf936('0x33')]));_0x123475[_0xf936('0x32')]=_0x123475[_0xf936('0x32')][_0xf936('0x49')]?_0x123475[_0xf936('0x32')]:_0x245696[_0xf936('0x31')];_0x123475[_0xf936('0x34')]=qs[_0xf936('0x35')](_0x59a3bf['query'][_0xf936('0x35')]);_0x123475[_0xf936('0x38')]=qs[_0xf936('0x2f')](_[_0xf936('0x36')](_0x59a3bf[_0xf936('0x2d')],_0x245696[_0xf936('0x2f')]));if(_0x59a3bf[_0xf936('0x2d')]['filter']){_0x123475[_0xf936('0x38')]=_[_0xf936('0x39')](_0x123475[_0xf936('0x38')],{'$or':_[_0xf936('0x28')](_0x123475[_0xf936('0x32')],function(_0x12edcb){var _0x232599={};_0x232599[_0x12edcb]={'$like':'%'+_0x59a3bf[_0xf936('0x2d')]['filter']+'%'};return _0x232599;})});}_0x123475=_[_0xf936('0x39')]({},_0x123475,_0x59a3bf[_0xf936('0x4a')]);return _0x3ea044[_0xf936('0x46')](_0x123475);}})['then'](function(_0x3cb316){if(_0x3cb316){_0xa44527=_0x3cb316[_0xf936('0x49')];if(!_0x59a3bf[_0xf936('0x2d')][_0xf936('0x4b')]('nolimit')){_0x123475[_0xf936('0x21')]=qs[_0xf936('0x21')](_0x59a3bf[_0xf936('0x2d')][_0xf936('0x21')]);_0x123475[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x59a3bf[_0xf936('0x2d')][_0xf936('0x1e')]);}return _0x3ea044[_0xf936('0x46')](_0x123475);}})[_0xf936('0x3b')](function(_0x4bc8fc){if(_0x4bc8fc){return _0x4bc8fc?{'count':_0xa44527,'rows':_0x4bc8fc}:null;}})['then'](respondWithResult(_0x1a5ea6,null))[_0xf936('0x41')](handleError(_0x1a5ea6,null));};exports[_0xf936('0x4c')]=function(_0x469913,_0x1a4ea9,_0x1ac590){var _0x5d7d22={};var _0x417c62={};var _0x45a2c8;var _0x22ad95;return db[_0xf936('0x29')][_0xf936('0x47')]({'where':{'id':_0x469913['params']['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x1a4ea9,null))[_0xf936('0x3b')](function(_0x4f3f17){if(_0x4f3f17){_0x45a2c8=_0x4f3f17;_0x417c62[_0xf936('0x31')]=_[_0xf936('0x2e')](db[_0xf936('0x48')][_0xf936('0x2a')]);_0x417c62[_0xf936('0x2d')]=_[_0xf936('0x2e')](_0x469913[_0xf936('0x2d')]);_0x417c62[_0xf936('0x2f')]=_[_0xf936('0x30')](_0x417c62[_0xf936('0x31')],_0x417c62[_0xf936('0x2d')]);_0x5d7d22[_0xf936('0x32')]=_[_0xf936('0x30')](_0x417c62[_0xf936('0x31')],qs['fields'](_0x469913[_0xf936('0x2d')][_0xf936('0x33')]));_0x5d7d22[_0xf936('0x32')]=_0x5d7d22[_0xf936('0x32')][_0xf936('0x49')]?_0x5d7d22[_0xf936('0x32')]:_0x417c62[_0xf936('0x31')];_0x5d7d22[_0xf936('0x34')]=qs[_0xf936('0x35')](_0x469913['query']['sort']);_0x5d7d22[_0xf936('0x38')]=qs[_0xf936('0x2f')](_[_0xf936('0x36')](_0x469913[_0xf936('0x2d')],_0x417c62[_0xf936('0x2f')]));if(_0x469913[_0xf936('0x2d')][_0xf936('0x37')]){_0x5d7d22['where']=_[_0xf936('0x39')](_0x5d7d22[_0xf936('0x38')],{'$or':_['map'](_0x5d7d22[_0xf936('0x32')],function(_0xe88c89){var _0x14ecc8={};_0x14ecc8[_0xe88c89]={'$like':'%'+_0x469913['query'][_0xf936('0x37')]+'%'};return _0x14ecc8;})});}_0x5d7d22=_['merge']({},_0x5d7d22,_0x469913[_0xf936('0x4a')]);return _0x45a2c8[_0xf936('0x4c')](_0x5d7d22);}})['then'](function(_0x169532){if(_0x169532){_0x22ad95=_0x169532['length'];if(!_0x469913[_0xf936('0x2d')][_0xf936('0x4b')]('nolimit')){_0x5d7d22['limit']=qs[_0xf936('0x21')](_0x469913['query']['limit']);_0x5d7d22[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x469913[_0xf936('0x2d')][_0xf936('0x1e')]);}return _0x45a2c8[_0xf936('0x4c')](_0x5d7d22);}})[_0xf936('0x3b')](function(_0x3cf925){if(_0x3cf925){return _0x3cf925?{'count':_0x22ad95,'rows':_0x3cf925}:null;}})[_0xf936('0x3b')](respondWithResult(_0x1a4ea9,null))[_0xf936('0x41')](handleError(_0x1a4ea9,null));};exports[_0xf936('0x4d')]=function(_0x24aa05,_0x3b6d09,_0x3f305b){var _0x3fbbad={};var _0x3c8e5e={};var _0xb6fdb5;var _0x5ebf12;return db['ZendeskConfiguration'][_0xf936('0x47')]({'where':{'id':_0x24aa05[_0xf936('0x3f')]['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x3b6d09,null))[_0xf936('0x3b')](function(_0x3e28e4){if(_0x3e28e4){_0xb6fdb5=_0x3e28e4;_0x3c8e5e[_0xf936('0x31')]=_['keys'](db[_0xf936('0x48')][_0xf936('0x2a')]);_0x3c8e5e[_0xf936('0x2d')]=_['keys'](_0x24aa05[_0xf936('0x2d')]);_0x3c8e5e['filters']=_[_0xf936('0x30')](_0x3c8e5e[_0xf936('0x31')],_0x3c8e5e[_0xf936('0x2d')]);_0x3fbbad[_0xf936('0x32')]=_[_0xf936('0x30')](_0x3c8e5e['model'],qs['fields'](_0x24aa05[_0xf936('0x2d')]['fields']));_0x3fbbad['attributes']=_0x3fbbad[_0xf936('0x32')][_0xf936('0x49')]?_0x3fbbad['attributes']:_0x3c8e5e['model'];_0x3fbbad['order']=qs['sort'](_0x24aa05[_0xf936('0x2d')][_0xf936('0x35')]);_0x3fbbad['where']=qs['filters'](_[_0xf936('0x36')](_0x24aa05['query'],_0x3c8e5e[_0xf936('0x2f')]));if(_0x24aa05[_0xf936('0x2d')]['filter']){_0x3fbbad[_0xf936('0x38')]=_[_0xf936('0x39')](_0x3fbbad[_0xf936('0x38')],{'$or':_[_0xf936('0x28')](_0x3fbbad[_0xf936('0x32')],function(_0x5a8b57){var _0x52f0fe={};_0x52f0fe[_0x5a8b57]={'$like':'%'+_0x24aa05[_0xf936('0x2d')]['filter']+'%'};return _0x52f0fe;})});}_0x3fbbad=_[_0xf936('0x39')]({},_0x3fbbad,_0x24aa05['options']);return _0xb6fdb5[_0xf936('0x4d')](_0x3fbbad);}})[_0xf936('0x3b')](function(_0x2b6839){if(_0x2b6839){_0x5ebf12=_0x2b6839[_0xf936('0x49')];if(!_0x24aa05[_0xf936('0x2d')]['hasOwnProperty'](_0xf936('0x4e'))){_0x3fbbad['limit']=qs[_0xf936('0x21')](_0x24aa05['query']['limit']);_0x3fbbad[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x24aa05[_0xf936('0x2d')][_0xf936('0x1e')]);}return _0xb6fdb5[_0xf936('0x4d')](_0x3fbbad);}})['then'](function(_0xb0bc84){if(_0xb0bc84){return _0xb0bc84?{'count':_0x5ebf12,'rows':_0xb0bc84}:null;}})['then'](respondWithResult(_0x3b6d09,null))[_0xf936('0x41')](handleError(_0x3b6d09,null));};exports['getTags']=function(_0x1fa53b,_0x4e8089,_0x339024){var _0xc3903={};var _0x17d71d={};var _0x543608;var _0x74954d;return db[_0xf936('0x29')][_0xf936('0x47')]({'where':{'id':_0x1fa53b[_0xf936('0x3f')]['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x4e8089,null))[_0xf936('0x3b')](function(_0x19f92b){if(_0x19f92b){_0x543608=_0x19f92b;_0x17d71d[_0xf936('0x31')]=_['keys'](db[_0xf936('0x4f')][_0xf936('0x2a')]);_0x17d71d[_0xf936('0x2d')]=_[_0xf936('0x2e')](_0x1fa53b[_0xf936('0x2d')]);_0x17d71d[_0xf936('0x2f')]=_[_0xf936('0x30')](_0x17d71d['model'],_0x17d71d['query']);_0xc3903[_0xf936('0x32')]=_[_0xf936('0x30')](_0x17d71d['model'],qs[_0xf936('0x33')](_0x1fa53b['query'][_0xf936('0x33')]));_0xc3903['attributes']=_0xc3903[_0xf936('0x32')][_0xf936('0x49')]?_0xc3903[_0xf936('0x32')]:_0x17d71d[_0xf936('0x31')];_0xc3903[_0xf936('0x34')]=qs[_0xf936('0x35')](_0x1fa53b['query'][_0xf936('0x35')]);_0xc3903[_0xf936('0x38')]=qs[_0xf936('0x2f')](_[_0xf936('0x36')](_0x1fa53b[_0xf936('0x2d')],_0x17d71d[_0xf936('0x2f')]));if(_0x1fa53b[_0xf936('0x2d')][_0xf936('0x37')]){_0xc3903['where']=_[_0xf936('0x39')](_0xc3903['where'],{'$or':_[_0xf936('0x28')](_0xc3903[_0xf936('0x32')],function(_0x49a82e){var _0x59462c={};_0x59462c[_0x49a82e]={'$like':'%'+_0x1fa53b[_0xf936('0x2d')][_0xf936('0x37')]+'%'};return _0x59462c;})});}_0xc3903=_[_0xf936('0x39')]({},_0xc3903,_0x1fa53b[_0xf936('0x4a')]);return _0x543608['getTags'](_0xc3903);}})[_0xf936('0x3b')](function(_0x14a5f4){if(_0x14a5f4){_0x74954d=_0x14a5f4[_0xf936('0x49')];if(!_0x1fa53b[_0xf936('0x2d')][_0xf936('0x4b')](_0xf936('0x4e'))){_0xc3903['limit']=qs[_0xf936('0x21')](_0x1fa53b[_0xf936('0x2d')]['limit']);_0xc3903[_0xf936('0x1e')]=qs[_0xf936('0x1e')](_0x1fa53b['query'][_0xf936('0x1e')]);}return _0x543608[_0xf936('0x50')](_0xc3903);}})[_0xf936('0x3b')](function(_0x31e7b1){if(_0x31e7b1){return _0x31e7b1?{'count':_0x74954d,'rows':_0x31e7b1}:null;}})[_0xf936('0x3b')](respondWithResult(_0x4e8089,null))[_0xf936('0x41')](handleError(_0x4e8089,null));};exports['setTags']=function(_0x409420,_0x88a2ff,_0xaac9d){if(_0x409420[_0xf936('0x43')]['id']){delete _0x409420[_0xf936('0x43')]['id'];}return db[_0xf936('0x29')][_0xf936('0x47')]({'where':{'id':_0x409420['params']['id']}})[_0xf936('0x3b')](handleEntityNotFound(_0x88a2ff,null))[_0xf936('0x3b')](function(_0x2c7cb3){if(_0x2c7cb3){return _0x2c7cb3[_0xf936('0x51')](_0x409420['body'][_0xf936('0x52')]||[]);}return null;})[_0xf936('0x3b')](respondWithResult(_0x88a2ff,null))[_0xf936('0x41')](handleError(_0x88a2ff,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 1ea4839..1022326 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x50a2af,_0x59a5d6){_0x50a2af=_0x50a2af-0x0;var _0x117282=_0xd7d1[_0x50a2af];return _0x117282;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae60=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x52d196,_0x449737){var _0x4db9dd=function(_0x358b31){while(--_0x358b31){_0x52d196['push'](_0x52d196['shift']());}};_0x4db9dd(++_0x449737);}(_0xae60,0x1c7));var _0x0ae6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xae60[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var logger=require(_0x0ae6('0x2'))('api');var moment=require(_0x0ae6('0x3'));var BPromise=require(_0x0ae6('0x4'));var rp=require(_0x0ae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x0ae6('0x8')]=function(_0x25ac7c,_0x30e000){return _0x25ac7c[_0x0ae6('0x9')](_0x0ae6('0xa'),attributes,{'tableName':_0x0ae6('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 7fd8af4..a414177 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 _0xd0e3=['client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x2813f4,_0x5c6254){var _0x1a1179=function(_0x399963){while(--_0x399963){_0x2813f4['push'](_0x2813f4['shift']());}};_0x1a1179(++_0x5c6254);}(_0xd0e3,0x182));var _0x3d0e=function(_0x196c38,_0x168322){_0x196c38=_0x196c38-0x0;var _0x3310db=_0xd0e3[_0x196c38];return _0x3310db;};'use strict';var _=require(_0x3d0e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d0e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d0e('0x2'));var config=require(_0x3d0e('0x3'));var jayson=require(_0x3d0e('0x4'));var client=jayson[_0x3d0e('0x5')][_0x3d0e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x309c52,_0x36a620,_0x2ef649){return new BPromise(function(_0x220095,_0x542cf4){return client[_0x3d0e('0x7')](_0x309c52,_0x2ef649)[_0x3d0e('0x8')](function(_0x5eb7b2){logger[_0x3d0e('0x9')](_0x3d0e('0xa'),_0x36a620,_0x3d0e('0xb'));logger['debug'](_0x3d0e('0xc'),_0x36a620,_0x3d0e('0xb'),JSON['stringify'](_0x5eb7b2));if(_0x5eb7b2[_0x3d0e('0xd')]){if(_0x5eb7b2['error']['code']===0x1f4){logger[_0x3d0e('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x36a620,_0x5eb7b2['error'][_0x3d0e('0xe')]);return _0x542cf4(_0x5eb7b2[_0x3d0e('0xd')][_0x3d0e('0xe')]);}logger[_0x3d0e('0xd')](_0x3d0e('0xa'),_0x36a620,_0x5eb7b2['error'][_0x3d0e('0xe')]);return _0x220095(_0x5eb7b2[_0x3d0e('0xd')][_0x3d0e('0xe')]);}else{logger[_0x3d0e('0x9')](_0x3d0e('0xa'),_0x36a620,_0x3d0e('0xb'));_0x220095(_0x5eb7b2[_0x3d0e('0xf')]['message']);}})[_0x3d0e('0x10')](function(_0x58d4aa){logger[_0x3d0e('0xd')](_0x3d0e('0xa'),_0x36a620,_0x58d4aa);_0x542cf4(_0x58d4aa);});});} \ No newline at end of file +var _0xca1c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xca1c,0xac));var _0xcca1=function(_0x587237,_0x6ac4be){_0x587237=_0x587237-0x0;var _0x592e69=_0xca1c[_0x587237];return _0x592e69;};'use strict';var _=require('lodash');var util=require(_0xcca1('0x0'));var moment=require(_0xcca1('0x1'));var BPromise=require(_0xcca1('0x2'));var rs=require(_0xcca1('0x3'));var fs=require('fs');var Redis=require(_0xcca1('0x4'));var db=require(_0xcca1('0x5'))['db'];var utils=require(_0xcca1('0x6'));var logger=require(_0xcca1('0x7'))(_0xcca1('0x8'));var config=require(_0xcca1('0x9'));var jayson=require(_0xcca1('0xa'));var client=jayson[_0xcca1('0xb')][_0xcca1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29e188,_0x591158,_0x13d573){return new BPromise(function(_0x536205,_0x548d8c){return client[_0xcca1('0xd')](_0x29e188,_0x13d573)[_0xcca1('0xe')](function(_0x1345ef){logger[_0xcca1('0xf')](_0xcca1('0x10'),_0x591158,'request\x20sent');logger[_0xcca1('0x11')](_0xcca1('0x12'),_0x591158,_0xcca1('0x13'),JSON['stringify'](_0x1345ef));if(_0x1345ef['error']){if(_0x1345ef[_0xcca1('0x14')][_0xcca1('0x15')]===0x1f4){logger[_0xcca1('0x14')](_0xcca1('0x10'),_0x591158,_0x1345ef[_0xcca1('0x14')][_0xcca1('0x16')]);return _0x548d8c(_0x1345ef[_0xcca1('0x14')][_0xcca1('0x16')]);}logger[_0xcca1('0x14')](_0xcca1('0x10'),_0x591158,_0x1345ef[_0xcca1('0x14')][_0xcca1('0x16')]);return _0x536205(_0x1345ef[_0xcca1('0x14')]['message']);}else{logger[_0xcca1('0xf')](_0xcca1('0x10'),_0x591158,_0xcca1('0x13'));_0x536205(_0x1345ef[_0xcca1('0x17')][_0xcca1('0x16')]);}})[_0xcca1('0x18')](function(_0x43d475){logger[_0xcca1('0x14')](_0xcca1('0x10'),_0x591158,_0x43d475);_0x548d8c(_0x43d475);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 30fb4c5..21c0460 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 _0xb014=['express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path'];(function(_0x5e980d,_0x316987){var _0x347477=function(_0x5566a8){while(--_0x5566a8){_0x5e980d['push'](_0x5e980d['shift']());}};_0x347477(++_0x316987);}(_0xb014,0x7b));var _0x4b01=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0xb014[_0x14e001];return _0x2c09da;};'use strict';var multer=require(_0x4b01('0x0'));var util=require(_0x4b01('0x1'));var path=require(_0x4b01('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b01('0x3'));var router=express['Router']();var fs_extra=require(_0x4b01('0x4'));var auth=require(_0x4b01('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b01('0x6'));var controller=require(_0x4b01('0x7'));router[_0x4b01('0x8')]('/',auth[_0x4b01('0x9')](),controller[_0x4b01('0xa')]);router[_0x4b01('0x8')](_0x4b01('0xb'),auth[_0x4b01('0x9')](),controller[_0x4b01('0xc')]);router['post']('/',auth[_0x4b01('0x9')](),controller[_0x4b01('0xd')]);router[_0x4b01('0xe')](_0x4b01('0xb'),auth[_0x4b01('0x9')](),controller[_0x4b01('0xf')]);router[_0x4b01('0x10')](_0x4b01('0xb'),auth[_0x4b01('0x9')](),controller['destroy']);module[_0x4b01('0x11')]=router; \ No newline at end of file +var _0x4d86=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','create','update','delete','multer'];(function(_0x550e6c,_0xc5b8e5){var _0x1c23e1=function(_0x1d35b4){while(--_0x1d35b4){_0x550e6c['push'](_0x550e6c['shift']());}};_0x1c23e1(++_0xc5b8e5);}(_0x4d86,0xa9));var _0x64d8=function(_0x5637a9,_0x5cb088){_0x5637a9=_0x5637a9-0x0;var _0x344268=_0x4d86[_0x5637a9];return _0x344268;};'use strict';var multer=require(_0x64d8('0x0'));var util=require(_0x64d8('0x1'));var path=require(_0x64d8('0x2'));var timeout=require(_0x64d8('0x3'));var express=require('express');var router=express[_0x64d8('0x4')]();var fs_extra=require(_0x64d8('0x5'));var auth=require(_0x64d8('0x6'));var interaction=require(_0x64d8('0x7'));var config=require(_0x64d8('0x8'));var controller=require(_0x64d8('0x9'));router[_0x64d8('0xa')]('/',auth[_0x64d8('0xb')](),controller['index']);router['get'](_0x64d8('0xc'),auth[_0x64d8('0xb')](),controller[_0x64d8('0xd')]);router['post']('/',auth[_0x64d8('0xb')](),controller[_0x64d8('0xe')]);router['put'](_0x64d8('0xc'),auth[_0x64d8('0xb')](),controller[_0x64d8('0xf')]);router[_0x64d8('0x10')](_0x64d8('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index cdf5007..58a37f9 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 _0xc1df=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x5401ae,_0x5e58ac){var _0x286068=function(_0x2cac88){while(--_0x2cac88){_0x5401ae['push'](_0x5401ae['shift']());}};_0x286068(++_0x5e58ac);}(_0xc1df,0x1de));var _0xfc1d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1df[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfc1d('0x0'));module[_0xfc1d('0x1')]={'type':{'type':Sequelize[_0xfc1d('0x2')]('string',_0xfc1d('0x3'),_0xfc1d('0x4'),_0xfc1d('0x5'),_0xfc1d('0x6')),'defaultValue':_0xfc1d('0x7')},'content':{'type':Sequelize[_0xfc1d('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfc1d('0x2')]('string',_0xfc1d('0x3'),_0xfc1d('0x4'))},'keyContent':{'type':Sequelize[_0xfc1d('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfc1d('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfc1d('0x8')]}}; \ No newline at end of file +var _0xd676=['STRING','string','variable','BOOLEAN','sequelize','ENUM','customVariable','keyValue','picklist'];(function(_0x5d65be,_0x38e67c){var _0x51f447=function(_0x31eb16){while(--_0x31eb16){_0x5d65be['push'](_0x5d65be['shift']());}};_0x51f447(++_0x38e67c);}(_0xd676,0x100));var _0x6d67=function(_0x4b2b7d,_0xc090b6){_0x4b2b7d=_0x4b2b7d-0x0;var _0x41b383=_0xd676[_0x4b2b7d];return _0x41b383;};'use strict';var Sequelize=require(_0x6d67('0x0'));module['exports']={'type':{'type':Sequelize[_0x6d67('0x1')]('string','variable',_0x6d67('0x2'),_0x6d67('0x3'),_0x6d67('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6d67('0x5')]},'key':{'type':Sequelize[_0x6d67('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x6d67('0x6'),_0x6d67('0x7'),_0x6d67('0x2'))},'keyContent':{'type':Sequelize[_0x6d67('0x5')]},'idField':{'type':Sequelize[_0x6d67('0x5')]},'nameField':{'type':Sequelize[_0x6d67('0x5')]},'customField':{'type':Sequelize[_0x6d67('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d67('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 41f2d58..1b52b4d 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 _0x245e=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','name','send','index','ZendeskField','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0x245e,0x11d));var _0xe245=function(_0x468ca8,_0x4f2cef){_0x468ca8=_0x468ca8-0x0;var _0x56991d=_0x245e[_0x468ca8];return _0x56991d;};'use strict';var emlformat=require(_0xe245('0x0'));var rimraf=require(_0xe245('0x1'));var zipdir=require(_0xe245('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe245('0x3'));var moment=require(_0xe245('0x4'));var BPromise=require(_0xe245('0x5'));var Mustache=require(_0xe245('0x6'));var util=require('util');var path=require(_0xe245('0x7'));var sox=require(_0xe245('0x8'));var csv=require('to-csv');var ejs=require(_0xe245('0x9'));var fs=require('fs');var fs_extra=require(_0xe245('0xa'));var _=require(_0xe245('0xb'));var squel=require(_0xe245('0xc'));var crypto=require(_0xe245('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe245('0xe'));var toCsv=require(_0xe245('0xf'));var querystring=require(_0xe245('0x10'));var Papa=require('papaparse');var Redis=require(_0xe245('0x11'));var authService=require(_0xe245('0x12'));var qs=require(_0xe245('0x13'));var as=require(_0xe245('0x14'));var hardwareService=require(_0xe245('0x15'));var logger=require(_0xe245('0x16'))(_0xe245('0x17'));var utils=require('../../config/utils');var config=require(_0xe245('0x18'));var licenseUtil=require(_0xe245('0x19'));var db=require(_0xe245('0x1a'))['db'];function respondWithStatusCode(_0x376f2c,_0x42e6fb){_0x42e6fb=_0x42e6fb||0xcc;return function(_0x4d4b28){if(_0x4d4b28){return _0x376f2c[_0xe245('0x1b')](_0x42e6fb);}return _0x376f2c[_0xe245('0x1c')](_0x42e6fb)[_0xe245('0x1d')]();};}function respondWithResult(_0x358035,_0x5b2737){_0x5b2737=_0x5b2737||0xc8;return function(_0x30978b){if(_0x30978b){return _0x358035['status'](_0x5b2737)['json'](_0x30978b);}};}function respondWithFilteredResult(_0x2bc605,_0xe34891){return function(_0x3f5165){if(_0x3f5165){var _0x2c7094=typeof _0xe34891['offset']===_0xe245('0x1e')&&typeof _0xe34891[_0xe245('0x1f')]==='undefined';var _0x356546=_0x3f5165[_0xe245('0x20')];var _0xa9a2eb=_0x2c7094?0x0:_0xe34891[_0xe245('0x21')];var _0x27bb2e=_0x2c7094?_0x3f5165[_0xe245('0x20')]:_0xe34891[_0xe245('0x21')]+_0xe34891[_0xe245('0x1f')];var _0x438803;if(_0x27bb2e>=_0x356546){_0x27bb2e=_0x356546;_0x438803=0xc8;}else{_0x438803=0xce;}_0x2bc605[_0xe245('0x1c')](_0x438803);return _0x2bc605['set'](_0xe245('0x22'),_0xa9a2eb+'-'+_0x27bb2e+'/'+_0x356546)['json'](_0x3f5165);}return null;};}function patchUpdates(_0x5d5ae7){return function(_0x2ec2d0){try{jsonpatch[_0xe245('0x23')](_0x2ec2d0,_0x5d5ae7,!![]);}catch(_0x5526ab){return BPromise[_0xe245('0x24')](_0x5526ab);}return _0x2ec2d0[_0xe245('0x25')]();};}function saveUpdates(_0x52d50a,_0x3dc6e4){return function(_0x35059a){if(_0x35059a){return _0x35059a[_0xe245('0x26')](_0x52d50a)[_0xe245('0x27')](function(_0x3a0647){return _0x3a0647;});}return null;};}function removeEntity(_0x18373d,_0x44044b){return function(_0x100b71){if(_0x100b71){return _0x100b71['destroy']()[_0xe245('0x27')](function(){_0x18373d[_0xe245('0x1c')](0xcc)[_0xe245('0x1d')]();});}};}function handleEntityNotFound(_0x30657b,_0x301a7f){return function(_0x97680d){if(!_0x97680d){_0x30657b[_0xe245('0x1b')](0x194);}return _0x97680d;};}function handleError(_0x4f2c39,_0x4cf0f7){_0x4cf0f7=_0x4cf0f7||0x1f4;return function(_0x2b3f44){logger[_0xe245('0x28')](_0x2b3f44['stack']);if(_0x2b3f44[_0xe245('0x29')]){delete _0x2b3f44[_0xe245('0x29')];}_0x4f2c39[_0xe245('0x1c')](_0x4cf0f7)[_0xe245('0x2a')](_0x2b3f44);};}exports[_0xe245('0x2b')]=function(_0x516a13,_0x374ac0){var _0x5b5640={},_0xe27dab={},_0x375ec6={'count':0x0,'rows':[]};var _0x1451dd=_['map'](db[_0xe245('0x2c')][_0xe245('0x2d')],function(_0x16184a){return{'name':_0x16184a[_0xe245('0x2e')],'type':_0x16184a['type']['key']};});_0xe27dab[_0xe245('0x2f')]=_[_0xe245('0x30')](_0x1451dd,'name');_0xe27dab[_0xe245('0x31')]=_['keys'](_0x516a13[_0xe245('0x31')]);_0xe27dab[_0xe245('0x32')]=_[_0xe245('0x33')](_0xe27dab[_0xe245('0x2f')],_0xe27dab['query']);_0x5b5640['attributes']=_['intersection'](_0xe27dab[_0xe245('0x2f')],qs[_0xe245('0x34')](_0x516a13[_0xe245('0x31')][_0xe245('0x34')]));_0x5b5640['attributes']=_0x5b5640[_0xe245('0x35')]['length']?_0x5b5640[_0xe245('0x35')]:_0xe27dab[_0xe245('0x2f')];if(!_0x516a13[_0xe245('0x31')][_0xe245('0x36')](_0xe245('0x37'))){_0x5b5640[_0xe245('0x1f')]=qs['limit'](_0x516a13['query'][_0xe245('0x1f')]);_0x5b5640[_0xe245('0x21')]=qs[_0xe245('0x21')](_0x516a13[_0xe245('0x31')][_0xe245('0x21')]);}_0x5b5640['order']=qs[_0xe245('0x38')](_0x516a13[_0xe245('0x31')]['sort']);_0x5b5640[_0xe245('0x39')]=qs['filters'](_[_0xe245('0x3a')](_0x516a13[_0xe245('0x31')],_0xe27dab[_0xe245('0x32')]),_0x1451dd);if(_0x516a13['query'][_0xe245('0x3b')]){_0x5b5640['where']=_['merge'](_0x5b5640[_0xe245('0x39')],{'$or':_[_0xe245('0x30')](_0x1451dd,function(_0x32d4c3){if(_0x32d4c3['type']!==_0xe245('0x3c')){var _0x1c6300={};_0x1c6300[_0x32d4c3[_0xe245('0x29')]]={'$like':'%'+_0x516a13['query'][_0xe245('0x3b')]+'%'};return _0x1c6300;}})});}_0x5b5640=_[_0xe245('0x3d')]({},_0x5b5640,_0x516a13[_0xe245('0x3e')]);var _0x4eca39={'where':_0x5b5640[_0xe245('0x39')]};return db['ZendeskField'][_0xe245('0x20')](_0x4eca39)[_0xe245('0x27')](function(_0x428ff3){_0x375ec6[_0xe245('0x20')]=_0x428ff3;if(_0x516a13[_0xe245('0x31')][_0xe245('0x3f')]){_0x5b5640['include']=[{'all':!![]}];}return db[_0xe245('0x2c')][_0xe245('0x40')](_0x5b5640);})[_0xe245('0x27')](function(_0x35761d){_0x375ec6[_0xe245('0x41')]=_0x35761d;return _0x375ec6;})[_0xe245('0x27')](respondWithFilteredResult(_0x374ac0,_0x5b5640))[_0xe245('0x42')](handleError(_0x374ac0,null));};exports['show']=function(_0x402ec0,_0xdf67c4){var _0x5d0a63={'raw':!![],'where':{'id':_0x402ec0[_0xe245('0x43')]['id']}},_0x24cf0e={};_0x24cf0e[_0xe245('0x2f')]=_[_0xe245('0x44')](db[_0xe245('0x2c')][_0xe245('0x2d')]);_0x24cf0e[_0xe245('0x31')]=_[_0xe245('0x44')](_0x402ec0[_0xe245('0x31')]);_0x24cf0e[_0xe245('0x32')]=_[_0xe245('0x33')](_0x24cf0e[_0xe245('0x2f')],_0x24cf0e[_0xe245('0x31')]);_0x5d0a63[_0xe245('0x35')]=_[_0xe245('0x33')](_0x24cf0e[_0xe245('0x2f')],qs[_0xe245('0x34')](_0x402ec0[_0xe245('0x31')][_0xe245('0x34')]));_0x5d0a63[_0xe245('0x35')]=_0x5d0a63[_0xe245('0x35')][_0xe245('0x45')]?_0x5d0a63[_0xe245('0x35')]:_0x24cf0e[_0xe245('0x2f')];if(_0x402ec0[_0xe245('0x31')][_0xe245('0x3f')]){_0x5d0a63[_0xe245('0x46')]=[{'all':!![]}];}_0x5d0a63=_[_0xe245('0x3d')]({},_0x5d0a63,_0x402ec0[_0xe245('0x3e')]);return db[_0xe245('0x2c')][_0xe245('0x47')](_0x5d0a63)['then'](handleEntityNotFound(_0xdf67c4,null))[_0xe245('0x27')](respondWithResult(_0xdf67c4,null))[_0xe245('0x42')](handleError(_0xdf67c4,null));};exports['create']=function(_0x2660a2,_0x2c7b45){return db['ZendeskField'][_0xe245('0x48')](_0x2660a2['body'],{})['then'](respondWithResult(_0x2c7b45,0xc9))[_0xe245('0x42')](handleError(_0x2c7b45,null));};exports[_0xe245('0x26')]=function(_0x41feaf,_0x228d91){if(_0x41feaf[_0xe245('0x49')]['id']){delete _0x41feaf[_0xe245('0x49')]['id'];}return db[_0xe245('0x2c')]['find']({'where':{'id':_0x41feaf['params']['id']}})[_0xe245('0x27')](handleEntityNotFound(_0x228d91,null))[_0xe245('0x27')](saveUpdates(_0x41feaf[_0xe245('0x49')],null))[_0xe245('0x27')](respondWithResult(_0x228d91,null))[_0xe245('0x42')](handleError(_0x228d91,null));};exports[_0xe245('0x4a')]=function(_0xf7def8,_0x2364b7){return db['ZendeskField'][_0xe245('0x47')]({'where':{'id':_0xf7def8[_0xe245('0x43')]['id']}})[_0xe245('0x27')](handleEntityNotFound(_0x2364b7,null))[_0xe245('0x27')](removeEntity(_0x2364b7,null))[_0xe245('0x42')](handleError(_0x2364b7,null));}; \ No newline at end of file +var _0x3b41=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','stack','name','send','index','ZendeskField','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','show','params','includeAll','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3b41,0x78));var _0x13b4=function(_0x398a75,_0x199132){_0x398a75=_0x398a75-0x0;var _0x5e4aa1=_0x3b41[_0x398a75];return _0x5e4aa1;};'use strict';var emlformat=require(_0x13b4('0x0'));var rimraf=require(_0x13b4('0x1'));var zipdir=require(_0x13b4('0x2'));var jsonpatch=require(_0x13b4('0x3'));var rp=require('request-promise');var moment=require(_0x13b4('0x4'));var BPromise=require(_0x13b4('0x5'));var Mustache=require('mustache');var util=require(_0x13b4('0x6'));var path=require('path');var sox=require(_0x13b4('0x7'));var csv=require(_0x13b4('0x8'));var ejs=require(_0x13b4('0x9'));var fs=require('fs');var fs_extra=require(_0x13b4('0xa'));var _=require(_0x13b4('0xb'));var squel=require(_0x13b4('0xc'));var crypto=require(_0x13b4('0xd'));var jsforce=require(_0x13b4('0xe'));var deskjs=require(_0x13b4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x13b4('0x10'));var Papa=require('papaparse');var Redis=require(_0x13b4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x13b4('0x12'));var as=require(_0x13b4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x13b4('0x14'));var utils=require(_0x13b4('0x15'));var config=require(_0x13b4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x13b4('0x17'))['db'];function respondWithStatusCode(_0x407678,_0x1fec97){_0x1fec97=_0x1fec97||0xcc;return function(_0x4fca3d){if(_0x4fca3d){return _0x407678[_0x13b4('0x18')](_0x1fec97);}return _0x407678[_0x13b4('0x19')](_0x1fec97)[_0x13b4('0x1a')]();};}function respondWithResult(_0x4abe53,_0x52ce0b){_0x52ce0b=_0x52ce0b||0xc8;return function(_0x113e59){if(_0x113e59){return _0x4abe53[_0x13b4('0x19')](_0x52ce0b)[_0x13b4('0x1b')](_0x113e59);}};}function respondWithFilteredResult(_0x4dbcc8,_0x5d6160){return function(_0xdd8ab8){if(_0xdd8ab8){var _0x720591=typeof _0x5d6160[_0x13b4('0x1c')]===_0x13b4('0x1d')&&typeof _0x5d6160[_0x13b4('0x1e')]==='undefined';var _0x3c4b0f=_0xdd8ab8[_0x13b4('0x1f')];var _0x494eb0=_0x720591?0x0:_0x5d6160['offset'];var _0x20b173=_0x720591?_0xdd8ab8[_0x13b4('0x1f')]:_0x5d6160[_0x13b4('0x1c')]+_0x5d6160[_0x13b4('0x1e')];var _0xacdf88;if(_0x20b173>=_0x3c4b0f){_0x20b173=_0x3c4b0f;_0xacdf88=0xc8;}else{_0xacdf88=0xce;}_0x4dbcc8['status'](_0xacdf88);return _0x4dbcc8['set'](_0x13b4('0x20'),_0x494eb0+'-'+_0x20b173+'/'+_0x3c4b0f)[_0x13b4('0x1b')](_0xdd8ab8);}return null;};}function patchUpdates(_0x26039d){return function(_0x1521cb){try{jsonpatch[_0x13b4('0x21')](_0x1521cb,_0x26039d,!![]);}catch(_0x2bac30){return BPromise[_0x13b4('0x22')](_0x2bac30);}return _0x1521cb[_0x13b4('0x23')]();};}function saveUpdates(_0x234534,_0x38f607){return function(_0x29c528){if(_0x29c528){return _0x29c528['update'](_0x234534)[_0x13b4('0x24')](function(_0x2c2183){return _0x2c2183;});}return null;};}function removeEntity(_0x2decc3,_0x229037){return function(_0x459203){if(_0x459203){return _0x459203['destroy']()[_0x13b4('0x24')](function(){_0x2decc3[_0x13b4('0x19')](0xcc)[_0x13b4('0x1a')]();});}};}function handleEntityNotFound(_0x41be88,_0x4ff870){return function(_0x41c923){if(!_0x41c923){_0x41be88[_0x13b4('0x18')](0x194);}return _0x41c923;};}function handleError(_0x473896,_0x21a333){_0x21a333=_0x21a333||0x1f4;return function(_0x10620f){logger['error'](_0x10620f[_0x13b4('0x25')]);if(_0x10620f[_0x13b4('0x26')]){delete _0x10620f[_0x13b4('0x26')];}_0x473896[_0x13b4('0x19')](_0x21a333)[_0x13b4('0x27')](_0x10620f);};}exports[_0x13b4('0x28')]=function(_0x22f231,_0x1b2cf2){var _0x501bc8={},_0x3b4aae={},_0x4ebf9b={'count':0x0,'rows':[]};var _0x5de124=_['map'](db[_0x13b4('0x29')][_0x13b4('0x2a')],function(_0x314f58){return{'name':_0x314f58['fieldName'],'type':_0x314f58[_0x13b4('0x2b')]['key']};});_0x3b4aae[_0x13b4('0x2c')]=_[_0x13b4('0x2d')](_0x5de124,'name');_0x3b4aae[_0x13b4('0x2e')]=_[_0x13b4('0x2f')](_0x22f231['query']);_0x3b4aae[_0x13b4('0x30')]=_['intersection'](_0x3b4aae[_0x13b4('0x2c')],_0x3b4aae[_0x13b4('0x2e')]);_0x501bc8[_0x13b4('0x31')]=_[_0x13b4('0x32')](_0x3b4aae['model'],qs['fields'](_0x22f231['query'][_0x13b4('0x33')]));_0x501bc8[_0x13b4('0x31')]=_0x501bc8[_0x13b4('0x31')]['length']?_0x501bc8[_0x13b4('0x31')]:_0x3b4aae[_0x13b4('0x2c')];if(!_0x22f231[_0x13b4('0x2e')][_0x13b4('0x34')](_0x13b4('0x35'))){_0x501bc8[_0x13b4('0x1e')]=qs[_0x13b4('0x1e')](_0x22f231[_0x13b4('0x2e')][_0x13b4('0x1e')]);_0x501bc8[_0x13b4('0x1c')]=qs[_0x13b4('0x1c')](_0x22f231['query'][_0x13b4('0x1c')]);}_0x501bc8[_0x13b4('0x36')]=qs['sort'](_0x22f231[_0x13b4('0x2e')][_0x13b4('0x37')]);_0x501bc8['where']=qs['filters'](_['pick'](_0x22f231['query'],_0x3b4aae[_0x13b4('0x30')]),_0x5de124);if(_0x22f231[_0x13b4('0x2e')]['filter']){_0x501bc8[_0x13b4('0x38')]=_[_0x13b4('0x39')](_0x501bc8['where'],{'$or':_[_0x13b4('0x2d')](_0x5de124,function(_0x2be7f8){if(_0x2be7f8[_0x13b4('0x2b')]!=='VIRTUAL'){var _0x158a2e={};_0x158a2e[_0x2be7f8['name']]={'$like':'%'+_0x22f231[_0x13b4('0x2e')][_0x13b4('0x3a')]+'%'};return _0x158a2e;}})});}_0x501bc8=_[_0x13b4('0x39')]({},_0x501bc8,_0x22f231[_0x13b4('0x3b')]);var _0x590de4={'where':_0x501bc8[_0x13b4('0x38')]};return db['ZendeskField'][_0x13b4('0x1f')](_0x590de4)['then'](function(_0x3eea62){_0x4ebf9b['count']=_0x3eea62;if(_0x22f231[_0x13b4('0x2e')]['includeAll']){_0x501bc8[_0x13b4('0x3c')]=[{'all':!![]}];}return db[_0x13b4('0x29')][_0x13b4('0x3d')](_0x501bc8);})[_0x13b4('0x24')](function(_0x2c21a8){_0x4ebf9b['rows']=_0x2c21a8;return _0x4ebf9b;})[_0x13b4('0x24')](respondWithFilteredResult(_0x1b2cf2,_0x501bc8))['catch'](handleError(_0x1b2cf2,null));};exports[_0x13b4('0x3e')]=function(_0x4e4c89,_0x7d30a3){var _0x212726={'raw':!![],'where':{'id':_0x4e4c89[_0x13b4('0x3f')]['id']}},_0x41d12a={};_0x41d12a[_0x13b4('0x2c')]=_['keys'](db['ZendeskField'][_0x13b4('0x2a')]);_0x41d12a[_0x13b4('0x2e')]=_['keys'](_0x4e4c89['query']);_0x41d12a[_0x13b4('0x30')]=_[_0x13b4('0x32')](_0x41d12a[_0x13b4('0x2c')],_0x41d12a[_0x13b4('0x2e')]);_0x212726[_0x13b4('0x31')]=_[_0x13b4('0x32')](_0x41d12a[_0x13b4('0x2c')],qs[_0x13b4('0x33')](_0x4e4c89['query'][_0x13b4('0x33')]));_0x212726['attributes']=_0x212726[_0x13b4('0x31')]['length']?_0x212726[_0x13b4('0x31')]:_0x41d12a['model'];if(_0x4e4c89[_0x13b4('0x2e')][_0x13b4('0x40')]){_0x212726[_0x13b4('0x3c')]=[{'all':!![]}];}_0x212726=_['merge']({},_0x212726,_0x4e4c89['options']);return db[_0x13b4('0x29')]['find'](_0x212726)[_0x13b4('0x24')](handleEntityNotFound(_0x7d30a3,null))[_0x13b4('0x24')](respondWithResult(_0x7d30a3,null))[_0x13b4('0x41')](handleError(_0x7d30a3,null));};exports[_0x13b4('0x42')]=function(_0x5ef558,_0x5286b5){return db[_0x13b4('0x29')][_0x13b4('0x42')](_0x5ef558[_0x13b4('0x43')],{})[_0x13b4('0x24')](respondWithResult(_0x5286b5,0xc9))[_0x13b4('0x41')](handleError(_0x5286b5,null));};exports[_0x13b4('0x44')]=function(_0x57da2d,_0x4e245d){if(_0x57da2d[_0x13b4('0x43')]['id']){delete _0x57da2d[_0x13b4('0x43')]['id'];}return db[_0x13b4('0x29')]['find']({'where':{'id':_0x57da2d[_0x13b4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4e245d,null))[_0x13b4('0x24')](saveUpdates(_0x57da2d[_0x13b4('0x43')],null))[_0x13b4('0x24')](respondWithResult(_0x4e245d,null))['catch'](handleError(_0x4e245d,null));};exports['destroy']=function(_0x3358c4,_0x1f63a0){return db[_0x13b4('0x29')][_0x13b4('0x45')]({'where':{'id':_0x3358c4[_0x13b4('0x3f')]['id']}})[_0x13b4('0x24')](handleEntityNotFound(_0x1f63a0,null))[_0x13b4('0x24')](removeEntity(_0x1f63a0,null))[_0x13b4('0x41')](handleError(_0x1f63a0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 21dce0d..931d36f 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 _0xc6fd=['FieldId','util','../../config/logger','api','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0xc6fd,0x146));var _0xdc6f=function(_0x3ce487,_0x2c0ccd){_0x3ce487=_0x3ce487-0x0;var _0x107e69=_0xc6fd[_0x3ce487];return _0x107e69;};'use strict';var _=require('lodash');var util=require(_0xdc6f('0x0'));var logger=require(_0xdc6f('0x1'))(_0xdc6f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdc6f('0x3'));var fs=require('fs');var path=require(_0xdc6f('0x4'));var rimraf=require(_0xdc6f('0x5'));var config=require('../../config/environment');var attributes=require(_0xdc6f('0x6'));module[_0xdc6f('0x7')]=function(_0x3c63a5,_0x599898){return _0x3c63a5[_0xdc6f('0x8')](_0xdc6f('0x9'),attributes,{'tableName':_0xdc6f('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xdc6f('0xb'),_0xdc6f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0514=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x4f199e,_0x21cd82){var _0xa8ce2=function(_0x57e093){while(--_0x57e093){_0x4f199e['push'](_0x4f199e['shift']());}};_0xa8ce2(++_0x21cd82);}(_0x0514,0x12d));var _0x4051=function(_0x2e2465,_0x132d5e){_0x2e2465=_0x2e2465-0x0;var _0x4a8cd8=_0x0514[_0x2e2465];return _0x4a8cd8;};'use strict';var _=require('lodash');var util=require(_0x4051('0x0'));var logger=require(_0x4051('0x1'))(_0x4051('0x2'));var moment=require(_0x4051('0x3'));var BPromise=require(_0x4051('0x4'));var rp=require(_0x4051('0x5'));var fs=require('fs');var path=require(_0x4051('0x6'));var rimraf=require(_0x4051('0x7'));var config=require(_0x4051('0x8'));var attributes=require(_0x4051('0x9'));module[_0x4051('0xa')]=function(_0x5d334,_0x2db199){return _0x5d334[_0x4051('0xb')]('ZendeskField',attributes,{'tableName':_0x4051('0xc'),'paranoid':![],'indexes':[{'name':_0x4051('0xd'),'fields':[_0x4051('0xe'),_0x4051('0xf')],'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 3a0b272..bca0a54 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 _0x5af5=['error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa866ce,_0x4fdd52){var _0x10e635=function(_0x398c4d){while(--_0x398c4d){_0xa866ce['push'](_0xa866ce['shift']());}};_0x10e635(++_0x4fdd52);}(_0x5af5,0x186));var _0x55af=function(_0x2f839d,_0x5483a7){_0x2f839d=_0x2f839d-0x0;var _0x2356d6=_0x5af5[_0x2f839d];return _0x2356d6;};'use strict';var _=require(_0x55af('0x0'));var util=require(_0x55af('0x1'));var moment=require('moment');var BPromise=require(_0x55af('0x2'));var rs=require(_0x55af('0x3'));var fs=require('fs');var Redis=require(_0x55af('0x4'));var db=require(_0x55af('0x5'))['db'];var utils=require(_0x55af('0x6'));var logger=require(_0x55af('0x7'))(_0x55af('0x8'));var config=require(_0x55af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x55af('0xa')][_0x55af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bbb13,_0x24fb91,_0x2bcb2a){return new BPromise(function(_0x477189,_0x22baec){return client['request'](_0x2bbb13,_0x2bcb2a)[_0x55af('0xc')](function(_0x4b3389){logger['info'](_0x55af('0xd'),_0x24fb91,_0x55af('0xe'));logger[_0x55af('0xf')](_0x55af('0x10'),_0x24fb91,_0x55af('0xe'),JSON[_0x55af('0x11')](_0x4b3389));if(_0x4b3389['error']){if(_0x4b3389[_0x55af('0x12')][_0x55af('0x13')]===0x1f4){logger['error'](_0x55af('0xd'),_0x24fb91,_0x4b3389[_0x55af('0x12')][_0x55af('0x14')]);return _0x22baec(_0x4b3389[_0x55af('0x12')][_0x55af('0x14')]);}logger['error'](_0x55af('0xd'),_0x24fb91,_0x4b3389[_0x55af('0x12')][_0x55af('0x14')]);return _0x477189(_0x4b3389[_0x55af('0x12')][_0x55af('0x14')]);}else{logger[_0x55af('0x15')](_0x55af('0xd'),_0x24fb91,_0x55af('0xe'));_0x477189(_0x4b3389[_0x55af('0x16')]['message']);}})[_0x55af('0x17')](function(_0x5048e2){logger['error'](_0x55af('0xd'),_0x24fb91,_0x5048e2);_0x22baec(_0x5048e2);});});} \ No newline at end of file +var _0x2edb=['message','info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2edb,0x1a8));var _0xb2ed=function(_0x12b93f,_0x599896){_0x12b93f=_0x12b93f-0x0;var _0x175640=_0x2edb[_0x12b93f];return _0x175640;};'use strict';var _=require('lodash');var util=require(_0xb2ed('0x0'));var moment=require('moment');var BPromise=require(_0xb2ed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2ed('0x2'));var db=require(_0xb2ed('0x3'))['db'];var utils=require(_0xb2ed('0x4'));var logger=require(_0xb2ed('0x5'))('rpc');var config=require(_0xb2ed('0x6'));var jayson=require(_0xb2ed('0x7'));var client=jayson[_0xb2ed('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f333a,_0x14a516,_0x499579){return new BPromise(function(_0x557f01,_0x5e5d1c){return client[_0xb2ed('0x9')](_0x2f333a,_0x499579)[_0xb2ed('0xa')](function(_0x4370b3){logger['info'](_0xb2ed('0xb'),_0x14a516,'request\x20sent');logger['debug'](_0xb2ed('0xc'),_0x14a516,_0xb2ed('0xd'),JSON[_0xb2ed('0xe')](_0x4370b3));if(_0x4370b3['error']){if(_0x4370b3[_0xb2ed('0xf')][_0xb2ed('0x10')]===0x1f4){logger[_0xb2ed('0xf')](_0xb2ed('0xb'),_0x14a516,_0x4370b3['error'][_0xb2ed('0x11')]);return _0x5e5d1c(_0x4370b3[_0xb2ed('0xf')][_0xb2ed('0x11')]);}logger[_0xb2ed('0xf')](_0xb2ed('0xb'),_0x14a516,_0x4370b3[_0xb2ed('0xf')][_0xb2ed('0x11')]);return _0x557f01(_0x4370b3[_0xb2ed('0xf')]['message']);}else{logger[_0xb2ed('0x12')](_0xb2ed('0xb'),_0x14a516,_0xb2ed('0xd'));_0x557f01(_0x4370b3[_0xb2ed('0x13')][_0xb2ed('0x11')]);}})[_0xb2ed('0x14')](function(_0x23e49f){logger[_0xb2ed('0xf')](_0xb2ed('0xb'),_0x14a516,_0x23e49f);_0x5e5d1c(_0x23e49f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 42536af..c76940c 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 _0xa25d=['create','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','get','/:id/fields','post'];(function(_0x4cb01c,_0x308644){var _0x46511b=function(_0x3a98aa){while(--_0x3a98aa){_0x4cb01c['push'](_0x4cb01c['shift']());}};_0x46511b(++_0x308644);}(_0xa25d,0x1a4));var _0xda25=function(_0x571c00,_0x3ae028){_0x571c00=_0x571c00-0x0;var _0x2887df=_0xa25d[_0x571c00];return _0x2887df;};'use strict';var multer=require('multer');var util=require(_0xda25('0x0'));var path=require(_0xda25('0x1'));var timeout=require(_0xda25('0x2'));var express=require(_0xda25('0x3'));var router=express[_0xda25('0x4')]();var fs_extra=require(_0xda25('0x5'));var auth=require(_0xda25('0x6'));var interaction=require(_0xda25('0x7'));var config=require('../../config/environment');var controller=require(_0xda25('0x8'));router['get']('/',auth[_0xda25('0x9')](),controller[_0xda25('0xa')]);router['get'](_0xda25('0xb'),auth[_0xda25('0x9')](),controller['show']);router['get'](_0xda25('0xc'),auth['isAuthenticated'](),controller[_0xda25('0xd')]);router[_0xda25('0xe')](_0xda25('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xda25('0x10')]('/',auth[_0xda25('0x9')](),controller[_0xda25('0x11')]);router[_0xda25('0x10')]('/:id/configurations',auth[_0xda25('0x9')](),controller[_0xda25('0x12')]);router[_0xda25('0x13')](_0xda25('0xb'),auth[_0xda25('0x9')](),controller[_0xda25('0x14')]);router[_0xda25('0x15')]('/:id',auth[_0xda25('0x9')](),controller['destroy']);module[_0xda25('0x16')]=router; \ No newline at end of file +var _0xdd2d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','util','connect-timeout'];(function(_0x3eed4b,_0x558eca){var _0x12eba0=function(_0x5d35f1){while(--_0x5d35f1){_0x3eed4b['push'](_0x3eed4b['shift']());}};_0x12eba0(++_0x558eca);}(_0xdd2d,0xae));var _0xddd2=function(_0x1631cf,_0x22d27b){_0x1631cf=_0x1631cf-0x0;var _0x3843c1=_0xdd2d[_0x1631cf];return _0x3843c1;};'use strict';var multer=require('multer');var util=require(_0xddd2('0x0'));var path=require('path');var timeout=require(_0xddd2('0x1'));var express=require(_0xddd2('0x2'));var router=express[_0xddd2('0x3')]();var fs_extra=require(_0xddd2('0x4'));var auth=require(_0xddd2('0x5'));var interaction=require(_0xddd2('0x6'));var config=require('../../config/environment');var controller=require(_0xddd2('0x7'));router[_0xddd2('0x8')]('/',auth[_0xddd2('0x9')](),controller[_0xddd2('0xa')]);router[_0xddd2('0x8')](_0xddd2('0xb'),auth[_0xddd2('0x9')](),controller[_0xddd2('0xc')]);router[_0xddd2('0x8')](_0xddd2('0xd'),auth[_0xddd2('0x9')](),controller['getConfigurations']);router[_0xddd2('0x8')](_0xddd2('0xe'),auth[_0xddd2('0x9')](),controller[_0xddd2('0xf')]);router[_0xddd2('0x10')]('/',auth[_0xddd2('0x9')](),controller[_0xddd2('0x11')]);router[_0xddd2('0x10')](_0xddd2('0xd'),auth['isAuthenticated'](),controller[_0xddd2('0x12')]);router[_0xddd2('0x13')](_0xddd2('0xb'),auth[_0xddd2('0x9')](),controller['update']);router['delete'](_0xddd2('0xb'),auth['isAuthenticated'](),controller[_0xddd2('0x14')]);module[_0xddd2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 6775be2..da5667c 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 _0x6c76=['STRING','sequelize','exports'];(function(_0x4842ce,_0x1ee4b2){var _0x27896b=function(_0x503e72){while(--_0x503e72){_0x4842ce['push'](_0x4842ce['shift']());}};_0x27896b(++_0x1ee4b2);}(_0x6c76,0x184));var _0x66c7=function(_0x57fda8,_0x5e80a0){_0x57fda8=_0x57fda8-0x0;var _0x11c895=_0x6c76[_0x57fda8];return _0x11c895;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'name':{'type':Sequelize[_0x66c7('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x66c7('0x2')]},'zone':{'type':Sequelize[_0x66c7('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x66c7('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x66c7('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf109=['exports','STRING','sequelize'];(function(_0x2aedbb,_0x47ef2e){var _0x7fc5cd=function(_0x517b42){while(--_0x517b42){_0x2aedbb['push'](_0x2aedbb['shift']());}};_0x7fc5cd(++_0x47ef2e);}(_0xf109,0xce));var _0x9f10=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xf109[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f10('0x2')]},'clientSecret':{'type':Sequelize[_0x9f10('0x2')]},'serverUrl':{'type':Sequelize[_0x9f10('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x9f10('0x2')]},'refreshToken':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 3bc003c..c78ead1 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 _0xca8e=['offset','set','json','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','options','ZohoAccount','include','rows','catch','show','includeAll','find','create','body','params','findOne','ZohoConfiguration','pick','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','getFields','host','clientSecret','code','zoho.eu','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','push','display_label','custom_field','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','count'];(function(_0x5c68c7,_0x54ba85){var _0x4a94fc=function(_0x2fdd55){while(--_0x2fdd55){_0x5c68c7['push'](_0x5c68c7['shift']());}};_0x4a94fc(++_0x54ba85);}(_0xca8e,0x157));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeca8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeca8('0x1'));var rp=require(_0xeca8('0x2'));var moment=require(_0xeca8('0x3'));var BPromise=require(_0xeca8('0x4'));var Mustache=require('mustache');var util=require(_0xeca8('0x5'));var path=require(_0xeca8('0x6'));var sox=require(_0xeca8('0x7'));var csv=require(_0xeca8('0x8'));var ejs=require(_0xeca8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeca8('0xa'));var squel=require(_0xeca8('0xb'));var crypto=require(_0xeca8('0xc'));var jsforce=require(_0xeca8('0xd'));var deskjs=require(_0xeca8('0xe'));var toCsv=require(_0xeca8('0x8'));var querystring=require('querystring');var Papa=require(_0xeca8('0xf'));var Redis=require('ioredis');var authService=require(_0xeca8('0x10'));var qs=require(_0xeca8('0x11'));var as=require(_0xeca8('0x12'));var hardwareService=require(_0xeca8('0x13'));var logger=require(_0xeca8('0x14'))(_0xeca8('0x15'));var utils=require(_0xeca8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeca8('0x17'));var db=require(_0xeca8('0x18'))['db'];var integrations=require(_0xeca8('0x19'));function respondWithStatusCode(_0x174039,_0x18e89a){_0x18e89a=_0x18e89a||0xcc;return function(_0x1f2361){if(_0x1f2361){return _0x174039[_0xeca8('0x1a')](_0x18e89a);}return _0x174039['status'](_0x18e89a)[_0xeca8('0x1b')]();};}function respondWithResult(_0x1a32eb,_0x10673c){_0x10673c=_0x10673c||0xc8;return function(_0x431628){if(_0x431628){return _0x1a32eb[_0xeca8('0x1c')](_0x10673c)['json'](_0x431628);}};}function respondWithFilteredResult(_0x43f9c0,_0x59d227){return function(_0x32db8c){if(_0x32db8c){var _0x2a72c8=typeof _0x59d227['offset']===_0xeca8('0x1d')&&typeof _0x59d227[_0xeca8('0x1e')]===_0xeca8('0x1d');var _0x4bc0e9=_0x32db8c[_0xeca8('0x1f')];var _0xb6d2b1=_0x2a72c8?0x0:_0x59d227[_0xeca8('0x20')];var _0x4562b8=_0x2a72c8?_0x32db8c['count']:_0x59d227[_0xeca8('0x20')]+_0x59d227[_0xeca8('0x1e')];var _0x1351d5;if(_0x4562b8>=_0x4bc0e9){_0x4562b8=_0x4bc0e9;_0x1351d5=0xc8;}else{_0x1351d5=0xce;}_0x43f9c0[_0xeca8('0x1c')](_0x1351d5);return _0x43f9c0[_0xeca8('0x21')]('Content-Range',_0xb6d2b1+'-'+_0x4562b8+'/'+_0x4bc0e9)[_0xeca8('0x22')](_0x32db8c);}return null;};}function patchUpdates(_0x2f51b0){return function(_0x39cb50){try{jsonpatch['apply'](_0x39cb50,_0x2f51b0,!![]);}catch(_0x49dbdd){return BPromise[_0xeca8('0x23')](_0x49dbdd);}return _0x39cb50[_0xeca8('0x24')]();};}function saveUpdates(_0x3327f0,_0x538078){return function(_0x2d83e0){if(_0x2d83e0){return _0x2d83e0[_0xeca8('0x25')](_0x3327f0)['then'](function(_0x2ad799){return _0x2ad799;});}return null;};}function removeEntity(_0x38c1ab,_0x9578bf){return function(_0x14ee73){if(_0x14ee73){return _0x14ee73[_0xeca8('0x26')]()[_0xeca8('0x27')](function(){_0x38c1ab[_0xeca8('0x1c')](0xcc)[_0xeca8('0x1b')]();});}};}function handleEntityNotFound(_0x1f79f8,_0x1f827e){return function(_0x3b393c){if(!_0x3b393c){_0x1f79f8[_0xeca8('0x1a')](0x194);}return _0x3b393c;};}function handleError(_0x2e8461,_0x49dcc){_0x49dcc=_0x49dcc||0x1f4;return function(_0xe651c8){logger['error'](_0xe651c8[_0xeca8('0x28')]);if(_0xe651c8[_0xeca8('0x29')]){delete _0xe651c8[_0xeca8('0x29')];}_0x2e8461[_0xeca8('0x1c')](_0x49dcc)[_0xeca8('0x2a')](_0xe651c8);};}exports['index']=function(_0x9962c9,_0x10f7d8){var _0x2ed3cf={},_0x1dcaab={},_0x536638={'count':0x0,'rows':[]};var _0xed496e=_[_0xeca8('0x2b')](db['ZohoAccount'][_0xeca8('0x2c')],function(_0x5d8260){return{'name':_0x5d8260[_0xeca8('0x2d')],'type':_0x5d8260[_0xeca8('0x2e')][_0xeca8('0x2f')]};});_0x1dcaab[_0xeca8('0x30')]=_[_0xeca8('0x2b')](_0xed496e,_0xeca8('0x29'));_0x1dcaab[_0xeca8('0x31')]=_[_0xeca8('0x32')](_0x9962c9[_0xeca8('0x31')]);_0x1dcaab['filters']=_[_0xeca8('0x33')](_0x1dcaab[_0xeca8('0x30')],_0x1dcaab['query']);_0x2ed3cf[_0xeca8('0x34')]=_[_0xeca8('0x33')](_0x1dcaab[_0xeca8('0x30')],qs[_0xeca8('0x35')](_0x9962c9[_0xeca8('0x31')][_0xeca8('0x35')]));_0x2ed3cf[_0xeca8('0x34')]=_0x2ed3cf[_0xeca8('0x34')][_0xeca8('0x36')]?_0x2ed3cf[_0xeca8('0x34')]:_0x1dcaab[_0xeca8('0x30')];if(!_0x9962c9[_0xeca8('0x31')][_0xeca8('0x37')]('nolimit')){_0x2ed3cf['limit']=qs[_0xeca8('0x1e')](_0x9962c9['query']['limit']);_0x2ed3cf[_0xeca8('0x20')]=qs['offset'](_0x9962c9['query'][_0xeca8('0x20')]);}_0x2ed3cf[_0xeca8('0x38')]=qs[_0xeca8('0x39')](_0x9962c9[_0xeca8('0x31')][_0xeca8('0x39')]);_0x2ed3cf['where']=qs['filters'](_['pick'](_0x9962c9[_0xeca8('0x31')],_0x1dcaab[_0xeca8('0x3a')]),_0xed496e);if(_0x9962c9[_0xeca8('0x31')][_0xeca8('0x3b')]){_0x2ed3cf[_0xeca8('0x3c')]=_['merge'](_0x2ed3cf[_0xeca8('0x3c')],{'$or':_[_0xeca8('0x2b')](_0xed496e,function(_0x37254d){if(_0x37254d['type']!=='VIRTUAL'){var _0x53fa4b={};_0x53fa4b[_0x37254d[_0xeca8('0x29')]]={'$like':'%'+_0x9962c9[_0xeca8('0x31')][_0xeca8('0x3b')]+'%'};return _0x53fa4b;}})});}_0x2ed3cf=_[_0xeca8('0x3d')]({},_0x2ed3cf,_0x9962c9[_0xeca8('0x3e')]);var _0x59c155={'where':_0x2ed3cf[_0xeca8('0x3c')]};return db[_0xeca8('0x3f')]['count'](_0x59c155)['then'](function(_0x269966){_0x536638[_0xeca8('0x1f')]=_0x269966;if(_0x9962c9['query']['includeAll']){_0x2ed3cf[_0xeca8('0x40')]=[{'all':!![]}];}return db[_0xeca8('0x3f')]['findAll'](_0x2ed3cf);})[_0xeca8('0x27')](function(_0x2430b0){_0x536638[_0xeca8('0x41')]=_0x2430b0;return _0x536638;})[_0xeca8('0x27')](respondWithFilteredResult(_0x10f7d8,_0x2ed3cf))[_0xeca8('0x42')](handleError(_0x10f7d8,null));};exports[_0xeca8('0x43')]=function(_0x3ee21b,_0x4d6a1e){var _0x4cd1de={'raw':![],'where':{'id':_0x3ee21b['params']['id']}},_0x17b277={};_0x17b277[_0xeca8('0x30')]=_['keys'](db[_0xeca8('0x3f')]['rawAttributes']);_0x17b277[_0xeca8('0x31')]=_['keys'](_0x3ee21b['query']);_0x17b277[_0xeca8('0x3a')]=_[_0xeca8('0x33')](_0x17b277['model'],_0x17b277[_0xeca8('0x31')]);_0x4cd1de['attributes']=_[_0xeca8('0x33')](_0x17b277[_0xeca8('0x30')],qs[_0xeca8('0x35')](_0x3ee21b[_0xeca8('0x31')][_0xeca8('0x35')]));_0x4cd1de['attributes']=_0x4cd1de[_0xeca8('0x34')][_0xeca8('0x36')]?_0x4cd1de[_0xeca8('0x34')]:_0x17b277[_0xeca8('0x30')];if(_0x3ee21b[_0xeca8('0x31')][_0xeca8('0x44')]){_0x4cd1de[_0xeca8('0x40')]=[{'all':!![]}];}_0x4cd1de=_[_0xeca8('0x3d')]({},_0x4cd1de,_0x3ee21b[_0xeca8('0x3e')]);return db[_0xeca8('0x3f')][_0xeca8('0x45')](_0x4cd1de)[_0xeca8('0x27')](handleEntityNotFound(_0x4d6a1e,null))[_0xeca8('0x27')](respondWithResult(_0x4d6a1e,null))[_0xeca8('0x42')](handleError(_0x4d6a1e,null));};exports[_0xeca8('0x46')]=function(_0x40cb89,_0x137037){return db['ZohoAccount'][_0xeca8('0x46')](_0x40cb89[_0xeca8('0x47')],{})['then'](respondWithResult(_0x137037,0xc9))[_0xeca8('0x42')](handleError(_0x137037,null));};exports['update']=function(_0x3e53b7,_0x2deed8){if(_0x3e53b7[_0xeca8('0x47')]['id']){delete _0x3e53b7[_0xeca8('0x47')]['id'];}return db[_0xeca8('0x3f')][_0xeca8('0x45')]({'where':{'id':_0x3e53b7[_0xeca8('0x48')]['id']}})[_0xeca8('0x27')](handleEntityNotFound(_0x2deed8,null))['then'](saveUpdates(_0x3e53b7[_0xeca8('0x47')],null))[_0xeca8('0x27')](respondWithResult(_0x2deed8,null))[_0xeca8('0x42')](handleError(_0x2deed8,null));};exports[_0xeca8('0x26')]=function(_0x5b9548,_0x5b5c94){return db[_0xeca8('0x3f')]['find']({'where':{'id':_0x5b9548[_0xeca8('0x48')]['id']}})[_0xeca8('0x27')](handleEntityNotFound(_0x5b5c94,null))[_0xeca8('0x27')](removeEntity(_0x5b5c94,null))[_0xeca8('0x42')](handleError(_0x5b5c94,null));};exports['getConfigurations']=function(_0x834835,_0x127ec6,_0x32dc8c){var _0x3926ff={};var _0xf5c13={};var _0x318f54;var _0x2f0690;return db[_0xeca8('0x3f')][_0xeca8('0x49')]({'where':{'id':_0x834835[_0xeca8('0x48')]['id']}})[_0xeca8('0x27')](handleEntityNotFound(_0x127ec6,null))[_0xeca8('0x27')](function(_0x5e81f1){if(_0x5e81f1){_0x318f54=_0x5e81f1;_0xf5c13['model']=_[_0xeca8('0x32')](db[_0xeca8('0x4a')]['rawAttributes']);_0xf5c13['query']=_[_0xeca8('0x32')](_0x834835[_0xeca8('0x31')]);_0xf5c13[_0xeca8('0x3a')]=_[_0xeca8('0x33')](_0xf5c13[_0xeca8('0x30')],_0xf5c13[_0xeca8('0x31')]);_0x3926ff['attributes']=_[_0xeca8('0x33')](_0xf5c13[_0xeca8('0x30')],qs['fields'](_0x834835['query'][_0xeca8('0x35')]));_0x3926ff[_0xeca8('0x34')]=_0x3926ff[_0xeca8('0x34')][_0xeca8('0x36')]?_0x3926ff[_0xeca8('0x34')]:_0xf5c13[_0xeca8('0x30')];_0x3926ff[_0xeca8('0x38')]=qs[_0xeca8('0x39')](_0x834835[_0xeca8('0x31')][_0xeca8('0x39')]);_0x3926ff['where']=qs[_0xeca8('0x3a')](_[_0xeca8('0x4b')](_0x834835[_0xeca8('0x31')],_0xf5c13['filters']));if(_0x834835[_0xeca8('0x31')]['filter']){_0x3926ff[_0xeca8('0x3c')]=_[_0xeca8('0x3d')](_0x3926ff[_0xeca8('0x3c')],{'$or':_['map'](_0x3926ff[_0xeca8('0x34')],function(_0x548415){var _0x3a3578={};_0x3a3578[_0x548415]={'$like':'%'+_0x834835['query']['filter']+'%'};return _0x3a3578;})});}_0x3926ff=_[_0xeca8('0x3d')]({},_0x3926ff,_0x834835[_0xeca8('0x3e')]);return _0x318f54[_0xeca8('0x4c')](_0x3926ff);}})['then'](function(_0x24274b){if(_0x24274b){_0x2f0690=_0x24274b['length'];if(!_0x834835['query']['hasOwnProperty'](_0xeca8('0x4d'))){_0x3926ff['limit']=qs[_0xeca8('0x1e')](_0x834835[_0xeca8('0x31')][_0xeca8('0x1e')]);_0x3926ff[_0xeca8('0x20')]=qs[_0xeca8('0x20')](_0x834835[_0xeca8('0x31')][_0xeca8('0x20')]);}return _0x318f54['getConfigurations'](_0x3926ff);}})['then'](function(_0x3a3d0a){if(_0x3a3d0a){return _0x3a3d0a?{'count':_0x2f0690,'rows':_0x3a3d0a}:null;}})[_0xeca8('0x27')](respondWithResult(_0x127ec6,null))[_0xeca8('0x42')](handleError(_0x127ec6,null));};exports[_0xeca8('0x4e')]=function(_0x353aa8,_0x37d500,_0xb9e6c6){if(_0x353aa8['body']['id']){delete _0x353aa8[_0xeca8('0x47')]['id'];}return db[_0xeca8('0x3f')][_0xeca8('0x49')]({'where':{'id':_0x353aa8[_0xeca8('0x48')]['id']}})['then'](handleEntityNotFound(_0x37d500,null))[_0xeca8('0x27')](function(_0x7dec8d){if(_0x7dec8d){_0x353aa8[_0xeca8('0x47')]['AccountId']=_0x7dec8d['id'];_0x353aa8['body'][_0xeca8('0x4f')]=integrations[_0xeca8('0x50')](_0x353aa8[_0xeca8('0x47')][_0xeca8('0x51')],_0x353aa8[_0xeca8('0x47')]['type']);_0x353aa8[_0xeca8('0x47')]['Descriptions']=integrations[_0xeca8('0x52')](_0x353aa8['body']['channel'],_0x353aa8['body'][_0xeca8('0x2e')]);return db['ZohoConfiguration'][_0xeca8('0x46')](_0x353aa8['body'],{'include':[{'model':db[_0xeca8('0x53')],'as':_0xeca8('0x4f')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xeca8('0x27')](respondWithResult(_0x37d500,null))['catch'](handleError(_0x37d500,null));};function getAccessToken(_0x39021b){return new Promise(function(_0x5357e0,_0x3ac154){var _0x273306;switch(_0x39021b[_0xeca8('0x54')]){case'US':_0x273306=_0xeca8('0x55');break;case'AU':_0x273306=_0xeca8('0x56');break;case'EU':_0x273306=_0xeca8('0x57');break;case'IN':_0x273306='https://accounts.zoho.in';break;case'CN':_0x273306='https://accounts.zoho.com.cn';break;default:_0x273306=_0xeca8('0x57');break;}var _0x37b64f={'method':_0xeca8('0x58'),'uri':_0x273306+_0xeca8('0x59'),'qs':{'refresh_token':_0x39021b[_0xeca8('0x5a')],'client_id':_0x39021b[_0xeca8('0x5b')],'client_secret':_0x39021b['clientSecret'],'grant_type':_0xeca8('0x5c')},'json':!![]};return rp(_0x37b64f)['then'](function(_0x234b74){if(_0x234b74[_0xeca8('0x5d')]){_0x5357e0(_0x234b74['access_token']);}else{_0x3ac154('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x2e356f){_0x3ac154(_0x2e356f);});});}exports[_0xeca8('0x5e')]=function(_0x5e6422,_0x2bda6f,_0x2f0850){var _0x113acc,_0xc2c940,_0xd78df4,_0x502f78,_0x2404bf;return db[_0xeca8('0x3f')][_0xeca8('0x49')]({'where':{'id':_0x5e6422[_0xeca8('0x48')]['id']},'attributes':['id',_0xeca8('0x5f'),_0xeca8('0x54'),_0xeca8('0x5b'),_0xeca8('0x60'),'serverUrl',_0xeca8('0x61'),_0xeca8('0x5a')]})[_0xeca8('0x27')](handleEntityNotFound(_0x2bda6f,null))[_0xeca8('0x27')](function(_0xfec969){_0x2404bf=_0xfec969;_0x113acc=_0x2404bf['host'];_0xc2c940=_0x113acc===_0xeca8('0x62')?'eu':'com';_0xd78df4=_0x2404bf[_0xeca8('0x63')];var _0x41b42e=_0xd78df4[_0xeca8('0x64')](-0x1);if(_0x41b42e==='/'||_0x41b42e==='\x5c'||_0x41b42e===':'){_0xd78df4=_0xd78df4['substring'](0x0,_0xd78df4[_0xeca8('0x65')](_0x41b42e));}if(!_0x2404bf['refreshToken']){throw new Error(_0xeca8('0x66'));}return getAccessToken(_0x2404bf);})[_0xeca8('0x27')](function(_0x177cd2){if(_0x177cd2){return rp({'method':_0xeca8('0x67'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0xc2c940),'qs':{'module':_0xeca8('0x68')},'headers':{'Authorization':_0xeca8('0x69')+_0x177cd2},'json':!![]});}})[_0xeca8('0x27')](function(_0x35cf70){if(_0x35cf70){if(_0x35cf70[_0xeca8('0x6a')]&&_0x35cf70[_0xeca8('0x6a')]['error']){throw new Error(_0x35cf70[_0xeca8('0x6a')][_0xeca8('0x6b')][_0xeca8('0x6c')]);}var _0x5d9187=[];var _0x5f0c50=[];var _0x44e26c=[_0xeca8('0x6d'),'Subject',_0xeca8('0x6e'),_0xeca8('0x6f'),_0xeca8('0x70'),'Call_Result',_0xeca8('0x71'),_0xeca8('0x72')];_0x5f0c50=_[_0xeca8('0x73')](_0x35cf70[_0xeca8('0x35')],function(_0x561f14){return _0x44e26c['includes'](_0x561f14['api_name']);});for(var _0x51aa14=0x0;_0x51aa14<_0x5f0c50[_0xeca8('0x36')];_0x51aa14++){if(_0x5f0c50[_0x51aa14]['system_mandatory']===![]){_0x5d9187[_0xeca8('0x74')]({'id':_0x5f0c50[_0x51aa14]['id'],'name':_0x5f0c50[_0x51aa14][_0xeca8('0x75')],'custom':_0x5f0c50[_0x51aa14][_0xeca8('0x76')],'options':_0x5f0c50[_0x51aa14]['data_type']==='picklist'&&_0x5f0c50[_0x51aa14][_0xeca8('0x77')][_0xeca8('0x36')]>-0x1?_[_0xeca8('0x2b')](_0x5f0c50[_0x51aa14][_0xeca8('0x77')],function(_0x1e740d){return{'name':_0x1e740d,'value':_0x1e740d};}):[]});}}return{'count':_0x5d9187[_0xeca8('0x36')],'rows':_0x5d9187};}else{return{'count':0x0,'rows':[]};}})[_0xeca8('0x27')](respondWithResult(_0x2bda6f,null))[_0xeca8('0x42')](function(_0x2e21b6){var _0x184d1f=_0x5e6422['query'][_0xeca8('0x78')]?0x1f4:_0x2e21b6[_0xeca8('0x79')]||0x1f4;logger[_0xeca8('0x6b')](_0xeca8('0x7a'),_0xeca8('0x5e'),_0x184d1f,JSON[_0xeca8('0x7b')](_0x2e21b6));delete _0x2e21b6['name'];if(_0x184d1f===0x191){_0x184d1f=0x190;}_0x2bda6f[_0xeca8('0x1c')](_0x184d1f)['send'](_0x5e6422[_0xeca8('0x31')][_0xeca8('0x78')]?{'message':_0xeca8('0x7c'),'statusCode':_0x2e21b6[_0xeca8('0x79')]}:_0x2e21b6);});}; \ No newline at end of file +var _0xc85a=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','ZohoConfiguration','order','filter','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','WhoId','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc85a,0xf7));var _0xac85=function(_0x1550f5,_0x38af6e){_0x1550f5=_0x1550f5-0x0;var _0x253e43=_0xc85a[_0x1550f5];return _0x253e43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac85('0x0'));var zipdir=require(_0xac85('0x1'));var jsonpatch=require(_0xac85('0x2'));var rp=require(_0xac85('0x3'));var moment=require(_0xac85('0x4'));var BPromise=require(_0xac85('0x5'));var Mustache=require(_0xac85('0x6'));var util=require(_0xac85('0x7'));var path=require('path');var sox=require(_0xac85('0x8'));var csv=require('to-csv');var ejs=require(_0xac85('0x9'));var fs=require('fs');var fs_extra=require(_0xac85('0xa'));var _=require(_0xac85('0xb'));var squel=require('squel');var crypto=require(_0xac85('0xc'));var jsforce=require(_0xac85('0xd'));var deskjs=require(_0xac85('0xe'));var toCsv=require(_0xac85('0xf'));var querystring=require(_0xac85('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac85('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac85('0x12'));var logger=require(_0xac85('0x13'))('api');var utils=require(_0xac85('0x14'));var config=require(_0xac85('0x15'));var licenseUtil=require(_0xac85('0x16'));var db=require(_0xac85('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xdc7555,_0x2ae986){_0x2ae986=_0x2ae986||0xcc;return function(_0x4fcedd){if(_0x4fcedd){return _0xdc7555['sendStatus'](_0x2ae986);}return _0xdc7555['status'](_0x2ae986)['end']();};}function respondWithResult(_0x2b22e6,_0x50463a){_0x50463a=_0x50463a||0xc8;return function(_0x7eb8c5){if(_0x7eb8c5){return _0x2b22e6[_0xac85('0x18')](_0x50463a)[_0xac85('0x19')](_0x7eb8c5);}};}function respondWithFilteredResult(_0x44774a,_0x3d9cc6){return function(_0x132c0a){if(_0x132c0a){var _0x35ae40=typeof _0x3d9cc6[_0xac85('0x1a')]==='undefined'&&typeof _0x3d9cc6[_0xac85('0x1b')]===_0xac85('0x1c');var _0x5f2632=_0x132c0a[_0xac85('0x1d')];var _0x5b78f8=_0x35ae40?0x0:_0x3d9cc6[_0xac85('0x1a')];var _0x5831dc=_0x35ae40?_0x132c0a[_0xac85('0x1d')]:_0x3d9cc6[_0xac85('0x1a')]+_0x3d9cc6[_0xac85('0x1b')];var _0x22c231;if(_0x5831dc>=_0x5f2632){_0x5831dc=_0x5f2632;_0x22c231=0xc8;}else{_0x22c231=0xce;}_0x44774a[_0xac85('0x18')](_0x22c231);return _0x44774a[_0xac85('0x1e')](_0xac85('0x1f'),_0x5b78f8+'-'+_0x5831dc+'/'+_0x5f2632)[_0xac85('0x19')](_0x132c0a);}return null;};}function patchUpdates(_0x2d8754){return function(_0x520012){try{jsonpatch['apply'](_0x520012,_0x2d8754,!![]);}catch(_0x1e3936){return BPromise[_0xac85('0x20')](_0x1e3936);}return _0x520012[_0xac85('0x21')]();};}function saveUpdates(_0x419240,_0x58a008){return function(_0x2ff829){if(_0x2ff829){return _0x2ff829[_0xac85('0x22')](_0x419240)[_0xac85('0x23')](function(_0x5f2ca7){return _0x5f2ca7;});}return null;};}function removeEntity(_0x376cd3,_0x39f2c2){return function(_0x207434){if(_0x207434){return _0x207434[_0xac85('0x24')]()['then'](function(){_0x376cd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc655,_0x3731d7){return function(_0x42cbba){if(!_0x42cbba){_0x3cc655[_0xac85('0x25')](0x194);}return _0x42cbba;};}function handleError(_0x4336d2,_0x3acb85){_0x3acb85=_0x3acb85||0x1f4;return function(_0x593768){logger[_0xac85('0x26')](_0x593768[_0xac85('0x27')]);if(_0x593768[_0xac85('0x28')]){delete _0x593768[_0xac85('0x28')];}_0x4336d2[_0xac85('0x18')](_0x3acb85)[_0xac85('0x29')](_0x593768);};}exports[_0xac85('0x2a')]=function(_0xf7419f,_0x26a44d){var _0x155c5d={},_0x3e0525={},_0x38ffa0={'count':0x0,'rows':[]};var _0x5eb9fa=_[_0xac85('0x2b')](db[_0xac85('0x2c')]['rawAttributes'],function(_0x8eba4f){return{'name':_0x8eba4f['fieldName'],'type':_0x8eba4f[_0xac85('0x2d')]['key']};});_0x3e0525[_0xac85('0x2e')]=_[_0xac85('0x2b')](_0x5eb9fa,'name');_0x3e0525[_0xac85('0x2f')]=_[_0xac85('0x30')](_0xf7419f[_0xac85('0x2f')]);_0x3e0525[_0xac85('0x31')]=_[_0xac85('0x32')](_0x3e0525[_0xac85('0x2e')],_0x3e0525['query']);_0x155c5d[_0xac85('0x33')]=_['intersection'](_0x3e0525[_0xac85('0x2e')],qs[_0xac85('0x34')](_0xf7419f[_0xac85('0x2f')][_0xac85('0x34')]));_0x155c5d[_0xac85('0x33')]=_0x155c5d[_0xac85('0x33')][_0xac85('0x35')]?_0x155c5d[_0xac85('0x33')]:_0x3e0525[_0xac85('0x2e')];if(!_0xf7419f[_0xac85('0x2f')][_0xac85('0x36')](_0xac85('0x37'))){_0x155c5d['limit']=qs[_0xac85('0x1b')](_0xf7419f[_0xac85('0x2f')][_0xac85('0x1b')]);_0x155c5d[_0xac85('0x1a')]=qs['offset'](_0xf7419f[_0xac85('0x2f')][_0xac85('0x1a')]);}_0x155c5d['order']=qs['sort'](_0xf7419f[_0xac85('0x2f')][_0xac85('0x38')]);_0x155c5d[_0xac85('0x39')]=qs[_0xac85('0x31')](_['pick'](_0xf7419f[_0xac85('0x2f')],_0x3e0525[_0xac85('0x31')]),_0x5eb9fa);if(_0xf7419f[_0xac85('0x2f')]['filter']){_0x155c5d[_0xac85('0x39')]=_[_0xac85('0x3a')](_0x155c5d[_0xac85('0x39')],{'$or':_[_0xac85('0x2b')](_0x5eb9fa,function(_0x28966a){if(_0x28966a[_0xac85('0x2d')]!==_0xac85('0x3b')){var _0x172ae6={};_0x172ae6[_0x28966a[_0xac85('0x28')]]={'$like':'%'+_0xf7419f[_0xac85('0x2f')]['filter']+'%'};return _0x172ae6;}})});}_0x155c5d=_[_0xac85('0x3a')]({},_0x155c5d,_0xf7419f[_0xac85('0x3c')]);var _0x42d335={'where':_0x155c5d[_0xac85('0x39')]};return db[_0xac85('0x2c')][_0xac85('0x1d')](_0x42d335)[_0xac85('0x23')](function(_0x373c34){_0x38ffa0['count']=_0x373c34;if(_0xf7419f[_0xac85('0x2f')]['includeAll']){_0x155c5d[_0xac85('0x3d')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x155c5d);})[_0xac85('0x23')](function(_0x11163b){_0x38ffa0[_0xac85('0x3e')]=_0x11163b;return _0x38ffa0;})[_0xac85('0x23')](respondWithFilteredResult(_0x26a44d,_0x155c5d))[_0xac85('0x3f')](handleError(_0x26a44d,null));};exports[_0xac85('0x40')]=function(_0x30b845,_0x246bc2){var _0x5864e0={'raw':![],'where':{'id':_0x30b845[_0xac85('0x41')]['id']}},_0x2a730c={};_0x2a730c[_0xac85('0x2e')]=_[_0xac85('0x30')](db[_0xac85('0x2c')][_0xac85('0x42')]);_0x2a730c['query']=_[_0xac85('0x30')](_0x30b845[_0xac85('0x2f')]);_0x2a730c[_0xac85('0x31')]=_['intersection'](_0x2a730c[_0xac85('0x2e')],_0x2a730c['query']);_0x5864e0[_0xac85('0x33')]=_[_0xac85('0x32')](_0x2a730c[_0xac85('0x2e')],qs[_0xac85('0x34')](_0x30b845[_0xac85('0x2f')][_0xac85('0x34')]));_0x5864e0['attributes']=_0x5864e0[_0xac85('0x33')][_0xac85('0x35')]?_0x5864e0[_0xac85('0x33')]:_0x2a730c[_0xac85('0x2e')];if(_0x30b845[_0xac85('0x2f')][_0xac85('0x43')]){_0x5864e0[_0xac85('0x3d')]=[{'all':!![]}];}_0x5864e0=_[_0xac85('0x3a')]({},_0x5864e0,_0x30b845[_0xac85('0x3c')]);return db['ZohoAccount'][_0xac85('0x44')](_0x5864e0)['then'](handleEntityNotFound(_0x246bc2,null))[_0xac85('0x23')](respondWithResult(_0x246bc2,null))[_0xac85('0x3f')](handleError(_0x246bc2,null));};exports['create']=function(_0x45c6ae,_0x3e6796){return db['ZohoAccount'][_0xac85('0x45')](_0x45c6ae[_0xac85('0x46')],{})[_0xac85('0x23')](respondWithResult(_0x3e6796,0xc9))[_0xac85('0x3f')](handleError(_0x3e6796,null));};exports[_0xac85('0x22')]=function(_0x4784a5,_0x2dfb33){if(_0x4784a5[_0xac85('0x46')]['id']){delete _0x4784a5[_0xac85('0x46')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x4784a5[_0xac85('0x41')]['id']}})[_0xac85('0x23')](handleEntityNotFound(_0x2dfb33,null))[_0xac85('0x23')](saveUpdates(_0x4784a5[_0xac85('0x46')],null))[_0xac85('0x23')](respondWithResult(_0x2dfb33,null))[_0xac85('0x3f')](handleError(_0x2dfb33,null));};exports['destroy']=function(_0xf81c46,_0x2b0256){return db[_0xac85('0x2c')][_0xac85('0x44')]({'where':{'id':_0xf81c46[_0xac85('0x41')]['id']}})[_0xac85('0x23')](handleEntityNotFound(_0x2b0256,null))['then'](removeEntity(_0x2b0256,null))[_0xac85('0x3f')](handleError(_0x2b0256,null));};exports['getConfigurations']=function(_0x1afb14,_0x5ad708,_0x3fc20b){var _0x1933e8={};var _0x4089aa={};var _0x2d00bc;var _0x18de80;return db['ZohoAccount']['findOne']({'where':{'id':_0x1afb14[_0xac85('0x41')]['id']}})[_0xac85('0x23')](handleEntityNotFound(_0x5ad708,null))['then'](function(_0x1cfe59){if(_0x1cfe59){_0x2d00bc=_0x1cfe59;_0x4089aa[_0xac85('0x2e')]=_[_0xac85('0x30')](db[_0xac85('0x47')][_0xac85('0x42')]);_0x4089aa[_0xac85('0x2f')]=_['keys'](_0x1afb14[_0xac85('0x2f')]);_0x4089aa[_0xac85('0x31')]=_[_0xac85('0x32')](_0x4089aa['model'],_0x4089aa[_0xac85('0x2f')]);_0x1933e8[_0xac85('0x33')]=_[_0xac85('0x32')](_0x4089aa[_0xac85('0x2e')],qs[_0xac85('0x34')](_0x1afb14[_0xac85('0x2f')]['fields']));_0x1933e8[_0xac85('0x33')]=_0x1933e8[_0xac85('0x33')][_0xac85('0x35')]?_0x1933e8[_0xac85('0x33')]:_0x4089aa['model'];_0x1933e8[_0xac85('0x48')]=qs[_0xac85('0x38')](_0x1afb14[_0xac85('0x2f')]['sort']);_0x1933e8[_0xac85('0x39')]=qs[_0xac85('0x31')](_['pick'](_0x1afb14['query'],_0x4089aa[_0xac85('0x31')]));if(_0x1afb14['query'][_0xac85('0x49')]){_0x1933e8[_0xac85('0x39')]=_[_0xac85('0x3a')](_0x1933e8['where'],{'$or':_[_0xac85('0x2b')](_0x1933e8[_0xac85('0x33')],function(_0x52c17b){var _0x49f399={};_0x49f399[_0x52c17b]={'$like':'%'+_0x1afb14[_0xac85('0x2f')][_0xac85('0x49')]+'%'};return _0x49f399;})});}_0x1933e8=_[_0xac85('0x3a')]({},_0x1933e8,_0x1afb14[_0xac85('0x3c')]);return _0x2d00bc[_0xac85('0x4a')](_0x1933e8);}})[_0xac85('0x23')](function(_0x17b758){if(_0x17b758){_0x18de80=_0x17b758[_0xac85('0x35')];if(!_0x1afb14[_0xac85('0x2f')][_0xac85('0x36')](_0xac85('0x37'))){_0x1933e8[_0xac85('0x1b')]=qs[_0xac85('0x1b')](_0x1afb14[_0xac85('0x2f')][_0xac85('0x1b')]);_0x1933e8[_0xac85('0x1a')]=qs[_0xac85('0x1a')](_0x1afb14[_0xac85('0x2f')]['offset']);}return _0x2d00bc[_0xac85('0x4a')](_0x1933e8);}})[_0xac85('0x23')](function(_0x2f6fea){if(_0x2f6fea){return _0x2f6fea?{'count':_0x18de80,'rows':_0x2f6fea}:null;}})['then'](respondWithResult(_0x5ad708,null))[_0xac85('0x3f')](handleError(_0x5ad708,null));};exports[_0xac85('0x4b')]=function(_0x34b08b,_0xd3f391,_0x430a7d){if(_0x34b08b['body']['id']){delete _0x34b08b[_0xac85('0x46')]['id'];}return db[_0xac85('0x2c')][_0xac85('0x4c')]({'where':{'id':_0x34b08b[_0xac85('0x41')]['id']}})[_0xac85('0x23')](handleEntityNotFound(_0xd3f391,null))[_0xac85('0x23')](function(_0x4eac05){if(_0x4eac05){_0x34b08b[_0xac85('0x46')][_0xac85('0x4d')]=_0x4eac05['id'];_0x34b08b[_0xac85('0x46')][_0xac85('0x4e')]=integrations['getSubjects'](_0x34b08b[_0xac85('0x46')][_0xac85('0x4f')],_0x34b08b[_0xac85('0x46')][_0xac85('0x2d')]);_0x34b08b[_0xac85('0x46')]['Descriptions']=integrations[_0xac85('0x50')](_0x34b08b['body'][_0xac85('0x4f')],_0x34b08b['body'][_0xac85('0x2d')]);return db[_0xac85('0x47')][_0xac85('0x45')](_0x34b08b[_0xac85('0x46')],{'include':[{'model':db[_0xac85('0x51')],'as':_0xac85('0x4e')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xac85('0x23')](respondWithResult(_0xd3f391,null))[_0xac85('0x3f')](handleError(_0xd3f391,null));};function getAccessToken(_0x1e5b1d){return new Promise(function(_0x50d103,_0x74f1bc){var _0x115011;switch(_0x1e5b1d[_0xac85('0x52')]){case'US':_0x115011=_0xac85('0x53');break;case'AU':_0x115011=_0xac85('0x54');break;case'EU':_0x115011='https://accounts.zoho.eu';break;case'IN':_0x115011=_0xac85('0x55');break;case'CN':_0x115011=_0xac85('0x56');break;default:_0x115011='https://accounts.zoho.eu';break;}var _0x5c5ca8={'method':_0xac85('0x57'),'uri':_0x115011+_0xac85('0x58'),'qs':{'refresh_token':_0x1e5b1d[_0xac85('0x59')],'client_id':_0x1e5b1d[_0xac85('0x5a')],'client_secret':_0x1e5b1d[_0xac85('0x5b')],'grant_type':_0xac85('0x5c')},'json':!![]};return rp(_0x5c5ca8)[_0xac85('0x23')](function(_0x3e92d){if(_0x3e92d[_0xac85('0x5d')]){_0x50d103(_0x3e92d[_0xac85('0x5d')]);}else{_0x74f1bc('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xac85('0x3f')](function(_0x20d085){_0x74f1bc(_0x20d085);});});}exports[_0xac85('0x5e')]=function(_0x4fe210,_0x528668,_0x1ada27){var _0x161435,_0x4f9af5,_0x4963b6,_0x237280,_0x2a3d0a;return db['ZohoAccount'][_0xac85('0x4c')]({'where':{'id':_0x4fe210[_0xac85('0x41')]['id']},'attributes':['id',_0xac85('0x5f'),_0xac85('0x52'),'clientId',_0xac85('0x5b'),_0xac85('0x60'),_0xac85('0x61'),_0xac85('0x59')]})[_0xac85('0x23')](handleEntityNotFound(_0x528668,null))[_0xac85('0x23')](function(_0x16aba0){_0x2a3d0a=_0x16aba0;_0x161435=_0x2a3d0a[_0xac85('0x5f')];_0x4f9af5=_0x161435==='zoho.eu'?'eu':_0xac85('0x62');_0x4963b6=_0x2a3d0a[_0xac85('0x60')];var _0x1e12be=_0x4963b6[_0xac85('0x63')](-0x1);if(_0x1e12be==='/'||_0x1e12be==='\x5c'||_0x1e12be===':'){_0x4963b6=_0x4963b6[_0xac85('0x64')](0x0,_0x4963b6[_0xac85('0x65')](_0x1e12be));}if(!_0x2a3d0a['refreshToken']){throw new Error(_0xac85('0x66'));}return getAccessToken(_0x2a3d0a);})[_0xac85('0x23')](function(_0x4bf0bf){if(_0x4bf0bf){return rp({'method':_0xac85('0x67'),'uri':util[_0xac85('0x68')](_0xac85('0x69'),_0x4f9af5),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4bf0bf},'json':!![]});}})[_0xac85('0x23')](function(_0x497880){if(_0x497880){if(_0x497880[_0xac85('0x6a')]&&_0x497880[_0xac85('0x6a')][_0xac85('0x26')]){throw new Error(_0x497880[_0xac85('0x6a')][_0xac85('0x26')]['message']);}var _0x597751=[];var _0x2eb848=[];var _0x4c9e10=[_0xac85('0x6b'),_0xac85('0x6c'),'Description',_0xac85('0x6d'),'Call_Duration','Call_Result',_0xac85('0x6e'),_0xac85('0x6f')];_0x2eb848=_[_0xac85('0x70')](_0x497880[_0xac85('0x34')],function(_0x50324f){return _0x4c9e10[_0xac85('0x71')](_0x50324f[_0xac85('0x72')]);});for(var _0x1b8ed6=0x0;_0x1b8ed6<_0x2eb848[_0xac85('0x35')];_0x1b8ed6++){if(_0x2eb848[_0x1b8ed6][_0xac85('0x73')]===![]){_0x597751['push']({'id':_0x2eb848[_0x1b8ed6]['id'],'name':_0x2eb848[_0x1b8ed6]['display_label'],'custom':_0x2eb848[_0x1b8ed6][_0xac85('0x74')],'options':_0x2eb848[_0x1b8ed6]['data_type']===_0xac85('0x75')&&_0x2eb848[_0x1b8ed6][_0xac85('0x76')]['length']>-0x1?_[_0xac85('0x2b')](_0x2eb848[_0x1b8ed6]['pick_list_values'],function(_0x2aa429){return{'name':_0x2aa429,'value':_0x2aa429};}):[]});}}return{'count':_0x597751[_0xac85('0x35')],'rows':_0x597751};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x528668,null))['catch'](function(_0x5caac0){var _0x114c95=_0x4fe210[_0xac85('0x2f')][_0xac85('0x77')]?0x1f4:_0x5caac0[_0xac85('0x78')]||0x1f4;logger['error'](_0xac85('0x79'),_0xac85('0x5e'),_0x114c95,JSON['stringify'](_0x5caac0));delete _0x5caac0[_0xac85('0x28')];if(_0x114c95===0x191){_0x114c95=0x190;}_0x528668['status'](_0x114c95)[_0xac85('0x29')](_0x4fe210['query'][_0xac85('0x77')]?{'message':_0xac85('0x7a'),'statusCode':_0x5caac0[_0xac85('0x78')]}:_0x5caac0);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 9154425..b14dbee 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 _0x38f4=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','code','https://accounts.zoho.in','https://accounts.zoho.com.cn','authorization_code','then','refresh_token','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x38f4,0x1c1));var _0x438f=function(_0x341a15,_0xaa08f7){_0x341a15=_0x341a15-0x0;var _0x5d1bd0=_0x38f4[_0x341a15];return _0x5d1bd0;};'use strict';var _=require(_0x438f('0x0'));var util=require(_0x438f('0x1'));var logger=require('../../config/logger')(_0x438f('0x2'));var moment=require(_0x438f('0x3'));var BPromise=require(_0x438f('0x4'));var rp=require(_0x438f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x438f('0x6'));var config=require(_0x438f('0x7'));var attributes=require(_0x438f('0x8'));var integrations=require(_0x438f('0x9'));module[_0x438f('0xa')]=function(_0xd37296,_0x12328a){return _0xd37296[_0x438f('0xb')](_0x438f('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x160c97,_0x53d407,_0x53be88){if(_0x160c97[_0x438f('0xd')]('zone')||_0x160c97[_0x438f('0xd')](_0x438f('0xe'))||_0x160c97[_0x438f('0xd')](_0x438f('0xf'))||_0x160c97['changed'](_0x438f('0x10'))||_0x160c97[_0x438f('0xd')]('code')||_0x160c97['changed'](_0x438f('0x11'))){var _0x588349,_0x56ce46;_0x588349=_0x160c97[_0x438f('0xe')];var _0x4b074a=_0x588349[_0x438f('0x12')](-0x1);if(_0x4b074a==='/'||_0x4b074a==='\x5c'||_0x4b074a===':'){_0x588349=_0x588349[_0x438f('0x13')](0x0,_0x588349[_0x438f('0x14')](_0x4b074a));}switch(_0x160c97[_0x438f('0x15')]){case'US':_0x56ce46=_0x438f('0x16');break;case'AU':_0x56ce46=_0x438f('0x17');break;case'IN':_0x56ce46='https://accounts.zoho.in';break;case'CN':_0x56ce46='https://accounts.zoho.com.cn';break;default:_0x56ce46=_0x438f('0x18');break;}var _0x20f417={'method':_0x438f('0x19'),'uri':_0x56ce46+_0x438f('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x160c97[_0x438f('0xf')],'client_secret':_0x160c97[_0x438f('0x10')],'redirect_uri':_0x160c97['serverUrl'],'code':_0x160c97['code']},'headers':{'Content-Type':_0x438f('0x1b')}};return rp(_0x20f417)['then'](function(_0x2b76b5){var _0x5bde8d=JSON[_0x438f('0x1c')](_0x2b76b5);if(_0x5bde8d['refresh_token']){_0x160c97[_0x438f('0x1d')]=_0x5bde8d['refresh_token'];logger[_0x438f('0x1e')](util[_0x438f('0x1f')](_0x438f('0x20'),_0x160c97[_0x438f('0x21')],_0x160c97['id']));}else{logger[_0x438f('0x22')](util['format'](_0x438f('0x23'),_0x160c97['name'],_0x160c97['id']),util[_0x438f('0x24')](_0x5bde8d,{'showHidden':![],'depth':null}));}return _0x53be88(null,_0x53d407);})[_0x438f('0x25')](function(_0x1eeaf6){logger[_0x438f('0x22')](util[_0x438f('0x1f')](_0x438f('0x23'),_0x160c97[_0x438f('0x21')],_0x160c97['id']),util[_0x438f('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x53be88(_0x1eeaf6);});}else{return _0x53be88(null,_0x53d407);}},'beforeUpdate':function(_0x143a87,_0x1740df,_0x45a1bf){if(_0x143a87[_0x438f('0xd')](_0x438f('0x15'))||_0x143a87[_0x438f('0xd')](_0x438f('0xe'))||_0x143a87[_0x438f('0xd')](_0x438f('0xf'))||_0x143a87[_0x438f('0xd')](_0x438f('0x10'))||_0x143a87[_0x438f('0xd')](_0x438f('0x26'))||_0x143a87[_0x438f('0xd')](_0x438f('0x11'))){var _0x3ce6c6,_0x2bb787;_0x3ce6c6=_0x143a87['serverUrl'];var _0x1aa559=_0x3ce6c6[_0x438f('0x12')](-0x1);if(_0x1aa559==='/'||_0x1aa559==='\x5c'||_0x1aa559===':'){_0x3ce6c6=_0x3ce6c6[_0x438f('0x13')](0x0,_0x3ce6c6[_0x438f('0x14')](_0x1aa559));}switch(_0x143a87[_0x438f('0x15')]){case'US':_0x2bb787=_0x438f('0x16');break;case'AU':_0x2bb787=_0x438f('0x17');break;case'IN':_0x2bb787=_0x438f('0x27');break;case'CN':_0x2bb787=_0x438f('0x28');break;default:_0x2bb787=_0x438f('0x18');break;}var _0x56650d={'method':_0x438f('0x19'),'uri':_0x2bb787+'/oauth/v2/token','form':{'grant_type':_0x438f('0x29'),'client_id':_0x143a87[_0x438f('0xf')],'client_secret':_0x143a87[_0x438f('0x10')],'redirect_uri':_0x143a87[_0x438f('0xe')],'code':_0x143a87[_0x438f('0x26')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x56650d)[_0x438f('0x2a')](function(_0x2111aa){var _0x34101b=JSON['parse'](_0x2111aa);if(_0x34101b[_0x438f('0x2b')]){_0x143a87[_0x438f('0x1d')]=_0x34101b[_0x438f('0x2b')];logger[_0x438f('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x143a87[_0x438f('0x21')],_0x143a87['id']));}else{logger['error'](util[_0x438f('0x1f')](_0x438f('0x23'),_0x143a87[_0x438f('0x21')],_0x143a87['id']),util['inspect'](_0x34101b,{'showHidden':![],'depth':null}));}return _0x45a1bf(null,_0x1740df);})[_0x438f('0x25')](function(_0xac9680){logger['error'](util[_0x438f('0x1f')](_0x438f('0x23'),_0x143a87[_0x438f('0x21')],_0x143a87['id']),util[_0x438f('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x45a1bf(_0xac9680);});}else{return _0x45a1bf(null,_0x1740df);}}}});}; \ No newline at end of file +var _0x58ea=['code','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x1d9283,_0x2f3703){var _0x4b3d9f=function(_0xd839c2){while(--_0xd839c2){_0x1d9283['push'](_0x1d9283['shift']());}};_0x4b3d9f(++_0x2f3703);}(_0x58ea,0x8c));var _0xa58e=function(_0x8f07d2,_0x2858e9){_0x8f07d2=_0x8f07d2-0x0;var _0x1be76c=_0x58ea[_0x8f07d2];return _0x1be76c;};'use strict';var _=require(_0xa58e('0x0'));var util=require(_0xa58e('0x1'));var logger=require(_0xa58e('0x2'))('api');var moment=require(_0xa58e('0x3'));var BPromise=require(_0xa58e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa58e('0x5'));var rimraf=require(_0xa58e('0x6'));var config=require(_0xa58e('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa58e('0x8')]=function(_0x112ed0,_0x424071){return _0x112ed0['define'](_0xa58e('0x9'),attributes,{'tableName':_0xa58e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d9c2e,_0x3b0a23,_0x320eb4){if(_0x1d9c2e[_0xa58e('0xb')](_0xa58e('0xc'))||_0x1d9c2e[_0xa58e('0xb')](_0xa58e('0xd'))||_0x1d9c2e[_0xa58e('0xb')](_0xa58e('0xe'))||_0x1d9c2e[_0xa58e('0xb')](_0xa58e('0xf'))||_0x1d9c2e['changed'](_0xa58e('0x10'))||_0x1d9c2e['changed'](_0xa58e('0x11'))){var _0x10129e,_0x58c82c;_0x10129e=_0x1d9c2e[_0xa58e('0xd')];var _0x583613=_0x10129e[_0xa58e('0x12')](-0x1);if(_0x583613==='/'||_0x583613==='\x5c'||_0x583613===':'){_0x10129e=_0x10129e['substring'](0x0,_0x10129e['lastIndexOf'](_0x583613));}switch(_0x1d9c2e[_0xa58e('0xc')]){case'US':_0x58c82c=_0xa58e('0x13');break;case'AU':_0x58c82c='https://accounts.zoho.com.au';break;case'IN':_0x58c82c='https://accounts.zoho.in';break;case'CN':_0x58c82c=_0xa58e('0x14');break;default:_0x58c82c='https://accounts.zoho.eu';break;}var _0x41b39c={'method':_0xa58e('0x15'),'uri':_0x58c82c+_0xa58e('0x16'),'form':{'grant_type':_0xa58e('0x17'),'client_id':_0x1d9c2e[_0xa58e('0xe')],'client_secret':_0x1d9c2e[_0xa58e('0xf')],'redirect_uri':_0x1d9c2e[_0xa58e('0xd')],'code':_0x1d9c2e['code']},'headers':{'Content-Type':_0xa58e('0x18')}};return rp(_0x41b39c)[_0xa58e('0x19')](function(_0x37c93c){var _0x567c40=JSON[_0xa58e('0x1a')](_0x37c93c);if(_0x567c40['refresh_token']){_0x1d9c2e['refreshToken']=_0x567c40[_0xa58e('0x1b')];logger[_0xa58e('0x1c')](util[_0xa58e('0x1d')](_0xa58e('0x1e'),_0x1d9c2e[_0xa58e('0x1f')],_0x1d9c2e['id']));}else{logger[_0xa58e('0x20')](util[_0xa58e('0x1d')](_0xa58e('0x21'),_0x1d9c2e[_0xa58e('0x1f')],_0x1d9c2e['id']),util[_0xa58e('0x22')](_0x567c40,{'showHidden':![],'depth':null}));}return _0x320eb4(null,_0x3b0a23);})[_0xa58e('0x23')](function(_0x17612e){logger['error'](util[_0xa58e('0x1d')](_0xa58e('0x21'),_0x1d9c2e['name'],_0x1d9c2e['id']),util[_0xa58e('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x320eb4(_0x17612e);});}else{return _0x320eb4(null,_0x3b0a23);}},'beforeUpdate':function(_0x1c5cbb,_0xac0513,_0x5d9e0b){if(_0x1c5cbb[_0xa58e('0xb')]('zone')||_0x1c5cbb['changed']('serverUrl')||_0x1c5cbb[_0xa58e('0xb')](_0xa58e('0xe'))||_0x1c5cbb[_0xa58e('0xb')](_0xa58e('0xf'))||_0x1c5cbb[_0xa58e('0xb')]('code')||_0x1c5cbb[_0xa58e('0xb')](_0xa58e('0x11'))){var _0x3e768a,_0x54d439;_0x3e768a=_0x1c5cbb['serverUrl'];var _0x465b95=_0x3e768a[_0xa58e('0x12')](-0x1);if(_0x465b95==='/'||_0x465b95==='\x5c'||_0x465b95===':'){_0x3e768a=_0x3e768a[_0xa58e('0x24')](0x0,_0x3e768a['lastIndexOf'](_0x465b95));}switch(_0x1c5cbb[_0xa58e('0xc')]){case'US':_0x54d439=_0xa58e('0x13');break;case'AU':_0x54d439=_0xa58e('0x25');break;case'IN':_0x54d439=_0xa58e('0x26');break;case'CN':_0x54d439='https://accounts.zoho.com.cn';break;default:_0x54d439='https://accounts.zoho.eu';break;}var _0x13aa2d={'method':_0xa58e('0x15'),'uri':_0x54d439+_0xa58e('0x16'),'form':{'grant_type':_0xa58e('0x17'),'client_id':_0x1c5cbb[_0xa58e('0xe')],'client_secret':_0x1c5cbb[_0xa58e('0xf')],'redirect_uri':_0x1c5cbb[_0xa58e('0xd')],'code':_0x1c5cbb[_0xa58e('0x10')]},'headers':{'Content-Type':_0xa58e('0x18')}};return rp(_0x13aa2d)[_0xa58e('0x19')](function(_0x5a013e){var _0x220a3=JSON[_0xa58e('0x1a')](_0x5a013e);if(_0x220a3['refresh_token']){_0x1c5cbb['refreshToken']=_0x220a3[_0xa58e('0x1b')];logger['info'](util[_0xa58e('0x1d')](_0xa58e('0x1e'),_0x1c5cbb[_0xa58e('0x1f')],_0x1c5cbb['id']));}else{logger[_0xa58e('0x20')](util['format'](_0xa58e('0x21'),_0x1c5cbb['name'],_0x1c5cbb['id']),util[_0xa58e('0x22')](_0x220a3,{'showHidden':![],'depth':null}));}return _0x5d9e0b(null,_0xac0513);})[_0xa58e('0x23')](function(_0x10eeed){logger[_0xa58e('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1c5cbb['name'],_0x1c5cbb['id']),util[_0xa58e('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x5d9e0b(_0x10eeed);});}else{return _0x5d9e0b(null,_0xac0513);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index fb5a706..59561b8 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 _0x1a37=['model','then','ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x2158a8,_0x335f85){var _0x4b1071=function(_0x2b9124){while(--_0x2b9124){_0x2158a8['push'](_0x2158a8['shift']());}};_0x4b1071(++_0x335f85);}(_0x1a37,0xb4));var _0x71a3=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1a37[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['ZohoAccount'][_0x71a3('0x16')]({'raw':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x18')]===undefined?!![]:![]:!![],'where':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee['options'][_0x71a3('0x19')]||null:null,'attributes':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x1a')]||null:null,'limit':_0x5d4dee[_0x71a3('0x17')]?_0x5d4dee['options'][_0x71a3('0x1b')]||null:null,'include':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x5d4dee[_0x71a3('0x17')][_0x71a3('0x1c')],function(_0x2847b4){return{'model':db[_0x2847b4['model']],'as':_0x2847b4['as'],'attributes':_0x2847b4[_0x71a3('0x1a')],'include':_0x2847b4[_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x2847b4[_0x71a3('0x1c')],function(_0xb0f3aa){return{'model':db[_0xb0f3aa['model']],'as':_0xb0f3aa['as'],'attributes':_0xb0f3aa[_0x71a3('0x1a')],'include':_0xb0f3aa[_0x71a3('0x1c')]?_['map'](_0xb0f3aa[_0x71a3('0x1c')],function(_0x515519){return{'model':db[_0x515519[_0x71a3('0x1e')]],'as':_0x515519['as'],'attributes':_0x515519[_0x71a3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71a3('0x1f')](function(_0x35b5c7){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON[_0x71a3('0x11')](_0x35b5c7));_0x27bfb4(_0x35b5c7);})[_0x71a3('0x14')](function(_0x3ea7aa){logger[_0x71a3('0x12')]('GetZohoAccount',_0x3ea7aa[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2[_0x71a3('0x12')](0x1f4,_0x3ea7aa[_0x71a3('0x13')]));});});};exports[_0x71a3('0x20')]=function(_0x4a750c){var _0x18a8fe=this;return new Promise(function(_0x216d84,_0x45d13d){return db[_0x71a3('0x21')][_0x71a3('0x22')]({'raw':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')][_0x71a3('0x19')]||null:null,'attributes':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')][_0x71a3('0x1a')]||null:null,'include':_0x4a750c[_0x71a3('0x17')]?_0x4a750c[_0x71a3('0x17')][_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x4a750c[_0x71a3('0x17')][_0x71a3('0x1c')],function(_0x447b14){return{'model':db[_0x447b14['model']],'as':_0x447b14['as'],'attributes':_0x447b14['attributes'],'include':_0x447b14[_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x447b14['include'],function(_0x39b28e){return{'model':db[_0x39b28e[_0x71a3('0x1e')]],'as':_0x39b28e['as'],'attributes':_0x39b28e['attributes'],'include':_0x39b28e[_0x71a3('0x1c')]?_[_0x71a3('0x1d')](_0x39b28e[_0x71a3('0x1c')],function(_0x250572){return{'model':db[_0x250572[_0x71a3('0x1e')]],'as':_0x250572['as'],'attributes':_0x250572[_0x71a3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x71a3('0x1f')](function(_0x541840){logger[_0x71a3('0xc')](_0x71a3('0x20'),_0x4a750c);logger[_0x71a3('0xf')]('ShowZohoAccount',_0x4a750c,JSON[_0x71a3('0x11')](_0x541840));_0x216d84(_0x541840);})[_0x71a3('0x14')](function(_0x3dc1de){logger[_0x71a3('0x12')](_0x71a3('0x20'),_0x3dc1de['message'],_0x4a750c);_0x45d13d(_0x18a8fe['error'](0x1f4,_0x3dc1de[_0x71a3('0x13')]));});});}; \ No newline at end of file +var _0x49db=['ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5ab3a8,_0x357688){var _0x4619de=function(_0x321ec2){while(--_0x321ec2){_0x5ab3a8['push'](_0x5ab3a8['shift']());}};_0x4619de(++_0x357688);}(_0x49db,0xc5));var _0xb49d=function(_0x57fb04,_0x55d3aa){_0x57fb04=_0x57fb04-0x0;var _0xfed3ff=_0x49db[_0x57fb04];return _0xfed3ff;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4180c8,_0x15f52f,_0x572ee4){return new BPromise(function(_0x12e114,_0x128caa){return client[_0xb49d('0xa')](_0x4180c8,_0x572ee4)[_0xb49d('0xb')](function(_0x3d4825){logger[_0xb49d('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x15f52f,'request\x20sent');logger[_0xb49d('0xd')](_0xb49d('0xe'),_0x15f52f,_0xb49d('0xf'),JSON[_0xb49d('0x10')](_0x3d4825));if(_0x3d4825[_0xb49d('0x11')]){if(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x12')]===0x1f4){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x3d4825['error'][_0xb49d('0x14')]);return _0x128caa(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);}logger[_0xb49d('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x15f52f,_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);return _0x12e114(_0x3d4825['error'][_0xb49d('0x14')]);}else{logger[_0xb49d('0xc')](_0xb49d('0x13'),_0x15f52f,_0xb49d('0xf'));_0x12e114(_0x3d4825[_0xb49d('0x15')][_0xb49d('0x14')]);}})[_0xb49d('0x16')](function(_0x584ade){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x584ade);_0x128caa(_0x584ade);});});}exports[_0xb49d('0x17')]=function(_0xf0bdff){var _0x4abce4=this;return new Promise(function(_0x4f3988,_0xfd7a95){return db[_0xb49d('0x18')][_0xb49d('0x19')]({'raw':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1b')]||null:null,'attributes':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1c')]||null:null,'limit':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1d')]||null:null,'include':_0xf0bdff[_0xb49d('0x1a')]?_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0xf0bdff[_0xb49d('0x1a')][_0xb49d('0x1e')],function(_0x2ccce8){return{'model':db[_0x2ccce8[_0xb49d('0x20')]],'as':_0x2ccce8['as'],'attributes':_0x2ccce8[_0xb49d('0x1c')],'include':_0x2ccce8[_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0x2ccce8[_0xb49d('0x1e')],function(_0x395c9f){return{'model':db[_0x395c9f['model']],'as':_0x395c9f['as'],'attributes':_0x395c9f[_0xb49d('0x1c')],'include':_0x395c9f['include']?_[_0xb49d('0x1f')](_0x395c9f[_0xb49d('0x1e')],function(_0x56163c){return{'model':db[_0x56163c[_0xb49d('0x20')]],'as':_0x56163c['as'],'attributes':_0x56163c[_0xb49d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb49d('0xb')](function(_0x3af956){logger[_0xb49d('0xc')](_0xb49d('0x17'),_0xf0bdff);logger['debug'](_0xb49d('0x17'),_0xf0bdff,JSON[_0xb49d('0x10')](_0x3af956));_0x4f3988(_0x3af956);})[_0xb49d('0x16')](function(_0x37901b){logger[_0xb49d('0x11')](_0xb49d('0x17'),_0x37901b[_0xb49d('0x14')],_0xf0bdff);_0xfd7a95(_0x4abce4['error'](0x1f4,_0x37901b[_0xb49d('0x14')]));});});};exports['ShowZohoAccount']=function(_0xf232e1){var _0x2fbcfa=this;return new Promise(function(_0x978e19,_0x1e66a6){return db[_0xb49d('0x18')][_0xb49d('0x21')]({'raw':_0xf232e1[_0xb49d('0x1a')]?_0xf232e1['options'][_0xb49d('0x22')]===undefined?!![]:![]:!![],'where':_0xf232e1[_0xb49d('0x1a')]?_0xf232e1[_0xb49d('0x1a')]['where']||null:null,'attributes':_0xf232e1['options']?_0xf232e1[_0xb49d('0x1a')][_0xb49d('0x1c')]||null:null,'include':_0xf232e1[_0xb49d('0x1a')]?_0xf232e1[_0xb49d('0x1a')][_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0xf232e1[_0xb49d('0x1a')][_0xb49d('0x1e')],function(_0x594dcb){return{'model':db[_0x594dcb['model']],'as':_0x594dcb['as'],'attributes':_0x594dcb[_0xb49d('0x1c')],'include':_0x594dcb['include']?_['map'](_0x594dcb['include'],function(_0x423399){return{'model':db[_0x423399[_0xb49d('0x20')]],'as':_0x423399['as'],'attributes':_0x423399[_0xb49d('0x1c')],'include':_0x423399[_0xb49d('0x1e')]?_[_0xb49d('0x1f')](_0x423399[_0xb49d('0x1e')],function(_0x52b44f){return{'model':db[_0x52b44f[_0xb49d('0x20')]],'as':_0x52b44f['as'],'attributes':_0x52b44f[_0xb49d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35ae2e){logger[_0xb49d('0xc')](_0xb49d('0x23'),_0xf232e1);logger['debug'](_0xb49d('0x23'),_0xf232e1,JSON[_0xb49d('0x10')](_0x35ae2e));_0x978e19(_0x35ae2e);})[_0xb49d('0x16')](function(_0x5671e6){logger[_0xb49d('0x11')]('ShowZohoAccount',_0x5671e6['message'],_0xf232e1);_0x1e66a6(_0x2fbcfa['error'](0x1f4,_0x5671e6['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9a0671f..3be3504 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 _0xc85f=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','show','isAuthenticated','getFields','getSubjects','/:id/descriptions','post','create','put'];(function(_0x536068,_0x3de52c){var _0x4a5db2=function(_0x1a8091){while(--_0x1a8091){_0x536068['push'](_0x536068['shift']());}};_0x4a5db2(++_0x3de52c);}(_0xc85f,0xc4));var _0xfc85=function(_0x9d9156,_0x4a4f39){_0x9d9156=_0x9d9156-0x0;var _0x59da79=_0xc85f[_0x9d9156];return _0x59da79;};'use strict';var multer=require(_0xfc85('0x0'));var util=require(_0xfc85('0x1'));var path=require(_0xfc85('0x2'));var timeout=require(_0xfc85('0x3'));var express=require(_0xfc85('0x4'));var router=express[_0xfc85('0x5')]();var fs_extra=require(_0xfc85('0x6'));var auth=require(_0xfc85('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfc85('0x8'));var controller=require(_0xfc85('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfc85('0xa')](_0xfc85('0xb'),auth['isAuthenticated'](),controller[_0xfc85('0xc')]);router[_0xfc85('0xa')]('/:id/fields',auth[_0xfc85('0xd')](),controller[_0xfc85('0xe')]);router['get']('/:id/subjects',auth[_0xfc85('0xd')](),controller[_0xfc85('0xf')]);router['get'](_0xfc85('0x10'),auth[_0xfc85('0xd')](),controller['getDescriptions']);router[_0xfc85('0x11')]('/',auth[_0xfc85('0xd')](),controller[_0xfc85('0x12')]);router[_0xfc85('0x13')](_0xfc85('0xb'),auth['isAuthenticated'](),controller[_0xfc85('0x14')]);router[_0xfc85('0x15')](_0xfc85('0xb'),auth[_0xfc85('0xd')](),controller[_0xfc85('0x16')]);module[_0xfc85('0x17')]=router; \ No newline at end of file +var _0x66be=['connect-timeout','express','Router','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','path'];(function(_0x115129,_0x2a9a04){var _0x186933=function(_0x4dc67e){while(--_0x4dc67e){_0x115129['push'](_0x115129['shift']());}};_0x186933(++_0x2a9a04);}(_0x66be,0xfb));var _0xe66b=function(_0x2a4ccc,_0x41fb7a){_0x2a4ccc=_0x2a4ccc-0x0;var _0x2ffee0=_0x66be[_0x2a4ccc];return _0x2ffee0;};'use strict';var multer=require(_0xe66b('0x0'));var util=require('util');var path=require(_0xe66b('0x1'));var timeout=require(_0xe66b('0x2'));var express=require(_0xe66b('0x3'));var router=express[_0xe66b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe66b('0x5'));var controller=require(_0xe66b('0x6'));router[_0xe66b('0x7')]('/',auth[_0xe66b('0x8')](),controller['index']);router[_0xe66b('0x7')](_0xe66b('0x9'),auth[_0xe66b('0x8')](),controller[_0xe66b('0xa')]);router[_0xe66b('0x7')](_0xe66b('0xb'),auth[_0xe66b('0x8')](),controller[_0xe66b('0xc')]);router[_0xe66b('0x7')](_0xe66b('0xd'),auth['isAuthenticated'](),controller[_0xe66b('0xe')]);router['get'](_0xe66b('0xf'),auth[_0xe66b('0x8')](),controller[_0xe66b('0x10')]);router[_0xe66b('0x11')]('/',auth['isAuthenticated'](),controller[_0xe66b('0x12')]);router[_0xe66b('0x13')](_0xe66b('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe66b('0x14')](_0xe66b('0x9'),auth[_0xe66b('0x8')](),controller[_0xe66b('0x15')]);module[_0xe66b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 97de04c..a35f52b 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 _0xec3f=['ENUM','lead','contact','contact_lead','sequelize','exports','STRING'];(function(_0x3483e5,_0x46eed9){var _0x3cd353=function(_0x2b69b7){while(--_0x2b69b7){_0x3483e5['push'](_0x3483e5['shift']());}};_0x3cd353(++_0x46eed9);}(_0xec3f,0x1ee));var _0xfec3=function(_0xace075,_0x4745ca){_0xace075=_0xace075-0x0;var _0x4720d3=_0xec3f[_0xace075];return _0x4720d3;};'use strict';var Sequelize=require(_0xfec3('0x0'));module[_0xfec3('0x1')]={'name':{'type':Sequelize[_0xfec3('0x2')]},'moduleCreate':{'type':Sequelize[_0xfec3('0x3')](_0xfec3('0x4'),_0xfec3('0x5'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xfec3('0x3')](_0xfec3('0x6'),_0xfec3('0x5'),_0xfec3('0x4')),'defaultValue':_0xfec3('0x6')},'description':{'type':Sequelize[_0xfec3('0x2')]}}; \ No newline at end of file +var _0x3376=['contact_lead','lead','exports','STRING','ENUM'];(function(_0x247902,_0x26d9ca){var _0x4f8697=function(_0x4d2dec){while(--_0x4d2dec){_0x247902['push'](_0x247902['shift']());}};_0x4f8697(++_0x26d9ca);}(_0x3376,0x1dd));var _0x6337=function(_0x54231c,_0x472e07){_0x54231c=_0x54231c-0x0;var _0x5cb33f=_0x3376[_0x54231c];return _0x5cb33f;};'use strict';var Sequelize=require('sequelize');module[_0x6337('0x0')]={'name':{'type':Sequelize[_0x6337('0x1')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x6337('0x2')](_0x6337('0x3'),'contact',_0x6337('0x4')),'defaultValue':_0x6337('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index e03e491..5cc5570 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 _0x3755=['body','params','destroy','getFields','findOne','ZohoField','options','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','Content-Range','json','apply','reject','update','then','end','error','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZohoConfiguration','include','findAll','rows','catch','rawAttributes','length','includeAll','find','create'];(function(_0xc8bcf9,_0x30b65e){var _0x460138=function(_0x35f431){while(--_0x35f431){_0xc8bcf9['push'](_0xc8bcf9['shift']());}};_0x460138(++_0x30b65e);}(_0x3755,0x199));var _0x5375=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3755[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x5375('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5375('0x1'));var rp=require(_0x5375('0x2'));var moment=require(_0x5375('0x3'));var BPromise=require(_0x5375('0x4'));var Mustache=require(_0x5375('0x5'));var util=require(_0x5375('0x6'));var path=require(_0x5375('0x7'));var sox=require(_0x5375('0x8'));var csv=require(_0x5375('0x9'));var ejs=require(_0x5375('0xa'));var fs=require('fs');var fs_extra=require(_0x5375('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5375('0xc'));var jsforce=require(_0x5375('0xd'));var deskjs=require(_0x5375('0xe'));var toCsv=require(_0x5375('0x9'));var querystring=require(_0x5375('0xf'));var Papa=require(_0x5375('0x10'));var Redis=require('ioredis');var authService=require(_0x5375('0x11'));var qs=require(_0x5375('0x12'));var as=require(_0x5375('0x13'));var hardwareService=require(_0x5375('0x14'));var logger=require(_0x5375('0x15'))(_0x5375('0x16'));var utils=require('../../config/utils');var config=require(_0x5375('0x17'));var licenseUtil=require(_0x5375('0x18'));var db=require(_0x5375('0x19'))['db'];function respondWithStatusCode(_0x374057,_0x17e2f6){_0x17e2f6=_0x17e2f6||0xcc;return function(_0x23b89d){if(_0x23b89d){return _0x374057['sendStatus'](_0x17e2f6);}return _0x374057[_0x5375('0x1a')](_0x17e2f6)['end']();};}function respondWithResult(_0x311005,_0x2faed1){_0x2faed1=_0x2faed1||0xc8;return function(_0x29bbba){if(_0x29bbba){return _0x311005[_0x5375('0x1a')](_0x2faed1)['json'](_0x29bbba);}};}function respondWithFilteredResult(_0x3ef8d6,_0x55b9f7){return function(_0x118152){if(_0x118152){var _0x428454=typeof _0x55b9f7[_0x5375('0x1b')]==='undefined'&&typeof _0x55b9f7[_0x5375('0x1c')]===_0x5375('0x1d');var _0xb1a425=_0x118152[_0x5375('0x1e')];var _0x2789a7=_0x428454?0x0:_0x55b9f7[_0x5375('0x1b')];var _0x5d36c0=_0x428454?_0x118152[_0x5375('0x1e')]:_0x55b9f7['offset']+_0x55b9f7[_0x5375('0x1c')];var _0x4d1aef;if(_0x5d36c0>=_0xb1a425){_0x5d36c0=_0xb1a425;_0x4d1aef=0xc8;}else{_0x4d1aef=0xce;}_0x3ef8d6['status'](_0x4d1aef);return _0x3ef8d6['set'](_0x5375('0x1f'),_0x2789a7+'-'+_0x5d36c0+'/'+_0xb1a425)[_0x5375('0x20')](_0x118152);}return null;};}function patchUpdates(_0x22a866){return function(_0x296fff){try{jsonpatch[_0x5375('0x21')](_0x296fff,_0x22a866,!![]);}catch(_0x3df66c){return BPromise[_0x5375('0x22')](_0x3df66c);}return _0x296fff['save']();};}function saveUpdates(_0x33b8fe,_0x240561){return function(_0x4de05b){if(_0x4de05b){return _0x4de05b[_0x5375('0x23')](_0x33b8fe)[_0x5375('0x24')](function(_0x2253ec){return _0x2253ec;});}return null;};}function removeEntity(_0x18b7d8,_0x113690){return function(_0x486790){if(_0x486790){return _0x486790['destroy']()[_0x5375('0x24')](function(){_0x18b7d8[_0x5375('0x1a')](0xcc)[_0x5375('0x25')]();});}};}function handleEntityNotFound(_0x3cdc30,_0x2fb180){return function(_0x24bda8){if(!_0x24bda8){_0x3cdc30['sendStatus'](0x194);}return _0x24bda8;};}function handleError(_0x28a0b7,_0x8c1198){_0x8c1198=_0x8c1198||0x1f4;return function(_0x1d5a0f){logger[_0x5375('0x26')](_0x1d5a0f['stack']);if(_0x1d5a0f[_0x5375('0x27')]){delete _0x1d5a0f[_0x5375('0x27')];}_0x28a0b7[_0x5375('0x1a')](_0x8c1198)['send'](_0x1d5a0f);};}exports[_0x5375('0x28')]=function(_0x364504,_0x22ac8b){var _0x441478={},_0x5f1110={},_0x32dac7={'count':0x0,'rows':[]};var _0x35b662=_[_0x5375('0x29')](db['ZohoConfiguration']['rawAttributes'],function(_0x4c4e30){return{'name':_0x4c4e30[_0x5375('0x2a')],'type':_0x4c4e30[_0x5375('0x2b')][_0x5375('0x2c')]};});_0x5f1110[_0x5375('0x2d')]=_['map'](_0x35b662,'name');_0x5f1110[_0x5375('0x2e')]=_[_0x5375('0x2f')](_0x364504[_0x5375('0x2e')]);_0x5f1110[_0x5375('0x30')]=_['intersection'](_0x5f1110[_0x5375('0x2d')],_0x5f1110[_0x5375('0x2e')]);_0x441478[_0x5375('0x31')]=_[_0x5375('0x32')](_0x5f1110[_0x5375('0x2d')],qs[_0x5375('0x33')](_0x364504[_0x5375('0x2e')][_0x5375('0x33')]));_0x441478['attributes']=_0x441478[_0x5375('0x31')]['length']?_0x441478['attributes']:_0x5f1110[_0x5375('0x2d')];if(!_0x364504[_0x5375('0x2e')][_0x5375('0x34')](_0x5375('0x35'))){_0x441478['limit']=qs[_0x5375('0x1c')](_0x364504[_0x5375('0x2e')][_0x5375('0x1c')]);_0x441478['offset']=qs[_0x5375('0x1b')](_0x364504['query'][_0x5375('0x1b')]);}_0x441478[_0x5375('0x36')]=qs[_0x5375('0x37')](_0x364504['query'][_0x5375('0x37')]);_0x441478[_0x5375('0x38')]=qs[_0x5375('0x30')](_[_0x5375('0x39')](_0x364504[_0x5375('0x2e')],_0x5f1110[_0x5375('0x30')]),_0x35b662);if(_0x364504[_0x5375('0x2e')][_0x5375('0x3a')]){_0x441478[_0x5375('0x38')]=_[_0x5375('0x3b')](_0x441478['where'],{'$or':_[_0x5375('0x29')](_0x35b662,function(_0x38223c){if(_0x38223c[_0x5375('0x2b')]!==_0x5375('0x3c')){var _0x8bc698={};_0x8bc698[_0x38223c[_0x5375('0x27')]]={'$like':'%'+_0x364504[_0x5375('0x2e')][_0x5375('0x3a')]+'%'};return _0x8bc698;}})});}_0x441478=_[_0x5375('0x3b')]({},_0x441478,_0x364504['options']);var _0x342dbe={'where':_0x441478[_0x5375('0x38')]};return db[_0x5375('0x3d')]['count'](_0x342dbe)[_0x5375('0x24')](function(_0x5d25ec){_0x32dac7[_0x5375('0x1e')]=_0x5d25ec;if(_0x364504[_0x5375('0x2e')]['includeAll']){_0x441478[_0x5375('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x5375('0x3f')](_0x441478);})[_0x5375('0x24')](function(_0x2aaff0){_0x32dac7[_0x5375('0x40')]=_0x2aaff0;return _0x32dac7;})[_0x5375('0x24')](respondWithFilteredResult(_0x22ac8b,_0x441478))[_0x5375('0x41')](handleError(_0x22ac8b,null));};exports['show']=function(_0x55be47,_0x103533){var _0x5bc214={'raw':![],'where':{'id':_0x55be47['params']['id']}},_0x3caebf={};_0x3caebf[_0x5375('0x2d')]=_[_0x5375('0x2f')](db[_0x5375('0x3d')][_0x5375('0x42')]);_0x3caebf[_0x5375('0x2e')]=_[_0x5375('0x2f')](_0x55be47[_0x5375('0x2e')]);_0x3caebf[_0x5375('0x30')]=_[_0x5375('0x32')](_0x3caebf['model'],_0x3caebf[_0x5375('0x2e')]);_0x5bc214[_0x5375('0x31')]=_[_0x5375('0x32')](_0x3caebf['model'],qs[_0x5375('0x33')](_0x55be47[_0x5375('0x2e')][_0x5375('0x33')]));_0x5bc214['attributes']=_0x5bc214[_0x5375('0x31')][_0x5375('0x43')]?_0x5bc214[_0x5375('0x31')]:_0x3caebf['model'];if(_0x55be47['query'][_0x5375('0x44')]){_0x5bc214['include']=[{'all':!![]}];}_0x5bc214=_['merge']({},_0x5bc214,_0x55be47['options']);return db[_0x5375('0x3d')][_0x5375('0x45')](_0x5bc214)['then'](handleEntityNotFound(_0x103533,null))[_0x5375('0x24')](respondWithResult(_0x103533,null))[_0x5375('0x41')](handleError(_0x103533,null));};exports[_0x5375('0x46')]=function(_0x165ff1,_0x124fa8){return db[_0x5375('0x3d')][_0x5375('0x46')](_0x165ff1[_0x5375('0x47')],{})[_0x5375('0x24')](respondWithResult(_0x124fa8,0xc9))[_0x5375('0x41')](handleError(_0x124fa8,null));};exports['update']=function(_0x623e20,_0x3bc045){if(_0x623e20['body']['id']){delete _0x623e20[_0x5375('0x47')]['id'];}return db['ZohoConfiguration'][_0x5375('0x45')]({'where':{'id':_0x623e20[_0x5375('0x48')]['id']}})[_0x5375('0x24')](handleEntityNotFound(_0x3bc045,null))[_0x5375('0x24')](saveUpdates(_0x623e20['body'],null))[_0x5375('0x24')](respondWithResult(_0x3bc045,null))[_0x5375('0x41')](handleError(_0x3bc045,null));};exports[_0x5375('0x49')]=function(_0x186175,_0x22e085){return db[_0x5375('0x3d')][_0x5375('0x45')]({'where':{'id':_0x186175[_0x5375('0x48')]['id']}})[_0x5375('0x24')](handleEntityNotFound(_0x22e085,null))['then'](removeEntity(_0x22e085,null))[_0x5375('0x41')](handleError(_0x22e085,null));};exports[_0x5375('0x4a')]=function(_0x52ace3,_0x57a3e2,_0x469e21){var _0x49d6df={};var _0x508925={};var _0xadb77d;var _0xa0925c;return db[_0x5375('0x3d')][_0x5375('0x4b')]({'where':{'id':_0x52ace3['params']['id']}})[_0x5375('0x24')](handleEntityNotFound(_0x57a3e2,null))['then'](function(_0x414f84){if(_0x414f84){_0xadb77d=_0x414f84;_0x508925[_0x5375('0x2d')]=_['keys'](db[_0x5375('0x4c')]['rawAttributes']);_0x508925[_0x5375('0x2e')]=_[_0x5375('0x2f')](_0x52ace3[_0x5375('0x2e')]);_0x508925['filters']=_[_0x5375('0x32')](_0x508925[_0x5375('0x2d')],_0x508925[_0x5375('0x2e')]);_0x49d6df[_0x5375('0x31')]=_[_0x5375('0x32')](_0x508925[_0x5375('0x2d')],qs[_0x5375('0x33')](_0x52ace3['query'][_0x5375('0x33')]));_0x49d6df[_0x5375('0x31')]=_0x49d6df[_0x5375('0x31')][_0x5375('0x43')]?_0x49d6df['attributes']:_0x508925[_0x5375('0x2d')];_0x49d6df[_0x5375('0x36')]=qs['sort'](_0x52ace3[_0x5375('0x2e')]['sort']);_0x49d6df[_0x5375('0x38')]=qs[_0x5375('0x30')](_[_0x5375('0x39')](_0x52ace3[_0x5375('0x2e')],_0x508925[_0x5375('0x30')]));if(_0x52ace3[_0x5375('0x2e')]['filter']){_0x49d6df[_0x5375('0x38')]=_[_0x5375('0x3b')](_0x49d6df[_0x5375('0x38')],{'$or':_[_0x5375('0x29')](_0x49d6df[_0x5375('0x31')],function(_0x3058ee){var _0x5257d5={};_0x5257d5[_0x3058ee]={'$like':'%'+_0x52ace3[_0x5375('0x2e')][_0x5375('0x3a')]+'%'};return _0x5257d5;})});}_0x49d6df=_[_0x5375('0x3b')]({},_0x49d6df,_0x52ace3[_0x5375('0x4d')]);return _0xadb77d[_0x5375('0x4a')](_0x49d6df);}})[_0x5375('0x24')](function(_0xc4d92c){if(_0xc4d92c){_0xa0925c=_0xc4d92c[_0x5375('0x43')];if(!_0x52ace3[_0x5375('0x2e')][_0x5375('0x34')](_0x5375('0x35'))){_0x49d6df[_0x5375('0x1c')]=qs[_0x5375('0x1c')](_0x52ace3[_0x5375('0x2e')][_0x5375('0x1c')]);_0x49d6df['offset']=qs[_0x5375('0x1b')](_0x52ace3[_0x5375('0x2e')][_0x5375('0x1b')]);}return _0xadb77d[_0x5375('0x4a')](_0x49d6df);}})['then'](function(_0x59bb3d){if(_0x59bb3d){return _0x59bb3d?{'count':_0xa0925c,'rows':_0x59bb3d}:null;}})[_0x5375('0x24')](respondWithResult(_0x57a3e2,null))[_0x5375('0x41')](handleError(_0x57a3e2,null));};exports['getSubjects']=function(_0x433798,_0x48228e,_0x248c88){var _0x4a8e93={};var _0x5966dd={};var _0x9e707;var _0x3dc3f7;return db[_0x5375('0x3d')]['findOne']({'where':{'id':_0x433798[_0x5375('0x48')]['id']}})[_0x5375('0x24')](handleEntityNotFound(_0x48228e,null))['then'](function(_0x22089a){if(_0x22089a){_0x9e707=_0x22089a;_0x5966dd[_0x5375('0x2d')]=_[_0x5375('0x2f')](db['ZohoField'][_0x5375('0x42')]);_0x5966dd[_0x5375('0x2e')]=_[_0x5375('0x2f')](_0x433798['query']);_0x5966dd['filters']=_['intersection'](_0x5966dd['model'],_0x5966dd['query']);_0x4a8e93['attributes']=_[_0x5375('0x32')](_0x5966dd[_0x5375('0x2d')],qs[_0x5375('0x33')](_0x433798[_0x5375('0x2e')][_0x5375('0x33')]));_0x4a8e93[_0x5375('0x31')]=_0x4a8e93[_0x5375('0x31')][_0x5375('0x43')]?_0x4a8e93['attributes']:_0x5966dd[_0x5375('0x2d')];_0x4a8e93[_0x5375('0x36')]=qs['sort'](_0x433798['query'][_0x5375('0x37')]);_0x4a8e93[_0x5375('0x38')]=qs['filters'](_[_0x5375('0x39')](_0x433798['query'],_0x5966dd[_0x5375('0x30')]));if(_0x433798[_0x5375('0x2e')][_0x5375('0x3a')]){_0x4a8e93[_0x5375('0x38')]=_['merge'](_0x4a8e93['where'],{'$or':_[_0x5375('0x29')](_0x4a8e93[_0x5375('0x31')],function(_0xfc642d){var _0x24c097={};_0x24c097[_0xfc642d]={'$like':'%'+_0x433798[_0x5375('0x2e')][_0x5375('0x3a')]+'%'};return _0x24c097;})});}_0x4a8e93=_[_0x5375('0x3b')]({},_0x4a8e93,_0x433798['options']);return _0x9e707[_0x5375('0x4e')](_0x4a8e93);}})['then'](function(_0x508f14){if(_0x508f14){_0x3dc3f7=_0x508f14[_0x5375('0x43')];if(!_0x433798[_0x5375('0x2e')][_0x5375('0x34')](_0x5375('0x35'))){_0x4a8e93[_0x5375('0x1c')]=qs[_0x5375('0x1c')](_0x433798[_0x5375('0x2e')][_0x5375('0x1c')]);_0x4a8e93[_0x5375('0x1b')]=qs[_0x5375('0x1b')](_0x433798['query']['offset']);}return _0x9e707[_0x5375('0x4e')](_0x4a8e93);}})[_0x5375('0x24')](function(_0x2d79be){if(_0x2d79be){return _0x2d79be?{'count':_0x3dc3f7,'rows':_0x2d79be}:null;}})[_0x5375('0x24')](respondWithResult(_0x48228e,null))['catch'](handleError(_0x48228e,null));};exports['getDescriptions']=function(_0xd41fdb,_0x2cbb90,_0x3bddb1){var _0x8e13f4={};var _0x3e2273={};var _0x25e41a;var _0x26c75a;return db[_0x5375('0x3d')][_0x5375('0x4b')]({'where':{'id':_0xd41fdb[_0x5375('0x48')]['id']}})['then'](handleEntityNotFound(_0x2cbb90,null))[_0x5375('0x24')](function(_0x568c45){if(_0x568c45){_0x25e41a=_0x568c45;_0x3e2273[_0x5375('0x2d')]=_[_0x5375('0x2f')](db[_0x5375('0x4c')][_0x5375('0x42')]);_0x3e2273[_0x5375('0x2e')]=_[_0x5375('0x2f')](_0xd41fdb[_0x5375('0x2e')]);_0x3e2273[_0x5375('0x30')]=_[_0x5375('0x32')](_0x3e2273[_0x5375('0x2d')],_0x3e2273[_0x5375('0x2e')]);_0x8e13f4[_0x5375('0x31')]=_[_0x5375('0x32')](_0x3e2273[_0x5375('0x2d')],qs[_0x5375('0x33')](_0xd41fdb['query']['fields']));_0x8e13f4['attributes']=_0x8e13f4['attributes'][_0x5375('0x43')]?_0x8e13f4[_0x5375('0x31')]:_0x3e2273[_0x5375('0x2d')];_0x8e13f4[_0x5375('0x36')]=qs[_0x5375('0x37')](_0xd41fdb[_0x5375('0x2e')][_0x5375('0x37')]);_0x8e13f4[_0x5375('0x38')]=qs[_0x5375('0x30')](_[_0x5375('0x39')](_0xd41fdb[_0x5375('0x2e')],_0x3e2273[_0x5375('0x30')]));if(_0xd41fdb[_0x5375('0x2e')]['filter']){_0x8e13f4[_0x5375('0x38')]=_[_0x5375('0x3b')](_0x8e13f4[_0x5375('0x38')],{'$or':_['map'](_0x8e13f4['attributes'],function(_0x3d76a7){var _0x16f19d={};_0x16f19d[_0x3d76a7]={'$like':'%'+_0xd41fdb[_0x5375('0x2e')][_0x5375('0x3a')]+'%'};return _0x16f19d;})});}_0x8e13f4=_[_0x5375('0x3b')]({},_0x8e13f4,_0xd41fdb[_0x5375('0x4d')]);return _0x25e41a[_0x5375('0x4f')](_0x8e13f4);}})['then'](function(_0x187027){if(_0x187027){_0x26c75a=_0x187027['length'];if(!_0xd41fdb['query'][_0x5375('0x34')]('nolimit')){_0x8e13f4['limit']=qs[_0x5375('0x1c')](_0xd41fdb[_0x5375('0x2e')][_0x5375('0x1c')]);_0x8e13f4['offset']=qs[_0x5375('0x1b')](_0xd41fdb[_0x5375('0x2e')][_0x5375('0x1b')]);}return _0x25e41a[_0x5375('0x4f')](_0x8e13f4);}})[_0x5375('0x24')](function(_0x222250){if(_0x222250){return _0x222250?{'count':_0x26c75a,'rows':_0x222250}:null;}})[_0x5375('0x24')](respondWithResult(_0x2cbb90,null))[_0x5375('0x41')](handleError(_0x2cbb90,null));}; \ No newline at end of file +var _0xdfdc=['params','find','catch','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','ZohoConfiguration','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show'];(function(_0x2d4333,_0x2638cb){var _0x27f48d=function(_0x538de8){while(--_0x538de8){_0x2d4333['push'](_0x2d4333['shift']());}};_0x27f48d(++_0x2638cb);}(_0xdfdc,0x1de));var _0xcdfd=function(_0x15fc73,_0x3477c7){_0x15fc73=_0x15fc73-0x0;var _0x5be08c=_0xdfdc[_0x15fc73];return _0x5be08c;};'use strict';var emlformat=require(_0xcdfd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdfd('0x1'));var jsonpatch=require(_0xcdfd('0x2'));var rp=require(_0xcdfd('0x3'));var moment=require(_0xcdfd('0x4'));var BPromise=require(_0xcdfd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcdfd('0x6'));var sox=require(_0xcdfd('0x7'));var csv=require(_0xcdfd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcdfd('0x9'));var squel=require(_0xcdfd('0xa'));var crypto=require('crypto');var jsforce=require(_0xcdfd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcdfd('0x8'));var querystring=require(_0xcdfd('0xc'));var Papa=require(_0xcdfd('0xd'));var Redis=require(_0xcdfd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcdfd('0xf'));var as=require(_0xcdfd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdfd('0x11'))(_0xcdfd('0x12'));var utils=require(_0xcdfd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xcdfd('0x14'));var db=require(_0xcdfd('0x15'))['db'];function respondWithStatusCode(_0x3d4c8f,_0x3db737){_0x3db737=_0x3db737||0xcc;return function(_0x29be8e){if(_0x29be8e){return _0x3d4c8f['sendStatus'](_0x3db737);}return _0x3d4c8f[_0xcdfd('0x16')](_0x3db737)[_0xcdfd('0x17')]();};}function respondWithResult(_0x259d90,_0x51c15c){_0x51c15c=_0x51c15c||0xc8;return function(_0x1cccac){if(_0x1cccac){return _0x259d90['status'](_0x51c15c)[_0xcdfd('0x18')](_0x1cccac);}};}function respondWithFilteredResult(_0xdaa3de,_0xe73e8e){return function(_0x5cfb71){if(_0x5cfb71){var _0x5e3e15=typeof _0xe73e8e[_0xcdfd('0x19')]===_0xcdfd('0x1a')&&typeof _0xe73e8e['limit']===_0xcdfd('0x1a');var _0x3f9804=_0x5cfb71[_0xcdfd('0x1b')];var _0x50499a=_0x5e3e15?0x0:_0xe73e8e['offset'];var _0x103b6c=_0x5e3e15?_0x5cfb71[_0xcdfd('0x1b')]:_0xe73e8e['offset']+_0xe73e8e[_0xcdfd('0x1c')];var _0x352bce;if(_0x103b6c>=_0x3f9804){_0x103b6c=_0x3f9804;_0x352bce=0xc8;}else{_0x352bce=0xce;}_0xdaa3de[_0xcdfd('0x16')](_0x352bce);return _0xdaa3de[_0xcdfd('0x1d')](_0xcdfd('0x1e'),_0x50499a+'-'+_0x103b6c+'/'+_0x3f9804)['json'](_0x5cfb71);}return null;};}function patchUpdates(_0x25a343){return function(_0x28cbee){try{jsonpatch['apply'](_0x28cbee,_0x25a343,!![]);}catch(_0x3a73cd){return BPromise[_0xcdfd('0x1f')](_0x3a73cd);}return _0x28cbee[_0xcdfd('0x20')]();};}function saveUpdates(_0x3a979e,_0x48ac47){return function(_0x190da5){if(_0x190da5){return _0x190da5[_0xcdfd('0x21')](_0x3a979e)[_0xcdfd('0x22')](function(_0x1b3510){return _0x1b3510;});}return null;};}function removeEntity(_0x4f7c21,_0x44a9dc){return function(_0x3835eb){if(_0x3835eb){return _0x3835eb[_0xcdfd('0x23')]()[_0xcdfd('0x22')](function(){_0x4f7c21[_0xcdfd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2da046,_0xd93ec8){return function(_0x2e17ca){if(!_0x2e17ca){_0x2da046[_0xcdfd('0x24')](0x194);}return _0x2e17ca;};}function handleError(_0x3404e2,_0xf0d064){_0xf0d064=_0xf0d064||0x1f4;return function(_0x5da2d5){logger[_0xcdfd('0x25')](_0x5da2d5['stack']);if(_0x5da2d5[_0xcdfd('0x26')]){delete _0x5da2d5[_0xcdfd('0x26')];}_0x3404e2['status'](_0xf0d064)[_0xcdfd('0x27')](_0x5da2d5);};}exports[_0xcdfd('0x28')]=function(_0x5cdb37,_0x487495){var _0x3f3d2d={},_0x755bca={},_0x4aa238={'count':0x0,'rows':[]};var _0x4a8e6f=_['map'](db[_0xcdfd('0x29')][_0xcdfd('0x2a')],function(_0x532833){return{'name':_0x532833[_0xcdfd('0x2b')],'type':_0x532833['type']['key']};});_0x755bca[_0xcdfd('0x2c')]=_[_0xcdfd('0x2d')](_0x4a8e6f,_0xcdfd('0x26'));_0x755bca[_0xcdfd('0x2e')]=_[_0xcdfd('0x2f')](_0x5cdb37[_0xcdfd('0x2e')]);_0x755bca[_0xcdfd('0x30')]=_[_0xcdfd('0x31')](_0x755bca[_0xcdfd('0x2c')],_0x755bca[_0xcdfd('0x2e')]);_0x3f3d2d[_0xcdfd('0x32')]=_[_0xcdfd('0x31')](_0x755bca[_0xcdfd('0x2c')],qs[_0xcdfd('0x33')](_0x5cdb37[_0xcdfd('0x2e')]['fields']));_0x3f3d2d[_0xcdfd('0x32')]=_0x3f3d2d[_0xcdfd('0x32')][_0xcdfd('0x34')]?_0x3f3d2d[_0xcdfd('0x32')]:_0x755bca[_0xcdfd('0x2c')];if(!_0x5cdb37[_0xcdfd('0x2e')][_0xcdfd('0x35')](_0xcdfd('0x36'))){_0x3f3d2d['limit']=qs[_0xcdfd('0x1c')](_0x5cdb37[_0xcdfd('0x2e')][_0xcdfd('0x1c')]);_0x3f3d2d[_0xcdfd('0x19')]=qs['offset'](_0x5cdb37[_0xcdfd('0x2e')][_0xcdfd('0x19')]);}_0x3f3d2d[_0xcdfd('0x37')]=qs[_0xcdfd('0x38')](_0x5cdb37[_0xcdfd('0x2e')]['sort']);_0x3f3d2d['where']=qs[_0xcdfd('0x30')](_[_0xcdfd('0x39')](_0x5cdb37[_0xcdfd('0x2e')],_0x755bca['filters']),_0x4a8e6f);if(_0x5cdb37[_0xcdfd('0x2e')][_0xcdfd('0x3a')]){_0x3f3d2d[_0xcdfd('0x3b')]=_[_0xcdfd('0x3c')](_0x3f3d2d[_0xcdfd('0x3b')],{'$or':_['map'](_0x4a8e6f,function(_0x24fcf7){if(_0x24fcf7[_0xcdfd('0x3d')]!=='VIRTUAL'){var _0x450491={};_0x450491[_0x24fcf7['name']]={'$like':'%'+_0x5cdb37[_0xcdfd('0x2e')]['filter']+'%'};return _0x450491;}})});}_0x3f3d2d=_[_0xcdfd('0x3c')]({},_0x3f3d2d,_0x5cdb37[_0xcdfd('0x3e')]);var _0x222223={'where':_0x3f3d2d[_0xcdfd('0x3b')]};return db[_0xcdfd('0x29')][_0xcdfd('0x1b')](_0x222223)[_0xcdfd('0x22')](function(_0x362a38){_0x4aa238[_0xcdfd('0x1b')]=_0x362a38;if(_0x5cdb37[_0xcdfd('0x2e')][_0xcdfd('0x3f')]){_0x3f3d2d[_0xcdfd('0x40')]=[{'all':!![]}];}return db[_0xcdfd('0x29')][_0xcdfd('0x41')](_0x3f3d2d);})[_0xcdfd('0x22')](function(_0xcad081){_0x4aa238[_0xcdfd('0x42')]=_0xcad081;return _0x4aa238;})[_0xcdfd('0x22')](respondWithFilteredResult(_0x487495,_0x3f3d2d))['catch'](handleError(_0x487495,null));};exports[_0xcdfd('0x43')]=function(_0x1a2b4c,_0x12d81d){var _0x519bf8={'raw':![],'where':{'id':_0x1a2b4c[_0xcdfd('0x44')]['id']}},_0x5f3d30={};_0x5f3d30[_0xcdfd('0x2c')]=_['keys'](db[_0xcdfd('0x29')][_0xcdfd('0x2a')]);_0x5f3d30[_0xcdfd('0x2e')]=_['keys'](_0x1a2b4c['query']);_0x5f3d30[_0xcdfd('0x30')]=_[_0xcdfd('0x31')](_0x5f3d30[_0xcdfd('0x2c')],_0x5f3d30[_0xcdfd('0x2e')]);_0x519bf8[_0xcdfd('0x32')]=_[_0xcdfd('0x31')](_0x5f3d30[_0xcdfd('0x2c')],qs[_0xcdfd('0x33')](_0x1a2b4c['query'][_0xcdfd('0x33')]));_0x519bf8[_0xcdfd('0x32')]=_0x519bf8[_0xcdfd('0x32')][_0xcdfd('0x34')]?_0x519bf8[_0xcdfd('0x32')]:_0x5f3d30[_0xcdfd('0x2c')];if(_0x1a2b4c[_0xcdfd('0x2e')][_0xcdfd('0x3f')]){_0x519bf8['include']=[{'all':!![]}];}_0x519bf8=_[_0xcdfd('0x3c')]({},_0x519bf8,_0x1a2b4c['options']);return db['ZohoConfiguration'][_0xcdfd('0x45')](_0x519bf8)[_0xcdfd('0x22')](handleEntityNotFound(_0x12d81d,null))[_0xcdfd('0x22')](respondWithResult(_0x12d81d,null))[_0xcdfd('0x46')](handleError(_0x12d81d,null));};exports[_0xcdfd('0x47')]=function(_0x3c3181,_0x607286){return db[_0xcdfd('0x29')]['create'](_0x3c3181['body'],{})['then'](respondWithResult(_0x607286,0xc9))[_0xcdfd('0x46')](handleError(_0x607286,null));};exports['update']=function(_0x41d617,_0x29da93){if(_0x41d617[_0xcdfd('0x48')]['id']){delete _0x41d617[_0xcdfd('0x48')]['id'];}return db[_0xcdfd('0x29')]['find']({'where':{'id':_0x41d617[_0xcdfd('0x44')]['id']}})[_0xcdfd('0x22')](handleEntityNotFound(_0x29da93,null))[_0xcdfd('0x22')](saveUpdates(_0x41d617[_0xcdfd('0x48')],null))[_0xcdfd('0x22')](respondWithResult(_0x29da93,null))[_0xcdfd('0x46')](handleError(_0x29da93,null));};exports[_0xcdfd('0x23')]=function(_0x2768aa,_0x4b782a){return db[_0xcdfd('0x29')][_0xcdfd('0x45')]({'where':{'id':_0x2768aa[_0xcdfd('0x44')]['id']}})[_0xcdfd('0x22')](handleEntityNotFound(_0x4b782a,null))[_0xcdfd('0x22')](removeEntity(_0x4b782a,null))[_0xcdfd('0x46')](handleError(_0x4b782a,null));};exports[_0xcdfd('0x49')]=function(_0x115490,_0x229131,_0x32b8cd){var _0x4c15e7={};var _0x2905f2={};var _0x30e9ac;var _0x5a9c4a;return db[_0xcdfd('0x29')][_0xcdfd('0x4a')]({'where':{'id':_0x115490[_0xcdfd('0x44')]['id']}})['then'](handleEntityNotFound(_0x229131,null))[_0xcdfd('0x22')](function(_0x23d408){if(_0x23d408){_0x30e9ac=_0x23d408;_0x2905f2[_0xcdfd('0x2c')]=_[_0xcdfd('0x2f')](db[_0xcdfd('0x4b')][_0xcdfd('0x2a')]);_0x2905f2['query']=_['keys'](_0x115490[_0xcdfd('0x2e')]);_0x2905f2[_0xcdfd('0x30')]=_[_0xcdfd('0x31')](_0x2905f2[_0xcdfd('0x2c')],_0x2905f2[_0xcdfd('0x2e')]);_0x4c15e7[_0xcdfd('0x32')]=_[_0xcdfd('0x31')](_0x2905f2['model'],qs[_0xcdfd('0x33')](_0x115490[_0xcdfd('0x2e')][_0xcdfd('0x33')]));_0x4c15e7[_0xcdfd('0x32')]=_0x4c15e7[_0xcdfd('0x32')]['length']?_0x4c15e7[_0xcdfd('0x32')]:_0x2905f2[_0xcdfd('0x2c')];_0x4c15e7[_0xcdfd('0x37')]=qs[_0xcdfd('0x38')](_0x115490[_0xcdfd('0x2e')][_0xcdfd('0x38')]);_0x4c15e7[_0xcdfd('0x3b')]=qs['filters'](_['pick'](_0x115490[_0xcdfd('0x2e')],_0x2905f2[_0xcdfd('0x30')]));if(_0x115490[_0xcdfd('0x2e')][_0xcdfd('0x3a')]){_0x4c15e7[_0xcdfd('0x3b')]=_[_0xcdfd('0x3c')](_0x4c15e7[_0xcdfd('0x3b')],{'$or':_[_0xcdfd('0x2d')](_0x4c15e7[_0xcdfd('0x32')],function(_0x2ada72){var _0x3a3123={};_0x3a3123[_0x2ada72]={'$like':'%'+_0x115490[_0xcdfd('0x2e')][_0xcdfd('0x3a')]+'%'};return _0x3a3123;})});}_0x4c15e7=_[_0xcdfd('0x3c')]({},_0x4c15e7,_0x115490['options']);return _0x30e9ac['getFields'](_0x4c15e7);}})[_0xcdfd('0x22')](function(_0x37b33c){if(_0x37b33c){_0x5a9c4a=_0x37b33c['length'];if(!_0x115490[_0xcdfd('0x2e')][_0xcdfd('0x35')](_0xcdfd('0x36'))){_0x4c15e7['limit']=qs[_0xcdfd('0x1c')](_0x115490[_0xcdfd('0x2e')]['limit']);_0x4c15e7[_0xcdfd('0x19')]=qs[_0xcdfd('0x19')](_0x115490['query'][_0xcdfd('0x19')]);}return _0x30e9ac['getFields'](_0x4c15e7);}})[_0xcdfd('0x22')](function(_0x3583f7){if(_0x3583f7){return _0x3583f7?{'count':_0x5a9c4a,'rows':_0x3583f7}:null;}})['then'](respondWithResult(_0x229131,null))['catch'](handleError(_0x229131,null));};exports['getSubjects']=function(_0x16ed9e,_0x1a88e1,_0x130ae0){var _0x1d1d85={};var _0x5e1a06={};var _0x595954;var _0x42171d;return db[_0xcdfd('0x29')][_0xcdfd('0x4a')]({'where':{'id':_0x16ed9e[_0xcdfd('0x44')]['id']}})[_0xcdfd('0x22')](handleEntityNotFound(_0x1a88e1,null))[_0xcdfd('0x22')](function(_0x13977b){if(_0x13977b){_0x595954=_0x13977b;_0x5e1a06['model']=_[_0xcdfd('0x2f')](db[_0xcdfd('0x4b')]['rawAttributes']);_0x5e1a06[_0xcdfd('0x2e')]=_[_0xcdfd('0x2f')](_0x16ed9e['query']);_0x5e1a06[_0xcdfd('0x30')]=_['intersection'](_0x5e1a06[_0xcdfd('0x2c')],_0x5e1a06[_0xcdfd('0x2e')]);_0x1d1d85['attributes']=_[_0xcdfd('0x31')](_0x5e1a06[_0xcdfd('0x2c')],qs['fields'](_0x16ed9e[_0xcdfd('0x2e')][_0xcdfd('0x33')]));_0x1d1d85['attributes']=_0x1d1d85['attributes'][_0xcdfd('0x34')]?_0x1d1d85[_0xcdfd('0x32')]:_0x5e1a06[_0xcdfd('0x2c')];_0x1d1d85[_0xcdfd('0x37')]=qs[_0xcdfd('0x38')](_0x16ed9e['query']['sort']);_0x1d1d85[_0xcdfd('0x3b')]=qs['filters'](_[_0xcdfd('0x39')](_0x16ed9e[_0xcdfd('0x2e')],_0x5e1a06[_0xcdfd('0x30')]));if(_0x16ed9e[_0xcdfd('0x2e')][_0xcdfd('0x3a')]){_0x1d1d85[_0xcdfd('0x3b')]=_[_0xcdfd('0x3c')](_0x1d1d85[_0xcdfd('0x3b')],{'$or':_[_0xcdfd('0x2d')](_0x1d1d85[_0xcdfd('0x32')],function(_0x43136e){var _0x41145a={};_0x41145a[_0x43136e]={'$like':'%'+_0x16ed9e[_0xcdfd('0x2e')][_0xcdfd('0x3a')]+'%'};return _0x41145a;})});}_0x1d1d85=_[_0xcdfd('0x3c')]({},_0x1d1d85,_0x16ed9e[_0xcdfd('0x3e')]);return _0x595954['getSubjects'](_0x1d1d85);}})['then'](function(_0x3dddf4){if(_0x3dddf4){_0x42171d=_0x3dddf4[_0xcdfd('0x34')];if(!_0x16ed9e[_0xcdfd('0x2e')][_0xcdfd('0x35')](_0xcdfd('0x36'))){_0x1d1d85[_0xcdfd('0x1c')]=qs[_0xcdfd('0x1c')](_0x16ed9e[_0xcdfd('0x2e')]['limit']);_0x1d1d85['offset']=qs[_0xcdfd('0x19')](_0x16ed9e[_0xcdfd('0x2e')][_0xcdfd('0x19')]);}return _0x595954[_0xcdfd('0x4c')](_0x1d1d85);}})[_0xcdfd('0x22')](function(_0x4936a8){if(_0x4936a8){return _0x4936a8?{'count':_0x42171d,'rows':_0x4936a8}:null;}})[_0xcdfd('0x22')](respondWithResult(_0x1a88e1,null))[_0xcdfd('0x46')](handleError(_0x1a88e1,null));};exports[_0xcdfd('0x4d')]=function(_0x1b6db3,_0x3d3c9a,_0x29428c){var _0x4cba58={};var _0x23529f={};var _0x51f9b7;var _0x5bdb7b;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1b6db3['params']['id']}})[_0xcdfd('0x22')](handleEntityNotFound(_0x3d3c9a,null))[_0xcdfd('0x22')](function(_0x7ed96b){if(_0x7ed96b){_0x51f9b7=_0x7ed96b;_0x23529f['model']=_[_0xcdfd('0x2f')](db[_0xcdfd('0x4b')]['rawAttributes']);_0x23529f[_0xcdfd('0x2e')]=_[_0xcdfd('0x2f')](_0x1b6db3[_0xcdfd('0x2e')]);_0x23529f[_0xcdfd('0x30')]=_[_0xcdfd('0x31')](_0x23529f['model'],_0x23529f['query']);_0x4cba58['attributes']=_[_0xcdfd('0x31')](_0x23529f['model'],qs[_0xcdfd('0x33')](_0x1b6db3[_0xcdfd('0x2e')]['fields']));_0x4cba58[_0xcdfd('0x32')]=_0x4cba58[_0xcdfd('0x32')]['length']?_0x4cba58[_0xcdfd('0x32')]:_0x23529f[_0xcdfd('0x2c')];_0x4cba58[_0xcdfd('0x37')]=qs[_0xcdfd('0x38')](_0x1b6db3[_0xcdfd('0x2e')]['sort']);_0x4cba58[_0xcdfd('0x3b')]=qs[_0xcdfd('0x30')](_[_0xcdfd('0x39')](_0x1b6db3['query'],_0x23529f[_0xcdfd('0x30')]));if(_0x1b6db3['query'][_0xcdfd('0x3a')]){_0x4cba58[_0xcdfd('0x3b')]=_[_0xcdfd('0x3c')](_0x4cba58[_0xcdfd('0x3b')],{'$or':_['map'](_0x4cba58[_0xcdfd('0x32')],function(_0x1456a0){var _0x32af94={};_0x32af94[_0x1456a0]={'$like':'%'+_0x1b6db3[_0xcdfd('0x2e')][_0xcdfd('0x3a')]+'%'};return _0x32af94;})});}_0x4cba58=_[_0xcdfd('0x3c')]({},_0x4cba58,_0x1b6db3['options']);return _0x51f9b7[_0xcdfd('0x4d')](_0x4cba58);}})[_0xcdfd('0x22')](function(_0x578e78){if(_0x578e78){_0x5bdb7b=_0x578e78[_0xcdfd('0x34')];if(!_0x1b6db3[_0xcdfd('0x2e')][_0xcdfd('0x35')](_0xcdfd('0x36'))){_0x4cba58[_0xcdfd('0x1c')]=qs[_0xcdfd('0x1c')](_0x1b6db3[_0xcdfd('0x2e')][_0xcdfd('0x1c')]);_0x4cba58[_0xcdfd('0x19')]=qs[_0xcdfd('0x19')](_0x1b6db3['query'][_0xcdfd('0x19')]);}return _0x51f9b7[_0xcdfd('0x4d')](_0x4cba58);}})['then'](function(_0x4bd77a){if(_0x4bd77a){return _0x4bd77a?{'count':_0x5bdb7b,'rows':_0x4bd77a}:null;}})[_0xcdfd('0x22')](respondWithResult(_0x3d3c9a,null))[_0xcdfd('0x46')](handleError(_0x3d3c9a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3e1150a..8c6972d 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 _0x1a14=['path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','util','api','moment','bluebird'];(function(_0x992fd0,_0x53feeb){var _0x5a4785=function(_0x15e995){while(--_0x15e995){_0x992fd0['push'](_0x992fd0['shift']());}};_0x5a4785(++_0x53feeb);}(_0x1a14,0xe3));var _0x41a1=function(_0x3cc2fd,_0x41758c){_0x3cc2fd=_0x3cc2fd-0x0;var _0x4bb927=_0x1a14[_0x3cc2fd];return _0x4bb927;};'use strict';var _=require('lodash');var util=require(_0x41a1('0x0'));var logger=require('../../config/logger')(_0x41a1('0x1'));var moment=require(_0x41a1('0x2'));var BPromise=require(_0x41a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41a1('0x4'));var rimraf=require(_0x41a1('0x5'));var config=require(_0x41a1('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x41a1('0x7')]=function(_0x87067f,_0x5379b5){return _0x87067f[_0x41a1('0x8')](_0x41a1('0x9'),attributes,{'tableName':_0x41a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ceb=['api','moment','bluebird','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7ceb,0xe1));var _0xb7ce=function(_0x915af1,_0x599343){_0x915af1=_0x915af1-0x0;var _0x44dacc=_0x7ceb[_0x915af1];return _0x44dacc;};'use strict';var _=require(_0xb7ce('0x0'));var util=require(_0xb7ce('0x1'));var logger=require(_0xb7ce('0x2'))(_0xb7ce('0x3'));var moment=require(_0xb7ce('0x4'));var BPromise=require(_0xb7ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7ce('0x6'));var attributes=require(_0xb7ce('0x7'));module[_0xb7ce('0x8')]=function(_0x5cf065,_0x5e6859){return _0x5cf065[_0xb7ce('0x9')](_0xb7ce('0xa'),attributes,{'tableName':_0xb7ce('0xb'),'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 2e28177..834b1c6 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 _0x2ff6=['ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','error','code'];(function(_0x46b052,_0x4651ae){var _0x45389b=function(_0x35322d){while(--_0x35322d){_0x46b052['push'](_0x46b052['shift']());}};_0x45389b(++_0x4651ae);}(_0x2ff6,0x1d0));var _0x62ff=function(_0x35ed48,_0x62de27){_0x35ed48=_0x35ed48-0x0;var _0x218750=_0x2ff6[_0x35ed48];return _0x218750;};'use strict';var _=require(_0x62ff('0x0'));var util=require(_0x62ff('0x1'));var moment=require(_0x62ff('0x2'));var BPromise=require(_0x62ff('0x3'));var rs=require(_0x62ff('0x4'));var fs=require('fs');var Redis=require(_0x62ff('0x5'));var db=require(_0x62ff('0x6'))['db'];var utils=require(_0x62ff('0x7'));var logger=require(_0x62ff('0x8'))(_0x62ff('0x9'));var config=require(_0x62ff('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x62ff('0xb')][_0x62ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eb49f,_0x5ca910,_0x3b7978){return new BPromise(function(_0x283ed9,_0x262935){return client['request'](_0x5eb49f,_0x3b7978)[_0x62ff('0xd')](function(_0x22a145){logger[_0x62ff('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ca910,_0x62ff('0xf'));logger[_0x62ff('0x10')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5ca910,_0x62ff('0xf'),JSON['stringify'](_0x22a145));if(_0x22a145['error']){if(_0x22a145[_0x62ff('0x11')][_0x62ff('0x12')]===0x1f4){logger[_0x62ff('0x11')](_0x62ff('0x13'),_0x5ca910,_0x22a145[_0x62ff('0x11')]['message']);return _0x262935(_0x22a145[_0x62ff('0x11')]['message']);}logger[_0x62ff('0x11')](_0x62ff('0x13'),_0x5ca910,_0x22a145['error'][_0x62ff('0x14')]);return _0x283ed9(_0x22a145[_0x62ff('0x11')][_0x62ff('0x14')]);}else{logger[_0x62ff('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ca910,_0x62ff('0xf'));_0x283ed9(_0x22a145[_0x62ff('0x15')]['message']);}})[_0x62ff('0x16')](function(_0x4809f8){logger[_0x62ff('0x11')](_0x62ff('0x13'),_0x5ca910,_0x4809f8);_0x262935(_0x4809f8);});});} \ No newline at end of file +var _0xbc22=['error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbc22,0x136));var _0x2bc2=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xbc22[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0x2bc2('0x0'));var moment=require(_0x2bc2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bc2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bc2('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x2bc2('0x4'));var jayson=require(_0x2bc2('0x5'));var client=jayson[_0x2bc2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7cce,_0x499b17,_0x5f50ce){return new BPromise(function(_0x3442fd,_0x299d60){return client[_0x2bc2('0x7')](_0x5d7cce,_0x5f50ce)[_0x2bc2('0x8')](function(_0x2d6590){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x499b17,_0x2bc2('0x9'));logger[_0x2bc2('0xa')](_0x2bc2('0xb'),_0x499b17,_0x2bc2('0x9'),JSON[_0x2bc2('0xc')](_0x2d6590));if(_0x2d6590[_0x2bc2('0xd')]){if(_0x2d6590['error'][_0x2bc2('0xe')]===0x1f4){logger[_0x2bc2('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x499b17,_0x2d6590['error']['message']);return _0x299d60(_0x2d6590[_0x2bc2('0xd')][_0x2bc2('0xf')]);}logger[_0x2bc2('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x499b17,_0x2d6590['error'][_0x2bc2('0xf')]);return _0x3442fd(_0x2d6590[_0x2bc2('0xd')][_0x2bc2('0xf')]);}else{logger['info'](_0x2bc2('0x10'),_0x499b17,'request\x20sent');_0x3442fd(_0x2d6590[_0x2bc2('0x11')]['message']);}})[_0x2bc2('0x12')](function(_0x194bcc){logger[_0x2bc2('0xd')](_0x2bc2('0x10'),_0x499b17,_0x194bcc);_0x299d60(_0x194bcc);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 4775e65..ceb692c 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 _0xe6dd=['path','connect-timeout','express','../../components/auth/service','./intZohoField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','multer'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0xe6dd,0x1db));var _0xde6d=function(_0x10a662,_0x3829e8){_0x10a662=_0x10a662-0x0;var _0x3b1995=_0xe6dd[_0x10a662];return _0x3b1995;};'use strict';var multer=require(_0xde6d('0x0'));var util=require('util');var path=require(_0xde6d('0x1'));var timeout=require(_0xde6d('0x2'));var express=require(_0xde6d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xde6d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xde6d('0x5'));router['get']('/',auth[_0xde6d('0x6')](),controller[_0xde6d('0x7')]);router[_0xde6d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xde6d('0x9')]);router[_0xde6d('0xa')]('/',auth['isAuthenticated'](),controller[_0xde6d('0xb')]);router[_0xde6d('0xc')]('/:id',auth[_0xde6d('0x6')](),controller[_0xde6d('0xd')]);router[_0xde6d('0xe')](_0xde6d('0xf'),auth[_0xde6d('0x6')](),controller[_0xde6d('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7462=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x569dfd,_0x4d8d0c){var _0x16edf8=function(_0x364d1e){while(--_0x364d1e){_0x569dfd['push'](_0x569dfd['shift']());}};_0x16edf8(++_0x4d8d0c);}(_0x7462,0xe2));var _0x2746=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x7462[_0x1a8ff0];return _0x3588bf;};'use strict';var multer=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2746('0x2'));var router=express[_0x2746('0x3')]();var fs_extra=require(_0x2746('0x4'));var auth=require(_0x2746('0x5'));var interaction=require(_0x2746('0x6'));var config=require(_0x2746('0x7'));var controller=require(_0x2746('0x8'));router['get']('/',auth[_0x2746('0x9')](),controller[_0x2746('0xa')]);router[_0x2746('0xb')](_0x2746('0xc'),auth[_0x2746('0x9')](),controller[_0x2746('0xd')]);router[_0x2746('0xe')]('/',auth[_0x2746('0x9')](),controller[_0x2746('0xf')]);router[_0x2746('0x10')](_0x2746('0xc'),auth[_0x2746('0x9')](),controller[_0x2746('0x11')]);router[_0x2746('0x12')](_0x2746('0xc'),auth[_0x2746('0x9')](),controller[_0x2746('0x13')]);module[_0x2746('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index bac0737..c7cec99 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 _0x9021=['exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize'];(function(_0x5245aa,_0x35d59a){var _0x2aa6f2=function(_0x1de0b0){while(--_0x1de0b0){_0x5245aa['push'](_0x5245aa['shift']());}};_0x2aa6f2(++_0x35d59a);}(_0x9021,0x116));var _0x1902=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x9021[_0x40f9a0];return _0x3e3144;};'use strict';var Sequelize=require(_0x1902('0x0'));module[_0x1902('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1902('0x2'),_0x1902('0x3'),_0x1902('0x4'),_0x1902('0x5'),_0x1902('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1902('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1902('0x8')](_0x1902('0x2'),_0x1902('0x3'),_0x1902('0x4'))},'keyContent':{'type':Sequelize[_0x1902('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1902('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e3a=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x28f66d,_0x2cb4cb){var _0x5b0410=function(_0x32925e){while(--_0x32925e){_0x28f66d['push'](_0x28f66d['shift']());}};_0x5b0410(++_0x2cb4cb);}(_0x2e3a,0xf1));var _0xa2e3=function(_0xf2fe0d,_0x586c5e){_0xf2fe0d=_0xf2fe0d-0x0;var _0x4a4f91=_0x2e3a[_0xf2fe0d];return _0x4a4f91;};'use strict';var Sequelize=require(_0xa2e3('0x0'));module[_0xa2e3('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa2e3('0x2'),_0xa2e3('0x3'),_0xa2e3('0x4'),_0xa2e3('0x5'),_0xa2e3('0x6')),'defaultValue':_0xa2e3('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa2e3('0x7')]},'keyType':{'type':Sequelize[_0xa2e3('0x8')](_0xa2e3('0x2'),_0xa2e3('0x3'),_0xa2e3('0x4'))},'keyContent':{'type':Sequelize[_0xa2e3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa2e3('0x7')]},'customField':{'type':Sequelize[_0xa2e3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa2e3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 7b17c8d..7d36716 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 _0x1abc=['send','map','ZohoField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x31b5f9,_0x21bfdf){var _0xb4ca95=function(_0x3bf12d){while(--_0x3bf12d){_0x31b5f9['push'](_0x31b5f9['shift']());}};_0xb4ca95(++_0x21bfdf);}(_0x1abc,0xbd));var _0xc1ab=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x1abc[_0x1bf809];return _0x1caa4e;};'use strict';var emlformat=require(_0xc1ab('0x0'));var rimraf=require(_0xc1ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1ab('0x2'));var rp=require(_0xc1ab('0x3'));var moment=require('moment');var BPromise=require(_0xc1ab('0x4'));var Mustache=require('mustache');var util=require(_0xc1ab('0x5'));var path=require(_0xc1ab('0x6'));var sox=require(_0xc1ab('0x7'));var csv=require(_0xc1ab('0x8'));var ejs=require(_0xc1ab('0x9'));var fs=require('fs');var fs_extra=require(_0xc1ab('0xa'));var _=require(_0xc1ab('0xb'));var squel=require(_0xc1ab('0xc'));var crypto=require(_0xc1ab('0xd'));var jsforce=require(_0xc1ab('0xe'));var deskjs=require(_0xc1ab('0xf'));var toCsv=require(_0xc1ab('0x8'));var querystring=require(_0xc1ab('0x10'));var Papa=require(_0xc1ab('0x11'));var Redis=require('ioredis');var authService=require(_0xc1ab('0x12'));var qs=require(_0xc1ab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1ab('0x14'));var logger=require(_0xc1ab('0x15'))(_0xc1ab('0x16'));var utils=require(_0xc1ab('0x17'));var config=require(_0xc1ab('0x18'));var licenseUtil=require(_0xc1ab('0x19'));var db=require(_0xc1ab('0x1a'))['db'];function respondWithStatusCode(_0x25ad4f,_0x47f334){_0x47f334=_0x47f334||0xcc;return function(_0x1b323a){if(_0x1b323a){return _0x25ad4f['sendStatus'](_0x47f334);}return _0x25ad4f[_0xc1ab('0x1b')](_0x47f334)[_0xc1ab('0x1c')]();};}function respondWithResult(_0xe9688a,_0x58e5f5){_0x58e5f5=_0x58e5f5||0xc8;return function(_0x10c4b7){if(_0x10c4b7){return _0xe9688a['status'](_0x58e5f5)[_0xc1ab('0x1d')](_0x10c4b7);}};}function respondWithFilteredResult(_0xaf73d1,_0x1e1de9){return function(_0x1ea58f){if(_0x1ea58f){var _0x1cd3c1=typeof _0x1e1de9[_0xc1ab('0x1e')]===_0xc1ab('0x1f')&&typeof _0x1e1de9['limit']===_0xc1ab('0x1f');var _0x4f06b9=_0x1ea58f[_0xc1ab('0x20')];var _0x32e392=_0x1cd3c1?0x0:_0x1e1de9[_0xc1ab('0x1e')];var _0xafd703=_0x1cd3c1?_0x1ea58f[_0xc1ab('0x20')]:_0x1e1de9[_0xc1ab('0x1e')]+_0x1e1de9[_0xc1ab('0x21')];var _0x1be86f;if(_0xafd703>=_0x4f06b9){_0xafd703=_0x4f06b9;_0x1be86f=0xc8;}else{_0x1be86f=0xce;}_0xaf73d1[_0xc1ab('0x1b')](_0x1be86f);return _0xaf73d1[_0xc1ab('0x22')](_0xc1ab('0x23'),_0x32e392+'-'+_0xafd703+'/'+_0x4f06b9)[_0xc1ab('0x1d')](_0x1ea58f);}return null;};}function patchUpdates(_0x4d34f3){return function(_0x39f85b){try{jsonpatch[_0xc1ab('0x24')](_0x39f85b,_0x4d34f3,!![]);}catch(_0x38acee){return BPromise['reject'](_0x38acee);}return _0x39f85b[_0xc1ab('0x25')]();};}function saveUpdates(_0x26a68c,_0x55bc27){return function(_0x343f17){if(_0x343f17){return _0x343f17[_0xc1ab('0x26')](_0x26a68c)[_0xc1ab('0x27')](function(_0x30e216){return _0x30e216;});}return null;};}function removeEntity(_0x3509fe,_0x479e52){return function(_0x1065b3){if(_0x1065b3){return _0x1065b3[_0xc1ab('0x28')]()['then'](function(){_0x3509fe['status'](0xcc)[_0xc1ab('0x1c')]();});}};}function handleEntityNotFound(_0xa82345,_0x480b57){return function(_0x305e36){if(!_0x305e36){_0xa82345[_0xc1ab('0x29')](0x194);}return _0x305e36;};}function handleError(_0xecd7f4,_0x62c4a3){_0x62c4a3=_0x62c4a3||0x1f4;return function(_0x2495c6){logger[_0xc1ab('0x2a')](_0x2495c6[_0xc1ab('0x2b')]);if(_0x2495c6[_0xc1ab('0x2c')]){delete _0x2495c6[_0xc1ab('0x2c')];}_0xecd7f4[_0xc1ab('0x1b')](_0x62c4a3)[_0xc1ab('0x2d')](_0x2495c6);};}exports['index']=function(_0x4125b1,_0x2eec48){var _0x4fa4d4={},_0x1b8c43={},_0x5ad145={'count':0x0,'rows':[]};var _0x14b6c0=_[_0xc1ab('0x2e')](db[_0xc1ab('0x2f')][_0xc1ab('0x30')],function(_0x520a09){return{'name':_0x520a09[_0xc1ab('0x31')],'type':_0x520a09[_0xc1ab('0x32')][_0xc1ab('0x33')]};});_0x1b8c43[_0xc1ab('0x34')]=_[_0xc1ab('0x2e')](_0x14b6c0,_0xc1ab('0x2c'));_0x1b8c43['query']=_['keys'](_0x4125b1[_0xc1ab('0x35')]);_0x1b8c43['filters']=_['intersection'](_0x1b8c43[_0xc1ab('0x34')],_0x1b8c43[_0xc1ab('0x35')]);_0x4fa4d4['attributes']=_[_0xc1ab('0x36')](_0x1b8c43[_0xc1ab('0x34')],qs[_0xc1ab('0x37')](_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x37')]));_0x4fa4d4[_0xc1ab('0x38')]=_0x4fa4d4[_0xc1ab('0x38')]['length']?_0x4fa4d4[_0xc1ab('0x38')]:_0x1b8c43[_0xc1ab('0x34')];if(!_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x39')](_0xc1ab('0x3a'))){_0x4fa4d4['limit']=qs[_0xc1ab('0x21')](_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x21')]);_0x4fa4d4[_0xc1ab('0x1e')]=qs[_0xc1ab('0x1e')](_0x4125b1[_0xc1ab('0x35')]['offset']);}_0x4fa4d4[_0xc1ab('0x3b')]=qs['sort'](_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x3c')]);_0x4fa4d4['where']=qs[_0xc1ab('0x3d')](_[_0xc1ab('0x3e')](_0x4125b1[_0xc1ab('0x35')],_0x1b8c43[_0xc1ab('0x3d')]),_0x14b6c0);if(_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x3f')]){_0x4fa4d4[_0xc1ab('0x40')]=_[_0xc1ab('0x41')](_0x4fa4d4[_0xc1ab('0x40')],{'$or':_[_0xc1ab('0x2e')](_0x14b6c0,function(_0x1371d5){if(_0x1371d5[_0xc1ab('0x32')]!==_0xc1ab('0x42')){var _0x3c3302={};_0x3c3302[_0x1371d5[_0xc1ab('0x2c')]]={'$like':'%'+_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x3f')]+'%'};return _0x3c3302;}})});}_0x4fa4d4=_[_0xc1ab('0x41')]({},_0x4fa4d4,_0x4125b1[_0xc1ab('0x43')]);var _0x348f7c={'where':_0x4fa4d4[_0xc1ab('0x40')]};return db[_0xc1ab('0x2f')]['count'](_0x348f7c)['then'](function(_0x4791e7){_0x5ad145[_0xc1ab('0x20')]=_0x4791e7;if(_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x44')]){_0x4fa4d4[_0xc1ab('0x45')]=[{'all':!![]}];}return db[_0xc1ab('0x2f')]['findAll'](_0x4fa4d4);})[_0xc1ab('0x27')](function(_0x319f53){_0x5ad145[_0xc1ab('0x46')]=_0x319f53;return _0x5ad145;})[_0xc1ab('0x27')](respondWithFilteredResult(_0x2eec48,_0x4fa4d4))[_0xc1ab('0x47')](handleError(_0x2eec48,null));};exports['show']=function(_0x4e1cd9,_0x50fedf){var _0xdd3338={'raw':!![],'where':{'id':_0x4e1cd9[_0xc1ab('0x48')]['id']}},_0x3c20ef={};_0x3c20ef[_0xc1ab('0x34')]=_[_0xc1ab('0x49')](db[_0xc1ab('0x2f')][_0xc1ab('0x30')]);_0x3c20ef[_0xc1ab('0x35')]=_['keys'](_0x4e1cd9['query']);_0x3c20ef[_0xc1ab('0x3d')]=_[_0xc1ab('0x36')](_0x3c20ef['model'],_0x3c20ef[_0xc1ab('0x35')]);_0xdd3338['attributes']=_[_0xc1ab('0x36')](_0x3c20ef['model'],qs[_0xc1ab('0x37')](_0x4e1cd9[_0xc1ab('0x35')][_0xc1ab('0x37')]));_0xdd3338[_0xc1ab('0x38')]=_0xdd3338['attributes'][_0xc1ab('0x4a')]?_0xdd3338[_0xc1ab('0x38')]:_0x3c20ef[_0xc1ab('0x34')];if(_0x4e1cd9[_0xc1ab('0x35')][_0xc1ab('0x44')]){_0xdd3338[_0xc1ab('0x45')]=[{'all':!![]}];}_0xdd3338=_['merge']({},_0xdd3338,_0x4e1cd9['options']);return db[_0xc1ab('0x2f')][_0xc1ab('0x4b')](_0xdd3338)[_0xc1ab('0x27')](handleEntityNotFound(_0x50fedf,null))[_0xc1ab('0x27')](respondWithResult(_0x50fedf,null))[_0xc1ab('0x47')](handleError(_0x50fedf,null));};exports[_0xc1ab('0x4c')]=function(_0x1b49ed,_0x66e6f9){return db[_0xc1ab('0x2f')]['create'](_0x1b49ed[_0xc1ab('0x4d')],{})[_0xc1ab('0x27')](respondWithResult(_0x66e6f9,0xc9))[_0xc1ab('0x47')](handleError(_0x66e6f9,null));};exports[_0xc1ab('0x26')]=function(_0x294922,_0x218278){if(_0x294922[_0xc1ab('0x4d')]['id']){delete _0x294922['body']['id'];}return db[_0xc1ab('0x2f')][_0xc1ab('0x4b')]({'where':{'id':_0x294922[_0xc1ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x218278,null))[_0xc1ab('0x27')](saveUpdates(_0x294922[_0xc1ab('0x4d')],null))[_0xc1ab('0x27')](respondWithResult(_0x218278,null))['catch'](handleError(_0x218278,null));};exports[_0xc1ab('0x28')]=function(_0x30ca30,_0x11c489){return db[_0xc1ab('0x2f')]['find']({'where':{'id':_0x30ca30[_0xc1ab('0x48')]['id']}})[_0xc1ab('0x27')](handleEntityNotFound(_0x11c489,null))[_0xc1ab('0x27')](removeEntity(_0x11c489,null))['catch'](handleError(_0x11c489,null));}; \ No newline at end of file +var _0x819f=['order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','update','then','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2f7627,_0x1a6d24){var _0x51520a=function(_0xab7ec9){while(--_0xab7ec9){_0x2f7627['push'](_0x2f7627['shift']());}};_0x51520a(++_0x1a6d24);}(_0x819f,0x1bd));var _0xf819=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0x819f[_0x557f5f];return _0x196eba;};'use strict';var emlformat=require(_0xf819('0x0'));var rimraf=require(_0xf819('0x1'));var zipdir=require(_0xf819('0x2'));var jsonpatch=require(_0xf819('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf819('0x4'));var Mustache=require(_0xf819('0x5'));var util=require(_0xf819('0x6'));var path=require(_0xf819('0x7'));var sox=require('sox');var csv=require(_0xf819('0x8'));var ejs=require(_0xf819('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf819('0xa'));var squel=require(_0xf819('0xb'));var crypto=require('crypto');var jsforce=require(_0xf819('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf819('0x8'));var querystring=require(_0xf819('0xd'));var Papa=require('papaparse');var Redis=require(_0xf819('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf819('0xf'));var as=require(_0xf819('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf819('0x11'));var utils=require(_0xf819('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf819('0x13'));var db=require(_0xf819('0x14'))['db'];function respondWithStatusCode(_0x280a76,_0x3a7f2b){_0x3a7f2b=_0x3a7f2b||0xcc;return function(_0x1fe48c){if(_0x1fe48c){return _0x280a76[_0xf819('0x15')](_0x3a7f2b);}return _0x280a76['status'](_0x3a7f2b)[_0xf819('0x16')]();};}function respondWithResult(_0x280b5a,_0x146ce1){_0x146ce1=_0x146ce1||0xc8;return function(_0x59edbc){if(_0x59edbc){return _0x280b5a[_0xf819('0x17')](_0x146ce1)[_0xf819('0x18')](_0x59edbc);}};}function respondWithFilteredResult(_0x5856af,_0x318ec7){return function(_0x443c2b){if(_0x443c2b){var _0x31e33e=typeof _0x318ec7[_0xf819('0x19')]===_0xf819('0x1a')&&typeof _0x318ec7[_0xf819('0x1b')]===_0xf819('0x1a');var _0x483865=_0x443c2b[_0xf819('0x1c')];var _0x5c908e=_0x31e33e?0x0:_0x318ec7[_0xf819('0x19')];var _0x2d7a37=_0x31e33e?_0x443c2b[_0xf819('0x1c')]:_0x318ec7[_0xf819('0x19')]+_0x318ec7['limit'];var _0x224365;if(_0x2d7a37>=_0x483865){_0x2d7a37=_0x483865;_0x224365=0xc8;}else{_0x224365=0xce;}_0x5856af[_0xf819('0x17')](_0x224365);return _0x5856af['set']('Content-Range',_0x5c908e+'-'+_0x2d7a37+'/'+_0x483865)[_0xf819('0x18')](_0x443c2b);}return null;};}function patchUpdates(_0x3b1750){return function(_0xf65ed1){try{jsonpatch[_0xf819('0x1d')](_0xf65ed1,_0x3b1750,!![]);}catch(_0x368302){return BPromise[_0xf819('0x1e')](_0x368302);}return _0xf65ed1['save']();};}function saveUpdates(_0x7d40f,_0x1dfe19){return function(_0x81b049){if(_0x81b049){return _0x81b049[_0xf819('0x1f')](_0x7d40f)[_0xf819('0x20')](function(_0x229c26){return _0x229c26;});}return null;};}function removeEntity(_0x462891,_0x21f21a){return function(_0x3098fe){if(_0x3098fe){return _0x3098fe['destroy']()['then'](function(){_0x462891['status'](0xcc)[_0xf819('0x16')]();});}};}function handleEntityNotFound(_0x412362,_0x575588){return function(_0x3a1976){if(!_0x3a1976){_0x412362[_0xf819('0x15')](0x194);}return _0x3a1976;};}function handleError(_0x5743fe,_0x1a64be){_0x1a64be=_0x1a64be||0x1f4;return function(_0x70e480){logger['error'](_0x70e480[_0xf819('0x21')]);if(_0x70e480[_0xf819('0x22')]){delete _0x70e480[_0xf819('0x22')];}_0x5743fe[_0xf819('0x17')](_0x1a64be)[_0xf819('0x23')](_0x70e480);};}exports[_0xf819('0x24')]=function(_0x1107d9,_0x5c3865){var _0x11785f={},_0x335521={},_0x54054a={'count':0x0,'rows':[]};var _0x33c407=_[_0xf819('0x25')](db[_0xf819('0x26')][_0xf819('0x27')],function(_0x14dc6f){return{'name':_0x14dc6f[_0xf819('0x28')],'type':_0x14dc6f[_0xf819('0x29')][_0xf819('0x2a')]};});_0x335521['model']=_[_0xf819('0x25')](_0x33c407,_0xf819('0x22'));_0x335521[_0xf819('0x2b')]=_[_0xf819('0x2c')](_0x1107d9[_0xf819('0x2b')]);_0x335521[_0xf819('0x2d')]=_[_0xf819('0x2e')](_0x335521[_0xf819('0x2f')],_0x335521[_0xf819('0x2b')]);_0x11785f[_0xf819('0x30')]=_[_0xf819('0x2e')](_0x335521[_0xf819('0x2f')],qs[_0xf819('0x31')](_0x1107d9[_0xf819('0x2b')][_0xf819('0x31')]));_0x11785f[_0xf819('0x30')]=_0x11785f[_0xf819('0x30')]['length']?_0x11785f[_0xf819('0x30')]:_0x335521['model'];if(!_0x1107d9[_0xf819('0x2b')][_0xf819('0x32')](_0xf819('0x33'))){_0x11785f['limit']=qs[_0xf819('0x1b')](_0x1107d9['query']['limit']);_0x11785f[_0xf819('0x19')]=qs['offset'](_0x1107d9['query'][_0xf819('0x19')]);}_0x11785f[_0xf819('0x34')]=qs['sort'](_0x1107d9[_0xf819('0x2b')][_0xf819('0x35')]);_0x11785f[_0xf819('0x36')]=qs[_0xf819('0x2d')](_['pick'](_0x1107d9[_0xf819('0x2b')],_0x335521[_0xf819('0x2d')]),_0x33c407);if(_0x1107d9[_0xf819('0x2b')][_0xf819('0x37')]){_0x11785f[_0xf819('0x36')]=_['merge'](_0x11785f[_0xf819('0x36')],{'$or':_['map'](_0x33c407,function(_0x29117d){if(_0x29117d[_0xf819('0x29')]!==_0xf819('0x38')){var _0x575016={};_0x575016[_0x29117d[_0xf819('0x22')]]={'$like':'%'+_0x1107d9[_0xf819('0x2b')][_0xf819('0x37')]+'%'};return _0x575016;}})});}_0x11785f=_[_0xf819('0x39')]({},_0x11785f,_0x1107d9[_0xf819('0x3a')]);var _0x5a1607={'where':_0x11785f[_0xf819('0x36')]};return db['ZohoField']['count'](_0x5a1607)[_0xf819('0x20')](function(_0x14e904){_0x54054a[_0xf819('0x1c')]=_0x14e904;if(_0x1107d9[_0xf819('0x2b')][_0xf819('0x3b')]){_0x11785f['include']=[{'all':!![]}];}return db[_0xf819('0x26')][_0xf819('0x3c')](_0x11785f);})[_0xf819('0x20')](function(_0x5ca387){_0x54054a[_0xf819('0x3d')]=_0x5ca387;return _0x54054a;})[_0xf819('0x20')](respondWithFilteredResult(_0x5c3865,_0x11785f))[_0xf819('0x3e')](handleError(_0x5c3865,null));};exports[_0xf819('0x3f')]=function(_0xa6ab1a,_0x258822){var _0x37cd45={'raw':!![],'where':{'id':_0xa6ab1a['params']['id']}},_0xf8576f={};_0xf8576f[_0xf819('0x2f')]=_['keys'](db[_0xf819('0x26')][_0xf819('0x27')]);_0xf8576f[_0xf819('0x2b')]=_['keys'](_0xa6ab1a[_0xf819('0x2b')]);_0xf8576f[_0xf819('0x2d')]=_[_0xf819('0x2e')](_0xf8576f[_0xf819('0x2f')],_0xf8576f['query']);_0x37cd45[_0xf819('0x30')]=_[_0xf819('0x2e')](_0xf8576f[_0xf819('0x2f')],qs['fields'](_0xa6ab1a[_0xf819('0x2b')][_0xf819('0x31')]));_0x37cd45[_0xf819('0x30')]=_0x37cd45[_0xf819('0x30')][_0xf819('0x40')]?_0x37cd45[_0xf819('0x30')]:_0xf8576f[_0xf819('0x2f')];if(_0xa6ab1a['query'][_0xf819('0x3b')]){_0x37cd45[_0xf819('0x41')]=[{'all':!![]}];}_0x37cd45=_[_0xf819('0x39')]({},_0x37cd45,_0xa6ab1a[_0xf819('0x3a')]);return db['ZohoField'][_0xf819('0x42')](_0x37cd45)['then'](handleEntityNotFound(_0x258822,null))[_0xf819('0x20')](respondWithResult(_0x258822,null))[_0xf819('0x3e')](handleError(_0x258822,null));};exports[_0xf819('0x43')]=function(_0x29b657,_0x19cb60){return db[_0xf819('0x26')][_0xf819('0x43')](_0x29b657[_0xf819('0x44')],{})['then'](respondWithResult(_0x19cb60,0xc9))['catch'](handleError(_0x19cb60,null));};exports['update']=function(_0x5e8897,_0x5afe16){if(_0x5e8897[_0xf819('0x44')]['id']){delete _0x5e8897[_0xf819('0x44')]['id'];}return db[_0xf819('0x26')][_0xf819('0x42')]({'where':{'id':_0x5e8897[_0xf819('0x45')]['id']}})[_0xf819('0x20')](handleEntityNotFound(_0x5afe16,null))[_0xf819('0x20')](saveUpdates(_0x5e8897[_0xf819('0x44')],null))[_0xf819('0x20')](respondWithResult(_0x5afe16,null))[_0xf819('0x3e')](handleError(_0x5afe16,null));};exports[_0xf819('0x46')]=function(_0x13aa40,_0x3e2442){return db[_0xf819('0x26')]['find']({'where':{'id':_0x13aa40['params']['id']}})['then'](handleEntityNotFound(_0x3e2442,null))[_0xf819('0x20')](removeEntity(_0x3e2442,null))[_0xf819('0x3e')](handleError(_0x3e2442,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index db8ede0..66e626c 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 _0x0a6b=['int_zoho_fields','zoho_unique_index','lodash','moment','request-promise','path','rimraf','./intZohoField.attributes','ZohoField'];(function(_0x26354a,_0x2a887a){var _0x3c21a8=function(_0x19de5f){while(--_0x19de5f){_0x26354a['push'](_0x26354a['shift']());}};_0x3c21a8(++_0x2a887a);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x356914,_0x243e3d){_0x356914=_0x356914-0x0;var _0x54c349=_0x0a6b[_0x356914];return _0x54c349;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));module['exports']=function(_0xbbdf89,_0x415e9e){return _0xbbdf89['define'](_0xb0a6('0x6'),attributes,{'tableName':_0xb0a6('0x7'),'paranoid':![],'indexes':[{'name':_0xb0a6('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bd0=['ZohoField','zoho_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','define'];(function(_0x5a8eb4,_0x51246d){var _0x5c365e=function(_0xda41c2){while(--_0xda41c2){_0x5a8eb4['push'](_0x5a8eb4['shift']());}};_0x5c365e(++_0x51246d);}(_0x7bd0,0x111));var _0x07bd=function(_0x2da357,_0x1f9b2f){_0x2da357=_0x2da357-0x0;var _0x138fdd=_0x7bd0[_0x2da357];return _0x138fdd;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x07bd('0xd'),'fields':['idField',_0x07bd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index f7df4d4..80db57b 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 _0xe8fd=['../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe8fd,0x1f2));var _0xde8f=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xe8fd[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0xde8f('0x0'));var util=require(_0xde8f('0x1'));var moment=require('moment');var BPromise=require(_0xde8f('0x2'));var rs=require(_0xde8f('0x3'));var fs=require('fs');var Redis=require(_0xde8f('0x4'));var db=require(_0xde8f('0x5'))['db'];var utils=require(_0xde8f('0x6'));var logger=require('../../config/logger')(_0xde8f('0x7'));var config=require(_0xde8f('0x8'));var jayson=require(_0xde8f('0x9'));var client=jayson[_0xde8f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32b9ea,_0xbb45ac,_0x406200){return new BPromise(function(_0x47c446,_0xdccbfd){return client[_0xde8f('0xb')](_0x32b9ea,_0x406200)[_0xde8f('0xc')](function(_0x3dc4bd){logger[_0xde8f('0xd')](_0xde8f('0xe'),_0xbb45ac,_0xde8f('0xf'));logger[_0xde8f('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0xbb45ac,_0xde8f('0xf'),JSON[_0xde8f('0x11')](_0x3dc4bd));if(_0x3dc4bd[_0xde8f('0x12')]){if(_0x3dc4bd['error']['code']===0x1f4){logger[_0xde8f('0x12')](_0xde8f('0xe'),_0xbb45ac,_0x3dc4bd['error'][_0xde8f('0x13')]);return _0xdccbfd(_0x3dc4bd['error'][_0xde8f('0x13')]);}logger[_0xde8f('0x12')]('ZohoField,\x20%s,\x20%s',_0xbb45ac,_0x3dc4bd[_0xde8f('0x12')][_0xde8f('0x13')]);return _0x47c446(_0x3dc4bd[_0xde8f('0x12')][_0xde8f('0x13')]);}else{logger[_0xde8f('0xd')](_0xde8f('0xe'),_0xbb45ac,_0xde8f('0xf'));_0x47c446(_0x3dc4bd[_0xde8f('0x14')]['message']);}})[_0xde8f('0x15')](function(_0x9f8dc4){logger[_0xde8f('0x12')](_0xde8f('0xe'),_0xbb45ac,_0x9f8dc4);_0xdccbfd(_0x9f8dc4);});});} \ No newline at end of file +var _0x216f=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoField,\x20%s,\x20%s','result','lodash','util'];(function(_0x1fa41a,_0x30bbe6){var _0x42f6cb=function(_0x480438){while(--_0x480438){_0x1fa41a['push'](_0x1fa41a['shift']());}};_0x42f6cb(++_0x30bbe6);}(_0x216f,0x1e1));var _0xf216=function(_0x4249c5,_0x49c7e0){_0x4249c5=_0x4249c5-0x0;var _0x13d8fc=_0x216f[_0x4249c5];return _0x13d8fc;};'use strict';var _=require(_0xf216('0x0'));var util=require(_0xf216('0x1'));var moment=require(_0xf216('0x2'));var BPromise=require(_0xf216('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf216('0x4'));var db=require(_0xf216('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf216('0x6'))(_0xf216('0x7'));var config=require('../../config/environment');var jayson=require(_0xf216('0x8'));var client=jayson[_0xf216('0x9')][_0xf216('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f474f,_0x2ee847,_0x39e753){return new BPromise(function(_0xddb82f,_0x1a0cad){return client[_0xf216('0xb')](_0x2f474f,_0x39e753)[_0xf216('0xc')](function(_0x4a4dba){logger[_0xf216('0xd')]('ZohoField,\x20%s,\x20%s',_0x2ee847,_0xf216('0xe'));logger[_0xf216('0xf')](_0xf216('0x10'),_0x2ee847,_0xf216('0xe'),JSON[_0xf216('0x11')](_0x4a4dba));if(_0x4a4dba['error']){if(_0x4a4dba[_0xf216('0x12')][_0xf216('0x13')]===0x1f4){logger[_0xf216('0x12')]('ZohoField,\x20%s,\x20%s',_0x2ee847,_0x4a4dba['error'][_0xf216('0x14')]);return _0x1a0cad(_0x4a4dba[_0xf216('0x12')]['message']);}logger['error'](_0xf216('0x15'),_0x2ee847,_0x4a4dba[_0xf216('0x12')]['message']);return _0xddb82f(_0x4a4dba[_0xf216('0x12')][_0xf216('0x14')]);}else{logger[_0xf216('0xd')]('ZohoField,\x20%s,\x20%s',_0x2ee847,_0xf216('0xe'));_0xddb82f(_0x4a4dba[_0xf216('0x16')][_0xf216('0x14')]);}})['catch'](function(_0x4147f3){logger[_0xf216('0x12')](_0xf216('0x15'),_0x2ee847,_0x4147f3);_0x1a0cad(_0x4147f3);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 49c0cb3..4f31b3b 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x135cd7,_0x6bdc01){var _0x300a1d=function(_0x4f292e){while(--_0x4f292e){_0x135cd7['push'](_0x135cd7['shift']());}};_0x300a1d(++_0x6bdc01);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x381d3c,_0x4bc7d0){var _0x12542e=function(_0xc3e0c7){while(--_0xc3e0c7){_0x381d3c['push'](_0x381d3c['shift']());}};_0x12542e(++_0x4bc7d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index a6d8be6..1d2c374 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 _0x6474=['sequelize','STRING','unique_name_and_version','app.js','INTEGER','state'];(function(_0x641f8c,_0x5b9e24){var _0x19ec5e=function(_0x5b4ff1){while(--_0x5b4ff1){_0x641f8c['push'](_0x641f8c['shift']());}};_0x19ec5e(++_0x5b9e24);}(_0x6474,0x1f2));var _0x4647=function(_0x3e7127,_0x424cd5){_0x3e7127=_0x3e7127-0x0;var _0x2e4a5e=_0x6474[_0x3e7127];return _0x2e4a5e;};'use strict';var Sequelize=require(_0x4647('0x0'));module['exports']={'name':{'type':Sequelize[_0x4647('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4647('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x4647('0x3')},'filename':{'type':Sequelize[_0x4647('0x1')]},'path':{'type':Sequelize[_0x4647('0x1')]},'type':{'type':Sequelize[_0x4647('0x1')]},'size':{'type':Sequelize[_0x4647('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x4647('0x1')]},'state':{'type':Sequelize[_0x4647('0x1')],'unique':_0x4647('0x5')},'description':{'type':Sequelize[_0x4647('0x1')]},'title':{'type':Sequelize[_0x4647('0x1')]},'remoteUri':{'type':Sequelize[_0x4647('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x8d44=['unique_name_and_version','STRING','INTEGER','sequelize','exports'];(function(_0x5c2d33,_0x208b4f){var _0xd5d256=function(_0x5a9227){while(--_0x5a9227){_0x5c2d33['push'](_0x5c2d33['shift']());}};_0xd5d256(++_0x208b4f);}(_0x8d44,0x161));var _0x48d4=function(_0xca31b6,_0x14c15f){_0xca31b6=_0xca31b6-0x0;var _0x10b23e=_0x8d44[_0xca31b6];return _0x10b23e;};'use strict';var Sequelize=require(_0x48d4('0x0'));module[_0x48d4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x48d4('0x2')},'version':{'type':Sequelize[_0x48d4('0x3')],'allowNull':![],'unique':_0x48d4('0x2')},'main':{'type':Sequelize[_0x48d4('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x48d4('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x48d4('0x3')]},'size':{'type':Sequelize[_0x48d4('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x48d4('0x3')]},'logo':{'type':Sequelize[_0x48d4('0x3')]},'state':{'type':Sequelize[_0x48d4('0x3')],'unique':'state'},'description':{'type':Sequelize[_0x48d4('0x3')]},'title':{'type':Sequelize[_0x48d4('0x3')]},'remoteUri':{'type':Sequelize[_0x48d4('0x3')]},'link':{'type':Sequelize[_0x48d4('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0cc8047..0503d6d 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 _0xc4aa=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Integration','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,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(_0x5d6e2a,_0x2bb42f){var _0x1e5a9d=function(_0x9aaf18){while(--_0x9aaf18){_0x5d6e2a['push'](_0x5d6e2a['shift']());}};_0x1e5a9d(++_0x2bb42f);}(_0xfcf0,0x138));var _0x0fcf=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0xfcf0[_0x108d5f];return _0x456ea3;};'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 ac86d28..0ad44b1 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 _0x112a=['./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d3973,_0x318f28){var _0x28fe79=function(_0x3adce6){while(--_0x3adce6){_0x4d3973['push'](_0x4d3973['shift']());}};_0x28fe79(++_0x318f28);}(_0x112a,0xe4));var _0xa112=function(_0x1f7133,_0xc0bc82){_0x1f7133=_0x1f7133-0x0;var _0x342c27=_0x112a[_0x1f7133];return _0x342c27;};'use strict';var _=require(_0xa112('0x0'));var util=require(_0xa112('0x1'));var logger=require(_0xa112('0x2'))(_0xa112('0x3'));var moment=require(_0xa112('0x4'));var BPromise=require(_0xa112('0x5'));var rp=require(_0xa112('0x6'));var fs=require('fs');var path=require(_0xa112('0x7'));var rimraf=require(_0xa112('0x8'));var config=require(_0xa112('0x9'));var attributes=require(_0xa112('0xa'));module[_0xa112('0xb')]=function(_0x47e0a9,_0x5f23c2){return _0x47e0a9[_0xa112('0xc')](_0xa112('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41b4=['path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x100c50,_0x37f74f){var _0x233e9a=function(_0x32707a){while(--_0x32707a){_0x100c50['push'](_0x100c50['shift']());}};_0x233e9a(++_0x37f74f);}(_0x41b4,0x1a7));var _0x441b=function(_0x3363ae,_0x5c3f3f){_0x3363ae=_0x3363ae-0x0;var _0x2bc795=_0x41b4[_0x3363ae];return _0x2bc795;};'use strict';var _=require(_0x441b('0x0'));var util=require('util');var logger=require(_0x441b('0x1'))(_0x441b('0x2'));var moment=require(_0x441b('0x3'));var BPromise=require(_0x441b('0x4'));var rp=require(_0x441b('0x5'));var fs=require('fs');var path=require(_0x441b('0x6'));var rimraf=require(_0x441b('0x7'));var config=require(_0x441b('0x8'));var attributes=require(_0x441b('0x9'));module[_0x441b('0xa')]=function(_0xd9213a,_0x3074aa){return _0xd9213a[_0x441b('0xb')](_0x441b('0xc'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 0b206d0..5984357 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x4a0f9d,_0x53b0c5){var _0x296eed=function(_0x2fc56e){while(--_0x2fc56e){_0x4a0f9d['push'](_0x4a0f9d['shift']());}};_0x296eed(++_0x53b0c5);}(_0xdb28,0x106));var _0x8db2=function(_0x26a3d5,_0x1315f2){_0x26a3d5=_0x26a3d5-0x0;var _0x501142=_0xdb28[_0x26a3d5];return _0x501142;};'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')]('Integration,\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 _0x955f=['Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x18680c,_0x11debd){var _0xfc0e96=function(_0x1d46ac){while(--_0x1d46ac){_0x18680c['push'](_0x18680c['shift']());}};_0xfc0e96(++_0x11debd);}(_0x955f,0x1eb));var _0xf955=function(_0x1f63a6,_0x5e15b2){_0x1f63a6=_0x1f63a6-0x0;var _0x4e7021=_0x955f[_0x1f63a6];return _0x4e7021;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('Integration,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 9f04fd3..598449c 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 _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xda2d,0x102));var _0xdda2=function(_0x552234,_0x43b64b){_0x552234=_0x552234-0x0;var _0x178e84=_0xda2d[_0x552234];return _0x178e84;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0xadb5,0xad));var _0x5adb=function(_0x29e5b5,_0x217c92){_0x29e5b5=_0x29e5b5-0x0;var _0x2f53e9=_0xadb5[_0x29e5b5];return _0x2f53e9;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a652fb0..8e2983e 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 _0x94eb=['RECEIVED','FAILED','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','SENT','SENDING'];(function(_0xb1e21b,_0x11e254){var _0x2b47b6=function(_0xfd5f53){while(--_0xfd5f53){_0xb1e21b['push'](_0xb1e21b['shift']());}};_0x2b47b6(++_0x11e254);}(_0x94eb,0xfc));var _0xb94e=function(_0x12aed2,_0x835379){_0x12aed2=_0x12aed2-0x0;var _0x7411fd=_0x94eb[_0x12aed2];return _0x7411fd;};'use strict';var Sequelize=require('sequelize');module[_0xb94e('0x0')]={'integration':{'type':Sequelize[_0xb94e('0x1')]},'eventChannel':{'type':Sequelize[_0xb94e('0x1')]},'exitStatus':{'type':Sequelize[_0xb94e('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xb94e('0x2')]},'contacts':{'type':Sequelize[_0xb94e('0x1')]},'uniqueid':{'type':Sequelize[_0xb94e('0x1')]},'calleridnum':{'type':Sequelize[_0xb94e('0x1')]},'calleridname':{'type':Sequelize[_0xb94e('0x1')]},'queue':{'type':Sequelize[_0xb94e('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb94e('0x2')]},'agentcomplete':{'type':Sequelize[_0xb94e('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb94e('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xb94e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xb94e('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xb94e('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb94e('0x4')]},'agentdump':{'type':Sequelize[_0xb94e('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xb94e('0x1')]},'channel':{'type':Sequelize[_0xb94e('0x1')]},'channelstate':{'type':Sequelize[_0xb94e('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb94e('0x1')]},'connectedlinename':{'type':Sequelize[_0xb94e('0x1')]},'language':{'type':Sequelize[_0xb94e('0x1')]},'accountcode':{'type':Sequelize[_0xb94e('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb94e('0x1')]},'priority':{'type':Sequelize[_0xb94e('0x1')]},'destchannel':{'type':Sequelize[_0xb94e('0x1')]},'destchannelstate':{'type':Sequelize[_0xb94e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xb94e('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb94e('0x1')]},'destcalleridname':{'type':Sequelize[_0xb94e('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xb94e('0x1')]},'destaccountcode':{'type':Sequelize[_0xb94e('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xb94e('0x1')]},'destpriority':{'type':Sequelize[_0xb94e('0x1')]},'destuniqueid':{'type':Sequelize[_0xb94e('0x1')]},'messageId':{'type':Sequelize[_0xb94e('0x1')]},'inReplyTo':{'type':Sequelize[_0xb94e('0x1')]},'subject':{'type':Sequelize[_0xb94e('0x1')]},'from':{'type':Sequelize[_0xb94e('0x1')]},'to':{'type':Sequelize[_0xb94e('0x1')]},'cc':{'type':Sequelize[_0xb94e('0x1')]},'attachment':{'type':Sequelize[_0xb94e('0x5')]},'html':{'type':Sequelize[_0xb94e('0x5')]},'text':{'type':Sequelize[_0xb94e('0x5')]},'status':{'type':Sequelize['ENUM'](_0xb94e('0x6'),_0xb94e('0x7'),_0xb94e('0x8'),_0xb94e('0x9'))},'url':{'type':Sequelize[_0xb94e('0x1')]},'app':{'type':Sequelize[_0xb94e('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xb94e('0x2')]}}; \ No newline at end of file +var _0xd90f=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','sequelize','STRING'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xd90f,0xbb));var _0xfd90=function(_0xe19986,_0x3ecb6a){_0xe19986=_0xe19986-0x0;var _0xd9c6a7=_0xd90f[_0xe19986];return _0xd9c6a7;};'use strict';var Sequelize=require(_0xfd90('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xfd90('0x1')]},'exitStatus':{'type':Sequelize[_0xfd90('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xfd90('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfd90('0x1')]},'calleridnum':{'type':Sequelize[_0xfd90('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfd90('0x1')]},'interface':{'type':Sequelize[_0xfd90('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xfd90('0x3')]},'agentconnectAt':{'type':Sequelize[_0xfd90('0x3')]},'holdtime':{'type':Sequelize[_0xfd90('0x2')]},'agentcomplete':{'type':Sequelize[_0xfd90('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xfd90('0x3')]},'talktime':{'type':Sequelize[_0xfd90('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfd90('0x2')]},'reason':{'type':Sequelize[_0xfd90('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xfd90('0x3')]},'agentdump':{'type':Sequelize[_0xfd90('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xfd90('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfd90('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xfd90('0x1')]},'connectedlinenum':{'type':Sequelize[_0xfd90('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd90('0x1')]},'accountcode':{'type':Sequelize[_0xfd90('0x1')]},'context':{'type':Sequelize[_0xfd90('0x1')]},'exten':{'type':Sequelize[_0xfd90('0x1')]},'priority':{'type':Sequelize[_0xfd90('0x1')]},'destchannel':{'type':Sequelize[_0xfd90('0x1')]},'destchannelstate':{'type':Sequelize[_0xfd90('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xfd90('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xfd90('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xfd90('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfd90('0x1')]},'destexten':{'type':Sequelize[_0xfd90('0x1')]},'destpriority':{'type':Sequelize[_0xfd90('0x1')]},'destuniqueid':{'type':Sequelize[_0xfd90('0x1')]},'messageId':{'type':Sequelize[_0xfd90('0x1')]},'inReplyTo':{'type':Sequelize[_0xfd90('0x1')]},'subject':{'type':Sequelize[_0xfd90('0x1')]},'from':{'type':Sequelize[_0xfd90('0x1')]},'to':{'type':Sequelize[_0xfd90('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xfd90('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xfd90('0x5')]},'status':{'type':Sequelize[_0xfd90('0x6')](_0xfd90('0x7'),'SENDING',_0xfd90('0x8'),'FAILED')},'url':{'type':Sequelize[_0xfd90('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xfd90('0x1')]},'projectId':{'type':Sequelize[_0xfd90('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index be72589..87f810b 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 _0xae4e=['status','end','json','offset','undefined','count','limit','apply','reject','then','error','stack','send','map','IntegrationReport','rawAttributes','fieldName','type','name','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','model','intersection','find','create','update','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5c9499,_0x221b1){var _0x1370d4=function(_0x2a077a){while(--_0x2a077a){_0x5c9499['push'](_0x5c9499['shift']());}};_0x1370d4(++_0x221b1);}(_0xae4e,0x112));var _0xeae4=function(_0x201aa7,_0x15c660){_0x201aa7=_0x201aa7-0x0;var _0x21f860=_0xae4e[_0x201aa7];return _0x21f860;};'use strict';var emlformat=require(_0xeae4('0x0'));var rimraf=require(_0xeae4('0x1'));var zipdir=require(_0xeae4('0x2'));var jsonpatch=require(_0xeae4('0x3'));var rp=require(_0xeae4('0x4'));var moment=require(_0xeae4('0x5'));var BPromise=require(_0xeae4('0x6'));var Mustache=require('mustache');var util=require(_0xeae4('0x7'));var path=require('path');var sox=require(_0xeae4('0x8'));var csv=require(_0xeae4('0x9'));var ejs=require(_0xeae4('0xa'));var fs=require('fs');var fs_extra=require(_0xeae4('0xb'));var _=require(_0xeae4('0xc'));var squel=require('squel');var crypto=require(_0xeae4('0xd'));var jsforce=require(_0xeae4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xeae4('0x9'));var querystring=require(_0xeae4('0xf'));var Papa=require(_0xeae4('0x10'));var Redis=require(_0xeae4('0x11'));var authService=require(_0xeae4('0x12'));var qs=require(_0xeae4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeae4('0x14'));var logger=require(_0xeae4('0x15'))('api');var utils=require(_0xeae4('0x16'));var config=require(_0xeae4('0x17'));var licenseUtil=require(_0xeae4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dfdcf,_0x522423){_0x522423=_0x522423||0xcc;return function(_0x4addbf){if(_0x4addbf){return _0x1dfdcf[_0xeae4('0x19')](_0x522423);}return _0x1dfdcf[_0xeae4('0x1a')](_0x522423)[_0xeae4('0x1b')]();};}function respondWithResult(_0x58b1ed,_0x1fea52){_0x1fea52=_0x1fea52||0xc8;return function(_0xda74a7){if(_0xda74a7){return _0x58b1ed['status'](_0x1fea52)[_0xeae4('0x1c')](_0xda74a7);}};}function respondWithFilteredResult(_0x5cb921,_0x3d24bd){return function(_0x32283f){if(_0x32283f){var _0x55913a=typeof _0x3d24bd[_0xeae4('0x1d')]===_0xeae4('0x1e')&&typeof _0x3d24bd['limit']===_0xeae4('0x1e');var _0x38a462=_0x32283f[_0xeae4('0x1f')];var _0x589d65=_0x55913a?0x0:_0x3d24bd[_0xeae4('0x1d')];var _0x54f567=_0x55913a?_0x32283f[_0xeae4('0x1f')]:_0x3d24bd[_0xeae4('0x1d')]+_0x3d24bd[_0xeae4('0x20')];var _0x112ed1;if(_0x54f567>=_0x38a462){_0x54f567=_0x38a462;_0x112ed1=0xc8;}else{_0x112ed1=0xce;}_0x5cb921[_0xeae4('0x1a')](_0x112ed1);return _0x5cb921['set']('Content-Range',_0x589d65+'-'+_0x54f567+'/'+_0x38a462)[_0xeae4('0x1c')](_0x32283f);}return null;};}function patchUpdates(_0x26ce37){return function(_0x10d3cb){try{jsonpatch[_0xeae4('0x21')](_0x10d3cb,_0x26ce37,!![]);}catch(_0x9fd932){return BPromise[_0xeae4('0x22')](_0x9fd932);}return _0x10d3cb['save']();};}function saveUpdates(_0x5d853e,_0x5cd164){return function(_0x184f99){if(_0x184f99){return _0x184f99['update'](_0x5d853e)['then'](function(_0x3ca164){return _0x3ca164;});}return null;};}function removeEntity(_0x470462,_0x1a1fa2){return function(_0x332889){if(_0x332889){return _0x332889['destroy']()[_0xeae4('0x23')](function(){_0x470462['status'](0xcc)[_0xeae4('0x1b')]();});}};}function handleEntityNotFound(_0x5a4407,_0x2f1865){return function(_0x687899){if(!_0x687899){_0x5a4407['sendStatus'](0x194);}return _0x687899;};}function handleError(_0x29db14,_0x5cc427){_0x5cc427=_0x5cc427||0x1f4;return function(_0x18b005){logger[_0xeae4('0x24')](_0x18b005[_0xeae4('0x25')]);if(_0x18b005['name']){delete _0x18b005['name'];}_0x29db14['status'](_0x5cc427)[_0xeae4('0x26')](_0x18b005);};}exports['index']=function(_0x157510,_0x2db602){var _0x27698f={},_0x55a125={},_0x3dbb40={'count':0x0,'rows':[]};var _0x5d9375=_[_0xeae4('0x27')](db[_0xeae4('0x28')][_0xeae4('0x29')],function(_0x4162bb){return{'name':_0x4162bb[_0xeae4('0x2a')],'type':_0x4162bb[_0xeae4('0x2b')]['key']};});_0x55a125['model']=_['map'](_0x5d9375,_0xeae4('0x2c'));_0x55a125[_0xeae4('0x2d')]=_[_0xeae4('0x2e')](_0x157510['query']);_0x55a125['filters']=_['intersection'](_0x55a125['model'],_0x55a125[_0xeae4('0x2d')]);_0x27698f[_0xeae4('0x2f')]=_['intersection'](_0x55a125['model'],qs[_0xeae4('0x30')](_0x157510['query']['fields']));_0x27698f[_0xeae4('0x2f')]=_0x27698f[_0xeae4('0x2f')][_0xeae4('0x31')]?_0x27698f['attributes']:_0x55a125['model'];if(!_0x157510[_0xeae4('0x2d')][_0xeae4('0x32')](_0xeae4('0x33'))){_0x27698f[_0xeae4('0x20')]=qs['limit'](_0x157510['query'][_0xeae4('0x20')]);_0x27698f['offset']=qs['offset'](_0x157510[_0xeae4('0x2d')][_0xeae4('0x1d')]);}_0x27698f[_0xeae4('0x34')]=qs[_0xeae4('0x35')](_0x157510[_0xeae4('0x2d')][_0xeae4('0x35')]);_0x27698f[_0xeae4('0x36')]=qs[_0xeae4('0x37')](_[_0xeae4('0x38')](_0x157510['query'],_0x55a125['filters']),_0x5d9375);if(_0x157510[_0xeae4('0x2d')][_0xeae4('0x39')]){_0x27698f[_0xeae4('0x36')]=_['merge'](_0x27698f[_0xeae4('0x36')],{'$or':_[_0xeae4('0x27')](_0x5d9375,function(_0x296123){if(_0x296123[_0xeae4('0x2b')]!=='VIRTUAL'){var _0x4b5a2e={};_0x4b5a2e[_0x296123[_0xeae4('0x2c')]]={'$like':'%'+_0x157510[_0xeae4('0x2d')][_0xeae4('0x39')]+'%'};return _0x4b5a2e;}})});}_0x27698f=_[_0xeae4('0x3a')]({},_0x27698f,_0x157510[_0xeae4('0x3b')]);var _0x477c3c={'where':_0x27698f[_0xeae4('0x36')]};return db[_0xeae4('0x28')][_0xeae4('0x1f')](_0x477c3c)['then'](function(_0x42b7dc){_0x3dbb40[_0xeae4('0x1f')]=_0x42b7dc;if(_0x157510['query'][_0xeae4('0x3c')]){_0x27698f[_0xeae4('0x3d')]=[{'all':!![]}];}return db[_0xeae4('0x28')][_0xeae4('0x3e')](_0x27698f);})['then'](function(_0x4ad9ba){_0x3dbb40[_0xeae4('0x3f')]=_0x4ad9ba;return _0x3dbb40;})['then'](respondWithFilteredResult(_0x2db602,_0x27698f))[_0xeae4('0x40')](handleError(_0x2db602,null));};exports[_0xeae4('0x41')]=function(_0x36aaa1,_0x1bf5ea){var _0x2b160c={'raw':![],'where':{'id':_0x36aaa1[_0xeae4('0x42')]['id']}},_0x11ae1c={};_0x11ae1c[_0xeae4('0x43')]=_[_0xeae4('0x2e')](db[_0xeae4('0x28')][_0xeae4('0x29')]);_0x11ae1c['query']=_[_0xeae4('0x2e')](_0x36aaa1[_0xeae4('0x2d')]);_0x11ae1c[_0xeae4('0x37')]=_['intersection'](_0x11ae1c[_0xeae4('0x43')],_0x11ae1c['query']);_0x2b160c[_0xeae4('0x2f')]=_[_0xeae4('0x44')](_0x11ae1c['model'],qs[_0xeae4('0x30')](_0x36aaa1[_0xeae4('0x2d')][_0xeae4('0x30')]));_0x2b160c[_0xeae4('0x2f')]=_0x2b160c[_0xeae4('0x2f')][_0xeae4('0x31')]?_0x2b160c[_0xeae4('0x2f')]:_0x11ae1c['model'];if(_0x36aaa1[_0xeae4('0x2d')][_0xeae4('0x3c')]){_0x2b160c[_0xeae4('0x3d')]=[{'all':!![]}];}_0x2b160c=_['merge']({},_0x2b160c,_0x36aaa1[_0xeae4('0x3b')]);return db['IntegrationReport'][_0xeae4('0x45')](_0x2b160c)[_0xeae4('0x23')](handleEntityNotFound(_0x1bf5ea,null))[_0xeae4('0x23')](respondWithResult(_0x1bf5ea,null))[_0xeae4('0x40')](handleError(_0x1bf5ea,null));};exports[_0xeae4('0x46')]=function(_0x3a86e8,_0xda6ffa){return db[_0xeae4('0x28')][_0xeae4('0x46')](_0x3a86e8['body'],{})['then'](respondWithResult(_0xda6ffa,0xc9))['catch'](handleError(_0xda6ffa,null));};exports[_0xeae4('0x47')]=function(_0x4cce68,_0x32cc98){if(_0x4cce68[_0xeae4('0x48')]['id']){delete _0x4cce68[_0xeae4('0x48')]['id'];}return db['IntegrationReport'][_0xeae4('0x45')]({'where':{'id':_0x4cce68[_0xeae4('0x42')]['id']}})[_0xeae4('0x23')](handleEntityNotFound(_0x32cc98,null))[_0xeae4('0x23')](saveUpdates(_0x4cce68['body'],null))[_0xeae4('0x23')](respondWithResult(_0x32cc98,null))[_0xeae4('0x40')](handleError(_0x32cc98,null));};exports[_0xeae4('0x49')]=function(_0x4144fb,_0x5ef7b6){return db['IntegrationReport'][_0xeae4('0x45')]({'where':{'id':_0x4144fb[_0xeae4('0x42')]['id']}})[_0xeae4('0x23')](handleEntityNotFound(_0x5ef7b6,null))[_0xeae4('0x23')](removeEntity(_0x5ef7b6,null))['catch'](handleError(_0x5ef7b6,null));};exports[_0xeae4('0x4a')]=function(_0x3ea867,_0x395ada){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x395ada,null))[_0xeae4('0x40')](handleError(_0x395ada,null));}; \ No newline at end of file +var _0x725e=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','filters','pick','filter','merge','where','VIRTUAL','options','rows','catch','show','params','length','includeAll','include','find','create','body','describe','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash'];(function(_0x1d453f,_0x5793a9){var _0x50996a=function(_0x59bdf3){while(--_0x59bdf3){_0x1d453f['push'](_0x1d453f['shift']());}};_0x50996a(++_0x5793a9);}(_0x725e,0x169));var _0xe725=function(_0x32f371,_0x1c9752){_0x32f371=_0x32f371-0x0;var _0x4778e7=_0x725e[_0x32f371];return _0x4778e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe725('0x0'));var jsonpatch=require(_0xe725('0x1'));var rp=require('request-promise');var moment=require(_0xe725('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe725('0x3'));var path=require(_0xe725('0x4'));var sox=require(_0xe725('0x5'));var csv=require(_0xe725('0x6'));var ejs=require(_0xe725('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe725('0x8'));var squel=require(_0xe725('0x9'));var crypto=require(_0xe725('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe725('0xb'));var toCsv=require(_0xe725('0x6'));var querystring=require(_0xe725('0xc'));var Papa=require(_0xe725('0xd'));var Redis=require(_0xe725('0xe'));var authService=require(_0xe725('0xf'));var qs=require(_0xe725('0x10'));var as=require(_0xe725('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe725('0x12'))(_0xe725('0x13'));var utils=require(_0xe725('0x14'));var config=require(_0xe725('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe725('0x16'))['db'];function respondWithStatusCode(_0x3b3093,_0x36bb64){_0x36bb64=_0x36bb64||0xcc;return function(_0x753c7){if(_0x753c7){return _0x3b3093['sendStatus'](_0x36bb64);}return _0x3b3093[_0xe725('0x17')](_0x36bb64)['end']();};}function respondWithResult(_0x12ed46,_0xd379ff){_0xd379ff=_0xd379ff||0xc8;return function(_0x3b76df){if(_0x3b76df){return _0x12ed46[_0xe725('0x17')](_0xd379ff)[_0xe725('0x18')](_0x3b76df);}};}function respondWithFilteredResult(_0x443d61,_0x52afb2){return function(_0x44858b){if(_0x44858b){var _0x19423b=typeof _0x52afb2[_0xe725('0x19')]===_0xe725('0x1a')&&typeof _0x52afb2[_0xe725('0x1b')]===_0xe725('0x1a');var _0xfed9aa=_0x44858b[_0xe725('0x1c')];var _0x5da338=_0x19423b?0x0:_0x52afb2[_0xe725('0x19')];var _0xb60c75=_0x19423b?_0x44858b[_0xe725('0x1c')]:_0x52afb2[_0xe725('0x19')]+_0x52afb2[_0xe725('0x1b')];var _0x31dde1;if(_0xb60c75>=_0xfed9aa){_0xb60c75=_0xfed9aa;_0x31dde1=0xc8;}else{_0x31dde1=0xce;}_0x443d61['status'](_0x31dde1);return _0x443d61[_0xe725('0x1d')]('Content-Range',_0x5da338+'-'+_0xb60c75+'/'+_0xfed9aa)['json'](_0x44858b);}return null;};}function patchUpdates(_0x4039cc){return function(_0x2f32aa){try{jsonpatch[_0xe725('0x1e')](_0x2f32aa,_0x4039cc,!![]);}catch(_0x421b1b){return BPromise[_0xe725('0x1f')](_0x421b1b);}return _0x2f32aa[_0xe725('0x20')]();};}function saveUpdates(_0x362a7b,_0x61a6bd){return function(_0x15301c){if(_0x15301c){return _0x15301c[_0xe725('0x21')](_0x362a7b)['then'](function(_0x50a16c){return _0x50a16c;});}return null;};}function removeEntity(_0x31f1ba,_0x3e1e74){return function(_0x3aae5b){if(_0x3aae5b){return _0x3aae5b[_0xe725('0x22')]()[_0xe725('0x23')](function(){_0x31f1ba[_0xe725('0x17')](0xcc)[_0xe725('0x24')]();});}};}function handleEntityNotFound(_0xdff71,_0x3d130){return function(_0x517e14){if(!_0x517e14){_0xdff71[_0xe725('0x25')](0x194);}return _0x517e14;};}function handleError(_0x57772c,_0x461dc9){_0x461dc9=_0x461dc9||0x1f4;return function(_0x1d7643){logger[_0xe725('0x26')](_0x1d7643[_0xe725('0x27')]);if(_0x1d7643[_0xe725('0x28')]){delete _0x1d7643[_0xe725('0x28')];}_0x57772c[_0xe725('0x17')](_0x461dc9)['send'](_0x1d7643);};}exports[_0xe725('0x29')]=function(_0x46c0aa,_0x3c92d8){var _0x28a0b0={},_0x132bf5={},_0x57ee8c={'count':0x0,'rows':[]};var _0x4707d7=_[_0xe725('0x2a')](db[_0xe725('0x2b')][_0xe725('0x2c')],function(_0x5ced3e){return{'name':_0x5ced3e[_0xe725('0x2d')],'type':_0x5ced3e[_0xe725('0x2e')][_0xe725('0x2f')]};});_0x132bf5[_0xe725('0x30')]=_[_0xe725('0x2a')](_0x4707d7,_0xe725('0x28'));_0x132bf5[_0xe725('0x31')]=_[_0xe725('0x32')](_0x46c0aa[_0xe725('0x31')]);_0x132bf5['filters']=_[_0xe725('0x33')](_0x132bf5[_0xe725('0x30')],_0x132bf5[_0xe725('0x31')]);_0x28a0b0['attributes']=_[_0xe725('0x33')](_0x132bf5[_0xe725('0x30')],qs[_0xe725('0x34')](_0x46c0aa[_0xe725('0x31')][_0xe725('0x34')]));_0x28a0b0[_0xe725('0x35')]=_0x28a0b0[_0xe725('0x35')]['length']?_0x28a0b0[_0xe725('0x35')]:_0x132bf5[_0xe725('0x30')];if(!_0x46c0aa[_0xe725('0x31')][_0xe725('0x36')]('nolimit')){_0x28a0b0[_0xe725('0x1b')]=qs[_0xe725('0x1b')](_0x46c0aa[_0xe725('0x31')][_0xe725('0x1b')]);_0x28a0b0['offset']=qs[_0xe725('0x19')](_0x46c0aa[_0xe725('0x31')]['offset']);}_0x28a0b0[_0xe725('0x37')]=qs['sort'](_0x46c0aa[_0xe725('0x31')]['sort']);_0x28a0b0['where']=qs[_0xe725('0x38')](_[_0xe725('0x39')](_0x46c0aa[_0xe725('0x31')],_0x132bf5[_0xe725('0x38')]),_0x4707d7);if(_0x46c0aa[_0xe725('0x31')][_0xe725('0x3a')]){_0x28a0b0['where']=_[_0xe725('0x3b')](_0x28a0b0[_0xe725('0x3c')],{'$or':_['map'](_0x4707d7,function(_0x4a860c){if(_0x4a860c[_0xe725('0x2e')]!==_0xe725('0x3d')){var _0x20b984={};_0x20b984[_0x4a860c['name']]={'$like':'%'+_0x46c0aa['query']['filter']+'%'};return _0x20b984;}})});}_0x28a0b0=_['merge']({},_0x28a0b0,_0x46c0aa[_0xe725('0x3e')]);var _0x51a0aa={'where':_0x28a0b0['where']};return db[_0xe725('0x2b')][_0xe725('0x1c')](_0x51a0aa)[_0xe725('0x23')](function(_0x2eb8af){_0x57ee8c['count']=_0x2eb8af;if(_0x46c0aa[_0xe725('0x31')]['includeAll']){_0x28a0b0['include']=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x28a0b0);})[_0xe725('0x23')](function(_0x587f72){_0x57ee8c[_0xe725('0x3f')]=_0x587f72;return _0x57ee8c;})[_0xe725('0x23')](respondWithFilteredResult(_0x3c92d8,_0x28a0b0))[_0xe725('0x40')](handleError(_0x3c92d8,null));};exports[_0xe725('0x41')]=function(_0x56b56b,_0x23d7fc){var _0x152f55={'raw':![],'where':{'id':_0x56b56b[_0xe725('0x42')]['id']}},_0x46ab83={};_0x46ab83[_0xe725('0x30')]=_[_0xe725('0x32')](db['IntegrationReport'][_0xe725('0x2c')]);_0x46ab83['query']=_['keys'](_0x56b56b[_0xe725('0x31')]);_0x46ab83[_0xe725('0x38')]=_[_0xe725('0x33')](_0x46ab83[_0xe725('0x30')],_0x46ab83[_0xe725('0x31')]);_0x152f55[_0xe725('0x35')]=_['intersection'](_0x46ab83[_0xe725('0x30')],qs[_0xe725('0x34')](_0x56b56b['query'][_0xe725('0x34')]));_0x152f55['attributes']=_0x152f55['attributes'][_0xe725('0x43')]?_0x152f55[_0xe725('0x35')]:_0x46ab83['model'];if(_0x56b56b[_0xe725('0x31')][_0xe725('0x44')]){_0x152f55[_0xe725('0x45')]=[{'all':!![]}];}_0x152f55=_[_0xe725('0x3b')]({},_0x152f55,_0x56b56b[_0xe725('0x3e')]);return db[_0xe725('0x2b')][_0xe725('0x46')](_0x152f55)[_0xe725('0x23')](handleEntityNotFound(_0x23d7fc,null))['then'](respondWithResult(_0x23d7fc,null))[_0xe725('0x40')](handleError(_0x23d7fc,null));};exports[_0xe725('0x47')]=function(_0x1f3080,_0x16e20b){return db[_0xe725('0x2b')][_0xe725('0x47')](_0x1f3080[_0xe725('0x48')],{})['then'](respondWithResult(_0x16e20b,0xc9))[_0xe725('0x40')](handleError(_0x16e20b,null));};exports[_0xe725('0x21')]=function(_0x4f59ab,_0x2a7803){if(_0x4f59ab[_0xe725('0x48')]['id']){delete _0x4f59ab['body']['id'];}return db['IntegrationReport'][_0xe725('0x46')]({'where':{'id':_0x4f59ab[_0xe725('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a7803,null))['then'](saveUpdates(_0x4f59ab[_0xe725('0x48')],null))[_0xe725('0x23')](respondWithResult(_0x2a7803,null))[_0xe725('0x40')](handleError(_0x2a7803,null));};exports[_0xe725('0x22')]=function(_0x150675,_0xba05c1){return db[_0xe725('0x2b')][_0xe725('0x46')]({'where':{'id':_0x150675[_0xe725('0x42')]['id']}})[_0xe725('0x23')](handleEntityNotFound(_0xba05c1,null))[_0xe725('0x23')](removeEntity(_0xba05c1,null))[_0xe725('0x40')](handleError(_0xba05c1,null));};exports[_0xe725('0x49')]=function(_0x3d5de9,_0x3f4b40){return db[_0xe725('0x2b')][_0xe725('0x49')]()[_0xe725('0x23')](respondWithResult(_0x3f4b40,null))['catch'](handleError(_0x3f4b40,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 52100f3..ce13ecc 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 _0x6b70=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger'];(function(_0x274abd,_0x4d9359){var _0x3477b1=function(_0x425a93){while(--_0x425a93){_0x274abd['push'](_0x274abd['shift']());}};_0x3477b1(++_0x4d9359);}(_0x6b70,0x131));var _0x06b7=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0x6b70[_0x316c42];return _0x2b38f7;};'use strict';var _=require(_0x06b7('0x0'));var util=require(_0x06b7('0x1'));var logger=require(_0x06b7('0x2'))(_0x06b7('0x3'));var moment=require(_0x06b7('0x4'));var BPromise=require(_0x06b7('0x5'));var rp=require(_0x06b7('0x6'));var fs=require('fs');var path=require(_0x06b7('0x7'));var rimraf=require(_0x06b7('0x8'));var config=require(_0x06b7('0x9'));var attributes=require('./integrationReport.attributes');module[_0x06b7('0xa')]=function(_0xefb34d,_0x437f7e){return _0xefb34d[_0x06b7('0xb')](_0x06b7('0xc'),attributes,{'tableName':_0x06b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11bd=['bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','api','moment'];(function(_0x15b8f1,_0xff9e26){var _0x4db892=function(_0x49d1a8){while(--_0x49d1a8){_0x15b8f1['push'](_0x15b8f1['shift']());}};_0x4db892(++_0xff9e26);}(_0x11bd,0x1e9));var _0xd11b=function(_0x5d85b2,_0x114e22){_0x5d85b2=_0x5d85b2-0x0;var _0x1c4326=_0x11bd[_0x5d85b2];return _0x1c4326;};'use strict';var _=require(_0xd11b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd11b('0x1'));var moment=require(_0xd11b('0x2'));var BPromise=require(_0xd11b('0x3'));var rp=require(_0xd11b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd11b('0x5'));var config=require(_0xd11b('0x6'));var attributes=require(_0xd11b('0x7'));module[_0xd11b('0x8')]=function(_0x200390,_0x33a412){return _0x200390[_0xd11b('0x9')](_0xd11b('0xa'),attributes,{'tableName':_0xd11b('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 63c6f97..b2de3a1 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 _0x6d38=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xd2bf12,_0x580722){var _0x3d5561=function(_0x14158a){while(--_0x14158a){_0xd2bf12['push'](_0xd2bf12['shift']());}};_0x3d5561(++_0x580722);}(_0x6d38,0x1ef));var _0x86d3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6d38[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x4975,0x86));var _0x5497=function(_0x5331a3,_0x323c4a){_0x5331a3=_0x5331a3-0x0;var _0x355af8=_0x4975[_0x5331a3];return _0x355af8;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5a22bb4..e6ea8a3 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 _0x8825=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x1092fc,_0x2f2df0){var _0x3cf5bc=function(_0x512131){while(--_0x512131){_0x1092fc['push'](_0x1092fc['shift']());}};_0x3cf5bc(++_0x2f2df0);}(_0x8825,0x9e));var _0x5882=function(_0x1cf5f2,_0x1cde30){_0x1cf5f2=_0x1cf5f2-0x0;var _0x270de2=_0x8825[_0x1cf5f2];return _0x270de2;};'use strict';var multer=require('multer');var util=require(_0x5882('0x0'));var path=require(_0x5882('0x1'));var timeout=require(_0x5882('0x2'));var express=require('express');var router=express[_0x5882('0x3')]();var fs_extra=require(_0x5882('0x4'));var auth=require(_0x5882('0x5'));var interaction=require(_0x5882('0x6'));var config=require(_0x5882('0x7'));var controller=require(_0x5882('0x8'));router[_0x5882('0x9')]('/',auth[_0x5882('0xa')](),controller[_0x5882('0xb')]);router[_0x5882('0x9')](_0x5882('0xc'),auth[_0x5882('0xa')](),controller['show']);router[_0x5882('0x9')]('/:id/sub_intervals',auth[_0x5882('0xa')](),controller[_0x5882('0xd')]);router[_0x5882('0xe')]('/',auth['isAuthenticated'](),controller[_0x5882('0xf')]);router[_0x5882('0xe')](_0x5882('0x10'),auth['isAuthenticated'](),controller[_0x5882('0x11')]);router['post'](_0x5882('0x12'),auth['isAuthenticated'](),controller['addIntervals']);router[_0x5882('0x13')](_0x5882('0xc'),auth[_0x5882('0xa')](),controller[_0x5882('0x14')]);router['delete'](_0x5882('0xc'),auth[_0x5882('0xa')](),controller[_0x5882('0x15')]);module[_0x5882('0x16')]=router; \ No newline at end of file +var _0xa4bd=['post','create','/:id/sub_intervals','addInterval','addIntervals','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals'];(function(_0x5701be,_0x31478e){var _0x52cbf7=function(_0x337d64){while(--_0x337d64){_0x5701be['push'](_0x5701be['shift']());}};_0x52cbf7(++_0x31478e);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x3be47d,_0x3b833e){_0x3be47d=_0x3be47d-0x0;var _0x30c21a=_0xa4bd[_0x3be47d];return _0x30c21a;};'use strict';var multer=require(_0xda4b('0x0'));var util=require(_0xda4b('0x1'));var path=require(_0xda4b('0x2'));var timeout=require('connect-timeout');var express=require(_0xda4b('0x3'));var router=express[_0xda4b('0x4')]();var fs_extra=require(_0xda4b('0x5'));var auth=require(_0xda4b('0x6'));var interaction=require(_0xda4b('0x7'));var config=require(_0xda4b('0x8'));var controller=require(_0xda4b('0x9'));router[_0xda4b('0xa')]('/',auth[_0xda4b('0xb')](),controller[_0xda4b('0xc')]);router['get'](_0xda4b('0xd'),auth[_0xda4b('0xb')](),controller[_0xda4b('0xe')]);router[_0xda4b('0xa')]('/:id/sub_intervals',auth[_0xda4b('0xb')](),controller[_0xda4b('0xf')]);router[_0xda4b('0x10')]('/',auth['isAuthenticated'](),controller[_0xda4b('0x11')]);router['post'](_0xda4b('0x12'),auth[_0xda4b('0xb')](),controller[_0xda4b('0x13')]);router[_0xda4b('0x10')]('/:id/sub_intervals/create_many',auth[_0xda4b('0xb')](),controller[_0xda4b('0x14')]);router[_0xda4b('0x15')](_0xda4b('0xd'),auth[_0xda4b('0xb')](),controller[_0xda4b('0x16')]);router[_0xda4b('0x17')](_0xda4b('0xd'),auth[_0xda4b('0xb')](),controller[_0xda4b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 7c3b615..e1877fd 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 _0xd8bb=['sequelize','STRING'];(function(_0x52f298,_0x1177f9){var _0x41ba03=function(_0x1b5040){while(--_0x1b5040){_0x52f298['push'](_0x52f298['shift']());}};_0x41ba03(++_0x1177f9);}(_0xd8bb,0xf4));var _0xbd8b=function(_0xb83e87,_0x501b12){_0xb83e87=_0xb83e87-0x0;var _0x2a6f0d=_0xd8bb[_0xb83e87];return _0x2a6f0d;};'use strict';var Sequelize=require(_0xbd8b('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd8b('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbd8b('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x43a8=['exports','STRING'];(function(_0xd2767c,_0x557505){var _0x4e7003=function(_0x289038){while(--_0x289038){_0xd2767c['push'](_0xd2767c['shift']());}};_0x4e7003(++_0x557505);}(_0x43a8,0xae));var _0x843a=function(_0x406d6c,_0x242fb6){_0x406d6c=_0x406d6c-0x0;var _0x40afea=_0x43a8[_0x406d6c];return _0x40afea;};'use strict';var Sequelize=require('sequelize');module[_0x843a('0x0')]={'name':{'type':Sequelize[_0x843a('0x1')]},'description':{'type':Sequelize[_0x843a('0x1')]},'interval':{'type':Sequelize[_0x843a('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 160ef92..f4d1efc 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 _0x6334=['set','Content-Range','apply','save','then','destroy','get','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','autoAssociation','UserProfileResource','update','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x51a6bf,_0x5eb1ee){var _0x4a39b4=function(_0x3bf03b){while(--_0x3bf03b){_0x51a6bf['push'](_0x51a6bf['shift']());}};_0x4a39b4(++_0x5eb1ee);}(_0x6334,0xf1));var _0x4633=function(_0x34b6aa,_0x5ddd29){_0x34b6aa=_0x34b6aa-0x0;var _0x3ead29=_0x6334[_0x34b6aa];return _0x3ead29;};'use strict';var emlformat=require(_0x4633('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4633('0x1'));var jsonpatch=require(_0x4633('0x2'));var rp=require('request-promise');var moment=require(_0x4633('0x3'));var BPromise=require(_0x4633('0x4'));var Mustache=require(_0x4633('0x5'));var util=require(_0x4633('0x6'));var path=require(_0x4633('0x7'));var sox=require(_0x4633('0x8'));var csv=require(_0x4633('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4633('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4633('0xb'));var jsforce=require(_0x4633('0xc'));var deskjs=require(_0x4633('0xd'));var toCsv=require(_0x4633('0x9'));var querystring=require(_0x4633('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4633('0xf'));var qs=require(_0x4633('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4633('0x11'))(_0x4633('0x12'));var utils=require(_0x4633('0x13'));var config=require(_0x4633('0x14'));var licenseUtil=require(_0x4633('0x15'));var db=require(_0x4633('0x16'))['db'];var extensions=require(_0x4633('0x17'));function respondWithStatusCode(_0x109aa9,_0x50d0fc){_0x50d0fc=_0x50d0fc||0xcc;return function(_0x8e2a66){if(_0x8e2a66){return _0x109aa9[_0x4633('0x18')](_0x50d0fc);}return _0x109aa9[_0x4633('0x19')](_0x50d0fc)[_0x4633('0x1a')]();};}function respondWithResult(_0x109d64,_0xda2625){_0xda2625=_0xda2625||0xc8;return function(_0x8b1809){if(_0x8b1809){return _0x109d64[_0x4633('0x19')](_0xda2625)[_0x4633('0x1b')](_0x8b1809);}};}function respondWithFilteredResult(_0x1b2ac6,_0xacc068){return function(_0x5ba6ba){if(_0x5ba6ba){var _0x27d5b5=typeof _0xacc068[_0x4633('0x1c')]==='undefined'&&typeof _0xacc068['limit']===_0x4633('0x1d');var _0x58bb5d=_0x5ba6ba['count'];var _0xb8a646=_0x27d5b5?0x0:_0xacc068[_0x4633('0x1c')];var _0x3927b7=_0x27d5b5?_0x5ba6ba[_0x4633('0x1e')]:_0xacc068['offset']+_0xacc068[_0x4633('0x1f')];var _0x5784b6;if(_0x3927b7>=_0x58bb5d){_0x3927b7=_0x58bb5d;_0x5784b6=0xc8;}else{_0x5784b6=0xce;}_0x1b2ac6['status'](_0x5784b6);return _0x1b2ac6[_0x4633('0x20')](_0x4633('0x21'),_0xb8a646+'-'+_0x3927b7+'/'+_0x58bb5d)[_0x4633('0x1b')](_0x5ba6ba);}return null;};}function patchUpdates(_0x4838bd){return function(_0x4c2cf9){try{jsonpatch[_0x4633('0x22')](_0x4c2cf9,_0x4838bd,!![]);}catch(_0x5affce){return BPromise['reject'](_0x5affce);}return _0x4c2cf9[_0x4633('0x23')]();};}function saveUpdates(_0x2d0b39,_0xd1c892){return function(_0x509208){if(_0x509208){return _0x509208['update'](_0x2d0b39)[_0x4633('0x24')](function(_0x1a8251){return _0x1a8251;});}return null;};}function removeEntity(_0x5d1137,_0x2b4120){return function(_0xa22b5f){if(_0xa22b5f){return _0xa22b5f[_0x4633('0x25')]()[_0x4633('0x24')](function(){var _0x40805b=_0xa22b5f[_0x4633('0x26')]({'plain':!![]});var _0x1ec3fb='Intervals';return db['UserProfileResource'][_0x4633('0x25')]({'where':{'type':_0x1ec3fb,'resourceId':_0x40805b['id']}})[_0x4633('0x24')](function(){return _0xa22b5f;});})[_0x4633('0x24')](function(){_0x5d1137[_0x4633('0x19')](0xcc)[_0x4633('0x1a')]();});}};}function handleEntityNotFound(_0x2597dd,_0x1fdfab){return function(_0x12e8ef){if(!_0x12e8ef){_0x2597dd[_0x4633('0x18')](0x194);}return _0x12e8ef;};}function handleError(_0x4bfd24,_0x530a69){_0x530a69=_0x530a69||0x1f4;return function(_0x4e7239){logger[_0x4633('0x27')](_0x4e7239[_0x4633('0x28')]);if(_0x4e7239[_0x4633('0x29')]){delete _0x4e7239['name'];}_0x4bfd24[_0x4633('0x19')](_0x530a69)['send'](_0x4e7239);};}exports[_0x4633('0x2a')]=function(_0x159e7e,_0x18dd4d){var _0x358daa={},_0x38caed={},_0xfa11ee={'count':0x0,'rows':[]};var _0x5ce473=_[_0x4633('0x2b')](db[_0x4633('0x2c')][_0x4633('0x2d')],function(_0x2f5c05){return{'name':_0x2f5c05[_0x4633('0x2e')],'type':_0x2f5c05[_0x4633('0x2f')]['key']};});_0x38caed[_0x4633('0x30')]=_[_0x4633('0x2b')](_0x5ce473,_0x4633('0x29'));_0x38caed[_0x4633('0x31')]=_[_0x4633('0x32')](_0x159e7e[_0x4633('0x31')]);_0x38caed[_0x4633('0x33')]=_['intersection'](_0x38caed[_0x4633('0x30')],_0x38caed[_0x4633('0x31')]);_0x358daa[_0x4633('0x34')]=_['intersection'](_0x38caed[_0x4633('0x30')],qs[_0x4633('0x35')](_0x159e7e[_0x4633('0x31')]['fields']));_0x358daa[_0x4633('0x34')]=_0x358daa[_0x4633('0x34')]['length']?_0x358daa[_0x4633('0x34')]:_0x38caed[_0x4633('0x30')];if(!_0x159e7e[_0x4633('0x31')][_0x4633('0x36')](_0x4633('0x37'))){_0x358daa[_0x4633('0x1f')]=qs['limit'](_0x159e7e[_0x4633('0x31')][_0x4633('0x1f')]);_0x358daa[_0x4633('0x1c')]=qs[_0x4633('0x1c')](_0x159e7e[_0x4633('0x31')]['offset']);}_0x358daa[_0x4633('0x38')]=qs[_0x4633('0x39')](_0x159e7e[_0x4633('0x31')][_0x4633('0x39')]);_0x358daa['where']=qs[_0x4633('0x33')](_[_0x4633('0x3a')](_0x159e7e['query'],_0x38caed[_0x4633('0x33')]),_0x5ce473);if(_0x159e7e['query'][_0x4633('0x3b')]){_0x358daa['where']=_[_0x4633('0x3c')](_0x358daa['where'],{'$or':_['map'](_0x5ce473,function(_0x51a9b3){if(_0x51a9b3[_0x4633('0x2f')]!==_0x4633('0x3d')){var _0x53ca06={};_0x53ca06[_0x51a9b3[_0x4633('0x29')]]={'$like':'%'+_0x159e7e[_0x4633('0x31')][_0x4633('0x3b')]+'%'};return _0x53ca06;}})});}_0x358daa=_[_0x4633('0x3c')]({},_0x358daa,_0x159e7e[_0x4633('0x3e')]);var _0x1f6e62={'where':_0x358daa[_0x4633('0x3f')]};return db[_0x4633('0x2c')][_0x4633('0x1e')](_0x1f6e62)[_0x4633('0x24')](function(_0x102fa8){_0xfa11ee['count']=_0x102fa8;if(_0x159e7e[_0x4633('0x31')][_0x4633('0x40')]){_0x358daa[_0x4633('0x41')]=[{'all':!![]}];}return db[_0x4633('0x2c')][_0x4633('0x42')](_0x358daa);})[_0x4633('0x24')](function(_0x1d412e){_0xfa11ee[_0x4633('0x43')]=_0x1d412e;return _0xfa11ee;})[_0x4633('0x24')](respondWithFilteredResult(_0x18dd4d,_0x358daa))[_0x4633('0x44')](handleError(_0x18dd4d,null));};exports[_0x4633('0x45')]=function(_0x37b0c5,_0x42c756){var _0x235989={'raw':!![],'where':{'id':_0x37b0c5[_0x4633('0x46')]['id']}},_0x1b3692={};_0x1b3692[_0x4633('0x30')]=_[_0x4633('0x32')](db[_0x4633('0x2c')][_0x4633('0x2d')]);_0x1b3692[_0x4633('0x31')]=_[_0x4633('0x32')](_0x37b0c5[_0x4633('0x31')]);_0x1b3692[_0x4633('0x33')]=_['intersection'](_0x1b3692[_0x4633('0x30')],_0x1b3692['query']);_0x235989[_0x4633('0x34')]=_[_0x4633('0x47')](_0x1b3692[_0x4633('0x30')],qs[_0x4633('0x35')](_0x37b0c5[_0x4633('0x31')][_0x4633('0x35')]));_0x235989[_0x4633('0x34')]=_0x235989['attributes'][_0x4633('0x48')]?_0x235989[_0x4633('0x34')]:_0x1b3692[_0x4633('0x30')];if(_0x37b0c5[_0x4633('0x31')][_0x4633('0x40')]){_0x235989['include']=[{'all':!![]}];}_0x235989=_[_0x4633('0x3c')]({},_0x235989,_0x37b0c5['options']);return db[_0x4633('0x2c')][_0x4633('0x49')](_0x235989)[_0x4633('0x24')](handleEntityNotFound(_0x42c756,null))[_0x4633('0x24')](respondWithResult(_0x42c756,null))[_0x4633('0x44')](handleError(_0x42c756,null));};exports[_0x4633('0x4a')]=function(_0x57071d,_0x2badbe){return db['Interval'][_0x4633('0x4a')](_0x57071d[_0x4633('0x4b')],{})[_0x4633('0x24')](function(_0x2389eb){var _0x170697=_0x57071d['user'][_0x4633('0x26')]({'plain':!![]});if(!_0x170697)throw new Error(_0x4633('0x4c'));if(_0x170697[_0x4633('0x4d')]===_0x4633('0x4e')){var _0x3d2e51=_0x2389eb[_0x4633('0x26')]({'plain':!![]});var _0x2fe012=_0x4633('0x4f');return db[_0x4633('0x50')][_0x4633('0x49')]({'where':{'name':_0x2fe012,'userProfileId':_0x170697['userProfileId']},'raw':!![]})[_0x4633('0x24')](function(_0x20c13a){if(_0x20c13a&&_0x20c13a[_0x4633('0x51')]===0x0){return db[_0x4633('0x52')]['create']({'name':_0x3d2e51[_0x4633('0x29')],'resourceId':_0x3d2e51['id'],'type':_0x20c13a[_0x4633('0x29')],'sectionId':_0x20c13a['id']},{})[_0x4633('0x24')](function(){return _0x2389eb;});}else{return _0x2389eb;}})[_0x4633('0x44')](function(_0x2e8292){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e8292);throw _0x2e8292;});}return _0x2389eb;})[_0x4633('0x24')](respondWithResult(_0x2badbe,0xc9))['catch'](handleError(_0x2badbe,null));};exports[_0x4633('0x53')]=function(_0x248192,_0x1af397){if(_0x248192[_0x4633('0x4b')]['id']){delete _0x248192['body']['id'];}return db[_0x4633('0x2c')]['find']({'where':{'id':_0x248192[_0x4633('0x46')]['id']}})['then'](handleEntityNotFound(_0x1af397,null))[_0x4633('0x24')](saveUpdates(_0x248192['body'],null))[_0x4633('0x24')](respondWithResult(_0x1af397,null))[_0x4633('0x44')](handleError(_0x1af397,null));};exports[_0x4633('0x25')]=function(_0x619a67,_0xf5f3a6){return db[_0x4633('0x2c')][_0x4633('0x49')]({'where':{'id':_0x619a67['params']['id']}})[_0x4633('0x24')](handleEntityNotFound(_0xf5f3a6,null))[_0x4633('0x24')](removeEntity(_0xf5f3a6,null))['catch'](handleError(_0xf5f3a6,null));};exports[_0x4633('0x54')]=function(_0x525222,_0x35f7bc,_0x1b0783){if(_0x525222[_0x4633('0x4b')]['id']){delete _0x525222[_0x4633('0x4b')]['id'];}return db[_0x4633('0x2c')][_0x4633('0x49')]({'where':{'id':_0x525222[_0x4633('0x46')]['id']}})[_0x4633('0x24')](handleEntityNotFound(_0x35f7bc,null))[_0x4633('0x24')](function(_0x2baaa8){if(_0x2baaa8){_0x525222['body'][_0x4633('0x55')]=_0x2baaa8['id'];return db[_0x4633('0x2c')][_0x4633('0x4a')](_0x525222['body']);}})[_0x4633('0x24')](respondWithResult(_0x35f7bc,null))[_0x4633('0x44')](handleError(_0x35f7bc,null));};exports[_0x4633('0x56')]=function(_0x8ae787,_0x1c592d,_0x1603f7){var _0x9d9c3a={};var _0x554bf2={};var _0x5005d4;var _0x369cc5;return db['Interval'][_0x4633('0x57')]({'where':{'id':_0x8ae787[_0x4633('0x46')]['id']}})[_0x4633('0x24')](handleEntityNotFound(_0x1c592d,null))[_0x4633('0x24')](function(_0x582281){if(_0x582281){_0x5005d4=_0x582281;_0x554bf2[_0x4633('0x30')]=_[_0x4633('0x32')](db[_0x4633('0x2c')][_0x4633('0x2d')]);_0x554bf2[_0x4633('0x31')]=_[_0x4633('0x32')](_0x8ae787[_0x4633('0x31')]);_0x554bf2[_0x4633('0x33')]=_[_0x4633('0x47')](_0x554bf2[_0x4633('0x30')],_0x554bf2[_0x4633('0x31')]);_0x9d9c3a[_0x4633('0x34')]=_[_0x4633('0x47')](_0x554bf2[_0x4633('0x30')],qs['fields'](_0x8ae787['query']['fields']));_0x9d9c3a[_0x4633('0x34')]=_0x9d9c3a[_0x4633('0x34')][_0x4633('0x48')]?_0x9d9c3a[_0x4633('0x34')]:_0x554bf2[_0x4633('0x30')];_0x9d9c3a[_0x4633('0x38')]=qs['sort'](_0x8ae787[_0x4633('0x31')]['sort']);_0x9d9c3a['where']=qs[_0x4633('0x33')](_['pick'](_0x8ae787['query'],_0x554bf2[_0x4633('0x33')]));if(_0x8ae787['query'][_0x4633('0x3b')]){_0x9d9c3a[_0x4633('0x3f')]=_[_0x4633('0x3c')](_0x9d9c3a[_0x4633('0x3f')],{'$or':_['map'](_0x9d9c3a['attributes'],function(_0x34322b){var _0x5249f6={};_0x5249f6[_0x34322b]={'$like':'%'+_0x8ae787['query']['filter']+'%'};return _0x5249f6;})});}_0x9d9c3a=_[_0x4633('0x3c')]({},_0x9d9c3a,_0x8ae787[_0x4633('0x3e')]);return _0x5005d4[_0x4633('0x56')](_0x9d9c3a);}})[_0x4633('0x24')](function(_0x5ae623){if(_0x5ae623){_0x369cc5=_0x5ae623['length'];if(!_0x8ae787[_0x4633('0x31')]['hasOwnProperty']('nolimit')){_0x9d9c3a[_0x4633('0x1f')]=qs[_0x4633('0x1f')](_0x8ae787[_0x4633('0x31')][_0x4633('0x1f')]);_0x9d9c3a['offset']=qs[_0x4633('0x1c')](_0x8ae787[_0x4633('0x31')][_0x4633('0x1c')]);}return _0x5005d4[_0x4633('0x56')](_0x9d9c3a);}})[_0x4633('0x24')](function(_0x4afcd5){if(_0x4afcd5){return _0x4afcd5?{'count':_0x369cc5,'rows':_0x4afcd5}:null;}})[_0x4633('0x24')](respondWithResult(_0x1c592d,null))[_0x4633('0x44')](handleError(_0x1c592d,null));};exports[_0x4633('0x58')]=function(_0x2059d0,_0x18c5fe,_0x8608f){return db[_0x4633('0x2c')][_0x4633('0x57')]({'where':{'id':_0x2059d0[_0x4633('0x46')]['id']}})[_0x4633('0x24')](handleEntityNotFound(_0x18c5fe,null))[_0x4633('0x24')](function(_0x4a78f2){if(_0x4a78f2){return db[_0x4633('0x59')][_0x4633('0x5a')](function(_0x29c328){return db[_0x4633('0x2c')][_0x4633('0x25')]({'where':{'IntervalId':_0x2059d0[_0x4633('0x46')]['id']},'transaction':_0x29c328})[_0x4633('0x24')](function(_0x1605df){var _0x46705d=_[_0x4633('0x2b')](_0x2059d0[_0x4633('0x4b')],function(_0xd2eef7){delete _0xd2eef7['id'];_0xd2eef7[_0x4633('0x55')]=_0x2059d0[_0x4633('0x46')]['id'];return _0xd2eef7;});return db[_0x4633('0x2c')]['bulkCreate'](_0x46705d,{'transaction':_0x29c328});});})['then'](function(){return db[_0x4633('0x2c')][_0x4633('0x42')]({'where':{'IntervalId':_0x2059d0[_0x4633('0x46')]['id']}});});}})[_0x4633('0x24')](respondWithResult(_0x18c5fe,null))[_0x4633('0x44')](handleError(_0x18c5fe,null));}; \ No newline at end of file +var _0x8fa3=['findOne','order','map','sequelize','transaction','IntervalId','bulkCreate','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','Interval','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8fa3,0x1c9));var _0x38fa=function(_0x155bb4,_0x22d4c4){_0x155bb4=_0x155bb4-0x0;var _0xb111d2=_0x8fa3[_0x155bb4];return _0xb111d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38fa('0x0'));var zipdir=require(_0x38fa('0x1'));var jsonpatch=require(_0x38fa('0x2'));var rp=require('request-promise');var moment=require(_0x38fa('0x3'));var BPromise=require(_0x38fa('0x4'));var Mustache=require(_0x38fa('0x5'));var util=require(_0x38fa('0x6'));var path=require(_0x38fa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38fa('0x8'));var fs=require('fs');var fs_extra=require(_0x38fa('0x9'));var _=require('lodash');var squel=require(_0x38fa('0xa'));var crypto=require(_0x38fa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x38fa('0xc'));var toCsv=require(_0x38fa('0xd'));var querystring=require('querystring');var Papa=require(_0x38fa('0xe'));var Redis=require(_0x38fa('0xf'));var authService=require(_0x38fa('0x10'));var qs=require(_0x38fa('0x11'));var as=require(_0x38fa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x38fa('0x13'));var utils=require(_0x38fa('0x14'));var config=require(_0x38fa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x38fa('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4b4c5c,_0x26aab0){_0x26aab0=_0x26aab0||0xcc;return function(_0x16496d){if(_0x16496d){return _0x4b4c5c[_0x38fa('0x17')](_0x26aab0);}return _0x4b4c5c['status'](_0x26aab0)[_0x38fa('0x18')]();};}function respondWithResult(_0x2c8e26,_0x5eb4e8){_0x5eb4e8=_0x5eb4e8||0xc8;return function(_0xcd6809){if(_0xcd6809){return _0x2c8e26[_0x38fa('0x19')](_0x5eb4e8)['json'](_0xcd6809);}};}function respondWithFilteredResult(_0x4a4643,_0x34b19d){return function(_0x2ae76c){if(_0x2ae76c){var _0x14734c=typeof _0x34b19d[_0x38fa('0x1a')]==='undefined'&&typeof _0x34b19d[_0x38fa('0x1b')]===_0x38fa('0x1c');var _0x527fc5=_0x2ae76c[_0x38fa('0x1d')];var _0x1d9a0c=_0x14734c?0x0:_0x34b19d[_0x38fa('0x1a')];var _0x11418c=_0x14734c?_0x2ae76c[_0x38fa('0x1d')]:_0x34b19d['offset']+_0x34b19d['limit'];var _0x346a83;if(_0x11418c>=_0x527fc5){_0x11418c=_0x527fc5;_0x346a83=0xc8;}else{_0x346a83=0xce;}_0x4a4643['status'](_0x346a83);return _0x4a4643[_0x38fa('0x1e')](_0x38fa('0x1f'),_0x1d9a0c+'-'+_0x11418c+'/'+_0x527fc5)[_0x38fa('0x20')](_0x2ae76c);}return null;};}function patchUpdates(_0x234340){return function(_0x82a924){try{jsonpatch[_0x38fa('0x21')](_0x82a924,_0x234340,!![]);}catch(_0x452578){return BPromise[_0x38fa('0x22')](_0x452578);}return _0x82a924['save']();};}function saveUpdates(_0x43c06f,_0x113c5e){return function(_0x2f11e3){if(_0x2f11e3){return _0x2f11e3[_0x38fa('0x23')](_0x43c06f)['then'](function(_0x508a13){return _0x508a13;});}return null;};}function removeEntity(_0x56fd3b,_0x3046cc){return function(_0x3cee27){if(_0x3cee27){return _0x3cee27[_0x38fa('0x24')]()[_0x38fa('0x25')](function(){var _0x21fde8=_0x3cee27[_0x38fa('0x26')]({'plain':!![]});var _0x5be57e='Intervals';return db[_0x38fa('0x27')]['destroy']({'where':{'type':_0x5be57e,'resourceId':_0x21fde8['id']}})[_0x38fa('0x25')](function(){return _0x3cee27;});})['then'](function(){_0x56fd3b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf7268,_0x5082f3){return function(_0x861915){if(!_0x861915){_0xaf7268[_0x38fa('0x17')](0x194);}return _0x861915;};}function handleError(_0x5e36a7,_0x2601b4){_0x2601b4=_0x2601b4||0x1f4;return function(_0x94a0dc){logger[_0x38fa('0x28')](_0x94a0dc[_0x38fa('0x29')]);if(_0x94a0dc['name']){delete _0x94a0dc[_0x38fa('0x2a')];}_0x5e36a7['status'](_0x2601b4)[_0x38fa('0x2b')](_0x94a0dc);};}exports[_0x38fa('0x2c')]=function(_0x1f5f0b,_0x3e25f3){var _0x482659={},_0x387784={},_0x4670c8={'count':0x0,'rows':[]};var _0x5f4e18=_['map'](db['Interval']['rawAttributes'],function(_0x119c20){return{'name':_0x119c20[_0x38fa('0x2d')],'type':_0x119c20[_0x38fa('0x2e')][_0x38fa('0x2f')]};});_0x387784[_0x38fa('0x30')]=_['map'](_0x5f4e18,'name');_0x387784[_0x38fa('0x31')]=_[_0x38fa('0x32')](_0x1f5f0b[_0x38fa('0x31')]);_0x387784['filters']=_[_0x38fa('0x33')](_0x387784['model'],_0x387784[_0x38fa('0x31')]);_0x482659[_0x38fa('0x34')]=_[_0x38fa('0x33')](_0x387784[_0x38fa('0x30')],qs[_0x38fa('0x35')](_0x1f5f0b[_0x38fa('0x31')]['fields']));_0x482659[_0x38fa('0x34')]=_0x482659[_0x38fa('0x34')][_0x38fa('0x36')]?_0x482659['attributes']:_0x387784['model'];if(!_0x1f5f0b['query'][_0x38fa('0x37')]('nolimit')){_0x482659['limit']=qs[_0x38fa('0x1b')](_0x1f5f0b[_0x38fa('0x31')][_0x38fa('0x1b')]);_0x482659[_0x38fa('0x1a')]=qs['offset'](_0x1f5f0b['query'][_0x38fa('0x1a')]);}_0x482659['order']=qs['sort'](_0x1f5f0b[_0x38fa('0x31')][_0x38fa('0x38')]);_0x482659[_0x38fa('0x39')]=qs[_0x38fa('0x3a')](_[_0x38fa('0x3b')](_0x1f5f0b[_0x38fa('0x31')],_0x387784[_0x38fa('0x3a')]),_0x5f4e18);if(_0x1f5f0b['query']['filter']){_0x482659['where']=_[_0x38fa('0x3c')](_0x482659['where'],{'$or':_['map'](_0x5f4e18,function(_0x307acd){if(_0x307acd[_0x38fa('0x2e')]!==_0x38fa('0x3d')){var _0x226986={};_0x226986[_0x307acd[_0x38fa('0x2a')]]={'$like':'%'+_0x1f5f0b[_0x38fa('0x31')][_0x38fa('0x3e')]+'%'};return _0x226986;}})});}_0x482659=_[_0x38fa('0x3c')]({},_0x482659,_0x1f5f0b[_0x38fa('0x3f')]);var _0x1c4274={'where':_0x482659[_0x38fa('0x39')]};return db[_0x38fa('0x40')][_0x38fa('0x1d')](_0x1c4274)[_0x38fa('0x25')](function(_0x595871){_0x4670c8['count']=_0x595871;if(_0x1f5f0b[_0x38fa('0x31')][_0x38fa('0x41')]){_0x482659[_0x38fa('0x42')]=[{'all':!![]}];}return db[_0x38fa('0x40')][_0x38fa('0x43')](_0x482659);})['then'](function(_0x12163b){_0x4670c8[_0x38fa('0x44')]=_0x12163b;return _0x4670c8;})[_0x38fa('0x25')](respondWithFilteredResult(_0x3e25f3,_0x482659))[_0x38fa('0x45')](handleError(_0x3e25f3,null));};exports[_0x38fa('0x46')]=function(_0xb5810b,_0x497b89){var _0x2e68bc={'raw':!![],'where':{'id':_0xb5810b['params']['id']}},_0x40cd3b={};_0x40cd3b[_0x38fa('0x30')]=_[_0x38fa('0x32')](db[_0x38fa('0x40')][_0x38fa('0x47')]);_0x40cd3b[_0x38fa('0x31')]=_[_0x38fa('0x32')](_0xb5810b['query']);_0x40cd3b[_0x38fa('0x3a')]=_[_0x38fa('0x33')](_0x40cd3b[_0x38fa('0x30')],_0x40cd3b[_0x38fa('0x31')]);_0x2e68bc['attributes']=_['intersection'](_0x40cd3b[_0x38fa('0x30')],qs[_0x38fa('0x35')](_0xb5810b['query']['fields']));_0x2e68bc['attributes']=_0x2e68bc['attributes'][_0x38fa('0x36')]?_0x2e68bc[_0x38fa('0x34')]:_0x40cd3b[_0x38fa('0x30')];if(_0xb5810b[_0x38fa('0x31')]['includeAll']){_0x2e68bc['include']=[{'all':!![]}];}_0x2e68bc=_[_0x38fa('0x3c')]({},_0x2e68bc,_0xb5810b[_0x38fa('0x3f')]);return db[_0x38fa('0x40')]['find'](_0x2e68bc)[_0x38fa('0x25')](handleEntityNotFound(_0x497b89,null))['then'](respondWithResult(_0x497b89,null))[_0x38fa('0x45')](handleError(_0x497b89,null));};exports[_0x38fa('0x48')]=function(_0x32a4cd,_0xa9c295){return db['Interval'][_0x38fa('0x48')](_0x32a4cd[_0x38fa('0x49')],{})[_0x38fa('0x25')](function(_0x248d3d){var _0x55c986=_0x32a4cd['user'][_0x38fa('0x26')]({'plain':!![]});if(!_0x55c986)throw new Error(_0x38fa('0x4a'));if(_0x55c986['role']==='user'){var _0xe8dc7e=_0x248d3d[_0x38fa('0x26')]({'plain':!![]});var _0x5bab9f=_0x38fa('0x4b');return db['UserProfileSection'][_0x38fa('0x4c')]({'where':{'name':_0x5bab9f,'userProfileId':_0x55c986[_0x38fa('0x4d')]},'raw':!![]})[_0x38fa('0x25')](function(_0x5b8e9c){if(_0x5b8e9c&&_0x5b8e9c[_0x38fa('0x4e')]===0x0){return db['UserProfileResource'][_0x38fa('0x48')]({'name':_0xe8dc7e[_0x38fa('0x2a')],'resourceId':_0xe8dc7e['id'],'type':_0x5b8e9c[_0x38fa('0x2a')],'sectionId':_0x5b8e9c['id']},{})[_0x38fa('0x25')](function(){return _0x248d3d;});}else{return _0x248d3d;}})[_0x38fa('0x45')](function(_0x389816){logger[_0x38fa('0x28')](_0x38fa('0x4f'),_0x389816);throw _0x389816;});}return _0x248d3d;})[_0x38fa('0x25')](respondWithResult(_0xa9c295,0xc9))[_0x38fa('0x45')](handleError(_0xa9c295,null));};exports[_0x38fa('0x23')]=function(_0x251846,_0x3e955d){if(_0x251846['body']['id']){delete _0x251846[_0x38fa('0x49')]['id'];}return db[_0x38fa('0x40')][_0x38fa('0x4c')]({'where':{'id':_0x251846[_0x38fa('0x50')]['id']}})[_0x38fa('0x25')](handleEntityNotFound(_0x3e955d,null))['then'](saveUpdates(_0x251846[_0x38fa('0x49')],null))[_0x38fa('0x25')](respondWithResult(_0x3e955d,null))['catch'](handleError(_0x3e955d,null));};exports[_0x38fa('0x24')]=function(_0x3f55bf,_0x3b342c){return db[_0x38fa('0x40')][_0x38fa('0x4c')]({'where':{'id':_0x3f55bf[_0x38fa('0x50')]['id']}})[_0x38fa('0x25')](handleEntityNotFound(_0x3b342c,null))[_0x38fa('0x25')](removeEntity(_0x3b342c,null))[_0x38fa('0x45')](handleError(_0x3b342c,null));};exports[_0x38fa('0x51')]=function(_0x3f2b21,_0x59f6ce,_0x20b9a3){if(_0x3f2b21[_0x38fa('0x49')]['id']){delete _0x3f2b21[_0x38fa('0x49')]['id'];}return db[_0x38fa('0x40')][_0x38fa('0x4c')]({'where':{'id':_0x3f2b21[_0x38fa('0x50')]['id']}})[_0x38fa('0x25')](handleEntityNotFound(_0x59f6ce,null))[_0x38fa('0x25')](function(_0x51ab87){if(_0x51ab87){_0x3f2b21[_0x38fa('0x49')]['IntervalId']=_0x51ab87['id'];return db[_0x38fa('0x40')]['create'](_0x3f2b21['body']);}})['then'](respondWithResult(_0x59f6ce,null))[_0x38fa('0x45')](handleError(_0x59f6ce,null));};exports[_0x38fa('0x52')]=function(_0x3af81e,_0x521536,_0x33d5a5){var _0x728092={};var _0x4a623d={};var _0x455708;var _0x370c9e;return db[_0x38fa('0x40')][_0x38fa('0x53')]({'where':{'id':_0x3af81e[_0x38fa('0x50')]['id']}})[_0x38fa('0x25')](handleEntityNotFound(_0x521536,null))['then'](function(_0x2fe1fe){if(_0x2fe1fe){_0x455708=_0x2fe1fe;_0x4a623d[_0x38fa('0x30')]=_['keys'](db[_0x38fa('0x40')]['rawAttributes']);_0x4a623d[_0x38fa('0x31')]=_[_0x38fa('0x32')](_0x3af81e['query']);_0x4a623d[_0x38fa('0x3a')]=_[_0x38fa('0x33')](_0x4a623d[_0x38fa('0x30')],_0x4a623d['query']);_0x728092['attributes']=_[_0x38fa('0x33')](_0x4a623d['model'],qs[_0x38fa('0x35')](_0x3af81e[_0x38fa('0x31')][_0x38fa('0x35')]));_0x728092['attributes']=_0x728092[_0x38fa('0x34')]['length']?_0x728092[_0x38fa('0x34')]:_0x4a623d[_0x38fa('0x30')];_0x728092[_0x38fa('0x54')]=qs[_0x38fa('0x38')](_0x3af81e[_0x38fa('0x31')][_0x38fa('0x38')]);_0x728092['where']=qs[_0x38fa('0x3a')](_[_0x38fa('0x3b')](_0x3af81e[_0x38fa('0x31')],_0x4a623d[_0x38fa('0x3a')]));if(_0x3af81e[_0x38fa('0x31')][_0x38fa('0x3e')]){_0x728092[_0x38fa('0x39')]=_[_0x38fa('0x3c')](_0x728092[_0x38fa('0x39')],{'$or':_[_0x38fa('0x55')](_0x728092[_0x38fa('0x34')],function(_0x14d1fb){var _0x18d0ae={};_0x18d0ae[_0x14d1fb]={'$like':'%'+_0x3af81e[_0x38fa('0x31')][_0x38fa('0x3e')]+'%'};return _0x18d0ae;})});}_0x728092=_['merge']({},_0x728092,_0x3af81e[_0x38fa('0x3f')]);return _0x455708[_0x38fa('0x52')](_0x728092);}})[_0x38fa('0x25')](function(_0x14eec3){if(_0x14eec3){_0x370c9e=_0x14eec3[_0x38fa('0x36')];if(!_0x3af81e[_0x38fa('0x31')][_0x38fa('0x37')]('nolimit')){_0x728092[_0x38fa('0x1b')]=qs[_0x38fa('0x1b')](_0x3af81e['query'][_0x38fa('0x1b')]);_0x728092[_0x38fa('0x1a')]=qs[_0x38fa('0x1a')](_0x3af81e[_0x38fa('0x31')][_0x38fa('0x1a')]);}return _0x455708[_0x38fa('0x52')](_0x728092);}})[_0x38fa('0x25')](function(_0x4e0f69){if(_0x4e0f69){return _0x4e0f69?{'count':_0x370c9e,'rows':_0x4e0f69}:null;}})['then'](respondWithResult(_0x521536,null))['catch'](handleError(_0x521536,null));};exports['addIntervals']=function(_0x548c7c,_0x598c01,_0x5e2ed8){return db['Interval'][_0x38fa('0x53')]({'where':{'id':_0x548c7c[_0x38fa('0x50')]['id']}})[_0x38fa('0x25')](handleEntityNotFound(_0x598c01,null))[_0x38fa('0x25')](function(_0x945db3){if(_0x945db3){return db[_0x38fa('0x56')][_0x38fa('0x57')](function(_0x533f3c){return db[_0x38fa('0x40')][_0x38fa('0x24')]({'where':{'IntervalId':_0x548c7c['params']['id']},'transaction':_0x533f3c})['then'](function(_0x1ffbb5){var _0x5c81f3=_[_0x38fa('0x55')](_0x548c7c[_0x38fa('0x49')],function(_0x50327f){delete _0x50327f['id'];_0x50327f[_0x38fa('0x58')]=_0x548c7c[_0x38fa('0x50')]['id'];return _0x50327f;});return db[_0x38fa('0x40')][_0x38fa('0x59')](_0x5c81f3,{'transaction':_0x533f3c});});})[_0x38fa('0x25')](function(){return db[_0x38fa('0x40')][_0x38fa('0x43')]({'where':{'IntervalId':_0x548c7c[_0x38fa('0x50')]['id']}});});}})['then'](respondWithResult(_0x598c01,null))['catch'](handleError(_0x598c01,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index fbae7f5..9b854ad 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 _0xf2f0=['map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','tools_intervals','rewrite','interval','string','getIntervals','all'];(function(_0x400b06,_0x43ab8c){var _0x210503=function(_0x4ed05e){while(--_0x4ed05e){_0x400b06['push'](_0x400b06['shift']());}};_0x210503(++_0x43ab8c);}(_0xf2f0,0xc6));var _0x0f2f=function(_0x39d980,_0x15c127){_0x39d980=_0x39d980-0x0;var _0x33fcbc=_0xf2f0[_0x39d980];return _0x33fcbc;};'use strict';var attributes=require(_0x0f2f('0x0'));var extensions=require(_0x0f2f('0x1'));var iftime=require(_0x0f2f('0x2'))[_0x0f2f('0x3')];module['exports']=function(_0x1fda07){return _0x1fda07['define']('Interval',attributes,{'tableName':_0x0f2f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x9c2297){extensions[_0x0f2f('0x5')](_0x1fda07,_0x9c2297);},'afterBulkCreate':function(_0xc51c43,_0x5bd5d0,_0x25de20){_0x25de20();extensions[_0x0f2f('0x5')](_0x1fda07,_0xc51c43[0x0]);},'afterUpdate':function(_0x2d5e8d){extensions[_0x0f2f('0x5')](_0x1fda07,_0x2d5e8d);},'afterDestroy':function(_0x5f115e){extensions[_0x0f2f('0x5')](_0x1fda07,_0x5f115e);}},'instanceMethods':{'ifTime':function(_0x2ede42=undefined,_0x4f2eeb=new Date()){if(typeof this[_0x0f2f('0x6')]===_0x0f2f('0x7')){return iftime(this[_0x0f2f('0x6')],_0x2ede42,_0x4f2eeb);}else{return this[_0x0f2f('0x8')]()['then'](function(_0x429874){return Promise[_0x0f2f('0x9')](_0x429874[_0x0f2f('0xa')](function(_0x3e359c){return _0x3e359c[_0x0f2f('0xb')](_0x2ede42,_0x4f2eeb);}));})['then'](function(_0x5c6f28){return _0x5c6f28[_0x0f2f('0xc')](function(_0x1b271f,_0x52f9c2){return _0x1b271f||_0x52f9c2;},![]);});}}}});}; \ No newline at end of file +var _0x2a4c=['tools_intervals','rewrite','interval','string','then','all','map','ifTime','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval'];(function(_0x35568f,_0x4ed4b1){var _0x54b75e=function(_0x3edb09){while(--_0x3edb09){_0x35568f['push'](_0x35568f['shift']());}};_0x54b75e(++_0x4ed4b1);}(_0x2a4c,0xb0));var _0xc2a4=function(_0x10a9fd,_0x2d2dc6){_0x10a9fd=_0x10a9fd-0x0;var _0x33e896=_0x2a4c[_0x10a9fd];return _0x33e896;};'use strict';var attributes=require(_0xc2a4('0x0'));var extensions=require(_0xc2a4('0x1'));var iftime=require(_0xc2a4('0x2'))['iftime'];module[_0xc2a4('0x3')]=function(_0x4a905c){return _0x4a905c[_0xc2a4('0x4')](_0xc2a4('0x5'),attributes,{'tableName':_0xc2a4('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c3b27){extensions['rewrite'](_0x4a905c,_0x3c3b27);},'afterBulkCreate':function(_0x5b3f0,_0x1714c2,_0x41716b){_0x41716b();extensions[_0xc2a4('0x7')](_0x4a905c,_0x5b3f0[0x0]);},'afterUpdate':function(_0x3ed54a){extensions[_0xc2a4('0x7')](_0x4a905c,_0x3ed54a);},'afterDestroy':function(_0x6b39a5){extensions[_0xc2a4('0x7')](_0x4a905c,_0x6b39a5);}},'instanceMethods':{'ifTime':function(_0x3c4dc3=undefined,_0x539ccd=new Date()){if(typeof this[_0xc2a4('0x8')]===_0xc2a4('0x9')){return iftime(this['interval'],_0x3c4dc3,_0x539ccd);}else{return this['getIntervals']()[_0xc2a4('0xa')](function(_0x52f971){return Promise[_0xc2a4('0xb')](_0x52f971[_0xc2a4('0xc')](function(_0x28016c){return _0x28016c[_0xc2a4('0xd')](_0x3c4dc3,_0x539ccd);}));})['then'](function(_0x1d33c9){return _0x1d33c9['reduce'](function(_0x46c437,_0x3d7bdb){return _0x46c437||_0x3d7bdb;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9a961a1..6634aa0 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 _0x3a07=['isArray','lodash','../../mysqldb','../../config/logger','rpc','GetInterval','findAll','options','where','attributes','limit','include','map','model','then','stringify','catch','error','message','ShowInterval','Interval','find','info','debug','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly'];(function(_0x171dbe,_0x5a34b4){var _0x2601f7=function(_0x22ef8b){while(--_0x22ef8b){_0x171dbe['push'](_0x171dbe['shift']());}};_0x2601f7(++_0x5a34b4);}(_0x3a07,0xfd));var _0x73a0=function(_0x408ef9,_0x4767bc){_0x408ef9=_0x408ef9-0x0;var _0x1c807f=_0x3a07[_0x408ef9];return _0x1c807f;};'use strict';var _=require(_0x73a0('0x0'));var util=require('util');var db=require(_0x73a0('0x1'))['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require(_0x73a0('0x2'))(_0x73a0('0x3'));exports[_0x73a0('0x4')]=function(_0x5237f1){var _0x17b576=this;return new Promise(function(_0x2e70d7,_0x27537a){return db['Interval'][_0x73a0('0x5')]({'raw':_0x5237f1[_0x73a0('0x6')]?_0x5237f1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5237f1[_0x73a0('0x6')]?_0x5237f1[_0x73a0('0x6')][_0x73a0('0x7')]||null:null,'attributes':_0x5237f1[_0x73a0('0x6')]?_0x5237f1[_0x73a0('0x6')][_0x73a0('0x8')]||null:null,'limit':_0x5237f1[_0x73a0('0x6')]?_0x5237f1[_0x73a0('0x6')][_0x73a0('0x9')]||null:null,'include':_0x5237f1[_0x73a0('0x6')]?_0x5237f1[_0x73a0('0x6')][_0x73a0('0xa')]?_[_0x73a0('0xb')](_0x5237f1[_0x73a0('0x6')][_0x73a0('0xa')],function(_0x30c095){return{'model':db[_0x30c095['model']],'as':_0x30c095['as'],'attributes':_0x30c095[_0x73a0('0x8')],'include':_0x30c095[_0x73a0('0xa')]?_[_0x73a0('0xb')](_0x30c095['include'],function(_0xe9c30c){return{'model':db[_0xe9c30c[_0x73a0('0xc')]],'as':_0xe9c30c['as'],'attributes':_0xe9c30c['attributes'],'include':_0xe9c30c[_0x73a0('0xa')]?_[_0x73a0('0xb')](_0xe9c30c[_0x73a0('0xa')],function(_0x4940b8){return{'model':db[_0x4940b8['model']],'as':_0x4940b8['as'],'attributes':_0x4940b8[_0x73a0('0x8')]};}):[]};}):[]};}):[]:[]})[_0x73a0('0xd')](function(_0x4962d1){logger['info']('GetInterval',_0x5237f1);logger['debug'](_0x73a0('0x4'),_0x5237f1,JSON[_0x73a0('0xe')](_0x4962d1));_0x2e70d7(_0x4962d1);})[_0x73a0('0xf')](function(_0x35d62b){logger[_0x73a0('0x10')]('GetInterval',_0x35d62b[_0x73a0('0x11')],_0x5237f1);_0x27537a(_0x17b576[_0x73a0('0x10')](0x1f4,_0x35d62b[_0x73a0('0x11')]));});});};exports[_0x73a0('0x12')]=function(_0x33cb00){var _0x1401b7=this;return new Promise(function(_0x35ef02,_0x2ae016){return db[_0x73a0('0x13')][_0x73a0('0x14')]({'raw':_0x33cb00['options']?_0x33cb00[_0x73a0('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x33cb00['options']?_0x33cb00['options'][_0x73a0('0x7')]||null:null,'attributes':_0x33cb00[_0x73a0('0x6')]?_0x33cb00[_0x73a0('0x6')][_0x73a0('0x8')]||null:null,'include':_0x33cb00[_0x73a0('0x6')]?_0x33cb00['options'][_0x73a0('0xa')]?_['map'](_0x33cb00[_0x73a0('0x6')][_0x73a0('0xa')],function(_0x593f63){return{'model':db[_0x593f63[_0x73a0('0xc')]],'as':_0x593f63['as'],'attributes':_0x593f63[_0x73a0('0x8')],'include':_0x593f63[_0x73a0('0xa')]?_[_0x73a0('0xb')](_0x593f63[_0x73a0('0xa')],function(_0x2e108a){return{'model':db[_0x2e108a[_0x73a0('0xc')]],'as':_0x2e108a['as'],'attributes':_0x2e108a[_0x73a0('0x8')],'include':_0x2e108a['include']?_[_0x73a0('0xb')](_0x2e108a['include'],function(_0x5b72f3){return{'model':db[_0x5b72f3[_0x73a0('0xc')]],'as':_0x5b72f3['as'],'attributes':_0x5b72f3[_0x73a0('0x8')]};}):[]};}):[]};}):[]:[]})[_0x73a0('0xd')](function(_0x114a4f){logger[_0x73a0('0x15')](_0x73a0('0x12'),_0x33cb00);logger[_0x73a0('0x16')](_0x73a0('0x12'),_0x33cb00,JSON[_0x73a0('0xe')](_0x114a4f));_0x35ef02(_0x114a4f);})[_0x73a0('0xf')](function(_0x5a43d8){logger[_0x73a0('0x10')](_0x73a0('0x12'),_0x5a43d8[_0x73a0('0x11')],_0x33cb00);_0x2ae016(_0x1401b7[_0x73a0('0x10')](0x1f4,_0x5a43d8[_0x73a0('0x11')]));});});};function checkArrayOfIntervals(_0x1ce04a,_0x36f293){var _0x187bb0=[];return db[_0x73a0('0x13')]['findAll']({'where':{'id':_0x1ce04a}})['then'](function(_0x3c7c7b){_0x187bb0=_0x3c7c7b;return Promise['all'](_0x187bb0['map'](function(_0x57f07d){return _0x57f07d['ifTime'](_0x36f293);}));})[_0x73a0('0xd')](function(_0x4fe263){var _0x493cf4=_0x4fe263[_0x73a0('0x17')](function(_0x251188,_0x34f67f){return _0x251188||_0x34f67f;},![]);logger['info'](util[_0x73a0('0x18')](_0x73a0('0x19'),_0x187bb0[_0x73a0('0xb')](function(_0x490c2b){return _0x490c2b[_0x73a0('0x1a')];})[_0x73a0('0x1b')](',\x20'),_0x187bb0[_0x73a0('0xb')](function(_0x2942de){return _0x2942de['id'];})['join'](',\x20')));return _0x493cf4;});}function checkSingleInterval(_0x4221c6,_0x37c8c8){return db[_0x73a0('0x13')][_0x73a0('0x1c')](_0x4221c6)[_0x73a0('0xd')](function(_0x524215){if(_0x524215){logger[_0x73a0('0x15')](util[_0x73a0('0x18')](_0x73a0('0x1d'),_0x524215[_0x73a0('0x1a')],_0x524215['id']));return _0x524215[_0x73a0('0x1e')](_0x37c8c8);}});}exports[_0x73a0('0x1f')]=function(_0x2c25d6){var _0x1f93c8=_0x2c25d6[_0x73a0('0x20')];var _0x5afd40=Array['isArray'](_0x2c25d6[_0x73a0('0x21')])?_0x2c25d6[_0x73a0('0x21')]:typeof _0x2c25d6['intervals']===_0x73a0('0x22')?[_0x2c25d6[_0x73a0('0x21')]]:[];var _0x9f4007=_0x2c25d6[_0x73a0('0x23')]||undefined;var _0x504df7=![];if(_0x5afd40[_0x73a0('0x24')]){logger['info'](util[_0x73a0('0x18')](_0x73a0('0x25'),_0x5afd40[_0x73a0('0x1b')](';\x20')));}if(_0x9f4007){logger['info'](util[_0x73a0('0x18')](_0x73a0('0x26'),_0x9f4007));}logger['debug'](_0x73a0('0x27'),_0x504df7);logger[_0x73a0('0x28')]('IntervalIftime',_0x2c25d6);return Promise['resolve']()[_0x73a0('0xd')](function(){if(Array[_0x73a0('0x29')](_0x1f93c8)){return checkArrayOfIntervals(_0x1f93c8,_0x9f4007);}else if(_0x1f93c8){return checkSingleInterval(_0x1f93c8,_0x9f4007);}})[_0x73a0('0xd')](function(_0x59df5d){var _0x82c394=_0x5afd40[_0x73a0('0x17')](function(_0x53bd84,_0x59189a){return _0x53bd84||iftime(_0x59189a,_0x9f4007);},![]);_0x504df7=_0x59df5d||_0x82c394;return _0x504df7;})[_0x73a0('0xf')](function(_0x5bfa80){logger[_0x73a0('0x10')](_0x73a0('0x1f'),_0x2c25d6,_0x5bfa80);throw this[_0x73a0('0x10')](0x1f4,_0x5bfa80['message']);});}; \ No newline at end of file +var _0x805f=['../../config/logger','rpc','Interval','options','raw','where','attributes','limit','include','map','model','then','info','GetInterval','debug','stringify','message','find','ShowInterval','catch','error','all','ifTime','reduce','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','length','format','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime'];(function(_0x41ea11,_0x1543c9){var _0x3d886e=function(_0x25b418){while(--_0x25b418){_0x41ea11['push'](_0x41ea11['shift']());}};_0x3d886e(++_0x1543c9);}(_0x805f,0x1c9));var _0xf805=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x805f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf805('0x0'));var util=require(_0xf805('0x1'));var db=require(_0xf805('0x2'))['db'];var iftime=require(_0xf805('0x3'))[_0xf805('0x4')];var logger=require(_0xf805('0x5'))(_0xf805('0x6'));exports['GetInterval']=function(_0xf41a42){var _0x24a917=this;return new Promise(function(_0x525920,_0x30f09b){return db[_0xf805('0x7')]['findAll']({'raw':_0xf41a42[_0xf805('0x8')]?_0xf41a42[_0xf805('0x8')][_0xf805('0x9')]===undefined?!![]:![]:!![],'where':_0xf41a42[_0xf805('0x8')]?_0xf41a42[_0xf805('0x8')][_0xf805('0xa')]||null:null,'attributes':_0xf41a42[_0xf805('0x8')]?_0xf41a42['options'][_0xf805('0xb')]||null:null,'limit':_0xf41a42[_0xf805('0x8')]?_0xf41a42['options'][_0xf805('0xc')]||null:null,'include':_0xf41a42[_0xf805('0x8')]?_0xf41a42[_0xf805('0x8')][_0xf805('0xd')]?_[_0xf805('0xe')](_0xf41a42[_0xf805('0x8')][_0xf805('0xd')],function(_0x3ec36e){return{'model':db[_0x3ec36e[_0xf805('0xf')]],'as':_0x3ec36e['as'],'attributes':_0x3ec36e['attributes'],'include':_0x3ec36e[_0xf805('0xd')]?_[_0xf805('0xe')](_0x3ec36e[_0xf805('0xd')],function(_0xcdbcc4){return{'model':db[_0xcdbcc4[_0xf805('0xf')]],'as':_0xcdbcc4['as'],'attributes':_0xcdbcc4[_0xf805('0xb')],'include':_0xcdbcc4[_0xf805('0xd')]?_[_0xf805('0xe')](_0xcdbcc4[_0xf805('0xd')],function(_0x55e973){return{'model':db[_0x55e973['model']],'as':_0x55e973['as'],'attributes':_0x55e973['attributes']};}):[]};}):[]};}):[]:[]})[_0xf805('0x10')](function(_0x27d6d8){logger[_0xf805('0x11')](_0xf805('0x12'),_0xf41a42);logger[_0xf805('0x13')](_0xf805('0x12'),_0xf41a42,JSON[_0xf805('0x14')](_0x27d6d8));_0x525920(_0x27d6d8);})['catch'](function(_0x4997f3){logger['error']('GetInterval',_0x4997f3[_0xf805('0x15')],_0xf41a42);_0x30f09b(_0x24a917['error'](0x1f4,_0x4997f3[_0xf805('0x15')]));});});};exports['ShowInterval']=function(_0x132a01){var _0x476c2a=this;return new Promise(function(_0xab32dd,_0x3892a6){return db[_0xf805('0x7')][_0xf805('0x16')]({'raw':_0x132a01[_0xf805('0x8')]?_0x132a01[_0xf805('0x8')][_0xf805('0x9')]===undefined?!![]:![]:!![],'where':_0x132a01[_0xf805('0x8')]?_0x132a01['options'][_0xf805('0xa')]||null:null,'attributes':_0x132a01[_0xf805('0x8')]?_0x132a01[_0xf805('0x8')][_0xf805('0xb')]||null:null,'include':_0x132a01[_0xf805('0x8')]?_0x132a01[_0xf805('0x8')][_0xf805('0xd')]?_['map'](_0x132a01[_0xf805('0x8')][_0xf805('0xd')],function(_0x51da6c){return{'model':db[_0x51da6c['model']],'as':_0x51da6c['as'],'attributes':_0x51da6c[_0xf805('0xb')],'include':_0x51da6c[_0xf805('0xd')]?_[_0xf805('0xe')](_0x51da6c[_0xf805('0xd')],function(_0x395713){return{'model':db[_0x395713[_0xf805('0xf')]],'as':_0x395713['as'],'attributes':_0x395713[_0xf805('0xb')],'include':_0x395713['include']?_[_0xf805('0xe')](_0x395713[_0xf805('0xd')],function(_0x1daaa2){return{'model':db[_0x1daaa2[_0xf805('0xf')]],'as':_0x1daaa2['as'],'attributes':_0x1daaa2[_0xf805('0xb')]};}):[]};}):[]};}):[]:[]})[_0xf805('0x10')](function(_0x133742){logger[_0xf805('0x11')]('ShowInterval',_0x132a01);logger[_0xf805('0x13')](_0xf805('0x17'),_0x132a01,JSON[_0xf805('0x14')](_0x133742));_0xab32dd(_0x133742);})[_0xf805('0x18')](function(_0x48350d){logger[_0xf805('0x19')](_0xf805('0x17'),_0x48350d[_0xf805('0x15')],_0x132a01);_0x3892a6(_0x476c2a[_0xf805('0x19')](0x1f4,_0x48350d[_0xf805('0x15')]));});});};function checkArrayOfIntervals(_0xc927aa,_0x101384){var _0x5de8d6=[];return db[_0xf805('0x7')]['findAll']({'where':{'id':_0xc927aa}})['then'](function(_0x3c5014){_0x5de8d6=_0x3c5014;return Promise[_0xf805('0x1a')](_0x5de8d6[_0xf805('0xe')](function(_0x7c55f5){return _0x7c55f5[_0xf805('0x1b')](_0x101384);}));})['then'](function(_0xdb682){var _0xb4de4e=_0xdb682[_0xf805('0x1c')](function(_0x60a8ae,_0x4ced57){return _0x60a8ae||_0x4ced57;},![]);logger['info'](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5de8d6[_0xf805('0xe')](function(_0x212fcf){return _0x212fcf[_0xf805('0x1d')];})[_0xf805('0x1e')](',\x20'),_0x5de8d6['map'](function(_0x293d6c){return _0x293d6c['id'];})[_0xf805('0x1e')](',\x20')));return _0xb4de4e;});}function checkSingleInterval(_0x595157,_0x3698b4){return db[_0xf805('0x7')][_0xf805('0x1f')](_0x595157)[_0xf805('0x10')](function(_0x354173){if(_0x354173){logger['info'](util['format'](_0xf805('0x20'),_0x354173[_0xf805('0x1d')],_0x354173['id']));return _0x354173[_0xf805('0x1b')](_0x3698b4);}});}exports[_0xf805('0x21')]=function(_0x5497a7){var _0x3f75b9=_0x5497a7[_0xf805('0x22')];var _0x293faf=Array[_0xf805('0x23')](_0x5497a7[_0xf805('0x24')])?_0x5497a7[_0xf805('0x24')]:typeof _0x5497a7['intervals']==='string'?[_0x5497a7['intervals']]:[];var _0x499e7d=_0x5497a7['timezone']||undefined;var _0x3514d1=![];if(_0x293faf[_0xf805('0x25')]){logger[_0xf805('0x11')](util[_0xf805('0x26')](_0xf805('0x27'),_0x293faf[_0xf805('0x1e')](';\x20')));}if(_0x499e7d){logger['info'](util[_0xf805('0x26')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x499e7d));}logger[_0xf805('0x13')](_0xf805('0x28'),_0x3514d1);logger['silly'](_0xf805('0x21'),_0x5497a7);return Promise[_0xf805('0x29')]()[_0xf805('0x10')](function(){if(Array[_0xf805('0x23')](_0x3f75b9)){return checkArrayOfIntervals(_0x3f75b9,_0x499e7d);}else if(_0x3f75b9){return checkSingleInterval(_0x3f75b9,_0x499e7d);}})[_0xf805('0x10')](function(_0x3f06c0){var _0x3415a1=_0x293faf[_0xf805('0x1c')](function(_0x52e408,_0x4d47be){return _0x52e408||iftime(_0x4d47be,_0x499e7d);},![]);_0x3514d1=_0x3f06c0||_0x3415a1;return _0x3514d1;})['catch'](function(_0x23242d){logger[_0xf805('0x19')]('IntervalIftime',_0x5497a7,_0x23242d);throw this[_0xf805('0x19')](0x1f4,_0x23242d[_0xf805('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 47dc6a9..c981e6e 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x47810b,_0x12c7e6){var _0x35b28c=function(_0x498d18){while(--_0x498d18){_0x47810b['push'](_0x47810b['shift']());}};_0x35b28c(++_0x12c7e6);}(_0x2032,0xd9));var _0x2203=function(_0x42135a,_0x44e6de){_0x42135a=_0x42135a-0x0;var _0x823f98=_0x2032[_0x42135a];return _0x823f98;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x46af14,_0x358eff){var _0x12d2d2=function(_0x358ec2){while(--_0x358ec2){_0x46af14['push'](_0x46af14['shift']());}};_0x12d2d2(++_0x358eff);}(_0xdb28,0x106));var _0x8db2=function(_0xc2e658,_0x377683){_0xc2e658=_0xc2e658-0x0;var _0x5b00da=_0xdb28[_0xc2e658];return _0x5b00da;};'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 84196a3..83e950b 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 _0x2551=['remoteAddress','socket','../../config/logger','api','support','key','summary','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','newToken','name','customfield_11504','reason','POST','Basic\x20','toString','base64','request','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','openIssue','body','x-forwarded-for','connection'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x2551,0x12a));var _0x1255=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x2551[_0x7e2eb0];return _0xd92de4;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x1255('0x0'))(_0x1255('0x1'));var USERNAME=_0x1255('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4dd901,_0xd7cee3){var _0x2b6b78={'fields':{'project':{'key':_0x4dd901[_0x1255('0x3')]||'MOTGUI'},'summary':(_0x4dd901[_0x1255('0x4')]||'Report')+'\x20from\x20'+_0x4dd901['ip'],'description':_0x4dd901[_0x1255('0x5')]||JSON[_0x1255('0x6')](_0x4dd901),'issuetype':{'name':_0x4dd901[_0x1255('0x7')]||_0x1255('0x8')}}};_0x2b6b78[_0x1255('0x9')][_0x1255('0xa')]=_0x4dd901['email'];_0x2b6b78[_0x1255('0x9')][_0x1255('0xb')]=_0x4dd901['oldToken'];_0x2b6b78[_0x1255('0x9')]['customfield_11502']=_0x4dd901[_0x1255('0xc')];_0x2b6b78['fields']['customfield_11503']=_0x4dd901[_0x1255('0xd')];_0x2b6b78[_0x1255('0x9')][_0x1255('0xe')]=_0x4dd901[_0x1255('0xf')];_0x2b6b78[_0x1255('0x9')]['customfield_10102']=_0x4dd901['ip'];var _0xfc9f52={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x1255('0x10'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x1255('0x11')+new Buffer(USERNAME+':'+PASSWORD)[_0x1255('0x12')](_0x1255('0x13'))}};var _0x348cbd=JSON[_0x1255('0x6')](_0x2b6b78);var _0x3a2af7=https[_0x1255('0x14')](_0xfc9f52,function(_0x4d9ef5){_0x4d9ef5['setEncoding'](_0x1255('0x15'));var _0xa81d1e='';_0x4d9ef5['on'](_0x1255('0x16'),function(_0x277a36){_0xa81d1e+=_0x277a36;});_0x4d9ef5['on'](_0x1255('0x17'),function(){if(_0xd7cee3){return _0xd7cee3[_0x1255('0x18')](_0x4d9ef5[_0x1255('0x19')])[_0x1255('0x1a')](JSON[_0x1255('0x1b')](_0xa81d1e));}});});_0x3a2af7['on'](_0x1255('0x1c'),function(_0x26ce11){if(_0xd7cee3){return _0xd7cee3['status'](0x1f4)[_0x1255('0x1a')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x1255('0x1d')}]});}});_0x3a2af7[_0x1255('0x1e')](_0x348cbd);_0x3a2af7[_0x1255('0x17')]();}exports[_0x1255('0x1f')]=openIssue;exports['send']=function(_0x10989c,_0x2a9a30){_0x10989c[_0x1255('0x20')]['ip']=_0x10989c['headers'][_0x1255('0x21')]||_0x10989c[_0x1255('0x22')][_0x1255('0x23')]||_0x10989c['socket']['remoteAddress']||_0x10989c[_0x1255('0x22')][_0x1255('0x24')]['remoteAddress'];return openIssue(_0x10989c[_0x1255('0x20')],_0x2a9a30);}; \ No newline at end of file +var _0x0dcb=['fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','utf8','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','../../config/logger','MOTGUI','summary','description','stringify','issuetype','Bug'];(function(_0x2fe997,_0x40c86a){var _0x898d8d=function(_0x53b91b){while(--_0x53b91b){_0x2fe997['push'](_0x2fe997['shift']());}};_0x898d8d(++_0x40c86a);}(_0x0dcb,0x18f));var _0xb0dc=function(_0x283455,_0x2d5b11){_0x283455=_0x283455-0x0;var _0x4ef041=_0x0dcb[_0x283455];return _0x4ef041;};'use strict';var BPromise=require(_0xb0dc('0x0'));var https=require('https');var logger=require(_0xb0dc('0x1'))('api');var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x3a58d4,_0x33226a){var _0xdf827a={'fields':{'project':{'key':_0x3a58d4['key']||_0xb0dc('0x2')},'summary':(_0x3a58d4[_0xb0dc('0x3')]||'Report')+'\x20from\x20'+_0x3a58d4['ip'],'description':_0x3a58d4[_0xb0dc('0x4')]||JSON[_0xb0dc('0x5')](_0x3a58d4),'issuetype':{'name':_0x3a58d4[_0xb0dc('0x6')]||_0xb0dc('0x7')}}};_0xdf827a[_0xb0dc('0x8')][_0xb0dc('0x9')]=_0x3a58d4['email'];_0xdf827a[_0xb0dc('0x8')][_0xb0dc('0xa')]=_0x3a58d4[_0xb0dc('0xb')];_0xdf827a[_0xb0dc('0x8')][_0xb0dc('0xc')]=_0x3a58d4[_0xb0dc('0xd')];_0xdf827a[_0xb0dc('0x8')]['customfield_11503']=_0x3a58d4['name'];_0xdf827a[_0xb0dc('0x8')][_0xb0dc('0xe')]=_0x3a58d4['reason'];_0xdf827a[_0xb0dc('0x8')][_0xb0dc('0xf')]=_0x3a58d4['ip'];var _0x28705b={'host':_0xb0dc('0x10'),'port':0x1bb,'path':_0xb0dc('0x11'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xb0dc('0x12'),'Authorization':_0xb0dc('0x13')+new Buffer(USERNAME+':'+PASSWORD)[_0xb0dc('0x14')](_0xb0dc('0x15'))}};var _0x1102ff=JSON[_0xb0dc('0x5')](_0xdf827a);var _0x43641e=https[_0xb0dc('0x16')](_0x28705b,function(_0x453d54){_0x453d54['setEncoding'](_0xb0dc('0x17'));var _0xf70d2e='';_0x453d54['on'](_0xb0dc('0x18'),function(_0x8c059c){_0xf70d2e+=_0x8c059c;});_0x453d54['on'](_0xb0dc('0x19'),function(){if(_0x33226a){return _0x33226a[_0xb0dc('0x1a')](_0x453d54[_0xb0dc('0x1b')])[_0xb0dc('0x1c')](JSON['parse'](_0xf70d2e));}});});_0x43641e['on']('error',function(_0x5ea6a9){if(_0x33226a){return _0x33226a[_0xb0dc('0x1a')](0x1f4)[_0xb0dc('0x1c')]({'errors':[{'message':_0xb0dc('0x1d'),'type':_0xb0dc('0x1e')}]});}});_0x43641e[_0xb0dc('0x1f')](_0x1102ff);_0x43641e['end']();}exports['openIssue']=openIssue;exports['send']=function(_0x499489,_0x5c4b88){_0x499489[_0xb0dc('0x20')]['ip']=_0x499489['headers'][_0xb0dc('0x21')]||_0x499489['connection'][_0xb0dc('0x22')]||_0x499489[_0xb0dc('0x23')][_0xb0dc('0x22')]||_0x499489[_0xb0dc('0x24')]['socket'][_0xb0dc('0x22')];return openIssue(_0x499489['body'],_0x5c4b88);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 8ed38c4..1651c50 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 _0x668b=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index'];(function(_0xbcfcb9,_0x3168bc){var _0x23d952=function(_0x4fab55){while(--_0x4fab55){_0xbcfcb9['push'](_0xbcfcb9['shift']());}};_0x23d952(++_0x3168bc);}(_0x668b,0x140));var _0xb668=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0x668b[_0x1505e5];return _0x5b1dcd;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xf')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')](_0xb668('0xd'),auth['isAuthenticated'](),controller[_0xb668('0x12')]);router[_0xb668('0x13')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);module[_0xb668('0x15')]=router; \ No newline at end of file +var _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x1bc70b,_0x1ff32f){var _0x21e350=function(_0x4a1b8e){while(--_0x4a1b8e){_0x1bc70b['push'](_0x1bc70b['shift']());}};_0x21e350(++_0x1ff32f);}(_0xf4eb,0xec));var _0xbf4e=function(_0xfd1d,_0x226db1){_0xfd1d=_0xfd1d-0x0;var _0x389e42=_0xf4eb[_0xfd1d];return _0x389e42;};'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')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3e0888e..77a3d66 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x4627df,_0x3c7155){_0x4627df=_0x4627df-0x0;var _0x4d0e53=_0x7a54[_0x4627df];return _0x4d0e53;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0x2e0b8e,_0xaedefc){_0x2e0b8e=_0x2e0b8e-0x0;var _0x26b5b7=_0x7a54[_0x2e0b8e];return _0x26b5b7;};'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 4b0a32d..9f864b2 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 _0x975b=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x2863b6,_0x47725b){var _0x3c17a9=function(_0x25a713){while(--_0x25a713){_0x2863b6['push'](_0x2863b6['shift']());}};_0x3c17a9(++_0x47725b);}(_0x975b,0x1c9));var _0xb975=function(_0x3c1151,_0x4c5da3){_0x3c1151=_0x3c1151-0x0;var _0x38dd44=_0x975b[_0x3c1151];return _0x38dd44;};'use strict';var emlformat=require(_0xb975('0x0'));var rimraf=require(_0xb975('0x1'));var zipdir=require(_0xb975('0x2'));var jsonpatch=require(_0xb975('0x3'));var rp=require(_0xb975('0x4'));var moment=require(_0xb975('0x5'));var BPromise=require(_0xb975('0x6'));var Mustache=require('mustache');var util=require(_0xb975('0x7'));var path=require(_0xb975('0x8'));var sox=require(_0xb975('0x9'));var csv=require(_0xb975('0xa'));var ejs=require(_0xb975('0xb'));var fs=require('fs');var fs_extra=require(_0xb975('0xc'));var _=require(_0xb975('0xd'));var squel=require('squel');var crypto=require(_0xb975('0xe'));var jsforce=require(_0xb975('0xf'));var deskjs=require(_0xb975('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb975('0x11'));var Papa=require(_0xb975('0x12'));var Redis=require(_0xb975('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb975('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb975('0x15'));var logger=require('../../config/logger')(_0xb975('0x16'));var utils=require('../../config/utils');var config=require(_0xb975('0x17'));var licenseUtil=require(_0xb975('0x18'));var db=require(_0xb975('0x19'))['db'];function respondWithStatusCode(_0x1c4b77,_0x13ca28){_0x13ca28=_0x13ca28||0xcc;return function(_0x558727){if(_0x558727){return _0x1c4b77[_0xb975('0x1a')](_0x13ca28);}return _0x1c4b77[_0xb975('0x1b')](_0x13ca28)[_0xb975('0x1c')]();};}function respondWithResult(_0x24919e,_0x5cea50){_0x5cea50=_0x5cea50||0xc8;return function(_0x470ead){if(_0x470ead){return _0x24919e[_0xb975('0x1b')](_0x5cea50)[_0xb975('0x1d')](_0x470ead);}};}function respondWithFilteredResult(_0x4b1ede,_0x24f8ec){return function(_0x3da9e9){if(_0x3da9e9){var _0x36d959=typeof _0x24f8ec['offset']===_0xb975('0x1e')&&typeof _0x24f8ec['limit']===_0xb975('0x1e');var _0x34e062=_0x3da9e9[_0xb975('0x1f')];var _0x347a04=_0x36d959?0x0:_0x24f8ec[_0xb975('0x20')];var _0x327728=_0x36d959?_0x3da9e9[_0xb975('0x1f')]:_0x24f8ec['offset']+_0x24f8ec['limit'];var _0x2abb84;if(_0x327728>=_0x34e062){_0x327728=_0x34e062;_0x2abb84=0xc8;}else{_0x2abb84=0xce;}_0x4b1ede[_0xb975('0x1b')](_0x2abb84);return _0x4b1ede[_0xb975('0x21')](_0xb975('0x22'),_0x347a04+'-'+_0x327728+'/'+_0x34e062)['json'](_0x3da9e9);}return null;};}function patchUpdates(_0x39af85){return function(_0x49adfa){try{jsonpatch[_0xb975('0x23')](_0x49adfa,_0x39af85,!![]);}catch(_0x3f0876){return BPromise[_0xb975('0x24')](_0x3f0876);}return _0x49adfa['save']();};}function saveUpdates(_0xe7a5f0,_0x493c0b){return function(_0x5d1312){if(_0x5d1312){return _0x5d1312[_0xb975('0x25')](_0xe7a5f0)[_0xb975('0x26')](function(_0x226f21){return _0x226f21;});}return null;};}function removeEntity(_0xa4d4c,_0x35dcc6){return function(_0x5620fc){if(_0x5620fc){return _0x5620fc[_0xb975('0x27')]()['then'](function(){_0xa4d4c[_0xb975('0x1b')](0xcc)[_0xb975('0x1c')]();});}};}function handleEntityNotFound(_0xc0d861,_0x263f73){return function(_0x5309c6){if(!_0x5309c6){_0xc0d861[_0xb975('0x1a')](0x194);}return _0x5309c6;};}function handleError(_0x2824bf,_0x41905e){_0x41905e=_0x41905e||0x1f4;return function(_0xed596){logger['error'](_0xed596[_0xb975('0x28')]);if(_0xed596[_0xb975('0x29')]){delete _0xed596[_0xb975('0x29')];}_0x2824bf[_0xb975('0x1b')](_0x41905e)[_0xb975('0x2a')](_0xed596);};}exports[_0xb975('0x2b')]=function(_0x442bc6,_0x135cc9){var _0x2d730d={},_0x514451={},_0x2b1319={'count':0x0,'rows':[]};var _0x2b3ec2=_[_0xb975('0x2c')](db[_0xb975('0x2d')][_0xb975('0x2e')],function(_0x3bd5cb){return{'name':_0x3bd5cb[_0xb975('0x2f')],'type':_0x3bd5cb[_0xb975('0x30')][_0xb975('0x31')]};});_0x514451[_0xb975('0x32')]=_[_0xb975('0x2c')](_0x2b3ec2,'name');_0x514451[_0xb975('0x33')]=_['keys'](_0x442bc6['query']);_0x514451[_0xb975('0x34')]=_['intersection'](_0x514451[_0xb975('0x32')],_0x514451[_0xb975('0x33')]);_0x2d730d['attributes']=_[_0xb975('0x35')](_0x514451['model'],qs[_0xb975('0x36')](_0x442bc6[_0xb975('0x33')][_0xb975('0x36')]));_0x2d730d[_0xb975('0x37')]=_0x2d730d[_0xb975('0x37')]['length']?_0x2d730d[_0xb975('0x37')]:_0x514451['model'];if(!_0x442bc6['query'][_0xb975('0x38')](_0xb975('0x39'))){_0x2d730d[_0xb975('0x3a')]=qs[_0xb975('0x3a')](_0x442bc6[_0xb975('0x33')][_0xb975('0x3a')]);_0x2d730d[_0xb975('0x20')]=qs[_0xb975('0x20')](_0x442bc6['query'][_0xb975('0x20')]);}_0x2d730d[_0xb975('0x3b')]=qs['sort'](_0x442bc6[_0xb975('0x33')][_0xb975('0x3c')]);_0x2d730d[_0xb975('0x3d')]=qs[_0xb975('0x34')](_[_0xb975('0x3e')](_0x442bc6[_0xb975('0x33')],_0x514451[_0xb975('0x34')]),_0x2b3ec2);if(_0x442bc6['query'][_0xb975('0x3f')]){_0x2d730d['where']=_[_0xb975('0x40')](_0x2d730d[_0xb975('0x3d')],{'$or':_['map'](_0x2b3ec2,function(_0x2341e6){if(_0x2341e6['type']!==_0xb975('0x41')){var _0x378e54={};_0x378e54[_0x2341e6[_0xb975('0x29')]]={'$like':'%'+_0x442bc6[_0xb975('0x33')][_0xb975('0x3f')]+'%'};return _0x378e54;}})});}_0x2d730d=_[_0xb975('0x40')]({},_0x2d730d,_0x442bc6[_0xb975('0x42')]);var _0x2781ab={'where':_0x2d730d['where']};return db[_0xb975('0x2d')][_0xb975('0x1f')](_0x2781ab)[_0xb975('0x26')](function(_0x562e0d){_0x2b1319['count']=_0x562e0d;if(_0x442bc6[_0xb975('0x33')][_0xb975('0x43')]){_0x2d730d[_0xb975('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2d730d);})[_0xb975('0x26')](function(_0x335011){_0x2b1319[_0xb975('0x45')]=_0x335011;return _0x2b1319;})[_0xb975('0x26')](respondWithFilteredResult(_0x135cc9,_0x2d730d))['catch'](handleError(_0x135cc9,null));};exports[_0xb975('0x46')]=function(_0x17d594,_0xe5c7e7){var _0x160e58={'raw':!![],'where':{'id':_0x17d594[_0xb975('0x47')]['id']}},_0x55f550={};_0x55f550[_0xb975('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0xb975('0x2e')]);_0x55f550['query']=_['keys'](_0x17d594[_0xb975('0x33')]);_0x55f550['filters']=_[_0xb975('0x35')](_0x55f550[_0xb975('0x32')],_0x55f550['query']);_0x160e58[_0xb975('0x37')]=_[_0xb975('0x35')](_0x55f550[_0xb975('0x32')],qs[_0xb975('0x36')](_0x17d594[_0xb975('0x33')]['fields']));_0x160e58[_0xb975('0x37')]=_0x160e58[_0xb975('0x37')][_0xb975('0x48')]?_0x160e58['attributes']:_0x55f550[_0xb975('0x32')];if(_0x17d594[_0xb975('0x33')][_0xb975('0x43')]){_0x160e58['include']=[{'all':!![]}];}_0x160e58=_[_0xb975('0x40')]({},_0x160e58,_0x17d594[_0xb975('0x42')]);return db[_0xb975('0x2d')][_0xb975('0x49')](_0x160e58)['then'](handleEntityNotFound(_0xe5c7e7,null))['then'](respondWithResult(_0xe5c7e7,null))['catch'](handleError(_0xe5c7e7,null));};exports[_0xb975('0x4a')]=function(_0x4483ba,_0x15bc77){return db[_0xb975('0x2d')][_0xb975('0x4a')](_0x4483ba[_0xb975('0x4b')],{})[_0xb975('0x26')](respondWithResult(_0x15bc77,0xc9))[_0xb975('0x4c')](handleError(_0x15bc77,null));};exports[_0xb975('0x25')]=function(_0x466251,_0x1a3268){if(_0x466251['body']['id']){delete _0x466251[_0xb975('0x4b')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x466251['params']['id']}})[_0xb975('0x26')](handleEntityNotFound(_0x1a3268,null))[_0xb975('0x26')](saveUpdates(_0x466251['body'],null))[_0xb975('0x26')](respondWithResult(_0x1a3268,null))[_0xb975('0x4c')](handleError(_0x1a3268,null));};exports[_0xb975('0x27')]=function(_0x22743c,_0x1f9544){return db[_0xb975('0x2d')][_0xb975('0x49')]({'where':{'id':_0x22743c[_0xb975('0x47')]['id']}})[_0xb975('0x26')](handleEntityNotFound(_0x1f9544,null))['then'](removeEntity(_0x1f9544,null))['catch'](handleError(_0x1f9544,null));};exports['describe']=function(_0x3cedf9,_0x1a1f97){return db['JscriptyAnswerReport'][_0xb975('0x4d')]()[_0xb975('0x26')](respondWithResult(_0x1a1f97,null))[_0xb975('0x4c')](handleError(_0x1a1f97,null));}; \ No newline at end of file +var _0xdbb1=['reject','save','update','then','destroy','end','error','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbb1,0x105));var _0x1dbb=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xdbb1[_0x28d18d];return _0x470640;};'use strict';var emlformat=require(_0x1dbb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1dbb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1dbb('0x2'));var util=require('util');var path=require(_0x1dbb('0x3'));var sox=require(_0x1dbb('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1dbb('0x5'));var _=require(_0x1dbb('0x6'));var squel=require(_0x1dbb('0x7'));var crypto=require(_0x1dbb('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1dbb('0x9'));var toCsv=require(_0x1dbb('0xa'));var querystring=require('querystring');var Papa=require(_0x1dbb('0xb'));var Redis=require(_0x1dbb('0xc'));var authService=require(_0x1dbb('0xd'));var qs=require(_0x1dbb('0xe'));var as=require(_0x1dbb('0xf'));var hardwareService=require(_0x1dbb('0x10'));var logger=require(_0x1dbb('0x11'))(_0x1dbb('0x12'));var utils=require(_0x1dbb('0x13'));var config=require(_0x1dbb('0x14'));var licenseUtil=require(_0x1dbb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425fef,_0x28c292){_0x28c292=_0x28c292||0xcc;return function(_0x332380){if(_0x332380){return _0x425fef[_0x1dbb('0x16')](_0x28c292);}return _0x425fef['status'](_0x28c292)['end']();};}function respondWithResult(_0x1d87b9,_0x175864){_0x175864=_0x175864||0xc8;return function(_0xf5f7ed){if(_0xf5f7ed){return _0x1d87b9[_0x1dbb('0x17')](_0x175864)[_0x1dbb('0x18')](_0xf5f7ed);}};}function respondWithFilteredResult(_0x539721,_0x15dc51){return function(_0x188515){if(_0x188515){var _0x409bee=typeof _0x15dc51['offset']===_0x1dbb('0x19')&&typeof _0x15dc51[_0x1dbb('0x1a')]==='undefined';var _0x2c2aa8=_0x188515[_0x1dbb('0x1b')];var _0x98b8d2=_0x409bee?0x0:_0x15dc51[_0x1dbb('0x1c')];var _0xb21bc5=_0x409bee?_0x188515[_0x1dbb('0x1b')]:_0x15dc51[_0x1dbb('0x1c')]+_0x15dc51[_0x1dbb('0x1a')];var _0x58aa43;if(_0xb21bc5>=_0x2c2aa8){_0xb21bc5=_0x2c2aa8;_0x58aa43=0xc8;}else{_0x58aa43=0xce;}_0x539721['status'](_0x58aa43);return _0x539721['set'](_0x1dbb('0x1d'),_0x98b8d2+'-'+_0xb21bc5+'/'+_0x2c2aa8)[_0x1dbb('0x18')](_0x188515);}return null;};}function patchUpdates(_0x570896){return function(_0x21e48c){try{jsonpatch[_0x1dbb('0x1e')](_0x21e48c,_0x570896,!![]);}catch(_0x23e6b2){return BPromise[_0x1dbb('0x1f')](_0x23e6b2);}return _0x21e48c[_0x1dbb('0x20')]();};}function saveUpdates(_0x3ddd80,_0x330f45){return function(_0x4b206d){if(_0x4b206d){return _0x4b206d[_0x1dbb('0x21')](_0x3ddd80)[_0x1dbb('0x22')](function(_0x2a2458){return _0x2a2458;});}return null;};}function removeEntity(_0x2d1b0c,_0x2c0993){return function(_0x429253){if(_0x429253){return _0x429253[_0x1dbb('0x23')]()[_0x1dbb('0x22')](function(){_0x2d1b0c[_0x1dbb('0x17')](0xcc)[_0x1dbb('0x24')]();});}};}function handleEntityNotFound(_0x18f188,_0x57a9f0){return function(_0x44eff7){if(!_0x44eff7){_0x18f188['sendStatus'](0x194);}return _0x44eff7;};}function handleError(_0x276818,_0x4cd836){_0x4cd836=_0x4cd836||0x1f4;return function(_0x72cfed){logger[_0x1dbb('0x25')](_0x72cfed[_0x1dbb('0x26')]);if(_0x72cfed[_0x1dbb('0x27')]){delete _0x72cfed[_0x1dbb('0x27')];}_0x276818[_0x1dbb('0x17')](_0x4cd836)['send'](_0x72cfed);};}exports[_0x1dbb('0x28')]=function(_0x410979,_0x2c2b99){var _0x4c0a9d={},_0x5557ad={},_0x12bbba={'count':0x0,'rows':[]};var _0x5df55e=_['map'](db[_0x1dbb('0x29')][_0x1dbb('0x2a')],function(_0x4511b3){return{'name':_0x4511b3[_0x1dbb('0x2b')],'type':_0x4511b3[_0x1dbb('0x2c')][_0x1dbb('0x2d')]};});_0x5557ad[_0x1dbb('0x2e')]=_[_0x1dbb('0x2f')](_0x5df55e,_0x1dbb('0x27'));_0x5557ad['query']=_['keys'](_0x410979[_0x1dbb('0x30')]);_0x5557ad[_0x1dbb('0x31')]=_[_0x1dbb('0x32')](_0x5557ad['model'],_0x5557ad['query']);_0x4c0a9d[_0x1dbb('0x33')]=_[_0x1dbb('0x32')](_0x5557ad[_0x1dbb('0x2e')],qs['fields'](_0x410979['query'][_0x1dbb('0x34')]));_0x4c0a9d[_0x1dbb('0x33')]=_0x4c0a9d['attributes'][_0x1dbb('0x35')]?_0x4c0a9d[_0x1dbb('0x33')]:_0x5557ad[_0x1dbb('0x2e')];if(!_0x410979[_0x1dbb('0x30')]['hasOwnProperty'](_0x1dbb('0x36'))){_0x4c0a9d[_0x1dbb('0x1a')]=qs[_0x1dbb('0x1a')](_0x410979[_0x1dbb('0x30')][_0x1dbb('0x1a')]);_0x4c0a9d[_0x1dbb('0x1c')]=qs['offset'](_0x410979[_0x1dbb('0x30')][_0x1dbb('0x1c')]);}_0x4c0a9d['order']=qs[_0x1dbb('0x37')](_0x410979[_0x1dbb('0x30')][_0x1dbb('0x37')]);_0x4c0a9d[_0x1dbb('0x38')]=qs[_0x1dbb('0x31')](_['pick'](_0x410979[_0x1dbb('0x30')],_0x5557ad[_0x1dbb('0x31')]),_0x5df55e);if(_0x410979[_0x1dbb('0x30')][_0x1dbb('0x39')]){_0x4c0a9d[_0x1dbb('0x38')]=_[_0x1dbb('0x3a')](_0x4c0a9d['where'],{'$or':_[_0x1dbb('0x2f')](_0x5df55e,function(_0x429151){if(_0x429151['type']!==_0x1dbb('0x3b')){var _0x41a81b={};_0x41a81b[_0x429151[_0x1dbb('0x27')]]={'$like':'%'+_0x410979[_0x1dbb('0x30')][_0x1dbb('0x39')]+'%'};return _0x41a81b;}})});}_0x4c0a9d=_[_0x1dbb('0x3a')]({},_0x4c0a9d,_0x410979[_0x1dbb('0x3c')]);var _0x2356e6={'where':_0x4c0a9d[_0x1dbb('0x38')]};return db[_0x1dbb('0x29')][_0x1dbb('0x1b')](_0x2356e6)[_0x1dbb('0x22')](function(_0x2a74a3){_0x12bbba['count']=_0x2a74a3;if(_0x410979[_0x1dbb('0x30')][_0x1dbb('0x3d')]){_0x4c0a9d[_0x1dbb('0x3e')]=[{'all':!![]}];}return db[_0x1dbb('0x29')][_0x1dbb('0x3f')](_0x4c0a9d);})[_0x1dbb('0x22')](function(_0x414609){_0x12bbba[_0x1dbb('0x40')]=_0x414609;return _0x12bbba;})[_0x1dbb('0x22')](respondWithFilteredResult(_0x2c2b99,_0x4c0a9d))[_0x1dbb('0x41')](handleError(_0x2c2b99,null));};exports[_0x1dbb('0x42')]=function(_0x23b7d0,_0x139cb4){var _0x504b80={'raw':!![],'where':{'id':_0x23b7d0[_0x1dbb('0x43')]['id']}},_0x148c2f={};_0x148c2f[_0x1dbb('0x2e')]=_[_0x1dbb('0x44')](db['JscriptyAnswerReport'][_0x1dbb('0x2a')]);_0x148c2f[_0x1dbb('0x30')]=_[_0x1dbb('0x44')](_0x23b7d0[_0x1dbb('0x30')]);_0x148c2f[_0x1dbb('0x31')]=_[_0x1dbb('0x32')](_0x148c2f[_0x1dbb('0x2e')],_0x148c2f[_0x1dbb('0x30')]);_0x504b80['attributes']=_[_0x1dbb('0x32')](_0x148c2f[_0x1dbb('0x2e')],qs[_0x1dbb('0x34')](_0x23b7d0[_0x1dbb('0x30')][_0x1dbb('0x34')]));_0x504b80[_0x1dbb('0x33')]=_0x504b80['attributes'][_0x1dbb('0x35')]?_0x504b80['attributes']:_0x148c2f[_0x1dbb('0x2e')];if(_0x23b7d0[_0x1dbb('0x30')]['includeAll']){_0x504b80[_0x1dbb('0x3e')]=[{'all':!![]}];}_0x504b80=_[_0x1dbb('0x3a')]({},_0x504b80,_0x23b7d0[_0x1dbb('0x3c')]);return db[_0x1dbb('0x29')][_0x1dbb('0x45')](_0x504b80)['then'](handleEntityNotFound(_0x139cb4,null))[_0x1dbb('0x22')](respondWithResult(_0x139cb4,null))[_0x1dbb('0x41')](handleError(_0x139cb4,null));};exports[_0x1dbb('0x46')]=function(_0x436b78,_0x19700d){return db['JscriptyAnswerReport'][_0x1dbb('0x46')](_0x436b78['body'],{})['then'](respondWithResult(_0x19700d,0xc9))[_0x1dbb('0x41')](handleError(_0x19700d,null));};exports['update']=function(_0x33969b,_0xb47fb7){if(_0x33969b[_0x1dbb('0x47')]['id']){delete _0x33969b[_0x1dbb('0x47')]['id'];}return db[_0x1dbb('0x29')][_0x1dbb('0x45')]({'where':{'id':_0x33969b['params']['id']}})[_0x1dbb('0x22')](handleEntityNotFound(_0xb47fb7,null))[_0x1dbb('0x22')](saveUpdates(_0x33969b[_0x1dbb('0x47')],null))[_0x1dbb('0x22')](respondWithResult(_0xb47fb7,null))[_0x1dbb('0x41')](handleError(_0xb47fb7,null));};exports[_0x1dbb('0x23')]=function(_0x512408,_0x47fe1e){return db[_0x1dbb('0x29')]['find']({'where':{'id':_0x512408[_0x1dbb('0x43')]['id']}})[_0x1dbb('0x22')](handleEntityNotFound(_0x47fe1e,null))[_0x1dbb('0x22')](removeEntity(_0x47fe1e,null))['catch'](handleError(_0x47fe1e,null));};exports[_0x1dbb('0x48')]=function(_0x2e4af6,_0x1dd2ba){return db[_0x1dbb('0x29')]['describe']()[_0x1dbb('0x22')](respondWithResult(_0x1dd2ba,null))[_0x1dbb('0x41')](handleError(_0x1dd2ba,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e0ed5d6..0553af6 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 _0xf57d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','lodash','util'];(function(_0x1698a4,_0x39a64b){var _0x3b0fcf=function(_0x39a301){while(--_0x39a301){_0x1698a4['push'](_0x1698a4['shift']());}};_0x3b0fcf(++_0x39a64b);}(_0xf57d,0x11c));var _0xdf57=function(_0x15624a,_0x62a80b){_0x15624a=_0x15624a-0x0;var _0x42b811=_0xf57d[_0x15624a];return _0x42b811;};'use strict';var _=require(_0xdf57('0x0'));var util=require(_0xdf57('0x1'));var logger=require(_0xdf57('0x2'))(_0xdf57('0x3'));var moment=require(_0xdf57('0x4'));var BPromise=require(_0xdf57('0x5'));var rp=require(_0xdf57('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf57('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf57('0x8'));module[_0xdf57('0x9')]=function(_0x34ae72,_0x32df67){return _0x34ae72['define'](_0xdf57('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfca=['./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xa9328,_0x276135){var _0x49b9d3=function(_0x1825c9){while(--_0x1825c9){_0xa9328['push'](_0xa9328['shift']());}};_0x49b9d3(++_0x276135);}(_0xbfca,0xdc));var _0xabfc=function(_0x139bb3,_0x1c6dbb){_0x139bb3=_0x139bb3-0x0;var _0xecb74=_0xbfca[_0x139bb3];return _0xecb74;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var logger=require('../../config/logger')(_0xabfc('0x2'));var moment=require(_0xabfc('0x3'));var BPromise=require(_0xabfc('0x4'));var rp=require(_0xabfc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabfc('0x6'));var config=require(_0xabfc('0x7'));var attributes=require(_0xabfc('0x8'));module[_0xabfc('0x9')]=function(_0x3f5f25,_0x5cb2){return _0x3f5f25['define'](_0xabfc('0xa'),attributes,{'tableName':_0xabfc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 1766ee2..32587db 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 _0xe6d2=['http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x2e7652,_0x1505cf){var _0x3f06ed=function(_0x51a10f){while(--_0x51a10f){_0x2e7652['push'](_0x2e7652['shift']());}};_0x3f06ed(++_0x1505cf);}(_0xe6d2,0x19c));var _0x2e6d=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe6d2[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x2e6d('0x0'));var util=require(_0x2e6d('0x1'));var moment=require('moment');var BPromise=require(_0x2e6d('0x2'));var rs=require(_0x2e6d('0x3'));var fs=require('fs');var Redis=require(_0x2e6d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e6d('0x5'))(_0x2e6d('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e6d('0x7'));var client=jayson['client'][_0x2e6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a9183,_0x383713,_0x52af9f){return new BPromise(function(_0x5aab01,_0x595235){return client[_0x2e6d('0x9')](_0x1a9183,_0x52af9f)[_0x2e6d('0xa')](function(_0x3bc2ea){logger[_0x2e6d('0xb')](_0x2e6d('0xc'),_0x383713,_0x2e6d('0xd'));logger['debug'](_0x2e6d('0xe'),_0x383713,_0x2e6d('0xd'),JSON[_0x2e6d('0xf')](_0x3bc2ea));if(_0x3bc2ea[_0x2e6d('0x10')]){if(_0x3bc2ea[_0x2e6d('0x10')][_0x2e6d('0x11')]===0x1f4){logger[_0x2e6d('0x10')](_0x2e6d('0xc'),_0x383713,_0x3bc2ea[_0x2e6d('0x10')]['message']);return _0x595235(_0x3bc2ea['error'][_0x2e6d('0x12')]);}logger[_0x2e6d('0x10')](_0x2e6d('0xc'),_0x383713,_0x3bc2ea[_0x2e6d('0x10')]['message']);return _0x5aab01(_0x3bc2ea[_0x2e6d('0x10')][_0x2e6d('0x12')]);}else{logger[_0x2e6d('0xb')](_0x2e6d('0xc'),_0x383713,'request\x20sent');_0x5aab01(_0x3bc2ea[_0x2e6d('0x13')]['message']);}})[_0x2e6d('0x14')](function(_0x2a0d3f){logger[_0x2e6d('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x383713,_0x2a0d3f);_0x595235(_0x2a0d3f);});});} \ No newline at end of file +var _0x4c0e=['../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x5a2289,_0x3bdee7){var _0x297728=function(_0x39e45b){while(--_0x39e45b){_0x5a2289['push'](_0x5a2289['shift']());}};_0x297728(++_0x3bdee7);}(_0x4c0e,0x175));var _0xe4c0=function(_0x4db22b,_0x30003f){_0x4db22b=_0x4db22b-0x0;var _0x534552=_0x4c0e[_0x4db22b];return _0x534552;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var moment=require(_0xe4c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4c0('0x3'));var db=require(_0xe4c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe4c0('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe4c0('0x6')][_0xe4c0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372a9e,_0x3fe239,_0x19afa0){return new BPromise(function(_0x3c366e,_0x1585de){return client[_0xe4c0('0x8')](_0x372a9e,_0x19afa0)[_0xe4c0('0x9')](function(_0xa08ee1){logger[_0xe4c0('0xa')](_0xe4c0('0xb'),_0x3fe239,_0xe4c0('0xc'));logger[_0xe4c0('0xd')](_0xe4c0('0xe'),_0x3fe239,_0xe4c0('0xc'),JSON['stringify'](_0xa08ee1));if(_0xa08ee1[_0xe4c0('0xf')]){if(_0xa08ee1[_0xe4c0('0xf')]['code']===0x1f4){logger[_0xe4c0('0xf')](_0xe4c0('0xb'),_0x3fe239,_0xa08ee1[_0xe4c0('0xf')][_0xe4c0('0x10')]);return _0x1585de(_0xa08ee1[_0xe4c0('0xf')]['message']);}logger['error'](_0xe4c0('0xb'),_0x3fe239,_0xa08ee1[_0xe4c0('0xf')][_0xe4c0('0x10')]);return _0x3c366e(_0xa08ee1[_0xe4c0('0xf')][_0xe4c0('0x10')]);}else{logger[_0xe4c0('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3fe239,_0xe4c0('0xc'));_0x3c366e(_0xa08ee1[_0xe4c0('0x11')][_0xe4c0('0x10')]);}})['catch'](function(_0x5a607d){logger[_0xe4c0('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3fe239,_0x5a607d);_0x1585de(_0x5a607d);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 346bbf9..a901b3e 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 _0xee26=['get','index','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xee26,0x12b));var _0x6ee2=function(_0x1153f7,_0x564f8b){_0x1153f7=_0x1153f7-0x0;var _0x49380f=_0xee26[_0x1153f7];return _0x49380f;};'use strict';var multer=require(_0x6ee2('0x0'));var util=require(_0x6ee2('0x1'));var path=require(_0x6ee2('0x2'));var timeout=require(_0x6ee2('0x3'));var express=require(_0x6ee2('0x4'));var router=express[_0x6ee2('0x5')]();var fs_extra=require(_0x6ee2('0x6'));var auth=require(_0x6ee2('0x7'));var interaction=require(_0x6ee2('0x8'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x6ee2('0x9')]('/',auth['isAuthenticated'](),controller[_0x6ee2('0xa')]);router['get']('/:id',auth[_0x6ee2('0xb')](),controller[_0x6ee2('0xc')]);router[_0x6ee2('0x9')](_0x6ee2('0xd'),auth[_0x6ee2('0xb')](),controller[_0x6ee2('0xe')]);router[_0x6ee2('0x9')](_0x6ee2('0xf'),auth[_0x6ee2('0xb')](),controller[_0x6ee2('0x10')]);router[_0x6ee2('0x9')](_0x6ee2('0x11'),auth[_0x6ee2('0xb')](),timeout(_0x6ee2('0x12')),controller[_0x6ee2('0x13')]);router[_0x6ee2('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ee2('0x14')](_0x6ee2('0x15'),auth[_0x6ee2('0xb')](),controller[_0x6ee2('0x16')]);router[_0x6ee2('0x17')]('/:id',auth[_0x6ee2('0xb')](),controller[_0x6ee2('0x18')]);router[_0x6ee2('0x19')](_0x6ee2('0x1a'),auth['isAuthenticated'](),controller['destroy']);module[_0x6ee2('0x1b')]=router; \ No newline at end of file +var _0x2357=['../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','post','create','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5bc436,_0xd27920){var _0x334194=function(_0x19d51c){while(--_0x19d51c){_0x5bc436['push'](_0x5bc436['shift']());}};_0x334194(++_0xd27920);}(_0x2357,0x6f));var _0x7235=function(_0xda728c,_0x30bdf4){_0xda728c=_0xda728c-0x0;var _0x4748f6=_0x2357[_0xda728c];return _0x4748f6;};'use strict';var multer=require(_0x7235('0x0'));var util=require(_0x7235('0x1'));var path=require(_0x7235('0x2'));var timeout=require(_0x7235('0x3'));var express=require(_0x7235('0x4'));var router=express[_0x7235('0x5')]();var fs_extra=require(_0x7235('0x6'));var auth=require(_0x7235('0x7'));var interaction=require(_0x7235('0x8'));var config=require(_0x7235('0x9'));var controller=require(_0x7235('0xa'));router['get']('/',auth[_0x7235('0xb')](),controller[_0x7235('0xc')]);router[_0x7235('0xd')]('/:id',auth[_0x7235('0xb')](),controller[_0x7235('0xe')]);router[_0x7235('0xd')](_0x7235('0xf'),auth[_0x7235('0xb')](),controller[_0x7235('0x10')]);router[_0x7235('0xd')](_0x7235('0x11'),auth[_0x7235('0xb')](),controller[_0x7235('0x12')]);router[_0x7235('0xd')](_0x7235('0x13'),auth[_0x7235('0xb')](),timeout('30s'),controller['getSummary']);router[_0x7235('0x14')]('/',auth[_0x7235('0xb')](),controller[_0x7235('0x15')]);router[_0x7235('0x14')](_0x7235('0x16'),auth[_0x7235('0xb')](),controller[_0x7235('0x17')]);router[_0x7235('0x18')](_0x7235('0x19'),auth[_0x7235('0xb')](),controller[_0x7235('0x1a')]);router[_0x7235('0x1b')](_0x7235('0x19'),auth[_0x7235('0xb')](),controller[_0x7235('0x1c')]);module[_0x7235('0x1d')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6511a4c..3e9c06e 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 _0xa60a=['isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long'];(function(_0x2b21bd,_0x3171a4){var _0x559b35=function(_0x622c13){while(--_0x622c13){_0x2b21bd['push'](_0x2b21bd['shift']());}};_0x559b35(++_0x3171a4);}(_0xa60a,0x190));var _0xaa60=function(_0x497e1a,_0x3970eb){_0x497e1a=_0x497e1a-0x0;var _0x372ca5=_0xa60a[_0x497e1a];return _0x372ca5;};'use strict';var Sequelize=require(_0xaa60('0x0'));var _=require(_0xaa60('0x1'));var util=require(_0xaa60('0x2'));module[_0xaa60('0x3')]={'name':{'type':Sequelize[_0xaa60('0x4')],'unique':_0xaa60('0x5')},'description':{'type':Sequelize[_0xaa60('0x4')]},'formData':{'type':Sequelize[_0xaa60('0x6')](_0xaa60('0x7')),'set':function(_0x2360db){if(_[_0xaa60('0x8')](_0x2360db)){this[_0xaa60('0x9')](_0xaa60('0xa'),JSON[_0xaa60('0xb')](_0x2360db));}else if(_['isString'](_0x2360db)){this[_0xaa60('0x9')]('formData',_0x2360db);}else{this[_0xaa60('0x9')](_0xaa60('0xa'),util[_0xaa60('0xc')](_0xaa60('0xd'),this[_0xaa60('0xe')](_0xaa60('0x5'))||'',this[_0xaa60('0xe')](_0xaa60('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xaa60('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xaa60('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x150f=['formData','stringify','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name','long','isObjectLike'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x150f,0x9e));var _0xf150=function(_0x2d9171,_0xa8d795){_0x2d9171=_0x2d9171-0x0;var _0x39dac7=_0x150f[_0x2d9171];return _0x39dac7;};'use strict';var Sequelize=require(_0xf150('0x0'));var _=require(_0xf150('0x1'));var util=require(_0xf150('0x2'));module[_0xf150('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xf150('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xf150('0x5')),'set':function(_0x2b5657){if(_[_0xf150('0x6')](_0x2b5657)){this['setDataValue'](_0xf150('0x7'),JSON[_0xf150('0x8')](_0x2b5657));}else if(_['isString'](_0x2b5657)){this[_0xf150('0x9')](_0xf150('0x7'),_0x2b5657);}else{this[_0xf150('0x9')](_0xf150('0x7'),util[_0xf150('0xa')](_0xf150('0xb'),this[_0xf150('0xc')](_0xf150('0x4'))||'',this[_0xf150('0xc')](_0xf150('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf150('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 5023be6..2adfbd9 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 _0x531a=['findOne','JscriptySessionReport','rows','getAnswers','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','-createdAt','questionId','question','format','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','get','Projects','name','map','JscriptyProject','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','createdAt','updatedAt','body','getSessions'];(function(_0x455a49,_0x441ef7){var _0x2c1e7a=function(_0x3e4d77){while(--_0x3e4d77){_0x455a49['push'](_0x455a49['shift']());}};_0x2c1e7a(++_0x441ef7);}(_0x531a,0x100));var _0xa531=function(_0xd45da0,_0x3ef3b3){_0xd45da0=_0xd45da0-0x0;var _0x2a9939=_0x531a[_0xd45da0];return _0x2a9939;};'use strict';var emlformat=require(_0xa531('0x0'));var rimraf=require(_0xa531('0x1'));var zipdir=require(_0xa531('0x2'));var jsonpatch=require(_0xa531('0x3'));var rp=require(_0xa531('0x4'));var moment=require(_0xa531('0x5'));var BPromise=require(_0xa531('0x6'));var Mustache=require(_0xa531('0x7'));var util=require(_0xa531('0x8'));var path=require(_0xa531('0x9'));var sox=require('sox');var csv=require(_0xa531('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa531('0xb'));var _=require(_0xa531('0xc'));var squel=require(_0xa531('0xd'));var crypto=require(_0xa531('0xe'));var jsforce=require(_0xa531('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa531('0xa'));var querystring=require(_0xa531('0x10'));var Papa=require('papaparse');var Redis=require(_0xa531('0x11'));var authService=require(_0xa531('0x12'));var qs=require(_0xa531('0x13'));var as=require(_0xa531('0x14'));var hardwareService=require(_0xa531('0x15'));var logger=require('../../config/logger')(_0xa531('0x16'));var utils=require('../../config/utils');var config=require(_0xa531('0x17'));var licenseUtil=require(_0xa531('0x18'));var db=require(_0xa531('0x19'))['db'];function respondWithStatusCode(_0x59130e,_0x3dcde3){_0x3dcde3=_0x3dcde3||0xcc;return function(_0x355d67){if(_0x355d67){return _0x59130e['sendStatus'](_0x3dcde3);}return _0x59130e[_0xa531('0x1a')](_0x3dcde3)[_0xa531('0x1b')]();};}function respondWithResult(_0x4922e4,_0x4717f9){_0x4717f9=_0x4717f9||0xc8;return function(_0x319f1f){if(_0x319f1f){return _0x4922e4[_0xa531('0x1a')](_0x4717f9)['json'](_0x319f1f);}};}function respondWithFilteredResult(_0x49205b,_0x56cffe){return function(_0x1600f4){if(_0x1600f4){var _0x1668aa=typeof _0x56cffe[_0xa531('0x1c')]===_0xa531('0x1d')&&typeof _0x56cffe[_0xa531('0x1e')]===_0xa531('0x1d');var _0x580761=_0x1600f4[_0xa531('0x1f')];var _0x5124a1=_0x1668aa?0x0:_0x56cffe[_0xa531('0x1c')];var _0x146013=_0x1668aa?_0x1600f4['count']:_0x56cffe['offset']+_0x56cffe[_0xa531('0x1e')];var _0x40848c;if(_0x146013>=_0x580761){_0x146013=_0x580761;_0x40848c=0xc8;}else{_0x40848c=0xce;}_0x49205b[_0xa531('0x1a')](_0x40848c);return _0x49205b['set'](_0xa531('0x20'),_0x5124a1+'-'+_0x146013+'/'+_0x580761)[_0xa531('0x21')](_0x1600f4);}return null;};}function patchUpdates(_0x4096f0){return function(_0x521799){try{jsonpatch[_0xa531('0x22')](_0x521799,_0x4096f0,!![]);}catch(_0x13904e){return BPromise['reject'](_0x13904e);}return _0x521799[_0xa531('0x23')]();};}function saveUpdates(_0x3864fc,_0x3a2016){return function(_0x18d0ef){if(_0x18d0ef){return _0x18d0ef[_0xa531('0x24')](_0x3864fc)[_0xa531('0x25')](function(_0x3270a6){return _0x3270a6;});}return null;};}function removeEntity(_0x3602c3,_0x271e4a){return function(_0x39f640){if(_0x39f640){return _0x39f640[_0xa531('0x26')]()[_0xa531('0x25')](function(){var _0x57f1b3=_0x39f640[_0xa531('0x27')]({'plain':!![]});var _0x1d0217=_0xa531('0x28');return db['UserProfileResource'][_0xa531('0x26')]({'where':{'type':_0x1d0217,'resourceId':_0x57f1b3['id']}})[_0xa531('0x25')](function(){return _0x39f640;});})['then'](function(){_0x3602c3['status'](0xcc)[_0xa531('0x1b')]();});}};}function handleEntityNotFound(_0x56b96d,_0x3acffc){return function(_0x2be143){if(!_0x2be143){_0x56b96d['sendStatus'](0x194);}return _0x2be143;};}function handleError(_0x40f43c,_0x5f2b51){_0x5f2b51=_0x5f2b51||0x1f4;return function(_0x36a8e6){logger['error'](_0x36a8e6['stack']);if(_0x36a8e6['name']){delete _0x36a8e6[_0xa531('0x29')];}_0x40f43c[_0xa531('0x1a')](_0x5f2b51)['send'](_0x36a8e6);};}exports['index']=function(_0x380cec,_0x59a10f){var _0x97df27={},_0x133431={},_0x556f56={'count':0x0,'rows':[]};var _0x3590f4=_[_0xa531('0x2a')](db[_0xa531('0x2b')]['rawAttributes'],function(_0x362691){return{'name':_0x362691[_0xa531('0x2c')],'type':_0x362691['type'][_0xa531('0x2d')]};});_0x133431[_0xa531('0x2e')]=_['map'](_0x3590f4,_0xa531('0x29'));_0x133431[_0xa531('0x2f')]=_[_0xa531('0x30')](_0x380cec[_0xa531('0x2f')]);_0x133431[_0xa531('0x31')]=_[_0xa531('0x32')](_0x133431[_0xa531('0x2e')],_0x133431['query']);_0x97df27['attributes']=_[_0xa531('0x32')](_0x133431[_0xa531('0x2e')],qs[_0xa531('0x33')](_0x380cec[_0xa531('0x2f')][_0xa531('0x33')]));_0x97df27['attributes']=_0x97df27[_0xa531('0x34')][_0xa531('0x35')]?_0x97df27[_0xa531('0x34')]:_0x133431[_0xa531('0x2e')];if(!_0x380cec[_0xa531('0x2f')][_0xa531('0x36')](_0xa531('0x37'))){_0x97df27[_0xa531('0x1e')]=qs[_0xa531('0x1e')](_0x380cec[_0xa531('0x2f')][_0xa531('0x1e')]);_0x97df27['offset']=qs[_0xa531('0x1c')](_0x380cec[_0xa531('0x2f')][_0xa531('0x1c')]);}_0x97df27[_0xa531('0x38')]=qs[_0xa531('0x39')](_0x380cec['query'][_0xa531('0x39')]);_0x97df27[_0xa531('0x3a')]=qs[_0xa531('0x31')](_[_0xa531('0x3b')](_0x380cec['query'],_0x133431[_0xa531('0x31')]),_0x3590f4);if(_0x380cec[_0xa531('0x2f')][_0xa531('0x3c')]){_0x97df27['where']=_['merge'](_0x97df27[_0xa531('0x3a')],{'$or':_['map'](_0x3590f4,function(_0x43d459){if(_0x43d459[_0xa531('0x3d')]!==_0xa531('0x3e')){var _0x4bc4ee={};_0x4bc4ee[_0x43d459['name']]={'$like':'%'+_0x380cec[_0xa531('0x2f')]['filter']+'%'};return _0x4bc4ee;}})});}_0x97df27=_[_0xa531('0x3f')]({},_0x97df27,_0x380cec[_0xa531('0x40')]);var _0x2024ce={'where':_0x97df27[_0xa531('0x3a')]};return db[_0xa531('0x2b')][_0xa531('0x1f')](_0x2024ce)[_0xa531('0x25')](function(_0x24e0ab){_0x556f56[_0xa531('0x1f')]=_0x24e0ab;if(_0x380cec['query']['includeAll']){_0x97df27[_0xa531('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0xa531('0x42')](_0x97df27);})[_0xa531('0x25')](function(_0x12d2e0){_0x556f56['rows']=_0x12d2e0;return _0x556f56;})[_0xa531('0x25')](respondWithFilteredResult(_0x59a10f,_0x97df27))[_0xa531('0x43')](handleError(_0x59a10f,null));};exports[_0xa531('0x44')]=function(_0xfaa238,_0x3e74f6){var _0x3bf073={'raw':![],'where':{'id':_0xfaa238[_0xa531('0x45')]['id']}},_0x28eff1={};_0x28eff1[_0xa531('0x2e')]=_[_0xa531('0x30')](db[_0xa531('0x2b')][_0xa531('0x46')]);_0x28eff1[_0xa531('0x2f')]=_['keys'](_0xfaa238[_0xa531('0x2f')]);_0x28eff1['filters']=_[_0xa531('0x32')](_0x28eff1[_0xa531('0x2e')],_0x28eff1[_0xa531('0x2f')]);_0x3bf073[_0xa531('0x34')]=_['intersection'](_0x28eff1['model'],qs['fields'](_0xfaa238[_0xa531('0x2f')][_0xa531('0x33')]));_0x3bf073[_0xa531('0x34')]=_0x3bf073['attributes'][_0xa531('0x35')]?_0x3bf073[_0xa531('0x34')]:_0x28eff1[_0xa531('0x2e')];if(_0xfaa238[_0xa531('0x2f')]['includeAll']){_0x3bf073[_0xa531('0x41')]=[{'all':!![]}];}_0x3bf073=_['merge']({},_0x3bf073,_0xfaa238[_0xa531('0x40')]);return db[_0xa531('0x2b')][_0xa531('0x47')](_0x3bf073)[_0xa531('0x25')](handleEntityNotFound(_0x3e74f6,null))[_0xa531('0x25')](respondWithResult(_0x3e74f6,null))['catch'](handleError(_0x3e74f6,null));};exports[_0xa531('0x48')]=function(_0x2a5973,_0x333b61){return db[_0xa531('0x2b')][_0xa531('0x48')](_0x2a5973['body'],{})[_0xa531('0x25')](function(_0x18b9db){var _0x599827=_0x2a5973[_0xa531('0x49')]['get']({'plain':!![]});if(!_0x599827)throw new Error(_0xa531('0x4a'));if(_0x599827[_0xa531('0x4b')]===_0xa531('0x49')){var _0x517966=_0x18b9db[_0xa531('0x27')]({'plain':!![]});var _0x496291=_0xa531('0x28');return db[_0xa531('0x4c')][_0xa531('0x47')]({'where':{'name':_0x496291,'userProfileId':_0x599827['userProfileId']},'raw':!![]})['then'](function(_0x5b97a9){if(_0x5b97a9&&_0x5b97a9[_0xa531('0x4d')]===0x0){return db[_0xa531('0x4e')][_0xa531('0x48')]({'name':_0x517966['name'],'resourceId':_0x517966['id'],'type':_0x5b97a9[_0xa531('0x29')],'sectionId':_0x5b97a9['id']},{})[_0xa531('0x25')](function(){return _0x18b9db;});}else{return _0x18b9db;}})[_0xa531('0x43')](function(_0x3c97e4){logger[_0xa531('0x4f')](_0xa531('0x50'),_0x3c97e4);throw _0x3c97e4;});}return _0x18b9db;})['then'](respondWithResult(_0x333b61,0xc9))[_0xa531('0x43')](handleError(_0x333b61,null));};exports['clone']=function(_0x1bae42,_0x3f39f7){var _0x8eeecf={'where':{'id':_0x1bae42[_0xa531('0x45')]['id']}},_0x435e40={};_0x435e40['model']=_[_0xa531('0x30')](db[_0xa531('0x2b')][_0xa531('0x46')]);_0x8eeecf['attributes']=_[_0xa531('0x32')](_0x435e40['model'],qs[_0xa531('0x33')](_0x1bae42['query']['fields']));_0x8eeecf['attributes']=_0x8eeecf['attributes']['length']?_0x8eeecf[_0xa531('0x34')]:_0x435e40[_0xa531('0x2e')];if(_0x1bae42[_0xa531('0x2f')][_0xa531('0x51')]){_0x8eeecf['include']=[{'all':!![]}];}_0x8eeecf=_[_0xa531('0x3f')]({},_0x8eeecf,_0x1bae42[_0xa531('0x40')]);return db[_0xa531('0x2b')]['find'](_0x8eeecf)[_0xa531('0x25')](handleEntityNotFound(_0x3f39f7,null))['then'](function(_0x12a7d3){if(_0x12a7d3){var _0x16edc5=_0x12a7d3[_0xa531('0x27')]({'plain':!![]});_0x16edc5=qs['omit'](_0x16edc5,['id',_0xa531('0x52'),_0xa531('0x53')]);_0x1bae42[_0xa531('0x54')]=_['omit'](_0x1bae42[_0xa531('0x54')],['id',_0xa531('0x52'),_0xa531('0x53')]);return db['JscriptyProject'][_0xa531('0x48')](_['merge'](_0x16edc5,_0x1bae42[_0xa531('0x54')]),{'include':_0x1bae42[_0xa531('0x2f')][_0xa531('0x51')]?[{'all':!![]}]:undefined})[_0xa531('0x25')](function(_0x469489){var _0x2906a8=_0x1bae42['user']['get']({'plain':!![]});if(!_0x2906a8)throw new Error(_0xa531('0x4a'));if(_0x2906a8[_0xa531('0x4b')]==='user'){var _0x26ab6f=_0x469489[_0xa531('0x27')]({'plain':!![]});var _0x3f01c6=_0xa531('0x28');return db[_0xa531('0x4c')][_0xa531('0x47')]({'where':{'name':_0x3f01c6,'userProfileId':_0x2906a8['userProfileId']},'raw':!![]})[_0xa531('0x25')](function(_0xded3de){if(_0xded3de&&_0xded3de[_0xa531('0x4d')]===0x0){return db[_0xa531('0x4e')][_0xa531('0x48')]({'name':_0x26ab6f['name'],'resourceId':_0x26ab6f['id'],'type':_0xded3de['name'],'sectionId':_0xded3de['id']},{})[_0xa531('0x25')](function(){return _0x469489;});}else{return _0x469489;}})[_0xa531('0x43')](function(_0x103e1d){logger[_0xa531('0x4f')](_0xa531('0x50'),_0x103e1d);throw _0x103e1d;});}return _0x469489;});}})[_0xa531('0x25')](respondWithResult(_0x3f39f7,0xc9))[_0xa531('0x43')](handleError(_0x3f39f7,null));};exports[_0xa531('0x24')]=function(_0x8fab97,_0xd8f05){if(_0x8fab97[_0xa531('0x54')]['id']){delete _0x8fab97[_0xa531('0x54')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x8fab97[_0xa531('0x45')]['id']}})[_0xa531('0x25')](handleEntityNotFound(_0xd8f05,null))['then'](saveUpdates(_0x8fab97[_0xa531('0x54')],null))[_0xa531('0x25')](respondWithResult(_0xd8f05,null))[_0xa531('0x43')](handleError(_0xd8f05,null));};exports[_0xa531('0x26')]=function(_0x5f4995,_0x48f06b){return db[_0xa531('0x2b')]['find']({'where':{'id':_0x5f4995[_0xa531('0x45')]['id']}})[_0xa531('0x25')](handleEntityNotFound(_0x48f06b,null))[_0xa531('0x25')](removeEntity(_0x48f06b,null))[_0xa531('0x43')](handleError(_0x48f06b,null));};exports[_0xa531('0x55')]=function(_0x1033a5,_0x196ea3,_0xadbd2d){var _0x345be8={'raw':!![],'where':{}};var _0x57d0c0={};var _0xe3fd66={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xa531('0x56')]({'where':{'id':_0x1033a5[_0xa531('0x45')]['id']}})[_0xa531('0x25')](handleEntityNotFound(_0x196ea3,null))[_0xa531('0x25')](function(_0x4230e9){if(_0x4230e9){_0x57d0c0[_0xa531('0x2e')]=_[_0xa531('0x30')](db['JscriptySessionReport'][_0xa531('0x46')]);_0x57d0c0[_0xa531('0x2f')]=_[_0xa531('0x30')](_0x1033a5[_0xa531('0x2f')]);_0x57d0c0[_0xa531('0x31')]=_[_0xa531('0x32')](_0x57d0c0[_0xa531('0x2e')],_0x57d0c0[_0xa531('0x2f')]);_0x345be8[_0xa531('0x34')]=_[_0xa531('0x32')](_0x57d0c0[_0xa531('0x2e')],qs['fields'](_0x1033a5[_0xa531('0x2f')][_0xa531('0x33')]));_0x345be8['attributes']=_0x345be8[_0xa531('0x34')][_0xa531('0x35')]?_0x345be8['attributes']:_0x57d0c0[_0xa531('0x2e')];if(!_0x1033a5['query'][_0xa531('0x36')](_0xa531('0x37'))){_0x345be8[_0xa531('0x1e')]=qs['limit'](_0x1033a5['query'][_0xa531('0x1e')]);_0x345be8['offset']=qs[_0xa531('0x1c')](_0x1033a5[_0xa531('0x2f')][_0xa531('0x1c')]);}_0x345be8[_0xa531('0x38')]=qs['sort'](_0x1033a5['query']['sort']);_0x345be8[_0xa531('0x3a')]=qs[_0xa531('0x31')](_[_0xa531('0x3b')](_0x1033a5['query'],_0x57d0c0['filters']));_0x345be8['where']['ProjectId']=_0x4230e9['id'];if(_0x1033a5['query'][_0xa531('0x3c')]){_0x345be8[_0xa531('0x3a')]=_[_0xa531('0x3f')](_0x345be8[_0xa531('0x3a')],{'$or':_['map'](_0x345be8[_0xa531('0x34')],function(_0x82d6bb){var _0x24f75e={};_0x24f75e[_0x82d6bb]={'$like':'%'+_0x1033a5[_0xa531('0x2f')][_0xa531('0x3c')]+'%'};return _0x24f75e;})});}_0x345be8=_['merge']({},_0x345be8,_0x1033a5[_0xa531('0x40')]);return db[_0xa531('0x57')][_0xa531('0x1f')]({'where':_0x345be8[_0xa531('0x3a')]})[_0xa531('0x25')](function(_0x13dcbf){_0xe3fd66[_0xa531('0x1f')]=_0x13dcbf;if(_0x1033a5['query']['includeAll']){_0x345be8[_0xa531('0x41')]=[{'all':!![]}];}return db[_0xa531('0x57')][_0xa531('0x42')](_0x345be8);})[_0xa531('0x25')](function(_0x882fe0){_0xe3fd66[_0xa531('0x58')]=_0x882fe0;return _0xe3fd66;});}})[_0xa531('0x25')](respondWithFilteredResult(_0x196ea3,_0x345be8))[_0xa531('0x43')](handleError(_0x196ea3,null));};exports[_0xa531('0x59')]=function(_0x2bdd93,_0x23d7e6,_0x4527d1){var _0x464d6b={'raw':!![],'where':{}};var _0x5e20cd={};var _0x1b99b6={'count':0x0,'rows':[]};return db[_0xa531('0x2b')][_0xa531('0x56')]({'where':{'id':_0x2bdd93['params']['id']}})[_0xa531('0x25')](handleEntityNotFound(_0x23d7e6,null))[_0xa531('0x25')](function(_0x43cbad){if(_0x43cbad){_0x5e20cd[_0xa531('0x2e')]=_[_0xa531('0x30')](db['JscriptyAnswerReport'][_0xa531('0x46')]);_0x5e20cd['query']=_[_0xa531('0x30')](_0x2bdd93[_0xa531('0x2f')]);_0x5e20cd[_0xa531('0x31')]=_['intersection'](_0x5e20cd['model'],_0x5e20cd[_0xa531('0x2f')]);_0x464d6b['attributes']=_['intersection'](_0x5e20cd[_0xa531('0x2e')],qs['fields'](_0x2bdd93[_0xa531('0x2f')][_0xa531('0x33')]));_0x464d6b[_0xa531('0x34')]=_0x464d6b[_0xa531('0x34')][_0xa531('0x35')]?_0x464d6b[_0xa531('0x34')]:_0x5e20cd[_0xa531('0x2e')];if(!_0x2bdd93[_0xa531('0x2f')][_0xa531('0x36')](_0xa531('0x37'))){_0x464d6b['limit']=qs[_0xa531('0x1e')](_0x2bdd93[_0xa531('0x2f')][_0xa531('0x1e')]);_0x464d6b[_0xa531('0x1c')]=qs[_0xa531('0x1c')](_0x2bdd93[_0xa531('0x2f')]['offset']);}_0x464d6b['order']=qs[_0xa531('0x39')](_0x2bdd93[_0xa531('0x2f')][_0xa531('0x39')]);_0x464d6b[_0xa531('0x3a')]=qs[_0xa531('0x31')](_[_0xa531('0x3b')](_0x2bdd93[_0xa531('0x2f')],_0x5e20cd[_0xa531('0x31')]));_0x464d6b[_0xa531('0x3a')][_0xa531('0x5a')]=_0x43cbad['id'];if(_0x2bdd93[_0xa531('0x2f')][_0xa531('0x3c')]){_0x464d6b[_0xa531('0x3a')]=_[_0xa531('0x3f')](_0x464d6b[_0xa531('0x3a')],{'$or':_[_0xa531('0x2a')](_0x464d6b[_0xa531('0x34')],function(_0x5b54de){var _0x4cb9a0={};_0x4cb9a0[_0x5b54de]={'$like':'%'+_0x2bdd93[_0xa531('0x2f')][_0xa531('0x3c')]+'%'};return _0x4cb9a0;})});}_0x464d6b=_['merge']({},_0x464d6b,_0x2bdd93[_0xa531('0x40')]);return db['JscriptyAnswerReport'][_0xa531('0x1f')]({'where':_0x464d6b['where']})[_0xa531('0x25')](function(_0x36db49){_0x1b99b6[_0xa531('0x1f')]=_0x36db49;if(_0x2bdd93['query'][_0xa531('0x51')]){_0x464d6b[_0xa531('0x41')]=[{'all':!![]}];}return db[_0xa531('0x5b')][_0xa531('0x42')](_0x464d6b);})['then'](function(_0x16215b){_0x1b99b6[_0xa531('0x58')]=_0x16215b;return _0x1b99b6;});}})[_0xa531('0x25')](respondWithFilteredResult(_0x23d7e6,_0x464d6b))['catch'](handleError(_0x23d7e6,null));};function char(_0x16d707){return _0xa531('0x5c')===typeof _0x16d707?String[_0xa531('0x5d')][_0xa531('0x22')](null,arguments):_0x16d707;}function needsEncapsulation(_0x5951c4){return!!_0x5951c4&&(_0x5951c4[_0xa531('0x5e')]()[_0xa531('0x5f')](char(0xd))>=0x0||_0x5951c4[_0xa531('0x5e')]()[_0xa531('0x5f')](char(0xa))>=0x0||_0x5951c4['toString']()['indexOf'](char(0x2c))>=0x0||_0x5951c4[_0xa531('0x5e')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4a1a33){var _0x5c4711=char(0x22),_0x1b6ecc='\x5c'+char(0x22),_0x4f0c4=_0x4a1a33['toString']()['replace'](new RegExp(_0x5c4711,'g'),_0x1b6ecc);return _0x5c4711+_0x4f0c4+_0x5c4711;}exports[_0xa531('0x60')]=function(_0x522100,_0x1c61a2,_0x541039){var _0xb24ec5,_0xdf2263;var _0x43c8dc={'where':{'ProjectId':_0x522100['params']['id']}};if(_0x522100[_0xa531('0x2f')][_0xa531('0x61')]){_0x43c8dc[_0xa531('0x3a')][_0xa531('0x62')]=JSON['parse'](_0x522100['query'][_0xa531('0x61')]);}return db[_0xa531('0x57')][_0xa531('0x42')](_0x43c8dc)[_0xa531('0x25')](handleEntityNotFound(_0x1c61a2,null))['then'](function(_0x578c95){if(_0x578c95){_0xb24ec5=_0x578c95;return db['JscriptyQuestionReport'][_0xa531('0x42')]({'where':{'SessionId':{'$in':_[_0xa531('0x2a')](_0xb24ec5,'id')},'ProjectId':_0x522100['params']['id']},'order':_0xa531('0x63')});}})['then'](handleEntityNotFound(_0x1c61a2,null))[_0xa531('0x25')](function(_0x21f881){if(_0x21f881){_0xdf2263=_0x21f881;var _0x5baf82={};for(var _0xa4f5e1=0x0,_0x6f5d20=_0xdf2263[_0xa531('0x35')];_0xa4f5e1<_0x6f5d20;_0xa4f5e1++){if(!_0x5baf82['hasOwnProperty'](_0xdf2263[_0xa4f5e1][_0xa531('0x64')])){_0x5baf82[_0xdf2263[_0xa4f5e1][_0xa531('0x64')]]=needsEncapsulation(_0xdf2263[_0xa4f5e1][_0xa531('0x65')])?encapsulate(_0xdf2263[_0xa4f5e1]['question']):_0xdf2263[_0xa4f5e1][_0xa531('0x65')];}}var _0x9d1fbf=[],_0x560264={};for(var _0x271944=0x0,_0x44d09b=_0xb24ec5[_0xa531('0x35')];_0x271944<_0x44d09b;_0x271944++){_0x560264={'ProjectId':_0x522100[_0xa531('0x45')]['id'],'SessionId':_0xb24ec5[_0x271944]['id'],'StartTime':moment(_0xb24ec5[_0x271944][_0xa531('0x62')])[_0xa531('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4d98fd=0x0,_0x1b44c0=_0xdf2263['length'];_0x4d98fd<_0x1b44c0;_0x4d98fd++){if(_0xdf2263[_0x4d98fd][_0xa531('0x67')]==_0xb24ec5[_0x271944]['id']&&_0x5baf82[_0xa531('0x36')](_0xdf2263[_0x4d98fd]['questionId'])){_0x560264[_0x5baf82[_0xdf2263[_0x4d98fd]['questionId']]]=_0xdf2263[_0x4d98fd][_0xa531('0x68')];}}for(var _0x2af973 in _0x5baf82){if(!_0x560264[_0xa531('0x36')](_0x5baf82[_0x2af973])){_0x560264[_0x5baf82[_0x2af973]]=null;}}_0x9d1fbf['push'](_0x560264);}return _0x9d1fbf;}})[_0xa531('0x25')](function(_0x4faf1e){if(!_[_0xa531('0x69')](_0x4faf1e)){var _0x2856ac=toCsv(_0x4faf1e);var _0x50441b=Date[_0xa531('0x6a')]();fs['writeFileSync'](util['format'](_0xa531('0x6b'),_0x522100['params']['id'],_0x50441b),_0x2856ac);_0x1c61a2['setHeader'](_0xa531('0x6c'),_0xa531('0x6d')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x522100[_0xa531('0x45')]['id'],_0x50441b));_0x1c61a2['setHeader'](_0xa531('0x6e'),_0xa531('0x6f'));return _0x1c61a2[_0xa531('0x70')](util[_0xa531('0x66')](_0xa531('0x6b'),_0x522100[_0xa531('0x45')]['id'],_0x50441b));}else{return _0x1c61a2[_0xa531('0x71')](0xcc);}})[_0xa531('0x43')](handleError(_0x1c61a2,null));}; \ No newline at end of file +var _0x06ef=['error','stack','name','send','index','map','JscriptyProject','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','updatedAt','createdAt','user','UserProfileSection','update','JscriptySessionReport','nolimit','ProjectId','include','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','text/csv','download','sendStatus','zip-dir','mustache','util','path','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','then','get','Projects','UserProfileResource','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06ef,0x185));var _0xf06e=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x06ef[_0xcfeda9];return _0x4826c7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf06e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf06e('0x1'));var util=require(_0xf06e('0x2'));var path=require(_0xf06e('0x3'));var sox=require('sox');var csv=require(_0xf06e('0x4'));var ejs=require(_0xf06e('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf06e('0x6'));var toCsv=require(_0xf06e('0x4'));var querystring=require(_0xf06e('0x7'));var Papa=require(_0xf06e('0x8'));var Redis=require(_0xf06e('0x9'));var authService=require('../../components/auth/service');var qs=require(_0xf06e('0xa'));var as=require(_0xf06e('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf06e('0xc'))(_0xf06e('0xd'));var utils=require(_0xf06e('0xe'));var config=require(_0xf06e('0xf'));var licenseUtil=require(_0xf06e('0x10'));var db=require(_0xf06e('0x11'))['db'];function respondWithStatusCode(_0x49fe5d,_0x3daa50){_0x3daa50=_0x3daa50||0xcc;return function(_0x2578e4){if(_0x2578e4){return _0x49fe5d['sendStatus'](_0x3daa50);}return _0x49fe5d[_0xf06e('0x12')](_0x3daa50)[_0xf06e('0x13')]();};}function respondWithResult(_0x59f60b,_0x4e6dd8){_0x4e6dd8=_0x4e6dd8||0xc8;return function(_0x5c862b){if(_0x5c862b){return _0x59f60b[_0xf06e('0x12')](_0x4e6dd8)[_0xf06e('0x14')](_0x5c862b);}};}function respondWithFilteredResult(_0x36f38f,_0x55dce1){return function(_0x3fdacc){if(_0x3fdacc){var _0x375f90=typeof _0x55dce1[_0xf06e('0x15')]===_0xf06e('0x16')&&typeof _0x55dce1[_0xf06e('0x17')]===_0xf06e('0x16');var _0x448fb6=_0x3fdacc['count'];var _0x380c07=_0x375f90?0x0:_0x55dce1[_0xf06e('0x15')];var _0x251c9f=_0x375f90?_0x3fdacc[_0xf06e('0x18')]:_0x55dce1['offset']+_0x55dce1['limit'];var _0x171763;if(_0x251c9f>=_0x448fb6){_0x251c9f=_0x448fb6;_0x171763=0xc8;}else{_0x171763=0xce;}_0x36f38f[_0xf06e('0x12')](_0x171763);return _0x36f38f['set']('Content-Range',_0x380c07+'-'+_0x251c9f+'/'+_0x448fb6)[_0xf06e('0x14')](_0x3fdacc);}return null;};}function patchUpdates(_0x211590){return function(_0x167ad3){try{jsonpatch['apply'](_0x167ad3,_0x211590,!![]);}catch(_0x197f50){return BPromise[_0xf06e('0x19')](_0x197f50);}return _0x167ad3['save']();};}function saveUpdates(_0x3c3796,_0x1ba130){return function(_0x445e2b){if(_0x445e2b){return _0x445e2b['update'](_0x3c3796)[_0xf06e('0x1a')](function(_0x1d8e73){return _0x1d8e73;});}return null;};}function removeEntity(_0x9e06b5,_0x13e484){return function(_0x3b410e){if(_0x3b410e){return _0x3b410e['destroy']()[_0xf06e('0x1a')](function(){var _0x4923d3=_0x3b410e[_0xf06e('0x1b')]({'plain':!![]});var _0x36b816=_0xf06e('0x1c');return db[_0xf06e('0x1d')][_0xf06e('0x1e')]({'where':{'type':_0x36b816,'resourceId':_0x4923d3['id']}})[_0xf06e('0x1a')](function(){return _0x3b410e;});})['then'](function(){_0x9e06b5[_0xf06e('0x12')](0xcc)[_0xf06e('0x13')]();});}};}function handleEntityNotFound(_0x873aa5,_0x1b1d2a){return function(_0x164fa9){if(!_0x164fa9){_0x873aa5['sendStatus'](0x194);}return _0x164fa9;};}function handleError(_0x19e8d3,_0x2ccbd0){_0x2ccbd0=_0x2ccbd0||0x1f4;return function(_0x126aa9){logger[_0xf06e('0x1f')](_0x126aa9[_0xf06e('0x20')]);if(_0x126aa9[_0xf06e('0x21')]){delete _0x126aa9['name'];}_0x19e8d3[_0xf06e('0x12')](_0x2ccbd0)[_0xf06e('0x22')](_0x126aa9);};}exports[_0xf06e('0x23')]=function(_0x5d21f7,_0x372d15){var _0x11580e={},_0xb1fa81={},_0x25115a={'count':0x0,'rows':[]};var _0x3f76d3=_[_0xf06e('0x24')](db[_0xf06e('0x25')][_0xf06e('0x26')],function(_0x3d4181){return{'name':_0x3d4181['fieldName'],'type':_0x3d4181['type'][_0xf06e('0x27')]};});_0xb1fa81[_0xf06e('0x28')]=_['map'](_0x3f76d3,_0xf06e('0x21'));_0xb1fa81[_0xf06e('0x29')]=_[_0xf06e('0x2a')](_0x5d21f7[_0xf06e('0x29')]);_0xb1fa81[_0xf06e('0x2b')]=_[_0xf06e('0x2c')](_0xb1fa81['model'],_0xb1fa81[_0xf06e('0x29')]);_0x11580e[_0xf06e('0x2d')]=_[_0xf06e('0x2c')](_0xb1fa81['model'],qs[_0xf06e('0x2e')](_0x5d21f7[_0xf06e('0x29')][_0xf06e('0x2e')]));_0x11580e[_0xf06e('0x2d')]=_0x11580e[_0xf06e('0x2d')][_0xf06e('0x2f')]?_0x11580e[_0xf06e('0x2d')]:_0xb1fa81['model'];if(!_0x5d21f7['query'][_0xf06e('0x30')]('nolimit')){_0x11580e[_0xf06e('0x17')]=qs['limit'](_0x5d21f7[_0xf06e('0x29')]['limit']);_0x11580e[_0xf06e('0x15')]=qs[_0xf06e('0x15')](_0x5d21f7[_0xf06e('0x29')][_0xf06e('0x15')]);}_0x11580e[_0xf06e('0x31')]=qs[_0xf06e('0x32')](_0x5d21f7['query'][_0xf06e('0x32')]);_0x11580e[_0xf06e('0x33')]=qs[_0xf06e('0x2b')](_[_0xf06e('0x34')](_0x5d21f7[_0xf06e('0x29')],_0xb1fa81[_0xf06e('0x2b')]),_0x3f76d3);if(_0x5d21f7[_0xf06e('0x29')][_0xf06e('0x35')]){_0x11580e[_0xf06e('0x33')]=_[_0xf06e('0x36')](_0x11580e[_0xf06e('0x33')],{'$or':_['map'](_0x3f76d3,function(_0x4085d6){if(_0x4085d6[_0xf06e('0x37')]!==_0xf06e('0x38')){var _0x3acf46={};_0x3acf46[_0x4085d6[_0xf06e('0x21')]]={'$like':'%'+_0x5d21f7[_0xf06e('0x29')][_0xf06e('0x35')]+'%'};return _0x3acf46;}})});}_0x11580e=_['merge']({},_0x11580e,_0x5d21f7[_0xf06e('0x39')]);var _0x37e0fc={'where':_0x11580e['where']};return db['JscriptyProject'][_0xf06e('0x18')](_0x37e0fc)[_0xf06e('0x1a')](function(_0x3ae06c){_0x25115a[_0xf06e('0x18')]=_0x3ae06c;if(_0x5d21f7[_0xf06e('0x29')][_0xf06e('0x3a')]){_0x11580e['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xf06e('0x3b')](_0x11580e);})['then'](function(_0x548186){_0x25115a['rows']=_0x548186;return _0x25115a;})[_0xf06e('0x1a')](respondWithFilteredResult(_0x372d15,_0x11580e))[_0xf06e('0x3c')](handleError(_0x372d15,null));};exports['show']=function(_0x58b828,_0x183c9b){var _0x7f94b0={'raw':![],'where':{'id':_0x58b828[_0xf06e('0x3d')]['id']}},_0x5ea9e4={};_0x5ea9e4['model']=_[_0xf06e('0x2a')](db[_0xf06e('0x25')][_0xf06e('0x26')]);_0x5ea9e4[_0xf06e('0x29')]=_['keys'](_0x58b828[_0xf06e('0x29')]);_0x5ea9e4[_0xf06e('0x2b')]=_['intersection'](_0x5ea9e4[_0xf06e('0x28')],_0x5ea9e4[_0xf06e('0x29')]);_0x7f94b0[_0xf06e('0x2d')]=_[_0xf06e('0x2c')](_0x5ea9e4[_0xf06e('0x28')],qs[_0xf06e('0x2e')](_0x58b828[_0xf06e('0x29')][_0xf06e('0x2e')]));_0x7f94b0[_0xf06e('0x2d')]=_0x7f94b0[_0xf06e('0x2d')][_0xf06e('0x2f')]?_0x7f94b0['attributes']:_0x5ea9e4['model'];if(_0x58b828[_0xf06e('0x29')]['includeAll']){_0x7f94b0['include']=[{'all':!![]}];}_0x7f94b0=_[_0xf06e('0x36')]({},_0x7f94b0,_0x58b828[_0xf06e('0x39')]);return db[_0xf06e('0x25')][_0xf06e('0x3e')](_0x7f94b0)[_0xf06e('0x1a')](handleEntityNotFound(_0x183c9b,null))[_0xf06e('0x1a')](respondWithResult(_0x183c9b,null))[_0xf06e('0x3c')](handleError(_0x183c9b,null));};exports[_0xf06e('0x3f')]=function(_0x4f7ce2,_0x23b416){return db[_0xf06e('0x25')]['create'](_0x4f7ce2[_0xf06e('0x40')],{})[_0xf06e('0x1a')](function(_0x44030c){var _0x4c8824=_0x4f7ce2['user'][_0xf06e('0x1b')]({'plain':!![]});if(!_0x4c8824)throw new Error(_0xf06e('0x41'));if(_0x4c8824[_0xf06e('0x42')]==='user'){var _0x9ec791=_0x44030c[_0xf06e('0x1b')]({'plain':!![]});var _0x1dedf3=_0xf06e('0x1c');return db['UserProfileSection']['find']({'where':{'name':_0x1dedf3,'userProfileId':_0x4c8824[_0xf06e('0x43')]},'raw':!![]})['then'](function(_0x4b07a1){if(_0x4b07a1&&_0x4b07a1[_0xf06e('0x44')]===0x0){return db['UserProfileResource']['create']({'name':_0x9ec791[_0xf06e('0x21')],'resourceId':_0x9ec791['id'],'type':_0x4b07a1[_0xf06e('0x21')],'sectionId':_0x4b07a1['id']},{})[_0xf06e('0x1a')](function(){return _0x44030c;});}else{return _0x44030c;}})[_0xf06e('0x3c')](function(_0x4aca1){logger[_0xf06e('0x1f')](_0xf06e('0x45'),_0x4aca1);throw _0x4aca1;});}return _0x44030c;})['then'](respondWithResult(_0x23b416,0xc9))[_0xf06e('0x3c')](handleError(_0x23b416,null));};exports['clone']=function(_0x417c96,_0x54f3fb){var _0x496006={'where':{'id':_0x417c96[_0xf06e('0x3d')]['id']}},_0x1fe197={};_0x1fe197[_0xf06e('0x28')]=_[_0xf06e('0x2a')](db[_0xf06e('0x25')]['rawAttributes']);_0x496006[_0xf06e('0x2d')]=_[_0xf06e('0x2c')](_0x1fe197['model'],qs['fields'](_0x417c96['query']['fields']));_0x496006[_0xf06e('0x2d')]=_0x496006[_0xf06e('0x2d')]['length']?_0x496006[_0xf06e('0x2d')]:_0x1fe197[_0xf06e('0x28')];if(_0x417c96[_0xf06e('0x29')][_0xf06e('0x3a')]){_0x496006['include']=[{'all':!![]}];}_0x496006=_[_0xf06e('0x36')]({},_0x496006,_0x417c96[_0xf06e('0x39')]);return db['JscriptyProject'][_0xf06e('0x3e')](_0x496006)[_0xf06e('0x1a')](handleEntityNotFound(_0x54f3fb,null))[_0xf06e('0x1a')](function(_0xa1afb9){if(_0xa1afb9){var _0x3a6bd7=_0xa1afb9[_0xf06e('0x1b')]({'plain':!![]});_0x3a6bd7=qs['omit'](_0x3a6bd7,['id','createdAt',_0xf06e('0x46')]);_0x417c96[_0xf06e('0x40')]=_['omit'](_0x417c96[_0xf06e('0x40')],['id',_0xf06e('0x47'),_0xf06e('0x46')]);return db[_0xf06e('0x25')][_0xf06e('0x3f')](_[_0xf06e('0x36')](_0x3a6bd7,_0x417c96['body']),{'include':_0x417c96[_0xf06e('0x29')][_0xf06e('0x3a')]?[{'all':!![]}]:undefined})[_0xf06e('0x1a')](function(_0x408ae3){var _0x14cb25=_0x417c96[_0xf06e('0x48')][_0xf06e('0x1b')]({'plain':!![]});if(!_0x14cb25)throw new Error(_0xf06e('0x41'));if(_0x14cb25[_0xf06e('0x42')]===_0xf06e('0x48')){var _0x5bf60a=_0x408ae3[_0xf06e('0x1b')]({'plain':!![]});var _0x4175e3=_0xf06e('0x1c');return db[_0xf06e('0x49')]['find']({'where':{'name':_0x4175e3,'userProfileId':_0x14cb25[_0xf06e('0x43')]},'raw':!![]})[_0xf06e('0x1a')](function(_0x543afa){if(_0x543afa&&_0x543afa[_0xf06e('0x44')]===0x0){return db[_0xf06e('0x1d')][_0xf06e('0x3f')]({'name':_0x5bf60a[_0xf06e('0x21')],'resourceId':_0x5bf60a['id'],'type':_0x543afa[_0xf06e('0x21')],'sectionId':_0x543afa['id']},{})[_0xf06e('0x1a')](function(){return _0x408ae3;});}else{return _0x408ae3;}})[_0xf06e('0x3c')](function(_0x4ad726){logger[_0xf06e('0x1f')](_0xf06e('0x45'),_0x4ad726);throw _0x4ad726;});}return _0x408ae3;});}})[_0xf06e('0x1a')](respondWithResult(_0x54f3fb,0xc9))['catch'](handleError(_0x54f3fb,null));};exports[_0xf06e('0x4a')]=function(_0x3c74f8,_0x18651f){if(_0x3c74f8['body']['id']){delete _0x3c74f8[_0xf06e('0x40')]['id'];}return db[_0xf06e('0x25')][_0xf06e('0x3e')]({'where':{'id':_0x3c74f8['params']['id']}})[_0xf06e('0x1a')](handleEntityNotFound(_0x18651f,null))[_0xf06e('0x1a')](saveUpdates(_0x3c74f8[_0xf06e('0x40')],null))[_0xf06e('0x1a')](respondWithResult(_0x18651f,null))[_0xf06e('0x3c')](handleError(_0x18651f,null));};exports[_0xf06e('0x1e')]=function(_0x1b3c95,_0x500f4d){return db[_0xf06e('0x25')][_0xf06e('0x3e')]({'where':{'id':_0x1b3c95[_0xf06e('0x3d')]['id']}})[_0xf06e('0x1a')](handleEntityNotFound(_0x500f4d,null))[_0xf06e('0x1a')](removeEntity(_0x500f4d,null))['catch'](handleError(_0x500f4d,null));};exports['getSessions']=function(_0x15261e,_0x305117,_0x16ca9d){var _0x317f99={'raw':!![],'where':{}};var _0xde0db5={};var _0x17397b={'count':0x0,'rows':[]};return db[_0xf06e('0x25')]['findOne']({'where':{'id':_0x15261e[_0xf06e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x305117,null))[_0xf06e('0x1a')](function(_0x199f13){if(_0x199f13){_0xde0db5[_0xf06e('0x28')]=_[_0xf06e('0x2a')](db[_0xf06e('0x4b')][_0xf06e('0x26')]);_0xde0db5['query']=_[_0xf06e('0x2a')](_0x15261e[_0xf06e('0x29')]);_0xde0db5[_0xf06e('0x2b')]=_['intersection'](_0xde0db5[_0xf06e('0x28')],_0xde0db5['query']);_0x317f99['attributes']=_[_0xf06e('0x2c')](_0xde0db5[_0xf06e('0x28')],qs['fields'](_0x15261e[_0xf06e('0x29')][_0xf06e('0x2e')]));_0x317f99[_0xf06e('0x2d')]=_0x317f99[_0xf06e('0x2d')][_0xf06e('0x2f')]?_0x317f99[_0xf06e('0x2d')]:_0xde0db5['model'];if(!_0x15261e[_0xf06e('0x29')][_0xf06e('0x30')](_0xf06e('0x4c'))){_0x317f99[_0xf06e('0x17')]=qs[_0xf06e('0x17')](_0x15261e[_0xf06e('0x29')][_0xf06e('0x17')]);_0x317f99[_0xf06e('0x15')]=qs['offset'](_0x15261e['query'][_0xf06e('0x15')]);}_0x317f99[_0xf06e('0x31')]=qs[_0xf06e('0x32')](_0x15261e[_0xf06e('0x29')][_0xf06e('0x32')]);_0x317f99['where']=qs[_0xf06e('0x2b')](_['pick'](_0x15261e['query'],_0xde0db5[_0xf06e('0x2b')]));_0x317f99[_0xf06e('0x33')][_0xf06e('0x4d')]=_0x199f13['id'];if(_0x15261e[_0xf06e('0x29')][_0xf06e('0x35')]){_0x317f99[_0xf06e('0x33')]=_[_0xf06e('0x36')](_0x317f99[_0xf06e('0x33')],{'$or':_[_0xf06e('0x24')](_0x317f99[_0xf06e('0x2d')],function(_0x172180){var _0x59c248={};_0x59c248[_0x172180]={'$like':'%'+_0x15261e['query'][_0xf06e('0x35')]+'%'};return _0x59c248;})});}_0x317f99=_[_0xf06e('0x36')]({},_0x317f99,_0x15261e['options']);return db[_0xf06e('0x4b')][_0xf06e('0x18')]({'where':_0x317f99['where']})[_0xf06e('0x1a')](function(_0x23430d){_0x17397b[_0xf06e('0x18')]=_0x23430d;if(_0x15261e[_0xf06e('0x29')]['includeAll']){_0x317f99[_0xf06e('0x4e')]=[{'all':!![]}];}return db[_0xf06e('0x4b')][_0xf06e('0x3b')](_0x317f99);})[_0xf06e('0x1a')](function(_0x5a3826){_0x17397b['rows']=_0x5a3826;return _0x17397b;});}})[_0xf06e('0x1a')](respondWithFilteredResult(_0x305117,_0x317f99))['catch'](handleError(_0x305117,null));};exports[_0xf06e('0x4f')]=function(_0x1d9e18,_0x4c531f,_0x20d06a){var _0x2e4d5b={'raw':!![],'where':{}};var _0x3c9fea={};var _0x170c38={'count':0x0,'rows':[]};return db[_0xf06e('0x25')][_0xf06e('0x50')]({'where':{'id':_0x1d9e18[_0xf06e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4c531f,null))['then'](function(_0x2ff8e1){if(_0x2ff8e1){_0x3c9fea[_0xf06e('0x28')]=_[_0xf06e('0x2a')](db[_0xf06e('0x51')]['rawAttributes']);_0x3c9fea['query']=_['keys'](_0x1d9e18[_0xf06e('0x29')]);_0x3c9fea[_0xf06e('0x2b')]=_[_0xf06e('0x2c')](_0x3c9fea['model'],_0x3c9fea['query']);_0x2e4d5b[_0xf06e('0x2d')]=_[_0xf06e('0x2c')](_0x3c9fea[_0xf06e('0x28')],qs[_0xf06e('0x2e')](_0x1d9e18[_0xf06e('0x29')][_0xf06e('0x2e')]));_0x2e4d5b[_0xf06e('0x2d')]=_0x2e4d5b[_0xf06e('0x2d')][_0xf06e('0x2f')]?_0x2e4d5b[_0xf06e('0x2d')]:_0x3c9fea[_0xf06e('0x28')];if(!_0x1d9e18[_0xf06e('0x29')][_0xf06e('0x30')](_0xf06e('0x4c'))){_0x2e4d5b['limit']=qs['limit'](_0x1d9e18[_0xf06e('0x29')][_0xf06e('0x17')]);_0x2e4d5b[_0xf06e('0x15')]=qs[_0xf06e('0x15')](_0x1d9e18[_0xf06e('0x29')]['offset']);}_0x2e4d5b[_0xf06e('0x31')]=qs[_0xf06e('0x32')](_0x1d9e18[_0xf06e('0x29')]['sort']);_0x2e4d5b[_0xf06e('0x33')]=qs[_0xf06e('0x2b')](_['pick'](_0x1d9e18[_0xf06e('0x29')],_0x3c9fea['filters']));_0x2e4d5b[_0xf06e('0x33')][_0xf06e('0x4d')]=_0x2ff8e1['id'];if(_0x1d9e18['query'][_0xf06e('0x35')]){_0x2e4d5b[_0xf06e('0x33')]=_['merge'](_0x2e4d5b[_0xf06e('0x33')],{'$or':_[_0xf06e('0x24')](_0x2e4d5b[_0xf06e('0x2d')],function(_0x49b637){var _0xaac51a={};_0xaac51a[_0x49b637]={'$like':'%'+_0x1d9e18[_0xf06e('0x29')]['filter']+'%'};return _0xaac51a;})});}_0x2e4d5b=_[_0xf06e('0x36')]({},_0x2e4d5b,_0x1d9e18[_0xf06e('0x39')]);return db['JscriptyAnswerReport']['count']({'where':_0x2e4d5b[_0xf06e('0x33')]})[_0xf06e('0x1a')](function(_0x57e4bb){_0x170c38[_0xf06e('0x18')]=_0x57e4bb;if(_0x1d9e18[_0xf06e('0x29')][_0xf06e('0x3a')]){_0x2e4d5b[_0xf06e('0x4e')]=[{'all':!![]}];}return db[_0xf06e('0x51')][_0xf06e('0x3b')](_0x2e4d5b);})[_0xf06e('0x1a')](function(_0x36f046){_0x170c38['rows']=_0x36f046;return _0x170c38;});}})['then'](respondWithFilteredResult(_0x4c531f,_0x2e4d5b))[_0xf06e('0x3c')](handleError(_0x4c531f,null));};function char(_0x58a790){return _0xf06e('0x52')===typeof _0x58a790?String[_0xf06e('0x53')]['apply'](null,arguments):_0x58a790;}function needsEncapsulation(_0x5c00df){return!!_0x5c00df&&(_0x5c00df[_0xf06e('0x54')]()[_0xf06e('0x55')](char(0xd))>=0x0||_0x5c00df['toString']()['indexOf'](char(0xa))>=0x0||_0x5c00df[_0xf06e('0x54')]()[_0xf06e('0x55')](char(0x2c))>=0x0||_0x5c00df['toString']()[_0xf06e('0x55')](char(0x22))>=0x0);}function encapsulate(_0x1c6001){var _0x349250=char(0x22),_0x16b83c='\x5c'+char(0x22),_0x2e133a=_0x1c6001[_0xf06e('0x54')]()[_0xf06e('0x56')](new RegExp(_0x349250,'g'),_0x16b83c);return _0x349250+_0x2e133a+_0x349250;}exports[_0xf06e('0x57')]=function(_0x2f5cf1,_0x1a8926,_0xfabed7){var _0x461c0f,_0x99bd2e;var _0x659c06={'where':{'ProjectId':_0x2f5cf1[_0xf06e('0x3d')]['id']}};if(_0x2f5cf1[_0xf06e('0x29')]['startTime']){_0x659c06[_0xf06e('0x33')][_0xf06e('0x58')]=JSON[_0xf06e('0x59')](_0x2f5cf1[_0xf06e('0x29')][_0xf06e('0x5a')]);}return db[_0xf06e('0x4b')]['findAll'](_0x659c06)[_0xf06e('0x1a')](handleEntityNotFound(_0x1a8926,null))[_0xf06e('0x1a')](function(_0x4c898b){if(_0x4c898b){_0x461c0f=_0x4c898b;return db[_0xf06e('0x5b')][_0xf06e('0x3b')]({'where':{'SessionId':{'$in':_[_0xf06e('0x24')](_0x461c0f,'id')},'ProjectId':_0x2f5cf1[_0xf06e('0x3d')]['id']},'order':_0xf06e('0x5c')});}})[_0xf06e('0x1a')](handleEntityNotFound(_0x1a8926,null))[_0xf06e('0x1a')](function(_0x8e79bc){if(_0x8e79bc){_0x99bd2e=_0x8e79bc;var _0xcea18d={};for(var _0x5dfc46=0x0,_0xb826de=_0x99bd2e[_0xf06e('0x2f')];_0x5dfc46<_0xb826de;_0x5dfc46++){if(!_0xcea18d[_0xf06e('0x30')](_0x99bd2e[_0x5dfc46][_0xf06e('0x5d')])){_0xcea18d[_0x99bd2e[_0x5dfc46][_0xf06e('0x5d')]]=needsEncapsulation(_0x99bd2e[_0x5dfc46][_0xf06e('0x5e')])?encapsulate(_0x99bd2e[_0x5dfc46][_0xf06e('0x5e')]):_0x99bd2e[_0x5dfc46][_0xf06e('0x5e')];}}var _0x47c0b2=[],_0x17fefd={};for(var _0x2aeedc=0x0,_0x1a80f2=_0x461c0f['length'];_0x2aeedc<_0x1a80f2;_0x2aeedc++){_0x17fefd={'ProjectId':_0x2f5cf1[_0xf06e('0x3d')]['id'],'SessionId':_0x461c0f[_0x2aeedc]['id'],'StartTime':moment(_0x461c0f[_0x2aeedc]['starttime'])[_0xf06e('0x5f')](_0xf06e('0x60'))};for(var _0x551edf=0x0,_0x285811=_0x99bd2e['length'];_0x551edf<_0x285811;_0x551edf++){if(_0x99bd2e[_0x551edf]['SessionId']==_0x461c0f[_0x2aeedc]['id']&&_0xcea18d[_0xf06e('0x30')](_0x99bd2e[_0x551edf][_0xf06e('0x5d')])){_0x17fefd[_0xcea18d[_0x99bd2e[_0x551edf][_0xf06e('0x5d')]]]=_0x99bd2e[_0x551edf]['answer'];}}for(var _0x2f43aa in _0xcea18d){if(!_0x17fefd[_0xf06e('0x30')](_0xcea18d[_0x2f43aa])){_0x17fefd[_0xcea18d[_0x2f43aa]]=null;}}_0x47c0b2[_0xf06e('0x61')](_0x17fefd);}return _0x47c0b2;}})[_0xf06e('0x1a')](function(_0x4046ca){if(!_['isEmpty'](_0x4046ca)){var _0x5005d9=toCsv(_0x4046ca);var _0x1537df=Date[_0xf06e('0x62')]();fs['writeFileSync'](util[_0xf06e('0x5f')](_0xf06e('0x63'),_0x2f5cf1[_0xf06e('0x3d')]['id'],_0x1537df),_0x5005d9);_0x1a8926[_0xf06e('0x64')](_0xf06e('0x65'),'attachment;\x20filename='+util[_0xf06e('0x5f')]('Jscripty_Project_%d_Summary_%s.csv',_0x2f5cf1[_0xf06e('0x3d')]['id'],_0x1537df));_0x1a8926[_0xf06e('0x64')]('Content-type',_0xf06e('0x66'));return _0x1a8926[_0xf06e('0x67')](util[_0xf06e('0x5f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2f5cf1[_0xf06e('0x3d')]['id'],_0x1537df));}else{return _0x1a8926[_0xf06e('0x68')](0xcc);}})['catch'](handleError(_0x1a8926,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e363e3c..739b67b 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 _0x7aaf=['./jscriptyProject.attributes','exports','JscriptyProject','lodash','../../config/logger','api','request-promise','rimraf'];(function(_0x5020ed,_0x3bba58){var _0x2a3697=function(_0xf6b7dc){while(--_0xf6b7dc){_0x5020ed['push'](_0x5020ed['shift']());}};_0x2a3697(++_0x3bba58);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0xecc46f,_0x424914){_0xecc46f=_0xecc46f-0x0;var _0x410177=_0x7aaf[_0xecc46f];return _0x410177;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var logger=require(_0xf7aa('0x1'))(_0xf7aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7aa('0x4'));var config=require('../../config/environment');var attributes=require(_0xf7aa('0x5'));module[_0xf7aa('0x6')]=function(_0x1babcd,_0xf02ed5){return _0x1babcd['define'](_0xf7aa('0x7'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x302c=['moment','path','rimraf','../../config/environment','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0x302c,0x15c));var _0xc302=function(_0x687575,_0x479ba0){_0x687575=_0x687575-0x0;var _0x333140=_0x302c[_0x687575];return _0x333140;};'use strict';var _=require(_0xc302('0x0'));var util=require(_0xc302('0x1'));var logger=require(_0xc302('0x2'))(_0xc302('0x3'));var moment=require(_0xc302('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc302('0x5'));var rimraf=require(_0xc302('0x6'));var config=require(_0xc302('0x7'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x13139e,_0x59ba1e){return _0x13139e[_0xc302('0x8')](_0xc302('0x9'),attributes,{'tableName':_0xc302('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 91af2f5..2a1f70e 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 _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xd3a823,_0x4ad32e){_0xd3a823=_0xd3a823-0x0;var _0x54b98a=_0xbdb7[_0xd3a823];return _0x54b98a;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x13eea8,_0x5ed8b2){var _0x255a29=function(_0x2fa27e){while(--_0x2fa27e){_0x13eea8['push'](_0x13eea8['shift']());}};_0x255a29(++_0x5ed8b2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1ef9ba,_0x1012e6){_0x1ef9ba=_0x1ef9ba-0x0;var _0x357a8b=_0xf4eb[_0x1ef9ba];return _0x357a8b;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9b997fa..f28c748 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 _0x4519=['index','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x48b41d,_0x2f433f){var _0x10732e=function(_0x506329){while(--_0x506329){_0x48b41d['push'](_0x48b41d['shift']());}};_0x10732e(++_0x2f433f);}(_0x4519,0xee));var _0x9451=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4519[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x9451('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9451('0x1'));var express=require(_0x9451('0x2'));var router=express['Router']();var fs_extra=require(_0x9451('0x3'));var auth=require(_0x9451('0x4'));var interaction=require(_0x9451('0x5'));var config=require('../../config/environment');var controller=require(_0x9451('0x6'));router[_0x9451('0x7')]('/',auth[_0x9451('0x8')](),controller[_0x9451('0x9')]);router[_0x9451('0x7')](_0x9451('0xa'),auth[_0x9451('0x8')](),controller[_0x9451('0xb')]);router[_0x9451('0x7')](_0x9451('0xc'),auth[_0x9451('0x8')](),controller['show']);router[_0x9451('0xd')]('/',auth[_0x9451('0x8')](),controller[_0x9451('0xe')]);router['put'](_0x9451('0xc'),auth[_0x9451('0x8')](),controller[_0x9451('0xf')]);router[_0x9451('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9451('0x11')]);module[_0x9451('0x12')]=router; \ No newline at end of file +var _0xb33f=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','exports','multer','util','path','express','Router','fs-extra'];(function(_0x2a4c74,_0x236f4c){var _0x2c5b75=function(_0x1432bb){while(--_0x1432bb){_0x2a4c74['push'](_0x2a4c74['shift']());}};_0x2c5b75(++_0x236f4c);}(_0xb33f,0x117));var _0xfb33=function(_0x346a00,_0x341e96){_0x346a00=_0x346a00-0x0;var _0x407015=_0xb33f[_0x346a00];return _0x407015;};'use strict';var multer=require(_0xfb33('0x0'));var util=require(_0xfb33('0x1'));var path=require(_0xfb33('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb33('0x3'));var router=express[_0xfb33('0x4')]();var fs_extra=require(_0xfb33('0x5'));var auth=require(_0xfb33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb33('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xfb33('0x8')]('/',auth[_0xfb33('0x9')](),controller[_0xfb33('0xa')]);router[_0xfb33('0x8')](_0xfb33('0xb'),auth['isAuthenticated'](),controller[_0xfb33('0xc')]);router[_0xfb33('0x8')]('/:id',auth[_0xfb33('0x9')](),controller[_0xfb33('0xd')]);router[_0xfb33('0xe')]('/',auth['isAuthenticated'](),controller[_0xfb33('0xf')]);router['put'](_0xfb33('0x10'),auth[_0xfb33('0x9')](),controller[_0xfb33('0x11')]);router['delete'](_0xfb33('0x10'),auth[_0xfb33('0x9')](),controller['destroy']);module[_0xfb33('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 225a8a1..fa47940 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x4701f4,_0x38f3a1){_0x4701f4=_0x4701f4-0x0;var _0x2aecb7=_0x7a54[_0x4701f4];return _0x2aecb7;};'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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x510b8d,_0x41bf3c){_0x510b8d=_0x510b8d-0x0;var _0x4089f9=_0x7a54[_0x510b8d];return _0x4089f9;};'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 7286691..095ed1b 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 _0xfa82=['undefined','limit','count','Content-Range','apply','reject','update','then','destroy','send','index','map','rawAttributes','fieldName','type','name','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x430095,_0x122722){var _0x115f8a=function(_0x5af765){while(--_0x5af765){_0x430095['push'](_0x430095['shift']());}};_0x115f8a(++_0x122722);}(_0xfa82,0x1e9));var _0x2fa8=function(_0x329b92,_0x2cbadf){_0x329b92=_0x329b92-0x0;var _0x12505a=_0xfa82[_0x329b92];return _0x12505a;};'use strict';var emlformat=require(_0x2fa8('0x0'));var rimraf=require(_0x2fa8('0x1'));var zipdir=require(_0x2fa8('0x2'));var jsonpatch=require(_0x2fa8('0x3'));var rp=require(_0x2fa8('0x4'));var moment=require('moment');var BPromise=require(_0x2fa8('0x5'));var Mustache=require(_0x2fa8('0x6'));var util=require(_0x2fa8('0x7'));var path=require(_0x2fa8('0x8'));var sox=require(_0x2fa8('0x9'));var csv=require(_0x2fa8('0xa'));var ejs=require(_0x2fa8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fa8('0xc'));var squel=require(_0x2fa8('0xd'));var crypto=require(_0x2fa8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2fa8('0xf'));var toCsv=require(_0x2fa8('0xa'));var querystring=require(_0x2fa8('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2fa8('0x11'));var qs=require(_0x2fa8('0x12'));var as=require(_0x2fa8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fa8('0x14'))(_0x2fa8('0x15'));var utils=require(_0x2fa8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2fa8('0x17'))['db'];function respondWithStatusCode(_0x4b5f6a,_0x19446e){_0x19446e=_0x19446e||0xcc;return function(_0x932a66){if(_0x932a66){return _0x4b5f6a[_0x2fa8('0x18')](_0x19446e);}return _0x4b5f6a['status'](_0x19446e)[_0x2fa8('0x19')]();};}function respondWithResult(_0x283114,_0x266d3e){_0x266d3e=_0x266d3e||0xc8;return function(_0x382291){if(_0x382291){return _0x283114[_0x2fa8('0x1a')](_0x266d3e)[_0x2fa8('0x1b')](_0x382291);}};}function respondWithFilteredResult(_0x38d973,_0x5d12ad){return function(_0x43b829){if(_0x43b829){var _0x213033=typeof _0x5d12ad[_0x2fa8('0x1c')]===_0x2fa8('0x1d')&&typeof _0x5d12ad[_0x2fa8('0x1e')]===_0x2fa8('0x1d');var _0x33e20c=_0x43b829[_0x2fa8('0x1f')];var _0x1a50c7=_0x213033?0x0:_0x5d12ad['offset'];var _0x55f724=_0x213033?_0x43b829[_0x2fa8('0x1f')]:_0x5d12ad[_0x2fa8('0x1c')]+_0x5d12ad['limit'];var _0x5d3614;if(_0x55f724>=_0x33e20c){_0x55f724=_0x33e20c;_0x5d3614=0xc8;}else{_0x5d3614=0xce;}_0x38d973['status'](_0x5d3614);return _0x38d973['set'](_0x2fa8('0x20'),_0x1a50c7+'-'+_0x55f724+'/'+_0x33e20c)[_0x2fa8('0x1b')](_0x43b829);}return null;};}function patchUpdates(_0x1949e4){return function(_0x240d68){try{jsonpatch[_0x2fa8('0x21')](_0x240d68,_0x1949e4,!![]);}catch(_0x488ab0){return BPromise[_0x2fa8('0x22')](_0x488ab0);}return _0x240d68['save']();};}function saveUpdates(_0x12b647,_0x1c8bd4){return function(_0x25296e){if(_0x25296e){return _0x25296e[_0x2fa8('0x23')](_0x12b647)[_0x2fa8('0x24')](function(_0x5cb6ef){return _0x5cb6ef;});}return null;};}function removeEntity(_0x3bccc9,_0x13cc4c){return function(_0x49e1bb){if(_0x49e1bb){return _0x49e1bb[_0x2fa8('0x25')]()['then'](function(){_0x3bccc9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e517,_0x230dd9){return function(_0x1b08e0){if(!_0x1b08e0){_0x46e517[_0x2fa8('0x18')](0x194);}return _0x1b08e0;};}function handleError(_0x4167b9,_0x4a490f){_0x4a490f=_0x4a490f||0x1f4;return function(_0x9e089e){logger['error'](_0x9e089e['stack']);if(_0x9e089e['name']){delete _0x9e089e['name'];}_0x4167b9[_0x2fa8('0x1a')](_0x4a490f)[_0x2fa8('0x26')](_0x9e089e);};}exports[_0x2fa8('0x27')]=function(_0x4415a7,_0x31a953){var _0x24534e={},_0xf47aee={},_0x291d62={'count':0x0,'rows':[]};var _0xee2063=_[_0x2fa8('0x28')](db['JscriptyQuestionReport'][_0x2fa8('0x29')],function(_0xf45ce3){return{'name':_0xf45ce3[_0x2fa8('0x2a')],'type':_0xf45ce3[_0x2fa8('0x2b')]['key']};});_0xf47aee['model']=_[_0x2fa8('0x28')](_0xee2063,_0x2fa8('0x2c'));_0xf47aee[_0x2fa8('0x2d')]=_[_0x2fa8('0x2e')](_0x4415a7[_0x2fa8('0x2d')]);_0xf47aee['filters']=_[_0x2fa8('0x2f')](_0xf47aee['model'],_0xf47aee['query']);_0x24534e[_0x2fa8('0x30')]=_[_0x2fa8('0x2f')](_0xf47aee[_0x2fa8('0x31')],qs[_0x2fa8('0x32')](_0x4415a7[_0x2fa8('0x2d')][_0x2fa8('0x32')]));_0x24534e[_0x2fa8('0x30')]=_0x24534e[_0x2fa8('0x30')][_0x2fa8('0x33')]?_0x24534e[_0x2fa8('0x30')]:_0xf47aee[_0x2fa8('0x31')];if(!_0x4415a7[_0x2fa8('0x2d')][_0x2fa8('0x34')](_0x2fa8('0x35'))){_0x24534e[_0x2fa8('0x1e')]=qs[_0x2fa8('0x1e')](_0x4415a7[_0x2fa8('0x2d')]['limit']);_0x24534e[_0x2fa8('0x1c')]=qs['offset'](_0x4415a7['query'][_0x2fa8('0x1c')]);}_0x24534e['order']=qs[_0x2fa8('0x36')](_0x4415a7[_0x2fa8('0x2d')]['sort']);_0x24534e['where']=qs[_0x2fa8('0x37')](_[_0x2fa8('0x38')](_0x4415a7['query'],_0xf47aee[_0x2fa8('0x37')]),_0xee2063);if(_0x4415a7[_0x2fa8('0x2d')][_0x2fa8('0x39')]){_0x24534e[_0x2fa8('0x3a')]=_[_0x2fa8('0x3b')](_0x24534e[_0x2fa8('0x3a')],{'$or':_[_0x2fa8('0x28')](_0xee2063,function(_0x2d5eff){if(_0x2d5eff['type']!==_0x2fa8('0x3c')){var _0x4e2ad3={};_0x4e2ad3[_0x2d5eff[_0x2fa8('0x2c')]]={'$like':'%'+_0x4415a7[_0x2fa8('0x2d')][_0x2fa8('0x39')]+'%'};return _0x4e2ad3;}})});}_0x24534e=_[_0x2fa8('0x3b')]({},_0x24534e,_0x4415a7[_0x2fa8('0x3d')]);var _0x53c9ab={'where':_0x24534e[_0x2fa8('0x3a')]};return db[_0x2fa8('0x3e')][_0x2fa8('0x1f')](_0x53c9ab)[_0x2fa8('0x24')](function(_0x2c7d0b){_0x291d62[_0x2fa8('0x1f')]=_0x2c7d0b;if(_0x4415a7['query'][_0x2fa8('0x3f')]){_0x24534e['include']=[{'all':!![]}];}return db[_0x2fa8('0x3e')][_0x2fa8('0x40')](_0x24534e);})[_0x2fa8('0x24')](function(_0x5e9c02){_0x291d62[_0x2fa8('0x41')]=_0x5e9c02;return _0x291d62;})[_0x2fa8('0x24')](respondWithFilteredResult(_0x31a953,_0x24534e))[_0x2fa8('0x42')](handleError(_0x31a953,null));};exports[_0x2fa8('0x43')]=function(_0xf5f0b5,_0xd69669){var _0x3dec0e={'raw':!![],'where':{'id':_0xf5f0b5[_0x2fa8('0x44')]['id']}},_0x4cbea3={};_0x4cbea3[_0x2fa8('0x31')]=_[_0x2fa8('0x2e')](db[_0x2fa8('0x3e')][_0x2fa8('0x29')]);_0x4cbea3[_0x2fa8('0x2d')]=_['keys'](_0xf5f0b5[_0x2fa8('0x2d')]);_0x4cbea3[_0x2fa8('0x37')]=_[_0x2fa8('0x2f')](_0x4cbea3[_0x2fa8('0x31')],_0x4cbea3[_0x2fa8('0x2d')]);_0x3dec0e['attributes']=_[_0x2fa8('0x2f')](_0x4cbea3['model'],qs['fields'](_0xf5f0b5['query'][_0x2fa8('0x32')]));_0x3dec0e['attributes']=_0x3dec0e['attributes'][_0x2fa8('0x33')]?_0x3dec0e[_0x2fa8('0x30')]:_0x4cbea3['model'];if(_0xf5f0b5[_0x2fa8('0x2d')][_0x2fa8('0x3f')]){_0x3dec0e[_0x2fa8('0x45')]=[{'all':!![]}];}_0x3dec0e=_[_0x2fa8('0x3b')]({},_0x3dec0e,_0xf5f0b5[_0x2fa8('0x3d')]);return db[_0x2fa8('0x3e')][_0x2fa8('0x46')](_0x3dec0e)[_0x2fa8('0x24')](handleEntityNotFound(_0xd69669,null))['then'](respondWithResult(_0xd69669,null))[_0x2fa8('0x42')](handleError(_0xd69669,null));};exports[_0x2fa8('0x47')]=function(_0x3e6bce,_0x3ebf7a){return db[_0x2fa8('0x3e')][_0x2fa8('0x47')](_0x3e6bce[_0x2fa8('0x48')],{})[_0x2fa8('0x24')](respondWithResult(_0x3ebf7a,0xc9))[_0x2fa8('0x42')](handleError(_0x3ebf7a,null));};exports[_0x2fa8('0x23')]=function(_0xccde1e,_0x5ea2c7){if(_0xccde1e[_0x2fa8('0x48')]['id']){delete _0xccde1e[_0x2fa8('0x48')]['id'];}return db[_0x2fa8('0x3e')]['find']({'where':{'id':_0xccde1e[_0x2fa8('0x44')]['id']}})[_0x2fa8('0x24')](handleEntityNotFound(_0x5ea2c7,null))['then'](saveUpdates(_0xccde1e[_0x2fa8('0x48')],null))[_0x2fa8('0x24')](respondWithResult(_0x5ea2c7,null))[_0x2fa8('0x42')](handleError(_0x5ea2c7,null));};exports[_0x2fa8('0x25')]=function(_0x48f014,_0x2a755b){return db[_0x2fa8('0x3e')][_0x2fa8('0x46')]({'where':{'id':_0x48f014['params']['id']}})['then'](handleEntityNotFound(_0x2a755b,null))[_0x2fa8('0x24')](removeEntity(_0x2a755b,null))[_0x2fa8('0x42')](handleError(_0x2a755b,null));};exports[_0x2fa8('0x49')]=function(_0x32ff8c,_0x27448f){return db[_0x2fa8('0x3e')][_0x2fa8('0x49')]()[_0x2fa8('0x24')](respondWithResult(_0x27448f,null))[_0x2fa8('0x42')](handleError(_0x27448f,null));}; \ No newline at end of file +var _0xe0c4=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','JscriptyQuestionReport','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3470e0,_0x189c04){var _0x3fa235=function(_0x2973e4){while(--_0x2973e4){_0x3470e0['push'](_0x3470e0['shift']());}};_0x3fa235(++_0x189c04);}(_0xe0c4,0x17e));var _0x4e0c=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0xe0c4[_0x680821];return _0x3f132c;};'use strict';var emlformat=require(_0x4e0c('0x0'));var rimraf=require(_0x4e0c('0x1'));var zipdir=require(_0x4e0c('0x2'));var jsonpatch=require(_0x4e0c('0x3'));var rp=require(_0x4e0c('0x4'));var moment=require(_0x4e0c('0x5'));var BPromise=require(_0x4e0c('0x6'));var Mustache=require(_0x4e0c('0x7'));var util=require(_0x4e0c('0x8'));var path=require(_0x4e0c('0x9'));var sox=require(_0x4e0c('0xa'));var csv=require(_0x4e0c('0xb'));var ejs=require(_0x4e0c('0xc'));var fs=require('fs');var fs_extra=require(_0x4e0c('0xd'));var _=require(_0x4e0c('0xe'));var squel=require(_0x4e0c('0xf'));var crypto=require(_0x4e0c('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x4e0c('0x11'));var toCsv=require(_0x4e0c('0xb'));var querystring=require(_0x4e0c('0x12'));var Papa=require(_0x4e0c('0x13'));var Redis=require(_0x4e0c('0x14'));var authService=require(_0x4e0c('0x15'));var qs=require(_0x4e0c('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e0c('0x17'));var logger=require(_0x4e0c('0x18'))(_0x4e0c('0x19'));var utils=require(_0x4e0c('0x1a'));var config=require(_0x4e0c('0x1b'));var licenseUtil=require(_0x4e0c('0x1c'));var db=require(_0x4e0c('0x1d'))['db'];function respondWithStatusCode(_0x5a5d0d,_0x37e0eb){_0x37e0eb=_0x37e0eb||0xcc;return function(_0x183318){if(_0x183318){return _0x5a5d0d[_0x4e0c('0x1e')](_0x37e0eb);}return _0x5a5d0d[_0x4e0c('0x1f')](_0x37e0eb)[_0x4e0c('0x20')]();};}function respondWithResult(_0x2168b2,_0x5225ac){_0x5225ac=_0x5225ac||0xc8;return function(_0x1ab716){if(_0x1ab716){return _0x2168b2[_0x4e0c('0x1f')](_0x5225ac)[_0x4e0c('0x21')](_0x1ab716);}};}function respondWithFilteredResult(_0x2f46be,_0x19bbbb){return function(_0x1ffb96){if(_0x1ffb96){var _0x522f55=typeof _0x19bbbb[_0x4e0c('0x22')]===_0x4e0c('0x23')&&typeof _0x19bbbb[_0x4e0c('0x24')]===_0x4e0c('0x23');var _0x3d4fa7=_0x1ffb96[_0x4e0c('0x25')];var _0x21ff75=_0x522f55?0x0:_0x19bbbb[_0x4e0c('0x22')];var _0x437a11=_0x522f55?_0x1ffb96[_0x4e0c('0x25')]:_0x19bbbb['offset']+_0x19bbbb[_0x4e0c('0x24')];var _0x22ad70;if(_0x437a11>=_0x3d4fa7){_0x437a11=_0x3d4fa7;_0x22ad70=0xc8;}else{_0x22ad70=0xce;}_0x2f46be['status'](_0x22ad70);return _0x2f46be['set'](_0x4e0c('0x26'),_0x21ff75+'-'+_0x437a11+'/'+_0x3d4fa7)[_0x4e0c('0x21')](_0x1ffb96);}return null;};}function patchUpdates(_0x5e8abb){return function(_0x121c16){try{jsonpatch[_0x4e0c('0x27')](_0x121c16,_0x5e8abb,!![]);}catch(_0x3aad83){return BPromise[_0x4e0c('0x28')](_0x3aad83);}return _0x121c16[_0x4e0c('0x29')]();};}function saveUpdates(_0x53f455,_0x4cf70d){return function(_0x82f72b){if(_0x82f72b){return _0x82f72b[_0x4e0c('0x2a')](_0x53f455)[_0x4e0c('0x2b')](function(_0x133a8f){return _0x133a8f;});}return null;};}function removeEntity(_0x3a751c,_0x15ebcd){return function(_0x456eaf){if(_0x456eaf){return _0x456eaf[_0x4e0c('0x2c')]()[_0x4e0c('0x2b')](function(){_0x3a751c['status'](0xcc)[_0x4e0c('0x20')]();});}};}function handleEntityNotFound(_0x40a78b,_0x23b525){return function(_0x432644){if(!_0x432644){_0x40a78b[_0x4e0c('0x1e')](0x194);}return _0x432644;};}function handleError(_0x147199,_0x64f8ec){_0x64f8ec=_0x64f8ec||0x1f4;return function(_0x110adc){logger['error'](_0x110adc[_0x4e0c('0x2d')]);if(_0x110adc[_0x4e0c('0x2e')]){delete _0x110adc[_0x4e0c('0x2e')];}_0x147199['status'](_0x64f8ec)[_0x4e0c('0x2f')](_0x110adc);};}exports[_0x4e0c('0x30')]=function(_0x286a42,_0x94dc17){var _0x3296f6={},_0x51c005={},_0x59150a={'count':0x0,'rows':[]};var _0x38ff96=_[_0x4e0c('0x31')](db['JscriptyQuestionReport'][_0x4e0c('0x32')],function(_0x4e30b7){return{'name':_0x4e30b7[_0x4e0c('0x33')],'type':_0x4e30b7[_0x4e0c('0x34')][_0x4e0c('0x35')]};});_0x51c005[_0x4e0c('0x36')]=_[_0x4e0c('0x31')](_0x38ff96,_0x4e0c('0x2e'));_0x51c005[_0x4e0c('0x37')]=_[_0x4e0c('0x38')](_0x286a42[_0x4e0c('0x37')]);_0x51c005[_0x4e0c('0x39')]=_[_0x4e0c('0x3a')](_0x51c005['model'],_0x51c005[_0x4e0c('0x37')]);_0x3296f6['attributes']=_[_0x4e0c('0x3a')](_0x51c005[_0x4e0c('0x36')],qs[_0x4e0c('0x3b')](_0x286a42[_0x4e0c('0x37')][_0x4e0c('0x3b')]));_0x3296f6[_0x4e0c('0x3c')]=_0x3296f6[_0x4e0c('0x3c')][_0x4e0c('0x3d')]?_0x3296f6[_0x4e0c('0x3c')]:_0x51c005[_0x4e0c('0x36')];if(!_0x286a42['query'][_0x4e0c('0x3e')](_0x4e0c('0x3f'))){_0x3296f6[_0x4e0c('0x24')]=qs[_0x4e0c('0x24')](_0x286a42['query'][_0x4e0c('0x24')]);_0x3296f6[_0x4e0c('0x22')]=qs[_0x4e0c('0x22')](_0x286a42['query'][_0x4e0c('0x22')]);}_0x3296f6[_0x4e0c('0x40')]=qs['sort'](_0x286a42[_0x4e0c('0x37')][_0x4e0c('0x41')]);_0x3296f6[_0x4e0c('0x42')]=qs[_0x4e0c('0x39')](_[_0x4e0c('0x43')](_0x286a42[_0x4e0c('0x37')],_0x51c005[_0x4e0c('0x39')]),_0x38ff96);if(_0x286a42[_0x4e0c('0x37')][_0x4e0c('0x44')]){_0x3296f6[_0x4e0c('0x42')]=_['merge'](_0x3296f6[_0x4e0c('0x42')],{'$or':_['map'](_0x38ff96,function(_0x37bd1e){if(_0x37bd1e[_0x4e0c('0x34')]!==_0x4e0c('0x45')){var _0x1e20be={};_0x1e20be[_0x37bd1e[_0x4e0c('0x2e')]]={'$like':'%'+_0x286a42[_0x4e0c('0x37')][_0x4e0c('0x44')]+'%'};return _0x1e20be;}})});}_0x3296f6=_[_0x4e0c('0x46')]({},_0x3296f6,_0x286a42['options']);var _0x4276f3={'where':_0x3296f6['where']};return db[_0x4e0c('0x47')][_0x4e0c('0x25')](_0x4276f3)[_0x4e0c('0x2b')](function(_0x231c02){_0x59150a[_0x4e0c('0x25')]=_0x231c02;if(_0x286a42[_0x4e0c('0x37')][_0x4e0c('0x48')]){_0x3296f6[_0x4e0c('0x49')]=[{'all':!![]}];}return db[_0x4e0c('0x47')][_0x4e0c('0x4a')](_0x3296f6);})['then'](function(_0x424c0f){_0x59150a[_0x4e0c('0x4b')]=_0x424c0f;return _0x59150a;})[_0x4e0c('0x2b')](respondWithFilteredResult(_0x94dc17,_0x3296f6))['catch'](handleError(_0x94dc17,null));};exports[_0x4e0c('0x4c')]=function(_0x127e59,_0x2f68ac){var _0x1cf422={'raw':!![],'where':{'id':_0x127e59[_0x4e0c('0x4d')]['id']}},_0x65f20e={};_0x65f20e[_0x4e0c('0x36')]=_['keys'](db[_0x4e0c('0x47')][_0x4e0c('0x32')]);_0x65f20e['query']=_[_0x4e0c('0x38')](_0x127e59[_0x4e0c('0x37')]);_0x65f20e[_0x4e0c('0x39')]=_[_0x4e0c('0x3a')](_0x65f20e[_0x4e0c('0x36')],_0x65f20e[_0x4e0c('0x37')]);_0x1cf422[_0x4e0c('0x3c')]=_[_0x4e0c('0x3a')](_0x65f20e[_0x4e0c('0x36')],qs[_0x4e0c('0x3b')](_0x127e59[_0x4e0c('0x37')][_0x4e0c('0x3b')]));_0x1cf422[_0x4e0c('0x3c')]=_0x1cf422['attributes'][_0x4e0c('0x3d')]?_0x1cf422[_0x4e0c('0x3c')]:_0x65f20e['model'];if(_0x127e59[_0x4e0c('0x37')][_0x4e0c('0x48')]){_0x1cf422[_0x4e0c('0x49')]=[{'all':!![]}];}_0x1cf422=_[_0x4e0c('0x46')]({},_0x1cf422,_0x127e59[_0x4e0c('0x4e')]);return db[_0x4e0c('0x47')][_0x4e0c('0x4f')](_0x1cf422)[_0x4e0c('0x2b')](handleEntityNotFound(_0x2f68ac,null))['then'](respondWithResult(_0x2f68ac,null))[_0x4e0c('0x50')](handleError(_0x2f68ac,null));};exports[_0x4e0c('0x51')]=function(_0x1ccc78,_0x2567a2){return db[_0x4e0c('0x47')][_0x4e0c('0x51')](_0x1ccc78[_0x4e0c('0x52')],{})[_0x4e0c('0x2b')](respondWithResult(_0x2567a2,0xc9))['catch'](handleError(_0x2567a2,null));};exports[_0x4e0c('0x2a')]=function(_0x2abe0d,_0x22766b){if(_0x2abe0d[_0x4e0c('0x52')]['id']){delete _0x2abe0d[_0x4e0c('0x52')]['id'];}return db['JscriptyQuestionReport'][_0x4e0c('0x4f')]({'where':{'id':_0x2abe0d[_0x4e0c('0x4d')]['id']}})[_0x4e0c('0x2b')](handleEntityNotFound(_0x22766b,null))[_0x4e0c('0x2b')](saveUpdates(_0x2abe0d['body'],null))[_0x4e0c('0x2b')](respondWithResult(_0x22766b,null))[_0x4e0c('0x50')](handleError(_0x22766b,null));};exports[_0x4e0c('0x2c')]=function(_0x313bd1,_0x5ec3cc){return db[_0x4e0c('0x47')][_0x4e0c('0x4f')]({'where':{'id':_0x313bd1[_0x4e0c('0x4d')]['id']}})[_0x4e0c('0x2b')](handleEntityNotFound(_0x5ec3cc,null))[_0x4e0c('0x2b')](removeEntity(_0x5ec3cc,null))[_0x4e0c('0x50')](handleError(_0x5ec3cc,null));};exports['describe']=function(_0x247e29,_0x430126){return db[_0x4e0c('0x47')]['describe']()['then'](respondWithResult(_0x430126,null))[_0x4e0c('0x50')](handleError(_0x430126,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f9ff990..08978dd 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 _0xc706=['report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x35e8ca,_0x5776f8){var _0x71383e=function(_0x2d1ad0){while(--_0x2d1ad0){_0x35e8ca['push'](_0x35e8ca['shift']());}};_0x71383e(++_0x5776f8);}(_0xc706,0x146));var _0x6c70=function(_0x4bb76e,_0x1188e1){_0x4bb76e=_0x4bb76e-0x0;var _0x2da1e5=_0xc706[_0x4bb76e];return _0x2da1e5;};'use strict';var _=require(_0x6c70('0x0'));var util=require(_0x6c70('0x1'));var logger=require(_0x6c70('0x2'))(_0x6c70('0x3'));var moment=require('moment');var BPromise=require(_0x6c70('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c70('0x5'));var rimraf=require(_0x6c70('0x6'));var config=require(_0x6c70('0x7'));var attributes=require(_0x6c70('0x8'));module[_0x6c70('0x9')]=function(_0x26f3bd,_0x30c57b){return _0x26f3bd[_0x6c70('0xa')](_0x6c70('0xb'),attributes,{'tableName':_0x6c70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e6b=['bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','util','../../config/logger','moment'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x7e6b,0x177));var _0xb7e6=function(_0x1b1a27,_0x424cdd){_0x1b1a27=_0x1b1a27-0x0;var _0x5c14ee=_0x7e6b[_0x1b1a27];return _0x5c14ee;};'use strict';var _=require('lodash');var util=require(_0xb7e6('0x0'));var logger=require(_0xb7e6('0x1'))('api');var moment=require(_0xb7e6('0x2'));var BPromise=require(_0xb7e6('0x3'));var rp=require(_0xb7e6('0x4'));var fs=require('fs');var path=require(_0xb7e6('0x5'));var rimraf=require(_0xb7e6('0x6'));var config=require('../../config/environment');var attributes=require(_0xb7e6('0x7'));module[_0xb7e6('0x8')]=function(_0x15bde9,_0x5cac57){return _0x15bde9['define']('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 88fb0bb..8e47eae 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 _0x021b=['then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x021b,0xd3));var _0xb021=function(_0x242dd7,_0x3d81d9){_0x242dd7=_0x242dd7-0x0;var _0x30ae03=_0x021b[_0x242dd7];return _0x30ae03;};'use strict';var _=require(_0xb021('0x0'));var util=require(_0xb021('0x1'));var moment=require(_0xb021('0x2'));var BPromise=require(_0xb021('0x3'));var rs=require(_0xb021('0x4'));var fs=require('fs');var Redis=require(_0xb021('0x5'));var db=require(_0xb021('0x6'))['db'];var utils=require(_0xb021('0x7'));var logger=require(_0xb021('0x8'))(_0xb021('0x9'));var config=require('../../config/environment');var jayson=require(_0xb021('0xa'));var client=jayson[_0xb021('0xb')][_0xb021('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3fcb7c,_0x2e68a7,_0x49f591){return new BPromise(function(_0x43c2fe,_0x489ad0){return client[_0xb021('0xd')](_0x3fcb7c,_0x49f591)[_0xb021('0xe')](function(_0xfb5e12){logger['info'](_0xb021('0xf'),_0x2e68a7,_0xb021('0x10'));logger[_0xb021('0x11')](_0xb021('0x12'),_0x2e68a7,'request\x20sent',JSON['stringify'](_0xfb5e12));if(_0xfb5e12[_0xb021('0x13')]){if(_0xfb5e12[_0xb021('0x13')][_0xb021('0x14')]===0x1f4){logger[_0xb021('0x13')](_0xb021('0xf'),_0x2e68a7,_0xfb5e12['error'][_0xb021('0x15')]);return _0x489ad0(_0xfb5e12['error'][_0xb021('0x15')]);}logger[_0xb021('0x13')](_0xb021('0xf'),_0x2e68a7,_0xfb5e12[_0xb021('0x13')][_0xb021('0x15')]);return _0x43c2fe(_0xfb5e12['error']['message']);}else{logger[_0xb021('0x16')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2e68a7,'request\x20sent');_0x43c2fe(_0xfb5e12[_0xb021('0x17')][_0xb021('0x15')]);}})[_0xb021('0x18')](function(_0x527f16){logger[_0xb021('0x13')](_0xb021('0xf'),_0x2e68a7,_0x527f16);_0x489ad0(_0x527f16);});});} \ No newline at end of file +var _0x8ab8=['../../config/utils','../../config/logger','../../config/environment','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5a9461,_0x30e8dc){var _0x39a3be=function(_0x5b05ee){while(--_0x5b05ee){_0x5a9461['push'](_0x5a9461['shift']());}};_0x39a3be(++_0x30e8dc);}(_0x8ab8,0x19f));var _0x88ab=function(_0x12f56d,_0x1c70e7){_0x12f56d=_0x12f56d-0x0;var _0xbe8144=_0x8ab8[_0x12f56d];return _0xbe8144;};'use strict';var _=require(_0x88ab('0x0'));var util=require('util');var moment=require(_0x88ab('0x1'));var BPromise=require(_0x88ab('0x2'));var rs=require(_0x88ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88ab('0x4'))['db'];var utils=require(_0x88ab('0x5'));var logger=require(_0x88ab('0x6'))('rpc');var config=require(_0x88ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x88ab('0x8')][_0x88ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be207,_0x4dfdd4,_0x3f7724){return new BPromise(function(_0x5c5ee2,_0x5bc4f5){return client['request'](_0x3be207,_0x3f7724)[_0x88ab('0xa')](function(_0x3536bf){logger[_0x88ab('0xb')](_0x88ab('0xc'),_0x4dfdd4,_0x88ab('0xd'));logger[_0x88ab('0xe')](_0x88ab('0xf'),_0x4dfdd4,_0x88ab('0xd'),JSON['stringify'](_0x3536bf));if(_0x3536bf['error']){if(_0x3536bf[_0x88ab('0x10')][_0x88ab('0x11')]===0x1f4){logger[_0x88ab('0x10')](_0x88ab('0xc'),_0x4dfdd4,_0x3536bf[_0x88ab('0x10')][_0x88ab('0x12')]);return _0x5bc4f5(_0x3536bf['error'][_0x88ab('0x12')]);}logger[_0x88ab('0x10')](_0x88ab('0xc'),_0x4dfdd4,_0x3536bf['error'][_0x88ab('0x12')]);return _0x5c5ee2(_0x3536bf['error'][_0x88ab('0x12')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4dfdd4,_0x88ab('0xd'));_0x5c5ee2(_0x3536bf[_0x88ab('0x13')][_0x88ab('0x12')]);}})[_0x88ab('0x14')](function(_0x493dac){logger['error'](_0x88ab('0xc'),_0x4dfdd4,_0x493dac);_0x5bc4f5(_0x493dac);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 4e808d9..21a01a2 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 _0x3eed=['/:id','show','/:id/questions','getQuestions','post','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x40cddc,_0xb2956f){var _0x177124=function(_0x1d2b33){while(--_0x1d2b33){_0x40cddc['push'](_0x40cddc['shift']());}};_0x177124(++_0xb2956f);}(_0x3eed,0xec));var _0xd3ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3eed[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3ee('0x0'));var timeout=require('connect-timeout');var express=require(_0xd3ee('0x1'));var router=express[_0xd3ee('0x2')]();var fs_extra=require(_0xd3ee('0x3'));var auth=require(_0xd3ee('0x4'));var interaction=require(_0xd3ee('0x5'));var config=require(_0xd3ee('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0xd3ee('0x7')]('/',auth[_0xd3ee('0x8')](),controller['index']);router[_0xd3ee('0x7')](_0xd3ee('0x9'),auth['isAuthenticated'](),controller[_0xd3ee('0xa')]);router[_0xd3ee('0x7')](_0xd3ee('0xb'),auth[_0xd3ee('0x8')](),controller[_0xd3ee('0xc')]);router['get'](_0xd3ee('0xd'),auth[_0xd3ee('0x8')](),controller[_0xd3ee('0xe')]);router[_0xd3ee('0xf')]('/',auth[_0xd3ee('0x8')](),controller['create']);router['put'](_0xd3ee('0xb'),auth[_0xd3ee('0x8')](),controller[_0xd3ee('0x10')]);router[_0xd3ee('0x11')](_0xd3ee('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd3ee('0x12')]=router; \ No newline at end of file +var _0xa722=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports','multer','util'];(function(_0x4bbe25,_0xf8cde8){var _0x1ab443=function(_0x3305aa){while(--_0x3305aa){_0x4bbe25['push'](_0x4bbe25['shift']());}};_0x1ab443(++_0xf8cde8);}(_0xa722,0x94));var _0x2a72=function(_0x11de10,_0x3f7597){_0x11de10=_0x11de10-0x0;var _0x492991=_0xa722[_0x11de10];return _0x492991;};'use strict';var multer=require(_0x2a72('0x0'));var util=require(_0x2a72('0x1'));var path=require(_0x2a72('0x2'));var timeout=require(_0x2a72('0x3'));var express=require(_0x2a72('0x4'));var router=express[_0x2a72('0x5')]();var fs_extra=require(_0x2a72('0x6'));var auth=require(_0x2a72('0x7'));var interaction=require(_0x2a72('0x8'));var config=require(_0x2a72('0x9'));var controller=require(_0x2a72('0xa'));router[_0x2a72('0xb')]('/',auth[_0x2a72('0xc')](),controller[_0x2a72('0xd')]);router['get'](_0x2a72('0xe'),auth[_0x2a72('0xc')](),controller['describe']);router[_0x2a72('0xb')](_0x2a72('0xf'),auth[_0x2a72('0xc')](),controller[_0x2a72('0x10')]);router['get'](_0x2a72('0x11'),auth[_0x2a72('0xc')](),controller[_0x2a72('0x12')]);router[_0x2a72('0x13')]('/',auth[_0x2a72('0xc')](),controller[_0x2a72('0x14')]);router[_0x2a72('0x15')](_0x2a72('0xf'),auth[_0x2a72('0xc')](),controller[_0x2a72('0x16')]);router['delete'](_0x2a72('0xf'),auth[_0x2a72('0xc')](),controller[_0x2a72('0x17')]);module[_0x2a72('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 0db6a3e..e6fdda5 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 _0xfcae=['DATE','starttime','setDataValue','endtime','format','STRING','moment','sequelize','exports'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xfcae,0x141));var _0xefca=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xfcae[_0x47aa64];return _0x549c7a;};'use strict';var moment=require(_0xefca('0x0'));var Sequelize=require(_0xefca('0x1'));module[_0xefca('0x2')]={'starttime':{'type':Sequelize[_0xefca('0x3')],'set':function(_0xeb4d1c){this['setDataValue'](_0xefca('0x4'),_0xeb4d1c);this[_0xefca('0x5')](_0xefca('0x6'),moment()[_0xefca('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xefca('0x3')]},'membername':{'type':Sequelize[_0xefca('0x8')]},'projectname':{'type':Sequelize[_0xefca('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xefca('0x8')]},'calleridname':{'type':Sequelize[_0xefca('0x8')]},'calleridnum':{'type':Sequelize[_0xefca('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5eb6=['setDataValue','starttime','DATE','STRING','sequelize'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x5eb6,0x1a3));var _0x65eb=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5eb6[_0x199572];return _0x13cfa3;};'use strict';var moment=require('moment');var Sequelize=require(_0x65eb('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x10cd31){this[_0x65eb('0x1')](_0x65eb('0x2'),_0x10cd31);this[_0x65eb('0x1')]('endtime',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x65eb('0x3')]},'membername':{'type':Sequelize[_0x65eb('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x65eb('0x4')]},'uniqueid':{'type':Sequelize[_0x65eb('0x4')]},'calleridname':{'type':Sequelize[_0x65eb('0x4')]},'calleridnum':{'type':Sequelize[_0x65eb('0x4')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d90e781..a0c0f60 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 _0x9c9a=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9c9a,0x130));var _0xa9c9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9c9a[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xa9c9('0x0'));var rimraf=require(_0xa9c9('0x1'));var zipdir=require(_0xa9c9('0x2'));var jsonpatch=require(_0xa9c9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa9c9('0x4'));var Mustache=require(_0xa9c9('0x5'));var util=require(_0xa9c9('0x6'));var path=require('path');var sox=require(_0xa9c9('0x7'));var csv=require(_0xa9c9('0x8'));var ejs=require(_0xa9c9('0x9'));var fs=require('fs');var fs_extra=require(_0xa9c9('0xa'));var _=require(_0xa9c9('0xb'));var squel=require('squel');var crypto=require(_0xa9c9('0xc'));var jsforce=require(_0xa9c9('0xd'));var deskjs=require(_0xa9c9('0xe'));var toCsv=require(_0xa9c9('0x8'));var querystring=require(_0xa9c9('0xf'));var Papa=require(_0xa9c9('0x10'));var Redis=require(_0xa9c9('0x11'));var authService=require(_0xa9c9('0x12'));var qs=require(_0xa9c9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa9c9('0x14'));var logger=require(_0xa9c9('0x15'))(_0xa9c9('0x16'));var utils=require(_0xa9c9('0x17'));var config=require(_0xa9c9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa9c9('0x19'))['db'];function respondWithStatusCode(_0x6289e7,_0x389b60){_0x389b60=_0x389b60||0xcc;return function(_0x3da9e7){if(_0x3da9e7){return _0x6289e7[_0xa9c9('0x1a')](_0x389b60);}return _0x6289e7[_0xa9c9('0x1b')](_0x389b60)[_0xa9c9('0x1c')]();};}function respondWithResult(_0x3e50a8,_0x1567e3){_0x1567e3=_0x1567e3||0xc8;return function(_0x135c93){if(_0x135c93){return _0x3e50a8[_0xa9c9('0x1b')](_0x1567e3)['json'](_0x135c93);}};}function respondWithFilteredResult(_0x1191e5,_0x24126b){return function(_0xdbd4eb){if(_0xdbd4eb){var _0x56f988=typeof _0x24126b[_0xa9c9('0x1d')]==='undefined'&&typeof _0x24126b['limit']===_0xa9c9('0x1e');var _0x14e616=_0xdbd4eb[_0xa9c9('0x1f')];var _0x3289cb=_0x56f988?0x0:_0x24126b['offset'];var _0x566553=_0x56f988?_0xdbd4eb[_0xa9c9('0x1f')]:_0x24126b[_0xa9c9('0x1d')]+_0x24126b[_0xa9c9('0x20')];var _0x73ee15;if(_0x566553>=_0x14e616){_0x566553=_0x14e616;_0x73ee15=0xc8;}else{_0x73ee15=0xce;}_0x1191e5['status'](_0x73ee15);return _0x1191e5[_0xa9c9('0x21')](_0xa9c9('0x22'),_0x3289cb+'-'+_0x566553+'/'+_0x14e616)['json'](_0xdbd4eb);}return null;};}function patchUpdates(_0x122666){return function(_0x3de395){try{jsonpatch['apply'](_0x3de395,_0x122666,!![]);}catch(_0x2351ec){return BPromise['reject'](_0x2351ec);}return _0x3de395[_0xa9c9('0x23')]();};}function saveUpdates(_0x4aa0b8,_0x5dcb40){return function(_0x75d153){if(_0x75d153){return _0x75d153['update'](_0x4aa0b8)[_0xa9c9('0x24')](function(_0x48ecf5){return _0x48ecf5;});}return null;};}function removeEntity(_0x27ee7a,_0x40516c){return function(_0x28cefa){if(_0x28cefa){return _0x28cefa[_0xa9c9('0x25')]()[_0xa9c9('0x24')](function(){_0x27ee7a[_0xa9c9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e50d6,_0x259c76){return function(_0x30c5e7){if(!_0x30c5e7){_0x5e50d6['sendStatus'](0x194);}return _0x30c5e7;};}function handleError(_0x29ed1b,_0x413d25){_0x413d25=_0x413d25||0x1f4;return function(_0x2d25b5){logger[_0xa9c9('0x26')](_0x2d25b5[_0xa9c9('0x27')]);if(_0x2d25b5[_0xa9c9('0x28')]){delete _0x2d25b5[_0xa9c9('0x28')];}_0x29ed1b[_0xa9c9('0x1b')](_0x413d25)[_0xa9c9('0x29')](_0x2d25b5);};}exports[_0xa9c9('0x2a')]=function(_0x15e209,_0x551a16){var _0x110616={},_0x43225d={},_0x1b7e38={'count':0x0,'rows':[]};var _0x39ab2f=_[_0xa9c9('0x2b')](db[_0xa9c9('0x2c')][_0xa9c9('0x2d')],function(_0x1db162){return{'name':_0x1db162[_0xa9c9('0x2e')],'type':_0x1db162['type']['key']};});_0x43225d[_0xa9c9('0x2f')]=_[_0xa9c9('0x2b')](_0x39ab2f,_0xa9c9('0x28'));_0x43225d[_0xa9c9('0x30')]=_['keys'](_0x15e209['query']);_0x43225d['filters']=_[_0xa9c9('0x31')](_0x43225d['model'],_0x43225d['query']);_0x110616['attributes']=_[_0xa9c9('0x31')](_0x43225d[_0xa9c9('0x2f')],qs[_0xa9c9('0x32')](_0x15e209[_0xa9c9('0x30')]['fields']));_0x110616[_0xa9c9('0x33')]=_0x110616[_0xa9c9('0x33')][_0xa9c9('0x34')]?_0x110616[_0xa9c9('0x33')]:_0x43225d[_0xa9c9('0x2f')];if(!_0x15e209[_0xa9c9('0x30')]['hasOwnProperty']('nolimit')){_0x110616['limit']=qs[_0xa9c9('0x20')](_0x15e209[_0xa9c9('0x30')][_0xa9c9('0x20')]);_0x110616[_0xa9c9('0x1d')]=qs['offset'](_0x15e209[_0xa9c9('0x30')]['offset']);}_0x110616[_0xa9c9('0x35')]=qs[_0xa9c9('0x36')](_0x15e209['query']['sort']);_0x110616[_0xa9c9('0x37')]=qs[_0xa9c9('0x38')](_[_0xa9c9('0x39')](_0x15e209[_0xa9c9('0x30')],_0x43225d['filters']),_0x39ab2f);if(_0x15e209[_0xa9c9('0x30')][_0xa9c9('0x3a')]){_0x110616[_0xa9c9('0x37')]=_[_0xa9c9('0x3b')](_0x110616[_0xa9c9('0x37')],{'$or':_['map'](_0x39ab2f,function(_0x5d952a){if(_0x5d952a[_0xa9c9('0x3c')]!==_0xa9c9('0x3d')){var _0x13aab3={};_0x13aab3[_0x5d952a[_0xa9c9('0x28')]]={'$like':'%'+_0x15e209[_0xa9c9('0x30')]['filter']+'%'};return _0x13aab3;}})});}_0x110616=_[_0xa9c9('0x3b')]({},_0x110616,_0x15e209[_0xa9c9('0x3e')]);var _0x5b7e8={'where':_0x110616[_0xa9c9('0x37')]};return db[_0xa9c9('0x2c')][_0xa9c9('0x1f')](_0x5b7e8)[_0xa9c9('0x24')](function(_0x652278){_0x1b7e38[_0xa9c9('0x1f')]=_0x652278;if(_0x15e209[_0xa9c9('0x30')][_0xa9c9('0x3f')]){_0x110616[_0xa9c9('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xa9c9('0x41')](_0x110616);})[_0xa9c9('0x24')](function(_0x318b7b){_0x1b7e38[_0xa9c9('0x42')]=_0x318b7b;return _0x1b7e38;})[_0xa9c9('0x24')](respondWithFilteredResult(_0x551a16,_0x110616))[_0xa9c9('0x43')](handleError(_0x551a16,null));};exports[_0xa9c9('0x44')]=function(_0x124451,_0xe9adf1){var _0x198605={'raw':!![],'where':{'id':_0x124451[_0xa9c9('0x45')]['id']}},_0x7d10ba={};_0x7d10ba[_0xa9c9('0x2f')]=_[_0xa9c9('0x46')](db['JscriptySessionReport']['rawAttributes']);_0x7d10ba[_0xa9c9('0x30')]=_[_0xa9c9('0x46')](_0x124451[_0xa9c9('0x30')]);_0x7d10ba[_0xa9c9('0x38')]=_[_0xa9c9('0x31')](_0x7d10ba[_0xa9c9('0x2f')],_0x7d10ba['query']);_0x198605[_0xa9c9('0x33')]=_[_0xa9c9('0x31')](_0x7d10ba[_0xa9c9('0x2f')],qs[_0xa9c9('0x32')](_0x124451[_0xa9c9('0x30')][_0xa9c9('0x32')]));_0x198605['attributes']=_0x198605[_0xa9c9('0x33')]['length']?_0x198605[_0xa9c9('0x33')]:_0x7d10ba[_0xa9c9('0x2f')];if(_0x124451['query'][_0xa9c9('0x3f')]){_0x198605[_0xa9c9('0x40')]=[{'all':!![]}];}_0x198605=_[_0xa9c9('0x3b')]({},_0x198605,_0x124451[_0xa9c9('0x3e')]);return db[_0xa9c9('0x2c')][_0xa9c9('0x47')](_0x198605)[_0xa9c9('0x24')](handleEntityNotFound(_0xe9adf1,null))[_0xa9c9('0x24')](respondWithResult(_0xe9adf1,null))[_0xa9c9('0x43')](handleError(_0xe9adf1,null));};exports[_0xa9c9('0x48')]=function(_0x551829,_0x545c05){return db[_0xa9c9('0x2c')][_0xa9c9('0x48')](_0x551829[_0xa9c9('0x49')],{})[_0xa9c9('0x24')](respondWithResult(_0x545c05,0xc9))[_0xa9c9('0x43')](handleError(_0x545c05,null));};exports[_0xa9c9('0x4a')]=function(_0x5b72fb,_0x4ee63c){if(_0x5b72fb[_0xa9c9('0x49')]['id']){delete _0x5b72fb[_0xa9c9('0x49')]['id'];}return db[_0xa9c9('0x2c')]['find']({'where':{'id':_0x5b72fb[_0xa9c9('0x45')]['id']}})[_0xa9c9('0x24')](handleEntityNotFound(_0x4ee63c,null))['then'](saveUpdates(_0x5b72fb[_0xa9c9('0x49')],null))[_0xa9c9('0x24')](respondWithResult(_0x4ee63c,null))[_0xa9c9('0x43')](handleError(_0x4ee63c,null));};exports[_0xa9c9('0x25')]=function(_0xa10a60,_0x261442){return db[_0xa9c9('0x2c')][_0xa9c9('0x47')]({'where':{'id':_0xa10a60[_0xa9c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x261442,null))[_0xa9c9('0x24')](removeEntity(_0x261442,null))[_0xa9c9('0x43')](handleError(_0x261442,null));};exports[_0xa9c9('0x4b')]=function(_0x18acec,_0x13a128){return db[_0xa9c9('0x2c')][_0xa9c9('0x4b')]()[_0xa9c9('0x24')](respondWithResult(_0x13a128,null))[_0xa9c9('0x43')](handleError(_0x13a128,null));};exports[_0xa9c9('0x4c')]=function(_0x166014,_0x1de23d,_0x36b8af){var _0x30c8be={'raw':!![],'where':{}};var _0x409e3c={};var _0xf3b18={'count':0x0,'rows':[]};return db[_0xa9c9('0x2c')][_0xa9c9('0x4d')]({'where':{'id':_0x166014[_0xa9c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x1de23d,null))[_0xa9c9('0x24')](function(_0x5d487b){if(_0x5d487b){_0x409e3c['model']=_['keys'](db[_0xa9c9('0x4e')]['rawAttributes']);_0x409e3c[_0xa9c9('0x30')]=_[_0xa9c9('0x46')](_0x166014[_0xa9c9('0x30')]);_0x409e3c['filters']=_[_0xa9c9('0x31')](_0x409e3c[_0xa9c9('0x2f')],_0x409e3c['query']);_0x30c8be[_0xa9c9('0x33')]=_[_0xa9c9('0x31')](_0x409e3c[_0xa9c9('0x2f')],qs[_0xa9c9('0x32')](_0x166014[_0xa9c9('0x30')]['fields']));_0x30c8be['attributes']=_0x30c8be['attributes'][_0xa9c9('0x34')]?_0x30c8be[_0xa9c9('0x33')]:_0x409e3c[_0xa9c9('0x2f')];if(!_0x166014['query']['hasOwnProperty']('nolimit')){_0x30c8be['limit']=qs[_0xa9c9('0x20')](_0x166014['query'][_0xa9c9('0x20')]);_0x30c8be[_0xa9c9('0x1d')]=qs[_0xa9c9('0x1d')](_0x166014[_0xa9c9('0x30')][_0xa9c9('0x1d')]);}_0x30c8be[_0xa9c9('0x35')]=qs['sort'](_0x166014['query']['sort']);_0x30c8be[_0xa9c9('0x37')]=qs[_0xa9c9('0x38')](_[_0xa9c9('0x39')](_0x166014[_0xa9c9('0x30')],_0x409e3c[_0xa9c9('0x38')]));_0x30c8be[_0xa9c9('0x37')][_0xa9c9('0x4f')]=_0x5d487b['id'];if(_0x166014[_0xa9c9('0x30')]['filter']){_0x30c8be['where']=_[_0xa9c9('0x3b')](_0x30c8be[_0xa9c9('0x37')],{'$or':_[_0xa9c9('0x2b')](_0x30c8be[_0xa9c9('0x33')],function(_0x2f5c0){var _0x1e8d49={};_0x1e8d49[_0x2f5c0]={'$like':'%'+_0x166014[_0xa9c9('0x30')][_0xa9c9('0x3a')]+'%'};return _0x1e8d49;})});}_0x30c8be=_[_0xa9c9('0x3b')]({},_0x30c8be,_0x166014[_0xa9c9('0x3e')]);return db[_0xa9c9('0x4e')]['count']({'where':_0x30c8be['where']})[_0xa9c9('0x24')](function(_0x351d94){_0xf3b18['count']=_0x351d94;if(_0x166014[_0xa9c9('0x30')][_0xa9c9('0x3f')]){_0x30c8be[_0xa9c9('0x40')]=[{'all':!![]}];}return db[_0xa9c9('0x4e')]['findAll'](_0x30c8be);})['then'](function(_0x1bfdaa){_0xf3b18['rows']=_0x1bfdaa;return _0xf3b18;});}})['then'](respondWithFilteredResult(_0x1de23d,_0x30c8be))[_0xa9c9('0x43')](handleError(_0x1de23d,null));}; \ No newline at end of file +var _0x5e67=['pick','SessionId','JscriptyQuestionReport','eml-format','rimraf','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','getQuestions','findOne'];(function(_0x148139,_0x219ce4){var _0x36be4d=function(_0x372245){while(--_0x372245){_0x148139['push'](_0x148139['shift']());}};_0x36be4d(++_0x219ce4);}(_0x5e67,0xf0));var _0x75e6=function(_0x37679b,_0x3de128){_0x37679b=_0x37679b-0x0;var _0x3e3ed5=_0x5e67[_0x37679b];return _0x3e3ed5;};'use strict';var emlformat=require(_0x75e6('0x0'));var rimraf=require(_0x75e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x75e6('0x2'));var rp=require(_0x75e6('0x3'));var moment=require(_0x75e6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x75e6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x75e6('0x6'));var ejs=require(_0x75e6('0x7'));var fs=require('fs');var fs_extra=require(_0x75e6('0x8'));var _=require('lodash');var squel=require(_0x75e6('0x9'));var crypto=require(_0x75e6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x75e6('0xb'));var toCsv=require(_0x75e6('0x6'));var querystring=require(_0x75e6('0xc'));var Papa=require('papaparse');var Redis=require(_0x75e6('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75e6('0xe'));var hardwareService=require(_0x75e6('0xf'));var logger=require(_0x75e6('0x10'))(_0x75e6('0x11'));var utils=require(_0x75e6('0x12'));var config=require(_0x75e6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x75e6('0x14'))['db'];function respondWithStatusCode(_0x1e0df3,_0x47eba2){_0x47eba2=_0x47eba2||0xcc;return function(_0x1b1719){if(_0x1b1719){return _0x1e0df3[_0x75e6('0x15')](_0x47eba2);}return _0x1e0df3[_0x75e6('0x16')](_0x47eba2)['end']();};}function respondWithResult(_0x4fc489,_0x1f35c2){_0x1f35c2=_0x1f35c2||0xc8;return function(_0x3a8a8f){if(_0x3a8a8f){return _0x4fc489[_0x75e6('0x16')](_0x1f35c2)[_0x75e6('0x17')](_0x3a8a8f);}};}function respondWithFilteredResult(_0x3515f0,_0x187998){return function(_0x15e94e){if(_0x15e94e){var _0x258fba=typeof _0x187998[_0x75e6('0x18')]===_0x75e6('0x19')&&typeof _0x187998[_0x75e6('0x1a')]===_0x75e6('0x19');var _0x1efe0f=_0x15e94e[_0x75e6('0x1b')];var _0x48c9fd=_0x258fba?0x0:_0x187998[_0x75e6('0x18')];var _0x51d943=_0x258fba?_0x15e94e[_0x75e6('0x1b')]:_0x187998[_0x75e6('0x18')]+_0x187998[_0x75e6('0x1a')];var _0x50493e;if(_0x51d943>=_0x1efe0f){_0x51d943=_0x1efe0f;_0x50493e=0xc8;}else{_0x50493e=0xce;}_0x3515f0[_0x75e6('0x16')](_0x50493e);return _0x3515f0[_0x75e6('0x1c')](_0x75e6('0x1d'),_0x48c9fd+'-'+_0x51d943+'/'+_0x1efe0f)[_0x75e6('0x17')](_0x15e94e);}return null;};}function patchUpdates(_0x100a3b){return function(_0x2fa1bf){try{jsonpatch[_0x75e6('0x1e')](_0x2fa1bf,_0x100a3b,!![]);}catch(_0x4fd2b3){return BPromise['reject'](_0x4fd2b3);}return _0x2fa1bf[_0x75e6('0x1f')]();};}function saveUpdates(_0x50c0d6,_0x3cc9c5){return function(_0x4306c0){if(_0x4306c0){return _0x4306c0[_0x75e6('0x20')](_0x50c0d6)[_0x75e6('0x21')](function(_0x3b57e0){return _0x3b57e0;});}return null;};}function removeEntity(_0xe9b38d,_0x11c3de){return function(_0x2b555f){if(_0x2b555f){return _0x2b555f[_0x75e6('0x22')]()[_0x75e6('0x21')](function(){_0xe9b38d['status'](0xcc)[_0x75e6('0x23')]();});}};}function handleEntityNotFound(_0x480b53,_0x1492a0){return function(_0xd6f8a6){if(!_0xd6f8a6){_0x480b53[_0x75e6('0x15')](0x194);}return _0xd6f8a6;};}function handleError(_0x5148d8,_0x8f9be0){_0x8f9be0=_0x8f9be0||0x1f4;return function(_0x2a5682){logger[_0x75e6('0x24')](_0x2a5682[_0x75e6('0x25')]);if(_0x2a5682[_0x75e6('0x26')]){delete _0x2a5682['name'];}_0x5148d8[_0x75e6('0x16')](_0x8f9be0)[_0x75e6('0x27')](_0x2a5682);};}exports[_0x75e6('0x28')]=function(_0x40c320,_0x3b0880){var _0x57bf6c={},_0x38a1db={},_0x34dd65={'count':0x0,'rows':[]};var _0x519d34=_[_0x75e6('0x29')](db[_0x75e6('0x2a')][_0x75e6('0x2b')],function(_0x3009ea){return{'name':_0x3009ea[_0x75e6('0x2c')],'type':_0x3009ea[_0x75e6('0x2d')][_0x75e6('0x2e')]};});_0x38a1db[_0x75e6('0x2f')]=_[_0x75e6('0x29')](_0x519d34,_0x75e6('0x26'));_0x38a1db[_0x75e6('0x30')]=_[_0x75e6('0x31')](_0x40c320[_0x75e6('0x30')]);_0x38a1db[_0x75e6('0x32')]=_[_0x75e6('0x33')](_0x38a1db[_0x75e6('0x2f')],_0x38a1db[_0x75e6('0x30')]);_0x57bf6c[_0x75e6('0x34')]=_[_0x75e6('0x33')](_0x38a1db[_0x75e6('0x2f')],qs[_0x75e6('0x35')](_0x40c320[_0x75e6('0x30')][_0x75e6('0x35')]));_0x57bf6c['attributes']=_0x57bf6c[_0x75e6('0x34')][_0x75e6('0x36')]?_0x57bf6c[_0x75e6('0x34')]:_0x38a1db[_0x75e6('0x2f')];if(!_0x40c320[_0x75e6('0x30')][_0x75e6('0x37')](_0x75e6('0x38'))){_0x57bf6c[_0x75e6('0x1a')]=qs[_0x75e6('0x1a')](_0x40c320['query'][_0x75e6('0x1a')]);_0x57bf6c[_0x75e6('0x18')]=qs['offset'](_0x40c320[_0x75e6('0x30')]['offset']);}_0x57bf6c[_0x75e6('0x39')]=qs[_0x75e6('0x3a')](_0x40c320['query'][_0x75e6('0x3a')]);_0x57bf6c[_0x75e6('0x3b')]=qs[_0x75e6('0x32')](_['pick'](_0x40c320['query'],_0x38a1db['filters']),_0x519d34);if(_0x40c320['query'][_0x75e6('0x3c')]){_0x57bf6c[_0x75e6('0x3b')]=_[_0x75e6('0x3d')](_0x57bf6c[_0x75e6('0x3b')],{'$or':_[_0x75e6('0x29')](_0x519d34,function(_0x1e92b1){if(_0x1e92b1[_0x75e6('0x2d')]!==_0x75e6('0x3e')){var _0x509b2f={};_0x509b2f[_0x1e92b1['name']]={'$like':'%'+_0x40c320[_0x75e6('0x30')][_0x75e6('0x3c')]+'%'};return _0x509b2f;}})});}_0x57bf6c=_[_0x75e6('0x3d')]({},_0x57bf6c,_0x40c320['options']);var _0x3e1d44={'where':_0x57bf6c['where']};return db[_0x75e6('0x2a')][_0x75e6('0x1b')](_0x3e1d44)['then'](function(_0x552bda){_0x34dd65[_0x75e6('0x1b')]=_0x552bda;if(_0x40c320[_0x75e6('0x30')][_0x75e6('0x3f')]){_0x57bf6c['include']=[{'all':!![]}];}return db[_0x75e6('0x2a')][_0x75e6('0x40')](_0x57bf6c);})['then'](function(_0x22c48e){_0x34dd65['rows']=_0x22c48e;return _0x34dd65;})[_0x75e6('0x21')](respondWithFilteredResult(_0x3b0880,_0x57bf6c))[_0x75e6('0x41')](handleError(_0x3b0880,null));};exports[_0x75e6('0x42')]=function(_0xdeef5d,_0xf29c9d){var _0x5c7c68={'raw':!![],'where':{'id':_0xdeef5d[_0x75e6('0x43')]['id']}},_0x5c81d4={};_0x5c81d4[_0x75e6('0x2f')]=_[_0x75e6('0x31')](db[_0x75e6('0x2a')][_0x75e6('0x2b')]);_0x5c81d4['query']=_[_0x75e6('0x31')](_0xdeef5d[_0x75e6('0x30')]);_0x5c81d4[_0x75e6('0x32')]=_[_0x75e6('0x33')](_0x5c81d4[_0x75e6('0x2f')],_0x5c81d4['query']);_0x5c7c68[_0x75e6('0x34')]=_[_0x75e6('0x33')](_0x5c81d4[_0x75e6('0x2f')],qs[_0x75e6('0x35')](_0xdeef5d[_0x75e6('0x30')][_0x75e6('0x35')]));_0x5c7c68[_0x75e6('0x34')]=_0x5c7c68[_0x75e6('0x34')][_0x75e6('0x36')]?_0x5c7c68[_0x75e6('0x34')]:_0x5c81d4[_0x75e6('0x2f')];if(_0xdeef5d[_0x75e6('0x30')]['includeAll']){_0x5c7c68[_0x75e6('0x44')]=[{'all':!![]}];}_0x5c7c68=_[_0x75e6('0x3d')]({},_0x5c7c68,_0xdeef5d[_0x75e6('0x45')]);return db[_0x75e6('0x2a')][_0x75e6('0x46')](_0x5c7c68)[_0x75e6('0x21')](handleEntityNotFound(_0xf29c9d,null))[_0x75e6('0x21')](respondWithResult(_0xf29c9d,null))['catch'](handleError(_0xf29c9d,null));};exports['create']=function(_0x1590e3,_0x492fe6){return db[_0x75e6('0x2a')][_0x75e6('0x47')](_0x1590e3['body'],{})['then'](respondWithResult(_0x492fe6,0xc9))['catch'](handleError(_0x492fe6,null));};exports['update']=function(_0x3f7889,_0x366c09){if(_0x3f7889[_0x75e6('0x48')]['id']){delete _0x3f7889[_0x75e6('0x48')]['id'];}return db['JscriptySessionReport'][_0x75e6('0x46')]({'where':{'id':_0x3f7889['params']['id']}})[_0x75e6('0x21')](handleEntityNotFound(_0x366c09,null))['then'](saveUpdates(_0x3f7889[_0x75e6('0x48')],null))['then'](respondWithResult(_0x366c09,null))[_0x75e6('0x41')](handleError(_0x366c09,null));};exports[_0x75e6('0x22')]=function(_0x5bcea6,_0x2fbe12){return db['JscriptySessionReport'][_0x75e6('0x46')]({'where':{'id':_0x5bcea6[_0x75e6('0x43')]['id']}})[_0x75e6('0x21')](handleEntityNotFound(_0x2fbe12,null))[_0x75e6('0x21')](removeEntity(_0x2fbe12,null))['catch'](handleError(_0x2fbe12,null));};exports[_0x75e6('0x49')]=function(_0x5e3579,_0xc7032f){return db['JscriptySessionReport'][_0x75e6('0x49')]()['then'](respondWithResult(_0xc7032f,null))['catch'](handleError(_0xc7032f,null));};exports[_0x75e6('0x4a')]=function(_0x277133,_0x4b4539,_0x460464){var _0x190e38={'raw':!![],'where':{}};var _0x3d31c8={};var _0x1a66b5={'count':0x0,'rows':[]};return db[_0x75e6('0x2a')][_0x75e6('0x4b')]({'where':{'id':_0x277133['params']['id']}})['then'](handleEntityNotFound(_0x4b4539,null))[_0x75e6('0x21')](function(_0x2fc9d7){if(_0x2fc9d7){_0x3d31c8['model']=_['keys'](db['JscriptyQuestionReport'][_0x75e6('0x2b')]);_0x3d31c8[_0x75e6('0x30')]=_['keys'](_0x277133[_0x75e6('0x30')]);_0x3d31c8[_0x75e6('0x32')]=_['intersection'](_0x3d31c8['model'],_0x3d31c8['query']);_0x190e38[_0x75e6('0x34')]=_['intersection'](_0x3d31c8[_0x75e6('0x2f')],qs[_0x75e6('0x35')](_0x277133[_0x75e6('0x30')][_0x75e6('0x35')]));_0x190e38[_0x75e6('0x34')]=_0x190e38[_0x75e6('0x34')][_0x75e6('0x36')]?_0x190e38[_0x75e6('0x34')]:_0x3d31c8['model'];if(!_0x277133[_0x75e6('0x30')]['hasOwnProperty'](_0x75e6('0x38'))){_0x190e38[_0x75e6('0x1a')]=qs[_0x75e6('0x1a')](_0x277133[_0x75e6('0x30')][_0x75e6('0x1a')]);_0x190e38[_0x75e6('0x18')]=qs['offset'](_0x277133[_0x75e6('0x30')][_0x75e6('0x18')]);}_0x190e38[_0x75e6('0x39')]=qs[_0x75e6('0x3a')](_0x277133['query'][_0x75e6('0x3a')]);_0x190e38['where']=qs[_0x75e6('0x32')](_[_0x75e6('0x4c')](_0x277133[_0x75e6('0x30')],_0x3d31c8[_0x75e6('0x32')]));_0x190e38[_0x75e6('0x3b')][_0x75e6('0x4d')]=_0x2fc9d7['id'];if(_0x277133[_0x75e6('0x30')][_0x75e6('0x3c')]){_0x190e38['where']=_[_0x75e6('0x3d')](_0x190e38[_0x75e6('0x3b')],{'$or':_['map'](_0x190e38[_0x75e6('0x34')],function(_0x2c6485){var _0x5b80ec={};_0x5b80ec[_0x2c6485]={'$like':'%'+_0x277133['query']['filter']+'%'};return _0x5b80ec;})});}_0x190e38=_[_0x75e6('0x3d')]({},_0x190e38,_0x277133[_0x75e6('0x45')]);return db[_0x75e6('0x4e')][_0x75e6('0x1b')]({'where':_0x190e38[_0x75e6('0x3b')]})[_0x75e6('0x21')](function(_0x217469){_0x1a66b5['count']=_0x217469;if(_0x277133[_0x75e6('0x30')][_0x75e6('0x3f')]){_0x190e38[_0x75e6('0x44')]=[{'all':!![]}];}return db[_0x75e6('0x4e')]['findAll'](_0x190e38);})['then'](function(_0x4574df){_0x1a66b5['rows']=_0x4574df;return _0x1a66b5;});}})[_0x75e6('0x21')](respondWithFilteredResult(_0x4b4539,_0x190e38))[_0x75e6('0x41')](handleError(_0x4b4539,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2bc1a5b..5b805c5 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 _0x7bd0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0xb6afc,_0x4048b6){var _0x57989f=function(_0x19de3e){while(--_0x19de3e){_0xb6afc['push'](_0xb6afc['shift']());}};_0x57989f(++_0x4048b6);}(_0x7bd0,0x111));var _0x07bd=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0x7bd0[_0x49c653];return _0x31e169;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3831=['define','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes'];(function(_0x178d95,_0x5880c1){var _0x55688c=function(_0x481551){while(--_0x481551){_0x178d95['push'](_0x178d95['shift']());}};_0x55688c(++_0x5880c1);}(_0x3831,0x14c));var _0x1383=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0x3831[_0x580d0e];return _0xb51111;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x1383('0x9'),'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 b204204..b5eb666 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 _0x32f4=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x62cfe,_0x894025){var _0x3ecfda=function(_0x3169d0){while(--_0x3169d0){_0x62cfe['push'](_0x62cfe['shift']());}};_0x3ecfda(++_0x894025);}(_0x32f4,0x154));var _0x432f=function(_0x726f20,_0x36564b){_0x726f20=_0x726f20-0x0;var _0x56b516=_0x32f4[_0x726f20];return _0x56b516;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});} \ No newline at end of file +var _0xd943=['info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x71ecb,_0x5c5c8f){var _0x661db=function(_0x18c7af){while(--_0x18c7af){_0x71ecb['push'](_0x71ecb['shift']());}};_0x661db(++_0x5c5c8f);}(_0xd943,0x15d));var _0x3d94=function(_0x5beeb3,_0x3739e1){_0x5beeb3=_0x5beeb3-0x0;var _0x188739=_0xd943[_0x5beeb3];return _0x188739;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 7df4288..c3a190d 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 _0xf0f3=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','put','/:id','isAuthenticated','update','/download_log_file','exports'];(function(_0x13bbea,_0x45c0f3){var _0xf4ea2=function(_0x35466b){while(--_0x35466b){_0x13bbea['push'](_0x13bbea['shift']());}};_0xf4ea2(++_0x45c0f3);}(_0xf0f3,0x11d));var _0x3f0f=function(_0x244348,_0x1c69bc){_0x244348=_0x244348-0x0;var _0x1b219e=_0xf0f3[_0x244348];return _0x1b219e;};'use strict';var multer=require('multer');var util=require(_0x3f0f('0x0'));var path=require(_0x3f0f('0x1'));var timeout=require(_0x3f0f('0x2'));var express=require(_0x3f0f('0x3'));var router=express[_0x3f0f('0x4')]();var fs_extra=require(_0x3f0f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f0f('0x6'));var controller=require('./license.controller');router[_0x3f0f('0x7')]('/',controller[_0x3f0f('0x8')]);router[_0x3f0f('0x9')](_0x3f0f('0xa'),auth[_0x3f0f('0xb')](),controller[_0x3f0f('0xc')]);router[_0x3f0f('0x7')](_0x3f0f('0xd'),auth[_0x3f0f('0xb')](),controller['downloadLogFile']);module[_0x3f0f('0xe')]=router; \ No newline at end of file +var _0x5170=['put','update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x4f1e4d,_0x1f18a4){var _0x929aad=function(_0x46b46d){while(--_0x46b46d){_0x4f1e4d['push'](_0x4f1e4d['shift']());}};_0x929aad(++_0x1f18a4);}(_0x5170,0x18c));var _0x0517=function(_0x2d3ba0,_0x257709){_0x2d3ba0=_0x2d3ba0-0x0;var _0x284cd3=_0x5170[_0x2d3ba0];return _0x284cd3;};'use strict';var multer=require(_0x0517('0x0'));var util=require('util');var path=require(_0x0517('0x1'));var timeout=require(_0x0517('0x2'));var express=require(_0x0517('0x3'));var router=express[_0x0517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0517('0x5'));var config=require(_0x0517('0x6'));var controller=require('./license.controller');router[_0x0517('0x7')]('/',controller[_0x0517('0x8')]);router[_0x0517('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0517('0xa')]);router[_0x0517('0x7')](_0x0517('0xb'),auth[_0x0517('0xc')](),controller[_0x0517('0xd')]);module[_0x0517('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 3c0aa5f..1d35ac7 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 _0x3560=['TEXT','STRING'];(function(_0x49581f,_0x1d8b5f){var _0x157d83=function(_0x278ccb){while(--_0x278ccb){_0x49581f['push'](_0x49581f['shift']());}};_0x157d83(++_0x1d8b5f);}(_0x3560,0x1b0));var _0x0356=function(_0x1fb4a0,_0x48a602){_0x1fb4a0=_0x1fb4a0-0x0;var _0x1094e7=_0x3560[_0x1fb4a0];return _0x1094e7;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x0356('0x0')]},'data1':{'type':Sequelize[_0x0356('0x1')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2745=['sequelize','exports','TEXT','STRING'];(function(_0x499e28,_0x2d0c3e){var _0x4b8c09=function(_0x2aa2ac){while(--_0x2aa2ac){_0x499e28['push'](_0x499e28['shift']());}};_0x4b8c09(++_0x2d0c3e);}(_0x2745,0xf0));var _0x5274=function(_0x1a24b3,_0x186e10){_0x1a24b3=_0x1a24b3-0x0;var _0x5365ad=_0x2745[_0x1a24b3];return _0x5365ad;};'use strict';var Sequelize=require(_0x5274('0x0'));module[_0x5274('0x1')]={'license':{'type':Sequelize[_0x5274('0x2')]},'data1':{'type':Sequelize[_0x5274('0x3')]},'data2':{'type':Sequelize[_0x5274('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 06f7a3a..788b2c7 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 _0xac0e=['crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','rawAttributes','query','keys','filters','attributes','intersection','fields','length','options','getLicense','body','License','find','params','get','checkLicense','key','demo','catch','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x964a7b,_0x50e77d){var _0x43844c=function(_0x3a6123){while(--_0x3a6123){_0x964a7b['push'](_0x964a7b['shift']());}};_0x43844c(++_0x50e77d);}(_0xac0e,0x198));var _0xeac0=function(_0x16fc36,_0x25505b){_0x16fc36=_0x16fc36-0x0;var _0x1375b1=_0xac0e[_0x16fc36];return _0x1375b1;};'use strict';var emlformat=require(_0xeac0('0x0'));var rimraf=require(_0xeac0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeac0('0x2'));var moment=require(_0xeac0('0x3'));var BPromise=require(_0xeac0('0x4'));var Mustache=require(_0xeac0('0x5'));var util=require(_0xeac0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xeac0('0x7'));var ejs=require(_0xeac0('0x8'));var fs=require('fs');var fs_extra=require(_0xeac0('0x9'));var _=require(_0xeac0('0xa'));var squel=require(_0xeac0('0xb'));var crypto=require(_0xeac0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeac0('0x7'));var querystring=require('querystring');var Papa=require(_0xeac0('0xd'));var Redis=require(_0xeac0('0xe'));var authService=require(_0xeac0('0xf'));var qs=require(_0xeac0('0x10'));var as=require(_0xeac0('0x11'));var hardwareService=require(_0xeac0('0x12'));var logger=require(_0xeac0('0x13'))(_0xeac0('0x14'));var utils=require(_0xeac0('0x15'));var config=require(_0xeac0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xeac0('0x17'))['db'];function respondWithStatusCode(_0x400502,_0x381524){_0x381524=_0x381524||0xcc;return function(_0x5ea0b0){if(_0x5ea0b0){return _0x400502['sendStatus'](_0x381524);}return _0x400502[_0xeac0('0x18')](_0x381524)[_0xeac0('0x19')]();};}function respondWithResult(_0x303ee6,_0x5466f3){_0x5466f3=_0x5466f3||0xc8;return function(_0xef0159){if(_0xef0159){return _0x303ee6[_0xeac0('0x18')](_0x5466f3)[_0xeac0('0x1a')](_0xef0159);}};}function respondWithFilteredResult(_0x5e5c46,_0x25ee1b){return function(_0x31662a){if(_0x31662a){var _0x2c175e=typeof _0x25ee1b[_0xeac0('0x1b')]==='undefined'&&typeof _0x25ee1b[_0xeac0('0x1c')]==='undefined';var _0x464c4d=_0x31662a[_0xeac0('0x1d')];var _0x39dccc=_0x2c175e?0x0:_0x25ee1b[_0xeac0('0x1b')];var _0x5e29f8=_0x2c175e?_0x31662a[_0xeac0('0x1d')]:_0x25ee1b[_0xeac0('0x1b')]+_0x25ee1b[_0xeac0('0x1c')];var _0x4fe883;if(_0x5e29f8>=_0x464c4d){_0x5e29f8=_0x464c4d;_0x4fe883=0xc8;}else{_0x4fe883=0xce;}_0x5e5c46[_0xeac0('0x18')](_0x4fe883);return _0x5e5c46['set']('Content-Range',_0x39dccc+'-'+_0x5e29f8+'/'+_0x464c4d)[_0xeac0('0x1a')](_0x31662a);}return null;};}function patchUpdates(_0x4bee65){return function(_0xdaa379){try{jsonpatch['apply'](_0xdaa379,_0x4bee65,!![]);}catch(_0x5c9371){return BPromise[_0xeac0('0x1e')](_0x5c9371);}return _0xdaa379[_0xeac0('0x1f')]();};}function saveUpdates(_0x524e3b,_0x5be10a){return function(_0x2ce88e){if(_0x2ce88e){return _0x2ce88e[_0xeac0('0x20')](_0x524e3b)[_0xeac0('0x21')](function(_0x576d36){return _0x576d36;});}return null;};}function removeEntity(_0xc7981d,_0x325a11){return function(_0x2572a3){if(_0x2572a3){return _0x2572a3[_0xeac0('0x22')]()['then'](function(){_0xc7981d[_0xeac0('0x18')](0xcc)[_0xeac0('0x19')]();});}};}function handleEntityNotFound(_0x380ba2,_0x15fd9a){return function(_0x4df931){if(!_0x4df931){_0x380ba2['sendStatus'](0x194);}return _0x4df931;};}function handleError(_0x1c9716,_0x5b80f2){_0x5b80f2=_0x5b80f2||0x1f4;return function(_0x1bb720){logger[_0xeac0('0x23')](_0x1bb720[_0xeac0('0x24')]);if(_0x1bb720[_0xeac0('0x25')]){delete _0x1bb720['name'];}_0x1c9716['status'](_0x5b80f2)[_0xeac0('0x26')](_0x1bb720);};}var utilLicense=require(_0xeac0('0x27'));exports[_0xeac0('0x28')]=function(_0x541f30,_0x41c95b){var _0x2e1473={'raw':!![],'where':{'id':0x1}},_0x35921e={};_0x35921e[_0xeac0('0x29')]=_['keys'](db['License'][_0xeac0('0x2a')]);_0x35921e[_0xeac0('0x2b')]=_[_0xeac0('0x2c')](_0x541f30[_0xeac0('0x2b')]);_0x35921e[_0xeac0('0x2d')]=_['intersection'](_0x35921e[_0xeac0('0x29')],_0x35921e[_0xeac0('0x2b')]);_0x2e1473[_0xeac0('0x2e')]=_[_0xeac0('0x2f')](_0x35921e['model'],qs[_0xeac0('0x30')](_0x541f30[_0xeac0('0x2b')][_0xeac0('0x30')]));_0x2e1473['attributes']=_0x2e1473[_0xeac0('0x2e')][_0xeac0('0x31')]?_0x2e1473['attributes']:_0x35921e[_0xeac0('0x29')];_0x2e1473=_['merge']({},_0x2e1473,_0x541f30[_0xeac0('0x32')]);return utilLicense[_0xeac0('0x33')](_0x2e1473)['then'](respondWithResult(_0x41c95b,null))['catch'](handleError(_0x41c95b,null));};exports[_0xeac0('0x20')]=function(_0x44ebf0,_0xfc1ff){if(_0x44ebf0[_0xeac0('0x34')]['id']){delete _0x44ebf0[_0xeac0('0x34')]['id'];}return db[_0xeac0('0x35')][_0xeac0('0x36')]({'where':{'id':_0x44ebf0[_0xeac0('0x37')]['id']}})['then'](handleEntityNotFound(_0xfc1ff,null))[_0xeac0('0x21')](function(_0x15bf01){var _0x5cdafe=_0x15bf01[_0xeac0('0x38')]({'plain':!![]});return utilLicense[_0xeac0('0x39')](_0x5cdafe,_0x44ebf0[_0xeac0('0x34')][_0xeac0('0x3a')]);})[_0xeac0('0x21')](function(_0x3964c3){if(!_0x3964c3[_0xeac0('0x3b')]){return saveUpdates(_0x44ebf0[_0xeac0('0x34')],null);}return _0x3964c3;})[_0xeac0('0x21')](respondWithResult(_0xfc1ff,null))[_0xeac0('0x3c')](handleError(_0xfc1ff,null));};exports['downloadLogFile']=function(_0x573c92,_0x5ab289){var _0x34f1a5=_0xeac0('0x3d');var _0x5a7629=path[_0xeac0('0x3e')](_0xeac0('0x3f'),_0xeac0('0x40'),_0xeac0('0x41'),_0x34f1a5);_0x5ab289['setHeader'](_0xeac0('0x42'),_0xeac0('0x43')+_0x34f1a5);_0x5ab289['set'](_0xeac0('0x44'),'text/plain');_0x5ab289[_0xeac0('0x45')](_0x5a7629);}; \ No newline at end of file +var _0xdc29=['status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','stack','name','send','index','model','keys','License','query','intersection','attributes','fields','length','merge','options','catch','body','find','params','demo','license-info.log','log','xcally','setHeader','text/plain','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','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'];(function(_0x2465a7,_0x479ebe){var _0x22a6c1=function(_0x45edcf){while(--_0x45edcf){_0x2465a7['push'](_0x2465a7['shift']());}};_0x22a6c1(++_0x479ebe);}(_0xdc29,0xe2));var _0x9dc2=function(_0x139810,_0x3d0e5a){_0x139810=_0x139810-0x0;var _0x257ce1=_0xdc29[_0x139810];return _0x257ce1;};'use strict';var emlformat=require(_0x9dc2('0x0'));var rimraf=require(_0x9dc2('0x1'));var zipdir=require(_0x9dc2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9dc2('0x3'));var Mustache=require(_0x9dc2('0x4'));var util=require(_0x9dc2('0x5'));var path=require(_0x9dc2('0x6'));var sox=require('sox');var csv=require(_0x9dc2('0x7'));var ejs=require(_0x9dc2('0x8'));var fs=require('fs');var fs_extra=require(_0x9dc2('0x9'));var _=require(_0x9dc2('0xa'));var squel=require('squel');var crypto=require(_0x9dc2('0xb'));var jsforce=require(_0x9dc2('0xc'));var deskjs=require(_0x9dc2('0xd'));var toCsv=require(_0x9dc2('0x7'));var querystring=require(_0x9dc2('0xe'));var Papa=require(_0x9dc2('0xf'));var Redis=require(_0x9dc2('0x10'));var authService=require(_0x9dc2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9dc2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9dc2('0x13'))(_0x9dc2('0x14'));var utils=require(_0x9dc2('0x15'));var config=require(_0x9dc2('0x16'));var licenseUtil=require(_0x9dc2('0x17'));var db=require(_0x9dc2('0x18'))['db'];function respondWithStatusCode(_0xe6b7f6,_0x6b11e3){_0x6b11e3=_0x6b11e3||0xcc;return function(_0x2a0b77){if(_0x2a0b77){return _0xe6b7f6[_0x9dc2('0x19')](_0x6b11e3);}return _0xe6b7f6[_0x9dc2('0x1a')](_0x6b11e3)[_0x9dc2('0x1b')]();};}function respondWithResult(_0x11fef8,_0x2436d1){_0x2436d1=_0x2436d1||0xc8;return function(_0x2f3cca){if(_0x2f3cca){return _0x11fef8[_0x9dc2('0x1a')](_0x2436d1)[_0x9dc2('0x1c')](_0x2f3cca);}};}function respondWithFilteredResult(_0x5971f3,_0x23a50d){return function(_0x4d8b6b){if(_0x4d8b6b){var _0x52dd24=typeof _0x23a50d[_0x9dc2('0x1d')]==='undefined'&&typeof _0x23a50d[_0x9dc2('0x1e')]===_0x9dc2('0x1f');var _0x4f3d9b=_0x4d8b6b[_0x9dc2('0x20')];var _0x208942=_0x52dd24?0x0:_0x23a50d['offset'];var _0x473594=_0x52dd24?_0x4d8b6b[_0x9dc2('0x20')]:_0x23a50d[_0x9dc2('0x1d')]+_0x23a50d['limit'];var _0x36fa7b;if(_0x473594>=_0x4f3d9b){_0x473594=_0x4f3d9b;_0x36fa7b=0xc8;}else{_0x36fa7b=0xce;}_0x5971f3[_0x9dc2('0x1a')](_0x36fa7b);return _0x5971f3[_0x9dc2('0x21')](_0x9dc2('0x22'),_0x208942+'-'+_0x473594+'/'+_0x4f3d9b)['json'](_0x4d8b6b);}return null;};}function patchUpdates(_0x19a5d5){return function(_0x420240){try{jsonpatch['apply'](_0x420240,_0x19a5d5,!![]);}catch(_0x40da56){return BPromise[_0x9dc2('0x23')](_0x40da56);}return _0x420240[_0x9dc2('0x24')]();};}function saveUpdates(_0x55c155,_0x1246cb){return function(_0x5e3bc4){if(_0x5e3bc4){return _0x5e3bc4[_0x9dc2('0x25')](_0x55c155)[_0x9dc2('0x26')](function(_0x8e967c){return _0x8e967c;});}return null;};}function removeEntity(_0x29cce0,_0x15e3e7){return function(_0x5430db){if(_0x5430db){return _0x5430db['destroy']()[_0x9dc2('0x26')](function(){_0x29cce0[_0x9dc2('0x1a')](0xcc)[_0x9dc2('0x1b')]();});}};}function handleEntityNotFound(_0x13c7df,_0x54efe8){return function(_0x34db91){if(!_0x34db91){_0x13c7df[_0x9dc2('0x19')](0x194);}return _0x34db91;};}function handleError(_0x1ff80f,_0x443d9c){_0x443d9c=_0x443d9c||0x1f4;return function(_0x119e01){logger['error'](_0x119e01[_0x9dc2('0x27')]);if(_0x119e01[_0x9dc2('0x28')]){delete _0x119e01[_0x9dc2('0x28')];}_0x1ff80f[_0x9dc2('0x1a')](_0x443d9c)[_0x9dc2('0x29')](_0x119e01);};}var utilLicense=require(_0x9dc2('0x17'));exports[_0x9dc2('0x2a')]=function(_0x1a1a55,_0x5e2d30){var _0x185592={'raw':!![],'where':{'id':0x1}},_0x4a9160={};_0x4a9160[_0x9dc2('0x2b')]=_[_0x9dc2('0x2c')](db[_0x9dc2('0x2d')]['rawAttributes']);_0x4a9160[_0x9dc2('0x2e')]=_[_0x9dc2('0x2c')](_0x1a1a55['query']);_0x4a9160['filters']=_[_0x9dc2('0x2f')](_0x4a9160[_0x9dc2('0x2b')],_0x4a9160[_0x9dc2('0x2e')]);_0x185592[_0x9dc2('0x30')]=_[_0x9dc2('0x2f')](_0x4a9160[_0x9dc2('0x2b')],qs[_0x9dc2('0x31')](_0x1a1a55['query'][_0x9dc2('0x31')]));_0x185592['attributes']=_0x185592[_0x9dc2('0x30')][_0x9dc2('0x32')]?_0x185592[_0x9dc2('0x30')]:_0x4a9160['model'];_0x185592=_[_0x9dc2('0x33')]({},_0x185592,_0x1a1a55[_0x9dc2('0x34')]);return utilLicense['getLicense'](_0x185592)[_0x9dc2('0x26')](respondWithResult(_0x5e2d30,null))[_0x9dc2('0x35')](handleError(_0x5e2d30,null));};exports['update']=function(_0x38e762,_0x4aa7){if(_0x38e762[_0x9dc2('0x36')]['id']){delete _0x38e762[_0x9dc2('0x36')]['id'];}return db[_0x9dc2('0x2d')][_0x9dc2('0x37')]({'where':{'id':_0x38e762[_0x9dc2('0x38')]['id']}})[_0x9dc2('0x26')](handleEntityNotFound(_0x4aa7,null))[_0x9dc2('0x26')](function(_0x2dbbe6){var _0x5e3dac=_0x2dbbe6['get']({'plain':!![]});return utilLicense['checkLicense'](_0x5e3dac,_0x38e762[_0x9dc2('0x36')]['key']);})['then'](function(_0x9d03a5){if(!_0x9d03a5[_0x9dc2('0x39')]){return saveUpdates(_0x38e762[_0x9dc2('0x36')],null);}return _0x9d03a5;})[_0x9dc2('0x26')](respondWithResult(_0x4aa7,null))['catch'](handleError(_0x4aa7,null));};exports['downloadLogFile']=function(_0x49d413,_0x2d288b){var _0x3f29e2=_0x9dc2('0x3a');var _0x4dc19c=path['join']('/var',_0x9dc2('0x3b'),_0x9dc2('0x3c'),_0x3f29e2);_0x2d288b[_0x9dc2('0x3d')]('Content-disposition','attachment;\x20filename='+_0x3f29e2);_0x2d288b['set']('Content-Type',_0x9dc2('0x3e'));_0x2d288b['download'](_0x4dc19c);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index fddaa65..f1d9826 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 _0xf258=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./license.attributes','exports','define','license'];(function(_0x3b6b31,_0x3b5da6){var _0xb66c27=function(_0x5e7e0b){while(--_0x5e7e0b){_0x3b6b31['push'](_0x3b6b31['shift']());}};_0xb66c27(++_0x3b5da6);}(_0xf258,0x172));var _0x8f25=function(_0x2ff2c5,_0x57d87c){_0x2ff2c5=_0x2ff2c5-0x0;var _0x9b8fd3=_0xf258[_0x2ff2c5];return _0x9b8fd3;};'use strict';var _=require(_0x8f25('0x0'));var util=require(_0x8f25('0x1'));var logger=require(_0x8f25('0x2'))('api');var moment=require(_0x8f25('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8f25('0x5'));var attributes=require(_0x8f25('0x6'));module[_0x8f25('0x7')]=function(_0x4954c6,_0x569a0e){return _0x4954c6[_0x8f25('0x8')]('License',attributes,{'tableName':_0x8f25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b35=['rimraf','../../config/environment','exports','define','license','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3a1b11,_0x4a8bd5){var _0x420e78=function(_0x4dc2f3){while(--_0x4dc2f3){_0x3a1b11['push'](_0x3a1b11['shift']());}};_0x420e78(++_0x4a8bd5);}(_0x5b35,0x1d3));var _0x55b3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5b35[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x55b3('0x0'));var logger=require(_0x55b3('0x1'))('api');var moment=require(_0x55b3('0x2'));var BPromise=require(_0x55b3('0x3'));var rp=require(_0x55b3('0x4'));var fs=require('fs');var path=require(_0x55b3('0x5'));var rimraf=require(_0x55b3('0x6'));var config=require(_0x55b3('0x7'));var attributes=require('./license.attributes');module[_0x55b3('0x8')]=function(_0x2d5206,_0x44076c){return _0x2d5206[_0x55b3('0x9')]('License',attributes,{'tableName':_0x55b3('0xa'),'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 511bee0..c5b7f74 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 _0x5d22=['code','message','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x5be8ab,_0x4000a6){var _0x35914d=function(_0x5c5e05){while(--_0x5c5e05){_0x5be8ab['push'](_0x5be8ab['shift']());}};_0x35914d(++_0x4000a6);}(_0x5d22,0x146));var _0x25d2=function(_0x190481,_0x25e749){_0x190481=_0x190481-0x0;var _0x50eba7=_0x5d22[_0x190481];return _0x50eba7;};'use strict';var _=require('lodash');var util=require(_0x25d2('0x0'));var moment=require(_0x25d2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25d2('0x2'));var db=require(_0x25d2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x25d2('0x4'))(_0x25d2('0x5'));var config=require(_0x25d2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x25d2('0x7')][_0x25d2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x553321,_0x474b8e,_0x5e3a0e){return new BPromise(function(_0x5cf1b1,_0x18d8af){return client[_0x25d2('0x9')](_0x553321,_0x5e3a0e)['then'](function(_0x439219){logger[_0x25d2('0xa')](_0x25d2('0xb'),_0x474b8e,_0x25d2('0xc'));logger[_0x25d2('0xd')](_0x25d2('0xe'),_0x474b8e,_0x25d2('0xc'),JSON['stringify'](_0x439219));if(_0x439219[_0x25d2('0xf')]){if(_0x439219[_0x25d2('0xf')][_0x25d2('0x10')]===0x1f4){logger[_0x25d2('0xf')](_0x25d2('0xb'),_0x474b8e,_0x439219['error']['message']);return _0x18d8af(_0x439219[_0x25d2('0xf')][_0x25d2('0x11')]);}logger[_0x25d2('0xf')](_0x25d2('0xb'),_0x474b8e,_0x439219[_0x25d2('0xf')][_0x25d2('0x11')]);return _0x5cf1b1(_0x439219[_0x25d2('0xf')][_0x25d2('0x11')]);}else{logger[_0x25d2('0xa')](_0x25d2('0xb'),_0x474b8e,_0x25d2('0xc'));_0x5cf1b1(_0x439219['result'][_0x25d2('0x11')]);}})[_0x25d2('0x12')](function(_0x2762c3){logger[_0x25d2('0xf')](_0x25d2('0xb'),_0x474b8e,_0x2762c3);_0x18d8af(_0x2762c3);});});} \ No newline at end of file +var _0x8e50=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x357366,_0x18b9d1){var _0x254ded=function(_0x2e7355){while(--_0x2e7355){_0x357366['push'](_0x357366['shift']());}};_0x254ded(++_0x18b9d1);}(_0x8e50,0x87));var _0x08e5=function(_0x2b9825,_0x2548db){_0x2b9825=_0x2b9825-0x0;var _0x5bb660=_0x8e50[_0x2b9825];return _0x5bb660;};'use strict';var _=require(_0x08e5('0x0'));var util=require(_0x08e5('0x1'));var moment=require(_0x08e5('0x2'));var BPromise=require(_0x08e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08e5('0x4'));var db=require(_0x08e5('0x5'))['db'];var utils=require(_0x08e5('0x6'));var logger=require(_0x08e5('0x7'))(_0x08e5('0x8'));var config=require('../../config/environment');var jayson=require(_0x08e5('0x9'));var client=jayson[_0x08e5('0xa')][_0x08e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f6e0d,_0x59c67a,_0x4da83f){return new BPromise(function(_0x350f99,_0x3e75f8){return client[_0x08e5('0xc')](_0x1f6e0d,_0x4da83f)[_0x08e5('0xd')](function(_0x1d8577){logger[_0x08e5('0xe')](_0x08e5('0xf'),_0x59c67a,_0x08e5('0x10'));logger['debug'](_0x08e5('0x11'),_0x59c67a,_0x08e5('0x10'),JSON[_0x08e5('0x12')](_0x1d8577));if(_0x1d8577[_0x08e5('0x13')]){if(_0x1d8577[_0x08e5('0x13')][_0x08e5('0x14')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x59c67a,_0x1d8577[_0x08e5('0x13')][_0x08e5('0x15')]);return _0x3e75f8(_0x1d8577[_0x08e5('0x13')]['message']);}logger[_0x08e5('0x13')]('License,\x20%s,\x20%s',_0x59c67a,_0x1d8577[_0x08e5('0x13')][_0x08e5('0x15')]);return _0x350f99(_0x1d8577[_0x08e5('0x13')]['message']);}else{logger['info'](_0x08e5('0xf'),_0x59c67a,_0x08e5('0x10'));_0x350f99(_0x1d8577['result'][_0x08e5('0x15')]);}})[_0x08e5('0x16')](function(_0x19166b){logger[_0x08e5('0x13')](_0x08e5('0xf'),_0x59c67a,_0x19166b);_0x3e75f8(_0x19166b);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index e4b83a8..8377370 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 _0xab79=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','/:id/canned_answers','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','removeDispositions','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','Router','fs-extra'];(function(_0xc27f58,_0x2adc35){var _0x549f2a=function(_0x438059){while(--_0x438059){_0xc27f58['push'](_0xc27f58['shift']());}};_0x549f2a(++_0x2adc35);}(_0xab79,0xe1));var _0x9ab7=function(_0x55e953,_0x4cd84e){_0x55e953=_0x55e953-0x0;var _0x1047cc=_0xab79[_0x55e953];return _0x1047cc;};'use strict';var multer=require(_0x9ab7('0x0'));var util=require(_0x9ab7('0x1'));var path=require(_0x9ab7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9ab7('0x3')]();var fs_extra=require(_0x9ab7('0x4'));var auth=require(_0x9ab7('0x5'));var interaction=require(_0x9ab7('0x6'));var config=require(_0x9ab7('0x7'));var controller=require(_0x9ab7('0x8'));router[_0x9ab7('0x9')]('/',auth[_0x9ab7('0xa')](),controller[_0x9ab7('0xb')]);router[_0x9ab7('0x9')](_0x9ab7('0xc'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0xd')]);router[_0x9ab7('0x9')](_0x9ab7('0xe'),auth['isAuthenticated'](),controller[_0x9ab7('0xf')]);router[_0x9ab7('0x9')](_0x9ab7('0x10'),auth[_0x9ab7('0xa')](),controller['getDispositions']);router[_0x9ab7('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9ab7('0x11')]);router[_0x9ab7('0x9')](_0x9ab7('0x12'),auth['isAuthenticated'](),controller[_0x9ab7('0x13')]);router[_0x9ab7('0x9')](_0x9ab7('0x14'),auth['isAuthenticated'](),controller['getSmtp']);router[_0x9ab7('0x9')]('/:id/interactions',auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x15')]);router[_0x9ab7('0x9')](_0x9ab7('0x16'),auth['isAuthenticated'](),controller[_0x9ab7('0x17')]);router['get'](_0x9ab7('0x18'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x19')]);router[_0x9ab7('0x9')](_0x9ab7('0x1a'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x9ab7('0x9')](_0x9ab7('0x1b'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x1c')]);router[_0x9ab7('0x1d')](_0x9ab7('0x10'),auth[_0x9ab7('0xa')](),controller['addDisposition']);router[_0x9ab7('0x1d')](_0x9ab7('0x1e'),auth[_0x9ab7('0xa')](),controller['addAnswer']);router['post']('/',auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x1f')]);router[_0x9ab7('0x1d')](_0x9ab7('0x12'),auth['isAuthenticated'](),controller[_0x9ab7('0x20')]);router['post']('/:id/out_servers',auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x21')]);router[_0x9ab7('0x1d')](_0x9ab7('0x22'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x23')]);router[_0x9ab7('0x1d')](_0x9ab7('0x16'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x24')]);router[_0x9ab7('0x1d')](_0x9ab7('0x25'),auth['isAuthenticated'](),controller[_0x9ab7('0x26')]);router[_0x9ab7('0x1d')](_0x9ab7('0x1b'),auth[_0x9ab7('0xa')](),controller['addAgents']);router['put'](_0x9ab7('0xe'),auth[_0x9ab7('0xa')](),controller['update']);router['delete'](_0x9ab7('0x10'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x27')]);router[_0x9ab7('0x28')](_0x9ab7('0x1e'),auth[_0x9ab7('0xa')](),controller['removeAnswers']);router['delete'](_0x9ab7('0x12'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x29')]);router[_0x9ab7('0x28')](_0x9ab7('0x14'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x2a')]);router['delete'](_0x9ab7('0xe'),auth['isAuthenticated'](),controller[_0x9ab7('0x2b')]);router[_0x9ab7('0x28')](_0x9ab7('0x1b'),auth[_0x9ab7('0xa')](),controller[_0x9ab7('0x2c')]);module[_0x9ab7('0x2d')]=router; \ No newline at end of file +var _0xd15e=['verifySmtp','/:id/dispositions','addAnswer','post','create','addImap','addApplications','/:id/send','send','/:id/users','addAgents','put','update','removeDispositions','removeAnswers','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages'];(function(_0x468404,_0x3a34b1){var _0x3d94b1=function(_0x4afc4e){while(--_0x4afc4e){_0x468404['push'](_0x468404['shift']());}};_0x3d94b1(++_0x3a34b1);}(_0xd15e,0xd1));var _0xed15=function(_0x24273c,_0x55e945){_0x24273c=_0x24273c-0x0;var _0x3b0bba=_0xd15e[_0x24273c];return _0x3b0bba;};'use strict';var multer=require(_0xed15('0x0'));var util=require(_0xed15('0x1'));var path=require(_0xed15('0x2'));var timeout=require(_0xed15('0x3'));var express=require('express');var router=express[_0xed15('0x4')]();var fs_extra=require(_0xed15('0x5'));var auth=require(_0xed15('0x6'));var interaction=require(_0xed15('0x7'));var config=require(_0xed15('0x8'));var controller=require(_0xed15('0x9'));router['get']('/',auth[_0xed15('0xa')](),controller['index']);router[_0xed15('0xb')](_0xed15('0xc'),auth[_0xed15('0xa')](),controller[_0xed15('0xd')]);router['get'](_0xed15('0xe'),auth[_0xed15('0xa')](),controller[_0xed15('0xf')]);router[_0xed15('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xed15('0x10')]);router[_0xed15('0xb')]('/:id/canned_answers',auth[_0xed15('0xa')](),controller['getAnswers']);router['get'](_0xed15('0x11'),auth[_0xed15('0xa')](),controller[_0xed15('0x12')]);router[_0xed15('0xb')](_0xed15('0x13'),auth[_0xed15('0xa')](),controller[_0xed15('0x14')]);router[_0xed15('0xb')](_0xed15('0x15'),auth[_0xed15('0xa')](),controller[_0xed15('0x16')]);router[_0xed15('0xb')](_0xed15('0x17'),auth[_0xed15('0xa')](),controller['getApplications']);router['get'](_0xed15('0x18'),auth[_0xed15('0xa')](),controller[_0xed15('0x19')]);router['get']('/:id/verify',auth[_0xed15('0xa')](),controller[_0xed15('0x1a')]);router[_0xed15('0xb')]('/:id/users',auth[_0xed15('0xa')](),controller['getAgents']);router['post'](_0xed15('0x1b'),auth[_0xed15('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xed15('0xa')](),controller[_0xed15('0x1c')]);router[_0xed15('0x1d')]('/',auth[_0xed15('0xa')](),controller[_0xed15('0x1e')]);router[_0xed15('0x1d')]('/:id/in_servers',auth[_0xed15('0xa')](),controller[_0xed15('0x1f')]);router[_0xed15('0x1d')](_0xed15('0x13'),auth[_0xed15('0xa')](),controller['addSmtp']);router[_0xed15('0x1d')](_0xed15('0x15'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xed15('0x1d')](_0xed15('0x17'),auth[_0xed15('0xa')](),controller[_0xed15('0x20')]);router[_0xed15('0x1d')](_0xed15('0x21'),auth[_0xed15('0xa')](),controller[_0xed15('0x22')]);router[_0xed15('0x1d')](_0xed15('0x23'),auth[_0xed15('0xa')](),controller[_0xed15('0x24')]);router[_0xed15('0x25')](_0xed15('0xe'),auth[_0xed15('0xa')](),controller[_0xed15('0x26')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xed15('0x27')]);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xed15('0x28')]);router[_0xed15('0x29')](_0xed15('0x11'),auth[_0xed15('0xa')](),controller[_0xed15('0x2a')]);router[_0xed15('0x29')](_0xed15('0x13'),auth[_0xed15('0xa')](),controller[_0xed15('0x2b')]);router[_0xed15('0x29')](_0xed15('0xe'),auth[_0xed15('0xa')](),controller[_0xed15('0x2c')]);router[_0xed15('0x29')](_0xed15('0x23'),auth['isAuthenticated'](),controller[_0xed15('0x2d')]);module[_0xed15('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 99a2830..5f3cc85 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 _0xc410=['sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','provider','custom','getDataValue'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0xc410,0x78));var _0x0c41=function(_0x5c5cfb,_0x856fe6){_0x5c5cfb=_0x5c5cfb-0x0;var _0xb89878=_0xc410[_0x5c5cfb];return _0xb89878;};'use strict';var Sequelize=require(_0x0c41('0x0'));module[_0x0c41('0x1')]={'description':{'type':Sequelize[_0x0c41('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0c41('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0c41('0x2')],'allowNull':![],'defaultValue':_0x0c41('0x4')},'fontSize':{'type':Sequelize[_0x0c41('0x5')](0x2)[_0x0c41('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0c41('0x7')],'defaultValue':function(){return _0x0c41('0x8');}},'notificationSound':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0c41('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0c41('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0c41('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0c41('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x0c41('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x0c41('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1931a0){if(!_0x1931a0)this[_0x0c41('0xa')](_0x0c41('0xb'),null);this[_0x0c41('0xa')](_0x0c41('0xc'),_0x1931a0);}},'provider':{'type':Sequelize[_0x0c41('0xd')](_0x0c41('0xe'),'hotmail',_0x0c41('0xf'),_0x0c41('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x0c41('0x11')))return _0x0c41('0x12');return this[_0x0c41('0x13')](_0x0c41('0x11'));},'set':function(_0x3edbbf){if(_0x3edbbf===_0x0c41('0x12'))_0x3edbbf=null;return this[_0x0c41('0xa')](_0x0c41('0x11'),_0x3edbbf);}}}; \ No newline at end of file +var _0xb4bb=['STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize'];(function(_0x8c3326,_0x4ece1b){var _0x1676d6=function(_0x7e4082){while(--_0x7e4082){_0x8c3326['push'](_0x8c3326['shift']());}};_0x1676d6(++_0x4ece1b);}(_0xb4bb,0xbd));var _0xbb4b=function(_0x5c47b5,_0x2bdbcd){_0x5c47b5=_0x5c47b5-0x0;var _0x204939=_0xb4bb[_0x5c47b5];return _0x204939;};'use strict';var Sequelize=require(_0xbb4b('0x0'));module['exports']={'description':{'type':Sequelize[_0xbb4b('0x1')]},'name':{'type':Sequelize[_0xbb4b('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xbb4b('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbb4b('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbb4b('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbb4b('0x1')],'allowNull':![],'defaultValue':_0xbb4b('0x3')},'fontSize':{'type':Sequelize[_0xbb4b('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbb4b('0x5')],'defaultValue':function(){return _0xbb4b('0x6');}},'notificationSound':{'type':Sequelize[_0xbb4b('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbb4b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xbb4b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb4b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbb4b('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbb4b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb4b('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xbb4b('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x44c9ab){if(!_0x44c9ab)this[_0xbb4b('0x8')](_0xbb4b('0x9'),null);this[_0xbb4b('0x8')](_0xbb4b('0xa'),_0x44c9ab);}},'provider':{'type':Sequelize[_0xbb4b('0xb')](_0xbb4b('0xc'),_0xbb4b('0xd'),_0xbb4b('0xe'),_0xbb4b('0xf')),'defaultValue':null,'get':function(){if(!this[_0xbb4b('0x10')](_0xbb4b('0x11')))return _0xbb4b('0x12');return this[_0xbb4b('0x10')]('provider');},'set':function(_0x5d5b29){if(_0x5d5b29===_0xbb4b('0x12'))_0x5d5b29=null;return this[_0xbb4b('0x8')](_0xbb4b('0x11'),_0x5d5b29);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 8c6f8df..5b7f8ad 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 _0x2963=['format','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','CmContact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','getSmtpOptions','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','bluebird','util','path','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','update','destroy','get','stack','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','modernAuthentication','CloudProviderId','pass','port','service','authentication','username','password','host','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','map','MailAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','name','include','rows','show','params','mandatoryDispositionPause','filters','includeAll','find','body','provider','custom','secure','catch','describe','create','getDispositions','Disposition','order','MailAccountId','options','findAll','ids','addAnswer','findOne','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailAccounts','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split'];(function(_0x3f2b65,_0x705325){var _0x1f29f5=function(_0x49c3dd){while(--_0x49c3dd){_0x3f2b65['push'](_0x3f2b65['shift']());}};_0x1f29f5(++_0x705325);}(_0x2963,0xef));var _0x3296=function(_0x3349f9,_0x3d98aa){_0x3349f9=_0x3349f9-0x0;var _0x45ef28=_0x2963[_0x3349f9];return _0x45ef28;};'use strict';var moment=require(_0x3296('0x0'));var BPromise=require(_0x3296('0x1'));var util=require(_0x3296('0x2'));var path=require(_0x3296('0x3'));var _=require(_0x3296('0x4'));var juice=require(_0x3296('0x5'));var Redis=require(_0x3296('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3296('0x7'));var config=require(_0x3296('0x8'));var db=require(_0x3296('0x9'))['db'];config[_0x3296('0xa')]=_[_0x3296('0xb')](config[_0x3296('0xa')],{'host':_0x3296('0xc'),'port':0x18eb});var socket=require(_0x3296('0xd'))(new Redis(config[_0x3296('0xa')]));require('./mailAccount.socket')[_0x3296('0xe')](socket);var jayson=require(_0x3296('0xf'));var client=jayson[_0x3296('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x208f61,_0xbc0bf6,_0x446818,_0x1de46f){return new BPromise(function(_0x3c1f27,_0x2de045){var _0x2c0cec=_0x1de46f||client;return _0x2c0cec['request'](_0x208f61,_0x446818)[_0x3296('0x11')](function(_0x44ff57){logger[_0x3296('0x12')]('MailAccount,\x20%s,\x20%s',_0xbc0bf6,_0x3296('0x13'));logger[_0x3296('0x14')](_0x3296('0x15'),_0xbc0bf6,_0x3296('0x13'),JSON[_0x3296('0x16')](_0x44ff57));if(_0x44ff57[_0x3296('0x17')]){if(_0x44ff57[_0x3296('0x17')][_0x3296('0x18')]===0x1f4){logger[_0x3296('0x17')](_0x3296('0x19'),_0xbc0bf6,_0x44ff57[_0x3296('0x17')][_0x3296('0x1a')]);return _0x2de045(_0x44ff57[_0x3296('0x17')][_0x3296('0x1a')]);}logger[_0x3296('0x17')](_0x3296('0x19'),_0xbc0bf6,_0x44ff57[_0x3296('0x17')][_0x3296('0x1a')]);return _0x3c1f27(_0x44ff57[_0x3296('0x17')][_0x3296('0x1a')]);}else{logger[_0x3296('0x12')](_0x3296('0x19'),_0xbc0bf6,'request\x20sent');_0x3c1f27(_0x44ff57[_0x3296('0x1b')]['message']);}})['catch'](function(_0x441709){logger[_0x3296('0x17')]('MailAccount,\x20%s,\x20%s',_0xbc0bf6,_0x441709);_0x2de045(_0x441709);});});}function respondWithStatusCode(_0x2ff980,_0x259d59){_0x259d59=_0x259d59||0xcc;return function(_0x1aa88b){if(_0x1aa88b){return _0x2ff980[_0x3296('0x1c')](_0x259d59);}return _0x2ff980['status'](_0x259d59)[_0x3296('0x1d')]();};}function respondWithResult(_0x5b057a,_0x40e493){_0x40e493=_0x40e493||0xc8;return function(_0x5ce2db){if(_0x5ce2db){return _0x5b057a['status'](_0x40e493)[_0x3296('0x1e')](_0x5ce2db);}};}function respondWithFilteredResult(_0x619f0e,_0x3a0be4){return function(_0x502e74){if(_0x502e74){var _0x3cc6b0=typeof _0x3a0be4['offset']===_0x3296('0x1f')&&typeof _0x3a0be4['limit']===_0x3296('0x1f');var _0x40c172=_0x502e74[_0x3296('0x20')];var _0x2d0322=_0x3cc6b0?0x0:_0x3a0be4['offset'];var _0x1aa6db=_0x3cc6b0?_0x502e74[_0x3296('0x20')]:_0x3a0be4[_0x3296('0x21')]+_0x3a0be4[_0x3296('0x22')];var _0x13d11e;if(_0x1aa6db>=_0x40c172){_0x1aa6db=_0x40c172;_0x13d11e=0xc8;}else{_0x13d11e=0xce;}_0x619f0e[_0x3296('0x23')](_0x13d11e);return _0x619f0e[_0x3296('0x24')](_0x3296('0x25'),_0x2d0322+'-'+_0x1aa6db+'/'+_0x40c172)[_0x3296('0x1e')](_0x502e74);}return null;};}function saveUpdates(_0x3ca1db){return function(_0x17f3b7){if(_0x17f3b7){return _0x17f3b7[_0x3296('0x26')](_0x3ca1db)['then'](function(_0x5a2e81){return _0x5a2e81;});}return null;};}function removeEntity(_0x310921){return function(_0x1c90d4){if(_0x1c90d4){return _0x1c90d4[_0x3296('0x27')]()[_0x3296('0x11')](function(){var _0x3b6b84=_0x1c90d4[_0x3296('0x28')]({'plain':!![]});var _0x506ce8='MailAccounts';return db['UserProfileResource'][_0x3296('0x27')]({'where':{'type':_0x506ce8,'resourceId':_0x3b6b84['id']}})[_0x3296('0x11')](function(){return _0x1c90d4;});})[_0x3296('0x11')](function(){_0x310921[_0x3296('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4355){return function(_0x4ff3a4){if(!_0x4ff3a4){_0x4b4355[_0x3296('0x1c')](0x194);}return _0x4ff3a4;};}function handleError(_0x43e669,_0x51ee76){_0x51ee76=_0x51ee76||0x1f4;return function(_0x1afe53){logger[_0x3296('0x17')](_0x1afe53[_0x3296('0x29')]);if(_0x1afe53['name']){delete _0x1afe53['name'];}_0x43e669[_0x3296('0x23')](_0x51ee76)[_0x3296('0x2a')](_0x1afe53);};}function getImapHost(_0x1985f3){switch(_0x1985f3){case _0x3296('0x2b'):return _0x3296('0x2c');case _0x3296('0x2d'):return _0x3296('0x2e');case _0x3296('0x2f'):return _0x3296('0x30');case _0x3296('0x31'):return _0x3296('0x32');}throw new Error(_0x3296('0x33'),_0x1985f3);}function getSmtpHost(_0x398e86){switch(_0x398e86){case'gmail':return'smtp.gmail.com';case'yahoo':return _0x3296('0x34');case _0x3296('0x2f'):return _0x3296('0x35');case _0x3296('0x31'):return _0x3296('0x36');}throw new Error(_0x3296('0x33'),_0x398e86);}function getAuthenticationOptions(_0x208478,_0x21aa51){var _0x10a113={};var _0x351a76={};if(_0x208478){_0x10a113[_0x3296('0x37')]=_0x351a76[_0x3296('0x37')]=_0x21aa51['username'];_0x10a113['password']=_0x351a76['pass']=_0x21aa51['password'];if(_0x21aa51[_0x3296('0x38')]){_0x10a113[_0x3296('0x38')]=_0x351a76['modernAuthentication']=!![];_0x10a113[_0x3296('0x39')]=_0x351a76[_0x3296('0x39')]=_0x21aa51[_0x3296('0x39')];_0x10a113['password']=_0x351a76[_0x3296('0x3a')]=null;}else{_0x10a113['CloudProviderId']=_0x351a76['CloudProviderId']=null;}_0x10a113['host']=getImapHost(_0x208478);_0x10a113[_0x3296('0x3b')]=0x3e1;_0x351a76['host']=getSmtpHost(_0x208478);_0x351a76[_0x3296('0x3b')]=0x24b;_0x351a76['secure']=![];_0x10a113['service']=_0x351a76[_0x3296('0x3c')]=null;}else{if(_0x21aa51[_0x3296('0x3d')]){_0x10a113[_0x3296('0x37')]=_0x351a76[_0x3296('0x37')]=_0x21aa51[_0x3296('0x3e')];_0x10a113[_0x3296('0x3f')]=_0x351a76[_0x3296('0x3a')]=_0x21aa51[_0x3296('0x3f')];}else{_0x10a113[_0x3296('0x3d')]=_0x351a76['authentication']=![];_0x10a113['user']=_0x351a76[_0x3296('0x37')]=null;_0x10a113['password']=_0x351a76[_0x3296('0x3a')]=null;}_0x10a113[_0x3296('0x40')]=_0x21aa51[_0x3296('0x41')]['host'];_0x10a113[_0x3296('0x3b')]=_0x21aa51[_0x3296('0x41')][_0x3296('0x3b')];_0x351a76[_0x3296('0x40')]=_0x21aa51[_0x3296('0x42')][_0x3296('0x40')];_0x351a76['port']=_0x21aa51[_0x3296('0x42')][_0x3296('0x3b')];}return{'Imap':_0x10a113,'Smtp':_0x351a76};}exports[_0x3296('0x43')]=function(_0x8eb27c,_0x4460cf){var _0x4b5e34={'include':[{'model':db[_0x3296('0x44')],'as':_0x3296('0x41')},{'model':db[_0x3296('0x45')],'as':'Smtp'},{'model':db[_0x3296('0x46')],'as':'mandatoryDispositionPause'}]},_0x28ec9f={},_0x2d8f7e={'count':0x0,'rows':[]};var _0x2e0401=_[_0x3296('0x47')](db[_0x3296('0x48')][_0x3296('0x49')],function(_0x48ed8a){return{'name':_0x48ed8a['fieldName'],'type':_0x48ed8a[_0x3296('0x4a')][_0x3296('0x4b')]};});_0x28ec9f['model']=_[_0x3296('0x47')](_0x2e0401,'name');_0x28ec9f[_0x3296('0x4c')]=_[_0x3296('0x4d')](_0x8eb27c[_0x3296('0x4c')]);_0x28ec9f['filters']=_[_0x3296('0x4e')](_0x28ec9f[_0x3296('0x4f')],_0x28ec9f['query']);_0x4b5e34[_0x3296('0x50')]=_['intersection'](_0x28ec9f[_0x3296('0x4f')],qs[_0x3296('0x51')](_0x8eb27c['query']['fields']));_0x4b5e34[_0x3296('0x50')]=_0x4b5e34[_0x3296('0x50')][_0x3296('0x52')]?_0x4b5e34['attributes']:_0x28ec9f[_0x3296('0x4f')];if(!_0x8eb27c['query'][_0x3296('0x53')](_0x3296('0x54'))){_0x4b5e34[_0x3296('0x22')]=qs[_0x3296('0x22')](_0x8eb27c[_0x3296('0x4c')][_0x3296('0x22')]);_0x4b5e34[_0x3296('0x21')]=qs[_0x3296('0x21')](_0x8eb27c['query'][_0x3296('0x21')]);}_0x4b5e34['order']=qs['sort'](_0x8eb27c[_0x3296('0x4c')][_0x3296('0x55')]);_0x4b5e34[_0x3296('0x56')]=qs['filters'](_[_0x3296('0x57')](_0x8eb27c[_0x3296('0x4c')],_0x28ec9f['filters']),_0x2e0401);if(_0x8eb27c[_0x3296('0x4c')][_0x3296('0x58')]){_0x4b5e34[_0x3296('0x56')]=_[_0x3296('0x59')](_0x4b5e34[_0x3296('0x56')],{'$or':_['map'](_0x2e0401,function(_0x3789ce){if(_0x3789ce[_0x3296('0x4a')]!=='VIRTUAL'){var _0x5297e9={};_0x5297e9[_0x3789ce[_0x3296('0x5a')]]={'$like':'%'+_0x8eb27c['query'][_0x3296('0x58')]+'%'};return _0x5297e9;}})});}_0x4b5e34=_['merge']({},_0x4b5e34,_0x8eb27c['options']);var _0x2ac357={'where':_0x4b5e34[_0x3296('0x56')]};return db[_0x3296('0x48')][_0x3296('0x20')](_0x2ac357)[_0x3296('0x11')](function(_0x5d5c2b){_0x2d8f7e[_0x3296('0x20')]=_0x5d5c2b;if(_0x8eb27c[_0x3296('0x4c')]['includeAll']){_0x4b5e34[_0x3296('0x5b')]=[{'all':!![]}];}return db[_0x3296('0x48')]['findAll'](_0x4b5e34);})[_0x3296('0x11')](function(_0x2757b8){_0x2d8f7e[_0x3296('0x5c')]=_0x2757b8;return _0x2d8f7e;})[_0x3296('0x11')](respondWithFilteredResult(_0x4460cf,_0x4b5e34))['catch'](handleError(_0x4460cf,null));};exports[_0x3296('0x5d')]=function(_0x7cb5ff,_0x588844){var _0x1e8fa4={'raw':![],'where':{'id':_0x7cb5ff[_0x3296('0x5e')]['id']},'include':[{'model':db[_0x3296('0x44')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x3296('0x42')},{'model':db[_0x3296('0x46')],'as':_0x3296('0x5f')}]},_0x288f25={};_0x288f25[_0x3296('0x4f')]=_[_0x3296('0x4d')](db[_0x3296('0x48')][_0x3296('0x49')]);_0x288f25[_0x3296('0x4c')]=_['keys'](_0x7cb5ff['query']);_0x288f25[_0x3296('0x60')]=_[_0x3296('0x4e')](_0x288f25[_0x3296('0x4f')],_0x288f25[_0x3296('0x4c')]);_0x1e8fa4[_0x3296('0x50')]=_['intersection'](_0x288f25[_0x3296('0x4f')],qs[_0x3296('0x51')](_0x7cb5ff[_0x3296('0x4c')][_0x3296('0x51')]));_0x1e8fa4[_0x3296('0x50')]=_0x1e8fa4['attributes'][_0x3296('0x52')]?_0x1e8fa4[_0x3296('0x50')]:_0x288f25[_0x3296('0x4f')];if(_0x7cb5ff[_0x3296('0x4c')][_0x3296('0x61')]){_0x1e8fa4[_0x3296('0x5b')]=[{'all':!![]}];}_0x1e8fa4=_['merge']({},_0x1e8fa4,_0x7cb5ff['options']);return db[_0x3296('0x48')][_0x3296('0x62')](_0x1e8fa4)[_0x3296('0x11')](handleEntityNotFound(_0x588844,null))['then'](respondWithResult(_0x588844,null))['catch'](handleError(_0x588844,null));};exports[_0x3296('0x26')]=function(_0x299902,_0x492dee){if(_0x299902['body']['id']){delete _0x299902[_0x3296('0x63')]['id'];}var _0x2a066c=_0x299902[_0x3296('0x63')][_0x3296('0x64')]===_0x3296('0x65')?null:_0x299902['body'][_0x3296('0x64')];var _0x3743c4=_0x299902[_0x3296('0x63')][_0x3296('0x41')]||{};var _0x5584c3=_0x299902['body'][_0x3296('0x42')]||{};if(_0x2a066c){_0x3743c4[_0x3296('0x40')]=getImapHost(_0x2a066c);_0x3743c4[_0x3296('0x3b')]=0x3e1;_0x5584c3['host']=getSmtpHost(_0x2a066c);_0x5584c3['port']=0x24b;_0x5584c3[_0x3296('0x66')]=![];}if(_0x5584c3[_0x3296('0x38')]){_0x5584c3[_0x3296('0x66')]=![];}else{_0x5584c3[_0x3296('0x39')]=null;}if(!_0x3743c4[_0x3296('0x38')])_0x3743c4[_0x3296('0x39')]=null;_0x299902[_0x3296('0x63')]['Imap']=_0x3743c4;_0x299902[_0x3296('0x63')][_0x3296('0x42')]=_0x5584c3;return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x299902['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x3296('0x41')},{'model':db[_0x3296('0x45')],'as':'Smtp'},{'model':db[_0x3296('0x46')],'as':_0x3296('0x5f')}]})[_0x3296('0x11')](handleEntityNotFound(_0x492dee,null))[_0x3296('0x11')](function(_0x78ed49){if(!_0x78ed49)throw new Error('Mail\x20Account\x20not\x20found');if(_0x78ed49[_0x3296('0x3c')])delete _0x299902[_0x3296('0x63')][_0x3296('0x41')];return _0x78ed49;})[_0x3296('0x11')](saveUpdates(_0x299902[_0x3296('0x63')],null))['then'](function(_0x3049e0){if(!_0x299902[_0x3296('0x63')][_0x3296('0x41')])return _0x3049e0;return db['MailServerIn'][_0x3296('0x26')](_0x299902[_0x3296('0x63')][_0x3296('0x41')],{'where':{'MailAccountId':_0x3049e0['id']}})[_0x3296('0x11')](function(){return _0x3049e0;});})[_0x3296('0x11')](function(_0x456939){if(!_0x299902['body'][_0x3296('0x42')])return _0x456939;return db[_0x3296('0x45')][_0x3296('0x26')](_0x299902[_0x3296('0x63')][_0x3296('0x42')],{'where':{'MailAccountId':_0x456939['id']}})['then'](function(){return _0x456939;});})['then'](respondWithResult(_0x492dee,null))[_0x3296('0x67')](handleError(_0x492dee,null));};exports[_0x3296('0x68')]=function(_0x511eeb,_0x4bb188){return db['MailAccount'][_0x3296('0x68')]()[_0x3296('0x11')](respondWithResult(_0x4bb188,null))[_0x3296('0x67')](handleError(_0x4bb188,null));};exports['addDisposition']=function(_0x586d07,_0x290b81){if(_0x586d07[_0x3296('0x63')]['id']){delete _0x586d07[_0x3296('0x63')]['id'];}return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x586d07[_0x3296('0x5e')]['id']}})['then'](handleEntityNotFound(_0x290b81,null))[_0x3296('0x11')](function(_0x1ea6a3){if(_0x1ea6a3){_0x586d07[_0x3296('0x63')]['MailAccountId']=_0x1ea6a3['id'];return db['Disposition'][_0x3296('0x69')](_0x586d07['body']);}})[_0x3296('0x11')](respondWithResult(_0x290b81,null))[_0x3296('0x67')](handleError(_0x290b81,null));};exports[_0x3296('0x6a')]=function(_0x23ad84,_0x800587){var _0x39054c={'raw':![],'where':{}};var _0x418350={};var _0x36beea={'count':0x0,'rows':[]};return db[_0x3296('0x48')]['findOne']({'where':{'id':_0x23ad84[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x800587,null))['then'](function(_0x3bb525){if(_0x3bb525){_0x418350['model']=_['keys'](db[_0x3296('0x6b')]['rawAttributes']);_0x418350[_0x3296('0x4c')]=_[_0x3296('0x4d')](_0x23ad84[_0x3296('0x4c')]);_0x418350[_0x3296('0x60')]=_[_0x3296('0x4e')](_0x418350[_0x3296('0x4f')],_0x418350[_0x3296('0x4c')]);_0x39054c[_0x3296('0x50')]=_[_0x3296('0x4e')](_0x418350[_0x3296('0x4f')],qs['fields'](_0x23ad84[_0x3296('0x4c')][_0x3296('0x51')]));_0x39054c['attributes']=_0x39054c['attributes'][_0x3296('0x52')]?_0x39054c['attributes']:_0x418350['model'];if(!_0x23ad84[_0x3296('0x4c')]['hasOwnProperty'](_0x3296('0x54'))){_0x39054c[_0x3296('0x22')]=qs[_0x3296('0x22')](_0x23ad84[_0x3296('0x4c')][_0x3296('0x22')]);_0x39054c[_0x3296('0x21')]=qs[_0x3296('0x21')](_0x23ad84[_0x3296('0x4c')]['offset']);}_0x39054c[_0x3296('0x6c')]=qs['sort'](_0x23ad84[_0x3296('0x4c')][_0x3296('0x55')]);_0x39054c[_0x3296('0x56')]=qs['filters'](_[_0x3296('0x57')](_0x23ad84[_0x3296('0x4c')],_0x418350['filters']));_0x39054c[_0x3296('0x56')][_0x3296('0x6d')]=_0x3bb525['id'];if(_0x23ad84[_0x3296('0x4c')][_0x3296('0x58')]){_0x39054c[_0x3296('0x56')]=_[_0x3296('0x59')](_0x39054c[_0x3296('0x56')],{'$or':_['map'](_0x39054c['attributes'],function(_0x3f641a){var _0x53a1a5={};_0x53a1a5[_0x3f641a]={'$like':'%'+_0x23ad84[_0x3296('0x4c')][_0x3296('0x58')]+'%'};return _0x53a1a5;})});}_0x39054c=_[_0x3296('0x59')]({},_0x39054c,_0x23ad84[_0x3296('0x6e')]);return db['Disposition'][_0x3296('0x20')]({'where':_0x39054c[_0x3296('0x56')]})[_0x3296('0x11')](function(_0x48c4f2){_0x36beea['count']=_0x48c4f2;if(_0x23ad84[_0x3296('0x4c')]['includeAll']){_0x39054c[_0x3296('0x5b')]=[{'all':!![]}];}return db[_0x3296('0x6b')][_0x3296('0x6f')](_0x39054c);})[_0x3296('0x11')](function(_0x3b8108){_0x36beea[_0x3296('0x5c')]=_0x3b8108;return _0x36beea;});}})[_0x3296('0x11')](respondWithFilteredResult(_0x800587,_0x39054c))[_0x3296('0x67')](handleError(_0x800587,null));};exports['removeDispositions']=function(_0x597257,_0xb0743c){return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x597257[_0x3296('0x5e')]['id']}})['then'](handleEntityNotFound(_0xb0743c,null))[_0x3296('0x11')](function(_0x26dcca){if(_0x26dcca){return _0x26dcca['removeDispositions'](_0x597257['query'][_0x3296('0x70')]);}})[_0x3296('0x11')](respondWithStatusCode(_0xb0743c,null))[_0x3296('0x67')](handleError(_0xb0743c,null));};exports[_0x3296('0x71')]=function(_0xee0ef2,_0x3d5292){if(_0xee0ef2[_0x3296('0x63')]['id']){delete _0xee0ef2[_0x3296('0x63')]['id'];}return db[_0x3296('0x48')]['find']({'where':{'id':_0xee0ef2[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x3d5292,null))[_0x3296('0x11')](function(_0xdf8721){if(_0xdf8721){_0xee0ef2['body']['MailAccountId']=_0xdf8721['id'];return db['CannedAnswer'][_0x3296('0x69')](_0xee0ef2[_0x3296('0x63')]);}})['then'](respondWithResult(_0x3d5292,null))[_0x3296('0x67')](handleError(_0x3d5292,null));};exports['getAnswers']=function(_0xdfea2e,_0x25147b){var _0x16551e={'raw':![],'where':{}};var _0x26324e={};var _0x274879={'count':0x0,'rows':[]};return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0xdfea2e[_0x3296('0x5e')]['id']}})['then'](handleEntityNotFound(_0x25147b,null))[_0x3296('0x11')](function(_0x137aa6){if(_0x137aa6){_0x26324e['model']=_[_0x3296('0x4d')](db[_0x3296('0x73')][_0x3296('0x49')]);_0x26324e[_0x3296('0x4c')]=_[_0x3296('0x4d')](_0xdfea2e[_0x3296('0x4c')]);_0x26324e[_0x3296('0x60')]=_['intersection'](_0x26324e[_0x3296('0x4f')],_0x26324e[_0x3296('0x4c')]);_0x16551e[_0x3296('0x50')]=_[_0x3296('0x4e')](_0x26324e[_0x3296('0x4f')],qs[_0x3296('0x51')](_0xdfea2e['query'][_0x3296('0x51')]));_0x16551e[_0x3296('0x50')]=_0x16551e[_0x3296('0x50')][_0x3296('0x52')]?_0x16551e[_0x3296('0x50')]:_0x26324e[_0x3296('0x4f')];if(!_0xdfea2e['query'][_0x3296('0x53')](_0x3296('0x54'))){_0x16551e[_0x3296('0x22')]=qs[_0x3296('0x22')](_0xdfea2e[_0x3296('0x4c')][_0x3296('0x22')]);_0x16551e[_0x3296('0x21')]=qs['offset'](_0xdfea2e[_0x3296('0x4c')][_0x3296('0x21')]);}_0x16551e[_0x3296('0x6c')]=qs['sort'](_0xdfea2e[_0x3296('0x4c')][_0x3296('0x55')]);_0x16551e[_0x3296('0x56')]=qs[_0x3296('0x60')](_[_0x3296('0x57')](_0xdfea2e[_0x3296('0x4c')],_0x26324e[_0x3296('0x60')]));_0x16551e['where'][_0x3296('0x6d')]=_0x137aa6['id'];if(_0xdfea2e[_0x3296('0x4c')]['filter']){_0x16551e[_0x3296('0x56')]=_['merge'](_0x16551e[_0x3296('0x56')],{'$or':_['map'](_0x16551e[_0x3296('0x50')],function(_0x371829){var _0x161dd1={};_0x161dd1[_0x371829]={'$like':'%'+_0xdfea2e[_0x3296('0x4c')][_0x3296('0x58')]+'%'};return _0x161dd1;})});}_0x16551e=_[_0x3296('0x59')]({},_0x16551e,_0xdfea2e[_0x3296('0x6e')]);return db[_0x3296('0x73')][_0x3296('0x20')]({'where':_0x16551e[_0x3296('0x56')]})[_0x3296('0x11')](function(_0x5af028){_0x274879['count']=_0x5af028;if(_0xdfea2e[_0x3296('0x4c')][_0x3296('0x61')]){_0x16551e[_0x3296('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3296('0x6f')](_0x16551e);})[_0x3296('0x11')](function(_0x2422e8){_0x274879[_0x3296('0x5c')]=_0x2422e8;return _0x274879;});}})[_0x3296('0x11')](respondWithFilteredResult(_0x25147b,_0x16551e))[_0x3296('0x67')](handleError(_0x25147b,null));};exports['removeAnswers']=function(_0x24ad47,_0x37e17c){return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x24ad47[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x37e17c,null))[_0x3296('0x11')](function(_0x478f74){if(_0x478f74){return _0x478f74[_0x3296('0x74')](_0x24ad47[_0x3296('0x4c')][_0x3296('0x70')]);}})['then'](respondWithStatusCode(_0x37e17c,null))[_0x3296('0x67')](handleError(_0x37e17c,null));};exports[_0x3296('0x69')]=function(_0x36e45c,_0x4be587){var _0x46944f={'name':_0x36e45c[_0x3296('0x63')][_0x3296('0x5a')],'key':_0x36e45c[_0x3296('0x63')][_0x3296('0x4b')],'provider':_0x36e45c[_0x3296('0x63')]['provider']===_0x3296('0x65')?null:_0x36e45c[_0x3296('0x63')][_0x3296('0x64')],'email':_0x36e45c['body'][_0x3296('0x75')],'ListId':_0x36e45c['body'][_0x3296('0x76')],'active':!_[_0x3296('0x77')](_0x36e45c[_0x3296('0x63')][_0x3296('0x78')])?_0x36e45c['body'][_0x3296('0x78')]:!![],'description':_0x36e45c['body'][_0x3296('0x79')]||null};var _0x572605=getAuthenticationOptions(_0x46944f[_0x3296('0x64')],_0x36e45c['body']);_0x46944f[_0x3296('0x41')]=_0x572605[_0x3296('0x41')];_0x46944f[_0x3296('0x42')]=_0x572605[_0x3296('0x42')];return db['MailAccount'][_0x3296('0x69')](_0x46944f,{'include':[{'model':db['MailServerOut'],'as':_0x3296('0x42')},{'model':db[_0x3296('0x44')],'as':_0x3296('0x41')}]})['then'](function(_0x2a9f58){var _0x15fd6c=_0x36e45c['user'][_0x3296('0x28')]({'plain':!![]});if(!_0x15fd6c)throw new Error(_0x3296('0x7a'));if(_0x15fd6c[_0x3296('0x7b')]===_0x3296('0x37')){var _0x1e4209=_0x2a9f58[_0x3296('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x3296('0x62')]({'where':{'name':_0x3296('0x7c'),'userProfileId':_0x15fd6c[_0x3296('0x7d')]},'raw':!![]})[_0x3296('0x11')](function(_0x2692bd){if(_0x2692bd&&_0x2692bd[_0x3296('0x7e')]===0x0){return db['UserProfileResource'][_0x3296('0x69')]({'name':_0x1e4209['name'],'resourceId':_0x1e4209['id'],'type':_0x2692bd[_0x3296('0x5a')],'sectionId':_0x2692bd['id']},{})[_0x3296('0x11')](function(){return _0x2a9f58;});}else{return _0x2a9f58;}})[_0x3296('0x67')](function(_0xaac18f){logger[_0x3296('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaac18f);throw _0xaac18f;});}return _0x2a9f58;})[_0x3296('0x11')](respondWithResult(_0x4be587,0xc9))[_0x3296('0x67')](handleError(_0x4be587,null));};exports['getImap']=function(_0x458665,_0x1d5a0c){return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0x458665[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x1d5a0c,null))[_0x3296('0x11')](function(_0x426725){if(_0x426725){return _0x426725[_0x3296('0x7f')]();}return null;})['then'](respondWithResult(_0x1d5a0c,null))['catch'](handleError(_0x1d5a0c,null));};exports['addImap']=function(_0x50b45f,_0x4760f9){if(_0x50b45f[_0x3296('0x63')]['id']){delete _0x50b45f[_0x3296('0x63')]['id'];}return db[_0x3296('0x48')]['find']({'where':{'id':_0x50b45f[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x4760f9,null))[_0x3296('0x11')](function(_0x5801a0){if(_0x5801a0){_0x50b45f[_0x3296('0x63')][_0x3296('0x6d')]=_0x5801a0['id'];return db[_0x3296('0x44')][_0x3296('0x69')](_0x50b45f['body']);}})[_0x3296('0x11')](respondWithResult(_0x4760f9,null))[_0x3296('0x67')](handleError(_0x4760f9,null));};exports[_0x3296('0x80')]=function(_0x1f3378,_0x1cce6e){return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0x1f3378[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x1cce6e,null))[_0x3296('0x11')](function(_0x5416e4){if(_0x5416e4){return _0x5416e4[_0x3296('0x81')](null);}return null;})[_0x3296('0x11')](respondWithStatusCode(_0x1cce6e,null))[_0x3296('0x67')](handleError(_0x1cce6e,null));};exports['getSmtp']=function(_0x148ad1,_0x586ac6){return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0x148ad1[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x586ac6,null))[_0x3296('0x11')](function(_0x331553){if(_0x331553){return _0x331553[_0x3296('0x82')]();}return null;})[_0x3296('0x11')](respondWithResult(_0x586ac6,null))[_0x3296('0x67')](handleError(_0x586ac6,null));};exports[_0x3296('0x83')]=function(_0x8dda6b,_0x4abc83){if(_0x8dda6b[_0x3296('0x63')]['id']){delete _0x8dda6b[_0x3296('0x63')]['id'];}return db[_0x3296('0x48')]['find']({'where':{'id':_0x8dda6b['params']['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x4abc83,null))['then'](function(_0x5a6488){if(_0x5a6488){_0x8dda6b[_0x3296('0x63')][_0x3296('0x6d')]=_0x5a6488['id'];return db[_0x3296('0x45')][_0x3296('0x69')](_0x8dda6b['body']);}})['then'](respondWithResult(_0x4abc83,null))[_0x3296('0x67')](handleError(_0x4abc83,null));};exports[_0x3296('0x84')]=function(_0x4eff01,_0x50be4e){return db['MailAccount'][_0x3296('0x72')]({'where':{'id':_0x4eff01[_0x3296('0x5e')]['id']}})['then'](handleEntityNotFound(_0x50be4e,null))['then'](function(_0x2a5197){if(_0x2a5197){return _0x2a5197[_0x3296('0x85')](null);}return null;})[_0x3296('0x11')](respondWithStatusCode(_0x50be4e,null))[_0x3296('0x67')](handleError(_0x50be4e,null));};exports[_0x3296('0x86')]=function(_0x43afc5,_0x265e3b){return db[_0x3296('0x87')][_0x3296('0x62')]({'where':{'id':_0x43afc5['params']['id']}})['then'](handleEntityNotFound(_0x265e3b,null))[_0x3296('0x11')](function(_0x40587e){if(_0x40587e){return _0x40587e[_0x3296('0x86')](_0x43afc5[_0x3296('0x63')][_0x3296('0x70')],_['omit'](_0x43afc5['body'],[_0x3296('0x70'),'id'])||{});}})[_0x3296('0x11')](respondWithResult(_0x265e3b,null))['catch'](handleError(_0x265e3b,null));};exports[_0x3296('0x88')]=function(_0x109fe8,_0x448560){var _0x598574={'raw':![],'where':{}};var _0xf9767f={};var _0x33c36d={'count':0x0,'rows':[]};return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0x109fe8['params']['id']}})['then'](handleEntityNotFound(_0x448560,null))[_0x3296('0x11')](function(_0x1c4e89){if(_0x1c4e89){_0xf9767f[_0x3296('0x4f')]=_[_0x3296('0x4d')](db[_0x3296('0x87')][_0x3296('0x49')]);_0xf9767f['query']=_[_0x3296('0x4d')](_0x109fe8['query']);_0xf9767f['filters']=_[_0x3296('0x4e')](_0xf9767f[_0x3296('0x4f')],_0xf9767f[_0x3296('0x4c')]);_0x598574['attributes']=_[_0x3296('0x4e')](_0xf9767f[_0x3296('0x4f')],qs['fields'](_0x109fe8[_0x3296('0x4c')][_0x3296('0x51')]));_0x598574[_0x3296('0x50')]=_0x598574[_0x3296('0x50')]['length']?_0x598574[_0x3296('0x50')]:_0xf9767f[_0x3296('0x4f')];if(!_0x109fe8[_0x3296('0x4c')][_0x3296('0x53')](_0x3296('0x54'))){_0x598574[_0x3296('0x22')]=qs[_0x3296('0x22')](_0x109fe8['query'][_0x3296('0x22')]);_0x598574[_0x3296('0x21')]=qs[_0x3296('0x21')](_0x109fe8[_0x3296('0x4c')][_0x3296('0x21')]);}_0x598574[_0x3296('0x6c')]=qs[_0x3296('0x55')](_0x109fe8[_0x3296('0x4c')]['sort']);_0x598574[_0x3296('0x56')]=qs[_0x3296('0x60')](_[_0x3296('0x57')](_0x109fe8[_0x3296('0x4c')],_0xf9767f['filters']));_0x598574[_0x3296('0x56')][_0x3296('0x6d')]=_0x1c4e89['id'];if(_0x109fe8[_0x3296('0x4c')]['filter']){_0x598574['where']=_[_0x3296('0x59')](_0x598574[_0x3296('0x56')],{'$or':_['map'](_0x598574[_0x3296('0x50')],function(_0x5dd8cc){var _0x30b1b3={};_0x30b1b3[_0x5dd8cc]={'$like':'%'+_0x109fe8[_0x3296('0x4c')][_0x3296('0x58')]+'%'};return _0x30b1b3;})});}_0x598574=_[_0x3296('0x59')]({},_0x598574,_0x109fe8[_0x3296('0x6e')]);return db[_0x3296('0x87')][_0x3296('0x20')]({'where':_0x598574[_0x3296('0x56')]})[_0x3296('0x11')](function(_0xedbd82){_0x33c36d[_0x3296('0x20')]=_0xedbd82;if(_0x109fe8[_0x3296('0x4c')][_0x3296('0x61')]){_0x598574['include']=[{'model':db['CmContact'],'as':_0x3296('0x89'),'required':![]},{'model':db['User'],'as':_0x3296('0x8a'),'attributes':['name',_0x3296('0x8b'),_0x3296('0x8c')],'required':![]},{'model':db[_0x3296('0x8d')],'as':'Tags','attributes':['id',_0x3296('0x5a'),_0x3296('0x8e')],'where':_0x109fe8['query']['tag']?{'id':_0x109fe8[_0x3296('0x4c')][_0x3296('0x8f')]}:undefined,'required':_0x109fe8[_0x3296('0x4c')][_0x3296('0x8f')]?!![]:![]}];}return db[_0x3296('0x87')][_0x3296('0x6f')](_0x598574);})[_0x3296('0x11')](function(_0x477749){_0x33c36d[_0x3296('0x5c')]=_0x477749;return _0x33c36d;});}})[_0x3296('0x11')](respondWithFilteredResult(_0x448560,_0x598574))['catch'](handleError(_0x448560,null));};exports['addApplications']=function addApplications(_0x315411,_0x409ebb){var _0x5c3711=_0x315411['params']['id'];var _0x30f507=_0x315411[_0x3296('0x63')];var _0x3cf639=0xc8;var _0x17686b=null;return db['sequelize'][_0x3296('0x90')]({'isolationLevel':db[_0x3296('0x91')][_0x3296('0x92')][_0x3296('0x93')][_0x3296('0x94')]},function(_0x4f7751){return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0x5c3711},'transaction':_0x4f7751})[_0x3296('0x11')](function(_0xd19f5b){if(_0xd19f5b){return db[_0x3296('0x95')]['destroy']({'where':{'MailAccountId':_0x5c3711},'transaction':_0x4f7751})[_0x3296('0x11')](function(){var _0x2c9fa1=_['map'](_0x30f507,function(_0x1fc98e){_0x1fc98e[_0x3296('0x6d')]=_0x5c3711;return _0x1fc98e;});return db[_0x3296('0x95')]['bulkCreate'](_0x2c9fa1,{'transaction':_0x4f7751});});}else{_0x3cf639=0x194;_0x17686b=[];}});})['then'](function(){if(_0x3cf639!==0x194){return db[_0x3296('0x95')][_0x3296('0x96')]({'where':{'MailAccountId':_0x5c3711},'order':_0x3296('0x97')})[_0x3296('0x11')](function(_0x2f3d91){_0x17686b=_0x2f3d91;});}})['catch'](function(_0x57409d){_0x3cf639=0x1f4;logger[_0x3296('0x17')](_0x57409d[_0x3296('0x29')]);if(_0x57409d[_0x3296('0x5a')]){delete _0x57409d[_0x3296('0x5a')];}_0x17686b=_0x57409d;})['finally'](function(){if(_0x17686b===null){_0x409ebb[_0x3296('0x1c')](_0x3cf639);}else{if(_0x3cf639===0x1f4){_0x409ebb[_0x3296('0x23')](_0x3cf639)[_0x3296('0x2a')](_0x17686b);}else{_0x409ebb[_0x3296('0x23')](_0x3cf639)[_0x3296('0x1e')](_0x17686b);}}});};exports[_0x3296('0x98')]=function(_0x18530f,_0x4d01db){var _0x5bb9cc={};var _0x319d4f={};var _0x63203a;var _0x24d06c;return db[_0x3296('0x48')]['findOne']({'where':{'id':_0x18530f[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x4d01db,null))['then'](function(_0x1c5417){if(_0x1c5417){_0x63203a=_0x1c5417;_0x319d4f['model']=_[_0x3296('0x4d')](db[_0x3296('0x95')][_0x3296('0x49')]);_0x319d4f[_0x3296('0x4c')]=_['keys'](_0x18530f[_0x3296('0x4c')]);_0x319d4f['filters']=_[_0x3296('0x4e')](_0x319d4f[_0x3296('0x4f')],_0x319d4f['query']);_0x5bb9cc[_0x3296('0x50')]=_[_0x3296('0x4e')](_0x319d4f['model'],qs[_0x3296('0x51')](_0x18530f[_0x3296('0x4c')][_0x3296('0x51')]));_0x5bb9cc[_0x3296('0x50')]=_0x5bb9cc['attributes'][_0x3296('0x52')]?_0x5bb9cc[_0x3296('0x50')]:_0x319d4f[_0x3296('0x4f')];_0x5bb9cc[_0x3296('0x6c')]=qs[_0x3296('0x55')](_0x18530f[_0x3296('0x4c')][_0x3296('0x55')]);_0x5bb9cc[_0x3296('0x56')]=qs[_0x3296('0x60')](_[_0x3296('0x57')](_0x18530f[_0x3296('0x4c')],_0x319d4f[_0x3296('0x60')]));if(_0x18530f[_0x3296('0x4c')][_0x3296('0x58')]){_0x5bb9cc[_0x3296('0x56')]=_[_0x3296('0x59')](_0x5bb9cc['where'],{'$or':_[_0x3296('0x47')](_0x5bb9cc[_0x3296('0x50')],function(_0x45fa52){var _0x18916b={};_0x18916b[_0x45fa52]={'$like':'%'+_0x18530f[_0x3296('0x4c')]['filter']+'%'};return _0x18916b;})});}_0x5bb9cc=_[_0x3296('0x59')]({},_0x5bb9cc,_0x18530f[_0x3296('0x6e')]);return _0x63203a[_0x3296('0x98')](_0x5bb9cc);}})['then'](function(_0x38cf8e){if(_0x38cf8e){_0x24d06c=_0x38cf8e[_0x3296('0x52')];if(!_0x18530f[_0x3296('0x4c')][_0x3296('0x53')](_0x3296('0x54'))){_0x5bb9cc[_0x3296('0x22')]=qs[_0x3296('0x22')](_0x18530f[_0x3296('0x4c')][_0x3296('0x22')]);_0x5bb9cc[_0x3296('0x21')]=qs['offset'](_0x18530f[_0x3296('0x4c')][_0x3296('0x21')]);}return _0x63203a[_0x3296('0x98')](_0x5bb9cc);}})[_0x3296('0x11')](function(_0x3b5862){if(_0x3b5862){return _0x3b5862?{'count':_0x24d06c,'rows':_0x3b5862}:null;}})['then'](respondWithResult(_0x4d01db,null))[_0x3296('0x67')](handleError(_0x4d01db,null));};exports[_0x3296('0x99')]=function(_0x5d99d3,_0x4d7980){var _0x467bbf={'raw':!![],'where':{}};var _0x1fb64f={};var _0x313a2c={'count':0x0,'rows':[]};return db[_0x3296('0x48')][_0x3296('0x72')]({'where':{'id':_0x5d99d3['params']['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x4d7980,null))[_0x3296('0x11')](function(_0x25a820){if(_0x25a820){_0x1fb64f[_0x3296('0x4f')]=_['keys'](db[_0x3296('0x9a')]['rawAttributes']);_0x1fb64f[_0x3296('0x4c')]=_['keys'](_0x5d99d3['query']);_0x1fb64f[_0x3296('0x60')]=_['intersection'](_0x1fb64f['model'],_0x1fb64f[_0x3296('0x4c')]);_0x467bbf['attributes']=_['intersection'](_0x1fb64f['model'],qs[_0x3296('0x51')](_0x5d99d3[_0x3296('0x4c')][_0x3296('0x51')]));_0x467bbf[_0x3296('0x50')]=_0x467bbf[_0x3296('0x50')][_0x3296('0x52')]?_0x467bbf[_0x3296('0x50')]:_0x1fb64f['model'];if(!_0x5d99d3['query']['hasOwnProperty'](_0x3296('0x54'))){_0x467bbf[_0x3296('0x22')]=qs[_0x3296('0x22')](_0x5d99d3[_0x3296('0x4c')][_0x3296('0x22')]);_0x467bbf[_0x3296('0x21')]=qs['offset'](_0x5d99d3[_0x3296('0x4c')][_0x3296('0x21')]);}_0x467bbf['order']=qs[_0x3296('0x55')](_0x5d99d3[_0x3296('0x4c')]['sort']);_0x467bbf['where']=qs[_0x3296('0x60')](_['pick'](_0x5d99d3['query'],_0x1fb64f[_0x3296('0x60')]));_0x467bbf[_0x3296('0x56')][_0x3296('0x6d')]=_0x25a820['id'];if(_0x5d99d3['query'][_0x3296('0x58')]){_0x467bbf[_0x3296('0x56')]=_[_0x3296('0x59')](_0x467bbf[_0x3296('0x56')],{'$or':_[_0x3296('0x47')](_0x467bbf[_0x3296('0x50')],function(_0x180433){var _0x1979d4={};_0x1979d4[_0x180433]={'$like':'%'+_0x5d99d3['query'][_0x3296('0x58')]+'%'};return _0x1979d4;})});}if(_0x5d99d3['query'][_0x3296('0x9b')]){var _0x4c811e=_0x5d99d3[_0x3296('0x4c')][_0x3296('0x9b')][_0x3296('0x9c')](',');var _0x32ddb9={};_0x32ddb9[_0x4c811e[0x0]]={'$gte':moment(_0x4c811e[0x1])[_0x3296('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x467bbf[_0x3296('0x56')]=_['merge'](_0x467bbf['where'],_0x32ddb9);}_0x467bbf=_[_0x3296('0x59')]({},_0x467bbf,_0x5d99d3['options']);return db[_0x3296('0x9a')]['count']({'where':_0x467bbf[_0x3296('0x56')]})[_0x3296('0x11')](function(_0x1c264b){_0x313a2c[_0x3296('0x20')]=_0x1c264b;if(_0x5d99d3[_0x3296('0x4c')][_0x3296('0x61')]){_0x467bbf['include']=[{'all':!![]}];}return db[_0x3296('0x9a')][_0x3296('0x6f')](_0x467bbf);})[_0x3296('0x11')](function(_0x97a7c5){if(_0x5d99d3[_0x3296('0x4c')][_0x3296('0x9e')]===_0x3296('0x9f')){for(var _0x39a02c=0x0;_0x39a02c<_0x97a7c5['length'];_0x39a02c++){_0x97a7c5[_0x39a02c][_0x3296('0x63')]=juice(_0x97a7c5[_0x39a02c][_0x3296('0x63')]);}}_0x313a2c[_0x3296('0x5c')]=_0x97a7c5;return _0x313a2c;});}})[_0x3296('0x11')](respondWithFilteredResult(_0x4d7980,_0x467bbf))[_0x3296('0x67')](handleError(_0x4d7980,null));};exports[_0x3296('0x2a')]=function(_0x437118,_0x2d6107){var _0x4c9624,_0x1c6218={},_0x780348;if(_0x437118[_0x3296('0x63')]['to']){_0x780348=_0x437118[_0x3296('0x63')]['to']['split'](',')[0x0];}return db[_0x3296('0x48')]['find']({'where':{'id':_0x437118[_0x3296('0x5e')]['id']},'include':[{'model':db[_0x3296('0xa0')],'as':_0x3296('0xa1'),'include':[{'model':db['CmContact'],'as':_0x3296('0xa2'),'where':{'email':_0x780348},'limit':0x1,'order':[[_0x3296('0xa3'),_0x3296('0xa4')]]}]},{'model':db[_0x3296('0x45')],'as':_0x3296('0x42'),'raw':!![],'include':[{'model':db[_0x3296('0xa5')],'as':_0x3296('0xa5'),'raw':!![]}]}]})[_0x3296('0x11')](handleEntityNotFound(_0x2d6107,null))['then'](function(_0x4750b2){if(!_0x4750b2)return;_0x4c9624=_0x4750b2;if(!_0x4750b2[_0x3296('0x42')])throw new Error(_0x3296('0xa6'));if(_[_0x3296('0x77')](_0x437118['body']['from'])){_0x437118[_0x3296('0x63')][_0x3296('0xa7')]=util['format'](_0x3296('0xa8'),_0x4750b2['name'],_0x4750b2[_0x3296('0x75')]||_0x4750b2[_0x3296('0x42')]['user']);}if(_0x437118[_0x3296('0x63')][_0x3296('0xa9')]&&_0x437118[_0x3296('0x63')][_0x3296('0xa9')][_0x3296('0x52')]){for(var _0x25c1e1=0x0;_0x25c1e1<_0x437118['body'][_0x3296('0xa9')][_0x3296('0x52')];_0x25c1e1+=0x1){_0x437118[_0x3296('0x63')][_0x3296('0xa9')][_0x25c1e1]={'filename':_0x437118['body'][_0x3296('0xa9')][_0x25c1e1][_0x3296('0x5a')],'path':path[_0x3296('0xaa')](config[_0x3296('0xab')],_0x3296('0xac'),_0x437118[_0x3296('0x63')][_0x3296('0xa9')][_0x25c1e1][_0x3296('0xad')])};}}var _0x5aa3b3=_0x4750b2['getSmtpOptions']();return respondWithRpcPromise(_0x3296('0xae'),_0x3296('0xaf'),{'account':_0x5aa3b3,'message':_0x437118['body']});})[_0x3296('0x11')](function(_0x537076){if(!_0x537076)return;_0x1c6218=_0x537076;if(!_0x4c9624[_0x3296('0xa1')])throw new Error(_0x3296('0xb0'));if(_0x4c9624[_0x3296('0xa1')][_0x3296('0xa2')][_0x3296('0x52')])return _0x4c9624[_0x3296('0xa1')]['Contacts'][0x0];return db[_0x3296('0xb1')]['create'](_[_0x3296('0xb')](_0x437118['body'],{'firstName':_0x437118[_0x3296('0x63')]['to'],'email':_0x437118[_0x3296('0x63')]['to'],'phone':_0x437118[_0x3296('0x63')]['to'],'ListId':_0x4c9624['ListId']}));})[_0x3296('0x11')](function(_0x4adaa7){if(!_0x4adaa7)return;var _0x3d3f00={'UserId':_0x437118[_0x3296('0x37')]['id'],'ContactId':_0x4adaa7['id'],'MailAccountId':_0x4c9624['id'],'inReplyTo':_0x1c6218[_0x3296('0xb2')],'to':_0x437118[_0x3296('0x63')][_0x3296('0xa7')],'cc':_0x437118[_0x3296('0x63')]['cc'],'subject':_0x437118['body'][_0x3296('0xb3')],'attach':_0x437118['body'][_0x3296('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x3296('0x9d')](_0x3296('0xb5')),'lastMsgDirection':_0x3296('0xb6'),'Messages':[_['merge'](_0x437118[_0x3296('0x63')],{'messageId':_0x1c6218[_0x3296('0xb2')],'sentAt':moment()['format'](_0x3296('0xb5')),'read':!![],'MailAccountId':_0x4c9624['id'],'UserId':_0x437118[_0x3296('0x37')]['id'],'ContactId':_0x4adaa7['id']})]};if(_0x437118[_0x3296('0x63')][_0x3296('0xb7')]){_0x3d3f00=_['merge'](_0x3d3f00,_0x437118[_0x3296('0x63')][_0x3296('0xb7')]);}return db['MailInteraction'][_0x3296('0x69')](_0x3d3f00,{'include':[{'model':db[_0x3296('0x9a')],'as':_0x3296('0xb8')}]});})['then'](respondWithResult(_0x2d6107,null))[_0x3296('0x67')](handleError(_0x2d6107,null));};exports[_0x3296('0xb9')]=function(_0x45d3c1,_0x95da23){return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x45d3c1[_0x3296('0x5e')]['id']},'include':[{'model':db[_0x3296('0x45')],'as':_0x3296('0x42'),'raw':!![],'include':[{'model':db[_0x3296('0xa5')],'as':_0x3296('0xa5'),'raw':!![]}]}]})[_0x3296('0x11')](handleEntityNotFound(_0x95da23,null))['then'](function(_0x534beb){if(!_0x534beb[_0x3296('0x42')])return;var _0x41c6cd=_0x534beb[_0x3296('0xba')]();return respondWithRpcPromise('VerifySmtp',_0x3296('0xb9'),{'account':_0x41c6cd});})[_0x3296('0x11')](respondWithResult(_0x95da23,null))[_0x3296('0x67')](handleError(_0x95da23,null));};exports['destroy']=function(_0x1f6ae3,_0x20373b){return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x1f6ae3[_0x3296('0x5e')]['id']}})['then'](handleEntityNotFound(_0x20373b,null))[_0x3296('0x11')](function(_0xe554c9){if(_0xe554c9&&_0xe554c9[_0x3296('0x3c')]){throw new db[(_0x3296('0xbb'))]['ValidationError'](_0x3296('0xbc'));}return _0xe554c9;})[_0x3296('0x11')](removeEntity(_0x20373b,null))[_0x3296('0x67')](handleError(_0x20373b,null));};exports[_0x3296('0xbd')]=function(_0x2ee748,_0x12832c){return db[_0x3296('0x48')][_0x3296('0x62')]({'where':{'id':_0x2ee748[_0x3296('0x5e')]['id']}})['then'](handleEntityNotFound(_0x12832c,null))[_0x3296('0x11')](function(_0x2e5d77){if(_0x2e5d77){return _0x2e5d77['addAgents'](_0x2ee748[_0x3296('0x63')][_0x3296('0x70')],_['omit'](_0x2ee748['body'],['ids','id'])||{})[_0x3296('0xbe')](function(_0x546792){for(var _0x535bbd=0x0;_0x535bbd<_0x2ee748[_0x3296('0x63')][_0x3296('0x70')][_0x3296('0x52')];_0x535bbd+=0x1){socket[_0x3296('0xbf')](_0x3296('0xc0'),{'UserId':Number(_0x2ee748[_0x3296('0x63')][_0x3296('0x70')][_0x535bbd]),'MailAccountId':Number(_0x2ee748[_0x3296('0x5e')]['id'])});}return _0x546792;});}})['then'](respondWithResult(_0x12832c,null))['catch'](handleError(_0x12832c,null));};exports[_0x3296('0xc1')]=function(_0x569af4,_0x5efa12){return db[_0x3296('0x48')]['find']({'where':{'id':_0x569af4['params']['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x5efa12,null))[_0x3296('0x11')](function(_0x47812a){if(_0x47812a){return _0x47812a[_0x3296('0xc1')](_0x569af4['query'][_0x3296('0x70')])[_0x3296('0x11')](function(){if(_[_0x3296('0xc2')](_0x569af4[_0x3296('0x4c')][_0x3296('0x70')])){for(var _0x154592=0x0;_0x154592<_0x569af4[_0x3296('0x4c')][_0x3296('0x70')][_0x3296('0x52')];_0x154592+=0x1){socket[_0x3296('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x569af4[_0x3296('0x4c')][_0x3296('0x70')][_0x154592]),'MailAccountId':Number(_0x569af4[_0x3296('0x5e')]['id'])});}}else{socket[_0x3296('0xbf')](_0x3296('0xc3'),{'UserId':Number(_0x569af4['query'][_0x3296('0x70')]),'MailAccountId':Number(_0x569af4[_0x3296('0x5e')]['id'])});}});}})[_0x3296('0x11')](respondWithStatusCode(_0x5efa12,null))['catch'](handleError(_0x5efa12,null));};exports[_0x3296('0xc4')]=function(_0x58c170,_0x5c4668){var _0x6bac98={};var _0x3fd061={};var _0x460353;var _0x45c34d;return db[_0x3296('0x48')]['findOne']({'where':{'id':_0x58c170[_0x3296('0x5e')]['id']}})[_0x3296('0x11')](handleEntityNotFound(_0x5c4668,null))[_0x3296('0x11')](function(_0x12123e){if(_0x12123e){_0x460353=_0x12123e;_0x3fd061[_0x3296('0x4f')]=_[_0x3296('0x4d')](db[_0x3296('0xc5')][_0x3296('0x49')]);_0x3fd061['query']=_[_0x3296('0x4d')](_0x58c170[_0x3296('0x4c')]);_0x3fd061['filters']=_['intersection'](_0x3fd061['model'],_0x3fd061[_0x3296('0x4c')]);_0x6bac98[_0x3296('0x50')]=_['intersection'](_0x3fd061[_0x3296('0x4f')],qs[_0x3296('0x51')](_0x58c170[_0x3296('0x4c')][_0x3296('0x51')]));_0x6bac98['attributes']=_0x6bac98[_0x3296('0x50')][_0x3296('0x52')]?_0x6bac98[_0x3296('0x50')]:_0x3fd061['model'];_0x6bac98[_0x3296('0x6c')]=qs['sort'](_0x58c170[_0x3296('0x4c')][_0x3296('0x55')]);_0x6bac98[_0x3296('0x56')]=qs[_0x3296('0x60')](_[_0x3296('0x57')](_0x58c170[_0x3296('0x4c')],_0x3fd061[_0x3296('0x60')]));if(_0x58c170[_0x3296('0x4c')][_0x3296('0x58')]){_0x6bac98[_0x3296('0x56')]=_[_0x3296('0x59')](_0x6bac98[_0x3296('0x56')],{'$or':_[_0x3296('0x47')](_0x6bac98[_0x3296('0x50')],function(_0x407339){var _0x10bb02={};_0x10bb02[_0x407339]={'$like':'%'+_0x58c170['query']['filter']+'%'};return _0x10bb02;})});}_0x6bac98=_[_0x3296('0x59')]({},_0x6bac98,_0x58c170[_0x3296('0x6e')]);return _0x460353[_0x3296('0xc4')](_0x6bac98);}})['then'](function(_0x493226){if(_0x493226){_0x45c34d=_0x493226[_0x3296('0x52')];if(!_0x58c170[_0x3296('0x4c')][_0x3296('0x53')]('nolimit')){_0x6bac98[_0x3296('0x22')]=qs[_0x3296('0x22')](_0x58c170[_0x3296('0x4c')][_0x3296('0x22')]);_0x6bac98[_0x3296('0x21')]=qs[_0x3296('0x21')](_0x58c170[_0x3296('0x4c')][_0x3296('0x21')]);}return _0x460353[_0x3296('0xc4')](_0x6bac98);}})[_0x3296('0x11')](function(_0x509e56){if(_0x509e56){return _0x509e56?{'count':_0x45c34d,'rows':_0x509e56}:null;}})[_0x3296('0x11')](respondWithResult(_0x5c4668,null))[_0x3296('0x67')](handleError(_0x5c4668,null));}; \ No newline at end of file +var _0xa3e9=['imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','MailAccount','findAll','rows','show','keys','length','include','find','update','body','provider','custom','params','describe','MailAccountId','Disposition','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','includeAll','removeAnswers','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','priority','stack','send','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','format','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','limit','offset','count','Content-Range','json','destroy','get','end','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail'];(function(_0x1ca95b,_0x2e3638){var _0x1cded7=function(_0x2f34c3){while(--_0x2f34c3){_0x1ca95b['push'](_0x1ca95b['shift']());}};_0x1cded7(++_0x2e3638);}(_0xa3e9,0x97));var _0x9a3e=function(_0x6a7a05,_0x39146d){_0x6a7a05=_0x6a7a05-0x0;var _0x27550f=_0xa3e9[_0x6a7a05];return _0x27550f;};'use strict';var moment=require(_0x9a3e('0x0'));var BPromise=require(_0x9a3e('0x1'));var util=require('util');var path=require(_0x9a3e('0x2'));var _=require('lodash');var juice=require(_0x9a3e('0x3'));var Redis=require(_0x9a3e('0x4'));var qs=require(_0x9a3e('0x5'));var logger=require(_0x9a3e('0x6'))(_0x9a3e('0x7'));var config=require(_0x9a3e('0x8'));var db=require(_0x9a3e('0x9'))['db'];config[_0x9a3e('0xa')]=_[_0x9a3e('0xb')](config['redis'],{'host':_0x9a3e('0xc'),'port':0x18eb});var socket=require(_0x9a3e('0xd'))(new Redis(config[_0x9a3e('0xa')]));require(_0x9a3e('0xe'))[_0x9a3e('0xf')](socket);var jayson=require(_0x9a3e('0x10'));var client=jayson[_0x9a3e('0x11')][_0x9a3e('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x36b50f,_0x212394,_0x476b4f,_0x5bcdec){return new BPromise(function(_0xf0eace,_0x293f92){var _0x4cce41=_0x5bcdec||client;return _0x4cce41[_0x9a3e('0x13')](_0x36b50f,_0x476b4f)[_0x9a3e('0x14')](function(_0x25c4b0){logger[_0x9a3e('0x15')](_0x9a3e('0x16'),_0x212394,'request\x20sent');logger[_0x9a3e('0x17')](_0x9a3e('0x18'),_0x212394,_0x9a3e('0x19'),JSON['stringify'](_0x25c4b0));if(_0x25c4b0[_0x9a3e('0x1a')]){if(_0x25c4b0[_0x9a3e('0x1a')]['code']===0x1f4){logger[_0x9a3e('0x1a')]('MailAccount,\x20%s,\x20%s',_0x212394,_0x25c4b0[_0x9a3e('0x1a')][_0x9a3e('0x1b')]);return _0x293f92(_0x25c4b0[_0x9a3e('0x1a')][_0x9a3e('0x1b')]);}logger[_0x9a3e('0x1a')](_0x9a3e('0x16'),_0x212394,_0x25c4b0[_0x9a3e('0x1a')]['message']);return _0xf0eace(_0x25c4b0['error'][_0x9a3e('0x1b')]);}else{logger[_0x9a3e('0x15')](_0x9a3e('0x16'),_0x212394,_0x9a3e('0x19'));_0xf0eace(_0x25c4b0['result'][_0x9a3e('0x1b')]);}})[_0x9a3e('0x1c')](function(_0x56c012){logger['error']('MailAccount,\x20%s,\x20%s',_0x212394,_0x56c012);_0x293f92(_0x56c012);});});}function respondWithStatusCode(_0x24889c,_0x590242){_0x590242=_0x590242||0xcc;return function(_0x4c7964){if(_0x4c7964){return _0x24889c[_0x9a3e('0x1d')](_0x590242);}return _0x24889c[_0x9a3e('0x1e')](_0x590242)['end']();};}function respondWithResult(_0x568ca3,_0x2e5c9f){_0x2e5c9f=_0x2e5c9f||0xc8;return function(_0x571ab1){if(_0x571ab1){return _0x568ca3[_0x9a3e('0x1e')](_0x2e5c9f)['json'](_0x571ab1);}};}function respondWithFilteredResult(_0xbf6e3,_0xecb8de){return function(_0x1e147f){if(_0x1e147f){var _0x1cce14=typeof _0xecb8de['offset']==='undefined'&&typeof _0xecb8de[_0x9a3e('0x1f')]==='undefined';var _0xa803fb=_0x1e147f['count'];var _0x1418db=_0x1cce14?0x0:_0xecb8de[_0x9a3e('0x20')];var _0x5b5e71=_0x1cce14?_0x1e147f[_0x9a3e('0x21')]:_0xecb8de[_0x9a3e('0x20')]+_0xecb8de[_0x9a3e('0x1f')];var _0x2f3f51;if(_0x5b5e71>=_0xa803fb){_0x5b5e71=_0xa803fb;_0x2f3f51=0xc8;}else{_0x2f3f51=0xce;}_0xbf6e3[_0x9a3e('0x1e')](_0x2f3f51);return _0xbf6e3['set'](_0x9a3e('0x22'),_0x1418db+'-'+_0x5b5e71+'/'+_0xa803fb)[_0x9a3e('0x23')](_0x1e147f);}return null;};}function saveUpdates(_0x2b5288){return function(_0x4b6490){if(_0x4b6490){return _0x4b6490['update'](_0x2b5288)[_0x9a3e('0x14')](function(_0x39fbee){return _0x39fbee;});}return null;};}function removeEntity(_0x4db241){return function(_0x71cf56){if(_0x71cf56){return _0x71cf56[_0x9a3e('0x24')]()[_0x9a3e('0x14')](function(){var _0x1ba64e=_0x71cf56[_0x9a3e('0x25')]({'plain':!![]});var _0x20661f='MailAccounts';return db['UserProfileResource'][_0x9a3e('0x24')]({'where':{'type':_0x20661f,'resourceId':_0x1ba64e['id']}})[_0x9a3e('0x14')](function(){return _0x71cf56;});})[_0x9a3e('0x14')](function(){_0x4db241[_0x9a3e('0x1e')](0xcc)[_0x9a3e('0x26')]();});}};}function handleEntityNotFound(_0x4fd90a){return function(_0x3a5362){if(!_0x3a5362){_0x4fd90a['sendStatus'](0x194);}return _0x3a5362;};}function handleError(_0x59cdcf,_0x3d6965){_0x3d6965=_0x3d6965||0x1f4;return function(_0x40d131){logger[_0x9a3e('0x1a')](_0x40d131['stack']);if(_0x40d131['name']){delete _0x40d131[_0x9a3e('0x27')];}_0x59cdcf[_0x9a3e('0x1e')](_0x3d6965)['send'](_0x40d131);};}function getImapHost(_0x3c4ab9){switch(_0x3c4ab9){case _0x9a3e('0x28'):return _0x9a3e('0x29');case _0x9a3e('0x2a'):return _0x9a3e('0x2b');case _0x9a3e('0x2c'):return _0x9a3e('0x2d');case'outlook365':return _0x9a3e('0x2e');}throw new Error(_0x9a3e('0x2f'),_0x3c4ab9);}function getSmtpHost(_0x1c98b0){switch(_0x1c98b0){case _0x9a3e('0x28'):return _0x9a3e('0x30');case _0x9a3e('0x2a'):return _0x9a3e('0x31');case _0x9a3e('0x2c'):return _0x9a3e('0x32');case'outlook365':return _0x9a3e('0x33');}throw new Error(_0x9a3e('0x2f'),_0x1c98b0);}function getAuthenticationOptions(_0x2b106b,_0x7abddf){var _0x448488={};var _0x49b719={};if(_0x2b106b){_0x448488[_0x9a3e('0x34')]=_0x49b719[_0x9a3e('0x34')]=_0x7abddf[_0x9a3e('0x35')];_0x448488[_0x9a3e('0x36')]=_0x49b719['pass']=_0x7abddf[_0x9a3e('0x36')];if(_0x7abddf['modernAuthentication']){_0x448488[_0x9a3e('0x37')]=_0x49b719[_0x9a3e('0x37')]=!![];_0x448488[_0x9a3e('0x38')]=_0x49b719[_0x9a3e('0x38')]=_0x7abddf[_0x9a3e('0x38')];_0x448488[_0x9a3e('0x36')]=_0x49b719['pass']=null;}else{_0x448488[_0x9a3e('0x38')]=_0x49b719[_0x9a3e('0x38')]=null;}_0x448488[_0x9a3e('0x39')]=getImapHost(_0x2b106b);_0x448488[_0x9a3e('0x3a')]=0x3e1;_0x49b719['host']=getSmtpHost(_0x2b106b);_0x49b719[_0x9a3e('0x3a')]=0x24b;_0x49b719[_0x9a3e('0x3b')]=![];_0x448488[_0x9a3e('0x3c')]=_0x49b719[_0x9a3e('0x3c')]=null;}else{if(_0x7abddf['authentication']){_0x448488['user']=_0x49b719[_0x9a3e('0x34')]=_0x7abddf[_0x9a3e('0x35')];_0x448488[_0x9a3e('0x36')]=_0x49b719['pass']=_0x7abddf['password'];}else{_0x448488[_0x9a3e('0x3d')]=_0x49b719['authentication']=![];_0x448488['user']=_0x49b719[_0x9a3e('0x34')]=null;_0x448488[_0x9a3e('0x36')]=_0x49b719[_0x9a3e('0x3e')]=null;}_0x448488[_0x9a3e('0x39')]=_0x7abddf[_0x9a3e('0x3f')][_0x9a3e('0x39')];_0x448488['port']=_0x7abddf[_0x9a3e('0x3f')][_0x9a3e('0x3a')];_0x49b719[_0x9a3e('0x39')]=_0x7abddf[_0x9a3e('0x40')][_0x9a3e('0x39')];_0x49b719[_0x9a3e('0x3a')]=_0x7abddf[_0x9a3e('0x40')][_0x9a3e('0x3a')];}return{'Imap':_0x448488,'Smtp':_0x49b719};}exports[_0x9a3e('0x41')]=function(_0x3bd18b,_0x4ae649){var _0x31056e={'include':[{'model':db[_0x9a3e('0x42')],'as':_0x9a3e('0x3f')},{'model':db[_0x9a3e('0x43')],'as':_0x9a3e('0x40')},{'model':db[_0x9a3e('0x44')],'as':_0x9a3e('0x45')}]},_0x4b82ca={},_0x2e17c3={'count':0x0,'rows':[]};var _0x16ea17=_[_0x9a3e('0x46')](db['MailAccount'][_0x9a3e('0x47')],function(_0x4c1142){return{'name':_0x4c1142[_0x9a3e('0x48')],'type':_0x4c1142[_0x9a3e('0x49')][_0x9a3e('0x4a')]};});_0x4b82ca['model']=_['map'](_0x16ea17,_0x9a3e('0x27'));_0x4b82ca[_0x9a3e('0x4b')]=_['keys'](_0x3bd18b[_0x9a3e('0x4b')]);_0x4b82ca[_0x9a3e('0x4c')]=_[_0x9a3e('0x4d')](_0x4b82ca['model'],_0x4b82ca[_0x9a3e('0x4b')]);_0x31056e[_0x9a3e('0x4e')]=_[_0x9a3e('0x4d')](_0x4b82ca[_0x9a3e('0x4f')],qs[_0x9a3e('0x50')](_0x3bd18b['query'][_0x9a3e('0x50')]));_0x31056e[_0x9a3e('0x4e')]=_0x31056e['attributes']['length']?_0x31056e[_0x9a3e('0x4e')]:_0x4b82ca[_0x9a3e('0x4f')];if(!_0x3bd18b[_0x9a3e('0x4b')][_0x9a3e('0x51')]('nolimit')){_0x31056e['limit']=qs[_0x9a3e('0x1f')](_0x3bd18b[_0x9a3e('0x4b')]['limit']);_0x31056e['offset']=qs[_0x9a3e('0x20')](_0x3bd18b[_0x9a3e('0x4b')][_0x9a3e('0x20')]);}_0x31056e[_0x9a3e('0x52')]=qs[_0x9a3e('0x53')](_0x3bd18b['query'][_0x9a3e('0x53')]);_0x31056e[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_['pick'](_0x3bd18b[_0x9a3e('0x4b')],_0x4b82ca[_0x9a3e('0x4c')]),_0x16ea17);if(_0x3bd18b[_0x9a3e('0x4b')][_0x9a3e('0x55')]){_0x31056e[_0x9a3e('0x54')]=_['merge'](_0x31056e['where'],{'$or':_['map'](_0x16ea17,function(_0x4152c0){if(_0x4152c0['type']!==_0x9a3e('0x56')){var _0x4a68d9={};_0x4a68d9[_0x4152c0['name']]={'$like':'%'+_0x3bd18b[_0x9a3e('0x4b')]['filter']+'%'};return _0x4a68d9;}})});}_0x31056e=_[_0x9a3e('0x57')]({},_0x31056e,_0x3bd18b[_0x9a3e('0x58')]);var _0x49eef8={'where':_0x31056e[_0x9a3e('0x54')]};return db['MailAccount'][_0x9a3e('0x21')](_0x49eef8)[_0x9a3e('0x14')](function(_0x6a9aeb){_0x2e17c3['count']=_0x6a9aeb;if(_0x3bd18b[_0x9a3e('0x4b')]['includeAll']){_0x31056e['include']=[{'all':!![]}];}return db[_0x9a3e('0x59')][_0x9a3e('0x5a')](_0x31056e);})[_0x9a3e('0x14')](function(_0x53df44){_0x2e17c3[_0x9a3e('0x5b')]=_0x53df44;return _0x2e17c3;})['then'](respondWithFilteredResult(_0x4ae649,_0x31056e))[_0x9a3e('0x1c')](handleError(_0x4ae649,null));};exports[_0x9a3e('0x5c')]=function(_0x2fcc72,_0x5dd64c){var _0x470f13={'raw':![],'where':{'id':_0x2fcc72['params']['id']},'include':[{'model':db[_0x9a3e('0x42')],'as':'Imap'},{'model':db[_0x9a3e('0x43')],'as':_0x9a3e('0x40')},{'model':db['Pause'],'as':_0x9a3e('0x45')}]},_0x17cb3f={};_0x17cb3f['model']=_[_0x9a3e('0x5d')](db[_0x9a3e('0x59')][_0x9a3e('0x47')]);_0x17cb3f['query']=_[_0x9a3e('0x5d')](_0x2fcc72[_0x9a3e('0x4b')]);_0x17cb3f[_0x9a3e('0x4c')]=_[_0x9a3e('0x4d')](_0x17cb3f[_0x9a3e('0x4f')],_0x17cb3f['query']);_0x470f13[_0x9a3e('0x4e')]=_[_0x9a3e('0x4d')](_0x17cb3f['model'],qs['fields'](_0x2fcc72[_0x9a3e('0x4b')][_0x9a3e('0x50')]));_0x470f13[_0x9a3e('0x4e')]=_0x470f13[_0x9a3e('0x4e')][_0x9a3e('0x5e')]?_0x470f13['attributes']:_0x17cb3f[_0x9a3e('0x4f')];if(_0x2fcc72[_0x9a3e('0x4b')]['includeAll']){_0x470f13[_0x9a3e('0x5f')]=[{'all':!![]}];}_0x470f13=_[_0x9a3e('0x57')]({},_0x470f13,_0x2fcc72[_0x9a3e('0x58')]);return db[_0x9a3e('0x59')][_0x9a3e('0x60')](_0x470f13)[_0x9a3e('0x14')](handleEntityNotFound(_0x5dd64c,null))['then'](respondWithResult(_0x5dd64c,null))[_0x9a3e('0x1c')](handleError(_0x5dd64c,null));};exports[_0x9a3e('0x61')]=function(_0x4a913c,_0x3b29db){if(_0x4a913c[_0x9a3e('0x62')]['id']){delete _0x4a913c[_0x9a3e('0x62')]['id'];}var _0x363e2c=_0x4a913c[_0x9a3e('0x62')][_0x9a3e('0x63')]===_0x9a3e('0x64')?null:_0x4a913c[_0x9a3e('0x62')][_0x9a3e('0x63')];var _0x59259a=_0x4a913c[_0x9a3e('0x62')]['Imap']||{};var _0x50a561=_0x4a913c[_0x9a3e('0x62')]['Smtp']||{};if(_0x363e2c){_0x59259a[_0x9a3e('0x39')]=getImapHost(_0x363e2c);_0x59259a[_0x9a3e('0x3a')]=0x3e1;_0x50a561['host']=getSmtpHost(_0x363e2c);_0x50a561[_0x9a3e('0x3a')]=0x24b;_0x50a561[_0x9a3e('0x3b')]=![];}if(_0x50a561[_0x9a3e('0x37')]){_0x50a561[_0x9a3e('0x3b')]=![];}else{_0x50a561[_0x9a3e('0x38')]=null;}if(!_0x59259a[_0x9a3e('0x37')])_0x59259a[_0x9a3e('0x38')]=null;_0x4a913c[_0x9a3e('0x62')][_0x9a3e('0x3f')]=_0x59259a;_0x4a913c[_0x9a3e('0x62')][_0x9a3e('0x40')]=_0x50a561;return db['MailAccount'][_0x9a3e('0x60')]({'where':{'id':_0x4a913c[_0x9a3e('0x65')]['id']},'include':[{'model':db[_0x9a3e('0x42')],'as':_0x9a3e('0x3f')},{'model':db[_0x9a3e('0x43')],'as':_0x9a3e('0x40')},{'model':db[_0x9a3e('0x44')],'as':_0x9a3e('0x45')}]})[_0x9a3e('0x14')](handleEntityNotFound(_0x3b29db,null))[_0x9a3e('0x14')](function(_0x5d2fe3){if(!_0x5d2fe3)throw new Error('Mail\x20Account\x20not\x20found');if(_0x5d2fe3['service'])delete _0x4a913c[_0x9a3e('0x62')]['Imap'];return _0x5d2fe3;})['then'](saveUpdates(_0x4a913c['body'],null))[_0x9a3e('0x14')](function(_0x2c2f35){if(!_0x4a913c[_0x9a3e('0x62')][_0x9a3e('0x3f')])return _0x2c2f35;return db[_0x9a3e('0x42')][_0x9a3e('0x61')](_0x4a913c['body'][_0x9a3e('0x3f')],{'where':{'MailAccountId':_0x2c2f35['id']}})[_0x9a3e('0x14')](function(){return _0x2c2f35;});})[_0x9a3e('0x14')](function(_0x100730){if(!_0x4a913c[_0x9a3e('0x62')][_0x9a3e('0x40')])return _0x100730;return db['MailServerOut'][_0x9a3e('0x61')](_0x4a913c[_0x9a3e('0x62')]['Smtp'],{'where':{'MailAccountId':_0x100730['id']}})[_0x9a3e('0x14')](function(){return _0x100730;});})[_0x9a3e('0x14')](respondWithResult(_0x3b29db,null))[_0x9a3e('0x1c')](handleError(_0x3b29db,null));};exports[_0x9a3e('0x66')]=function(_0x1b8f18,_0x1b6a71){return db['MailAccount']['describe']()[_0x9a3e('0x14')](respondWithResult(_0x1b6a71,null))[_0x9a3e('0x1c')](handleError(_0x1b6a71,null));};exports['addDisposition']=function(_0x4037c3,_0x1ade52){if(_0x4037c3['body']['id']){delete _0x4037c3['body']['id'];}return db[_0x9a3e('0x59')][_0x9a3e('0x60')]({'where':{'id':_0x4037c3[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x1ade52,null))[_0x9a3e('0x14')](function(_0x61f9ae){if(_0x61f9ae){_0x4037c3[_0x9a3e('0x62')][_0x9a3e('0x67')]=_0x61f9ae['id'];return db[_0x9a3e('0x68')]['create'](_0x4037c3[_0x9a3e('0x62')]);}})['then'](respondWithResult(_0x1ade52,null))['catch'](handleError(_0x1ade52,null));};exports['getDispositions']=function(_0xb48c52,_0x3521a2){var _0x254ead={'raw':![],'where':{}};var _0x135f61={};var _0x36c053={'count':0x0,'rows':[]};return db[_0x9a3e('0x59')][_0x9a3e('0x69')]({'where':{'id':_0xb48c52['params']['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x3521a2,null))[_0x9a3e('0x14')](function(_0x22121d){if(_0x22121d){_0x135f61[_0x9a3e('0x4f')]=_[_0x9a3e('0x5d')](db[_0x9a3e('0x68')][_0x9a3e('0x47')]);_0x135f61['query']=_[_0x9a3e('0x5d')](_0xb48c52[_0x9a3e('0x4b')]);_0x135f61['filters']=_[_0x9a3e('0x4d')](_0x135f61[_0x9a3e('0x4f')],_0x135f61[_0x9a3e('0x4b')]);_0x254ead[_0x9a3e('0x4e')]=_[_0x9a3e('0x4d')](_0x135f61['model'],qs[_0x9a3e('0x50')](_0xb48c52[_0x9a3e('0x4b')]['fields']));_0x254ead[_0x9a3e('0x4e')]=_0x254ead['attributes']['length']?_0x254ead[_0x9a3e('0x4e')]:_0x135f61['model'];if(!_0xb48c52[_0x9a3e('0x4b')][_0x9a3e('0x51')](_0x9a3e('0x6a'))){_0x254ead[_0x9a3e('0x1f')]=qs['limit'](_0xb48c52[_0x9a3e('0x4b')][_0x9a3e('0x1f')]);_0x254ead[_0x9a3e('0x20')]=qs[_0x9a3e('0x20')](_0xb48c52[_0x9a3e('0x4b')]['offset']);}_0x254ead[_0x9a3e('0x52')]=qs[_0x9a3e('0x53')](_0xb48c52[_0x9a3e('0x4b')][_0x9a3e('0x53')]);_0x254ead[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_[_0x9a3e('0x6b')](_0xb48c52['query'],_0x135f61[_0x9a3e('0x4c')]));_0x254ead['where'][_0x9a3e('0x67')]=_0x22121d['id'];if(_0xb48c52[_0x9a3e('0x4b')][_0x9a3e('0x55')]){_0x254ead[_0x9a3e('0x54')]=_['merge'](_0x254ead[_0x9a3e('0x54')],{'$or':_[_0x9a3e('0x46')](_0x254ead['attributes'],function(_0xff53b){var _0x27f001={};_0x27f001[_0xff53b]={'$like':'%'+_0xb48c52[_0x9a3e('0x4b')]['filter']+'%'};return _0x27f001;})});}_0x254ead=_[_0x9a3e('0x57')]({},_0x254ead,_0xb48c52[_0x9a3e('0x58')]);return db['Disposition'][_0x9a3e('0x21')]({'where':_0x254ead['where']})['then'](function(_0x544159){_0x36c053[_0x9a3e('0x21')]=_0x544159;if(_0xb48c52[_0x9a3e('0x4b')]['includeAll']){_0x254ead[_0x9a3e('0x5f')]=[{'all':!![]}];}return db[_0x9a3e('0x68')][_0x9a3e('0x5a')](_0x254ead);})[_0x9a3e('0x14')](function(_0x236152){_0x36c053[_0x9a3e('0x5b')]=_0x236152;return _0x36c053;});}})[_0x9a3e('0x14')](respondWithFilteredResult(_0x3521a2,_0x254ead))['catch'](handleError(_0x3521a2,null));};exports[_0x9a3e('0x6c')]=function(_0x55d178,_0x554107){return db[_0x9a3e('0x59')]['find']({'where':{'id':_0x55d178[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x554107,null))[_0x9a3e('0x14')](function(_0x301755){if(_0x301755){return _0x301755['removeDispositions'](_0x55d178[_0x9a3e('0x4b')][_0x9a3e('0x6d')]);}})['then'](respondWithStatusCode(_0x554107,null))[_0x9a3e('0x1c')](handleError(_0x554107,null));};exports[_0x9a3e('0x6e')]=function(_0x56a714,_0x2df33c){if(_0x56a714[_0x9a3e('0x62')]['id']){delete _0x56a714['body']['id'];}return db[_0x9a3e('0x59')][_0x9a3e('0x60')]({'where':{'id':_0x56a714[_0x9a3e('0x65')]['id']}})['then'](handleEntityNotFound(_0x2df33c,null))[_0x9a3e('0x14')](function(_0x1d7d65){if(_0x1d7d65){_0x56a714['body'][_0x9a3e('0x67')]=_0x1d7d65['id'];return db[_0x9a3e('0x6f')][_0x9a3e('0x70')](_0x56a714['body']);}})[_0x9a3e('0x14')](respondWithResult(_0x2df33c,null))['catch'](handleError(_0x2df33c,null));};exports[_0x9a3e('0x71')]=function(_0x307af3,_0x35741f){var _0x1cd32a={'raw':![],'where':{}};var _0x3b3a42={};var _0x57e2c5={'count':0x0,'rows':[]};return db['MailAccount'][_0x9a3e('0x69')]({'where':{'id':_0x307af3[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x35741f,null))[_0x9a3e('0x14')](function(_0x90f2bb){if(_0x90f2bb){_0x3b3a42[_0x9a3e('0x4f')]=_[_0x9a3e('0x5d')](db['CannedAnswer'][_0x9a3e('0x47')]);_0x3b3a42['query']=_[_0x9a3e('0x5d')](_0x307af3[_0x9a3e('0x4b')]);_0x3b3a42['filters']=_['intersection'](_0x3b3a42[_0x9a3e('0x4f')],_0x3b3a42[_0x9a3e('0x4b')]);_0x1cd32a[_0x9a3e('0x4e')]=_[_0x9a3e('0x4d')](_0x3b3a42[_0x9a3e('0x4f')],qs['fields'](_0x307af3[_0x9a3e('0x4b')]['fields']));_0x1cd32a[_0x9a3e('0x4e')]=_0x1cd32a[_0x9a3e('0x4e')][_0x9a3e('0x5e')]?_0x1cd32a[_0x9a3e('0x4e')]:_0x3b3a42['model'];if(!_0x307af3[_0x9a3e('0x4b')][_0x9a3e('0x51')]('nolimit')){_0x1cd32a[_0x9a3e('0x1f')]=qs[_0x9a3e('0x1f')](_0x307af3['query'][_0x9a3e('0x1f')]);_0x1cd32a[_0x9a3e('0x20')]=qs['offset'](_0x307af3[_0x9a3e('0x4b')]['offset']);}_0x1cd32a[_0x9a3e('0x52')]=qs[_0x9a3e('0x53')](_0x307af3['query'][_0x9a3e('0x53')]);_0x1cd32a[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_[_0x9a3e('0x6b')](_0x307af3[_0x9a3e('0x4b')],_0x3b3a42['filters']));_0x1cd32a['where'][_0x9a3e('0x67')]=_0x90f2bb['id'];if(_0x307af3['query'][_0x9a3e('0x55')]){_0x1cd32a[_0x9a3e('0x54')]=_[_0x9a3e('0x57')](_0x1cd32a[_0x9a3e('0x54')],{'$or':_[_0x9a3e('0x46')](_0x1cd32a['attributes'],function(_0x1dd460){var _0x35b0df={};_0x35b0df[_0x1dd460]={'$like':'%'+_0x307af3[_0x9a3e('0x4b')]['filter']+'%'};return _0x35b0df;})});}_0x1cd32a=_['merge']({},_0x1cd32a,_0x307af3[_0x9a3e('0x58')]);return db[_0x9a3e('0x6f')][_0x9a3e('0x21')]({'where':_0x1cd32a[_0x9a3e('0x54')]})[_0x9a3e('0x14')](function(_0x23a946){_0x57e2c5['count']=_0x23a946;if(_0x307af3[_0x9a3e('0x4b')][_0x9a3e('0x72')]){_0x1cd32a['include']=[{'all':!![]}];}return db[_0x9a3e('0x6f')]['findAll'](_0x1cd32a);})['then'](function(_0x5d5d4f){_0x57e2c5['rows']=_0x5d5d4f;return _0x57e2c5;});}})['then'](respondWithFilteredResult(_0x35741f,_0x1cd32a))[_0x9a3e('0x1c')](handleError(_0x35741f,null));};exports[_0x9a3e('0x73')]=function(_0x32e720,_0x2106c9){return db[_0x9a3e('0x59')][_0x9a3e('0x60')]({'where':{'id':_0x32e720[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x2106c9,null))[_0x9a3e('0x14')](function(_0x23dcff){if(_0x23dcff){return _0x23dcff[_0x9a3e('0x73')](_0x32e720[_0x9a3e('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x2106c9,null))[_0x9a3e('0x1c')](handleError(_0x2106c9,null));};exports[_0x9a3e('0x70')]=function(_0x2a6452,_0x5c280a){var _0x3494d4={'name':_0x2a6452[_0x9a3e('0x62')][_0x9a3e('0x27')],'key':_0x2a6452[_0x9a3e('0x62')]['key'],'provider':_0x2a6452[_0x9a3e('0x62')][_0x9a3e('0x63')]===_0x9a3e('0x64')?null:_0x2a6452[_0x9a3e('0x62')]['provider'],'email':_0x2a6452['body'][_0x9a3e('0x74')],'ListId':_0x2a6452[_0x9a3e('0x62')]['ListId'],'active':!_[_0x9a3e('0x75')](_0x2a6452['body'][_0x9a3e('0x76')])?_0x2a6452['body']['active']:!![],'description':_0x2a6452[_0x9a3e('0x62')][_0x9a3e('0x77')]||null};var _0x37e899=getAuthenticationOptions(_0x3494d4[_0x9a3e('0x63')],_0x2a6452[_0x9a3e('0x62')]);_0x3494d4[_0x9a3e('0x3f')]=_0x37e899[_0x9a3e('0x3f')];_0x3494d4[_0x9a3e('0x40')]=_0x37e899[_0x9a3e('0x40')];return db[_0x9a3e('0x59')]['create'](_0x3494d4,{'include':[{'model':db[_0x9a3e('0x43')],'as':_0x9a3e('0x40')},{'model':db['MailServerIn'],'as':_0x9a3e('0x3f')}]})['then'](function(_0x4a7a4e){var _0x3ce89f=_0x2a6452['user'][_0x9a3e('0x25')]({'plain':!![]});if(!_0x3ce89f)throw new Error(_0x9a3e('0x78'));if(_0x3ce89f['role']===_0x9a3e('0x34')){var _0x39d13c=_0x4a7a4e['get']({'plain':!![]});return db[_0x9a3e('0x79')][_0x9a3e('0x60')]({'where':{'name':_0x9a3e('0x7a'),'userProfileId':_0x3ce89f['userProfileId']},'raw':!![]})[_0x9a3e('0x14')](function(_0x2e6695){if(_0x2e6695&&_0x2e6695['autoAssociation']===0x0){return db[_0x9a3e('0x7b')]['create']({'name':_0x39d13c[_0x9a3e('0x27')],'resourceId':_0x39d13c['id'],'type':_0x2e6695['name'],'sectionId':_0x2e6695['id']},{})[_0x9a3e('0x14')](function(){return _0x4a7a4e;});}else{return _0x4a7a4e;}})[_0x9a3e('0x1c')](function(_0x270ad0){logger[_0x9a3e('0x1a')](_0x9a3e('0x7c'),_0x270ad0);throw _0x270ad0;});}return _0x4a7a4e;})[_0x9a3e('0x14')](respondWithResult(_0x5c280a,0xc9))[_0x9a3e('0x1c')](handleError(_0x5c280a,null));};exports[_0x9a3e('0x7d')]=function(_0x204775,_0x3ff6d0){return db[_0x9a3e('0x59')]['findOne']({'where':{'id':_0x204775[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x3ff6d0,null))['then'](function(_0x50dcc9){if(_0x50dcc9){return _0x50dcc9[_0x9a3e('0x7d')]();}return null;})[_0x9a3e('0x14')](respondWithResult(_0x3ff6d0,null))[_0x9a3e('0x1c')](handleError(_0x3ff6d0,null));};exports[_0x9a3e('0x7e')]=function(_0xce534a,_0x52d262){if(_0xce534a['body']['id']){delete _0xce534a[_0x9a3e('0x62')]['id'];}return db['MailAccount'][_0x9a3e('0x60')]({'where':{'id':_0xce534a[_0x9a3e('0x65')]['id']}})['then'](handleEntityNotFound(_0x52d262,null))[_0x9a3e('0x14')](function(_0x5c39b2){if(_0x5c39b2){_0xce534a['body'][_0x9a3e('0x67')]=_0x5c39b2['id'];return db['MailServerIn'][_0x9a3e('0x70')](_0xce534a[_0x9a3e('0x62')]);}})[_0x9a3e('0x14')](respondWithResult(_0x52d262,null))[_0x9a3e('0x1c')](handleError(_0x52d262,null));};exports[_0x9a3e('0x7f')]=function(_0x147fbd,_0x3ee3cd){return db['MailAccount'][_0x9a3e('0x69')]({'where':{'id':_0x147fbd['params']['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x3ee3cd,null))[_0x9a3e('0x14')](function(_0x3f4635){if(_0x3f4635){return _0x3f4635['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x3ee3cd,null))[_0x9a3e('0x1c')](handleError(_0x3ee3cd,null));};exports[_0x9a3e('0x80')]=function(_0x16d3dc,_0x358390){return db['MailAccount'][_0x9a3e('0x69')]({'where':{'id':_0x16d3dc['params']['id']}})['then'](handleEntityNotFound(_0x358390,null))[_0x9a3e('0x14')](function(_0x1c5bdf){if(_0x1c5bdf){return _0x1c5bdf[_0x9a3e('0x80')]();}return null;})[_0x9a3e('0x14')](respondWithResult(_0x358390,null))[_0x9a3e('0x1c')](handleError(_0x358390,null));};exports[_0x9a3e('0x81')]=function(_0x3e7e3d,_0x4793fc){if(_0x3e7e3d[_0x9a3e('0x62')]['id']){delete _0x3e7e3d[_0x9a3e('0x62')]['id'];}return db['MailAccount'][_0x9a3e('0x60')]({'where':{'id':_0x3e7e3d[_0x9a3e('0x65')]['id']}})['then'](handleEntityNotFound(_0x4793fc,null))[_0x9a3e('0x14')](function(_0x218502){if(_0x218502){_0x3e7e3d[_0x9a3e('0x62')][_0x9a3e('0x67')]=_0x218502['id'];return db[_0x9a3e('0x43')][_0x9a3e('0x70')](_0x3e7e3d['body']);}})[_0x9a3e('0x14')](respondWithResult(_0x4793fc,null))[_0x9a3e('0x1c')](handleError(_0x4793fc,null));};exports[_0x9a3e('0x82')]=function(_0x2bc2a1,_0x3e8cf5){return db[_0x9a3e('0x59')][_0x9a3e('0x69')]({'where':{'id':_0x2bc2a1[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x3e8cf5,null))[_0x9a3e('0x14')](function(_0x4f785d){if(_0x4f785d){return _0x4f785d[_0x9a3e('0x83')](null);}return null;})[_0x9a3e('0x14')](respondWithStatusCode(_0x3e8cf5,null))['catch'](handleError(_0x3e8cf5,null));};exports[_0x9a3e('0x84')]=function(_0x587721,_0x258acc){return db[_0x9a3e('0x85')][_0x9a3e('0x60')]({'where':{'id':_0x587721[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x258acc,null))['then'](function(_0x2fd966){if(_0x2fd966){return _0x2fd966[_0x9a3e('0x84')](_0x587721[_0x9a3e('0x62')]['ids'],_[_0x9a3e('0x86')](_0x587721[_0x9a3e('0x62')],[_0x9a3e('0x6d'),'id'])||{});}})[_0x9a3e('0x14')](respondWithResult(_0x258acc,null))['catch'](handleError(_0x258acc,null));};exports[_0x9a3e('0x87')]=function(_0x1059ae,_0x4f2431){var _0x17448d={'raw':![],'where':{}};var _0x3339d8={};var _0x3bf5e3={'count':0x0,'rows':[]};return db[_0x9a3e('0x59')][_0x9a3e('0x69')]({'where':{'id':_0x1059ae[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x4f2431,null))[_0x9a3e('0x14')](function(_0x25c361){if(_0x25c361){_0x3339d8[_0x9a3e('0x4f')]=_[_0x9a3e('0x5d')](db[_0x9a3e('0x85')][_0x9a3e('0x47')]);_0x3339d8[_0x9a3e('0x4b')]=_[_0x9a3e('0x5d')](_0x1059ae[_0x9a3e('0x4b')]);_0x3339d8[_0x9a3e('0x4c')]=_[_0x9a3e('0x4d')](_0x3339d8[_0x9a3e('0x4f')],_0x3339d8['query']);_0x17448d['attributes']=_[_0x9a3e('0x4d')](_0x3339d8[_0x9a3e('0x4f')],qs[_0x9a3e('0x50')](_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x50')]));_0x17448d[_0x9a3e('0x4e')]=_0x17448d[_0x9a3e('0x4e')]['length']?_0x17448d[_0x9a3e('0x4e')]:_0x3339d8[_0x9a3e('0x4f')];if(!_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x51')](_0x9a3e('0x6a'))){_0x17448d['limit']=qs[_0x9a3e('0x1f')](_0x1059ae['query'][_0x9a3e('0x1f')]);_0x17448d[_0x9a3e('0x20')]=qs['offset'](_0x1059ae[_0x9a3e('0x4b')]['offset']);}_0x17448d[_0x9a3e('0x52')]=qs[_0x9a3e('0x53')](_0x1059ae[_0x9a3e('0x4b')]['sort']);_0x17448d[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_[_0x9a3e('0x6b')](_0x1059ae[_0x9a3e('0x4b')],_0x3339d8['filters']));_0x17448d['where']['MailAccountId']=_0x25c361['id'];if(_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x55')]){_0x17448d[_0x9a3e('0x54')]=_[_0x9a3e('0x57')](_0x17448d[_0x9a3e('0x54')],{'$or':_[_0x9a3e('0x46')](_0x17448d[_0x9a3e('0x4e')],function(_0x238d9d){var _0x59662c={};_0x59662c[_0x238d9d]={'$like':'%'+_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x55')]+'%'};return _0x59662c;})});}_0x17448d=_[_0x9a3e('0x57')]({},_0x17448d,_0x1059ae[_0x9a3e('0x58')]);return db['MailInteraction']['count']({'where':_0x17448d[_0x9a3e('0x54')]})[_0x9a3e('0x14')](function(_0x18c38e){_0x3bf5e3['count']=_0x18c38e;if(_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x72')]){_0x17448d[_0x9a3e('0x5f')]=[{'model':db['CmContact'],'as':_0x9a3e('0x88'),'required':![]},{'model':db[_0x9a3e('0x89')],'as':'Owner','attributes':['name',_0x9a3e('0x8a'),_0x9a3e('0x8b')],'required':![]},{'model':db[_0x9a3e('0x8c')],'as':_0x9a3e('0x8d'),'attributes':['id',_0x9a3e('0x27'),_0x9a3e('0x8e')],'where':_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x8f')]?{'id':_0x1059ae[_0x9a3e('0x4b')][_0x9a3e('0x8f')]}:undefined,'required':_0x1059ae[_0x9a3e('0x4b')]['tag']?!![]:![]}];}return db[_0x9a3e('0x85')][_0x9a3e('0x5a')](_0x17448d);})[_0x9a3e('0x14')](function(_0x2ff88c){_0x3bf5e3[_0x9a3e('0x5b')]=_0x2ff88c;return _0x3bf5e3;});}})[_0x9a3e('0x14')](respondWithFilteredResult(_0x4f2431,_0x17448d))[_0x9a3e('0x1c')](handleError(_0x4f2431,null));};exports[_0x9a3e('0x90')]=function addApplications(_0x40939c,_0x2776c4){var _0x206df9=_0x40939c[_0x9a3e('0x65')]['id'];var _0x56bfa7=_0x40939c['body'];var _0x23bfe7=0xc8;var _0x135dd5=null;return db[_0x9a3e('0x91')][_0x9a3e('0x92')]({'isolationLevel':db[_0x9a3e('0x91')]['Transaction'][_0x9a3e('0x93')]['READ_COMMITTED']},function(_0x5f24c9){return db[_0x9a3e('0x59')]['findOne']({'where':{'id':_0x206df9},'transaction':_0x5f24c9})[_0x9a3e('0x14')](function(_0xf4d2cb){if(_0xf4d2cb){return db['MailApplication'][_0x9a3e('0x24')]({'where':{'MailAccountId':_0x206df9},'transaction':_0x5f24c9})[_0x9a3e('0x14')](function(){var _0xdb890d=_[_0x9a3e('0x46')](_0x56bfa7,function(_0x4d61b8){_0x4d61b8[_0x9a3e('0x67')]=_0x206df9;return _0x4d61b8;});return db[_0x9a3e('0x94')][_0x9a3e('0x95')](_0xdb890d,{'transaction':_0x5f24c9});});}else{_0x23bfe7=0x194;_0x135dd5=[];}});})[_0x9a3e('0x14')](function(){if(_0x23bfe7!==0x194){return db['MailApplication'][_0x9a3e('0x96')]({'where':{'MailAccountId':_0x206df9},'order':_0x9a3e('0x97')})[_0x9a3e('0x14')](function(_0x6161e4){_0x135dd5=_0x6161e4;});}})[_0x9a3e('0x1c')](function(_0x5e6e40){_0x23bfe7=0x1f4;logger[_0x9a3e('0x1a')](_0x5e6e40[_0x9a3e('0x98')]);if(_0x5e6e40[_0x9a3e('0x27')]){delete _0x5e6e40[_0x9a3e('0x27')];}_0x135dd5=_0x5e6e40;})['finally'](function(){if(_0x135dd5===null){_0x2776c4[_0x9a3e('0x1d')](_0x23bfe7);}else{if(_0x23bfe7===0x1f4){_0x2776c4['status'](_0x23bfe7)[_0x9a3e('0x99')](_0x135dd5);}else{_0x2776c4[_0x9a3e('0x1e')](_0x23bfe7)[_0x9a3e('0x23')](_0x135dd5);}}});};exports[_0x9a3e('0x9a')]=function(_0x545695,_0x3f8d4b){var _0x57fcc6={};var _0x46996a={};var _0x30b9eb;var _0x329db4;return db[_0x9a3e('0x59')]['findOne']({'where':{'id':_0x545695['params']['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x3f8d4b,null))[_0x9a3e('0x14')](function(_0x1868e6){if(_0x1868e6){_0x30b9eb=_0x1868e6;_0x46996a[_0x9a3e('0x4f')]=_[_0x9a3e('0x5d')](db['MailApplication']['rawAttributes']);_0x46996a['query']=_['keys'](_0x545695[_0x9a3e('0x4b')]);_0x46996a[_0x9a3e('0x4c')]=_[_0x9a3e('0x4d')](_0x46996a['model'],_0x46996a['query']);_0x57fcc6['attributes']=_[_0x9a3e('0x4d')](_0x46996a[_0x9a3e('0x4f')],qs[_0x9a3e('0x50')](_0x545695[_0x9a3e('0x4b')]['fields']));_0x57fcc6[_0x9a3e('0x4e')]=_0x57fcc6[_0x9a3e('0x4e')][_0x9a3e('0x5e')]?_0x57fcc6[_0x9a3e('0x4e')]:_0x46996a[_0x9a3e('0x4f')];_0x57fcc6[_0x9a3e('0x52')]=qs[_0x9a3e('0x53')](_0x545695['query']['sort']);_0x57fcc6[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_[_0x9a3e('0x6b')](_0x545695[_0x9a3e('0x4b')],_0x46996a[_0x9a3e('0x4c')]));if(_0x545695['query'][_0x9a3e('0x55')]){_0x57fcc6[_0x9a3e('0x54')]=_[_0x9a3e('0x57')](_0x57fcc6[_0x9a3e('0x54')],{'$or':_[_0x9a3e('0x46')](_0x57fcc6[_0x9a3e('0x4e')],function(_0x44e636){var _0x3ca20b={};_0x3ca20b[_0x44e636]={'$like':'%'+_0x545695[_0x9a3e('0x4b')][_0x9a3e('0x55')]+'%'};return _0x3ca20b;})});}_0x57fcc6=_[_0x9a3e('0x57')]({},_0x57fcc6,_0x545695[_0x9a3e('0x58')]);return _0x30b9eb[_0x9a3e('0x9a')](_0x57fcc6);}})[_0x9a3e('0x14')](function(_0x28fe3){if(_0x28fe3){_0x329db4=_0x28fe3[_0x9a3e('0x5e')];if(!_0x545695['query'][_0x9a3e('0x51')]('nolimit')){_0x57fcc6['limit']=qs[_0x9a3e('0x1f')](_0x545695[_0x9a3e('0x4b')][_0x9a3e('0x1f')]);_0x57fcc6['offset']=qs['offset'](_0x545695[_0x9a3e('0x4b')]['offset']);}return _0x30b9eb[_0x9a3e('0x9a')](_0x57fcc6);}})[_0x9a3e('0x14')](function(_0x17134b){if(_0x17134b){return _0x17134b?{'count':_0x329db4,'rows':_0x17134b}:null;}})[_0x9a3e('0x14')](respondWithResult(_0x3f8d4b,null))[_0x9a3e('0x1c')](handleError(_0x3f8d4b,null));};exports[_0x9a3e('0x9b')]=function(_0xbabde3,_0x40beda){var _0x436d9a={'raw':!![],'where':{}};var _0x4ffec7={};var _0x20a2df={'count':0x0,'rows':[]};return db[_0x9a3e('0x59')][_0x9a3e('0x69')]({'where':{'id':_0xbabde3[_0x9a3e('0x65')]['id']}})['then'](handleEntityNotFound(_0x40beda,null))[_0x9a3e('0x14')](function(_0x19c52b){if(_0x19c52b){_0x4ffec7[_0x9a3e('0x4f')]=_['keys'](db[_0x9a3e('0x9c')]['rawAttributes']);_0x4ffec7[_0x9a3e('0x4b')]=_[_0x9a3e('0x5d')](_0xbabde3[_0x9a3e('0x4b')]);_0x4ffec7[_0x9a3e('0x4c')]=_[_0x9a3e('0x4d')](_0x4ffec7[_0x9a3e('0x4f')],_0x4ffec7[_0x9a3e('0x4b')]);_0x436d9a[_0x9a3e('0x4e')]=_[_0x9a3e('0x4d')](_0x4ffec7[_0x9a3e('0x4f')],qs[_0x9a3e('0x50')](_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x50')]));_0x436d9a[_0x9a3e('0x4e')]=_0x436d9a['attributes'][_0x9a3e('0x5e')]?_0x436d9a[_0x9a3e('0x4e')]:_0x4ffec7[_0x9a3e('0x4f')];if(!_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x51')](_0x9a3e('0x6a'))){_0x436d9a[_0x9a3e('0x1f')]=qs['limit'](_0xbabde3[_0x9a3e('0x4b')]['limit']);_0x436d9a[_0x9a3e('0x20')]=qs[_0x9a3e('0x20')](_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x20')]);}_0x436d9a['order']=qs['sort'](_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x53')]);_0x436d9a[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_[_0x9a3e('0x6b')](_0xbabde3[_0x9a3e('0x4b')],_0x4ffec7['filters']));_0x436d9a[_0x9a3e('0x54')][_0x9a3e('0x67')]=_0x19c52b['id'];if(_0xbabde3[_0x9a3e('0x4b')]['filter']){_0x436d9a['where']=_[_0x9a3e('0x57')](_0x436d9a[_0x9a3e('0x54')],{'$or':_[_0x9a3e('0x46')](_0x436d9a['attributes'],function(_0x3c0e49){var _0x2640fa={};_0x2640fa[_0x3c0e49]={'$like':'%'+_0xbabde3[_0x9a3e('0x4b')]['filter']+'%'};return _0x2640fa;})});}if(_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x9d')]){var _0x28925d=_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x9d')][_0x9a3e('0x9e')](',');var _0x4ef39b={};_0x4ef39b[_0x28925d[0x0]]={'$gte':moment(_0x28925d[0x1])['format'](_0x9a3e('0x9f'))};_0x436d9a['where']=_[_0x9a3e('0x57')](_0x436d9a[_0x9a3e('0x54')],_0x4ef39b);}_0x436d9a=_[_0x9a3e('0x57')]({},_0x436d9a,_0xbabde3[_0x9a3e('0x58')]);return db['MailMessage'][_0x9a3e('0x21')]({'where':_0x436d9a[_0x9a3e('0x54')]})[_0x9a3e('0x14')](function(_0x33bc6f){_0x20a2df[_0x9a3e('0x21')]=_0x33bc6f;if(_0xbabde3[_0x9a3e('0x4b')][_0x9a3e('0x72')]){_0x436d9a[_0x9a3e('0x5f')]=[{'all':!![]}];}return db[_0x9a3e('0x9c')][_0x9a3e('0x5a')](_0x436d9a);})[_0x9a3e('0x14')](function(_0x157e27){if(_0xbabde3[_0x9a3e('0x4b')]['inlineCss']===_0x9a3e('0xa0')){for(var _0x566c51=0x0;_0x566c51<_0x157e27['length'];_0x566c51++){_0x157e27[_0x566c51][_0x9a3e('0x62')]=juice(_0x157e27[_0x566c51][_0x9a3e('0x62')]);}}_0x20a2df[_0x9a3e('0x5b')]=_0x157e27;return _0x20a2df;});}})['then'](respondWithFilteredResult(_0x40beda,_0x436d9a))['catch'](handleError(_0x40beda,null));};exports[_0x9a3e('0x99')]=function(_0x9baf16,_0x19644c){var _0x11058a,_0x48132d={},_0x3e6791;if(_0x9baf16[_0x9a3e('0x62')]['to']){_0x3e6791=_0x9baf16['body']['to'][_0x9a3e('0x9e')](',')[0x0];}return db[_0x9a3e('0x59')][_0x9a3e('0x60')]({'where':{'id':_0x9baf16[_0x9a3e('0x65')]['id']},'include':[{'model':db[_0x9a3e('0xa1')],'as':_0x9a3e('0xa2'),'include':[{'model':db[_0x9a3e('0xa3')],'as':_0x9a3e('0xa4'),'where':{'email':_0x3e6791},'limit':0x1,'order':[[_0x9a3e('0xa5'),_0x9a3e('0xa6')]]}]},{'model':db[_0x9a3e('0x43')],'as':_0x9a3e('0x40'),'raw':!![],'include':[{'model':db[_0x9a3e('0xa7')],'as':'CloudProvider','raw':!![]}]}]})[_0x9a3e('0x14')](handleEntityNotFound(_0x19644c,null))[_0x9a3e('0x14')](function(_0x2120c6){if(!_0x2120c6)return;_0x11058a=_0x2120c6;if(!_0x2120c6[_0x9a3e('0x40')])throw new Error(_0x9a3e('0xa8'));if(_[_0x9a3e('0x75')](_0x9baf16['body'][_0x9a3e('0xa9')])){_0x9baf16[_0x9a3e('0x62')]['from']=util['format'](_0x9a3e('0xaa'),_0x2120c6[_0x9a3e('0x27')],_0x2120c6[_0x9a3e('0x74')]||_0x2120c6[_0x9a3e('0x40')]['user']);}if(_0x9baf16['body']['attachments']&&_0x9baf16[_0x9a3e('0x62')][_0x9a3e('0xab')][_0x9a3e('0x5e')]){for(var _0x5c10ed=0x0;_0x5c10ed<_0x9baf16[_0x9a3e('0x62')][_0x9a3e('0xab')]['length'];_0x5c10ed+=0x1){_0x9baf16['body'][_0x9a3e('0xab')][_0x5c10ed]={'filename':_0x9baf16[_0x9a3e('0x62')][_0x9a3e('0xab')][_0x5c10ed][_0x9a3e('0x27')],'path':path[_0x9a3e('0xac')](config[_0x9a3e('0xad')],_0x9a3e('0xae'),_0x9baf16[_0x9a3e('0x62')]['attachments'][_0x5c10ed][_0x9a3e('0xaf')])};}}var _0xfb1211=_0x2120c6['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x9a3e('0xb0'),{'account':_0xfb1211,'message':_0x9baf16[_0x9a3e('0x62')]});})[_0x9a3e('0x14')](function(_0x303387){if(!_0x303387)return;_0x48132d=_0x303387;if(!_0x11058a['List'])throw new Error(_0x9a3e('0xb1'));if(_0x11058a[_0x9a3e('0xa2')][_0x9a3e('0xa4')][_0x9a3e('0x5e')])return _0x11058a[_0x9a3e('0xa2')]['Contacts'][0x0];return db[_0x9a3e('0xa3')][_0x9a3e('0x70')](_[_0x9a3e('0xb')](_0x9baf16[_0x9a3e('0x62')],{'firstName':_0x9baf16[_0x9a3e('0x62')]['to'],'email':_0x9baf16[_0x9a3e('0x62')]['to'],'phone':_0x9baf16[_0x9a3e('0x62')]['to'],'ListId':_0x11058a[_0x9a3e('0xb2')]}));})[_0x9a3e('0x14')](function(_0x7fabbd){if(!_0x7fabbd)return;var _0x230188={'UserId':_0x9baf16['user']['id'],'ContactId':_0x7fabbd['id'],'MailAccountId':_0x11058a['id'],'inReplyTo':_0x48132d[_0x9a3e('0xb3')],'to':_0x9baf16['body'][_0x9a3e('0xa9')],'cc':_0x9baf16[_0x9a3e('0x62')]['cc'],'subject':_0x9baf16['body'][_0x9a3e('0xb4')],'attach':_0x9baf16['body'][_0x9a3e('0xb5')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x9a3e('0xb6')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x9a3e('0xb7'),'Messages':[_[_0x9a3e('0x57')](_0x9baf16['body'],{'messageId':_0x48132d['messageId'],'sentAt':moment()[_0x9a3e('0xb6')](_0x9a3e('0x9f')),'read':!![],'MailAccountId':_0x11058a['id'],'UserId':_0x9baf16[_0x9a3e('0x34')]['id'],'ContactId':_0x7fabbd['id']})]};if(_0x9baf16['body'][_0x9a3e('0xb8')]){_0x230188=_['merge'](_0x230188,_0x9baf16[_0x9a3e('0x62')][_0x9a3e('0xb8')]);}return db[_0x9a3e('0x85')][_0x9a3e('0x70')](_0x230188,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x9a3e('0x14')](respondWithResult(_0x19644c,null))[_0x9a3e('0x1c')](handleError(_0x19644c,null));};exports[_0x9a3e('0xb9')]=function(_0x301951,_0x5e6638){return db[_0x9a3e('0x59')][_0x9a3e('0x60')]({'where':{'id':_0x301951[_0x9a3e('0x65')]['id']},'include':[{'model':db[_0x9a3e('0x43')],'as':_0x9a3e('0x40'),'raw':!![],'include':[{'model':db[_0x9a3e('0xa7')],'as':_0x9a3e('0xa7'),'raw':!![]}]}]})[_0x9a3e('0x14')](handleEntityNotFound(_0x5e6638,null))['then'](function(_0x2f3c65){if(!_0x2f3c65[_0x9a3e('0x40')])return;var _0x151aa9=_0x2f3c65['getSmtpOptions']();return respondWithRpcPromise(_0x9a3e('0xba'),_0x9a3e('0xb9'),{'account':_0x151aa9});})[_0x9a3e('0x14')](respondWithResult(_0x5e6638,null))[_0x9a3e('0x1c')](handleError(_0x5e6638,null));};exports['destroy']=function(_0xa82f46,_0x39af50){return db[_0x9a3e('0x59')][_0x9a3e('0x60')]({'where':{'id':_0xa82f46[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x39af50,null))['then'](function(_0x5adad1){if(_0x5adad1&&_0x5adad1[_0x9a3e('0x3c')]){throw new db[(_0x9a3e('0xbb'))][(_0x9a3e('0xbc'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5adad1;})[_0x9a3e('0x14')](removeEntity(_0x39af50,null))['catch'](handleError(_0x39af50,null));};exports[_0x9a3e('0xbd')]=function(_0x4d6b57,_0x3d938f){return db[_0x9a3e('0x59')]['find']({'where':{'id':_0x4d6b57[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x3d938f,null))[_0x9a3e('0x14')](function(_0x326a8a){if(_0x326a8a){return _0x326a8a[_0x9a3e('0xbd')](_0x4d6b57[_0x9a3e('0x62')][_0x9a3e('0x6d')],_['omit'](_0x4d6b57[_0x9a3e('0x62')],[_0x9a3e('0x6d'),'id'])||{})[_0x9a3e('0xbe')](function(_0x901486){for(var _0x3510c8=0x0;_0x3510c8<_0x4d6b57[_0x9a3e('0x62')][_0x9a3e('0x6d')]['length'];_0x3510c8+=0x1){socket[_0x9a3e('0xbf')](_0x9a3e('0xc0'),{'UserId':Number(_0x4d6b57[_0x9a3e('0x62')][_0x9a3e('0x6d')][_0x3510c8]),'MailAccountId':Number(_0x4d6b57[_0x9a3e('0x65')]['id'])});}return _0x901486;});}})[_0x9a3e('0x14')](respondWithResult(_0x3d938f,null))[_0x9a3e('0x1c')](handleError(_0x3d938f,null));};exports[_0x9a3e('0xc1')]=function(_0xb735cb,_0x192d8f){return db['MailAccount'][_0x9a3e('0x60')]({'where':{'id':_0xb735cb[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x192d8f,null))[_0x9a3e('0x14')](function(_0x94c647){if(_0x94c647){return _0x94c647['removeAgents'](_0xb735cb[_0x9a3e('0x4b')][_0x9a3e('0x6d')])[_0x9a3e('0x14')](function(){if(_['isArray'](_0xb735cb[_0x9a3e('0x4b')][_0x9a3e('0x6d')])){for(var _0x2018ba=0x0;_0x2018ba<_0xb735cb[_0x9a3e('0x4b')][_0x9a3e('0x6d')]['length'];_0x2018ba+=0x1){socket[_0x9a3e('0xbf')](_0x9a3e('0xc2'),{'UserId':Number(_0xb735cb['query'][_0x9a3e('0x6d')][_0x2018ba]),'MailAccountId':Number(_0xb735cb[_0x9a3e('0x65')]['id'])});}}else{socket['emit'](_0x9a3e('0xc2'),{'UserId':Number(_0xb735cb[_0x9a3e('0x4b')][_0x9a3e('0x6d')]),'MailAccountId':Number(_0xb735cb['params']['id'])});}});}})['then'](respondWithStatusCode(_0x192d8f,null))[_0x9a3e('0x1c')](handleError(_0x192d8f,null));};exports[_0x9a3e('0xc3')]=function(_0x4ac040,_0x406af5){var _0x45304c={};var _0x35d01f={};var _0x525989;var _0x27d3a8;return db[_0x9a3e('0x59')][_0x9a3e('0x69')]({'where':{'id':_0x4ac040[_0x9a3e('0x65')]['id']}})[_0x9a3e('0x14')](handleEntityNotFound(_0x406af5,null))[_0x9a3e('0x14')](function(_0x3e6ae6){if(_0x3e6ae6){_0x525989=_0x3e6ae6;_0x35d01f[_0x9a3e('0x4f')]=_[_0x9a3e('0x5d')](db[_0x9a3e('0x89')]['rawAttributes']);_0x35d01f['query']=_[_0x9a3e('0x5d')](_0x4ac040[_0x9a3e('0x4b')]);_0x35d01f[_0x9a3e('0x4c')]=_[_0x9a3e('0x4d')](_0x35d01f[_0x9a3e('0x4f')],_0x35d01f[_0x9a3e('0x4b')]);_0x45304c['attributes']=_[_0x9a3e('0x4d')](_0x35d01f[_0x9a3e('0x4f')],qs[_0x9a3e('0x50')](_0x4ac040[_0x9a3e('0x4b')][_0x9a3e('0x50')]));_0x45304c['attributes']=_0x45304c[_0x9a3e('0x4e')][_0x9a3e('0x5e')]?_0x45304c[_0x9a3e('0x4e')]:_0x35d01f['model'];_0x45304c['order']=qs[_0x9a3e('0x53')](_0x4ac040[_0x9a3e('0x4b')][_0x9a3e('0x53')]);_0x45304c[_0x9a3e('0x54')]=qs[_0x9a3e('0x4c')](_['pick'](_0x4ac040[_0x9a3e('0x4b')],_0x35d01f[_0x9a3e('0x4c')]));if(_0x4ac040[_0x9a3e('0x4b')][_0x9a3e('0x55')]){_0x45304c['where']=_[_0x9a3e('0x57')](_0x45304c['where'],{'$or':_[_0x9a3e('0x46')](_0x45304c['attributes'],function(_0x5341f6){var _0x22315d={};_0x22315d[_0x5341f6]={'$like':'%'+_0x4ac040[_0x9a3e('0x4b')][_0x9a3e('0x55')]+'%'};return _0x22315d;})});}_0x45304c=_[_0x9a3e('0x57')]({},_0x45304c,_0x4ac040[_0x9a3e('0x58')]);return _0x525989[_0x9a3e('0xc3')](_0x45304c);}})[_0x9a3e('0x14')](function(_0x251129){if(_0x251129){_0x27d3a8=_0x251129[_0x9a3e('0x5e')];if(!_0x4ac040['query']['hasOwnProperty'](_0x9a3e('0x6a'))){_0x45304c[_0x9a3e('0x1f')]=qs[_0x9a3e('0x1f')](_0x4ac040['query'][_0x9a3e('0x1f')]);_0x45304c[_0x9a3e('0x20')]=qs[_0x9a3e('0x20')](_0x4ac040[_0x9a3e('0x4b')][_0x9a3e('0x20')]);}return _0x525989[_0x9a3e('0xc3')](_0x45304c);}})[_0x9a3e('0x14')](function(_0x43ed25){if(_0x43ed25){return _0x43ed25?{'count':_0x27d3a8,'rows':_0x43ed25}:null;}})[_0x9a3e('0x14')](respondWithResult(_0x406af5,null))[_0x9a3e('0x1c')](handleError(_0x406af5,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index dd6df81..b92f27d 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 _0x07d7=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x254360,_0x571b99){var _0x251774=function(_0x42f9cf){while(--_0x42f9cf){_0x254360['push'](_0x254360['shift']());}};_0x251774(++_0x571b99);}(_0x07d7,0x85));var _0x707d=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x07d7[_0x2a0738];return _0x159679;};'use strict';var EventEmitter=require(_0x707d('0x0'));var MailAccount=require(_0x707d('0x1'))['db'][_0x707d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x707d('0x3')](0x0);var events={'afterCreate':_0x707d('0x4'),'afterUpdate':_0x707d('0x5'),'afterDestroy':_0x707d('0x6')};function emitEvent(_0x3d6fed){return function(_0x38c520,_0x2a5ddd,_0x3b44c7){MailAccountEvents[_0x707d('0x7')](_0x3d6fed+':'+_0x38c520['id'],_0x38c520);MailAccountEvents[_0x707d('0x7')](_0x3d6fed,_0x38c520);_0x3b44c7(null);};}for(var e in events){if(events[_0x707d('0x8')](e)){var event=events[e];MailAccount[_0x707d('0x9')](e,emitEvent(event));}}module[_0x707d('0xa')]=MailAccountEvents; \ No newline at end of file +var _0xc61d=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x58f37d,_0x2b89a6){var _0x52e063=function(_0x3e02de){while(--_0x3e02de){_0x58f37d['push'](_0x58f37d['shift']());}};_0x52e063(++_0x2b89a6);}(_0xc61d,0xfb));var _0xdc61=function(_0x2b86c5,_0x2b2da4){_0x2b86c5=_0x2b86c5-0x0;var _0x10de15=_0xc61d[_0x2b86c5];return _0x10de15;};'use strict';var EventEmitter=require(_0xdc61('0x0'));var MailAccount=require(_0xdc61('0x1'))['db'][_0xdc61('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdc61('0x3')](0x0);var events={'afterCreate':_0xdc61('0x4'),'afterUpdate':_0xdc61('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2125a2){return function(_0x237baa,_0x4ebd75,_0x2b94dd){MailAccountEvents[_0xdc61('0x6')](_0x2125a2+':'+_0x237baa['id'],_0x237baa);MailAccountEvents[_0xdc61('0x6')](_0x2125a2,_0x237baa);_0x2b94dd(null);};}for(var e in events){if(events[_0xdc61('0x7')](e)){var event=events[e];MailAccount[_0xdc61('0x8')](e,emitEvent(event));}}module[_0xdc61('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 5344f2f..337ad68 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 _0x7e1e=['host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','auth','pass','./mailAccount.attributes','exports','define','mail_accounts','provider','Smtp'];(function(_0x38febf,_0x1fdebc){var _0x36db7f=function(_0x4d13b8){while(--_0x4d13b8){_0x38febf['push'](_0x38febf['shift']());}};_0x36db7f(++_0x1fdebc);}(_0x7e1e,0x82));var _0xe7e1=function(_0x5b3eec,_0x2f8554){_0x5b3eec=_0x5b3eec-0x0;var _0x2774be=_0x7e1e[_0x5b3eec];return _0x2774be;};'use strict';var attributes=require(_0xe7e1('0x0'));module[_0xe7e1('0x1')]=function(_0x58142d){return _0x58142d[_0xe7e1('0x2')]('MailAccount',attributes,{'tableName':_0xe7e1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4e6bd3=this;var _0x33a5c0={'id':_0x4e6bd3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4e6bd3['provider']!=='custom'){_0x33a5c0['service']=_0x4e6bd3[_0xe7e1('0x4')];}else{_0x33a5c0['host']=_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0x6')];_0x33a5c0[_0xe7e1('0x7')]=_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0x7')];_0x33a5c0[_0xe7e1('0x8')]=_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0x8')];}if(_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0x9')]){if(_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0xa')]){if(!_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0xb')])throw new Error(_0xe7e1('0xc'));_0x33a5c0['auth']={'type':_0xe7e1('0xd'),'user':_0x4e6bd3['Smtp'][_0xe7e1('0xe')],'accessToken':_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0xb')]['data5']};}else{_0x33a5c0[_0xe7e1('0xf')]={'user':_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0xe')],'pass':_0x4e6bd3[_0xe7e1('0x5')][_0xe7e1('0x10')]};}}return _0x33a5c0;}}});}; \ No newline at end of file +var _0x0234=['secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','CloudProvider','data5','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','host','port','Smtp'];(function(_0x4f9e04,_0x9b9d17){var _0x5ef292=function(_0x3dd841){while(--_0x3dd841){_0x4f9e04['push'](_0x4f9e04['shift']());}};_0x5ef292(++_0x9b9d17);}(_0x0234,0x1bf));var _0x4023=function(_0x1ed78f,_0x5ab61b){_0x1ed78f=_0x1ed78f-0x0;var _0x46f620=_0x0234[_0x1ed78f];return _0x46f620;};'use strict';var attributes=require(_0x4023('0x0'));module['exports']=function(_0x4837d){return _0x4837d[_0x4023('0x1')](_0x4023('0x2'),attributes,{'tableName':_0x4023('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xa8f63d=this;var _0x2ab0db={'id':_0xa8f63d['id'],'tls':{'rejectUnauthorized':![]}};if(_0xa8f63d[_0x4023('0x4')]!==_0x4023('0x5')){_0x2ab0db['service']=_0xa8f63d[_0x4023('0x4')];}else{_0x2ab0db[_0x4023('0x6')]=_0xa8f63d['Smtp'][_0x4023('0x6')];_0x2ab0db[_0x4023('0x7')]=_0xa8f63d[_0x4023('0x8')][_0x4023('0x7')];_0x2ab0db[_0x4023('0x9')]=_0xa8f63d[_0x4023('0x8')][_0x4023('0x9')];}if(_0xa8f63d[_0x4023('0x8')][_0x4023('0xa')]){if(_0xa8f63d[_0x4023('0x8')][_0x4023('0xb')]){if(!_0xa8f63d[_0x4023('0x8')]['CloudProvider'])throw new Error(_0x4023('0xc'));_0x2ab0db[_0x4023('0xd')]={'type':_0x4023('0xe'),'user':_0xa8f63d[_0x4023('0x8')][_0x4023('0xf')],'accessToken':_0xa8f63d[_0x4023('0x8')][_0x4023('0x10')][_0x4023('0x11')]};}else{_0x2ab0db[_0x4023('0xd')]={'user':_0xa8f63d[_0x4023('0x8')]['user'],'pass':_0xa8f63d[_0x4023('0x8')][_0x4023('0x12')]};}}return _0x2ab0db;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 68f045a..46f9119 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 _0x3fa4=['MailServerOut','Smtp','CloudProvider','List','applications','orderBy','asc','push','close','autoclose','*,*,*,*','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','create','Contact\x20not\x20found','spread','attach','interaction','created','MailMessage','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','UserId','name','agent','waitForTheAssignedAgent','queueId','MailQueue','unshift','waitForTheAssignedQueue','startRouting','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','model','find','map','smtp','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','body','mail','keys','CmContact','updatedAt','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','account','CmList','Contacts','DESC','MailApplication','Applications'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x3fa4,0xf0));var _0x43fa=function(_0x1e135e,_0x53b5a0){_0x1e135e=_0x1e135e-0x0;var _0x590590=_0x3fa4[_0x1e135e];return _0x590590;};'use strict';var _=require(_0x43fa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var Redis=require(_0x43fa('0x1'));var db=require(_0x43fa('0x2'))['db'];var logger=require(_0x43fa('0x3'))(_0x43fa('0x4'));var config=require(_0x43fa('0x5'));var jayson=require(_0x43fa('0x6'));var client=jayson[_0x43fa('0x7')]['http']({'port':0x232c});config[_0x43fa('0x8')]=_[_0x43fa('0x9')](config[_0x43fa('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x43fa('0xa'))(new Redis(config[_0x43fa('0x8')]));require(_0x43fa('0xb'))['register'](socket);function respondWithRpcPromise(_0x2410d4,_0x36d40d,_0x5ee967){return new BPromise(function(_0x4e775d,_0xe0c8cd){return client[_0x43fa('0xc')](_0x2410d4,_0x5ee967)[_0x43fa('0xd')](function(_0x42eba9){logger[_0x43fa('0xe')]('MailAccount,\x20%s,\x20%s',_0x36d40d,_0x43fa('0xf'));logger[_0x43fa('0x10')](_0x43fa('0x11'),_0x36d40d,'request\x20sent',JSON[_0x43fa('0x12')](_0x42eba9));if(_0x42eba9[_0x43fa('0x13')]){if(_0x42eba9[_0x43fa('0x13')]['code']===0x1f4){logger[_0x43fa('0x13')]('MailAccount,\x20%s,\x20%s',_0x36d40d,_0x42eba9['error']['message']);return _0xe0c8cd(_0x42eba9[_0x43fa('0x13')]['message']);}logger[_0x43fa('0x13')](_0x43fa('0x14'),_0x36d40d,_0x42eba9['error'][_0x43fa('0x15')]);return _0x4e775d(_0x42eba9[_0x43fa('0x13')][_0x43fa('0x15')]);}else{logger[_0x43fa('0xe')](_0x43fa('0x14'),_0x36d40d,_0x43fa('0xf'));_0x4e775d(_0x42eba9['result']['message']);}})[_0x43fa('0x16')](function(_0x29b8aa){logger[_0x43fa('0x13')](_0x43fa('0x14'),_0x36d40d,_0x29b8aa);_0xe0c8cd(_0x29b8aa);});});}exports[_0x43fa('0x17')]=function(_0x15e594){var _0xdf68a6=this;return new Promise(function(_0x2d8594,_0x3e39b7){return db['MailAccount'][_0x43fa('0x18')]({'raw':_0x15e594[_0x43fa('0x19')]?_0x15e594[_0x43fa('0x19')][_0x43fa('0x1a')]===undefined?!![]:![]:!![],'where':_0x15e594[_0x43fa('0x19')]?_0x15e594['options'][_0x43fa('0x1b')]||null:null,'attributes':_0x15e594[_0x43fa('0x19')]?_0x15e594[_0x43fa('0x19')][_0x43fa('0x1c')]||null:null,'limit':_0x15e594[_0x43fa('0x19')]?_0x15e594[_0x43fa('0x19')][_0x43fa('0x1d')]||null:null,'include':_0x15e594[_0x43fa('0x19')]?_0x15e594[_0x43fa('0x19')]['include']?_['map'](_0x15e594[_0x43fa('0x19')][_0x43fa('0x1e')],function(_0x28f695){return{'model':db[_0x28f695[_0x43fa('0x1f')]],'as':_0x28f695['as'],'attributes':_0x28f695[_0x43fa('0x1c')],'include':_0x28f695[_0x43fa('0x1e')]?_['map'](_0x28f695['include'],function(_0x1fa077){return{'model':db[_0x1fa077[_0x43fa('0x1f')]],'as':_0x1fa077['as'],'attributes':_0x1fa077[_0x43fa('0x1c')],'include':_0x1fa077[_0x43fa('0x1e')]?_['map'](_0x1fa077[_0x43fa('0x1e')],function(_0x2ea476){return{'model':db[_0x2ea476[_0x43fa('0x1f')]],'as':_0x2ea476['as'],'attributes':_0x2ea476[_0x43fa('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d5abd){logger[_0x43fa('0xe')](_0x43fa('0x17'),_0x15e594);logger[_0x43fa('0x10')](_0x43fa('0x17'),_0x15e594,JSON[_0x43fa('0x12')](_0x3d5abd));_0x2d8594(_0x3d5abd);})[_0x43fa('0x16')](function(_0x41a3cf){logger[_0x43fa('0x13')](_0x43fa('0x17'),_0x41a3cf[_0x43fa('0x15')],_0x15e594);_0x3e39b7(_0xdf68a6[_0x43fa('0x13')](0x1f4,_0x41a3cf['message']));});});};exports['ShowMailAccount']=function(_0x2791a0){var _0xca5e0=this;return new Promise(function(_0xb4bdb2,_0x414c3a){return db['MailAccount'][_0x43fa('0x20')]({'raw':_0x2791a0[_0x43fa('0x19')]?_0x2791a0[_0x43fa('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2791a0[_0x43fa('0x19')]?_0x2791a0[_0x43fa('0x19')][_0x43fa('0x1b')]||null:null,'attributes':_0x2791a0[_0x43fa('0x19')]?_0x2791a0['options'][_0x43fa('0x1c')]||null:null,'include':_0x2791a0['options']?_0x2791a0[_0x43fa('0x19')][_0x43fa('0x1e')]?_[_0x43fa('0x21')](_0x2791a0['options'][_0x43fa('0x1e')],function(_0x52d4e5){return{'model':db[_0x52d4e5['model']],'as':_0x52d4e5['as'],'attributes':_0x52d4e5[_0x43fa('0x1c')],'include':_0x52d4e5[_0x43fa('0x1e')]?_[_0x43fa('0x21')](_0x52d4e5['include'],function(_0x34668f){return{'model':db[_0x34668f[_0x43fa('0x1f')]],'as':_0x34668f['as'],'attributes':_0x34668f[_0x43fa('0x1c')],'include':_0x34668f[_0x43fa('0x1e')]?_[_0x43fa('0x21')](_0x34668f['include'],function(_0x3daddf){return{'model':db[_0x3daddf[_0x43fa('0x1f')]],'as':_0x3daddf['as'],'attributes':_0x3daddf[_0x43fa('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x43fa('0xd')](function(_0x503d9d){if(_0x2791a0['options'][_0x43fa('0x22')]===!![])_0x503d9d[_0x43fa('0x23')](_0x43fa('0x24'),_0x503d9d[_0x43fa('0x25')]());logger[_0x43fa('0xe')]('ShowMailAccount',_0x2791a0);logger[_0x43fa('0x10')]('ShowMailAccount',_0x2791a0,JSON['stringify'](_0x503d9d));_0xb4bdb2(_0x503d9d);})[_0x43fa('0x16')](function(_0x59e332){logger[_0x43fa('0x13')](_0x43fa('0x26'),_0x59e332[_0x43fa('0x15')],_0x2791a0);_0x414c3a(_0xca5e0[_0x43fa('0x13')](0x1f4,_0x59e332['message']));});});};exports['NotifyMailAccount']=function(_0x4911f6){var _0x20568b=this;return new Promise(function(_0x15ef49,_0x548a67){var _0x36e08e={'body':_0x4911f6[_0x43fa('0x27')],'channel':_0x43fa('0x28')};var _0x25555a=_['difference'](_[_0x43fa('0x29')](db[_0x43fa('0x2a')]['rawAttributes']),['createdAt',_0x43fa('0x2b'),'CompanyId',_0x43fa('0x2c')]);var _0x137ef=![];if(_0x4911f6['body']['id']){delete _0x4911f6[_0x43fa('0x27')]['id'];}if(_['isNil'](_0x4911f6[_0x43fa('0x27')][_0x43fa('0x2d')])){return _0x548a67(_0x20568b[_0x43fa('0x13')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x43fa('0x2e')](_0x4911f6[_0x43fa('0x27')][_0x43fa('0x27')])||_0x4911f6[_0x43fa('0x27')][_0x43fa('0x27')]===''){return _0x548a67(_0x20568b[_0x43fa('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x43fa('0x2e')](_0x4911f6['body'][_0x43fa('0x2f')])){return _0x548a67(_0x20568b['error'](0x1f4,_0x43fa('0x30')+_0x25555a));}if(!_[_0x43fa('0x31')](_0x25555a,_0x4911f6[_0x43fa('0x27')][_0x43fa('0x2f')])){return _0x548a67(_0x20568b[_0x43fa('0x13')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25555a));}var _0x2fffef={};_0x2fffef[_0x4911f6['body']['mapKey']]=_0x4911f6['body'][_0x43fa('0x2d')];return db[_0x43fa('0x32')][_0x43fa('0x20')]({'where':{'id':_0x4911f6[_0x43fa('0x33')]['id']},'include':[{'model':db[_0x43fa('0x34')],'as':'List','include':[{'model':db[_0x43fa('0x2a')],'as':_0x43fa('0x35'),'where':_0x2fffef,'limit':0x1,'order':[[_0x43fa('0x2b'),_0x43fa('0x36')]]}]},{'model':db[_0x43fa('0x37')],'as':_0x43fa('0x38')},{'model':db[_0x43fa('0x39')],'as':_0x43fa('0x3a'),'include':[{'model':db[_0x43fa('0x3b')],'as':_0x43fa('0x3b')}]}]})[_0x43fa('0xd')](function(_0x52d66f){if(_0x52d66f&&_0x52d66f[_0x43fa('0x3c')]){var _0x2a06ff=_0x52d66f['get']({'plain':!![]});_0x36e08e[_0x43fa('0x33')]=_['omit'](_0x2a06ff,[_0x43fa('0x38'),_0x43fa('0x3c')]);_0x36e08e[_0x43fa('0x33')][_0x43fa('0x24')]=_0x52d66f[_0x43fa('0x25')]();_0x36e08e['applications']=_0x2a06ff[_0x43fa('0x38')];_0x36e08e['list']=_0x2a06ff[_0x43fa('0x3c')];_0x36e08e[_0x43fa('0x3d')]=_[_0x43fa('0x3e')](_0x36e08e['applications'],['priority'],[_0x43fa('0x3f')]);if(_0x36e08e['account']&&_0x36e08e[_0x43fa('0x33')]['autoclose']){_0x36e08e['applications'][_0x43fa('0x40')]({'id':0x0,'priority':_0x36e08e[_0x43fa('0x3d')]['length']+0x1,'app':_0x43fa('0x41'),'appdata':_0x43fa('0x42'),'interval':_0x43fa('0x43')});}if(_0x36e08e[_0x43fa('0x33')]['Applications']){delete _0x36e08e[_0x43fa('0x33')][_0x43fa('0x38')];}if(_0x36e08e[_0x43fa('0x33')][_0x43fa('0x3c')]){delete _0x36e08e['account']['List'];}if(_0x2a06ff[_0x43fa('0x3c')]['Contacts']['length']){return _0x2a06ff['List'][_0x43fa('0x35')][0x0];}var _0x1f36e1=_[_0x43fa('0x9')](_0x4911f6[_0x43fa('0x27')],{'firstName':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x2d')],'ListId':_0x2a06ff[_0x43fa('0x2c')]});_0x1f36e1[_0x4911f6['body'][_0x43fa('0x2f')]]=_0x4911f6[_0x43fa('0x27')]['from'];return db[_0x43fa('0x2a')]['create'](_0x1f36e1);}else{throw new Error(_0x43fa('0x44'));}})[_0x43fa('0xd')](function(_0x3b9de0){_0x36e08e[_0x43fa('0x45')]=_0x3b9de0;if(_0x3b9de0){if(!_0x4911f6['body']['message'][_0x43fa('0x46')]){_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x46')]=rs['generate']()+'\x20'+_0x4911f6['body'][_0x43fa('0x15')]['from'];}var _0x30323c={'ContactId':_0x3b9de0['id'],'MailAccountId':_0x4911f6[_0x43fa('0x33')]['id'],'inReplyTo':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['messageId'],'to':_0x4911f6['body'][_0x43fa('0x15')]['from'],'cc':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['cc'],'subject':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x47')],'attach':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['attach'],'lastMsgAt':moment()[_0x43fa('0x48')](_0x43fa('0x49')),'lastMsgDirection':'in'};return db[_0x43fa('0x4a')][_0x43fa('0x20')]({'where':{'closed':![],'MailAccountId':_0x4911f6[_0x43fa('0x33')]['id']},'include':[{'model':db['MailMessage'],'as':_0x43fa('0x4b'),'attributes':[_0x43fa('0x46')],'where':{'messageId':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x4c')]}}]})[_0x43fa('0xd')](function(_0x12681e){if(_0x12681e){return[_0x12681e,![]];}return db[_0x43fa('0x4a')][_0x43fa('0x4d')](_0x30323c)['then'](function(_0x1395f4){return[_0x1395f4,!![]];});});}else{throw new Error(_0x43fa('0x4e'));}})[_0x43fa('0x4f')](function(_0x170dac,_0x31fdeb){if(_0x170dac){_0x137ef=_0x31fdeb;if(!_0x31fdeb){return _0x170dac['update']({'inReplyTo':_0x4911f6['body'][_0x43fa('0x15')][_0x43fa('0x46')],'to':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x2d')],'cc':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['cc'],'subject':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x47')],'attach':_0x170dac[_0x43fa('0x50')]?_0x170dac[_0x43fa('0x50')]:_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x50')],'substatus':null,'substatusAt':moment()[_0x43fa('0x48')](_0x43fa('0x49')),'lastMsgAt':moment()[_0x43fa('0x48')](_0x43fa('0x49')),'lastMsgDirection':'in'});}else{return _0x170dac;}}})[_0x43fa('0xd')](function(_0x1554e6){_0x36e08e[_0x43fa('0x51')]=_0x1554e6['get']({'plain':!![]});_0x36e08e['interaction'][_0x43fa('0x52')]=_0x137ef;return db[_0x43fa('0x53')]['create']({'body':_0x4911f6[_0x43fa('0x27')]['body'],'MailAccountId':_0x4911f6[_0x43fa('0x33')]['id'],'MailInteractionId':_0x1554e6['id'],'direction':'in','ContactId':_0x36e08e['contact']['id'],'messageId':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x46')],'from':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['from'],'to':_0x4911f6[_0x43fa('0x27')]['message']['to'],'cc':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['cc'],'subject':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x47')],'attach':_0x4911f6['body'][_0x43fa('0x15')][_0x43fa('0x50')],'Attachments':_0x4911f6['body'][_0x43fa('0x15')]['attachments'],'originTo':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')]['originTo'],'originCc':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x54')],'bcc':_0x4911f6['body']['message'][_0x43fa('0x55')],'ChatWebsiteId':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x56')]||null,'originChannel':_0x4911f6['body'][_0x43fa('0x15')]['originChannel']||'Email','ChatOfflineMessageId':_0x4911f6[_0x43fa('0x27')][_0x43fa('0x15')][_0x43fa('0x57')]||null},{'include':[{'model':db[_0x43fa('0x58')],'as':_0x43fa('0x59')}]});})[_0x43fa('0xd')](function(_0x4842b1){_0x36e08e[_0x43fa('0x15')]=_0x4842b1;if(!_0x36e08e[_0x43fa('0x51')][_0x43fa('0x5a')]){return;}return db['User'][_0x43fa('0x20')]({'attributes':['id',_0x43fa('0x5b')],'where':{'id':_0x36e08e[_0x43fa('0x51')]['UserId']}});})[_0x43fa('0xd')](function(_0x2f7380){if(_0x2f7380){_0x36e08e['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x43fa('0x5c'),'appdata':_0x2f7380[_0x43fa('0x5b')]+','+(_0x36e08e[_0x43fa('0x33')][_0x43fa('0x5d')]||0xa),'interval':_0x43fa('0x43')});}if(!_0x36e08e[_0x43fa('0x51')][_0x43fa('0x5e')]){return;}return db[_0x43fa('0x5f')][_0x43fa('0x20')]({'attributes':['id',_0x43fa('0x5b')],'where':{'id':_0x36e08e[_0x43fa('0x51')][_0x43fa('0x5e')]}});})[_0x43fa('0xd')](function(_0x408419){if(_0x408419){_0x36e08e[_0x43fa('0x3d')][_0x43fa('0x60')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x408419[_0x43fa('0x5b')]+','+(_0x36e08e[_0x43fa('0x33')][_0x43fa('0x61')]||0x12c),'interval':_0x43fa('0x43')});}return respondWithRpcPromise('Start',_0x43fa('0x62'),_0x36e08e);})['then'](function(_0x4fd721){_0x15ef49(_0x4fd721);})['catch'](function(_0x46d43d){_0x548a67(_0x20568b['error'](0x1f4,_0x46d43d[_0x43fa('0x15')]));});});}; \ No newline at end of file +var _0xb138=['messageId','generate','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','create','subject','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','name','unshift','waitForTheAssignedAgent','MailQueue','queueId','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','GetMailAccount','findAll','options','where','attributes','limit','include','model','map','ShowMailAccount','find','raw','setDataValue','getSmtpOptions','body','mail','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','Contacts','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','smtpOptions','applications','Applications','list','orderBy','priority','asc','autoclose','push','close','length','List\x20not\x20found'];(function(_0x3133e2,_0x444385){var _0x4b95ad=function(_0x189dcc){while(--_0x189dcc){_0x3133e2['push'](_0x3133e2['shift']());}};_0x4b95ad(++_0x444385);}(_0xb138,0x1dd));var _0x8b13=function(_0x1890b9,_0x4bc103){_0x1890b9=_0x1890b9-0x0;var _0x46d9c6=_0xb138[_0x1890b9];return _0x46d9c6;};'use strict';var _=require(_0x8b13('0x0'));var moment=require(_0x8b13('0x1'));var BPromise=require(_0x8b13('0x2'));var rs=require(_0x8b13('0x3'));var Redis=require(_0x8b13('0x4'));var db=require(_0x8b13('0x5'))['db'];var logger=require(_0x8b13('0x6'))('rpc');var config=require(_0x8b13('0x7'));var jayson=require(_0x8b13('0x8'));var client=jayson[_0x8b13('0x9')]['http']({'port':0x232c});config[_0x8b13('0xa')]=_[_0x8b13('0xb')](config['redis'],{'host':_0x8b13('0xc'),'port':0x18eb});var socket=require(_0x8b13('0xd'))(new Redis(config[_0x8b13('0xa')]));require('./mailAccount.socket')[_0x8b13('0xe')](socket);function respondWithRpcPromise(_0x1aed6f,_0x58683a,_0x53ae50){return new BPromise(function(_0x1f2528,_0x21fcd9){return client[_0x8b13('0xf')](_0x1aed6f,_0x53ae50)[_0x8b13('0x10')](function(_0x3e8eca){logger['info'](_0x8b13('0x11'),_0x58683a,_0x8b13('0x12'));logger[_0x8b13('0x13')](_0x8b13('0x14'),_0x58683a,_0x8b13('0x12'),JSON[_0x8b13('0x15')](_0x3e8eca));if(_0x3e8eca['error']){if(_0x3e8eca['error'][_0x8b13('0x16')]===0x1f4){logger[_0x8b13('0x17')]('MailAccount,\x20%s,\x20%s',_0x58683a,_0x3e8eca['error']['message']);return _0x21fcd9(_0x3e8eca[_0x8b13('0x17')][_0x8b13('0x18')]);}logger[_0x8b13('0x17')](_0x8b13('0x11'),_0x58683a,_0x3e8eca[_0x8b13('0x17')]['message']);return _0x1f2528(_0x3e8eca[_0x8b13('0x17')][_0x8b13('0x18')]);}else{logger[_0x8b13('0x19')](_0x8b13('0x11'),_0x58683a,_0x8b13('0x12'));_0x1f2528(_0x3e8eca[_0x8b13('0x1a')][_0x8b13('0x18')]);}})[_0x8b13('0x1b')](function(_0x4989d3){logger['error'](_0x8b13('0x11'),_0x58683a,_0x4989d3);_0x21fcd9(_0x4989d3);});});}exports[_0x8b13('0x1c')]=function(_0x14a8ac){var _0x9c03b4=this;return new Promise(function(_0x1e0fe3,_0x3cc9a0){return db['MailAccount'][_0x8b13('0x1d')]({'raw':_0x14a8ac[_0x8b13('0x1e')]?_0x14a8ac[_0x8b13('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x14a8ac['options']?_0x14a8ac[_0x8b13('0x1e')][_0x8b13('0x1f')]||null:null,'attributes':_0x14a8ac['options']?_0x14a8ac[_0x8b13('0x1e')][_0x8b13('0x20')]||null:null,'limit':_0x14a8ac[_0x8b13('0x1e')]?_0x14a8ac[_0x8b13('0x1e')][_0x8b13('0x21')]||null:null,'include':_0x14a8ac['options']?_0x14a8ac[_0x8b13('0x1e')][_0x8b13('0x22')]?_['map'](_0x14a8ac[_0x8b13('0x1e')]['include'],function(_0x420772){return{'model':db[_0x420772[_0x8b13('0x23')]],'as':_0x420772['as'],'attributes':_0x420772['attributes'],'include':_0x420772[_0x8b13('0x22')]?_[_0x8b13('0x24')](_0x420772['include'],function(_0x134c5e){return{'model':db[_0x134c5e[_0x8b13('0x23')]],'as':_0x134c5e['as'],'attributes':_0x134c5e[_0x8b13('0x20')],'include':_0x134c5e[_0x8b13('0x22')]?_[_0x8b13('0x24')](_0x134c5e['include'],function(_0x6023f5){return{'model':db[_0x6023f5[_0x8b13('0x23')]],'as':_0x6023f5['as'],'attributes':_0x6023f5[_0x8b13('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8b13('0x10')](function(_0x114b01){logger[_0x8b13('0x19')]('GetMailAccount',_0x14a8ac);logger[_0x8b13('0x13')](_0x8b13('0x1c'),_0x14a8ac,JSON[_0x8b13('0x15')](_0x114b01));_0x1e0fe3(_0x114b01);})[_0x8b13('0x1b')](function(_0x23fde7){logger[_0x8b13('0x17')](_0x8b13('0x1c'),_0x23fde7[_0x8b13('0x18')],_0x14a8ac);_0x3cc9a0(_0x9c03b4[_0x8b13('0x17')](0x1f4,_0x23fde7['message']));});});};exports[_0x8b13('0x25')]=function(_0x193965){var _0x288ff7=this;return new Promise(function(_0x2878a6,_0x51a334){return db['MailAccount'][_0x8b13('0x26')]({'raw':_0x193965['options']?_0x193965['options'][_0x8b13('0x27')]===undefined?!![]:![]:!![],'where':_0x193965['options']?_0x193965[_0x8b13('0x1e')][_0x8b13('0x1f')]||null:null,'attributes':_0x193965[_0x8b13('0x1e')]?_0x193965[_0x8b13('0x1e')][_0x8b13('0x20')]||null:null,'include':_0x193965[_0x8b13('0x1e')]?_0x193965[_0x8b13('0x1e')][_0x8b13('0x22')]?_[_0x8b13('0x24')](_0x193965[_0x8b13('0x1e')]['include'],function(_0xa07850){return{'model':db[_0xa07850[_0x8b13('0x23')]],'as':_0xa07850['as'],'attributes':_0xa07850[_0x8b13('0x20')],'include':_0xa07850[_0x8b13('0x22')]?_[_0x8b13('0x24')](_0xa07850[_0x8b13('0x22')],function(_0x6b4645){return{'model':db[_0x6b4645[_0x8b13('0x23')]],'as':_0x6b4645['as'],'attributes':_0x6b4645['attributes'],'include':_0x6b4645[_0x8b13('0x22')]?_['map'](_0x6b4645[_0x8b13('0x22')],function(_0x37732c){return{'model':db[_0x37732c[_0x8b13('0x23')]],'as':_0x37732c['as'],'attributes':_0x37732c[_0x8b13('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8b13('0x10')](function(_0x327eb1){if(_0x193965['options']['smtp']===!![])_0x327eb1[_0x8b13('0x28')]('smtpOptions',_0x327eb1[_0x8b13('0x29')]());logger['info'](_0x8b13('0x25'),_0x193965);logger[_0x8b13('0x13')](_0x8b13('0x25'),_0x193965,JSON[_0x8b13('0x15')](_0x327eb1));_0x2878a6(_0x327eb1);})[_0x8b13('0x1b')](function(_0x4e16e7){logger['error'](_0x8b13('0x25'),_0x4e16e7['message'],_0x193965);_0x51a334(_0x288ff7[_0x8b13('0x17')](0x1f4,_0x4e16e7[_0x8b13('0x18')]));});});};exports['NotifyMailAccount']=function(_0x1012eb){var _0x41d710=this;return new Promise(function(_0x35c1d6,_0x81b931){var _0x2f4e7f={'body':_0x1012eb[_0x8b13('0x2a')],'channel':_0x8b13('0x2b')};var _0x516c70=_['difference'](_['keys'](db[_0x8b13('0x2c')][_0x8b13('0x2d')]),[_0x8b13('0x2e'),_0x8b13('0x2f'),_0x8b13('0x30'),_0x8b13('0x31')]);var _0x492f7d=![];if(_0x1012eb[_0x8b13('0x2a')]['id']){delete _0x1012eb['body']['id'];}if(_[_0x8b13('0x32')](_0x1012eb['body'][_0x8b13('0x33')])){return _0x81b931(_0x41d710[_0x8b13('0x17')](0x1f4,_0x8b13('0x34')));}if(_[_0x8b13('0x32')](_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x2a')])||_0x1012eb[_0x8b13('0x2a')]['body']===''){return _0x81b931(_0x41d710['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8b13('0x32')](_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x35')])){return _0x81b931(_0x41d710[_0x8b13('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x516c70));}if(!_['includes'](_0x516c70,_0x1012eb[_0x8b13('0x2a')]['mapKey'])){return _0x81b931(_0x41d710[_0x8b13('0x17')](0x1f4,_0x8b13('0x36')+_0x516c70));}var _0x20c363={};_0x20c363[_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x35')]]=_0x1012eb['body'][_0x8b13('0x33')];return db[_0x8b13('0x37')][_0x8b13('0x26')]({'where':{'id':_0x1012eb[_0x8b13('0x38')]['id']},'include':[{'model':db[_0x8b13('0x39')],'as':_0x8b13('0x3a'),'include':[{'model':db[_0x8b13('0x2c')],'as':_0x8b13('0x3b'),'where':_0x20c363,'limit':0x1,'order':[[_0x8b13('0x2f'),'DESC']]}]},{'model':db[_0x8b13('0x3c')],'as':'Applications'},{'model':db[_0x8b13('0x3d')],'as':_0x8b13('0x3e'),'include':[{'model':db[_0x8b13('0x3f')],'as':'CloudProvider'}]}]})[_0x8b13('0x10')](function(_0x35f612){if(_0x35f612&&_0x35f612[_0x8b13('0x3a')]){var _0x4129c0=_0x35f612[_0x8b13('0x40')]({'plain':!![]});_0x2f4e7f[_0x8b13('0x38')]=_[_0x8b13('0x41')](_0x4129c0,['Applications',_0x8b13('0x3a')]);_0x2f4e7f['account'][_0x8b13('0x42')]=_0x35f612[_0x8b13('0x29')]();_0x2f4e7f[_0x8b13('0x43')]=_0x4129c0[_0x8b13('0x44')];_0x2f4e7f[_0x8b13('0x45')]=_0x4129c0[_0x8b13('0x3a')];_0x2f4e7f[_0x8b13('0x43')]=_[_0x8b13('0x46')](_0x2f4e7f[_0x8b13('0x43')],[_0x8b13('0x47')],[_0x8b13('0x48')]);if(_0x2f4e7f[_0x8b13('0x38')]&&_0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x49')]){_0x2f4e7f[_0x8b13('0x43')][_0x8b13('0x4a')]({'id':0x0,'priority':_0x2f4e7f[_0x8b13('0x43')]['length']+0x1,'app':_0x8b13('0x4b'),'appdata':_0x8b13('0x49'),'interval':'*,*,*,*'});}if(_0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x44')]){delete _0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x44')];}if(_0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x3a')]){delete _0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x3a')];}if(_0x4129c0[_0x8b13('0x3a')][_0x8b13('0x3b')][_0x8b13('0x4c')]){return _0x4129c0[_0x8b13('0x3a')][_0x8b13('0x3b')][0x0];}var _0x25ab1f=_[_0x8b13('0xb')](_0x1012eb['body'],{'firstName':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x33')],'ListId':_0x4129c0['ListId']});_0x25ab1f[_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x35')]]=_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x33')];return db[_0x8b13('0x2c')]['create'](_0x25ab1f);}else{throw new Error(_0x8b13('0x4d'));}})[_0x8b13('0x10')](function(_0x46850a){_0x2f4e7f['contact']=_0x46850a;if(_0x46850a){if(!_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['messageId']){_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x4e')]=rs[_0x8b13('0x4f')]()+'\x20'+_0x1012eb['body'][_0x8b13('0x18')][_0x8b13('0x33')];}var _0x52e705={'ContactId':_0x46850a['id'],'MailAccountId':_0x1012eb[_0x8b13('0x38')]['id'],'inReplyTo':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x4e')],'to':_0x1012eb['body'][_0x8b13('0x18')][_0x8b13('0x33')],'cc':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['cc'],'subject':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['subject'],'attach':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x50')],'lastMsgAt':moment()['format'](_0x8b13('0x51')),'lastMsgDirection':'in'};return db[_0x8b13('0x52')][_0x8b13('0x26')]({'where':{'closed':![],'MailAccountId':_0x1012eb[_0x8b13('0x38')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x1012eb['body']['message'][_0x8b13('0x53')]}}]})[_0x8b13('0x10')](function(_0x574f98){if(_0x574f98){return[_0x574f98,![]];}return db[_0x8b13('0x52')]['create'](_0x52e705)[_0x8b13('0x10')](function(_0x2d2fa3){return[_0x2d2fa3,!![]];});});}else{throw new Error(_0x8b13('0x54'));}})[_0x8b13('0x55')](function(_0x43f12a,_0x2ff9c3){if(_0x43f12a){_0x492f7d=_0x2ff9c3;if(!_0x2ff9c3){return _0x43f12a[_0x8b13('0x56')]({'inReplyTo':_0x1012eb['body'][_0x8b13('0x18')]['messageId'],'to':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x33')],'cc':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['cc'],'subject':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['subject'],'attach':_0x43f12a[_0x8b13('0x50')]?_0x43f12a['attach']:_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x50')],'substatus':null,'substatusAt':moment()[_0x8b13('0x57')](_0x8b13('0x51')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x43f12a;}}})[_0x8b13('0x10')](function(_0x37a243){_0x2f4e7f['interaction']=_0x37a243[_0x8b13('0x40')]({'plain':!![]});_0x2f4e7f[_0x8b13('0x58')][_0x8b13('0x59')]=_0x492f7d;return db['MailMessage'][_0x8b13('0x5a')]({'body':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x2a')],'MailAccountId':_0x1012eb[_0x8b13('0x38')]['id'],'MailInteractionId':_0x37a243['id'],'direction':'in','ContactId':_0x2f4e7f['contact']['id'],'messageId':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['messageId'],'from':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x33')],'to':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['to'],'cc':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['cc'],'subject':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x5b')],'attach':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x50')],'Attachments':_0x1012eb[_0x8b13('0x2a')]['message'][_0x8b13('0x5c')],'originTo':_0x1012eb['body'][_0x8b13('0x18')][_0x8b13('0x5d')],'originCc':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')]['originCc'],'bcc':_0x1012eb['body'][_0x8b13('0x18')][_0x8b13('0x5e')],'ChatWebsiteId':_0x1012eb['body'][_0x8b13('0x18')][_0x8b13('0x5f')]||null,'originChannel':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x60')]||_0x8b13('0x61'),'ChatOfflineMessageId':_0x1012eb[_0x8b13('0x2a')][_0x8b13('0x18')][_0x8b13('0x62')]||null},{'include':[{'model':db[_0x8b13('0x63')],'as':'Attachments'}]});})[_0x8b13('0x10')](function(_0x2e7477){_0x2f4e7f['message']=_0x2e7477;if(!_0x2f4e7f[_0x8b13('0x58')][_0x8b13('0x64')]){return;}return db['User'][_0x8b13('0x26')]({'attributes':['id',_0x8b13('0x65')],'where':{'id':_0x2f4e7f[_0x8b13('0x58')][_0x8b13('0x64')]}});})[_0x8b13('0x10')](function(_0xe81c2e){if(_0xe81c2e){_0x2f4e7f[_0x8b13('0x43')][_0x8b13('0x66')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe81c2e[_0x8b13('0x65')]+','+(_0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x2f4e7f[_0x8b13('0x58')]['queueId']){return;}return db[_0x8b13('0x68')][_0x8b13('0x26')]({'attributes':['id',_0x8b13('0x65')],'where':{'id':_0x2f4e7f[_0x8b13('0x58')][_0x8b13('0x69')]}});})[_0x8b13('0x10')](function(_0x41cefe){if(_0x41cefe){_0x2f4e7f[_0x8b13('0x43')][_0x8b13('0x66')]({'id':0x0,'priority':0x1,'app':_0x8b13('0x6a'),'appdata':_0x41cefe['name']+','+(_0x2f4e7f[_0x8b13('0x38')][_0x8b13('0x6b')]||0x12c),'interval':_0x8b13('0x6c')});}return respondWithRpcPromise(_0x8b13('0x6d'),_0x8b13('0x6e'),_0x2f4e7f);})[_0x8b13('0x10')](function(_0x2c69f5){_0x35c1d6(_0x2c69f5);})[_0x8b13('0x1b')](function(_0x5cb836){_0x81b931(_0x41d710[_0x8b13('0x17')](0x1f4,_0x5cb836[_0x8b13('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 61e2f71..2c5a51b 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 _0x382a=['mailAccount:','./mailAccount.events','save','update','emit','removeListener','register'];(function(_0x660527,_0x8378a6){var _0x5cf71c=function(_0x53017e){while(--_0x53017e){_0x660527['push'](_0x660527['shift']());}};_0x5cf71c(++_0x8378a6);}(_0x382a,0x120));var _0xa382=function(_0x3a5a8d,_0x22dac9){_0x3a5a8d=_0x3a5a8d-0x0;var _0x1b94b7=_0x382a[_0x3a5a8d];return _0x1b94b7;};'use strict';var MailAccountEvents=require(_0xa382('0x0'));var events=[_0xa382('0x1'),'remove',_0xa382('0x2')];function createListener(_0xf05949,_0x686c35){return function(_0x14a495){_0x686c35[_0xa382('0x3')](_0xf05949,_0x14a495);};}function removeListener(_0x25d760,_0x390163){return function(){MailAccountEvents[_0xa382('0x4')](_0x25d760,_0x390163);};}exports[_0xa382('0x5')]=function(_0x59cd0f){for(var _0x651ff3=0x0,_0x7008e5=events['length'];_0x651ff3<_0x7008e5;_0x651ff3++){var _0x333d5a=events[_0x651ff3];var _0x17ed0f=createListener(_0xa382('0x6')+_0x333d5a,_0x59cd0f);MailAccountEvents['on'](_0x333d5a,_0x17ed0f);}}; \ No newline at end of file +var _0xa412=['save','remove','update','register','mailAccount:','./mailAccount.events'];(function(_0x37b42e,_0x3c4b35){var _0x1dca41=function(_0x23fdf7){while(--_0x23fdf7){_0x37b42e['push'](_0x37b42e['shift']());}};_0x1dca41(++_0x3c4b35);}(_0xa412,0xa7));var _0x2a41=function(_0x1cda45,_0x754471){_0x1cda45=_0x1cda45-0x0;var _0x24ce43=_0xa412[_0x1cda45];return _0x24ce43;};'use strict';var MailAccountEvents=require(_0x2a41('0x0'));var events=[_0x2a41('0x1'),_0x2a41('0x2'),_0x2a41('0x3')];function createListener(_0x3ffbcc,_0x1c8048){return function(_0x473575){_0x1c8048['emit'](_0x3ffbcc,_0x473575);};}function removeListener(_0x33e87b,_0x517ee2){return function(){MailAccountEvents['removeListener'](_0x33e87b,_0x517ee2);};}exports[_0x2a41('0x4')]=function(_0x54a9ea){for(var _0x56d9e2=0x0,_0x39ed65=events['length'];_0x56d9e2<_0x39ed65;_0x56d9e2++){var _0x4880e9=events[_0x56d9e2];var _0x1fdaf4=createListener(_0x2a41('0x5')+_0x4880e9,_0x54a9ea);MailAccountEvents['on'](_0x4880e9,_0x1fdaf4);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index fa59931..dd545f5 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 _0xb221=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xf58288,_0x35333c){var _0x196e87=function(_0x2f8a09){while(--_0x2f8a09){_0xf58288['push'](_0xf58288['shift']());}};_0x196e87(++_0x35333c);}(_0xb221,0xb0));var _0x1b22=function(_0x3e043a,_0x3beb96){_0x3e043a=_0x3e043a-0x0;var _0x57647f=_0xb221[_0x3e043a];return _0x57647f;};'use strict';var multer=require(_0x1b22('0x0'));var util=require(_0x1b22('0x1'));var path=require(_0x1b22('0x2'));var timeout=require(_0x1b22('0x3'));var express=require(_0x1b22('0x4'));var router=express[_0x1b22('0x5')]();var fs_extra=require(_0x1b22('0x6'));var auth=require(_0x1b22('0x7'));var interaction=require(_0x1b22('0x8'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x1b22('0x9')](_0x1b22('0xa'),auth[_0x1b22('0xb')](),controller[_0x1b22('0xc')]);router[_0x1b22('0xd')]('/:id',auth[_0x1b22('0xb')](),controller[_0x1b22('0xe')]);router[_0x1b22('0xf')](_0x1b22('0xa'),auth[_0x1b22('0xb')](),controller[_0x1b22('0x10')]);module[_0x1b22('0x11')]=router; \ No newline at end of file +var _0x5058=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x576ab9,_0x2e6eef){var _0x4fcf15=function(_0x366831){while(--_0x366831){_0x576ab9['push'](_0x576ab9['shift']());}};_0x4fcf15(++_0x2e6eef);}(_0x5058,0x121));var _0x8505=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x5058[_0x456032];return _0x1a53cd;};'use strict';var multer=require(_0x8505('0x0'));var util=require('util');var path=require(_0x8505('0x1'));var timeout=require(_0x8505('0x2'));var express=require(_0x8505('0x3'));var router=express[_0x8505('0x4')]();var fs_extra=require(_0x8505('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8505('0x6'));var config=require(_0x8505('0x7'));var controller=require(_0x8505('0x8'));router[_0x8505('0x9')](_0x8505('0xa'),auth[_0x8505('0xb')](),controller[_0x8505('0xc')]);router[_0x8505('0xd')](_0x8505('0xa'),auth['isAuthenticated'](),controller[_0x8505('0xe')]);router[_0x8505('0xf')]('/:id',auth[_0x8505('0xb')](),controller[_0x8505('0x10')]);module[_0x8505('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index c695543..cca2871 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 _0x30a4=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x53ef4f,_0x4ed551){var _0x5ef8ce=function(_0xae9d8f){while(--_0xae9d8f){_0x53ef4f['push'](_0x53ef4f['shift']());}};_0x5ef8ce(++_0x4ed551);}(_0x30a4,0x1df));var _0x430a=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x30a4[_0x154940];return _0x401409;};'use strict';var Sequelize=require(_0x430a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x430a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x430a('0x2')],'allowNull':![],'defaultValue':_0x430a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x430a('0x2')]},'interval':{'type':Sequelize[_0x430a('0x2')],'defaultValue':_0x430a('0x4')}}; \ No newline at end of file +var _0x1b0a=['sequelize','STRING','noop'];(function(_0x47250a,_0x56586f){var _0x593fef=function(_0x1e6587){while(--_0x1e6587){_0x47250a['push'](_0x47250a['shift']());}};_0x593fef(++_0x56586f);}(_0x1b0a,0x1bc));var _0xa1b0=function(_0x5fad36,_0x540a39){_0x5fad36=_0x5fad36-0x0;var _0x444d88=_0x1b0a[_0x5fad36];return _0x444d88;};'use strict';var Sequelize=require(_0xa1b0('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa1b0('0x1')],'allowNull':![],'defaultValue':_0xa1b0('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa1b0('0x1')]},'interval':{'type':Sequelize[_0xa1b0('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 2c592af..5f74d30 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','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','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x3042d5,_0x349534){var _0x1acfef=function(_0x5a920f){while(--_0x5a920f){_0x3042d5['push'](_0x3042d5['shift']());}};_0x1acfef(++_0x349534);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x359484,_0x2c9e98){var _0x1f46e9=function(_0x309bd1){while(--_0x309bd1){_0x359484['push'](_0x359484['shift']());}};_0x1f46e9(++_0x2c9e98);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54d52,_0x2473ba){_0x54d52=_0x54d52-0x0;var _0x968345=_0xcb91[_0x54d52];return _0x968345;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 55c0652..45c8195 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 _0x2c31=['api','request-promise','path','rimraf','./mailApplication.attributes','MailApplication','../../config/logger'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0x2c31,0x1f0));var _0x12c3=function(_0x1ecbf1,_0x2cfdec){_0x1ecbf1=_0x1ecbf1-0x0;var _0x4f11a0=_0x2c31[_0x1ecbf1];return _0x4f11a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x12c3('0x0'))(_0x12c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x12c3('0x2'));var fs=require('fs');var path=require(_0x12c3('0x3'));var rimraf=require(_0x12c3('0x4'));var config=require('../../config/environment');var attributes=require(_0x12c3('0x5'));module['exports']=function(_0x414961,_0x19c652){return _0x414961['define'](_0x12c3('0x6'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9b77=['define','MailApplication','mail_applications','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x545e01,_0x1d5a91){var _0x1d46e0=function(_0x19fd78){while(--_0x19fd78){_0x545e01['push'](_0x545e01['shift']());}};_0x1d46e0(++_0x1d5a91);}(_0x9b77,0x10e));var _0x79b7=function(_0x397014,_0x17cc12){_0x397014=_0x397014-0x0;var _0x1163f7=_0x9b77[_0x397014];return _0x1163f7;};'use strict';var _=require('lodash');var util=require(_0x79b7('0x0'));var logger=require(_0x79b7('0x1'))(_0x79b7('0x2'));var moment=require('moment');var BPromise=require(_0x79b7('0x3'));var rp=require(_0x79b7('0x4'));var fs=require('fs');var path=require(_0x79b7('0x5'));var rimraf=require(_0x79b7('0x6'));var config=require(_0x79b7('0x7'));var attributes=require(_0x79b7('0x8'));module[_0x79b7('0x9')]=function(_0x2be858,_0x4e1e86){return _0x2be858[_0x79b7('0xa')](_0x79b7('0xb'),attributes,{'tableName':_0x79b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x79b7('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3a88ecc..c17c16e 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 _0x0457=['debug','stringify','error','code','message','catch','UpdateMailApplication','body','options','raw','where','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x26b026,_0x20885e){var _0x149e0f=function(_0x4f14d5){while(--_0x4f14d5){_0x26b026['push'](_0x26b026['shift']());}};_0x149e0f(++_0x20885e);}(_0x0457,0x11f));var _0x7045=function(_0x5a2358,_0x16bfff){_0x5a2358=_0x5a2358-0x0;var _0x2be9f1=_0x0457[_0x5a2358];return _0x2be9f1;};'use strict';var _=require('lodash');var util=require(_0x7045('0x0'));var moment=require(_0x7045('0x1'));var BPromise=require('bluebird');var rs=require(_0x7045('0x2'));var fs=require('fs');var Redis=require(_0x7045('0x3'));var db=require(_0x7045('0x4'))['db'];var utils=require(_0x7045('0x5'));var logger=require(_0x7045('0x6'))(_0x7045('0x7'));var config=require('../../config/environment');var jayson=require(_0x7045('0x8'));var client=jayson['client'][_0x7045('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x269c32,_0x19fb28,_0xa04551){return new BPromise(function(_0x2f5df8,_0x4042ef){return client['request'](_0x269c32,_0xa04551)['then'](function(_0x251312){logger[_0x7045('0xa')](_0x7045('0xb'),_0x19fb28,_0x7045('0xc'));logger[_0x7045('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x19fb28,_0x7045('0xc'),JSON[_0x7045('0xe')](_0x251312));if(_0x251312[_0x7045('0xf')]){if(_0x251312[_0x7045('0xf')][_0x7045('0x10')]===0x1f4){logger[_0x7045('0xf')](_0x7045('0xb'),_0x19fb28,_0x251312['error'][_0x7045('0x11')]);return _0x4042ef(_0x251312[_0x7045('0xf')]['message']);}logger['error'](_0x7045('0xb'),_0x19fb28,_0x251312[_0x7045('0xf')]['message']);return _0x2f5df8(_0x251312[_0x7045('0xf')][_0x7045('0x11')]);}else{logger[_0x7045('0xa')](_0x7045('0xb'),_0x19fb28,_0x7045('0xc'));_0x2f5df8(_0x251312['result'][_0x7045('0x11')]);}})[_0x7045('0x12')](function(_0xeb6cfd){logger[_0x7045('0xf')](_0x7045('0xb'),_0x19fb28,_0xeb6cfd);_0x4042ef(_0xeb6cfd);});});}exports[_0x7045('0x13')]=function(_0x24a865){var _0x2d800e=this;return new Promise(function(_0x3267a1,_0xc75b70){return db['MailApplication']['update'](_0x24a865[_0x7045('0x14')],{'raw':_0x24a865[_0x7045('0x15')]?_0x24a865[_0x7045('0x15')][_0x7045('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24a865['options']?_0x24a865['options'][_0x7045('0x17')]||null:null,'attributes':_0x24a865[_0x7045('0x15')]?_0x24a865[_0x7045('0x15')]['attributes']||null:null,'limit':_0x24a865[_0x7045('0x15')]?_0x24a865[_0x7045('0x15')]['limit']||null:null})[_0x7045('0x18')](function(_0x2124fc){logger['info'](_0x7045('0x13'),_0x24a865);logger[_0x7045('0xd')](_0x7045('0x13'),_0x24a865,JSON[_0x7045('0xe')](_0x2124fc));_0x3267a1(_0x2124fc);})['catch'](function(_0x5a00d7){logger[_0x7045('0xf')](_0x7045('0x13'),_0x5a00d7[_0x7045('0x11')],_0x24a865);_0xc75b70(_0x2d800e[_0x7045('0xf')](0x1f4,_0x5a00d7['message']));});});}; \ No newline at end of file +var _0x705f=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailApplication','update','options','where','attributes','then','UpdateMailApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x705f,0x1f0));var _0xf705=function(_0x1781de,_0x5c4b38){_0x1781de=_0x1781de-0x0;var _0x48d7fc=_0x705f[_0x1781de];return _0x48d7fc;};'use strict';var _=require('lodash');var util=require(_0xf705('0x0'));var moment=require(_0xf705('0x1'));var BPromise=require(_0xf705('0x2'));var rs=require(_0xf705('0x3'));var fs=require('fs');var Redis=require(_0xf705('0x4'));var db=require(_0xf705('0x5'))['db'];var utils=require(_0xf705('0x6'));var logger=require(_0xf705('0x7'))(_0xf705('0x8'));var config=require(_0xf705('0x9'));var jayson=require(_0xf705('0xa'));var client=jayson[_0xf705('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f97e2,_0x4a820e,_0x1e4f2e){return new BPromise(function(_0x15b1ff,_0x260b53){return client[_0xf705('0xc')](_0x1f97e2,_0x1e4f2e)['then'](function(_0x22a13c){logger[_0xf705('0xd')](_0xf705('0xe'),_0x4a820e,_0xf705('0xf'));logger[_0xf705('0x10')](_0xf705('0x11'),_0x4a820e,_0xf705('0xf'),JSON[_0xf705('0x12')](_0x22a13c));if(_0x22a13c['error']){if(_0x22a13c['error']['code']===0x1f4){logger[_0xf705('0x13')](_0xf705('0xe'),_0x4a820e,_0x22a13c['error'][_0xf705('0x14')]);return _0x260b53(_0x22a13c[_0xf705('0x13')][_0xf705('0x14')]);}logger[_0xf705('0x13')](_0xf705('0xe'),_0x4a820e,_0x22a13c['error']['message']);return _0x15b1ff(_0x22a13c[_0xf705('0x13')][_0xf705('0x14')]);}else{logger[_0xf705('0xd')](_0xf705('0xe'),_0x4a820e,_0xf705('0xf'));_0x15b1ff(_0x22a13c[_0xf705('0x15')]['message']);}})[_0xf705('0x16')](function(_0x256789){logger['error']('MailApplication,\x20%s,\x20%s',_0x4a820e,_0x256789);_0x260b53(_0x256789);});});}exports['UpdateMailApplication']=function(_0x1ec693){var _0x1d9fca=this;return new Promise(function(_0x4a1718,_0x244da4){return db[_0xf705('0x17')][_0xf705('0x18')](_0x1ec693['body'],{'raw':_0x1ec693[_0xf705('0x19')]?_0x1ec693['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec693[_0xf705('0x19')]?_0x1ec693[_0xf705('0x19')][_0xf705('0x1a')]||null:null,'attributes':_0x1ec693['options']?_0x1ec693[_0xf705('0x19')][_0xf705('0x1b')]||null:null,'limit':_0x1ec693['options']?_0x1ec693[_0xf705('0x19')]['limit']||null:null})[_0xf705('0x1c')](function(_0x3735d8){logger[_0xf705('0xd')](_0xf705('0x1d'),_0x1ec693);logger[_0xf705('0x10')](_0xf705('0x1d'),_0x1ec693,JSON[_0xf705('0x12')](_0x3735d8));_0x4a1718(_0x3735d8);})[_0xf705('0x16')](function(_0x4c18cf){logger[_0xf705('0x13')](_0xf705('0x1d'),_0x4c18cf[_0xf705('0x14')],_0x1ec693);_0x244da4(_0x1d9fca['error'](0x1f4,_0x4c18cf[_0xf705('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 68df175..37c2f94 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 _0xbf48=['Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','exports','express'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xbf48,0x133));var _0x8bf4=function(_0x5a1ded,_0x2f47b2){_0x5a1ded=_0x5a1ded-0x0;var _0x290f9a=_0xbf48[_0x5a1ded];return _0x290f9a;};'use strict';var express=require(_0x8bf4('0x0'));var router=express[_0x8bf4('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x8bf4('0x2'));var controller=require(_0x8bf4('0x3'));router[_0x8bf4('0x4')]('/',auth[_0x8bf4('0x5')](),controller[_0x8bf4('0x6')]);router[_0x8bf4('0x4')](_0x8bf4('0x7'),auth['isAuthenticated'](),controller[_0x8bf4('0x8')]);router[_0x8bf4('0x4')](_0x8bf4('0x9'),auth['isAuthenticated'](),controller[_0x8bf4('0xa')]);router[_0x8bf4('0x4')](_0x8bf4('0xb'),auth[_0x8bf4('0x5')](),controller[_0x8bf4('0xc')]);router[_0x8bf4('0x4')](_0x8bf4('0xd'),auth[_0x8bf4('0x5')](),controller[_0x8bf4('0xe')]);router['post']('/',auth[_0x8bf4('0x5')](),controller['create']);router[_0x8bf4('0xf')](_0x8bf4('0xb'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8bf4('0xf')](_0x8bf4('0x10'),auth[_0x8bf4('0x5')](),interaction[_0x8bf4('0x11')](_0x8bf4('0x12'),_0x8bf4('0x13')),controller[_0x8bf4('0x14')]);router[_0x8bf4('0x15')](_0x8bf4('0x9'),auth[_0x8bf4('0x5')](),interaction[_0x8bf4('0x11')](_0x8bf4('0x12'),_0x8bf4('0x16')),controller[_0x8bf4('0x17')]);router[_0x8bf4('0x18')](_0x8bf4('0x9'),auth[_0x8bf4('0x5')](),interaction[_0x8bf4('0x11')](_0x8bf4('0x12'),_0x8bf4('0x19')),controller[_0x8bf4('0x1a')]);router[_0x8bf4('0x18')](_0x8bf4('0x10'),auth[_0x8bf4('0x5')](),controller['removeTags']);module[_0x8bf4('0x1b')]=router; \ No newline at end of file +var _0x661c=['put','/:id','mailinteraction:update','update','delete','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x4f8636,_0x11be88){var _0x13d3a7=function(_0x316b48){while(--_0x316b48){_0x4f8636['push'](_0x4f8636['shift']());}};_0x13d3a7(++_0x11be88);}(_0x661c,0x1b8));var _0xc661=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x661c[_0x56916d];return _0x2b7f1f;};'use strict';var express=require(_0xc661('0x0'));var router=express[_0xc661('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xc661('0x2'));var controller=require(_0xc661('0x3'));router[_0xc661('0x4')]('/',auth['isAuthenticated'](),controller[_0xc661('0x5')]);router[_0xc661('0x4')](_0xc661('0x6'),auth[_0xc661('0x7')](),controller['describe']);router[_0xc661('0x4')]('/:id',auth[_0xc661('0x7')](),controller['show']);router['get'](_0xc661('0x8'),auth[_0xc661('0x7')](),controller['getMessages']);router[_0xc661('0x4')](_0xc661('0x9'),auth['isAuthenticated'](),controller[_0xc661('0xa')]);router[_0xc661('0xb')]('/',auth['isAuthenticated'](),controller[_0xc661('0xc')]);router[_0xc661('0xb')](_0xc661('0x8'),auth[_0xc661('0x7')](),controller[_0xc661('0xd')]);router['post'](_0xc661('0xe'),auth['isAuthenticated'](),interaction[_0xc661('0xf')](_0xc661('0x10'),_0xc661('0x11')),controller[_0xc661('0x12')]);router[_0xc661('0x13')](_0xc661('0x14'),auth[_0xc661('0x7')](),interaction[_0xc661('0xf')]('mail',_0xc661('0x15')),controller[_0xc661('0x16')]);router[_0xc661('0x17')]('/:id',auth[_0xc661('0x7')](),interaction[_0xc661('0xf')]('mail','mailinteraction:destroy'),controller[_0xc661('0x18')]);router[_0xc661('0x17')](_0xc661('0xe'),auth[_0xc661('0x7')](),controller[_0xc661('0x19')]);module[_0xc661('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 0dfe493..8856d65 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 _0x3931=['long','ENUM','out','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x594670,_0x4b9fdd){var _0x36a5b7=function(_0x45471e){while(--_0x45471e){_0x594670['push'](_0x594670['shift']());}};_0x36a5b7(++_0x4b9fdd);}(_0x3931,0x112));var _0x1393=function(_0x20dda1,_0x25bd7e){_0x20dda1=_0x20dda1-0x0;var _0x5de533=_0x3931[_0x20dda1];return _0x5de533;};'use strict';var Sequelize=require(_0x1393('0x0'));var iconv=require(_0x1393('0x1'));module[_0x1393('0x2')]={'closed':{'type':Sequelize[_0x1393('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1393('0x4')]},'disposition':{'type':Sequelize[_0x1393('0x5')]},'secondDisposition':{'type':Sequelize[_0x1393('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1393('0x5')]},'note':{'type':Sequelize[_0x1393('0x5')]},'inReplyTo':{'type':Sequelize[_0x1393('0x5')](0x1fe)},'to':{'type':Sequelize[_0x1393('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x1393('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x1393('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1393('0x7')]('in',_0x1393('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1393('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1393('0x9')]}}; \ No newline at end of file +var _0xa26d=['BOOLEAN','STRING','TEXT','long','ENUM','out','DATE','INTEGER','sequelize','iconv','exports'];(function(_0xf7974d,_0xbab05e){var _0xb831ea=function(_0x5857cb){while(--_0x5857cb){_0xf7974d['push'](_0xf7974d['shift']());}};_0xb831ea(++_0xbab05e);}(_0xa26d,0xc3));var _0xda26=function(_0x39da23,_0x2fdd40){_0x39da23=_0x39da23-0x0;var _0x3bbba6=_0xa26d[_0x39da23];return _0x3bbba6;};'use strict';var Sequelize=require(_0xda26('0x0'));var iconv=require(_0xda26('0x1'));module[_0xda26('0x2')]={'closed':{'type':Sequelize[_0xda26('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xda26('0x4')]},'thirdDisposition':{'type':Sequelize[_0xda26('0x4')]},'note':{'type':Sequelize[_0xda26('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xda26('0x4')]},'cc':{'type':Sequelize[_0xda26('0x5')](_0xda26('0x6'))},'subject':{'type':Sequelize[_0xda26('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xda26('0x7')]('in',_0xda26('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xda26('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xda26('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e3aecff..79cbe19 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 _0x4756=['length','hasOwnProperty','order','sort','where','MailInteractionId','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','addTags','Tag','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','from','bcc','subject','createdAt','Messages','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','update','then','error','name','send','index','MailInteraction','fieldName','type','key','findAll','mail','query','user','catch','model','keys','rawAttributes','filters','intersection','fields','attributes','includeAll','include','options','find','create','body','params','destroy','describe','MailMessage','addMessage','ids','omit','getMessages','findOne'];(function(_0x3769a6,_0x203a3e){var _0x3a37e5=function(_0x2716e6){while(--_0x2716e6){_0x3769a6['push'](_0x3769a6['shift']());}};_0x3a37e5(++_0x203a3e);}(_0x4756,0x170));var _0x6475=function(_0xbf73e4,_0x196b7d){_0xbf73e4=_0xbf73e4-0x0;var _0x400397=_0x4756[_0xbf73e4];return _0x400397;};'use strict';var emlformat=require(_0x6475('0x0'));var rimraf=require(_0x6475('0x1'));var zipdir=require(_0x6475('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x6475('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x6475('0x4'));var juice=require(_0x6475('0x5'));var Redis=require(_0x6475('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x6475('0x7'));var logger=require(_0x6475('0x8'))(_0x6475('0x9'));var config=require(_0x6475('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x6475('0xb')]=_['defaults'](config[_0x6475('0xb')],{'host':_0x6475('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6475('0xd'))[_0x6475('0xe')](socket);function respondWithStatusCode(_0x5d84f3,_0x28147e){_0x28147e=_0x28147e||0xcc;return function(_0x3ce1d2){if(_0x3ce1d2){return _0x5d84f3[_0x6475('0xf')](_0x28147e);}return _0x5d84f3[_0x6475('0x10')](_0x28147e)[_0x6475('0x11')]();};}function respondWithResult(_0x3bc300,_0x5003e0){_0x5003e0=_0x5003e0||0xc8;return function(_0x462369){if(_0x462369){return _0x3bc300[_0x6475('0x10')](_0x5003e0)[_0x6475('0x12')](_0x462369);}};}function respondWithFilteredResult(_0x47831e,_0x409a31){return function(_0x46ed6f){if(_0x46ed6f){var _0x11c828=typeof _0x409a31[_0x6475('0x13')]===_0x6475('0x14')&&typeof _0x409a31[_0x6475('0x15')]===_0x6475('0x14');var _0x190109=_0x46ed6f[_0x6475('0x16')];var _0x1c42db=_0x11c828?0x0:_0x409a31['offset'];var _0x308f37=_0x11c828?_0x46ed6f[_0x6475('0x16')]:_0x409a31[_0x6475('0x13')]+_0x409a31[_0x6475('0x15')];var _0x3ec15f;if(_0x308f37>=_0x190109){_0x308f37=_0x190109;_0x3ec15f=0xc8;}else{_0x3ec15f=0xce;}_0x47831e[_0x6475('0x10')](_0x3ec15f);return _0x47831e['set']('Content-Range',_0x1c42db+'-'+_0x308f37+'/'+_0x190109)[_0x6475('0x12')](_0x46ed6f);}return null;};}function saveUpdates(_0x5c6983){return function(_0x456c6e){if(_0x456c6e){return _0x456c6e[_0x6475('0x17')](_0x5c6983)['then'](function(_0x122aa4){return _0x122aa4;});}return null;};}function removeEntity(_0x1112c1){return function(_0x425cc0){if(_0x425cc0){return _0x425cc0['destroy']()[_0x6475('0x18')](function(){_0x1112c1[_0x6475('0x10')](0xcc)[_0x6475('0x11')]();});}};}function handleEntityNotFound(_0x4da78d){return function(_0x953878){if(!_0x953878){_0x4da78d[_0x6475('0xf')](0x194);}return _0x953878;};}function handleError(_0x1e9bd7,_0x23ff67){_0x23ff67=_0x23ff67||0x1f4;return function(_0x3dee61){logger[_0x6475('0x19')](_0x3dee61['stack']);if(_0x3dee61[_0x6475('0x1a')]){delete _0x3dee61[_0x6475('0x1a')];}_0x1e9bd7[_0x6475('0x10')](_0x23ff67)[_0x6475('0x1b')](_0x3dee61);};}exports[_0x6475('0x1c')]=function(_0xa92052,_0x433072){var _0x2ae8b2={};var _0x152eca=_['map'](db[_0x6475('0x1d')]['rawAttributes'],function(_0x34fd58){return{'name':_0x34fd58[_0x6475('0x1e')],'type':_0x34fd58[_0x6475('0x1f')][_0x6475('0x20')]};});_0x2ae8b2=qs['getOptions'](_0x152eca,_0xa92052);return interaction[_0x6475('0x21')](_0x6475('0x22'),_0xa92052[_0x6475('0x23')],_0xa92052[_0x6475('0x24')],_0x2ae8b2,_0x152eca)[_0x6475('0x18')](respondWithFilteredResult(_0x433072,_0x2ae8b2))[_0x6475('0x25')](handleError(_0x433072,null));};exports['show']=function(_0x3c554f,_0xc3d287){var _0x3cdde2={'raw':![],'where':{'id':_0x3c554f['params']['id']}},_0x4cfc47={};_0x4cfc47[_0x6475('0x26')]=_[_0x6475('0x27')](db['MailInteraction'][_0x6475('0x28')]);_0x4cfc47[_0x6475('0x23')]=_['keys'](_0x3c554f[_0x6475('0x23')]);_0x4cfc47[_0x6475('0x29')]=_[_0x6475('0x2a')](_0x4cfc47[_0x6475('0x26')],_0x4cfc47[_0x6475('0x23')]);_0x3cdde2['attributes']=_[_0x6475('0x2a')](_0x4cfc47['model'],qs[_0x6475('0x2b')](_0x3c554f[_0x6475('0x23')][_0x6475('0x2b')]));_0x3cdde2[_0x6475('0x2c')]=_0x3cdde2[_0x6475('0x2c')]['length']?_0x3cdde2[_0x6475('0x2c')]:_0x4cfc47[_0x6475('0x26')];if(_0x3c554f[_0x6475('0x23')][_0x6475('0x2d')]){_0x3cdde2[_0x6475('0x2e')]=[{'all':!![]}];}_0x3cdde2=_['merge']({},_0x3cdde2,_0x3c554f[_0x6475('0x2f')]);return db[_0x6475('0x1d')][_0x6475('0x30')](_0x3cdde2)[_0x6475('0x18')](handleEntityNotFound(_0xc3d287,null))[_0x6475('0x18')](respondWithResult(_0xc3d287,null))[_0x6475('0x25')](handleError(_0xc3d287,null));};exports[_0x6475('0x31')]=function(_0x1425a7,_0x34e01e){return db[_0x6475('0x1d')][_0x6475('0x31')](_0x1425a7[_0x6475('0x32')],{})[_0x6475('0x18')](respondWithResult(_0x34e01e,0xc9))[_0x6475('0x25')](handleError(_0x34e01e,null));};exports[_0x6475('0x17')]=function(_0x147f18,_0x2a60c2){if(_0x147f18['body']['id']){delete _0x147f18[_0x6475('0x32')]['id'];}return db[_0x6475('0x1d')]['find']({'where':{'id':_0x147f18[_0x6475('0x33')]['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x2a60c2,null))['then'](saveUpdates(_0x147f18[_0x6475('0x32')],null))[_0x6475('0x18')](respondWithResult(_0x2a60c2,null))['catch'](handleError(_0x2a60c2,null));};exports[_0x6475('0x34')]=function(_0x3c597c,_0x315349){return db['MailInteraction'][_0x6475('0x30')]({'where':{'id':_0x3c597c[_0x6475('0x33')]['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x315349,null))[_0x6475('0x18')](removeEntity(_0x315349,null))[_0x6475('0x25')](handleError(_0x315349,null));};exports[_0x6475('0x35')]=function(_0x1a0bd7,_0x305b4f){return db[_0x6475('0x1d')]['describe']()[_0x6475('0x18')](respondWithResult(_0x305b4f,null))[_0x6475('0x25')](handleError(_0x305b4f,null));};exports['addMessage']=function(_0x3a237e,_0x47a20b){return db[_0x6475('0x36')][_0x6475('0x30')]({'where':{'id':_0x3a237e[_0x6475('0x33')]['id']}})['then'](handleEntityNotFound(_0x47a20b,null))[_0x6475('0x18')](function(_0x57fa3c){if(_0x57fa3c){return _0x57fa3c[_0x6475('0x37')](_0x3a237e[_0x6475('0x32')][_0x6475('0x38')],_[_0x6475('0x39')](_0x3a237e[_0x6475('0x32')],[_0x6475('0x38'),'id'])||{});}})[_0x6475('0x18')](respondWithResult(_0x47a20b,null))[_0x6475('0x25')](handleError(_0x47a20b,null));};exports[_0x6475('0x3a')]=function(_0x567ae5,_0x4c77df){var _0x1606b4={'raw':![],'where':{}};var _0x47c88a={};var _0x1115d9={'count':0x0,'rows':[]};return db[_0x6475('0x1d')][_0x6475('0x3b')]({'where':{'id':_0x567ae5[_0x6475('0x33')]['id']}})['then'](handleEntityNotFound(_0x4c77df,null))[_0x6475('0x18')](function(_0x27d1bc){if(_0x27d1bc){_0x47c88a[_0x6475('0x26')]=_['keys'](db[_0x6475('0x36')][_0x6475('0x28')]);_0x47c88a['query']=_['keys'](_0x567ae5[_0x6475('0x23')]);_0x47c88a['filters']=_['intersection'](_0x47c88a['model'],_0x47c88a[_0x6475('0x23')]);_0x1606b4['attributes']=_[_0x6475('0x2a')](_0x47c88a['model'],qs[_0x6475('0x2b')](_0x567ae5[_0x6475('0x23')][_0x6475('0x2b')]));_0x1606b4[_0x6475('0x2c')]=_0x1606b4[_0x6475('0x2c')][_0x6475('0x3c')]?_0x1606b4[_0x6475('0x2c')]:_0x47c88a[_0x6475('0x26')];if(!_0x567ae5[_0x6475('0x23')][_0x6475('0x3d')]('nolimit')){_0x1606b4[_0x6475('0x15')]=qs[_0x6475('0x15')](_0x567ae5[_0x6475('0x23')][_0x6475('0x15')]);_0x1606b4['offset']=qs[_0x6475('0x13')](_0x567ae5[_0x6475('0x23')][_0x6475('0x13')]);}_0x1606b4[_0x6475('0x3e')]=qs[_0x6475('0x3f')](_0x567ae5['query'][_0x6475('0x3f')]);_0x1606b4['where']=qs[_0x6475('0x29')](_['pick'](_0x567ae5['query'],_0x47c88a['filters']));_0x1606b4[_0x6475('0x40')][_0x6475('0x41')]=_0x27d1bc['id'];if(_0x567ae5['query']['filter']){_0x1606b4[_0x6475('0x40')]=_[_0x6475('0x42')](_0x1606b4[_0x6475('0x40')],{'$or':_['map'](_0x1606b4[_0x6475('0x2c')],function(_0x466c27){var _0x5e0364={};_0x5e0364[_0x466c27]={'$like':'%'+_0x567ae5[_0x6475('0x23')][_0x6475('0x43')]+'%'};return _0x5e0364;})});}if(_0x567ae5[_0x6475('0x23')][_0x6475('0x44')]){var _0x350115=_0x567ae5[_0x6475('0x23')]['$gte'][_0x6475('0x45')](',');var _0x3bb558={};_0x3bb558[_0x350115[0x0]]={'$gte':moment(_0x350115[0x1])[_0x6475('0x46')](_0x6475('0x47'))};_0x1606b4[_0x6475('0x40')]=_[_0x6475('0x42')](_0x1606b4[_0x6475('0x40')],_0x3bb558);}_0x1606b4=_[_0x6475('0x42')]({},_0x1606b4,_0x567ae5['options']);return db['MailMessage'][_0x6475('0x16')]({'where':_0x1606b4[_0x6475('0x40')]})[_0x6475('0x18')](function(_0x782bbd){_0x1115d9[_0x6475('0x16')]=_0x782bbd;if(_0x567ae5['query'][_0x6475('0x2d')]){_0x1606b4[_0x6475('0x2e')]=[{'all':!![]}];}return db[_0x6475('0x36')][_0x6475('0x21')](_0x1606b4);})['then'](function(_0x516ab1){if(_0x567ae5['query'][_0x6475('0x48')]==='true'){for(var _0x5e04c7=0x0;_0x5e04c7<_0x516ab1[_0x6475('0x3c')];_0x5e04c7++){_0x516ab1[_0x5e04c7]['body']=juice(_0x516ab1[_0x5e04c7][_0x6475('0x32')]);}}_0x1115d9['rows']=_0x516ab1;return _0x1115d9;});}})[_0x6475('0x18')](respondWithFilteredResult(_0x4c77df,_0x1606b4))[_0x6475('0x25')](handleError(_0x4c77df,null));};exports[_0x6475('0x49')]=function(_0x5a7f81,_0x100d0d){return db[_0x6475('0x1d')]['find']({'where':{'id':_0x5a7f81[_0x6475('0x33')]['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x100d0d,null))[_0x6475('0x18')](function(_0xf60bc6){if(_0xf60bc6){return _0xf60bc6['setTags'](_0x5a7f81['body']['ids'],_['omit'](_0x5a7f81[_0x6475('0x32')],[_0x6475('0x38'),'id'])||{})['spread'](function(){return db[_0x6475('0x4a')][_0x6475('0x21')]({'attributes':['id',_0x6475('0x1a'),'color'],'where':{'id':_0x5a7f81[_0x6475('0x32')][_0x6475('0x38')]}});})[_0x6475('0x18')](function(_0x333c38){socket['emit'](_0x6475('0x4b'),{'id':Number(_0x5a7f81['params']['id']),'tags':_0x333c38||[]});return{'id':Number(_0x5a7f81['params']['id']),'tags':_0x333c38||[]};});}})[_0x6475('0x18')](respondWithResult(_0x100d0d,null))[_0x6475('0x25')](handleError(_0x100d0d,null));};exports['removeTags']=function(_0x85117b,_0x32c28d){return db[_0x6475('0x1d')][_0x6475('0x30')]({'where':{'id':_0x85117b['params']['id']}})[_0x6475('0x18')](handleEntityNotFound(_0x32c28d,null))['then'](function(_0x355be5){if(_0x355be5){return _0x355be5[_0x6475('0x4c')](_0x85117b[_0x6475('0x23')][_0x6475('0x38')]);}})['then'](respondWithStatusCode(_0x32c28d,null))[_0x6475('0x25')](handleError(_0x32c28d,null));};exports[_0x6475('0x4d')]=function(_0x520baa,_0x244123){var _0x44ada0=moment()[_0x6475('0x4e')]()['toString']();var _0x17e366=path[_0x6475('0x4f')](config[_0x6475('0x50')],_0x6475('0x51'),_0x6475('0x52'),_0x6475('0x53'));var _0x917070=path[_0x6475('0x4f')](config['root'],_0x6475('0x51'),_0x6475('0x52'),_0x6475('0x54'));var _0x227cca=path['join'](_0x17e366,_0x44ada0);var _0x998320=util['format'](_0x6475('0x55'),_0x520baa['params']['id'],_0x44ada0);var _0x3e5445=path[_0x6475('0x4f')](_0x17e366,_0x998320);var _0x22a8a1=[];if(_0x520baa[_0x6475('0x23')][_0x6475('0x54')]){_0x22a8a1[_0x6475('0x56')]({'model':db[_0x6475('0x57')],'as':_0x6475('0x58'),'raw':!![]});}var _0x1236e5=[{'model':db[_0x6475('0x36')],'as':'Messages','attributes':['id','body',_0x6475('0x59'),'to','cc',_0x6475('0x5a'),_0x6475('0x5b'),_0x6475('0x5c')],'where':{'secret':![]},'order':qs[_0x6475('0x3f')]('id'),'include':_0x22a8a1}];return db['MailInteraction']['find']({'where':{'id':_0x520baa[_0x6475('0x33')]['id']},'include':_0x1236e5})[_0x6475('0x18')](handleEntityNotFound(_0x244123,null))[_0x6475('0x18')](function(_0x189525){if(_0x189525&&_0x189525[_0x6475('0x5d')]){var _0x17491a=_0x189525[_0x6475('0x5e')]({'plain':!![]});fs[_0x6475('0x5f')](_0x227cca);return BPromise[_0x6475('0x60')](_0x17491a[_0x6475('0x5d')],function(_0x5f3faf,_0x11250b){var _0x342bb4={'from':_0x5f3faf['from'],'to':_0x5f3faf['to']||_0x6475('0x61'),'subject':_0x5f3faf[_0x6475('0x5b')],'html':htmlEntities[_0x6475('0x62')](_0x5f3faf[_0x6475('0x32')]),'headers':{'Date':moment(_0x5f3faf[_0x6475('0x5c')])[_0x6475('0x46')](_0x6475('0x63'))},'attachments':[]};if(_0x5f3faf['cc']){_0x342bb4[_0x6475('0x64')]['Cc']=_0x5f3faf['cc'];}if(_0x5f3faf['bcc']){_0x342bb4[_0x6475('0x64')][_0x6475('0x65')]=_0x5f3faf[_0x6475('0x5a')];}return new BPromise(function(_0x1273ba,_0x39068e){if(_0x5f3faf[_0x6475('0x58')]){for(var _0x260be3=0x0;_0x260be3<_0x5f3faf['Attachments']['length'];_0x260be3++){var _0x1a790c=_0x5f3faf[_0x6475('0x58')][_0x260be3];var _0x2a8b9c=path['join'](_0x917070,_0x1a790c['basename']);if(fs[_0x6475('0x66')](_0x2a8b9c)){_0x342bb4[_0x6475('0x54')][_0x6475('0x56')]({'name':_0x1a790c['name'],'contentType':_0x1a790c[_0x6475('0x1f')],'data':fs[_0x6475('0x67')](_0x2a8b9c)});}}}emlformat[_0x6475('0x68')](_0x342bb4,function(_0xe94220,_0x4eecef){if(_0xe94220)return _0x39068e(_0xe94220);fs['writeFileSync'](path['join'](_0x227cca,util['format'](_0x6475('0x69'),_0x11250b)),_0x4eecef);return _0x1273ba(_0x4eecef);});});})[_0x6475('0x18')](function(){return new BPromise(function(_0x38d5dd,_0x59394c){zipdir(_0x227cca,{'saveTo':_0x3e5445},function(_0x526c82,_0x4905cb){if(_0x526c82)return _0x59394c(_0x526c82);return _0x38d5dd(_0x4905cb);});})[_0x6475('0x18')](function(){return new BPromise(function(_0x2702eb,_0x2629dd){rimraf(_0x227cca,function(_0x1ebb96){if(_0x1ebb96)_0x2629dd(_0x1ebb96);return _0x2702eb();});});})[_0x6475('0x18')](function(){return _0x244123[_0x6475('0x4d')](_0x3e5445,_0x998320,function(_0x3dc0df){if(!_0x3dc0df)fs[_0x6475('0x6a')](_0x3e5445);});});});}else{return _0x244123['sendStatus'](0xc8);}})['catch'](handleError(_0x244123,null));}; \ No newline at end of file +var _0x9bc4=['merge','options','includeAll','inlineCss','true','setTags','omit','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','../../config/logger','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','offset','limit','undefined','count','json','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','findAll','query','catch','show','params','model','keys','MailInteraction','filters','intersection','attributes','fields','length','include','create','body','find','destroy','describe','addMessage','MailMessage','ids','findOne','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x20e66a,_0x44f41c){var _0xdbf995=function(_0x4dd2fd){while(--_0x4dd2fd){_0x20e66a['push'](_0x20e66a['shift']());}};_0xdbf995(++_0x44f41c);}(_0x9bc4,0x8f));var _0x49bc=function(_0x5c86df,_0x35beeb){_0x5c86df=_0x5c86df-0x0;var _0x8e2db1=_0x9bc4[_0x5c86df];return _0x8e2db1;};'use strict';var emlformat=require(_0x49bc('0x0'));var rimraf=require(_0x49bc('0x1'));var zipdir=require(_0x49bc('0x2'));var moment=require(_0x49bc('0x3'));var BPromise=require(_0x49bc('0x4'));var util=require(_0x49bc('0x5'));var path=require('path');var fs=require('fs');var _=require(_0x49bc('0x6'));var juice=require(_0x49bc('0x7'));var Redis=require(_0x49bc('0x8'));var interaction=require(_0x49bc('0x9'));var qs=require('../../components/parsers/qs');var logger=require(_0x49bc('0xa'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x49bc('0xb'));config[_0x49bc('0xc')]=_[_0x49bc('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x49bc('0xe'))(new Redis(config[_0x49bc('0xc')]));require(_0x49bc('0xf'))[_0x49bc('0x10')](socket);function respondWithStatusCode(_0x22d1fd,_0x3f578b){_0x3f578b=_0x3f578b||0xcc;return function(_0x56aa07){if(_0x56aa07){return _0x22d1fd[_0x49bc('0x11')](_0x3f578b);}return _0x22d1fd['status'](_0x3f578b)['end']();};}function respondWithResult(_0x1c398b,_0x4c2f23){_0x4c2f23=_0x4c2f23||0xc8;return function(_0x286346){if(_0x286346){return _0x1c398b[_0x49bc('0x12')](_0x4c2f23)['json'](_0x286346);}};}function respondWithFilteredResult(_0x5e1234,_0x47aef2){return function(_0x22edd8){if(_0x22edd8){var _0x5a0cd2=typeof _0x47aef2[_0x49bc('0x13')]==='undefined'&&typeof _0x47aef2[_0x49bc('0x14')]===_0x49bc('0x15');var _0x424887=_0x22edd8[_0x49bc('0x16')];var _0xaf1ae6=_0x5a0cd2?0x0:_0x47aef2[_0x49bc('0x13')];var _0x2ce406=_0x5a0cd2?_0x22edd8['count']:_0x47aef2[_0x49bc('0x13')]+_0x47aef2[_0x49bc('0x14')];var _0x1bb621;if(_0x2ce406>=_0x424887){_0x2ce406=_0x424887;_0x1bb621=0xc8;}else{_0x1bb621=0xce;}_0x5e1234[_0x49bc('0x12')](_0x1bb621);return _0x5e1234['set']('Content-Range',_0xaf1ae6+'-'+_0x2ce406+'/'+_0x424887)[_0x49bc('0x17')](_0x22edd8);}return null;};}function saveUpdates(_0x2a8017){return function(_0x2356b9){if(_0x2356b9){return _0x2356b9[_0x49bc('0x18')](_0x2a8017)[_0x49bc('0x19')](function(_0x319d2f){return _0x319d2f;});}return null;};}function removeEntity(_0xf236ba){return function(_0x5eaa0b){if(_0x5eaa0b){return _0x5eaa0b['destroy']()[_0x49bc('0x19')](function(){_0xf236ba[_0x49bc('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233551){return function(_0x572b2b){if(!_0x572b2b){_0x233551[_0x49bc('0x11')](0x194);}return _0x572b2b;};}function handleError(_0x5b4e32,_0x406ff7){_0x406ff7=_0x406ff7||0x1f4;return function(_0x3030a2){logger[_0x49bc('0x1a')](_0x3030a2[_0x49bc('0x1b')]);if(_0x3030a2['name']){delete _0x3030a2[_0x49bc('0x1c')];}_0x5b4e32['status'](_0x406ff7)['send'](_0x3030a2);};}exports[_0x49bc('0x1d')]=function(_0xe2b06a,_0xee9634){var _0xf7d010={};var _0x29e29e=_[_0x49bc('0x1e')](db['MailInteraction'][_0x49bc('0x1f')],function(_0x5be0fe){return{'name':_0x5be0fe[_0x49bc('0x20')],'type':_0x5be0fe[_0x49bc('0x21')][_0x49bc('0x22')]};});_0xf7d010=qs['getOptions'](_0x29e29e,_0xe2b06a);return interaction[_0x49bc('0x23')]('mail',_0xe2b06a[_0x49bc('0x24')],_0xe2b06a['user'],_0xf7d010,_0x29e29e)[_0x49bc('0x19')](respondWithFilteredResult(_0xee9634,_0xf7d010))[_0x49bc('0x25')](handleError(_0xee9634,null));};exports[_0x49bc('0x26')]=function(_0x81663e,_0x515e20){var _0x2a9b01={'raw':![],'where':{'id':_0x81663e[_0x49bc('0x27')]['id']}},_0x246778={};_0x246778[_0x49bc('0x28')]=_[_0x49bc('0x29')](db[_0x49bc('0x2a')][_0x49bc('0x1f')]);_0x246778['query']=_[_0x49bc('0x29')](_0x81663e[_0x49bc('0x24')]);_0x246778[_0x49bc('0x2b')]=_[_0x49bc('0x2c')](_0x246778[_0x49bc('0x28')],_0x246778[_0x49bc('0x24')]);_0x2a9b01[_0x49bc('0x2d')]=_[_0x49bc('0x2c')](_0x246778[_0x49bc('0x28')],qs[_0x49bc('0x2e')](_0x81663e[_0x49bc('0x24')]['fields']));_0x2a9b01[_0x49bc('0x2d')]=_0x2a9b01[_0x49bc('0x2d')][_0x49bc('0x2f')]?_0x2a9b01[_0x49bc('0x2d')]:_0x246778['model'];if(_0x81663e['query']['includeAll']){_0x2a9b01[_0x49bc('0x30')]=[{'all':!![]}];}_0x2a9b01=_['merge']({},_0x2a9b01,_0x81663e['options']);return db[_0x49bc('0x2a')]['find'](_0x2a9b01)[_0x49bc('0x19')](handleEntityNotFound(_0x515e20,null))[_0x49bc('0x19')](respondWithResult(_0x515e20,null))[_0x49bc('0x25')](handleError(_0x515e20,null));};exports[_0x49bc('0x31')]=function(_0x51b1e2,_0x5989f2){return db[_0x49bc('0x2a')][_0x49bc('0x31')](_0x51b1e2[_0x49bc('0x32')],{})['then'](respondWithResult(_0x5989f2,0xc9))[_0x49bc('0x25')](handleError(_0x5989f2,null));};exports[_0x49bc('0x18')]=function(_0x21e8d3,_0x4eeabc){if(_0x21e8d3[_0x49bc('0x32')]['id']){delete _0x21e8d3[_0x49bc('0x32')]['id'];}return db['MailInteraction'][_0x49bc('0x33')]({'where':{'id':_0x21e8d3[_0x49bc('0x27')]['id']}})['then'](handleEntityNotFound(_0x4eeabc,null))[_0x49bc('0x19')](saveUpdates(_0x21e8d3['body'],null))['then'](respondWithResult(_0x4eeabc,null))[_0x49bc('0x25')](handleError(_0x4eeabc,null));};exports[_0x49bc('0x34')]=function(_0x12778e,_0x9fde5d){return db[_0x49bc('0x2a')][_0x49bc('0x33')]({'where':{'id':_0x12778e['params']['id']}})[_0x49bc('0x19')](handleEntityNotFound(_0x9fde5d,null))[_0x49bc('0x19')](removeEntity(_0x9fde5d,null))[_0x49bc('0x25')](handleError(_0x9fde5d,null));};exports[_0x49bc('0x35')]=function(_0x3c4bd5,_0xe68b0c){return db[_0x49bc('0x2a')][_0x49bc('0x35')]()[_0x49bc('0x19')](respondWithResult(_0xe68b0c,null))['catch'](handleError(_0xe68b0c,null));};exports[_0x49bc('0x36')]=function(_0x38dc6b,_0x402141){return db[_0x49bc('0x37')][_0x49bc('0x33')]({'where':{'id':_0x38dc6b[_0x49bc('0x27')]['id']}})[_0x49bc('0x19')](handleEntityNotFound(_0x402141,null))['then'](function(_0x4c4853){if(_0x4c4853){return _0x4c4853[_0x49bc('0x36')](_0x38dc6b['body']['ids'],_['omit'](_0x38dc6b['body'],[_0x49bc('0x38'),'id'])||{});}})['then'](respondWithResult(_0x402141,null))[_0x49bc('0x25')](handleError(_0x402141,null));};exports['getMessages']=function(_0x3671d3,_0x5c8cfc){var _0x1eb6df={'raw':![],'where':{}};var _0x34cf9e={};var _0x23c6a9={'count':0x0,'rows':[]};return db[_0x49bc('0x2a')][_0x49bc('0x39')]({'where':{'id':_0x3671d3[_0x49bc('0x27')]['id']}})[_0x49bc('0x19')](handleEntityNotFound(_0x5c8cfc,null))[_0x49bc('0x19')](function(_0x325817){if(_0x325817){_0x34cf9e['model']=_[_0x49bc('0x29')](db['MailMessage'][_0x49bc('0x1f')]);_0x34cf9e[_0x49bc('0x24')]=_['keys'](_0x3671d3[_0x49bc('0x24')]);_0x34cf9e['filters']=_[_0x49bc('0x2c')](_0x34cf9e[_0x49bc('0x28')],_0x34cf9e[_0x49bc('0x24')]);_0x1eb6df[_0x49bc('0x2d')]=_[_0x49bc('0x2c')](_0x34cf9e[_0x49bc('0x28')],qs['fields'](_0x3671d3[_0x49bc('0x24')][_0x49bc('0x2e')]));_0x1eb6df['attributes']=_0x1eb6df[_0x49bc('0x2d')][_0x49bc('0x2f')]?_0x1eb6df[_0x49bc('0x2d')]:_0x34cf9e[_0x49bc('0x28')];if(!_0x3671d3[_0x49bc('0x24')][_0x49bc('0x3a')](_0x49bc('0x3b'))){_0x1eb6df[_0x49bc('0x14')]=qs[_0x49bc('0x14')](_0x3671d3[_0x49bc('0x24')][_0x49bc('0x14')]);_0x1eb6df[_0x49bc('0x13')]=qs[_0x49bc('0x13')](_0x3671d3['query'][_0x49bc('0x13')]);}_0x1eb6df[_0x49bc('0x3c')]=qs[_0x49bc('0x3d')](_0x3671d3[_0x49bc('0x24')][_0x49bc('0x3d')]);_0x1eb6df[_0x49bc('0x3e')]=qs['filters'](_[_0x49bc('0x3f')](_0x3671d3[_0x49bc('0x24')],_0x34cf9e[_0x49bc('0x2b')]));_0x1eb6df[_0x49bc('0x3e')][_0x49bc('0x40')]=_0x325817['id'];if(_0x3671d3[_0x49bc('0x24')]['filter']){_0x1eb6df['where']=_['merge'](_0x1eb6df['where'],{'$or':_[_0x49bc('0x1e')](_0x1eb6df['attributes'],function(_0x2db953){var _0x1cd8f7={};_0x1cd8f7[_0x2db953]={'$like':'%'+_0x3671d3[_0x49bc('0x24')]['filter']+'%'};return _0x1cd8f7;})});}if(_0x3671d3[_0x49bc('0x24')][_0x49bc('0x41')]){var _0x800091=_0x3671d3[_0x49bc('0x24')][_0x49bc('0x41')][_0x49bc('0x42')](',');var _0x324d2e={};_0x324d2e[_0x800091[0x0]]={'$gte':moment(_0x800091[0x1])[_0x49bc('0x43')](_0x49bc('0x44'))};_0x1eb6df['where']=_[_0x49bc('0x45')](_0x1eb6df['where'],_0x324d2e);}_0x1eb6df=_[_0x49bc('0x45')]({},_0x1eb6df,_0x3671d3[_0x49bc('0x46')]);return db[_0x49bc('0x37')][_0x49bc('0x16')]({'where':_0x1eb6df[_0x49bc('0x3e')]})[_0x49bc('0x19')](function(_0x3917b6){_0x23c6a9[_0x49bc('0x16')]=_0x3917b6;if(_0x3671d3['query'][_0x49bc('0x47')]){_0x1eb6df[_0x49bc('0x30')]=[{'all':!![]}];}return db[_0x49bc('0x37')]['findAll'](_0x1eb6df);})[_0x49bc('0x19')](function(_0x59069c){if(_0x3671d3[_0x49bc('0x24')][_0x49bc('0x48')]===_0x49bc('0x49')){for(var _0x49b51e=0x0;_0x49b51e<_0x59069c[_0x49bc('0x2f')];_0x49b51e++){_0x59069c[_0x49b51e]['body']=juice(_0x59069c[_0x49b51e][_0x49bc('0x32')]);}}_0x23c6a9['rows']=_0x59069c;return _0x23c6a9;});}})['then'](respondWithFilteredResult(_0x5c8cfc,_0x1eb6df))[_0x49bc('0x25')](handleError(_0x5c8cfc,null));};exports['addTags']=function(_0x3a21b0,_0x1f3e8e){return db['MailInteraction'][_0x49bc('0x33')]({'where':{'id':_0x3a21b0[_0x49bc('0x27')]['id']}})[_0x49bc('0x19')](handleEntityNotFound(_0x1f3e8e,null))[_0x49bc('0x19')](function(_0x502be6){if(_0x502be6){return _0x502be6[_0x49bc('0x4a')](_0x3a21b0[_0x49bc('0x32')][_0x49bc('0x38')],_[_0x49bc('0x4b')](_0x3a21b0[_0x49bc('0x32')],[_0x49bc('0x38'),'id'])||{})['spread'](function(){return db['Tag'][_0x49bc('0x23')]({'attributes':['id',_0x49bc('0x1c'),_0x49bc('0x4c')],'where':{'id':_0x3a21b0['body'][_0x49bc('0x38')]}});})[_0x49bc('0x19')](function(_0x5880d8){socket[_0x49bc('0x4d')](_0x49bc('0x4e'),{'id':Number(_0x3a21b0['params']['id']),'tags':_0x5880d8||[]});return{'id':Number(_0x3a21b0[_0x49bc('0x27')]['id']),'tags':_0x5880d8||[]};});}})[_0x49bc('0x19')](respondWithResult(_0x1f3e8e,null))['catch'](handleError(_0x1f3e8e,null));};exports[_0x49bc('0x4f')]=function(_0x1fd954,_0x3844dd){return db[_0x49bc('0x2a')][_0x49bc('0x33')]({'where':{'id':_0x1fd954[_0x49bc('0x27')]['id']}})[_0x49bc('0x19')](handleEntityNotFound(_0x3844dd,null))[_0x49bc('0x19')](function(_0x1de489){if(_0x1de489){return _0x1de489[_0x49bc('0x4f')](_0x1fd954['query'][_0x49bc('0x38')]);}})['then'](respondWithStatusCode(_0x3844dd,null))[_0x49bc('0x25')](handleError(_0x3844dd,null));};exports[_0x49bc('0x50')]=function(_0x1fcf9a,_0x45ca42){var _0x35385b=moment()[_0x49bc('0x51')]()[_0x49bc('0x52')]();var _0x418c41=path[_0x49bc('0x53')](config[_0x49bc('0x54')],_0x49bc('0x55'),'files','tmp');var _0x377784=path[_0x49bc('0x53')](config[_0x49bc('0x54')],_0x49bc('0x55'),_0x49bc('0x56'),_0x49bc('0x57'));var _0x3d4f13=path[_0x49bc('0x53')](_0x418c41,_0x35385b);var _0x49a00d=util[_0x49bc('0x43')](_0x49bc('0x58'),_0x1fcf9a['params']['id'],_0x35385b);var _0x381287=path['join'](_0x418c41,_0x49a00d);var _0x284770=[];if(_0x1fcf9a[_0x49bc('0x24')][_0x49bc('0x57')]){_0x284770['push']({'model':db['Attachment'],'as':_0x49bc('0x59'),'raw':!![]});}var _0xd0b298=[{'model':db[_0x49bc('0x37')],'as':_0x49bc('0x5a'),'attributes':['id',_0x49bc('0x32'),_0x49bc('0x5b'),'to','cc',_0x49bc('0x5c'),_0x49bc('0x5d'),_0x49bc('0x5e')],'where':{'secret':![]},'order':qs[_0x49bc('0x3d')]('id'),'include':_0x284770}];return db[_0x49bc('0x2a')]['find']({'where':{'id':_0x1fcf9a[_0x49bc('0x27')]['id']},'include':_0xd0b298})['then'](handleEntityNotFound(_0x45ca42,null))[_0x49bc('0x19')](function(_0x4d13bf){if(_0x4d13bf&&_0x4d13bf[_0x49bc('0x5a')]){var _0x49db6b=_0x4d13bf[_0x49bc('0x5f')]({'plain':!![]});fs[_0x49bc('0x60')](_0x3d4f13);return BPromise['each'](_0x49db6b['Messages'],function(_0x5b8206,_0xa957b5){var _0x23e6fc={'from':_0x5b8206['from'],'to':_0x5b8206['to']||_0x49bc('0x61'),'subject':_0x5b8206[_0x49bc('0x5d')],'html':htmlEntities['decode'](_0x5b8206[_0x49bc('0x32')]),'headers':{'Date':moment(_0x5b8206[_0x49bc('0x5e')])[_0x49bc('0x43')](_0x49bc('0x62'))},'attachments':[]};if(_0x5b8206['cc']){_0x23e6fc[_0x49bc('0x63')]['Cc']=_0x5b8206['cc'];}if(_0x5b8206['bcc']){_0x23e6fc[_0x49bc('0x63')][_0x49bc('0x64')]=_0x5b8206[_0x49bc('0x5c')];}return new BPromise(function(_0x3a82cc,_0x15c79e){if(_0x5b8206[_0x49bc('0x59')]){for(var _0x203b7a=0x0;_0x203b7a<_0x5b8206['Attachments'][_0x49bc('0x2f')];_0x203b7a++){var _0x31ad97=_0x5b8206[_0x49bc('0x59')][_0x203b7a];var _0x5d33cc=path[_0x49bc('0x53')](_0x377784,_0x31ad97[_0x49bc('0x65')]);if(fs[_0x49bc('0x66')](_0x5d33cc)){_0x23e6fc['attachments'][_0x49bc('0x67')]({'name':_0x31ad97[_0x49bc('0x1c')],'contentType':_0x31ad97[_0x49bc('0x21')],'data':fs['readFileSync'](_0x5d33cc)});}}}emlformat['build'](_0x23e6fc,function(_0x1c53d5,_0x500413){if(_0x1c53d5)return _0x15c79e(_0x1c53d5);fs[_0x49bc('0x68')](path[_0x49bc('0x53')](_0x3d4f13,util[_0x49bc('0x43')]('message%d.eml',_0xa957b5)),_0x500413);return _0x3a82cc(_0x500413);});});})[_0x49bc('0x19')](function(){return new BPromise(function(_0x5ae889,_0x2cceed){zipdir(_0x3d4f13,{'saveTo':_0x381287},function(_0x1e3f01,_0x35342f){if(_0x1e3f01)return _0x2cceed(_0x1e3f01);return _0x5ae889(_0x35342f);});})[_0x49bc('0x19')](function(){return new BPromise(function(_0xc386a5,_0x460f2c){rimraf(_0x3d4f13,function(_0x3b57c2){if(_0x3b57c2)_0x460f2c(_0x3b57c2);return _0xc386a5();});});})[_0x49bc('0x19')](function(){return _0x45ca42['download'](_0x381287,_0x49a00d,function(_0x1270ea){if(!_0x1270ea)fs[_0x49bc('0x69')](_0x381287);});});});}else{return _0x45ca42[_0x49bc('0x11')](0xc8);}})[_0x49bc('0x25')](handleError(_0x45ca42,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 80a95ce..af0fbdb 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 _0x7dff=['update','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','setMaxListeners','save'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0x7dff,0x182));var _0xf7df=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x7dff[_0x710815];return _0x5b3b89;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0xf7df('0x0')];var MailMessage=require(_0xf7df('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf7df('0x2')](0x0);var events={'afterCreate':_0xf7df('0x3'),'afterUpdate':_0xf7df('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2de86e){return function(_0x3b24e8,_0x147147,_0x5bd9c8){_0x3b24e8[_0xf7df('0x5')]({'attributes':['id'],'raw':!![]})[_0xf7df('0x6')](function(_0x3f50e7){_0x3b24e8[_0xf7df('0x7')]('Users',_0x3f50e7[_0xf7df('0x8')](function(_0x109507){return{'id':_0x109507['id']};}));return MailMessage[_0xf7df('0x9')]({'where':{'MailInteractionId':_0x3b24e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf7df('0x6')](function(_0x494860){_0x3b24e8[_0xf7df('0x7')](_0xf7df('0xa'),_0x494860['length']);MailInteractionEvents['emit'](_0x2de86e+':'+_0x3b24e8['id'],_0x3b24e8);MailInteractionEvents[_0xf7df('0xb')](_0x2de86e,_0x3b24e8);_0x5bd9c8(null);})['catch'](_0x5bd9c8(null));};}for(var e in events){if(events[_0xf7df('0xc')](e)){var event=events[e];MailInteraction[_0xf7df('0xd')](e,emitEvent(event));}}module[_0xf7df('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x537a=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','MailMessage','save','update','remove','getUsers'];(function(_0x19f665,_0x593e01){var _0x3368d8=function(_0x1663ef){while(--_0x1663ef){_0x19f665['push'](_0x19f665['shift']());}};_0x3368d8(++_0x593e01);}(_0x537a,0x197));var _0xa537=function(_0xb60c8c,_0x5a9497){_0xb60c8c=_0xb60c8c-0x0;var _0x5a0247=_0x537a[_0xb60c8c];return _0x5a0247;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0xa537('0x0')];var MailMessage=require(_0xa537('0x1'))['db'][_0xa537('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa537('0x3'),'afterUpdate':_0xa537('0x4'),'afterDestroy':_0xa537('0x5')};function emitEvent(_0x5b1aad){return function(_0x2b253a,_0x581a45,_0x402fc2){_0x2b253a[_0xa537('0x6')]({'attributes':['id'],'raw':!![]})[_0xa537('0x7')](function(_0x4da134){_0x2b253a[_0xa537('0x8')](_0xa537('0x9'),_0x4da134[_0xa537('0xa')](function(_0x4c809b){return{'id':_0x4c809b['id']};}));return MailMessage[_0xa537('0xb')]({'where':{'MailInteractionId':_0x2b253a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa537('0x7')](function(_0x455c65){_0x2b253a[_0xa537('0x8')](_0xa537('0xc'),_0x455c65[_0xa537('0xd')]);MailInteractionEvents[_0xa537('0xe')](_0x5b1aad+':'+_0x2b253a['id'],_0x2b253a);MailInteractionEvents['emit'](_0x5b1aad,_0x2b253a);_0x402fc2(null);})['catch'](_0x402fc2(null));};}for(var e in events){if(events[_0xa537('0xf')](e)){var event=events[e];MailInteraction[_0xa537('0x10')](e,emitEvent(event));}}module[_0xa537('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b748111..71d56ec 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 _0x6917=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','get','MailMessage','update','then','utf8mb4'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0x6917,0xc5));var _0x7691=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x6917[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x7691('0x0'));var util=require(_0x7691('0x1'));var logger=require(_0x7691('0x2'))('api');var moment=require(_0x7691('0x3'));var BPromise=require(_0x7691('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7691('0x5'));var rimraf=require('rimraf');var config=require(_0x7691('0x6'));var attributes=require(_0x7691('0x7'));module[_0x7691('0x8')]=function(_0x260224,_0x556e90){return _0x260224['define'](_0x7691('0x9'),attributes,{'tableName':_0x7691('0xa'),'paranoid':![],'indexes':[{'name':_0x7691('0xb'),'fields':[_0x7691('0xc'),'to'],'type':_0x7691('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x488d1a,_0xa3fdb3,_0x280e7f){if(_0x488d1a[_0x7691('0xe')]){_0x488d1a[_0x7691('0xf')]=moment()[_0x7691('0x10')](_0x7691('0x11'));}if(_0x488d1a['closed']){_0x488d1a[_0x7691('0x12')]=moment()[_0x7691('0x10')](_0x7691('0x11'));}_0x280e7f(null,_0xa3fdb3);},'beforeUpdate':function(_0x25e454,_0x545e58,_0x4dfc58){if(_0x25e454[_0x7691('0x13')](_0x7691('0xe'))){_0x25e454[_0x7691('0xf')]=_0x25e454[_0x7691('0xe')]?moment()[_0x7691('0x10')](_0x7691('0x11')):null;}if(_0x25e454[_0x7691('0x13')](_0x7691('0x14'))){_0x25e454[_0x7691('0x12')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x25e454[_0x7691('0xe')]=null;_0x25e454[_0x7691('0xf')]=null;}_0x4dfc58(null,_0x25e454);},'afterUpdate':function(_0x35cb89,_0x26a0ca,_0x4f491d){var _0x366aa7=_0x260224[_0x7691('0x15')];var _0x1b06b7=_0x35cb89[_0x7691('0x16')]({'plain':!![]});if(_0x1b06b7[_0x7691('0x14')]){return _0x366aa7[_0x7691('0x17')][_0x7691('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x1b06b7['id']}})[_0x7691('0x19')](function(){_0x4f491d();})['catch'](function(_0x14bc2e){_0x4f491d(_0x14bc2e);});}else{_0x4f491d();}}},'charset':_0x7691('0x1a'),'collate':_0x7691('0x1b')});}; \ No newline at end of file +var _0x7bf8=['closedAt','changed','substatus','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','./mailInteraction.attributes','MailInteraction','mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x1b25ee,_0x455a6e){var _0x5d9087=function(_0x209ebf){while(--_0x209ebf){_0x1b25ee['push'](_0x1b25ee['shift']());}};_0x5d9087(++_0x455a6e);}(_0x7bf8,0xf5));var _0x87bf=function(_0x15296c,_0xba34d7){_0x15296c=_0x15296c-0x0;var _0x3687f2=_0x7bf8[_0x15296c];return _0x3687f2;};'use strict';var _=require(_0x87bf('0x0'));var util=require(_0x87bf('0x1'));var logger=require('../../config/logger')(_0x87bf('0x2'));var moment=require('moment');var BPromise=require(_0x87bf('0x3'));var rp=require(_0x87bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87bf('0x5'));var config=require('../../config/environment');var attributes=require(_0x87bf('0x6'));module['exports']=function(_0x141d0c,_0x3e3d9c){return _0x141d0c['define'](_0x87bf('0x7'),attributes,{'tableName':_0x87bf('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x87bf('0x9'),'to'],'type':_0x87bf('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a247b,_0xb3a9a3,_0x430e18){if(_0x2a247b['substatus']){_0x2a247b[_0x87bf('0xb')]=moment()[_0x87bf('0xc')](_0x87bf('0xd'));}if(_0x2a247b[_0x87bf('0xe')]){_0x2a247b[_0x87bf('0xf')]=moment()['format'](_0x87bf('0xd'));}_0x430e18(null,_0xb3a9a3);},'beforeUpdate':function(_0xdbb72c,_0x31d745,_0x19eb1a){if(_0xdbb72c[_0x87bf('0x10')](_0x87bf('0x11'))){_0xdbb72c[_0x87bf('0xb')]=_0xdbb72c[_0x87bf('0x11')]?moment()[_0x87bf('0xc')](_0x87bf('0xd')):null;}if(_0xdbb72c['changed'](_0x87bf('0xe'))){_0xdbb72c['closedAt']=moment()[_0x87bf('0xc')](_0x87bf('0xd'));_0xdbb72c[_0x87bf('0x11')]=null;_0xdbb72c['substatusAt']=null;}_0x19eb1a(null,_0xdbb72c);},'afterUpdate':function(_0x19bc25,_0x166f14,_0x6801ff){var _0x4a0ee2=_0x141d0c[_0x87bf('0x12')];var _0x39cb23=_0x19bc25[_0x87bf('0x13')]({'plain':!![]});if(_0x39cb23[_0x87bf('0xe')]){return _0x4a0ee2[_0x87bf('0x14')][_0x87bf('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x39cb23['id']}})[_0x87bf('0x16')](function(){_0x6801ff();})[_0x87bf('0x17')](function(_0x1509a0){_0x6801ff(_0x1509a0);});}else{_0x6801ff();}}},'charset':_0x87bf('0x18'),'collate':_0x87bf('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8e55df4..9b067fb 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 _0xac6a=['MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','debug','stringify','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x559c22,_0x478de2){var _0x311862=function(_0x328467){while(--_0x328467){_0x559c22['push'](_0x559c22['shift']());}};_0x311862(++_0x478de2);}(_0xac6a,0xc2));var _0xaac6=function(_0x3918dc,_0x34054d){_0x3918dc=_0x3918dc-0x0;var _0x2b2fa3=_0xac6a[_0x3918dc];return _0x2b2fa3;};'use strict';var _=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var moment=require(_0xaac6('0x2'));var BPromise=require(_0xaac6('0x3'));var rs=require(_0xaac6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaac6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaac6('0x6'))(_0xaac6('0x7'));var config=require(_0xaac6('0x8'));var jayson=require(_0xaac6('0x9'));var client=jayson[_0xaac6('0xa')][_0xaac6('0xb')]({'port':0x232a});config[_0xaac6('0xc')]=_[_0xaac6('0xd')](config[_0xaac6('0xc')],{'host':_0xaac6('0xe'),'port':0x18eb});var socket=require(_0xaac6('0xf'))(new Redis(config[_0xaac6('0xc')]));require('./mailInteraction.socket')[_0xaac6('0x10')](socket);function respondWithRpcPromise(_0x160834,_0x31fa92,_0x37c3ba){return new BPromise(function(_0x19345a,_0x2b9460){return client['request'](_0x160834,_0x37c3ba)[_0xaac6('0x11')](function(_0x1605a3){logger[_0xaac6('0x12')](_0xaac6('0x13'),_0x31fa92,_0xaac6('0x14'));logger['debug'](_0xaac6('0x15'),_0x31fa92,_0xaac6('0x14'),JSON['stringify'](_0x1605a3));if(_0x1605a3['error']){if(_0x1605a3[_0xaac6('0x16')][_0xaac6('0x17')]===0x1f4){logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);return _0x2b9460(_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);}logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);return _0x19345a(_0x1605a3['error']['message']);}else{logger[_0xaac6('0x12')](_0xaac6('0x13'),_0x31fa92,_0xaac6('0x14'));_0x19345a(_0x1605a3[_0xaac6('0x19')][_0xaac6('0x18')]);}})['catch'](function(_0x22d66e){logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x22d66e);_0x2b9460(_0x22d66e);});});}exports[_0xaac6('0x1a')]=function(_0xab5028){var _0x1e7c3e=this;return new Promise(function(_0x450019,_0x4a6064){return db[_0xaac6('0x1b')][_0xaac6('0x1c')](_0xab5028[_0xaac6('0x1d')],{'raw':_0xab5028[_0xaac6('0x1e')]?_0xab5028[_0xaac6('0x1e')][_0xaac6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab5028[_0xaac6('0x1e')]?_0xab5028['options']['where']||null:null,'attributes':_0xab5028[_0xaac6('0x1e')]?_0xab5028['options'][_0xaac6('0x20')]||null:null,'limit':_0xab5028[_0xaac6('0x1e')]?_0xab5028[_0xaac6('0x1e')]['limit']||null:null})[_0xaac6('0x11')](function(_0x536002){logger[_0xaac6('0x12')](_0xaac6('0x1a'),_0xab5028);logger[_0xaac6('0x21')](_0xaac6('0x1a'),_0xab5028,JSON[_0xaac6('0x22')](_0x536002));_0x450019(_0x536002);})['catch'](function(_0xc4b235){logger[_0xaac6('0x16')]('UpdateMailInteraction',_0xc4b235['message'],_0xab5028);_0x4a6064(_0x1e7c3e[_0xaac6('0x16')](0x1f4,_0xc4b235['message']));});});};exports[_0xaac6('0x23')]=function(_0x41090a){return new Promise(function(_0x15dfee,_0x3b63f3){return db[_0xaac6('0x1b')][_0xaac6('0x24')]({'where':_0x41090a[_0xaac6('0x1e')]?_0x41090a[_0xaac6('0x1e')][_0xaac6('0x25')]||null:null})['then'](function(_0x8143e){if(_0x8143e){return _0x8143e[_0xaac6('0x26')](_0x41090a[_0xaac6('0x1d')][_0xaac6('0x27')],_[_0xaac6('0x28')](_0x41090a['body'],['ids','id'])||{});}})[_0xaac6('0x29')](function(_0x344140){logger[_0xaac6('0x12')]('AddTags',_0x41090a);logger[_0xaac6('0x21')](_0xaac6('0x2a'),_0x41090a,JSON[_0xaac6('0x22')](_0x344140));_0x15dfee(_0x344140);})['catch'](function(_0x257b15){logger[_0xaac6('0x16')](_0xaac6('0x2a'),_0x257b15[_0xaac6('0x18')],_0x41090a);_0x3b63f3(_this[_0xaac6('0x16')](0x1f4,_0x257b15['message']));});});}; \ No newline at end of file +var _0x956b=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','update','body','options','raw','where','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x956b,0x16e));var _0xb956=function(_0x23278b,_0x4ee261){_0x23278b=_0x23278b-0x0;var _0x46ce06=_0x956b[_0x23278b];return _0x46ce06;};'use strict';var _=require(_0xb956('0x0'));var util=require(_0xb956('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb956('0x2'));var fs=require('fs');var Redis=require(_0xb956('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb956('0x4'));var logger=require(_0xb956('0x5'))(_0xb956('0x6'));var config=require(_0xb956('0x7'));var jayson=require(_0xb956('0x8'));var client=jayson['client'][_0xb956('0x9')]({'port':0x232a});config[_0xb956('0xa')]=_[_0xb956('0xb')](config[_0xb956('0xa')],{'host':_0xb956('0xc'),'port':0x18eb});var socket=require(_0xb956('0xd'))(new Redis(config[_0xb956('0xa')]));require(_0xb956('0xe'))['register'](socket);function respondWithRpcPromise(_0x4254bb,_0x5533d5,_0xcd00c8){return new BPromise(function(_0xd9f4af,_0x1afe03){return client[_0xb956('0xf')](_0x4254bb,_0xcd00c8)[_0xb956('0x10')](function(_0x33bf55){logger['info']('MailInteraction,\x20%s,\x20%s',_0x5533d5,_0xb956('0x11'));logger[_0xb956('0x12')](_0xb956('0x13'),_0x5533d5,_0xb956('0x11'),JSON[_0xb956('0x14')](_0x33bf55));if(_0x33bf55[_0xb956('0x15')]){if(_0x33bf55[_0xb956('0x15')][_0xb956('0x16')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x5533d5,_0x33bf55['error'][_0xb956('0x17')]);return _0x1afe03(_0x33bf55['error'][_0xb956('0x17')]);}logger['error'](_0xb956('0x18'),_0x5533d5,_0x33bf55['error'][_0xb956('0x17')]);return _0xd9f4af(_0x33bf55[_0xb956('0x15')][_0xb956('0x17')]);}else{logger[_0xb956('0x19')]('MailInteraction,\x20%s,\x20%s',_0x5533d5,_0xb956('0x11'));_0xd9f4af(_0x33bf55[_0xb956('0x1a')][_0xb956('0x17')]);}})[_0xb956('0x1b')](function(_0x29c42d){logger[_0xb956('0x15')](_0xb956('0x18'),_0x5533d5,_0x29c42d);_0x1afe03(_0x29c42d);});});}exports[_0xb956('0x1c')]=function(_0x203448){var _0x4067fa=this;return new Promise(function(_0x4b97b5,_0x2123f1){return db['MailInteraction'][_0xb956('0x1d')](_0x203448[_0xb956('0x1e')],{'raw':_0x203448[_0xb956('0x1f')]?_0x203448[_0xb956('0x1f')][_0xb956('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203448[_0xb956('0x1f')]?_0x203448[_0xb956('0x1f')][_0xb956('0x21')]||null:null,'attributes':_0x203448[_0xb956('0x1f')]?_0x203448[_0xb956('0x1f')]['attributes']||null:null,'limit':_0x203448[_0xb956('0x1f')]?_0x203448['options']['limit']||null:null})[_0xb956('0x10')](function(_0x2eaae5){logger[_0xb956('0x19')](_0xb956('0x1c'),_0x203448);logger[_0xb956('0x12')](_0xb956('0x1c'),_0x203448,JSON[_0xb956('0x14')](_0x2eaae5));_0x4b97b5(_0x2eaae5);})['catch'](function(_0x25b103){logger[_0xb956('0x15')](_0xb956('0x1c'),_0x25b103[_0xb956('0x17')],_0x203448);_0x2123f1(_0x4067fa[_0xb956('0x15')](0x1f4,_0x25b103[_0xb956('0x17')]));});});};exports[_0xb956('0x22')]=function(_0x3f37ff){return new Promise(function(_0x238168,_0x106d4c){return db['MailInteraction'][_0xb956('0x23')]({'where':_0x3f37ff[_0xb956('0x1f')]?_0x3f37ff[_0xb956('0x1f')]['where']||null:null})[_0xb956('0x10')](function(_0xb9673f){if(_0xb9673f){return _0xb9673f[_0xb956('0x24')](_0x3f37ff[_0xb956('0x1e')][_0xb956('0x25')],_[_0xb956('0x26')](_0x3f37ff['body'],[_0xb956('0x25'),'id'])||{});}})[_0xb956('0x27')](function(_0x2f711a){logger[_0xb956('0x19')](_0xb956('0x28'),_0x3f37ff);logger[_0xb956('0x12')](_0xb956('0x28'),_0x3f37ff,JSON[_0xb956('0x14')](_0x2f711a));_0x238168(_0x2f711a);})['catch'](function(_0x1e9193){logger[_0xb956('0x15')](_0xb956('0x28'),_0x1e9193[_0xb956('0x17')],_0x3f37ff);_0x106d4c(_this[_0xb956('0x15')](0x1f4,_0x1e9193[_0xb956('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 4fcf941..88692e0 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 _0x0371=['mailInteraction:','./mailInteraction.events','save','emit'];(function(_0x165936,_0x128cb9){var _0x25dd5a=function(_0x49f202){while(--_0x49f202){_0x165936['push'](_0x165936['shift']());}};_0x25dd5a(++_0x128cb9);}(_0x0371,0x189));var _0x1037=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0x0371[_0x151721];return _0x2deaa7;};'use strict';var MailInteractionEvents=require(_0x1037('0x0'));var events=[_0x1037('0x1'),'remove','update'];function createListener(_0x5126d3,_0x35e197){return function(_0x3f4daf){_0x35e197[_0x1037('0x2')](_0x5126d3,_0x3f4daf);};}function removeListener(_0x209b8b,_0x5061be){return function(){MailInteractionEvents['removeListener'](_0x209b8b,_0x5061be);};}exports['register']=function(_0x561ad8){for(var _0x4bd3e3=0x0,_0xf91fc3=events['length'];_0x4bd3e3<_0xf91fc3;_0x4bd3e3++){var _0x584e15=events[_0x4bd3e3];var _0x59a19d=createListener(_0x1037('0x3')+_0x584e15,_0x561ad8);MailInteractionEvents['on'](_0x584e15,_0x59a19d);}}; \ No newline at end of file +var _0xe7ab=['remove','emit','register','length','./mailInteraction.events'];(function(_0x28f9ad,_0x481bfb){var _0x58e707=function(_0x3a0e5e){while(--_0x3a0e5e){_0x28f9ad['push'](_0x28f9ad['shift']());}};_0x58e707(++_0x481bfb);}(_0xe7ab,0x130));var _0xbe7a=function(_0x237a8e,_0x296c2e){_0x237a8e=_0x237a8e-0x0;var _0x12369a=_0xe7ab[_0x237a8e];return _0x12369a;};'use strict';var MailInteractionEvents=require(_0xbe7a('0x0'));var events=['save',_0xbe7a('0x1'),'update'];function createListener(_0x585ac7,_0x24e953){return function(_0x3baa4f){_0x24e953[_0xbe7a('0x2')](_0x585ac7,_0x3baa4f);};}function removeListener(_0x18a6bf,_0x514e81){return function(){MailInteractionEvents['removeListener'](_0x18a6bf,_0x514e81);};}exports[_0xbe7a('0x3')]=function(_0x4b10d8){for(var _0x44eb16=0x0,_0x39e654=events[_0xbe7a('0x4')];_0x44eb16<_0x39e654;_0x44eb16++){var _0x50f7c2=events[_0x44eb16];var _0x4f6ebb=createListener('mailInteraction:'+_0x50f7c2,_0x4b10d8);MailInteractionEvents['on'](_0x50f7c2,_0x4f6ebb);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 81d78b8..5ba4e91 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 _0x2821=['describe','/:id','show','/:id/download','download','tracked','mailmessage:create','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2821,0x87));var _0x1282=function(_0x6b576,_0xa0ad40){_0x6b576=_0x6b576-0x0;var _0x1d5731=_0x2821[_0x6b576];return _0x1d5731;};'use strict';var multer=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var path=require(_0x1282('0x2'));var timeout=require(_0x1282('0x3'));var express=require(_0x1282('0x4'));var router=express[_0x1282('0x5')]();var fs_extra=require(_0x1282('0x6'));var auth=require(_0x1282('0x7'));var interaction=require(_0x1282('0x8'));var config=require(_0x1282('0x9'));var controller=require(_0x1282('0xa'));router['get']('/',auth[_0x1282('0xb')](),controller[_0x1282('0xc')]);router[_0x1282('0xd')](_0x1282('0xe'),auth[_0x1282('0xb')](),controller[_0x1282('0xf')]);router[_0x1282('0xd')](_0x1282('0x10'),auth['isAuthenticated'](),controller[_0x1282('0x11')]);router[_0x1282('0xd')](_0x1282('0x12'),auth[_0x1282('0xb')](),controller[_0x1282('0x13')]);router['post']('/',auth[_0x1282('0xb')](),interaction[_0x1282('0x14')]('mail',_0x1282('0x15')),controller[_0x1282('0x16')]);router['put'](_0x1282('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x1282('0x17')](_0x1282('0x18'),auth[_0x1282('0xb')](),controller[_0x1282('0x19')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x1282('0x1a')]);router[_0x1282('0x1b')](_0x1282('0x10'),auth[_0x1282('0xb')](),controller[_0x1282('0x1c')]);module[_0x1282('0x1d')]=router; \ No newline at end of file +var _0x0b96=['destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','isAuthenticated','index','get','/:id','download','post','reject'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x0b96,0xc2));var _0x60b9=function(_0xc2fc17,_0x2b78be){_0xc2fc17=_0xc2fc17-0x0;var _0x5b4fe0=_0x0b96[_0xc2fc17];return _0x5b4fe0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x60b9('0x0'));var timeout=require(_0x60b9('0x1'));var express=require('express');var router=express[_0x60b9('0x2')]();var fs_extra=require(_0x60b9('0x3'));var auth=require(_0x60b9('0x4'));var interaction=require(_0x60b9('0x5'));var config=require('../../config/environment');var controller=require(_0x60b9('0x6'));router['get']('/',auth[_0x60b9('0x7')](),controller[_0x60b9('0x8')]);router[_0x60b9('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x60b9('0x9')](_0x60b9('0xa'),auth[_0x60b9('0x7')](),controller['show']);router[_0x60b9('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x60b9('0xb')]);router[_0x60b9('0xc')]('/',auth[_0x60b9('0x7')](),interaction['tracked']('mail','mailmessage:create'),controller['create']);router['put'](_0x60b9('0xa'),auth['isAuthenticated'](),controller['update']);router['put']('/:id/accept',auth[_0x60b9('0x7')](),controller['accept']);router['put']('/:id/reject',auth[_0x60b9('0x7')](),controller[_0x60b9('0xd')]);router['delete']('/:id',auth[_0x60b9('0x7')](),controller[_0x60b9('0xe')]);module[_0x60b9('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 0d9ad94..553295c 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 _0x574b=['lodash','TEXT','long','ENUM','out','STRING','BOOLEAN','Email','sequelize'];(function(_0x2735d9,_0x46cbe7){var _0x287543=function(_0x230db8){while(--_0x230db8){_0x2735d9['push'](_0x2735d9['shift']());}};_0x287543(++_0x46cbe7);}(_0x574b,0xc5));var _0xb574=function(_0x3f2812,_0x43518e){_0x3f2812=_0x3f2812-0x0;var _0xc92555=_0x574b[_0x3f2812];return _0xc92555;};'use strict';var Sequelize=require(_0xb574('0x0'));var _=require(_0xb574('0x1'));module['exports']={'body':{'type':Sequelize[_0xb574('0x2')](_0xb574('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb574('0x4')]('in','out'),'defaultValue':_0xb574('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb574('0x6')](0x1fe)},'from':{'type':Sequelize[_0xb574('0x6')]},'to':{'type':Sequelize[_0xb574('0x2')](_0xb574('0x3'))},'cc':{'type':Sequelize['TEXT'](_0xb574('0x3'))},'bcc':{'type':Sequelize[_0xb574('0x2')](_0xb574('0x3'))},'subject':{'type':Sequelize[_0xb574('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb574('0x7')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xb574('0x2')]('long')},'originCc':{'type':Sequelize[_0xb574('0x2')](_0xb574('0x3'))},'originChannel':{'type':Sequelize[_0xb574('0x4')](_0xb574('0x8'),'Chat'),'defaultValue':_0xb574('0x8'),'allowNull':![]}}; \ No newline at end of file +var _0x1c5c=['TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email','lodash','exports'];(function(_0x4046c3,_0x23ec82){var _0x5a4e0b=function(_0x440742){while(--_0x440742){_0x4046c3['push'](_0x4046c3['shift']());}};_0x5a4e0b(++_0x23ec82);}(_0x1c5c,0x1ae));var _0xc1c5=function(_0x45b809,_0x13074b){_0x45b809=_0x45b809-0x0;var _0x2f45f1=_0x1c5c[_0x45b809];return _0x2f45f1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc1c5('0x0'));module[_0xc1c5('0x1')]={'body':{'type':Sequelize[_0xc1c5('0x2')](_0xc1c5('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc1c5('0x2')](_0xc1c5('0x4'))},'read':{'type':Sequelize[_0xc1c5('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc1c5('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xc1c5('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xc1c5('0x2')](_0xc1c5('0x3'))},'cc':{'type':Sequelize['TEXT'](_0xc1c5('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0xc1c5('0x3'))},'subject':{'type':Sequelize[_0xc1c5('0x2')]},'sentAt':{'type':Sequelize[_0xc1c5('0x8')]},'attach':{'type':Sequelize[_0xc1c5('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xc1c5('0x8')]},'originTo':{'type':Sequelize[_0xc1c5('0x2')](_0xc1c5('0x3'))},'originCc':{'type':Sequelize[_0xc1c5('0x2')](_0xc1c5('0x3'))},'originChannel':{'type':Sequelize[_0xc1c5('0xa')]('Email','Chat'),'defaultValue':_0xc1c5('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 8120812..f2a426c 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 _0xdb6a=['secret','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','CmContact','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','readAt','UserId','user','agent','get','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','accept','fromString','EventManager','acceptmessage','reject','MailInteraction','info','role','RejectMessage','rejectMessage','User','SIP/%s','event','rejectmessage','download','unix','toString','server','tmp','from','bcc','createdAt','Attachment','subject','decode','headers','Bcc','Attachments','readFileSync','build','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','debug','stringify','code','error','MailMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','MailMessage','findAll','rows','params','includeAll','include','find','body','describe','create','direction','out'];(function(_0x706b20,_0x5afd8a){var _0x18f85c=function(_0x431fab){while(--_0x431fab){_0x706b20['push'](_0x706b20['shift']());}};_0x18f85c(++_0x5afd8a);}(_0xdb6a,0x17f));var _0xadb6=function(_0x32560c,_0xbdcd75){_0x32560c=_0x32560c-0x0;var _0x54bc4c=_0xdb6a[_0x32560c];return _0x54bc4c;};'use strict';var emlformat=require(_0xadb6('0x0'));var moment=require(_0xadb6('0x1'));var BPromise=require(_0xadb6('0x2'));var util=require(_0xadb6('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xadb6('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xadb6('0x5'));var qs=require(_0xadb6('0x6'));var logger=require(_0xadb6('0x7'))(_0xadb6('0x8'));var interaction_log=require(_0xadb6('0x7'))(_0xadb6('0x9'));var config=require(_0xadb6('0xa'));var db=require(_0xadb6('0xb'))['db'];config[_0xadb6('0xc')]=_[_0xadb6('0xd')](config[_0xadb6('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadb6('0xc')]));var htmlEntities=require(_0xadb6('0xe'));require(_0xadb6('0xf'))[_0xadb6('0x10')](socket);var jayson=require(_0xadb6('0x11'));var client=jayson[_0xadb6('0x12')][_0xadb6('0x13')]({'port':0x232c});var client9003=jayson[_0xadb6('0x12')]['http']({'port':0x232b});var client9002=jayson['client'][_0xadb6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x4086a5,_0x3d7c27,_0x4df871,_0x1b8cfe){return new BPromise(function(_0x11cee3,_0x3e5a37){var _0x3ed887=_0x1b8cfe||client;return _0x3ed887[_0xadb6('0x14')](_0x4086a5,_0x4df871)[_0xadb6('0x15')](function(_0x5a9f22){logger['info']('MailMessage,\x20%s,\x20%s',_0x3d7c27,'request\x20sent');logger[_0xadb6('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x3d7c27,'request\x20sent',JSON[_0xadb6('0x17')](_0x5a9f22));if(_0x5a9f22['error']){if(_0x5a9f22['error'][_0xadb6('0x18')]===0x1f4){logger[_0xadb6('0x19')](_0xadb6('0x1a'),_0x3d7c27,_0x5a9f22['error'][_0xadb6('0x1b')]);return _0x3e5a37(_0x5a9f22[_0xadb6('0x19')]['message']);}logger['error'](_0xadb6('0x1a'),_0x3d7c27,_0x5a9f22[_0xadb6('0x19')][_0xadb6('0x1b')]);return _0x11cee3(_0x5a9f22[_0xadb6('0x19')][_0xadb6('0x1b')]);}else{logger['info'](_0xadb6('0x1a'),_0x3d7c27,_0xadb6('0x1c'));_0x11cee3(_0x5a9f22[_0xadb6('0x1d')]['message']);}})[_0xadb6('0x1e')](function(_0x78d5af){logger[_0xadb6('0x19')](_0xadb6('0x1a'),_0x3d7c27,_0x78d5af);_0x3e5a37(_0x78d5af);});});}function respondWithResult(_0x254721,_0xc77c24){_0xc77c24=_0xc77c24||0xc8;return function(_0x2796ef){if(_0x2796ef){return _0x254721[_0xadb6('0x1f')](_0xc77c24)[_0xadb6('0x20')](_0x2796ef);}};}function respondWithFilteredResult(_0xcc8fc1,_0x229e4e){return function(_0x5a269e){if(_0x5a269e){var _0xf3dcff=typeof _0x229e4e[_0xadb6('0x21')]===_0xadb6('0x22')&&typeof _0x229e4e[_0xadb6('0x23')]===_0xadb6('0x22');var _0xefce42=_0x5a269e[_0xadb6('0x24')];var _0x5005bd=_0xf3dcff?0x0:_0x229e4e[_0xadb6('0x21')];var _0x104978=_0xf3dcff?_0x5a269e[_0xadb6('0x24')]:_0x229e4e[_0xadb6('0x21')]+_0x229e4e[_0xadb6('0x23')];var _0x37fbc6;if(_0x104978>=_0xefce42){_0x104978=_0xefce42;_0x37fbc6=0xc8;}else{_0x37fbc6=0xce;}_0xcc8fc1[_0xadb6('0x1f')](_0x37fbc6);return _0xcc8fc1[_0xadb6('0x25')]('Content-Range',_0x5005bd+'-'+_0x104978+'/'+_0xefce42)[_0xadb6('0x20')](_0x5a269e);}return null;};}function saveUpdates(_0x4c5fa3){return function(_0x3285aa){if(_0x3285aa){return _0x3285aa[_0xadb6('0x26')](_0x4c5fa3)[_0xadb6('0x15')](function(_0xffbd57){return _0xffbd57;});}return null;};}function removeEntity(_0x3d3b14){return function(_0x251be9){if(_0x251be9){return _0x251be9[_0xadb6('0x27')]()['then'](function(){_0x3d3b14['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0bb5){return function(_0x355b21){if(!_0x355b21){_0x4c0bb5[_0xadb6('0x28')](0x194);}return _0x355b21;};}function handleError(_0x407ab0,_0x4568c4){_0x4568c4=_0x4568c4||0x1f4;return function(_0x1cb3e7){logger['error'](_0x1cb3e7[_0xadb6('0x29')]);if(_0x1cb3e7[_0xadb6('0x2a')]){delete _0x1cb3e7[_0xadb6('0x2a')];}_0x407ab0[_0xadb6('0x1f')](_0x4568c4)[_0xadb6('0x2b')](_0x1cb3e7);};}exports['index']=function(_0x37e343,_0x548fd8){var _0x2f73a5={},_0x7cef47={},_0x1d6a31={'count':0x0,'rows':[]};var _0x4a3f7e=_[_0xadb6('0x2c')](db['MailMessage'][_0xadb6('0x2d')],function(_0x4e320c){return{'name':_0x4e320c[_0xadb6('0x2e')],'type':_0x4e320c[_0xadb6('0x2f')][_0xadb6('0x30')]};});_0x7cef47[_0xadb6('0x31')]=_[_0xadb6('0x2c')](_0x4a3f7e,'name');_0x7cef47[_0xadb6('0x32')]=_[_0xadb6('0x33')](_0x37e343[_0xadb6('0x32')]);_0x7cef47['filters']=_[_0xadb6('0x34')](_0x7cef47[_0xadb6('0x31')],_0x7cef47[_0xadb6('0x32')]);_0x2f73a5['attributes']=_['intersection'](_0x7cef47[_0xadb6('0x31')],qs[_0xadb6('0x35')](_0x37e343[_0xadb6('0x32')][_0xadb6('0x35')]));_0x2f73a5[_0xadb6('0x36')]=_0x2f73a5[_0xadb6('0x36')][_0xadb6('0x37')]?_0x2f73a5[_0xadb6('0x36')]:_0x7cef47[_0xadb6('0x31')];if(!_0x37e343[_0xadb6('0x32')][_0xadb6('0x38')](_0xadb6('0x39'))){_0x2f73a5['limit']=qs[_0xadb6('0x23')](_0x37e343[_0xadb6('0x32')][_0xadb6('0x23')]);_0x2f73a5[_0xadb6('0x21')]=qs['offset'](_0x37e343[_0xadb6('0x32')][_0xadb6('0x21')]);}_0x2f73a5[_0xadb6('0x3a')]=qs[_0xadb6('0x3b')](_0x37e343[_0xadb6('0x32')][_0xadb6('0x3b')]);_0x2f73a5['where']=qs[_0xadb6('0x3c')](_[_0xadb6('0x3d')](_0x37e343[_0xadb6('0x32')],_0x7cef47[_0xadb6('0x3c')]),_0x4a3f7e);if(_0x37e343['query'][_0xadb6('0x3e')]){_0x2f73a5[_0xadb6('0x3f')]=_[_0xadb6('0x40')](_0x2f73a5['where'],{'$or':_['map'](_0x4a3f7e,function(_0x521ef7){if(_0x521ef7['type']!==_0xadb6('0x41')){var _0x1252d9={};_0x1252d9[_0x521ef7[_0xadb6('0x2a')]]={'$like':'%'+_0x37e343[_0xadb6('0x32')]['filter']+'%'};return _0x1252d9;}})});}_0x2f73a5=_[_0xadb6('0x40')]({},_0x2f73a5,_0x37e343[_0xadb6('0x42')]);var _0x33083d={'where':_0x2f73a5['where']};return db[_0xadb6('0x43')][_0xadb6('0x24')](_0x33083d)['then'](function(_0x2d549f){_0x1d6a31[_0xadb6('0x24')]=_0x2d549f;if(_0x37e343[_0xadb6('0x32')]['includeAll']){_0x2f73a5['include']=[{'all':!![]}];}return db[_0xadb6('0x43')][_0xadb6('0x44')](_0x2f73a5);})[_0xadb6('0x15')](function(_0x113d24){_0x1d6a31[_0xadb6('0x45')]=_0x113d24;return _0x1d6a31;})[_0xadb6('0x15')](respondWithFilteredResult(_0x548fd8,_0x2f73a5))[_0xadb6('0x1e')](handleError(_0x548fd8,null));};exports['show']=function(_0x2f7fa1,_0x11f59b){var _0x1cc908={'raw':!![],'where':{'id':_0x2f7fa1[_0xadb6('0x46')]['id']}},_0x2cf35f={};_0x2cf35f[_0xadb6('0x31')]=_['keys'](db[_0xadb6('0x43')][_0xadb6('0x2d')]);_0x2cf35f[_0xadb6('0x32')]=_[_0xadb6('0x33')](_0x2f7fa1[_0xadb6('0x32')]);_0x2cf35f[_0xadb6('0x3c')]=_[_0xadb6('0x34')](_0x2cf35f[_0xadb6('0x31')],_0x2cf35f[_0xadb6('0x32')]);_0x1cc908['attributes']=_[_0xadb6('0x34')](_0x2cf35f[_0xadb6('0x31')],qs[_0xadb6('0x35')](_0x2f7fa1[_0xadb6('0x32')][_0xadb6('0x35')]));_0x1cc908['attributes']=_0x1cc908[_0xadb6('0x36')][_0xadb6('0x37')]?_0x1cc908['attributes']:_0x2cf35f[_0xadb6('0x31')];if(_0x2f7fa1[_0xadb6('0x32')][_0xadb6('0x47')]){_0x1cc908[_0xadb6('0x48')]=[{'all':!![]}];}_0x1cc908=_[_0xadb6('0x40')]({},_0x1cc908,_0x2f7fa1['options']);return db['MailMessage'][_0xadb6('0x49')](_0x1cc908)[_0xadb6('0x15')](handleEntityNotFound(_0x11f59b,null))[_0xadb6('0x15')](respondWithResult(_0x11f59b,null))['catch'](handleError(_0x11f59b,null));};exports[_0xadb6('0x26')]=function(_0x30d50a,_0xfdd189){if(_0x30d50a['body']['id']){delete _0x30d50a[_0xadb6('0x4a')]['id'];}return db['MailMessage'][_0xadb6('0x49')]({'where':{'id':_0x30d50a[_0xadb6('0x46')]['id']}})[_0xadb6('0x15')](handleEntityNotFound(_0xfdd189,null))['then'](saveUpdates(_0x30d50a[_0xadb6('0x4a')],null))[_0xadb6('0x15')](respondWithResult(_0xfdd189,null))[_0xadb6('0x1e')](handleError(_0xfdd189,null));};exports[_0xadb6('0x27')]=function(_0x4b4da3,_0x3ae9a0){return db[_0xadb6('0x43')][_0xadb6('0x49')]({'where':{'id':_0x4b4da3[_0xadb6('0x46')]['id']}})[_0xadb6('0x15')](handleEntityNotFound(_0x3ae9a0,null))['then'](removeEntity(_0x3ae9a0,null))[_0xadb6('0x1e')](handleError(_0x3ae9a0,null));};exports[_0xadb6('0x4b')]=function(_0x94e9a6,_0x63736c){return db[_0xadb6('0x43')]['describe']()[_0xadb6('0x15')](respondWithResult(_0x63736c,null))[_0xadb6('0x1e')](handleError(_0x63736c,null));};exports[_0xadb6('0x4c')]=function(_0x238e56,_0x3f3faa){return db[_0xadb6('0x43')]['create'](_0x238e56[_0xadb6('0x4a')])[_0xadb6('0x15')](function(_0x13f526){if(_0x13f526){if(_0x13f526[_0xadb6('0x4d')]===_0xadb6('0x4e')&&!_0x13f526[_0xadb6('0x4f')]){var _0x2ef472,_0x114c2b,_0x173e4c;if(_0x238e56[_0xadb6('0x4a')]['to']){_0x114c2b=_0x238e56[_0xadb6('0x4a')]['to']['split'](',')[0x0];}return db[_0xadb6('0x50')][_0xadb6('0x51')]({'where':{'id':_0x13f526[_0xadb6('0x52')]},'include':[{'model':db[_0xadb6('0x53')],'as':_0xadb6('0x54'),'include':[{'model':db['CmContact'],'as':_0xadb6('0x55'),'where':{'email':_0x114c2b},'limit':0x1,'order':[[_0xadb6('0x56'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xadb6('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xadb6('0x15')](function(_0xf33494){_0x2ef472=_0xf33494;if(!_0x2ef472||!_0x2ef472[_0xadb6('0x57')])return;var _0x24a323=_0x2ef472[_0xadb6('0x58')]();if(_0x238e56[_0xadb6('0x4a')][_0xadb6('0x59')]&&_0x238e56[_0xadb6('0x4a')]['attachments'][_0xadb6('0x37')]){for(var _0x32f78e=0x0;_0x32f78e<_0x238e56['body'][_0xadb6('0x59')]['length'];_0x32f78e+=0x1){_0x238e56[_0xadb6('0x4a')][_0xadb6('0x59')][_0x32f78e]={'filename':_0x238e56[_0xadb6('0x4a')][_0xadb6('0x59')][_0x32f78e][_0xadb6('0x2a')],'path':path[_0xadb6('0x5a')](config[_0xadb6('0x5b')],_0xadb6('0x5c'),_0x238e56['body'][_0xadb6('0x59')][_0x32f78e][_0xadb6('0x5d')])};}}_0x173e4c={'account':_0x24a323,'message':_0x238e56[_0xadb6('0x4a')]};return;})[_0xadb6('0x15')](function(){if(_0x2ef472['List']){if(_0x2ef472[_0xadb6('0x54')]['Contacts']['length']){return _0x2ef472[_0xadb6('0x54')][_0xadb6('0x55')][0x0];}else{return db[_0xadb6('0x5e')]['create'](_[_0xadb6('0xd')](_0x238e56[_0xadb6('0x4a')],{'firstName':_0x238e56[_0xadb6('0x4a')]['to'],'email':_0x238e56[_0xadb6('0x4a')]['to'],'phone':_0x238e56['body']['to'],'ListId':_0x2ef472['ListId']}));}}else{throw new Error(_0xadb6('0x5f'));}})[_0xadb6('0x15')](function(){if(_0x173e4c){return respondWithRpcPromise('SendMail',_0xadb6('0x60'),_0x173e4c,client9003)['then'](function(_0x2590ec){return _0x13f526[_0xadb6('0x26')]({'read':!![],'messageId':_0x2590ec[_0xadb6('0x61')],'sentAt':moment()[_0xadb6('0x62')](_0xadb6('0x63'))});})[_0xadb6('0x1e')](function(_0x2f7f50){logger[_0xadb6('0x19')]('%s',JSON['stringify'](_0x2f7f50));return _0x13f526;});}return _0x13f526;});}return _0x13f526;}})[_0xadb6('0x15')](respondWithResult(_0x3f3faa,0xc9))[_0xadb6('0x1e')](handleError(_0x3f3faa,null));};exports['accept']=function(_0x4e4a9c,_0x17dac8){var _0x1ea323={'agent':{},'channel':_0xadb6('0x64')};if(_0x4e4a9c[_0xadb6('0x4a')]['id']){delete _0x4e4a9c[_0xadb6('0x4a')]['id'];}_0x4e4a9c[_0xadb6('0x4a')]['read']=!![];_0x4e4a9c['body'][_0xadb6('0x65')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4e4a9c[_0xadb6('0x4a')]['UserId']=_0x4e4a9c[_0xadb6('0x4a')][_0xadb6('0x66')]||_0x4e4a9c[_0xadb6('0x67')]['id'];_0x1ea323[_0xadb6('0x68')]['id']=_0x4e4a9c[_0xadb6('0x4a')]['UserId'];return db[_0xadb6('0x43')][_0xadb6('0x49')]({'where':{'id':_0x4e4a9c['params']['id'],'UserId':null}})[_0xadb6('0x15')](handleEntityNotFound(_0x17dac8,null))['then'](saveUpdates(_0x4e4a9c[_0xadb6('0x4a')],null))[_0xadb6('0x15')](function(_0x5b8cc9){if(_0x5b8cc9){_0x1ea323[_0xadb6('0x1b')]=_0x5b8cc9[_0xadb6('0x69')]({'plain':!![]});return db['MailInteraction'][_0xadb6('0x49')]({'where':{'id':_0x5b8cc9[_0xadb6('0x6a')]}});}return null;})[_0xadb6('0x15')](handleEntityNotFound(_0x17dac8,null))[_0xadb6('0x15')](function(_0x41cac3){if(_0x41cac3){return _0x41cac3[_0xadb6('0x26')]({'UserId':_0x4e4a9c[_0xadb6('0x4a')][_0xadb6('0x66')],'read1stAt':_['isNil'](_0x41cac3['read1stAt'])?moment()[_0xadb6('0x62')](_0xadb6('0x63')):undefined});}return null;})['then'](function(_0x3808b1){if(_0x3808b1){_0x1ea323[_0xadb6('0x6b')]=_0x3808b1[_0xadb6('0x69')]({'plain':!![]});interaction_log['info'](_0xadb6('0x6c'),_0x4e4a9c['user']['id'],_0x4e4a9c[_0xadb6('0x67')][_0xadb6('0x2a')],_0x4e4a9c[_0xadb6('0x67')]['role'],_0x1ea323[_0xadb6('0x6b')]['id'],_0x4e4a9c['body']?JSON[_0xadb6('0x17')](_0x4e4a9c[_0xadb6('0x4a')]):_0xadb6('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1ea323);}return null;})[_0xadb6('0x15')](function(_0x3b4795){var _0x5e87c1=_0xadb6('0x6e')+_0x3b4795[_0xadb6('0x1b')][_0xadb6('0x6f')];return db[_0xadb6('0x70')]['query'](_0x5e87c1,{'type':db[_0xadb6('0x71')][_0xadb6('0x72')][_0xadb6('0x73')],'raw':!![]})[_0xadb6('0x15')](function(_0x5f092f){return _0x5f092f;});})['then'](function(_0x3a51d2){if(_0x3a51d2){_0x1ea323[_0xadb6('0x1b')][_0xadb6('0x74')]=_0x3a51d2[0x0];if(!_0x4e4a9c[_0xadb6('0x4a')]['UserId'])return;return db['User'][_0xadb6('0x49')]({'where':{'id':_0x4e4a9c[_0xadb6('0x4a')][_0xadb6('0x66')],'role':_0xadb6('0x68')},'attributes':['id','name',_0xadb6('0x75'),_0xadb6('0x76'),_0xadb6('0x77')],'raw':!![]});}return null;})[_0xadb6('0x15')](function(_0x57b218){if(!_0x57b218)return null;_0x1ea323['message'][_0xadb6('0x68')]=_0x57b218;return _0x1ea323;})[_0xadb6('0x15')](function(_0x3c9e9c){if(_0x3c9e9c){if(_0x4e4a9c[_0xadb6('0x4a')][_0xadb6('0x78')]){_0x1ea323['message'][_0xadb6('0x79')]=util['format']('SIP/%s',_0x4e4a9c[_0xadb6('0x67')]['name']);_0x1ea323[_0xadb6('0x1b')][_0xadb6('0x7a')]=_0x1ea323[_0xadb6('0x7a')];_0x1ea323[_0xadb6('0x1b')][_0xadb6('0x7b')]=_0x1ea323['channel'];_0x1ea323['message']['event']=_0xadb6('0x7c');_0x1ea323[_0xadb6('0x1b')]['body']=htmlToText[_0xadb6('0x7d')](_0x1ea323[_0xadb6('0x1b')][_0xadb6('0x4a')]);return respondWithRpcPromise('EventManager',_0xadb6('0x7e'),{'event':_0xadb6('0x7f'),'message':_0x1ea323[_0xadb6('0x1b')]},client9002)['then'](function(){return _0x1ea323;});}return _0x1ea323;}return null;})[_0xadb6('0x15')](respondWithResult(_0x17dac8,null))['catch'](handleError(_0x17dac8,null));};exports[_0xadb6('0x80')]=function(_0xb5baeb,_0x22daa1){var _0x1152db={'agent':{},'channel':_0xadb6('0x64')};if(_0xb5baeb['body']['id']){delete _0xb5baeb[_0xadb6('0x4a')]['id'];}_0xb5baeb[_0xadb6('0x4a')]['UserId']=_0xb5baeb[_0xadb6('0x4a')][_0xadb6('0x66')]||_0xb5baeb[_0xadb6('0x67')]['id'];_0x1152db['agent']['id']=_0xb5baeb['body']['UserId'];return db[_0xadb6('0x43')][_0xadb6('0x49')]({'where':{'id':_0xb5baeb[_0xadb6('0x46')]['id'],'UserId':null}})[_0xadb6('0x15')](handleEntityNotFound(_0x22daa1,null))[_0xadb6('0x15')](function(_0x459960){if(_0x459960){_0x1152db['message']=_0x459960[_0xadb6('0x69')]({'plain':!![]});return db[_0xadb6('0x81')][_0xadb6('0x49')]({'where':{'id':_0x459960[_0xadb6('0x6a')]}});}return null;})[_0xadb6('0x15')](handleEntityNotFound(_0x22daa1,null))['then'](function(_0x1c2aa5){if(_0x1c2aa5){_0x1152db[_0xadb6('0x6b')]=_0x1c2aa5[_0xadb6('0x69')]({'plain':!![]});interaction_log[_0xadb6('0x82')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb5baeb['user']['id'],_0xb5baeb['user'][_0xadb6('0x2a')],_0xb5baeb['user'][_0xadb6('0x83')],_0x1152db['interaction']['id'],_0xb5baeb[_0xadb6('0x4a')]?JSON[_0xadb6('0x17')](_0xb5baeb[_0xadb6('0x4a')]):_0xadb6('0x6d'));return respondWithRpcPromise(_0xadb6('0x84'),_0xadb6('0x85'),_0x1152db);}return null;})[_0xadb6('0x15')](function(_0x5e2492){var _0x10c1df=_0xadb6('0x6e')+_0x5e2492[_0xadb6('0x1b')][_0xadb6('0x6f')];return db[_0xadb6('0x70')][_0xadb6('0x32')](_0x10c1df,{'type':db['Sequelize'][_0xadb6('0x72')][_0xadb6('0x73')],'raw':!![]})['then'](function(_0x50402c){return _0x50402c;});})[_0xadb6('0x15')](function(_0xa6130a){if(_0xa6130a){_0x1152db[_0xadb6('0x1b')][_0xadb6('0x74')]=_0xa6130a[0x0];if(!_0xb5baeb[_0xadb6('0x4a')][_0xadb6('0x66')])return;return db[_0xadb6('0x86')][_0xadb6('0x49')]({'where':{'id':_0xb5baeb[_0xadb6('0x4a')][_0xadb6('0x66')],'role':_0xadb6('0x68')},'attributes':['id',_0xadb6('0x2a'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x5867a7){if(!_0x5867a7)return null;_0x1152db[_0xadb6('0x1b')][_0xadb6('0x68')]=_0x5867a7;return _0x1152db;})[_0xadb6('0x15')](function(_0x5d2b36){if(_0x5d2b36){_0x5d2b36['message']['interface']=util[_0xadb6('0x62')](_0xadb6('0x87'),_0xb5baeb['user'][_0xadb6('0x2a')]);_0x5d2b36[_0xadb6('0x1b')][_0xadb6('0x7a')]=_0x1152db[_0xadb6('0x7a')];_0x5d2b36[_0xadb6('0x1b')][_0xadb6('0x7b')]=_0x1152db[_0xadb6('0x7a')];_0x5d2b36[_0xadb6('0x1b')][_0xadb6('0x88')]='reject';_0x5d2b36[_0xadb6('0x1b')]['body']=htmlToText[_0xadb6('0x7d')](_0x1152db[_0xadb6('0x1b')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0xadb6('0x89'),'message':_0x5d2b36[_0xadb6('0x1b')]},client9002);return _0x1152db;}return null;})[_0xadb6('0x15')](respondWithResult(_0x22daa1,null))[_0xadb6('0x1e')](handleError(_0x22daa1,null));};exports[_0xadb6('0x8a')]=function(_0xd27600,_0x65d8f6){var _0x3c3a81=moment()[_0xadb6('0x8b')]()[_0xadb6('0x8c')]();var _0x54f750=path[_0xadb6('0x5a')](config[_0xadb6('0x5b')],_0xadb6('0x8d'),'files',_0xadb6('0x8e'));var _0x4e1059=path[_0xadb6('0x5a')](config[_0xadb6('0x5b')],'server','files',_0xadb6('0x59'));var _0x1db584=util[_0xadb6('0x62')]('message-%s.eml',_0x3c3a81);return db[_0xadb6('0x43')][_0xadb6('0x49')]({'where':{'id':_0xd27600[_0xadb6('0x46')]['id']},'attributes':['id',_0xadb6('0x4a'),_0xadb6('0x8f'),'to','cc',_0xadb6('0x90'),'subject',_0xadb6('0x91')],'include':_0xd27600[_0xadb6('0x32')]['attachments']?[{'model':db[_0xadb6('0x92')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x65d8f6,null))['then'](function(_0x1eae51){if(_0x1eae51){var _0xeeabb=_0x1eae51;var _0x1fcba6={'from':_0xeeabb[_0xadb6('0x8f')],'to':_0xeeabb['to'],'subject':_0xeeabb[_0xadb6('0x93')],'html':htmlEntities[_0xadb6('0x94')](_0xeeabb[_0xadb6('0x4a')]),'headers':{'Date':moment(_0xeeabb[_0xadb6('0x91')])[_0xadb6('0x62')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1eae51['cc']){_0x1fcba6['headers']['Cc']=_0x1eae51['cc'];}if(_0x1eae51[_0xadb6('0x90')]){_0x1fcba6[_0xadb6('0x95')][_0xadb6('0x96')]=_0x1eae51['bcc'];}return new BPromise(function(_0x97ea10,_0x516e94){if(_0x1eae51[_0xadb6('0x97')]){for(var _0x5e58f9=0x0;_0x5e58f9<_0x1eae51[_0xadb6('0x97')][_0xadb6('0x37')];_0x5e58f9++){var _0x5729de=_0x1eae51['Attachments'][_0x5e58f9];var _0x3a040a=path[_0xadb6('0x5a')](_0x4e1059,_0x5729de['basename']);if(fs['existsSync'](_0x3a040a)){_0x1fcba6[_0xadb6('0x59')]['push']({'name':_0x5729de[_0xadb6('0x2a')],'contentType':_0x5729de[_0xadb6('0x2f')],'data':fs[_0xadb6('0x98')](_0x3a040a)});}}}emlformat[_0xadb6('0x99')](_0x1fcba6,function(_0x49444d,_0x5db362){if(_0x49444d)return _0x516e94(_0x49444d);fs['writeFileSync'](path[_0xadb6('0x5a')](_0x54f750,_0x1db584),_0x5db362);return _0x97ea10(_0x5db362);});});}})[_0xadb6('0x15')](function(_0x11d295){if(_0x11d295){return _0x65d8f6[_0xadb6('0x8a')](path['join'](_0x54f750,_0x1db584),_0x1db584,function(_0x559383){if(!_0x559383)fs['unlinkSync'](path[_0xadb6('0x5a')](_0x54f750,_0x1db584));});}})[_0xadb6('0x1e')](handleError(_0x65d8f6,null));}; \ No newline at end of file +var _0xc237=['key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','includeAll','find','body','describe','create','direction','out','secret','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','agent','params','get','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','MailInteraction','MailInteractionId','RejectMessage','rejectMessage','ContactId','sequelize','SELECT','contact','motionChannel','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','decode','headers','Bcc','existsSync','push','type','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','util','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','MailMessage','rawAttributes','fieldName'];(function(_0x35e990,_0x5d304d){var _0x5cd35c=function(_0x290f2d){while(--_0x290f2d){_0x35e990['push'](_0x35e990['shift']());}};_0x5cd35c(++_0x5d304d);}(_0xc237,0x113));var _0x7c23=function(_0x11111b,_0x22c56c){_0x11111b=_0x11111b-0x0;var _0xd2c42=_0xc237[_0x11111b];return _0xd2c42;};'use strict';var emlformat=require(_0x7c23('0x0'));var moment=require(_0x7c23('0x1'));var BPromise=require('bluebird');var util=require(_0x7c23('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x7c23('0x3'));var Redis=require(_0x7c23('0x4'));var htmlToText=require(_0x7c23('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x7c23('0x6'))(_0x7c23('0x7'));var interaction_log=require(_0x7c23('0x6'))(_0x7c23('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7c23('0x9')]=_[_0x7c23('0xa')](config[_0x7c23('0x9')],{'host':_0x7c23('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0x7c23('0xc'))[_0x7c23('0xd')](socket);var jayson=require(_0x7c23('0xe'));var client=jayson['client'][_0x7c23('0xf')]({'port':0x232c});var client9003=jayson['client'][_0x7c23('0xf')]({'port':0x232b});var client9002=jayson['client'][_0x7c23('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x4b9f17,_0x2e5f75,_0x3fe643,_0x52ac9){return new BPromise(function(_0x46900f,_0x48e9ec){var _0x3c1065=_0x52ac9||client;return _0x3c1065[_0x7c23('0x10')](_0x4b9f17,_0x3fe643)[_0x7c23('0x11')](function(_0x38ac27){logger[_0x7c23('0x12')](_0x7c23('0x13'),_0x2e5f75,'request\x20sent');logger[_0x7c23('0x14')](_0x7c23('0x15'),_0x2e5f75,_0x7c23('0x16'),JSON['stringify'](_0x38ac27));if(_0x38ac27['error']){if(_0x38ac27[_0x7c23('0x17')][_0x7c23('0x18')]===0x1f4){logger[_0x7c23('0x17')](_0x7c23('0x13'),_0x2e5f75,_0x38ac27[_0x7c23('0x17')][_0x7c23('0x19')]);return _0x48e9ec(_0x38ac27[_0x7c23('0x17')][_0x7c23('0x19')]);}logger[_0x7c23('0x17')](_0x7c23('0x13'),_0x2e5f75,_0x38ac27[_0x7c23('0x17')][_0x7c23('0x19')]);return _0x46900f(_0x38ac27[_0x7c23('0x17')]['message']);}else{logger[_0x7c23('0x12')]('MailMessage,\x20%s,\x20%s',_0x2e5f75,'request\x20sent');_0x46900f(_0x38ac27['result']['message']);}})[_0x7c23('0x1a')](function(_0x166db9){logger[_0x7c23('0x17')](_0x7c23('0x13'),_0x2e5f75,_0x166db9);_0x48e9ec(_0x166db9);});});}function respondWithResult(_0x3627f3,_0x140336){_0x140336=_0x140336||0xc8;return function(_0x98d9e2){if(_0x98d9e2){return _0x3627f3[_0x7c23('0x1b')](_0x140336)[_0x7c23('0x1c')](_0x98d9e2);}};}function respondWithFilteredResult(_0x353d2e,_0x10a6b9){return function(_0x51bac9){if(_0x51bac9){var _0x99cc5d=typeof _0x10a6b9[_0x7c23('0x1d')]===_0x7c23('0x1e')&&typeof _0x10a6b9[_0x7c23('0x1f')]===_0x7c23('0x1e');var _0x512317=_0x51bac9['count'];var _0x4c8371=_0x99cc5d?0x0:_0x10a6b9['offset'];var _0x2dc1e5=_0x99cc5d?_0x51bac9[_0x7c23('0x20')]:_0x10a6b9[_0x7c23('0x1d')]+_0x10a6b9['limit'];var _0x5713a3;if(_0x2dc1e5>=_0x512317){_0x2dc1e5=_0x512317;_0x5713a3=0xc8;}else{_0x5713a3=0xce;}_0x353d2e[_0x7c23('0x1b')](_0x5713a3);return _0x353d2e[_0x7c23('0x21')](_0x7c23('0x22'),_0x4c8371+'-'+_0x2dc1e5+'/'+_0x512317)[_0x7c23('0x1c')](_0x51bac9);}return null;};}function saveUpdates(_0x165153){return function(_0x499550){if(_0x499550){return _0x499550[_0x7c23('0x23')](_0x165153)[_0x7c23('0x11')](function(_0x99d3a){return _0x99d3a;});}return null;};}function removeEntity(_0x3dfa71){return function(_0x2b0a18){if(_0x2b0a18){return _0x2b0a18[_0x7c23('0x24')]()[_0x7c23('0x11')](function(){_0x3dfa71[_0x7c23('0x1b')](0xcc)[_0x7c23('0x25')]();});}};}function handleEntityNotFound(_0x536c35){return function(_0x4baffd){if(!_0x4baffd){_0x536c35[_0x7c23('0x26')](0x194);}return _0x4baffd;};}function handleError(_0x3e5adf,_0x32b590){_0x32b590=_0x32b590||0x1f4;return function(_0xdbc3c3){logger['error'](_0xdbc3c3['stack']);if(_0xdbc3c3[_0x7c23('0x27')]){delete _0xdbc3c3[_0x7c23('0x27')];}_0x3e5adf[_0x7c23('0x1b')](_0x32b590)[_0x7c23('0x28')](_0xdbc3c3);};}exports[_0x7c23('0x29')]=function(_0x4463be,_0xb29477){var _0x48f74d={},_0x18bcf4={},_0x2b91ca={'count':0x0,'rows':[]};var _0x44cfad=_['map'](db[_0x7c23('0x2a')][_0x7c23('0x2b')],function(_0x32f82b){return{'name':_0x32f82b[_0x7c23('0x2c')],'type':_0x32f82b['type'][_0x7c23('0x2d')]};});_0x18bcf4[_0x7c23('0x2e')]=_[_0x7c23('0x2f')](_0x44cfad,_0x7c23('0x27'));_0x18bcf4[_0x7c23('0x30')]=_[_0x7c23('0x31')](_0x4463be[_0x7c23('0x30')]);_0x18bcf4['filters']=_[_0x7c23('0x32')](_0x18bcf4[_0x7c23('0x2e')],_0x18bcf4[_0x7c23('0x30')]);_0x48f74d[_0x7c23('0x33')]=_['intersection'](_0x18bcf4[_0x7c23('0x2e')],qs[_0x7c23('0x34')](_0x4463be[_0x7c23('0x30')][_0x7c23('0x34')]));_0x48f74d[_0x7c23('0x33')]=_0x48f74d[_0x7c23('0x33')][_0x7c23('0x35')]?_0x48f74d[_0x7c23('0x33')]:_0x18bcf4['model'];if(!_0x4463be[_0x7c23('0x30')][_0x7c23('0x36')](_0x7c23('0x37'))){_0x48f74d['limit']=qs[_0x7c23('0x1f')](_0x4463be['query'][_0x7c23('0x1f')]);_0x48f74d[_0x7c23('0x1d')]=qs['offset'](_0x4463be[_0x7c23('0x30')][_0x7c23('0x1d')]);}_0x48f74d[_0x7c23('0x38')]=qs['sort'](_0x4463be[_0x7c23('0x30')][_0x7c23('0x39')]);_0x48f74d['where']=qs[_0x7c23('0x3a')](_['pick'](_0x4463be[_0x7c23('0x30')],_0x18bcf4['filters']),_0x44cfad);if(_0x4463be[_0x7c23('0x30')][_0x7c23('0x3b')]){_0x48f74d['where']=_['merge'](_0x48f74d[_0x7c23('0x3c')],{'$or':_[_0x7c23('0x2f')](_0x44cfad,function(_0x1f236a){if(_0x1f236a['type']!==_0x7c23('0x3d')){var _0x1941ba={};_0x1941ba[_0x1f236a[_0x7c23('0x27')]]={'$like':'%'+_0x4463be['query'][_0x7c23('0x3b')]+'%'};return _0x1941ba;}})});}_0x48f74d=_[_0x7c23('0x3e')]({},_0x48f74d,_0x4463be[_0x7c23('0x3f')]);var _0x54206b={'where':_0x48f74d[_0x7c23('0x3c')]};return db[_0x7c23('0x2a')][_0x7c23('0x20')](_0x54206b)[_0x7c23('0x11')](function(_0x52e691){_0x2b91ca[_0x7c23('0x20')]=_0x52e691;if(_0x4463be[_0x7c23('0x30')]['includeAll']){_0x48f74d[_0x7c23('0x40')]=[{'all':!![]}];}return db[_0x7c23('0x2a')][_0x7c23('0x41')](_0x48f74d);})['then'](function(_0x2edc96){_0x2b91ca[_0x7c23('0x42')]=_0x2edc96;return _0x2b91ca;})['then'](respondWithFilteredResult(_0xb29477,_0x48f74d))['catch'](handleError(_0xb29477,null));};exports[_0x7c23('0x43')]=function(_0x2b993f,_0x55c6ea){var _0xe38df1={'raw':!![],'where':{'id':_0x2b993f['params']['id']}},_0x5b9843={};_0x5b9843[_0x7c23('0x2e')]=_['keys'](db[_0x7c23('0x2a')][_0x7c23('0x2b')]);_0x5b9843[_0x7c23('0x30')]=_[_0x7c23('0x31')](_0x2b993f['query']);_0x5b9843[_0x7c23('0x3a')]=_['intersection'](_0x5b9843['model'],_0x5b9843[_0x7c23('0x30')]);_0xe38df1[_0x7c23('0x33')]=_[_0x7c23('0x32')](_0x5b9843[_0x7c23('0x2e')],qs[_0x7c23('0x34')](_0x2b993f[_0x7c23('0x30')]['fields']));_0xe38df1['attributes']=_0xe38df1[_0x7c23('0x33')][_0x7c23('0x35')]?_0xe38df1[_0x7c23('0x33')]:_0x5b9843[_0x7c23('0x2e')];if(_0x2b993f[_0x7c23('0x30')][_0x7c23('0x44')]){_0xe38df1[_0x7c23('0x40')]=[{'all':!![]}];}_0xe38df1=_[_0x7c23('0x3e')]({},_0xe38df1,_0x2b993f['options']);return db[_0x7c23('0x2a')][_0x7c23('0x45')](_0xe38df1)[_0x7c23('0x11')](handleEntityNotFound(_0x55c6ea,null))[_0x7c23('0x11')](respondWithResult(_0x55c6ea,null))[_0x7c23('0x1a')](handleError(_0x55c6ea,null));};exports[_0x7c23('0x23')]=function(_0x35c8ae,_0xe0b309){if(_0x35c8ae[_0x7c23('0x46')]['id']){delete _0x35c8ae[_0x7c23('0x46')]['id'];}return db[_0x7c23('0x2a')][_0x7c23('0x45')]({'where':{'id':_0x35c8ae['params']['id']}})[_0x7c23('0x11')](handleEntityNotFound(_0xe0b309,null))[_0x7c23('0x11')](saveUpdates(_0x35c8ae[_0x7c23('0x46')],null))[_0x7c23('0x11')](respondWithResult(_0xe0b309,null))[_0x7c23('0x1a')](handleError(_0xe0b309,null));};exports['destroy']=function(_0xdf122b,_0x2763e5){return db[_0x7c23('0x2a')][_0x7c23('0x45')]({'where':{'id':_0xdf122b['params']['id']}})[_0x7c23('0x11')](handleEntityNotFound(_0x2763e5,null))[_0x7c23('0x11')](removeEntity(_0x2763e5,null))[_0x7c23('0x1a')](handleError(_0x2763e5,null));};exports[_0x7c23('0x47')]=function(_0x447089,_0x42ec56){return db[_0x7c23('0x2a')]['describe']()[_0x7c23('0x11')](respondWithResult(_0x42ec56,null))[_0x7c23('0x1a')](handleError(_0x42ec56,null));};exports[_0x7c23('0x48')]=function(_0x4049fe,_0x230b60){return db[_0x7c23('0x2a')]['create'](_0x4049fe[_0x7c23('0x46')])[_0x7c23('0x11')](function(_0x1cee95){if(_0x1cee95){if(_0x1cee95[_0x7c23('0x49')]===_0x7c23('0x4a')&&!_0x1cee95[_0x7c23('0x4b')]){var _0x402d54,_0x309acf,_0x40b518;if(_0x4049fe[_0x7c23('0x46')]['to']){_0x309acf=_0x4049fe[_0x7c23('0x46')]['to']['split'](',')[0x0];}return db[_0x7c23('0x4c')]['findOne']({'where':{'id':_0x1cee95[_0x7c23('0x4d')]},'include':[{'model':db[_0x7c23('0x4e')],'as':_0x7c23('0x4f'),'include':[{'model':db[_0x7c23('0x50')],'as':_0x7c23('0x51'),'where':{'email':_0x309acf},'limit':0x1,'order':[[_0x7c23('0x52'),'DESC']]}]},{'model':db[_0x7c23('0x53')],'as':_0x7c23('0x54'),'raw':!![],'include':[{'model':db[_0x7c23('0x55')],'as':'CloudProvider','raw':!![]}]}]})[_0x7c23('0x11')](function(_0x44d19e){_0x402d54=_0x44d19e;if(!_0x402d54||!_0x402d54[_0x7c23('0x54')])return;var _0x489690=_0x402d54[_0x7c23('0x56')]();if(_0x4049fe[_0x7c23('0x46')][_0x7c23('0x57')]&&_0x4049fe['body'][_0x7c23('0x57')][_0x7c23('0x35')]){for(var _0x45587e=0x0;_0x45587e<_0x4049fe[_0x7c23('0x46')]['attachments'][_0x7c23('0x35')];_0x45587e+=0x1){_0x4049fe[_0x7c23('0x46')][_0x7c23('0x57')][_0x45587e]={'filename':_0x4049fe['body'][_0x7c23('0x57')][_0x45587e][_0x7c23('0x27')],'path':path[_0x7c23('0x58')](config[_0x7c23('0x59')],_0x7c23('0x5a'),_0x4049fe[_0x7c23('0x46')][_0x7c23('0x57')][_0x45587e][_0x7c23('0x5b')])};}}_0x40b518={'account':_0x489690,'message':_0x4049fe['body']};return;})['then'](function(){if(_0x402d54[_0x7c23('0x4f')]){if(_0x402d54[_0x7c23('0x4f')][_0x7c23('0x51')][_0x7c23('0x35')]){return _0x402d54['List']['Contacts'][0x0];}else{return db[_0x7c23('0x50')][_0x7c23('0x48')](_[_0x7c23('0xa')](_0x4049fe['body'],{'firstName':_0x4049fe[_0x7c23('0x46')]['to'],'email':_0x4049fe[_0x7c23('0x46')]['to'],'phone':_0x4049fe[_0x7c23('0x46')]['to'],'ListId':_0x402d54[_0x7c23('0x5c')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x40b518){return respondWithRpcPromise(_0x7c23('0x5d'),'sendMail',_0x40b518,client9003)[_0x7c23('0x11')](function(_0x79b7d0){return _0x1cee95[_0x7c23('0x23')]({'read':!![],'messageId':_0x79b7d0[_0x7c23('0x5e')],'sentAt':moment()[_0x7c23('0x5f')](_0x7c23('0x60'))});})[_0x7c23('0x1a')](function(_0x3a78c9){logger[_0x7c23('0x17')]('%s',JSON[_0x7c23('0x61')](_0x3a78c9));return _0x1cee95;});}return _0x1cee95;});}return _0x1cee95;}})[_0x7c23('0x11')](respondWithResult(_0x230b60,0xc9))[_0x7c23('0x1a')](handleError(_0x230b60,null));};exports[_0x7c23('0x62')]=function(_0x74d936,_0x5857cf){var _0x1c2472={'agent':{},'channel':_0x7c23('0x63')};if(_0x74d936['body']['id']){delete _0x74d936[_0x7c23('0x46')]['id'];}_0x74d936[_0x7c23('0x46')][_0x7c23('0x64')]=!![];_0x74d936['body'][_0x7c23('0x65')]=moment()[_0x7c23('0x5f')](_0x7c23('0x60'));_0x74d936['body']['UserId']=_0x74d936[_0x7c23('0x46')][_0x7c23('0x66')]||_0x74d936[_0x7c23('0x67')]['id'];_0x1c2472[_0x7c23('0x68')]['id']=_0x74d936[_0x7c23('0x46')][_0x7c23('0x66')];return db[_0x7c23('0x2a')][_0x7c23('0x45')]({'where':{'id':_0x74d936[_0x7c23('0x69')]['id'],'UserId':null}})[_0x7c23('0x11')](handleEntityNotFound(_0x5857cf,null))['then'](saveUpdates(_0x74d936['body'],null))[_0x7c23('0x11')](function(_0x56029a){if(_0x56029a){_0x1c2472[_0x7c23('0x19')]=_0x56029a[_0x7c23('0x6a')]({'plain':!![]});return db['MailInteraction'][_0x7c23('0x45')]({'where':{'id':_0x56029a['MailInteractionId']}});}return null;})[_0x7c23('0x11')](handleEntityNotFound(_0x5857cf,null))[_0x7c23('0x11')](function(_0x2b9317){if(_0x2b9317){return _0x2b9317['update']({'UserId':_0x74d936[_0x7c23('0x46')]['UserId'],'read1stAt':_[_0x7c23('0x6b')](_0x2b9317['read1stAt'])?moment()[_0x7c23('0x5f')](_0x7c23('0x60')):undefined});}return null;})[_0x7c23('0x11')](function(_0x56687a){if(_0x56687a){_0x1c2472[_0x7c23('0x6c')]=_0x56687a[_0x7c23('0x6a')]({'plain':!![]});interaction_log['info'](_0x7c23('0x6d'),_0x74d936[_0x7c23('0x67')]['id'],_0x74d936[_0x7c23('0x67')][_0x7c23('0x27')],_0x74d936[_0x7c23('0x67')][_0x7c23('0x6e')],_0x1c2472[_0x7c23('0x6c')]['id'],_0x74d936[_0x7c23('0x46')]?JSON[_0x7c23('0x61')](_0x74d936[_0x7c23('0x46')]):_0x7c23('0x6f'));return respondWithRpcPromise(_0x7c23('0x70'),'acceptMessage',_0x1c2472);}return null;})[_0x7c23('0x11')](function(_0x664c13){var _0x329436=_0x7c23('0x71')+_0x664c13[_0x7c23('0x19')]['ContactId'];return db['sequelize'][_0x7c23('0x30')](_0x329436,{'type':db[_0x7c23('0x72')][_0x7c23('0x73')]['SELECT'],'raw':!![]})[_0x7c23('0x11')](function(_0x31db10){return _0x31db10;});})[_0x7c23('0x11')](function(_0x2725aa){if(_0x2725aa){_0x1c2472['message']['contact']=_0x2725aa[0x0];if(!_0x74d936['body']['UserId'])return;return db[_0x7c23('0x74')][_0x7c23('0x45')]({'where':{'id':_0x74d936['body'][_0x7c23('0x66')],'role':_0x7c23('0x68')},'attributes':['id',_0x7c23('0x27'),_0x7c23('0x75'),_0x7c23('0x76'),_0x7c23('0x77')],'raw':!![]});}return null;})[_0x7c23('0x11')](function(_0x45e286){if(!_0x45e286)return null;_0x1c2472['message']['agent']=_0x45e286;return _0x1c2472;})[_0x7c23('0x11')](function(_0x3183c9){if(_0x3183c9){if(_0x74d936['body'][_0x7c23('0x78')]){_0x1c2472['message'][_0x7c23('0x79')]=util[_0x7c23('0x5f')](_0x7c23('0x7a'),_0x74d936[_0x7c23('0x67')][_0x7c23('0x27')]);_0x1c2472[_0x7c23('0x19')][_0x7c23('0x7b')]=_0x1c2472['channel'];_0x1c2472[_0x7c23('0x19')]['motionChannel']=_0x1c2472[_0x7c23('0x7b')];_0x1c2472[_0x7c23('0x19')][_0x7c23('0x7c')]=_0x7c23('0x62');_0x1c2472[_0x7c23('0x19')][_0x7c23('0x46')]=htmlToText[_0x7c23('0x7d')](_0x1c2472[_0x7c23('0x19')][_0x7c23('0x46')]);return respondWithRpcPromise(_0x7c23('0x7e'),_0x7c23('0x7e'),{'event':'acceptmessage','message':_0x1c2472['message']},client9002)['then'](function(){return _0x1c2472;});}return _0x1c2472;}return null;})[_0x7c23('0x11')](respondWithResult(_0x5857cf,null))['catch'](handleError(_0x5857cf,null));};exports['reject']=function(_0xaee30e,_0x2582bf){var _0x5eb489={'agent':{},'channel':_0x7c23('0x63')};if(_0xaee30e[_0x7c23('0x46')]['id']){delete _0xaee30e['body']['id'];}_0xaee30e[_0x7c23('0x46')][_0x7c23('0x66')]=_0xaee30e[_0x7c23('0x46')][_0x7c23('0x66')]||_0xaee30e[_0x7c23('0x67')]['id'];_0x5eb489[_0x7c23('0x68')]['id']=_0xaee30e[_0x7c23('0x46')][_0x7c23('0x66')];return db[_0x7c23('0x2a')]['find']({'where':{'id':_0xaee30e['params']['id'],'UserId':null}})[_0x7c23('0x11')](handleEntityNotFound(_0x2582bf,null))[_0x7c23('0x11')](function(_0x3f9617){if(_0x3f9617){_0x5eb489[_0x7c23('0x19')]=_0x3f9617[_0x7c23('0x6a')]({'plain':!![]});return db[_0x7c23('0x7f')][_0x7c23('0x45')]({'where':{'id':_0x3f9617[_0x7c23('0x80')]}});}return null;})[_0x7c23('0x11')](handleEntityNotFound(_0x2582bf,null))[_0x7c23('0x11')](function(_0x261f20){if(_0x261f20){_0x5eb489[_0x7c23('0x6c')]=_0x261f20[_0x7c23('0x6a')]({'plain':!![]});interaction_log[_0x7c23('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xaee30e['user']['id'],_0xaee30e['user'][_0x7c23('0x27')],_0xaee30e[_0x7c23('0x67')][_0x7c23('0x6e')],_0x5eb489[_0x7c23('0x6c')]['id'],_0xaee30e[_0x7c23('0x46')]?JSON[_0x7c23('0x61')](_0xaee30e[_0x7c23('0x46')]):_0x7c23('0x6f'));return respondWithRpcPromise(_0x7c23('0x81'),_0x7c23('0x82'),_0x5eb489);}return null;})[_0x7c23('0x11')](function(_0x2538e9){var _0x17abf1=_0x7c23('0x71')+_0x2538e9[_0x7c23('0x19')][_0x7c23('0x83')];return db[_0x7c23('0x84')][_0x7c23('0x30')](_0x17abf1,{'type':db[_0x7c23('0x72')][_0x7c23('0x73')][_0x7c23('0x85')],'raw':!![]})[_0x7c23('0x11')](function(_0x5575ad){return _0x5575ad;});})[_0x7c23('0x11')](function(_0x4c1800){if(_0x4c1800){_0x5eb489['message'][_0x7c23('0x86')]=_0x4c1800[0x0];if(!_0xaee30e['body'][_0x7c23('0x66')])return;return db['User'][_0x7c23('0x45')]({'where':{'id':_0xaee30e[_0x7c23('0x46')][_0x7c23('0x66')],'role':_0x7c23('0x68')},'attributes':['id',_0x7c23('0x27'),_0x7c23('0x75'),_0x7c23('0x76'),_0x7c23('0x77')],'raw':!![]});}return null;})[_0x7c23('0x11')](function(_0x23394b){if(!_0x23394b)return null;_0x5eb489[_0x7c23('0x19')][_0x7c23('0x68')]=_0x23394b;return _0x5eb489;})[_0x7c23('0x11')](function(_0x57fd55){if(_0x57fd55){_0x57fd55[_0x7c23('0x19')][_0x7c23('0x79')]=util[_0x7c23('0x5f')](_0x7c23('0x7a'),_0xaee30e[_0x7c23('0x67')][_0x7c23('0x27')]);_0x57fd55[_0x7c23('0x19')]['channel']=_0x5eb489[_0x7c23('0x7b')];_0x57fd55['message'][_0x7c23('0x87')]=_0x5eb489[_0x7c23('0x7b')];_0x57fd55[_0x7c23('0x19')][_0x7c23('0x7c')]='reject';_0x57fd55['message'][_0x7c23('0x46')]=htmlToText[_0x7c23('0x7d')](_0x5eb489[_0x7c23('0x19')][_0x7c23('0x46')]);respondWithRpcPromise(_0x7c23('0x7e'),_0x7c23('0x7e'),{'event':_0x7c23('0x88'),'message':_0x57fd55[_0x7c23('0x19')]},client9002);return _0x5eb489;}return null;})[_0x7c23('0x11')](respondWithResult(_0x2582bf,null))[_0x7c23('0x1a')](handleError(_0x2582bf,null));};exports[_0x7c23('0x89')]=function(_0x79ce47,_0x592d5e){var _0x3f72ab=moment()[_0x7c23('0x8a')]()[_0x7c23('0x8b')]();var _0x4ffc41=path[_0x7c23('0x58')](config[_0x7c23('0x59')],_0x7c23('0x8c'),_0x7c23('0x8d'),_0x7c23('0x8e'));var _0xdaad8a=path[_0x7c23('0x58')](config[_0x7c23('0x59')],'server',_0x7c23('0x8d'),_0x7c23('0x57'));var _0x5877af=util['format'](_0x7c23('0x8f'),_0x3f72ab);return db[_0x7c23('0x2a')][_0x7c23('0x45')]({'where':{'id':_0x79ce47['params']['id']},'attributes':['id','body',_0x7c23('0x90'),'to','cc',_0x7c23('0x91'),'subject',_0x7c23('0x92')],'include':_0x79ce47['query']['attachments']?[{'model':db[_0x7c23('0x93')],'as':_0x7c23('0x94')}]:undefined})[_0x7c23('0x11')](handleEntityNotFound(_0x592d5e,null))[_0x7c23('0x11')](function(_0x12b58e){if(_0x12b58e){var _0x3bcc76=_0x12b58e;var _0x52cec3={'from':_0x3bcc76['from'],'to':_0x3bcc76['to'],'subject':_0x3bcc76[_0x7c23('0x95')],'html':htmlEntities[_0x7c23('0x96')](_0x3bcc76[_0x7c23('0x46')]),'headers':{'Date':moment(_0x3bcc76[_0x7c23('0x92')])[_0x7c23('0x5f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x12b58e['cc']){_0x52cec3[_0x7c23('0x97')]['Cc']=_0x12b58e['cc'];}if(_0x12b58e['bcc']){_0x52cec3[_0x7c23('0x97')][_0x7c23('0x98')]=_0x12b58e[_0x7c23('0x91')];}return new BPromise(function(_0x3c39e8,_0x3bc02f){if(_0x12b58e['Attachments']){for(var _0x3fdaa4=0x0;_0x3fdaa4<_0x12b58e[_0x7c23('0x94')][_0x7c23('0x35')];_0x3fdaa4++){var _0xd7995e=_0x12b58e[_0x7c23('0x94')][_0x3fdaa4];var _0x1dd9a0=path['join'](_0xdaad8a,_0xd7995e[_0x7c23('0x5b')]);if(fs[_0x7c23('0x99')](_0x1dd9a0)){_0x52cec3['attachments'][_0x7c23('0x9a')]({'name':_0xd7995e[_0x7c23('0x27')],'contentType':_0xd7995e[_0x7c23('0x9b')],'data':fs[_0x7c23('0x9c')](_0x1dd9a0)});}}}emlformat[_0x7c23('0x9d')](_0x52cec3,function(_0x20f321,_0x1fd05d){if(_0x20f321)return _0x3bc02f(_0x20f321);fs[_0x7c23('0x9e')](path[_0x7c23('0x58')](_0x4ffc41,_0x5877af),_0x1fd05d);return _0x3c39e8(_0x1fd05d);});});}})['then'](function(_0x1df253){if(_0x1df253){return _0x592d5e[_0x7c23('0x89')](path['join'](_0x4ffc41,_0x5877af),_0x5877af,function(_0x743d73){if(!_0x743d73)fs[_0x7c23('0x9f')](path[_0x7c23('0x58')](_0x4ffc41,_0x5877af));});}})[_0x7c23('0x1a')](handleError(_0x592d5e,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f66bf95..d4d6a17 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 _0x8045=['emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','save','update'];(function(_0x1f3074,_0x526a33){var _0x4c537f=function(_0x443bd7){while(--_0x443bd7){_0x1f3074['push'](_0x1f3074['shift']());}};_0x4c537f(++_0x526a33);}(_0x8045,0x1cb));var _0x5804=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x8045[_0x155c64];return _0x1f154a;};'use strict';var EventEmitter=require(_0x5804('0x0'));var MailMessage=require(_0x5804('0x1'))['db'][_0x5804('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5804('0x3'),'afterUpdate':_0x5804('0x4'),'afterDestroy':'remove'};function emitEvent(_0x150053){return function(_0x1a86de,_0x37c990,_0x1f6edc){MailMessageEvents[_0x5804('0x5')](_0x150053+':'+_0x1a86de['id'],_0x1a86de);MailMessageEvents[_0x5804('0x5')](_0x150053,_0x1a86de);_0x1f6edc(null);};}for(var e in events){if(events[_0x5804('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x5804('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xf60e=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x481f37,_0x27d9cb){var _0x521020=function(_0x5c81b4){while(--_0x5c81b4){_0x481f37['push'](_0x481f37['shift']());}};_0x521020(++_0x27d9cb);}(_0xf60e,0x155));var _0xef60=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xf60e[_0x4d8ed9];return _0x1e2140;};'use strict';var EventEmitter=require(_0xef60('0x0'));var MailMessage=require(_0xef60('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xef60('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef60('0x3'),'afterDestroy':_0xef60('0x4')};function emitEvent(_0x1e5831){return function(_0x455602,_0x2c01f9,_0x452835){MailMessageEvents[_0xef60('0x5')](_0x1e5831+':'+_0x455602['id'],_0x455602);MailMessageEvents[_0xef60('0x5')](_0x1e5831,_0x455602);_0x452835(null);};}for(var e in events){if(events[_0xef60('0x6')](e)){var event=events[e];MailMessage[_0xef60('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 916339b..c94019e 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 _0x3910=['secret','isNil','findOne','MailInteractionId','then','update','createdAt','error','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','get','direction','toLowerCase'];(function(_0x3d4dd9,_0x48aafc){var _0x49acb0=function(_0x2644c1){while(--_0x2644c1){_0x3d4dd9['push'](_0x3d4dd9['shift']());}};_0x49acb0(++_0x48aafc);}(_0x3910,0xf0));var _0x0391=function(_0x10207f,_0x66a2d8){_0x10207f=_0x10207f-0x0;var _0x185a2b=_0x3910[_0x10207f];return _0x185a2b;};'use strict';var _=require(_0x0391('0x0'));var util=require(_0x0391('0x1'));var logger=require('../../config/logger')(_0x0391('0x2'));var moment=require(_0x0391('0x3'));var BPromise=require('bluebird');var rp=require(_0x0391('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x0391('0x5'));var rimraf=require(_0x0391('0x6'));var config=require(_0x0391('0x7'));var attributes=require(_0x0391('0x8'));module[_0x0391('0x9')]=function(_0x75b50f,_0x5d5acf){return _0x75b50f[_0x0391('0xa')]('MailMessage',attributes,{'tableName':_0x0391('0xb'),'paranoid':![],'indexes':[{'name':_0x0391('0xc'),'fields':[_0x0391('0xc')]},{'name':'fti_mail_messages','fields':[_0x0391('0xd'),_0x0391('0xe')],'type':_0x0391('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f8063,_0x15d207,_0x23ff46){if(_0x2f8063[_0x0391('0x10')]){_0x2f8063[_0x0391('0xd')]=htmlToText[_0x0391('0x11')](_0x2f8063[_0x0391('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x23ff46(null,_0x15d207);},'afterCreate':function(_0x25e8b6,_0x5d9b82,_0x29bb5c){var _0x42417d=_0x75b50f['models'];var _0x31bba9=_0x25e8b6[_0x0391('0x12')]({'plain':!![]});if(_0x31bba9[_0x0391('0x13')][_0x0391('0x14')]()==='in'||_0x31bba9[_0x0391('0x13')][_0x0391('0x14')]()==='out'&&!_0x31bba9[_0x0391('0x15')]&&!_[_0x0391('0x16')](_0x31bba9['UserId'])){_0x42417d['MailInteraction'][_0x0391('0x17')]({'where':{'id':_0x31bba9[_0x0391('0x18')]}})[_0x0391('0x19')](function(_0xfd619f){if(_0xfd619f){_0xfd619f[_0x0391('0x1a')]({'lastMsgAt':_0x31bba9[_0x0391('0x1b')],'lastMsgDirection':_0x31bba9['direction'][_0x0391('0x14')]()});}})['catch'](function(_0x56e733){console[_0x0391('0x1c')](_0x56e733);});}_0x29bb5c();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc8f9=['../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteractionId','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','html-to-text','path'];(function(_0x11257e,_0x17f3b0){var _0x4b013b=function(_0x1cb577){while(--_0x1cb577){_0x11257e['push'](_0x11257e['shift']());}};_0x4b013b(++_0x17f3b0);}(_0xc8f9,0x172));var _0x9c8f=function(_0x1251f7,_0x1736e2){_0x1251f7=_0x1251f7-0x0;var _0x362706=_0xc8f9[_0x1251f7];return _0x362706;};'use strict';var _=require(_0x9c8f('0x0'));var util=require(_0x9c8f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c8f('0x2'));var BPromise=require(_0x9c8f('0x3'));var rp=require(_0x9c8f('0x4'));var htmlToText=require(_0x9c8f('0x5'));var fs=require('fs');var path=require(_0x9c8f('0x6'));var rimraf=require('rimraf');var config=require(_0x9c8f('0x7'));var attributes=require('./mailMessage.attributes');module[_0x9c8f('0x8')]=function(_0x1abcc6,_0x1099aa){return _0x1abcc6[_0x9c8f('0x9')](_0x9c8f('0xa'),attributes,{'tableName':_0x9c8f('0xb'),'paranoid':![],'indexes':[{'name':_0x9c8f('0xc'),'fields':[_0x9c8f('0xc')]},{'name':_0x9c8f('0xd'),'fields':[_0x9c8f('0xe'),_0x9c8f('0xf')],'type':_0x9c8f('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x56d5a5,_0x3c8925,_0x4d36d2){if(_0x56d5a5[_0x9c8f('0x11')]){_0x56d5a5[_0x9c8f('0xe')]=htmlToText['fromString'](_0x56d5a5[_0x9c8f('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4d36d2(null,_0x3c8925);},'afterCreate':function(_0x2877a6,_0x244226,_0x50686e){var _0x3be64a=_0x1abcc6['models'];var _0x9cfd49=_0x2877a6[_0x9c8f('0x12')]({'plain':!![]});if(_0x9cfd49[_0x9c8f('0x13')][_0x9c8f('0x14')]()==='in'||_0x9cfd49[_0x9c8f('0x13')][_0x9c8f('0x14')]()===_0x9c8f('0x15')&&!_0x9cfd49[_0x9c8f('0x16')]&&!_[_0x9c8f('0x17')](_0x9cfd49[_0x9c8f('0x18')])){_0x3be64a['MailInteraction']['findOne']({'where':{'id':_0x9cfd49[_0x9c8f('0x19')]}})[_0x9c8f('0x1a')](function(_0x2bbe66){if(_0x2bbe66){_0x2bbe66['update']({'lastMsgAt':_0x9cfd49['createdAt'],'lastMsgDirection':_0x9cfd49[_0x9c8f('0x13')]['toLowerCase']()});}})['catch'](function(_0x561eb3){console['error'](_0x561eb3);});}_0x50686e();}},'charset':_0x9c8f('0x1b'),'collate':_0x9c8f('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 84d623e..1cdef72 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 _0x5f2f=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailMessage','create','options','raw','CreateMailMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa5dd80,_0x59e75a){var _0xec6fed=function(_0x44727e){while(--_0x44727e){_0xa5dd80['push'](_0xa5dd80['shift']());}};_0xec6fed(++_0x59e75a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x50e8e4,_0x159905){_0x50e8e4=_0x50e8e4-0x0;var _0x79da34=_0x5f2f[_0x50e8e4];return _0x79da34;};'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('./mailMessage.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['CreateMailMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0xbbbc=['CreateMailMessage','MailMessage','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x45518f,_0x475a6b){_0x45518f=_0x45518f-0x0;var _0x198175=_0xbbbc[_0x45518f];return _0x198175;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('MailMessage,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')](_0x25e92f[_0xcbbb('0x1d')],{'raw':_0x25e92f['options']?_0x25e92f[_0xcbbb('0x1e')][_0xcbbb('0x1f')]===undefined?!![]:![]:!![]})[_0xcbbb('0x20')](function(_0x42aaf1){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x21')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x42aaf1));_0x1cca90(_0x42aaf1);})['catch'](function(_0xf39ddd){logger[_0xcbbb('0x16')]('CreateMailMessage',_0xf39ddd[_0xcbbb('0x18')],_0x25e92f);_0x45de5f(_0x658337['error'](0x1f4,_0xf39ddd['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7428dbe..60162cb 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 _0x7af2=['removeListener','length','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0x16a5cf,_0x12627a){var _0x5c30d0=function(_0x1b240a){while(--_0x1b240a){_0x16a5cf['push'](_0x16a5cf['shift']());}};_0x5c30d0(++_0x12627a);}(_0x7af2,0x1b5));var _0x27af=function(_0x5cbdf2,_0x4de8ca){_0x5cbdf2=_0x5cbdf2-0x0;var _0x19d3a2=_0x7af2[_0x5cbdf2];return _0x19d3a2;};'use strict';var MailMessageEvents=require(_0x27af('0x0'));var events=[_0x27af('0x1'),'remove',_0x27af('0x2')];function createListener(_0x455f93,_0x371752){return function(_0x428661){_0x371752[_0x27af('0x3')](_0x455f93,_0x428661);};}function removeListener(_0xa75342,_0x3de7fe){return function(){MailMessageEvents[_0x27af('0x4')](_0xa75342,_0x3de7fe);};}exports['register']=function(_0x589eb4){for(var _0x320886=0x0,_0x1525c7=events[_0x27af('0x5')];_0x320886<_0x1525c7;_0x320886++){var _0x444d85=events[_0x320886];var _0x374157=createListener(_0x27af('0x6')+_0x444d85,_0x589eb4);MailMessageEvents['on'](_0x444d85,_0x374157);}}; \ No newline at end of file +var _0xa090=['emit','removeListener','register','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x1d4cf7,_0x11441e){var _0x2f912d=function(_0x1fb662){while(--_0x1fb662){_0x1d4cf7['push'](_0x1d4cf7['shift']());}};_0x2f912d(++_0x11441e);}(_0xa090,0x6c));var _0x0a09=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xa090[_0x1030ce];return _0x3367fd;};'use strict';var MailMessageEvents=require(_0x0a09('0x0'));var events=[_0x0a09('0x1'),_0x0a09('0x2'),_0x0a09('0x3')];function createListener(_0x5b1b8a,_0x11256a){return function(_0x1b9791){_0x11256a[_0x0a09('0x4')](_0x5b1b8a,_0x1b9791);};}function removeListener(_0xd33e3b,_0x6f836b){return function(){MailMessageEvents[_0x0a09('0x5')](_0xd33e3b,_0x6f836b);};}exports[_0x0a09('0x6')]=function(_0x375d00){for(var _0x2ee60f=0x0,_0x32cf1e=events['length'];_0x2ee60f<_0x32cf1e;_0x2ee60f++){var _0xcf8936=events[_0x2ee60f];var _0x1f4509=createListener(_0x0a09('0x7')+_0xcf8936,_0x375d00);MailMessageEvents['on'](_0xcf8936,_0x1f4509);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6b216dd..aa0fa02 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 _0x2ea0=['show','/:id/members','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','delete','destroy','removeTeams','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x2ea0,0x1a3));var _0x02ea=function(_0x77fd25,_0x226ea2){_0x77fd25=_0x77fd25-0x0;var _0xe14528=_0x2ea0[_0x77fd25];return _0xe14528;};'use strict';var multer=require(_0x02ea('0x0'));var util=require('util');var path=require(_0x02ea('0x1'));var timeout=require('connect-timeout');var express=require(_0x02ea('0x2'));var router=express[_0x02ea('0x3')]();var fs_extra=require(_0x02ea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x02ea('0x5'));var config=require(_0x02ea('0x6'));var controller=require('./mailQueue.controller');router[_0x02ea('0x7')]('/',auth['isAuthenticated'](),controller[_0x02ea('0x8')]);router[_0x02ea('0x7')](_0x02ea('0x9'),auth[_0x02ea('0xa')](),controller[_0x02ea('0xb')]);router[_0x02ea('0x7')](_0x02ea('0xc'),auth['isAuthenticated'](),controller[_0x02ea('0xd')]);router['get'](_0x02ea('0xe'),auth[_0x02ea('0xa')](),controller['getMembers']);router[_0x02ea('0x7')](_0x02ea('0xf'),auth[_0x02ea('0xa')](),controller[_0x02ea('0x10')]);router[_0x02ea('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x02ea('0x11')]);router[_0x02ea('0x12')]('/',auth[_0x02ea('0xa')](),controller[_0x02ea('0x13')]);router[_0x02ea('0x12')](_0x02ea('0xf'),auth[_0x02ea('0xa')](),controller['addTeams']);router[_0x02ea('0x12')](_0x02ea('0x14'),auth[_0x02ea('0xa')](),controller[_0x02ea('0x15')]);router[_0x02ea('0x16')]('/:id',auth[_0x02ea('0xa')](),controller[_0x02ea('0x17')]);router[_0x02ea('0x18')](_0x02ea('0xc'),auth[_0x02ea('0xa')](),controller[_0x02ea('0x19')]);router[_0x02ea('0x18')](_0x02ea('0xf'),auth[_0x02ea('0xa')](),controller[_0x02ea('0x1a')]);router[_0x02ea('0x18')]('/:id/users',auth[_0x02ea('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x277d=['removeTeams','removeAgents','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','delete','destroy'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x277d,0x77));var _0xd277=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x277d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require(_0xd277('0x0'));var path=require(_0xd277('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd277('0x2')]();var fs_extra=require(_0xd277('0x3'));var auth=require(_0xd277('0x4'));var interaction=require(_0xd277('0x5'));var config=require(_0xd277('0x6'));var controller=require(_0xd277('0x7'));router[_0xd277('0x8')]('/',auth['isAuthenticated'](),controller[_0xd277('0x9')]);router[_0xd277('0x8')](_0xd277('0xa'),auth[_0xd277('0xb')](),controller[_0xd277('0xc')]);router[_0xd277('0x8')](_0xd277('0xd'),auth[_0xd277('0xb')](),controller[_0xd277('0xe')]);router['get'](_0xd277('0xf'),auth[_0xd277('0xb')](),controller[_0xd277('0x10')]);router[_0xd277('0x8')](_0xd277('0x11'),auth[_0xd277('0xb')](),controller[_0xd277('0x12')]);router[_0xd277('0x8')](_0xd277('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd277('0x14')]('/',auth[_0xd277('0xb')](),controller['create']);router[_0xd277('0x14')](_0xd277('0x11'),auth[_0xd277('0xb')](),controller[_0xd277('0x15')]);router['post'](_0xd277('0x13'),auth[_0xd277('0xb')](),controller[_0xd277('0x16')]);router[_0xd277('0x17')](_0xd277('0xd'),auth[_0xd277('0xb')](),controller['update']);router[_0xd277('0x18')](_0xd277('0xd'),auth['isAuthenticated'](),controller[_0xd277('0x19')]);router[_0xd277('0x18')](_0xd277('0x11'),auth[_0xd277('0xb')](),controller[_0xd277('0x1a')]);router[_0xd277('0x18')](_0xd277('0x13'),auth[_0xd277('0xb')](),controller[_0xd277('0x1b')]);module[_0xd277('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 6d8a045..67faf2f 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 _0x68bf=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x5e8469,_0x2dbd59){var _0x1cc76d=function(_0x31e3ca){while(--_0x31e3ca){_0x5e8469['push'](_0x5e8469['shift']());}};_0x1cc76d(++_0x2dbd59);}(_0x68bf,0x1e2));var _0xf68b=function(_0x238a52,_0x576299){_0x238a52=_0x238a52-0x0;var _0x1b3191=_0x68bf[_0x238a52];return _0x1b3191;};'use strict';var Sequelize=require('sequelize');module[_0xf68b('0x0')]={'name':{'type':Sequelize[_0xf68b('0x1')],'unique':_0xf68b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf68b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf68b('0x4')](_0xf68b('0x5'),_0xf68b('0x6'),_0xf68b('0x7'))}}; \ No newline at end of file +var _0xcdc2=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x43f1aa,_0x54ebbd){var _0x2be01d=function(_0x4e3a54){while(--_0x4e3a54){_0x43f1aa['push'](_0x43f1aa['shift']());}};_0x2be01d(++_0x54ebbd);}(_0xcdc2,0xe5));var _0x2cdc=function(_0x13ff04,_0x1852a4){_0x13ff04=_0x13ff04-0x0;var _0x36cb31=_0xcdc2[_0x13ff04];return _0x36cb31;};'use strict';var Sequelize=require(_0x2cdc('0x0'));module[_0x2cdc('0x1')]={'name':{'type':Sequelize[_0x2cdc('0x2')],'unique':_0x2cdc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2cdc('0x2')]},'timeout':{'type':Sequelize[_0x2cdc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2cdc('0x5')](_0x2cdc('0x6'),_0x2cdc('0x7'),_0x2cdc('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 606ea00..87d4195 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 _0x9e1e=['body','user','role','UserProfileSection','userProfileId','params','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','sort','pick','MailQueueId','merge','filter','options','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','order','nolimit','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource','error','name','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','rows','show','keys','query','filters','intersection','fields','attributes','length','model','includeAll','find','catch','create'];(function(_0x1d8c86,_0x35919a){var _0x47c8a5=function(_0x39346d){while(--_0x39346d){_0x1d8c86['push'](_0x1d8c86['shift']());}};_0x47c8a5(++_0x35919a);}(_0x9e1e,0x137));var _0xe9e1=function(_0x5b7bf6,_0x4509d5){_0x5b7bf6=_0x5b7bf6-0x0;var _0xb955d8=_0x9e1e[_0x5b7bf6];return _0xb955d8;};'use strict';var BPromise=require('bluebird');var util=require(_0xe9e1('0x0'));var _=require(_0xe9e1('0x1'));var squel=require(_0xe9e1('0x2'));var Redis=require(_0xe9e1('0x3'));var qs=require(_0xe9e1('0x4'));var logger=require(_0xe9e1('0x5'))(_0xe9e1('0x6'));var config=require(_0xe9e1('0x7'));var db=require(_0xe9e1('0x8'))['db'];config[_0xe9e1('0x9')]=_[_0xe9e1('0xa')](config[_0xe9e1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9e1('0xb'))(new Redis(config[_0xe9e1('0x9')]));require(_0xe9e1('0xc'))['register'](socket);function respondWithStatusCode(_0x37d66f,_0x2633d5){_0x2633d5=_0x2633d5||0xcc;return function(_0x3f235d){if(_0x3f235d){return _0x37d66f[_0xe9e1('0xd')](_0x2633d5);}return _0x37d66f[_0xe9e1('0xe')](_0x2633d5)[_0xe9e1('0xf')]();};}function respondWithResult(_0x501edb,_0x2fdc06){_0x2fdc06=_0x2fdc06||0xc8;return function(_0x3045e8){if(_0x3045e8){return _0x501edb['status'](_0x2fdc06)[_0xe9e1('0x10')](_0x3045e8);}};}function respondWithFilteredResult(_0x14b179,_0x1710ff){return function(_0x3a6491){if(_0x3a6491){var _0x1b6a14=typeof _0x1710ff[_0xe9e1('0x11')]===_0xe9e1('0x12')&&typeof _0x1710ff[_0xe9e1('0x13')]===_0xe9e1('0x12');var _0x16b2e1=_0x3a6491['count'];var _0x37ab95=_0x1b6a14?0x0:_0x1710ff[_0xe9e1('0x11')];var _0x48f43d=_0x1b6a14?_0x3a6491[_0xe9e1('0x14')]:_0x1710ff[_0xe9e1('0x11')]+_0x1710ff[_0xe9e1('0x13')];var _0xafafe5;if(_0x48f43d>=_0x16b2e1){_0x48f43d=_0x16b2e1;_0xafafe5=0xc8;}else{_0xafafe5=0xce;}_0x14b179[_0xe9e1('0xe')](_0xafafe5);return _0x14b179['set'](_0xe9e1('0x15'),_0x37ab95+'-'+_0x48f43d+'/'+_0x16b2e1)[_0xe9e1('0x10')](_0x3a6491);}return null;};}function saveUpdates(_0x277e7b){return function(_0x27b171){if(_0x27b171){return _0x27b171[_0xe9e1('0x16')](_0x277e7b)[_0xe9e1('0x17')](function(_0x4ecb69){return _0x4ecb69;});}return null;};}function removeEntity(_0x4783f8){return function(_0x1c6b3e){if(_0x1c6b3e){return _0x1c6b3e[_0xe9e1('0x18')]()['then'](function(){var _0x519b61=_0x1c6b3e[_0xe9e1('0x19')]({'plain':!![]});var _0x2c7fd6=_0xe9e1('0x1a');return db[_0xe9e1('0x1b')][_0xe9e1('0x18')]({'where':{'type':_0x2c7fd6,'resourceId':_0x519b61['id']}})['then'](function(){return _0x1c6b3e;});})[_0xe9e1('0x17')](function(){_0x4783f8[_0xe9e1('0xe')](0xcc)[_0xe9e1('0xf')]();});}};}function handleEntityNotFound(_0x5f523b){return function(_0x11bfaa){if(!_0x11bfaa){_0x5f523b[_0xe9e1('0xd')](0x194);}return _0x11bfaa;};}function handleError(_0x7a2ba9,_0x6db56d){_0x6db56d=_0x6db56d||0x1f4;return function(_0x36b7f4){logger[_0xe9e1('0x1c')](_0x36b7f4['stack']);if(_0x36b7f4['name']){delete _0x36b7f4[_0xe9e1('0x1d')];}_0x7a2ba9[_0xe9e1('0xe')](_0x6db56d)['send'](_0x36b7f4);};}exports[_0xe9e1('0x1e')]=function(_0x386b68,_0x3a6944){var _0x5f51ee={};var _0x41ac70={'count':0x0,'rows':[]};var _0x12ee2a=_[_0xe9e1('0x1f')](db[_0xe9e1('0x20')][_0xe9e1('0x21')],function(_0x2992d){return{'name':_0x2992d[_0xe9e1('0x22')],'type':_0x2992d[_0xe9e1('0x23')][_0xe9e1('0x24')]};});_0x5f51ee=qs[_0xe9e1('0x25')](_0x12ee2a,_0x386b68);var _0x5b6de1={'where':_0x5f51ee[_0xe9e1('0x26')]};return db[_0xe9e1('0x20')][_0xe9e1('0x14')](_0x5b6de1)['then'](function(_0x34dee7){_0x41ac70[_0xe9e1('0x14')]=_0x34dee7;_0x5f51ee[_0xe9e1('0x27')]=qs[_0xe9e1('0x27')](_0x386b68['query']);return db[_0xe9e1('0x20')][_0xe9e1('0x28')](_0x5f51ee);})[_0xe9e1('0x17')](function(_0x59e7c3){_0x41ac70[_0xe9e1('0x29')]=_0x59e7c3;return _0x41ac70;})['then'](respondWithFilteredResult(_0x3a6944,_0x5f51ee))['catch'](handleError(_0x3a6944,null));};exports[_0xe9e1('0x2a')]=function(_0x597f1e,_0x522144){var _0x66e18b={'raw':!![],'where':{'id':_0x597f1e['params']['id']}},_0x46559e={};_0x46559e['model']=_[_0xe9e1('0x2b')](db[_0xe9e1('0x20')][_0xe9e1('0x21')]);_0x46559e[_0xe9e1('0x2c')]=_[_0xe9e1('0x2b')](_0x597f1e['query']);_0x46559e[_0xe9e1('0x2d')]=_[_0xe9e1('0x2e')](_0x46559e['model'],_0x46559e[_0xe9e1('0x2c')]);_0x66e18b['attributes']=_['intersection'](_0x46559e['model'],qs[_0xe9e1('0x2f')](_0x597f1e[_0xe9e1('0x2c')]['fields']));_0x66e18b[_0xe9e1('0x30')]=_0x66e18b['attributes'][_0xe9e1('0x31')]?_0x66e18b[_0xe9e1('0x30')]:_0x46559e[_0xe9e1('0x32')];if(_0x597f1e['query'][_0xe9e1('0x33')]){_0x66e18b['include']=[{'all':!![]}];}_0x66e18b=_['merge']({},_0x66e18b,_0x597f1e['options']);return db[_0xe9e1('0x20')][_0xe9e1('0x34')](_0x66e18b)[_0xe9e1('0x17')](handleEntityNotFound(_0x522144,null))[_0xe9e1('0x17')](respondWithResult(_0x522144,null))[_0xe9e1('0x35')](handleError(_0x522144,null));};exports['create']=function(_0x4bcd5a,_0x50e6b3){return db['MailQueue'][_0xe9e1('0x36')](_0x4bcd5a[_0xe9e1('0x37')],{})[_0xe9e1('0x17')](function(_0x277522){var _0x49ee76=_0x4bcd5a[_0xe9e1('0x38')][_0xe9e1('0x19')]({'plain':!![]});if(!_0x49ee76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49ee76[_0xe9e1('0x39')]===_0xe9e1('0x38')){var _0xe212b8=_0x277522['get']({'plain':!![]});var _0x10a98e=_0xe9e1('0x1a');return db[_0xe9e1('0x3a')][_0xe9e1('0x34')]({'where':{'name':_0x10a98e,'userProfileId':_0x49ee76[_0xe9e1('0x3b')]},'raw':!![]})[_0xe9e1('0x17')](function(_0x4025c4){if(_0x4025c4&&_0x4025c4['autoAssociation']===0x0){return db[_0xe9e1('0x1b')][_0xe9e1('0x36')]({'name':_0xe212b8[_0xe9e1('0x1d')],'resourceId':_0xe212b8['id'],'type':_0x4025c4[_0xe9e1('0x1d')],'sectionId':_0x4025c4['id']},{})[_0xe9e1('0x17')](function(){return _0x277522;});}else{return _0x277522;}})[_0xe9e1('0x35')](function(_0x4bd11){logger[_0xe9e1('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bd11);throw _0x4bd11;});}return _0x277522;})[_0xe9e1('0x17')](respondWithResult(_0x50e6b3,0xc9))[_0xe9e1('0x35')](handleError(_0x50e6b3,null));};exports[_0xe9e1('0x16')]=function(_0x2e971b,_0x5125e2){if(_0x2e971b[_0xe9e1('0x37')]['id']){delete _0x2e971b[_0xe9e1('0x37')]['id'];}return db['MailQueue'][_0xe9e1('0x34')]({'where':{'id':_0x2e971b[_0xe9e1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5125e2,null))[_0xe9e1('0x17')](saveUpdates(_0x2e971b[_0xe9e1('0x37')],null))[_0xe9e1('0x17')](respondWithResult(_0x5125e2,null))[_0xe9e1('0x35')](handleError(_0x5125e2,null));};exports[_0xe9e1('0x18')]=function(_0x2d15a3,_0x400a61){return db['MailQueue'][_0xe9e1('0x34')]({'where':{'id':_0x2d15a3['params']['id']}})[_0xe9e1('0x17')](handleEntityNotFound(_0x400a61,null))['then'](removeEntity(_0x400a61,null))['catch'](handleError(_0x400a61,null));};exports[_0xe9e1('0x3d')]=function(_0x7ffcde,_0x450806){return db[_0xe9e1('0x20')][_0xe9e1('0x3d')]()[_0xe9e1('0x17')](respondWithResult(_0x450806,null))[_0xe9e1('0x35')](handleError(_0x450806,null));};exports[_0xe9e1('0x3e')]=function(_0x2447bb,_0x3bd136){var _0x545a88={'raw':!![],'where':{}},_0x2d294a={},_0x4d95f9;return db[_0xe9e1('0x20')][_0xe9e1('0x3f')]({'where':{'id':_0x2447bb[_0xe9e1('0x3c')]['id']}})[_0xe9e1('0x17')](handleEntityNotFound(_0x3bd136,null))[_0xe9e1('0x17')](function(_0x24d0bd){if(_0x24d0bd){_0x4d95f9=_0x24d0bd[_0xe9e1('0x19')]({'plain':!![]});_0x2d294a[_0xe9e1('0x32')]=_[_0xe9e1('0x2b')](db[_0xe9e1('0x40')][_0xe9e1('0x21')]);_0x2d294a[_0xe9e1('0x2c')]=_[_0xe9e1('0x2b')](_0x2447bb['query']);_0x2d294a['filters']=_['intersection'](_0x2d294a[_0xe9e1('0x32')],_0x2d294a['query']);_0x545a88[_0xe9e1('0x30')]=_['intersection'](_0x2d294a['model'],qs[_0xe9e1('0x2f')](_0x2447bb[_0xe9e1('0x2c')][_0xe9e1('0x2f')]));_0x545a88[_0xe9e1('0x30')]=_0x545a88['attributes'][_0xe9e1('0x31')]?_0x545a88[_0xe9e1('0x30')]:_0x2d294a[_0xe9e1('0x32')];if(!_0x2447bb[_0xe9e1('0x2c')][_0xe9e1('0x41')]('nolimit')){_0x545a88['limit']=qs[_0xe9e1('0x13')](_0x2447bb[_0xe9e1('0x2c')][_0xe9e1('0x13')]);_0x545a88[_0xe9e1('0x11')]=qs[_0xe9e1('0x11')](_0x2447bb['query'][_0xe9e1('0x11')]);}_0x545a88['order']=qs['sort'](_0x2447bb[_0xe9e1('0x2c')][_0xe9e1('0x42')]);_0x545a88['where']=qs[_0xe9e1('0x2d')](_[_0xe9e1('0x43')](_0x2447bb[_0xe9e1('0x2c')],_0x2d294a[_0xe9e1('0x2d')]));_0x545a88[_0xe9e1('0x26')][_0xe9e1('0x44')]=_0x24d0bd['id'];if(_0x2447bb[_0xe9e1('0x2c')]['filter']){_0x545a88[_0xe9e1('0x26')]=_[_0xe9e1('0x45')](_0x545a88[_0xe9e1('0x26')],{'$or':_[_0xe9e1('0x1f')](_0x545a88['attributes'],function(_0x27c2ae){var _0x11354f={};_0x11354f[_0x27c2ae]={'$like':'%'+_0x2447bb[_0xe9e1('0x2c')][_0xe9e1('0x46')]+'%'};return _0x11354f;})});}_0x545a88=_['merge']({},_0x545a88,_0x2447bb[_0xe9e1('0x47')]);return db[_0xe9e1('0x40')][_0xe9e1('0x28')](_0x545a88);}})[_0xe9e1('0x17')](function(_0x12c48d){if(_0x12c48d){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x12c48d,_0xe9e1('0x48')),'role':_0xe9e1('0x49')},'attributes':['id',_0xe9e1('0x1d'),_0xe9e1('0x4a'),_0xe9e1('0x4b'),_0xe9e1('0x4c')]});}})[_0xe9e1('0x17')](function(_0x1005fb){if(_0x1005fb){return{'count':_0x1005fb[_0xe9e1('0x14')],'rows':_[_0xe9e1('0x1f')](_0x1005fb[_0xe9e1('0x29')],function(_0xb87053){return{'membername':_0xb87053[_0xe9e1('0x1d')],'UserId':_0xb87053['id'],'queue_name':_0x4d95f9[_0xe9e1('0x1d')],'MailQueueId':_0x4d95f9['id'],'interface':util['format'](_0xe9e1('0x4d'),_0xe9e1('0x4e'),_0xb87053[_0xe9e1('0x1d')]),'penalty':0x0,'paused':_0xb87053['mailPause'],'createdAt':_0xb87053[_0xe9e1('0x4c')],'updatedAt':_0xb87053[_0xe9e1('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3bd136,_0x545a88))[_0xe9e1('0x35')](handleError(_0x3bd136,null));};exports[_0xe9e1('0x4f')]=function(_0x496fa4,_0xe57034){var _0x1b6d10={};var _0x2f5c6f={};var _0x378326;var _0x2cc6f3;return db[_0xe9e1('0x20')][_0xe9e1('0x3f')]({'where':{'id':_0x496fa4[_0xe9e1('0x3c')]['id']}})['then'](handleEntityNotFound(_0xe57034,null))[_0xe9e1('0x17')](function(_0x489cdb){if(_0x489cdb){_0x378326=_0x489cdb;_0x2f5c6f[_0xe9e1('0x32')]=_[_0xe9e1('0x2b')](db[_0xe9e1('0x50')]['rawAttributes']);_0x2f5c6f['query']=_['keys'](_0x496fa4[_0xe9e1('0x2c')]);_0x2f5c6f[_0xe9e1('0x2d')]=_['intersection'](_0x2f5c6f['model'],_0x2f5c6f[_0xe9e1('0x2c')]);_0x1b6d10[_0xe9e1('0x30')]=_[_0xe9e1('0x2e')](_0x2f5c6f['model'],qs['fields'](_0x496fa4[_0xe9e1('0x2c')][_0xe9e1('0x2f')]));_0x1b6d10['attributes']=_0x1b6d10[_0xe9e1('0x30')][_0xe9e1('0x31')]?_0x1b6d10['attributes']:_0x2f5c6f[_0xe9e1('0x32')];_0x1b6d10[_0xe9e1('0x51')]=qs[_0xe9e1('0x42')](_0x496fa4['query'][_0xe9e1('0x42')]);_0x1b6d10[_0xe9e1('0x26')]=qs['filters'](_[_0xe9e1('0x43')](_0x496fa4[_0xe9e1('0x2c')],_0x2f5c6f[_0xe9e1('0x2d')]));if(_0x496fa4['query'][_0xe9e1('0x46')]){_0x1b6d10[_0xe9e1('0x26')]=_[_0xe9e1('0x45')](_0x1b6d10[_0xe9e1('0x26')],{'$or':_[_0xe9e1('0x1f')](_0x1b6d10['attributes'],function(_0x371abe){var _0x278ba2={};_0x278ba2[_0x371abe]={'$like':'%'+_0x496fa4['query'][_0xe9e1('0x46')]+'%'};return _0x278ba2;})});}_0x1b6d10=_[_0xe9e1('0x45')]({},_0x1b6d10,_0x496fa4[_0xe9e1('0x47')]);return _0x378326['getTeams'](_0x1b6d10);}})[_0xe9e1('0x17')](function(_0x3a5243){if(_0x3a5243){_0x2cc6f3=_0x3a5243[_0xe9e1('0x31')];if(!_0x496fa4['query'][_0xe9e1('0x41')](_0xe9e1('0x52'))){_0x1b6d10[_0xe9e1('0x13')]=qs['limit'](_0x496fa4[_0xe9e1('0x2c')][_0xe9e1('0x13')]);_0x1b6d10['offset']=qs[_0xe9e1('0x11')](_0x496fa4[_0xe9e1('0x2c')]['offset']);}return _0x378326[_0xe9e1('0x4f')](_0x1b6d10);}})['then'](function(_0x251ced){if(_0x251ced){return _0x251ced?{'count':_0x2cc6f3,'rows':_0x251ced}:null;}})[_0xe9e1('0x17')](respondWithResult(_0xe57034,null))[_0xe9e1('0x35')](handleError(_0xe57034,null));};exports[_0xe9e1('0x53')]=function(_0x18b264,_0x5d4376){var _0x50b874=_0x18b264['body'][_0xe9e1('0x54')];return db[_0xe9e1('0x50')]['findAll']({'where':{'id':_0x50b874},'attributes':['id'],'include':[{'model':db[_0xe9e1('0x55')],'as':_0xe9e1('0x56'),'attributes':['id',_0xe9e1('0x1d'),_0xe9e1('0x57'),_0xe9e1('0x58'),_0xe9e1('0x59')],'raw':!![]}]})[_0xe9e1('0x17')](function(_0x3e469e){if(_0x3e469e){var _0xd8af54=_[_0xe9e1('0x5a')](_0x3e469e,function(_0x2b848f){var _0x57bd6e=_0x2b848f[_0xe9e1('0x19')]({'plain':!![]});return _0x57bd6e[_0xe9e1('0x56')];});return db[_0xe9e1('0x20')][_0xe9e1('0x34')]({'where':{'id':_0x18b264['params']['id']}})[_0xe9e1('0x17')](function(_0x1d0d72){return db[_0xe9e1('0x5b')][_0xe9e1('0x5c')](function(_0x5b02ef){return _0x1d0d72['addTeams'](_0x50b874,{'transaction':_0x5b02ef})['then'](function(){return BPromise[_0xe9e1('0x5d')](_0xd8af54,function(_0x3da65c){return db[_0xe9e1('0x40')]['findOrCreate']({'where':{'UserId':_0x3da65c['id'],'MailQueueId':_0x18b264[_0xe9e1('0x3c')]['id']},'transaction':_0x5b02ef});});})[_0xe9e1('0x17')](function(){_0xd8af54[_0xe9e1('0x5e')](function(_0x35f42d){socket[_0xe9e1('0x5f')](_0xe9e1('0x60'),{'UserId':_0x35f42d['id'],'MailQueueId':_0x1d0d72['id']});});});});});}})['then'](respondWithStatusCode(_0x5d4376,null))[_0xe9e1('0x35')](handleError(_0x5d4376,null));};exports[_0xe9e1('0x61')]=function(_0x438c20,_0xee60dc){return db[_0xe9e1('0x50')]['findAll']({'where':{'id':_0x438c20[_0xe9e1('0x2c')][_0xe9e1('0x54')]},'attributes':['id'],'include':[{'model':db[_0xe9e1('0x55')],'as':_0xe9e1('0x56'),'attributes':['id'],'raw':!![]}]})[_0xe9e1('0x17')](handleEntityNotFound(_0xee60dc,null))[_0xe9e1('0x17')](function(_0x3e1926){var _0x3d60c3=_[_0xe9e1('0x1f')](_0x3e1926,'id');var _0x105f33=[];var _0x1a8978=[];var _0x5b0028=squel[_0xe9e1('0x62')]();_0x5b0028['field']('tq.TeamId')[_0xe9e1('0x63')](_0xe9e1('0x64'),'tq')[_0xe9e1('0x65')](_0xe9e1('0x66'),'ut',_0xe9e1('0x67'))['where'](_0xe9e1('0x68'),_0x438c20[_0xe9e1('0x3c')]['id']);for(var _0x47363c=0x0;_0x47363c<_0x3e1926['length'];_0x47363c+=0x1){let _0x1097c2=_0x3e1926[_0x47363c];for(var _0x29f7e4=0x0;_0x29f7e4<_0x1097c2[_0xe9e1('0x56')]['length'];_0x29f7e4+=0x1){let _0x3d630b=_0x1097c2[_0xe9e1('0x56')][_0x29f7e4];var _0x1e0bda=_0x5b0028['clone']();_0x1e0bda[_0xe9e1('0x26')]('ut.UserId\x20=\x20?',_0x3d630b['id']);_0x1a8978['push'](db['sequelize']['query'](_0x1e0bda[_0xe9e1('0x69')](),{'type':db[_0xe9e1('0x5b')][_0xe9e1('0x6a')][_0xe9e1('0x6b')]})['then'](function(_0x5f2b78){if(_0x5f2b78[_0xe9e1('0x31')]===0x1){return _0x3d630b['id'];}else{var _0x37fa2a=_[_0xe9e1('0x6c')](_[_0xe9e1('0x1f')](_0x5f2b78,_0xe9e1('0x6d')),function(_0x2cd404){return _[_0xe9e1('0x6e')](_0x3d60c3,_0x2cd404);});if(_0x37fa2a){return _0x3d630b['id'];}}}));}}return BPromise[_0xe9e1('0x6f')](_0x1a8978)[_0xe9e1('0x17')](function(_0x1ebc0e){_0x105f33=_(_0x105f33)[_0xe9e1('0x70')](_0x1ebc0e)[_0xe9e1('0x71')]()[_0xe9e1('0x72')]();return db[_0xe9e1('0x20')][_0xe9e1('0x34')]({'where':{'id':_0x438c20['params']['id']}})[_0xe9e1('0x17')](function(_0x3cd0d4){return db[_0xe9e1('0x5b')][_0xe9e1('0x5c')](function(_0x3266c2){return _0x3cd0d4[_0xe9e1('0x61')](_0x438c20[_0xe9e1('0x2c')][_0xe9e1('0x54')],{'transaction':_0x3266c2})[_0xe9e1('0x17')](function(){if(!_['isEmpty'](_0x105f33)){return _0x3cd0d4['removeAgents'](_0x105f33,{'transaction':_0x3266c2});}})[_0xe9e1('0x17')](function(){_0x105f33['forEach'](function(_0x278afd){socket[_0xe9e1('0x5f')](_0xe9e1('0x73'),{'UserId':_0x278afd,'MailQueueId':_0x3cd0d4['id']});});});});});});})[_0xe9e1('0x17')](respondWithStatusCode(_0xee60dc,null))[_0xe9e1('0x35')](handleError(_0xee60dc,null));};exports[_0xe9e1('0x74')]=function(_0x299716,_0x31d96a){return db[_0xe9e1('0x20')][_0xe9e1('0x34')]({'where':{'id':_0x299716[_0xe9e1('0x3c')]['id']}})[_0xe9e1('0x17')](handleEntityNotFound(_0x31d96a,null))['then'](function(_0x200330){if(_0x200330){return _0x200330[_0xe9e1('0x74')](_0x299716[_0xe9e1('0x37')][_0xe9e1('0x54')],_[_0xe9e1('0x75')](_0x299716['body'],[_0xe9e1('0x54'),'id'])||{})[_0xe9e1('0x76')](function(_0x2b8542){for(var _0xe9f07=0x0;_0xe9f07<_0x299716[_0xe9e1('0x37')]['ids'][_0xe9e1('0x31')];_0xe9f07+=0x1){socket[_0xe9e1('0x5f')](_0xe9e1('0x60'),{'UserId':Number(_0x299716['body'][_0xe9e1('0x54')][_0xe9f07]),'MailQueueId':Number(_0x299716['params']['id'])});}return _0x2b8542;});}})[_0xe9e1('0x17')](respondWithResult(_0x31d96a,null))[_0xe9e1('0x35')](handleError(_0x31d96a,null));};exports['removeAgents']=function(_0x19f5c8,_0x2d32fe){return db['MailQueue']['find']({'where':{'id':_0x19f5c8[_0xe9e1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2d32fe,null))[_0xe9e1('0x17')](function(_0x4ca3ec){if(_0x4ca3ec){return _0x4ca3ec[_0xe9e1('0x77')](_0x19f5c8[_0xe9e1('0x2c')]['ids'])[_0xe9e1('0x17')](function(){if(_[_0xe9e1('0x78')](_0x19f5c8[_0xe9e1('0x2c')][_0xe9e1('0x54')])){for(var _0x55a209=0x0;_0x55a209<_0x19f5c8[_0xe9e1('0x2c')][_0xe9e1('0x54')][_0xe9e1('0x31')];_0x55a209+=0x1){socket[_0xe9e1('0x5f')](_0xe9e1('0x73'),{'UserId':Number(_0x19f5c8[_0xe9e1('0x2c')][_0xe9e1('0x54')][_0x55a209]),'MailQueueId':Number(_0x19f5c8[_0xe9e1('0x3c')]['id'])});}}else{socket[_0xe9e1('0x5f')]('userMailQueue:remove',{'UserId':Number(_0x19f5c8[_0xe9e1('0x2c')][_0xe9e1('0x54')]),'MailQueueId':Number(_0x19f5c8[_0xe9e1('0x3c')]['id'])});}});}})[_0xe9e1('0x17')](respondWithStatusCode(_0x2d32fe,null))['catch'](handleError(_0x2d32fe,null));};exports[_0xe9e1('0x79')]=function(_0x121aa7,_0x3d1042){var _0x483d8a={};var _0x18a57d={};var _0x4b8b20;var _0x52887f;return db['MailQueue'][_0xe9e1('0x3f')]({'where':{'id':_0x121aa7[_0xe9e1('0x3c')]['id']}})[_0xe9e1('0x17')](handleEntityNotFound(_0x3d1042,null))[_0xe9e1('0x17')](function(_0x91b4cf){if(_0x91b4cf){_0x4b8b20=_0x91b4cf;_0x18a57d[_0xe9e1('0x32')]=_[_0xe9e1('0x2b')](db[_0xe9e1('0x55')][_0xe9e1('0x21')]);_0x18a57d[_0xe9e1('0x2c')]=_[_0xe9e1('0x2b')](_0x121aa7[_0xe9e1('0x2c')]);_0x18a57d[_0xe9e1('0x2d')]=_[_0xe9e1('0x2e')](_0x18a57d[_0xe9e1('0x32')],_0x18a57d['query']);_0x483d8a['attributes']=_[_0xe9e1('0x2e')](_0x18a57d[_0xe9e1('0x32')],qs['fields'](_0x121aa7[_0xe9e1('0x2c')][_0xe9e1('0x2f')]));_0x483d8a[_0xe9e1('0x30')]=_0x483d8a[_0xe9e1('0x30')]['length']?_0x483d8a[_0xe9e1('0x30')]:_0x18a57d[_0xe9e1('0x32')];_0x483d8a['order']=qs[_0xe9e1('0x42')](_0x121aa7[_0xe9e1('0x2c')][_0xe9e1('0x42')]);_0x483d8a[_0xe9e1('0x26')]=qs['filters'](_[_0xe9e1('0x43')](_0x121aa7['query'],_0x18a57d[_0xe9e1('0x2d')]));if(_0x121aa7[_0xe9e1('0x2c')]['filter']){_0x483d8a[_0xe9e1('0x26')]=_[_0xe9e1('0x45')](_0x483d8a[_0xe9e1('0x26')],{'$or':_['map'](_0x483d8a['attributes'],function(_0x1c57dd){var _0x37162a={};_0x37162a[_0x1c57dd]={'$like':'%'+_0x121aa7[_0xe9e1('0x2c')][_0xe9e1('0x46')]+'%'};return _0x37162a;})});}_0x483d8a=_[_0xe9e1('0x45')]({},_0x483d8a,_0x121aa7[_0xe9e1('0x47')]);return _0x4b8b20[_0xe9e1('0x79')](_0x483d8a);}})[_0xe9e1('0x17')](function(_0x2b5c84){if(_0x2b5c84){_0x52887f=_0x2b5c84[_0xe9e1('0x31')];if(!_0x121aa7[_0xe9e1('0x2c')][_0xe9e1('0x41')](_0xe9e1('0x52'))){_0x483d8a[_0xe9e1('0x13')]=qs[_0xe9e1('0x13')](_0x121aa7['query'][_0xe9e1('0x13')]);_0x483d8a[_0xe9e1('0x11')]=qs[_0xe9e1('0x11')](_0x121aa7[_0xe9e1('0x2c')][_0xe9e1('0x11')]);}return _0x4b8b20[_0xe9e1('0x79')](_0x483d8a);}})[_0xe9e1('0x17')](function(_0x58634f){if(_0x58634f){return _0x58634f?{'count':_0x52887f,'rows':_0x58634f}:null;}})['then'](respondWithResult(_0x3d1042,null))['catch'](handleError(_0x3d1042,null));}; \ No newline at end of file +var _0x388b=['voicePause','interface','sequelize','transaction','each','forEach','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','util','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','json','offset','undefined','count','limit','set','update','then','destroy','MailQueues','end','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','getOptions','where','include','rows','catch','show','params','model','keys','query','intersection','attributes','fields','length','merge','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserMailQueue','filters','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','getTeams','addTeams','findAll','Agents','online'];(function(_0x263b9b,_0x504422){var _0x17cee2=function(_0x34e0ce){while(--_0x34e0ce){_0x263b9b['push'](_0x263b9b['shift']());}};_0x17cee2(++_0x504422);}(_0x388b,0xa4));var _0xb388=function(_0x345bc6,_0x1f866f){_0x345bc6=_0x345bc6-0x0;var _0x4610b7=_0x388b[_0x345bc6];return _0x4610b7;};'use strict';var BPromise=require('bluebird');var util=require(_0xb388('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0xb388('0x1'));var qs=require(_0xb388('0x2'));var logger=require(_0xb388('0x3'))(_0xb388('0x4'));var config=require(_0xb388('0x5'));var db=require(_0xb388('0x6'))['db'];config[_0xb388('0x7')]=_[_0xb388('0x8')](config['redis'],{'host':_0xb388('0x9'),'port':0x18eb});var socket=require(_0xb388('0xa'))(new Redis(config[_0xb388('0x7')]));require(_0xb388('0xb'))['register'](socket);function respondWithStatusCode(_0x14b714,_0xe34714){_0xe34714=_0xe34714||0xcc;return function(_0x57923f){if(_0x57923f){return _0x14b714['sendStatus'](_0xe34714);}return _0x14b714[_0xb388('0xc')](_0xe34714)['end']();};}function respondWithResult(_0x5972d9,_0x289d0d){_0x289d0d=_0x289d0d||0xc8;return function(_0x454843){if(_0x454843){return _0x5972d9[_0xb388('0xc')](_0x289d0d)[_0xb388('0xd')](_0x454843);}};}function respondWithFilteredResult(_0x152a3f,_0x12967b){return function(_0x20196c){if(_0x20196c){var _0x154f52=typeof _0x12967b[_0xb388('0xe')]==='undefined'&&typeof _0x12967b['limit']===_0xb388('0xf');var _0x286972=_0x20196c['count'];var _0x167148=_0x154f52?0x0:_0x12967b[_0xb388('0xe')];var _0x541c5c=_0x154f52?_0x20196c[_0xb388('0x10')]:_0x12967b[_0xb388('0xe')]+_0x12967b[_0xb388('0x11')];var _0x43e29c;if(_0x541c5c>=_0x286972){_0x541c5c=_0x286972;_0x43e29c=0xc8;}else{_0x43e29c=0xce;}_0x152a3f[_0xb388('0xc')](_0x43e29c);return _0x152a3f[_0xb388('0x12')]('Content-Range',_0x167148+'-'+_0x541c5c+'/'+_0x286972)[_0xb388('0xd')](_0x20196c);}return null;};}function saveUpdates(_0x11c5b1){return function(_0xb27a5){if(_0xb27a5){return _0xb27a5[_0xb388('0x13')](_0x11c5b1)[_0xb388('0x14')](function(_0x5c608c){return _0x5c608c;});}return null;};}function removeEntity(_0x245d5e){return function(_0x17e56d){if(_0x17e56d){return _0x17e56d[_0xb388('0x15')]()[_0xb388('0x14')](function(){var _0xc4863d=_0x17e56d['get']({'plain':!![]});var _0xf10bec=_0xb388('0x16');return db['UserProfileResource'][_0xb388('0x15')]({'where':{'type':_0xf10bec,'resourceId':_0xc4863d['id']}})['then'](function(){return _0x17e56d;});})['then'](function(){_0x245d5e['status'](0xcc)[_0xb388('0x17')]();});}};}function handleEntityNotFound(_0x4811b5){return function(_0x26c838){if(!_0x26c838){_0x4811b5[_0xb388('0x18')](0x194);}return _0x26c838;};}function handleError(_0xda43b6,_0x1fa35f){_0x1fa35f=_0x1fa35f||0x1f4;return function(_0x9316db){logger[_0xb388('0x19')](_0x9316db[_0xb388('0x1a')]);if(_0x9316db['name']){delete _0x9316db[_0xb388('0x1b')];}_0xda43b6['status'](_0x1fa35f)[_0xb388('0x1c')](_0x9316db);};}exports[_0xb388('0x1d')]=function(_0x566848,_0x4e7540){var _0x39ccfc={};var _0x31805b={'count':0x0,'rows':[]};var _0x1b5750=_[_0xb388('0x1e')](db[_0xb388('0x1f')][_0xb388('0x20')],function(_0x503f0a){return{'name':_0x503f0a[_0xb388('0x21')],'type':_0x503f0a[_0xb388('0x22')]['key']};});_0x39ccfc=qs[_0xb388('0x23')](_0x1b5750,_0x566848);var _0x14fc3e={'where':_0x39ccfc[_0xb388('0x24')]};return db['MailQueue']['count'](_0x14fc3e)[_0xb388('0x14')](function(_0x250da9){_0x31805b[_0xb388('0x10')]=_0x250da9;_0x39ccfc['include']=qs[_0xb388('0x25')](_0x566848['query']);return db[_0xb388('0x1f')]['findAll'](_0x39ccfc);})[_0xb388('0x14')](function(_0x3acc68){_0x31805b[_0xb388('0x26')]=_0x3acc68;return _0x31805b;})[_0xb388('0x14')](respondWithFilteredResult(_0x4e7540,_0x39ccfc))[_0xb388('0x27')](handleError(_0x4e7540,null));};exports[_0xb388('0x28')]=function(_0x1abf6f,_0x4328e7){var _0x2d8b1f={'raw':!![],'where':{'id':_0x1abf6f[_0xb388('0x29')]['id']}},_0x8e6edf={};_0x8e6edf[_0xb388('0x2a')]=_[_0xb388('0x2b')](db['MailQueue']['rawAttributes']);_0x8e6edf[_0xb388('0x2c')]=_[_0xb388('0x2b')](_0x1abf6f[_0xb388('0x2c')]);_0x8e6edf['filters']=_[_0xb388('0x2d')](_0x8e6edf['model'],_0x8e6edf[_0xb388('0x2c')]);_0x2d8b1f[_0xb388('0x2e')]=_[_0xb388('0x2d')](_0x8e6edf[_0xb388('0x2a')],qs[_0xb388('0x2f')](_0x1abf6f['query']['fields']));_0x2d8b1f[_0xb388('0x2e')]=_0x2d8b1f[_0xb388('0x2e')][_0xb388('0x30')]?_0x2d8b1f['attributes']:_0x8e6edf[_0xb388('0x2a')];if(_0x1abf6f[_0xb388('0x2c')]['includeAll']){_0x2d8b1f['include']=[{'all':!![]}];}_0x2d8b1f=_[_0xb388('0x31')]({},_0x2d8b1f,_0x1abf6f[_0xb388('0x32')]);return db[_0xb388('0x1f')]['find'](_0x2d8b1f)[_0xb388('0x14')](handleEntityNotFound(_0x4328e7,null))['then'](respondWithResult(_0x4328e7,null))[_0xb388('0x27')](handleError(_0x4328e7,null));};exports[_0xb388('0x33')]=function(_0x42ff5f,_0x451b56){return db[_0xb388('0x1f')][_0xb388('0x33')](_0x42ff5f['body'],{})[_0xb388('0x14')](function(_0x1e0adb){var _0x5bb7c8=_0x42ff5f['user'][_0xb388('0x34')]({'plain':!![]});if(!_0x5bb7c8)throw new Error(_0xb388('0x35'));if(_0x5bb7c8['role']===_0xb388('0x36')){var _0x577255=_0x1e0adb[_0xb388('0x34')]({'plain':!![]});var _0x4b42dc=_0xb388('0x16');return db[_0xb388('0x37')][_0xb388('0x38')]({'where':{'name':_0x4b42dc,'userProfileId':_0x5bb7c8[_0xb388('0x39')]},'raw':!![]})[_0xb388('0x14')](function(_0x1aff30){if(_0x1aff30&&_0x1aff30[_0xb388('0x3a')]===0x0){return db[_0xb388('0x3b')][_0xb388('0x33')]({'name':_0x577255['name'],'resourceId':_0x577255['id'],'type':_0x1aff30[_0xb388('0x1b')],'sectionId':_0x1aff30['id']},{})[_0xb388('0x14')](function(){return _0x1e0adb;});}else{return _0x1e0adb;}})[_0xb388('0x27')](function(_0x3969f6){logger[_0xb388('0x19')](_0xb388('0x3c'),_0x3969f6);throw _0x3969f6;});}return _0x1e0adb;})[_0xb388('0x14')](respondWithResult(_0x451b56,0xc9))[_0xb388('0x27')](handleError(_0x451b56,null));};exports[_0xb388('0x13')]=function(_0x451488,_0x43ed27){if(_0x451488['body']['id']){delete _0x451488[_0xb388('0x3d')]['id'];}return db['MailQueue'][_0xb388('0x38')]({'where':{'id':_0x451488[_0xb388('0x29')]['id']}})['then'](handleEntityNotFound(_0x43ed27,null))[_0xb388('0x14')](saveUpdates(_0x451488[_0xb388('0x3d')],null))['then'](respondWithResult(_0x43ed27,null))[_0xb388('0x27')](handleError(_0x43ed27,null));};exports[_0xb388('0x15')]=function(_0x364083,_0x10ad8c){return db[_0xb388('0x1f')][_0xb388('0x38')]({'where':{'id':_0x364083[_0xb388('0x29')]['id']}})[_0xb388('0x14')](handleEntityNotFound(_0x10ad8c,null))[_0xb388('0x14')](removeEntity(_0x10ad8c,null))[_0xb388('0x27')](handleError(_0x10ad8c,null));};exports[_0xb388('0x3e')]=function(_0x5e5e64,_0x2de831){return db[_0xb388('0x1f')][_0xb388('0x3e')]()['then'](respondWithResult(_0x2de831,null))[_0xb388('0x27')](handleError(_0x2de831,null));};exports['getMembers']=function(_0x3983a7,_0x5c52c0){var _0x4c79d0={'raw':!![],'where':{}},_0x278aff={},_0x5cc455;return db[_0xb388('0x1f')]['findOne']({'where':{'id':_0x3983a7['params']['id']}})['then'](handleEntityNotFound(_0x5c52c0,null))[_0xb388('0x14')](function(_0x1a72bc){if(_0x1a72bc){_0x5cc455=_0x1a72bc[_0xb388('0x34')]({'plain':!![]});_0x278aff[_0xb388('0x2a')]=_[_0xb388('0x2b')](db[_0xb388('0x3f')][_0xb388('0x20')]);_0x278aff[_0xb388('0x2c')]=_[_0xb388('0x2b')](_0x3983a7[_0xb388('0x2c')]);_0x278aff[_0xb388('0x40')]=_[_0xb388('0x2d')](_0x278aff[_0xb388('0x2a')],_0x278aff['query']);_0x4c79d0[_0xb388('0x2e')]=_[_0xb388('0x2d')](_0x278aff['model'],qs['fields'](_0x3983a7[_0xb388('0x2c')][_0xb388('0x2f')]));_0x4c79d0[_0xb388('0x2e')]=_0x4c79d0[_0xb388('0x2e')][_0xb388('0x30')]?_0x4c79d0[_0xb388('0x2e')]:_0x278aff['model'];if(!_0x3983a7[_0xb388('0x2c')][_0xb388('0x41')](_0xb388('0x42'))){_0x4c79d0[_0xb388('0x11')]=qs[_0xb388('0x11')](_0x3983a7[_0xb388('0x2c')][_0xb388('0x11')]);_0x4c79d0['offset']=qs[_0xb388('0xe')](_0x3983a7[_0xb388('0x2c')][_0xb388('0xe')]);}_0x4c79d0[_0xb388('0x43')]=qs[_0xb388('0x44')](_0x3983a7[_0xb388('0x2c')][_0xb388('0x44')]);_0x4c79d0[_0xb388('0x24')]=qs['filters'](_[_0xb388('0x45')](_0x3983a7[_0xb388('0x2c')],_0x278aff[_0xb388('0x40')]));_0x4c79d0[_0xb388('0x24')]['MailQueueId']=_0x1a72bc['id'];if(_0x3983a7[_0xb388('0x2c')][_0xb388('0x46')]){_0x4c79d0[_0xb388('0x24')]=_[_0xb388('0x31')](_0x4c79d0['where'],{'$or':_[_0xb388('0x1e')](_0x4c79d0[_0xb388('0x2e')],function(_0xc7d7f0){var _0x119a88={};_0x119a88[_0xc7d7f0]={'$like':'%'+_0x3983a7['query'][_0xb388('0x46')]+'%'};return _0x119a88;})});}_0x4c79d0=_[_0xb388('0x31')]({},_0x4c79d0,_0x3983a7['options']);return db['UserMailQueue']['findAll'](_0x4c79d0);}})[_0xb388('0x14')](function(_0x22dffb){if(_0x22dffb){return db[_0xb388('0x47')][_0xb388('0x48')]({'where':{'id':_[_0xb388('0x1e')](_0x22dffb,_0xb388('0x49')),'role':_0xb388('0x4a')},'attributes':['id',_0xb388('0x1b'),_0xb388('0x4b'),_0xb388('0x4c'),'createdAt']});}})[_0xb388('0x14')](function(_0x86e989){if(_0x86e989){return{'count':_0x86e989[_0xb388('0x10')],'rows':_[_0xb388('0x1e')](_0x86e989[_0xb388('0x26')],function(_0x1e32ed){return{'membername':_0x1e32ed[_0xb388('0x1b')],'UserId':_0x1e32ed['id'],'queue_name':_0x5cc455[_0xb388('0x1b')],'MailQueueId':_0x5cc455['id'],'interface':util[_0xb388('0x4d')](_0xb388('0x4e'),_0xb388('0x4f'),_0x1e32ed['name']),'penalty':0x0,'paused':_0x1e32ed[_0xb388('0x4b')],'createdAt':_0x1e32ed[_0xb388('0x50')],'updatedAt':_0x1e32ed[_0xb388('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5c52c0,_0x4c79d0))['catch'](handleError(_0x5c52c0,null));};exports['getTeams']=function(_0x54f8d8,_0x2da94b){var _0x326161={};var _0x401816={};var _0x4f76b4;var _0x10fcfd;return db[_0xb388('0x1f')][_0xb388('0x51')]({'where':{'id':_0x54f8d8['params']['id']}})[_0xb388('0x14')](handleEntityNotFound(_0x2da94b,null))[_0xb388('0x14')](function(_0x4e3394){if(_0x4e3394){_0x4f76b4=_0x4e3394;_0x401816[_0xb388('0x2a')]=_[_0xb388('0x2b')](db[_0xb388('0x52')][_0xb388('0x20')]);_0x401816[_0xb388('0x2c')]=_['keys'](_0x54f8d8[_0xb388('0x2c')]);_0x401816[_0xb388('0x40')]=_[_0xb388('0x2d')](_0x401816[_0xb388('0x2a')],_0x401816['query']);_0x326161[_0xb388('0x2e')]=_[_0xb388('0x2d')](_0x401816[_0xb388('0x2a')],qs['fields'](_0x54f8d8[_0xb388('0x2c')][_0xb388('0x2f')]));_0x326161[_0xb388('0x2e')]=_0x326161[_0xb388('0x2e')][_0xb388('0x30')]?_0x326161['attributes']:_0x401816['model'];_0x326161[_0xb388('0x43')]=qs[_0xb388('0x44')](_0x54f8d8[_0xb388('0x2c')][_0xb388('0x44')]);_0x326161[_0xb388('0x24')]=qs[_0xb388('0x40')](_[_0xb388('0x45')](_0x54f8d8[_0xb388('0x2c')],_0x401816[_0xb388('0x40')]));if(_0x54f8d8[_0xb388('0x2c')][_0xb388('0x46')]){_0x326161[_0xb388('0x24')]=_['merge'](_0x326161['where'],{'$or':_[_0xb388('0x1e')](_0x326161[_0xb388('0x2e')],function(_0x551014){var _0x42d568={};_0x42d568[_0x551014]={'$like':'%'+_0x54f8d8[_0xb388('0x2c')][_0xb388('0x46')]+'%'};return _0x42d568;})});}_0x326161=_['merge']({},_0x326161,_0x54f8d8[_0xb388('0x32')]);return _0x4f76b4[_0xb388('0x53')](_0x326161);}})['then'](function(_0x40fc4b){if(_0x40fc4b){_0x10fcfd=_0x40fc4b[_0xb388('0x30')];if(!_0x54f8d8[_0xb388('0x2c')][_0xb388('0x41')]('nolimit')){_0x326161['limit']=qs['limit'](_0x54f8d8[_0xb388('0x2c')]['limit']);_0x326161[_0xb388('0xe')]=qs[_0xb388('0xe')](_0x54f8d8['query'][_0xb388('0xe')]);}return _0x4f76b4[_0xb388('0x53')](_0x326161);}})['then'](function(_0x1c3758){if(_0x1c3758){return _0x1c3758?{'count':_0x10fcfd,'rows':_0x1c3758}:null;}})[_0xb388('0x14')](respondWithResult(_0x2da94b,null))[_0xb388('0x27')](handleError(_0x2da94b,null));};exports[_0xb388('0x54')]=function(_0x5c1c5c,_0x73020a){var _0x332985=_0x5c1c5c[_0xb388('0x3d')]['ids'];return db[_0xb388('0x52')][_0xb388('0x55')]({'where':{'id':_0x332985},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb388('0x56'),'attributes':['id',_0xb388('0x1b'),_0xb388('0x57'),_0xb388('0x58'),_0xb388('0x59')],'raw':!![]}]})['then'](function(_0x4456bc){if(_0x4456bc){var _0x42ce25=_['flatMap'](_0x4456bc,function(_0x36d865){var _0x5d2d56=_0x36d865[_0xb388('0x34')]({'plain':!![]});return _0x5d2d56[_0xb388('0x56')];});return db[_0xb388('0x1f')][_0xb388('0x38')]({'where':{'id':_0x5c1c5c[_0xb388('0x29')]['id']}})[_0xb388('0x14')](function(_0x513fb6){return db[_0xb388('0x5a')][_0xb388('0x5b')](function(_0x2a809b){return _0x513fb6[_0xb388('0x54')](_0x332985,{'transaction':_0x2a809b})[_0xb388('0x14')](function(){return BPromise[_0xb388('0x5c')](_0x42ce25,function(_0x21c67c){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x21c67c['id'],'MailQueueId':_0x5c1c5c[_0xb388('0x29')]['id']},'transaction':_0x2a809b});});})[_0xb388('0x14')](function(){_0x42ce25[_0xb388('0x5d')](function(_0x19246){socket[_0xb388('0x5e')](_0xb388('0x5f'),{'UserId':_0x19246['id'],'MailQueueId':_0x513fb6['id']});});});});});}})[_0xb388('0x14')](respondWithStatusCode(_0x73020a,null))[_0xb388('0x27')](handleError(_0x73020a,null));};exports[_0xb388('0x60')]=function(_0x51f9a4,_0x3541a2){return db[_0xb388('0x52')]['findAll']({'where':{'id':_0x51f9a4['query'][_0xb388('0x61')]},'attributes':['id'],'include':[{'model':db[_0xb388('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb388('0x14')](handleEntityNotFound(_0x3541a2,null))[_0xb388('0x14')](function(_0x3f1696){var _0x1edcaa=_[_0xb388('0x1e')](_0x3f1696,'id');var _0x4656f4=[];var _0x2550c9=[];var _0x4670b2=squel[_0xb388('0x62')]();_0x4670b2[_0xb388('0x63')](_0xb388('0x64'))[_0xb388('0x65')](_0xb388('0x66'),'tq')[_0xb388('0x67')](_0xb388('0x68'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb388('0x24')](_0xb388('0x69'),_0x51f9a4[_0xb388('0x29')]['id']);for(var _0x52ab2a=0x0;_0x52ab2a<_0x3f1696['length'];_0x52ab2a+=0x1){let _0x4c76a7=_0x3f1696[_0x52ab2a];for(var _0x33a64e=0x0;_0x33a64e<_0x4c76a7[_0xb388('0x56')]['length'];_0x33a64e+=0x1){let _0x5bd816=_0x4c76a7['Agents'][_0x33a64e];var _0x4e9382=_0x4670b2[_0xb388('0x6a')]();_0x4e9382[_0xb388('0x24')]('ut.UserId\x20=\x20?',_0x5bd816['id']);_0x2550c9[_0xb388('0x6b')](db[_0xb388('0x5a')][_0xb388('0x2c')](_0x4e9382[_0xb388('0x6c')](),{'type':db[_0xb388('0x5a')][_0xb388('0x6d')][_0xb388('0x6e')]})[_0xb388('0x14')](function(_0x448b4c){if(_0x448b4c[_0xb388('0x30')]===0x1){return _0x5bd816['id'];}else{var _0x5a3cfd=_[_0xb388('0x6f')](_['map'](_0x448b4c,_0xb388('0x70')),function(_0x3e8cf6){return _[_0xb388('0x71')](_0x1edcaa,_0x3e8cf6);});if(_0x5a3cfd){return _0x5bd816['id'];}}}));}}return BPromise[_0xb388('0x72')](_0x2550c9)[_0xb388('0x14')](function(_0x133afd){_0x4656f4=_(_0x4656f4)[_0xb388('0x73')](_0x133afd)[_0xb388('0x74')]()[_0xb388('0x75')]();return db[_0xb388('0x1f')][_0xb388('0x38')]({'where':{'id':_0x51f9a4[_0xb388('0x29')]['id']}})[_0xb388('0x14')](function(_0x3c034a){return db['sequelize'][_0xb388('0x5b')](function(_0x435298){return _0x3c034a[_0xb388('0x60')](_0x51f9a4[_0xb388('0x2c')]['ids'],{'transaction':_0x435298})[_0xb388('0x14')](function(){if(!_[_0xb388('0x76')](_0x4656f4)){return _0x3c034a[_0xb388('0x77')](_0x4656f4,{'transaction':_0x435298});}})[_0xb388('0x14')](function(){_0x4656f4[_0xb388('0x5d')](function(_0x33521d){socket[_0xb388('0x5e')](_0xb388('0x78'),{'UserId':_0x33521d,'MailQueueId':_0x3c034a['id']});});});});});});})['then'](respondWithStatusCode(_0x3541a2,null))[_0xb388('0x27')](handleError(_0x3541a2,null));};exports['addAgents']=function(_0x3e6e4f,_0x449db5){return db[_0xb388('0x1f')][_0xb388('0x38')]({'where':{'id':_0x3e6e4f[_0xb388('0x29')]['id']}})[_0xb388('0x14')](handleEntityNotFound(_0x449db5,null))['then'](function(_0x4f6683){if(_0x4f6683){return _0x4f6683[_0xb388('0x79')](_0x3e6e4f['body'][_0xb388('0x61')],_[_0xb388('0x7a')](_0x3e6e4f[_0xb388('0x3d')],[_0xb388('0x61'),'id'])||{})[_0xb388('0x7b')](function(_0x32dba9){for(var _0x2be721=0x0;_0x2be721<_0x3e6e4f['body'][_0xb388('0x61')][_0xb388('0x30')];_0x2be721+=0x1){socket['emit'](_0xb388('0x5f'),{'UserId':Number(_0x3e6e4f['body']['ids'][_0x2be721]),'MailQueueId':Number(_0x3e6e4f[_0xb388('0x29')]['id'])});}return _0x32dba9;});}})[_0xb388('0x14')](respondWithResult(_0x449db5,null))[_0xb388('0x27')](handleError(_0x449db5,null));};exports[_0xb388('0x77')]=function(_0x1f0e94,_0xd46dc0){return db[_0xb388('0x1f')]['find']({'where':{'id':_0x1f0e94[_0xb388('0x29')]['id']}})[_0xb388('0x14')](handleEntityNotFound(_0xd46dc0,null))[_0xb388('0x14')](function(_0x492e57){if(_0x492e57){return _0x492e57[_0xb388('0x77')](_0x1f0e94[_0xb388('0x2c')][_0xb388('0x61')])[_0xb388('0x14')](function(){if(_[_0xb388('0x7c')](_0x1f0e94[_0xb388('0x2c')][_0xb388('0x61')])){for(var _0x56bc5b=0x0;_0x56bc5b<_0x1f0e94[_0xb388('0x2c')][_0xb388('0x61')][_0xb388('0x30')];_0x56bc5b+=0x1){socket[_0xb388('0x5e')](_0xb388('0x78'),{'UserId':Number(_0x1f0e94[_0xb388('0x2c')][_0xb388('0x61')][_0x56bc5b]),'MailQueueId':Number(_0x1f0e94[_0xb388('0x29')]['id'])});}}else{socket['emit'](_0xb388('0x78'),{'UserId':Number(_0x1f0e94['query'][_0xb388('0x61')]),'MailQueueId':Number(_0x1f0e94[_0xb388('0x29')]['id'])});}});}})[_0xb388('0x14')](respondWithStatusCode(_0xd46dc0,null))[_0xb388('0x27')](handleError(_0xd46dc0,null));};exports['getAgents']=function(_0x697753,_0x1967cc){var _0x32551a={};var _0x599cb5={};var _0x243e49;var _0x320995;return db[_0xb388('0x1f')][_0xb388('0x51')]({'where':{'id':_0x697753[_0xb388('0x29')]['id']}})['then'](handleEntityNotFound(_0x1967cc,null))[_0xb388('0x14')](function(_0x130849){if(_0x130849){_0x243e49=_0x130849;_0x599cb5[_0xb388('0x2a')]=_[_0xb388('0x2b')](db[_0xb388('0x47')][_0xb388('0x20')]);_0x599cb5[_0xb388('0x2c')]=_[_0xb388('0x2b')](_0x697753['query']);_0x599cb5['filters']=_[_0xb388('0x2d')](_0x599cb5[_0xb388('0x2a')],_0x599cb5[_0xb388('0x2c')]);_0x32551a[_0xb388('0x2e')]=_[_0xb388('0x2d')](_0x599cb5[_0xb388('0x2a')],qs['fields'](_0x697753[_0xb388('0x2c')][_0xb388('0x2f')]));_0x32551a[_0xb388('0x2e')]=_0x32551a['attributes'][_0xb388('0x30')]?_0x32551a[_0xb388('0x2e')]:_0x599cb5[_0xb388('0x2a')];_0x32551a[_0xb388('0x43')]=qs['sort'](_0x697753[_0xb388('0x2c')][_0xb388('0x44')]);_0x32551a[_0xb388('0x24')]=qs['filters'](_['pick'](_0x697753[_0xb388('0x2c')],_0x599cb5['filters']));if(_0x697753['query'][_0xb388('0x46')]){_0x32551a[_0xb388('0x24')]=_[_0xb388('0x31')](_0x32551a['where'],{'$or':_[_0xb388('0x1e')](_0x32551a[_0xb388('0x2e')],function(_0x5984d7){var _0xc29dcd={};_0xc29dcd[_0x5984d7]={'$like':'%'+_0x697753[_0xb388('0x2c')]['filter']+'%'};return _0xc29dcd;})});}_0x32551a=_[_0xb388('0x31')]({},_0x32551a,_0x697753['options']);return _0x243e49[_0xb388('0x7d')](_0x32551a);}})[_0xb388('0x14')](function(_0xae2a85){if(_0xae2a85){_0x320995=_0xae2a85[_0xb388('0x30')];if(!_0x697753[_0xb388('0x2c')]['hasOwnProperty'](_0xb388('0x42'))){_0x32551a[_0xb388('0x11')]=qs['limit'](_0x697753[_0xb388('0x2c')][_0xb388('0x11')]);_0x32551a['offset']=qs[_0xb388('0xe')](_0x697753[_0xb388('0x2c')][_0xb388('0xe')]);}return _0x243e49['getAgents'](_0x32551a);}})['then'](function(_0x71130c){if(_0x71130c){return _0x71130c?{'count':_0x320995,'rows':_0x71130c}:null;}})['then'](respondWithResult(_0x1967cc,null))[_0xb388('0x27')](handleError(_0x1967cc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 859e7f0..fbfb550 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 _0x2522=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x8bef3b,_0x4ad38c){var _0x2c785b=function(_0x3c005c){while(--_0x3c005c){_0x8bef3b['push'](_0x8bef3b['shift']());}};_0x2c785b(++_0x4ad38c);}(_0x2522,0x102));var _0x2252=function(_0x10a7a4,_0x2087b1){_0x10a7a4=_0x10a7a4-0x0;var _0x4df1ba=_0x2522[_0x10a7a4];return _0x4df1ba;};'use strict';var EventEmitter=require(_0x2252('0x0'));var MailQueue=require(_0x2252('0x1'))['db'][_0x2252('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2252('0x3')](0x0);var events={'afterCreate':_0x2252('0x4'),'afterUpdate':_0x2252('0x5'),'afterDestroy':_0x2252('0x6')};function emitEvent(_0x256a44){return function(_0x1a79ed,_0x3a0db0,_0x7fd4bf){MailQueueEvents['emit'](_0x256a44+':'+_0x1a79ed['id'],_0x1a79ed);MailQueueEvents[_0x2252('0x7')](_0x256a44,_0x1a79ed);_0x7fd4bf(null);};}for(var e in events){if(events[_0x2252('0x8')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x2252('0x9')]=MailQueueEvents; \ No newline at end of file +var _0xc721=['hasOwnProperty','hook','../../mysqldb','save','remove'];(function(_0x1f269a,_0x13bf81){var _0x502f33=function(_0x1d8294){while(--_0x1d8294){_0x1f269a['push'](_0x1f269a['shift']());}};_0x502f33(++_0x13bf81);}(_0xc721,0x1a1));var _0x1c72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc721[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x1c72('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c72('0x1'),'afterUpdate':'update','afterDestroy':_0x1c72('0x2')};function emitEvent(_0x358413){return function(_0x32e535,_0xc31d96,_0x2da9d0){MailQueueEvents['emit'](_0x358413+':'+_0x32e535['id'],_0x32e535);MailQueueEvents['emit'](_0x358413,_0x32e535);_0x2da9d0(null);};}for(var e in events){if(events[_0x1c72('0x3')](e)){var event=events[e];MailQueue[_0x1c72('0x4')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index a0e0eb0..893d6cf 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 _0xd63c=['api','moment','bluebird','request-promise','rimraf','./mailQueue.attributes','exports','MailQueue','mail_queues','util','../../config/logger'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xd63c,0x195));var _0xcd63=function(_0x743b6c,_0x4dbc78){_0x743b6c=_0x743b6c-0x0;var _0x41575a=_0xd63c[_0x743b6c];return _0x41575a;};'use strict';var _=require('lodash');var util=require(_0xcd63('0x0'));var logger=require(_0xcd63('0x1'))(_0xcd63('0x2'));var moment=require(_0xcd63('0x3'));var BPromise=require(_0xcd63('0x4'));var rp=require(_0xcd63('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd63('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd63('0x7'));module[_0xcd63('0x8')]=function(_0x137bd4,_0x353c43){return _0x137bd4['define'](_0xcd63('0x9'),attributes,{'tableName':_0xcd63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0089=['rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0089,0x1d5));var _0x9008=function(_0x167796,_0x4bc07d){_0x167796=_0x167796-0x0;var _0x3e11a2=_0x0089[_0x167796];return _0x3e11a2;};'use strict';var _=require(_0x9008('0x0'));var util=require(_0x9008('0x1'));var logger=require('../../config/logger')(_0x9008('0x2'));var moment=require(_0x9008('0x3'));var BPromise=require(_0x9008('0x4'));var rp=require(_0x9008('0x5'));var fs=require('fs');var path=require(_0x9008('0x6'));var rimraf=require(_0x9008('0x7'));var config=require(_0x9008('0x8'));var attributes=require(_0x9008('0x9'));module[_0x9008('0xa')]=function(_0x9a1152,_0x401a7a){return _0x9a1152[_0x9008('0xb')](_0x9008('0xc'),attributes,{'tableName':_0x9008('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index f4b3696..3f16e14 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 _0x3425=['error','code','message','info','result','catch','GetMailQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowMailQueue','find','bluebird','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x45363e,_0x1d6bdf){var _0x5ad690=function(_0x3b36ad){while(--_0x3b36ad){_0x45363e['push'](_0x45363e['shift']());}};_0x5ad690(++_0x1d6bdf);}(_0x3425,0x1c0));var _0x5342=function(_0x5c427f,_0x26d635){_0x5c427f=_0x5c427f-0x0;var _0x1a65d7=_0x3425[_0x5c427f];return _0x1a65d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5342('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5342('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x5342('0x2'));var jayson=require(_0x5342('0x3'));var client=jayson[_0x5342('0x4')]['http']({'port':0x232a});config[_0x5342('0x5')]=_[_0x5342('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5342('0x5')]));require('./mailQueue.socket')[_0x5342('0x7')](socket);function respondWithRpcPromise(_0xd60871,_0x1a919a,_0x3c3edd){return new BPromise(function(_0x3817b4,_0x460e09){return client[_0x5342('0x8')](_0xd60871,_0x3c3edd)[_0x5342('0x9')](function(_0x58a41f){logger['info'](_0x5342('0xa'),_0x1a919a,_0x5342('0xb'));logger['debug'](_0x5342('0xc'),_0x1a919a,_0x5342('0xb'),JSON[_0x5342('0xd')](_0x58a41f));if(_0x58a41f[_0x5342('0xe')]){if(_0x58a41f[_0x5342('0xe')][_0x5342('0xf')]===0x1f4){logger[_0x5342('0xe')](_0x5342('0xa'),_0x1a919a,_0x58a41f['error'][_0x5342('0x10')]);return _0x460e09(_0x58a41f[_0x5342('0xe')][_0x5342('0x10')]);}logger['error'](_0x5342('0xa'),_0x1a919a,_0x58a41f[_0x5342('0xe')][_0x5342('0x10')]);return _0x3817b4(_0x58a41f[_0x5342('0xe')][_0x5342('0x10')]);}else{logger[_0x5342('0x11')]('MailQueue,\x20%s,\x20%s',_0x1a919a,_0x5342('0xb'));_0x3817b4(_0x58a41f[_0x5342('0x12')][_0x5342('0x10')]);}})[_0x5342('0x13')](function(_0x1a706c){logger[_0x5342('0xe')]('MailQueue,\x20%s,\x20%s',_0x1a919a,_0x1a706c);_0x460e09(_0x1a706c);});});}exports[_0x5342('0x14')]=function(_0x56e4bf){var _0x4ad479=this;return new Promise(function(_0xbd467b,_0x52e1c4){return db['MailQueue'][_0x5342('0x15')]({'raw':_0x56e4bf[_0x5342('0x16')]?_0x56e4bf['options'][_0x5342('0x17')]===undefined?!![]:![]:!![],'where':_0x56e4bf[_0x5342('0x16')]?_0x56e4bf[_0x5342('0x16')][_0x5342('0x18')]||null:null,'attributes':_0x56e4bf[_0x5342('0x16')]?_0x56e4bf[_0x5342('0x16')]['attributes']||null:null,'limit':_0x56e4bf[_0x5342('0x16')]?_0x56e4bf['options'][_0x5342('0x19')]||null:null,'include':_0x56e4bf[_0x5342('0x16')]?_0x56e4bf['options']['include']?_[_0x5342('0x1a')](_0x56e4bf[_0x5342('0x16')][_0x5342('0x1b')],function(_0x1bd8bd){return{'model':db[_0x1bd8bd[_0x5342('0x1c')]],'as':_0x1bd8bd['as'],'attributes':_0x1bd8bd['attributes'],'include':_0x1bd8bd[_0x5342('0x1b')]?_[_0x5342('0x1a')](_0x1bd8bd[_0x5342('0x1b')],function(_0x418092){return{'model':db[_0x418092[_0x5342('0x1c')]],'as':_0x418092['as'],'attributes':_0x418092[_0x5342('0x1d')],'include':_0x418092[_0x5342('0x1b')]?_[_0x5342('0x1a')](_0x418092['include'],function(_0xfcef41){return{'model':db[_0xfcef41[_0x5342('0x1c')]],'as':_0xfcef41['as'],'attributes':_0xfcef41[_0x5342('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18fb98){logger[_0x5342('0x11')](_0x5342('0x14'),_0x56e4bf);logger[_0x5342('0x1e')](_0x5342('0x14'),_0x56e4bf,JSON[_0x5342('0xd')](_0x18fb98));_0xbd467b(_0x18fb98);})[_0x5342('0x13')](function(_0x137cda){logger[_0x5342('0xe')](_0x5342('0x14'),_0x137cda[_0x5342('0x10')],_0x56e4bf);_0x52e1c4(_0x4ad479[_0x5342('0xe')](0x1f4,_0x137cda[_0x5342('0x10')]));});});};exports[_0x5342('0x1f')]=function(_0x55576f){var _0x5da811=this;return new Promise(function(_0x507c29,_0x4d4765){return db['MailQueue'][_0x5342('0x20')]({'raw':_0x55576f[_0x5342('0x16')]?_0x55576f[_0x5342('0x16')][_0x5342('0x17')]===undefined?!![]:![]:!![],'where':_0x55576f[_0x5342('0x16')]?_0x55576f['options'][_0x5342('0x18')]||null:null,'attributes':_0x55576f[_0x5342('0x16')]?_0x55576f['options'][_0x5342('0x1d')]||null:null,'include':_0x55576f['options']?_0x55576f[_0x5342('0x16')]['include']?_[_0x5342('0x1a')](_0x55576f[_0x5342('0x16')]['include'],function(_0x2e0392){return{'model':db[_0x2e0392['model']],'as':_0x2e0392['as'],'attributes':_0x2e0392[_0x5342('0x1d')],'include':_0x2e0392[_0x5342('0x1b')]?_[_0x5342('0x1a')](_0x2e0392['include'],function(_0x3f47b1){return{'model':db[_0x3f47b1[_0x5342('0x1c')]],'as':_0x3f47b1['as'],'attributes':_0x3f47b1[_0x5342('0x1d')],'include':_0x3f47b1[_0x5342('0x1b')]?_[_0x5342('0x1a')](_0x3f47b1[_0x5342('0x1b')],function(_0x2425e4){return{'model':db[_0x2425e4['model']],'as':_0x2425e4['as'],'attributes':_0x2425e4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5342('0x9')](function(_0x4ec648){logger[_0x5342('0x11')](_0x5342('0x1f'),_0x55576f);logger[_0x5342('0x1e')](_0x5342('0x1f'),_0x55576f,JSON['stringify'](_0x4ec648));_0x507c29(_0x4ec648);})['catch'](function(_0x540d43){logger[_0x5342('0xe')](_0x5342('0x1f'),_0x540d43[_0x5342('0x10')],_0x55576f);_0x4d4765(_0x5da811[_0x5342('0xe')](0x1f4,_0x540d43['message']));});});}; \ No newline at end of file +var _0x9fdc=['MailQueue','options','raw','where','limit','map','include','model','attributes','ShowMailQueue','find','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue'];(function(_0x33b140,_0x225c6e){var _0x36d9c2=function(_0x462aff){while(--_0x462aff){_0x33b140['push'](_0x33b140['shift']());}};_0x36d9c2(++_0x225c6e);}(_0x9fdc,0xce));var _0xc9fd=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x9fdc[_0x53bcc3];return _0x47c959;};'use strict';var _=require('lodash');var util=require(_0xc9fd('0x0'));var moment=require('moment');var BPromise=require(_0xc9fd('0x1'));var rs=require(_0xc9fd('0x2'));var fs=require('fs');var Redis=require(_0xc9fd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fd('0x4'));var logger=require(_0xc9fd('0x5'))(_0xc9fd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc9fd('0x7'));var client=jayson[_0xc9fd('0x8')]['http']({'port':0x232a});config[_0xc9fd('0x9')]=_[_0xc9fd('0xa')](config[_0xc9fd('0x9')],{'host':_0xc9fd('0xb'),'port':0x18eb});var socket=require(_0xc9fd('0xc'))(new Redis(config['redis']));require(_0xc9fd('0xd'))[_0xc9fd('0xe')](socket);function respondWithRpcPromise(_0x462b57,_0x844422,_0xe2611e){return new BPromise(function(_0x12f823,_0x5cb8a1){return client['request'](_0x462b57,_0xe2611e)[_0xc9fd('0xf')](function(_0x3da019){logger[_0xc9fd('0x10')](_0xc9fd('0x11'),_0x844422,_0xc9fd('0x12'));logger[_0xc9fd('0x13')](_0xc9fd('0x14'),_0x844422,'request\x20sent',JSON[_0xc9fd('0x15')](_0x3da019));if(_0x3da019[_0xc9fd('0x16')]){if(_0x3da019['error'][_0xc9fd('0x17')]===0x1f4){logger[_0xc9fd('0x16')]('MailQueue,\x20%s,\x20%s',_0x844422,_0x3da019['error']['message']);return _0x5cb8a1(_0x3da019[_0xc9fd('0x16')][_0xc9fd('0x18')]);}logger[_0xc9fd('0x16')](_0xc9fd('0x11'),_0x844422,_0x3da019['error'][_0xc9fd('0x18')]);return _0x12f823(_0x3da019[_0xc9fd('0x16')][_0xc9fd('0x18')]);}else{logger[_0xc9fd('0x10')]('MailQueue,\x20%s,\x20%s',_0x844422,_0xc9fd('0x12'));_0x12f823(_0x3da019[_0xc9fd('0x19')]['message']);}})[_0xc9fd('0x1a')](function(_0x57e0c1){logger[_0xc9fd('0x16')]('MailQueue,\x20%s,\x20%s',_0x844422,_0x57e0c1);_0x5cb8a1(_0x57e0c1);});});}exports[_0xc9fd('0x1b')]=function(_0x441770){var _0x43ff09=this;return new Promise(function(_0xcd830d,_0x228490){return db[_0xc9fd('0x1c')]['findAll']({'raw':_0x441770['options']?_0x441770[_0xc9fd('0x1d')][_0xc9fd('0x1e')]===undefined?!![]:![]:!![],'where':_0x441770[_0xc9fd('0x1d')]?_0x441770['options'][_0xc9fd('0x1f')]||null:null,'attributes':_0x441770[_0xc9fd('0x1d')]?_0x441770[_0xc9fd('0x1d')]['attributes']||null:null,'limit':_0x441770[_0xc9fd('0x1d')]?_0x441770[_0xc9fd('0x1d')][_0xc9fd('0x20')]||null:null,'include':_0x441770[_0xc9fd('0x1d')]?_0x441770[_0xc9fd('0x1d')]['include']?_[_0xc9fd('0x21')](_0x441770[_0xc9fd('0x1d')][_0xc9fd('0x22')],function(_0x2e71df){return{'model':db[_0x2e71df[_0xc9fd('0x23')]],'as':_0x2e71df['as'],'attributes':_0x2e71df['attributes'],'include':_0x2e71df['include']?_[_0xc9fd('0x21')](_0x2e71df['include'],function(_0x4ef730){return{'model':db[_0x4ef730[_0xc9fd('0x23')]],'as':_0x4ef730['as'],'attributes':_0x4ef730['attributes'],'include':_0x4ef730[_0xc9fd('0x22')]?_[_0xc9fd('0x21')](_0x4ef730[_0xc9fd('0x22')],function(_0x2fa1bd){return{'model':db[_0x2fa1bd[_0xc9fd('0x23')]],'as':_0x2fa1bd['as'],'attributes':_0x2fa1bd[_0xc9fd('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc9fd('0xf')](function(_0x3bb28c){logger[_0xc9fd('0x10')](_0xc9fd('0x1b'),_0x441770);logger[_0xc9fd('0x13')](_0xc9fd('0x1b'),_0x441770,JSON[_0xc9fd('0x15')](_0x3bb28c));_0xcd830d(_0x3bb28c);})[_0xc9fd('0x1a')](function(_0x34df50){logger[_0xc9fd('0x16')](_0xc9fd('0x1b'),_0x34df50[_0xc9fd('0x18')],_0x441770);_0x228490(_0x43ff09[_0xc9fd('0x16')](0x1f4,_0x34df50[_0xc9fd('0x18')]));});});};exports[_0xc9fd('0x25')]=function(_0x4f6e13){var _0x3e7fd4=this;return new Promise(function(_0x25c2a1,_0x36da11){return db['MailQueue'][_0xc9fd('0x26')]({'raw':_0x4f6e13['options']?_0x4f6e13[_0xc9fd('0x1d')][_0xc9fd('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f6e13['options']?_0x4f6e13[_0xc9fd('0x1d')][_0xc9fd('0x1f')]||null:null,'attributes':_0x4f6e13[_0xc9fd('0x1d')]?_0x4f6e13['options']['attributes']||null:null,'include':_0x4f6e13[_0xc9fd('0x1d')]?_0x4f6e13[_0xc9fd('0x1d')][_0xc9fd('0x22')]?_[_0xc9fd('0x21')](_0x4f6e13['options'][_0xc9fd('0x22')],function(_0x392fad){return{'model':db[_0x392fad[_0xc9fd('0x23')]],'as':_0x392fad['as'],'attributes':_0x392fad[_0xc9fd('0x24')],'include':_0x392fad[_0xc9fd('0x22')]?_['map'](_0x392fad[_0xc9fd('0x22')],function(_0x552213){return{'model':db[_0x552213[_0xc9fd('0x23')]],'as':_0x552213['as'],'attributes':_0x552213[_0xc9fd('0x24')],'include':_0x552213['include']?_[_0xc9fd('0x21')](_0x552213['include'],function(_0x25d23c){return{'model':db[_0x25d23c[_0xc9fd('0x23')]],'as':_0x25d23c['as'],'attributes':_0x25d23c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9fd('0xf')](function(_0x575694){logger[_0xc9fd('0x10')](_0xc9fd('0x25'),_0x4f6e13);logger[_0xc9fd('0x13')](_0xc9fd('0x25'),_0x4f6e13,JSON['stringify'](_0x575694));_0x25c2a1(_0x575694);})[_0xc9fd('0x1a')](function(_0x2593c7){logger[_0xc9fd('0x16')](_0xc9fd('0x25'),_0x2593c7[_0xc9fd('0x18')],_0x4f6e13);_0x36da11(_0x3e7fd4[_0xc9fd('0x16')](0x1f4,_0x2593c7[_0xc9fd('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c43ad54..c2b7beb 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 _0x31af=['register','length','mailQueue:','./mailQueue.events','update','removeListener'];(function(_0x2d7ef7,_0x5588b3){var _0x8c8b4e=function(_0x2ad405){while(--_0x2ad405){_0x2d7ef7['push'](_0x2d7ef7['shift']());}};_0x8c8b4e(++_0x5588b3);}(_0x31af,0x1b9));var _0xf31a=function(_0x748a65,_0xf5e156){_0x748a65=_0x748a65-0x0;var _0x5d395f=_0x31af[_0x748a65];return _0x5d395f;};'use strict';var MailQueueEvents=require(_0xf31a('0x0'));var events=['save','remove',_0xf31a('0x1')];function createListener(_0x4d4c2b,_0x105822){return function(_0x36402c){_0x105822['emit'](_0x4d4c2b,_0x36402c);};}function removeListener(_0x4e0d70,_0x11d769){return function(){MailQueueEvents[_0xf31a('0x2')](_0x4e0d70,_0x11d769);};}exports[_0xf31a('0x3')]=function(_0x32e828){for(var _0x354ef9=0x0,_0x2f2e98=events[_0xf31a('0x4')];_0x354ef9<_0x2f2e98;_0x354ef9++){var _0x28a045=events[_0x354ef9];var _0x8aa5e4=createListener(_0xf31a('0x5')+_0x28a045,_0x32e828);MailQueueEvents['on'](_0x28a045,_0x8aa5e4);}}; \ No newline at end of file +var _0xfad0=['length','mailQueue:','save','update','removeListener','register'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xfad0,0xb0));var _0x0fad=function(_0x7b0ea4,_0x4bc2ef){_0x7b0ea4=_0x7b0ea4-0x0;var _0x2e94b4=_0xfad0[_0x7b0ea4];return _0x2e94b4;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x0fad('0x0'),'remove',_0x0fad('0x1')];function createListener(_0x1bc2d3,_0x5777c9){return function(_0x123ebf){_0x5777c9['emit'](_0x1bc2d3,_0x123ebf);};}function removeListener(_0x302912,_0x83f1ad){return function(){MailQueueEvents[_0x0fad('0x2')](_0x302912,_0x83f1ad);};}exports[_0x0fad('0x3')]=function(_0x1280d9){for(var _0x4292b7=0x0,_0x305a4f=events[_0x0fad('0x4')];_0x4292b7<_0x305a4f;_0x4292b7++){var _0x28ecd8=events[_0x4292b7];var _0x3be118=createListener(_0x0fad('0x5')+_0x28ecd8,_0x1280d9);MailQueueEvents['on'](_0x28ecd8,_0x3be118);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e044eee..c5e2780 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 _0x48d1=['update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x48d1,0x192));var _0x148d=function(_0x2d7128,_0x5905eb){_0x2d7128=_0x2d7128-0x0;var _0x3ce08e=_0x48d1[_0x2d7128];return _0x3ce08e;};'use strict';var multer=require(_0x148d('0x0'));var util=require(_0x148d('0x1'));var path=require('path');var timeout=require(_0x148d('0x2'));var express=require(_0x148d('0x3'));var router=express[_0x148d('0x4')]();var fs_extra=require(_0x148d('0x5'));var auth=require(_0x148d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x148d('0x7'));var controller=require(_0x148d('0x8'));router[_0x148d('0x9')]('/',auth[_0x148d('0xa')](),controller[_0x148d('0xb')]);router[_0x148d('0x9')](_0x148d('0xc'),auth['isAuthenticated'](),controller[_0x148d('0xd')]);router[_0x148d('0x9')](_0x148d('0xe'),auth[_0x148d('0xa')](),controller['show']);router[_0x148d('0xf')]('/',auth[_0x148d('0xa')](),controller[_0x148d('0x10')]);router[_0x148d('0x11')](_0x148d('0xe'),auth[_0x148d('0xa')](),controller[_0x148d('0x12')]);router['delete'](_0x148d('0xe'),auth['isAuthenticated'](),controller[_0x148d('0x13')]);module[_0x148d('0x14')]=router; \ No newline at end of file +var _0xb3d0=['fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','describe','get','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x1c54b3,_0x362fbd){var _0x408915=function(_0x1fd14f){while(--_0x1fd14f){_0x1c54b3['push'](_0x1c54b3['shift']());}};_0x408915(++_0x362fbd);}(_0xb3d0,0x100));var _0x0b3d=function(_0x9b4e52,_0x59e220){_0x9b4e52=_0x9b4e52-0x0;var _0x401203=_0xb3d0[_0x9b4e52];return _0x401203;};'use strict';var multer=require(_0x0b3d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0b3d('0x1'));var express=require(_0x0b3d('0x2'));var router=express[_0x0b3d('0x3')]();var fs_extra=require(_0x0b3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0b3d('0x5'));var config=require(_0x0b3d('0x6'));var controller=require(_0x0b3d('0x7'));router['get']('/',auth[_0x0b3d('0x8')](),controller[_0x0b3d('0x9')]);router['get']('/describe',auth[_0x0b3d('0x8')](),controller[_0x0b3d('0xa')]);router[_0x0b3d('0xb')](_0x0b3d('0xc'),auth[_0x0b3d('0x8')](),controller[_0x0b3d('0xd')]);router[_0x0b3d('0xe')]('/',auth[_0x0b3d('0x8')](),controller['create']);router[_0x0b3d('0xf')]('/:id',auth[_0x0b3d('0x8')](),controller[_0x0b3d('0x10')]);router[_0x0b3d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0b3d('0x12')]);module[_0x0b3d('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 8de5e62..63e5f66 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 _0x9cdb=['STRING','DATE','moment','sequelize'];(function(_0x332405,_0x2764c5){var _0x226299=function(_0x465505){while(--_0x465505){_0x332405['push'](_0x332405['shift']());}};_0x226299(++_0x2764c5);}(_0x9cdb,0x142));var _0xb9cd=function(_0x4369ef,_0x33cde3){_0x4369ef=_0x4369ef-0x0;var _0xf9dac4=_0x9cdb[_0x4369ef];return _0xf9dac4;};'use strict';var moment=require(_0xb9cd('0x0'));var Sequelize=require(_0xb9cd('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb9cd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb9cd('0x2')]},'joinAt':{'type':Sequelize[_0xb9cd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb9cd('0x2')]}}; \ No newline at end of file +var _0x794b=['STRING','DATE','exports'];(function(_0x4528cd,_0xb06738){var _0x379fc0=function(_0xc8a053){while(--_0xc8a053){_0x4528cd['push'](_0x4528cd['shift']());}};_0x379fc0(++_0xb06738);}(_0x794b,0xa7));var _0xb794=function(_0x288842,_0xfa3790){_0x288842=_0x288842-0x0;var _0x39b429=_0x794b[_0x288842];return _0x39b429;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xb794('0x0')]={'uniqueid':{'type':Sequelize[_0xb794('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb794('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb794('0x2')]},'exitAt':{'type':Sequelize[_0xb794('0x2')]},'reason':{'type':Sequelize[_0xb794('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 30caf53..d45cdb9 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 _0xfcf0=['nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xfcf0,0x138));var _0x0fcf=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0xfcf0[_0x13b330];return _0x1f666c;};'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['MailQueueReport']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':!![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));};exports[_0x0fcf('0x49')]=function(_0x389d71,_0x3a473c){return db[_0x0fcf('0x2b')][_0x0fcf('0x49')]()[_0x0fcf('0x24')](respondWithResult(_0x3a473c,null))[_0x0fcf('0x42')](handleError(_0x3a473c,null));}; \ No newline at end of file +var _0x6a55=['eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','create','body','find','describe'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6a55,0xdb));var _0x56a5=function(_0x186222,_0x3bdfb0){_0x186222=_0x186222-0x0;var _0x226a38=_0x6a55[_0x186222];return _0x226a38;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];function respondWithStatusCode(_0x2b9d7d,_0x1a9bf0){_0x1a9bf0=_0x1a9bf0||0xcc;return function(_0x2de420){if(_0x2de420){return _0x2b9d7d[_0x56a5('0x17')](_0x1a9bf0);}return _0x2b9d7d['status'](_0x1a9bf0)['end']();};}function respondWithResult(_0x3e3ff6,_0x1e416f){_0x1e416f=_0x1e416f||0xc8;return function(_0x176c7b){if(_0x176c7b){return _0x3e3ff6[_0x56a5('0x18')](_0x1e416f)[_0x56a5('0x19')](_0x176c7b);}};}function respondWithFilteredResult(_0x2db112,_0xe3091f){return function(_0x5c4028){if(_0x5c4028){var _0x360297=typeof _0xe3091f['offset']===_0x56a5('0x1a')&&typeof _0xe3091f['limit']===_0x56a5('0x1a');var _0x3f3e5b=_0x5c4028[_0x56a5('0x1b')];var _0x28fe74=_0x360297?0x0:_0xe3091f[_0x56a5('0x1c')];var _0x143f3d=_0x360297?_0x5c4028[_0x56a5('0x1b')]:_0xe3091f['offset']+_0xe3091f[_0x56a5('0x1d')];var _0x3db687;if(_0x143f3d>=_0x3f3e5b){_0x143f3d=_0x3f3e5b;_0x3db687=0xc8;}else{_0x3db687=0xce;}_0x2db112[_0x56a5('0x18')](_0x3db687);return _0x2db112[_0x56a5('0x1e')]('Content-Range',_0x28fe74+'-'+_0x143f3d+'/'+_0x3f3e5b)[_0x56a5('0x19')](_0x5c4028);}return null;};}function patchUpdates(_0x1fdb7a){return function(_0xa274f4){try{jsonpatch[_0x56a5('0x1f')](_0xa274f4,_0x1fdb7a,!![]);}catch(_0x155d3b){return BPromise['reject'](_0x155d3b);}return _0xa274f4['save']();};}function saveUpdates(_0x29f181,_0x1c4ab8){return function(_0x487505){if(_0x487505){return _0x487505[_0x56a5('0x20')](_0x29f181)[_0x56a5('0x21')](function(_0x615d49){return _0x615d49;});}return null;};}function removeEntity(_0x15d9f8,_0xe1ded0){return function(_0x616922){if(_0x616922){return _0x616922[_0x56a5('0x22')]()[_0x56a5('0x21')](function(){_0x15d9f8[_0x56a5('0x18')](0xcc)[_0x56a5('0x23')]();});}};}function handleEntityNotFound(_0xcf212,_0x2f203f){return function(_0x460bc2){if(!_0x460bc2){_0xcf212['sendStatus'](0x194);}return _0x460bc2;};}function handleError(_0x5c76a7,_0x2d8e68){_0x2d8e68=_0x2d8e68||0x1f4;return function(_0x42cd45){logger[_0x56a5('0x24')](_0x42cd45[_0x56a5('0x25')]);if(_0x42cd45['name']){delete _0x42cd45[_0x56a5('0x26')];}_0x5c76a7['status'](_0x2d8e68)[_0x56a5('0x27')](_0x42cd45);};}exports[_0x56a5('0x28')]=function(_0x1b27b5,_0x284ee5){var _0x4e7afd={},_0x3b55e6={},_0x1f7aeb={'count':0x0,'rows':[]};var _0x178f11=_['map'](db[_0x56a5('0x29')][_0x56a5('0x2a')],function(_0xeb4378){return{'name':_0xeb4378[_0x56a5('0x2b')],'type':_0xeb4378[_0x56a5('0x2c')]['key']};});_0x3b55e6[_0x56a5('0x2d')]=_[_0x56a5('0x2e')](_0x178f11,_0x56a5('0x26'));_0x3b55e6[_0x56a5('0x2f')]=_[_0x56a5('0x30')](_0x1b27b5['query']);_0x3b55e6['filters']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],_0x3b55e6[_0x56a5('0x2f')]);_0x4e7afd['attributes']=_[_0x56a5('0x31')](_0x3b55e6[_0x56a5('0x2d')],qs['fields'](_0x1b27b5['query']['fields']));_0x4e7afd['attributes']=_0x4e7afd[_0x56a5('0x32')][_0x56a5('0x33')]?_0x4e7afd[_0x56a5('0x32')]:_0x3b55e6['model'];if(!_0x1b27b5[_0x56a5('0x2f')]['hasOwnProperty'](_0x56a5('0x34'))){_0x4e7afd[_0x56a5('0x1d')]=qs['limit'](_0x1b27b5[_0x56a5('0x2f')]['limit']);_0x4e7afd[_0x56a5('0x1c')]=qs[_0x56a5('0x1c')](_0x1b27b5[_0x56a5('0x2f')]['offset']);}_0x4e7afd[_0x56a5('0x35')]=qs[_0x56a5('0x36')](_0x1b27b5[_0x56a5('0x2f')]['sort']);_0x4e7afd[_0x56a5('0x37')]=qs[_0x56a5('0x38')](_[_0x56a5('0x39')](_0x1b27b5[_0x56a5('0x2f')],_0x3b55e6[_0x56a5('0x38')]),_0x178f11);if(_0x1b27b5['query']['filter']){_0x4e7afd[_0x56a5('0x37')]=_[_0x56a5('0x3a')](_0x4e7afd[_0x56a5('0x37')],{'$or':_[_0x56a5('0x2e')](_0x178f11,function(_0xbf2db6){if(_0xbf2db6[_0x56a5('0x2c')]!==_0x56a5('0x3b')){var _0x652028={};_0x652028[_0xbf2db6[_0x56a5('0x26')]]={'$like':'%'+_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3c')]+'%'};return _0x652028;}})});}_0x4e7afd=_[_0x56a5('0x3a')]({},_0x4e7afd,_0x1b27b5[_0x56a5('0x3d')]);var _0x389c01={'where':_0x4e7afd[_0x56a5('0x37')]};return db[_0x56a5('0x29')][_0x56a5('0x1b')](_0x389c01)[_0x56a5('0x21')](function(_0xf0f6c8){_0x1f7aeb[_0x56a5('0x1b')]=_0xf0f6c8;if(_0x1b27b5[_0x56a5('0x2f')][_0x56a5('0x3e')]){_0x4e7afd['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x56a5('0x3f')](_0x4e7afd);})['then'](function(_0x7c3c3e){_0x1f7aeb[_0x56a5('0x40')]=_0x7c3c3e;return _0x1f7aeb;})[_0x56a5('0x21')](respondWithFilteredResult(_0x284ee5,_0x4e7afd))[_0x56a5('0x41')](handleError(_0x284ee5,null));};exports[_0x56a5('0x42')]=function(_0x1160da,_0x5618f9){var _0x5c565a={'raw':!![],'where':{'id':_0x1160da[_0x56a5('0x43')]['id']}},_0x29ab9b={};_0x29ab9b[_0x56a5('0x2d')]=_[_0x56a5('0x30')](db[_0x56a5('0x29')][_0x56a5('0x2a')]);_0x29ab9b['query']=_[_0x56a5('0x30')](_0x1160da[_0x56a5('0x2f')]);_0x29ab9b['filters']=_[_0x56a5('0x31')](_0x29ab9b[_0x56a5('0x2d')],_0x29ab9b[_0x56a5('0x2f')]);_0x5c565a[_0x56a5('0x32')]=_['intersection'](_0x29ab9b[_0x56a5('0x2d')],qs['fields'](_0x1160da[_0x56a5('0x2f')][_0x56a5('0x44')]));_0x5c565a['attributes']=_0x5c565a[_0x56a5('0x32')]['length']?_0x5c565a[_0x56a5('0x32')]:_0x29ab9b[_0x56a5('0x2d')];if(_0x1160da['query'][_0x56a5('0x3e')]){_0x5c565a['include']=[{'all':!![]}];}_0x5c565a=_[_0x56a5('0x3a')]({},_0x5c565a,_0x1160da['options']);return db[_0x56a5('0x29')]['find'](_0x5c565a)[_0x56a5('0x21')](handleEntityNotFound(_0x5618f9,null))[_0x56a5('0x21')](respondWithResult(_0x5618f9,null))[_0x56a5('0x41')](handleError(_0x5618f9,null));};exports[_0x56a5('0x45')]=function(_0x30d377,_0x43196d){return db[_0x56a5('0x29')]['create'](_0x30d377['body'],{})['then'](respondWithResult(_0x43196d,0xc9))[_0x56a5('0x41')](handleError(_0x43196d,null));};exports[_0x56a5('0x20')]=function(_0x1e510a,_0x55d2e2){if(_0x1e510a[_0x56a5('0x46')]['id']){delete _0x1e510a[_0x56a5('0x46')]['id'];}return db[_0x56a5('0x29')]['find']({'where':{'id':_0x1e510a[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x55d2e2,null))['then'](saveUpdates(_0x1e510a[_0x56a5('0x46')],null))[_0x56a5('0x21')](respondWithResult(_0x55d2e2,null))[_0x56a5('0x41')](handleError(_0x55d2e2,null));};exports[_0x56a5('0x22')]=function(_0xcb3cb9,_0x58d308){return db[_0x56a5('0x29')][_0x56a5('0x47')]({'where':{'id':_0xcb3cb9[_0x56a5('0x43')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x58d308,null))[_0x56a5('0x21')](removeEntity(_0x58d308,null))['catch'](handleError(_0x58d308,null));};exports[_0x56a5('0x48')]=function(_0x3bda32,_0x597e52){return db[_0x56a5('0x29')][_0x56a5('0x48')]()[_0x56a5('0x21')](respondWithResult(_0x597e52,null))['catch'](handleError(_0x597e52,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 33689c8..86e8a81 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 _0xb921=['../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0xb921,0xd7));var _0x1b92=function(_0x1db5de,_0x37c0ef){_0x1db5de=_0x1db5de-0x0;var _0x4b165e=_0xb921[_0x1db5de];return _0x4b165e;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var logger=require(_0x1b92('0x2'))(_0x1b92('0x3'));var moment=require(_0x1b92('0x4'));var BPromise=require(_0x1b92('0x5'));var rp=require(_0x1b92('0x6'));var fs=require('fs');var path=require(_0x1b92('0x7'));var rimraf=require(_0x1b92('0x8'));var config=require(_0x1b92('0x9'));var attributes=require(_0x1b92('0xa'));module[_0x1b92('0xb')]=function(_0x4eb9da,_0x50153a){return _0x4eb9da[_0x1b92('0xc')](_0x1b92('0xd'),attributes,{'tableName':_0x1b92('0xe'),'paranoid':![],'indexes':[{'name':_0x1b92('0xf'),'fields':[_0x1b92('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x078a=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x078a,0x12d));var _0xa078=function(_0x2e28e9,_0x1decf8){_0x2e28e9=_0x2e28e9-0x0;var _0x340369=_0x078a[_0x2e28e9];return _0x340369;};'use strict';var _=require(_0xa078('0x0'));var util=require(_0xa078('0x1'));var logger=require(_0xa078('0x2'))(_0xa078('0x3'));var moment=require(_0xa078('0x4'));var BPromise=require(_0xa078('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa078('0x6'));var rimraf=require(_0xa078('0x7'));var config=require(_0xa078('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0xa078('0x9')]=function(_0x4a65f2,_0x453616){return _0x4a65f2[_0xa078('0xa')](_0xa078('0xb'),attributes,{'tableName':_0xa078('0xc'),'paranoid':![],'indexes':[{'name':_0xa078('0xd'),'fields':[_0xa078('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 385aa13..c32ff24 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 _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x5c4ddc,_0x2c0eec){var _0x37865d=function(_0x3654fc){while(--_0x3654fc){_0x5c4ddc['push'](_0x5c4ddc['shift']());}};_0x37865d(++_0x2c0eec);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c2c9b,_0x1c0051){_0x2c2c9b=_0x2c2c9b-0x0;var _0x4df7d0=_0x5f2f[_0x2c2c9b];return _0x4df7d0;};'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')]('MailQueueReport,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ 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(_0x58b5f9,_0x10a310){var _0x40f816=function(_0x5ae15f){while(--_0x5ae15f){_0x58b5f9['push'](_0x58b5f9['shift']());}};_0x40f816(++_0x10a310);}(_0xdb28,0x106));var _0x8db2=function(_0x4f9f15,_0x11ed7f){_0x4f9f15=_0x4f9f15-0x0;var _0x289a09=_0xdb28[_0x4f9f15];return _0x289a09;};'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 7a70c52..b964211 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(_0x143f66,_0xc9a270){var _0x2e84d9=function(_0xe835c9){while(--_0xe835c9){_0x143f66['push'](_0x143f66['shift']());}};_0x2e84d9(++_0xc9a270);}(_0xe706,0xa3));var _0x6e70=function(_0x1df5cd,_0x3dc641){_0x1df5cd=_0x1df5cd-0x0;var _0xf6df9b=_0xe706[_0x1df5cd];return _0xf6df9b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1d9786,_0x21c91d){var _0x99599b=function(_0x10c219){while(--_0x10c219){_0x1d9786['push'](_0x1d9786['shift']());}};_0x99599b(++_0x21c91d);}(_0x70e0,0x17b));var _0x070e=function(_0x3d31e3,_0x275876){_0x3d31e3=_0x3d31e3-0x0;var _0x3dcd97=_0x70e0[_0x3d31e3];return _0x3dcd97;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index b10520d..b98fcb5 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 _0x5fd8=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x3b56cb,_0x13c013){var _0x2a5764=function(_0x298beb){while(--_0x298beb){_0x3b56cb['push'](_0x3b56cb['shift']());}};_0x2a5764(++_0x13c013);}(_0x5fd8,0x192));var _0x85fd=function(_0x3eb767,_0x45bea8){_0x3eb767=_0x3eb767-0x0;var _0x735867=_0x5fd8[_0x3eb767];return _0x735867;};'use strict';var Sequelize=require(_0x85fd('0x0'));module[_0x85fd('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x85fd('0x2')]},'authentication':{'type':Sequelize[_0x85fd('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x85fd('0x2')]},'password':{'type':Sequelize[_0x85fd('0x2')]},'port':{'type':Sequelize[_0x85fd('0x4')]},'tls':{'type':Sequelize[_0x85fd('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x85fd('0x2')],'defaultValue':_0x85fd('0x5')},'connTimeout':{'type':Sequelize[_0x85fd('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x85fd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x88a1=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x88a1,0x1c7));var _0x188a=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x88a1[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require(_0x188a('0x0'));module['exports']={'description':{'type':Sequelize[_0x188a('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x188a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x188a('0x1')]},'password':{'type':Sequelize[_0x188a('0x1')]},'port':{'type':Sequelize[_0x188a('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x188a('0x4')},'connTimeout':{'type':Sequelize[_0x188a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x188a('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x188a('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5aebc2d..31bba00 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 _0x79c6=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0x79c6,0xe9));var _0x679c=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0x79c6[_0xfbdff6];return _0x4cb9be;};'use strict';var _=require(_0x679c('0x0'));var util=require(_0x679c('0x1'));var logger=require(_0x679c('0x2'))(_0x679c('0x3'));var moment=require(_0x679c('0x4'));var BPromise=require(_0x679c('0x5'));var rp=require(_0x679c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x679c('0x7'));var config=require(_0x679c('0x8'));var attributes=require(_0x679c('0x9'));module[_0x679c('0xa')]=function(_0x546931,_0x5836c5){return _0x546931['define'](_0x679c('0xb'),attributes,{'tableName':_0x679c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2013=['moment','request-promise','rimraf','MailServerIn','lodash','api'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x2013,0x18a));var _0x3201=function(_0x2b26a7,_0x10761a){_0x2b26a7=_0x2b26a7-0x0;var _0x4b32fa=_0x2013[_0x2b26a7];return _0x4b32fa;};'use strict';var _=require(_0x3201('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3201('0x1'));var moment=require(_0x3201('0x2'));var BPromise=require('bluebird');var rp=require(_0x3201('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3201('0x4'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x1b2a32,_0x91b904){return _0x1b2a32['define'](_0x3201('0x5'),attributes,{'tableName':'mail_servers_in','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 7dcedf4..8fa9815 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 _0x61ee=['../../config/logger','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetMailServerIn','options','limit','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4b2cc0,_0x5670b1){var _0x32abc4=function(_0x339003){while(--_0x339003){_0x4b2cc0['push'](_0x4b2cc0['shift']());}};_0x32abc4(++_0x5670b1);}(_0x61ee,0x1ba));var _0xe61e=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0x61ee[_0x4733d3];return _0x1b9a44;};'use strict';var _=require(_0xe61e('0x0'));var util=require('util');var moment=require(_0xe61e('0x1'));var BPromise=require(_0xe61e('0x2'));var rs=require(_0xe61e('0x3'));var fs=require('fs');var Redis=require(_0xe61e('0x4'));var db=require(_0xe61e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe61e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe61e('0x7')][_0xe61e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7ae020,_0x4f48b1,_0x1822d9){return new BPromise(function(_0x390f48,_0x4979e4){return client[_0xe61e('0x9')](_0x7ae020,_0x1822d9)[_0xe61e('0xa')](function(_0x50cd4e){logger[_0xe61e('0xb')](_0xe61e('0xc'),_0x4f48b1,'request\x20sent');logger[_0xe61e('0xd')](_0xe61e('0xe'),_0x4f48b1,_0xe61e('0xf'),JSON['stringify'](_0x50cd4e));if(_0x50cd4e[_0xe61e('0x10')]){if(_0x50cd4e[_0xe61e('0x10')][_0xe61e('0x11')]===0x1f4){logger[_0xe61e('0x10')](_0xe61e('0xc'),_0x4f48b1,_0x50cd4e[_0xe61e('0x10')][_0xe61e('0x12')]);return _0x4979e4(_0x50cd4e[_0xe61e('0x10')][_0xe61e('0x12')]);}logger['error'](_0xe61e('0xc'),_0x4f48b1,_0x50cd4e[_0xe61e('0x10')]['message']);return _0x390f48(_0x50cd4e[_0xe61e('0x10')][_0xe61e('0x12')]);}else{logger[_0xe61e('0xb')](_0xe61e('0xc'),_0x4f48b1,_0xe61e('0xf'));_0x390f48(_0x50cd4e[_0xe61e('0x13')][_0xe61e('0x12')]);}})[_0xe61e('0x14')](function(_0x493620){logger[_0xe61e('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4f48b1,_0x493620);_0x4979e4(_0x493620);});});}exports[_0xe61e('0x15')]=function(_0xb83d76){var _0x512337=this;return new Promise(function(_0x5e460b,_0x3c43bc){return db['MailServerIn']['findAll']({'raw':_0xb83d76[_0xe61e('0x16')]?_0xb83d76[_0xe61e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xb83d76['options']?_0xb83d76[_0xe61e('0x16')]['where']||null:null,'attributes':_0xb83d76[_0xe61e('0x16')]?_0xb83d76[_0xe61e('0x16')]['attributes']||null:null,'limit':_0xb83d76[_0xe61e('0x16')]?_0xb83d76[_0xe61e('0x16')][_0xe61e('0x17')]||null:null,'include':_0xb83d76[_0xe61e('0x16')]?_0xb83d76[_0xe61e('0x16')][_0xe61e('0x18')]?_[_0xe61e('0x19')](_0xb83d76['options'][_0xe61e('0x18')],function(_0x259e8b){return{'model':db[_0x259e8b[_0xe61e('0x1a')]],'as':_0x259e8b['as'],'attributes':_0x259e8b[_0xe61e('0x1b')],'include':_0x259e8b['include']?_[_0xe61e('0x19')](_0x259e8b['include'],function(_0x24974f){return{'model':db[_0x24974f[_0xe61e('0x1a')]],'as':_0x24974f['as'],'attributes':_0x24974f[_0xe61e('0x1b')],'include':_0x24974f['include']?_[_0xe61e('0x19')](_0x24974f[_0xe61e('0x18')],function(_0x2c0c1a){return{'model':db[_0x2c0c1a[_0xe61e('0x1a')]],'as':_0x2c0c1a['as'],'attributes':_0x2c0c1a[_0xe61e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe61e('0xa')](function(_0x17f4c5){logger['info'](_0xe61e('0x15'),_0xb83d76);logger[_0xe61e('0xd')](_0xe61e('0x15'),_0xb83d76,JSON['stringify'](_0x17f4c5));_0x5e460b(_0x17f4c5);})[_0xe61e('0x14')](function(_0xa14537){logger[_0xe61e('0x10')](_0xe61e('0x15'),_0xa14537[_0xe61e('0x12')],_0xb83d76);_0x3c43bc(_0x512337[_0xe61e('0x10')](0x1f4,_0xa14537[_0xe61e('0x12')]));});});}; \ No newline at end of file +var _0xe98f=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x202350,_0x1d0559){var _0x33beff=function(_0x1a609b){while(--_0x1a609b){_0x202350['push'](_0x202350['shift']());}};_0x33beff(++_0x1d0559);}(_0xe98f,0xc1));var _0xfe98=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe98f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xfe98('0x0'));var util=require(_0xfe98('0x1'));var moment=require(_0xfe98('0x2'));var BPromise=require(_0xfe98('0x3'));var rs=require(_0xfe98('0x4'));var fs=require('fs');var Redis=require(_0xfe98('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe98('0x6'));var logger=require(_0xfe98('0x7'))(_0xfe98('0x8'));var config=require(_0xfe98('0x9'));var jayson=require(_0xfe98('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7c15,_0x2b6339,_0x2bf726){return new BPromise(function(_0x85632d,_0xca4598){return client[_0xfe98('0xb')](_0x4c7c15,_0x2bf726)[_0xfe98('0xc')](function(_0x5394a1){logger['info'](_0xfe98('0xd'),_0x2b6339,_0xfe98('0xe'));logger['debug'](_0xfe98('0xf'),_0x2b6339,_0xfe98('0xe'),JSON[_0xfe98('0x10')](_0x5394a1));if(_0x5394a1['error']){if(_0x5394a1[_0xfe98('0x11')][_0xfe98('0x12')]===0x1f4){logger[_0xfe98('0x11')](_0xfe98('0xd'),_0x2b6339,_0x5394a1[_0xfe98('0x11')][_0xfe98('0x13')]);return _0xca4598(_0x5394a1[_0xfe98('0x11')]['message']);}logger[_0xfe98('0x11')]('MailServerIn,\x20%s,\x20%s',_0x2b6339,_0x5394a1[_0xfe98('0x11')][_0xfe98('0x13')]);return _0x85632d(_0x5394a1[_0xfe98('0x11')][_0xfe98('0x13')]);}else{logger[_0xfe98('0x14')](_0xfe98('0xd'),_0x2b6339,'request\x20sent');_0x85632d(_0x5394a1[_0xfe98('0x15')]['message']);}})[_0xfe98('0x16')](function(_0x5e5af4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x2b6339,_0x5e5af4);_0xca4598(_0x5e5af4);});});}exports[_0xfe98('0x17')]=function(_0xff276a){var _0x1eddea=this;return new Promise(function(_0x78f0fa,_0x179c51){return db[_0xfe98('0x18')]['findAll']({'raw':_0xff276a[_0xfe98('0x19')]?_0xff276a[_0xfe98('0x19')][_0xfe98('0x1a')]===undefined?!![]:![]:!![],'where':_0xff276a[_0xfe98('0x19')]?_0xff276a[_0xfe98('0x19')]['where']||null:null,'attributes':_0xff276a['options']?_0xff276a[_0xfe98('0x19')][_0xfe98('0x1b')]||null:null,'limit':_0xff276a[_0xfe98('0x19')]?_0xff276a[_0xfe98('0x19')][_0xfe98('0x1c')]||null:null,'include':_0xff276a[_0xfe98('0x19')]?_0xff276a[_0xfe98('0x19')][_0xfe98('0x1d')]?_[_0xfe98('0x1e')](_0xff276a[_0xfe98('0x19')][_0xfe98('0x1d')],function(_0x40d7dd){return{'model':db[_0x40d7dd[_0xfe98('0x1f')]],'as':_0x40d7dd['as'],'attributes':_0x40d7dd[_0xfe98('0x1b')],'include':_0x40d7dd[_0xfe98('0x1d')]?_['map'](_0x40d7dd['include'],function(_0x4f2fad){return{'model':db[_0x4f2fad['model']],'as':_0x4f2fad['as'],'attributes':_0x4f2fad['attributes'],'include':_0x4f2fad['include']?_['map'](_0x4f2fad[_0xfe98('0x1d')],function(_0x40cda9){return{'model':db[_0x40cda9[_0xfe98('0x1f')]],'as':_0x40cda9['as'],'attributes':_0x40cda9[_0xfe98('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfe98('0xc')](function(_0x57d50b){logger[_0xfe98('0x14')](_0xfe98('0x17'),_0xff276a);logger[_0xfe98('0x20')](_0xfe98('0x17'),_0xff276a,JSON[_0xfe98('0x10')](_0x57d50b));_0x78f0fa(_0x57d50b);})['catch'](function(_0x2ae114){logger['error'](_0xfe98('0x17'),_0x2ae114[_0xfe98('0x13')],_0xff276a);_0x179c51(_0x1eddea[_0xfe98('0x11')](0x1f4,_0x2ae114[_0xfe98('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c0e1c13..c95e229 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c6abbc1..fc5e5c2 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 _0xf45e=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x25071c,_0xa180d0){var _0x4e28cc=function(_0x3c1c86){while(--_0x3c1c86){_0x25071c['push'](_0x25071c['shift']());}};_0x4e28cc(++_0xa180d0);}(_0xf45e,0x115));var _0xef45=function(_0x116a22,_0x2f7e15){_0x116a22=_0x116a22-0x0;var _0x3f2c75=_0xf45e[_0x116a22];return _0x3f2c75;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'description':{'type':Sequelize[_0xef45('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xef45('0x1')]},'pass':{'type':Sequelize[_0xef45('0x1')]},'port':{'type':Sequelize[_0xef45('0x2')]},'secure':{'type':Sequelize[_0xef45('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xef45('0x1')]},'authentication':{'type':Sequelize[_0xef45('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xef45('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6324=['STRING','BOOLEAN','sequelize','exports'];(function(_0x385c76,_0xb97335){var _0x5c8367=function(_0xdfcd3){while(--_0xdfcd3){_0x385c76['push'](_0x385c76['shift']());}};_0x5c8367(++_0xb97335);}(_0x6324,0x142));var _0x4632=function(_0xf3f58c,_0x38b821){_0xf3f58c=_0xf3f58c-0x0;var _0x53d7b6=_0x6324[_0xf3f58c];return _0x53d7b6;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'description':{'type':Sequelize[_0x4632('0x2')]},'host':{'type':Sequelize[_0x4632('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4632('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4632('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4632('0x3')],'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 aa94c67..31c7087 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 _0x60a5=['limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','MailServerOut','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0x485594,_0x293fa1){var _0xd1dc2b=function(_0x13467c){while(--_0x13467c){_0x485594['push'](_0x485594['shift']());}};_0xd1dc2b(++_0x293fa1);}(_0x60a5,0x1bb));var _0x560a=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x60a5[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x560a('0x0'));var rimraf=require(_0x560a('0x1'));var zipdir=require(_0x560a('0x2'));var jsonpatch=require(_0x560a('0x3'));var rp=require('request-promise');var moment=require(_0x560a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x560a('0x5'));var path=require(_0x560a('0x6'));var sox=require(_0x560a('0x7'));var csv=require('to-csv');var ejs=require(_0x560a('0x8'));var fs=require('fs');var fs_extra=require(_0x560a('0x9'));var _=require(_0x560a('0xa'));var squel=require(_0x560a('0xb'));var crypto=require(_0x560a('0xc'));var jsforce=require(_0x560a('0xd'));var deskjs=require(_0x560a('0xe'));var toCsv=require(_0x560a('0xf'));var querystring=require(_0x560a('0x10'));var Papa=require(_0x560a('0x11'));var Redis=require(_0x560a('0x12'));var authService=require(_0x560a('0x13'));var qs=require(_0x560a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x560a('0x15'));var logger=require(_0x560a('0x16'))(_0x560a('0x17'));var utils=require(_0x560a('0x18'));var config=require(_0x560a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x560a('0x1a'))['db'];function respondWithStatusCode(_0x20e364,_0x324341){_0x324341=_0x324341||0xcc;return function(_0x102fec){if(_0x102fec){return _0x20e364[_0x560a('0x1b')](_0x324341);}return _0x20e364[_0x560a('0x1c')](_0x324341)['end']();};}function respondWithResult(_0x147480,_0x24c448){_0x24c448=_0x24c448||0xc8;return function(_0x4f4dda){if(_0x4f4dda){return _0x147480[_0x560a('0x1c')](_0x24c448)['json'](_0x4f4dda);}};}function respondWithFilteredResult(_0xb26582,_0x2fe721){return function(_0x4d1635){if(_0x4d1635){var _0x1845b8=typeof _0x2fe721[_0x560a('0x1d')]===_0x560a('0x1e')&&typeof _0x2fe721[_0x560a('0x1f')]===_0x560a('0x1e');var _0x4c5707=_0x4d1635[_0x560a('0x20')];var _0x45816e=_0x1845b8?0x0:_0x2fe721[_0x560a('0x1d')];var _0x13e8f4=_0x1845b8?_0x4d1635[_0x560a('0x20')]:_0x2fe721[_0x560a('0x1d')]+_0x2fe721[_0x560a('0x1f')];var _0x36d4c8;if(_0x13e8f4>=_0x4c5707){_0x13e8f4=_0x4c5707;_0x36d4c8=0xc8;}else{_0x36d4c8=0xce;}_0xb26582[_0x560a('0x1c')](_0x36d4c8);return _0xb26582[_0x560a('0x21')](_0x560a('0x22'),_0x45816e+'-'+_0x13e8f4+'/'+_0x4c5707)[_0x560a('0x23')](_0x4d1635);}return null;};}function patchUpdates(_0x11667c){return function(_0x53a824){try{jsonpatch[_0x560a('0x24')](_0x53a824,_0x11667c,!![]);}catch(_0x140dbc){return BPromise[_0x560a('0x25')](_0x140dbc);}return _0x53a824[_0x560a('0x26')]();};}function saveUpdates(_0x5f2167,_0xb607d6){return function(_0x5a6097){if(_0x5a6097){return _0x5a6097[_0x560a('0x27')](_0x5f2167)['then'](function(_0x2f70f1){return _0x2f70f1;});}return null;};}function removeEntity(_0x24a863,_0x3ab88a){return function(_0x42d22a){if(_0x42d22a){return _0x42d22a[_0x560a('0x28')]()['then'](function(){_0x24a863[_0x560a('0x1c')](0xcc)[_0x560a('0x29')]();});}};}function handleEntityNotFound(_0xb5c3b2,_0x21e78e){return function(_0x5ae1c5){if(!_0x5ae1c5){_0xb5c3b2[_0x560a('0x1b')](0x194);}return _0x5ae1c5;};}function handleError(_0x34b71d,_0x257f73){_0x257f73=_0x257f73||0x1f4;return function(_0x5be65b){logger[_0x560a('0x2a')](_0x5be65b[_0x560a('0x2b')]);if(_0x5be65b[_0x560a('0x2c')]){delete _0x5be65b['name'];}_0x34b71d[_0x560a('0x1c')](_0x257f73)[_0x560a('0x2d')](_0x5be65b);};}exports[_0x560a('0x2e')]=function(_0x2e3e9f,_0x32bf3e){var _0x424930={},_0x4190e3={},_0xa479ea={'count':0x0,'rows':[]};var _0x170fb9=_[_0x560a('0x2f')](db[_0x560a('0x30')]['rawAttributes'],function(_0x4971a5){return{'name':_0x4971a5['fieldName'],'type':_0x4971a5[_0x560a('0x31')][_0x560a('0x32')]};});_0x4190e3[_0x560a('0x33')]=_[_0x560a('0x2f')](_0x170fb9,_0x560a('0x2c'));_0x4190e3['query']=_[_0x560a('0x34')](_0x2e3e9f[_0x560a('0x35')]);_0x4190e3['filters']=_[_0x560a('0x36')](_0x4190e3[_0x560a('0x33')],_0x4190e3[_0x560a('0x35')]);_0x424930[_0x560a('0x37')]=_[_0x560a('0x36')](_0x4190e3[_0x560a('0x33')],qs[_0x560a('0x38')](_0x2e3e9f[_0x560a('0x35')][_0x560a('0x38')]));_0x424930[_0x560a('0x37')]=_0x424930['attributes'][_0x560a('0x39')]?_0x424930[_0x560a('0x37')]:_0x4190e3[_0x560a('0x33')];if(!_0x2e3e9f['query'][_0x560a('0x3a')](_0x560a('0x3b'))){_0x424930[_0x560a('0x1f')]=qs[_0x560a('0x1f')](_0x2e3e9f[_0x560a('0x35')][_0x560a('0x1f')]);_0x424930[_0x560a('0x1d')]=qs['offset'](_0x2e3e9f[_0x560a('0x35')][_0x560a('0x1d')]);}_0x424930[_0x560a('0x3c')]=qs['sort'](_0x2e3e9f['query'][_0x560a('0x3d')]);_0x424930[_0x560a('0x3e')]=qs[_0x560a('0x3f')](_['pick'](_0x2e3e9f['query'],_0x4190e3[_0x560a('0x3f')]),_0x170fb9);if(_0x2e3e9f[_0x560a('0x35')][_0x560a('0x40')]){_0x424930[_0x560a('0x3e')]=_[_0x560a('0x41')](_0x424930[_0x560a('0x3e')],{'$or':_[_0x560a('0x2f')](_0x170fb9,function(_0xadcda0){if(_0xadcda0['type']!=='VIRTUAL'){var _0x12f1d2={};_0x12f1d2[_0xadcda0[_0x560a('0x2c')]]={'$like':'%'+_0x2e3e9f[_0x560a('0x35')][_0x560a('0x40')]+'%'};return _0x12f1d2;}})});}_0x424930=_[_0x560a('0x41')]({},_0x424930,_0x2e3e9f[_0x560a('0x42')]);var _0x535a2d={'where':_0x424930[_0x560a('0x3e')]};return db[_0x560a('0x30')][_0x560a('0x20')](_0x535a2d)[_0x560a('0x43')](function(_0x2b27ff){_0xa479ea[_0x560a('0x20')]=_0x2b27ff;if(_0x2e3e9f[_0x560a('0x35')]['includeAll']){_0x424930[_0x560a('0x44')]=[{'all':!![]}];}return db['MailServerOut'][_0x560a('0x45')](_0x424930);})[_0x560a('0x43')](function(_0x2ac025){_0xa479ea[_0x560a('0x46')]=_0x2ac025;return _0xa479ea;})[_0x560a('0x43')](respondWithFilteredResult(_0x32bf3e,_0x424930))[_0x560a('0x47')](handleError(_0x32bf3e,null));};exports[_0x560a('0x48')]=function(_0x52c011,_0x3c31e7){var _0x4864e5={'raw':!![],'where':{'id':_0x52c011[_0x560a('0x49')]['id']}},_0x3b724a={};_0x3b724a[_0x560a('0x33')]=_['keys'](db['MailServerOut'][_0x560a('0x4a')]);_0x3b724a[_0x560a('0x35')]=_['keys'](_0x52c011[_0x560a('0x35')]);_0x3b724a[_0x560a('0x3f')]=_['intersection'](_0x3b724a['model'],_0x3b724a[_0x560a('0x35')]);_0x4864e5[_0x560a('0x37')]=_[_0x560a('0x36')](_0x3b724a['model'],qs[_0x560a('0x38')](_0x52c011['query'][_0x560a('0x38')]));_0x4864e5[_0x560a('0x37')]=_0x4864e5[_0x560a('0x37')][_0x560a('0x39')]?_0x4864e5[_0x560a('0x37')]:_0x3b724a['model'];if(_0x52c011[_0x560a('0x35')][_0x560a('0x4b')]){_0x4864e5['include']=[{'all':!![]}];}_0x4864e5=_[_0x560a('0x41')]({},_0x4864e5,_0x52c011[_0x560a('0x42')]);return db[_0x560a('0x30')][_0x560a('0x4c')](_0x4864e5)[_0x560a('0x43')](handleEntityNotFound(_0x3c31e7,null))[_0x560a('0x43')](respondWithResult(_0x3c31e7,null))[_0x560a('0x47')](handleError(_0x3c31e7,null));};exports[_0x560a('0x4d')]=function(_0x385cb7,_0x52232c){return db[_0x560a('0x30')][_0x560a('0x4d')](_0x385cb7[_0x560a('0x4e')],{})[_0x560a('0x43')](respondWithResult(_0x52232c,0xc9))[_0x560a('0x47')](handleError(_0x52232c,null));};exports[_0x560a('0x27')]=function(_0x407d96,_0x507d60){if(_0x407d96[_0x560a('0x4e')]['id']){delete _0x407d96[_0x560a('0x4e')]['id'];}return db[_0x560a('0x30')][_0x560a('0x4c')]({'where':{'id':_0x407d96[_0x560a('0x49')]['id']}})[_0x560a('0x43')](handleEntityNotFound(_0x507d60,null))[_0x560a('0x43')](saveUpdates(_0x407d96[_0x560a('0x4e')],null))['then'](respondWithResult(_0x507d60,null))[_0x560a('0x47')](handleError(_0x507d60,null));};exports[_0x560a('0x28')]=function(_0x3156fa,_0x3f2b83){return db['MailServerOut']['find']({'where':{'id':_0x3156fa['params']['id']}})[_0x560a('0x43')](handleEntityNotFound(_0x3f2b83,null))[_0x560a('0x43')](removeEntity(_0x3f2b83,null))[_0x560a('0x47')](handleError(_0x3f2b83,null));}; \ No newline at end of file +var _0x6e76=['undefined','count','limit','save','update','then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x6e76,0x189));var _0x66e7=function(_0x136f95,_0x2d5815){_0x136f95=_0x136f95-0x0;var _0x4cd94f=_0x6e76[_0x136f95];return _0x4cd94f;};'use strict';var emlformat=require(_0x66e7('0x0'));var rimraf=require(_0x66e7('0x1'));var zipdir=require(_0x66e7('0x2'));var jsonpatch=require(_0x66e7('0x3'));var rp=require('request-promise');var moment=require(_0x66e7('0x4'));var BPromise=require(_0x66e7('0x5'));var Mustache=require(_0x66e7('0x6'));var util=require(_0x66e7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x66e7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66e7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66e7('0xa'));var deskjs=require(_0x66e7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x66e7('0xc'));var Papa=require(_0x66e7('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x66e7('0xe'));var as=require(_0x66e7('0xf'));var hardwareService=require(_0x66e7('0x10'));var logger=require('../../config/logger')(_0x66e7('0x11'));var utils=require(_0x66e7('0x12'));var config=require(_0x66e7('0x13'));var licenseUtil=require(_0x66e7('0x14'));var db=require(_0x66e7('0x15'))['db'];function respondWithStatusCode(_0x472f8f,_0x3a2486){_0x3a2486=_0x3a2486||0xcc;return function(_0x18de3b){if(_0x18de3b){return _0x472f8f[_0x66e7('0x16')](_0x3a2486);}return _0x472f8f['status'](_0x3a2486)[_0x66e7('0x17')]();};}function respondWithResult(_0x507878,_0x4c107c){_0x4c107c=_0x4c107c||0xc8;return function(_0x229ad4){if(_0x229ad4){return _0x507878[_0x66e7('0x18')](_0x4c107c)[_0x66e7('0x19')](_0x229ad4);}};}function respondWithFilteredResult(_0x13fd08,_0x408551){return function(_0x239f0e){if(_0x239f0e){var _0x588fdb=typeof _0x408551[_0x66e7('0x1a')]===_0x66e7('0x1b')&&typeof _0x408551['limit']===_0x66e7('0x1b');var _0x540e60=_0x239f0e['count'];var _0xb5255=_0x588fdb?0x0:_0x408551[_0x66e7('0x1a')];var _0x1ad397=_0x588fdb?_0x239f0e[_0x66e7('0x1c')]:_0x408551[_0x66e7('0x1a')]+_0x408551[_0x66e7('0x1d')];var _0x140c85;if(_0x1ad397>=_0x540e60){_0x1ad397=_0x540e60;_0x140c85=0xc8;}else{_0x140c85=0xce;}_0x13fd08['status'](_0x140c85);return _0x13fd08['set']('Content-Range',_0xb5255+'-'+_0x1ad397+'/'+_0x540e60)['json'](_0x239f0e);}return null;};}function patchUpdates(_0x1214da){return function(_0x39e8ef){try{jsonpatch['apply'](_0x39e8ef,_0x1214da,!![]);}catch(_0x1113d3){return BPromise['reject'](_0x1113d3);}return _0x39e8ef[_0x66e7('0x1e')]();};}function saveUpdates(_0x1666b4,_0x25143b){return function(_0x57c170){if(_0x57c170){return _0x57c170[_0x66e7('0x1f')](_0x1666b4)[_0x66e7('0x20')](function(_0x1a9e2e){return _0x1a9e2e;});}return null;};}function removeEntity(_0x1108b3,_0xd3a4eb){return function(_0x1109f7){if(_0x1109f7){return _0x1109f7[_0x66e7('0x21')]()[_0x66e7('0x20')](function(){_0x1108b3['status'](0xcc)[_0x66e7('0x17')]();});}};}function handleEntityNotFound(_0x59bc22,_0x43f76d){return function(_0x2d3745){if(!_0x2d3745){_0x59bc22['sendStatus'](0x194);}return _0x2d3745;};}function handleError(_0x14eac4,_0x20f31c){_0x20f31c=_0x20f31c||0x1f4;return function(_0xd3db4b){logger[_0x66e7('0x22')](_0xd3db4b[_0x66e7('0x23')]);if(_0xd3db4b[_0x66e7('0x24')]){delete _0xd3db4b[_0x66e7('0x24')];}_0x14eac4[_0x66e7('0x18')](_0x20f31c)['send'](_0xd3db4b);};}exports[_0x66e7('0x25')]=function(_0x4e825d,_0x6425c8){var _0x5a5aca={},_0x247198={},_0x5ef4f9={'count':0x0,'rows':[]};var _0x2c7707=_[_0x66e7('0x26')](db[_0x66e7('0x27')][_0x66e7('0x28')],function(_0x4ad099){return{'name':_0x4ad099[_0x66e7('0x29')],'type':_0x4ad099[_0x66e7('0x2a')][_0x66e7('0x2b')]};});_0x247198[_0x66e7('0x2c')]=_[_0x66e7('0x26')](_0x2c7707,_0x66e7('0x24'));_0x247198['query']=_[_0x66e7('0x2d')](_0x4e825d[_0x66e7('0x2e')]);_0x247198[_0x66e7('0x2f')]=_[_0x66e7('0x30')](_0x247198[_0x66e7('0x2c')],_0x247198[_0x66e7('0x2e')]);_0x5a5aca[_0x66e7('0x31')]=_['intersection'](_0x247198['model'],qs['fields'](_0x4e825d[_0x66e7('0x2e')][_0x66e7('0x32')]));_0x5a5aca['attributes']=_0x5a5aca['attributes'][_0x66e7('0x33')]?_0x5a5aca[_0x66e7('0x31')]:_0x247198['model'];if(!_0x4e825d[_0x66e7('0x2e')][_0x66e7('0x34')](_0x66e7('0x35'))){_0x5a5aca['limit']=qs[_0x66e7('0x1d')](_0x4e825d[_0x66e7('0x2e')][_0x66e7('0x1d')]);_0x5a5aca[_0x66e7('0x1a')]=qs['offset'](_0x4e825d[_0x66e7('0x2e')][_0x66e7('0x1a')]);}_0x5a5aca[_0x66e7('0x36')]=qs['sort'](_0x4e825d[_0x66e7('0x2e')][_0x66e7('0x37')]);_0x5a5aca[_0x66e7('0x38')]=qs[_0x66e7('0x2f')](_[_0x66e7('0x39')](_0x4e825d[_0x66e7('0x2e')],_0x247198['filters']),_0x2c7707);if(_0x4e825d[_0x66e7('0x2e')][_0x66e7('0x3a')]){_0x5a5aca[_0x66e7('0x38')]=_[_0x66e7('0x3b')](_0x5a5aca[_0x66e7('0x38')],{'$or':_[_0x66e7('0x26')](_0x2c7707,function(_0x3997c1){if(_0x3997c1[_0x66e7('0x2a')]!==_0x66e7('0x3c')){var _0x249119={};_0x249119[_0x3997c1[_0x66e7('0x24')]]={'$like':'%'+_0x4e825d[_0x66e7('0x2e')]['filter']+'%'};return _0x249119;}})});}_0x5a5aca=_[_0x66e7('0x3b')]({},_0x5a5aca,_0x4e825d[_0x66e7('0x3d')]);var _0x286e2c={'where':_0x5a5aca['where']};return db[_0x66e7('0x27')]['count'](_0x286e2c)[_0x66e7('0x20')](function(_0x1f9d44){_0x5ef4f9[_0x66e7('0x1c')]=_0x1f9d44;if(_0x4e825d['query'][_0x66e7('0x3e')]){_0x5a5aca[_0x66e7('0x3f')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x5a5aca);})[_0x66e7('0x20')](function(_0x693283){_0x5ef4f9[_0x66e7('0x40')]=_0x693283;return _0x5ef4f9;})[_0x66e7('0x20')](respondWithFilteredResult(_0x6425c8,_0x5a5aca))[_0x66e7('0x41')](handleError(_0x6425c8,null));};exports['show']=function(_0x4e181e,_0x56a31b){var _0x524c40={'raw':!![],'where':{'id':_0x4e181e[_0x66e7('0x42')]['id']}},_0x2a4a8a={};_0x2a4a8a[_0x66e7('0x2c')]=_[_0x66e7('0x2d')](db[_0x66e7('0x27')][_0x66e7('0x28')]);_0x2a4a8a[_0x66e7('0x2e')]=_[_0x66e7('0x2d')](_0x4e181e[_0x66e7('0x2e')]);_0x2a4a8a[_0x66e7('0x2f')]=_[_0x66e7('0x30')](_0x2a4a8a[_0x66e7('0x2c')],_0x2a4a8a['query']);_0x524c40[_0x66e7('0x31')]=_[_0x66e7('0x30')](_0x2a4a8a['model'],qs[_0x66e7('0x32')](_0x4e181e['query'][_0x66e7('0x32')]));_0x524c40[_0x66e7('0x31')]=_0x524c40[_0x66e7('0x31')][_0x66e7('0x33')]?_0x524c40[_0x66e7('0x31')]:_0x2a4a8a[_0x66e7('0x2c')];if(_0x4e181e[_0x66e7('0x2e')]['includeAll']){_0x524c40[_0x66e7('0x3f')]=[{'all':!![]}];}_0x524c40=_[_0x66e7('0x3b')]({},_0x524c40,_0x4e181e['options']);return db['MailServerOut'][_0x66e7('0x43')](_0x524c40)[_0x66e7('0x20')](handleEntityNotFound(_0x56a31b,null))[_0x66e7('0x20')](respondWithResult(_0x56a31b,null))[_0x66e7('0x41')](handleError(_0x56a31b,null));};exports[_0x66e7('0x44')]=function(_0x327caf,_0x511f98){return db['MailServerOut'][_0x66e7('0x44')](_0x327caf[_0x66e7('0x45')],{})[_0x66e7('0x20')](respondWithResult(_0x511f98,0xc9))[_0x66e7('0x41')](handleError(_0x511f98,null));};exports[_0x66e7('0x1f')]=function(_0x3dc8cf,_0x29bcf0){if(_0x3dc8cf['body']['id']){delete _0x3dc8cf[_0x66e7('0x45')]['id'];}return db['MailServerOut'][_0x66e7('0x43')]({'where':{'id':_0x3dc8cf[_0x66e7('0x42')]['id']}})[_0x66e7('0x20')](handleEntityNotFound(_0x29bcf0,null))[_0x66e7('0x20')](saveUpdates(_0x3dc8cf[_0x66e7('0x45')],null))[_0x66e7('0x20')](respondWithResult(_0x29bcf0,null))['catch'](handleError(_0x29bcf0,null));};exports['destroy']=function(_0x17bb8e,_0x4fba12){return db[_0x66e7('0x27')][_0x66e7('0x43')]({'where':{'id':_0x17bb8e[_0x66e7('0x42')]['id']}})[_0x66e7('0x20')](handleEntityNotFound(_0x4fba12,null))[_0x66e7('0x20')](removeEntity(_0x4fba12,null))[_0x66e7('0x41')](handleError(_0x4fba12,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index ceb36c3..4cfac7c 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 _0xec8a=['path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x132c24,_0x13248e){var _0x176231=function(_0x11d11b){while(--_0x11d11b){_0x132c24['push'](_0x132c24['shift']());}};_0x176231(++_0x13248e);}(_0xec8a,0x67));var _0xaec8=function(_0x4732bd,_0x142db4){_0x4732bd=_0x4732bd-0x0;var _0x57f607=_0xec8a[_0x4732bd];return _0x57f607;};'use strict';var _=require(_0xaec8('0x0'));var util=require(_0xaec8('0x1'));var logger=require(_0xaec8('0x2'))(_0xaec8('0x3'));var moment=require(_0xaec8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaec8('0x5'));var rimraf=require('rimraf');var config=require(_0xaec8('0x6'));var attributes=require(_0xaec8('0x7'));module[_0xaec8('0x8')]=function(_0x393141,_0x4b2565){return _0x393141[_0xaec8('0x9')](_0xaec8('0xa'),attributes,{'tableName':_0xaec8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcda6=['exports','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./mailServerOut.attributes'];(function(_0x313055,_0x3c8844){var _0x39b471=function(_0x482be0){while(--_0x482be0){_0x313055['push'](_0x313055['shift']());}};_0x39b471(++_0x3c8844);}(_0xcda6,0x1b0));var _0x6cda=function(_0x302499,_0x5ee831){_0x302499=_0x302499-0x0;var _0x11d447=_0xcda6[_0x302499];return _0x11d447;};'use strict';var _=require(_0x6cda('0x0'));var util=require('util');var logger=require(_0x6cda('0x1'))(_0x6cda('0x2'));var moment=require(_0x6cda('0x3'));var BPromise=require(_0x6cda('0x4'));var rp=require(_0x6cda('0x5'));var fs=require('fs');var path=require(_0x6cda('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6cda('0x7'));module[_0x6cda('0x8')]=function(_0x357b2a,_0x2565de){return _0x357b2a['define'](_0x6cda('0x9'),attributes,{'tableName':_0x6cda('0xa'),'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 0617fc9..a9fb9b0 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2b67df,_0x1ff377){var _0xc9df37=function(_0x7b7f06){while(--_0x7b7f06){_0x2b67df['push'](_0x2b67df['shift']());}};_0xc9df37(++_0x1ff377);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b02ff,_0x4ce260){_0x5b02ff=_0x5b02ff-0x0;var _0xfe3187=_0x5f2f[_0x5b02ff];return _0xfe3187;};'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')]('MailServerOut,\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 +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x495847,_0x443271){_0x495847=_0x495847-0x0;var _0x59420e=_0x7a54[_0x495847];return _0x59420e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 503a3de..bd99002 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 _0x8598=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x3abadf,_0x33e3ba){var _0x3800b1=function(_0xc9eee4){while(--_0xc9eee4){_0x3abadf['push'](_0x3abadf['shift']());}};_0x3800b1(++_0x33e3ba);}(_0x8598,0xb8));var _0x8859=function(_0x351ce5,_0x150077){_0x351ce5=_0x351ce5-0x0;var _0x260035=_0x8598[_0x351ce5];return _0x260035;};'use strict';var multer=require(_0x8859('0x0'));var util=require(_0x8859('0x1'));var path=require(_0x8859('0x2'));var timeout=require(_0x8859('0x3'));var express=require(_0x8859('0x4'));var router=express[_0x8859('0x5')]();var fs_extra=require(_0x8859('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8859('0x7'));var config=require(_0x8859('0x8'));var controller=require(_0x8859('0x9'));router['get']('/',auth[_0x8859('0xa')](),controller[_0x8859('0xb')]);router[_0x8859('0xc')](_0x8859('0xd'),auth[_0x8859('0xa')](),controller[_0x8859('0xe')]);router[_0x8859('0xc')](_0x8859('0xf'),auth['isAuthenticated'](),controller[_0x8859('0x10')]);router[_0x8859('0x11')]('/',auth[_0x8859('0xa')](),controller[_0x8859('0x12')]);router[_0x8859('0x13')](_0x8859('0xf'),auth[_0x8859('0xa')](),controller['update']);router[_0x8859('0x14')](_0x8859('0xf'),auth[_0x8859('0xa')](),controller[_0x8859('0x15')]);module[_0x8859('0x16')]=router; \ No newline at end of file +var _0xb8d0=['describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./mailSubstatus.controller','get','isAuthenticated'];(function(_0x2e1180,_0x4c56e1){var _0x11b7e9=function(_0x155e4b){while(--_0x155e4b){_0x2e1180['push'](_0x2e1180['shift']());}};_0x11b7e9(++_0x4c56e1);}(_0xb8d0,0xf2));var _0x0b8d=function(_0x3c4205,_0x59d1f5){_0x3c4205=_0x3c4205-0x0;var _0x4ff0a5=_0xb8d0[_0x3c4205];return _0x4ff0a5;};'use strict';var multer=require(_0x0b8d('0x0'));var util=require(_0x0b8d('0x1'));var path=require(_0x0b8d('0x2'));var timeout=require(_0x0b8d('0x3'));var express=require('express');var router=express[_0x0b8d('0x4')]();var fs_extra=require(_0x0b8d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0b8d('0x6'));var controller=require(_0x0b8d('0x7'));router[_0x0b8d('0x8')]('/',auth[_0x0b8d('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0b8d('0xa')]);router[_0x0b8d('0x8')](_0x0b8d('0xb'),auth[_0x0b8d('0x9')](),controller['show']);router[_0x0b8d('0xc')]('/',auth[_0x0b8d('0x9')](),controller['create']);router[_0x0b8d('0xd')]('/:id',auth[_0x0b8d('0x9')](),controller[_0x0b8d('0xe')]);router[_0x0b8d('0xf')](_0x0b8d('0xb'),auth[_0x0b8d('0x9')](),controller[_0x0b8d('0x10')]);module[_0x0b8d('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d64a74c..a430d11 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 _0x1b65=['sequelize','exports','STRING','name'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1b65,0x1b4));var _0x51b6=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x1b65[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0x51b6('0x0'));module[_0x51b6('0x1')]={'name':{'type':Sequelize[_0x51b6('0x2')],'unique':_0x51b6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf98=['STRING','sequelize'];(function(_0x550bae,_0x1c6162){var _0x6f0360=function(_0x59ff02){while(--_0x59ff02){_0x550bae['push'](_0x550bae['shift']());}};_0x6f0360(++_0x1c6162);}(_0xdf98,0xcf));var _0x8df9=function(_0x30d719,_0x22729b){_0x30d719=_0x30d719-0x0;var _0x21358e=_0xdf98[_0x30d719];return _0x21358e;};'use strict';var Sequelize=require(_0x8df9('0x0'));module['exports']={'name':{'type':Sequelize[_0x8df9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1eec8c3..a5a2874 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 _0x6fff=['save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','reject'];(function(_0x29cb7e,_0x3b5115){var _0x592c87=function(_0x17b042){while(--_0x17b042){_0x29cb7e['push'](_0x29cb7e['shift']());}};_0x592c87(++_0x3b5115);}(_0x6fff,0x160));var _0xf6ff=function(_0x1044a9,_0x308711){_0x1044a9=_0x1044a9-0x0;var _0x293921=_0x6fff[_0x1044a9];return _0x293921;};'use strict';var emlformat=require(_0xf6ff('0x0'));var rimraf=require(_0xf6ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf6ff('0x2'));var moment=require('moment');var BPromise=require(_0xf6ff('0x3'));var Mustache=require(_0xf6ff('0x4'));var util=require(_0xf6ff('0x5'));var path=require(_0xf6ff('0x6'));var sox=require(_0xf6ff('0x7'));var csv=require(_0xf6ff('0x8'));var ejs=require(_0xf6ff('0x9'));var fs=require('fs');var fs_extra=require(_0xf6ff('0xa'));var _=require(_0xf6ff('0xb'));var squel=require(_0xf6ff('0xc'));var crypto=require(_0xf6ff('0xd'));var jsforce=require(_0xf6ff('0xe'));var deskjs=require(_0xf6ff('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf6ff('0x10'));var authService=require(_0xf6ff('0x11'));var qs=require(_0xf6ff('0x12'));var as=require(_0xf6ff('0x13'));var hardwareService=require(_0xf6ff('0x14'));var logger=require(_0xf6ff('0x15'))(_0xf6ff('0x16'));var utils=require(_0xf6ff('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf6ff('0x18'))['db'];function respondWithStatusCode(_0x21180d,_0x438b31){_0x438b31=_0x438b31||0xcc;return function(_0x2cdba8){if(_0x2cdba8){return _0x21180d[_0xf6ff('0x19')](_0x438b31);}return _0x21180d[_0xf6ff('0x1a')](_0x438b31)['end']();};}function respondWithResult(_0xe60004,_0x559d98){_0x559d98=_0x559d98||0xc8;return function(_0x57b385){if(_0x57b385){return _0xe60004[_0xf6ff('0x1a')](_0x559d98)[_0xf6ff('0x1b')](_0x57b385);}};}function respondWithFilteredResult(_0x3f17c2,_0x1c20ea){return function(_0x4bc4dc){if(_0x4bc4dc){var _0x212075=typeof _0x1c20ea['offset']===_0xf6ff('0x1c')&&typeof _0x1c20ea['limit']==='undefined';var _0x28f76f=_0x4bc4dc[_0xf6ff('0x1d')];var _0x13eddd=_0x212075?0x0:_0x1c20ea['offset'];var _0x552c11=_0x212075?_0x4bc4dc[_0xf6ff('0x1d')]:_0x1c20ea[_0xf6ff('0x1e')]+_0x1c20ea['limit'];var _0x2e0d3c;if(_0x552c11>=_0x28f76f){_0x552c11=_0x28f76f;_0x2e0d3c=0xc8;}else{_0x2e0d3c=0xce;}_0x3f17c2[_0xf6ff('0x1a')](_0x2e0d3c);return _0x3f17c2[_0xf6ff('0x1f')]('Content-Range',_0x13eddd+'-'+_0x552c11+'/'+_0x28f76f)[_0xf6ff('0x1b')](_0x4bc4dc);}return null;};}function patchUpdates(_0x37c585){return function(_0x4f5791){try{jsonpatch['apply'](_0x4f5791,_0x37c585,!![]);}catch(_0x20e10a){return BPromise[_0xf6ff('0x20')](_0x20e10a);}return _0x4f5791[_0xf6ff('0x21')]();};}function saveUpdates(_0x2469ca,_0x13086a){return function(_0x43feee){if(_0x43feee){return _0x43feee[_0xf6ff('0x22')](_0x2469ca)[_0xf6ff('0x23')](function(_0x4ac214){return _0x4ac214;});}return null;};}function removeEntity(_0x56ec18,_0x5150fb){return function(_0x27cafb){if(_0x27cafb){return _0x27cafb[_0xf6ff('0x24')]()[_0xf6ff('0x23')](function(){_0x56ec18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5049b9,_0x39333e){return function(_0x252a18){if(!_0x252a18){_0x5049b9[_0xf6ff('0x19')](0x194);}return _0x252a18;};}function handleError(_0x27c93d,_0x3c6a94){_0x3c6a94=_0x3c6a94||0x1f4;return function(_0x5de968){logger[_0xf6ff('0x25')](_0x5de968[_0xf6ff('0x26')]);if(_0x5de968[_0xf6ff('0x27')]){delete _0x5de968['name'];}_0x27c93d['status'](_0x3c6a94)[_0xf6ff('0x28')](_0x5de968);};}exports[_0xf6ff('0x29')]=function(_0x22615a,_0x1ae6e3){var _0x32eb66={},_0xfc152b={},_0x5a3acb={'count':0x0,'rows':[]};var _0x5e12c4=_[_0xf6ff('0x2a')](db[_0xf6ff('0x2b')][_0xf6ff('0x2c')],function(_0x1ee60b){return{'name':_0x1ee60b[_0xf6ff('0x2d')],'type':_0x1ee60b[_0xf6ff('0x2e')][_0xf6ff('0x2f')]};});_0xfc152b[_0xf6ff('0x30')]=_[_0xf6ff('0x2a')](_0x5e12c4,'name');_0xfc152b[_0xf6ff('0x31')]=_[_0xf6ff('0x32')](_0x22615a[_0xf6ff('0x31')]);_0xfc152b[_0xf6ff('0x33')]=_['intersection'](_0xfc152b[_0xf6ff('0x30')],_0xfc152b['query']);_0x32eb66[_0xf6ff('0x34')]=_[_0xf6ff('0x35')](_0xfc152b[_0xf6ff('0x30')],qs[_0xf6ff('0x36')](_0x22615a[_0xf6ff('0x31')]['fields']));_0x32eb66[_0xf6ff('0x34')]=_0x32eb66['attributes']['length']?_0x32eb66[_0xf6ff('0x34')]:_0xfc152b[_0xf6ff('0x30')];if(!_0x22615a[_0xf6ff('0x31')][_0xf6ff('0x37')](_0xf6ff('0x38'))){_0x32eb66['limit']=qs[_0xf6ff('0x39')](_0x22615a[_0xf6ff('0x31')][_0xf6ff('0x39')]);_0x32eb66['offset']=qs[_0xf6ff('0x1e')](_0x22615a['query'][_0xf6ff('0x1e')]);}_0x32eb66[_0xf6ff('0x3a')]=qs[_0xf6ff('0x3b')](_0x22615a['query'][_0xf6ff('0x3b')]);_0x32eb66[_0xf6ff('0x3c')]=qs[_0xf6ff('0x33')](_[_0xf6ff('0x3d')](_0x22615a['query'],_0xfc152b[_0xf6ff('0x33')]),_0x5e12c4);if(_0x22615a['query'][_0xf6ff('0x3e')]){_0x32eb66[_0xf6ff('0x3c')]=_[_0xf6ff('0x3f')](_0x32eb66[_0xf6ff('0x3c')],{'$or':_[_0xf6ff('0x2a')](_0x5e12c4,function(_0xe26cf0){if(_0xe26cf0['type']!=='VIRTUAL'){var _0x3d2736={};_0x3d2736[_0xe26cf0[_0xf6ff('0x27')]]={'$like':'%'+_0x22615a[_0xf6ff('0x31')][_0xf6ff('0x3e')]+'%'};return _0x3d2736;}})});}_0x32eb66=_[_0xf6ff('0x3f')]({},_0x32eb66,_0x22615a[_0xf6ff('0x40')]);var _0x14b65e={'where':_0x32eb66['where']};return db['MailSubstatus'][_0xf6ff('0x1d')](_0x14b65e)[_0xf6ff('0x23')](function(_0x519557){_0x5a3acb['count']=_0x519557;if(_0x22615a['query'][_0xf6ff('0x41')]){_0x32eb66[_0xf6ff('0x42')]=[{'all':!![]}];}return db[_0xf6ff('0x2b')][_0xf6ff('0x43')](_0x32eb66);})[_0xf6ff('0x23')](function(_0x188ab4){_0x5a3acb[_0xf6ff('0x44')]=_0x188ab4;return _0x5a3acb;})[_0xf6ff('0x23')](respondWithFilteredResult(_0x1ae6e3,_0x32eb66))[_0xf6ff('0x45')](handleError(_0x1ae6e3,null));};exports[_0xf6ff('0x46')]=function(_0x2db692,_0x902867){var _0x160501={'raw':!![],'where':{'id':_0x2db692[_0xf6ff('0x47')]['id']}},_0x3b2ee3={};_0x3b2ee3[_0xf6ff('0x30')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0x3b2ee3[_0xf6ff('0x31')]=_[_0xf6ff('0x32')](_0x2db692[_0xf6ff('0x31')]);_0x3b2ee3[_0xf6ff('0x33')]=_[_0xf6ff('0x35')](_0x3b2ee3['model'],_0x3b2ee3[_0xf6ff('0x31')]);_0x160501[_0xf6ff('0x34')]=_[_0xf6ff('0x35')](_0x3b2ee3[_0xf6ff('0x30')],qs[_0xf6ff('0x36')](_0x2db692[_0xf6ff('0x31')][_0xf6ff('0x36')]));_0x160501[_0xf6ff('0x34')]=_0x160501['attributes'][_0xf6ff('0x48')]?_0x160501[_0xf6ff('0x34')]:_0x3b2ee3['model'];if(_0x2db692['query'][_0xf6ff('0x41')]){_0x160501[_0xf6ff('0x42')]=[{'all':!![]}];}_0x160501=_[_0xf6ff('0x3f')]({},_0x160501,_0x2db692[_0xf6ff('0x40')]);return db[_0xf6ff('0x2b')][_0xf6ff('0x49')](_0x160501)[_0xf6ff('0x23')](handleEntityNotFound(_0x902867,null))[_0xf6ff('0x23')](respondWithResult(_0x902867,null))['catch'](handleError(_0x902867,null));};exports[_0xf6ff('0x4a')]=function(_0x449cd8,_0x1683a6){return db['MailSubstatus'][_0xf6ff('0x4a')](_0x449cd8['body'],{})[_0xf6ff('0x23')](respondWithResult(_0x1683a6,0xc9))[_0xf6ff('0x45')](handleError(_0x1683a6,null));};exports['update']=function(_0xcca4dd,_0x37ebbb){if(_0xcca4dd['body']['id']){delete _0xcca4dd[_0xf6ff('0x4b')]['id'];}return db[_0xf6ff('0x2b')][_0xf6ff('0x49')]({'where':{'id':_0xcca4dd[_0xf6ff('0x47')]['id']}})[_0xf6ff('0x23')](handleEntityNotFound(_0x37ebbb,null))[_0xf6ff('0x23')](saveUpdates(_0xcca4dd[_0xf6ff('0x4b')],null))[_0xf6ff('0x23')](respondWithResult(_0x37ebbb,null))[_0xf6ff('0x45')](handleError(_0x37ebbb,null));};exports[_0xf6ff('0x24')]=function(_0x542c96,_0x2ea883){return db['MailSubstatus'][_0xf6ff('0x49')]({'where':{'id':_0x542c96[_0xf6ff('0x47')]['id']}})[_0xf6ff('0x23')](handleEntityNotFound(_0x2ea883,null))[_0xf6ff('0x23')](removeEntity(_0x2ea883,null))[_0xf6ff('0x45')](handleError(_0x2ea883,null));};exports[_0xf6ff('0x4c')]=function(_0xc0d612,_0x5bb52f){return db[_0xf6ff('0x2b')][_0xf6ff('0x4c')]()[_0xf6ff('0x23')](respondWithResult(_0x5bb52f,null))['catch'](handleError(_0x5bb52f,null));}; \ No newline at end of file +var _0x4806=['length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields'];(function(_0x2aa8eb,_0x876986){var _0x2afc1b=function(_0xbc03ec){while(--_0xbc03ec){_0x2aa8eb['push'](_0x2aa8eb['shift']());}};_0x2afc1b(++_0x876986);}(_0x4806,0x12b));var _0x6480=function(_0x49efb2,_0x2338c6){_0x49efb2=_0x49efb2-0x0;var _0xeda1dd=_0x4806[_0x49efb2];return _0xeda1dd;};'use strict';var emlformat=require(_0x6480('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6480('0x1'));var rp=require('request-promise');var moment=require(_0x6480('0x2'));var BPromise=require(_0x6480('0x3'));var Mustache=require(_0x6480('0x4'));var util=require(_0x6480('0x5'));var path=require('path');var sox=require(_0x6480('0x6'));var csv=require(_0x6480('0x7'));var ejs=require(_0x6480('0x8'));var fs=require('fs');var fs_extra=require(_0x6480('0x9'));var _=require(_0x6480('0xa'));var squel=require('squel');var crypto=require(_0x6480('0xb'));var jsforce=require(_0x6480('0xc'));var deskjs=require(_0x6480('0xd'));var toCsv=require(_0x6480('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6480('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x6480('0xf'));var config=require(_0x6480('0x10'));var licenseUtil=require(_0x6480('0x11'));var db=require(_0x6480('0x12'))['db'];function respondWithStatusCode(_0x1b8ad9,_0x4e4097){_0x4e4097=_0x4e4097||0xcc;return function(_0x3f35b0){if(_0x3f35b0){return _0x1b8ad9[_0x6480('0x13')](_0x4e4097);}return _0x1b8ad9[_0x6480('0x14')](_0x4e4097)[_0x6480('0x15')]();};}function respondWithResult(_0x443ec7,_0x1a734c){_0x1a734c=_0x1a734c||0xc8;return function(_0x4a7bd7){if(_0x4a7bd7){return _0x443ec7[_0x6480('0x14')](_0x1a734c)[_0x6480('0x16')](_0x4a7bd7);}};}function respondWithFilteredResult(_0x331531,_0x85208e){return function(_0x2c611e){if(_0x2c611e){var _0x2e23de=typeof _0x85208e[_0x6480('0x17')]===_0x6480('0x18')&&typeof _0x85208e[_0x6480('0x19')]===_0x6480('0x18');var _0xf75825=_0x2c611e[_0x6480('0x1a')];var _0x5be4fa=_0x2e23de?0x0:_0x85208e[_0x6480('0x17')];var _0x470723=_0x2e23de?_0x2c611e[_0x6480('0x1a')]:_0x85208e[_0x6480('0x17')]+_0x85208e[_0x6480('0x19')];var _0x588d14;if(_0x470723>=_0xf75825){_0x470723=_0xf75825;_0x588d14=0xc8;}else{_0x588d14=0xce;}_0x331531[_0x6480('0x14')](_0x588d14);return _0x331531[_0x6480('0x1b')](_0x6480('0x1c'),_0x5be4fa+'-'+_0x470723+'/'+_0xf75825)[_0x6480('0x16')](_0x2c611e);}return null;};}function patchUpdates(_0x240970){return function(_0xb258a3){try{jsonpatch[_0x6480('0x1d')](_0xb258a3,_0x240970,!![]);}catch(_0x4c2af7){return BPromise[_0x6480('0x1e')](_0x4c2af7);}return _0xb258a3[_0x6480('0x1f')]();};}function saveUpdates(_0x5d3a9c,_0x1b361c){return function(_0x3bca3c){if(_0x3bca3c){return _0x3bca3c[_0x6480('0x20')](_0x5d3a9c)['then'](function(_0x328a50){return _0x328a50;});}return null;};}function removeEntity(_0x3d1481,_0x2aad7a){return function(_0x49a7d5){if(_0x49a7d5){return _0x49a7d5[_0x6480('0x21')]()[_0x6480('0x22')](function(){_0x3d1481[_0x6480('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9c49,_0x431f15){return function(_0x5ef22a){if(!_0x5ef22a){_0x5c9c49['sendStatus'](0x194);}return _0x5ef22a;};}function handleError(_0x1ee22b,_0x5a2df5){_0x5a2df5=_0x5a2df5||0x1f4;return function(_0xa9d7b1){logger[_0x6480('0x23')](_0xa9d7b1['stack']);if(_0xa9d7b1[_0x6480('0x24')]){delete _0xa9d7b1[_0x6480('0x24')];}_0x1ee22b[_0x6480('0x14')](_0x5a2df5)[_0x6480('0x25')](_0xa9d7b1);};}exports[_0x6480('0x26')]=function(_0x31f314,_0x43064d){var _0x1ba178={},_0x53c657={},_0x5909d1={'count':0x0,'rows':[]};var _0x57b6b4=_[_0x6480('0x27')](db[_0x6480('0x28')][_0x6480('0x29')],function(_0xbd437b){return{'name':_0xbd437b['fieldName'],'type':_0xbd437b[_0x6480('0x2a')][_0x6480('0x2b')]};});_0x53c657['model']=_[_0x6480('0x27')](_0x57b6b4,_0x6480('0x24'));_0x53c657[_0x6480('0x2c')]=_[_0x6480('0x2d')](_0x31f314['query']);_0x53c657[_0x6480('0x2e')]=_[_0x6480('0x2f')](_0x53c657['model'],_0x53c657['query']);_0x1ba178[_0x6480('0x30')]=_[_0x6480('0x2f')](_0x53c657[_0x6480('0x31')],qs[_0x6480('0x32')](_0x31f314[_0x6480('0x2c')][_0x6480('0x32')]));_0x1ba178[_0x6480('0x30')]=_0x1ba178['attributes'][_0x6480('0x33')]?_0x1ba178[_0x6480('0x30')]:_0x53c657[_0x6480('0x31')];if(!_0x31f314[_0x6480('0x2c')][_0x6480('0x34')](_0x6480('0x35'))){_0x1ba178[_0x6480('0x19')]=qs[_0x6480('0x19')](_0x31f314[_0x6480('0x2c')][_0x6480('0x19')]);_0x1ba178[_0x6480('0x17')]=qs['offset'](_0x31f314[_0x6480('0x2c')]['offset']);}_0x1ba178['order']=qs[_0x6480('0x36')](_0x31f314['query'][_0x6480('0x36')]);_0x1ba178[_0x6480('0x37')]=qs[_0x6480('0x2e')](_['pick'](_0x31f314[_0x6480('0x2c')],_0x53c657[_0x6480('0x2e')]),_0x57b6b4);if(_0x31f314['query']['filter']){_0x1ba178[_0x6480('0x37')]=_[_0x6480('0x38')](_0x1ba178[_0x6480('0x37')],{'$or':_[_0x6480('0x27')](_0x57b6b4,function(_0x39f5f8){if(_0x39f5f8[_0x6480('0x2a')]!==_0x6480('0x39')){var _0x208843={};_0x208843[_0x39f5f8[_0x6480('0x24')]]={'$like':'%'+_0x31f314[_0x6480('0x2c')]['filter']+'%'};return _0x208843;}})});}_0x1ba178=_[_0x6480('0x38')]({},_0x1ba178,_0x31f314[_0x6480('0x3a')]);var _0x17eb58={'where':_0x1ba178[_0x6480('0x37')]};return db['MailSubstatus'][_0x6480('0x1a')](_0x17eb58)[_0x6480('0x22')](function(_0x433bfc){_0x5909d1[_0x6480('0x1a')]=_0x433bfc;if(_0x31f314[_0x6480('0x2c')][_0x6480('0x3b')]){_0x1ba178['include']=[{'all':!![]}];}return db[_0x6480('0x28')][_0x6480('0x3c')](_0x1ba178);})[_0x6480('0x22')](function(_0x53d7db){_0x5909d1[_0x6480('0x3d')]=_0x53d7db;return _0x5909d1;})[_0x6480('0x22')](respondWithFilteredResult(_0x43064d,_0x1ba178))[_0x6480('0x3e')](handleError(_0x43064d,null));};exports[_0x6480('0x3f')]=function(_0x418e0e,_0x2dfd0a){var _0x54f750={'raw':!![],'where':{'id':_0x418e0e[_0x6480('0x40')]['id']}},_0x5ce11f={};_0x5ce11f[_0x6480('0x31')]=_['keys'](db[_0x6480('0x28')][_0x6480('0x29')]);_0x5ce11f[_0x6480('0x2c')]=_[_0x6480('0x2d')](_0x418e0e['query']);_0x5ce11f[_0x6480('0x2e')]=_[_0x6480('0x2f')](_0x5ce11f[_0x6480('0x31')],_0x5ce11f[_0x6480('0x2c')]);_0x54f750['attributes']=_[_0x6480('0x2f')](_0x5ce11f[_0x6480('0x31')],qs['fields'](_0x418e0e['query']['fields']));_0x54f750[_0x6480('0x30')]=_0x54f750['attributes']['length']?_0x54f750['attributes']:_0x5ce11f['model'];if(_0x418e0e[_0x6480('0x2c')][_0x6480('0x3b')]){_0x54f750[_0x6480('0x41')]=[{'all':!![]}];}_0x54f750=_[_0x6480('0x38')]({},_0x54f750,_0x418e0e[_0x6480('0x3a')]);return db[_0x6480('0x28')][_0x6480('0x42')](_0x54f750)[_0x6480('0x22')](handleEntityNotFound(_0x2dfd0a,null))[_0x6480('0x22')](respondWithResult(_0x2dfd0a,null))[_0x6480('0x3e')](handleError(_0x2dfd0a,null));};exports[_0x6480('0x43')]=function(_0x28907b,_0x430f67){return db['MailSubstatus']['create'](_0x28907b[_0x6480('0x44')],{})['then'](respondWithResult(_0x430f67,0xc9))[_0x6480('0x3e')](handleError(_0x430f67,null));};exports['update']=function(_0x409259,_0x438a9d){if(_0x409259['body']['id']){delete _0x409259[_0x6480('0x44')]['id'];}return db[_0x6480('0x28')]['find']({'where':{'id':_0x409259[_0x6480('0x40')]['id']}})[_0x6480('0x22')](handleEntityNotFound(_0x438a9d,null))[_0x6480('0x22')](saveUpdates(_0x409259['body'],null))[_0x6480('0x22')](respondWithResult(_0x438a9d,null))[_0x6480('0x3e')](handleError(_0x438a9d,null));};exports[_0x6480('0x21')]=function(_0x1086ef,_0x111d8d){return db['MailSubstatus'][_0x6480('0x42')]({'where':{'id':_0x1086ef[_0x6480('0x40')]['id']}})[_0x6480('0x22')](handleEntityNotFound(_0x111d8d,null))['then'](removeEntity(_0x111d8d,null))[_0x6480('0x3e')](handleError(_0x111d8d,null));};exports[_0x6480('0x45')]=function(_0x270d89,_0x371160){return db[_0x6480('0x28')][_0x6480('0x45')]()[_0x6480('0x22')](respondWithResult(_0x371160,null))[_0x6480('0x3e')](handleError(_0x371160,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 05e613a..ac0e0b1 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 _0x28ad=['events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0xb0cfd8,_0x5e6b2a){var _0x429bd6=function(_0x3e7b7c){while(--_0x3e7b7c){_0xb0cfd8['push'](_0xb0cfd8['shift']());}};_0x429bd6(++_0x5e6b2a);}(_0x28ad,0x180));var _0xd28a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28ad[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xd28a('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xd28a('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd28a('0x2')](0x0);var events={'afterUpdate':_0xd28a('0x3')};function emitEvent(_0x4180be){return function(_0x455e13,_0x529dd4,_0x33289b){MailSubstatusEvents[_0xd28a('0x4')](_0x4180be+':'+_0x455e13['id'],_0x455e13);MailSubstatusEvents[_0xd28a('0x4')](_0x4180be,_0x455e13);_0x33289b(null);};}for(var e in events){if(events[_0xd28a('0x5')](e)){var event=events[e];MailSubstatus[_0xd28a('0x6')](e,emitEvent(event));}}module[_0xd28a('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xe0ce=['hasOwnProperty','hook','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x18e3b3,_0x3e631d){var _0xbb7bc7=function(_0x44c41b){while(--_0x44c41b){_0x18e3b3['push'](_0x18e3b3['shift']());}};_0xbb7bc7(++_0x3e631d);}(_0xe0ce,0xba));var _0xee0c=function(_0x508d1,_0xc0c0e5){_0x508d1=_0x508d1-0x0;var _0x322d8d=_0xe0ce[_0x508d1];return _0x322d8d;};'use strict';var EventEmitter=require(_0xee0c('0x0'));var MailSubstatus=require(_0xee0c('0x1'))['db'][_0xee0c('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xee0c('0x3')](0x0);var events={'afterUpdate':_0xee0c('0x4')};function emitEvent(_0x3b276a){return function(_0x488961,_0x56e370,_0x446a65){MailSubstatusEvents[_0xee0c('0x5')](_0x3b276a+':'+_0x488961['id'],_0x488961);MailSubstatusEvents[_0xee0c('0x5')](_0x3b276a,_0x488961);_0x446a65(null);};}for(var e in events){if(events[_0xee0c('0x6')](e)){var event=events[e];MailSubstatus[_0xee0c('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 9af608a..a2b7486 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 _0x2758=['catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x57d503,_0x29a81e){var _0x3d00ac=function(_0x3223c9){while(--_0x3223c9){_0x57d503['push'](_0x57d503['shift']());}};_0x3d00ac(++_0x29a81e);}(_0x2758,0x91));var _0x8275=function(_0x477387,_0x4ef439){_0x477387=_0x477387-0x0;var _0x2cdbd4=_0x2758[_0x477387];return _0x2cdbd4;};'use strict';var attributes=require(_0x8275('0x0'));module[_0x8275('0x1')]=function(_0x3d2eff){var _0x330e58=_0x3d2eff[_0x8275('0x2')];return _0x3d2eff[_0x8275('0x3')](_0x8275('0x4'),attributes,{'tableName':_0x8275('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x556832,_0x343393,_0x38eb01){return _0x330e58['Condition'][_0x8275('0x6')]({'value':_0x556832[_0x8275('0x7')]},{'where':{'field':_0x8275('0x8'),'value':_0x556832[_0x8275('0x9')][_0x8275('0x7')]}})[_0x8275('0xa')](function(){_0x38eb01();})[_0x8275('0xb')](function(_0x138e19){_0x38eb01(_0x138e19);});}}});}; \ No newline at end of file +var _0x89e2=['define','MailSubstatus','mail_substatuses','Condition','update','name','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x9bdd99,_0x5722cc){var _0x443371=function(_0x38e01c){while(--_0x38e01c){_0x9bdd99['push'](_0x9bdd99['shift']());}};_0x443371(++_0x5722cc);}(_0x89e2,0xc7));var _0x289e=function(_0x26330c,_0x5274fa){_0x26330c=_0x26330c-0x0;var _0x3c258e=_0x89e2[_0x26330c];return _0x3c258e;};'use strict';var attributes=require(_0x289e('0x0'));module['exports']=function(_0x256961){var _0x2be90e=_0x256961['models'];return _0x256961[_0x289e('0x1')](_0x289e('0x2'),attributes,{'tableName':_0x289e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x17cc2d,_0x4358de,_0x5678d5){return _0x2be90e[_0x289e('0x4')][_0x289e('0x5')]({'value':_0x17cc2d[_0x289e('0x6')]},{'where':{'field':'mailSubstatus','value':_0x17cc2d[_0x289e('0x7')][_0x289e('0x6')]}})[_0x289e('0x8')](function(){_0x5678d5();})[_0x289e('0x9')](function(_0x4e5c61){_0x5678d5(_0x4e5c61);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index be93671..e3a2509 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 _0x7d06=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x7d06,0x8b));var _0x67d0=function(_0x1842b9,_0x5d197e){_0x1842b9=_0x1842b9-0x0;var _0x286aa7=_0x7d06[_0x1842b9];return _0x286aa7;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require(_0x67d0('0x5'));var db=require(_0x67d0('0x6'))['db'];var utils=require(_0x67d0('0x7'));var logger=require('../../config/logger')(_0x67d0('0x8'));var config=require(_0x67d0('0x9'));var jayson=require(_0x67d0('0xa'));var client=jayson[_0x67d0('0xb')][_0x67d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33a61d,_0x59ba80,_0x3b75bd){return new BPromise(function(_0x21d429,_0x2c2c19){return client[_0x67d0('0xd')](_0x33a61d,_0x3b75bd)[_0x67d0('0xe')](function(_0x187615){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x59ba80,_0x67d0('0xf'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x59ba80,_0x67d0('0xf'),JSON[_0x67d0('0x10')](_0x187615));if(_0x187615[_0x67d0('0x11')]){if(_0x187615[_0x67d0('0x11')][_0x67d0('0x12')]===0x1f4){logger[_0x67d0('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x59ba80,_0x187615[_0x67d0('0x11')][_0x67d0('0x13')]);return _0x2c2c19(_0x187615[_0x67d0('0x11')][_0x67d0('0x13')]);}logger[_0x67d0('0x11')](_0x67d0('0x14'),_0x59ba80,_0x187615[_0x67d0('0x11')]['message']);return _0x21d429(_0x187615[_0x67d0('0x11')]['message']);}else{logger[_0x67d0('0x15')]('MailSubstatus,\x20%s,\x20%s',_0x59ba80,_0x67d0('0xf'));_0x21d429(_0x187615[_0x67d0('0x16')][_0x67d0('0x13')]);}})[_0x67d0('0x17')](function(_0x244ae7){logger['error'](_0x67d0('0x14'),_0x59ba80,_0x244ae7);_0x2c2c19(_0x244ae7);});});} \ No newline at end of file +var _0x3e6d=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e6d,0xdf));var _0xd3e6=function(_0x4bcfe2,_0x2c3665){_0x4bcfe2=_0x4bcfe2-0x0;var _0x445590=_0x3e6d[_0x4bcfe2];return _0x445590;};'use strict';var _=require(_0xd3e6('0x0'));var util=require(_0xd3e6('0x1'));var moment=require(_0xd3e6('0x2'));var BPromise=require(_0xd3e6('0x3'));var rs=require(_0xd3e6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd3e6('0x6'));var config=require(_0xd3e6('0x7'));var jayson=require(_0xd3e6('0x8'));var client=jayson[_0xd3e6('0x9')][_0xd3e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d6de7,_0x22f561,_0x310870){return new BPromise(function(_0x16fbe4,_0x977d7d){return client[_0xd3e6('0xb')](_0x1d6de7,_0x310870)['then'](function(_0x2ca378){logger[_0xd3e6('0xc')](_0xd3e6('0xd'),_0x22f561,_0xd3e6('0xe'));logger[_0xd3e6('0xf')](_0xd3e6('0x10'),_0x22f561,'request\x20sent',JSON[_0xd3e6('0x11')](_0x2ca378));if(_0x2ca378[_0xd3e6('0x12')]){if(_0x2ca378[_0xd3e6('0x12')][_0xd3e6('0x13')]===0x1f4){logger[_0xd3e6('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x22f561,_0x2ca378['error']['message']);return _0x977d7d(_0x2ca378[_0xd3e6('0x12')][_0xd3e6('0x14')]);}logger[_0xd3e6('0x12')](_0xd3e6('0xd'),_0x22f561,_0x2ca378[_0xd3e6('0x12')]['message']);return _0x16fbe4(_0x2ca378[_0xd3e6('0x12')][_0xd3e6('0x14')]);}else{logger[_0xd3e6('0xc')](_0xd3e6('0xd'),_0x22f561,'request\x20sent');_0x16fbe4(_0x2ca378['result'][_0xd3e6('0x14')]);}})[_0xd3e6('0x15')](function(_0x38b298){logger[_0xd3e6('0x12')](_0xd3e6('0xd'),_0x22f561,_0x38b298);_0x977d7d(_0x38b298);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d6fb3df..914a975 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 _0xdbbc=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post'];(function(_0x4ce6b1,_0x312769){var _0x42c356=function(_0x12cfbb){while(--_0x12cfbb){_0x4ce6b1['push'](_0x4ce6b1['shift']());}};_0x42c356(++_0x312769);}(_0xdbbc,0x83));var _0xcdbb=function(_0x25a928,_0x1c3cb3){_0x25a928=_0x25a928-0x0;var _0x49ea9b=_0xdbbc[_0x25a928];return _0x49ea9b;};'use strict';var multer=require(_0xcdbb('0x0'));var util=require(_0xcdbb('0x1'));var path=require(_0xcdbb('0x2'));var timeout=require(_0xcdbb('0x3'));var express=require(_0xcdbb('0x4'));var router=express['Router']();var fs_extra=require(_0xcdbb('0x5'));var auth=require(_0xcdbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcdbb('0x7'));var controller=require(_0xcdbb('0x8'));router['get']('/',auth[_0xcdbb('0x9')](),controller[_0xcdbb('0xa')]);router[_0xcdbb('0xb')](_0xcdbb('0xc'),auth[_0xcdbb('0x9')](),controller['describe']);router[_0xcdbb('0xb')](_0xcdbb('0xd'),auth['isAuthenticated'](),controller[_0xcdbb('0xe')]);router[_0xcdbb('0xf')]('/',auth[_0xcdbb('0x9')](),controller[_0xcdbb('0x10')]);router[_0xcdbb('0x11')](_0xcdbb('0xd'),auth[_0xcdbb('0x9')](),controller['update']);router[_0xcdbb('0x12')](_0xcdbb('0xd'),auth['isAuthenticated'](),controller[_0xcdbb('0x13')]);module[_0xcdbb('0x14')]=router; \ No newline at end of file +var _0x9e0a=['index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x2bdd13,_0xdaa27a){var _0x49c7c9=function(_0x94d40e){while(--_0x94d40e){_0x2bdd13['push'](_0x2bdd13['shift']());}};_0x49c7c9(++_0xdaa27a);}(_0x9e0a,0x114));var _0xa9e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9e0a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa9e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa9e0('0x1'));var express=require(_0xa9e0('0x2'));var router=express['Router']();var fs_extra=require(_0xa9e0('0x3'));var auth=require(_0xa9e0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa9e0('0x5'));var controller=require(_0xa9e0('0x6'));router[_0xa9e0('0x7')]('/',auth[_0xa9e0('0x8')](),controller[_0xa9e0('0x9')]);router['get'](_0xa9e0('0xa'),auth[_0xa9e0('0x8')](),controller['describe']);router[_0xa9e0('0x7')](_0xa9e0('0xb'),auth[_0xa9e0('0x8')](),controller[_0xa9e0('0xc')]);router[_0xa9e0('0xd')]('/',auth[_0xa9e0('0x8')](),controller[_0xa9e0('0xe')]);router[_0xa9e0('0xf')](_0xa9e0('0xb'),auth[_0xa9e0('0x8')](),controller[_0xa9e0('0x10')]);router['delete'](_0xa9e0('0xb'),auth['isAuthenticated'](),controller[_0xa9e0('0x11')]);module[_0xa9e0('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 7f6aab4..c8dec98 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x331a31,_0x116709){var _0x521de0=function(_0x104a03){while(--_0x104a03){_0x331a31['push'](_0x331a31['shift']());}};_0x521de0(++_0x116709);}(_0x54ef,0x112));var _0xf54e=function(_0x4ce474,_0x34a32e){_0x4ce474=_0x4ce474-0x0;var _0x4d79c0=_0x54ef[_0x4ce474];return _0x4d79c0;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 0c0f95c..40e7ea1 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 _0x8ff2=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x8ff2,0x95));var _0x28ff=function(_0x481a42,_0x4d531b){_0x481a42=_0x481a42-0x0;var _0x1603b0=_0x8ff2[_0x481a42];return _0x1603b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ff('0x0'));var zipdir=require(_0x28ff('0x1'));var jsonpatch=require(_0x28ff('0x2'));var rp=require(_0x28ff('0x3'));var moment=require(_0x28ff('0x4'));var BPromise=require(_0x28ff('0x5'));var Mustache=require(_0x28ff('0x6'));var util=require(_0x28ff('0x7'));var path=require(_0x28ff('0x8'));var sox=require('sox');var csv=require(_0x28ff('0x9'));var ejs=require(_0x28ff('0xa'));var fs=require('fs');var fs_extra=require(_0x28ff('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x28ff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28ff('0xd'));var Papa=require(_0x28ff('0xe'));var Redis=require(_0x28ff('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28ff('0x10'));var hardwareService=require(_0x28ff('0x11'));var logger=require(_0x28ff('0x12'))(_0x28ff('0x13'));var utils=require(_0x28ff('0x14'));var config=require(_0x28ff('0x15'));var licenseUtil=require(_0x28ff('0x16'));var db=require(_0x28ff('0x17'))['db'];function respondWithStatusCode(_0x56e43d,_0xb89e7c){_0xb89e7c=_0xb89e7c||0xcc;return function(_0x4a56ce){if(_0x4a56ce){return _0x56e43d['sendStatus'](_0xb89e7c);}return _0x56e43d[_0x28ff('0x18')](_0xb89e7c)['end']();};}function respondWithResult(_0x2acb79,_0x4cf8e8){_0x4cf8e8=_0x4cf8e8||0xc8;return function(_0x136f77){if(_0x136f77){return _0x2acb79['status'](_0x4cf8e8)[_0x28ff('0x19')](_0x136f77);}};}function respondWithFilteredResult(_0x5a9abf,_0x53f1ed){return function(_0x152331){if(_0x152331){var _0x1e23e8=typeof _0x53f1ed['offset']===_0x28ff('0x1a')&&typeof _0x53f1ed[_0x28ff('0x1b')]==='undefined';var _0x97f5c=_0x152331[_0x28ff('0x1c')];var _0x107215=_0x1e23e8?0x0:_0x53f1ed['offset'];var _0x707c7d=_0x1e23e8?_0x152331[_0x28ff('0x1c')]:_0x53f1ed[_0x28ff('0x1d')]+_0x53f1ed[_0x28ff('0x1b')];var _0xe50450;if(_0x707c7d>=_0x97f5c){_0x707c7d=_0x97f5c;_0xe50450=0xc8;}else{_0xe50450=0xce;}_0x5a9abf[_0x28ff('0x18')](_0xe50450);return _0x5a9abf[_0x28ff('0x1e')](_0x28ff('0x1f'),_0x107215+'-'+_0x707c7d+'/'+_0x97f5c)[_0x28ff('0x19')](_0x152331);}return null;};}function patchUpdates(_0x52f722){return function(_0x2818){try{jsonpatch[_0x28ff('0x20')](_0x2818,_0x52f722,!![]);}catch(_0x398fd8){return BPromise[_0x28ff('0x21')](_0x398fd8);}return _0x2818['save']();};}function saveUpdates(_0x5ac41a,_0x5f8ddc){return function(_0x2fd83d){if(_0x2fd83d){return _0x2fd83d[_0x28ff('0x22')](_0x5ac41a)[_0x28ff('0x23')](function(_0x20ada7){return _0x20ada7;});}return null;};}function removeEntity(_0x125dbe,_0x48846a){return function(_0x5f55e2){if(_0x5f55e2){return _0x5f55e2['destroy']()[_0x28ff('0x23')](function(){_0x125dbe[_0x28ff('0x18')](0xcc)[_0x28ff('0x24')]();});}};}function handleEntityNotFound(_0x3567c3,_0xc75b63){return function(_0x24b6b8){if(!_0x24b6b8){_0x3567c3[_0x28ff('0x25')](0x194);}return _0x24b6b8;};}function handleError(_0x2ec009,_0x454032){_0x454032=_0x454032||0x1f4;return function(_0x4dd45e){logger[_0x28ff('0x26')](_0x4dd45e[_0x28ff('0x27')]);if(_0x4dd45e[_0x28ff('0x28')]){delete _0x4dd45e['name'];}_0x2ec009[_0x28ff('0x18')](_0x454032)[_0x28ff('0x29')](_0x4dd45e);};}exports[_0x28ff('0x2a')]=function(_0x985430,_0x3e52f0){var _0x5e90fb={},_0x4ec2be={},_0xd134ba={'count':0x0,'rows':[]};var _0x13e201=_[_0x28ff('0x2b')](db[_0x28ff('0x2c')][_0x28ff('0x2d')],function(_0x5b12d7){return{'name':_0x5b12d7[_0x28ff('0x2e')],'type':_0x5b12d7[_0x28ff('0x2f')][_0x28ff('0x30')]};});_0x4ec2be['model']=_[_0x28ff('0x2b')](_0x13e201,_0x28ff('0x28'));_0x4ec2be[_0x28ff('0x31')]=_[_0x28ff('0x32')](_0x985430[_0x28ff('0x31')]);_0x4ec2be[_0x28ff('0x33')]=_[_0x28ff('0x34')](_0x4ec2be[_0x28ff('0x35')],_0x4ec2be['query']);_0x5e90fb[_0x28ff('0x36')]=_[_0x28ff('0x34')](_0x4ec2be[_0x28ff('0x35')],qs[_0x28ff('0x37')](_0x985430[_0x28ff('0x31')][_0x28ff('0x37')]));_0x5e90fb[_0x28ff('0x36')]=_0x5e90fb[_0x28ff('0x36')][_0x28ff('0x38')]?_0x5e90fb['attributes']:_0x4ec2be[_0x28ff('0x35')];if(!_0x985430[_0x28ff('0x31')][_0x28ff('0x39')](_0x28ff('0x3a'))){_0x5e90fb[_0x28ff('0x1b')]=qs['limit'](_0x985430['query'][_0x28ff('0x1b')]);_0x5e90fb[_0x28ff('0x1d')]=qs['offset'](_0x985430[_0x28ff('0x31')][_0x28ff('0x1d')]);}_0x5e90fb[_0x28ff('0x3b')]=qs[_0x28ff('0x3c')](_0x985430[_0x28ff('0x31')][_0x28ff('0x3c')]);_0x5e90fb[_0x28ff('0x3d')]=qs[_0x28ff('0x33')](_[_0x28ff('0x3e')](_0x985430['query'],_0x4ec2be['filters']),_0x13e201);if(_0x985430[_0x28ff('0x31')][_0x28ff('0x3f')]){_0x5e90fb[_0x28ff('0x3d')]=_['merge'](_0x5e90fb[_0x28ff('0x3d')],{'$or':_[_0x28ff('0x2b')](_0x13e201,function(_0x138631){if(_0x138631[_0x28ff('0x2f')]!==_0x28ff('0x40')){var _0x58670a={};_0x58670a[_0x138631[_0x28ff('0x28')]]={'$like':'%'+_0x985430[_0x28ff('0x31')][_0x28ff('0x3f')]+'%'};return _0x58670a;}})});}_0x5e90fb=_['merge']({},_0x5e90fb,_0x985430[_0x28ff('0x41')]);var _0x180189={'where':_0x5e90fb[_0x28ff('0x3d')]};return db['MailTransferReport'][_0x28ff('0x1c')](_0x180189)[_0x28ff('0x23')](function(_0x25d9e1){_0xd134ba[_0x28ff('0x1c')]=_0x25d9e1;if(_0x985430[_0x28ff('0x31')][_0x28ff('0x42')]){_0x5e90fb['include']=[{'all':!![]}];}return db[_0x28ff('0x2c')][_0x28ff('0x43')](_0x5e90fb);})[_0x28ff('0x23')](function(_0x3b7a14){_0xd134ba[_0x28ff('0x44')]=_0x3b7a14;return _0xd134ba;})['then'](respondWithFilteredResult(_0x3e52f0,_0x5e90fb))[_0x28ff('0x45')](handleError(_0x3e52f0,null));};exports[_0x28ff('0x46')]=function(_0x125b7b,_0x27766e){var _0xf3d9d9={'raw':!![],'where':{'id':_0x125b7b[_0x28ff('0x47')]['id']}},_0x31410b={};_0x31410b[_0x28ff('0x35')]=_[_0x28ff('0x32')](db[_0x28ff('0x2c')]['rawAttributes']);_0x31410b['query']=_['keys'](_0x125b7b[_0x28ff('0x31')]);_0x31410b[_0x28ff('0x33')]=_[_0x28ff('0x34')](_0x31410b[_0x28ff('0x35')],_0x31410b[_0x28ff('0x31')]);_0xf3d9d9[_0x28ff('0x36')]=_[_0x28ff('0x34')](_0x31410b[_0x28ff('0x35')],qs[_0x28ff('0x37')](_0x125b7b[_0x28ff('0x31')][_0x28ff('0x37')]));_0xf3d9d9[_0x28ff('0x36')]=_0xf3d9d9['attributes'][_0x28ff('0x38')]?_0xf3d9d9[_0x28ff('0x36')]:_0x31410b[_0x28ff('0x35')];if(_0x125b7b['query']['includeAll']){_0xf3d9d9['include']=[{'all':!![]}];}_0xf3d9d9=_['merge']({},_0xf3d9d9,_0x125b7b[_0x28ff('0x41')]);return db[_0x28ff('0x2c')][_0x28ff('0x48')](_0xf3d9d9)[_0x28ff('0x23')](handleEntityNotFound(_0x27766e,null))[_0x28ff('0x23')](respondWithResult(_0x27766e,null))['catch'](handleError(_0x27766e,null));};exports[_0x28ff('0x49')]=function(_0x245e95,_0x3f523e){return db[_0x28ff('0x2c')][_0x28ff('0x49')](_0x245e95[_0x28ff('0x4a')],{})['then'](respondWithResult(_0x3f523e,0xc9))['catch'](handleError(_0x3f523e,null));};exports[_0x28ff('0x22')]=function(_0x1db0c1,_0x2450a1){if(_0x1db0c1['body']['id']){delete _0x1db0c1[_0x28ff('0x4a')]['id'];}return db[_0x28ff('0x2c')]['find']({'where':{'id':_0x1db0c1['params']['id']}})['then'](handleEntityNotFound(_0x2450a1,null))[_0x28ff('0x23')](saveUpdates(_0x1db0c1['body'],null))[_0x28ff('0x23')](respondWithResult(_0x2450a1,null))[_0x28ff('0x45')](handleError(_0x2450a1,null));};exports[_0x28ff('0x4b')]=function(_0x55e84f,_0x3115df){return db[_0x28ff('0x2c')][_0x28ff('0x48')]({'where':{'id':_0x55e84f[_0x28ff('0x47')]['id']}})[_0x28ff('0x23')](handleEntityNotFound(_0x3115df,null))['then'](removeEntity(_0x3115df,null))[_0x28ff('0x45')](handleError(_0x3115df,null));};exports[_0x28ff('0x4c')]=function(_0x1013a4,_0x125b71){return db['MailTransferReport'][_0x28ff('0x4c')]()[_0x28ff('0x23')](respondWithResult(_0x125b71,null))['catch'](handleError(_0x125b71,null));}; \ No newline at end of file +var _0xf27a=['save','update','destroy','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','where','filter','MailTransferReport','includeAll','include','findAll','rows','params','rawAttributes','length','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','apply','reject'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf27a,0xef));var _0xaf27=function(_0x3f9d4f,_0x165b76){_0x3f9d4f=_0x3f9d4f-0x0;var _0x4ccdcc=_0xf27a[_0x3f9d4f];return _0x4ccdcc;};'use strict';var emlformat=require(_0xaf27('0x0'));var rimraf=require(_0xaf27('0x1'));var zipdir=require(_0xaf27('0x2'));var jsonpatch=require(_0xaf27('0x3'));var rp=require(_0xaf27('0x4'));var moment=require(_0xaf27('0x5'));var BPromise=require(_0xaf27('0x6'));var Mustache=require('mustache');var util=require(_0xaf27('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xaf27('0x8'));var ejs=require(_0xaf27('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf27('0xa'));var squel=require(_0xaf27('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf27('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaf27('0xd'));var Papa=require(_0xaf27('0xe'));var Redis=require(_0xaf27('0xf'));var authService=require(_0xaf27('0x10'));var qs=require(_0xaf27('0x11'));var as=require(_0xaf27('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf27('0x13'))(_0xaf27('0x14'));var utils=require(_0xaf27('0x15'));var config=require(_0xaf27('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf27('0x17'))['db'];function respondWithStatusCode(_0x4495e6,_0x495125){_0x495125=_0x495125||0xcc;return function(_0x38f28a){if(_0x38f28a){return _0x4495e6[_0xaf27('0x18')](_0x495125);}return _0x4495e6[_0xaf27('0x19')](_0x495125)[_0xaf27('0x1a')]();};}function respondWithResult(_0x7d7771,_0x16bce9){_0x16bce9=_0x16bce9||0xc8;return function(_0x3df5c7){if(_0x3df5c7){return _0x7d7771['status'](_0x16bce9)['json'](_0x3df5c7);}};}function respondWithFilteredResult(_0xb78ab3,_0x10bc3c){return function(_0x31abf7){if(_0x31abf7){var _0xd50f72=typeof _0x10bc3c['offset']===_0xaf27('0x1b')&&typeof _0x10bc3c['limit']===_0xaf27('0x1b');var _0x277cdb=_0x31abf7[_0xaf27('0x1c')];var _0x203d04=_0xd50f72?0x0:_0x10bc3c[_0xaf27('0x1d')];var _0x20055b=_0xd50f72?_0x31abf7[_0xaf27('0x1c')]:_0x10bc3c[_0xaf27('0x1d')]+_0x10bc3c[_0xaf27('0x1e')];var _0x2cd81b;if(_0x20055b>=_0x277cdb){_0x20055b=_0x277cdb;_0x2cd81b=0xc8;}else{_0x2cd81b=0xce;}_0xb78ab3[_0xaf27('0x19')](_0x2cd81b);return _0xb78ab3['set']('Content-Range',_0x203d04+'-'+_0x20055b+'/'+_0x277cdb)['json'](_0x31abf7);}return null;};}function patchUpdates(_0x84ae){return function(_0x45b33a){try{jsonpatch[_0xaf27('0x1f')](_0x45b33a,_0x84ae,!![]);}catch(_0x49787d){return BPromise[_0xaf27('0x20')](_0x49787d);}return _0x45b33a[_0xaf27('0x21')]();};}function saveUpdates(_0x105a3e,_0x14106b){return function(_0x38918c){if(_0x38918c){return _0x38918c[_0xaf27('0x22')](_0x105a3e)['then'](function(_0x4fbdc7){return _0x4fbdc7;});}return null;};}function removeEntity(_0x25480c,_0x13bbba){return function(_0x1210ba){if(_0x1210ba){return _0x1210ba[_0xaf27('0x23')]()[_0xaf27('0x24')](function(){_0x25480c[_0xaf27('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172ba1,_0x1c534b){return function(_0x440e64){if(!_0x440e64){_0x172ba1[_0xaf27('0x18')](0x194);}return _0x440e64;};}function handleError(_0x157160,_0x475919){_0x475919=_0x475919||0x1f4;return function(_0x1fdc2e){logger['error'](_0x1fdc2e[_0xaf27('0x25')]);if(_0x1fdc2e[_0xaf27('0x26')]){delete _0x1fdc2e[_0xaf27('0x26')];}_0x157160[_0xaf27('0x19')](_0x475919)[_0xaf27('0x27')](_0x1fdc2e);};}exports[_0xaf27('0x28')]=function(_0xd03e00,_0x48db49){var _0x468856={},_0xe707eb={},_0x250e2d={'count':0x0,'rows':[]};var _0x28b6ad=_[_0xaf27('0x29')](db['MailTransferReport']['rawAttributes'],function(_0x399dcf){return{'name':_0x399dcf[_0xaf27('0x2a')],'type':_0x399dcf[_0xaf27('0x2b')][_0xaf27('0x2c')]};});_0xe707eb[_0xaf27('0x2d')]=_[_0xaf27('0x29')](_0x28b6ad,'name');_0xe707eb[_0xaf27('0x2e')]=_[_0xaf27('0x2f')](_0xd03e00[_0xaf27('0x2e')]);_0xe707eb[_0xaf27('0x30')]=_[_0xaf27('0x31')](_0xe707eb[_0xaf27('0x2d')],_0xe707eb[_0xaf27('0x2e')]);_0x468856['attributes']=_[_0xaf27('0x31')](_0xe707eb[_0xaf27('0x2d')],qs[_0xaf27('0x32')](_0xd03e00['query'][_0xaf27('0x32')]));_0x468856['attributes']=_0x468856[_0xaf27('0x33')]['length']?_0x468856[_0xaf27('0x33')]:_0xe707eb[_0xaf27('0x2d')];if(!_0xd03e00[_0xaf27('0x2e')][_0xaf27('0x34')]('nolimit')){_0x468856[_0xaf27('0x1e')]=qs[_0xaf27('0x1e')](_0xd03e00[_0xaf27('0x2e')][_0xaf27('0x1e')]);_0x468856[_0xaf27('0x1d')]=qs[_0xaf27('0x1d')](_0xd03e00[_0xaf27('0x2e')]['offset']);}_0x468856[_0xaf27('0x35')]=qs['sort'](_0xd03e00[_0xaf27('0x2e')]['sort']);_0x468856[_0xaf27('0x36')]=qs[_0xaf27('0x30')](_['pick'](_0xd03e00['query'],_0xe707eb[_0xaf27('0x30')]),_0x28b6ad);if(_0xd03e00['query'][_0xaf27('0x37')]){_0x468856[_0xaf27('0x36')]=_['merge'](_0x468856[_0xaf27('0x36')],{'$or':_[_0xaf27('0x29')](_0x28b6ad,function(_0x4bdd5c){if(_0x4bdd5c[_0xaf27('0x2b')]!=='VIRTUAL'){var _0x26e1c5={};_0x26e1c5[_0x4bdd5c[_0xaf27('0x26')]]={'$like':'%'+_0xd03e00[_0xaf27('0x2e')][_0xaf27('0x37')]+'%'};return _0x26e1c5;}})});}_0x468856=_['merge']({},_0x468856,_0xd03e00['options']);var _0xd55b44={'where':_0x468856[_0xaf27('0x36')]};return db[_0xaf27('0x38')][_0xaf27('0x1c')](_0xd55b44)[_0xaf27('0x24')](function(_0x3b479b){_0x250e2d[_0xaf27('0x1c')]=_0x3b479b;if(_0xd03e00[_0xaf27('0x2e')][_0xaf27('0x39')]){_0x468856[_0xaf27('0x3a')]=[{'all':!![]}];}return db['MailTransferReport'][_0xaf27('0x3b')](_0x468856);})[_0xaf27('0x24')](function(_0x54bd69){_0x250e2d[_0xaf27('0x3c')]=_0x54bd69;return _0x250e2d;})[_0xaf27('0x24')](respondWithFilteredResult(_0x48db49,_0x468856))['catch'](handleError(_0x48db49,null));};exports['show']=function(_0x1e150b,_0x54c568){var _0x514264={'raw':!![],'where':{'id':_0x1e150b[_0xaf27('0x3d')]['id']}},_0x5dbf0d={};_0x5dbf0d['model']=_[_0xaf27('0x2f')](db[_0xaf27('0x38')][_0xaf27('0x3e')]);_0x5dbf0d[_0xaf27('0x2e')]=_[_0xaf27('0x2f')](_0x1e150b['query']);_0x5dbf0d[_0xaf27('0x30')]=_[_0xaf27('0x31')](_0x5dbf0d['model'],_0x5dbf0d[_0xaf27('0x2e')]);_0x514264[_0xaf27('0x33')]=_[_0xaf27('0x31')](_0x5dbf0d[_0xaf27('0x2d')],qs['fields'](_0x1e150b[_0xaf27('0x2e')][_0xaf27('0x32')]));_0x514264[_0xaf27('0x33')]=_0x514264['attributes'][_0xaf27('0x3f')]?_0x514264['attributes']:_0x5dbf0d[_0xaf27('0x2d')];if(_0x1e150b['query'][_0xaf27('0x39')]){_0x514264[_0xaf27('0x3a')]=[{'all':!![]}];}_0x514264=_[_0xaf27('0x40')]({},_0x514264,_0x1e150b['options']);return db[_0xaf27('0x38')][_0xaf27('0x41')](_0x514264)['then'](handleEntityNotFound(_0x54c568,null))['then'](respondWithResult(_0x54c568,null))[_0xaf27('0x42')](handleError(_0x54c568,null));};exports['create']=function(_0x2fb753,_0x2a3df9){return db[_0xaf27('0x38')]['create'](_0x2fb753[_0xaf27('0x43')],{})[_0xaf27('0x24')](respondWithResult(_0x2a3df9,0xc9))['catch'](handleError(_0x2a3df9,null));};exports['update']=function(_0x2b5768,_0x28a414){if(_0x2b5768[_0xaf27('0x43')]['id']){delete _0x2b5768[_0xaf27('0x43')]['id'];}return db[_0xaf27('0x38')][_0xaf27('0x41')]({'where':{'id':_0x2b5768['params']['id']}})[_0xaf27('0x24')](handleEntityNotFound(_0x28a414,null))['then'](saveUpdates(_0x2b5768[_0xaf27('0x43')],null))[_0xaf27('0x24')](respondWithResult(_0x28a414,null))[_0xaf27('0x42')](handleError(_0x28a414,null));};exports['destroy']=function(_0x3d6ad8,_0x5595ba){return db['MailTransferReport'][_0xaf27('0x41')]({'where':{'id':_0x3d6ad8[_0xaf27('0x3d')]['id']}})[_0xaf27('0x24')](handleEntityNotFound(_0x5595ba,null))[_0xaf27('0x24')](removeEntity(_0x5595ba,null))[_0xaf27('0x42')](handleError(_0x5595ba,null));};exports['describe']=function(_0x4fab21,_0x1368ce){return db[_0xaf27('0x38')]['describe']()[_0xaf27('0x24')](respondWithResult(_0x1368ce,null))[_0xaf27('0x42')](handleError(_0x1368ce,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c4dd09f..439f9c6 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 _0x7ec7=['./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x53d4b8,_0x3fb30c){var _0x1c550a=function(_0x1a55b0){while(--_0x1a55b0){_0x53d4b8['push'](_0x53d4b8['shift']());}};_0x1c550a(++_0x3fb30c);}(_0x7ec7,0x19b));var _0x77ec=function(_0x38be86,_0x2e9672){_0x38be86=_0x38be86-0x0;var _0x3055a2=_0x7ec7[_0x38be86];return _0x3055a2;};'use strict';var _=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var logger=require(_0x77ec('0x2'))('api');var moment=require(_0x77ec('0x3'));var BPromise=require('bluebird');var rp=require(_0x77ec('0x4'));var fs=require('fs');var path=require(_0x77ec('0x5'));var rimraf=require(_0x77ec('0x6'));var config=require('../../config/environment');var attributes=require(_0x77ec('0x7'));module['exports']=function(_0x5b14da,_0x20433a){return _0x5b14da['define'](_0x77ec('0x8'),attributes,{'tableName':_0x77ec('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x77ec('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa0b=['uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0xa1671c,_0x57700d){var _0x2107f0=function(_0x436e27){while(--_0x436e27){_0xa1671c['push'](_0xa1671c['shift']());}};_0x2107f0(++_0x57700d);}(_0xaa0b,0x1b1));var _0xbaa0=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xaa0b[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0xbaa0('0x0'));var util=require(_0xbaa0('0x1'));var logger=require('../../config/logger')(_0xbaa0('0x2'));var moment=require(_0xbaa0('0x3'));var BPromise=require(_0xbaa0('0x4'));var rp=require(_0xbaa0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbaa0('0x6'));var config=require(_0xbaa0('0x7'));var attributes=require(_0xbaa0('0x8'));module[_0xbaa0('0x9')]=function(_0x1d344f,_0x49567d){return _0x1d344f[_0xbaa0('0xa')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xbaa0('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index cdae053..644385e 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 _0x5002=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5002,0xad));var _0x2500=function(_0x15e9c0,_0x1bd22e){_0x15e9c0=_0x15e9c0-0x0;var _0x2a3ec3=_0x5002[_0x15e9c0];return _0x2a3ec3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2500('0x0'));var BPromise=require(_0x2500('0x1'));var rs=require(_0x2500('0x2'));var fs=require('fs');var Redis=require(_0x2500('0x3'));var db=require(_0x2500('0x4'))['db'];var utils=require(_0x2500('0x5'));var logger=require(_0x2500('0x6'))(_0x2500('0x7'));var config=require(_0x2500('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2500('0x9')][_0x2500('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fa90f,_0x4fb26a,_0x52e4ff){return new BPromise(function(_0x56e5a4,_0x15a338){return client[_0x2500('0xb')](_0x1fa90f,_0x52e4ff)[_0x2500('0xc')](function(_0x143bb1){logger[_0x2500('0xd')](_0x2500('0xe'),_0x4fb26a,_0x2500('0xf'));logger[_0x2500('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4fb26a,_0x2500('0xf'),JSON['stringify'](_0x143bb1));if(_0x143bb1[_0x2500('0x11')]){if(_0x143bb1[_0x2500('0x11')][_0x2500('0x12')]===0x1f4){logger[_0x2500('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x4fb26a,_0x143bb1[_0x2500('0x11')][_0x2500('0x13')]);return _0x15a338(_0x143bb1[_0x2500('0x11')][_0x2500('0x13')]);}logger[_0x2500('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x4fb26a,_0x143bb1['error'][_0x2500('0x13')]);return _0x56e5a4(_0x143bb1[_0x2500('0x11')][_0x2500('0x13')]);}else{logger[_0x2500('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x4fb26a,_0x2500('0xf'));_0x56e5a4(_0x143bb1[_0x2500('0x14')][_0x2500('0x13')]);}})[_0x2500('0x15')](function(_0x505bb9){logger[_0x2500('0x11')](_0x2500('0xe'),_0x4fb26a,_0x505bb9);_0x15a338(_0x505bb9);});});} \ No newline at end of file +var _0x5736=['debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x5212c6,_0x150938){var _0x402a71=function(_0x217793){while(--_0x217793){_0x5212c6['push'](_0x5212c6['shift']());}};_0x402a71(++_0x150938);}(_0x5736,0x197));var _0x6573=function(_0x1f0064,_0x1b1fc4){_0x1f0064=_0x1f0064-0x0;var _0x6bea0b=_0x5736[_0x1f0064];return _0x6bea0b;};'use strict';var _=require('lodash');var util=require(_0x6573('0x0'));var moment=require(_0x6573('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6573('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6573('0x3'))(_0x6573('0x4'));var config=require(_0x6573('0x5'));var jayson=require(_0x6573('0x6'));var client=jayson[_0x6573('0x7')][_0x6573('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3fe014,_0x46012d,_0x8aa90){return new BPromise(function(_0x51f402,_0x31107d){return client[_0x6573('0x9')](_0x3fe014,_0x8aa90)[_0x6573('0xa')](function(_0x2d6864){logger[_0x6573('0xb')](_0x6573('0xc'),_0x46012d,'request\x20sent');logger[_0x6573('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x46012d,_0x6573('0xe'),JSON[_0x6573('0xf')](_0x2d6864));if(_0x2d6864['error']){if(_0x2d6864[_0x6573('0x10')][_0x6573('0x11')]===0x1f4){logger[_0x6573('0x10')](_0x6573('0xc'),_0x46012d,_0x2d6864[_0x6573('0x10')][_0x6573('0x12')]);return _0x31107d(_0x2d6864[_0x6573('0x10')]['message']);}logger[_0x6573('0x10')](_0x6573('0xc'),_0x46012d,_0x2d6864[_0x6573('0x10')]['message']);return _0x51f402(_0x2d6864[_0x6573('0x10')][_0x6573('0x12')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x46012d,_0x6573('0xe'));_0x51f402(_0x2d6864[_0x6573('0x13')][_0x6573('0x12')]);}})[_0x6573('0x14')](function(_0x38c81d){logger[_0x6573('0x10')](_0x6573('0xc'),_0x46012d,_0x38c81d);_0x31107d(_0x38c81d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 83f7958..1139602 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 _0x7a1b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','destroy','exports','path','connect-timeout','express'];(function(_0x49a98c,_0x4b36e4){var _0x3530e8=function(_0x54d62f){while(--_0x54d62f){_0x49a98c['push'](_0x49a98c['shift']());}};_0x3530e8(++_0x4b36e4);}(_0x7a1b,0x1b2));var _0xb7a1=function(_0x2f43e3,_0x329db1){_0x2f43e3=_0x2f43e3-0x0;var _0x42ca6e=_0x7a1b[_0x2f43e3];return _0x42ca6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb7a1('0x0'));var timeout=require(_0xb7a1('0x1'));var express=require(_0xb7a1('0x2'));var router=express[_0xb7a1('0x3')]();var fs_extra=require(_0xb7a1('0x4'));var auth=require(_0xb7a1('0x5'));var interaction=require(_0xb7a1('0x6'));var config=require('../../config/environment');var controller=require(_0xb7a1('0x7'));router[_0xb7a1('0x8')]('/',auth['isAuthenticated'](),controller[_0xb7a1('0x9')]);router[_0xb7a1('0x8')](_0xb7a1('0xa'),auth[_0xb7a1('0xb')](),controller['describe']);router[_0xb7a1('0x8')](_0xb7a1('0xc'),auth[_0xb7a1('0xb')](),controller['show']);router[_0xb7a1('0xd')]('/',auth[_0xb7a1('0xb')](),controller[_0xb7a1('0xe')]);router[_0xb7a1('0xf')](_0xb7a1('0xc'),auth[_0xb7a1('0xb')](),controller[_0xb7a1('0x10')]);router['delete'](_0xb7a1('0xc'),auth[_0xb7a1('0xb')](),controller[_0xb7a1('0x11')]);module[_0xb7a1('0x12')]=router; \ No newline at end of file +var _0x0645=['multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0645,0x1c0));var _0x5064=function(_0x39a423,_0x48915f){_0x39a423=_0x39a423-0x0;var _0x14f20b=_0x0645[_0x39a423];return _0x14f20b;};'use strict';var multer=require(_0x5064('0x0'));var util=require(_0x5064('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5064('0x2')]();var fs_extra=require(_0x5064('0x3'));var auth=require(_0x5064('0x4'));var interaction=require(_0x5064('0x5'));var config=require(_0x5064('0x6'));var controller=require('./memberReport.controller');router[_0x5064('0x7')]('/',auth[_0x5064('0x8')](),controller['index']);router[_0x5064('0x7')]('/describe',auth[_0x5064('0x8')](),controller[_0x5064('0x9')]);router[_0x5064('0x7')](_0x5064('0xa'),auth[_0x5064('0x8')](),controller[_0x5064('0xb')]);router[_0x5064('0xc')]('/',auth[_0x5064('0x8')](),controller[_0x5064('0xd')]);router['put'](_0x5064('0xa'),auth[_0x5064('0x8')](),controller[_0x5064('0xe')]);router['delete'](_0x5064('0xa'),auth[_0x5064('0x8')](),controller['destroy']);module[_0x5064('0xf')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 54e7a15..3c12213 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 _0x4b2d=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x329163,_0x5a6f13){var _0x4e2408=function(_0x5102a8){while(--_0x5102a8){_0x329163['push'](_0x329163['shift']());}};_0x4e2408(++_0x5a6f13);}(_0x4b2d,0x82));var _0xd4b2=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0x4b2d[_0x57645b];return _0xe82f00;};'use strict';var Sequelize=require(_0xd4b2('0x0'));var moment=require(_0xd4b2('0x1'));module[_0xd4b2('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd4b2('0x3')]},'interface':{'type':Sequelize[_0xd4b2('0x3')]},'type':{'type':Sequelize[_0xd4b2('0x3')],'defaultValue':_0xd4b2('0x4'),'comment':_0xd4b2('0x5')},'duration':{'type':Sequelize[_0xd4b2('0x6')]},'enterAt':{'type':Sequelize[_0xd4b2('0x7')]},'exitAt':{'type':Sequelize[_0xd4b2('0x7')],'set':function(_0x17e662){var _0x457d73=moment(_0x17e662);var _0x511c3e=moment(this[_0xd4b2('0x8')]('enterAt'));var _0x2259d6=_0x457d73[_0xd4b2('0x9')](_0x511c3e,'seconds');this[_0xd4b2('0xa')]('exitAt',_0x17e662);this['setDataValue']('duration',_0x2259d6>=0x0?_0x2259d6:null);}},'data1':{'type':Sequelize[_0xd4b2('0x3')],'comment':_0xd4b2('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xd4b2('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0xd4b2('0xd')},'data4':{'type':Sequelize[_0xd4b2('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xd4b2('0x3')],'comment':_0xd4b2('0xe')},'role':{'type':Sequelize[_0xd4b2('0x3')]},'internal':{'type':Sequelize[_0xd4b2('0x6')]},'uniqueid':{'type':Sequelize[_0xd4b2('0x3')]}}; \ No newline at end of file +var _0x466d=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration'];(function(_0x2c7be3,_0x16540d){var _0x2d53ce=function(_0x479052){while(--_0x479052){_0x2c7be3['push'](_0x2c7be3['shift']());}};_0x2d53ce(++_0x16540d);}(_0x466d,0x191));var _0xd466=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x466d[_0x13606d];return _0x1b85b0;};'use strict';var Sequelize=require(_0xd466('0x0'));var moment=require('moment');module[_0xd466('0x1')]={'channel':{'type':Sequelize[_0xd466('0x2')]},'membername':{'type':Sequelize[_0xd466('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd466('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xd466('0x3')},'duration':{'type':Sequelize[_0xd466('0x4')]},'enterAt':{'type':Sequelize[_0xd466('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x517218){var _0x3c5905=moment(_0x517218);var _0x53c6fa=moment(this[_0xd466('0x6')](_0xd466('0x7')));var _0x50eb6d=_0x3c5905[_0xd466('0x8')](_0x53c6fa,_0xd466('0x9'));this[_0xd466('0xa')](_0xd466('0xb'),_0x517218);this['setDataValue'](_0xd466('0xc'),_0x50eb6d>=0x0?_0x50eb6d:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xd466('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xd466('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xd466('0xf')},'data4':{'type':Sequelize[_0xd466('0x2')],'comment':_0xd466('0x10')},'data5':{'type':Sequelize[_0xd466('0x2')],'comment':_0xd466('0x11')},'role':{'type':Sequelize[_0xd466('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xd466('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 57d1e93..c149e0a 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x53a06e,_0x1dd83d){var _0x29b535=function(_0xe19096){while(--_0xe19096){_0x53a06e['push'](_0x53a06e['shift']());}};_0x29b535(++_0x1dd83d);}(_0x3e74,0x175));var _0x43e7=function(_0xb43f90,_0x1b4967){_0xb43f90=_0xb43f90-0x0;var _0x35c445=_0x3e74[_0xb43f90];return _0x35c445;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +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(_0xa9d9c4,_0x2cfe0c){var _0x18d97e=function(_0x17ba08){while(--_0x17ba08){_0xa9d9c4['push'](_0xa9d9c4['shift']());}};_0x18d97e(++_0x2cfe0c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8a4e797..a6d1aaa 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 _0xb510=['./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xb510,0xd6));var _0x0b51=function(_0x1a66ef,_0x3df85d){_0x1a66ef=_0x1a66ef-0x0;var _0x1c26b7=_0xb510[_0x1a66ef];return _0x1c26b7;};'use strict';var _=require(_0x0b51('0x0'));var util=require(_0x0b51('0x1'));var logger=require(_0x0b51('0x2'))('api');var moment=require(_0x0b51('0x3'));var BPromise=require(_0x0b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b51('0x5'));var rimraf=require('rimraf');var config=require(_0x0b51('0x6'));var attributes=require(_0x0b51('0x7'));module['exports']=function(_0x500b21,_0x54675d){return _0x500b21['define'](_0x0b51('0x8'),attributes,{'tableName':_0x0b51('0x9'),'paranoid':![],'indexes':[{'name':_0x0b51('0xa'),'fields':[_0x0b51('0xb'),_0x0b51('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2d=['MemberReport','membername_interface','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','define'];(function(_0xa5bcd7,_0x11768e){var _0x14a6aa=function(_0x4a005d){while(--_0x4a005d){_0xa5bcd7['push'](_0xa5bcd7['shift']());}};_0x14a6aa(++_0x11768e);}(_0x9a2d,0x6d));var _0xd9a2=function(_0x444ac5,_0x465afa){_0x444ac5=_0x444ac5-0x0;var _0xb26616=_0x9a2d[_0x444ac5];return _0xb26616;};'use strict';var _=require(_0xd9a2('0x0'));var util=require(_0xd9a2('0x1'));var logger=require('../../config/logger')(_0xd9a2('0x2'));var moment=require(_0xd9a2('0x3'));var BPromise=require(_0xd9a2('0x4'));var rp=require(_0xd9a2('0x5'));var fs=require('fs');var path=require(_0xd9a2('0x6'));var rimraf=require(_0xd9a2('0x7'));var config=require('../../config/environment');var attributes=require(_0xd9a2('0x8'));module[_0xd9a2('0x9')]=function(_0x49fb38,_0x289a23){return _0x49fb38[_0xd9a2('0xa')](_0xd9a2('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xd9a2('0xc'),'fields':[_0xd9a2('0xd'),_0xd9a2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ceebf5a..3efe607 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 _0x1a44=['where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','model','map','catch','CreateMemberReport','body','UpdateMemberReport','update'];(function(_0x346919,_0x3401c5){var _0x2de0dd=function(_0x56062a){while(--_0x56062a){_0x346919['push'](_0x346919['shift']());}};_0x2de0dd(++_0x3401c5);}(_0x1a44,0xc4));var _0x41a4=function(_0x59cf03,_0x17a3ee){_0x59cf03=_0x59cf03-0x0;var _0x49db55=_0x1a44[_0x59cf03];return _0x49db55;};'use strict';var _=require(_0x41a4('0x0'));var util=require('util');var moment=require(_0x41a4('0x1'));var BPromise=require(_0x41a4('0x2'));var rs=require(_0x41a4('0x3'));var fs=require('fs');var Redis=require(_0x41a4('0x4'));var db=require(_0x41a4('0x5'))['db'];var utils=require(_0x41a4('0x6'));var logger=require(_0x41a4('0x7'))('rpc');var config=require(_0x41a4('0x8'));var jayson=require(_0x41a4('0x9'));var client=jayson[_0x41a4('0xa')][_0x41a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x599ccc,_0x5f57e7,_0x2e523b){return new BPromise(function(_0x141ae3,_0x3edb3d){return client[_0x41a4('0xc')](_0x599ccc,_0x2e523b)[_0x41a4('0xd')](function(_0x5a6e4b){logger['info'](_0x41a4('0xe'),_0x5f57e7,_0x41a4('0xf'));logger[_0x41a4('0x10')](_0x41a4('0x11'),_0x5f57e7,_0x41a4('0xf'),JSON[_0x41a4('0x12')](_0x5a6e4b));if(_0x5a6e4b['error']){if(_0x5a6e4b[_0x41a4('0x13')][_0x41a4('0x14')]===0x1f4){logger[_0x41a4('0x13')](_0x41a4('0xe'),_0x5f57e7,_0x5a6e4b['error'][_0x41a4('0x15')]);return _0x3edb3d(_0x5a6e4b[_0x41a4('0x13')]['message']);}logger[_0x41a4('0x13')](_0x41a4('0xe'),_0x5f57e7,_0x5a6e4b['error']['message']);return _0x141ae3(_0x5a6e4b[_0x41a4('0x13')][_0x41a4('0x15')]);}else{logger[_0x41a4('0x16')](_0x41a4('0xe'),_0x5f57e7,_0x41a4('0xf'));_0x141ae3(_0x5a6e4b['result'][_0x41a4('0x15')]);}})['catch'](function(_0x83140c){logger[_0x41a4('0x13')](_0x41a4('0xe'),_0x5f57e7,_0x83140c);_0x3edb3d(_0x83140c);});});}exports[_0x41a4('0x17')]=function(_0x239912){var _0x1b5788=this;return new Promise(function(_0x43c0f9,_0x372868){return db[_0x41a4('0x18')][_0x41a4('0x19')]({'raw':_0x239912[_0x41a4('0x1a')]?_0x239912['options'][_0x41a4('0x1b')]===undefined?!![]:![]:!![],'where':_0x239912[_0x41a4('0x1a')]?_0x239912[_0x41a4('0x1a')]['where']||null:null,'attributes':_0x239912[_0x41a4('0x1a')]?_0x239912[_0x41a4('0x1a')][_0x41a4('0x1c')]||null:null,'limit':_0x239912[_0x41a4('0x1a')]?_0x239912['options'][_0x41a4('0x1d')]||null:null,'include':_0x239912[_0x41a4('0x1a')]?_0x239912['options'][_0x41a4('0x1e')]?_['map'](_0x239912[_0x41a4('0x1a')][_0x41a4('0x1e')],function(_0x42a31f){return{'model':db[_0x42a31f[_0x41a4('0x1f')]],'as':_0x42a31f['as'],'attributes':_0x42a31f[_0x41a4('0x1c')],'include':_0x42a31f[_0x41a4('0x1e')]?_[_0x41a4('0x20')](_0x42a31f[_0x41a4('0x1e')],function(_0x263639){return{'model':db[_0x263639[_0x41a4('0x1f')]],'as':_0x263639['as'],'attributes':_0x263639[_0x41a4('0x1c')],'include':_0x263639[_0x41a4('0x1e')]?_['map'](_0x263639[_0x41a4('0x1e')],function(_0xac9279){return{'model':db[_0xac9279[_0x41a4('0x1f')]],'as':_0xac9279['as'],'attributes':_0xac9279['attributes']};}):[]};}):[]};}):[]:[]})[_0x41a4('0xd')](function(_0x99bcec){logger[_0x41a4('0x16')](_0x41a4('0x17'),_0x239912);logger['debug'](_0x41a4('0x17'),_0x239912,JSON['stringify'](_0x99bcec));_0x43c0f9(_0x99bcec);})[_0x41a4('0x21')](function(_0x309fec){logger[_0x41a4('0x13')]('GetMemberReport',_0x309fec[_0x41a4('0x15')],_0x239912);_0x372868(_0x1b5788[_0x41a4('0x13')](0x1f4,_0x309fec[_0x41a4('0x15')]));});});};exports[_0x41a4('0x22')]=function(_0x2cfe57){var _0x3ad2fa=this;return new Promise(function(_0x1d21d6,_0x2b9f5b){return db[_0x41a4('0x18')]['create'](_0x2cfe57[_0x41a4('0x23')],{'raw':_0x2cfe57[_0x41a4('0x1a')]?_0x2cfe57['options']['raw']===undefined?!![]:![]:!![]})[_0x41a4('0xd')](function(_0x959f80){logger['info'](_0x41a4('0x22'),_0x2cfe57);logger[_0x41a4('0x10')](_0x41a4('0x22'),_0x2cfe57,JSON[_0x41a4('0x12')](_0x959f80));_0x1d21d6(_0x959f80);})[_0x41a4('0x21')](function(_0x3ef496){logger[_0x41a4('0x13')](_0x41a4('0x22'),_0x3ef496[_0x41a4('0x15')],_0x2cfe57);_0x2b9f5b(_0x3ad2fa[_0x41a4('0x13')](0x1f4,_0x3ef496['message']));});});};exports[_0x41a4('0x24')]=function(_0x2aa62d){var _0x35bfaf=this;return new Promise(function(_0xfc228c,_0x153f70){return db[_0x41a4('0x18')][_0x41a4('0x25')](_0x2aa62d[_0x41a4('0x23')],{'raw':_0x2aa62d[_0x41a4('0x1a')]?_0x2aa62d['options'][_0x41a4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2aa62d['options']?_0x2aa62d[_0x41a4('0x1a')][_0x41a4('0x26')]||null:null,'attributes':_0x2aa62d[_0x41a4('0x1a')]?_0x2aa62d[_0x41a4('0x1a')][_0x41a4('0x1c')]||null:null,'limit':_0x2aa62d[_0x41a4('0x1a')]?_0x2aa62d[_0x41a4('0x1a')]['limit']||null:null})['then'](function(_0x543d2b){logger['info'](_0x41a4('0x24'),_0x2aa62d);logger[_0x41a4('0x10')](_0x41a4('0x24'),_0x2aa62d,JSON[_0x41a4('0x12')](_0x543d2b));_0xfc228c(_0x543d2b);})['catch'](function(_0x1a33df){logger[_0x41a4('0x13')](_0x41a4('0x24'),_0x1a33df[_0x41a4('0x15')],_0x2aa62d);_0x153f70(_0x35bfaf[_0x41a4('0x13')](0x1f4,_0x1a33df[_0x41a4('0x15')]));});});}; \ No newline at end of file +var _0xcf98=['request\x20sent','stringify','error','code','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','model','map','create','body','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s'];(function(_0x3eb211,_0x4a2e7f){var _0xb32a15=function(_0xff52ec){while(--_0xff52ec){_0x3eb211['push'](_0x3eb211['shift']());}};_0xb32a15(++_0x4a2e7f);}(_0xcf98,0x8d));var _0x8cf9=function(_0x3a04eb,_0x5c17e2){_0x3a04eb=_0x3a04eb-0x0;var _0x5d41d9=_0xcf98[_0x3a04eb];return _0x5d41d9;};'use strict';var _=require('lodash');var util=require(_0x8cf9('0x0'));var moment=require(_0x8cf9('0x1'));var BPromise=require(_0x8cf9('0x2'));var rs=require(_0x8cf9('0x3'));var fs=require('fs');var Redis=require(_0x8cf9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8cf9('0x5'))(_0x8cf9('0x6'));var config=require(_0x8cf9('0x7'));var jayson=require(_0x8cf9('0x8'));var client=jayson[_0x8cf9('0x9')][_0x8cf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23114d,_0x29fb1e,_0x11c3b5){return new BPromise(function(_0x136309,_0x7d48dc){return client['request'](_0x23114d,_0x11c3b5)[_0x8cf9('0xb')](function(_0x982c65){logger['info'](_0x8cf9('0xc'),_0x29fb1e,'request\x20sent');logger[_0x8cf9('0xd')](_0x8cf9('0xe'),_0x29fb1e,_0x8cf9('0xf'),JSON[_0x8cf9('0x10')](_0x982c65));if(_0x982c65[_0x8cf9('0x11')]){if(_0x982c65[_0x8cf9('0x11')][_0x8cf9('0x12')]===0x1f4){logger['error'](_0x8cf9('0xc'),_0x29fb1e,_0x982c65['error']['message']);return _0x7d48dc(_0x982c65['error'][_0x8cf9('0x13')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x29fb1e,_0x982c65[_0x8cf9('0x11')][_0x8cf9('0x13')]);return _0x136309(_0x982c65[_0x8cf9('0x11')]['message']);}else{logger[_0x8cf9('0x14')](_0x8cf9('0xc'),_0x29fb1e,'request\x20sent');_0x136309(_0x982c65[_0x8cf9('0x15')][_0x8cf9('0x13')]);}})[_0x8cf9('0x16')](function(_0x46a573){logger[_0x8cf9('0x11')](_0x8cf9('0xc'),_0x29fb1e,_0x46a573);_0x7d48dc(_0x46a573);});});}exports[_0x8cf9('0x17')]=function(_0x21efd3){var _0x309866=this;return new Promise(function(_0x3a13b7,_0x873fec){return db[_0x8cf9('0x18')][_0x8cf9('0x19')]({'raw':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1b')]===undefined?!![]:![]:!![],'where':_0x21efd3['options']?_0x21efd3['options'][_0x8cf9('0x1c')]||null:null,'attributes':_0x21efd3['options']?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1d')]||null:null,'limit':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1e')]||null:null,'include':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1f')]?_['map'](_0x21efd3[_0x8cf9('0x1a')]['include'],function(_0x5be3ae){return{'model':db[_0x5be3ae[_0x8cf9('0x20')]],'as':_0x5be3ae['as'],'attributes':_0x5be3ae[_0x8cf9('0x1d')],'include':_0x5be3ae['include']?_[_0x8cf9('0x21')](_0x5be3ae['include'],function(_0x4d07fa){return{'model':db[_0x4d07fa[_0x8cf9('0x20')]],'as':_0x4d07fa['as'],'attributes':_0x4d07fa[_0x8cf9('0x1d')],'include':_0x4d07fa['include']?_[_0x8cf9('0x21')](_0x4d07fa[_0x8cf9('0x1f')],function(_0x170414){return{'model':db[_0x170414[_0x8cf9('0x20')]],'as':_0x170414['as'],'attributes':_0x170414[_0x8cf9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b580){logger[_0x8cf9('0x14')](_0x8cf9('0x17'),_0x21efd3);logger[_0x8cf9('0xd')](_0x8cf9('0x17'),_0x21efd3,JSON[_0x8cf9('0x10')](_0x53b580));_0x3a13b7(_0x53b580);})[_0x8cf9('0x16')](function(_0x13fa60){logger[_0x8cf9('0x11')](_0x8cf9('0x17'),_0x13fa60['message'],_0x21efd3);_0x873fec(_0x309866['error'](0x1f4,_0x13fa60[_0x8cf9('0x13')]));});});};exports['CreateMemberReport']=function(_0x2716c8){var _0x2c2e6e=this;return new Promise(function(_0x2bbd81,_0x443ca1){return db['MemberReport'][_0x8cf9('0x22')](_0x2716c8[_0x8cf9('0x23')],{'raw':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1b')]===undefined?!![]:![]:!![]})[_0x8cf9('0xb')](function(_0x3c8282){logger['info']('CreateMemberReport',_0x2716c8);logger[_0x8cf9('0xd')](_0x8cf9('0x24'),_0x2716c8,JSON[_0x8cf9('0x10')](_0x3c8282));_0x2bbd81(_0x3c8282);})[_0x8cf9('0x16')](function(_0x38b771){logger[_0x8cf9('0x11')]('CreateMemberReport',_0x38b771[_0x8cf9('0x13')],_0x2716c8);_0x443ca1(_0x2c2e6e[_0x8cf9('0x11')](0x1f4,_0x38b771[_0x8cf9('0x13')]));});});};exports[_0x8cf9('0x25')]=function(_0x2a8688){var _0x11e272=this;return new Promise(function(_0x1d37a3,_0x1df0f9){return db['MemberReport'][_0x8cf9('0x26')](_0x2a8688[_0x8cf9('0x23')],{'raw':_0x2a8688[_0x8cf9('0x1a')]?_0x2a8688['options'][_0x8cf9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a8688['options']?_0x2a8688[_0x8cf9('0x1a')]['where']||null:null,'attributes':_0x2a8688[_0x8cf9('0x1a')]?_0x2a8688['options'][_0x8cf9('0x1d')]||null:null,'limit':_0x2a8688['options']?_0x2a8688[_0x8cf9('0x1a')]['limit']||null:null})['then'](function(_0x3e5a11){logger['info'](_0x8cf9('0x25'),_0x2a8688);logger['debug'](_0x8cf9('0x25'),_0x2a8688,JSON['stringify'](_0x3e5a11));_0x1d37a3(_0x3e5a11);})[_0x8cf9('0x16')](function(_0x4542d5){logger[_0x8cf9('0x11')](_0x8cf9('0x25'),_0x4542d5[_0x8cf9('0x13')],_0x2a8688);_0x1df0f9(_0x11e272[_0x8cf9('0x11')](0x1f4,_0x4542d5[_0x8cf9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 51b72cb..e35b5e7 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 _0x6171=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./migration.controller','exports'];(function(_0x1ea3b4,_0x43584c){var _0x5cb548=function(_0x55bccf){while(--_0x55bccf){_0x1ea3b4['push'](_0x1ea3b4['shift']());}};_0x5cb548(++_0x43584c);}(_0x6171,0x10e));var _0x1617=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x6171[_0x279d37];return _0x530173;};'use strict';var multer=require(_0x1617('0x0'));var util=require(_0x1617('0x1'));var path=require('path');var timeout=require(_0x1617('0x2'));var express=require(_0x1617('0x3'));var router=express[_0x1617('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1617('0x5'));var interaction=require(_0x1617('0x6'));var config=require('../../config/environment');var controller=require(_0x1617('0x7'));router['get']('/',controller['index']);module[_0x1617('0x8')]=router; \ No newline at end of file +var _0xf5cd=['../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53651d,_0x36423d){var _0x2c76df=function(_0x50a10b){while(--_0x50a10b){_0x53651d['push'](_0x53651d['shift']());}};_0x2c76df(++_0x36423d);}(_0xf5cd,0x1bf));var _0xdf5c=function(_0x4aded8,_0x347394){_0x4aded8=_0x4aded8-0x0;var _0x39b271=_0xf5cd[_0x4aded8];return _0x39b271;};'use strict';var multer=require(_0xdf5c('0x0'));var util=require(_0xdf5c('0x1'));var path=require(_0xdf5c('0x2'));var timeout=require(_0xdf5c('0x3'));var express=require(_0xdf5c('0x4'));var router=express[_0xdf5c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf5c('0x6'));var interaction=require(_0xdf5c('0x7'));var config=require(_0xdf5c('0x8'));var controller=require(_0xdf5c('0x9'));router[_0xdf5c('0xa')]('/',controller[_0xdf5c('0xb')]);module[_0xdf5c('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5d85186..94496c6 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 _0x5529=['STRING','version','exports'];(function(_0x5460aa,_0x48b3c3){var _0x66394d=function(_0x133e60){while(--_0x133e60){_0x5460aa['push'](_0x5460aa['shift']());}};_0x66394d(++_0x48b3c3);}(_0x5529,0x188));var _0x9552=function(_0x51215f,_0x298675){_0x51215f=_0x51215f-0x0;var _0x2a5f60=_0x5529[_0x51215f];return _0x2a5f60;};'use strict';var Sequelize=require('sequelize');module[_0x9552('0x0')]={'version':{'type':Sequelize[_0x9552('0x1')],'unique':_0x9552('0x2')}}; \ No newline at end of file +var _0x2e0b=['exports','STRING','version'];(function(_0xa59345,_0x86f01c){var _0x22fc32=function(_0x1c5423){while(--_0x1c5423){_0xa59345['push'](_0xa59345['shift']());}};_0x22fc32(++_0x86f01c);}(_0x2e0b,0x6f));var _0xb2e0=function(_0x3cd590,_0x54deaa){_0x3cd590=_0x3cd590-0x0;var _0x149858=_0x2e0b[_0x3cd590];return _0x149858;};'use strict';var Sequelize=require('sequelize');module[_0xb2e0('0x0')]={'version':{'type':Sequelize[_0xb2e0('0x1')],'unique':_0xb2e0('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 17bedd6..7fbf79d 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 _0xbbdb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','Migration','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3eb87a,_0x4d2fe2){var _0x172678=function(_0x4a7c5e){while(--_0x4a7c5e){_0x3eb87a['push'](_0x3eb87a['shift']());}};_0x172678(++_0x4d2fe2);}(_0xbbdb,0x18b));var _0xbbbd=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xbbdb[_0x4b12ae];return _0x16957b;};'use strict';var emlformat=require(_0xbbbd('0x0'));var rimraf=require(_0xbbbd('0x1'));var zipdir=require(_0xbbbd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbbd('0x3'));var moment=require(_0xbbbd('0x4'));var BPromise=require(_0xbbbd('0x5'));var Mustache=require(_0xbbbd('0x6'));var util=require(_0xbbbd('0x7'));var path=require(_0xbbbd('0x8'));var sox=require(_0xbbbd('0x9'));var csv=require(_0xbbbd('0xa'));var ejs=require(_0xbbbd('0xb'));var fs=require('fs');var fs_extra=require(_0xbbbd('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbbbd('0xd'));var deskjs=require(_0xbbbd('0xe'));var toCsv=require(_0xbbbd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbbbd('0xf'));var authService=require(_0xbbbd('0x10'));var qs=require(_0xbbbd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbbd('0x12'));var logger=require('../../config/logger')(_0xbbbd('0x13'));var utils=require('../../config/utils');var config=require(_0xbbbd('0x14'));var licenseUtil=require(_0xbbbd('0x15'));var db=require(_0xbbbd('0x16'))['db'];function respondWithStatusCode(_0xf9ab59,_0x31c3d6){_0x31c3d6=_0x31c3d6||0xcc;return function(_0x3eaef4){if(_0x3eaef4){return _0xf9ab59[_0xbbbd('0x17')](_0x31c3d6);}return _0xf9ab59[_0xbbbd('0x18')](_0x31c3d6)['end']();};}function respondWithResult(_0x129e23,_0x34aa9d){_0x34aa9d=_0x34aa9d||0xc8;return function(_0x4bdcb1){if(_0x4bdcb1){return _0x129e23[_0xbbbd('0x18')](_0x34aa9d)[_0xbbbd('0x19')](_0x4bdcb1);}};}function respondWithFilteredResult(_0x378ee3,_0x56ce1c){return function(_0xd1f02d){if(_0xd1f02d){var _0xb90ed1=typeof _0x56ce1c[_0xbbbd('0x1a')]===_0xbbbd('0x1b')&&typeof _0x56ce1c[_0xbbbd('0x1c')]===_0xbbbd('0x1b');var _0x50e1f8=_0xd1f02d['count'];var _0x5c0629=_0xb90ed1?0x0:_0x56ce1c[_0xbbbd('0x1a')];var _0x5d4796=_0xb90ed1?_0xd1f02d[_0xbbbd('0x1d')]:_0x56ce1c['offset']+_0x56ce1c[_0xbbbd('0x1c')];var _0x2cc307;if(_0x5d4796>=_0x50e1f8){_0x5d4796=_0x50e1f8;_0x2cc307=0xc8;}else{_0x2cc307=0xce;}_0x378ee3['status'](_0x2cc307);return _0x378ee3[_0xbbbd('0x1e')](_0xbbbd('0x1f'),_0x5c0629+'-'+_0x5d4796+'/'+_0x50e1f8)[_0xbbbd('0x19')](_0xd1f02d);}return null;};}function patchUpdates(_0x28f612){return function(_0x5f39cc){try{jsonpatch[_0xbbbd('0x20')](_0x5f39cc,_0x28f612,!![]);}catch(_0x1a27fb){return BPromise[_0xbbbd('0x21')](_0x1a27fb);}return _0x5f39cc['save']();};}function saveUpdates(_0x32cf41,_0x407fbd){return function(_0xbad567){if(_0xbad567){return _0xbad567[_0xbbbd('0x22')](_0x32cf41)['then'](function(_0x428778){return _0x428778;});}return null;};}function removeEntity(_0x289d79,_0x2556bb){return function(_0x4e2274){if(_0x4e2274){return _0x4e2274[_0xbbbd('0x23')]()[_0xbbbd('0x24')](function(){_0x289d79[_0xbbbd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fd4e,_0x16ec70){return function(_0x1000ae){if(!_0x1000ae){_0x30fd4e[_0xbbbd('0x17')](0x194);}return _0x1000ae;};}function handleError(_0x46d5a7,_0x536350){_0x536350=_0x536350||0x1f4;return function(_0x4f73bb){logger[_0xbbbd('0x25')](_0x4f73bb[_0xbbbd('0x26')]);if(_0x4f73bb[_0xbbbd('0x27')]){delete _0x4f73bb[_0xbbbd('0x27')];}_0x46d5a7[_0xbbbd('0x18')](_0x536350)[_0xbbbd('0x28')](_0x4f73bb);};}exports[_0xbbbd('0x29')]=function(_0x2281d2,_0x1f4709){var _0x4f9187={},_0x3ad5ed={},_0x278f9c={'count':0x0,'rows':[]};var _0x14839c=_[_0xbbbd('0x2a')](db[_0xbbbd('0x2b')]['rawAttributes'],function(_0x2960c0){return{'name':_0x2960c0[_0xbbbd('0x2c')],'type':_0x2960c0['type'][_0xbbbd('0x2d')]};});_0x3ad5ed[_0xbbbd('0x2e')]=_[_0xbbbd('0x2a')](_0x14839c,_0xbbbd('0x27'));_0x3ad5ed[_0xbbbd('0x2f')]=_[_0xbbbd('0x30')](_0x2281d2[_0xbbbd('0x2f')]);_0x3ad5ed['filters']=_[_0xbbbd('0x31')](_0x3ad5ed['model'],_0x3ad5ed[_0xbbbd('0x2f')]);_0x4f9187[_0xbbbd('0x32')]=_[_0xbbbd('0x31')](_0x3ad5ed[_0xbbbd('0x2e')],qs[_0xbbbd('0x33')](_0x2281d2[_0xbbbd('0x2f')][_0xbbbd('0x33')]));_0x4f9187[_0xbbbd('0x32')]=_0x4f9187[_0xbbbd('0x32')][_0xbbbd('0x34')]?_0x4f9187[_0xbbbd('0x32')]:_0x3ad5ed[_0xbbbd('0x2e')];if(!_0x2281d2[_0xbbbd('0x2f')]['hasOwnProperty'](_0xbbbd('0x35'))){_0x4f9187[_0xbbbd('0x1c')]=qs[_0xbbbd('0x1c')](_0x2281d2[_0xbbbd('0x2f')][_0xbbbd('0x1c')]);_0x4f9187[_0xbbbd('0x1a')]=qs[_0xbbbd('0x1a')](_0x2281d2['query']['offset']);}_0x4f9187[_0xbbbd('0x36')]=qs[_0xbbbd('0x37')](_0x2281d2['query']['sort']);_0x4f9187[_0xbbbd('0x38')]=qs[_0xbbbd('0x39')](_[_0xbbbd('0x3a')](_0x2281d2['query'],_0x3ad5ed[_0xbbbd('0x39')]),_0x14839c);if(_0x2281d2[_0xbbbd('0x2f')]['filter']){_0x4f9187[_0xbbbd('0x38')]=_['merge'](_0x4f9187[_0xbbbd('0x38')],{'$or':_[_0xbbbd('0x2a')](_0x14839c,function(_0x2ca50e){if(_0x2ca50e[_0xbbbd('0x3b')]!==_0xbbbd('0x3c')){var _0x36ac7b={};_0x36ac7b[_0x2ca50e[_0xbbbd('0x27')]]={'$like':'%'+_0x2281d2[_0xbbbd('0x2f')][_0xbbbd('0x3d')]+'%'};return _0x36ac7b;}})});}_0x4f9187=_[_0xbbbd('0x3e')]({},_0x4f9187,_0x2281d2[_0xbbbd('0x3f')]);var _0x4aebbe={'where':_0x4f9187['where']};return db['Migration'][_0xbbbd('0x1d')](_0x4aebbe)[_0xbbbd('0x24')](function(_0x471d52){_0x278f9c['count']=_0x471d52;if(_0x2281d2[_0xbbbd('0x2f')][_0xbbbd('0x40')]){_0x4f9187[_0xbbbd('0x41')]=[{'all':!![]}];}return db[_0xbbbd('0x2b')][_0xbbbd('0x42')](_0x4f9187);})[_0xbbbd('0x24')](function(_0x340415){_0x278f9c[_0xbbbd('0x43')]=_0x340415;return _0x278f9c;})[_0xbbbd('0x24')](respondWithFilteredResult(_0x1f4709,_0x4f9187))[_0xbbbd('0x44')](handleError(_0x1f4709,null));}; \ No newline at end of file +var _0xd61d=['include','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','update','then','stack','send','index','map','Migration','fieldName','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options'];(function(_0x4346fe,_0x1957a2){var _0x3bfbe0=function(_0xd35983){while(--_0xd35983){_0x4346fe['push'](_0x4346fe['shift']());}};_0x3bfbe0(++_0x1957a2);}(_0xd61d,0x100));var _0xdd61=function(_0x3a5b8f,_0x5b803d){_0x3a5b8f=_0x3a5b8f-0x0;var _0xef0679=_0xd61d[_0x3a5b8f];return _0xef0679;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd61('0x0'));var zipdir=require(_0xdd61('0x1'));var jsonpatch=require(_0xdd61('0x2'));var rp=require(_0xdd61('0x3'));var moment=require(_0xdd61('0x4'));var BPromise=require(_0xdd61('0x5'));var Mustache=require('mustache');var util=require(_0xdd61('0x6'));var path=require(_0xdd61('0x7'));var sox=require('sox');var csv=require(_0xdd61('0x8'));var ejs=require(_0xdd61('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd61('0xa'));var squel=require(_0xdd61('0xb'));var crypto=require(_0xdd61('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdd61('0xd'));var toCsv=require(_0xdd61('0x8'));var querystring=require(_0xdd61('0xe'));var Papa=require(_0xdd61('0xf'));var Redis=require(_0xdd61('0x10'));var authService=require(_0xdd61('0x11'));var qs=require(_0xdd61('0x12'));var as=require(_0xdd61('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd61('0x14'))('api');var utils=require(_0xdd61('0x15'));var config=require(_0xdd61('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x539a83,_0x55cbf3){_0x55cbf3=_0x55cbf3||0xcc;return function(_0x2b9d86){if(_0x2b9d86){return _0x539a83[_0xdd61('0x17')](_0x55cbf3);}return _0x539a83[_0xdd61('0x18')](_0x55cbf3)[_0xdd61('0x19')]();};}function respondWithResult(_0x3bd302,_0x2ae8cd){_0x2ae8cd=_0x2ae8cd||0xc8;return function(_0x241a22){if(_0x241a22){return _0x3bd302[_0xdd61('0x18')](_0x2ae8cd)['json'](_0x241a22);}};}function respondWithFilteredResult(_0x4cd315,_0x302c6b){return function(_0x1b19cf){if(_0x1b19cf){var _0x5d6dce=typeof _0x302c6b[_0xdd61('0x1a')]===_0xdd61('0x1b')&&typeof _0x302c6b['limit']==='undefined';var _0x192a11=_0x1b19cf['count'];var _0x3a2d22=_0x5d6dce?0x0:_0x302c6b['offset'];var _0x4669ac=_0x5d6dce?_0x1b19cf[_0xdd61('0x1c')]:_0x302c6b['offset']+_0x302c6b[_0xdd61('0x1d')];var _0x4bb1bb;if(_0x4669ac>=_0x192a11){_0x4669ac=_0x192a11;_0x4bb1bb=0xc8;}else{_0x4bb1bb=0xce;}_0x4cd315['status'](_0x4bb1bb);return _0x4cd315[_0xdd61('0x1e')]('Content-Range',_0x3a2d22+'-'+_0x4669ac+'/'+_0x192a11)[_0xdd61('0x1f')](_0x1b19cf);}return null;};}function patchUpdates(_0x6cdfb8){return function(_0x3eb239){try{jsonpatch[_0xdd61('0x20')](_0x3eb239,_0x6cdfb8,!![]);}catch(_0x40e28c){return BPromise['reject'](_0x40e28c);}return _0x3eb239[_0xdd61('0x21')]();};}function saveUpdates(_0x237598,_0x294d31){return function(_0x1203e9){if(_0x1203e9){return _0x1203e9[_0xdd61('0x22')](_0x237598)[_0xdd61('0x23')](function(_0x2ce87b){return _0x2ce87b;});}return null;};}function removeEntity(_0x24e9f4,_0x48a53b){return function(_0x25a8e5){if(_0x25a8e5){return _0x25a8e5['destroy']()['then'](function(){_0x24e9f4[_0xdd61('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x342e93,_0x3bd49c){return function(_0x3b1d68){if(!_0x3b1d68){_0x342e93[_0xdd61('0x17')](0x194);}return _0x3b1d68;};}function handleError(_0x4e0e87,_0x2394be){_0x2394be=_0x2394be||0x1f4;return function(_0x2b19df){logger['error'](_0x2b19df[_0xdd61('0x24')]);if(_0x2b19df['name']){delete _0x2b19df['name'];}_0x4e0e87[_0xdd61('0x18')](_0x2394be)[_0xdd61('0x25')](_0x2b19df);};}exports[_0xdd61('0x26')]=function(_0x514cab,_0x289757){var _0x3bcd75={},_0x36aedb={},_0x368d5a={'count':0x0,'rows':[]};var _0x69c797=_[_0xdd61('0x27')](db[_0xdd61('0x28')]['rawAttributes'],function(_0x1c6251){return{'name':_0x1c6251[_0xdd61('0x29')],'type':_0x1c6251[_0xdd61('0x2a')]['key']};});_0x36aedb[_0xdd61('0x2b')]=_[_0xdd61('0x27')](_0x69c797,_0xdd61('0x2c'));_0x36aedb[_0xdd61('0x2d')]=_[_0xdd61('0x2e')](_0x514cab[_0xdd61('0x2d')]);_0x36aedb['filters']=_[_0xdd61('0x2f')](_0x36aedb[_0xdd61('0x2b')],_0x36aedb[_0xdd61('0x2d')]);_0x3bcd75[_0xdd61('0x30')]=_[_0xdd61('0x2f')](_0x36aedb[_0xdd61('0x2b')],qs[_0xdd61('0x31')](_0x514cab['query']['fields']));_0x3bcd75[_0xdd61('0x30')]=_0x3bcd75[_0xdd61('0x30')][_0xdd61('0x32')]?_0x3bcd75['attributes']:_0x36aedb['model'];if(!_0x514cab[_0xdd61('0x2d')][_0xdd61('0x33')]('nolimit')){_0x3bcd75[_0xdd61('0x1d')]=qs['limit'](_0x514cab[_0xdd61('0x2d')][_0xdd61('0x1d')]);_0x3bcd75[_0xdd61('0x1a')]=qs['offset'](_0x514cab['query'][_0xdd61('0x1a')]);}_0x3bcd75[_0xdd61('0x34')]=qs[_0xdd61('0x35')](_0x514cab[_0xdd61('0x2d')]['sort']);_0x3bcd75[_0xdd61('0x36')]=qs[_0xdd61('0x37')](_['pick'](_0x514cab[_0xdd61('0x2d')],_0x36aedb[_0xdd61('0x37')]),_0x69c797);if(_0x514cab[_0xdd61('0x2d')][_0xdd61('0x38')]){_0x3bcd75[_0xdd61('0x36')]=_[_0xdd61('0x39')](_0x3bcd75[_0xdd61('0x36')],{'$or':_[_0xdd61('0x27')](_0x69c797,function(_0x6b2b20){if(_0x6b2b20[_0xdd61('0x2a')]!=='VIRTUAL'){var _0x35044b={};_0x35044b[_0x6b2b20[_0xdd61('0x2c')]]={'$like':'%'+_0x514cab['query'][_0xdd61('0x38')]+'%'};return _0x35044b;}})});}_0x3bcd75=_[_0xdd61('0x39')]({},_0x3bcd75,_0x514cab[_0xdd61('0x3a')]);var _0xe3ff86={'where':_0x3bcd75[_0xdd61('0x36')]};return db['Migration'][_0xdd61('0x1c')](_0xe3ff86)['then'](function(_0x4ffdf4){_0x368d5a[_0xdd61('0x1c')]=_0x4ffdf4;if(_0x514cab['query']['includeAll']){_0x3bcd75[_0xdd61('0x3b')]=[{'all':!![]}];}return db[_0xdd61('0x28')][_0xdd61('0x3c')](_0x3bcd75);})['then'](function(_0x4042c2){_0x368d5a[_0xdd61('0x3d')]=_0x4042c2;return _0x368d5a;})['then'](respondWithFilteredResult(_0x289757,_0x3bcd75))[_0xdd61('0x3e')](handleError(_0x289757,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 02f1b60..0d59267 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 _0x0f16=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','util','../../config/logger'];(function(_0x3714a0,_0x3775e4){var _0x430d52=function(_0xc846cb){while(--_0xc846cb){_0x3714a0['push'](_0x3714a0['shift']());}};_0x430d52(++_0x3775e4);}(_0x0f16,0x1d2));var _0x60f1=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0f16[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x60f1('0x0'));var logger=require(_0x60f1('0x1'))(_0x60f1('0x2'));var moment=require(_0x60f1('0x3'));var BPromise=require(_0x60f1('0x4'));var rp=require(_0x60f1('0x5'));var fs=require('fs');var path=require(_0x60f1('0x6'));var rimraf=require(_0x60f1('0x7'));var config=require(_0x60f1('0x8'));var attributes=require(_0x60f1('0x9'));module[_0x60f1('0xa')]=function(_0xe5d062,_0x4645a3){return _0xe5d062[_0x60f1('0xb')](_0x60f1('0xc'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6b4=['define','migrations','../../config/logger','moment','bluebird','request-promise','rimraf','./migration.attributes','exports'];(function(_0xb3ed81,_0x3479a8){var _0x3a5c36=function(_0x6ce423){while(--_0x6ce423){_0xb3ed81['push'](_0xb3ed81['shift']());}};_0x3a5c36(++_0x3479a8);}(_0xd6b4,0x110));var _0x4d6b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd6b4[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4d6b('0x0'))('api');var moment=require(_0x4d6b('0x1'));var BPromise=require(_0x4d6b('0x2'));var rp=require(_0x4d6b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d6b('0x4'));var config=require('../../config/environment');var attributes=require(_0x4d6b('0x5'));module[_0x4d6b('0x6')]=function(_0xde6541,_0xf7fa0e){return _0xde6541[_0x4d6b('0x7')]('Migration',attributes,{'tableName':_0x4d6b('0x8'),'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 14eb610..1c1479b 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 _0xb575=['bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x4c414b,_0x5da92c){var _0x2bf2c1=function(_0x159d88){while(--_0x159d88){_0x4c414b['push'](_0x4c414b['shift']());}};_0x2bf2c1(++_0x5da92c);}(_0xb575,0xda));var _0x5b57=function(_0x12c8fb,_0x2c14e5){_0x12c8fb=_0x12c8fb-0x0;var _0x3488c8=_0xb575[_0x12c8fb];return _0x3488c8;};'use strict';var _=require(_0x5b57('0x0'));var util=require(_0x5b57('0x1'));var moment=require('moment');var BPromise=require(_0x5b57('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b57('0x3'));var logger=require(_0x5b57('0x4'))('rpc');var config=require(_0x5b57('0x5'));var jayson=require(_0x5b57('0x6'));var client=jayson[_0x5b57('0x7')][_0x5b57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x672beb,_0x5d223d,_0x4232d0){return new BPromise(function(_0x5dd0c7,_0x2f9789){return client[_0x5b57('0x9')](_0x672beb,_0x4232d0)[_0x5b57('0xa')](function(_0x49ce3a){logger[_0x5b57('0xb')](_0x5b57('0xc'),_0x5d223d,_0x5b57('0xd'));logger['debug'](_0x5b57('0xe'),_0x5d223d,_0x5b57('0xd'),JSON['stringify'](_0x49ce3a));if(_0x49ce3a['error']){if(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x10')]===0x1f4){logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);return _0x2f9789(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);}logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x49ce3a['error'][_0x5b57('0x11')]);return _0x5dd0c7(_0x49ce3a[_0x5b57('0xf')][_0x5b57('0x11')]);}else{logger['info'](_0x5b57('0xc'),_0x5d223d,_0x5b57('0xd'));_0x5dd0c7(_0x49ce3a[_0x5b57('0x12')][_0x5b57('0x11')]);}})[_0x5b57('0x13')](function(_0x1e7cc0){logger[_0x5b57('0xf')](_0x5b57('0xc'),_0x5d223d,_0x1e7cc0);_0x2f9789(_0x1e7cc0);});});} \ No newline at end of file +var _0x6822=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','Migration,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x6822,0x18c));var _0x2682=function(_0x49b123,_0x53b56c){_0x49b123=_0x49b123-0x0;var _0x3da195=_0x6822[_0x49b123];return _0x3da195;};'use strict';var _=require('lodash');var util=require(_0x2682('0x0'));var moment=require(_0x2682('0x1'));var BPromise=require(_0x2682('0x2'));var rs=require(_0x2682('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2682('0x4'))['db'];var utils=require(_0x2682('0x5'));var logger=require(_0x2682('0x6'))(_0x2682('0x7'));var config=require(_0x2682('0x8'));var jayson=require(_0x2682('0x9'));var client=jayson[_0x2682('0xa')][_0x2682('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35f55b,_0x3f706c,_0x4242c5){return new BPromise(function(_0x1a1307,_0x303fe4){return client[_0x2682('0xc')](_0x35f55b,_0x4242c5)['then'](function(_0x3e72bc){logger[_0x2682('0xd')]('Migration,\x20%s,\x20%s',_0x3f706c,'request\x20sent');logger['debug'](_0x2682('0xe'),_0x3f706c,_0x2682('0xf'),JSON['stringify'](_0x3e72bc));if(_0x3e72bc[_0x2682('0x10')]){if(_0x3e72bc[_0x2682('0x10')]['code']===0x1f4){logger[_0x2682('0x10')](_0x2682('0x11'),_0x3f706c,_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);return _0x303fe4(_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);}logger[_0x2682('0x10')](_0x2682('0x11'),_0x3f706c,_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);return _0x1a1307(_0x3e72bc[_0x2682('0x10')][_0x2682('0x12')]);}else{logger[_0x2682('0xd')](_0x2682('0x11'),_0x3f706c,_0x2682('0xf'));_0x1a1307(_0x3e72bc['result']['message']);}})[_0x2682('0x13')](function(_0x2b1ed2){logger[_0x2682('0x10')]('Migration,\x20%s,\x20%s',_0x3f706c,_0x2b1ed2);_0x303fe4(_0x2b1ed2);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3557272..4d65693 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 _0x9906=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','destroy'];(function(_0x175098,_0x3bc941){var _0x10b93=function(_0x4c798c){while(--_0x4c798c){_0x175098['push'](_0x175098['shift']());}};_0x10b93(++_0x3bc941);}(_0x9906,0x1f1));var _0x6990=function(_0x33d7ce,_0x31dd2d){_0x33d7ce=_0x33d7ce-0x0;var _0xe93ae0=_0x9906[_0x33d7ce];return _0xe93ae0;};'use strict';var multer=require(_0x6990('0x0'));var util=require(_0x6990('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6990('0x2'));var router=express[_0x6990('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6990('0x4'));var interaction=require(_0x6990('0x5'));var config=require(_0x6990('0x6'));var controller=require('./network.controller');router[_0x6990('0x7')]('/',auth[_0x6990('0x8')](),controller[_0x6990('0x9')]);router['get'](_0x6990('0xa'),auth[_0x6990('0x8')](),controller['show']);router[_0x6990('0xb')]('/',auth[_0x6990('0x8')](),controller[_0x6990('0xc')]);router['put'](_0x6990('0xa'),auth['isAuthenticated'](),controller[_0x6990('0xd')]);router['delete'](_0x6990('0xa'),auth[_0x6990('0x8')](),controller[_0x6990('0xe')]);module[_0x6990('0xf')]=router; \ No newline at end of file +var _0x023d=['exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x54b0fa,_0x406c2a){var _0x4a6998=function(_0x2497ce){while(--_0x2497ce){_0x54b0fa['push'](_0x54b0fa['shift']());}};_0x4a6998(++_0x406c2a);}(_0x023d,0x67));var _0xd023=function(_0x552166,_0x32ce08){_0x552166=_0x552166-0x0;var _0x3357a7=_0x023d[_0x552166];return _0x3357a7;};'use strict';var multer=require('multer');var util=require(_0xd023('0x0'));var path=require('path');var timeout=require(_0xd023('0x1'));var express=require(_0xd023('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd023('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd023('0x4'));var controller=require(_0xd023('0x5'));router[_0xd023('0x6')]('/',auth[_0xd023('0x7')](),controller[_0xd023('0x8')]);router[_0xd023('0x6')](_0xd023('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xd023('0xa')]('/',auth['isAuthenticated'](),controller[_0xd023('0xb')]);router[_0xd023('0xc')]('/:id',auth[_0xd023('0x7')](),controller[_0xd023('0xd')]);router[_0xd023('0xe')](_0xd023('0x9'),auth[_0xd023('0x7')](),controller[_0xd023('0xf')]);module[_0xd023('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index f58ce6e..abf5b6a 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 _0xe890=['STRING','sequelize','exports','ENUM','localnet','externip','stun','turn'];(function(_0x469d22,_0x1e635b){var _0x391cb9=function(_0x370af0){while(--_0x370af0){_0x469d22['push'](_0x469d22['shift']());}};_0x391cb9(++_0x1e635b);}(_0xe890,0x111));var _0x0e89=function(_0x5474ca,_0x30447c){_0x5474ca=_0x5474ca-0x0;var _0x828a4a=_0xe890[_0x5474ca];return _0x828a4a;};'use strict';var Sequelize=require(_0x0e89('0x0'));module[_0x0e89('0x1')]={'type':{'type':Sequelize[_0x0e89('0x2')](_0x0e89('0x3'),_0x0e89('0x4'),_0x0e89('0x5'),_0x0e89('0x6'))},'value':{'type':Sequelize[_0x0e89('0x7')]},'username':{'type':Sequelize[_0x0e89('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb4d7=['ENUM','localnet','externip','stun','turn','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4d7,0x133));var _0x7b4d=function(_0x5ee694,_0x42ebc9){_0x5ee694=_0x5ee694-0x0;var _0x49a481=_0xb4d7[_0x5ee694];return _0x49a481;};'use strict';var Sequelize=require('sequelize');module[_0x7b4d('0x0')]={'type':{'type':Sequelize[_0x7b4d('0x1')](_0x7b4d('0x2'),_0x7b4d('0x3'),_0x7b4d('0x4'),_0x7b4d('0x5'))},'value':{'type':Sequelize[_0x7b4d('0x6')]},'username':{'type':Sequelize[_0x7b4d('0x6')]},'password':{'type':Sequelize[_0x7b4d('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f076e0c..01093e9 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 _0x5705=['catch','json','offset','undefined','count','limit','status','set','update','then','destroy','end','sendStatus','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Network','includeAll','include','findAll','rows','rawAttributes','merge','find','create','body','toUpperCase','STUN','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','utf8','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','/etc/asterisk/turn_xcally.conf','format','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3d602b,_0x4bae52){var _0x5059ae=function(_0x18bba1){while(--_0x18bba1){_0x3d602b['push'](_0x3d602b['shift']());}};_0x5059ae(++_0x4bae52);}(_0x5705,0x19b));var _0x5570=function(_0x18deef,_0x5b8774){_0x18deef=_0x18deef-0x0;var _0x3f4361=_0x5705[_0x18deef];return _0x3f4361;};'use strict';var util=require(_0x5570('0x0'));var path=require(_0x5570('0x1'));var ejs=require(_0x5570('0x2'));var fs=require('fs');var _=require(_0x5570('0x3'));var qs=require(_0x5570('0x4'));var logger=require('../../config/logger')(_0x5570('0x5'));var config=require(_0x5570('0x6'));var db=require(_0x5570('0x7'))['db'];var jayson=require(_0x5570('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1616e4,_0x3ad94d,_0x10314e,_0x162e96){return new Promise(function(_0xf2c9a5,_0x120db4){var _0x39ac5b=_0x162e96||client;return _0x39ac5b[_0x5570('0x9')](_0x1616e4,_0x10314e)['then'](function(_0x27564f){logger[_0x5570('0xa')](_0x5570('0xb'),_0x3ad94d,_0x5570('0xc'));logger[_0x5570('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x3ad94d,_0x5570('0xc'),JSON[_0x5570('0xe')](_0x27564f));if(_0x27564f[_0x5570('0xf')]){if(_0x27564f[_0x5570('0xf')][_0x5570('0x10')]===0x1f4){logger['error'](_0x5570('0xb'),_0x3ad94d,_0x27564f[_0x5570('0xf')]['message']);return _0x120db4(_0x27564f[_0x5570('0xf')][_0x5570('0x11')]);}logger[_0x5570('0xf')](_0x5570('0xb'),_0x3ad94d,_0x27564f['error'][_0x5570('0x11')]);return _0xf2c9a5(_0x27564f['error'][_0x5570('0x11')]);}else{logger[_0x5570('0xa')](_0x5570('0xb'),_0x3ad94d,_0x5570('0xc'));_0xf2c9a5(_0x27564f[_0x5570('0x12')]['message']);}})[_0x5570('0x13')](function(_0x31f1d1){logger[_0x5570('0xf')](_0x5570('0xb'),_0x3ad94d,_0x31f1d1);_0x120db4(_0x31f1d1);});});}function respondWithResult(_0x5a9545,_0x3e9d1a){_0x3e9d1a=_0x3e9d1a||0xc8;return function(_0x40466b){if(_0x40466b){return _0x5a9545['status'](_0x3e9d1a)[_0x5570('0x14')](_0x40466b);}};}function respondWithFilteredResult(_0x60629,_0x279a60){return function(_0x5463de){if(_0x5463de){var _0x28c9b0=typeof _0x279a60[_0x5570('0x15')]===_0x5570('0x16')&&typeof _0x279a60['limit']==='undefined';var _0x221032=_0x5463de['count'];var _0x8dee18=_0x28c9b0?0x0:_0x279a60['offset'];var _0x2b81cf=_0x28c9b0?_0x5463de[_0x5570('0x17')]:_0x279a60['offset']+_0x279a60[_0x5570('0x18')];var _0x2339f5;if(_0x2b81cf>=_0x221032){_0x2b81cf=_0x221032;_0x2339f5=0xc8;}else{_0x2339f5=0xce;}_0x60629[_0x5570('0x19')](_0x2339f5);return _0x60629[_0x5570('0x1a')]('Content-Range',_0x8dee18+'-'+_0x2b81cf+'/'+_0x221032)[_0x5570('0x14')](_0x5463de);}return null;};}function saveUpdates(_0x57a881){return function(_0x3cebd4){if(_0x3cebd4){return _0x3cebd4[_0x5570('0x1b')](_0x57a881)[_0x5570('0x1c')](function(_0x2a9d92){return _0x2a9d92;});}return null;};}function removeEntity(_0x4997be){return function(_0xf70e){if(_0xf70e){return _0xf70e[_0x5570('0x1d')]()[_0x5570('0x1c')](function(){_0x4997be['status'](0xcc)[_0x5570('0x1e')]();});}};}function handleEntityNotFound(_0x209f47){return function(_0x1dde27){if(!_0x1dde27){_0x209f47[_0x5570('0x1f')](0x194);}return _0x1dde27;};}function handleError(_0x38cca2,_0x163682){_0x163682=_0x163682||0x1f4;return function(_0x268b8d){logger[_0x5570('0xf')](_0x268b8d[_0x5570('0x20')]);if(_0x268b8d[_0x5570('0x21')]){delete _0x268b8d['name'];}_0x38cca2[_0x5570('0x19')](_0x163682)[_0x5570('0x22')](_0x268b8d);};}exports[_0x5570('0x23')]=function(_0x30a5fc,_0x16989f){var _0x106fc6={},_0x50bdd2={},_0x12a4d3={'count':0x0,'rows':[]};var _0x1995c4=_['map'](db['Network']['rawAttributes'],function(_0x3ebe84){return{'name':_0x3ebe84['fieldName'],'type':_0x3ebe84[_0x5570('0x24')][_0x5570('0x25')]};});_0x50bdd2[_0x5570('0x26')]=_[_0x5570('0x27')](_0x1995c4,_0x5570('0x21'));_0x50bdd2[_0x5570('0x28')]=_[_0x5570('0x29')](_0x30a5fc[_0x5570('0x28')]);_0x50bdd2[_0x5570('0x2a')]=_[_0x5570('0x2b')](_0x50bdd2[_0x5570('0x26')],_0x50bdd2['query']);_0x106fc6['attributes']=_[_0x5570('0x2b')](_0x50bdd2[_0x5570('0x26')],qs[_0x5570('0x2c')](_0x30a5fc[_0x5570('0x28')][_0x5570('0x2c')]));_0x106fc6[_0x5570('0x2d')]=_0x106fc6[_0x5570('0x2d')]['length']?_0x106fc6[_0x5570('0x2d')]:_0x50bdd2[_0x5570('0x26')];if(!_0x30a5fc[_0x5570('0x28')][_0x5570('0x2e')](_0x5570('0x2f'))){_0x106fc6[_0x5570('0x18')]=qs[_0x5570('0x18')](_0x30a5fc['query'][_0x5570('0x18')]);_0x106fc6['offset']=qs['offset'](_0x30a5fc[_0x5570('0x28')]['offset']);}_0x106fc6[_0x5570('0x30')]=qs[_0x5570('0x31')](_0x30a5fc[_0x5570('0x28')][_0x5570('0x31')]);_0x106fc6[_0x5570('0x32')]=qs[_0x5570('0x2a')](_[_0x5570('0x33')](_0x30a5fc['query'],_0x50bdd2[_0x5570('0x2a')]),_0x1995c4);if(_0x30a5fc[_0x5570('0x28')][_0x5570('0x34')]){_0x106fc6['where']=_['merge'](_0x106fc6['where'],{'$or':_[_0x5570('0x27')](_0x1995c4,function(_0x42cd03){if(_0x42cd03['type']!==_0x5570('0x35')){var _0xc654a={};_0xc654a[_0x42cd03['name']]={'$like':'%'+_0x30a5fc[_0x5570('0x28')][_0x5570('0x34')]+'%'};return _0xc654a;}})});}_0x106fc6=_['merge']({},_0x106fc6,_0x30a5fc[_0x5570('0x36')]);var _0x5921ad={'where':_0x106fc6[_0x5570('0x32')]};return db[_0x5570('0x37')]['count'](_0x5921ad)[_0x5570('0x1c')](function(_0x2bec7d){_0x12a4d3[_0x5570('0x17')]=_0x2bec7d;if(_0x30a5fc[_0x5570('0x28')][_0x5570('0x38')]){_0x106fc6[_0x5570('0x39')]=[{'all':!![]}];}return db[_0x5570('0x37')][_0x5570('0x3a')](_0x106fc6);})[_0x5570('0x1c')](function(_0x371f89){_0x12a4d3[_0x5570('0x3b')]=_0x371f89;return _0x12a4d3;})['then'](respondWithFilteredResult(_0x16989f,_0x106fc6))['catch'](handleError(_0x16989f,null));};exports['show']=function(_0x2725ca,_0x20699b){var _0x5978e9={'raw':!![],'where':{'id':_0x2725ca['params']['id']}},_0x3973d5={};_0x3973d5[_0x5570('0x26')]=_[_0x5570('0x29')](db[_0x5570('0x37')][_0x5570('0x3c')]);_0x3973d5[_0x5570('0x28')]=_[_0x5570('0x29')](_0x2725ca['query']);_0x3973d5['filters']=_[_0x5570('0x2b')](_0x3973d5[_0x5570('0x26')],_0x3973d5[_0x5570('0x28')]);_0x5978e9[_0x5570('0x2d')]=_['intersection'](_0x3973d5[_0x5570('0x26')],qs[_0x5570('0x2c')](_0x2725ca[_0x5570('0x28')][_0x5570('0x2c')]));_0x5978e9[_0x5570('0x2d')]=_0x5978e9[_0x5570('0x2d')]['length']?_0x5978e9[_0x5570('0x2d')]:_0x3973d5[_0x5570('0x26')];if(_0x2725ca[_0x5570('0x28')][_0x5570('0x38')]){_0x5978e9[_0x5570('0x39')]=[{'all':!![]}];}_0x5978e9=_[_0x5570('0x3d')]({},_0x5978e9,_0x2725ca[_0x5570('0x36')]);return db[_0x5570('0x37')][_0x5570('0x3e')](_0x5978e9)['then'](handleEntityNotFound(_0x20699b,null))[_0x5570('0x1c')](respondWithResult(_0x20699b,null))[_0x5570('0x13')](handleError(_0x20699b,null));};exports[_0x5570('0x3f')]=function(_0xd0c4bc,_0x1634be){var _0x7dc4d2;return db[_0x5570('0x37')][_0x5570('0x3f')](_0xd0c4bc[_0x5570('0x40')],{'raw':!![]})[_0x5570('0x1c')](function(_0x546e7d){_0x7dc4d2=_0x546e7d;return db['Network']['findAll']({'where':{'type':_0xd0c4bc[_0x5570('0x40')][_0x5570('0x24')]},'raw':!![]});})[_0x5570('0x1c')](function(_0x4a7ae9){if(_0x7dc4d2['type'][_0x5570('0x41')]()==_0x5570('0x42')){var _0x25b617=fs['readFileSync'](path['join'](config[_0x5570('0x43')],_0x5570('0x44')),'utf8');var _0x20a57a=ejs[_0x5570('0x45')](_0x25b617,{'networks':_0x4a7ae9||[]});fs[_0x5570('0x46')](_0x5570('0x47'),_0x20a57a);return respondWithRpcPromise(_0x5570('0x48'),_0x5570('0x3f'),{'module':_0x5570('0x49')});}else if(_0x7dc4d2[_0x5570('0x24')][_0x5570('0x41')]()==_0x5570('0x4a')){var _0x45b6b4=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config['root'],_0x5570('0x4d')),_0x5570('0x4e'));var _0xfa9d6f=ejs['render'](_0x45b6b4,{'networks':_0x4a7ae9||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xfa9d6f);return respondWithRpcPromise('Reload',_0x5570('0x3f'),{'module':_0x5570('0x49')});}else{var _0x58ad6e=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config[_0x5570('0x43')],_0x5570('0x4f')),'utf8');var _0x5d8b4c=ejs[_0x5570('0x45')](_0x58ad6e,{'networks':_0x4a7ae9||[]});fs[_0x5570('0x46')](util['format'](_0x5570('0x50'),_0xd0c4bc['body']['type'][_0x5570('0x51')]()),_0x5d8b4c);return respondWithRpcPromise(_0x5570('0x48'),_0x5570('0x3f'),{'module':_0x5570('0x52')});}})[_0x5570('0x1c')](function(){return _0x7dc4d2;})[_0x5570('0x1c')](respondWithResult(_0x1634be,0xc9))[_0x5570('0x13')](handleError(_0x1634be,null));};exports[_0x5570('0x1b')]=function(_0x2ba6bf,_0x2428c6){var _0x3bfe3a;return db['Network'][_0x5570('0x3e')]({'where':{'id':_0x2ba6bf[_0x5570('0x53')]['id']}})[_0x5570('0x1c')](handleEntityNotFound(_0x2428c6,null))['then'](saveUpdates(_0x2ba6bf['body'],null))[_0x5570('0x1c')](function(_0x583ec8){if(_0x583ec8){_0x3bfe3a=_0x583ec8;return db[_0x5570('0x37')][_0x5570('0x3a')]({'where':{'type':_0x3bfe3a[_0x5570('0x24')]},'raw':!![]});}return null;})[_0x5570('0x1c')](function(_0x280c5d){if(_0x3bfe3a[_0x5570('0x24')][_0x5570('0x41')]()=='STUN'){var _0x291363=fs['readFileSync'](path[_0x5570('0x4c')](config['root'],_0x5570('0x44')),'utf8');var _0x4d5867=ejs['render'](_0x291363,{'networks':_0x280c5d||[]});fs[_0x5570('0x46')](_0x5570('0x47'),_0x4d5867);return respondWithRpcPromise('Reload',_0x5570('0x1b'),{'module':_0x5570('0x49')});}else if(_0x3bfe3a[_0x5570('0x24')][_0x5570('0x41')]()==_0x5570('0x4a')){var _0x2fc815=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config[_0x5570('0x43')],_0x5570('0x4d')),_0x5570('0x4e'));var _0x3bbf25=ejs['render'](_0x2fc815,{'networks':_0x280c5d||[]});fs[_0x5570('0x46')](_0x5570('0x54'),_0x3bbf25);return respondWithRpcPromise(_0x5570('0x48'),'update',{'module':_0x5570('0x49')});}else{var _0x6c5c0d=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config[_0x5570('0x43')],_0x5570('0x4f')),_0x5570('0x4e'));var _0x3495f8=ejs[_0x5570('0x45')](_0x6c5c0d,{'networks':_0x280c5d||[]});fs[_0x5570('0x46')](util[_0x5570('0x55')]('/etc/asterisk/sip_xcally_%s.conf',_0x2ba6bf['body'][_0x5570('0x24')]['toLowerCase']()),_0x3495f8);return respondWithRpcPromise(_0x5570('0x48'),'update',{'module':_0x5570('0x52')});}})[_0x5570('0x1c')](function(_0x40b82){if(_0x40b82){return _0x3bfe3a;}return null;})[_0x5570('0x1c')](respondWithResult(_0x2428c6,null))[_0x5570('0x13')](handleError(_0x2428c6,null));};exports[_0x5570('0x1d')]=function(_0x5cae0f,_0x525f6e){var _0x14e2a1;return db[_0x5570('0x37')][_0x5570('0x3e')]({'where':{'id':_0x5cae0f[_0x5570('0x53')]['id']}})[_0x5570('0x1c')](function(_0x314225){_0x14e2a1=_0x314225;return _0x314225;})[_0x5570('0x1c')](handleEntityNotFound(_0x525f6e,null))[_0x5570('0x1c')](removeEntity(_0x525f6e,null))[_0x5570('0x1c')](function(){if(_0x14e2a1){return db['Network'][_0x5570('0x3a')]({'where':{'type':_0x14e2a1['type']},'raw':!![]});}})[_0x5570('0x1c')](function(_0x2ee3fb){if(_0x14e2a1[_0x5570('0x24')]['toUpperCase']()==_0x5570('0x42')){var _0x457033=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config[_0x5570('0x43')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5031bf=ejs['render'](_0x457033,{'networks':_0x2ee3fb||[]});fs[_0x5570('0x46')](_0x5570('0x47'),_0x5031bf);return respondWithRpcPromise('Reload',_0x5570('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x14e2a1['type'][_0x5570('0x41')]()=='TURN'){var _0x3da160=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config[_0x5570('0x43')],_0x5570('0x4d')),_0x5570('0x4e'));var _0xce082a=ejs[_0x5570('0x45')](_0x3da160,{'networks':_0x2ee3fb||[]});fs[_0x5570('0x46')](_0x5570('0x54'),_0xce082a);return respondWithRpcPromise(_0x5570('0x48'),_0x5570('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x3ce791=fs[_0x5570('0x4b')](path[_0x5570('0x4c')](config[_0x5570('0x43')],_0x5570('0x4f')),_0x5570('0x4e'));var _0x327a6f=ejs['render'](_0x3ce791,{'networks':_0x2ee3fb||[]});fs['writeFileSync'](util[_0x5570('0x55')]('/etc/asterisk/sip_xcally_%s.conf',_0x14e2a1[_0x5570('0x24')][_0x5570('0x51')]()),_0x327a6f);return respondWithRpcPromise(_0x5570('0x48'),_0x5570('0x1d'),{'module':_0x5570('0x52')});}})[_0x5570('0x13')](handleError(_0x525f6e,null));}; \ No newline at end of file +var _0x8e90=['rows','show','length','include','find','body','toUpperCase','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','Reload','create','res_stun_monitor.so','readFileSync','join','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','params','STUN','/etc/asterisk/stun_xcally.conf','TURN','format','chan_sip.so','toLowerCase','util','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','stack','name','index','Network','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll'];(function(_0x391e6e,_0x8055ff){var _0x49341d=function(_0xbe81a9){while(--_0xbe81a9){_0x391e6e['push'](_0x391e6e['shift']());}};_0x49341d(++_0x8055ff);}(_0x8e90,0x75));var _0x08e9=function(_0x1bad8a,_0x4a160f){_0x1bad8a=_0x1bad8a-0x0;var _0xfa3b6b=_0x8e90[_0x1bad8a];return _0xfa3b6b;};'use strict';var util=require(_0x08e9('0x0'));var path=require('path');var ejs=require(_0x08e9('0x1'));var fs=require('fs');var _=require(_0x08e9('0x2'));var qs=require(_0x08e9('0x3'));var logger=require(_0x08e9('0x4'))(_0x08e9('0x5'));var config=require(_0x08e9('0x6'));var db=require(_0x08e9('0x7'))['db'];var jayson=require(_0x08e9('0x8'));var client=jayson[_0x08e9('0x9')][_0x08e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d6228,_0xa89dad,_0x1bb8ed,_0x308737){return new Promise(function(_0x570169,_0x58f14a){var _0x2b456f=_0x308737||client;return _0x2b456f[_0x08e9('0xb')](_0x2d6228,_0x1bb8ed)['then'](function(_0x4473a8){logger[_0x08e9('0xc')](_0x08e9('0xd'),_0xa89dad,'request\x20sent');logger[_0x08e9('0xe')]('Network,\x20%s,\x20%s,\x20%s',_0xa89dad,_0x08e9('0xf'),JSON[_0x08e9('0x10')](_0x4473a8));if(_0x4473a8[_0x08e9('0x11')]){if(_0x4473a8[_0x08e9('0x11')][_0x08e9('0x12')]===0x1f4){logger['error'](_0x08e9('0xd'),_0xa89dad,_0x4473a8[_0x08e9('0x11')][_0x08e9('0x13')]);return _0x58f14a(_0x4473a8[_0x08e9('0x11')]['message']);}logger[_0x08e9('0x11')](_0x08e9('0xd'),_0xa89dad,_0x4473a8['error'][_0x08e9('0x13')]);return _0x570169(_0x4473a8[_0x08e9('0x11')][_0x08e9('0x13')]);}else{logger[_0x08e9('0xc')](_0x08e9('0xd'),_0xa89dad,'request\x20sent');_0x570169(_0x4473a8[_0x08e9('0x14')][_0x08e9('0x13')]);}})[_0x08e9('0x15')](function(_0x51e013){logger[_0x08e9('0x11')](_0x08e9('0xd'),_0xa89dad,_0x51e013);_0x58f14a(_0x51e013);});});}function respondWithResult(_0x5be45b,_0x341582){_0x341582=_0x341582||0xc8;return function(_0x292974){if(_0x292974){return _0x5be45b[_0x08e9('0x16')](_0x341582)[_0x08e9('0x17')](_0x292974);}};}function respondWithFilteredResult(_0x4f17e3,_0x336345){return function(_0x4112af){if(_0x4112af){var _0x4ea168=typeof _0x336345[_0x08e9('0x18')]===_0x08e9('0x19')&&typeof _0x336345[_0x08e9('0x1a')]==='undefined';var _0x45d290=_0x4112af[_0x08e9('0x1b')];var _0x26bfa2=_0x4ea168?0x0:_0x336345[_0x08e9('0x18')];var _0x2bf50c=_0x4ea168?_0x4112af[_0x08e9('0x1b')]:_0x336345[_0x08e9('0x18')]+_0x336345[_0x08e9('0x1a')];var _0x2c2d72;if(_0x2bf50c>=_0x45d290){_0x2bf50c=_0x45d290;_0x2c2d72=0xc8;}else{_0x2c2d72=0xce;}_0x4f17e3[_0x08e9('0x16')](_0x2c2d72);return _0x4f17e3[_0x08e9('0x1c')]('Content-Range',_0x26bfa2+'-'+_0x2bf50c+'/'+_0x45d290)[_0x08e9('0x17')](_0x4112af);}return null;};}function saveUpdates(_0x8e1c90){return function(_0x33b047){if(_0x33b047){return _0x33b047[_0x08e9('0x1d')](_0x8e1c90)[_0x08e9('0x1e')](function(_0xb67a9f){return _0xb67a9f;});}return null;};}function removeEntity(_0x27b72b){return function(_0x32a73a){if(_0x32a73a){return _0x32a73a[_0x08e9('0x1f')]()[_0x08e9('0x1e')](function(){_0x27b72b[_0x08e9('0x16')](0xcc)[_0x08e9('0x20')]();});}};}function handleEntityNotFound(_0x101f41){return function(_0x3a2ddf){if(!_0x3a2ddf){_0x101f41[_0x08e9('0x21')](0x194);}return _0x3a2ddf;};}function handleError(_0x241134,_0x5aca27){_0x5aca27=_0x5aca27||0x1f4;return function(_0x23226a){logger[_0x08e9('0x11')](_0x23226a[_0x08e9('0x22')]);if(_0x23226a['name']){delete _0x23226a[_0x08e9('0x23')];}_0x241134[_0x08e9('0x16')](_0x5aca27)['send'](_0x23226a);};}exports[_0x08e9('0x24')]=function(_0x469cff,_0x404a6e){var _0x5a68e7={},_0x58d522={},_0x9005b5={'count':0x0,'rows':[]};var _0x4dd9ba=_['map'](db[_0x08e9('0x25')][_0x08e9('0x26')],function(_0x36939c){return{'name':_0x36939c[_0x08e9('0x27')],'type':_0x36939c[_0x08e9('0x28')][_0x08e9('0x29')]};});_0x58d522['model']=_['map'](_0x4dd9ba,'name');_0x58d522[_0x08e9('0x2a')]=_[_0x08e9('0x2b')](_0x469cff['query']);_0x58d522[_0x08e9('0x2c')]=_[_0x08e9('0x2d')](_0x58d522[_0x08e9('0x2e')],_0x58d522[_0x08e9('0x2a')]);_0x5a68e7[_0x08e9('0x2f')]=_[_0x08e9('0x2d')](_0x58d522[_0x08e9('0x2e')],qs[_0x08e9('0x30')](_0x469cff[_0x08e9('0x2a')][_0x08e9('0x30')]));_0x5a68e7[_0x08e9('0x2f')]=_0x5a68e7['attributes']['length']?_0x5a68e7['attributes']:_0x58d522[_0x08e9('0x2e')];if(!_0x469cff[_0x08e9('0x2a')]['hasOwnProperty'](_0x08e9('0x31'))){_0x5a68e7['limit']=qs['limit'](_0x469cff[_0x08e9('0x2a')][_0x08e9('0x1a')]);_0x5a68e7['offset']=qs[_0x08e9('0x18')](_0x469cff['query'][_0x08e9('0x18')]);}_0x5a68e7[_0x08e9('0x32')]=qs['sort'](_0x469cff[_0x08e9('0x2a')][_0x08e9('0x33')]);_0x5a68e7[_0x08e9('0x34')]=qs[_0x08e9('0x2c')](_[_0x08e9('0x35')](_0x469cff['query'],_0x58d522[_0x08e9('0x2c')]),_0x4dd9ba);if(_0x469cff[_0x08e9('0x2a')][_0x08e9('0x36')]){_0x5a68e7[_0x08e9('0x34')]=_[_0x08e9('0x37')](_0x5a68e7[_0x08e9('0x34')],{'$or':_[_0x08e9('0x38')](_0x4dd9ba,function(_0x152841){if(_0x152841[_0x08e9('0x28')]!==_0x08e9('0x39')){var _0x1924a6={};_0x1924a6[_0x152841[_0x08e9('0x23')]]={'$like':'%'+_0x469cff[_0x08e9('0x2a')][_0x08e9('0x36')]+'%'};return _0x1924a6;}})});}_0x5a68e7=_[_0x08e9('0x37')]({},_0x5a68e7,_0x469cff[_0x08e9('0x3a')]);var _0x25b3ef={'where':_0x5a68e7[_0x08e9('0x34')]};return db['Network'][_0x08e9('0x1b')](_0x25b3ef)[_0x08e9('0x1e')](function(_0x3817fd){_0x9005b5[_0x08e9('0x1b')]=_0x3817fd;if(_0x469cff[_0x08e9('0x2a')][_0x08e9('0x3b')]){_0x5a68e7['include']=[{'all':!![]}];}return db[_0x08e9('0x25')][_0x08e9('0x3c')](_0x5a68e7);})['then'](function(_0x3bb28b){_0x9005b5[_0x08e9('0x3d')]=_0x3bb28b;return _0x9005b5;})[_0x08e9('0x1e')](respondWithFilteredResult(_0x404a6e,_0x5a68e7))[_0x08e9('0x15')](handleError(_0x404a6e,null));};exports[_0x08e9('0x3e')]=function(_0xf2de63,_0x3b4db8){var _0xaa82d1={'raw':!![],'where':{'id':_0xf2de63['params']['id']}},_0x5ecee4={};_0x5ecee4[_0x08e9('0x2e')]=_[_0x08e9('0x2b')](db[_0x08e9('0x25')][_0x08e9('0x26')]);_0x5ecee4[_0x08e9('0x2a')]=_[_0x08e9('0x2b')](_0xf2de63[_0x08e9('0x2a')]);_0x5ecee4[_0x08e9('0x2c')]=_['intersection'](_0x5ecee4['model'],_0x5ecee4[_0x08e9('0x2a')]);_0xaa82d1[_0x08e9('0x2f')]=_[_0x08e9('0x2d')](_0x5ecee4[_0x08e9('0x2e')],qs[_0x08e9('0x30')](_0xf2de63[_0x08e9('0x2a')][_0x08e9('0x30')]));_0xaa82d1[_0x08e9('0x2f')]=_0xaa82d1[_0x08e9('0x2f')][_0x08e9('0x3f')]?_0xaa82d1[_0x08e9('0x2f')]:_0x5ecee4[_0x08e9('0x2e')];if(_0xf2de63['query'][_0x08e9('0x3b')]){_0xaa82d1[_0x08e9('0x40')]=[{'all':!![]}];}_0xaa82d1=_[_0x08e9('0x37')]({},_0xaa82d1,_0xf2de63[_0x08e9('0x3a')]);return db[_0x08e9('0x25')][_0x08e9('0x41')](_0xaa82d1)['then'](handleEntityNotFound(_0x3b4db8,null))['then'](respondWithResult(_0x3b4db8,null))[_0x08e9('0x15')](handleError(_0x3b4db8,null));};exports['create']=function(_0x14df09,_0x2f74f){var _0x7fa9bf;return db[_0x08e9('0x25')]['create'](_0x14df09[_0x08e9('0x42')],{'raw':!![]})['then'](function(_0x28cf2a){_0x7fa9bf=_0x28cf2a;return db[_0x08e9('0x25')][_0x08e9('0x3c')]({'where':{'type':_0x14df09['body']['type']},'raw':!![]});})[_0x08e9('0x1e')](function(_0x487818){if(_0x7fa9bf['type'][_0x08e9('0x43')]()=='STUN'){var _0x1e61d9=fs['readFileSync'](path['join'](config[_0x08e9('0x44')],_0x08e9('0x45')),'utf8');var _0x207bf8=ejs[_0x08e9('0x46')](_0x1e61d9,{'networks':_0x487818||[]});fs[_0x08e9('0x47')]('/etc/asterisk/stun_xcally.conf',_0x207bf8);return respondWithRpcPromise(_0x08e9('0x48'),_0x08e9('0x49'),{'module':_0x08e9('0x4a')});}else if(_0x7fa9bf[_0x08e9('0x28')]['toUpperCase']()=='TURN'){var _0x134038=fs[_0x08e9('0x4b')](path[_0x08e9('0x4c')](config['root'],_0x08e9('0x4d')),_0x08e9('0x4e'));var _0x316d7c=ejs['render'](_0x134038,{'networks':_0x487818||[]});fs['writeFileSync'](_0x08e9('0x4f'),_0x316d7c);return respondWithRpcPromise(_0x08e9('0x48'),_0x08e9('0x49'),{'module':_0x08e9('0x4a')});}else{var _0x23b0e8=fs['readFileSync'](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],_0x08e9('0x50')),'utf8');var _0x365c95=ejs[_0x08e9('0x46')](_0x23b0e8,{'networks':_0x487818||[]});fs[_0x08e9('0x47')](util['format'](_0x08e9('0x51'),_0x14df09['body'][_0x08e9('0x28')]['toLowerCase']()),_0x365c95);return respondWithRpcPromise('Reload',_0x08e9('0x49'),{'module':'chan_sip.so'});}})['then'](function(){return _0x7fa9bf;})['then'](respondWithResult(_0x2f74f,0xc9))[_0x08e9('0x15')](handleError(_0x2f74f,null));};exports[_0x08e9('0x1d')]=function(_0x4716ca,_0x21c07f){var _0x383934;return db[_0x08e9('0x25')][_0x08e9('0x41')]({'where':{'id':_0x4716ca[_0x08e9('0x52')]['id']}})[_0x08e9('0x1e')](handleEntityNotFound(_0x21c07f,null))[_0x08e9('0x1e')](saveUpdates(_0x4716ca['body'],null))[_0x08e9('0x1e')](function(_0x5f1792){if(_0x5f1792){_0x383934=_0x5f1792;return db[_0x08e9('0x25')][_0x08e9('0x3c')]({'where':{'type':_0x383934['type']},'raw':!![]});}return null;})[_0x08e9('0x1e')](function(_0x3de28d){if(_0x383934['type'][_0x08e9('0x43')]()==_0x08e9('0x53')){var _0x39fd3f=fs['readFileSync'](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],_0x08e9('0x45')),'utf8');var _0x4fc7b8=ejs[_0x08e9('0x46')](_0x39fd3f,{'networks':_0x3de28d||[]});fs[_0x08e9('0x47')](_0x08e9('0x54'),_0x4fc7b8);return respondWithRpcPromise('Reload',_0x08e9('0x1d'),{'module':_0x08e9('0x4a')});}else if(_0x383934[_0x08e9('0x28')][_0x08e9('0x43')]()==_0x08e9('0x55')){var _0x20eeb0=fs[_0x08e9('0x4b')](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],'server/files/templates/turn_multiple.ejs'),_0x08e9('0x4e'));var _0x46b2f4=ejs[_0x08e9('0x46')](_0x20eeb0,{'networks':_0x3de28d||[]});fs[_0x08e9('0x47')](_0x08e9('0x4f'),_0x46b2f4);return respondWithRpcPromise('Reload','update',{'module':_0x08e9('0x4a')});}else{var _0x30d40f=fs[_0x08e9('0x4b')](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],'server/files/templates/network.ejs'),_0x08e9('0x4e'));var _0x18c7fe=ejs[_0x08e9('0x46')](_0x30d40f,{'networks':_0x3de28d||[]});fs[_0x08e9('0x47')](util[_0x08e9('0x56')](_0x08e9('0x51'),_0x4716ca['body']['type']['toLowerCase']()),_0x18c7fe);return respondWithRpcPromise(_0x08e9('0x48'),_0x08e9('0x1d'),{'module':_0x08e9('0x57')});}})['then'](function(_0x13232f){if(_0x13232f){return _0x383934;}return null;})['then'](respondWithResult(_0x21c07f,null))['catch'](handleError(_0x21c07f,null));};exports['destroy']=function(_0x2324e3,_0x116a98){var _0x5f0bd5;return db[_0x08e9('0x25')][_0x08e9('0x41')]({'where':{'id':_0x2324e3[_0x08e9('0x52')]['id']}})['then'](function(_0x394347){_0x5f0bd5=_0x394347;return _0x394347;})[_0x08e9('0x1e')](handleEntityNotFound(_0x116a98,null))['then'](removeEntity(_0x116a98,null))[_0x08e9('0x1e')](function(){if(_0x5f0bd5){return db[_0x08e9('0x25')][_0x08e9('0x3c')]({'where':{'type':_0x5f0bd5[_0x08e9('0x28')]},'raw':!![]});}})[_0x08e9('0x1e')](function(_0x5878ef){if(_0x5f0bd5[_0x08e9('0x28')][_0x08e9('0x43')]()==_0x08e9('0x53')){var _0x4cfb8a=fs[_0x08e9('0x4b')](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],_0x08e9('0x45')),_0x08e9('0x4e'));var _0x137e13=ejs[_0x08e9('0x46')](_0x4cfb8a,{'networks':_0x5878ef||[]});fs[_0x08e9('0x47')]('/etc/asterisk/stun_xcally.conf',_0x137e13);return respondWithRpcPromise(_0x08e9('0x48'),_0x08e9('0x1f'),{'module':_0x08e9('0x4a')});}else if(_0x5f0bd5[_0x08e9('0x28')][_0x08e9('0x43')]()==_0x08e9('0x55')){var _0x51b6da=fs[_0x08e9('0x4b')](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],_0x08e9('0x4d')),_0x08e9('0x4e'));var _0x513bf6=ejs[_0x08e9('0x46')](_0x51b6da,{'networks':_0x5878ef||[]});fs[_0x08e9('0x47')](_0x08e9('0x4f'),_0x513bf6);return respondWithRpcPromise('Reload','destroy',{'module':_0x08e9('0x4a')});}else{var _0x5014dc=fs[_0x08e9('0x4b')](path[_0x08e9('0x4c')](config[_0x08e9('0x44')],_0x08e9('0x50')),_0x08e9('0x4e'));var _0x33f1f1=ejs[_0x08e9('0x46')](_0x5014dc,{'networks':_0x5878ef||[]});fs[_0x08e9('0x47')](util[_0x08e9('0x56')](_0x08e9('0x51'),_0x5f0bd5[_0x08e9('0x28')][_0x08e9('0x58')]()),_0x33f1f1);return respondWithRpcPromise(_0x08e9('0x48'),_0x08e9('0x1f'),{'module':_0x08e9('0x57')});}})[_0x08e9('0x15')](handleError(_0x116a98,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8058a7d..9cd38c9 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 _0xa0bc=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','../../config/logger','moment','bluebird'];(function(_0x5983a8,_0x24f4c0){var _0x1c21d0=function(_0x25e271){while(--_0x25e271){_0x5983a8['push'](_0x5983a8['shift']());}};_0x1c21d0(++_0x24f4c0);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('api');var moment=require(_0xca0b('0x2'));var BPromise=require(_0xca0b('0x3'));var rp=require(_0xca0b('0x4'));var fs=require('fs');var path=require(_0xca0b('0x5'));var rimraf=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var attributes=require(_0xca0b('0x8'));module[_0xca0b('0x9')]=function(_0x3cb084,_0x1aac00){return _0x3cb084[_0xca0b('0xa')](_0xca0b('0xb'),attributes,{'tableName':_0xca0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x153f=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./network.attributes','exports','define','network','lodash'];(function(_0x30e806,_0x17935b){var _0x2b5e9b=function(_0x1931ed){while(--_0x1931ed){_0x30e806['push'](_0x30e806['shift']());}};_0x2b5e9b(++_0x17935b);}(_0x153f,0x15b));var _0xf153=function(_0x48f20c,_0x374f9b){_0x48f20c=_0x48f20c-0x0;var _0x4d9a2a=_0x153f[_0x48f20c];return _0x4d9a2a;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var logger=require(_0xf153('0x2'))(_0xf153('0x3'));var moment=require(_0xf153('0x4'));var BPromise=require(_0xf153('0x5'));var rp=require(_0xf153('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf153('0x7'));var config=require('../../config/environment');var attributes=require(_0xf153('0x8'));module[_0xf153('0x9')]=function(_0x342a45,_0xafd987){return _0x342a45[_0xf153('0xa')]('Network',attributes,{'tableName':_0xf153('0xb'),'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 ce6adfc..5b27664 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(_0x18ff8e,_0x395070){var _0x7221b0=function(_0x55f352){while(--_0x55f352){_0x18ff8e['push'](_0x18ff8e['shift']());}};_0x7221b0(++_0x395070);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 _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(_0xf0fb5f,_0x4610a8){var _0x5838b9=function(_0x20d04){while(--_0x20d04){_0xf0fb5f['push'](_0xf0fb5f['shift']());}};_0x5838b9(++_0x4610a8);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 448492e..ba6d788 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 _0x10bc=['addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','exports','path','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','addDisposition','/:id/notify','notify'];(function(_0x108182,_0x2e64bf){var _0x3f1b61=function(_0xc089f0){while(--_0xc089f0){_0x108182['push'](_0x108182['shift']());}};_0x3f1b61(++_0x2e64bf);}(_0x10bc,0x195));var _0xc10b=function(_0xde9e6d,_0x75c766){_0xde9e6d=_0xde9e6d-0x0;var _0x5af0a1=_0x10bc[_0xde9e6d];return _0x5af0a1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc10b('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc10b('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xc10b('0x2'));var interaction=require(_0xc10b('0x3'));var config=require('../../config/environment');var controller=require(_0xc10b('0x4'));router[_0xc10b('0x5')]('/',auth[_0xc10b('0x6')](),controller[_0xc10b('0x7')]);router[_0xc10b('0x5')](_0xc10b('0x8'),auth[_0xc10b('0x6')](),controller[_0xc10b('0x9')]);router['get'](_0xc10b('0xa'),auth[_0xc10b('0x6')](),controller[_0xc10b('0xb')]);router[_0xc10b('0x5')](_0xc10b('0xc'),auth[_0xc10b('0x6')](),controller[_0xc10b('0xd')]);router[_0xc10b('0x5')](_0xc10b('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xc10b('0xf'),auth[_0xc10b('0x6')](),controller[_0xc10b('0x10')]);router[_0xc10b('0x5')]('/:id/interactions',auth[_0xc10b('0x6')](),controller[_0xc10b('0x11')]);router['get'](_0xc10b('0x12'),auth['isAuthenticated'](),controller[_0xc10b('0x13')]);router[_0xc10b('0x14')]('/',auth[_0xc10b('0x6')](),controller['create']);router['post'](_0xc10b('0xc'),auth['isAuthenticated'](),controller[_0xc10b('0x15')]);router[_0xc10b('0x14')](_0xc10b('0xe'),auth[_0xc10b('0x6')](),controller['addAnswer']);router[_0xc10b('0x14')](_0xc10b('0x16'),controller[_0xc10b('0x17')]);router[_0xc10b('0x14')](_0xc10b('0xf'),auth[_0xc10b('0x6')](),controller[_0xc10b('0x18')]);router[_0xc10b('0x14')](_0xc10b('0x12'),auth[_0xc10b('0x6')](),controller[_0xc10b('0x19')]);router[_0xc10b('0x14')](_0xc10b('0x1a'),auth[_0xc10b('0x6')](),controller[_0xc10b('0x1b')]);router[_0xc10b('0x1c')](_0xc10b('0xa'),auth[_0xc10b('0x6')](),controller['update']);router[_0xc10b('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xc10b('0x1e')]);router[_0xc10b('0x1d')](_0xc10b('0xc'),auth[_0xc10b('0x6')](),controller[_0xc10b('0x1f')]);router['delete']('/:id/canned_answers',auth[_0xc10b('0x6')](),controller['removeAnswers']);router[_0xc10b('0x1d')](_0xc10b('0x12'),auth[_0xc10b('0x6')](),controller['removeAgents']);module[_0xc10b('0x20')]=router; \ No newline at end of file +var _0xb8a0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','/:id/users','addAgents','/:id/send','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x3cffb3,_0x284b2d){var _0x57a846=function(_0x32a354){while(--_0x32a354){_0x3cffb3['push'](_0x3cffb3['shift']());}};_0x57a846(++_0x284b2d);}(_0xb8a0,0x74));var _0x0b8a=function(_0x44f893,_0x5b7ac3){_0x44f893=_0x44f893-0x0;var _0x59ff9f=_0xb8a0[_0x44f893];return _0x59ff9f;};'use strict';var multer=require(_0x0b8a('0x0'));var util=require(_0x0b8a('0x1'));var path=require(_0x0b8a('0x2'));var timeout=require(_0x0b8a('0x3'));var express=require('express');var router=express[_0x0b8a('0x4')]();var fs_extra=require(_0x0b8a('0x5'));var auth=require(_0x0b8a('0x6'));var interaction=require(_0x0b8a('0x7'));var config=require(_0x0b8a('0x8'));var controller=require(_0x0b8a('0x9'));router['get']('/',auth[_0x0b8a('0xa')](),controller[_0x0b8a('0xb')]);router[_0x0b8a('0xc')](_0x0b8a('0xd'),auth[_0x0b8a('0xa')](),controller['describe']);router[_0x0b8a('0xc')](_0x0b8a('0xe'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0xf')]);router[_0x0b8a('0xc')](_0x0b8a('0x10'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x11')]);router[_0x0b8a('0xc')](_0x0b8a('0x12'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x13')]);router['get'](_0x0b8a('0x14'),auth[_0x0b8a('0xa')](),controller['getApplications']);router[_0x0b8a('0xc')](_0x0b8a('0x15'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x16')]);router[_0x0b8a('0xc')]('/:id/users',auth['isAuthenticated'](),controller[_0x0b8a('0x17')]);router[_0x0b8a('0x18')]('/',auth[_0x0b8a('0xa')](),controller['create']);router[_0x0b8a('0x18')]('/:id/dispositions',auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x19')]);router[_0x0b8a('0x18')](_0x0b8a('0x12'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x1a')]);router[_0x0b8a('0x18')](_0x0b8a('0x1b'),controller[_0x0b8a('0x1c')]);router[_0x0b8a('0x18')]('/:id/applications',auth[_0x0b8a('0xa')](),controller['addApplications']);router[_0x0b8a('0x18')](_0x0b8a('0x1d'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x1e')]);router[_0x0b8a('0x18')](_0x0b8a('0x1f'),auth[_0x0b8a('0xa')](),controller['send']);router[_0x0b8a('0x20')](_0x0b8a('0xe'),auth['isAuthenticated'](),controller[_0x0b8a('0x21')]);router['delete'](_0x0b8a('0xe'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x22')]);router['delete']('/:id/dispositions',auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x23')]);router[_0x0b8a('0x24')](_0x0b8a('0x12'),auth[_0x0b8a('0xa')](),controller[_0x0b8a('0x25')]);router[_0x0b8a('0x24')]('/:id/users',auth['isAuthenticated'](),controller[_0x0b8a('0x26')]);module[_0x0b8a('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 de8ecc3..7a9e3bd 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 _0x403f=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','generate'];(function(_0x5e7398,_0x1156be){var _0x217c33=function(_0x398b7d){while(--_0x398b7d){_0x5e7398['push'](_0x5e7398['shift']());}};_0x217c33(++_0x1156be);}(_0x403f,0x19c));var _0xf403=function(_0x5eab80,_0x5d1188){_0x5eab80=_0x5eab80-0x0;var _0x5a8b24=_0x403f[_0x5eab80];return _0x5a8b24;};'use strict';var Sequelize=require(_0xf403('0x0'));var rs=require(_0xf403('0x1'));module['exports']={'name':{'type':Sequelize[_0xf403('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf403('0x2')]},'token':{'type':Sequelize[_0xf403('0x2')],'defaultValue':function(){return rs[_0xf403('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf403('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf403('0x4')],'defaultValue':function(){return _0xf403('0x5');}},'notificationSound':{'type':Sequelize[_0xf403('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf403('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf403('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf403('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf403('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf403('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf403('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf403('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xf403('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xf403('0x6')],'defaultValue':![],'comment':_0xf403('0x9'),'set':function(_0x3772bc){if(!_0x3772bc)this[_0xf403('0xa')](_0xf403('0xb'),null);this['setDataValue'](_0xf403('0xc'),_0x3772bc);}}}; \ No newline at end of file +var _0x6354=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x3a6eba,_0x7db8ac){var _0x531c0a=function(_0x349132){while(--_0x349132){_0x3a6eba['push'](_0x3a6eba['shift']());}};_0x531c0a(++_0x7db8ac);}(_0x6354,0x170));var _0x4635=function(_0x42889f,_0x1bddf4){_0x42889f=_0x42889f-0x0;var _0x29936a=_0x6354[_0x42889f];return _0x29936a;};'use strict';var Sequelize=require(_0x4635('0x0'));var rs=require(_0x4635('0x1'));module[_0x4635('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4635('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4635('0x4')]();}},'replyUri':{'type':Sequelize[_0x4635('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4635('0x5')],'defaultValue':function(){return _0x4635('0x6');}},'notificationSound':{'type':Sequelize[_0x4635('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4635('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4635('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4635('0x3')]},'queueTransfer':{'type':Sequelize[_0x4635('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4635('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4635('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4635('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4635('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x4635('0x7')],'defaultValue':![],'comment':_0x4635('0xa'),'set':function(_0x375540){if(!_0x375540)this[_0x4635('0xb')](_0x4635('0xc'),null);this[_0x4635('0xb')](_0x4635('0xd'),_0x375540);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ab64503..14de014 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 _0x99e8=['limit','undefined','count','Content-Range','apply','update','then','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','difference','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','OpenchannelApplication','List','account','applications','Applications','list','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','dataValues','Messages','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset'];(function(_0x3bb27d,_0x1c25a4){var _0x384140=function(_0x1e170e){while(--_0x1e170e){_0x3bb27d['push'](_0x3bb27d['shift']());}};_0x384140(++_0x1c25a4);}(_0x99e8,0x148));var _0x899e=function(_0x16dc47,_0x2fa25b){_0x16dc47=_0x16dc47-0x0;var _0x3c5fad=_0x99e8[_0x16dc47];return _0x3c5fad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x899e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x899e('0x1'));var rp=require(_0x899e('0x2'));var moment=require(_0x899e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x899e('0x4'));var util=require(_0x899e('0x5'));var path=require(_0x899e('0x6'));var sox=require(_0x899e('0x7'));var csv=require(_0x899e('0x8'));var ejs=require(_0x899e('0x9'));var fs=require('fs');var fs_extra=require(_0x899e('0xa'));var _=require(_0x899e('0xb'));var squel=require(_0x899e('0xc'));var crypto=require(_0x899e('0xd'));var jsforce=require(_0x899e('0xe'));var deskjs=require(_0x899e('0xf'));var toCsv=require(_0x899e('0x8'));var querystring=require(_0x899e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x899e('0x11'));var qs=require(_0x899e('0x12'));var as=require(_0x899e('0x13'));var hardwareService=require(_0x899e('0x14'));var logger=require(_0x899e('0x15'))(_0x899e('0x16'));var utils=require(_0x899e('0x17'));var config=require(_0x899e('0x18'));var licenseUtil=require(_0x899e('0x19'));var db=require(_0x899e('0x1a'))['db'];config[_0x899e('0x1b')]=_[_0x899e('0x1c')](config[_0x899e('0x1b')],{'host':_0x899e('0x1d'),'port':0x18eb});var socket=require(_0x899e('0x1e'))(new Redis(config[_0x899e('0x1b')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x899e('0x1f')][_0x899e('0x20')]({'port':0x232c});var client9002=jayson[_0x899e('0x1f')][_0x899e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1140c8,_0x2c700e,_0x268ca1,_0x196471){return new BPromise(function(_0x3238c3,_0x266562){var _0x5cd1b6=_0x196471||client;return _0x5cd1b6[_0x899e('0x21')](_0x1140c8,_0x268ca1)['then'](function(_0x5c2cbd){logger[_0x899e('0x22')](_0x899e('0x23'),_0x2c700e,_0x899e('0x24'));logger['debug'](_0x899e('0x25'),_0x2c700e,_0x899e('0x24'),JSON[_0x899e('0x26')](_0x5c2cbd));if(_0x5c2cbd[_0x899e('0x27')]){if(_0x5c2cbd[_0x899e('0x27')][_0x899e('0x28')]===0x1f4){logger[_0x899e('0x27')](_0x899e('0x23'),_0x2c700e,_0x5c2cbd[_0x899e('0x27')]['message']);return _0x266562(_0x5c2cbd['error'][_0x899e('0x29')]);}logger[_0x899e('0x27')](_0x899e('0x23'),_0x2c700e,_0x5c2cbd['error'][_0x899e('0x29')]);return _0x3238c3(_0x5c2cbd[_0x899e('0x27')][_0x899e('0x29')]);}else{logger[_0x899e('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2c700e,_0x899e('0x24'));_0x3238c3(_0x5c2cbd['result'][_0x899e('0x29')]);}})[_0x899e('0x2a')](function(_0x5b4d4e){logger[_0x899e('0x27')](_0x899e('0x23'),_0x2c700e,_0x5b4d4e);_0x266562(_0x5b4d4e);});});}function respondWithStatusCode(_0x50f53a,_0x3ee775){_0x3ee775=_0x3ee775||0xcc;return function(_0x446909){if(_0x446909){return _0x50f53a[_0x899e('0x2b')](_0x3ee775);}return _0x50f53a['status'](_0x3ee775)[_0x899e('0x2c')]();};}function respondWithResult(_0x559164,_0x4628b5){_0x4628b5=_0x4628b5||0xc8;return function(_0x6a0004){if(_0x6a0004){return _0x559164[_0x899e('0x2d')](_0x4628b5)[_0x899e('0x2e')](_0x6a0004);}};}function respondWithFilteredResult(_0x47100e,_0x3f130c){return function(_0x6739c4){if(_0x6739c4){var _0xab03c1=typeof _0x3f130c[_0x899e('0x2f')]==='undefined'&&typeof _0x3f130c[_0x899e('0x30')]===_0x899e('0x31');var _0x581794=_0x6739c4[_0x899e('0x32')];var _0x234008=_0xab03c1?0x0:_0x3f130c['offset'];var _0x16277d=_0xab03c1?_0x6739c4['count']:_0x3f130c[_0x899e('0x2f')]+_0x3f130c[_0x899e('0x30')];var _0x49862c;if(_0x16277d>=_0x581794){_0x16277d=_0x581794;_0x49862c=0xc8;}else{_0x49862c=0xce;}_0x47100e[_0x899e('0x2d')](_0x49862c);return _0x47100e['set'](_0x899e('0x33'),_0x234008+'-'+_0x16277d+'/'+_0x581794)[_0x899e('0x2e')](_0x6739c4);}return null;};}function patchUpdates(_0x57f2b6){return function(_0xa6d773){try{jsonpatch[_0x899e('0x34')](_0xa6d773,_0x57f2b6,!![]);}catch(_0x44be25){return BPromise['reject'](_0x44be25);}return _0xa6d773['save']();};}function saveUpdates(_0x3b98ec,_0x2c491c){return function(_0x92ede2){if(_0x92ede2){return _0x92ede2[_0x899e('0x35')](_0x3b98ec)[_0x899e('0x36')](function(_0x481c91){return _0x481c91;});}return null;};}function removeEntity(_0x13b39f,_0xda48a8){return function(_0x285782){if(_0x285782){return _0x285782[_0x899e('0x37')]()[_0x899e('0x36')](function(){var _0x2486ac=_0x285782['get']({'plain':!![]});var _0x2e0615=_0x899e('0x38');return db[_0x899e('0x39')][_0x899e('0x37')]({'where':{'type':_0x2e0615,'resourceId':_0x2486ac['id']}})[_0x899e('0x36')](function(){return _0x285782;});})[_0x899e('0x36')](function(){_0x13b39f[_0x899e('0x2d')](0xcc)[_0x899e('0x2c')]();});}};}function handleEntityNotFound(_0x513b50,_0x5e5caf){return function(_0x5ba3ff){if(!_0x5ba3ff){_0x513b50['sendStatus'](0x194);}return _0x5ba3ff;};}function handleError(_0x71dd17,_0x157d5a){_0x157d5a=_0x157d5a||0x1f4;return function(_0x1bceff){logger['error'](_0x1bceff[_0x899e('0x3a')]);if(_0x1bceff[_0x899e('0x3b')]){delete _0x1bceff[_0x899e('0x3b')];}_0x71dd17[_0x899e('0x2d')](_0x157d5a)[_0x899e('0x3c')](_0x1bceff);};}exports['index']=function(_0x535998,_0x5902e0){var _0x4bb1b2={'include':[{'model':db[_0x899e('0x3d')],'as':_0x899e('0x3e')}]},_0x1c0106={},_0x3f55a1={'count':0x0,'rows':[]};var _0x24bc18=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x27afb4){return{'name':_0x27afb4['fieldName'],'type':_0x27afb4[_0x899e('0x3f')][_0x899e('0x40')]};});_0x1c0106['model']=_[_0x899e('0x41')](_0x24bc18,_0x899e('0x3b'));_0x1c0106[_0x899e('0x42')]=_[_0x899e('0x43')](_0x535998[_0x899e('0x42')]);_0x1c0106[_0x899e('0x44')]=_[_0x899e('0x45')](_0x1c0106[_0x899e('0x46')],_0x1c0106[_0x899e('0x42')]);_0x4bb1b2['attributes']=_[_0x899e('0x45')](_0x1c0106[_0x899e('0x46')],qs['fields'](_0x535998[_0x899e('0x42')][_0x899e('0x47')]));_0x4bb1b2[_0x899e('0x48')]=_0x4bb1b2[_0x899e('0x48')][_0x899e('0x49')]?_0x4bb1b2['attributes']:_0x1c0106[_0x899e('0x46')];if(!_0x535998[_0x899e('0x42')]['hasOwnProperty'](_0x899e('0x4a'))){_0x4bb1b2[_0x899e('0x30')]=qs['limit'](_0x535998[_0x899e('0x42')]['limit']);_0x4bb1b2[_0x899e('0x2f')]=qs[_0x899e('0x2f')](_0x535998[_0x899e('0x42')][_0x899e('0x2f')]);}_0x4bb1b2[_0x899e('0x4b')]=qs[_0x899e('0x4c')](_0x535998[_0x899e('0x42')][_0x899e('0x4c')]);_0x4bb1b2[_0x899e('0x4d')]=qs[_0x899e('0x44')](_[_0x899e('0x4e')](_0x535998[_0x899e('0x42')],_0x1c0106['filters']),_0x24bc18);if(_0x535998['query']['filter']){_0x4bb1b2[_0x899e('0x4d')]=_[_0x899e('0x4f')](_0x4bb1b2['where'],{'$or':_[_0x899e('0x41')](_0x24bc18,function(_0x445748){if(_0x445748[_0x899e('0x3f')]!==_0x899e('0x50')){var _0x2897c4={};_0x2897c4[_0x445748['name']]={'$like':'%'+_0x535998['query'][_0x899e('0x51')]+'%'};return _0x2897c4;}})});}_0x4bb1b2=_[_0x899e('0x4f')]({},_0x4bb1b2,_0x535998[_0x899e('0x52')]);var _0x379b85={'where':_0x4bb1b2[_0x899e('0x4d')]};return db[_0x899e('0x53')]['count'](_0x379b85)[_0x899e('0x36')](function(_0x3f6cce){_0x3f55a1[_0x899e('0x32')]=_0x3f6cce;if(_0x535998[_0x899e('0x42')][_0x899e('0x54')]){_0x4bb1b2[_0x899e('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x899e('0x56')](_0x4bb1b2);})[_0x899e('0x36')](function(_0x2c13ee){_0x3f55a1[_0x899e('0x57')]=_0x2c13ee;return _0x3f55a1;})[_0x899e('0x36')](respondWithFilteredResult(_0x5902e0,_0x4bb1b2))[_0x899e('0x2a')](handleError(_0x5902e0,null));};exports['show']=function(_0x16f896,_0x1191fc){var _0x213c15={'raw':![],'where':{'id':_0x16f896[_0x899e('0x58')]['id']},'include':[{'model':db[_0x899e('0x3d')],'as':_0x899e('0x3e')}]},_0x2616d1={};_0x2616d1[_0x899e('0x46')]=_[_0x899e('0x43')](db['OpenchannelAccount'][_0x899e('0x59')]);_0x2616d1['query']=_[_0x899e('0x43')](_0x16f896[_0x899e('0x42')]);_0x2616d1[_0x899e('0x44')]=_[_0x899e('0x45')](_0x2616d1[_0x899e('0x46')],_0x2616d1['query']);_0x213c15[_0x899e('0x48')]=_['intersection'](_0x2616d1['model'],qs[_0x899e('0x47')](_0x16f896['query'][_0x899e('0x47')]));_0x213c15[_0x899e('0x48')]=_0x213c15['attributes'][_0x899e('0x49')]?_0x213c15['attributes']:_0x2616d1[_0x899e('0x46')];if(_0x16f896[_0x899e('0x42')][_0x899e('0x54')]){_0x213c15[_0x899e('0x55')]=[{'all':!![]}];}_0x213c15=_[_0x899e('0x4f')]({},_0x213c15,_0x16f896[_0x899e('0x52')]);return db[_0x899e('0x53')]['find'](_0x213c15)[_0x899e('0x36')](handleEntityNotFound(_0x1191fc,null))[_0x899e('0x36')](respondWithResult(_0x1191fc,null))['catch'](handleError(_0x1191fc,null));};exports[_0x899e('0x5a')]=function(_0x1544cc,_0xe9208a){return db[_0x899e('0x53')]['create'](_0x1544cc[_0x899e('0x5b')],{})[_0x899e('0x36')](function(_0x245f63){var _0x21a260=_0x1544cc[_0x899e('0x5c')][_0x899e('0x5d')]({'plain':!![]});if(!_0x21a260)throw new Error(_0x899e('0x5e'));if(_0x21a260['role']==='user'){var _0x1770f9=_0x245f63['get']({'plain':!![]});var _0x5d0b57=_0x899e('0x38');return db[_0x899e('0x5f')][_0x899e('0x60')]({'where':{'name':_0x5d0b57,'userProfileId':_0x21a260[_0x899e('0x61')]},'raw':!![]})['then'](function(_0x1b7ee8){if(_0x1b7ee8&&_0x1b7ee8['autoAssociation']===0x0){return db[_0x899e('0x39')][_0x899e('0x5a')]({'name':_0x1770f9[_0x899e('0x3b')],'resourceId':_0x1770f9['id'],'type':_0x1b7ee8[_0x899e('0x3b')],'sectionId':_0x1b7ee8['id']},{})[_0x899e('0x36')](function(){return _0x245f63;});}else{return _0x245f63;}})['catch'](function(_0x687d11){logger[_0x899e('0x27')](_0x899e('0x62'),_0x687d11);throw _0x687d11;});}return _0x245f63;})[_0x899e('0x36')](respondWithResult(_0xe9208a,0xc9))[_0x899e('0x2a')](handleError(_0xe9208a,null));};exports[_0x899e('0x35')]=function(_0x453986,_0x131dc3){if(_0x453986['body']['id']){delete _0x453986['body']['id'];}return db[_0x899e('0x53')]['find']({'where':{'id':_0x453986['params']['id']},'include':[{'model':db[_0x899e('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x899e('0x36')](handleEntityNotFound(_0x131dc3,null))[_0x899e('0x36')](saveUpdates(_0x453986[_0x899e('0x5b')],null))[_0x899e('0x36')](respondWithResult(_0x131dc3,null))['catch'](handleError(_0x131dc3,null));};exports[_0x899e('0x37')]=function(_0x1b8026,_0x276722){return db[_0x899e('0x53')]['find']({'where':{'id':_0x1b8026[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x276722,null))[_0x899e('0x36')](removeEntity(_0x276722,null))[_0x899e('0x2a')](handleError(_0x276722,null));};exports[_0x899e('0x63')]=function(_0x127cc4,_0x1747c3){return db[_0x899e('0x53')][_0x899e('0x63')]()[_0x899e('0x36')](respondWithResult(_0x1747c3,null))['catch'](handleError(_0x1747c3,null));};exports['addDisposition']=function(_0x5c3d7a,_0x4a5e30,_0x52a320){if(_0x5c3d7a['body']['id']){delete _0x5c3d7a['body']['id'];}return db['OpenchannelAccount'][_0x899e('0x60')]({'where':{'id':_0x5c3d7a['params']['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x4a5e30,null))['then'](function(_0x26fb34){if(_0x26fb34){_0x5c3d7a[_0x899e('0x5b')][_0x899e('0x64')]=_0x26fb34['id'];return db['Disposition']['create'](_0x5c3d7a[_0x899e('0x5b')]);}})[_0x899e('0x36')](respondWithResult(_0x4a5e30,null))[_0x899e('0x2a')](handleError(_0x4a5e30,null));};exports['getDispositions']=function(_0x1873cc,_0x22302a,_0x1a17d4){var _0x31840c={'raw':![],'where':{}};var _0x277018={};var _0x90f20e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x899e('0x65')]({'where':{'id':_0x1873cc[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x22302a,null))[_0x899e('0x36')](function(_0x4f55b2){if(_0x4f55b2){_0x277018[_0x899e('0x46')]=_[_0x899e('0x43')](db[_0x899e('0x66')][_0x899e('0x59')]);_0x277018[_0x899e('0x42')]=_[_0x899e('0x43')](_0x1873cc[_0x899e('0x42')]);_0x277018[_0x899e('0x44')]=_[_0x899e('0x45')](_0x277018[_0x899e('0x46')],_0x277018['query']);_0x31840c[_0x899e('0x48')]=_[_0x899e('0x45')](_0x277018['model'],qs[_0x899e('0x47')](_0x1873cc[_0x899e('0x42')]['fields']));_0x31840c[_0x899e('0x48')]=_0x31840c[_0x899e('0x48')][_0x899e('0x49')]?_0x31840c[_0x899e('0x48')]:_0x277018[_0x899e('0x46')];if(!_0x1873cc['query'][_0x899e('0x67')](_0x899e('0x4a'))){_0x31840c[_0x899e('0x30')]=qs[_0x899e('0x30')](_0x1873cc[_0x899e('0x42')][_0x899e('0x30')]);_0x31840c[_0x899e('0x2f')]=qs[_0x899e('0x2f')](_0x1873cc[_0x899e('0x42')]['offset']);}_0x31840c[_0x899e('0x4b')]=qs['sort'](_0x1873cc['query'][_0x899e('0x4c')]);_0x31840c[_0x899e('0x4d')]=qs[_0x899e('0x44')](_[_0x899e('0x4e')](_0x1873cc[_0x899e('0x42')],_0x277018[_0x899e('0x44')]));_0x31840c[_0x899e('0x4d')]['OpenchannelAccountId']=_0x4f55b2['id'];if(_0x1873cc[_0x899e('0x42')][_0x899e('0x51')]){_0x31840c[_0x899e('0x4d')]=_[_0x899e('0x4f')](_0x31840c['where'],{'$or':_[_0x899e('0x41')](_0x31840c[_0x899e('0x48')],function(_0x133e12){var _0x573a63={};_0x573a63[_0x133e12]={'$like':'%'+_0x1873cc[_0x899e('0x42')][_0x899e('0x51')]+'%'};return _0x573a63;})});}_0x31840c=_[_0x899e('0x4f')]({},_0x31840c,_0x1873cc['options']);return db[_0x899e('0x66')][_0x899e('0x32')]({'where':_0x31840c[_0x899e('0x4d')]})['then'](function(_0x38675c){_0x90f20e[_0x899e('0x32')]=_0x38675c;if(_0x1873cc[_0x899e('0x42')][_0x899e('0x54')]){_0x31840c['include']=[{'all':!![]}];}return db['Disposition'][_0x899e('0x56')](_0x31840c);})['then'](function(_0x70ac34){_0x90f20e[_0x899e('0x57')]=_0x70ac34;return _0x90f20e;});}})['then'](respondWithFilteredResult(_0x22302a,_0x31840c))[_0x899e('0x2a')](handleError(_0x22302a,null));};exports[_0x899e('0x68')]=function(_0x1eaf23,_0x179202,_0x3890f6){return db[_0x899e('0x53')][_0x899e('0x60')]({'where':{'id':_0x1eaf23['params']['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x179202,null))[_0x899e('0x36')](function(_0x2b0354){if(_0x2b0354){return _0x2b0354[_0x899e('0x68')](_0x1eaf23[_0x899e('0x42')][_0x899e('0x69')]);}})[_0x899e('0x36')](respondWithStatusCode(_0x179202,null))[_0x899e('0x2a')](handleError(_0x179202,null));};exports[_0x899e('0x6a')]=function(_0x200875,_0x17250b,_0x153aa2){if(_0x200875[_0x899e('0x5b')]['id']){delete _0x200875['body']['id'];}return db['OpenchannelAccount'][_0x899e('0x60')]({'where':{'id':_0x200875[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x17250b,null))[_0x899e('0x36')](function(_0x3b23fc){if(_0x3b23fc){_0x200875['body'][_0x899e('0x64')]=_0x3b23fc['id'];return db[_0x899e('0x6b')][_0x899e('0x5a')](_0x200875[_0x899e('0x5b')]);}})[_0x899e('0x36')](respondWithResult(_0x17250b,null))[_0x899e('0x2a')](handleError(_0x17250b,null));};exports[_0x899e('0x6c')]=function(_0x7f1407,_0x41c625,_0x232e2c){var _0x2b2bbe={'raw':![],'where':{}};var _0x346e33={};var _0x3a7123={'count':0x0,'rows':[]};return db[_0x899e('0x53')][_0x899e('0x65')]({'where':{'id':_0x7f1407[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x41c625,null))['then'](function(_0x4d5200){if(_0x4d5200){_0x346e33[_0x899e('0x46')]=_[_0x899e('0x43')](db[_0x899e('0x6b')]['rawAttributes']);_0x346e33['query']=_[_0x899e('0x43')](_0x7f1407['query']);_0x346e33[_0x899e('0x44')]=_[_0x899e('0x45')](_0x346e33['model'],_0x346e33[_0x899e('0x42')]);_0x2b2bbe[_0x899e('0x48')]=_[_0x899e('0x45')](_0x346e33[_0x899e('0x46')],qs[_0x899e('0x47')](_0x7f1407[_0x899e('0x42')]['fields']));_0x2b2bbe[_0x899e('0x48')]=_0x2b2bbe[_0x899e('0x48')][_0x899e('0x49')]?_0x2b2bbe['attributes']:_0x346e33[_0x899e('0x46')];if(!_0x7f1407[_0x899e('0x42')][_0x899e('0x67')](_0x899e('0x4a'))){_0x2b2bbe[_0x899e('0x30')]=qs['limit'](_0x7f1407[_0x899e('0x42')][_0x899e('0x30')]);_0x2b2bbe[_0x899e('0x2f')]=qs['offset'](_0x7f1407[_0x899e('0x42')][_0x899e('0x2f')]);}_0x2b2bbe[_0x899e('0x4b')]=qs[_0x899e('0x4c')](_0x7f1407[_0x899e('0x42')][_0x899e('0x4c')]);_0x2b2bbe['where']=qs['filters'](_[_0x899e('0x4e')](_0x7f1407['query'],_0x346e33[_0x899e('0x44')]));_0x2b2bbe[_0x899e('0x4d')][_0x899e('0x64')]=_0x4d5200['id'];if(_0x7f1407[_0x899e('0x42')]['filter']){_0x2b2bbe['where']=_[_0x899e('0x4f')](_0x2b2bbe[_0x899e('0x4d')],{'$or':_[_0x899e('0x41')](_0x2b2bbe[_0x899e('0x48')],function(_0xc2c7e1){var _0x429d18={};_0x429d18[_0xc2c7e1]={'$like':'%'+_0x7f1407['query'][_0x899e('0x51')]+'%'};return _0x429d18;})});}_0x2b2bbe=_[_0x899e('0x4f')]({},_0x2b2bbe,_0x7f1407[_0x899e('0x52')]);return db[_0x899e('0x6b')][_0x899e('0x32')]({'where':_0x2b2bbe[_0x899e('0x4d')]})[_0x899e('0x36')](function(_0x59cf47){_0x3a7123[_0x899e('0x32')]=_0x59cf47;if(_0x7f1407['query']['includeAll']){_0x2b2bbe['include']=[{'all':!![]}];}return db[_0x899e('0x6b')][_0x899e('0x56')](_0x2b2bbe);})[_0x899e('0x36')](function(_0x2658f3){_0x3a7123['rows']=_0x2658f3;return _0x3a7123;});}})[_0x899e('0x36')](respondWithFilteredResult(_0x41c625,_0x2b2bbe))[_0x899e('0x2a')](handleError(_0x41c625,null));};exports['removeAnswers']=function(_0x1bbd98,_0x31159d,_0x4dba1c){return db[_0x899e('0x53')][_0x899e('0x60')]({'where':{'id':_0x1bbd98[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x31159d,null))[_0x899e('0x36')](function(_0x184849){if(_0x184849){return _0x184849[_0x899e('0x6d')](_0x1bbd98['query']['ids']);}})[_0x899e('0x36')](respondWithStatusCode(_0x31159d,null))[_0x899e('0x2a')](handleError(_0x31159d,null));};exports[_0x899e('0x6e')]=function(_0x53e09b,_0x550ec5,_0x94fb52){var _0x31668b={'body':_0x53e09b['body'],'channel':_0x899e('0x6f')};var _0x1af666=[];var _0x5dd688=[];var _0x245557={};var _0x37aad9=![];return db['CmContact'][_0x899e('0x63')]()[_0x899e('0x36')](function(_0x48aaf8){if(!_0x48aaf8){throw new db[(_0x899e('0x70'))]['ValidationError']('no\x20available\x20attributes');}_0x1af666=_[_0x899e('0x71')](_['keys'](_0x48aaf8),[_0x899e('0x72'),_0x899e('0x73')]);_0x5dd688=_[_0x899e('0x71')](_[_0x899e('0x43')](_0x48aaf8),[_0x899e('0x72'),_0x899e('0x73'),'CompanyId',_0x899e('0x74')]);if(_0x53e09b[_0x899e('0x5b')]['id']){delete _0x53e09b[_0x899e('0x5b')]['id'];}if(_[_0x899e('0x75')](_0x53e09b['body']['from'])){throw new db[(_0x899e('0x70'))]['ValidationError'](_0x899e('0x76'));}if(_[_0x899e('0x75')](_0x53e09b[_0x899e('0x5b')][_0x899e('0x5b')])||_0x53e09b[_0x899e('0x5b')]['body']===''){throw new db[(_0x899e('0x70'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x899e('0x75')](_0x53e09b['body'][_0x899e('0x77')])){throw new db['Sequelize'][(_0x899e('0x78'))](_0x899e('0x79')+_0x5dd688);}if(!_['includes'](_0x5dd688,_0x53e09b['body']['mapKey'])){throw new db[(_0x899e('0x70'))]['ValidationError'](_0x899e('0x7a')+_0x5dd688);}_0x245557[_0x53e09b['body'][_0x899e('0x77')]]=_0x53e09b[_0x899e('0x5b')][_0x899e('0x7b')];})['then'](function(){return db['OpenchannelAccount'][_0x899e('0x60')]({'where':{'id':_0x53e09b['params']['id']},'include':[{'model':db[_0x899e('0x7c')],'as':'List','include':[{'model':db[_0x899e('0x7d')],'as':_0x899e('0x7e'),'where':_0x245557,'limit':0x1,'order':[['updatedAt',_0x899e('0x7f')]]}]},{'model':db[_0x899e('0x80')],'as':'Applications'}]});})[_0x899e('0x36')](handleEntityNotFound(_0x550ec5,null))['then'](function(_0x4c737b){if(_0x4c737b&&_0x4c737b[_0x899e('0x81')]){_0x31668b[_0x899e('0x82')]=_0x4c737b;_0x31668b[_0x899e('0x83')]=_0x4c737b[_0x899e('0x84')];_0x31668b[_0x899e('0x85')]=_0x4c737b['List'];_0x31668b[_0x899e('0x83')]=_['orderBy'](_0x31668b[_0x899e('0x83')],['priority'],['asc']);if(_0x31668b[_0x899e('0x82')]['Applications']){delete _0x31668b[_0x899e('0x82')][_0x899e('0x84')];}if(_0x31668b['account'][_0x899e('0x81')]&&_0x31668b['account'][_0x899e('0x81')]['Contacts'][_0x899e('0x49')]){return _0x31668b[_0x899e('0x82')]['List'][_0x899e('0x7e')][0x0];}var _0x2d2c38=_[_0x899e('0x1c')](_0x53e09b[_0x899e('0x5b')],{'firstName':_0x53e09b[_0x899e('0x5b')][_0x899e('0x7b')],'ListId':_0x4c737b['ListId']});_0x2d2c38[_0x53e09b[_0x899e('0x5b')]['mapKey']]=_0x53e09b['body']['from'];return db[_0x899e('0x7d')][_0x899e('0x5a')](_0x2d2c38,{'fields':_0x1af666,'raw':!![]});}})[_0x899e('0x36')](handleEntityNotFound(_0x550ec5,null))[_0x899e('0x36')](function(_0x59b09a){_0x31668b['contact']=_0x59b09a;if(_0x59b09a){var _0x589184={'ContactId':_0x59b09a['id'],'OpenchannelAccountId':_0x53e09b[_0x899e('0x58')]['id'],'from':(_0x59b09a[_0x899e('0x86')]||'')+'\x20'+(_0x59b09a[_0x899e('0x87')]||'')};var _0x437501={'OpenchannelAccountId':_0x53e09b['params']['id'],'closed':![]};if(_0x53e09b[_0x899e('0x5b')][_0x899e('0x88')]){_0x437501[_0x899e('0x88')]=_0x53e09b[_0x899e('0x5b')][_0x899e('0x88')];return db[_0x899e('0x89')][_0x899e('0x60')]({'where':_0x437501})['then'](function(_0x51d1ae){if(_0x51d1ae){return[_0x51d1ae,![]];}_0x589184[_0x899e('0x88')]=_0x53e09b[_0x899e('0x5b')]['threadId'];_0x589184[_0x899e('0x8a')]=_0x53e09b[_0x899e('0x5b')][_0x899e('0x8a')];return db[_0x899e('0x89')][_0x899e('0x5a')](_0x589184)[_0x899e('0x36')](function(_0x16773b){return[_0x16773b,!![]];});});}else{_0x437501[_0x899e('0x88')]=null;}_0x437501[_0x899e('0x8b')]=_0x59b09a['id'];return db['OpenchannelInteraction'][_0x899e('0x60')]({'where':_0x437501})['then'](function(_0x381a59){if(_0x381a59){return[_0x381a59,![]];}return db[_0x899e('0x89')][_0x899e('0x5a')](_0x589184)[_0x899e('0x36')](function(_0x10260e){return[_0x10260e,!![]];});});}})['spread'](function(_0x45906c,_0x121939){if(_0x45906c){_0x37aad9=_0x121939;if(!_0x121939){var _0x2ef344={'from':(_0x31668b[_0x899e('0x8c')][_0x899e('0x86')]||'')+'\x20'+(_0x31668b[_0x899e('0x8c')][_0x899e('0x87')]||'')};if(_0x53e09b[_0x899e('0x5b')][_0x899e('0x88')]&&_0x53e09b[_0x899e('0x5b')]['messageId']&&_0x53e09b[_0x899e('0x5b')]['threadId']!=_0x53e09b['body'][_0x899e('0x8d')]){_0x2ef344['threadId']=_0x53e09b['body'][_0x899e('0x8d')];}return _0x45906c['update'](_0x2ef344);}else{return _0x45906c;}}})[_0x899e('0x36')](function(_0x4504d1){_0x31668b['interaction']=_0x4504d1[_0x899e('0x5d')]({'plain':!![]});_0x31668b[_0x899e('0x8e')][_0x899e('0x8f')]=_0x37aad9;if(_0x31668b[_0x899e('0x8e')]['created']){if(_0x31668b[_0x899e('0x82')][_0x899e('0x90')]){_0x31668b['applications']['push']({'id':0x0,'priority':_0x31668b['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x899e('0x91')});}}return db[_0x899e('0x92')][_0x899e('0x5a')]({'body':_0x53e09b['body'][_0x899e('0x5b')],'OpenchannelAccountId':_0x53e09b[_0x899e('0x58')]['id'],'OpenchannelInteractionId':_0x4504d1['id'],'direction':'in','ContactId':_0x31668b[_0x899e('0x8c')]['id'],'AttachmentId':_0x53e09b[_0x899e('0x5b')][_0x899e('0x93')]});})[_0x899e('0x36')](function(_0x140dcf){_0x31668b[_0x899e('0x29')]=_0x140dcf;if(!_0x31668b[_0x899e('0x8e')]['UserId'])return;return db[_0x899e('0x94')][_0x899e('0x60')]({'attributes':['id',_0x899e('0x3b')],'where':{'id':_0x31668b[_0x899e('0x8e')][_0x899e('0x95')]}});})[_0x899e('0x36')](function(_0x567724){if(_0x567724){_0x31668b[_0x899e('0x83')][_0x899e('0x96')]({'id':0x0,'priority':0x0,'app':_0x899e('0x97'),'appdata':_0x567724[_0x899e('0x3b')]+','+(_0x31668b['account'][_0x899e('0x98')]||0xa),'interval':_0x899e('0x91')});}if(!_0x31668b['interaction'][_0x899e('0x99')])return;return db[_0x899e('0x9a')]['find']({'attributes':['id',_0x899e('0x3b')],'where':{'id':_0x31668b['interaction'][_0x899e('0x99')]}});})[_0x899e('0x36')](function(_0x2e11d5){if(_0x2e11d5){_0x31668b[_0x899e('0x83')][_0x899e('0x96')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2e11d5[_0x899e('0x3b')]+','+(_0x31668b[_0x899e('0x82')][_0x899e('0x9b')]||0x12c),'interval':_0x899e('0x91')});}return respondWithRpcPromise(_0x899e('0x9c'),_0x899e('0x9d'),_0x31668b);})[_0x899e('0x36')](function(_0x4ef2f7){respondWithRpcPromise(_0x899e('0x9e'),_0x899e('0x9e'),{'event':_0x899e('0x6e'),'message':_0x4ef2f7},client9002);return _0x4ef2f7;})[_0x899e('0x36')](respondWithResult(_0x550ec5,null))['catch'](handleError(_0x550ec5,null));};exports[_0x899e('0x9f')]=function(_0x1f4a30,_0x48e148){var _0x557940=_0x1f4a30[_0x899e('0x58')]['id'];var _0xf53771=_0x1f4a30[_0x899e('0x5b')];var _0xbb8a8d=0xc8;var _0x38ec3c=null;return db[_0x899e('0xa0')][_0x899e('0xa1')]({'isolationLevel':db[_0x899e('0xa0')][_0x899e('0xa2')][_0x899e('0xa3')][_0x899e('0xa4')]},function(_0x2a62df){return db[_0x899e('0x53')][_0x899e('0x65')]({'where':{'id':_0x557940},'transaction':_0x2a62df})[_0x899e('0x36')](function(_0xce3cc1){if(_0xce3cc1){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x557940},'transaction':_0x2a62df})[_0x899e('0x36')](function(){var _0x423371=_['map'](_0xf53771,function(_0x147d2d){_0x147d2d[_0x899e('0x64')]=_0x557940;return _0x147d2d;});return db['OpenchannelApplication'][_0x899e('0xa5')](_0x423371,{'transaction':_0x2a62df});});}else{_0xbb8a8d=0x194;_0x38ec3c=[];}});})[_0x899e('0x36')](function(){if(_0xbb8a8d!==0x194){return db[_0x899e('0x80')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x557940},'order':_0x899e('0xa6')})['then'](function(_0x5147ad){_0x38ec3c=_0x5147ad;});}})[_0x899e('0x2a')](function(_0x127029){_0xbb8a8d=0x1f4;logger[_0x899e('0x27')](_0x127029['stack']);if(_0x127029[_0x899e('0x3b')]){delete _0x127029['name'];}_0x38ec3c=_0x127029;})[_0x899e('0xa7')](function(){if(_0x38ec3c===null){_0x48e148[_0x899e('0x2b')](_0xbb8a8d);}else{if(_0xbb8a8d===0x1f4){_0x48e148[_0x899e('0x2d')](_0xbb8a8d)[_0x899e('0x3c')](_0x38ec3c);}else{_0x48e148['status'](_0xbb8a8d)[_0x899e('0x2e')](_0x38ec3c);}}});};exports[_0x899e('0xa8')]=function(_0x393ef7,_0x56ea92,_0x53fef2){var _0x44522d={};var _0x3d9f7f={};var _0x5b4f59;var _0x35676d;return db['OpenchannelAccount'][_0x899e('0x65')]({'where':{'id':_0x393ef7[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x56ea92,null))[_0x899e('0x36')](function(_0x1d4946){if(_0x1d4946){_0x5b4f59=_0x1d4946;_0x3d9f7f['model']=_[_0x899e('0x43')](db[_0x899e('0x80')]['rawAttributes']);_0x3d9f7f['query']=_[_0x899e('0x43')](_0x393ef7[_0x899e('0x42')]);_0x3d9f7f[_0x899e('0x44')]=_['intersection'](_0x3d9f7f[_0x899e('0x46')],_0x3d9f7f[_0x899e('0x42')]);_0x44522d['attributes']=_[_0x899e('0x45')](_0x3d9f7f['model'],qs[_0x899e('0x47')](_0x393ef7[_0x899e('0x42')][_0x899e('0x47')]));_0x44522d[_0x899e('0x48')]=_0x44522d[_0x899e('0x48')][_0x899e('0x49')]?_0x44522d['attributes']:_0x3d9f7f[_0x899e('0x46')];_0x44522d[_0x899e('0x4b')]=qs[_0x899e('0x4c')](_0x393ef7['query'][_0x899e('0x4c')]);_0x44522d[_0x899e('0x4d')]=qs[_0x899e('0x44')](_[_0x899e('0x4e')](_0x393ef7['query'],_0x3d9f7f[_0x899e('0x44')]));if(_0x393ef7['query'][_0x899e('0x51')]){_0x44522d[_0x899e('0x4d')]=_[_0x899e('0x4f')](_0x44522d[_0x899e('0x4d')],{'$or':_['map'](_0x44522d[_0x899e('0x48')],function(_0x38f674){var _0x91568={};_0x91568[_0x38f674]={'$like':'%'+_0x393ef7[_0x899e('0x42')][_0x899e('0x51')]+'%'};return _0x91568;})});}_0x44522d=_['merge']({},_0x44522d,_0x393ef7[_0x899e('0x52')]);return _0x5b4f59[_0x899e('0xa8')](_0x44522d);}})[_0x899e('0x36')](function(_0x4ff2e6){if(_0x4ff2e6){_0x35676d=_0x4ff2e6[_0x899e('0x49')];if(!_0x393ef7[_0x899e('0x42')][_0x899e('0x67')]('nolimit')){_0x44522d[_0x899e('0x30')]=qs[_0x899e('0x30')](_0x393ef7[_0x899e('0x42')][_0x899e('0x30')]);_0x44522d[_0x899e('0x2f')]=qs[_0x899e('0x2f')](_0x393ef7[_0x899e('0x42')][_0x899e('0x2f')]);}return _0x5b4f59[_0x899e('0xa8')](_0x44522d);}})[_0x899e('0x36')](function(_0x30fe43){if(_0x30fe43){return _0x30fe43?{'count':_0x35676d,'rows':_0x30fe43}:null;}})['then'](respondWithResult(_0x56ea92,null))['catch'](handleError(_0x56ea92,null));};exports[_0x899e('0xa9')]=function(_0x3102c6,_0x5ae0d2,_0x4f2d8b){var _0x4b7c22={'raw':![],'where':{}};var _0xefb99d={};var _0x3f17dd={'count':0x0,'rows':[]};return db[_0x899e('0x53')]['findOne']({'where':{'id':_0x3102c6[_0x899e('0x58')]['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x5ae0d2,null))[_0x899e('0x36')](function(_0x2a3ff1){if(_0x2a3ff1){_0xefb99d[_0x899e('0x46')]=_[_0x899e('0x43')](db[_0x899e('0x89')][_0x899e('0x59')]);_0xefb99d[_0x899e('0x42')]=_[_0x899e('0x43')](_0x3102c6['query']);_0xefb99d[_0x899e('0x44')]=_[_0x899e('0x45')](_0xefb99d[_0x899e('0x46')],_0xefb99d[_0x899e('0x42')]);_0x4b7c22[_0x899e('0x48')]=_[_0x899e('0x45')](_0xefb99d[_0x899e('0x46')],qs[_0x899e('0x47')](_0x3102c6[_0x899e('0x42')][_0x899e('0x47')]));_0x4b7c22[_0x899e('0x48')]=_0x4b7c22[_0x899e('0x48')][_0x899e('0x49')]?_0x4b7c22[_0x899e('0x48')]:_0xefb99d[_0x899e('0x46')];if(!_0x3102c6['query']['hasOwnProperty'](_0x899e('0x4a'))){_0x4b7c22['limit']=qs[_0x899e('0x30')](_0x3102c6[_0x899e('0x42')][_0x899e('0x30')]);_0x4b7c22[_0x899e('0x2f')]=qs[_0x899e('0x2f')](_0x3102c6[_0x899e('0x42')]['offset']);}_0x4b7c22[_0x899e('0x4b')]=qs['sort'](_0x3102c6[_0x899e('0x42')]['sort']);_0x4b7c22[_0x899e('0x4d')]=qs['filters'](_['pick'](_0x3102c6[_0x899e('0x42')],_0xefb99d[_0x899e('0x44')]));_0x4b7c22[_0x899e('0x4d')]['OpenchannelAccountId']=_0x2a3ff1['id'];if(_0x3102c6[_0x899e('0x42')][_0x899e('0x51')]){_0x4b7c22[_0x899e('0x4d')]=_[_0x899e('0x4f')](_0x4b7c22['where'],{'$or':_[_0x899e('0x41')](_0x4b7c22[_0x899e('0x48')],function(_0x345102){var _0xf045ce={};_0xf045ce[_0x345102]={'$like':'%'+_0x3102c6[_0x899e('0x42')][_0x899e('0x51')]+'%'};return _0xf045ce;})});}_0x4b7c22=_[_0x899e('0x4f')]({},_0x4b7c22,_0x3102c6['options']);return db[_0x899e('0x89')][_0x899e('0x32')]({'where':_0x4b7c22[_0x899e('0x4d')]})[_0x899e('0x36')](function(_0x4aa885){_0x3f17dd[_0x899e('0x32')]=_0x4aa885;if(_0x3102c6[_0x899e('0x42')][_0x899e('0x54')]){_0x4b7c22[_0x899e('0x55')]=[{'model':db[_0x899e('0x7d')],'as':_0x899e('0xaa'),'required':![]},{'model':db[_0x899e('0x94')],'as':_0x899e('0xab'),'attributes':[_0x899e('0x3b'),_0x899e('0xac'),_0x899e('0xad')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x899e('0x3b'),_0x899e('0xae')],'where':_0x3102c6['query']['tag']?{'id':_0x3102c6[_0x899e('0x42')]['tag']}:undefined,'required':_0x3102c6[_0x899e('0x42')][_0x899e('0xaf')]?!![]:![]}];}return db[_0x899e('0x89')][_0x899e('0x56')](_0x4b7c22);})[_0x899e('0x36')](function(_0x5362fa){_0x3f17dd[_0x899e('0x57')]=_0x5362fa;return _0x3f17dd;});}})[_0x899e('0x36')](respondWithFilteredResult(_0x5ae0d2,_0x4b7c22))['catch'](handleError(_0x5ae0d2,null));};exports[_0x899e('0xb0')]=function(_0x35342e,_0x515de3,_0x1f9b40){return db['OpenchannelAccount'][_0x899e('0x60')]({'where':{'id':_0x35342e['params']['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x515de3,null))[_0x899e('0x36')](function(_0x5f1e31){if(_0x5f1e31){return _0x5f1e31['addAgents'](_0x35342e[_0x899e('0x5b')][_0x899e('0x69')],_[_0x899e('0xb1')](_0x35342e['body'],[_0x899e('0x69'),'id'])||{})['spread'](function(_0x1218d9){for(var _0x362f5a=0x0;_0x362f5a<_0x35342e[_0x899e('0x5b')]['ids'][_0x899e('0x49')];_0x362f5a+=0x1){socket['emit'](_0x899e('0xb2'),{'UserId':Number(_0x35342e[_0x899e('0x5b')][_0x899e('0x69')][_0x362f5a]),'OpenchannelAccountId':Number(_0x35342e[_0x899e('0x58')]['id'])});}return _0x1218d9;});}})[_0x899e('0x36')](respondWithResult(_0x515de3,null))[_0x899e('0x2a')](handleError(_0x515de3,null));};exports[_0x899e('0xb3')]=function(_0x1290ae,_0x393b52,_0x408aef){return db['OpenchannelAccount'][_0x899e('0x60')]({'where':{'id':_0x1290ae['params']['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x393b52,null))[_0x899e('0x36')](function(_0x175d29){if(_0x175d29){return _0x175d29['removeAgents'](_0x1290ae[_0x899e('0x42')]['ids'])[_0x899e('0x36')](function(){if(_[_0x899e('0xb4')](_0x1290ae['query'][_0x899e('0x69')])){for(var _0xdfc677=0x0;_0xdfc677<_0x1290ae[_0x899e('0x42')][_0x899e('0x69')][_0x899e('0x49')];_0xdfc677+=0x1){socket[_0x899e('0xb5')](_0x899e('0xb6'),{'UserId':Number(_0x1290ae[_0x899e('0x42')][_0x899e('0x69')][_0xdfc677]),'OpenchannelAccountId':Number(_0x1290ae[_0x899e('0x58')]['id'])});}}else{socket[_0x899e('0xb5')](_0x899e('0xb6'),{'UserId':Number(_0x1290ae[_0x899e('0x42')][_0x899e('0x69')]),'OpenchannelAccountId':Number(_0x1290ae[_0x899e('0x58')]['id'])});}});}})[_0x899e('0x36')](respondWithStatusCode(_0x393b52,null))[_0x899e('0x2a')](handleError(_0x393b52,null));};exports[_0x899e('0xb7')]=function(_0x554e65,_0xfa8448,_0x2509d5){var _0x135946={};var _0x56564b={};var _0x5e18f4;var _0xbbd1f8;return db[_0x899e('0x53')][_0x899e('0x65')]({'where':{'id':_0x554e65[_0x899e('0x58')]['id']}})['then'](handleEntityNotFound(_0xfa8448,null))[_0x899e('0x36')](function(_0x52d070){if(_0x52d070){_0x5e18f4=_0x52d070;_0x56564b['model']=_[_0x899e('0x43')](db[_0x899e('0x94')][_0x899e('0x59')]);_0x56564b[_0x899e('0x42')]=_[_0x899e('0x43')](_0x554e65[_0x899e('0x42')]);_0x56564b['filters']=_[_0x899e('0x45')](_0x56564b['model'],_0x56564b['query']);_0x135946[_0x899e('0x48')]=_['intersection'](_0x56564b[_0x899e('0x46')],qs[_0x899e('0x47')](_0x554e65[_0x899e('0x42')][_0x899e('0x47')]));_0x135946[_0x899e('0x48')]=_0x135946[_0x899e('0x48')]['length']?_0x135946[_0x899e('0x48')]:_0x56564b[_0x899e('0x46')];_0x135946['order']=qs[_0x899e('0x4c')](_0x554e65['query'][_0x899e('0x4c')]);_0x135946[_0x899e('0x4d')]=qs[_0x899e('0x44')](_['pick'](_0x554e65['query'],_0x56564b[_0x899e('0x44')]));if(_0x554e65[_0x899e('0x42')][_0x899e('0x51')]){_0x135946[_0x899e('0x4d')]=_[_0x899e('0x4f')](_0x135946[_0x899e('0x4d')],{'$or':_[_0x899e('0x41')](_0x135946[_0x899e('0x48')],function(_0x30bd71){var _0x54fc40={};_0x54fc40[_0x30bd71]={'$like':'%'+_0x554e65[_0x899e('0x42')][_0x899e('0x51')]+'%'};return _0x54fc40;})});}_0x135946=_[_0x899e('0x4f')]({},_0x135946,_0x554e65['options']);return _0x5e18f4[_0x899e('0xb7')](_0x135946);}})[_0x899e('0x36')](function(_0x21d3fe){if(_0x21d3fe){_0xbbd1f8=_0x21d3fe[_0x899e('0x49')];if(!_0x554e65[_0x899e('0x42')][_0x899e('0x67')](_0x899e('0x4a'))){_0x135946['limit']=qs[_0x899e('0x30')](_0x554e65[_0x899e('0x42')][_0x899e('0x30')]);_0x135946[_0x899e('0x2f')]=qs[_0x899e('0x2f')](_0x554e65[_0x899e('0x42')][_0x899e('0x2f')]);}return _0x5e18f4[_0x899e('0xb7')](_0x135946);}})['then'](function(_0x3acd0b){if(_0x3acd0b){return _0x3acd0b?{'count':_0xbbd1f8,'rows':_0x3acd0b}:null;}})['then'](respondWithResult(_0xfa8448,null))[_0x899e('0x2a')](handleError(_0xfa8448,null));};exports[_0x899e('0x3c')]=function(_0x193ebc,_0x3191a1,_0xb39d28){var _0x18870c,_0x225376,_0xf4afac;if(_['isNil'](_0x193ebc[_0x899e('0x5b')][_0x899e('0x5b')])||_0x193ebc[_0x899e('0x5b')][_0x899e('0x5b')]===''){throw new db['Sequelize'][(_0x899e('0x78'))](_0x899e('0xb8'));}if(_[_0x899e('0x75')](_0x193ebc[_0x899e('0x5b')]['to'])){}_0x18870c=_0x193ebc[_0x899e('0x5b')]['to'];return db[_0x899e('0x53')][_0x899e('0x65')]({'where':{'id':_0x193ebc['params']['id']}})[_0x899e('0x36')](handleEntityNotFound(_0x3191a1,null))[_0x899e('0x36')](function(_0x4cb716){if(_0x4cb716){return db['OpenchannelAccount']['find']({'where':{'id':_0x4cb716['id']},'include':[{'model':db[_0x899e('0x7c')],'as':_0x899e('0x81'),'include':[{'model':db[_0x899e('0x7d')],'as':'Contacts','where':{[_0x4cb716['mapKey']]:_0x18870c},'limit':0x1,'order':[[_0x899e('0x73'),_0x899e('0x7f')]]}]}]})['then'](handleEntityNotFound(_0x3191a1,null))[_0x899e('0x36')](function(_0x3f8962){if(_0x3f8962&&_0x3f8962[_0x899e('0x81')]){_0x225376=_0x3f8962['get']({'plain':!![]});if(_0x225376[_0x899e('0x81')]&&_0x225376[_0x899e('0x81')][_0x899e('0x7e')][_0x899e('0x49')]){return _0x225376[_0x899e('0x81')]['Contacts'][0x0];}return db[_0x899e('0x7d')]['create'](_[_0x899e('0x1c')](_0x193ebc['body'],{'firstName':_0x18870c,[_0x3f8962['mapKey']]:_0x18870c,'phone':_0x18870c,'ListId':_0x225376[_0x899e('0x74')]}));}})['then'](handleEntityNotFound(_0x3191a1,null))['then'](function(_0x48939b){if(_0x48939b){_0xf4afac=_0x48939b;return db[_0x899e('0x89')][_0x899e('0x60')]({'where':{'ContactId':_0xf4afac['id'],'closed':![],'OpenchannelAccountId':_0x225376['id']}})[_0x899e('0x36')](function(_0x3addfe){if(_0x3addfe){return[_0x3addfe,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x193ebc[_0x899e('0x5c')]['id'],'ContactId':_0xf4afac['id'],'OpenchannelAccountId':_0x225376['id'],'lastMsgDirection':_0x899e('0xb9'),'firstMsgDirection':_0x899e('0xb9'),'Messages':[_[_0x899e('0x4f')](_0x193ebc[_0x899e('0x5b')],{'read':![],'body':_0x193ebc[_0x899e('0x5b')][_0x899e('0x5b')],'OpenchannelAccountId':_0x225376['id'],'UserId':_0x193ebc[_0x899e('0x5c')]['id'],'ContactId':_0xf4afac['id']})]},{'include':[{'model':db[_0x899e('0x92')],'as':'Messages'}]})['then'](function(_0x36ebd5){return[_0x36ebd5,!![]];});});}})['spread'](function(_0x2931fd,_0x417ddc){if(_0x417ddc){return _0x2931fd;}return db[_0x899e('0x92')][_0x899e('0x5a')](_['merge'](_0x193ebc[_0x899e('0x5b')],{'read':![],'body':_0x193ebc[_0x899e('0x5b')][_0x899e('0x5b')],'OpenchannelAccountId':_0x225376['id'],'OpenchannelInteractionId':_0x2931fd['id'],'UserId':_0x193ebc[_0x899e('0x5c')]['id'],'ContactId':_0xf4afac['id']}))[_0x899e('0x36')](function(_0x1ed4d6){_0x2931fd[_0x899e('0xba')][_0x899e('0xbb')]=[];_0x2931fd[_0x899e('0xba')][_0x899e('0xbb')]['push'](_0x1ed4d6[_0x899e('0xba')]);return _0x2931fd;});});}})['then'](respondWithResult(_0x3191a1,null))[_0x899e('0x2a')](handleError(_0x3191a1,null));}; \ No newline at end of file +var _0x2444=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','OpenchannelAccounts','end','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','params','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','filter','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','describe','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','priority','asc','List','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','unshift','agent','queueId','OpenchannelQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','User','Owner','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x2444,0x170));var _0x4244=function(_0x57ec77,_0x5697ce){_0x57ec77=_0x57ec77-0x0;var _0x241c51=_0x2444[_0x57ec77];return _0x241c51;};'use strict';var emlformat=require(_0x4244('0x0'));var rimraf=require(_0x4244('0x1'));var zipdir=require(_0x4244('0x2'));var jsonpatch=require(_0x4244('0x3'));var rp=require(_0x4244('0x4'));var moment=require(_0x4244('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4244('0x6'));var util=require('util');var path=require(_0x4244('0x7'));var sox=require(_0x4244('0x8'));var csv=require('to-csv');var ejs=require(_0x4244('0x9'));var fs=require('fs');var fs_extra=require(_0x4244('0xa'));var _=require('lodash');var squel=require(_0x4244('0xb'));var crypto=require(_0x4244('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4244('0xd'));var toCsv=require(_0x4244('0xe'));var querystring=require(_0x4244('0xf'));var Papa=require(_0x4244('0x10'));var Redis=require('ioredis');var authService=require(_0x4244('0x11'));var qs=require(_0x4244('0x12'));var as=require(_0x4244('0x13'));var hardwareService=require(_0x4244('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4244('0x15'));var config=require(_0x4244('0x16'));var licenseUtil=require(_0x4244('0x17'));var db=require(_0x4244('0x18'))['db'];config[_0x4244('0x19')]=_[_0x4244('0x1a')](config['redis'],{'host':_0x4244('0x1b'),'port':0x18eb});var socket=require(_0x4244('0x1c'))(new Redis(config[_0x4244('0x19')]));require(_0x4244('0x1d'))[_0x4244('0x1e')](socket);var jayson=require(_0x4244('0x1f'));var client=jayson[_0x4244('0x20')][_0x4244('0x21')]({'port':0x232c});var client9002=jayson[_0x4244('0x20')][_0x4244('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x11f7c5,_0x2fabb6,_0x248de3,_0x823dbd){return new BPromise(function(_0x5d8494,_0x13a93e){var _0x1d3cd3=_0x823dbd||client;return _0x1d3cd3[_0x4244('0x22')](_0x11f7c5,_0x248de3)[_0x4244('0x23')](function(_0xef5ddf){logger[_0x4244('0x24')](_0x4244('0x25'),_0x2fabb6,_0x4244('0x26'));logger[_0x4244('0x27')](_0x4244('0x28'),_0x2fabb6,_0x4244('0x26'),JSON['stringify'](_0xef5ddf));if(_0xef5ddf[_0x4244('0x29')]){if(_0xef5ddf[_0x4244('0x29')]['code']===0x1f4){logger[_0x4244('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x2fabb6,_0xef5ddf['error']['message']);return _0x13a93e(_0xef5ddf['error']['message']);}logger[_0x4244('0x29')](_0x4244('0x25'),_0x2fabb6,_0xef5ddf[_0x4244('0x29')]['message']);return _0x5d8494(_0xef5ddf[_0x4244('0x29')][_0x4244('0x2a')]);}else{logger[_0x4244('0x24')](_0x4244('0x25'),_0x2fabb6,_0x4244('0x26'));_0x5d8494(_0xef5ddf[_0x4244('0x2b')][_0x4244('0x2a')]);}})[_0x4244('0x2c')](function(_0x302871){logger[_0x4244('0x29')](_0x4244('0x25'),_0x2fabb6,_0x302871);_0x13a93e(_0x302871);});});}function respondWithStatusCode(_0x179533,_0x5a2e3f){_0x5a2e3f=_0x5a2e3f||0xcc;return function(_0x1f4b16){if(_0x1f4b16){return _0x179533[_0x4244('0x2d')](_0x5a2e3f);}return _0x179533[_0x4244('0x2e')](_0x5a2e3f)['end']();};}function respondWithResult(_0xc302c8,_0x5e99a0){_0x5e99a0=_0x5e99a0||0xc8;return function(_0x199d54){if(_0x199d54){return _0xc302c8[_0x4244('0x2e')](_0x5e99a0)[_0x4244('0x2f')](_0x199d54);}};}function respondWithFilteredResult(_0x502fbd,_0xad6e42){return function(_0x514d87){if(_0x514d87){var _0x4db863=typeof _0xad6e42[_0x4244('0x30')]===_0x4244('0x31')&&typeof _0xad6e42[_0x4244('0x32')]===_0x4244('0x31');var _0x16293e=_0x514d87[_0x4244('0x33')];var _0x30d7c1=_0x4db863?0x0:_0xad6e42[_0x4244('0x30')];var _0x4b26b4=_0x4db863?_0x514d87[_0x4244('0x33')]:_0xad6e42[_0x4244('0x30')]+_0xad6e42[_0x4244('0x32')];var _0x4717c2;if(_0x4b26b4>=_0x16293e){_0x4b26b4=_0x16293e;_0x4717c2=0xc8;}else{_0x4717c2=0xce;}_0x502fbd[_0x4244('0x2e')](_0x4717c2);return _0x502fbd[_0x4244('0x34')](_0x4244('0x35'),_0x30d7c1+'-'+_0x4b26b4+'/'+_0x16293e)[_0x4244('0x2f')](_0x514d87);}return null;};}function patchUpdates(_0x5e3781){return function(_0x57d3f9){try{jsonpatch[_0x4244('0x36')](_0x57d3f9,_0x5e3781,!![]);}catch(_0x5b17b0){return BPromise['reject'](_0x5b17b0);}return _0x57d3f9['save']();};}function saveUpdates(_0x3a7817,_0x42e4dc){return function(_0x59890d){if(_0x59890d){return _0x59890d[_0x4244('0x37')](_0x3a7817)[_0x4244('0x23')](function(_0x396877){return _0x396877;});}return null;};}function removeEntity(_0xe16649,_0x48b1c3){return function(_0x462f5c){if(_0x462f5c){return _0x462f5c[_0x4244('0x38')]()[_0x4244('0x23')](function(){var _0x1fc18a=_0x462f5c[_0x4244('0x39')]({'plain':!![]});var _0x35ca98=_0x4244('0x3a');return db['UserProfileResource'][_0x4244('0x38')]({'where':{'type':_0x35ca98,'resourceId':_0x1fc18a['id']}})[_0x4244('0x23')](function(){return _0x462f5c;});})['then'](function(){_0xe16649[_0x4244('0x2e')](0xcc)[_0x4244('0x3b')]();});}};}function handleEntityNotFound(_0x2fc9ee,_0xc3501e){return function(_0x31b0fa){if(!_0x31b0fa){_0x2fc9ee[_0x4244('0x2d')](0x194);}return _0x31b0fa;};}function handleError(_0x266416,_0x19b82d){_0x19b82d=_0x19b82d||0x1f4;return function(_0x3ac67c){logger['error'](_0x3ac67c['stack']);if(_0x3ac67c[_0x4244('0x3c')]){delete _0x3ac67c[_0x4244('0x3c')];}_0x266416[_0x4244('0x2e')](_0x19b82d)[_0x4244('0x3d')](_0x3ac67c);};}exports['index']=function(_0x30f64a,_0x7104d1){var _0x34a1a3={'include':[{'model':db['Pause'],'as':_0x4244('0x3e')}]},_0x2a84d9={},_0xf07af1={'count':0x0,'rows':[]};var _0x4a1ec5=_[_0x4244('0x3f')](db[_0x4244('0x40')][_0x4244('0x41')],function(_0x30c75c){return{'name':_0x30c75c['fieldName'],'type':_0x30c75c[_0x4244('0x42')][_0x4244('0x43')]};});_0x2a84d9[_0x4244('0x44')]=_['map'](_0x4a1ec5,_0x4244('0x3c'));_0x2a84d9[_0x4244('0x45')]=_['keys'](_0x30f64a['query']);_0x2a84d9[_0x4244('0x46')]=_[_0x4244('0x47')](_0x2a84d9[_0x4244('0x44')],_0x2a84d9[_0x4244('0x45')]);_0x34a1a3[_0x4244('0x48')]=_['intersection'](_0x2a84d9[_0x4244('0x44')],qs[_0x4244('0x49')](_0x30f64a[_0x4244('0x45')][_0x4244('0x49')]));_0x34a1a3[_0x4244('0x48')]=_0x34a1a3['attributes'][_0x4244('0x4a')]?_0x34a1a3[_0x4244('0x48')]:_0x2a84d9[_0x4244('0x44')];if(!_0x30f64a[_0x4244('0x45')][_0x4244('0x4b')](_0x4244('0x4c'))){_0x34a1a3[_0x4244('0x32')]=qs[_0x4244('0x32')](_0x30f64a[_0x4244('0x45')]['limit']);_0x34a1a3['offset']=qs['offset'](_0x30f64a[_0x4244('0x45')][_0x4244('0x30')]);}_0x34a1a3[_0x4244('0x4d')]=qs['sort'](_0x30f64a[_0x4244('0x45')][_0x4244('0x4e')]);_0x34a1a3[_0x4244('0x4f')]=qs['filters'](_[_0x4244('0x50')](_0x30f64a[_0x4244('0x45')],_0x2a84d9[_0x4244('0x46')]),_0x4a1ec5);if(_0x30f64a[_0x4244('0x45')]['filter']){_0x34a1a3['where']=_[_0x4244('0x51')](_0x34a1a3[_0x4244('0x4f')],{'$or':_['map'](_0x4a1ec5,function(_0x3f03a6){if(_0x3f03a6[_0x4244('0x42')]!==_0x4244('0x52')){var _0x48c5f2={};_0x48c5f2[_0x3f03a6[_0x4244('0x3c')]]={'$like':'%'+_0x30f64a[_0x4244('0x45')]['filter']+'%'};return _0x48c5f2;}})});}_0x34a1a3=_[_0x4244('0x51')]({},_0x34a1a3,_0x30f64a[_0x4244('0x53')]);var _0x2b844e={'where':_0x34a1a3['where']};return db[_0x4244('0x40')]['count'](_0x2b844e)[_0x4244('0x23')](function(_0x5d1f26){_0xf07af1[_0x4244('0x33')]=_0x5d1f26;if(_0x30f64a['query'][_0x4244('0x54')]){_0x34a1a3[_0x4244('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x4244('0x56')](_0x34a1a3);})[_0x4244('0x23')](function(_0x374c3a){_0xf07af1[_0x4244('0x57')]=_0x374c3a;return _0xf07af1;})['then'](respondWithFilteredResult(_0x7104d1,_0x34a1a3))[_0x4244('0x2c')](handleError(_0x7104d1,null));};exports[_0x4244('0x58')]=function(_0x2aa977,_0x256d7f){var _0x5bc4f3={'raw':![],'where':{'id':_0x2aa977['params']['id']},'include':[{'model':db[_0x4244('0x59')],'as':_0x4244('0x3e')}]},_0x3a874c={};_0x3a874c[_0x4244('0x44')]=_[_0x4244('0x5a')](db['OpenchannelAccount'][_0x4244('0x41')]);_0x3a874c[_0x4244('0x45')]=_[_0x4244('0x5a')](_0x2aa977[_0x4244('0x45')]);_0x3a874c[_0x4244('0x46')]=_[_0x4244('0x47')](_0x3a874c[_0x4244('0x44')],_0x3a874c[_0x4244('0x45')]);_0x5bc4f3['attributes']=_[_0x4244('0x47')](_0x3a874c[_0x4244('0x44')],qs['fields'](_0x2aa977[_0x4244('0x45')][_0x4244('0x49')]));_0x5bc4f3[_0x4244('0x48')]=_0x5bc4f3[_0x4244('0x48')][_0x4244('0x4a')]?_0x5bc4f3['attributes']:_0x3a874c[_0x4244('0x44')];if(_0x2aa977[_0x4244('0x45')]['includeAll']){_0x5bc4f3[_0x4244('0x55')]=[{'all':!![]}];}_0x5bc4f3=_['merge']({},_0x5bc4f3,_0x2aa977[_0x4244('0x53')]);return db['OpenchannelAccount'][_0x4244('0x5b')](_0x5bc4f3)[_0x4244('0x23')](handleEntityNotFound(_0x256d7f,null))[_0x4244('0x23')](respondWithResult(_0x256d7f,null))[_0x4244('0x2c')](handleError(_0x256d7f,null));};exports['create']=function(_0x10f389,_0x1296b4){return db['OpenchannelAccount']['create'](_0x10f389[_0x4244('0x5c')],{})['then'](function(_0x47832b){var _0x9e01e0=_0x10f389[_0x4244('0x5d')][_0x4244('0x39')]({'plain':!![]});if(!_0x9e01e0)throw new Error(_0x4244('0x5e'));if(_0x9e01e0[_0x4244('0x5f')]===_0x4244('0x5d')){var _0x55f10f=_0x47832b[_0x4244('0x39')]({'plain':!![]});var _0x1ea3e5='OpenchannelAccounts';return db[_0x4244('0x60')]['find']({'where':{'name':_0x1ea3e5,'userProfileId':_0x9e01e0['userProfileId']},'raw':!![]})[_0x4244('0x23')](function(_0x5d2e69){if(_0x5d2e69&&_0x5d2e69[_0x4244('0x61')]===0x0){return db[_0x4244('0x62')][_0x4244('0x63')]({'name':_0x55f10f[_0x4244('0x3c')],'resourceId':_0x55f10f['id'],'type':_0x5d2e69[_0x4244('0x3c')],'sectionId':_0x5d2e69['id']},{})[_0x4244('0x23')](function(){return _0x47832b;});}else{return _0x47832b;}})[_0x4244('0x2c')](function(_0x276af4){logger[_0x4244('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x276af4);throw _0x276af4;});}return _0x47832b;})[_0x4244('0x23')](respondWithResult(_0x1296b4,0xc9))[_0x4244('0x2c')](handleError(_0x1296b4,null));};exports['update']=function(_0x1b5665,_0x2db5ea){if(_0x1b5665[_0x4244('0x5c')]['id']){delete _0x1b5665[_0x4244('0x5c')]['id'];}return db[_0x4244('0x40')][_0x4244('0x5b')]({'where':{'id':_0x1b5665[_0x4244('0x64')]['id']},'include':[{'model':db[_0x4244('0x59')],'as':_0x4244('0x3e')}]})[_0x4244('0x23')](handleEntityNotFound(_0x2db5ea,null))[_0x4244('0x23')](saveUpdates(_0x1b5665[_0x4244('0x5c')],null))[_0x4244('0x23')](respondWithResult(_0x2db5ea,null))[_0x4244('0x2c')](handleError(_0x2db5ea,null));};exports[_0x4244('0x38')]=function(_0x49308c,_0x375410){return db[_0x4244('0x40')]['find']({'where':{'id':_0x49308c[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x375410,null))[_0x4244('0x23')](removeEntity(_0x375410,null))[_0x4244('0x2c')](handleError(_0x375410,null));};exports['describe']=function(_0x2decc7,_0x557d45){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x557d45,null))['catch'](handleError(_0x557d45,null));};exports[_0x4244('0x65')]=function(_0x513370,_0x38cdf2,_0x6f1ea9){if(_0x513370['body']['id']){delete _0x513370[_0x4244('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x513370[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x38cdf2,null))[_0x4244('0x23')](function(_0xbf0ae){if(_0xbf0ae){_0x513370[_0x4244('0x5c')][_0x4244('0x66')]=_0xbf0ae['id'];return db['Disposition'][_0x4244('0x63')](_0x513370[_0x4244('0x5c')]);}})[_0x4244('0x23')](respondWithResult(_0x38cdf2,null))['catch'](handleError(_0x38cdf2,null));};exports[_0x4244('0x67')]=function(_0x55ccb2,_0x569743,_0x7bbfef){var _0x5d74f9={'raw':![],'where':{}};var _0x3cbc9b={};var _0x538dfe={'count':0x0,'rows':[]};return db[_0x4244('0x40')][_0x4244('0x68')]({'where':{'id':_0x55ccb2['params']['id']}})['then'](handleEntityNotFound(_0x569743,null))['then'](function(_0x2d57a3){if(_0x2d57a3){_0x3cbc9b[_0x4244('0x44')]=_[_0x4244('0x5a')](db[_0x4244('0x69')][_0x4244('0x41')]);_0x3cbc9b[_0x4244('0x45')]=_['keys'](_0x55ccb2[_0x4244('0x45')]);_0x3cbc9b['filters']=_['intersection'](_0x3cbc9b[_0x4244('0x44')],_0x3cbc9b[_0x4244('0x45')]);_0x5d74f9[_0x4244('0x48')]=_[_0x4244('0x47')](_0x3cbc9b[_0x4244('0x44')],qs[_0x4244('0x49')](_0x55ccb2[_0x4244('0x45')][_0x4244('0x49')]));_0x5d74f9[_0x4244('0x48')]=_0x5d74f9[_0x4244('0x48')][_0x4244('0x4a')]?_0x5d74f9[_0x4244('0x48')]:_0x3cbc9b[_0x4244('0x44')];if(!_0x55ccb2[_0x4244('0x45')][_0x4244('0x4b')](_0x4244('0x4c'))){_0x5d74f9['limit']=qs[_0x4244('0x32')](_0x55ccb2[_0x4244('0x45')][_0x4244('0x32')]);_0x5d74f9['offset']=qs['offset'](_0x55ccb2[_0x4244('0x45')][_0x4244('0x30')]);}_0x5d74f9[_0x4244('0x4d')]=qs[_0x4244('0x4e')](_0x55ccb2[_0x4244('0x45')][_0x4244('0x4e')]);_0x5d74f9[_0x4244('0x4f')]=qs['filters'](_[_0x4244('0x50')](_0x55ccb2[_0x4244('0x45')],_0x3cbc9b[_0x4244('0x46')]));_0x5d74f9['where'][_0x4244('0x66')]=_0x2d57a3['id'];if(_0x55ccb2[_0x4244('0x45')][_0x4244('0x6a')]){_0x5d74f9[_0x4244('0x4f')]=_[_0x4244('0x51')](_0x5d74f9[_0x4244('0x4f')],{'$or':_[_0x4244('0x3f')](_0x5d74f9['attributes'],function(_0x45b18a){var _0xf4a365={};_0xf4a365[_0x45b18a]={'$like':'%'+_0x55ccb2[_0x4244('0x45')][_0x4244('0x6a')]+'%'};return _0xf4a365;})});}_0x5d74f9=_[_0x4244('0x51')]({},_0x5d74f9,_0x55ccb2[_0x4244('0x53')]);return db[_0x4244('0x69')][_0x4244('0x33')]({'where':_0x5d74f9[_0x4244('0x4f')]})[_0x4244('0x23')](function(_0x4641db){_0x538dfe[_0x4244('0x33')]=_0x4641db;if(_0x55ccb2[_0x4244('0x45')][_0x4244('0x54')]){_0x5d74f9[_0x4244('0x55')]=[{'all':!![]}];}return db[_0x4244('0x69')]['findAll'](_0x5d74f9);})[_0x4244('0x23')](function(_0x57a996){_0x538dfe['rows']=_0x57a996;return _0x538dfe;});}})[_0x4244('0x23')](respondWithFilteredResult(_0x569743,_0x5d74f9))[_0x4244('0x2c')](handleError(_0x569743,null));};exports[_0x4244('0x6b')]=function(_0x4ee209,_0x2755dd,_0x360b82){return db[_0x4244('0x40')][_0x4244('0x5b')]({'where':{'id':_0x4ee209[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x2755dd,null))[_0x4244('0x23')](function(_0x376b09){if(_0x376b09){return _0x376b09[_0x4244('0x6b')](_0x4ee209['query'][_0x4244('0x6c')]);}})[_0x4244('0x23')](respondWithStatusCode(_0x2755dd,null))[_0x4244('0x2c')](handleError(_0x2755dd,null));};exports[_0x4244('0x6d')]=function(_0x19c168,_0xdb897c,_0x16d816){if(_0x19c168[_0x4244('0x5c')]['id']){delete _0x19c168['body']['id'];}return db[_0x4244('0x40')]['find']({'where':{'id':_0x19c168[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0xdb897c,null))[_0x4244('0x23')](function(_0x558dff){if(_0x558dff){_0x19c168[_0x4244('0x5c')][_0x4244('0x66')]=_0x558dff['id'];return db['CannedAnswer']['create'](_0x19c168[_0x4244('0x5c')]);}})['then'](respondWithResult(_0xdb897c,null))['catch'](handleError(_0xdb897c,null));};exports[_0x4244('0x6e')]=function(_0x4797a6,_0x508065,_0x14dad2){var _0x216166={'raw':![],'where':{}};var _0x38774a={};var _0x4e676c={'count':0x0,'rows':[]};return db[_0x4244('0x40')][_0x4244('0x68')]({'where':{'id':_0x4797a6[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x508065,null))[_0x4244('0x23')](function(_0xc2a42b){if(_0xc2a42b){_0x38774a[_0x4244('0x44')]=_[_0x4244('0x5a')](db['CannedAnswer'][_0x4244('0x41')]);_0x38774a[_0x4244('0x45')]=_[_0x4244('0x5a')](_0x4797a6[_0x4244('0x45')]);_0x38774a['filters']=_[_0x4244('0x47')](_0x38774a[_0x4244('0x44')],_0x38774a[_0x4244('0x45')]);_0x216166[_0x4244('0x48')]=_[_0x4244('0x47')](_0x38774a[_0x4244('0x44')],qs[_0x4244('0x49')](_0x4797a6[_0x4244('0x45')][_0x4244('0x49')]));_0x216166[_0x4244('0x48')]=_0x216166['attributes'][_0x4244('0x4a')]?_0x216166[_0x4244('0x48')]:_0x38774a[_0x4244('0x44')];if(!_0x4797a6[_0x4244('0x45')]['hasOwnProperty'](_0x4244('0x4c'))){_0x216166[_0x4244('0x32')]=qs[_0x4244('0x32')](_0x4797a6[_0x4244('0x45')][_0x4244('0x32')]);_0x216166[_0x4244('0x30')]=qs[_0x4244('0x30')](_0x4797a6['query']['offset']);}_0x216166[_0x4244('0x4d')]=qs[_0x4244('0x4e')](_0x4797a6[_0x4244('0x45')]['sort']);_0x216166[_0x4244('0x4f')]=qs[_0x4244('0x46')](_[_0x4244('0x50')](_0x4797a6[_0x4244('0x45')],_0x38774a[_0x4244('0x46')]));_0x216166[_0x4244('0x4f')][_0x4244('0x66')]=_0xc2a42b['id'];if(_0x4797a6[_0x4244('0x45')][_0x4244('0x6a')]){_0x216166[_0x4244('0x4f')]=_['merge'](_0x216166['where'],{'$or':_[_0x4244('0x3f')](_0x216166['attributes'],function(_0x34cf79){var _0x11011d={};_0x11011d[_0x34cf79]={'$like':'%'+_0x4797a6[_0x4244('0x45')][_0x4244('0x6a')]+'%'};return _0x11011d;})});}_0x216166=_['merge']({},_0x216166,_0x4797a6['options']);return db[_0x4244('0x6f')][_0x4244('0x33')]({'where':_0x216166['where']})[_0x4244('0x23')](function(_0x4edf8a){_0x4e676c[_0x4244('0x33')]=_0x4edf8a;if(_0x4797a6['query'][_0x4244('0x54')]){_0x216166[_0x4244('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4244('0x56')](_0x216166);})[_0x4244('0x23')](function(_0x1c24cd){_0x4e676c['rows']=_0x1c24cd;return _0x4e676c;});}})[_0x4244('0x23')](respondWithFilteredResult(_0x508065,_0x216166))['catch'](handleError(_0x508065,null));};exports[_0x4244('0x70')]=function(_0x21d2d6,_0x2f833a,_0x40e6a8){return db[_0x4244('0x40')][_0x4244('0x5b')]({'where':{'id':_0x21d2d6[_0x4244('0x64')]['id']}})['then'](handleEntityNotFound(_0x2f833a,null))[_0x4244('0x23')](function(_0x2cbed9){if(_0x2cbed9){return _0x2cbed9[_0x4244('0x70')](_0x21d2d6[_0x4244('0x45')][_0x4244('0x6c')]);}})[_0x4244('0x23')](respondWithStatusCode(_0x2f833a,null))[_0x4244('0x2c')](handleError(_0x2f833a,null));};exports[_0x4244('0x71')]=function(_0x46eb97,_0x399328,_0x1a53cf){var _0x437b24={'body':_0x46eb97['body'],'channel':'openchannel'};var _0x381e5a=[];var _0x2a457b=[];var _0x474d8e={};var _0x1559bd=![];return db[_0x4244('0x72')][_0x4244('0x73')]()[_0x4244('0x23')](function(_0x19f91c){if(!_0x19f91c){throw new db[(_0x4244('0x74'))]['ValidationError']('no\x20available\x20attributes');}_0x381e5a=_[_0x4244('0x75')](_[_0x4244('0x5a')](_0x19f91c),[_0x4244('0x76'),_0x4244('0x77')]);_0x2a457b=_[_0x4244('0x75')](_['keys'](_0x19f91c),[_0x4244('0x76'),_0x4244('0x77'),_0x4244('0x78'),_0x4244('0x79')]);if(_0x46eb97[_0x4244('0x5c')]['id']){delete _0x46eb97[_0x4244('0x5c')]['id'];}if(_['isNil'](_0x46eb97[_0x4244('0x5c')][_0x4244('0x7a')])){throw new db[(_0x4244('0x74'))][(_0x4244('0x7b'))](_0x4244('0x7c'));}if(_[_0x4244('0x7d')](_0x46eb97[_0x4244('0x5c')][_0x4244('0x5c')])||_0x46eb97[_0x4244('0x5c')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x4244('0x7e'));}if(_['isNil'](_0x46eb97['body']['mapKey'])){throw new db[(_0x4244('0x74'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a457b);}if(!_[_0x4244('0x7f')](_0x2a457b,_0x46eb97['body'][_0x4244('0x80')])){throw new db[(_0x4244('0x74'))][(_0x4244('0x7b'))](_0x4244('0x81')+_0x2a457b);}_0x474d8e[_0x46eb97['body'][_0x4244('0x80')]]=_0x46eb97[_0x4244('0x5c')][_0x4244('0x7a')];})[_0x4244('0x23')](function(){return db['OpenchannelAccount'][_0x4244('0x5b')]({'where':{'id':_0x46eb97['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4244('0x72')],'as':_0x4244('0x82'),'where':_0x474d8e,'limit':0x1,'order':[[_0x4244('0x77'),_0x4244('0x83')]]}]},{'model':db[_0x4244('0x84')],'as':_0x4244('0x85')}]});})[_0x4244('0x23')](handleEntityNotFound(_0x399328,null))[_0x4244('0x23')](function(_0x5e95c5){if(_0x5e95c5&&_0x5e95c5['List']){_0x437b24[_0x4244('0x86')]=_0x5e95c5;_0x437b24[_0x4244('0x87')]=_0x5e95c5['Applications'];_0x437b24[_0x4244('0x88')]=_0x5e95c5['List'];_0x437b24[_0x4244('0x87')]=_['orderBy'](_0x437b24['applications'],[_0x4244('0x89')],[_0x4244('0x8a')]);if(_0x437b24['account']['Applications']){delete _0x437b24['account'][_0x4244('0x85')];}if(_0x437b24[_0x4244('0x86')][_0x4244('0x8b')]&&_0x437b24[_0x4244('0x86')][_0x4244('0x8b')][_0x4244('0x82')]['length']){return _0x437b24[_0x4244('0x86')][_0x4244('0x8b')][_0x4244('0x82')][0x0];}var _0x3b3322=_[_0x4244('0x1a')](_0x46eb97[_0x4244('0x5c')],{'firstName':_0x46eb97[_0x4244('0x5c')][_0x4244('0x7a')],'ListId':_0x5e95c5[_0x4244('0x79')]});_0x3b3322[_0x46eb97[_0x4244('0x5c')][_0x4244('0x80')]]=_0x46eb97[_0x4244('0x5c')]['from'];return db[_0x4244('0x72')][_0x4244('0x63')](_0x3b3322,{'fields':_0x381e5a,'raw':!![]});}})[_0x4244('0x23')](handleEntityNotFound(_0x399328,null))[_0x4244('0x23')](function(_0x83bc11){_0x437b24[_0x4244('0x8c')]=_0x83bc11;if(_0x83bc11){var _0x4cc332={'ContactId':_0x83bc11['id'],'OpenchannelAccountId':_0x46eb97[_0x4244('0x64')]['id'],'from':(_0x83bc11[_0x4244('0x8d')]||'')+'\x20'+(_0x83bc11[_0x4244('0x8e')]||'')};var _0x2bf27d={'OpenchannelAccountId':_0x46eb97[_0x4244('0x64')]['id'],'closed':![]};if(_0x46eb97['body'][_0x4244('0x8f')]){_0x2bf27d['threadId']=_0x46eb97['body'][_0x4244('0x8f')];return db['OpenchannelInteraction'][_0x4244('0x5b')]({'where':_0x2bf27d})[_0x4244('0x23')](function(_0x230992){if(_0x230992){return[_0x230992,![]];}_0x4cc332[_0x4244('0x8f')]=_0x46eb97['body'][_0x4244('0x8f')];_0x4cc332[_0x4244('0x90')]=_0x46eb97['body'][_0x4244('0x90')];return db['OpenchannelInteraction'][_0x4244('0x63')](_0x4cc332)['then'](function(_0x505167){return[_0x505167,!![]];});});}else{_0x2bf27d['threadId']=null;}_0x2bf27d[_0x4244('0x91')]=_0x83bc11['id'];return db[_0x4244('0x92')][_0x4244('0x5b')]({'where':_0x2bf27d})['then'](function(_0x20f153){if(_0x20f153){return[_0x20f153,![]];}return db[_0x4244('0x92')][_0x4244('0x63')](_0x4cc332)[_0x4244('0x23')](function(_0x599774){return[_0x599774,!![]];});});}})[_0x4244('0x93')](function(_0xa176ec,_0x282ecc){if(_0xa176ec){_0x1559bd=_0x282ecc;if(!_0x282ecc){var _0xb371de={'from':(_0x437b24[_0x4244('0x8c')][_0x4244('0x8d')]||'')+'\x20'+(_0x437b24['contact'][_0x4244('0x8e')]||'')};if(_0x46eb97['body'][_0x4244('0x8f')]&&_0x46eb97[_0x4244('0x5c')][_0x4244('0x94')]&&_0x46eb97[_0x4244('0x5c')][_0x4244('0x8f')]!=_0x46eb97[_0x4244('0x5c')][_0x4244('0x94')]){_0xb371de[_0x4244('0x8f')]=_0x46eb97[_0x4244('0x5c')][_0x4244('0x94')];}return _0xa176ec[_0x4244('0x37')](_0xb371de);}else{return _0xa176ec;}}})['then'](function(_0x1f5959){_0x437b24[_0x4244('0x95')]=_0x1f5959[_0x4244('0x39')]({'plain':!![]});_0x437b24[_0x4244('0x95')][_0x4244('0x96')]=_0x1559bd;if(_0x437b24[_0x4244('0x95')][_0x4244('0x96')]){if(_0x437b24[_0x4244('0x86')][_0x4244('0x97')]){_0x437b24[_0x4244('0x87')][_0x4244('0x98')]({'id':0x0,'priority':_0x437b24['applications'][_0x4244('0x4a')]+0x1,'app':_0x4244('0x99'),'appdata':'unmanaged','interval':_0x4244('0x9a')});}}return db['OpenchannelMessage'][_0x4244('0x63')]({'body':_0x46eb97[_0x4244('0x5c')][_0x4244('0x5c')],'OpenchannelAccountId':_0x46eb97[_0x4244('0x64')]['id'],'OpenchannelInteractionId':_0x1f5959['id'],'direction':'in','ContactId':_0x437b24[_0x4244('0x8c')]['id'],'AttachmentId':_0x46eb97['body'][_0x4244('0x9b')]});})[_0x4244('0x23')](function(_0x1c2082){_0x437b24[_0x4244('0x2a')]=_0x1c2082;if(!_0x437b24[_0x4244('0x95')]['UserId'])return;return db['User'][_0x4244('0x5b')]({'attributes':['id','name'],'where':{'id':_0x437b24['interaction'][_0x4244('0x9c')]}});})['then'](function(_0x596a7b){if(_0x596a7b){_0x437b24['applications'][_0x4244('0x9d')]({'id':0x0,'priority':0x0,'app':_0x4244('0x9e'),'appdata':_0x596a7b[_0x4244('0x3c')]+','+(_0x437b24['account']['waitForTheAssignedAgent']||0xa),'interval':_0x4244('0x9a')});}if(!_0x437b24[_0x4244('0x95')][_0x4244('0x9f')])return;return db[_0x4244('0xa0')][_0x4244('0x5b')]({'attributes':['id',_0x4244('0x3c')],'where':{'id':_0x437b24[_0x4244('0x95')][_0x4244('0x9f')]}});})['then'](function(_0x3c32f2){if(_0x3c32f2){_0x437b24[_0x4244('0x87')][_0x4244('0x9d')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3c32f2[_0x4244('0x3c')]+','+(_0x437b24['account'][_0x4244('0xa1')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4244('0xa2'),_0x4244('0xa3'),_0x437b24);})[_0x4244('0x23')](function(_0x2d52b4){respondWithRpcPromise(_0x4244('0xa4'),_0x4244('0xa4'),{'event':_0x4244('0x71'),'message':_0x2d52b4},client9002);return _0x2d52b4;})[_0x4244('0x23')](respondWithResult(_0x399328,null))[_0x4244('0x2c')](handleError(_0x399328,null));};exports[_0x4244('0xa5')]=function(_0x812819,_0x3a04b2){var _0x2237b0=_0x812819[_0x4244('0x64')]['id'];var _0xef485e=_0x812819[_0x4244('0x5c')];var _0x51a381=0xc8;var _0x4cb2cc=null;return db[_0x4244('0xa6')]['transaction']({'isolationLevel':db[_0x4244('0xa6')][_0x4244('0xa7')][_0x4244('0xa8')][_0x4244('0xa9')]},function(_0x180731){return db['OpenchannelAccount'][_0x4244('0x68')]({'where':{'id':_0x2237b0},'transaction':_0x180731})[_0x4244('0x23')](function(_0x271b9d){if(_0x271b9d){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x2237b0},'transaction':_0x180731})[_0x4244('0x23')](function(){var _0x52e9de=_[_0x4244('0x3f')](_0xef485e,function(_0x43084d){_0x43084d['OpenchannelAccountId']=_0x2237b0;return _0x43084d;});return db[_0x4244('0x84')][_0x4244('0xaa')](_0x52e9de,{'transaction':_0x180731});});}else{_0x51a381=0x194;_0x4cb2cc=[];}});})[_0x4244('0x23')](function(){if(_0x51a381!==0x194){return db[_0x4244('0x84')][_0x4244('0xab')]({'where':{'OpenchannelAccountId':_0x2237b0},'order':_0x4244('0x89')})[_0x4244('0x23')](function(_0x241249){_0x4cb2cc=_0x241249;});}})[_0x4244('0x2c')](function(_0xefa658){_0x51a381=0x1f4;logger[_0x4244('0x29')](_0xefa658[_0x4244('0xac')]);if(_0xefa658[_0x4244('0x3c')]){delete _0xefa658[_0x4244('0x3c')];}_0x4cb2cc=_0xefa658;})[_0x4244('0xad')](function(){if(_0x4cb2cc===null){_0x3a04b2['sendStatus'](_0x51a381);}else{if(_0x51a381===0x1f4){_0x3a04b2[_0x4244('0x2e')](_0x51a381)[_0x4244('0x3d')](_0x4cb2cc);}else{_0x3a04b2[_0x4244('0x2e')](_0x51a381)[_0x4244('0x2f')](_0x4cb2cc);}}});};exports[_0x4244('0xae')]=function(_0x3dad5f,_0x547fcd,_0x367c66){var _0x35cb70={};var _0x42a76f={};var _0x5a3d6f;var _0x2ebe1b;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3dad5f[_0x4244('0x64')]['id']}})['then'](handleEntityNotFound(_0x547fcd,null))[_0x4244('0x23')](function(_0x340999){if(_0x340999){_0x5a3d6f=_0x340999;_0x42a76f[_0x4244('0x44')]=_[_0x4244('0x5a')](db['OpenchannelApplication'][_0x4244('0x41')]);_0x42a76f[_0x4244('0x45')]=_[_0x4244('0x5a')](_0x3dad5f[_0x4244('0x45')]);_0x42a76f['filters']=_[_0x4244('0x47')](_0x42a76f[_0x4244('0x44')],_0x42a76f[_0x4244('0x45')]);_0x35cb70['attributes']=_[_0x4244('0x47')](_0x42a76f['model'],qs[_0x4244('0x49')](_0x3dad5f[_0x4244('0x45')][_0x4244('0x49')]));_0x35cb70['attributes']=_0x35cb70[_0x4244('0x48')][_0x4244('0x4a')]?_0x35cb70[_0x4244('0x48')]:_0x42a76f['model'];_0x35cb70[_0x4244('0x4d')]=qs[_0x4244('0x4e')](_0x3dad5f['query']['sort']);_0x35cb70['where']=qs['filters'](_['pick'](_0x3dad5f[_0x4244('0x45')],_0x42a76f[_0x4244('0x46')]));if(_0x3dad5f[_0x4244('0x45')][_0x4244('0x6a')]){_0x35cb70[_0x4244('0x4f')]=_[_0x4244('0x51')](_0x35cb70[_0x4244('0x4f')],{'$or':_['map'](_0x35cb70[_0x4244('0x48')],function(_0x50914f){var _0x4f434b={};_0x4f434b[_0x50914f]={'$like':'%'+_0x3dad5f[_0x4244('0x45')]['filter']+'%'};return _0x4f434b;})});}_0x35cb70=_[_0x4244('0x51')]({},_0x35cb70,_0x3dad5f[_0x4244('0x53')]);return _0x5a3d6f[_0x4244('0xae')](_0x35cb70);}})[_0x4244('0x23')](function(_0x2b40c3){if(_0x2b40c3){_0x2ebe1b=_0x2b40c3[_0x4244('0x4a')];if(!_0x3dad5f[_0x4244('0x45')]['hasOwnProperty'](_0x4244('0x4c'))){_0x35cb70[_0x4244('0x32')]=qs['limit'](_0x3dad5f[_0x4244('0x45')][_0x4244('0x32')]);_0x35cb70['offset']=qs[_0x4244('0x30')](_0x3dad5f[_0x4244('0x45')]['offset']);}return _0x5a3d6f['getApplications'](_0x35cb70);}})[_0x4244('0x23')](function(_0x4a8aab){if(_0x4a8aab){return _0x4a8aab?{'count':_0x2ebe1b,'rows':_0x4a8aab}:null;}})[_0x4244('0x23')](respondWithResult(_0x547fcd,null))['catch'](handleError(_0x547fcd,null));};exports[_0x4244('0xaf')]=function(_0x134428,_0x425afc,_0x204eaf){var _0x58d840={'raw':![],'where':{}};var _0x3f7cf1={};var _0x370e74={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4244('0x68')]({'where':{'id':_0x134428[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x425afc,null))[_0x4244('0x23')](function(_0x264efe){if(_0x264efe){_0x3f7cf1[_0x4244('0x44')]=_[_0x4244('0x5a')](db['OpenchannelInteraction'][_0x4244('0x41')]);_0x3f7cf1['query']=_[_0x4244('0x5a')](_0x134428[_0x4244('0x45')]);_0x3f7cf1[_0x4244('0x46')]=_[_0x4244('0x47')](_0x3f7cf1[_0x4244('0x44')],_0x3f7cf1[_0x4244('0x45')]);_0x58d840[_0x4244('0x48')]=_[_0x4244('0x47')](_0x3f7cf1['model'],qs[_0x4244('0x49')](_0x134428[_0x4244('0x45')][_0x4244('0x49')]));_0x58d840[_0x4244('0x48')]=_0x58d840['attributes']['length']?_0x58d840[_0x4244('0x48')]:_0x3f7cf1[_0x4244('0x44')];if(!_0x134428[_0x4244('0x45')][_0x4244('0x4b')](_0x4244('0x4c'))){_0x58d840['limit']=qs[_0x4244('0x32')](_0x134428[_0x4244('0x45')][_0x4244('0x32')]);_0x58d840[_0x4244('0x30')]=qs['offset'](_0x134428[_0x4244('0x45')][_0x4244('0x30')]);}_0x58d840['order']=qs[_0x4244('0x4e')](_0x134428[_0x4244('0x45')][_0x4244('0x4e')]);_0x58d840[_0x4244('0x4f')]=qs[_0x4244('0x46')](_[_0x4244('0x50')](_0x134428[_0x4244('0x45')],_0x3f7cf1[_0x4244('0x46')]));_0x58d840[_0x4244('0x4f')][_0x4244('0x66')]=_0x264efe['id'];if(_0x134428[_0x4244('0x45')][_0x4244('0x6a')]){_0x58d840[_0x4244('0x4f')]=_['merge'](_0x58d840[_0x4244('0x4f')],{'$or':_[_0x4244('0x3f')](_0x58d840[_0x4244('0x48')],function(_0x25c66c){var _0x543e48={};_0x543e48[_0x25c66c]={'$like':'%'+_0x134428['query'][_0x4244('0x6a')]+'%'};return _0x543e48;})});}_0x58d840=_['merge']({},_0x58d840,_0x134428[_0x4244('0x53')]);return db[_0x4244('0x92')]['count']({'where':_0x58d840[_0x4244('0x4f')]})[_0x4244('0x23')](function(_0x74de27){_0x370e74[_0x4244('0x33')]=_0x74de27;if(_0x134428[_0x4244('0x45')][_0x4244('0x54')]){_0x58d840[_0x4244('0x55')]=[{'model':db[_0x4244('0x72')],'as':_0x4244('0xb0'),'required':![]},{'model':db[_0x4244('0xb1')],'as':_0x4244('0xb2'),'attributes':[_0x4244('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x4244('0xb3')],'as':'Tags','attributes':['id',_0x4244('0x3c'),_0x4244('0xb4')],'where':_0x134428[_0x4244('0x45')][_0x4244('0xb5')]?{'id':_0x134428[_0x4244('0x45')][_0x4244('0xb5')]}:undefined,'required':_0x134428['query'][_0x4244('0xb5')]?!![]:![]}];}return db[_0x4244('0x92')][_0x4244('0x56')](_0x58d840);})[_0x4244('0x23')](function(_0x3fa37e){_0x370e74[_0x4244('0x57')]=_0x3fa37e;return _0x370e74;});}})[_0x4244('0x23')](respondWithFilteredResult(_0x425afc,_0x58d840))['catch'](handleError(_0x425afc,null));};exports[_0x4244('0xb6')]=function(_0x1b896a,_0x5d696c,_0x274efa){return db[_0x4244('0x40')][_0x4244('0x5b')]({'where':{'id':_0x1b896a[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x5d696c,null))['then'](function(_0x10c44d){if(_0x10c44d){return _0x10c44d[_0x4244('0xb6')](_0x1b896a[_0x4244('0x5c')][_0x4244('0x6c')],_[_0x4244('0xb7')](_0x1b896a[_0x4244('0x5c')],['ids','id'])||{})[_0x4244('0x93')](function(_0x5efb66){for(var _0x3fd685=0x0;_0x3fd685<_0x1b896a[_0x4244('0x5c')][_0x4244('0x6c')][_0x4244('0x4a')];_0x3fd685+=0x1){socket[_0x4244('0xb8')](_0x4244('0xb9'),{'UserId':Number(_0x1b896a[_0x4244('0x5c')][_0x4244('0x6c')][_0x3fd685]),'OpenchannelAccountId':Number(_0x1b896a[_0x4244('0x64')]['id'])});}return _0x5efb66;});}})[_0x4244('0x23')](respondWithResult(_0x5d696c,null))['catch'](handleError(_0x5d696c,null));};exports[_0x4244('0xba')]=function(_0x35f79a,_0x2e2ed3,_0xb0803c){return db['OpenchannelAccount']['find']({'where':{'id':_0x35f79a['params']['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x2e2ed3,null))[_0x4244('0x23')](function(_0x5de574){if(_0x5de574){return _0x5de574[_0x4244('0xba')](_0x35f79a[_0x4244('0x45')][_0x4244('0x6c')])[_0x4244('0x23')](function(){if(_[_0x4244('0xbb')](_0x35f79a[_0x4244('0x45')][_0x4244('0x6c')])){for(var _0x28837f=0x0;_0x28837f<_0x35f79a[_0x4244('0x45')][_0x4244('0x6c')][_0x4244('0x4a')];_0x28837f+=0x1){socket[_0x4244('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x35f79a['query'][_0x4244('0x6c')][_0x28837f]),'OpenchannelAccountId':Number(_0x35f79a[_0x4244('0x64')]['id'])});}}else{socket[_0x4244('0xb8')](_0x4244('0xbc'),{'UserId':Number(_0x35f79a[_0x4244('0x45')][_0x4244('0x6c')]),'OpenchannelAccountId':Number(_0x35f79a[_0x4244('0x64')]['id'])});}});}})[_0x4244('0x23')](respondWithStatusCode(_0x2e2ed3,null))[_0x4244('0x2c')](handleError(_0x2e2ed3,null));};exports['getAgents']=function(_0xec67a6,_0x319fa0,_0x5e13df){var _0x1eb538={};var _0x460f9b={};var _0x1ea69e;var _0x2862ce;return db[_0x4244('0x40')][_0x4244('0x68')]({'where':{'id':_0xec67a6[_0x4244('0x64')]['id']}})[_0x4244('0x23')](handleEntityNotFound(_0x319fa0,null))[_0x4244('0x23')](function(_0x251372){if(_0x251372){_0x1ea69e=_0x251372;_0x460f9b[_0x4244('0x44')]=_[_0x4244('0x5a')](db[_0x4244('0xb1')][_0x4244('0x41')]);_0x460f9b[_0x4244('0x45')]=_[_0x4244('0x5a')](_0xec67a6['query']);_0x460f9b[_0x4244('0x46')]=_[_0x4244('0x47')](_0x460f9b[_0x4244('0x44')],_0x460f9b['query']);_0x1eb538[_0x4244('0x48')]=_[_0x4244('0x47')](_0x460f9b[_0x4244('0x44')],qs[_0x4244('0x49')](_0xec67a6['query']['fields']));_0x1eb538['attributes']=_0x1eb538['attributes']['length']?_0x1eb538['attributes']:_0x460f9b[_0x4244('0x44')];_0x1eb538[_0x4244('0x4d')]=qs[_0x4244('0x4e')](_0xec67a6['query'][_0x4244('0x4e')]);_0x1eb538[_0x4244('0x4f')]=qs[_0x4244('0x46')](_['pick'](_0xec67a6[_0x4244('0x45')],_0x460f9b[_0x4244('0x46')]));if(_0xec67a6[_0x4244('0x45')]['filter']){_0x1eb538[_0x4244('0x4f')]=_[_0x4244('0x51')](_0x1eb538[_0x4244('0x4f')],{'$or':_[_0x4244('0x3f')](_0x1eb538[_0x4244('0x48')],function(_0x12e2d9){var _0x1d84a9={};_0x1d84a9[_0x12e2d9]={'$like':'%'+_0xec67a6[_0x4244('0x45')][_0x4244('0x6a')]+'%'};return _0x1d84a9;})});}_0x1eb538=_[_0x4244('0x51')]({},_0x1eb538,_0xec67a6['options']);return _0x1ea69e['getAgents'](_0x1eb538);}})[_0x4244('0x23')](function(_0x505fb7){if(_0x505fb7){_0x2862ce=_0x505fb7[_0x4244('0x4a')];if(!_0xec67a6[_0x4244('0x45')][_0x4244('0x4b')]('nolimit')){_0x1eb538[_0x4244('0x32')]=qs[_0x4244('0x32')](_0xec67a6[_0x4244('0x45')][_0x4244('0x32')]);_0x1eb538[_0x4244('0x30')]=qs['offset'](_0xec67a6[_0x4244('0x45')][_0x4244('0x30')]);}return _0x1ea69e[_0x4244('0xbd')](_0x1eb538);}})[_0x4244('0x23')](function(_0x51a31b){if(_0x51a31b){return _0x51a31b?{'count':_0x2862ce,'rows':_0x51a31b}:null;}})[_0x4244('0x23')](respondWithResult(_0x319fa0,null))[_0x4244('0x2c')](handleError(_0x319fa0,null));};exports[_0x4244('0x3d')]=function(_0xeb55c1,_0x5a1af3,_0x578626){var _0x14a1aa,_0x4ca21a,_0x58e4d9;if(_['isNil'](_0xeb55c1[_0x4244('0x5c')][_0x4244('0x5c')])||_0xeb55c1['body']['body']===''){throw new db[(_0x4244('0x74'))][(_0x4244('0x7b'))](_0x4244('0x7e'));}if(_[_0x4244('0x7d')](_0xeb55c1[_0x4244('0x5c')]['to'])){}_0x14a1aa=_0xeb55c1['body']['to'];return db[_0x4244('0x40')][_0x4244('0x68')]({'where':{'id':_0xeb55c1[_0x4244('0x64')]['id']}})['then'](handleEntityNotFound(_0x5a1af3,null))[_0x4244('0x23')](function(_0x75155c){if(_0x75155c){return db[_0x4244('0x40')]['find']({'where':{'id':_0x75155c['id']},'include':[{'model':db[_0x4244('0xbe')],'as':_0x4244('0x8b'),'include':[{'model':db[_0x4244('0x72')],'as':_0x4244('0x82'),'where':{[_0x75155c['mapKey']]:_0x14a1aa},'limit':0x1,'order':[[_0x4244('0x77'),_0x4244('0x83')]]}]}]})[_0x4244('0x23')](handleEntityNotFound(_0x5a1af3,null))[_0x4244('0x23')](function(_0x268e7f){if(_0x268e7f&&_0x268e7f[_0x4244('0x8b')]){_0x4ca21a=_0x268e7f[_0x4244('0x39')]({'plain':!![]});if(_0x4ca21a[_0x4244('0x8b')]&&_0x4ca21a[_0x4244('0x8b')][_0x4244('0x82')][_0x4244('0x4a')]){return _0x4ca21a[_0x4244('0x8b')][_0x4244('0x82')][0x0];}return db[_0x4244('0x72')][_0x4244('0x63')](_[_0x4244('0x1a')](_0xeb55c1['body'],{'firstName':_0x14a1aa,[_0x268e7f[_0x4244('0x80')]]:_0x14a1aa,'phone':_0x14a1aa,'ListId':_0x4ca21a[_0x4244('0x79')]}));}})[_0x4244('0x23')](handleEntityNotFound(_0x5a1af3,null))[_0x4244('0x23')](function(_0x2f41d0){if(_0x2f41d0){_0x58e4d9=_0x2f41d0;return db[_0x4244('0x92')][_0x4244('0x5b')]({'where':{'ContactId':_0x58e4d9['id'],'closed':![],'OpenchannelAccountId':_0x4ca21a['id']}})[_0x4244('0x23')](function(_0x245a95){if(_0x245a95){return[_0x245a95,![]];}return db['OpenchannelInteraction'][_0x4244('0x63')]({'UserId':_0xeb55c1['user']['id'],'ContactId':_0x58e4d9['id'],'OpenchannelAccountId':_0x4ca21a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x4244('0xbf'),'Messages':[_[_0x4244('0x51')](_0xeb55c1[_0x4244('0x5c')],{'read':![],'body':_0xeb55c1[_0x4244('0x5c')][_0x4244('0x5c')],'OpenchannelAccountId':_0x4ca21a['id'],'UserId':_0xeb55c1[_0x4244('0x5d')]['id'],'ContactId':_0x58e4d9['id']})]},{'include':[{'model':db[_0x4244('0xc0')],'as':_0x4244('0xc1')}]})[_0x4244('0x23')](function(_0x4027a9){return[_0x4027a9,!![]];});});}})['spread'](function(_0x3b9fc3,_0x3709ec){if(_0x3709ec){return _0x3b9fc3;}return db[_0x4244('0xc0')][_0x4244('0x63')](_[_0x4244('0x51')](_0xeb55c1[_0x4244('0x5c')],{'read':![],'body':_0xeb55c1[_0x4244('0x5c')][_0x4244('0x5c')],'OpenchannelAccountId':_0x4ca21a['id'],'OpenchannelInteractionId':_0x3b9fc3['id'],'UserId':_0xeb55c1[_0x4244('0x5d')]['id'],'ContactId':_0x58e4d9['id']}))[_0x4244('0x23')](function(_0x36abab){_0x3b9fc3[_0x4244('0xc2')][_0x4244('0xc1')]=[];_0x3b9fc3[_0x4244('0xc2')][_0x4244('0xc1')][_0x4244('0x98')](_0x36abab[_0x4244('0xc2')]);return _0x3b9fc3;});});}})[_0x4244('0x23')](respondWithResult(_0x5a1af3,null))['catch'](handleError(_0x5a1af3,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 17eefea..071f515 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 _0x9348=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x508f9d,_0x4ed489){var _0x11a292=function(_0x4d611f){while(--_0x4d611f){_0x508f9d['push'](_0x508f9d['shift']());}};_0x11a292(++_0x4ed489);}(_0x9348,0x10d));var _0x8934=function(_0x21ef85,_0x1d1aff){_0x21ef85=_0x21ef85-0x0;var _0x560ec8=_0x9348[_0x21ef85];return _0x560ec8;};'use strict';var EventEmitter=require(_0x8934('0x0'));var OpenchannelAccount=require(_0x8934('0x1'))['db'][_0x8934('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8934('0x3')](0x0);var events={'afterCreate':_0x8934('0x4'),'afterUpdate':'update','afterDestroy':_0x8934('0x5')};function emitEvent(_0x35da0b){return function(_0x5f34d7,_0x34f94c,_0x923aa3){OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b+':'+_0x5f34d7['id'],_0x5f34d7);OpenchannelAccountEvents[_0x8934('0x6')](_0x35da0b,_0x5f34d7);_0x923aa3(null);};}for(var e in events){if(events[_0x8934('0x7')](e)){var event=events[e];OpenchannelAccount[_0x8934('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','update','emit'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var OpenchannelAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){OpenchannelAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);OpenchannelAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];OpenchannelAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 997daff..d3bb006 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(_0x362828,_0x15d80d){var _0x26230f=function(_0x1a5a8e){while(--_0x1a5a8e){_0x362828['push'](_0x362828['shift']());}};_0x26230f(++_0x15d80d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x38dc33,_0x2fa60e){var _0x1c2294=function(_0x4050ad){while(--_0x4050ad){_0x38dc33['push'](_0x38dc33['shift']());}};_0x1c2294(++_0x2fa60e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 e7e453f..bab5bb7 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 _0x407f=['register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket'];(function(_0x1c8429,_0x4483aa){var _0x44dcbc=function(_0x4eec3e){while(--_0x4eec3e){_0x1c8429['push'](_0x1c8429['shift']());}};_0x44dcbc(++_0x4483aa);}(_0x407f,0xc2));var _0xf407=function(_0x1e3c2a,_0x33acf3){_0x1e3c2a=_0x1e3c2a-0x0;var _0x10fa0c=_0x407f[_0x1e3c2a];return _0x10fa0c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf407('0x0'));var rs=require(_0xf407('0x1'));var fs=require('fs');var Redis=require(_0xf407('0x2'));var db=require(_0xf407('0x3'))['db'];var utils=require(_0xf407('0x4'));var logger=require(_0xf407('0x5'))(_0xf407('0x6'));var config=require(_0xf407('0x7'));var jayson=require(_0xf407('0x8'));var client=jayson[_0xf407('0x9')][_0xf407('0xa')]({'port':0x232a});config[_0xf407('0xb')]=_[_0xf407('0xc')](config[_0xf407('0xb')],{'host':_0xf407('0xd'),'port':0x18eb});var socket=require(_0xf407('0xe'))(new Redis(config['redis']));require(_0xf407('0xf'))[_0xf407('0x10')](socket);function respondWithRpcPromise(_0x436e03,_0x5af7b8,_0x4ff28e){return new BPromise(function(_0x4f4840,_0x5583fc){return client[_0xf407('0x11')](_0x436e03,_0x4ff28e)[_0xf407('0x12')](function(_0x31ac1b){logger[_0xf407('0x13')](_0xf407('0x14'),_0x5af7b8,'request\x20sent');logger[_0xf407('0x15')](_0xf407('0x16'),_0x5af7b8,_0xf407('0x17'),JSON[_0xf407('0x18')](_0x31ac1b));if(_0x31ac1b[_0xf407('0x19')]){if(_0x31ac1b[_0xf407('0x19')][_0xf407('0x1a')]===0x1f4){logger[_0xf407('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x5af7b8,_0x31ac1b['error'][_0xf407('0x1b')]);return _0x5583fc(_0x31ac1b['error'][_0xf407('0x1b')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5af7b8,_0x31ac1b[_0xf407('0x19')][_0xf407('0x1b')]);return _0x4f4840(_0x31ac1b[_0xf407('0x19')][_0xf407('0x1b')]);}else{logger[_0xf407('0x13')](_0xf407('0x14'),_0x5af7b8,_0xf407('0x17'));_0x4f4840(_0x31ac1b[_0xf407('0x1c')]['message']);}})[_0xf407('0x1d')](function(_0x1cd48f){logger[_0xf407('0x19')](_0xf407('0x14'),_0x5af7b8,_0x1cd48f);_0x5583fc(_0x1cd48f);});});} \ No newline at end of file +var _0x593e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x5b8c36,_0x3378ff){var _0x384e1a=function(_0x2ed2e7){while(--_0x2ed2e7){_0x5b8c36['push'](_0x5b8c36['shift']());}};_0x384e1a(++_0x3378ff);}(_0x593e,0xcb));var _0xe593=function(_0x14d549,_0x41482b){_0x14d549=_0x14d549-0x0;var _0x29b98c=_0x593e[_0x14d549];return _0x29b98c;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var BPromise=require(_0xe593('0x3'));var rs=require(_0xe593('0x4'));var fs=require('fs');var Redis=require(_0xe593('0x5'));var db=require(_0xe593('0x6'))['db'];var utils=require(_0xe593('0x7'));var logger=require('../../config/logger')(_0xe593('0x8'));var config=require(_0xe593('0x9'));var jayson=require(_0xe593('0xa'));var client=jayson[_0xe593('0xb')][_0xe593('0xc')]({'port':0x232a});config[_0xe593('0xd')]=_[_0xe593('0xe')](config[_0xe593('0xd')],{'host':_0xe593('0xf'),'port':0x18eb});var socket=require(_0xe593('0x10'))(new Redis(config['redis']));require(_0xe593('0x11'))[_0xe593('0x12')](socket);function respondWithRpcPromise(_0x38d977,_0x5ba75c,_0x5f1222){return new BPromise(function(_0x3032ee,_0xeefe30){return client[_0xe593('0x13')](_0x38d977,_0x5f1222)['then'](function(_0x6a5d4f){logger[_0xe593('0x14')](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));logger[_0xe593('0x17')](_0xe593('0x18'),_0x5ba75c,_0xe593('0x16'),JSON[_0xe593('0x19')](_0x6a5d4f));if(_0x6a5d4f[_0xe593('0x1a')]){if(_0x6a5d4f[_0xe593('0x1a')]['code']===0x1f4){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f['error'][_0xe593('0x1b')]);return _0xeefe30(_0x6a5d4f[_0xe593('0x1a')]['message']);}logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);return _0x3032ee(_0x6a5d4f[_0xe593('0x1a')][_0xe593('0x1b')]);}else{logger['info'](_0xe593('0x15'),_0x5ba75c,_0xe593('0x16'));_0x3032ee(_0x6a5d4f['result'][_0xe593('0x1b')]);}})[_0xe593('0x1c')](function(_0x56b4ff){logger[_0xe593('0x1a')](_0xe593('0x15'),_0x5ba75c,_0x56b4ff);_0xeefe30(_0x56b4ff);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index e352446..afa2824 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 _0x04d0=['register','length','remove','update'];(function(_0x557995,_0xeb90b){var _0xc0e078=function(_0x10474c){while(--_0x10474c){_0x557995['push'](_0x557995['shift']());}};_0xc0e078(++_0xeb90b);}(_0x04d0,0x10a));var _0x004d=function(_0x58c60d,_0x4aa199){_0x58c60d=_0x58c60d-0x0;var _0x1764e7=_0x04d0[_0x58c60d];return _0x1764e7;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x004d('0x0'),_0x004d('0x1')];function createListener(_0x421661,_0x386bc3){return function(_0x1c0219){_0x386bc3['emit'](_0x421661,_0x1c0219);};}function removeListener(_0x516d73,_0x2638dd){return function(){OpenchannelAccountEvents['removeListener'](_0x516d73,_0x2638dd);};}exports[_0x004d('0x2')]=function(_0x285754){for(var _0x4a3878=0x0,_0x36e8bd=events[_0x004d('0x3')];_0x4a3878<_0x36e8bd;_0x4a3878++){var _0x4d0ae4=events[_0x4a3878];var _0x1f0efd=createListener('openchannelAccount:'+_0x4d0ae4,_0x285754);OpenchannelAccountEvents['on'](_0x4d0ae4,_0x1f0efd);}}; \ No newline at end of file +var _0x324f=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','emit'];(function(_0xaa0262,_0x100940){var _0x56560b=function(_0x29c136){while(--_0x29c136){_0xaa0262['push'](_0xaa0262['shift']());}};_0x56560b(++_0x100940);}(_0x324f,0x94));var _0xf324=function(_0x176807,_0x137e37){_0x176807=_0x176807-0x0;var _0x26cd57=_0x324f[_0x176807];return _0x26cd57;};'use strict';var OpenchannelAccountEvents=require(_0xf324('0x0'));var events=[_0xf324('0x1'),_0xf324('0x2'),'update'];function createListener(_0x54657f,_0x1f9dd7){return function(_0x48f6ef){_0x1f9dd7[_0xf324('0x3')](_0x54657f,_0x48f6ef);};}function removeListener(_0x30c658,_0x5e0457){return function(){OpenchannelAccountEvents[_0xf324('0x4')](_0x30c658,_0x5e0457);};}exports[_0xf324('0x5')]=function(_0x5657a5){for(var _0x19ef3b=0x0,_0x390f7d=events[_0xf324('0x6')];_0x19ef3b<_0x390f7d;_0x19ef3b++){var _0x2290b7=events[_0x19ef3b];var _0x408b34=createListener(_0xf324('0x7')+_0x2290b7,_0x5657a5);OpenchannelAccountEvents['on'](_0x2290b7,_0x408b34);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 47d5431..c42d165 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 _0xd3e3=['/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated'];(function(_0x1dedc2,_0x4bfd33){var _0x19c72b=function(_0x2f01a0){while(--_0x2f01a0){_0x1dedc2['push'](_0x1dedc2['shift']());}};_0x19c72b(++_0x4bfd33);}(_0xd3e3,0x7d));var _0x3d3e=function(_0x433e80,_0x80753f){_0x433e80=_0x433e80-0x0;var _0x3d0725=_0xd3e3[_0x433e80];return _0x3d0725;};'use strict';var multer=require(_0x3d3e('0x0'));var util=require(_0x3d3e('0x1'));var path=require(_0x3d3e('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d3e('0x3'));var router=express['Router']();var fs_extra=require(_0x3d3e('0x4'));var auth=require(_0x3d3e('0x5'));var interaction=require(_0x3d3e('0x6'));var config=require(_0x3d3e('0x7'));var controller=require(_0x3d3e('0x8'));router[_0x3d3e('0x9')]('/',auth[_0x3d3e('0xa')](),controller['index']);router[_0x3d3e('0x9')](_0x3d3e('0xb'),auth[_0x3d3e('0xa')](),controller[_0x3d3e('0xc')]);router['post']('/',auth[_0x3d3e('0xa')](),controller[_0x3d3e('0xd')]);router[_0x3d3e('0xe')](_0x3d3e('0xb'),auth[_0x3d3e('0xa')](),controller[_0x3d3e('0xf')]);router[_0x3d3e('0x10')]('/:id',auth[_0x3d3e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcbd8=['fs-extra','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','express'];(function(_0x6d97b2,_0x3c1332){var _0x514465=function(_0x13c3ce){while(--_0x13c3ce){_0x6d97b2['push'](_0x6d97b2['shift']());}};_0x514465(++_0x3c1332);}(_0xcbd8,0x84));var _0x8cbd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcbd8[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x8cbd('0x0'));var path=require('path');var timeout=require(_0x8cbd('0x1'));var express=require(_0x8cbd('0x2'));var router=express['Router']();var fs_extra=require(_0x8cbd('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x8cbd('0x4')]('/',auth[_0x8cbd('0x5')](),controller[_0x8cbd('0x6')]);router[_0x8cbd('0x4')](_0x8cbd('0x7'),auth[_0x8cbd('0x5')](),controller[_0x8cbd('0x8')]);router[_0x8cbd('0x9')]('/',auth[_0x8cbd('0x5')](),controller[_0x8cbd('0xa')]);router[_0x8cbd('0xb')](_0x8cbd('0x7'),auth[_0x8cbd('0x5')](),controller['update']);router[_0x8cbd('0xc')](_0x8cbd('0x7'),auth[_0x8cbd('0x5')](),controller[_0x8cbd('0xd')]);module[_0x8cbd('0xe')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 415ebf2..3e6b28b 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 _0xf3fb=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf3fb,0x1a2));var _0xbf3f=function(_0x8f4554,_0x97e1f8){_0x8f4554=_0x8f4554-0x0;var _0x2b7465=_0xf3fb[_0x8f4554];return _0x2b7465;};'use strict';var Sequelize=require(_0xbf3f('0x0'));module[_0xbf3f('0x1')]={'priority':{'type':Sequelize[_0xbf3f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbf3f('0x3')},'appdata':{'type':Sequelize[_0xbf3f('0x4')]()},'description':{'type':Sequelize[_0xbf3f('0x5')]},'interval':{'type':Sequelize[_0xbf3f('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xaba5=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x595b0d,_0xa5bdff){var _0x3abfe7=function(_0x1b1669){while(--_0x1b1669){_0x595b0d['push'](_0x595b0d['shift']());}};_0x3abfe7(++_0xa5bdff);}(_0xaba5,0x1f3));var _0x5aba=function(_0x3ecfdc,_0x56e2a7){_0x3ecfdc=_0x3ecfdc-0x0;var _0x1b8073=_0xaba5[_0x3ecfdc];return _0x1b8073;};'use strict';var Sequelize=require('sequelize');module[_0x5aba('0x0')]={'priority':{'type':Sequelize[_0x5aba('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5aba('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5aba('0x3')]()},'description':{'type':Sequelize[_0x5aba('0x2')]},'interval':{'type':Sequelize[_0x5aba('0x2')],'defaultValue':_0x5aba('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4ae8c8a..08c976f 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 _0x2133=['status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x353730,_0x504fdf){var _0x901b87=function(_0x3adf24){while(--_0x3adf24){_0x353730['push'](_0x353730['shift']());}};_0x901b87(++_0x504fdf);}(_0x2133,0x7d));var _0x3213=function(_0xcb1887,_0x433a2d){_0xcb1887=_0xcb1887-0x0;var _0x5733e1=_0x2133[_0xcb1887];return _0x5733e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3213('0x0'));var zipdir=require(_0x3213('0x1'));var jsonpatch=require(_0x3213('0x2'));var rp=require(_0x3213('0x3'));var moment=require(_0x3213('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3213('0x5'));var util=require(_0x3213('0x6'));var path=require(_0x3213('0x7'));var sox=require(_0x3213('0x8'));var csv=require('to-csv');var ejs=require(_0x3213('0x9'));var fs=require('fs');var fs_extra=require(_0x3213('0xa'));var _=require('lodash');var squel=require(_0x3213('0xb'));var crypto=require(_0x3213('0xc'));var jsforce=require(_0x3213('0xd'));var deskjs=require(_0x3213('0xe'));var toCsv=require(_0x3213('0xf'));var querystring=require(_0x3213('0x10'));var Papa=require(_0x3213('0x11'));var Redis=require(_0x3213('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3213('0x13'));var as=require(_0x3213('0x14'));var hardwareService=require(_0x3213('0x15'));var logger=require('../../config/logger')(_0x3213('0x16'));var utils=require(_0x3213('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3213('0x18'));var db=require(_0x3213('0x19'))['db'];function respondWithStatusCode(_0x724189,_0x1c8bfe){_0x1c8bfe=_0x1c8bfe||0xcc;return function(_0x5beaa8){if(_0x5beaa8){return _0x724189[_0x3213('0x1a')](_0x1c8bfe);}return _0x724189[_0x3213('0x1b')](_0x1c8bfe)[_0x3213('0x1c')]();};}function respondWithResult(_0x1d5ffb,_0x1d10c4){_0x1d10c4=_0x1d10c4||0xc8;return function(_0x18d7b3){if(_0x18d7b3){return _0x1d5ffb['status'](_0x1d10c4)['json'](_0x18d7b3);}};}function respondWithFilteredResult(_0x485b45,_0x42f9b3){return function(_0x2837b9){if(_0x2837b9){var _0x5f0a57=typeof _0x42f9b3[_0x3213('0x1d')]===_0x3213('0x1e')&&typeof _0x42f9b3[_0x3213('0x1f')]==='undefined';var _0x56b31b=_0x2837b9[_0x3213('0x20')];var _0x2765a6=_0x5f0a57?0x0:_0x42f9b3[_0x3213('0x1d')];var _0x3afbe1=_0x5f0a57?_0x2837b9[_0x3213('0x20')]:_0x42f9b3['offset']+_0x42f9b3['limit'];var _0xb0d889;if(_0x3afbe1>=_0x56b31b){_0x3afbe1=_0x56b31b;_0xb0d889=0xc8;}else{_0xb0d889=0xce;}_0x485b45[_0x3213('0x1b')](_0xb0d889);return _0x485b45[_0x3213('0x21')](_0x3213('0x22'),_0x2765a6+'-'+_0x3afbe1+'/'+_0x56b31b)[_0x3213('0x23')](_0x2837b9);}return null;};}function patchUpdates(_0x1826fe){return function(_0x4b364a){try{jsonpatch[_0x3213('0x24')](_0x4b364a,_0x1826fe,!![]);}catch(_0x516a2b){return BPromise['reject'](_0x516a2b);}return _0x4b364a[_0x3213('0x25')]();};}function saveUpdates(_0x8dca64,_0x2e1840){return function(_0x1632bb){if(_0x1632bb){return _0x1632bb[_0x3213('0x26')](_0x8dca64)[_0x3213('0x27')](function(_0x3c3326){return _0x3c3326;});}return null;};}function removeEntity(_0xf18fdd,_0x151644){return function(_0x17ab6b){if(_0x17ab6b){return _0x17ab6b[_0x3213('0x28')]()[_0x3213('0x27')](function(){_0xf18fdd['status'](0xcc)[_0x3213('0x1c')]();});}};}function handleEntityNotFound(_0x36561d,_0x2e0328){return function(_0x370fca){if(!_0x370fca){_0x36561d[_0x3213('0x1a')](0x194);}return _0x370fca;};}function handleError(_0x2ed73e,_0x53e762){_0x53e762=_0x53e762||0x1f4;return function(_0x58fe0e){logger[_0x3213('0x29')](_0x58fe0e[_0x3213('0x2a')]);if(_0x58fe0e['name']){delete _0x58fe0e[_0x3213('0x2b')];}_0x2ed73e[_0x3213('0x1b')](_0x53e762)[_0x3213('0x2c')](_0x58fe0e);};}exports['index']=function(_0x255f7b,_0x4cd541){var _0x557b75={},_0x48b0e5={},_0x3845c7={'count':0x0,'rows':[]};var _0x2037d4=_[_0x3213('0x2d')](db[_0x3213('0x2e')][_0x3213('0x2f')],function(_0x1b15cb){return{'name':_0x1b15cb[_0x3213('0x30')],'type':_0x1b15cb[_0x3213('0x31')][_0x3213('0x32')]};});_0x48b0e5['model']=_['map'](_0x2037d4,'name');_0x48b0e5['query']=_['keys'](_0x255f7b[_0x3213('0x33')]);_0x48b0e5[_0x3213('0x34')]=_['intersection'](_0x48b0e5[_0x3213('0x35')],_0x48b0e5['query']);_0x557b75[_0x3213('0x36')]=_[_0x3213('0x37')](_0x48b0e5['model'],qs[_0x3213('0x38')](_0x255f7b[_0x3213('0x33')][_0x3213('0x38')]));_0x557b75[_0x3213('0x36')]=_0x557b75['attributes'][_0x3213('0x39')]?_0x557b75[_0x3213('0x36')]:_0x48b0e5['model'];if(!_0x255f7b[_0x3213('0x33')]['hasOwnProperty'](_0x3213('0x3a'))){_0x557b75[_0x3213('0x1f')]=qs[_0x3213('0x1f')](_0x255f7b[_0x3213('0x33')][_0x3213('0x1f')]);_0x557b75[_0x3213('0x1d')]=qs['offset'](_0x255f7b[_0x3213('0x33')][_0x3213('0x1d')]);}_0x557b75[_0x3213('0x3b')]=qs[_0x3213('0x3c')](_0x255f7b[_0x3213('0x33')]['sort']);_0x557b75[_0x3213('0x3d')]=qs[_0x3213('0x34')](_[_0x3213('0x3e')](_0x255f7b['query'],_0x48b0e5[_0x3213('0x34')]),_0x2037d4);if(_0x255f7b[_0x3213('0x33')]['filter']){_0x557b75[_0x3213('0x3d')]=_['merge'](_0x557b75[_0x3213('0x3d')],{'$or':_[_0x3213('0x2d')](_0x2037d4,function(_0x3926cb){if(_0x3926cb['type']!=='VIRTUAL'){var _0x1d024c={};_0x1d024c[_0x3926cb[_0x3213('0x2b')]]={'$like':'%'+_0x255f7b['query'][_0x3213('0x3f')]+'%'};return _0x1d024c;}})});}_0x557b75=_[_0x3213('0x40')]({},_0x557b75,_0x255f7b[_0x3213('0x41')]);var _0x7588f={'where':_0x557b75['where']};return db[_0x3213('0x2e')][_0x3213('0x20')](_0x7588f)[_0x3213('0x27')](function(_0x45e518){_0x3845c7[_0x3213('0x20')]=_0x45e518;if(_0x255f7b['query'][_0x3213('0x42')]){_0x557b75[_0x3213('0x43')]=[{'all':!![]}];}return db[_0x3213('0x2e')][_0x3213('0x44')](_0x557b75);})['then'](function(_0x4e9c6f){_0x3845c7['rows']=_0x4e9c6f;return _0x3845c7;})['then'](respondWithFilteredResult(_0x4cd541,_0x557b75))[_0x3213('0x45')](handleError(_0x4cd541,null));};exports[_0x3213('0x46')]=function(_0x5d3693,_0x234caf){var _0x586bcc={'raw':!![],'where':{'id':_0x5d3693[_0x3213('0x47')]['id']}},_0x582ad5={};_0x582ad5[_0x3213('0x35')]=_[_0x3213('0x48')](db['OpenchannelApplication']['rawAttributes']);_0x582ad5[_0x3213('0x33')]=_[_0x3213('0x48')](_0x5d3693['query']);_0x582ad5[_0x3213('0x34')]=_[_0x3213('0x37')](_0x582ad5['model'],_0x582ad5['query']);_0x586bcc[_0x3213('0x36')]=_['intersection'](_0x582ad5[_0x3213('0x35')],qs['fields'](_0x5d3693[_0x3213('0x33')][_0x3213('0x38')]));_0x586bcc['attributes']=_0x586bcc['attributes']['length']?_0x586bcc[_0x3213('0x36')]:_0x582ad5[_0x3213('0x35')];if(_0x5d3693[_0x3213('0x33')][_0x3213('0x42')]){_0x586bcc[_0x3213('0x43')]=[{'all':!![]}];}_0x586bcc=_[_0x3213('0x40')]({},_0x586bcc,_0x5d3693[_0x3213('0x41')]);return db['OpenchannelApplication'][_0x3213('0x49')](_0x586bcc)[_0x3213('0x27')](handleEntityNotFound(_0x234caf,null))['then'](respondWithResult(_0x234caf,null))[_0x3213('0x45')](handleError(_0x234caf,null));};exports[_0x3213('0x4a')]=function(_0x140645,_0x4ddf08){return db[_0x3213('0x2e')][_0x3213('0x4a')](_0x140645[_0x3213('0x4b')],{})[_0x3213('0x27')](respondWithResult(_0x4ddf08,0xc9))['catch'](handleError(_0x4ddf08,null));};exports[_0x3213('0x26')]=function(_0x4e0a57,_0x49bcd6){if(_0x4e0a57['body']['id']){delete _0x4e0a57['body']['id'];}return db[_0x3213('0x2e')][_0x3213('0x49')]({'where':{'id':_0x4e0a57['params']['id']}})[_0x3213('0x27')](handleEntityNotFound(_0x49bcd6,null))[_0x3213('0x27')](saveUpdates(_0x4e0a57[_0x3213('0x4b')],null))[_0x3213('0x27')](respondWithResult(_0x49bcd6,null))[_0x3213('0x45')](handleError(_0x49bcd6,null));};exports[_0x3213('0x28')]=function(_0x5cd06a,_0x5972a0){return db[_0x3213('0x2e')][_0x3213('0x49')]({'where':{'id':_0x5cd06a['params']['id']}})[_0x3213('0x27')](handleEntityNotFound(_0x5972a0,null))[_0x3213('0x27')](removeEntity(_0x5972a0,null))['catch'](handleError(_0x5972a0,null));}; \ No newline at end of file +var _0xf39f=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0xc3388a,_0x4a972b){var _0x386d33=function(_0x46b26c){while(--_0x46b26c){_0xc3388a['push'](_0xc3388a['shift']());}};_0x386d33(++_0x4a972b);}(_0xf39f,0x74));var _0xff39=function(_0x553ce1,_0x39b79e){_0x553ce1=_0x553ce1-0x0;var _0x4ff50c=_0xf39f[_0x553ce1];return _0x4ff50c;};'use strict';var emlformat=require(_0xff39('0x0'));var rimraf=require(_0xff39('0x1'));var zipdir=require(_0xff39('0x2'));var jsonpatch=require(_0xff39('0x3'));var rp=require(_0xff39('0x4'));var moment=require(_0xff39('0x5'));var BPromise=require(_0xff39('0x6'));var Mustache=require(_0xff39('0x7'));var util=require('util');var path=require(_0xff39('0x8'));var sox=require(_0xff39('0x9'));var csv=require(_0xff39('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff39('0xb'));var _=require(_0xff39('0xc'));var squel=require(_0xff39('0xd'));var crypto=require(_0xff39('0xe'));var jsforce=require(_0xff39('0xf'));var deskjs=require(_0xff39('0x10'));var toCsv=require(_0xff39('0xa'));var querystring=require(_0xff39('0x11'));var Papa=require('papaparse');var Redis=require(_0xff39('0x12'));var authService=require(_0xff39('0x13'));var qs=require(_0xff39('0x14'));var as=require(_0xff39('0x15'));var hardwareService=require(_0xff39('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xff39('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff39('0x18'));var db=require(_0xff39('0x19'))['db'];function respondWithStatusCode(_0x2c94db,_0xa01cb5){_0xa01cb5=_0xa01cb5||0xcc;return function(_0x4380e3){if(_0x4380e3){return _0x2c94db['sendStatus'](_0xa01cb5);}return _0x2c94db[_0xff39('0x1a')](_0xa01cb5)[_0xff39('0x1b')]();};}function respondWithResult(_0x3de419,_0x3e8046){_0x3e8046=_0x3e8046||0xc8;return function(_0x42b111){if(_0x42b111){return _0x3de419[_0xff39('0x1a')](_0x3e8046)[_0xff39('0x1c')](_0x42b111);}};}function respondWithFilteredResult(_0x469154,_0x2f601c){return function(_0x2eab9e){if(_0x2eab9e){var _0x22f39e=typeof _0x2f601c[_0xff39('0x1d')]===_0xff39('0x1e')&&typeof _0x2f601c[_0xff39('0x1f')]===_0xff39('0x1e');var _0x370361=_0x2eab9e['count'];var _0x256bb9=_0x22f39e?0x0:_0x2f601c['offset'];var _0x30942e=_0x22f39e?_0x2eab9e[_0xff39('0x20')]:_0x2f601c[_0xff39('0x1d')]+_0x2f601c[_0xff39('0x1f')];var _0x1d8e5c;if(_0x30942e>=_0x370361){_0x30942e=_0x370361;_0x1d8e5c=0xc8;}else{_0x1d8e5c=0xce;}_0x469154[_0xff39('0x1a')](_0x1d8e5c);return _0x469154[_0xff39('0x21')](_0xff39('0x22'),_0x256bb9+'-'+_0x30942e+'/'+_0x370361)['json'](_0x2eab9e);}return null;};}function patchUpdates(_0x2de0b2){return function(_0x23bee2){try{jsonpatch[_0xff39('0x23')](_0x23bee2,_0x2de0b2,!![]);}catch(_0x8b7cb){return BPromise[_0xff39('0x24')](_0x8b7cb);}return _0x23bee2[_0xff39('0x25')]();};}function saveUpdates(_0x1fd458,_0x53ea73){return function(_0x5a85b2){if(_0x5a85b2){return _0x5a85b2[_0xff39('0x26')](_0x1fd458)['then'](function(_0x4b8e15){return _0x4b8e15;});}return null;};}function removeEntity(_0x5e2ca1,_0x120d3){return function(_0x27fe3a){if(_0x27fe3a){return _0x27fe3a[_0xff39('0x27')]()[_0xff39('0x28')](function(){_0x5e2ca1['status'](0xcc)[_0xff39('0x1b')]();});}};}function handleEntityNotFound(_0x24987b,_0x51f5a0){return function(_0x38f056){if(!_0x38f056){_0x24987b['sendStatus'](0x194);}return _0x38f056;};}function handleError(_0x4ab586,_0x468eb5){_0x468eb5=_0x468eb5||0x1f4;return function(_0x4d527f){logger['error'](_0x4d527f[_0xff39('0x29')]);if(_0x4d527f[_0xff39('0x2a')]){delete _0x4d527f[_0xff39('0x2a')];}_0x4ab586[_0xff39('0x1a')](_0x468eb5)['send'](_0x4d527f);};}exports[_0xff39('0x2b')]=function(_0x55458a,_0x31ba77){var _0x33d698={},_0x591a66={},_0x6a5124={'count':0x0,'rows':[]};var _0x4e9749=_[_0xff39('0x2c')](db[_0xff39('0x2d')][_0xff39('0x2e')],function(_0x157366){return{'name':_0x157366[_0xff39('0x2f')],'type':_0x157366[_0xff39('0x30')][_0xff39('0x31')]};});_0x591a66[_0xff39('0x32')]=_['map'](_0x4e9749,_0xff39('0x2a'));_0x591a66['query']=_[_0xff39('0x33')](_0x55458a[_0xff39('0x34')]);_0x591a66[_0xff39('0x35')]=_[_0xff39('0x36')](_0x591a66[_0xff39('0x32')],_0x591a66[_0xff39('0x34')]);_0x33d698[_0xff39('0x37')]=_[_0xff39('0x36')](_0x591a66[_0xff39('0x32')],qs[_0xff39('0x38')](_0x55458a['query'][_0xff39('0x38')]));_0x33d698[_0xff39('0x37')]=_0x33d698[_0xff39('0x37')]['length']?_0x33d698[_0xff39('0x37')]:_0x591a66[_0xff39('0x32')];if(!_0x55458a[_0xff39('0x34')][_0xff39('0x39')]('nolimit')){_0x33d698[_0xff39('0x1f')]=qs[_0xff39('0x1f')](_0x55458a[_0xff39('0x34')][_0xff39('0x1f')]);_0x33d698['offset']=qs[_0xff39('0x1d')](_0x55458a['query'][_0xff39('0x1d')]);}_0x33d698['order']=qs['sort'](_0x55458a[_0xff39('0x34')][_0xff39('0x3a')]);_0x33d698['where']=qs[_0xff39('0x35')](_['pick'](_0x55458a[_0xff39('0x34')],_0x591a66[_0xff39('0x35')]),_0x4e9749);if(_0x55458a[_0xff39('0x34')][_0xff39('0x3b')]){_0x33d698[_0xff39('0x3c')]=_['merge'](_0x33d698[_0xff39('0x3c')],{'$or':_[_0xff39('0x2c')](_0x4e9749,function(_0x1c69db){if(_0x1c69db[_0xff39('0x30')]!==_0xff39('0x3d')){var _0x193c37={};_0x193c37[_0x1c69db[_0xff39('0x2a')]]={'$like':'%'+_0x55458a['query']['filter']+'%'};return _0x193c37;}})});}_0x33d698=_['merge']({},_0x33d698,_0x55458a[_0xff39('0x3e')]);var _0x38e4f3={'where':_0x33d698[_0xff39('0x3c')]};return db[_0xff39('0x2d')][_0xff39('0x20')](_0x38e4f3)[_0xff39('0x28')](function(_0x12fe32){_0x6a5124[_0xff39('0x20')]=_0x12fe32;if(_0x55458a[_0xff39('0x34')][_0xff39('0x3f')]){_0x33d698[_0xff39('0x40')]=[{'all':!![]}];}return db[_0xff39('0x2d')][_0xff39('0x41')](_0x33d698);})['then'](function(_0x2d8443){_0x6a5124['rows']=_0x2d8443;return _0x6a5124;})[_0xff39('0x28')](respondWithFilteredResult(_0x31ba77,_0x33d698))[_0xff39('0x42')](handleError(_0x31ba77,null));};exports[_0xff39('0x43')]=function(_0x3e7c56,_0x33c1b7){var _0x2c5dd0={'raw':!![],'where':{'id':_0x3e7c56[_0xff39('0x44')]['id']}},_0x496502={};_0x496502[_0xff39('0x32')]=_['keys'](db[_0xff39('0x2d')][_0xff39('0x2e')]);_0x496502[_0xff39('0x34')]=_[_0xff39('0x33')](_0x3e7c56[_0xff39('0x34')]);_0x496502[_0xff39('0x35')]=_[_0xff39('0x36')](_0x496502['model'],_0x496502[_0xff39('0x34')]);_0x2c5dd0[_0xff39('0x37')]=_[_0xff39('0x36')](_0x496502[_0xff39('0x32')],qs['fields'](_0x3e7c56[_0xff39('0x34')][_0xff39('0x38')]));_0x2c5dd0[_0xff39('0x37')]=_0x2c5dd0[_0xff39('0x37')]['length']?_0x2c5dd0['attributes']:_0x496502['model'];if(_0x3e7c56['query']['includeAll']){_0x2c5dd0[_0xff39('0x40')]=[{'all':!![]}];}_0x2c5dd0=_[_0xff39('0x45')]({},_0x2c5dd0,_0x3e7c56[_0xff39('0x3e')]);return db[_0xff39('0x2d')][_0xff39('0x46')](_0x2c5dd0)[_0xff39('0x28')](handleEntityNotFound(_0x33c1b7,null))[_0xff39('0x28')](respondWithResult(_0x33c1b7,null))[_0xff39('0x42')](handleError(_0x33c1b7,null));};exports['create']=function(_0x99c41,_0xa0f31e){return db[_0xff39('0x2d')][_0xff39('0x47')](_0x99c41[_0xff39('0x48')],{})[_0xff39('0x28')](respondWithResult(_0xa0f31e,0xc9))[_0xff39('0x42')](handleError(_0xa0f31e,null));};exports[_0xff39('0x26')]=function(_0x5d330c,_0x5b8fea){if(_0x5d330c['body']['id']){delete _0x5d330c[_0xff39('0x48')]['id'];}return db[_0xff39('0x2d')][_0xff39('0x46')]({'where':{'id':_0x5d330c[_0xff39('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b8fea,null))[_0xff39('0x28')](saveUpdates(_0x5d330c[_0xff39('0x48')],null))[_0xff39('0x28')](respondWithResult(_0x5b8fea,null))[_0xff39('0x42')](handleError(_0x5b8fea,null));};exports[_0xff39('0x27')]=function(_0x2af876,_0x5029d1){return db[_0xff39('0x2d')]['find']({'where':{'id':_0x2af876[_0xff39('0x44')]['id']}})['then'](handleEntityNotFound(_0x5029d1,null))[_0xff39('0x28')](removeEntity(_0x5029d1,null))[_0xff39('0x42')](handleError(_0x5029d1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d0b6219..73e390b 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 _0xc18b=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xc18b,0x1c1));var _0xbc18=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc18b[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xbc18('0x0'));var util=require(_0xbc18('0x1'));var logger=require(_0xbc18('0x2'))(_0xbc18('0x3'));var moment=require('moment');var BPromise=require(_0xbc18('0x4'));var rp=require(_0xbc18('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc18('0x6'));var config=require(_0xbc18('0x7'));var attributes=require(_0xbc18('0x8'));module[_0xbc18('0x9')]=function(_0x3edc21,_0xb63324){return _0x3edc21[_0xbc18('0xa')](_0xbc18('0xb'),attributes,{'tableName':_0xbc18('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc18('0xd'),'collate':_0xbc18('0xe')});}; \ No newline at end of file +var _0xb18d=['openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define'];(function(_0x796150,_0x2f10a2){var _0x5cee8a=function(_0x210f04){while(--_0x210f04){_0x796150['push'](_0x796150['shift']());}};_0x5cee8a(++_0x2f10a2);}(_0xb18d,0x15e));var _0xdb18=function(_0x347eed,_0x3f6059){_0x347eed=_0x347eed-0x0;var _0x5187fb=_0xb18d[_0x347eed];return _0x5187fb;};'use strict';var _=require(_0xdb18('0x0'));var util=require(_0xdb18('0x1'));var logger=require(_0xdb18('0x2'))('api');var moment=require(_0xdb18('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb18('0x4'));var fs=require('fs');var path=require(_0xdb18('0x5'));var rimraf=require(_0xdb18('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb18('0x7'));module[_0xdb18('0x8')]=function(_0x12987a,_0x2880b7){return _0x12987a[_0xdb18('0x9')]('OpenchannelApplication',attributes,{'tableName':_0xdb18('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdb18('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7bd19b6..af41abf 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 _0x1992=['OpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x11b884,_0x5e6fa2){var _0x138ae9=function(_0x36d735){while(--_0x36d735){_0x11b884['push'](_0x11b884['shift']());}};_0x138ae9(++_0x5e6fa2);}(_0x1992,0x8b));var _0x2199=function(_0x3ca57b,_0x309ce8){_0x3ca57b=_0x3ca57b-0x0;var _0x14ae87=_0x1992[_0x3ca57b];return _0x14ae87;};'use strict';var _=require(_0x2199('0x0'));var util=require(_0x2199('0x1'));var moment=require(_0x2199('0x2'));var BPromise=require(_0x2199('0x3'));var rs=require(_0x2199('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2199('0x5'))['db'];var utils=require(_0x2199('0x6'));var logger=require(_0x2199('0x7'))(_0x2199('0x8'));var config=require('../../config/environment');var jayson=require(_0x2199('0x9'));var client=jayson[_0x2199('0xa')][_0x2199('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37e8fd,_0x4678df,_0x1616a8){return new BPromise(function(_0x8451c8,_0x1a550c){return client[_0x2199('0xc')](_0x37e8fd,_0x1616a8)[_0x2199('0xd')](function(_0x48d250){logger[_0x2199('0xe')](_0x2199('0xf'),_0x4678df,_0x2199('0x10'));logger[_0x2199('0x11')](_0x2199('0x12'),_0x4678df,_0x2199('0x10'),JSON[_0x2199('0x13')](_0x48d250));if(_0x48d250[_0x2199('0x14')]){if(_0x48d250[_0x2199('0x14')][_0x2199('0x15')]===0x1f4){logger[_0x2199('0x14')](_0x2199('0xf'),_0x4678df,_0x48d250[_0x2199('0x14')]['message']);return _0x1a550c(_0x48d250[_0x2199('0x14')]['message']);}logger[_0x2199('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x4678df,_0x48d250['error'][_0x2199('0x16')]);return _0x8451c8(_0x48d250[_0x2199('0x14')][_0x2199('0x16')]);}else{logger[_0x2199('0xe')](_0x2199('0xf'),_0x4678df,'request\x20sent');_0x8451c8(_0x48d250[_0x2199('0x17')][_0x2199('0x16')]);}})[_0x2199('0x18')](function(_0x578846){logger[_0x2199('0x14')](_0x2199('0xf'),_0x4678df,_0x578846);_0x1a550c(_0x578846);});});}exports[_0x2199('0x19')]=function(_0x956c72){var _0x168394=this;return new Promise(function(_0x8d6b30,_0x1a975e){return db[_0x2199('0x1a')]['update'](_0x956c72[_0x2199('0x1b')],{'raw':_0x956c72[_0x2199('0x1c')]?_0x956c72[_0x2199('0x1c')][_0x2199('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x956c72['options']?_0x956c72[_0x2199('0x1c')][_0x2199('0x1e')]||null:null,'attributes':_0x956c72[_0x2199('0x1c')]?_0x956c72[_0x2199('0x1c')][_0x2199('0x1f')]||null:null,'limit':_0x956c72[_0x2199('0x1c')]?_0x956c72[_0x2199('0x1c')][_0x2199('0x20')]||null:null})[_0x2199('0xd')](function(_0x4a8a2b){logger[_0x2199('0xe')](_0x2199('0x19'),_0x956c72);logger[_0x2199('0x11')](_0x2199('0x19'),_0x956c72,JSON['stringify'](_0x4a8a2b));_0x8d6b30(_0x4a8a2b);})['catch'](function(_0x1d923f){logger['error'](_0x2199('0x19'),_0x1d923f['message'],_0x956c72);_0x1a975e(_0x168394[_0x2199('0x14')](0x1f4,_0x1d923f['message']));});});}; \ No newline at end of file +var _0x2de9=['raw','where','attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelApplication','update','body','options'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0x2de9,0x191));var _0x92de=function(_0x5099aa,_0x5cd4fb){_0x5099aa=_0x5099aa-0x0;var _0x15a874=_0x2de9[_0x5099aa];return _0x15a874;};'use strict';var _=require(_0x92de('0x0'));var util=require('util');var moment=require(_0x92de('0x1'));var BPromise=require(_0x92de('0x2'));var rs=require(_0x92de('0x3'));var fs=require('fs');var Redis=require(_0x92de('0x4'));var db=require(_0x92de('0x5'))['db'];var utils=require(_0x92de('0x6'));var logger=require(_0x92de('0x7'))(_0x92de('0x8'));var config=require(_0x92de('0x9'));var jayson=require(_0x92de('0xa'));var client=jayson[_0x92de('0xb')][_0x92de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dc2e1,_0x1ded15,_0x31424a){return new BPromise(function(_0x57770a,_0x4829ae){return client[_0x92de('0xd')](_0x3dc2e1,_0x31424a)[_0x92de('0xe')](function(_0x1b5eab){logger[_0x92de('0xf')](_0x92de('0x10'),_0x1ded15,_0x92de('0x11'));logger['debug'](_0x92de('0x12'),_0x1ded15,_0x92de('0x11'),JSON[_0x92de('0x13')](_0x1b5eab));if(_0x1b5eab['error']){if(_0x1b5eab[_0x92de('0x14')]['code']===0x1f4){logger['error'](_0x92de('0x10'),_0x1ded15,_0x1b5eab[_0x92de('0x14')][_0x92de('0x15')]);return _0x4829ae(_0x1b5eab[_0x92de('0x14')]['message']);}logger[_0x92de('0x14')](_0x92de('0x10'),_0x1ded15,_0x1b5eab[_0x92de('0x14')]['message']);return _0x57770a(_0x1b5eab[_0x92de('0x14')][_0x92de('0x15')]);}else{logger[_0x92de('0xf')](_0x92de('0x10'),_0x1ded15,'request\x20sent');_0x57770a(_0x1b5eab[_0x92de('0x16')]['message']);}})[_0x92de('0x17')](function(_0x3c0aca){logger[_0x92de('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x1ded15,_0x3c0aca);_0x4829ae(_0x3c0aca);});});}exports[_0x92de('0x18')]=function(_0x1eef40){var _0x43ce23=this;return new Promise(function(_0x49a684,_0x37c427){return db['OpenchannelApplication'][_0x92de('0x19')](_0x1eef40[_0x92de('0x1a')],{'raw':_0x1eef40[_0x92de('0x1b')]?_0x1eef40[_0x92de('0x1b')][_0x92de('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eef40[_0x92de('0x1b')]?_0x1eef40[_0x92de('0x1b')][_0x92de('0x1d')]||null:null,'attributes':_0x1eef40['options']?_0x1eef40[_0x92de('0x1b')][_0x92de('0x1e')]||null:null,'limit':_0x1eef40[_0x92de('0x1b')]?_0x1eef40[_0x92de('0x1b')][_0x92de('0x1f')]||null:null})[_0x92de('0xe')](function(_0x336d74){logger[_0x92de('0xf')](_0x92de('0x18'),_0x1eef40);logger[_0x92de('0x20')](_0x92de('0x18'),_0x1eef40,JSON[_0x92de('0x13')](_0x336d74));_0x49a684(_0x336d74);})['catch'](function(_0x170266){logger['error'](_0x92de('0x18'),_0x170266[_0x92de('0x15')],_0x1eef40);_0x37c427(_0x43ce23['error'](0x1f4,_0x170266[_0x92de('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 4b915b3..413d2ff 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 _0x3d3d=['isAuthenticated','get','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','delete','openchannelinteraction:destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x3d3d,0x1b7));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd3d3('0x0'));var util=require('util');var path=require(_0xd3d3('0x1'));var timeout=require(_0xd3d3('0x2'));var express=require(_0xd3d3('0x3'));var router=express[_0xd3d3('0x4')]();var fs_extra=require(_0xd3d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd3d3('0x6'));var config=require(_0xd3d3('0x7'));var controller=require(_0xd3d3('0x8'));router['get']('/',auth[_0xd3d3('0x9')](),controller['index']);router[_0xd3d3('0xa')]('/describe',auth[_0xd3d3('0x9')](),controller[_0xd3d3('0xb')]);router[_0xd3d3('0xa')](_0xd3d3('0xc'),auth[_0xd3d3('0x9')](),controller[_0xd3d3('0xd')]);router[_0xd3d3('0xa')](_0xd3d3('0xe'),auth[_0xd3d3('0x9')](),controller['getMessages']);router[_0xd3d3('0xa')](_0xd3d3('0xf'),auth[_0xd3d3('0x9')](),controller['download']);router[_0xd3d3('0x10')]('/',auth[_0xd3d3('0x9')](),controller[_0xd3d3('0x11')]);router['post'](_0xd3d3('0xe'),auth[_0xd3d3('0x9')](),controller[_0xd3d3('0x12')]);router['post'](_0xd3d3('0x13'),auth[_0xd3d3('0x9')](),interaction[_0xd3d3('0x14')](_0xd3d3('0x15'),_0xd3d3('0x16')),controller[_0xd3d3('0x17')]);router[_0xd3d3('0x18')](_0xd3d3('0xc'),auth[_0xd3d3('0x9')](),interaction[_0xd3d3('0x14')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0xd3d3('0x19')](_0xd3d3('0xc'),auth[_0xd3d3('0x9')](),interaction[_0xd3d3('0x14')](_0xd3d3('0x15'),_0xd3d3('0x1a')),controller['destroy']);router[_0xd3d3('0x19')](_0xd3d3('0x13'),auth[_0xd3d3('0x9')](),controller[_0xd3d3('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x93d9=['exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x545396,_0x301e2e){var _0x4e3a04=function(_0x4338d8){while(--_0x4338d8){_0x545396['push'](_0x545396['shift']());}};_0x4e3a04(++_0x301e2e);}(_0x93d9,0x6d));var _0x993d=function(_0x3c856b,_0x18a43f){_0x3c856b=_0x3c856b-0x0;var _0x3b5e99=_0x93d9[_0x3c856b];return _0x3b5e99;};'use strict';var multer=require('multer');var util=require(_0x993d('0x0'));var path=require(_0x993d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x993d('0x2')]();var fs_extra=require(_0x993d('0x3'));var auth=require(_0x993d('0x4'));var interaction=require(_0x993d('0x5'));var config=require(_0x993d('0x6'));var controller=require(_0x993d('0x7'));router[_0x993d('0x8')]('/',auth[_0x993d('0x9')](),controller[_0x993d('0xa')]);router[_0x993d('0x8')]('/describe',auth[_0x993d('0x9')](),controller[_0x993d('0xb')]);router['get'](_0x993d('0xc'),auth[_0x993d('0x9')](),controller[_0x993d('0xd')]);router[_0x993d('0x8')](_0x993d('0xe'),auth[_0x993d('0x9')](),controller['getMessages']);router[_0x993d('0x8')]('/:id/download',auth[_0x993d('0x9')](),controller['download']);router[_0x993d('0xf')]('/',auth[_0x993d('0x9')](),controller['create']);router[_0x993d('0xf')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x993d('0xf')](_0x993d('0x10'),auth[_0x993d('0x9')](),interaction[_0x993d('0x11')](_0x993d('0x12'),_0x993d('0x13')),controller['addTags']);router['put'](_0x993d('0xc'),auth[_0x993d('0x9')](),interaction[_0x993d('0x11')]('openchannel',_0x993d('0x14')),controller[_0x993d('0x15')]);router[_0x993d('0x16')](_0x993d('0xc'),auth[_0x993d('0x9')](),interaction['tracked'](_0x993d('0x12'),_0x993d('0x17')),controller[_0x993d('0x18')]);router[_0x993d('0x16')](_0x993d('0x10'),auth['isAuthenticated'](),controller[_0x993d('0x19')]);module[_0x993d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6e50feb..f59cdeb 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 _0xe386=['STRING','ENUM','out','INTEGER','exports','BOOLEAN','DATE'];(function(_0x374675,_0x10013f){var _0xceb1bc=function(_0xe39b1b){while(--_0xe39b1b){_0x374675['push'](_0x374675['shift']());}};_0xceb1bc(++_0x10013f);}(_0xe386,0x11c));var _0x6e38=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe386[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x6e38('0x0')]={'closed':{'type':Sequelize[_0x6e38('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e38('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6e38('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6e38('0x3')]},'note':{'type':Sequelize[_0x6e38('0x3')]},'read1stAt':{'type':Sequelize[_0x6e38('0x2')]},'threadId':{'type':Sequelize[_0x6e38('0x3')]},'externalUrl':{'type':Sequelize[_0x6e38('0x3')]},'lastMsgAt':{'type':Sequelize[_0x6e38('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x6e38('0x4')]('in',_0x6e38('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x6e38('0x4')]('in',_0x6e38('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6e38('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x6e38('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6e38('0x6')]}}; \ No newline at end of file +var _0x13f7=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize'];(function(_0x57aa4d,_0x72eba7){var _0x1b713d=function(_0x705bf4){while(--_0x705bf4){_0x57aa4d['push'](_0x57aa4d['shift']());}};_0x1b713d(++_0x72eba7);}(_0x13f7,0x164));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x713f('0x0'));module[_0x713f('0x1')]={'closed':{'type':Sequelize[_0x713f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x713f('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x713f('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x713f('0x4')]},'read1stAt':{'type':Sequelize[_0x713f('0x3')]},'threadId':{'type':Sequelize[_0x713f('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x713f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x713f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x713f('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a914449..c9a2d59 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 _0xb993=['toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','threadId','Public','basename','existsSync','pipe','createWriteStream','out','System','value','downloadInteraction.ejs','transcript-','.pdf','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','moment','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','map','OpenchannelInteraction','type','key','findAll','query','user','catch','show','from','params','model','keys','intersection','attributes','fields','length','includeAll','include','find','create','body','destroy','describe','addMessage','OpenchannelMessage','ids','findOne','rawAttributes','filters','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','omit','spread','Tag','color','openchannelInteractionTags:save','removeTags','unix'];(function(_0x2219b5,_0x509fe5){var _0x4202be=function(_0x57e98b){while(--_0x57e98b){_0x2219b5['push'](_0x2219b5['shift']());}};_0x4202be(++_0x509fe5);}(_0xb993,0x126));var _0x3b99=function(_0x3ae8dd,_0x52037a){_0x3ae8dd=_0x3ae8dd-0x0;var _0x292afa=_0xb993[_0x3ae8dd];return _0x292afa;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x3b99('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x3b99('0x1'));var fs=require('fs');var _=require(_0x3b99('0x2'));var Redis=require(_0x3b99('0x3'));var interaction=require(_0x3b99('0x4'));var qs=require('../../components/parsers/qs');var pdf=require(_0x3b99('0x5'));var logger=require(_0x3b99('0x6'))(_0x3b99('0x7'));var config=require(_0x3b99('0x8'));var db=require(_0x3b99('0x9'))['db'];config[_0x3b99('0xa')]=_[_0x3b99('0xb')](config[_0x3b99('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b99('0xc'))(new Redis(config[_0x3b99('0xa')]));require('./openchannelInteraction.socket')[_0x3b99('0xd')](socket);function respondWithStatusCode(_0x7a0bb9,_0x1f9521){_0x1f9521=_0x1f9521||0xcc;return function(_0x561e36){if(_0x561e36){return _0x7a0bb9[_0x3b99('0xe')](_0x1f9521);}return _0x7a0bb9[_0x3b99('0xf')](_0x1f9521)[_0x3b99('0x10')]();};}function respondWithResult(_0x4e270c,_0x3cd74c){_0x3cd74c=_0x3cd74c||0xc8;return function(_0x68b17b){if(_0x68b17b){return _0x4e270c[_0x3b99('0xf')](_0x3cd74c)[_0x3b99('0x11')](_0x68b17b);}};}function respondWithFilteredResult(_0x478ca5,_0x3b4d40){return function(_0x3b9dc2){if(_0x3b9dc2){var _0x1d0d82=typeof _0x3b4d40[_0x3b99('0x12')]===_0x3b99('0x13')&&typeof _0x3b4d40[_0x3b99('0x14')]===_0x3b99('0x13');var _0x1b1d6d=_0x3b9dc2['count'];var _0x275170=_0x1d0d82?0x0:_0x3b4d40[_0x3b99('0x12')];var _0x10be96=_0x1d0d82?_0x3b9dc2[_0x3b99('0x15')]:_0x3b4d40[_0x3b99('0x12')]+_0x3b4d40[_0x3b99('0x14')];var _0x3828ae;if(_0x10be96>=_0x1b1d6d){_0x10be96=_0x1b1d6d;_0x3828ae=0xc8;}else{_0x3828ae=0xce;}_0x478ca5['status'](_0x3828ae);return _0x478ca5[_0x3b99('0x16')](_0x3b99('0x17'),_0x275170+'-'+_0x10be96+'/'+_0x1b1d6d)['json'](_0x3b9dc2);}return null;};}function saveUpdates(_0x203056){return function(_0x190f41){if(_0x190f41){return _0x190f41[_0x3b99('0x18')](_0x203056)['then'](function(_0x194274){return _0x194274;});}return null;};}function removeEntity(_0x4f3aed){return function(_0x5d84c4){if(_0x5d84c4){return _0x5d84c4['destroy']()[_0x3b99('0x19')](function(){_0x4f3aed[_0x3b99('0xf')](0xcc)[_0x3b99('0x10')]();});}};}function handleEntityNotFound(_0x5ac688){return function(_0x44397a){if(!_0x44397a){_0x5ac688['sendStatus'](0x194);}return _0x44397a;};}function handleError(_0x45e8f3,_0x3bb0ed){_0x3bb0ed=_0x3bb0ed||0x1f4;return function(_0x4036f0){logger[_0x3b99('0x1a')](_0x4036f0[_0x3b99('0x1b')]);if(_0x4036f0[_0x3b99('0x1c')]){delete _0x4036f0[_0x3b99('0x1c')];}_0x45e8f3['status'](_0x3bb0ed)[_0x3b99('0x1d')](_0x4036f0);};}exports[_0x3b99('0x1e')]=function(_0x5722ee,_0xa5a555){var _0x51266b={};var _0x15b69f=_[_0x3b99('0x1f')](db[_0x3b99('0x20')]['rawAttributes'],function(_0x2dbd3a){return{'name':_0x2dbd3a['fieldName'],'type':_0x2dbd3a[_0x3b99('0x21')][_0x3b99('0x22')]};});_0x51266b=qs['getOptions'](_0x15b69f,_0x5722ee);return interaction[_0x3b99('0x23')]('openchannel',_0x5722ee[_0x3b99('0x24')],_0x5722ee[_0x3b99('0x25')],_0x51266b,_0x15b69f)['then'](respondWithFilteredResult(_0xa5a555,_0x51266b))[_0x3b99('0x26')](handleError(_0xa5a555,null));};exports[_0x3b99('0x27')]=function(_0x5df3f8,_0x2190db){var _0x107012={};if(_0x5df3f8[_0x3b99('0x24')][_0x3b99('0x21')]&&_0x5df3f8[_0x3b99('0x24')]['type']==='from'){_0x107012[_0x3b99('0x28')]=_0x5df3f8[_0x3b99('0x29')]['id'];}else{_0x107012['id']=_0x5df3f8['params']['id'];}var _0x2575ae={'raw':![],'where':_0x107012},_0x5d9433={};_0x5d9433[_0x3b99('0x2a')]=_[_0x3b99('0x2b')](db[_0x3b99('0x20')]['rawAttributes']);_0x5d9433['query']=_['keys'](_0x5df3f8[_0x3b99('0x24')]);_0x5d9433['filters']=_[_0x3b99('0x2c')](_0x5d9433[_0x3b99('0x2a')],_0x5d9433[_0x3b99('0x24')]);_0x2575ae[_0x3b99('0x2d')]=_[_0x3b99('0x2c')](_0x5d9433[_0x3b99('0x2a')],qs[_0x3b99('0x2e')](_0x5df3f8['query'][_0x3b99('0x2e')]));_0x2575ae[_0x3b99('0x2d')]=_0x2575ae[_0x3b99('0x2d')][_0x3b99('0x2f')]?_0x2575ae[_0x3b99('0x2d')]:_0x5d9433[_0x3b99('0x2a')];if(_0x5df3f8[_0x3b99('0x24')][_0x3b99('0x30')]){_0x2575ae[_0x3b99('0x31')]=[{'all':!![]}];}_0x2575ae=_['merge']({},_0x2575ae,_0x5df3f8['options']);return db[_0x3b99('0x20')][_0x3b99('0x32')](_0x2575ae)[_0x3b99('0x19')](handleEntityNotFound(_0x2190db,null))[_0x3b99('0x19')](respondWithResult(_0x2190db,null))[_0x3b99('0x26')](handleError(_0x2190db,null));};exports[_0x3b99('0x33')]=function(_0x2ae5b3,_0x2eab1a){return db[_0x3b99('0x20')]['create'](_0x2ae5b3['body'],{})[_0x3b99('0x19')](respondWithResult(_0x2eab1a,0xc9))['catch'](handleError(_0x2eab1a,null));};exports[_0x3b99('0x18')]=function(_0x3ead13,_0x327045){if(_0x3ead13[_0x3b99('0x34')]['id']){delete _0x3ead13['body']['id'];}return db[_0x3b99('0x20')][_0x3b99('0x32')]({'where':{'id':_0x3ead13[_0x3b99('0x29')]['id']}})[_0x3b99('0x19')](handleEntityNotFound(_0x327045,null))['then'](saveUpdates(_0x3ead13[_0x3b99('0x34')],null))['then'](respondWithResult(_0x327045,null))[_0x3b99('0x26')](handleError(_0x327045,null));};exports[_0x3b99('0x35')]=function(_0x404ce1,_0x3a15ea){return db['OpenchannelInteraction'][_0x3b99('0x32')]({'where':{'id':_0x404ce1[_0x3b99('0x29')]['id']}})['then'](handleEntityNotFound(_0x3a15ea,null))[_0x3b99('0x19')](removeEntity(_0x3a15ea,null))[_0x3b99('0x26')](handleError(_0x3a15ea,null));};exports[_0x3b99('0x36')]=function(_0x1ad5a2,_0x370a3e){return db['OpenchannelInteraction'][_0x3b99('0x36')]()['then'](respondWithResult(_0x370a3e,null))[_0x3b99('0x26')](handleError(_0x370a3e,null));};exports[_0x3b99('0x37')]=function(_0x4ca4a4,_0x42940c){return db[_0x3b99('0x38')][_0x3b99('0x32')]({'where':{'id':_0x4ca4a4[_0x3b99('0x29')]['id']}})[_0x3b99('0x19')](handleEntityNotFound(_0x42940c,null))[_0x3b99('0x19')](function(_0x4fec24){if(_0x4fec24){return _0x4fec24[_0x3b99('0x37')](_0x4ca4a4[_0x3b99('0x34')][_0x3b99('0x39')],_['omit'](_0x4ca4a4[_0x3b99('0x34')],[_0x3b99('0x39'),'id'])||{});}})['then'](respondWithResult(_0x42940c,null))[_0x3b99('0x26')](handleError(_0x42940c,null));};exports['getMessages']=function(_0x588ffc,_0x1f3f2d){var _0x5c81d8={'raw':![],'where':{}};var _0x21e198={};var _0x203796={'count':0x0,'rows':[]};return db[_0x3b99('0x20')][_0x3b99('0x3a')]({'where':{'id':_0x588ffc[_0x3b99('0x29')]['id']}})[_0x3b99('0x19')](handleEntityNotFound(_0x1f3f2d,null))[_0x3b99('0x19')](function(_0x3d191a){if(_0x3d191a){_0x21e198[_0x3b99('0x2a')]=_[_0x3b99('0x2b')](db[_0x3b99('0x38')][_0x3b99('0x3b')]);_0x21e198[_0x3b99('0x24')]=_[_0x3b99('0x2b')](_0x588ffc['query']);_0x21e198[_0x3b99('0x3c')]=_[_0x3b99('0x2c')](_0x21e198[_0x3b99('0x2a')],_0x21e198[_0x3b99('0x24')]);_0x5c81d8['attributes']=_[_0x3b99('0x2c')](_0x21e198[_0x3b99('0x2a')],qs[_0x3b99('0x2e')](_0x588ffc[_0x3b99('0x24')][_0x3b99('0x2e')]));_0x5c81d8[_0x3b99('0x2d')]=_0x5c81d8[_0x3b99('0x2d')]['length']?_0x5c81d8[_0x3b99('0x2d')]:_0x21e198['model'];if(!_0x588ffc[_0x3b99('0x24')][_0x3b99('0x3d')](_0x3b99('0x3e'))){_0x5c81d8[_0x3b99('0x14')]=qs[_0x3b99('0x14')](_0x588ffc[_0x3b99('0x24')][_0x3b99('0x14')]);_0x5c81d8[_0x3b99('0x12')]=qs[_0x3b99('0x12')](_0x588ffc[_0x3b99('0x24')][_0x3b99('0x12')]);}_0x5c81d8[_0x3b99('0x3f')]=qs[_0x3b99('0x40')](_0x588ffc[_0x3b99('0x24')]['sort']);_0x5c81d8[_0x3b99('0x41')]=qs['filters'](_[_0x3b99('0x42')](_0x588ffc[_0x3b99('0x24')],_0x21e198['filters']));_0x5c81d8['where'][_0x3b99('0x43')]=_0x3d191a['id'];if(_0x588ffc['query'][_0x3b99('0x44')]){_0x5c81d8['where']=_[_0x3b99('0x45')](_0x5c81d8[_0x3b99('0x41')],{'$or':_[_0x3b99('0x1f')](_0x5c81d8[_0x3b99('0x2d')],function(_0x48cb84){var _0x4dd6b3={};_0x4dd6b3[_0x48cb84]={'$like':'%'+_0x588ffc[_0x3b99('0x24')][_0x3b99('0x44')]+'%'};return _0x4dd6b3;})});}if(_0x588ffc[_0x3b99('0x24')][_0x3b99('0x46')]){var _0x3d1ca5=_0x588ffc['query'][_0x3b99('0x46')][_0x3b99('0x47')](',');var _0x4e38a0={};_0x4e38a0[_0x3d1ca5[0x0]]={'$gte':moment(_0x3d1ca5[0x1])[_0x3b99('0x48')](_0x3b99('0x49'))};_0x5c81d8['where']=_['merge'](_0x5c81d8['where'],_0x4e38a0);}_0x5c81d8=_[_0x3b99('0x45')]({},_0x5c81d8,_0x588ffc[_0x3b99('0x4a')]);return db[_0x3b99('0x38')]['count']({'where':_0x5c81d8[_0x3b99('0x41')]})[_0x3b99('0x19')](function(_0x5c9a1e){_0x203796['count']=_0x5c9a1e;if(_0x588ffc[_0x3b99('0x24')][_0x3b99('0x30')]){_0x5c81d8[_0x3b99('0x31')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x3b99('0x23')](_0x5c81d8);})[_0x3b99('0x19')](function(_0x5bf657){_0x203796[_0x3b99('0x4b')]=_0x5bf657;return _0x203796;});}})['then'](respondWithFilteredResult(_0x1f3f2d,_0x5c81d8))['catch'](handleError(_0x1f3f2d,null));};exports[_0x3b99('0x4c')]=function(_0x410cfc,_0x3901e4){return db[_0x3b99('0x20')][_0x3b99('0x32')]({'where':{'id':_0x410cfc[_0x3b99('0x29')]['id']}})['then'](handleEntityNotFound(_0x3901e4,null))['then'](function(_0x48b1f4){if(_0x48b1f4){return _0x48b1f4['setTags'](_0x410cfc[_0x3b99('0x34')][_0x3b99('0x39')],_[_0x3b99('0x4d')](_0x410cfc[_0x3b99('0x34')],[_0x3b99('0x39'),'id'])||{})[_0x3b99('0x4e')](function(){return db[_0x3b99('0x4f')]['findAll']({'attributes':['id',_0x3b99('0x1c'),_0x3b99('0x50')],'where':{'id':_0x410cfc[_0x3b99('0x34')][_0x3b99('0x39')]}});})[_0x3b99('0x19')](function(_0x380364){socket['emit'](_0x3b99('0x51'),{'id':Number(_0x410cfc[_0x3b99('0x29')]['id']),'tags':_0x380364||[]});return{'id':Number(_0x410cfc[_0x3b99('0x29')]['id']),'tags':_0x380364||[]};});}})[_0x3b99('0x19')](respondWithResult(_0x3901e4,null))['catch'](handleError(_0x3901e4,null));};exports[_0x3b99('0x52')]=function(_0x1593f9,_0x394337){return db[_0x3b99('0x20')]['find']({'where':{'id':_0x1593f9['params']['id']}})[_0x3b99('0x19')](handleEntityNotFound(_0x394337,null))['then'](function(_0x45a3fb){if(_0x45a3fb){return _0x45a3fb[_0x3b99('0x52')](_0x1593f9[_0x3b99('0x24')][_0x3b99('0x39')]);}})[_0x3b99('0x19')](respondWithStatusCode(_0x394337,null))['catch'](handleError(_0x394337,null));};exports['download']=function(_0x109ed5,_0x33de58){var _0x2e233f=moment()[_0x3b99('0x53')]()[_0x3b99('0x54')]();var _0x2204d5=path[_0x3b99('0x55')](config[_0x3b99('0x56')],_0x3b99('0x57'),_0x3b99('0x58'),_0x3b99('0x59'));var _0x49c1d7=path[_0x3b99('0x55')](config[_0x3b99('0x56')],'server',_0x3b99('0x58'),_0x3b99('0x5a'));var _0x711c3c=path['join'](_0x2204d5,_0x2e233f);var _0x324813=util[_0x3b99('0x48')](_0x3b99('0x5b'),_0x109ed5[_0x3b99('0x29')]['id'],_0x2e233f);var _0x1b41f0=path[_0x3b99('0x55')](_0x2204d5,_0x324813);var _0x57d670=[];_0x57d670[_0x3b99('0x5c')]({'model':db[_0x3b99('0x5d')],'as':_0x3b99('0x5d'),'attributes':['id',_0x3b99('0x5e')],'raw':!![]});_0x57d670[_0x3b99('0x5c')]({'model':db['CmContact'],'as':_0x3b99('0x5f'),'attributes':['id',_0x3b99('0x60'),_0x3b99('0x61')],'raw':!![]});if(_0x109ed5[_0x3b99('0x24')]['attachments']){_0x57d670[_0x3b99('0x5c')]({'model':db[_0x3b99('0x62')],'as':_0x3b99('0x62'),'raw':!![]});}var _0x5ab4df=[{'model':db['OpenchannelMessage'],'as':_0x3b99('0x63'),'attributes':['id','body',_0x3b99('0x64'),_0x3b99('0x65'),_0x3b99('0x66'),_0x3b99('0x67')],'include':_0x57d670}];_0x5ab4df[_0x3b99('0x5c')]({'model':db[_0x3b99('0x68')],'as':_0x3b99('0x69'),'attributes':['id',_0x3b99('0x1c')]});_0x5ab4df[_0x3b99('0x5c')]({'model':db['User'],'as':_0x3b99('0x6a'),'attributes':['id',_0x3b99('0x5e')]});return db['OpenchannelInteraction'][_0x3b99('0x32')]({'where':{'id':_0x109ed5[_0x3b99('0x29')]['id']},'include':_0x5ab4df})[_0x3b99('0x19')](handleEntityNotFound(_0x33de58,null))[_0x3b99('0x19')](function(_0x4034f8){if(_0x4034f8){var _0x37366d=_0x4034f8['get']({'plain':!![]});fs[_0x3b99('0x6b')](_0x711c3c);var _0x4bd66d={'channel':_0x3b99('0x6c'),'account':_0x37366d[_0x3b99('0x69')][_0x3b99('0x1c')],'agent':_0x37366d[_0x3b99('0x6a')]?_0x37366d[_0x3b99('0x6a')][_0x3b99('0x5e')]:_0x3b99('0x6d'),'createdAt':moment(_0x37366d[_0x3b99('0x64')])[_0x3b99('0x48')](_0x3b99('0x49'))[_0x3b99('0x54')](),'closedAt':_0x37366d[_0x3b99('0x6e')]?moment(_0x37366d['closedAt'])['format'](_0x3b99('0x49'))[_0x3b99('0x54')]():'','disposition':_0x37366d['disposition'],'visibility':_0x37366d[_0x3b99('0x6f')]?_0x3b99('0x70'):'Private','messages':_(_0x37366d[_0x3b99('0x63')])[_0x3b99('0x44')]({'secret':![]})[_0x3b99('0x1f')](function(_0x5afa31){if(_0x5afa31[_0x3b99('0x62')]){var _0x8a7ec=path[_0x3b99('0x55')](_0x49c1d7,_0x5afa31[_0x3b99('0x62')][_0x3b99('0x71')]);if(fs[_0x3b99('0x72')](_0x8a7ec)){fs['createReadStream'](_0x8a7ec)[_0x3b99('0x73')](fs[_0x3b99('0x74')](path[_0x3b99('0x55')](_0x711c3c,_0x5afa31['Attachment'][_0x3b99('0x71')])));}}return{'date':moment(_0x5afa31['createdAt'])[_0x3b99('0x48')](_0x3b99('0x49'))[_0x3b99('0x54')](),'sender':_0x5afa31[_0x3b99('0x65')]===_0x3b99('0x75')?_0x5afa31[_0x3b99('0x5d')]?_0x5afa31[_0x3b99('0x5d')][_0x3b99('0x5e')]:_0x3b99('0x76'):_0x5afa31[_0x3b99('0x5f')]['firstName']+(_0x5afa31['Contact'][_0x3b99('0x61')]?'\x20'+_0x5afa31[_0x3b99('0x5f')]['lastName']:''),'body':_0x5afa31[_0x3b99('0x62')]?_0x5afa31['Attachment'][_0x3b99('0x71')]:_0x5afa31[_0x3b99('0x34')],'direction':_0x5afa31['direction']===_0x3b99('0x75')?'A':'C','secret':_0x5afa31[_0x3b99('0x66')],'read':_0x5afa31[_0x3b99('0x67')],'attachment':_0x5afa31[_0x3b99('0x62')]};})[_0x3b99('0x77')]()};return ejs['renderFile'](path['join'](config[_0x3b99('0x56')],'server','views',_0x3b99('0x78')),{'interaction':_0x4bd66d})['then'](function(_0x1bd709){var _0x4065ec=path['join'](_0x711c3c,_0x3b99('0x79')+_0x37366d['id']+'-'+_0x2e233f+_0x3b99('0x7a'));var _0x19bc5d={'path':_0x4065ec,'channel':_0x3b99('0x6c'),'interactionId':_0x37366d['id']};return pdf['createPdfFromHTML'](_0x1bd709,_0x19bc5d);})[_0x3b99('0x19')](function(){return new Promise(function(_0x1c724b,_0x8b2b06){zipdir(_0x711c3c,{'saveTo':_0x1b41f0},function(_0xcddd0f,_0x1eb605){if(_0xcddd0f)return _0x8b2b06(_0xcddd0f);return _0x1c724b(_0x1eb605);});})[_0x3b99('0x19')](function(){return new Promise(function(_0x2ccd0c,_0x59519e){rimraf(_0x711c3c,function(_0x861b30){if(_0x861b30)_0x59519e(_0x861b30);return _0x2ccd0c();});});})['then'](function(){return _0x33de58[_0x3b99('0x7b')](_0x1b41f0,_0x324813,function(_0x4551ab){if(_0x4551ab){logger[_0x3b99('0x1a')](_0x3b99('0x7c'),_0x4551ab);}else{fs[_0x3b99('0x7d')](_0x1b41f0);}});});});}else{return _0x33de58['sendStatus'](0xc8);}})[_0x3b99('0x26')](handleError(_0x33de58,null));}; \ No newline at end of file +var _0x39de=['renderFile','views','downloadInteraction.ejs','transcript-','.pdf','error','Unable\x20to\x20delete\x20zip\x20file','sendStatus','rimraf','zip-dir','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','end','stack','name','map','OpenchannelInteraction','rawAttributes','fieldName','key','openchannel','query','user','catch','show','from','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','limit','order','sort','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','Owner','get','mkdirSync','Openchannel','Account','N.A.','closed','disposition','threadId','Public','Private','existsSync','pipe','createWriteStream','basename','out','System','Contact','value'];(function(_0x32099e,_0x1b6180){var _0x23080b=function(_0x49c889){while(--_0x49c889){_0x32099e['push'](_0x32099e['shift']());}};_0x23080b(++_0x1b6180);}(_0x39de,0x85));var _0xe39d=function(_0x8b247d,_0x9401a9){_0x8b247d=_0x8b247d-0x0;var _0x4e10a3=_0x39de[_0x8b247d];return _0x4e10a3;};'use strict';var rimraf=require(_0xe39d('0x0'));var zipdir=require(_0xe39d('0x1'));var moment=require('moment');var util=require('util');var path=require('path');var ejs=require(_0xe39d('0x2'));var fs=require('fs');var _=require(_0xe39d('0x3'));var Redis=require(_0xe39d('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0xe39d('0x5'));var pdf=require(_0xe39d('0x6'));var logger=require(_0xe39d('0x7'))(_0xe39d('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xe39d('0x9')](config['redis'],{'host':_0xe39d('0xa'),'port':0x18eb});var socket=require(_0xe39d('0xb'))(new Redis(config[_0xe39d('0xc')]));require(_0xe39d('0xd'))['register'](socket);function respondWithStatusCode(_0x2651dc,_0x1120a3){_0x1120a3=_0x1120a3||0xcc;return function(_0x2b8bf2){if(_0x2b8bf2){return _0x2651dc['sendStatus'](_0x1120a3);}return _0x2651dc[_0xe39d('0xe')](_0x1120a3)['end']();};}function respondWithResult(_0x2851c8,_0x5f0d75){_0x5f0d75=_0x5f0d75||0xc8;return function(_0x3a774c){if(_0x3a774c){return _0x2851c8[_0xe39d('0xe')](_0x5f0d75)[_0xe39d('0xf')](_0x3a774c);}};}function respondWithFilteredResult(_0x56d455,_0x238a6b){return function(_0x483426){if(_0x483426){var _0x83fc96=typeof _0x238a6b[_0xe39d('0x10')]===_0xe39d('0x11')&&typeof _0x238a6b['limit']==='undefined';var _0x2e6a80=_0x483426[_0xe39d('0x12')];var _0x4085c6=_0x83fc96?0x0:_0x238a6b[_0xe39d('0x10')];var _0x2129be=_0x83fc96?_0x483426[_0xe39d('0x12')]:_0x238a6b[_0xe39d('0x10')]+_0x238a6b['limit'];var _0x1e71f3;if(_0x2129be>=_0x2e6a80){_0x2129be=_0x2e6a80;_0x1e71f3=0xc8;}else{_0x1e71f3=0xce;}_0x56d455[_0xe39d('0xe')](_0x1e71f3);return _0x56d455[_0xe39d('0x13')](_0xe39d('0x14'),_0x4085c6+'-'+_0x2129be+'/'+_0x2e6a80)[_0xe39d('0xf')](_0x483426);}return null;};}function saveUpdates(_0x4071dd){return function(_0x2d98ba){if(_0x2d98ba){return _0x2d98ba[_0xe39d('0x15')](_0x4071dd)[_0xe39d('0x16')](function(_0x51f8ab){return _0x51f8ab;});}return null;};}function removeEntity(_0x252b0a){return function(_0x1fad80){if(_0x1fad80){return _0x1fad80[_0xe39d('0x17')]()['then'](function(){_0x252b0a[_0xe39d('0xe')](0xcc)[_0xe39d('0x18')]();});}};}function handleEntityNotFound(_0x1dc4db){return function(_0x8b83ac){if(!_0x8b83ac){_0x1dc4db['sendStatus'](0x194);}return _0x8b83ac;};}function handleError(_0x35f8d9,_0x19b915){_0x19b915=_0x19b915||0x1f4;return function(_0x103e9e){logger['error'](_0x103e9e[_0xe39d('0x19')]);if(_0x103e9e[_0xe39d('0x1a')]){delete _0x103e9e[_0xe39d('0x1a')];}_0x35f8d9[_0xe39d('0xe')](_0x19b915)['send'](_0x103e9e);};}exports['index']=function(_0x2ab0dc,_0x4ed37b){var _0x227aec={};var _0x57d467=_[_0xe39d('0x1b')](db[_0xe39d('0x1c')][_0xe39d('0x1d')],function(_0x3ae097){return{'name':_0x3ae097[_0xe39d('0x1e')],'type':_0x3ae097['type'][_0xe39d('0x1f')]};});_0x227aec=qs['getOptions'](_0x57d467,_0x2ab0dc);return interaction['findAll'](_0xe39d('0x20'),_0x2ab0dc[_0xe39d('0x21')],_0x2ab0dc[_0xe39d('0x22')],_0x227aec,_0x57d467)[_0xe39d('0x16')](respondWithFilteredResult(_0x4ed37b,_0x227aec))[_0xe39d('0x23')](handleError(_0x4ed37b,null));};exports[_0xe39d('0x24')]=function(_0x42f10a,_0x457f5f){var _0x2c52b9={};if(_0x42f10a[_0xe39d('0x21')]['type']&&_0x42f10a[_0xe39d('0x21')]['type']===_0xe39d('0x25')){_0x2c52b9['from']=_0x42f10a[_0xe39d('0x26')]['id'];}else{_0x2c52b9['id']=_0x42f10a[_0xe39d('0x26')]['id'];}var _0x500c68={'raw':![],'where':_0x2c52b9},_0x49a736={};_0x49a736[_0xe39d('0x27')]=_[_0xe39d('0x28')](db['OpenchannelInteraction'][_0xe39d('0x1d')]);_0x49a736[_0xe39d('0x21')]=_[_0xe39d('0x28')](_0x42f10a[_0xe39d('0x21')]);_0x49a736[_0xe39d('0x29')]=_['intersection'](_0x49a736[_0xe39d('0x27')],_0x49a736[_0xe39d('0x21')]);_0x500c68[_0xe39d('0x2a')]=_[_0xe39d('0x2b')](_0x49a736['model'],qs[_0xe39d('0x2c')](_0x42f10a[_0xe39d('0x21')][_0xe39d('0x2c')]));_0x500c68[_0xe39d('0x2a')]=_0x500c68[_0xe39d('0x2a')][_0xe39d('0x2d')]?_0x500c68[_0xe39d('0x2a')]:_0x49a736[_0xe39d('0x27')];if(_0x42f10a[_0xe39d('0x21')][_0xe39d('0x2e')]){_0x500c68[_0xe39d('0x2f')]=[{'all':!![]}];}_0x500c68=_[_0xe39d('0x30')]({},_0x500c68,_0x42f10a[_0xe39d('0x31')]);return db[_0xe39d('0x1c')][_0xe39d('0x32')](_0x500c68)[_0xe39d('0x16')](handleEntityNotFound(_0x457f5f,null))[_0xe39d('0x16')](respondWithResult(_0x457f5f,null))['catch'](handleError(_0x457f5f,null));};exports['create']=function(_0x42e1ae,_0x364c6e){return db[_0xe39d('0x1c')]['create'](_0x42e1ae[_0xe39d('0x33')],{})[_0xe39d('0x16')](respondWithResult(_0x364c6e,0xc9))['catch'](handleError(_0x364c6e,null));};exports[_0xe39d('0x15')]=function(_0x1b15f0,_0x47dc16){if(_0x1b15f0[_0xe39d('0x33')]['id']){delete _0x1b15f0[_0xe39d('0x33')]['id'];}return db[_0xe39d('0x1c')][_0xe39d('0x32')]({'where':{'id':_0x1b15f0['params']['id']}})[_0xe39d('0x16')](handleEntityNotFound(_0x47dc16,null))[_0xe39d('0x16')](saveUpdates(_0x1b15f0[_0xe39d('0x33')],null))[_0xe39d('0x16')](respondWithResult(_0x47dc16,null))['catch'](handleError(_0x47dc16,null));};exports['destroy']=function(_0x2bc29f,_0xd261ee){return db['OpenchannelInteraction'][_0xe39d('0x32')]({'where':{'id':_0x2bc29f[_0xe39d('0x26')]['id']}})[_0xe39d('0x16')](handleEntityNotFound(_0xd261ee,null))['then'](removeEntity(_0xd261ee,null))[_0xe39d('0x23')](handleError(_0xd261ee,null));};exports[_0xe39d('0x34')]=function(_0x11a12c,_0x314b4b){return db[_0xe39d('0x1c')]['describe']()['then'](respondWithResult(_0x314b4b,null))[_0xe39d('0x23')](handleError(_0x314b4b,null));};exports[_0xe39d('0x35')]=function(_0x31075b,_0x35724f){return db[_0xe39d('0x36')][_0xe39d('0x32')]({'where':{'id':_0x31075b[_0xe39d('0x26')]['id']}})[_0xe39d('0x16')](handleEntityNotFound(_0x35724f,null))[_0xe39d('0x16')](function(_0x26e465){if(_0x26e465){return _0x26e465[_0xe39d('0x35')](_0x31075b[_0xe39d('0x33')][_0xe39d('0x37')],_[_0xe39d('0x38')](_0x31075b[_0xe39d('0x33')],[_0xe39d('0x37'),'id'])||{});}})['then'](respondWithResult(_0x35724f,null))[_0xe39d('0x23')](handleError(_0x35724f,null));};exports[_0xe39d('0x39')]=function(_0x5b290b,_0x2b984a){var _0x4c3126={'raw':![],'where':{}};var _0x4e5134={};var _0xac48c={'count':0x0,'rows':[]};return db[_0xe39d('0x1c')]['findOne']({'where':{'id':_0x5b290b[_0xe39d('0x26')]['id']}})[_0xe39d('0x16')](handleEntityNotFound(_0x2b984a,null))['then'](function(_0x56eada){if(_0x56eada){_0x4e5134['model']=_['keys'](db[_0xe39d('0x36')]['rawAttributes']);_0x4e5134[_0xe39d('0x21')]=_[_0xe39d('0x28')](_0x5b290b[_0xe39d('0x21')]);_0x4e5134['filters']=_[_0xe39d('0x2b')](_0x4e5134[_0xe39d('0x27')],_0x4e5134[_0xe39d('0x21')]);_0x4c3126[_0xe39d('0x2a')]=_[_0xe39d('0x2b')](_0x4e5134['model'],qs[_0xe39d('0x2c')](_0x5b290b[_0xe39d('0x21')]['fields']));_0x4c3126[_0xe39d('0x2a')]=_0x4c3126[_0xe39d('0x2a')][_0xe39d('0x2d')]?_0x4c3126[_0xe39d('0x2a')]:_0x4e5134[_0xe39d('0x27')];if(!_0x5b290b[_0xe39d('0x21')]['hasOwnProperty']('nolimit')){_0x4c3126['limit']=qs[_0xe39d('0x3a')](_0x5b290b[_0xe39d('0x21')]['limit']);_0x4c3126[_0xe39d('0x10')]=qs[_0xe39d('0x10')](_0x5b290b['query'][_0xe39d('0x10')]);}_0x4c3126[_0xe39d('0x3b')]=qs['sort'](_0x5b290b[_0xe39d('0x21')][_0xe39d('0x3c')]);_0x4c3126[_0xe39d('0x3d')]=qs[_0xe39d('0x29')](_['pick'](_0x5b290b[_0xe39d('0x21')],_0x4e5134['filters']));_0x4c3126[_0xe39d('0x3d')]['OpenchannelInteractionId']=_0x56eada['id'];if(_0x5b290b[_0xe39d('0x21')][_0xe39d('0x3e')]){_0x4c3126[_0xe39d('0x3d')]=_[_0xe39d('0x30')](_0x4c3126[_0xe39d('0x3d')],{'$or':_[_0xe39d('0x1b')](_0x4c3126[_0xe39d('0x2a')],function(_0xf99ace){var _0x9225b9={};_0x9225b9[_0xf99ace]={'$like':'%'+_0x5b290b[_0xe39d('0x21')][_0xe39d('0x3e')]+'%'};return _0x9225b9;})});}if(_0x5b290b['query'][_0xe39d('0x3f')]){var _0x1d98fe=_0x5b290b[_0xe39d('0x21')]['$gte']['split'](',');var _0x5b3e0d={};_0x5b3e0d[_0x1d98fe[0x0]]={'$gte':moment(_0x1d98fe[0x1])[_0xe39d('0x40')](_0xe39d('0x41'))};_0x4c3126[_0xe39d('0x3d')]=_[_0xe39d('0x30')](_0x4c3126['where'],_0x5b3e0d);}_0x4c3126=_[_0xe39d('0x30')]({},_0x4c3126,_0x5b290b[_0xe39d('0x31')]);return db[_0xe39d('0x36')]['count']({'where':_0x4c3126['where']})[_0xe39d('0x16')](function(_0x44317a){_0xac48c['count']=_0x44317a;if(_0x5b290b[_0xe39d('0x21')][_0xe39d('0x2e')]){_0x4c3126[_0xe39d('0x2f')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xe39d('0x42')](_0x4c3126);})[_0xe39d('0x16')](function(_0x303bfe){_0xac48c[_0xe39d('0x43')]=_0x303bfe;return _0xac48c;});}})[_0xe39d('0x16')](respondWithFilteredResult(_0x2b984a,_0x4c3126))[_0xe39d('0x23')](handleError(_0x2b984a,null));};exports[_0xe39d('0x44')]=function(_0x289866,_0x382ab7){return db[_0xe39d('0x1c')][_0xe39d('0x32')]({'where':{'id':_0x289866[_0xe39d('0x26')]['id']}})[_0xe39d('0x16')](handleEntityNotFound(_0x382ab7,null))[_0xe39d('0x16')](function(_0x2d5959){if(_0x2d5959){return _0x2d5959[_0xe39d('0x45')](_0x289866[_0xe39d('0x33')][_0xe39d('0x37')],_['omit'](_0x289866[_0xe39d('0x33')],[_0xe39d('0x37'),'id'])||{})[_0xe39d('0x46')](function(){return db[_0xe39d('0x47')][_0xe39d('0x42')]({'attributes':['id','name',_0xe39d('0x48')],'where':{'id':_0x289866[_0xe39d('0x33')][_0xe39d('0x37')]}});})[_0xe39d('0x16')](function(_0x889fc3){socket[_0xe39d('0x49')](_0xe39d('0x4a'),{'id':Number(_0x289866[_0xe39d('0x26')]['id']),'tags':_0x889fc3||[]});return{'id':Number(_0x289866[_0xe39d('0x26')]['id']),'tags':_0x889fc3||[]};});}})['then'](respondWithResult(_0x382ab7,null))[_0xe39d('0x23')](handleError(_0x382ab7,null));};exports[_0xe39d('0x4b')]=function(_0x292228,_0x516170){return db[_0xe39d('0x1c')][_0xe39d('0x32')]({'where':{'id':_0x292228['params']['id']}})[_0xe39d('0x16')](handleEntityNotFound(_0x516170,null))[_0xe39d('0x16')](function(_0x59e446){if(_0x59e446){return _0x59e446[_0xe39d('0x4b')](_0x292228[_0xe39d('0x21')]['ids']);}})[_0xe39d('0x16')](respondWithStatusCode(_0x516170,null))[_0xe39d('0x23')](handleError(_0x516170,null));};exports[_0xe39d('0x4c')]=function(_0xb14cd2,_0x5a25f2){var _0x53055b=moment()[_0xe39d('0x4d')]()[_0xe39d('0x4e')]();var _0x6263f9=path[_0xe39d('0x4f')](config[_0xe39d('0x50')],_0xe39d('0x51'),_0xe39d('0x52'),_0xe39d('0x53'));var _0x5bc87a=path[_0xe39d('0x4f')](config['root'],_0xe39d('0x51'),_0xe39d('0x52'),'attachments');var _0xfab3ad=path[_0xe39d('0x4f')](_0x6263f9,_0x53055b);var _0x40f105=util['format'](_0xe39d('0x54'),_0xb14cd2[_0xe39d('0x26')]['id'],_0x53055b);var _0xa0274=path[_0xe39d('0x4f')](_0x6263f9,_0x40f105);var _0x495d09=[];_0x495d09[_0xe39d('0x55')]({'model':db[_0xe39d('0x56')],'as':_0xe39d('0x56'),'attributes':['id',_0xe39d('0x57')],'raw':!![]});_0x495d09[_0xe39d('0x55')]({'model':db[_0xe39d('0x58')],'as':'Contact','attributes':['id',_0xe39d('0x59'),_0xe39d('0x5a')],'raw':!![]});if(_0xb14cd2[_0xe39d('0x21')][_0xe39d('0x5b')]){_0x495d09[_0xe39d('0x55')]({'model':db[_0xe39d('0x5c')],'as':'Attachment','raw':!![]});}var _0xf4bf34=[{'model':db['OpenchannelMessage'],'as':_0xe39d('0x5d'),'attributes':['id',_0xe39d('0x33'),_0xe39d('0x5e'),_0xe39d('0x5f'),_0xe39d('0x60'),_0xe39d('0x61')],'include':_0x495d09}];_0xf4bf34[_0xe39d('0x55')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0xf4bf34[_0xe39d('0x55')]({'model':db[_0xe39d('0x56')],'as':_0xe39d('0x62'),'attributes':['id',_0xe39d('0x57')]});return db[_0xe39d('0x1c')][_0xe39d('0x32')]({'where':{'id':_0xb14cd2[_0xe39d('0x26')]['id']},'include':_0xf4bf34})[_0xe39d('0x16')](handleEntityNotFound(_0x5a25f2,null))[_0xe39d('0x16')](function(_0x52bc03){if(_0x52bc03){var _0x7d733f=_0x52bc03[_0xe39d('0x63')]({'plain':!![]});fs[_0xe39d('0x64')](_0xfab3ad);var _0x4dc7a3={'channel':_0xe39d('0x65'),'account':_0x7d733f[_0xe39d('0x66')][_0xe39d('0x1a')],'agent':_0x7d733f[_0xe39d('0x62')]?_0x7d733f[_0xe39d('0x62')][_0xe39d('0x57')]:_0xe39d('0x67'),'createdAt':moment(_0x7d733f['createdAt'])[_0xe39d('0x40')](_0xe39d('0x41'))[_0xe39d('0x4e')](),'closedAt':_0x7d733f[_0xe39d('0x68')]?moment(_0x7d733f['closedAt'])[_0xe39d('0x40')](_0xe39d('0x41'))[_0xe39d('0x4e')]():'','disposition':_0x7d733f[_0xe39d('0x69')],'visibility':_0x7d733f[_0xe39d('0x6a')]?_0xe39d('0x6b'):_0xe39d('0x6c'),'messages':_(_0x7d733f[_0xe39d('0x5d')])['filter']({'secret':![]})[_0xe39d('0x1b')](function(_0x2183fc){if(_0x2183fc['Attachment']){var _0x13c322=path[_0xe39d('0x4f')](_0x5bc87a,_0x2183fc['Attachment']['basename']);if(fs[_0xe39d('0x6d')](_0x13c322)){fs['createReadStream'](_0x13c322)[_0xe39d('0x6e')](fs[_0xe39d('0x6f')](path['join'](_0xfab3ad,_0x2183fc['Attachment'][_0xe39d('0x70')])));}}return{'date':moment(_0x2183fc[_0xe39d('0x5e')])[_0xe39d('0x40')](_0xe39d('0x41'))[_0xe39d('0x4e')](),'sender':_0x2183fc[_0xe39d('0x5f')]===_0xe39d('0x71')?_0x2183fc[_0xe39d('0x56')]?_0x2183fc['User']['fullname']:_0xe39d('0x72'):_0x2183fc[_0xe39d('0x73')]['firstName']+(_0x2183fc[_0xe39d('0x73')][_0xe39d('0x5a')]?'\x20'+_0x2183fc[_0xe39d('0x73')][_0xe39d('0x5a')]:''),'body':_0x2183fc[_0xe39d('0x5c')]?_0x2183fc[_0xe39d('0x5c')][_0xe39d('0x70')]:_0x2183fc['body'],'direction':_0x2183fc[_0xe39d('0x5f')]===_0xe39d('0x71')?'A':'C','secret':_0x2183fc[_0xe39d('0x60')],'read':_0x2183fc[_0xe39d('0x61')],'attachment':_0x2183fc['Attachment']};})[_0xe39d('0x74')]()};return ejs[_0xe39d('0x75')](path['join'](config[_0xe39d('0x50')],_0xe39d('0x51'),_0xe39d('0x76'),_0xe39d('0x77')),{'interaction':_0x4dc7a3})[_0xe39d('0x16')](function(_0x58044a){var _0x4adc01=path[_0xe39d('0x4f')](_0xfab3ad,_0xe39d('0x78')+_0x7d733f['id']+'-'+_0x53055b+_0xe39d('0x79'));var _0xadb72={'path':_0x4adc01,'channel':_0xe39d('0x65'),'interactionId':_0x7d733f['id']};return pdf['createPdfFromHTML'](_0x58044a,_0xadb72);})[_0xe39d('0x16')](function(){return new Promise(function(_0xba61f0,_0x3609b5){zipdir(_0xfab3ad,{'saveTo':_0xa0274},function(_0xcda13e,_0x3cf07c){if(_0xcda13e)return _0x3609b5(_0xcda13e);return _0xba61f0(_0x3cf07c);});})[_0xe39d('0x16')](function(){return new Promise(function(_0x102097,_0x491676){rimraf(_0xfab3ad,function(_0x4c4535){if(_0x4c4535)_0x491676(_0x4c4535);return _0x102097();});});})[_0xe39d('0x16')](function(){return _0x5a25f2[_0xe39d('0x4c')](_0xa0274,_0x40f105,function(_0x13eaf5){if(_0x13eaf5){logger[_0xe39d('0x7a')](_0xe39d('0x7b'),_0x13eaf5);}else{fs['unlinkSync'](_0xa0274);}});});});}else{return _0x5a25f2[_0xe39d('0x7c')](0xc8);}})[_0xe39d('0x23')](handleError(_0x5a25f2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 678f3c4..bcb94b4 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 _0x8810=['getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','save','update','remove'];(function(_0x5cf113,_0x13f6f4){var _0x931a22=function(_0x36197b){while(--_0x36197b){_0x5cf113['push'](_0x5cf113['shift']());}};_0x931a22(++_0x13f6f4);}(_0x8810,0x19a));var _0x0881=function(_0x3acfa8,_0x5edc8a){_0x3acfa8=_0x3acfa8-0x0;var _0x51764b=_0x8810[_0x3acfa8];return _0x51764b;};'use strict';var EventEmitter=require(_0x0881('0x0'));var OpenchannelInteraction=require(_0x0881('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x0881('0x1'))['db'][_0x0881('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0881('0x3'),'afterUpdate':_0x0881('0x4'),'afterDestroy':_0x0881('0x5')};function emitEvent(_0x57de66){return function(_0x44cec1,_0x5a029a,_0x2b01c8){_0x44cec1[_0x0881('0x6')]({'attributes':['id'],'raw':!![]})[_0x0881('0x7')](function(_0x19886f){_0x44cec1[_0x0881('0x8')](_0x0881('0x9'),_0x19886f[_0x0881('0xa')](function(_0x3f85ae){return{'id':_0x3f85ae['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x44cec1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0881('0x7')](function(_0x3c3f08){_0x44cec1[_0x0881('0x8')](_0x0881('0xb'),_0x3c3f08[_0x0881('0xc')]);OpenchannelInteractionEvents[_0x0881('0xd')](_0x57de66+':'+_0x44cec1['id'],_0x44cec1);OpenchannelInteractionEvents[_0x0881('0xd')](_0x57de66,_0x44cec1);_0x2b01c8(null);})['catch'](_0x2b01c8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x0881('0xe')](e,emitEvent(event));}}module[_0x0881('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xcc92=['catch','hasOwnProperty','hook','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x482dee,_0x8e5094){var _0x11fdae=function(_0x2e8792){while(--_0x2e8792){_0x482dee['push'](_0x482dee['shift']());}};_0x11fdae(++_0x8e5094);}(_0xcc92,0x1f3));var _0x2cc9=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0xcc92[_0xfb42e6];return _0x27265b;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x2cc9('0x0'))['db'][_0x2cc9('0x1')];var OpenchannelMessage=require(_0x2cc9('0x0'))['db'][_0x2cc9('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2cc9('0x3'),'afterUpdate':_0x2cc9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a3529){return function(_0xae8b6c,_0x49bd20,_0x212343){_0xae8b6c['getUsers']({'attributes':['id'],'raw':!![]})[_0x2cc9('0x5')](function(_0xcd916f){_0xae8b6c[_0x2cc9('0x6')](_0x2cc9('0x7'),_0xcd916f[_0x2cc9('0x8')](function(_0x33e4fa){return{'id':_0x33e4fa['id']};}));return OpenchannelMessage[_0x2cc9('0x9')]({'where':{'OpenchannelInteractionId':_0xae8b6c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2cc9('0x5')](function(_0x1ccd53){_0xae8b6c['setDataValue'](_0x2cc9('0xa'),_0x1ccd53[_0x2cc9('0xb')]);OpenchannelInteractionEvents[_0x2cc9('0xc')](_0x2a3529+':'+_0xae8b6c['id'],_0xae8b6c);OpenchannelInteractionEvents[_0x2cc9('0xc')](_0x2a3529,_0xae8b6c);_0x212343(null);})[_0x2cc9('0xd')](_0x212343(null));};}for(var e in events){if(events[_0x2cc9('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x2cc9('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f1e6531..a1476f8 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 _0xc9e0=['moment','bluebird','request-promise','path','../../config/environment','exports','define','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','lodash','../../config/logger'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xc9e0,0x193));var _0x0c9e=function(_0x593952,_0x2b1e56){_0x593952=_0x593952-0x0;var _0x1947d1=_0xc9e0[_0x593952];return _0x1947d1;};'use strict';var _=require(_0x0c9e('0x0'));var util=require('util');var logger=require(_0x0c9e('0x1'))('api');var moment=require(_0x0c9e('0x2'));var BPromise=require(_0x0c9e('0x3'));var rp=require(_0x0c9e('0x4'));var fs=require('fs');var path=require(_0x0c9e('0x5'));var rimraf=require('rimraf');var config=require(_0x0c9e('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x0c9e('0x7')]=function(_0x36d068,_0x525a22){return _0x36d068[_0x0c9e('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0x0c9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0c9e('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x27e831,_0x212401,_0x405b3c){if(_0x27e831[_0x0c9e('0xb')](_0x0c9e('0xc'))){_0x27e831[_0x0c9e('0xd')]=moment()[_0x0c9e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x405b3c(null,_0x27e831);}}});}; \ No newline at end of file +var _0x8bf4=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','openchannel_interactions','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0xd3f548,_0x1ba19c){var _0x1743a9=function(_0x362012){while(--_0x362012){_0xd3f548['push'](_0xd3f548['shift']());}};_0x1743a9(++_0x1ba19c);}(_0x8bf4,0x185));var _0x48bf=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0x8bf4[_0x38ce4c];return _0x5d4544;};'use strict';var _=require(_0x48bf('0x0'));var util=require(_0x48bf('0x1'));var logger=require(_0x48bf('0x2'))(_0x48bf('0x3'));var moment=require(_0x48bf('0x4'));var BPromise=require(_0x48bf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48bf('0x6'));var rimraf=require('rimraf');var config=require(_0x48bf('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x48bf('0x8')]=function(_0x3d9d3c,_0x4a6970){return _0x3d9d3c['define']('OpenchannelInteraction',attributes,{'tableName':_0x48bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x48bf('0xa'),'hooks':{'beforeUpdate':function(_0x3197a7,_0x41893d,_0x68420b){if(_0x3197a7[_0x48bf('0xb')]('closed')){_0x3197a7[_0x48bf('0xc')]=moment()[_0x48bf('0xd')](_0x48bf('0xe'));}_0x68420b(null,_0x3197a7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 5622624..97c00c3 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 _0x00c2=['debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','then','AddTagsToOpenchannelInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0x20e8c3,_0x1b5794){var _0x31d221=function(_0x5a3f15){while(--_0x5a3f15){_0x20e8c3['push'](_0x20e8c3['shift']());}};_0x31d221(++_0x1b5794);}(_0x00c2,0x9f));var _0x200c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x00c2[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x200c('0x0'));var util=require(_0x200c('0x1'));var moment=require(_0x200c('0x2'));var BPromise=require(_0x200c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x200c('0x4'));var db=require(_0x200c('0x5'))['db'];var utils=require(_0x200c('0x6'));var logger=require('../../config/logger')(_0x200c('0x7'));var config=require(_0x200c('0x8'));var jayson=require(_0x200c('0x9'));var client=jayson[_0x200c('0xa')][_0x200c('0xb')]({'port':0x232a});config[_0x200c('0xc')]=_[_0x200c('0xd')](config[_0x200c('0xc')],{'host':_0x200c('0xe'),'port':0x18eb});var socket=require(_0x200c('0xf'))(new Redis(config[_0x200c('0xc')]));require(_0x200c('0x10'))[_0x200c('0x11')](socket);function respondWithRpcPromise(_0x529fd8,_0x3fd537,_0x541b97){return new BPromise(function(_0xcd5b2c,_0x259131){return client[_0x200c('0x12')](_0x529fd8,_0x541b97)['then'](function(_0x220216){logger[_0x200c('0x13')](_0x200c('0x14'),_0x3fd537,'request\x20sent');logger[_0x200c('0x15')](_0x200c('0x16'),_0x3fd537,_0x200c('0x17'),JSON[_0x200c('0x18')](_0x220216));if(_0x220216['error']){if(_0x220216[_0x200c('0x19')][_0x200c('0x1a')]===0x1f4){logger[_0x200c('0x19')](_0x200c('0x14'),_0x3fd537,_0x220216[_0x200c('0x19')][_0x200c('0x1b')]);return _0x259131(_0x220216[_0x200c('0x19')][_0x200c('0x1b')]);}logger[_0x200c('0x19')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3fd537,_0x220216[_0x200c('0x19')][_0x200c('0x1b')]);return _0xcd5b2c(_0x220216[_0x200c('0x19')][_0x200c('0x1b')]);}else{logger[_0x200c('0x13')](_0x200c('0x14'),_0x3fd537,_0x200c('0x17'));_0xcd5b2c(_0x220216[_0x200c('0x1c')][_0x200c('0x1b')]);}})[_0x200c('0x1d')](function(_0xc6053c){logger[_0x200c('0x19')](_0x200c('0x14'),_0x3fd537,_0xc6053c);_0x259131(_0xc6053c);});});}exports[_0x200c('0x1e')]=function(_0x34439b){var _0x35ac25=this;return new Promise(function(_0x1d86f5,_0x5452a4){return db[_0x200c('0x1f')][_0x200c('0x20')](_0x34439b[_0x200c('0x21')],{'raw':_0x34439b[_0x200c('0x22')]?_0x34439b['options'][_0x200c('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34439b[_0x200c('0x22')]?_0x34439b['options'][_0x200c('0x24')]||null:null,'attributes':_0x34439b['options']?_0x34439b[_0x200c('0x22')][_0x200c('0x25')]||null:null,'limit':_0x34439b[_0x200c('0x22')]?_0x34439b[_0x200c('0x22')]['limit']||null:null})[_0x200c('0x26')](function(_0x5cf4c1){logger[_0x200c('0x13')](_0x200c('0x1e'),_0x34439b);logger[_0x200c('0x15')](_0x200c('0x1e'),_0x34439b,JSON['stringify'](_0x5cf4c1));_0x1d86f5(_0x5cf4c1);})[_0x200c('0x1d')](function(_0x4cbc50){logger[_0x200c('0x19')]('UpdateOpenchannelInteraction',_0x4cbc50[_0x200c('0x1b')],_0x34439b);_0x5452a4(_0x35ac25[_0x200c('0x19')](0x1f4,_0x4cbc50[_0x200c('0x1b')]));});});};exports[_0x200c('0x27')]=function(_0x1420e2){return new Promise(function(_0x3363a9,_0x4b9165){return db['OpenchannelInteraction']['find']({'where':_0x1420e2[_0x200c('0x22')]?_0x1420e2[_0x200c('0x22')]['where']||null:null})[_0x200c('0x26')](function(_0xa8f94c){if(_0xa8f94c){return _0xa8f94c[_0x200c('0x28')](_0x1420e2[_0x200c('0x21')]['ids'],_[_0x200c('0x29')](_0x1420e2[_0x200c('0x21')],[_0x200c('0x2a'),'id'])||{});}})[_0x200c('0x2b')](function(_0x224b94){logger['info'](_0x200c('0x2c'),_0x1420e2);logger['debug']('AddTags',_0x1420e2,JSON[_0x200c('0x18')](_0x224b94));_0x3363a9(_0x224b94);})[_0x200c('0x1d')](function(_0x169395){logger[_0x200c('0x19')](_0x200c('0x2c'),_0x169395['message'],_0x1420e2);_0x4b9165(_this[_0x200c('0x19')](0x1f4,_0x169395[_0x200c('0x1b')]));});});}; \ No newline at end of file +var _0x8bee=['redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','addTags','body','ids','omit','spread','AddTags','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1ac41c,_0x1dacbf){var _0x561d64=function(_0x2654df){while(--_0x2654df){_0x1ac41c['push'](_0x1ac41c['shift']());}};_0x561d64(++_0x1dacbf);}(_0x8bee,0xec));var _0xe8be=function(_0x558e88,_0x44bdf7){_0x558e88=_0x558e88-0x0;var _0x3a778b=_0x8bee[_0x558e88];return _0x3a778b;};'use strict';var _=require('lodash');var util=require(_0xe8be('0x0'));var moment=require(_0xe8be('0x1'));var BPromise=require(_0xe8be('0x2'));var rs=require(_0xe8be('0x3'));var fs=require('fs');var Redis=require(_0xe8be('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8be('0x5'));var logger=require(_0xe8be('0x6'))(_0xe8be('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8be('0x8'));var client=jayson[_0xe8be('0x9')]['http']({'port':0x232a});config[_0xe8be('0xa')]=_[_0xe8be('0xb')](config[_0xe8be('0xa')],{'host':_0xe8be('0xc'),'port':0x18eb});var socket=require(_0xe8be('0xd'))(new Redis(config[_0xe8be('0xa')]));require(_0xe8be('0xe'))[_0xe8be('0xf')](socket);function respondWithRpcPromise(_0x15b607,_0x129a3d,_0x4a3551){return new BPromise(function(_0x1afee8,_0x4bbbd5){return client[_0xe8be('0x10')](_0x15b607,_0x4a3551)[_0xe8be('0x11')](function(_0x5b2fda){logger[_0xe8be('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x129a3d,_0xe8be('0x13'));logger[_0xe8be('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x129a3d,_0xe8be('0x13'),JSON['stringify'](_0x5b2fda));if(_0x5b2fda['error']){if(_0x5b2fda[_0xe8be('0x15')][_0xe8be('0x16')]===0x1f4){logger[_0xe8be('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x129a3d,_0x5b2fda['error'][_0xe8be('0x17')]);return _0x4bbbd5(_0x5b2fda['error'][_0xe8be('0x17')]);}logger[_0xe8be('0x15')](_0xe8be('0x18'),_0x129a3d,_0x5b2fda[_0xe8be('0x15')][_0xe8be('0x17')]);return _0x1afee8(_0x5b2fda[_0xe8be('0x15')][_0xe8be('0x17')]);}else{logger[_0xe8be('0x12')](_0xe8be('0x18'),_0x129a3d,_0xe8be('0x13'));_0x1afee8(_0x5b2fda[_0xe8be('0x19')][_0xe8be('0x17')]);}})[_0xe8be('0x1a')](function(_0x40fafe){logger[_0xe8be('0x15')](_0xe8be('0x18'),_0x129a3d,_0x40fafe);_0x4bbbd5(_0x40fafe);});});}exports[_0xe8be('0x1b')]=function(_0xd6122b){var _0xf8db30=this;return new Promise(function(_0x484215,_0x2574e8){return db[_0xe8be('0x1c')][_0xe8be('0x1d')](_0xd6122b['body'],{'raw':_0xd6122b[_0xe8be('0x1e')]?_0xd6122b[_0xe8be('0x1e')][_0xe8be('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd6122b[_0xe8be('0x1e')]?_0xd6122b[_0xe8be('0x1e')][_0xe8be('0x20')]||null:null,'attributes':_0xd6122b[_0xe8be('0x1e')]?_0xd6122b['options'][_0xe8be('0x21')]||null:null,'limit':_0xd6122b['options']?_0xd6122b['options']['limit']||null:null})[_0xe8be('0x11')](function(_0xb4d4cb){logger[_0xe8be('0x12')](_0xe8be('0x1b'),_0xd6122b);logger['debug'](_0xe8be('0x1b'),_0xd6122b,JSON['stringify'](_0xb4d4cb));_0x484215(_0xb4d4cb);})['catch'](function(_0x3a6297){logger[_0xe8be('0x15')](_0xe8be('0x1b'),_0x3a6297['message'],_0xd6122b);_0x2574e8(_0xf8db30['error'](0x1f4,_0x3a6297['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x33dbb8){return new Promise(function(_0x1854ce,_0x114b14){return db[_0xe8be('0x1c')]['find']({'where':_0x33dbb8['options']?_0x33dbb8[_0xe8be('0x1e')][_0xe8be('0x20')]||null:null})[_0xe8be('0x11')](function(_0x21d382){if(_0x21d382){return _0x21d382[_0xe8be('0x22')](_0x33dbb8[_0xe8be('0x23')][_0xe8be('0x24')],_[_0xe8be('0x25')](_0x33dbb8['body'],['ids','id'])||{});}})[_0xe8be('0x26')](function(_0x151810){logger['info'](_0xe8be('0x27'),_0x33dbb8);logger[_0xe8be('0x14')](_0xe8be('0x27'),_0x33dbb8,JSON[_0xe8be('0x28')](_0x151810));_0x1854ce(_0x151810);})[_0xe8be('0x1a')](function(_0x2dd385){logger[_0xe8be('0x15')](_0xe8be('0x27'),_0x2dd385[_0xe8be('0x17')],_0x33dbb8);_0x114b14(_this[_0xe8be('0x15')](0x1f4,_0x2dd385[_0xe8be('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 070d21b..ed98c96 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 _0x0fd0=['update','emit','removeListener','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x20f688,_0x2f9afb){var _0x50da69=function(_0x252094){while(--_0x252094){_0x20f688['push'](_0x20f688['shift']());}};_0x50da69(++_0x2f9afb);}(_0x0fd0,0xf9));var _0x00fd=function(_0xd3f313,_0x46f240){_0xd3f313=_0xd3f313-0x0;var _0x4420e8=_0x0fd0[_0xd3f313];return _0x4420e8;};'use strict';var OpenchannelInteractionEvents=require(_0x00fd('0x0'));var events=['save','remove',_0x00fd('0x1')];function createListener(_0x3023d3,_0x5c084e){return function(_0x114eac){_0x5c084e[_0x00fd('0x2')](_0x3023d3,_0x114eac);};}function removeListener(_0x390af1,_0x3191d9){return function(){OpenchannelInteractionEvents[_0x00fd('0x3')](_0x390af1,_0x3191d9);};}exports['register']=function(_0x1d481e){for(var _0x54a291=0x0,_0x38aeb=events['length'];_0x54a291<_0x38aeb;_0x54a291++){var _0x249ec9=events[_0x54a291];var _0x2809be=createListener(_0x00fd('0x4')+_0x249ec9,_0x1d481e);OpenchannelInteractionEvents['on'](_0x249ec9,_0x2809be);}}; \ No newline at end of file +var _0xde2a=['emit','removeListener','register','openchannelInteraction:','save','remove'];(function(_0x498ce7,_0x5d1664){var _0x5008ca=function(_0x217a0e){while(--_0x217a0e){_0x498ce7['push'](_0x498ce7['shift']());}};_0x5008ca(++_0x5d1664);}(_0xde2a,0x142));var _0xade2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xde2a[_0x1b4b23];return _0x2a325b;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xade2('0x0'),_0xade2('0x1'),'update'];function createListener(_0x2aef43,_0x2a94c6){return function(_0x3838b0){_0x2a94c6[_0xade2('0x2')](_0x2aef43,_0x3838b0);};}function removeListener(_0x5982a8,_0x42f534){return function(){OpenchannelInteractionEvents[_0xade2('0x3')](_0x5982a8,_0x42f534);};}exports[_0xade2('0x4')]=function(_0x3cbf46){for(var _0x21ebad=0x0,_0x20c70a=events['length'];_0x21ebad<_0x20c70a;_0x21ebad++){var _0x413be9=events[_0x21ebad];var _0x36397c=createListener(_0xade2('0x5')+_0x413be9,_0x3cbf46);OpenchannelInteractionEvents['on'](_0x413be9,_0x36397c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8f1d5fc..9f91f22 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x4a4b45,_0x16bc77){var _0x3d9e27=function(_0x4ae4f8){while(--_0x4ae4f8){_0x4a4b45['push'](_0x4a4b45['shift']());}};_0x3d9e27(++_0x16bc77);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0xcb91[_0x50d84b];return _0x6d4270;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x1908bd,_0x44456f){var _0x2d7833=function(_0x1bd7d3){while(--_0x1bd7d3){_0x1908bd['push'](_0x1908bd['shift']());}};_0x2d7833(++_0x44456f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index f318d63..b45627c 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 _0x80cd=['BOOLEAN','ENUM','out','STRING','exports','TEXT','medium'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x80cd,0x146));var _0xd80c=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x80cd[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'body':{'type':Sequelize[_0xd80c('0x1')](_0xd80c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd80c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd80c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd80c('0x4')]('in',_0xd80c('0x5')),'defaultValue':_0xd80c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd80c('0x6')]},'providerResponse':{'type':Sequelize[_0xd80c('0x1')]}}; \ No newline at end of file +var _0x4e81=['out','DATE','STRING','sequelize','exports','TEXT','ENUM'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x4e81,0x1bc));var _0x14e8=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0x4e81[_0x495b3d];return _0x4cb329;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'body':{'type':Sequelize[_0x14e8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x14e8('0x3')]('in',_0x14e8('0x4')),'defaultValue':_0x14e8('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x14e8('0x5')]},'providerName':{'type':Sequelize[_0x14e8('0x6')]},'providerResponse':{'type':Sequelize[_0x14e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7d266cb..e504aff 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 _0x4c00=['OpenchannelMessage,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','status','end','json','undefined','count','offset','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','OpenchannelMessage','includeAll','include','rows','params','create','body','find','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','email','manual','interface','channel','event','EventManager','openchannel-interactions','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT','User','internal','motionChannel','reject','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','client','http','request','then'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x4c00,0x1c2));var _0x04c0=function(_0x14790f,_0x432b5f){_0x14790f=_0x14790f-0x0;var _0x5acc1f=_0x4c00[_0x14790f];return _0x5acc1f;};'use strict';var emlformat=require(_0x04c0('0x0'));var rimraf=require(_0x04c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04c0('0x2'));var rp=require(_0x04c0('0x3'));var moment=require('moment');var BPromise=require(_0x04c0('0x4'));var Mustache=require(_0x04c0('0x5'));var util=require(_0x04c0('0x6'));var path=require(_0x04c0('0x7'));var sox=require(_0x04c0('0x8'));var csv=require(_0x04c0('0x9'));var ejs=require(_0x04c0('0xa'));var fs=require('fs');var fs_extra=require(_0x04c0('0xb'));var _=require(_0x04c0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x04c0('0xd'));var deskjs=require(_0x04c0('0xe'));var toCsv=require(_0x04c0('0x9'));var querystring=require(_0x04c0('0xf'));var Papa=require(_0x04c0('0x10'));var Redis=require(_0x04c0('0x11'));var authService=require(_0x04c0('0x12'));var qs=require(_0x04c0('0x13'));var as=require(_0x04c0('0x14'));var hardwareService=require(_0x04c0('0x15'));var logger=require(_0x04c0('0x16'))('api');var utils=require(_0x04c0('0x17'));var config=require(_0x04c0('0x18'));var licenseUtil=require(_0x04c0('0x19'));var db=require(_0x04c0('0x1a'))['db'];config[_0x04c0('0x1b')]=_[_0x04c0('0x1c')](config[_0x04c0('0x1b')],{'host':_0x04c0('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04c0('0x1b')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x04c0('0x1e')][_0x04c0('0x1f')]({'port':0x232c});var client9002=jayson[_0x04c0('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9759d2,_0x4deecd,_0x3a1af2,_0x57ddea){return new BPromise(function(_0x43c34c,_0x5bd816){var _0x59763c=_0x57ddea||client;return _0x59763c[_0x04c0('0x20')](_0x9759d2,_0x3a1af2)[_0x04c0('0x21')](function(_0x336669){logger['info'](_0x04c0('0x22'),_0x4deecd,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4deecd,'request\x20sent',JSON[_0x04c0('0x23')](_0x336669));if(_0x336669[_0x04c0('0x24')]){if(_0x336669[_0x04c0('0x24')]['code']===0x1f4){logger[_0x04c0('0x24')](_0x04c0('0x22'),_0x4deecd,_0x336669['error'][_0x04c0('0x25')]);return _0x5bd816(_0x336669[_0x04c0('0x24')][_0x04c0('0x25')]);}logger[_0x04c0('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4deecd,_0x336669['error'][_0x04c0('0x25')]);return _0x43c34c(_0x336669[_0x04c0('0x24')][_0x04c0('0x25')]);}else{logger[_0x04c0('0x26')](_0x04c0('0x22'),_0x4deecd,_0x04c0('0x27'));_0x43c34c(_0x336669['result'][_0x04c0('0x25')]);}})[_0x04c0('0x28')](function(_0x5ac449){logger[_0x04c0('0x24')](_0x04c0('0x22'),_0x4deecd,_0x5ac449);_0x5bd816(_0x5ac449);});});}function respondWithStatusCode(_0x83298b,_0x52ecaa){_0x52ecaa=_0x52ecaa||0xcc;return function(_0x32dca8){if(_0x32dca8){return _0x83298b['sendStatus'](_0x52ecaa);}return _0x83298b[_0x04c0('0x29')](_0x52ecaa)[_0x04c0('0x2a')]();};}function respondWithResult(_0x31299e,_0x3cc934){_0x3cc934=_0x3cc934||0xc8;return function(_0x2199c1){if(_0x2199c1){return _0x31299e[_0x04c0('0x29')](_0x3cc934)[_0x04c0('0x2b')](_0x2199c1);}};}function respondWithFilteredResult(_0x43324d,_0x36ca7e){return function(_0x44085a){if(_0x44085a){var _0x3ef710=typeof _0x36ca7e['offset']==='undefined'&&typeof _0x36ca7e['limit']===_0x04c0('0x2c');var _0x37a901=_0x44085a[_0x04c0('0x2d')];var _0x3b1381=_0x3ef710?0x0:_0x36ca7e[_0x04c0('0x2e')];var _0x23a88b=_0x3ef710?_0x44085a[_0x04c0('0x2d')]:_0x36ca7e[_0x04c0('0x2e')]+_0x36ca7e['limit'];var _0x5b985b;if(_0x23a88b>=_0x37a901){_0x23a88b=_0x37a901;_0x5b985b=0xc8;}else{_0x5b985b=0xce;}_0x43324d[_0x04c0('0x29')](_0x5b985b);return _0x43324d['set']('Content-Range',_0x3b1381+'-'+_0x23a88b+'/'+_0x37a901)['json'](_0x44085a);}return null;};}function patchUpdates(_0xa93f87){return function(_0x5c4261){try{jsonpatch['apply'](_0x5c4261,_0xa93f87,!![]);}catch(_0xe509af){return BPromise['reject'](_0xe509af);}return _0x5c4261[_0x04c0('0x2f')]();};}function saveUpdates(_0x244274,_0xc9dbf0){return function(_0x5a43dd){if(_0x5a43dd){return _0x5a43dd[_0x04c0('0x30')](_0x244274)[_0x04c0('0x21')](function(_0x2203eb){return _0x2203eb;});}return null;};}function removeEntity(_0x1fe468,_0x5ca09b){return function(_0x125cad){if(_0x125cad){return _0x125cad[_0x04c0('0x31')]()[_0x04c0('0x21')](function(){_0x1fe468[_0x04c0('0x29')](0xcc)[_0x04c0('0x2a')]();});}};}function handleEntityNotFound(_0x18bfe7,_0x19916d){return function(_0x297632){if(!_0x297632){_0x18bfe7[_0x04c0('0x32')](0x194);}return _0x297632;};}function handleError(_0x1d7553,_0x95904e){_0x95904e=_0x95904e||0x1f4;return function(_0x19e388){logger[_0x04c0('0x24')](_0x19e388['stack']);if(_0x19e388[_0x04c0('0x33')]){delete _0x19e388['name'];}_0x1d7553[_0x04c0('0x29')](_0x95904e)[_0x04c0('0x34')](_0x19e388);};}exports[_0x04c0('0x35')]=function(_0x5dc3d5,_0x530583){var _0x1c8a0d={},_0x1af25b={},_0x9d1c8b={'count':0x0,'rows':[]};var _0x189db7=_[_0x04c0('0x36')](db['OpenchannelMessage'][_0x04c0('0x37')],function(_0x4e39dc){return{'name':_0x4e39dc[_0x04c0('0x38')],'type':_0x4e39dc[_0x04c0('0x39')][_0x04c0('0x3a')]};});_0x1af25b[_0x04c0('0x3b')]=_[_0x04c0('0x36')](_0x189db7,_0x04c0('0x33'));_0x1af25b[_0x04c0('0x3c')]=_[_0x04c0('0x3d')](_0x5dc3d5[_0x04c0('0x3c')]);_0x1af25b[_0x04c0('0x3e')]=_[_0x04c0('0x3f')](_0x1af25b['model'],_0x1af25b['query']);_0x1c8a0d['attributes']=_[_0x04c0('0x3f')](_0x1af25b[_0x04c0('0x3b')],qs[_0x04c0('0x40')](_0x5dc3d5[_0x04c0('0x3c')][_0x04c0('0x40')]));_0x1c8a0d[_0x04c0('0x41')]=_0x1c8a0d[_0x04c0('0x41')]['length']?_0x1c8a0d[_0x04c0('0x41')]:_0x1af25b[_0x04c0('0x3b')];if(!_0x5dc3d5[_0x04c0('0x3c')][_0x04c0('0x42')](_0x04c0('0x43'))){_0x1c8a0d[_0x04c0('0x44')]=qs['limit'](_0x5dc3d5['query'][_0x04c0('0x44')]);_0x1c8a0d[_0x04c0('0x2e')]=qs[_0x04c0('0x2e')](_0x5dc3d5[_0x04c0('0x3c')][_0x04c0('0x2e')]);}_0x1c8a0d['order']=qs[_0x04c0('0x45')](_0x5dc3d5['query'][_0x04c0('0x45')]);_0x1c8a0d[_0x04c0('0x46')]=qs[_0x04c0('0x3e')](_['pick'](_0x5dc3d5[_0x04c0('0x3c')],_0x1af25b['filters']),_0x189db7);if(_0x5dc3d5[_0x04c0('0x3c')][_0x04c0('0x47')]){_0x1c8a0d[_0x04c0('0x46')]=_['merge'](_0x1c8a0d[_0x04c0('0x46')],{'$or':_[_0x04c0('0x36')](_0x189db7,function(_0x2bd92f){if(_0x2bd92f[_0x04c0('0x39')]!==_0x04c0('0x48')){var _0x168181={};_0x168181[_0x2bd92f['name']]={'$like':'%'+_0x5dc3d5[_0x04c0('0x3c')]['filter']+'%'};return _0x168181;}})});}_0x1c8a0d=_[_0x04c0('0x49')]({},_0x1c8a0d,_0x5dc3d5[_0x04c0('0x4a')]);var _0x469c12={'where':_0x1c8a0d[_0x04c0('0x46')]};return db[_0x04c0('0x4b')][_0x04c0('0x2d')](_0x469c12)[_0x04c0('0x21')](function(_0x5a4836){_0x9d1c8b[_0x04c0('0x2d')]=_0x5a4836;if(_0x5dc3d5['query'][_0x04c0('0x4c')]){_0x1c8a0d[_0x04c0('0x4d')]=[{'all':!![]}];}return db[_0x04c0('0x4b')]['findAll'](_0x1c8a0d);})['then'](function(_0x131565){_0x9d1c8b[_0x04c0('0x4e')]=_0x131565;return _0x9d1c8b;})[_0x04c0('0x21')](respondWithFilteredResult(_0x530583,_0x1c8a0d))[_0x04c0('0x28')](handleError(_0x530583,null));};exports['show']=function(_0x1c5371,_0x3a6f4f){var _0x523d05={'raw':!![],'where':{'id':_0x1c5371[_0x04c0('0x4f')]['id']}},_0x219956={};_0x219956[_0x04c0('0x3b')]=_['keys'](db[_0x04c0('0x4b')]['rawAttributes']);_0x219956['query']=_[_0x04c0('0x3d')](_0x1c5371[_0x04c0('0x3c')]);_0x219956['filters']=_[_0x04c0('0x3f')](_0x219956[_0x04c0('0x3b')],_0x219956[_0x04c0('0x3c')]);_0x523d05[_0x04c0('0x41')]=_[_0x04c0('0x3f')](_0x219956[_0x04c0('0x3b')],qs[_0x04c0('0x40')](_0x1c5371['query']['fields']));_0x523d05['attributes']=_0x523d05['attributes']['length']?_0x523d05[_0x04c0('0x41')]:_0x219956['model'];if(_0x1c5371[_0x04c0('0x3c')][_0x04c0('0x4c')]){_0x523d05[_0x04c0('0x4d')]=[{'all':!![]}];}_0x523d05=_[_0x04c0('0x49')]({},_0x523d05,_0x1c5371[_0x04c0('0x4a')]);return db['OpenchannelMessage']['find'](_0x523d05)[_0x04c0('0x21')](handleEntityNotFound(_0x3a6f4f,null))[_0x04c0('0x21')](respondWithResult(_0x3a6f4f,null))[_0x04c0('0x28')](handleError(_0x3a6f4f,null));};exports[_0x04c0('0x50')]=function(_0x3a59ba,_0x396cb6){return db[_0x04c0('0x4b')][_0x04c0('0x50')](_0x3a59ba['body'],{})[_0x04c0('0x21')](respondWithResult(_0x396cb6,0xc9))[_0x04c0('0x28')](handleError(_0x396cb6,null));};exports[_0x04c0('0x30')]=function(_0x4d65d0,_0x2d3ddb){if(_0x4d65d0[_0x04c0('0x51')]['id']){delete _0x4d65d0[_0x04c0('0x51')]['id'];}return db[_0x04c0('0x4b')][_0x04c0('0x52')]({'where':{'id':_0x4d65d0['params']['id']}})[_0x04c0('0x21')](handleEntityNotFound(_0x2d3ddb,null))[_0x04c0('0x21')](saveUpdates(_0x4d65d0[_0x04c0('0x51')],null))[_0x04c0('0x21')](respondWithResult(_0x2d3ddb,null))['catch'](handleError(_0x2d3ddb,null));};exports[_0x04c0('0x31')]=function(_0x8adbc0,_0x5e4694){return db[_0x04c0('0x4b')][_0x04c0('0x52')]({'where':{'id':_0x8adbc0['params']['id']}})[_0x04c0('0x21')](handleEntityNotFound(_0x5e4694,null))['then'](removeEntity(_0x5e4694,null))[_0x04c0('0x28')](handleError(_0x5e4694,null));};exports[_0x04c0('0x53')]=function(_0x2566ff,_0x4c2e46){return db[_0x04c0('0x4b')][_0x04c0('0x53')]()[_0x04c0('0x21')](respondWithResult(_0x4c2e46,null))[_0x04c0('0x28')](handleError(_0x4c2e46,null));};var interaction_log=require(_0x04c0('0x16'))('openchannel-interactions');exports[_0x04c0('0x54')]=function(_0x311e20,_0x1e487a,_0x3d1f70){var _0x4b7249={'agent':{},'channel':'openchannel'};if(_0x311e20['body']['id']){delete _0x311e20[_0x04c0('0x51')]['id'];}_0x311e20[_0x04c0('0x51')][_0x04c0('0x55')]=!![];_0x311e20[_0x04c0('0x51')][_0x04c0('0x56')]=moment()[_0x04c0('0x57')](_0x04c0('0x58'));_0x311e20[_0x04c0('0x51')][_0x04c0('0x59')]=_0x311e20['body'][_0x04c0('0x59')]||_0x311e20[_0x04c0('0x5a')]['id'];_0x4b7249[_0x04c0('0x5b')]['id']=_0x311e20[_0x04c0('0x51')][_0x04c0('0x59')];return db[_0x04c0('0x4b')]['find']({'where':{'id':_0x311e20[_0x04c0('0x4f')]['id'],'UserId':null}})[_0x04c0('0x21')](handleEntityNotFound(_0x1e487a,null))[_0x04c0('0x21')](saveUpdates(_0x311e20[_0x04c0('0x51')],null))[_0x04c0('0x21')](function(_0x1b9992){if(_0x1b9992){_0x4b7249[_0x04c0('0x25')]=_0x1b9992[_0x04c0('0x5c')]({'plain':!![]});return db[_0x04c0('0x5d')]['find']({'where':{'id':_0x1b9992['OpenchannelInteractionId']}});}return null;})[_0x04c0('0x21')](handleEntityNotFound(_0x1e487a,null))[_0x04c0('0x21')](function(_0x388f44){if(_0x388f44){return _0x388f44[_0x04c0('0x30')]({'UserId':_0x311e20[_0x04c0('0x51')][_0x04c0('0x59')],'read1stAt':_['isNil'](_0x388f44[_0x04c0('0x5e')])?moment()[_0x04c0('0x57')](_0x04c0('0x58')):undefined});}return null;})[_0x04c0('0x21')](function(_0x593831){if(_0x593831){_0x4b7249['interaction']=_0x593831[_0x04c0('0x5c')]({'plain':!![]});interaction_log[_0x04c0('0x26')](_0x04c0('0x5f'),_0x311e20[_0x04c0('0x5a')]['id'],_0x311e20[_0x04c0('0x5a')]['name'],_0x311e20[_0x04c0('0x5a')]['role'],_0x4b7249[_0x04c0('0x60')]['id'],_0x311e20['body']?JSON['stringify'](_0x311e20[_0x04c0('0x51')]):_0x04c0('0x61'));return respondWithRpcPromise('AcceptMessage',_0x04c0('0x62'),_0x4b7249);}return null;})['then'](function(_0x38767a){var _0x28c30c=_0x04c0('0x63')+_0x38767a[_0x04c0('0x25')][_0x04c0('0x64')];return db[_0x04c0('0x65')]['query'](_0x28c30c,{'type':db[_0x04c0('0x66')][_0x04c0('0x67')]['SELECT'],'raw':!![]})[_0x04c0('0x21')](function(_0x3dd842){return _0x3dd842;});})[_0x04c0('0x21')](function(_0x3b13bb){if(_0x3b13bb){_0x4b7249[_0x04c0('0x25')][_0x04c0('0x68')]=_0x3b13bb[0x0];if(!_0x311e20[_0x04c0('0x51')]['UserId'])return;return db['User'][_0x04c0('0x52')]({'where':{'id':_0x311e20[_0x04c0('0x51')][_0x04c0('0x59')],'role':_0x04c0('0x5b')},'attributes':['id',_0x04c0('0x33'),'fullname',_0x04c0('0x69'),'internal'],'raw':!![]});}return null;})[_0x04c0('0x21')](function(_0x523ce6){if(!_0x523ce6)return null;_0x4b7249[_0x04c0('0x25')][_0x04c0('0x5b')]=_0x523ce6;return _0x4b7249;})[_0x04c0('0x21')](function(_0x2daeaa){if(_0x2daeaa){if(_0x311e20['body'][_0x04c0('0x6a')]){_0x4b7249[_0x04c0('0x25')][_0x04c0('0x6b')]=util[_0x04c0('0x57')]('SIP/%s',_0x311e20['user']['name']);_0x4b7249[_0x04c0('0x25')][_0x04c0('0x6c')]=_0x4b7249[_0x04c0('0x6c')];_0x4b7249[_0x04c0('0x25')]['motionChannel']=_0x4b7249[_0x04c0('0x6c')];_0x4b7249[_0x04c0('0x25')][_0x04c0('0x6d')]='accept';return respondWithRpcPromise(_0x04c0('0x6e'),_0x04c0('0x6e'),{'event':'acceptmessage','message':_0x4b7249[_0x04c0('0x25')]},client9002)[_0x04c0('0x21')](function(){return _0x4b7249;});}return _0x4b7249;}return null;})[_0x04c0('0x21')](respondWithResult(_0x1e487a,null))['catch'](handleError(_0x1e487a,null));};var interaction_log=require(_0x04c0('0x16'))(_0x04c0('0x6f'));exports['reject']=function(_0x6b8d29,_0x140653,_0x43e99c){var _0x44bd22={'agent':{},'channel':'openchannel'};if(_0x6b8d29[_0x04c0('0x51')]['id']){delete _0x6b8d29[_0x04c0('0x51')]['id'];}_0x6b8d29['body'][_0x04c0('0x59')]=_0x6b8d29[_0x04c0('0x51')][_0x04c0('0x59')]||_0x6b8d29[_0x04c0('0x5a')]['id'];_0x44bd22[_0x04c0('0x5b')]['id']=_0x6b8d29[_0x04c0('0x51')][_0x04c0('0x59')];return db['OpenchannelMessage'][_0x04c0('0x52')]({'where':{'id':_0x6b8d29[_0x04c0('0x4f')]['id'],'UserId':null}})[_0x04c0('0x21')](handleEntityNotFound(_0x140653,null))['then'](function(_0x40c2e1){if(_0x40c2e1){_0x44bd22[_0x04c0('0x25')]=_0x40c2e1[_0x04c0('0x5c')]({'plain':!![]});return db[_0x04c0('0x5d')][_0x04c0('0x52')]({'where':{'id':_0x40c2e1[_0x04c0('0x70')]}});}return null;})[_0x04c0('0x21')](handleEntityNotFound(_0x140653,null))[_0x04c0('0x21')](function(_0x41aea2){if(_0x41aea2){_0x44bd22[_0x04c0('0x60')]=_0x41aea2[_0x04c0('0x5c')]({'plain':!![]});interaction_log['info'](_0x04c0('0x71'),_0x6b8d29['user']['id'],_0x6b8d29[_0x04c0('0x5a')][_0x04c0('0x33')],_0x6b8d29[_0x04c0('0x5a')][_0x04c0('0x72')],_0x44bd22[_0x04c0('0x60')]['id'],_0x6b8d29[_0x04c0('0x51')]?JSON[_0x04c0('0x23')](_0x6b8d29[_0x04c0('0x51')]):_0x04c0('0x61'));return respondWithRpcPromise('RejectMessage',_0x04c0('0x73'),_0x44bd22);}return null;})[_0x04c0('0x21')](function(_0x11fd4f){var _0x4f5460=_0x04c0('0x63')+_0x11fd4f[_0x04c0('0x25')][_0x04c0('0x64')];return db[_0x04c0('0x65')][_0x04c0('0x3c')](_0x4f5460,{'type':db['Sequelize'][_0x04c0('0x67')][_0x04c0('0x74')],'raw':!![]})[_0x04c0('0x21')](function(_0x235eab){return _0x235eab;});})[_0x04c0('0x21')](function(_0x394d7c){if(_0x394d7c){_0x44bd22[_0x04c0('0x25')][_0x04c0('0x68')]=_0x394d7c[0x0];if(!_0x6b8d29['body']['UserId'])return;return db[_0x04c0('0x75')][_0x04c0('0x52')]({'where':{'id':_0x6b8d29[_0x04c0('0x51')][_0x04c0('0x59')],'role':_0x04c0('0x5b')},'attributes':['id',_0x04c0('0x33'),'fullname',_0x04c0('0x69'),_0x04c0('0x76')],'raw':!![]});}return null;})[_0x04c0('0x21')](function(_0x538a52){if(!_0x538a52)return null;_0x44bd22[_0x04c0('0x25')][_0x04c0('0x5b')]=_0x538a52;return _0x44bd22;})[_0x04c0('0x21')](function(_0xda0645){if(_0xda0645){_0xda0645[_0x04c0('0x25')][_0x04c0('0x6b')]=util[_0x04c0('0x57')]('SIP/%s',_0x6b8d29[_0x04c0('0x5a')][_0x04c0('0x33')]);_0xda0645[_0x04c0('0x25')][_0x04c0('0x6c')]=_0x44bd22[_0x04c0('0x6c')];_0xda0645[_0x04c0('0x25')][_0x04c0('0x77')]=_0x44bd22[_0x04c0('0x6c')];_0xda0645['message'][_0x04c0('0x6d')]=_0x04c0('0x78');respondWithRpcPromise(_0x04c0('0x6e'),_0x04c0('0x6e'),{'event':'rejectmessage','message':_0xda0645['message']},client9002);return _0x44bd22;}return null;})[_0x04c0('0x21')](respondWithResult(_0x140653,null))['catch'](handleError(_0x140653,null));}; \ No newline at end of file +var _0x126e=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','params','rawAttributes','includeAll','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','sequelize','User','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5502da,_0x3370b0){var _0x346cf5=function(_0x4f9c0a){while(--_0x4f9c0a){_0x5502da['push'](_0x5502da['shift']());}};_0x346cf5(++_0x3370b0);}(_0x126e,0x108));var _0xe126=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x126e[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe126('0x0'));var zipdir=require(_0xe126('0x1'));var jsonpatch=require(_0xe126('0x2'));var rp=require(_0xe126('0x3'));var moment=require(_0xe126('0x4'));var BPromise=require(_0xe126('0x5'));var Mustache=require('mustache');var util=require(_0xe126('0x6'));var path=require(_0xe126('0x7'));var sox=require(_0xe126('0x8'));var csv=require(_0xe126('0x9'));var ejs=require(_0xe126('0xa'));var fs=require('fs');var fs_extra=require(_0xe126('0xb'));var _=require(_0xe126('0xc'));var squel=require('squel');var crypto=require(_0xe126('0xd'));var jsforce=require(_0xe126('0xe'));var deskjs=require(_0xe126('0xf'));var toCsv=require(_0xe126('0x9'));var querystring=require(_0xe126('0x10'));var Papa=require('papaparse');var Redis=require(_0xe126('0x11'));var authService=require(_0xe126('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe126('0x13'));var hardwareService=require(_0xe126('0x14'));var logger=require('../../config/logger')(_0xe126('0x15'));var utils=require('../../config/utils');var config=require(_0xe126('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe126('0x17'))['db'];config[_0xe126('0x18')]=_[_0xe126('0x19')](config[_0xe126('0x18')],{'host':_0xe126('0x1a'),'port':0x18eb});var socket=require(_0xe126('0x1b'))(new Redis(config[_0xe126('0x18')]));require('./openchannelMessage.socket')[_0xe126('0x1c')](socket);var jayson=require(_0xe126('0x1d'));var client=jayson['client'][_0xe126('0x1e')]({'port':0x232c});var client9002=jayson[_0xe126('0x1f')][_0xe126('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x38b0c0,_0x5e52d1,_0x14bfb7,_0x3a4996){return new BPromise(function(_0x1c32fe,_0x521509){var _0x2b0baa=_0x3a4996||client;return _0x2b0baa['request'](_0x38b0c0,_0x14bfb7)[_0xe126('0x20')](function(_0xa1ce97){logger[_0xe126('0x21')](_0xe126('0x22'),_0x5e52d1,_0xe126('0x23'));logger[_0xe126('0x24')](_0xe126('0x25'),_0x5e52d1,_0xe126('0x23'),JSON['stringify'](_0xa1ce97));if(_0xa1ce97[_0xe126('0x26')]){if(_0xa1ce97[_0xe126('0x26')][_0xe126('0x27')]===0x1f4){logger[_0xe126('0x26')](_0xe126('0x22'),_0x5e52d1,_0xa1ce97[_0xe126('0x26')][_0xe126('0x28')]);return _0x521509(_0xa1ce97[_0xe126('0x26')]['message']);}logger['error'](_0xe126('0x22'),_0x5e52d1,_0xa1ce97[_0xe126('0x26')][_0xe126('0x28')]);return _0x1c32fe(_0xa1ce97['error']['message']);}else{logger['info'](_0xe126('0x22'),_0x5e52d1,_0xe126('0x23'));_0x1c32fe(_0xa1ce97['result'][_0xe126('0x28')]);}})[_0xe126('0x29')](function(_0x4157ed){logger[_0xe126('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e52d1,_0x4157ed);_0x521509(_0x4157ed);});});}function respondWithStatusCode(_0x49d70d,_0x26482f){_0x26482f=_0x26482f||0xcc;return function(_0x4facea){if(_0x4facea){return _0x49d70d[_0xe126('0x2a')](_0x26482f);}return _0x49d70d[_0xe126('0x2b')](_0x26482f)[_0xe126('0x2c')]();};}function respondWithResult(_0x5b31a4,_0x45f55c){_0x45f55c=_0x45f55c||0xc8;return function(_0x449309){if(_0x449309){return _0x5b31a4['status'](_0x45f55c)[_0xe126('0x2d')](_0x449309);}};}function respondWithFilteredResult(_0x259059,_0x5a8b2a){return function(_0x9d9e28){if(_0x9d9e28){var _0x1fb354=typeof _0x5a8b2a[_0xe126('0x2e')]===_0xe126('0x2f')&&typeof _0x5a8b2a['limit']===_0xe126('0x2f');var _0x2df99d=_0x9d9e28['count'];var _0x4e61a8=_0x1fb354?0x0:_0x5a8b2a[_0xe126('0x2e')];var _0x590d35=_0x1fb354?_0x9d9e28[_0xe126('0x30')]:_0x5a8b2a[_0xe126('0x2e')]+_0x5a8b2a[_0xe126('0x31')];var _0x5bdf16;if(_0x590d35>=_0x2df99d){_0x590d35=_0x2df99d;_0x5bdf16=0xc8;}else{_0x5bdf16=0xce;}_0x259059[_0xe126('0x2b')](_0x5bdf16);return _0x259059[_0xe126('0x32')](_0xe126('0x33'),_0x4e61a8+'-'+_0x590d35+'/'+_0x2df99d)['json'](_0x9d9e28);}return null;};}function patchUpdates(_0x1ecbd1){return function(_0x2c1e63){try{jsonpatch['apply'](_0x2c1e63,_0x1ecbd1,!![]);}catch(_0x5a4782){return BPromise[_0xe126('0x34')](_0x5a4782);}return _0x2c1e63[_0xe126('0x35')]();};}function saveUpdates(_0x371673,_0xd3ebfe){return function(_0x33e671){if(_0x33e671){return _0x33e671[_0xe126('0x36')](_0x371673)[_0xe126('0x20')](function(_0xd03338){return _0xd03338;});}return null;};}function removeEntity(_0x577fc6,_0x427a1e){return function(_0xf5e235){if(_0xf5e235){return _0xf5e235[_0xe126('0x37')]()[_0xe126('0x20')](function(){_0x577fc6[_0xe126('0x2b')](0xcc)[_0xe126('0x2c')]();});}};}function handleEntityNotFound(_0x4bc069,_0x258616){return function(_0x1de471){if(!_0x1de471){_0x4bc069[_0xe126('0x2a')](0x194);}return _0x1de471;};}function handleError(_0x11058a,_0x32f84b){_0x32f84b=_0x32f84b||0x1f4;return function(_0x5e5cae){logger[_0xe126('0x26')](_0x5e5cae[_0xe126('0x38')]);if(_0x5e5cae[_0xe126('0x39')]){delete _0x5e5cae[_0xe126('0x39')];}_0x11058a['status'](_0x32f84b)[_0xe126('0x3a')](_0x5e5cae);};}exports[_0xe126('0x3b')]=function(_0x471715,_0x392c33){var _0x14870e={},_0x2fe73a={},_0x57cfaf={'count':0x0,'rows':[]};var _0x3c2b07=_[_0xe126('0x3c')](db[_0xe126('0x3d')]['rawAttributes'],function(_0x5073bc){return{'name':_0x5073bc[_0xe126('0x3e')],'type':_0x5073bc[_0xe126('0x3f')][_0xe126('0x40')]};});_0x2fe73a[_0xe126('0x41')]=_[_0xe126('0x3c')](_0x3c2b07,_0xe126('0x39'));_0x2fe73a['query']=_[_0xe126('0x42')](_0x471715[_0xe126('0x43')]);_0x2fe73a['filters']=_[_0xe126('0x44')](_0x2fe73a[_0xe126('0x41')],_0x2fe73a[_0xe126('0x43')]);_0x14870e['attributes']=_[_0xe126('0x44')](_0x2fe73a[_0xe126('0x41')],qs['fields'](_0x471715[_0xe126('0x43')][_0xe126('0x45')]));_0x14870e['attributes']=_0x14870e[_0xe126('0x46')]['length']?_0x14870e[_0xe126('0x46')]:_0x2fe73a[_0xe126('0x41')];if(!_0x471715['query'][_0xe126('0x47')](_0xe126('0x48'))){_0x14870e[_0xe126('0x31')]=qs['limit'](_0x471715[_0xe126('0x43')]['limit']);_0x14870e[_0xe126('0x2e')]=qs[_0xe126('0x2e')](_0x471715[_0xe126('0x43')][_0xe126('0x2e')]);}_0x14870e[_0xe126('0x49')]=qs[_0xe126('0x4a')](_0x471715[_0xe126('0x43')][_0xe126('0x4a')]);_0x14870e[_0xe126('0x4b')]=qs[_0xe126('0x4c')](_[_0xe126('0x4d')](_0x471715['query'],_0x2fe73a['filters']),_0x3c2b07);if(_0x471715[_0xe126('0x43')][_0xe126('0x4e')]){_0x14870e['where']=_[_0xe126('0x4f')](_0x14870e[_0xe126('0x4b')],{'$or':_[_0xe126('0x3c')](_0x3c2b07,function(_0x3d318a){if(_0x3d318a['type']!==_0xe126('0x50')){var _0x132ef9={};_0x132ef9[_0x3d318a[_0xe126('0x39')]]={'$like':'%'+_0x471715[_0xe126('0x43')][_0xe126('0x4e')]+'%'};return _0x132ef9;}})});}_0x14870e=_[_0xe126('0x4f')]({},_0x14870e,_0x471715[_0xe126('0x51')]);var _0xa8eae6={'where':_0x14870e[_0xe126('0x4b')]};return db[_0xe126('0x3d')][_0xe126('0x30')](_0xa8eae6)[_0xe126('0x20')](function(_0x24c312){_0x57cfaf['count']=_0x24c312;if(_0x471715['query']['includeAll']){_0x14870e['include']=[{'all':!![]}];}return db[_0xe126('0x3d')][_0xe126('0x52')](_0x14870e);})[_0xe126('0x20')](function(_0x6f6cc0){_0x57cfaf[_0xe126('0x53')]=_0x6f6cc0;return _0x57cfaf;})[_0xe126('0x20')](respondWithFilteredResult(_0x392c33,_0x14870e))[_0xe126('0x29')](handleError(_0x392c33,null));};exports['show']=function(_0x58b1ef,_0x18df48){var _0xc6886b={'raw':!![],'where':{'id':_0x58b1ef[_0xe126('0x54')]['id']}},_0x561bf5={};_0x561bf5[_0xe126('0x41')]=_['keys'](db[_0xe126('0x3d')][_0xe126('0x55')]);_0x561bf5['query']=_['keys'](_0x58b1ef[_0xe126('0x43')]);_0x561bf5[_0xe126('0x4c')]=_[_0xe126('0x44')](_0x561bf5['model'],_0x561bf5[_0xe126('0x43')]);_0xc6886b['attributes']=_[_0xe126('0x44')](_0x561bf5[_0xe126('0x41')],qs['fields'](_0x58b1ef[_0xe126('0x43')][_0xe126('0x45')]));_0xc6886b['attributes']=_0xc6886b['attributes']['length']?_0xc6886b[_0xe126('0x46')]:_0x561bf5[_0xe126('0x41')];if(_0x58b1ef[_0xe126('0x43')][_0xe126('0x56')]){_0xc6886b['include']=[{'all':!![]}];}_0xc6886b=_[_0xe126('0x4f')]({},_0xc6886b,_0x58b1ef[_0xe126('0x51')]);return db[_0xe126('0x3d')][_0xe126('0x57')](_0xc6886b)[_0xe126('0x20')](handleEntityNotFound(_0x18df48,null))[_0xe126('0x20')](respondWithResult(_0x18df48,null))[_0xe126('0x29')](handleError(_0x18df48,null));};exports[_0xe126('0x58')]=function(_0x14902b,_0x1ee162){return db[_0xe126('0x3d')][_0xe126('0x58')](_0x14902b[_0xe126('0x59')],{})[_0xe126('0x20')](respondWithResult(_0x1ee162,0xc9))[_0xe126('0x29')](handleError(_0x1ee162,null));};exports[_0xe126('0x36')]=function(_0x2d4fe5,_0x1f689a){if(_0x2d4fe5[_0xe126('0x59')]['id']){delete _0x2d4fe5[_0xe126('0x59')]['id'];}return db[_0xe126('0x3d')][_0xe126('0x57')]({'where':{'id':_0x2d4fe5[_0xe126('0x54')]['id']}})[_0xe126('0x20')](handleEntityNotFound(_0x1f689a,null))[_0xe126('0x20')](saveUpdates(_0x2d4fe5[_0xe126('0x59')],null))[_0xe126('0x20')](respondWithResult(_0x1f689a,null))['catch'](handleError(_0x1f689a,null));};exports[_0xe126('0x37')]=function(_0x20e5ba,_0xa4f1e5){return db[_0xe126('0x3d')][_0xe126('0x57')]({'where':{'id':_0x20e5ba['params']['id']}})[_0xe126('0x20')](handleEntityNotFound(_0xa4f1e5,null))[_0xe126('0x20')](removeEntity(_0xa4f1e5,null))['catch'](handleError(_0xa4f1e5,null));};exports[_0xe126('0x5a')]=function(_0x3ed82a,_0x5b807e){return db[_0xe126('0x3d')][_0xe126('0x5a')]()[_0xe126('0x20')](respondWithResult(_0x5b807e,null))[_0xe126('0x29')](handleError(_0x5b807e,null));};var interaction_log=require(_0xe126('0x5b'))(_0xe126('0x5c'));exports[_0xe126('0x5d')]=function(_0x5b4426,_0x33b33c,_0x3d1a48){var _0x4a30c8={'agent':{},'channel':_0xe126('0x5e')};if(_0x5b4426[_0xe126('0x59')]['id']){delete _0x5b4426[_0xe126('0x59')]['id'];}_0x5b4426['body'][_0xe126('0x5f')]=!![];_0x5b4426[_0xe126('0x59')][_0xe126('0x60')]=moment()[_0xe126('0x61')](_0xe126('0x62'));_0x5b4426[_0xe126('0x59')][_0xe126('0x63')]=_0x5b4426[_0xe126('0x59')][_0xe126('0x63')]||_0x5b4426[_0xe126('0x64')]['id'];_0x4a30c8[_0xe126('0x65')]['id']=_0x5b4426[_0xe126('0x59')][_0xe126('0x63')];return db[_0xe126('0x3d')][_0xe126('0x57')]({'where':{'id':_0x5b4426[_0xe126('0x54')]['id'],'UserId':null}})[_0xe126('0x20')](handleEntityNotFound(_0x33b33c,null))[_0xe126('0x20')](saveUpdates(_0x5b4426[_0xe126('0x59')],null))[_0xe126('0x20')](function(_0x167a72){if(_0x167a72){_0x4a30c8[_0xe126('0x28')]=_0x167a72['get']({'plain':!![]});return db[_0xe126('0x66')][_0xe126('0x57')]({'where':{'id':_0x167a72[_0xe126('0x67')]}});}return null;})[_0xe126('0x20')](handleEntityNotFound(_0x33b33c,null))[_0xe126('0x20')](function(_0x1f8891){if(_0x1f8891){return _0x1f8891[_0xe126('0x36')]({'UserId':_0x5b4426[_0xe126('0x59')][_0xe126('0x63')],'read1stAt':_[_0xe126('0x68')](_0x1f8891['read1stAt'])?moment()[_0xe126('0x61')](_0xe126('0x62')):undefined});}return null;})[_0xe126('0x20')](function(_0x3ff963){if(_0x3ff963){_0x4a30c8[_0xe126('0x69')]=_0x3ff963[_0xe126('0x6a')]({'plain':!![]});interaction_log[_0xe126('0x21')](_0xe126('0x6b'),_0x5b4426[_0xe126('0x64')]['id'],_0x5b4426[_0xe126('0x64')][_0xe126('0x39')],_0x5b4426[_0xe126('0x64')][_0xe126('0x6c')],_0x4a30c8[_0xe126('0x69')]['id'],_0x5b4426[_0xe126('0x59')]?JSON[_0xe126('0x6d')](_0x5b4426[_0xe126('0x59')]):_0xe126('0x6e'));return respondWithRpcPromise(_0xe126('0x6f'),_0xe126('0x70'),_0x4a30c8);}return null;})[_0xe126('0x20')](function(_0x1ff7e8){var _0x3369c1=_0xe126('0x71')+_0x1ff7e8['message'][_0xe126('0x72')];return db['sequelize'][_0xe126('0x43')](_0x3369c1,{'type':db[_0xe126('0x73')][_0xe126('0x74')][_0xe126('0x75')],'raw':!![]})[_0xe126('0x20')](function(_0x235f45){return _0x235f45;});})['then'](function(_0x3d4836){if(_0x3d4836){_0x4a30c8['message'][_0xe126('0x76')]=_0x3d4836[0x0];if(!_0x5b4426[_0xe126('0x59')][_0xe126('0x63')])return;return db['User'][_0xe126('0x57')]({'where':{'id':_0x5b4426[_0xe126('0x59')][_0xe126('0x63')],'role':_0xe126('0x65')},'attributes':['id',_0xe126('0x39'),_0xe126('0x77'),'email',_0xe126('0x78')],'raw':!![]});}return null;})['then'](function(_0x5c49cd){if(!_0x5c49cd)return null;_0x4a30c8['message'][_0xe126('0x65')]=_0x5c49cd;return _0x4a30c8;})[_0xe126('0x20')](function(_0x56161c){if(_0x56161c){if(_0x5b4426[_0xe126('0x59')][_0xe126('0x79')]){_0x4a30c8[_0xe126('0x28')][_0xe126('0x7a')]=util['format'](_0xe126('0x7b'),_0x5b4426[_0xe126('0x64')][_0xe126('0x39')]);_0x4a30c8[_0xe126('0x28')][_0xe126('0x7c')]=_0x4a30c8[_0xe126('0x7c')];_0x4a30c8[_0xe126('0x28')][_0xe126('0x7d')]=_0x4a30c8[_0xe126('0x7c')];_0x4a30c8['message'][_0xe126('0x7e')]=_0xe126('0x5d');return respondWithRpcPromise('EventManager',_0xe126('0x7f'),{'event':_0xe126('0x80'),'message':_0x4a30c8[_0xe126('0x28')]},client9002)[_0xe126('0x20')](function(){return _0x4a30c8;});}return _0x4a30c8;}return null;})[_0xe126('0x20')](respondWithResult(_0x33b33c,null))[_0xe126('0x29')](handleError(_0x33b33c,null));};var interaction_log=require(_0xe126('0x5b'))(_0xe126('0x5c'));exports[_0xe126('0x34')]=function(_0x208ba2,_0x1c473a,_0x4cf2d9){var _0x1fde6a={'agent':{},'channel':_0xe126('0x5e')};if(_0x208ba2['body']['id']){delete _0x208ba2[_0xe126('0x59')]['id'];}_0x208ba2[_0xe126('0x59')][_0xe126('0x63')]=_0x208ba2['body'][_0xe126('0x63')]||_0x208ba2['user']['id'];_0x1fde6a['agent']['id']=_0x208ba2[_0xe126('0x59')][_0xe126('0x63')];return db['OpenchannelMessage'][_0xe126('0x57')]({'where':{'id':_0x208ba2[_0xe126('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c473a,null))[_0xe126('0x20')](function(_0x357451){if(_0x357451){_0x1fde6a[_0xe126('0x28')]=_0x357451['get']({'plain':!![]});return db[_0xe126('0x66')][_0xe126('0x57')]({'where':{'id':_0x357451['OpenchannelInteractionId']}});}return null;})[_0xe126('0x20')](handleEntityNotFound(_0x1c473a,null))[_0xe126('0x20')](function(_0x5f08e4){if(_0x5f08e4){_0x1fde6a[_0xe126('0x69')]=_0x5f08e4[_0xe126('0x6a')]({'plain':!![]});interaction_log[_0xe126('0x21')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x208ba2['user']['id'],_0x208ba2[_0xe126('0x64')][_0xe126('0x39')],_0x208ba2['user'][_0xe126('0x6c')],_0x1fde6a[_0xe126('0x69')]['id'],_0x208ba2[_0xe126('0x59')]?JSON[_0xe126('0x6d')](_0x208ba2['body']):_0xe126('0x6e'));return respondWithRpcPromise(_0xe126('0x81'),_0xe126('0x82'),_0x1fde6a);}return null;})[_0xe126('0x20')](function(_0x48df24){var _0x15da1b=_0xe126('0x71')+_0x48df24[_0xe126('0x28')][_0xe126('0x72')];return db[_0xe126('0x83')][_0xe126('0x43')](_0x15da1b,{'type':db[_0xe126('0x73')][_0xe126('0x74')][_0xe126('0x75')],'raw':!![]})['then'](function(_0x4ebe4d){return _0x4ebe4d;});})[_0xe126('0x20')](function(_0x1baa43){if(_0x1baa43){_0x1fde6a[_0xe126('0x28')]['contact']=_0x1baa43[0x0];if(!_0x208ba2['body']['UserId'])return;return db[_0xe126('0x84')][_0xe126('0x57')]({'where':{'id':_0x208ba2[_0xe126('0x59')][_0xe126('0x63')],'role':_0xe126('0x65')},'attributes':['id',_0xe126('0x39'),_0xe126('0x77'),'email',_0xe126('0x78')],'raw':!![]});}return null;})[_0xe126('0x20')](function(_0x5a2fb4){if(!_0x5a2fb4)return null;_0x1fde6a[_0xe126('0x28')][_0xe126('0x65')]=_0x5a2fb4;return _0x1fde6a;})[_0xe126('0x20')](function(_0x498b43){if(_0x498b43){_0x498b43['message'][_0xe126('0x7a')]=util[_0xe126('0x61')](_0xe126('0x7b'),_0x208ba2[_0xe126('0x64')]['name']);_0x498b43['message']['channel']=_0x1fde6a[_0xe126('0x7c')];_0x498b43[_0xe126('0x28')]['motionChannel']=_0x1fde6a['channel'];_0x498b43[_0xe126('0x28')][_0xe126('0x7e')]=_0xe126('0x34');respondWithRpcPromise('EventManager',_0xe126('0x7f'),{'event':_0xe126('0x85'),'message':_0x498b43[_0xe126('0x28')]},client9002);return _0x1fde6a;}return null;})['then'](respondWithResult(_0x1c473a,null))['catch'](handleError(_0x1c473a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index f1e80bc..f82c145 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 _0xc8b3=['exports','../../mysqldb','OpenchannelMessage','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x979ace,_0x266b84){var _0x37c672=function(_0x308856){while(--_0x308856){_0x979ace['push'](_0x979ace['shift']());}};_0x37c672(++_0x266b84);}(_0xc8b3,0x89));var _0x3c8b=function(_0x5b5095,_0x4518d0){_0x5b5095=_0x5b5095-0x0;var _0x54d290=_0xc8b3[_0x5b5095];return _0x54d290;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x3c8b('0x0'))['db'][_0x3c8b('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3c8b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3c8b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49b99a){return function(_0x59b0c0,_0x27357b,_0x9c5c50){OpenchannelMessageEvents[_0x3c8b('0x4')](_0x49b99a+':'+_0x59b0c0['id'],_0x59b0c0);OpenchannelMessageEvents[_0x3c8b('0x4')](_0x49b99a,_0x59b0c0);_0x9c5c50(null);};}for(var e in events){if(events[_0x3c8b('0x5')](e)){var event=events[e];OpenchannelMessage[_0x3c8b('0x6')](e,emitEvent(event));}}module[_0x3c8b('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xbd3b=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelMessage'];(function(_0x11490a,_0x325f82){var _0x37ea5e=function(_0xe68b42){while(--_0xe68b42){_0x11490a['push'](_0x11490a['shift']());}};_0x37ea5e(++_0x325f82);}(_0xbd3b,0x125));var _0xbbd3=function(_0x7929d8,_0x8be119){_0x7929d8=_0x7929d8-0x0;var _0x40ff94=_0xbd3b[_0x7929d8];return _0x40ff94;};'use strict';var EventEmitter=require(_0xbbd3('0x0'));var OpenchannelMessage=require(_0xbbd3('0x1'))['db'][_0xbbd3('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbbd3('0x3'),'afterUpdate':_0xbbd3('0x4'),'afterDestroy':_0xbbd3('0x5')};function emitEvent(_0x53769e){return function(_0x14532b,_0x402954,_0x524275){OpenchannelMessageEvents['emit'](_0x53769e+':'+_0x14532b['id'],_0x14532b);OpenchannelMessageEvents[_0xbbd3('0x6')](_0x53769e,_0x14532b);_0x524275(null);};}for(var e in events){if(events[_0xbbd3('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 0f54826..b9e0d0f 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 _0xa4a7=['get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','createdAt','catch','error','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','CmContact','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','length','method','GET','POST','body','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','FULLTEXT'];(function(_0x43add2,_0x4f494e){var _0x4f60d5=function(_0x1fd291){while(--_0x1fd291){_0x43add2['push'](_0x43add2['shift']());}};_0x4f60d5(++_0x4f494e);}(_0xa4a7,0x1e7));var _0x7a4a=function(_0x544034,_0x4ab18a){_0x544034=_0x544034-0x0;var _0x1d77e7=_0xa4a7[_0x544034];return _0x1d77e7;};'use strict';var _=require('lodash');var util=require(_0x7a4a('0x0'));var logger=require(_0x7a4a('0x1'))(_0x7a4a('0x2'));var moment=require(_0x7a4a('0x3'));var BPromise=require(_0x7a4a('0x4'));var rp=require(_0x7a4a('0x5'));var fs=require('fs');var path=require(_0x7a4a('0x6'));var rimraf=require('rimraf');var config=require(_0x7a4a('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0x7a4a('0x8')]=function(_0x5752e3,_0x51c87a){return _0x5752e3[_0x7a4a('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x7a4a('0xa'),'paranoid':![],'indexes':[{'name':_0x7a4a('0xb'),'fields':['body'],'type':_0x7a4a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53394e,_0x36b81e,_0x1501e7){var _0x35f1a1=_0x5752e3['models'];var _0x16322a=_0x53394e[_0x7a4a('0xd')]({'plain':!![]});if(_0x16322a[_0x7a4a('0xe')][_0x7a4a('0xf')]()==='in'||_0x16322a[_0x7a4a('0xe')][_0x7a4a('0xf')]()===_0x7a4a('0x10')&&!_0x16322a[_0x7a4a('0x11')]&&!_[_0x7a4a('0x12')](_0x16322a[_0x7a4a('0x13')])){_0x35f1a1[_0x7a4a('0x14')]['findOne']({'where':{'id':_0x16322a[_0x7a4a('0x15')]}})[_0x7a4a('0x16')](function(_0x5b4b64){if(_0x5b4b64){_0x5b4b64['update']({'lastMsgAt':_0x16322a[_0x7a4a('0x17')],'lastMsgDirection':_0x16322a['direction']['toLowerCase']()});}})[_0x7a4a('0x18')](function(_0x19dc44){console[_0x7a4a('0x19')](_0x19dc44);});}if(_0x16322a[_0x7a4a('0xe')]===_0x7a4a('0x10')&&!_0x16322a['secret']){var _0x232cab;_0x35f1a1['CmContact'][_0x7a4a('0x1a')]()[_0x7a4a('0x16')](function(_0x4b5efd){return _0x35f1a1[_0x7a4a('0x1b')]['find']({'where':{'id':_0x16322a[_0x7a4a('0x1c')]},'include':[{'model':_0x35f1a1[_0x7a4a('0x14')],'as':_0x7a4a('0x1d'),'where':{'id':_0x16322a['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x35f1a1[_0x7a4a('0x1e')],'as':_0x7a4a('0x1f'),'attributes':_[_0x7a4a('0x20')](_0x4b5efd)}]}]});})['then'](function(_0x1bda80){_0x232cab=_0x1bda80[_0x7a4a('0xd')]({'plain':!![]});if(_0x232cab&&_0x232cab[_0x7a4a('0x21')]){logger['info'](_0x7a4a('0x22'),'afterCreate',util[_0x7a4a('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x16322a['id'],_0x232cab[_0x7a4a('0x21')]));if(_0x232cab[_0x7a4a('0x1d')]&&_0x232cab['Interactions'][_0x7a4a('0x24')]){_0x16322a['Interaction']=_['omit'](_0x232cab[_0x7a4a('0x1d')][0x0],_0x7a4a('0x1f'));_0x16322a[_0x7a4a('0x1f')]=_0x232cab[_0x7a4a('0x1d')][0x0][_0x7a4a('0x1f')];}var _0x36b81e={'method':'POST','uri':encodeURI(_0x232cab[_0x7a4a('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x36b81e[_0x7a4a('0x25')]){case _0x7a4a('0x26'):_0x36b81e['qs']=_0x16322a;break;case _0x7a4a('0x27'):_0x36b81e[_0x7a4a('0x28')]=_0x16322a;break;}return rp(_0x36b81e)[_0x7a4a('0x16')](function(_0x1d9ecc){logger[_0x7a4a('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x7a4a('0x2a'),util['format'](_0x7a4a('0x2b'),_0x16322a['id'],_0x232cab[_0x7a4a('0x21')]));if(_0x1d9ecc[_0x7a4a('0x28')]['threadId']&&_0x1d9ecc[_0x7a4a('0x28')][_0x7a4a('0x2c')]!=_0x16322a[_0x7a4a('0x2d')]['threadId']){return _0x35f1a1[_0x7a4a('0x14')]['update']({'threadId':_0x1d9ecc[_0x7a4a('0x28')][_0x7a4a('0x2c')]},{'where':{'id':_0x16322a[_0x7a4a('0x2d')]['id']}});}else{return;}})[_0x7a4a('0x16')](function(){return _0x53394e[_0x7a4a('0x2e')]({'read':!![]});})[_0x7a4a('0x18')](function(_0x50ccbc){logger[_0x7a4a('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x7a4a('0x2a'),util['inspect'](_0x50ccbc,{'showHidden':![],'depth':null}));_0x1501e7();});}else{_0x1501e7();}})[_0x7a4a('0x2f')](function(){_0x1501e7();});}else{_0x1501e7();}}},'charset':_0x7a4a('0x30'),'collate':_0x7a4a('0x31')});}; \ No newline at end of file +var _0x7b50=['threadId','error','inspect','finally','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','body','models','get','direction','toLowerCase','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','out','secret','CmContact','describe','find','OpenchannelAccountId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Interactions','length','Interaction','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x7b50,0x12b));var _0x07b5=function(_0x2b9fc1,_0x42947d){_0x2b9fc1=_0x2b9fc1-0x0;var _0xd90dc9=_0x7b50[_0x2b9fc1];return _0xd90dc9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x07b5('0x0'))(_0x07b5('0x1'));var moment=require(_0x07b5('0x2'));var BPromise=require(_0x07b5('0x3'));var rp=require(_0x07b5('0x4'));var fs=require('fs');var path=require(_0x07b5('0x5'));var rimraf=require(_0x07b5('0x6'));var config=require(_0x07b5('0x7'));var attributes=require(_0x07b5('0x8'));module[_0x07b5('0x9')]=function(_0x5036bf,_0x5d3af3){return _0x5036bf['define'](_0x07b5('0xa'),attributes,{'tableName':_0x07b5('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x07b5('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x190d4e,_0xcbba4,_0x19f843){var _0x1186e4=_0x5036bf[_0x07b5('0xd')];var _0x3e9c34=_0x190d4e[_0x07b5('0xe')]({'plain':!![]});if(_0x3e9c34[_0x07b5('0xf')][_0x07b5('0x10')]()==='in'||_0x3e9c34['direction']['toLowerCase']()==='out'&&!_0x3e9c34['secret']&&!_['isNil'](_0x3e9c34['UserId'])){_0x1186e4[_0x07b5('0x11')][_0x07b5('0x12')]({'where':{'id':_0x3e9c34[_0x07b5('0x13')]}})[_0x07b5('0x14')](function(_0x17f03c){if(_0x17f03c){_0x17f03c[_0x07b5('0x15')]({'lastMsgAt':_0x3e9c34[_0x07b5('0x16')],'lastMsgDirection':_0x3e9c34[_0x07b5('0xf')][_0x07b5('0x10')]()});}})[_0x07b5('0x17')](function(_0x41c5d8){console['error'](_0x41c5d8);});}if(_0x3e9c34[_0x07b5('0xf')]===_0x07b5('0x18')&&!_0x3e9c34[_0x07b5('0x19')]){var _0x3b550b;_0x1186e4[_0x07b5('0x1a')][_0x07b5('0x1b')]()[_0x07b5('0x14')](function(_0x48f858){return _0x1186e4['OpenchannelAccount'][_0x07b5('0x1c')]({'where':{'id':_0x3e9c34[_0x07b5('0x1d')]},'include':[{'model':_0x1186e4[_0x07b5('0x11')],'as':'Interactions','where':{'id':_0x3e9c34[_0x07b5('0x13')]},'limit':0x1,'include':[{'model':_0x1186e4[_0x07b5('0x1a')],'as':_0x07b5('0x1e'),'attributes':_[_0x07b5('0x1f')](_0x48f858)}]}]});})[_0x07b5('0x14')](function(_0xb60cde){_0x3b550b=_0xb60cde['get']({'plain':!![]});if(_0x3b550b&&_0x3b550b[_0x07b5('0x20')]){logger[_0x07b5('0x21')](_0x07b5('0x22'),_0x07b5('0x23'),util[_0x07b5('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x3e9c34['id'],_0x3b550b[_0x07b5('0x20')]));if(_0x3b550b[_0x07b5('0x25')]&&_0x3b550b['Interactions'][_0x07b5('0x26')]){_0x3e9c34[_0x07b5('0x27')]=_['omit'](_0x3b550b[_0x07b5('0x25')][0x0],_0x07b5('0x1e'));_0x3e9c34[_0x07b5('0x1e')]=_0x3b550b[_0x07b5('0x25')][0x0][_0x07b5('0x1e')];}var _0xcbba4={'method':_0x07b5('0x28'),'uri':encodeURI(_0x3b550b['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xcbba4[_0x07b5('0x29')]){case _0x07b5('0x2a'):_0xcbba4['qs']=_0x3e9c34;break;case'POST':_0xcbba4[_0x07b5('0xc')]=_0x3e9c34;break;}return rp(_0xcbba4)[_0x07b5('0x14')](function(_0x3f0270){logger[_0x07b5('0x21')](_0x07b5('0x22'),_0x07b5('0x23'),util[_0x07b5('0x24')](_0x07b5('0x2b'),_0x3e9c34['id'],_0x3b550b[_0x07b5('0x20')]));if(_0x3f0270[_0x07b5('0xc')][_0x07b5('0x2c')]&&_0x3f0270[_0x07b5('0xc')]['threadId']!=_0x3e9c34[_0x07b5('0x27')][_0x07b5('0x2c')]){return _0x1186e4['OpenchannelInteraction'][_0x07b5('0x15')]({'threadId':_0x3f0270['body'][_0x07b5('0x2c')]},{'where':{'id':_0x3e9c34[_0x07b5('0x27')]['id']}});}else{return;}})[_0x07b5('0x14')](function(){return _0x190d4e[_0x07b5('0x15')]({'read':!![]});})[_0x07b5('0x17')](function(_0x2de0b6){logger[_0x07b5('0x2d')](_0x07b5('0x22'),_0x07b5('0x23'),util[_0x07b5('0x2e')](_0x2de0b6,{'showHidden':![],'depth':null}));_0x19f843();});}else{_0x19f843();}})[_0x07b5('0x2f')](function(){_0x19f843();});}else{_0x19f843();}}},'charset':_0x07b5('0x30'),'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 12a3b5e..b7286bd 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x1261,0x144));var _0x1126=function(_0x42fc8e,_0x26620d){_0x42fc8e=_0x42fc8e-0x0;var _0x4ad7b5=_0x1261[_0x42fc8e];return _0x4ad7b5;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x36bbcb,_0x3aebb9){var _0x30f935=function(_0x854707){while(--_0x854707){_0x36bbcb['push'](_0x36bbcb['shift']());}};_0x30f935(++_0x3aebb9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d8c1e67..507e4eb 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 _0xbb0e=['emit','register','length','./openchannelMessage.events','save','remove','update'];(function(_0x5007cb,_0x1d52d0){var _0x4be4fc=function(_0x4d5c42){while(--_0x4d5c42){_0x5007cb['push'](_0x5007cb['shift']());}};_0x4be4fc(++_0x1d52d0);}(_0xbb0e,0x153));var _0xebb0=function(_0x1c2cbd,_0x85c037){_0x1c2cbd=_0x1c2cbd-0x0;var _0x21266f=_0xbb0e[_0x1c2cbd];return _0x21266f;};'use strict';var OpenchannelMessageEvents=require(_0xebb0('0x0'));var events=[_0xebb0('0x1'),_0xebb0('0x2'),_0xebb0('0x3')];function createListener(_0x5e5557,_0x47e292){return function(_0xf82f70){_0x47e292[_0xebb0('0x4')](_0x5e5557,_0xf82f70);};}function removeListener(_0x1add18,_0x1e5f8b){return function(){OpenchannelMessageEvents['removeListener'](_0x1add18,_0x1e5f8b);};}exports[_0xebb0('0x5')]=function(_0x2d0e8e){for(var _0x3f420e=0x0,_0x389cbd=events[_0xebb0('0x6')];_0x3f420e<_0x389cbd;_0x3f420e++){var _0x2f083d=events[_0x3f420e];var _0x533845=createListener('openchannelMessage:'+_0x2f083d,_0x2d0e8e);OpenchannelMessageEvents['on'](_0x2f083d,_0x533845);}}; \ No newline at end of file +var _0x2353=['update','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x252884,_0x117ddf){var _0x4de0e6=function(_0x442519){while(--_0x442519){_0x252884['push'](_0x252884['shift']());}};_0x4de0e6(++_0x117ddf);}(_0x2353,0xe3));var _0x3235=function(_0x5e5605,_0x15cb79){_0x5e5605=_0x5e5605-0x0;var _0x297f16=_0x2353[_0x5e5605];return _0x297f16;};'use strict';var OpenchannelMessageEvents=require(_0x3235('0x0'));var events=['save','remove',_0x3235('0x1')];function createListener(_0x1a446d,_0x1960c6){return function(_0x1c5b30){_0x1960c6['emit'](_0x1a446d,_0x1c5b30);};}function removeListener(_0x26e442,_0x378df4){return function(){OpenchannelMessageEvents[_0x3235('0x2')](_0x26e442,_0x378df4);};}exports[_0x3235('0x3')]=function(_0x22e9b8){for(var _0x513570=0x0,_0x2ee681=events[_0x3235('0x4')];_0x513570<_0x2ee681;_0x513570++){var _0x36d66a=events[_0x513570];var _0x34c975=createListener(_0x3235('0x5')+_0x36d66a,_0x22e9b8);OpenchannelMessageEvents['on'](_0x36d66a,_0x34c975);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 1770f3a..1bce58b 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 _0x1006=['removeTeams','removeAgents','exports','multer','util','express','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','/:id','destroy'];(function(_0x4d4c19,_0x3147ff){var _0xf9e510=function(_0x5b9442){while(--_0x5b9442){_0x4d4c19['push'](_0x4d4c19['shift']());}};_0xf9e510(++_0x3147ff);}(_0x1006,0x121));var _0x6100=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1006[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0x6100('0x0'));var util=require(_0x6100('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6100('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6100('0x3'));var config=require(_0x6100('0x4'));var controller=require(_0x6100('0x5'));router[_0x6100('0x6')]('/',auth[_0x6100('0x7')](),controller[_0x6100('0x8')]);router[_0x6100('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x6100('0x9')]);router[_0x6100('0x6')]('/:id',auth[_0x6100('0x7')](),controller[_0x6100('0xa')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x6100('0x6')](_0x6100('0xb'),auth['isAuthenticated'](),controller[_0x6100('0xc')]);router[_0x6100('0x6')](_0x6100('0xd'),auth[_0x6100('0x7')](),controller[_0x6100('0xe')]);router[_0x6100('0xf')]('/',auth[_0x6100('0x7')](),controller[_0x6100('0x10')]);router[_0x6100('0xf')](_0x6100('0xb'),auth[_0x6100('0x7')](),controller[_0x6100('0x11')]);router[_0x6100('0xf')]('/:id/users',auth[_0x6100('0x7')](),controller[_0x6100('0x12')]);router['put']('/:id',auth[_0x6100('0x7')](),controller[_0x6100('0x13')]);router[_0x6100('0x14')](_0x6100('0x15'),auth[_0x6100('0x7')](),controller[_0x6100('0x16')]);router[_0x6100('0x14')](_0x6100('0xb'),auth[_0x6100('0x7')](),controller[_0x6100('0x17')]);router[_0x6100('0x14')](_0x6100('0xd'),auth[_0x6100('0x7')](),controller[_0x6100('0x18')]);module[_0x6100('0x19')]=router; \ No newline at end of file +var _0x0d2c=['isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0xc945b8,_0x466326){var _0x29bdf2=function(_0x5ca3aa){while(--_0x5ca3aa){_0xc945b8['push'](_0xc945b8['shift']());}};_0x29bdf2(++_0x466326);}(_0x0d2c,0xcf));var _0xc0d2=function(_0x1c93a1,_0x1d8d26){_0x1c93a1=_0x1c93a1-0x0;var _0x1ae18e=_0x0d2c[_0x1c93a1];return _0x1ae18e;};'use strict';var multer=require(_0xc0d2('0x0'));var util=require(_0xc0d2('0x1'));var path=require(_0xc0d2('0x2'));var timeout=require(_0xc0d2('0x3'));var express=require(_0xc0d2('0x4'));var router=express[_0xc0d2('0x5')]();var fs_extra=require(_0xc0d2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc0d2('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0xc0d2('0x8')]('/',auth[_0xc0d2('0x9')](),controller[_0xc0d2('0xa')]);router['get'](_0xc0d2('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc0d2('0x8')](_0xc0d2('0xc'),auth[_0xc0d2('0x9')](),controller[_0xc0d2('0xd')]);router['get'](_0xc0d2('0xe'),auth['isAuthenticated'](),controller[_0xc0d2('0xf')]);router[_0xc0d2('0x8')](_0xc0d2('0x10'),auth[_0xc0d2('0x9')](),controller[_0xc0d2('0x11')]);router['get'](_0xc0d2('0x12'),auth['isAuthenticated'](),controller[_0xc0d2('0x13')]);router[_0xc0d2('0x14')]('/',auth[_0xc0d2('0x9')](),controller[_0xc0d2('0x15')]);router['post'](_0xc0d2('0x10'),auth[_0xc0d2('0x9')](),controller['addTeams']);router[_0xc0d2('0x14')](_0xc0d2('0x12'),auth[_0xc0d2('0x9')](),controller[_0xc0d2('0x16')]);router['put']('/:id',auth[_0xc0d2('0x9')](),controller['update']);router[_0xc0d2('0x17')](_0xc0d2('0xc'),auth[_0xc0d2('0x9')](),controller['destroy']);router[_0xc0d2('0x17')]('/:id/teams',auth[_0xc0d2('0x9')](),controller[_0xc0d2('0x18')]);router[_0xc0d2('0x17')](_0xc0d2('0x12'),auth[_0xc0d2('0x9')](),controller[_0xc0d2('0x19')]);module[_0xc0d2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 032cd30..d23e514 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 _0x0546=['ENUM','roundrobin','sequelize','exports','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0546,0x1ee));var _0x6054=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0x0546[_0x1034ee];return _0x2922af;};'use strict';var Sequelize=require(_0x6054('0x0'));module[_0x6054('0x1')]={'name':{'type':Sequelize[_0x6054('0x2')],'unique':_0x6054('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6054('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6054('0x4')]('rrmemory','beepall',_0x6054('0x5'))}}; \ No newline at end of file +var _0x5bb8=['sequelize','exports','STRING','name','ENUM','rrmemory','roundrobin'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x5bb8,0x10a));var _0x85bb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5bb8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x85bb('0x0'));module[_0x85bb('0x1')]={'name':{'type':Sequelize[_0x85bb('0x2')],'unique':_0x85bb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x85bb('0x4')](_0x85bb('0x5'),'beepall',_0x85bb('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index ff15547..3f0e267 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 _0xcc96=['keys','filters','intersection','attributes','fields','length','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','sort','OpenchannelQueueId','map','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','getTeams','order','pick','filter','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','sequelize','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','undefined','limit','offset','count','set','Content-Range','update','then','destroy','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','index','OpenchannelQueue','rawAttributes','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model'];(function(_0x58177d,_0x3932db){var _0xfa7fa6=function(_0x52c0e4){while(--_0x52c0e4){_0x58177d['push'](_0x58177d['shift']());}};_0xfa7fa6(++_0x3932db);}(_0xcc96,0xc4));var _0x6cc9=function(_0x9325f,_0x34eaf0){_0x9325f=_0x9325f-0x0;var _0x13fa2b=_0xcc96[_0x9325f];return _0x13fa2b;};'use strict';var BPromise=require(_0x6cc9('0x0'));var util=require(_0x6cc9('0x1'));var _=require(_0x6cc9('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x6cc9('0x3'));var logger=require('../../config/logger')(_0x6cc9('0x4'));var config=require(_0x6cc9('0x5'));var db=require(_0x6cc9('0x6'))['db'];config[_0x6cc9('0x7')]=_[_0x6cc9('0x8')](config['redis'],{'host':_0x6cc9('0x9'),'port':0x18eb});var socket=require(_0x6cc9('0xa'))(new Redis(config[_0x6cc9('0x7')]));require(_0x6cc9('0xb'))[_0x6cc9('0xc')](socket);function respondWithStatusCode(_0x6a86df,_0x4f1444){_0x4f1444=_0x4f1444||0xcc;return function(_0x483236){if(_0x483236){return _0x6a86df[_0x6cc9('0xd')](_0x4f1444);}return _0x6a86df[_0x6cc9('0xe')](_0x4f1444)['end']();};}function respondWithResult(_0x1374ab,_0x1c8420){_0x1c8420=_0x1c8420||0xc8;return function(_0x497bd2){if(_0x497bd2){return _0x1374ab['status'](_0x1c8420)['json'](_0x497bd2);}};}function respondWithFilteredResult(_0x1f2f5a,_0x5d7f14){return function(_0x468cfc){if(_0x468cfc){var _0x2868f9=typeof _0x5d7f14['offset']===_0x6cc9('0xf')&&typeof _0x5d7f14[_0x6cc9('0x10')]===_0x6cc9('0xf');var _0x51a674=_0x468cfc['count'];var _0x3c843e=_0x2868f9?0x0:_0x5d7f14[_0x6cc9('0x11')];var _0x2d381e=_0x2868f9?_0x468cfc[_0x6cc9('0x12')]:_0x5d7f14[_0x6cc9('0x11')]+_0x5d7f14['limit'];var _0x4ce9e1;if(_0x2d381e>=_0x51a674){_0x2d381e=_0x51a674;_0x4ce9e1=0xc8;}else{_0x4ce9e1=0xce;}_0x1f2f5a['status'](_0x4ce9e1);return _0x1f2f5a[_0x6cc9('0x13')](_0x6cc9('0x14'),_0x3c843e+'-'+_0x2d381e+'/'+_0x51a674)['json'](_0x468cfc);}return null;};}function saveUpdates(_0x44559c){return function(_0x31fffa){if(_0x31fffa){return _0x31fffa[_0x6cc9('0x15')](_0x44559c)[_0x6cc9('0x16')](function(_0x44cb1b){return _0x44cb1b;});}return null;};}function removeEntity(_0x2023e4){return function(_0x5900a9){if(_0x5900a9){return _0x5900a9[_0x6cc9('0x17')]()[_0x6cc9('0x16')](function(){var _0xe844df=_0x5900a9['get']({'plain':!![]});var _0x477f8e=_0x6cc9('0x18');return db[_0x6cc9('0x19')]['destroy']({'where':{'type':_0x477f8e,'resourceId':_0xe844df['id']}})[_0x6cc9('0x16')](function(){return _0x5900a9;});})[_0x6cc9('0x16')](function(){_0x2023e4[_0x6cc9('0xe')](0xcc)[_0x6cc9('0x1a')]();});}};}function handleEntityNotFound(_0x43664d){return function(_0x395d75){if(!_0x395d75){_0x43664d[_0x6cc9('0xd')](0x194);}return _0x395d75;};}function handleError(_0x1e0320,_0x4dd53c){_0x4dd53c=_0x4dd53c||0x1f4;return function(_0x105888){logger[_0x6cc9('0x1b')](_0x105888[_0x6cc9('0x1c')]);if(_0x105888[_0x6cc9('0x1d')]){delete _0x105888['name'];}_0x1e0320['status'](_0x4dd53c)[_0x6cc9('0x1e')](_0x105888);};}exports[_0x6cc9('0x1f')]=function(_0x10c8c5,_0x8823fa){var _0x5d857a={};var _0x1ba34d={'count':0x0,'rows':[]};var _0x5904ae=_['map'](db[_0x6cc9('0x20')][_0x6cc9('0x21')],function(_0x34d3e8){return{'name':_0x34d3e8['fieldName'],'type':_0x34d3e8[_0x6cc9('0x22')][_0x6cc9('0x23')]};});_0x5d857a=qs[_0x6cc9('0x24')](_0x5904ae,_0x10c8c5);var _0x4e36f0={'where':_0x5d857a[_0x6cc9('0x25')]};return db[_0x6cc9('0x20')][_0x6cc9('0x12')](_0x4e36f0)[_0x6cc9('0x16')](function(_0x3376c0){_0x1ba34d[_0x6cc9('0x12')]=_0x3376c0;_0x5d857a[_0x6cc9('0x26')]=qs[_0x6cc9('0x26')](_0x10c8c5[_0x6cc9('0x27')]);return db[_0x6cc9('0x20')][_0x6cc9('0x28')](_0x5d857a);})[_0x6cc9('0x16')](function(_0x5abb55){_0x1ba34d[_0x6cc9('0x29')]=_0x5abb55;return _0x1ba34d;})[_0x6cc9('0x16')](respondWithFilteredResult(_0x8823fa,_0x5d857a))[_0x6cc9('0x2a')](handleError(_0x8823fa,null));};exports[_0x6cc9('0x2b')]=function(_0x5221c9,_0x5836de){var _0x2d999d={'raw':!![],'where':{'id':_0x5221c9[_0x6cc9('0x2c')]['id']}},_0x4f142c={};_0x4f142c[_0x6cc9('0x2d')]=_[_0x6cc9('0x2e')](db[_0x6cc9('0x20')][_0x6cc9('0x21')]);_0x4f142c[_0x6cc9('0x27')]=_[_0x6cc9('0x2e')](_0x5221c9['query']);_0x4f142c[_0x6cc9('0x2f')]=_[_0x6cc9('0x30')](_0x4f142c[_0x6cc9('0x2d')],_0x4f142c[_0x6cc9('0x27')]);_0x2d999d[_0x6cc9('0x31')]=_[_0x6cc9('0x30')](_0x4f142c[_0x6cc9('0x2d')],qs[_0x6cc9('0x32')](_0x5221c9[_0x6cc9('0x27')][_0x6cc9('0x32')]));_0x2d999d['attributes']=_0x2d999d[_0x6cc9('0x31')][_0x6cc9('0x33')]?_0x2d999d[_0x6cc9('0x31')]:_0x4f142c[_0x6cc9('0x2d')];if(_0x5221c9[_0x6cc9('0x27')]['includeAll']){_0x2d999d['include']=[{'all':!![]}];}_0x2d999d=_[_0x6cc9('0x34')]({},_0x2d999d,_0x5221c9[_0x6cc9('0x35')]);return db['OpenchannelQueue'][_0x6cc9('0x36')](_0x2d999d)[_0x6cc9('0x16')](handleEntityNotFound(_0x5836de,null))['then'](respondWithResult(_0x5836de,null))[_0x6cc9('0x2a')](handleError(_0x5836de,null));};exports[_0x6cc9('0x37')]=function(_0x32e8e4,_0x586194){return db[_0x6cc9('0x20')][_0x6cc9('0x37')](_0x32e8e4[_0x6cc9('0x38')],{})['then'](function(_0x4bbc8c){var _0x3a9470=_0x32e8e4[_0x6cc9('0x39')][_0x6cc9('0x3a')]({'plain':!![]});if(!_0x3a9470)throw new Error(_0x6cc9('0x3b'));if(_0x3a9470['role']===_0x6cc9('0x39')){var _0x154bd5=_0x4bbc8c[_0x6cc9('0x3a')]({'plain':!![]});var _0x530c72='OpenchannelQueues';return db['UserProfileSection'][_0x6cc9('0x36')]({'where':{'name':_0x530c72,'userProfileId':_0x3a9470[_0x6cc9('0x3c')]},'raw':!![]})[_0x6cc9('0x16')](function(_0x413eee){if(_0x413eee&&_0x413eee[_0x6cc9('0x3d')]===0x0){return db[_0x6cc9('0x19')][_0x6cc9('0x37')]({'name':_0x154bd5[_0x6cc9('0x1d')],'resourceId':_0x154bd5['id'],'type':_0x413eee[_0x6cc9('0x1d')],'sectionId':_0x413eee['id']},{})['then'](function(){return _0x4bbc8c;});}else{return _0x4bbc8c;}})[_0x6cc9('0x2a')](function(_0xa586fe){logger[_0x6cc9('0x1b')](_0x6cc9('0x3e'),_0xa586fe);throw _0xa586fe;});}return _0x4bbc8c;})['then'](respondWithResult(_0x586194,0xc9))['catch'](handleError(_0x586194,null));};exports[_0x6cc9('0x15')]=function(_0x27c708,_0x48498b){if(_0x27c708['body']['id']){delete _0x27c708[_0x6cc9('0x38')]['id'];}return db['OpenchannelQueue'][_0x6cc9('0x36')]({'where':{'id':_0x27c708['params']['id']}})[_0x6cc9('0x16')](handleEntityNotFound(_0x48498b,null))['then'](saveUpdates(_0x27c708[_0x6cc9('0x38')],null))[_0x6cc9('0x16')](respondWithResult(_0x48498b,null))[_0x6cc9('0x2a')](handleError(_0x48498b,null));};exports[_0x6cc9('0x17')]=function(_0xe49c78,_0x176a30){return db[_0x6cc9('0x20')][_0x6cc9('0x36')]({'where':{'id':_0xe49c78[_0x6cc9('0x2c')]['id']}})[_0x6cc9('0x16')](handleEntityNotFound(_0x176a30,null))[_0x6cc9('0x16')](removeEntity(_0x176a30,null))[_0x6cc9('0x2a')](handleError(_0x176a30,null));};exports[_0x6cc9('0x3f')]=function(_0x5727f2,_0x5f1598){return db[_0x6cc9('0x20')][_0x6cc9('0x3f')]()[_0x6cc9('0x16')](respondWithResult(_0x5f1598,null))['catch'](handleError(_0x5f1598,null));};exports['getMembers']=function(_0x58ed00,_0x1b4e8f){var _0x4edc79={'raw':!![],'where':{}},_0x55c855={},_0x24758d;return db[_0x6cc9('0x20')][_0x6cc9('0x40')]({'where':{'id':_0x58ed00[_0x6cc9('0x2c')]['id']}})[_0x6cc9('0x16')](handleEntityNotFound(_0x1b4e8f,null))[_0x6cc9('0x16')](function(_0xfc401a){if(_0xfc401a){_0x24758d=_0xfc401a[_0x6cc9('0x3a')]({'plain':!![]});_0x55c855['model']=_['keys'](db[_0x6cc9('0x41')][_0x6cc9('0x21')]);_0x55c855[_0x6cc9('0x27')]=_[_0x6cc9('0x2e')](_0x58ed00['query']);_0x55c855[_0x6cc9('0x2f')]=_['intersection'](_0x55c855[_0x6cc9('0x2d')],_0x55c855['query']);_0x4edc79[_0x6cc9('0x31')]=_[_0x6cc9('0x30')](_0x55c855[_0x6cc9('0x2d')],qs['fields'](_0x58ed00['query'][_0x6cc9('0x32')]));_0x4edc79['attributes']=_0x4edc79['attributes'][_0x6cc9('0x33')]?_0x4edc79[_0x6cc9('0x31')]:_0x55c855[_0x6cc9('0x2d')];if(!_0x58ed00[_0x6cc9('0x27')][_0x6cc9('0x42')](_0x6cc9('0x43'))){_0x4edc79[_0x6cc9('0x10')]=qs[_0x6cc9('0x10')](_0x58ed00[_0x6cc9('0x27')][_0x6cc9('0x10')]);_0x4edc79[_0x6cc9('0x11')]=qs[_0x6cc9('0x11')](_0x58ed00[_0x6cc9('0x27')][_0x6cc9('0x11')]);}_0x4edc79['order']=qs[_0x6cc9('0x44')](_0x58ed00[_0x6cc9('0x27')]['sort']);_0x4edc79[_0x6cc9('0x25')]=qs[_0x6cc9('0x2f')](_['pick'](_0x58ed00[_0x6cc9('0x27')],_0x55c855[_0x6cc9('0x2f')]));_0x4edc79[_0x6cc9('0x25')][_0x6cc9('0x45')]=_0xfc401a['id'];if(_0x58ed00['query']['filter']){_0x4edc79[_0x6cc9('0x25')]=_['merge'](_0x4edc79[_0x6cc9('0x25')],{'$or':_[_0x6cc9('0x46')](_0x4edc79[_0x6cc9('0x31')],function(_0x1854e5){var _0x42bfaa={};_0x42bfaa[_0x1854e5]={'$like':'%'+_0x58ed00[_0x6cc9('0x27')]['filter']+'%'};return _0x42bfaa;})});}_0x4edc79=_[_0x6cc9('0x34')]({},_0x4edc79,_0x58ed00['options']);return db[_0x6cc9('0x41')][_0x6cc9('0x28')](_0x4edc79);}})[_0x6cc9('0x16')](function(_0x1fb32e){if(_0x1fb32e){return db[_0x6cc9('0x47')][_0x6cc9('0x48')]({'where':{'id':_['map'](_0x1fb32e,_0x6cc9('0x49')),'role':_0x6cc9('0x4a')},'attributes':['id',_0x6cc9('0x1d'),'openchannelPause','updatedAt',_0x6cc9('0x4b')]});}})['then'](function(_0x5bb30a){if(_0x5bb30a){return{'count':_0x5bb30a[_0x6cc9('0x12')],'rows':_[_0x6cc9('0x46')](_0x5bb30a['rows'],function(_0x3d4704){return{'membername':_0x3d4704[_0x6cc9('0x1d')],'UserId':_0x3d4704['id'],'queue_name':_0x24758d['name'],'OpenchannelQueueId':_0x24758d['id'],'interface':util[_0x6cc9('0x4c')](_0x6cc9('0x4d'),_0x6cc9('0x4e'),_0x3d4704['name']),'penalty':0x0,'paused':_0x3d4704['openchannelPause'],'createdAt':_0x3d4704[_0x6cc9('0x4b')],'updatedAt':_0x3d4704['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6cc9('0x16')](respondWithFilteredResult(_0x1b4e8f,_0x4edc79))[_0x6cc9('0x2a')](handleError(_0x1b4e8f,null));};exports[_0x6cc9('0x4f')]=function(_0x496bf9,_0x2cc7d7){var _0xfb4416={};var _0x4dda7c={};var _0x4a6739;var _0x25422d;return db['OpenchannelQueue'][_0x6cc9('0x40')]({'where':{'id':_0x496bf9[_0x6cc9('0x2c')]['id']}})[_0x6cc9('0x16')](handleEntityNotFound(_0x2cc7d7,null))[_0x6cc9('0x16')](function(_0x2eea8a){if(_0x2eea8a){_0x4a6739=_0x2eea8a;_0x4dda7c[_0x6cc9('0x2d')]=_['keys'](db['Team'][_0x6cc9('0x21')]);_0x4dda7c[_0x6cc9('0x27')]=_['keys'](_0x496bf9['query']);_0x4dda7c[_0x6cc9('0x2f')]=_[_0x6cc9('0x30')](_0x4dda7c[_0x6cc9('0x2d')],_0x4dda7c[_0x6cc9('0x27')]);_0xfb4416[_0x6cc9('0x31')]=_[_0x6cc9('0x30')](_0x4dda7c[_0x6cc9('0x2d')],qs[_0x6cc9('0x32')](_0x496bf9['query'][_0x6cc9('0x32')]));_0xfb4416[_0x6cc9('0x31')]=_0xfb4416[_0x6cc9('0x31')][_0x6cc9('0x33')]?_0xfb4416[_0x6cc9('0x31')]:_0x4dda7c[_0x6cc9('0x2d')];_0xfb4416[_0x6cc9('0x50')]=qs[_0x6cc9('0x44')](_0x496bf9[_0x6cc9('0x27')][_0x6cc9('0x44')]);_0xfb4416[_0x6cc9('0x25')]=qs[_0x6cc9('0x2f')](_[_0x6cc9('0x51')](_0x496bf9[_0x6cc9('0x27')],_0x4dda7c[_0x6cc9('0x2f')]));if(_0x496bf9[_0x6cc9('0x27')][_0x6cc9('0x52')]){_0xfb4416[_0x6cc9('0x25')]=_['merge'](_0xfb4416[_0x6cc9('0x25')],{'$or':_[_0x6cc9('0x46')](_0xfb4416[_0x6cc9('0x31')],function(_0x3226c8){var _0x430c01={};_0x430c01[_0x3226c8]={'$like':'%'+_0x496bf9['query'][_0x6cc9('0x52')]+'%'};return _0x430c01;})});}_0xfb4416=_[_0x6cc9('0x34')]({},_0xfb4416,_0x496bf9['options']);return _0x4a6739[_0x6cc9('0x4f')](_0xfb4416);}})['then'](function(_0x5ce13f){if(_0x5ce13f){_0x25422d=_0x5ce13f['length'];if(!_0x496bf9[_0x6cc9('0x27')][_0x6cc9('0x42')]('nolimit')){_0xfb4416[_0x6cc9('0x10')]=qs[_0x6cc9('0x10')](_0x496bf9[_0x6cc9('0x27')][_0x6cc9('0x10')]);_0xfb4416[_0x6cc9('0x11')]=qs['offset'](_0x496bf9['query'][_0x6cc9('0x11')]);}return _0x4a6739[_0x6cc9('0x4f')](_0xfb4416);}})['then'](function(_0x557abe){if(_0x557abe){return _0x557abe?{'count':_0x25422d,'rows':_0x557abe}:null;}})[_0x6cc9('0x16')](respondWithResult(_0x2cc7d7,null))['catch'](handleError(_0x2cc7d7,null));};exports[_0x6cc9('0x53')]=function(_0x1311dd,_0x5788d2){var _0x2df9c=_0x1311dd[_0x6cc9('0x38')][_0x6cc9('0x54')];return db['Team'][_0x6cc9('0x28')]({'where':{'id':_0x2df9c},'attributes':['id'],'include':[{'model':db[_0x6cc9('0x47')],'as':_0x6cc9('0x55'),'attributes':['id',_0x6cc9('0x1d'),_0x6cc9('0x56'),_0x6cc9('0x57'),_0x6cc9('0x58')],'raw':!![]}]})[_0x6cc9('0x16')](function(_0xe99e95){if(_0xe99e95){var _0x64fe4e=_[_0x6cc9('0x59')](_0xe99e95,function(_0x3d13a8){var _0x3a6ac2=_0x3d13a8['get']({'plain':!![]});return _0x3a6ac2[_0x6cc9('0x55')];});return db[_0x6cc9('0x20')][_0x6cc9('0x36')]({'where':{'id':_0x1311dd[_0x6cc9('0x2c')]['id']}})[_0x6cc9('0x16')](function(_0x463022){return db['sequelize']['transaction'](function(_0x1fd384){return _0x463022[_0x6cc9('0x53')](_0x2df9c,{'transaction':_0x1fd384})[_0x6cc9('0x16')](function(){return BPromise[_0x6cc9('0x5a')](_0x64fe4e,function(_0x13ea98){return db['UserOpenchannelQueue'][_0x6cc9('0x5b')]({'where':{'UserId':_0x13ea98['id'],'OpenchannelQueueId':_0x1311dd['params']['id']},'transaction':_0x1fd384});});})['then'](function(){_0x64fe4e['forEach'](function(_0x148089){socket[_0x6cc9('0x5c')](_0x6cc9('0x5d'),{'UserId':_0x148089['id'],'OpenchannelQueueId':_0x463022['id']});});});});});}})['then'](respondWithStatusCode(_0x5788d2,null))['catch'](handleError(_0x5788d2,null));};exports[_0x6cc9('0x5e')]=function(_0x111c58,_0x77e91e){return db['Team'][_0x6cc9('0x28')]({'where':{'id':_0x111c58[_0x6cc9('0x27')][_0x6cc9('0x54')]},'attributes':['id'],'include':[{'model':db[_0x6cc9('0x47')],'as':_0x6cc9('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x77e91e,null))[_0x6cc9('0x16')](function(_0x4ea60e){var _0x47a506=_[_0x6cc9('0x46')](_0x4ea60e,'id');var _0x4dce12=[];var _0x1f2647=[];var _0x2a5f01=squel['select']();_0x2a5f01[_0x6cc9('0x5f')]('tq.TeamId')[_0x6cc9('0x60')](_0x6cc9('0x61'),'tq')[_0x6cc9('0x62')](_0x6cc9('0x63'),'ut',_0x6cc9('0x64'))[_0x6cc9('0x25')]('OpenchannelQueueId\x20=\x20?',_0x111c58[_0x6cc9('0x2c')]['id']);for(var _0x11cb24=0x0;_0x11cb24<_0x4ea60e[_0x6cc9('0x33')];_0x11cb24+=0x1){let _0x48a8e4=_0x4ea60e[_0x11cb24];for(var _0x51a963=0x0;_0x51a963<_0x48a8e4[_0x6cc9('0x55')][_0x6cc9('0x33')];_0x51a963+=0x1){let _0x13e380=_0x48a8e4[_0x6cc9('0x55')][_0x51a963];var _0x52c027=_0x2a5f01['clone']();_0x52c027[_0x6cc9('0x25')](_0x6cc9('0x65'),_0x13e380['id']);_0x1f2647[_0x6cc9('0x66')](db['sequelize'][_0x6cc9('0x27')](_0x52c027['toString'](),{'type':db['sequelize'][_0x6cc9('0x67')][_0x6cc9('0x68')]})[_0x6cc9('0x16')](function(_0x4fded8){if(_0x4fded8[_0x6cc9('0x33')]===0x1){return _0x13e380['id'];}else{var _0x52deac=_[_0x6cc9('0x69')](_[_0x6cc9('0x46')](_0x4fded8,'TeamId'),function(_0x4f0ec2){return _[_0x6cc9('0x6a')](_0x47a506,_0x4f0ec2);});if(_0x52deac){return _0x13e380['id'];}}}));}}return BPromise[_0x6cc9('0x6b')](_0x1f2647)[_0x6cc9('0x16')](function(_0x1f4a7e){_0x4dce12=_(_0x4dce12)[_0x6cc9('0x6c')](_0x1f4a7e)[_0x6cc9('0x6d')]()[_0x6cc9('0x6e')]();return db[_0x6cc9('0x20')][_0x6cc9('0x36')]({'where':{'id':_0x111c58[_0x6cc9('0x2c')]['id']}})[_0x6cc9('0x16')](function(_0x3d5b59){return db[_0x6cc9('0x6f')]['transaction'](function(_0x296f69){return _0x3d5b59[_0x6cc9('0x5e')](_0x111c58[_0x6cc9('0x27')][_0x6cc9('0x54')],{'transaction':_0x296f69})['then'](function(){if(!_[_0x6cc9('0x70')](_0x4dce12)){return _0x3d5b59[_0x6cc9('0x71')](_0x4dce12,{'transaction':_0x296f69});}})['then'](function(){_0x4dce12[_0x6cc9('0x72')](function(_0x13a6e3){socket[_0x6cc9('0x5c')]('userOpenchannelQueue:remove',{'UserId':_0x13a6e3,'OpenchannelQueueId':_0x3d5b59['id']});});});});});});})['then'](respondWithStatusCode(_0x77e91e,null))['catch'](handleError(_0x77e91e,null));};exports[_0x6cc9('0x73')]=function(_0x426af6,_0x2c8af7){return db[_0x6cc9('0x20')][_0x6cc9('0x36')]({'where':{'id':_0x426af6[_0x6cc9('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2c8af7,null))[_0x6cc9('0x16')](function(_0xf9ecd0){if(_0xf9ecd0){return _0xf9ecd0[_0x6cc9('0x73')](_0x426af6['body'][_0x6cc9('0x54')],_[_0x6cc9('0x74')](_0x426af6[_0x6cc9('0x38')],['ids','id'])||{})[_0x6cc9('0x75')](function(_0x506f93){for(var _0x3bfe64=0x0;_0x3bfe64<_0x426af6[_0x6cc9('0x38')][_0x6cc9('0x54')][_0x6cc9('0x33')];_0x3bfe64+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x426af6[_0x6cc9('0x38')][_0x6cc9('0x54')][_0x3bfe64]),'OpenchannelQueueId':Number(_0x426af6[_0x6cc9('0x2c')]['id'])});}return _0x506f93;});}})[_0x6cc9('0x16')](respondWithResult(_0x2c8af7,null))[_0x6cc9('0x2a')](handleError(_0x2c8af7,null));};exports[_0x6cc9('0x71')]=function(_0x2e30a1,_0x23f620){return db[_0x6cc9('0x20')][_0x6cc9('0x36')]({'where':{'id':_0x2e30a1['params']['id']}})[_0x6cc9('0x16')](handleEntityNotFound(_0x23f620,null))[_0x6cc9('0x16')](function(_0x15372a){if(_0x15372a){return _0x15372a[_0x6cc9('0x71')](_0x2e30a1[_0x6cc9('0x27')][_0x6cc9('0x54')])[_0x6cc9('0x16')](function(){if(_[_0x6cc9('0x76')](_0x2e30a1[_0x6cc9('0x27')][_0x6cc9('0x54')])){for(var _0x5410a7=0x0;_0x5410a7<_0x2e30a1[_0x6cc9('0x27')][_0x6cc9('0x54')][_0x6cc9('0x33')];_0x5410a7+=0x1){socket[_0x6cc9('0x5c')](_0x6cc9('0x77'),{'UserId':Number(_0x2e30a1[_0x6cc9('0x27')]['ids'][_0x5410a7]),'OpenchannelQueueId':Number(_0x2e30a1[_0x6cc9('0x2c')]['id'])});}}else{socket['emit'](_0x6cc9('0x77'),{'UserId':Number(_0x2e30a1[_0x6cc9('0x27')]['ids']),'OpenchannelQueueId':Number(_0x2e30a1['params']['id'])});}});}})[_0x6cc9('0x16')](respondWithStatusCode(_0x23f620,null))[_0x6cc9('0x2a')](handleError(_0x23f620,null));};exports['getAgents']=function(_0x3f50d3,_0x2b1e2b){var _0xe004b6={};var _0x546d4d={};var _0x57d1a0;var _0x38d02a;return db[_0x6cc9('0x20')][_0x6cc9('0x40')]({'where':{'id':_0x3f50d3[_0x6cc9('0x2c')]['id']}})[_0x6cc9('0x16')](handleEntityNotFound(_0x2b1e2b,null))[_0x6cc9('0x16')](function(_0x4efbe1){if(_0x4efbe1){_0x57d1a0=_0x4efbe1;_0x546d4d[_0x6cc9('0x2d')]=_[_0x6cc9('0x2e')](db[_0x6cc9('0x47')][_0x6cc9('0x21')]);_0x546d4d['query']=_[_0x6cc9('0x2e')](_0x3f50d3[_0x6cc9('0x27')]);_0x546d4d['filters']=_[_0x6cc9('0x30')](_0x546d4d[_0x6cc9('0x2d')],_0x546d4d[_0x6cc9('0x27')]);_0xe004b6[_0x6cc9('0x31')]=_[_0x6cc9('0x30')](_0x546d4d[_0x6cc9('0x2d')],qs[_0x6cc9('0x32')](_0x3f50d3['query'][_0x6cc9('0x32')]));_0xe004b6[_0x6cc9('0x31')]=_0xe004b6[_0x6cc9('0x31')]['length']?_0xe004b6[_0x6cc9('0x31')]:_0x546d4d[_0x6cc9('0x2d')];_0xe004b6[_0x6cc9('0x50')]=qs[_0x6cc9('0x44')](_0x3f50d3[_0x6cc9('0x27')][_0x6cc9('0x44')]);_0xe004b6[_0x6cc9('0x25')]=qs[_0x6cc9('0x2f')](_[_0x6cc9('0x51')](_0x3f50d3['query'],_0x546d4d[_0x6cc9('0x2f')]));if(_0x3f50d3[_0x6cc9('0x27')][_0x6cc9('0x52')]){_0xe004b6[_0x6cc9('0x25')]=_[_0x6cc9('0x34')](_0xe004b6['where'],{'$or':_[_0x6cc9('0x46')](_0xe004b6['attributes'],function(_0x1551b0){var _0x2fcbd1={};_0x2fcbd1[_0x1551b0]={'$like':'%'+_0x3f50d3[_0x6cc9('0x27')]['filter']+'%'};return _0x2fcbd1;})});}_0xe004b6=_['merge']({},_0xe004b6,_0x3f50d3[_0x6cc9('0x35')]);return _0x57d1a0[_0x6cc9('0x78')](_0xe004b6);}})[_0x6cc9('0x16')](function(_0xf17e3e){if(_0xf17e3e){_0x38d02a=_0xf17e3e['length'];if(!_0x3f50d3['query']['hasOwnProperty'](_0x6cc9('0x43'))){_0xe004b6[_0x6cc9('0x10')]=qs[_0x6cc9('0x10')](_0x3f50d3[_0x6cc9('0x27')]['limit']);_0xe004b6['offset']=qs['offset'](_0x3f50d3[_0x6cc9('0x27')][_0x6cc9('0x11')]);}return _0x57d1a0[_0x6cc9('0x78')](_0xe004b6);}})[_0x6cc9('0x16')](function(_0x356bb2){if(_0x356bb2){return _0x356bb2?{'count':_0x38d02a,'rows':_0x356bb2}:null;}})[_0x6cc9('0x16')](respondWithResult(_0x2b1e2b,null))[_0x6cc9('0x2a')](handleError(_0x2b1e2b,null));}; \ No newline at end of file +var _0x1972=['sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','getOptions','where','OpenchannelQueue','include','query','findAll','rows','catch','show','model','keys','filters','intersection','fields','length','attributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','filter','merge','User','findAndCountAll','map','agent','openchannelPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','Agents','online','interface','flatMap','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push'];(function(_0x52676f,_0x3e49f4){var _0xde9067=function(_0x43f61b){while(--_0x43f61b){_0x52676f['push'](_0x52676f['shift']());}};_0xde9067(++_0x3e49f4);}(_0x1972,0x94));var _0x2197=function(_0x1f0334,_0xa8ce05){_0x1f0334=_0x1f0334-0x0;var _0x3a7be8=_0x1972[_0x1f0334];return _0x3a7be8;};'use strict';var BPromise=require(_0x2197('0x0'));var util=require(_0x2197('0x1'));var _=require(_0x2197('0x2'));var squel=require(_0x2197('0x3'));var Redis=require(_0x2197('0x4'));var qs=require(_0x2197('0x5'));var logger=require(_0x2197('0x6'))('api');var config=require(_0x2197('0x7'));var db=require(_0x2197('0x8'))['db'];config[_0x2197('0x9')]=_[_0x2197('0xa')](config['redis'],{'host':_0x2197('0xb'),'port':0x18eb});var socket=require(_0x2197('0xc'))(new Redis(config['redis']));require(_0x2197('0xd'))['register'](socket);function respondWithStatusCode(_0x1c5af6,_0x47ad74){_0x47ad74=_0x47ad74||0xcc;return function(_0x5e322d){if(_0x5e322d){return _0x1c5af6[_0x2197('0xe')](_0x47ad74);}return _0x1c5af6[_0x2197('0xf')](_0x47ad74)[_0x2197('0x10')]();};}function respondWithResult(_0x36fb68,_0x1a31a1){_0x1a31a1=_0x1a31a1||0xc8;return function(_0x1b4154){if(_0x1b4154){return _0x36fb68[_0x2197('0xf')](_0x1a31a1)[_0x2197('0x11')](_0x1b4154);}};}function respondWithFilteredResult(_0x47057d,_0x20582a){return function(_0x45fb0e){if(_0x45fb0e){var _0x4c6f2b=typeof _0x20582a[_0x2197('0x12')]==='undefined'&&typeof _0x20582a['limit']===_0x2197('0x13');var _0xe1154b=_0x45fb0e[_0x2197('0x14')];var _0x1669b8=_0x4c6f2b?0x0:_0x20582a[_0x2197('0x12')];var _0x45bb3f=_0x4c6f2b?_0x45fb0e[_0x2197('0x14')]:_0x20582a[_0x2197('0x12')]+_0x20582a[_0x2197('0x15')];var _0x4ef1ef;if(_0x45bb3f>=_0xe1154b){_0x45bb3f=_0xe1154b;_0x4ef1ef=0xc8;}else{_0x4ef1ef=0xce;}_0x47057d['status'](_0x4ef1ef);return _0x47057d[_0x2197('0x16')]('Content-Range',_0x1669b8+'-'+_0x45bb3f+'/'+_0xe1154b)[_0x2197('0x11')](_0x45fb0e);}return null;};}function saveUpdates(_0x5518e8){return function(_0x338a2a){if(_0x338a2a){return _0x338a2a[_0x2197('0x17')](_0x5518e8)[_0x2197('0x18')](function(_0x18f845){return _0x18f845;});}return null;};}function removeEntity(_0x245bfa){return function(_0x424507){if(_0x424507){return _0x424507[_0x2197('0x19')]()[_0x2197('0x18')](function(){var _0x154637=_0x424507[_0x2197('0x1a')]({'plain':!![]});var _0x48e384=_0x2197('0x1b');return db[_0x2197('0x1c')][_0x2197('0x19')]({'where':{'type':_0x48e384,'resourceId':_0x154637['id']}})[_0x2197('0x18')](function(){return _0x424507;});})['then'](function(){_0x245bfa[_0x2197('0xf')](0xcc)[_0x2197('0x10')]();});}};}function handleEntityNotFound(_0x2a7724){return function(_0x52881){if(!_0x52881){_0x2a7724[_0x2197('0xe')](0x194);}return _0x52881;};}function handleError(_0x2eb94a,_0x46d1fd){_0x46d1fd=_0x46d1fd||0x1f4;return function(_0x5597b8){logger[_0x2197('0x1d')](_0x5597b8[_0x2197('0x1e')]);if(_0x5597b8[_0x2197('0x1f')]){delete _0x5597b8[_0x2197('0x1f')];}_0x2eb94a['status'](_0x46d1fd)[_0x2197('0x20')](_0x5597b8);};}exports['index']=function(_0x215891,_0x4e0734){var _0x26b842={};var _0x46caaf={'count':0x0,'rows':[]};var _0x2e5c28=_['map'](db['OpenchannelQueue'][_0x2197('0x21')],function(_0x42cdce){return{'name':_0x42cdce[_0x2197('0x22')],'type':_0x42cdce[_0x2197('0x23')]['key']};});_0x26b842=qs[_0x2197('0x24')](_0x2e5c28,_0x215891);var _0x5a62bd={'where':_0x26b842[_0x2197('0x25')]};return db[_0x2197('0x26')][_0x2197('0x14')](_0x5a62bd)[_0x2197('0x18')](function(_0xf8cead){_0x46caaf[_0x2197('0x14')]=_0xf8cead;_0x26b842[_0x2197('0x27')]=qs[_0x2197('0x27')](_0x215891[_0x2197('0x28')]);return db[_0x2197('0x26')][_0x2197('0x29')](_0x26b842);})['then'](function(_0x29cdb2){_0x46caaf[_0x2197('0x2a')]=_0x29cdb2;return _0x46caaf;})['then'](respondWithFilteredResult(_0x4e0734,_0x26b842))[_0x2197('0x2b')](handleError(_0x4e0734,null));};exports[_0x2197('0x2c')]=function(_0x29cbef,_0x3b7a75){var _0x35bcbd={'raw':!![],'where':{'id':_0x29cbef['params']['id']}},_0x3a78e8={};_0x3a78e8[_0x2197('0x2d')]=_[_0x2197('0x2e')](db['OpenchannelQueue'][_0x2197('0x21')]);_0x3a78e8['query']=_[_0x2197('0x2e')](_0x29cbef[_0x2197('0x28')]);_0x3a78e8[_0x2197('0x2f')]=_['intersection'](_0x3a78e8[_0x2197('0x2d')],_0x3a78e8[_0x2197('0x28')]);_0x35bcbd['attributes']=_[_0x2197('0x30')](_0x3a78e8[_0x2197('0x2d')],qs[_0x2197('0x31')](_0x29cbef['query'][_0x2197('0x31')]));_0x35bcbd['attributes']=_0x35bcbd['attributes'][_0x2197('0x32')]?_0x35bcbd[_0x2197('0x33')]:_0x3a78e8[_0x2197('0x2d')];if(_0x29cbef[_0x2197('0x28')][_0x2197('0x34')]){_0x35bcbd['include']=[{'all':!![]}];}_0x35bcbd=_['merge']({},_0x35bcbd,_0x29cbef[_0x2197('0x35')]);return db['OpenchannelQueue'][_0x2197('0x36')](_0x35bcbd)['then'](handleEntityNotFound(_0x3b7a75,null))[_0x2197('0x18')](respondWithResult(_0x3b7a75,null))['catch'](handleError(_0x3b7a75,null));};exports[_0x2197('0x37')]=function(_0x170bbe,_0x39b9ae){return db[_0x2197('0x26')][_0x2197('0x37')](_0x170bbe[_0x2197('0x38')],{})[_0x2197('0x18')](function(_0x3e382a){var _0x2e0526=_0x170bbe[_0x2197('0x39')]['get']({'plain':!![]});if(!_0x2e0526)throw new Error(_0x2197('0x3a'));if(_0x2e0526[_0x2197('0x3b')]===_0x2197('0x39')){var _0x377fda=_0x3e382a[_0x2197('0x1a')]({'plain':!![]});var _0x4fa563=_0x2197('0x1b');return db[_0x2197('0x3c')][_0x2197('0x36')]({'where':{'name':_0x4fa563,'userProfileId':_0x2e0526['userProfileId']},'raw':!![]})[_0x2197('0x18')](function(_0x16766c){if(_0x16766c&&_0x16766c['autoAssociation']===0x0){return db[_0x2197('0x1c')][_0x2197('0x37')]({'name':_0x377fda[_0x2197('0x1f')],'resourceId':_0x377fda['id'],'type':_0x16766c['name'],'sectionId':_0x16766c['id']},{})[_0x2197('0x18')](function(){return _0x3e382a;});}else{return _0x3e382a;}})[_0x2197('0x2b')](function(_0x481847){logger[_0x2197('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x481847);throw _0x481847;});}return _0x3e382a;})[_0x2197('0x18')](respondWithResult(_0x39b9ae,0xc9))[_0x2197('0x2b')](handleError(_0x39b9ae,null));};exports[_0x2197('0x17')]=function(_0x30da70,_0x44834c){if(_0x30da70['body']['id']){delete _0x30da70[_0x2197('0x38')]['id'];}return db['OpenchannelQueue'][_0x2197('0x36')]({'where':{'id':_0x30da70[_0x2197('0x3d')]['id']}})[_0x2197('0x18')](handleEntityNotFound(_0x44834c,null))[_0x2197('0x18')](saveUpdates(_0x30da70[_0x2197('0x38')],null))[_0x2197('0x18')](respondWithResult(_0x44834c,null))[_0x2197('0x2b')](handleError(_0x44834c,null));};exports['destroy']=function(_0x4d01fd,_0x32494c){return db['OpenchannelQueue'][_0x2197('0x36')]({'where':{'id':_0x4d01fd['params']['id']}})[_0x2197('0x18')](handleEntityNotFound(_0x32494c,null))[_0x2197('0x18')](removeEntity(_0x32494c,null))[_0x2197('0x2b')](handleError(_0x32494c,null));};exports[_0x2197('0x3e')]=function(_0xc10a43,_0x17f576){return db[_0x2197('0x26')][_0x2197('0x3e')]()[_0x2197('0x18')](respondWithResult(_0x17f576,null))[_0x2197('0x2b')](handleError(_0x17f576,null));};exports[_0x2197('0x3f')]=function(_0x160293,_0x42423d){var _0x524f5b={'raw':!![],'where':{}},_0xc492e9={},_0x550df6;return db[_0x2197('0x26')][_0x2197('0x40')]({'where':{'id':_0x160293[_0x2197('0x3d')]['id']}})['then'](handleEntityNotFound(_0x42423d,null))['then'](function(_0x524bf8){if(_0x524bf8){_0x550df6=_0x524bf8[_0x2197('0x1a')]({'plain':!![]});_0xc492e9[_0x2197('0x2d')]=_[_0x2197('0x2e')](db[_0x2197('0x41')][_0x2197('0x21')]);_0xc492e9[_0x2197('0x28')]=_[_0x2197('0x2e')](_0x160293[_0x2197('0x28')]);_0xc492e9['filters']=_[_0x2197('0x30')](_0xc492e9[_0x2197('0x2d')],_0xc492e9[_0x2197('0x28')]);_0x524f5b[_0x2197('0x33')]=_[_0x2197('0x30')](_0xc492e9[_0x2197('0x2d')],qs['fields'](_0x160293[_0x2197('0x28')]['fields']));_0x524f5b[_0x2197('0x33')]=_0x524f5b[_0x2197('0x33')][_0x2197('0x32')]?_0x524f5b[_0x2197('0x33')]:_0xc492e9[_0x2197('0x2d')];if(!_0x160293['query'][_0x2197('0x42')](_0x2197('0x43'))){_0x524f5b['limit']=qs['limit'](_0x160293['query'][_0x2197('0x15')]);_0x524f5b[_0x2197('0x12')]=qs[_0x2197('0x12')](_0x160293[_0x2197('0x28')][_0x2197('0x12')]);}_0x524f5b[_0x2197('0x44')]=qs[_0x2197('0x45')](_0x160293[_0x2197('0x28')][_0x2197('0x45')]);_0x524f5b[_0x2197('0x25')]=qs[_0x2197('0x2f')](_[_0x2197('0x46')](_0x160293[_0x2197('0x28')],_0xc492e9[_0x2197('0x2f')]));_0x524f5b[_0x2197('0x25')][_0x2197('0x47')]=_0x524bf8['id'];if(_0x160293[_0x2197('0x28')][_0x2197('0x48')]){_0x524f5b[_0x2197('0x25')]=_[_0x2197('0x49')](_0x524f5b[_0x2197('0x25')],{'$or':_['map'](_0x524f5b['attributes'],function(_0x2f4c13){var _0x4f1f23={};_0x4f1f23[_0x2f4c13]={'$like':'%'+_0x160293[_0x2197('0x28')][_0x2197('0x48')]+'%'};return _0x4f1f23;})});}_0x524f5b=_['merge']({},_0x524f5b,_0x160293[_0x2197('0x35')]);return db[_0x2197('0x41')]['findAll'](_0x524f5b);}})[_0x2197('0x18')](function(_0x458186){if(_0x458186){return db[_0x2197('0x4a')][_0x2197('0x4b')]({'where':{'id':_[_0x2197('0x4c')](_0x458186,'UserId'),'role':_0x2197('0x4d')},'attributes':['id',_0x2197('0x1f'),_0x2197('0x4e'),_0x2197('0x4f'),'createdAt']});}})[_0x2197('0x18')](function(_0x545a78){if(_0x545a78){return{'count':_0x545a78[_0x2197('0x14')],'rows':_[_0x2197('0x4c')](_0x545a78[_0x2197('0x2a')],function(_0x2fb4bc){return{'membername':_0x2fb4bc[_0x2197('0x1f')],'UserId':_0x2fb4bc['id'],'queue_name':_0x550df6['name'],'OpenchannelQueueId':_0x550df6['id'],'interface':util[_0x2197('0x50')]('%s/%s',_0x2197('0x51'),_0x2fb4bc[_0x2197('0x1f')]),'penalty':0x0,'paused':_0x2fb4bc['openchannelPause'],'createdAt':_0x2fb4bc[_0x2197('0x52')],'updatedAt':_0x2fb4bc[_0x2197('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2197('0x18')](respondWithFilteredResult(_0x42423d,_0x524f5b))[_0x2197('0x2b')](handleError(_0x42423d,null));};exports[_0x2197('0x53')]=function(_0x12dc92,_0x574c8a){var _0x7f9e2c={};var _0x276573={};var _0x2644f8;var _0xc3f3c;return db[_0x2197('0x26')][_0x2197('0x40')]({'where':{'id':_0x12dc92[_0x2197('0x3d')]['id']}})[_0x2197('0x18')](handleEntityNotFound(_0x574c8a,null))['then'](function(_0x43c66f){if(_0x43c66f){_0x2644f8=_0x43c66f;_0x276573[_0x2197('0x2d')]=_[_0x2197('0x2e')](db[_0x2197('0x54')][_0x2197('0x21')]);_0x276573['query']=_['keys'](_0x12dc92['query']);_0x276573[_0x2197('0x2f')]=_[_0x2197('0x30')](_0x276573[_0x2197('0x2d')],_0x276573['query']);_0x7f9e2c[_0x2197('0x33')]=_['intersection'](_0x276573['model'],qs[_0x2197('0x31')](_0x12dc92[_0x2197('0x28')][_0x2197('0x31')]));_0x7f9e2c['attributes']=_0x7f9e2c[_0x2197('0x33')][_0x2197('0x32')]?_0x7f9e2c[_0x2197('0x33')]:_0x276573[_0x2197('0x2d')];_0x7f9e2c[_0x2197('0x44')]=qs[_0x2197('0x45')](_0x12dc92[_0x2197('0x28')]['sort']);_0x7f9e2c['where']=qs['filters'](_[_0x2197('0x46')](_0x12dc92['query'],_0x276573[_0x2197('0x2f')]));if(_0x12dc92[_0x2197('0x28')][_0x2197('0x48')]){_0x7f9e2c[_0x2197('0x25')]=_[_0x2197('0x49')](_0x7f9e2c[_0x2197('0x25')],{'$or':_[_0x2197('0x4c')](_0x7f9e2c[_0x2197('0x33')],function(_0xea170){var _0x16a844={};_0x16a844[_0xea170]={'$like':'%'+_0x12dc92['query'][_0x2197('0x48')]+'%'};return _0x16a844;})});}_0x7f9e2c=_['merge']({},_0x7f9e2c,_0x12dc92[_0x2197('0x35')]);return _0x2644f8[_0x2197('0x53')](_0x7f9e2c);}})[_0x2197('0x18')](function(_0x5471eb){if(_0x5471eb){_0xc3f3c=_0x5471eb[_0x2197('0x32')];if(!_0x12dc92[_0x2197('0x28')]['hasOwnProperty'](_0x2197('0x43'))){_0x7f9e2c[_0x2197('0x15')]=qs[_0x2197('0x15')](_0x12dc92[_0x2197('0x28')][_0x2197('0x15')]);_0x7f9e2c['offset']=qs['offset'](_0x12dc92['query'][_0x2197('0x12')]);}return _0x2644f8[_0x2197('0x53')](_0x7f9e2c);}})[_0x2197('0x18')](function(_0xbcfb24){if(_0xbcfb24){return _0xbcfb24?{'count':_0xc3f3c,'rows':_0xbcfb24}:null;}})[_0x2197('0x18')](respondWithResult(_0x574c8a,null))['catch'](handleError(_0x574c8a,null));};exports[_0x2197('0x55')]=function(_0x38f76e,_0x44473a){var _0x372f1e=_0x38f76e[_0x2197('0x38')]['ids'];return db[_0x2197('0x54')][_0x2197('0x29')]({'where':{'id':_0x372f1e},'attributes':['id'],'include':[{'model':db[_0x2197('0x4a')],'as':_0x2197('0x56'),'attributes':['id',_0x2197('0x1f'),_0x2197('0x57'),'voicePause',_0x2197('0x58')],'raw':!![]}]})[_0x2197('0x18')](function(_0x2c6e5){if(_0x2c6e5){var _0x5c23d4=_[_0x2197('0x59')](_0x2c6e5,function(_0x48d77b){var _0x21e827=_0x48d77b[_0x2197('0x1a')]({'plain':!![]});return _0x21e827[_0x2197('0x56')];});return db[_0x2197('0x26')][_0x2197('0x36')]({'where':{'id':_0x38f76e[_0x2197('0x3d')]['id']}})[_0x2197('0x18')](function(_0x4f4310){return db['sequelize']['transaction'](function(_0x5c09ab){return _0x4f4310[_0x2197('0x55')](_0x372f1e,{'transaction':_0x5c09ab})[_0x2197('0x18')](function(){return BPromise[_0x2197('0x5a')](_0x5c23d4,function(_0x433ec7){return db[_0x2197('0x41')][_0x2197('0x5b')]({'where':{'UserId':_0x433ec7['id'],'OpenchannelQueueId':_0x38f76e[_0x2197('0x3d')]['id']},'transaction':_0x5c09ab});});})['then'](function(){_0x5c23d4[_0x2197('0x5c')](function(_0xe124b4){socket['emit'](_0x2197('0x5d'),{'UserId':_0xe124b4['id'],'OpenchannelQueueId':_0x4f4310['id']});});});});});}})[_0x2197('0x18')](respondWithStatusCode(_0x44473a,null))[_0x2197('0x2b')](handleError(_0x44473a,null));};exports[_0x2197('0x5e')]=function(_0x391028,_0x3a727f){return db['Team'][_0x2197('0x29')]({'where':{'id':_0x391028[_0x2197('0x28')][_0x2197('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x2197('0x4a')],'as':_0x2197('0x56'),'attributes':['id'],'raw':!![]}]})[_0x2197('0x18')](handleEntityNotFound(_0x3a727f,null))['then'](function(_0x205efb){var _0x2dd135=_[_0x2197('0x4c')](_0x205efb,'id');var _0x3ec390=[];var _0x32ee9b=[];var _0x26feea=squel[_0x2197('0x60')]();_0x26feea[_0x2197('0x61')](_0x2197('0x62'))['from'](_0x2197('0x63'),'tq')[_0x2197('0x64')](_0x2197('0x65'),'ut',_0x2197('0x66'))[_0x2197('0x25')](_0x2197('0x67'),_0x391028[_0x2197('0x3d')]['id']);for(var _0x51a2bc=0x0;_0x51a2bc<_0x205efb[_0x2197('0x32')];_0x51a2bc+=0x1){let _0x378d35=_0x205efb[_0x51a2bc];for(var _0x2dca80=0x0;_0x2dca80<_0x378d35[_0x2197('0x56')][_0x2197('0x32')];_0x2dca80+=0x1){let _0xe3943b=_0x378d35[_0x2197('0x56')][_0x2dca80];var _0x4c1ba9=_0x26feea[_0x2197('0x68')]();_0x4c1ba9[_0x2197('0x25')]('ut.UserId\x20=\x20?',_0xe3943b['id']);_0x32ee9b[_0x2197('0x69')](db[_0x2197('0x6a')][_0x2197('0x28')](_0x4c1ba9[_0x2197('0x6b')](),{'type':db[_0x2197('0x6a')][_0x2197('0x6c')][_0x2197('0x6d')]})[_0x2197('0x18')](function(_0x2a191e){if(_0x2a191e[_0x2197('0x32')]===0x1){return _0xe3943b['id'];}else{var _0x3810f9=_[_0x2197('0x6e')](_['map'](_0x2a191e,_0x2197('0x6f')),function(_0x4faab0){return _[_0x2197('0x70')](_0x2dd135,_0x4faab0);});if(_0x3810f9){return _0xe3943b['id'];}}}));}}return BPromise[_0x2197('0x71')](_0x32ee9b)['then'](function(_0x1c914d){_0x3ec390=_(_0x3ec390)[_0x2197('0x72')](_0x1c914d)[_0x2197('0x73')]()[_0x2197('0x74')]();return db[_0x2197('0x26')][_0x2197('0x36')]({'where':{'id':_0x391028[_0x2197('0x3d')]['id']}})[_0x2197('0x18')](function(_0x4ae41d){return db[_0x2197('0x6a')][_0x2197('0x75')](function(_0x5e1f3e){return _0x4ae41d[_0x2197('0x5e')](_0x391028[_0x2197('0x28')][_0x2197('0x5f')],{'transaction':_0x5e1f3e})[_0x2197('0x18')](function(){if(!_[_0x2197('0x76')](_0x3ec390)){return _0x4ae41d[_0x2197('0x77')](_0x3ec390,{'transaction':_0x5e1f3e});}})[_0x2197('0x18')](function(){_0x3ec390[_0x2197('0x5c')](function(_0x41ce7e){socket[_0x2197('0x78')](_0x2197('0x79'),{'UserId':_0x41ce7e,'OpenchannelQueueId':_0x4ae41d['id']});});});});});});})[_0x2197('0x18')](respondWithStatusCode(_0x3a727f,null))[_0x2197('0x2b')](handleError(_0x3a727f,null));};exports[_0x2197('0x7a')]=function(_0x4912b0,_0x27e884){return db[_0x2197('0x26')][_0x2197('0x36')]({'where':{'id':_0x4912b0[_0x2197('0x3d')]['id']}})[_0x2197('0x18')](handleEntityNotFound(_0x27e884,null))[_0x2197('0x18')](function(_0x1c64e1){if(_0x1c64e1){return _0x1c64e1[_0x2197('0x7a')](_0x4912b0[_0x2197('0x38')][_0x2197('0x5f')],_[_0x2197('0x7b')](_0x4912b0[_0x2197('0x38')],['ids','id'])||{})[_0x2197('0x7c')](function(_0x4f1cd6){for(var _0x3cbd9c=0x0;_0x3cbd9c<_0x4912b0['body'][_0x2197('0x5f')][_0x2197('0x32')];_0x3cbd9c+=0x1){socket[_0x2197('0x78')](_0x2197('0x5d'),{'UserId':Number(_0x4912b0[_0x2197('0x38')][_0x2197('0x5f')][_0x3cbd9c]),'OpenchannelQueueId':Number(_0x4912b0[_0x2197('0x3d')]['id'])});}return _0x4f1cd6;});}})['then'](respondWithResult(_0x27e884,null))[_0x2197('0x2b')](handleError(_0x27e884,null));};exports['removeAgents']=function(_0x531820,_0x519e87){return db[_0x2197('0x26')][_0x2197('0x36')]({'where':{'id':_0x531820['params']['id']}})[_0x2197('0x18')](handleEntityNotFound(_0x519e87,null))['then'](function(_0x2b9a49){if(_0x2b9a49){return _0x2b9a49[_0x2197('0x77')](_0x531820[_0x2197('0x28')]['ids'])['then'](function(){if(_[_0x2197('0x7d')](_0x531820['query'][_0x2197('0x5f')])){for(var _0x28fa7=0x0;_0x28fa7<_0x531820[_0x2197('0x28')][_0x2197('0x5f')]['length'];_0x28fa7+=0x1){socket[_0x2197('0x78')](_0x2197('0x79'),{'UserId':Number(_0x531820[_0x2197('0x28')]['ids'][_0x28fa7]),'OpenchannelQueueId':Number(_0x531820['params']['id'])});}}else{socket[_0x2197('0x78')](_0x2197('0x79'),{'UserId':Number(_0x531820[_0x2197('0x28')][_0x2197('0x5f')]),'OpenchannelQueueId':Number(_0x531820['params']['id'])});}});}})['then'](respondWithStatusCode(_0x519e87,null))[_0x2197('0x2b')](handleError(_0x519e87,null));};exports[_0x2197('0x7e')]=function(_0x30239a,_0x5e2b43){var _0x4bf893={};var _0xf4c89b={};var _0x40132b;var _0x41fa6b;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x30239a[_0x2197('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5e2b43,null))['then'](function(_0x143ba8){if(_0x143ba8){_0x40132b=_0x143ba8;_0xf4c89b[_0x2197('0x2d')]=_[_0x2197('0x2e')](db[_0x2197('0x4a')][_0x2197('0x21')]);_0xf4c89b[_0x2197('0x28')]=_[_0x2197('0x2e')](_0x30239a['query']);_0xf4c89b[_0x2197('0x2f')]=_[_0x2197('0x30')](_0xf4c89b['model'],_0xf4c89b[_0x2197('0x28')]);_0x4bf893[_0x2197('0x33')]=_[_0x2197('0x30')](_0xf4c89b[_0x2197('0x2d')],qs[_0x2197('0x31')](_0x30239a[_0x2197('0x28')]['fields']));_0x4bf893[_0x2197('0x33')]=_0x4bf893[_0x2197('0x33')][_0x2197('0x32')]?_0x4bf893[_0x2197('0x33')]:_0xf4c89b[_0x2197('0x2d')];_0x4bf893['order']=qs[_0x2197('0x45')](_0x30239a[_0x2197('0x28')][_0x2197('0x45')]);_0x4bf893[_0x2197('0x25')]=qs[_0x2197('0x2f')](_[_0x2197('0x46')](_0x30239a[_0x2197('0x28')],_0xf4c89b['filters']));if(_0x30239a[_0x2197('0x28')][_0x2197('0x48')]){_0x4bf893[_0x2197('0x25')]=_[_0x2197('0x49')](_0x4bf893[_0x2197('0x25')],{'$or':_[_0x2197('0x4c')](_0x4bf893[_0x2197('0x33')],function(_0x5c327d){var _0x14d78e={};_0x14d78e[_0x5c327d]={'$like':'%'+_0x30239a[_0x2197('0x28')]['filter']+'%'};return _0x14d78e;})});}_0x4bf893=_[_0x2197('0x49')]({},_0x4bf893,_0x30239a[_0x2197('0x35')]);return _0x40132b[_0x2197('0x7e')](_0x4bf893);}})['then'](function(_0x10b3de){if(_0x10b3de){_0x41fa6b=_0x10b3de[_0x2197('0x32')];if(!_0x30239a[_0x2197('0x28')][_0x2197('0x42')](_0x2197('0x43'))){_0x4bf893[_0x2197('0x15')]=qs[_0x2197('0x15')](_0x30239a[_0x2197('0x28')][_0x2197('0x15')]);_0x4bf893[_0x2197('0x12')]=qs[_0x2197('0x12')](_0x30239a[_0x2197('0x28')]['offset']);}return _0x40132b[_0x2197('0x7e')](_0x4bf893);}})['then'](function(_0x33a0c6){if(_0x33a0c6){return _0x33a0c6?{'count':_0x41fa6b,'rows':_0x33a0c6}:null;}})[_0x2197('0x18')](respondWithResult(_0x5e2b43,null))[_0x2197('0x2b')](handleError(_0x5e2b43,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 714f083..36cdb68 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 _0xbeff=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xbeff,0xf3));var _0xfbef=function(_0x465781,_0x3c3e57){_0x465781=_0x465781-0x0;var _0x931aaa=_0xbeff[_0x465781];return _0x931aaa;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xfbef('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfbef('0x1')](0x0);var events={'afterCreate':_0xfbef('0x2'),'afterUpdate':_0xfbef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x57ea88){return function(_0x148cf0,_0x10573e,_0x3aab46){OpenchannelQueueEvents[_0xfbef('0x4')](_0x57ea88+':'+_0x148cf0['id'],_0x148cf0);OpenchannelQueueEvents[_0xfbef('0x4')](_0x57ea88,_0x148cf0);_0x3aab46(null);};}for(var e in events){if(events[_0xfbef('0x5')](e)){var event=events[e];OpenchannelQueue[_0xfbef('0x6')](e,emitEvent(event));}}module[_0xfbef('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf6d2=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xf6d2,0xae));var _0x2f6d=function(_0x35b1fd,_0x52b7b2){_0x35b1fd=_0x35b1fd-0x0;var _0x420f50=_0xf6d2[_0x35b1fd];return _0x420f50;};'use strict';var EventEmitter=require(_0x2f6d('0x0'));var OpenchannelQueue=require(_0x2f6d('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2f6d('0x2')](0x0);var events={'afterCreate':_0x2f6d('0x3'),'afterUpdate':_0x2f6d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x114db3){return function(_0x1e3056,_0xa76c91,_0x4a6237){OpenchannelQueueEvents[_0x2f6d('0x5')](_0x114db3+':'+_0x1e3056['id'],_0x1e3056);OpenchannelQueueEvents['emit'](_0x114db3,_0x1e3056);_0x4a6237(null);};}for(var e in events){if(events[_0x2f6d('0x6')](e)){var event=events[e];OpenchannelQueue[_0x2f6d('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 792da4c..24eb948 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 _0xc907=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x29ef78,_0x39e227){var _0x45efe2=function(_0x2a42c4){while(--_0x2a42c4){_0x29ef78['push'](_0x29ef78['shift']());}};_0x45efe2(++_0x39e227);}(_0xc907,0x126));var _0x7c90=function(_0x47d966,_0x2db1f2){_0x47d966=_0x47d966-0x0;var _0x5e451b=_0xc907[_0x47d966];return _0x5e451b;};'use strict';var _=require(_0x7c90('0x0'));var util=require('util');var logger=require(_0x7c90('0x1'))(_0x7c90('0x2'));var moment=require(_0x7c90('0x3'));var BPromise=require(_0x7c90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c90('0x5'));var rimraf=require(_0x7c90('0x6'));var config=require(_0x7c90('0x7'));var attributes=require(_0x7c90('0x8'));module[_0x7c90('0x9')]=function(_0x15697b,_0xf2a618){return _0x15697b[_0x7c90('0xa')](_0x7c90('0xb'),attributes,{'tableName':_0x7c90('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42e4=['rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x16da00,_0x48b6b9){var _0x58ada7=function(_0x18d5b1){while(--_0x18d5b1){_0x16da00['push'](_0x16da00['shift']());}};_0x58ada7(++_0x48b6b9);}(_0x42e4,0x165));var _0x442e=function(_0x330cfa,_0x477ac5){_0x330cfa=_0x330cfa-0x0;var _0x3fe47e=_0x42e4[_0x330cfa];return _0x3fe47e;};'use strict';var _=require(_0x442e('0x0'));var util=require(_0x442e('0x1'));var logger=require(_0x442e('0x2'))(_0x442e('0x3'));var moment=require(_0x442e('0x4'));var BPromise=require(_0x442e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x442e('0x6'));var rimraf=require(_0x442e('0x7'));var config=require(_0x442e('0x8'));var attributes=require(_0x442e('0x9'));module['exports']=function(_0x3ce615,_0x67c81a){return _0x3ce615[_0x442e('0xa')](_0x442e('0xb'),attributes,{'tableName':_0x442e('0xc'),'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 52740bf..6cdff9c 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 _0xc2a6=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','options','raw','where','limit','include','map','attributes','model','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xc2a6,0x1ad));var _0x6c2a=function(_0xc638a8,_0x493da3){_0xc638a8=_0xc638a8-0x0;var _0x2c3516=_0xc2a6[_0xc638a8];return _0x2c3516;};'use strict';var _=require(_0x6c2a('0x0'));var util=require('util');var moment=require(_0x6c2a('0x1'));var BPromise=require(_0x6c2a('0x2'));var rs=require(_0x6c2a('0x3'));var fs=require('fs');var Redis=require(_0x6c2a('0x4'));var db=require(_0x6c2a('0x5'))['db'];var utils=require(_0x6c2a('0x6'));var logger=require(_0x6c2a('0x7'))(_0x6c2a('0x8'));var config=require('../../config/environment');var jayson=require(_0x6c2a('0x9'));var client=jayson['client'][_0x6c2a('0xa')]({'port':0x232a});config[_0x6c2a('0xb')]=_[_0x6c2a('0xc')](config[_0x6c2a('0xb')],{'host':_0x6c2a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c2a('0xb')]));require(_0x6c2a('0xe'))[_0x6c2a('0xf')](socket);function respondWithRpcPromise(_0x1e0662,_0x3bf665,_0x3e04be){return new BPromise(function(_0x17234,_0x37b0f3){return client[_0x6c2a('0x10')](_0x1e0662,_0x3e04be)[_0x6c2a('0x11')](function(_0x33b892){logger[_0x6c2a('0x12')](_0x6c2a('0x13'),_0x3bf665,_0x6c2a('0x14'));logger[_0x6c2a('0x15')](_0x6c2a('0x16'),_0x3bf665,'request\x20sent',JSON[_0x6c2a('0x17')](_0x33b892));if(_0x33b892[_0x6c2a('0x18')]){if(_0x33b892['error'][_0x6c2a('0x19')]===0x1f4){logger[_0x6c2a('0x18')](_0x6c2a('0x13'),_0x3bf665,_0x33b892['error'][_0x6c2a('0x1a')]);return _0x37b0f3(_0x33b892[_0x6c2a('0x18')]['message']);}logger['error'](_0x6c2a('0x13'),_0x3bf665,_0x33b892[_0x6c2a('0x18')][_0x6c2a('0x1a')]);return _0x17234(_0x33b892[_0x6c2a('0x18')][_0x6c2a('0x1a')]);}else{logger['info'](_0x6c2a('0x13'),_0x3bf665,'request\x20sent');_0x17234(_0x33b892[_0x6c2a('0x1b')][_0x6c2a('0x1a')]);}})[_0x6c2a('0x1c')](function(_0x4aec93){logger['error'](_0x6c2a('0x13'),_0x3bf665,_0x4aec93);_0x37b0f3(_0x4aec93);});});}exports[_0x6c2a('0x1d')]=function(_0x41f6fa){var _0x425b27=this;return new Promise(function(_0x30c158,_0x2de833){return db['OpenchannelQueue']['findAll']({'raw':_0x41f6fa['options']?_0x41f6fa[_0x6c2a('0x1e')][_0x6c2a('0x1f')]===undefined?!![]:![]:!![],'where':_0x41f6fa['options']?_0x41f6fa[_0x6c2a('0x1e')][_0x6c2a('0x20')]||null:null,'attributes':_0x41f6fa['options']?_0x41f6fa[_0x6c2a('0x1e')]['attributes']||null:null,'limit':_0x41f6fa[_0x6c2a('0x1e')]?_0x41f6fa[_0x6c2a('0x1e')][_0x6c2a('0x21')]||null:null,'include':_0x41f6fa['options']?_0x41f6fa[_0x6c2a('0x1e')][_0x6c2a('0x22')]?_[_0x6c2a('0x23')](_0x41f6fa['options'][_0x6c2a('0x22')],function(_0x18c28c){return{'model':db[_0x18c28c['model']],'as':_0x18c28c['as'],'attributes':_0x18c28c[_0x6c2a('0x24')],'include':_0x18c28c[_0x6c2a('0x22')]?_[_0x6c2a('0x23')](_0x18c28c[_0x6c2a('0x22')],function(_0x3a2717){return{'model':db[_0x3a2717[_0x6c2a('0x25')]],'as':_0x3a2717['as'],'attributes':_0x3a2717['attributes'],'include':_0x3a2717[_0x6c2a('0x22')]?_['map'](_0x3a2717[_0x6c2a('0x22')],function(_0x5865a4){return{'model':db[_0x5865a4[_0x6c2a('0x25')]],'as':_0x5865a4['as'],'attributes':_0x5865a4[_0x6c2a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6c2a('0x11')](function(_0x391974){logger[_0x6c2a('0x12')](_0x6c2a('0x1d'),_0x41f6fa);logger[_0x6c2a('0x15')](_0x6c2a('0x1d'),_0x41f6fa,JSON[_0x6c2a('0x17')](_0x391974));_0x30c158(_0x391974);})['catch'](function(_0x3b3548){logger[_0x6c2a('0x18')]('GetOpenchannelQueue',_0x3b3548[_0x6c2a('0x1a')],_0x41f6fa);_0x2de833(_0x425b27['error'](0x1f4,_0x3b3548[_0x6c2a('0x1a')]));});});};exports[_0x6c2a('0x26')]=function(_0x1dd6cb){var _0xa66ee0=this;return new Promise(function(_0x12a431,_0x31e5fe){return db[_0x6c2a('0x27')][_0x6c2a('0x28')]({'raw':_0x1dd6cb[_0x6c2a('0x1e')]?_0x1dd6cb[_0x6c2a('0x1e')][_0x6c2a('0x1f')]===undefined?!![]:![]:!![],'where':_0x1dd6cb[_0x6c2a('0x1e')]?_0x1dd6cb[_0x6c2a('0x1e')][_0x6c2a('0x20')]||null:null,'attributes':_0x1dd6cb[_0x6c2a('0x1e')]?_0x1dd6cb[_0x6c2a('0x1e')][_0x6c2a('0x24')]||null:null,'include':_0x1dd6cb['options']?_0x1dd6cb[_0x6c2a('0x1e')][_0x6c2a('0x22')]?_[_0x6c2a('0x23')](_0x1dd6cb[_0x6c2a('0x1e')][_0x6c2a('0x22')],function(_0x115eb8){return{'model':db[_0x115eb8[_0x6c2a('0x25')]],'as':_0x115eb8['as'],'attributes':_0x115eb8[_0x6c2a('0x24')],'include':_0x115eb8[_0x6c2a('0x22')]?_[_0x6c2a('0x23')](_0x115eb8['include'],function(_0x586f52){return{'model':db[_0x586f52[_0x6c2a('0x25')]],'as':_0x586f52['as'],'attributes':_0x586f52[_0x6c2a('0x24')],'include':_0x586f52['include']?_[_0x6c2a('0x23')](_0x586f52[_0x6c2a('0x22')],function(_0x135364){return{'model':db[_0x135364[_0x6c2a('0x25')]],'as':_0x135364['as'],'attributes':_0x135364[_0x6c2a('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6c2a('0x11')](function(_0x124e75){logger[_0x6c2a('0x12')](_0x6c2a('0x26'),_0x1dd6cb);logger['debug'](_0x6c2a('0x26'),_0x1dd6cb,JSON['stringify'](_0x124e75));_0x12a431(_0x124e75);})[_0x6c2a('0x1c')](function(_0x591f05){logger[_0x6c2a('0x18')](_0x6c2a('0x26'),_0x591f05['message'],_0x1dd6cb);_0x31e5fe(_0xa66ee0[_0x6c2a('0x18')](0x1f4,_0x591f05['message']));});});}; \ No newline at end of file +var _0x18e4=['then','debug','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map'];(function(_0x2bfb8e,_0x30bd93){var _0x41b378=function(_0x33501e){while(--_0x33501e){_0x2bfb8e['push'](_0x2bfb8e['shift']());}};_0x41b378(++_0x30bd93);}(_0x18e4,0x80));var _0x418e=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0x18e4[_0x10316a];return _0x36ac2e;};'use strict';var _=require(_0x418e('0x0'));var util=require(_0x418e('0x1'));var moment=require(_0x418e('0x2'));var BPromise=require(_0x418e('0x3'));var rs=require(_0x418e('0x4'));var fs=require('fs');var Redis=require(_0x418e('0x5'));var db=require(_0x418e('0x6'))['db'];var utils=require(_0x418e('0x7'));var logger=require(_0x418e('0x8'))('rpc');var config=require(_0x418e('0x9'));var jayson=require(_0x418e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x418e('0xb')]=_[_0x418e('0xc')](config[_0x418e('0xb')],{'host':_0x418e('0xd'),'port':0x18eb});var socket=require(_0x418e('0xe'))(new Redis(config[_0x418e('0xb')]));require(_0x418e('0xf'))[_0x418e('0x10')](socket);function respondWithRpcPromise(_0x1b2a0f,_0x27a068,_0x474ccc){return new BPromise(function(_0x192c2f,_0x2b825a){return client[_0x418e('0x11')](_0x1b2a0f,_0x474ccc)['then'](function(_0x5d6f9d){logger['info'](_0x418e('0x12'),_0x27a068,_0x418e('0x13'));logger['debug'](_0x418e('0x14'),_0x27a068,_0x418e('0x13'),JSON[_0x418e('0x15')](_0x5d6f9d));if(_0x5d6f9d['error']){if(_0x5d6f9d['error'][_0x418e('0x16')]===0x1f4){logger[_0x418e('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x27a068,_0x5d6f9d[_0x418e('0x17')][_0x418e('0x18')]);return _0x2b825a(_0x5d6f9d[_0x418e('0x17')][_0x418e('0x18')]);}logger[_0x418e('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x27a068,_0x5d6f9d[_0x418e('0x17')][_0x418e('0x18')]);return _0x192c2f(_0x5d6f9d[_0x418e('0x17')]['message']);}else{logger[_0x418e('0x19')](_0x418e('0x12'),_0x27a068,_0x418e('0x13'));_0x192c2f(_0x5d6f9d['result'][_0x418e('0x18')]);}})['catch'](function(_0x461563){logger[_0x418e('0x17')](_0x418e('0x12'),_0x27a068,_0x461563);_0x2b825a(_0x461563);});});}exports[_0x418e('0x1a')]=function(_0x2a2b51){var _0x1f793c=this;return new Promise(function(_0x4b375d,_0x23b144){return db[_0x418e('0x1b')][_0x418e('0x1c')]({'raw':_0x2a2b51[_0x418e('0x1d')]?_0x2a2b51[_0x418e('0x1d')][_0x418e('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a2b51[_0x418e('0x1d')]?_0x2a2b51[_0x418e('0x1d')][_0x418e('0x1f')]||null:null,'attributes':_0x2a2b51[_0x418e('0x1d')]?_0x2a2b51[_0x418e('0x1d')][_0x418e('0x20')]||null:null,'limit':_0x2a2b51[_0x418e('0x1d')]?_0x2a2b51['options']['limit']||null:null,'include':_0x2a2b51[_0x418e('0x1d')]?_0x2a2b51[_0x418e('0x1d')][_0x418e('0x21')]?_['map'](_0x2a2b51[_0x418e('0x1d')][_0x418e('0x21')],function(_0x9ec5e7){return{'model':db[_0x9ec5e7[_0x418e('0x22')]],'as':_0x9ec5e7['as'],'attributes':_0x9ec5e7[_0x418e('0x20')],'include':_0x9ec5e7[_0x418e('0x21')]?_[_0x418e('0x23')](_0x9ec5e7[_0x418e('0x21')],function(_0x4fe731){return{'model':db[_0x4fe731['model']],'as':_0x4fe731['as'],'attributes':_0x4fe731[_0x418e('0x20')],'include':_0x4fe731[_0x418e('0x21')]?_[_0x418e('0x23')](_0x4fe731[_0x418e('0x21')],function(_0x31f37){return{'model':db[_0x31f37[_0x418e('0x22')]],'as':_0x31f37['as'],'attributes':_0x31f37['attributes']};}):[]};}):[]};}):[]:[]})[_0x418e('0x24')](function(_0x5cd173){logger[_0x418e('0x19')](_0x418e('0x1a'),_0x2a2b51);logger[_0x418e('0x25')](_0x418e('0x1a'),_0x2a2b51,JSON['stringify'](_0x5cd173));_0x4b375d(_0x5cd173);})[_0x418e('0x26')](function(_0x326ffb){logger['error'](_0x418e('0x1a'),_0x326ffb[_0x418e('0x18')],_0x2a2b51);_0x23b144(_0x1f793c[_0x418e('0x17')](0x1f4,_0x326ffb[_0x418e('0x18')]));});});};exports[_0x418e('0x27')]=function(_0x33fd15){var _0x31e1fe=this;return new Promise(function(_0x2e81da,_0x148954){return db[_0x418e('0x1b')][_0x418e('0x28')]({'raw':_0x33fd15[_0x418e('0x1d')]?_0x33fd15[_0x418e('0x1d')][_0x418e('0x1e')]===undefined?!![]:![]:!![],'where':_0x33fd15['options']?_0x33fd15[_0x418e('0x1d')][_0x418e('0x1f')]||null:null,'attributes':_0x33fd15[_0x418e('0x1d')]?_0x33fd15[_0x418e('0x1d')][_0x418e('0x20')]||null:null,'include':_0x33fd15['options']?_0x33fd15[_0x418e('0x1d')][_0x418e('0x21')]?_['map'](_0x33fd15[_0x418e('0x1d')][_0x418e('0x21')],function(_0x31925c){return{'model':db[_0x31925c['model']],'as':_0x31925c['as'],'attributes':_0x31925c[_0x418e('0x20')],'include':_0x31925c[_0x418e('0x21')]?_[_0x418e('0x23')](_0x31925c[_0x418e('0x21')],function(_0x295591){return{'model':db[_0x295591[_0x418e('0x22')]],'as':_0x295591['as'],'attributes':_0x295591[_0x418e('0x20')],'include':_0x295591[_0x418e('0x21')]?_[_0x418e('0x23')](_0x295591['include'],function(_0x5b1d01){return{'model':db[_0x5b1d01[_0x418e('0x22')]],'as':_0x5b1d01['as'],'attributes':_0x5b1d01[_0x418e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x418e('0x24')](function(_0xb34f33){logger[_0x418e('0x19')](_0x418e('0x27'),_0x33fd15);logger['debug'](_0x418e('0x27'),_0x33fd15,JSON[_0x418e('0x15')](_0xb34f33));_0x2e81da(_0xb34f33);})['catch'](function(_0x7e76ee){logger[_0x418e('0x17')](_0x418e('0x27'),_0x7e76ee[_0x418e('0x18')],_0x33fd15);_0x148954(_0x31e1fe[_0x418e('0x17')](0x1f4,_0x7e76ee[_0x418e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 0a1917a..ccce4b1 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 _0xc314=['emit','removeListener','register','length','openchannelQueue:','save','remove'];(function(_0x5a8cb3,_0x4b43ea){var _0x27d0c4=function(_0x2e881b){while(--_0x2e881b){_0x5a8cb3['push'](_0x5a8cb3['shift']());}};_0x27d0c4(++_0x4b43ea);}(_0xc314,0x11d));var _0x4c31=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc314[_0x502c7d];return _0x30b7ed;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x4c31('0x0'),_0x4c31('0x1'),'update'];function createListener(_0x1bda45,_0x43184d){return function(_0x54ea23){_0x43184d[_0x4c31('0x2')](_0x1bda45,_0x54ea23);};}function removeListener(_0x2e197e,_0x21c8ea){return function(){OpenchannelQueueEvents[_0x4c31('0x3')](_0x2e197e,_0x21c8ea);};}exports[_0x4c31('0x4')]=function(_0x11c858){for(var _0x1be4d1=0x0,_0x4549d9=events[_0x4c31('0x5')];_0x1be4d1<_0x4549d9;_0x1be4d1++){var _0x2a8202=events[_0x1be4d1];var _0x581b4d=createListener(_0x4c31('0x6')+_0x2a8202,_0x11c858);OpenchannelQueueEvents['on'](_0x2a8202,_0x581b4d);}}; \ No newline at end of file +var _0xd2a5=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x4c73f1,_0x48ebff){var _0x4fb631=function(_0x1cac18){while(--_0x1cac18){_0x4c73f1['push'](_0x4c73f1['shift']());}};_0x4fb631(++_0x48ebff);}(_0xd2a5,0x8a));var _0x5d2a=function(_0x20049b,_0x369c8b){_0x20049b=_0x20049b-0x0;var _0x35cc83=_0xd2a5[_0x20049b];return _0x35cc83;};'use strict';var OpenchannelQueueEvents=require(_0x5d2a('0x0'));var events=[_0x5d2a('0x1'),_0x5d2a('0x2'),_0x5d2a('0x3')];function createListener(_0x375735,_0x108e71){return function(_0x3c51cb){_0x108e71[_0x5d2a('0x4')](_0x375735,_0x3c51cb);};}function removeListener(_0x2f776a,_0xbb871a){return function(){OpenchannelQueueEvents[_0x5d2a('0x5')](_0x2f776a,_0xbb871a);};}exports[_0x5d2a('0x6')]=function(_0x25ab1a){for(var _0x59e4db=0x0,_0x5829ca=events[_0x5d2a('0x7')];_0x59e4db<_0x5829ca;_0x59e4db++){var _0x324fd1=events[_0x59e4db];var _0x3b8a21=createListener(_0x5d2a('0x8')+_0x324fd1,_0x25ab1a);OpenchannelQueueEvents['on'](_0x324fd1,_0x3b8a21);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index cf804ca..dddebd1 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 _0x0f30=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','create','put'];(function(_0x3de077,_0x5591b7){var _0x3d151f=function(_0x59d271){while(--_0x59d271){_0x3de077['push'](_0x3de077['shift']());}};_0x3d151f(++_0x5591b7);}(_0x0f30,0x1b9));var _0x00f3=function(_0x818500,_0xe7620c){_0x818500=_0x818500-0x0;var _0x342023=_0x0f30[_0x818500];return _0x342023;};'use strict';var multer=require(_0x00f3('0x0'));var util=require(_0x00f3('0x1'));var path=require(_0x00f3('0x2'));var timeout=require(_0x00f3('0x3'));var express=require(_0x00f3('0x4'));var router=express[_0x00f3('0x5')]();var fs_extra=require(_0x00f3('0x6'));var auth=require(_0x00f3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x00f3('0x8'));router[_0x00f3('0x9')]('/',auth[_0x00f3('0xa')](),controller['index']);router[_0x00f3('0x9')](_0x00f3('0xb'),auth[_0x00f3('0xa')](),controller[_0x00f3('0xc')]);router['get']('/:id',auth[_0x00f3('0xa')](),controller['show']);router['post']('/',auth[_0x00f3('0xa')](),controller[_0x00f3('0xd')]);router[_0x00f3('0xe')](_0x00f3('0xf'),auth[_0x00f3('0xa')](),controller[_0x00f3('0x10')]);router[_0x00f3('0x11')](_0x00f3('0xf'),auth[_0x00f3('0xa')](),controller['destroy']);module[_0x00f3('0x12')]=router; \ No newline at end of file +var _0x91e1=['put','update','delete','multer','connect-timeout','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x4e88bb,_0x3657ec){var _0x27a2e1=function(_0x457f35){while(--_0x457f35){_0x4e88bb['push'](_0x4e88bb['shift']());}};_0x27a2e1(++_0x3657ec);}(_0x91e1,0x1bd));var _0x191e=function(_0x523384,_0x1a6e54){_0x523384=_0x523384-0x0;var _0x5f5bcc=_0x91e1[_0x523384];return _0x5f5bcc;};'use strict';var multer=require(_0x191e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x191e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x191e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x191e('0x3'));var controller=require(_0x191e('0x4'));router[_0x191e('0x5')]('/',auth['isAuthenticated'](),controller[_0x191e('0x6')]);router[_0x191e('0x5')](_0x191e('0x7'),auth[_0x191e('0x8')](),controller[_0x191e('0x9')]);router[_0x191e('0x5')](_0x191e('0xa'),auth[_0x191e('0x8')](),controller[_0x191e('0xb')]);router[_0x191e('0xc')]('/',auth[_0x191e('0x8')](),controller[_0x191e('0xd')]);router[_0x191e('0xe')](_0x191e('0xa'),auth[_0x191e('0x8')](),controller[_0x191e('0xf')]);router[_0x191e('0x10')]('/:id',auth[_0x191e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index fc2dcfa..fb9705e 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 _0xfbfe=['exports','STRING','DATE','moment','sequelize'];(function(_0x2a62e6,_0x3e1c31){var _0x1c3bb0=function(_0x41168e){while(--_0x41168e){_0x2a62e6['push'](_0x2a62e6['shift']());}};_0x1c3bb0(++_0x3e1c31);}(_0xfbfe,0x99));var _0xefbf=function(_0x1f0633,_0x27fc92){_0x1f0633=_0x1f0633-0x0;var _0x42804f=_0xfbfe[_0x1f0633];return _0x42804f;};'use strict';var moment=require(_0xefbf('0x0'));var Sequelize=require(_0xefbf('0x1'));module[_0xefbf('0x2')]={'uniqueid':{'type':Sequelize[_0xefbf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xefbf('0x4')]},'acceptAt':{'type':Sequelize[_0xefbf('0x4')]},'exitAt':{'type':Sequelize[_0xefbf('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x04ee=['DATE','moment','sequelize','exports','STRING'];(function(_0x4b621a,_0x29119e){var _0x292846=function(_0x2601bc){while(--_0x2601bc){_0x4b621a['push'](_0x4b621a['shift']());}};_0x292846(++_0x29119e);}(_0x04ee,0xc9));var _0xe04e=function(_0x4434d2,_0x395fb1){_0x4434d2=_0x4434d2-0x0;var _0x37848b=_0x04ee[_0x4434d2];return _0x37848b;};'use strict';var moment=require(_0xe04e('0x0'));var Sequelize=require(_0xe04e('0x1'));module[_0xe04e('0x2')]={'uniqueid':{'type':Sequelize[_0xe04e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe04e('0x4')]},'leaveAt':{'type':Sequelize[_0xe04e('0x4')]},'acceptAt':{'type':Sequelize[_0xe04e('0x4')]},'exitAt':{'type':Sequelize[_0xe04e('0x4')]},'reason':{'type':Sequelize[_0xe04e('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 327d47c..cc2124d 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 _0x24f5=['find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x24f5,0x1d4));var _0x524f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24f5[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x524f('0x0'));var rimraf=require(_0x524f('0x1'));var zipdir=require(_0x524f('0x2'));var jsonpatch=require(_0x524f('0x3'));var rp=require('request-promise');var moment=require(_0x524f('0x4'));var BPromise=require(_0x524f('0x5'));var Mustache=require(_0x524f('0x6'));var util=require(_0x524f('0x7'));var path=require(_0x524f('0x8'));var sox=require(_0x524f('0x9'));var csv=require('to-csv');var ejs=require(_0x524f('0xa'));var fs=require('fs');var fs_extra=require(_0x524f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x524f('0xc'));var jsforce=require(_0x524f('0xd'));var deskjs=require(_0x524f('0xe'));var toCsv=require(_0x524f('0xf'));var querystring=require(_0x524f('0x10'));var Papa=require(_0x524f('0x11'));var Redis=require('ioredis');var authService=require(_0x524f('0x12'));var qs=require(_0x524f('0x13'));var as=require(_0x524f('0x14'));var hardwareService=require(_0x524f('0x15'));var logger=require(_0x524f('0x16'))(_0x524f('0x17'));var utils=require(_0x524f('0x18'));var config=require(_0x524f('0x19'));var licenseUtil=require(_0x524f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d101b,_0x279932){_0x279932=_0x279932||0xcc;return function(_0x203103){if(_0x203103){return _0x5d101b[_0x524f('0x1b')](_0x279932);}return _0x5d101b[_0x524f('0x1c')](_0x279932)['end']();};}function respondWithResult(_0x17ef55,_0x50a83d){_0x50a83d=_0x50a83d||0xc8;return function(_0x39d9de){if(_0x39d9de){return _0x17ef55['status'](_0x50a83d)[_0x524f('0x1d')](_0x39d9de);}};}function respondWithFilteredResult(_0xe01e45,_0x5f46de){return function(_0x1632f3){if(_0x1632f3){var _0x32bd1e=typeof _0x5f46de[_0x524f('0x1e')]===_0x524f('0x1f')&&typeof _0x5f46de[_0x524f('0x20')]===_0x524f('0x1f');var _0x471ff8=_0x1632f3[_0x524f('0x21')];var _0x318968=_0x32bd1e?0x0:_0x5f46de['offset'];var _0x211660=_0x32bd1e?_0x1632f3[_0x524f('0x21')]:_0x5f46de[_0x524f('0x1e')]+_0x5f46de['limit'];var _0x4c6362;if(_0x211660>=_0x471ff8){_0x211660=_0x471ff8;_0x4c6362=0xc8;}else{_0x4c6362=0xce;}_0xe01e45[_0x524f('0x1c')](_0x4c6362);return _0xe01e45['set'](_0x524f('0x22'),_0x318968+'-'+_0x211660+'/'+_0x471ff8)[_0x524f('0x1d')](_0x1632f3);}return null;};}function patchUpdates(_0x1052ca){return function(_0x4746a9){try{jsonpatch[_0x524f('0x23')](_0x4746a9,_0x1052ca,!![]);}catch(_0x4b22b6){return BPromise[_0x524f('0x24')](_0x4b22b6);}return _0x4746a9[_0x524f('0x25')]();};}function saveUpdates(_0x47914a,_0x59fffe){return function(_0x1f7085){if(_0x1f7085){return _0x1f7085[_0x524f('0x26')](_0x47914a)[_0x524f('0x27')](function(_0x2df453){return _0x2df453;});}return null;};}function removeEntity(_0x1c9441,_0x3c1f1f){return function(_0x42d8c3){if(_0x42d8c3){return _0x42d8c3['destroy']()[_0x524f('0x27')](function(){_0x1c9441[_0x524f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dc47d,_0x5bc783){return function(_0x122375){if(!_0x122375){_0x5dc47d[_0x524f('0x1b')](0x194);}return _0x122375;};}function handleError(_0x2245d1,_0x5e20bc){_0x5e20bc=_0x5e20bc||0x1f4;return function(_0x5f0b45){logger['error'](_0x5f0b45[_0x524f('0x28')]);if(_0x5f0b45[_0x524f('0x29')]){delete _0x5f0b45['name'];}_0x2245d1['status'](_0x5e20bc)[_0x524f('0x2a')](_0x5f0b45);};}exports[_0x524f('0x2b')]=function(_0x1b971a,_0x6b184e){var _0x19d8c6={},_0x1062a3={},_0x1c86a3={'count':0x0,'rows':[]};var _0x8f5007=_[_0x524f('0x2c')](db[_0x524f('0x2d')][_0x524f('0x2e')],function(_0x327dad){return{'name':_0x327dad['fieldName'],'type':_0x327dad[_0x524f('0x2f')][_0x524f('0x30')]};});_0x1062a3['model']=_['map'](_0x8f5007,'name');_0x1062a3[_0x524f('0x31')]=_[_0x524f('0x32')](_0x1b971a['query']);_0x1062a3[_0x524f('0x33')]=_[_0x524f('0x34')](_0x1062a3[_0x524f('0x35')],_0x1062a3[_0x524f('0x31')]);_0x19d8c6[_0x524f('0x36')]=_[_0x524f('0x34')](_0x1062a3[_0x524f('0x35')],qs[_0x524f('0x37')](_0x1b971a[_0x524f('0x31')][_0x524f('0x37')]));_0x19d8c6[_0x524f('0x36')]=_0x19d8c6[_0x524f('0x36')][_0x524f('0x38')]?_0x19d8c6['attributes']:_0x1062a3[_0x524f('0x35')];if(!_0x1b971a['query'][_0x524f('0x39')](_0x524f('0x3a'))){_0x19d8c6[_0x524f('0x20')]=qs['limit'](_0x1b971a[_0x524f('0x31')][_0x524f('0x20')]);_0x19d8c6[_0x524f('0x1e')]=qs['offset'](_0x1b971a[_0x524f('0x31')][_0x524f('0x1e')]);}_0x19d8c6[_0x524f('0x3b')]=qs[_0x524f('0x3c')](_0x1b971a['query'][_0x524f('0x3c')]);_0x19d8c6[_0x524f('0x3d')]=qs[_0x524f('0x33')](_[_0x524f('0x3e')](_0x1b971a[_0x524f('0x31')],_0x1062a3[_0x524f('0x33')]),_0x8f5007);if(_0x1b971a[_0x524f('0x31')][_0x524f('0x3f')]){_0x19d8c6[_0x524f('0x3d')]=_[_0x524f('0x40')](_0x19d8c6['where'],{'$or':_['map'](_0x8f5007,function(_0x11b338){if(_0x11b338['type']!=='VIRTUAL'){var _0x8ba594={};_0x8ba594[_0x11b338[_0x524f('0x29')]]={'$like':'%'+_0x1b971a[_0x524f('0x31')]['filter']+'%'};return _0x8ba594;}})});}_0x19d8c6=_[_0x524f('0x40')]({},_0x19d8c6,_0x1b971a[_0x524f('0x41')]);var _0x4d4ac8={'where':_0x19d8c6[_0x524f('0x3d')]};return db[_0x524f('0x2d')][_0x524f('0x21')](_0x4d4ac8)[_0x524f('0x27')](function(_0x15158d){_0x1c86a3[_0x524f('0x21')]=_0x15158d;if(_0x1b971a[_0x524f('0x31')][_0x524f('0x42')]){_0x19d8c6[_0x524f('0x43')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x524f('0x44')](_0x19d8c6);})[_0x524f('0x27')](function(_0x5053d8){_0x1c86a3['rows']=_0x5053d8;return _0x1c86a3;})['then'](respondWithFilteredResult(_0x6b184e,_0x19d8c6))['catch'](handleError(_0x6b184e,null));};exports[_0x524f('0x45')]=function(_0x1d5411,_0x2ba9d2){var _0x547337={'raw':!![],'where':{'id':_0x1d5411[_0x524f('0x46')]['id']}},_0x50439a={};_0x50439a[_0x524f('0x35')]=_[_0x524f('0x32')](db[_0x524f('0x2d')][_0x524f('0x2e')]);_0x50439a['query']=_['keys'](_0x1d5411[_0x524f('0x31')]);_0x50439a[_0x524f('0x33')]=_['intersection'](_0x50439a['model'],_0x50439a[_0x524f('0x31')]);_0x547337['attributes']=_[_0x524f('0x34')](_0x50439a[_0x524f('0x35')],qs[_0x524f('0x37')](_0x1d5411[_0x524f('0x31')][_0x524f('0x37')]));_0x547337['attributes']=_0x547337[_0x524f('0x36')]['length']?_0x547337['attributes']:_0x50439a[_0x524f('0x35')];if(_0x1d5411[_0x524f('0x31')][_0x524f('0x42')]){_0x547337['include']=[{'all':!![]}];}_0x547337=_[_0x524f('0x40')]({},_0x547337,_0x1d5411[_0x524f('0x41')]);return db[_0x524f('0x2d')][_0x524f('0x47')](_0x547337)[_0x524f('0x27')](handleEntityNotFound(_0x2ba9d2,null))[_0x524f('0x27')](respondWithResult(_0x2ba9d2,null))[_0x524f('0x48')](handleError(_0x2ba9d2,null));};exports['create']=function(_0x5b4917,_0x19c0d4){return db[_0x524f('0x2d')][_0x524f('0x49')](_0x5b4917[_0x524f('0x4a')],{})[_0x524f('0x27')](respondWithResult(_0x19c0d4,0xc9))[_0x524f('0x48')](handleError(_0x19c0d4,null));};exports[_0x524f('0x26')]=function(_0x140184,_0x2e105f){if(_0x140184[_0x524f('0x4a')]['id']){delete _0x140184[_0x524f('0x4a')]['id'];}return db[_0x524f('0x2d')][_0x524f('0x47')]({'where':{'id':_0x140184[_0x524f('0x46')]['id']}})[_0x524f('0x27')](handleEntityNotFound(_0x2e105f,null))[_0x524f('0x27')](saveUpdates(_0x140184[_0x524f('0x4a')],null))[_0x524f('0x27')](respondWithResult(_0x2e105f,null))['catch'](handleError(_0x2e105f,null));};exports[_0x524f('0x4b')]=function(_0x55f85d,_0x3d876b){return db[_0x524f('0x2d')][_0x524f('0x47')]({'where':{'id':_0x55f85d[_0x524f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d876b,null))[_0x524f('0x27')](removeEntity(_0x3d876b,null))['catch'](handleError(_0x3d876b,null));};exports['describe']=function(_0x14d82c,_0x43aaa4){return db[_0x524f('0x2d')][_0x524f('0x4c')]()[_0x524f('0x27')](respondWithResult(_0x43aaa4,null))[_0x524f('0x48')](handleError(_0x43aaa4,null));}; \ No newline at end of file +var _0x3b7e=['status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','error','name','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','catch','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3b7e,0xfe));var _0xe3b7=function(_0x4e0c80,_0x4e50d8){_0x4e0c80=_0x4e0c80-0x0;var _0x486096=_0x3b7e[_0x4e0c80];return _0x486096;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3b7('0x0'));var zipdir=require(_0xe3b7('0x1'));var jsonpatch=require(_0xe3b7('0x2'));var rp=require('request-promise');var moment=require(_0xe3b7('0x3'));var BPromise=require(_0xe3b7('0x4'));var Mustache=require(_0xe3b7('0x5'));var util=require('util');var path=require(_0xe3b7('0x6'));var sox=require(_0xe3b7('0x7'));var csv=require(_0xe3b7('0x8'));var ejs=require(_0xe3b7('0x9'));var fs=require('fs');var fs_extra=require(_0xe3b7('0xa'));var _=require(_0xe3b7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe3b7('0x8'));var querystring=require('querystring');var Papa=require(_0xe3b7('0xc'));var Redis=require(_0xe3b7('0xd'));var authService=require(_0xe3b7('0xe'));var qs=require(_0xe3b7('0xf'));var as=require(_0xe3b7('0x10'));var hardwareService=require(_0xe3b7('0x11'));var logger=require(_0xe3b7('0x12'))(_0xe3b7('0x13'));var utils=require(_0xe3b7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe3b7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf11918,_0x590a9f){_0x590a9f=_0x590a9f||0xcc;return function(_0x4a5c80){if(_0x4a5c80){return _0xf11918['sendStatus'](_0x590a9f);}return _0xf11918[_0xe3b7('0x16')](_0x590a9f)[_0xe3b7('0x17')]();};}function respondWithResult(_0x25a3a9,_0x13c4f8){_0x13c4f8=_0x13c4f8||0xc8;return function(_0x14ffab){if(_0x14ffab){return _0x25a3a9[_0xe3b7('0x16')](_0x13c4f8)['json'](_0x14ffab);}};}function respondWithFilteredResult(_0x23df66,_0x2d034c){return function(_0x2b2bd8){if(_0x2b2bd8){var _0x3401a0=typeof _0x2d034c[_0xe3b7('0x18')]===_0xe3b7('0x19')&&typeof _0x2d034c[_0xe3b7('0x1a')]===_0xe3b7('0x19');var _0x3045a1=_0x2b2bd8[_0xe3b7('0x1b')];var _0xd36ff9=_0x3401a0?0x0:_0x2d034c['offset'];var _0x4fe093=_0x3401a0?_0x2b2bd8[_0xe3b7('0x1b')]:_0x2d034c[_0xe3b7('0x18')]+_0x2d034c['limit'];var _0x3d8840;if(_0x4fe093>=_0x3045a1){_0x4fe093=_0x3045a1;_0x3d8840=0xc8;}else{_0x3d8840=0xce;}_0x23df66[_0xe3b7('0x16')](_0x3d8840);return _0x23df66[_0xe3b7('0x1c')](_0xe3b7('0x1d'),_0xd36ff9+'-'+_0x4fe093+'/'+_0x3045a1)['json'](_0x2b2bd8);}return null;};}function patchUpdates(_0x32e382){return function(_0x38b234){try{jsonpatch[_0xe3b7('0x1e')](_0x38b234,_0x32e382,!![]);}catch(_0x346a5f){return BPromise[_0xe3b7('0x1f')](_0x346a5f);}return _0x38b234['save']();};}function saveUpdates(_0x113fd5,_0xa83808){return function(_0xce7e1a){if(_0xce7e1a){return _0xce7e1a[_0xe3b7('0x20')](_0x113fd5)[_0xe3b7('0x21')](function(_0x8d870e){return _0x8d870e;});}return null;};}function removeEntity(_0x54e1c6,_0x16da0b){return function(_0x4ea933){if(_0x4ea933){return _0x4ea933['destroy']()[_0xe3b7('0x21')](function(){_0x54e1c6[_0xe3b7('0x16')](0xcc)[_0xe3b7('0x17')]();});}};}function handleEntityNotFound(_0x2fe4ec,_0x3922b9){return function(_0x24d316){if(!_0x24d316){_0x2fe4ec[_0xe3b7('0x22')](0x194);}return _0x24d316;};}function handleError(_0x59c000,_0x4d16a4){_0x4d16a4=_0x4d16a4||0x1f4;return function(_0x4e897c){logger[_0xe3b7('0x23')](_0x4e897c['stack']);if(_0x4e897c['name']){delete _0x4e897c[_0xe3b7('0x24')];}_0x59c000['status'](_0x4d16a4)['send'](_0x4e897c);};}exports[_0xe3b7('0x25')]=function(_0xef832f,_0x1185b1){var _0x279676={},_0x504dbd={},_0x3794ed={'count':0x0,'rows':[]};var _0x2dd63b=_[_0xe3b7('0x26')](db[_0xe3b7('0x27')][_0xe3b7('0x28')],function(_0x5af58d){return{'name':_0x5af58d['fieldName'],'type':_0x5af58d[_0xe3b7('0x29')][_0xe3b7('0x2a')]};});_0x504dbd[_0xe3b7('0x2b')]=_[_0xe3b7('0x26')](_0x2dd63b,_0xe3b7('0x24'));_0x504dbd[_0xe3b7('0x2c')]=_[_0xe3b7('0x2d')](_0xef832f[_0xe3b7('0x2c')]);_0x504dbd[_0xe3b7('0x2e')]=_[_0xe3b7('0x2f')](_0x504dbd[_0xe3b7('0x2b')],_0x504dbd['query']);_0x279676[_0xe3b7('0x30')]=_['intersection'](_0x504dbd[_0xe3b7('0x2b')],qs['fields'](_0xef832f['query'][_0xe3b7('0x31')]));_0x279676[_0xe3b7('0x30')]=_0x279676['attributes'][_0xe3b7('0x32')]?_0x279676[_0xe3b7('0x30')]:_0x504dbd[_0xe3b7('0x2b')];if(!_0xef832f[_0xe3b7('0x2c')][_0xe3b7('0x33')](_0xe3b7('0x34'))){_0x279676['limit']=qs[_0xe3b7('0x1a')](_0xef832f[_0xe3b7('0x2c')]['limit']);_0x279676[_0xe3b7('0x18')]=qs[_0xe3b7('0x18')](_0xef832f[_0xe3b7('0x2c')]['offset']);}_0x279676[_0xe3b7('0x35')]=qs['sort'](_0xef832f[_0xe3b7('0x2c')][_0xe3b7('0x36')]);_0x279676[_0xe3b7('0x37')]=qs[_0xe3b7('0x2e')](_[_0xe3b7('0x38')](_0xef832f['query'],_0x504dbd[_0xe3b7('0x2e')]),_0x2dd63b);if(_0xef832f[_0xe3b7('0x2c')]['filter']){_0x279676[_0xe3b7('0x37')]=_[_0xe3b7('0x39')](_0x279676[_0xe3b7('0x37')],{'$or':_[_0xe3b7('0x26')](_0x2dd63b,function(_0x404222){if(_0x404222[_0xe3b7('0x29')]!=='VIRTUAL'){var _0x27e431={};_0x27e431[_0x404222['name']]={'$like':'%'+_0xef832f[_0xe3b7('0x2c')][_0xe3b7('0x3a')]+'%'};return _0x27e431;}})});}_0x279676=_[_0xe3b7('0x39')]({},_0x279676,_0xef832f[_0xe3b7('0x3b')]);var _0x58a400={'where':_0x279676[_0xe3b7('0x37')]};return db[_0xe3b7('0x27')][_0xe3b7('0x1b')](_0x58a400)['then'](function(_0x42f487){_0x3794ed['count']=_0x42f487;if(_0xef832f[_0xe3b7('0x2c')][_0xe3b7('0x3c')]){_0x279676['include']=[{'all':!![]}];}return db[_0xe3b7('0x27')][_0xe3b7('0x3d')](_0x279676);})['then'](function(_0x32cb3d){_0x3794ed['rows']=_0x32cb3d;return _0x3794ed;})[_0xe3b7('0x21')](respondWithFilteredResult(_0x1185b1,_0x279676))[_0xe3b7('0x3e')](handleError(_0x1185b1,null));};exports['show']=function(_0x243704,_0x282b4e){var _0x3cc8e4={'raw':!![],'where':{'id':_0x243704['params']['id']}},_0x3842a2={};_0x3842a2[_0xe3b7('0x2b')]=_['keys'](db[_0xe3b7('0x27')][_0xe3b7('0x28')]);_0x3842a2[_0xe3b7('0x2c')]=_[_0xe3b7('0x2d')](_0x243704[_0xe3b7('0x2c')]);_0x3842a2[_0xe3b7('0x2e')]=_['intersection'](_0x3842a2['model'],_0x3842a2['query']);_0x3cc8e4[_0xe3b7('0x30')]=_[_0xe3b7('0x2f')](_0x3842a2[_0xe3b7('0x2b')],qs['fields'](_0x243704[_0xe3b7('0x2c')][_0xe3b7('0x31')]));_0x3cc8e4[_0xe3b7('0x30')]=_0x3cc8e4['attributes'][_0xe3b7('0x32')]?_0x3cc8e4[_0xe3b7('0x30')]:_0x3842a2['model'];if(_0x243704[_0xe3b7('0x2c')][_0xe3b7('0x3c')]){_0x3cc8e4[_0xe3b7('0x3f')]=[{'all':!![]}];}_0x3cc8e4=_[_0xe3b7('0x39')]({},_0x3cc8e4,_0x243704[_0xe3b7('0x3b')]);return db['OpenchannelQueueReport'][_0xe3b7('0x40')](_0x3cc8e4)[_0xe3b7('0x21')](handleEntityNotFound(_0x282b4e,null))[_0xe3b7('0x21')](respondWithResult(_0x282b4e,null))[_0xe3b7('0x3e')](handleError(_0x282b4e,null));};exports[_0xe3b7('0x41')]=function(_0x8b057f,_0x288721){return db[_0xe3b7('0x27')][_0xe3b7('0x41')](_0x8b057f['body'],{})[_0xe3b7('0x21')](respondWithResult(_0x288721,0xc9))[_0xe3b7('0x3e')](handleError(_0x288721,null));};exports[_0xe3b7('0x20')]=function(_0x27828c,_0x52eb60){if(_0x27828c['body']['id']){delete _0x27828c[_0xe3b7('0x42')]['id'];}return db[_0xe3b7('0x27')][_0xe3b7('0x40')]({'where':{'id':_0x27828c[_0xe3b7('0x43')]['id']}})[_0xe3b7('0x21')](handleEntityNotFound(_0x52eb60,null))[_0xe3b7('0x21')](saveUpdates(_0x27828c[_0xe3b7('0x42')],null))[_0xe3b7('0x21')](respondWithResult(_0x52eb60,null))[_0xe3b7('0x3e')](handleError(_0x52eb60,null));};exports['destroy']=function(_0x5c7db0,_0x4e00ff){return db['OpenchannelQueueReport'][_0xe3b7('0x40')]({'where':{'id':_0x5c7db0[_0xe3b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e00ff,null))[_0xe3b7('0x21')](removeEntity(_0x4e00ff,null))[_0xe3b7('0x3e')](handleError(_0x4e00ff,null));};exports[_0xe3b7('0x44')]=function(_0x1fb70e,_0x58d59a){return db['OpenchannelQueueReport'][_0xe3b7('0x44')]()[_0xe3b7('0x21')](respondWithResult(_0x58d59a,null))['catch'](handleError(_0x58d59a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 28c5b4a..4660d73 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(_0x1b9d04,_0x31b1f7){var _0x27bb14=function(_0x29d27b){while(--_0x29d27b){_0x1b9d04['push'](_0x1b9d04['shift']());}};_0x27bb14(++_0x31b1f7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x5fc3[_0x36bf88];return _0x332914;};'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(_0x2e347c,_0xcc9832){var _0x6ac2f3=function(_0x340e59){while(--_0x340e59){_0x2e347c['push'](_0x2e347c['shift']());}};_0x6ac2f3(++_0xcc9832);}(_0x326f,0xd1));var _0xf326=function(_0x592e05,_0x272779){_0x592e05=_0x592e05-0x0;var _0x6fe7d5=_0x326f[_0x592e05];return _0x6fe7d5;};'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 a66f313..6b5d168 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 _0x1c3d=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x19a501,_0x263b5e){var _0xc3a3d3=function(_0x11872b){while(--_0x11872b){_0x19a501['push'](_0x19a501['shift']());}};_0xc3a3d3(++_0x263b5e);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x325348,_0x26b555){_0x325348=_0x325348-0x0;var _0x3391a8=_0x1c3d[_0x325348];return _0x3391a8;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});}exports[_0xd1c3('0x18')]=function(_0x5d26c2){var _0x53a5e1=this;return new Promise(function(_0x14f6cb,_0x3a1a74){return db[_0xd1c3('0x19')][_0xd1c3('0x1a')](_0x5d26c2[_0xd1c3('0x1b')],{'raw':_0x5d26c2['options']?_0x5d26c2[_0xd1c3('0x1c')][_0xd1c3('0x1d')]===undefined?!![]:![]:!![]})[_0xd1c3('0xc')](function(_0x588f4e){logger['info'](_0xd1c3('0x18'),_0x5d26c2);logger[_0xd1c3('0xe')]('CreateOpenchannelQueueReport',_0x5d26c2,JSON['stringify'](_0x588f4e));_0x14f6cb(_0x588f4e);})[_0xd1c3('0x17')](function(_0xc45d5d){logger[_0xd1c3('0x12')](_0xd1c3('0x18'),_0xc45d5d[_0xd1c3('0x15')],_0x5d26c2);_0x3a1a74(_0x53a5e1[_0xd1c3('0x12')](0x1f4,_0xc45d5d[_0xd1c3('0x15')]));});});};exports[_0xd1c3('0x1e')]=function(_0x33c380){var _0x218ef1=this;return new Promise(function(_0x5a9d5d,_0x56091a){return db[_0xd1c3('0x19')][_0xd1c3('0x1f')](_0x33c380[_0xd1c3('0x1b')],{'raw':_0x33c380[_0xd1c3('0x1c')]?_0x33c380['options'][_0xd1c3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c380[_0xd1c3('0x1c')]?_0x33c380['options'][_0xd1c3('0x20')]||null:null,'attributes':_0x33c380[_0xd1c3('0x1c')]?_0x33c380[_0xd1c3('0x1c')][_0xd1c3('0x21')]||null:null,'limit':_0x33c380[_0xd1c3('0x1c')]?_0x33c380[_0xd1c3('0x1c')][_0xd1c3('0x22')]||null:null})['then'](function(_0x57309e){logger[_0xd1c3('0xd')](_0xd1c3('0x1e'),_0x33c380);logger[_0xd1c3('0xe')](_0xd1c3('0x1e'),_0x33c380,JSON[_0xd1c3('0x11')](_0x57309e));_0x5a9d5d(_0x57309e);})['catch'](function(_0x331bad){logger[_0xd1c3('0x12')]('UpdateOpenchannelQueueReport',_0x331bad[_0xd1c3('0x15')],_0x33c380);_0x56091a(_0x218ef1['error'](0x1f4,_0x331bad[_0xd1c3('0x15')]));});});}; \ No newline at end of file +var _0x6215=['UpdateOpenchannelQueueReport','update','body','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','stringify'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var moment=require(_0x5621('0x2'));var BPromise=require('bluebird');var rs=require(_0x5621('0x3'));var fs=require('fs');var Redis=require(_0x5621('0x4'));var db=require(_0x5621('0x5'))['db'];var utils=require(_0x5621('0x6'));var logger=require(_0x5621('0x7'))(_0x5621('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x431e77,_0x13ed74,_0x2b7275){return new BPromise(function(_0x253c0b,_0x19427d){return client['request'](_0x431e77,_0x2b7275)[_0x5621('0x9')](function(_0x39b1c0){logger[_0x5621('0xa')](_0x5621('0xb'),_0x13ed74,'request\x20sent');logger[_0x5621('0xc')](_0x5621('0xd'),_0x13ed74,_0x5621('0xe'),JSON['stringify'](_0x39b1c0));if(_0x39b1c0[_0x5621('0xf')]){if(_0x39b1c0[_0x5621('0xf')][_0x5621('0x10')]===0x1f4){logger[_0x5621('0xf')](_0x5621('0xb'),_0x13ed74,_0x39b1c0[_0x5621('0xf')][_0x5621('0x11')]);return _0x19427d(_0x39b1c0[_0x5621('0xf')][_0x5621('0x11')]);}logger[_0x5621('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x13ed74,_0x39b1c0[_0x5621('0xf')][_0x5621('0x11')]);return _0x253c0b(_0x39b1c0[_0x5621('0xf')]['message']);}else{logger[_0x5621('0xa')](_0x5621('0xb'),_0x13ed74,'request\x20sent');_0x253c0b(_0x39b1c0[_0x5621('0x12')][_0x5621('0x11')]);}})[_0x5621('0x13')](function(_0x180926){logger[_0x5621('0xf')](_0x5621('0xb'),_0x13ed74,_0x180926);_0x19427d(_0x180926);});});}exports[_0x5621('0x14')]=function(_0x374f44){var _0x41941b=this;return new Promise(function(_0x2baba3,_0x4b55b0){return db[_0x5621('0x15')][_0x5621('0x16')](_0x374f44['body'],{'raw':_0x374f44[_0x5621('0x17')]?_0x374f44['options'][_0x5621('0x18')]===undefined?!![]:![]:!![]})[_0x5621('0x9')](function(_0x179830){logger[_0x5621('0xa')](_0x5621('0x14'),_0x374f44);logger['debug'](_0x5621('0x14'),_0x374f44,JSON[_0x5621('0x19')](_0x179830));_0x2baba3(_0x179830);})[_0x5621('0x13')](function(_0x3eaa1a){logger['error'](_0x5621('0x14'),_0x3eaa1a[_0x5621('0x11')],_0x374f44);_0x4b55b0(_0x41941b[_0x5621('0xf')](0x1f4,_0x3eaa1a[_0x5621('0x11')]));});});};exports[_0x5621('0x1a')]=function(_0x2af50a){var _0x470db7=this;return new Promise(function(_0x5c8ef5,_0x23ba00){return db['OpenchannelQueueReport'][_0x5621('0x1b')](_0x2af50a[_0x5621('0x1c')],{'raw':_0x2af50a[_0x5621('0x17')]?_0x2af50a[_0x5621('0x17')][_0x5621('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2af50a[_0x5621('0x17')]?_0x2af50a[_0x5621('0x17')]['where']||null:null,'attributes':_0x2af50a[_0x5621('0x17')]?_0x2af50a[_0x5621('0x17')][_0x5621('0x1d')]||null:null,'limit':_0x2af50a[_0x5621('0x17')]?_0x2af50a['options'][_0x5621('0x1e')]||null:null})[_0x5621('0x9')](function(_0x4ad3ac){logger['info'](_0x5621('0x1a'),_0x2af50a);logger[_0x5621('0xc')](_0x5621('0x1a'),_0x2af50a,JSON[_0x5621('0x19')](_0x4ad3ac));_0x5c8ef5(_0x4ad3ac);})[_0x5621('0x13')](function(_0xc1af98){logger[_0x5621('0xf')]('UpdateOpenchannelQueueReport',_0xc1af98[_0x5621('0x11')],_0x2af50a);_0x23ba00(_0x470db7[_0x5621('0xf')](0x1f4,_0xc1af98[_0x5621('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 096a89d..1e79f3d 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 _0x4889=['put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x47529f,_0x6c7061){var _0x4505a9=function(_0x463eea){while(--_0x463eea){_0x47529f['push'](_0x47529f['shift']());}};_0x4505a9(++_0x6c7061);}(_0x4889,0x11c));var _0x9488=function(_0x4036d4,_0x5994ab){_0x4036d4=_0x4036d4-0x0;var _0x3bc2a4=_0x4889[_0x4036d4];return _0x3bc2a4;};'use strict';var multer=require(_0x9488('0x0'));var util=require('util');var path=require(_0x9488('0x1'));var timeout=require(_0x9488('0x2'));var express=require('express');var router=express[_0x9488('0x3')]();var fs_extra=require(_0x9488('0x4'));var auth=require(_0x9488('0x5'));var interaction=require(_0x9488('0x6'));var config=require(_0x9488('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x9488('0x8')]('/',auth[_0x9488('0x9')](),controller[_0x9488('0xa')]);router['get'](_0x9488('0xb'),auth[_0x9488('0x9')](),controller['describe']);router['get'](_0x9488('0xc'),auth[_0x9488('0x9')](),controller[_0x9488('0xd')]);router[_0x9488('0xe')]('/',auth[_0x9488('0x9')](),controller[_0x9488('0xf')]);router[_0x9488('0x10')]('/:id',auth[_0x9488('0x9')](),controller[_0x9488('0x11')]);router['delete']('/:id',auth[_0x9488('0x9')](),controller[_0x9488('0x12')]);module[_0x9488('0x13')]=router; \ No newline at end of file +var _0x1f69=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1bb425,_0x22ea05){var _0x5d67cb=function(_0x50cb4a){while(--_0x50cb4a){_0x1bb425['push'](_0x1bb425['shift']());}};_0x5d67cb(++_0x22ea05);}(_0x1f69,0x150));var _0x91f6=function(_0x4fc842,_0x28de81){_0x4fc842=_0x4fc842-0x0;var _0x1850ea=_0x1f69[_0x4fc842];return _0x1850ea;};'use strict';var multer=require(_0x91f6('0x0'));var util=require(_0x91f6('0x1'));var path=require(_0x91f6('0x2'));var timeout=require(_0x91f6('0x3'));var express=require('express');var router=express[_0x91f6('0x4')]();var fs_extra=require(_0x91f6('0x5'));var auth=require(_0x91f6('0x6'));var interaction=require(_0x91f6('0x7'));var config=require(_0x91f6('0x8'));var controller=require(_0x91f6('0x9'));router[_0x91f6('0xa')]('/',auth[_0x91f6('0xb')](),controller[_0x91f6('0xc')]);router['get'](_0x91f6('0xd'),auth[_0x91f6('0xb')](),controller[_0x91f6('0xe')]);router[_0x91f6('0xa')](_0x91f6('0xf'),auth[_0x91f6('0xb')](),controller[_0x91f6('0x10')]);router['post']('/',auth[_0x91f6('0xb')](),controller['create']);router[_0x91f6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x91f6('0x12')]);router[_0x91f6('0x13')](_0x91f6('0xf'),auth['isAuthenticated'](),controller[_0x91f6('0x14')]);module[_0x91f6('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 993b1b4..8edf78f 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3eb9a3,_0x3755e6){var _0x235ac4=function(_0x865fcf){while(--_0x865fcf){_0x3eb9a3['push'](_0x3eb9a3['shift']());}};_0x235ac4(++_0x3755e6);}(_0xaa88,0x137));var _0x8aa8=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xaa88[_0xfb0281];return _0x408dd3;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3115fa,_0x1bf37e){var _0x3a5567=function(_0x18f739){while(--_0x18f739){_0x3115fa['push'](_0x3115fa['shift']());}};_0x3a5567(++_0x1bf37e);}(_0x008c,0x188));var _0xc008=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x008c[_0x2665a3];return _0x586de6;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index b488b9d..6b430a7 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 _0xf50b=['name','send','index','map','OpenchannelTransferReport','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','length','find','create','body','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf50b,0x142));var _0xbf50=function(_0x474c18,_0x5d257a){_0x474c18=_0x474c18-0x0;var _0x1cb228=_0xf50b[_0x474c18];return _0x1cb228;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf50('0x0'));var jsonpatch=require(_0xbf50('0x1'));var rp=require(_0xbf50('0x2'));var moment=require('moment');var BPromise=require(_0xbf50('0x3'));var Mustache=require(_0xbf50('0x4'));var util=require(_0xbf50('0x5'));var path=require(_0xbf50('0x6'));var sox=require(_0xbf50('0x7'));var csv=require(_0xbf50('0x8'));var ejs=require(_0xbf50('0x9'));var fs=require('fs');var fs_extra=require(_0xbf50('0xa'));var _=require('lodash');var squel=require(_0xbf50('0xb'));var crypto=require(_0xbf50('0xc'));var jsforce=require(_0xbf50('0xd'));var deskjs=require(_0xbf50('0xe'));var toCsv=require(_0xbf50('0x8'));var querystring=require('querystring');var Papa=require(_0xbf50('0xf'));var Redis=require('ioredis');var authService=require(_0xbf50('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf50('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xbf50('0x12'));var licenseUtil=require(_0xbf50('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e172,_0x49a2ee){_0x49a2ee=_0x49a2ee||0xcc;return function(_0x412ca8){if(_0x412ca8){return _0x15e172[_0xbf50('0x14')](_0x49a2ee);}return _0x15e172[_0xbf50('0x15')](_0x49a2ee)[_0xbf50('0x16')]();};}function respondWithResult(_0x4dd350,_0x39b223){_0x39b223=_0x39b223||0xc8;return function(_0x5c511f){if(_0x5c511f){return _0x4dd350['status'](_0x39b223)[_0xbf50('0x17')](_0x5c511f);}};}function respondWithFilteredResult(_0x2ae4ca,_0x3511a2){return function(_0x3edf6b){if(_0x3edf6b){var _0x725872=typeof _0x3511a2[_0xbf50('0x18')]==='undefined'&&typeof _0x3511a2[_0xbf50('0x19')]===_0xbf50('0x1a');var _0x4da653=_0x3edf6b[_0xbf50('0x1b')];var _0x4d0c32=_0x725872?0x0:_0x3511a2[_0xbf50('0x18')];var _0x252513=_0x725872?_0x3edf6b['count']:_0x3511a2[_0xbf50('0x18')]+_0x3511a2[_0xbf50('0x19')];var _0x20c2aa;if(_0x252513>=_0x4da653){_0x252513=_0x4da653;_0x20c2aa=0xc8;}else{_0x20c2aa=0xce;}_0x2ae4ca[_0xbf50('0x15')](_0x20c2aa);return _0x2ae4ca[_0xbf50('0x1c')](_0xbf50('0x1d'),_0x4d0c32+'-'+_0x252513+'/'+_0x4da653)[_0xbf50('0x17')](_0x3edf6b);}return null;};}function patchUpdates(_0x50f3d7){return function(_0x3350ea){try{jsonpatch[_0xbf50('0x1e')](_0x3350ea,_0x50f3d7,!![]);}catch(_0x103d4e){return BPromise[_0xbf50('0x1f')](_0x103d4e);}return _0x3350ea[_0xbf50('0x20')]();};}function saveUpdates(_0x1a3d12,_0x1ed8a8){return function(_0x4ee5ab){if(_0x4ee5ab){return _0x4ee5ab[_0xbf50('0x21')](_0x1a3d12)['then'](function(_0x40d105){return _0x40d105;});}return null;};}function removeEntity(_0x5a118b,_0x36cfe6){return function(_0x3f8def){if(_0x3f8def){return _0x3f8def[_0xbf50('0x22')]()[_0xbf50('0x23')](function(){_0x5a118b['status'](0xcc)[_0xbf50('0x16')]();});}};}function handleEntityNotFound(_0x2be601,_0x4c3fa1){return function(_0x4bcdaa){if(!_0x4bcdaa){_0x2be601[_0xbf50('0x14')](0x194);}return _0x4bcdaa;};}function handleError(_0x19b737,_0x5c9195){_0x5c9195=_0x5c9195||0x1f4;return function(_0x3b7cc0){logger[_0xbf50('0x24')](_0x3b7cc0[_0xbf50('0x25')]);if(_0x3b7cc0[_0xbf50('0x26')]){delete _0x3b7cc0[_0xbf50('0x26')];}_0x19b737[_0xbf50('0x15')](_0x5c9195)[_0xbf50('0x27')](_0x3b7cc0);};}exports[_0xbf50('0x28')]=function(_0x25be64,_0x405a52){var _0x1b0929={},_0x2ff013={},_0x2ec8c8={'count':0x0,'rows':[]};var _0x24d9d9=_[_0xbf50('0x29')](db[_0xbf50('0x2a')]['rawAttributes'],function(_0x5e2609){return{'name':_0x5e2609[_0xbf50('0x2b')],'type':_0x5e2609[_0xbf50('0x2c')]['key']};});_0x2ff013[_0xbf50('0x2d')]=_[_0xbf50('0x29')](_0x24d9d9,_0xbf50('0x26'));_0x2ff013[_0xbf50('0x2e')]=_['keys'](_0x25be64[_0xbf50('0x2e')]);_0x2ff013['filters']=_[_0xbf50('0x2f')](_0x2ff013[_0xbf50('0x2d')],_0x2ff013[_0xbf50('0x2e')]);_0x1b0929['attributes']=_[_0xbf50('0x2f')](_0x2ff013[_0xbf50('0x2d')],qs['fields'](_0x25be64[_0xbf50('0x2e')][_0xbf50('0x30')]));_0x1b0929[_0xbf50('0x31')]=_0x1b0929[_0xbf50('0x31')]['length']?_0x1b0929[_0xbf50('0x31')]:_0x2ff013[_0xbf50('0x2d')];if(!_0x25be64[_0xbf50('0x2e')][_0xbf50('0x32')](_0xbf50('0x33'))){_0x1b0929[_0xbf50('0x19')]=qs[_0xbf50('0x19')](_0x25be64[_0xbf50('0x2e')]['limit']);_0x1b0929[_0xbf50('0x18')]=qs[_0xbf50('0x18')](_0x25be64[_0xbf50('0x2e')]['offset']);}_0x1b0929[_0xbf50('0x34')]=qs[_0xbf50('0x35')](_0x25be64[_0xbf50('0x2e')][_0xbf50('0x35')]);_0x1b0929[_0xbf50('0x36')]=qs[_0xbf50('0x37')](_[_0xbf50('0x38')](_0x25be64[_0xbf50('0x2e')],_0x2ff013[_0xbf50('0x37')]),_0x24d9d9);if(_0x25be64[_0xbf50('0x2e')][_0xbf50('0x39')]){_0x1b0929[_0xbf50('0x36')]=_[_0xbf50('0x3a')](_0x1b0929[_0xbf50('0x36')],{'$or':_[_0xbf50('0x29')](_0x24d9d9,function(_0x1c6591){if(_0x1c6591[_0xbf50('0x2c')]!==_0xbf50('0x3b')){var _0x32daf8={};_0x32daf8[_0x1c6591['name']]={'$like':'%'+_0x25be64[_0xbf50('0x2e')][_0xbf50('0x39')]+'%'};return _0x32daf8;}})});}_0x1b0929=_[_0xbf50('0x3a')]({},_0x1b0929,_0x25be64[_0xbf50('0x3c')]);var _0x368a9c={'where':_0x1b0929[_0xbf50('0x36')]};return db[_0xbf50('0x2a')][_0xbf50('0x1b')](_0x368a9c)['then'](function(_0x525c8f){_0x2ec8c8[_0xbf50('0x1b')]=_0x525c8f;if(_0x25be64[_0xbf50('0x2e')][_0xbf50('0x3d')]){_0x1b0929[_0xbf50('0x3e')]=[{'all':!![]}];}return db[_0xbf50('0x2a')]['findAll'](_0x1b0929);})[_0xbf50('0x23')](function(_0x926639){_0x2ec8c8['rows']=_0x926639;return _0x2ec8c8;})['then'](respondWithFilteredResult(_0x405a52,_0x1b0929))[_0xbf50('0x3f')](handleError(_0x405a52,null));};exports[_0xbf50('0x40')]=function(_0x2f6406,_0x4b8f1a){var _0x100629={'raw':!![],'where':{'id':_0x2f6406[_0xbf50('0x41')]['id']}},_0x2df9f9={};_0x2df9f9[_0xbf50('0x2d')]=_['keys'](db[_0xbf50('0x2a')][_0xbf50('0x42')]);_0x2df9f9[_0xbf50('0x2e')]=_['keys'](_0x2f6406[_0xbf50('0x2e')]);_0x2df9f9[_0xbf50('0x37')]=_['intersection'](_0x2df9f9[_0xbf50('0x2d')],_0x2df9f9[_0xbf50('0x2e')]);_0x100629[_0xbf50('0x31')]=_[_0xbf50('0x2f')](_0x2df9f9[_0xbf50('0x2d')],qs[_0xbf50('0x30')](_0x2f6406['query'][_0xbf50('0x30')]));_0x100629[_0xbf50('0x31')]=_0x100629[_0xbf50('0x31')][_0xbf50('0x43')]?_0x100629['attributes']:_0x2df9f9[_0xbf50('0x2d')];if(_0x2f6406['query'][_0xbf50('0x3d')]){_0x100629[_0xbf50('0x3e')]=[{'all':!![]}];}_0x100629=_[_0xbf50('0x3a')]({},_0x100629,_0x2f6406[_0xbf50('0x3c')]);return db[_0xbf50('0x2a')][_0xbf50('0x44')](_0x100629)[_0xbf50('0x23')](handleEntityNotFound(_0x4b8f1a,null))[_0xbf50('0x23')](respondWithResult(_0x4b8f1a,null))[_0xbf50('0x3f')](handleError(_0x4b8f1a,null));};exports['create']=function(_0x2bd4c3,_0x401f9e){return db[_0xbf50('0x2a')][_0xbf50('0x45')](_0x2bd4c3[_0xbf50('0x46')],{})[_0xbf50('0x23')](respondWithResult(_0x401f9e,0xc9))[_0xbf50('0x3f')](handleError(_0x401f9e,null));};exports[_0xbf50('0x21')]=function(_0x350eac,_0x366bcd){if(_0x350eac['body']['id']){delete _0x350eac[_0xbf50('0x46')]['id'];}return db[_0xbf50('0x2a')][_0xbf50('0x44')]({'where':{'id':_0x350eac[_0xbf50('0x41')]['id']}})[_0xbf50('0x23')](handleEntityNotFound(_0x366bcd,null))['then'](saveUpdates(_0x350eac[_0xbf50('0x46')],null))[_0xbf50('0x23')](respondWithResult(_0x366bcd,null))[_0xbf50('0x3f')](handleError(_0x366bcd,null));};exports['destroy']=function(_0x549941,_0x4b2e8b){return db[_0xbf50('0x2a')][_0xbf50('0x44')]({'where':{'id':_0x549941[_0xbf50('0x41')]['id']}})[_0xbf50('0x23')](handleEntityNotFound(_0x4b2e8b,null))[_0xbf50('0x23')](removeEntity(_0x4b2e8b,null))[_0xbf50('0x3f')](handleError(_0x4b2e8b,null));};exports['describe']=function(_0x5de21e,_0x5f5e7b){return db[_0xbf50('0x2a')][_0xbf50('0x47')]()[_0xbf50('0x23')](respondWithResult(_0x5f5e7b,null))[_0xbf50('0x3f')](handleError(_0x5f5e7b,null));}; \ No newline at end of file +var _0x557f=['type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','stack','name','index','map','OpenchannelTransferReport','rawAttributes'];(function(_0x2a0b85,_0x4d9fe8){var _0x46d6d7=function(_0x37bb7e){while(--_0x37bb7e){_0x2a0b85['push'](_0x2a0b85['shift']());}};_0x46d6d7(++_0x4d9fe8);}(_0x557f,0x139));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf557('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf557('0x1'));var jsonpatch=require(_0xf557('0x2'));var rp=require(_0xf557('0x3'));var moment=require(_0xf557('0x4'));var BPromise=require(_0xf557('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf557('0x6'));var sox=require(_0xf557('0x7'));var csv=require(_0xf557('0x8'));var ejs=require(_0xf557('0x9'));var fs=require('fs');var fs_extra=require(_0xf557('0xa'));var _=require(_0xf557('0xb'));var squel=require(_0xf557('0xc'));var crypto=require(_0xf557('0xd'));var jsforce=require(_0xf557('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf557('0x8'));var querystring=require(_0xf557('0xf'));var Papa=require(_0xf557('0x10'));var Redis=require(_0xf557('0x11'));var authService=require(_0xf557('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf557('0x13'));var logger=require(_0xf557('0x14'))(_0xf557('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf557('0x16'));var db=require(_0xf557('0x17'))['db'];function respondWithStatusCode(_0x3938d4,_0x1bca77){_0x1bca77=_0x1bca77||0xcc;return function(_0x3cf8fd){if(_0x3cf8fd){return _0x3938d4['sendStatus'](_0x1bca77);}return _0x3938d4[_0xf557('0x18')](_0x1bca77)[_0xf557('0x19')]();};}function respondWithResult(_0x2043cd,_0x14fb28){_0x14fb28=_0x14fb28||0xc8;return function(_0x4fa19f){if(_0x4fa19f){return _0x2043cd[_0xf557('0x18')](_0x14fb28)[_0xf557('0x1a')](_0x4fa19f);}};}function respondWithFilteredResult(_0x160bc1,_0x23233c){return function(_0x5e975c){if(_0x5e975c){var _0x4a4854=typeof _0x23233c[_0xf557('0x1b')]===_0xf557('0x1c')&&typeof _0x23233c[_0xf557('0x1d')]===_0xf557('0x1c');var _0x39fdd6=_0x5e975c['count'];var _0x28928c=_0x4a4854?0x0:_0x23233c['offset'];var _0x22d335=_0x4a4854?_0x5e975c[_0xf557('0x1e')]:_0x23233c[_0xf557('0x1b')]+_0x23233c['limit'];var _0x5c7d86;if(_0x22d335>=_0x39fdd6){_0x22d335=_0x39fdd6;_0x5c7d86=0xc8;}else{_0x5c7d86=0xce;}_0x160bc1['status'](_0x5c7d86);return _0x160bc1['set'](_0xf557('0x1f'),_0x28928c+'-'+_0x22d335+'/'+_0x39fdd6)['json'](_0x5e975c);}return null;};}function patchUpdates(_0x55439a){return function(_0x1a00af){try{jsonpatch['apply'](_0x1a00af,_0x55439a,!![]);}catch(_0x16c8dc){return BPromise[_0xf557('0x20')](_0x16c8dc);}return _0x1a00af['save']();};}function saveUpdates(_0x1ddb80,_0x3ee723){return function(_0xab0f3f){if(_0xab0f3f){return _0xab0f3f[_0xf557('0x21')](_0x1ddb80)['then'](function(_0x4ba779){return _0x4ba779;});}return null;};}function removeEntity(_0x5a46dc,_0x437848){return function(_0x4dba91){if(_0x4dba91){return _0x4dba91['destroy']()[_0xf557('0x22')](function(){_0x5a46dc[_0xf557('0x18')](0xcc)[_0xf557('0x19')]();});}};}function handleEntityNotFound(_0x58b26d,_0x3923b9){return function(_0xbbe48b){if(!_0xbbe48b){_0x58b26d[_0xf557('0x23')](0x194);}return _0xbbe48b;};}function handleError(_0x36639a,_0x28bae4){_0x28bae4=_0x28bae4||0x1f4;return function(_0x563996){logger['error'](_0x563996[_0xf557('0x24')]);if(_0x563996[_0xf557('0x25')]){delete _0x563996[_0xf557('0x25')];}_0x36639a[_0xf557('0x18')](_0x28bae4)['send'](_0x563996);};}exports[_0xf557('0x26')]=function(_0x342f81,_0x151fe7){var _0x4fd2f9={},_0x5bddce={},_0x4c5adc={'count':0x0,'rows':[]};var _0x293871=_[_0xf557('0x27')](db[_0xf557('0x28')][_0xf557('0x29')],function(_0x9746bd){return{'name':_0x9746bd['fieldName'],'type':_0x9746bd[_0xf557('0x2a')]['key']};});_0x5bddce['model']=_[_0xf557('0x27')](_0x293871,_0xf557('0x25'));_0x5bddce['query']=_[_0xf557('0x2b')](_0x342f81[_0xf557('0x2c')]);_0x5bddce[_0xf557('0x2d')]=_[_0xf557('0x2e')](_0x5bddce[_0xf557('0x2f')],_0x5bddce['query']);_0x4fd2f9[_0xf557('0x30')]=_['intersection'](_0x5bddce[_0xf557('0x2f')],qs[_0xf557('0x31')](_0x342f81[_0xf557('0x2c')][_0xf557('0x31')]));_0x4fd2f9[_0xf557('0x30')]=_0x4fd2f9['attributes'][_0xf557('0x32')]?_0x4fd2f9[_0xf557('0x30')]:_0x5bddce[_0xf557('0x2f')];if(!_0x342f81['query'][_0xf557('0x33')](_0xf557('0x34'))){_0x4fd2f9[_0xf557('0x1d')]=qs[_0xf557('0x1d')](_0x342f81[_0xf557('0x2c')][_0xf557('0x1d')]);_0x4fd2f9['offset']=qs[_0xf557('0x1b')](_0x342f81[_0xf557('0x2c')][_0xf557('0x1b')]);}_0x4fd2f9[_0xf557('0x35')]=qs[_0xf557('0x36')](_0x342f81[_0xf557('0x2c')]['sort']);_0x4fd2f9['where']=qs[_0xf557('0x2d')](_['pick'](_0x342f81[_0xf557('0x2c')],_0x5bddce[_0xf557('0x2d')]),_0x293871);if(_0x342f81[_0xf557('0x2c')]['filter']){_0x4fd2f9[_0xf557('0x37')]=_['merge'](_0x4fd2f9[_0xf557('0x37')],{'$or':_[_0xf557('0x27')](_0x293871,function(_0x26b1ca){if(_0x26b1ca[_0xf557('0x2a')]!==_0xf557('0x38')){var _0x45e758={};_0x45e758[_0x26b1ca[_0xf557('0x25')]]={'$like':'%'+_0x342f81[_0xf557('0x2c')][_0xf557('0x39')]+'%'};return _0x45e758;}})});}_0x4fd2f9=_['merge']({},_0x4fd2f9,_0x342f81[_0xf557('0x3a')]);var _0x426639={'where':_0x4fd2f9[_0xf557('0x37')]};return db[_0xf557('0x28')][_0xf557('0x1e')](_0x426639)[_0xf557('0x22')](function(_0x163776){_0x4c5adc[_0xf557('0x1e')]=_0x163776;if(_0x342f81[_0xf557('0x2c')]['includeAll']){_0x4fd2f9[_0xf557('0x3b')]=[{'all':!![]}];}return db[_0xf557('0x28')][_0xf557('0x3c')](_0x4fd2f9);})['then'](function(_0x55f1fc){_0x4c5adc[_0xf557('0x3d')]=_0x55f1fc;return _0x4c5adc;})[_0xf557('0x22')](respondWithFilteredResult(_0x151fe7,_0x4fd2f9))[_0xf557('0x3e')](handleError(_0x151fe7,null));};exports[_0xf557('0x3f')]=function(_0x52850b,_0x9705a9){var _0xc8d501={'raw':!![],'where':{'id':_0x52850b[_0xf557('0x40')]['id']}},_0x34e076={};_0x34e076[_0xf557('0x2f')]=_[_0xf557('0x2b')](db[_0xf557('0x28')]['rawAttributes']);_0x34e076[_0xf557('0x2c')]=_[_0xf557('0x2b')](_0x52850b[_0xf557('0x2c')]);_0x34e076[_0xf557('0x2d')]=_[_0xf557('0x2e')](_0x34e076[_0xf557('0x2f')],_0x34e076[_0xf557('0x2c')]);_0xc8d501['attributes']=_[_0xf557('0x2e')](_0x34e076[_0xf557('0x2f')],qs[_0xf557('0x31')](_0x52850b[_0xf557('0x2c')][_0xf557('0x31')]));_0xc8d501[_0xf557('0x30')]=_0xc8d501[_0xf557('0x30')]['length']?_0xc8d501[_0xf557('0x30')]:_0x34e076['model'];if(_0x52850b[_0xf557('0x2c')][_0xf557('0x41')]){_0xc8d501['include']=[{'all':!![]}];}_0xc8d501=_['merge']({},_0xc8d501,_0x52850b[_0xf557('0x3a')]);return db[_0xf557('0x28')][_0xf557('0x42')](_0xc8d501)[_0xf557('0x22')](handleEntityNotFound(_0x9705a9,null))[_0xf557('0x22')](respondWithResult(_0x9705a9,null))[_0xf557('0x3e')](handleError(_0x9705a9,null));};exports[_0xf557('0x43')]=function(_0x21ea6d,_0x407d55){return db[_0xf557('0x28')]['create'](_0x21ea6d[_0xf557('0x44')],{})[_0xf557('0x22')](respondWithResult(_0x407d55,0xc9))[_0xf557('0x3e')](handleError(_0x407d55,null));};exports[_0xf557('0x21')]=function(_0x4e4184,_0xe12b5f){if(_0x4e4184['body']['id']){delete _0x4e4184[_0xf557('0x44')]['id'];}return db[_0xf557('0x28')][_0xf557('0x42')]({'where':{'id':_0x4e4184[_0xf557('0x40')]['id']}})[_0xf557('0x22')](handleEntityNotFound(_0xe12b5f,null))['then'](saveUpdates(_0x4e4184[_0xf557('0x44')],null))['then'](respondWithResult(_0xe12b5f,null))[_0xf557('0x3e')](handleError(_0xe12b5f,null));};exports[_0xf557('0x45')]=function(_0xf72d0d,_0xb654ac){return db[_0xf557('0x28')]['find']({'where':{'id':_0xf72d0d[_0xf557('0x40')]['id']}})[_0xf557('0x22')](handleEntityNotFound(_0xb654ac,null))[_0xf557('0x22')](removeEntity(_0xb654ac,null))[_0xf557('0x3e')](handleError(_0xb654ac,null));};exports[_0xf557('0x46')]=function(_0xe7b104,_0xbda10c){return db[_0xf557('0x28')][_0xf557('0x46')]()[_0xf557('0x22')](respondWithResult(_0xbda10c,null))[_0xf557('0x3e')](handleError(_0xbda10c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 913c5c6..ea29f24 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 _0xf08e=['api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','uniqueid','lodash','util','../../config/logger'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0xf08e,0x11f));var _0xef08=function(_0xe5052,_0x53b9e5){_0xe5052=_0xe5052-0x0;var _0x874d7d=_0xf08e[_0xe5052];return _0x874d7d;};'use strict';var _=require(_0xef08('0x0'));var util=require(_0xef08('0x1'));var logger=require(_0xef08('0x2'))(_0xef08('0x3'));var moment=require(_0xef08('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xef08('0x5'));var rimraf=require(_0xef08('0x6'));var config=require(_0xef08('0x7'));var attributes=require(_0xef08('0x8'));module['exports']=function(_0x3042bb,_0x49f5d1){return _0x3042bb['define']('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xef08('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc037=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','moment','bluebird','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc037,0xa0));var _0x7c03=function(_0x256686,_0x4ba61e){_0x256686=_0x256686-0x0;var _0x459665=_0xc037[_0x256686];return _0x459665;};'use strict';var _=require(_0x7c03('0x0'));var util=require(_0x7c03('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7c03('0x2'));var BPromise=require(_0x7c03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c03('0x4'));var config=require(_0x7c03('0x5'));var attributes=require(_0x7c03('0x6'));module[_0x7c03('0x7')]=function(_0x2fb178,_0x10f6b5){return _0x2fb178[_0x7c03('0x8')](_0x7c03('0x9'),attributes,{'tableName':_0x7c03('0xa'),'paranoid':![],'indexes':[{'name':_0x7c03('0xb'),'fields':[_0x7c03('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4afafa2..b71614f 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 _0x8ece=['client','http','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ece,0x195));var _0xe8ec=function(_0x3e3b4e,_0x2a974b){_0x3e3b4e=_0x3e3b4e-0x0;var _0x1e434b=_0x8ece[_0x3e3b4e];return _0x1e434b;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var moment=require(_0xe8ec('0x2'));var BPromise=require(_0xe8ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8ec('0x4'))['db'];var utils=require(_0xe8ec('0x5'));var logger=require(_0xe8ec('0x6'))(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ec('0x9')][_0xe8ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x64ed4c,_0x234b67,_0x3682cb){return new BPromise(function(_0x122f36,_0x406f7e){return client['request'](_0x64ed4c,_0x3682cb)[_0xe8ec('0xb')](function(_0x5e1fe9){logger[_0xe8ec('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x234b67,_0xe8ec('0xd'));logger[_0xe8ec('0xe')](_0xe8ec('0xf'),_0x234b67,_0xe8ec('0xd'),JSON[_0xe8ec('0x10')](_0x5e1fe9));if(_0x5e1fe9[_0xe8ec('0x11')]){if(_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x12')]===0x1f4){logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);return _0x406f7e(_0x5e1fe9[_0xe8ec('0x11')]['message']);}logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);return _0x122f36(_0x5e1fe9[_0xe8ec('0x11')][_0xe8ec('0x14')]);}else{logger[_0xe8ec('0xc')](_0xe8ec('0x13'),_0x234b67,'request\x20sent');_0x122f36(_0x5e1fe9[_0xe8ec('0x15')][_0xe8ec('0x14')]);}})[_0xe8ec('0x16')](function(_0x50f8ed){logger[_0xe8ec('0x11')](_0xe8ec('0x13'),_0x234b67,_0x50f8ed);_0x406f7e(_0x50f8ed);});});} \ No newline at end of file +var _0xd8b1=['../../mysqldb','../../config/utils','rpc','http','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xd8b1,0x105));var _0x1d8b=function(_0x178c2d,_0x169d68){_0x178c2d=_0x178c2d-0x0;var _0x421f79=_0xd8b1[_0x178c2d];return _0x421f79;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var moment=require(_0x1d8b('0x2'));var BPromise=require(_0x1d8b('0x3'));var rs=require(_0x1d8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d8b('0x5'))['db'];var utils=require(_0x1d8b('0x6'));var logger=require('../../config/logger')(_0x1d8b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5bbd,_0x3eb93a,_0xdba2e5){return new BPromise(function(_0x2b28e2,_0x4480cf){return client['request'](_0x5f5bbd,_0xdba2e5)['then'](function(_0x28be45){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3eb93a,_0x1d8b('0x9'));logger['debug'](_0x1d8b('0xa'),_0x3eb93a,'request\x20sent',JSON[_0x1d8b('0xb')](_0x28be45));if(_0x28be45[_0x1d8b('0xc')]){if(_0x28be45[_0x1d8b('0xc')][_0x1d8b('0xd')]===0x1f4){logger[_0x1d8b('0xc')](_0x1d8b('0xe'),_0x3eb93a,_0x28be45['error'][_0x1d8b('0xf')]);return _0x4480cf(_0x28be45[_0x1d8b('0xc')][_0x1d8b('0xf')]);}logger[_0x1d8b('0xc')](_0x1d8b('0xe'),_0x3eb93a,_0x28be45[_0x1d8b('0xc')][_0x1d8b('0xf')]);return _0x2b28e2(_0x28be45[_0x1d8b('0xc')]['message']);}else{logger[_0x1d8b('0x10')](_0x1d8b('0xe'),_0x3eb93a,_0x1d8b('0x9'));_0x2b28e2(_0x28be45[_0x1d8b('0x11')][_0x1d8b('0xf')]);}})[_0x1d8b('0x12')](function(_0x144556){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3eb93a,_0x144556);_0x4480cf(_0x144556);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 10cbf6a..be4333b 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 _0x5b5f=['../../components/auth/service','../../config/environment','./pause.controller','isAuthenticated','/:id','post','put','delete','destroy','path','connect-timeout','express','fs-extra'];(function(_0x18fb70,_0x24467b){var _0x4a36b5=function(_0x23dc7a){while(--_0x23dc7a){_0x18fb70['push'](_0x18fb70['shift']());}};_0x4a36b5(++_0x24467b);}(_0x5b5f,0xd9));var _0xf5b5=function(_0x1068ff,_0x3dd4f0){_0x1068ff=_0x1068ff-0x0;var _0x2040ac=_0x5b5f[_0x1068ff];return _0x2040ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf5b5('0x0'));var timeout=require(_0xf5b5('0x1'));var express=require(_0xf5b5('0x2'));var router=express['Router']();var fs_extra=require(_0xf5b5('0x3'));var auth=require(_0xf5b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf5b5('0x5'));var controller=require(_0xf5b5('0x6'));router['get']('/',auth[_0xf5b5('0x7')](),controller['index']);router['get'](_0xf5b5('0x8'),auth[_0xf5b5('0x7')](),controller['show']);router[_0xf5b5('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf5b5('0xa')](_0xf5b5('0x8'),auth[_0xf5b5('0x7')](),controller['update']);router[_0xf5b5('0xb')]('/:id',auth[_0xf5b5('0x7')](),controller[_0xf5b5('0xc')]);module['exports']=router; \ No newline at end of file +var _0xe055=['/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index','get'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe055,0x1cf));var _0x5e05=function(_0xa08526,_0xd2a376){_0xa08526=_0xa08526-0x0;var _0x2684eb=_0xe055[_0xa08526];return _0x2684eb;};'use strict';var multer=require(_0x5e05('0x0'));var util=require(_0x5e05('0x1'));var path=require(_0x5e05('0x2'));var timeout=require(_0x5e05('0x3'));var express=require(_0x5e05('0x4'));var router=express['Router']();var fs_extra=require(_0x5e05('0x5'));var auth=require(_0x5e05('0x6'));var interaction=require(_0x5e05('0x7'));var config=require('../../config/environment');var controller=require(_0x5e05('0x8'));router['get']('/',auth[_0x5e05('0x9')](),controller[_0x5e05('0xa')]);router[_0x5e05('0xb')](_0x5e05('0xc'),auth[_0x5e05('0x9')](),controller[_0x5e05('0xd')]);router['post']('/',auth[_0x5e05('0x9')](),controller[_0x5e05('0xe')]);router['put']('/:id',auth[_0x5e05('0x9')](),controller[_0x5e05('0xf')]);router[_0x5e05('0x10')]('/:id',auth[_0x5e05('0x9')](),controller[_0x5e05('0x11')]);module[_0x5e05('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9847b9a..38b0573 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 _0x70ea=['STRING','name','sequelize','exports'];(function(_0x5a678d,_0x478baf){var _0x499397=function(_0x1ccb61){while(--_0x1ccb61){_0x5a678d['push'](_0x5a678d['shift']());}};_0x499397(++_0x478baf);}(_0x70ea,0xaa));var _0xa70e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x70ea[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xa70e('0x0'));module[_0xa70e('0x1')]={'name':{'type':Sequelize[_0xa70e('0x2')],'unique':_0xa70e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xa70e('0x2')]}}; \ No newline at end of file +var _0xc07b=['exports','STRING','sequelize'];(function(_0x59eeaf,_0x56e107){var _0x119d61=function(_0xad3379){while(--_0xad3379){_0x59eeaf['push'](_0x59eeaf['shift']());}};_0x119d61(++_0x56e107);}(_0xc07b,0x101));var _0xbc07=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0xc07b[_0x2181fc];return _0x315da1;};'use strict';var Sequelize=require(_0xbc07('0x0'));module[_0xbc07('0x1')]={'name':{'type':Sequelize[_0xbc07('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbc07('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 024bbeb..f05f86d 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 _0x0286=['error','stack','name','send','map','Pause','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','show','params','length','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','get','Pauses','UserProfileResource','destroy'];(function(_0x39edab,_0x465164){var _0x247563=function(_0x21a639){while(--_0x21a639){_0x39edab['push'](_0x39edab['shift']());}};_0x247563(++_0x465164);}(_0x0286,0x79));var _0x6028=function(_0x39b28f,_0x330532){_0x39b28f=_0x39b28f-0x0;var _0x34721e=_0x0286[_0x39b28f];return _0x34721e;};'use strict';var emlformat=require(_0x6028('0x0'));var rimraf=require(_0x6028('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6028('0x2'));var rp=require('request-promise');var moment=require(_0x6028('0x3'));var BPromise=require(_0x6028('0x4'));var Mustache=require(_0x6028('0x5'));var util=require(_0x6028('0x6'));var path=require('path');var sox=require(_0x6028('0x7'));var csv=require(_0x6028('0x8'));var ejs=require(_0x6028('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6028('0xa'));var squel=require(_0x6028('0xb'));var crypto=require(_0x6028('0xc'));var jsforce=require(_0x6028('0xd'));var deskjs=require(_0x6028('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6028('0xf'));var Papa=require(_0x6028('0x10'));var Redis=require(_0x6028('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6028('0x12'))(_0x6028('0x13'));var utils=require(_0x6028('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6028('0x15'));var db=require(_0x6028('0x16'))['db'];function respondWithStatusCode(_0x4e5e0a,_0x5a3944){_0x5a3944=_0x5a3944||0xcc;return function(_0x2a1be1){if(_0x2a1be1){return _0x4e5e0a[_0x6028('0x17')](_0x5a3944);}return _0x4e5e0a[_0x6028('0x18')](_0x5a3944)[_0x6028('0x19')]();};}function respondWithResult(_0x27c52f,_0x2c6361){_0x2c6361=_0x2c6361||0xc8;return function(_0x266ab7){if(_0x266ab7){return _0x27c52f['status'](_0x2c6361)[_0x6028('0x1a')](_0x266ab7);}};}function respondWithFilteredResult(_0x1ebf39,_0x234e12){return function(_0x2ed153){if(_0x2ed153){var _0x13cc2a=typeof _0x234e12['offset']===_0x6028('0x1b')&&typeof _0x234e12[_0x6028('0x1c')]==='undefined';var _0x9d9bdd=_0x2ed153[_0x6028('0x1d')];var _0x17add2=_0x13cc2a?0x0:_0x234e12[_0x6028('0x1e')];var _0x464c2f=_0x13cc2a?_0x2ed153['count']:_0x234e12[_0x6028('0x1e')]+_0x234e12[_0x6028('0x1c')];var _0x23749d;if(_0x464c2f>=_0x9d9bdd){_0x464c2f=_0x9d9bdd;_0x23749d=0xc8;}else{_0x23749d=0xce;}_0x1ebf39[_0x6028('0x18')](_0x23749d);return _0x1ebf39[_0x6028('0x1f')](_0x6028('0x20'),_0x17add2+'-'+_0x464c2f+'/'+_0x9d9bdd)[_0x6028('0x1a')](_0x2ed153);}return null;};}function patchUpdates(_0x2cc8e9){return function(_0x2e3fe5){try{jsonpatch[_0x6028('0x21')](_0x2e3fe5,_0x2cc8e9,!![]);}catch(_0xd14b45){return BPromise['reject'](_0xd14b45);}return _0x2e3fe5[_0x6028('0x22')]();};}function saveUpdates(_0x34b73f,_0x3aa6bc){return function(_0x2c2764){if(_0x2c2764){return _0x2c2764[_0x6028('0x23')](_0x34b73f)[_0x6028('0x24')](function(_0x550bdd){return _0x550bdd;});}return null;};}function removeEntity(_0x5dafe2,_0x4921dd){return function(_0x3c652b){if(_0x3c652b){return _0x3c652b['destroy']()['then'](function(){var _0x498f76=_0x3c652b[_0x6028('0x25')]({'plain':!![]});var _0x168f90=_0x6028('0x26');return db[_0x6028('0x27')][_0x6028('0x28')]({'where':{'type':_0x168f90,'resourceId':_0x498f76['id']}})[_0x6028('0x24')](function(){return _0x3c652b;});})['then'](function(){_0x5dafe2['status'](0xcc)[_0x6028('0x19')]();});}};}function handleEntityNotFound(_0x28c5a3,_0x33af5d){return function(_0x376884){if(!_0x376884){_0x28c5a3[_0x6028('0x17')](0x194);}return _0x376884;};}function handleError(_0x392add,_0x2f4ab6){_0x2f4ab6=_0x2f4ab6||0x1f4;return function(_0x1d49d0){logger[_0x6028('0x29')](_0x1d49d0[_0x6028('0x2a')]);if(_0x1d49d0['name']){delete _0x1d49d0[_0x6028('0x2b')];}_0x392add[_0x6028('0x18')](_0x2f4ab6)[_0x6028('0x2c')](_0x1d49d0);};}exports['index']=function(_0xf93872,_0x1f61d0){var _0x1056f6={},_0x33ebcd={},_0x19c538={'count':0x0,'rows':[]};var _0x288428=_[_0x6028('0x2d')](db[_0x6028('0x2e')][_0x6028('0x2f')],function(_0x1b5873){return{'name':_0x1b5873[_0x6028('0x30')],'type':_0x1b5873[_0x6028('0x31')]['key']};});_0x33ebcd['model']=_['map'](_0x288428,_0x6028('0x2b'));_0x33ebcd[_0x6028('0x32')]=_[_0x6028('0x33')](_0xf93872[_0x6028('0x32')]);_0x33ebcd['filters']=_[_0x6028('0x34')](_0x33ebcd[_0x6028('0x35')],_0x33ebcd[_0x6028('0x32')]);_0x1056f6['attributes']=_[_0x6028('0x34')](_0x33ebcd[_0x6028('0x35')],qs[_0x6028('0x36')](_0xf93872['query'][_0x6028('0x36')]));_0x1056f6[_0x6028('0x37')]=_0x1056f6[_0x6028('0x37')]['length']?_0x1056f6[_0x6028('0x37')]:_0x33ebcd[_0x6028('0x35')];if(!_0xf93872[_0x6028('0x32')][_0x6028('0x38')](_0x6028('0x39'))){_0x1056f6[_0x6028('0x1c')]=qs[_0x6028('0x1c')](_0xf93872[_0x6028('0x32')][_0x6028('0x1c')]);_0x1056f6[_0x6028('0x1e')]=qs[_0x6028('0x1e')](_0xf93872['query']['offset']);}_0x1056f6[_0x6028('0x3a')]=qs[_0x6028('0x3b')](_0xf93872[_0x6028('0x32')][_0x6028('0x3b')]);_0x1056f6[_0x6028('0x3c')]=qs[_0x6028('0x3d')](_[_0x6028('0x3e')](_0xf93872['query'],_0x33ebcd[_0x6028('0x3d')]),_0x288428);if(_0xf93872['query']['filter']){_0x1056f6[_0x6028('0x3c')]=_[_0x6028('0x3f')](_0x1056f6['where'],{'$or':_['map'](_0x288428,function(_0x67898c){if(_0x67898c[_0x6028('0x31')]!==_0x6028('0x40')){var _0x309083={};_0x309083[_0x67898c[_0x6028('0x2b')]]={'$like':'%'+_0xf93872[_0x6028('0x32')][_0x6028('0x41')]+'%'};return _0x309083;}})});}_0x1056f6=_[_0x6028('0x3f')]({},_0x1056f6,_0xf93872['options']);var _0x572613={'where':_0x1056f6['where']};return db[_0x6028('0x2e')][_0x6028('0x1d')](_0x572613)[_0x6028('0x24')](function(_0x10c4f9){_0x19c538['count']=_0x10c4f9;if(_0xf93872[_0x6028('0x32')]['includeAll']){_0x1056f6[_0x6028('0x42')]=[{'all':!![]}];}return db['Pause'][_0x6028('0x43')](_0x1056f6);})[_0x6028('0x24')](function(_0xe51fb2){_0x19c538[_0x6028('0x44')]=_0xe51fb2;return _0x19c538;})[_0x6028('0x24')](respondWithFilteredResult(_0x1f61d0,_0x1056f6))['catch'](handleError(_0x1f61d0,null));};exports[_0x6028('0x45')]=function(_0x1f932c,_0x125955){var _0x46e805={'raw':!![],'where':{'id':_0x1f932c[_0x6028('0x46')]['id']}},_0x4cc261={};_0x4cc261[_0x6028('0x35')]=_['keys'](db[_0x6028('0x2e')][_0x6028('0x2f')]);_0x4cc261[_0x6028('0x32')]=_[_0x6028('0x33')](_0x1f932c['query']);_0x4cc261[_0x6028('0x3d')]=_[_0x6028('0x34')](_0x4cc261['model'],_0x4cc261[_0x6028('0x32')]);_0x46e805[_0x6028('0x37')]=_['intersection'](_0x4cc261[_0x6028('0x35')],qs[_0x6028('0x36')](_0x1f932c[_0x6028('0x32')][_0x6028('0x36')]));_0x46e805[_0x6028('0x37')]=_0x46e805[_0x6028('0x37')][_0x6028('0x47')]?_0x46e805[_0x6028('0x37')]:_0x4cc261[_0x6028('0x35')];if(_0x1f932c[_0x6028('0x32')][_0x6028('0x48')]){_0x46e805['include']=[{'all':!![]}];}_0x46e805=_['merge']({},_0x46e805,_0x1f932c[_0x6028('0x49')]);return db[_0x6028('0x2e')][_0x6028('0x4a')](_0x46e805)[_0x6028('0x24')](handleEntityNotFound(_0x125955,null))[_0x6028('0x24')](respondWithResult(_0x125955,null))['catch'](handleError(_0x125955,null));};exports[_0x6028('0x4b')]=function(_0x374fa9,_0x1fdcd5){return db[_0x6028('0x2e')][_0x6028('0x4b')](_0x374fa9[_0x6028('0x4c')],{})[_0x6028('0x24')](function(_0x265ace){var _0x27418a=_0x374fa9['user'][_0x6028('0x25')]({'plain':!![]});if(!_0x27418a)throw new Error(_0x6028('0x4d'));if(_0x27418a['role']==='user'){var _0x52eda7=_0x265ace[_0x6028('0x25')]({'plain':!![]});var _0x33655a=_0x6028('0x26');return db[_0x6028('0x4e')][_0x6028('0x4a')]({'where':{'name':_0x33655a,'userProfileId':_0x27418a['userProfileId']},'raw':!![]})[_0x6028('0x24')](function(_0x42e359){if(_0x42e359&&_0x42e359[_0x6028('0x4f')]===0x0){return db[_0x6028('0x27')][_0x6028('0x4b')]({'name':_0x52eda7[_0x6028('0x2b')],'resourceId':_0x52eda7['id'],'type':_0x42e359[_0x6028('0x2b')],'sectionId':_0x42e359['id']},{})['then'](function(){return _0x265ace;});}else{return _0x265ace;}})['catch'](function(_0xa5acdc){logger[_0x6028('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa5acdc);throw _0xa5acdc;});}return _0x265ace;})[_0x6028('0x24')](respondWithResult(_0x1fdcd5,0xc9))[_0x6028('0x50')](handleError(_0x1fdcd5,null));};exports['update']=function(_0x7b6a76,_0x3e3068){if(_0x7b6a76[_0x6028('0x4c')]['id']){delete _0x7b6a76[_0x6028('0x4c')]['id'];}return db[_0x6028('0x2e')][_0x6028('0x4a')]({'where':{'id':_0x7b6a76[_0x6028('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e3068,null))[_0x6028('0x24')](saveUpdates(_0x7b6a76['body'],null))[_0x6028('0x24')](respondWithResult(_0x3e3068,null))[_0x6028('0x50')](handleError(_0x3e3068,null));};exports[_0x6028('0x28')]=function(_0x4eb7a4,_0x5a8b0e){return db[_0x6028('0x2e')][_0x6028('0x4a')]({'where':{'id':_0x4eb7a4[_0x6028('0x46')]['id']}})[_0x6028('0x24')](handleEntityNotFound(_0x5a8b0e,null))[_0x6028('0x24')](removeEntity(_0x5a8b0e,null))[_0x6028('0x50')](handleError(_0x5a8b0e,null));}; \ No newline at end of file +var _0xb835=['keys','filters','query','attributes','intersection','fields','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','destroy','then','Pauses','UserProfileResource','error','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model'];(function(_0x3e9af0,_0xb82e07){var _0x243da8=function(_0x24e37d){while(--_0x24e37d){_0x3e9af0['push'](_0x3e9af0['shift']());}};_0x243da8(++_0xb82e07);}(_0xb835,0x156));var _0x5b83=function(_0x3f2603,_0x10cbb4){_0x3f2603=_0x3f2603-0x0;var _0x48eb7a=_0xb835[_0x3f2603];return _0x48eb7a;};'use strict';var emlformat=require(_0x5b83('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b83('0x1'));var jsonpatch=require(_0x5b83('0x2'));var rp=require(_0x5b83('0x3'));var moment=require(_0x5b83('0x4'));var BPromise=require(_0x5b83('0x5'));var Mustache=require(_0x5b83('0x6'));var util=require(_0x5b83('0x7'));var path=require(_0x5b83('0x8'));var sox=require('sox');var csv=require(_0x5b83('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b83('0xa'));var _=require('lodash');var squel=require(_0x5b83('0xb'));var crypto=require(_0x5b83('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5b83('0xd'));var toCsv=require(_0x5b83('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5b83('0xe'));var authService=require(_0x5b83('0xf'));var qs=require(_0x5b83('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b83('0x11'));var logger=require('../../config/logger')(_0x5b83('0x12'));var utils=require(_0x5b83('0x13'));var config=require(_0x5b83('0x14'));var licenseUtil=require(_0x5b83('0x15'));var db=require(_0x5b83('0x16'))['db'];function respondWithStatusCode(_0x54d139,_0x4e98e1){_0x4e98e1=_0x4e98e1||0xcc;return function(_0x5a29fc){if(_0x5a29fc){return _0x54d139[_0x5b83('0x17')](_0x4e98e1);}return _0x54d139[_0x5b83('0x18')](_0x4e98e1)[_0x5b83('0x19')]();};}function respondWithResult(_0x16a339,_0x3c6432){_0x3c6432=_0x3c6432||0xc8;return function(_0x5a0b89){if(_0x5a0b89){return _0x16a339['status'](_0x3c6432)[_0x5b83('0x1a')](_0x5a0b89);}};}function respondWithFilteredResult(_0x483bb8,_0x3b2d78){return function(_0x23a0f0){if(_0x23a0f0){var _0x3f7d2d=typeof _0x3b2d78[_0x5b83('0x1b')]===_0x5b83('0x1c')&&typeof _0x3b2d78['limit']===_0x5b83('0x1c');var _0x52d68a=_0x23a0f0['count'];var _0x514dfc=_0x3f7d2d?0x0:_0x3b2d78[_0x5b83('0x1b')];var _0x193137=_0x3f7d2d?_0x23a0f0[_0x5b83('0x1d')]:_0x3b2d78[_0x5b83('0x1b')]+_0x3b2d78[_0x5b83('0x1e')];var _0x268b85;if(_0x193137>=_0x52d68a){_0x193137=_0x52d68a;_0x268b85=0xc8;}else{_0x268b85=0xce;}_0x483bb8[_0x5b83('0x18')](_0x268b85);return _0x483bb8['set'](_0x5b83('0x1f'),_0x514dfc+'-'+_0x193137+'/'+_0x52d68a)[_0x5b83('0x1a')](_0x23a0f0);}return null;};}function patchUpdates(_0x1f9668){return function(_0x22bdb0){try{jsonpatch['apply'](_0x22bdb0,_0x1f9668,!![]);}catch(_0x414621){return BPromise['reject'](_0x414621);}return _0x22bdb0['save']();};}function saveUpdates(_0x109277,_0xcbfba1){return function(_0x18fa66){if(_0x18fa66){return _0x18fa66[_0x5b83('0x20')](_0x109277)['then'](function(_0x663722){return _0x663722;});}return null;};}function removeEntity(_0x576daa,_0x1fdc47){return function(_0x4f1d5c){if(_0x4f1d5c){return _0x4f1d5c[_0x5b83('0x21')]()[_0x5b83('0x22')](function(){var _0x2c9465=_0x4f1d5c['get']({'plain':!![]});var _0x5150ce=_0x5b83('0x23');return db[_0x5b83('0x24')]['destroy']({'where':{'type':_0x5150ce,'resourceId':_0x2c9465['id']}})[_0x5b83('0x22')](function(){return _0x4f1d5c;});})[_0x5b83('0x22')](function(){_0x576daa[_0x5b83('0x18')](0xcc)[_0x5b83('0x19')]();});}};}function handleEntityNotFound(_0x36cc7f,_0x1c67e4){return function(_0x514890){if(!_0x514890){_0x36cc7f[_0x5b83('0x17')](0x194);}return _0x514890;};}function handleError(_0x406242,_0x1728e0){_0x1728e0=_0x1728e0||0x1f4;return function(_0x2533ab){logger[_0x5b83('0x25')](_0x2533ab[_0x5b83('0x26')]);if(_0x2533ab['name']){delete _0x2533ab[_0x5b83('0x27')];}_0x406242[_0x5b83('0x18')](_0x1728e0)[_0x5b83('0x28')](_0x2533ab);};}exports['index']=function(_0x35f894,_0x1e57a7){var _0x2afb4d={},_0x3ed9ec={},_0x3836c5={'count':0x0,'rows':[]};var _0x49fd89=_[_0x5b83('0x29')](db[_0x5b83('0x2a')][_0x5b83('0x2b')],function(_0x360e96){return{'name':_0x360e96[_0x5b83('0x2c')],'type':_0x360e96[_0x5b83('0x2d')][_0x5b83('0x2e')]};});_0x3ed9ec[_0x5b83('0x2f')]=_[_0x5b83('0x29')](_0x49fd89,'name');_0x3ed9ec['query']=_[_0x5b83('0x30')](_0x35f894['query']);_0x3ed9ec[_0x5b83('0x31')]=_['intersection'](_0x3ed9ec[_0x5b83('0x2f')],_0x3ed9ec[_0x5b83('0x32')]);_0x2afb4d[_0x5b83('0x33')]=_[_0x5b83('0x34')](_0x3ed9ec[_0x5b83('0x2f')],qs[_0x5b83('0x35')](_0x35f894['query'][_0x5b83('0x35')]));_0x2afb4d[_0x5b83('0x33')]=_0x2afb4d[_0x5b83('0x33')]['length']?_0x2afb4d[_0x5b83('0x33')]:_0x3ed9ec[_0x5b83('0x2f')];if(!_0x35f894[_0x5b83('0x32')]['hasOwnProperty']('nolimit')){_0x2afb4d[_0x5b83('0x1e')]=qs[_0x5b83('0x1e')](_0x35f894[_0x5b83('0x32')][_0x5b83('0x1e')]);_0x2afb4d[_0x5b83('0x1b')]=qs['offset'](_0x35f894[_0x5b83('0x32')]['offset']);}_0x2afb4d[_0x5b83('0x36')]=qs[_0x5b83('0x37')](_0x35f894[_0x5b83('0x32')][_0x5b83('0x37')]);_0x2afb4d[_0x5b83('0x38')]=qs[_0x5b83('0x31')](_[_0x5b83('0x39')](_0x35f894['query'],_0x3ed9ec[_0x5b83('0x31')]),_0x49fd89);if(_0x35f894[_0x5b83('0x32')][_0x5b83('0x3a')]){_0x2afb4d['where']=_[_0x5b83('0x3b')](_0x2afb4d[_0x5b83('0x38')],{'$or':_[_0x5b83('0x29')](_0x49fd89,function(_0x254c57){if(_0x254c57[_0x5b83('0x2d')]!=='VIRTUAL'){var _0x5e580e={};_0x5e580e[_0x254c57[_0x5b83('0x27')]]={'$like':'%'+_0x35f894[_0x5b83('0x32')][_0x5b83('0x3a')]+'%'};return _0x5e580e;}})});}_0x2afb4d=_[_0x5b83('0x3b')]({},_0x2afb4d,_0x35f894['options']);var _0x765349={'where':_0x2afb4d['where']};return db['Pause'][_0x5b83('0x1d')](_0x765349)['then'](function(_0x45d4c0){_0x3836c5['count']=_0x45d4c0;if(_0x35f894['query'][_0x5b83('0x3c')]){_0x2afb4d[_0x5b83('0x3d')]=[{'all':!![]}];}return db[_0x5b83('0x2a')][_0x5b83('0x3e')](_0x2afb4d);})[_0x5b83('0x22')](function(_0xc7d844){_0x3836c5[_0x5b83('0x3f')]=_0xc7d844;return _0x3836c5;})['then'](respondWithFilteredResult(_0x1e57a7,_0x2afb4d))[_0x5b83('0x40')](handleError(_0x1e57a7,null));};exports[_0x5b83('0x41')]=function(_0x9742ff,_0x457047){var _0x3fb081={'raw':!![],'where':{'id':_0x9742ff[_0x5b83('0x42')]['id']}},_0x1a78ce={};_0x1a78ce[_0x5b83('0x2f')]=_[_0x5b83('0x30')](db[_0x5b83('0x2a')]['rawAttributes']);_0x1a78ce[_0x5b83('0x32')]=_['keys'](_0x9742ff[_0x5b83('0x32')]);_0x1a78ce[_0x5b83('0x31')]=_[_0x5b83('0x34')](_0x1a78ce['model'],_0x1a78ce[_0x5b83('0x32')]);_0x3fb081[_0x5b83('0x33')]=_[_0x5b83('0x34')](_0x1a78ce['model'],qs[_0x5b83('0x35')](_0x9742ff['query']['fields']));_0x3fb081['attributes']=_0x3fb081[_0x5b83('0x33')][_0x5b83('0x43')]?_0x3fb081[_0x5b83('0x33')]:_0x1a78ce[_0x5b83('0x2f')];if(_0x9742ff[_0x5b83('0x32')][_0x5b83('0x3c')]){_0x3fb081[_0x5b83('0x3d')]=[{'all':!![]}];}_0x3fb081=_[_0x5b83('0x3b')]({},_0x3fb081,_0x9742ff['options']);return db[_0x5b83('0x2a')]['find'](_0x3fb081)[_0x5b83('0x22')](handleEntityNotFound(_0x457047,null))[_0x5b83('0x22')](respondWithResult(_0x457047,null))['catch'](handleError(_0x457047,null));};exports['create']=function(_0x183cbe,_0x5d053c){return db[_0x5b83('0x2a')][_0x5b83('0x44')](_0x183cbe[_0x5b83('0x45')],{})[_0x5b83('0x22')](function(_0x3a6cf2){var _0x3d7d35=_0x183cbe[_0x5b83('0x46')]['get']({'plain':!![]});if(!_0x3d7d35)throw new Error(_0x5b83('0x47'));if(_0x3d7d35['role']===_0x5b83('0x46')){var _0x3079af=_0x3a6cf2[_0x5b83('0x48')]({'plain':!![]});var _0x9b43a2=_0x5b83('0x23');return db[_0x5b83('0x49')][_0x5b83('0x4a')]({'where':{'name':_0x9b43a2,'userProfileId':_0x3d7d35[_0x5b83('0x4b')]},'raw':!![]})[_0x5b83('0x22')](function(_0x21fe66){if(_0x21fe66&&_0x21fe66[_0x5b83('0x4c')]===0x0){return db[_0x5b83('0x24')][_0x5b83('0x44')]({'name':_0x3079af[_0x5b83('0x27')],'resourceId':_0x3079af['id'],'type':_0x21fe66[_0x5b83('0x27')],'sectionId':_0x21fe66['id']},{})[_0x5b83('0x22')](function(){return _0x3a6cf2;});}else{return _0x3a6cf2;}})[_0x5b83('0x40')](function(_0x46710a){logger[_0x5b83('0x25')](_0x5b83('0x4d'),_0x46710a);throw _0x46710a;});}return _0x3a6cf2;})[_0x5b83('0x22')](respondWithResult(_0x5d053c,0xc9))[_0x5b83('0x40')](handleError(_0x5d053c,null));};exports[_0x5b83('0x20')]=function(_0x3bcdea,_0x3c1059){if(_0x3bcdea[_0x5b83('0x45')]['id']){delete _0x3bcdea[_0x5b83('0x45')]['id'];}return db[_0x5b83('0x2a')]['find']({'where':{'id':_0x3bcdea[_0x5b83('0x42')]['id']}})[_0x5b83('0x22')](handleEntityNotFound(_0x3c1059,null))[_0x5b83('0x22')](saveUpdates(_0x3bcdea[_0x5b83('0x45')],null))[_0x5b83('0x22')](respondWithResult(_0x3c1059,null))['catch'](handleError(_0x3c1059,null));};exports[_0x5b83('0x21')]=function(_0x47291b,_0xaf545d){return db['Pause'][_0x5b83('0x4a')]({'where':{'id':_0x47291b[_0x5b83('0x42')]['id']}})[_0x5b83('0x22')](handleEntityNotFound(_0xaf545d,null))[_0x5b83('0x22')](removeEntity(_0xaf545d,null))[_0x5b83('0x40')](handleError(_0xaf545d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4f86d5c..2caf9d0 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 _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x242f1e,_0x98bf0f){var _0x2d36d7=function(_0x46b18b){while(--_0x46b18b){_0x242f1e['push'](_0x242f1e['shift']());}};_0x2d36d7(++_0x98bf0f);}(_0x53ec,0x192));var _0xc53e=function(_0x323c7e,_0x3d16ec){_0x323c7e=_0x323c7e-0x0;var _0x2b0f72=_0x53ec[_0x323c7e];return _0x2b0f72;};'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 +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x33cf66,_0x30e414){var _0x3a400b=function(_0x29130b){while(--_0x29130b){_0x33cf66['push'](_0x33cf66['shift']());}};_0x3a400b(++_0x30e414);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3fbf6d,_0x3fea86){_0x3fbf6d=_0x3fbf6d-0x0;var _0x2fe1bc=_0x8ef6[_0x3fbf6d];return _0x2fe1bc;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index e7de8af..296e62a 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(_0x3aff88,_0x2c9094){var _0x335baf=function(_0x48ebbf){while(--_0x48ebbf){_0x3aff88['push'](_0x3aff88['shift']());}};_0x335baf(++_0x2c9094);}(_0xb10b,0x12a));var _0xbb10=function(_0xb60ae4,_0x48b458){_0xb60ae4=_0xb60ae4-0x0;var _0x53d530=_0xb10b[_0xb60ae4];return _0x53d530;};'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(_0xb2a95d,_0x4bbee0){var _0x2d9a2f=function(_0x4a3f82){while(--_0x4a3f82){_0xb2a95d['push'](_0xb2a95d['shift']());}};_0x2d9a2f(++_0x4bbee0);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ebec4,_0x474731){_0x5ebec4=_0x5ebec4-0x0;var _0x3b9d3b=_0xb10b[_0x5ebec4];return _0x3b9d3b;};'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 303eeb3..9b8ecac 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 _0x984b=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/webhook','webhookGet','/:id','show','get','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','file','upload','put','update','delete','exports','connect-timeout','express'];(function(_0x127d89,_0x3e52bc){var _0x238e98=function(_0x45f11f){while(--_0x45f11f){_0x127d89['push'](_0x127d89['shift']());}};_0x238e98(++_0x3e52bc);}(_0x984b,0xee));var _0xb984=function(_0x81c55f,_0x16f964){_0x81c55f=_0x81c55f-0x0;var _0xb2ef9a=_0x984b[_0x81c55f];return _0xb2ef9a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var controller=require('./plugin.controller');router['get']('/',auth[_0xb984('0x5')](),controller[_0xb984('0x6')]);router['get'](_0xb984('0x7'),controller[_0xb984('0x8')]);router['get'](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0xa')]);router[_0xb984('0xb')](_0xb984('0xc'),auth[_0xb984('0x5')](),controller[_0xb984('0xd')]);var upload=multer({'storage':multer[_0xb984('0xe')]({'destination':function(_0x11525c,_0xfca315,_0x16d46f){_0x16d46f(null,path[_0xb984('0xf')](config[_0xb984('0x10')],_0xb984('0x11')));},'filename':function(_0x5b4add,_0x1b922b,_0x4b9c75){_0x1b922b[_0xb984('0x12')]=_0x1b922b[_0xb984('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b9c75(null,util[_0xb984('0x13')](_0xb984('0x14'),path['basename'](_0x1b922b[_0xb984('0x12')],path[_0xb984('0x15')](_0x1b922b['originalname'])),Date[_0xb984('0x16')](),path[_0xb984('0x15')](_0x1b922b['originalname'])));}})});router[_0xb984('0x17')]('/',upload['single'](_0xb984('0x18')),controller[_0xb984('0x19')]);router[_0xb984('0x17')](_0xb984('0x7'),controller['webhookPost']);router[_0xb984('0x1a')](_0xb984('0x9'),auth[_0xb984('0x5')](),controller[_0xb984('0x1b')]);router[_0xb984('0x1c')](_0xb984('0x9'),auth['isAuthenticated'](),controller[_0xb984('0x1c')]);module[_0xb984('0x1d')]=router; \ No newline at end of file +var _0x1cc7=['path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util'];(function(_0x3dd3de,_0x54508f){var _0x30c8da=function(_0x2502b6){while(--_0x2502b6){_0x3dd3de['push'](_0x3dd3de['shift']());}};_0x30c8da(++_0x54508f);}(_0x1cc7,0x15a));var _0x71cc=function(_0xbe203f,_0x3bc771){_0xbe203f=_0xbe203f-0x0;var _0x1a640d=_0x1cc7[_0xbe203f];return _0x1a640d;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')](_0x71cc('0xa'),auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0x7')](_0x71cc('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b7514,_0xeb4747,_0x2db190){_0x2db190(null,path[_0x71cc('0xd')](config['root'],_0x71cc('0xe')));},'filename':function(_0x550b3c,_0x1aad83,_0x4f9c5c){_0x1aad83[_0x71cc('0xf')]=_0x1aad83['originalname'][_0x71cc('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f9c5c(null,util[_0x71cc('0x11')](_0x71cc('0x12'),path[_0x71cc('0x13')](_0x1aad83[_0x71cc('0xf')],path['extname'](_0x1aad83[_0x71cc('0xf')])),Date[_0x71cc('0x14')](),path[_0x71cc('0x15')](_0x1aad83[_0x71cc('0xf')])));}})});router[_0x71cc('0x16')]('/',upload[_0x71cc('0x17')](_0x71cc('0x18')),controller['upload']);router[_0x71cc('0x16')](_0x71cc('0x8'),controller[_0x71cc('0x19')]);router[_0x71cc('0x1a')](_0x71cc('0xa'),auth[_0x71cc('0x6')](),controller['update']);router[_0x71cc('0x1b')](_0x71cc('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x71cc('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index c6da8c9..54e9143 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 _0xacbd=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script'];(function(_0x5295a5,_0x2f106a){var _0x499291=function(_0x5e2f29){while(--_0x5e2f29){_0x5295a5['push'](_0x5295a5['shift']());}};_0x499291(++_0x2f106a);}(_0xacbd,0x8a));var _0xdacb=function(_0x3feafa,_0x5aaf84){_0x3feafa=_0x3feafa-0x0;var _0x29ec9c=_0xacbd[_0x3feafa];return _0x29ec9c;};'use strict';var Sequelize=require(_0xdacb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdacb('0x1')]},'type':{'type':Sequelize[_0xdacb('0x2')](_0xdacb('0x3'),_0xdacb('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xdacb('0x5')]},'path':{'type':Sequelize[_0xdacb('0x1')],'comment':_0xdacb('0x6')},'active':{'type':Sequelize[_0xdacb('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xdacb('0x8'),'agentOnly','always','never'),'defaultValue':_0xdacb('0x9'),'comment':_0xdacb('0xa')},'icon':{'type':Sequelize[_0xdacb('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xdacb('0x1')]},'scriptPath':{'type':Sequelize[_0xdacb('0x1')]}}; \ No newline at end of file +var _0x1817=['ENUM','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','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x5867d8,_0x3a656b){var _0x32f008=function(_0xf038e8){while(--_0xf038e8){_0x5867d8['push'](_0x5867d8['shift']());}};_0x32f008(++_0x3a656b);}(_0x1817,0x1eb));var _0x7181=function(_0x10ba87,_0x594501){_0x10ba87=_0x10ba87-0x0;var _0x47416e=_0x1817[_0x10ba87];return _0x47416e;};'use strict';var Sequelize=require(_0x7181('0x0'));module[_0x7181('0x1')]={'name':{'type':Sequelize[_0x7181('0x2')]},'type':{'type':Sequelize[_0x7181('0x3')]('html',_0x7181('0x4'))},'description':{'type':Sequelize[_0x7181('0x5')]},'version':{'type':Sequelize[_0x7181('0x5')]},'path':{'type':Sequelize[_0x7181('0x2')],'comment':_0x7181('0x6')},'active':{'type':Sequelize[_0x7181('0x7')],'defaultValue':0x0,'comment':_0x7181('0x8')},'sidebar':{'type':Sequelize[_0x7181('0x3')]('adminOnly',_0x7181('0x9'),'always',_0x7181('0xa')),'defaultValue':_0x7181('0xb'),'comment':_0x7181('0xc')},'icon':{'type':Sequelize[_0x7181('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x7181('0x2')]},'scriptName':{'type':Sequelize[_0x7181('0x2')]},'scriptPath':{'type':Sequelize[_0x7181('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index cd02156..7ce49a7 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 _0xc86e=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','download','params','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','extname','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','type','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','webhookGet','resolve','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','set','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./plugin.socket','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','destroy','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x22eea0,_0x1a8e15){var _0x518fa5=function(_0x1232cb){while(--_0x1232cb){_0x22eea0['push'](_0x22eea0['shift']());}};_0x518fa5(++_0x1a8e15);}(_0xc86e,0x110));var _0xec86=function(_0x44d6da,_0x146ce2){_0x44d6da=_0x44d6da-0x0;var _0x2f37ae=_0xc86e[_0x44d6da];return _0x2f37ae;};'use strict';var emlformat=require(_0xec86('0x0'));var rimraf=require(_0xec86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec86('0x2'));var rp=require(_0xec86('0x3'));var moment=require(_0xec86('0x4'));var BPromise=require(_0xec86('0x5'));var Mustache=require('mustache');var util=require(_0xec86('0x6'));var path=require('path');var sox=require(_0xec86('0x7'));var csv=require(_0xec86('0x8'));var ejs=require(_0xec86('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xec86('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xec86('0xb'));var toCsv=require(_0xec86('0x8'));var querystring=require(_0xec86('0xc'));var Papa=require(_0xec86('0xd'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xec86('0xe'));var authService=require(_0xec86('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec86('0x10'));var logger=require(_0xec86('0x11'))(_0xec86('0x12'));var utils=require(_0xec86('0x13'));var config=require(_0xec86('0x14'));var licenseUtil=require(_0xec86('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec86('0x16')]));require(_0xec86('0x17'))['register'](socket);function respondWithStatusCode(_0x3e98bd,_0x51eb61){_0x51eb61=_0x51eb61||0xcc;return function(_0x21e339){if(_0x21e339){return _0x3e98bd[_0xec86('0x18')](_0x51eb61);}return _0x3e98bd[_0xec86('0x19')](_0x51eb61)[_0xec86('0x1a')]();};}function respondWithResult(_0x54278c,_0x27855e){_0x27855e=_0x27855e||0xc8;return function(_0x2ea72){if(_0x2ea72){return _0x54278c['status'](_0x27855e)[_0xec86('0x1b')](_0x2ea72);}};}function respondWithFilteredResult(_0x1f4bfd,_0x3ae7b5){return function(_0xe66ad5){if(_0xe66ad5){var _0x40f3b7=typeof _0x3ae7b5[_0xec86('0x1c')]==='undefined'&&typeof _0x3ae7b5[_0xec86('0x1d')]===_0xec86('0x1e');var _0x59b557=_0xe66ad5[_0xec86('0x1f')];var _0x5d0a74=_0x40f3b7?0x0:_0x3ae7b5['offset'];var _0x5840f5=_0x40f3b7?_0xe66ad5['count']:_0x3ae7b5[_0xec86('0x1c')]+_0x3ae7b5[_0xec86('0x1d')];var _0x25abca;if(_0x5840f5>=_0x59b557){_0x5840f5=_0x59b557;_0x25abca=0xc8;}else{_0x25abca=0xce;}_0x1f4bfd[_0xec86('0x19')](_0x25abca);return _0x1f4bfd['set']('Content-Range',_0x5d0a74+'-'+_0x5840f5+'/'+_0x59b557)[_0xec86('0x1b')](_0xe66ad5);}return null;};}function patchUpdates(_0x49c6b3){return function(_0x160057){try{jsonpatch[_0xec86('0x20')](_0x160057,_0x49c6b3,!![]);}catch(_0x34a3a4){return BPromise[_0xec86('0x21')](_0x34a3a4);}return _0x160057['save']();};}function saveUpdates(_0x2bd994,_0x1f5cca){return function(_0x4e8237){if(_0x4e8237){return _0x4e8237[_0xec86('0x22')](_0x2bd994)[_0xec86('0x23')](function(_0x2625a2){return _0x2625a2;});}return null;};}function removeEntity(_0x1ec3f1,_0x4fe2b0){return function(_0x1dff17){if(_0x1dff17){return _0x1dff17[_0xec86('0x24')]()['then'](function(){var _0x1328d8=_0x1dff17['get']({'plain':!![]});var _0x56d44a=_0xec86('0x25');return db[_0xec86('0x26')]['destroy']({'where':{'type':_0x56d44a,'resourceId':_0x1328d8['id']}})[_0xec86('0x23')](function(){return _0x1dff17;});})[_0xec86('0x23')](function(){_0x1ec3f1['status'](0xcc)[_0xec86('0x1a')]();});}};}function handleEntityNotFound(_0x307a57,_0xaacac0){return function(_0x4b17e0){if(!_0x4b17e0){_0x307a57[_0xec86('0x18')](0x194);}return _0x4b17e0;};}function handleError(_0x2cb28a,_0x2a6d6a){_0x2a6d6a=_0x2a6d6a||0x1f4;return function(_0x3262ac){logger[_0xec86('0x27')](_0x3262ac[_0xec86('0x28')]);if(_0x3262ac['name']){delete _0x3262ac[_0xec86('0x29')];}_0x2cb28a['status'](_0x2a6d6a)[_0xec86('0x2a')](_0x3262ac);};}exports[_0xec86('0x2b')]=function(_0x1f8480,_0x2594f1){var _0x31ad35={},_0xfef04d={},_0x238747={'count':0x0,'rows':[]};var _0x2491d3=_[_0xec86('0x2c')](db[_0xec86('0x2d')][_0xec86('0x2e')],function(_0xe37e47){return{'name':_0xe37e47[_0xec86('0x2f')],'type':_0xe37e47['type'][_0xec86('0x30')]};});_0xfef04d[_0xec86('0x31')]=_['map'](_0x2491d3,'name');_0xfef04d[_0xec86('0x32')]=_[_0xec86('0x33')](_0x1f8480[_0xec86('0x32')]);_0xfef04d[_0xec86('0x34')]=_[_0xec86('0x35')](_0xfef04d[_0xec86('0x31')],_0xfef04d[_0xec86('0x32')]);_0x31ad35[_0xec86('0x36')]=_[_0xec86('0x35')](_0xfef04d[_0xec86('0x31')],qs[_0xec86('0x37')](_0x1f8480[_0xec86('0x32')]['fields']));_0x31ad35[_0xec86('0x36')]=_0x31ad35[_0xec86('0x36')]['length']?_0x31ad35[_0xec86('0x36')]:_0xfef04d[_0xec86('0x31')];if(!_0x1f8480[_0xec86('0x32')][_0xec86('0x38')](_0xec86('0x39'))){_0x31ad35[_0xec86('0x1d')]=qs[_0xec86('0x1d')](_0x1f8480[_0xec86('0x32')][_0xec86('0x1d')]);_0x31ad35[_0xec86('0x1c')]=qs[_0xec86('0x1c')](_0x1f8480[_0xec86('0x32')]['offset']);}_0x31ad35[_0xec86('0x3a')]=qs[_0xec86('0x3b')](_0x1f8480[_0xec86('0x32')][_0xec86('0x3b')]);_0x31ad35[_0xec86('0x3c')]=qs[_0xec86('0x34')](_[_0xec86('0x3d')](_0x1f8480['query'],_0xfef04d[_0xec86('0x34')]),_0x2491d3);if(_0x1f8480[_0xec86('0x32')][_0xec86('0x3e')]){_0x31ad35[_0xec86('0x3c')]=_[_0xec86('0x3f')](_0x31ad35['where'],{'$or':_[_0xec86('0x2c')](_0x2491d3,function(_0x22a015){if(_0x22a015['type']!==_0xec86('0x40')){var _0x24f6da={};_0x24f6da[_0x22a015[_0xec86('0x29')]]={'$like':'%'+_0x1f8480['query'][_0xec86('0x3e')]+'%'};return _0x24f6da;}})});}_0x31ad35=_[_0xec86('0x3f')]({},_0x31ad35,_0x1f8480[_0xec86('0x41')]);var _0x2c52a2={'where':_0x31ad35[_0xec86('0x3c')]};return db[_0xec86('0x2d')]['count'](_0x2c52a2)[_0xec86('0x23')](function(_0x444c62){_0x238747[_0xec86('0x1f')]=_0x444c62;if(_0x1f8480['query'][_0xec86('0x42')]){_0x31ad35[_0xec86('0x43')]=[{'all':!![]}];}return db[_0xec86('0x2d')][_0xec86('0x44')](_0x31ad35);})['then'](function(_0xa91a41){_0x238747['rows']=_0xa91a41;return _0x238747;})['then'](respondWithFilteredResult(_0x2594f1,_0x31ad35))[_0xec86('0x45')](handleError(_0x2594f1,null));};exports[_0xec86('0x46')]=function(_0xf51495,_0x4fe8bf){var _0x420dd6={'raw':!![],'where':{'id':_0xf51495['params']['id']}},_0x1bbb0c={};_0x1bbb0c[_0xec86('0x31')]=_[_0xec86('0x33')](db[_0xec86('0x2d')]['rawAttributes']);_0x1bbb0c[_0xec86('0x32')]=_[_0xec86('0x33')](_0xf51495['query']);_0x1bbb0c[_0xec86('0x34')]=_[_0xec86('0x35')](_0x1bbb0c['model'],_0x1bbb0c[_0xec86('0x32')]);_0x420dd6[_0xec86('0x36')]=_[_0xec86('0x35')](_0x1bbb0c[_0xec86('0x31')],qs[_0xec86('0x37')](_0xf51495['query'][_0xec86('0x37')]));_0x420dd6['attributes']=_0x420dd6['attributes'][_0xec86('0x47')]?_0x420dd6[_0xec86('0x36')]:_0x1bbb0c[_0xec86('0x31')];if(_0xf51495[_0xec86('0x32')][_0xec86('0x42')]){_0x420dd6[_0xec86('0x43')]=[{'all':!![]}];}_0x420dd6=_['merge']({},_0x420dd6,_0xf51495['options']);return db[_0xec86('0x2d')][_0xec86('0x48')](_0x420dd6)[_0xec86('0x23')](handleEntityNotFound(_0x4fe8bf,null))[_0xec86('0x23')](respondWithResult(_0x4fe8bf,null))[_0xec86('0x45')](handleError(_0x4fe8bf,null));};exports[_0xec86('0x49')]=function(_0x4a3a68,_0x19ab51,_0xb482dc){return db[_0xec86('0x2d')]['find']({'where':{'id':_0x4a3a68[_0xec86('0x4a')]['id']},'attributes':['name',_0xec86('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x19ab51,null))[_0xec86('0x23')](function(_0x9f066c){if(_0x9f066c){var _0x4df011=path[_0xec86('0x4c')](config[_0xec86('0x4d')],_0xec86('0x4e'),util[_0xec86('0x4f')](_0xec86('0x50'),path[_0xec86('0x51')](_0x9f066c[_0xec86('0x4b')])));var _0x53b281=fs[_0xec86('0x52')](_0x4df011);var _0x1158ec=archiver(_0xec86('0x53'),{'zlib':{'level':0x9}});_0x1158ec['on'](_0xec86('0x54'),function(_0x4ff122){if(_0x4ff122['code']==='ENOENT'){logger[_0xec86('0x27')](_0x4ff122);}else{throw new db[(_0xec86('0x55'))][(_0xec86('0x56'))](_0xec86('0x57'));}});_0x1158ec['on']('error',function(_0x38f24d){throw new db[(_0xec86('0x55'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x1158ec[_0xec86('0x58')](_0x53b281);_0x1158ec['glob']('**/*',{'cwd':path[_0xec86('0x4c')](config['root'],_0xec86('0x4e'),path[_0xec86('0x59')](_0x9f066c[_0xec86('0x4b')])),'ignore':[path[_0xec86('0x4c')](path[_0xec86('0x51')](_0x9f066c[_0xec86('0x4b')]),_0xec86('0x5a')),path[_0xec86('0x4c')](path[_0xec86('0x51')](_0x9f066c[_0xec86('0x4b')]),_0xec86('0x5b'))],'nodir':!![]})[_0xec86('0x5c')]();_0x53b281['on'](_0xec86('0x5d'),function(){if(!fs[_0xec86('0x5e')](_0x4df011)){throw new db['Sequelize'][(_0xec86('0x56'))](_0xec86('0x5f'));}return _0x19ab51[_0xec86('0x49')](_0x4df011,util[_0xec86('0x4f')](_0xec86('0x50'),path['basename'](_0x9f066c[_0xec86('0x4b')])),function(_0x248ea8){if(_0x248ea8){throw new db[(_0xec86('0x55'))][(_0xec86('0x56'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xec86('0x60')](_0x4df011);logger[_0xec86('0x61')](_0xec86('0x62'));logger[_0xec86('0x61')](_0xec86('0x63'));});});}return null;})[_0xec86('0x45')](handleError(_0x19ab51,null));};exports['upload']=function(_0x4041e5,_0x2304b5,_0x800431){var _0x3f97f8=path[_0xec86('0x51')](_0x4041e5[_0xec86('0x64')]['filename'],path[_0xec86('0x65')](_0x4041e5['file'][_0xec86('0x66')]));var _0x5aa4cd=path[_0xec86('0x4c')](config[_0xec86('0x4d')],'server/files/plugins',_0x4041e5[_0xec86('0x64')][_0xec86('0x66')]);var _0x52ed06=path['join'](config[_0xec86('0x4d')],_0xec86('0x4e'),_0x3f97f8);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x5aa4cd);logger[_0xec86('0x61')](_0xec86('0x67'),_0x52ed06);try{fs[_0xec86('0x68')](_0x5aa4cd,parseInt('0777',0x8));extract(_0x5aa4cd,{'dir':_0x52ed06},function(_0x1b4df5){if(_0x1b4df5){logger[_0xec86('0x27')](_0x1b4df5);handleError(_0x1b4df5,!![]);};var _0x1a5493=fs[_0xec86('0x69')](_0x52ed06);if(_0x1a5493[_0xec86('0x47')]>0x1){removeReferences(_0x5aa4cd,_0x52ed06);logger[_0xec86('0x27')](_0xec86('0x6a'));return _0x800431(new Error(_0xec86('0x6a')));}var _0x23cb1a=fs[_0xec86('0x6b')](path['join'](_0x52ed06,_0x1a5493[0x0]));if(_0x23cb1a[_0xec86('0x6c')]()){removeReferences(_0x5aa4cd,_0x52ed06);logger['error'](_0xec86('0x6a'));return _0x800431(new Error(_0xec86('0x6a')));}if(_0x23cb1a[_0xec86('0x6d')]()){var _0x51041c=fs[_0xec86('0x69')](path[_0xec86('0x4c')](_0x52ed06,_0x1a5493[0x0]));if(_0x51041c[_0xec86('0x47')]===0x0){removeReferences(_0x5aa4cd,_0x52ed06);logger[_0xec86('0x27')](_0xec86('0x6a'));return _0x800431(new Error(_0xec86('0x6a')));}var _0x3fcdda=_0x51041c[_0xec86('0x6e')](function(_0x1a4547){return _0x1a4547===_0xec86('0x6f');});if(!_0x3fcdda){return _0x800431(new Error(_0xec86('0x70')));}var _0x1c7f59=fs[_0xec86('0x71')](path[_0xec86('0x4c')](_0x52ed06,_0x1a5493[0x0],'manifest.json'));var _0x381412=JSON[_0xec86('0x72')](_0x1c7f59);if(_0xec86('0x1e')==typeof _0x381412[_0xec86('0x29')]){return _0x800431(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xec86('0x1e')==typeof _0x381412['type']){return _0x800431(new Error(_0xec86('0x73')));}if('undefined'==typeof _0x381412[_0xec86('0x74')]){return _0x800431(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x381412[_0xec86('0x75')]){return _0x800431(new Error(_0xec86('0x76')));}if(_0x381412[_0xec86('0x77')]===_0xec86('0x78')){if('undefined'==typeof _0x381412[_0xec86('0x75')][_0xec86('0x79')]){return _0x800431(new Error(_0xec86('0x7a')));}if(_0xec86('0x1e')==typeof _0x381412[_0xec86('0x75')][_0xec86('0x79')]['admin']&&'undefined'==typeof _0x381412['parameters'][_0xec86('0x79')]['agent']){return _0x800431(new Error(_0xec86('0x7b')));}}else if(_0x381412[_0xec86('0x77')]===_0xec86('0x7c')){if('undefined'==typeof _0x381412['parameters'][_0xec86('0x7d')]){return _0x800431(new Error(_0xec86('0x7e')));}if(_0xec86('0x1e')==typeof _0x381412[_0xec86('0x75')][_0xec86('0x7f')]){return _0x800431(new Error(_0xec86('0x80')));}}else{return _0x800431(new Error(_0xec86('0x81')));}var _0x3b882a=_0x381412['name'];var _0x211631=_0x381412[_0xec86('0x82')];var _0x1f7670=_0x381412[_0xec86('0x77')];var _0x29a7d=_0x381412[_0xec86('0x83')]?_0x381412['sidebar']:_0xec86('0x84');var _0x995051=_0x381412[_0xec86('0x85')]?_0x381412[_0xec86('0x85')]:_0xec86('0x86');var _0x2959c7='';var _0x43cf2a='';var _0x2504cb='';var _0x289915='';var _0x5b462f=_0x381412['version'];if(_0x1f7670===_0xec86('0x78')){if(_0xec86('0x1e')!=typeof _0x381412[_0xec86('0x75')][_0xec86('0x79')][_0xec86('0x87')]){var _0x4db9a2=_0x381412['parameters'][_0xec86('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xec86('0x88')](_0x4db9a2)){_0x2959c7=path[_0xec86('0x4c')](_0xec86('0x89'),_0x3f97f8,_0x1a5493[0x0],_0x4db9a2);}else{_0x2959c7=_0x4db9a2;}}else{logger[_0xec86('0x61')](_0xec86('0x8a'));}if('undefined'!=typeof _0x381412[_0xec86('0x75')][_0xec86('0x79')][_0xec86('0x8b')]){var _0x52e95c=_0x381412[_0xec86('0x75')]['views'][_0xec86('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xec86('0x88')](_0x52e95c)){_0x43cf2a=path[_0xec86('0x4c')](_0xec86('0x89'),_0x3f97f8,_0x1a5493[0x0],_0x52e95c);}else{_0x43cf2a=_0x52e95c;}}else{logger[_0xec86('0x61')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1f7670==='script'){_0x2504cb=_0x381412['parameters'][_0xec86('0x7d')];_0x289915=_0x381412[_0xec86('0x75')][_0xec86('0x7f')];if(_0xec86('0x1e')!=typeof _0x381412['parameters']['views']){if(_0xec86('0x1e')!=typeof _0x381412['parameters'][_0xec86('0x79')]['admin']){var _0x4db9a2=_0x381412[_0xec86('0x75')][_0xec86('0x79')][_0xec86('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xec86('0x88')](_0x4db9a2)){_0x2959c7=path[_0xec86('0x4c')]('plugins',_0x3f97f8,_0x1a5493[0x0],_0x4db9a2);}else{_0x2959c7=_0x4db9a2;}}if('undefined'!=typeof _0x381412[_0xec86('0x75')][_0xec86('0x79')][_0xec86('0x8b')]){var _0x52e95c=_0x381412[_0xec86('0x75')][_0xec86('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x52e95c)){_0x43cf2a=path[_0xec86('0x4c')](_0xec86('0x89'),_0x3f97f8,_0x1a5493[0x0],_0x52e95c);}else{_0x43cf2a=_0x52e95c;}}}}var _0x5885e1={'name':_0x3b882a,'description':_0x211631,'path':path[_0xec86('0x4c')](_0x3f97f8,_0x1a5493[0x0]),'type':_0x1f7670,'sidebar':_0x29a7d,'icon':_0x995051,'adminUrl':_0x2959c7,'agentUrl':_0x43cf2a,'scriptName':_0x2504cb,'scriptPath':_0x289915,'version':_0x5b462f};removeReferences(_0x5aa4cd,null);return db[_0xec86('0x2d')][_0xec86('0x8c')](_0x5885e1)['then'](function(_0x2ee8c8){var _0x26bf96={'role':_0x4041e5['body'][_0xec86('0x8d')],'userProfileId':_0x4041e5[_0xec86('0x8e')][_0xec86('0x8f')]};if(!_0x26bf96)throw new Error(_0xec86('0x90'));if(_0x26bf96['role']==='user'){var _0x1e0a2e=_0x2ee8c8[_0xec86('0x91')]({'plain':!![]});return db[_0xec86('0x92')]['find']({'where':{'name':_0xec86('0x25'),'userProfileId':_0x26bf96[_0xec86('0x8f')]},'raw':!![]})[_0xec86('0x23')](function(_0x5b54f7){if(_0x5b54f7&&_0x5b54f7[_0xec86('0x93')]===0x0){return db['UserProfileResource'][_0xec86('0x8c')]({'name':_0x1e0a2e[_0xec86('0x29')],'resourceId':_0x1e0a2e['id'],'type':_0x5b54f7[_0xec86('0x29')],'sectionId':_0x5b54f7['id']},{})['then'](function(){return _0x2ee8c8;});}else{return _0x2ee8c8;}})[_0xec86('0x45')](function(_0xab43f4){logger[_0xec86('0x27')](_0xec86('0x94'),_0xab43f4);throw _0xab43f4;});}return _0x2ee8c8;})[_0xec86('0x23')](respondWithResult(_0x2304b5,null))[_0xec86('0x45')](handleError(_0x2304b5,null));}});}catch(_0x2fa297){_0x2304b5['status'](0x1f4)[_0xec86('0x2a')](_0x2fa297);}};function removeReferences(_0x4e226d,_0x2df919){try{if(_0x4e226d){fs[_0xec86('0x60')](_0x4e226d);logger['info']('Zip\x20archive\x20removed');}if(_0x2df919){rimraf(_0x2df919,function(){});logger[_0xec86('0x61')](_0xec86('0x95'));}}catch(_0x1f771f){logger[_0xec86('0x27')](_0x1f771f);}}exports[_0xec86('0x22')]=function(_0xd412d8,_0x3fbe10,_0x2670eb){return db[_0xec86('0x2d')][_0xec86('0x48')]({'where':{'id':_0xd412d8[_0xec86('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fbe10,null))[_0xec86('0x23')](saveUpdates(_0xd412d8['body'],null))[_0xec86('0x23')](respondWithResult(_0x3fbe10,null))[_0xec86('0x45')](handleError(_0x3fbe10,null));};exports['delete']=function(_0x5515e9,_0x189561,_0x20e9f3){return db[_0xec86('0x2d')][_0xec86('0x48')]({'where':{'id':_0x5515e9[_0xec86('0x4a')]['id']}})[_0xec86('0x23')](function(_0x21f7ff){if(_0x21f7ff){return _0x21f7ff[_0xec86('0x24')]();}})[_0xec86('0x23')](function(_0x13dba9){rimraf(path[_0xec86('0x4c')](config['root'],_0xec86('0x4e'),path[_0xec86('0x59')](_0x13dba9[_0xec86('0x4b')])),function(){});return _0x13dba9;})[_0xec86('0x23')](handleEntityNotFound(_0x189561,null))[_0xec86('0x23')](respondWithStatusCode(_0x189561,null))[_0xec86('0x45')](handleError(_0x189561,null));};exports[_0xec86('0x96')]=function(_0x284d80,_0x488973,_0xb993dd){return BPromise[_0xec86('0x97')]()[_0xec86('0x23')](function(){if(!_0x284d80[_0xec86('0x32')][_0xec86('0x4b')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x284d80[_0xec86('0x32')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2af004=_0x284d80[_0xec86('0x32')][_0xec86('0x98')]?_0x284d80[_0xec86('0x32')][_0xec86('0x98')]+':'+_0x284d80[_0xec86('0x32')][_0xec86('0x99')]:_0xec86('0x9a')+_0x284d80[_0xec86('0x32')][_0xec86('0x99')];var _0xad0d3d=_0x284d80[_0xec86('0x32')]['json']?_0x284d80['query'][_0xec86('0x1b')]:!![];var _0x19ac66=_0x284d80['query'][_0xec86('0x9b')]?_0x284d80[_0xec86('0x32')][_0xec86('0x9b')]:null;var _0x4fac19={'method':_0x284d80[_0xec86('0x9c')],'uri':util['format'](_0xec86('0x9d'),_0x2af004,_0x284d80[_0xec86('0x32')][_0xec86('0x4b')]),'json':_0xad0d3d,'resolveWithFullResponse':!![],'encoding':_0x19ac66,'qs':_0x284d80[_0xec86('0x32')]};if(_0x284d80[_0xec86('0x9e')]){_0x4fac19[_0xec86('0x9e')]=_0x284d80[_0xec86('0x9e')];if(_0x4fac19[_0xec86('0x9e')][_0xec86('0x9f')]){delete _0x4fac19[_0xec86('0x9e')][_0xec86('0x9f')];}}if(_0x4fac19[_0xec86('0x9e')]['content-type']){delete _0x4fac19[_0xec86('0x9e')]['content-type'];}return rp(_0x4fac19);})[_0xec86('0x23')](function(_0x220b90){if(_0x220b90){_0x488973[_0xec86('0xa0')](_0x220b90['headers']);logger[_0xec86('0x61')](_0x220b90['body']);if(_[_0xec86('0xa1')](_0x284d80[_0xec86('0x32')][_0xec86('0x4b')],_0xec86('0x49'))&&_0x220b90[_0xec86('0xa2')]==0x1f4){return _0x488973[_0xec86('0x18')](_0x220b90[_0xec86('0xa2')]);}else{return _0x488973['status'](_0x220b90[_0xec86('0xa2')])['send'](_0x220b90['body']);}}else{return _0x488973[_0xec86('0x18')](0xc8);}})[_0xec86('0x45')](handleError(_0x488973,null));};exports['webhookPost']=function(_0x4973f2,_0xee3644,_0x3845c4){return BPromise[_0xec86('0x97')]()[_0xec86('0x23')](function(){if(!_0x4973f2[_0xec86('0x32')][_0xec86('0x4b')]){throw new Error(_0xec86('0xa3'));}if(!_0x4973f2[_0xec86('0x32')][_0xec86('0x99')]){throw new Error(_0xec86('0xa4'));}var _0xeb6602=_0x4973f2[_0xec86('0x32')][_0xec86('0x98')]?_0x4973f2[_0xec86('0x32')][_0xec86('0x98')]+':'+_0x4973f2[_0xec86('0x32')][_0xec86('0x99')]:_0xec86('0x9a')+_0x4973f2[_0xec86('0x32')][_0xec86('0x99')];var _0x11b98a=_0x4973f2['query'][_0xec86('0x1b')]?_0x4973f2['query']['json']:!![];var _0x25eff9=_0x4973f2[_0xec86('0x32')][_0xec86('0x9b')]?_0x4973f2['query'][_0xec86('0x9b')]:null;var _0x190da6={'method':_0x4973f2['method'],'uri':util[_0xec86('0x4f')](_0xec86('0x9d'),_0xeb6602,_0x4973f2[_0xec86('0x32')][_0xec86('0x4b')]),'json':_0x11b98a,'resolveWithFullResponse':!![],'encoding':_0x25eff9,'body':_0x4973f2[_0xec86('0x8e')]};if(_0x4973f2[_0xec86('0x9e')]){_0x190da6['headers']=_0x4973f2[_0xec86('0x9e')];if(_0x190da6[_0xec86('0x9e')]['content-length']){delete _0x190da6['headers'][_0xec86('0x9f')];}}if(_0x190da6[_0xec86('0x9e')]['content-type']){delete _0x190da6[_0xec86('0x9e')]['content-type'];}return rp(_0x190da6);})[_0xec86('0x23')](function(_0x382afc){if(_0x382afc){_0xee3644[_0xec86('0xa0')](_0x382afc[_0xec86('0x9e')]);logger[_0xec86('0x61')](_0x382afc[_0xec86('0x8e')]);return _0xee3644[_0xec86('0x19')](_0x382afc[_0xec86('0xa2')])[_0xec86('0x2a')](_0x382afc['body']);}else{return _0xee3644[_0xec86('0x18')](0xc8);}})[_0xec86('0x45')](handleError(_0xee3644,null));}; \ No newline at end of file +var _0x258b=['where','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','includeAll','catch','download','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','join','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','isFile','Invalid\x20plugin\x20structure','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','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','description','icon','icon-apps','html','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','find','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','set','statusCode','sendStatus','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./plugin.socket','register','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x258b,0x1d6));var _0xb258=function(_0x4cddd2,_0xe0c534){_0x4cddd2=_0x4cddd2-0x0;var _0x435e13=_0x258b[_0x4cddd2];return _0x435e13;};'use strict';var emlformat=require(_0xb258('0x0'));var rimraf=require(_0xb258('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb258('0x2'));var rp=require(_0xb258('0x3'));var moment=require(_0xb258('0x4'));var BPromise=require(_0xb258('0x5'));var Mustache=require(_0xb258('0x6'));var util=require('util');var path=require(_0xb258('0x7'));var sox=require(_0xb258('0x8'));var csv=require(_0xb258('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb258('0xa'));var _=require(_0xb258('0xb'));var squel=require(_0xb258('0xc'));var crypto=require(_0xb258('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb258('0xe'));var toCsv=require(_0xb258('0x9'));var querystring=require(_0xb258('0xf'));var Papa=require(_0xb258('0x10'));var extract=require('extract-zip');var rimraf=require(_0xb258('0x1'));var archiver=require(_0xb258('0x11'));var Redis=require(_0xb258('0x12'));var authService=require(_0xb258('0x13'));var qs=require(_0xb258('0x14'));var as=require(_0xb258('0x15'));var hardwareService=require(_0xb258('0x16'));var logger=require(_0xb258('0x17'))(_0xb258('0x18'));var utils=require(_0xb258('0x19'));var config=require(_0xb258('0x1a'));var licenseUtil=require(_0xb258('0x1b'));var db=require(_0xb258('0x1c'))['db'];config['redis']=_[_0xb258('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb258('0x1e'))(new Redis(config['redis']));require(_0xb258('0x1f'))[_0xb258('0x20')](socket);function respondWithStatusCode(_0x5050a7,_0x2d15c4){_0x2d15c4=_0x2d15c4||0xcc;return function(_0x1ffe72){if(_0x1ffe72){return _0x5050a7['sendStatus'](_0x2d15c4);}return _0x5050a7[_0xb258('0x21')](_0x2d15c4)[_0xb258('0x22')]();};}function respondWithResult(_0x5a661c,_0x296ba3){_0x296ba3=_0x296ba3||0xc8;return function(_0x11165b){if(_0x11165b){return _0x5a661c[_0xb258('0x21')](_0x296ba3)[_0xb258('0x23')](_0x11165b);}};}function respondWithFilteredResult(_0x47faac,_0x172407){return function(_0x5e9864){if(_0x5e9864){var _0x4110c1=typeof _0x172407['offset']==='undefined'&&typeof _0x172407[_0xb258('0x24')]===_0xb258('0x25');var _0x3495d7=_0x5e9864[_0xb258('0x26')];var _0x42d7d7=_0x4110c1?0x0:_0x172407[_0xb258('0x27')];var _0x5e936c=_0x4110c1?_0x5e9864[_0xb258('0x26')]:_0x172407['offset']+_0x172407['limit'];var _0x47cd68;if(_0x5e936c>=_0x3495d7){_0x5e936c=_0x3495d7;_0x47cd68=0xc8;}else{_0x47cd68=0xce;}_0x47faac['status'](_0x47cd68);return _0x47faac['set'](_0xb258('0x28'),_0x42d7d7+'-'+_0x5e936c+'/'+_0x3495d7)['json'](_0x5e9864);}return null;};}function patchUpdates(_0xa51ac6){return function(_0x2be94a){try{jsonpatch[_0xb258('0x29')](_0x2be94a,_0xa51ac6,!![]);}catch(_0xd1358d){return BPromise[_0xb258('0x2a')](_0xd1358d);}return _0x2be94a[_0xb258('0x2b')]();};}function saveUpdates(_0x39d738,_0x94b603){return function(_0x4bfe0f){if(_0x4bfe0f){return _0x4bfe0f[_0xb258('0x2c')](_0x39d738)[_0xb258('0x2d')](function(_0x1249f3){return _0x1249f3;});}return null;};}function removeEntity(_0x18ab3c,_0x3fdc79){return function(_0x4a67e1){if(_0x4a67e1){return _0x4a67e1[_0xb258('0x2e')]()[_0xb258('0x2d')](function(){var _0x2394b7=_0x4a67e1[_0xb258('0x2f')]({'plain':!![]});var _0x4787b7=_0xb258('0x30');return db['UserProfileResource'][_0xb258('0x2e')]({'where':{'type':_0x4787b7,'resourceId':_0x2394b7['id']}})[_0xb258('0x2d')](function(){return _0x4a67e1;});})['then'](function(){_0x18ab3c['status'](0xcc)[_0xb258('0x22')]();});}};}function handleEntityNotFound(_0x17d836,_0x43eab6){return function(_0x347f9b){if(!_0x347f9b){_0x17d836['sendStatus'](0x194);}return _0x347f9b;};}function handleError(_0x12ba14,_0x1b876d){_0x1b876d=_0x1b876d||0x1f4;return function(_0x3099db){logger[_0xb258('0x31')](_0x3099db[_0xb258('0x32')]);if(_0x3099db[_0xb258('0x33')]){delete _0x3099db['name'];}_0x12ba14['status'](_0x1b876d)[_0xb258('0x34')](_0x3099db);};}exports[_0xb258('0x35')]=function(_0x2d2b58,_0x93fd15){var _0xeb52f2={},_0xfb5f39={},_0xa355db={'count':0x0,'rows':[]};var _0x5b8246=_[_0xb258('0x36')](db[_0xb258('0x37')][_0xb258('0x38')],function(_0x52ece1){return{'name':_0x52ece1[_0xb258('0x39')],'type':_0x52ece1[_0xb258('0x3a')][_0xb258('0x3b')]};});_0xfb5f39[_0xb258('0x3c')]=_[_0xb258('0x36')](_0x5b8246,'name');_0xfb5f39[_0xb258('0x3d')]=_[_0xb258('0x3e')](_0x2d2b58[_0xb258('0x3d')]);_0xfb5f39['filters']=_[_0xb258('0x3f')](_0xfb5f39['model'],_0xfb5f39[_0xb258('0x3d')]);_0xeb52f2[_0xb258('0x40')]=_['intersection'](_0xfb5f39[_0xb258('0x3c')],qs[_0xb258('0x41')](_0x2d2b58[_0xb258('0x3d')][_0xb258('0x41')]));_0xeb52f2[_0xb258('0x40')]=_0xeb52f2[_0xb258('0x40')][_0xb258('0x42')]?_0xeb52f2['attributes']:_0xfb5f39[_0xb258('0x3c')];if(!_0x2d2b58[_0xb258('0x3d')][_0xb258('0x43')](_0xb258('0x44'))){_0xeb52f2['limit']=qs['limit'](_0x2d2b58['query']['limit']);_0xeb52f2['offset']=qs[_0xb258('0x27')](_0x2d2b58[_0xb258('0x3d')][_0xb258('0x27')]);}_0xeb52f2[_0xb258('0x45')]=qs['sort'](_0x2d2b58[_0xb258('0x3d')][_0xb258('0x46')]);_0xeb52f2['where']=qs[_0xb258('0x47')](_[_0xb258('0x48')](_0x2d2b58[_0xb258('0x3d')],_0xfb5f39['filters']),_0x5b8246);if(_0x2d2b58[_0xb258('0x3d')]['filter']){_0xeb52f2['where']=_['merge'](_0xeb52f2[_0xb258('0x49')],{'$or':_[_0xb258('0x36')](_0x5b8246,function(_0xec8812){if(_0xec8812[_0xb258('0x3a')]!==_0xb258('0x4a')){var _0x7c36f2={};_0x7c36f2[_0xec8812['name']]={'$like':'%'+_0x2d2b58[_0xb258('0x3d')][_0xb258('0x4b')]+'%'};return _0x7c36f2;}})});}_0xeb52f2=_[_0xb258('0x4c')]({},_0xeb52f2,_0x2d2b58[_0xb258('0x4d')]);var _0x369799={'where':_0xeb52f2[_0xb258('0x49')]};return db[_0xb258('0x37')][_0xb258('0x26')](_0x369799)['then'](function(_0x21a386){_0xa355db[_0xb258('0x26')]=_0x21a386;if(_0x2d2b58[_0xb258('0x3d')]['includeAll']){_0xeb52f2[_0xb258('0x4e')]=[{'all':!![]}];}return db[_0xb258('0x37')][_0xb258('0x4f')](_0xeb52f2);})[_0xb258('0x2d')](function(_0x3823d1){_0xa355db[_0xb258('0x50')]=_0x3823d1;return _0xa355db;})['then'](respondWithFilteredResult(_0x93fd15,_0xeb52f2))['catch'](handleError(_0x93fd15,null));};exports[_0xb258('0x51')]=function(_0x4560ff,_0x1ee317){var _0x23880e={'raw':!![],'where':{'id':_0x4560ff[_0xb258('0x52')]['id']}},_0xe213db={};_0xe213db['model']=_[_0xb258('0x3e')](db[_0xb258('0x37')]['rawAttributes']);_0xe213db[_0xb258('0x3d')]=_[_0xb258('0x3e')](_0x4560ff[_0xb258('0x3d')]);_0xe213db[_0xb258('0x47')]=_[_0xb258('0x3f')](_0xe213db[_0xb258('0x3c')],_0xe213db[_0xb258('0x3d')]);_0x23880e[_0xb258('0x40')]=_[_0xb258('0x3f')](_0xe213db['model'],qs[_0xb258('0x41')](_0x4560ff[_0xb258('0x3d')][_0xb258('0x41')]));_0x23880e[_0xb258('0x40')]=_0x23880e[_0xb258('0x40')][_0xb258('0x42')]?_0x23880e[_0xb258('0x40')]:_0xe213db[_0xb258('0x3c')];if(_0x4560ff[_0xb258('0x3d')][_0xb258('0x53')]){_0x23880e['include']=[{'all':!![]}];}_0x23880e=_[_0xb258('0x4c')]({},_0x23880e,_0x4560ff[_0xb258('0x4d')]);return db[_0xb258('0x37')]['find'](_0x23880e)[_0xb258('0x2d')](handleEntityNotFound(_0x1ee317,null))[_0xb258('0x2d')](respondWithResult(_0x1ee317,null))[_0xb258('0x54')](handleError(_0x1ee317,null));};exports[_0xb258('0x55')]=function(_0x126f77,_0x1b37ab,_0x177baf){return db[_0xb258('0x37')]['find']({'where':{'id':_0x126f77[_0xb258('0x52')]['id']},'attributes':[_0xb258('0x33'),_0xb258('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x1b37ab,null))[_0xb258('0x2d')](function(_0x1e227c){if(_0x1e227c){var _0x5e9b67=path['join'](config[_0xb258('0x56')],_0xb258('0x57'),util[_0xb258('0x58')](_0xb258('0x59'),path[_0xb258('0x5a')](_0x1e227c['path'])));var _0x25069e=fs[_0xb258('0x5b')](_0x5e9b67);var _0x3875d9=archiver(_0xb258('0x5c'),{'zlib':{'level':0x9}});_0x3875d9['on'](_0xb258('0x5d'),function(_0x537161){if(_0x537161[_0xb258('0x5e')]===_0xb258('0x5f')){logger[_0xb258('0x31')](_0x537161);}else{throw new db[(_0xb258('0x60'))][(_0xb258('0x61'))](_0xb258('0x62'));}});_0x3875d9['on']('error',function(_0xfc1a1b){throw new db['Sequelize'][(_0xb258('0x61'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3875d9['pipe'](_0x25069e);_0x3875d9['glob'](_0xb258('0x63'),{'cwd':path[_0xb258('0x64')](config[_0xb258('0x56')],_0xb258('0x57'),path['dirname'](_0x1e227c[_0xb258('0x7')])),'ignore':[path[_0xb258('0x64')](path['basename'](_0x1e227c[_0xb258('0x7')]),_0xb258('0x65')),path[_0xb258('0x64')](path[_0xb258('0x5a')](_0x1e227c[_0xb258('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xb258('0x66')]();_0x25069e['on'](_0xb258('0x67'),function(){if(!fs[_0xb258('0x68')](_0x5e9b67)){throw new db[(_0xb258('0x60'))]['Error'](_0xb258('0x69'));}return _0x1b37ab['download'](_0x5e9b67,util[_0xb258('0x58')](_0xb258('0x59'),path[_0xb258('0x5a')](_0x1e227c[_0xb258('0x7')])),function(_0x5cdea7){if(_0x5cdea7){throw new db[(_0xb258('0x60'))]['Error'](_0xb258('0x6a'));}fs[_0xb258('0x6b')](_0x5e9b67);logger[_0xb258('0x6c')](_0xb258('0x6d'));logger[_0xb258('0x6c')](_0xb258('0x6e'));});});}return null;})[_0xb258('0x54')](handleError(_0x1b37ab,null));};exports[_0xb258('0x6f')]=function(_0x374fcf,_0x2e14c1,_0x4c99c9){var _0xe6e2ae=path['basename'](_0x374fcf[_0xb258('0x70')][_0xb258('0x71')],path[_0xb258('0x72')](_0x374fcf[_0xb258('0x70')][_0xb258('0x71')]));var _0x40ff7a=path[_0xb258('0x64')](config['root'],_0xb258('0x57'),_0x374fcf[_0xb258('0x70')][_0xb258('0x71')]);var _0x5e2751=path[_0xb258('0x64')](config['root'],'server/files/plugins',_0xe6e2ae);logger[_0xb258('0x6c')](_0xb258('0x73'),_0x40ff7a);logger[_0xb258('0x6c')](_0xb258('0x74'),_0x5e2751);try{fs[_0xb258('0x75')](_0x40ff7a,parseInt(_0xb258('0x76'),0x8));extract(_0x40ff7a,{'dir':_0x5e2751},function(_0x1148b0){if(_0x1148b0){logger[_0xb258('0x31')](_0x1148b0);handleError(_0x1148b0,!![]);};var _0x594578=fs['readdirSync'](_0x5e2751);if(_0x594578[_0xb258('0x42')]>0x1){removeReferences(_0x40ff7a,_0x5e2751);logger[_0xb258('0x31')]('Invalid\x20plugin\x20structure');return _0x4c99c9(new Error('Invalid\x20plugin\x20structure'));}var _0x322c87=fs['lstatSync'](path[_0xb258('0x64')](_0x5e2751,_0x594578[0x0]));if(_0x322c87[_0xb258('0x77')]()){removeReferences(_0x40ff7a,_0x5e2751);logger[_0xb258('0x31')](_0xb258('0x78'));return _0x4c99c9(new Error(_0xb258('0x78')));}if(_0x322c87[_0xb258('0x79')]()){var _0x47f688=fs[_0xb258('0x7a')](path['join'](_0x5e2751,_0x594578[0x0]));if(_0x47f688[_0xb258('0x42')]===0x0){removeReferences(_0x40ff7a,_0x5e2751);logger[_0xb258('0x31')]('Invalid\x20plugin\x20structure');return _0x4c99c9(new Error(_0xb258('0x78')));}var _0x4cc42d=_0x47f688[_0xb258('0x7b')](function(_0x4d0aa1){return _0x4d0aa1===_0xb258('0x7c');});if(!_0x4cc42d){return _0x4c99c9(new Error(_0xb258('0x7d')));}var _0x70c31=fs[_0xb258('0x7e')](path[_0xb258('0x64')](_0x5e2751,_0x594578[0x0],'manifest.json'));var _0x15545b=JSON['parse'](_0x70c31);if('undefined'==typeof _0x15545b[_0xb258('0x33')]){return _0x4c99c9(new Error(_0xb258('0x7f')));}if(_0xb258('0x25')==typeof _0x15545b[_0xb258('0x3a')]){return _0x4c99c9(new Error(_0xb258('0x80')));}if('undefined'==typeof _0x15545b[_0xb258('0x81')]){return _0x4c99c9(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xb258('0x25')==typeof _0x15545b[_0xb258('0x82')]){return _0x4c99c9(new Error(_0xb258('0x83')));}if(_0x15545b[_0xb258('0x3a')]==='html'){if('undefined'==typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')]){return _0x4c99c9(new Error(_0xb258('0x85')));}if(_0xb258('0x25')==typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')][_0xb258('0x86')]&&_0xb258('0x25')==typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')][_0xb258('0x87')]){return _0x4c99c9(new Error(_0xb258('0x88')));}}else if(_0x15545b[_0xb258('0x3a')]===_0xb258('0x89')){if(_0xb258('0x25')==typeof _0x15545b[_0xb258('0x82')][_0xb258('0x8a')]){return _0x4c99c9(new Error(_0xb258('0x8b')));}if(_0xb258('0x25')==typeof _0x15545b[_0xb258('0x82')][_0xb258('0x8c')]){return _0x4c99c9(new Error(_0xb258('0x8d')));}}else{return _0x4c99c9(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x17ecd9=_0x15545b[_0xb258('0x33')];var _0xc3049=_0x15545b[_0xb258('0x8e')];var _0x19089f=_0x15545b[_0xb258('0x3a')];var _0x5f067a=_0x15545b['sidebar']?_0x15545b['sidebar']:'always';var _0x52d5c3=_0x15545b['icon']?_0x15545b[_0xb258('0x8f')]:_0xb258('0x90');var _0x5b13d8='';var _0x5a4fc1='';var _0x2b1f04='';var _0xd38865='';var _0x23a81a=_0x15545b[_0xb258('0x81')];if(_0x19089f===_0xb258('0x91')){if(_0xb258('0x25')!=typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')][_0xb258('0x86')]){var _0x232075=_0x15545b[_0xb258('0x82')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb258('0x92')](_0x232075)){_0x5b13d8=path[_0xb258('0x64')](_0xb258('0x93'),_0xe6e2ae,_0x594578[0x0],_0x232075);}else{_0x5b13d8=_0x232075;}}else{logger[_0xb258('0x6c')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')]['agent']){var _0x1d1bfe=_0x15545b[_0xb258('0x82')]['views'][_0xb258('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xb258('0x92')](_0x1d1bfe)){_0x5a4fc1=path['join'](_0xb258('0x93'),_0xe6e2ae,_0x594578[0x0],_0x1d1bfe);}else{_0x5a4fc1=_0x1d1bfe;}}else{logger['info'](_0xb258('0x94'));}}else if(_0x19089f==='script'){_0x2b1f04=_0x15545b[_0xb258('0x82')]['scriptName'];_0xd38865=_0x15545b[_0xb258('0x82')][_0xb258('0x8c')];if(_0xb258('0x25')!=typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')]){if(_0xb258('0x25')!=typeof _0x15545b[_0xb258('0x82')][_0xb258('0x84')][_0xb258('0x86')]){var _0x232075=_0x15545b['parameters'][_0xb258('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb258('0x92')](_0x232075)){_0x5b13d8=path[_0xb258('0x64')](_0xb258('0x93'),_0xe6e2ae,_0x594578[0x0],_0x232075);}else{_0x5b13d8=_0x232075;}}if(_0xb258('0x25')!=typeof _0x15545b['parameters'][_0xb258('0x84')]['agent']){var _0x1d1bfe=_0x15545b[_0xb258('0x82')]['views'][_0xb258('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xb258('0x92')](_0x1d1bfe)){_0x5a4fc1=path[_0xb258('0x64')](_0xb258('0x93'),_0xe6e2ae,_0x594578[0x0],_0x1d1bfe);}else{_0x5a4fc1=_0x1d1bfe;}}}}var _0x2e1709={'name':_0x17ecd9,'description':_0xc3049,'path':path['join'](_0xe6e2ae,_0x594578[0x0]),'type':_0x19089f,'sidebar':_0x5f067a,'icon':_0x52d5c3,'adminUrl':_0x5b13d8,'agentUrl':_0x5a4fc1,'scriptName':_0x2b1f04,'scriptPath':_0xd38865,'version':_0x23a81a};removeReferences(_0x40ff7a,null);return db['Plugin']['create'](_0x2e1709)[_0xb258('0x2d')](function(_0xa8dd43){var _0x31ff09={'role':_0x374fcf[_0xb258('0x95')][_0xb258('0x96')],'userProfileId':_0x374fcf[_0xb258('0x95')][_0xb258('0x97')]};if(!_0x31ff09)throw new Error(_0xb258('0x98'));if(_0x31ff09[_0xb258('0x96')]===_0xb258('0x99')){var _0x49813a=_0xa8dd43[_0xb258('0x2f')]({'plain':!![]});return db[_0xb258('0x9a')]['find']({'where':{'name':_0xb258('0x30'),'userProfileId':_0x31ff09[_0xb258('0x97')]},'raw':!![]})[_0xb258('0x2d')](function(_0x31d913){if(_0x31d913&&_0x31d913[_0xb258('0x9b')]===0x0){return db[_0xb258('0x9c')][_0xb258('0x9d')]({'name':_0x49813a[_0xb258('0x33')],'resourceId':_0x49813a['id'],'type':_0x31d913[_0xb258('0x33')],'sectionId':_0x31d913['id']},{})[_0xb258('0x2d')](function(){return _0xa8dd43;});}else{return _0xa8dd43;}})[_0xb258('0x54')](function(_0x3cc7e2){logger[_0xb258('0x31')](_0xb258('0x9e'),_0x3cc7e2);throw _0x3cc7e2;});}return _0xa8dd43;})[_0xb258('0x2d')](respondWithResult(_0x2e14c1,null))['catch'](handleError(_0x2e14c1,null));}});}catch(_0xc63cd8){_0x2e14c1[_0xb258('0x21')](0x1f4)['send'](_0xc63cd8);}};function removeReferences(_0x459523,_0x54efcd){try{if(_0x459523){fs['unlinkSync'](_0x459523);logger[_0xb258('0x6c')](_0xb258('0x9f'));}if(_0x54efcd){rimraf(_0x54efcd,function(){});logger[_0xb258('0x6c')](_0xb258('0xa0'));}}catch(_0x29476f){logger[_0xb258('0x31')](_0x29476f);}}exports['update']=function(_0x59340f,_0x571ced,_0x112a13){return db['Plugin'][_0xb258('0xa1')]({'where':{'id':_0x59340f[_0xb258('0x52')]['id']}})[_0xb258('0x2d')](handleEntityNotFound(_0x571ced,null))[_0xb258('0x2d')](saveUpdates(_0x59340f[_0xb258('0x95')],null))[_0xb258('0x2d')](respondWithResult(_0x571ced,null))[_0xb258('0x54')](handleError(_0x571ced,null));};exports[_0xb258('0xa2')]=function(_0x2de459,_0x32fa09,_0x2d857f){return db[_0xb258('0x37')][_0xb258('0xa1')]({'where':{'id':_0x2de459[_0xb258('0x52')]['id']}})[_0xb258('0x2d')](function(_0x4ceef0){if(_0x4ceef0){return _0x4ceef0[_0xb258('0x2e')]();}})[_0xb258('0x2d')](function(_0x3e1ce8){rimraf(path[_0xb258('0x64')](config[_0xb258('0x56')],_0xb258('0x57'),path[_0xb258('0xa3')](_0x3e1ce8['path'])),function(){});return _0x3e1ce8;})[_0xb258('0x2d')](handleEntityNotFound(_0x32fa09,null))[_0xb258('0x2d')](respondWithStatusCode(_0x32fa09,null))[_0xb258('0x54')](handleError(_0x32fa09,null));};exports[_0xb258('0xa4')]=function(_0x26ba50,_0xa68583,_0x25bdc2){return BPromise[_0xb258('0xa5')]()[_0xb258('0x2d')](function(){if(!_0x26ba50[_0xb258('0x3d')][_0xb258('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x26ba50['query'][_0xb258('0xa6')]){throw new Error(_0xb258('0xa7'));}var _0x1dcd28=_0x26ba50[_0xb258('0x3d')][_0xb258('0xa8')]?_0x26ba50[_0xb258('0x3d')][_0xb258('0xa8')]+':'+_0x26ba50[_0xb258('0x3d')][_0xb258('0xa6')]:_0xb258('0xa9')+_0x26ba50[_0xb258('0x3d')][_0xb258('0xa6')];var _0x29af2f=_0x26ba50[_0xb258('0x3d')][_0xb258('0x23')]?_0x26ba50[_0xb258('0x3d')][_0xb258('0x23')]:!![];var _0x4f8c7c=_0x26ba50['query']['encoding']?_0x26ba50[_0xb258('0x3d')][_0xb258('0xaa')]:null;var _0x56e7fc={'method':_0x26ba50['method'],'uri':util['format'](_0xb258('0xab'),_0x1dcd28,_0x26ba50[_0xb258('0x3d')][_0xb258('0x7')]),'json':_0x29af2f,'resolveWithFullResponse':!![],'encoding':_0x4f8c7c,'qs':_0x26ba50[_0xb258('0x3d')]};if(_0x26ba50['headers']){_0x56e7fc[_0xb258('0xac')]=_0x26ba50[_0xb258('0xac')];if(_0x56e7fc[_0xb258('0xac')][_0xb258('0xad')]){delete _0x56e7fc[_0xb258('0xac')]['content-length'];}}if(_0x56e7fc[_0xb258('0xac')][_0xb258('0xae')]){delete _0x56e7fc['headers'][_0xb258('0xae')];}return rp(_0x56e7fc);})[_0xb258('0x2d')](function(_0x598213){if(_0x598213){_0xa68583[_0xb258('0xaf')](_0x598213[_0xb258('0xac')]);logger[_0xb258('0x6c')](_0x598213['body']);if(_['endsWith'](_0x26ba50[_0xb258('0x3d')][_0xb258('0x7')],_0xb258('0x55'))&&_0x598213[_0xb258('0xb0')]==0x1f4){return _0xa68583[_0xb258('0xb1')](_0x598213[_0xb258('0xb0')]);}else{return _0xa68583[_0xb258('0x21')](_0x598213[_0xb258('0xb0')])[_0xb258('0x34')](_0x598213[_0xb258('0x95')]);}}else{return _0xa68583['sendStatus'](0xc8);}})[_0xb258('0x54')](handleError(_0xa68583,null));};exports[_0xb258('0xb2')]=function(_0x19cede,_0x48c467,_0x13aac5){return BPromise[_0xb258('0xa5')]()[_0xb258('0x2d')](function(){if(!_0x19cede[_0xb258('0x3d')][_0xb258('0x7')]){throw new Error(_0xb258('0xb3'));}if(!_0x19cede[_0xb258('0x3d')][_0xb258('0xa6')]){throw new Error(_0xb258('0xa7'));}var _0x219a26=_0x19cede[_0xb258('0x3d')][_0xb258('0xa8')]?_0x19cede['query'][_0xb258('0xa8')]+':'+_0x19cede['query'][_0xb258('0xa6')]:'http://localhost:'+_0x19cede['query'][_0xb258('0xa6')];var _0x39d374=_0x19cede[_0xb258('0x3d')][_0xb258('0x23')]?_0x19cede[_0xb258('0x3d')]['json']:!![];var _0x50164c=_0x19cede[_0xb258('0x3d')][_0xb258('0xaa')]?_0x19cede[_0xb258('0x3d')][_0xb258('0xaa')]:null;var _0x34c855={'method':_0x19cede[_0xb258('0xb4')],'uri':util[_0xb258('0x58')](_0xb258('0xab'),_0x219a26,_0x19cede[_0xb258('0x3d')]['path']),'json':_0x39d374,'resolveWithFullResponse':!![],'encoding':_0x50164c,'body':_0x19cede['body']};if(_0x19cede[_0xb258('0xac')]){_0x34c855[_0xb258('0xac')]=_0x19cede[_0xb258('0xac')];if(_0x34c855[_0xb258('0xac')][_0xb258('0xad')]){delete _0x34c855['headers'][_0xb258('0xad')];}}if(_0x34c855['headers'][_0xb258('0xae')]){delete _0x34c855[_0xb258('0xac')][_0xb258('0xae')];}return rp(_0x34c855);})[_0xb258('0x2d')](function(_0x1aeec1){if(_0x1aeec1){_0x48c467[_0xb258('0xaf')](_0x1aeec1[_0xb258('0xac')]);logger[_0xb258('0x6c')](_0x1aeec1[_0xb258('0x95')]);return _0x48c467[_0xb258('0x21')](_0x1aeec1['statusCode'])[_0xb258('0x34')](_0x1aeec1[_0xb258('0x95')]);}else{return _0x48c467[_0xb258('0xb1')](0xc8);}})['catch'](handleError(_0x48c467,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 3b6bfe0..e11ecee 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 _0xdedd=['../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','events'];(function(_0x18229c,_0x23b6d6){var _0x292e15=function(_0x40e839){while(--_0x40e839){_0x18229c['push'](_0x18229c['shift']());}};_0x292e15(++_0x23b6d6);}(_0xdedd,0x197));var _0xdded=function(_0x29f07e,_0x36389a){_0x29f07e=_0x29f07e-0x0;var _0x1f62df=_0xdedd[_0x29f07e];return _0x1f62df;};'use strict';var EventEmitter=require(_0xdded('0x0'));var Plugin=require(_0xdded('0x1'))['db'][_0xdded('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xdded('0x3')](0x0);var events={'afterCreate':_0xdded('0x4'),'afterUpdate':'update','afterDestroy':_0xdded('0x5')};function emitEvent(_0x171456){return function(_0x207a33,_0x3e91ad,_0x36703d){PluginEvents[_0xdded('0x6')](_0x171456+':'+_0x207a33['id'],_0x207a33);PluginEvents[_0xdded('0x6')](_0x171456,_0x207a33);_0x36703d(null);};}for(var e in events){if(events[_0xdded('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x9973=['Plugin','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x91e39a,_0x104c1d){var _0x3af027=function(_0x4876ee){while(--_0x4876ee){_0x91e39a['push'](_0x91e39a['shift']());}};_0x3af027(++_0x104c1d);}(_0x9973,0x157));var _0x3997=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9973[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x3997('0x0'))['db'][_0x3997('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3997('0x2'),'afterUpdate':_0x3997('0x3'),'afterDestroy':_0x3997('0x4')};function emitEvent(_0x36e0bc){return function(_0x873171,_0x30c504,_0x300493){PluginEvents['emit'](_0x36e0bc+':'+_0x873171['id'],_0x873171);PluginEvents['emit'](_0x36e0bc,_0x873171);_0x300493(null);};}for(var e in events){if(events[_0x3997('0x5')](e)){var event=events[e];Plugin[_0x3997('0x6')](e,emitEvent(event));}}module[_0x3997('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 4244c5e..46616c2 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 _0x5170=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','Plugin','plugins','util','api'];(function(_0x2d5411,_0x1a439f){var _0x4f13d7=function(_0x2523c4){while(--_0x2523c4){_0x2d5411['push'](_0x2d5411['shift']());}};_0x4f13d7(++_0x1a439f);}(_0x5170,0x77));var _0x0517=function(_0x5a25c4,_0x5c8f1b){_0x5a25c4=_0x5a25c4-0x0;var _0x4a4843=_0x5170[_0x5a25c4];return _0x4a4843;};'use strict';var _=require('lodash');var util=require(_0x0517('0x0'));var logger=require('../../config/logger')(_0x0517('0x1'));var moment=require(_0x0517('0x2'));var BPromise=require(_0x0517('0x3'));var rp=require(_0x0517('0x4'));var fs=require('fs');var path=require(_0x0517('0x5'));var rimraf=require(_0x0517('0x6'));var config=require(_0x0517('0x7'));var attributes=require(_0x0517('0x8'));module['exports']=function(_0xb1bd34,_0x29aaa9){return _0xb1bd34['define'](_0x0517('0x9'),attributes,{'tableName':_0x0517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x506b=['api','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','util','../../config/logger'];(function(_0x271a95,_0x4d2a07){var _0x3fa489=function(_0x40e0fe){while(--_0x40e0fe){_0x271a95['push'](_0x271a95['shift']());}};_0x3fa489(++_0x4d2a07);}(_0x506b,0x14b));var _0xb506=function(_0x27c156,_0x14ce9b){_0x27c156=_0x27c156-0x0;var _0x4a94af=_0x506b[_0x27c156];return _0x4a94af;};'use strict';var _=require('lodash');var util=require(_0xb506('0x0'));var logger=require(_0xb506('0x1'))(_0xb506('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(_0xb506('0x3'));var config=require(_0xb506('0x4'));var attributes=require(_0xb506('0x5'));module[_0xb506('0x6')]=function(_0x4b6791,_0x16075e){return _0x4b6791[_0xb506('0x7')](_0xb506('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 7f529c4..c5feb08 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 _0x9605=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','options','raw','CreatePlugin','debug','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9605,0xde));var _0x5960=function(_0x1fc6f7,_0x34e9d7){_0x1fc6f7=_0x1fc6f7-0x0;var _0x50ab6b=_0x9605[_0x1fc6f7];return _0x50ab6b;};'use strict';var _=require(_0x5960('0x0'));var util=require('util');var moment=require(_0x5960('0x1'));var BPromise=require('bluebird');var rs=require(_0x5960('0x2'));var fs=require('fs');var Redis=require(_0x5960('0x3'));var db=require(_0x5960('0x4'))['db'];var utils=require(_0x5960('0x5'));var logger=require(_0x5960('0x6'))(_0x5960('0x7'));var config=require(_0x5960('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5960('0x9')]({'port':0x232a});config[_0x5960('0xa')]=_[_0x5960('0xb')](config['redis'],{'host':_0x5960('0xc'),'port':0x18eb});var socket=require(_0x5960('0xd'))(new Redis(config[_0x5960('0xa')]));require(_0x5960('0xe'))['register'](socket);function respondWithRpcPromise(_0x4bd82c,_0x31707d,_0x191cf4){return new BPromise(function(_0x3c7721,_0x4246fb){return client[_0x5960('0xf')](_0x4bd82c,_0x191cf4)[_0x5960('0x10')](function(_0x1ce678){logger['info'](_0x5960('0x11'),_0x31707d,_0x5960('0x12'));logger['debug'](_0x5960('0x13'),_0x31707d,'request\x20sent',JSON[_0x5960('0x14')](_0x1ce678));if(_0x1ce678[_0x5960('0x15')]){if(_0x1ce678[_0x5960('0x15')][_0x5960('0x16')]===0x1f4){logger[_0x5960('0x15')](_0x5960('0x11'),_0x31707d,_0x1ce678['error'][_0x5960('0x17')]);return _0x4246fb(_0x1ce678[_0x5960('0x15')]['message']);}logger[_0x5960('0x15')](_0x5960('0x11'),_0x31707d,_0x1ce678['error'][_0x5960('0x17')]);return _0x3c7721(_0x1ce678[_0x5960('0x15')][_0x5960('0x17')]);}else{logger['info'](_0x5960('0x11'),_0x31707d,_0x5960('0x12'));_0x3c7721(_0x1ce678[_0x5960('0x18')][_0x5960('0x17')]);}})[_0x5960('0x19')](function(_0x281cf7){logger[_0x5960('0x15')](_0x5960('0x11'),_0x31707d,_0x281cf7);_0x4246fb(_0x281cf7);});});}exports['CreatePlugin']=function(_0x4f3215){var _0xf76b0b=this;return new Promise(function(_0x2756e6,_0x2794e3){return db[_0x5960('0x1a')][_0x5960('0x1b')](_0x4f3215['body'],{'raw':_0x4f3215[_0x5960('0x1c')]?_0x4f3215['options'][_0x5960('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5c6e62){logger['info'](_0x5960('0x1e'),_0x4f3215);logger[_0x5960('0x1f')](_0x5960('0x1e'),_0x4f3215,JSON[_0x5960('0x14')](_0x5c6e62));_0x2756e6(_0x5c6e62);})['catch'](function(_0x3df6ab){logger['error'](_0x5960('0x1e'),_0x3df6ab['message'],_0x4f3215);_0x2794e3(_0xf76b0b[_0x5960('0x15')](0x1f4,_0x3df6ab[_0x5960('0x17')]));});});}; \ No newline at end of file +var _0x672d=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','socket.io-emitter','redis','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreatePlugin','Plugin','options','raw','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x284f33,_0x43b4b6){var _0x53ddac=function(_0xf8e389){while(--_0xf8e389){_0x284f33['push'](_0x284f33['shift']());}};_0x53ddac(++_0x43b4b6);}(_0x672d,0x191));var _0xd672=function(_0x5a93eb,_0x29345b){_0x5a93eb=_0x5a93eb-0x0;var _0x11d2fa=_0x672d[_0x5a93eb];return _0x11d2fa;};'use strict';var _=require(_0xd672('0x0'));var util=require(_0xd672('0x1'));var moment=require(_0xd672('0x2'));var BPromise=require(_0xd672('0x3'));var rs=require(_0xd672('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd672('0x5'))['db'];var utils=require(_0xd672('0x6'));var logger=require('../../config/logger')(_0xd672('0x7'));var config=require('../../config/environment');var jayson=require(_0xd672('0x8'));var client=jayson['client'][_0xd672('0x9')]({'port':0x232a});config['redis']=_[_0xd672('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd672('0xb'))(new Redis(config[_0xd672('0xc')]));require(_0xd672('0xd'))['register'](socket);function respondWithRpcPromise(_0x5153d9,_0x2e8753,_0x1b1554){return new BPromise(function(_0x164020,_0x160a6a){return client[_0xd672('0xe')](_0x5153d9,_0x1b1554)[_0xd672('0xf')](function(_0x3ffe85){logger['info'](_0xd672('0x10'),_0x2e8753,_0xd672('0x11'));logger['debug'](_0xd672('0x12'),_0x2e8753,_0xd672('0x11'),JSON[_0xd672('0x13')](_0x3ffe85));if(_0x3ffe85[_0xd672('0x14')]){if(_0x3ffe85[_0xd672('0x14')]['code']===0x1f4){logger[_0xd672('0x14')]('Plugin,\x20%s,\x20%s',_0x2e8753,_0x3ffe85['error'][_0xd672('0x15')]);return _0x160a6a(_0x3ffe85[_0xd672('0x14')][_0xd672('0x15')]);}logger[_0xd672('0x14')]('Plugin,\x20%s,\x20%s',_0x2e8753,_0x3ffe85[_0xd672('0x14')]['message']);return _0x164020(_0x3ffe85[_0xd672('0x14')][_0xd672('0x15')]);}else{logger[_0xd672('0x16')](_0xd672('0x10'),_0x2e8753,_0xd672('0x11'));_0x164020(_0x3ffe85[_0xd672('0x17')][_0xd672('0x15')]);}})['catch'](function(_0x1724c){logger[_0xd672('0x14')](_0xd672('0x10'),_0x2e8753,_0x1724c);_0x160a6a(_0x1724c);});});}exports[_0xd672('0x18')]=function(_0x534d34){var _0x2bd57f=this;return new Promise(function(_0x359898,_0xfeab9b){return db[_0xd672('0x19')]['create'](_0x534d34['body'],{'raw':_0x534d34[_0xd672('0x1a')]?_0x534d34['options'][_0xd672('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x30b05d){logger[_0xd672('0x16')](_0xd672('0x18'),_0x534d34);logger['debug'](_0xd672('0x18'),_0x534d34,JSON['stringify'](_0x30b05d));_0x359898(_0x30b05d);})[_0xd672('0x1c')](function(_0x7facdd){logger[_0xd672('0x14')]('CreatePlugin',_0x7facdd['message'],_0x534d34);_0xfeab9b(_0x2bd57f[_0xd672('0x14')](0x1f4,_0x7facdd[_0xd672('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 190e176..d1f52a9 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 _0x9f2c=['./plugin.events','save','update','emit','removeListener','register','length','plugin:'];(function(_0x4ea035,_0x309cff){var _0x1886ec=function(_0x109d37){while(--_0x109d37){_0x4ea035['push'](_0x4ea035['shift']());}};_0x1886ec(++_0x309cff);}(_0x9f2c,0xd0));var _0xc9f2=function(_0x12fc6d,_0x1b2dc1){_0x12fc6d=_0x12fc6d-0x0;var _0x2929f0=_0x9f2c[_0x12fc6d];return _0x2929f0;};'use strict';var PluginEvents=require(_0xc9f2('0x0'));var events=[_0xc9f2('0x1'),'remove',_0xc9f2('0x2')];function createListener(_0x1ed734,_0x4d755e){return function(_0x1769c4){_0x4d755e[_0xc9f2('0x3')](_0x1ed734,_0x1769c4);};}function removeListener(_0x2ba00b,_0x253905){return function(){PluginEvents[_0xc9f2('0x4')](_0x2ba00b,_0x253905);};}exports[_0xc9f2('0x5')]=function(_0x45c087){for(var _0x45e076=0x0,_0x24e495=events[_0xc9f2('0x6')];_0x45e076<_0x24e495;_0x45e076++){var _0x203a48=events[_0x45e076];var _0x2ab0f9=createListener(_0xc9f2('0x7')+_0x203a48,_0x45c087);PluginEvents['on'](_0x203a48,_0x2ab0f9);}}; \ No newline at end of file +var _0x01e4=['plugin:','./plugin.events','remove','update','emit','register','length'];(function(_0x42a584,_0x2d9ee3){var _0x56be59=function(_0x5809dd){while(--_0x5809dd){_0x42a584['push'](_0x42a584['shift']());}};_0x56be59(++_0x2d9ee3);}(_0x01e4,0x119));var _0x401e=function(_0x2d9887,_0x1481f0){_0x2d9887=_0x2d9887-0x0;var _0x24fced=_0x01e4[_0x2d9887];return _0x24fced;};'use strict';var PluginEvents=require(_0x401e('0x0'));var events=['save',_0x401e('0x1'),_0x401e('0x2')];function createListener(_0x4d9218,_0x17cce7){return function(_0x7db851){_0x17cce7[_0x401e('0x3')](_0x4d9218,_0x7db851);};}function removeListener(_0x28f029,_0x35e5cf){return function(){PluginEvents['removeListener'](_0x28f029,_0x35e5cf);};}exports[_0x401e('0x4')]=function(_0x4aba52){for(var _0x579c6e=0x0,_0x55e5df=events[_0x401e('0x5')];_0x579c6e<_0x55e5df;_0x579c6e++){var _0x3a2d43=events[_0x579c6e];var _0x4413b9=createListener(_0x401e('0x6')+_0x3a2d43,_0x4aba52);PluginEvents['on'](_0x3a2d43,_0x4413b9);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index ccb5e59..ff6187c 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(_0x3836b7,_0x72ec32){var _0x4a77aa=function(_0xb2881b){while(--_0xb2881b){_0x3836b7['push'](_0x3836b7['shift']());}};_0x4a77aa(++_0x72ec32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x7adcec,_0x215c42){var _0x44bd61=function(_0x57865b){while(--_0x57865b){_0x7adcec['push'](_0x7adcec['shift']());}};_0x44bd61(++_0x215c42);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 b840b6c..a0e8b1f 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(_0x32ab0d,_0x2cd5e0){var _0x4c81e3=function(_0x1db402){while(--_0x1db402){_0x32ab0d['push'](_0x32ab0d['shift']());}};_0x4c81e3(++_0x2cd5e0);}(_0xd3d1,0x172));var _0x1d3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3d1[_0x20a584];return _0x4b41a8;};'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 _0x5b02=['../../files/plugins','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','catch','show','describe','params','create','body','script','join'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x5b02,0xe9));var _0x25b0=function(_0x2db1c1,_0xb12a17){_0x2db1c1=_0x2db1c1-0x0;var _0x5a82b6=_0x5b02[_0x2db1c1];return _0x5a82b6;};'use strict';var _=require(_0x25b0('0x0'));var pm2=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var path=require('path');var exec=require('child_process')[_0x25b0('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3e1d20,_0x31c9c2){return function(_0x38dc14){if(!_0x38dc14){_0x3e1d20[_0x25b0('0x5')](0x194);;}return _0x38dc14;};}function respondWithResult(_0x2d84a9,_0x4eea55){_0x4eea55=_0x4eea55||0xc8;return function(_0x1d82c6){if(_0x1d82c6){return _0x2d84a9[_0x25b0('0x6')](_0x4eea55)['json'](_0x1d82c6);}return null;};}function handleError(_0x412954,_0x4d3e71){_0x4d3e71=_0x4d3e71||0x1f4;return function(_0x56feca){logger[_0x25b0('0x7')](_0x56feca[_0x25b0('0x8')]);if(_0x56feca[_0x25b0('0x9')]){delete _0x56feca['name'];}_0x412954[_0x25b0('0x6')](_0x4d3e71)[_0x25b0('0xa')](_0x56feca);};}function execChildProcess(){return new BPromise(function(_0x135afb,_0x250d31){exec(_0x25b0('0xb'),function(_0x2f57af,_0x44afbc,_0x10c3fb){logger[_0x25b0('0xc')](_0x44afbc);logger[_0x25b0('0xc')](_0x10c3fb);if(_0x2f57af){logger[_0x25b0('0x7')](_0x2f57af);return _0x250d31(_0x2f57af);}return _0x135afb(_0x44afbc);});});}exports[_0x25b0('0xd')]=function(_0x2048dc,_0x3655c2){return pm2[_0x25b0('0xe')]()[_0x25b0('0xf')](function(_0x293203){if(_0x293203){var _0x211658=_[_0x25b0('0x10')](_0x293203,function(_0x3b89e7){return _0x3b89e7[_0x25b0('0x9')]==='express'||_0x3b89e7['name']===_0x25b0('0x11');});return{'rows':_0x211658,'count':_0x211658['length']};}return null;})[_0x25b0('0xf')](respondWithResult(_0x3655c2,null))[_0x25b0('0x12')](handleError(_0x3655c2,null));};exports[_0x25b0('0x13')]=function(_0x3267b9,_0x5e3a3a){return pm2[_0x25b0('0x14')](_0x3267b9[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x5e3a3a,null))[_0x25b0('0xf')](handleEntityNotFound(_0x5e3a3a,null))[_0x25b0('0x12')](handleError(_0x5e3a3a,null));};exports[_0x25b0('0x16')]=function(_0x54f458,_0x348d36){if(_0x54f458[_0x25b0('0x17')][_0x25b0('0x9')]&&_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]){var _0xea4162=path[_0x25b0('0x19')](__dirname,_0x25b0('0x1a'),_0x54f458[_0x25b0('0x17')][_0x25b0('0x18')]);var _0x2b2eda=process[_0x25b0('0x1b')]();process['chdir'](path[_0x25b0('0x1c')](_0xea4162));return execChildProcess()[_0x25b0('0xf')](function(_0x517ec5){process[_0x25b0('0x1d')](_0x2b2eda);return pm2[_0x25b0('0x1e')]({'name':_0x54f458[_0x25b0('0x17')]['name'],'script':_0xea4162});})['then'](function(_0x50089e){pm2[_0x25b0('0x1f')]();return _0x50089e[0x0];})[_0x25b0('0xf')](respondWithResult(_0x348d36,0xc9))[_0x25b0('0x12')](handleError(_0x348d36,null));}else{return _0x348d36[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x20')});}};exports[_0x25b0('0x21')]=function(_0x75ce7a,_0x22e024){if(_0x75ce7a['body']['id']){delete _0x75ce7a[_0x25b0('0x17')]['id'];}var _0xbfba84={'online':'restart','stopped':'stop'};if(_0xbfba84['hasOwnProperty'](_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')])){return pm2[_0xbfba84[_0x75ce7a[_0x25b0('0x17')][_0x25b0('0x6')]]](_0x75ce7a[_0x25b0('0x15')]['id'])[_0x25b0('0xf')](respondWithResult(_0x22e024,0xc8))[_0x25b0('0x12')](handleError(_0x22e024,null));}else{return _0x22e024[_0x25b0('0x6')](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x22')});}};exports[_0x25b0('0x23')]=function(_0x3161c1,_0x1ea374){if(_0x3161c1['body']['id']){delete _0x3161c1['body']['id'];}if(_0x3161c1[_0x25b0('0x15')]['id']){return pm2['delete'](_0x3161c1['params']['id'])[_0x25b0('0xf')](function(_0x419975){pm2[_0x25b0('0x1f')]();return _0x419975[0x0];})[_0x25b0('0xf')](respondWithResult(_0x1ea374,null))[_0x25b0('0x12')](handleError(_0x1ea374,null));}else{return _0x1ea374['status'](0x1f4)[_0x25b0('0xa')]({'message':_0x25b0('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index f6b6662..f160812 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 _0x55fc=['get','isAuthenticated','/queues','getQueues','exports','express','Router','../../components/auth/service'];(function(_0x8d8f44,_0x4be97d){var _0x4bfe39=function(_0x75bc81){while(--_0x75bc81){_0x8d8f44['push'](_0x8d8f44['shift']());}};_0x4bfe39(++_0x4be97d);}(_0x55fc,0x16d));var _0xc55f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x55fc[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc55f('0x0'));var router=express[_0xc55f('0x1')]();var auth=require(_0xc55f('0x2'));var controller=require('./realtime.controller');router[_0xc55f('0x3')]('/agents',auth[_0xc55f('0x4')](),controller['getAgents']);router['get'](_0xc55f('0x5'),auth[_0xc55f('0x4')](),controller[_0xc55f('0x6')]);module[_0xc55f('0x7')]=router; \ No newline at end of file +var _0xdec1=['/queues','getQueues','express','Router','../../components/auth/service','get','/agents','isAuthenticated','getAgents'];(function(_0x4f3c97,_0x5198e0){var _0x2bbbd9=function(_0x20a201){while(--_0x20a201){_0x4f3c97['push'](_0x4f3c97['shift']());}};_0x2bbbd9(++_0x5198e0);}(_0xdec1,0x122));var _0x1dec=function(_0x11ebed,_0x215685){_0x11ebed=_0x11ebed-0x0;var _0x4fa9e8=_0xdec1[_0x11ebed];return _0x4fa9e8;};'use strict';var express=require(_0x1dec('0x0'));var router=express[_0x1dec('0x1')]();var auth=require(_0x1dec('0x2'));var controller=require('./realtime.controller');router[_0x1dec('0x3')](_0x1dec('0x4'),auth[_0x1dec('0x5')](),controller[_0x1dec('0x6')]);router[_0x1dec('0x3')](_0x1dec('0x7'),auth[_0x1dec('0x5')](),controller[_0x1dec('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index a1f73ca..3940781 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 _0x06fc=['key','name','outbound','dialActive','dialMethod','join','QueueCampaigns','startCase','filter','assign','findAndCountAll','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','../../errors/api','handleError','undefined','limit','count','offset','status','set','Content-Range','json','getAgents','getChannels','query','pauseTypeFilter','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','validateSortParameter','getUpdatedSortOptions','fields','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','role','agent','getOptions','length','push','sequelize','literal','FIELD(id,','*pause','Pause','forEach','where','user','userProfileId','online','extraQueryConditions','UserProfile','getResources','find','filterAgentAttributes','getAgentStatus','includes','pause','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x06fc,0x1c0));var _0xc06f=function(_0x3e71ce,_0x27f3bd){_0x3e71ce=_0x3e71ce-0x0;var _0x50e8a2=_0x06fc[_0x3e71ce];return _0x50e8a2;};'use strict';var _=require(_0xc06f('0x0'));var util=require('util');var rta=require(_0xc06f('0x1'));var rtq=require(_0xc06f('0x2'));var qs=require(_0xc06f('0x3'));var utils=require(_0xc06f('0x4'));var db=require(_0xc06f('0x5'))['db'];var APIBadRequestError=require('../../errors/api')[_0xc06f('0x6')];var APIHandleError=require(_0xc06f('0x7'))[_0xc06f('0x8')];function respondWithFilteredResult(_0x4804ca,_0xf17368){return function(_0x20596b){if(_0x20596b){var _0x38cbdf=typeof _0xf17368['offset']===_0xc06f('0x9')&&typeof _0xf17368[_0xc06f('0xa')]===_0xc06f('0x9');var _0x21b65b=_0x20596b[_0xc06f('0xb')];var _0x48f03e=_0x38cbdf?0x0:_0xf17368['offset'];var _0x5d7ce3=_0x38cbdf?_0x20596b[_0xc06f('0xb')]:_0xf17368[_0xc06f('0xc')]+_0xf17368['limit'];var _0x3bd441;if(_0x5d7ce3>=_0x21b65b){_0x5d7ce3=_0x21b65b;_0x3bd441=0xc8;}else{_0x3bd441=0xce;}_0x4804ca[_0xc06f('0xd')](_0x3bd441);return _0x4804ca[_0xc06f('0xe')](_0xc06f('0xf'),_0x48f03e+'-'+_0x5d7ce3+'/'+_0x21b65b)[_0xc06f('0x10')](_0x20596b);}return null;};}exports[_0xc06f('0x11')]=function(_0x2c17e8,_0xa2e983){var _0x40f473={'count':0x0,'rows':[]};var _0x1b05a9={};var _0x33f2fa;var _0x5e88ec=utils[_0xc06f('0x12')]();var _0x58fbec;var _0x341554;var _0x322167=_0x2c17e8[_0xc06f('0x13')]['globalQueueFilter'];var _0x2db203=_0x2c17e8['query']['globalStatusFilter'];var _0x3b7c08=_0x2c17e8['query'][_0xc06f('0x14')];var _0x4ada3f=_0x2db203==='pause'||_0x2db203==='*pause'?!![]:![];var _0x2eb0ae=[];var _0x2650e8;var _0x3f748e;Promise[_0xc06f('0x15')]()[_0xc06f('0x16')](function(){if(_0x2c17e8['query'][_0xc06f('0x17')]){if(!utils[_0xc06f('0x18')](_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x17')])){throw new APIBadRequestError(util[_0xc06f('0x19')](_0xc06f('0x1a'),_0x2c17e8[_0xc06f('0x13')]['channel']));}_0x33f2fa=_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x17')][_0xc06f('0x1b')]();}if(!_0x2c17e8['query'][_0xc06f('0x1c')]||!_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x1c')]['includes']('globalStatus')){_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x1c')]=rta[_0xc06f('0x1d')](_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x1c')]);return;}var _0x3374ee=rta[_0xc06f('0x1e')](_0x2c17e8['query']['sort']);_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x1c')]=_0x3374ee[_0xc06f('0x1f')]['join'](',');_0x2650e8=_0x3374ee['order'];})[_0xc06f('0x16')](function(){if(!_0x322167){return[];}return rta[_0xc06f('0x20')](_0x322167,_0x33f2fa);})['then'](function(_0xd6b6df){_0x2eb0ae=_0xd6b6df;return rta[_0xc06f('0x21')]();})[_0xc06f('0x16')](function(_0xe8e1d7){_0x341554=_0xe8e1d7[_0xc06f('0x22')];if((!_0x2db203||_0x4ada3f)&&!_0x2650e8){return _0x2eb0ae;}if(_0x2650e8&&!_0x2db203){return rta[_0xc06f('0x23')](_0x341554,_0x2eb0ae,_0x2650e8);}else{return rta[_0xc06f('0x24')](_0x341554,_0x2eb0ae,_0x2db203);}})['then'](function(_0xd42450){_0x2eb0ae=_0xd42450;var _0x2f285c=![];if(_0x2eb0ae['length']===0x0){if(_0x322167||_0x2db203){_0x2f285c=!![];}if(_0x4ada3f){_0x2f285c=![];}}if(_0x2f285c){return _0x40f473;}var _0x513193=_[_0xc06f('0x25')](db[_0xc06f('0x26')][_0xc06f('0x27')],function(_0x1a77ca){return{'name':_0x1a77ca[_0xc06f('0x28')],'type':_0x1a77ca[_0xc06f('0x29')]['key']};});_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x2a')]=_0xc06f('0x2b');_0x1b05a9=qs[_0xc06f('0x2c')](_0x513193,_0x2c17e8);_0x1b05a9['raw']=!![];var _0x37b328=[];if(_0x2eb0ae[_0xc06f('0x2d')]>0x0){_0x37b328[_0xc06f('0x2e')]({'id':{'$in':_0x2eb0ae}});if(_0x2650e8&&!_0x2db203){_0x3f748e=[db[_0xc06f('0x2f')][_0xc06f('0x30')](_0xc06f('0x31')+_0x2eb0ae+')')];_0x1b05a9['order']=_0x3f748e;}}if(_0x4ada3f){_0x5e88ec['forEach'](function(_0x585b55){var _0x37a5d0=!![];if(_0x2db203===_0xc06f('0x32')&&_0x33f2fa!==_0x585b55){_0x37a5d0=![];}_0x37b328['push']({[_0x585b55+_0xc06f('0x33')]:_0x37a5d0});});if(_0x3b7c08){_0x37b328['push']({'pauseType':_0x3b7c08});}}else if(_0x2db203){_0x5e88ec[_0xc06f('0x34')](function(_0x1cbb12){_0x37b328[_0xc06f('0x2e')]({[_0x1cbb12+'Pause']:![]});});}_0x1b05a9[_0xc06f('0x35')]=_['merge'](_0x1b05a9[_0xc06f('0x35')],{'$and':_0x37b328});if(_0x2c17e8[_0xc06f('0x36')][_0xc06f('0x2a')]===_0xc06f('0x36')){var _0x47da9a={'params':{'id':_0x2c17e8[_0xc06f('0x36')][_0xc06f('0x37')]},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x2eb0ae,'customSorting':_0x3f748e}};if(_0x2c17e8[_0xc06f('0x13')][_0xc06f('0x38')]){_0x47da9a[_0xc06f('0x13')]['online']=!![];}if(_0x4ada3f){_0x47da9a[_0xc06f('0x13')][_0xc06f('0x39')]=_0x37b328;}_0x47da9a[_0xc06f('0x13')]=Object['assign'](_0x47da9a[_0xc06f('0x13')],_0x2c17e8[_0xc06f('0x13')]);return db[_0xc06f('0x3a')][_0xc06f('0x3b')](_0x47da9a);}return db[_0xc06f('0x26')]['findAndCountAll'](_0x1b05a9);})[_0xc06f('0x16')](function(_0x327ca9){_0x40f473[_0xc06f('0xb')]=_0x327ca9['count'];_0x58fbec=_0x327ca9[_0xc06f('0x22')];return _0x58fbec[_0xc06f('0x25')](function(_0x2d2407){var _0x4fa1b9=_[_0xc06f('0x3c')](_0x341554,['id',_0x2d2407['id']]);if(_0x4fa1b9){var _0x4871e0=rta[_0xc06f('0x3d')](_0x4fa1b9);_['merge'](_0x2d2407,_0x4871e0);}_0x2d2407['globalStatus']=rta[_0xc06f('0x3e')](_0x2d2407);if(_0x2d2407['globalStatus'][_0xc06f('0x3f')](_0xc06f('0x40'))){_0x5e88ec[_0xc06f('0x34')](function(_0x2a17ae){if(_0x2d2407[_0x2a17ae+_0xc06f('0x33')]){if(_0x2a17ae===_0xc06f('0x41')){if(_0x2d2407[_0xc06f('0x42')]!==_0xc06f('0x43')){_0x2d2407[_0xc06f('0x42')]='pause';}}else{_0x2d2407[_0x2a17ae+_0xc06f('0x44')]=_0xc06f('0x40');}}});}return _0x2d2407;});})[_0xc06f('0x16')](function(_0x2979fc){if(!_0x2650e8||_0x3f748e){return _0x2979fc;}return rta[_0xc06f('0x45')](_0x2979fc,_0x2650e8);})['then'](function(_0x4a1677){var _0x4af107=rta[_0xc06f('0x46')]();_0x40f473[_0xc06f('0x22')]=_0x4a1677[_0xc06f('0x25')](function(_0x1767e6){return _[_0xc06f('0x47')](_0x1767e6,_0x4af107);});return _0x40f473;})['then'](respondWithFilteredResult(_0xa2e983,_0x1b05a9))[_0xc06f('0x48')](APIHandleError(_0xa2e983));};exports[_0xc06f('0x49')]=function(_0xbe82de,_0x2914){var _0x80320c={'count':0x0,'rows':[]};var _0x33ca64={};var _0x5f20b8;var _0x39d82c;var _0xdef12e;Promise[_0xc06f('0x15')]()[_0xc06f('0x16')](function(){if(_0xbe82de[_0xc06f('0x13')]['channel']){if(!utils[_0xc06f('0x18')](_0xbe82de['query']['channel'])){throw new APIBadRequestError(util[_0xc06f('0x19')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xbe82de[_0xc06f('0x13')][_0xc06f('0x17')]));}_0x5f20b8=_0xbe82de[_0xc06f('0x13')][_0xc06f('0x17')][_0xc06f('0x1b')]();}var _0x113df6=_['startCase'](_0x5f20b8)+'Queue';var _0x24afbd=_['map'](db[_0x113df6][_0xc06f('0x27')],function(_0x69c6a8){return{'name':_0x69c6a8[_0xc06f('0x28')],'type':_0x69c6a8[_0xc06f('0x29')][_0xc06f('0x4a')]};});if(!_0xbe82de['query']['fields']){var _0x3b466f=['id',_0xc06f('0x4b')];if(_0x5f20b8===_0xc06f('0x41')){_0x3b466f[_0xc06f('0x2e')](_0xc06f('0x29'));if(_0xbe82de[_0xc06f('0x13')][_0xc06f('0x29')]===_0xc06f('0x4c')){_0x3b466f[_0xc06f('0x2e')]([_0xc06f('0x4d'),_0xc06f('0x4e')]);}}_0xbe82de[_0xc06f('0x13')][_0xc06f('0x1f')]=_0x3b466f[_0xc06f('0x4f')](',');}_0x33ca64=qs[_0xc06f('0x2c')](_0x24afbd,_0xbe82de);if(_0xbe82de[_0xc06f('0x36')][_0xc06f('0x2a')]==='user'){var _0x3090c3={'params':{'id':_0xbe82de[_0xc06f('0x36')]['userProfileId']},'query':{'section':_0x5f20b8===_0xc06f('0x41')&&_0xbe82de[_0xc06f('0x13')][_0xc06f('0x29')]===_0xc06f('0x4c')?_0xc06f('0x50'):_[_0xc06f('0x51')](_0x5f20b8)+'Queues','type':_0xbe82de[_0xc06f('0x13')][_0xc06f('0x29')],'nolimit':!![],'sort':_0xc06f('0x4b'),'filter':_0xbe82de[_0xc06f('0x13')][_0xc06f('0x52')]}};_0x3090c3[_0xc06f('0x13')]=Object[_0xc06f('0x53')](_0x3090c3[_0xc06f('0x13')],_0xbe82de[_0xc06f('0x13')]);delete _0x3090c3['query']['id'];return db[_0xc06f('0x3a')][_0xc06f('0x3b')](_0x3090c3);}return db[_0x113df6][_0xc06f('0x54')](_0x33ca64);})[_0xc06f('0x16')](function(_0x5aca8a){_0x80320c[_0xc06f('0xb')]=_0x5aca8a['count'];_0x39d82c=_0x5aca8a['rows'];return rtq[_0xc06f('0x55')](_0xbe82de,_0x5f20b8);})[_0xc06f('0x16')](function(_0x5f3772){_0xdef12e=_0x5f3772[_0xc06f('0x22')];return rtq[_0xc06f('0x56')](_0x39d82c,_0xdef12e,_0x5f20b8,_0xbe82de[_0xc06f('0x13')][_0xc06f('0x29')]);})['then'](function(_0x25dbd2){_0x80320c[_0xc06f('0x22')]=_0x25dbd2;return _0x80320c;})[_0xc06f('0x16')](respondWithFilteredResult(_0x2914,_0x33ca64))[_0xc06f('0x48')](APIHandleError(_0x2914));}; \ No newline at end of file +var _0x9677=['Agents','agent','online','UserProfile','findAndCountAll','find','filterAgentAttributes','merge','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','fieldName','key','name','dialMethod','join','role','outbound','Queues','filter','assign','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','undefined','limit','count','status','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','resolve','then','isValidChannel','channel','format','toLowerCase','includes','globalStatus','validateSortParameter','sort','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','type','getOptions','raw','push','sequelize','literal','forEach','Pause','user','userProfileId'];(function(_0x582689,_0x20c7b4){var _0x1041ca=function(_0x1ff4da){while(--_0x1ff4da){_0x582689['push'](_0x582689['shift']());}};_0x1041ca(++_0x20c7b4);}(_0x9677,0x1c5));var _0x7967=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x9677[_0x14363e];return _0x17c56d;};'use strict';var _=require(_0x7967('0x0'));var util=require('util');var rta=require(_0x7967('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0x7967('0x2'));var utils=require(_0x7967('0x3'));var db=require(_0x7967('0x4'))['db'];var APIBadRequestError=require(_0x7967('0x5'))[_0x7967('0x6')];var APIHandleError=require(_0x7967('0x5'))['handleError'];function respondWithFilteredResult(_0x635494,_0x294d90){return function(_0x795ce6){if(_0x795ce6){var _0xcfd84f=typeof _0x294d90[_0x7967('0x7')]===_0x7967('0x8')&&typeof _0x294d90[_0x7967('0x9')]===_0x7967('0x8');var _0x18e4e1=_0x795ce6[_0x7967('0xa')];var _0xd00d8b=_0xcfd84f?0x0:_0x294d90[_0x7967('0x7')];var _0x18db84=_0xcfd84f?_0x795ce6[_0x7967('0xa')]:_0x294d90[_0x7967('0x7')]+_0x294d90['limit'];var _0x147a6c;if(_0x18db84>=_0x18e4e1){_0x18db84=_0x18e4e1;_0x147a6c=0xc8;}else{_0x147a6c=0xce;}_0x635494[_0x7967('0xb')](_0x147a6c);return _0x635494['set'](_0x7967('0xc'),_0xd00d8b+'-'+_0x18db84+'/'+_0x18e4e1)[_0x7967('0xd')](_0x795ce6);}return null;};}exports[_0x7967('0xe')]=function(_0x317cab,_0x4ef4f9){var _0x494b34={'count':0x0,'rows':[]};var _0x416568={};var _0x581129;var _0x483cbe=utils[_0x7967('0xf')]();var _0x1051b2;var _0x461349;var _0x5891c5=_0x317cab[_0x7967('0x10')][_0x7967('0x11')];var _0xa0cfc8=_0x317cab[_0x7967('0x10')]['globalStatusFilter'];var _0x1ff8be=_0x317cab[_0x7967('0x10')][_0x7967('0x12')];var _0x2108bc=_0xa0cfc8===_0x7967('0x13')||_0xa0cfc8==='*pause'?!![]:![];var _0x5810f7=[];var _0x2934a9;var _0x50c48d;Promise[_0x7967('0x14')]()[_0x7967('0x15')](function(){if(_0x317cab[_0x7967('0x10')]['channel']){if(!utils[_0x7967('0x16')](_0x317cab[_0x7967('0x10')][_0x7967('0x17')])){throw new APIBadRequestError(util[_0x7967('0x18')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x317cab[_0x7967('0x10')][_0x7967('0x17')]));}_0x581129=_0x317cab[_0x7967('0x10')][_0x7967('0x17')][_0x7967('0x19')]();}if(!_0x317cab[_0x7967('0x10')]['sort']||!_0x317cab['query']['sort'][_0x7967('0x1a')](_0x7967('0x1b'))){_0x317cab[_0x7967('0x10')]['sort']=rta[_0x7967('0x1c')](_0x317cab[_0x7967('0x10')][_0x7967('0x1d')]);return;}var _0x329e23=rta[_0x7967('0x1e')](_0x317cab[_0x7967('0x10')]['sort']);_0x317cab['query']['sort']=_0x329e23[_0x7967('0x1f')]['join'](',');_0x2934a9=_0x329e23[_0x7967('0x20')];})[_0x7967('0x15')](function(){if(!_0x5891c5){return[];}return rta[_0x7967('0x21')](_0x5891c5,_0x581129);})[_0x7967('0x15')](function(_0xb6d4db){_0x5810f7=_0xb6d4db;return rta[_0x7967('0x22')]();})[_0x7967('0x15')](function(_0x2e86bd){_0x461349=_0x2e86bd[_0x7967('0x23')];if((!_0xa0cfc8||_0x2108bc)&&!_0x2934a9){return _0x5810f7;}if(_0x2934a9&&!_0xa0cfc8){return rta[_0x7967('0x24')](_0x461349,_0x5810f7,_0x2934a9);}else{return rta[_0x7967('0x25')](_0x461349,_0x5810f7,_0xa0cfc8);}})[_0x7967('0x15')](function(_0x155947){_0x5810f7=_0x155947;var _0x1f50f6=![];if(_0x5810f7['length']===0x0){if(_0x5891c5||_0xa0cfc8){_0x1f50f6=!![];}if(_0x2108bc){_0x1f50f6=![];}}if(_0x1f50f6){return _0x494b34;}var _0x441f93=_[_0x7967('0x26')](db[_0x7967('0x27')][_0x7967('0x28')],function(_0x22e2ac){return{'name':_0x22e2ac['fieldName'],'type':_0x22e2ac[_0x7967('0x29')]['key']};});_0x317cab[_0x7967('0x10')]['role']='agent';_0x416568=qs[_0x7967('0x2a')](_0x441f93,_0x317cab);_0x416568[_0x7967('0x2b')]=!![];var _0x1e9fe4=[];if(_0x5810f7['length']>0x0){_0x1e9fe4[_0x7967('0x2c')]({'id':{'$in':_0x5810f7}});if(_0x2934a9&&!_0xa0cfc8){_0x50c48d=[db[_0x7967('0x2d')][_0x7967('0x2e')]('FIELD(id,'+_0x5810f7+')')];_0x416568[_0x7967('0x20')]=_0x50c48d;}}if(_0x2108bc){_0x483cbe[_0x7967('0x2f')](function(_0x2c9d66){var _0x271a14=!![];if(_0xa0cfc8==='*pause'&&_0x581129!==_0x2c9d66){_0x271a14=![];}_0x1e9fe4[_0x7967('0x2c')]({[_0x2c9d66+_0x7967('0x30')]:_0x271a14});});if(_0x1ff8be){_0x1e9fe4[_0x7967('0x2c')]({'pauseType':_0x1ff8be});}}else if(_0xa0cfc8){_0x483cbe[_0x7967('0x2f')](function(_0x982d0){_0x1e9fe4[_0x7967('0x2c')]({[_0x982d0+_0x7967('0x30')]:![]});});}_0x416568['where']=_['merge'](_0x416568['where'],{'$and':_0x1e9fe4});if(_0x317cab[_0x7967('0x31')]['role']===_0x7967('0x31')){var _0x5b852d={'params':{'id':_0x317cab['user'][_0x7967('0x32')]},'query':{'section':_0x7967('0x33'),'role':_0x7967('0x34'),'raw':!![],'ids':_0x5810f7,'customSorting':_0x50c48d}};if(_0x317cab[_0x7967('0x10')][_0x7967('0x35')]){_0x5b852d[_0x7967('0x10')]['online']=!![];}if(_0x2108bc){_0x5b852d['query']['extraQueryConditions']=_0x1e9fe4;}_0x5b852d[_0x7967('0x10')]=Object['assign'](_0x5b852d[_0x7967('0x10')],_0x317cab['query']);return db[_0x7967('0x36')]['getResources'](_0x5b852d);}return db['User'][_0x7967('0x37')](_0x416568);})[_0x7967('0x15')](function(_0x23084b){_0x494b34['count']=_0x23084b[_0x7967('0xa')];_0x1051b2=_0x23084b[_0x7967('0x23')];return _0x1051b2[_0x7967('0x26')](function(_0x381eb2){var _0x5878eb=_[_0x7967('0x38')](_0x461349,['id',_0x381eb2['id']]);if(_0x5878eb){var _0x228984=rta[_0x7967('0x39')](_0x5878eb);_[_0x7967('0x3a')](_0x381eb2,_0x228984);}_0x381eb2['globalStatus']=rta[_0x7967('0x3b')](_0x381eb2);if(_0x381eb2[_0x7967('0x1b')]['includes'](_0x7967('0x13'))){_0x483cbe[_0x7967('0x2f')](function(_0x466e7b){if(_0x381eb2[_0x466e7b+_0x7967('0x30')]){if(_0x466e7b===_0x7967('0x3c')){if(_0x381eb2[_0x7967('0x3d')]!==_0x7967('0x3e')){_0x381eb2['voiceStatus']=_0x7967('0x13');}}else{_0x381eb2[_0x466e7b+_0x7967('0x3f')]=_0x7967('0x13');}}});}return _0x381eb2;});})[_0x7967('0x15')](function(_0x1de2dc){if(!_0x2934a9||_0x50c48d){return _0x1de2dc;}return rta[_0x7967('0x40')](_0x1de2dc,_0x2934a9);})[_0x7967('0x15')](function(_0x487a81){var _0x10fc6a=rta[_0x7967('0x41')]();_0x494b34[_0x7967('0x23')]=_0x487a81[_0x7967('0x26')](function(_0x4d12a1){return _[_0x7967('0x42')](_0x4d12a1,_0x10fc6a);});return _0x494b34;})[_0x7967('0x15')](respondWithFilteredResult(_0x4ef4f9,_0x416568))[_0x7967('0x43')](APIHandleError(_0x4ef4f9));};exports[_0x7967('0x44')]=function(_0x5c2891,_0x2a869c){var _0x5dab31={'count':0x0,'rows':[]};var _0x21120e={};var _0x456e4d;var _0xb1587b;var _0x3d481f;Promise[_0x7967('0x14')]()[_0x7967('0x15')](function(){if(_0x5c2891[_0x7967('0x10')]['channel']){if(!utils['isValidChannel'](_0x5c2891[_0x7967('0x10')][_0x7967('0x17')])){throw new APIBadRequestError(util[_0x7967('0x18')](_0x7967('0x45'),_0x5c2891[_0x7967('0x10')][_0x7967('0x17')]));}_0x456e4d=_0x5c2891[_0x7967('0x10')][_0x7967('0x17')]['toLowerCase']();}var _0x4d03d0=_[_0x7967('0x46')](_0x456e4d)+_0x7967('0x47');var _0x30ba89=_['map'](db[_0x4d03d0]['rawAttributes'],function(_0x3bb21f){return{'name':_0x3bb21f[_0x7967('0x48')],'type':_0x3bb21f['type'][_0x7967('0x49')]};});if(!_0x5c2891['query'][_0x7967('0x1f')]){var _0x12039a=['id',_0x7967('0x4a')];if(_0x456e4d===_0x7967('0x3c')){_0x12039a[_0x7967('0x2c')](_0x7967('0x29'));if(_0x5c2891[_0x7967('0x10')][_0x7967('0x29')]==='outbound'){_0x12039a[_0x7967('0x2c')](['dialActive',_0x7967('0x4b')]);}}_0x5c2891['query']['fields']=_0x12039a[_0x7967('0x4c')](',');}_0x21120e=qs['getOptions'](_0x30ba89,_0x5c2891);if(_0x5c2891[_0x7967('0x31')][_0x7967('0x4d')]===_0x7967('0x31')){var _0x31da43={'params':{'id':_0x5c2891[_0x7967('0x31')][_0x7967('0x32')]},'query':{'section':_0x456e4d===_0x7967('0x3c')&&_0x5c2891[_0x7967('0x10')][_0x7967('0x29')]===_0x7967('0x4e')?'QueueCampaigns':_['startCase'](_0x456e4d)+_0x7967('0x4f'),'type':_0x5c2891[_0x7967('0x10')][_0x7967('0x29')],'nolimit':!![],'sort':_0x7967('0x4a'),'filter':_0x5c2891['query'][_0x7967('0x50')]}};_0x31da43[_0x7967('0x10')]=Object[_0x7967('0x51')](_0x31da43[_0x7967('0x10')],_0x5c2891['query']);delete _0x31da43[_0x7967('0x10')]['id'];return db['UserProfile']['getResources'](_0x31da43);}return db[_0x4d03d0][_0x7967('0x37')](_0x21120e);})[_0x7967('0x15')](function(_0x3f8e4f){_0x5dab31[_0x7967('0xa')]=_0x3f8e4f['count'];_0xb1587b=_0x3f8e4f[_0x7967('0x23')];return rtq[_0x7967('0x52')](_0x5c2891,_0x456e4d);})[_0x7967('0x15')](function(_0x2402ad){_0x3d481f=_0x2402ad['rows'];return rtq[_0x7967('0x53')](_0xb1587b,_0x3d481f,_0x456e4d,_0x5c2891[_0x7967('0x10')][_0x7967('0x29')]);})[_0x7967('0x15')](function(_0x5e2f20){_0x5dab31['rows']=_0x5e2f20;return _0x5dab31;})[_0x7967('0x15')](respondWithFilteredResult(_0x2a869c,_0x21120e))[_0x7967('0x43')](APIHandleError(_0x2a869c));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index b0c21ff..7c2e738 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5a5c11,_0x358f6b){var _0x5d6ba7=function(_0x272c72){while(--_0x272c72){_0x5a5c11['push'](_0x5a5c11['shift']());}};_0x5d6ba7(++_0x358f6b);}(_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 +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3625f7,_0x27dd21){var _0x2343e2=function(_0x4948b5){while(--_0x4948b5){_0x3625f7['push'](_0x3625f7['shift']());}};_0x2343e2(++_0x27dd21);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e3c8c8f..c3c78d4 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 _0x6b4e=['exports','DATE','INTEGER','STRING'];(function(_0x3dd509,_0x50ddaa){var _0x2796c2=function(_0xa85045){while(--_0xa85045){_0x3dd509['push'](_0x3dd509['shift']());}};_0x2796c2(++_0x50ddaa);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x66c2d8,_0x3c2414){_0x66c2d8=_0x66c2d8-0x0;var _0xa8d0f0=_0x6b4e[_0x66c2d8];return _0xa8d0f0;};'use strict';var Sequelize=require('sequelize');module[_0xe6b4('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe6b4('0x1')]},'responsetime':{'type':Sequelize[_0xe6b4('0x1')]},'ringtime':{'type':Sequelize[_0xe6b4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe6b4('0x3')]},'campaigntype':{'type':Sequelize[_0xe6b4('0x3')]},'membername':{'type':Sequelize[_0xe6b4('0x3')]}}; \ No newline at end of file +var _0xd9ef=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0xf4357c,_0x54788d){var _0x48c0e6=function(_0x18a7e7){while(--_0x18a7e7){_0xf4357c['push'](_0xf4357c['shift']());}};_0x48c0e6(++_0x54788d);}(_0xd9ef,0x95));var _0xfd9e=function(_0x2802cb,_0xffbd53){_0x2802cb=_0x2802cb-0x0;var _0x26f518=_0xd9ef[_0x2802cb];return _0x26f518;};'use strict';var Sequelize=require(_0xfd9e('0x0'));module[_0xfd9e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfd9e('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xfd9e('0x3')]},'ringtime':{'type':Sequelize[_0xfd9e('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xfd9e('0x2')]},'campaigntype':{'type':Sequelize[_0xfd9e('0x2')]},'membername':{'type':Sequelize[_0xfd9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 0b6d2f8..e7a515f 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 _0x0c1e=['../../config/environment','exports','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0c1e,0xc8));var _0xe0c1=function(_0x2139fa,_0xb597a2){_0x2139fa=_0x2139fa-0x0;var _0xb7cc86=_0x0c1e[_0x2139fa];return _0xb7cc86;};'use strict';var _=require(_0xe0c1('0x0'));var util=require(_0xe0c1('0x1'));var logger=require('../../config/logger')(_0xe0c1('0x2'));var moment=require(_0xe0c1('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0c1('0x4'));var fs=require('fs');var path=require(_0xe0c1('0x5'));var rimraf=require(_0xe0c1('0x6'));var config=require(_0xe0c1('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xe0c1('0x8')]=function(_0x4bc4ec,_0x5a5240){return _0x4bc4ec['define']('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3ae=['util','../../config/logger','api','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x13f56d,_0x1845d4){var _0x50711b=function(_0x553264){while(--_0x553264){_0x13f56d['push'](_0x13f56d['shift']());}};_0x50711b(++_0x1845d4);}(_0xa3ae,0x1ee));var _0xea3a=function(_0xca06e,_0x25a203){_0xca06e=_0xca06e-0x0;var _0x32bb7e=_0xa3ae[_0xca06e];return _0x32bb7e;};'use strict';var _=require(_0xea3a('0x0'));var util=require(_0xea3a('0x1'));var logger=require(_0xea3a('0x2'))(_0xea3a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea3a('0x4'));var rimraf=require(_0xea3a('0x5'));var config=require(_0xea3a('0x6'));var attributes=require(_0xea3a('0x7'));module[_0xea3a('0x8')]=function(_0x4462d6,_0x251340){return _0x4462d6['define'](_0xea3a('0x9'),attributes,{'tableName':_0xea3a('0xa'),'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 0dd654a..2cb5f1a 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 _0x7ef2=['../../mysqldb','../../config/logger','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','stringify','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x18f7da,_0x40d95e){var _0x38a3c4=function(_0x3480b5){while(--_0x3480b5){_0x18f7da['push'](_0x18f7da['shift']());}};_0x38a3c4(++_0x40d95e);}(_0x7ef2,0xbf));var _0x27ef=function(_0x52470e,_0x5f3cdc){_0x52470e=_0x52470e-0x0;var _0x560003=_0x7ef2[_0x52470e];return _0x560003;};'use strict';var _=require(_0x27ef('0x0'));var util=require(_0x27ef('0x1'));var moment=require(_0x27ef('0x2'));var BPromise=require(_0x27ef('0x3'));var rs=require(_0x27ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x27ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x27ef('0x7'));var client=jayson[_0x27ef('0x8')][_0x27ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4722,_0x368cd7,_0x505027){return new BPromise(function(_0x2c48d0,_0x505668){return client['request'](_0x2b4722,_0x505027)[_0x27ef('0xa')](function(_0x5f8f10){logger[_0x27ef('0xb')](_0x27ef('0xc'),_0x368cd7,'request\x20sent');logger[_0x27ef('0xd')](_0x27ef('0xe'),_0x368cd7,_0x27ef('0xf'),JSON['stringify'](_0x5f8f10));if(_0x5f8f10[_0x27ef('0x10')]){if(_0x5f8f10['error'][_0x27ef('0x11')]===0x1f4){logger[_0x27ef('0x10')](_0x27ef('0xc'),_0x368cd7,_0x5f8f10[_0x27ef('0x10')][_0x27ef('0x12')]);return _0x505668(_0x5f8f10[_0x27ef('0x10')][_0x27ef('0x12')]);}logger[_0x27ef('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x368cd7,_0x5f8f10[_0x27ef('0x10')][_0x27ef('0x12')]);return _0x2c48d0(_0x5f8f10[_0x27ef('0x10')][_0x27ef('0x12')]);}else{logger[_0x27ef('0xb')](_0x27ef('0xc'),_0x368cd7,'request\x20sent');_0x2c48d0(_0x5f8f10[_0x27ef('0x13')][_0x27ef('0x12')]);}})['catch'](function(_0x156d3c){logger[_0x27ef('0x10')](_0x27ef('0xc'),_0x368cd7,_0x156d3c);_0x505668(_0x156d3c);});});}exports['CreateReportAgentPreview']=function(_0x3e172f){var _0x2f4aca=this;return new Promise(function(_0x40e55e,_0x133279){return db[_0x27ef('0x14')][_0x27ef('0x15')](_0x3e172f[_0x27ef('0x16')],{'raw':_0x3e172f[_0x27ef('0x17')]?_0x3e172f[_0x27ef('0x17')][_0x27ef('0x18')]===undefined?!![]:![]:!![]})[_0x27ef('0xa')](function(_0x1c24e3){logger[_0x27ef('0xb')]('CreateReportAgentPreview',_0x3e172f);logger[_0x27ef('0xd')](_0x27ef('0x19'),_0x3e172f,JSON[_0x27ef('0x1a')](_0x1c24e3));_0x40e55e(_0x1c24e3);})[_0x27ef('0x1b')](function(_0x3acdea){logger['error'](_0x27ef('0x19'),_0x3acdea['message'],_0x3e172f);_0x133279(_0x2f4aca[_0x27ef('0x10')](0x1f4,_0x3acdea['message']));});});}; \ No newline at end of file +var _0x5fdd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','info','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','moment'];(function(_0x916ccc,_0x19734f){var _0xfd449b=function(_0xa31c4b){while(--_0xa31c4b){_0x916ccc['push'](_0x916ccc['shift']());}};_0xfd449b(++_0x19734f);}(_0x5fdd,0x16f));var _0xd5fd=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0x5fdd[_0x3f25b2];return _0xd8caeb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd5fd('0x0'));var BPromise=require(_0xd5fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5fd('0x2'));var db=require(_0xd5fd('0x3'))['db'];var utils=require(_0xd5fd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5fd('0x5'));var jayson=require(_0xd5fd('0x6'));var client=jayson[_0xd5fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fda78,_0x3f02b1,_0x3a854f){return new BPromise(function(_0x87ca6c,_0x238700){return client['request'](_0x1fda78,_0x3a854f)[_0xd5fd('0x8')](function(_0x559dae){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0xd5fd('0x9'));logger[_0xd5fd('0xa')](_0xd5fd('0xb'),_0x3f02b1,_0xd5fd('0x9'),JSON[_0xd5fd('0xc')](_0x559dae));if(_0x559dae[_0xd5fd('0xd')]){if(_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xe')]===0x1f4){logger[_0xd5fd('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0x559dae['error'][_0xd5fd('0xf')]);return _0x238700(_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xf')]);}logger['error'](_0xd5fd('0x10'),_0x3f02b1,_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xf')]);return _0x87ca6c(_0x559dae['error'][_0xd5fd('0xf')]);}else{logger[_0xd5fd('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0xd5fd('0x9'));_0x87ca6c(_0x559dae['result'][_0xd5fd('0xf')]);}})[_0xd5fd('0x12')](function(_0x1b00c5){logger[_0xd5fd('0xd')](_0xd5fd('0x10'),_0x3f02b1,_0x1b00c5);_0x238700(_0x1b00c5);});});}exports[_0xd5fd('0x13')]=function(_0x50f12e){var _0x365829=this;return new Promise(function(_0x6873ae,_0x262c27){return db[_0xd5fd('0x14')]['create'](_0x50f12e[_0xd5fd('0x15')],{'raw':_0x50f12e[_0xd5fd('0x16')]?_0x50f12e[_0xd5fd('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd5fd('0x8')](function(_0xf4ed32){logger['info'](_0xd5fd('0x13'),_0x50f12e);logger['debug']('CreateReportAgentPreview',_0x50f12e,JSON[_0xd5fd('0xc')](_0xf4ed32));_0x6873ae(_0xf4ed32);})[_0xd5fd('0x12')](function(_0x21d4ad){logger['error'](_0xd5fd('0x13'),_0x21d4ad['message'],_0x50f12e);_0x262c27(_0x365829[_0xd5fd('0xd')](0x1f4,_0x21d4ad[_0xd5fd('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index ee044a3..f20a604 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 _0x8d05=['queueNotify','sms','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','exports','multer','util','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','showMailQueues','/chat/queues/:id/notify','fax','showFaxQueues','openchannel','/sms/queues/:id/notify'];(function(_0x251eaa,_0x1eb908){var _0x4110a4=function(_0x596054){while(--_0x596054){_0x251eaa['push'](_0x251eaa['shift']());}};_0x4110a4(++_0x1eb908);}(_0x8d05,0xe8));var _0x58d0=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x8d05[_0x2ca2d0];return _0x521c23;};'use strict';var multer=require(_0x58d0('0x0'));var util=require(_0x58d0('0x1'));var path=require(_0x58d0('0x2'));var express=require(_0x58d0('0x3'));var router=express[_0x58d0('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x58d0('0x5')](_0x58d0('0x6'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x8')]);router['get'](_0x58d0('0x9'),auth[_0x58d0('0x7')](),controller['voiceChannelMixMonitor']);router[_0x58d0('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x58d0('0x7')](),controller[_0x58d0('0xa')]);router[_0x58d0('0x5')](_0x58d0('0xb'),auth[_0x58d0('0x7')](),controller['voiceQueues']);router[_0x58d0('0x5')](_0x58d0('0xc'),auth['isAuthenticated'](),controller[_0x58d0('0xd')]);router[_0x58d0('0x5')]('/mail/queues',auth['isAuthenticated'](),controller[_0x58d0('0xe')]);router[_0x58d0('0x5')](_0x58d0('0xf'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x10')]);router[_0x58d0('0x5')](_0x58d0('0x11'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x12')]);router[_0x58d0('0x5')](_0x58d0('0x13'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x14')]);router[_0x58d0('0x5')](_0x58d0('0x15'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x16')]);router[_0x58d0('0x5')](_0x58d0('0x17'),auth['isAuthenticated'](),controller[_0x58d0('0x18')]);router[_0x58d0('0x5')](_0x58d0('0x19'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x1a')]);router[_0x58d0('0x5')](_0x58d0('0x1b'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x1c')]);router[_0x58d0('0x5')](_0x58d0('0x1d'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x1e')]);router[_0x58d0('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x58d0('0x7')](),controller[_0x58d0('0x1f')]);router[_0x58d0('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x58d0('0x7')](),controller[_0x58d0('0x20')]);router[_0x58d0('0x5')]('/voice/queues/:id',auth[_0x58d0('0x7')](),controller['showVoiceQueues']);router['put'](_0x58d0('0x21'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x22')]);router[_0x58d0('0x5')]('/outbound',auth[_0x58d0('0x7')](),controller[_0x58d0('0x23')]);router[_0x58d0('0x5')]('/outbound/channels',auth[_0x58d0('0x7')](),controller[_0x58d0('0x24')]);router['get'](_0x58d0('0x25'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x26')]);router[_0x58d0('0x27')](_0x58d0('0x28'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x58d0('0x5')](_0x58d0('0x29'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x2a')]);router[_0x58d0('0x5')]('/trunks',auth[_0x58d0('0x7')](),controller['trunks']);router[_0x58d0('0x5')](_0x58d0('0x2b'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x2c')]);router['get'](_0x58d0('0x2d'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x2e')]);router['get'](_0x58d0('0x2f'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x30')]);router[_0x58d0('0x5')]('/mail/queues/waitinginteractions',auth[_0x58d0('0x7')](),controller[_0x58d0('0x31')]);router[_0x58d0('0x5')](_0x58d0('0x32'),auth[_0x58d0('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0x58d0('0x5')](_0x58d0('0x33'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x34')]);router[_0x58d0('0x5')](_0x58d0('0x35'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x36')]);router[_0x58d0('0x5')](_0x58d0('0x37'),auth['isAuthenticated'](),controller[_0x58d0('0x38')]);router[_0x58d0('0x5')](_0x58d0('0x39'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x3a')]);router[_0x58d0('0x3b')](_0x58d0('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0x58d0('0x3d')));router[_0x58d0('0x5')]('/mail/queues/:id',auth[_0x58d0('0x7')](),controller[_0x58d0('0x3e')]);router[_0x58d0('0x3b')](_0x58d0('0x3f'),auth[_0x58d0('0x7')](),controller['queueNotify']('chat'));router[_0x58d0('0x5')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0x58d0('0x3b')]('/fax/queues/:id/notify',auth[_0x58d0('0x7')](),controller['queueNotify'](_0x58d0('0x40')));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x58d0('0x41')]);router[_0x58d0('0x3b')]('/openchannel/queues/:id/notify',auth[_0x58d0('0x7')](),controller['queueNotify'](_0x58d0('0x42')));router[_0x58d0('0x5')]('/openchannel/queues/:id',auth[_0x58d0('0x7')](),controller['showOpenchannelQueues']);router[_0x58d0('0x3b')](_0x58d0('0x43'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x44')](_0x58d0('0x45')));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x58d0('0x44')](_0x58d0('0x46')));router['get'](_0x58d0('0x47'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x58d0('0x5')](_0x58d0('0x48'),auth[_0x58d0('0x7')](),controller[_0x58d0('0x49')]);router[_0x58d0('0x3b')]('/agents/:id/notify',auth['isAuthenticated'](),controller['agentNotify']);module[_0x58d0('0x4a')]=router; \ No newline at end of file +var _0x3265=['/agents/:id/notify','agentNotify','exports','multer','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','showSmsQueues','/whatsapp/queues/:id'];(function(_0x413b19,_0x299538){var _0xb73bb6=function(_0x4a5160){while(--_0x4a5160){_0x413b19['push'](_0x413b19['shift']());}};_0xb73bb6(++_0x299538);}(_0x3265,0x14b));var _0x5326=function(_0x198b7b,_0x5f5bae){_0x198b7b=_0x198b7b-0x0;var _0x16c056=_0x3265[_0x198b7b];return _0x16c056;};'use strict';var multer=require(_0x5326('0x0'));var util=require('util');var path=require(_0x5326('0x1'));var express=require(_0x5326('0x2'));var router=express[_0x5326('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x5326('0x4'));router[_0x5326('0x5')](_0x5326('0x6'),auth[_0x5326('0x7')](),controller[_0x5326('0x8')]);router[_0x5326('0x5')](_0x5326('0x9'),auth['isAuthenticated'](),controller[_0x5326('0xa')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x5326('0x7')](),controller[_0x5326('0xb')]);router[_0x5326('0x5')](_0x5326('0xc'),auth[_0x5326('0x7')](),controller[_0x5326('0xd')]);router[_0x5326('0x5')]('/chat/queues',auth['isAuthenticated'](),controller[_0x5326('0xe')]);router['get'](_0x5326('0xf'),auth[_0x5326('0x7')](),controller['mailQueues']);router['get'](_0x5326('0x10'),auth['isAuthenticated'](),controller[_0x5326('0x11')]);router[_0x5326('0x5')](_0x5326('0x12'),auth[_0x5326('0x7')](),controller['openchannelQueues']);router[_0x5326('0x5')]('/sms/queues',auth[_0x5326('0x7')](),controller[_0x5326('0x13')]);router['get'](_0x5326('0x14'),auth[_0x5326('0x7')](),controller[_0x5326('0x15')]);router[_0x5326('0x5')](_0x5326('0x16'),auth[_0x5326('0x7')](),controller[_0x5326('0x17')]);router[_0x5326('0x5')](_0x5326('0x18'),auth['isAuthenticated'](),controller[_0x5326('0x19')]);router[_0x5326('0x5')](_0x5326('0x1a'),auth[_0x5326('0x7')](),controller[_0x5326('0x1b')]);router[_0x5326('0x5')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x5326('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x5326('0x7')](),controller['voiceQueuesChannelHangup']);router[_0x5326('0x5')](_0x5326('0x1c'),auth[_0x5326('0x7')](),controller[_0x5326('0x1d')]);router[_0x5326('0x5')](_0x5326('0x1e'),auth[_0x5326('0x7')](),controller[_0x5326('0x1f')]);router[_0x5326('0x20')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x5326('0x21')]);router[_0x5326('0x5')](_0x5326('0x22'),auth[_0x5326('0x7')](),controller[_0x5326('0x23')]);router[_0x5326('0x5')](_0x5326('0x24'),auth[_0x5326('0x7')](),controller['outboundChannels']);router[_0x5326('0x5')](_0x5326('0x25'),auth[_0x5326('0x7')](),controller[_0x5326('0x26')]);router[_0x5326('0x20')](_0x5326('0x27'),auth[_0x5326('0x7')](),controller[_0x5326('0x28')]);router[_0x5326('0x5')](_0x5326('0x29'),auth['isAuthenticated'](),controller[_0x5326('0x2a')]);router[_0x5326('0x5')](_0x5326('0x2b'),auth['isAuthenticated'](),controller[_0x5326('0x2c')]);router['get'](_0x5326('0x2d'),auth[_0x5326('0x7')](),controller[_0x5326('0x2e')]);router[_0x5326('0x5')](_0x5326('0x2f'),auth['isAuthenticated'](),controller[_0x5326('0x30')]);router[_0x5326('0x5')]('/chat/queues/waitinginteractions',auth[_0x5326('0x7')](),controller[_0x5326('0x31')]);router[_0x5326('0x5')](_0x5326('0x32'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x5326('0x5')](_0x5326('0x33'),auth[_0x5326('0x7')](),controller[_0x5326('0x34')]);router[_0x5326('0x5')](_0x5326('0x35'),auth[_0x5326('0x7')](),controller[_0x5326('0x36')]);router[_0x5326('0x5')]('/sms/queues/waitinginteractions',auth[_0x5326('0x7')](),controller[_0x5326('0x37')]);router[_0x5326('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x5326('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0x5326('0x5')](_0x5326('0x38'),auth[_0x5326('0x7')](),controller[_0x5326('0x39')]);router[_0x5326('0x3a')](_0x5326('0x3b'),auth[_0x5326('0x7')](),controller['queueNotify'](_0x5326('0x3c')));router['get'](_0x5326('0x3d'),auth[_0x5326('0x7')](),controller[_0x5326('0x3e')]);router['post'](_0x5326('0x3f'),auth[_0x5326('0x7')](),controller[_0x5326('0x40')](_0x5326('0x41')));router[_0x5326('0x5')](_0x5326('0x42'),auth[_0x5326('0x7')](),controller[_0x5326('0x43')]);router[_0x5326('0x3a')](_0x5326('0x44'),auth[_0x5326('0x7')](),controller['queueNotify'](_0x5326('0x45')));router['get'](_0x5326('0x46'),auth['isAuthenticated'](),controller[_0x5326('0x47')]);router['post'](_0x5326('0x48'),auth[_0x5326('0x7')](),controller[_0x5326('0x40')](_0x5326('0x49')));router['get']('/openchannel/queues/:id',auth[_0x5326('0x7')](),controller['showOpenchannelQueues']);router[_0x5326('0x3a')](_0x5326('0x4a'),auth['isAuthenticated'](),controller[_0x5326('0x40')](_0x5326('0x4b')));router[_0x5326('0x3a')](_0x5326('0x4c'),auth[_0x5326('0x7')](),controller[_0x5326('0x40')]('whatsapp'));router[_0x5326('0x5')]('/sms/queues/:id',auth[_0x5326('0x7')](),controller[_0x5326('0x4d')]);router[_0x5326('0x5')](_0x5326('0x4e'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x5326('0x3a')](_0x5326('0x4f'),auth[_0x5326('0x7')](),controller[_0x5326('0x50')]);module[_0x5326('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 37f51f2..a61c466 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x571ed5,_0x427243){var _0x3d95e1=function(_0x28a948){while(--_0x28a948){_0x571ed5['push'](_0x571ed5['shift']());}};_0x3d95e1(++_0x427243);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file +var _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a4b650c..ef3543c 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 _0x9085=['show','/:id/run','run','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x493cea,_0x144c6a){var _0x1c32ba=function(_0x47c0f9){while(--_0x47c0f9){_0x493cea['push'](_0x493cea['shift']());}};_0x1c32ba(++_0x144c6a);}(_0x9085,0xd3));var _0x5908=function(_0x226494,_0xc4b645){_0x226494=_0x226494-0x0;var _0x27b950=_0x9085[_0x226494];return _0x27b950;};'use strict';var multer=require(_0x5908('0x0'));var util=require(_0x5908('0x1'));var path=require(_0x5908('0x2'));var timeout=require(_0x5908('0x3'));var express=require(_0x5908('0x4'));var router=express[_0x5908('0x5')]();var fs_extra=require(_0x5908('0x6'));var auth=require(_0x5908('0x7'));var interaction=require(_0x5908('0x8'));var config=require(_0x5908('0x9'));var controller=require(_0x5908('0xa'));router[_0x5908('0xb')]('/',auth[_0x5908('0xc')](),controller[_0x5908('0xd')]);router[_0x5908('0xb')]('/:id',auth[_0x5908('0xc')](),controller[_0x5908('0xe')]);router[_0x5908('0xb')](_0x5908('0xf'),auth[_0x5908('0xc')](),controller[_0x5908('0x10')]);router[_0x5908('0x11')]('/',auth[_0x5908('0xc')](),controller[_0x5908('0x12')]);router[_0x5908('0x13')](_0x5908('0x14'),auth[_0x5908('0xc')](),controller[_0x5908('0x15')]);router[_0x5908('0x16')](_0x5908('0x14'),auth[_0x5908('0xc')](),controller[_0x5908('0x17')]);module[_0x5908('0x18')]=router; \ No newline at end of file +var _0x0538=['/:id/run','run','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4976a4,_0x30a5ff){var _0x3c8ca6=function(_0x24e155){while(--_0x24e155){_0x4976a4['push'](_0x4976a4['shift']());}};_0x3c8ca6(++_0x30a5ff);}(_0x0538,0x16c));var _0x8053=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0x0538[_0x12aaee];return _0x37c350;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8053('0x0'));var timeout=require(_0x8053('0x1'));var express=require(_0x8053('0x2'));var router=express[_0x8053('0x3')]();var fs_extra=require(_0x8053('0x4'));var auth=require(_0x8053('0x5'));var interaction=require(_0x8053('0x6'));var config=require(_0x8053('0x7'));var controller=require(_0x8053('0x8'));router[_0x8053('0x9')]('/',auth['isAuthenticated'](),controller[_0x8053('0xa')]);router['get'](_0x8053('0xb'),auth[_0x8053('0xc')](),controller[_0x8053('0xd')]);router[_0x8053('0x9')](_0x8053('0xe'),auth[_0x8053('0xc')](),controller[_0x8053('0xf')]);router[_0x8053('0x10')]('/',auth[_0x8053('0xc')](),controller[_0x8053('0x11')]);router[_0x8053('0x12')](_0x8053('0xb'),auth[_0x8053('0xc')](),controller['update']);router['delete'](_0x8053('0xb'),auth[_0x8053('0xc')](),controller[_0x8053('0x13')]);module[_0x8053('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 4f8a155..f4c63de 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 _0xd3c6=['default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','pdf','csv','custom'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3c6,0xa4));var _0x6d3c=function(_0x1b74e9,_0x5360a7){_0x1b74e9=_0x1b74e9-0x0;var _0x3206ec=_0xd3c6[_0x1b74e9];return _0x3206ec;};'use strict';var Sequelize=require('sequelize');module[_0x6d3c('0x0')]={'name':{'type':Sequelize[_0x6d3c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6d3c('0x1')]},'active':{'type':Sequelize[_0x6d3c('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d3c('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x6d3c('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6d3c('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6d3c('0x6')](_0x6d3c('0x7'),_0x6d3c('0x8'),_0x6d3c('0x9'),_0x6d3c('0xa'),_0x6d3c('0xb'),_0x6d3c('0xc'),'minutes'),'allowNull':![],'defaultValue':_0x6d3c('0xb')},'output':{'type':Sequelize['ENUM']('csv',_0x6d3c('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x6d3c('0xe')},'type':{'type':Sequelize['ENUM'](_0x6d3c('0xf'),_0x6d3c('0x10')),'allowNull':![],'defaultValue':_0x6d3c('0xf')},'sendMail':{'type':Sequelize[_0x6d3c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6d3c('0x1')]},'cc':{'type':Sequelize[_0x6d3c('0x11')]},'bcc':{'type':Sequelize[_0x6d3c('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x6d3c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x47ad=['ENUM','years','quarters','weeks','days','hours','minutes','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER'];(function(_0x197065,_0x2e79d0){var _0x3d9404=function(_0xf582a7){while(--_0xf582a7){_0x197065['push'](_0x197065['shift']());}};_0x3d9404(++_0x2e79d0);}(_0x47ad,0xd7));var _0xd47a=function(_0x20f96d,_0x23e67f){_0x20f96d=_0x20f96d-0x0;var _0x9a7524=_0x47ad[_0x20f96d];return _0x9a7524;};'use strict';var Sequelize=require(_0xd47a('0x0'));module[_0xd47a('0x1')]={'name':{'type':Sequelize[_0xd47a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd47a('0x2')]},'active':{'type':Sequelize[_0xd47a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xd47a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd47a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd47a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd47a('0x6')](_0xd47a('0x7'),_0xd47a('0x8'),'months',_0xd47a('0x9'),_0xd47a('0xa'),_0xd47a('0xb'),_0xd47a('0xc')),'allowNull':![],'defaultValue':_0xd47a('0xa')},'output':{'type':Sequelize[_0xd47a('0x6')](_0xd47a('0xd'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xd47a('0x6')](_0xd47a('0xe'),_0xd47a('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xd47a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd47a('0x2')]},'cc':{'type':Sequelize[_0xd47a('0x10')]},'bcc':{'type':Sequelize[_0xd47a('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xd47a('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 fb5430a..e14a67d 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 _0x0338=['then','get','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','set','apply','save','update','destroy'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0338,0x197));var _0x8033=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x0338[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require(_0x8033('0x0'));var rimraf=require(_0x8033('0x1'));var zipdir=require(_0x8033('0x2'));var jsonpatch=require(_0x8033('0x3'));var rp=require(_0x8033('0x4'));var moment=require(_0x8033('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8033('0x6'));var util=require('util');var path=require(_0x8033('0x7'));var sox=require(_0x8033('0x8'));var csv=require(_0x8033('0x9'));var ejs=require(_0x8033('0xa'));var fs=require('fs');var fs_extra=require(_0x8033('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8033('0xc'));var deskjs=require(_0x8033('0xd'));var toCsv=require(_0x8033('0x9'));var querystring=require(_0x8033('0xe'));var Papa=require(_0x8033('0xf'));var Redis=require(_0x8033('0x10'));var authService=require(_0x8033('0x11'));var qs=require(_0x8033('0x12'));var as=require(_0x8033('0x13'));var hardwareService=require(_0x8033('0x14'));var logger=require(_0x8033('0x15'))(_0x8033('0x16'));var utils=require('../../config/utils');var config=require(_0x8033('0x17'));var licenseUtil=require(_0x8033('0x18'));var db=require(_0x8033('0x19'))['db'];function respondWithStatusCode(_0x486f21,_0x23f4d5){_0x23f4d5=_0x23f4d5||0xcc;return function(_0x1571f0){if(_0x1571f0){return _0x486f21[_0x8033('0x1a')](_0x23f4d5);}return _0x486f21['status'](_0x23f4d5)[_0x8033('0x1b')]();};}function respondWithResult(_0x5d19f1,_0x5ac28d){_0x5ac28d=_0x5ac28d||0xc8;return function(_0xbc9199){if(_0xbc9199){return _0x5d19f1[_0x8033('0x1c')](_0x5ac28d)[_0x8033('0x1d')](_0xbc9199);}};}function respondWithFilteredResult(_0x10021f,_0x3c0885){return function(_0x47c3de){if(_0x47c3de){var _0xcb8426=typeof _0x3c0885['offset']===_0x8033('0x1e')&&typeof _0x3c0885['limit']===_0x8033('0x1e');var _0x1db0e8=_0x47c3de[_0x8033('0x1f')];var _0xf3960=_0xcb8426?0x0:_0x3c0885[_0x8033('0x20')];var _0x55160d=_0xcb8426?_0x47c3de[_0x8033('0x1f')]:_0x3c0885[_0x8033('0x20')]+_0x3c0885['limit'];var _0x557078;if(_0x55160d>=_0x1db0e8){_0x55160d=_0x1db0e8;_0x557078=0xc8;}else{_0x557078=0xce;}_0x10021f[_0x8033('0x1c')](_0x557078);return _0x10021f[_0x8033('0x21')]('Content-Range',_0xf3960+'-'+_0x55160d+'/'+_0x1db0e8)['json'](_0x47c3de);}return null;};}function patchUpdates(_0x1b9730){return function(_0x8bd4b6){try{jsonpatch[_0x8033('0x22')](_0x8bd4b6,_0x1b9730,!![]);}catch(_0x282732){return BPromise['reject'](_0x282732);}return _0x8bd4b6[_0x8033('0x23')]();};}function saveUpdates(_0x1bb4af,_0x6de480){return function(_0x562dda){if(_0x562dda){return _0x562dda[_0x8033('0x24')](_0x1bb4af)['then'](function(_0x2f595b){return _0x2f595b;});}return null;};}function removeEntity(_0x34ab15,_0x2cc6b4){return function(_0x32d8ca){if(_0x32d8ca){return _0x32d8ca[_0x8033('0x25')]()[_0x8033('0x26')](function(){var _0xf5f83a=_0x32d8ca[_0x8033('0x27')]({'plain':!![]});var _0x2ac442='Scheduler';return db[_0x8033('0x28')]['destroy']({'where':{'type':_0x2ac442,'resourceId':_0xf5f83a['id']}})[_0x8033('0x26')](function(){return _0x32d8ca;});})[_0x8033('0x26')](function(){_0x34ab15[_0x8033('0x1c')](0xcc)[_0x8033('0x1b')]();});}};}function handleEntityNotFound(_0x4537af,_0x433f12){return function(_0x2f5e9f){if(!_0x2f5e9f){_0x4537af[_0x8033('0x1a')](0x194);}return _0x2f5e9f;};}function handleError(_0x1ae6af,_0x50423e){_0x50423e=_0x50423e||0x1f4;return function(_0x59df32){logger[_0x8033('0x29')](_0x59df32[_0x8033('0x2a')]);if(_0x59df32[_0x8033('0x2b')]){delete _0x59df32[_0x8033('0x2b')];}_0x1ae6af[_0x8033('0x1c')](_0x50423e)[_0x8033('0x2c')](_0x59df32);};}exports[_0x8033('0x2d')]=function(_0x2d181c,_0xeb9349){var _0x109e76={},_0xc11b0c={},_0x4431ef={'count':0x0,'rows':[]};var _0x52d314=_[_0x8033('0x2e')](db[_0x8033('0x2f')][_0x8033('0x30')],function(_0x3a3837){return{'name':_0x3a3837[_0x8033('0x31')],'type':_0x3a3837[_0x8033('0x32')][_0x8033('0x33')]};});_0xc11b0c[_0x8033('0x34')]=_[_0x8033('0x2e')](_0x52d314,'name');_0xc11b0c['query']=_[_0x8033('0x35')](_0x2d181c['query']);_0xc11b0c[_0x8033('0x36')]=_[_0x8033('0x37')](_0xc11b0c[_0x8033('0x34')],_0xc11b0c['query']);_0x109e76[_0x8033('0x38')]=_['intersection'](_0xc11b0c[_0x8033('0x34')],qs[_0x8033('0x39')](_0x2d181c[_0x8033('0x3a')][_0x8033('0x39')]));_0x109e76['attributes']=_0x109e76['attributes'][_0x8033('0x3b')]?_0x109e76[_0x8033('0x38')]:_0xc11b0c[_0x8033('0x34')];if(!_0x2d181c[_0x8033('0x3a')][_0x8033('0x3c')]('nolimit')){_0x109e76[_0x8033('0x3d')]=qs[_0x8033('0x3d')](_0x2d181c[_0x8033('0x3a')][_0x8033('0x3d')]);_0x109e76[_0x8033('0x20')]=qs[_0x8033('0x20')](_0x2d181c['query']['offset']);}_0x109e76[_0x8033('0x3e')]=qs[_0x8033('0x3f')](_0x2d181c[_0x8033('0x3a')][_0x8033('0x3f')]);_0x109e76[_0x8033('0x40')]=qs[_0x8033('0x36')](_[_0x8033('0x41')](_0x2d181c['query'],_0xc11b0c[_0x8033('0x36')]),_0x52d314);if(_0x2d181c['query'][_0x8033('0x42')]){_0x109e76[_0x8033('0x40')]=_['merge'](_0x109e76[_0x8033('0x40')],{'$or':_[_0x8033('0x2e')](_0x52d314,function(_0x4ebccc){if(_0x4ebccc[_0x8033('0x32')]!==_0x8033('0x43')){var _0x29a962={};_0x29a962[_0x4ebccc[_0x8033('0x2b')]]={'$like':'%'+_0x2d181c[_0x8033('0x3a')][_0x8033('0x42')]+'%'};return _0x29a962;}})});}_0x109e76=_['merge']({},_0x109e76,_0x2d181c[_0x8033('0x44')]);var _0x392b29={'where':_0x109e76[_0x8033('0x40')]};return db[_0x8033('0x2f')][_0x8033('0x1f')](_0x392b29)['then'](function(_0x457346){_0x4431ef[_0x8033('0x1f')]=_0x457346;if(_0x2d181c['query'][_0x8033('0x45')]){_0x109e76[_0x8033('0x46')]=[{'all':!![]}];}return db[_0x8033('0x2f')][_0x8033('0x47')](_0x109e76);})[_0x8033('0x26')](function(_0x51593f){_0x4431ef[_0x8033('0x48')]=_0x51593f;return _0x4431ef;})[_0x8033('0x26')](respondWithFilteredResult(_0xeb9349,_0x109e76))[_0x8033('0x49')](handleError(_0xeb9349,null));};exports[_0x8033('0x4a')]=function(_0x329e87,_0x57d0f3){var _0x14b93d={'raw':![],'where':{'id':_0x329e87[_0x8033('0x4b')]['id']}},_0x250181={};_0x250181[_0x8033('0x34')]=_[_0x8033('0x35')](db[_0x8033('0x2f')]['rawAttributes']);_0x250181['query']=_[_0x8033('0x35')](_0x329e87[_0x8033('0x3a')]);_0x250181[_0x8033('0x36')]=_[_0x8033('0x37')](_0x250181['model'],_0x250181[_0x8033('0x3a')]);_0x14b93d[_0x8033('0x38')]=_['intersection'](_0x250181['model'],qs[_0x8033('0x39')](_0x329e87[_0x8033('0x3a')][_0x8033('0x39')]));_0x14b93d['attributes']=_0x14b93d[_0x8033('0x38')]['length']?_0x14b93d[_0x8033('0x38')]:_0x250181[_0x8033('0x34')];if(_0x329e87[_0x8033('0x3a')]['includeAll']){_0x14b93d[_0x8033('0x46')]=[{'all':!![]}];}_0x14b93d=_[_0x8033('0x4c')]({},_0x14b93d,_0x329e87[_0x8033('0x44')]);return db[_0x8033('0x2f')][_0x8033('0x4d')](_0x14b93d)['then'](handleEntityNotFound(_0x57d0f3,null))[_0x8033('0x26')](respondWithResult(_0x57d0f3,null))[_0x8033('0x49')](handleError(_0x57d0f3,null));};exports[_0x8033('0x4e')]=function(_0x3af945,_0x3b0c58){return db[_0x8033('0x2f')][_0x8033('0x4e')](_0x3af945[_0x8033('0x4f')],{})[_0x8033('0x26')](function(_0x28f9b2){var _0x3911c3=_0x3af945[_0x8033('0x50')][_0x8033('0x27')]({'plain':!![]});if(!_0x3911c3)throw new Error(_0x8033('0x51'));if(_0x3911c3[_0x8033('0x52')]===_0x8033('0x50')){var _0x5bed09=_0x28f9b2[_0x8033('0x27')]({'plain':!![]});var _0x152817=_0x8033('0x53');return db[_0x8033('0x54')]['find']({'where':{'name':_0x152817,'userProfileId':_0x3911c3['userProfileId']},'raw':!![]})[_0x8033('0x26')](function(_0x1df617){if(_0x1df617&&_0x1df617[_0x8033('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bed09[_0x8033('0x2b')],'resourceId':_0x5bed09['id'],'type':_0x1df617['name'],'sectionId':_0x1df617['id']},{})[_0x8033('0x26')](function(){return _0x28f9b2;});}else{return _0x28f9b2;}})[_0x8033('0x49')](function(_0x566c8b){logger['error'](_0x8033('0x56'),_0x566c8b);throw _0x566c8b;});}return _0x28f9b2;})[_0x8033('0x26')](respondWithResult(_0x3b0c58,0xc9))[_0x8033('0x49')](handleError(_0x3b0c58,null));};exports[_0x8033('0x24')]=function(_0x5bc73d,_0x81c8b2){if(_0x5bc73d['body']['id']){delete _0x5bc73d[_0x8033('0x4f')]['id'];}return db['Schedule']['find']({'where':{'id':_0x5bc73d[_0x8033('0x4b')]['id']}})[_0x8033('0x26')](handleEntityNotFound(_0x81c8b2,null))[_0x8033('0x26')](saveUpdates(_0x5bc73d['body'],null))[_0x8033('0x26')](respondWithResult(_0x81c8b2,null))[_0x8033('0x49')](handleError(_0x81c8b2,null));};exports[_0x8033('0x25')]=function(_0x5701a0,_0x38ce69){return db['Schedule'][_0x8033('0x4d')]({'where':{'id':_0x5701a0[_0x8033('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38ce69,null))[_0x8033('0x26')](removeEntity(_0x38ce69,null))['catch'](handleError(_0x38ce69,null));};exports[_0x8033('0x57')]=function(_0x1d8ef4,_0x149746,_0x1f902c){var _0x106bad=require(_0x8033('0x58'));return db['Schedule'][_0x8033('0x4d')]({'where':{'id':_0x1d8ef4[_0x8033('0x4b')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x149746,null))[_0x8033('0x26')](function(){_0x106bad[_0x8033('0x57')](_0x1d8ef4[_0x8033('0x4b')]['id']);})['then'](respondWithStatusCode(_0x149746,null))[_0x8033('0x49')](handleError(_0x149746,null));}; \ No newline at end of file +var _0xc55e=['rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','update','then','destroy','get','Scheduler','stack','send','index','map','Schedule'];(function(_0x3f440e,_0x489a07){var _0x31eef4=function(_0x5fc712){while(--_0x5fc712){_0x3f440e['push'](_0x3f440e['shift']());}};_0x31eef4(++_0x489a07);}(_0xc55e,0x7c));var _0xec55=function(_0x241596,_0x209dab){_0x241596=_0x241596-0x0;var _0x3e05f5=_0xc55e[_0x241596];return _0x3e05f5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec55('0x0'));var zipdir=require(_0xec55('0x1'));var jsonpatch=require(_0xec55('0x2'));var rp=require('request-promise');var moment=require(_0xec55('0x3'));var BPromise=require(_0xec55('0x4'));var Mustache=require('mustache');var util=require(_0xec55('0x5'));var path=require(_0xec55('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xec55('0x7'));var fs=require('fs');var fs_extra=require(_0xec55('0x8'));var _=require(_0xec55('0x9'));var squel=require(_0xec55('0xa'));var crypto=require(_0xec55('0xb'));var jsforce=require(_0xec55('0xc'));var deskjs=require(_0xec55('0xd'));var toCsv=require(_0xec55('0xe'));var querystring=require(_0xec55('0xf'));var Papa=require(_0xec55('0x10'));var Redis=require(_0xec55('0x11'));var authService=require(_0xec55('0x12'));var qs=require(_0xec55('0x13'));var as=require(_0xec55('0x14'));var hardwareService=require(_0xec55('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xec55('0x16'));var licenseUtil=require(_0xec55('0x17'));var db=require(_0xec55('0x18'))['db'];function respondWithStatusCode(_0x3f9279,_0x3f49b0){_0x3f49b0=_0x3f49b0||0xcc;return function(_0x104e5c){if(_0x104e5c){return _0x3f9279[_0xec55('0x19')](_0x3f49b0);}return _0x3f9279['status'](_0x3f49b0)[_0xec55('0x1a')]();};}function respondWithResult(_0x4a25f8,_0x36d479){_0x36d479=_0x36d479||0xc8;return function(_0x30ca4e){if(_0x30ca4e){return _0x4a25f8['status'](_0x36d479)['json'](_0x30ca4e);}};}function respondWithFilteredResult(_0x5c8949,_0x1a9c2f){return function(_0x3b41d4){if(_0x3b41d4){var _0x4428aa=typeof _0x1a9c2f[_0xec55('0x1b')]==='undefined'&&typeof _0x1a9c2f[_0xec55('0x1c')]==='undefined';var _0x745a65=_0x3b41d4[_0xec55('0x1d')];var _0x5bc26f=_0x4428aa?0x0:_0x1a9c2f[_0xec55('0x1b')];var _0x15c9d6=_0x4428aa?_0x3b41d4['count']:_0x1a9c2f[_0xec55('0x1b')]+_0x1a9c2f[_0xec55('0x1c')];var _0x45eae4;if(_0x15c9d6>=_0x745a65){_0x15c9d6=_0x745a65;_0x45eae4=0xc8;}else{_0x45eae4=0xce;}_0x5c8949[_0xec55('0x1e')](_0x45eae4);return _0x5c8949['set'](_0xec55('0x1f'),_0x5bc26f+'-'+_0x15c9d6+'/'+_0x745a65)[_0xec55('0x20')](_0x3b41d4);}return null;};}function patchUpdates(_0xefaa27){return function(_0x2815d6){try{jsonpatch[_0xec55('0x21')](_0x2815d6,_0xefaa27,!![]);}catch(_0x102325){return BPromise['reject'](_0x102325);}return _0x2815d6['save']();};}function saveUpdates(_0x1b376f,_0x49ab48){return function(_0x5a8223){if(_0x5a8223){return _0x5a8223[_0xec55('0x22')](_0x1b376f)[_0xec55('0x23')](function(_0x4eacac){return _0x4eacac;});}return null;};}function removeEntity(_0x327d61,_0x1fab52){return function(_0x4bc26e){if(_0x4bc26e){return _0x4bc26e[_0xec55('0x24')]()[_0xec55('0x23')](function(){var _0x3419ab=_0x4bc26e[_0xec55('0x25')]({'plain':!![]});var _0x147c10=_0xec55('0x26');return db['UserProfileResource'][_0xec55('0x24')]({'where':{'type':_0x147c10,'resourceId':_0x3419ab['id']}})[_0xec55('0x23')](function(){return _0x4bc26e;});})['then'](function(){_0x327d61[_0xec55('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50945d,_0x5ddba6){return function(_0x412ddf){if(!_0x412ddf){_0x50945d[_0xec55('0x19')](0x194);}return _0x412ddf;};}function handleError(_0x198ea7,_0x10d594){_0x10d594=_0x10d594||0x1f4;return function(_0x3b12fc){logger['error'](_0x3b12fc[_0xec55('0x27')]);if(_0x3b12fc['name']){delete _0x3b12fc['name'];}_0x198ea7[_0xec55('0x1e')](_0x10d594)[_0xec55('0x28')](_0x3b12fc);};}exports[_0xec55('0x29')]=function(_0x3014b9,_0x51b57f){var _0x54f0bf={},_0x4584d9={},_0x34d248={'count':0x0,'rows':[]};var _0x20a4d7=_[_0xec55('0x2a')](db[_0xec55('0x2b')][_0xec55('0x2c')],function(_0x2be591){return{'name':_0x2be591[_0xec55('0x2d')],'type':_0x2be591['type']['key']};});_0x4584d9[_0xec55('0x2e')]=_['map'](_0x20a4d7,_0xec55('0x2f'));_0x4584d9[_0xec55('0x30')]=_[_0xec55('0x31')](_0x3014b9[_0xec55('0x30')]);_0x4584d9['filters']=_[_0xec55('0x32')](_0x4584d9['model'],_0x4584d9[_0xec55('0x30')]);_0x54f0bf[_0xec55('0x33')]=_[_0xec55('0x32')](_0x4584d9[_0xec55('0x2e')],qs[_0xec55('0x34')](_0x3014b9[_0xec55('0x30')][_0xec55('0x34')]));_0x54f0bf[_0xec55('0x33')]=_0x54f0bf[_0xec55('0x33')][_0xec55('0x35')]?_0x54f0bf['attributes']:_0x4584d9[_0xec55('0x2e')];if(!_0x3014b9[_0xec55('0x30')][_0xec55('0x36')](_0xec55('0x37'))){_0x54f0bf[_0xec55('0x1c')]=qs['limit'](_0x3014b9['query'][_0xec55('0x1c')]);_0x54f0bf[_0xec55('0x1b')]=qs[_0xec55('0x1b')](_0x3014b9[_0xec55('0x30')]['offset']);}_0x54f0bf['order']=qs['sort'](_0x3014b9['query'][_0xec55('0x38')]);_0x54f0bf['where']=qs['filters'](_[_0xec55('0x39')](_0x3014b9['query'],_0x4584d9['filters']),_0x20a4d7);if(_0x3014b9[_0xec55('0x30')][_0xec55('0x3a')]){_0x54f0bf[_0xec55('0x3b')]=_[_0xec55('0x3c')](_0x54f0bf[_0xec55('0x3b')],{'$or':_[_0xec55('0x2a')](_0x20a4d7,function(_0xb1af59){if(_0xb1af59[_0xec55('0x3d')]!=='VIRTUAL'){var _0x2a4248={};_0x2a4248[_0xb1af59[_0xec55('0x2f')]]={'$like':'%'+_0x3014b9['query'][_0xec55('0x3a')]+'%'};return _0x2a4248;}})});}_0x54f0bf=_[_0xec55('0x3c')]({},_0x54f0bf,_0x3014b9[_0xec55('0x3e')]);var _0x39b193={'where':_0x54f0bf['where']};return db[_0xec55('0x2b')][_0xec55('0x1d')](_0x39b193)[_0xec55('0x23')](function(_0x410be7){_0x34d248[_0xec55('0x1d')]=_0x410be7;if(_0x3014b9[_0xec55('0x30')][_0xec55('0x3f')]){_0x54f0bf[_0xec55('0x40')]=[{'all':!![]}];}return db[_0xec55('0x2b')][_0xec55('0x41')](_0x54f0bf);})[_0xec55('0x23')](function(_0x286baf){_0x34d248[_0xec55('0x42')]=_0x286baf;return _0x34d248;})[_0xec55('0x23')](respondWithFilteredResult(_0x51b57f,_0x54f0bf))[_0xec55('0x43')](handleError(_0x51b57f,null));};exports[_0xec55('0x44')]=function(_0x1145e0,_0x5e1b5e){var _0x40bf0c={'raw':![],'where':{'id':_0x1145e0[_0xec55('0x45')]['id']}},_0x44d3f5={};_0x44d3f5[_0xec55('0x2e')]=_['keys'](db[_0xec55('0x2b')][_0xec55('0x2c')]);_0x44d3f5['query']=_[_0xec55('0x31')](_0x1145e0[_0xec55('0x30')]);_0x44d3f5[_0xec55('0x46')]=_[_0xec55('0x32')](_0x44d3f5[_0xec55('0x2e')],_0x44d3f5[_0xec55('0x30')]);_0x40bf0c[_0xec55('0x33')]=_[_0xec55('0x32')](_0x44d3f5[_0xec55('0x2e')],qs['fields'](_0x1145e0['query'][_0xec55('0x34')]));_0x40bf0c[_0xec55('0x33')]=_0x40bf0c['attributes'][_0xec55('0x35')]?_0x40bf0c['attributes']:_0x44d3f5[_0xec55('0x2e')];if(_0x1145e0[_0xec55('0x30')][_0xec55('0x3f')]){_0x40bf0c[_0xec55('0x40')]=[{'all':!![]}];}_0x40bf0c=_[_0xec55('0x3c')]({},_0x40bf0c,_0x1145e0['options']);return db[_0xec55('0x2b')][_0xec55('0x47')](_0x40bf0c)[_0xec55('0x23')](handleEntityNotFound(_0x5e1b5e,null))['then'](respondWithResult(_0x5e1b5e,null))['catch'](handleError(_0x5e1b5e,null));};exports[_0xec55('0x48')]=function(_0x5a1888,_0x5cc220){return db[_0xec55('0x2b')][_0xec55('0x48')](_0x5a1888[_0xec55('0x49')],{})[_0xec55('0x23')](function(_0x17200b){var _0x5e02f4=_0x5a1888[_0xec55('0x4a')][_0xec55('0x25')]({'plain':!![]});if(!_0x5e02f4)throw new Error(_0xec55('0x4b'));if(_0x5e02f4[_0xec55('0x4c')]===_0xec55('0x4a')){var _0x2ace11=_0x17200b[_0xec55('0x25')]({'plain':!![]});var _0x313f57=_0xec55('0x26');return db[_0xec55('0x4d')][_0xec55('0x47')]({'where':{'name':_0x313f57,'userProfileId':_0x5e02f4[_0xec55('0x4e')]},'raw':!![]})[_0xec55('0x23')](function(_0x5197f2){if(_0x5197f2&&_0x5197f2[_0xec55('0x4f')]===0x0){return db[_0xec55('0x50')][_0xec55('0x48')]({'name':_0x2ace11[_0xec55('0x2f')],'resourceId':_0x2ace11['id'],'type':_0x5197f2[_0xec55('0x2f')],'sectionId':_0x5197f2['id']},{})[_0xec55('0x23')](function(){return _0x17200b;});}else{return _0x17200b;}})[_0xec55('0x43')](function(_0x11700f){logger[_0xec55('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11700f);throw _0x11700f;});}return _0x17200b;})[_0xec55('0x23')](respondWithResult(_0x5cc220,0xc9))[_0xec55('0x43')](handleError(_0x5cc220,null));};exports[_0xec55('0x22')]=function(_0x10a5e8,_0x3e4d52){if(_0x10a5e8[_0xec55('0x49')]['id']){delete _0x10a5e8[_0xec55('0x49')]['id'];}return db[_0xec55('0x2b')]['find']({'where':{'id':_0x10a5e8[_0xec55('0x45')]['id']}})[_0xec55('0x23')](handleEntityNotFound(_0x3e4d52,null))[_0xec55('0x23')](saveUpdates(_0x10a5e8[_0xec55('0x49')],null))[_0xec55('0x23')](respondWithResult(_0x3e4d52,null))[_0xec55('0x43')](handleError(_0x3e4d52,null));};exports[_0xec55('0x24')]=function(_0xba82c4,_0x27aeb7){return db[_0xec55('0x2b')]['find']({'where':{'id':_0xba82c4['params']['id']}})[_0xec55('0x23')](handleEntityNotFound(_0x27aeb7,null))[_0xec55('0x23')](removeEntity(_0x27aeb7,null))[_0xec55('0x43')](handleError(_0x27aeb7,null));};exports[_0xec55('0x52')]=function(_0x9d803f,_0xe67636,_0x15e433){var _0x271cf7=require(_0xec55('0x53'));return db[_0xec55('0x2b')][_0xec55('0x47')]({'where':{'id':_0x9d803f[_0xec55('0x45')]['id']},'raw':!![]})[_0xec55('0x23')](handleEntityNotFound(_0xe67636,null))[_0xec55('0x23')](function(){_0x271cf7[_0xec55('0x52')](_0x9d803f[_0xec55('0x45')]['id']);})['then'](respondWithStatusCode(_0xe67636,null))['catch'](handleError(_0xe67636,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 4eda73b..3126370 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 _0x4fa5=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','Schedule','tools_schedules','util','../../config/logger','api','moment'];(function(_0x131af2,_0x2d48c5){var _0xd147c8=function(_0x44aeb0){while(--_0x44aeb0){_0x131af2['push'](_0x131af2['shift']());}};_0xd147c8(++_0x2d48c5);}(_0x4fa5,0x1e8));var _0x54fa=function(_0x4bf488,_0x4d1b38){_0x4bf488=_0x4bf488-0x0;var _0x4f5f04=_0x4fa5[_0x4bf488];return _0x4f5f04;};'use strict';var _=require('lodash');var util=require(_0x54fa('0x0'));var logger=require(_0x54fa('0x1'))(_0x54fa('0x2'));var moment=require(_0x54fa('0x3'));var BPromise=require(_0x54fa('0x4'));var rp=require(_0x54fa('0x5'));var fs=require('fs');var path=require(_0x54fa('0x6'));var rimraf=require(_0x54fa('0x7'));var config=require(_0x54fa('0x8'));var attributes=require(_0x54fa('0x9'));module['exports']=function(_0x42dd57,_0x3c5547){return _0x42dd57['define'](_0x54fa('0xa'),attributes,{'tableName':_0x54fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ea4=['util','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','Schedule','tools_schedules'];(function(_0x3de3e8,_0x5bd985){var _0x501fdd=function(_0x5b8959){while(--_0x5b8959){_0x3de3e8['push'](_0x3de3e8['shift']());}};_0x501fdd(++_0x5bd985);}(_0x3ea4,0x15e));var _0x43ea=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0x3ea4[_0x546aaf];return _0x1cbf6d;};'use strict';var _=require('lodash');var util=require(_0x43ea('0x0'));var logger=require('../../config/logger')(_0x43ea('0x1'));var moment=require('moment');var BPromise=require(_0x43ea('0x2'));var rp=require(_0x43ea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43ea('0x4'));var config=require(_0x43ea('0x5'));var attributes=require('./schedule.attributes');module[_0x43ea('0x6')]=function(_0x36fd76,_0x233f01){return _0x36fd76[_0x43ea('0x7')](_0x43ea('0x8'),attributes,{'tableName':_0x43ea('0x9'),'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 ce74b71..88acfef 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 _0xf045=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xf045,0x6c));var _0x5f04=function(_0x49835f,_0x193226){_0x49835f=_0x49835f-0x0;var _0x3afc8f=_0xf045[_0x49835f];return _0x3afc8f;};'use strict';var _=require(_0x5f04('0x0'));var util=require('util');var moment=require(_0x5f04('0x1'));var BPromise=require(_0x5f04('0x2'));var rs=require(_0x5f04('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f04('0x4'))['db'];var utils=require(_0x5f04('0x5'));var logger=require('../../config/logger')(_0x5f04('0x6'));var config=require(_0x5f04('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5f04('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50660b,_0x26be89,_0x329908){return new BPromise(function(_0x53c502,_0x565257){return client['request'](_0x50660b,_0x329908)[_0x5f04('0x9')](function(_0x16185c){logger[_0x5f04('0xa')](_0x5f04('0xb'),_0x26be89,_0x5f04('0xc'));logger[_0x5f04('0xd')](_0x5f04('0xe'),_0x26be89,_0x5f04('0xc'),JSON[_0x5f04('0xf')](_0x16185c));if(_0x16185c[_0x5f04('0x10')]){if(_0x16185c[_0x5f04('0x10')][_0x5f04('0x11')]===0x1f4){logger['error'](_0x5f04('0xb'),_0x26be89,_0x16185c[_0x5f04('0x10')][_0x5f04('0x12')]);return _0x565257(_0x16185c[_0x5f04('0x10')][_0x5f04('0x12')]);}logger[_0x5f04('0x10')](_0x5f04('0xb'),_0x26be89,_0x16185c[_0x5f04('0x10')][_0x5f04('0x12')]);return _0x53c502(_0x16185c[_0x5f04('0x10')][_0x5f04('0x12')]);}else{logger[_0x5f04('0xa')](_0x5f04('0xb'),_0x26be89,_0x5f04('0xc'));_0x53c502(_0x16185c[_0x5f04('0x13')][_0x5f04('0x12')]);}})[_0x5f04('0x14')](function(_0x446f2d){logger['error'](_0x5f04('0xb'),_0x26be89,_0x446f2d);_0x565257(_0x446f2d);});});} \ No newline at end of file +var _0xc5cd=['Schedule,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0xc5cd,0x143));var _0xdc5c=function(_0x4d35df,_0xcc0b08){_0x4d35df=_0x4d35df-0x0;var _0x37327f=_0xc5cd[_0x4d35df];return _0x37327f;};'use strict';var _=require(_0xdc5c('0x0'));var util=require(_0xdc5c('0x1'));var moment=require(_0xdc5c('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc5c('0x3'));var fs=require('fs');var Redis=require(_0xdc5c('0x4'));var db=require(_0xdc5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc5c('0x6'))(_0xdc5c('0x7'));var config=require(_0xdc5c('0x8'));var jayson=require(_0xdc5c('0x9'));var client=jayson['client'][_0xdc5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cce8a,_0x5d3cbd,_0x37cdac){return new BPromise(function(_0x2ed4f3,_0x2af740){return client[_0xdc5c('0xb')](_0x4cce8a,_0x37cdac)['then'](function(_0x51f671){logger[_0xdc5c('0xc')]('Schedule,\x20%s,\x20%s',_0x5d3cbd,'request\x20sent');logger['debug'](_0xdc5c('0xd'),_0x5d3cbd,_0xdc5c('0xe'),JSON['stringify'](_0x51f671));if(_0x51f671[_0xdc5c('0xf')]){if(_0x51f671[_0xdc5c('0xf')][_0xdc5c('0x10')]===0x1f4){logger[_0xdc5c('0xf')](_0xdc5c('0x11'),_0x5d3cbd,_0x51f671[_0xdc5c('0xf')][_0xdc5c('0x12')]);return _0x2af740(_0x51f671[_0xdc5c('0xf')]['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0x5d3cbd,_0x51f671[_0xdc5c('0xf')]['message']);return _0x2ed4f3(_0x51f671[_0xdc5c('0xf')][_0xdc5c('0x12')]);}else{logger[_0xdc5c('0xc')](_0xdc5c('0x11'),_0x5d3cbd,_0xdc5c('0xe'));_0x2ed4f3(_0x51f671['result'][_0xdc5c('0x12')]);}})[_0xdc5c('0x13')](function(_0x462a63){logger[_0xdc5c('0xf')](_0xdc5c('0x11'),_0x5d3cbd,_0x462a63);_0x2af740(_0x462a63);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 0f94085..1f84ac9 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 _0x62c1=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','delete','destroy','exports'];(function(_0x459820,_0x1b8e1d){var _0xafadeb=function(_0x248210){while(--_0x248210){_0x459820['push'](_0x459820['shift']());}};_0xafadeb(++_0x1b8e1d);}(_0x62c1,0xf7));var _0x162c=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x62c1[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x162c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x162c('0x1'));var express=require('express');var router=express[_0x162c('0x2')]();var fs_extra=require(_0x162c('0x3'));var auth=require(_0x162c('0x4'));var interaction=require(_0x162c('0x5'));var config=require('../../config/environment');var controller=require(_0x162c('0x6'));router[_0x162c('0x7')]('/',auth[_0x162c('0x8')](),controller[_0x162c('0x9')]);router[_0x162c('0x7')]('/describe',auth[_0x162c('0x8')](),controller['describe']);router[_0x162c('0x7')](_0x162c('0xa'),auth[_0x162c('0x8')](),controller[_0x162c('0xb')]);router[_0x162c('0x7')](_0x162c('0xc'),auth[_0x162c('0x8')](),controller[_0x162c('0xd')]);router[_0x162c('0xe')]('/',auth[_0x162c('0x8')](),controller[_0x162c('0xf')]);router['put']('/:id',auth[_0x162c('0x8')](),controller['update']);router[_0x162c('0x10')](_0x162c('0xa'),auth[_0x162c('0x8')](),controller[_0x162c('0x11')]);module[_0x162c('0x12')]=router; \ No newline at end of file +var _0xfdfb=['get','describe','show','/:id/download','download','post','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index'];(function(_0x3a35d5,_0x5ec663){var _0x5445f2=function(_0x5520b7){while(--_0x5520b7){_0x3a35d5['push'](_0x3a35d5['shift']());}};_0x5445f2(++_0x5ec663);}(_0xfdfb,0x1c0));var _0xbfdf=function(_0x4e0d05,_0x2a5cf4){_0x4e0d05=_0x4e0d05-0x0;var _0x4def44=_0xfdfb[_0x4e0d05];return _0x4def44;};'use strict';var multer=require(_0xbfdf('0x0'));var util=require(_0xbfdf('0x1'));var path=require(_0xbfdf('0x2'));var timeout=require(_0xbfdf('0x3'));var express=require('express');var router=express[_0xbfdf('0x4')]();var fs_extra=require(_0xbfdf('0x5'));var auth=require(_0xbfdf('0x6'));var interaction=require(_0xbfdf('0x7'));var config=require(_0xbfdf('0x8'));var controller=require(_0xbfdf('0x9'));router['get']('/',auth[_0xbfdf('0xa')](),controller[_0xbfdf('0xb')]);router[_0xbfdf('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xbfdf('0xd')]);router[_0xbfdf('0xc')]('/:id',auth[_0xbfdf('0xa')](),controller[_0xbfdf('0xe')]);router[_0xbfdf('0xc')](_0xbfdf('0xf'),auth[_0xbfdf('0xa')](),controller[_0xbfdf('0x10')]);router[_0xbfdf('0x11')]('/',auth[_0xbfdf('0xa')](),controller[_0xbfdf('0x12')]);router['put'](_0xbfdf('0x13'),auth[_0xbfdf('0xa')](),controller[_0xbfdf('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xbfdf('0x15')]);module[_0xbfdf('0x16')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5ca9016..b1b96f8 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 _0xa880=['path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment'];(function(_0xc45596,_0x5c410e){var _0x425ffe=function(_0x3c327d){while(--_0x3c327d){_0xc45596['push'](_0xc45596['shift']());}};_0x425ffe(++_0x5c410e);}(_0xa880,0x106));var _0x0a88=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xa880[_0x4a7631];return _0x1a5a6f;};'use strict';var Sequelize=require(_0x0a88('0x0'));var moment=require(_0x0a88('0x1'));var path=require(_0x0a88('0x2'));var config=require(_0x0a88('0x3'));module[_0x0a88('0x4')]={'format':{'type':Sequelize[_0x0a88('0x5')],'get':function(){return this[_0x0a88('0x6')](_0x0a88('0x7'))?path[_0x0a88('0x8')](this[_0x0a88('0x6')](_0x0a88('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0a88('0x9')]},'value':{'type':Sequelize[_0x0a88('0x9')],'set':function(_0x3a576d){var _0x3f9463=_0x3a576d['replace'](/\\/g,'/');this[_0x0a88('0xa')](_0x0a88('0x7'),_0x3f9463);}},'rating':{'type':Sequelize[_0x0a88('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x512810){this['setDataValue'](_0x0a88('0xc'),moment()[_0x0a88('0xd')](_0x512810,'ms'));this[_0x0a88('0xa')](_0x0a88('0xe'),moment());this[_0x0a88('0xa')](_0x0a88('0xf'),_0x512810);}},'startedAt':{'type':Sequelize[_0x0a88('0x10')],'get':function(){return moment(this[_0x0a88('0x6')](_0x0a88('0xc')))[_0x0a88('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x0a88('0x12')]();}},'closedAt':{'type':Sequelize[_0x0a88('0x10')],'get':function(){return moment(this[_0x0a88('0x6')](_0x0a88('0xe')))['format'](_0x0a88('0x13'))[_0x0a88('0x12')]();}},'createdAt':{'type':Sequelize[_0x0a88('0x10')],'get':function(){return moment(this['getDataValue'](_0x0a88('0x14')))[_0x0a88('0x11')](_0x0a88('0x13'))[_0x0a88('0x12')]();}},'updatedAt':{'type':Sequelize[_0x0a88('0x10')],'get':function(){return moment(this['getDataValue'](_0x0a88('0x15')))[_0x0a88('0x11')](_0x0a88('0x13'))['toString']();}}}; \ No newline at end of file +var _0x1a37=['STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname'];(function(_0x32e2f6,_0x199b9c){var _0x5e6cc7=function(_0x2a127b){while(--_0x2a127b){_0x32e2f6['push'](_0x32e2f6['shift']());}};_0x5e6cc7(++_0x199b9c);}(_0x1a37,0xb4));var _0x71a3=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x1a37[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0x71a3('0x0'));var moment=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var config=require(_0x71a3('0x3'));module[_0x71a3('0x4')]={'format':{'type':Sequelize[_0x71a3('0x5')],'get':function(){return this[_0x71a3('0x6')](_0x71a3('0x7'))?path[_0x71a3('0x8')](this[_0x71a3('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x71a3('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x71a3('0x9')],'set':function(_0x45050a){var _0x231ea7=_0x45050a[_0x71a3('0xa')](/\\/g,'/');this['setDataValue']('value',_0x231ea7);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x89da86){this[_0x71a3('0xb')](_0x71a3('0xc'),moment()[_0x71a3('0xd')](_0x89da86,'ms'));this[_0x71a3('0xb')](_0x71a3('0xe'),moment());this[_0x71a3('0xb')](_0x71a3('0xf'),_0x89da86);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}},'closedAt':{'type':Sequelize[_0x71a3('0x13')],'get':function(){return moment(this[_0x71a3('0x6')](_0x71a3('0xe')))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}},'createdAt':{'type':Sequelize[_0x71a3('0x13')],'get':function(){return moment(this[_0x71a3('0x6')]('createdAt'))[_0x71a3('0x10')](_0x71a3('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x71a3('0x6')](_0x71a3('0x14')))[_0x71a3('0x10')](_0x71a3('0x11'))[_0x71a3('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 313a25a..abf00cc 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 _0xa41a=['unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','key','differenceBy','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','params','include','find','catch','create','body','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname'];(function(_0x9cf8a2,_0x5acc81){var _0x530159=function(_0x4c9d31){while(--_0x4c9d31){_0x9cf8a2['push'](_0x9cf8a2['shift']());}};_0x530159(++_0x5acc81);}(_0xa41a,0x6b));var _0xaa41=function(_0x311c93,_0x5d31a8){_0x311c93=_0x311c93-0x0;var _0x504a3b=_0xa41a[_0x311c93];return _0x504a3b;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){_0x43a85c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aec5,_0x527cac){return function(_0x493a10){if(!_0x493a10){_0x16aec5[_0xaa41('0x19')](0x194);}return _0x493a10;};}function handleError(_0x59707f,_0x536bed){_0x536bed=_0x536bed||0x1f4;return function(_0x2d0ac0){logger[_0xaa41('0x26')](_0x2d0ac0[_0xaa41('0x27')]);if(_0x2d0ac0[_0xaa41('0x28')]){delete _0x2d0ac0[_0xaa41('0x28')];}_0x59707f[_0xaa41('0x1a')](_0x536bed)['send'](_0x2d0ac0);};}exports[_0xaa41('0x29')]=function(_0x1f0275,_0x63c18c){var _0x9a16e3={},_0x1d8c2b={},_0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x2a')](db['ScreenRecording'][_0xaa41('0x2b')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x1d8c2b['model']=_[_0xaa41('0x2e')](_[_0xaa41('0x2a')](_0x30f88e,'name'),['format']);_0x1d8c2b['query']=_[_0xaa41('0x2f')](_0x1f0275[_0xaa41('0x30')]);_0x1d8c2b[_0xaa41('0x31')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],_0x1d8c2b[_0xaa41('0x30')]);_0x9a16e3[_0xaa41('0x33')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],qs[_0xaa41('0x34')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x34')]));_0x9a16e3['attributes']=_0x9a16e3[_0xaa41('0x33')][_0xaa41('0x35')]?_0x9a16e3['attributes']:_0x1d8c2b[_0xaa41('0x36')];if(!_0x1f0275[_0xaa41('0x30')][_0xaa41('0x37')]('nolimit')){_0x9a16e3[_0xaa41('0x1e')]=qs['limit'](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x1e')]);_0x9a16e3[_0xaa41('0x20')]=qs['offset'](_0x1f0275['query']['offset']);}_0x9a16e3[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x39')]);_0x9a16e3['where']=qs['filters'](_[_0xaa41('0x3a')](_0x1f0275[_0xaa41('0x30')],_0x1d8c2b[_0xaa41('0x31')]),_0x30f88e);if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]){_0x9a16e3[_0xaa41('0x3c')]=_[_0xaa41('0x3d')](_0x9a16e3['where'],{'$or':_[_0xaa41('0x2a')](_0x30f88e,function(_0x5cf689){if(_0x5cf689[_0xaa41('0x2c')]!==_0xaa41('0x3e')){var _0x57f1bf={};_0x57f1bf[_0x5cf689['name']]={'$like':'%'+_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]+'%'};return _0x57f1bf;}})});}_0x9a16e3=_['merge']({},_0x9a16e3,_0x1f0275[_0xaa41('0x3f')]);var _0x563687={'where':_0x9a16e3[_0xaa41('0x3c')]};return db[_0xaa41('0x40')][_0xaa41('0x1f')](_0x563687)[_0xaa41('0x25')](function(_0x3e6cac){_0x4466a3[_0xaa41('0x1f')]=_0x3e6cac;if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x41')]){_0x9a16e3['include']=[{'all':!![]}];}return db[_0xaa41('0x40')][_0xaa41('0x42')](_0x9a16e3);})[_0xaa41('0x25')](function(_0x398c35){_0x4466a3[_0xaa41('0x43')]=_0x398c35;return _0x4466a3;})[_0xaa41('0x25')](respondWithFilteredResult(_0x63c18c,_0x9a16e3))['catch'](handleError(_0x63c18c,null));};exports['show']=function(_0x87e2f4,_0x4f9086){var _0x1ed366={'raw':![],'where':{'id':_0x87e2f4[_0xaa41('0x44')]['id']}},_0x215896={};_0x215896[_0xaa41('0x36')]=_[_0xaa41('0x2f')](db[_0xaa41('0x40')][_0xaa41('0x2b')]);_0x215896['query']=_[_0xaa41('0x2f')](_0x87e2f4['query']);_0x215896['filters']=_[_0xaa41('0x32')](_0x215896['model'],_0x215896['query']);_0x1ed366['attributes']=_[_0xaa41('0x32')](_0x215896['model'],qs[_0xaa41('0x34')](_0x87e2f4[_0xaa41('0x30')]['fields']));_0x1ed366['attributes']=_0x1ed366[_0xaa41('0x33')][_0xaa41('0x35')]?_0x1ed366[_0xaa41('0x33')]:_0x215896[_0xaa41('0x36')];if(_0x87e2f4[_0xaa41('0x30')][_0xaa41('0x41')]){_0x1ed366[_0xaa41('0x45')]=[{'all':!![]}];}_0x1ed366=_[_0xaa41('0x3d')]({},_0x1ed366,_0x87e2f4[_0xaa41('0x3f')]);return db['ScreenRecording'][_0xaa41('0x46')](_0x1ed366)[_0xaa41('0x25')](handleEntityNotFound(_0x4f9086,null))[_0xaa41('0x25')](respondWithResult(_0x4f9086,null))[_0xaa41('0x47')](handleError(_0x4f9086,null));};exports[_0xaa41('0x48')]=function(_0x1d6112,_0x538b12){return db[_0xaa41('0x40')][_0xaa41('0x48')](_0x1d6112[_0xaa41('0x49')],{})[_0xaa41('0x25')](respondWithResult(_0x538b12,0xc9))['catch'](handleError(_0x538b12,null));};exports[_0xaa41('0x23')]=function(_0x5787f3,_0x49fedd){if(_0x5787f3[_0xaa41('0x49')]['id']){delete _0x5787f3[_0xaa41('0x49')]['id'];}delete _0x5787f3[_0xaa41('0x49')]['duration'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4a')];delete _0x5787f3[_0xaa41('0x49')]['closedAt'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4b')];return db[_0xaa41('0x40')][_0xaa41('0x46')]({'where':{'id':_0x5787f3[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x49fedd,null))[_0xaa41('0x25')](saveUpdates(_0x5787f3[_0xaa41('0x49')],null))['then'](respondWithResult(_0x49fedd,null))[_0xaa41('0x47')](handleError(_0x49fedd,null));};exports['describe']=function(_0x5ae65e,_0x1bdcd6){return db[_0xaa41('0x40')][_0xaa41('0x4c')]()[_0xaa41('0x25')](respondWithResult(_0x1bdcd6,null))[_0xaa41('0x47')](handleError(_0x1bdcd6,null));};exports[_0xaa41('0x4d')]=function(_0x48c4c7,_0x3c5082,_0x519e39){var _0xecb54=require(_0xaa41('0x4e'));var _0x1d518f=![];var _0x4f9e92={};if(_0x48c4c7[_0xaa41('0x30')][_0xaa41('0x2c')]&&_0x48c4c7['query'][_0xaa41('0x2c')]===_0xaa41('0x4f')){_0x4f9e92[_0xaa41('0x4f')]=_0x48c4c7['params']['id'];}else{_0x4f9e92['id']=_0x48c4c7[_0xaa41('0x44')]['id'];}return db[_0xaa41('0x40')]['find']({'where':_0x4f9e92,'attributes':['id','value'],'raw':!![]})[_0xaa41('0x25')](handleEntityNotFound(_0x3c5082,null))[_0xaa41('0x25')](function(_0x3a29d2){if(_0x3a29d2){var _0x4d20c6=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x3a29d2[_0xaa41('0x4b')]);var _0x2abb78=util['format'](_0xaa41('0x53'),_0x4d20c6);if(fs['existsSync'](_0x2abb78)){_0x1d518f=!![];return _0xecb54['decryptFile'](_0x2abb78,_0x4d20c6,config[_0xaa41('0x54')]['recording'])[_0xaa41('0x25')](function(){return _0x3a29d2;});}return _0x3a29d2;}})[_0xaa41('0x25')](function(_0x169ddf){if(_0x169ddf){var _0x5e83e1=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x169ddf[_0xaa41('0x4b')]);if(!fs[_0xaa41('0x55')](_0x5e83e1)){throw new db[(_0xaa41('0x56'))][(_0xaa41('0x57'))](_0xaa41('0x58'));}if(_0x169ddf[_0xaa41('0x59')]){return _0x3c5082['download'](_0x5e83e1,_0x169ddf[_0xaa41('0x59')]+path[_0xaa41('0x5a')](_0x5e83e1),function(){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}else{return _0x3c5082['download'](_0x5e83e1,function(_0x3fe47a){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}}})[_0xaa41('0x47')](function(_0x134579){if(_0x134579[_0xaa41('0x5c')]===_0xaa41('0x58')){_0x3c5082[_0xaa41('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c5082,null);}});};exports['destroy']=function(_0x540325,_0x4ec357){return db['ScreenRecording'][_0xaa41('0x46')]({'where':{'id':_0x540325['params']['id']}})['then'](function(_0x24c6f3){if(_[_0xaa41('0x5d')](_0x24c6f3)){throw new ReferenceError(_0xaa41('0x5e'));}return _0x24c6f3;})[_0xaa41('0x25')](function(_0x5cabc4){var _0x244d41=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x5cabc4[_0xaa41('0x4b')]);logger[_0xaa41('0x5f')](_0xaa41('0x60'),_0x244d41);if(!_[_0xaa41('0x5d')](_0x5cabc4[_0xaa41('0x4b')])&&fs['existsSync'](_0x244d41)){logger[_0xaa41('0x5f')](_0xaa41('0x61')+_0x244d41+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x244d41);}_0x244d41=_0x244d41+'.cypher';if(!_[_0xaa41('0x5d')](_0x5cabc4['value'])&&fs[_0xaa41('0x55')](_0x244d41)){logger['info'](_0xaa41('0x61')+_0x244d41+_0xaa41('0x62'));fs['unlinkSync'](_0x244d41);}return _0x5cabc4;})[_0xaa41('0x25')](function(_0x33efc5){if(!_0x33efc5)throw new InternalError();return _0x33efc5[_0xaa41('0x24')]();})[_0xaa41('0x25')](function(){_0x4ec357['status'](0xcc)['end']();})[_0xaa41('0x47')](handleError(_0x4ec357,null));}; \ No newline at end of file +var _0x8ef6=['keys','find','create','update','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','ValidationError','ScreenRecording\x20not\x20found','filename','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params'];(function(_0x5235a8,_0x2e32bb){var _0x57ab6f=function(_0x454c47){while(--_0x454c47){_0x5235a8['push'](_0x5235a8['shift']());}};_0x57ab6f(++_0x2e32bb);}(_0x8ef6,0xf2));var _0x68ef=function(_0x51424d,_0x1a40ae){_0x51424d=_0x51424d-0x0;var _0x57b799=_0x8ef6[_0x51424d];return _0x57b799;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x13280b,_0x5e4dbe){return function(_0x178460){if(!_0x178460){_0x13280b['sendStatus'](0x194);}return _0x178460;};}function handleError(_0x599243,_0x55d8b0){_0x55d8b0=_0x55d8b0||0x1f4;return function(_0x1a7ce1){logger[_0x68ef('0x29')](_0x1a7ce1[_0x68ef('0x2a')]);if(_0x1a7ce1[_0x68ef('0x2b')]){delete _0x1a7ce1['name'];}_0x599243['status'](_0x55d8b0)[_0x68ef('0x2c')](_0x1a7ce1);};}exports[_0x68ef('0x2d')]=function(_0x7bf96,_0x263b30){var _0x22ef25={},_0x201884={},_0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x2e')][_0x68ef('0x2f')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x30')]['key']};});_0x201884[_0x68ef('0x31')]=_[_0x68ef('0x32')](_['map'](_0x4579cb,'name'),[_0x68ef('0x33')]);_0x201884[_0x68ef('0x34')]=_['keys'](_0x7bf96[_0x68ef('0x34')]);_0x201884[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x201884[_0x68ef('0x31')],_0x201884['query']);_0x22ef25[_0x68ef('0x37')]=_[_0x68ef('0x36')](_0x201884['model'],qs[_0x68ef('0x38')](_0x7bf96['query'][_0x68ef('0x38')]));_0x22ef25[_0x68ef('0x37')]=_0x22ef25['attributes'][_0x68ef('0x39')]?_0x22ef25['attributes']:_0x201884[_0x68ef('0x31')];if(!_0x7bf96['query'][_0x68ef('0x3a')](_0x68ef('0x3b'))){_0x22ef25[_0x68ef('0x21')]=qs['limit'](_0x7bf96[_0x68ef('0x34')]['limit']);_0x22ef25[_0x68ef('0x1f')]=qs['offset'](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x1f')]);}_0x22ef25[_0x68ef('0x3c')]=qs[_0x68ef('0x3d')](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3d')]);_0x22ef25['where']=qs[_0x68ef('0x35')](_[_0x68ef('0x3e')](_0x7bf96[_0x68ef('0x34')],_0x201884['filters']),_0x4579cb);if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3f')]){_0x22ef25[_0x68ef('0x40')]=_['merge'](_0x22ef25['where'],{'$or':_[_0x68ef('0x41')](_0x4579cb,function(_0xec7de3){if(_0xec7de3[_0x68ef('0x30')]!==_0x68ef('0x42')){var _0x401459={};_0x401459[_0xec7de3[_0x68ef('0x2b')]]={'$like':'%'+_0x7bf96[_0x68ef('0x34')]['filter']+'%'};return _0x401459;}})});}_0x22ef25=_[_0x68ef('0x43')]({},_0x22ef25,_0x7bf96[_0x68ef('0x44')]);var _0x2f6ee0={'where':_0x22ef25[_0x68ef('0x40')]};return db['ScreenRecording'][_0x68ef('0x45')](_0x2f6ee0)[_0x68ef('0x27')](function(_0xcf595d){_0x26288a[_0x68ef('0x45')]=_0xcf595d;if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x46')]){_0x22ef25['include']=[{'all':!![]}];}return db[_0x68ef('0x2e')][_0x68ef('0x47')](_0x22ef25);})[_0x68ef('0x27')](function(_0x43796b){_0x26288a[_0x68ef('0x48')]=_0x43796b;return _0x26288a;})[_0x68ef('0x27')](respondWithFilteredResult(_0x263b30,_0x22ef25))[_0x68ef('0x49')](handleError(_0x263b30,null));};exports[_0x68ef('0x4a')]=function(_0xc687ab,_0x531096){var _0xad1a28={'raw':![],'where':{'id':_0xc687ab[_0x68ef('0x4b')]['id']}},_0x19d7a1={};_0x19d7a1[_0x68ef('0x31')]=_[_0x68ef('0x4c')](db[_0x68ef('0x2e')][_0x68ef('0x2f')]);_0x19d7a1['query']=_[_0x68ef('0x4c')](_0xc687ab['query']);_0x19d7a1[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x19d7a1[_0x68ef('0x31')],_0x19d7a1[_0x68ef('0x34')]);_0xad1a28['attributes']=_[_0x68ef('0x36')](_0x19d7a1['model'],qs[_0x68ef('0x38')](_0xc687ab['query'][_0x68ef('0x38')]));_0xad1a28[_0x68ef('0x37')]=_0xad1a28[_0x68ef('0x37')]['length']?_0xad1a28['attributes']:_0x19d7a1[_0x68ef('0x31')];if(_0xc687ab[_0x68ef('0x34')]['includeAll']){_0xad1a28['include']=[{'all':!![]}];}_0xad1a28=_['merge']({},_0xad1a28,_0xc687ab[_0x68ef('0x44')]);return db[_0x68ef('0x2e')][_0x68ef('0x4d')](_0xad1a28)[_0x68ef('0x27')](handleEntityNotFound(_0x531096,null))[_0x68ef('0x27')](respondWithResult(_0x531096,null))['catch'](handleError(_0x531096,null));};exports['create']=function(_0xc39f5b,_0x21f064){return db[_0x68ef('0x2e')][_0x68ef('0x4e')](_0xc39f5b['body'],{})[_0x68ef('0x27')](respondWithResult(_0x21f064,0xc9))[_0x68ef('0x49')](handleError(_0x21f064,null));};exports[_0x68ef('0x4f')]=function(_0x14142a,_0x53880c){if(_0x14142a['body']['id']){delete _0x14142a[_0x68ef('0x50')]['id'];}delete _0x14142a[_0x68ef('0x50')]['duration'];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x51')];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x52')];delete _0x14142a[_0x68ef('0x50')]['value'];return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':{'id':_0x14142a[_0x68ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53880c,null))[_0x68ef('0x27')](saveUpdates(_0x14142a[_0x68ef('0x50')],null))[_0x68ef('0x27')](respondWithResult(_0x53880c,null))['catch'](handleError(_0x53880c,null));};exports[_0x68ef('0x53')]=function(_0x59e8ee,_0x574573){return db[_0x68ef('0x2e')]['describe']()[_0x68ef('0x27')](respondWithResult(_0x574573,null))[_0x68ef('0x49')](handleError(_0x574573,null));};exports[_0x68ef('0x54')]=function(_0x1e651f,_0x2a0be0,_0x45ae42){var _0x363498=require(_0x68ef('0x55'));var _0x2b35f4=![];var _0x247915={};if(_0x1e651f['query']['type']&&_0x1e651f[_0x68ef('0x34')][_0x68ef('0x30')]===_0x68ef('0x56')){_0x247915[_0x68ef('0x56')]=_0x1e651f[_0x68ef('0x4b')]['id'];}else{_0x247915['id']=_0x1e651f[_0x68ef('0x4b')]['id'];}return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':_0x247915,'attributes':['id',_0x68ef('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x2a0be0,null))['then'](function(_0x42a4b2){if(_0x42a4b2){var _0x5781c8=path[_0x68ef('0x58')](config['root'],_0x68ef('0x59'),_0x42a4b2[_0x68ef('0x57')]);var _0x552736=util[_0x68ef('0x33')]('%s.cypher',_0x5781c8);if(fs[_0x68ef('0x5a')](_0x552736)){_0x2b35f4=!![];return _0x363498[_0x68ef('0x5b')](_0x552736,_0x5781c8,config[_0x68ef('0x5c')][_0x68ef('0x5d')])[_0x68ef('0x27')](function(){return _0x42a4b2;});}return _0x42a4b2;}})[_0x68ef('0x27')](function(_0x5c347c){if(_0x5c347c){var _0x1cdaef=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],_0x68ef('0x59'),_0x5c347c[_0x68ef('0x57')]);if(!fs[_0x68ef('0x5a')](_0x1cdaef)){throw new db['Sequelize'][(_0x68ef('0x5f'))](_0x68ef('0x60'));}if(_0x5c347c['filename']){return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,_0x5c347c[_0x68ef('0x61')]+path[_0x68ef('0x62')](_0x1cdaef),function(){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}else{return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,function(_0x49d197){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}}})[_0x68ef('0x49')](function(_0x540da5){if(_0x540da5[_0x68ef('0x63')]==='ScreenRecording\x20not\x20found'){_0x2a0be0[_0x68ef('0x1d')](0x194)[_0x68ef('0x2c')](_0x68ef('0x64'));}else{return handleError(_0x2a0be0,null);}});};exports[_0x68ef('0x28')]=function(_0x19ce17,_0x19a9c4){return db['ScreenRecording'][_0x68ef('0x4d')]({'where':{'id':_0x19ce17['params']['id']}})[_0x68ef('0x27')](function(_0x4b0c3e){if(_[_0x68ef('0x65')](_0x4b0c3e)){throw new ReferenceError(_0x68ef('0x66'));}return _0x4b0c3e;})[_0x68ef('0x27')](function(_0xf0a40f){var _0x2f409c=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],'server/files/screen_recordings',_0xf0a40f[_0x68ef('0x57')]);logger[_0x68ef('0x67')](_0x68ef('0x68'),_0x2f409c);if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs['existsSync'](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}_0x2f409c=_0x2f409c+'.cypher';if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs[_0x68ef('0x5a')](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}return _0xf0a40f;})[_0x68ef('0x27')](function(_0x2d916e){if(!_0x2d916e)throw new InternalError();return _0x2d916e[_0x68ef('0x28')]();})['then'](function(){_0x19a9c4['status'](0xcc)[_0x68ef('0x1c')]();})[_0x68ef('0x49')](handleError(_0x19a9c4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 59bb2f9..77b6cb3 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 _0xcb5d=['exports','define','screen_recordings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb5d,0x6b));var _0xdcb5=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xcb5d[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0xdcb5('0x0'));var util=require(_0xdcb5('0x1'));var logger=require(_0xdcb5('0x2'))(_0xdcb5('0x3'));var moment=require(_0xdcb5('0x4'));var BPromise=require('bluebird');var rp=require(_0xdcb5('0x5'));var fs=require('fs');var path=require(_0xdcb5('0x6'));var rimraf=require(_0xdcb5('0x7'));var config=require(_0xdcb5('0x8'));var attributes=require(_0xdcb5('0x9'));module[_0xdcb5('0xa')]=function(_0x21f405,_0x19c030){return _0x21f405[_0xdcb5('0xb')]('ScreenRecording',attributes,{'tableName':_0xdcb5('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x498a=['../../config/environment','./screenRecording.attributes','ScreenRecording','interactionid','lodash','util','../../config/logger','path','rimraf'];(function(_0x34465a,_0x41b269){var _0x2c61b7=function(_0x1b546f){while(--_0x1b546f){_0x34465a['push'](_0x34465a['shift']());}};_0x2c61b7(++_0x41b269);}(_0x498a,0x12d));var _0xa498=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x498a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xa498('0x0'));var util=require(_0xa498('0x1'));var logger=require(_0xa498('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa498('0x3'));var rimraf=require(_0xa498('0x4'));var config=require(_0xa498('0x5'));var attributes=require(_0xa498('0x6'));module['exports']=function(_0x3b82ba,_0x2c2eca){return _0x3b82ba['define'](_0xa498('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xa498('0x8'),'fields':[_0xa498('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a31795b..8f67522 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 _0x1c29=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1c29,0x12c));var _0x91c2=function(_0x19d06d,_0x4fca6d){_0x19d06d=_0x19d06d-0x0;var _0x14c61f=_0x1c29[_0x19d06d];return _0x14c61f;};'use strict';var _=require(_0x91c2('0x0'));var util=require(_0x91c2('0x1'));var moment=require(_0x91c2('0x2'));var BPromise=require(_0x91c2('0x3'));var rs=require(_0x91c2('0x4'));var fs=require('fs');var Redis=require(_0x91c2('0x5'));var db=require(_0x91c2('0x6'))['db'];var utils=require(_0x91c2('0x7'));var logger=require(_0x91c2('0x8'))(_0x91c2('0x9'));var config=require(_0x91c2('0xa'));var jayson=require(_0x91c2('0xb'));var client=jayson[_0x91c2('0xc')][_0x91c2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5e71cd,_0x321434,_0x37ccca){return new BPromise(function(_0x3a46a4,_0x577610){return client[_0x91c2('0xe')](_0x5e71cd,_0x37ccca)['then'](function(_0x2d81a2){logger[_0x91c2('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x321434,_0x91c2('0x10'));logger[_0x91c2('0x11')](_0x91c2('0x12'),_0x321434,'request\x20sent',JSON['stringify'](_0x2d81a2));if(_0x2d81a2[_0x91c2('0x13')]){if(_0x2d81a2[_0x91c2('0x13')][_0x91c2('0x14')]===0x1f4){logger[_0x91c2('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x321434,_0x2d81a2[_0x91c2('0x13')]['message']);return _0x577610(_0x2d81a2[_0x91c2('0x13')][_0x91c2('0x15')]);}logger[_0x91c2('0x13')](_0x91c2('0x16'),_0x321434,_0x2d81a2[_0x91c2('0x13')][_0x91c2('0x15')]);return _0x3a46a4(_0x2d81a2['error'][_0x91c2('0x15')]);}else{logger['info'](_0x91c2('0x16'),_0x321434,_0x91c2('0x10'));_0x3a46a4(_0x2d81a2[_0x91c2('0x17')]['message']);}})[_0x91c2('0x18')](function(_0x5b3cc5){logger['error'](_0x91c2('0x16'),_0x321434,_0x5b3cc5);_0x577610(_0x5b3cc5);});});} \ No newline at end of file +var _0x1e03=['ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1e03,0x11f));var _0x31e0=function(_0x1329d0,_0x594df5){_0x1329d0=_0x1329d0-0x0;var _0x9c1fc1=_0x1e03[_0x1329d0];return _0x9c1fc1;};'use strict';var _=require(_0x31e0('0x0'));var util=require(_0x31e0('0x1'));var moment=require('moment');var BPromise=require(_0x31e0('0x2'));var rs=require(_0x31e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x31e0('0x4'));var logger=require(_0x31e0('0x5'))(_0x31e0('0x6'));var config=require(_0x31e0('0x7'));var jayson=require(_0x31e0('0x8'));var client=jayson['client'][_0x31e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23d708,_0x5848a9,_0x5f11b5){return new BPromise(function(_0x4af57e,_0x25703d){return client[_0x31e0('0xa')](_0x23d708,_0x5f11b5)[_0x31e0('0xb')](function(_0x1827b8){logger[_0x31e0('0xc')](_0x31e0('0xd'),_0x5848a9,'request\x20sent');logger[_0x31e0('0xe')](_0x31e0('0xf'),_0x5848a9,_0x31e0('0x10'),JSON[_0x31e0('0x11')](_0x1827b8));if(_0x1827b8[_0x31e0('0x12')]){if(_0x1827b8['error']['code']===0x1f4){logger[_0x31e0('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x5848a9,_0x1827b8[_0x31e0('0x12')][_0x31e0('0x13')]);return _0x25703d(_0x1827b8[_0x31e0('0x12')][_0x31e0('0x13')]);}logger[_0x31e0('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x5848a9,_0x1827b8[_0x31e0('0x12')][_0x31e0('0x13')]);return _0x4af57e(_0x1827b8[_0x31e0('0x12')][_0x31e0('0x13')]);}else{logger[_0x31e0('0xc')](_0x31e0('0xd'),_0x5848a9,'request\x20sent');_0x4af57e(_0x1827b8['result'][_0x31e0('0x13')]);}})['catch'](function(_0x473349){logger[_0x31e0('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x5848a9,_0x473349);_0x25703d(_0x473349);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9dc5bdf..0e2a41f 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 _0xe762=['/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','root','server/files/images/logos/','%s%s','logo','extname','post','single','diskStorage','join','logologin','file','addLogoLogin','preferred','format','favicon','originalname','/:id/favicon','addFavicon','put','/:id','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/now','getDate','show'];(function(_0x395fd3,_0x316a22){var _0x51d314=function(_0x53dbb9){while(--_0x53dbb9){_0x395fd3['push'](_0x395fd3['shift']());}};_0x51d314(++_0x316a22);}(_0xe762,0x94));var _0x2e76=function(_0x2c0a71,_0x1fec93){_0x2c0a71=_0x2c0a71-0x0;var _0x128200=_0xe762[_0x2c0a71];return _0x128200;};'use strict';var multer=require(_0x2e76('0x0'));var util=require('util');var path=require(_0x2e76('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e76('0x2')]();var fs_extra=require(_0x2e76('0x3'));var auth=require(_0x2e76('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2e76('0x5'));var controller=require('./setting.controller');router['get']('/',auth[_0x2e76('0x6')](),controller[_0x2e76('0x7')]);router[_0x2e76('0x8')](_0x2e76('0x9'),controller[_0x2e76('0xa')]);router[_0x2e76('0x8')]('/:id',controller[_0x2e76('0xb')]);router[_0x2e76('0x8')](_0x2e76('0xc'),controller[_0x2e76('0xd')]);router[_0x2e76('0x8')](_0x2e76('0xe'),controller['getLogoLogin']);router['get'](_0x2e76('0xf'),controller[_0x2e76('0x10')]);router[_0x2e76('0x8')](_0x2e76('0x11'),controller[_0x2e76('0x12')]);router[_0x2e76('0x8')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x562f20,_0x4ed0ac,_0x39cb5e){_0x39cb5e(null,path['join'](config[_0x2e76('0x13')],_0x2e76('0x14')));},'filename':function(_0x20e105,_0x1f000b,_0x4becf6){_0x4becf6(null,util['format'](_0x2e76('0x15'),_0x2e76('0x16'),path[_0x2e76('0x17')](_0x1f000b['originalname'])));}})});router[_0x2e76('0x18')](_0x2e76('0xc'),upload[_0x2e76('0x19')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x2e76('0x1a')]({'destination':function(_0x20c817,_0x56d438,_0x14f575){_0x14f575(null,path[_0x2e76('0x1b')](config[_0x2e76('0x13')],_0x2e76('0x14')));},'filename':function(_0x522000,_0x55b26a,_0x13b6b0){_0x13b6b0(null,util['format'](_0x2e76('0x15'),_0x2e76('0x1c'),path[_0x2e76('0x17')](_0x55b26a['originalname'])));}})});router[_0x2e76('0x18')](_0x2e76('0xe'),upload[_0x2e76('0x19')](_0x2e76('0x1d')),controller[_0x2e76('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3487ad,_0x59ecff,_0x1096ee){_0x1096ee(null,path[_0x2e76('0x1b')](config[_0x2e76('0x13')],'server/files/images/logos/'));},'filename':function(_0xd17ea2,_0xedc272,_0x3eef70){_0x3eef70(null,util['format'](_0x2e76('0x15'),_0x2e76('0x1f'),path[_0x2e76('0x17')](_0xedc272['originalname'])));}})});router[_0x2e76('0x18')]('/:id/preferred',upload[_0x2e76('0x19')](_0x2e76('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer[_0x2e76('0x1a')]({'destination':function(_0x578548,_0x486e5e,_0x8eab8c){_0x8eab8c(null,path['join'](config['root'],_0x2e76('0x14')));},'filename':function(_0xd4eb58,_0x244150,_0x265822){_0x265822(null,util[_0x2e76('0x20')](_0x2e76('0x15'),_0x2e76('0x21'),path[_0x2e76('0x17')](_0x244150[_0x2e76('0x22')])));}})});router['post'](_0x2e76('0x23'),upload[_0x2e76('0x19')](_0x2e76('0x1d')),controller[_0x2e76('0x24')]);router[_0x2e76('0x25')](_0x2e76('0x26'),auth[_0x2e76('0x6')](),controller['update']);module[_0x2e76('0x27')]=router; \ No newline at end of file +var _0xc696=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','getFavicon','join','root','server/files/images/logos/','format','logo','extname','originalname','single','addLogo','diskStorage','%s%s','logologin','file','addLogoLogin','post','addPreferred','favicon','/:id/favicon','addFavicon','update','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xc696,0x134));var _0x6c69=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xc696[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x6c69('0x0'));var util=require(_0x6c69('0x1'));var path=require('path');var timeout=require(_0x6c69('0x2'));var express=require('express');var router=express[_0x6c69('0x3')]();var fs_extra=require(_0x6c69('0x4'));var auth=require(_0x6c69('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c69('0x6'));var controller=require(_0x6c69('0x7'));router[_0x6c69('0x8')]('/',auth[_0x6c69('0x9')](),controller[_0x6c69('0xa')]);router[_0x6c69('0x8')](_0x6c69('0xb'),controller[_0x6c69('0xc')]);router[_0x6c69('0x8')](_0x6c69('0xd'),controller[_0x6c69('0xe')]);router[_0x6c69('0x8')](_0x6c69('0xf'),controller[_0x6c69('0x10')]);router['get'](_0x6c69('0x11'),controller[_0x6c69('0x12')]);router[_0x6c69('0x8')]('/:id/gdpr',controller[_0x6c69('0x13')]);router[_0x6c69('0x8')](_0x6c69('0x14'),controller[_0x6c69('0x15')]);router[_0x6c69('0x8')]('/:id/favicon',controller[_0x6c69('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57c697,_0x7a15b0,_0x1b0594){_0x1b0594(null,path[_0x6c69('0x17')](config[_0x6c69('0x18')],_0x6c69('0x19')));},'filename':function(_0x1fc096,_0x522440,_0x33adfe){_0x33adfe(null,util[_0x6c69('0x1a')]('%s%s',_0x6c69('0x1b'),path[_0x6c69('0x1c')](_0x522440[_0x6c69('0x1d')])));}})});router['post'](_0x6c69('0xf'),upload[_0x6c69('0x1e')]('file'),controller[_0x6c69('0x1f')]);var upload=multer({'storage':multer[_0x6c69('0x20')]({'destination':function(_0x3811cf,_0xd62dd5,_0x237f46){_0x237f46(null,path[_0x6c69('0x17')](config['root'],_0x6c69('0x19')));},'filename':function(_0x9c8038,_0x4e3610,_0x5cf909){_0x5cf909(null,util['format'](_0x6c69('0x21'),_0x6c69('0x22'),path[_0x6c69('0x1c')](_0x4e3610['originalname'])));}})});router['post']('/:id/logo_login',upload[_0x6c69('0x1e')](_0x6c69('0x23')),controller[_0x6c69('0x24')]);var upload=multer({'storage':multer[_0x6c69('0x20')]({'destination':function(_0x282dba,_0x27eaa3,_0x59faa8){_0x59faa8(null,path[_0x6c69('0x17')](config[_0x6c69('0x18')],_0x6c69('0x19')));},'filename':function(_0x25c6fe,_0x200fed,_0x20bce6){_0x20bce6(null,util['format'](_0x6c69('0x21'),'preferred',path[_0x6c69('0x1c')](_0x200fed['originalname'])));}})});router[_0x6c69('0x25')](_0x6c69('0x14'),upload[_0x6c69('0x1e')]('file'),controller[_0x6c69('0x26')]);var upload=multer({'storage':multer[_0x6c69('0x20')]({'destination':function(_0x4fbeb0,_0x40d07a,_0x305597){_0x305597(null,path[_0x6c69('0x17')](config[_0x6c69('0x18')],_0x6c69('0x19')));},'filename':function(_0x2a592d,_0x34701e,_0x312257){_0x312257(null,util[_0x6c69('0x1a')](_0x6c69('0x21'),_0x6c69('0x27'),path[_0x6c69('0x1c')](_0x34701e['originalname'])));}})});router['post'](_0x6c69('0x28'),upload[_0x6c69('0x1e')](_0x6c69('0x23')),controller[_0x6c69('0x29')]);router['put'](_0x6c69('0xd'),auth[_0x6c69('0x9')](),controller[_0x6c69('0x2a')]);module[_0x6c69('0x2b')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 968173b..2ea40e4 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xd86635,_0x3749b1){var _0x37747b=function(_0x53b6a5){while(--_0x53b6a5){_0xd86635['push'](_0xd86635['shift']());}};_0x37747b(++_0x3749b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1eb286,_0x12ed64){var _0x2444e5=function(_0x5ce55f){while(--_0x5ce55f){_0x1eb286['push'](_0x1eb286['shift']());}};_0x2444e5(++_0x12ed64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c5b3383..4303a10 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 _0x3d10=['default_preferred.png','ValidationError','default_favicon.ico','getDate','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','Setting','findAll','rows','show','find','update','body','params','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','defaultLoginLogo','defaultFavicon','default_loginLogo.svg','gdpr','addPreferred','preferred','getPreferred'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x3d10,0x7b));var _0x03d1=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x3d10[_0x483102];return _0x5cc885;};'use strict';var emlformat=require(_0x03d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03d1('0x2'));var moment=require(_0x03d1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x03d1('0x4'));var path=require(_0x03d1('0x5'));var sox=require(_0x03d1('0x6'));var csv=require(_0x03d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03d1('0x8'));var _=require(_0x03d1('0x9'));var squel=require(_0x03d1('0xa'));var crypto=require('crypto');var jsforce=require(_0x03d1('0xb'));var deskjs=require(_0x03d1('0xc'));var toCsv=require(_0x03d1('0x7'));var querystring=require(_0x03d1('0xd'));var Papa=require(_0x03d1('0xe'));var Redis=require(_0x03d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03d1('0x10'));var as=require(_0x03d1('0x11'));var hardwareService=require(_0x03d1('0x12'));var logger=require(_0x03d1('0x13'))(_0x03d1('0x14'));var utils=require(_0x03d1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x03d1('0x16'));var db=require(_0x03d1('0x17'))['db'];var jayson=require(_0x03d1('0x18'));var client=jayson[_0x03d1('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250992,_0x3c76ba,_0x537fb2,_0x417245){return new BPromise(function(_0x3ac4ec,_0x2c3604){var _0x42116d=_0x417245||client;return _0x42116d[_0x03d1('0x1a')](_0x250992,_0x537fb2)[_0x03d1('0x1b')](function(_0x2d6983){logger[_0x03d1('0x1c')](_0x03d1('0x1d'),_0x3c76ba,_0x03d1('0x1e'));logger[_0x03d1('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x3c76ba,_0x03d1('0x1e'),JSON['stringify'](_0x2d6983));if(_0x2d6983[_0x03d1('0x20')]){if(_0x2d6983[_0x03d1('0x20')]['code']===0x1f4){logger[_0x03d1('0x20')](_0x03d1('0x1d'),_0x3c76ba,_0x2d6983['error']['message']);return _0x2c3604(_0x2d6983[_0x03d1('0x20')][_0x03d1('0x21')]);}logger[_0x03d1('0x20')](_0x03d1('0x1d'),_0x3c76ba,_0x2d6983['error'][_0x03d1('0x21')]);return _0x3ac4ec(_0x2d6983[_0x03d1('0x20')][_0x03d1('0x21')]);}else{logger[_0x03d1('0x1c')](_0x03d1('0x1d'),_0x3c76ba,_0x03d1('0x1e'));_0x3ac4ec(_0x2d6983['result'][_0x03d1('0x21')]);}})[_0x03d1('0x22')](function(_0x2d6a97){logger[_0x03d1('0x20')](_0x03d1('0x1d'),_0x3c76ba,_0x2d6a97);_0x2c3604(_0x2d6a97);});});}function respondWithStatusCode(_0x80030a,_0x221bf8){_0x221bf8=_0x221bf8||0xcc;return function(_0x2aaabb){if(_0x2aaabb){return _0x80030a[_0x03d1('0x23')](_0x221bf8);}return _0x80030a[_0x03d1('0x24')](_0x221bf8)[_0x03d1('0x25')]();};}function respondWithResult(_0x120a5b,_0x1b6ff4){_0x1b6ff4=_0x1b6ff4||0xc8;return function(_0x541ad1){if(_0x541ad1){return _0x120a5b[_0x03d1('0x24')](_0x1b6ff4)[_0x03d1('0x26')](_0x541ad1);}};}function respondWithFilteredResult(_0x42f56d,_0x48ad17){return function(_0x11f56e){if(_0x11f56e){var _0x29a36d=typeof _0x48ad17[_0x03d1('0x27')]==='undefined'&&typeof _0x48ad17['limit']===_0x03d1('0x28');var _0x433e96=_0x11f56e['count'];var _0xe5fce4=_0x29a36d?0x0:_0x48ad17[_0x03d1('0x27')];var _0x50292d=_0x29a36d?_0x11f56e[_0x03d1('0x29')]:_0x48ad17[_0x03d1('0x27')]+_0x48ad17[_0x03d1('0x2a')];var _0x208679;if(_0x50292d>=_0x433e96){_0x50292d=_0x433e96;_0x208679=0xc8;}else{_0x208679=0xce;}_0x42f56d['status'](_0x208679);return _0x42f56d['set']('Content-Range',_0xe5fce4+'-'+_0x50292d+'/'+_0x433e96)[_0x03d1('0x26')](_0x11f56e);}return null;};}function patchUpdates(_0x237fa3){return function(_0x517eb8){try{jsonpatch[_0x03d1('0x2b')](_0x517eb8,_0x237fa3,!![]);}catch(_0xbddd0e){return BPromise[_0x03d1('0x2c')](_0xbddd0e);}return _0x517eb8[_0x03d1('0x2d')]();};}function saveUpdates(_0xb29799,_0x59a204){return function(_0x182cf8){if(_0x182cf8){return _0x182cf8['update'](_0xb29799)[_0x03d1('0x1b')](function(_0x3fc593){return _0x3fc593;});}return null;};}function removeEntity(_0x2a0882,_0x46e6d4){return function(_0xa024dd){if(_0xa024dd){return _0xa024dd['destroy']()[_0x03d1('0x1b')](function(){_0x2a0882['status'](0xcc)[_0x03d1('0x25')]();});}};}function handleEntityNotFound(_0x3e8229,_0x1eac00){return function(_0x30c206){if(!_0x30c206){_0x3e8229[_0x03d1('0x23')](0x194);}return _0x30c206;};}function handleError(_0x27258a,_0x13380f){_0x13380f=_0x13380f||0x1f4;return function(_0x48446e){logger[_0x03d1('0x20')](_0x48446e[_0x03d1('0x2e')]);if(_0x48446e[_0x03d1('0x2f')]){delete _0x48446e['name'];}_0x27258a['status'](_0x13380f)['send'](_0x48446e);};}exports[_0x03d1('0x30')]=function(_0x17ccaa,_0x30cf5c){var _0x3930f8={},_0x34fb34={},_0x1a21c8={'count':0x0,'rows':[]};var _0x5f28c8=_[_0x03d1('0x31')](db['Setting'][_0x03d1('0x32')],function(_0x28bb1c){return{'name':_0x28bb1c[_0x03d1('0x33')],'type':_0x28bb1c[_0x03d1('0x34')][_0x03d1('0x35')]};});_0x34fb34[_0x03d1('0x36')]=_['map'](_0x5f28c8,_0x03d1('0x2f'));_0x34fb34[_0x03d1('0x37')]=_[_0x03d1('0x38')](_0x17ccaa['query']);_0x34fb34[_0x03d1('0x39')]=_[_0x03d1('0x3a')](_0x34fb34[_0x03d1('0x36')],_0x34fb34[_0x03d1('0x37')]);_0x3930f8['attributes']=_[_0x03d1('0x3a')](_0x34fb34[_0x03d1('0x36')],qs[_0x03d1('0x3b')](_0x17ccaa['query'][_0x03d1('0x3b')]));_0x3930f8[_0x03d1('0x3c')]=_0x3930f8[_0x03d1('0x3c')]['length']?_0x3930f8['attributes']:_0x34fb34['model'];if(!_0x17ccaa[_0x03d1('0x37')][_0x03d1('0x3d')](_0x03d1('0x3e'))){_0x3930f8[_0x03d1('0x2a')]=qs['limit'](_0x17ccaa[_0x03d1('0x37')][_0x03d1('0x2a')]);_0x3930f8[_0x03d1('0x27')]=qs[_0x03d1('0x27')](_0x17ccaa[_0x03d1('0x37')][_0x03d1('0x27')]);}_0x3930f8[_0x03d1('0x3f')]=qs[_0x03d1('0x40')](_0x17ccaa['query'][_0x03d1('0x40')]);_0x3930f8[_0x03d1('0x41')]=qs[_0x03d1('0x39')](_[_0x03d1('0x42')](_0x17ccaa[_0x03d1('0x37')],_0x34fb34[_0x03d1('0x39')]),_0x5f28c8);if(_0x17ccaa[_0x03d1('0x37')][_0x03d1('0x43')]){_0x3930f8[_0x03d1('0x41')]=_[_0x03d1('0x44')](_0x3930f8[_0x03d1('0x41')],{'$or':_['map'](_0x5f28c8,function(_0x167097){if(_0x167097['type']!=='VIRTUAL'){var _0xfe3b58={};_0xfe3b58[_0x167097['name']]={'$like':'%'+_0x17ccaa['query'][_0x03d1('0x43')]+'%'};return _0xfe3b58;}})});}_0x3930f8=_[_0x03d1('0x44')]({},_0x3930f8,_0x17ccaa[_0x03d1('0x45')]);var _0x8f5efd={'where':_0x3930f8['where']};return db['Setting'][_0x03d1('0x29')](_0x8f5efd)['then'](function(_0x1f17f0){_0x1a21c8[_0x03d1('0x29')]=_0x1f17f0;if(_0x17ccaa[_0x03d1('0x37')][_0x03d1('0x46')]){_0x3930f8[_0x03d1('0x47')]=[{'all':!![]}];}return db[_0x03d1('0x48')][_0x03d1('0x49')](_0x3930f8);})['then'](function(_0x4e6e3d){_0x1a21c8[_0x03d1('0x4a')]=_0x4e6e3d;return _0x1a21c8;})['then'](respondWithFilteredResult(_0x30cf5c,_0x3930f8))['catch'](handleError(_0x30cf5c,null));};exports[_0x03d1('0x4b')]=function(_0x2d0c66,_0xd4760d){var _0x34b2e4={'raw':![],'where':{'id':_0x2d0c66['params']['id']}},_0x387848={};_0x387848[_0x03d1('0x36')]=_['keys'](db['Setting'][_0x03d1('0x32')]);_0x387848[_0x03d1('0x37')]=_['keys'](_0x2d0c66['query']);_0x387848[_0x03d1('0x39')]=_[_0x03d1('0x3a')](_0x387848[_0x03d1('0x36')],_0x387848[_0x03d1('0x37')]);_0x34b2e4[_0x03d1('0x3c')]=_[_0x03d1('0x3a')](_0x387848[_0x03d1('0x36')],qs[_0x03d1('0x3b')](_0x2d0c66[_0x03d1('0x37')][_0x03d1('0x3b')]));_0x34b2e4[_0x03d1('0x3c')]=_0x34b2e4[_0x03d1('0x3c')]['length']?_0x34b2e4[_0x03d1('0x3c')]:_0x387848[_0x03d1('0x36')];if(_0x2d0c66[_0x03d1('0x37')]['includeAll']){_0x34b2e4[_0x03d1('0x47')]=[{'all':!![]}];}_0x34b2e4=_[_0x03d1('0x44')]({},_0x34b2e4,_0x2d0c66[_0x03d1('0x45')]);return db[_0x03d1('0x48')][_0x03d1('0x4c')](_0x34b2e4)['then'](handleEntityNotFound(_0xd4760d,null))['then'](respondWithResult(_0xd4760d,null))[_0x03d1('0x22')](handleError(_0xd4760d,null));};exports[_0x03d1('0x4d')]=function(_0xca5df6,_0x263787){if(_0xca5df6[_0x03d1('0x4e')]['id']){delete _0xca5df6[_0x03d1('0x4e')]['id'];}return db[_0x03d1('0x48')][_0x03d1('0x4c')]({'where':{'id':_0xca5df6[_0x03d1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x263787,null))[_0x03d1('0x1b')](saveUpdates(_0xca5df6[_0x03d1('0x4e')],null))[_0x03d1('0x1b')](respondWithResult(_0x263787,null))['catch'](handleError(_0x263787,null));};exports['addLogo']=function(_0x3a43a5,_0x1025bb,_0x115096){if(_0x3a43a5[_0x03d1('0x50')]&&_0x3a43a5[_0x03d1('0x50')][_0x03d1('0x51')]){_0x3a43a5['body'][_0x03d1('0x52')]=_0x3a43a5[_0x03d1('0x50')][_0x03d1('0x51')];}return db[_0x03d1('0x48')]['find']({'where':{'id':_0x3a43a5[_0x03d1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1025bb,null))[_0x03d1('0x1b')](saveUpdates(_0x3a43a5[_0x03d1('0x4e')],null))[_0x03d1('0x1b')](respondWithResult(_0x1025bb,null))[_0x03d1('0x22')](handleError(_0x1025bb,null));};exports[_0x03d1('0x53')]=function(_0x3e40a8,_0x31924e,_0x3f9e13){if(_0x3e40a8[_0x03d1('0x50')]&&_0x3e40a8[_0x03d1('0x50')][_0x03d1('0x51')]){_0x3e40a8[_0x03d1('0x4e')][_0x03d1('0x54')]=_0x3e40a8['file'][_0x03d1('0x51')];}return db[_0x03d1('0x48')][_0x03d1('0x4c')]({'where':{'id':_0x3e40a8[_0x03d1('0x4f')]['id']}})[_0x03d1('0x1b')](handleEntityNotFound(_0x31924e,null))[_0x03d1('0x1b')](saveUpdates(_0x3e40a8[_0x03d1('0x4e')],null))[_0x03d1('0x1b')](respondWithResult(_0x31924e,null))[_0x03d1('0x22')](handleError(_0x31924e,null));};var utilLicense=require(_0x03d1('0x16'));exports[_0x03d1('0x55')]=function(_0x39628d,_0x298c3b,_0x44cd43){var _0x393297=_0x03d1('0x56');var _0x4a5ead={'custom':![]};return utilLicense[_0x03d1('0x57')]()[_0x03d1('0x1b')](function(_0xf01386){if(_0xf01386){_0x4a5ead=_0xf01386;}return db[_0x03d1('0x48')][_0x03d1('0x4c')]({'where':{'id':_0x39628d[_0x03d1('0x4f')]['id']},'attributes':['logo',_0x03d1('0x54'),'preferred',_0x03d1('0x58'),_0x03d1('0x59'),'defaultLoginLogo',_0x03d1('0x5a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x298c3b,null))['then'](function(_0x19b7ea){if(_0x19b7ea){var _0xb1e969=_0x19b7ea['logo']&&fs[_0x03d1('0x5b')](path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x393297,_[_0x03d1('0x5e')](_0x19b7ea[_0x03d1('0x52')])))?path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x393297,_[_0x03d1('0x5e')](_0x19b7ea['logo'])):path[_0x03d1('0x5c')](config['root'],_0x393297,_[_0x03d1('0x5e')](_0x03d1('0x5f')));var _0x5ee65f=_0x03d1('0x60')+_[_0x03d1('0x61')](_0x03d1('0x52'));if(_0x19b7ea[_0x5ee65f]||!_0x4a5ead[_0x03d1('0x62')]){_0xb1e969=path['join'](config['root'],_0x393297,_['toLower'](_0x03d1('0x5f')));}if(!fs[_0x03d1('0x5b')](_0xb1e969)){throw new db[(_0x03d1('0x63'))]['ValidationError'](_[_0x03d1('0x61')](_0x03d1('0x52'))+_0x03d1('0x64'));}return _0x298c3b[_0x03d1('0x65')](_0xb1e969);}})['catch'](handleError(_0x298c3b,null));};var utilLicense=require(_0x03d1('0x16'));exports['getLogoLogin']=function(_0x224c3b,_0x474fe9,_0x4820ae){var _0x4f4efe='server/files/images/logos';var _0xd7f8fa={'custom':![]};return utilLicense[_0x03d1('0x57')]()[_0x03d1('0x1b')](function(_0x41bed0){if(_0x41bed0){_0xd7f8fa=_0x41bed0;}return db['Setting'][_0x03d1('0x4c')]({'where':{'id':_0x224c3b[_0x03d1('0x4f')]['id']},'attributes':['logo',_0x03d1('0x54'),'preferred','favicon',_0x03d1('0x59'),_0x03d1('0x66'),_0x03d1('0x5a'),_0x03d1('0x67')],'raw':!![]});})[_0x03d1('0x1b')](handleEntityNotFound(_0x474fe9,null))['then'](function(_0x10e581){if(_0x10e581){var _0x165038=_0x10e581[_0x03d1('0x54')]&&fs[_0x03d1('0x5b')](path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x4f4efe,_['toLower'](_0x10e581['loginLogo'])))?path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x4f4efe,_[_0x03d1('0x5e')](_0x10e581['loginLogo'])):path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x4f4efe,_[_0x03d1('0x5e')]('default_loginLogo.svg'));var _0x2d3487='default'+_[_0x03d1('0x61')](_0x03d1('0x54'));if(_0x10e581[_0x2d3487]||!_0xd7f8fa['custom']){_0x165038=path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x4f4efe,_[_0x03d1('0x5e')](_0x03d1('0x68')));}if(!fs['existsSync'](_0x165038)){throw new db[(_0x03d1('0x63'))]['ValidationError'](_['upperFirst'](_0x03d1('0x54'))+_0x03d1('0x64'));}return _0x474fe9[_0x03d1('0x65')](_0x165038);}})[_0x03d1('0x22')](handleError(_0x474fe9,null));};exports[_0x03d1('0x69')]=function(_0x892499,_0x3e62bc){return db[_0x03d1('0x48')][_0x03d1('0x4c')]({'where':{'id':_0x892499[_0x03d1('0x4f')]['id']},'attributes':['securePassword']})[_0x03d1('0x1b')](respondWithResult(_0x3e62bc,null))[_0x03d1('0x22')](handleError(_0x3e62bc,null));};exports[_0x03d1('0x6a')]=function(_0x4e4653,_0x3a2d8a,_0x467ea8){if(_0x4e4653[_0x03d1('0x50')]&&_0x4e4653[_0x03d1('0x50')][_0x03d1('0x51')]){_0x4e4653[_0x03d1('0x4e')][_0x03d1('0x6b')]=_0x4e4653[_0x03d1('0x50')]['filename'];}return db[_0x03d1('0x48')]['find']({'where':{'id':_0x4e4653[_0x03d1('0x4f')]['id']}})[_0x03d1('0x1b')](handleEntityNotFound(_0x3a2d8a,null))[_0x03d1('0x1b')](saveUpdates(_0x4e4653['body'],null))['then'](respondWithResult(_0x3a2d8a,null))[_0x03d1('0x22')](handleError(_0x3a2d8a,null));};var utilLicense=require(_0x03d1('0x16'));exports[_0x03d1('0x6c')]=function(_0x43aeb4,_0x8e1e50,_0x2535cf){var _0x11289c='server/files/images/logos';var _0x45f830={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x3b4613){if(_0x3b4613){_0x45f830=_0x3b4613;}return db['Setting'][_0x03d1('0x4c')]({'where':{'id':_0x43aeb4[_0x03d1('0x4f')]['id']},'attributes':[_0x03d1('0x52'),_0x03d1('0x54'),'preferred','favicon','defaultLogo',_0x03d1('0x66'),_0x03d1('0x5a'),_0x03d1('0x67')],'raw':!![]});})[_0x03d1('0x1b')](handleEntityNotFound(_0x8e1e50,null))[_0x03d1('0x1b')](function(_0x590276){if(_0x590276){var _0x41ce0b=_0x590276[_0x03d1('0x6b')]&&fs[_0x03d1('0x5b')](path['join'](config[_0x03d1('0x5d')],_0x11289c,_[_0x03d1('0x5e')](_0x590276[_0x03d1('0x6b')])))?path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x11289c,_[_0x03d1('0x5e')](_0x590276[_0x03d1('0x6b')])):path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x11289c,_['toLower'](_0x03d1('0x6d')));var _0x54ea1c=_0x03d1('0x60')+_[_0x03d1('0x61')]('preferred');if(_0x590276[_0x54ea1c]||!_0x45f830['custom']||!_0x45f830[_0x03d1('0x6b')]){_0x41ce0b=path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x11289c,_[_0x03d1('0x5e')](_0x03d1('0x6d')));}if(!fs['existsSync'](_0x41ce0b)){throw new db[(_0x03d1('0x63'))][(_0x03d1('0x6e'))](_[_0x03d1('0x61')]('preferred')+'\x20not\x20found');}return _0x8e1e50[_0x03d1('0x65')](_0x41ce0b);}})['catch'](handleError(_0x8e1e50,null));};exports['addFavicon']=function(_0x358a69,_0x24039f,_0x5b146c){if(_0x358a69[_0x03d1('0x50')]&&_0x358a69['file']['filename']){_0x358a69[_0x03d1('0x4e')][_0x03d1('0x58')]=_0x358a69[_0x03d1('0x50')][_0x03d1('0x51')];}return db[_0x03d1('0x48')][_0x03d1('0x4c')]({'where':{'id':_0x358a69[_0x03d1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x24039f,null))['then'](saveUpdates(_0x358a69[_0x03d1('0x4e')],null))[_0x03d1('0x1b')](respondWithResult(_0x24039f,null))[_0x03d1('0x22')](handleError(_0x24039f,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x5b3541,_0x55382a,_0xba50a2){var _0x5ab118='server/files/images/logos';var _0x898b72={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x552652){if(_0x552652){_0x898b72=_0x552652;}return db[_0x03d1('0x48')][_0x03d1('0x4c')]({'where':{'id':_0x5b3541['params']['id']},'attributes':[_0x03d1('0x52'),'loginLogo',_0x03d1('0x6b'),_0x03d1('0x58'),'defaultLogo',_0x03d1('0x66'),_0x03d1('0x5a'),_0x03d1('0x67')],'raw':!![]});})[_0x03d1('0x1b')](handleEntityNotFound(_0x55382a,null))[_0x03d1('0x1b')](function(_0x48688c){if(_0x48688c){var _0x7bd3ac=_0x48688c[_0x03d1('0x58')]&&fs[_0x03d1('0x5b')](path[_0x03d1('0x5c')](config['root'],_0x5ab118,_[_0x03d1('0x5e')](_0x48688c[_0x03d1('0x58')])))?path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x5ab118,_[_0x03d1('0x5e')](_0x48688c[_0x03d1('0x58')])):path[_0x03d1('0x5c')](config[_0x03d1('0x5d')],_0x5ab118,_['toLower']('default_favicon.ico'));var _0x1eeb34=_0x03d1('0x60')+_[_0x03d1('0x61')](_0x03d1('0x58'));if(_0x48688c[_0x1eeb34]||!_0x898b72[_0x03d1('0x62')]){_0x7bd3ac=path['join'](config[_0x03d1('0x5d')],_0x5ab118,_[_0x03d1('0x5e')](_0x03d1('0x6f')));}if(!fs['existsSync'](_0x7bd3ac)){throw new db['Sequelize'][(_0x03d1('0x6e'))](_[_0x03d1('0x61')](_0x03d1('0x58'))+'\x20not\x20found');}return _0x55382a[_0x03d1('0x65')](_0x7bd3ac);}})[_0x03d1('0x22')](handleError(_0x55382a,null));};exports[_0x03d1('0x70')]=function(_0x1f89ea,_0x3838d1){var _0x39434a={'offset':moment()[_0x03d1('0x71')]()};_0x39434a['now']=moment()['utcOffset'](_0x39434a[_0x03d1('0x27')])['format'](_0x03d1('0x72'));return _0x3838d1[_0x03d1('0x24')](0xc8)[_0x03d1('0x73')](_0x39434a);}; \ No newline at end of file +var _0x3d4f=['zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','index','map','Setting','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','include','find','body','addLogo','file','logo','addLogoLogin','filename','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default','upperFirst','custom','Sequelize','\x20not\x20found','getLogoLogin','defaultFavicon','ValidationError','gdpr','securePassword','download','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','send','rimraf'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x3d4f,0xef));var _0xf3d4=function(_0x40ff4e,_0x50a4a3){_0x40ff4e=_0x40ff4e-0x0;var _0x2ea887=_0x3d4f[_0x40ff4e];return _0x2ea887;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3d4('0x0'));var zipdir=require(_0xf3d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3d4('0x2'));var moment=require('moment');var BPromise=require(_0xf3d4('0x3'));var Mustache=require(_0xf3d4('0x4'));var util=require('util');var path=require(_0xf3d4('0x5'));var sox=require(_0xf3d4('0x6'));var csv=require(_0xf3d4('0x7'));var ejs=require(_0xf3d4('0x8'));var fs=require('fs');var fs_extra=require(_0xf3d4('0x9'));var _=require(_0xf3d4('0xa'));var squel=require(_0xf3d4('0xb'));var crypto=require(_0xf3d4('0xc'));var jsforce=require(_0xf3d4('0xd'));var deskjs=require(_0xf3d4('0xe'));var toCsv=require(_0xf3d4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf3d4('0xf'));var authService=require(_0xf3d4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3d4('0x11'));var logger=require(_0xf3d4('0x12'))(_0xf3d4('0x13'));var utils=require('../../config/utils');var config=require(_0xf3d4('0x14'));var licenseUtil=require(_0xf3d4('0x15'));var db=require(_0xf3d4('0x16'))['db'];var jayson=require(_0xf3d4('0x17'));var client=jayson[_0xf3d4('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20848b,_0x2c48ae,_0x22cf17,_0x44b613){return new BPromise(function(_0x4ada14,_0x38e858){var _0x19d0d7=_0x44b613||client;return _0x19d0d7[_0xf3d4('0x19')](_0x20848b,_0x22cf17)[_0xf3d4('0x1a')](function(_0x21935e){logger[_0xf3d4('0x1b')](_0xf3d4('0x1c'),_0x2c48ae,'request\x20sent');logger['debug'](_0xf3d4('0x1d'),_0x2c48ae,_0xf3d4('0x1e'),JSON[_0xf3d4('0x1f')](_0x21935e));if(_0x21935e[_0xf3d4('0x20')]){if(_0x21935e[_0xf3d4('0x20')][_0xf3d4('0x21')]===0x1f4){logger[_0xf3d4('0x20')](_0xf3d4('0x1c'),_0x2c48ae,_0x21935e['error']['message']);return _0x38e858(_0x21935e['error'][_0xf3d4('0x22')]);}logger[_0xf3d4('0x20')](_0xf3d4('0x1c'),_0x2c48ae,_0x21935e[_0xf3d4('0x20')][_0xf3d4('0x22')]);return _0x4ada14(_0x21935e[_0xf3d4('0x20')]['message']);}else{logger[_0xf3d4('0x1b')](_0xf3d4('0x1c'),_0x2c48ae,_0xf3d4('0x1e'));_0x4ada14(_0x21935e['result']['message']);}})[_0xf3d4('0x23')](function(_0x5bdc91){logger['error'](_0xf3d4('0x1c'),_0x2c48ae,_0x5bdc91);_0x38e858(_0x5bdc91);});});}function respondWithStatusCode(_0x59a31b,_0x37859b){_0x37859b=_0x37859b||0xcc;return function(_0x543409){if(_0x543409){return _0x59a31b['sendStatus'](_0x37859b);}return _0x59a31b[_0xf3d4('0x24')](_0x37859b)[_0xf3d4('0x25')]();};}function respondWithResult(_0x5cdcd9,_0x2fa445){_0x2fa445=_0x2fa445||0xc8;return function(_0x37bcfa){if(_0x37bcfa){return _0x5cdcd9['status'](_0x2fa445)[_0xf3d4('0x26')](_0x37bcfa);}};}function respondWithFilteredResult(_0x5aabc7,_0x14f84a){return function(_0x561f11){if(_0x561f11){var _0x2f5fec=typeof _0x14f84a[_0xf3d4('0x27')]===_0xf3d4('0x28')&&typeof _0x14f84a[_0xf3d4('0x29')]===_0xf3d4('0x28');var _0x1fd30a=_0x561f11['count'];var _0x3742ca=_0x2f5fec?0x0:_0x14f84a['offset'];var _0xdb7036=_0x2f5fec?_0x561f11[_0xf3d4('0x2a')]:_0x14f84a[_0xf3d4('0x27')]+_0x14f84a[_0xf3d4('0x29')];var _0x7f72a4;if(_0xdb7036>=_0x1fd30a){_0xdb7036=_0x1fd30a;_0x7f72a4=0xc8;}else{_0x7f72a4=0xce;}_0x5aabc7[_0xf3d4('0x24')](_0x7f72a4);return _0x5aabc7[_0xf3d4('0x2b')](_0xf3d4('0x2c'),_0x3742ca+'-'+_0xdb7036+'/'+_0x1fd30a)['json'](_0x561f11);}return null;};}function patchUpdates(_0x3bd239){return function(_0x2e99ae){try{jsonpatch[_0xf3d4('0x2d')](_0x2e99ae,_0x3bd239,!![]);}catch(_0xf7c2ee){return BPromise['reject'](_0xf7c2ee);}return _0x2e99ae[_0xf3d4('0x2e')]();};}function saveUpdates(_0x553b67,_0x1bc16f){return function(_0x3ee483){if(_0x3ee483){return _0x3ee483[_0xf3d4('0x2f')](_0x553b67)['then'](function(_0x1d2d92){return _0x1d2d92;});}return null;};}function removeEntity(_0x5b6327,_0x3c2a19){return function(_0x4c12a8){if(_0x4c12a8){return _0x4c12a8[_0xf3d4('0x30')]()[_0xf3d4('0x1a')](function(){_0x5b6327['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fa2f,_0xaaa1f2){return function(_0x317244){if(!_0x317244){_0x53fa2f[_0xf3d4('0x31')](0x194);}return _0x317244;};}function handleError(_0x965b37,_0x1fda29){_0x1fda29=_0x1fda29||0x1f4;return function(_0x4adaf1){logger['error'](_0x4adaf1[_0xf3d4('0x32')]);if(_0x4adaf1[_0xf3d4('0x33')]){delete _0x4adaf1[_0xf3d4('0x33')];}_0x965b37[_0xf3d4('0x24')](_0x1fda29)['send'](_0x4adaf1);};}exports[_0xf3d4('0x34')]=function(_0x5b3fc0,_0x2b9cef){var _0x56c5a3={},_0x1db508={},_0x2881d5={'count':0x0,'rows':[]};var _0x5a3b0a=_[_0xf3d4('0x35')](db[_0xf3d4('0x36')][_0xf3d4('0x37')],function(_0xd3fcc7){return{'name':_0xd3fcc7[_0xf3d4('0x38')],'type':_0xd3fcc7[_0xf3d4('0x39')][_0xf3d4('0x3a')]};});_0x1db508[_0xf3d4('0x3b')]=_[_0xf3d4('0x35')](_0x5a3b0a,_0xf3d4('0x33'));_0x1db508['query']=_[_0xf3d4('0x3c')](_0x5b3fc0['query']);_0x1db508[_0xf3d4('0x3d')]=_[_0xf3d4('0x3e')](_0x1db508[_0xf3d4('0x3b')],_0x1db508[_0xf3d4('0x3f')]);_0x56c5a3['attributes']=_[_0xf3d4('0x3e')](_0x1db508[_0xf3d4('0x3b')],qs[_0xf3d4('0x40')](_0x5b3fc0['query'][_0xf3d4('0x40')]));_0x56c5a3[_0xf3d4('0x41')]=_0x56c5a3[_0xf3d4('0x41')][_0xf3d4('0x42')]?_0x56c5a3[_0xf3d4('0x41')]:_0x1db508[_0xf3d4('0x3b')];if(!_0x5b3fc0['query'][_0xf3d4('0x43')](_0xf3d4('0x44'))){_0x56c5a3[_0xf3d4('0x29')]=qs[_0xf3d4('0x29')](_0x5b3fc0[_0xf3d4('0x3f')][_0xf3d4('0x29')]);_0x56c5a3[_0xf3d4('0x27')]=qs[_0xf3d4('0x27')](_0x5b3fc0[_0xf3d4('0x3f')][_0xf3d4('0x27')]);}_0x56c5a3['order']=qs[_0xf3d4('0x45')](_0x5b3fc0[_0xf3d4('0x3f')][_0xf3d4('0x45')]);_0x56c5a3[_0xf3d4('0x46')]=qs[_0xf3d4('0x3d')](_[_0xf3d4('0x47')](_0x5b3fc0[_0xf3d4('0x3f')],_0x1db508[_0xf3d4('0x3d')]),_0x5a3b0a);if(_0x5b3fc0[_0xf3d4('0x3f')][_0xf3d4('0x48')]){_0x56c5a3['where']=_['merge'](_0x56c5a3[_0xf3d4('0x46')],{'$or':_['map'](_0x5a3b0a,function(_0x52d834){if(_0x52d834[_0xf3d4('0x39')]!==_0xf3d4('0x49')){var _0x29f897={};_0x29f897[_0x52d834['name']]={'$like':'%'+_0x5b3fc0[_0xf3d4('0x3f')][_0xf3d4('0x48')]+'%'};return _0x29f897;}})});}_0x56c5a3=_[_0xf3d4('0x4a')]({},_0x56c5a3,_0x5b3fc0[_0xf3d4('0x4b')]);var _0x196f2a={'where':_0x56c5a3['where']};return db[_0xf3d4('0x36')][_0xf3d4('0x2a')](_0x196f2a)[_0xf3d4('0x1a')](function(_0x2a547e){_0x2881d5[_0xf3d4('0x2a')]=_0x2a547e;if(_0x5b3fc0['query'][_0xf3d4('0x4c')]){_0x56c5a3['include']=[{'all':!![]}];}return db['Setting'][_0xf3d4('0x4d')](_0x56c5a3);})[_0xf3d4('0x1a')](function(_0x2bc340){_0x2881d5['rows']=_0x2bc340;return _0x2881d5;})['then'](respondWithFilteredResult(_0x2b9cef,_0x56c5a3))[_0xf3d4('0x23')](handleError(_0x2b9cef,null));};exports[_0xf3d4('0x4e')]=function(_0x3fe55a,_0xacb9eb){var _0x2d797e={'raw':![],'where':{'id':_0x3fe55a[_0xf3d4('0x4f')]['id']}},_0xd03915={};_0xd03915[_0xf3d4('0x3b')]=_[_0xf3d4('0x3c')](db['Setting'][_0xf3d4('0x37')]);_0xd03915[_0xf3d4('0x3f')]=_['keys'](_0x3fe55a[_0xf3d4('0x3f')]);_0xd03915[_0xf3d4('0x3d')]=_[_0xf3d4('0x3e')](_0xd03915[_0xf3d4('0x3b')],_0xd03915[_0xf3d4('0x3f')]);_0x2d797e[_0xf3d4('0x41')]=_[_0xf3d4('0x3e')](_0xd03915[_0xf3d4('0x3b')],qs['fields'](_0x3fe55a['query'][_0xf3d4('0x40')]));_0x2d797e[_0xf3d4('0x41')]=_0x2d797e[_0xf3d4('0x41')][_0xf3d4('0x42')]?_0x2d797e[_0xf3d4('0x41')]:_0xd03915[_0xf3d4('0x3b')];if(_0x3fe55a[_0xf3d4('0x3f')][_0xf3d4('0x4c')]){_0x2d797e[_0xf3d4('0x50')]=[{'all':!![]}];}_0x2d797e=_['merge']({},_0x2d797e,_0x3fe55a[_0xf3d4('0x4b')]);return db[_0xf3d4('0x36')][_0xf3d4('0x51')](_0x2d797e)[_0xf3d4('0x1a')](handleEntityNotFound(_0xacb9eb,null))[_0xf3d4('0x1a')](respondWithResult(_0xacb9eb,null))[_0xf3d4('0x23')](handleError(_0xacb9eb,null));};exports['update']=function(_0x4e555a,_0x295d56){if(_0x4e555a[_0xf3d4('0x52')]['id']){delete _0x4e555a[_0xf3d4('0x52')]['id'];}return db[_0xf3d4('0x36')][_0xf3d4('0x51')]({'where':{'id':_0x4e555a[_0xf3d4('0x4f')]['id']}})[_0xf3d4('0x1a')](handleEntityNotFound(_0x295d56,null))['then'](saveUpdates(_0x4e555a[_0xf3d4('0x52')],null))['then'](respondWithResult(_0x295d56,null))['catch'](handleError(_0x295d56,null));};exports[_0xf3d4('0x53')]=function(_0x4d83ee,_0x4be306,_0x528e35){if(_0x4d83ee[_0xf3d4('0x54')]&&_0x4d83ee['file']['filename']){_0x4d83ee[_0xf3d4('0x52')][_0xf3d4('0x55')]=_0x4d83ee[_0xf3d4('0x54')]['filename'];}return db[_0xf3d4('0x36')][_0xf3d4('0x51')]({'where':{'id':_0x4d83ee['params']['id']}})['then'](handleEntityNotFound(_0x4be306,null))[_0xf3d4('0x1a')](saveUpdates(_0x4d83ee[_0xf3d4('0x52')],null))['then'](respondWithResult(_0x4be306,null))['catch'](handleError(_0x4be306,null));};exports[_0xf3d4('0x56')]=function(_0x4c0802,_0x454cb7,_0x4ebb2f){if(_0x4c0802[_0xf3d4('0x54')]&&_0x4c0802[_0xf3d4('0x54')][_0xf3d4('0x57')]){_0x4c0802[_0xf3d4('0x52')][_0xf3d4('0x58')]=_0x4c0802[_0xf3d4('0x54')][_0xf3d4('0x57')];}return db['Setting'][_0xf3d4('0x51')]({'where':{'id':_0x4c0802[_0xf3d4('0x4f')]['id']}})[_0xf3d4('0x1a')](handleEntityNotFound(_0x454cb7,null))[_0xf3d4('0x1a')](saveUpdates(_0x4c0802[_0xf3d4('0x52')],null))['then'](respondWithResult(_0x454cb7,null))[_0xf3d4('0x23')](handleError(_0x454cb7,null));};var utilLicense=require('../../config/license/util');exports[_0xf3d4('0x59')]=function(_0x46ad9f,_0x251a23,_0x51f8da){var _0x176f3b=_0xf3d4('0x5a');var _0x539547={'custom':![]};return utilLicense[_0xf3d4('0x5b')]()['then'](function(_0x222878){if(_0x222878){_0x539547=_0x222878;}return db[_0xf3d4('0x36')][_0xf3d4('0x51')]({'where':{'id':_0x46ad9f[_0xf3d4('0x4f')]['id']},'attributes':[_0xf3d4('0x55'),_0xf3d4('0x58'),_0xf3d4('0x5c'),_0xf3d4('0x5d'),_0xf3d4('0x5e'),_0xf3d4('0x5f'),_0xf3d4('0x60'),'defaultFavicon'],'raw':!![]});})[_0xf3d4('0x1a')](handleEntityNotFound(_0x251a23,null))[_0xf3d4('0x1a')](function(_0x2c1ea2){if(_0x2c1ea2){var _0xd6cd22=_0x2c1ea2[_0xf3d4('0x55')]&&fs[_0xf3d4('0x61')](path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x176f3b,_[_0xf3d4('0x64')](_0x2c1ea2[_0xf3d4('0x55')])))?path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x176f3b,_[_0xf3d4('0x64')](_0x2c1ea2['logo'])):path[_0xf3d4('0x62')](config['root'],_0x176f3b,_['toLower']('default_logo.svg'));var _0x2a2d02=_0xf3d4('0x65')+_[_0xf3d4('0x66')](_0xf3d4('0x55'));if(_0x2c1ea2[_0x2a2d02]||!_0x539547[_0xf3d4('0x67')]){_0xd6cd22=path[_0xf3d4('0x62')](config['root'],_0x176f3b,_['toLower']('default_logo.svg'));}if(!fs['existsSync'](_0xd6cd22)){throw new db[(_0xf3d4('0x68'))]['ValidationError'](_['upperFirst'](_0xf3d4('0x55'))+_0xf3d4('0x69'));}return _0x251a23['download'](_0xd6cd22);}})[_0xf3d4('0x23')](handleError(_0x251a23,null));};var utilLicense=require(_0xf3d4('0x15'));exports[_0xf3d4('0x6a')]=function(_0x57a476,_0x4381d5,_0x187d9e){var _0x4e82f3='server/files/images/logos';var _0x459a6d={'custom':![]};return utilLicense[_0xf3d4('0x5b')]()['then'](function(_0x582346){if(_0x582346){_0x459a6d=_0x582346;}return db[_0xf3d4('0x36')][_0xf3d4('0x51')]({'where':{'id':_0x57a476[_0xf3d4('0x4f')]['id']},'attributes':['logo',_0xf3d4('0x58'),'preferred','favicon',_0xf3d4('0x5e'),_0xf3d4('0x5f'),_0xf3d4('0x60'),_0xf3d4('0x6b')],'raw':!![]});})[_0xf3d4('0x1a')](handleEntityNotFound(_0x4381d5,null))[_0xf3d4('0x1a')](function(_0x31a907){if(_0x31a907){var _0x7d4da1=_0x31a907[_0xf3d4('0x58')]&&fs['existsSync'](path[_0xf3d4('0x62')](config['root'],_0x4e82f3,_[_0xf3d4('0x64')](_0x31a907[_0xf3d4('0x58')])))?path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x4e82f3,_[_0xf3d4('0x64')](_0x31a907[_0xf3d4('0x58')])):path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x4e82f3,_[_0xf3d4('0x64')]('default_loginLogo.svg'));var _0x1dbfd4=_0xf3d4('0x65')+_[_0xf3d4('0x66')]('loginLogo');if(_0x31a907[_0x1dbfd4]||!_0x459a6d[_0xf3d4('0x67')]){_0x7d4da1=path[_0xf3d4('0x62')](config['root'],_0x4e82f3,_[_0xf3d4('0x64')]('default_loginLogo.svg'));}if(!fs[_0xf3d4('0x61')](_0x7d4da1)){throw new db[(_0xf3d4('0x68'))][(_0xf3d4('0x6c'))](_[_0xf3d4('0x66')](_0xf3d4('0x58'))+_0xf3d4('0x69'));}return _0x4381d5['download'](_0x7d4da1);}})[_0xf3d4('0x23')](handleError(_0x4381d5,null));};exports[_0xf3d4('0x6d')]=function(_0x3e9112,_0x1e3a75){return db['Setting'][_0xf3d4('0x51')]({'where':{'id':_0x3e9112[_0xf3d4('0x4f')]['id']},'attributes':[_0xf3d4('0x6e')]})[_0xf3d4('0x1a')](respondWithResult(_0x1e3a75,null))['catch'](handleError(_0x1e3a75,null));};exports['addPreferred']=function(_0x1f0c53,_0x30f914,_0x5e0a63){if(_0x1f0c53[_0xf3d4('0x54')]&&_0x1f0c53[_0xf3d4('0x54')][_0xf3d4('0x57')]){_0x1f0c53['body'][_0xf3d4('0x5c')]=_0x1f0c53[_0xf3d4('0x54')][_0xf3d4('0x57')];}return db[_0xf3d4('0x36')][_0xf3d4('0x51')]({'where':{'id':_0x1f0c53['params']['id']}})[_0xf3d4('0x1a')](handleEntityNotFound(_0x30f914,null))[_0xf3d4('0x1a')](saveUpdates(_0x1f0c53[_0xf3d4('0x52')],null))['then'](respondWithResult(_0x30f914,null))[_0xf3d4('0x23')](handleError(_0x30f914,null));};var utilLicense=require(_0xf3d4('0x15'));exports['getPreferred']=function(_0x508acd,_0x2c079c,_0x4ba070){var _0x32e6ab=_0xf3d4('0x5a');var _0x5300c0={'custom':![]};return utilLicense['getLicense']()[_0xf3d4('0x1a')](function(_0x326504){if(_0x326504){_0x5300c0=_0x326504;}return db['Setting'][_0xf3d4('0x51')]({'where':{'id':_0x508acd[_0xf3d4('0x4f')]['id']},'attributes':[_0xf3d4('0x55'),_0xf3d4('0x58'),_0xf3d4('0x5c'),'favicon',_0xf3d4('0x5e'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2c079c,null))[_0xf3d4('0x1a')](function(_0x1989b8){if(_0x1989b8){var _0x1b189f=_0x1989b8[_0xf3d4('0x5c')]&&fs[_0xf3d4('0x61')](path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x32e6ab,_[_0xf3d4('0x64')](_0x1989b8[_0xf3d4('0x5c')])))?path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x32e6ab,_[_0xf3d4('0x64')](_0x1989b8['preferred'])):path[_0xf3d4('0x62')](config['root'],_0x32e6ab,_[_0xf3d4('0x64')]('default_preferred.png'));var _0x41c528=_0xf3d4('0x65')+_['upperFirst'](_0xf3d4('0x5c'));if(_0x1989b8[_0x41c528]||!_0x5300c0['custom']||!_0x5300c0[_0xf3d4('0x5c')]){_0x1b189f=path['join'](config['root'],_0x32e6ab,_[_0xf3d4('0x64')]('default_preferred.png'));}if(!fs['existsSync'](_0x1b189f)){throw new db[(_0xf3d4('0x68'))]['ValidationError'](_['upperFirst'](_0xf3d4('0x5c'))+_0xf3d4('0x69'));}return _0x2c079c[_0xf3d4('0x6f')](_0x1b189f);}})[_0xf3d4('0x23')](handleError(_0x2c079c,null));};exports[_0xf3d4('0x70')]=function(_0x16ebd7,_0x1566b8,_0x435549){if(_0x16ebd7[_0xf3d4('0x54')]&&_0x16ebd7[_0xf3d4('0x54')]['filename']){_0x16ebd7[_0xf3d4('0x52')][_0xf3d4('0x5d')]=_0x16ebd7['file'][_0xf3d4('0x57')];}return db['Setting'][_0xf3d4('0x51')]({'where':{'id':_0x16ebd7[_0xf3d4('0x4f')]['id']}})[_0xf3d4('0x1a')](handleEntityNotFound(_0x1566b8,null))['then'](saveUpdates(_0x16ebd7[_0xf3d4('0x52')],null))['then'](respondWithResult(_0x1566b8,null))[_0xf3d4('0x23')](handleError(_0x1566b8,null));};var utilLicense=require('../../config/license/util');exports[_0xf3d4('0x71')]=function(_0x5005b1,_0x43c033,_0xbc5c7){var _0x36704d='server/files/images/logos';var _0x301762={'custom':![]};return utilLicense['getLicense']()[_0xf3d4('0x1a')](function(_0x18a201){if(_0x18a201){_0x301762=_0x18a201;}return db[_0xf3d4('0x36')][_0xf3d4('0x51')]({'where':{'id':_0x5005b1[_0xf3d4('0x4f')]['id']},'attributes':[_0xf3d4('0x55'),_0xf3d4('0x58'),_0xf3d4('0x5c'),_0xf3d4('0x5d'),_0xf3d4('0x5e'),_0xf3d4('0x5f'),_0xf3d4('0x60'),_0xf3d4('0x6b')],'raw':!![]});})[_0xf3d4('0x1a')](handleEntityNotFound(_0x43c033,null))[_0xf3d4('0x1a')](function(_0x39b4b5){if(_0x39b4b5){var _0x3fc00d=_0x39b4b5['favicon']&&fs['existsSync'](path[_0xf3d4('0x62')](config['root'],_0x36704d,_[_0xf3d4('0x64')](_0x39b4b5[_0xf3d4('0x5d')])))?path['join'](config[_0xf3d4('0x63')],_0x36704d,_['toLower'](_0x39b4b5[_0xf3d4('0x5d')])):path[_0xf3d4('0x62')](config[_0xf3d4('0x63')],_0x36704d,_['toLower'](_0xf3d4('0x72')));var _0x59e110=_0xf3d4('0x65')+_[_0xf3d4('0x66')](_0xf3d4('0x5d'));if(_0x39b4b5[_0x59e110]||!_0x301762['custom']){_0x3fc00d=path['join'](config[_0xf3d4('0x63')],_0x36704d,_[_0xf3d4('0x64')](_0xf3d4('0x72')));}if(!fs[_0xf3d4('0x61')](_0x3fc00d)){throw new db[(_0xf3d4('0x68'))]['ValidationError'](_['upperFirst'](_0xf3d4('0x5d'))+_0xf3d4('0x69'));}return _0x43c033[_0xf3d4('0x6f')](_0x3fc00d);}})[_0xf3d4('0x23')](handleError(_0x43c033,null));};exports[_0xf3d4('0x73')]=function(_0x2fb852,_0x46d3a0){var _0x482896={'offset':moment()['utcOffset']()};_0x482896[_0xf3d4('0x74')]=moment()[_0xf3d4('0x75')](_0x482896[_0xf3d4('0x27')])[_0xf3d4('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x46d3a0[_0xf3d4('0x24')](0xc8)[_0xf3d4('0x77')](_0x482896);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 18d82d3..fd6e4a8 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x3e1a10,_0x6aeaf2){var _0x2fb8ee=function(_0x473aa3){while(--_0x473aa3){_0x3e1a10['push'](_0x3e1a10['shift']());}};_0x2fb8ee(++_0x6aeaf2);}(_0x008c,0x188));var _0xc008=function(_0x44a329,_0x45f280){_0x44a329=_0x44a329-0x0;var _0x45f2a3=_0x008c[_0x44a329];return _0x45f2a3;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x3e9568,_0x5a2319){var _0x1608fc=function(_0x2ad91d){while(--_0x2ad91d){_0x3e9568['push'](_0x3e9568['shift']());}};_0x1608fc(++_0x5a2319);}(_0x34e8,0x12c));var _0x834e=function(_0x58cab0,_0x3c8923){_0x58cab0=_0x58cab0-0x0;var _0x36c06e=_0x34e8[_0x58cab0];return _0x36c06e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 255589a..38d32ef 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 _0x4ab2=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSetting','find','options','raw','where','attributes','include','model','map','catch','lodash','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4ab2,0x153));var _0x24ab=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x4ab2[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x24ab('0x0'));var util=require('util');var moment=require(_0x24ab('0x1'));var BPromise=require(_0x24ab('0x2'));var rs=require(_0x24ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x24ab('0x5'));var config=require(_0x24ab('0x6'));var jayson=require(_0x24ab('0x7'));var client=jayson[_0x24ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a517e,_0x4cd8a9,_0x2f3d35){return new BPromise(function(_0x3415e4,_0x2ba45b){return client[_0x24ab('0x9')](_0x5a517e,_0x2f3d35)[_0x24ab('0xa')](function(_0x4282bd){logger[_0x24ab('0xb')](_0x24ab('0xc'),_0x4cd8a9,_0x24ab('0xd'));logger[_0x24ab('0xe')](_0x24ab('0xf'),_0x4cd8a9,_0x24ab('0xd'),JSON[_0x24ab('0x10')](_0x4282bd));if(_0x4282bd[_0x24ab('0x11')]){if(_0x4282bd[_0x24ab('0x11')][_0x24ab('0x12')]===0x1f4){logger[_0x24ab('0x11')](_0x24ab('0xc'),_0x4cd8a9,_0x4282bd[_0x24ab('0x11')]['message']);return _0x2ba45b(_0x4282bd['error'][_0x24ab('0x13')]);}logger[_0x24ab('0x11')](_0x24ab('0xc'),_0x4cd8a9,_0x4282bd['error']['message']);return _0x3415e4(_0x4282bd[_0x24ab('0x11')][_0x24ab('0x13')]);}else{logger[_0x24ab('0xb')](_0x24ab('0xc'),_0x4cd8a9,_0x24ab('0xd'));_0x3415e4(_0x4282bd[_0x24ab('0x14')]['message']);}})['catch'](function(_0x14bcfe){logger[_0x24ab('0x11')]('Setting,\x20%s,\x20%s',_0x4cd8a9,_0x14bcfe);_0x2ba45b(_0x14bcfe);});});}exports[_0x24ab('0x15')]=function(_0x2d29bc){var _0x2c317a=this;return new Promise(function(_0x22ff07,_0x1d6248){return db['Setting'][_0x24ab('0x16')]({'raw':_0x2d29bc[_0x24ab('0x17')]?_0x2d29bc[_0x24ab('0x17')][_0x24ab('0x18')]===undefined?!![]:![]:!![],'where':_0x2d29bc['options']?_0x2d29bc[_0x24ab('0x17')][_0x24ab('0x19')]||null:null,'attributes':_0x2d29bc[_0x24ab('0x17')]?_0x2d29bc[_0x24ab('0x17')][_0x24ab('0x1a')]||null:null,'include':_0x2d29bc[_0x24ab('0x17')]?_0x2d29bc['options']['include']?_['map'](_0x2d29bc[_0x24ab('0x17')][_0x24ab('0x1b')],function(_0x30688c){return{'model':db[_0x30688c[_0x24ab('0x1c')]],'as':_0x30688c['as'],'attributes':_0x30688c[_0x24ab('0x1a')],'include':_0x30688c['include']?_[_0x24ab('0x1d')](_0x30688c[_0x24ab('0x1b')],function(_0x4ab98c){return{'model':db[_0x4ab98c['model']],'as':_0x4ab98c['as'],'attributes':_0x4ab98c[_0x24ab('0x1a')],'include':_0x4ab98c[_0x24ab('0x1b')]?_[_0x24ab('0x1d')](_0x4ab98c[_0x24ab('0x1b')],function(_0x4abf5e){return{'model':db[_0x4abf5e['model']],'as':_0x4abf5e['as'],'attributes':_0x4abf5e[_0x24ab('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x24ab('0xa')](function(_0x1cd331){logger[_0x24ab('0xb')](_0x24ab('0x15'),_0x2d29bc);logger[_0x24ab('0xe')](_0x24ab('0x15'),_0x2d29bc,JSON['stringify'](_0x1cd331));_0x22ff07(_0x1cd331);})[_0x24ab('0x1e')](function(_0x3e4684){logger['error'](_0x24ab('0x15'),_0x3e4684[_0x24ab('0x13')],_0x2d29bc);_0x1d6248(_0x2c317a[_0x24ab('0x11')](0x1f4,_0x3e4684[_0x24ab('0x13')]));});});}; \ No newline at end of file +var _0x78cf=['error','message','info','result','ShowSetting','Setting','find','options','where','attributes','include','map','model','then','debug','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x270dbb,_0xbb9a1a){var _0x535742=function(_0x1dc4c8){while(--_0x1dc4c8){_0x270dbb['push'](_0x270dbb['shift']());}};_0x535742(++_0xbb9a1a);}(_0x78cf,0x88));var _0xf78c=function(_0x577fd4,_0x453fbb){_0x577fd4=_0x577fd4-0x0;var _0x1306ee=_0x78cf[_0x577fd4];return _0x1306ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf78c('0x0'));var BPromise=require(_0xf78c('0x1'));var rs=require(_0xf78c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf78c('0x3'))['db'];var utils=require(_0xf78c('0x4'));var logger=require(_0xf78c('0x5'))(_0xf78c('0x6'));var config=require(_0xf78c('0x7'));var jayson=require(_0xf78c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bd06b,_0x5c5048,_0x21b5f0){return new BPromise(function(_0x2ef499,_0x5494aa){return client[_0xf78c('0x9')](_0x5bd06b,_0x21b5f0)['then'](function(_0x270f3d){logger['info'](_0xf78c('0xa'),_0x5c5048,_0xf78c('0xb'));logger['debug'](_0xf78c('0xc'),_0x5c5048,_0xf78c('0xb'),JSON[_0xf78c('0xd')](_0x270f3d));if(_0x270f3d[_0xf78c('0xe')]){if(_0x270f3d[_0xf78c('0xe')]['code']===0x1f4){logger[_0xf78c('0xe')](_0xf78c('0xa'),_0x5c5048,_0x270f3d[_0xf78c('0xe')][_0xf78c('0xf')]);return _0x5494aa(_0x270f3d[_0xf78c('0xe')]['message']);}logger[_0xf78c('0xe')]('Setting,\x20%s,\x20%s',_0x5c5048,_0x270f3d['error'][_0xf78c('0xf')]);return _0x2ef499(_0x270f3d[_0xf78c('0xe')][_0xf78c('0xf')]);}else{logger[_0xf78c('0x10')](_0xf78c('0xa'),_0x5c5048,_0xf78c('0xb'));_0x2ef499(_0x270f3d[_0xf78c('0x11')][_0xf78c('0xf')]);}})['catch'](function(_0x2990c6){logger[_0xf78c('0xe')](_0xf78c('0xa'),_0x5c5048,_0x2990c6);_0x5494aa(_0x2990c6);});});}exports[_0xf78c('0x12')]=function(_0x2e5547){var _0x2c95b8=this;return new Promise(function(_0x16607b,_0x559ded){return db[_0xf78c('0x13')][_0xf78c('0x14')]({'raw':_0x2e5547[_0xf78c('0x15')]?_0x2e5547[_0xf78c('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e5547['options']?_0x2e5547['options'][_0xf78c('0x16')]||null:null,'attributes':_0x2e5547[_0xf78c('0x15')]?_0x2e5547[_0xf78c('0x15')][_0xf78c('0x17')]||null:null,'include':_0x2e5547[_0xf78c('0x15')]?_0x2e5547[_0xf78c('0x15')][_0xf78c('0x18')]?_[_0xf78c('0x19')](_0x2e5547[_0xf78c('0x15')]['include'],function(_0x74aef1){return{'model':db[_0x74aef1[_0xf78c('0x1a')]],'as':_0x74aef1['as'],'attributes':_0x74aef1[_0xf78c('0x17')],'include':_0x74aef1['include']?_[_0xf78c('0x19')](_0x74aef1[_0xf78c('0x18')],function(_0x533755){return{'model':db[_0x533755['model']],'as':_0x533755['as'],'attributes':_0x533755[_0xf78c('0x17')],'include':_0x533755['include']?_[_0xf78c('0x19')](_0x533755['include'],function(_0x453ed5){return{'model':db[_0x453ed5[_0xf78c('0x1a')]],'as':_0x453ed5['as'],'attributes':_0x453ed5[_0xf78c('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf78c('0x1b')](function(_0x42c988){logger[_0xf78c('0x10')](_0xf78c('0x12'),_0x2e5547);logger[_0xf78c('0x1c')](_0xf78c('0x12'),_0x2e5547,JSON[_0xf78c('0xd')](_0x42c988));_0x16607b(_0x42c988);})[_0xf78c('0x1d')](function(_0x1eb67c){logger[_0xf78c('0xe')]('ShowSetting',_0x1eb67c[_0xf78c('0xf')],_0x2e5547);_0x559ded(_0x2c95b8[_0xf78c('0xe')](0x1f4,_0x1eb67c[_0xf78c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 6fcb0be..97f0e8b 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0xfa597d,_0xdb36b2){var _0x88d351=function(_0x196ec2){while(--_0x196ec2){_0xfa597d['push'](_0xfa597d['shift']());}};_0x88d351(++_0xdb36b2);}(_0x7a54,0x106));var _0x47a5=function(_0x2a604b,_0x3ded0f){_0x2a604b=_0x2a604b-0x0;var _0xb0e66c=_0x7a54[_0x2a604b];return _0xb0e66c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x59bd6a,_0x540db8){var _0x54ffd0=function(_0x2549d0){while(--_0x2549d0){_0x59bd6a['push'](_0x59bd6a['shift']());}};_0x54ffd0(++_0x540db8);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index e3c129a..b04840e 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 _0x73eb=['clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','ENUM','twilio','skebby','connectel'];(function(_0x14154c,_0x3996de){var _0x239fe9=function(_0x3427f4){while(--_0x3427f4){_0x14154c['push'](_0x14154c['shift']());}};_0x239fe9(++_0x3996de);}(_0x73eb,0x115));var _0xb73e=function(_0x5d3dc2,_0xfe6819){_0x5d3dc2=_0x5d3dc2-0x0;var _0x354a65=_0x73eb[_0x5d3dc2];return _0x354a65;};'use strict';var Sequelize=require(_0xb73e('0x0'));var rs=require('randomstring');module[_0xb73e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb73e('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb73e('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xb73e('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb73e('0x3')]},'type':{'type':Sequelize[_0xb73e('0x4')](_0xb73e('0x5'),_0xb73e('0x6'),_0xb73e('0x7'),_0xb73e('0x8'),'plivo',_0xb73e('0x9'),_0xb73e('0xa'),_0xb73e('0xb'),_0xb73e('0xc'),_0xb73e('0xd'))},'accountSid':{'type':Sequelize[_0xb73e('0x3')]},'authId':{'type':Sequelize[_0xb73e('0x3')]},'authToken':{'type':Sequelize[_0xb73e('0x3')]},'smsMethod':{'type':Sequelize[_0xb73e('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb73e('0x3')]},'password':{'type':Sequelize[_0xb73e('0x3')]},'apiKey':{'type':Sequelize[_0xb73e('0x3')]},'applicationId':{'type':Sequelize[_0xb73e('0x3')]},'accountId':{'type':Sequelize[_0xb73e('0x3')]},'senderString':{'type':Sequelize[_0xb73e('0x3')]},'deliveryReport':{'type':Sequelize[_0xb73e('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xb73e('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb73e('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb73e('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb73e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb73e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb73e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb73e('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb73e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb73e('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb73e('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb73e('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4c3534){if(!_0x4c3534)this[_0xb73e('0x10')](_0xb73e('0x11'),null);this[_0xb73e('0x10')](_0xb73e('0x12'),_0x4c3534);}}}; \ No newline at end of file +var _0x927f=['mandatoryDisposition','exports','STRING','name','generate','ENUM','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x927f,0xbe));var _0xf927=function(_0x3a1227,_0x10c43e){_0x3a1227=_0x3a1227-0x0;var _0x5d39bb=_0x927f[_0x3a1227];return _0x5d39bb;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xf927('0x0')]={'name':{'type':Sequelize[_0xf927('0x1')],'unique':_0xf927('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xf927('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xf927('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xf927('0x1')],'defaultValue':function(){return rs[_0xf927('0x3')]();}},'phone':{'type':Sequelize[_0xf927('0x1')]},'type':{'type':Sequelize[_0xf927('0x4')]('twilio',_0xf927('0x5'),_0xf927('0x6'),_0xf927('0x7'),'plivo',_0xf927('0x8'),_0xf927('0x9'),_0xf927('0xa'),_0xf927('0xb'),_0xf927('0xc'))},'accountSid':{'type':Sequelize[_0xf927('0x1')]},'authId':{'type':Sequelize[_0xf927('0x1')]},'authToken':{'type':Sequelize[_0xf927('0x1')]},'smsMethod':{'type':Sequelize[_0xf927('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf927('0x1')]},'apiKey':{'type':Sequelize[_0xf927('0x1')]},'applicationId':{'type':Sequelize[_0xf927('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf927('0x1')]},'notificationTemplate':{'type':Sequelize[_0xf927('0xd')],'defaultValue':function(){return _0xf927('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf927('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf927('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf927('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf927('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf927('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf927('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf927('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf927('0x10')],'comment':_0xf927('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xf927('0xf')],'defaultValue':![],'comment':_0xf927('0x12'),'set':function(_0x5207a2){if(!_0x5207a2)this[_0xf927('0x13')]('mandatoryDispositionPauseId',null);this[_0xf927('0x13')](_0xf927('0x14'),_0x5207a2);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index c69b37d..2c57f4c 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 _0x211e=['filter','where','merge','VIRTUAL','options','SmsAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','CannedAnswer','removeAnswers','notify','sms','Applications','account','orderBy','priority','asc','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','twilio','From','Body','messageId','skebby','from','sender','text','connectel','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','SmsInteraction','spread','interaction','created','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','waitForTheAssignedAgent','queueId','queue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','Content-Type','text/xml','addApplications','sequelize','transaction','READ_COMMITTED','SmsApplication','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','internal','color','tag','to\x20is\x20mandatory','List','defaults','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','redif','DELIVERED','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','ids','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort'];(function(_0x54ac3c,_0x5d71d4){var _0x49b5f1=function(_0x165e75){while(--_0x165e75){_0x54ac3c['push'](_0x54ac3c['shift']());}};_0x49b5f1(++_0x5d71d4);}(_0x211e,0x180));var _0xe211=function(_0x4f7db6,_0x461baa){_0x4f7db6=_0x4f7db6-0x0;var _0x2aae7e=_0x211e[_0x4f7db6];return _0x2aae7e;};'use strict';var emlformat=require(_0xe211('0x0'));var rimraf=require(_0xe211('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe211('0x2'));var rp=require('request-promise');var moment=require(_0xe211('0x3'));var BPromise=require(_0xe211('0x4'));var Mustache=require(_0xe211('0x5'));var util=require(_0xe211('0x6'));var path=require(_0xe211('0x7'));var sox=require(_0xe211('0x8'));var csv=require(_0xe211('0x9'));var ejs=require(_0xe211('0xa'));var fs=require('fs');var fs_extra=require(_0xe211('0xb'));var _=require(_0xe211('0xc'));var squel=require(_0xe211('0xd'));var crypto=require(_0xe211('0xe'));var jsforce=require(_0xe211('0xf'));var deskjs=require(_0xe211('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe211('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe211('0x12'));var as=require(_0xe211('0x13'));var hardwareService=require(_0xe211('0x14'));var logger=require(_0xe211('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe211('0x16'));var licenseUtil=require(_0xe211('0x17'));var db=require(_0xe211('0x18'))['db'];config[_0xe211('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe211('0x1a'))(new Redis(config['redis']));require(_0xe211('0x1b'))[_0xe211('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2dbec5,_0x13a7fb,_0x4f4d78,_0x17c292){return new BPromise(function(_0x5e4eb8,_0x46454f){var _0x1ea248=_0x17c292||client;return _0x1ea248['request'](_0x2dbec5,_0x4f4d78)[_0xe211('0x1d')](function(_0x6595f2){logger[_0xe211('0x1e')](_0xe211('0x1f'),_0x13a7fb,_0xe211('0x20'));logger[_0xe211('0x21')](_0xe211('0x22'),_0x13a7fb,_0xe211('0x20'),JSON['stringify'](_0x6595f2));if(_0x6595f2[_0xe211('0x23')]){if(_0x6595f2[_0xe211('0x23')][_0xe211('0x24')]===0x1f4){logger[_0xe211('0x23')]('SmsAccount,\x20%s,\x20%s',_0x13a7fb,_0x6595f2[_0xe211('0x23')]['message']);return _0x46454f(_0x6595f2[_0xe211('0x23')][_0xe211('0x25')]);}logger['error'](_0xe211('0x1f'),_0x13a7fb,_0x6595f2[_0xe211('0x23')]['message']);return _0x5e4eb8(_0x6595f2[_0xe211('0x23')]['message']);}else{logger[_0xe211('0x1e')](_0xe211('0x1f'),_0x13a7fb,_0xe211('0x20'));_0x5e4eb8(_0x6595f2['result']['message']);}})['catch'](function(_0xf9d3cb){logger[_0xe211('0x23')](_0xe211('0x1f'),_0x13a7fb,_0xf9d3cb);_0x46454f(_0xf9d3cb);});});}function respondWithStatusCode(_0x99f68a,_0x46650f){_0x46650f=_0x46650f||0xcc;return function(_0x5a9b65){if(_0x5a9b65){return _0x99f68a[_0xe211('0x26')](_0x46650f);}return _0x99f68a['status'](_0x46650f)[_0xe211('0x27')]();};}function respondWithResult(_0x526fd7,_0x318a45){_0x318a45=_0x318a45||0xc8;return function(_0x5eec02){if(_0x5eec02){return _0x526fd7[_0xe211('0x28')](_0x318a45)[_0xe211('0x29')](_0x5eec02);}};}function respondWithFilteredResult(_0x4f28c3,_0x1d7bbf){return function(_0x40744d){if(_0x40744d){var _0x3f44a8=typeof _0x1d7bbf['offset']===_0xe211('0x2a')&&typeof _0x1d7bbf['limit']===_0xe211('0x2a');var _0x18f0b8=_0x40744d[_0xe211('0x2b')];var _0x3c6fdc=_0x3f44a8?0x0:_0x1d7bbf['offset'];var _0x53fc39=_0x3f44a8?_0x40744d[_0xe211('0x2b')]:_0x1d7bbf[_0xe211('0x2c')]+_0x1d7bbf[_0xe211('0x2d')];var _0x588c0c;if(_0x53fc39>=_0x18f0b8){_0x53fc39=_0x18f0b8;_0x588c0c=0xc8;}else{_0x588c0c=0xce;}_0x4f28c3[_0xe211('0x28')](_0x588c0c);return _0x4f28c3['set'](_0xe211('0x2e'),_0x3c6fdc+'-'+_0x53fc39+'/'+_0x18f0b8)[_0xe211('0x29')](_0x40744d);}return null;};}function patchUpdates(_0x842dab){return function(_0x5e150f){try{jsonpatch['apply'](_0x5e150f,_0x842dab,!![]);}catch(_0x2a12e9){return BPromise[_0xe211('0x2f')](_0x2a12e9);}return _0x5e150f[_0xe211('0x30')]();};}function saveUpdates(_0x45e7d1,_0x529892){return function(_0xfb4e88){if(_0xfb4e88){return _0xfb4e88[_0xe211('0x31')](_0x45e7d1)['then'](function(_0x24b339){return _0x24b339;});}return null;};}function removeEntity(_0x2175aa,_0x4ca13b){return function(_0x5be671){if(_0x5be671){return _0x5be671['destroy']()[_0xe211('0x1d')](function(){var _0x3e4275=_0x5be671[_0xe211('0x32')]({'plain':!![]});var _0x195548=_0xe211('0x33');return db[_0xe211('0x34')][_0xe211('0x35')]({'where':{'type':_0x195548,'resourceId':_0x3e4275['id']}})['then'](function(){return _0x5be671;});})['then'](function(){_0x2175aa[_0xe211('0x28')](0xcc)[_0xe211('0x27')]();});}};}function handleEntityNotFound(_0x162f7c,_0x296242){return function(_0xb6b86){if(!_0xb6b86){_0x162f7c['sendStatus'](0x194);}return _0xb6b86;};}function handleError(_0x3b6118,_0x25cf71){_0x25cf71=_0x25cf71||0x1f4;return function(_0x635d6f){logger['error'](_0x635d6f['stack']);if(_0x635d6f['name']){delete _0x635d6f[_0xe211('0x36')];}_0x3b6118[_0xe211('0x28')](_0x25cf71)[_0xe211('0x37')](_0x635d6f);};}exports[_0xe211('0x38')]=function(_0x1b20fc,_0x15b26d){var _0x6ab71a={'include':[{'model':db[_0xe211('0x39')],'as':_0xe211('0x3a')}]},_0x1a8d67={},_0x4d2693={'count':0x0,'rows':[]};var _0x53a2e5=_[_0xe211('0x3b')](db['SmsAccount'][_0xe211('0x3c')],function(_0x49f049){return{'name':_0x49f049['fieldName'],'type':_0x49f049[_0xe211('0x3d')][_0xe211('0x3e')]};});_0x1a8d67['model']=_[_0xe211('0x3b')](_0x53a2e5,_0xe211('0x36'));_0x1a8d67[_0xe211('0x3f')]=_[_0xe211('0x40')](_0x1b20fc[_0xe211('0x3f')]);_0x1a8d67[_0xe211('0x41')]=_[_0xe211('0x42')](_0x1a8d67[_0xe211('0x43')],_0x1a8d67[_0xe211('0x3f')]);_0x6ab71a[_0xe211('0x44')]=_['intersection'](_0x1a8d67['model'],qs[_0xe211('0x45')](_0x1b20fc[_0xe211('0x3f')][_0xe211('0x45')]));_0x6ab71a[_0xe211('0x44')]=_0x6ab71a[_0xe211('0x44')][_0xe211('0x46')]?_0x6ab71a[_0xe211('0x44')]:_0x1a8d67[_0xe211('0x43')];if(!_0x1b20fc[_0xe211('0x3f')]['hasOwnProperty'](_0xe211('0x47'))){_0x6ab71a[_0xe211('0x2d')]=qs[_0xe211('0x2d')](_0x1b20fc[_0xe211('0x3f')][_0xe211('0x2d')]);_0x6ab71a[_0xe211('0x2c')]=qs['offset'](_0x1b20fc[_0xe211('0x3f')][_0xe211('0x2c')]);}_0x6ab71a[_0xe211('0x48')]=qs[_0xe211('0x49')](_0x1b20fc[_0xe211('0x3f')][_0xe211('0x49')]);_0x6ab71a['where']=qs['filters'](_['pick'](_0x1b20fc[_0xe211('0x3f')],_0x1a8d67[_0xe211('0x41')]),_0x53a2e5);if(_0x1b20fc[_0xe211('0x3f')][_0xe211('0x4a')]){_0x6ab71a[_0xe211('0x4b')]=_[_0xe211('0x4c')](_0x6ab71a[_0xe211('0x4b')],{'$or':_[_0xe211('0x3b')](_0x53a2e5,function(_0x56b594){if(_0x56b594['type']!==_0xe211('0x4d')){var _0x1d3aac={};_0x1d3aac[_0x56b594[_0xe211('0x36')]]={'$like':'%'+_0x1b20fc[_0xe211('0x3f')][_0xe211('0x4a')]+'%'};return _0x1d3aac;}})});}_0x6ab71a=_[_0xe211('0x4c')]({},_0x6ab71a,_0x1b20fc[_0xe211('0x4e')]);var _0x4c6d24={'where':_0x6ab71a[_0xe211('0x4b')]};return db[_0xe211('0x4f')]['count'](_0x4c6d24)['then'](function(_0x5b93d3){_0x4d2693['count']=_0x5b93d3;if(_0x1b20fc[_0xe211('0x3f')]['includeAll']){_0x6ab71a[_0xe211('0x50')]=[{'all':!![]}];}return db[_0xe211('0x4f')][_0xe211('0x51')](_0x6ab71a);})[_0xe211('0x1d')](function(_0x41e307){_0x4d2693[_0xe211('0x52')]=_0x41e307;return _0x4d2693;})[_0xe211('0x1d')](respondWithFilteredResult(_0x15b26d,_0x6ab71a))[_0xe211('0x53')](handleError(_0x15b26d,null));};exports[_0xe211('0x54')]=function(_0xee53d1,_0x5cdcc5){var _0x1a628c={'raw':![],'where':{'id':_0xee53d1[_0xe211('0x55')]['id']},'include':[{'model':db[_0xe211('0x39')],'as':'mandatoryDispositionPause'}]},_0x4c6aa3={};_0x4c6aa3[_0xe211('0x43')]=_['keys'](db[_0xe211('0x4f')][_0xe211('0x3c')]);_0x4c6aa3[_0xe211('0x3f')]=_[_0xe211('0x40')](_0xee53d1[_0xe211('0x3f')]);_0x4c6aa3[_0xe211('0x41')]=_[_0xe211('0x42')](_0x4c6aa3['model'],_0x4c6aa3[_0xe211('0x3f')]);_0x1a628c['attributes']=_['intersection'](_0x4c6aa3[_0xe211('0x43')],qs[_0xe211('0x45')](_0xee53d1[_0xe211('0x3f')][_0xe211('0x45')]));_0x1a628c[_0xe211('0x44')]=_0x1a628c['attributes'][_0xe211('0x46')]?_0x1a628c[_0xe211('0x44')]:_0x4c6aa3[_0xe211('0x43')];if(_0xee53d1['query'][_0xe211('0x56')]){_0x1a628c['include']=[{'all':!![]}];}_0x1a628c=_['merge']({},_0x1a628c,_0xee53d1['options']);return db[_0xe211('0x4f')][_0xe211('0x57')](_0x1a628c)[_0xe211('0x1d')](handleEntityNotFound(_0x5cdcc5,null))[_0xe211('0x1d')](respondWithResult(_0x5cdcc5,null))[_0xe211('0x53')](handleError(_0x5cdcc5,null));};exports[_0xe211('0x58')]=function(_0x5ae377,_0x5a5379){return db[_0xe211('0x4f')][_0xe211('0x58')](_0x5ae377[_0xe211('0x59')],{})['then'](function(_0x26f2ef){var _0x38a7f4=_0x5ae377['user']['get']({'plain':!![]});if(!_0x38a7f4)throw new Error(_0xe211('0x5a'));if(_0x38a7f4['role']===_0xe211('0x5b')){var _0x312bea=_0x26f2ef['get']({'plain':!![]});var _0x4233f4='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x4233f4,'userProfileId':_0x38a7f4[_0xe211('0x5c')]},'raw':!![]})[_0xe211('0x1d')](function(_0x1ad81d){if(_0x1ad81d&&_0x1ad81d[_0xe211('0x5d')]===0x0){return db['UserProfileResource'][_0xe211('0x58')]({'name':_0x312bea[_0xe211('0x36')],'resourceId':_0x312bea['id'],'type':_0x1ad81d[_0xe211('0x36')],'sectionId':_0x1ad81d['id']},{})[_0xe211('0x1d')](function(){return _0x26f2ef;});}else{return _0x26f2ef;}})[_0xe211('0x53')](function(_0x27ec24){logger['error'](_0xe211('0x5e'),_0x27ec24);throw _0x27ec24;});}return _0x26f2ef;})[_0xe211('0x1d')](respondWithResult(_0x5a5379,0xc9))[_0xe211('0x53')](handleError(_0x5a5379,null));};exports[_0xe211('0x31')]=function(_0x32ed27,_0x2d1d9e){if(_0x32ed27[_0xe211('0x59')]['id']){delete _0x32ed27[_0xe211('0x59')]['id'];}return db['SmsAccount'][_0xe211('0x57')]({'where':{'id':_0x32ed27[_0xe211('0x55')]['id']},'include':[{'model':db[_0xe211('0x39')],'as':_0xe211('0x3a')}]})['then'](handleEntityNotFound(_0x2d1d9e,null))['then'](saveUpdates(_0x32ed27[_0xe211('0x59')],null))[_0xe211('0x1d')](respondWithResult(_0x2d1d9e,null))[_0xe211('0x53')](handleError(_0x2d1d9e,null));};exports['destroy']=function(_0x462959,_0x17eefc){return db[_0xe211('0x4f')][_0xe211('0x57')]({'where':{'id':_0x462959[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x17eefc,null))[_0xe211('0x1d')](removeEntity(_0x17eefc,null))[_0xe211('0x53')](handleError(_0x17eefc,null));};exports['describe']=function(_0x306f1a,_0x3df80a){return db[_0xe211('0x4f')]['describe']()[_0xe211('0x1d')](respondWithResult(_0x3df80a,null))['catch'](handleError(_0x3df80a,null));};exports[_0xe211('0x5f')]=function(_0x482c34,_0x237133,_0xbb60ca){if(_0x482c34[_0xe211('0x59')]['id']){delete _0x482c34[_0xe211('0x59')]['id'];}return db[_0xe211('0x4f')][_0xe211('0x57')]({'where':{'id':_0x482c34[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x237133,null))[_0xe211('0x1d')](function(_0xea2631){if(_0xea2631){_0x482c34[_0xe211('0x59')][_0xe211('0x60')]=_0xea2631['id'];return db[_0xe211('0x61')][_0xe211('0x58')](_0x482c34[_0xe211('0x59')]);}})[_0xe211('0x1d')](respondWithResult(_0x237133,null))[_0xe211('0x53')](handleError(_0x237133,null));};exports[_0xe211('0x62')]=function(_0x3a33b8,_0x2ee265,_0x40f45d){var _0x51d628={'raw':![],'where':{}};var _0xd71449={};var _0x1de44c={'count':0x0,'rows':[]};return db[_0xe211('0x4f')][_0xe211('0x63')]({'where':{'id':_0x3a33b8[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x2ee265,null))[_0xe211('0x1d')](function(_0x5a49a4){if(_0x5a49a4){_0xd71449[_0xe211('0x43')]=_['keys'](db['Disposition'][_0xe211('0x3c')]);_0xd71449[_0xe211('0x3f')]=_[_0xe211('0x40')](_0x3a33b8['query']);_0xd71449[_0xe211('0x41')]=_[_0xe211('0x42')](_0xd71449[_0xe211('0x43')],_0xd71449[_0xe211('0x3f')]);_0x51d628['attributes']=_[_0xe211('0x42')](_0xd71449[_0xe211('0x43')],qs[_0xe211('0x45')](_0x3a33b8[_0xe211('0x3f')][_0xe211('0x45')]));_0x51d628[_0xe211('0x44')]=_0x51d628[_0xe211('0x44')][_0xe211('0x46')]?_0x51d628[_0xe211('0x44')]:_0xd71449[_0xe211('0x43')];if(!_0x3a33b8[_0xe211('0x3f')][_0xe211('0x64')](_0xe211('0x47'))){_0x51d628[_0xe211('0x2d')]=qs[_0xe211('0x2d')](_0x3a33b8['query'][_0xe211('0x2d')]);_0x51d628['offset']=qs[_0xe211('0x2c')](_0x3a33b8[_0xe211('0x3f')][_0xe211('0x2c')]);}_0x51d628[_0xe211('0x48')]=qs[_0xe211('0x49')](_0x3a33b8[_0xe211('0x3f')][_0xe211('0x49')]);_0x51d628['where']=qs[_0xe211('0x41')](_[_0xe211('0x65')](_0x3a33b8['query'],_0xd71449[_0xe211('0x41')]));_0x51d628[_0xe211('0x4b')][_0xe211('0x60')]=_0x5a49a4['id'];if(_0x3a33b8[_0xe211('0x3f')]['filter']){_0x51d628['where']=_[_0xe211('0x4c')](_0x51d628[_0xe211('0x4b')],{'$or':_[_0xe211('0x3b')](_0x51d628[_0xe211('0x44')],function(_0x5c216b){var _0x46032c={};_0x46032c[_0x5c216b]={'$like':'%'+_0x3a33b8['query'][_0xe211('0x4a')]+'%'};return _0x46032c;})});}_0x51d628=_[_0xe211('0x4c')]({},_0x51d628,_0x3a33b8[_0xe211('0x4e')]);return db[_0xe211('0x61')][_0xe211('0x2b')]({'where':_0x51d628['where']})[_0xe211('0x1d')](function(_0x449e2a){_0x1de44c['count']=_0x449e2a;if(_0x3a33b8[_0xe211('0x3f')][_0xe211('0x56')]){_0x51d628['include']=[{'all':!![]}];}return db[_0xe211('0x61')]['findAll'](_0x51d628);})[_0xe211('0x1d')](function(_0x3102eb){_0x1de44c[_0xe211('0x52')]=_0x3102eb;return _0x1de44c;});}})['then'](respondWithFilteredResult(_0x2ee265,_0x51d628))[_0xe211('0x53')](handleError(_0x2ee265,null));};exports[_0xe211('0x66')]=function(_0x50389c,_0x5b40cc,_0x436f31){return db[_0xe211('0x4f')][_0xe211('0x57')]({'where':{'id':_0x50389c['params']['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x5b40cc,null))[_0xe211('0x1d')](function(_0x5298ec){if(_0x5298ec){return _0x5298ec[_0xe211('0x66')](_0x50389c[_0xe211('0x3f')]['ids']);}})[_0xe211('0x1d')](respondWithStatusCode(_0x5b40cc,null))[_0xe211('0x53')](handleError(_0x5b40cc,null));};exports['addAnswer']=function(_0x4ce15b,_0x2a881b,_0x572f7d){if(_0x4ce15b[_0xe211('0x59')]['id']){delete _0x4ce15b[_0xe211('0x59')]['id'];}return db[_0xe211('0x4f')]['find']({'where':{'id':_0x4ce15b[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x2a881b,null))[_0xe211('0x1d')](function(_0x4130ca){if(_0x4130ca){_0x4ce15b[_0xe211('0x59')][_0xe211('0x60')]=_0x4130ca['id'];return db[_0xe211('0x67')]['create'](_0x4ce15b['body']);}})[_0xe211('0x1d')](respondWithResult(_0x2a881b,null))['catch'](handleError(_0x2a881b,null));};exports['getAnswers']=function(_0x43d5a3,_0x95bfb7,_0x246925){var _0x653929={'raw':![],'where':{}};var _0x3b1cf8={};var _0x5cef17={'count':0x0,'rows':[]};return db['SmsAccount'][_0xe211('0x63')]({'where':{'id':_0x43d5a3[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x95bfb7,null))[_0xe211('0x1d')](function(_0x55c7bf){if(_0x55c7bf){_0x3b1cf8[_0xe211('0x43')]=_[_0xe211('0x40')](db[_0xe211('0x67')]['rawAttributes']);_0x3b1cf8[_0xe211('0x3f')]=_['keys'](_0x43d5a3[_0xe211('0x3f')]);_0x3b1cf8['filters']=_['intersection'](_0x3b1cf8[_0xe211('0x43')],_0x3b1cf8[_0xe211('0x3f')]);_0x653929[_0xe211('0x44')]=_[_0xe211('0x42')](_0x3b1cf8[_0xe211('0x43')],qs[_0xe211('0x45')](_0x43d5a3['query'][_0xe211('0x45')]));_0x653929[_0xe211('0x44')]=_0x653929['attributes'][_0xe211('0x46')]?_0x653929[_0xe211('0x44')]:_0x3b1cf8[_0xe211('0x43')];if(!_0x43d5a3[_0xe211('0x3f')]['hasOwnProperty'](_0xe211('0x47'))){_0x653929[_0xe211('0x2d')]=qs[_0xe211('0x2d')](_0x43d5a3['query']['limit']);_0x653929[_0xe211('0x2c')]=qs['offset'](_0x43d5a3['query'][_0xe211('0x2c')]);}_0x653929['order']=qs[_0xe211('0x49')](_0x43d5a3[_0xe211('0x3f')]['sort']);_0x653929[_0xe211('0x4b')]=qs[_0xe211('0x41')](_['pick'](_0x43d5a3['query'],_0x3b1cf8[_0xe211('0x41')]));_0x653929['where']['SmsAccountId']=_0x55c7bf['id'];if(_0x43d5a3['query']['filter']){_0x653929[_0xe211('0x4b')]=_[_0xe211('0x4c')](_0x653929[_0xe211('0x4b')],{'$or':_[_0xe211('0x3b')](_0x653929[_0xe211('0x44')],function(_0x419f25){var _0x4a8cfc={};_0x4a8cfc[_0x419f25]={'$like':'%'+_0x43d5a3['query'][_0xe211('0x4a')]+'%'};return _0x4a8cfc;})});}_0x653929=_['merge']({},_0x653929,_0x43d5a3['options']);return db[_0xe211('0x67')]['count']({'where':_0x653929[_0xe211('0x4b')]})[_0xe211('0x1d')](function(_0x5ace41){_0x5cef17['count']=_0x5ace41;if(_0x43d5a3[_0xe211('0x3f')]['includeAll']){_0x653929['include']=[{'all':!![]}];}return db[_0xe211('0x67')]['findAll'](_0x653929);})[_0xe211('0x1d')](function(_0x2379f7){_0x5cef17['rows']=_0x2379f7;return _0x5cef17;});}})[_0xe211('0x1d')](respondWithFilteredResult(_0x95bfb7,_0x653929))[_0xe211('0x53')](handleError(_0x95bfb7,null));};exports[_0xe211('0x68')]=function(_0x275c96,_0x476bd0,_0x5abcde){return db[_0xe211('0x4f')][_0xe211('0x57')]({'where':{'id':_0x275c96[_0xe211('0x55')]['id']}})['then'](handleEntityNotFound(_0x476bd0,null))[_0xe211('0x1d')](function(_0x44ab21){if(_0x44ab21){return _0x44ab21[_0xe211('0x68')](_0x275c96[_0xe211('0x3f')]['ids']);}})[_0xe211('0x1d')](respondWithStatusCode(_0x476bd0,null))[_0xe211('0x53')](handleError(_0x476bd0,null));};exports[_0xe211('0x69')]=function(_0x4a7aaa,_0x19496d,_0x36907d){var _0x104922={'channel':_0xe211('0x6a')};var _0x265f99=[];var _0x4ebe7d=[];var _0x8f8829={};return db[_0xe211('0x4f')][_0xe211('0x57')]({'where':{'id':_0x4a7aaa[_0xe211('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xe211('0x6b')}]})[_0xe211('0x1d')](handleEntityNotFound(_0x19496d,null))[_0xe211('0x1d')](function(_0x500511){_0x104922[_0xe211('0x6c')]=_0x500511;_0x104922['applications']=_[_0xe211('0x6d')](_0x500511[_0xe211('0x6b')],[_0xe211('0x6e')],[_0xe211('0x6f')]);if(_0x104922['account'][_0xe211('0x6b')]){delete _0x104922[_0xe211('0x6c')][_0xe211('0x6b')];}return db[_0xe211('0x70')][_0xe211('0x71')]();})['then'](function(_0x4fbe14){if(!_0x4fbe14){throw new db[(_0xe211('0x72'))][(_0xe211('0x73'))](_0xe211('0x74'));}_0x265f99=_['difference'](_[_0xe211('0x40')](_0x4fbe14),['createdAt',_0xe211('0x75')]);_0x4ebe7d=_[_0xe211('0x76')](_['keys'](_0x4fbe14),[_0xe211('0x77'),_0xe211('0x75'),_0xe211('0x78'),_0xe211('0x79')]);_0x104922['body']={'mapKey':'mobile'};if(_0x104922[_0xe211('0x6c')]['type']){switch(_0x104922['account'][_0xe211('0x3d')]){case _0xe211('0x7a'):_0x104922[_0xe211('0x59')]['from']=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x7b')];_0x104922[_0xe211('0x59')]['body']=_0x4a7aaa['body'][_0xe211('0x7c')];_0x104922[_0xe211('0x59')][_0xe211('0x7d')]=_0x4a7aaa[_0xe211('0x59')]['MessageSid'];break;case _0xe211('0x7e'):_0x104922[_0xe211('0x59')][_0xe211('0x7f')]='+'+_0x4a7aaa['body'][_0xe211('0x80')];_0x104922[_0xe211('0x59')][_0xe211('0x59')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x81')];break;case _0xe211('0x82'):_0x104922[_0xe211('0x59')][_0xe211('0x7f')]=_0x4a7aaa[_0xe211('0x59')]['from'];_0x104922['body']['body']=_0x4a7aaa[_0xe211('0x59')]['message'];break;case'clicksend':_0x104922['body']['from']=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x7f')];_0x104922[_0xe211('0x59')][_0xe211('0x59')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x59')];_0x104922[_0xe211('0x59')][_0xe211('0x7d')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x83')];break;case'plivo':_0x104922[_0xe211('0x59')][_0xe211('0x7f')]=_0x4a7aaa[_0xe211('0x59')]['From'];_0x104922[_0xe211('0x59')][_0xe211('0x59')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x84')];_0x104922[_0xe211('0x59')][_0xe211('0x7d')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x85')];break;case _0xe211('0x86'):_0x104922['body'][_0xe211('0x7f')]='+'+_0x4a7aaa[_0xe211('0x59')][_0xe211('0x87')][0x0][_0xe211('0x7f')];_0x104922[_0xe211('0x59')][_0xe211('0x59')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x87')][0x0][_0xe211('0x81')];_0x104922['body'][_0xe211('0x7d')]=_0x4a7aaa[_0xe211('0x59')]['results'][0x0][_0xe211('0x7d')];break;case _0xe211('0x88'):_0x104922[_0xe211('0x59')][_0xe211('0x7f')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x89')];_0x104922[_0xe211('0x59')]['body']=_0x4a7aaa[_0xe211('0x59')]['segmentedMessage'][_0xe211('0x25')];break;case _0xe211('0x8a'):_0x104922[_0xe211('0x59')][_0xe211('0x7f')]=_0x4a7aaa[_0xe211('0x59')][_0xe211('0x8b')];_0x104922[_0xe211('0x59')]['body']=_0x4a7aaa['body'][_0xe211('0x81')];_0x104922[_0xe211('0x59')]['messageId']=_0x4a7aaa['body'][_0xe211('0x8c')];break;case _0xe211('0x8d'):_0x104922[_0xe211('0x59')][_0xe211('0x7d')]=_0x4a7aaa[_0xe211('0x59')][0x0][_0xe211('0x25')]['id'];_0x104922[_0xe211('0x59')][_0xe211('0x7f')]=_0x4a7aaa[_0xe211('0x59')][0x0]['message'][_0xe211('0x7f')];_0x104922[_0xe211('0x59')]['body']=_0x4a7aaa['body'][0x0][_0xe211('0x25')][_0xe211('0x81')];break;case _0xe211('0x8e'):_0x104922['body']['from']=_0x4a7aaa['body']['from'];_0x104922[_0xe211('0x59')][_0xe211('0x59')]=_0x4a7aaa['body'][_0xe211('0x25')];_0x104922[_0xe211('0x59')]['messageId']=_0x4a7aaa['body'][_0xe211('0x8f')];break;}}if(_0x104922[_0xe211('0x59')]['id']){delete _0x104922[_0xe211('0x59')]['id'];}if(_[_0xe211('0x90')](_0x104922[_0xe211('0x59')]['from'])){throw new db[(_0xe211('0x72'))][(_0xe211('0x73'))](_0xe211('0x91'));}if(_[_0xe211('0x90')](_0x104922['body']['body'])||_0x104922['body'][_0xe211('0x59')]===''){throw new db[(_0xe211('0x72'))][(_0xe211('0x73'))](_0xe211('0x92'));}if(_[_0xe211('0x90')](_0x104922['body'][_0xe211('0x93')])){throw new db['Sequelize']['ValidationError'](_0xe211('0x94')+_0x4ebe7d);}if(!_[_0xe211('0x95')](_0x4ebe7d,_0x104922[_0xe211('0x59')][_0xe211('0x93')])){throw new db[(_0xe211('0x72'))]['ValidationError'](_0xe211('0x96')+_0x4ebe7d);}_0x8f8829[_0x104922[_0xe211('0x59')][_0xe211('0x93')]]=_0x104922[_0xe211('0x59')][_0xe211('0x7f')];return db[_0xe211('0x97')]['find']({'where':{'id':_0x104922[_0xe211('0x6c')][_0xe211('0x79')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x8f8829,'limit':0x1,'order':[['updatedAt',_0xe211('0x98')]]}]});})[_0xe211('0x1d')](handleEntityNotFound(_0x19496d,null))[_0xe211('0x1d')](function(_0x4fa960){if(_0x4fa960){_0x104922[_0xe211('0x99')]=_['omit'](_0x4fa960,[_0xe211('0x9a')]);if(_0x4fa960[_0xe211('0x9a')][_0xe211('0x46')]){return _0x4fa960[_0xe211('0x9a')][0x0];}var _0x19a8bd=_['defaults'](_0x104922['body'],{'firstName':_0x104922['body'][_0xe211('0x7f')],'ListId':_0x4fa960['id']});_0x19a8bd[_0x104922['body'][_0xe211('0x93')]]=_0x104922[_0xe211('0x59')]['from'];return db[_0xe211('0x70')][_0xe211('0x58')](_0x19a8bd,{'fields':_0x265f99,'raw':!![]});}})['then'](handleEntityNotFound(_0x19496d,null))[_0xe211('0x1d')](function(_0xe80886){if(_0xe80886){_0x104922[_0xe211('0x9b')]=_0xe80886;var _0x146c8={'ContactId':_0xe80886['id'],'phone':_0x104922[_0xe211('0x59')][_0xe211('0x7f')],'SmsAccountId':_0x4a7aaa['params']['id']};var _0x393df9={'ContactId':_0xe80886['id'],'SmsAccountId':_0x4a7aaa[_0xe211('0x55')]['id'],'closed':![]};return db[_0xe211('0x9c')][_0xe211('0x57')]({'where':_0x393df9})[_0xe211('0x1d')](function(_0x2542a8){if(_0x2542a8){return[_0x2542a8,![]];}return db[_0xe211('0x9c')][_0xe211('0x58')](_0x146c8)[_0xe211('0x1d')](function(_0x51ea28){return[_0x51ea28,!![]];});});}})[_0xe211('0x9d')](function(_0x4b2289,_0xae5e3a){_0x104922[_0xe211('0x9e')]=_0x4b2289[_0xe211('0x32')]({'plain':!![]});_0x104922[_0xe211('0x9e')][_0xe211('0x9f')]=![];if(_0xae5e3a){if(_0x104922[_0xe211('0x6c')]['autoclose']){_0x104922[_0xe211('0xa0')][_0xe211('0xa1')]({'id':0x0,'priority':_0x104922[_0xe211('0xa0')]['length']+0x1,'app':_0xe211('0xa2'),'appdata':_0xe211('0xa3'),'interval':_0xe211('0xa4')});}_0x104922[_0xe211('0x9e')][_0xe211('0x9f')]=!![];}return db[_0xe211('0xa5')][_0xe211('0x58')]({'phone':_0x104922[_0xe211('0x59')]['from'],'messageId':_0x104922[_0xe211('0x59')][_0xe211('0x7d')],'body':_0x104922[_0xe211('0x59')][_0xe211('0x59')],'SmsAccountId':_0x4a7aaa['params']['id'],'SmsInteractionId':_0x4b2289['id'],'direction':'in','ContactId':_0x4b2289[_0xe211('0xa6')],'AttachmentId':_0x104922['body']['AttachmentId']});})[_0xe211('0x1d')](function(_0x1af654){_0x104922[_0xe211('0x25')]=_0x1af654;if(!_0x104922[_0xe211('0x9e')][_0xe211('0xa7')])return;return db[_0xe211('0xa8')][_0xe211('0x57')]({'attributes':['id',_0xe211('0x36')],'where':{'id':_0x104922['interaction'][_0xe211('0xa7')]}});})[_0xe211('0x1d')](function(_0x19b92d){if(_0x19b92d){_0x104922['applications'][_0xe211('0xa9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x19b92d[_0xe211('0x36')]+','+(_0x104922[_0xe211('0x6c')][_0xe211('0xaa')]||0xa),'interval':_0xe211('0xa4')});}if(!_0x104922[_0xe211('0x9e')]['queueId'])return;return db['SmsQueue']['find']({'attributes':['id',_0xe211('0x36')],'where':{'id':_0x104922[_0xe211('0x9e')][_0xe211('0xab')]}});})['then'](function(_0xcc2ac3){if(_0xcc2ac3){_0x104922[_0xe211('0xa0')][_0xe211('0xa9')]({'id':0x0,'priority':0x1,'app':_0xe211('0xac'),'appdata':_0xcc2ac3[_0xe211('0x36')]+','+(_0x104922[_0xe211('0x6c')]['waitForTheAssignedQueue']||0x12c),'interval':_0xe211('0xa4')});}return respondWithRpcPromise(_0xe211('0xad'),_0xe211('0xae'),_0x104922);})['then'](function(_0x39535c){if(_0x39535c){var _0x98aa45=0xc8;var _0x4d5583=_0xe211('0xaf');logger[_0xe211('0x1e')](_0xe211('0x22'),_0x4d5583,_0x98aa45,'entity\x20found');logger[_0xe211('0x21')](_0xe211('0xb0'),_0x4d5583,_0x98aa45,_0xe211('0xb1'),JSON[_0xe211('0xb2')](_0x39535c));if(_0x104922[_0xe211('0x6c')]['type']===_0xe211('0x7a')){return _0x19496d['status'](_0x98aa45)[_0xe211('0xb3')](_0xe211('0xb4'),_0xe211('0xb5'))[_0xe211('0x37')]('\x0a');}else{return _0x19496d[_0xe211('0x28')](_0x98aa45)[_0xe211('0x29')](_0x39535c);}}})[_0xe211('0x53')](handleError(_0x19496d,null));};exports[_0xe211('0xb6')]=function(_0x54bc78,_0x4ecdf5){var _0x3ae544=_0x54bc78[_0xe211('0x55')]['id'];var _0xeb595b=_0x54bc78['body'];var _0x5097f3=0xc8;var _0xcba27c=null;return db[_0xe211('0xb7')][_0xe211('0xb8')]({'isolationLevel':db[_0xe211('0xb7')]['Transaction']['ISOLATION_LEVELS'][_0xe211('0xb9')]},function(_0x7cbbe){return db[_0xe211('0x4f')][_0xe211('0x63')]({'where':{'id':_0x3ae544},'transaction':_0x7cbbe})['then'](function(_0xd6d98d){if(_0xd6d98d){return db['SmsApplication'][_0xe211('0x35')]({'where':{'SmsAccountId':_0x3ae544},'transaction':_0x7cbbe})[_0xe211('0x1d')](function(){var _0x353f39=_[_0xe211('0x3b')](_0xeb595b,function(_0x59b016){_0x59b016['SmsAccountId']=_0x3ae544;return _0x59b016;});return db[_0xe211('0xba')]['bulkCreate'](_0x353f39,{'transaction':_0x7cbbe});});}else{_0x5097f3=0x194;_0xcba27c=[];}});})[_0xe211('0x1d')](function(){if(_0x5097f3!==0x194){return db[_0xe211('0xba')][_0xe211('0xbb')]({'where':{'SmsAccountId':_0x3ae544},'order':'priority'})[_0xe211('0x1d')](function(_0x58061a){_0xcba27c=_0x58061a;});}})[_0xe211('0x53')](function(_0x406cf8){_0x5097f3=0x1f4;logger[_0xe211('0x23')](_0x406cf8[_0xe211('0xbc')]);if(_0x406cf8[_0xe211('0x36')]){delete _0x406cf8[_0xe211('0x36')];}_0xcba27c=_0x406cf8;})[_0xe211('0xbd')](function(){if(_0xcba27c===null){_0x4ecdf5[_0xe211('0x26')](_0x5097f3);}else{if(_0x5097f3===0x1f4){_0x4ecdf5[_0xe211('0x28')](_0x5097f3)[_0xe211('0x37')](_0xcba27c);}else{_0x4ecdf5['status'](_0x5097f3)[_0xe211('0x29')](_0xcba27c);}}});};exports[_0xe211('0xbe')]=function(_0x2b211c,_0x569db2,_0x37e09b){var _0x497e80={};var _0x4892b8={};var _0x3b21af;var _0x38eaf7;return db[_0xe211('0x4f')][_0xe211('0x63')]({'where':{'id':_0x2b211c[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x569db2,null))[_0xe211('0x1d')](function(_0x2cbe09){if(_0x2cbe09){_0x3b21af=_0x2cbe09;_0x4892b8[_0xe211('0x43')]=_[_0xe211('0x40')](db[_0xe211('0xba')][_0xe211('0x3c')]);_0x4892b8['query']=_[_0xe211('0x40')](_0x2b211c[_0xe211('0x3f')]);_0x4892b8['filters']=_[_0xe211('0x42')](_0x4892b8[_0xe211('0x43')],_0x4892b8[_0xe211('0x3f')]);_0x497e80['attributes']=_['intersection'](_0x4892b8[_0xe211('0x43')],qs[_0xe211('0x45')](_0x2b211c[_0xe211('0x3f')]['fields']));_0x497e80['attributes']=_0x497e80['attributes'][_0xe211('0x46')]?_0x497e80['attributes']:_0x4892b8['model'];_0x497e80['order']=qs[_0xe211('0x49')](_0x2b211c[_0xe211('0x3f')][_0xe211('0x49')]);_0x497e80[_0xe211('0x4b')]=qs['filters'](_[_0xe211('0x65')](_0x2b211c[_0xe211('0x3f')],_0x4892b8['filters']));if(_0x2b211c[_0xe211('0x3f')][_0xe211('0x4a')]){_0x497e80[_0xe211('0x4b')]=_['merge'](_0x497e80[_0xe211('0x4b')],{'$or':_[_0xe211('0x3b')](_0x497e80[_0xe211('0x44')],function(_0x181168){var _0x55dc41={};_0x55dc41[_0x181168]={'$like':'%'+_0x2b211c['query'][_0xe211('0x4a')]+'%'};return _0x55dc41;})});}_0x497e80=_[_0xe211('0x4c')]({},_0x497e80,_0x2b211c[_0xe211('0x4e')]);return _0x3b21af[_0xe211('0xbe')](_0x497e80);}})[_0xe211('0x1d')](function(_0x2a2c4f){if(_0x2a2c4f){_0x38eaf7=_0x2a2c4f[_0xe211('0x46')];if(!_0x2b211c['query'][_0xe211('0x64')](_0xe211('0x47'))){_0x497e80[_0xe211('0x2d')]=qs[_0xe211('0x2d')](_0x2b211c[_0xe211('0x3f')]['limit']);_0x497e80[_0xe211('0x2c')]=qs['offset'](_0x2b211c[_0xe211('0x3f')][_0xe211('0x2c')]);}return _0x3b21af[_0xe211('0xbe')](_0x497e80);}})['then'](function(_0x77adb3){if(_0x77adb3){return _0x77adb3?{'count':_0x38eaf7,'rows':_0x77adb3}:null;}})[_0xe211('0x1d')](respondWithResult(_0x569db2,null))[_0xe211('0x53')](handleError(_0x569db2,null));};exports[_0xe211('0xbf')]=function(_0x5b7392,_0x18ace6,_0x3d98df){var _0x303c1d={'raw':![],'where':{}};var _0x30b20f={};var _0x25c8d7={'count':0x0,'rows':[]};return db[_0xe211('0x4f')]['findOne']({'where':{'id':_0x5b7392[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x18ace6,null))[_0xe211('0x1d')](function(_0x2d0361){if(_0x2d0361){_0x30b20f[_0xe211('0x43')]=_[_0xe211('0x40')](db['SmsInteraction']['rawAttributes']);_0x30b20f[_0xe211('0x3f')]=_[_0xe211('0x40')](_0x5b7392[_0xe211('0x3f')]);_0x30b20f[_0xe211('0x41')]=_['intersection'](_0x30b20f[_0xe211('0x43')],_0x30b20f[_0xe211('0x3f')]);_0x303c1d['attributes']=_[_0xe211('0x42')](_0x30b20f['model'],qs[_0xe211('0x45')](_0x5b7392['query']['fields']));_0x303c1d[_0xe211('0x44')]=_0x303c1d[_0xe211('0x44')][_0xe211('0x46')]?_0x303c1d['attributes']:_0x30b20f[_0xe211('0x43')];if(!_0x5b7392[_0xe211('0x3f')][_0xe211('0x64')]('nolimit')){_0x303c1d[_0xe211('0x2d')]=qs[_0xe211('0x2d')](_0x5b7392[_0xe211('0x3f')][_0xe211('0x2d')]);_0x303c1d['offset']=qs[_0xe211('0x2c')](_0x5b7392['query'][_0xe211('0x2c')]);}_0x303c1d[_0xe211('0x48')]=qs[_0xe211('0x49')](_0x5b7392[_0xe211('0x3f')][_0xe211('0x49')]);_0x303c1d[_0xe211('0x4b')]=qs[_0xe211('0x41')](_[_0xe211('0x65')](_0x5b7392['query'],_0x30b20f['filters']));_0x303c1d[_0xe211('0x4b')]['SmsAccountId']=_0x2d0361['id'];if(_0x5b7392['query'][_0xe211('0x4a')]){_0x303c1d[_0xe211('0x4b')]=_[_0xe211('0x4c')](_0x303c1d[_0xe211('0x4b')],{'$or':_[_0xe211('0x3b')](_0x303c1d[_0xe211('0x44')],function(_0x49ea86){var _0x23df67={};_0x23df67[_0x49ea86]={'$like':'%'+_0x5b7392[_0xe211('0x3f')][_0xe211('0x4a')]+'%'};return _0x23df67;})});}_0x303c1d=_[_0xe211('0x4c')]({},_0x303c1d,_0x5b7392[_0xe211('0x4e')]);return db[_0xe211('0x9c')]['count']({'where':_0x303c1d['where']})['then'](function(_0x1b98f7){_0x25c8d7['count']=_0x1b98f7;if(_0x5b7392['query'][_0xe211('0x56')]){_0x303c1d[_0xe211('0x50')]=[{'model':db[_0xe211('0x70')],'as':_0xe211('0xc0'),'required':![]},{'model':db[_0xe211('0xa8')],'as':_0xe211('0xc1'),'attributes':[_0xe211('0x36'),'fullname',_0xe211('0xc2')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xe211('0x36'),_0xe211('0xc3')],'where':_0x5b7392[_0xe211('0x3f')][_0xe211('0xc4')]?{'id':_0x5b7392[_0xe211('0x3f')][_0xe211('0xc4')]}:undefined,'required':_0x5b7392[_0xe211('0x3f')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0xe211('0x51')](_0x303c1d);})[_0xe211('0x1d')](function(_0x34562b){_0x25c8d7[_0xe211('0x52')]=_0x34562b;return _0x25c8d7;});}})['then'](respondWithFilteredResult(_0x18ace6,_0x303c1d))['catch'](handleError(_0x18ace6,null));};exports[_0xe211('0x37')]=function(_0x1f6f45,_0x3d7851,_0x53ec85){var _0x81870a,_0xf090d3,_0x44da8d;if(_[_0xe211('0x90')](_0x1f6f45['body'][_0xe211('0x59')])||_0x1f6f45[_0xe211('0x59')]['body']===''){throw new db[(_0xe211('0x72'))][(_0xe211('0x73'))](_0xe211('0x92'));}if(_['isNil'](_0x1f6f45[_0xe211('0x59')]['to'])){throw new db['Sequelize'][(_0xe211('0x73'))](_0xe211('0xc5'));}_0x81870a=_0x1f6f45['body']['to'];return db[_0xe211('0x4f')]['find']({'where':{'id':_0x1f6f45[_0xe211('0x55')]['id']},'include':[{'model':db[_0xe211('0x97')],'as':_0xe211('0xc6'),'include':[{'model':db[_0xe211('0x70')],'as':_0xe211('0x9a'),'where':{'mobile':_0x81870a},'limit':0x1,'order':[['updatedAt',_0xe211('0x98')]]}]}]})[_0xe211('0x1d')](handleEntityNotFound(_0x3d7851,null))['then'](function(_0x450083){if(_0x450083&&_0x450083[_0xe211('0xc6')]){_0xf090d3=_0x450083['get']({'plain':!![]});if(_0xf090d3['List']&&_0xf090d3[_0xe211('0xc6')][_0xe211('0x9a')][_0xe211('0x46')]){return _0xf090d3['List'][_0xe211('0x9a')][0x0];}return db[_0xe211('0x70')][_0xe211('0x58')](_[_0xe211('0xc7')](_0x1f6f45['body'],{'firstName':_0x81870a,'mobile':_0x81870a,'phone':_0x81870a,'ListId':_0xf090d3['ListId']}));}})[_0xe211('0x1d')](handleEntityNotFound(_0x3d7851,null))['then'](function(_0x30443e){if(_0x30443e){_0x44da8d=_0x30443e;return db[_0xe211('0x9c')][_0xe211('0x57')]({'where':{'ContactId':_0x44da8d['id'],'closed':![],'SmsAccountId':_0xf090d3['id']}})[_0xe211('0x1d')](function(_0xa42475){if(_0xa42475){return[_0xa42475,![]];}return db['SmsInteraction'][_0xe211('0x58')]({'UserId':_0x1f6f45[_0xe211('0x5b')]['id'],'ContactId':_0x44da8d['id'],'SmsAccountId':_0xf090d3['id'],'phone':_0x81870a,'firstMsgDirection':_0xe211('0xc8'),'Messages':[_[_0xe211('0x4c')](_0x1f6f45[_0xe211('0x59')],{'read':![],'body':_0x1f6f45[_0xe211('0x59')][_0xe211('0x59')],'phone':_0x81870a,'SmsAccountId':_0xf090d3['id'],'UserId':_0x1f6f45[_0xe211('0x5b')]['id'],'ContactId':_0x44da8d['id']})]},{'include':[{'model':db[_0xe211('0xa5')],'as':_0xe211('0xc9')}]})['then'](function(_0x355498){return[_0x355498,!![]];});});}})[_0xe211('0x9d')](function(_0x2b2633,_0x55e5b5){if(_0x55e5b5){return _0x2b2633;}return db[_0xe211('0xa5')][_0xe211('0x58')](_[_0xe211('0x4c')](_0x1f6f45[_0xe211('0x59')],{'read':![],'body':_0x1f6f45['body'][_0xe211('0x59')],'phone':_0x81870a,'SmsAccountId':_0xf090d3['id'],'SmsInteractionId':_0x2b2633['id'],'UserId':_0x1f6f45[_0xe211('0x5b')]['id'],'ContactId':_0x44da8d['id']}))[_0xe211('0x1d')](function(_0x13d322){_0x2b2633[_0xe211('0xca')][_0xe211('0xc9')]=[];_0x2b2633[_0xe211('0xca')][_0xe211('0xc9')][_0xe211('0xa1')](_0x13d322[_0xe211('0xca')]);return _0x2b2633;});})['then'](respondWithResult(_0x3d7851,null))[_0xe211('0x53')](handleError(_0x3d7851,null));};exports[_0xe211('0x28')]=function(_0x1c3f57,_0x50c9b8,_0x2a2d3b){if(_0x1c3f57['body']['id']){delete _0x1c3f57[_0xe211('0x59')]['id'];}var _0x3321c7,_0x47a571,_0x1885d9;return db[_0xe211('0x4f')]['find']({'where':{'id':_0x1c3f57[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x50c9b8,null))[_0xe211('0x1d')](function(_0xbcfb66){if(_0xbcfb66){_0x1885d9=_0xbcfb66;logger[_0xe211('0x21')](_0xe211('0x22'),_0xe211('0x28'),_0xe211('0xcb'),_0xbcfb66['type'],util[_0xe211('0xcc')](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));switch(_0xbcfb66['type']){case'skebby':if(_0x1c3f57[_0xe211('0x59')][_0xe211('0xcd')]&&_0x1c3f57[_0xe211('0x59')][_0xe211('0x28')]){_0x47a571=_0x1c3f57[_0xe211('0x59')]['status'];return db['SmsMessage'][_0xe211('0x57')]({'where':{'messageId':_0x1c3f57['body']['skebby_dispatch_id']}});}break;case _0xe211('0x82'):if(_0x1c3f57[_0xe211('0x59')][_0xe211('0xce')]&&_0x1c3f57[_0xe211('0x59')][_0xe211('0xcf')]){_0x47a571=_0x1c3f57[_0xe211('0x59')][_0xe211('0xcf')];return db['SmsMessage'][_0xe211('0x57')]({'where':{'messageId':_0x1c3f57[_0xe211('0x59')]['requestid']}});}break;case _0xe211('0xd0'):if(_0x1c3f57['body'][_0xe211('0x83')]&&_0x1c3f57[_0xe211('0x59')][_0xe211('0xd1')]){_0x47a571=_0x1c3f57[_0xe211('0x59')][_0xe211('0xd1')];return db[_0xe211('0xa5')][_0xe211('0x57')]({'where':{'messageId':_0x1c3f57[_0xe211('0x59')][_0xe211('0x83')]}});}break;case _0xe211('0x86'):var _0x2bdb5b=_0x1c3f57[_0xe211('0x59')][_0xe211('0x87')][0x0];if(_0x2bdb5b[_0xe211('0x7d')]&&_0x2bdb5b[_0xe211('0x28')][_0xe211('0xd2')]==='DELIVERED'){_0x47a571=_0x2bdb5b[_0xe211('0x28')]['groupName'];return db['SmsMessage']['find']({'where':{'messageId':_0x2bdb5b[_0xe211('0x7d')]}});}break;case _0xe211('0x8a'):if(_0x1c3f57['body'][_0xe211('0x7d')]&&_0x1c3f57[_0xe211('0x59')]['status']){_0x47a571=_0x1c3f57[_0xe211('0x59')][_0xe211('0x28')];return db['SmsMessage']['find']({'where':{'messageId':_0x1c3f57['body']['messageId']}});}break;case _0xe211('0x8d'):if(_0x1c3f57[_0xe211('0x59')][0x0][_0xe211('0x25')]['id']){_0x47a571=_0x1c3f57['body'][0x0][_0xe211('0x3d')];return db[_0xe211('0xa5')][_0xe211('0x57')]({'where':{'messageId':_0x1c3f57[_0xe211('0x59')][0x0][_0xe211('0x25')]['id']}});}break;case _0xe211('0x8e'):if(_0x1c3f57['body'][_0xe211('0xd3')]&&_0x1c3f57['body'][_0xe211('0x28')]){_0x47a571=_0x1c3f57[_0xe211('0x59')]['status'];return db[_0xe211('0xa5')][_0xe211('0x57')]({'where':{'messageId':_0x1c3f57[_0xe211('0x59')][_0xe211('0xd3')]}});}break;}}})[_0xe211('0x1d')](handleEntityNotFound(_0x50c9b8,null))['then'](function(_0x854365){if(_0x854365){_0x3321c7=_0x854365;switch(_0x1885d9[_0xe211('0x3d')]){case _0xe211('0x7e'):if(_0x47a571===_0xe211('0xd4')){return _0x3321c7[_0xe211('0x31')]({'read':!![]});}else{logger[_0xe211('0x23')](_0xe211('0x22'),_0xe211('0x28'),_0xe211('0x7e'),util['inspect'](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));}break;case _0xe211('0x82'):if(_0x47a571==='1'){return _0x3321c7['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe211('0x28'),'skebby',util['inspect'](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1c3f57[_0xe211('0x59')][_0xe211('0xd5')]&&_0x47a571>=0xc8&&_0x47a571<=0xce){return _0x3321c7['update']({'read':!![]});}else{logger['error'](_0xe211('0x22'),_0xe211('0x28'),'clicksend',util['inspect'](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));}break;case _0xe211('0x86'):var _0x51f911=_0x1c3f57['body'][_0xe211('0x87')][0x0];if(_0x51f911[_0xe211('0x28')][_0xe211('0xd2')]===_0xe211('0xd4')){return _0x3321c7[_0xe211('0x31')]({'read':!![]});}else{logger['error'](_0xe211('0x22'),_0xe211('0x28'),_0xe211('0x86'),util[_0xe211('0xcc')](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));}break;case _0xe211('0x8a'):if(_0x47a571=='DELIVERED_TO_GATEWAY'||_0x47a571==_0xe211('0xd6')){return _0x3321c7['update']({'read':!![]});}else{logger[_0xe211('0x23')](_0xe211('0x22'),'status',_0xe211('0x8a'),util[_0xe211('0xcc')](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x47a571==_0xe211('0xd7')){return _0x3321c7[_0xe211('0x31')]({'read':!![]});}else{logger[_0xe211('0x23')](_0xe211('0x22'),_0xe211('0x28'),_0xe211('0x8d'),util['inspect'](_0x1c3f57['body'],{'showHidden':![],'depth':null}));}break;case _0xe211('0x8e'):if(_0x47a571===_0xe211('0xd8')||_0x47a571==='ACCEPTD'){return _0x3321c7[_0xe211('0x31')]({'read':!![]});}else{logger[_0xe211('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe211('0x28'),'intelepeer',util['inspect'](_0x1c3f57[_0xe211('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x3321c7;}})[_0xe211('0x1d')](respondWithResult(_0x50c9b8,null))[_0xe211('0x53')](handleError(_0x50c9b8,null));};exports[_0xe211('0xd9')]=function(_0x40b0a5,_0x30bd81,_0x4fd312){var _0x556b98,_0x5b6455,_0x55c7ab;return db['SmsAccount'][_0xe211('0x57')]({'where':{'id':_0x40b0a5[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x30bd81,null))[_0xe211('0x1d')](function(_0x373a57){if(_0x373a57){_0x55c7ab=_0x373a57;logger['debug'](_0xe211('0x22'),_0xe211('0x28'),_0xe211('0xcb'),_0x373a57[_0xe211('0x3d')],util[_0xe211('0xcc')](_0x40b0a5[_0xe211('0x3f')],{'showHidden':![],'depth':null}));switch(_0x373a57[_0xe211('0x3d')]){case _0xe211('0x88'):if(_0x40b0a5['query'][_0xe211('0xda')]&&_0x40b0a5[_0xe211('0x3f')]['state']){_0x5b6455=_0x40b0a5[_0xe211('0x3f')][_0xe211('0xdb')];return db[_0xe211('0xa5')][_0xe211('0x57')]({'where':{'messageId':_0x40b0a5[_0xe211('0x3f')][_0xe211('0xda')]}});}break;}}})[_0xe211('0x1d')](handleEntityNotFound(_0x30bd81,null))['then'](function(_0x3adad6){if(_0x3adad6){_0x556b98=_0x3adad6;switch(_0x55c7ab[_0xe211('0x3d')]){case _0xe211('0x88'):if(_0x5b6455==='2'||_0x5b6455==='6'){return _0x556b98[_0xe211('0x31')]({'read':!![]});}else{logger[_0xe211('0x23')](_0xe211('0x22'),_0xe211('0x28'),'csc',util['inspect'](_0x40b0a5[_0xe211('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x556b98;}})['then'](respondWithResult(_0x30bd81,null))[_0xe211('0x53')](handleError(_0x30bd81,null));};exports[_0xe211('0xdc')]=function(_0x4bb854,_0x515d4c,_0x4e8d4f){return db[_0xe211('0x4f')][_0xe211('0x57')]({'where':{'id':_0x4bb854[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x515d4c,null))[_0xe211('0x1d')](function(_0x3e5f39){if(_0x3e5f39){return _0x3e5f39[_0xe211('0xdc')](_0x4bb854[_0xe211('0x59')][_0xe211('0xdd')],_[_0xe211('0xde')](_0x4bb854[_0xe211('0x59')],[_0xe211('0xdd'),'id'])||{})[_0xe211('0x9d')](function(_0x4af885){for(var _0x1a5f1d=0x0;_0x1a5f1d<_0x4bb854[_0xe211('0x59')]['ids'][_0xe211('0x46')];_0x1a5f1d+=0x1){socket[_0xe211('0xdf')](_0xe211('0xe0'),{'UserId':Number(_0x4bb854['body'][_0xe211('0xdd')][_0x1a5f1d]),'SmsAccountId':Number(_0x4bb854['params']['id'])});}return _0x4af885;});}})['then'](respondWithResult(_0x515d4c,null))[_0xe211('0x53')](handleError(_0x515d4c,null));};exports[_0xe211('0xe1')]=function(_0x3fd767,_0x2d24c7,_0x20c652){return db['SmsAccount'][_0xe211('0x57')]({'where':{'id':_0x3fd767[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x2d24c7,null))['then'](function(_0x5e7750){if(_0x5e7750){return _0x5e7750[_0xe211('0xe1')](_0x3fd767[_0xe211('0x3f')]['ids'])[_0xe211('0x1d')](function(){if(_[_0xe211('0xe2')](_0x3fd767['query']['ids'])){for(var _0x5c2960=0x0;_0x5c2960<_0x3fd767[_0xe211('0x3f')][_0xe211('0xdd')][_0xe211('0x46')];_0x5c2960+=0x1){socket[_0xe211('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x3fd767[_0xe211('0x3f')]['ids'][_0x5c2960]),'SmsAccountId':Number(_0x3fd767['params']['id'])});}}else{socket['emit'](_0xe211('0xe3'),{'UserId':Number(_0x3fd767[_0xe211('0x3f')][_0xe211('0xdd')]),'SmsAccountId':Number(_0x3fd767['params']['id'])});}});}})[_0xe211('0x1d')](respondWithStatusCode(_0x2d24c7,null))[_0xe211('0x53')](handleError(_0x2d24c7,null));};exports[_0xe211('0xe4')]=function(_0x1b1c64,_0x65c330,_0x4e90d9){var _0x3b66a6={};var _0x530cd2={};var _0x1a13c5;var _0x394c98;return db['SmsAccount']['findOne']({'where':{'id':_0x1b1c64[_0xe211('0x55')]['id']}})[_0xe211('0x1d')](handleEntityNotFound(_0x65c330,null))[_0xe211('0x1d')](function(_0xab4b95){if(_0xab4b95){_0x1a13c5=_0xab4b95;_0x530cd2['model']=_[_0xe211('0x40')](db['User']['rawAttributes']);_0x530cd2[_0xe211('0x3f')]=_[_0xe211('0x40')](_0x1b1c64[_0xe211('0x3f')]);_0x530cd2['filters']=_['intersection'](_0x530cd2['model'],_0x530cd2['query']);_0x3b66a6[_0xe211('0x44')]=_[_0xe211('0x42')](_0x530cd2['model'],qs['fields'](_0x1b1c64[_0xe211('0x3f')][_0xe211('0x45')]));_0x3b66a6['attributes']=_0x3b66a6['attributes'][_0xe211('0x46')]?_0x3b66a6[_0xe211('0x44')]:_0x530cd2['model'];_0x3b66a6[_0xe211('0x48')]=qs[_0xe211('0x49')](_0x1b1c64[_0xe211('0x3f')][_0xe211('0x49')]);_0x3b66a6[_0xe211('0x4b')]=qs[_0xe211('0x41')](_['pick'](_0x1b1c64[_0xe211('0x3f')],_0x530cd2[_0xe211('0x41')]));if(_0x1b1c64[_0xe211('0x3f')][_0xe211('0x4a')]){_0x3b66a6[_0xe211('0x4b')]=_['merge'](_0x3b66a6[_0xe211('0x4b')],{'$or':_[_0xe211('0x3b')](_0x3b66a6[_0xe211('0x44')],function(_0x3a8ee5){var _0x598556={};_0x598556[_0x3a8ee5]={'$like':'%'+_0x1b1c64[_0xe211('0x3f')][_0xe211('0x4a')]+'%'};return _0x598556;})});}_0x3b66a6=_['merge']({},_0x3b66a6,_0x1b1c64[_0xe211('0x4e')]);return _0x1a13c5[_0xe211('0xe4')](_0x3b66a6);}})[_0xe211('0x1d')](function(_0xceabd6){if(_0xceabd6){_0x394c98=_0xceabd6[_0xe211('0x46')];if(!_0x1b1c64[_0xe211('0x3f')]['hasOwnProperty'](_0xe211('0x47'))){_0x3b66a6[_0xe211('0x2d')]=qs[_0xe211('0x2d')](_0x1b1c64[_0xe211('0x3f')][_0xe211('0x2d')]);_0x3b66a6[_0xe211('0x2c')]=qs['offset'](_0x1b1c64[_0xe211('0x3f')][_0xe211('0x2c')]);}return _0x1a13c5[_0xe211('0xe4')](_0x3b66a6);}})['then'](function(_0x426b42){if(_0x426b42){return _0x426b42?{'count':_0x394c98,'rows':_0x426b42}:null;}})[_0xe211('0x1d')](respondWithResult(_0x65c330,null))[_0xe211('0x53')](handleError(_0x65c330,null));}; \ No newline at end of file +var _0x8265=['statusInt','status_code','groupName','redif','DELIVERED','clicksend','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','csc','message-id','state','addAgents','omit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','end','status','undefined','limit','count','offset','json','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','SmsAccountId','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','ids','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','Body','messageId','MessageSid','skebby','sender','text','connectel','message_id','From','Text','MessageUUID','results','originatingAddress','segmentedMessage','clickatell','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','text/xml','\x0a','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8265,0xfd));var _0x5826=function(_0x3fa385,_0x1f2675){_0x3fa385=_0x3fa385-0x0;var _0x3d577e=_0x8265[_0x3fa385];return _0x3d577e;};'use strict';var emlformat=require(_0x5826('0x0'));var rimraf=require(_0x5826('0x1'));var zipdir=require(_0x5826('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5826('0x3'));var moment=require(_0x5826('0x4'));var BPromise=require(_0x5826('0x5'));var Mustache=require(_0x5826('0x6'));var util=require(_0x5826('0x7'));var path=require(_0x5826('0x8'));var sox=require(_0x5826('0x9'));var csv=require(_0x5826('0xa'));var ejs=require(_0x5826('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5826('0xc'));var squel=require(_0x5826('0xd'));var crypto=require(_0x5826('0xe'));var jsforce=require(_0x5826('0xf'));var deskjs=require(_0x5826('0x10'));var toCsv=require(_0x5826('0xa'));var querystring=require(_0x5826('0x11'));var Papa=require(_0x5826('0x12'));var Redis=require(_0x5826('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5826('0x14'));var hardwareService=require(_0x5826('0x15'));var logger=require('../../config/logger')(_0x5826('0x16'));var utils=require(_0x5826('0x17'));var config=require(_0x5826('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5826('0x19'))['db'];config['redis']=_[_0x5826('0x1a')](config[_0x5826('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5826('0x1c'))(new Redis(config[_0x5826('0x1b')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x5826('0x1d'));var client=jayson[_0x5826('0x1e')][_0x5826('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x6e589d,_0x2d3655,_0x34a3df,_0x59409c){return new BPromise(function(_0xf5cb1e,_0x33c9a3){var _0x5eae38=_0x59409c||client;return _0x5eae38['request'](_0x6e589d,_0x34a3df)[_0x5826('0x20')](function(_0x545ed0){logger[_0x5826('0x21')]('SmsAccount,\x20%s,\x20%s',_0x2d3655,'request\x20sent');logger[_0x5826('0x22')](_0x5826('0x23'),_0x2d3655,_0x5826('0x24'),JSON[_0x5826('0x25')](_0x545ed0));if(_0x545ed0[_0x5826('0x26')]){if(_0x545ed0['error'][_0x5826('0x27')]===0x1f4){logger[_0x5826('0x26')]('SmsAccount,\x20%s,\x20%s',_0x2d3655,_0x545ed0[_0x5826('0x26')][_0x5826('0x28')]);return _0x33c9a3(_0x545ed0[_0x5826('0x26')][_0x5826('0x28')]);}logger[_0x5826('0x26')](_0x5826('0x29'),_0x2d3655,_0x545ed0[_0x5826('0x26')][_0x5826('0x28')]);return _0xf5cb1e(_0x545ed0['error'][_0x5826('0x28')]);}else{logger[_0x5826('0x21')](_0x5826('0x29'),_0x2d3655,_0x5826('0x24'));_0xf5cb1e(_0x545ed0[_0x5826('0x2a')][_0x5826('0x28')]);}})['catch'](function(_0x1b4296){logger[_0x5826('0x26')](_0x5826('0x29'),_0x2d3655,_0x1b4296);_0x33c9a3(_0x1b4296);});});}function respondWithStatusCode(_0x6ff1e7,_0x5af5a6){_0x5af5a6=_0x5af5a6||0xcc;return function(_0x269f14){if(_0x269f14){return _0x6ff1e7['sendStatus'](_0x5af5a6);}return _0x6ff1e7['status'](_0x5af5a6)[_0x5826('0x2b')]();};}function respondWithResult(_0x4168ea,_0x4ef110){_0x4ef110=_0x4ef110||0xc8;return function(_0x52cad9){if(_0x52cad9){return _0x4168ea[_0x5826('0x2c')](_0x4ef110)['json'](_0x52cad9);}};}function respondWithFilteredResult(_0x528a19,_0x3fa3fa){return function(_0xfee002){if(_0xfee002){var _0x1995b3=typeof _0x3fa3fa['offset']===_0x5826('0x2d')&&typeof _0x3fa3fa[_0x5826('0x2e')]===_0x5826('0x2d');var _0x18f4b2=_0xfee002[_0x5826('0x2f')];var _0x470729=_0x1995b3?0x0:_0x3fa3fa[_0x5826('0x30')];var _0x1cba9f=_0x1995b3?_0xfee002[_0x5826('0x2f')]:_0x3fa3fa[_0x5826('0x30')]+_0x3fa3fa[_0x5826('0x2e')];var _0x30b68;if(_0x1cba9f>=_0x18f4b2){_0x1cba9f=_0x18f4b2;_0x30b68=0xc8;}else{_0x30b68=0xce;}_0x528a19[_0x5826('0x2c')](_0x30b68);return _0x528a19['set']('Content-Range',_0x470729+'-'+_0x1cba9f+'/'+_0x18f4b2)[_0x5826('0x31')](_0xfee002);}return null;};}function patchUpdates(_0x1075d1){return function(_0x356d0b){try{jsonpatch[_0x5826('0x32')](_0x356d0b,_0x1075d1,!![]);}catch(_0x4ca2fa){return BPromise[_0x5826('0x33')](_0x4ca2fa);}return _0x356d0b[_0x5826('0x34')]();};}function saveUpdates(_0x29ef94,_0x3e3b68){return function(_0x410b35){if(_0x410b35){return _0x410b35[_0x5826('0x35')](_0x29ef94)[_0x5826('0x20')](function(_0x3b1023){return _0x3b1023;});}return null;};}function removeEntity(_0x419bbe,_0x1842b0){return function(_0x3b9604){if(_0x3b9604){return _0x3b9604[_0x5826('0x36')]()[_0x5826('0x20')](function(){var _0x30e7c8=_0x3b9604['get']({'plain':!![]});var _0x440dda=_0x5826('0x37');return db[_0x5826('0x38')]['destroy']({'where':{'type':_0x440dda,'resourceId':_0x30e7c8['id']}})[_0x5826('0x20')](function(){return _0x3b9604;});})[_0x5826('0x20')](function(){_0x419bbe[_0x5826('0x2c')](0xcc)[_0x5826('0x2b')]();});}};}function handleEntityNotFound(_0x5d1b59,_0x4bb47f){return function(_0x57f656){if(!_0x57f656){_0x5d1b59[_0x5826('0x39')](0x194);}return _0x57f656;};}function handleError(_0x5f26a9,_0x172e4c){_0x172e4c=_0x172e4c||0x1f4;return function(_0x4410e3){logger[_0x5826('0x26')](_0x4410e3[_0x5826('0x3a')]);if(_0x4410e3[_0x5826('0x3b')]){delete _0x4410e3[_0x5826('0x3b')];}_0x5f26a9[_0x5826('0x2c')](_0x172e4c)[_0x5826('0x3c')](_0x4410e3);};}exports[_0x5826('0x3d')]=function(_0x18a089,_0x226059){var _0x5051db={'include':[{'model':db[_0x5826('0x3e')],'as':_0x5826('0x3f')}]},_0xab4df9={},_0x401409={'count':0x0,'rows':[]};var _0x3a4264=_[_0x5826('0x40')](db[_0x5826('0x41')][_0x5826('0x42')],function(_0x5d4cfa){return{'name':_0x5d4cfa[_0x5826('0x43')],'type':_0x5d4cfa['type'][_0x5826('0x44')]};});_0xab4df9['model']=_['map'](_0x3a4264,'name');_0xab4df9[_0x5826('0x45')]=_[_0x5826('0x46')](_0x18a089['query']);_0xab4df9[_0x5826('0x47')]=_[_0x5826('0x48')](_0xab4df9['model'],_0xab4df9[_0x5826('0x45')]);_0x5051db[_0x5826('0x49')]=_[_0x5826('0x48')](_0xab4df9[_0x5826('0x4a')],qs[_0x5826('0x4b')](_0x18a089[_0x5826('0x45')][_0x5826('0x4b')]));_0x5051db[_0x5826('0x49')]=_0x5051db[_0x5826('0x49')]['length']?_0x5051db[_0x5826('0x49')]:_0xab4df9[_0x5826('0x4a')];if(!_0x18a089[_0x5826('0x45')][_0x5826('0x4c')](_0x5826('0x4d'))){_0x5051db[_0x5826('0x2e')]=qs[_0x5826('0x2e')](_0x18a089[_0x5826('0x45')][_0x5826('0x2e')]);_0x5051db['offset']=qs['offset'](_0x18a089['query'][_0x5826('0x30')]);}_0x5051db[_0x5826('0x4e')]=qs[_0x5826('0x4f')](_0x18a089[_0x5826('0x45')][_0x5826('0x4f')]);_0x5051db[_0x5826('0x50')]=qs[_0x5826('0x47')](_[_0x5826('0x51')](_0x18a089['query'],_0xab4df9[_0x5826('0x47')]),_0x3a4264);if(_0x18a089[_0x5826('0x45')][_0x5826('0x52')]){_0x5051db[_0x5826('0x50')]=_['merge'](_0x5051db[_0x5826('0x50')],{'$or':_[_0x5826('0x40')](_0x3a4264,function(_0x540983){if(_0x540983[_0x5826('0x53')]!==_0x5826('0x54')){var _0x1cf88e={};_0x1cf88e[_0x540983[_0x5826('0x3b')]]={'$like':'%'+_0x18a089[_0x5826('0x45')][_0x5826('0x52')]+'%'};return _0x1cf88e;}})});}_0x5051db=_[_0x5826('0x55')]({},_0x5051db,_0x18a089[_0x5826('0x56')]);var _0x52e5a4={'where':_0x5051db[_0x5826('0x50')]};return db[_0x5826('0x41')][_0x5826('0x2f')](_0x52e5a4)[_0x5826('0x20')](function(_0x227465){_0x401409[_0x5826('0x2f')]=_0x227465;if(_0x18a089[_0x5826('0x45')]['includeAll']){_0x5051db[_0x5826('0x57')]=[{'all':!![]}];}return db[_0x5826('0x41')][_0x5826('0x58')](_0x5051db);})['then'](function(_0x5198c1){_0x401409[_0x5826('0x59')]=_0x5198c1;return _0x401409;})[_0x5826('0x20')](respondWithFilteredResult(_0x226059,_0x5051db))[_0x5826('0x5a')](handleError(_0x226059,null));};exports[_0x5826('0x5b')]=function(_0x5a53e8,_0x1ab9e4){var _0x2fb8f8={'raw':![],'where':{'id':_0x5a53e8[_0x5826('0x5c')]['id']},'include':[{'model':db[_0x5826('0x3e')],'as':_0x5826('0x3f')}]},_0x4a347c={};_0x4a347c['model']=_[_0x5826('0x46')](db['SmsAccount'][_0x5826('0x42')]);_0x4a347c['query']=_['keys'](_0x5a53e8[_0x5826('0x45')]);_0x4a347c[_0x5826('0x47')]=_[_0x5826('0x48')](_0x4a347c[_0x5826('0x4a')],_0x4a347c[_0x5826('0x45')]);_0x2fb8f8['attributes']=_['intersection'](_0x4a347c[_0x5826('0x4a')],qs[_0x5826('0x4b')](_0x5a53e8[_0x5826('0x45')][_0x5826('0x4b')]));_0x2fb8f8[_0x5826('0x49')]=_0x2fb8f8[_0x5826('0x49')]['length']?_0x2fb8f8[_0x5826('0x49')]:_0x4a347c[_0x5826('0x4a')];if(_0x5a53e8[_0x5826('0x45')][_0x5826('0x5d')]){_0x2fb8f8[_0x5826('0x57')]=[{'all':!![]}];}_0x2fb8f8=_['merge']({},_0x2fb8f8,_0x5a53e8[_0x5826('0x56')]);return db[_0x5826('0x41')]['find'](_0x2fb8f8)[_0x5826('0x20')](handleEntityNotFound(_0x1ab9e4,null))['then'](respondWithResult(_0x1ab9e4,null))[_0x5826('0x5a')](handleError(_0x1ab9e4,null));};exports[_0x5826('0x5e')]=function(_0x3e9b18,_0xb53166){return db[_0x5826('0x41')][_0x5826('0x5e')](_0x3e9b18['body'],{})['then'](function(_0x5eae7a){var _0x382afb=_0x3e9b18[_0x5826('0x5f')][_0x5826('0x60')]({'plain':!![]});if(!_0x382afb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x382afb[_0x5826('0x61')]===_0x5826('0x5f')){var _0x1a1909=_0x5eae7a[_0x5826('0x60')]({'plain':!![]});var _0x55ca02='SmsAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x55ca02,'userProfileId':_0x382afb[_0x5826('0x62')]},'raw':!![]})[_0x5826('0x20')](function(_0x2bf9bd){if(_0x2bf9bd&&_0x2bf9bd[_0x5826('0x63')]===0x0){return db[_0x5826('0x38')][_0x5826('0x5e')]({'name':_0x1a1909[_0x5826('0x3b')],'resourceId':_0x1a1909['id'],'type':_0x2bf9bd['name'],'sectionId':_0x2bf9bd['id']},{})[_0x5826('0x20')](function(){return _0x5eae7a;});}else{return _0x5eae7a;}})['catch'](function(_0x15836d){logger[_0x5826('0x26')](_0x5826('0x64'),_0x15836d);throw _0x15836d;});}return _0x5eae7a;})['then'](respondWithResult(_0xb53166,0xc9))[_0x5826('0x5a')](handleError(_0xb53166,null));};exports['update']=function(_0x1912a3,_0x1e8eb1){if(_0x1912a3['body']['id']){delete _0x1912a3[_0x5826('0x65')]['id'];}return db[_0x5826('0x41')]['find']({'where':{'id':_0x1912a3[_0x5826('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x5826('0x3f')}]})['then'](handleEntityNotFound(_0x1e8eb1,null))[_0x5826('0x20')](saveUpdates(_0x1912a3['body'],null))[_0x5826('0x20')](respondWithResult(_0x1e8eb1,null))[_0x5826('0x5a')](handleError(_0x1e8eb1,null));};exports[_0x5826('0x36')]=function(_0x53f87f,_0x54375f){return db[_0x5826('0x41')][_0x5826('0x66')]({'where':{'id':_0x53f87f['params']['id']}})['then'](handleEntityNotFound(_0x54375f,null))['then'](removeEntity(_0x54375f,null))[_0x5826('0x5a')](handleError(_0x54375f,null));};exports[_0x5826('0x67')]=function(_0x140652,_0x26d408){return db[_0x5826('0x41')][_0x5826('0x67')]()[_0x5826('0x20')](respondWithResult(_0x26d408,null))['catch'](handleError(_0x26d408,null));};exports[_0x5826('0x68')]=function(_0x1f0a6c,_0x350374,_0x1f11d2){if(_0x1f0a6c['body']['id']){delete _0x1f0a6c['body']['id'];}return db[_0x5826('0x41')][_0x5826('0x66')]({'where':{'id':_0x1f0a6c[_0x5826('0x5c')]['id']}})['then'](handleEntityNotFound(_0x350374,null))['then'](function(_0x4567e4){if(_0x4567e4){_0x1f0a6c[_0x5826('0x65')][_0x5826('0x69')]=_0x4567e4['id'];return db['Disposition'][_0x5826('0x5e')](_0x1f0a6c[_0x5826('0x65')]);}})[_0x5826('0x20')](respondWithResult(_0x350374,null))[_0x5826('0x5a')](handleError(_0x350374,null));};exports['getDispositions']=function(_0x309a24,_0xa1cbc3,_0x16678d){var _0x28a947={'raw':![],'where':{}};var _0x5c8f33={};var _0x35305d={'count':0x0,'rows':[]};return db[_0x5826('0x41')][_0x5826('0x6a')]({'where':{'id':_0x309a24[_0x5826('0x5c')]['id']}})[_0x5826('0x20')](handleEntityNotFound(_0xa1cbc3,null))[_0x5826('0x20')](function(_0x53e4ef){if(_0x53e4ef){_0x5c8f33[_0x5826('0x4a')]=_[_0x5826('0x46')](db[_0x5826('0x6b')][_0x5826('0x42')]);_0x5c8f33['query']=_[_0x5826('0x46')](_0x309a24['query']);_0x5c8f33['filters']=_[_0x5826('0x48')](_0x5c8f33[_0x5826('0x4a')],_0x5c8f33['query']);_0x28a947[_0x5826('0x49')]=_['intersection'](_0x5c8f33[_0x5826('0x4a')],qs[_0x5826('0x4b')](_0x309a24[_0x5826('0x45')][_0x5826('0x4b')]));_0x28a947[_0x5826('0x49')]=_0x28a947[_0x5826('0x49')]['length']?_0x28a947[_0x5826('0x49')]:_0x5c8f33[_0x5826('0x4a')];if(!_0x309a24[_0x5826('0x45')][_0x5826('0x4c')](_0x5826('0x4d'))){_0x28a947['limit']=qs[_0x5826('0x2e')](_0x309a24[_0x5826('0x45')][_0x5826('0x2e')]);_0x28a947[_0x5826('0x30')]=qs[_0x5826('0x30')](_0x309a24['query']['offset']);}_0x28a947['order']=qs[_0x5826('0x4f')](_0x309a24['query'][_0x5826('0x4f')]);_0x28a947['where']=qs[_0x5826('0x47')](_[_0x5826('0x51')](_0x309a24['query'],_0x5c8f33[_0x5826('0x47')]));_0x28a947[_0x5826('0x50')][_0x5826('0x69')]=_0x53e4ef['id'];if(_0x309a24[_0x5826('0x45')][_0x5826('0x52')]){_0x28a947[_0x5826('0x50')]=_['merge'](_0x28a947['where'],{'$or':_[_0x5826('0x40')](_0x28a947[_0x5826('0x49')],function(_0x37a78e){var _0x354ae8={};_0x354ae8[_0x37a78e]={'$like':'%'+_0x309a24[_0x5826('0x45')][_0x5826('0x52')]+'%'};return _0x354ae8;})});}_0x28a947=_[_0x5826('0x55')]({},_0x28a947,_0x309a24['options']);return db[_0x5826('0x6b')][_0x5826('0x2f')]({'where':_0x28a947[_0x5826('0x50')]})[_0x5826('0x20')](function(_0x2e78b9){_0x35305d['count']=_0x2e78b9;if(_0x309a24['query']['includeAll']){_0x28a947[_0x5826('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x5826('0x58')](_0x28a947);})['then'](function(_0x32e648){_0x35305d['rows']=_0x32e648;return _0x35305d;});}})[_0x5826('0x20')](respondWithFilteredResult(_0xa1cbc3,_0x28a947))[_0x5826('0x5a')](handleError(_0xa1cbc3,null));};exports[_0x5826('0x6c')]=function(_0x2d80c2,_0x49280c,_0x28396c){return db['SmsAccount']['find']({'where':{'id':_0x2d80c2['params']['id']}})['then'](handleEntityNotFound(_0x49280c,null))[_0x5826('0x20')](function(_0x2200b0){if(_0x2200b0){return _0x2200b0[_0x5826('0x6c')](_0x2d80c2[_0x5826('0x45')]['ids']);}})[_0x5826('0x20')](respondWithStatusCode(_0x49280c,null))[_0x5826('0x5a')](handleError(_0x49280c,null));};exports[_0x5826('0x6d')]=function(_0xcec0e8,_0x31e31f,_0x3ddb05){if(_0xcec0e8[_0x5826('0x65')]['id']){delete _0xcec0e8[_0x5826('0x65')]['id'];}return db[_0x5826('0x41')]['find']({'where':{'id':_0xcec0e8[_0x5826('0x5c')]['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x31e31f,null))[_0x5826('0x20')](function(_0x2e38c5){if(_0x2e38c5){_0xcec0e8[_0x5826('0x65')]['SmsAccountId']=_0x2e38c5['id'];return db[_0x5826('0x6e')]['create'](_0xcec0e8[_0x5826('0x65')]);}})[_0x5826('0x20')](respondWithResult(_0x31e31f,null))['catch'](handleError(_0x31e31f,null));};exports[_0x5826('0x6f')]=function(_0x16dff0,_0x50f8de,_0x36b725){var _0x487ced={'raw':![],'where':{}};var _0x2a9e49={};var _0x4a2562={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5826('0x6a')]({'where':{'id':_0x16dff0['params']['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x50f8de,null))['then'](function(_0x501244){if(_0x501244){_0x2a9e49[_0x5826('0x4a')]=_['keys'](db['CannedAnswer'][_0x5826('0x42')]);_0x2a9e49['query']=_[_0x5826('0x46')](_0x16dff0[_0x5826('0x45')]);_0x2a9e49[_0x5826('0x47')]=_['intersection'](_0x2a9e49['model'],_0x2a9e49[_0x5826('0x45')]);_0x487ced['attributes']=_['intersection'](_0x2a9e49[_0x5826('0x4a')],qs[_0x5826('0x4b')](_0x16dff0[_0x5826('0x45')]['fields']));_0x487ced[_0x5826('0x49')]=_0x487ced[_0x5826('0x49')][_0x5826('0x70')]?_0x487ced[_0x5826('0x49')]:_0x2a9e49[_0x5826('0x4a')];if(!_0x16dff0[_0x5826('0x45')][_0x5826('0x4c')]('nolimit')){_0x487ced[_0x5826('0x2e')]=qs[_0x5826('0x2e')](_0x16dff0[_0x5826('0x45')][_0x5826('0x2e')]);_0x487ced[_0x5826('0x30')]=qs[_0x5826('0x30')](_0x16dff0[_0x5826('0x45')]['offset']);}_0x487ced[_0x5826('0x4e')]=qs[_0x5826('0x4f')](_0x16dff0[_0x5826('0x45')][_0x5826('0x4f')]);_0x487ced[_0x5826('0x50')]=qs[_0x5826('0x47')](_['pick'](_0x16dff0['query'],_0x2a9e49['filters']));_0x487ced[_0x5826('0x50')][_0x5826('0x69')]=_0x501244['id'];if(_0x16dff0['query'][_0x5826('0x52')]){_0x487ced[_0x5826('0x50')]=_[_0x5826('0x55')](_0x487ced[_0x5826('0x50')],{'$or':_[_0x5826('0x40')](_0x487ced['attributes'],function(_0x329ef3){var _0x458793={};_0x458793[_0x329ef3]={'$like':'%'+_0x16dff0[_0x5826('0x45')][_0x5826('0x52')]+'%'};return _0x458793;})});}_0x487ced=_[_0x5826('0x55')]({},_0x487ced,_0x16dff0[_0x5826('0x56')]);return db[_0x5826('0x6e')][_0x5826('0x2f')]({'where':_0x487ced[_0x5826('0x50')]})[_0x5826('0x20')](function(_0x229e53){_0x4a2562['count']=_0x229e53;if(_0x16dff0[_0x5826('0x45')]['includeAll']){_0x487ced[_0x5826('0x57')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x487ced);})[_0x5826('0x20')](function(_0x4063c6){_0x4a2562[_0x5826('0x59')]=_0x4063c6;return _0x4a2562;});}})[_0x5826('0x20')](respondWithFilteredResult(_0x50f8de,_0x487ced))[_0x5826('0x5a')](handleError(_0x50f8de,null));};exports[_0x5826('0x71')]=function(_0x45fee8,_0x2f594c,_0x4099a8){return db[_0x5826('0x41')]['find']({'where':{'id':_0x45fee8['params']['id']}})['then'](handleEntityNotFound(_0x2f594c,null))[_0x5826('0x20')](function(_0x2b2108){if(_0x2b2108){return _0x2b2108[_0x5826('0x71')](_0x45fee8[_0x5826('0x45')][_0x5826('0x72')]);}})['then'](respondWithStatusCode(_0x2f594c,null))[_0x5826('0x5a')](handleError(_0x2f594c,null));};exports[_0x5826('0x73')]=function(_0xb312b2,_0x52de06,_0x3072de){var _0x4d8996={'channel':_0x5826('0x74')};var _0x1af232=[];var _0x5bc7bf=[];var _0x158687={};return db[_0x5826('0x41')][_0x5826('0x66')]({'where':{'id':_0xb312b2[_0x5826('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x5826('0x75')}]})['then'](handleEntityNotFound(_0x52de06,null))[_0x5826('0x20')](function(_0x11e169){_0x4d8996[_0x5826('0x76')]=_0x11e169;_0x4d8996[_0x5826('0x77')]=_[_0x5826('0x78')](_0x11e169[_0x5826('0x75')],[_0x5826('0x79')],[_0x5826('0x7a')]);if(_0x4d8996[_0x5826('0x76')][_0x5826('0x75')]){delete _0x4d8996[_0x5826('0x76')][_0x5826('0x75')];}return db[_0x5826('0x7b')][_0x5826('0x67')]();})[_0x5826('0x20')](function(_0x39f6b9){if(!_0x39f6b9){throw new db[(_0x5826('0x7c'))][(_0x5826('0x7d'))]('no\x20available\x20attributes');}_0x1af232=_[_0x5826('0x7e')](_['keys'](_0x39f6b9),[_0x5826('0x7f'),_0x5826('0x80')]);_0x5bc7bf=_[_0x5826('0x7e')](_[_0x5826('0x46')](_0x39f6b9),[_0x5826('0x7f'),_0x5826('0x80'),_0x5826('0x81'),_0x5826('0x82')]);_0x4d8996[_0x5826('0x65')]={'mapKey':_0x5826('0x83')};if(_0x4d8996[_0x5826('0x76')][_0x5826('0x53')]){switch(_0x4d8996[_0x5826('0x76')]['type']){case'twilio':_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]=_0xb312b2[_0x5826('0x65')]['From'];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x85')];_0x4d8996['body'][_0x5826('0x86')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x87')];break;case _0x5826('0x88'):_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]='+'+_0xb312b2[_0x5826('0x65')][_0x5826('0x89')];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x8a')];break;case _0x5826('0x8b'):_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x84')];_0x4d8996['body'][_0x5826('0x65')]=_0xb312b2['body']['message'];break;case'clicksend':_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]=_0xb312b2[_0x5826('0x65')]['from'];_0x4d8996[_0x5826('0x65')]['body']=_0xb312b2[_0x5826('0x65')][_0x5826('0x65')];_0x4d8996['body'][_0x5826('0x86')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x8c')];break;case'plivo':_0x4d8996[_0x5826('0x65')]['from']=_0xb312b2[_0x5826('0x65')][_0x5826('0x8d')];_0x4d8996['body'][_0x5826('0x65')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x8e')];_0x4d8996[_0x5826('0x65')][_0x5826('0x86')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x8f')];break;case'infobip':_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]='+'+_0xb312b2[_0x5826('0x65')][_0x5826('0x90')][0x0][_0x5826('0x84')];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x90')][0x0][_0x5826('0x8a')];_0x4d8996[_0x5826('0x65')]['messageId']=_0xb312b2[_0x5826('0x65')][_0x5826('0x90')][0x0][_0x5826('0x86')];break;case'csc':_0x4d8996['body'][_0x5826('0x84')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x91')];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2['body'][_0x5826('0x92')][_0x5826('0x28')];break;case _0x5826('0x93'):_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]=_0xb312b2['body']['fromNumber'];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2['body'][_0x5826('0x8a')];_0x4d8996['body'][_0x5826('0x86')]=_0xb312b2[_0x5826('0x65')]['replyMessageId'];break;case _0x5826('0x94'):_0x4d8996['body'][_0x5826('0x86')]=_0xb312b2[_0x5826('0x65')][0x0][_0x5826('0x28')]['id'];_0x4d8996[_0x5826('0x65')]['from']=_0xb312b2[_0x5826('0x65')][0x0][_0x5826('0x28')][_0x5826('0x84')];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2[_0x5826('0x65')][0x0]['message'][_0x5826('0x8a')];break;case _0x5826('0x95'):_0x4d8996[_0x5826('0x65')][_0x5826('0x84')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x84')];_0x4d8996[_0x5826('0x65')][_0x5826('0x65')]=_0xb312b2[_0x5826('0x65')][_0x5826('0x28')];_0x4d8996['body']['messageId']=_0xb312b2[_0x5826('0x65')][_0x5826('0x96')];break;}}if(_0x4d8996['body']['id']){delete _0x4d8996['body']['id'];}if(_['isNil'](_0x4d8996[_0x5826('0x65')][_0x5826('0x84')])){throw new db[(_0x5826('0x7c'))][(_0x5826('0x7d'))]('from\x20is\x20mandatory');}if(_[_0x5826('0x97')](_0x4d8996[_0x5826('0x65')][_0x5826('0x65')])||_0x4d8996[_0x5826('0x65')]['body']===''){throw new db[(_0x5826('0x7c'))][(_0x5826('0x7d'))](_0x5826('0x98'));}if(_[_0x5826('0x97')](_0x4d8996['body']['mapKey'])){throw new db[(_0x5826('0x7c'))]['ValidationError'](_0x5826('0x99')+_0x5bc7bf);}if(!_['includes'](_0x5bc7bf,_0x4d8996['body'][_0x5826('0x9a')])){throw new db[(_0x5826('0x7c'))]['ValidationError'](_0x5826('0x9b')+_0x5bc7bf);}_0x158687[_0x4d8996[_0x5826('0x65')]['mapKey']]=_0x4d8996[_0x5826('0x65')]['from'];return db[_0x5826('0x9c')]['find']({'where':{'id':_0x4d8996['account'][_0x5826('0x82')]},'include':[{'model':db[_0x5826('0x7b')],'as':_0x5826('0x9d'),'where':_0x158687,'limit':0x1,'order':[[_0x5826('0x80'),_0x5826('0x9e')]]}]});})[_0x5826('0x20')](handleEntityNotFound(_0x52de06,null))[_0x5826('0x20')](function(_0x4f08b0){if(_0x4f08b0){_0x4d8996[_0x5826('0x9f')]=_['omit'](_0x4f08b0,[_0x5826('0x9d')]);if(_0x4f08b0[_0x5826('0x9d')][_0x5826('0x70')]){return _0x4f08b0[_0x5826('0x9d')][0x0];}var _0x56f6c9=_[_0x5826('0x1a')](_0x4d8996[_0x5826('0x65')],{'firstName':_0x4d8996[_0x5826('0x65')][_0x5826('0x84')],'ListId':_0x4f08b0['id']});_0x56f6c9[_0x4d8996[_0x5826('0x65')][_0x5826('0x9a')]]=_0x4d8996[_0x5826('0x65')][_0x5826('0x84')];return db['CmContact'][_0x5826('0x5e')](_0x56f6c9,{'fields':_0x1af232,'raw':!![]});}})[_0x5826('0x20')](handleEntityNotFound(_0x52de06,null))['then'](function(_0x458df8){if(_0x458df8){_0x4d8996[_0x5826('0xa0')]=_0x458df8;var _0x39854c={'ContactId':_0x458df8['id'],'phone':_0x4d8996[_0x5826('0x65')]['from'],'SmsAccountId':_0xb312b2[_0x5826('0x5c')]['id']};var _0x38e40b={'ContactId':_0x458df8['id'],'SmsAccountId':_0xb312b2[_0x5826('0x5c')]['id'],'closed':![]};return db[_0x5826('0xa1')]['find']({'where':_0x38e40b})['then'](function(_0xb9e669){if(_0xb9e669){return[_0xb9e669,![]];}return db[_0x5826('0xa1')][_0x5826('0x5e')](_0x39854c)[_0x5826('0x20')](function(_0x79489e){return[_0x79489e,!![]];});});}})[_0x5826('0xa2')](function(_0x340283,_0xfaa14a){_0x4d8996['interaction']=_0x340283['get']({'plain':!![]});_0x4d8996[_0x5826('0xa3')][_0x5826('0xa4')]=![];if(_0xfaa14a){if(_0x4d8996[_0x5826('0x76')][_0x5826('0xa5')]){_0x4d8996['applications'][_0x5826('0xa6')]({'id':0x0,'priority':_0x4d8996[_0x5826('0x77')][_0x5826('0x70')]+0x1,'app':_0x5826('0xa7'),'appdata':_0x5826('0xa8'),'interval':_0x5826('0xa9')});}_0x4d8996[_0x5826('0xa3')][_0x5826('0xa4')]=!![];}return db[_0x5826('0xaa')][_0x5826('0x5e')]({'phone':_0x4d8996['body'][_0x5826('0x84')],'messageId':_0x4d8996[_0x5826('0x65')][_0x5826('0x86')],'body':_0x4d8996[_0x5826('0x65')][_0x5826('0x65')],'SmsAccountId':_0xb312b2['params']['id'],'SmsInteractionId':_0x340283['id'],'direction':'in','ContactId':_0x340283[_0x5826('0xab')],'AttachmentId':_0x4d8996[_0x5826('0x65')][_0x5826('0xac')]});})['then'](function(_0x4ede7b){_0x4d8996[_0x5826('0x28')]=_0x4ede7b;if(!_0x4d8996[_0x5826('0xa3')][_0x5826('0xad')])return;return db[_0x5826('0xae')][_0x5826('0x66')]({'attributes':['id',_0x5826('0x3b')],'where':{'id':_0x4d8996[_0x5826('0xa3')][_0x5826('0xad')]}});})['then'](function(_0x19ffe8){if(_0x19ffe8){_0x4d8996[_0x5826('0x77')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5826('0xaf'),'appdata':_0x19ffe8['name']+','+(_0x4d8996[_0x5826('0x76')][_0x5826('0xb0')]||0xa),'interval':_0x5826('0xa9')});}if(!_0x4d8996[_0x5826('0xa3')][_0x5826('0xb1')])return;return db['SmsQueue'][_0x5826('0x66')]({'attributes':['id',_0x5826('0x3b')],'where':{'id':_0x4d8996[_0x5826('0xa3')][_0x5826('0xb1')]}});})[_0x5826('0x20')](function(_0x451f9e){if(_0x451f9e){_0x4d8996[_0x5826('0x77')][_0x5826('0xb2')]({'id':0x0,'priority':0x1,'app':_0x5826('0xb3'),'appdata':_0x451f9e['name']+','+(_0x4d8996[_0x5826('0x76')][_0x5826('0xb4')]||0x12c),'interval':_0x5826('0xa9')});}return respondWithRpcPromise(_0x5826('0xb5'),'startRouting',_0x4d8996);})[_0x5826('0x20')](function(_0x1cb465){if(_0x1cb465){var _0x1ba76c=0xc8;var _0x483d2b='receiveMessage';logger[_0x5826('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x483d2b,_0x1ba76c,_0x5826('0xb6'));logger['debug'](_0x5826('0xb7'),_0x483d2b,_0x1ba76c,_0x5826('0xb6'),JSON['stringify'](_0x1cb465));if(_0x4d8996[_0x5826('0x76')][_0x5826('0x53')]===_0x5826('0xb8')){return _0x52de06[_0x5826('0x2c')](_0x1ba76c)[_0x5826('0xb9')]('Content-Type',_0x5826('0xba'))['send'](_0x5826('0xbb'));}else{return _0x52de06['status'](_0x1ba76c)[_0x5826('0x31')](_0x1cb465);}}})[_0x5826('0x5a')](handleError(_0x52de06,null));};exports['addApplications']=function(_0x5a16df,_0x190981){var _0x35c1ed=_0x5a16df[_0x5826('0x5c')]['id'];var _0x355054=_0x5a16df['body'];var _0x3ec63a=0xc8;var _0x5a73de=null;return db[_0x5826('0xbc')][_0x5826('0xbd')]({'isolationLevel':db[_0x5826('0xbc')][_0x5826('0xbe')][_0x5826('0xbf')][_0x5826('0xc0')]},function(_0x176f70){return db[_0x5826('0x41')][_0x5826('0x6a')]({'where':{'id':_0x35c1ed},'transaction':_0x176f70})[_0x5826('0x20')](function(_0x277ccf){if(_0x277ccf){return db[_0x5826('0xc1')][_0x5826('0x36')]({'where':{'SmsAccountId':_0x35c1ed},'transaction':_0x176f70})[_0x5826('0x20')](function(){var _0x7a9f6c=_['map'](_0x355054,function(_0x554890){_0x554890[_0x5826('0x69')]=_0x35c1ed;return _0x554890;});return db[_0x5826('0xc1')][_0x5826('0xc2')](_0x7a9f6c,{'transaction':_0x176f70});});}else{_0x3ec63a=0x194;_0x5a73de=[];}});})[_0x5826('0x20')](function(){if(_0x3ec63a!==0x194){return db[_0x5826('0xc1')][_0x5826('0xc3')]({'where':{'SmsAccountId':_0x35c1ed},'order':_0x5826('0x79')})[_0x5826('0x20')](function(_0x1fd08a){_0x5a73de=_0x1fd08a;});}})[_0x5826('0x5a')](function(_0x2d3437){_0x3ec63a=0x1f4;logger[_0x5826('0x26')](_0x2d3437['stack']);if(_0x2d3437[_0x5826('0x3b')]){delete _0x2d3437['name'];}_0x5a73de=_0x2d3437;})['finally'](function(){if(_0x5a73de===null){_0x190981['sendStatus'](_0x3ec63a);}else{if(_0x3ec63a===0x1f4){_0x190981[_0x5826('0x2c')](_0x3ec63a)['send'](_0x5a73de);}else{_0x190981[_0x5826('0x2c')](_0x3ec63a)[_0x5826('0x31')](_0x5a73de);}}});};exports[_0x5826('0xc4')]=function(_0x4511e7,_0x344138,_0x54aff5){var _0x1241ce={};var _0x10bec8={};var _0x26e3c1;var _0x2806a4;return db[_0x5826('0x41')][_0x5826('0x6a')]({'where':{'id':_0x4511e7[_0x5826('0x5c')]['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x344138,null))[_0x5826('0x20')](function(_0x472639){if(_0x472639){_0x26e3c1=_0x472639;_0x10bec8[_0x5826('0x4a')]=_['keys'](db[_0x5826('0xc1')]['rawAttributes']);_0x10bec8['query']=_[_0x5826('0x46')](_0x4511e7['query']);_0x10bec8[_0x5826('0x47')]=_[_0x5826('0x48')](_0x10bec8[_0x5826('0x4a')],_0x10bec8[_0x5826('0x45')]);_0x1241ce['attributes']=_[_0x5826('0x48')](_0x10bec8[_0x5826('0x4a')],qs[_0x5826('0x4b')](_0x4511e7['query'][_0x5826('0x4b')]));_0x1241ce['attributes']=_0x1241ce[_0x5826('0x49')][_0x5826('0x70')]?_0x1241ce['attributes']:_0x10bec8[_0x5826('0x4a')];_0x1241ce['order']=qs[_0x5826('0x4f')](_0x4511e7['query'][_0x5826('0x4f')]);_0x1241ce['where']=qs[_0x5826('0x47')](_[_0x5826('0x51')](_0x4511e7[_0x5826('0x45')],_0x10bec8['filters']));if(_0x4511e7[_0x5826('0x45')][_0x5826('0x52')]){_0x1241ce[_0x5826('0x50')]=_[_0x5826('0x55')](_0x1241ce['where'],{'$or':_[_0x5826('0x40')](_0x1241ce[_0x5826('0x49')],function(_0x32370b){var _0x4f225b={};_0x4f225b[_0x32370b]={'$like':'%'+_0x4511e7['query'][_0x5826('0x52')]+'%'};return _0x4f225b;})});}_0x1241ce=_['merge']({},_0x1241ce,_0x4511e7[_0x5826('0x56')]);return _0x26e3c1['getApplications'](_0x1241ce);}})[_0x5826('0x20')](function(_0xd402af){if(_0xd402af){_0x2806a4=_0xd402af['length'];if(!_0x4511e7[_0x5826('0x45')][_0x5826('0x4c')]('nolimit')){_0x1241ce[_0x5826('0x2e')]=qs['limit'](_0x4511e7[_0x5826('0x45')][_0x5826('0x2e')]);_0x1241ce[_0x5826('0x30')]=qs['offset'](_0x4511e7[_0x5826('0x45')][_0x5826('0x30')]);}return _0x26e3c1[_0x5826('0xc4')](_0x1241ce);}})[_0x5826('0x20')](function(_0xc12550){if(_0xc12550){return _0xc12550?{'count':_0x2806a4,'rows':_0xc12550}:null;}})['then'](respondWithResult(_0x344138,null))[_0x5826('0x5a')](handleError(_0x344138,null));};exports[_0x5826('0xc5')]=function(_0xddf5bb,_0x200de2,_0x3a63b9){var _0x2502c9={'raw':![],'where':{}};var _0x2a580b={};var _0x3ff5a8={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5826('0x6a')]({'where':{'id':_0xddf5bb[_0x5826('0x5c')]['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x200de2,null))['then'](function(_0x7c114b){if(_0x7c114b){_0x2a580b[_0x5826('0x4a')]=_[_0x5826('0x46')](db['SmsInteraction'][_0x5826('0x42')]);_0x2a580b['query']=_['keys'](_0xddf5bb['query']);_0x2a580b[_0x5826('0x47')]=_[_0x5826('0x48')](_0x2a580b[_0x5826('0x4a')],_0x2a580b[_0x5826('0x45')]);_0x2502c9[_0x5826('0x49')]=_['intersection'](_0x2a580b['model'],qs[_0x5826('0x4b')](_0xddf5bb[_0x5826('0x45')][_0x5826('0x4b')]));_0x2502c9[_0x5826('0x49')]=_0x2502c9[_0x5826('0x49')][_0x5826('0x70')]?_0x2502c9[_0x5826('0x49')]:_0x2a580b[_0x5826('0x4a')];if(!_0xddf5bb[_0x5826('0x45')][_0x5826('0x4c')](_0x5826('0x4d'))){_0x2502c9[_0x5826('0x2e')]=qs[_0x5826('0x2e')](_0xddf5bb[_0x5826('0x45')][_0x5826('0x2e')]);_0x2502c9[_0x5826('0x30')]=qs['offset'](_0xddf5bb[_0x5826('0x45')]['offset']);}_0x2502c9[_0x5826('0x4e')]=qs[_0x5826('0x4f')](_0xddf5bb[_0x5826('0x45')][_0x5826('0x4f')]);_0x2502c9['where']=qs[_0x5826('0x47')](_['pick'](_0xddf5bb['query'],_0x2a580b[_0x5826('0x47')]));_0x2502c9[_0x5826('0x50')][_0x5826('0x69')]=_0x7c114b['id'];if(_0xddf5bb[_0x5826('0x45')][_0x5826('0x52')]){_0x2502c9[_0x5826('0x50')]=_[_0x5826('0x55')](_0x2502c9[_0x5826('0x50')],{'$or':_[_0x5826('0x40')](_0x2502c9[_0x5826('0x49')],function(_0x399113){var _0x4f835a={};_0x4f835a[_0x399113]={'$like':'%'+_0xddf5bb[_0x5826('0x45')][_0x5826('0x52')]+'%'};return _0x4f835a;})});}_0x2502c9=_[_0x5826('0x55')]({},_0x2502c9,_0xddf5bb[_0x5826('0x56')]);return db[_0x5826('0xa1')][_0x5826('0x2f')]({'where':_0x2502c9[_0x5826('0x50')]})[_0x5826('0x20')](function(_0x5a09b6){_0x3ff5a8[_0x5826('0x2f')]=_0x5a09b6;if(_0xddf5bb[_0x5826('0x45')][_0x5826('0x5d')]){_0x2502c9[_0x5826('0x57')]=[{'model':db[_0x5826('0x7b')],'as':'Contact','required':![]},{'model':db[_0x5826('0xae')],'as':_0x5826('0xc6'),'attributes':[_0x5826('0x3b'),_0x5826('0xc7'),_0x5826('0xc8')],'required':![]},{'model':db[_0x5826('0xc9')],'as':_0x5826('0xca'),'attributes':['id',_0x5826('0x3b'),'color'],'where':_0xddf5bb[_0x5826('0x45')]['tag']?{'id':_0xddf5bb[_0x5826('0x45')][_0x5826('0xcb')]}:undefined,'required':_0xddf5bb['query']['tag']?!![]:![]}];}return db[_0x5826('0xa1')][_0x5826('0x58')](_0x2502c9);})[_0x5826('0x20')](function(_0x4fed07){_0x3ff5a8[_0x5826('0x59')]=_0x4fed07;return _0x3ff5a8;});}})[_0x5826('0x20')](respondWithFilteredResult(_0x200de2,_0x2502c9))[_0x5826('0x5a')](handleError(_0x200de2,null));};exports[_0x5826('0x3c')]=function(_0x13bd54,_0x336556,_0x310fe1){var _0x3fd864,_0x34be67,_0x1c135d;if(_[_0x5826('0x97')](_0x13bd54[_0x5826('0x65')][_0x5826('0x65')])||_0x13bd54[_0x5826('0x65')]['body']===''){throw new db[(_0x5826('0x7c'))][(_0x5826('0x7d'))](_0x5826('0x98'));}if(_['isNil'](_0x13bd54['body']['to'])){throw new db[(_0x5826('0x7c'))][(_0x5826('0x7d'))](_0x5826('0xcc'));}_0x3fd864=_0x13bd54[_0x5826('0x65')]['to'];return db[_0x5826('0x41')][_0x5826('0x66')]({'where':{'id':_0x13bd54[_0x5826('0x5c')]['id']},'include':[{'model':db[_0x5826('0x9c')],'as':_0x5826('0xcd'),'include':[{'model':db[_0x5826('0x7b')],'as':_0x5826('0x9d'),'where':{'mobile':_0x3fd864},'limit':0x1,'order':[[_0x5826('0x80'),'DESC']]}]}]})[_0x5826('0x20')](handleEntityNotFound(_0x336556,null))[_0x5826('0x20')](function(_0x338ed2){if(_0x338ed2&&_0x338ed2[_0x5826('0xcd')]){_0x34be67=_0x338ed2[_0x5826('0x60')]({'plain':!![]});if(_0x34be67[_0x5826('0xcd')]&&_0x34be67[_0x5826('0xcd')]['Contacts'][_0x5826('0x70')]){return _0x34be67[_0x5826('0xcd')][_0x5826('0x9d')][0x0];}return db[_0x5826('0x7b')][_0x5826('0x5e')](_[_0x5826('0x1a')](_0x13bd54[_0x5826('0x65')],{'firstName':_0x3fd864,'mobile':_0x3fd864,'phone':_0x3fd864,'ListId':_0x34be67[_0x5826('0x82')]}));}})[_0x5826('0x20')](handleEntityNotFound(_0x336556,null))['then'](function(_0x412eee){if(_0x412eee){_0x1c135d=_0x412eee;return db[_0x5826('0xa1')][_0x5826('0x66')]({'where':{'ContactId':_0x1c135d['id'],'closed':![],'SmsAccountId':_0x34be67['id']}})[_0x5826('0x20')](function(_0x45dcc6){if(_0x45dcc6){return[_0x45dcc6,![]];}return db[_0x5826('0xa1')][_0x5826('0x5e')]({'UserId':_0x13bd54[_0x5826('0x5f')]['id'],'ContactId':_0x1c135d['id'],'SmsAccountId':_0x34be67['id'],'phone':_0x3fd864,'firstMsgDirection':_0x5826('0xce'),'Messages':[_[_0x5826('0x55')](_0x13bd54[_0x5826('0x65')],{'read':![],'body':_0x13bd54[_0x5826('0x65')][_0x5826('0x65')],'phone':_0x3fd864,'SmsAccountId':_0x34be67['id'],'UserId':_0x13bd54[_0x5826('0x5f')]['id'],'ContactId':_0x1c135d['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x5826('0xcf')}]})[_0x5826('0x20')](function(_0x49968d){return[_0x49968d,!![]];});});}})['spread'](function(_0x4d037c,_0x52450e){if(_0x52450e){return _0x4d037c;}return db[_0x5826('0xaa')][_0x5826('0x5e')](_[_0x5826('0x55')](_0x13bd54['body'],{'read':![],'body':_0x13bd54[_0x5826('0x65')][_0x5826('0x65')],'phone':_0x3fd864,'SmsAccountId':_0x34be67['id'],'SmsInteractionId':_0x4d037c['id'],'UserId':_0x13bd54[_0x5826('0x5f')]['id'],'ContactId':_0x1c135d['id']}))[_0x5826('0x20')](function(_0x438174){_0x4d037c[_0x5826('0xd0')][_0x5826('0xcf')]=[];_0x4d037c[_0x5826('0xd0')][_0x5826('0xcf')][_0x5826('0xa6')](_0x438174[_0x5826('0xd0')]);return _0x4d037c;});})[_0x5826('0x20')](respondWithResult(_0x336556,null))[_0x5826('0x5a')](handleError(_0x336556,null));};exports[_0x5826('0x2c')]=function(_0xea6629,_0x37aa9d,_0x2e2196){if(_0xea6629['body']['id']){delete _0xea6629['body']['id'];}var _0x15de57,_0xc967c6,_0x5e28f2;return db['SmsAccount'][_0x5826('0x66')]({'where':{'id':_0xea6629[_0x5826('0x5c')]['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x37aa9d,null))['then'](function(_0x56569d){if(_0x56569d){_0x5e28f2=_0x56569d;logger[_0x5826('0x22')](_0x5826('0x23'),_0x5826('0x2c'),_0x5826('0xd1'),_0x56569d[_0x5826('0x53')],util[_0x5826('0xd2')](_0xea6629[_0x5826('0x65')],{'showHidden':![],'depth':null}));switch(_0x56569d[_0x5826('0x53')]){case _0x5826('0x88'):if(_0xea6629[_0x5826('0x65')][_0x5826('0xd3')]&&_0xea6629[_0x5826('0x65')][_0x5826('0x2c')]){_0xc967c6=_0xea6629[_0x5826('0x65')][_0x5826('0x2c')];return db[_0x5826('0xaa')][_0x5826('0x66')]({'where':{'messageId':_0xea6629['body']['skebby_dispatch_id']}});}break;case _0x5826('0x8b'):if(_0xea6629[_0x5826('0x65')][_0x5826('0xd4')]&&_0xea6629[_0x5826('0x65')]['statusInt']){_0xc967c6=_0xea6629[_0x5826('0x65')][_0x5826('0xd5')];return db[_0x5826('0xaa')][_0x5826('0x66')]({'where':{'messageId':_0xea6629[_0x5826('0x65')]['requestid']}});}break;case'clicksend':if(_0xea6629[_0x5826('0x65')]['message_id']&&_0xea6629[_0x5826('0x65')][_0x5826('0xd6')]){_0xc967c6=_0xea6629[_0x5826('0x65')]['status_code'];return db[_0x5826('0xaa')][_0x5826('0x66')]({'where':{'messageId':_0xea6629[_0x5826('0x65')][_0x5826('0x8c')]}});}break;case'infobip':var _0x28f6ed=_0xea6629[_0x5826('0x65')][_0x5826('0x90')][0x0];if(_0x28f6ed[_0x5826('0x86')]&&_0x28f6ed[_0x5826('0x2c')][_0x5826('0xd7')]==='DELIVERED'){_0xc967c6=_0x28f6ed['status'][_0x5826('0xd7')];return db['SmsMessage'][_0x5826('0x66')]({'where':{'messageId':_0x28f6ed[_0x5826('0x86')]}});}break;case _0x5826('0x93'):if(_0xea6629[_0x5826('0x65')]['messageId']&&_0xea6629[_0x5826('0x65')][_0x5826('0x2c')]){_0xc967c6=_0xea6629[_0x5826('0x65')][_0x5826('0x2c')];return db[_0x5826('0xaa')][_0x5826('0x66')]({'where':{'messageId':_0xea6629['body'][_0x5826('0x86')]}});}break;case _0x5826('0x94'):if(_0xea6629[_0x5826('0x65')][0x0][_0x5826('0x28')]['id']){_0xc967c6=_0xea6629[_0x5826('0x65')][0x0][_0x5826('0x53')];return db[_0x5826('0xaa')][_0x5826('0x66')]({'where':{'messageId':_0xea6629[_0x5826('0x65')][0x0][_0x5826('0x28')]['id']}});}break;case'intelepeer':if(_0xea6629['body'][_0x5826('0xd8')]&&_0xea6629[_0x5826('0x65')]['status']){_0xc967c6=_0xea6629[_0x5826('0x65')][_0x5826('0x2c')];return db['SmsMessage'][_0x5826('0x66')]({'where':{'messageId':_0xea6629[_0x5826('0x65')]['redif']}});}break;}}})[_0x5826('0x20')](handleEntityNotFound(_0x37aa9d,null))[_0x5826('0x20')](function(_0x23aeb4){if(_0x23aeb4){_0x15de57=_0x23aeb4;switch(_0x5e28f2[_0x5826('0x53')]){case _0x5826('0x88'):if(_0xc967c6===_0x5826('0xd9')){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger['error'](_0x5826('0x23'),_0x5826('0x2c'),_0x5826('0x88'),util[_0x5826('0xd2')](_0xea6629[_0x5826('0x65')],{'showHidden':![],'depth':null}));}break;case _0x5826('0x8b'):if(_0xc967c6==='1'){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger[_0x5826('0x26')](_0x5826('0x23'),'status',_0x5826('0x88'),util[_0x5826('0xd2')](_0xea6629['body'],{'showHidden':![],'depth':null}));}break;case _0x5826('0xda'):if(!_0xea6629['body'][_0x5826('0xdb')]&&_0xc967c6>=0xc8&&_0xc967c6<=0xce){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger[_0x5826('0x26')](_0x5826('0x23'),_0x5826('0x2c'),'clicksend',util['inspect'](_0xea6629[_0x5826('0x65')],{'showHidden':![],'depth':null}));}break;case _0x5826('0xdc'):var _0x6b1550=_0xea6629[_0x5826('0x65')][_0x5826('0x90')][0x0];if(_0x6b1550['status']['groupName']===_0x5826('0xd9')){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger[_0x5826('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x5826('0xd2')](_0xea6629[_0x5826('0x65')],{'showHidden':![],'depth':null}));}break;case _0x5826('0x93'):if(_0xc967c6==_0x5826('0xdd')||_0xc967c6==_0x5826('0xde')){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger[_0x5826('0x26')](_0x5826('0x23'),_0x5826('0x2c'),_0x5826('0x93'),util[_0x5826('0xd2')](_0xea6629[_0x5826('0x65')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0xc967c6=='message-delivered'){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger[_0x5826('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5826('0x2c'),_0x5826('0x94'),util[_0x5826('0xd2')](_0xea6629[_0x5826('0x65')],{'showHidden':![],'depth':null}));}break;case _0x5826('0x95'):if(_0xc967c6==='DELIVRD'||_0xc967c6===_0x5826('0xdf')){return _0x15de57[_0x5826('0x35')]({'read':!![]});}else{logger['error'](_0x5826('0x23'),_0x5826('0x2c'),_0x5826('0x95'),util[_0x5826('0xd2')](_0xea6629['body'],{'showHidden':![],'depth':null}));}break;}return _0x15de57;}})[_0x5826('0x20')](respondWithResult(_0x37aa9d,null))[_0x5826('0x5a')](handleError(_0x37aa9d,null));};exports[_0x5826('0xe0')]=function(_0x3c66fa,_0x45e1ac,_0x55ca01){var _0x5686fa,_0xbb4397,_0x276beb;return db['SmsAccount'][_0x5826('0x66')]({'where':{'id':_0x3c66fa['params']['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x45e1ac,null))['then'](function(_0xd70234){if(_0xd70234){_0x276beb=_0xd70234;logger[_0x5826('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5826('0x2c'),_0x5826('0xd1'),_0xd70234[_0x5826('0x53')],util[_0x5826('0xd2')](_0x3c66fa[_0x5826('0x45')],{'showHidden':![],'depth':null}));switch(_0xd70234[_0x5826('0x53')]){case _0x5826('0xe1'):if(_0x3c66fa[_0x5826('0x45')][_0x5826('0xe2')]&&_0x3c66fa['query'][_0x5826('0xe3')]){_0xbb4397=_0x3c66fa[_0x5826('0x45')][_0x5826('0xe3')];return db[_0x5826('0xaa')][_0x5826('0x66')]({'where':{'messageId':_0x3c66fa[_0x5826('0x45')][_0x5826('0xe2')]}});}break;}}})[_0x5826('0x20')](handleEntityNotFound(_0x45e1ac,null))[_0x5826('0x20')](function(_0x38bebd){if(_0x38bebd){_0x5686fa=_0x38bebd;switch(_0x276beb[_0x5826('0x53')]){case'csc':if(_0xbb4397==='2'||_0xbb4397==='6'){return _0x5686fa[_0x5826('0x35')]({'read':!![]});}else{logger[_0x5826('0x26')](_0x5826('0x23'),'status',_0x5826('0xe1'),util['inspect'](_0x3c66fa[_0x5826('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x5686fa;}})['then'](respondWithResult(_0x45e1ac,null))[_0x5826('0x5a')](handleError(_0x45e1ac,null));};exports[_0x5826('0xe4')]=function(_0x3cfff3,_0x4dd86b,_0x14fb2f){return db['SmsAccount'][_0x5826('0x66')]({'where':{'id':_0x3cfff3['params']['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x4dd86b,null))[_0x5826('0x20')](function(_0x9f2c38){if(_0x9f2c38){return _0x9f2c38[_0x5826('0xe4')](_0x3cfff3['body'][_0x5826('0x72')],_[_0x5826('0xe5')](_0x3cfff3[_0x5826('0x65')],[_0x5826('0x72'),'id'])||{})[_0x5826('0xa2')](function(_0x37a899){for(var _0x561e64=0x0;_0x561e64<_0x3cfff3['body'][_0x5826('0x72')]['length'];_0x561e64+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x3cfff3[_0x5826('0x65')][_0x5826('0x72')][_0x561e64]),'SmsAccountId':Number(_0x3cfff3[_0x5826('0x5c')]['id'])});}return _0x37a899;});}})[_0x5826('0x20')](respondWithResult(_0x4dd86b,null))['catch'](handleError(_0x4dd86b,null));};exports[_0x5826('0xe6')]=function(_0x5af52e,_0x116f5d,_0x3da5b8){return db[_0x5826('0x41')][_0x5826('0x66')]({'where':{'id':_0x5af52e[_0x5826('0x5c')]['id']}})['then'](handleEntityNotFound(_0x116f5d,null))[_0x5826('0x20')](function(_0xa7c1e4){if(_0xa7c1e4){return _0xa7c1e4[_0x5826('0xe6')](_0x5af52e[_0x5826('0x45')]['ids'])[_0x5826('0x20')](function(){if(_['isArray'](_0x5af52e[_0x5826('0x45')]['ids'])){for(var _0x5068bd=0x0;_0x5068bd<_0x5af52e[_0x5826('0x45')][_0x5826('0x72')][_0x5826('0x70')];_0x5068bd+=0x1){socket['emit'](_0x5826('0xe7'),{'UserId':Number(_0x5af52e['query'][_0x5826('0x72')][_0x5068bd]),'SmsAccountId':Number(_0x5af52e[_0x5826('0x5c')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5af52e[_0x5826('0x45')][_0x5826('0x72')]),'SmsAccountId':Number(_0x5af52e[_0x5826('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x116f5d,null))[_0x5826('0x5a')](handleError(_0x116f5d,null));};exports['getAgents']=function(_0x889769,_0x5616c6,_0x4cfa1){var _0x5743aa={};var _0x51c4f8={};var _0x2e18bd;var _0x4991f1;return db[_0x5826('0x41')]['findOne']({'where':{'id':_0x889769['params']['id']}})[_0x5826('0x20')](handleEntityNotFound(_0x5616c6,null))[_0x5826('0x20')](function(_0x3e8a21){if(_0x3e8a21){_0x2e18bd=_0x3e8a21;_0x51c4f8[_0x5826('0x4a')]=_[_0x5826('0x46')](db[_0x5826('0xae')][_0x5826('0x42')]);_0x51c4f8[_0x5826('0x45')]=_[_0x5826('0x46')](_0x889769[_0x5826('0x45')]);_0x51c4f8[_0x5826('0x47')]=_[_0x5826('0x48')](_0x51c4f8['model'],_0x51c4f8[_0x5826('0x45')]);_0x5743aa[_0x5826('0x49')]=_[_0x5826('0x48')](_0x51c4f8[_0x5826('0x4a')],qs[_0x5826('0x4b')](_0x889769[_0x5826('0x45')][_0x5826('0x4b')]));_0x5743aa[_0x5826('0x49')]=_0x5743aa[_0x5826('0x49')]['length']?_0x5743aa[_0x5826('0x49')]:_0x51c4f8[_0x5826('0x4a')];_0x5743aa[_0x5826('0x4e')]=qs['sort'](_0x889769['query'][_0x5826('0x4f')]);_0x5743aa[_0x5826('0x50')]=qs['filters'](_[_0x5826('0x51')](_0x889769[_0x5826('0x45')],_0x51c4f8[_0x5826('0x47')]));if(_0x889769[_0x5826('0x45')][_0x5826('0x52')]){_0x5743aa['where']=_[_0x5826('0x55')](_0x5743aa['where'],{'$or':_[_0x5826('0x40')](_0x5743aa[_0x5826('0x49')],function(_0x599fe5){var _0xe22829={};_0xe22829[_0x599fe5]={'$like':'%'+_0x889769[_0x5826('0x45')][_0x5826('0x52')]+'%'};return _0xe22829;})});}_0x5743aa=_[_0x5826('0x55')]({},_0x5743aa,_0x889769['options']);return _0x2e18bd[_0x5826('0xe8')](_0x5743aa);}})['then'](function(_0x43e3e7){if(_0x43e3e7){_0x4991f1=_0x43e3e7[_0x5826('0x70')];if(!_0x889769[_0x5826('0x45')]['hasOwnProperty']('nolimit')){_0x5743aa[_0x5826('0x2e')]=qs[_0x5826('0x2e')](_0x889769[_0x5826('0x45')][_0x5826('0x2e')]);_0x5743aa[_0x5826('0x30')]=qs[_0x5826('0x30')](_0x889769['query'][_0x5826('0x30')]);}return _0x2e18bd[_0x5826('0xe8')](_0x5743aa);}})[_0x5826('0x20')](function(_0x33487f){if(_0x33487f){return _0x33487f?{'count':_0x4991f1,'rows':_0x33487f}:null;}})[_0x5826('0x20')](respondWithResult(_0x5616c6,null))['catch'](handleError(_0x5616c6,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 579ea07..7305890 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 _0x9525=['exports','events','SmsAccount','save','update','emit','hook'];(function(_0x388a67,_0x42f613){var _0x4bdfb4=function(_0x4dc8d3){while(--_0x4dc8d3){_0x388a67['push'](_0x388a67['shift']());}};_0x4bdfb4(++_0x42f613);}(_0x9525,0x7f));var _0x5952=function(_0x2db896,_0x165786){_0x2db896=_0x2db896-0x0;var _0x3a281f=_0x9525[_0x2db896];return _0x3a281f;};'use strict';var EventEmitter=require(_0x5952('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x5952('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5952('0x2'),'afterUpdate':_0x5952('0x3'),'afterDestroy':'remove'};function emitEvent(_0x317831){return function(_0x153925,_0x33b957,_0x343cf0){SmsAccountEvents[_0x5952('0x4')](_0x317831+':'+_0x153925['id'],_0x153925);SmsAccountEvents['emit'](_0x317831,_0x153925);_0x343cf0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x5952('0x5')](e,emitEvent(event));}}module[_0x5952('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0xf22c=['exports','../../mysqldb','SmsAccount','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x34bff4,_0x51d3b7){var _0x438688=function(_0x443247){while(--_0x443247){_0x34bff4['push'](_0x34bff4['shift']());}};_0x438688(++_0x51d3b7);}(_0xf22c,0x69));var _0xcf22=function(_0x2b9d65,_0x72a3f9){_0x2b9d65=_0x2b9d65-0x0;var _0x412cd4=_0xf22c[_0x2b9d65];return _0x412cd4;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xcf22('0x0'))['db'][_0xcf22('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xcf22('0x2')](0x0);var events={'afterCreate':_0xcf22('0x3'),'afterUpdate':'update','afterDestroy':_0xcf22('0x4')};function emitEvent(_0x492a30){return function(_0x12853e,_0x4c3f61,_0x54768b){SmsAccountEvents['emit'](_0x492a30+':'+_0x12853e['id'],_0x12853e);SmsAccountEvents['emit'](_0x492a30,_0x12853e);_0x54768b(null);};}for(var e in events){if(events[_0xcf22('0x5')](e)){var event=events[e];SmsAccount[_0xcf22('0x6')](e,emitEvent(event));}}module[_0xcf22('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 3f19ee0..8e447ed 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 _0xb973=['rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb973,0x123));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3b97('0x0'));var logger=require(_0x3b97('0x1'))('api');var moment=require(_0x3b97('0x2'));var BPromise=require(_0x3b97('0x3'));var rp=require(_0x3b97('0x4'));var fs=require('fs');var path=require(_0x3b97('0x5'));var rimraf=require(_0x3b97('0x6'));var config=require(_0x3b97('0x7'));var attributes=require(_0x3b97('0x8'));module['exports']=function(_0x11be6e,_0x3c0ecf){return _0x11be6e[_0x3b97('0x9')](_0x3b97('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d76=['SmsAccount','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','define'];(function(_0x125cc5,_0x292ea2){var _0x395c66=function(_0x2bcb59){while(--_0x2bcb59){_0x125cc5['push'](_0x125cc5['shift']());}};_0x395c66(++_0x292ea2);}(_0x5d76,0xac));var _0x65d7=function(_0x513ee0,_0x29e3c4){_0x513ee0=_0x513ee0-0x0;var _0x424bae=_0x5d76[_0x513ee0];return _0x424bae;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x65d7('0x0'));var moment=require(_0x65d7('0x1'));var BPromise=require(_0x65d7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65d7('0x3'));var rimraf=require(_0x65d7('0x4'));var config=require(_0x65d7('0x5'));var attributes=require(_0x65d7('0x6'));module['exports']=function(_0x5c6bc5,_0x38cd66){return _0x5c6bc5[_0x65d7('0x7')](_0x65d7('0x8'),attributes,{'tableName':'sms_accounts','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 bac298e..e71575d 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 _0xdbe9=['stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ShowSmsAccount','SmsAccount','find','options','raw','attributes','map','include','model'];(function(_0x2241aa,_0x527f6a){var _0x530380=function(_0x4c4105){while(--_0x4c4105){_0x2241aa['push'](_0x2241aa['shift']());}};_0x530380(++_0x527f6a);}(_0xdbe9,0xe6));var _0x9dbe=function(_0xa24e34,_0x22225c){_0xa24e34=_0xa24e34-0x0;var _0x56a887=_0xdbe9[_0xa24e34];return _0x56a887;};'use strict';var _=require(_0x9dbe('0x0'));var util=require(_0x9dbe('0x1'));var moment=require(_0x9dbe('0x2'));var BPromise=require(_0x9dbe('0x3'));var rs=require(_0x9dbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dbe('0x5'))['db'];var utils=require(_0x9dbe('0x6'));var logger=require(_0x9dbe('0x7'))(_0x9dbe('0x8'));var config=require(_0x9dbe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9dbe('0xa')][_0x9dbe('0xb')]({'port':0x232a});config[_0x9dbe('0xc')]=_['defaults'](config[_0x9dbe('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9dbe('0xd'))(new Redis(config[_0x9dbe('0xc')]));require(_0x9dbe('0xe'))[_0x9dbe('0xf')](socket);function respondWithRpcPromise(_0x138fc8,_0x3a344c,_0x22e3b6){return new BPromise(function(_0x49f34b,_0x41ea1e){return client[_0x9dbe('0x10')](_0x138fc8,_0x22e3b6)[_0x9dbe('0x11')](function(_0x6c03c6){logger[_0x9dbe('0x12')](_0x9dbe('0x13'),_0x3a344c,'request\x20sent');logger[_0x9dbe('0x14')](_0x9dbe('0x15'),_0x3a344c,_0x9dbe('0x16'),JSON['stringify'](_0x6c03c6));if(_0x6c03c6[_0x9dbe('0x17')]){if(_0x6c03c6[_0x9dbe('0x17')][_0x9dbe('0x18')]===0x1f4){logger[_0x9dbe('0x17')](_0x9dbe('0x13'),_0x3a344c,_0x6c03c6[_0x9dbe('0x17')][_0x9dbe('0x19')]);return _0x41ea1e(_0x6c03c6['error'][_0x9dbe('0x19')]);}logger[_0x9dbe('0x17')](_0x9dbe('0x13'),_0x3a344c,_0x6c03c6['error']['message']);return _0x49f34b(_0x6c03c6['error']['message']);}else{logger[_0x9dbe('0x12')](_0x9dbe('0x13'),_0x3a344c,'request\x20sent');_0x49f34b(_0x6c03c6[_0x9dbe('0x1a')][_0x9dbe('0x19')]);}})['catch'](function(_0x125ad2){logger[_0x9dbe('0x17')]('SmsAccount,\x20%s,\x20%s',_0x3a344c,_0x125ad2);_0x41ea1e(_0x125ad2);});});}exports[_0x9dbe('0x1b')]=function(_0x313743){var _0x47e9c8=this;return new Promise(function(_0x55dab5,_0x4e3b7c){return db[_0x9dbe('0x1c')][_0x9dbe('0x1d')]({'raw':_0x313743['options']?_0x313743[_0x9dbe('0x1e')][_0x9dbe('0x1f')]===undefined?!![]:![]:!![],'where':_0x313743[_0x9dbe('0x1e')]?_0x313743[_0x9dbe('0x1e')]['where']||null:null,'attributes':_0x313743[_0x9dbe('0x1e')]?_0x313743['options'][_0x9dbe('0x20')]||null:null,'include':_0x313743[_0x9dbe('0x1e')]?_0x313743[_0x9dbe('0x1e')]['include']?_[_0x9dbe('0x21')](_0x313743[_0x9dbe('0x1e')][_0x9dbe('0x22')],function(_0x4a04b9){return{'model':db[_0x4a04b9[_0x9dbe('0x23')]],'as':_0x4a04b9['as'],'attributes':_0x4a04b9[_0x9dbe('0x20')],'include':_0x4a04b9[_0x9dbe('0x22')]?_['map'](_0x4a04b9[_0x9dbe('0x22')],function(_0x3d8e57){return{'model':db[_0x3d8e57[_0x9dbe('0x23')]],'as':_0x3d8e57['as'],'attributes':_0x3d8e57['attributes'],'include':_0x3d8e57[_0x9dbe('0x22')]?_[_0x9dbe('0x21')](_0x3d8e57[_0x9dbe('0x22')],function(_0xc4d36b){return{'model':db[_0xc4d36b[_0x9dbe('0x23')]],'as':_0xc4d36b['as'],'attributes':_0xc4d36b[_0x9dbe('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9dbe('0x11')](function(_0x1e1f3e){logger[_0x9dbe('0x12')](_0x9dbe('0x1b'),_0x313743);logger[_0x9dbe('0x14')](_0x9dbe('0x1b'),_0x313743,JSON[_0x9dbe('0x24')](_0x1e1f3e));_0x55dab5(_0x1e1f3e);})[_0x9dbe('0x25')](function(_0x309822){logger['error'](_0x9dbe('0x1b'),_0x309822['message'],_0x313743);_0x4e3b7c(_0x47e9c8['error'](0x1f4,_0x309822[_0x9dbe('0x19')]));});});}; \ No newline at end of file +var _0x2e5d=['register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','map','include','model','attributes','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','localhost','redis','./smsAccount.socket'];(function(_0x4c6e1e,_0x27c3a3){var _0x4e6ce9=function(_0x177d52){while(--_0x177d52){_0x4c6e1e['push'](_0x4c6e1e['shift']());}};_0x4e6ce9(++_0x27c3a3);}(_0x2e5d,0x7f));var _0xd2e5=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0x2e5d[_0xc8a11];return _0x55a500;};'use strict';var _=require('lodash');var util=require(_0xd2e5('0x0'));var moment=require('moment');var BPromise=require(_0xd2e5('0x1'));var rs=require(_0xd2e5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2e5('0x3'))['db'];var utils=require(_0xd2e5('0x4'));var logger=require(_0xd2e5('0x5'))(_0xd2e5('0x6'));var config=require(_0xd2e5('0x7'));var jayson=require(_0xd2e5('0x8'));var client=jayson[_0xd2e5('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xd2e5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd2e5('0xb')]));require(_0xd2e5('0xc'))[_0xd2e5('0xd')](socket);function respondWithRpcPromise(_0x3ece80,_0x2b184e,_0x536bf2){return new BPromise(function(_0x5674d9,_0x316f1b){return client[_0xd2e5('0xe')](_0x3ece80,_0x536bf2)[_0xd2e5('0xf')](function(_0x325915){logger[_0xd2e5('0x10')](_0xd2e5('0x11'),_0x2b184e,_0xd2e5('0x12'));logger[_0xd2e5('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2b184e,_0xd2e5('0x12'),JSON[_0xd2e5('0x14')](_0x325915));if(_0x325915[_0xd2e5('0x15')]){if(_0x325915[_0xd2e5('0x15')]['code']===0x1f4){logger[_0xd2e5('0x15')](_0xd2e5('0x11'),_0x2b184e,_0x325915[_0xd2e5('0x15')][_0xd2e5('0x16')]);return _0x316f1b(_0x325915[_0xd2e5('0x15')][_0xd2e5('0x16')]);}logger[_0xd2e5('0x15')](_0xd2e5('0x11'),_0x2b184e,_0x325915[_0xd2e5('0x15')]['message']);return _0x5674d9(_0x325915['error'][_0xd2e5('0x16')]);}else{logger['info'](_0xd2e5('0x11'),_0x2b184e,_0xd2e5('0x12'));_0x5674d9(_0x325915[_0xd2e5('0x17')][_0xd2e5('0x16')]);}})[_0xd2e5('0x18')](function(_0x13e0cc){logger[_0xd2e5('0x15')](_0xd2e5('0x11'),_0x2b184e,_0x13e0cc);_0x316f1b(_0x13e0cc);});});}exports[_0xd2e5('0x19')]=function(_0x35928b){var _0x3cef32=this;return new Promise(function(_0x2e3d26,_0x2407c7){return db[_0xd2e5('0x1a')][_0xd2e5('0x1b')]({'raw':_0x35928b[_0xd2e5('0x1c')]?_0x35928b[_0xd2e5('0x1c')][_0xd2e5('0x1d')]===undefined?!![]:![]:!![],'where':_0x35928b[_0xd2e5('0x1c')]?_0x35928b['options'][_0xd2e5('0x1e')]||null:null,'attributes':_0x35928b[_0xd2e5('0x1c')]?_0x35928b[_0xd2e5('0x1c')]['attributes']||null:null,'include':_0x35928b['options']?_0x35928b[_0xd2e5('0x1c')]['include']?_[_0xd2e5('0x1f')](_0x35928b[_0xd2e5('0x1c')][_0xd2e5('0x20')],function(_0x309a9a){return{'model':db[_0x309a9a[_0xd2e5('0x21')]],'as':_0x309a9a['as'],'attributes':_0x309a9a['attributes'],'include':_0x309a9a[_0xd2e5('0x20')]?_[_0xd2e5('0x1f')](_0x309a9a[_0xd2e5('0x20')],function(_0x2ce1bf){return{'model':db[_0x2ce1bf[_0xd2e5('0x21')]],'as':_0x2ce1bf['as'],'attributes':_0x2ce1bf[_0xd2e5('0x22')],'include':_0x2ce1bf['include']?_[_0xd2e5('0x1f')](_0x2ce1bf[_0xd2e5('0x20')],function(_0x3bc222){return{'model':db[_0x3bc222[_0xd2e5('0x21')]],'as':_0x3bc222['as'],'attributes':_0x3bc222[_0xd2e5('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd2e5('0xf')](function(_0x149ba9){logger[_0xd2e5('0x10')](_0xd2e5('0x19'),_0x35928b);logger[_0xd2e5('0x13')](_0xd2e5('0x19'),_0x35928b,JSON[_0xd2e5('0x14')](_0x149ba9));_0x2e3d26(_0x149ba9);})['catch'](function(_0xb8042){logger[_0xd2e5('0x15')](_0xd2e5('0x19'),_0xb8042[_0xd2e5('0x16')],_0x35928b);_0x2407c7(_0x3cef32[_0xd2e5('0x15')](0x1f4,_0xb8042[_0xd2e5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e0ff975..86f8d74 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 466ce1c..9f416fe 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23345f,_0xc1cd34){var _0x1865e0=function(_0x4c76e3){while(--_0x4c76e3){_0x23345f['push'](_0x23345f['shift']());}};_0x1865e0(++_0xc1cd34);}(_0x34e8,0x12c));var _0x834e=function(_0x594f6f,_0x3d274b){_0x594f6f=_0x594f6f-0x0;var _0x1ab76b=_0x34e8[_0x594f6f];return _0x1ab76b;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x359d63,_0x452178){var _0x9d053a=function(_0x49ca44){while(--_0x49ca44){_0x359d63['push'](_0x359d63['shift']());}};_0x9d053a(++_0x452178);}(_0x7217,0x19e));var _0x7721=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x7217[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 6a91b9c..06630f0 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 _0xb97a=['STRING','TEXT','sequelize','exports'];(function(_0x317696,_0x3fd78b){var _0x268999=function(_0x21a06f){while(--_0x21a06f){_0x317696['push'](_0x317696['shift']());}};_0x268999(++_0x3fd78b);}(_0xb97a,0x82));var _0xab97=function(_0x1a95dd,_0x574f23){_0x1a95dd=_0x1a95dd-0x0;var _0x59c77e=_0xb97a[_0x1a95dd];return _0x59c77e;};'use strict';var Sequelize=require(_0xab97('0x0'));module[_0xab97('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xab97('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xab97('0x3')]()},'description':{'type':Sequelize[_0xab97('0x2')]},'interval':{'type':Sequelize[_0xab97('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc402=['STRING','exports','noop','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc402,0xb1));var _0x2c40=function(_0x51416a,_0x2ce0ca){_0x51416a=_0x51416a-0x0;var _0x37f27e=_0xc402[_0x51416a];return _0x37f27e;};'use strict';var Sequelize=require('sequelize');module[_0x2c40('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c40('0x1')},'appdata':{'type':Sequelize[_0x2c40('0x2')]()},'description':{'type':Sequelize[_0x2c40('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9a30c94..66f5e4a 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 _0xb9e0=['undefined','limit','count','offset','Content-Range','reject','update','then','destroy','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x152314,_0x3891bb){var _0x49bac4=function(_0x4dcbc7){while(--_0x4dcbc7){_0x152314['push'](_0x152314['shift']());}};_0x49bac4(++_0x3891bb);}(_0xb9e0,0x73));var _0x0b9e=function(_0xab4a7c,_0x28b640){_0xab4a7c=_0xab4a7c-0x0;var _0x4b0bd2=_0xb9e0[_0xab4a7c];return _0x4b0bd2;};'use strict';var emlformat=require(_0x0b9e('0x0'));var rimraf=require(_0x0b9e('0x1'));var zipdir=require(_0x0b9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b9e('0x3'));var moment=require(_0x0b9e('0x4'));var BPromise=require(_0x0b9e('0x5'));var Mustache=require(_0x0b9e('0x6'));var util=require('util');var path=require(_0x0b9e('0x7'));var sox=require(_0x0b9e('0x8'));var csv=require(_0x0b9e('0x9'));var ejs=require(_0x0b9e('0xa'));var fs=require('fs');var fs_extra=require(_0x0b9e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0b9e('0xc'));var jsforce=require(_0x0b9e('0xd'));var deskjs=require(_0x0b9e('0xe'));var toCsv=require(_0x0b9e('0x9'));var querystring=require('querystring');var Papa=require(_0x0b9e('0xf'));var Redis=require('ioredis');var authService=require(_0x0b9e('0x10'));var qs=require(_0x0b9e('0x11'));var as=require(_0x0b9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0b9e('0x13'));var utils=require('../../config/utils');var config=require(_0x0b9e('0x14'));var licenseUtil=require(_0x0b9e('0x15'));var db=require(_0x0b9e('0x16'))['db'];function respondWithStatusCode(_0x36cee4,_0x554037){_0x554037=_0x554037||0xcc;return function(_0xe230d9){if(_0xe230d9){return _0x36cee4[_0x0b9e('0x17')](_0x554037);}return _0x36cee4[_0x0b9e('0x18')](_0x554037)[_0x0b9e('0x19')]();};}function respondWithResult(_0x391ef2,_0x2645b7){_0x2645b7=_0x2645b7||0xc8;return function(_0x38cd1b){if(_0x38cd1b){return _0x391ef2[_0x0b9e('0x18')](_0x2645b7)[_0x0b9e('0x1a')](_0x38cd1b);}};}function respondWithFilteredResult(_0x414cf4,_0x92a273){return function(_0x1b9d0a){if(_0x1b9d0a){var _0x234f58=typeof _0x92a273['offset']===_0x0b9e('0x1b')&&typeof _0x92a273[_0x0b9e('0x1c')]===_0x0b9e('0x1b');var _0x477a70=_0x1b9d0a[_0x0b9e('0x1d')];var _0x3669c7=_0x234f58?0x0:_0x92a273[_0x0b9e('0x1e')];var _0x4ce0f9=_0x234f58?_0x1b9d0a['count']:_0x92a273['offset']+_0x92a273['limit'];var _0x3228fd;if(_0x4ce0f9>=_0x477a70){_0x4ce0f9=_0x477a70;_0x3228fd=0xc8;}else{_0x3228fd=0xce;}_0x414cf4[_0x0b9e('0x18')](_0x3228fd);return _0x414cf4['set'](_0x0b9e('0x1f'),_0x3669c7+'-'+_0x4ce0f9+'/'+_0x477a70)['json'](_0x1b9d0a);}return null;};}function patchUpdates(_0x26751c){return function(_0x5d693c){try{jsonpatch['apply'](_0x5d693c,_0x26751c,!![]);}catch(_0x15c1be){return BPromise[_0x0b9e('0x20')](_0x15c1be);}return _0x5d693c['save']();};}function saveUpdates(_0x445420,_0x4acc0f){return function(_0x3fd3e6){if(_0x3fd3e6){return _0x3fd3e6[_0x0b9e('0x21')](_0x445420)[_0x0b9e('0x22')](function(_0x384ee0){return _0x384ee0;});}return null;};}function removeEntity(_0x2e9994,_0x49a7b3){return function(_0x2660a0){if(_0x2660a0){return _0x2660a0[_0x0b9e('0x23')]()[_0x0b9e('0x22')](function(){_0x2e9994[_0x0b9e('0x18')](0xcc)[_0x0b9e('0x19')]();});}};}function handleEntityNotFound(_0x11228b,_0x58c407){return function(_0x844484){if(!_0x844484){_0x11228b[_0x0b9e('0x17')](0x194);}return _0x844484;};}function handleError(_0xf35802,_0x2827dc){_0x2827dc=_0x2827dc||0x1f4;return function(_0x2b1021){logger['error'](_0x2b1021['stack']);if(_0x2b1021[_0x0b9e('0x24')]){delete _0x2b1021[_0x0b9e('0x24')];}_0xf35802[_0x0b9e('0x18')](_0x2827dc)[_0x0b9e('0x25')](_0x2b1021);};}exports[_0x0b9e('0x26')]=function(_0x40fe95,_0x102491){var _0x2cead4={},_0x234092={},_0x2b43ec={'count':0x0,'rows':[]};var _0xa2baa6=_[_0x0b9e('0x27')](db[_0x0b9e('0x28')][_0x0b9e('0x29')],function(_0x281531){return{'name':_0x281531[_0x0b9e('0x2a')],'type':_0x281531['type'][_0x0b9e('0x2b')]};});_0x234092[_0x0b9e('0x2c')]=_[_0x0b9e('0x27')](_0xa2baa6,_0x0b9e('0x24'));_0x234092[_0x0b9e('0x2d')]=_[_0x0b9e('0x2e')](_0x40fe95['query']);_0x234092[_0x0b9e('0x2f')]=_['intersection'](_0x234092[_0x0b9e('0x2c')],_0x234092[_0x0b9e('0x2d')]);_0x2cead4['attributes']=_[_0x0b9e('0x30')](_0x234092[_0x0b9e('0x2c')],qs[_0x0b9e('0x31')](_0x40fe95[_0x0b9e('0x2d')]['fields']));_0x2cead4[_0x0b9e('0x32')]=_0x2cead4[_0x0b9e('0x32')][_0x0b9e('0x33')]?_0x2cead4['attributes']:_0x234092[_0x0b9e('0x2c')];if(!_0x40fe95[_0x0b9e('0x2d')][_0x0b9e('0x34')]('nolimit')){_0x2cead4['limit']=qs['limit'](_0x40fe95[_0x0b9e('0x2d')]['limit']);_0x2cead4[_0x0b9e('0x1e')]=qs[_0x0b9e('0x1e')](_0x40fe95[_0x0b9e('0x2d')][_0x0b9e('0x1e')]);}_0x2cead4[_0x0b9e('0x35')]=qs[_0x0b9e('0x36')](_0x40fe95['query']['sort']);_0x2cead4[_0x0b9e('0x37')]=qs[_0x0b9e('0x2f')](_[_0x0b9e('0x38')](_0x40fe95[_0x0b9e('0x2d')],_0x234092[_0x0b9e('0x2f')]),_0xa2baa6);if(_0x40fe95['query'][_0x0b9e('0x39')]){_0x2cead4[_0x0b9e('0x37')]=_[_0x0b9e('0x3a')](_0x2cead4[_0x0b9e('0x37')],{'$or':_[_0x0b9e('0x27')](_0xa2baa6,function(_0x1a5992){if(_0x1a5992[_0x0b9e('0x3b')]!==_0x0b9e('0x3c')){var _0x9e7e9b={};_0x9e7e9b[_0x1a5992[_0x0b9e('0x24')]]={'$like':'%'+_0x40fe95[_0x0b9e('0x2d')][_0x0b9e('0x39')]+'%'};return _0x9e7e9b;}})});}_0x2cead4=_['merge']({},_0x2cead4,_0x40fe95[_0x0b9e('0x3d')]);var _0x3ccec2={'where':_0x2cead4['where']};return db['SmsApplication'][_0x0b9e('0x1d')](_0x3ccec2)[_0x0b9e('0x22')](function(_0x2c9f37){_0x2b43ec[_0x0b9e('0x1d')]=_0x2c9f37;if(_0x40fe95['query'][_0x0b9e('0x3e')]){_0x2cead4[_0x0b9e('0x3f')]=[{'all':!![]}];}return db[_0x0b9e('0x28')]['findAll'](_0x2cead4);})[_0x0b9e('0x22')](function(_0x42ecd8){_0x2b43ec[_0x0b9e('0x40')]=_0x42ecd8;return _0x2b43ec;})[_0x0b9e('0x22')](respondWithFilteredResult(_0x102491,_0x2cead4))[_0x0b9e('0x41')](handleError(_0x102491,null));};exports[_0x0b9e('0x42')]=function(_0x5433bd,_0x28bbfb){var _0x20192f={'raw':!![],'where':{'id':_0x5433bd[_0x0b9e('0x43')]['id']}},_0x469e45={};_0x469e45['model']=_[_0x0b9e('0x2e')](db['SmsApplication'][_0x0b9e('0x29')]);_0x469e45[_0x0b9e('0x2d')]=_[_0x0b9e('0x2e')](_0x5433bd['query']);_0x469e45[_0x0b9e('0x2f')]=_['intersection'](_0x469e45[_0x0b9e('0x2c')],_0x469e45[_0x0b9e('0x2d')]);_0x20192f['attributes']=_[_0x0b9e('0x30')](_0x469e45['model'],qs[_0x0b9e('0x31')](_0x5433bd[_0x0b9e('0x2d')][_0x0b9e('0x31')]));_0x20192f[_0x0b9e('0x32')]=_0x20192f[_0x0b9e('0x32')][_0x0b9e('0x33')]?_0x20192f[_0x0b9e('0x32')]:_0x469e45[_0x0b9e('0x2c')];if(_0x5433bd[_0x0b9e('0x2d')][_0x0b9e('0x3e')]){_0x20192f[_0x0b9e('0x3f')]=[{'all':!![]}];}_0x20192f=_[_0x0b9e('0x3a')]({},_0x20192f,_0x5433bd[_0x0b9e('0x3d')]);return db[_0x0b9e('0x28')][_0x0b9e('0x44')](_0x20192f)[_0x0b9e('0x22')](handleEntityNotFound(_0x28bbfb,null))[_0x0b9e('0x22')](respondWithResult(_0x28bbfb,null))[_0x0b9e('0x41')](handleError(_0x28bbfb,null));};exports[_0x0b9e('0x45')]=function(_0x5ad57,_0x5b21c9){return db['SmsApplication'][_0x0b9e('0x45')](_0x5ad57[_0x0b9e('0x46')],{})['then'](respondWithResult(_0x5b21c9,0xc9))[_0x0b9e('0x41')](handleError(_0x5b21c9,null));};exports[_0x0b9e('0x21')]=function(_0x69250d,_0x2c835b){if(_0x69250d[_0x0b9e('0x46')]['id']){delete _0x69250d[_0x0b9e('0x46')]['id'];}return db[_0x0b9e('0x28')][_0x0b9e('0x44')]({'where':{'id':_0x69250d[_0x0b9e('0x43')]['id']}})[_0x0b9e('0x22')](handleEntityNotFound(_0x2c835b,null))[_0x0b9e('0x22')](saveUpdates(_0x69250d[_0x0b9e('0x46')],null))[_0x0b9e('0x22')](respondWithResult(_0x2c835b,null))['catch'](handleError(_0x2c835b,null));};exports[_0x0b9e('0x23')]=function(_0x305f80,_0x12ebca){return db['SmsApplication'][_0x0b9e('0x44')]({'where':{'id':_0x305f80[_0x0b9e('0x43')]['id']}})['then'](handleEntityNotFound(_0x12ebca,null))[_0x0b9e('0x22')](removeEntity(_0x12ebca,null))['catch'](handleError(_0x12ebca,null));}; \ No newline at end of file +var _0x1e05=['undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','rows','show','options','find','catch','create','body','params','eml-format','rimraf','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0xf5c514,_0x352f43){var _0x52e317=function(_0x70ae7a){while(--_0x70ae7a){_0xf5c514['push'](_0xf5c514['shift']());}};_0x52e317(++_0x352f43);}(_0x1e05,0x72));var _0x51e0=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0x1e05[_0x337a10];return _0x575f98;};'use strict';var emlformat=require(_0x51e0('0x0'));var rimraf=require(_0x51e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51e0('0x3'));var util=require(_0x51e0('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x51e0('0x5'));var ejs=require(_0x51e0('0x6'));var fs=require('fs');var fs_extra=require(_0x51e0('0x7'));var _=require(_0x51e0('0x8'));var squel=require('squel');var crypto=require(_0x51e0('0x9'));var jsforce=require(_0x51e0('0xa'));var deskjs=require(_0x51e0('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x51e0('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x51e0('0xd'));var as=require(_0x51e0('0xe'));var hardwareService=require(_0x51e0('0xf'));var logger=require('../../config/logger')(_0x51e0('0x10'));var utils=require(_0x51e0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x51e0('0x12'));var db=require(_0x51e0('0x13'))['db'];function respondWithStatusCode(_0x2e8c7a,_0x594025){_0x594025=_0x594025||0xcc;return function(_0x6c5995){if(_0x6c5995){return _0x2e8c7a['sendStatus'](_0x594025);}return _0x2e8c7a[_0x51e0('0x14')](_0x594025)[_0x51e0('0x15')]();};}function respondWithResult(_0x151f04,_0x2dde24){_0x2dde24=_0x2dde24||0xc8;return function(_0x2f4c62){if(_0x2f4c62){return _0x151f04[_0x51e0('0x14')](_0x2dde24)[_0x51e0('0x16')](_0x2f4c62);}};}function respondWithFilteredResult(_0x458e4b,_0x349c66){return function(_0x89d5cb){if(_0x89d5cb){var _0x1a6f54=typeof _0x349c66[_0x51e0('0x17')]===_0x51e0('0x18')&&typeof _0x349c66[_0x51e0('0x19')]===_0x51e0('0x18');var _0x4dd8ba=_0x89d5cb[_0x51e0('0x1a')];var _0x4bf216=_0x1a6f54?0x0:_0x349c66[_0x51e0('0x17')];var _0xcf1424=_0x1a6f54?_0x89d5cb[_0x51e0('0x1a')]:_0x349c66[_0x51e0('0x17')]+_0x349c66[_0x51e0('0x19')];var _0x58a16f;if(_0xcf1424>=_0x4dd8ba){_0xcf1424=_0x4dd8ba;_0x58a16f=0xc8;}else{_0x58a16f=0xce;}_0x458e4b[_0x51e0('0x14')](_0x58a16f);return _0x458e4b[_0x51e0('0x1b')](_0x51e0('0x1c'),_0x4bf216+'-'+_0xcf1424+'/'+_0x4dd8ba)[_0x51e0('0x16')](_0x89d5cb);}return null;};}function patchUpdates(_0x42eb28){return function(_0x3db910){try{jsonpatch['apply'](_0x3db910,_0x42eb28,!![]);}catch(_0x1a1830){return BPromise[_0x51e0('0x1d')](_0x1a1830);}return _0x3db910[_0x51e0('0x1e')]();};}function saveUpdates(_0x3329d1,_0x558328){return function(_0x4686f2){if(_0x4686f2){return _0x4686f2[_0x51e0('0x1f')](_0x3329d1)[_0x51e0('0x20')](function(_0x3edb81){return _0x3edb81;});}return null;};}function removeEntity(_0x3b34b0,_0x1da596){return function(_0x1673c0){if(_0x1673c0){return _0x1673c0['destroy']()[_0x51e0('0x20')](function(){_0x3b34b0[_0x51e0('0x14')](0xcc)[_0x51e0('0x15')]();});}};}function handleEntityNotFound(_0x33ba26,_0x2c59eb){return function(_0x543489){if(!_0x543489){_0x33ba26[_0x51e0('0x21')](0x194);}return _0x543489;};}function handleError(_0x36b83d,_0x16fb6d){_0x16fb6d=_0x16fb6d||0x1f4;return function(_0x589952){logger[_0x51e0('0x22')](_0x589952[_0x51e0('0x23')]);if(_0x589952['name']){delete _0x589952[_0x51e0('0x24')];}_0x36b83d[_0x51e0('0x14')](_0x16fb6d)['send'](_0x589952);};}exports['index']=function(_0x22c089,_0x8567cc){var _0x588657={},_0x672e38={},_0x403205={'count':0x0,'rows':[]};var _0x191490=_[_0x51e0('0x25')](db[_0x51e0('0x26')][_0x51e0('0x27')],function(_0x30be1f){return{'name':_0x30be1f[_0x51e0('0x28')],'type':_0x30be1f[_0x51e0('0x29')][_0x51e0('0x2a')]};});_0x672e38['model']=_['map'](_0x191490,_0x51e0('0x24'));_0x672e38[_0x51e0('0x2b')]=_[_0x51e0('0x2c')](_0x22c089['query']);_0x672e38[_0x51e0('0x2d')]=_['intersection'](_0x672e38['model'],_0x672e38[_0x51e0('0x2b')]);_0x588657['attributes']=_[_0x51e0('0x2e')](_0x672e38[_0x51e0('0x2f')],qs[_0x51e0('0x30')](_0x22c089[_0x51e0('0x2b')][_0x51e0('0x30')]));_0x588657['attributes']=_0x588657[_0x51e0('0x31')][_0x51e0('0x32')]?_0x588657[_0x51e0('0x31')]:_0x672e38['model'];if(!_0x22c089[_0x51e0('0x2b')][_0x51e0('0x33')](_0x51e0('0x34'))){_0x588657[_0x51e0('0x19')]=qs[_0x51e0('0x19')](_0x22c089[_0x51e0('0x2b')][_0x51e0('0x19')]);_0x588657[_0x51e0('0x17')]=qs[_0x51e0('0x17')](_0x22c089[_0x51e0('0x2b')][_0x51e0('0x17')]);}_0x588657[_0x51e0('0x35')]=qs['sort'](_0x22c089[_0x51e0('0x2b')][_0x51e0('0x36')]);_0x588657[_0x51e0('0x37')]=qs[_0x51e0('0x2d')](_[_0x51e0('0x38')](_0x22c089[_0x51e0('0x2b')],_0x672e38['filters']),_0x191490);if(_0x22c089[_0x51e0('0x2b')]['filter']){_0x588657[_0x51e0('0x37')]=_['merge'](_0x588657[_0x51e0('0x37')],{'$or':_[_0x51e0('0x25')](_0x191490,function(_0x3fd241){if(_0x3fd241[_0x51e0('0x29')]!==_0x51e0('0x39')){var _0x50d0cd={};_0x50d0cd[_0x3fd241[_0x51e0('0x24')]]={'$like':'%'+_0x22c089[_0x51e0('0x2b')][_0x51e0('0x3a')]+'%'};return _0x50d0cd;}})});}_0x588657=_[_0x51e0('0x3b')]({},_0x588657,_0x22c089['options']);var _0x2bae6d={'where':_0x588657[_0x51e0('0x37')]};return db[_0x51e0('0x26')][_0x51e0('0x1a')](_0x2bae6d)[_0x51e0('0x20')](function(_0x5d19b0){_0x403205[_0x51e0('0x1a')]=_0x5d19b0;if(_0x22c089[_0x51e0('0x2b')][_0x51e0('0x3c')]){_0x588657['include']=[{'all':!![]}];}return db[_0x51e0('0x26')]['findAll'](_0x588657);})[_0x51e0('0x20')](function(_0x149769){_0x403205[_0x51e0('0x3d')]=_0x149769;return _0x403205;})[_0x51e0('0x20')](respondWithFilteredResult(_0x8567cc,_0x588657))['catch'](handleError(_0x8567cc,null));};exports[_0x51e0('0x3e')]=function(_0x561d01,_0x4c3982){var _0x5b65de={'raw':!![],'where':{'id':_0x561d01['params']['id']}},_0x8ef206={};_0x8ef206['model']=_['keys'](db[_0x51e0('0x26')][_0x51e0('0x27')]);_0x8ef206[_0x51e0('0x2b')]=_[_0x51e0('0x2c')](_0x561d01[_0x51e0('0x2b')]);_0x8ef206[_0x51e0('0x2d')]=_[_0x51e0('0x2e')](_0x8ef206[_0x51e0('0x2f')],_0x8ef206[_0x51e0('0x2b')]);_0x5b65de[_0x51e0('0x31')]=_[_0x51e0('0x2e')](_0x8ef206[_0x51e0('0x2f')],qs[_0x51e0('0x30')](_0x561d01[_0x51e0('0x2b')][_0x51e0('0x30')]));_0x5b65de[_0x51e0('0x31')]=_0x5b65de[_0x51e0('0x31')][_0x51e0('0x32')]?_0x5b65de[_0x51e0('0x31')]:_0x8ef206[_0x51e0('0x2f')];if(_0x561d01['query'][_0x51e0('0x3c')]){_0x5b65de['include']=[{'all':!![]}];}_0x5b65de=_['merge']({},_0x5b65de,_0x561d01[_0x51e0('0x3f')]);return db[_0x51e0('0x26')][_0x51e0('0x40')](_0x5b65de)[_0x51e0('0x20')](handleEntityNotFound(_0x4c3982,null))[_0x51e0('0x20')](respondWithResult(_0x4c3982,null))[_0x51e0('0x41')](handleError(_0x4c3982,null));};exports['create']=function(_0x3c834a,_0x99b431){return db[_0x51e0('0x26')][_0x51e0('0x42')](_0x3c834a['body'],{})[_0x51e0('0x20')](respondWithResult(_0x99b431,0xc9))['catch'](handleError(_0x99b431,null));};exports[_0x51e0('0x1f')]=function(_0x10bed2,_0x559097){if(_0x10bed2[_0x51e0('0x43')]['id']){delete _0x10bed2[_0x51e0('0x43')]['id'];}return db['SmsApplication'][_0x51e0('0x40')]({'where':{'id':_0x10bed2['params']['id']}})[_0x51e0('0x20')](handleEntityNotFound(_0x559097,null))[_0x51e0('0x20')](saveUpdates(_0x10bed2[_0x51e0('0x43')],null))[_0x51e0('0x20')](respondWithResult(_0x559097,null))[_0x51e0('0x41')](handleError(_0x559097,null));};exports['destroy']=function(_0x45b6ec,_0x27fc2a){return db[_0x51e0('0x26')][_0x51e0('0x40')]({'where':{'id':_0x45b6ec[_0x51e0('0x44')]['id']}})[_0x51e0('0x20')](handleEntityNotFound(_0x27fc2a,null))['then'](removeEntity(_0x27fc2a,null))[_0x51e0('0x41')](handleError(_0x27fc2a,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index dd5dbb5..98041fb 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 _0xc72f=['../../config/logger','moment','bluebird','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5998c7,_0x514254){var _0x321421=function(_0x2f0987){while(--_0x2f0987){_0x5998c7['push'](_0x5998c7['shift']());}};_0x321421(++_0x514254);}(_0xc72f,0x9b));var _0xfc72=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc72f[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xfc72('0x0'));var util=require('util');var logger=require(_0xfc72('0x1'))('api');var moment=require(_0xfc72('0x2'));var BPromise=require(_0xfc72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc72('0x4'));var rimraf=require('rimraf');var config=require(_0xfc72('0x5'));var attributes=require(_0xfc72('0x6'));module[_0xfc72('0x7')]=function(_0x48f0b7,_0x547104){return _0x48f0b7[_0xfc72('0x8')](_0xfc72('0x9'),attributes,{'tableName':_0xfc72('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc72('0xb'),'collate':_0xfc72('0xc')});}; \ No newline at end of file +var _0xb2f3=['path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb2f3,0x157));var _0x3b2f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb2f3[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var logger=require(_0x3b2f('0x2'))(_0x3b2f('0x3'));var moment=require(_0x3b2f('0x4'));var BPromise=require(_0x3b2f('0x5'));var rp=require(_0x3b2f('0x6'));var fs=require('fs');var path=require(_0x3b2f('0x7'));var rimraf=require(_0x3b2f('0x8'));var config=require(_0x3b2f('0x9'));var attributes=require(_0x3b2f('0xa'));module[_0x3b2f('0xb')]=function(_0xf5a519,_0x12de12){return _0xf5a519['define'](_0x3b2f('0xc'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b2f('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 7a4ef76..0cac4ac 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 _0x58cc=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x58cc,0x7a));var _0xc58c=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x58cc[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0xc58c('0x0'));var util=require(_0xc58c('0x1'));var moment=require(_0xc58c('0x2'));var BPromise=require(_0xc58c('0x3'));var rs=require(_0xc58c('0x4'));var fs=require('fs');var Redis=require(_0xc58c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc58c('0x6'));var logger=require(_0xc58c('0x7'))(_0xc58c('0x8'));var config=require(_0xc58c('0x9'));var jayson=require(_0xc58c('0xa'));var client=jayson[_0xc58c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1b4e,_0x448646,_0x282354){return new BPromise(function(_0x48a9f4,_0x184b6d){return client[_0xc58c('0xc')](_0x4f1b4e,_0x282354)['then'](function(_0x248c8c){logger['info'](_0xc58c('0xd'),_0x448646,_0xc58c('0xe'));logger[_0xc58c('0xf')](_0xc58c('0x10'),_0x448646,_0xc58c('0xe'),JSON[_0xc58c('0x11')](_0x248c8c));if(_0x248c8c['error']){if(_0x248c8c[_0xc58c('0x12')][_0xc58c('0x13')]===0x1f4){logger[_0xc58c('0x12')](_0xc58c('0xd'),_0x448646,_0x248c8c[_0xc58c('0x12')][_0xc58c('0x14')]);return _0x184b6d(_0x248c8c[_0xc58c('0x12')][_0xc58c('0x14')]);}logger[_0xc58c('0x12')](_0xc58c('0xd'),_0x448646,_0x248c8c['error'][_0xc58c('0x14')]);return _0x48a9f4(_0x248c8c['error'][_0xc58c('0x14')]);}else{logger[_0xc58c('0x15')](_0xc58c('0xd'),_0x448646,_0xc58c('0xe'));_0x48a9f4(_0x248c8c[_0xc58c('0x16')][_0xc58c('0x14')]);}})[_0xc58c('0x17')](function(_0xf1601f){logger[_0xc58c('0x12')](_0xc58c('0xd'),_0x448646,_0xf1601f);_0x184b6d(_0xf1601f);});});} \ No newline at end of file +var _0xabad=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xabad,0x150));var _0xdaba=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0xabad[_0x4d7116];return _0x4593dc;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var moment=require(_0xdaba('0x1'));var BPromise=require(_0xdaba('0x2'));var rs=require(_0xdaba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaba('0x4'))['db'];var utils=require(_0xdaba('0x5'));var logger=require('../../config/logger')(_0xdaba('0x6'));var config=require(_0xdaba('0x7'));var jayson=require(_0xdaba('0x8'));var client=jayson[_0xdaba('0x9')][_0xdaba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ae0f,_0x4045f5,_0x352a74){return new BPromise(function(_0x5214dc,_0x2344d1){return client[_0xdaba('0xb')](_0x23ae0f,_0x352a74)[_0xdaba('0xc')](function(_0x1e22ba){logger['info'](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));logger[_0xdaba('0xf')](_0xdaba('0x10'),_0x4045f5,_0xdaba('0xe'),JSON[_0xdaba('0x11')](_0x1e22ba));if(_0x1e22ba[_0xdaba('0x12')]){if(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x13')]===0x1f4){logger['error'](_0xdaba('0xd'),_0x4045f5,_0x1e22ba['error'][_0xdaba('0x14')]);return _0x2344d1(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);}logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);return _0x5214dc(_0x1e22ba['error'][_0xdaba('0x14')]);}else{logger[_0xdaba('0x15')](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));_0x5214dc(_0x1e22ba[_0xdaba('0x16')][_0xdaba('0x14')]);}})[_0xdaba('0x17')](function(_0x5c4ec1){logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x5c4ec1);_0x2344d1(_0x5c4ec1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index cb85c25..9f284d0 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 _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x3a1040,_0x2b332c){var _0x14eb9e=function(_0x164dc7){while(--_0x164dc7){_0x3a1040['push'](_0x3a1040['shift']());}};_0x14eb9e(++_0x2b332c);}(_0x0972,0x64));var _0x2097=function(_0x82c0e2,_0x3dd8fa){_0x82c0e2=_0x82c0e2-0x0;var _0x3e1bd0=_0x0972[_0x82c0e2];return _0x3e1bd0;};'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')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file +var _0x8603=['sms','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0xe97e4c,_0x486a93){var _0x2a2f09=function(_0x4a7575){while(--_0x4a7575){_0xe97e4c['push'](_0xe97e4c['shift']());}};_0x2a2f09(++_0x486a93);}(_0x8603,0x190));var _0x3860=function(_0x3dd972,_0x46dd84){_0x3dd972=_0x3dd972-0x0;var _0x3800e0=_0x8603[_0x3dd972];return _0x3800e0;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['describe']);router['get']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router['get'](_0x3860('0xc'),auth[_0x3860('0x7')](),controller['getMessages']);router[_0x3860('0x9')](_0x3860('0xd'),auth['isAuthenticated'](),controller[_0x3860('0xe')]);router[_0x3860('0xf')]('/',auth['isAuthenticated'](),controller[_0x3860('0x10')]);router[_0x3860('0xf')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router[_0x3860('0xf')](_0x3860('0x12'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),'smsinteraction:addtags'),controller[_0x3860('0x15')]);router[_0x3860('0x16')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),_0x3860('0x18')),controller[_0x3860('0x19')]);router[_0x3860('0x1a')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')]('sms','smsinteraction:destroy'),controller[_0x3860('0x1b')]);router[_0x3860('0x1a')](_0x3860('0x12'),auth['isAuthenticated'](),controller[_0x3860('0x1c')]);module[_0x3860('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 821077c..df6afb9 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 _0x4b11=['INTEGER','sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x429056,_0x1bbd65){var _0x371516=function(_0x634d22){while(--_0x634d22){_0x429056['push'](_0x429056['shift']());}};_0x371516(++_0x1bbd65);}(_0x4b11,0xf4));var _0x14b1=function(_0x386993,_0x19f872){_0x386993=_0x386993-0x0;var _0x2afedb=_0x4b11[_0x386993];return _0x2afedb;};'use strict';var Sequelize=require(_0x14b1('0x0'));var moment=require(_0x14b1('0x1'));module[_0x14b1('0x2')]={'closed':{'type':Sequelize[_0x14b1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x14b1('0x4')]},'secondDisposition':{'type':Sequelize[_0x14b1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x14b1('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x14b1('0x4')]},'read1stAt':{'type':Sequelize[_0x14b1('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x14b1('0x6')]('in',_0x14b1('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x14b1('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x14b1('0x6')]('in',_0x14b1('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x14b1('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x14b1('0x8')]}}; \ No newline at end of file +var _0xa5c1=['INTEGER','sequelize','moment','exports','STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x329110,_0x539408){var _0xb0d529=function(_0x561bce){while(--_0x561bce){_0x329110['push'](_0x329110['shift']());}};_0xb0d529(++_0x539408);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x3d6f72,_0x1c4eec){_0x3d6f72=_0x3d6f72-0x0;var _0x36ebfd=_0xa5c1[_0x3d6f72];return _0x36ebfd;};'use strict';var Sequelize=require(_0x1a5c('0x0'));var moment=require(_0x1a5c('0x1'));module[_0x1a5c('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1a5c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1a5c('0x3')]},'note':{'type':Sequelize[_0x1a5c('0x3')]},'phone':{'type':Sequelize[_0x1a5c('0x3')]},'read1stAt':{'type':Sequelize[_0x1a5c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1a5c('0x5')]('in',_0x1a5c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1a5c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1a5c('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1a5c('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ed4b993..cb6557f 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 _0x187d=['map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','params','model','keys','filters','intersection','attributes','fields','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','hasOwnProperty','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','omit','spread','Tag','color','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','N.A.','createdAt','closed','closedAt','toString','disposition','direction','out','System','value','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','then','stack','name'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x187d,0xd1));var _0xd187=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x187d[_0x46aff0];return _0x9d78cf;};'use strict';var rimraf=require(_0xd187('0x0'));var zipdir=require(_0xd187('0x1'));var moment=require(_0xd187('0x2'));var BPromise=require(_0xd187('0x3'));var util=require(_0xd187('0x4'));var path=require('path');var ejs=require(_0xd187('0x5'));var fs=require('fs');var _=require(_0xd187('0x6'));var Redis=require(_0xd187('0x7'));var interaction=require(_0xd187('0x8'));var qs=require(_0xd187('0x9'));var pdf=require(_0xd187('0xa'));var logger=require(_0xd187('0xb'))(_0xd187('0xc'));var config=require(_0xd187('0xd'));var db=require(_0xd187('0xe'))['db'];config[_0xd187('0xf')]=_[_0xd187('0x10')](config[_0xd187('0xf')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd187('0xf')]));require('./smsInteraction.socket')[_0xd187('0x11')](socket);function respondWithStatusCode(_0x1d8951,_0x596cf0){_0x596cf0=_0x596cf0||0xcc;return function(_0x34047a){if(_0x34047a){return _0x1d8951[_0xd187('0x12')](_0x596cf0);}return _0x1d8951['status'](_0x596cf0)[_0xd187('0x13')]();};}function respondWithResult(_0x2f6b71,_0x56acb8){_0x56acb8=_0x56acb8||0xc8;return function(_0x3d6827){if(_0x3d6827){return _0x2f6b71[_0xd187('0x14')](_0x56acb8)[_0xd187('0x15')](_0x3d6827);}};}function respondWithFilteredResult(_0x4028b8,_0x26f1c5){return function(_0x69b815){if(_0x69b815){var _0x28559e=typeof _0x26f1c5[_0xd187('0x16')]===_0xd187('0x17')&&typeof _0x26f1c5[_0xd187('0x18')]===_0xd187('0x17');var _0x57cd7b=_0x69b815['count'];var _0x240e3b=_0x28559e?0x0:_0x26f1c5[_0xd187('0x16')];var _0x24dbbc=_0x28559e?_0x69b815[_0xd187('0x19')]:_0x26f1c5[_0xd187('0x16')]+_0x26f1c5[_0xd187('0x18')];var _0x17b452;if(_0x24dbbc>=_0x57cd7b){_0x24dbbc=_0x57cd7b;_0x17b452=0xc8;}else{_0x17b452=0xce;}_0x4028b8[_0xd187('0x14')](_0x17b452);return _0x4028b8['set'](_0xd187('0x1a'),_0x240e3b+'-'+_0x24dbbc+'/'+_0x57cd7b)[_0xd187('0x15')](_0x69b815);}return null;};}function saveUpdates(_0x17ef37){return function(_0x84223){if(_0x84223){return _0x84223['update'](_0x17ef37)['then'](function(_0x319f7f){return _0x319f7f;});}return null;};}function removeEntity(_0x290b2c){return function(_0x37d239){if(_0x37d239){return _0x37d239[_0xd187('0x1b')]()[_0xd187('0x1c')](function(){_0x290b2c['status'](0xcc)[_0xd187('0x13')]();});}};}function handleEntityNotFound(_0xe4251d){return function(_0x1f7c78){if(!_0x1f7c78){_0xe4251d[_0xd187('0x12')](0x194);}return _0x1f7c78;};}function handleError(_0x3eae27,_0x391da0){_0x391da0=_0x391da0||0x1f4;return function(_0x53fa3c){logger['error'](_0x53fa3c[_0xd187('0x1d')]);if(_0x53fa3c['name']){delete _0x53fa3c[_0xd187('0x1e')];}_0x3eae27[_0xd187('0x14')](_0x391da0)['send'](_0x53fa3c);};}exports['index']=function(_0x1fa643,_0x2952ad){var _0x25f391={};var _0x2362aa=_[_0xd187('0x1f')](db[_0xd187('0x20')][_0xd187('0x21')],function(_0x28efcb){return{'name':_0x28efcb[_0xd187('0x22')],'type':_0x28efcb[_0xd187('0x23')][_0xd187('0x24')]};});_0x25f391=qs[_0xd187('0x25')](_0x2362aa,_0x1fa643);return interaction[_0xd187('0x26')](_0xd187('0x27'),_0x1fa643[_0xd187('0x28')],_0x1fa643[_0xd187('0x29')],_0x25f391,_0x2362aa)['then'](respondWithFilteredResult(_0x2952ad,_0x25f391))[_0xd187('0x2a')](handleError(_0x2952ad,null));};exports['show']=function(_0x57a55c,_0x5c0fb5){var _0x79a390={'raw':![],'where':{'id':_0x57a55c[_0xd187('0x2b')]['id']}},_0x16fb7f={};_0x16fb7f[_0xd187('0x2c')]=_[_0xd187('0x2d')](db[_0xd187('0x20')][_0xd187('0x21')]);_0x16fb7f['query']=_[_0xd187('0x2d')](_0x57a55c[_0xd187('0x28')]);_0x16fb7f[_0xd187('0x2e')]=_[_0xd187('0x2f')](_0x16fb7f[_0xd187('0x2c')],_0x16fb7f[_0xd187('0x28')]);_0x79a390[_0xd187('0x30')]=_[_0xd187('0x2f')](_0x16fb7f['model'],qs[_0xd187('0x31')](_0x57a55c[_0xd187('0x28')][_0xd187('0x31')]));_0x79a390[_0xd187('0x30')]=_0x79a390[_0xd187('0x30')]['length']?_0x79a390[_0xd187('0x30')]:_0x16fb7f[_0xd187('0x2c')];if(_0x57a55c[_0xd187('0x28')]['includeAll']){_0x79a390[_0xd187('0x32')]=[{'all':!![]}];}_0x79a390=_[_0xd187('0x33')]({},_0x79a390,_0x57a55c[_0xd187('0x34')]);return db[_0xd187('0x20')][_0xd187('0x35')](_0x79a390)['then'](handleEntityNotFound(_0x5c0fb5,null))['then'](respondWithResult(_0x5c0fb5,null))['catch'](handleError(_0x5c0fb5,null));};exports[_0xd187('0x36')]=function(_0x1234f3,_0x55886c){return db[_0xd187('0x20')][_0xd187('0x36')](_0x1234f3[_0xd187('0x37')],{})[_0xd187('0x1c')](respondWithResult(_0x55886c,0xc9))['catch'](handleError(_0x55886c,null));};exports['update']=function(_0x1c699d,_0x487cf5){if(_0x1c699d['body']['id']){delete _0x1c699d[_0xd187('0x37')]['id'];}return db[_0xd187('0x20')]['find']({'where':{'id':_0x1c699d['params']['id']}})[_0xd187('0x1c')](handleEntityNotFound(_0x487cf5,null))[_0xd187('0x1c')](saveUpdates(_0x1c699d['body'],null))[_0xd187('0x1c')](respondWithResult(_0x487cf5,null))['catch'](handleError(_0x487cf5,null));};exports[_0xd187('0x1b')]=function(_0x237c7d,_0x301259){return db[_0xd187('0x20')][_0xd187('0x35')]({'where':{'id':_0x237c7d[_0xd187('0x2b')]['id']}})[_0xd187('0x1c')](handleEntityNotFound(_0x301259,null))['then'](removeEntity(_0x301259,null))[_0xd187('0x2a')](handleError(_0x301259,null));};exports[_0xd187('0x38')]=function(_0x4520ce,_0x401ff5){return db[_0xd187('0x20')][_0xd187('0x38')]()[_0xd187('0x1c')](respondWithResult(_0x401ff5,null))[_0xd187('0x2a')](handleError(_0x401ff5,null));};exports[_0xd187('0x39')]=function(_0x2bda9f,_0x39ea67){return db[_0xd187('0x3a')][_0xd187('0x35')]({'where':{'id':_0x2bda9f['params']['id']}})[_0xd187('0x1c')](handleEntityNotFound(_0x39ea67,null))['then'](function(_0x8bb9d6){if(_0x8bb9d6){return _0x8bb9d6[_0xd187('0x39')](_0x2bda9f[_0xd187('0x37')][_0xd187('0x3b')],_['omit'](_0x2bda9f[_0xd187('0x37')],[_0xd187('0x3b'),'id'])||{});}})[_0xd187('0x1c')](respondWithResult(_0x39ea67,null))[_0xd187('0x2a')](handleError(_0x39ea67,null));};exports['getMessages']=function(_0x1a20db,_0x4aae3f){var _0x3774ee={'raw':![],'where':{}};var _0x3e2667={};var _0x33e31f={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x1a20db[_0xd187('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4aae3f,null))['then'](function(_0x4814eb){if(_0x4814eb){_0x3e2667[_0xd187('0x2c')]=_[_0xd187('0x2d')](db[_0xd187('0x3a')][_0xd187('0x21')]);_0x3e2667[_0xd187('0x28')]=_[_0xd187('0x2d')](_0x1a20db['query']);_0x3e2667[_0xd187('0x2e')]=_['intersection'](_0x3e2667['model'],_0x3e2667[_0xd187('0x28')]);_0x3774ee[_0xd187('0x30')]=_[_0xd187('0x2f')](_0x3e2667[_0xd187('0x2c')],qs[_0xd187('0x31')](_0x1a20db['query']['fields']));_0x3774ee['attributes']=_0x3774ee[_0xd187('0x30')]['length']?_0x3774ee[_0xd187('0x30')]:_0x3e2667[_0xd187('0x2c')];if(!_0x1a20db['query'][_0xd187('0x3c')]('nolimit')){_0x3774ee[_0xd187('0x18')]=qs[_0xd187('0x18')](_0x1a20db['query']['limit']);_0x3774ee[_0xd187('0x16')]=qs[_0xd187('0x16')](_0x1a20db[_0xd187('0x28')][_0xd187('0x16')]);}_0x3774ee[_0xd187('0x3d')]=qs[_0xd187('0x3e')](_0x1a20db[_0xd187('0x28')][_0xd187('0x3e')]);_0x3774ee[_0xd187('0x3f')]=qs[_0xd187('0x2e')](_['pick'](_0x1a20db[_0xd187('0x28')],_0x3e2667[_0xd187('0x2e')]));_0x3774ee[_0xd187('0x3f')][_0xd187('0x40')]=_0x4814eb['id'];if(_0x1a20db[_0xd187('0x28')][_0xd187('0x41')]){_0x3774ee[_0xd187('0x3f')]=_['merge'](_0x3774ee[_0xd187('0x3f')],{'$or':_['map'](_0x3774ee[_0xd187('0x30')],function(_0x2adc0c){var _0x4d5a71={};_0x4d5a71[_0x2adc0c]={'$like':'%'+_0x1a20db[_0xd187('0x28')][_0xd187('0x41')]+'%'};return _0x4d5a71;})});}if(_0x1a20db[_0xd187('0x28')][_0xd187('0x42')]){var _0xc2c6bd=_0x1a20db[_0xd187('0x28')][_0xd187('0x42')][_0xd187('0x43')](',');var _0x4c6db5={};_0x4c6db5[_0xc2c6bd[0x0]]={'$gte':moment(_0xc2c6bd[0x1])[_0xd187('0x44')](_0xd187('0x45'))};_0x3774ee['where']=_[_0xd187('0x33')](_0x3774ee[_0xd187('0x3f')],_0x4c6db5);}_0x3774ee=_['merge']({},_0x3774ee,_0x1a20db[_0xd187('0x34')]);return db[_0xd187('0x3a')][_0xd187('0x19')]({'where':_0x3774ee[_0xd187('0x3f')]})[_0xd187('0x1c')](function(_0x3021f){_0x33e31f['count']=_0x3021f;if(_0x1a20db[_0xd187('0x28')][_0xd187('0x46')]){_0x3774ee[_0xd187('0x32')]=[{'all':!![]}];}return db[_0xd187('0x3a')][_0xd187('0x26')](_0x3774ee);})[_0xd187('0x1c')](function(_0xc8e278){_0x33e31f[_0xd187('0x47')]=_0xc8e278;return _0x33e31f;});}})[_0xd187('0x1c')](respondWithFilteredResult(_0x4aae3f,_0x3774ee))[_0xd187('0x2a')](handleError(_0x4aae3f,null));};exports[_0xd187('0x48')]=function(_0x25a0c9,_0x4fdd27){return db[_0xd187('0x20')]['find']({'where':{'id':_0x25a0c9[_0xd187('0x2b')]['id']}})[_0xd187('0x1c')](handleEntityNotFound(_0x4fdd27,null))[_0xd187('0x1c')](function(_0x2f1a7f){if(_0x2f1a7f){return _0x2f1a7f[_0xd187('0x49')](_0x25a0c9['body'][_0xd187('0x3b')],_[_0xd187('0x4a')](_0x25a0c9['body'],[_0xd187('0x3b'),'id'])||{})[_0xd187('0x4b')](function(){return db[_0xd187('0x4c')][_0xd187('0x26')]({'attributes':['id',_0xd187('0x1e'),_0xd187('0x4d')],'where':{'id':_0x25a0c9[_0xd187('0x37')][_0xd187('0x3b')]}});})[_0xd187('0x1c')](function(_0x54e649){socket['emit'](_0xd187('0x4e'),{'id':Number(_0x25a0c9[_0xd187('0x2b')]['id']),'tags':_0x54e649||[]});return{'id':Number(_0x25a0c9['params']['id']),'tags':_0x54e649||[]};});}})[_0xd187('0x1c')](respondWithResult(_0x4fdd27,null))[_0xd187('0x2a')](handleError(_0x4fdd27,null));};exports[_0xd187('0x4f')]=function(_0x362a2a,_0x5e2c1a){return db['SmsInteraction']['find']({'where':{'id':_0x362a2a[_0xd187('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5e2c1a,null))[_0xd187('0x1c')](function(_0x576214){if(_0x576214){return _0x576214[_0xd187('0x4f')](_0x362a2a['query'][_0xd187('0x3b')]);}})[_0xd187('0x1c')](respondWithStatusCode(_0x5e2c1a,null))[_0xd187('0x2a')](handleError(_0x5e2c1a,null));};exports[_0xd187('0x50')]=function(_0x142ade,_0x2d5630){var _0x1563be=moment()[_0xd187('0x51')]()['toString']();var _0x39f92f=path[_0xd187('0x52')](config[_0xd187('0x53')],_0xd187('0x54'),_0xd187('0x55'),_0xd187('0x56'));var _0x491f1b=path[_0xd187('0x52')](_0x39f92f,_0x1563be);var _0x51427d=util[_0xd187('0x44')](_0xd187('0x57'),_0x142ade[_0xd187('0x2b')]['id'],_0x1563be);var _0x326838=path[_0xd187('0x52')](_0x39f92f,_0x51427d);var _0x13d922=[];_0x13d922[_0xd187('0x58')]({'model':db[_0xd187('0x59')],'as':'User','attributes':['id',_0xd187('0x5a')],'raw':!![]});_0x13d922[_0xd187('0x58')]({'model':db['CmContact'],'as':_0xd187('0x5b'),'attributes':['id',_0xd187('0x5c'),_0xd187('0x5d')],'raw':!![]});var _0x4c32b6=[{'model':db[_0xd187('0x3a')],'as':_0xd187('0x5e'),'attributes':['id',_0xd187('0x37'),'createdAt','direction',_0xd187('0x5f'),'read'],'include':_0x13d922}];_0x4c32b6[_0xd187('0x58')]({'model':db[_0xd187('0x60')],'as':_0xd187('0x61'),'attributes':['id',_0xd187('0x1e')]});_0x4c32b6[_0xd187('0x58')]({'model':db[_0xd187('0x59')],'as':_0xd187('0x62'),'attributes':['id',_0xd187('0x5a')]});return db[_0xd187('0x20')][_0xd187('0x35')]({'where':{'id':_0x142ade['params']['id']},'include':_0x4c32b6})[_0xd187('0x1c')](handleEntityNotFound(_0x2d5630,null))['then'](function(_0x25586a){if(_0x25586a){var _0x217371=_0x25586a[_0xd187('0x63')]({'plain':!![]});fs[_0xd187('0x64')](_0x491f1b);var _0x1b8033={'channel':'Sms','account':_0x217371[_0xd187('0x61')][_0xd187('0x1e')],'agent':_0x217371[_0xd187('0x62')]?_0x217371[_0xd187('0x62')]['fullname']:_0xd187('0x65'),'createdAt':moment(_0x217371[_0xd187('0x66')])[_0xd187('0x44')](_0xd187('0x45'))['toString'](),'closedAt':_0x217371[_0xd187('0x67')]?moment(_0x217371[_0xd187('0x68')])[_0xd187('0x44')](_0xd187('0x45'))[_0xd187('0x69')]():'','disposition':_0x217371[_0xd187('0x6a')],'messages':_(_0x217371[_0xd187('0x5e')])[_0xd187('0x41')]({'secret':![]})['map'](function(_0x5b8ba8){return{'date':moment(_0x5b8ba8[_0xd187('0x66')])[_0xd187('0x44')](_0xd187('0x45'))[_0xd187('0x69')](),'sender':_0x5b8ba8[_0xd187('0x6b')]===_0xd187('0x6c')?_0x5b8ba8['User']?_0x5b8ba8[_0xd187('0x59')][_0xd187('0x5a')]:_0xd187('0x6d'):_0x5b8ba8[_0xd187('0x5b')][_0xd187('0x5c')]+(_0x5b8ba8[_0xd187('0x5b')][_0xd187('0x5d')]?'\x20'+_0x5b8ba8[_0xd187('0x5b')][_0xd187('0x5d')]:''),'body':_0x5b8ba8[_0xd187('0x37')],'direction':_0x5b8ba8['direction']===_0xd187('0x6c')?'A':'C','secret':_0x5b8ba8[_0xd187('0x5f')],'read':_0x5b8ba8['read']};})[_0xd187('0x6e')]()};return ejs['renderFile'](path[_0xd187('0x52')](config[_0xd187('0x53')],'server',_0xd187('0x6f'),_0xd187('0x70')),{'interaction':_0x1b8033})[_0xd187('0x1c')](function(_0x3b698e){var _0x305fd5=path[_0xd187('0x52')](_0x491f1b,_0xd187('0x71')+_0x217371['id']+'-'+_0x1563be+_0xd187('0x72'));var _0x17ec68={'path':_0x305fd5,'channel':_0xd187('0x73'),'interactionId':_0x217371['id']};return pdf[_0xd187('0x74')](_0x3b698e,_0x17ec68);})[_0xd187('0x1c')](function(){return new BPromise(function(_0x25c474,_0x36209f){zipdir(_0x491f1b,{'saveTo':_0x326838},function(_0xd351a0,_0x4d8b32){if(_0xd351a0)return _0x36209f(_0xd351a0);return _0x25c474(_0x4d8b32);});})[_0xd187('0x1c')](function(){return new BPromise(function(_0x5912a3,_0x64786e){rimraf(_0x491f1b,function(_0x486f43){if(_0x486f43)_0x64786e(_0x486f43);return _0x5912a3();});});})[_0xd187('0x1c')](function(){return _0x2d5630[_0xd187('0x50')](_0x326838,_0x51427d,function(_0x40a0ac){if(_0x40a0ac){console[_0xd187('0x75')](_0xd187('0x76'),_0x40a0ac);}else{fs[_0xd187('0x77')](_0x326838);}});});});}else{return _0x2d5630[_0xd187('0x12')](0xc8);}})[_0xd187('0x2a')](handleError(_0x2d5630,null));}; \ No newline at end of file +var _0xeb5a=['views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','rimraf','moment','bluebird','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','key','getOptions','findAll','sms','query','user','catch','show','params','intersection','attributes','model','fields','length','include','merge','options','SmsInteraction','find','create','body','describe','addMessage','SmsMessage','ids','omit','findOne','keys','filters','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','map','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','spread','Tag','smsInteractionTags:save','removeTags','unix','toString','join','root','server','tmp','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','Sms','createdAt','closedAt','disposition','out','System','read','value','renderFile'];(function(_0x59b860,_0x397549){var _0x30dd4c=function(_0x524d33){while(--_0x524d33){_0x59b860['push'](_0x59b860['shift']());}};_0x30dd4c(++_0x397549);}(_0xeb5a,0x1ea));var _0xaeb5=function(_0xe7748c,_0x3241dc){_0xe7748c=_0xe7748c-0x0;var _0x48f37c=_0xeb5a[_0xe7748c];return _0x48f37c;};'use strict';var rimraf=require(_0xaeb5('0x0'));var zipdir=require('zip-dir');var moment=require(_0xaeb5('0x1'));var BPromise=require(_0xaeb5('0x2'));var util=require(_0xaeb5('0x3'));var path=require('path');var ejs=require(_0xaeb5('0x4'));var fs=require('fs');var _=require(_0xaeb5('0x5'));var Redis=require('ioredis');var interaction=require(_0xaeb5('0x6'));var qs=require(_0xaeb5('0x7'));var pdf=require(_0xaeb5('0x8'));var logger=require(_0xaeb5('0x9'))(_0xaeb5('0xa'));var config=require(_0xaeb5('0xb'));var db=require(_0xaeb5('0xc'))['db'];config[_0xaeb5('0xd')]=_['defaults'](config[_0xaeb5('0xd')],{'host':_0xaeb5('0xe'),'port':0x18eb});var socket=require(_0xaeb5('0xf'))(new Redis(config['redis']));require(_0xaeb5('0x10'))[_0xaeb5('0x11')](socket);function respondWithStatusCode(_0x125bb3,_0x4663f2){_0x4663f2=_0x4663f2||0xcc;return function(_0x2ca342){if(_0x2ca342){return _0x125bb3[_0xaeb5('0x12')](_0x4663f2);}return _0x125bb3[_0xaeb5('0x13')](_0x4663f2)[_0xaeb5('0x14')]();};}function respondWithResult(_0x1bae0,_0x384cdd){_0x384cdd=_0x384cdd||0xc8;return function(_0x19edff){if(_0x19edff){return _0x1bae0[_0xaeb5('0x13')](_0x384cdd)[_0xaeb5('0x15')](_0x19edff);}};}function respondWithFilteredResult(_0x34471b,_0x2c5e91){return function(_0x3cd551){if(_0x3cd551){var _0x2750b3=typeof _0x2c5e91['offset']===_0xaeb5('0x16')&&typeof _0x2c5e91[_0xaeb5('0x17')]===_0xaeb5('0x16');var _0x17e5d7=_0x3cd551[_0xaeb5('0x18')];var _0xcf71a5=_0x2750b3?0x0:_0x2c5e91[_0xaeb5('0x19')];var _0x1a22f7=_0x2750b3?_0x3cd551[_0xaeb5('0x18')]:_0x2c5e91[_0xaeb5('0x19')]+_0x2c5e91[_0xaeb5('0x17')];var _0x15b3d6;if(_0x1a22f7>=_0x17e5d7){_0x1a22f7=_0x17e5d7;_0x15b3d6=0xc8;}else{_0x15b3d6=0xce;}_0x34471b[_0xaeb5('0x13')](_0x15b3d6);return _0x34471b['set'](_0xaeb5('0x1a'),_0xcf71a5+'-'+_0x1a22f7+'/'+_0x17e5d7)[_0xaeb5('0x15')](_0x3cd551);}return null;};}function saveUpdates(_0x4bf9e0){return function(_0x3776fa){if(_0x3776fa){return _0x3776fa[_0xaeb5('0x1b')](_0x4bf9e0)['then'](function(_0xc23610){return _0xc23610;});}return null;};}function removeEntity(_0x484aff){return function(_0x4ac43e){if(_0x4ac43e){return _0x4ac43e[_0xaeb5('0x1c')]()[_0xaeb5('0x1d')](function(){_0x484aff['status'](0xcc)[_0xaeb5('0x14')]();});}};}function handleEntityNotFound(_0xc361b7){return function(_0x22a3c6){if(!_0x22a3c6){_0xc361b7[_0xaeb5('0x12')](0x194);}return _0x22a3c6;};}function handleError(_0x3abd3a,_0x5904bb){_0x5904bb=_0x5904bb||0x1f4;return function(_0x32f4d1){logger[_0xaeb5('0x1e')](_0x32f4d1[_0xaeb5('0x1f')]);if(_0x32f4d1[_0xaeb5('0x20')]){delete _0x32f4d1[_0xaeb5('0x20')];}_0x3abd3a['status'](_0x5904bb)[_0xaeb5('0x21')](_0x32f4d1);};}exports['index']=function(_0x14f62c,_0x4676a0){var _0x193117={};var _0x54db50=_['map'](db['SmsInteraction'][_0xaeb5('0x22')],function(_0x30f7e5){return{'name':_0x30f7e5[_0xaeb5('0x23')],'type':_0x30f7e5['type'][_0xaeb5('0x24')]};});_0x193117=qs[_0xaeb5('0x25')](_0x54db50,_0x14f62c);return interaction[_0xaeb5('0x26')](_0xaeb5('0x27'),_0x14f62c[_0xaeb5('0x28')],_0x14f62c[_0xaeb5('0x29')],_0x193117,_0x54db50)[_0xaeb5('0x1d')](respondWithFilteredResult(_0x4676a0,_0x193117))[_0xaeb5('0x2a')](handleError(_0x4676a0,null));};exports[_0xaeb5('0x2b')]=function(_0xbfc6cd,_0x4f6b47){var _0x796f0c={'raw':![],'where':{'id':_0xbfc6cd[_0xaeb5('0x2c')]['id']}},_0x432c9e={};_0x432c9e['model']=_['keys'](db['SmsInteraction']['rawAttributes']);_0x432c9e[_0xaeb5('0x28')]=_['keys'](_0xbfc6cd['query']);_0x432c9e['filters']=_[_0xaeb5('0x2d')](_0x432c9e['model'],_0x432c9e[_0xaeb5('0x28')]);_0x796f0c[_0xaeb5('0x2e')]=_[_0xaeb5('0x2d')](_0x432c9e[_0xaeb5('0x2f')],qs[_0xaeb5('0x30')](_0xbfc6cd['query'][_0xaeb5('0x30')]));_0x796f0c[_0xaeb5('0x2e')]=_0x796f0c['attributes'][_0xaeb5('0x31')]?_0x796f0c['attributes']:_0x432c9e[_0xaeb5('0x2f')];if(_0xbfc6cd[_0xaeb5('0x28')]['includeAll']){_0x796f0c[_0xaeb5('0x32')]=[{'all':!![]}];}_0x796f0c=_[_0xaeb5('0x33')]({},_0x796f0c,_0xbfc6cd[_0xaeb5('0x34')]);return db[_0xaeb5('0x35')][_0xaeb5('0x36')](_0x796f0c)[_0xaeb5('0x1d')](handleEntityNotFound(_0x4f6b47,null))['then'](respondWithResult(_0x4f6b47,null))[_0xaeb5('0x2a')](handleError(_0x4f6b47,null));};exports[_0xaeb5('0x37')]=function(_0x3aca7f,_0x1d2f66){return db[_0xaeb5('0x35')][_0xaeb5('0x37')](_0x3aca7f[_0xaeb5('0x38')],{})[_0xaeb5('0x1d')](respondWithResult(_0x1d2f66,0xc9))[_0xaeb5('0x2a')](handleError(_0x1d2f66,null));};exports[_0xaeb5('0x1b')]=function(_0x2cdf68,_0x5664cf){if(_0x2cdf68[_0xaeb5('0x38')]['id']){delete _0x2cdf68['body']['id'];}return db[_0xaeb5('0x35')][_0xaeb5('0x36')]({'where':{'id':_0x2cdf68[_0xaeb5('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5664cf,null))[_0xaeb5('0x1d')](saveUpdates(_0x2cdf68[_0xaeb5('0x38')],null))[_0xaeb5('0x1d')](respondWithResult(_0x5664cf,null))[_0xaeb5('0x2a')](handleError(_0x5664cf,null));};exports[_0xaeb5('0x1c')]=function(_0x223c47,_0x7f6b93){return db[_0xaeb5('0x35')][_0xaeb5('0x36')]({'where':{'id':_0x223c47[_0xaeb5('0x2c')]['id']}})[_0xaeb5('0x1d')](handleEntityNotFound(_0x7f6b93,null))[_0xaeb5('0x1d')](removeEntity(_0x7f6b93,null))['catch'](handleError(_0x7f6b93,null));};exports[_0xaeb5('0x39')]=function(_0xb99a06,_0x3dca2f){return db[_0xaeb5('0x35')][_0xaeb5('0x39')]()[_0xaeb5('0x1d')](respondWithResult(_0x3dca2f,null))[_0xaeb5('0x2a')](handleError(_0x3dca2f,null));};exports[_0xaeb5('0x3a')]=function(_0x1699f5,_0x42abfb){return db[_0xaeb5('0x3b')]['find']({'where':{'id':_0x1699f5[_0xaeb5('0x2c')]['id']}})['then'](handleEntityNotFound(_0x42abfb,null))[_0xaeb5('0x1d')](function(_0x57b872){if(_0x57b872){return _0x57b872['addMessage'](_0x1699f5[_0xaeb5('0x38')][_0xaeb5('0x3c')],_[_0xaeb5('0x3d')](_0x1699f5[_0xaeb5('0x38')],[_0xaeb5('0x3c'),'id'])||{});}})[_0xaeb5('0x1d')](respondWithResult(_0x42abfb,null))[_0xaeb5('0x2a')](handleError(_0x42abfb,null));};exports['getMessages']=function(_0x4f3995,_0x228bcb){var _0x51320a={'raw':![],'where':{}};var _0xc320ad={};var _0x361119={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xaeb5('0x3e')]({'where':{'id':_0x4f3995[_0xaeb5('0x2c')]['id']}})[_0xaeb5('0x1d')](handleEntityNotFound(_0x228bcb,null))[_0xaeb5('0x1d')](function(_0x434412){if(_0x434412){_0xc320ad[_0xaeb5('0x2f')]=_[_0xaeb5('0x3f')](db['SmsMessage'][_0xaeb5('0x22')]);_0xc320ad[_0xaeb5('0x28')]=_[_0xaeb5('0x3f')](_0x4f3995[_0xaeb5('0x28')]);_0xc320ad[_0xaeb5('0x40')]=_[_0xaeb5('0x2d')](_0xc320ad[_0xaeb5('0x2f')],_0xc320ad[_0xaeb5('0x28')]);_0x51320a['attributes']=_[_0xaeb5('0x2d')](_0xc320ad[_0xaeb5('0x2f')],qs[_0xaeb5('0x30')](_0x4f3995['query'][_0xaeb5('0x30')]));_0x51320a['attributes']=_0x51320a[_0xaeb5('0x2e')][_0xaeb5('0x31')]?_0x51320a[_0xaeb5('0x2e')]:_0xc320ad[_0xaeb5('0x2f')];if(!_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x41')](_0xaeb5('0x42'))){_0x51320a[_0xaeb5('0x17')]=qs[_0xaeb5('0x17')](_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x17')]);_0x51320a[_0xaeb5('0x19')]=qs[_0xaeb5('0x19')](_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x19')]);}_0x51320a[_0xaeb5('0x43')]=qs[_0xaeb5('0x44')](_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x44')]);_0x51320a[_0xaeb5('0x45')]=qs[_0xaeb5('0x40')](_[_0xaeb5('0x46')](_0x4f3995[_0xaeb5('0x28')],_0xc320ad[_0xaeb5('0x40')]));_0x51320a[_0xaeb5('0x45')][_0xaeb5('0x47')]=_0x434412['id'];if(_0x4f3995[_0xaeb5('0x28')]['filter']){_0x51320a[_0xaeb5('0x45')]=_[_0xaeb5('0x33')](_0x51320a[_0xaeb5('0x45')],{'$or':_[_0xaeb5('0x48')](_0x51320a['attributes'],function(_0x5a1e55){var _0x2ae01e={};_0x2ae01e[_0x5a1e55]={'$like':'%'+_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x49')]+'%'};return _0x2ae01e;})});}if(_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x4a')]){var _0x4f38aa=_0x4f3995[_0xaeb5('0x28')][_0xaeb5('0x4a')][_0xaeb5('0x4b')](',');var _0xc0d449={};_0xc0d449[_0x4f38aa[0x0]]={'$gte':moment(_0x4f38aa[0x1])['format'](_0xaeb5('0x4c'))};_0x51320a['where']=_['merge'](_0x51320a[_0xaeb5('0x45')],_0xc0d449);}_0x51320a=_[_0xaeb5('0x33')]({},_0x51320a,_0x4f3995[_0xaeb5('0x34')]);return db['SmsMessage'][_0xaeb5('0x18')]({'where':_0x51320a[_0xaeb5('0x45')]})[_0xaeb5('0x1d')](function(_0x1c8e4a){_0x361119[_0xaeb5('0x18')]=_0x1c8e4a;if(_0x4f3995['query'][_0xaeb5('0x4d')]){_0x51320a[_0xaeb5('0x32')]=[{'all':!![]}];}return db[_0xaeb5('0x3b')]['findAll'](_0x51320a);})[_0xaeb5('0x1d')](function(_0x1478d3){_0x361119[_0xaeb5('0x4e')]=_0x1478d3;return _0x361119;});}})[_0xaeb5('0x1d')](respondWithFilteredResult(_0x228bcb,_0x51320a))[_0xaeb5('0x2a')](handleError(_0x228bcb,null));};exports[_0xaeb5('0x4f')]=function(_0xfe7e81,_0x458aac){return db[_0xaeb5('0x35')][_0xaeb5('0x36')]({'where':{'id':_0xfe7e81[_0xaeb5('0x2c')]['id']}})[_0xaeb5('0x1d')](handleEntityNotFound(_0x458aac,null))[_0xaeb5('0x1d')](function(_0x2dc7f1){if(_0x2dc7f1){return _0x2dc7f1['setTags'](_0xfe7e81[_0xaeb5('0x38')][_0xaeb5('0x3c')],_['omit'](_0xfe7e81[_0xaeb5('0x38')],[_0xaeb5('0x3c'),'id'])||{})[_0xaeb5('0x50')](function(){return db[_0xaeb5('0x51')]['findAll']({'attributes':['id',_0xaeb5('0x20'),'color'],'where':{'id':_0xfe7e81[_0xaeb5('0x38')]['ids']}});})[_0xaeb5('0x1d')](function(_0x568563){socket['emit'](_0xaeb5('0x52'),{'id':Number(_0xfe7e81[_0xaeb5('0x2c')]['id']),'tags':_0x568563||[]});return{'id':Number(_0xfe7e81[_0xaeb5('0x2c')]['id']),'tags':_0x568563||[]};});}})[_0xaeb5('0x1d')](respondWithResult(_0x458aac,null))[_0xaeb5('0x2a')](handleError(_0x458aac,null));};exports['removeTags']=function(_0x1fe7e6,_0x25366b){return db[_0xaeb5('0x35')][_0xaeb5('0x36')]({'where':{'id':_0x1fe7e6['params']['id']}})[_0xaeb5('0x1d')](handleEntityNotFound(_0x25366b,null))[_0xaeb5('0x1d')](function(_0x50f5f4){if(_0x50f5f4){return _0x50f5f4[_0xaeb5('0x53')](_0x1fe7e6['query'][_0xaeb5('0x3c')]);}})[_0xaeb5('0x1d')](respondWithStatusCode(_0x25366b,null))[_0xaeb5('0x2a')](handleError(_0x25366b,null));};exports['download']=function(_0x1bf1b3,_0x30e17b){var _0x80ea0d=moment()[_0xaeb5('0x54')]()[_0xaeb5('0x55')]();var _0x1cbae2=path[_0xaeb5('0x56')](config[_0xaeb5('0x57')],_0xaeb5('0x58'),'files',_0xaeb5('0x59'));var _0x2ac68d=path[_0xaeb5('0x56')](_0x1cbae2,_0x80ea0d);var _0x11ce98=util[_0xaeb5('0x5a')](_0xaeb5('0x5b'),_0x1bf1b3['params']['id'],_0x80ea0d);var _0x24267b=path['join'](_0x1cbae2,_0x11ce98);var _0x122791=[];_0x122791[_0xaeb5('0x5c')]({'model':db[_0xaeb5('0x5d')],'as':_0xaeb5('0x5d'),'attributes':['id',_0xaeb5('0x5e')],'raw':!![]});_0x122791[_0xaeb5('0x5c')]({'model':db[_0xaeb5('0x5f')],'as':_0xaeb5('0x60'),'attributes':['id',_0xaeb5('0x61'),_0xaeb5('0x62')],'raw':!![]});var _0x38584a=[{'model':db[_0xaeb5('0x3b')],'as':_0xaeb5('0x63'),'attributes':['id','body','createdAt',_0xaeb5('0x64'),_0xaeb5('0x65'),'read'],'include':_0x122791}];_0x38584a['push']({'model':db[_0xaeb5('0x66')],'as':_0xaeb5('0x67'),'attributes':['id','name']});_0x38584a[_0xaeb5('0x5c')]({'model':db[_0xaeb5('0x5d')],'as':'Owner','attributes':['id',_0xaeb5('0x5e')]});return db[_0xaeb5('0x35')]['find']({'where':{'id':_0x1bf1b3[_0xaeb5('0x2c')]['id']},'include':_0x38584a})[_0xaeb5('0x1d')](handleEntityNotFound(_0x30e17b,null))[_0xaeb5('0x1d')](function(_0xe2c7ae){if(_0xe2c7ae){var _0x4e769c=_0xe2c7ae[_0xaeb5('0x68')]({'plain':!![]});fs[_0xaeb5('0x69')](_0x2ac68d);var _0x1cdbc1={'channel':_0xaeb5('0x6a'),'account':_0x4e769c[_0xaeb5('0x67')][_0xaeb5('0x20')],'agent':_0x4e769c['Owner']?_0x4e769c['Owner'][_0xaeb5('0x5e')]:'N.A.','createdAt':moment(_0x4e769c[_0xaeb5('0x6b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xaeb5('0x55')](),'closedAt':_0x4e769c['closed']?moment(_0x4e769c[_0xaeb5('0x6c')])['format'](_0xaeb5('0x4c'))[_0xaeb5('0x55')]():'','disposition':_0x4e769c[_0xaeb5('0x6d')],'messages':_(_0x4e769c[_0xaeb5('0x63')])[_0xaeb5('0x49')]({'secret':![]})[_0xaeb5('0x48')](function(_0x329fb8){return{'date':moment(_0x329fb8[_0xaeb5('0x6b')])[_0xaeb5('0x5a')](_0xaeb5('0x4c'))['toString'](),'sender':_0x329fb8[_0xaeb5('0x64')]===_0xaeb5('0x6e')?_0x329fb8['User']?_0x329fb8[_0xaeb5('0x5d')][_0xaeb5('0x5e')]:_0xaeb5('0x6f'):_0x329fb8[_0xaeb5('0x60')]['firstName']+(_0x329fb8[_0xaeb5('0x60')][_0xaeb5('0x62')]?'\x20'+_0x329fb8[_0xaeb5('0x60')][_0xaeb5('0x62')]:''),'body':_0x329fb8['body'],'direction':_0x329fb8['direction']===_0xaeb5('0x6e')?'A':'C','secret':_0x329fb8[_0xaeb5('0x65')],'read':_0x329fb8[_0xaeb5('0x70')]};})[_0xaeb5('0x71')]()};return ejs[_0xaeb5('0x72')](path[_0xaeb5('0x56')](config[_0xaeb5('0x57')],_0xaeb5('0x58'),_0xaeb5('0x73'),_0xaeb5('0x74')),{'interaction':_0x1cdbc1})[_0xaeb5('0x1d')](function(_0x12ee14){var _0x1ef918=path[_0xaeb5('0x56')](_0x2ac68d,_0xaeb5('0x75')+_0x4e769c['id']+'-'+_0x80ea0d+_0xaeb5('0x76'));var _0x3f4cff={'path':_0x1ef918,'channel':'Sms','interactionId':_0x4e769c['id']};return pdf['createPdfFromHTML'](_0x12ee14,_0x3f4cff);})['then'](function(){return new BPromise(function(_0x2292bd,_0x552c63){zipdir(_0x2ac68d,{'saveTo':_0x24267b},function(_0x18f5f9,_0x579211){if(_0x18f5f9)return _0x552c63(_0x18f5f9);return _0x2292bd(_0x579211);});})[_0xaeb5('0x1d')](function(){return new BPromise(function(_0x47205b,_0x2b8852){rimraf(_0x2ac68d,function(_0x1f78e7){if(_0x1f78e7)_0x2b8852(_0x1f78e7);return _0x47205b();});});})[_0xaeb5('0x1d')](function(){return _0x30e17b['download'](_0x24267b,_0x11ce98,function(_0xda95ac){if(_0xda95ac){console[_0xaeb5('0x77')]('err',_0xda95ac);}else{fs[_0xaeb5('0x78')](_0x24267b);}});});});}else{return _0x30e17b['sendStatus'](0xc8);}})[_0xaeb5('0x2a')](handleError(_0x30e17b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index a5e6e7d..200cb79 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 _0x4888=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','then','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x596b42,_0x5b4bd0){var _0x4701e5=function(_0x558a09){while(--_0x558a09){_0x596b42['push'](_0x596b42['shift']());}};_0x4701e5(++_0x5b4bd0);}(_0x4888,0x198));var _0x8488=function(_0x5349ee,_0x3e8ed9){_0x5349ee=_0x5349ee-0x0;var _0x26dd71=_0x4888[_0x5349ee];return _0x26dd71;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var SmsMessage=require(_0x8488('0x0'))['db'][_0x8488('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8488('0x3')](0x0);var events={'afterCreate':_0x8488('0x4'),'afterUpdate':_0x8488('0x5'),'afterDestroy':'remove'};function emitEvent(_0x267093){return function(_0xf45c3f,_0x1a97f4,_0x421292){_0xf45c3f[_0x8488('0x6')]({'attributes':['id'],'raw':!![]})[_0x8488('0x7')](function(_0x5250a1){_0xf45c3f['setDataValue']('Users',_0x5250a1['map'](function(_0x151528){return{'id':_0x151528['id']};}));return SmsMessage[_0x8488('0x8')]({'where':{'SmsInteractionId':_0xf45c3f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19c994){_0xf45c3f[_0x8488('0x9')](_0x8488('0xa'),_0x19c994[_0x8488('0xb')]);SmsInteractionEvents['emit'](_0x267093+':'+_0xf45c3f['id'],_0xf45c3f);SmsInteractionEvents[_0x8488('0xc')](_0x267093,_0xf45c3f);_0x421292(null);})[_0x8488('0xd')](_0x421292(null));};}for(var e in events){if(events[_0x8488('0xe')](e)){var event=events[e];SmsInteraction[_0x8488('0xf')](e,emitEvent(event));}}module[_0x8488('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0xa30a=['update','remove','then','setDataValue','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x3bf16f,_0x20d447){var _0x45f6c9=function(_0x2b09d){while(--_0x2b09d){_0x3bf16f['push'](_0x3bf16f['shift']());}};_0x45f6c9(++_0x20d447);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xaa30('0x0'));var SmsInteraction=require(_0xaa30('0x1'))['db'][_0xaa30('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xaa30('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xaa30('0x4')](0x0);var events={'afterCreate':_0xaa30('0x5'),'afterUpdate':_0xaa30('0x6'),'afterDestroy':_0xaa30('0x7')};function emitEvent(_0x271425){return function(_0x102ad7,_0x555947,_0x347cd5){_0x102ad7['getUsers']({'attributes':['id'],'raw':!![]})[_0xaa30('0x8')](function(_0x14fe09){_0x102ad7[_0xaa30('0x9')]('Users',_0x14fe09[_0xaa30('0xa')](function(_0x40dbda){return{'id':_0x40dbda['id']};}));return SmsMessage[_0xaa30('0xb')]({'where':{'SmsInteractionId':_0x102ad7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa30('0x8')](function(_0x14a6a6){_0x102ad7[_0xaa30('0x9')]('unreadMessages',_0x14a6a6['length']);SmsInteractionEvents[_0xaa30('0xc')](_0x271425+':'+_0x102ad7['id'],_0x102ad7);SmsInteractionEvents['emit'](_0x271425,_0x102ad7);_0x347cd5(null);})[_0xaa30('0xd')](_0x347cd5(null));};}for(var e in events){if(events[_0xaa30('0xe')](e)){var event=events[e];SmsInteraction[_0xaa30('0xf')](e,emitEvent(event));}}module[_0xaa30('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 3852b0f..e6b0864 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 _0xda18=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xda18,0x1f0));var _0x8da1=function(_0x4888d6,_0x2b9cc5){_0x4888d6=_0x4888d6-0x0;var _0x1a27e4=_0xda18[_0x4888d6];return _0x1a27e4;};'use strict';var _=require(_0x8da1('0x0'));var util=require(_0x8da1('0x1'));var logger=require(_0x8da1('0x2'))('api');var moment=require(_0x8da1('0x3'));var BPromise=require('bluebird');var rp=require(_0x8da1('0x4'));var fs=require('fs');var path=require(_0x8da1('0x5'));var rimraf=require(_0x8da1('0x6'));var config=require(_0x8da1('0x7'));var attributes=require(_0x8da1('0x8'));module[_0x8da1('0x9')]=function(_0x37ff51,_0x3aaa15){return _0x37ff51[_0x8da1('0xa')](_0x8da1('0xb'),attributes,{'tableName':_0x8da1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f03cc,_0x2cc3d4,_0x4b41c5){if(_0x5f03cc['changed'](_0x8da1('0xd'))){_0x5f03cc[_0x8da1('0xe')]=moment()['format'](_0x8da1('0xf'));}_0x4b41c5(null,_0x5f03cc);}}});}; \ No newline at end of file +var _0xd4ad=['request-promise','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd4ad,0x1ca));var _0xdd4a=function(_0x52ba81,_0x10e4de){_0x52ba81=_0x52ba81-0x0;var _0x148a52=_0xd4ad[_0x52ba81];return _0x148a52;};'use strict';var _=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var logger=require(_0xdd4a('0x2'))(_0xdd4a('0x3'));var moment=require(_0xdd4a('0x4'));var BPromise=require(_0xdd4a('0x5'));var rp=require(_0xdd4a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd4a('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd4a('0x8'));module['exports']=function(_0x21d6e7,_0x5d3266){return _0x21d6e7[_0xdd4a('0x9')](_0xdd4a('0xa'),attributes,{'tableName':_0xdd4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ab164,_0x154a72,_0x3f78df){if(_0x1ab164[_0xdd4a('0xc')](_0xdd4a('0xd'))){_0x1ab164[_0xdd4a('0xe')]=moment()['format'](_0xdd4a('0xf'));}_0x3f78df(null,_0x1ab164);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 0461b63..74a9200 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 _0x4512=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','catch','AddTagsToSmsInteraction','where','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x2326b8,_0x3b62f7){var _0x363f62=function(_0x4b01fc){while(--_0x4b01fc){_0x2326b8['push'](_0x2326b8['shift']());}};_0x363f62(++_0x3b62f7);}(_0x4512,0x1da));var _0x2451=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x4512[_0x154192];return _0x3c2792;};'use strict';var _=require(_0x2451('0x0'));var util=require(_0x2451('0x1'));var moment=require('moment');var BPromise=require(_0x2451('0x2'));var rs=require(_0x2451('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2451('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2451('0x5'))(_0x2451('0x6'));var config=require(_0x2451('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2451('0x8')][_0x2451('0x9')]({'port':0x232a});config[_0x2451('0xa')]=_[_0x2451('0xb')](config[_0x2451('0xa')],{'host':_0x2451('0xc'),'port':0x18eb});var socket=require(_0x2451('0xd'))(new Redis(config[_0x2451('0xa')]));require(_0x2451('0xe'))[_0x2451('0xf')](socket);function respondWithRpcPromise(_0x21e051,_0x59200a,_0x439a87){return new BPromise(function(_0x31d184,_0x219c79){return client[_0x2451('0x10')](_0x21e051,_0x439a87)[_0x2451('0x11')](function(_0x174332){logger['info'](_0x2451('0x12'),_0x59200a,_0x2451('0x13'));logger[_0x2451('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x59200a,'request\x20sent',JSON[_0x2451('0x15')](_0x174332));if(_0x174332[_0x2451('0x16')]){if(_0x174332[_0x2451('0x16')][_0x2451('0x17')]===0x1f4){logger['error'](_0x2451('0x12'),_0x59200a,_0x174332[_0x2451('0x16')]['message']);return _0x219c79(_0x174332[_0x2451('0x16')][_0x2451('0x18')]);}logger[_0x2451('0x16')](_0x2451('0x12'),_0x59200a,_0x174332[_0x2451('0x16')][_0x2451('0x18')]);return _0x31d184(_0x174332['error'][_0x2451('0x18')]);}else{logger[_0x2451('0x19')](_0x2451('0x12'),_0x59200a,_0x2451('0x13'));_0x31d184(_0x174332[_0x2451('0x1a')][_0x2451('0x18')]);}})['catch'](function(_0xd7df0a){logger[_0x2451('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x59200a,_0xd7df0a);_0x219c79(_0xd7df0a);});});}exports[_0x2451('0x1b')]=function(_0x192f4a){var _0x52df1d=this;return new Promise(function(_0x1b14a0,_0x1f7dc9){return db[_0x2451('0x1c')]['update'](_0x192f4a[_0x2451('0x1d')],{'raw':_0x192f4a[_0x2451('0x1e')]?_0x192f4a['options'][_0x2451('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x192f4a[_0x2451('0x1e')]?_0x192f4a['options']['where']||null:null,'attributes':_0x192f4a['options']?_0x192f4a['options'][_0x2451('0x20')]||null:null,'limit':_0x192f4a[_0x2451('0x1e')]?_0x192f4a[_0x2451('0x1e')]['limit']||null:null})[_0x2451('0x11')](function(_0x2b2715){logger[_0x2451('0x19')]('UpdateSmsInteraction',_0x192f4a);logger[_0x2451('0x14')]('UpdateSmsInteraction',_0x192f4a,JSON[_0x2451('0x15')](_0x2b2715));_0x1b14a0(_0x2b2715);})[_0x2451('0x21')](function(_0x2a5e10){logger[_0x2451('0x16')](_0x2451('0x1b'),_0x2a5e10[_0x2451('0x18')],_0x192f4a);_0x1f7dc9(_0x52df1d[_0x2451('0x16')](0x1f4,_0x2a5e10[_0x2451('0x18')]));});});};exports[_0x2451('0x22')]=function(_0x71220d){return new Promise(function(_0x3efc0c,_0x4a97b0){return db['SmsInteraction']['find']({'where':_0x71220d[_0x2451('0x1e')]?_0x71220d[_0x2451('0x1e')][_0x2451('0x23')]||null:null})[_0x2451('0x11')](function(_0x2eb13b){if(_0x2eb13b){return _0x2eb13b['addTags'](_0x71220d[_0x2451('0x1d')][_0x2451('0x24')],_[_0x2451('0x25')](_0x71220d[_0x2451('0x1d')],[_0x2451('0x24'),'id'])||{});}})[_0x2451('0x26')](function(_0x31c0e8){logger[_0x2451('0x19')](_0x2451('0x27'),_0x71220d);logger['debug'](_0x2451('0x27'),_0x71220d,JSON[_0x2451('0x15')](_0x31c0e8));_0x3efc0c(_0x31c0e8);})[_0x2451('0x21')](function(_0x47f0ad){logger[_0x2451('0x16')](_0x2451('0x27'),_0x47f0ad['message'],_0x71220d);_0x4a97b0(_this[_0x2451('0x16')](0x1f4,_0x47f0ad[_0x2451('0x18')]));});});}; \ No newline at end of file +var _0x6eef=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateSmsInteraction','body','options','raw','where','attributes','catch','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x5510a6,_0x4975b9){var _0x962a10=function(_0x5cca76){while(--_0x5cca76){_0x5510a6['push'](_0x5510a6['shift']());}};_0x962a10(++_0x4975b9);}(_0x6eef,0x1ab));var _0xf6ee=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x6eef[_0xdf3db6];return _0x4b7a65;};'use strict';var _=require(_0xf6ee('0x0'));var util=require(_0xf6ee('0x1'));var moment=require(_0xf6ee('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6ee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6ee('0x5'));var config=require(_0xf6ee('0x6'));var jayson=require(_0xf6ee('0x7'));var client=jayson[_0xf6ee('0x8')][_0xf6ee('0x9')]({'port':0x232a});config[_0xf6ee('0xa')]=_[_0xf6ee('0xb')](config[_0xf6ee('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6ee('0xc'))(new Redis(config[_0xf6ee('0xa')]));require(_0xf6ee('0xd'))['register'](socket);function respondWithRpcPromise(_0x55502c,_0x2338b2,_0x1dc52d){return new BPromise(function(_0x5a2cad,_0x2630e9){return client[_0xf6ee('0xe')](_0x55502c,_0x1dc52d)[_0xf6ee('0xf')](function(_0x345762){logger[_0xf6ee('0x10')](_0xf6ee('0x11'),_0x2338b2,_0xf6ee('0x12'));logger[_0xf6ee('0x13')](_0xf6ee('0x14'),_0x2338b2,'request\x20sent',JSON[_0xf6ee('0x15')](_0x345762));if(_0x345762['error']){if(_0x345762[_0xf6ee('0x16')][_0xf6ee('0x17')]===0x1f4){logger[_0xf6ee('0x16')](_0xf6ee('0x11'),_0x2338b2,_0x345762[_0xf6ee('0x16')][_0xf6ee('0x18')]);return _0x2630e9(_0x345762[_0xf6ee('0x16')]['message']);}logger[_0xf6ee('0x16')](_0xf6ee('0x11'),_0x2338b2,_0x345762[_0xf6ee('0x16')]['message']);return _0x5a2cad(_0x345762[_0xf6ee('0x16')]['message']);}else{logger[_0xf6ee('0x10')](_0xf6ee('0x11'),_0x2338b2,_0xf6ee('0x12'));_0x5a2cad(_0x345762['result'][_0xf6ee('0x18')]);}})['catch'](function(_0x32c6b0){logger['error'](_0xf6ee('0x11'),_0x2338b2,_0x32c6b0);_0x2630e9(_0x32c6b0);});});}exports[_0xf6ee('0x19')]=function(_0x5f2293){var _0x3730f3=this;return new Promise(function(_0x206408,_0x14b484){return db['SmsInteraction']['update'](_0x5f2293[_0xf6ee('0x1a')],{'raw':_0x5f2293[_0xf6ee('0x1b')]?_0x5f2293['options'][_0xf6ee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f2293['options']?_0x5f2293[_0xf6ee('0x1b')][_0xf6ee('0x1d')]||null:null,'attributes':_0x5f2293['options']?_0x5f2293[_0xf6ee('0x1b')][_0xf6ee('0x1e')]||null:null,'limit':_0x5f2293['options']?_0x5f2293[_0xf6ee('0x1b')]['limit']||null:null})['then'](function(_0x1f6f58){logger[_0xf6ee('0x10')]('UpdateSmsInteraction',_0x5f2293);logger['debug']('UpdateSmsInteraction',_0x5f2293,JSON[_0xf6ee('0x15')](_0x1f6f58));_0x206408(_0x1f6f58);})[_0xf6ee('0x1f')](function(_0x36dfea){logger[_0xf6ee('0x16')]('UpdateSmsInteraction',_0x36dfea['message'],_0x5f2293);_0x14b484(_0x3730f3[_0xf6ee('0x16')](0x1f4,_0x36dfea[_0xf6ee('0x18')]));});});};exports[_0xf6ee('0x20')]=function(_0x42b9ca){return new Promise(function(_0x1e1881,_0x49d1a6){return db['SmsInteraction'][_0xf6ee('0x21')]({'where':_0x42b9ca[_0xf6ee('0x1b')]?_0x42b9ca[_0xf6ee('0x1b')][_0xf6ee('0x1d')]||null:null})[_0xf6ee('0xf')](function(_0x23d70c){if(_0x23d70c){return _0x23d70c[_0xf6ee('0x22')](_0x42b9ca[_0xf6ee('0x1a')][_0xf6ee('0x23')],_[_0xf6ee('0x24')](_0x42b9ca[_0xf6ee('0x1a')],[_0xf6ee('0x23'),'id'])||{});}})[_0xf6ee('0x25')](function(_0x401e12){logger[_0xf6ee('0x10')](_0xf6ee('0x26'),_0x42b9ca);logger[_0xf6ee('0x13')](_0xf6ee('0x26'),_0x42b9ca,JSON[_0xf6ee('0x15')](_0x401e12));_0x1e1881(_0x401e12);})[_0xf6ee('0x1f')](function(_0x32c956){logger[_0xf6ee('0x16')](_0xf6ee('0x26'),_0x32c956[_0xf6ee('0x18')],_0x42b9ca);_0x49d1a6(_this['error'](0x1f4,_0x32c956[_0xf6ee('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 77f8c04..03884bf 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 _0x83a5=['smsInteraction:','./smsInteraction.events','save','emit','removeListener','register','length'];(function(_0x37800d,_0x4c0984){var _0x21a833=function(_0x13e231){while(--_0x13e231){_0x37800d['push'](_0x37800d['shift']());}};_0x21a833(++_0x4c0984);}(_0x83a5,0x13c));var _0x583a=function(_0x451643,_0x5d9c07){_0x451643=_0x451643-0x0;var _0xe3df13=_0x83a5[_0x451643];return _0xe3df13;};'use strict';var SmsInteractionEvents=require(_0x583a('0x0'));var events=[_0x583a('0x1'),'remove','update'];function createListener(_0x93a784,_0x49b8d6){return function(_0x437c5b){_0x49b8d6[_0x583a('0x2')](_0x93a784,_0x437c5b);};}function removeListener(_0x3092de,_0x251539){return function(){SmsInteractionEvents[_0x583a('0x3')](_0x3092de,_0x251539);};}exports[_0x583a('0x4')]=function(_0x5e9274){for(var _0x516da7=0x0,_0x30b8e6=events[_0x583a('0x5')];_0x516da7<_0x30b8e6;_0x516da7++){var _0x57df26=events[_0x516da7];var _0x494024=createListener(_0x583a('0x6')+_0x57df26,_0x5e9274);SmsInteractionEvents['on'](_0x57df26,_0x494024);}}; \ No newline at end of file +var _0x8637=['./smsInteraction.events','update','emit','removeListener','register','smsInteraction:'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0x8637,0x13e));var _0x7863=function(_0x1798fe,_0xfd2868){_0x1798fe=_0x1798fe-0x0;var _0x260fe8=_0x8637[_0x1798fe];return _0x260fe8;};'use strict';var SmsInteractionEvents=require(_0x7863('0x0'));var events=['save','remove',_0x7863('0x1')];function createListener(_0x119fba,_0x328f28){return function(_0x57ec75){_0x328f28[_0x7863('0x2')](_0x119fba,_0x57ec75);};}function removeListener(_0x37fe63,_0x3b1ac3){return function(){SmsInteractionEvents[_0x7863('0x3')](_0x37fe63,_0x3b1ac3);};}exports[_0x7863('0x4')]=function(_0x19b87d){for(var _0xb268fb=0x0,_0x2bbeab=events['length'];_0xb268fb<_0x2bbeab;_0xb268fb++){var _0x340420=events[_0xb268fb];var _0x8be853=createListener(_0x7863('0x5')+_0x340420,_0x19b87d);SmsInteractionEvents['on'](_0x340420,_0x8be853);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 485130a..b4faa4a 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 _0x463c=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','/:id/reject'];(function(_0x4c164d,_0x814e8c){var _0x22b480=function(_0x19952e){while(--_0x19952e){_0x4c164d['push'](_0x4c164d['shift']());}};_0x22b480(++_0x814e8c);}(_0x463c,0xbf));var _0xc463=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x463c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc463('0x0'));var util=require(_0xc463('0x1'));var path=require(_0xc463('0x2'));var timeout=require(_0xc463('0x3'));var express=require('express');var router=express[_0xc463('0x4')]();var fs_extra=require(_0xc463('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc463('0x6'));var config=require(_0xc463('0x7'));var controller=require('./smsMessage.controller');router[_0xc463('0x8')]('/',auth['isAuthenticated'](),controller[_0xc463('0x9')]);router[_0xc463('0x8')](_0xc463('0xa'),auth[_0xc463('0xb')](),controller[_0xc463('0xc')]);router['get'](_0xc463('0xd'),auth[_0xc463('0xb')](),controller[_0xc463('0xe')]);router[_0xc463('0xf')]('/',auth[_0xc463('0xb')](),interaction[_0xc463('0x10')](_0xc463('0x11'),_0xc463('0x12')),controller[_0xc463('0x13')]);router[_0xc463('0xf')](_0xc463('0x14'),controller['status']);router[_0xc463('0x15')](_0xc463('0xd'),auth['isAuthenticated'](),controller[_0xc463('0x16')]);router['put'](_0xc463('0x17'),auth[_0xc463('0xb')](),controller['accept']);router['put'](_0xc463('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0xc463('0x19')](_0xc463('0xd'),auth[_0xc463('0xb')](),controller['destroy']);module[_0xc463('0x1a')]=router; \ No newline at end of file +var _0xa67e=['../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','put','update','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x40cb84,_0x3ec2ff){var _0x4d25c1=function(_0x4f1314){while(--_0x4f1314){_0x40cb84['push'](_0x40cb84['shift']());}};_0x4d25c1(++_0x3ec2ff);}(_0xa67e,0x19d));var _0xea67=function(_0x4947c4,_0x664bb0){_0x4947c4=_0x4947c4-0x0;var _0x1337f2=_0xa67e[_0x4947c4];return _0x1337f2;};'use strict';var multer=require(_0xea67('0x0'));var util=require(_0xea67('0x1'));var path=require(_0xea67('0x2'));var timeout=require(_0xea67('0x3'));var express=require(_0xea67('0x4'));var router=express['Router']();var fs_extra=require(_0xea67('0x5'));var auth=require(_0xea67('0x6'));var interaction=require(_0xea67('0x7'));var config=require(_0xea67('0x8'));var controller=require(_0xea67('0x9'));router[_0xea67('0xa')]('/',auth[_0xea67('0xb')](),controller[_0xea67('0xc')]);router[_0xea67('0xa')]('/describe',auth[_0xea67('0xb')](),controller[_0xea67('0xd')]);router[_0xea67('0xa')](_0xea67('0xe'),auth[_0xea67('0xb')](),controller[_0xea67('0xf')]);router['post']('/',auth[_0xea67('0xb')](),interaction[_0xea67('0x10')]('sms',_0xea67('0x11')),controller[_0xea67('0x12')]);router[_0xea67('0x13')](_0xea67('0x14'),controller['status']);router[_0xea67('0x15')](_0xea67('0xe'),auth[_0xea67('0xb')](),controller[_0xea67('0x16')]);router[_0xea67('0x15')](_0xea67('0x17'),auth[_0xea67('0xb')](),controller[_0xea67('0x18')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xea67('0x19')]);router[_0xea67('0x1a')](_0xea67('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xea67('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index ad92fb7..6c180b8 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 _0xab60=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0xdeb5d6,_0x157ee2){var _0x2c7820=function(_0xf20148){while(--_0xf20148){_0xdeb5d6['push'](_0xdeb5d6['shift']());}};_0x2c7820(++_0x157ee2);}(_0xab60,0xea));var _0x0ab6=function(_0x131390,_0xd0846e){_0x131390=_0x131390-0x0;var _0x550870=_0xab60[_0x131390];return _0x550870;};'use strict';var Sequelize=require(_0x0ab6('0x0'));module[_0x0ab6('0x1')]={'body':{'type':Sequelize[_0x0ab6('0x2')](_0x0ab6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0ab6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0ab6('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0ab6('0x6')]},'readAt':{'type':Sequelize[_0x0ab6('0x7')]},'secret':{'type':Sequelize[_0x0ab6('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0ab6('0x6')]},'providerResponse':{'type':Sequelize[_0x0ab6('0x2')]}}; \ No newline at end of file +var _0x02a0=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x02a0,0x1db));var _0x002a=function(_0x27647d,_0x1795d6){_0x27647d=_0x27647d-0x0;var _0x3cde90=_0x02a0[_0x27647d];return _0x3cde90;};'use strict';var Sequelize=require(_0x002a('0x0'));module[_0x002a('0x1')]={'body':{'type':Sequelize[_0x002a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x002a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x002a('0x4')]('in',_0x002a('0x5')),'defaultValue':_0x002a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x002a('0x6')]},'readAt':{'type':Sequelize[_0x002a('0x7')]},'secret':{'type':Sequelize[_0x002a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x002a('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 047be1b..017f3ed 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 _0x1a62=['end','send','index','map','SmsMessage','rawAttributes','type','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','info','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','RejectMessage','fullname','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','then','request\x20sent','debug','stringify','code','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','update','destroy'];(function(_0x2c3e7a,_0x510d76){var _0xce38f0=function(_0x38be5b){while(--_0x38be5b){_0x2c3e7a['push'](_0x2c3e7a['shift']());}};_0xce38f0(++_0x510d76);}(_0x1a62,0x176));var _0x21a6=function(_0x4f47c0,_0x192781){_0x4f47c0=_0x4f47c0-0x0;var _0x4247bf=_0x1a62[_0x4f47c0];return _0x4247bf;};'use strict';var emlformat=require(_0x21a6('0x0'));var rimraf=require(_0x21a6('0x1'));var zipdir=require(_0x21a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21a6('0x3'));var moment=require(_0x21a6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x21a6('0x5'));var path=require('path');var sox=require(_0x21a6('0x6'));var csv=require(_0x21a6('0x7'));var ejs=require(_0x21a6('0x8'));var fs=require('fs');var fs_extra=require(_0x21a6('0x9'));var _=require(_0x21a6('0xa'));var squel=require('squel');var crypto=require(_0x21a6('0xb'));var jsforce=require(_0x21a6('0xc'));var deskjs=require(_0x21a6('0xd'));var toCsv=require(_0x21a6('0x7'));var querystring=require(_0x21a6('0xe'));var Papa=require(_0x21a6('0xf'));var Redis=require('ioredis');var authService=require(_0x21a6('0x10'));var qs=require(_0x21a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21a6('0x12'));var logger=require(_0x21a6('0x13'))('api');var utils=require(_0x21a6('0x14'));var config=require(_0x21a6('0x15'));var licenseUtil=require(_0x21a6('0x16'));var db=require('../../mysqldb')['db'];config[_0x21a6('0x17')]=_[_0x21a6('0x18')](config['redis'],{'host':_0x21a6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x21a6('0x1a')](socket);var jayson=require(_0x21a6('0x1b'));var client=jayson[_0x21a6('0x1c')][_0x21a6('0x1d')]({'port':0x232c});var client9002=jayson[_0x21a6('0x1c')][_0x21a6('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x25d121,_0x5a43e7,_0x20be7f,_0x449749){return new BPromise(function(_0x35ecd9,_0x3ca9bd){var _0x3dca6f=_0x449749||client;return _0x3dca6f['request'](_0x25d121,_0x20be7f)[_0x21a6('0x1e')](function(_0x255f54){logger['info']('SmsMessage,\x20%s,\x20%s',_0x5a43e7,_0x21a6('0x1f'));logger[_0x21a6('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5a43e7,_0x21a6('0x1f'),JSON[_0x21a6('0x21')](_0x255f54));if(_0x255f54['error']){if(_0x255f54['error'][_0x21a6('0x22')]===0x1f4){logger[_0x21a6('0x23')](_0x21a6('0x24'),_0x5a43e7,_0x255f54[_0x21a6('0x23')][_0x21a6('0x25')]);return _0x3ca9bd(_0x255f54[_0x21a6('0x23')][_0x21a6('0x25')]);}logger['error'](_0x21a6('0x24'),_0x5a43e7,_0x255f54[_0x21a6('0x23')][_0x21a6('0x25')]);return _0x35ecd9(_0x255f54[_0x21a6('0x23')][_0x21a6('0x25')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x5a43e7,_0x21a6('0x1f'));_0x35ecd9(_0x255f54[_0x21a6('0x26')][_0x21a6('0x25')]);}})[_0x21a6('0x27')](function(_0x357dd4){logger[_0x21a6('0x23')](_0x21a6('0x24'),_0x5a43e7,_0x357dd4);_0x3ca9bd(_0x357dd4);});});}function respondWithStatusCode(_0x3e93b5,_0x3e0337){_0x3e0337=_0x3e0337||0xcc;return function(_0x54ea40){if(_0x54ea40){return _0x3e93b5[_0x21a6('0x28')](_0x3e0337);}return _0x3e93b5[_0x21a6('0x29')](_0x3e0337)['end']();};}function respondWithResult(_0x2d8cad,_0x53a039){_0x53a039=_0x53a039||0xc8;return function(_0x46e7a3){if(_0x46e7a3){return _0x2d8cad[_0x21a6('0x29')](_0x53a039)[_0x21a6('0x2a')](_0x46e7a3);}};}function respondWithFilteredResult(_0x1ab21f,_0x161fe5){return function(_0x2d9603){if(_0x2d9603){var _0x25886c=typeof _0x161fe5[_0x21a6('0x2b')]===_0x21a6('0x2c')&&typeof _0x161fe5['limit']===_0x21a6('0x2c');var _0x1cd67b=_0x2d9603[_0x21a6('0x2d')];var _0x1aa978=_0x25886c?0x0:_0x161fe5[_0x21a6('0x2b')];var _0x352d73=_0x25886c?_0x2d9603['count']:_0x161fe5[_0x21a6('0x2b')]+_0x161fe5[_0x21a6('0x2e')];var _0x58445b;if(_0x352d73>=_0x1cd67b){_0x352d73=_0x1cd67b;_0x58445b=0xc8;}else{_0x58445b=0xce;}_0x1ab21f[_0x21a6('0x29')](_0x58445b);return _0x1ab21f['set']('Content-Range',_0x1aa978+'-'+_0x352d73+'/'+_0x1cd67b)[_0x21a6('0x2a')](_0x2d9603);}return null;};}function patchUpdates(_0x3b133c){return function(_0x244554){try{jsonpatch[_0x21a6('0x2f')](_0x244554,_0x3b133c,!![]);}catch(_0xde6e43){return BPromise[_0x21a6('0x30')](_0xde6e43);}return _0x244554[_0x21a6('0x31')]();};}function saveUpdates(_0x2a4d06,_0x37f2b4){return function(_0x4573bc){if(_0x4573bc){return _0x4573bc[_0x21a6('0x32')](_0x2a4d06)[_0x21a6('0x1e')](function(_0x2dd042){return _0x2dd042;});}return null;};}function removeEntity(_0x9c25ba,_0x1db245){return function(_0x500ca4){if(_0x500ca4){return _0x500ca4[_0x21a6('0x33')]()[_0x21a6('0x1e')](function(){_0x9c25ba[_0x21a6('0x29')](0xcc)[_0x21a6('0x34')]();});}};}function handleEntityNotFound(_0x5be2f3,_0x31da5a){return function(_0x8785dc){if(!_0x8785dc){_0x5be2f3[_0x21a6('0x28')](0x194);}return _0x8785dc;};}function handleError(_0x564a18,_0x1d91e8){_0x1d91e8=_0x1d91e8||0x1f4;return function(_0xc2f33c){logger[_0x21a6('0x23')](_0xc2f33c['stack']);if(_0xc2f33c['name']){delete _0xc2f33c['name'];}_0x564a18[_0x21a6('0x29')](_0x1d91e8)[_0x21a6('0x35')](_0xc2f33c);};}exports[_0x21a6('0x36')]=function(_0x59e87e,_0x4aa1fc){var _0x79e682={},_0x51641f={},_0x45202a={'count':0x0,'rows':[]};var _0x181a81=_[_0x21a6('0x37')](db[_0x21a6('0x38')][_0x21a6('0x39')],function(_0x50a022){return{'name':_0x50a022['fieldName'],'type':_0x50a022[_0x21a6('0x3a')]['key']};});_0x51641f['model']=_[_0x21a6('0x37')](_0x181a81,_0x21a6('0x3b'));_0x51641f[_0x21a6('0x3c')]=_[_0x21a6('0x3d')](_0x59e87e['query']);_0x51641f[_0x21a6('0x3e')]=_[_0x21a6('0x3f')](_0x51641f[_0x21a6('0x40')],_0x51641f[_0x21a6('0x3c')]);_0x79e682[_0x21a6('0x41')]=_[_0x21a6('0x3f')](_0x51641f[_0x21a6('0x40')],qs[_0x21a6('0x42')](_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x42')]));_0x79e682['attributes']=_0x79e682[_0x21a6('0x41')]['length']?_0x79e682[_0x21a6('0x41')]:_0x51641f['model'];if(!_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x43')](_0x21a6('0x44'))){_0x79e682[_0x21a6('0x2e')]=qs['limit'](_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x2e')]);_0x79e682[_0x21a6('0x2b')]=qs[_0x21a6('0x2b')](_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x2b')]);}_0x79e682['order']=qs[_0x21a6('0x45')](_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x45')]);_0x79e682[_0x21a6('0x46')]=qs[_0x21a6('0x3e')](_[_0x21a6('0x47')](_0x59e87e[_0x21a6('0x3c')],_0x51641f[_0x21a6('0x3e')]),_0x181a81);if(_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x48')]){_0x79e682[_0x21a6('0x46')]=_[_0x21a6('0x49')](_0x79e682[_0x21a6('0x46')],{'$or':_['map'](_0x181a81,function(_0x3da958){if(_0x3da958[_0x21a6('0x3a')]!==_0x21a6('0x4a')){var _0x4a267c={};_0x4a267c[_0x3da958['name']]={'$like':'%'+_0x59e87e['query'][_0x21a6('0x48')]+'%'};return _0x4a267c;}})});}_0x79e682=_[_0x21a6('0x49')]({},_0x79e682,_0x59e87e[_0x21a6('0x4b')]);var _0x47258a={'where':_0x79e682[_0x21a6('0x46')]};return db['SmsMessage']['count'](_0x47258a)['then'](function(_0x441934){_0x45202a['count']=_0x441934;if(_0x59e87e[_0x21a6('0x3c')][_0x21a6('0x4c')]){_0x79e682[_0x21a6('0x4d')]=[{'all':!![]}];}return db[_0x21a6('0x38')][_0x21a6('0x4e')](_0x79e682);})[_0x21a6('0x1e')](function(_0x33fa22){_0x45202a['rows']=_0x33fa22;return _0x45202a;})[_0x21a6('0x1e')](respondWithFilteredResult(_0x4aa1fc,_0x79e682))[_0x21a6('0x27')](handleError(_0x4aa1fc,null));};exports['show']=function(_0x3dbea1,_0x36a341){var _0x1a7462={'raw':!![],'where':{'id':_0x3dbea1[_0x21a6('0x4f')]['id']}},_0x1db4c1={};_0x1db4c1[_0x21a6('0x40')]=_[_0x21a6('0x3d')](db[_0x21a6('0x38')][_0x21a6('0x39')]);_0x1db4c1[_0x21a6('0x3c')]=_['keys'](_0x3dbea1[_0x21a6('0x3c')]);_0x1db4c1['filters']=_[_0x21a6('0x3f')](_0x1db4c1[_0x21a6('0x40')],_0x1db4c1[_0x21a6('0x3c')]);_0x1a7462[_0x21a6('0x41')]=_[_0x21a6('0x3f')](_0x1db4c1[_0x21a6('0x40')],qs[_0x21a6('0x42')](_0x3dbea1[_0x21a6('0x3c')][_0x21a6('0x42')]));_0x1a7462['attributes']=_0x1a7462[_0x21a6('0x41')]['length']?_0x1a7462['attributes']:_0x1db4c1['model'];if(_0x3dbea1[_0x21a6('0x3c')][_0x21a6('0x4c')]){_0x1a7462[_0x21a6('0x4d')]=[{'all':!![]}];}_0x1a7462=_[_0x21a6('0x49')]({},_0x1a7462,_0x3dbea1[_0x21a6('0x4b')]);return db[_0x21a6('0x38')][_0x21a6('0x50')](_0x1a7462)['then'](handleEntityNotFound(_0x36a341,null))[_0x21a6('0x1e')](respondWithResult(_0x36a341,null))[_0x21a6('0x27')](handleError(_0x36a341,null));};exports['create']=function(_0x4f67e1,_0x13aa9f){return db[_0x21a6('0x38')][_0x21a6('0x51')](_0x4f67e1[_0x21a6('0x52')],{})[_0x21a6('0x1e')](respondWithResult(_0x13aa9f,0xc9))[_0x21a6('0x27')](handleError(_0x13aa9f,null));};exports[_0x21a6('0x32')]=function(_0x5c6b15,_0x3e68d4){if(_0x5c6b15[_0x21a6('0x52')]['id']){delete _0x5c6b15['body']['id'];}return db['SmsMessage'][_0x21a6('0x50')]({'where':{'id':_0x5c6b15['params']['id']}})[_0x21a6('0x1e')](handleEntityNotFound(_0x3e68d4,null))[_0x21a6('0x1e')](saveUpdates(_0x5c6b15[_0x21a6('0x52')],null))[_0x21a6('0x1e')](respondWithResult(_0x3e68d4,null))[_0x21a6('0x27')](handleError(_0x3e68d4,null));};exports['destroy']=function(_0x4da822,_0x52ae00){return db[_0x21a6('0x38')]['find']({'where':{'id':_0x4da822['params']['id']}})['then'](handleEntityNotFound(_0x52ae00,null))[_0x21a6('0x1e')](removeEntity(_0x52ae00,null))[_0x21a6('0x27')](handleError(_0x52ae00,null));};exports['describe']=function(_0x1f97f0,_0x54a458){return db[_0x21a6('0x38')][_0x21a6('0x53')]()[_0x21a6('0x1e')](respondWithResult(_0x54a458,null))[_0x21a6('0x27')](handleError(_0x54a458,null));};var interaction_log=require(_0x21a6('0x13'))('sms-interactions');exports[_0x21a6('0x54')]=function(_0x408416,_0x21ff31,_0x121281){var _0x26e426={'agent':{},'channel':'sms'};if(_0x408416[_0x21a6('0x52')]['id']){delete _0x408416[_0x21a6('0x52')]['id'];}_0x408416['body'][_0x21a6('0x55')]=!![];_0x408416[_0x21a6('0x52')][_0x21a6('0x56')]=moment()[_0x21a6('0x57')](_0x21a6('0x58'));_0x408416[_0x21a6('0x52')][_0x21a6('0x59')]=_0x408416[_0x21a6('0x52')][_0x21a6('0x59')]||_0x408416[_0x21a6('0x5a')]['id'];_0x26e426['agent']['id']=_0x408416['body'][_0x21a6('0x59')];return db['SmsMessage']['find']({'where':{'id':_0x408416[_0x21a6('0x4f')]['id'],'UserId':null}})[_0x21a6('0x1e')](handleEntityNotFound(_0x21ff31,null))['then'](saveUpdates(_0x408416[_0x21a6('0x52')],null))[_0x21a6('0x1e')](function(_0x59212a){if(_0x59212a){_0x26e426['message']=_0x59212a[_0x21a6('0x5b')]({'plain':!![]});return db[_0x21a6('0x5c')]['find']({'where':{'id':_0x59212a[_0x21a6('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x21ff31,null))[_0x21a6('0x1e')](function(_0x347402){if(_0x347402){return _0x347402[_0x21a6('0x32')]({'UserId':_0x408416['body']['UserId'],'read1stAt':_[_0x21a6('0x5e')](_0x347402[_0x21a6('0x5f')])?moment()['format'](_0x21a6('0x58')):undefined});}return null;})[_0x21a6('0x1e')](function(_0x1a735f){if(_0x1a735f){_0x26e426[_0x21a6('0x60')]=_0x1a735f[_0x21a6('0x5b')]({'plain':!![]});interaction_log[_0x21a6('0x61')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x408416[_0x21a6('0x5a')]['id'],_0x408416[_0x21a6('0x5a')][_0x21a6('0x3b')],_0x408416[_0x21a6('0x5a')][_0x21a6('0x62')],_0x26e426[_0x21a6('0x60')]['id'],_0x408416[_0x21a6('0x52')]?JSON['stringify'](_0x408416[_0x21a6('0x52')]):_0x21a6('0x63'));return respondWithRpcPromise(_0x21a6('0x64'),_0x21a6('0x65'),_0x26e426);}return null;})[_0x21a6('0x1e')](function(_0xad82c2){var _0x322e66=_0x21a6('0x66')+_0xad82c2[_0x21a6('0x25')][_0x21a6('0x67')];return db[_0x21a6('0x68')][_0x21a6('0x3c')](_0x322e66,{'type':db[_0x21a6('0x69')][_0x21a6('0x6a')][_0x21a6('0x6b')],'raw':!![]})[_0x21a6('0x1e')](function(_0x29a6fb){return _0x29a6fb;});})[_0x21a6('0x1e')](function(_0x2198ad){if(_0x2198ad){_0x26e426[_0x21a6('0x25')][_0x21a6('0x6c')]=_0x2198ad[0x0];if(!_0x408416[_0x21a6('0x52')]['UserId'])return;return db[_0x21a6('0x6d')]['find']({'where':{'id':_0x408416[_0x21a6('0x52')][_0x21a6('0x59')],'role':_0x21a6('0x6e')},'attributes':['id','name','fullname',_0x21a6('0x6f'),_0x21a6('0x70')],'raw':!![]});}return null;})[_0x21a6('0x1e')](function(_0x37c843){if(!_0x37c843)return null;_0x26e426[_0x21a6('0x25')][_0x21a6('0x6e')]=_0x37c843;return _0x26e426;})['then'](function(_0x41a2b2){if(_0x41a2b2){if(_0x408416[_0x21a6('0x52')][_0x21a6('0x71')]){_0x26e426[_0x21a6('0x25')][_0x21a6('0x72')]=util[_0x21a6('0x57')]('SIP/%s',_0x408416[_0x21a6('0x5a')][_0x21a6('0x3b')]);_0x26e426[_0x21a6('0x25')][_0x21a6('0x73')]=_0x26e426[_0x21a6('0x73')];_0x26e426['message'][_0x21a6('0x74')]=_0x26e426['channel'];_0x26e426[_0x21a6('0x25')][_0x21a6('0x75')]=_0x21a6('0x54');return respondWithRpcPromise(_0x21a6('0x76'),_0x21a6('0x76'),{'event':_0x21a6('0x77'),'message':_0x26e426[_0x21a6('0x25')]},client9002)[_0x21a6('0x1e')](function(){return _0x26e426;});}return _0x26e426;}return null;})['then'](respondWithResult(_0x21ff31,null))['catch'](handleError(_0x21ff31,null));};var interaction_log=require(_0x21a6('0x13'))(_0x21a6('0x78'));exports[_0x21a6('0x30')]=function(_0x5997c6,_0x3dc988,_0x557995){var _0x1c1a77={'agent':{},'channel':'sms'};if(_0x5997c6['body']['id']){delete _0x5997c6[_0x21a6('0x52')]['id'];}_0x5997c6['body'][_0x21a6('0x59')]=_0x5997c6[_0x21a6('0x52')][_0x21a6('0x59')]||_0x5997c6[_0x21a6('0x5a')]['id'];_0x1c1a77[_0x21a6('0x6e')]['id']=_0x5997c6[_0x21a6('0x52')][_0x21a6('0x59')];return db[_0x21a6('0x38')][_0x21a6('0x50')]({'where':{'id':_0x5997c6['params']['id'],'UserId':null}})[_0x21a6('0x1e')](handleEntityNotFound(_0x3dc988,null))[_0x21a6('0x1e')](function(_0x40d6c8){if(_0x40d6c8){_0x1c1a77[_0x21a6('0x25')]=_0x40d6c8[_0x21a6('0x5b')]({'plain':!![]});return db[_0x21a6('0x5c')][_0x21a6('0x50')]({'where':{'id':_0x40d6c8['SmsInteractionId']}});}return null;})[_0x21a6('0x1e')](handleEntityNotFound(_0x3dc988,null))[_0x21a6('0x1e')](function(_0x4b1852){if(_0x4b1852){_0x1c1a77[_0x21a6('0x60')]=_0x4b1852[_0x21a6('0x5b')]({'plain':!![]});interaction_log[_0x21a6('0x61')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5997c6[_0x21a6('0x5a')]['id'],_0x5997c6[_0x21a6('0x5a')][_0x21a6('0x3b')],_0x5997c6[_0x21a6('0x5a')][_0x21a6('0x62')],_0x1c1a77[_0x21a6('0x60')]['id'],_0x5997c6[_0x21a6('0x52')]?JSON[_0x21a6('0x21')](_0x5997c6['body']):_0x21a6('0x63'));return respondWithRpcPromise(_0x21a6('0x79'),'rejectMessage',_0x1c1a77);}return null;})[_0x21a6('0x1e')](function(_0x2dfa22){var _0x2a0f26=_0x21a6('0x66')+_0x2dfa22[_0x21a6('0x25')][_0x21a6('0x67')];return db[_0x21a6('0x68')][_0x21a6('0x3c')](_0x2a0f26,{'type':db['Sequelize'][_0x21a6('0x6a')][_0x21a6('0x6b')],'raw':!![]})[_0x21a6('0x1e')](function(_0x39fe9f){return _0x39fe9f;});})['then'](function(_0x7186b7){if(_0x7186b7){_0x1c1a77[_0x21a6('0x25')][_0x21a6('0x6c')]=_0x7186b7[0x0];if(!_0x5997c6[_0x21a6('0x52')][_0x21a6('0x59')])return;return db[_0x21a6('0x6d')][_0x21a6('0x50')]({'where':{'id':_0x5997c6[_0x21a6('0x52')]['UserId'],'role':_0x21a6('0x6e')},'attributes':['id','name',_0x21a6('0x7a'),_0x21a6('0x6f'),_0x21a6('0x70')],'raw':!![]});}return null;})[_0x21a6('0x1e')](function(_0x1bbdd7){if(!_0x1bbdd7)return null;_0x1c1a77['message'][_0x21a6('0x6e')]=_0x1bbdd7;return _0x1c1a77;})[_0x21a6('0x1e')](function(_0x24f40e){if(_0x24f40e){_0x24f40e[_0x21a6('0x25')][_0x21a6('0x72')]=util['format'](_0x21a6('0x7b'),_0x5997c6[_0x21a6('0x5a')]['name']);_0x24f40e['message'][_0x21a6('0x73')]=_0x1c1a77['channel'];_0x24f40e[_0x21a6('0x25')][_0x21a6('0x74')]=_0x1c1a77[_0x21a6('0x73')];_0x24f40e[_0x21a6('0x25')]['event']=_0x21a6('0x30');respondWithRpcPromise(_0x21a6('0x76'),'EventManager',{'event':_0x21a6('0x7c'),'message':_0x24f40e[_0x21a6('0x25')]},client9002);return _0x1c1a77;}return null;})[_0x21a6('0x1e')](respondWithResult(_0x3dc988,null))['catch'](handleError(_0x3dc988,null));};exports[_0x21a6('0x29')]=function(_0x18b30d,_0x3b6f10,_0x3a0147){if(_0x18b30d[_0x21a6('0x52')]['id']){delete _0x18b30d[_0x21a6('0x52')]['id'];}var _0x58801e;return db[_0x21a6('0x38')][_0x21a6('0x50')]({'where':{'id':_0x18b30d['params']['id']}})[_0x21a6('0x1e')](handleEntityNotFound(_0x3b6f10,null))[_0x21a6('0x1e')](function(_0x302adb){if(_0x302adb){_0x58801e=_0x302adb;return db[_0x21a6('0x7d')][_0x21a6('0x50')]({'where':{'id':_0x302adb[_0x21a6('0x7e')]}});}})[_0x21a6('0x1e')](handleEntityNotFound(_0x3b6f10,null))[_0x21a6('0x1e')](function(_0x18b70d){if(_0x18b70d){logger[_0x21a6('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x21a6('0x29'),_0x21a6('0x7f'),_0x18b70d[_0x21a6('0x3a')],util[_0x21a6('0x80')](_0x18b30d[_0x21a6('0x52')],{'showHidden':![],'depth':null}));switch(_0x18b70d[_0x21a6('0x3a')]){case'twilio':if(_0x18b30d[_0x21a6('0x52')]['MessageSid']&&_0x18b30d[_0x21a6('0x52')][_0x21a6('0x81')]===_0x58801e[_0x21a6('0x82')]){return _0x58801e[_0x21a6('0x32')]({'read':!![]});}else{logger[_0x21a6('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x21a6('0x29'),_0x21a6('0x83'),util[_0x21a6('0x80')](_0x18b30d[_0x21a6('0x52')],{'showHidden':![],'depth':null}));}break;case _0x21a6('0x84'):if(_0x18b30d[_0x21a6('0x52')][_0x21a6('0x85')]&&_0x18b30d[_0x21a6('0x52')][_0x21a6('0x85')]===_0x58801e['messageId']&&_[_0x21a6('0x86')]([_0x21a6('0x87'),_0x21a6('0x88')],_0x18b30d[_0x21a6('0x52')]['Status'])>=0x0){return _0x58801e[_0x21a6('0x32')]({'read':!![]});}else{logger[_0x21a6('0x23')](_0x21a6('0x89'),_0x21a6('0x29'),_0x21a6('0x8a'),util['inspect'](_0x18b30d[_0x21a6('0x52')],{'showHidden':![],'depth':null}));}break;case _0x21a6('0x8b'):var _0xb2a8c1=_0x18b30d['body'][_0x21a6('0x8c')][0x0];if(_0xb2a8c1[_0x21a6('0x29')][_0x21a6('0x8d')]==='DELIVERED'){return _0x58801e['update']({'read':!![]});}else{logger[_0x21a6('0x23')](_0x21a6('0x89'),_0x21a6('0x29'),'infobip',util[_0x21a6('0x80')](_0x18b30d[_0x21a6('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x58801e;}})[_0x21a6('0x1e')](respondWithResult(_0x3b6f10,null))['catch'](handleError(_0x3b6f10,null));}; \ No newline at end of file +var _0x22c9=['sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','email','internal','manual','SIP/%s','channel','event','EventManager','../../config/logger','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','interface','motionChannel','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','infobip','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','includeAll','include','findAll','rows','show','params','options','find','catch','body','describe'];(function(_0x170952,_0xfa7a1e){var _0x4cbb6c=function(_0x1a381d){while(--_0x1a381d){_0x170952['push'](_0x170952['shift']());}};_0x4cbb6c(++_0xfa7a1e);}(_0x22c9,0x151));var _0x922c=function(_0x3af54c,_0x436158){_0x3af54c=_0x3af54c-0x0;var _0x4bc816=_0x22c9[_0x3af54c];return _0x4bc816;};'use strict';var emlformat=require(_0x922c('0x0'));var rimraf=require(_0x922c('0x1'));var zipdir=require(_0x922c('0x2'));var jsonpatch=require(_0x922c('0x3'));var rp=require('request-promise');var moment=require(_0x922c('0x4'));var BPromise=require(_0x922c('0x5'));var Mustache=require(_0x922c('0x6'));var util=require(_0x922c('0x7'));var path=require(_0x922c('0x8'));var sox=require(_0x922c('0x9'));var csv=require(_0x922c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x922c('0xb'));var _=require(_0x922c('0xc'));var squel=require(_0x922c('0xd'));var crypto=require(_0x922c('0xe'));var jsforce=require(_0x922c('0xf'));var deskjs=require(_0x922c('0x10'));var toCsv=require(_0x922c('0xa'));var querystring=require(_0x922c('0x11'));var Papa=require(_0x922c('0x12'));var Redis=require(_0x922c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x922c('0x14'));var as=require(_0x922c('0x15'));var hardwareService=require(_0x922c('0x16'));var logger=require('../../config/logger')(_0x922c('0x17'));var utils=require(_0x922c('0x18'));var config=require(_0x922c('0x19'));var licenseUtil=require(_0x922c('0x1a'));var db=require(_0x922c('0x1b'))['db'];config[_0x922c('0x1c')]=_[_0x922c('0x1d')](config[_0x922c('0x1c')],{'host':_0x922c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x922c('0x1f'))['register'](socket);var jayson=require(_0x922c('0x20'));var client=jayson[_0x922c('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x922c('0x21')][_0x922c('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1934cb,_0x4a147d,_0x38e691,_0x4353b7){return new BPromise(function(_0x5aa71a,_0x5a29fc){var _0x4e3958=_0x4353b7||client;return _0x4e3958[_0x922c('0x23')](_0x1934cb,_0x38e691)[_0x922c('0x24')](function(_0x3b42dd){logger['info'](_0x922c('0x25'),_0x4a147d,_0x922c('0x26'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4a147d,'request\x20sent',JSON[_0x922c('0x27')](_0x3b42dd));if(_0x3b42dd[_0x922c('0x28')]){if(_0x3b42dd[_0x922c('0x28')][_0x922c('0x29')]===0x1f4){logger[_0x922c('0x28')](_0x922c('0x25'),_0x4a147d,_0x3b42dd[_0x922c('0x28')][_0x922c('0x2a')]);return _0x5a29fc(_0x3b42dd[_0x922c('0x28')]['message']);}logger[_0x922c('0x28')](_0x922c('0x25'),_0x4a147d,_0x3b42dd['error']['message']);return _0x5aa71a(_0x3b42dd['error'][_0x922c('0x2a')]);}else{logger[_0x922c('0x2b')](_0x922c('0x25'),_0x4a147d,_0x922c('0x26'));_0x5aa71a(_0x3b42dd[_0x922c('0x2c')][_0x922c('0x2a')]);}})['catch'](function(_0x1a0db9){logger[_0x922c('0x28')](_0x922c('0x25'),_0x4a147d,_0x1a0db9);_0x5a29fc(_0x1a0db9);});});}function respondWithStatusCode(_0x4d9fb0,_0x54d8ef){_0x54d8ef=_0x54d8ef||0xcc;return function(_0x1b257d){if(_0x1b257d){return _0x4d9fb0[_0x922c('0x2d')](_0x54d8ef);}return _0x4d9fb0[_0x922c('0x2e')](_0x54d8ef)[_0x922c('0x2f')]();};}function respondWithResult(_0x5a07d7,_0x53e9c7){_0x53e9c7=_0x53e9c7||0xc8;return function(_0x5434d6){if(_0x5434d6){return _0x5a07d7['status'](_0x53e9c7)[_0x922c('0x30')](_0x5434d6);}};}function respondWithFilteredResult(_0x375298,_0x3475b7){return function(_0x42f16a){if(_0x42f16a){var _0x94d216=typeof _0x3475b7[_0x922c('0x31')]==='undefined'&&typeof _0x3475b7[_0x922c('0x32')]===_0x922c('0x33');var _0x10381b=_0x42f16a['count'];var _0x5a0a54=_0x94d216?0x0:_0x3475b7['offset'];var _0x2a2e62=_0x94d216?_0x42f16a[_0x922c('0x34')]:_0x3475b7[_0x922c('0x31')]+_0x3475b7[_0x922c('0x32')];var _0x5ef850;if(_0x2a2e62>=_0x10381b){_0x2a2e62=_0x10381b;_0x5ef850=0xc8;}else{_0x5ef850=0xce;}_0x375298[_0x922c('0x2e')](_0x5ef850);return _0x375298['set']('Content-Range',_0x5a0a54+'-'+_0x2a2e62+'/'+_0x10381b)['json'](_0x42f16a);}return null;};}function patchUpdates(_0x13bdfa){return function(_0x22b793){try{jsonpatch[_0x922c('0x35')](_0x22b793,_0x13bdfa,!![]);}catch(_0x5078fd){return BPromise[_0x922c('0x36')](_0x5078fd);}return _0x22b793['save']();};}function saveUpdates(_0x1cca91,_0x2f632f){return function(_0x45e0fa){if(_0x45e0fa){return _0x45e0fa[_0x922c('0x37')](_0x1cca91)[_0x922c('0x24')](function(_0x41866e){return _0x41866e;});}return null;};}function removeEntity(_0x17bb79,_0x37c8f1){return function(_0xcfe818){if(_0xcfe818){return _0xcfe818[_0x922c('0x38')]()[_0x922c('0x24')](function(){_0x17bb79[_0x922c('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x303e5e,_0x41164b){return function(_0x56fa4c){if(!_0x56fa4c){_0x303e5e[_0x922c('0x2d')](0x194);}return _0x56fa4c;};}function handleError(_0xe1c4d1,_0x4b2e94){_0x4b2e94=_0x4b2e94||0x1f4;return function(_0x13c9ad){logger[_0x922c('0x28')](_0x13c9ad[_0x922c('0x39')]);if(_0x13c9ad[_0x922c('0x3a')]){delete _0x13c9ad[_0x922c('0x3a')];}_0xe1c4d1[_0x922c('0x2e')](_0x4b2e94)['send'](_0x13c9ad);};}exports[_0x922c('0x3b')]=function(_0x52d0e0,_0x2d7b96){var _0xfe5e8b={},_0x56b34e={},_0x12d51e={'count':0x0,'rows':[]};var _0x19a438=_[_0x922c('0x3c')](db[_0x922c('0x3d')][_0x922c('0x3e')],function(_0x25abe0){return{'name':_0x25abe0['fieldName'],'type':_0x25abe0[_0x922c('0x3f')]['key']};});_0x56b34e['model']=_[_0x922c('0x3c')](_0x19a438,_0x922c('0x3a'));_0x56b34e[_0x922c('0x40')]=_[_0x922c('0x41')](_0x52d0e0[_0x922c('0x40')]);_0x56b34e[_0x922c('0x42')]=_[_0x922c('0x43')](_0x56b34e[_0x922c('0x44')],_0x56b34e[_0x922c('0x40')]);_0xfe5e8b[_0x922c('0x45')]=_[_0x922c('0x43')](_0x56b34e[_0x922c('0x44')],qs[_0x922c('0x46')](_0x52d0e0['query']['fields']));_0xfe5e8b[_0x922c('0x45')]=_0xfe5e8b[_0x922c('0x45')]['length']?_0xfe5e8b['attributes']:_0x56b34e[_0x922c('0x44')];if(!_0x52d0e0['query'][_0x922c('0x47')]('nolimit')){_0xfe5e8b[_0x922c('0x32')]=qs[_0x922c('0x32')](_0x52d0e0[_0x922c('0x40')][_0x922c('0x32')]);_0xfe5e8b[_0x922c('0x31')]=qs[_0x922c('0x31')](_0x52d0e0[_0x922c('0x40')][_0x922c('0x31')]);}_0xfe5e8b[_0x922c('0x48')]=qs[_0x922c('0x49')](_0x52d0e0[_0x922c('0x40')][_0x922c('0x49')]);_0xfe5e8b['where']=qs[_0x922c('0x42')](_[_0x922c('0x4a')](_0x52d0e0[_0x922c('0x40')],_0x56b34e[_0x922c('0x42')]),_0x19a438);if(_0x52d0e0['query'][_0x922c('0x4b')]){_0xfe5e8b['where']=_[_0x922c('0x4c')](_0xfe5e8b['where'],{'$or':_['map'](_0x19a438,function(_0x4dad81){if(_0x4dad81[_0x922c('0x3f')]!=='VIRTUAL'){var _0x57e6e5={};_0x57e6e5[_0x4dad81[_0x922c('0x3a')]]={'$like':'%'+_0x52d0e0['query'][_0x922c('0x4b')]+'%'};return _0x57e6e5;}})});}_0xfe5e8b=_['merge']({},_0xfe5e8b,_0x52d0e0['options']);var _0x4fc537={'where':_0xfe5e8b[_0x922c('0x4d')]};return db[_0x922c('0x3d')][_0x922c('0x34')](_0x4fc537)['then'](function(_0x324fc3){_0x12d51e[_0x922c('0x34')]=_0x324fc3;if(_0x52d0e0['query'][_0x922c('0x4e')]){_0xfe5e8b[_0x922c('0x4f')]=[{'all':!![]}];}return db[_0x922c('0x3d')][_0x922c('0x50')](_0xfe5e8b);})[_0x922c('0x24')](function(_0x1154f5){_0x12d51e[_0x922c('0x51')]=_0x1154f5;return _0x12d51e;})[_0x922c('0x24')](respondWithFilteredResult(_0x2d7b96,_0xfe5e8b))['catch'](handleError(_0x2d7b96,null));};exports[_0x922c('0x52')]=function(_0x3e2cc3,_0x399ec1){var _0x13a199={'raw':!![],'where':{'id':_0x3e2cc3[_0x922c('0x53')]['id']}},_0x46136d={};_0x46136d[_0x922c('0x44')]=_['keys'](db[_0x922c('0x3d')][_0x922c('0x3e')]);_0x46136d['query']=_[_0x922c('0x41')](_0x3e2cc3[_0x922c('0x40')]);_0x46136d['filters']=_[_0x922c('0x43')](_0x46136d[_0x922c('0x44')],_0x46136d[_0x922c('0x40')]);_0x13a199['attributes']=_[_0x922c('0x43')](_0x46136d[_0x922c('0x44')],qs[_0x922c('0x46')](_0x3e2cc3[_0x922c('0x40')][_0x922c('0x46')]));_0x13a199['attributes']=_0x13a199[_0x922c('0x45')]['length']?_0x13a199[_0x922c('0x45')]:_0x46136d[_0x922c('0x44')];if(_0x3e2cc3[_0x922c('0x40')][_0x922c('0x4e')]){_0x13a199[_0x922c('0x4f')]=[{'all':!![]}];}_0x13a199=_[_0x922c('0x4c')]({},_0x13a199,_0x3e2cc3[_0x922c('0x54')]);return db[_0x922c('0x3d')][_0x922c('0x55')](_0x13a199)[_0x922c('0x24')](handleEntityNotFound(_0x399ec1,null))[_0x922c('0x24')](respondWithResult(_0x399ec1,null))[_0x922c('0x56')](handleError(_0x399ec1,null));};exports['create']=function(_0x507a8d,_0x248e1f){return db[_0x922c('0x3d')]['create'](_0x507a8d[_0x922c('0x57')],{})[_0x922c('0x24')](respondWithResult(_0x248e1f,0xc9))[_0x922c('0x56')](handleError(_0x248e1f,null));};exports[_0x922c('0x37')]=function(_0x18ad51,_0x38ba87){if(_0x18ad51['body']['id']){delete _0x18ad51[_0x922c('0x57')]['id'];}return db[_0x922c('0x3d')][_0x922c('0x55')]({'where':{'id':_0x18ad51[_0x922c('0x53')]['id']}})[_0x922c('0x24')](handleEntityNotFound(_0x38ba87,null))[_0x922c('0x24')](saveUpdates(_0x18ad51[_0x922c('0x57')],null))['then'](respondWithResult(_0x38ba87,null))[_0x922c('0x56')](handleError(_0x38ba87,null));};exports[_0x922c('0x38')]=function(_0x48df90,_0x2314a8){return db[_0x922c('0x3d')][_0x922c('0x55')]({'where':{'id':_0x48df90[_0x922c('0x53')]['id']}})['then'](handleEntityNotFound(_0x2314a8,null))[_0x922c('0x24')](removeEntity(_0x2314a8,null))[_0x922c('0x56')](handleError(_0x2314a8,null));};exports[_0x922c('0x58')]=function(_0x431a70,_0x2b8a89){return db[_0x922c('0x3d')][_0x922c('0x58')]()[_0x922c('0x24')](respondWithResult(_0x2b8a89,null))[_0x922c('0x56')](handleError(_0x2b8a89,null));};var interaction_log=require('../../config/logger')(_0x922c('0x59'));exports[_0x922c('0x5a')]=function(_0x4d2737,_0x4bcd31,_0x113cdb){var _0x425706={'agent':{},'channel':'sms'};if(_0x4d2737[_0x922c('0x57')]['id']){delete _0x4d2737[_0x922c('0x57')]['id'];}_0x4d2737['body'][_0x922c('0x5b')]=!![];_0x4d2737[_0x922c('0x57')]['readAt']=moment()[_0x922c('0x5c')](_0x922c('0x5d'));_0x4d2737[_0x922c('0x57')][_0x922c('0x5e')]=_0x4d2737[_0x922c('0x57')]['UserId']||_0x4d2737[_0x922c('0x5f')]['id'];_0x425706[_0x922c('0x60')]['id']=_0x4d2737[_0x922c('0x57')][_0x922c('0x5e')];return db[_0x922c('0x3d')]['find']({'where':{'id':_0x4d2737[_0x922c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4bcd31,null))['then'](saveUpdates(_0x4d2737['body'],null))[_0x922c('0x24')](function(_0x1aae97){if(_0x1aae97){_0x425706[_0x922c('0x2a')]=_0x1aae97[_0x922c('0x61')]({'plain':!![]});return db[_0x922c('0x62')]['find']({'where':{'id':_0x1aae97[_0x922c('0x63')]}});}return null;})[_0x922c('0x24')](handleEntityNotFound(_0x4bcd31,null))[_0x922c('0x24')](function(_0x543076){if(_0x543076){return _0x543076[_0x922c('0x37')]({'UserId':_0x4d2737[_0x922c('0x57')][_0x922c('0x5e')],'read1stAt':_['isNil'](_0x543076[_0x922c('0x64')])?moment()[_0x922c('0x5c')](_0x922c('0x5d')):undefined});}return null;})[_0x922c('0x24')](function(_0x542409){if(_0x542409){_0x425706[_0x922c('0x65')]=_0x542409[_0x922c('0x61')]({'plain':!![]});interaction_log[_0x922c('0x2b')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d2737[_0x922c('0x5f')]['id'],_0x4d2737[_0x922c('0x5f')][_0x922c('0x3a')],_0x4d2737[_0x922c('0x5f')][_0x922c('0x66')],_0x425706[_0x922c('0x65')]['id'],_0x4d2737[_0x922c('0x57')]?JSON[_0x922c('0x27')](_0x4d2737['body']):_0x922c('0x67'));return respondWithRpcPromise('AcceptMessage',_0x922c('0x68'),_0x425706);}return null;})[_0x922c('0x24')](function(_0x518061){var _0x2b545d=_0x922c('0x69')+_0x518061['message'][_0x922c('0x6a')];return db[_0x922c('0x6b')]['query'](_0x2b545d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x922c('0x24')](function(_0x3f2ca0){return _0x3f2ca0;});})[_0x922c('0x24')](function(_0x5810cb){if(_0x5810cb){_0x425706['message'][_0x922c('0x6c')]=_0x5810cb[0x0];if(!_0x4d2737['body']['UserId'])return;return db[_0x922c('0x6d')][_0x922c('0x55')]({'where':{'id':_0x4d2737['body'][_0x922c('0x5e')],'role':_0x922c('0x60')},'attributes':['id',_0x922c('0x3a'),'fullname',_0x922c('0x6e'),_0x922c('0x6f')],'raw':!![]});}return null;})[_0x922c('0x24')](function(_0x5f4049){if(!_0x5f4049)return null;_0x425706[_0x922c('0x2a')][_0x922c('0x60')]=_0x5f4049;return _0x425706;})[_0x922c('0x24')](function(_0x2e89f7){if(_0x2e89f7){if(_0x4d2737[_0x922c('0x57')][_0x922c('0x70')]){_0x425706['message']['interface']=util['format'](_0x922c('0x71'),_0x4d2737[_0x922c('0x5f')][_0x922c('0x3a')]);_0x425706['message'][_0x922c('0x72')]=_0x425706[_0x922c('0x72')];_0x425706[_0x922c('0x2a')]['motionChannel']=_0x425706[_0x922c('0x72')];_0x425706[_0x922c('0x2a')][_0x922c('0x73')]=_0x922c('0x5a');return respondWithRpcPromise(_0x922c('0x74'),'EventManager',{'event':'acceptmessage','message':_0x425706[_0x922c('0x2a')]},client9002)[_0x922c('0x24')](function(){return _0x425706;});}return _0x425706;}return null;})[_0x922c('0x24')](respondWithResult(_0x4bcd31,null))['catch'](handleError(_0x4bcd31,null));};var interaction_log=require(_0x922c('0x75'))(_0x922c('0x59'));exports[_0x922c('0x36')]=function(_0x5dd37e,_0x273640,_0x364b06){var _0x358c1e={'agent':{},'channel':_0x922c('0x76')};if(_0x5dd37e['body']['id']){delete _0x5dd37e['body']['id'];}_0x5dd37e[_0x922c('0x57')][_0x922c('0x5e')]=_0x5dd37e[_0x922c('0x57')][_0x922c('0x5e')]||_0x5dd37e[_0x922c('0x5f')]['id'];_0x358c1e[_0x922c('0x60')]['id']=_0x5dd37e[_0x922c('0x57')]['UserId'];return db[_0x922c('0x3d')][_0x922c('0x55')]({'where':{'id':_0x5dd37e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x273640,null))[_0x922c('0x24')](function(_0x1fbdfd){if(_0x1fbdfd){_0x358c1e[_0x922c('0x2a')]=_0x1fbdfd['get']({'plain':!![]});return db[_0x922c('0x62')]['find']({'where':{'id':_0x1fbdfd[_0x922c('0x63')]}});}return null;})[_0x922c('0x24')](handleEntityNotFound(_0x273640,null))[_0x922c('0x24')](function(_0x74ff61){if(_0x74ff61){_0x358c1e[_0x922c('0x65')]=_0x74ff61['get']({'plain':!![]});interaction_log['info'](_0x922c('0x77'),_0x5dd37e[_0x922c('0x5f')]['id'],_0x5dd37e[_0x922c('0x5f')][_0x922c('0x3a')],_0x5dd37e[_0x922c('0x5f')][_0x922c('0x66')],_0x358c1e[_0x922c('0x65')]['id'],_0x5dd37e[_0x922c('0x57')]?JSON[_0x922c('0x27')](_0x5dd37e[_0x922c('0x57')]):_0x922c('0x67'));return respondWithRpcPromise(_0x922c('0x78'),_0x922c('0x79'),_0x358c1e);}return null;})['then'](function(_0x1096e7){var _0x7b08c9=_0x922c('0x69')+_0x1096e7['message'][_0x922c('0x6a')];return db[_0x922c('0x6b')][_0x922c('0x40')](_0x7b08c9,{'type':db['Sequelize']['QueryTypes'][_0x922c('0x7a')],'raw':!![]})[_0x922c('0x24')](function(_0x47d9aa){return _0x47d9aa;});})[_0x922c('0x24')](function(_0x52d114){if(_0x52d114){_0x358c1e[_0x922c('0x2a')][_0x922c('0x6c')]=_0x52d114[0x0];if(!_0x5dd37e[_0x922c('0x57')][_0x922c('0x5e')])return;return db[_0x922c('0x6d')][_0x922c('0x55')]({'where':{'id':_0x5dd37e[_0x922c('0x57')]['UserId'],'role':_0x922c('0x60')},'attributes':['id',_0x922c('0x3a'),_0x922c('0x7b'),'email',_0x922c('0x6f')],'raw':!![]});}return null;})[_0x922c('0x24')](function(_0x2366a9){if(!_0x2366a9)return null;_0x358c1e[_0x922c('0x2a')][_0x922c('0x60')]=_0x2366a9;return _0x358c1e;})[_0x922c('0x24')](function(_0x1d74d1){if(_0x1d74d1){_0x1d74d1[_0x922c('0x2a')][_0x922c('0x7c')]=util[_0x922c('0x5c')](_0x922c('0x71'),_0x5dd37e['user']['name']);_0x1d74d1[_0x922c('0x2a')]['channel']=_0x358c1e[_0x922c('0x72')];_0x1d74d1[_0x922c('0x2a')][_0x922c('0x7d')]=_0x358c1e['channel'];_0x1d74d1[_0x922c('0x2a')]['event']=_0x922c('0x36');respondWithRpcPromise(_0x922c('0x74'),_0x922c('0x74'),{'event':_0x922c('0x7e'),'message':_0x1d74d1[_0x922c('0x2a')]},client9002);return _0x358c1e;}return null;})[_0x922c('0x24')](respondWithResult(_0x273640,null))[_0x922c('0x56')](handleError(_0x273640,null));};exports[_0x922c('0x2e')]=function(_0x35709c,_0x5e2b95,_0x2f822e){if(_0x35709c['body']['id']){delete _0x35709c[_0x922c('0x57')]['id'];}var _0x26bb29;return db[_0x922c('0x3d')][_0x922c('0x55')]({'where':{'id':_0x35709c[_0x922c('0x53')]['id']}})[_0x922c('0x24')](handleEntityNotFound(_0x5e2b95,null))[_0x922c('0x24')](function(_0x33b0fe){if(_0x33b0fe){_0x26bb29=_0x33b0fe;return db[_0x922c('0x7f')][_0x922c('0x55')]({'where':{'id':_0x33b0fe[_0x922c('0x80')]}});}})[_0x922c('0x24')](handleEntityNotFound(_0x5e2b95,null))[_0x922c('0x24')](function(_0x200b6e){if(_0x200b6e){logger['debug'](_0x922c('0x81'),'status','received\x20delivery\x20report\x20from',_0x200b6e[_0x922c('0x3f')],util[_0x922c('0x82')](_0x35709c[_0x922c('0x57')],{'showHidden':![],'depth':null}));switch(_0x200b6e[_0x922c('0x3f')]){case _0x922c('0x83'):if(_0x35709c['body'][_0x922c('0x84')]&&_0x35709c[_0x922c('0x57')][_0x922c('0x84')]===_0x26bb29[_0x922c('0x85')]){return _0x26bb29['update']({'read':!![]});}else{logger[_0x922c('0x28')](_0x922c('0x86'),_0x922c('0x2e'),'twilio',util['inspect'](_0x35709c['body'],{'showHidden':![],'depth':null}));}break;case _0x922c('0x87'):if(_0x35709c[_0x922c('0x57')][_0x922c('0x88')]&&_0x35709c[_0x922c('0x57')][_0x922c('0x88')]===_0x26bb29[_0x922c('0x85')]&&_['indexOf']([_0x922c('0x89'),_0x922c('0x8a')],_0x35709c[_0x922c('0x57')][_0x922c('0x8b')])>=0x0){return _0x26bb29['update']({'read':!![]});}else{logger[_0x922c('0x28')](_0x922c('0x86'),'status','plivio',util[_0x922c('0x82')](_0x35709c['body'],{'showHidden':![],'depth':null}));}break;case _0x922c('0x8c'):var _0x5b0120=_0x35709c[_0x922c('0x57')]['results'][0x0];if(_0x5b0120[_0x922c('0x2e')][_0x922c('0x8d')]==='DELIVERED'){return _0x26bb29[_0x922c('0x37')]({'read':!![]});}else{logger[_0x922c('0x28')](_0x922c('0x86'),'status','infobip',util['inspect'](_0x35709c[_0x922c('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x26bb29;}})[_0x922c('0x24')](respondWithResult(_0x5e2b95,null))[_0x922c('0x56')](handleError(_0x5e2b95,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b9d391d..5abfa68 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 _0x07d8=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save'];(function(_0x1d6d1f,_0x3d8f16){var _0x42d7cd=function(_0x298524){while(--_0x298524){_0x1d6d1f['push'](_0x1d6d1f['shift']());}};_0x42d7cd(++_0x3d8f16);}(_0x07d8,0x1aa));var _0x807d=function(_0x3a931e,_0x583292){_0x3a931e=_0x3a931e-0x0;var _0x4fd6b6=_0x07d8[_0x3a931e];return _0x4fd6b6;};'use strict';var EventEmitter=require(_0x807d('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x807d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x807d('0x2')](0x0);var events={'afterCreate':_0x807d('0x3'),'afterUpdate':_0x807d('0x4'),'afterDestroy':_0x807d('0x5')};function emitEvent(_0x4cb666){return function(_0x1654eb,_0x4d7847,_0x11f8e8){SmsMessageEvents[_0x807d('0x6')](_0x4cb666+':'+_0x1654eb['id'],_0x1654eb);SmsMessageEvents[_0x807d('0x6')](_0x4cb666,_0x1654eb);_0x11f8e8(null);};}for(var e in events){if(events[_0x807d('0x7')](e)){var event=events[e];SmsMessage[_0x807d('0x8')](e,emitEvent(event));}}module[_0x807d('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x9a33=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x9a33,0x9f));var _0x39a3=function(_0x4d1f20,_0x141995){_0x4d1f20=_0x4d1f20-0x0;var _0x5544f7=_0x9a33[_0x4d1f20];return _0x5544f7;};'use strict';var EventEmitter=require(_0x39a3('0x0'));var SmsMessage=require(_0x39a3('0x1'))['db'][_0x39a3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x39a3('0x3')](0x0);var events={'afterCreate':_0x39a3('0x4'),'afterUpdate':_0x39a3('0x5'),'afterDestroy':_0x39a3('0x6')};function emitEvent(_0x1f5d6a){return function(_0x4df9e8,_0x51eafd,_0x3e2a71){SmsMessageEvents[_0x39a3('0x7')](_0x1f5d6a+':'+_0x4df9e8['id'],_0x4df9e8);SmsMessageEvents['emit'](_0x1f5d6a,_0x4df9e8);_0x3e2a71(null);};}for(var e in events){if(events[_0x39a3('0x8')](e)){var event=events[e];SmsMessage[_0x39a3('0x9')](e,emitEvent(event));}}module[_0x39a3('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index b9e6814..5b1f251 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 _0xe873=['sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','update','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','messages','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','%s:%s','authId','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','application/json','IBSSO\x20','token','Missing\x20parameters:\x20base_url','crypto','login','text','timestamp','keys','length','apiKey','createHash','md5','digest','hex','signature=','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','toString','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','sms_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','findOne','error','SmsAccount','find','type','twilio','authToken','accountSid','create','phone','/api/sms/messages/','/status?token=','then','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','split'];(function(_0x44cf0d,_0x1f023c){var _0x2657bd=function(_0x3265a2){while(--_0x3265a2){_0x44cf0d['push'](_0x44cf0d['shift']());}};_0x2657bd(++_0x1f023c);}(_0xe873,0xc4));var _0x3e87=function(_0x52b81e,_0xb5b16c){_0x52b81e=_0x52b81e-0x0;var _0x38a3e2=_0xe873[_0x52b81e];return _0x38a3e2;};'use strict';var _=require('lodash');var util=require(_0x3e87('0x0'));var logger=require(_0x3e87('0x1'))(_0x3e87('0x2'));var moment=require(_0x3e87('0x3'));var BPromise=require(_0x3e87('0x4'));var rp=require(_0x3e87('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e87('0x6'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x3e87('0x7')]=function(_0x224222,_0x193684){return _0x224222['define']('SmsMessage',attributes,{'tableName':_0x3e87('0x8'),'paranoid':![],'indexes':[{'name':_0x3e87('0x9'),'fields':[_0x3e87('0x9')]},{'name':'fti_sms_messages','fields':[_0x3e87('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bf2c5,_0x1cd1dc,_0x3eb3b7){var _0x129b8d=_0x224222[_0x3e87('0xb')];var _0x4efda7=_0x1bf2c5[_0x3e87('0xc')]({'plain':!![]});if(_0x4efda7[_0x3e87('0xd')]['toLowerCase']()==='in'||_0x4efda7[_0x3e87('0xd')][_0x3e87('0xe')]()===_0x3e87('0xf')&&!_0x4efda7[_0x3e87('0x10')]&&!_[_0x3e87('0x11')](_0x4efda7['UserId'])&&!_[_0x3e87('0x11')](_0x4efda7[_0x3e87('0x12')])){_0x129b8d['SmsInteraction'][_0x3e87('0x13')]({'where':{'id':_0x4efda7[_0x3e87('0x12')]}})['then'](function(_0x23bfaf){if(_0x23bfaf){_0x23bfaf['update']({'lastMsgAt':_0x4efda7['createdAt'],'lastMsgDirection':_0x4efda7[_0x3e87('0xd')]['toLowerCase']()});}})['catch'](function(_0x42536c){console[_0x3e87('0x14')](_0x42536c);});}if(_0x4efda7['direction']===_0x3e87('0xf')&&!_0x4efda7[_0x3e87('0x10')]){var _0x34e51b;_0x129b8d[_0x3e87('0x15')][_0x3e87('0x16')]({'where':{'id':_0x4efda7['SmsAccountId']},'raw':!![]})['then'](function(_0x1dbca8){_0x34e51b=_0x1dbca8;if(_0x34e51b&&_0x34e51b[_0x3e87('0x17')]){switch(_0x34e51b[_0x3e87('0x17')]){case _0x3e87('0x18'):var _0x3514dd=require('twilio');if(_0x34e51b['accountSid']&&_0x34e51b[_0x3e87('0x19')]&&_0x34e51b['phone']){var _0x4672f6=new _0x3514dd(_0x34e51b[_0x3e87('0x1a')],_0x34e51b[_0x3e87('0x19')]);_0x4672f6['messages'][_0x3e87('0x1b')]({'body':_0x4efda7[_0x3e87('0xa')],'to':_0x4efda7['phone'],'from':_0x34e51b[_0x3e87('0x1c')],'statusCallback':_0x34e51b['remote']+_0x3e87('0x1d')+_0x4efda7['id']+_0x3e87('0x1e')+_0x34e51b['token']})[_0x3e87('0x1f')](function(_0x48af91){if(_0x48af91['sid']){return _0x1bf2c5['update']({'messageId':_0x48af91[_0x3e87('0x20')]});}})[_0x3e87('0x21')](function(_0x16b881){logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),'twilio',util[_0x3e87('0x24')](_0x16b881,{'showHidden':![],'depth':null}));});}else{logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e87('0x23'),_0x3e87('0x18'),_0x3e87('0x25'));}break;case _0x3e87('0x26'):var _0x1e92be=_0x3e87('0x27');if(_0x34e51b['username']&&_0x34e51b[_0x3e87('0x28')]){var _0x16a988={'recipient':[_0x4efda7[_0x3e87('0x1c')]],'message':_0x4efda7[_0x3e87('0xa')],'message_type':_0x34e51b['smsMethod']};if(_0x34e51b['smsMethod']&&_0x34e51b[_0x3e87('0x29')]!=='SI'){_0x16a988[_0x3e87('0x2a')]=_0x34e51b[_0x3e87('0x1c')];}var _0x1552f9={'url':_0x1e92be+_0x3e87('0x2b')+_0x34e51b[_0x3e87('0x2c')]+_0x3e87('0x2d')+_0x34e51b[_0x3e87('0x28')],'method':_0x3e87('0x2e')};rp(_0x1552f9)['then'](function(_0x2f5638){var _0x1663bd=_0x2f5638[_0x3e87('0x2f')](';');var _0x401876={'user_key':_0x1663bd[0x0],'session_key':_0x1663bd[0x1]};_0x1552f9={'url':_0x1e92be+_0x3e87('0x30'),'method':_0x3e87('0x31'),'headers':{'user_key':_0x401876[_0x3e87('0x32')],'Session_key':_0x401876[_0x3e87('0x33')]},'json':!![],'body':_0x16a988};return rp(_0x1552f9);})[_0x3e87('0x1f')](function(_0x5a591d){if(_0x5a591d[_0x3e87('0x34')]>=0x1){var _0x494cab={'messageId':_0x5a591d[_0x3e87('0x35')]};if(_0x34e51b[_0x3e87('0x29')]!=='GP'||!_0x34e51b[_0x3e87('0x36')]){_0x494cab[_0x3e87('0x37')]=!![];}return _0x1bf2c5[_0x3e87('0x38')](_0x494cab);}else{return logger['error'](_0x3e87('0x22'),_0x3e87('0x23'),'skebby',util[_0x3e87('0x24')](_0x5a591d,{'showHidden':![],'depth':null}));}})[_0x3e87('0x21')](function(_0x5ae008){return logger['error'](_0x3e87('0x22'),'afterCreate','skebby',util[_0x3e87('0x24')](_0x5ae008,{'showHidden':![],'depth':null}));});}else{logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x3e87('0x39'):if(_0x34e51b['authToken']){var _0x29dfba={'recipient':_0x4efda7[_0x3e87('0x1c')],'message':_0x4efda7[_0x3e87('0xa')],'sender':_0x34e51b[_0x3e87('0x3a')]||_0x34e51b[_0x3e87('0x1c')],'authorization':_0x34e51b[_0x3e87('0x19')]};var _0x1cd1dc={'method':_0x3e87('0x31'),'uri':_0x3e87('0x3b'),'body':_0x29dfba,'json':!![]};rp(_0x1cd1dc)[_0x3e87('0x1f')](function(_0x1a7851){var _0x27248a={'messageId':_0x1a7851[_0x3e87('0x3c')]};if(!_0x34e51b[_0x3e87('0x36')]){_0x27248a[_0x3e87('0x37')]=!![];}return _0x1bf2c5[_0x3e87('0x38')](_0x27248a);})[_0x3e87('0x21')](function(_0xf5df0a){logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),'connectel',util[_0x3e87('0x24')](_0xf5df0a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x39'),_0x3e87('0x3d'));}break;case'clicksend':if(_0x34e51b['username']&&_0x34e51b['password']){var _0x29dfba={'messages':[{'source':_0x3e87('0x3e'),'to':_0x4efda7[_0x3e87('0x1c')],'body':_0x4efda7[_0x3e87('0xa')],'from':_0x34e51b['senderString']||_0x34e51b[_0x3e87('0x1c')]}]};var _0x832b76=util[_0x3e87('0x3f')]('%s:%s',_0x34e51b['username'],_0x34e51b[_0x3e87('0x28')]);var _0x1cd1dc={'method':_0x3e87('0x31'),'uri':_0x3e87('0x40'),'body':_0x29dfba,'headers':{'Authorization':util[_0x3e87('0x3f')](_0x3e87('0x41'),new Buffer(_0x832b76)['toString'](_0x3e87('0x42')))},'json':!![]};rp(_0x1cd1dc)[_0x3e87('0x1f')](function(_0x36a4ec){if(_0x36a4ec[_0x3e87('0x43')]>=0xc8&&_0x36a4ec[_0x3e87('0x43')]<=0xce){if(_0x36a4ec[_0x3e87('0x44')]&&_0x36a4ec[_0x3e87('0x44')][_0x3e87('0x45')]>0x0){var _0x357a8b=_[_0x3e87('0x46')](_0x36a4ec[_0x3e87('0x44')][_0x3e87('0x47')]);var _0x389dee={'messageId':_0x357a8b['message_id']};if(!_0x34e51b[_0x3e87('0x36')]){_0x389dee[_0x3e87('0x37')]=!![];}return _0x1bf2c5[_0x3e87('0x38')](_0x389dee);}else{logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e87('0x23'),'clickSend',util['inspect'](_0x36a4ec,{'showHidden':![],'depth':null}));}}else{logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x48'),util[_0x3e87('0x24')](_0x36a4ec,{'showHidden':![],'depth':null}));}})[_0x3e87('0x21')](function(_0x524a0d){logger[_0x3e87('0x14')](_0x3e87('0x22'),'afterCreate',_0x3e87('0x48'),util[_0x3e87('0x24')](_0x524a0d,{'showHidden':![],'depth':null}));});}else{logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),'clickSend',_0x3e87('0x49'));}break;case _0x3e87('0x4a'):if(_0x34e51b['authId']&&_0x34e51b[_0x3e87('0x19')]){var _0x29dfba={'dst':_0x4efda7['phone'],'text':_0x4efda7['body'],'src':_0x34e51b[_0x3e87('0x3a')]||_0x34e51b['phone'],'url':_0x34e51b['remote']+_0x3e87('0x1d')+_0x4efda7['id']+'/status?token='+_0x34e51b['token']};var _0x832b76=util['format'](_0x3e87('0x4b'),_0x34e51b[_0x3e87('0x4c')],_0x34e51b['authToken']);var _0x1cd1dc={'method':'POST','uri':util[_0x3e87('0x3f')](_0x3e87('0x4d'),_0x34e51b[_0x3e87('0x4c')]),'body':_0x29dfba,'headers':{'Authorization':util['format'](_0x3e87('0x41'),new Buffer(_0x832b76)['toString'](_0x3e87('0x42')))},'json':!![]};rp(_0x1cd1dc)[_0x3e87('0x1f')](function(_0x5dc735){var _0x1a47ca={'messageId':_0x5dc735['message_uuid'][0x0]};return _0x1bf2c5['update'](_0x1a47ca);})['catch'](function(_0x4cb2bc){logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x4a'),util[_0x3e87('0x24')](_0x4cb2bc,{'showHidden':![],'depth':null}));});}else{logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e87('0x23'),_0x3e87('0x4a'),_0x3e87('0x4e'));}break;case _0x3e87('0x4f'):if(_0x34e51b[_0x3e87('0x2c')]&&_0x34e51b[_0x3e87('0x28')]){if(_0x34e51b[_0x3e87('0x50')]){var _0x15f197={'method':_0x3e87('0x31'),'uri':_0x34e51b[_0x3e87('0x50')]+_0x3e87('0x51'),'body':{'username':_0x34e51b['username'],'password':_0x34e51b[_0x3e87('0x28')]},'json':!![]};return rp(_0x15f197)[_0x3e87('0x1f')](function(_0x4baa39){var _0x2556b6={'method':_0x3e87('0x31'),'uri':_0x34e51b[_0x3e87('0x50')]+_0x3e87('0x52'),'body':{'messages':[{'from':_0x34e51b[_0x3e87('0x1c')],'destinations':[{'to':_0x4efda7[_0x3e87('0x1c')]}],'text':_0x4efda7[_0x3e87('0xa')],'notifyUrl':_0x34e51b[_0x3e87('0x53')]+'/api/sms/messages/'+_0x4efda7['id']+_0x3e87('0x1e')+_0x34e51b['token'],'notifyContentType':_0x3e87('0x54'),'callbackData':_0x34e51b[_0x3e87('0x1c')]+';'+_0x4efda7[_0x3e87('0xa')]}]},'headers':{'Authorization':_0x3e87('0x55')+_0x4baa39[_0x3e87('0x56')]},'json':!![]};return rp(_0x2556b6)['then'](function(_0x4fa01c){if(_0x4fa01c[_0x3e87('0x47')]){var _0x56dd9d={'messageId':_0x4fa01c[_0x3e87('0x47')][0x0]['messageId']};if(!_0x34e51b[_0x3e87('0x36')]){_0x56dd9d['read']=!![];}return _0x1bf2c5[_0x3e87('0x38')](_0x56dd9d);}else{return logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x4f'),util[_0x3e87('0x24')](_0x4fa01c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x313bea){return logger['error'](_0x3e87('0x22'),'afterCreate',_0x3e87('0x4f'),util[_0x3e87('0x24')](_0x313bea,{'showHidden':![],'depth':null}));});}else{logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x4f'),_0x3e87('0x57'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e87('0x23'),_0x3e87('0x4f'),_0x3e87('0x49'));}break;case'csc':var _0x1fd1bd=require(_0x3e87('0x58'));if(_0x34e51b['apiKey']){var _0x2db9f8={};_0x2db9f8[_0x3e87('0x59')]=_0x34e51b[_0x3e87('0x2c')];_0x2db9f8[_0x3e87('0x1c')]=_0x4efda7[_0x3e87('0x1c')];_0x2db9f8[_0x3e87('0x2a')]=_0x34e51b[_0x3e87('0x1c')];_0x2db9f8[_0x3e87('0x5a')]=_0x4efda7['body'];_0x2db9f8[_0x3e87('0x5b')]=+new Date();var _0x5ec02d='';var _0x3b625d='';var _0x211982=Object[_0x3e87('0x5c')](_0x2db9f8);_0x211982['sort']();for(var _0x5b5961=0x0;_0x5b5961<_0x211982[_0x3e87('0x5d')];_0x5b5961++){if(_0x5ec02d!=''){_0x5ec02d+='&';}_0x5ec02d+=_0x211982[_0x5b5961]+'='+encodeURIComponent(_0x2db9f8[_0x211982[_0x5b5961]]);_0x3b625d+=_0x2db9f8[_0x211982[_0x5b5961]];}_0x3b625d+=_0x34e51b[_0x3e87('0x5e')];_0x3b625d=_0x1fd1bd[_0x3e87('0x5f')](_0x3e87('0x60'))[_0x3e87('0x38')](_0x3b625d)[_0x3e87('0x61')](_0x3e87('0x62'));if(_0x5ec02d!==''){_0x5ec02d+='&';}_0x5ec02d+=_0x3e87('0x63')+_0x3b625d;var _0x1552f9={'method':_0x3e87('0x2e'),'uri':_0x34e51b['baseUrl']+'/external/get/send.php?'+_0x5ec02d,'json':!![]};return rp(_0x1552f9)[_0x3e87('0x1f')](function(_0x1afa54){var _0x18815e=Object[_0x3e87('0x5c')](_0x1afa54);if(_0x1afa54[_0x18815e[0x0]][_0x3e87('0x14')]&&parseInt(_0x1afa54[_0x18815e[0x0]][_0x3e87('0x14')])===0x0){var _0x1a2e7f={'messageId':_0x1afa54[_0x18815e[0x0]][_0x3e87('0x64')]};if(!_0x34e51b[_0x3e87('0x36')]){_0x1a2e7f['read']=!![];}return _0x1bf2c5['update'](_0x1a2e7f);}else{return logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),'csc',util[_0x3e87('0x24')](_0x1afa54[_0x3e87('0x14')],{'showHidden':![],'depth':null}));}})[_0x3e87('0x21')](function(_0x5aa0ba){return logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e87('0x23'),_0x3e87('0x65'),util[_0x3e87('0x24')](_0x5aa0ba,{'showHidden':![],'depth':null}));});}else{logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0x3e87('0x66'):if(_0x34e51b[_0x3e87('0x5e')]){var _0x22becd={'method':'POST','uri':_0x3e87('0x67'),'headers':{'Authorization':_0x34e51b[_0x3e87('0x5e')]},'body':{'content':_0x4efda7[_0x3e87('0xa')],'to':[_0x4efda7[_0x3e87('0x1c')]],'from':_0x34e51b[_0x3e87('0x1c')],'binary':![],'clientMessageId':_0x3e87('0x68'),'charset':_0x3e87('0x69')},'json':!![]};rp(_0x22becd)['then'](function(_0x49a18d){if(!_0x49a18d[_0x3e87('0x14')]){var _0x56791e={'messageId':_0x49a18d['messages'][0x0][_0x3e87('0x6a')]};if(!_0x34e51b['deliveryReport']){_0x56791e[_0x3e87('0x37')]=!![];}return _0x1bf2c5[_0x3e87('0x38')](_0x56791e);}else{return logger[_0x3e87('0x14')](_0x3e87('0x22'),'afterCreate','clickatell',util['inspect'](_0x49a18d[_0x3e87('0x14')],{'showHidden':![],'depth':null}));}})[_0x3e87('0x21')](function(_0x3876f2){return logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x66'),util[_0x3e87('0x24')](_0x3876f2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3e87('0x22'),'afterCreate','clickatell',_0x3e87('0x6b'));}break;case'bandwidth':if(_0x34e51b[_0x3e87('0x2c')]&&_0x34e51b['password']){var _0x832b76=util[_0x3e87('0x3f')]('%s:%s',_0x34e51b[_0x3e87('0x2c')],_0x34e51b[_0x3e87('0x28')]);var _0x1cd1dc={'method':_0x3e87('0x31'),'uri':_0x3e87('0x6c')+_0x34e51b[_0x3e87('0x6d')]+'/messages','body':{'to':[_0x4efda7[_0x3e87('0x1c')]],'text':_0x4efda7[_0x3e87('0xa')],'from':_0x34e51b['phone'],'applicationId':_0x34e51b[_0x3e87('0x6e')]},'headers':{'Authorization':util['format'](_0x3e87('0x41'),new Buffer(_0x832b76)[_0x3e87('0x6f')](_0x3e87('0x42')))},'json':!![]};rp(_0x1cd1dc)[_0x3e87('0x1f')](function(_0x159fe2){if(_0x159fe2['id']){var _0x33c8ca={'messageId':_0x159fe2['id']};return _0x1bf2c5['update'](_0x33c8ca);}else{logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x70'),util['inspect'](_0x159fe2,{'showHidden':![],'depth':null}));}})[_0x3e87('0x21')](function(_0x23d948){logger[_0x3e87('0x14')](_0x3e87('0x22'),_0x3e87('0x23'),_0x3e87('0x70'),util[_0x3e87('0x24')](_0x23d948,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3e87('0x70'),_0x3e87('0x49'));}break;case _0x3e87('0x71'):if(_0x34e51b[_0x3e87('0x5e')]){var _0x391af2={};var _0x1552f9={'method':_0x3e87('0x31'),'uri':_0x3e87('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x34e51b[_0x3e87('0x5e')],'Content-Type':_0x3e87('0x54')},'body':{'from':_0x34e51b[_0x3e87('0x1c')],'to':_0x4efda7[_0x3e87('0x1c')],'text':_0x4efda7[_0x3e87('0xa')]},'json':!![]};return rp(_0x1552f9)['then'](function(_0x5331bd){if(_0x5331bd[_0x3e87('0x73')]==0xca){_0x391af2['message']=_0x5331bd;var _0x438db1={'method':_0x3e87('0x31'),'uri':_0x3e87('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x34e51b[_0x3e87('0x5e')],'Content-Type':_0x3e87('0x54')},'body':{'refid':_0x391af2[_0x3e87('0x75')][_0x3e87('0x76')]},'json':!![]};return rp(_0x438db1)[_0x3e87('0x1f')](function(_0x29332d){_0x391af2['status']=_0x29332d;var _0xe03f33={'messageId':_0x391af2['message'][_0x3e87('0x76')],'read':!![]};return _0x1bf2c5[_0x3e87('0x38')](_0xe03f33);});}else{return logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3e87('0x71'),util[_0x3e87('0x24')](_0x5331bd,{'showHidden':![],'depth':null}));}})[_0x3e87('0x21')](function(_0x42149a){return logger[_0x3e87('0x14')](_0x3e87('0x22'),'afterCreate','intelepeer',util[_0x3e87('0x24')](_0x42149a,{'showHidden':![],'depth':null}));});}else{return logger[_0x3e87('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e87('0x23'),_0x3e87('0x71'),_0x3e87('0x77'));}break;}}})[_0x3e87('0x78')](function(){_0x3eb3b7();});}else{_0x3eb3b7();}}},'charset':'utf8mb4','collate':_0x3e87('0x79')});}; \ No newline at end of file +var _0x9781=['accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','findOne','then','createdAt','catch','error','out','SmsAccount','find','twilio','accountSid','authToken','phone','messages','create','remote','token','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','body','smsMethod','sender','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','afterCreate','https://smsapi.connectel.se/api/v2/send/','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/api/sms/messages/','/status?token=','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','md5','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/'];(function(_0xb5cae9,_0x2d4da9){var _0x2f61b8=function(_0x483a2d){while(--_0x483a2d){_0xb5cae9['push'](_0xb5cae9['shift']());}};_0x2f61b8(++_0x2d4da9);}(_0x9781,0x101));var _0x1978=function(_0x2534cf,_0x545be6){_0x2534cf=_0x2534cf-0x0;var _0x221461=_0x9781[_0x2534cf];return _0x221461;};'use strict';var _=require(_0x1978('0x0'));var util=require(_0x1978('0x1'));var logger=require(_0x1978('0x2'))('api');var moment=require(_0x1978('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1978('0x4'));var config=require(_0x1978('0x5'));var attributes=require(_0x1978('0x6'));module[_0x1978('0x7')]=function(_0x4afc4a,_0x50a433){return _0x4afc4a[_0x1978('0x8')]('SmsMessage',attributes,{'tableName':_0x1978('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1978('0xa')]},{'name':_0x1978('0xb'),'fields':['body'],'type':_0x1978('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dee1b,_0x3e70f9,_0xdb5b0b){var _0x5a3db8=_0x4afc4a[_0x1978('0xd')];var _0x2a3fa=_0x5dee1b['get']({'plain':!![]});if(_0x2a3fa[_0x1978('0xe')]['toLowerCase']()==='in'||_0x2a3fa[_0x1978('0xe')][_0x1978('0xf')]()==='out'&&!_0x2a3fa[_0x1978('0x10')]&&!_[_0x1978('0x11')](_0x2a3fa[_0x1978('0x12')])&&!_[_0x1978('0x11')](_0x2a3fa[_0x1978('0x13')])){_0x5a3db8['SmsInteraction'][_0x1978('0x14')]({'where':{'id':_0x2a3fa[_0x1978('0x13')]}})[_0x1978('0x15')](function(_0x53078c){if(_0x53078c){_0x53078c['update']({'lastMsgAt':_0x2a3fa[_0x1978('0x16')],'lastMsgDirection':_0x2a3fa[_0x1978('0xe')][_0x1978('0xf')]()});}})[_0x1978('0x17')](function(_0x10d364){console[_0x1978('0x18')](_0x10d364);});}if(_0x2a3fa['direction']===_0x1978('0x19')&&!_0x2a3fa['secret']){var _0xc3b8a7;_0x5a3db8[_0x1978('0x1a')][_0x1978('0x1b')]({'where':{'id':_0x2a3fa['SmsAccountId']},'raw':!![]})[_0x1978('0x15')](function(_0x2906ec){_0xc3b8a7=_0x2906ec;if(_0xc3b8a7&&_0xc3b8a7['type']){switch(_0xc3b8a7['type']){case _0x1978('0x1c'):var _0x67d384=require(_0x1978('0x1c'));if(_0xc3b8a7[_0x1978('0x1d')]&&_0xc3b8a7[_0x1978('0x1e')]&&_0xc3b8a7[_0x1978('0x1f')]){var _0x134ac0=new _0x67d384(_0xc3b8a7['accountSid'],_0xc3b8a7[_0x1978('0x1e')]);_0x134ac0[_0x1978('0x20')][_0x1978('0x21')]({'body':_0x2a3fa['body'],'to':_0x2a3fa[_0x1978('0x1f')],'from':_0xc3b8a7[_0x1978('0x1f')],'statusCallback':_0xc3b8a7[_0x1978('0x22')]+'/api/sms/messages/'+_0x2a3fa['id']+'/status?token='+_0xc3b8a7[_0x1978('0x23')]})[_0x1978('0x15')](function(_0x27a55a){if(_0x27a55a['sid']){return _0x5dee1b[_0x1978('0x24')]({'messageId':_0x27a55a['sid']});}})[_0x1978('0x17')](function(_0x4b4565){logger[_0x1978('0x18')](_0x1978('0x25'),'afterCreate',_0x1978('0x1c'),util[_0x1978('0x26')](_0x4b4565,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1978('0x1c'),_0x1978('0x27'));}break;case _0x1978('0x28'):var _0x143760=_0x1978('0x29');if(_0xc3b8a7[_0x1978('0x2a')]&&_0xc3b8a7[_0x1978('0x2b')]){var _0x4738b3={'recipient':[_0x2a3fa[_0x1978('0x1f')]],'message':_0x2a3fa[_0x1978('0x2c')],'message_type':_0xc3b8a7[_0x1978('0x2d')]};if(_0xc3b8a7[_0x1978('0x2d')]&&_0xc3b8a7['smsMethod']!=='SI'){_0x4738b3[_0x1978('0x2e')]=_0xc3b8a7[_0x1978('0x1f')];}var _0x3bbe0e={'url':_0x143760+_0x1978('0x2f')+_0xc3b8a7['username']+_0x1978('0x30')+_0xc3b8a7[_0x1978('0x2b')],'method':_0x1978('0x31')};rp(_0x3bbe0e)[_0x1978('0x15')](function(_0x2efc10){var _0x18021c=_0x2efc10['split'](';');var _0x45569e={'user_key':_0x18021c[0x0],'session_key':_0x18021c[0x1]};_0x3bbe0e={'url':_0x143760+_0x1978('0x32'),'method':_0x1978('0x33'),'headers':{'user_key':_0x45569e[_0x1978('0x34')],'Session_key':_0x45569e[_0x1978('0x35')]},'json':!![],'body':_0x4738b3};return rp(_0x3bbe0e);})[_0x1978('0x15')](function(_0x12d74d){if(_0x12d74d[_0x1978('0x36')]>=0x1){var _0x34b669={'messageId':_0x12d74d[_0x1978('0x37')]};if(_0xc3b8a7[_0x1978('0x2d')]!=='GP'||!_0xc3b8a7[_0x1978('0x38')]){_0x34b669[_0x1978('0x39')]=!![];}return _0x5dee1b[_0x1978('0x24')](_0x34b669);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1978('0x3a'),_0x1978('0x28'),util[_0x1978('0x26')](_0x12d74d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x359f8e){return logger['error'](_0x1978('0x25'),'afterCreate',_0x1978('0x28'),util[_0x1978('0x26')](_0x359f8e,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')](_0x1978('0x25'),'afterCreate','skebby','Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0xc3b8a7[_0x1978('0x1e')]){var _0x2fcbc9={'recipient':_0x2a3fa['phone'],'message':_0x2a3fa['body'],'sender':_0xc3b8a7['senderString']||_0xc3b8a7['phone'],'authorization':_0xc3b8a7[_0x1978('0x1e')]};var _0x3e70f9={'method':_0x1978('0x33'),'uri':_0x1978('0x3b'),'body':_0x2fcbc9,'json':!![]};rp(_0x3e70f9)['then'](function(_0x2620e7){var _0x10ee12={'messageId':_0x2620e7['requestid']};if(!_0xc3b8a7['deliveryReport']){_0x10ee12[_0x1978('0x39')]=!![];}return _0x5dee1b[_0x1978('0x24')](_0x10ee12);})[_0x1978('0x17')](function(_0xa9e80f){logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x3c'),util[_0x1978('0x26')](_0xa9e80f,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1978('0x3c'),_0x1978('0x3d'));}break;case _0x1978('0x3e'):if(_0xc3b8a7[_0x1978('0x2a')]&&_0xc3b8a7[_0x1978('0x2b')]){var _0x2fcbc9={'messages':[{'source':_0x1978('0x3f'),'to':_0x2a3fa[_0x1978('0x1f')],'body':_0x2a3fa['body'],'from':_0xc3b8a7[_0x1978('0x40')]||_0xc3b8a7['phone']}]};var _0x1b4ff4=util[_0x1978('0x41')](_0x1978('0x42'),_0xc3b8a7[_0x1978('0x2a')],_0xc3b8a7[_0x1978('0x2b')]);var _0x3e70f9={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2fcbc9,'headers':{'Authorization':util[_0x1978('0x41')](_0x1978('0x43'),new Buffer(_0x1b4ff4)[_0x1978('0x44')](_0x1978('0x45')))},'json':!![]};rp(_0x3e70f9)['then'](function(_0x196a6a){if(_0x196a6a[_0x1978('0x46')]>=0xc8&&_0x196a6a[_0x1978('0x46')]<=0xce){if(_0x196a6a[_0x1978('0x47')]&&_0x196a6a[_0x1978('0x47')]['queued_count']>0x0){var _0x76aad0=_[_0x1978('0x48')](_0x196a6a[_0x1978('0x47')][_0x1978('0x20')]);var _0x2c910b={'messageId':_0x76aad0[_0x1978('0x49')]};if(!_0xc3b8a7[_0x1978('0x38')]){_0x2c910b[_0x1978('0x39')]=!![];}return _0x5dee1b[_0x1978('0x24')](_0x2c910b);}else{logger[_0x1978('0x18')](_0x1978('0x25'),'afterCreate',_0x1978('0x4a'),util[_0x1978('0x26')](_0x196a6a,{'showHidden':![],'depth':null}));}}else{logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1978('0x4a'),util['inspect'](_0x196a6a,{'showHidden':![],'depth':null}));}})[_0x1978('0x17')](function(_0x4e8ec9){logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x4a'),util[_0x1978('0x26')](_0x4e8ec9,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x4a'),_0x1978('0x4b'));}break;case _0x1978('0x4c'):if(_0xc3b8a7[_0x1978('0x4d')]&&_0xc3b8a7[_0x1978('0x1e')]){var _0x2fcbc9={'dst':_0x2a3fa[_0x1978('0x1f')],'text':_0x2a3fa['body'],'src':_0xc3b8a7[_0x1978('0x40')]||_0xc3b8a7[_0x1978('0x1f')],'url':_0xc3b8a7['remote']+_0x1978('0x4e')+_0x2a3fa['id']+_0x1978('0x4f')+_0xc3b8a7[_0x1978('0x23')]};var _0x1b4ff4=util[_0x1978('0x41')](_0x1978('0x42'),_0xc3b8a7[_0x1978('0x4d')],_0xc3b8a7[_0x1978('0x1e')]);var _0x3e70f9={'method':_0x1978('0x33'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0xc3b8a7[_0x1978('0x4d')]),'body':_0x2fcbc9,'headers':{'Authorization':util[_0x1978('0x41')](_0x1978('0x43'),new Buffer(_0x1b4ff4)[_0x1978('0x44')](_0x1978('0x45')))},'json':!![]};rp(_0x3e70f9)[_0x1978('0x15')](function(_0x2aea74){var _0x1c573c={'messageId':_0x2aea74[_0x1978('0x50')][0x0]};return _0x5dee1b[_0x1978('0x24')](_0x1c573c);})[_0x1978('0x17')](function(_0x316210){logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1978('0x4c'),util[_0x1978('0x26')](_0x316210,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1978('0x3a'),'plivo',_0x1978('0x51'));}break;case _0x1978('0x52'):if(_0xc3b8a7[_0x1978('0x2a')]&&_0xc3b8a7['password']){if(_0xc3b8a7['baseUrl']){var _0xe5425f={'method':_0x1978('0x33'),'uri':_0xc3b8a7['baseUrl']+'/auth/1/session','body':{'username':_0xc3b8a7['username'],'password':_0xc3b8a7['password']},'json':!![]};return rp(_0xe5425f)[_0x1978('0x15')](function(_0x3e07db){var _0x12fd09={'method':'POST','uri':_0xc3b8a7[_0x1978('0x53')]+_0x1978('0x54'),'body':{'messages':[{'from':_0xc3b8a7[_0x1978('0x1f')],'destinations':[{'to':_0x2a3fa['phone']}],'text':_0x2a3fa[_0x1978('0x2c')],'notifyUrl':_0xc3b8a7[_0x1978('0x22')]+_0x1978('0x4e')+_0x2a3fa['id']+'/status?token='+_0xc3b8a7[_0x1978('0x23')],'notifyContentType':_0x1978('0x55'),'callbackData':_0xc3b8a7[_0x1978('0x1f')]+';'+_0x2a3fa[_0x1978('0x2c')]}]},'headers':{'Authorization':_0x1978('0x56')+_0x3e07db[_0x1978('0x23')]},'json':!![]};return rp(_0x12fd09)[_0x1978('0x15')](function(_0xe65b06){if(_0xe65b06[_0x1978('0x20')]){var _0x5c96e0={'messageId':_0xe65b06[_0x1978('0x20')][0x0]['messageId']};if(!_0xc3b8a7[_0x1978('0x38')]){_0x5c96e0['read']=!![];}return _0x5dee1b[_0x1978('0x24')](_0x5c96e0);}else{return logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x52'),util[_0x1978('0x26')](_0xe65b06,{'showHidden':![],'depth':null}));}});})[_0x1978('0x17')](function(_0xdbc31a){return logger[_0x1978('0x18')](_0x1978('0x25'),'afterCreate',_0x1978('0x52'),util[_0x1978('0x26')](_0xdbc31a,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x52'),_0x1978('0x57'));}}else{logger['error'](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1978('0x58'):var _0x2baffc=require(_0x1978('0x59'));if(_0xc3b8a7[_0x1978('0x5a')]){var _0x38d746={};_0x38d746['login']=_0xc3b8a7[_0x1978('0x2a')];_0x38d746[_0x1978('0x1f')]=_0x2a3fa['phone'];_0x38d746[_0x1978('0x2e')]=_0xc3b8a7[_0x1978('0x1f')];_0x38d746[_0x1978('0x5b')]=_0x2a3fa[_0x1978('0x2c')];_0x38d746[_0x1978('0x5c')]=+new Date();var _0x4a63e1='';var _0x4f959f='';var _0xdf2873=Object[_0x1978('0x5d')](_0x38d746);_0xdf2873[_0x1978('0x5e')]();for(var _0x2332ec=0x0;_0x2332ec<_0xdf2873[_0x1978('0x5f')];_0x2332ec++){if(_0x4a63e1!=''){_0x4a63e1+='&';}_0x4a63e1+=_0xdf2873[_0x2332ec]+'='+encodeURIComponent(_0x38d746[_0xdf2873[_0x2332ec]]);_0x4f959f+=_0x38d746[_0xdf2873[_0x2332ec]];}_0x4f959f+=_0xc3b8a7[_0x1978('0x5a')];_0x4f959f=_0x2baffc[_0x1978('0x60')](_0x1978('0x61'))[_0x1978('0x24')](_0x4f959f)['digest'](_0x1978('0x62'));if(_0x4a63e1!==''){_0x4a63e1+='&';}_0x4a63e1+='signature='+_0x4f959f;var _0x3bbe0e={'method':_0x1978('0x31'),'uri':_0xc3b8a7[_0x1978('0x53')]+_0x1978('0x63')+_0x4a63e1,'json':!![]};return rp(_0x3bbe0e)[_0x1978('0x15')](function(_0x59feac){var _0x3cd911=Object['keys'](_0x59feac);if(_0x59feac[_0x3cd911[0x0]][_0x1978('0x18')]&&parseInt(_0x59feac[_0x3cd911[0x0]][_0x1978('0x18')])===0x0){var _0x2d53f7={'messageId':_0x59feac[_0x3cd911[0x0]][_0x1978('0x64')]};if(!_0xc3b8a7[_0x1978('0x38')]){_0x2d53f7[_0x1978('0x39')]=!![];}return _0x5dee1b[_0x1978('0x24')](_0x2d53f7);}else{return logger[_0x1978('0x18')](_0x1978('0x25'),'afterCreate','csc',util[_0x1978('0x26')](_0x59feac[_0x1978('0x18')],{'showHidden':![],'depth':null}));}})[_0x1978('0x17')](function(_0x2e9df1){return logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1978('0x3a'),_0x1978('0x58'),util[_0x1978('0x26')](_0x2e9df1,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x58'),_0x1978('0x65'));}break;case _0x1978('0x66'):if(_0xc3b8a7['apiKey']){var _0x2dbf7f={'method':_0x1978('0x33'),'uri':_0x1978('0x67'),'headers':{'Authorization':_0xc3b8a7[_0x1978('0x5a')]},'body':{'content':_0x2a3fa[_0x1978('0x2c')],'to':[_0x2a3fa[_0x1978('0x1f')]],'from':_0xc3b8a7[_0x1978('0x1f')],'binary':![],'clientMessageId':_0x1978('0x68'),'charset':_0x1978('0x69')},'json':!![]};rp(_0x2dbf7f)[_0x1978('0x15')](function(_0x485c63){if(!_0x485c63[_0x1978('0x18')]){var _0x8da863={'messageId':_0x485c63[_0x1978('0x20')][0x0][_0x1978('0x6a')]};if(!_0xc3b8a7[_0x1978('0x38')]){_0x8da863[_0x1978('0x39')]=!![];}return _0x5dee1b['update'](_0x8da863);}else{return logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x66'),util[_0x1978('0x26')](_0x485c63[_0x1978('0x18')],{'showHidden':![],'depth':null}));}})[_0x1978('0x17')](function(_0x2168a6){return logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x66'),util[_0x1978('0x26')](_0x2168a6,{'showHidden':![],'depth':null}));});}else{logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1978('0x66'),_0x1978('0x65'));}break;case _0x1978('0x6b'):if(_0xc3b8a7[_0x1978('0x2a')]&&_0xc3b8a7[_0x1978('0x2b')]){var _0x1b4ff4=util[_0x1978('0x41')](_0x1978('0x42'),_0xc3b8a7[_0x1978('0x2a')],_0xc3b8a7[_0x1978('0x2b')]);var _0x3e70f9={'method':_0x1978('0x33'),'uri':_0x1978('0x6c')+_0xc3b8a7[_0x1978('0x6d')]+_0x1978('0x6e'),'body':{'to':[_0x2a3fa[_0x1978('0x1f')]],'text':_0x2a3fa[_0x1978('0x2c')],'from':_0xc3b8a7[_0x1978('0x1f')],'applicationId':_0xc3b8a7[_0x1978('0x6f')]},'headers':{'Authorization':util['format'](_0x1978('0x43'),new Buffer(_0x1b4ff4)[_0x1978('0x44')](_0x1978('0x45')))},'json':!![]};rp(_0x3e70f9)[_0x1978('0x15')](function(_0x123a87){if(_0x123a87['id']){var _0x49ba6e={'messageId':_0x123a87['id']};return _0x5dee1b['update'](_0x49ba6e);}else{logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1978('0x3a'),_0x1978('0x6b'),util[_0x1978('0x26')](_0x123a87,{'showHidden':![],'depth':null}));}})[_0x1978('0x17')](function(_0x1c7443){logger[_0x1978('0x18')](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x6b'),util[_0x1978('0x26')](_0x1c7443,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1978('0x25'),_0x1978('0x3a'),'bandwidth',_0x1978('0x4b'));}break;case _0x1978('0x70'):if(_0xc3b8a7[_0x1978('0x5a')]){var _0x3e565c={};var _0x3bbe0e={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x1978('0x71')+_0xc3b8a7[_0x1978('0x5a')],'Content-Type':_0x1978('0x55')},'body':{'from':_0xc3b8a7[_0x1978('0x1f')],'to':_0x2a3fa[_0x1978('0x1f')],'text':_0x2a3fa['body']},'json':!![]};return rp(_0x3bbe0e)[_0x1978('0x15')](function(_0xfaabee){if(_0xfaabee[_0x1978('0x72')]==0xca){_0x3e565c[_0x1978('0x73')]=_0xfaabee;var _0x153b05={'method':_0x1978('0x33'),'uri':_0x1978('0x74'),'headers':{'Authorization':'Bearer\x20'+_0xc3b8a7['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x3e565c[_0x1978('0x73')]['refid']},'json':!![]};return rp(_0x153b05)[_0x1978('0x15')](function(_0x268296){_0x3e565c[_0x1978('0x75')]=_0x268296;var _0x57816c={'messageId':_0x3e565c[_0x1978('0x73')][_0x1978('0x76')],'read':!![]};return _0x5dee1b['update'](_0x57816c);});}else{return logger[_0x1978('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1978('0x3a'),_0x1978('0x70'),util[_0x1978('0x26')](_0xfaabee,{'showHidden':![],'depth':null}));}})[_0x1978('0x17')](function(_0x5493ae){return logger['error'](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x70'),util[_0x1978('0x26')](_0x5493ae,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x1978('0x25'),_0x1978('0x3a'),_0x1978('0x70'),_0x1978('0x77'));}break;}}})[_0x1978('0x78')](function(){_0xdb5b0b();});}else{_0xdb5b0b();}}},'charset':_0x1978('0x79'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 31eeadf..df2a61b 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 _0x28ba=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsMessage','create','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','ioredis'];(function(_0x303862,_0x20b5ab){var _0xe6f228=function(_0x41fc5a){while(--_0x41fc5a){_0x303862['push'](_0x303862['shift']());}};_0xe6f228(++_0x20b5ab);}(_0x28ba,0xbb));var _0xa28b=function(_0x39feb6,_0x5db8da){_0x39feb6=_0x39feb6-0x0;var _0x1b3b7b=_0x28ba[_0x39feb6];return _0x1b3b7b;};'use strict';var _=require(_0xa28b('0x0'));var util=require(_0xa28b('0x1'));var moment=require(_0xa28b('0x2'));var BPromise=require(_0xa28b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa28b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa28b('0x5'))(_0xa28b('0x6'));var config=require(_0xa28b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa28b('0x8')][_0xa28b('0x9')]({'port':0x232a});config[_0xa28b('0xa')]=_['defaults'](config[_0xa28b('0xa')],{'host':_0xa28b('0xb'),'port':0x18eb});var socket=require(_0xa28b('0xc'))(new Redis(config[_0xa28b('0xa')]));require(_0xa28b('0xd'))['register'](socket);function respondWithRpcPromise(_0x3de89c,_0x43cf44,_0x3b843e){return new BPromise(function(_0x1d259d,_0x208e45){return client[_0xa28b('0xe')](_0x3de89c,_0x3b843e)[_0xa28b('0xf')](function(_0x3e49e7){logger[_0xa28b('0x10')](_0xa28b('0x11'),_0x43cf44,_0xa28b('0x12'));logger[_0xa28b('0x13')](_0xa28b('0x14'),_0x43cf44,'request\x20sent',JSON[_0xa28b('0x15')](_0x3e49e7));if(_0x3e49e7['error']){if(_0x3e49e7[_0xa28b('0x16')][_0xa28b('0x17')]===0x1f4){logger[_0xa28b('0x16')](_0xa28b('0x11'),_0x43cf44,_0x3e49e7['error'][_0xa28b('0x18')]);return _0x208e45(_0x3e49e7['error'][_0xa28b('0x18')]);}logger[_0xa28b('0x16')](_0xa28b('0x11'),_0x43cf44,_0x3e49e7['error'][_0xa28b('0x18')]);return _0x1d259d(_0x3e49e7[_0xa28b('0x16')]['message']);}else{logger[_0xa28b('0x10')](_0xa28b('0x11'),_0x43cf44,_0xa28b('0x12'));_0x1d259d(_0x3e49e7[_0xa28b('0x19')][_0xa28b('0x18')]);}})[_0xa28b('0x1a')](function(_0x1d5671){logger['error'](_0xa28b('0x11'),_0x43cf44,_0x1d5671);_0x208e45(_0x1d5671);});});}exports['CreateSmsMessage']=function(_0x29ed26){var _0x29a0d3=this;return new Promise(function(_0x1468f2,_0xdf05b4){return db[_0xa28b('0x1b')][_0xa28b('0x1c')](_0x29ed26['body'],{'raw':_0x29ed26[_0xa28b('0x1d')]?_0x29ed26['options'][_0xa28b('0x1e')]===undefined?!![]:![]:!![]})[_0xa28b('0xf')](function(_0x1aa7d5){logger[_0xa28b('0x10')](_0xa28b('0x1f'),_0x29ed26);logger['debug'](_0xa28b('0x1f'),_0x29ed26,JSON[_0xa28b('0x15')](_0x1aa7d5));_0x1468f2(_0x1aa7d5);})[_0xa28b('0x1a')](function(_0x2b9404){logger[_0xa28b('0x16')]('CreateSmsMessage',_0x2b9404[_0xa28b('0x18')],_0x29ed26);_0xdf05b4(_0x29a0d3[_0xa28b('0x16')](0x1f4,_0x2b9404[_0xa28b('0x18')]));});});}; \ No newline at end of file +var _0xff09=['rpc','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsMessage','SmsMessage','create','body','options','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e1fb8,_0x1f2a12){var _0x52780b=function(_0x3c0855){while(--_0x3c0855){_0x1e1fb8['push'](_0x1e1fb8['shift']());}};_0x52780b(++_0x1f2a12);}(_0xff09,0x180));var _0x9ff0=function(_0xc5c9e6,_0x36adb4){_0xc5c9e6=_0xc5c9e6-0x0;var _0x57e3cb=_0xff09[_0xc5c9e6];return _0x57e3cb;};'use strict';var _=require('lodash');var util=require(_0x9ff0('0x0'));var moment=require(_0x9ff0('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ff0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ff0('0x3'))['db'];var utils=require(_0x9ff0('0x4'));var logger=require(_0x9ff0('0x5'))(_0x9ff0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9ff0('0x7')]({'port':0x232a});config[_0x9ff0('0x8')]=_[_0x9ff0('0x9')](config['redis'],{'host':_0x9ff0('0xa'),'port':0x18eb});var socket=require(_0x9ff0('0xb'))(new Redis(config[_0x9ff0('0x8')]));require(_0x9ff0('0xc'))[_0x9ff0('0xd')](socket);function respondWithRpcPromise(_0x37a63d,_0x5dd949,_0xe8a746){return new BPromise(function(_0x555893,_0x16dddb){return client[_0x9ff0('0xe')](_0x37a63d,_0xe8a746)[_0x9ff0('0xf')](function(_0x525951){logger[_0x9ff0('0x10')](_0x9ff0('0x11'),_0x5dd949,_0x9ff0('0x12'));logger[_0x9ff0('0x13')](_0x9ff0('0x14'),_0x5dd949,_0x9ff0('0x12'),JSON[_0x9ff0('0x15')](_0x525951));if(_0x525951[_0x9ff0('0x16')]){if(_0x525951[_0x9ff0('0x16')][_0x9ff0('0x17')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x5dd949,_0x525951[_0x9ff0('0x16')]['message']);return _0x16dddb(_0x525951[_0x9ff0('0x16')][_0x9ff0('0x18')]);}logger[_0x9ff0('0x16')](_0x9ff0('0x11'),_0x5dd949,_0x525951[_0x9ff0('0x16')][_0x9ff0('0x18')]);return _0x555893(_0x525951[_0x9ff0('0x16')][_0x9ff0('0x18')]);}else{logger[_0x9ff0('0x10')](_0x9ff0('0x11'),_0x5dd949,'request\x20sent');_0x555893(_0x525951['result'][_0x9ff0('0x18')]);}})['catch'](function(_0x386dc5){logger[_0x9ff0('0x16')]('SmsMessage,\x20%s,\x20%s',_0x5dd949,_0x386dc5);_0x16dddb(_0x386dc5);});});}exports[_0x9ff0('0x19')]=function(_0x310ea8){var _0x22687f=this;return new Promise(function(_0x4e35d4,_0x13d58f){return db[_0x9ff0('0x1a')][_0x9ff0('0x1b')](_0x310ea8[_0x9ff0('0x1c')],{'raw':_0x310ea8['options']?_0x310ea8[_0x9ff0('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xfcf76){logger[_0x9ff0('0x10')]('CreateSmsMessage',_0x310ea8);logger['debug'](_0x9ff0('0x19'),_0x310ea8,JSON[_0x9ff0('0x15')](_0xfcf76));_0x4e35d4(_0xfcf76);})['catch'](function(_0x13fc07){logger[_0x9ff0('0x16')](_0x9ff0('0x19'),_0x13fc07[_0x9ff0('0x18')],_0x310ea8);_0x13d58f(_0x22687f[_0x9ff0('0x16')](0x1f4,_0x13fc07[_0x9ff0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 0d11188..ff54756 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 _0x5aa0=['emit','removeListener','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x5aa0,0x10d));var _0x05aa=function(_0x5ca850,_0x18b7d7){_0x5ca850=_0x5ca850-0x0;var _0x5c50fa=_0x5aa0[_0x5ca850];return _0x5c50fa;};'use strict';var SmsMessageEvents=require(_0x05aa('0x0'));var events=[_0x05aa('0x1'),_0x05aa('0x2'),_0x05aa('0x3')];function createListener(_0x3b8485,_0x2d836d){return function(_0x538161){_0x2d836d[_0x05aa('0x4')](_0x3b8485,_0x538161);};}function removeListener(_0x53615f,_0x14fef7){return function(){SmsMessageEvents[_0x05aa('0x5')](_0x53615f,_0x14fef7);};}exports['register']=function(_0x2a3331){for(var _0x386440=0x0,_0x1beaa1=events['length'];_0x386440<_0x1beaa1;_0x386440++){var _0x4f7b1a=events[_0x386440];var _0x19ece9=createListener(_0x05aa('0x6')+_0x4f7b1a,_0x2a3331);SmsMessageEvents['on'](_0x4f7b1a,_0x19ece9);}}; \ No newline at end of file +var _0x4441=['smsMessage:','./smsMessage.events','save','remove','update','emit','register','length'];(function(_0xee5272,_0x370d3a){var _0xa8ae9c=function(_0x241e31){while(--_0x241e31){_0xee5272['push'](_0xee5272['shift']());}};_0xa8ae9c(++_0x370d3a);}(_0x4441,0x129));var _0x1444=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4441[_0xa464c9];return _0x3d73c4;};'use strict';var SmsMessageEvents=require(_0x1444('0x0'));var events=[_0x1444('0x1'),_0x1444('0x2'),_0x1444('0x3')];function createListener(_0x24faa8,_0x274226){return function(_0x466f56){_0x274226[_0x1444('0x4')](_0x24faa8,_0x466f56);};}function removeListener(_0x383cff,_0x1d89b8){return function(){SmsMessageEvents['removeListener'](_0x383cff,_0x1d89b8);};}exports[_0x1444('0x5')]=function(_0x7fb0df){for(var _0x2ddf10=0x0,_0x91683=events[_0x1444('0x6')];_0x2ddf10<_0x91683;_0x2ddf10++){var _0x41948d=events[_0x2ddf10];var _0xbe300=createListener(_0x1444('0x7')+_0x41948d,_0x7fb0df);SmsMessageEvents['on'](_0x41948d,_0xbe300);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 2f3feb2..4e1bc03 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 _0xb40b=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb40b,0x119));var _0xbb40=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xb40b[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xbb40('0x0'));var util=require(_0xbb40('0x1'));var path=require('path');var timeout=require(_0xbb40('0x2'));var express=require(_0xbb40('0x3'));var router=express[_0xbb40('0x4')]();var fs_extra=require(_0xbb40('0x5'));var auth=require(_0xbb40('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xbb40('0x7')]('/',auth[_0xbb40('0x8')](),controller[_0xbb40('0x9')]);router[_0xbb40('0x7')]('/describe',auth[_0xbb40('0x8')](),controller[_0xbb40('0xa')]);router['get'](_0xbb40('0xb'),auth[_0xbb40('0x8')](),controller[_0xbb40('0xc')]);router[_0xbb40('0x7')](_0xbb40('0xd'),auth[_0xbb40('0x8')](),controller[_0xbb40('0xe')]);router[_0xbb40('0x7')]('/:id/teams',auth[_0xbb40('0x8')](),controller[_0xbb40('0xf')]);router[_0xbb40('0x7')](_0xbb40('0x10'),auth[_0xbb40('0x8')](),controller[_0xbb40('0x11')]);router[_0xbb40('0x12')]('/',auth[_0xbb40('0x8')](),controller[_0xbb40('0x13')]);router[_0xbb40('0x12')](_0xbb40('0x14'),auth[_0xbb40('0x8')](),controller[_0xbb40('0x15')]);router[_0xbb40('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xbb40('0x16')]);router[_0xbb40('0x17')](_0xbb40('0xb'),auth[_0xbb40('0x8')](),controller[_0xbb40('0x18')]);router[_0xbb40('0x19')](_0xbb40('0xb'),auth[_0xbb40('0x8')](),controller['destroy']);router[_0xbb40('0x19')](_0xbb40('0x14'),auth[_0xbb40('0x8')](),controller[_0xbb40('0x1a')]);router[_0xbb40('0x19')](_0xbb40('0x10'),auth[_0xbb40('0x8')](),controller['removeAgents']);module[_0xbb40('0x1b')]=router; \ No newline at end of file +var _0xf53c=['getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x141c1a,_0x589007){var _0x1a6cf6=function(_0xb99378){while(--_0xb99378){_0x141c1a['push'](_0x141c1a['shift']());}};_0x1a6cf6(++_0x589007);}(_0xf53c,0x15a));var _0xcf53=function(_0x58f758,_0xfcf852){_0x58f758=_0x58f758-0x0;var _0x18ffcf=_0xf53c[_0x58f758];return _0x18ffcf;};'use strict';var multer=require('multer');var util=require(_0xcf53('0x0'));var path=require(_0xcf53('0x1'));var timeout=require(_0xcf53('0x2'));var express=require(_0xcf53('0x3'));var router=express[_0xcf53('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf53('0x5'));var interaction=require(_0xcf53('0x6'));var config=require(_0xcf53('0x7'));var controller=require(_0xcf53('0x8'));router[_0xcf53('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf53('0xa')]);router[_0xcf53('0x9')]('/describe',auth[_0xcf53('0xb')](),controller[_0xcf53('0xc')]);router[_0xcf53('0x9')](_0xcf53('0xd'),auth[_0xcf53('0xb')](),controller['show']);router[_0xcf53('0x9')]('/:id/members',auth[_0xcf53('0xb')](),controller[_0xcf53('0xe')]);router[_0xcf53('0x9')](_0xcf53('0xf'),auth[_0xcf53('0xb')](),controller[_0xcf53('0x10')]);router[_0xcf53('0x9')](_0xcf53('0x11'),auth[_0xcf53('0xb')](),controller[_0xcf53('0x12')]);router[_0xcf53('0x13')]('/',auth[_0xcf53('0xb')](),controller[_0xcf53('0x14')]);router[_0xcf53('0x13')](_0xcf53('0xf'),auth[_0xcf53('0xb')](),controller[_0xcf53('0x15')]);router[_0xcf53('0x13')](_0xcf53('0x11'),auth[_0xcf53('0xb')](),controller['addAgents']);router[_0xcf53('0x16')]('/:id',auth[_0xcf53('0xb')](),controller[_0xcf53('0x17')]);router[_0xcf53('0x18')](_0xcf53('0xd'),auth['isAuthenticated'](),controller[_0xcf53('0x19')]);router[_0xcf53('0x18')](_0xcf53('0xf'),auth['isAuthenticated'](),controller[_0xcf53('0x1a')]);router['delete'](_0xcf53('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xcf53('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c5e0c34..7152760 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 _0x2060=['exports','name','rrmemory','beepall','roundrobin'];(function(_0x309abd,_0x5e28f9){var _0x20e4c0=function(_0x1bc54b){while(--_0x1bc54b){_0x309abd['push'](_0x309abd['shift']());}};_0x20e4c0(++_0x5e28f9);}(_0x2060,0x163));var _0x0206=function(_0x2e1cbc,_0x823f62){_0x2e1cbc=_0x2e1cbc-0x0;var _0x617514=_0x2060[_0x2e1cbc];return _0x617514;};'use strict';var Sequelize=require('sequelize');module[_0x0206('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0206('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0206('0x2'),_0x0206('0x3'),_0x0206('0x4'))}}; \ No newline at end of file +var _0x52b1=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x300643,_0x1c6157){var _0x228e22=function(_0x48ab3f){while(--_0x48ab3f){_0x300643['push'](_0x300643['shift']());}};_0x228e22(++_0x1c6157);}(_0x52b1,0xd8));var _0x152b=function(_0x3b11a5,_0x3d4621){_0x3b11a5=_0x3b11a5-0x0;var _0x116210=_0x52b1[_0x3b11a5];return _0x116210;};'use strict';var Sequelize=require(_0x152b('0x0'));module[_0x152b('0x1')]={'name':{'type':Sequelize[_0x152b('0x2')],'unique':_0x152b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x152b('0x2')]},'timeout':{'type':Sequelize[_0x152b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x152b('0x5')](_0x152b('0x6'),_0x152b('0x7'),_0x152b('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index f85d354..62527c7 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 _0x2032=['offset','limit','set','Content-Range','json','update','then','get','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','getOptions','where','include','query','rows','show','keys','filters','intersection','attributes','model','fields','options','find','catch','body','user','UserProfileSection','autoAssociation','params','describe','findOne','UserSmsQueue','hasOwnProperty','order','sort','SmsQueueId','filter','merge','findAll','User','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','pick','nolimit','addTeams','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','length','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','transaction','isEmpty','emit','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','count'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x2032,0xd9));var _0x2203=function(_0x35dd50,_0xc7923a){_0x35dd50=_0x35dd50-0x0;var _0x107d33=_0x2032[_0x35dd50];return _0x107d33;};'use strict';var BPromise=require('bluebird');var util=require(_0x2203('0x0'));var _=require(_0x2203('0x1'));var squel=require(_0x2203('0x2'));var Redis=require('ioredis');var qs=require(_0x2203('0x3'));var logger=require(_0x2203('0x4'))('api');var config=require(_0x2203('0x5'));var db=require(_0x2203('0x6'))['db'];config[_0x2203('0x7')]=_[_0x2203('0x8')](config[_0x2203('0x7')],{'host':_0x2203('0x9'),'port':0x18eb});var socket=require(_0x2203('0xa'))(new Redis(config[_0x2203('0x7')]));require(_0x2203('0xb'))[_0x2203('0xc')](socket);function respondWithStatusCode(_0x2999ed,_0x5ecf9e){_0x5ecf9e=_0x5ecf9e||0xcc;return function(_0x526ae0){if(_0x526ae0){return _0x2999ed[_0x2203('0xd')](_0x5ecf9e);}return _0x2999ed['status'](_0x5ecf9e)[_0x2203('0xe')]();};}function respondWithResult(_0x2972f3,_0x6339c4){_0x6339c4=_0x6339c4||0xc8;return function(_0x5b19df){if(_0x5b19df){return _0x2972f3[_0x2203('0xf')](_0x6339c4)['json'](_0x5b19df);}};}function respondWithFilteredResult(_0x3f690a,_0x4b73be){return function(_0x297459){if(_0x297459){var _0x1abb51=typeof _0x4b73be['offset']==='undefined'&&typeof _0x4b73be['limit']==='undefined';var _0x4bad7c=_0x297459[_0x2203('0x10')];var _0x538b30=_0x1abb51?0x0:_0x4b73be['offset'];var _0x21a3af=_0x1abb51?_0x297459[_0x2203('0x10')]:_0x4b73be[_0x2203('0x11')]+_0x4b73be[_0x2203('0x12')];var _0x226209;if(_0x21a3af>=_0x4bad7c){_0x21a3af=_0x4bad7c;_0x226209=0xc8;}else{_0x226209=0xce;}_0x3f690a[_0x2203('0xf')](_0x226209);return _0x3f690a[_0x2203('0x13')](_0x2203('0x14'),_0x538b30+'-'+_0x21a3af+'/'+_0x4bad7c)[_0x2203('0x15')](_0x297459);}return null;};}function saveUpdates(_0x3053f3){return function(_0x5129fb){if(_0x5129fb){return _0x5129fb[_0x2203('0x16')](_0x3053f3)[_0x2203('0x17')](function(_0x4893ff){return _0x4893ff;});}return null;};}function removeEntity(_0x3f9ef6){return function(_0x8906e1){if(_0x8906e1){return _0x8906e1['destroy']()[_0x2203('0x17')](function(){var _0x5ee83c=_0x8906e1[_0x2203('0x18')]({'plain':!![]});var _0x310b8c=_0x2203('0x19');return db[_0x2203('0x1a')][_0x2203('0x1b')]({'where':{'type':_0x310b8c,'resourceId':_0x5ee83c['id']}})[_0x2203('0x17')](function(){return _0x8906e1;});})['then'](function(){_0x3f9ef6[_0x2203('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac866){return function(_0x15f543){if(!_0x15f543){_0x5ac866['sendStatus'](0x194);}return _0x15f543;};}function handleError(_0x3b8ef9,_0x5bfe61){_0x5bfe61=_0x5bfe61||0x1f4;return function(_0x5d4c4e){logger[_0x2203('0x1c')](_0x5d4c4e['stack']);if(_0x5d4c4e['name']){delete _0x5d4c4e[_0x2203('0x1d')];}_0x3b8ef9[_0x2203('0xf')](_0x5bfe61)[_0x2203('0x1e')](_0x5d4c4e);};}exports[_0x2203('0x1f')]=function(_0x1244f4,_0x3114ef){var _0x49c12={};var _0x250349={'count':0x0,'rows':[]};var _0x576378=_[_0x2203('0x20')](db[_0x2203('0x21')][_0x2203('0x22')],function(_0x5f11bf){return{'name':_0x5f11bf[_0x2203('0x23')],'type':_0x5f11bf[_0x2203('0x24')]['key']};});_0x49c12=qs[_0x2203('0x25')](_0x576378,_0x1244f4);var _0xd91f5d={'where':_0x49c12[_0x2203('0x26')]};return db[_0x2203('0x21')][_0x2203('0x10')](_0xd91f5d)[_0x2203('0x17')](function(_0x9c53f){_0x250349['count']=_0x9c53f;_0x49c12[_0x2203('0x27')]=qs[_0x2203('0x27')](_0x1244f4[_0x2203('0x28')]);return db[_0x2203('0x21')]['findAll'](_0x49c12);})[_0x2203('0x17')](function(_0x21ff0d){_0x250349[_0x2203('0x29')]=_0x21ff0d;return _0x250349;})[_0x2203('0x17')](respondWithFilteredResult(_0x3114ef,_0x49c12))['catch'](handleError(_0x3114ef,null));};exports[_0x2203('0x2a')]=function(_0x50aa17,_0x5e6560){var _0x5c0157={'raw':!![],'where':{'id':_0x50aa17['params']['id']}},_0x1d5f74={};_0x1d5f74['model']=_[_0x2203('0x2b')](db[_0x2203('0x21')][_0x2203('0x22')]);_0x1d5f74[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x50aa17['query']);_0x1d5f74[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x1d5f74['model'],_0x1d5f74[_0x2203('0x28')]);_0x5c0157[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0x1d5f74[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x50aa17[_0x2203('0x28')][_0x2203('0x30')]));_0x5c0157[_0x2203('0x2e')]=_0x5c0157[_0x2203('0x2e')]['length']?_0x5c0157[_0x2203('0x2e')]:_0x1d5f74[_0x2203('0x2f')];if(_0x50aa17['query']['includeAll']){_0x5c0157[_0x2203('0x27')]=[{'all':!![]}];}_0x5c0157=_['merge']({},_0x5c0157,_0x50aa17[_0x2203('0x31')]);return db[_0x2203('0x21')][_0x2203('0x32')](_0x5c0157)['then'](handleEntityNotFound(_0x5e6560,null))['then'](respondWithResult(_0x5e6560,null))[_0x2203('0x33')](handleError(_0x5e6560,null));};exports['create']=function(_0x2d0365,_0x5cfe5e){return db[_0x2203('0x21')]['create'](_0x2d0365[_0x2203('0x34')],{})[_0x2203('0x17')](function(_0x4311d1){var _0x40a793=_0x2d0365[_0x2203('0x35')]['get']({'plain':!![]});if(!_0x40a793)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a793['role']===_0x2203('0x35')){var _0x25a2dc=_0x4311d1[_0x2203('0x18')]({'plain':!![]});var _0x3b0c7a=_0x2203('0x19');return db[_0x2203('0x36')][_0x2203('0x32')]({'where':{'name':_0x3b0c7a,'userProfileId':_0x40a793['userProfileId']},'raw':!![]})[_0x2203('0x17')](function(_0x1b12c3){if(_0x1b12c3&&_0x1b12c3[_0x2203('0x37')]===0x0){return db[_0x2203('0x1a')]['create']({'name':_0x25a2dc['name'],'resourceId':_0x25a2dc['id'],'type':_0x1b12c3[_0x2203('0x1d')],'sectionId':_0x1b12c3['id']},{})['then'](function(){return _0x4311d1;});}else{return _0x4311d1;}})[_0x2203('0x33')](function(_0x446209){logger[_0x2203('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446209);throw _0x446209;});}return _0x4311d1;})['then'](respondWithResult(_0x5cfe5e,0xc9))[_0x2203('0x33')](handleError(_0x5cfe5e,null));};exports[_0x2203('0x16')]=function(_0x368444,_0x1e09f3){if(_0x368444[_0x2203('0x34')]['id']){delete _0x368444[_0x2203('0x34')]['id'];}return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x368444[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e09f3,null))[_0x2203('0x17')](saveUpdates(_0x368444[_0x2203('0x34')],null))[_0x2203('0x17')](respondWithResult(_0x1e09f3,null))[_0x2203('0x33')](handleError(_0x1e09f3,null));};exports[_0x2203('0x1b')]=function(_0x36b8e4,_0x1e34a0){return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x36b8e4[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e34a0,null))[_0x2203('0x17')](removeEntity(_0x1e34a0,null))['catch'](handleError(_0x1e34a0,null));};exports['describe']=function(_0x1c6661,_0x48129c){return db[_0x2203('0x21')][_0x2203('0x39')]()[_0x2203('0x17')](respondWithResult(_0x48129c,null))[_0x2203('0x33')](handleError(_0x48129c,null));};exports['getMembers']=function(_0x289146,_0x102803){var _0x5cd8c6={'raw':!![],'where':{}},_0x29bd91={},_0x381b3e;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x289146['params']['id']}})['then'](handleEntityNotFound(_0x102803,null))[_0x2203('0x17')](function(_0x5707c8){if(_0x5707c8){_0x381b3e=_0x5707c8['get']({'plain':!![]});_0x29bd91[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x3b')]['rawAttributes']);_0x29bd91['query']=_[_0x2203('0x2b')](_0x289146[_0x2203('0x28')]);_0x29bd91[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x29bd91[_0x2203('0x2f')],_0x29bd91[_0x2203('0x28')]);_0x5cd8c6['attributes']=_[_0x2203('0x2d')](_0x29bd91['model'],qs[_0x2203('0x30')](_0x289146[_0x2203('0x28')][_0x2203('0x30')]));_0x5cd8c6[_0x2203('0x2e')]=_0x5cd8c6['attributes']['length']?_0x5cd8c6[_0x2203('0x2e')]:_0x29bd91[_0x2203('0x2f')];if(!_0x289146[_0x2203('0x28')][_0x2203('0x3c')]('nolimit')){_0x5cd8c6['limit']=qs['limit'](_0x289146[_0x2203('0x28')][_0x2203('0x12')]);_0x5cd8c6['offset']=qs[_0x2203('0x11')](_0x289146[_0x2203('0x28')]['offset']);}_0x5cd8c6[_0x2203('0x3d')]=qs[_0x2203('0x3e')](_0x289146[_0x2203('0x28')][_0x2203('0x3e')]);_0x5cd8c6['where']=qs[_0x2203('0x2c')](_['pick'](_0x289146[_0x2203('0x28')],_0x29bd91[_0x2203('0x2c')]));_0x5cd8c6['where'][_0x2203('0x3f')]=_0x5707c8['id'];if(_0x289146[_0x2203('0x28')][_0x2203('0x40')]){_0x5cd8c6[_0x2203('0x26')]=_[_0x2203('0x41')](_0x5cd8c6[_0x2203('0x26')],{'$or':_['map'](_0x5cd8c6['attributes'],function(_0x2f2537){var _0x524356={};_0x524356[_0x2f2537]={'$like':'%'+_0x289146['query'][_0x2203('0x40')]+'%'};return _0x524356;})});}_0x5cd8c6=_[_0x2203('0x41')]({},_0x5cd8c6,_0x289146[_0x2203('0x31')]);return db['UserSmsQueue'][_0x2203('0x42')](_0x5cd8c6);}})['then'](function(_0x5ddf9e){if(_0x5ddf9e){return db[_0x2203('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x5ddf9e,'UserId'),'role':_0x2203('0x44')},'attributes':['id',_0x2203('0x1d'),_0x2203('0x45'),_0x2203('0x46'),_0x2203('0x47')]});}})[_0x2203('0x17')](function(_0x2baea2){if(_0x2baea2){return{'count':_0x2baea2[_0x2203('0x10')],'rows':_[_0x2203('0x20')](_0x2baea2[_0x2203('0x29')],function(_0x384a59){return{'membername':_0x384a59[_0x2203('0x1d')],'UserId':_0x384a59['id'],'queue_name':_0x381b3e['name'],'SmsQueueId':_0x381b3e['id'],'interface':util['format'](_0x2203('0x48'),_0x2203('0x49'),_0x384a59[_0x2203('0x1d')]),'penalty':0x0,'paused':_0x384a59[_0x2203('0x45')],'createdAt':_0x384a59[_0x2203('0x47')],'updatedAt':_0x384a59[_0x2203('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x102803,_0x5cd8c6))['catch'](handleError(_0x102803,null));};exports[_0x2203('0x4a')]=function(_0x34358e,_0x21ee59){var _0x1e6d21={};var _0xcab922={};var _0x7b0b9c;var _0x133d22;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x34358e[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x21ee59,null))['then'](function(_0x1ea97a){if(_0x1ea97a){_0x7b0b9c=_0x1ea97a;_0xcab922[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x4b')][_0x2203('0x22')]);_0xcab922[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x34358e[_0x2203('0x28')]);_0xcab922[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],_0xcab922[_0x2203('0x28')]);_0x1e6d21[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x34358e[_0x2203('0x28')][_0x2203('0x30')]));_0x1e6d21[_0x2203('0x2e')]=_0x1e6d21[_0x2203('0x2e')]['length']?_0x1e6d21[_0x2203('0x2e')]:_0xcab922[_0x2203('0x2f')];_0x1e6d21[_0x2203('0x3d')]=qs['sort'](_0x34358e[_0x2203('0x28')][_0x2203('0x3e')]);_0x1e6d21[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x34358e['query'],_0xcab922[_0x2203('0x2c')]));if(_0x34358e[_0x2203('0x28')][_0x2203('0x40')]){_0x1e6d21['where']=_['merge'](_0x1e6d21['where'],{'$or':_['map'](_0x1e6d21['attributes'],function(_0x418d48){var _0xbc9f88={};_0xbc9f88[_0x418d48]={'$like':'%'+_0x34358e[_0x2203('0x28')][_0x2203('0x40')]+'%'};return _0xbc9f88;})});}_0x1e6d21=_[_0x2203('0x41')]({},_0x1e6d21,_0x34358e[_0x2203('0x31')]);return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0x56dcbe){if(_0x56dcbe){_0x133d22=_0x56dcbe['length'];if(!_0x34358e[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x1e6d21[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x34358e[_0x2203('0x28')][_0x2203('0x12')]);_0x1e6d21[_0x2203('0x11')]=qs[_0x2203('0x11')](_0x34358e[_0x2203('0x28')][_0x2203('0x11')]);}return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0xae45a5){if(_0xae45a5){return _0xae45a5?{'count':_0x133d22,'rows':_0xae45a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x21ee59,null))[_0x2203('0x33')](handleError(_0x21ee59,null));};exports[_0x2203('0x4e')]=function(_0x173ac1,_0xa15021){var _0x4b2e4f=_0x173ac1[_0x2203('0x34')]['ids'];return db[_0x2203('0x4b')]['findAll']({'where':{'id':_0x4b2e4f},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':_0x2203('0x4f'),'attributes':['id',_0x2203('0x1d'),_0x2203('0x50'),_0x2203('0x51'),_0x2203('0x52')],'raw':!![]}]})[_0x2203('0x17')](function(_0x2eab08){if(_0x2eab08){var _0x4e9a01=_['flatMap'](_0x2eab08,function(_0x38903b){var _0x34593a=_0x38903b[_0x2203('0x18')]({'plain':!![]});return _0x34593a['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x173ac1[_0x2203('0x38')]['id']}})[_0x2203('0x17')](function(_0x20385b){return db[_0x2203('0x53')]['transaction'](function(_0x2f7850){return _0x20385b['addTeams'](_0x4b2e4f,{'transaction':_0x2f7850})[_0x2203('0x17')](function(){return BPromise[_0x2203('0x54')](_0x4e9a01,function(_0xe3bee5){return db[_0x2203('0x3b')][_0x2203('0x55')]({'where':{'UserId':_0xe3bee5['id'],'SmsQueueId':_0x173ac1['params']['id']},'transaction':_0x2f7850});});})[_0x2203('0x17')](function(){_0x4e9a01[_0x2203('0x56')](function(_0x18663f){socket['emit'](_0x2203('0x57'),{'UserId':_0x18663f['id'],'SmsQueueId':_0x20385b['id']});});});});});}})[_0x2203('0x17')](respondWithStatusCode(_0xa15021,null))[_0x2203('0x33')](handleError(_0xa15021,null));};exports[_0x2203('0x58')]=function(_0x1c65f9,_0x4356fe){return db[_0x2203('0x4b')][_0x2203('0x42')]({'where':{'id':_0x1c65f9[_0x2203('0x28')][_0x2203('0x59')]},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2203('0x17')](handleEntityNotFound(_0x4356fe,null))[_0x2203('0x17')](function(_0x21b755){var _0x2da37c=_[_0x2203('0x20')](_0x21b755,'id');var _0x52c35e=[];var _0x23f7b1=[];var _0x2a5a4b=squel[_0x2203('0x5a')]();_0x2a5a4b[_0x2203('0x5b')](_0x2203('0x5c'))[_0x2203('0x5d')]('team_has_sms_queues','tq')['join'](_0x2203('0x5e'),'ut',_0x2203('0x5f'))[_0x2203('0x26')](_0x2203('0x60'),_0x1c65f9[_0x2203('0x38')]['id']);for(var _0x4fd029=0x0;_0x4fd029<_0x21b755[_0x2203('0x61')];_0x4fd029+=0x1){let _0x3cb792=_0x21b755[_0x4fd029];for(var _0x4e539b=0x0;_0x4e539b<_0x3cb792['Agents']['length'];_0x4e539b+=0x1){let _0x4fc51a=_0x3cb792['Agents'][_0x4e539b];var _0x2952fc=_0x2a5a4b[_0x2203('0x62')]();_0x2952fc[_0x2203('0x26')]('ut.UserId\x20=\x20?',_0x4fc51a['id']);_0x23f7b1['push'](db['sequelize'][_0x2203('0x28')](_0x2952fc[_0x2203('0x63')](),{'type':db[_0x2203('0x53')][_0x2203('0x64')][_0x2203('0x65')]})[_0x2203('0x17')](function(_0x3d1797){if(_0x3d1797['length']===0x1){return _0x4fc51a['id'];}else{var _0x3bf2c9=_[_0x2203('0x66')](_[_0x2203('0x20')](_0x3d1797,_0x2203('0x67')),function(_0x35ff6b){return _[_0x2203('0x68')](_0x2da37c,_0x35ff6b);});if(_0x3bf2c9){return _0x4fc51a['id'];}}}));}}return BPromise[_0x2203('0x69')](_0x23f7b1)['then'](function(_0x188722){_0x52c35e=_(_0x52c35e)['union'](_0x188722)['compact']()[_0x2203('0x6a')]();return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x1c65f9[_0x2203('0x38')]['id']}})['then'](function(_0x29d545){return db[_0x2203('0x53')][_0x2203('0x6b')](function(_0x461f90){return _0x29d545[_0x2203('0x58')](_0x1c65f9[_0x2203('0x28')]['ids'],{'transaction':_0x461f90})[_0x2203('0x17')](function(){if(!_[_0x2203('0x6c')](_0x52c35e)){return _0x29d545['removeAgents'](_0x52c35e,{'transaction':_0x461f90});}})['then'](function(){_0x52c35e[_0x2203('0x56')](function(_0x3fe71b){socket[_0x2203('0x6d')](_0x2203('0x6e'),{'UserId':_0x3fe71b,'SmsQueueId':_0x29d545['id']});});});});});});})[_0x2203('0x17')](respondWithStatusCode(_0x4356fe,null))[_0x2203('0x33')](handleError(_0x4356fe,null));};exports[_0x2203('0x6f')]=function(_0x3c41bf,_0x4749df){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x3c41bf[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x4749df,null))[_0x2203('0x17')](function(_0x7589a7){if(_0x7589a7){return _0x7589a7[_0x2203('0x6f')](_0x3c41bf['body']['ids'],_[_0x2203('0x70')](_0x3c41bf[_0x2203('0x34')],['ids','id'])||{})[_0x2203('0x71')](function(_0x447a95){for(var _0x5b5e95=0x0;_0x5b5e95<_0x3c41bf[_0x2203('0x34')][_0x2203('0x59')]['length'];_0x5b5e95+=0x1){socket[_0x2203('0x6d')](_0x2203('0x57'),{'UserId':Number(_0x3c41bf['body'][_0x2203('0x59')][_0x5b5e95]),'SmsQueueId':Number(_0x3c41bf[_0x2203('0x38')]['id'])});}return _0x447a95;});}})[_0x2203('0x17')](respondWithResult(_0x4749df,null))[_0x2203('0x33')](handleError(_0x4749df,null));};exports['removeAgents']=function(_0x511c66,_0x2df837){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x511c66['params']['id']}})['then'](handleEntityNotFound(_0x2df837,null))[_0x2203('0x17')](function(_0x199bec){if(_0x199bec){return _0x199bec[_0x2203('0x72')](_0x511c66['query']['ids'])[_0x2203('0x17')](function(){if(_[_0x2203('0x73')](_0x511c66['query'][_0x2203('0x59')])){for(var _0x2de64d=0x0;_0x2de64d<_0x511c66['query'][_0x2203('0x59')]['length'];_0x2de64d+=0x1){socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66['query']['ids'][_0x2de64d]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}}else{socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66[_0x2203('0x28')][_0x2203('0x59')]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x2df837,null))[_0x2203('0x33')](handleError(_0x2df837,null));};exports['getAgents']=function(_0x3f31e0,_0x3edb38){var _0x486563={};var _0x4358c1={};var _0x4096f4;var _0x5bd4e4;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x3f31e0[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x3edb38,null))[_0x2203('0x17')](function(_0x5d73a7){if(_0x5d73a7){_0x4096f4=_0x5d73a7;_0x4358c1[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x43')][_0x2203('0x22')]);_0x4358c1[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x3f31e0['query']);_0x4358c1[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x4358c1['model'],_0x4358c1[_0x2203('0x28')]);_0x486563['attributes']=_[_0x2203('0x2d')](_0x4358c1[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x3f31e0['query'][_0x2203('0x30')]));_0x486563[_0x2203('0x2e')]=_0x486563[_0x2203('0x2e')][_0x2203('0x61')]?_0x486563[_0x2203('0x2e')]:_0x4358c1[_0x2203('0x2f')];_0x486563[_0x2203('0x3d')]=qs['sort'](_0x3f31e0['query'][_0x2203('0x3e')]);_0x486563[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x3f31e0[_0x2203('0x28')],_0x4358c1[_0x2203('0x2c')]));if(_0x3f31e0[_0x2203('0x28')]['filter']){_0x486563[_0x2203('0x26')]=_[_0x2203('0x41')](_0x486563['where'],{'$or':_[_0x2203('0x20')](_0x486563['attributes'],function(_0xc3dac5){var _0xbd1866={};_0xbd1866[_0xc3dac5]={'$like':'%'+_0x3f31e0['query'][_0x2203('0x40')]+'%'};return _0xbd1866;})});}_0x486563=_[_0x2203('0x41')]({},_0x486563,_0x3f31e0[_0x2203('0x31')]);return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x36ab7f){if(_0x36ab7f){_0x5bd4e4=_0x36ab7f[_0x2203('0x61')];if(!_0x3f31e0[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x486563[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x3f31e0['query'][_0x2203('0x12')]);_0x486563['offset']=qs[_0x2203('0x11')](_0x3f31e0[_0x2203('0x28')][_0x2203('0x11')]);}return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x2159a5){if(_0x2159a5){return _0x2159a5?{'count':_0x5bd4e4,'rows':_0x2159a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x3edb38,null))[_0x2203('0x33')](handleError(_0x3edb38,null));}; \ No newline at end of file +var _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x0b0e[_0x58c20f];return _0x3b0318;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index dffd815..527caf6 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 _0xf194=['emit','hasOwnProperty','hook','events','../../mysqldb','update'];(function(_0x5261e2,_0x43c2fa){var _0x366a77=function(_0x47400e){while(--_0x47400e){_0x5261e2['push'](_0x5261e2['shift']());}};_0x366a77(++_0x43c2fa);}(_0xf194,0x183));var _0x4f19=function(_0x56e982,_0xda7a2d){_0x56e982=_0x56e982-0x0;var _0xa0bf73=_0xf194[_0x56e982];return _0xa0bf73;};'use strict';var EventEmitter=require(_0x4f19('0x0'));var SmsQueue=require(_0x4f19('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4f19('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5308ff){return function(_0x4bd129,_0x204154,_0x31a7a4){SmsQueueEvents[_0x4f19('0x3')](_0x5308ff+':'+_0x4bd129['id'],_0x4bd129);SmsQueueEvents[_0x4f19('0x3')](_0x5308ff,_0x4bd129);_0x31a7a4(null);};}for(var e in events){if(events[_0x4f19('0x4')](e)){var event=events[e];SmsQueue[_0x4f19('0x5')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x4df6=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4df6,0x90));var _0x64df=function(_0x38cfef,_0xe8207b){_0x38cfef=_0x38cfef-0x0;var _0x5713dc=_0x4df6[_0x38cfef];return _0x5713dc;};'use strict';var EventEmitter=require(_0x64df('0x0'));var SmsQueue=require(_0x64df('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x64df('0x2')](0x0);var events={'afterCreate':_0x64df('0x3'),'afterUpdate':_0x64df('0x4'),'afterDestroy':_0x64df('0x5')};function emitEvent(_0xf662ce){return function(_0x281a4c,_0x59063a,_0x2347ca){SmsQueueEvents[_0x64df('0x6')](_0xf662ce+':'+_0x281a4c['id'],_0x281a4c);SmsQueueEvents[_0x64df('0x6')](_0xf662ce,_0x281a4c);_0x2347ca(null);};}for(var e in events){if(events[_0x64df('0x7')](e)){var event=events[e];SmsQueue[_0x64df('0x8')](e,emitEvent(event));}}module[_0x64df('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 055dc04..1809ef2 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 _0x2042=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','sms_queues'];(function(_0x150dfe,_0x411ca7){var _0x190b6d=function(_0x463871){while(--_0x463871){_0x150dfe['push'](_0x150dfe['shift']());}};_0x190b6d(++_0x411ca7);}(_0x2042,0x176));var _0x2204=function(_0x19cfe9,_0x4851e0){_0x19cfe9=_0x19cfe9-0x0;var _0x8e1c39=_0x2042[_0x19cfe9];return _0x8e1c39;};'use strict';var _=require('lodash');var util=require(_0x2204('0x0'));var logger=require(_0x2204('0x1'))(_0x2204('0x2'));var moment=require(_0x2204('0x3'));var BPromise=require('bluebird');var rp=require(_0x2204('0x4'));var fs=require('fs');var path=require(_0x2204('0x5'));var rimraf=require(_0x2204('0x6'));var config=require(_0x2204('0x7'));var attributes=require('./smsQueue.attributes');module[_0x2204('0x8')]=function(_0x24eddc,_0x15fa57){return _0x24eddc[_0x2204('0x9')]('SmsQueue',attributes,{'tableName':_0x2204('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0def=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','../../config/logger','api','request-promise','rimraf'];(function(_0x3d9ba7,_0x1c8b5f){var _0x4621ce=function(_0x5e3283){while(--_0x5e3283){_0x3d9ba7['push'](_0x3d9ba7['shift']());}};_0x4621ce(++_0x1c8b5f);}(_0x0def,0x74));var _0xf0de=function(_0x34c027,_0x123688){_0x34c027=_0x34c027-0x0;var _0x47bff0=_0x0def[_0x34c027];return _0x47bff0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf0de('0x0'))(_0xf0de('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0de('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0de('0x3'));var config=require(_0xf0de('0x4'));var attributes=require(_0xf0de('0x5'));module[_0xf0de('0x6')]=function(_0x23f0b0,_0x52fa06){return _0x23f0b0[_0xf0de('0x7')](_0xf0de('0x8'),attributes,{'tableName':_0xf0de('0x9'),'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 b1f92b3..63d2c6a 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 _0x8c73=['redis','defaults','localhost','./smsQueue.socket','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsQueue,\x20%s,\x20%s','message','catch','SmsQueue','options','raw','where','limit','include','model','attributes','map','GetSmsQueue','stringify','ShowSmsQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xdd14da,_0x12a773){var _0x4d2e81=function(_0x151c0e){while(--_0x151c0e){_0xdd14da['push'](_0xdd14da['shift']());}};_0x4d2e81(++_0x12a773);}(_0x8c73,0x10d));var _0x38c7=function(_0x2be2c7,_0x32900e){_0x2be2c7=_0x2be2c7-0x0;var _0x4cc9a7=_0x8c73[_0x2be2c7];return _0x4cc9a7;};'use strict';var _=require(_0x38c7('0x0'));var util=require(_0x38c7('0x1'));var moment=require(_0x38c7('0x2'));var BPromise=require(_0x38c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x38c7('0x5'));var logger=require(_0x38c7('0x6'))(_0x38c7('0x7'));var config=require(_0x38c7('0x8'));var jayson=require(_0x38c7('0x9'));var client=jayson[_0x38c7('0xa')]['http']({'port':0x232a});config[_0x38c7('0xb')]=_[_0x38c7('0xc')](config[_0x38c7('0xb')],{'host':_0x38c7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38c7('0xb')]));require(_0x38c7('0xe'))[_0x38c7('0xf')](socket);function respondWithRpcPromise(_0x24adac,_0x3fe746,_0x4a4708){return new BPromise(function(_0x2beb46,_0x57a090){return client[_0x38c7('0x10')](_0x24adac,_0x4a4708)[_0x38c7('0x11')](function(_0x491bed){logger[_0x38c7('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3fe746,'request\x20sent');logger[_0x38c7('0x13')](_0x38c7('0x14'),_0x3fe746,_0x38c7('0x15'),JSON['stringify'](_0x491bed));if(_0x491bed['error']){if(_0x491bed[_0x38c7('0x16')][_0x38c7('0x17')]===0x1f4){logger['error'](_0x38c7('0x18'),_0x3fe746,_0x491bed[_0x38c7('0x16')][_0x38c7('0x19')]);return _0x57a090(_0x491bed[_0x38c7('0x16')][_0x38c7('0x19')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x3fe746,_0x491bed[_0x38c7('0x16')][_0x38c7('0x19')]);return _0x2beb46(_0x491bed[_0x38c7('0x16')][_0x38c7('0x19')]);}else{logger[_0x38c7('0x12')]('SmsQueue,\x20%s,\x20%s',_0x3fe746,_0x38c7('0x15'));_0x2beb46(_0x491bed['result'][_0x38c7('0x19')]);}})[_0x38c7('0x1a')](function(_0xd15c3a){logger[_0x38c7('0x16')](_0x38c7('0x18'),_0x3fe746,_0xd15c3a);_0x57a090(_0xd15c3a);});});}exports['GetSmsQueue']=function(_0x1cf8aa){var _0x2d52b5=this;return new Promise(function(_0x581dce,_0x2cb71a){return db[_0x38c7('0x1b')]['findAll']({'raw':_0x1cf8aa['options']?_0x1cf8aa[_0x38c7('0x1c')][_0x38c7('0x1d')]===undefined?!![]:![]:!![],'where':_0x1cf8aa[_0x38c7('0x1c')]?_0x1cf8aa[_0x38c7('0x1c')][_0x38c7('0x1e')]||null:null,'attributes':_0x1cf8aa[_0x38c7('0x1c')]?_0x1cf8aa[_0x38c7('0x1c')]['attributes']||null:null,'limit':_0x1cf8aa[_0x38c7('0x1c')]?_0x1cf8aa[_0x38c7('0x1c')][_0x38c7('0x1f')]||null:null,'include':_0x1cf8aa[_0x38c7('0x1c')]?_0x1cf8aa[_0x38c7('0x1c')][_0x38c7('0x20')]?_['map'](_0x1cf8aa['options'][_0x38c7('0x20')],function(_0x193518){return{'model':db[_0x193518[_0x38c7('0x21')]],'as':_0x193518['as'],'attributes':_0x193518[_0x38c7('0x22')],'include':_0x193518['include']?_[_0x38c7('0x23')](_0x193518[_0x38c7('0x20')],function(_0x374fca){return{'model':db[_0x374fca['model']],'as':_0x374fca['as'],'attributes':_0x374fca['attributes'],'include':_0x374fca['include']?_[_0x38c7('0x23')](_0x374fca[_0x38c7('0x20')],function(_0x92b1d2){return{'model':db[_0x92b1d2[_0x38c7('0x21')]],'as':_0x92b1d2['as'],'attributes':_0x92b1d2[_0x38c7('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x408f71){logger[_0x38c7('0x12')](_0x38c7('0x24'),_0x1cf8aa);logger[_0x38c7('0x13')](_0x38c7('0x24'),_0x1cf8aa,JSON[_0x38c7('0x25')](_0x408f71));_0x581dce(_0x408f71);})[_0x38c7('0x1a')](function(_0x5e1fbf){logger['error'](_0x38c7('0x24'),_0x5e1fbf[_0x38c7('0x19')],_0x1cf8aa);_0x2cb71a(_0x2d52b5['error'](0x1f4,_0x5e1fbf[_0x38c7('0x19')]));});});};exports[_0x38c7('0x26')]=function(_0x4a75ee){var _0x1bd351=this;return new Promise(function(_0x503f49,_0x31bedc){return db[_0x38c7('0x1b')][_0x38c7('0x27')]({'raw':_0x4a75ee[_0x38c7('0x1c')]?_0x4a75ee[_0x38c7('0x1c')][_0x38c7('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a75ee['options']?_0x4a75ee[_0x38c7('0x1c')][_0x38c7('0x1e')]||null:null,'attributes':_0x4a75ee['options']?_0x4a75ee[_0x38c7('0x1c')]['attributes']||null:null,'include':_0x4a75ee[_0x38c7('0x1c')]?_0x4a75ee[_0x38c7('0x1c')]['include']?_[_0x38c7('0x23')](_0x4a75ee[_0x38c7('0x1c')][_0x38c7('0x20')],function(_0x37ab97){return{'model':db[_0x37ab97['model']],'as':_0x37ab97['as'],'attributes':_0x37ab97[_0x38c7('0x22')],'include':_0x37ab97[_0x38c7('0x20')]?_['map'](_0x37ab97[_0x38c7('0x20')],function(_0x556913){return{'model':db[_0x556913['model']],'as':_0x556913['as'],'attributes':_0x556913[_0x38c7('0x22')],'include':_0x556913[_0x38c7('0x20')]?_['map'](_0x556913[_0x38c7('0x20')],function(_0x3a2c3b){return{'model':db[_0x3a2c3b[_0x38c7('0x21')]],'as':_0x3a2c3b['as'],'attributes':_0x3a2c3b[_0x38c7('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb02973){logger[_0x38c7('0x12')](_0x38c7('0x26'),_0x4a75ee);logger['debug']('ShowSmsQueue',_0x4a75ee,JSON[_0x38c7('0x25')](_0xb02973));_0x503f49(_0xb02973);})[_0x38c7('0x1a')](function(_0x773cb7){logger[_0x38c7('0x16')](_0x38c7('0x26'),_0x773cb7[_0x38c7('0x19')],_0x4a75ee);_0x31bedc(_0x1bd351[_0x38c7('0x16')](0x1f4,_0x773cb7[_0x38c7('0x19')]));});});}; \ No newline at end of file +var _0xb332=['register','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','raw','options','where','limit','include','map','attributes','model','stringify','find','ShowSmsQueue','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0xb332,0x68));var _0x2b33=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0xb332[_0x2797c6];return _0x54809f;};'use strict';var _=require(_0x2b33('0x0'));var util=require(_0x2b33('0x1'));var moment=require('moment');var BPromise=require(_0x2b33('0x2'));var rs=require(_0x2b33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b33('0x4'));var logger=require('../../config/logger')(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson[_0x2b33('0x7')]['http']({'port':0x232a});config[_0x2b33('0x8')]=_[_0x2b33('0x9')](config[_0x2b33('0x8')],{'host':_0x2b33('0xa'),'port':0x18eb});var socket=require(_0x2b33('0xb'))(new Redis(config[_0x2b33('0x8')]));require(_0x2b33('0xc'))[_0x2b33('0xd')](socket);function respondWithRpcPromise(_0xd33c6f,_0x2f7648,_0x35a537){return new BPromise(function(_0x33a856,_0x1725ba){return client['request'](_0xd33c6f,_0x35a537)[_0x2b33('0xe')](function(_0x3ab013){logger[_0x2b33('0xf')]('SmsQueue,\x20%s,\x20%s',_0x2f7648,_0x2b33('0x10'));logger[_0x2b33('0x11')](_0x2b33('0x12'),_0x2f7648,_0x2b33('0x10'),JSON['stringify'](_0x3ab013));if(_0x3ab013[_0x2b33('0x13')]){if(_0x3ab013[_0x2b33('0x13')][_0x2b33('0x14')]===0x1f4){logger['error'](_0x2b33('0x15'),_0x2f7648,_0x3ab013['error'][_0x2b33('0x16')]);return _0x1725ba(_0x3ab013[_0x2b33('0x13')][_0x2b33('0x16')]);}logger[_0x2b33('0x13')]('SmsQueue,\x20%s,\x20%s',_0x2f7648,_0x3ab013[_0x2b33('0x13')]['message']);return _0x33a856(_0x3ab013['error'][_0x2b33('0x16')]);}else{logger[_0x2b33('0xf')](_0x2b33('0x15'),_0x2f7648,_0x2b33('0x10'));_0x33a856(_0x3ab013[_0x2b33('0x17')][_0x2b33('0x16')]);}})[_0x2b33('0x18')](function(_0x7b9325){logger[_0x2b33('0x13')](_0x2b33('0x15'),_0x2f7648,_0x7b9325);_0x1725ba(_0x7b9325);});});}exports[_0x2b33('0x19')]=function(_0x4944be){var _0xdfe43e=this;return new Promise(function(_0x598571,_0x5170fe){return db[_0x2b33('0x1a')][_0x2b33('0x1b')]({'raw':_0x4944be['options']?_0x4944be['options'][_0x2b33('0x1c')]===undefined?!![]:![]:!![],'where':_0x4944be[_0x2b33('0x1d')]?_0x4944be[_0x2b33('0x1d')][_0x2b33('0x1e')]||null:null,'attributes':_0x4944be[_0x2b33('0x1d')]?_0x4944be[_0x2b33('0x1d')]['attributes']||null:null,'limit':_0x4944be['options']?_0x4944be[_0x2b33('0x1d')][_0x2b33('0x1f')]||null:null,'include':_0x4944be[_0x2b33('0x1d')]?_0x4944be['options'][_0x2b33('0x20')]?_[_0x2b33('0x21')](_0x4944be[_0x2b33('0x1d')][_0x2b33('0x20')],function(_0x376fa2){return{'model':db[_0x376fa2['model']],'as':_0x376fa2['as'],'attributes':_0x376fa2[_0x2b33('0x22')],'include':_0x376fa2[_0x2b33('0x20')]?_[_0x2b33('0x21')](_0x376fa2[_0x2b33('0x20')],function(_0x1a943c){return{'model':db[_0x1a943c[_0x2b33('0x23')]],'as':_0x1a943c['as'],'attributes':_0x1a943c[_0x2b33('0x22')],'include':_0x1a943c[_0x2b33('0x20')]?_[_0x2b33('0x21')](_0x1a943c[_0x2b33('0x20')],function(_0x3caf96){return{'model':db[_0x3caf96[_0x2b33('0x23')]],'as':_0x3caf96['as'],'attributes':_0x3caf96[_0x2b33('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2b33('0xe')](function(_0x4e1493){logger[_0x2b33('0xf')](_0x2b33('0x19'),_0x4944be);logger['debug']('GetSmsQueue',_0x4944be,JSON[_0x2b33('0x24')](_0x4e1493));_0x598571(_0x4e1493);})[_0x2b33('0x18')](function(_0x2fce49){logger[_0x2b33('0x13')](_0x2b33('0x19'),_0x2fce49['message'],_0x4944be);_0x5170fe(_0xdfe43e[_0x2b33('0x13')](0x1f4,_0x2fce49[_0x2b33('0x16')]));});});};exports['ShowSmsQueue']=function(_0x47449a){var _0x309ec2=this;return new Promise(function(_0x285de5,_0x4eba4d){return db[_0x2b33('0x1a')][_0x2b33('0x25')]({'raw':_0x47449a[_0x2b33('0x1d')]?_0x47449a[_0x2b33('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x47449a[_0x2b33('0x1d')]?_0x47449a[_0x2b33('0x1d')]['where']||null:null,'attributes':_0x47449a[_0x2b33('0x1d')]?_0x47449a[_0x2b33('0x1d')][_0x2b33('0x22')]||null:null,'include':_0x47449a[_0x2b33('0x1d')]?_0x47449a['options']['include']?_[_0x2b33('0x21')](_0x47449a['options'][_0x2b33('0x20')],function(_0x963199){return{'model':db[_0x963199[_0x2b33('0x23')]],'as':_0x963199['as'],'attributes':_0x963199[_0x2b33('0x22')],'include':_0x963199[_0x2b33('0x20')]?_[_0x2b33('0x21')](_0x963199['include'],function(_0x5ac380){return{'model':db[_0x5ac380[_0x2b33('0x23')]],'as':_0x5ac380['as'],'attributes':_0x5ac380[_0x2b33('0x22')],'include':_0x5ac380['include']?_['map'](_0x5ac380[_0x2b33('0x20')],function(_0x2a3917){return{'model':db[_0x2a3917[_0x2b33('0x23')]],'as':_0x2a3917['as'],'attributes':_0x2a3917[_0x2b33('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2b33('0xe')](function(_0x3ec645){logger[_0x2b33('0xf')](_0x2b33('0x26'),_0x47449a);logger['debug']('ShowSmsQueue',_0x47449a,JSON['stringify'](_0x3ec645));_0x285de5(_0x3ec645);})['catch'](function(_0xf75451){logger[_0x2b33('0x13')](_0x2b33('0x26'),_0xf75451[_0x2b33('0x16')],_0x47449a);_0x4eba4d(_0x309ec2[_0x2b33('0x13')](0x1f4,_0xf75451[_0x2b33('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 6dab4a3..104e5ec 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 _0xf99e=['update','emit','removeListener','register','length','smsQueue:','save','remove'];(function(_0x25220c,_0x31d7d4){var _0xb7f9ec=function(_0x176ca9){while(--_0x176ca9){_0x25220c['push'](_0x25220c['shift']());}};_0xb7f9ec(++_0x31d7d4);}(_0xf99e,0x126));var _0xef99=function(_0x2cac50,_0x320bb5){_0x2cac50=_0x2cac50-0x0;var _0x1b7d73=_0xf99e[_0x2cac50];return _0x1b7d73;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xef99('0x0'),_0xef99('0x1'),_0xef99('0x2')];function createListener(_0x18818c,_0x117538){return function(_0x44e720){_0x117538[_0xef99('0x3')](_0x18818c,_0x44e720);};}function removeListener(_0x33de97,_0x1d0ade){return function(){SmsQueueEvents[_0xef99('0x4')](_0x33de97,_0x1d0ade);};}exports[_0xef99('0x5')]=function(_0x412cb3){for(var _0x231847=0x0,_0x33ae7a=events[_0xef99('0x6')];_0x231847<_0x33ae7a;_0x231847++){var _0x170cf6=events[_0x231847];var _0x172a5e=createListener(_0xef99('0x7')+_0x170cf6,_0x412cb3);SmsQueueEvents['on'](_0x170cf6,_0x172a5e);}}; \ No newline at end of file +var _0x6fca=['emit','removeListener','register','length','./smsQueue.events','remove','update'];(function(_0x165cc3,_0x1b2d7d){var _0x2d5eea=function(_0x48bc18){while(--_0x48bc18){_0x165cc3['push'](_0x165cc3['shift']());}};_0x2d5eea(++_0x1b2d7d);}(_0x6fca,0x177));var _0xa6fc=function(_0x15670e,_0x28a8f6){_0x15670e=_0x15670e-0x0;var _0x216cc4=_0x6fca[_0x15670e];return _0x216cc4;};'use strict';var SmsQueueEvents=require(_0xa6fc('0x0'));var events=['save',_0xa6fc('0x1'),_0xa6fc('0x2')];function createListener(_0x1d62b1,_0x3ee5be){return function(_0x3c4bfd){_0x3ee5be[_0xa6fc('0x3')](_0x1d62b1,_0x3c4bfd);};}function removeListener(_0xc98e44,_0xbd2e15){return function(){SmsQueueEvents[_0xa6fc('0x4')](_0xc98e44,_0xbd2e15);};}exports[_0xa6fc('0x5')]=function(_0x520c7b){for(var _0x5b69e6=0x0,_0x331a16=events[_0xa6fc('0x6')];_0x5b69e6<_0x331a16;_0x5b69e6++){var _0x1931de=events[_0x5b69e6];var _0xf35d45=createListener('smsQueue:'+_0x1931de,_0x520c7b);SmsQueueEvents['on'](_0x1931de,_0xf35d45);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index c3749ff..1d988d5 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 _0xbe3b=['express','../../components/auth/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path'];(function(_0x45ee22,_0xbeb707){var _0x2b97e6=function(_0x414580){while(--_0x414580){_0x45ee22['push'](_0x45ee22['shift']());}};_0x2b97e6(++_0xbeb707);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x1ad9b4,_0x5df9ed){_0x1ad9b4=_0x1ad9b4-0x0;var _0xbbee74=_0xbe3b[_0x1ad9b4];return _0xbbee74;};'use strict';var multer=require('multer');var util=require(_0xbbe3('0x0'));var path=require(_0xbbe3('0x1'));var timeout=require('connect-timeout');var express=require(_0xbbe3('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbbe3('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbbe3('0x4'));router[_0xbbe3('0x5')]('/',auth[_0xbbe3('0x6')](),controller[_0xbbe3('0x7')]);router['get'](_0xbbe3('0x8'),auth[_0xbbe3('0x6')](),controller[_0xbbe3('0x9')]);router[_0xbbe3('0x5')](_0xbbe3('0xa'),auth['isAuthenticated'](),controller[_0xbbe3('0xb')]);router[_0xbbe3('0xc')]('/',auth[_0xbbe3('0x6')](),controller[_0xbbe3('0xd')]);router[_0xbbe3('0xe')](_0xbbe3('0xa'),auth[_0xbbe3('0x6')](),controller[_0xbbe3('0xf')]);router['delete'](_0xbbe3('0xa'),auth[_0xbbe3('0x6')](),controller[_0xbbe3('0x10')]);module[_0xbbe3('0x11')]=router; \ No newline at end of file +var _0xb000=['/describe','describe','show','post','put','/:id','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x23c262,_0x74765a){var _0x9b913f=function(_0x3ecb98){while(--_0x3ecb98){_0x23c262['push'](_0x23c262['shift']());}};_0x9b913f(++_0x74765a);}(_0xb000,0x1a7));var _0x0b00=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xb000[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0x0b00('0x0'));var util=require('util');var path=require(_0x0b00('0x1'));var timeout=require(_0x0b00('0x2'));var express=require('express');var router=express[_0x0b00('0x3')]();var fs_extra=require(_0x0b00('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0b00('0x5'));var controller=require(_0x0b00('0x6'));router[_0x0b00('0x7')]('/',auth[_0x0b00('0x8')](),controller['index']);router[_0x0b00('0x7')](_0x0b00('0x9'),auth[_0x0b00('0x8')](),controller[_0x0b00('0xa')]);router['get']('/:id',auth[_0x0b00('0x8')](),controller[_0x0b00('0xb')]);router[_0x0b00('0xc')]('/',auth[_0x0b00('0x8')](),controller['create']);router[_0x0b00('0xd')](_0x0b00('0xe'),auth[_0x0b00('0x8')](),controller[_0x0b00('0xf')]);router[_0x0b00('0x10')](_0x0b00('0xe'),auth[_0x0b00('0x8')](),controller['destroy']);module[_0x0b00('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7a6245d..b96770d 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 _0xf360=['exports','STRING','DATE','moment','sequelize'];(function(_0x580425,_0x33c13f){var _0x4cb63f=function(_0x43620f){while(--_0x43620f){_0x580425['push'](_0x580425['shift']());}};_0x4cb63f(++_0x33c13f);}(_0xf360,0x9e));var _0x0f36=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf360[_0x13d07a];return _0x5ee0ee;};'use strict';var moment=require(_0x0f36('0x0'));var Sequelize=require(_0x0f36('0x1'));module[_0x0f36('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0f36('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0f36('0x4')]},'acceptAt':{'type':Sequelize[_0x0f36('0x4')]},'exitAt':{'type':Sequelize[_0x0f36('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd447=['STRING','DATE','sequelize'];(function(_0x5bf279,_0x41f310){var _0xc7df1a=function(_0x3f4bbf){while(--_0x3f4bbf){_0x5bf279['push'](_0x5bf279['shift']());}};_0xc7df1a(++_0x41f310);}(_0xd447,0xc8));var _0x7d44=function(_0x235b9c,_0x2f5c00){_0x235b9c=_0x235b9c-0x0;var _0x4a0904=_0xd447[_0x235b9c];return _0x4a0904;};'use strict';var moment=require('moment');var Sequelize=require(_0x7d44('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7d44('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7d44('0x1')]},'joinAt':{'type':Sequelize[_0x7d44('0x2')]},'leaveAt':{'type':Sequelize[_0x7d44('0x2')]},'acceptAt':{'type':Sequelize[_0x7d44('0x2')]},'exitAt':{'type':Sequelize[_0x7d44('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index be63e21..6f03700 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 _0xa7a4=['merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','save','update','destroy','then','error','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x50bd84,_0x1be88b){var _0x4fd95d=function(_0x48d2d8){while(--_0x48d2d8){_0x50bd84['push'](_0x50bd84['shift']());}};_0x4fd95d(++_0x1be88b);}(_0xa7a4,0xe7));var _0x4a7a=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa7a4[_0x432fca];return _0x3adba4;};'use strict';var emlformat=require(_0x4a7a('0x0'));var rimraf=require(_0x4a7a('0x1'));var zipdir=require(_0x4a7a('0x2'));var jsonpatch=require(_0x4a7a('0x3'));var rp=require(_0x4a7a('0x4'));var moment=require(_0x4a7a('0x5'));var BPromise=require(_0x4a7a('0x6'));var Mustache=require(_0x4a7a('0x7'));var util=require('util');var path=require(_0x4a7a('0x8'));var sox=require(_0x4a7a('0x9'));var csv=require(_0x4a7a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a7a('0xb'));var _=require(_0x4a7a('0xc'));var squel=require('squel');var crypto=require(_0x4a7a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a7a('0xe'));var toCsv=require(_0x4a7a('0xa'));var querystring=require(_0x4a7a('0xf'));var Papa=require('papaparse');var Redis=require(_0x4a7a('0x10'));var authService=require(_0x4a7a('0x11'));var qs=require(_0x4a7a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a7a('0x13'));var utils=require(_0x4a7a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4a7a('0x15'))['db'];function respondWithStatusCode(_0x4da957,_0x273ef0){_0x273ef0=_0x273ef0||0xcc;return function(_0x561606){if(_0x561606){return _0x4da957[_0x4a7a('0x16')](_0x273ef0);}return _0x4da957[_0x4a7a('0x17')](_0x273ef0)[_0x4a7a('0x18')]();};}function respondWithResult(_0x31e14f,_0x1688a2){_0x1688a2=_0x1688a2||0xc8;return function(_0x6958f2){if(_0x6958f2){return _0x31e14f[_0x4a7a('0x17')](_0x1688a2)[_0x4a7a('0x19')](_0x6958f2);}};}function respondWithFilteredResult(_0x194cca,_0xd942f5){return function(_0x415bda){if(_0x415bda){var _0x38c8d0=typeof _0xd942f5[_0x4a7a('0x1a')]==='undefined'&&typeof _0xd942f5[_0x4a7a('0x1b')]===_0x4a7a('0x1c');var _0x5b0663=_0x415bda['count'];var _0x141eb0=_0x38c8d0?0x0:_0xd942f5[_0x4a7a('0x1a')];var _0x55cd6d=_0x38c8d0?_0x415bda['count']:_0xd942f5['offset']+_0xd942f5[_0x4a7a('0x1b')];var _0x4f2dfc;if(_0x55cd6d>=_0x5b0663){_0x55cd6d=_0x5b0663;_0x4f2dfc=0xc8;}else{_0x4f2dfc=0xce;}_0x194cca[_0x4a7a('0x17')](_0x4f2dfc);return _0x194cca['set'](_0x4a7a('0x1d'),_0x141eb0+'-'+_0x55cd6d+'/'+_0x5b0663)[_0x4a7a('0x19')](_0x415bda);}return null;};}function patchUpdates(_0x4a85f8){return function(_0x55ade7){try{jsonpatch['apply'](_0x55ade7,_0x4a85f8,!![]);}catch(_0x449c9d){return BPromise['reject'](_0x449c9d);}return _0x55ade7[_0x4a7a('0x1e')]();};}function saveUpdates(_0x5f154d,_0x12af9b){return function(_0x4b28f3){if(_0x4b28f3){return _0x4b28f3[_0x4a7a('0x1f')](_0x5f154d)['then'](function(_0x4440dd){return _0x4440dd;});}return null;};}function removeEntity(_0x2c931b,_0x36bf97){return function(_0x101c2c){if(_0x101c2c){return _0x101c2c[_0x4a7a('0x20')]()[_0x4a7a('0x21')](function(){_0x2c931b[_0x4a7a('0x17')](0xcc)[_0x4a7a('0x18')]();});}};}function handleEntityNotFound(_0x1474dd,_0x4323c3){return function(_0x137cb1){if(!_0x137cb1){_0x1474dd['sendStatus'](0x194);}return _0x137cb1;};}function handleError(_0xfac698,_0xbfd33a){_0xbfd33a=_0xbfd33a||0x1f4;return function(_0x29c46b){logger[_0x4a7a('0x22')](_0x29c46b['stack']);if(_0x29c46b['name']){delete _0x29c46b[_0x4a7a('0x23')];}_0xfac698[_0x4a7a('0x17')](_0xbfd33a)[_0x4a7a('0x24')](_0x29c46b);};}exports[_0x4a7a('0x25')]=function(_0xb00f0c,_0x5e2fc5){var _0x4ca31a={},_0x5efaa7={},_0x3e5d61={'count':0x0,'rows':[]};var _0x10092d=_['map'](db[_0x4a7a('0x26')][_0x4a7a('0x27')],function(_0x12a51d){return{'name':_0x12a51d[_0x4a7a('0x28')],'type':_0x12a51d[_0x4a7a('0x29')][_0x4a7a('0x2a')]};});_0x5efaa7[_0x4a7a('0x2b')]=_[_0x4a7a('0x2c')](_0x10092d,_0x4a7a('0x23'));_0x5efaa7[_0x4a7a('0x2d')]=_[_0x4a7a('0x2e')](_0xb00f0c[_0x4a7a('0x2d')]);_0x5efaa7[_0x4a7a('0x2f')]=_[_0x4a7a('0x30')](_0x5efaa7[_0x4a7a('0x2b')],_0x5efaa7[_0x4a7a('0x2d')]);_0x4ca31a[_0x4a7a('0x31')]=_[_0x4a7a('0x30')](_0x5efaa7[_0x4a7a('0x2b')],qs[_0x4a7a('0x32')](_0xb00f0c[_0x4a7a('0x2d')][_0x4a7a('0x32')]));_0x4ca31a['attributes']=_0x4ca31a[_0x4a7a('0x31')]['length']?_0x4ca31a['attributes']:_0x5efaa7[_0x4a7a('0x2b')];if(!_0xb00f0c[_0x4a7a('0x2d')][_0x4a7a('0x33')]('nolimit')){_0x4ca31a[_0x4a7a('0x1b')]=qs[_0x4a7a('0x1b')](_0xb00f0c[_0x4a7a('0x2d')][_0x4a7a('0x1b')]);_0x4ca31a[_0x4a7a('0x1a')]=qs[_0x4a7a('0x1a')](_0xb00f0c['query'][_0x4a7a('0x1a')]);}_0x4ca31a[_0x4a7a('0x34')]=qs[_0x4a7a('0x35')](_0xb00f0c[_0x4a7a('0x2d')][_0x4a7a('0x35')]);_0x4ca31a['where']=qs['filters'](_[_0x4a7a('0x36')](_0xb00f0c['query'],_0x5efaa7[_0x4a7a('0x2f')]),_0x10092d);if(_0xb00f0c[_0x4a7a('0x2d')][_0x4a7a('0x37')]){_0x4ca31a[_0x4a7a('0x38')]=_[_0x4a7a('0x39')](_0x4ca31a[_0x4a7a('0x38')],{'$or':_[_0x4a7a('0x2c')](_0x10092d,function(_0x5d24cf){if(_0x5d24cf['type']!==_0x4a7a('0x3a')){var _0x506377={};_0x506377[_0x5d24cf[_0x4a7a('0x23')]]={'$like':'%'+_0xb00f0c['query'][_0x4a7a('0x37')]+'%'};return _0x506377;}})});}_0x4ca31a=_[_0x4a7a('0x39')]({},_0x4ca31a,_0xb00f0c[_0x4a7a('0x3b')]);var _0x637df3={'where':_0x4ca31a[_0x4a7a('0x38')]};return db[_0x4a7a('0x26')][_0x4a7a('0x3c')](_0x637df3)['then'](function(_0x186122){_0x3e5d61[_0x4a7a('0x3c')]=_0x186122;if(_0xb00f0c['query'][_0x4a7a('0x3d')]){_0x4ca31a[_0x4a7a('0x3e')]=[{'all':!![]}];}return db[_0x4a7a('0x26')][_0x4a7a('0x3f')](_0x4ca31a);})[_0x4a7a('0x21')](function(_0x14e1f2){_0x3e5d61['rows']=_0x14e1f2;return _0x3e5d61;})['then'](respondWithFilteredResult(_0x5e2fc5,_0x4ca31a))[_0x4a7a('0x40')](handleError(_0x5e2fc5,null));};exports[_0x4a7a('0x41')]=function(_0x1981bb,_0x160754){var _0x360bb4={'raw':!![],'where':{'id':_0x1981bb[_0x4a7a('0x42')]['id']}},_0x3ca025={};_0x3ca025[_0x4a7a('0x2b')]=_[_0x4a7a('0x2e')](db[_0x4a7a('0x26')][_0x4a7a('0x27')]);_0x3ca025[_0x4a7a('0x2d')]=_[_0x4a7a('0x2e')](_0x1981bb[_0x4a7a('0x2d')]);_0x3ca025[_0x4a7a('0x2f')]=_['intersection'](_0x3ca025['model'],_0x3ca025[_0x4a7a('0x2d')]);_0x360bb4[_0x4a7a('0x31')]=_[_0x4a7a('0x30')](_0x3ca025['model'],qs[_0x4a7a('0x32')](_0x1981bb[_0x4a7a('0x2d')]['fields']));_0x360bb4['attributes']=_0x360bb4[_0x4a7a('0x31')][_0x4a7a('0x43')]?_0x360bb4[_0x4a7a('0x31')]:_0x3ca025['model'];if(_0x1981bb[_0x4a7a('0x2d')]['includeAll']){_0x360bb4[_0x4a7a('0x3e')]=[{'all':!![]}];}_0x360bb4=_[_0x4a7a('0x39')]({},_0x360bb4,_0x1981bb[_0x4a7a('0x3b')]);return db['SmsQueueReport']['find'](_0x360bb4)['then'](handleEntityNotFound(_0x160754,null))['then'](respondWithResult(_0x160754,null))[_0x4a7a('0x40')](handleError(_0x160754,null));};exports[_0x4a7a('0x44')]=function(_0x14bfd7,_0x263df7){return db[_0x4a7a('0x26')][_0x4a7a('0x44')](_0x14bfd7[_0x4a7a('0x45')],{})['then'](respondWithResult(_0x263df7,0xc9))[_0x4a7a('0x40')](handleError(_0x263df7,null));};exports['update']=function(_0x23fd11,_0x27c7b0){if(_0x23fd11[_0x4a7a('0x45')]['id']){delete _0x23fd11[_0x4a7a('0x45')]['id'];}return db[_0x4a7a('0x26')][_0x4a7a('0x46')]({'where':{'id':_0x23fd11[_0x4a7a('0x42')]['id']}})['then'](handleEntityNotFound(_0x27c7b0,null))['then'](saveUpdates(_0x23fd11[_0x4a7a('0x45')],null))[_0x4a7a('0x21')](respondWithResult(_0x27c7b0,null))[_0x4a7a('0x40')](handleError(_0x27c7b0,null));};exports[_0x4a7a('0x20')]=function(_0x183e46,_0x386707){return db[_0x4a7a('0x26')]['find']({'where':{'id':_0x183e46[_0x4a7a('0x42')]['id']}})[_0x4a7a('0x21')](handleEntityNotFound(_0x386707,null))['then'](removeEntity(_0x386707,null))[_0x4a7a('0x40')](handleError(_0x386707,null));};exports[_0x4a7a('0x47')]=function(_0xc3dbef,_0x66fa51){return db[_0x4a7a('0x26')][_0x4a7a('0x47')]()['then'](respondWithResult(_0x66fa51,null))[_0x4a7a('0x40')](handleError(_0x66fa51,null));}; \ No newline at end of file +var _0xc3d7=['keys','find','create','body','describe','eml-format','zip-dir','request-promise','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsQueueReport','includeAll','include','rows','catch','show','params'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc3d7,0x16d));var _0x7c3d=function(_0x5d7ba4,_0x2883ed){_0x5d7ba4=_0x5d7ba4-0x0;var _0x732c2d=_0xc3d7[_0x5d7ba4];return _0x732c2d;};'use strict';var emlformat=require(_0x7c3d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c3d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c3d('0x2'));var moment=require('moment');var BPromise=require(_0x7c3d('0x3'));var Mustache=require(_0x7c3d('0x4'));var util=require(_0x7c3d('0x5'));var path=require(_0x7c3d('0x6'));var sox=require(_0x7c3d('0x7'));var csv=require(_0x7c3d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c3d('0x9'));var squel=require(_0x7c3d('0xa'));var crypto=require(_0x7c3d('0xb'));var jsforce=require(_0x7c3d('0xc'));var deskjs=require(_0x7c3d('0xd'));var toCsv=require(_0x7c3d('0x8'));var querystring=require(_0x7c3d('0xe'));var Papa=require(_0x7c3d('0xf'));var Redis=require(_0x7c3d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7c3d('0x11'));var as=require(_0x7c3d('0x12'));var hardwareService=require(_0x7c3d('0x13'));var logger=require(_0x7c3d('0x14'))('api');var utils=require(_0x7c3d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7c3d('0x16'));var db=require(_0x7c3d('0x17'))['db'];function respondWithStatusCode(_0x1ff220,_0x445d7b){_0x445d7b=_0x445d7b||0xcc;return function(_0x1d0f3e){if(_0x1d0f3e){return _0x1ff220[_0x7c3d('0x18')](_0x445d7b);}return _0x1ff220[_0x7c3d('0x19')](_0x445d7b)['end']();};}function respondWithResult(_0x4a6d3e,_0x5e160d){_0x5e160d=_0x5e160d||0xc8;return function(_0x49420f){if(_0x49420f){return _0x4a6d3e[_0x7c3d('0x19')](_0x5e160d)[_0x7c3d('0x1a')](_0x49420f);}};}function respondWithFilteredResult(_0x2abd1b,_0x3d1175){return function(_0x3f8e38){if(_0x3f8e38){var _0x43337e=typeof _0x3d1175[_0x7c3d('0x1b')]===_0x7c3d('0x1c')&&typeof _0x3d1175[_0x7c3d('0x1d')]===_0x7c3d('0x1c');var _0x200c3f=_0x3f8e38[_0x7c3d('0x1e')];var _0x20bfa9=_0x43337e?0x0:_0x3d1175[_0x7c3d('0x1b')];var _0x5c5efe=_0x43337e?_0x3f8e38[_0x7c3d('0x1e')]:_0x3d1175[_0x7c3d('0x1b')]+_0x3d1175[_0x7c3d('0x1d')];var _0x4c90dd;if(_0x5c5efe>=_0x200c3f){_0x5c5efe=_0x200c3f;_0x4c90dd=0xc8;}else{_0x4c90dd=0xce;}_0x2abd1b[_0x7c3d('0x19')](_0x4c90dd);return _0x2abd1b[_0x7c3d('0x1f')](_0x7c3d('0x20'),_0x20bfa9+'-'+_0x5c5efe+'/'+_0x200c3f)[_0x7c3d('0x1a')](_0x3f8e38);}return null;};}function patchUpdates(_0x1bb051){return function(_0x72336b){try{jsonpatch['apply'](_0x72336b,_0x1bb051,!![]);}catch(_0x44e8dc){return BPromise[_0x7c3d('0x21')](_0x44e8dc);}return _0x72336b[_0x7c3d('0x22')]();};}function saveUpdates(_0x2e7d8f,_0x5c31bc){return function(_0x175e4a){if(_0x175e4a){return _0x175e4a['update'](_0x2e7d8f)['then'](function(_0x13506b){return _0x13506b;});}return null;};}function removeEntity(_0x43f2de,_0x2a0c11){return function(_0x3f2c93){if(_0x3f2c93){return _0x3f2c93['destroy']()[_0x7c3d('0x23')](function(){_0x43f2de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eeac3,_0x59a41a){return function(_0x6ddc0f){if(!_0x6ddc0f){_0x1eeac3['sendStatus'](0x194);}return _0x6ddc0f;};}function handleError(_0x28b51c,_0x5c6d5e){_0x5c6d5e=_0x5c6d5e||0x1f4;return function(_0x4d3233){logger[_0x7c3d('0x24')](_0x4d3233[_0x7c3d('0x25')]);if(_0x4d3233[_0x7c3d('0x26')]){delete _0x4d3233[_0x7c3d('0x26')];}_0x28b51c[_0x7c3d('0x19')](_0x5c6d5e)[_0x7c3d('0x27')](_0x4d3233);};}exports[_0x7c3d('0x28')]=function(_0x4f9bfe,_0x488038){var _0xff16ad={},_0x24b9eb={},_0x4d5e16={'count':0x0,'rows':[]};var _0xcbb8e1=_[_0x7c3d('0x29')](db['SmsQueueReport'][_0x7c3d('0x2a')],function(_0x36c7a7){return{'name':_0x36c7a7[_0x7c3d('0x2b')],'type':_0x36c7a7['type']['key']};});_0x24b9eb['model']=_[_0x7c3d('0x29')](_0xcbb8e1,'name');_0x24b9eb[_0x7c3d('0x2c')]=_['keys'](_0x4f9bfe[_0x7c3d('0x2c')]);_0x24b9eb[_0x7c3d('0x2d')]=_[_0x7c3d('0x2e')](_0x24b9eb['model'],_0x24b9eb['query']);_0xff16ad[_0x7c3d('0x2f')]=_[_0x7c3d('0x2e')](_0x24b9eb[_0x7c3d('0x30')],qs['fields'](_0x4f9bfe['query'][_0x7c3d('0x31')]));_0xff16ad[_0x7c3d('0x2f')]=_0xff16ad[_0x7c3d('0x2f')][_0x7c3d('0x32')]?_0xff16ad[_0x7c3d('0x2f')]:_0x24b9eb[_0x7c3d('0x30')];if(!_0x4f9bfe[_0x7c3d('0x2c')][_0x7c3d('0x33')]('nolimit')){_0xff16ad[_0x7c3d('0x1d')]=qs[_0x7c3d('0x1d')](_0x4f9bfe[_0x7c3d('0x2c')][_0x7c3d('0x1d')]);_0xff16ad[_0x7c3d('0x1b')]=qs[_0x7c3d('0x1b')](_0x4f9bfe[_0x7c3d('0x2c')][_0x7c3d('0x1b')]);}_0xff16ad[_0x7c3d('0x34')]=qs[_0x7c3d('0x35')](_0x4f9bfe['query'][_0x7c3d('0x35')]);_0xff16ad[_0x7c3d('0x36')]=qs[_0x7c3d('0x2d')](_[_0x7c3d('0x37')](_0x4f9bfe[_0x7c3d('0x2c')],_0x24b9eb[_0x7c3d('0x2d')]),_0xcbb8e1);if(_0x4f9bfe[_0x7c3d('0x2c')][_0x7c3d('0x38')]){_0xff16ad[_0x7c3d('0x36')]=_['merge'](_0xff16ad[_0x7c3d('0x36')],{'$or':_[_0x7c3d('0x29')](_0xcbb8e1,function(_0x1d23ba){if(_0x1d23ba['type']!==_0x7c3d('0x39')){var _0x3860e6={};_0x3860e6[_0x1d23ba[_0x7c3d('0x26')]]={'$like':'%'+_0x4f9bfe[_0x7c3d('0x2c')][_0x7c3d('0x38')]+'%'};return _0x3860e6;}})});}_0xff16ad=_[_0x7c3d('0x3a')]({},_0xff16ad,_0x4f9bfe[_0x7c3d('0x3b')]);var _0x393003={'where':_0xff16ad['where']};return db[_0x7c3d('0x3c')][_0x7c3d('0x1e')](_0x393003)['then'](function(_0xdc6414){_0x4d5e16['count']=_0xdc6414;if(_0x4f9bfe[_0x7c3d('0x2c')][_0x7c3d('0x3d')]){_0xff16ad[_0x7c3d('0x3e')]=[{'all':!![]}];}return db[_0x7c3d('0x3c')]['findAll'](_0xff16ad);})['then'](function(_0x4a9995){_0x4d5e16[_0x7c3d('0x3f')]=_0x4a9995;return _0x4d5e16;})[_0x7c3d('0x23')](respondWithFilteredResult(_0x488038,_0xff16ad))[_0x7c3d('0x40')](handleError(_0x488038,null));};exports[_0x7c3d('0x41')]=function(_0x29c50e,_0x5dd576){var _0x1315b7={'raw':!![],'where':{'id':_0x29c50e[_0x7c3d('0x42')]['id']}},_0x27cd51={};_0x27cd51[_0x7c3d('0x30')]=_[_0x7c3d('0x43')](db[_0x7c3d('0x3c')][_0x7c3d('0x2a')]);_0x27cd51[_0x7c3d('0x2c')]=_[_0x7c3d('0x43')](_0x29c50e[_0x7c3d('0x2c')]);_0x27cd51[_0x7c3d('0x2d')]=_[_0x7c3d('0x2e')](_0x27cd51[_0x7c3d('0x30')],_0x27cd51[_0x7c3d('0x2c')]);_0x1315b7[_0x7c3d('0x2f')]=_[_0x7c3d('0x2e')](_0x27cd51[_0x7c3d('0x30')],qs[_0x7c3d('0x31')](_0x29c50e[_0x7c3d('0x2c')][_0x7c3d('0x31')]));_0x1315b7[_0x7c3d('0x2f')]=_0x1315b7[_0x7c3d('0x2f')]['length']?_0x1315b7['attributes']:_0x27cd51[_0x7c3d('0x30')];if(_0x29c50e[_0x7c3d('0x2c')][_0x7c3d('0x3d')]){_0x1315b7[_0x7c3d('0x3e')]=[{'all':!![]}];}_0x1315b7=_['merge']({},_0x1315b7,_0x29c50e['options']);return db['SmsQueueReport'][_0x7c3d('0x44')](_0x1315b7)[_0x7c3d('0x23')](handleEntityNotFound(_0x5dd576,null))[_0x7c3d('0x23')](respondWithResult(_0x5dd576,null))[_0x7c3d('0x40')](handleError(_0x5dd576,null));};exports['create']=function(_0x413f8e,_0x4950a4){return db[_0x7c3d('0x3c')][_0x7c3d('0x45')](_0x413f8e[_0x7c3d('0x46')],{})[_0x7c3d('0x23')](respondWithResult(_0x4950a4,0xc9))['catch'](handleError(_0x4950a4,null));};exports['update']=function(_0x19afd9,_0x88d189){if(_0x19afd9[_0x7c3d('0x46')]['id']){delete _0x19afd9[_0x7c3d('0x46')]['id'];}return db[_0x7c3d('0x3c')]['find']({'where':{'id':_0x19afd9[_0x7c3d('0x42')]['id']}})[_0x7c3d('0x23')](handleEntityNotFound(_0x88d189,null))[_0x7c3d('0x23')](saveUpdates(_0x19afd9['body'],null))[_0x7c3d('0x23')](respondWithResult(_0x88d189,null))['catch'](handleError(_0x88d189,null));};exports['destroy']=function(_0x3f015b,_0x1f9620){return db['SmsQueueReport'][_0x7c3d('0x44')]({'where':{'id':_0x3f015b['params']['id']}})[_0x7c3d('0x23')](handleEntityNotFound(_0x1f9620,null))[_0x7c3d('0x23')](removeEntity(_0x1f9620,null))[_0x7c3d('0x40')](handleError(_0x1f9620,null));};exports[_0x7c3d('0x47')]=function(_0x40f04e,_0xa30f32){return db[_0x7c3d('0x3c')][_0x7c3d('0x47')]()[_0x7c3d('0x23')](respondWithResult(_0xa30f32,null))['catch'](handleError(_0xa30f32,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index c808395..644ae26 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_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 +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x238544,_0x5672c8){var _0x160b38=function(_0x4a5033){while(--_0x4a5033){_0x238544['push'](_0x238544['shift']());}};_0x160b38(++_0x5672c8);}(_0xb7e7,0x121));var _0x7b7e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xb7e7[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index e254442..c6947da 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 _0xe92d=['attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsQueueReport','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','update','where'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe92d,0x14b));var _0xde92=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe92d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xde92('0x0'));var util=require(_0xde92('0x1'));var moment=require('moment');var BPromise=require(_0xde92('0x2'));var rs=require(_0xde92('0x3'));var fs=require('fs');var Redis=require(_0xde92('0x4'));var db=require(_0xde92('0x5'))['db'];var utils=require(_0xde92('0x6'));var logger=require(_0xde92('0x7'))('rpc');var config=require(_0xde92('0x8'));var jayson=require(_0xde92('0x9'));var client=jayson[_0xde92('0xa')][_0xde92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19b277,_0x4aab10,_0x5e553d){return new BPromise(function(_0x564784,_0x2fc7f3){return client[_0xde92('0xc')](_0x19b277,_0x5e553d)[_0xde92('0xd')](function(_0xd1c143){logger[_0xde92('0xe')](_0xde92('0xf'),_0x4aab10,'request\x20sent');logger[_0xde92('0x10')](_0xde92('0x11'),_0x4aab10,_0xde92('0x12'),JSON[_0xde92('0x13')](_0xd1c143));if(_0xd1c143[_0xde92('0x14')]){if(_0xd1c143[_0xde92('0x14')]['code']===0x1f4){logger[_0xde92('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x4aab10,_0xd1c143[_0xde92('0x14')][_0xde92('0x15')]);return _0x2fc7f3(_0xd1c143[_0xde92('0x14')][_0xde92('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x4aab10,_0xd1c143['error']['message']);return _0x564784(_0xd1c143[_0xde92('0x14')][_0xde92('0x15')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x4aab10,_0xde92('0x12'));_0x564784(_0xd1c143[_0xde92('0x16')][_0xde92('0x15')]);}})[_0xde92('0x17')](function(_0x335005){logger['error'](_0xde92('0xf'),_0x4aab10,_0x335005);_0x2fc7f3(_0x335005);});});}exports[_0xde92('0x18')]=function(_0x119ef3){var _0x4b9294=this;return new Promise(function(_0xb3cfa8,_0x579ae0){return db['SmsQueueReport']['create'](_0x119ef3[_0xde92('0x19')],{'raw':_0x119ef3[_0xde92('0x1a')]?_0x119ef3['options'][_0xde92('0x1b')]===undefined?!![]:![]:!![]})[_0xde92('0xd')](function(_0x2b1438){logger[_0xde92('0xe')](_0xde92('0x18'),_0x119ef3);logger[_0xde92('0x10')](_0xde92('0x18'),_0x119ef3,JSON['stringify'](_0x2b1438));_0xb3cfa8(_0x2b1438);})[_0xde92('0x17')](function(_0x2cf47e){logger[_0xde92('0x14')](_0xde92('0x18'),_0x2cf47e[_0xde92('0x15')],_0x119ef3);_0x579ae0(_0x4b9294[_0xde92('0x14')](0x1f4,_0x2cf47e[_0xde92('0x15')]));});});};exports[_0xde92('0x1c')]=function(_0x453830){var _0x19ff5f=this;return new Promise(function(_0x2ac3ad,_0x9c8981){return db[_0xde92('0x1d')][_0xde92('0x1e')](_0x453830[_0xde92('0x19')],{'raw':_0x453830['options']?_0x453830[_0xde92('0x1a')][_0xde92('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453830[_0xde92('0x1a')]?_0x453830[_0xde92('0x1a')][_0xde92('0x1f')]||null:null,'attributes':_0x453830['options']?_0x453830[_0xde92('0x1a')][_0xde92('0x20')]||null:null,'limit':_0x453830[_0xde92('0x1a')]?_0x453830[_0xde92('0x1a')]['limit']||null:null})[_0xde92('0xd')](function(_0x269c6b){logger[_0xde92('0xe')](_0xde92('0x1c'),_0x453830);logger[_0xde92('0x10')]('UpdateSmsQueueReport',_0x453830,JSON[_0xde92('0x13')](_0x269c6b));_0x2ac3ad(_0x269c6b);})[_0xde92('0x17')](function(_0x5797ae){logger[_0xde92('0x14')](_0xde92('0x1c'),_0x5797ae[_0xde92('0x15')],_0x453830);_0x9c8981(_0x19ff5f['error'](0x1f4,_0x5797ae['message']));});});}; \ No newline at end of file +var _0x14af=['result','CreateSmsQueueReport','SmsQueueReport','create','body','options','then','catch','UpdateSmsQueueReport','update','raw','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2a1948,_0xfff739){var _0x4e3eb2=function(_0x145e83){while(--_0x145e83){_0x2a1948['push'](_0x2a1948['shift']());}};_0x4e3eb2(++_0xfff739);}(_0x14af,0xb7));var _0xf14a=function(_0x549876,_0x66473f){_0x549876=_0x549876-0x0;var _0x242552=_0x14af[_0x549876];return _0x242552;};'use strict';var _=require(_0xf14a('0x0'));var util=require(_0xf14a('0x1'));var moment=require(_0xf14a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf14a('0x3'));var fs=require('fs');var Redis=require(_0xf14a('0x4'));var db=require(_0xf14a('0x5'))['db'];var utils=require(_0xf14a('0x6'));var logger=require(_0xf14a('0x7'))(_0xf14a('0x8'));var config=require(_0xf14a('0x9'));var jayson=require(_0xf14a('0xa'));var client=jayson[_0xf14a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fcd55,_0x142582,_0x20b6f7){return new BPromise(function(_0xf13538,_0x32d6bc){return client[_0xf14a('0xc')](_0x2fcd55,_0x20b6f7)['then'](function(_0x40a796){logger['info'](_0xf14a('0xd'),_0x142582,'request\x20sent');logger[_0xf14a('0xe')](_0xf14a('0xf'),_0x142582,'request\x20sent',JSON[_0xf14a('0x10')](_0x40a796));if(_0x40a796[_0xf14a('0x11')]){if(_0x40a796[_0xf14a('0x11')][_0xf14a('0x12')]===0x1f4){logger['error'](_0xf14a('0xd'),_0x142582,_0x40a796[_0xf14a('0x11')][_0xf14a('0x13')]);return _0x32d6bc(_0x40a796[_0xf14a('0x11')]['message']);}logger[_0xf14a('0x11')](_0xf14a('0xd'),_0x142582,_0x40a796['error']['message']);return _0xf13538(_0x40a796[_0xf14a('0x11')]['message']);}else{logger[_0xf14a('0x14')](_0xf14a('0xd'),_0x142582,'request\x20sent');_0xf13538(_0x40a796[_0xf14a('0x15')][_0xf14a('0x13')]);}})['catch'](function(_0x39bd3e){logger[_0xf14a('0x11')](_0xf14a('0xd'),_0x142582,_0x39bd3e);_0x32d6bc(_0x39bd3e);});});}exports[_0xf14a('0x16')]=function(_0x23d93e){var _0x21b357=this;return new Promise(function(_0x838a48,_0x3b4758){return db[_0xf14a('0x17')][_0xf14a('0x18')](_0x23d93e[_0xf14a('0x19')],{'raw':_0x23d93e['options']?_0x23d93e[_0xf14a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xf14a('0x1b')](function(_0x301429){logger['info'](_0xf14a('0x16'),_0x23d93e);logger[_0xf14a('0xe')](_0xf14a('0x16'),_0x23d93e,JSON['stringify'](_0x301429));_0x838a48(_0x301429);})[_0xf14a('0x1c')](function(_0x85cfef){logger[_0xf14a('0x11')](_0xf14a('0x16'),_0x85cfef[_0xf14a('0x13')],_0x23d93e);_0x3b4758(_0x21b357[_0xf14a('0x11')](0x1f4,_0x85cfef[_0xf14a('0x13')]));});});};exports[_0xf14a('0x1d')]=function(_0x1f7508){var _0x22c069=this;return new Promise(function(_0x284fa3,_0x2e8c2b){return db['SmsQueueReport'][_0xf14a('0x1e')](_0x1f7508[_0xf14a('0x19')],{'raw':_0x1f7508[_0xf14a('0x1a')]?_0x1f7508[_0xf14a('0x1a')][_0xf14a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f7508[_0xf14a('0x1a')]?_0x1f7508[_0xf14a('0x1a')]['where']||null:null,'attributes':_0x1f7508[_0xf14a('0x1a')]?_0x1f7508['options'][_0xf14a('0x20')]||null:null,'limit':_0x1f7508[_0xf14a('0x1a')]?_0x1f7508[_0xf14a('0x1a')][_0xf14a('0x21')]||null:null})[_0xf14a('0x1b')](function(_0x258cad){logger[_0xf14a('0x14')](_0xf14a('0x1d'),_0x1f7508);logger[_0xf14a('0xe')]('UpdateSmsQueueReport',_0x1f7508,JSON[_0xf14a('0x10')](_0x258cad));_0x284fa3(_0x258cad);})['catch'](function(_0x15119f){logger['error'](_0xf14a('0x1d'),_0x15119f[_0xf14a('0x13')],_0x1f7508);_0x2e8c2b(_0x22c069['error'](0x1f4,_0x15119f[_0xf14a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index e9970ca..7f027cf 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 _0x7217=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x7217,0x19e));var _0x7721=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7217[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe0ae=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','index','get','/describe','isAuthenticated','show','post','put','/:id','update'];(function(_0x2f7071,_0x1fc3aa){var _0x34a39c=function(_0x1d23df){while(--_0x1d23df){_0x2f7071['push'](_0x2f7071['shift']());}};_0x34a39c(++_0x1fc3aa);}(_0xe0ae,0xa1));var _0xee0a=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0xe0ae[_0x29df9a];return _0x3a8e96;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xee0a('0x3'));var interaction=require(_0xee0a('0x4'));var config=require('../../config/environment');var controller=require(_0xee0a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xee0a('0x6')]);router[_0xee0a('0x7')](_0xee0a('0x8'),auth[_0xee0a('0x9')](),controller['describe']);router[_0xee0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xee0a('0xa')]);router[_0xee0a('0xb')]('/',auth[_0xee0a('0x9')](),controller['create']);router[_0xee0a('0xc')](_0xee0a('0xd'),auth['isAuthenticated'](),controller[_0xee0a('0xe')]);router['delete'](_0xee0a('0xd'),auth[_0xee0a('0x9')](),controller['destroy']);module[_0xee0a('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 8124c09..582d7f3 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1d2e03,_0xd23d3c){var _0x3abaff=function(_0x2897ff){while(--_0x2897ff){_0x1d2e03['push'](_0x1d2e03['shift']());}};_0x3abaff(++_0xd23d3c);}(_0xe706,0xa3));var _0x6e70=function(_0x15482e,_0x25b23c){_0x15482e=_0x15482e-0x0;var _0x4a0651=_0xe706[_0x15482e];return _0x4a0651;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0xb43b,0x1b2));var _0xbb43=function(_0x57145a,_0x5dfa91){_0x57145a=_0x57145a-0x0;var _0x1c75f1=_0xb43b[_0x57145a];return _0x1c75f1;};'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 2c6ad9c..eff9ea5 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 _0x35ba=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','SmsTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0x35ba,0x174));var _0xa35b=function(_0x330a51,_0x42c33b){_0x330a51=_0x330a51-0x0;var _0x55aa63=_0x35ba[_0x330a51];return _0x55aa63;};'use strict';var emlformat=require(_0xa35b('0x0'));var rimraf=require(_0xa35b('0x1'));var zipdir=require(_0xa35b('0x2'));var jsonpatch=require(_0xa35b('0x3'));var rp=require(_0xa35b('0x4'));var moment=require('moment');var BPromise=require(_0xa35b('0x5'));var Mustache=require(_0xa35b('0x6'));var util=require(_0xa35b('0x7'));var path=require(_0xa35b('0x8'));var sox=require('sox');var csv=require(_0xa35b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa35b('0xa'));var _=require(_0xa35b('0xb'));var squel=require(_0xa35b('0xc'));var crypto=require(_0xa35b('0xd'));var jsforce=require(_0xa35b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa35b('0xf'));var Papa=require(_0xa35b('0x10'));var Redis=require(_0xa35b('0x11'));var authService=require(_0xa35b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa35b('0x13'));var hardwareService=require(_0xa35b('0x14'));var logger=require(_0xa35b('0x15'))('api');var utils=require(_0xa35b('0x16'));var config=require(_0xa35b('0x17'));var licenseUtil=require(_0xa35b('0x18'));var db=require(_0xa35b('0x19'))['db'];function respondWithStatusCode(_0x1a2bae,_0x37e96b){_0x37e96b=_0x37e96b||0xcc;return function(_0x2c06e9){if(_0x2c06e9){return _0x1a2bae['sendStatus'](_0x37e96b);}return _0x1a2bae[_0xa35b('0x1a')](_0x37e96b)[_0xa35b('0x1b')]();};}function respondWithResult(_0x4138df,_0x462e85){_0x462e85=_0x462e85||0xc8;return function(_0x550a6f){if(_0x550a6f){return _0x4138df[_0xa35b('0x1a')](_0x462e85)['json'](_0x550a6f);}};}function respondWithFilteredResult(_0x4823b3,_0x14973b){return function(_0x59cb6b){if(_0x59cb6b){var _0x2bca02=typeof _0x14973b[_0xa35b('0x1c')]===_0xa35b('0x1d')&&typeof _0x14973b[_0xa35b('0x1e')]===_0xa35b('0x1d');var _0x3796fd=_0x59cb6b['count'];var _0x52af4b=_0x2bca02?0x0:_0x14973b[_0xa35b('0x1c')];var _0x5b0baf=_0x2bca02?_0x59cb6b[_0xa35b('0x1f')]:_0x14973b[_0xa35b('0x1c')]+_0x14973b[_0xa35b('0x1e')];var _0x488053;if(_0x5b0baf>=_0x3796fd){_0x5b0baf=_0x3796fd;_0x488053=0xc8;}else{_0x488053=0xce;}_0x4823b3[_0xa35b('0x1a')](_0x488053);return _0x4823b3[_0xa35b('0x20')](_0xa35b('0x21'),_0x52af4b+'-'+_0x5b0baf+'/'+_0x3796fd)[_0xa35b('0x22')](_0x59cb6b);}return null;};}function patchUpdates(_0x3ed14d){return function(_0x753ac8){try{jsonpatch[_0xa35b('0x23')](_0x753ac8,_0x3ed14d,!![]);}catch(_0xbb1dea){return BPromise[_0xa35b('0x24')](_0xbb1dea);}return _0x753ac8['save']();};}function saveUpdates(_0x159bb6,_0x39a6d5){return function(_0x359cb9){if(_0x359cb9){return _0x359cb9[_0xa35b('0x25')](_0x159bb6)[_0xa35b('0x26')](function(_0x40fadc){return _0x40fadc;});}return null;};}function removeEntity(_0x67d7d8,_0x37cd6a){return function(_0x1f0ae0){if(_0x1f0ae0){return _0x1f0ae0['destroy']()[_0xa35b('0x26')](function(){_0x67d7d8[_0xa35b('0x1a')](0xcc)[_0xa35b('0x1b')]();});}};}function handleEntityNotFound(_0x2498f1,_0x12e54d){return function(_0x36c5c0){if(!_0x36c5c0){_0x2498f1[_0xa35b('0x27')](0x194);}return _0x36c5c0;};}function handleError(_0x63bfac,_0xa4798){_0xa4798=_0xa4798||0x1f4;return function(_0x1ff67c){logger[_0xa35b('0x28')](_0x1ff67c[_0xa35b('0x29')]);if(_0x1ff67c['name']){delete _0x1ff67c[_0xa35b('0x2a')];}_0x63bfac['status'](_0xa4798)[_0xa35b('0x2b')](_0x1ff67c);};}exports['index']=function(_0x516b53,_0x3615c0){var _0xf2485f={},_0x1748ca={},_0x89b0={'count':0x0,'rows':[]};var _0x318498=_['map'](db[_0xa35b('0x2c')][_0xa35b('0x2d')],function(_0x5a93e9){return{'name':_0x5a93e9[_0xa35b('0x2e')],'type':_0x5a93e9[_0xa35b('0x2f')][_0xa35b('0x30')]};});_0x1748ca['model']=_[_0xa35b('0x31')](_0x318498,'name');_0x1748ca[_0xa35b('0x32')]=_[_0xa35b('0x33')](_0x516b53[_0xa35b('0x32')]);_0x1748ca[_0xa35b('0x34')]=_[_0xa35b('0x35')](_0x1748ca['model'],_0x1748ca['query']);_0xf2485f[_0xa35b('0x36')]=_[_0xa35b('0x35')](_0x1748ca[_0xa35b('0x37')],qs[_0xa35b('0x38')](_0x516b53[_0xa35b('0x32')]['fields']));_0xf2485f[_0xa35b('0x36')]=_0xf2485f['attributes'][_0xa35b('0x39')]?_0xf2485f[_0xa35b('0x36')]:_0x1748ca[_0xa35b('0x37')];if(!_0x516b53['query'][_0xa35b('0x3a')](_0xa35b('0x3b'))){_0xf2485f[_0xa35b('0x1e')]=qs[_0xa35b('0x1e')](_0x516b53[_0xa35b('0x32')][_0xa35b('0x1e')]);_0xf2485f[_0xa35b('0x1c')]=qs[_0xa35b('0x1c')](_0x516b53[_0xa35b('0x32')][_0xa35b('0x1c')]);}_0xf2485f[_0xa35b('0x3c')]=qs[_0xa35b('0x3d')](_0x516b53[_0xa35b('0x32')][_0xa35b('0x3d')]);_0xf2485f[_0xa35b('0x3e')]=qs[_0xa35b('0x34')](_[_0xa35b('0x3f')](_0x516b53[_0xa35b('0x32')],_0x1748ca['filters']),_0x318498);if(_0x516b53[_0xa35b('0x32')]['filter']){_0xf2485f[_0xa35b('0x3e')]=_[_0xa35b('0x40')](_0xf2485f[_0xa35b('0x3e')],{'$or':_[_0xa35b('0x31')](_0x318498,function(_0x2011ff){if(_0x2011ff[_0xa35b('0x2f')]!=='VIRTUAL'){var _0xe38c2f={};_0xe38c2f[_0x2011ff['name']]={'$like':'%'+_0x516b53[_0xa35b('0x32')]['filter']+'%'};return _0xe38c2f;}})});}_0xf2485f=_[_0xa35b('0x40')]({},_0xf2485f,_0x516b53['options']);var _0x1b8db7={'where':_0xf2485f['where']};return db['SmsTransferReport']['count'](_0x1b8db7)[_0xa35b('0x26')](function(_0x418d5d){_0x89b0[_0xa35b('0x1f')]=_0x418d5d;if(_0x516b53[_0xa35b('0x32')][_0xa35b('0x41')]){_0xf2485f['include']=[{'all':!![]}];}return db[_0xa35b('0x2c')][_0xa35b('0x42')](_0xf2485f);})[_0xa35b('0x26')](function(_0x466ac0){_0x89b0[_0xa35b('0x43')]=_0x466ac0;return _0x89b0;})[_0xa35b('0x26')](respondWithFilteredResult(_0x3615c0,_0xf2485f))[_0xa35b('0x44')](handleError(_0x3615c0,null));};exports[_0xa35b('0x45')]=function(_0x16e144,_0x504fc7){var _0x41534e={'raw':!![],'where':{'id':_0x16e144[_0xa35b('0x46')]['id']}},_0x30b132={};_0x30b132['model']=_[_0xa35b('0x33')](db[_0xa35b('0x2c')][_0xa35b('0x2d')]);_0x30b132['query']=_[_0xa35b('0x33')](_0x16e144[_0xa35b('0x32')]);_0x30b132[_0xa35b('0x34')]=_[_0xa35b('0x35')](_0x30b132['model'],_0x30b132[_0xa35b('0x32')]);_0x41534e[_0xa35b('0x36')]=_['intersection'](_0x30b132[_0xa35b('0x37')],qs[_0xa35b('0x38')](_0x16e144[_0xa35b('0x32')][_0xa35b('0x38')]));_0x41534e['attributes']=_0x41534e[_0xa35b('0x36')][_0xa35b('0x39')]?_0x41534e[_0xa35b('0x36')]:_0x30b132['model'];if(_0x16e144[_0xa35b('0x32')][_0xa35b('0x41')]){_0x41534e[_0xa35b('0x47')]=[{'all':!![]}];}_0x41534e=_[_0xa35b('0x40')]({},_0x41534e,_0x16e144[_0xa35b('0x48')]);return db[_0xa35b('0x2c')][_0xa35b('0x49')](_0x41534e)['then'](handleEntityNotFound(_0x504fc7,null))[_0xa35b('0x26')](respondWithResult(_0x504fc7,null))[_0xa35b('0x44')](handleError(_0x504fc7,null));};exports[_0xa35b('0x4a')]=function(_0x19c345,_0x561a75){return db[_0xa35b('0x2c')][_0xa35b('0x4a')](_0x19c345[_0xa35b('0x4b')],{})[_0xa35b('0x26')](respondWithResult(_0x561a75,0xc9))['catch'](handleError(_0x561a75,null));};exports[_0xa35b('0x25')]=function(_0x103409,_0x816fbb){if(_0x103409[_0xa35b('0x4b')]['id']){delete _0x103409[_0xa35b('0x4b')]['id'];}return db['SmsTransferReport'][_0xa35b('0x49')]({'where':{'id':_0x103409[_0xa35b('0x46')]['id']}})[_0xa35b('0x26')](handleEntityNotFound(_0x816fbb,null))[_0xa35b('0x26')](saveUpdates(_0x103409[_0xa35b('0x4b')],null))[_0xa35b('0x26')](respondWithResult(_0x816fbb,null))[_0xa35b('0x44')](handleError(_0x816fbb,null));};exports[_0xa35b('0x4c')]=function(_0x2c3f0a,_0x51da01){return db['SmsTransferReport'][_0xa35b('0x49')]({'where':{'id':_0x2c3f0a[_0xa35b('0x46')]['id']}})[_0xa35b('0x26')](handleEntityNotFound(_0x51da01,null))[_0xa35b('0x26')](removeEntity(_0x51da01,null))[_0xa35b('0x44')](handleError(_0x51da01,null));};exports['describe']=function(_0x1a7aae,_0x343e34){return db['SmsTransferReport']['describe']()[_0xa35b('0x26')](respondWithResult(_0x343e34,null))[_0xa35b('0x44')](handleError(_0x343e34,null));}; \ No newline at end of file +var _0xc351=['where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','pick','filter'];(function(_0x5a173c,_0x3b0f31){var _0x3502bd=function(_0xfff149){while(--_0xfff149){_0x5a173c['push'](_0x5a173c['shift']());}};_0x3502bd(++_0x3b0f31);}(_0xc351,0x148));var _0x1c35=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xc351[_0x54defc];return _0x1955d3;};'use strict';var emlformat=require(_0x1c35('0x0'));var rimraf=require(_0x1c35('0x1'));var zipdir=require(_0x1c35('0x2'));var jsonpatch=require(_0x1c35('0x3'));var rp=require(_0x1c35('0x4'));var moment=require('moment');var BPromise=require(_0x1c35('0x5'));var Mustache=require(_0x1c35('0x6'));var util=require('util');var path=require(_0x1c35('0x7'));var sox=require(_0x1c35('0x8'));var csv=require(_0x1c35('0x9'));var ejs=require(_0x1c35('0xa'));var fs=require('fs');var fs_extra=require(_0x1c35('0xb'));var _=require(_0x1c35('0xc'));var squel=require(_0x1c35('0xd'));var crypto=require(_0x1c35('0xe'));var jsforce=require(_0x1c35('0xf'));var deskjs=require(_0x1c35('0x10'));var toCsv=require(_0x1c35('0x9'));var querystring=require(_0x1c35('0x11'));var Papa=require(_0x1c35('0x12'));var Redis=require(_0x1c35('0x13'));var authService=require(_0x1c35('0x14'));var qs=require(_0x1c35('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c35('0x16'))('api');var utils=require(_0x1c35('0x17'));var config=require(_0x1c35('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x138006,_0x157c43){_0x157c43=_0x157c43||0xcc;return function(_0x4b0d68){if(_0x4b0d68){return _0x138006['sendStatus'](_0x157c43);}return _0x138006[_0x1c35('0x19')](_0x157c43)['end']();};}function respondWithResult(_0x195b4c,_0x556eae){_0x556eae=_0x556eae||0xc8;return function(_0x43595f){if(_0x43595f){return _0x195b4c[_0x1c35('0x19')](_0x556eae)[_0x1c35('0x1a')](_0x43595f);}};}function respondWithFilteredResult(_0x5ad9d0,_0x4bcc15){return function(_0x31f680){if(_0x31f680){var _0x2721b3=typeof _0x4bcc15[_0x1c35('0x1b')]===_0x1c35('0x1c')&&typeof _0x4bcc15[_0x1c35('0x1d')]===_0x1c35('0x1c');var _0xeae0f1=_0x31f680[_0x1c35('0x1e')];var _0x56ded8=_0x2721b3?0x0:_0x4bcc15[_0x1c35('0x1b')];var _0x48cf1=_0x2721b3?_0x31f680['count']:_0x4bcc15['offset']+_0x4bcc15[_0x1c35('0x1d')];var _0x362615;if(_0x48cf1>=_0xeae0f1){_0x48cf1=_0xeae0f1;_0x362615=0xc8;}else{_0x362615=0xce;}_0x5ad9d0[_0x1c35('0x19')](_0x362615);return _0x5ad9d0['set'](_0x1c35('0x1f'),_0x56ded8+'-'+_0x48cf1+'/'+_0xeae0f1)[_0x1c35('0x1a')](_0x31f680);}return null;};}function patchUpdates(_0x560d38){return function(_0x393af6){try{jsonpatch[_0x1c35('0x20')](_0x393af6,_0x560d38,!![]);}catch(_0x57558c){return BPromise[_0x1c35('0x21')](_0x57558c);}return _0x393af6[_0x1c35('0x22')]();};}function saveUpdates(_0x3fcdda,_0x9c110e){return function(_0x241e24){if(_0x241e24){return _0x241e24[_0x1c35('0x23')](_0x3fcdda)[_0x1c35('0x24')](function(_0x507c98){return _0x507c98;});}return null;};}function removeEntity(_0x193938,_0x25fa4d){return function(_0x75c749){if(_0x75c749){return _0x75c749[_0x1c35('0x25')]()['then'](function(){_0x193938[_0x1c35('0x19')](0xcc)[_0x1c35('0x26')]();});}};}function handleEntityNotFound(_0x564ba3,_0x346eee){return function(_0x141b30){if(!_0x141b30){_0x564ba3[_0x1c35('0x27')](0x194);}return _0x141b30;};}function handleError(_0x2195a7,_0x5398b4){_0x5398b4=_0x5398b4||0x1f4;return function(_0x4e00ac){logger[_0x1c35('0x28')](_0x4e00ac[_0x1c35('0x29')]);if(_0x4e00ac[_0x1c35('0x2a')]){delete _0x4e00ac[_0x1c35('0x2a')];}_0x2195a7[_0x1c35('0x19')](_0x5398b4)[_0x1c35('0x2b')](_0x4e00ac);};}exports[_0x1c35('0x2c')]=function(_0x3cefe9,_0x4760d6){var _0x2642b5={},_0x2360c9={},_0x1edbf7={'count':0x0,'rows':[]};var _0x5d1b86=_['map'](db[_0x1c35('0x2d')][_0x1c35('0x2e')],function(_0x2f10f9){return{'name':_0x2f10f9[_0x1c35('0x2f')],'type':_0x2f10f9[_0x1c35('0x30')][_0x1c35('0x31')]};});_0x2360c9[_0x1c35('0x32')]=_[_0x1c35('0x33')](_0x5d1b86,_0x1c35('0x2a'));_0x2360c9[_0x1c35('0x34')]=_[_0x1c35('0x35')](_0x3cefe9[_0x1c35('0x34')]);_0x2360c9[_0x1c35('0x36')]=_[_0x1c35('0x37')](_0x2360c9['model'],_0x2360c9[_0x1c35('0x34')]);_0x2642b5['attributes']=_[_0x1c35('0x37')](_0x2360c9[_0x1c35('0x32')],qs['fields'](_0x3cefe9[_0x1c35('0x34')]['fields']));_0x2642b5[_0x1c35('0x38')]=_0x2642b5[_0x1c35('0x38')][_0x1c35('0x39')]?_0x2642b5[_0x1c35('0x38')]:_0x2360c9['model'];if(!_0x3cefe9['query']['hasOwnProperty']('nolimit')){_0x2642b5[_0x1c35('0x1d')]=qs['limit'](_0x3cefe9['query'][_0x1c35('0x1d')]);_0x2642b5[_0x1c35('0x1b')]=qs['offset'](_0x3cefe9[_0x1c35('0x34')]['offset']);}_0x2642b5[_0x1c35('0x3a')]=qs['sort'](_0x3cefe9[_0x1c35('0x34')][_0x1c35('0x3b')]);_0x2642b5['where']=qs[_0x1c35('0x36')](_[_0x1c35('0x3c')](_0x3cefe9['query'],_0x2360c9[_0x1c35('0x36')]),_0x5d1b86);if(_0x3cefe9['query'][_0x1c35('0x3d')]){_0x2642b5[_0x1c35('0x3e')]=_[_0x1c35('0x3f')](_0x2642b5['where'],{'$or':_[_0x1c35('0x33')](_0x5d1b86,function(_0x3f515e){if(_0x3f515e[_0x1c35('0x30')]!==_0x1c35('0x40')){var _0x283b9a={};_0x283b9a[_0x3f515e[_0x1c35('0x2a')]]={'$like':'%'+_0x3cefe9[_0x1c35('0x34')]['filter']+'%'};return _0x283b9a;}})});}_0x2642b5=_['merge']({},_0x2642b5,_0x3cefe9['options']);var _0x5721c6={'where':_0x2642b5[_0x1c35('0x3e')]};return db['SmsTransferReport'][_0x1c35('0x1e')](_0x5721c6)[_0x1c35('0x24')](function(_0x754161){_0x1edbf7['count']=_0x754161;if(_0x3cefe9[_0x1c35('0x34')][_0x1c35('0x41')]){_0x2642b5[_0x1c35('0x42')]=[{'all':!![]}];}return db[_0x1c35('0x2d')][_0x1c35('0x43')](_0x2642b5);})[_0x1c35('0x24')](function(_0x5e8772){_0x1edbf7[_0x1c35('0x44')]=_0x5e8772;return _0x1edbf7;})[_0x1c35('0x24')](respondWithFilteredResult(_0x4760d6,_0x2642b5))[_0x1c35('0x45')](handleError(_0x4760d6,null));};exports[_0x1c35('0x46')]=function(_0x3832ee,_0x32bfd3){var _0x1b506d={'raw':!![],'where':{'id':_0x3832ee['params']['id']}},_0x38d51c={};_0x38d51c[_0x1c35('0x32')]=_[_0x1c35('0x35')](db[_0x1c35('0x2d')][_0x1c35('0x2e')]);_0x38d51c[_0x1c35('0x34')]=_['keys'](_0x3832ee[_0x1c35('0x34')]);_0x38d51c['filters']=_[_0x1c35('0x37')](_0x38d51c[_0x1c35('0x32')],_0x38d51c['query']);_0x1b506d[_0x1c35('0x38')]=_[_0x1c35('0x37')](_0x38d51c[_0x1c35('0x32')],qs['fields'](_0x3832ee['query'][_0x1c35('0x47')]));_0x1b506d[_0x1c35('0x38')]=_0x1b506d[_0x1c35('0x38')]['length']?_0x1b506d[_0x1c35('0x38')]:_0x38d51c['model'];if(_0x3832ee[_0x1c35('0x34')][_0x1c35('0x41')]){_0x1b506d[_0x1c35('0x42')]=[{'all':!![]}];}_0x1b506d=_[_0x1c35('0x3f')]({},_0x1b506d,_0x3832ee[_0x1c35('0x48')]);return db['SmsTransferReport'][_0x1c35('0x49')](_0x1b506d)[_0x1c35('0x24')](handleEntityNotFound(_0x32bfd3,null))[_0x1c35('0x24')](respondWithResult(_0x32bfd3,null))[_0x1c35('0x45')](handleError(_0x32bfd3,null));};exports[_0x1c35('0x4a')]=function(_0x5585f7,_0x3266db){return db[_0x1c35('0x2d')][_0x1c35('0x4a')](_0x5585f7[_0x1c35('0x4b')],{})[_0x1c35('0x24')](respondWithResult(_0x3266db,0xc9))[_0x1c35('0x45')](handleError(_0x3266db,null));};exports[_0x1c35('0x23')]=function(_0x107162,_0x3ffe18){if(_0x107162[_0x1c35('0x4b')]['id']){delete _0x107162[_0x1c35('0x4b')]['id'];}return db[_0x1c35('0x2d')][_0x1c35('0x49')]({'where':{'id':_0x107162[_0x1c35('0x4c')]['id']}})[_0x1c35('0x24')](handleEntityNotFound(_0x3ffe18,null))['then'](saveUpdates(_0x107162[_0x1c35('0x4b')],null))[_0x1c35('0x24')](respondWithResult(_0x3ffe18,null))[_0x1c35('0x45')](handleError(_0x3ffe18,null));};exports[_0x1c35('0x25')]=function(_0x418282,_0x227bf9){return db[_0x1c35('0x2d')][_0x1c35('0x49')]({'where':{'id':_0x418282[_0x1c35('0x4c')]['id']}})[_0x1c35('0x24')](handleEntityNotFound(_0x227bf9,null))[_0x1c35('0x24')](removeEntity(_0x227bf9,null))[_0x1c35('0x45')](handleError(_0x227bf9,null));};exports['describe']=function(_0x54de6c,_0x21eea1){return db[_0x1c35('0x2d')][_0x1c35('0x4d')]()[_0x1c35('0x24')](respondWithResult(_0x21eea1,null))['catch'](handleError(_0x21eea1,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7a8ee23..877cad0 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 _0x3d3e=['./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x561f02,_0x524768){var _0x15d2a9=function(_0x523bda){while(--_0x523bda){_0x561f02['push'](_0x561f02['shift']());}};_0x15d2a9(++_0x524768);}(_0x3d3e,0x155));var _0xe3d3=function(_0x1ebbcf,_0x577e2a){_0x1ebbcf=_0x1ebbcf-0x0;var _0x42e5d4=_0x3d3e[_0x1ebbcf];return _0x42e5d4;};'use strict';var _=require(_0xe3d3('0x0'));var util=require(_0xe3d3('0x1'));var logger=require(_0xe3d3('0x2'))('api');var moment=require(_0xe3d3('0x3'));var BPromise=require(_0xe3d3('0x4'));var rp=require(_0xe3d3('0x5'));var fs=require('fs');var path=require(_0xe3d3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe3d3('0x7'));module['exports']=function(_0x512389,_0x3a5d73){return _0x512389[_0xe3d3('0x8')](_0xe3d3('0x9'),attributes,{'tableName':_0xe3d3('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d3('0xb'),'fields':[_0xe3d3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x303a=['bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','lodash','../../config/logger','api','moment'];(function(_0x5dd8e2,_0x4e9323){var _0x1b84d9=function(_0x34cb2f){while(--_0x34cb2f){_0x5dd8e2['push'](_0x5dd8e2['shift']());}};_0x1b84d9(++_0x4e9323);}(_0x303a,0x1a0));var _0xa303=function(_0x361ecd,_0x32451e){_0x361ecd=_0x361ecd-0x0;var _0x31942f=_0x303a[_0x361ecd];return _0x31942f;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index de62fac..54dd6bb 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 _0xf3ff=['error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3b1953,_0x520449){var _0x896cca=function(_0xce4453){while(--_0xce4453){_0x3b1953['push'](_0x3b1953['shift']());}};_0x896cca(++_0x520449);}(_0xf3ff,0xae));var _0xff3f=function(_0x3ff002,_0x16047d){_0x3ff002=_0x3ff002-0x0;var _0x3bf573=_0xf3ff[_0x3ff002];return _0x3bf573;};'use strict';var _=require(_0xff3f('0x0'));var util=require('util');var moment=require(_0xff3f('0x1'));var BPromise=require(_0xff3f('0x2'));var rs=require(_0xff3f('0x3'));var fs=require('fs');var Redis=require(_0xff3f('0x4'));var db=require(_0xff3f('0x5'))['db'];var utils=require(_0xff3f('0x6'));var logger=require('../../config/logger')(_0xff3f('0x7'));var config=require(_0xff3f('0x8'));var jayson=require(_0xff3f('0x9'));var client=jayson['client'][_0xff3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45a86f,_0x5568d0,_0x465c8a){return new BPromise(function(_0x1543bf,_0x5c1d76){return client['request'](_0x45a86f,_0x465c8a)['then'](function(_0x34df96){logger['info'](_0xff3f('0xb'),_0x5568d0,'request\x20sent');logger[_0xff3f('0xc')](_0xff3f('0xd'),_0x5568d0,_0xff3f('0xe'),JSON[_0xff3f('0xf')](_0x34df96));if(_0x34df96[_0xff3f('0x10')]){if(_0x34df96[_0xff3f('0x10')][_0xff3f('0x11')]===0x1f4){logger[_0xff3f('0x10')](_0xff3f('0xb'),_0x5568d0,_0x34df96[_0xff3f('0x10')]['message']);return _0x5c1d76(_0x34df96['error'][_0xff3f('0x12')]);}logger[_0xff3f('0x10')](_0xff3f('0xb'),_0x5568d0,_0x34df96['error']['message']);return _0x1543bf(_0x34df96[_0xff3f('0x10')]['message']);}else{logger['info'](_0xff3f('0xb'),_0x5568d0,_0xff3f('0xe'));_0x1543bf(_0x34df96['result'][_0xff3f('0x12')]);}})['catch'](function(_0x129647){logger['error'](_0xff3f('0xb'),_0x5568d0,_0x129647);_0x5c1d76(_0x129647);});});} \ No newline at end of file +var _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x9a19,0x114));var _0x99a1=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0x9a19[_0x16e57d];return _0x40239c;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d72e446..500cfd9 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 _0xd6f7=['format','%s-%s%s','basename','extname','post','single','/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/download','download','diskStorage','join','root','originalname','replace'];(function(_0x1e0bfe,_0x19a453){var _0xb3a289=function(_0x541221){while(--_0x541221){_0x1e0bfe['push'](_0x1e0bfe['shift']());}};_0xb3a289(++_0x19a453);}(_0xd6f7,0x105));var _0x7d6f=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0xd6f7[_0x48c2ae];return _0x8f7531;};'use strict';var multer=require(_0x7d6f('0x0'));var util=require(_0x7d6f('0x1'));var path=require('path');var timeout=require(_0x7d6f('0x2'));var express=require(_0x7d6f('0x3'));var router=express[_0x7d6f('0x4')]();var fs_extra=require(_0x7d6f('0x5'));var auth=require(_0x7d6f('0x6'));var interaction=require(_0x7d6f('0x7'));var config=require(_0x7d6f('0x8'));var controller=require('./sound.controller');router[_0x7d6f('0x9')]('/',auth[_0x7d6f('0xa')](),controller[_0x7d6f('0xb')]);router['get']('/:id',auth[_0x7d6f('0xa')](),controller['show']);router[_0x7d6f('0x9')](_0x7d6f('0xc'),auth[_0x7d6f('0xa')](),controller[_0x7d6f('0xd')]);var upload=multer({'storage':multer[_0x7d6f('0xe')]({'destination':function(_0xa41286,_0x29acd8,_0x129205){_0x129205(null,path[_0x7d6f('0xf')](config[_0x7d6f('0x10')],'server/files/sounds/original/'));},'filename':function(_0x57dc89,_0x21e963,_0x371c7f){_0x21e963['originalname']=_0x21e963[_0x7d6f('0x11')][_0x7d6f('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x371c7f(null,util[_0x7d6f('0x13')](_0x7d6f('0x14'),path[_0x7d6f('0x15')](_0x21e963[_0x7d6f('0x11')],path[_0x7d6f('0x16')](_0x21e963[_0x7d6f('0x11')])),Date['now'](),path[_0x7d6f('0x16')](_0x21e963[_0x7d6f('0x11')])));}})});router[_0x7d6f('0x17')]('/',upload[_0x7d6f('0x18')]('file'),controller['create']);router['put'](_0x7d6f('0x19'),auth[_0x7d6f('0xa')](),controller[_0x7d6f('0x1a')]);router[_0x7d6f('0x1b')]('/:id',auth[_0x7d6f('0xa')](),controller[_0x7d6f('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xc780=['fs-extra','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','%s-%s%s','basename','now','post','single','file','create','put','update','delete','exports','util','path','connect-timeout','Router'];(function(_0xf3b42f,_0xfeb80){var _0x474258=function(_0x22b988){while(--_0x22b988){_0xf3b42f['push'](_0xf3b42f['shift']());}};_0x474258(++_0xfeb80);}(_0xc780,0xaa));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x0c78('0x0'));var path=require(_0x0c78('0x1'));var timeout=require(_0x0c78('0x2'));var express=require('express');var router=express[_0x0c78('0x3')]();var fs_extra=require(_0x0c78('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0c78('0x5'));var config=require('../../config/environment');var controller=require(_0x0c78('0x6'));router[_0x0c78('0x7')]('/',auth[_0x0c78('0x8')](),controller['index']);router[_0x0c78('0x7')](_0x0c78('0x9'),auth[_0x0c78('0x8')](),controller[_0x0c78('0xa')]);router[_0x0c78('0x7')](_0x0c78('0xb'),auth[_0x0c78('0x8')](),controller[_0x0c78('0xc')]);var upload=multer({'storage':multer[_0x0c78('0xd')]({'destination':function(_0x1e3806,_0x39a571,_0x24a979){_0x24a979(null,path[_0x0c78('0xe')](config[_0x0c78('0xf')],'server/files/sounds/original/'));},'filename':function(_0x504c90,_0x1eb402,_0x5eba7f){_0x1eb402[_0x0c78('0x10')]=_0x1eb402['originalname'][_0x0c78('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5eba7f(null,util['format'](_0x0c78('0x12'),path[_0x0c78('0x13')](_0x1eb402[_0x0c78('0x10')],path['extname'](_0x1eb402[_0x0c78('0x10')])),Date[_0x0c78('0x14')](),path['extname'](_0x1eb402[_0x0c78('0x10')])));}})});router[_0x0c78('0x15')]('/',upload[_0x0c78('0x16')](_0x0c78('0x17')),controller[_0x0c78('0x18')]);router[_0x0c78('0x19')](_0x0c78('0x9'),auth[_0x0c78('0x8')](),controller[_0x0c78('0x1a')]);router[_0x0c78('0x1b')](_0x0c78('0x9'),auth[_0x0c78('0x8')](),controller['delete']);module[_0x0c78('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 983991d..65d9c74 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 _0x2001=['FLOAT','BIGINT','INTEGER','sequelize','name','STRING'];(function(_0x28cb4f,_0x121e9c){var _0x40870f=function(_0x359328){while(--_0x359328){_0x28cb4f['push'](_0x28cb4f['shift']());}};_0x40870f(++_0x121e9c);}(_0x2001,0xf3));var _0x1200=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x2001[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x1200('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1200('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1200('0x2')]},'display_name':{'type':Sequelize[_0x1200('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x1200('0x2')]},'original_duration':{'type':Sequelize[_0x1200('0x3')]},'original_sampleCount':{'type':Sequelize[_0x1200('0x4')]},'original_channelCount':{'type':Sequelize[_0x1200('0x5')]},'original_bitRate':{'type':Sequelize[_0x1200('0x4')]},'original_sampleRate':{'type':Sequelize[_0x1200('0x5')]},'converted_format':{'type':Sequelize[_0x1200('0x2')]},'converted_duration':{'type':Sequelize[_0x1200('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x1200('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1200('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x1200('0x5')]}}; \ No newline at end of file +var _0x843d=['name','FLOAT','BIGINT','INTEGER','STRING'];(function(_0x2d8281,_0x11d952){var _0x506f68=function(_0x52b83a){while(--_0x52b83a){_0x2d8281['push'](_0x2d8281['shift']());}};_0x506f68(++_0x11d952);}(_0x843d,0x18a));var _0xd843=function(_0x180452,_0x18db4e){_0x180452=_0x180452-0x0;var _0x42d755=_0x843d[_0x180452];return _0x42d755;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd843('0x0')],'unique':_0xd843('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd843('0x0')]},'display_name':{'type':Sequelize[_0xd843('0x0')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xd843('0x0')]},'original_duration':{'type':Sequelize[_0xd843('0x2')]},'original_sampleCount':{'type':Sequelize[_0xd843('0x3')]},'original_channelCount':{'type':Sequelize[_0xd843('0x4')]},'original_bitRate':{'type':Sequelize[_0xd843('0x3')]},'original_sampleRate':{'type':Sequelize[_0xd843('0x4')]},'converted_format':{'type':Sequelize[_0xd843('0x0')]},'converted_duration':{'type':Sequelize[_0xd843('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xd843('0x3')]},'converted_channelCount':{'type':Sequelize[_0xd843('0x4')]},'converted_bitRate':{'type':Sequelize[_0xd843('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xd843('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 373474a..646c57e 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 _0x5b40=['converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','find','autoAssociation','description','delete','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','Sound','includeAll','include','rows','show','params','options','catch','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','originalname','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x5b40,0x185));var _0x05b4=function(_0x2598a3,_0x2c633f){_0x2598a3=_0x2598a3-0x0;var _0x379ae3=_0x5b40[_0x2598a3];return _0x379ae3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x05b4('0x0'));var jsonpatch=require(_0x05b4('0x1'));var rp=require(_0x05b4('0x2'));var moment=require(_0x05b4('0x3'));var BPromise=require(_0x05b4('0x4'));var Mustache=require(_0x05b4('0x5'));var util=require(_0x05b4('0x6'));var path=require(_0x05b4('0x7'));var sox=require(_0x05b4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x05b4('0x9'));var crypto=require(_0x05b4('0xa'));var jsforce=require(_0x05b4('0xb'));var deskjs=require(_0x05b4('0xc'));var toCsv=require(_0x05b4('0xd'));var querystring=require(_0x05b4('0xe'));var Papa=require('papaparse');var Redis=require(_0x05b4('0xf'));var authService=require(_0x05b4('0x10'));var qs=require(_0x05b4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05b4('0x12'));var logger=require('../../config/logger')(_0x05b4('0x13'));var utils=require('../../config/utils');var config=require(_0x05b4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x05b4('0x15'))['db'];function respondWithStatusCode(_0x59ea5d,_0x2a5bca){_0x2a5bca=_0x2a5bca||0xcc;return function(_0x2b5844){if(_0x2b5844){return _0x59ea5d[_0x05b4('0x16')](_0x2a5bca);}return _0x59ea5d[_0x05b4('0x17')](_0x2a5bca)[_0x05b4('0x18')]();};}function respondWithResult(_0x31fd46,_0x1b8462){_0x1b8462=_0x1b8462||0xc8;return function(_0x306b26){if(_0x306b26){return _0x31fd46[_0x05b4('0x17')](_0x1b8462)[_0x05b4('0x19')](_0x306b26);}};}function respondWithFilteredResult(_0x2649cd,_0x36e47e){return function(_0x26bf22){if(_0x26bf22){var _0x119157=typeof _0x36e47e[_0x05b4('0x1a')]===_0x05b4('0x1b')&&typeof _0x36e47e[_0x05b4('0x1c')]==='undefined';var _0x33ceb9=_0x26bf22['count'];var _0x51cc55=_0x119157?0x0:_0x36e47e[_0x05b4('0x1a')];var _0x249ce9=_0x119157?_0x26bf22[_0x05b4('0x1d')]:_0x36e47e[_0x05b4('0x1a')]+_0x36e47e[_0x05b4('0x1c')];var _0xbceed3;if(_0x249ce9>=_0x33ceb9){_0x249ce9=_0x33ceb9;_0xbceed3=0xc8;}else{_0xbceed3=0xce;}_0x2649cd['status'](_0xbceed3);return _0x2649cd['set'](_0x05b4('0x1e'),_0x51cc55+'-'+_0x249ce9+'/'+_0x33ceb9)['json'](_0x26bf22);}return null;};}function patchUpdates(_0x34eb08){return function(_0x68b40){try{jsonpatch[_0x05b4('0x1f')](_0x68b40,_0x34eb08,!![]);}catch(_0x4c6633){return BPromise[_0x05b4('0x20')](_0x4c6633);}return _0x68b40[_0x05b4('0x21')]();};}function saveUpdates(_0x369685,_0x3122bf){return function(_0x549540){if(_0x549540){return _0x549540[_0x05b4('0x22')](_0x369685)[_0x05b4('0x23')](function(_0x4b7e79){return _0x4b7e79;});}return null;};}function removeEntity(_0x53f2f9,_0x1865c3){return function(_0x3e8298){if(_0x3e8298){return _0x3e8298[_0x05b4('0x24')]()[_0x05b4('0x23')](function(){var _0x558961=_0x3e8298['get']({'plain':!![]});var _0x463d82=_0x05b4('0x25');return db[_0x05b4('0x26')][_0x05b4('0x24')]({'where':{'type':_0x463d82,'resourceId':_0x558961['id']}})['then'](function(){return _0x3e8298;});})[_0x05b4('0x23')](function(){_0x53f2f9[_0x05b4('0x17')](0xcc)[_0x05b4('0x18')]();});}};}function handleEntityNotFound(_0x5068d1,_0x1f5a54){return function(_0x3893d7){if(!_0x3893d7){_0x5068d1[_0x05b4('0x16')](0x194);}return _0x3893d7;};}function handleError(_0x4fd3e6,_0x5dae18){_0x5dae18=_0x5dae18||0x1f4;return function(_0x3cb441){logger[_0x05b4('0x27')](_0x3cb441['stack']);if(_0x3cb441['name']){delete _0x3cb441[_0x05b4('0x28')];}_0x4fd3e6[_0x05b4('0x17')](_0x5dae18)[_0x05b4('0x29')](_0x3cb441);};}exports[_0x05b4('0x2a')]=function(_0x52e7e3,_0x15905c){var _0x16af38={},_0x1e3f51={},_0x5e981a={'count':0x0,'rows':[]};var _0x6eae1c=_[_0x05b4('0x2b')](db['Sound'][_0x05b4('0x2c')],function(_0x3f3b0c){return{'name':_0x3f3b0c[_0x05b4('0x2d')],'type':_0x3f3b0c['type'][_0x05b4('0x2e')]};});_0x1e3f51[_0x05b4('0x2f')]=_[_0x05b4('0x2b')](_0x6eae1c,_0x05b4('0x28'));_0x1e3f51['query']=_[_0x05b4('0x30')](_0x52e7e3[_0x05b4('0x31')]);_0x1e3f51['filters']=_['intersection'](_0x1e3f51[_0x05b4('0x2f')],_0x1e3f51[_0x05b4('0x31')]);_0x16af38[_0x05b4('0x32')]=_[_0x05b4('0x33')](_0x1e3f51[_0x05b4('0x2f')],qs[_0x05b4('0x34')](_0x52e7e3[_0x05b4('0x31')][_0x05b4('0x34')]));_0x16af38[_0x05b4('0x32')]=_0x16af38[_0x05b4('0x32')][_0x05b4('0x35')]?_0x16af38[_0x05b4('0x32')]:_0x1e3f51['model'];if(!_0x52e7e3[_0x05b4('0x31')][_0x05b4('0x36')](_0x05b4('0x37'))){_0x16af38[_0x05b4('0x1c')]=qs[_0x05b4('0x1c')](_0x52e7e3[_0x05b4('0x31')][_0x05b4('0x1c')]);_0x16af38['offset']=qs['offset'](_0x52e7e3[_0x05b4('0x31')]['offset']);}_0x16af38[_0x05b4('0x38')]=qs[_0x05b4('0x39')](_0x52e7e3['query'][_0x05b4('0x39')]);_0x16af38[_0x05b4('0x3a')]=qs[_0x05b4('0x3b')](_[_0x05b4('0x3c')](_0x52e7e3[_0x05b4('0x31')],_0x1e3f51[_0x05b4('0x3b')]),_0x6eae1c);if(_0x52e7e3[_0x05b4('0x31')][_0x05b4('0x3d')]){_0x16af38[_0x05b4('0x3a')]=_[_0x05b4('0x3e')](_0x16af38[_0x05b4('0x3a')],{'$or':_[_0x05b4('0x2b')](_0x6eae1c,function(_0x365e35){if(_0x365e35[_0x05b4('0x3f')]!==_0x05b4('0x40')){var _0x341493={};_0x341493[_0x365e35['name']]={'$like':'%'+_0x52e7e3[_0x05b4('0x31')][_0x05b4('0x3d')]+'%'};return _0x341493;}})});}_0x16af38=_['merge']({},_0x16af38,_0x52e7e3['options']);var _0x1aa77f={'where':_0x16af38[_0x05b4('0x3a')]};return db[_0x05b4('0x41')][_0x05b4('0x1d')](_0x1aa77f)['then'](function(_0x35ab79){_0x5e981a[_0x05b4('0x1d')]=_0x35ab79;if(_0x52e7e3[_0x05b4('0x31')][_0x05b4('0x42')]){_0x16af38[_0x05b4('0x43')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x16af38);})[_0x05b4('0x23')](function(_0x2227ed){_0x5e981a[_0x05b4('0x44')]=_0x2227ed;return _0x5e981a;})[_0x05b4('0x23')](respondWithFilteredResult(_0x15905c,_0x16af38))['catch'](handleError(_0x15905c,null));};exports[_0x05b4('0x45')]=function(_0x54499d,_0x273423){var _0x322238={'raw':!![],'where':{'id':_0x54499d[_0x05b4('0x46')]['id']}},_0x26497e={};_0x26497e['model']=_['keys'](db['Sound'][_0x05b4('0x2c')]);_0x26497e[_0x05b4('0x31')]=_['keys'](_0x54499d[_0x05b4('0x31')]);_0x26497e['filters']=_['intersection'](_0x26497e['model'],_0x26497e[_0x05b4('0x31')]);_0x322238[_0x05b4('0x32')]=_[_0x05b4('0x33')](_0x26497e[_0x05b4('0x2f')],qs['fields'](_0x54499d[_0x05b4('0x31')][_0x05b4('0x34')]));_0x322238[_0x05b4('0x32')]=_0x322238[_0x05b4('0x32')][_0x05b4('0x35')]?_0x322238[_0x05b4('0x32')]:_0x26497e[_0x05b4('0x2f')];if(_0x54499d[_0x05b4('0x31')]['includeAll']){_0x322238[_0x05b4('0x43')]=[{'all':!![]}];}_0x322238=_[_0x05b4('0x3e')]({},_0x322238,_0x54499d[_0x05b4('0x47')]);return db['Sound']['find'](_0x322238)['then'](handleEntityNotFound(_0x273423,null))[_0x05b4('0x23')](respondWithResult(_0x273423,null))[_0x05b4('0x48')](handleError(_0x273423,null));};exports[_0x05b4('0x49')]=function(_0x2028f3,_0x1daf4e,_0x42dc4b){return db[_0x05b4('0x41')]['find']({'where':{'id':_0x2028f3[_0x05b4('0x46')]['id']},'attributes':[_0x05b4('0x28'),_0x05b4('0x4a'),'converted_format'],'raw':!![]})[_0x05b4('0x23')](handleEntityNotFound(_0x1daf4e,null))[_0x05b4('0x23')](function(_0x1f8393){if(_0x1f8393){if(!fs[_0x05b4('0x4b')](path[_0x05b4('0x4c')](config[_0x05b4('0x4d')],_0x05b4('0x4e'),_0x1f8393['save_name']+'.'+_0x1f8393[_0x05b4('0x4f')]))){throw new db['Sequelize'][(_0x05b4('0x50'))](_0x05b4('0x51'));}return _0x1daf4e[_0x05b4('0x49')](path[_0x05b4('0x4c')](config[_0x05b4('0x4d')],_0x05b4('0x4e'),util[_0x05b4('0x52')](_0x05b4('0x53'),_0x1f8393[_0x05b4('0x4a')],_0x1f8393[_0x05b4('0x4f')])),util[_0x05b4('0x52')]('%s.%s',_0x1f8393[_0x05b4('0x28')],_0x1f8393[_0x05b4('0x4f')]));}return null;})[_0x05b4('0x48')](handleError(_0x1daf4e,null));};exports[_0x05b4('0x54')]=function(_0x3ecb98,_0xc49922,_0x1f2826){var _0x41ef93={'name':path[_0x05b4('0x55')](_0x3ecb98[_0x05b4('0x56')]['originalname'],path[_0x05b4('0x57')](_0x3ecb98[_0x05b4('0x56')][_0x05b4('0x58')])),'save_name':path[_0x05b4('0x55')](_0x3ecb98[_0x05b4('0x56')][_0x05b4('0x59')],path[_0x05b4('0x57')](_0x3ecb98[_0x05b4('0x56')][_0x05b4('0x59')])),'original_format':path['extname'](_0x3ecb98['file'][_0x05b4('0x58')])['substring'](0x1),'converted_format':'wav'};var _0x128401=path['join'](config[_0x05b4('0x4d')],_0x05b4('0x5a'),_0x3ecb98[_0x05b4('0x56')][_0x05b4('0x59')]);var _0x4c0977=path[_0x05b4('0x4c')](config[_0x05b4('0x4d')],_0x05b4('0x4e'),util[_0x05b4('0x52')](_0x05b4('0x53'),path[_0x05b4('0x55')](_0x3ecb98[_0x05b4('0x56')][_0x05b4('0x59')],path[_0x05b4('0x57')](_0x3ecb98['file'][_0x05b4('0x59')])),_0x41ef93[_0x05b4('0x4f')]));logger[_0x05b4('0x5b')](_0x05b4('0x5c'),_0x128401);logger['info'](_0x05b4('0x5d'),_0x4c0977);try{fs[_0x05b4('0x5e')](_0x128401,parseInt(_0x05b4('0x5f'),0x8));var _0x17fa30=sox[_0x05b4('0x60')](_0x128401,_0x4c0977,{'sampleRate':0x1f40,'format':_0x05b4('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x17fa30['on'](_0x05b4('0x27'),function(_0x5792df){fs[_0x05b4('0x62')](_0x128401);_0xc49922[_0x05b4('0x17')](0x1f4)[_0x05b4('0x29')](_0x5792df);});_0x17fa30['on'](_0x05b4('0x63'),function(_0x518070){_0x41ef93[_0x05b4('0x64')]=isNaN(_0x518070[_0x05b4('0x65')])?null:_0x518070['duration']*0x3e8;_0x41ef93['original_sampleCount']=isNaN(_0x518070['sampleCount'])?null:_0x518070[_0x05b4('0x66')];_0x41ef93[_0x05b4('0x67')]=isNaN(_0x518070[_0x05b4('0x68')])?null:_0x518070['channelCount'];_0x41ef93[_0x05b4('0x69')]=isNaN(_0x518070[_0x05b4('0x6a')])?null:_0x518070[_0x05b4('0x6a')];_0x41ef93[_0x05b4('0x6b')]=isNaN(_0x518070[_0x05b4('0x6c')])?null:_0x518070[_0x05b4('0x6c')];});_0x17fa30['on']('dest',function(_0x31ed43){_0x41ef93[_0x05b4('0x6d')]=isNaN(_0x31ed43[_0x05b4('0x65')])?null:_0x31ed43[_0x05b4('0x65')]*0x3e8;_0x41ef93[_0x05b4('0x6e')]=isNaN(_0x31ed43[_0x05b4('0x66')])?null:_0x31ed43[_0x05b4('0x66')];_0x41ef93[_0x05b4('0x6f')]=isNaN(_0x31ed43[_0x05b4('0x68')])?null:_0x31ed43[_0x05b4('0x68')];_0x41ef93[_0x05b4('0x70')]=isNaN(_0x31ed43[_0x05b4('0x6a')])?null:_0x31ed43[_0x05b4('0x6a')];_0x41ef93[_0x05b4('0x71')]=isNaN(_0x31ed43[_0x05b4('0x6c')])?null:_0x31ed43['sampleRate'];});_0x17fa30['on']('end',function(){fs[_0x05b4('0x5e')](_0x4c0977,parseInt(_0x05b4('0x5f'),0x8));return db[_0x05b4('0x41')][_0x05b4('0x54')](_0x41ef93)[_0x05b4('0x23')](function(_0xe1a8b3){var _0x2047d0={'role':_0x3ecb98[_0x05b4('0x72')][_0x05b4('0x73')],'userProfileId':_0x3ecb98[_0x05b4('0x72')][_0x05b4('0x74')]};if(!_0x2047d0)throw new Error(_0x05b4('0x75'));if(_0x2047d0[_0x05b4('0x73')]===_0x05b4('0x76')){var _0x25cf39=_0xe1a8b3[_0x05b4('0x77')]({'plain':!![]});return db[_0x05b4('0x78')][_0x05b4('0x79')]({'where':{'name':_0x05b4('0x25'),'userProfileId':_0x2047d0[_0x05b4('0x74')]},'raw':!![]})[_0x05b4('0x23')](function(_0x19f0c1){if(_0x19f0c1&&_0x19f0c1[_0x05b4('0x7a')]===0x0){return db[_0x05b4('0x26')][_0x05b4('0x54')]({'name':_0x25cf39['name'],'resourceId':_0x25cf39['id'],'type':_0x19f0c1[_0x05b4('0x28')],'sectionId':_0x19f0c1['id']},{})[_0x05b4('0x23')](function(){return _0xe1a8b3;});}else{return _0xe1a8b3;}})['catch'](function(_0x21c96b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21c96b);throw _0x21c96b;});}return _0xe1a8b3;})[_0x05b4('0x23')](respondWithResult(_0xc49922,null))[_0x05b4('0x48')](handleError(_0xc49922,null));});_0x17fa30['start']();}catch(_0x414a98){_0xc49922[_0x05b4('0x17')](0x1f4)[_0x05b4('0x29')](_0x414a98);}};exports[_0x05b4('0x22')]=function(_0x587380,_0x33a017,_0x28d065){return db[_0x05b4('0x41')]['find']({'where':{'id':_0x587380[_0x05b4('0x46')]['id']}})[_0x05b4('0x23')](handleEntityNotFound(_0x33a017,null))[_0x05b4('0x23')](saveUpdates(_['pick'](_0x587380['body'],[_0x05b4('0x28'),_0x05b4('0x7b')]),null))[_0x05b4('0x23')](respondWithResult(_0x33a017,null))['catch'](handleError(_0x33a017,null));};exports[_0x05b4('0x7c')]=function(_0x4f0b2a,_0x4f49b4,_0x1077f6){return db[_0x05b4('0x41')]['find']({'where':{'id':_0x4f0b2a[_0x05b4('0x46')]['id']}})[_0x05b4('0x23')](function(_0x14aa33){if(_0x14aa33){return _0x14aa33[_0x05b4('0x24')]();}})[_0x05b4('0x23')](function(_0x5934a6){var _0x12d98b=path[_0x05b4('0x4c')](config[_0x05b4('0x4d')],'server/files/sounds/original',util[_0x05b4('0x52')](_0x05b4('0x53'),_0x5934a6[_0x05b4('0x4a')],_0x5934a6['original_format']));var _0x7718ff=path[_0x05b4('0x4c')](config[_0x05b4('0x4d')],_0x05b4('0x4e'),util[_0x05b4('0x52')](_0x05b4('0x53'),_0x5934a6[_0x05b4('0x4a')],_0x5934a6[_0x05b4('0x4f')]));fs['unlinkSync'](_0x12d98b);fs[_0x05b4('0x62')](_0x7718ff);return _0x5934a6;})['then'](function(_0x4c7ecc){if(_0x4c7ecc){return _0x4f49b4[_0x05b4('0x17')](0xcc)['end']();}})[_0x05b4('0x23')](handleEntityNotFound(_0x4f49b4,null))['catch'](handleError(_0x4f49b4,null));}; \ No newline at end of file +var _0xeb2b=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','rows','show','params','include','find','download','save_name','converted_format','join','root','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','catch','originalname','file','filename','extname','wav','server/files/sounds/original','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','delete','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','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','../../mysqldb','sendStatus','status','end','json'];(function(_0x5df532,_0x14cbbe){var _0x143974=function(_0x5d5a82){while(--_0x5d5a82){_0x5df532['push'](_0x5df532['shift']());}};_0x143974(++_0x14cbbe);}(_0xeb2b,0x1d4));var _0xbeb2=function(_0x4355f9,_0x84172c){_0x4355f9=_0x4355f9-0x0;var _0x2b2513=_0xeb2b[_0x4355f9];return _0x2b2513;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbeb2('0x0'));var zipdir=require(_0xbeb2('0x1'));var jsonpatch=require(_0xbeb2('0x2'));var rp=require(_0xbeb2('0x3'));var moment=require('moment');var BPromise=require(_0xbeb2('0x4'));var Mustache=require(_0xbeb2('0x5'));var util=require('util');var path=require(_0xbeb2('0x6'));var sox=require('sox');var csv=require(_0xbeb2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbeb2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbeb2('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbeb2('0xa'));var toCsv=require(_0xbeb2('0x7'));var querystring=require(_0xbeb2('0xb'));var Papa=require(_0xbeb2('0xc'));var Redis=require(_0xbeb2('0xd'));var authService=require(_0xbeb2('0xe'));var qs=require(_0xbeb2('0xf'));var as=require(_0xbeb2('0x10'));var hardwareService=require(_0xbeb2('0x11'));var logger=require(_0xbeb2('0x12'))(_0xbeb2('0x13'));var utils=require(_0xbeb2('0x14'));var config=require(_0xbeb2('0x15'));var licenseUtil=require(_0xbeb2('0x16'));var db=require(_0xbeb2('0x17'))['db'];function respondWithStatusCode(_0x2bba54,_0x3144e8){_0x3144e8=_0x3144e8||0xcc;return function(_0x1153d8){if(_0x1153d8){return _0x2bba54[_0xbeb2('0x18')](_0x3144e8);}return _0x2bba54[_0xbeb2('0x19')](_0x3144e8)[_0xbeb2('0x1a')]();};}function respondWithResult(_0x50dd28,_0xe4f4e0){_0xe4f4e0=_0xe4f4e0||0xc8;return function(_0x2dbf5b){if(_0x2dbf5b){return _0x50dd28[_0xbeb2('0x19')](_0xe4f4e0)[_0xbeb2('0x1b')](_0x2dbf5b);}};}function respondWithFilteredResult(_0x1f5f59,_0x322aae){return function(_0x568b18){if(_0x568b18){var _0x59014c=typeof _0x322aae[_0xbeb2('0x1c')]===_0xbeb2('0x1d')&&typeof _0x322aae[_0xbeb2('0x1e')]===_0xbeb2('0x1d');var _0xb1799c=_0x568b18[_0xbeb2('0x1f')];var _0x40b86f=_0x59014c?0x0:_0x322aae[_0xbeb2('0x1c')];var _0x403643=_0x59014c?_0x568b18[_0xbeb2('0x1f')]:_0x322aae[_0xbeb2('0x1c')]+_0x322aae['limit'];var _0x3f50e3;if(_0x403643>=_0xb1799c){_0x403643=_0xb1799c;_0x3f50e3=0xc8;}else{_0x3f50e3=0xce;}_0x1f5f59['status'](_0x3f50e3);return _0x1f5f59[_0xbeb2('0x20')](_0xbeb2('0x21'),_0x40b86f+'-'+_0x403643+'/'+_0xb1799c)[_0xbeb2('0x1b')](_0x568b18);}return null;};}function patchUpdates(_0x505d3d){return function(_0x5c4a08){try{jsonpatch[_0xbeb2('0x22')](_0x5c4a08,_0x505d3d,!![]);}catch(_0x15218c){return BPromise['reject'](_0x15218c);}return _0x5c4a08[_0xbeb2('0x23')]();};}function saveUpdates(_0x5dc431,_0x2cc5dc){return function(_0x588524){if(_0x588524){return _0x588524[_0xbeb2('0x24')](_0x5dc431)[_0xbeb2('0x25')](function(_0x13e636){return _0x13e636;});}return null;};}function removeEntity(_0x3affca,_0x566fc0){return function(_0x44e544){if(_0x44e544){return _0x44e544[_0xbeb2('0x26')]()[_0xbeb2('0x25')](function(){var _0x342eb4=_0x44e544['get']({'plain':!![]});var _0x4404d4=_0xbeb2('0x27');return db[_0xbeb2('0x28')][_0xbeb2('0x26')]({'where':{'type':_0x4404d4,'resourceId':_0x342eb4['id']}})[_0xbeb2('0x25')](function(){return _0x44e544;});})[_0xbeb2('0x25')](function(){_0x3affca[_0xbeb2('0x19')](0xcc)[_0xbeb2('0x1a')]();});}};}function handleEntityNotFound(_0x24e8ce,_0x3a7130){return function(_0x36d533){if(!_0x36d533){_0x24e8ce[_0xbeb2('0x18')](0x194);}return _0x36d533;};}function handleError(_0x3e8b87,_0x5c9c6a){_0x5c9c6a=_0x5c9c6a||0x1f4;return function(_0x3422ae){logger['error'](_0x3422ae[_0xbeb2('0x29')]);if(_0x3422ae[_0xbeb2('0x2a')]){delete _0x3422ae[_0xbeb2('0x2a')];}_0x3e8b87[_0xbeb2('0x19')](_0x5c9c6a)[_0xbeb2('0x2b')](_0x3422ae);};}exports[_0xbeb2('0x2c')]=function(_0x55ec84,_0x1e6c54){var _0x50bd3f={},_0x9d4002={},_0x30a7ea={'count':0x0,'rows':[]};var _0x512df2=_[_0xbeb2('0x2d')](db[_0xbeb2('0x2e')][_0xbeb2('0x2f')],function(_0x51169e){return{'name':_0x51169e['fieldName'],'type':_0x51169e[_0xbeb2('0x30')][_0xbeb2('0x31')]};});_0x9d4002['model']=_[_0xbeb2('0x2d')](_0x512df2,'name');_0x9d4002[_0xbeb2('0x32')]=_[_0xbeb2('0x33')](_0x55ec84[_0xbeb2('0x32')]);_0x9d4002[_0xbeb2('0x34')]=_['intersection'](_0x9d4002['model'],_0x9d4002[_0xbeb2('0x32')]);_0x50bd3f[_0xbeb2('0x35')]=_[_0xbeb2('0x36')](_0x9d4002['model'],qs[_0xbeb2('0x37')](_0x55ec84[_0xbeb2('0x32')]['fields']));_0x50bd3f[_0xbeb2('0x35')]=_0x50bd3f[_0xbeb2('0x35')][_0xbeb2('0x38')]?_0x50bd3f[_0xbeb2('0x35')]:_0x9d4002[_0xbeb2('0x39')];if(!_0x55ec84[_0xbeb2('0x32')][_0xbeb2('0x3a')](_0xbeb2('0x3b'))){_0x50bd3f[_0xbeb2('0x1e')]=qs[_0xbeb2('0x1e')](_0x55ec84[_0xbeb2('0x32')][_0xbeb2('0x1e')]);_0x50bd3f[_0xbeb2('0x1c')]=qs[_0xbeb2('0x1c')](_0x55ec84['query']['offset']);}_0x50bd3f[_0xbeb2('0x3c')]=qs[_0xbeb2('0x3d')](_0x55ec84[_0xbeb2('0x32')]['sort']);_0x50bd3f[_0xbeb2('0x3e')]=qs[_0xbeb2('0x34')](_['pick'](_0x55ec84[_0xbeb2('0x32')],_0x9d4002[_0xbeb2('0x34')]),_0x512df2);if(_0x55ec84['query']['filter']){_0x50bd3f['where']=_[_0xbeb2('0x3f')](_0x50bd3f[_0xbeb2('0x3e')],{'$or':_[_0xbeb2('0x2d')](_0x512df2,function(_0xefb0d0){if(_0xefb0d0[_0xbeb2('0x30')]!=='VIRTUAL'){var _0x220b78={};_0x220b78[_0xefb0d0[_0xbeb2('0x2a')]]={'$like':'%'+_0x55ec84['query'][_0xbeb2('0x40')]+'%'};return _0x220b78;}})});}_0x50bd3f=_['merge']({},_0x50bd3f,_0x55ec84[_0xbeb2('0x41')]);var _0x561dee={'where':_0x50bd3f[_0xbeb2('0x3e')]};return db[_0xbeb2('0x2e')][_0xbeb2('0x1f')](_0x561dee)[_0xbeb2('0x25')](function(_0x1f8236){_0x30a7ea['count']=_0x1f8236;if(_0x55ec84[_0xbeb2('0x32')][_0xbeb2('0x42')]){_0x50bd3f['include']=[{'all':!![]}];}return db[_0xbeb2('0x2e')][_0xbeb2('0x43')](_0x50bd3f);})[_0xbeb2('0x25')](function(_0x62e783){_0x30a7ea[_0xbeb2('0x44')]=_0x62e783;return _0x30a7ea;})[_0xbeb2('0x25')](respondWithFilteredResult(_0x1e6c54,_0x50bd3f))['catch'](handleError(_0x1e6c54,null));};exports[_0xbeb2('0x45')]=function(_0x139313,_0x3f133b){var _0x1a32c6={'raw':!![],'where':{'id':_0x139313[_0xbeb2('0x46')]['id']}},_0x5e25fe={};_0x5e25fe[_0xbeb2('0x39')]=_[_0xbeb2('0x33')](db[_0xbeb2('0x2e')][_0xbeb2('0x2f')]);_0x5e25fe[_0xbeb2('0x32')]=_[_0xbeb2('0x33')](_0x139313[_0xbeb2('0x32')]);_0x5e25fe[_0xbeb2('0x34')]=_[_0xbeb2('0x36')](_0x5e25fe[_0xbeb2('0x39')],_0x5e25fe[_0xbeb2('0x32')]);_0x1a32c6[_0xbeb2('0x35')]=_[_0xbeb2('0x36')](_0x5e25fe[_0xbeb2('0x39')],qs[_0xbeb2('0x37')](_0x139313['query'][_0xbeb2('0x37')]));_0x1a32c6[_0xbeb2('0x35')]=_0x1a32c6[_0xbeb2('0x35')][_0xbeb2('0x38')]?_0x1a32c6['attributes']:_0x5e25fe[_0xbeb2('0x39')];if(_0x139313[_0xbeb2('0x32')][_0xbeb2('0x42')]){_0x1a32c6[_0xbeb2('0x47')]=[{'all':!![]}];}_0x1a32c6=_['merge']({},_0x1a32c6,_0x139313[_0xbeb2('0x41')]);return db[_0xbeb2('0x2e')][_0xbeb2('0x48')](_0x1a32c6)[_0xbeb2('0x25')](handleEntityNotFound(_0x3f133b,null))['then'](respondWithResult(_0x3f133b,null))['catch'](handleError(_0x3f133b,null));};exports[_0xbeb2('0x49')]=function(_0x92b5d5,_0x22d91c,_0x5273ee){return db['Sound'][_0xbeb2('0x48')]({'where':{'id':_0x92b5d5[_0xbeb2('0x46')]['id']},'attributes':[_0xbeb2('0x2a'),_0xbeb2('0x4a'),_0xbeb2('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x22d91c,null))[_0xbeb2('0x25')](function(_0x1d2c7c){if(_0x1d2c7c){if(!fs['existsSync'](path[_0xbeb2('0x4c')](config[_0xbeb2('0x4d')],'server/files/sounds/converted',_0x1d2c7c['save_name']+'.'+_0x1d2c7c[_0xbeb2('0x4b')]))){throw new db['Sequelize'][(_0xbeb2('0x4e'))](_0xbeb2('0x4f'));}return _0x22d91c[_0xbeb2('0x49')](path['join'](config[_0xbeb2('0x4d')],_0xbeb2('0x50'),util[_0xbeb2('0x51')](_0xbeb2('0x52'),_0x1d2c7c[_0xbeb2('0x4a')],_0x1d2c7c['converted_format'])),util[_0xbeb2('0x51')]('%s.%s',_0x1d2c7c[_0xbeb2('0x2a')],_0x1d2c7c[_0xbeb2('0x4b')]));}return null;})[_0xbeb2('0x53')](handleError(_0x22d91c,null));};exports['create']=function(_0x5a7468,_0x3d22b7,_0x29b3f0){var _0x34b29a={'name':path['basename'](_0x5a7468['file'][_0xbeb2('0x54')],path['extname'](_0x5a7468[_0xbeb2('0x55')][_0xbeb2('0x54')])),'save_name':path['basename'](_0x5a7468[_0xbeb2('0x55')][_0xbeb2('0x56')],path[_0xbeb2('0x57')](_0x5a7468[_0xbeb2('0x55')][_0xbeb2('0x56')])),'original_format':path[_0xbeb2('0x57')](_0x5a7468[_0xbeb2('0x55')][_0xbeb2('0x54')])['substring'](0x1),'converted_format':_0xbeb2('0x58')};var _0x123b0d=path[_0xbeb2('0x4c')](config[_0xbeb2('0x4d')],_0xbeb2('0x59'),_0x5a7468['file'][_0xbeb2('0x56')]);var _0x26a209=path[_0xbeb2('0x4c')](config[_0xbeb2('0x4d')],_0xbeb2('0x50'),util[_0xbeb2('0x51')]('%s.%s',path[_0xbeb2('0x5a')](_0x5a7468[_0xbeb2('0x55')][_0xbeb2('0x56')],path[_0xbeb2('0x57')](_0x5a7468[_0xbeb2('0x55')][_0xbeb2('0x56')])),_0x34b29a[_0xbeb2('0x4b')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x123b0d);logger[_0xbeb2('0x5b')](_0xbeb2('0x5c'),_0x26a209);try{fs[_0xbeb2('0x5d')](_0x123b0d,parseInt(_0xbeb2('0x5e'),0x8));var _0x6974ae=sox['transcode'](_0x123b0d,_0x26a209,{'sampleRate':0x1f40,'format':_0xbeb2('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6974ae['on'](_0xbeb2('0x5f'),function(_0x22fd51){fs['unlinkSync'](_0x123b0d);_0x3d22b7[_0xbeb2('0x19')](0x1f4)[_0xbeb2('0x2b')](_0x22fd51);});_0x6974ae['on'](_0xbeb2('0x60'),function(_0x5d4a9e){_0x34b29a[_0xbeb2('0x61')]=isNaN(_0x5d4a9e[_0xbeb2('0x62')])?null:_0x5d4a9e[_0xbeb2('0x62')]*0x3e8;_0x34b29a[_0xbeb2('0x63')]=isNaN(_0x5d4a9e['sampleCount'])?null:_0x5d4a9e[_0xbeb2('0x64')];_0x34b29a[_0xbeb2('0x65')]=isNaN(_0x5d4a9e[_0xbeb2('0x66')])?null:_0x5d4a9e['channelCount'];_0x34b29a['original_bitRate']=isNaN(_0x5d4a9e[_0xbeb2('0x67')])?null:_0x5d4a9e[_0xbeb2('0x67')];_0x34b29a[_0xbeb2('0x68')]=isNaN(_0x5d4a9e[_0xbeb2('0x69')])?null:_0x5d4a9e['sampleRate'];});_0x6974ae['on'](_0xbeb2('0x6a'),function(_0x3699c2){_0x34b29a['converted_duration']=isNaN(_0x3699c2[_0xbeb2('0x62')])?null:_0x3699c2[_0xbeb2('0x62')]*0x3e8;_0x34b29a[_0xbeb2('0x6b')]=isNaN(_0x3699c2[_0xbeb2('0x64')])?null:_0x3699c2[_0xbeb2('0x64')];_0x34b29a[_0xbeb2('0x6c')]=isNaN(_0x3699c2[_0xbeb2('0x66')])?null:_0x3699c2[_0xbeb2('0x66')];_0x34b29a[_0xbeb2('0x6d')]=isNaN(_0x3699c2[_0xbeb2('0x67')])?null:_0x3699c2[_0xbeb2('0x67')];_0x34b29a[_0xbeb2('0x6e')]=isNaN(_0x3699c2['sampleRate'])?null:_0x3699c2[_0xbeb2('0x69')];});_0x6974ae['on']('end',function(){fs[_0xbeb2('0x5d')](_0x26a209,parseInt('0777',0x8));return db['Sound'][_0xbeb2('0x6f')](_0x34b29a)[_0xbeb2('0x25')](function(_0x2f31db){var _0x1e8072={'role':_0x5a7468[_0xbeb2('0x70')][_0xbeb2('0x71')],'userProfileId':_0x5a7468[_0xbeb2('0x70')][_0xbeb2('0x72')]};if(!_0x1e8072)throw new Error(_0xbeb2('0x73'));if(_0x1e8072[_0xbeb2('0x71')]===_0xbeb2('0x74')){var _0x9f17e3=_0x2f31db[_0xbeb2('0x75')]({'plain':!![]});return db[_0xbeb2('0x76')][_0xbeb2('0x48')]({'where':{'name':_0xbeb2('0x27'),'userProfileId':_0x1e8072[_0xbeb2('0x72')]},'raw':!![]})[_0xbeb2('0x25')](function(_0x47ffbc){if(_0x47ffbc&&_0x47ffbc['autoAssociation']===0x0){return db[_0xbeb2('0x28')][_0xbeb2('0x6f')]({'name':_0x9f17e3[_0xbeb2('0x2a')],'resourceId':_0x9f17e3['id'],'type':_0x47ffbc[_0xbeb2('0x2a')],'sectionId':_0x47ffbc['id']},{})[_0xbeb2('0x25')](function(){return _0x2f31db;});}else{return _0x2f31db;}})[_0xbeb2('0x53')](function(_0x1ca010){logger[_0xbeb2('0x5f')](_0xbeb2('0x77'),_0x1ca010);throw _0x1ca010;});}return _0x2f31db;})[_0xbeb2('0x25')](respondWithResult(_0x3d22b7,null))['catch'](handleError(_0x3d22b7,null));});_0x6974ae['start']();}catch(_0x5b8e4f){_0x3d22b7[_0xbeb2('0x19')](0x1f4)[_0xbeb2('0x2b')](_0x5b8e4f);}};exports[_0xbeb2('0x24')]=function(_0x206d54,_0x4bba6b,_0x4e591b){return db[_0xbeb2('0x2e')]['find']({'where':{'id':_0x206d54[_0xbeb2('0x46')]['id']}})[_0xbeb2('0x25')](handleEntityNotFound(_0x4bba6b,null))[_0xbeb2('0x25')](saveUpdates(_[_0xbeb2('0x78')](_0x206d54['body'],[_0xbeb2('0x2a'),_0xbeb2('0x79')]),null))[_0xbeb2('0x25')](respondWithResult(_0x4bba6b,null))[_0xbeb2('0x53')](handleError(_0x4bba6b,null));};exports[_0xbeb2('0x7a')]=function(_0x577065,_0x13bdd6,_0x59479e){return db[_0xbeb2('0x2e')]['find']({'where':{'id':_0x577065[_0xbeb2('0x46')]['id']}})['then'](function(_0x4cc9e5){if(_0x4cc9e5){return _0x4cc9e5[_0xbeb2('0x26')]();}})['then'](function(_0x553965){var _0x117f9e=path[_0xbeb2('0x4c')](config['root'],'server/files/sounds/original',util[_0xbeb2('0x51')]('%s.%s',_0x553965[_0xbeb2('0x4a')],_0x553965['original_format']));var _0x366497=path[_0xbeb2('0x4c')](config['root'],_0xbeb2('0x50'),util[_0xbeb2('0x51')](_0xbeb2('0x52'),_0x553965[_0xbeb2('0x4a')],_0x553965['converted_format']));fs[_0xbeb2('0x7b')](_0x117f9e);fs[_0xbeb2('0x7b')](_0x366497);return _0x553965;})[_0xbeb2('0x25')](function(_0x4bbffc){if(_0x4bbffc){return _0x13bdd6['status'](0xcc)[_0xbeb2('0x1a')]();}})[_0xbeb2('0x25')](handleEntityNotFound(_0x13bdd6,null))[_0xbeb2('0x53')](handleError(_0x13bdd6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 951457e..1ab4f73 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 _0x070b=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./sound.attributes','define','Sound','tools_sounds'];(function(_0x564f95,_0x1ff30c){var _0x45557d=function(_0x4aca7b){while(--_0x4aca7b){_0x564f95['push'](_0x564f95['shift']());}};_0x45557d(++_0x1ff30c);}(_0x070b,0x96));var _0xb070=function(_0x27d49d,_0x124844){_0x27d49d=_0x27d49d-0x0;var _0x5297e5=_0x070b[_0x27d49d];return _0x5297e5;};'use strict';var _=require(_0xb070('0x0'));var util=require(_0xb070('0x1'));var logger=require(_0xb070('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb070('0x3'));var rp=require(_0xb070('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb070('0x5'));var attributes=require(_0xb070('0x6'));module['exports']=function(_0x3cd325,_0x26840f){return _0x3cd325[_0xb070('0x7')](_0xb070('0x8'),attributes,{'tableName':_0xb070('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5372=['rimraf','exports','define','Sound','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2302b4,_0x5d9683){var _0x597d34=function(_0x4afe1e){while(--_0x4afe1e){_0x2302b4['push'](_0x2302b4['shift']());}};_0x597d34(++_0x5d9683);}(_0x5372,0x72));var _0x2537=function(_0x52c342,_0x5ee6f1){_0x52c342=_0x52c342-0x0;var _0x1d02f7=_0x5372[_0x52c342];return _0x1d02f7;};'use strict';var _=require(_0x2537('0x0'));var util=require(_0x2537('0x1'));var logger=require('../../config/logger')(_0x2537('0x2'));var moment=require(_0x2537('0x3'));var BPromise=require(_0x2537('0x4'));var rp=require(_0x2537('0x5'));var fs=require('fs');var path=require(_0x2537('0x6'));var rimraf=require(_0x2537('0x7'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x2537('0x8')]=function(_0x24f416,_0x3db16e){return _0x24f416[_0x2537('0x9')](_0x2537('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 2a901c7..00c8668 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 _0x00f1=['Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','options','raw','where','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc12455,_0x5f3ff5){var _0x4a4aa4=function(_0x3eca7a){while(--_0x3eca7a){_0xc12455['push'](_0xc12455['shift']());}};_0x4a4aa4(++_0x5f3ff5);}(_0x00f1,0x1bc));var _0x100f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x00f1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x100f('0x0'));var util=require(_0x100f('0x1'));var moment=require(_0x100f('0x2'));var BPromise=require('bluebird');var rs=require(_0x100f('0x3'));var fs=require('fs');var Redis=require(_0x100f('0x4'));var db=require(_0x100f('0x5'))['db'];var utils=require(_0x100f('0x6'));var logger=require(_0x100f('0x7'))('rpc');var config=require(_0x100f('0x8'));var jayson=require(_0x100f('0x9'));var client=jayson[_0x100f('0xa')][_0x100f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d66ed,_0x775784,_0xf3c3ba){return new BPromise(function(_0x11de18,_0x3d308a){return client[_0x100f('0xc')](_0x1d66ed,_0xf3c3ba)[_0x100f('0xd')](function(_0x4011bf){logger[_0x100f('0xe')](_0x100f('0xf'),_0x775784,_0x100f('0x10'));logger[_0x100f('0x11')](_0x100f('0x12'),_0x775784,_0x100f('0x10'),JSON[_0x100f('0x13')](_0x4011bf));if(_0x4011bf['error']){if(_0x4011bf[_0x100f('0x14')][_0x100f('0x15')]===0x1f4){logger[_0x100f('0x14')](_0x100f('0xf'),_0x775784,_0x4011bf[_0x100f('0x14')][_0x100f('0x16')]);return _0x3d308a(_0x4011bf[_0x100f('0x14')][_0x100f('0x16')]);}logger[_0x100f('0x14')](_0x100f('0xf'),_0x775784,_0x4011bf[_0x100f('0x14')][_0x100f('0x16')]);return _0x11de18(_0x4011bf[_0x100f('0x14')][_0x100f('0x16')]);}else{logger[_0x100f('0xe')](_0x100f('0xf'),_0x775784,'request\x20sent');_0x11de18(_0x4011bf['result']['message']);}})[_0x100f('0x17')](function(_0x194bd4){logger['error']('Sound,\x20%s,\x20%s',_0x775784,_0x194bd4);_0x3d308a(_0x194bd4);});});}exports[_0x100f('0x18')]=function(_0x2288ea){var _0x4c651d=this;return new Promise(function(_0x2c022b,_0x4c6de9){return db[_0x100f('0x19')]['find']({'raw':_0x2288ea[_0x100f('0x1a')]?_0x2288ea[_0x100f('0x1a')][_0x100f('0x1b')]===undefined?!![]:![]:!![],'where':_0x2288ea['options']?_0x2288ea[_0x100f('0x1a')][_0x100f('0x1c')]||null:null,'attributes':_0x2288ea[_0x100f('0x1a')]?_0x2288ea[_0x100f('0x1a')]['attributes']||null:null,'include':_0x2288ea[_0x100f('0x1a')]?_0x2288ea['options'][_0x100f('0x1d')]?_[_0x100f('0x1e')](_0x2288ea[_0x100f('0x1a')][_0x100f('0x1d')],function(_0x3b686){return{'model':db[_0x3b686[_0x100f('0x1f')]],'as':_0x3b686['as'],'attributes':_0x3b686[_0x100f('0x20')],'include':_0x3b686['include']?_[_0x100f('0x1e')](_0x3b686[_0x100f('0x1d')],function(_0x2d4f49){return{'model':db[_0x2d4f49[_0x100f('0x1f')]],'as':_0x2d4f49['as'],'attributes':_0x2d4f49[_0x100f('0x20')],'include':_0x2d4f49[_0x100f('0x1d')]?_[_0x100f('0x1e')](_0x2d4f49['include'],function(_0x1f1313){return{'model':db[_0x1f1313[_0x100f('0x1f')]],'as':_0x1f1313['as'],'attributes':_0x1f1313[_0x100f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51388e){logger['info'](_0x100f('0x18'),_0x2288ea);logger['debug'](_0x100f('0x18'),_0x2288ea,JSON[_0x100f('0x13')](_0x51388e));_0x2c022b(_0x51388e);})[_0x100f('0x17')](function(_0xd65640){logger['error'](_0x100f('0x18'),_0xd65640['message'],_0x2288ea);_0x4c6de9(_0x4c651d[_0x100f('0x14')](0x1f4,_0xd65640['message']));});});}; \ No newline at end of file +var _0x7670=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','find','options','where','attributes','include','map','model'];(function(_0x32d7e8,_0x2ad5d8){var _0x33f098=function(_0x490c3a){while(--_0x490c3a){_0x32d7e8['push'](_0x32d7e8['shift']());}};_0x33f098(++_0x2ad5d8);}(_0x7670,0xda));var _0x0767=function(_0x2fd21f,_0x104a24){_0x2fd21f=_0x2fd21f-0x0;var _0x50d9de=_0x7670[_0x2fd21f];return _0x50d9de;};'use strict';var _=require('lodash');var util=require(_0x0767('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0767('0x1'));var fs=require('fs');var Redis=require(_0x0767('0x2'));var db=require(_0x0767('0x3'))['db'];var utils=require(_0x0767('0x4'));var logger=require(_0x0767('0x5'))('rpc');var config=require(_0x0767('0x6'));var jayson=require(_0x0767('0x7'));var client=jayson['client'][_0x0767('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ea28a,_0x2aaecd,_0x437545){return new BPromise(function(_0x352926,_0x2bfa8e){return client[_0x0767('0x9')](_0x4ea28a,_0x437545)[_0x0767('0xa')](function(_0x5639fc){logger[_0x0767('0xb')]('Sound,\x20%s,\x20%s',_0x2aaecd,'request\x20sent');logger[_0x0767('0xc')](_0x0767('0xd'),_0x2aaecd,_0x0767('0xe'),JSON[_0x0767('0xf')](_0x5639fc));if(_0x5639fc[_0x0767('0x10')]){if(_0x5639fc[_0x0767('0x10')][_0x0767('0x11')]===0x1f4){logger[_0x0767('0x10')](_0x0767('0x12'),_0x2aaecd,_0x5639fc[_0x0767('0x10')][_0x0767('0x13')]);return _0x2bfa8e(_0x5639fc[_0x0767('0x10')][_0x0767('0x13')]);}logger[_0x0767('0x10')](_0x0767('0x12'),_0x2aaecd,_0x5639fc[_0x0767('0x10')]['message']);return _0x352926(_0x5639fc[_0x0767('0x10')][_0x0767('0x13')]);}else{logger[_0x0767('0xb')](_0x0767('0x12'),_0x2aaecd,_0x0767('0xe'));_0x352926(_0x5639fc[_0x0767('0x14')]['message']);}})['catch'](function(_0x2bdce3){logger['error'](_0x0767('0x12'),_0x2aaecd,_0x2bdce3);_0x2bfa8e(_0x2bdce3);});});}exports[_0x0767('0x15')]=function(_0x2328c5){var _0x222ef7=this;return new Promise(function(_0x193f0d,_0x388095){return db[_0x0767('0x16')][_0x0767('0x17')]({'raw':_0x2328c5[_0x0767('0x18')]?_0x2328c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x2328c5[_0x0767('0x18')]?_0x2328c5[_0x0767('0x18')][_0x0767('0x19')]||null:null,'attributes':_0x2328c5['options']?_0x2328c5['options'][_0x0767('0x1a')]||null:null,'include':_0x2328c5['options']?_0x2328c5[_0x0767('0x18')][_0x0767('0x1b')]?_[_0x0767('0x1c')](_0x2328c5['options'][_0x0767('0x1b')],function(_0x2c9742){return{'model':db[_0x2c9742[_0x0767('0x1d')]],'as':_0x2c9742['as'],'attributes':_0x2c9742[_0x0767('0x1a')],'include':_0x2c9742[_0x0767('0x1b')]?_[_0x0767('0x1c')](_0x2c9742[_0x0767('0x1b')],function(_0x2434e4){return{'model':db[_0x2434e4[_0x0767('0x1d')]],'as':_0x2434e4['as'],'attributes':_0x2434e4[_0x0767('0x1a')],'include':_0x2434e4['include']?_['map'](_0x2434e4[_0x0767('0x1b')],function(_0x1b78d3){return{'model':db[_0x1b78d3['model']],'as':_0x1b78d3['as'],'attributes':_0x1b78d3[_0x0767('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0767('0xa')](function(_0x369d30){logger[_0x0767('0xb')]('ShowSound',_0x2328c5);logger['debug']('ShowSound',_0x2328c5,JSON[_0x0767('0xf')](_0x369d30));_0x193f0d(_0x369d30);})[_0x0767('0x1e')](function(_0x26fbd2){logger[_0x0767('0x10')](_0x0767('0x15'),_0x26fbd2[_0x0767('0x13')],_0x2328c5);_0x388095(_0x222ef7[_0x0767('0x10')](0x1f4,_0x26fbd2[_0x0767('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index cd3b865..3add8ca 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x53d578,_0x4ca37f){var _0x5ce805=function(_0x237705){while(--_0x237705){_0x53d578['push'](_0x53d578['shift']());}};_0x5ce805(++_0x4ca37f);}(_0x4fc2,0x111));var _0x24fc=function(_0x85d56d,_0x37f5c1){_0x85d56d=_0x85d56d-0x0;var _0x51f613=_0x4fc2[_0x85d56d];return _0x51f613;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x8603,0x190));var _0x3860=function(_0x2ce6a4,_0x51e9a9){_0x2ce6a4=_0x2ce6a4-0x0;var _0x2c90de=_0x8603[_0x2ce6a4];return _0x2c90de;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 170e4f6..f1bb434 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 _0xea93=['medium','out','STRING','TEXT','exports'];(function(_0x2c6991,_0x4b5775){var _0x4de9fa=function(_0x4ad213){while(--_0x4ad213){_0x2c6991['push'](_0x2c6991['shift']());}};_0x4de9fa(++_0x4b5775);}(_0xea93,0x126));var _0x3ea9=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0xea93[_0x455150];return _0x12ca9c;};'use strict';var Sequelize=require('sequelize');module[_0x3ea9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x3ea9('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3ea9('0x2')),'defaultValue':_0x3ea9('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3ea9('0x3')]},'providerResponse':{'type':Sequelize[_0x3ea9('0x4')]}}; \ No newline at end of file +var _0x0235=['exports','STRING','TEXT','ENUM','out','sequelize'];(function(_0x21309a,_0x33029c){var _0x4cadae=function(_0x30fd7d){while(--_0x30fd7d){_0x21309a['push'](_0x21309a['shift']());}};_0x4cadae(++_0x33029c);}(_0x0235,0x107));var _0x5023=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x0235[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x5023('0x0'));module[_0x5023('0x1')]={'uniqueid':{'type':Sequelize[_0x5023('0x2')]},'body':{'type':Sequelize[_0x5023('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x5023('0x4')]('in',_0x5023('0x5')),'defaultValue':_0x5023('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x5023('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b696a36..2ef3580 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 _0xe05d=['options','find','create','body','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','include'];(function(_0x3fbeb7,_0x316335){var _0x4dcb89=function(_0xff351f){while(--_0xff351f){_0x3fbeb7['push'](_0x3fbeb7['shift']());}};_0x4dcb89(++_0x316335);}(_0xe05d,0x1d2));var _0xde05=function(_0x2c3a47,_0x170687){_0x2c3a47=_0x2c3a47-0x0;var _0x1c04de=_0xe05d[_0x2c3a47];return _0x1c04de;};'use strict';var emlformat=require(_0xde05('0x0'));var rimraf=require(_0xde05('0x1'));var zipdir=require(_0xde05('0x2'));var jsonpatch=require(_0xde05('0x3'));var rp=require(_0xde05('0x4'));var moment=require(_0xde05('0x5'));var BPromise=require(_0xde05('0x6'));var Mustache=require(_0xde05('0x7'));var util=require(_0xde05('0x8'));var path=require(_0xde05('0x9'));var sox=require(_0xde05('0xa'));var csv=require(_0xde05('0xb'));var ejs=require(_0xde05('0xc'));var fs=require('fs');var fs_extra=require(_0xde05('0xd'));var _=require(_0xde05('0xe'));var squel=require(_0xde05('0xf'));var crypto=require(_0xde05('0x10'));var jsforce=require(_0xde05('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xde05('0xb'));var querystring=require('querystring');var Papa=require(_0xde05('0x12'));var Redis=require(_0xde05('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xde05('0x14'));var as=require(_0xde05('0x15'));var hardwareService=require(_0xde05('0x16'));var logger=require(_0xde05('0x17'))(_0xde05('0x18'));var utils=require('../../config/utils');var config=require(_0xde05('0x19'));var licenseUtil=require(_0xde05('0x1a'));var db=require(_0xde05('0x1b'))['db'];function respondWithStatusCode(_0x42f97f,_0x44e6bd){_0x44e6bd=_0x44e6bd||0xcc;return function(_0x36b710){if(_0x36b710){return _0x42f97f[_0xde05('0x1c')](_0x44e6bd);}return _0x42f97f[_0xde05('0x1d')](_0x44e6bd)['end']();};}function respondWithResult(_0x1af1d1,_0x26145e){_0x26145e=_0x26145e||0xc8;return function(_0x4cc532){if(_0x4cc532){return _0x1af1d1['status'](_0x26145e)['json'](_0x4cc532);}};}function respondWithFilteredResult(_0x1a5b64,_0x566b6e){return function(_0x802ea2){if(_0x802ea2){var _0x5ea3a1=typeof _0x566b6e[_0xde05('0x1e')]==='undefined'&&typeof _0x566b6e[_0xde05('0x1f')]==='undefined';var _0x4fe4d4=_0x802ea2[_0xde05('0x20')];var _0x1393d9=_0x5ea3a1?0x0:_0x566b6e[_0xde05('0x1e')];var _0x43684b=_0x5ea3a1?_0x802ea2[_0xde05('0x20')]:_0x566b6e[_0xde05('0x1e')]+_0x566b6e[_0xde05('0x1f')];var _0x243834;if(_0x43684b>=_0x4fe4d4){_0x43684b=_0x4fe4d4;_0x243834=0xc8;}else{_0x243834=0xce;}_0x1a5b64['status'](_0x243834);return _0x1a5b64[_0xde05('0x21')](_0xde05('0x22'),_0x1393d9+'-'+_0x43684b+'/'+_0x4fe4d4)[_0xde05('0x23')](_0x802ea2);}return null;};}function patchUpdates(_0x220dee){return function(_0x1f35e8){try{jsonpatch[_0xde05('0x24')](_0x1f35e8,_0x220dee,!![]);}catch(_0x32ed76){return BPromise[_0xde05('0x25')](_0x32ed76);}return _0x1f35e8[_0xde05('0x26')]();};}function saveUpdates(_0x47fafb,_0x2139e0){return function(_0x47ffea){if(_0x47ffea){return _0x47ffea[_0xde05('0x27')](_0x47fafb)[_0xde05('0x28')](function(_0x540b37){return _0x540b37;});}return null;};}function removeEntity(_0x3a7ccd,_0x1257c0){return function(_0x5a91ae){if(_0x5a91ae){return _0x5a91ae[_0xde05('0x29')]()[_0xde05('0x28')](function(){_0x3a7ccd[_0xde05('0x1d')](0xcc)[_0xde05('0x2a')]();});}};}function handleEntityNotFound(_0x4b8699,_0x9f76ee){return function(_0xc1095f){if(!_0xc1095f){_0x4b8699[_0xde05('0x1c')](0x194);}return _0xc1095f;};}function handleError(_0x6281f4,_0x4b1bd5){_0x4b1bd5=_0x4b1bd5||0x1f4;return function(_0x66ee12){logger['error'](_0x66ee12['stack']);if(_0x66ee12[_0xde05('0x2b')]){delete _0x66ee12['name'];}_0x6281f4['status'](_0x4b1bd5)['send'](_0x66ee12);};}exports[_0xde05('0x2c')]=function(_0x1f58c4,_0x722407){var _0x41aff2={},_0x5b1172={},_0x2532a6={'count':0x0,'rows':[]};var _0x297df5=_[_0xde05('0x2d')](db[_0xde05('0x2e')][_0xde05('0x2f')],function(_0x502308){return{'name':_0x502308[_0xde05('0x30')],'type':_0x502308[_0xde05('0x31')][_0xde05('0x32')]};});_0x5b1172[_0xde05('0x33')]=_['map'](_0x297df5,_0xde05('0x2b'));_0x5b1172[_0xde05('0x34')]=_[_0xde05('0x35')](_0x1f58c4['query']);_0x5b1172[_0xde05('0x36')]=_[_0xde05('0x37')](_0x5b1172[_0xde05('0x33')],_0x5b1172['query']);_0x41aff2['attributes']=_[_0xde05('0x37')](_0x5b1172[_0xde05('0x33')],qs[_0xde05('0x38')](_0x1f58c4[_0xde05('0x34')][_0xde05('0x38')]));_0x41aff2[_0xde05('0x39')]=_0x41aff2[_0xde05('0x39')][_0xde05('0x3a')]?_0x41aff2[_0xde05('0x39')]:_0x5b1172[_0xde05('0x33')];if(!_0x1f58c4[_0xde05('0x34')][_0xde05('0x3b')](_0xde05('0x3c'))){_0x41aff2[_0xde05('0x1f')]=qs[_0xde05('0x1f')](_0x1f58c4[_0xde05('0x34')][_0xde05('0x1f')]);_0x41aff2[_0xde05('0x1e')]=qs['offset'](_0x1f58c4[_0xde05('0x34')][_0xde05('0x1e')]);}_0x41aff2['order']=qs[_0xde05('0x3d')](_0x1f58c4[_0xde05('0x34')][_0xde05('0x3d')]);_0x41aff2[_0xde05('0x3e')]=qs['filters'](_[_0xde05('0x3f')](_0x1f58c4[_0xde05('0x34')],_0x5b1172['filters']),_0x297df5);if(_0x1f58c4[_0xde05('0x34')][_0xde05('0x40')]){_0x41aff2[_0xde05('0x3e')]=_[_0xde05('0x41')](_0x41aff2[_0xde05('0x3e')],{'$or':_[_0xde05('0x2d')](_0x297df5,function(_0x386598){if(_0x386598[_0xde05('0x31')]!==_0xde05('0x42')){var _0x486cf5={};_0x486cf5[_0x386598[_0xde05('0x2b')]]={'$like':'%'+_0x1f58c4[_0xde05('0x34')][_0xde05('0x40')]+'%'};return _0x486cf5;}})});}_0x41aff2=_[_0xde05('0x41')]({},_0x41aff2,_0x1f58c4['options']);var _0x1a2472={'where':_0x41aff2[_0xde05('0x3e')]};return db[_0xde05('0x2e')][_0xde05('0x20')](_0x1a2472)[_0xde05('0x28')](function(_0x562ed7){_0x2532a6[_0xde05('0x20')]=_0x562ed7;if(_0x1f58c4['query']['includeAll']){_0x41aff2['include']=[{'all':!![]}];}return db[_0xde05('0x2e')][_0xde05('0x43')](_0x41aff2);})[_0xde05('0x28')](function(_0x43f6de){_0x2532a6[_0xde05('0x44')]=_0x43f6de;return _0x2532a6;})[_0xde05('0x28')](respondWithFilteredResult(_0x722407,_0x41aff2))[_0xde05('0x45')](handleError(_0x722407,null));};exports[_0xde05('0x46')]=function(_0x278b7a,_0x165e21){var _0x237981={'raw':!![],'where':{'id':_0x278b7a[_0xde05('0x47')]['id']}},_0x465480={};_0x465480[_0xde05('0x33')]=_[_0xde05('0x35')](db[_0xde05('0x2e')][_0xde05('0x2f')]);_0x465480[_0xde05('0x34')]=_[_0xde05('0x35')](_0x278b7a[_0xde05('0x34')]);_0x465480[_0xde05('0x36')]=_[_0xde05('0x37')](_0x465480[_0xde05('0x33')],_0x465480[_0xde05('0x34')]);_0x237981[_0xde05('0x39')]=_['intersection'](_0x465480[_0xde05('0x33')],qs[_0xde05('0x38')](_0x278b7a[_0xde05('0x34')][_0xde05('0x38')]));_0x237981['attributes']=_0x237981[_0xde05('0x39')]['length']?_0x237981[_0xde05('0x39')]:_0x465480[_0xde05('0x33')];if(_0x278b7a['query']['includeAll']){_0x237981[_0xde05('0x48')]=[{'all':!![]}];}_0x237981=_[_0xde05('0x41')]({},_0x237981,_0x278b7a[_0xde05('0x49')]);return db['SquareMessage'][_0xde05('0x4a')](_0x237981)[_0xde05('0x28')](handleEntityNotFound(_0x165e21,null))[_0xde05('0x28')](respondWithResult(_0x165e21,null))[_0xde05('0x45')](handleError(_0x165e21,null));};exports[_0xde05('0x4b')]=function(_0x57fde9,_0x12ac53){return db[_0xde05('0x2e')][_0xde05('0x4b')](_0x57fde9[_0xde05('0x4c')],{})['then'](respondWithResult(_0x12ac53,0xc9))[_0xde05('0x45')](handleError(_0x12ac53,null));};exports[_0xde05('0x27')]=function(_0x3fe62c,_0x2fa267){if(_0x3fe62c[_0xde05('0x4c')]['id']){delete _0x3fe62c[_0xde05('0x4c')]['id'];}return db[_0xde05('0x2e')]['find']({'where':{'id':_0x3fe62c['params']['id']}})[_0xde05('0x28')](handleEntityNotFound(_0x2fa267,null))['then'](saveUpdates(_0x3fe62c[_0xde05('0x4c')],null))['then'](respondWithResult(_0x2fa267,null))['catch'](handleError(_0x2fa267,null));};exports['destroy']=function(_0x3755b4,_0x4841e9){return db['SquareMessage'][_0xde05('0x4a')]({'where':{'id':_0x3755b4[_0xde05('0x47')]['id']}})[_0xde05('0x28')](handleEntityNotFound(_0x4841e9,null))[_0xde05('0x28')](removeEntity(_0x4841e9,null))[_0xde05('0x45')](handleError(_0x4841e9,null));}; \ No newline at end of file +var _0xfece=['squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','SquareMessage','rows','catch','show','params','find','body','update','destroy','eml-format','rimraf','moment','util','ejs','lodash'];(function(_0x2ac6ef,_0xc7cf73){var _0x73130e=function(_0x96af71){while(--_0x96af71){_0x2ac6ef['push'](_0x2ac6ef['shift']());}};_0x73130e(++_0xc7cf73);}(_0xfece,0x19e));var _0xefec=function(_0x495090,_0x11c52c){_0x495090=_0x495090-0x0;var _0x24ab0c=_0xfece[_0x495090];return _0x24ab0c;};'use strict';var emlformat=require(_0xefec('0x0'));var rimraf=require(_0xefec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefec('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefec('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xefec('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefec('0x5'));var squel=require(_0xefec('0x6'));var crypto=require(_0xefec('0x7'));var jsforce=require(_0xefec('0x8'));var deskjs=require(_0xefec('0x9'));var toCsv=require(_0xefec('0xa'));var querystring=require('querystring');var Papa=require(_0xefec('0xb'));var Redis=require(_0xefec('0xc'));var authService=require(_0xefec('0xd'));var qs=require(_0xefec('0xe'));var as=require(_0xefec('0xf'));var hardwareService=require(_0xefec('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xefec('0x11'));var config=require(_0xefec('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xefec('0x13'))['db'];function respondWithStatusCode(_0x49337a,_0x40c28f){_0x40c28f=_0x40c28f||0xcc;return function(_0x18436f){if(_0x18436f){return _0x49337a[_0xefec('0x14')](_0x40c28f);}return _0x49337a[_0xefec('0x15')](_0x40c28f)[_0xefec('0x16')]();};}function respondWithResult(_0x4b3021,_0x175f5f){_0x175f5f=_0x175f5f||0xc8;return function(_0xf3e25){if(_0xf3e25){return _0x4b3021[_0xefec('0x15')](_0x175f5f)[_0xefec('0x17')](_0xf3e25);}};}function respondWithFilteredResult(_0x34a2a6,_0x5a97ff){return function(_0x3829e4){if(_0x3829e4){var _0x40397a=typeof _0x5a97ff[_0xefec('0x18')]===_0xefec('0x19')&&typeof _0x5a97ff[_0xefec('0x1a')]===_0xefec('0x19');var _0xbad60f=_0x3829e4[_0xefec('0x1b')];var _0x2bf27e=_0x40397a?0x0:_0x5a97ff['offset'];var _0x20c4fb=_0x40397a?_0x3829e4[_0xefec('0x1b')]:_0x5a97ff[_0xefec('0x18')]+_0x5a97ff['limit'];var _0x343b5b;if(_0x20c4fb>=_0xbad60f){_0x20c4fb=_0xbad60f;_0x343b5b=0xc8;}else{_0x343b5b=0xce;}_0x34a2a6['status'](_0x343b5b);return _0x34a2a6[_0xefec('0x1c')](_0xefec('0x1d'),_0x2bf27e+'-'+_0x20c4fb+'/'+_0xbad60f)['json'](_0x3829e4);}return null;};}function patchUpdates(_0xd4eb4){return function(_0x264c3a){try{jsonpatch[_0xefec('0x1e')](_0x264c3a,_0xd4eb4,!![]);}catch(_0x21ff56){return BPromise[_0xefec('0x1f')](_0x21ff56);}return _0x264c3a['save']();};}function saveUpdates(_0x4ea0cc,_0xf5899c){return function(_0x20735c){if(_0x20735c){return _0x20735c['update'](_0x4ea0cc)[_0xefec('0x20')](function(_0x1e697d){return _0x1e697d;});}return null;};}function removeEntity(_0x27d3a7,_0x4b5e50){return function(_0x19f4fe){if(_0x19f4fe){return _0x19f4fe['destroy']()[_0xefec('0x20')](function(){_0x27d3a7[_0xefec('0x15')](0xcc)[_0xefec('0x16')]();});}};}function handleEntityNotFound(_0x594702,_0x24f47b){return function(_0x26e169){if(!_0x26e169){_0x594702['sendStatus'](0x194);}return _0x26e169;};}function handleError(_0x13264a,_0x2a7ac8){_0x2a7ac8=_0x2a7ac8||0x1f4;return function(_0x2ee9ed){logger[_0xefec('0x21')](_0x2ee9ed[_0xefec('0x22')]);if(_0x2ee9ed['name']){delete _0x2ee9ed[_0xefec('0x23')];}_0x13264a[_0xefec('0x15')](_0x2a7ac8)[_0xefec('0x24')](_0x2ee9ed);};}exports[_0xefec('0x25')]=function(_0x5939eb,_0xc41281){var _0x389dff={},_0x37d76c={},_0x442c5f={'count':0x0,'rows':[]};var _0x342727=_[_0xefec('0x26')](db['SquareMessage'][_0xefec('0x27')],function(_0x38cd90){return{'name':_0x38cd90[_0xefec('0x28')],'type':_0x38cd90[_0xefec('0x29')][_0xefec('0x2a')]};});_0x37d76c['model']=_['map'](_0x342727,'name');_0x37d76c[_0xefec('0x2b')]=_[_0xefec('0x2c')](_0x5939eb[_0xefec('0x2b')]);_0x37d76c['filters']=_[_0xefec('0x2d')](_0x37d76c['model'],_0x37d76c[_0xefec('0x2b')]);_0x389dff[_0xefec('0x2e')]=_[_0xefec('0x2d')](_0x37d76c[_0xefec('0x2f')],qs[_0xefec('0x30')](_0x5939eb[_0xefec('0x2b')][_0xefec('0x30')]));_0x389dff[_0xefec('0x2e')]=_0x389dff[_0xefec('0x2e')][_0xefec('0x31')]?_0x389dff[_0xefec('0x2e')]:_0x37d76c[_0xefec('0x2f')];if(!_0x5939eb['query'][_0xefec('0x32')]('nolimit')){_0x389dff['limit']=qs[_0xefec('0x1a')](_0x5939eb[_0xefec('0x2b')][_0xefec('0x1a')]);_0x389dff['offset']=qs['offset'](_0x5939eb['query'][_0xefec('0x18')]);}_0x389dff[_0xefec('0x33')]=qs[_0xefec('0x34')](_0x5939eb['query']['sort']);_0x389dff['where']=qs['filters'](_[_0xefec('0x35')](_0x5939eb[_0xefec('0x2b')],_0x37d76c[_0xefec('0x36')]),_0x342727);if(_0x5939eb[_0xefec('0x2b')][_0xefec('0x37')]){_0x389dff[_0xefec('0x38')]=_['merge'](_0x389dff['where'],{'$or':_[_0xefec('0x26')](_0x342727,function(_0x2f4481){if(_0x2f4481[_0xefec('0x29')]!==_0xefec('0x39')){var _0x4c36c1={};_0x4c36c1[_0x2f4481[_0xefec('0x23')]]={'$like':'%'+_0x5939eb[_0xefec('0x2b')][_0xefec('0x37')]+'%'};return _0x4c36c1;}})});}_0x389dff=_[_0xefec('0x3a')]({},_0x389dff,_0x5939eb[_0xefec('0x3b')]);var _0x161215={'where':_0x389dff[_0xefec('0x38')]};return db['SquareMessage'][_0xefec('0x1b')](_0x161215)['then'](function(_0x555b6a){_0x442c5f[_0xefec('0x1b')]=_0x555b6a;if(_0x5939eb[_0xefec('0x2b')][_0xefec('0x3c')]){_0x389dff['include']=[{'all':!![]}];}return db[_0xefec('0x3d')]['findAll'](_0x389dff);})[_0xefec('0x20')](function(_0x405683){_0x442c5f[_0xefec('0x3e')]=_0x405683;return _0x442c5f;})[_0xefec('0x20')](respondWithFilteredResult(_0xc41281,_0x389dff))[_0xefec('0x3f')](handleError(_0xc41281,null));};exports[_0xefec('0x40')]=function(_0x272605,_0x4d4289){var _0x46689c={'raw':!![],'where':{'id':_0x272605[_0xefec('0x41')]['id']}},_0x3afdc6={};_0x3afdc6[_0xefec('0x2f')]=_[_0xefec('0x2c')](db[_0xefec('0x3d')][_0xefec('0x27')]);_0x3afdc6[_0xefec('0x2b')]=_[_0xefec('0x2c')](_0x272605[_0xefec('0x2b')]);_0x3afdc6[_0xefec('0x36')]=_['intersection'](_0x3afdc6[_0xefec('0x2f')],_0x3afdc6[_0xefec('0x2b')]);_0x46689c[_0xefec('0x2e')]=_[_0xefec('0x2d')](_0x3afdc6['model'],qs[_0xefec('0x30')](_0x272605['query']['fields']));_0x46689c[_0xefec('0x2e')]=_0x46689c[_0xefec('0x2e')][_0xefec('0x31')]?_0x46689c[_0xefec('0x2e')]:_0x3afdc6[_0xefec('0x2f')];if(_0x272605[_0xefec('0x2b')][_0xefec('0x3c')]){_0x46689c['include']=[{'all':!![]}];}_0x46689c=_['merge']({},_0x46689c,_0x272605[_0xefec('0x3b')]);return db[_0xefec('0x3d')][_0xefec('0x42')](_0x46689c)[_0xefec('0x20')](handleEntityNotFound(_0x4d4289,null))[_0xefec('0x20')](respondWithResult(_0x4d4289,null))[_0xefec('0x3f')](handleError(_0x4d4289,null));};exports['create']=function(_0x26163f,_0x1ad468){return db[_0xefec('0x3d')]['create'](_0x26163f[_0xefec('0x43')],{})[_0xefec('0x20')](respondWithResult(_0x1ad468,0xc9))[_0xefec('0x3f')](handleError(_0x1ad468,null));};exports[_0xefec('0x44')]=function(_0x373dd9,_0x3fbc46){if(_0x373dd9[_0xefec('0x43')]['id']){delete _0x373dd9['body']['id'];}return db['SquareMessage'][_0xefec('0x42')]({'where':{'id':_0x373dd9[_0xefec('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fbc46,null))[_0xefec('0x20')](saveUpdates(_0x373dd9[_0xefec('0x43')],null))[_0xefec('0x20')](respondWithResult(_0x3fbc46,null))[_0xefec('0x3f')](handleError(_0x3fbc46,null));};exports[_0xefec('0x45')]=function(_0x51731,_0x5f1fdb){return db[_0xefec('0x3d')][_0xefec('0x42')]({'where':{'id':_0x51731[_0xefec('0x41')]['id']}})[_0xefec('0x20')](handleEntityNotFound(_0x5f1fdb,null))['then'](removeEntity(_0x5f1fdb,null))['catch'](handleError(_0x5f1fdb,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 7980f17..97b79d8 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 _0x570c=['define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports'];(function(_0x2e03fa,_0x3cb6f4){var _0x4ee3af=function(_0x37ab7a){while(--_0x37ab7a){_0x2e03fa['push'](_0x2e03fa['shift']());}};_0x4ee3af(++_0x3cb6f4);}(_0x570c,0x17d));var _0xc570=function(_0x558d39,_0x4be256){_0x558d39=_0x558d39-0x0;var _0x5bdb26=_0x570c[_0x558d39];return _0x5bdb26;};'use strict';var _=require(_0xc570('0x0'));var util=require(_0xc570('0x1'));var logger=require(_0xc570('0x2'))(_0xc570('0x3'));var moment=require(_0xc570('0x4'));var BPromise=require(_0xc570('0x5'));var rp=require(_0xc570('0x6'));var fs=require('fs');var path=require(_0xc570('0x7'));var rimraf=require('rimraf');var config=require(_0xc570('0x8'));var attributes=require(_0xc570('0x9'));module[_0xc570('0xa')]=function(_0x36f32e,_0x29a02f){return _0x36f32e[_0xc570('0xb')](_0xc570('0xc'),attributes,{'tableName':_0xc570('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb160=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb160,0xef));var _0x0b16=function(_0x53e2b1,_0x3f45df){_0x53e2b1=_0x53e2b1-0x0;var _0x257993=_0xb160[_0x53e2b1];return _0x257993;};'use strict';var _=require(_0x0b16('0x0'));var util=require(_0x0b16('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0b16('0x2'));var BPromise=require(_0x0b16('0x3'));var rp=require(_0x0b16('0x4'));var fs=require('fs');var path=require(_0x0b16('0x5'));var rimraf=require(_0x0b16('0x6'));var config=require(_0x0b16('0x7'));var attributes=require(_0x0b16('0x8'));module[_0x0b16('0x9')]=function(_0x578496,_0x1f32b6){return _0x578496[_0x0b16('0xa')](_0x0b16('0xb'),attributes,{'tableName':_0x0b16('0xc'),'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 235895a..8cb33e7 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 _0x2e72=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateSquareMessage','SquareMessage','create','body','options'];(function(_0xc5bb7f,_0x336c16){var _0x5ed8f7=function(_0x6c77bf){while(--_0x6c77bf){_0xc5bb7f['push'](_0xc5bb7f['shift']());}};_0x5ed8f7(++_0x336c16);}(_0x2e72,0x10e));var _0x22e7=function(_0x2fdee1,_0x466858){_0x2fdee1=_0x2fdee1-0x0;var _0x2c5533=_0x2e72[_0x2fdee1];return _0x2c5533;};'use strict';var _=require(_0x22e7('0x0'));var util=require(_0x22e7('0x1'));var moment=require(_0x22e7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22e7('0x3'));var db=require(_0x22e7('0x4'))['db'];var utils=require(_0x22e7('0x5'));var logger=require(_0x22e7('0x6'))('rpc');var config=require(_0x22e7('0x7'));var jayson=require(_0x22e7('0x8'));var client=jayson[_0x22e7('0x9')][_0x22e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23153c,_0x345785,_0x5b36de){return new BPromise(function(_0x3d4dd3,_0x28808a){return client[_0x22e7('0xb')](_0x23153c,_0x5b36de)[_0x22e7('0xc')](function(_0x3a1900){logger['info'](_0x22e7('0xd'),_0x345785,_0x22e7('0xe'));logger[_0x22e7('0xf')](_0x22e7('0x10'),_0x345785,_0x22e7('0xe'),JSON[_0x22e7('0x11')](_0x3a1900));if(_0x3a1900[_0x22e7('0x12')]){if(_0x3a1900['error']['code']===0x1f4){logger[_0x22e7('0x12')](_0x22e7('0xd'),_0x345785,_0x3a1900[_0x22e7('0x12')][_0x22e7('0x13')]);return _0x28808a(_0x3a1900[_0x22e7('0x12')][_0x22e7('0x13')]);}logger[_0x22e7('0x12')]('SquareMessage,\x20%s,\x20%s',_0x345785,_0x3a1900['error']['message']);return _0x3d4dd3(_0x3a1900['error'][_0x22e7('0x13')]);}else{logger[_0x22e7('0x14')](_0x22e7('0xd'),_0x345785,'request\x20sent');_0x3d4dd3(_0x3a1900['result'][_0x22e7('0x13')]);}})[_0x22e7('0x15')](function(_0x21ef21){logger[_0x22e7('0x12')](_0x22e7('0xd'),_0x345785,_0x21ef21);_0x28808a(_0x21ef21);});});}exports[_0x22e7('0x16')]=function(_0x15c1d4){var _0x29813c=this;return new Promise(function(_0x2e046f,_0x4dcce5){return db[_0x22e7('0x17')][_0x22e7('0x18')](_0x15c1d4[_0x22e7('0x19')],{'raw':_0x15c1d4['options']?_0x15c1d4[_0x22e7('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x22e7('0xc')](function(_0x56b02a){logger[_0x22e7('0x14')](_0x22e7('0x16'),_0x15c1d4);logger[_0x22e7('0xf')](_0x22e7('0x16'),_0x15c1d4,JSON[_0x22e7('0x11')](_0x56b02a));_0x2e046f(_0x56b02a);})[_0x22e7('0x15')](function(_0x3a6c42){logger[_0x22e7('0x12')](_0x22e7('0x16'),_0x3a6c42[_0x22e7('0x13')],_0x15c1d4);_0x4dcce5(_0x29813c[_0x22e7('0x12')](0x1f4,_0x3a6c42[_0x22e7('0x13')]));});});}; \ No newline at end of file +var _0x9ff4=['SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','ioredis','../../config/utils','../../config/logger','jayson/promise','request','then','info'];(function(_0xc689c7,_0x63165a){var _0x535e43=function(_0x429c8b){while(--_0x429c8b){_0xc689c7['push'](_0xc689c7['shift']());}};_0x535e43(++_0x63165a);}(_0x9ff4,0x159));var _0x49ff=function(_0x284e7c,_0x248a22){_0x284e7c=_0x284e7c-0x0;var _0x4aee36=_0x9ff4[_0x284e7c];return _0x4aee36;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49ff('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x49ff('0x1'));var logger=require(_0x49ff('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49ff('0x3'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x553dab,_0x1c7322,_0x21ccba){return new BPromise(function(_0x32f577,_0x4772b4){return client[_0x49ff('0x4')](_0x553dab,_0x21ccba)[_0x49ff('0x5')](function(_0x1b7b4e){logger[_0x49ff('0x6')](_0x49ff('0x7'),_0x1c7322,_0x49ff('0x8'));logger[_0x49ff('0x9')](_0x49ff('0xa'),_0x1c7322,_0x49ff('0x8'),JSON[_0x49ff('0xb')](_0x1b7b4e));if(_0x1b7b4e[_0x49ff('0xc')]){if(_0x1b7b4e[_0x49ff('0xc')]['code']===0x1f4){logger[_0x49ff('0xc')](_0x49ff('0x7'),_0x1c7322,_0x1b7b4e['error'][_0x49ff('0xd')]);return _0x4772b4(_0x1b7b4e[_0x49ff('0xc')][_0x49ff('0xd')]);}logger[_0x49ff('0xc')](_0x49ff('0x7'),_0x1c7322,_0x1b7b4e[_0x49ff('0xc')][_0x49ff('0xd')]);return _0x32f577(_0x1b7b4e[_0x49ff('0xc')][_0x49ff('0xd')]);}else{logger[_0x49ff('0x6')](_0x49ff('0x7'),_0x1c7322,'request\x20sent');_0x32f577(_0x1b7b4e[_0x49ff('0xe')][_0x49ff('0xd')]);}})[_0x49ff('0xf')](function(_0x514b7b){logger['error'](_0x49ff('0x7'),_0x1c7322,_0x514b7b);_0x4772b4(_0x514b7b);});});}exports['CreateSquareMessage']=function(_0x5bdb4c){var _0x1995a6=this;return new Promise(function(_0x1637aa,_0x4140d9){return db[_0x49ff('0x10')][_0x49ff('0x11')](_0x5bdb4c[_0x49ff('0x12')],{'raw':_0x5bdb4c[_0x49ff('0x13')]?_0x5bdb4c[_0x49ff('0x13')][_0x49ff('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x518034){logger['info'](_0x49ff('0x15'),_0x5bdb4c);logger[_0x49ff('0x9')](_0x49ff('0x15'),_0x5bdb4c,JSON[_0x49ff('0xb')](_0x518034));_0x1637aa(_0x518034);})['catch'](function(_0x3baefa){logger[_0x49ff('0xc')]('CreateSquareMessage',_0x3baefa[_0x49ff('0xd')],_0x5bdb4c);_0x4140d9(_0x1995a6[_0x49ff('0xc')](0x1f4,_0x3baefa[_0x49ff('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a857914..9ffb8c3 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 _0xe10f=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','15s','test','post','create'];(function(_0xdabd59,_0x55e984){var _0x4af920=function(_0x7e5f46){while(--_0x7e5f46){_0xdabd59['push'](_0xdabd59['shift']());}};_0x4af920(++_0x55e984);}(_0xe10f,0xc1));var _0xfe10=function(_0x550baf,_0x591813){_0x550baf=_0x550baf-0x0;var _0x497b3e=_0xe10f[_0x550baf];return _0x497b3e;};'use strict';var multer=require(_0xfe10('0x0'));var util=require(_0xfe10('0x1'));var path=require(_0xfe10('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe10('0x3'));var router=express['Router']();var fs_extra=require(_0xfe10('0x4'));var auth=require(_0xfe10('0x5'));var interaction=require(_0xfe10('0x6'));var config=require(_0xfe10('0x7'));var controller=require(_0xfe10('0x8'));router[_0xfe10('0x9')]('/',auth[_0xfe10('0xa')](),controller['index']);router[_0xfe10('0x9')](_0xfe10('0xb'),auth['isAuthenticated'](),controller[_0xfe10('0xc')]);router['get']('/:id/test',auth[_0xfe10('0xa')](),timeout(_0xfe10('0xd')),controller[_0xfe10('0xe')]);router[_0xfe10('0xf')]('/',auth['isAuthenticated'](),controller[_0xfe10('0x10')]);router['put'](_0xfe10('0xb'),auth[_0xfe10('0xa')](),controller[_0xfe10('0x11')]);router[_0xfe10('0x12')](_0xfe10('0xb'),auth['isAuthenticated'](),controller[_0xfe10('0x13')]);module[_0xfe10('0x14')]=router; \ No newline at end of file +var _0xef52=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','create','put'];(function(_0x3bcbcd,_0x226221){var _0x4669c8=function(_0x3d7916){while(--_0x3d7916){_0x3bcbcd['push'](_0x3bcbcd['shift']());}};_0x4669c8(++_0x226221);}(_0xef52,0x137));var _0x2ef5=function(_0x22a8c4,_0x51c09a){_0x22a8c4=_0x22a8c4-0x0;var _0x104c6d=_0xef52[_0x22a8c4];return _0x104c6d;};'use strict';var multer=require(_0x2ef5('0x0'));var util=require(_0x2ef5('0x1'));var path=require('path');var timeout=require(_0x2ef5('0x2'));var express=require(_0x2ef5('0x3'));var router=express['Router']();var fs_extra=require(_0x2ef5('0x4'));var auth=require(_0x2ef5('0x5'));var interaction=require(_0x2ef5('0x6'));var config=require(_0x2ef5('0x7'));var controller=require(_0x2ef5('0x8'));router[_0x2ef5('0x9')]('/',auth[_0x2ef5('0xa')](),controller[_0x2ef5('0xb')]);router[_0x2ef5('0x9')](_0x2ef5('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2ef5('0xd'),auth['isAuthenticated'](),timeout(_0x2ef5('0xe')),controller[_0x2ef5('0xf')]);router[_0x2ef5('0x10')]('/',auth[_0x2ef5('0xa')](),controller[_0x2ef5('0x11')]);router[_0x2ef5('0x12')](_0x2ef5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2ef5('0x13')]('/:id',auth[_0x2ef5('0xa')](),controller[_0x2ef5('0x14')]);module[_0x2ef5('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 48d3459..e042e25 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 _0x13a7=['STRING','name','sequelize','exports'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x13a7,0xb6));var _0x713a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13a7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x713a('0x0'));module[_0x713a('0x1')]={'name':{'type':Sequelize[_0x713a('0x2')],'unique':_0x713a('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x713a('0x2')]}}; \ No newline at end of file +var _0xe425=['sequelize','exports','STRING','name'];(function(_0x10162d,_0x421be6){var _0x5139ad=function(_0x5cb616){while(--_0x5cb616){_0x10162d['push'](_0x10162d['shift']());}};_0x5139ad(++_0x421be6);}(_0xe425,0x1b0));var _0x5e42=function(_0x101d59,_0x331222){_0x101d59=_0x101d59-0x0;var _0x31dddd=_0xe425[_0x101d59];return _0x31dddd;};'use strict';var Sequelize=require(_0x5e42('0x0'));module[_0x5e42('0x1')]={'name':{'type':Sequelize[_0x5e42('0x2')],'unique':_0x5e42('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e3535bf..535a205 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 _0xa2b2=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','SquareOdbc','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','test','dsn','odbc','closeSync','eml-format','rimraf','fast-json-patch','moment','bluebird','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','get','ODBC','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','query','keys','filters'];(function(_0x1402f9,_0x172161){var _0x1f5ef7=function(_0x5a1967){while(--_0x5a1967){_0x1402f9['push'](_0x1402f9['shift']());}};_0x1f5ef7(++_0x172161);}(_0xa2b2,0xdb));var _0x2a2b=function(_0x10e8a4,_0x4f0789){_0x10e8a4=_0x10e8a4-0x0;var _0x56d281=_0xa2b2[_0x10e8a4];return _0x56d281;};'use strict';var emlformat=require(_0x2a2b('0x0'));var rimraf=require(_0x2a2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a2b('0x2'));var rp=require('request-promise');var moment=require(_0x2a2b('0x3'));var BPromise=require(_0x2a2b('0x4'));var Mustache=require('mustache');var util=require(_0x2a2b('0x5'));var path=require(_0x2a2b('0x6'));var sox=require(_0x2a2b('0x7'));var csv=require(_0x2a2b('0x8'));var ejs=require(_0x2a2b('0x9'));var fs=require('fs');var fs_extra=require(_0x2a2b('0xa'));var _=require(_0x2a2b('0xb'));var squel=require(_0x2a2b('0xc'));var crypto=require(_0x2a2b('0xd'));var jsforce=require(_0x2a2b('0xe'));var deskjs=require(_0x2a2b('0xf'));var toCsv=require(_0x2a2b('0x8'));var querystring=require(_0x2a2b('0x10'));var Papa=require(_0x2a2b('0x11'));var Redis=require(_0x2a2b('0x12'));var authService=require(_0x2a2b('0x13'));var qs=require(_0x2a2b('0x14'));var as=require(_0x2a2b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a2b('0x16'))(_0x2a2b('0x17'));var utils=require('../../config/utils');var config=require(_0x2a2b('0x18'));var licenseUtil=require(_0x2a2b('0x19'));var db=require(_0x2a2b('0x1a'))['db'];function respondWithStatusCode(_0x32bc78,_0x1c74ae){_0x1c74ae=_0x1c74ae||0xcc;return function(_0x13d3df){if(_0x13d3df){return _0x32bc78[_0x2a2b('0x1b')](_0x1c74ae);}return _0x32bc78[_0x2a2b('0x1c')](_0x1c74ae)[_0x2a2b('0x1d')]();};}function respondWithResult(_0x4163a5,_0x1ffac5){_0x1ffac5=_0x1ffac5||0xc8;return function(_0x39f196){if(_0x39f196){return _0x4163a5['status'](_0x1ffac5)['json'](_0x39f196);}};}function respondWithFilteredResult(_0x502291,_0x3fcd50){return function(_0x5ca365){if(_0x5ca365){var _0x2002b3=typeof _0x3fcd50[_0x2a2b('0x1e')]===_0x2a2b('0x1f')&&typeof _0x3fcd50[_0x2a2b('0x20')]==='undefined';var _0x46a68f=_0x5ca365[_0x2a2b('0x21')];var _0x4ebc78=_0x2002b3?0x0:_0x3fcd50['offset'];var _0xbb9f0b=_0x2002b3?_0x5ca365[_0x2a2b('0x21')]:_0x3fcd50[_0x2a2b('0x1e')]+_0x3fcd50[_0x2a2b('0x20')];var _0x375dc4;if(_0xbb9f0b>=_0x46a68f){_0xbb9f0b=_0x46a68f;_0x375dc4=0xc8;}else{_0x375dc4=0xce;}_0x502291[_0x2a2b('0x1c')](_0x375dc4);return _0x502291[_0x2a2b('0x22')]('Content-Range',_0x4ebc78+'-'+_0xbb9f0b+'/'+_0x46a68f)[_0x2a2b('0x23')](_0x5ca365);}return null;};}function patchUpdates(_0x52336a){return function(_0x3266ea){try{jsonpatch[_0x2a2b('0x24')](_0x3266ea,_0x52336a,!![]);}catch(_0x37e07e){return BPromise[_0x2a2b('0x25')](_0x37e07e);}return _0x3266ea[_0x2a2b('0x26')]();};}function saveUpdates(_0x4f7fe9,_0xef62d4){return function(_0x3459db){if(_0x3459db){return _0x3459db['update'](_0x4f7fe9)['then'](function(_0x1910c3){return _0x1910c3;});}return null;};}function removeEntity(_0x4d5c73,_0x1ab9dd){return function(_0x1d4e7e){if(_0x1d4e7e){return _0x1d4e7e['destroy']()[_0x2a2b('0x27')](function(){var _0x51ce8f=_0x1d4e7e[_0x2a2b('0x28')]({'plain':!![]});var _0x5db8ab=_0x2a2b('0x29');return db[_0x2a2b('0x2a')]['destroy']({'where':{'type':_0x5db8ab,'resourceId':_0x51ce8f['id']}})[_0x2a2b('0x27')](function(){return _0x1d4e7e;});})[_0x2a2b('0x27')](function(){_0x4d5c73[_0x2a2b('0x1c')](0xcc)[_0x2a2b('0x1d')]();});}};}function handleEntityNotFound(_0x310b7e,_0x2063b1){return function(_0x3dd897){if(!_0x3dd897){_0x310b7e['sendStatus'](0x194);}return _0x3dd897;};}function handleError(_0x435f6a,_0x49c836){_0x49c836=_0x49c836||0x1f4;return function(_0x1fc96b){logger[_0x2a2b('0x2b')](_0x1fc96b[_0x2a2b('0x2c')]);if(_0x1fc96b[_0x2a2b('0x2d')]){delete _0x1fc96b[_0x2a2b('0x2d')];}_0x435f6a[_0x2a2b('0x1c')](_0x49c836)[_0x2a2b('0x2e')](_0x1fc96b);};}exports[_0x2a2b('0x2f')]=function(_0x325cf6,_0x10aaa1){var _0x37e9f2={},_0x334e64={},_0x1f822a={'count':0x0,'rows':[]};var _0x1d170d=_[_0x2a2b('0x30')](db['SquareOdbc'][_0x2a2b('0x31')],function(_0x470690){return{'name':_0x470690['fieldName'],'type':_0x470690['type'][_0x2a2b('0x32')]};});_0x334e64['model']=_[_0x2a2b('0x30')](_0x1d170d,_0x2a2b('0x2d'));_0x334e64[_0x2a2b('0x33')]=_[_0x2a2b('0x34')](_0x325cf6[_0x2a2b('0x33')]);_0x334e64[_0x2a2b('0x35')]=_[_0x2a2b('0x36')](_0x334e64[_0x2a2b('0x37')],_0x334e64[_0x2a2b('0x33')]);_0x37e9f2[_0x2a2b('0x38')]=_[_0x2a2b('0x36')](_0x334e64[_0x2a2b('0x37')],qs[_0x2a2b('0x39')](_0x325cf6['query'][_0x2a2b('0x39')]));_0x37e9f2[_0x2a2b('0x38')]=_0x37e9f2[_0x2a2b('0x38')][_0x2a2b('0x3a')]?_0x37e9f2['attributes']:_0x334e64[_0x2a2b('0x37')];if(!_0x325cf6[_0x2a2b('0x33')][_0x2a2b('0x3b')](_0x2a2b('0x3c'))){_0x37e9f2['limit']=qs['limit'](_0x325cf6[_0x2a2b('0x33')][_0x2a2b('0x20')]);_0x37e9f2['offset']=qs['offset'](_0x325cf6[_0x2a2b('0x33')]['offset']);}_0x37e9f2[_0x2a2b('0x3d')]=qs[_0x2a2b('0x3e')](_0x325cf6[_0x2a2b('0x33')][_0x2a2b('0x3e')]);_0x37e9f2['where']=qs[_0x2a2b('0x35')](_[_0x2a2b('0x3f')](_0x325cf6[_0x2a2b('0x33')],_0x334e64[_0x2a2b('0x35')]),_0x1d170d);if(_0x325cf6[_0x2a2b('0x33')][_0x2a2b('0x40')]){_0x37e9f2[_0x2a2b('0x41')]=_[_0x2a2b('0x42')](_0x37e9f2[_0x2a2b('0x41')],{'$or':_[_0x2a2b('0x30')](_0x1d170d,function(_0x2d6bc5){if(_0x2d6bc5[_0x2a2b('0x43')]!=='VIRTUAL'){var _0x3623c6={};_0x3623c6[_0x2d6bc5[_0x2a2b('0x2d')]]={'$like':'%'+_0x325cf6[_0x2a2b('0x33')]['filter']+'%'};return _0x3623c6;}})});}_0x37e9f2=_[_0x2a2b('0x42')]({},_0x37e9f2,_0x325cf6[_0x2a2b('0x44')]);var _0x5da8bc={'where':_0x37e9f2[_0x2a2b('0x41')]};return db[_0x2a2b('0x45')]['count'](_0x5da8bc)[_0x2a2b('0x27')](function(_0x4097c4){_0x1f822a[_0x2a2b('0x21')]=_0x4097c4;if(_0x325cf6[_0x2a2b('0x33')]['includeAll']){_0x37e9f2[_0x2a2b('0x46')]=[{'all':!![]}];}return db[_0x2a2b('0x45')][_0x2a2b('0x47')](_0x37e9f2);})[_0x2a2b('0x27')](function(_0x3a861a){_0x1f822a['rows']=_0x3a861a;return _0x1f822a;})['then'](respondWithFilteredResult(_0x10aaa1,_0x37e9f2))[_0x2a2b('0x48')](handleError(_0x10aaa1,null));};exports[_0x2a2b('0x49')]=function(_0x1e0fdf,_0x38aefe){var _0x140b43={'raw':!![],'where':{'id':_0x1e0fdf[_0x2a2b('0x4a')]['id']}},_0x17208f={};_0x17208f[_0x2a2b('0x37')]=_[_0x2a2b('0x34')](db[_0x2a2b('0x45')][_0x2a2b('0x31')]);_0x17208f[_0x2a2b('0x33')]=_['keys'](_0x1e0fdf[_0x2a2b('0x33')]);_0x17208f['filters']=_[_0x2a2b('0x36')](_0x17208f[_0x2a2b('0x37')],_0x17208f[_0x2a2b('0x33')]);_0x140b43[_0x2a2b('0x38')]=_[_0x2a2b('0x36')](_0x17208f[_0x2a2b('0x37')],qs[_0x2a2b('0x39')](_0x1e0fdf['query']['fields']));_0x140b43[_0x2a2b('0x38')]=_0x140b43[_0x2a2b('0x38')][_0x2a2b('0x3a')]?_0x140b43[_0x2a2b('0x38')]:_0x17208f[_0x2a2b('0x37')];if(_0x1e0fdf[_0x2a2b('0x33')][_0x2a2b('0x4b')]){_0x140b43[_0x2a2b('0x46')]=[{'all':!![]}];}_0x140b43=_[_0x2a2b('0x42')]({},_0x140b43,_0x1e0fdf[_0x2a2b('0x44')]);return db[_0x2a2b('0x45')][_0x2a2b('0x4c')](_0x140b43)['then'](handleEntityNotFound(_0x38aefe,null))[_0x2a2b('0x27')](respondWithResult(_0x38aefe,null))[_0x2a2b('0x48')](handleError(_0x38aefe,null));};exports[_0x2a2b('0x4d')]=function(_0x55c22c,_0x375828){return db[_0x2a2b('0x45')][_0x2a2b('0x4d')](_0x55c22c[_0x2a2b('0x4e')],{})['then'](function(_0x10ec1d){var _0x24365e=_0x55c22c[_0x2a2b('0x4f')][_0x2a2b('0x28')]({'plain':!![]});if(!_0x24365e)throw new Error(_0x2a2b('0x50'));if(_0x24365e[_0x2a2b('0x51')]===_0x2a2b('0x4f')){var _0x25f416=_0x10ec1d['get']({'plain':!![]});var _0x2008d5=_0x2a2b('0x29');return db[_0x2a2b('0x52')][_0x2a2b('0x4c')]({'where':{'name':_0x2008d5,'userProfileId':_0x24365e[_0x2a2b('0x53')]},'raw':!![]})['then'](function(_0x4effa7){if(_0x4effa7&&_0x4effa7[_0x2a2b('0x54')]===0x0){return db[_0x2a2b('0x2a')][_0x2a2b('0x4d')]({'name':_0x25f416[_0x2a2b('0x2d')],'resourceId':_0x25f416['id'],'type':_0x4effa7[_0x2a2b('0x2d')],'sectionId':_0x4effa7['id']},{})[_0x2a2b('0x27')](function(){return _0x10ec1d;});}else{return _0x10ec1d;}})[_0x2a2b('0x48')](function(_0x26cdbb){logger['error'](_0x2a2b('0x55'),_0x26cdbb);throw _0x26cdbb;});}return _0x10ec1d;})[_0x2a2b('0x27')](respondWithResult(_0x375828,0xc9))[_0x2a2b('0x48')](handleError(_0x375828,null));};exports['update']=function(_0x4f6407,_0x2281bc){if(_0x4f6407[_0x2a2b('0x4e')]['id']){delete _0x4f6407['body']['id'];}return db[_0x2a2b('0x45')]['find']({'where':{'id':_0x4f6407['params']['id']}})[_0x2a2b('0x27')](handleEntityNotFound(_0x2281bc,null))[_0x2a2b('0x27')](saveUpdates(_0x4f6407[_0x2a2b('0x4e')],null))[_0x2a2b('0x27')](respondWithResult(_0x2281bc,null))[_0x2a2b('0x48')](handleError(_0x2281bc,null));};exports[_0x2a2b('0x56')]=function(_0x52d890,_0x40be7e){return db[_0x2a2b('0x45')][_0x2a2b('0x4c')]({'where':{'id':_0x52d890['params']['id']}})[_0x2a2b('0x27')](handleEntityNotFound(_0x40be7e,null))[_0x2a2b('0x27')](removeEntity(_0x40be7e,null))[_0x2a2b('0x48')](handleError(_0x40be7e,null));};exports[_0x2a2b('0x57')]=function(_0x2b0246,_0x22bf87,_0x36d4aa){var _0x249f63;return db['SquareOdbc']['find']({'where':{'id':_0x2b0246[_0x2a2b('0x4a')]['id']},'attributes':['id',_0x2a2b('0x58')]})[_0x2a2b('0x27')](handleEntityNotFound(_0x22bf87,null))[_0x2a2b('0x27')](function(_0x5019e9){if(_0x5019e9){var _0x581db4=require(_0x2a2b('0x59'))();_0x581db4['openSync'](_0x5019e9[_0x2a2b('0x58')]);_0x581db4[_0x2a2b('0x5a')]();return _0x5019e9;}})[_0x2a2b('0x27')](respondWithResult(_0x22bf87,null))[_0x2a2b('0x48')](handleError(_0x22bf87,null));}; \ No newline at end of file +var _0x824e=['ODBC','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','SquareOdbc','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','Content-Range','apply','reject','update','then','destroy','get'];(function(_0x309824,_0x150a1a){var _0x2eaa86=function(_0x4273b4){while(--_0x4273b4){_0x309824['push'](_0x309824['shift']());}};_0x2eaa86(++_0x150a1a);}(_0x824e,0x142));var _0xe824=function(_0x43794c,_0x4b4158){_0x43794c=_0x43794c-0x0;var _0xa31045=_0x824e[_0x43794c];return _0xa31045;};'use strict';var emlformat=require(_0xe824('0x0'));var rimraf=require(_0xe824('0x1'));var zipdir=require(_0xe824('0x2'));var jsonpatch=require(_0xe824('0x3'));var rp=require('request-promise');var moment=require(_0xe824('0x4'));var BPromise=require(_0xe824('0x5'));var Mustache=require(_0xe824('0x6'));var util=require(_0xe824('0x7'));var path=require(_0xe824('0x8'));var sox=require(_0xe824('0x9'));var csv=require('to-csv');var ejs=require(_0xe824('0xa'));var fs=require('fs');var fs_extra=require(_0xe824('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe824('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe824('0xd'));var toCsv=require(_0xe824('0xe'));var querystring=require('querystring');var Papa=require(_0xe824('0xf'));var Redis=require(_0xe824('0x10'));var authService=require(_0xe824('0x11'));var qs=require(_0xe824('0x12'));var as=require(_0xe824('0x13'));var hardwareService=require(_0xe824('0x14'));var logger=require(_0xe824('0x15'))('api');var utils=require(_0xe824('0x16'));var config=require(_0xe824('0x17'));var licenseUtil=require(_0xe824('0x18'));var db=require(_0xe824('0x19'))['db'];function respondWithStatusCode(_0xd912e6,_0x367665){_0x367665=_0x367665||0xcc;return function(_0x5b0c14){if(_0x5b0c14){return _0xd912e6[_0xe824('0x1a')](_0x367665);}return _0xd912e6[_0xe824('0x1b')](_0x367665)['end']();};}function respondWithResult(_0x2d1bb7,_0xc674c8){_0xc674c8=_0xc674c8||0xc8;return function(_0x47e0c6){if(_0x47e0c6){return _0x2d1bb7[_0xe824('0x1b')](_0xc674c8)[_0xe824('0x1c')](_0x47e0c6);}};}function respondWithFilteredResult(_0x17f719,_0x25a27d){return function(_0x56ca55){if(_0x56ca55){var _0xcc33bd=typeof _0x25a27d[_0xe824('0x1d')]===_0xe824('0x1e')&&typeof _0x25a27d['limit']===_0xe824('0x1e');var _0x124c1e=_0x56ca55['count'];var _0x3cca96=_0xcc33bd?0x0:_0x25a27d[_0xe824('0x1d')];var _0x267259=_0xcc33bd?_0x56ca55['count']:_0x25a27d[_0xe824('0x1d')]+_0x25a27d['limit'];var _0x4d64eb;if(_0x267259>=_0x124c1e){_0x267259=_0x124c1e;_0x4d64eb=0xc8;}else{_0x4d64eb=0xce;}_0x17f719[_0xe824('0x1b')](_0x4d64eb);return _0x17f719['set'](_0xe824('0x1f'),_0x3cca96+'-'+_0x267259+'/'+_0x124c1e)['json'](_0x56ca55);}return null;};}function patchUpdates(_0xbd2c1){return function(_0x1c6300){try{jsonpatch[_0xe824('0x20')](_0x1c6300,_0xbd2c1,!![]);}catch(_0x105a34){return BPromise[_0xe824('0x21')](_0x105a34);}return _0x1c6300['save']();};}function saveUpdates(_0x3bec2d,_0x417cfc){return function(_0x2824ed){if(_0x2824ed){return _0x2824ed[_0xe824('0x22')](_0x3bec2d)[_0xe824('0x23')](function(_0x42d140){return _0x42d140;});}return null;};}function removeEntity(_0xeb11f5,_0x580866){return function(_0x105633){if(_0x105633){return _0x105633[_0xe824('0x24')]()['then'](function(){var _0x5d8dfe=_0x105633[_0xe824('0x25')]({'plain':!![]});var _0x2af780=_0xe824('0x26');return db[_0xe824('0x27')][_0xe824('0x24')]({'where':{'type':_0x2af780,'resourceId':_0x5d8dfe['id']}})[_0xe824('0x23')](function(){return _0x105633;});})[_0xe824('0x23')](function(){_0xeb11f5[_0xe824('0x1b')](0xcc)[_0xe824('0x28')]();});}};}function handleEntityNotFound(_0x4a4e93,_0x1b0308){return function(_0x16cc3d){if(!_0x16cc3d){_0x4a4e93[_0xe824('0x1a')](0x194);}return _0x16cc3d;};}function handleError(_0x2eda9d,_0x57c6c2){_0x57c6c2=_0x57c6c2||0x1f4;return function(_0x323657){logger[_0xe824('0x29')](_0x323657[_0xe824('0x2a')]);if(_0x323657[_0xe824('0x2b')]){delete _0x323657['name'];}_0x2eda9d['status'](_0x57c6c2)[_0xe824('0x2c')](_0x323657);};}exports['index']=function(_0x36ad1e,_0x43fa45){var _0x1967f3={},_0x280eb5={},_0xc4f4c7={'count':0x0,'rows':[]};var _0x196696=_[_0xe824('0x2d')](db['SquareOdbc'][_0xe824('0x2e')],function(_0xc306b3){return{'name':_0xc306b3[_0xe824('0x2f')],'type':_0xc306b3[_0xe824('0x30')][_0xe824('0x31')]};});_0x280eb5[_0xe824('0x32')]=_[_0xe824('0x2d')](_0x196696,'name');_0x280eb5[_0xe824('0x33')]=_[_0xe824('0x34')](_0x36ad1e[_0xe824('0x33')]);_0x280eb5[_0xe824('0x35')]=_['intersection'](_0x280eb5[_0xe824('0x32')],_0x280eb5[_0xe824('0x33')]);_0x1967f3[_0xe824('0x36')]=_[_0xe824('0x37')](_0x280eb5['model'],qs[_0xe824('0x38')](_0x36ad1e[_0xe824('0x33')]['fields']));_0x1967f3[_0xe824('0x36')]=_0x1967f3['attributes'][_0xe824('0x39')]?_0x1967f3['attributes']:_0x280eb5[_0xe824('0x32')];if(!_0x36ad1e[_0xe824('0x33')][_0xe824('0x3a')](_0xe824('0x3b'))){_0x1967f3[_0xe824('0x3c')]=qs[_0xe824('0x3c')](_0x36ad1e[_0xe824('0x33')][_0xe824('0x3c')]);_0x1967f3[_0xe824('0x1d')]=qs[_0xe824('0x1d')](_0x36ad1e[_0xe824('0x33')][_0xe824('0x1d')]);}_0x1967f3[_0xe824('0x3d')]=qs[_0xe824('0x3e')](_0x36ad1e[_0xe824('0x33')][_0xe824('0x3e')]);_0x1967f3['where']=qs['filters'](_[_0xe824('0x3f')](_0x36ad1e[_0xe824('0x33')],_0x280eb5[_0xe824('0x35')]),_0x196696);if(_0x36ad1e[_0xe824('0x33')][_0xe824('0x40')]){_0x1967f3['where']=_[_0xe824('0x41')](_0x1967f3[_0xe824('0x42')],{'$or':_[_0xe824('0x2d')](_0x196696,function(_0x27dc07){if(_0x27dc07[_0xe824('0x30')]!==_0xe824('0x43')){var _0x513a47={};_0x513a47[_0x27dc07[_0xe824('0x2b')]]={'$like':'%'+_0x36ad1e[_0xe824('0x33')][_0xe824('0x40')]+'%'};return _0x513a47;}})});}_0x1967f3=_[_0xe824('0x41')]({},_0x1967f3,_0x36ad1e[_0xe824('0x44')]);var _0x4771a4={'where':_0x1967f3[_0xe824('0x42')]};return db['SquareOdbc'][_0xe824('0x45')](_0x4771a4)[_0xe824('0x23')](function(_0x4ac97f){_0xc4f4c7[_0xe824('0x45')]=_0x4ac97f;if(_0x36ad1e['query'][_0xe824('0x46')]){_0x1967f3['include']=[{'all':!![]}];}return db[_0xe824('0x47')]['findAll'](_0x1967f3);})[_0xe824('0x23')](function(_0x40dc2b){_0xc4f4c7[_0xe824('0x48')]=_0x40dc2b;return _0xc4f4c7;})[_0xe824('0x23')](respondWithFilteredResult(_0x43fa45,_0x1967f3))[_0xe824('0x49')](handleError(_0x43fa45,null));};exports[_0xe824('0x4a')]=function(_0x2478d7,_0x42dac4){var _0x11e0ad={'raw':!![],'where':{'id':_0x2478d7[_0xe824('0x4b')]['id']}},_0x4979ba={};_0x4979ba[_0xe824('0x32')]=_[_0xe824('0x34')](db[_0xe824('0x47')][_0xe824('0x2e')]);_0x4979ba[_0xe824('0x33')]=_[_0xe824('0x34')](_0x2478d7[_0xe824('0x33')]);_0x4979ba[_0xe824('0x35')]=_[_0xe824('0x37')](_0x4979ba[_0xe824('0x32')],_0x4979ba['query']);_0x11e0ad[_0xe824('0x36')]=_[_0xe824('0x37')](_0x4979ba['model'],qs[_0xe824('0x38')](_0x2478d7['query'][_0xe824('0x38')]));_0x11e0ad[_0xe824('0x36')]=_0x11e0ad[_0xe824('0x36')][_0xe824('0x39')]?_0x11e0ad[_0xe824('0x36')]:_0x4979ba[_0xe824('0x32')];if(_0x2478d7[_0xe824('0x33')]['includeAll']){_0x11e0ad[_0xe824('0x4c')]=[{'all':!![]}];}_0x11e0ad=_[_0xe824('0x41')]({},_0x11e0ad,_0x2478d7['options']);return db['SquareOdbc'][_0xe824('0x4d')](_0x11e0ad)[_0xe824('0x23')](handleEntityNotFound(_0x42dac4,null))['then'](respondWithResult(_0x42dac4,null))[_0xe824('0x49')](handleError(_0x42dac4,null));};exports[_0xe824('0x4e')]=function(_0x5e06af,_0x1d6b77){return db[_0xe824('0x47')][_0xe824('0x4e')](_0x5e06af[_0xe824('0x4f')],{})[_0xe824('0x23')](function(_0xab8a57){var _0xc99651=_0x5e06af[_0xe824('0x50')][_0xe824('0x25')]({'plain':!![]});if(!_0xc99651)throw new Error(_0xe824('0x51'));if(_0xc99651[_0xe824('0x52')]==='user'){var _0x1ad39b=_0xab8a57['get']({'plain':!![]});var _0x70b865=_0xe824('0x26');return db['UserProfileSection'][_0xe824('0x4d')]({'where':{'name':_0x70b865,'userProfileId':_0xc99651[_0xe824('0x53')]},'raw':!![]})[_0xe824('0x23')](function(_0x29c461){if(_0x29c461&&_0x29c461[_0xe824('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1ad39b[_0xe824('0x2b')],'resourceId':_0x1ad39b['id'],'type':_0x29c461[_0xe824('0x2b')],'sectionId':_0x29c461['id']},{})[_0xe824('0x23')](function(){return _0xab8a57;});}else{return _0xab8a57;}})[_0xe824('0x49')](function(_0x510e91){logger[_0xe824('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x510e91);throw _0x510e91;});}return _0xab8a57;})[_0xe824('0x23')](respondWithResult(_0x1d6b77,0xc9))[_0xe824('0x49')](handleError(_0x1d6b77,null));};exports[_0xe824('0x22')]=function(_0x140dd2,_0x495423){if(_0x140dd2['body']['id']){delete _0x140dd2[_0xe824('0x4f')]['id'];}return db[_0xe824('0x47')][_0xe824('0x4d')]({'where':{'id':_0x140dd2[_0xe824('0x4b')]['id']}})[_0xe824('0x23')](handleEntityNotFound(_0x495423,null))[_0xe824('0x23')](saveUpdates(_0x140dd2['body'],null))[_0xe824('0x23')](respondWithResult(_0x495423,null))[_0xe824('0x49')](handleError(_0x495423,null));};exports[_0xe824('0x24')]=function(_0x35310b,_0x15e764){return db[_0xe824('0x47')][_0xe824('0x4d')]({'where':{'id':_0x35310b['params']['id']}})[_0xe824('0x23')](handleEntityNotFound(_0x15e764,null))[_0xe824('0x23')](removeEntity(_0x15e764,null))[_0xe824('0x49')](handleError(_0x15e764,null));};exports[_0xe824('0x55')]=function(_0x36635c,_0xbe3833,_0x3cc1b6){var _0xbc32da;return db[_0xe824('0x47')]['find']({'where':{'id':_0x36635c['params']['id']},'attributes':['id',_0xe824('0x56')]})[_0xe824('0x23')](handleEntityNotFound(_0xbe3833,null))[_0xe824('0x23')](function(_0x4c51f2){if(_0x4c51f2){var _0x1de0f6=require(_0xe824('0x57'))();_0x1de0f6[_0xe824('0x58')](_0x4c51f2[_0xe824('0x56')]);_0x1de0f6[_0xe824('0x59')]();return _0x4c51f2;}})[_0xe824('0x23')](respondWithResult(_0xbe3833,null))[_0xe824('0x49')](handleError(_0xbe3833,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 5905186..fcf1f31 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 _0xfbde=['square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x1f4705,_0x4e7e65){var _0xc02cd2=function(_0x3c3110){while(--_0x3c3110){_0x1f4705['push'](_0x1f4705['shift']());}};_0xc02cd2(++_0x4e7e65);}(_0xfbde,0xb5));var _0xefbd=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xfbde[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xefbd('0x0'));var util=require(_0xefbd('0x1'));var logger=require(_0xefbd('0x2'))(_0xefbd('0x3'));var moment=require(_0xefbd('0x4'));var BPromise=require(_0xefbd('0x5'));var rp=require(_0xefbd('0x6'));var fs=require('fs');var path=require(_0xefbd('0x7'));var rimraf=require(_0xefbd('0x8'));var config=require(_0xefbd('0x9'));var attributes=require(_0xefbd('0xa'));module[_0xefbd('0xb')]=function(_0x410263,_0x6362a6){return _0x410263[_0xefbd('0xc')](_0xefbd('0xd'),attributes,{'tableName':_0xefbd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc905=['request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird'];(function(_0x163537,_0x21aaf9){var _0x4035ba=function(_0x24346b){while(--_0x24346b){_0x163537['push'](_0x163537['shift']());}};_0x4035ba(++_0x21aaf9);}(_0xc905,0x1b5));var _0x5c90=function(_0x410e66,_0x35208f){_0x410e66=_0x410e66-0x0;var _0x178b9e=_0xc905[_0x410e66];return _0x178b9e;};'use strict';var _=require(_0x5c90('0x0'));var util=require(_0x5c90('0x1'));var logger=require('../../config/logger')(_0x5c90('0x2'));var moment=require(_0x5c90('0x3'));var BPromise=require(_0x5c90('0x4'));var rp=require(_0x5c90('0x5'));var fs=require('fs');var path=require(_0x5c90('0x6'));var rimraf=require('rimraf');var config=require(_0x5c90('0x7'));var attributes=require(_0x5c90('0x8'));module[_0x5c90('0x9')]=function(_0x3dcea7,_0xe5cbe3){return _0x3dcea7[_0x5c90('0xa')](_0x5c90('0xb'),attributes,{'tableName':_0x5c90('0xc'),'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 727d896..484a592 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 _0x6d8f=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','map','include','model','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s'];(function(_0x1feda6,_0x32f46f){var _0x3fb724=function(_0x242feb){while(--_0x242feb){_0x1feda6['push'](_0x1feda6['shift']());}};_0x3fb724(++_0x32f46f);}(_0x6d8f,0x198));var _0xf6d8=function(_0x13172e,_0x30852a){_0x13172e=_0x13172e-0x0;var _0x2df751=_0x6d8f[_0x13172e];return _0x2df751;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf6d8('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6d8('0x1'));var db=require(_0xf6d8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6d8('0x3'))(_0xf6d8('0x4'));var config=require(_0xf6d8('0x5'));var jayson=require(_0xf6d8('0x6'));var client=jayson[_0xf6d8('0x7')][_0xf6d8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bab73,_0x4823b7,_0x4f8bd4){return new BPromise(function(_0x38885c,_0x224d61){return client['request'](_0x1bab73,_0x4f8bd4)[_0xf6d8('0x9')](function(_0x5874c5){logger[_0xf6d8('0xa')](_0xf6d8('0xb'),_0x4823b7,_0xf6d8('0xc'));logger[_0xf6d8('0xd')](_0xf6d8('0xe'),_0x4823b7,_0xf6d8('0xc'),JSON[_0xf6d8('0xf')](_0x5874c5));if(_0x5874c5[_0xf6d8('0x10')]){if(_0x5874c5[_0xf6d8('0x10')][_0xf6d8('0x11')]===0x1f4){logger[_0xf6d8('0x10')](_0xf6d8('0xb'),_0x4823b7,_0x5874c5[_0xf6d8('0x10')][_0xf6d8('0x12')]);return _0x224d61(_0x5874c5[_0xf6d8('0x10')][_0xf6d8('0x12')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4823b7,_0x5874c5[_0xf6d8('0x10')][_0xf6d8('0x12')]);return _0x38885c(_0x5874c5['error'][_0xf6d8('0x12')]);}else{logger[_0xf6d8('0xa')](_0xf6d8('0xb'),_0x4823b7,_0xf6d8('0xc'));_0x38885c(_0x5874c5[_0xf6d8('0x13')][_0xf6d8('0x12')]);}})[_0xf6d8('0x14')](function(_0x34ce25){logger[_0xf6d8('0x10')](_0xf6d8('0xb'),_0x4823b7,_0x34ce25);_0x224d61(_0x34ce25);});});}exports[_0xf6d8('0x15')]=function(_0x3218b3){var _0x179398=this;return new Promise(function(_0x330052,_0x3a357b){return db[_0xf6d8('0x16')][_0xf6d8('0x17')]({'raw':_0x3218b3['options']?_0x3218b3[_0xf6d8('0x18')][_0xf6d8('0x19')]===undefined?!![]:![]:!![],'where':_0x3218b3[_0xf6d8('0x18')]?_0x3218b3[_0xf6d8('0x18')]['where']||null:null,'attributes':_0x3218b3[_0xf6d8('0x18')]?_0x3218b3['options'][_0xf6d8('0x1a')]||null:null,'include':_0x3218b3[_0xf6d8('0x18')]?_0x3218b3['options']['include']?_[_0xf6d8('0x1b')](_0x3218b3[_0xf6d8('0x18')][_0xf6d8('0x1c')],function(_0x1c8c29){return{'model':db[_0x1c8c29['model']],'as':_0x1c8c29['as'],'attributes':_0x1c8c29[_0xf6d8('0x1a')],'include':_0x1c8c29[_0xf6d8('0x1c')]?_[_0xf6d8('0x1b')](_0x1c8c29[_0xf6d8('0x1c')],function(_0x2a7914){return{'model':db[_0x2a7914['model']],'as':_0x2a7914['as'],'attributes':_0x2a7914[_0xf6d8('0x1a')],'include':_0x2a7914[_0xf6d8('0x1c')]?_['map'](_0x2a7914[_0xf6d8('0x1c')],function(_0x7010d8){return{'model':db[_0x7010d8[_0xf6d8('0x1d')]],'as':_0x7010d8['as'],'attributes':_0x7010d8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a279b){logger[_0xf6d8('0xa')]('ShowSquareOdbc',_0x3218b3);logger['debug'](_0xf6d8('0x15'),_0x3218b3,JSON[_0xf6d8('0xf')](_0x5a279b));_0x330052(_0x5a279b);})[_0xf6d8('0x14')](function(_0x3f2afd){logger['error'](_0xf6d8('0x15'),_0x3f2afd[_0xf6d8('0x12')],_0x3218b3);_0x3a357b(_0x179398['error'](0x1f4,_0x3f2afd[_0xf6d8('0x12')]));});});}; \ No newline at end of file +var _0xea74=['then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x4f4b51,_0x424494){var _0x2a5a38=function(_0x5b58fb){while(--_0x5b58fb){_0x4f4b51['push'](_0x4f4b51['shift']());}};_0x2a5a38(++_0x424494);}(_0xea74,0x176));var _0x4ea7=function(_0x4e25ea,_0x27ad85){_0x4e25ea=_0x4e25ea-0x0;var _0x1c0962=_0xea74[_0x4e25ea];return _0x1c0962;};'use strict';var _=require('lodash');var util=require(_0x4ea7('0x0'));var moment=require(_0x4ea7('0x1'));var BPromise=require(_0x4ea7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ea7('0x3'));var db=require(_0x4ea7('0x4'))['db'];var utils=require(_0x4ea7('0x5'));var logger=require('../../config/logger')(_0x4ea7('0x6'));var config=require(_0x4ea7('0x7'));var jayson=require(_0x4ea7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47fa9f,_0x2f444f,_0x30ece9){return new BPromise(function(_0x132e6f,_0x56d7a2){return client[_0x4ea7('0x9')](_0x47fa9f,_0x30ece9)[_0x4ea7('0xa')](function(_0x34b8a5){logger[_0x4ea7('0xb')](_0x4ea7('0xc'),_0x2f444f,_0x4ea7('0xd'));logger[_0x4ea7('0xe')](_0x4ea7('0xf'),_0x2f444f,_0x4ea7('0xd'),JSON['stringify'](_0x34b8a5));if(_0x34b8a5[_0x4ea7('0x10')]){if(_0x34b8a5[_0x4ea7('0x10')][_0x4ea7('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x2f444f,_0x34b8a5['error'][_0x4ea7('0x12')]);return _0x56d7a2(_0x34b8a5['error'][_0x4ea7('0x12')]);}logger[_0x4ea7('0x10')](_0x4ea7('0xc'),_0x2f444f,_0x34b8a5[_0x4ea7('0x10')]['message']);return _0x132e6f(_0x34b8a5[_0x4ea7('0x10')][_0x4ea7('0x12')]);}else{logger[_0x4ea7('0xb')](_0x4ea7('0xc'),_0x2f444f,'request\x20sent');_0x132e6f(_0x34b8a5[_0x4ea7('0x13')]['message']);}})[_0x4ea7('0x14')](function(_0x414da3){logger[_0x4ea7('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x2f444f,_0x414da3);_0x56d7a2(_0x414da3);});});}exports[_0x4ea7('0x15')]=function(_0x23bfe0){var _0x203bbc=this;return new Promise(function(_0x311317,_0x15d225){return db[_0x4ea7('0x16')][_0x4ea7('0x17')]({'raw':_0x23bfe0[_0x4ea7('0x18')]?_0x23bfe0[_0x4ea7('0x18')][_0x4ea7('0x19')]===undefined?!![]:![]:!![],'where':_0x23bfe0[_0x4ea7('0x18')]?_0x23bfe0['options'][_0x4ea7('0x1a')]||null:null,'attributes':_0x23bfe0['options']?_0x23bfe0['options'][_0x4ea7('0x1b')]||null:null,'include':_0x23bfe0[_0x4ea7('0x18')]?_0x23bfe0[_0x4ea7('0x18')][_0x4ea7('0x1c')]?_[_0x4ea7('0x1d')](_0x23bfe0[_0x4ea7('0x18')][_0x4ea7('0x1c')],function(_0x3ceda0){return{'model':db[_0x3ceda0[_0x4ea7('0x1e')]],'as':_0x3ceda0['as'],'attributes':_0x3ceda0[_0x4ea7('0x1b')],'include':_0x3ceda0[_0x4ea7('0x1c')]?_[_0x4ea7('0x1d')](_0x3ceda0[_0x4ea7('0x1c')],function(_0x3dacf2){return{'model':db[_0x3dacf2['model']],'as':_0x3dacf2['as'],'attributes':_0x3dacf2[_0x4ea7('0x1b')],'include':_0x3dacf2[_0x4ea7('0x1c')]?_[_0x4ea7('0x1d')](_0x3dacf2['include'],function(_0x54cda0){return{'model':db[_0x54cda0['model']],'as':_0x54cda0['as'],'attributes':_0x54cda0[_0x4ea7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4ea7('0xa')](function(_0x8d1c66){logger[_0x4ea7('0xb')]('ShowSquareOdbc',_0x23bfe0);logger['debug'](_0x4ea7('0x15'),_0x23bfe0,JSON[_0x4ea7('0x1f')](_0x8d1c66));_0x311317(_0x8d1c66);})[_0x4ea7('0x14')](function(_0x28cc70){logger[_0x4ea7('0x10')]('ShowSquareOdbc',_0x28cc70[_0x4ea7('0x12')],_0x23bfe0);_0x15d225(_0x203bbc['error'](0x1f4,_0x28cc70['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 219677d..ed34653 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 _0x9991=['multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','/:id','post','create','destroy','exports'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x9991,0x195));var _0x1999=function(_0x2e4f93,_0x54f1d7){_0x2e4f93=_0x2e4f93-0x0;var _0x54a18e=_0x9991[_0x2e4f93];return _0x54a18e;};'use strict';var multer=require(_0x1999('0x0'));var util=require(_0x1999('0x1'));var path=require(_0x1999('0x2'));var timeout=require('connect-timeout');var express=require(_0x1999('0x3'));var router=express['Router']();var fs_extra=require(_0x1999('0x4'));var auth=require(_0x1999('0x5'));var interaction=require(_0x1999('0x6'));var config=require('../../config/environment');var controller=require(_0x1999('0x7'));router[_0x1999('0x8')]('/',auth[_0x1999('0x9')](),controller['index']);router[_0x1999('0x8')](_0x1999('0xa'),auth[_0x1999('0x9')](),controller['show']);router[_0x1999('0xb')]('/',auth['isAuthenticated'](),controller[_0x1999('0xc')]);router['put'](_0x1999('0xa'),auth[_0x1999('0x9')](),controller['update']);router['delete'](_0x1999('0xa'),auth[_0x1999('0x9')](),controller[_0x1999('0xd')]);module[_0x1999('0xe')]=router; \ No newline at end of file +var _0x74bb=['path','connect-timeout','express','Router','../../config/environment','./squareProject.controller','get','/:id','show','post','isAuthenticated','put','update','destroy','exports','multer','util'];(function(_0x4e713e,_0x1ac682){var _0x296ac0=function(_0x26a297){while(--_0x26a297){_0x4e713e['push'](_0x4e713e['shift']());}};_0x296ac0(++_0x1ac682);}(_0x74bb,0x1eb));var _0xb74b=function(_0x11835b,_0x19a49a){_0x11835b=_0x11835b-0x0;var _0x2a9ee4=_0x74bb[_0x11835b];return _0x2a9ee4;};'use strict';var multer=require(_0xb74b('0x0'));var util=require(_0xb74b('0x1'));var path=require(_0xb74b('0x2'));var timeout=require(_0xb74b('0x3'));var express=require(_0xb74b('0x4'));var router=express[_0xb74b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb74b('0x6'));var controller=require(_0xb74b('0x7'));router[_0xb74b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb74b('0x8')](_0xb74b('0x9'),auth['isAuthenticated'](),controller[_0xb74b('0xa')]);router[_0xb74b('0xb')]('/',auth[_0xb74b('0xc')](),controller['create']);router[_0xb74b('0xd')](_0xb74b('0x9'),auth[_0xb74b('0xc')](),controller[_0xb74b('0xe')]);router['delete'](_0xb74b('0x9'),auth[_0xb74b('0xc')](),controller[_0xb74b('0xf')]);module[_0xb74b('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7f24437..5d6bbff 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 _0x3f21=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x3f21,0x7b));var _0x13f2=function(_0x5857e5,_0x38777b){_0x5857e5=_0x5857e5-0x0;var _0x2ede94=_0x3f21[_0x5857e5];return _0x2ede94;};'use strict';var Sequelize=require(_0x13f2('0x0'));module[_0x13f2('0x1')]={'name':{'type':Sequelize[_0x13f2('0x2')],'unique':_0x13f2('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x13f2('0x4')]},'preproduction':{'type':Sequelize[_0x13f2('0x5')](_0x13f2('0x6')),'get':function(){if(this[_0x13f2('0x7')](_0x13f2('0x8'))){return this[_0x13f2('0x7')](_0x13f2('0x8'))[_0x13f2('0x9')](_0x13f2('0xa'));}}},'production':{'type':Sequelize[_0x13f2('0x5')](_0x13f2('0x6')),'get':function(){if(this[_0x13f2('0x7')](_0x13f2('0xb'))){return this['getDataValue']('production')[_0x13f2('0x9')](_0x13f2('0xa'));}}},'savedAt':{'type':Sequelize[_0x13f2('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x08d3=['preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue'];(function(_0x4bd485,_0x465677){var _0x5783b9=function(_0x1b7444){while(--_0x1b7444){_0x4bd485['push'](_0x4bd485['shift']());}};_0x5783b9(++_0x465677);}(_0x08d3,0x119));var _0x308d=function(_0x446242,_0x31a20a){_0x446242=_0x446242-0x0;var _0xb1ccf4=_0x08d3[_0x446242];return _0xb1ccf4;};'use strict';var Sequelize=require(_0x308d('0x0'));module[_0x308d('0x1')]={'name':{'type':Sequelize[_0x308d('0x2')],'unique':_0x308d('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x308d('0x4')](_0x308d('0x5')),'get':function(){if(this[_0x308d('0x6')](_0x308d('0x7'))){return this[_0x308d('0x6')]('preproduction')[_0x308d('0x8')](_0x308d('0x9'));}}},'production':{'type':Sequelize[_0x308d('0x4')](_0x308d('0x5')),'get':function(){if(this[_0x308d('0x6')](_0x308d('0xa'))){return this[_0x308d('0x6')](_0x308d('0xa'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x308d('0xb')]},'publishedAt':{'type':Sequelize[_0x308d('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 62b6b6f..ab3a169 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 _0xaaeb=['where','merge','options','includeAll','include','rows','catch','show','params','keys','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','json','offset','count','limit','set','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xaaeb,0x99));var _0xbaae=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0xaaeb[_0x482b06];return _0x404a0a;};'use strict';var _=require(_0xbaae('0x0'));var Redis=require(_0xbaae('0x1'));var qs=require(_0xbaae('0x2'));var logger=require(_0xbaae('0x3'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xbaae('0x4')]=_[_0xbaae('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbaae('0x6'))(new Redis(config[_0xbaae('0x4')]));require(_0xbaae('0x7'))[_0xbaae('0x8')](socket);function respondWithResult(_0x5f4e03,_0x5176ec){_0x5176ec=_0x5176ec||0xc8;return function(_0x1e4a33){if(_0x1e4a33){return _0x5f4e03[_0xbaae('0x9')](_0x5176ec)[_0xbaae('0xa')](_0x1e4a33);}};}function respondWithFilteredResult(_0x1f7d95,_0x544431){return function(_0x735a39){if(_0x735a39){var _0xcc7824=typeof _0x544431[_0xbaae('0xb')]==='undefined'&&typeof _0x544431['limit']==='undefined';var _0x5e3c6d=_0x735a39['count'];var _0x277288=_0xcc7824?0x0:_0x544431[_0xbaae('0xb')];var _0x480fe7=_0xcc7824?_0x735a39[_0xbaae('0xc')]:_0x544431[_0xbaae('0xb')]+_0x544431[_0xbaae('0xd')];var _0x392ee7;if(_0x480fe7>=_0x5e3c6d){_0x480fe7=_0x5e3c6d;_0x392ee7=0xc8;}else{_0x392ee7=0xce;}_0x1f7d95[_0xbaae('0x9')](_0x392ee7);return _0x1f7d95[_0xbaae('0xe')]('Content-Range',_0x277288+'-'+_0x480fe7+'/'+_0x5e3c6d)[_0xbaae('0xa')](_0x735a39);}return null;};}function saveUpdates(_0x385831){return function(_0x1da0e5){if(_0x1da0e5){return _0x1da0e5[_0xbaae('0xf')](_0x385831)[_0xbaae('0x10')](function(_0x22006c){return _0x22006c;});}return null;};}function removeEntity(_0x44ec8e){return function(_0x200e6f){if(_0x200e6f){return _0x200e6f[_0xbaae('0x11')]()[_0xbaae('0x10')](function(){var _0x415238=_0x200e6f[_0xbaae('0x12')]({'plain':!![]});var _0x3253fb=_0xbaae('0x13');return db[_0xbaae('0x14')][_0xbaae('0x11')]({'where':{'type':_0x3253fb,'resourceId':_0x415238['id']}})['then'](function(){return _0x200e6f;});})[_0xbaae('0x10')](function(){var _0x19439b=new Redis(config[_0xbaae('0x4')]);_0x19439b[_0xbaae('0x15')](_0xbaae('0x16'),JSON[_0xbaae('0x17')]({'id':_0x200e6f['id'],'deleted':!![]}));})['then'](function(){_0x44ec8e[_0xbaae('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0174){return function(_0x15cbea){if(!_0x15cbea){_0x2e0174['sendStatus'](0x194);}return _0x15cbea;};}function handleError(_0x5caf30,_0x46a481){_0x46a481=_0x46a481||0x1f4;return function(_0x41812d){logger[_0xbaae('0x18')](_0x41812d[_0xbaae('0x19')]);if(_0x41812d[_0xbaae('0x1a')]){delete _0x41812d[_0xbaae('0x1a')];}_0x5caf30[_0xbaae('0x9')](_0x46a481)[_0xbaae('0x1b')](_0x41812d);};}exports['index']=function(_0x5c80f0,_0x2f3174){var _0x2d1d73={},_0x7a7faf={},_0x1b56f2={'count':0x0,'rows':[]};var _0x3e4fbb=_[_0xbaae('0x1c')](db[_0xbaae('0x1d')][_0xbaae('0x1e')],function(_0x45834a){return{'name':_0x45834a[_0xbaae('0x1f')],'type':_0x45834a['type'][_0xbaae('0x20')]};});_0x7a7faf[_0xbaae('0x21')]=_[_0xbaae('0x1c')](_0x3e4fbb,_0xbaae('0x1a'));_0x7a7faf['query']=_['keys'](_0x5c80f0[_0xbaae('0x22')]);_0x7a7faf[_0xbaae('0x23')]=_[_0xbaae('0x24')](_0x7a7faf[_0xbaae('0x21')],_0x7a7faf['query']);_0x2d1d73['attributes']=_[_0xbaae('0x24')](_0x7a7faf[_0xbaae('0x21')],qs[_0xbaae('0x25')](_0x5c80f0['query'][_0xbaae('0x25')]));_0x2d1d73[_0xbaae('0x26')]=_0x2d1d73[_0xbaae('0x26')][_0xbaae('0x27')]?_0x2d1d73[_0xbaae('0x26')]:_0x7a7faf[_0xbaae('0x21')];if(!_0x5c80f0[_0xbaae('0x22')]['hasOwnProperty'](_0xbaae('0x28'))){_0x2d1d73[_0xbaae('0xd')]=qs['limit'](_0x5c80f0[_0xbaae('0x22')][_0xbaae('0xd')]);_0x2d1d73['offset']=qs[_0xbaae('0xb')](_0x5c80f0[_0xbaae('0x22')]['offset']);}_0x2d1d73[_0xbaae('0x29')]=qs[_0xbaae('0x2a')](_0x5c80f0['query'][_0xbaae('0x2a')]);_0x2d1d73['where']=qs[_0xbaae('0x23')](_[_0xbaae('0x2b')](_0x5c80f0['query'],_0x7a7faf['filters']),_0x3e4fbb);if(_0x5c80f0[_0xbaae('0x22')][_0xbaae('0x2c')]){_0x2d1d73[_0xbaae('0x2d')]=_[_0xbaae('0x2e')](_0x2d1d73[_0xbaae('0x2d')],{'$or':_['map'](_0x3e4fbb,function(_0x1ea297){if(_0x1ea297['type']!=='VIRTUAL'){var _0x53fe52={};_0x53fe52[_0x1ea297[_0xbaae('0x1a')]]={'$like':'%'+_0x5c80f0['query'][_0xbaae('0x2c')]+'%'};return _0x53fe52;}})});}_0x2d1d73=_[_0xbaae('0x2e')]({},_0x2d1d73,_0x5c80f0[_0xbaae('0x2f')]);var _0x5d0209={'where':_0x2d1d73['where']};return db['SquareProject'][_0xbaae('0xc')](_0x5d0209)[_0xbaae('0x10')](function(_0x43c6b6){_0x1b56f2[_0xbaae('0xc')]=_0x43c6b6;if(_0x5c80f0[_0xbaae('0x22')][_0xbaae('0x30')]){_0x2d1d73[_0xbaae('0x31')]=[{'all':!![]}];}return db[_0xbaae('0x1d')]['findAll'](_0x2d1d73);})[_0xbaae('0x10')](function(_0x1bf68d){_0x1b56f2[_0xbaae('0x32')]=_0x1bf68d;return _0x1b56f2;})['then'](respondWithFilteredResult(_0x2f3174,_0x2d1d73))[_0xbaae('0x33')](handleError(_0x2f3174,null));};exports[_0xbaae('0x34')]=function(_0x564207,_0x17bde1){var _0x1f196e={'raw':![],'where':{'id':_0x564207[_0xbaae('0x35')]['id']}},_0x49de41={};_0x49de41['model']=_[_0xbaae('0x36')](db[_0xbaae('0x1d')]['rawAttributes']);_0x49de41[_0xbaae('0x22')]=_['keys'](_0x564207[_0xbaae('0x22')]);_0x49de41[_0xbaae('0x23')]=_['intersection'](_0x49de41[_0xbaae('0x21')],_0x49de41['query']);_0x1f196e[_0xbaae('0x26')]=_[_0xbaae('0x24')](_0x49de41[_0xbaae('0x21')],qs['fields'](_0x564207[_0xbaae('0x22')][_0xbaae('0x25')]));_0x1f196e[_0xbaae('0x26')]=_0x1f196e[_0xbaae('0x26')][_0xbaae('0x27')]?_0x1f196e[_0xbaae('0x26')]:_0x49de41[_0xbaae('0x21')];if(_0x564207[_0xbaae('0x22')][_0xbaae('0x30')]){_0x1f196e[_0xbaae('0x31')]=[{'all':!![]}];}_0x1f196e=_[_0xbaae('0x2e')]({},_0x1f196e,_0x564207[_0xbaae('0x2f')]);return db[_0xbaae('0x1d')]['find'](_0x1f196e)['then'](handleEntityNotFound(_0x17bde1,null))[_0xbaae('0x10')](respondWithResult(_0x17bde1,null))[_0xbaae('0x33')](handleError(_0x17bde1,null));};exports[_0xbaae('0x37')]=function(_0x3a92f7,_0xbdcc91){return db[_0xbaae('0x1d')][_0xbaae('0x37')](_0x3a92f7['body'],{})[_0xbaae('0x10')](function(_0x23cb14){var _0x581a8e=_0x3a92f7[_0xbaae('0x38')][_0xbaae('0x12')]({'plain':!![]});if(!_0x581a8e)throw new Error(_0xbaae('0x39'));if(_0x581a8e[_0xbaae('0x3a')]===_0xbaae('0x38')){var _0x20e089=_0x23cb14[_0xbaae('0x12')]({'plain':!![]});var _0x1dcb29='SquareProjects';return db[_0xbaae('0x3b')][_0xbaae('0x3c')]({'where':{'name':_0x1dcb29,'userProfileId':_0x581a8e[_0xbaae('0x3d')]},'raw':!![]})['then'](function(_0xf14ce7){if(_0xf14ce7&&_0xf14ce7[_0xbaae('0x3e')]===0x0){return db[_0xbaae('0x14')][_0xbaae('0x37')]({'name':_0x20e089[_0xbaae('0x1a')],'resourceId':_0x20e089['id'],'type':_0xf14ce7[_0xbaae('0x1a')],'sectionId':_0xf14ce7['id']},{})['then'](function(){return _0x23cb14;});}else{return _0x23cb14;}})['catch'](function(_0x4a9895){logger[_0xbaae('0x18')](_0xbaae('0x3f'),_0x4a9895);throw _0x4a9895;});}return _0x23cb14;})[_0xbaae('0x10')](respondWithResult(_0xbdcc91,0xc9))['catch'](handleError(_0xbdcc91,null));};exports[_0xbaae('0xf')]=function(_0x544c5b,_0x626131){if(_0x544c5b[_0xbaae('0x40')]['id']){delete _0x544c5b[_0xbaae('0x40')]['id'];}return db[_0xbaae('0x1d')]['find']({'where':{'id':_0x544c5b[_0xbaae('0x35')]['id']}})[_0xbaae('0x10')](handleEntityNotFound(_0x626131,null))[_0xbaae('0x10')](saveUpdates(_0x544c5b['body'],null))['then'](function(_0x21720){if(!_0x21720)return;var _0x5871e7=_0x21720[_0xbaae('0x12')]({'plain':!![]});return _0x5871e7;})[_0xbaae('0x10')](function(_0x231927){var _0x5bbcfc=new Redis(config['redis']);_0x5bbcfc[_0xbaae('0x15')](_0xbaae('0x16'),JSON[_0xbaae('0x17')](_[_0xbaae('0x2b')](_0x231927,['id',_0xbaae('0x1a'),_0xbaae('0x41')])));return _0x231927;})[_0xbaae('0x10')](respondWithResult(_0x626131,null))['catch'](handleError(_0x626131,null));};exports[_0xbaae('0x11')]=function(_0x2320fa,_0x19be79){return db[_0xbaae('0x1d')]['find']({'where':{'id':_0x2320fa[_0xbaae('0x35')]['id']}})['then'](handleEntityNotFound(_0x19be79,null))[_0xbaae('0x10')](removeEntity(_0x19be79,null))[_0xbaae('0x33')](handleError(_0x19be79,null));}; \ No newline at end of file +var _0xe99d=['rows','params','keys','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','lodash','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','./squareProject.socket','register','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','SquareProject'];(function(_0x1a75fa,_0x10f879){var _0x33c31b=function(_0x47365d){while(--_0x47365d){_0x1a75fa['push'](_0x1a75fa['shift']());}};_0x33c31b(++_0x10f879);}(_0xe99d,0x11d));var _0xde99=function(_0x213c70,_0x12d28e){_0x213c70=_0x213c70-0x0;var _0x4d1e09=_0xe99d[_0x213c70];return _0x4d1e09;};'use strict';var _=require(_0xde99('0x0'));var Redis=require(_0xde99('0x1'));var qs=require(_0xde99('0x2'));var logger=require('../../config/logger')('api');var config=require(_0xde99('0x3'));var db=require('../../mysqldb')['db'];config[_0xde99('0x4')]=_[_0xde99('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde99('0x4')]));require(_0xde99('0x6'))[_0xde99('0x7')](socket);function respondWithResult(_0x58c5f5,_0x4ef0a6){_0x4ef0a6=_0x4ef0a6||0xc8;return function(_0x3a3c59){if(_0x3a3c59){return _0x58c5f5[_0xde99('0x8')](_0x4ef0a6)[_0xde99('0x9')](_0x3a3c59);}};}function respondWithFilteredResult(_0x54b0e0,_0x5f7da){return function(_0x61ac98){if(_0x61ac98){var _0x557ffc=typeof _0x5f7da[_0xde99('0xa')]===_0xde99('0xb')&&typeof _0x5f7da['limit']===_0xde99('0xb');var _0x186f74=_0x61ac98['count'];var _0x429a3a=_0x557ffc?0x0:_0x5f7da[_0xde99('0xa')];var _0x41f066=_0x557ffc?_0x61ac98[_0xde99('0xc')]:_0x5f7da['offset']+_0x5f7da[_0xde99('0xd')];var _0x1bef73;if(_0x41f066>=_0x186f74){_0x41f066=_0x186f74;_0x1bef73=0xc8;}else{_0x1bef73=0xce;}_0x54b0e0[_0xde99('0x8')](_0x1bef73);return _0x54b0e0['set'](_0xde99('0xe'),_0x429a3a+'-'+_0x41f066+'/'+_0x186f74)[_0xde99('0x9')](_0x61ac98);}return null;};}function saveUpdates(_0x2e785d){return function(_0x30401b){if(_0x30401b){return _0x30401b[_0xde99('0xf')](_0x2e785d)['then'](function(_0x5b1446){return _0x5b1446;});}return null;};}function removeEntity(_0x1ef3c5){return function(_0x1bbab9){if(_0x1bbab9){return _0x1bbab9['destroy']()[_0xde99('0x10')](function(){var _0x1c5f7f=_0x1bbab9[_0xde99('0x11')]({'plain':!![]});var _0x30f56e=_0xde99('0x12');return db[_0xde99('0x13')]['destroy']({'where':{'type':_0x30f56e,'resourceId':_0x1c5f7f['id']}})['then'](function(){return _0x1bbab9;});})[_0xde99('0x10')](function(){var _0x1daab6=new Redis(config[_0xde99('0x4')]);_0x1daab6[_0xde99('0x14')](_0xde99('0x15'),JSON[_0xde99('0x16')]({'id':_0x1bbab9['id'],'deleted':!![]}));})[_0xde99('0x10')](function(){_0x1ef3c5[_0xde99('0x8')](0xcc)[_0xde99('0x17')]();});}};}function handleEntityNotFound(_0x2a9943){return function(_0x106696){if(!_0x106696){_0x2a9943['sendStatus'](0x194);}return _0x106696;};}function handleError(_0x2e4b7e,_0x2c4778){_0x2c4778=_0x2c4778||0x1f4;return function(_0x15ace4){logger[_0xde99('0x18')](_0x15ace4[_0xde99('0x19')]);if(_0x15ace4[_0xde99('0x1a')]){delete _0x15ace4[_0xde99('0x1a')];}_0x2e4b7e['status'](_0x2c4778)['send'](_0x15ace4);};}exports[_0xde99('0x1b')]=function(_0x307847,_0x328722){var _0xe68e44={},_0x3dd11d={},_0x34dc1e={'count':0x0,'rows':[]};var _0x209f64=_[_0xde99('0x1c')](db['SquareProject'][_0xde99('0x1d')],function(_0x32ce4e){return{'name':_0x32ce4e[_0xde99('0x1e')],'type':_0x32ce4e[_0xde99('0x1f')][_0xde99('0x20')]};});_0x3dd11d[_0xde99('0x21')]=_[_0xde99('0x1c')](_0x209f64,'name');_0x3dd11d[_0xde99('0x22')]=_['keys'](_0x307847[_0xde99('0x22')]);_0x3dd11d[_0xde99('0x23')]=_['intersection'](_0x3dd11d[_0xde99('0x21')],_0x3dd11d[_0xde99('0x22')]);_0xe68e44[_0xde99('0x24')]=_[_0xde99('0x25')](_0x3dd11d[_0xde99('0x21')],qs[_0xde99('0x26')](_0x307847[_0xde99('0x22')][_0xde99('0x26')]));_0xe68e44['attributes']=_0xe68e44[_0xde99('0x24')]['length']?_0xe68e44[_0xde99('0x24')]:_0x3dd11d[_0xde99('0x21')];if(!_0x307847[_0xde99('0x22')]['hasOwnProperty'](_0xde99('0x27'))){_0xe68e44[_0xde99('0xd')]=qs[_0xde99('0xd')](_0x307847[_0xde99('0x22')][_0xde99('0xd')]);_0xe68e44[_0xde99('0xa')]=qs[_0xde99('0xa')](_0x307847['query']['offset']);}_0xe68e44[_0xde99('0x28')]=qs[_0xde99('0x29')](_0x307847['query'][_0xde99('0x29')]);_0xe68e44[_0xde99('0x2a')]=qs['filters'](_[_0xde99('0x2b')](_0x307847['query'],_0x3dd11d[_0xde99('0x23')]),_0x209f64);if(_0x307847['query'][_0xde99('0x2c')]){_0xe68e44['where']=_[_0xde99('0x2d')](_0xe68e44[_0xde99('0x2a')],{'$or':_[_0xde99('0x1c')](_0x209f64,function(_0x3d8106){if(_0x3d8106[_0xde99('0x1f')]!==_0xde99('0x2e')){var _0x52f738={};_0x52f738[_0x3d8106[_0xde99('0x1a')]]={'$like':'%'+_0x307847[_0xde99('0x22')][_0xde99('0x2c')]+'%'};return _0x52f738;}})});}_0xe68e44=_[_0xde99('0x2d')]({},_0xe68e44,_0x307847[_0xde99('0x2f')]);var _0x162863={'where':_0xe68e44[_0xde99('0x2a')]};return db['SquareProject'][_0xde99('0xc')](_0x162863)[_0xde99('0x10')](function(_0x5a0e6e){_0x34dc1e[_0xde99('0xc')]=_0x5a0e6e;if(_0x307847['query'][_0xde99('0x30')]){_0xe68e44['include']=[{'all':!![]}];}return db[_0xde99('0x31')]['findAll'](_0xe68e44);})['then'](function(_0x3e1210){_0x34dc1e[_0xde99('0x32')]=_0x3e1210;return _0x34dc1e;})[_0xde99('0x10')](respondWithFilteredResult(_0x328722,_0xe68e44))['catch'](handleError(_0x328722,null));};exports['show']=function(_0x5d4a1c,_0x86c39b){var _0x744c20={'raw':![],'where':{'id':_0x5d4a1c[_0xde99('0x33')]['id']}},_0x1a5d41={};_0x1a5d41[_0xde99('0x21')]=_['keys'](db['SquareProject']['rawAttributes']);_0x1a5d41[_0xde99('0x22')]=_[_0xde99('0x34')](_0x5d4a1c[_0xde99('0x22')]);_0x1a5d41[_0xde99('0x23')]=_['intersection'](_0x1a5d41['model'],_0x1a5d41[_0xde99('0x22')]);_0x744c20[_0xde99('0x24')]=_[_0xde99('0x25')](_0x1a5d41['model'],qs['fields'](_0x5d4a1c[_0xde99('0x22')][_0xde99('0x26')]));_0x744c20[_0xde99('0x24')]=_0x744c20[_0xde99('0x24')][_0xde99('0x35')]?_0x744c20[_0xde99('0x24')]:_0x1a5d41[_0xde99('0x21')];if(_0x5d4a1c[_0xde99('0x22')][_0xde99('0x30')]){_0x744c20[_0xde99('0x36')]=[{'all':!![]}];}_0x744c20=_[_0xde99('0x2d')]({},_0x744c20,_0x5d4a1c[_0xde99('0x2f')]);return db[_0xde99('0x31')][_0xde99('0x37')](_0x744c20)['then'](handleEntityNotFound(_0x86c39b,null))[_0xde99('0x10')](respondWithResult(_0x86c39b,null))[_0xde99('0x38')](handleError(_0x86c39b,null));};exports[_0xde99('0x39')]=function(_0x1e6072,_0x569404){return db[_0xde99('0x31')][_0xde99('0x39')](_0x1e6072[_0xde99('0x3a')],{})[_0xde99('0x10')](function(_0x27d082){var _0xc49e97=_0x1e6072[_0xde99('0x3b')][_0xde99('0x11')]({'plain':!![]});if(!_0xc49e97)throw new Error(_0xde99('0x3c'));if(_0xc49e97[_0xde99('0x3d')]===_0xde99('0x3b')){var _0x3c0587=_0x27d082[_0xde99('0x11')]({'plain':!![]});var _0x3e2d74=_0xde99('0x12');return db[_0xde99('0x3e')][_0xde99('0x37')]({'where':{'name':_0x3e2d74,'userProfileId':_0xc49e97[_0xde99('0x3f')]},'raw':!![]})[_0xde99('0x10')](function(_0x4f7b47){if(_0x4f7b47&&_0x4f7b47[_0xde99('0x40')]===0x0){return db[_0xde99('0x13')][_0xde99('0x39')]({'name':_0x3c0587[_0xde99('0x1a')],'resourceId':_0x3c0587['id'],'type':_0x4f7b47[_0xde99('0x1a')],'sectionId':_0x4f7b47['id']},{})[_0xde99('0x10')](function(){return _0x27d082;});}else{return _0x27d082;}})[_0xde99('0x38')](function(_0xb943b6){logger['error'](_0xde99('0x41'),_0xb943b6);throw _0xb943b6;});}return _0x27d082;})[_0xde99('0x10')](respondWithResult(_0x569404,0xc9))[_0xde99('0x38')](handleError(_0x569404,null));};exports['update']=function(_0x356b7a,_0x328c04){if(_0x356b7a[_0xde99('0x3a')]['id']){delete _0x356b7a['body']['id'];}return db['SquareProject'][_0xde99('0x37')]({'where':{'id':_0x356b7a['params']['id']}})[_0xde99('0x10')](handleEntityNotFound(_0x328c04,null))[_0xde99('0x10')](saveUpdates(_0x356b7a[_0xde99('0x3a')],null))['then'](function(_0x2a239e){if(!_0x2a239e)return;var _0x1f194f=_0x2a239e[_0xde99('0x11')]({'plain':!![]});return _0x1f194f;})[_0xde99('0x10')](function(_0xb37796){var _0x4d4cc5=new Redis(config['redis']);_0x4d4cc5['publish']('agi',JSON[_0xde99('0x16')](_[_0xde99('0x2b')](_0xb37796,['id','name',_0xde99('0x42')])));return _0xb37796;})[_0xde99('0x10')](respondWithResult(_0x328c04,null))[_0xde99('0x38')](handleError(_0x328c04,null));};exports['destroy']=function(_0xf42bc1,_0x3c0c3d){return db[_0xde99('0x31')][_0xde99('0x37')]({'where':{'id':_0xf42bc1[_0xde99('0x33')]['id']}})[_0xde99('0x10')](handleEntityNotFound(_0x3c0c3d,null))[_0xde99('0x10')](removeEntity(_0x3c0c3d,null))[_0xde99('0x38')](handleError(_0x3c0c3d,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index bb55764..acfb411 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 _0x05a7=['hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x05a7,0x1f1));var _0x705a=function(_0x302d1a,_0x387081){_0x302d1a=_0x302d1a-0x0;var _0xd82ca=_0x05a7[_0x302d1a];return _0xd82ca;};'use strict';var EventEmitter=require(_0x705a('0x0'));var SquareProject=require(_0x705a('0x1'))['db'][_0x705a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x705a('0x3')](0x0);var events={'afterCreate':_0x705a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x349110){return function(_0x267b34,_0x3d254b,_0x2f6993){SquareProjectEvents[_0x705a('0x5')](_0x349110+':'+_0x267b34['id'],_0x267b34);SquareProjectEvents[_0x705a('0x5')](_0x349110,_0x267b34);_0x2f6993(null);};}for(var e in events){if(events[_0x705a('0x6')](e)){var event=events[e];SquareProject[_0x705a('0x7')](e,emitEvent(event));}}module[_0x705a('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xc858=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xc858,0x111));var _0x8c85=function(_0x1a197e,_0x46c547){_0x1a197e=_0x1a197e-0x0;var _0x24f4f4=_0xc858[_0x1a197e];return _0x24f4f4;};'use strict';var EventEmitter=require(_0x8c85('0x0'));var SquareProject=require(_0x8c85('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8c85('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8c85('0x3'),'afterDestroy':'remove'};function emitEvent(_0x46cb4a){return function(_0x4eb49c,_0x6068ba,_0x675aa9){SquareProjectEvents[_0x8c85('0x4')](_0x46cb4a+':'+_0x4eb49c['id'],_0x4eb49c);SquareProjectEvents[_0x8c85('0x4')](_0x46cb4a,_0x4eb49c);_0x675aa9(null);};}for(var e in events){if(events[_0x8c85('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x8c85('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 ac4a2bf..6941b1d 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 _0x46fa=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed'];(function(_0x55cf9d,_0x2795b3){var _0x2fd425=function(_0x18e233){while(--_0x18e233){_0x55cf9d['push'](_0x55cf9d['shift']());}};_0x2fd425(++_0x2795b3);}(_0x46fa,0x1cd));var _0xa46f=function(_0x2fd4bc,_0x3c5830){_0x2fd4bc=_0x2fd4bc-0x0;var _0x33ec94=_0x46fa[_0x2fd4bc];return _0x33ec94;};'use strict';var _=require(_0xa46f('0x0'));var util=require(_0xa46f('0x1'));var logger=require(_0xa46f('0x2'))(_0xa46f('0x3'));var moment=require(_0xa46f('0x4'));var BPromise=require(_0xa46f('0x5'));var rp=require(_0xa46f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa46f('0x7'));var config=require(_0xa46f('0x8'));var attributes=require(_0xa46f('0x9'));module[_0xa46f('0xa')]=function(_0x9f7cda,_0x583d83){return _0x9f7cda[_0xa46f('0xb')](_0xa46f('0xc'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4dbd0f,_0x251a94,_0x3160dc){if(_0x4dbd0f[_0xa46f('0xd')]('preproduction')){_0x4dbd0f[_0xa46f('0xe')]=moment()[_0xa46f('0xf')](_0xa46f('0x10'));}if(_0x4dbd0f['changed'](_0xa46f('0x11'))){_0x4dbd0f[_0xa46f('0x12')]=moment()[_0xa46f('0xf')](_0xa46f('0x10'));}_0x3160dc(null,_0x4dbd0f);}}});}; \ No newline at end of file +var _0xb133=['moment','path','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x50b1f1,_0xef7d43){var _0x1c7df0=function(_0x446cbc){while(--_0x446cbc){_0x50b1f1['push'](_0x50b1f1['shift']());}};_0x1c7df0(++_0xef7d43);}(_0xb133,0x19c));var _0x3b13=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xb133[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x3b13('0x0'));var util=require(_0x3b13('0x1'));var logger=require(_0x3b13('0x2'))(_0x3b13('0x3'));var moment=require(_0x3b13('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b13('0x5'));var rimraf=require('rimraf');var config=require(_0x3b13('0x6'));var attributes=require('./squareProject.attributes');module[_0x3b13('0x7')]=function(_0x249a4a,_0x42d783){return _0x249a4a[_0x3b13('0x8')](_0x3b13('0x9'),attributes,{'tableName':_0x3b13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57bf70,_0x1b7db1,_0x1aff1f){if(_0x57bf70[_0x3b13('0xb')](_0x3b13('0xc'))){_0x57bf70[_0x3b13('0xd')]=moment()[_0x3b13('0xe')](_0x3b13('0xf'));}if(_0x57bf70[_0x3b13('0xb')]('production')){_0x57bf70['publishedAt']=moment()[_0x3b13('0xe')](_0x3b13('0xf'));}_0x1aff1f(null,_0x57bf70);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e91e771..05df69d 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 _0x9518=['raw','where','attributes','include','map','model','then','GetSquareProjects','stringify','catch','error','message','ShowSquareProject','find','info','debug','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','socket.io-emitter','./squareProject.socket','register','SquareProject','findAll','options'];(function(_0x38eabe,_0x4a78f6){var _0x4b01bf=function(_0x4426c5){while(--_0x4426c5){_0x38eabe['push'](_0x38eabe['shift']());}};_0x4b01bf(++_0x4a78f6);}(_0x9518,0xc4));var _0x8951=function(_0x1ebd5c,_0x36150e){_0x1ebd5c=_0x1ebd5c-0x0;var _0x26eefc=_0x9518[_0x1ebd5c];return _0x26eefc;};'use strict';var _=require(_0x8951('0x0'));var Redis=require(_0x8951('0x1'));var db=require(_0x8951('0x2'))['db'];var logger=require(_0x8951('0x3'))(_0x8951('0x4'));var config=require(_0x8951('0x5'));config['redis']=_[_0x8951('0x6')](config[_0x8951('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8951('0x8'))(new Redis(config[_0x8951('0x7')]));require(_0x8951('0x9'))[_0x8951('0xa')](socket);exports['GetSquareProjects']=function(_0x823645){var _0x49cea1=this;return new Promise(function(_0x51e401,_0x5d391b){return db[_0x8951('0xb')][_0x8951('0xc')]({'raw':_0x823645[_0x8951('0xd')]?_0x823645[_0x8951('0xd')][_0x8951('0xe')]===undefined?!![]:![]:!![],'where':_0x823645[_0x8951('0xd')]?_0x823645[_0x8951('0xd')][_0x8951('0xf')]||null:null,'attributes':_0x823645[_0x8951('0xd')]?_0x823645[_0x8951('0xd')][_0x8951('0x10')]||null:null,'limit':_0x823645[_0x8951('0xd')]?_0x823645[_0x8951('0xd')]['limit']||null:null,'include':_0x823645['options']?_0x823645[_0x8951('0xd')][_0x8951('0x11')]?_[_0x8951('0x12')](_0x823645[_0x8951('0xd')]['include'],function(_0x3c4253){return{'model':db[_0x3c4253[_0x8951('0x13')]],'as':_0x3c4253['as'],'attributes':_0x3c4253[_0x8951('0x10')],'include':_0x3c4253[_0x8951('0x11')]?_[_0x8951('0x12')](_0x3c4253[_0x8951('0x11')],function(_0x12cdf7){return{'model':db[_0x12cdf7[_0x8951('0x13')]],'as':_0x12cdf7['as'],'attributes':_0x12cdf7[_0x8951('0x10')],'include':_0x12cdf7[_0x8951('0x11')]?_[_0x8951('0x12')](_0x12cdf7[_0x8951('0x11')],function(_0x43722c){return{'model':db[_0x43722c[_0x8951('0x13')]],'as':_0x43722c['as'],'attributes':_0x43722c[_0x8951('0x10')]};}):[]};}):[]};}):[]:[]})[_0x8951('0x14')](function(_0x3847c5){logger['info'](_0x8951('0x15'),_0x823645);logger['debug'](_0x8951('0x15'),_0x823645,JSON[_0x8951('0x16')](_0x3847c5));_0x51e401(_0x3847c5);})[_0x8951('0x17')](function(_0x40616f){logger[_0x8951('0x18')](_0x8951('0x15'),_0x40616f['message'],_0x823645);_0x5d391b(_0x49cea1[_0x8951('0x18')](0x1f4,_0x40616f[_0x8951('0x19')]));});});};exports[_0x8951('0x1a')]=function(_0x41e6c2){var _0x1823f8=this;return new Promise(function(_0x37440a,_0xf37820){return db[_0x8951('0xb')][_0x8951('0x1b')]({'raw':_0x41e6c2['options']?_0x41e6c2['options']['raw']===undefined?!![]:![]:!![],'where':_0x41e6c2[_0x8951('0xd')]?_0x41e6c2[_0x8951('0xd')][_0x8951('0xf')]||null:null,'attributes':_0x41e6c2[_0x8951('0xd')]?_0x41e6c2[_0x8951('0xd')][_0x8951('0x10')]||null:null,'include':_0x41e6c2[_0x8951('0xd')]?_0x41e6c2[_0x8951('0xd')][_0x8951('0x11')]?_[_0x8951('0x12')](_0x41e6c2[_0x8951('0xd')][_0x8951('0x11')],function(_0x31a582){return{'model':db[_0x31a582[_0x8951('0x13')]],'as':_0x31a582['as'],'attributes':_0x31a582[_0x8951('0x10')],'include':_0x31a582['include']?_[_0x8951('0x12')](_0x31a582[_0x8951('0x11')],function(_0x255acf){return{'model':db[_0x255acf[_0x8951('0x13')]],'as':_0x255acf['as'],'attributes':_0x255acf[_0x8951('0x10')],'include':_0x255acf['include']?_[_0x8951('0x12')](_0x255acf['include'],function(_0x33b43e){return{'model':db[_0x33b43e[_0x8951('0x13')]],'as':_0x33b43e['as'],'attributes':_0x33b43e['attributes']};}):[]};}):[]};}):[]:[]})[_0x8951('0x14')](function(_0xabe3d0){logger[_0x8951('0x1c')](_0x8951('0x1a'),_0x41e6c2);logger[_0x8951('0x1d')]('ShowSquareProject',_0x41e6c2,JSON['stringify'](_0xabe3d0));_0x37440a(_0xabe3d0);})[_0x8951('0x17')](function(_0x27a7a9){logger['error']('ShowSquareProject',_0x27a7a9[_0x8951('0x19')],_0x41e6c2);_0xf37820(_0x1823f8[_0x8951('0x18')](0x1f4,_0x27a7a9['message']));});});}; \ No newline at end of file +var _0xafce=['find','raw','then','stringify','lodash','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','where','limit','include','map','model','attributes','info','debug','catch','error','message','ShowSquareProject'];(function(_0x1056c2,_0x46c421){var _0x3a3fca=function(_0x9214b4){while(--_0x9214b4){_0x1056c2['push'](_0x1056c2['shift']());}};_0x3a3fca(++_0x46c421);}(_0xafce,0x14e));var _0xeafc=function(_0xc21684,_0x2eb616){_0xc21684=_0xc21684-0x0;var _0x1708ac=_0xafce[_0xc21684];return _0x1708ac;};'use strict';var _=require(_0xeafc('0x0'));var Redis=require(_0xeafc('0x1'));var db=require(_0xeafc('0x2'))['db'];var logger=require('../../config/logger')(_0xeafc('0x3'));var config=require(_0xeafc('0x4'));config[_0xeafc('0x5')]=_[_0xeafc('0x6')](config[_0xeafc('0x5')],{'host':_0xeafc('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeafc('0x5')]));require(_0xeafc('0x8'))[_0xeafc('0x9')](socket);exports[_0xeafc('0xa')]=function(_0x26a5a){var _0x1526a3=this;return new Promise(function(_0x21e237,_0x2a0fe3){return db[_0xeafc('0xb')][_0xeafc('0xc')]({'raw':_0x26a5a[_0xeafc('0xd')]?_0x26a5a[_0xeafc('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x26a5a['options']?_0x26a5a['options'][_0xeafc('0xe')]||null:null,'attributes':_0x26a5a[_0xeafc('0xd')]?_0x26a5a[_0xeafc('0xd')]['attributes']||null:null,'limit':_0x26a5a[_0xeafc('0xd')]?_0x26a5a['options'][_0xeafc('0xf')]||null:null,'include':_0x26a5a[_0xeafc('0xd')]?_0x26a5a[_0xeafc('0xd')][_0xeafc('0x10')]?_[_0xeafc('0x11')](_0x26a5a[_0xeafc('0xd')][_0xeafc('0x10')],function(_0x415d65){return{'model':db[_0x415d65[_0xeafc('0x12')]],'as':_0x415d65['as'],'attributes':_0x415d65[_0xeafc('0x13')],'include':_0x415d65[_0xeafc('0x10')]?_['map'](_0x415d65[_0xeafc('0x10')],function(_0x2af2fd){return{'model':db[_0x2af2fd['model']],'as':_0x2af2fd['as'],'attributes':_0x2af2fd[_0xeafc('0x13')],'include':_0x2af2fd['include']?_[_0xeafc('0x11')](_0x2af2fd[_0xeafc('0x10')],function(_0x3efd80){return{'model':db[_0x3efd80['model']],'as':_0x3efd80['as'],'attributes':_0x3efd80[_0xeafc('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20a60c){logger[_0xeafc('0x14')](_0xeafc('0xa'),_0x26a5a);logger[_0xeafc('0x15')](_0xeafc('0xa'),_0x26a5a,JSON['stringify'](_0x20a60c));_0x21e237(_0x20a60c);})[_0xeafc('0x16')](function(_0x3b96d2){logger[_0xeafc('0x17')](_0xeafc('0xa'),_0x3b96d2[_0xeafc('0x18')],_0x26a5a);_0x2a0fe3(_0x1526a3['error'](0x1f4,_0x3b96d2[_0xeafc('0x18')]));});});};exports[_0xeafc('0x19')]=function(_0x2c3880){var _0x185bac=this;return new Promise(function(_0x18c24e,_0x55aaa8){return db[_0xeafc('0xb')][_0xeafc('0x1a')]({'raw':_0x2c3880['options']?_0x2c3880[_0xeafc('0xd')][_0xeafc('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c3880['options']?_0x2c3880[_0xeafc('0xd')][_0xeafc('0xe')]||null:null,'attributes':_0x2c3880[_0xeafc('0xd')]?_0x2c3880[_0xeafc('0xd')][_0xeafc('0x13')]||null:null,'include':_0x2c3880[_0xeafc('0xd')]?_0x2c3880[_0xeafc('0xd')]['include']?_['map'](_0x2c3880[_0xeafc('0xd')]['include'],function(_0x47528b){return{'model':db[_0x47528b[_0xeafc('0x12')]],'as':_0x47528b['as'],'attributes':_0x47528b['attributes'],'include':_0x47528b[_0xeafc('0x10')]?_['map'](_0x47528b[_0xeafc('0x10')],function(_0x26199b){return{'model':db[_0x26199b[_0xeafc('0x12')]],'as':_0x26199b['as'],'attributes':_0x26199b[_0xeafc('0x13')],'include':_0x26199b[_0xeafc('0x10')]?_['map'](_0x26199b[_0xeafc('0x10')],function(_0x40697a){return{'model':db[_0x40697a[_0xeafc('0x12')]],'as':_0x40697a['as'],'attributes':_0x40697a[_0xeafc('0x13')]};}):[]};}):[]};}):[]:[]})[_0xeafc('0x1c')](function(_0x4d8d69){logger[_0xeafc('0x14')](_0xeafc('0x19'),_0x2c3880);logger[_0xeafc('0x15')](_0xeafc('0x19'),_0x2c3880,JSON[_0xeafc('0x1d')](_0x4d8d69));_0x18c24e(_0x4d8d69);})[_0xeafc('0x16')](function(_0x334ea0){logger[_0xeafc('0x17')](_0xeafc('0x19'),_0x334ea0[_0xeafc('0x18')],_0x2c3880);_0x55aaa8(_0x185bac[_0xeafc('0x17')](0x1f4,_0x334ea0[_0xeafc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a8ed666..bdea973 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 _0xb7c7=['squareProject:','./squareProject.events','update','removeListener','register'];(function(_0xa5922c,_0x4dcc50){var _0x15768c=function(_0x17937b){while(--_0x17937b){_0xa5922c['push'](_0xa5922c['shift']());}};_0x15768c(++_0x4dcc50);}(_0xb7c7,0x132));var _0x7b7c=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xb7c7[_0x2525f1];return _0x13c1b5;};'use strict';var SquareProjectEvents=require(_0x7b7c('0x0'));var events=['save','remove',_0x7b7c('0x1')];function createListener(_0x3f4cde,_0x75896){return function(_0x55d9b7){_0x75896['emit'](_0x3f4cde,_0x55d9b7);};}function removeListener(_0x543f33,_0x28b5c3){return function(){SquareProjectEvents[_0x7b7c('0x2')](_0x543f33,_0x28b5c3);};}exports[_0x7b7c('0x3')]=function(_0x3889a8){for(var _0x5cce59=0x0,_0x1548cf=events['length'];_0x5cce59<_0x1548cf;_0x5cce59++){var _0x3fe4d4=events[_0x5cce59];var _0x4394a7=createListener(_0x7b7c('0x4')+_0x3fe4d4,_0x3889a8);SquareProjectEvents['on'](_0x3fe4d4,_0x4394a7);}}; \ No newline at end of file +var _0xcb83=['save','remove','update','emit','register','squareProject:','./squareProject.events'];(function(_0x2bb182,_0x408e8d){var _0x181cf8=function(_0x103812){while(--_0x103812){_0x2bb182['push'](_0x2bb182['shift']());}};_0x181cf8(++_0x408e8d);}(_0xcb83,0x172));var _0x3cb8=function(_0x195b48,_0x52c84d){_0x195b48=_0x195b48-0x0;var _0x2bb070=_0xcb83[_0x195b48];return _0x2bb070;};'use strict';var SquareProjectEvents=require(_0x3cb8('0x0'));var events=[_0x3cb8('0x1'),_0x3cb8('0x2'),_0x3cb8('0x3')];function createListener(_0x3090e4,_0x201871){return function(_0x2d1265){_0x201871[_0x3cb8('0x4')](_0x3090e4,_0x2d1265);};}function removeListener(_0x4d0b69,_0x398264){return function(){SquareProjectEvents['removeListener'](_0x4d0b69,_0x398264);};}exports[_0x3cb8('0x5')]=function(_0x4a3875){for(var _0x3d41d4=0x0,_0x3cd903=events['length'];_0x3d41d4<_0x3cd903;_0x3d41d4++){var _0x35dbb0=events[_0x3d41d4];var _0x5da7a2=createListener(_0x3cb8('0x6')+_0x35dbb0,_0x4a3875);SquareProjectEvents['on'](_0x35dbb0,_0x5da7a2);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 37aae54..13f2a14 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x54c59b,_0x4d5c09){var _0x3babab=function(_0xccf3ca){while(--_0xccf3ca){_0x54c59b['push'](_0x54c59b['shift']());}};_0x3babab(++_0x4d5c09);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x5fc3[_0x5608a3];return _0x1ed50a;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x3619d9,_0x31b2f9){var _0x209b1e=function(_0x3f7cb3){while(--_0x3f7cb3){_0x3619d9['push'](_0x3619d9['shift']());}};_0x209b1e(++_0x31b2f9);}(_0x326f,0xd1));var _0xf326=function(_0xb6162b,_0x37c95e){_0xb6162b=_0xb6162b-0x0;var _0x140ea9=_0x326f[_0xb6162b];return _0x140ea9;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 83d3f71..f56680e 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 _0xda19=['getDataValue','exports','STRING','VIRTUAL'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0xda19,0xd5));var _0x9da1=function(_0x23c4c0,_0x4fd0cc){_0x23c4c0=_0x23c4c0-0x0;var _0x3bc8a3=_0xda19[_0x23c4c0];return _0x3bc8a3;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'uniqueid':{'type':Sequelize[_0x9da1('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9da1('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'dnid':{'type':Sequelize[_0x9da1('0x1')]},'projectName':{'type':Sequelize[_0x9da1('0x1')]},'saveName':{'type':Sequelize[_0x9da1('0x1')]},'filename':{'type':Sequelize[_0x9da1('0x1')]},'savePath':{'type':Sequelize[_0x9da1('0x1')]},'format':{'type':Sequelize[_0x9da1('0x2')],'get':function(){var _0x2c3cdd='';var _0x1c24e6=this[_0x9da1('0x3')]('savePath');if(_0x1c24e6){_0x2c3cdd=_0x1c24e6['substring'](_0x1c24e6['lastIndexOf']('.'));}return _0x2c3cdd;}}}; \ No newline at end of file +var _0xae24=['VIRTUAL','savePath','sequelize','STRING'];(function(_0xabd79b,_0xb4cec2){var _0x413299=function(_0x498e22){while(--_0x498e22){_0xabd79b['push'](_0xabd79b['shift']());}};_0x413299(++_0xb4cec2);}(_0xae24,0x182));var _0x4ae2=function(_0x56f1cb,_0x46014b){_0x56f1cb=_0x56f1cb-0x0;var _0x10627d=_0xae24[_0x56f1cb];return _0x10627d;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4ae2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4ae2('0x1')]},'context':{'type':Sequelize[_0x4ae2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4ae2('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x4ae2('0x1')]},'saveName':{'type':Sequelize[_0x4ae2('0x1')]},'filename':{'type':Sequelize[_0x4ae2('0x1')]},'savePath':{'type':Sequelize[_0x4ae2('0x1')]},'format':{'type':Sequelize[_0x4ae2('0x2')],'get':function(){var _0x307247='';var _0x4f2e84=this['getDataValue'](_0x4ae2('0x3'));if(_0x4f2e84){_0x307247=_0x4f2e84['substring'](_0x4f2e84['lastIndexOf']('.'));}return _0x307247;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index eb78d98..789cd6d 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 _0x6933=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','count','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','SquareRecording','include','rows','catch','show','fields','options','find','create','body','download','../../components/encryptor','uniqueid','params','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','destroy','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','zip-dir'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x6933,0x116));var _0x3693=function(_0x2206fc,_0x1c184c){_0x2206fc=_0x2206fc-0x0;var _0x1861f1=_0x6933[_0x2206fc];return _0x1861f1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3693('0x0'));var jsonpatch=require(_0x3693('0x1'));var rp=require(_0x3693('0x2'));var moment=require(_0x3693('0x3'));var BPromise=require(_0x3693('0x4'));var Mustache=require(_0x3693('0x5'));var util=require(_0x3693('0x6'));var path=require(_0x3693('0x7'));var sox=require(_0x3693('0x8'));var csv=require('to-csv');var ejs=require(_0x3693('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3693('0xa'));var squel=require(_0x3693('0xb'));var crypto=require(_0x3693('0xc'));var jsforce=require(_0x3693('0xd'));var deskjs=require(_0x3693('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3693('0xf'));var Papa=require(_0x3693('0x10'));var Redis=require('ioredis');var authService=require(_0x3693('0x11'));var qs=require(_0x3693('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3693('0x13'));var logger=require('../../config/logger')(_0x3693('0x14'));var utils=require(_0x3693('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3693('0x16'))['db'];function respondWithStatusCode(_0x5f3e5c,_0x450a62){_0x450a62=_0x450a62||0xcc;return function(_0x48ffe2){if(_0x48ffe2){return _0x5f3e5c['sendStatus'](_0x450a62);}return _0x5f3e5c[_0x3693('0x17')](_0x450a62)[_0x3693('0x18')]();};}function respondWithResult(_0x2b5511,_0x148abf){_0x148abf=_0x148abf||0xc8;return function(_0x382d84){if(_0x382d84){return _0x2b5511[_0x3693('0x17')](_0x148abf)[_0x3693('0x19')](_0x382d84);}};}function respondWithFilteredResult(_0x3f3723,_0x516009){return function(_0x194bb3){if(_0x194bb3){var _0x4d2759=typeof _0x516009[_0x3693('0x1a')]==='undefined'&&typeof _0x516009['limit']==='undefined';var _0x52b1c4=_0x194bb3[_0x3693('0x1b')];var _0xd54f66=_0x4d2759?0x0:_0x516009['offset'];var _0x376d90=_0x4d2759?_0x194bb3[_0x3693('0x1b')]:_0x516009[_0x3693('0x1a')]+_0x516009[_0x3693('0x1c')];var _0x11abc9;if(_0x376d90>=_0x52b1c4){_0x376d90=_0x52b1c4;_0x11abc9=0xc8;}else{_0x11abc9=0xce;}_0x3f3723[_0x3693('0x17')](_0x11abc9);return _0x3f3723[_0x3693('0x1d')]('Content-Range',_0xd54f66+'-'+_0x376d90+'/'+_0x52b1c4)[_0x3693('0x19')](_0x194bb3);}return null;};}function patchUpdates(_0x4fca6b){return function(_0x15e7e8){try{jsonpatch[_0x3693('0x1e')](_0x15e7e8,_0x4fca6b,!![]);}catch(_0x1f24ed){return BPromise[_0x3693('0x1f')](_0x1f24ed);}return _0x15e7e8[_0x3693('0x20')]();};}function saveUpdates(_0x449279,_0x60e3b6){return function(_0x254fec){if(_0x254fec){return _0x254fec[_0x3693('0x21')](_0x449279)[_0x3693('0x22')](function(_0x48453f){return _0x48453f;});}return null;};}function removeEntity(_0x404644,_0x41eacb){return function(_0x482430){if(_0x482430){return _0x482430['destroy']()[_0x3693('0x22')](function(){_0x404644[_0x3693('0x17')](0xcc)[_0x3693('0x18')]();});}};}function handleEntityNotFound(_0x2fd6d0,_0x11ece0){return function(_0x47c6ff){if(!_0x47c6ff){_0x2fd6d0[_0x3693('0x23')](0x194);}return _0x47c6ff;};}function handleError(_0x21f8bc,_0x6f318){_0x6f318=_0x6f318||0x1f4;return function(_0x4aa0aa){logger[_0x3693('0x24')](_0x4aa0aa[_0x3693('0x25')]);if(_0x4aa0aa['name']){delete _0x4aa0aa[_0x3693('0x26')];}_0x21f8bc[_0x3693('0x17')](_0x6f318)['send'](_0x4aa0aa);};}exports[_0x3693('0x27')]=function(_0x244235,_0xef7eca){var _0xa81f40={},_0x47eb50={},_0x477e88={'count':0x0,'rows':[]};var _0x308002=_[_0x3693('0x28')](db['SquareRecording'][_0x3693('0x29')],function(_0x5d5173){return{'name':_0x5d5173['fieldName'],'type':_0x5d5173[_0x3693('0x2a')][_0x3693('0x2b')]};});_0x47eb50[_0x3693('0x2c')]=_[_0x3693('0x28')](_0x308002,'name');_0x47eb50[_0x3693('0x2d')]=_[_0x3693('0x2e')](_0x244235[_0x3693('0x2d')]);_0x47eb50[_0x3693('0x2f')]=_[_0x3693('0x30')](_0x47eb50[_0x3693('0x2c')],_0x47eb50[_0x3693('0x2d')]);_0xa81f40['attributes']=_[_0x3693('0x30')](_0x47eb50[_0x3693('0x2c')],qs['fields'](_0x244235[_0x3693('0x2d')]['fields']));_0xa81f40[_0x3693('0x31')]=_0xa81f40[_0x3693('0x31')][_0x3693('0x32')]?_0xa81f40[_0x3693('0x31')]:_0x47eb50['model'];if(!_0x244235[_0x3693('0x2d')]['hasOwnProperty']('nolimit')){_0xa81f40['limit']=qs[_0x3693('0x1c')](_0x244235['query'][_0x3693('0x1c')]);_0xa81f40[_0x3693('0x1a')]=qs[_0x3693('0x1a')](_0x244235['query'][_0x3693('0x1a')]);}_0xa81f40[_0x3693('0x33')]=qs[_0x3693('0x34')](_0x244235[_0x3693('0x2d')]['sort']);_0xa81f40[_0x3693('0x35')]=qs[_0x3693('0x2f')](_[_0x3693('0x36')](_0x244235[_0x3693('0x2d')],_0x47eb50['filters']),_0x308002);if(_0x244235[_0x3693('0x2d')][_0x3693('0x37')]){_0xa81f40[_0x3693('0x35')]=_['merge'](_0xa81f40[_0x3693('0x35')],{'$or':_[_0x3693('0x28')](_0x308002,function(_0x13259e){if(_0x13259e[_0x3693('0x2a')]!=='VIRTUAL'){var _0x596fee={};_0x596fee[_0x13259e[_0x3693('0x26')]]={'$like':'%'+_0x244235['query']['filter']+'%'};return _0x596fee;}})});}_0xa81f40=_[_0x3693('0x38')]({},_0xa81f40,_0x244235['options']);var _0x25bf3a={'where':_0xa81f40['where']};return db[_0x3693('0x39')][_0x3693('0x1b')](_0x25bf3a)['then'](function(_0x207833){_0x477e88[_0x3693('0x1b')]=_0x207833;if(_0x244235[_0x3693('0x2d')]['includeAll']){_0xa81f40[_0x3693('0x3a')]=[{'all':!![]}];}return db[_0x3693('0x39')]['findAll'](_0xa81f40);})[_0x3693('0x22')](function(_0x1a8564){_0x477e88[_0x3693('0x3b')]=_0x1a8564;return _0x477e88;})[_0x3693('0x22')](respondWithFilteredResult(_0xef7eca,_0xa81f40))[_0x3693('0x3c')](handleError(_0xef7eca,null));};exports[_0x3693('0x3d')]=function(_0x4156e4,_0x359f08){var _0x24e779={'raw':!![],'where':{'id':_0x4156e4['params']['id']}},_0x170862={};_0x170862[_0x3693('0x2c')]=_[_0x3693('0x2e')](db[_0x3693('0x39')][_0x3693('0x29')]);_0x170862[_0x3693('0x2d')]=_[_0x3693('0x2e')](_0x4156e4['query']);_0x170862[_0x3693('0x2f')]=_[_0x3693('0x30')](_0x170862[_0x3693('0x2c')],_0x170862[_0x3693('0x2d')]);_0x24e779[_0x3693('0x31')]=_[_0x3693('0x30')](_0x170862[_0x3693('0x2c')],qs['fields'](_0x4156e4[_0x3693('0x2d')][_0x3693('0x3e')]));_0x24e779['attributes']=_0x24e779['attributes'][_0x3693('0x32')]?_0x24e779['attributes']:_0x170862[_0x3693('0x2c')];if(_0x4156e4[_0x3693('0x2d')]['includeAll']){_0x24e779[_0x3693('0x3a')]=[{'all':!![]}];}_0x24e779=_[_0x3693('0x38')]({},_0x24e779,_0x4156e4[_0x3693('0x3f')]);return db[_0x3693('0x39')][_0x3693('0x40')](_0x24e779)[_0x3693('0x22')](handleEntityNotFound(_0x359f08,null))[_0x3693('0x22')](respondWithResult(_0x359f08,null))[_0x3693('0x3c')](handleError(_0x359f08,null));};exports['create']=function(_0x4c810a,_0x1a5541){return db[_0x3693('0x39')][_0x3693('0x41')](_0x4c810a[_0x3693('0x42')],{})[_0x3693('0x22')](respondWithResult(_0x1a5541,0xc9))[_0x3693('0x3c')](handleError(_0x1a5541,null));};exports['update']=function(_0x396c46,_0x22eac2){if(_0x396c46[_0x3693('0x42')]['id']){delete _0x396c46['body']['id'];}return db[_0x3693('0x39')][_0x3693('0x40')]({'where':{'id':_0x396c46['params']['id']}})['then'](handleEntityNotFound(_0x22eac2,null))['then'](saveUpdates(_0x396c46[_0x3693('0x42')],null))[_0x3693('0x22')](respondWithResult(_0x22eac2,null))[_0x3693('0x3c')](handleError(_0x22eac2,null));};exports[_0x3693('0x43')]=function(_0x4a09c1,_0x32e4e0,_0x43a8dd){var _0x164d4b=require(_0x3693('0x44'));var _0x8a8f54=![];var _0x5f00f3={};if(_0x4a09c1['query'][_0x3693('0x2a')]&&_0x4a09c1[_0x3693('0x2d')][_0x3693('0x2a')]===_0x3693('0x45')){_0x5f00f3[_0x3693('0x45')]=_0x4a09c1['params']['id'];}else{_0x5f00f3['id']=_0x4a09c1[_0x3693('0x46')]['id'];}return db[_0x3693('0x39')][_0x3693('0x40')]({'where':_0x5f00f3,'attributes':['id',_0x3693('0x47'),_0x3693('0x48')],'raw':!![]})[_0x3693('0x22')](handleEntityNotFound(_0x32e4e0,null))[_0x3693('0x22')](function(_0x56bb8c){if(_0x56bb8c){var _0x3a2ee9=_0x56bb8c[_0x3693('0x47')];var _0x19c123=util[_0x3693('0x49')](_0x3693('0x4a'),_0x3a2ee9);if(fs[_0x3693('0x4b')](_0x19c123)){_0x8a8f54=!![];return _0x164d4b[_0x3693('0x4c')](_0x19c123,_0x3a2ee9,config[_0x3693('0x4d')]['recording'])[_0x3693('0x22')](function(){return _0x56bb8c;});}return _0x56bb8c;}})[_0x3693('0x22')](function(_0x4b9a7d){if(_0x4b9a7d){var _0x1d946d=_0x4b9a7d[_0x3693('0x47')];if(!fs[_0x3693('0x4b')](_0x1d946d)){throw new db[(_0x3693('0x4e'))][(_0x3693('0x4f'))](_0x3693('0x50'));}if(_0x4b9a7d[_0x3693('0x48')]){return _0x32e4e0[_0x3693('0x43')](_0x1d946d,_0x4b9a7d['filename']+path[_0x3693('0x51')](_0x1d946d),function(){if(_0x8a8f54){fs[_0x3693('0x52')](_0x1d946d);}});}else{return _0x32e4e0[_0x3693('0x43')](_0x1d946d,function(_0x4c7711){if(_0x8a8f54){fs[_0x3693('0x52')](_0x1d946d);}});}}})[_0x3693('0x3c')](function(_0x240e27){if(_0x240e27[_0x3693('0x53')]==='SquareRecording\x20not\x20found'){_0x32e4e0[_0x3693('0x17')](0x194)[_0x3693('0x54')](_0x3693('0x55'));}else{return handleError(_0x32e4e0,null);}});};exports[_0x3693('0x56')]=function(_0x5d3ff7,_0x2aae53){return db[_0x3693('0x39')][_0x3693('0x40')]({'where':{'id':_0x5d3ff7['params']['id']}})[_0x3693('0x22')](function(_0x5b22c6){if(_[_0x3693('0x57')](_0x5b22c6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5b22c6;})[_0x3693('0x22')](function(_0x2ef689){var _0x31e1d1=_0x2ef689[_0x3693('0x47')];logger[_0x3693('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x31e1d1);if(!_[_0x3693('0x57')](_0x2ef689[_0x3693('0x47')])&&fs['existsSync'](_0x31e1d1)){logger[_0x3693('0x58')]('File:\x20\x22'+_0x31e1d1+_0x3693('0x59'));fs[_0x3693('0x5a')](_0x31e1d1);}_0x31e1d1=_0x31e1d1+_0x3693('0x5b');if(!_['isNil'](_0x2ef689[_0x3693('0x47')])&&fs[_0x3693('0x4b')](_0x31e1d1)){logger['info'](_0x3693('0x5c')+_0x31e1d1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3693('0x5a')](_0x31e1d1);}return _0x2ef689;})[_0x3693('0x22')](function(_0x571d8a){if(!_0x571d8a)throw new InternalError();return _0x571d8a['destroy']();})[_0x3693('0x22')](function(){_0x2aae53[_0x3693('0x17')](0xcc)['end']();})['catch'](handleError(_0x2aae53,null));}; \ No newline at end of file +var _0x6628=['Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x6628,0x69));var _0x8662=function(_0x45a7a2,_0xea050a){_0x45a7a2=_0x45a7a2-0x0;var _0xde152c=_0x6628[_0x45a7a2];return _0xde152c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8662('0x0'));var zipdir=require(_0x8662('0x1'));var jsonpatch=require(_0x8662('0x2'));var rp=require(_0x8662('0x3'));var moment=require(_0x8662('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8662('0x5'));var util=require(_0x8662('0x6'));var path=require(_0x8662('0x7'));var sox=require('sox');var csv=require(_0x8662('0x8'));var ejs=require(_0x8662('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8662('0xa'));var squel=require(_0x8662('0xb'));var crypto=require(_0x8662('0xc'));var jsforce=require(_0x8662('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8662('0x8'));var querystring=require(_0x8662('0xe'));var Papa=require(_0x8662('0xf'));var Redis=require(_0x8662('0x10'));var authService=require(_0x8662('0x11'));var qs=require(_0x8662('0x12'));var as=require(_0x8662('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8662('0x14'))(_0x8662('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8662('0x16'))['db'];function respondWithStatusCode(_0x52f980,_0x219801){_0x219801=_0x219801||0xcc;return function(_0xbdd560){if(_0xbdd560){return _0x52f980[_0x8662('0x17')](_0x219801);}return _0x52f980[_0x8662('0x18')](_0x219801)[_0x8662('0x19')]();};}function respondWithResult(_0x408b15,_0x543161){_0x543161=_0x543161||0xc8;return function(_0x3e6ad9){if(_0x3e6ad9){return _0x408b15['status'](_0x543161)[_0x8662('0x1a')](_0x3e6ad9);}};}function respondWithFilteredResult(_0x23764e,_0x4fcd38){return function(_0x117e3e){if(_0x117e3e){var _0xb400a8=typeof _0x4fcd38[_0x8662('0x1b')]==='undefined'&&typeof _0x4fcd38[_0x8662('0x1c')]===_0x8662('0x1d');var _0x1ccc97=_0x117e3e[_0x8662('0x1e')];var _0x5ea616=_0xb400a8?0x0:_0x4fcd38['offset'];var _0x33fb91=_0xb400a8?_0x117e3e[_0x8662('0x1e')]:_0x4fcd38[_0x8662('0x1b')]+_0x4fcd38['limit'];var _0x133459;if(_0x33fb91>=_0x1ccc97){_0x33fb91=_0x1ccc97;_0x133459=0xc8;}else{_0x133459=0xce;}_0x23764e[_0x8662('0x18')](_0x133459);return _0x23764e[_0x8662('0x1f')](_0x8662('0x20'),_0x5ea616+'-'+_0x33fb91+'/'+_0x1ccc97)['json'](_0x117e3e);}return null;};}function patchUpdates(_0x379fcd){return function(_0x4bff8b){try{jsonpatch[_0x8662('0x21')](_0x4bff8b,_0x379fcd,!![]);}catch(_0x27f4b0){return BPromise['reject'](_0x27f4b0);}return _0x4bff8b[_0x8662('0x22')]();};}function saveUpdates(_0x3a0f3d,_0x3b39ec){return function(_0x4418ac){if(_0x4418ac){return _0x4418ac['update'](_0x3a0f3d)[_0x8662('0x23')](function(_0x5a477e){return _0x5a477e;});}return null;};}function removeEntity(_0x39c972,_0x3596eb){return function(_0x3afaa3){if(_0x3afaa3){return _0x3afaa3['destroy']()[_0x8662('0x23')](function(){_0x39c972[_0x8662('0x18')](0xcc)[_0x8662('0x19')]();});}};}function handleEntityNotFound(_0x2b9155,_0x29ea1f){return function(_0x47196f){if(!_0x47196f){_0x2b9155[_0x8662('0x17')](0x194);}return _0x47196f;};}function handleError(_0x2e2e5a,_0x8738b){_0x8738b=_0x8738b||0x1f4;return function(_0x52340b){logger['error'](_0x52340b['stack']);if(_0x52340b[_0x8662('0x24')]){delete _0x52340b['name'];}_0x2e2e5a[_0x8662('0x18')](_0x8738b)['send'](_0x52340b);};}exports[_0x8662('0x25')]=function(_0x267818,_0x394022){var _0x5dd03e={},_0x149412={},_0x1d63b0={'count':0x0,'rows':[]};var _0x4ed1ba=_[_0x8662('0x26')](db[_0x8662('0x27')][_0x8662('0x28')],function(_0x448b36){return{'name':_0x448b36[_0x8662('0x29')],'type':_0x448b36[_0x8662('0x2a')][_0x8662('0x2b')]};});_0x149412[_0x8662('0x2c')]=_['map'](_0x4ed1ba,_0x8662('0x24'));_0x149412[_0x8662('0x2d')]=_[_0x8662('0x2e')](_0x267818[_0x8662('0x2d')]);_0x149412[_0x8662('0x2f')]=_[_0x8662('0x30')](_0x149412['model'],_0x149412[_0x8662('0x2d')]);_0x5dd03e['attributes']=_[_0x8662('0x30')](_0x149412[_0x8662('0x2c')],qs[_0x8662('0x31')](_0x267818[_0x8662('0x2d')][_0x8662('0x31')]));_0x5dd03e[_0x8662('0x32')]=_0x5dd03e[_0x8662('0x32')][_0x8662('0x33')]?_0x5dd03e[_0x8662('0x32')]:_0x149412[_0x8662('0x2c')];if(!_0x267818[_0x8662('0x2d')][_0x8662('0x34')](_0x8662('0x35'))){_0x5dd03e[_0x8662('0x1c')]=qs[_0x8662('0x1c')](_0x267818[_0x8662('0x2d')]['limit']);_0x5dd03e[_0x8662('0x1b')]=qs[_0x8662('0x1b')](_0x267818[_0x8662('0x2d')][_0x8662('0x1b')]);}_0x5dd03e['order']=qs[_0x8662('0x36')](_0x267818[_0x8662('0x2d')]['sort']);_0x5dd03e['where']=qs['filters'](_[_0x8662('0x37')](_0x267818[_0x8662('0x2d')],_0x149412[_0x8662('0x2f')]),_0x4ed1ba);if(_0x267818['query'][_0x8662('0x38')]){_0x5dd03e[_0x8662('0x39')]=_[_0x8662('0x3a')](_0x5dd03e[_0x8662('0x39')],{'$or':_[_0x8662('0x26')](_0x4ed1ba,function(_0x5d8074){if(_0x5d8074[_0x8662('0x2a')]!=='VIRTUAL'){var _0x3f6478={};_0x3f6478[_0x5d8074[_0x8662('0x24')]]={'$like':'%'+_0x267818['query']['filter']+'%'};return _0x3f6478;}})});}_0x5dd03e=_[_0x8662('0x3a')]({},_0x5dd03e,_0x267818[_0x8662('0x3b')]);var _0x36bdcc={'where':_0x5dd03e[_0x8662('0x39')]};return db[_0x8662('0x27')][_0x8662('0x1e')](_0x36bdcc)[_0x8662('0x23')](function(_0x156da3){_0x1d63b0[_0x8662('0x1e')]=_0x156da3;if(_0x267818[_0x8662('0x2d')]['includeAll']){_0x5dd03e[_0x8662('0x3c')]=[{'all':!![]}];}return db[_0x8662('0x27')][_0x8662('0x3d')](_0x5dd03e);})[_0x8662('0x23')](function(_0x12ee91){_0x1d63b0[_0x8662('0x3e')]=_0x12ee91;return _0x1d63b0;})['then'](respondWithFilteredResult(_0x394022,_0x5dd03e))[_0x8662('0x3f')](handleError(_0x394022,null));};exports[_0x8662('0x40')]=function(_0x31ebe9,_0x25fb15){var _0x27adec={'raw':!![],'where':{'id':_0x31ebe9[_0x8662('0x41')]['id']}},_0x4fbeb8={};_0x4fbeb8[_0x8662('0x2c')]=_[_0x8662('0x2e')](db[_0x8662('0x27')][_0x8662('0x28')]);_0x4fbeb8[_0x8662('0x2d')]=_[_0x8662('0x2e')](_0x31ebe9[_0x8662('0x2d')]);_0x4fbeb8[_0x8662('0x2f')]=_['intersection'](_0x4fbeb8[_0x8662('0x2c')],_0x4fbeb8[_0x8662('0x2d')]);_0x27adec[_0x8662('0x32')]=_['intersection'](_0x4fbeb8[_0x8662('0x2c')],qs[_0x8662('0x31')](_0x31ebe9[_0x8662('0x2d')][_0x8662('0x31')]));_0x27adec[_0x8662('0x32')]=_0x27adec[_0x8662('0x32')][_0x8662('0x33')]?_0x27adec[_0x8662('0x32')]:_0x4fbeb8[_0x8662('0x2c')];if(_0x31ebe9[_0x8662('0x2d')]['includeAll']){_0x27adec[_0x8662('0x3c')]=[{'all':!![]}];}_0x27adec=_['merge']({},_0x27adec,_0x31ebe9[_0x8662('0x3b')]);return db[_0x8662('0x27')][_0x8662('0x42')](_0x27adec)[_0x8662('0x23')](handleEntityNotFound(_0x25fb15,null))['then'](respondWithResult(_0x25fb15,null))['catch'](handleError(_0x25fb15,null));};exports['create']=function(_0x4f7071,_0x377576){return db[_0x8662('0x27')][_0x8662('0x43')](_0x4f7071[_0x8662('0x44')],{})['then'](respondWithResult(_0x377576,0xc9))[_0x8662('0x3f')](handleError(_0x377576,null));};exports[_0x8662('0x45')]=function(_0x300cde,_0x19f4a3){if(_0x300cde['body']['id']){delete _0x300cde['body']['id'];}return db[_0x8662('0x27')]['find']({'where':{'id':_0x300cde[_0x8662('0x41')]['id']}})[_0x8662('0x23')](handleEntityNotFound(_0x19f4a3,null))['then'](saveUpdates(_0x300cde['body'],null))[_0x8662('0x23')](respondWithResult(_0x19f4a3,null))[_0x8662('0x3f')](handleError(_0x19f4a3,null));};exports[_0x8662('0x46')]=function(_0x32d6df,_0x345a36,_0x4a584d){var _0x195687=require(_0x8662('0x47'));var _0x51a7d4=![];var _0x2b0442={};if(_0x32d6df[_0x8662('0x2d')]['type']&&_0x32d6df['query'][_0x8662('0x2a')]===_0x8662('0x48')){_0x2b0442[_0x8662('0x48')]=_0x32d6df[_0x8662('0x41')]['id'];}else{_0x2b0442['id']=_0x32d6df['params']['id'];}return db[_0x8662('0x27')]['find']({'where':_0x2b0442,'attributes':['id',_0x8662('0x49'),_0x8662('0x4a')],'raw':!![]})[_0x8662('0x23')](handleEntityNotFound(_0x345a36,null))[_0x8662('0x23')](function(_0x2b7053){if(_0x2b7053){var _0x16a768=_0x2b7053[_0x8662('0x49')];var _0x122309=util['format'](_0x8662('0x4b'),_0x16a768);if(fs['existsSync'](_0x122309)){_0x51a7d4=!![];return _0x195687[_0x8662('0x4c')](_0x122309,_0x16a768,config[_0x8662('0x4d')][_0x8662('0x4e')])[_0x8662('0x23')](function(){return _0x2b7053;});}return _0x2b7053;}})[_0x8662('0x23')](function(_0x13de8e){if(_0x13de8e){var _0x54c37c=_0x13de8e['savePath'];if(!fs[_0x8662('0x4f')](_0x54c37c)){throw new db[(_0x8662('0x50'))][(_0x8662('0x51'))]('SquareRecording\x20not\x20found');}if(_0x13de8e[_0x8662('0x4a')]){return _0x345a36[_0x8662('0x46')](_0x54c37c,_0x13de8e[_0x8662('0x4a')]+path[_0x8662('0x52')](_0x54c37c),function(){if(_0x51a7d4){fs[_0x8662('0x53')](_0x54c37c);}});}else{return _0x345a36[_0x8662('0x46')](_0x54c37c,function(_0x3afea0){if(_0x51a7d4){fs[_0x8662('0x53')](_0x54c37c);}});}}})[_0x8662('0x3f')](function(_0xe911ce){if(_0xe911ce[_0x8662('0x54')]===_0x8662('0x55')){_0x345a36[_0x8662('0x18')](0x194)[_0x8662('0x56')](_0x8662('0x57'));}else{return handleError(_0x345a36,null);}});};exports['destroy']=function(_0x1878c4,_0x345338){return db['SquareRecording'][_0x8662('0x42')]({'where':{'id':_0x1878c4[_0x8662('0x41')]['id']}})['then'](function(_0x52b133){if(_[_0x8662('0x58')](_0x52b133)){throw new ReferenceError(_0x8662('0x59'));}return _0x52b133;})[_0x8662('0x23')](function(_0x394a98){var _0x5d2837=_0x394a98[_0x8662('0x49')];logger[_0x8662('0x5a')](_0x8662('0x5b'),_0x5d2837);if(!_[_0x8662('0x58')](_0x394a98[_0x8662('0x49')])&&fs[_0x8662('0x4f')](_0x5d2837)){logger[_0x8662('0x5a')](_0x8662('0x5c')+_0x5d2837+_0x8662('0x5d'));fs['unlinkSync'](_0x5d2837);}_0x5d2837=_0x5d2837+_0x8662('0x5e');if(!_[_0x8662('0x58')](_0x394a98[_0x8662('0x49')])&&fs[_0x8662('0x4f')](_0x5d2837)){logger[_0x8662('0x5a')](_0x8662('0x5c')+_0x5d2837+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8662('0x5f')](_0x5d2837);}return _0x394a98;})[_0x8662('0x23')](function(_0x4218d2){if(!_0x4218d2)throw new InternalError();return _0x4218d2['destroy']();})[_0x8662('0x23')](function(){_0x345338[_0x8662('0x18')](0xcc)[_0x8662('0x19')]();})['catch'](handleError(_0x345338,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 23e6a41..cdc1598 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 _0x6a0b=['./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x460569,_0x14212b){var _0x6181b4=function(_0x5f01b7){while(--_0x5f01b7){_0x460569['push'](_0x460569['shift']());}};_0x6181b4(++_0x14212b);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x226ba5,_0xe9b896){_0x226ba5=_0x226ba5-0x0;var _0x5d6ad5=_0x6a0b[_0x226ba5];return _0x5d6ad5;};'use strict';var _=require(_0xb6a0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb6a0('0x1'));var moment=require(_0xb6a0('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6a0('0x3'));var fs=require('fs');var path=require(_0xb6a0('0x4'));var rimraf=require(_0xb6a0('0x5'));var config=require(_0xb6a0('0x6'));var attributes=require(_0xb6a0('0x7'));module['exports']=function(_0x36c035,_0x348d1b){return _0x36c035[_0xb6a0('0x8')](_0xb6a0('0x9'),attributes,{'tableName':_0xb6a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9e5=['rimraf','../../config/environment','exports','define','SquareRecording','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x129f70,_0x57e337){var _0x4ae7ad=function(_0xa2d1a3){while(--_0xa2d1a3){_0x129f70['push'](_0x129f70['shift']());}};_0x4ae7ad(++_0x57e337);}(_0xf9e5,0x89));var _0x5f9e=function(_0x28b3db,_0x88ae29){_0x28b3db=_0x28b3db-0x0;var _0x241963=_0xf9e5[_0x28b3db];return _0x241963;};'use strict';var _=require(_0x5f9e('0x0'));var util=require(_0x5f9e('0x1'));var logger=require(_0x5f9e('0x2'))(_0x5f9e('0x3'));var moment=require(_0x5f9e('0x4'));var BPromise=require(_0x5f9e('0x5'));var rp=require(_0x5f9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f9e('0x7'));var config=require(_0x5f9e('0x8'));var attributes=require('./squareRecording.attributes');module[_0x5f9e('0x9')]=function(_0x4c3209,_0x5d1f10){return _0x4c3209[_0x5f9e('0xa')](_0x5f9e('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 08eff6f..545cebb 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 _0xd0bf=['../../config/utils','rpc','jayson/promise','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareRecording','options','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x391eed,_0x3fd74b){var _0x5608cf=function(_0x403422){while(--_0x403422){_0x391eed['push'](_0x391eed['shift']());}};_0x5608cf(++_0x3fd74b);}(_0xd0bf,0xd5));var _0xfd0b=function(_0x30710c,_0x2e88ff){_0x30710c=_0x30710c-0x0;var _0x3c28b3=_0xd0bf[_0x30710c];return _0x3c28b3;};'use strict';var _=require(_0xfd0b('0x0'));var util=require(_0xfd0b('0x1'));var moment=require(_0xfd0b('0x2'));var BPromise=require(_0xfd0b('0x3'));var rs=require(_0xfd0b('0x4'));var fs=require('fs');var Redis=require(_0xfd0b('0x5'));var db=require(_0xfd0b('0x6'))['db'];var utils=require(_0xfd0b('0x7'));var logger=require('../../config/logger')(_0xfd0b('0x8'));var config=require('../../config/environment');var jayson=require(_0xfd0b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11d0d1,_0x33d188,_0x1a590d){return new BPromise(function(_0x3c5ea0,_0x54d28a){return client['request'](_0x11d0d1,_0x1a590d)['then'](function(_0x497004){logger[_0xfd0b('0xa')](_0xfd0b('0xb'),_0x33d188,_0xfd0b('0xc'));logger['debug'](_0xfd0b('0xd'),_0x33d188,_0xfd0b('0xc'),JSON[_0xfd0b('0xe')](_0x497004));if(_0x497004[_0xfd0b('0xf')]){if(_0x497004[_0xfd0b('0xf')]['code']===0x1f4){logger[_0xfd0b('0xf')](_0xfd0b('0xb'),_0x33d188,_0x497004[_0xfd0b('0xf')]['message']);return _0x54d28a(_0x497004[_0xfd0b('0xf')][_0xfd0b('0x10')]);}logger[_0xfd0b('0xf')](_0xfd0b('0xb'),_0x33d188,_0x497004[_0xfd0b('0xf')][_0xfd0b('0x10')]);return _0x3c5ea0(_0x497004[_0xfd0b('0xf')][_0xfd0b('0x10')]);}else{logger[_0xfd0b('0xa')]('SquareRecording,\x20%s,\x20%s',_0x33d188,_0xfd0b('0xc'));_0x3c5ea0(_0x497004[_0xfd0b('0x11')][_0xfd0b('0x10')]);}})['catch'](function(_0x272d98){logger[_0xfd0b('0xf')](_0xfd0b('0xb'),_0x33d188,_0x272d98);_0x54d28a(_0x272d98);});});}exports[_0xfd0b('0x12')]=function(_0x3c632c){var _0x2eabb6=this;return new Promise(function(_0x31c4aa,_0x4206ca){return db['SquareRecording']['create'](_0x3c632c['body'],{'raw':_0x3c632c[_0xfd0b('0x13')]?_0x3c632c[_0xfd0b('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xfd0b('0x14')](function(_0x47c6a5){logger['info'](_0xfd0b('0x12'),_0x3c632c);logger[_0xfd0b('0x15')](_0xfd0b('0x12'),_0x3c632c,JSON['stringify'](_0x47c6a5));_0x31c4aa(_0x47c6a5);})['catch'](function(_0x3dbcb6){logger[_0xfd0b('0xf')](_0xfd0b('0x12'),_0x3dbcb6['message'],_0x3c632c);_0x4206ca(_0x2eabb6['error'](0x1f4,_0x3dbcb6[_0xfd0b('0x10')]));});});}; \ No newline at end of file +var _0x6036=['../../config/logger','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d0823,_0x43d47a){var _0x2aaede=function(_0x230bda){while(--_0x230bda){_0x4d0823['push'](_0x4d0823['shift']());}};_0x2aaede(++_0x43d47a);}(_0x6036,0x14b));var _0x6603=function(_0x302468,_0x31de67){_0x302468=_0x302468-0x0;var _0x1687d9=_0x6036[_0x302468];return _0x1687d9;};'use strict';var _=require(_0x6603('0x0'));var util=require(_0x6603('0x1'));var moment=require(_0x6603('0x2'));var BPromise=require(_0x6603('0x3'));var rs=require(_0x6603('0x4'));var fs=require('fs');var Redis=require(_0x6603('0x5'));var db=require(_0x6603('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6603('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6603('0x8')][_0x6603('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fb16c,_0xce0add,_0xfff709){return new BPromise(function(_0x5a0392,_0xc83ae7){return client[_0x6603('0xa')](_0x2fb16c,_0xfff709)[_0x6603('0xb')](function(_0x3002ee){logger[_0x6603('0xc')](_0x6603('0xd'),_0xce0add,_0x6603('0xe'));logger['debug'](_0x6603('0xf'),_0xce0add,_0x6603('0xe'),JSON['stringify'](_0x3002ee));if(_0x3002ee['error']){if(_0x3002ee[_0x6603('0x10')][_0x6603('0x11')]===0x1f4){logger[_0x6603('0x10')]('SquareRecording,\x20%s,\x20%s',_0xce0add,_0x3002ee[_0x6603('0x10')][_0x6603('0x12')]);return _0xc83ae7(_0x3002ee['error'][_0x6603('0x12')]);}logger['error'](_0x6603('0xd'),_0xce0add,_0x3002ee[_0x6603('0x10')][_0x6603('0x12')]);return _0x5a0392(_0x3002ee['error'][_0x6603('0x12')]);}else{logger['info'](_0x6603('0xd'),_0xce0add,_0x6603('0xe'));_0x5a0392(_0x3002ee['result'][_0x6603('0x12')]);}})[_0x6603('0x13')](function(_0x181a66){logger[_0x6603('0x10')]('SquareRecording,\x20%s,\x20%s',_0xce0add,_0x181a66);_0xc83ae7(_0x181a66);});});}exports[_0x6603('0x14')]=function(_0x3ad90b){var _0x4a430f=this;return new Promise(function(_0x12a139,_0x13d3b1){return db[_0x6603('0x15')][_0x6603('0x16')](_0x3ad90b[_0x6603('0x17')],{'raw':_0x3ad90b[_0x6603('0x18')]?_0x3ad90b[_0x6603('0x18')][_0x6603('0x19')]===undefined?!![]:![]:!![]})[_0x6603('0xb')](function(_0x221a8b){logger[_0x6603('0xc')](_0x6603('0x14'),_0x3ad90b);logger['debug'](_0x6603('0x14'),_0x3ad90b,JSON['stringify'](_0x221a8b));_0x12a139(_0x221a8b);})['catch'](function(_0x13ef59){logger[_0x6603('0x10')](_0x6603('0x14'),_0x13ef59[_0x6603('0x12')],_0x3ad90b);_0x13d3b1(_0x4a430f['error'](0x1f4,_0x13ef59[_0x6603('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index c82f617..ae241cb 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(_0x822a3f,_0x32fd83){var _0x1053e7=function(_0xf41a09){while(--_0xf41a09){_0x822a3f['push'](_0x822a3f['shift']());}};_0x1053e7(++_0x32fd83);}(_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 _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(_0x5ddda9,_0x43e558){var _0x53a004=function(_0x2794a1){while(--_0x2794a1){_0x5ddda9['push'](_0x5ddda9['shift']());}};_0x53a004(++_0x43e558);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 37b4a79..4d577db 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 _0x22e5=['BOOLEAN','STRING','DATE'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x22e5,0x142));var _0x522e=function(_0x1d2890,_0x1b9a67){_0x1d2890=_0x1d2890-0x0;var _0x233622=_0x22e5[_0x1d2890];return _0x233622;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0x522e('0x0')]},'network_script':{'type':Sequelize[_0x522e('0x0')]},'request':{'type':Sequelize[_0x522e('0x0')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x522e('0x0')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x522e('0x0')]},'callerid':{'type':Sequelize[_0x522e('0x0')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x522e('0x0')]},'callingani2':{'type':Sequelize[_0x522e('0x0')]},'callington':{'type':Sequelize[_0x522e('0x0')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x522e('0x0')]},'rdnis':{'type':Sequelize[_0x522e('0x0')]},'context':{'type':Sequelize[_0x522e('0x0')]},'extension':{'type':Sequelize[_0x522e('0x0')]},'priority':{'type':Sequelize[_0x522e('0x0')]},'enhanced':{'type':Sequelize[_0x522e('0x0')]},'accountcode':{'type':Sequelize[_0x522e('0x0')]},'threadid':{'type':Sequelize[_0x522e('0x0')]},'project_name':{'type':Sequelize[_0x522e('0x0')]},'joinAt':{'type':Sequelize[_0x522e('0x1')]},'leaveAt':{'type':Sequelize[_0x522e('0x1')]},'bot':{'type':Sequelize[_0x522e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xdd9d=['BOOLEAN','sequelize','STRING','DATE'];(function(_0xe4c712,_0x1e26d5){var _0x101962=function(_0x1bfc5a){while(--_0x1bfc5a){_0xe4c712['push'](_0xe4c712['shift']());}};_0x101962(++_0x1e26d5);}(_0xdd9d,0xd9));var _0xddd9=function(_0x3d8f92,_0x14017a){_0x3d8f92=_0x3d8f92-0x0;var _0x1e7b44=_0xdd9d[_0x3d8f92];return _0x1e7b44;};'use strict';var Sequelize=require(_0xddd9('0x0'));module['exports']={'network':{'type':Sequelize[_0xddd9('0x1')]},'network_script':{'type':Sequelize[_0xddd9('0x1')]},'request':{'type':Sequelize[_0xddd9('0x1')]},'channel':{'type':Sequelize[_0xddd9('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xddd9('0x1')]},'uniqueid':{'type':Sequelize[_0xddd9('0x1')]},'version':{'type':Sequelize[_0xddd9('0x1')]},'callerid':{'type':Sequelize[_0xddd9('0x1')]},'calleridname':{'type':Sequelize[_0xddd9('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xddd9('0x1')]},'callington':{'type':Sequelize[_0xddd9('0x1')]},'callingtns':{'type':Sequelize[_0xddd9('0x1')]},'dnid':{'type':Sequelize[_0xddd9('0x1')]},'rdnis':{'type':Sequelize[_0xddd9('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xddd9('0x1')]},'priority':{'type':Sequelize[_0xddd9('0x1')]},'enhanced':{'type':Sequelize[_0xddd9('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xddd9('0x1')]},'project_name':{'type':Sequelize[_0xddd9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xddd9('0x2')]},'bot':{'type':Sequelize[_0xddd9('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 586b1d5..92f70d0 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 _0x08a8=['VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','SquareReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','type'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x08a8,0xab));var _0x808a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x808a('0x0'));var rimraf=require(_0x808a('0x1'));var zipdir=require(_0x808a('0x2'));var jsonpatch=require(_0x808a('0x3'));var rp=require(_0x808a('0x4'));var moment=require('moment');var BPromise=require(_0x808a('0x5'));var Mustache=require(_0x808a('0x6'));var util=require(_0x808a('0x7'));var path=require('path');var sox=require(_0x808a('0x8'));var csv=require(_0x808a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x808a('0xa'));var _=require(_0x808a('0xb'));var squel=require(_0x808a('0xc'));var crypto=require('crypto');var jsforce=require(_0x808a('0xd'));var deskjs=require(_0x808a('0xe'));var toCsv=require(_0x808a('0x9'));var querystring=require(_0x808a('0xf'));var Papa=require(_0x808a('0x10'));var Redis=require(_0x808a('0x11'));var authService=require(_0x808a('0x12'));var qs=require(_0x808a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x808a('0x14'));var logger=require(_0x808a('0x15'))(_0x808a('0x16'));var utils=require(_0x808a('0x17'));var config=require(_0x808a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f642,_0x308229){_0x308229=_0x308229||0xcc;return function(_0x1823b9){if(_0x1823b9){return _0x14f642[_0x808a('0x19')](_0x308229);}return _0x14f642[_0x808a('0x1a')](_0x308229)[_0x808a('0x1b')]();};}function respondWithResult(_0x29e197,_0x10ace9){_0x10ace9=_0x10ace9||0xc8;return function(_0x5cba44){if(_0x5cba44){return _0x29e197['status'](_0x10ace9)[_0x808a('0x1c')](_0x5cba44);}};}function respondWithFilteredResult(_0x57d8e9,_0x19db95){return function(_0x3a9ec5){if(_0x3a9ec5){var _0xa7c64f=typeof _0x19db95['offset']===_0x808a('0x1d')&&typeof _0x19db95[_0x808a('0x1e')]===_0x808a('0x1d');var _0x54d171=_0x3a9ec5['count'];var _0x4e7beb=_0xa7c64f?0x0:_0x19db95[_0x808a('0x1f')];var _0x1f23f2=_0xa7c64f?_0x3a9ec5[_0x808a('0x20')]:_0x19db95[_0x808a('0x1f')]+_0x19db95[_0x808a('0x1e')];var _0x5d2c94;if(_0x1f23f2>=_0x54d171){_0x1f23f2=_0x54d171;_0x5d2c94=0xc8;}else{_0x5d2c94=0xce;}_0x57d8e9[_0x808a('0x1a')](_0x5d2c94);return _0x57d8e9[_0x808a('0x21')](_0x808a('0x22'),_0x4e7beb+'-'+_0x1f23f2+'/'+_0x54d171)[_0x808a('0x1c')](_0x3a9ec5);}return null;};}function patchUpdates(_0x3137eb){return function(_0x5a58f2){try{jsonpatch[_0x808a('0x23')](_0x5a58f2,_0x3137eb,!![]);}catch(_0x3354a0){return BPromise[_0x808a('0x24')](_0x3354a0);}return _0x5a58f2[_0x808a('0x25')]();};}function saveUpdates(_0x166efd,_0x132548){return function(_0xf050d){if(_0xf050d){return _0xf050d[_0x808a('0x26')](_0x166efd)['then'](function(_0x302eef){return _0x302eef;});}return null;};}function removeEntity(_0x4702f6,_0x3a3d70){return function(_0x4dffc1){if(_0x4dffc1){return _0x4dffc1[_0x808a('0x27')]()[_0x808a('0x28')](function(){_0x4702f6[_0x808a('0x1a')](0xcc)[_0x808a('0x1b')]();});}};}function handleEntityNotFound(_0x3c0f05,_0xbb3498){return function(_0x175650){if(!_0x175650){_0x3c0f05[_0x808a('0x19')](0x194);}return _0x175650;};}function handleError(_0x4a5dd7,_0x293c59){_0x293c59=_0x293c59||0x1f4;return function(_0x560274){logger[_0x808a('0x29')](_0x560274[_0x808a('0x2a')]);if(_0x560274[_0x808a('0x2b')]){delete _0x560274[_0x808a('0x2b')];}_0x4a5dd7[_0x808a('0x1a')](_0x293c59)[_0x808a('0x2c')](_0x560274);};}exports['index']=function(_0x317f93,_0x222f30){var _0x3c53ec={},_0x3d79ed={},_0x4c720={'count':0x0,'rows':[]};var _0x375bbb=_[_0x808a('0x2d')](db[_0x808a('0x2e')]['rawAttributes'],function(_0x251d6c){return{'name':_0x251d6c[_0x808a('0x2f')],'type':_0x251d6c['type'][_0x808a('0x30')]};});_0x3d79ed[_0x808a('0x31')]=_[_0x808a('0x2d')](_0x375bbb,'name');_0x3d79ed[_0x808a('0x32')]=_[_0x808a('0x33')](_0x317f93[_0x808a('0x32')]);_0x3d79ed[_0x808a('0x34')]=_['intersection'](_0x3d79ed[_0x808a('0x31')],_0x3d79ed[_0x808a('0x32')]);_0x3c53ec[_0x808a('0x35')]=_[_0x808a('0x36')](_0x3d79ed['model'],qs[_0x808a('0x37')](_0x317f93[_0x808a('0x32')][_0x808a('0x37')]));_0x3c53ec[_0x808a('0x35')]=_0x3c53ec[_0x808a('0x35')]['length']?_0x3c53ec['attributes']:_0x3d79ed['model'];if(!_0x317f93[_0x808a('0x32')][_0x808a('0x38')](_0x808a('0x39'))){_0x3c53ec[_0x808a('0x1e')]=qs['limit'](_0x317f93[_0x808a('0x32')][_0x808a('0x1e')]);_0x3c53ec[_0x808a('0x1f')]=qs['offset'](_0x317f93[_0x808a('0x32')][_0x808a('0x1f')]);}_0x3c53ec[_0x808a('0x3a')]=qs['sort'](_0x317f93[_0x808a('0x32')][_0x808a('0x3b')]);_0x3c53ec[_0x808a('0x3c')]=qs[_0x808a('0x34')](_[_0x808a('0x3d')](_0x317f93['query'],_0x3d79ed[_0x808a('0x34')]),_0x375bbb);if(_0x317f93[_0x808a('0x32')]['filter']){_0x3c53ec[_0x808a('0x3c')]=_['merge'](_0x3c53ec[_0x808a('0x3c')],{'$or':_[_0x808a('0x2d')](_0x375bbb,function(_0x37effd){if(_0x37effd[_0x808a('0x3e')]!==_0x808a('0x3f')){var _0xde87a3={};_0xde87a3[_0x37effd['name']]={'$like':'%'+_0x317f93[_0x808a('0x32')][_0x808a('0x40')]+'%'};return _0xde87a3;}})});}_0x3c53ec=_[_0x808a('0x41')]({},_0x3c53ec,_0x317f93[_0x808a('0x42')]);var _0x4b51b3={'where':_0x3c53ec[_0x808a('0x3c')]};return db[_0x808a('0x2e')][_0x808a('0x20')](_0x4b51b3)['then'](function(_0x9cf23){_0x4c720[_0x808a('0x20')]=_0x9cf23;if(_0x317f93[_0x808a('0x32')]['includeAll']){_0x3c53ec[_0x808a('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0x808a('0x44')](_0x3c53ec);})['then'](function(_0x4c454c){_0x4c720[_0x808a('0x45')]=_0x4c454c;return _0x4c720;})[_0x808a('0x28')](respondWithFilteredResult(_0x222f30,_0x3c53ec))[_0x808a('0x46')](handleError(_0x222f30,null));};exports[_0x808a('0x47')]=function(_0x38c1af,_0x5be688){var _0x16c852={'raw':!![],'where':{'id':_0x38c1af['params']['id']}},_0x4d7bae={};_0x4d7bae['model']=_['keys'](db[_0x808a('0x2e')][_0x808a('0x48')]);_0x4d7bae[_0x808a('0x32')]=_[_0x808a('0x33')](_0x38c1af[_0x808a('0x32')]);_0x4d7bae[_0x808a('0x34')]=_[_0x808a('0x36')](_0x4d7bae[_0x808a('0x31')],_0x4d7bae[_0x808a('0x32')]);_0x16c852[_0x808a('0x35')]=_['intersection'](_0x4d7bae[_0x808a('0x31')],qs[_0x808a('0x37')](_0x38c1af[_0x808a('0x32')][_0x808a('0x37')]));_0x16c852[_0x808a('0x35')]=_0x16c852['attributes']['length']?_0x16c852[_0x808a('0x35')]:_0x4d7bae[_0x808a('0x31')];if(_0x38c1af[_0x808a('0x32')]['includeAll']){_0x16c852[_0x808a('0x43')]=[{'all':!![]}];}_0x16c852=_[_0x808a('0x41')]({},_0x16c852,_0x38c1af['options']);return db['SquareReport'][_0x808a('0x49')](_0x16c852)['then'](handleEntityNotFound(_0x5be688,null))['then'](respondWithResult(_0x5be688,null))['catch'](handleError(_0x5be688,null));};exports[_0x808a('0x4a')]=function(_0x22be44,_0x39275a){return db['SquareReport'][_0x808a('0x4a')](_0x22be44['body'],{})[_0x808a('0x28')](respondWithResult(_0x39275a,0xc9))[_0x808a('0x46')](handleError(_0x39275a,null));};exports['update']=function(_0x331375,_0x258645){if(_0x331375[_0x808a('0x4b')]['id']){delete _0x331375[_0x808a('0x4b')]['id'];}return db['SquareReport'][_0x808a('0x49')]({'where':{'id':_0x331375['params']['id']}})[_0x808a('0x28')](handleEntityNotFound(_0x258645,null))[_0x808a('0x28')](saveUpdates(_0x331375[_0x808a('0x4b')],null))[_0x808a('0x28')](respondWithResult(_0x258645,null))['catch'](handleError(_0x258645,null));};exports[_0x808a('0x27')]=function(_0xebabe2,_0xecfa0b){return db[_0x808a('0x2e')][_0x808a('0x49')]({'where':{'id':_0xebabe2[_0x808a('0x4c')]['id']}})[_0x808a('0x28')](handleEntityNotFound(_0xecfa0b,null))[_0x808a('0x28')](removeEntity(_0xecfa0b,null))[_0x808a('0x46')](handleError(_0xecfa0b,null));};exports[_0x808a('0x4d')]=function(_0x536891,_0x4ef509){return db[_0x808a('0x2e')][_0x808a('0x4d')]()[_0x808a('0x28')](respondWithResult(_0x4ef509,null))[_0x808a('0x46')](handleError(_0x4ef509,null));}; \ No newline at end of file +var _0x3e01=['sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','options','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e01,0xa4));var _0x13e0=function(_0x20126d,_0x1623b5){_0x20126d=_0x20126d-0x0;var _0x4e80c8=_0x3e01[_0x20126d];return _0x4e80c8;};'use strict';var emlformat=require(_0x13e0('0x0'));var rimraf=require(_0x13e0('0x1'));var zipdir=require(_0x13e0('0x2'));var jsonpatch=require(_0x13e0('0x3'));var rp=require(_0x13e0('0x4'));var moment=require(_0x13e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x13e0('0x6'));var util=require(_0x13e0('0x7'));var path=require(_0x13e0('0x8'));var sox=require(_0x13e0('0x9'));var csv=require(_0x13e0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13e0('0xb'));var _=require(_0x13e0('0xc'));var squel=require('squel');var crypto=require(_0x13e0('0xd'));var jsforce=require(_0x13e0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x13e0('0xa'));var querystring=require(_0x13e0('0xf'));var Papa=require('papaparse');var Redis=require(_0x13e0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x13e0('0x11'));var hardwareService=require(_0x13e0('0x12'));var logger=require(_0x13e0('0x13'))(_0x13e0('0x14'));var utils=require(_0x13e0('0x15'));var config=require(_0x13e0('0x16'));var licenseUtil=require(_0x13e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cb04c,_0x54c0f2){_0x54c0f2=_0x54c0f2||0xcc;return function(_0x184f65){if(_0x184f65){return _0x2cb04c[_0x13e0('0x18')](_0x54c0f2);}return _0x2cb04c[_0x13e0('0x19')](_0x54c0f2)[_0x13e0('0x1a')]();};}function respondWithResult(_0x52552c,_0x2a6871){_0x2a6871=_0x2a6871||0xc8;return function(_0x1ed2ed){if(_0x1ed2ed){return _0x52552c[_0x13e0('0x19')](_0x2a6871)[_0x13e0('0x1b')](_0x1ed2ed);}};}function respondWithFilteredResult(_0x4f6dd1,_0x34a7a2){return function(_0x32e940){if(_0x32e940){var _0x4d2b59=typeof _0x34a7a2[_0x13e0('0x1c')]===_0x13e0('0x1d')&&typeof _0x34a7a2[_0x13e0('0x1e')]===_0x13e0('0x1d');var _0x3af685=_0x32e940[_0x13e0('0x1f')];var _0x56b9c8=_0x4d2b59?0x0:_0x34a7a2[_0x13e0('0x1c')];var _0x4d5994=_0x4d2b59?_0x32e940[_0x13e0('0x1f')]:_0x34a7a2[_0x13e0('0x1c')]+_0x34a7a2[_0x13e0('0x1e')];var _0x25cbc9;if(_0x4d5994>=_0x3af685){_0x4d5994=_0x3af685;_0x25cbc9=0xc8;}else{_0x25cbc9=0xce;}_0x4f6dd1['status'](_0x25cbc9);return _0x4f6dd1[_0x13e0('0x20')](_0x13e0('0x21'),_0x56b9c8+'-'+_0x4d5994+'/'+_0x3af685)['json'](_0x32e940);}return null;};}function patchUpdates(_0x1612cf){return function(_0x533036){try{jsonpatch['apply'](_0x533036,_0x1612cf,!![]);}catch(_0x35403f){return BPromise[_0x13e0('0x22')](_0x35403f);}return _0x533036[_0x13e0('0x23')]();};}function saveUpdates(_0x478a43,_0xe4c240){return function(_0x3afddc){if(_0x3afddc){return _0x3afddc[_0x13e0('0x24')](_0x478a43)[_0x13e0('0x25')](function(_0xa9cf94){return _0xa9cf94;});}return null;};}function removeEntity(_0x5db761,_0xeca0d0){return function(_0xebeea4){if(_0xebeea4){return _0xebeea4[_0x13e0('0x26')]()[_0x13e0('0x25')](function(){_0x5db761['status'](0xcc)[_0x13e0('0x1a')]();});}};}function handleEntityNotFound(_0x358506,_0x57374b){return function(_0x2d43a3){if(!_0x2d43a3){_0x358506['sendStatus'](0x194);}return _0x2d43a3;};}function handleError(_0x2ae289,_0x5c917f){_0x5c917f=_0x5c917f||0x1f4;return function(_0xd7e60d){logger[_0x13e0('0x27')](_0xd7e60d['stack']);if(_0xd7e60d['name']){delete _0xd7e60d[_0x13e0('0x28')];}_0x2ae289[_0x13e0('0x19')](_0x5c917f)['send'](_0xd7e60d);};}exports[_0x13e0('0x29')]=function(_0x40ca05,_0x8b783f){var _0x41f24c={},_0x47544b={},_0x40fbe6={'count':0x0,'rows':[]};var _0x323672=_[_0x13e0('0x2a')](db[_0x13e0('0x2b')][_0x13e0('0x2c')],function(_0x1bd833){return{'name':_0x1bd833[_0x13e0('0x2d')],'type':_0x1bd833[_0x13e0('0x2e')][_0x13e0('0x2f')]};});_0x47544b[_0x13e0('0x30')]=_['map'](_0x323672,_0x13e0('0x28'));_0x47544b[_0x13e0('0x31')]=_['keys'](_0x40ca05['query']);_0x47544b[_0x13e0('0x32')]=_[_0x13e0('0x33')](_0x47544b[_0x13e0('0x30')],_0x47544b[_0x13e0('0x31')]);_0x41f24c[_0x13e0('0x34')]=_[_0x13e0('0x33')](_0x47544b[_0x13e0('0x30')],qs['fields'](_0x40ca05[_0x13e0('0x31')][_0x13e0('0x35')]));_0x41f24c[_0x13e0('0x34')]=_0x41f24c['attributes'][_0x13e0('0x36')]?_0x41f24c[_0x13e0('0x34')]:_0x47544b['model'];if(!_0x40ca05[_0x13e0('0x31')][_0x13e0('0x37')](_0x13e0('0x38'))){_0x41f24c[_0x13e0('0x1e')]=qs[_0x13e0('0x1e')](_0x40ca05[_0x13e0('0x31')][_0x13e0('0x1e')]);_0x41f24c[_0x13e0('0x1c')]=qs[_0x13e0('0x1c')](_0x40ca05['query'][_0x13e0('0x1c')]);}_0x41f24c[_0x13e0('0x39')]=qs[_0x13e0('0x3a')](_0x40ca05['query'][_0x13e0('0x3a')]);_0x41f24c[_0x13e0('0x3b')]=qs[_0x13e0('0x32')](_[_0x13e0('0x3c')](_0x40ca05[_0x13e0('0x31')],_0x47544b['filters']),_0x323672);if(_0x40ca05[_0x13e0('0x31')][_0x13e0('0x3d')]){_0x41f24c[_0x13e0('0x3b')]=_['merge'](_0x41f24c[_0x13e0('0x3b')],{'$or':_[_0x13e0('0x2a')](_0x323672,function(_0x3e5322){if(_0x3e5322['type']!=='VIRTUAL'){var _0x2b32a1={};_0x2b32a1[_0x3e5322['name']]={'$like':'%'+_0x40ca05[_0x13e0('0x31')][_0x13e0('0x3d')]+'%'};return _0x2b32a1;}})});}_0x41f24c=_[_0x13e0('0x3e')]({},_0x41f24c,_0x40ca05['options']);var _0x4e52a5={'where':_0x41f24c[_0x13e0('0x3b')]};return db['SquareReport'][_0x13e0('0x1f')](_0x4e52a5)[_0x13e0('0x25')](function(_0x36b342){_0x40fbe6[_0x13e0('0x1f')]=_0x36b342;if(_0x40ca05[_0x13e0('0x31')][_0x13e0('0x3f')]){_0x41f24c[_0x13e0('0x40')]=[{'all':!![]}];}return db[_0x13e0('0x2b')][_0x13e0('0x41')](_0x41f24c);})['then'](function(_0x58ae8d){_0x40fbe6['rows']=_0x58ae8d;return _0x40fbe6;})[_0x13e0('0x25')](respondWithFilteredResult(_0x8b783f,_0x41f24c))[_0x13e0('0x42')](handleError(_0x8b783f,null));};exports[_0x13e0('0x43')]=function(_0x8f9065,_0x1c155a){var _0x4499cc={'raw':!![],'where':{'id':_0x8f9065[_0x13e0('0x44')]['id']}},_0x243ba4={};_0x243ba4[_0x13e0('0x30')]=_['keys'](db['SquareReport'][_0x13e0('0x2c')]);_0x243ba4['query']=_[_0x13e0('0x45')](_0x8f9065['query']);_0x243ba4[_0x13e0('0x32')]=_['intersection'](_0x243ba4[_0x13e0('0x30')],_0x243ba4[_0x13e0('0x31')]);_0x4499cc['attributes']=_[_0x13e0('0x33')](_0x243ba4[_0x13e0('0x30')],qs[_0x13e0('0x35')](_0x8f9065[_0x13e0('0x31')][_0x13e0('0x35')]));_0x4499cc[_0x13e0('0x34')]=_0x4499cc[_0x13e0('0x34')]['length']?_0x4499cc[_0x13e0('0x34')]:_0x243ba4['model'];if(_0x8f9065[_0x13e0('0x31')][_0x13e0('0x3f')]){_0x4499cc[_0x13e0('0x40')]=[{'all':!![]}];}_0x4499cc=_[_0x13e0('0x3e')]({},_0x4499cc,_0x8f9065[_0x13e0('0x46')]);return db['SquareReport']['find'](_0x4499cc)[_0x13e0('0x25')](handleEntityNotFound(_0x1c155a,null))[_0x13e0('0x25')](respondWithResult(_0x1c155a,null))[_0x13e0('0x42')](handleError(_0x1c155a,null));};exports[_0x13e0('0x47')]=function(_0x3d6de1,_0x3a7921){return db[_0x13e0('0x2b')][_0x13e0('0x47')](_0x3d6de1[_0x13e0('0x48')],{})[_0x13e0('0x25')](respondWithResult(_0x3a7921,0xc9))[_0x13e0('0x42')](handleError(_0x3a7921,null));};exports[_0x13e0('0x24')]=function(_0x2b670a,_0x2e0b94){if(_0x2b670a[_0x13e0('0x48')]['id']){delete _0x2b670a['body']['id'];}return db[_0x13e0('0x2b')]['find']({'where':{'id':_0x2b670a['params']['id']}})[_0x13e0('0x25')](handleEntityNotFound(_0x2e0b94,null))[_0x13e0('0x25')](saveUpdates(_0x2b670a['body'],null))[_0x13e0('0x25')](respondWithResult(_0x2e0b94,null))[_0x13e0('0x42')](handleError(_0x2e0b94,null));};exports['destroy']=function(_0x18d296,_0x539c85){return db[_0x13e0('0x2b')]['find']({'where':{'id':_0x18d296[_0x13e0('0x44')]['id']}})[_0x13e0('0x25')](handleEntityNotFound(_0x539c85,null))[_0x13e0('0x25')](removeEntity(_0x539c85,null))[_0x13e0('0x42')](handleError(_0x539c85,null));};exports[_0x13e0('0x49')]=function(_0x12b572,_0x577a58){return db['SquareReport'][_0x13e0('0x49')]()[_0x13e0('0x25')](respondWithResult(_0x577a58,null))[_0x13e0('0x42')](handleError(_0x577a58,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ba25c02..b120943 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 _0x655d=['path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14bdfb,_0x7ebb3c){var _0x433477=function(_0x499bf6){while(--_0x499bf6){_0x14bdfb['push'](_0x14bdfb['shift']());}};_0x433477(++_0x7ebb3c);}(_0x655d,0x15e));var _0xd655=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x655d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd655('0x0'));var util=require(_0xd655('0x1'));var logger=require(_0xd655('0x2'))(_0xd655('0x3'));var moment=require(_0xd655('0x4'));var BPromise=require(_0xd655('0x5'));var rp=require(_0xd655('0x6'));var fs=require('fs');var path=require(_0xd655('0x7'));var rimraf=require(_0xd655('0x8'));var config=require(_0xd655('0x9'));var attributes=require(_0xd655('0xa'));module[_0xd655('0xb')]=function(_0x33397a,_0x5d0412){return _0x33397a[_0xd655('0xc')]('SquareReport',attributes,{'tableName':_0xd655('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xd655('0xe'),_0xd655('0xf')]},{'name':_0xd655('0x10'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c79=['bluebird','request-promise','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment'];(function(_0x155ca1,_0x487df6){var _0x29a92d=function(_0x2938a4){while(--_0x2938a4){_0x155ca1['push'](_0x155ca1['shift']());}};_0x29a92d(++_0x487df6);}(_0x4c79,0x182));var _0x94c7=function(_0x5f3175,_0x389e09){_0x5f3175=_0x5f3175-0x0;var _0x12fbe9=_0x4c79[_0x5f3175];return _0x12fbe9;};'use strict';var _=require(_0x94c7('0x0'));var util=require(_0x94c7('0x1'));var logger=require('../../config/logger')(_0x94c7('0x2'));var moment=require(_0x94c7('0x3'));var BPromise=require(_0x94c7('0x4'));var rp=require(_0x94c7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x94c7('0x6'));var attributes=require(_0x94c7('0x7'));module[_0x94c7('0x8')]=function(_0x39fdd5,_0x2115a9){return _0x39fdd5['define'](_0x94c7('0x9'),attributes,{'tableName':_0x94c7('0xa'),'paranoid':![],'indexes':[{'name':_0x94c7('0xb'),'fields':[_0x94c7('0xc'),_0x94c7('0xd')]},{'name':_0x94c7('0xe'),'fields':[_0x94c7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index f6302e9..79fcec9 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 _0x91fd=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','CreateSquareReport','create','options','UpdateSquareReport','update','body','raw','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3d47d3,_0x3a7c4a){var _0x26af4b=function(_0x458e9b){while(--_0x458e9b){_0x3d47d3['push'](_0x3d47d3['shift']());}};_0x26af4b(++_0x3a7c4a);}(_0x91fd,0x1c4));var _0xd91f=function(_0x5bc05a,_0x23f34f){_0x5bc05a=_0x5bc05a-0x0;var _0x37fcf3=_0x91fd[_0x5bc05a];return _0x37fcf3;};'use strict';var _=require(_0xd91f('0x0'));var util=require(_0xd91f('0x1'));var moment=require(_0xd91f('0x2'));var BPromise=require(_0xd91f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd91f('0x4'))['db'];var utils=require(_0xd91f('0x5'));var logger=require(_0xd91f('0x6'))('rpc');var config=require(_0xd91f('0x7'));var jayson=require(_0xd91f('0x8'));var client=jayson[_0xd91f('0x9')][_0xd91f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331783,_0xf1a902,_0x5adf6f){return new BPromise(function(_0x326b97,_0x18fd2e){return client['request'](_0x331783,_0x5adf6f)[_0xd91f('0xb')](function(_0x4bfee6){logger[_0xd91f('0xc')](_0xd91f('0xd'),_0xf1a902,_0xd91f('0xe'));logger[_0xd91f('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0xf1a902,'request\x20sent',JSON[_0xd91f('0x10')](_0x4bfee6));if(_0x4bfee6['error']){if(_0x4bfee6['error'][_0xd91f('0x11')]===0x1f4){logger['error'](_0xd91f('0xd'),_0xf1a902,_0x4bfee6[_0xd91f('0x12')][_0xd91f('0x13')]);return _0x18fd2e(_0x4bfee6[_0xd91f('0x12')][_0xd91f('0x13')]);}logger[_0xd91f('0x12')](_0xd91f('0xd'),_0xf1a902,_0x4bfee6[_0xd91f('0x12')][_0xd91f('0x13')]);return _0x326b97(_0x4bfee6[_0xd91f('0x12')][_0xd91f('0x13')]);}else{logger['info'](_0xd91f('0xd'),_0xf1a902,_0xd91f('0xe'));_0x326b97(_0x4bfee6['result'][_0xd91f('0x13')]);}})[_0xd91f('0x14')](function(_0xb0ca4d){logger[_0xd91f('0x12')](_0xd91f('0xd'),_0xf1a902,_0xb0ca4d);_0x18fd2e(_0xb0ca4d);});});}exports[_0xd91f('0x15')]=function(_0x29e43a){var _0x2ceb4b=this;return new Promise(function(_0x3fc08f,_0x4a155c){return db['SquareReport'][_0xd91f('0x16')](_0x29e43a['body'],{'raw':_0x29e43a[_0xd91f('0x17')]?_0x29e43a[_0xd91f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xd91f('0xb')](function(_0x3c2da9){logger['info'](_0xd91f('0x15'),_0x29e43a);logger['debug'](_0xd91f('0x15'),_0x29e43a,JSON[_0xd91f('0x10')](_0x3c2da9));_0x3fc08f(_0x3c2da9);})[_0xd91f('0x14')](function(_0x40a275){logger['error'](_0xd91f('0x15'),_0x40a275[_0xd91f('0x13')],_0x29e43a);_0x4a155c(_0x2ceb4b[_0xd91f('0x12')](0x1f4,_0x40a275[_0xd91f('0x13')]));});});};exports[_0xd91f('0x18')]=function(_0x39ef2d){var _0x56eec9=this;return new Promise(function(_0x2f214d,_0x3d8bed){return db['SquareReport'][_0xd91f('0x19')](_0x39ef2d[_0xd91f('0x1a')],{'raw':_0x39ef2d[_0xd91f('0x17')]?_0x39ef2d['options'][_0xd91f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ef2d[_0xd91f('0x17')]?_0x39ef2d[_0xd91f('0x17')][_0xd91f('0x1c')]||null:null,'attributes':_0x39ef2d['options']?_0x39ef2d[_0xd91f('0x17')][_0xd91f('0x1d')]||null:null,'limit':_0x39ef2d[_0xd91f('0x17')]?_0x39ef2d[_0xd91f('0x17')][_0xd91f('0x1e')]||null:null})['then'](function(_0x217b18){logger[_0xd91f('0xc')](_0xd91f('0x18'),_0x39ef2d);logger[_0xd91f('0xf')](_0xd91f('0x18'),_0x39ef2d,JSON[_0xd91f('0x10')](_0x217b18));_0x2f214d(_0x217b18);})[_0xd91f('0x14')](function(_0x3570dd){logger['error'](_0xd91f('0x18'),_0x3570dd[_0xd91f('0x13')],_0x39ef2d);_0x3d8bed(_0x56eec9[_0xd91f('0x12')](0x1f4,_0x3570dd[_0xd91f('0x13')]));});});}; \ No newline at end of file +var _0x8ec9=['request\x20sent','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x370eab,_0x3aff4c){var _0x10b1d2=function(_0x45418d){while(--_0x45418d){_0x370eab['push'](_0x370eab['shift']());}};_0x10b1d2(++_0x3aff4c);}(_0x8ec9,0x178));var _0x98ec=function(_0x2484b8,_0x24b9b0){_0x2484b8=_0x2484b8-0x0;var _0x3a0377=_0x8ec9[_0x2484b8];return _0x3a0377;};'use strict';var _=require('lodash');var util=require(_0x98ec('0x0'));var moment=require(_0x98ec('0x1'));var BPromise=require(_0x98ec('0x2'));var rs=require(_0x98ec('0x3'));var fs=require('fs');var Redis=require(_0x98ec('0x4'));var db=require(_0x98ec('0x5'))['db'];var utils=require(_0x98ec('0x6'));var logger=require(_0x98ec('0x7'))(_0x98ec('0x8'));var config=require(_0x98ec('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x98ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210798,_0x55f026,_0x66b74c){return new BPromise(function(_0x23aed6,_0x25ed76){return client[_0x98ec('0xb')](_0x210798,_0x66b74c)[_0x98ec('0xc')](function(_0x273cfc){logger[_0x98ec('0xd')](_0x98ec('0xe'),_0x55f026,'request\x20sent');logger[_0x98ec('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x55f026,'request\x20sent',JSON[_0x98ec('0x10')](_0x273cfc));if(_0x273cfc[_0x98ec('0x11')]){if(_0x273cfc[_0x98ec('0x11')][_0x98ec('0x12')]===0x1f4){logger[_0x98ec('0x11')]('SquareReport,\x20%s,\x20%s',_0x55f026,_0x273cfc[_0x98ec('0x11')][_0x98ec('0x13')]);return _0x25ed76(_0x273cfc['error'][_0x98ec('0x13')]);}logger[_0x98ec('0x11')](_0x98ec('0xe'),_0x55f026,_0x273cfc[_0x98ec('0x11')]['message']);return _0x23aed6(_0x273cfc[_0x98ec('0x11')][_0x98ec('0x13')]);}else{logger['info'](_0x98ec('0xe'),_0x55f026,_0x98ec('0x14'));_0x23aed6(_0x273cfc[_0x98ec('0x15')][_0x98ec('0x13')]);}})[_0x98ec('0x16')](function(_0x5d9299){logger['error']('SquareReport,\x20%s,\x20%s',_0x55f026,_0x5d9299);_0x25ed76(_0x5d9299);});});}exports[_0x98ec('0x17')]=function(_0x19e1db){var _0x2b4844=this;return new Promise(function(_0xaf4750,_0x33eb94){return db[_0x98ec('0x18')][_0x98ec('0x19')](_0x19e1db[_0x98ec('0x1a')],{'raw':_0x19e1db[_0x98ec('0x1b')]?_0x19e1db['options'][_0x98ec('0x1c')]===undefined?!![]:![]:!![]})[_0x98ec('0xc')](function(_0x2e5e5a){logger['info'](_0x98ec('0x17'),_0x19e1db);logger[_0x98ec('0xf')]('CreateSquareReport',_0x19e1db,JSON[_0x98ec('0x10')](_0x2e5e5a));_0xaf4750(_0x2e5e5a);})[_0x98ec('0x16')](function(_0x2d1ab2){logger[_0x98ec('0x11')]('CreateSquareReport',_0x2d1ab2[_0x98ec('0x13')],_0x19e1db);_0x33eb94(_0x2b4844['error'](0x1f4,_0x2d1ab2[_0x98ec('0x13')]));});});};exports[_0x98ec('0x1d')]=function(_0x1586ed){var _0x4da1de=this;return new Promise(function(_0xe6ccac,_0x546050){return db['SquareReport'][_0x98ec('0x1e')](_0x1586ed[_0x98ec('0x1a')],{'raw':_0x1586ed[_0x98ec('0x1b')]?_0x1586ed['options'][_0x98ec('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1586ed[_0x98ec('0x1b')]?_0x1586ed[_0x98ec('0x1b')][_0x98ec('0x1f')]||null:null,'attributes':_0x1586ed[_0x98ec('0x1b')]?_0x1586ed[_0x98ec('0x1b')]['attributes']||null:null,'limit':_0x1586ed[_0x98ec('0x1b')]?_0x1586ed[_0x98ec('0x1b')][_0x98ec('0x20')]||null:null})[_0x98ec('0xc')](function(_0x5d7351){logger[_0x98ec('0xd')](_0x98ec('0x1d'),_0x1586ed);logger[_0x98ec('0xf')](_0x98ec('0x1d'),_0x1586ed,JSON['stringify'](_0x5d7351));_0xe6ccac(_0x5d7351);})[_0x98ec('0x16')](function(_0x5cd798){logger[_0x98ec('0x11')]('UpdateSquareReport',_0x5cd798[_0x98ec('0x13')],_0x1586ed);_0x546050(_0x4da1de[_0x98ec('0x11')](0x1f4,_0x5cd798['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c34905c..40194af 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 _0x0969=['isAuthenticated','describe','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe'];(function(_0x55406d,_0x116f1e){var _0x5a8275=function(_0x1a8ae3){while(--_0x1a8ae3){_0x55406d['push'](_0x55406d['shift']());}};_0x5a8275(++_0x116f1e);}(_0x0969,0xce));var _0x9096=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0969[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x9096('0x0'));var util=require(_0x9096('0x1'));var path=require(_0x9096('0x2'));var timeout=require(_0x9096('0x3'));var express=require(_0x9096('0x4'));var router=express[_0x9096('0x5')]();var fs_extra=require(_0x9096('0x6'));var auth=require(_0x9096('0x7'));var interaction=require(_0x9096('0x8'));var config=require(_0x9096('0x9'));var controller=require(_0x9096('0xa'));router[_0x9096('0xb')]('/',auth['isAuthenticated'](),controller[_0x9096('0xc')]);router[_0x9096('0xb')](_0x9096('0xd'),auth[_0x9096('0xe')](),controller[_0x9096('0xf')]);router[_0x9096('0xb')](_0x9096('0x10'),auth['isAuthenticated'](),controller[_0x9096('0x11')]);router[_0x9096('0x12')]('/',auth[_0x9096('0xe')](),controller[_0x9096('0x13')]);router['put'](_0x9096('0x10'),auth['isAuthenticated'](),controller[_0x9096('0x14')]);router['delete'](_0x9096('0x10'),auth[_0x9096('0xe')](),controller['destroy']);module[_0x9096('0x15')]=router; \ No newline at end of file +var _0x6eb9=['describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated'];(function(_0x167384,_0x4b5c2b){var _0x289311=function(_0x12224c){while(--_0x12224c){_0x167384['push'](_0x167384['shift']());}};_0x289311(++_0x4b5c2b);}(_0x6eb9,0x185));var _0x96eb=function(_0x35d586,_0x43094a){_0x35d586=_0x35d586-0x0;var _0x4288ae=_0x6eb9[_0x35d586];return _0x4288ae;};'use strict';var multer=require(_0x96eb('0x0'));var util=require(_0x96eb('0x1'));var path=require('path');var timeout=require(_0x96eb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x96eb('0x3'));var config=require(_0x96eb('0x4'));var controller=require(_0x96eb('0x5'));router[_0x96eb('0x6')]('/',auth['isAuthenticated'](),controller[_0x96eb('0x7')]);router[_0x96eb('0x6')](_0x96eb('0x8'),auth[_0x96eb('0x9')](),controller[_0x96eb('0xa')]);router[_0x96eb('0x6')](_0x96eb('0xb'),auth[_0x96eb('0x9')](),controller[_0x96eb('0xc')]);router[_0x96eb('0xd')]('/',auth[_0x96eb('0x9')](),controller[_0x96eb('0xe')]);router[_0x96eb('0xf')](_0x96eb('0xb'),auth[_0x96eb('0x9')](),controller[_0x96eb('0x10')]);router['delete'](_0x96eb('0xb'),auth['isAuthenticated'](),controller[_0x96eb('0x11')]);module[_0x96eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 4f37c0a..78cfbcc 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 _0xead3=['TEXT','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xead3,0xd0));var _0x3ead=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0xead3[_0x54ea7a];return _0x65a10d;};'use strict';var Sequelize=require('sequelize');module[_0x3ead('0x0')]={'uniqueid':{'type':Sequelize[_0x3ead('0x1')]},'node':{'type':Sequelize[_0x3ead('0x1')]},'application':{'type':Sequelize[_0x3ead('0x1')]},'data':{'type':Sequelize[_0x3ead('0x2')]},'project_name':{'type':Sequelize[_0x3ead('0x1')]},'callerid':{'type':Sequelize[_0x3ead('0x1')]}}; \ No newline at end of file +var _0xbdf0=['exports','STRING','sequelize'];(function(_0x4a8339,_0x27eff4){var _0x2781cc=function(_0x17f00a){while(--_0x17f00a){_0x4a8339['push'](_0x4a8339['shift']());}};_0x2781cc(++_0x27eff4);}(_0xbdf0,0x71));var _0x0bdf=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0xbdf0[_0x25c326];return _0x762452;};'use strict';var Sequelize=require(_0x0bdf('0x0'));module[_0x0bdf('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0bdf('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0bdf('0x2')]},'callerid':{'type':Sequelize[_0x0bdf('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index aa2cff6..0f20611 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 _0xb271=['save','destroy','then','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0xb271,0x142));var _0x1b27=function(_0x50be34,_0x52f796){_0x50be34=_0x50be34-0x0;var _0x20a89a=_0xb271[_0x50be34];return _0x20a89a;};'use strict';var emlformat=require(_0x1b27('0x0'));var rimraf=require(_0x1b27('0x1'));var zipdir=require(_0x1b27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b27('0x3'));var moment=require(_0x1b27('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1b27('0x5'));var util=require(_0x1b27('0x6'));var path=require(_0x1b27('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1b27('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b27('0x9'));var squel=require(_0x1b27('0xa'));var crypto=require('crypto');var jsforce=require(_0x1b27('0xb'));var deskjs=require(_0x1b27('0xc'));var toCsv=require(_0x1b27('0xd'));var querystring=require(_0x1b27('0xe'));var Papa=require('papaparse');var Redis=require(_0x1b27('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1b27('0x10'));var as=require(_0x1b27('0x11'));var hardwareService=require(_0x1b27('0x12'));var logger=require(_0x1b27('0x13'))(_0x1b27('0x14'));var utils=require('../../config/utils');var config=require(_0x1b27('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b27('0x16'))['db'];function respondWithStatusCode(_0x9eb8a4,_0x3b1928){_0x3b1928=_0x3b1928||0xcc;return function(_0x5745b8){if(_0x5745b8){return _0x9eb8a4[_0x1b27('0x17')](_0x3b1928);}return _0x9eb8a4[_0x1b27('0x18')](_0x3b1928)[_0x1b27('0x19')]();};}function respondWithResult(_0xa46d2d,_0x5289e8){_0x5289e8=_0x5289e8||0xc8;return function(_0x1363c1){if(_0x1363c1){return _0xa46d2d['status'](_0x5289e8)[_0x1b27('0x1a')](_0x1363c1);}};}function respondWithFilteredResult(_0x51498e,_0x55dc8e){return function(_0x147f65){if(_0x147f65){var _0x20e846=typeof _0x55dc8e[_0x1b27('0x1b')]===_0x1b27('0x1c')&&typeof _0x55dc8e[_0x1b27('0x1d')]===_0x1b27('0x1c');var _0xaa0361=_0x147f65['count'];var _0x378d22=_0x20e846?0x0:_0x55dc8e['offset'];var _0x4d6be3=_0x20e846?_0x147f65[_0x1b27('0x1e')]:_0x55dc8e['offset']+_0x55dc8e[_0x1b27('0x1d')];var _0x46cd1e;if(_0x4d6be3>=_0xaa0361){_0x4d6be3=_0xaa0361;_0x46cd1e=0xc8;}else{_0x46cd1e=0xce;}_0x51498e[_0x1b27('0x18')](_0x46cd1e);return _0x51498e[_0x1b27('0x1f')]('Content-Range',_0x378d22+'-'+_0x4d6be3+'/'+_0xaa0361)['json'](_0x147f65);}return null;};}function patchUpdates(_0x2b55ae){return function(_0x5b64f1){try{jsonpatch[_0x1b27('0x20')](_0x5b64f1,_0x2b55ae,!![]);}catch(_0x1bef0a){return BPromise['reject'](_0x1bef0a);}return _0x5b64f1[_0x1b27('0x21')]();};}function saveUpdates(_0x265500,_0x1018c4){return function(_0x50fbed){if(_0x50fbed){return _0x50fbed['update'](_0x265500)['then'](function(_0x484272){return _0x484272;});}return null;};}function removeEntity(_0x4c0a94,_0x3c0b9b){return function(_0x32a472){if(_0x32a472){return _0x32a472[_0x1b27('0x22')]()[_0x1b27('0x23')](function(){_0x4c0a94['status'](0xcc)[_0x1b27('0x19')]();});}};}function handleEntityNotFound(_0x5b255d,_0x4d027a){return function(_0x5dedb8){if(!_0x5dedb8){_0x5b255d[_0x1b27('0x17')](0x194);}return _0x5dedb8;};}function handleError(_0x27c426,_0x180708){_0x180708=_0x180708||0x1f4;return function(_0x142724){logger[_0x1b27('0x24')](_0x142724[_0x1b27('0x25')]);if(_0x142724[_0x1b27('0x26')]){delete _0x142724['name'];}_0x27c426[_0x1b27('0x18')](_0x180708)['send'](_0x142724);};}exports[_0x1b27('0x27')]=function(_0xe17d13,_0x1ffa2d){var _0x17283b={},_0xc67c56={},_0x433d0e={'count':0x0,'rows':[]};var _0x11c43c=_[_0x1b27('0x28')](db[_0x1b27('0x29')][_0x1b27('0x2a')],function(_0x2359ba){return{'name':_0x2359ba[_0x1b27('0x2b')],'type':_0x2359ba[_0x1b27('0x2c')]['key']};});_0xc67c56[_0x1b27('0x2d')]=_[_0x1b27('0x28')](_0x11c43c,'name');_0xc67c56[_0x1b27('0x2e')]=_[_0x1b27('0x2f')](_0xe17d13[_0x1b27('0x2e')]);_0xc67c56[_0x1b27('0x30')]=_[_0x1b27('0x31')](_0xc67c56['model'],_0xc67c56[_0x1b27('0x2e')]);_0x17283b['attributes']=_[_0x1b27('0x31')](_0xc67c56[_0x1b27('0x2d')],qs[_0x1b27('0x32')](_0xe17d13[_0x1b27('0x2e')][_0x1b27('0x32')]));_0x17283b['attributes']=_0x17283b[_0x1b27('0x33')][_0x1b27('0x34')]?_0x17283b['attributes']:_0xc67c56[_0x1b27('0x2d')];if(!_0xe17d13['query'][_0x1b27('0x35')]('nolimit')){_0x17283b[_0x1b27('0x1d')]=qs['limit'](_0xe17d13[_0x1b27('0x2e')][_0x1b27('0x1d')]);_0x17283b[_0x1b27('0x1b')]=qs[_0x1b27('0x1b')](_0xe17d13[_0x1b27('0x2e')][_0x1b27('0x1b')]);}_0x17283b['order']=qs[_0x1b27('0x36')](_0xe17d13['query'][_0x1b27('0x36')]);_0x17283b['where']=qs['filters'](_[_0x1b27('0x37')](_0xe17d13[_0x1b27('0x2e')],_0xc67c56[_0x1b27('0x30')]),_0x11c43c);if(_0xe17d13[_0x1b27('0x2e')][_0x1b27('0x38')]){_0x17283b['where']=_[_0x1b27('0x39')](_0x17283b[_0x1b27('0x3a')],{'$or':_[_0x1b27('0x28')](_0x11c43c,function(_0x194065){if(_0x194065['type']!==_0x1b27('0x3b')){var _0x5d7d25={};_0x5d7d25[_0x194065[_0x1b27('0x26')]]={'$like':'%'+_0xe17d13[_0x1b27('0x2e')]['filter']+'%'};return _0x5d7d25;}})});}_0x17283b=_[_0x1b27('0x39')]({},_0x17283b,_0xe17d13[_0x1b27('0x3c')]);var _0x21c7eb={'where':_0x17283b[_0x1b27('0x3a')]};return db[_0x1b27('0x29')][_0x1b27('0x1e')](_0x21c7eb)['then'](function(_0x3ebe4e){_0x433d0e[_0x1b27('0x1e')]=_0x3ebe4e;if(_0xe17d13['query'][_0x1b27('0x3d')]){_0x17283b['include']=[{'all':!![]}];}return db[_0x1b27('0x29')][_0x1b27('0x3e')](_0x17283b);})[_0x1b27('0x23')](function(_0x169fa3){_0x433d0e[_0x1b27('0x3f')]=_0x169fa3;return _0x433d0e;})[_0x1b27('0x23')](respondWithFilteredResult(_0x1ffa2d,_0x17283b))[_0x1b27('0x40')](handleError(_0x1ffa2d,null));};exports['show']=function(_0x1da06a,_0x392957){var _0x56e6c2={'raw':!![],'where':{'id':_0x1da06a[_0x1b27('0x41')]['id']}},_0x517c00={};_0x517c00[_0x1b27('0x2d')]=_['keys'](db[_0x1b27('0x29')][_0x1b27('0x2a')]);_0x517c00[_0x1b27('0x2e')]=_['keys'](_0x1da06a[_0x1b27('0x2e')]);_0x517c00['filters']=_[_0x1b27('0x31')](_0x517c00[_0x1b27('0x2d')],_0x517c00[_0x1b27('0x2e')]);_0x56e6c2['attributes']=_['intersection'](_0x517c00[_0x1b27('0x2d')],qs[_0x1b27('0x32')](_0x1da06a[_0x1b27('0x2e')][_0x1b27('0x32')]));_0x56e6c2[_0x1b27('0x33')]=_0x56e6c2[_0x1b27('0x33')][_0x1b27('0x34')]?_0x56e6c2[_0x1b27('0x33')]:_0x517c00[_0x1b27('0x2d')];if(_0x1da06a[_0x1b27('0x2e')]['includeAll']){_0x56e6c2['include']=[{'all':!![]}];}_0x56e6c2=_[_0x1b27('0x39')]({},_0x56e6c2,_0x1da06a[_0x1b27('0x3c')]);return db['SquareDetailsReport'][_0x1b27('0x42')](_0x56e6c2)['then'](handleEntityNotFound(_0x392957,null))[_0x1b27('0x23')](respondWithResult(_0x392957,null))[_0x1b27('0x40')](handleError(_0x392957,null));};exports[_0x1b27('0x43')]=function(_0x1f41f7,_0x1b8a65){return db[_0x1b27('0x29')][_0x1b27('0x43')](_0x1f41f7[_0x1b27('0x44')],{})[_0x1b27('0x23')](respondWithResult(_0x1b8a65,0xc9))[_0x1b27('0x40')](handleError(_0x1b8a65,null));};exports[_0x1b27('0x45')]=function(_0x272889,_0x21437d){if(_0x272889[_0x1b27('0x44')]['id']){delete _0x272889[_0x1b27('0x44')]['id'];}return db[_0x1b27('0x29')]['find']({'where':{'id':_0x272889[_0x1b27('0x41')]['id']}})[_0x1b27('0x23')](handleEntityNotFound(_0x21437d,null))[_0x1b27('0x23')](saveUpdates(_0x272889[_0x1b27('0x44')],null))[_0x1b27('0x23')](respondWithResult(_0x21437d,null))[_0x1b27('0x40')](handleError(_0x21437d,null));};exports[_0x1b27('0x22')]=function(_0x2f1054,_0x174c15){return db['SquareDetailsReport'][_0x1b27('0x42')]({'where':{'id':_0x2f1054[_0x1b27('0x41')]['id']}})['then'](handleEntityNotFound(_0x174c15,null))['then'](removeEntity(_0x174c15,null))[_0x1b27('0x40')](handleError(_0x174c15,null));};exports[_0x1b27('0x46')]=function(_0x204967,_0x171743){return db[_0x1b27('0x29')][_0x1b27('0x46')]()['then'](respondWithResult(_0x171743,null))[_0x1b27('0x40')](handleError(_0x171743,null));}; \ No newline at end of file +var _0x3304=['hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','length','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3304,0xb0));var _0x4330=function(_0x1d852a,_0x807346){_0x1d852a=_0x1d852a-0x0;var _0x3910c8=_0x3304[_0x1d852a];return _0x3910c8;};'use strict';var emlformat=require(_0x4330('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4330('0x1'));var jsonpatch=require(_0x4330('0x2'));var rp=require(_0x4330('0x3'));var moment=require(_0x4330('0x4'));var BPromise=require(_0x4330('0x5'));var Mustache=require(_0x4330('0x6'));var util=require(_0x4330('0x7'));var path=require(_0x4330('0x8'));var sox=require(_0x4330('0x9'));var csv=require(_0x4330('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4330('0xb'));var crypto=require(_0x4330('0xc'));var jsforce=require(_0x4330('0xd'));var deskjs=require(_0x4330('0xe'));var toCsv=require(_0x4330('0xa'));var querystring=require(_0x4330('0xf'));var Papa=require(_0x4330('0x10'));var Redis=require(_0x4330('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4330('0x12'));var as=require(_0x4330('0x13'));var hardwareService=require(_0x4330('0x14'));var logger=require(_0x4330('0x15'))(_0x4330('0x16'));var utils=require(_0x4330('0x17'));var config=require(_0x4330('0x18'));var licenseUtil=require(_0x4330('0x19'));var db=require(_0x4330('0x1a'))['db'];function respondWithStatusCode(_0x3835ad,_0xc43165){_0xc43165=_0xc43165||0xcc;return function(_0x116577){if(_0x116577){return _0x3835ad[_0x4330('0x1b')](_0xc43165);}return _0x3835ad[_0x4330('0x1c')](_0xc43165)[_0x4330('0x1d')]();};}function respondWithResult(_0x43a579,_0x48a877){_0x48a877=_0x48a877||0xc8;return function(_0x596d50){if(_0x596d50){return _0x43a579[_0x4330('0x1c')](_0x48a877)[_0x4330('0x1e')](_0x596d50);}};}function respondWithFilteredResult(_0x293b80,_0x323ebd){return function(_0x6cb282){if(_0x6cb282){var _0x2e5680=typeof _0x323ebd[_0x4330('0x1f')]===_0x4330('0x20')&&typeof _0x323ebd[_0x4330('0x21')]===_0x4330('0x20');var _0x18cdfc=_0x6cb282[_0x4330('0x22')];var _0x2288b4=_0x2e5680?0x0:_0x323ebd[_0x4330('0x1f')];var _0x21b60d=_0x2e5680?_0x6cb282['count']:_0x323ebd[_0x4330('0x1f')]+_0x323ebd[_0x4330('0x21')];var _0x53a496;if(_0x21b60d>=_0x18cdfc){_0x21b60d=_0x18cdfc;_0x53a496=0xc8;}else{_0x53a496=0xce;}_0x293b80[_0x4330('0x1c')](_0x53a496);return _0x293b80[_0x4330('0x23')](_0x4330('0x24'),_0x2288b4+'-'+_0x21b60d+'/'+_0x18cdfc)[_0x4330('0x1e')](_0x6cb282);}return null;};}function patchUpdates(_0x4ef6a){return function(_0x47ec50){try{jsonpatch[_0x4330('0x25')](_0x47ec50,_0x4ef6a,!![]);}catch(_0x110403){return BPromise['reject'](_0x110403);}return _0x47ec50[_0x4330('0x26')]();};}function saveUpdates(_0x45565c,_0x2ecbac){return function(_0x18eb80){if(_0x18eb80){return _0x18eb80['update'](_0x45565c)['then'](function(_0x5dc94b){return _0x5dc94b;});}return null;};}function removeEntity(_0x212621,_0x2c153d){return function(_0x5c24a1){if(_0x5c24a1){return _0x5c24a1[_0x4330('0x27')]()[_0x4330('0x28')](function(){_0x212621[_0x4330('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0a86,_0x420c92){return function(_0x31e0b1){if(!_0x31e0b1){_0x2b0a86['sendStatus'](0x194);}return _0x31e0b1;};}function handleError(_0x117751,_0x596420){_0x596420=_0x596420||0x1f4;return function(_0x2240d8){logger[_0x4330('0x29')](_0x2240d8[_0x4330('0x2a')]);if(_0x2240d8['name']){delete _0x2240d8[_0x4330('0x2b')];}_0x117751[_0x4330('0x1c')](_0x596420)[_0x4330('0x2c')](_0x2240d8);};}exports[_0x4330('0x2d')]=function(_0x77c01e,_0x235f0e){var _0x554a15={},_0x2f3743={},_0x1b47b6={'count':0x0,'rows':[]};var _0xe3672f=_[_0x4330('0x2e')](db[_0x4330('0x2f')][_0x4330('0x30')],function(_0x308139){return{'name':_0x308139[_0x4330('0x31')],'type':_0x308139[_0x4330('0x32')]['key']};});_0x2f3743[_0x4330('0x33')]=_[_0x4330('0x2e')](_0xe3672f,_0x4330('0x2b'));_0x2f3743['query']=_[_0x4330('0x34')](_0x77c01e[_0x4330('0x35')]);_0x2f3743[_0x4330('0x36')]=_[_0x4330('0x37')](_0x2f3743['model'],_0x2f3743[_0x4330('0x35')]);_0x554a15[_0x4330('0x38')]=_[_0x4330('0x37')](_0x2f3743['model'],qs[_0x4330('0x39')](_0x77c01e['query'][_0x4330('0x39')]));_0x554a15[_0x4330('0x38')]=_0x554a15[_0x4330('0x38')]['length']?_0x554a15[_0x4330('0x38')]:_0x2f3743[_0x4330('0x33')];if(!_0x77c01e[_0x4330('0x35')][_0x4330('0x3a')](_0x4330('0x3b'))){_0x554a15[_0x4330('0x21')]=qs[_0x4330('0x21')](_0x77c01e[_0x4330('0x35')]['limit']);_0x554a15[_0x4330('0x1f')]=qs[_0x4330('0x1f')](_0x77c01e[_0x4330('0x35')]['offset']);}_0x554a15['order']=qs[_0x4330('0x3c')](_0x77c01e[_0x4330('0x35')][_0x4330('0x3c')]);_0x554a15[_0x4330('0x3d')]=qs[_0x4330('0x36')](_['pick'](_0x77c01e[_0x4330('0x35')],_0x2f3743[_0x4330('0x36')]),_0xe3672f);if(_0x77c01e[_0x4330('0x35')][_0x4330('0x3e')]){_0x554a15[_0x4330('0x3d')]=_[_0x4330('0x3f')](_0x554a15[_0x4330('0x3d')],{'$or':_[_0x4330('0x2e')](_0xe3672f,function(_0xb4dd9b){if(_0xb4dd9b['type']!==_0x4330('0x40')){var _0x7c3986={};_0x7c3986[_0xb4dd9b['name']]={'$like':'%'+_0x77c01e['query'][_0x4330('0x3e')]+'%'};return _0x7c3986;}})});}_0x554a15=_[_0x4330('0x3f')]({},_0x554a15,_0x77c01e[_0x4330('0x41')]);var _0x309fc2={'where':_0x554a15[_0x4330('0x3d')]};return db[_0x4330('0x2f')][_0x4330('0x22')](_0x309fc2)['then'](function(_0x278771){_0x1b47b6[_0x4330('0x22')]=_0x278771;if(_0x77c01e[_0x4330('0x35')][_0x4330('0x42')]){_0x554a15['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x4330('0x43')](_0x554a15);})[_0x4330('0x28')](function(_0x434b23){_0x1b47b6[_0x4330('0x44')]=_0x434b23;return _0x1b47b6;})[_0x4330('0x28')](respondWithFilteredResult(_0x235f0e,_0x554a15))['catch'](handleError(_0x235f0e,null));};exports[_0x4330('0x45')]=function(_0x5ba36c,_0x1e3ecf){var _0x46cdd0={'raw':!![],'where':{'id':_0x5ba36c['params']['id']}},_0xdd43da={};_0xdd43da[_0x4330('0x33')]=_[_0x4330('0x34')](db['SquareDetailsReport'][_0x4330('0x30')]);_0xdd43da[_0x4330('0x35')]=_[_0x4330('0x34')](_0x5ba36c['query']);_0xdd43da[_0x4330('0x36')]=_[_0x4330('0x37')](_0xdd43da[_0x4330('0x33')],_0xdd43da[_0x4330('0x35')]);_0x46cdd0[_0x4330('0x38')]=_['intersection'](_0xdd43da[_0x4330('0x33')],qs['fields'](_0x5ba36c[_0x4330('0x35')][_0x4330('0x39')]));_0x46cdd0[_0x4330('0x38')]=_0x46cdd0[_0x4330('0x38')][_0x4330('0x46')]?_0x46cdd0[_0x4330('0x38')]:_0xdd43da[_0x4330('0x33')];if(_0x5ba36c[_0x4330('0x35')][_0x4330('0x42')]){_0x46cdd0['include']=[{'all':!![]}];}_0x46cdd0=_[_0x4330('0x3f')]({},_0x46cdd0,_0x5ba36c[_0x4330('0x41')]);return db[_0x4330('0x2f')][_0x4330('0x47')](_0x46cdd0)[_0x4330('0x28')](handleEntityNotFound(_0x1e3ecf,null))[_0x4330('0x28')](respondWithResult(_0x1e3ecf,null))[_0x4330('0x48')](handleError(_0x1e3ecf,null));};exports[_0x4330('0x49')]=function(_0x4cd2d9,_0x31d21a){return db[_0x4330('0x2f')][_0x4330('0x49')](_0x4cd2d9[_0x4330('0x4a')],{})[_0x4330('0x28')](respondWithResult(_0x31d21a,0xc9))[_0x4330('0x48')](handleError(_0x31d21a,null));};exports[_0x4330('0x4b')]=function(_0x48c471,_0x482cec){if(_0x48c471[_0x4330('0x4a')]['id']){delete _0x48c471['body']['id'];}return db[_0x4330('0x2f')][_0x4330('0x47')]({'where':{'id':_0x48c471[_0x4330('0x4c')]['id']}})['then'](handleEntityNotFound(_0x482cec,null))['then'](saveUpdates(_0x48c471[_0x4330('0x4a')],null))['then'](respondWithResult(_0x482cec,null))[_0x4330('0x48')](handleError(_0x482cec,null));};exports[_0x4330('0x27')]=function(_0x16dfe2,_0x25bc0d){return db[_0x4330('0x2f')][_0x4330('0x47')]({'where':{'id':_0x16dfe2['params']['id']}})[_0x4330('0x28')](handleEntityNotFound(_0x25bc0d,null))[_0x4330('0x28')](removeEntity(_0x25bc0d,null))[_0x4330('0x48')](handleError(_0x25bc0d,null));};exports[_0x4330('0x4d')]=function(_0x266523,_0x21c7e5){return db[_0x4330('0x2f')][_0x4330('0x4d')]()[_0x4330('0x28')](respondWithResult(_0x21c7e5,null))['catch'](handleError(_0x21c7e5,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 6f32a92..25c61e6 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 _0x89e2=['request-promise','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','../../config/logger','api','moment','bluebird'];(function(_0x3b26f3,_0x5b69b3){var _0x2c69fd=function(_0x49df50){while(--_0x49df50){_0x3b26f3['push'](_0x3b26f3['shift']());}};_0x2c69fd(++_0x5b69b3);}(_0x89e2,0x1a9));var _0x289e=function(_0x286846,_0x5ac040){_0x286846=_0x286846-0x0;var _0x5c2bcd=_0x89e2[_0x286846];return _0x5c2bcd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x289e('0x0'))(_0x289e('0x1'));var moment=require(_0x289e('0x2'));var BPromise=require(_0x289e('0x3'));var rp=require(_0x289e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x289e('0x5'));var attributes=require(_0x289e('0x6'));module[_0x289e('0x7')]=function(_0x595829,_0x2f4da8){return _0x595829[_0x289e('0x8')](_0x289e('0x9'),attributes,{'tableName':_0x289e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f3=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','SquareDetailsReport','report_square_details'];(function(_0x3b4fb5,_0x4f93c0){var _0x5a2d06=function(_0x276f30){while(--_0x276f30){_0x3b4fb5['push'](_0x3b4fb5['shift']());}};_0x5a2d06(++_0x4f93c0);}(_0x37f3,0x16b));var _0x337f=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x37f3[_0x25cd2c];return _0x1e364c;};'use strict';var _=require('lodash');var util=require(_0x337f('0x0'));var logger=require(_0x337f('0x1'))(_0x337f('0x2'));var moment=require(_0x337f('0x3'));var BPromise=require('bluebird');var rp=require(_0x337f('0x4'));var fs=require('fs');var path=require(_0x337f('0x5'));var rimraf=require(_0x337f('0x6'));var config=require(_0x337f('0x7'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x3e7d34,_0x4e0519){return _0x3e7d34[_0x337f('0x8')](_0x337f('0x9'),attributes,{'tableName':_0x337f('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 6381efd..f629f3a 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 _0x6cb4=['raw','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','create','body','options'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x6cb4,0xff));var _0x46cb=function(_0x33bd6d,_0x354484){_0x33bd6d=_0x33bd6d-0x0;var _0x5cd2e4=_0x6cb4[_0x33bd6d];return _0x5cd2e4;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});}exports['CreateSquareDetailsReport']=function(_0x4e3454){var _0x1b6646=this;return new Promise(function(_0x1f2891,_0x4df1f0){return db[_0x46cb('0x15')][_0x46cb('0x16')](_0x4e3454[_0x46cb('0x17')],{'raw':_0x4e3454[_0x46cb('0x18')]?_0x4e3454[_0x46cb('0x18')][_0x46cb('0x19')]===undefined?!![]:![]:!![]})[_0x46cb('0x1a')](function(_0x149483){logger[_0x46cb('0xc')](_0x46cb('0x1b'),_0x4e3454);logger[_0x46cb('0xe')](_0x46cb('0x1b'),_0x4e3454,JSON[_0x46cb('0xf')](_0x149483));_0x1f2891(_0x149483);})[_0x46cb('0x14')](function(_0x1fb467){logger[_0x46cb('0x10')](_0x46cb('0x1b'),_0x1fb467[_0x46cb('0x12')],_0x4e3454);_0x4df1f0(_0x1b6646[_0x46cb('0x10')](0x1f4,_0x1fb467[_0x46cb('0x12')]));});});}; \ No newline at end of file +var _0xc901=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','catch','lodash','ioredis'];(function(_0x4de7c2,_0x22d819){var _0x51716d=function(_0xc3b196){while(--_0xc3b196){_0x4de7c2['push'](_0x4de7c2['shift']());}};_0x51716d(++_0x22d819);}(_0xc901,0x142));var _0x1c90=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc901[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}exports[_0x1c90('0x13')]=function(_0x4ec354){var _0x582246=this;return new Promise(function(_0x128bf0,_0x5dd488){return db[_0x1c90('0x14')][_0x1c90('0x15')](_0x4ec354[_0x1c90('0x16')],{'raw':_0x4ec354[_0x1c90('0x17')]?_0x4ec354['options'][_0x1c90('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x525997){logger[_0x1c90('0xb')](_0x1c90('0x13'),_0x4ec354);logger['debug'](_0x1c90('0x13'),_0x4ec354,JSON[_0x1c90('0x19')](_0x525997));_0x128bf0(_0x525997);})[_0x1c90('0x1a')](function(_0x4074fd){logger[_0x1c90('0x10')](_0x1c90('0x13'),_0x4074fd['message'],_0x4ec354);_0x5dd488(_0x582246[_0x1c90('0x10')](0x1f4,_0x4074fd[_0x1c90('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b68e931..46544e2 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 _0x3689=['get','/process/:pid/kill','killProcess','exports','Router','isAuthenticated','index'];(function(_0x39def7,_0x59ec48){var _0x34783a=function(_0xd4f6e4){while(--_0xd4f6e4){_0x39def7['push'](_0x39def7['shift']());}};_0x34783a(++_0x59ec48);}(_0x3689,0x154));var _0x9368=function(_0x22e6ee,_0x333da6){_0x22e6ee=_0x22e6ee-0x0;var _0x36baef=_0x3689[_0x22e6ee];return _0x36baef;};'use strict';var express=require('express');var router=express[_0x9368('0x0')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth[_0x9368('0x1')](),controller[_0x9368('0x2')]);router[_0x9368('0x3')](_0x9368('0x4'),auth['isAuthenticated'](),controller[_0x9368('0x5')]);module[_0x9368('0x6')]=router; \ No newline at end of file +var _0x7ae3=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ae3,0x1b1));var _0x37ae=function(_0xf8b46b,_0x5ce09d){_0xf8b46b=_0xf8b46b-0x0;var _0x520269=_0x7ae3[_0xf8b46b];return _0x520269;};'use strict';var express=require(_0x37ae('0x0'));var router=express[_0x37ae('0x1')]();var auth=require(_0x37ae('0x2'));var controller=require(_0x37ae('0x3'));router[_0x37ae('0x4')]('/',auth[_0x37ae('0x5')](),controller[_0x37ae('0x6')]);router[_0x37ae('0x4')](_0x37ae('0x7'),auth['isAuthenticated'](),controller[_0x37ae('0x8')]);module[_0x37ae('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 2067e75..387e88f 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 _0xad63=['exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process'];(function(_0x31e5e4,_0x128154){var _0x3ec603=function(_0x4f84fe){while(--_0x4f84fe){_0x31e5e4['push'](_0x31e5e4['shift']());}};_0x3ec603(++_0x128154);}(_0xad63,0xa1));var _0x3ad6=function(_0x156c90,_0x499e9e){_0x156c90=_0x156c90-0x0;var _0x4d3966=_0xad63[_0x156c90];return _0x4d3966;};'use strict';var info=require('systeminformation');var exec=require(_0x3ad6('0x0'))[_0x3ad6('0x1')];var logger=require(_0x3ad6('0x2'))(_0x3ad6('0x3'));var util=require(_0x3ad6('0x4'));var BPromise=require(_0x3ad6('0x5'));var _=require(_0x3ad6('0x6'));function handleError(_0x84100b,_0x43eb33,_0x15eb83){_0x43eb33=_0x43eb33||0x1f4;return function(_0x7bf177){logger['error'](_0x3ad6('0x7'),_0x15eb83,_0x43eb33,util[_0x3ad6('0x8')](_0x7bf177,{'showHidden':![],'depth':null}));delete _0x7bf177[_0x3ad6('0x9')];_0x84100b[_0x3ad6('0xa')](_0x43eb33)[_0x3ad6('0xb')](_0x7bf177);};}exports['index']=function(_0x4192f1,_0x5f3ca2){return info['getAllData']()[_0x3ad6('0xc')](function(_0x1f3264){return _0x5f3ca2['status'](0xc8)[_0x3ad6('0xd')](_0x1f3264);})[_0x3ad6('0xe')](function(_0x437762){return _0x5f3ca2[_0x3ad6('0xa')](0x1f4)[_0x3ad6('0xd')](_0x437762);});};exports[_0x3ad6('0xf')]=function(_0x2d8172,_0x5d0aa4){var _0x558f08=[_0x3ad6('0x10')];return new BPromise(function(_0x534292,_0x48d83f){return exec(util['format'](_0x3ad6('0x11'),_0x2d8172[_0x3ad6('0x12')][_0x3ad6('0x13')]),function(_0x13b091,_0x5196ac,_0x71431d){if(_0x13b091){return _0x48d83f(_0x13b091);}return _0x534292(_0x5196ac);});})[_0x3ad6('0xc')](function(_0x5ea482){var _0x294bce=![];var _0x2046b2=_0x5ea482[_0x3ad6('0x14')](/\n/);for(var _0x52a499=0x0,_0x48f70f=_0x558f08[_0x3ad6('0x15')];_0x52a499<_0x48f70f,_0x294bce===![];_0x52a499+=0x1){if(_0x5ea482['indexOf'](_0x558f08[_0x52a499])>=0x0){_0x294bce=!![];}}if(!_0x294bce){throw new Error(util['format'](_0x3ad6('0x16'),_0x2d8172[_0x3ad6('0x12')][_0x3ad6('0x13')]));}process[_0x3ad6('0x17')](_0x2d8172[_0x3ad6('0x12')][_0x3ad6('0x13')],_0x3ad6('0x18'));return _0x5d0aa4[_0x3ad6('0xa')](0xc8)['json']({'message':util[_0x3ad6('0x19')](_0x3ad6('0x1a'),_0x2d8172[_0x3ad6('0x12')][_0x3ad6('0x13')])});})['catch'](handleError(_0x5d0aa4,null,'killProcess'));}; \ No newline at end of file +var _0x1c1d=['status','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','api','util','bluebird','error','inspect','name','send','getAllData','then'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1c1d,0xd4));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var info=require(_0xd1c1('0x0'));var exec=require(_0xd1c1('0x1'))['exec'];var logger=require(_0xd1c1('0x2'))(_0xd1c1('0x3'));var util=require(_0xd1c1('0x4'));var BPromise=require(_0xd1c1('0x5'));var _=require('lodash');function handleError(_0x306229,_0x5aea99,_0x14013b){_0x5aea99=_0x5aea99||0x1f4;return function(_0x2b3eab){logger[_0xd1c1('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x14013b,_0x5aea99,util[_0xd1c1('0x7')](_0x2b3eab,{'showHidden':![],'depth':null}));delete _0x2b3eab[_0xd1c1('0x8')];_0x306229['status'](_0x5aea99)[_0xd1c1('0x9')](_0x2b3eab);};}exports['index']=function(_0x1c59c2,_0x495fe3){return info[_0xd1c1('0xa')]()[_0xd1c1('0xb')](function(_0x6d4090){return _0x495fe3[_0xd1c1('0xc')](0xc8)[_0xd1c1('0xd')](_0x6d4090);})[_0xd1c1('0xe')](function(_0x361135){return _0x495fe3[_0xd1c1('0xc')](0x1f4)[_0xd1c1('0xd')](_0x361135);});};exports['killProcess']=function(_0x11de1e,_0x25db01){var _0x2686b9=[_0xd1c1('0xf')];return new BPromise(function(_0x130ddc,_0x435246){return exec(util[_0xd1c1('0x10')](_0xd1c1('0x11'),_0x11de1e[_0xd1c1('0x12')]['pid']),function(_0x35a093,_0x1855b4,_0x3dddeb){if(_0x35a093){return _0x435246(_0x35a093);}return _0x130ddc(_0x1855b4);});})[_0xd1c1('0xb')](function(_0x3cd9db){var _0x5f0b0d=![];var _0x2b79f6=_0x3cd9db[_0xd1c1('0x13')](/\n/);for(var _0x47d9d7=0x0,_0x387d05=_0x2686b9[_0xd1c1('0x14')];_0x47d9d7<_0x387d05,_0x5f0b0d===![];_0x47d9d7+=0x1){if(_0x3cd9db[_0xd1c1('0x15')](_0x2686b9[_0x47d9d7])>=0x0){_0x5f0b0d=!![];}}if(!_0x5f0b0d){throw new Error(util[_0xd1c1('0x10')](_0xd1c1('0x16'),_0x11de1e[_0xd1c1('0x12')]['pid']));}process[_0xd1c1('0x17')](_0x11de1e['params'][_0xd1c1('0x18')],_0xd1c1('0x19'));return _0x25db01[_0xd1c1('0xc')](0xc8)[_0xd1c1('0xd')]({'message':util['format'](_0xd1c1('0x1a'),_0x11de1e[_0xd1c1('0x12')][_0xd1c1('0x18')])});})[_0xd1c1('0xe')](handleError(_0x25db01,null,_0xd1c1('0x1b')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6d7bd84..85041c2 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 _0x2fe5=['isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','index','/:id'];(function(_0x4afaf7,_0x16bfe2){var _0x5e4c06=function(_0x4411c2){while(--_0x4411c2){_0x4afaf7['push'](_0x4afaf7['shift']());}};_0x5e4c06(++_0x16bfe2);}(_0x2fe5,0x14b));var _0x52fe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2fe5[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x52fe('0x2'));var router=express[_0x52fe('0x3')]();var fs_extra=require(_0x52fe('0x4'));var auth=require(_0x52fe('0x5'));var interaction=require(_0x52fe('0x6'));var config=require('../../config/environment');var controller=require(_0x52fe('0x7'));router[_0x52fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x52fe('0x9')]);router[_0x52fe('0x8')](_0x52fe('0xa'),auth[_0x52fe('0xb')](),controller[_0x52fe('0xc')]);router['post']('/',auth[_0x52fe('0xb')](),controller[_0x52fe('0xd')]);router[_0x52fe('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x52fe('0xf')]);router[_0x52fe('0x10')]('/:id',auth[_0x52fe('0xb')](),controller[_0x52fe('0x11')]);module[_0x52fe('0x12')]=router; \ No newline at end of file +var _0x805a=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get'];(function(_0x542ce3,_0x4e833a){var _0x29b3f7=function(_0x245e33){while(--_0x245e33){_0x542ce3['push'](_0x542ce3['shift']());}};_0x29b3f7(++_0x4e833a);}(_0x805a,0xad));var _0xa805=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0x805a[_0x2b8722];return _0x20c180;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa805('0x0'));var timeout=require('connect-timeout');var express=require(_0xa805('0x1'));var router=express['Router']();var fs_extra=require(_0xa805('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa805('0x3'));var config=require(_0xa805('0x4'));var controller=require(_0xa805('0x5'));router[_0xa805('0x6')]('/',auth[_0xa805('0x7')](),controller[_0xa805('0x8')]);router['get'](_0xa805('0x9'),auth[_0xa805('0x7')](),controller[_0xa805('0xa')]);router[_0xa805('0xb')]('/',auth[_0xa805('0x7')](),controller[_0xa805('0xc')]);router[_0xa805('0xd')](_0xa805('0x9'),auth[_0xa805('0x7')](),controller[_0xa805('0xe')]);router[_0xa805('0xf')](_0xa805('0x9'),auth[_0xa805('0x7')](),controller[_0xa805('0x10')]);module[_0xa805('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 356043e..f0e9ba9 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 _0x6b20=['exports','name','#0091EA','STRING','sequelize'];(function(_0x573e18,_0x21bfee){var _0x58a314=function(_0x181d14){while(--_0x181d14){_0x573e18['push'](_0x573e18['shift']());}};_0x58a314(++_0x21bfee);}(_0x6b20,0xd1));var _0x06b2=function(_0x4e6f63,_0x218f82){_0x4e6f63=_0x4e6f63-0x0;var _0x65269c=_0x6b20[_0x4e6f63];return _0x65269c;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x06b2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x06b2('0x3')},'description':{'type':Sequelize[_0x06b2('0x4')]}}; \ No newline at end of file +var _0xfd6f=['name','sequelize','exports','STRING'];(function(_0x176807,_0x137e37){var _0x26cd57=function(_0x4d3f71){while(--_0x4d3f71){_0x176807['push'](_0x176807['shift']());}};_0x26cd57(++_0x137e37);}(_0xfd6f,0x19d));var _0xffd6=function(_0xbf673,_0x37e605){_0xbf673=_0xbf673-0x0;var _0x12a2df=_0xfd6f[_0xbf673];return _0x12a2df;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'name':{'type':Sequelize[_0xffd6('0x2')],'unique':_0xffd6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xffd6('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xffd6('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index e278eff..aab07b1 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 _0x4bc3=['end','offset','undefined','count','limit','set','json','apply','reject','destroy','then','get','Tags','UserProfileResource','sendStatus','error','stack','name','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','Tag','findAll','rows','catch','show','params','length','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x4bc3,0x16e));var _0x34bc=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x4bc3[_0x31ced5];return _0x10d9e5;};'use strict';var emlformat=require(_0x34bc('0x0'));var rimraf=require(_0x34bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34bc('0x2'));var rp=require(_0x34bc('0x3'));var moment=require('moment');var BPromise=require(_0x34bc('0x4'));var Mustache=require(_0x34bc('0x5'));var util=require(_0x34bc('0x6'));var path=require(_0x34bc('0x7'));var sox=require(_0x34bc('0x8'));var csv=require(_0x34bc('0x9'));var ejs=require(_0x34bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34bc('0xc'));var deskjs=require(_0x34bc('0xd'));var toCsv=require(_0x34bc('0x9'));var querystring=require(_0x34bc('0xe'));var Papa=require(_0x34bc('0xf'));var Redis=require(_0x34bc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x34bc('0x11'));var hardwareService=require(_0x34bc('0x12'));var logger=require(_0x34bc('0x13'))('api');var utils=require(_0x34bc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x34bc('0x15'));var db=require(_0x34bc('0x16'))['db'];function respondWithStatusCode(_0x164fb2,_0x536ebd){_0x536ebd=_0x536ebd||0xcc;return function(_0x3f8852){if(_0x3f8852){return _0x164fb2['sendStatus'](_0x536ebd);}return _0x164fb2[_0x34bc('0x17')](_0x536ebd)[_0x34bc('0x18')]();};}function respondWithResult(_0xc77013,_0x5a22a3){_0x5a22a3=_0x5a22a3||0xc8;return function(_0x4c365a){if(_0x4c365a){return _0xc77013[_0x34bc('0x17')](_0x5a22a3)['json'](_0x4c365a);}};}function respondWithFilteredResult(_0x3e93bf,_0x217605){return function(_0x1da8eb){if(_0x1da8eb){var _0x25da29=typeof _0x217605[_0x34bc('0x19')]===_0x34bc('0x1a')&&typeof _0x217605['limit']==='undefined';var _0x5a5895=_0x1da8eb[_0x34bc('0x1b')];var _0x3eaedf=_0x25da29?0x0:_0x217605[_0x34bc('0x19')];var _0x239e6c=_0x25da29?_0x1da8eb['count']:_0x217605[_0x34bc('0x19')]+_0x217605[_0x34bc('0x1c')];var _0x50106a;if(_0x239e6c>=_0x5a5895){_0x239e6c=_0x5a5895;_0x50106a=0xc8;}else{_0x50106a=0xce;}_0x3e93bf[_0x34bc('0x17')](_0x50106a);return _0x3e93bf[_0x34bc('0x1d')]('Content-Range',_0x3eaedf+'-'+_0x239e6c+'/'+_0x5a5895)[_0x34bc('0x1e')](_0x1da8eb);}return null;};}function patchUpdates(_0x26cdec){return function(_0x2d18ea){try{jsonpatch[_0x34bc('0x1f')](_0x2d18ea,_0x26cdec,!![]);}catch(_0x1f993b){return BPromise[_0x34bc('0x20')](_0x1f993b);}return _0x2d18ea['save']();};}function saveUpdates(_0x40e128,_0x3c9939){return function(_0x38882c){if(_0x38882c){return _0x38882c['update'](_0x40e128)['then'](function(_0x358d51){return _0x358d51;});}return null;};}function removeEntity(_0x1b820a,_0x4263de){return function(_0x410800){if(_0x410800){return _0x410800[_0x34bc('0x21')]()[_0x34bc('0x22')](function(){var _0x3f3653=_0x410800[_0x34bc('0x23')]({'plain':!![]});var _0x19472e=_0x34bc('0x24');return db[_0x34bc('0x25')][_0x34bc('0x21')]({'where':{'type':_0x19472e,'resourceId':_0x3f3653['id']}})['then'](function(){return _0x410800;});})[_0x34bc('0x22')](function(){_0x1b820a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da96b,_0x5332c8){return function(_0x4082c3){if(!_0x4082c3){_0x3da96b[_0x34bc('0x26')](0x194);}return _0x4082c3;};}function handleError(_0x46fd76,_0x47c878){_0x47c878=_0x47c878||0x1f4;return function(_0x2e6d96){logger[_0x34bc('0x27')](_0x2e6d96[_0x34bc('0x28')]);if(_0x2e6d96[_0x34bc('0x29')]){delete _0x2e6d96[_0x34bc('0x29')];}_0x46fd76[_0x34bc('0x17')](_0x47c878)['send'](_0x2e6d96);};}exports[_0x34bc('0x2a')]=function(_0x1fb7c5,_0x22aacc){var _0x407831={},_0x2241b4={},_0xd92957={'count':0x0,'rows':[]};var _0x5b37de=_[_0x34bc('0x2b')](db['Tag']['rawAttributes'],function(_0x42fd40){return{'name':_0x42fd40['fieldName'],'type':_0x42fd40[_0x34bc('0x2c')][_0x34bc('0x2d')]};});_0x2241b4[_0x34bc('0x2e')]=_[_0x34bc('0x2b')](_0x5b37de,_0x34bc('0x29'));_0x2241b4[_0x34bc('0x2f')]=_[_0x34bc('0x30')](_0x1fb7c5['query']);_0x2241b4[_0x34bc('0x31')]=_[_0x34bc('0x32')](_0x2241b4[_0x34bc('0x2e')],_0x2241b4[_0x34bc('0x2f')]);_0x407831[_0x34bc('0x33')]=_['intersection'](_0x2241b4[_0x34bc('0x2e')],qs[_0x34bc('0x34')](_0x1fb7c5[_0x34bc('0x2f')][_0x34bc('0x34')]));_0x407831[_0x34bc('0x33')]=_0x407831['attributes']['length']?_0x407831[_0x34bc('0x33')]:_0x2241b4[_0x34bc('0x2e')];if(!_0x1fb7c5[_0x34bc('0x2f')][_0x34bc('0x35')]('nolimit')){_0x407831[_0x34bc('0x1c')]=qs[_0x34bc('0x1c')](_0x1fb7c5[_0x34bc('0x2f')]['limit']);_0x407831[_0x34bc('0x19')]=qs[_0x34bc('0x19')](_0x1fb7c5[_0x34bc('0x2f')][_0x34bc('0x19')]);}_0x407831['order']=qs[_0x34bc('0x36')](_0x1fb7c5[_0x34bc('0x2f')][_0x34bc('0x36')]);_0x407831['where']=qs[_0x34bc('0x31')](_[_0x34bc('0x37')](_0x1fb7c5[_0x34bc('0x2f')],_0x2241b4[_0x34bc('0x31')]),_0x5b37de);if(_0x1fb7c5[_0x34bc('0x2f')]['filter']){_0x407831[_0x34bc('0x38')]=_[_0x34bc('0x39')](_0x407831[_0x34bc('0x38')],{'$or':_[_0x34bc('0x2b')](_0x5b37de,function(_0xbaf32){if(_0xbaf32['type']!==_0x34bc('0x3a')){var _0x50f1ee={};_0x50f1ee[_0xbaf32[_0x34bc('0x29')]]={'$like':'%'+_0x1fb7c5[_0x34bc('0x2f')][_0x34bc('0x3b')]+'%'};return _0x50f1ee;}})});}_0x407831=_[_0x34bc('0x39')]({},_0x407831,_0x1fb7c5['options']);var _0x11ab9c={'where':_0x407831[_0x34bc('0x38')]};return db['Tag'][_0x34bc('0x1b')](_0x11ab9c)[_0x34bc('0x22')](function(_0xa2cbd0){_0xd92957['count']=_0xa2cbd0;if(_0x1fb7c5[_0x34bc('0x2f')][_0x34bc('0x3c')]){_0x407831[_0x34bc('0x3d')]=[{'all':!![]}];}return db[_0x34bc('0x3e')][_0x34bc('0x3f')](_0x407831);})[_0x34bc('0x22')](function(_0x428326){_0xd92957[_0x34bc('0x40')]=_0x428326;return _0xd92957;})[_0x34bc('0x22')](respondWithFilteredResult(_0x22aacc,_0x407831))[_0x34bc('0x41')](handleError(_0x22aacc,null));};exports[_0x34bc('0x42')]=function(_0x570824,_0x4da4ec){var _0x1d7395={'raw':!![],'where':{'id':_0x570824[_0x34bc('0x43')]['id']}},_0x1e1bf3={};_0x1e1bf3[_0x34bc('0x2e')]=_[_0x34bc('0x30')](db[_0x34bc('0x3e')]['rawAttributes']);_0x1e1bf3[_0x34bc('0x2f')]=_['keys'](_0x570824[_0x34bc('0x2f')]);_0x1e1bf3[_0x34bc('0x31')]=_[_0x34bc('0x32')](_0x1e1bf3['model'],_0x1e1bf3[_0x34bc('0x2f')]);_0x1d7395[_0x34bc('0x33')]=_[_0x34bc('0x32')](_0x1e1bf3[_0x34bc('0x2e')],qs[_0x34bc('0x34')](_0x570824[_0x34bc('0x2f')][_0x34bc('0x34')]));_0x1d7395[_0x34bc('0x33')]=_0x1d7395[_0x34bc('0x33')][_0x34bc('0x44')]?_0x1d7395[_0x34bc('0x33')]:_0x1e1bf3[_0x34bc('0x2e')];if(_0x570824['query']['includeAll']){_0x1d7395[_0x34bc('0x3d')]=[{'all':!![]}];}_0x1d7395=_[_0x34bc('0x39')]({},_0x1d7395,_0x570824[_0x34bc('0x45')]);return db['Tag']['find'](_0x1d7395)[_0x34bc('0x22')](handleEntityNotFound(_0x4da4ec,null))[_0x34bc('0x22')](respondWithResult(_0x4da4ec,null))[_0x34bc('0x41')](handleError(_0x4da4ec,null));};exports['create']=function(_0x43bfb7,_0x25b02e){return db['Tag'][_0x34bc('0x46')](_0x43bfb7['body'],{})[_0x34bc('0x22')](function(_0x487678){var _0x281d6f=_0x43bfb7[_0x34bc('0x47')][_0x34bc('0x23')]({'plain':!![]});if(!_0x281d6f)throw new Error(_0x34bc('0x48'));if(_0x281d6f['role']===_0x34bc('0x47')){var _0x2bbd0b=_0x487678[_0x34bc('0x23')]({'plain':!![]});var _0x42a96b=_0x34bc('0x24');return db[_0x34bc('0x49')][_0x34bc('0x4a')]({'where':{'name':_0x42a96b,'userProfileId':_0x281d6f[_0x34bc('0x4b')]},'raw':!![]})['then'](function(_0x592557){if(_0x592557&&_0x592557['autoAssociation']===0x0){return db[_0x34bc('0x25')][_0x34bc('0x46')]({'name':_0x2bbd0b['name'],'resourceId':_0x2bbd0b['id'],'type':_0x592557[_0x34bc('0x29')],'sectionId':_0x592557['id']},{})[_0x34bc('0x22')](function(){return _0x487678;});}else{return _0x487678;}})[_0x34bc('0x41')](function(_0x37b467){logger[_0x34bc('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37b467);throw _0x37b467;});}return _0x487678;})['then'](respondWithResult(_0x25b02e,0xc9))['catch'](handleError(_0x25b02e,null));};exports[_0x34bc('0x4c')]=function(_0x17ce18,_0x151a45){if(_0x17ce18[_0x34bc('0x4d')]['id']){delete _0x17ce18[_0x34bc('0x4d')]['id'];}return db['Tag'][_0x34bc('0x4a')]({'where':{'id':_0x17ce18[_0x34bc('0x43')]['id']}})[_0x34bc('0x22')](handleEntityNotFound(_0x151a45,null))[_0x34bc('0x22')](saveUpdates(_0x17ce18['body'],null))[_0x34bc('0x22')](respondWithResult(_0x151a45,null))[_0x34bc('0x41')](handleError(_0x151a45,null));};exports[_0x34bc('0x21')]=function(_0x91e6c5,_0x279a83){return db[_0x34bc('0x3e')][_0x34bc('0x4a')]({'where':{'id':_0x91e6c5[_0x34bc('0x43')]['id']}})[_0x34bc('0x22')](handleEntityNotFound(_0x279a83,null))[_0x34bc('0x22')](removeEntity(_0x279a83,null))[_0x34bc('0x41')](handleError(_0x279a83,null));}; \ No newline at end of file +var _0xad95=['Tag','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','includeAll','include','show','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','Tags','UserProfileResource','end','stack','name','send','index'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0xad95,0x70));var _0x5ad9=function(_0x5960ab,_0x1388bd){_0x5960ab=_0x5960ab-0x0;var _0x4a3c7b=_0xad95[_0x5960ab];return _0x4a3c7b;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));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(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){var _0x39a124=_0x524249[_0x5ad9('0x20')]({'plain':!![]});var _0x1252e6=_0x5ad9('0x21');return db[_0x5ad9('0x22')]['destroy']({'where':{'type':_0x1252e6,'resourceId':_0x39a124['id']}})['then'](function(){return _0x524249;});})[_0x5ad9('0x1f')](function(){_0x5b816d['status'](0xcc)[_0x5ad9('0x23')]();});}};}function handleEntityNotFound(_0x584de3,_0x346f35){return function(_0x55a0e4){if(!_0x55a0e4){_0x584de3['sendStatus'](0x194);}return _0x55a0e4;};}function handleError(_0x243f82,_0x46d565){_0x46d565=_0x46d565||0x1f4;return function(_0x49b3df){logger['error'](_0x49b3df[_0x5ad9('0x24')]);if(_0x49b3df[_0x5ad9('0x25')]){delete _0x49b3df[_0x5ad9('0x25')];}_0x243f82[_0x5ad9('0x14')](_0x46d565)[_0x5ad9('0x26')](_0x49b3df);};}exports[_0x5ad9('0x27')]=function(_0x5e5656,_0x132ec6){var _0x12867b={},_0x2d4f72={},_0x4118a7={'count':0x0,'rows':[]};var _0x5517c8=_['map'](db[_0x5ad9('0x28')][_0x5ad9('0x29')],function(_0x4afceb){return{'name':_0x4afceb['fieldName'],'type':_0x4afceb['type'][_0x5ad9('0x2a')]};});_0x2d4f72[_0x5ad9('0x2b')]=_['map'](_0x5517c8,_0x5ad9('0x25'));_0x2d4f72[_0x5ad9('0x2c')]=_[_0x5ad9('0x2d')](_0x5e5656[_0x5ad9('0x2c')]);_0x2d4f72['filters']=_['intersection'](_0x2d4f72[_0x5ad9('0x2b')],_0x2d4f72[_0x5ad9('0x2c')]);_0x12867b[_0x5ad9('0x2e')]=_[_0x5ad9('0x2f')](_0x2d4f72[_0x5ad9('0x2b')],qs['fields'](_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x30')]));_0x12867b[_0x5ad9('0x2e')]=_0x12867b[_0x5ad9('0x2e')][_0x5ad9('0x31')]?_0x12867b[_0x5ad9('0x2e')]:_0x2d4f72['model'];if(!_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x32')]('nolimit')){_0x12867b[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x5e5656['query'][_0x5ad9('0x18')]);_0x12867b[_0x5ad9('0x16')]=qs[_0x5ad9('0x16')](_0x5e5656['query'][_0x5ad9('0x16')]);}_0x12867b[_0x5ad9('0x33')]=qs[_0x5ad9('0x34')](_0x5e5656[_0x5ad9('0x2c')]['sort']);_0x12867b[_0x5ad9('0x35')]=qs[_0x5ad9('0x36')](_[_0x5ad9('0x37')](_0x5e5656[_0x5ad9('0x2c')],_0x2d4f72[_0x5ad9('0x36')]),_0x5517c8);if(_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x38')]){_0x12867b[_0x5ad9('0x35')]=_[_0x5ad9('0x39')](_0x12867b['where'],{'$or':_[_0x5ad9('0x3a')](_0x5517c8,function(_0x39563f){if(_0x39563f[_0x5ad9('0x3b')]!==_0x5ad9('0x3c')){var _0x2a9e3b={};_0x2a9e3b[_0x39563f['name']]={'$like':'%'+_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x38')]+'%'};return _0x2a9e3b;}})});}_0x12867b=_[_0x5ad9('0x39')]({},_0x12867b,_0x5e5656['options']);var _0x3d027a={'where':_0x12867b[_0x5ad9('0x35')]};return db[_0x5ad9('0x28')]['count'](_0x3d027a)[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x4118a7['count']=_0x5cfe5b;if(_0x5e5656[_0x5ad9('0x2c')][_0x5ad9('0x3d')]){_0x12867b[_0x5ad9('0x3e')]=[{'all':!![]}];}return db[_0x5ad9('0x28')]['findAll'](_0x12867b);})['then'](function(_0x552c39){_0x4118a7['rows']=_0x552c39;return _0x4118a7;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x132ec6,_0x12867b))['catch'](handleError(_0x132ec6,null));};exports[_0x5ad9('0x3f')]=function(_0x5c5a7a,_0x21dfd1){var _0x1c04c3={'raw':!![],'where':{'id':_0x5c5a7a[_0x5ad9('0x40')]['id']}},_0x6b2fa7={};_0x6b2fa7[_0x5ad9('0x2b')]=_[_0x5ad9('0x2d')](db[_0x5ad9('0x28')][_0x5ad9('0x29')]);_0x6b2fa7[_0x5ad9('0x2c')]=_['keys'](_0x5c5a7a[_0x5ad9('0x2c')]);_0x6b2fa7[_0x5ad9('0x36')]=_[_0x5ad9('0x2f')](_0x6b2fa7[_0x5ad9('0x2b')],_0x6b2fa7[_0x5ad9('0x2c')]);_0x1c04c3['attributes']=_[_0x5ad9('0x2f')](_0x6b2fa7['model'],qs['fields'](_0x5c5a7a['query'][_0x5ad9('0x30')]));_0x1c04c3[_0x5ad9('0x2e')]=_0x1c04c3[_0x5ad9('0x2e')]['length']?_0x1c04c3[_0x5ad9('0x2e')]:_0x6b2fa7[_0x5ad9('0x2b')];if(_0x5c5a7a[_0x5ad9('0x2c')][_0x5ad9('0x3d')]){_0x1c04c3['include']=[{'all':!![]}];}_0x1c04c3=_[_0x5ad9('0x39')]({},_0x1c04c3,_0x5c5a7a[_0x5ad9('0x41')]);return db[_0x5ad9('0x28')][_0x5ad9('0x42')](_0x1c04c3)['then'](handleEntityNotFound(_0x21dfd1,null))[_0x5ad9('0x1f')](respondWithResult(_0x21dfd1,null))[_0x5ad9('0x43')](handleError(_0x21dfd1,null));};exports[_0x5ad9('0x44')]=function(_0x1e03f,_0x479bbc){return db[_0x5ad9('0x28')][_0x5ad9('0x44')](_0x1e03f['body'],{})[_0x5ad9('0x1f')](function(_0x5d8a5f){var _0x42a662=_0x1e03f[_0x5ad9('0x45')][_0x5ad9('0x20')]({'plain':!![]});if(!_0x42a662)throw new Error(_0x5ad9('0x46'));if(_0x42a662[_0x5ad9('0x47')]===_0x5ad9('0x45')){var _0xa0f426=_0x5d8a5f[_0x5ad9('0x20')]({'plain':!![]});var _0x307dd9=_0x5ad9('0x21');return db[_0x5ad9('0x48')][_0x5ad9('0x42')]({'where':{'name':_0x307dd9,'userProfileId':_0x42a662[_0x5ad9('0x49')]},'raw':!![]})[_0x5ad9('0x1f')](function(_0x251b65){if(_0x251b65&&_0x251b65['autoAssociation']===0x0){return db[_0x5ad9('0x22')][_0x5ad9('0x44')]({'name':_0xa0f426[_0x5ad9('0x25')],'resourceId':_0xa0f426['id'],'type':_0x251b65[_0x5ad9('0x25')],'sectionId':_0x251b65['id']},{})[_0x5ad9('0x1f')](function(){return _0x5d8a5f;});}else{return _0x5d8a5f;}})[_0x5ad9('0x43')](function(_0xb5222e){logger[_0x5ad9('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb5222e);throw _0xb5222e;});}return _0x5d8a5f;})[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,0xc9))['catch'](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1d')]=function(_0x3445b6,_0x469b19){if(_0x3445b6['body']['id']){delete _0x3445b6[_0x5ad9('0x4b')]['id'];}return db[_0x5ad9('0x28')][_0x5ad9('0x42')]({'where':{'id':_0x3445b6['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x469b19,null))['then'](saveUpdates(_0x3445b6['body'],null))[_0x5ad9('0x1f')](respondWithResult(_0x469b19,null))[_0x5ad9('0x43')](handleError(_0x469b19,null));};exports['destroy']=function(_0x5c6627,_0xbda89a){return db[_0x5ad9('0x28')][_0x5ad9('0x42')]({'where':{'id':_0x5c6627[_0x5ad9('0x40')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0xbda89a,null))[_0x5ad9('0x1f')](removeEntity(_0xbda89a,null))[_0x5ad9('0x43')](handleError(_0xbda89a,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index b8d1d02..85bbc8b 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 _0x46b6=['define','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./tag.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46b6,0x1eb));var _0x646b=function(_0x1e9c09,_0x184114){_0x1e9c09=_0x1e9c09-0x0;var _0x6150b9=_0x46b6[_0x1e9c09];return _0x6150b9;};'use strict';var _=require(_0x646b('0x0'));var util=require('util');var logger=require(_0x646b('0x1'))(_0x646b('0x2'));var moment=require(_0x646b('0x3'));var BPromise=require(_0x646b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x646b('0x5'));var rimraf=require('rimraf');var config=require(_0x646b('0x6'));var attributes=require(_0x646b('0x7'));module[_0x646b('0x8')]=function(_0x2c9d52,_0x57c8e6){return _0x2c9d52[_0x646b('0x9')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a85=['tools_tags','lodash','api','moment','bluebird','request-promise','../../config/environment','exports','define','Tag'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x0a85,0x8d));var _0x50a8=function(_0x91c841,_0x3541b6){_0x91c841=_0x91c841-0x0;var _0x1c3b48=_0x0a85[_0x91c841];return _0x1c3b48;};'use strict';var _=require(_0x50a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x50a8('0x1'));var moment=require(_0x50a8('0x2'));var BPromise=require(_0x50a8('0x3'));var rp=require(_0x50a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x50a8('0x5'));var attributes=require('./tag.attributes');module[_0x50a8('0x6')]=function(_0x2511fb,_0x8c1834){return _0x2511fb[_0x50a8('0x7')](_0x50a8('0x8'),attributes,{'tableName':_0x50a8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 20da457..547da4e 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 _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x184504,_0x583020){var _0xbf9a15=function(_0x36e9ec){while(--_0x36e9ec){_0x184504['push'](_0x184504['shift']());}};_0xbf9a15(++_0x583020);}(_0x68fc,0xa5));var _0xc68f=function(_0xf71f48,_0x4e577e){_0xf71f48=_0xf71f48-0x0;var _0x3ac4ad=_0x68fc[_0xf71f48];return _0x3ac4ad;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file +var _0x4ab0=['jayson/promise','client','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x56456b,_0x5babd7){var _0x37da11=function(_0x45698e){while(--_0x45698e){_0x56456b['push'](_0x56456b['shift']());}};_0x37da11(++_0x5babd7);}(_0x4ab0,0xd5));var _0x04ab=function(_0x129f5f,_0x2c275b){_0x129f5f=_0x129f5f-0x0;var _0x518628=_0x4ab0[_0x129f5f];return _0x518628;};'use strict';var _=require('lodash');var util=require(_0x04ab('0x0'));var moment=require(_0x04ab('0x1'));var BPromise=require(_0x04ab('0x2'));var rs=require(_0x04ab('0x3'));var fs=require('fs');var Redis=require(_0x04ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x04ab('0x5'))(_0x04ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ab('0x7'));var client=jayson[_0x04ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f5901,_0x293f1d,_0x1ff7f6){return new BPromise(function(_0x4bc05e,_0x101d6b){return client[_0x04ab('0x9')](_0x3f5901,_0x1ff7f6)[_0x04ab('0xa')](function(_0x41ce1e){logger['info'](_0x04ab('0xb'),_0x293f1d,_0x04ab('0xc'));logger[_0x04ab('0xd')](_0x04ab('0xe'),_0x293f1d,'request\x20sent',JSON[_0x04ab('0xf')](_0x41ce1e));if(_0x41ce1e[_0x04ab('0x10')]){if(_0x41ce1e[_0x04ab('0x10')][_0x04ab('0x11')]===0x1f4){logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x41ce1e['error'][_0x04ab('0x12')]);return _0x101d6b(_0x41ce1e['error'][_0x04ab('0x12')]);}logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x41ce1e[_0x04ab('0x10')]['message']);return _0x4bc05e(_0x41ce1e['error']['message']);}else{logger[_0x04ab('0x13')](_0x04ab('0xb'),_0x293f1d,_0x04ab('0xc'));_0x4bc05e(_0x41ce1e[_0x04ab('0x14')][_0x04ab('0x12')]);}})[_0x04ab('0x15')](function(_0x42c937){logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x42c937);_0x101d6b(_0x42c937);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 5876d8a..7028eef 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 3b9df4a..c3d2244 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x3a98e5,_0x17da2b){var _0x7fbba=function(_0x2b2db0){while(--_0x2b2db0){_0x3a98e5['push'](_0x3a98e5['shift']());}};_0x7fbba(++_0x17da2b);}(_0x2032,0xd9));var _0x2203=function(_0x14890b,_0xf1b5f1){_0x14890b=_0x14890b-0x0;var _0x38c4cb=_0x2032[_0x14890b];return _0x38c4cb;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x2fd028,_0x1daa19){var _0x351007=function(_0xad6ed0){while(--_0xad6ed0){_0x2fd028['push'](_0x2fd028['shift']());}};_0x351007(++_0x1daa19);}(_0x757a,0xde));var _0xa757=function(_0x31a025,_0x398597){_0x31a025=_0x31a025-0x0;var _0x1a8a57=_0x757a[_0x31a025];return _0x1a8a57;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 0a8b0d9..a2948fc 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 _0xc02d=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','UserProfileResource','send','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','pick','capitalize','addQueues','findOne','Queues','remove','ids','Sms','Fax','Openchannel','through','penalty','Voice','TeamVoiceQueue','User','Queue','emit','Queue:save','QueueId','online','voicePause','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','all','addAgents','spread','removeAgents','Chat','Whatsapp','transaction','Queue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','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','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','map','Team','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x43ad18,_0x21f334){var _0x3bdc6a=function(_0x16fbd5){while(--_0x16fbd5){_0x43ad18['push'](_0x43ad18['shift']());}};_0x3bdc6a(++_0x21f334);}(_0xc02d,0xe8));var _0xdc02=function(_0x5ea4b9,_0x1a62b6){_0x5ea4b9=_0x5ea4b9-0x0;var _0x3d375f=_0xc02d[_0x5ea4b9];return _0x3d375f;};'use strict';var emlformat=require(_0xdc02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc02('0x1'));var jsonpatch=require(_0xdc02('0x2'));var rp=require(_0xdc02('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdc02('0x4'));var util=require(_0xdc02('0x5'));var path=require('path');var sox=require(_0xdc02('0x6'));var csv=require(_0xdc02('0x7'));var ejs=require(_0xdc02('0x8'));var fs=require('fs');var fs_extra=require(_0xdc02('0x9'));var _=require('lodash');var squel=require(_0xdc02('0xa'));var crypto=require(_0xdc02('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdc02('0xc'));var toCsv=require(_0xdc02('0x7'));var querystring=require(_0xdc02('0xd'));var Papa=require(_0xdc02('0xe'));var Redis=require('ioredis');var authService=require(_0xdc02('0xf'));var qs=require(_0xdc02('0x10'));var as=require(_0xdc02('0x11'));var hardwareService=require(_0xdc02('0x12'));var logger=require(_0xdc02('0x13'))('api');var utils=require(_0xdc02('0x14'));var config=require(_0xdc02('0x15'));var licenseUtil=require(_0xdc02('0x16'));var db=require(_0xdc02('0x17'))['db'];config[_0xdc02('0x18')]=_[_0xdc02('0x19')](config['redis'],{'host':_0xdc02('0x1a'),'port':0x18eb});var socket=require(_0xdc02('0x1b'))(new Redis(config[_0xdc02('0x18')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0xbf9506,_0x5f1710){_0x5f1710=_0x5f1710||0xcc;return function(_0x26a417){if(_0x26a417){return _0xbf9506['sendStatus'](_0x5f1710);}return _0xbf9506[_0xdc02('0x1c')](_0x5f1710)[_0xdc02('0x1d')]();};}function respondWithResult(_0x4d3ec5,_0x29aa35){_0x29aa35=_0x29aa35||0xc8;return function(_0xe2e444){if(_0xe2e444){return _0x4d3ec5['status'](_0x29aa35)[_0xdc02('0x1e')](_0xe2e444);}};}function respondWithFilteredResult(_0xe2ee67,_0x13c5b7){return function(_0x952fb2){if(_0x952fb2){var _0x43243e=typeof _0x13c5b7[_0xdc02('0x1f')]===_0xdc02('0x20')&&typeof _0x13c5b7['limit']==='undefined';var _0x9b7c87=_0x952fb2['count'];var _0x5e8bea=_0x43243e?0x0:_0x13c5b7[_0xdc02('0x1f')];var _0x3b1dcc=_0x43243e?_0x952fb2[_0xdc02('0x21')]:_0x13c5b7['offset']+_0x13c5b7['limit'];var _0x584e6c;if(_0x3b1dcc>=_0x9b7c87){_0x3b1dcc=_0x9b7c87;_0x584e6c=0xc8;}else{_0x584e6c=0xce;}_0xe2ee67['status'](_0x584e6c);return _0xe2ee67[_0xdc02('0x22')](_0xdc02('0x23'),_0x5e8bea+'-'+_0x3b1dcc+'/'+_0x9b7c87)[_0xdc02('0x1e')](_0x952fb2);}return null;};}function patchUpdates(_0x37876c){return function(_0xbe4e31){try{jsonpatch[_0xdc02('0x24')](_0xbe4e31,_0x37876c,!![]);}catch(_0x21dd11){return BPromise[_0xdc02('0x25')](_0x21dd11);}return _0xbe4e31[_0xdc02('0x26')]();};}function saveUpdates(_0x2b9987,_0x19c636){return function(_0x26b865){if(_0x26b865){return _0x26b865[_0xdc02('0x27')](_0x2b9987)[_0xdc02('0x28')](function(_0x31db75){return _0x31db75;});}return null;};}function handleEntityNotFound(_0x45ddaf,_0x4d690d){return function(_0x2ebc59){if(!_0x2ebc59){_0x45ddaf[_0xdc02('0x29')](0x194);}return _0x2ebc59;};}function handleError(_0xada19a,_0x412d58){_0x412d58=_0x412d58||0x1f4;return function(_0x2955b2){logger[_0xdc02('0x2a')](_0x2955b2[_0xdc02('0x2b')]);if(_0x2955b2[_0xdc02('0x2c')]){delete _0x2955b2[_0xdc02('0x2c')];}_0xada19a[_0xdc02('0x1c')](_0x412d58)['send'](_0x2955b2);};}exports['index']=function(_0x62c6a7,_0x243c1e){var _0x56520a={},_0x55a2d0={},_0x3b146a={'count':0x0,'rows':[]};var _0x163698=_[_0xdc02('0x2d')](db[_0xdc02('0x2e')][_0xdc02('0x2f')],function(_0x28c5a8){return{'name':_0x28c5a8[_0xdc02('0x30')],'type':_0x28c5a8['type']['key']};});_0x55a2d0[_0xdc02('0x31')]=_[_0xdc02('0x2d')](_0x163698,'name');_0x55a2d0[_0xdc02('0x32')]=_[_0xdc02('0x33')](_0x62c6a7[_0xdc02('0x32')]);_0x55a2d0[_0xdc02('0x34')]=_[_0xdc02('0x35')](_0x55a2d0[_0xdc02('0x31')],_0x55a2d0[_0xdc02('0x32')]);_0x56520a[_0xdc02('0x36')]=_[_0xdc02('0x35')](_0x55a2d0[_0xdc02('0x31')],qs['fields'](_0x62c6a7[_0xdc02('0x32')][_0xdc02('0x37')]));_0x56520a[_0xdc02('0x36')]=_0x56520a[_0xdc02('0x36')][_0xdc02('0x38')]?_0x56520a[_0xdc02('0x36')]:_0x55a2d0[_0xdc02('0x31')];if(!_0x62c6a7[_0xdc02('0x32')][_0xdc02('0x39')](_0xdc02('0x3a'))){_0x56520a[_0xdc02('0x3b')]=qs[_0xdc02('0x3b')](_0x62c6a7[_0xdc02('0x32')][_0xdc02('0x3b')]);_0x56520a['offset']=qs['offset'](_0x62c6a7['query']['offset']);}_0x56520a[_0xdc02('0x3c')]=qs[_0xdc02('0x3d')](_0x62c6a7[_0xdc02('0x32')][_0xdc02('0x3d')]);_0x56520a[_0xdc02('0x3e')]=qs['filters'](_['pick'](_0x62c6a7[_0xdc02('0x32')],_0x55a2d0[_0xdc02('0x34')]),_0x163698);if(_0x62c6a7['query'][_0xdc02('0x3f')]){_0x56520a['where']=_['merge'](_0x56520a[_0xdc02('0x3e')],{'$or':_[_0xdc02('0x2d')](_0x163698,function(_0x2ee22d){if(_0x2ee22d[_0xdc02('0x40')]!==_0xdc02('0x41')){var _0x38f95b={};_0x38f95b[_0x2ee22d[_0xdc02('0x2c')]]={'$like':'%'+_0x62c6a7[_0xdc02('0x32')]['filter']+'%'};return _0x38f95b;}})});}_0x56520a=_[_0xdc02('0x42')]({},_0x56520a,_0x62c6a7[_0xdc02('0x43')]);var _0x5ae49e={'where':_0x56520a[_0xdc02('0x3e')]};return db['Team'][_0xdc02('0x21')](_0x5ae49e)[_0xdc02('0x28')](function(_0x271cfc){_0x3b146a[_0xdc02('0x21')]=_0x271cfc;if(_0x62c6a7['query'][_0xdc02('0x44')]){_0x56520a[_0xdc02('0x45')]=[{'all':!![]}];}return db[_0xdc02('0x2e')][_0xdc02('0x46')](_0x56520a);})[_0xdc02('0x28')](function(_0x720488){_0x3b146a[_0xdc02('0x47')]=_0x720488;return _0x3b146a;})[_0xdc02('0x28')](respondWithFilteredResult(_0x243c1e,_0x56520a))[_0xdc02('0x48')](handleError(_0x243c1e,null));};exports[_0xdc02('0x49')]=function(_0x5284f7,_0x29d28e){var _0x90cf44={'raw':![],'where':{'id':_0x5284f7[_0xdc02('0x4a')]['id']}},_0x5ebab5={};_0x5ebab5['model']=_[_0xdc02('0x33')](db[_0xdc02('0x2e')][_0xdc02('0x2f')]);_0x5ebab5[_0xdc02('0x32')]=_['keys'](_0x5284f7[_0xdc02('0x32')]);_0x5ebab5[_0xdc02('0x34')]=_[_0xdc02('0x35')](_0x5ebab5[_0xdc02('0x31')],_0x5ebab5['query']);_0x90cf44['attributes']=_[_0xdc02('0x35')](_0x5ebab5[_0xdc02('0x31')],qs[_0xdc02('0x37')](_0x5284f7[_0xdc02('0x32')][_0xdc02('0x37')]));_0x90cf44[_0xdc02('0x36')]=_0x90cf44[_0xdc02('0x36')][_0xdc02('0x38')]?_0x90cf44[_0xdc02('0x36')]:_0x5ebab5[_0xdc02('0x31')];if(_0x5284f7[_0xdc02('0x32')][_0xdc02('0x44')]){_0x90cf44[_0xdc02('0x45')]=[{'all':!![]}];}_0x90cf44=_[_0xdc02('0x42')]({},_0x90cf44,_0x5284f7[_0xdc02('0x43')]);return db[_0xdc02('0x2e')][_0xdc02('0x4b')](_0x90cf44)[_0xdc02('0x28')](handleEntityNotFound(_0x29d28e,null))[_0xdc02('0x28')](respondWithResult(_0x29d28e,null))[_0xdc02('0x48')](handleError(_0x29d28e,null));};exports[_0xdc02('0x4c')]=function(_0x267a4e,_0x49da40){return db[_0xdc02('0x2e')][_0xdc02('0x4c')](_0x267a4e[_0xdc02('0x4d')],{})['then'](function(_0x461448){var _0x2952b4=_0x267a4e[_0xdc02('0x4e')][_0xdc02('0x4f')]({'plain':!![]});if(!_0x2952b4)throw new Error(_0xdc02('0x50'));if(_0x2952b4[_0xdc02('0x51')]==='user'){var _0x3682de=_0x461448[_0xdc02('0x4f')]({'plain':!![]});var _0x10a1da=_0xdc02('0x52');return db[_0xdc02('0x53')][_0xdc02('0x4b')]({'where':{'name':_0x10a1da,'userProfileId':_0x2952b4['userProfileId']},'raw':!![]})[_0xdc02('0x28')](function(_0x2d87d6){if(_0x2d87d6&&_0x2d87d6[_0xdc02('0x54')]===0x0){return db['UserProfileResource'][_0xdc02('0x4c')]({'name':_0x3682de['name'],'resourceId':_0x3682de['id'],'type':_0x2d87d6[_0xdc02('0x2c')],'sectionId':_0x2d87d6['id']},{})[_0xdc02('0x28')](function(){return _0x461448;});}else{return _0x461448;}})[_0xdc02('0x48')](function(_0x38160d){logger['error'](_0xdc02('0x55'),_0x38160d);throw _0x38160d;});}return _0x461448;})['then'](respondWithResult(_0x49da40,0xc9))[_0xdc02('0x48')](handleError(_0x49da40,null));};exports[_0xdc02('0x27')]=function(_0x70fa75,_0x4a84cf){if(_0x70fa75['body']['id']){delete _0x70fa75['body']['id'];}return db[_0xdc02('0x2e')][_0xdc02('0x4b')]({'where':{'id':_0x70fa75['params']['id']}})[_0xdc02('0x28')](handleEntityNotFound(_0x4a84cf,null))['then'](saveUpdates(_0x70fa75['body'],null))[_0xdc02('0x28')](respondWithResult(_0x4a84cf,null))['catch'](handleError(_0x4a84cf,null));};exports[_0xdc02('0x56')]=function(_0x5f5023,_0x401d44){var _0xa4c0d4=_0x5f5023[_0xdc02('0x4a')]['id'];var _0x553808=[];return db[_0xdc02('0x57')]['transaction'](function(_0x2ce812){var _0x39aaaf=_0xdc02('0x58')+_0xa4c0d4;return db['sequelize'][_0xdc02('0x32')](_0x39aaaf,{'type':db[_0xdc02('0x59')][_0xdc02('0x5a')][_0xdc02('0x5b')],'raw':!![],'transaction':_0x2ce812})[_0xdc02('0x28')](function(_0x21b833){_0x553808=_[_0xdc02('0x2d')](_0x21b833,function(_0xdae3c0){return Number(_0xdae3c0['UserId']);});})[_0xdc02('0x28')](function(){var _0x2be497=_0xdc02('0x5c')+_0xa4c0d4;return db[_0xdc02('0x57')]['query'](_0x2be497,{'type':db[_0xdc02('0x59')][_0xdc02('0x5a')][_0xdc02('0x5b')],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x54b80f){var _0x519c74=_[_0xdc02('0x2d')](_0x54b80f,function(_0x2c93d5){return Number(_0x2c93d5[_0xdc02('0x5d')]);});return db[_0xdc02('0x5e')][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'VoiceQueueId':{'$in':_0x519c74}},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){var _0x1b7c20=_0xdc02('0x5f')+_0xa4c0d4;return db[_0xdc02('0x57')]['query'](_0x1b7c20,{'type':db['Sequelize'][_0xdc02('0x5a')][_0xdc02('0x5b')],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x3d8830){var _0x240499=_[_0xdc02('0x2d')](_0x3d8830,function(_0x1851ba){return Number(_0x1851ba['MailQueueId']);});return db[_0xdc02('0x60')]['destroy']({'where':{'UserId':{'$in':_0x553808},'MailQueueId':{'$in':_0x240499}},'transaction':_0x2ce812});})['then'](function(){var _0x51345f=_0xdc02('0x61')+_0xa4c0d4;return db[_0xdc02('0x57')][_0xdc02('0x32')](_0x51345f,{'type':db[_0xdc02('0x59')]['QueryTypes'][_0xdc02('0x5b')],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x3b78a8){var _0x282a26=_[_0xdc02('0x2d')](_0x3b78a8,function(_0x255cd8){return Number(_0x255cd8['SmsQueueId']);});return db[_0xdc02('0x62')][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'SmsQueueId':{'$in':_0x282a26}},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){var _0x341636=_0xdc02('0x63')+_0xa4c0d4;return db[_0xdc02('0x57')][_0xdc02('0x32')](_0x341636,{'type':db[_0xdc02('0x59')][_0xdc02('0x5a')]['SELECT'],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x35d960){var _0x1e46df=_['map'](_0x35d960,function(_0x548fbb){return Number(_0x548fbb[_0xdc02('0x64')]);});return db[_0xdc02('0x65')][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'ChatQueueId':{'$in':_0x1e46df}},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){var _0x4e983f='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0xa4c0d4;return db[_0xdc02('0x57')][_0xdc02('0x32')](_0x4e983f,{'type':db[_0xdc02('0x59')][_0xdc02('0x5a')][_0xdc02('0x5b')],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x21aa85){var _0x20ee9b=_[_0xdc02('0x2d')](_0x21aa85,function(_0x4216af){return Number(_0x4216af[_0xdc02('0x66')]);});return db[_0xdc02('0x67')][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'FaxQueueId':{'$in':_0x20ee9b}},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){var _0x976037=_0xdc02('0x68')+_0xa4c0d4;return db[_0xdc02('0x57')][_0xdc02('0x32')](_0x976037,{'type':db[_0xdc02('0x59')][_0xdc02('0x5a')]['SELECT'],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x2fa2dc){var _0x3f85a2=_['map'](_0x2fa2dc,function(_0x12005a){return Number(_0x12005a[_0xdc02('0x69')]);});return db['UserOpenchannelQueue'][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'OpenchannelQueueId':{'$in':_0x3f85a2}},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){var _0x6f11d3=_0xdc02('0x6a')+_0xa4c0d4;return db[_0xdc02('0x57')]['query'](_0x6f11d3,{'type':db[_0xdc02('0x59')][_0xdc02('0x5a')][_0xdc02('0x5b')],'raw':!![],'transaction':_0x2ce812});})[_0xdc02('0x28')](function(_0x5aa5f9){var _0x58546c=_[_0xdc02('0x2d')](_0x5aa5f9,function(_0x3a436f){return Number(_0x3a436f[_0xdc02('0x6b')]);});return db['UserWhatsappQueue'][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'WhatsappQueueId':{'$in':_0x58546c}},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){return db[_0xdc02('0x6c')][_0xdc02('0x4b')]({'where':{'TeamId':_0xa4c0d4}});})[_0xdc02('0x28')](function(_0x29426e){if(_0x29426e===null){return;}return db[_0xdc02('0x6d')][_0xdc02('0x56')]({'where':{'UserId':{'$in':_0x553808},'VoicePrefixId':_0x29426e['VoicePrefixId']},'transaction':_0x2ce812});})[_0xdc02('0x28')](function(){return db[_0xdc02('0x2e')][_0xdc02('0x56')]({'where':{'id':_0xa4c0d4},'cascade':!![],'transaction':_0x2ce812});})['then'](function(_0x58370c){if(_0x58370c===0x0){_0x401d44[_0xdc02('0x29')](0x194);}else{return db[_0xdc02('0x6e')][_0xdc02('0x56')]({'where':{'type':_0xdc02('0x52'),'resourceId':_0xa4c0d4},'cascade':!![],'transaction':_0x2ce812})['then'](function(){_0x401d44[_0xdc02('0x1c')](0xcc)[_0xdc02('0x1d')]();});}})[_0xdc02('0x48')](function(_0x2066b8){_0x401d44['status'](0x1f4)[_0xdc02('0x6f')](_0x2066b8);});});};exports[_0xdc02('0x70')]=function(_0x4557ba,_0x4d4b6a,_0x6a41c9){return db[_0xdc02('0x2e')]['findOne']({'where':{'id':_0x4557ba[_0xdc02('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d4b6a,null))[_0xdc02('0x28')](function(_0x801edd){if(!_0x4557ba[_0xdc02('0x32')][_0xdc02('0x71')]||!utils[_0xdc02('0x72')](_0x4557ba[_0xdc02('0x32')]['channel'])){throw new db[(_0xdc02('0x59'))][(_0xdc02('0x73'))](_0xdc02('0x74'));}var _0x21dfcc={};var _0x248c5c={};_0x248c5c['model']=_[_0xdc02('0x33')](db[_['capitalize'](_0x4557ba[_0xdc02('0x32')]['channel'][_0xdc02('0x75')]())+'Queue'][_0xdc02('0x2f')]);_0x248c5c[_0xdc02('0x32')]=_[_0xdc02('0x33')](_0x4557ba[_0xdc02('0x32')]);_0x248c5c[_0xdc02('0x34')]=_['intersection'](_0x248c5c[_0xdc02('0x31')],_0x248c5c['query']);_0x21dfcc[_0xdc02('0x36')]=_[_0xdc02('0x35')](_0x248c5c['model'],qs[_0xdc02('0x37')](_0x4557ba[_0xdc02('0x32')][_0xdc02('0x37')]));_0x21dfcc[_0xdc02('0x36')]=_0x21dfcc[_0xdc02('0x36')][_0xdc02('0x38')]?_0x21dfcc[_0xdc02('0x36')]:_0x248c5c[_0xdc02('0x31')];_0x21dfcc[_0xdc02('0x3b')]=qs[_0xdc02('0x3b')](_0x4557ba[_0xdc02('0x32')]['limit']);_0x21dfcc[_0xdc02('0x1f')]=qs[_0xdc02('0x1f')](_0x4557ba[_0xdc02('0x32')]['offset']);_0x21dfcc['order']=qs['sort'](_0x4557ba['query'][_0xdc02('0x3d')]);_0x21dfcc[_0xdc02('0x3e')]=qs['filters'](_[_0xdc02('0x76')](_0x4557ba[_0xdc02('0x32')],_0x248c5c[_0xdc02('0x34')]));_0x21dfcc=_['merge']({},_0x21dfcc,_0x4557ba[_0xdc02('0x43')]);return _0x801edd[_0xdc02('0x4f')+_[_0xdc02('0x77')](_0x4557ba[_0xdc02('0x32')][_0xdc02('0x71')]['toLowerCase']())+'Queues'](_0x21dfcc);})['then'](respondWithResult(_0x4d4b6a,null))[_0xdc02('0x48')](handleError(_0x4d4b6a,null));};exports[_0xdc02('0x78')]=function(_0x50b4f3,_0x41b9e0,_0x769c77){return db['Team'][_0xdc02('0x79')]({'where':{'id':_0x50b4f3[_0xdc02('0x4a')]['id']}})[_0xdc02('0x28')](function(_0x4b784f){if(_0x4b784f){if(!_0x50b4f3[_0xdc02('0x4d')][_0xdc02('0x71')]||!utils[_0xdc02('0x72')](_0x50b4f3[_0xdc02('0x4d')][_0xdc02('0x71')])){throw new db[(_0xdc02('0x59'))][(_0xdc02('0x73'))](_0xdc02('0x74'));}return _0x4b784f['add'+_[_0xdc02('0x77')](_0x50b4f3['body']['channel'][_0xdc02('0x75')]())+_0xdc02('0x7a')](_0x50b4f3[_0xdc02('0x4d')]['ids']);}return null;})[_0xdc02('0x28')](handleEntityNotFound(_0x41b9e0,null))[_0xdc02('0x28')](respondWithStatusCode(_0x41b9e0,null))[_0xdc02('0x48')](handleError(_0x41b9e0,null));};exports['removeQueues']=function(_0x28f28d,_0x256bac,_0x3b1037){return db['Team'][_0xdc02('0x79')]({'where':{'id':_0x28f28d[_0xdc02('0x4a')]['id']}})[_0xdc02('0x28')](function(_0x20f7f7){if(_0x20f7f7){if(!_0x28f28d[_0xdc02('0x32')]['channel']||!utils['isValidChannel'](_0x28f28d[_0xdc02('0x32')][_0xdc02('0x71')])){throw new db['Sequelize'][(_0xdc02('0x73'))]('Unknown\x20channel');}return _0x20f7f7[_0xdc02('0x7b')+_['capitalize'](_0x28f28d[_0xdc02('0x32')][_0xdc02('0x71')][_0xdc02('0x75')]())+'Queues'](_0x28f28d['query'][_0xdc02('0x7c')]);}return null;})[_0xdc02('0x28')](handleEntityNotFound(_0x256bac,null))[_0xdc02('0x28')](respondWithStatusCode(_0x256bac,null))[_0xdc02('0x48')](handleError(_0x256bac,null));};exports['addAgents']=function(_0x4a23e4,_0x5ea156){var _0x4c61eb=_['isArray'](_0x4a23e4['body'][_0xdc02('0x7c')])?_0x4a23e4[_0xdc02('0x4d')][_0xdc02('0x7c')]:[_0x4a23e4[_0xdc02('0x4d')]['ids']];var _0x2a74b9=_0x4a23e4[_0xdc02('0x4a')]['id'];return db['Team'][_0xdc02('0x4b')]({'where':{'id':_0x2a74b9}})[_0xdc02('0x28')](handleEntityNotFound(_0x5ea156,null))[_0xdc02('0x28')](function(_0x2313ab){if(_0x2313ab){var _0x842a60=['Voice','Chat','Mail',_0xdc02('0x7d'),_0xdc02('0x7e'),_0xdc02('0x7f'),'Whatsapp'];return db[_0xdc02('0x57')]['transaction'](function(_0x514431){var _0xddf4a2=_[_0xdc02('0x2d')](_0x842a60,function(_0x7bbe41){var _0x3866b3={'attributes':['id','name']};if(_0x7bbe41==='Voice'){_0x3866b3[_0xdc02('0x80')]={'attributes':[_0xdc02('0x81')]};}return _0x2313ab[_0xdc02('0x4f')+_0x7bbe41+_0xdc02('0x7a')](_0x3866b3)[_0xdc02('0x28')](function(_0x2bbdd1){var _0x3e4ab6=_[_0xdc02('0x2d')](_0x2bbdd1,function(_0x16d46f){var _0x54f161=_['map'](_0x4c61eb,function(_0xc8a682){var _0x582623={'where':{'UserId':_0xc8a682,[_0x7bbe41+'QueueId']:_0x16d46f['id']},'transaction':_0x514431};if(_0x7bbe41===_0xdc02('0x82')){_0x582623[_0xdc02('0x19')]={'penalty':_0x16d46f[_0xdc02('0x83')][_0xdc02('0x81')]};}return db[_0xdc02('0x84')+_0x7bbe41+_0xdc02('0x85')]['findOrCreate'](_0x582623)['then'](function(){socket[_0xdc02('0x86')](_0xdc02('0x4e')+_0x7bbe41+_0xdc02('0x87'),{'UserId':_0xc8a682,[_0x7bbe41+_0xdc02('0x88')]:_0x16d46f['id']});if(_0x7bbe41!=='Voice'){return;}return db[_0xdc02('0x84')][_0xdc02('0x46')]({'where':{'id':_0x4c61eb,'online':0x1},'attributes':['id','name',_0xdc02('0x89'),_0xdc02('0x8a'),'interface'],'raw':!![]})[_0xdc02('0x28')](function(_0x3a0572){var _0x4ed4f2=_[_0xdc02('0x2d')](_0x3a0572,function(_0x3f342d){return db[_0xdc02('0x8b')][_0xdc02('0x8c')]({'membername':_0x3f342d[_0xdc02('0x2c')],'UserId':_0x3f342d['id'],'queue_name':_0x16d46f[_0xdc02('0x2c')],'VoiceQueueId':_0x16d46f['id'],'interface':_[_0xdc02('0x8d')](_0x3f342d['interface'])?util[_0xdc02('0x8e')](_0xdc02('0x8f'),_0x3f342d['name']):_0x3f342d[_0xdc02('0x90')],'paused':_0x3f342d['voicePause']||![],'penalty':_0x16d46f[_0xdc02('0x83')][_0xdc02('0x81')]},{'transaction':_0x514431});});return Promise['all'](_0x4ed4f2);});});});return Promise[_0xdc02('0x91')](_0x54f161);});return Promise[_0xdc02('0x91')](_0x3e4ab6);})['then'](function(){return db[_0xdc02('0x6c')][_0xdc02('0x79')]({'where':{'teamId':_0x2a74b9}})[_0xdc02('0x28')](function(_0x1772d7){if(_0x1772d7){var _0x156651=_[_0xdc02('0x2d')](_0x4c61eb,function(_0x763cb4){db['UserVoicePrefix'][_0xdc02('0x8c')]({'UserId':_0x763cb4,'VoicePrefixId':_0x1772d7['VoicePrefixId']});});return Promise[_0xdc02('0x91')](_0x156651);}});});});return Promise[_0xdc02('0x91')](_0xddf4a2)['then'](function(){return _0x2313ab[_0xdc02('0x92')](_0x4c61eb,{'transaction':_0x514431})[_0xdc02('0x93')](function(_0x567496){return _0x567496;});});});}})['then'](respondWithResult(_0x5ea156,null))['catch'](handleError(_0x5ea156,null));};exports[_0xdc02('0x94')]=function(_0xa6e2cc,_0x3ca4ff){var _0x19a375=_['isArray'](_0xa6e2cc[_0xdc02('0x32')][_0xdc02('0x7c')])?_0xa6e2cc[_0xdc02('0x32')][_0xdc02('0x7c')]:[_0xa6e2cc[_0xdc02('0x32')][_0xdc02('0x7c')]];var _0x3a3b77=_0xa6e2cc['params']['id'];return db[_0xdc02('0x2e')]['find']({'where':{'id':_0x3a3b77}})[_0xdc02('0x28')](handleEntityNotFound(_0x3ca4ff,null))[_0xdc02('0x28')](function(_0x20718f){if(_0x20718f){var _0x16d4f3=['Voice',_0xdc02('0x95'),'Mail',_0xdc02('0x7d'),_0xdc02('0x7e'),_0xdc02('0x7f'),_0xdc02('0x96')];return db['sequelize'][_0xdc02('0x97')](function(_0x59aeba){var _0x1cfb35=_[_0xdc02('0x2d')](_0x16d4f3,function(_0x2927fb){var _0x372696={'attributes':['id',_0xdc02('0x2c')]};return _0x20718f[_0xdc02('0x4f')+_0x2927fb+_0xdc02('0x7a')](_0x372696)[_0xdc02('0x28')](function(_0x4e65bd){var _0x409d8a=_[_0xdc02('0x2d')](_0x4e65bd,function(_0x5e2b97){return _0x5e2b97['removeAgents'](_0x19a375,{'transaction':_0x59aeba})[_0xdc02('0x28')](function(){var _0x3b0202=_[_0xdc02('0x2d')](_0x19a375,function(_0x1a3b09){socket[_0xdc02('0x86')]('user'+_0x2927fb+_0xdc02('0x98'),{'UserId':Number(_0x1a3b09),[_0x2927fb+_0xdc02('0x88')]:_0x5e2b97['id']});if(_0x2927fb!==_0xdc02('0x82')){return;}return db[_0xdc02('0x8b')]['destroy']({'where':{'VoiceQueueId':_0x5e2b97['id'],'UserId':_0x1a3b09},'transaction':_0x59aeba});});return Promise['all'](_0x3b0202);});});return Promise[_0xdc02('0x91')](_0x409d8a);});});return Promise[_0xdc02('0x91')](_0x1cfb35)[_0xdc02('0x28')](function(){return _0x20718f[_0xdc02('0x94')](_0x19a375,{'transaction':_0x59aeba});})[_0xdc02('0x28')](function(){return db['TeamVoicePrefix'][_0xdc02('0x79')]({'where':{'teamId':_0x3a3b77}})['then'](function(_0x12a48b){if(_0x12a48b){var _0x3d8c17=_['map'](_0x19a375,function(_0x4d4b9c){db[_0xdc02('0x6d')][_0xdc02('0x56')]({'where':{'UserId':_0x4d4b9c,'VoicePrefixId':_0x12a48b['VoicePrefixId']}});});return Promise['all'](_0x3d8c17);}});});});}})[_0xdc02('0x28')](respondWithStatusCode(_0x3ca4ff,null))[_0xdc02('0x48')](handleError(_0x3ca4ff,null));};exports[_0xdc02('0x99')]=function(_0x11e585,_0x356eff,_0x4871a1){var _0xaf0c32={};var _0x2aa0ed={};var _0x566c9;var _0x3f97f0;return db[_0xdc02('0x2e')][_0xdc02('0x79')]({'where':{'id':_0x11e585[_0xdc02('0x4a')]['id']}})[_0xdc02('0x28')](handleEntityNotFound(_0x356eff,null))[_0xdc02('0x28')](function(_0x37965d){if(_0x37965d){_0x566c9=_0x37965d;_0x2aa0ed[_0xdc02('0x31')]=_[_0xdc02('0x33')](db[_0xdc02('0x84')][_0xdc02('0x2f')]);_0x2aa0ed[_0xdc02('0x32')]=_['keys'](_0x11e585[_0xdc02('0x32')]);_0x2aa0ed[_0xdc02('0x34')]=_[_0xdc02('0x35')](_0x2aa0ed[_0xdc02('0x31')],_0x2aa0ed[_0xdc02('0x32')]);_0xaf0c32['attributes']=_[_0xdc02('0x35')](_0x2aa0ed['model'],qs['fields'](_0x11e585[_0xdc02('0x32')][_0xdc02('0x37')]));_0xaf0c32[_0xdc02('0x36')]=_0xaf0c32[_0xdc02('0x36')][_0xdc02('0x38')]?_0xaf0c32['attributes']:_0x2aa0ed[_0xdc02('0x31')];_0xaf0c32['order']=qs[_0xdc02('0x3d')](_0x11e585[_0xdc02('0x32')][_0xdc02('0x3d')]);_0xaf0c32[_0xdc02('0x3e')]=qs[_0xdc02('0x34')](_['pick'](_0x11e585[_0xdc02('0x32')],_0x2aa0ed[_0xdc02('0x34')]));if(_0x11e585[_0xdc02('0x32')][_0xdc02('0x3f')]){_0xaf0c32[_0xdc02('0x3e')]=_['merge'](_0xaf0c32[_0xdc02('0x3e')],{'$or':_['map'](_0xaf0c32[_0xdc02('0x36')],function(_0x215988){var _0x113c4d={};_0x113c4d[_0x215988]={'$like':'%'+_0x11e585[_0xdc02('0x32')][_0xdc02('0x3f')]+'%'};return _0x113c4d;})});}_0xaf0c32=_[_0xdc02('0x42')]({},_0xaf0c32,_0x11e585[_0xdc02('0x43')]);return _0x566c9['getAgents'](_0xaf0c32);}})['then'](function(_0x466615){if(_0x466615){_0x3f97f0=_0x466615[_0xdc02('0x38')];if(!_0x11e585[_0xdc02('0x32')][_0xdc02('0x39')](_0xdc02('0x3a'))){_0xaf0c32[_0xdc02('0x3b')]=qs[_0xdc02('0x3b')](_0x11e585['query'][_0xdc02('0x3b')]);_0xaf0c32[_0xdc02('0x1f')]=qs[_0xdc02('0x1f')](_0x11e585[_0xdc02('0x32')][_0xdc02('0x1f')]);}return _0x566c9[_0xdc02('0x99')](_0xaf0c32);}})[_0xdc02('0x28')](function(_0x10287a){if(_0x10287a){return _0x10287a?{'count':_0x3f97f0,'rows':_0x10287a}:null;}})[_0xdc02('0x28')](respondWithResult(_0x356eff,null))[_0xdc02('0x48')](handleError(_0x356eff,null));}; \ No newline at end of file +var _0xad92=['isArray','removeAgents','Queue:remove','TeamVoicePrefix','getAgents','filter','nolimit','zip-dir','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','keys','find','body','role','user','get','Teams','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','VoiceQueueId','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','isValidChannel','ValidationError','Unknown\x20channel','channel','toLowerCase','Queue','order','addQueues','findOne','add','capitalize','ids','removeQueues','remove','Queues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','TeamVoiceQueue','penalty','User','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all'];(function(_0x18726d,_0x476830){var _0x1bd3fa=function(_0x3709fb){while(--_0x3709fb){_0x18726d['push'](_0x18726d['shift']());}};_0x1bd3fa(++_0x476830);}(_0xad92,0x1cc));var _0x2ad9=function(_0x39eff9,_0x3a57a4){_0x39eff9=_0x39eff9-0x0;var _0x356d78=_0xad92[_0x39eff9];return _0x356d78;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2ad9('0x0'));var jsonpatch=require(_0x2ad9('0x1'));var rp=require('request-promise');var moment=require(_0x2ad9('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ad9('0x3'));var path=require('path');var sox=require(_0x2ad9('0x4'));var csv=require(_0x2ad9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ad9('0x6'));var _=require(_0x2ad9('0x7'));var squel=require(_0x2ad9('0x8'));var crypto=require(_0x2ad9('0x9'));var jsforce=require(_0x2ad9('0xa'));var deskjs=require(_0x2ad9('0xb'));var toCsv=require(_0x2ad9('0x5'));var querystring=require('querystring');var Papa=require(_0x2ad9('0xc'));var Redis=require(_0x2ad9('0xd'));var authService=require(_0x2ad9('0xe'));var qs=require(_0x2ad9('0xf'));var as=require(_0x2ad9('0x10'));var hardwareService=require(_0x2ad9('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2ad9('0x12'));var licenseUtil=require(_0x2ad9('0x13'));var db=require(_0x2ad9('0x14'))['db'];config['redis']=_[_0x2ad9('0x15')](config[_0x2ad9('0x16')],{'host':_0x2ad9('0x17'),'port':0x18eb});var socket=require(_0x2ad9('0x18'))(new Redis(config[_0x2ad9('0x16')]));require('./team.socket')[_0x2ad9('0x19')](socket);function respondWithStatusCode(_0x32e062,_0x212347){_0x212347=_0x212347||0xcc;return function(_0x45131c){if(_0x45131c){return _0x32e062[_0x2ad9('0x1a')](_0x212347);}return _0x32e062[_0x2ad9('0x1b')](_0x212347)[_0x2ad9('0x1c')]();};}function respondWithResult(_0x383a1d,_0x132646){_0x132646=_0x132646||0xc8;return function(_0x49c07b){if(_0x49c07b){return _0x383a1d[_0x2ad9('0x1b')](_0x132646)['json'](_0x49c07b);}};}function respondWithFilteredResult(_0x479396,_0x36492c){return function(_0x2668e1){if(_0x2668e1){var _0x1c4e65=typeof _0x36492c['offset']===_0x2ad9('0x1d')&&typeof _0x36492c[_0x2ad9('0x1e')]===_0x2ad9('0x1d');var _0x3f5416=_0x2668e1[_0x2ad9('0x1f')];var _0x16df1a=_0x1c4e65?0x0:_0x36492c[_0x2ad9('0x20')];var _0x16de36=_0x1c4e65?_0x2668e1[_0x2ad9('0x1f')]:_0x36492c[_0x2ad9('0x20')]+_0x36492c[_0x2ad9('0x1e')];var _0x37137b;if(_0x16de36>=_0x3f5416){_0x16de36=_0x3f5416;_0x37137b=0xc8;}else{_0x37137b=0xce;}_0x479396[_0x2ad9('0x1b')](_0x37137b);return _0x479396[_0x2ad9('0x21')]('Content-Range',_0x16df1a+'-'+_0x16de36+'/'+_0x3f5416)[_0x2ad9('0x22')](_0x2668e1);}return null;};}function patchUpdates(_0x2fc8c8){return function(_0x36b29d){try{jsonpatch[_0x2ad9('0x23')](_0x36b29d,_0x2fc8c8,!![]);}catch(_0x22f34e){return BPromise[_0x2ad9('0x24')](_0x22f34e);}return _0x36b29d['save']();};}function saveUpdates(_0x1e4b15,_0x2f85ad){return function(_0x2eb08a){if(_0x2eb08a){return _0x2eb08a['update'](_0x1e4b15)[_0x2ad9('0x25')](function(_0x1af047){return _0x1af047;});}return null;};}function handleEntityNotFound(_0xd1160f,_0x5782d4){return function(_0x1f9d2d){if(!_0x1f9d2d){_0xd1160f[_0x2ad9('0x1a')](0x194);}return _0x1f9d2d;};}function handleError(_0xbbfc0a,_0x23354f){_0x23354f=_0x23354f||0x1f4;return function(_0x561f2f){logger[_0x2ad9('0x26')](_0x561f2f[_0x2ad9('0x27')]);if(_0x561f2f[_0x2ad9('0x28')]){delete _0x561f2f[_0x2ad9('0x28')];}_0xbbfc0a[_0x2ad9('0x1b')](_0x23354f)[_0x2ad9('0x29')](_0x561f2f);};}exports['index']=function(_0x12203a,_0x597a81){var _0x5220a6={},_0x15a89f={},_0x1f5d47={'count':0x0,'rows':[]};var _0x3aed12=_[_0x2ad9('0x2a')](db['Team'][_0x2ad9('0x2b')],function(_0x49b714){return{'name':_0x49b714[_0x2ad9('0x2c')],'type':_0x49b714[_0x2ad9('0x2d')][_0x2ad9('0x2e')]};});_0x15a89f[_0x2ad9('0x2f')]=_['map'](_0x3aed12,_0x2ad9('0x28'));_0x15a89f[_0x2ad9('0x30')]=_['keys'](_0x12203a['query']);_0x15a89f['filters']=_[_0x2ad9('0x31')](_0x15a89f[_0x2ad9('0x2f')],_0x15a89f['query']);_0x5220a6[_0x2ad9('0x32')]=_[_0x2ad9('0x31')](_0x15a89f[_0x2ad9('0x2f')],qs[_0x2ad9('0x33')](_0x12203a[_0x2ad9('0x30')][_0x2ad9('0x33')]));_0x5220a6['attributes']=_0x5220a6[_0x2ad9('0x32')][_0x2ad9('0x34')]?_0x5220a6[_0x2ad9('0x32')]:_0x15a89f['model'];if(!_0x12203a[_0x2ad9('0x30')][_0x2ad9('0x35')]('nolimit')){_0x5220a6[_0x2ad9('0x1e')]=qs[_0x2ad9('0x1e')](_0x12203a[_0x2ad9('0x30')]['limit']);_0x5220a6[_0x2ad9('0x20')]=qs[_0x2ad9('0x20')](_0x12203a[_0x2ad9('0x30')][_0x2ad9('0x20')]);}_0x5220a6['order']=qs[_0x2ad9('0x36')](_0x12203a[_0x2ad9('0x30')][_0x2ad9('0x36')]);_0x5220a6[_0x2ad9('0x37')]=qs[_0x2ad9('0x38')](_[_0x2ad9('0x39')](_0x12203a[_0x2ad9('0x30')],_0x15a89f[_0x2ad9('0x38')]),_0x3aed12);if(_0x12203a[_0x2ad9('0x30')]['filter']){_0x5220a6[_0x2ad9('0x37')]=_[_0x2ad9('0x3a')](_0x5220a6[_0x2ad9('0x37')],{'$or':_[_0x2ad9('0x2a')](_0x3aed12,function(_0x2440c3){if(_0x2440c3['type']!==_0x2ad9('0x3b')){var _0x318491={};_0x318491[_0x2440c3[_0x2ad9('0x28')]]={'$like':'%'+_0x12203a[_0x2ad9('0x30')]['filter']+'%'};return _0x318491;}})});}_0x5220a6=_[_0x2ad9('0x3a')]({},_0x5220a6,_0x12203a[_0x2ad9('0x3c')]);var _0x22ee86={'where':_0x5220a6[_0x2ad9('0x37')]};return db[_0x2ad9('0x3d')][_0x2ad9('0x1f')](_0x22ee86)[_0x2ad9('0x25')](function(_0x3fd472){_0x1f5d47[_0x2ad9('0x1f')]=_0x3fd472;if(_0x12203a['query'][_0x2ad9('0x3e')]){_0x5220a6[_0x2ad9('0x3f')]=[{'all':!![]}];}return db[_0x2ad9('0x3d')][_0x2ad9('0x40')](_0x5220a6);})[_0x2ad9('0x25')](function(_0x3a67ce){_0x1f5d47[_0x2ad9('0x41')]=_0x3a67ce;return _0x1f5d47;})['then'](respondWithFilteredResult(_0x597a81,_0x5220a6))[_0x2ad9('0x42')](handleError(_0x597a81,null));};exports[_0x2ad9('0x43')]=function(_0x460487,_0x240ed1){var _0x9aaa4f={'raw':![],'where':{'id':_0x460487[_0x2ad9('0x44')]['id']}},_0xcc2421={};_0xcc2421['model']=_['keys'](db['Team']['rawAttributes']);_0xcc2421['query']=_[_0x2ad9('0x45')](_0x460487[_0x2ad9('0x30')]);_0xcc2421[_0x2ad9('0x38')]=_['intersection'](_0xcc2421[_0x2ad9('0x2f')],_0xcc2421[_0x2ad9('0x30')]);_0x9aaa4f[_0x2ad9('0x32')]=_[_0x2ad9('0x31')](_0xcc2421[_0x2ad9('0x2f')],qs[_0x2ad9('0x33')](_0x460487[_0x2ad9('0x30')]['fields']));_0x9aaa4f['attributes']=_0x9aaa4f[_0x2ad9('0x32')][_0x2ad9('0x34')]?_0x9aaa4f[_0x2ad9('0x32')]:_0xcc2421['model'];if(_0x460487[_0x2ad9('0x30')][_0x2ad9('0x3e')]){_0x9aaa4f[_0x2ad9('0x3f')]=[{'all':!![]}];}_0x9aaa4f=_['merge']({},_0x9aaa4f,_0x460487['options']);return db[_0x2ad9('0x3d')][_0x2ad9('0x46')](_0x9aaa4f)[_0x2ad9('0x25')](handleEntityNotFound(_0x240ed1,null))[_0x2ad9('0x25')](respondWithResult(_0x240ed1,null))[_0x2ad9('0x42')](handleError(_0x240ed1,null));};exports['create']=function(_0x44a352,_0x435d3b){return db[_0x2ad9('0x3d')]['create'](_0x44a352[_0x2ad9('0x47')],{})[_0x2ad9('0x25')](function(_0x443f29){var _0xb52473=_0x44a352['user']['get']({'plain':!![]});if(!_0xb52473)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb52473[_0x2ad9('0x48')]===_0x2ad9('0x49')){var _0x3ebb21=_0x443f29[_0x2ad9('0x4a')]({'plain':!![]});var _0x5ef969=_0x2ad9('0x4b');return db[_0x2ad9('0x4c')][_0x2ad9('0x46')]({'where':{'name':_0x5ef969,'userProfileId':_0xb52473[_0x2ad9('0x4d')]},'raw':!![]})['then'](function(_0x50f1cb){if(_0x50f1cb&&_0x50f1cb['autoAssociation']===0x0){return db['UserProfileResource'][_0x2ad9('0x4e')]({'name':_0x3ebb21['name'],'resourceId':_0x3ebb21['id'],'type':_0x50f1cb[_0x2ad9('0x28')],'sectionId':_0x50f1cb['id']},{})[_0x2ad9('0x25')](function(){return _0x443f29;});}else{return _0x443f29;}})['catch'](function(_0x4478b8){logger['error'](_0x2ad9('0x4f'),_0x4478b8);throw _0x4478b8;});}return _0x443f29;})[_0x2ad9('0x25')](respondWithResult(_0x435d3b,0xc9))[_0x2ad9('0x42')](handleError(_0x435d3b,null));};exports['update']=function(_0x11fb5f,_0x2210f7){if(_0x11fb5f[_0x2ad9('0x47')]['id']){delete _0x11fb5f['body']['id'];}return db[_0x2ad9('0x3d')]['find']({'where':{'id':_0x11fb5f[_0x2ad9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2210f7,null))[_0x2ad9('0x25')](saveUpdates(_0x11fb5f[_0x2ad9('0x47')],null))[_0x2ad9('0x25')](respondWithResult(_0x2210f7,null))[_0x2ad9('0x42')](handleError(_0x2210f7,null));};exports['destroy']=function(_0x2faf05,_0x2b1e91){var _0x2ae009=_0x2faf05[_0x2ad9('0x44')]['id'];var _0x5869ac=[];return db[_0x2ad9('0x50')][_0x2ad9('0x51')](function(_0xa08557){var _0x1cb5bf=_0x2ad9('0x52')+_0x2ae009;return db[_0x2ad9('0x50')][_0x2ad9('0x30')](_0x1cb5bf,{'type':db[_0x2ad9('0x53')][_0x2ad9('0x54')][_0x2ad9('0x55')],'raw':!![],'transaction':_0xa08557})[_0x2ad9('0x25')](function(_0x129cdc){_0x5869ac=_[_0x2ad9('0x2a')](_0x129cdc,function(_0x155b49){return Number(_0x155b49['UserId']);});})[_0x2ad9('0x25')](function(){var _0x1f7194='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ae009;return db[_0x2ad9('0x50')]['query'](_0x1f7194,{'type':db[_0x2ad9('0x53')]['QueryTypes'][_0x2ad9('0x55')],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0x314325){var _0x3da6cf=_['map'](_0x314325,function(_0x3d3a44){return Number(_0x3d3a44[_0x2ad9('0x56')]);});return db['UserVoiceQueue'][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'VoiceQueueId':{'$in':_0x3da6cf}},'transaction':_0xa08557});})['then'](function(){var _0xd66869=_0x2ad9('0x58')+_0x2ae009;return db[_0x2ad9('0x50')][_0x2ad9('0x30')](_0xd66869,{'type':db[_0x2ad9('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0x1b6347){var _0x2f7c47=_[_0x2ad9('0x2a')](_0x1b6347,function(_0x5c75a1){return Number(_0x5c75a1['MailQueueId']);});return db[_0x2ad9('0x59')][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'MailQueueId':{'$in':_0x2f7c47}},'transaction':_0xa08557});})[_0x2ad9('0x25')](function(){var _0x53198a=_0x2ad9('0x5a')+_0x2ae009;return db['sequelize'][_0x2ad9('0x30')](_0x53198a,{'type':db['Sequelize'][_0x2ad9('0x54')]['SELECT'],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0x36f7c5){var _0x277de0=_['map'](_0x36f7c5,function(_0x4cab4e){return Number(_0x4cab4e['SmsQueueId']);});return db[_0x2ad9('0x5b')][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'SmsQueueId':{'$in':_0x277de0}},'transaction':_0xa08557});})[_0x2ad9('0x25')](function(){var _0x37b940=_0x2ad9('0x5c')+_0x2ae009;return db[_0x2ad9('0x50')][_0x2ad9('0x30')](_0x37b940,{'type':db[_0x2ad9('0x53')]['QueryTypes'][_0x2ad9('0x55')],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0xae10ee){var _0x3ac930=_[_0x2ad9('0x2a')](_0xae10ee,function(_0xceef08){return Number(_0xceef08['ChatQueueId']);});return db[_0x2ad9('0x5d')][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'ChatQueueId':{'$in':_0x3ac930}},'transaction':_0xa08557});})['then'](function(){var _0x505855=_0x2ad9('0x5e')+_0x2ae009;return db['sequelize'][_0x2ad9('0x30')](_0x505855,{'type':db[_0x2ad9('0x53')][_0x2ad9('0x54')]['SELECT'],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0x3eedb7){var _0xfb61ec=_[_0x2ad9('0x2a')](_0x3eedb7,function(_0x34692f){return Number(_0x34692f[_0x2ad9('0x5f')]);});return db[_0x2ad9('0x60')]['destroy']({'where':{'UserId':{'$in':_0x5869ac},'FaxQueueId':{'$in':_0xfb61ec}},'transaction':_0xa08557});})[_0x2ad9('0x25')](function(){var _0x266e42=_0x2ad9('0x61')+_0x2ae009;return db[_0x2ad9('0x50')][_0x2ad9('0x30')](_0x266e42,{'type':db[_0x2ad9('0x53')][_0x2ad9('0x54')]['SELECT'],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0x502fce){var _0x4d40c7=_[_0x2ad9('0x2a')](_0x502fce,function(_0x3c71a7){return Number(_0x3c71a7[_0x2ad9('0x62')]);});return db[_0x2ad9('0x63')][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'OpenchannelQueueId':{'$in':_0x4d40c7}},'transaction':_0xa08557});})['then'](function(){var _0x56d5fe=_0x2ad9('0x64')+_0x2ae009;return db[_0x2ad9('0x50')]['query'](_0x56d5fe,{'type':db[_0x2ad9('0x53')][_0x2ad9('0x54')][_0x2ad9('0x55')],'raw':!![],'transaction':_0xa08557});})[_0x2ad9('0x25')](function(_0x3b87fb){var _0x1549d4=_[_0x2ad9('0x2a')](_0x3b87fb,function(_0x184e91){return Number(_0x184e91[_0x2ad9('0x65')]);});return db[_0x2ad9('0x66')][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'WhatsappQueueId':{'$in':_0x1549d4}},'transaction':_0xa08557});})[_0x2ad9('0x25')](function(){return db['TeamVoicePrefix'][_0x2ad9('0x46')]({'where':{'TeamId':_0x2ae009}});})['then'](function(_0x13da84){if(_0x13da84===null){return;}return db[_0x2ad9('0x67')][_0x2ad9('0x57')]({'where':{'UserId':{'$in':_0x5869ac},'VoicePrefixId':_0x13da84[_0x2ad9('0x68')]},'transaction':_0xa08557});})[_0x2ad9('0x25')](function(){return db[_0x2ad9('0x3d')][_0x2ad9('0x57')]({'where':{'id':_0x2ae009},'cascade':!![],'transaction':_0xa08557});})['then'](function(_0x11f090){if(_0x11f090===0x0){_0x2b1e91[_0x2ad9('0x1a')](0x194);}else{return db[_0x2ad9('0x69')]['destroy']({'where':{'type':_0x2ad9('0x4b'),'resourceId':_0x2ae009},'cascade':!![],'transaction':_0xa08557})[_0x2ad9('0x25')](function(){_0x2b1e91[_0x2ad9('0x1b')](0xcc)['end']();});}})[_0x2ad9('0x42')](function(_0x2c2130){_0x2b1e91[_0x2ad9('0x1b')](0x1f4)[_0x2ad9('0x29')](_0x2c2130);});});};exports[_0x2ad9('0x6a')]=function(_0xffe4fc,_0x4b24b2,_0x96ca92){return db[_0x2ad9('0x3d')]['findOne']({'where':{'id':_0xffe4fc[_0x2ad9('0x44')]['id']}})[_0x2ad9('0x25')](handleEntityNotFound(_0x4b24b2,null))[_0x2ad9('0x25')](function(_0x4b7b00){if(!_0xffe4fc[_0x2ad9('0x30')]['channel']||!utils[_0x2ad9('0x6b')](_0xffe4fc[_0x2ad9('0x30')]['channel'])){throw new db['Sequelize'][(_0x2ad9('0x6c'))](_0x2ad9('0x6d'));}var _0x449161={};var _0x3f282f={};_0x3f282f[_0x2ad9('0x2f')]=_[_0x2ad9('0x45')](db[_['capitalize'](_0xffe4fc[_0x2ad9('0x30')][_0x2ad9('0x6e')][_0x2ad9('0x6f')]())+_0x2ad9('0x70')][_0x2ad9('0x2b')]);_0x3f282f[_0x2ad9('0x30')]=_[_0x2ad9('0x45')](_0xffe4fc[_0x2ad9('0x30')]);_0x3f282f[_0x2ad9('0x38')]=_[_0x2ad9('0x31')](_0x3f282f['model'],_0x3f282f[_0x2ad9('0x30')]);_0x449161[_0x2ad9('0x32')]=_['intersection'](_0x3f282f[_0x2ad9('0x2f')],qs['fields'](_0xffe4fc[_0x2ad9('0x30')][_0x2ad9('0x33')]));_0x449161['attributes']=_0x449161[_0x2ad9('0x32')][_0x2ad9('0x34')]?_0x449161['attributes']:_0x3f282f['model'];_0x449161[_0x2ad9('0x1e')]=qs['limit'](_0xffe4fc[_0x2ad9('0x30')][_0x2ad9('0x1e')]);_0x449161['offset']=qs[_0x2ad9('0x20')](_0xffe4fc[_0x2ad9('0x30')]['offset']);_0x449161[_0x2ad9('0x71')]=qs['sort'](_0xffe4fc[_0x2ad9('0x30')][_0x2ad9('0x36')]);_0x449161['where']=qs['filters'](_[_0x2ad9('0x39')](_0xffe4fc[_0x2ad9('0x30')],_0x3f282f[_0x2ad9('0x38')]));_0x449161=_['merge']({},_0x449161,_0xffe4fc[_0x2ad9('0x3c')]);return _0x4b7b00['get'+_['capitalize'](_0xffe4fc[_0x2ad9('0x30')][_0x2ad9('0x6e')]['toLowerCase']())+'Queues'](_0x449161);})[_0x2ad9('0x25')](respondWithResult(_0x4b24b2,null))[_0x2ad9('0x42')](handleError(_0x4b24b2,null));};exports[_0x2ad9('0x72')]=function(_0x15e1e8,_0x216c40,_0x2e2300){return db[_0x2ad9('0x3d')][_0x2ad9('0x73')]({'where':{'id':_0x15e1e8[_0x2ad9('0x44')]['id']}})[_0x2ad9('0x25')](function(_0x33c70c){if(_0x33c70c){if(!_0x15e1e8[_0x2ad9('0x47')][_0x2ad9('0x6e')]||!utils[_0x2ad9('0x6b')](_0x15e1e8[_0x2ad9('0x47')][_0x2ad9('0x6e')])){throw new db[(_0x2ad9('0x53'))][(_0x2ad9('0x6c'))](_0x2ad9('0x6d'));}return _0x33c70c[_0x2ad9('0x74')+_[_0x2ad9('0x75')](_0x15e1e8[_0x2ad9('0x47')]['channel'][_0x2ad9('0x6f')]())+'Queues'](_0x15e1e8[_0x2ad9('0x47')][_0x2ad9('0x76')]);}return null;})['then'](handleEntityNotFound(_0x216c40,null))[_0x2ad9('0x25')](respondWithStatusCode(_0x216c40,null))[_0x2ad9('0x42')](handleError(_0x216c40,null));};exports[_0x2ad9('0x77')]=function(_0x297f92,_0x3f5921,_0x4fbbb7){return db[_0x2ad9('0x3d')]['findOne']({'where':{'id':_0x297f92[_0x2ad9('0x44')]['id']}})[_0x2ad9('0x25')](function(_0x20fdaf){if(_0x20fdaf){if(!_0x297f92[_0x2ad9('0x30')][_0x2ad9('0x6e')]||!utils[_0x2ad9('0x6b')](_0x297f92[_0x2ad9('0x30')]['channel'])){throw new db[(_0x2ad9('0x53'))][(_0x2ad9('0x6c'))](_0x2ad9('0x6d'));}return _0x20fdaf[_0x2ad9('0x78')+_[_0x2ad9('0x75')](_0x297f92[_0x2ad9('0x30')]['channel']['toLowerCase']())+_0x2ad9('0x79')](_0x297f92['query'][_0x2ad9('0x76')]);}return null;})[_0x2ad9('0x25')](handleEntityNotFound(_0x3f5921,null))[_0x2ad9('0x25')](respondWithStatusCode(_0x3f5921,null))[_0x2ad9('0x42')](handleError(_0x3f5921,null));};exports[_0x2ad9('0x7a')]=function(_0x56aee3,_0x1077e8){var _0x4d1d5e=_['isArray'](_0x56aee3[_0x2ad9('0x47')]['ids'])?_0x56aee3[_0x2ad9('0x47')]['ids']:[_0x56aee3[_0x2ad9('0x47')][_0x2ad9('0x76')]];var _0x5977c5=_0x56aee3['params']['id'];return db[_0x2ad9('0x3d')][_0x2ad9('0x46')]({'where':{'id':_0x5977c5}})[_0x2ad9('0x25')](handleEntityNotFound(_0x1077e8,null))[_0x2ad9('0x25')](function(_0x5ce9a6){if(_0x5ce9a6){var _0x1c5d70=[_0x2ad9('0x7b'),_0x2ad9('0x7c'),_0x2ad9('0x7d'),_0x2ad9('0x7e'),_0x2ad9('0x7f'),_0x2ad9('0x80'),_0x2ad9('0x81')];return db[_0x2ad9('0x50')]['transaction'](function(_0x3ab54c){var _0x355403=_[_0x2ad9('0x2a')](_0x1c5d70,function(_0x6a22a9){var _0x336d1a={'attributes':['id',_0x2ad9('0x28')]};if(_0x6a22a9===_0x2ad9('0x7b')){_0x336d1a[_0x2ad9('0x82')]={'attributes':['penalty']};}return _0x5ce9a6['get'+_0x6a22a9+_0x2ad9('0x79')](_0x336d1a)['then'](function(_0x530a7f){var _0x34b6eb=_[_0x2ad9('0x2a')](_0x530a7f,function(_0x264b55){var _0xc3a21f=_[_0x2ad9('0x2a')](_0x4d1d5e,function(_0x53007b){var _0x25f89a={'where':{'UserId':_0x53007b,[_0x6a22a9+_0x2ad9('0x83')]:_0x264b55['id']},'transaction':_0x3ab54c};if(_0x6a22a9==='Voice'){_0x25f89a[_0x2ad9('0x15')]={'penalty':_0x264b55[_0x2ad9('0x84')][_0x2ad9('0x85')]};}return db[_0x2ad9('0x86')+_0x6a22a9+'Queue']['findOrCreate'](_0x25f89a)['then'](function(){socket[_0x2ad9('0x87')]('user'+_0x6a22a9+'Queue:save',{'UserId':_0x53007b,[_0x6a22a9+_0x2ad9('0x83')]:_0x264b55['id']});if(_0x6a22a9!==_0x2ad9('0x7b')){return;}return db[_0x2ad9('0x86')]['findAll']({'where':{'id':_0x4d1d5e,'online':0x1},'attributes':['id',_0x2ad9('0x28'),_0x2ad9('0x88'),_0x2ad9('0x89'),_0x2ad9('0x8a')],'raw':!![]})['then'](function(_0x36998b){var _0x62f567=_[_0x2ad9('0x2a')](_0x36998b,function(_0x339e16){return db[_0x2ad9('0x8b')][_0x2ad9('0x8c')]({'membername':_0x339e16[_0x2ad9('0x28')],'UserId':_0x339e16['id'],'queue_name':_0x264b55[_0x2ad9('0x28')],'VoiceQueueId':_0x264b55['id'],'interface':_[_0x2ad9('0x8d')](_0x339e16[_0x2ad9('0x8a')])?util['format'](_0x2ad9('0x8e'),_0x339e16[_0x2ad9('0x28')]):_0x339e16[_0x2ad9('0x8a')],'paused':_0x339e16[_0x2ad9('0x89')]||![],'penalty':_0x264b55['TeamVoiceQueue']['penalty']},{'transaction':_0x3ab54c});});return Promise[_0x2ad9('0x8f')](_0x62f567);});});});return Promise[_0x2ad9('0x8f')](_0xc3a21f);});return Promise['all'](_0x34b6eb);})[_0x2ad9('0x25')](function(){return db['TeamVoicePrefix'][_0x2ad9('0x73')]({'where':{'teamId':_0x5977c5}})['then'](function(_0xbe22b4){if(_0xbe22b4){var _0x345460=_[_0x2ad9('0x2a')](_0x4d1d5e,function(_0x34c58a){db['UserVoicePrefix'][_0x2ad9('0x8c')]({'UserId':_0x34c58a,'VoicePrefixId':_0xbe22b4[_0x2ad9('0x68')]});});return Promise[_0x2ad9('0x8f')](_0x345460);}});});});return Promise[_0x2ad9('0x8f')](_0x355403)[_0x2ad9('0x25')](function(){return _0x5ce9a6['addAgents'](_0x4d1d5e,{'transaction':_0x3ab54c})['spread'](function(_0x15bb17){return _0x15bb17;});});});}})['then'](respondWithResult(_0x1077e8,null))[_0x2ad9('0x42')](handleError(_0x1077e8,null));};exports['removeAgents']=function(_0x2cc947,_0x59d8a3){var _0x26ba29=_[_0x2ad9('0x90')](_0x2cc947[_0x2ad9('0x30')][_0x2ad9('0x76')])?_0x2cc947[_0x2ad9('0x30')]['ids']:[_0x2cc947[_0x2ad9('0x30')][_0x2ad9('0x76')]];var _0x519dc9=_0x2cc947[_0x2ad9('0x44')]['id'];return db[_0x2ad9('0x3d')]['find']({'where':{'id':_0x519dc9}})[_0x2ad9('0x25')](handleEntityNotFound(_0x59d8a3,null))[_0x2ad9('0x25')](function(_0x5c5920){if(_0x5c5920){var _0x4ff0a6=[_0x2ad9('0x7b'),_0x2ad9('0x7c'),_0x2ad9('0x7d'),_0x2ad9('0x7e'),_0x2ad9('0x7f'),_0x2ad9('0x80'),_0x2ad9('0x81')];return db[_0x2ad9('0x50')][_0x2ad9('0x51')](function(_0xf6de98){var _0x3e1553=_[_0x2ad9('0x2a')](_0x4ff0a6,function(_0x3a0565){var _0x2fd6eb={'attributes':['id',_0x2ad9('0x28')]};return _0x5c5920[_0x2ad9('0x4a')+_0x3a0565+_0x2ad9('0x79')](_0x2fd6eb)['then'](function(_0x5d7fcd){var _0x38c6b7=_[_0x2ad9('0x2a')](_0x5d7fcd,function(_0x365cff){return _0x365cff[_0x2ad9('0x91')](_0x26ba29,{'transaction':_0xf6de98})[_0x2ad9('0x25')](function(){var _0x1a0faf=_['map'](_0x26ba29,function(_0x40cd56){socket[_0x2ad9('0x87')]('user'+_0x3a0565+_0x2ad9('0x92'),{'UserId':Number(_0x40cd56),[_0x3a0565+_0x2ad9('0x83')]:_0x365cff['id']});if(_0x3a0565!=='Voice'){return;}return db[_0x2ad9('0x8b')]['destroy']({'where':{'VoiceQueueId':_0x365cff['id'],'UserId':_0x40cd56},'transaction':_0xf6de98});});return Promise[_0x2ad9('0x8f')](_0x1a0faf);});});return Promise[_0x2ad9('0x8f')](_0x38c6b7);});});return Promise[_0x2ad9('0x8f')](_0x3e1553)[_0x2ad9('0x25')](function(){return _0x5c5920['removeAgents'](_0x26ba29,{'transaction':_0xf6de98});})[_0x2ad9('0x25')](function(){return db[_0x2ad9('0x93')]['findOne']({'where':{'teamId':_0x519dc9}})[_0x2ad9('0x25')](function(_0x2b3d4c){if(_0x2b3d4c){var _0x2f595f=_['map'](_0x26ba29,function(_0x4f7543){db[_0x2ad9('0x67')][_0x2ad9('0x57')]({'where':{'UserId':_0x4f7543,'VoicePrefixId':_0x2b3d4c[_0x2ad9('0x68')]}});});return Promise[_0x2ad9('0x8f')](_0x2f595f);}});});});}})[_0x2ad9('0x25')](respondWithStatusCode(_0x59d8a3,null))['catch'](handleError(_0x59d8a3,null));};exports[_0x2ad9('0x94')]=function(_0x27d0cc,_0x5769ec,_0x5961cc){var _0x492ba6={};var _0x107fe5={};var _0x547d82;var _0x30a72f;return db['Team']['findOne']({'where':{'id':_0x27d0cc[_0x2ad9('0x44')]['id']}})['then'](handleEntityNotFound(_0x5769ec,null))[_0x2ad9('0x25')](function(_0x2eb842){if(_0x2eb842){_0x547d82=_0x2eb842;_0x107fe5[_0x2ad9('0x2f')]=_['keys'](db['User']['rawAttributes']);_0x107fe5[_0x2ad9('0x30')]=_['keys'](_0x27d0cc[_0x2ad9('0x30')]);_0x107fe5['filters']=_[_0x2ad9('0x31')](_0x107fe5['model'],_0x107fe5[_0x2ad9('0x30')]);_0x492ba6[_0x2ad9('0x32')]=_[_0x2ad9('0x31')](_0x107fe5[_0x2ad9('0x2f')],qs[_0x2ad9('0x33')](_0x27d0cc[_0x2ad9('0x30')][_0x2ad9('0x33')]));_0x492ba6[_0x2ad9('0x32')]=_0x492ba6['attributes']['length']?_0x492ba6[_0x2ad9('0x32')]:_0x107fe5[_0x2ad9('0x2f')];_0x492ba6['order']=qs[_0x2ad9('0x36')](_0x27d0cc[_0x2ad9('0x30')]['sort']);_0x492ba6[_0x2ad9('0x37')]=qs[_0x2ad9('0x38')](_['pick'](_0x27d0cc[_0x2ad9('0x30')],_0x107fe5[_0x2ad9('0x38')]));if(_0x27d0cc[_0x2ad9('0x30')][_0x2ad9('0x95')]){_0x492ba6[_0x2ad9('0x37')]=_[_0x2ad9('0x3a')](_0x492ba6[_0x2ad9('0x37')],{'$or':_[_0x2ad9('0x2a')](_0x492ba6['attributes'],function(_0x4e59d9){var _0x27af85={};_0x27af85[_0x4e59d9]={'$like':'%'+_0x27d0cc['query'][_0x2ad9('0x95')]+'%'};return _0x27af85;})});}_0x492ba6=_[_0x2ad9('0x3a')]({},_0x492ba6,_0x27d0cc[_0x2ad9('0x3c')]);return _0x547d82[_0x2ad9('0x94')](_0x492ba6);}})[_0x2ad9('0x25')](function(_0x4d21bc){if(_0x4d21bc){_0x30a72f=_0x4d21bc[_0x2ad9('0x34')];if(!_0x27d0cc[_0x2ad9('0x30')]['hasOwnProperty'](_0x2ad9('0x96'))){_0x492ba6[_0x2ad9('0x1e')]=qs['limit'](_0x27d0cc[_0x2ad9('0x30')][_0x2ad9('0x1e')]);_0x492ba6[_0x2ad9('0x20')]=qs['offset'](_0x27d0cc[_0x2ad9('0x30')][_0x2ad9('0x20')]);}return _0x547d82['getAgents'](_0x492ba6);}})['then'](function(_0x5429b9){if(_0x5429b9){return _0x5429b9?{'count':_0x30a72f,'rows':_0x5429b9}:null;}})[_0x2ad9('0x25')](respondWithResult(_0x5769ec,null))[_0x2ad9('0x42')](handleError(_0x5769ec,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index bdd39ef..6622733 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 _0xd77a=['save','update','remove','emit','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xd77a,0x88));var _0xad77=function(_0x1edc48,_0x432419){_0x1edc48=_0x1edc48-0x0;var _0x5492e1=_0xd77a[_0x1edc48];return _0x5492e1;};'use strict';var EventEmitter=require(_0xad77('0x0'));var Team=require(_0xad77('0x1'))['db'][_0xad77('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xad77('0x3')](0x0);var events={'afterCreate':_0xad77('0x4'),'afterUpdate':_0xad77('0x5'),'afterDestroy':_0xad77('0x6')};function emitEvent(_0x2517b2){return function(_0x1084ef,_0x3744a9,_0x544e7f){TeamEvents[_0xad77('0x7')](_0x2517b2+':'+_0x1084ef['id'],_0x1084ef);TeamEvents[_0xad77('0x7')](_0x2517b2,_0x1084ef);_0x544e7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xad77('0x8')](e,emitEvent(event));}}module[_0xad77('0x9')]=TeamEvents; \ No newline at end of file +var _0x9c1a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','save','update','remove'];(function(_0x2248e5,_0x3ef019){var _0x12c74e=function(_0x292b8a){while(--_0x292b8a){_0x2248e5['push'](_0x2248e5['shift']());}};_0x12c74e(++_0x3ef019);}(_0x9c1a,0x16c));var _0xa9c1=function(_0x3fa9cc,_0x2172bc){_0x3fa9cc=_0x3fa9cc-0x0;var _0x3ade14=_0x9c1a[_0x3fa9cc];return _0x3ade14;};'use strict';var EventEmitter=require(_0xa9c1('0x0'));var Team=require(_0xa9c1('0x1'))['db'][_0xa9c1('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa9c1('0x3'),'afterUpdate':_0xa9c1('0x4'),'afterDestroy':_0xa9c1('0x5')};function emitEvent(_0x372960){return function(_0x2ec82e,_0x36e6c1,_0x5ece27){TeamEvents[_0xa9c1('0x6')](_0x372960+':'+_0x2ec82e['id'],_0x2ec82e);TeamEvents['emit'](_0x372960,_0x2ec82e);_0x5ece27(null);};}for(var e in events){if(events[_0xa9c1('0x7')](e)){var event=events[e];Team[_0xa9c1('0x8')](e,emitEvent(event));}}module[_0xa9c1('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 7fc6e1f..4b1492f 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 _0x5611=['setDataValue','channel','catch','exports','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','map','all','./team.attributes','get','Queues','then'];(function(_0x160f66,_0x5619c1){var _0x17ca55=function(_0x4151e3){while(--_0x4151e3){_0x160f66['push'](_0x160f66['shift']());}};_0x17ca55(++_0x5619c1);}(_0x5611,0x164));var _0x1561=function(_0x18a579,_0x557b47){_0x18a579=_0x18a579-0x0;var _0x3dfbf4=_0x5611[_0x18a579];return _0x3dfbf4;};'use strict';var _=require('lodash');var attributes=require(_0x1561('0x0'));function getQueuesByChannel(_0x34d1cb,_0x8b95ad){var _0x10bba1=_0x1561('0x1')+_0x8b95ad+_0x1561('0x2');return _0x34d1cb[_0x10bba1]()[_0x1561('0x3')](function(_0x13f59a){return _['map'](_0x13f59a,function(_0xf68eff){_0xf68eff[_0x1561('0x4')](_0x1561('0x5'),_0x8b95ad);return _0xf68eff;});})[_0x1561('0x6')](function(_0x1ed685){throw _0x1ed685;});}module[_0x1561('0x7')]=function(_0x439ac8){return _0x439ac8['define'](_0x1561('0x8'),attributes,{'tableName':_0x1561('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x512ec5=this;var _0x8783b8=[_0x1561('0xa'),_0x1561('0xb'),_0x1561('0xc'),_0x1561('0xd'),_0x1561('0xe'),_0x1561('0xf'),_0x1561('0x10')];return Promise[_0x1561('0x11')]()[_0x1561('0x3')](function(){var _0x5cc8d9=_[_0x1561('0x12')](_0x8783b8,function(_0x1f2166){return getQueuesByChannel(_0x512ec5,_0x1f2166);});return Promise[_0x1561('0x13')](_0x5cc8d9);})[_0x1561('0x6')](function(_0x3045bb){throw _0x3045bb;});}}});}; \ No newline at end of file +var _0x0516=['Team','teams','Fax','Openchannel','Sms','Voice','Whatsapp','resolve','lodash','./team.attributes','Queues','then','map','setDataValue','catch','exports','define'];(function(_0x25c78b,_0x593c5a){var _0x145a23=function(_0x5ae0a8){while(--_0x5ae0a8){_0x25c78b['push'](_0x25c78b['shift']());}};_0x145a23(++_0x593c5a);}(_0x0516,0x6e));var _0x6051=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0x0516[_0x2c6810];return _0x213881;};'use strict';var _=require(_0x6051('0x0'));var attributes=require(_0x6051('0x1'));function getQueuesByChannel(_0x10bcc5,_0x31beb2){var _0x4f88c3='get'+_0x31beb2+_0x6051('0x2');return _0x10bcc5[_0x4f88c3]()[_0x6051('0x3')](function(_0x3ce0ae){return _[_0x6051('0x4')](_0x3ce0ae,function(_0x37c630){_0x37c630[_0x6051('0x5')]('channel',_0x31beb2);return _0x37c630;});})[_0x6051('0x6')](function(_0x300cf4){throw _0x300cf4;});}module[_0x6051('0x7')]=function(_0x2ed390){return _0x2ed390[_0x6051('0x8')](_0x6051('0x9'),attributes,{'tableName':_0x6051('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3bfd08=this;var _0x233754=['Chat',_0x6051('0xb'),'Mail',_0x6051('0xc'),_0x6051('0xd'),_0x6051('0xe'),_0x6051('0xf')];return Promise[_0x6051('0x10')]()[_0x6051('0x3')](function(){var _0x3cc0c7=_['map'](_0x233754,function(_0x440c2d){return getQueuesByChannel(_0x3bfd08,_0x440c2d);});return Promise['all'](_0x3cc0c7);})['catch'](function(_0xe853e7){throw _0xe853e7;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1a2a9ba..fd53bf5 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 _0x319d=['defaults','localhost','socket.io-emitter','./team.socket','register','request','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x319d,0xb2));var _0xd319=function(_0xff9b9d,_0x55eb38){_0xff9b9d=_0xff9b9d-0x0;var _0x267e23=_0x319d[_0xff9b9d];return _0x267e23;};'use strict';var _=require(_0xd319('0x0'));var util=require(_0xd319('0x1'));var moment=require(_0xd319('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd319('0x3'));var db=require(_0xd319('0x4'))['db'];var utils=require(_0xd319('0x5'));var logger=require('../../config/logger')(_0xd319('0x6'));var config=require(_0xd319('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd319('0x8')][_0xd319('0x9')]({'port':0x232a});config[_0xd319('0xa')]=_[_0xd319('0xb')](config[_0xd319('0xa')],{'host':_0xd319('0xc'),'port':0x18eb});var socket=require(_0xd319('0xd'))(new Redis(config[_0xd319('0xa')]));require(_0xd319('0xe'))[_0xd319('0xf')](socket);function respondWithRpcPromise(_0x53f23f,_0x4a15c0,_0x4f9876){return new BPromise(function(_0x29a9b6,_0x3cead2){return client[_0xd319('0x10')](_0x53f23f,_0x4f9876)['then'](function(_0x2acc83){logger['info']('Team,\x20%s,\x20%s',_0x4a15c0,_0xd319('0x11'));logger[_0xd319('0x12')](_0xd319('0x13'),_0x4a15c0,_0xd319('0x11'),JSON['stringify'](_0x2acc83));if(_0x2acc83[_0xd319('0x14')]){if(_0x2acc83[_0xd319('0x14')][_0xd319('0x15')]===0x1f4){logger[_0xd319('0x14')](_0xd319('0x16'),_0x4a15c0,_0x2acc83[_0xd319('0x14')][_0xd319('0x17')]);return _0x3cead2(_0x2acc83[_0xd319('0x14')][_0xd319('0x17')]);}logger[_0xd319('0x14')](_0xd319('0x16'),_0x4a15c0,_0x2acc83[_0xd319('0x14')][_0xd319('0x17')]);return _0x29a9b6(_0x2acc83[_0xd319('0x14')][_0xd319('0x17')]);}else{logger[_0xd319('0x18')](_0xd319('0x16'),_0x4a15c0,_0xd319('0x11'));_0x29a9b6(_0x2acc83[_0xd319('0x19')][_0xd319('0x17')]);}})[_0xd319('0x1a')](function(_0x2ccf12){logger[_0xd319('0x14')](_0xd319('0x16'),_0x4a15c0,_0x2ccf12);_0x3cead2(_0x2ccf12);});});} \ No newline at end of file +var _0x8b5d=['request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','Team,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0x147510,_0x2868ce){var _0x346554=function(_0x106e4b){while(--_0x106e4b){_0x147510['push'](_0x147510['shift']());}};_0x346554(++_0x2868ce);}(_0x8b5d,0x127));var _0xd8b5=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0x8b5d[_0x554047];return _0x5d11e4;};'use strict';var _=require(_0xd8b5('0x0'));var util=require(_0xd8b5('0x1'));var moment=require('moment');var BPromise=require(_0xd8b5('0x2'));var rs=require(_0xd8b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8b5('0x4'))['db'];var utils=require(_0xd8b5('0x5'));var logger=require(_0xd8b5('0x6'))('rpc');var config=require(_0xd8b5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd8b5('0x8')][_0xd8b5('0x9')]({'port':0x232a});config[_0xd8b5('0xa')]=_[_0xd8b5('0xb')](config[_0xd8b5('0xa')],{'host':_0xd8b5('0xc'),'port':0x18eb});var socket=require(_0xd8b5('0xd'))(new Redis(config[_0xd8b5('0xa')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x189e4b,_0xbe6dcf,_0x4929ea){return new BPromise(function(_0x9e2c2b,_0x5a38b5){return client[_0xd8b5('0xe')](_0x189e4b,_0x4929ea)[_0xd8b5('0xf')](function(_0x124499){logger[_0xd8b5('0x10')]('Team,\x20%s,\x20%s',_0xbe6dcf,_0xd8b5('0x11'));logger['debug'](_0xd8b5('0x12'),_0xbe6dcf,_0xd8b5('0x11'),JSON[_0xd8b5('0x13')](_0x124499));if(_0x124499[_0xd8b5('0x14')]){if(_0x124499[_0xd8b5('0x14')]['code']===0x1f4){logger[_0xd8b5('0x14')](_0xd8b5('0x15'),_0xbe6dcf,_0x124499[_0xd8b5('0x14')][_0xd8b5('0x16')]);return _0x5a38b5(_0x124499['error'][_0xd8b5('0x16')]);}logger[_0xd8b5('0x14')](_0xd8b5('0x15'),_0xbe6dcf,_0x124499['error'][_0xd8b5('0x16')]);return _0x9e2c2b(_0x124499[_0xd8b5('0x14')][_0xd8b5('0x16')]);}else{logger[_0xd8b5('0x10')](_0xd8b5('0x15'),_0xbe6dcf,'request\x20sent');_0x9e2c2b(_0x124499[_0xd8b5('0x17')]['message']);}})['catch'](function(_0x59b17c){logger['error'](_0xd8b5('0x15'),_0xbe6dcf,_0x59b17c);_0x5a38b5(_0x59b17c);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 5b2842c..e646da9 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 _0x1339=['team:','remove','update','emit','register','length'];(function(_0xa23301,_0x38db83){var _0x378610=function(_0x153b0e){while(--_0x153b0e){_0xa23301['push'](_0xa23301['shift']());}};_0x378610(++_0x38db83);}(_0x1339,0x1ed));var _0x9133=function(_0x5b9aba,_0x23efed){_0x5b9aba=_0x5b9aba-0x0;var _0x51ee54=_0x1339[_0x5b9aba];return _0x51ee54;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x9133('0x0'),_0x9133('0x1')];function createListener(_0x4611be,_0x20aa4b){return function(_0x447096){_0x20aa4b[_0x9133('0x2')](_0x4611be,_0x447096);};}function removeListener(_0x176e80,_0x110c51){return function(){TeamEvents['removeListener'](_0x176e80,_0x110c51);};}exports[_0x9133('0x3')]=function(_0x855473){for(var _0x379915=0x0,_0x539af6=events[_0x9133('0x4')];_0x379915<_0x539af6;_0x379915++){var _0x334dcd=events[_0x379915];var _0x3059c4=createListener(_0x9133('0x5')+_0x334dcd,_0x855473);TeamEvents['on'](_0x334dcd,_0x3059c4);}}; \ No newline at end of file +var _0x6931=['./team.events','save','removeListener','length','team:'];(function(_0x2ba460,_0x2fb3b0){var _0x4ab146=function(_0x164a7b){while(--_0x164a7b){_0x2ba460['push'](_0x2ba460['shift']());}};_0x4ab146(++_0x2fb3b0);}(_0x6931,0xa5));var _0x1693=function(_0x4e716b,_0x314cdf){_0x4e716b=_0x4e716b-0x0;var _0x310703=_0x6931[_0x4e716b];return _0x310703;};'use strict';var TeamEvents=require(_0x1693('0x0'));var events=[_0x1693('0x1'),'remove','update'];function createListener(_0x7828b9,_0x190052){return function(_0x37c53b){_0x190052['emit'](_0x7828b9,_0x37c53b);};}function removeListener(_0x1c8ac6,_0x3ea966){return function(){TeamEvents[_0x1693('0x2')](_0x1c8ac6,_0x3ea966);};}exports['register']=function(_0x361381){for(var _0x4bd166=0x0,_0x3594e0=events[_0x1693('0x3')];_0x4bd166<_0x3594e0;_0x4bd166++){var _0x328cfc=events[_0x4bd166];var _0x2ab0a0=createListener(_0x1693('0x4')+_0x328cfc,_0x361381);TeamEvents['on'](_0x328cfc,_0x2ab0a0);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 3e9abce..3be2cf1 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 _0x520e=['sequelize','exports','INTEGER'];(function(_0x55a89d,_0x584ea7){var _0x1b0e5a=function(_0x2f9b88){while(--_0x2f9b88){_0x55a89d['push'](_0x55a89d['shift']());}};_0x1b0e5a(++_0x584ea7);}(_0x520e,0x90));var _0xe520=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0x520e[_0x113a6c];return _0x1ac632;};'use strict';var Sequelize=require(_0xe520('0x0'));module[_0xe520('0x1')]={'TeamId':{'type':Sequelize[_0xe520('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xe520('0x2')]}}; \ No newline at end of file +var _0x151b=['INTEGER','sequelize'];(function(_0x336017,_0x43cbc2){var _0x46fb27=function(_0x189da0){while(--_0x189da0){_0x336017['push'](_0x336017['shift']());}};_0x46fb27(++_0x43cbc2);}(_0x151b,0x153));var _0xb151=function(_0x3a98dc,_0x5f072e){_0x3a98dc=_0x3a98dc-0x0;var _0xad0138=_0x151b[_0x3a98dc];return _0xad0138;};'use strict';var Sequelize=require(_0xb151('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb151('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index e293e76..33eb666 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 _0xd87e=['moment','bluebird','path','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api'];(function(_0x21a46f,_0x5682a8){var _0x2e4aa0=function(_0x51f06f){while(--_0x51f06f){_0x21a46f['push'](_0x21a46f['shift']());}};_0x2e4aa0(++_0x5682a8);}(_0xd87e,0x1bf));var _0xed87=function(_0x2f762f,_0x50f7e7){_0x2f762f=_0x2f762f-0x0;var _0x1b68d4=_0xd87e[_0x2f762f];return _0x1b68d4;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var logger=require('../../config/logger')(_0xed87('0x2'));var moment=require(_0xed87('0x3'));var BPromise=require(_0xed87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed87('0x5'));var rimraf=require('rimraf');var config=require(_0xed87('0x6'));var attributes=require(_0xed87('0x7'));module['exports']=function(_0x17adfe,_0x589fb9){return _0x17adfe['define'](_0xed87('0x8'),attributes,{'tableName':_0xed87('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8164=['util','../../config/logger','moment','bluebird','path','../../config/environment','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x8164,0x170));var _0x4816=function(_0x38f5fe,_0x53da89){_0x38f5fe=_0x38f5fe-0x0;var _0x54ab60=_0x8164[_0x38f5fe];return _0x54ab60;};'use strict';var _=require(_0x4816('0x0'));var util=require(_0x4816('0x1'));var logger=require(_0x4816('0x2'))('api');var moment=require(_0x4816('0x3'));var BPromise=require(_0x4816('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4816('0x5'));var rimraf=require('rimraf');var config=require(_0x4816('0x6'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x1b3efa,_0x4b6510){return _0x1b3efa['define'](_0x4816('0x7'),attributes,{'tableName':_0x4816('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 6488a2f..bdf7c34 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x59f617,_0x1ef891){var _0x409053=function(_0x2af264){while(--_0x2af264){_0x59f617['push'](_0x59f617['shift']());}};_0x409053(++_0x1ef891);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4815a6,_0x29ef5e){var _0x309740=function(_0x4c6caf){while(--_0x4c6caf){_0x4815a6['push'](_0x4815a6['shift']());}};_0x309740(++_0x29ef5e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 42ef5c5..d954d30 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 _0x494a=['exports','INTEGER','sequelize'];(function(_0x5ec688,_0x115f65){var _0x557ef0=function(_0x329696){while(--_0x329696){_0x5ec688['push'](_0x5ec688['shift']());}};_0x557ef0(++_0x115f65);}(_0x494a,0x17c));var _0xa494=function(_0x211445,_0x3d4aaa){_0x211445=_0x211445-0x0;var _0x39f9c4=_0x494a[_0x211445];return _0x39f9c4;};'use strict';var Sequelize=require(_0xa494('0x0'));module[_0xa494('0x1')]={'penalty':{'type':Sequelize[_0xa494('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0ccb=['exports','sequelize'];(function(_0x4801a0,_0x252c24){var _0x338e26=function(_0x1599c2){while(--_0x1599c2){_0x4801a0['push'](_0x4801a0['shift']());}};_0x338e26(++_0x252c24);}(_0x0ccb,0x77));var _0xb0cc=function(_0x721435,_0x19a459){_0x721435=_0x721435-0x0;var _0x1dc26f=_0x0ccb[_0x721435];return _0x1dc26f;};'use strict';var Sequelize=require(_0xb0cc('0x0'));module[_0xb0cc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index aa83c61..72193d7 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 _0xe062=['moment','bluebird','rimraf','../../config/environment','team_has_voice_queues','lodash','util','api'];(function(_0x2d46f5,_0x1b7161){var _0x2c070f=function(_0x17dd11){while(--_0x17dd11){_0x2d46f5['push'](_0x2d46f5['shift']());}};_0x2c070f(++_0x1b7161);}(_0xe062,0xd5));var _0x2e06=function(_0x2d192c,_0x24d142){_0x2d192c=_0x2d192c-0x0;var _0x791919=_0xe062[_0x2d192c];return _0x791919;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var logger=require('../../config/logger')(_0x2e06('0x2'));var moment=require(_0x2e06('0x3'));var BPromise=require(_0x2e06('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e06('0x5'));var config=require(_0x2e06('0x6'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x912daf,_0x31d2a3){return _0x912daf['define']('TeamVoiceQueue',attributes,{'tableName':_0x2e06('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ff9=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','util','../../config/logger','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8ff9,0x188));var _0x98ff=function(_0x39f2ce,_0x13fd3f){_0x39f2ce=_0x39f2ce-0x0;var _0x2f1473=_0x8ff9[_0x39f2ce];return _0x2f1473;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var logger=require(_0x98ff('0x2'))('api');var moment=require(_0x98ff('0x3'));var BPromise=require(_0x98ff('0x4'));var rp=require(_0x98ff('0x5'));var fs=require('fs');var path=require(_0x98ff('0x6'));var rimraf=require(_0x98ff('0x7'));var config=require(_0x98ff('0x8'));var attributes=require(_0x98ff('0x9'));module['exports']=function(_0xe3db15,_0x4e61db){return _0xe3db15[_0x98ff('0xa')](_0x98ff('0xb'),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 e73cc32..e07519f 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 _0xe6c1=['../../config/utils','../../config/logger','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x1e6c('0x0'));var moment=require(_0x1e6c('0x1'));var BPromise=require(_0x1e6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6c('0x3'))['db'];var utils=require(_0x1e6c('0x4'));var logger=require(_0x1e6c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1e6c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x22ee8b,_0x6c4a37,_0x42c541){return new BPromise(function(_0x21bf7a,_0x37e078){return client[_0x1e6c('0x7')](_0x22ee8b,_0x42c541)[_0x1e6c('0x8')](function(_0xe18dae){logger[_0x1e6c('0x9')](_0x1e6c('0xa'),_0x6c4a37,_0x1e6c('0xb'));logger[_0x1e6c('0xc')](_0x1e6c('0xd'),_0x6c4a37,_0x1e6c('0xb'),JSON[_0x1e6c('0xe')](_0xe18dae));if(_0xe18dae[_0x1e6c('0xf')]){if(_0xe18dae[_0x1e6c('0xf')][_0x1e6c('0x10')]===0x1f4){logger[_0x1e6c('0xf')](_0x1e6c('0xa'),_0x6c4a37,_0xe18dae['error'][_0x1e6c('0x11')]);return _0x37e078(_0xe18dae[_0x1e6c('0xf')]['message']);}logger[_0x1e6c('0xf')](_0x1e6c('0xa'),_0x6c4a37,_0xe18dae[_0x1e6c('0xf')][_0x1e6c('0x11')]);return _0x21bf7a(_0xe18dae[_0x1e6c('0xf')][_0x1e6c('0x11')]);}else{logger[_0x1e6c('0x9')]('TeamVoiceQueue,\x20%s,\x20%s',_0x6c4a37,_0x1e6c('0xb'));_0x21bf7a(_0xe18dae[_0x1e6c('0x12')][_0x1e6c('0x11')]);}})[_0x1e6c('0x13')](function(_0x3e0c94){logger['error'](_0x1e6c('0xa'),_0x6c4a37,_0x3e0c94);_0x37e078(_0x3e0c94);});});} \ No newline at end of file +var _0x9f13=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x426fb9,_0x73b8ed){var _0x2d1760=function(_0x10d531){while(--_0x10d531){_0x426fb9['push'](_0x426fb9['shift']());}};_0x2d1760(++_0x73b8ed);}(_0x9f13,0x1f4));var _0x39f1=function(_0x5b825e,_0x10f033){_0x5b825e=_0x5b825e-0x0;var _0x29f4f2=_0x9f13[_0x5b825e];return _0x29f4f2;};'use strict';var _=require(_0x39f1('0x0'));var util=require(_0x39f1('0x1'));var moment=require(_0x39f1('0x2'));var BPromise=require(_0x39f1('0x3'));var rs=require(_0x39f1('0x4'));var fs=require('fs');var Redis=require(_0x39f1('0x5'));var db=require(_0x39f1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x39f1('0x7'))(_0x39f1('0x8'));var config=require(_0x39f1('0x9'));var jayson=require(_0x39f1('0xa'));var client=jayson[_0x39f1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc40d,_0x34b0ce,_0x456f4a){return new BPromise(function(_0x251c64,_0x5ca760){return client['request'](_0x1bc40d,_0x456f4a)[_0x39f1('0xc')](function(_0x324c83){logger['info'](_0x39f1('0xd'),_0x34b0ce,_0x39f1('0xe'));logger[_0x39f1('0xf')](_0x39f1('0x10'),_0x34b0ce,_0x39f1('0xe'),JSON[_0x39f1('0x11')](_0x324c83));if(_0x324c83[_0x39f1('0x12')]){if(_0x324c83[_0x39f1('0x12')][_0x39f1('0x13')]===0x1f4){logger[_0x39f1('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x34b0ce,_0x324c83[_0x39f1('0x12')]['message']);return _0x5ca760(_0x324c83[_0x39f1('0x12')][_0x39f1('0x14')]);}logger[_0x39f1('0x12')](_0x39f1('0xd'),_0x34b0ce,_0x324c83[_0x39f1('0x12')]['message']);return _0x251c64(_0x324c83[_0x39f1('0x12')][_0x39f1('0x14')]);}else{logger['info'](_0x39f1('0xd'),_0x34b0ce,_0x39f1('0xe'));_0x251c64(_0x324c83[_0x39f1('0x15')]['message']);}})[_0x39f1('0x16')](function(_0x32b571){logger[_0x39f1('0x12')](_0x39f1('0xd'),_0x34b0ce,_0x32b571);_0x5ca760(_0x32b571);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 25bcb6f..8f921fa 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 _0x556a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x2b52a0,_0x46ead2){var _0x8e517c=function(_0x4232fa){while(--_0x4232fa){_0x2b52a0['push'](_0x2b52a0['shift']());}};_0x8e517c(++_0x46ead2);}(_0x556a,0x1dd));var _0xa556=function(_0x375c93,_0x187be1){_0x375c93=_0x375c93-0x0;var _0x517688=_0x556a[_0x375c93];return _0x517688;};'use strict';var multer=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var path=require(_0xa556('0x2'));var timeout=require(_0xa556('0x3'));var express=require(_0xa556('0x4'));var router=express[_0xa556('0x5')]();var fs_extra=require(_0xa556('0x6'));var auth=require(_0xa556('0x7'));var interaction=require(_0xa556('0x8'));var config=require('../../config/environment');var controller=require(_0xa556('0x9'));router[_0xa556('0xa')]('/',auth[_0xa556('0xb')](),controller[_0xa556('0xc')]);router[_0xa556('0xa')]('/:id',auth[_0xa556('0xb')](),controller[_0xa556('0xd')]);router[_0xa556('0xe')]('/',auth[_0xa556('0xb')](),controller['create']);router[_0xa556('0xf')](_0xa556('0x10'),auth[_0xa556('0xb')](),controller[_0xa556('0x11')]);router[_0xa556('0x12')](_0xa556('0x10'),auth[_0xa556('0xb')](),controller[_0xa556('0x13')]);module['exports']=router; \ No newline at end of file +var _0x556a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util','path'];(function(_0xef21e7,_0x1775e7){var _0x5d5014=function(_0x286db1){while(--_0x286db1){_0xef21e7['push'](_0xef21e7['shift']());}};_0x5d5014(++_0x1775e7);}(_0x556a,0x1dd));var _0xa556=function(_0x1665b3,_0x3eea94){_0x1665b3=_0x1665b3-0x0;var _0x248c90=_0x556a[_0x1665b3];return _0x248c90;};'use strict';var multer=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var path=require(_0xa556('0x2'));var timeout=require(_0xa556('0x3'));var express=require(_0xa556('0x4'));var router=express[_0xa556('0x5')]();var fs_extra=require(_0xa556('0x6'));var auth=require(_0xa556('0x7'));var interaction=require(_0xa556('0x8'));var config=require('../../config/environment');var controller=require(_0xa556('0x9'));router[_0xa556('0xa')]('/',auth[_0xa556('0xb')](),controller[_0xa556('0xc')]);router[_0xa556('0xa')]('/:id',auth[_0xa556('0xb')](),controller[_0xa556('0xd')]);router[_0xa556('0xe')]('/',auth[_0xa556('0xb')](),controller['create']);router[_0xa556('0xf')](_0xa556('0x10'),auth[_0xa556('0xb')](),controller[_0xa556('0x11')]);router[_0xa556('0x12')](_0xa556('0x10'),auth[_0xa556('0xb')](),controller[_0xa556('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 5fd1ac1..ddff2a9 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 _0x35dc=['STRING','TEXT','sequelize','exports'];(function(_0x533215,_0x4aeb56){var _0x1b92fb=function(_0x5bad6c){while(--_0x5bad6c){_0x533215['push'](_0x533215['shift']());}};_0x1b92fb(++_0x4aeb56);}(_0x35dc,0x16a));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc35d('0x0'));module[_0xc35d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc35d('0x2')]},'html':{'type':Sequelize[_0xc35d('0x3')]}}; \ No newline at end of file +var _0x5226=['exports','STRING','TEXT'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5226,0xc9));var _0x6522=function(_0x49832d,_0x4d5a4d){_0x49832d=_0x49832d-0x0;var _0x54872f=_0x5226[_0x49832d];return _0x54872f;};'use strict';var Sequelize=require('sequelize');module[_0x6522('0x0')]={'name':{'type':Sequelize[_0x6522('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x6522('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 5fbc526..4faabdd 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 _0xe1ba=['sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','get','Templates','UserProfileResource','destroy','name','index','Template','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','length','nolimit','sort','where','filters','pick','filter','merge','type','options','findAll','rows','show','params','fields','include','find','create','body','user','role','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x506b51,_0x2d2b6d){var _0xca5779=function(_0x5f0fcb){while(--_0x5f0fcb){_0x506b51['push'](_0x506b51['shift']());}};_0xca5779(++_0x2d2b6d);}(_0xe1ba,0x12d));var _0xae1b=function(_0x1501e2,_0x271210){_0x1501e2=_0x1501e2-0x0;var _0xfce8c5=_0xe1ba[_0x1501e2];return _0xfce8c5;};'use strict';var emlformat=require(_0xae1b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae1b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae1b('0x2'));var moment=require(_0xae1b('0x3'));var BPromise=require(_0xae1b('0x4'));var Mustache=require('mustache');var util=require(_0xae1b('0x5'));var path=require(_0xae1b('0x6'));var sox=require(_0xae1b('0x7'));var csv=require(_0xae1b('0x8'));var ejs=require(_0xae1b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae1b('0xa'));var squel=require(_0xae1b('0xb'));var crypto=require(_0xae1b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xae1b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xae1b('0xe'));var Papa=require(_0xae1b('0xf'));var Redis=require(_0xae1b('0x10'));var authService=require(_0xae1b('0x11'));var qs=require(_0xae1b('0x12'));var as=require(_0xae1b('0x13'));var hardwareService=require(_0xae1b('0x14'));var logger=require(_0xae1b('0x15'))(_0xae1b('0x16'));var utils=require(_0xae1b('0x17'));var config=require(_0xae1b('0x18'));var licenseUtil=require(_0xae1b('0x19'));var db=require(_0xae1b('0x1a'))['db'];function respondWithStatusCode(_0x54b6f7,_0x18cc89){_0x18cc89=_0x18cc89||0xcc;return function(_0x5eaaa1){if(_0x5eaaa1){return _0x54b6f7[_0xae1b('0x1b')](_0x18cc89);}return _0x54b6f7[_0xae1b('0x1c')](_0x18cc89)[_0xae1b('0x1d')]();};}function respondWithResult(_0x4bcced,_0x27d99f){_0x27d99f=_0x27d99f||0xc8;return function(_0x3a9cf6){if(_0x3a9cf6){return _0x4bcced[_0xae1b('0x1c')](_0x27d99f)[_0xae1b('0x1e')](_0x3a9cf6);}};}function respondWithFilteredResult(_0x42e495,_0x2eea89){return function(_0x1c4e54){if(_0x1c4e54){var _0x1b6550=typeof _0x2eea89[_0xae1b('0x1f')]==='undefined'&&typeof _0x2eea89[_0xae1b('0x20')]==='undefined';var _0x15a602=_0x1c4e54[_0xae1b('0x21')];var _0x18e31f=_0x1b6550?0x0:_0x2eea89[_0xae1b('0x1f')];var _0x33f6bf=_0x1b6550?_0x1c4e54[_0xae1b('0x21')]:_0x2eea89[_0xae1b('0x1f')]+_0x2eea89[_0xae1b('0x20')];var _0x167ec0;if(_0x33f6bf>=_0x15a602){_0x33f6bf=_0x15a602;_0x167ec0=0xc8;}else{_0x167ec0=0xce;}_0x42e495[_0xae1b('0x1c')](_0x167ec0);return _0x42e495[_0xae1b('0x22')](_0xae1b('0x23'),_0x18e31f+'-'+_0x33f6bf+'/'+_0x15a602)[_0xae1b('0x1e')](_0x1c4e54);}return null;};}function patchUpdates(_0x42d212){return function(_0x546909){try{jsonpatch[_0xae1b('0x24')](_0x546909,_0x42d212,!![]);}catch(_0x3088da){return BPromise[_0xae1b('0x25')](_0x3088da);}return _0x546909[_0xae1b('0x26')]();};}function saveUpdates(_0x11dd1f,_0x37fb59){return function(_0x9fd77){if(_0x9fd77){return _0x9fd77['update'](_0x11dd1f)[_0xae1b('0x27')](function(_0x36f211){return _0x36f211;});}return null;};}function removeEntity(_0x392978,_0x3a3f1e){return function(_0x51d1be){if(_0x51d1be){return _0x51d1be['destroy']()[_0xae1b('0x27')](function(){var _0x2e3b61=_0x51d1be[_0xae1b('0x28')]({'plain':!![]});var _0x2c0ca9=_0xae1b('0x29');return db[_0xae1b('0x2a')][_0xae1b('0x2b')]({'where':{'type':_0x2c0ca9,'resourceId':_0x2e3b61['id']}})[_0xae1b('0x27')](function(){return _0x51d1be;});})[_0xae1b('0x27')](function(){_0x392978[_0xae1b('0x1c')](0xcc)[_0xae1b('0x1d')]();});}};}function handleEntityNotFound(_0x17e755,_0x33836c){return function(_0x39f1f8){if(!_0x39f1f8){_0x17e755[_0xae1b('0x1b')](0x194);}return _0x39f1f8;};}function handleError(_0x1fc636,_0x40165a){_0x40165a=_0x40165a||0x1f4;return function(_0x5dc3a8){logger['error'](_0x5dc3a8['stack']);if(_0x5dc3a8[_0xae1b('0x2c')]){delete _0x5dc3a8['name'];}_0x1fc636[_0xae1b('0x1c')](_0x40165a)['send'](_0x5dc3a8);};}exports[_0xae1b('0x2d')]=function(_0x1eaf58,_0x43ef92){var _0x177faf={},_0x1d8d11={},_0x5178b9={'count':0x0,'rows':[]};var _0x50fd2c=_['map'](db[_0xae1b('0x2e')][_0xae1b('0x2f')],function(_0x1b8a60){return{'name':_0x1b8a60[_0xae1b('0x30')],'type':_0x1b8a60['type'][_0xae1b('0x31')]};});_0x1d8d11[_0xae1b('0x32')]=_[_0xae1b('0x33')](_0x50fd2c,_0xae1b('0x2c'));_0x1d8d11[_0xae1b('0x34')]=_[_0xae1b('0x35')](_0x1eaf58[_0xae1b('0x34')]);_0x1d8d11['filters']=_[_0xae1b('0x36')](_0x1d8d11[_0xae1b('0x32')],_0x1d8d11[_0xae1b('0x34')]);_0x177faf[_0xae1b('0x37')]=_['intersection'](_0x1d8d11[_0xae1b('0x32')],qs['fields'](_0x1eaf58['query']['fields']));_0x177faf['attributes']=_0x177faf['attributes'][_0xae1b('0x38')]?_0x177faf[_0xae1b('0x37')]:_0x1d8d11['model'];if(!_0x1eaf58['query']['hasOwnProperty'](_0xae1b('0x39'))){_0x177faf[_0xae1b('0x20')]=qs[_0xae1b('0x20')](_0x1eaf58[_0xae1b('0x34')][_0xae1b('0x20')]);_0x177faf[_0xae1b('0x1f')]=qs[_0xae1b('0x1f')](_0x1eaf58[_0xae1b('0x34')][_0xae1b('0x1f')]);}_0x177faf['order']=qs[_0xae1b('0x3a')](_0x1eaf58['query'][_0xae1b('0x3a')]);_0x177faf[_0xae1b('0x3b')]=qs[_0xae1b('0x3c')](_[_0xae1b('0x3d')](_0x1eaf58['query'],_0x1d8d11[_0xae1b('0x3c')]),_0x50fd2c);if(_0x1eaf58[_0xae1b('0x34')][_0xae1b('0x3e')]){_0x177faf[_0xae1b('0x3b')]=_[_0xae1b('0x3f')](_0x177faf[_0xae1b('0x3b')],{'$or':_['map'](_0x50fd2c,function(_0x6b5f03){if(_0x6b5f03[_0xae1b('0x40')]!=='VIRTUAL'){var _0x340803={};_0x340803[_0x6b5f03[_0xae1b('0x2c')]]={'$like':'%'+_0x1eaf58[_0xae1b('0x34')][_0xae1b('0x3e')]+'%'};return _0x340803;}})});}_0x177faf=_[_0xae1b('0x3f')]({},_0x177faf,_0x1eaf58[_0xae1b('0x41')]);var _0x538ef0={'where':_0x177faf[_0xae1b('0x3b')]};return db[_0xae1b('0x2e')]['count'](_0x538ef0)['then'](function(_0x3ed670){_0x5178b9[_0xae1b('0x21')]=_0x3ed670;if(_0x1eaf58['query']['includeAll']){_0x177faf['include']=[{'all':!![]}];}return db[_0xae1b('0x2e')][_0xae1b('0x42')](_0x177faf);})[_0xae1b('0x27')](function(_0x1ab90c){_0x5178b9[_0xae1b('0x43')]=_0x1ab90c;return _0x5178b9;})[_0xae1b('0x27')](respondWithFilteredResult(_0x43ef92,_0x177faf))['catch'](handleError(_0x43ef92,null));};exports[_0xae1b('0x44')]=function(_0x343bf6,_0x598a38){var _0x39a160={'raw':!![],'where':{'id':_0x343bf6[_0xae1b('0x45')]['id']}},_0x47fa57={};_0x47fa57[_0xae1b('0x32')]=_[_0xae1b('0x35')](db['Template'][_0xae1b('0x2f')]);_0x47fa57[_0xae1b('0x34')]=_[_0xae1b('0x35')](_0x343bf6[_0xae1b('0x34')]);_0x47fa57[_0xae1b('0x3c')]=_[_0xae1b('0x36')](_0x47fa57[_0xae1b('0x32')],_0x47fa57[_0xae1b('0x34')]);_0x39a160[_0xae1b('0x37')]=_[_0xae1b('0x36')](_0x47fa57[_0xae1b('0x32')],qs[_0xae1b('0x46')](_0x343bf6[_0xae1b('0x34')][_0xae1b('0x46')]));_0x39a160[_0xae1b('0x37')]=_0x39a160[_0xae1b('0x37')]['length']?_0x39a160[_0xae1b('0x37')]:_0x47fa57[_0xae1b('0x32')];if(_0x343bf6['query']['includeAll']){_0x39a160[_0xae1b('0x47')]=[{'all':!![]}];}_0x39a160=_[_0xae1b('0x3f')]({},_0x39a160,_0x343bf6[_0xae1b('0x41')]);return db[_0xae1b('0x2e')][_0xae1b('0x48')](_0x39a160)[_0xae1b('0x27')](handleEntityNotFound(_0x598a38,null))[_0xae1b('0x27')](respondWithResult(_0x598a38,null))['catch'](handleError(_0x598a38,null));};exports[_0xae1b('0x49')]=function(_0xebda8,_0x369b24){return db[_0xae1b('0x2e')]['create'](_0xebda8[_0xae1b('0x4a')],{})['then'](function(_0xce1530){var _0xcee88d=_0xebda8[_0xae1b('0x4b')][_0xae1b('0x28')]({'plain':!![]});if(!_0xcee88d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcee88d[_0xae1b('0x4c')]==='user'){var _0x181b54=_0xce1530[_0xae1b('0x28')]({'plain':!![]});var _0x1f769c=_0xae1b('0x29');return db['UserProfileSection'][_0xae1b('0x48')]({'where':{'name':_0x1f769c,'userProfileId':_0xcee88d['userProfileId']},'raw':!![]})['then'](function(_0x4d0701){if(_0x4d0701&&_0x4d0701[_0xae1b('0x4d')]===0x0){return db[_0xae1b('0x2a')][_0xae1b('0x49')]({'name':_0x181b54[_0xae1b('0x2c')],'resourceId':_0x181b54['id'],'type':_0x4d0701[_0xae1b('0x2c')],'sectionId':_0x4d0701['id']},{})['then'](function(){return _0xce1530;});}else{return _0xce1530;}})[_0xae1b('0x4e')](function(_0x3352e5){logger[_0xae1b('0x4f')](_0xae1b('0x50'),_0x3352e5);throw _0x3352e5;});}return _0xce1530;})[_0xae1b('0x27')](respondWithResult(_0x369b24,0xc9))[_0xae1b('0x4e')](handleError(_0x369b24,null));};exports[_0xae1b('0x51')]=function(_0x446a7d,_0x4ce416){if(_0x446a7d[_0xae1b('0x4a')]['id']){delete _0x446a7d[_0xae1b('0x4a')]['id'];}return db[_0xae1b('0x2e')]['find']({'where':{'id':_0x446a7d['params']['id']}})[_0xae1b('0x27')](handleEntityNotFound(_0x4ce416,null))['then'](saveUpdates(_0x446a7d[_0xae1b('0x4a')],null))[_0xae1b('0x27')](respondWithResult(_0x4ce416,null))[_0xae1b('0x4e')](handleError(_0x4ce416,null));};exports[_0xae1b('0x2b')]=function(_0x30722c,_0x2af253){return db[_0xae1b('0x2e')][_0xae1b('0x48')]({'where':{'id':_0x30722c[_0xae1b('0x45')]['id']}})[_0xae1b('0x27')](handleEntityNotFound(_0x2af253,null))[_0xae1b('0x27')](removeEntity(_0x2af253,null))[_0xae1b('0x4e')](handleError(_0x2af253,null));}; \ No newline at end of file +var _0x3aee=['count','offset','limit','set','Content-Range','reject','save','then','destroy','get','Templates','UserProfileResource','end','stack','Template','rawAttributes','fieldName','model','map','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined'];(function(_0x3f5e54,_0x2f6de9){var _0x4fae6c=function(_0x5ed5e2){while(--_0x5ed5e2){_0x3f5e54['push'](_0x3f5e54['shift']());}};_0x4fae6c(++_0x2f6de9);}(_0x3aee,0x1ea));var _0xe3ae=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x3aee[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xe3ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3ae('0x1'));var jsonpatch=require(_0xe3ae('0x2'));var rp=require(_0xe3ae('0x3'));var moment=require(_0xe3ae('0x4'));var BPromise=require(_0xe3ae('0x5'));var Mustache=require('mustache');var util=require(_0xe3ae('0x6'));var path=require(_0xe3ae('0x7'));var sox=require(_0xe3ae('0x8'));var csv=require(_0xe3ae('0x9'));var ejs=require(_0xe3ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3ae('0xb'));var squel=require(_0xe3ae('0xc'));var crypto=require(_0xe3ae('0xd'));var jsforce=require(_0xe3ae('0xe'));var deskjs=require(_0xe3ae('0xf'));var toCsv=require(_0xe3ae('0x9'));var querystring=require(_0xe3ae('0x10'));var Papa=require(_0xe3ae('0x11'));var Redis=require(_0xe3ae('0x12'));var authService=require(_0xe3ae('0x13'));var qs=require(_0xe3ae('0x14'));var as=require(_0xe3ae('0x15'));var hardwareService=require(_0xe3ae('0x16'));var logger=require(_0xe3ae('0x17'))(_0xe3ae('0x18'));var utils=require(_0xe3ae('0x19'));var config=require(_0xe3ae('0x1a'));var licenseUtil=require(_0xe3ae('0x1b'));var db=require(_0xe3ae('0x1c'))['db'];function respondWithStatusCode(_0x5b338d,_0x474f63){_0x474f63=_0x474f63||0xcc;return function(_0x396763){if(_0x396763){return _0x5b338d['sendStatus'](_0x474f63);}return _0x5b338d[_0xe3ae('0x1d')](_0x474f63)['end']();};}function respondWithResult(_0x5e8d92,_0x37f02f){_0x37f02f=_0x37f02f||0xc8;return function(_0x4d4628){if(_0x4d4628){return _0x5e8d92[_0xe3ae('0x1d')](_0x37f02f)[_0xe3ae('0x1e')](_0x4d4628);}};}function respondWithFilteredResult(_0x1d208c,_0x43b66a){return function(_0x37e9f1){if(_0x37e9f1){var _0x5e6d5e=typeof _0x43b66a['offset']===_0xe3ae('0x1f')&&typeof _0x43b66a['limit']==='undefined';var _0x3ee395=_0x37e9f1[_0xe3ae('0x20')];var _0x50c841=_0x5e6d5e?0x0:_0x43b66a['offset'];var _0x53e363=_0x5e6d5e?_0x37e9f1['count']:_0x43b66a[_0xe3ae('0x21')]+_0x43b66a[_0xe3ae('0x22')];var _0x1aa1a5;if(_0x53e363>=_0x3ee395){_0x53e363=_0x3ee395;_0x1aa1a5=0xc8;}else{_0x1aa1a5=0xce;}_0x1d208c[_0xe3ae('0x1d')](_0x1aa1a5);return _0x1d208c[_0xe3ae('0x23')](_0xe3ae('0x24'),_0x50c841+'-'+_0x53e363+'/'+_0x3ee395)[_0xe3ae('0x1e')](_0x37e9f1);}return null;};}function patchUpdates(_0x57e890){return function(_0x2aba55){try{jsonpatch['apply'](_0x2aba55,_0x57e890,!![]);}catch(_0x148e54){return BPromise[_0xe3ae('0x25')](_0x148e54);}return _0x2aba55[_0xe3ae('0x26')]();};}function saveUpdates(_0x45380d,_0x3ee65c){return function(_0xd44bf8){if(_0xd44bf8){return _0xd44bf8['update'](_0x45380d)[_0xe3ae('0x27')](function(_0x48dd95){return _0x48dd95;});}return null;};}function removeEntity(_0x1966eb,_0x52fb5a){return function(_0x2b7edc){if(_0x2b7edc){return _0x2b7edc[_0xe3ae('0x28')]()[_0xe3ae('0x27')](function(){var _0x1fb544=_0x2b7edc[_0xe3ae('0x29')]({'plain':!![]});var _0x24ecc1=_0xe3ae('0x2a');return db[_0xe3ae('0x2b')]['destroy']({'where':{'type':_0x24ecc1,'resourceId':_0x1fb544['id']}})[_0xe3ae('0x27')](function(){return _0x2b7edc;});})[_0xe3ae('0x27')](function(){_0x1966eb[_0xe3ae('0x1d')](0xcc)[_0xe3ae('0x2c')]();});}};}function handleEntityNotFound(_0xac6ec6,_0x1f63cb){return function(_0x2e548a){if(!_0x2e548a){_0xac6ec6['sendStatus'](0x194);}return _0x2e548a;};}function handleError(_0x40282d,_0x2a80bc){_0x2a80bc=_0x2a80bc||0x1f4;return function(_0x592208){logger['error'](_0x592208[_0xe3ae('0x2d')]);if(_0x592208['name']){delete _0x592208['name'];}_0x40282d[_0xe3ae('0x1d')](_0x2a80bc)['send'](_0x592208);};}exports['index']=function(_0x194d32,_0xa2e754){var _0x2f6d2a={},_0xeb3334={},_0x144ed2={'count':0x0,'rows':[]};var _0x37ec68=_['map'](db[_0xe3ae('0x2e')][_0xe3ae('0x2f')],function(_0x352e3b){return{'name':_0x352e3b[_0xe3ae('0x30')],'type':_0x352e3b['type']['key']};});_0xeb3334[_0xe3ae('0x31')]=_[_0xe3ae('0x32')](_0x37ec68,_0xe3ae('0x33'));_0xeb3334[_0xe3ae('0x34')]=_['keys'](_0x194d32[_0xe3ae('0x34')]);_0xeb3334[_0xe3ae('0x35')]=_['intersection'](_0xeb3334[_0xe3ae('0x31')],_0xeb3334[_0xe3ae('0x34')]);_0x2f6d2a[_0xe3ae('0x36')]=_[_0xe3ae('0x37')](_0xeb3334[_0xe3ae('0x31')],qs[_0xe3ae('0x38')](_0x194d32['query'][_0xe3ae('0x38')]));_0x2f6d2a[_0xe3ae('0x36')]=_0x2f6d2a[_0xe3ae('0x36')][_0xe3ae('0x39')]?_0x2f6d2a[_0xe3ae('0x36')]:_0xeb3334[_0xe3ae('0x31')];if(!_0x194d32['query'][_0xe3ae('0x3a')](_0xe3ae('0x3b'))){_0x2f6d2a[_0xe3ae('0x22')]=qs[_0xe3ae('0x22')](_0x194d32[_0xe3ae('0x34')][_0xe3ae('0x22')]);_0x2f6d2a[_0xe3ae('0x21')]=qs[_0xe3ae('0x21')](_0x194d32[_0xe3ae('0x34')]['offset']);}_0x2f6d2a[_0xe3ae('0x3c')]=qs[_0xe3ae('0x3d')](_0x194d32[_0xe3ae('0x34')]['sort']);_0x2f6d2a[_0xe3ae('0x3e')]=qs[_0xe3ae('0x35')](_[_0xe3ae('0x3f')](_0x194d32[_0xe3ae('0x34')],_0xeb3334[_0xe3ae('0x35')]),_0x37ec68);if(_0x194d32['query'][_0xe3ae('0x40')]){_0x2f6d2a['where']=_['merge'](_0x2f6d2a[_0xe3ae('0x3e')],{'$or':_[_0xe3ae('0x32')](_0x37ec68,function(_0x332d4c){if(_0x332d4c[_0xe3ae('0x41')]!==_0xe3ae('0x42')){var _0x3344f1={};_0x3344f1[_0x332d4c[_0xe3ae('0x33')]]={'$like':'%'+_0x194d32[_0xe3ae('0x34')][_0xe3ae('0x40')]+'%'};return _0x3344f1;}})});}_0x2f6d2a=_[_0xe3ae('0x43')]({},_0x2f6d2a,_0x194d32[_0xe3ae('0x44')]);var _0x38268a={'where':_0x2f6d2a['where']};return db[_0xe3ae('0x2e')][_0xe3ae('0x20')](_0x38268a)[_0xe3ae('0x27')](function(_0x311e81){_0x144ed2[_0xe3ae('0x20')]=_0x311e81;if(_0x194d32['query']['includeAll']){_0x2f6d2a[_0xe3ae('0x45')]=[{'all':!![]}];}return db[_0xe3ae('0x2e')][_0xe3ae('0x46')](_0x2f6d2a);})[_0xe3ae('0x27')](function(_0x27aaa1){_0x144ed2[_0xe3ae('0x47')]=_0x27aaa1;return _0x144ed2;})[_0xe3ae('0x27')](respondWithFilteredResult(_0xa2e754,_0x2f6d2a))[_0xe3ae('0x48')](handleError(_0xa2e754,null));};exports['show']=function(_0x3d8155,_0x1d70f9){var _0x37685d={'raw':!![],'where':{'id':_0x3d8155['params']['id']}},_0x417124={};_0x417124['model']=_['keys'](db[_0xe3ae('0x2e')]['rawAttributes']);_0x417124[_0xe3ae('0x34')]=_['keys'](_0x3d8155[_0xe3ae('0x34')]);_0x417124[_0xe3ae('0x35')]=_['intersection'](_0x417124[_0xe3ae('0x31')],_0x417124[_0xe3ae('0x34')]);_0x37685d[_0xe3ae('0x36')]=_[_0xe3ae('0x37')](_0x417124[_0xe3ae('0x31')],qs[_0xe3ae('0x38')](_0x3d8155[_0xe3ae('0x34')]['fields']));_0x37685d['attributes']=_0x37685d[_0xe3ae('0x36')][_0xe3ae('0x39')]?_0x37685d[_0xe3ae('0x36')]:_0x417124[_0xe3ae('0x31')];if(_0x3d8155[_0xe3ae('0x34')][_0xe3ae('0x49')]){_0x37685d[_0xe3ae('0x45')]=[{'all':!![]}];}_0x37685d=_['merge']({},_0x37685d,_0x3d8155['options']);return db[_0xe3ae('0x2e')][_0xe3ae('0x4a')](_0x37685d)[_0xe3ae('0x27')](handleEntityNotFound(_0x1d70f9,null))[_0xe3ae('0x27')](respondWithResult(_0x1d70f9,null))['catch'](handleError(_0x1d70f9,null));};exports[_0xe3ae('0x4b')]=function(_0x43b020,_0x2536ca){return db[_0xe3ae('0x2e')][_0xe3ae('0x4b')](_0x43b020[_0xe3ae('0x4c')],{})[_0xe3ae('0x27')](function(_0x192dc6){var _0x757727=_0x43b020[_0xe3ae('0x4d')][_0xe3ae('0x29')]({'plain':!![]});if(!_0x757727)throw new Error(_0xe3ae('0x4e'));if(_0x757727[_0xe3ae('0x4f')]===_0xe3ae('0x4d')){var _0x58c61a=_0x192dc6[_0xe3ae('0x29')]({'plain':!![]});var _0x1f9c91=_0xe3ae('0x2a');return db[_0xe3ae('0x50')][_0xe3ae('0x4a')]({'where':{'name':_0x1f9c91,'userProfileId':_0x757727[_0xe3ae('0x51')]},'raw':!![]})[_0xe3ae('0x27')](function(_0x41b0e6){if(_0x41b0e6&&_0x41b0e6[_0xe3ae('0x52')]===0x0){return db['UserProfileResource'][_0xe3ae('0x4b')]({'name':_0x58c61a[_0xe3ae('0x33')],'resourceId':_0x58c61a['id'],'type':_0x41b0e6[_0xe3ae('0x33')],'sectionId':_0x41b0e6['id']},{})[_0xe3ae('0x27')](function(){return _0x192dc6;});}else{return _0x192dc6;}})[_0xe3ae('0x48')](function(_0x37c933){logger[_0xe3ae('0x53')](_0xe3ae('0x54'),_0x37c933);throw _0x37c933;});}return _0x192dc6;})[_0xe3ae('0x27')](respondWithResult(_0x2536ca,0xc9))[_0xe3ae('0x48')](handleError(_0x2536ca,null));};exports[_0xe3ae('0x55')]=function(_0x3f7cfa,_0xed6510){if(_0x3f7cfa['body']['id']){delete _0x3f7cfa['body']['id'];}return db['Template'][_0xe3ae('0x4a')]({'where':{'id':_0x3f7cfa['params']['id']}})[_0xe3ae('0x27')](handleEntityNotFound(_0xed6510,null))[_0xe3ae('0x27')](saveUpdates(_0x3f7cfa[_0xe3ae('0x4c')],null))[_0xe3ae('0x27')](respondWithResult(_0xed6510,null))[_0xe3ae('0x48')](handleError(_0xed6510,null));};exports[_0xe3ae('0x28')]=function(_0x42fc35,_0x4e36a3){return db['Template'][_0xe3ae('0x4a')]({'where':{'id':_0x42fc35[_0xe3ae('0x56')]['id']}})[_0xe3ae('0x27')](handleEntityNotFound(_0x4e36a3,null))[_0xe3ae('0x27')](removeEntity(_0x4e36a3,null))['catch'](handleError(_0x4e36a3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index cd1b978..43091fa 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 _0x5414=['rimraf','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5326f3,_0xade490){var _0x394455=function(_0x52534c){while(--_0x52534c){_0x5326f3['push'](_0x5326f3['shift']());}};_0x394455(++_0xade490);}(_0x5414,0xf5));var _0x4541=function(_0x2a8cdf,_0xeb422){_0x2a8cdf=_0x2a8cdf-0x0;var _0x3328c4=_0x5414[_0x2a8cdf];return _0x3328c4;};'use strict';var _=require(_0x4541('0x0'));var util=require(_0x4541('0x1'));var logger=require(_0x4541('0x2'))(_0x4541('0x3'));var moment=require(_0x4541('0x4'));var BPromise=require(_0x4541('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4541('0x6'));var rimraf=require(_0x4541('0x7'));var config=require('../../config/environment');var attributes=require(_0x4541('0x8'));module[_0x4541('0x9')]=function(_0x325c7e,_0x5c7d61){return _0x325c7e[_0x4541('0xa')]('Template',attributes,{'tableName':_0x4541('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fa3=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates'];(function(_0x401fa3,_0x30620a){var _0x5f3885=function(_0x18533f){while(--_0x18533f){_0x401fa3['push'](_0x401fa3['shift']());}};_0x5f3885(++_0x30620a);}(_0x9fa3,0x1a4));var _0x39fa=function(_0x22e473,_0x20e334){_0x22e473=_0x22e473-0x0;var _0x5966d3=_0x9fa3[_0x22e473];return _0x5966d3;};'use strict';var _=require(_0x39fa('0x0'));var util=require('util');var logger=require(_0x39fa('0x1'))(_0x39fa('0x2'));var moment=require(_0x39fa('0x3'));var BPromise=require(_0x39fa('0x4'));var rp=require(_0x39fa('0x5'));var fs=require('fs');var path=require(_0x39fa('0x6'));var rimraf=require(_0x39fa('0x7'));var config=require(_0x39fa('0x8'));var attributes=require(_0x39fa('0x9'));module[_0x39fa('0xa')]=function(_0x339220,_0x1b8389){return _0x339220[_0x39fa('0xb')](_0x39fa('0xc'),attributes,{'tableName':_0x39fa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 4ae104a..027f833 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 _0xf642=['attributes','GetTemplate','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Template','findAll','options','raw','where','map','include','model'];(function(_0x1ff79e,_0x24dfb4){var _0x215316=function(_0x2352f6){while(--_0x2352f6){_0x1ff79e['push'](_0x1ff79e['shift']());}};_0x215316(++_0x24dfb4);}(_0xf642,0xbc));var _0x2f64=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xf642[_0x56daff];return _0x132c82;};'use strict';var _=require(_0x2f64('0x0'));var util=require(_0x2f64('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f64('0x2'));var db=require(_0x2f64('0x3'))['db'];var utils=require(_0x2f64('0x4'));var logger=require(_0x2f64('0x5'))(_0x2f64('0x6'));var config=require(_0x2f64('0x7'));var jayson=require(_0x2f64('0x8'));var client=jayson[_0x2f64('0x9')][_0x2f64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x467c32,_0x2a011e,_0x99bd74){return new BPromise(function(_0x455702,_0x2581b2){return client['request'](_0x467c32,_0x99bd74)[_0x2f64('0xb')](function(_0x5c6cb8){logger[_0x2f64('0xc')](_0x2f64('0xd'),_0x2a011e,_0x2f64('0xe'));logger[_0x2f64('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x2a011e,_0x2f64('0xe'),JSON[_0x2f64('0x10')](_0x5c6cb8));if(_0x5c6cb8[_0x2f64('0x11')]){if(_0x5c6cb8[_0x2f64('0x11')]['code']===0x1f4){logger[_0x2f64('0x11')]('Template,\x20%s,\x20%s',_0x2a011e,_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);return _0x2581b2(_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);}logger['error'](_0x2f64('0xd'),_0x2a011e,_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);return _0x455702(_0x5c6cb8[_0x2f64('0x11')][_0x2f64('0x12')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x2a011e,_0x2f64('0xe'));_0x455702(_0x5c6cb8[_0x2f64('0x13')]['message']);}})[_0x2f64('0x14')](function(_0x112e3a){logger[_0x2f64('0x11')](_0x2f64('0xd'),_0x2a011e,_0x112e3a);_0x2581b2(_0x112e3a);});});}exports['GetTemplate']=function(_0x57c3d3){var _0x3cd409=this;return new Promise(function(_0x230423,_0x4a8318){return db[_0x2f64('0x15')][_0x2f64('0x16')]({'raw':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3[_0x2f64('0x17')][_0x2f64('0x18')]===undefined?!![]:![]:!![],'where':_0x57c3d3['options']?_0x57c3d3[_0x2f64('0x17')][_0x2f64('0x19')]||null:null,'attributes':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3[_0x2f64('0x17')]['attributes']||null:null,'limit':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3['options']['limit']||null:null,'include':_0x57c3d3[_0x2f64('0x17')]?_0x57c3d3['options']['include']?_[_0x2f64('0x1a')](_0x57c3d3[_0x2f64('0x17')][_0x2f64('0x1b')],function(_0x392619){return{'model':db[_0x392619[_0x2f64('0x1c')]],'as':_0x392619['as'],'attributes':_0x392619[_0x2f64('0x1d')],'include':_0x392619[_0x2f64('0x1b')]?_[_0x2f64('0x1a')](_0x392619[_0x2f64('0x1b')],function(_0x44ed92){return{'model':db[_0x44ed92['model']],'as':_0x44ed92['as'],'attributes':_0x44ed92[_0x2f64('0x1d')],'include':_0x44ed92[_0x2f64('0x1b')]?_[_0x2f64('0x1a')](_0x44ed92['include'],function(_0x340475){return{'model':db[_0x340475[_0x2f64('0x1c')]],'as':_0x340475['as'],'attributes':_0x340475['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f64('0xb')](function(_0x15774e){logger[_0x2f64('0xc')]('GetTemplate',_0x57c3d3);logger[_0x2f64('0xf')](_0x2f64('0x1e'),_0x57c3d3,JSON[_0x2f64('0x10')](_0x15774e));_0x230423(_0x15774e);})[_0x2f64('0x14')](function(_0x118308){logger['error'](_0x2f64('0x1e'),_0x118308[_0x2f64('0x12')],_0x57c3d3);_0x4a8318(_0x3cd409['error'](0x1f4,_0x118308[_0x2f64('0x12')]));});});}; \ No newline at end of file +var _0x30c7=['map','model','GetTemplate','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Template','findAll','options','raw','where','attributes','include'];(function(_0x88edb9,_0x364958){var _0x349211=function(_0x537803){while(--_0x537803){_0x88edb9['push'](_0x88edb9['shift']());}};_0x349211(++_0x364958);}(_0x30c7,0x111));var _0x730c=function(_0xd1a1f1,_0x12971c){_0xd1a1f1=_0xd1a1f1-0x0;var _0x6f687f=_0x30c7[_0xd1a1f1];return _0x6f687f;};'use strict';var _=require(_0x730c('0x0'));var util=require('util');var moment=require(_0x730c('0x1'));var BPromise=require(_0x730c('0x2'));var rs=require(_0x730c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x730c('0x4'))['db'];var utils=require(_0x730c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x730c('0x6')][_0x730c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5748ab,_0x11b5a8,_0x2ed29c){return new BPromise(function(_0x6022ae,_0x4b6e23){return client[_0x730c('0x8')](_0x5748ab,_0x2ed29c)[_0x730c('0x9')](function(_0x48b4f7){logger[_0x730c('0xa')](_0x730c('0xb'),_0x11b5a8,_0x730c('0xc'));logger[_0x730c('0xd')](_0x730c('0xe'),_0x11b5a8,_0x730c('0xc'),JSON[_0x730c('0xf')](_0x48b4f7));if(_0x48b4f7['error']){if(_0x48b4f7[_0x730c('0x10')][_0x730c('0x11')]===0x1f4){logger[_0x730c('0x10')](_0x730c('0xb'),_0x11b5a8,_0x48b4f7['error'][_0x730c('0x12')]);return _0x4b6e23(_0x48b4f7[_0x730c('0x10')][_0x730c('0x12')]);}logger[_0x730c('0x10')](_0x730c('0xb'),_0x11b5a8,_0x48b4f7[_0x730c('0x10')][_0x730c('0x12')]);return _0x6022ae(_0x48b4f7[_0x730c('0x10')][_0x730c('0x12')]);}else{logger[_0x730c('0xa')](_0x730c('0xb'),_0x11b5a8,'request\x20sent');_0x6022ae(_0x48b4f7['result']['message']);}})[_0x730c('0x13')](function(_0x2242e4){logger[_0x730c('0x10')](_0x730c('0xb'),_0x11b5a8,_0x2242e4);_0x4b6e23(_0x2242e4);});});}exports['GetTemplate']=function(_0x3b3fda){var _0x39a2be=this;return new Promise(function(_0xbeb3fe,_0x16038a){return db[_0x730c('0x14')][_0x730c('0x15')]({'raw':_0x3b3fda[_0x730c('0x16')]?_0x3b3fda[_0x730c('0x16')][_0x730c('0x17')]===undefined?!![]:![]:!![],'where':_0x3b3fda[_0x730c('0x16')]?_0x3b3fda['options'][_0x730c('0x18')]||null:null,'attributes':_0x3b3fda[_0x730c('0x16')]?_0x3b3fda[_0x730c('0x16')][_0x730c('0x19')]||null:null,'limit':_0x3b3fda[_0x730c('0x16')]?_0x3b3fda[_0x730c('0x16')]['limit']||null:null,'include':_0x3b3fda[_0x730c('0x16')]?_0x3b3fda[_0x730c('0x16')][_0x730c('0x1a')]?_[_0x730c('0x1b')](_0x3b3fda[_0x730c('0x16')][_0x730c('0x1a')],function(_0x3145be){return{'model':db[_0x3145be[_0x730c('0x1c')]],'as':_0x3145be['as'],'attributes':_0x3145be['attributes'],'include':_0x3145be['include']?_['map'](_0x3145be[_0x730c('0x1a')],function(_0xea1cfd){return{'model':db[_0xea1cfd[_0x730c('0x1c')]],'as':_0xea1cfd['as'],'attributes':_0xea1cfd[_0x730c('0x19')],'include':_0xea1cfd[_0x730c('0x1a')]?_['map'](_0xea1cfd['include'],function(_0x984a84){return{'model':db[_0x984a84['model']],'as':_0x984a84['as'],'attributes':_0x984a84['attributes']};}):[]};}):[]};}):[]:[]})[_0x730c('0x9')](function(_0x1c7a00){logger[_0x730c('0xa')](_0x730c('0x1d'),_0x3b3fda);logger['debug'](_0x730c('0x1d'),_0x3b3fda,JSON[_0x730c('0xf')](_0x1c7a00));_0xbeb3fe(_0x1c7a00);})[_0x730c('0x13')](function(_0x3fdb87){logger[_0x730c('0x10')](_0x730c('0x1d'),_0x3fdb87[_0x730c('0x12')],_0x3b3fda);_0x16038a(_0x39a2be[_0x730c('0x10')](0x1f4,_0x3fdb87[_0x730c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d902bf8..95a75ba 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 _0x6e8b=['get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller'];(function(_0x178142,_0x3d53dc){var _0x3435f7=function(_0x49d42c){while(--_0x49d42c){_0x178142['push'](_0x178142['shift']());}};_0x3435f7(++_0x3d53dc);}(_0x6e8b,0x156));var _0xb6e8=function(_0x2c2c63,_0x4239f9){_0x2c2c63=_0x2c2c63-0x0;var _0x55cefe=_0x6e8b[_0x2c2c63];return _0x55cefe;};'use strict';var multer=require(_0xb6e8('0x0'));var util=require('util');var path=require(_0xb6e8('0x1'));var timeout=require(_0xb6e8('0x2'));var express=require('express');var router=express[_0xb6e8('0x3')]();var fs_extra=require(_0xb6e8('0x4'));var auth=require(_0xb6e8('0x5'));var interaction=require(_0xb6e8('0x6'));var config=require(_0xb6e8('0x7'));var controller=require(_0xb6e8('0x8'));router[_0xb6e8('0x9')]('/',auth[_0xb6e8('0xa')](),controller[_0xb6e8('0xb')]);router[_0xb6e8('0x9')](_0xb6e8('0xc'),auth[_0xb6e8('0xa')](),controller['show']);router[_0xb6e8('0x9')]('/:id/all_conditions',auth[_0xb6e8('0xa')](),controller[_0xb6e8('0xd')]);router[_0xb6e8('0x9')](_0xb6e8('0xe'),auth[_0xb6e8('0xa')](),controller[_0xb6e8('0xf')]);router[_0xb6e8('0x9')](_0xb6e8('0x10'),auth[_0xb6e8('0xa')](),controller['getActions']);router[_0xb6e8('0x11')]('/',auth[_0xb6e8('0xa')](),controller[_0xb6e8('0x12')]);router['post'](_0xb6e8('0x13'),auth[_0xb6e8('0xa')](),controller[_0xb6e8('0x14')]);router[_0xb6e8('0x11')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xb6e8('0x15')]);router[_0xb6e8('0x11')](_0xb6e8('0x10'),auth['isAuthenticated'](),controller[_0xb6e8('0x16')]);router[_0xb6e8('0x17')](_0xb6e8('0xc'),auth['isAuthenticated'](),controller[_0xb6e8('0x18')]);router[_0xb6e8('0x19')]('/:id',auth[_0xb6e8('0xa')](),controller[_0xb6e8('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x3c01=['/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAnyCondition','addAction','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','get','/:id','show'];(function(_0xc77872,_0x56be1b){var _0x4ce290=function(_0x4f6f58){while(--_0x4f6f58){_0xc77872['push'](_0xc77872['shift']());}};_0x4ce290(++_0x56be1b);}(_0x3c01,0x79));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x13c0('0x0'));var util=require(_0x13c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x13c0('0x2'));var router=express['Router']();var fs_extra=require(_0x13c0('0x3'));var auth=require(_0x13c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x13c0('0x5'));var controller=require(_0x13c0('0x6'));router['get']('/',auth[_0x13c0('0x7')](),controller['index']);router[_0x13c0('0x8')](_0x13c0('0x9'),auth['isAuthenticated'](),controller[_0x13c0('0xa')]);router['get'](_0x13c0('0xb'),auth[_0x13c0('0x7')](),controller[_0x13c0('0xc')]);router[_0x13c0('0x8')](_0x13c0('0xd'),auth[_0x13c0('0x7')](),controller[_0x13c0('0xe')]);router['get'](_0x13c0('0xf'),auth[_0x13c0('0x7')](),controller['getActions']);router['post']('/',auth[_0x13c0('0x7')](),controller[_0x13c0('0x10')]);router[_0x13c0('0x11')]('/:id/all_conditions',auth[_0x13c0('0x7')](),controller['addAllCondition']);router[_0x13c0('0x11')]('/:id/any_conditions',auth[_0x13c0('0x7')](),controller[_0x13c0('0x12')]);router[_0x13c0('0x11')](_0x13c0('0xf'),auth[_0x13c0('0x7')](),controller[_0x13c0('0x13')]);router['put'](_0x13c0('0x9'),auth[_0x13c0('0x7')](),controller['update']);router['delete'](_0x13c0('0x9'),auth[_0x13c0('0x7')](),controller[_0x13c0('0x14')]);module[_0x13c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index fc012af..881fe5f 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 _0xa240=['STRING','BOOLEAN','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa240,0xd7));var _0x0a24=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0xa240[_0x102977];return _0x15c466;};'use strict';var Sequelize=require(_0x0a24('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a24('0x1')]},'channel':{'type':Sequelize[_0x0a24('0x1')]},'description':{'type':Sequelize[_0x0a24('0x1')]},'status':{'type':Sequelize[_0x0a24('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3cbd=['exports','STRING','sequelize'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3cbd,0x197));var _0xd3cb=function(_0x2117a2,_0x53c2b4){_0x2117a2=_0x2117a2-0x0;var _0x48b35c=_0x3cbd[_0x2117a2];return _0x48b35c;};'use strict';var Sequelize=require(_0xd3cb('0x0'));module[_0xd3cb('0x1')]={'name':{'type':Sequelize[_0xd3cb('0x2')]},'channel':{'type':Sequelize[_0xd3cb('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 23667ed..79c2ef1 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 _0x2884=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','offset','count','limit','status','Content-Range','reject','save','update','then','destroy','get','Triggers','end','error','stack','name','index','map','Trigger','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','show','params','rawAttributes','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','nolimit','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2884,0x1b6));var _0x4288=function(_0x928a02,_0x2257cd){_0x928a02=_0x928a02-0x0;var _0x30705c=_0x2884[_0x928a02];return _0x30705c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4288('0x0'));var zipdir=require(_0x4288('0x1'));var jsonpatch=require(_0x4288('0x2'));var rp=require(_0x4288('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4288('0x4'));var path=require(_0x4288('0x5'));var sox=require(_0x4288('0x6'));var csv=require(_0x4288('0x7'));var ejs=require(_0x4288('0x8'));var fs=require('fs');var fs_extra=require(_0x4288('0x9'));var _=require(_0x4288('0xa'));var squel=require(_0x4288('0xb'));var crypto=require(_0x4288('0xc'));var jsforce=require(_0x4288('0xd'));var deskjs=require(_0x4288('0xe'));var toCsv=require(_0x4288('0x7'));var querystring=require(_0x4288('0xf'));var Papa=require(_0x4288('0x10'));var Redis=require(_0x4288('0x11'));var authService=require(_0x4288('0x12'));var qs=require(_0x4288('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4288('0x14'));var logger=require(_0x4288('0x15'))('api');var utils=require(_0x4288('0x16'));var config=require(_0x4288('0x17'));var licenseUtil=require(_0x4288('0x18'));var db=require(_0x4288('0x19'))['db'];function respondWithStatusCode(_0x4aee5e,_0x1b3c28){_0x1b3c28=_0x1b3c28||0xcc;return function(_0x4f64e5){if(_0x4f64e5){return _0x4aee5e[_0x4288('0x1a')](_0x1b3c28);}return _0x4aee5e['status'](_0x1b3c28)['end']();};}function respondWithResult(_0x4ef7c3,_0x4b7b2c){_0x4b7b2c=_0x4b7b2c||0xc8;return function(_0xff8f6d){if(_0xff8f6d){return _0x4ef7c3['status'](_0x4b7b2c)[_0x4288('0x1b')](_0xff8f6d);}};}function respondWithFilteredResult(_0x1f53d5,_0x16dc11){return function(_0x45c874){if(_0x45c874){var _0x1fd60c=typeof _0x16dc11['offset']===_0x4288('0x1c')&&typeof _0x16dc11['limit']===_0x4288('0x1c');var _0x5f6c52=_0x45c874['count'];var _0x5a0c2f=_0x1fd60c?0x0:_0x16dc11[_0x4288('0x1d')];var _0x5d6b28=_0x1fd60c?_0x45c874[_0x4288('0x1e')]:_0x16dc11[_0x4288('0x1d')]+_0x16dc11[_0x4288('0x1f')];var _0x31bd74;if(_0x5d6b28>=_0x5f6c52){_0x5d6b28=_0x5f6c52;_0x31bd74=0xc8;}else{_0x31bd74=0xce;}_0x1f53d5[_0x4288('0x20')](_0x31bd74);return _0x1f53d5['set'](_0x4288('0x21'),_0x5a0c2f+'-'+_0x5d6b28+'/'+_0x5f6c52)[_0x4288('0x1b')](_0x45c874);}return null;};}function patchUpdates(_0x3a25f6){return function(_0x578059){try{jsonpatch['apply'](_0x578059,_0x3a25f6,!![]);}catch(_0xb8d603){return BPromise[_0x4288('0x22')](_0xb8d603);}return _0x578059[_0x4288('0x23')]();};}function saveUpdates(_0x1e1f8b,_0x4c6d7e){return function(_0x43b62c){if(_0x43b62c){return _0x43b62c[_0x4288('0x24')](_0x1e1f8b)[_0x4288('0x25')](function(_0x1aad2a){return _0x1aad2a;});}return null;};}function removeEntity(_0x1a5339,_0x4c81dd){return function(_0x3c8287){if(_0x3c8287){return _0x3c8287[_0x4288('0x26')]()[_0x4288('0x25')](function(){var _0x33edd7=_0x3c8287[_0x4288('0x27')]({'plain':!![]});var _0x33c5c1=_0x4288('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x33c5c1,'resourceId':_0x33edd7['id']}})['then'](function(){return _0x3c8287;});})[_0x4288('0x25')](function(){_0x1a5339[_0x4288('0x20')](0xcc)[_0x4288('0x29')]();});}};}function handleEntityNotFound(_0x702008,_0x1682d5){return function(_0x61dd02){if(!_0x61dd02){_0x702008[_0x4288('0x1a')](0x194);}return _0x61dd02;};}function handleError(_0x8ed62d,_0x5e9386){_0x5e9386=_0x5e9386||0x1f4;return function(_0x31a440){logger[_0x4288('0x2a')](_0x31a440[_0x4288('0x2b')]);if(_0x31a440[_0x4288('0x2c')]){delete _0x31a440['name'];}_0x8ed62d[_0x4288('0x20')](_0x5e9386)['send'](_0x31a440);};}exports[_0x4288('0x2d')]=function(_0x5e2821,_0x56831b){var _0x15d139={},_0x4f3655={},_0x3d0c22={'count':0x0,'rows':[]};var _0x42ddc5=_[_0x4288('0x2e')](db[_0x4288('0x2f')]['rawAttributes'],function(_0x4c0137){return{'name':_0x4c0137[_0x4288('0x30')],'type':_0x4c0137[_0x4288('0x31')]['key']};});_0x4f3655['model']=_['map'](_0x42ddc5,_0x4288('0x2c'));_0x4f3655['query']=_[_0x4288('0x32')](_0x5e2821[_0x4288('0x33')]);_0x4f3655['filters']=_[_0x4288('0x34')](_0x4f3655[_0x4288('0x35')],_0x4f3655[_0x4288('0x33')]);_0x15d139[_0x4288('0x36')]=_[_0x4288('0x34')](_0x4f3655[_0x4288('0x35')],qs[_0x4288('0x37')](_0x5e2821['query'][_0x4288('0x37')]));_0x15d139['attributes']=_0x15d139[_0x4288('0x36')][_0x4288('0x38')]?_0x15d139['attributes']:_0x4f3655[_0x4288('0x35')];if(!_0x5e2821[_0x4288('0x33')][_0x4288('0x39')]('nolimit')){_0x15d139[_0x4288('0x1f')]=qs[_0x4288('0x1f')](_0x5e2821['query'][_0x4288('0x1f')]);_0x15d139['offset']=qs[_0x4288('0x1d')](_0x5e2821[_0x4288('0x33')][_0x4288('0x1d')]);}_0x15d139[_0x4288('0x3a')]=qs[_0x4288('0x3b')](_0x5e2821[_0x4288('0x33')]['sort']);_0x15d139[_0x4288('0x3c')]=qs[_0x4288('0x3d')](_[_0x4288('0x3e')](_0x5e2821[_0x4288('0x33')],_0x4f3655[_0x4288('0x3d')]),_0x42ddc5);if(_0x5e2821[_0x4288('0x33')][_0x4288('0x3f')]){_0x15d139[_0x4288('0x3c')]=_[_0x4288('0x40')](_0x15d139[_0x4288('0x3c')],{'$or':_['map'](_0x42ddc5,function(_0x220709){if(_0x220709[_0x4288('0x31')]!==_0x4288('0x41')){var _0x584baf={};_0x584baf[_0x220709[_0x4288('0x2c')]]={'$like':'%'+_0x5e2821[_0x4288('0x33')][_0x4288('0x3f')]+'%'};return _0x584baf;}})});}_0x15d139=_['merge']({},_0x15d139,_0x5e2821['options']);var _0x50423f={'where':_0x15d139['where']};return db[_0x4288('0x2f')]['count'](_0x50423f)[_0x4288('0x25')](function(_0x29650a){_0x3d0c22['count']=_0x29650a;if(_0x5e2821['query'][_0x4288('0x42')]){_0x15d139['include']=[{'all':!![]}];}return db[_0x4288('0x2f')]['findAll'](_0x15d139);})[_0x4288('0x25')](function(_0x1a5684){_0x3d0c22['rows']=_0x1a5684;return _0x3d0c22;})[_0x4288('0x25')](respondWithFilteredResult(_0x56831b,_0x15d139))['catch'](handleError(_0x56831b,null));};exports[_0x4288('0x43')]=function(_0x3b15e8,_0x32d347){var _0x3bcdea={'raw':![],'where':{'id':_0x3b15e8[_0x4288('0x44')]['id']}},_0x4b0443={};_0x4b0443[_0x4288('0x35')]=_[_0x4288('0x32')](db['Trigger'][_0x4288('0x45')]);_0x4b0443[_0x4288('0x33')]=_['keys'](_0x3b15e8['query']);_0x4b0443[_0x4288('0x3d')]=_['intersection'](_0x4b0443[_0x4288('0x35')],_0x4b0443[_0x4288('0x33')]);_0x3bcdea[_0x4288('0x36')]=_[_0x4288('0x34')](_0x4b0443[_0x4288('0x35')],qs[_0x4288('0x37')](_0x3b15e8[_0x4288('0x33')][_0x4288('0x37')]));_0x3bcdea[_0x4288('0x36')]=_0x3bcdea['attributes'][_0x4288('0x38')]?_0x3bcdea[_0x4288('0x36')]:_0x4b0443[_0x4288('0x35')];if(_0x3b15e8[_0x4288('0x33')]['includeAll']){_0x3bcdea['include']=[{'all':!![]}];}_0x3bcdea=_[_0x4288('0x40')]({},_0x3bcdea,_0x3b15e8[_0x4288('0x46')]);return db['Trigger']['find'](_0x3bcdea)[_0x4288('0x25')](handleEntityNotFound(_0x32d347,null))[_0x4288('0x25')](respondWithResult(_0x32d347,null))[_0x4288('0x47')](handleError(_0x32d347,null));};exports[_0x4288('0x48')]=function(_0x1dca06,_0x2f3d52){return db['Trigger'][_0x4288('0x48')](_0x1dca06[_0x4288('0x49')],{})[_0x4288('0x25')](function(_0x2bbebc){var _0x3dc698=_0x1dca06['user']['get']({'plain':!![]});if(!_0x3dc698)throw new Error(_0x4288('0x4a'));if(_0x3dc698[_0x4288('0x4b')]===_0x4288('0x4c')){var _0x39f8d4=_0x2bbebc['get']({'plain':!![]});var _0x357fa4='Triggers';return db['UserProfileSection'][_0x4288('0x4d')]({'where':{'name':_0x357fa4,'userProfileId':_0x3dc698['userProfileId']},'raw':!![]})[_0x4288('0x25')](function(_0x5d5956){if(_0x5d5956&&_0x5d5956[_0x4288('0x4e')]===0x0){return db['UserProfileResource'][_0x4288('0x48')]({'name':_0x39f8d4[_0x4288('0x2c')],'resourceId':_0x39f8d4['id'],'type':_0x5d5956[_0x4288('0x2c')],'sectionId':_0x5d5956['id']},{})[_0x4288('0x25')](function(){return _0x2bbebc;});}else{return _0x2bbebc;}})['catch'](function(_0x2ebf37){logger['error'](_0x4288('0x4f'),_0x2ebf37);throw _0x2ebf37;});}return _0x2bbebc;})[_0x4288('0x25')](respondWithResult(_0x2f3d52,0xc9))['catch'](handleError(_0x2f3d52,null));};exports[_0x4288('0x24')]=function(_0x4f0015,_0x4459d0){if(_0x4f0015[_0x4288('0x49')]['id']){delete _0x4f0015[_0x4288('0x49')]['id'];}return db[_0x4288('0x2f')][_0x4288('0x4d')]({'where':{'id':_0x4f0015[_0x4288('0x44')]['id']}})['then'](handleEntityNotFound(_0x4459d0,null))['then'](saveUpdates(_0x4f0015[_0x4288('0x49')],null))['then'](respondWithResult(_0x4459d0,null))[_0x4288('0x47')](handleError(_0x4459d0,null));};exports[_0x4288('0x26')]=function(_0x50884a,_0x3fe36b){return db[_0x4288('0x2f')]['find']({'where':{'id':_0x50884a['params']['id']}})['then'](handleEntityNotFound(_0x3fe36b,null))[_0x4288('0x25')](removeEntity(_0x3fe36b,null))['catch'](handleError(_0x3fe36b,null));};exports['addAllCondition']=function(_0x4b1d46,_0x47b313,_0x52ff2d){if(_0x4b1d46[_0x4288('0x49')]['id']){delete _0x4b1d46[_0x4288('0x49')]['id'];}return db[_0x4288('0x2f')][_0x4288('0x4d')]({'where':{'id':_0x4b1d46[_0x4288('0x44')]['id']}})[_0x4288('0x25')](handleEntityNotFound(_0x47b313,null))[_0x4288('0x25')](function(_0x3a541c){if(_0x3a541c){_0x4b1d46['body'][_0x4288('0x50')]=_0x3a541c['id'];return db[_0x4288('0x51')]['create'](_0x4b1d46[_0x4288('0x49')]);}})[_0x4288('0x25')](respondWithResult(_0x47b313,null))[_0x4288('0x47')](handleError(_0x47b313,null));};exports[_0x4288('0x52')]=function(_0x533d4e,_0x51778d,_0x4849e7){if(_0x533d4e[_0x4288('0x49')]['id']){delete _0x533d4e[_0x4288('0x49')]['id'];}return db[_0x4288('0x2f')][_0x4288('0x4d')]({'where':{'id':_0x533d4e[_0x4288('0x44')]['id']}})['then'](handleEntityNotFound(_0x51778d,null))[_0x4288('0x25')](function(_0x37f2d8){if(_0x37f2d8){_0x533d4e[_0x4288('0x49')][_0x4288('0x53')]=_0x37f2d8['id'];return db[_0x4288('0x51')][_0x4288('0x48')](_0x533d4e[_0x4288('0x49')]);}})[_0x4288('0x25')](respondWithResult(_0x51778d,null))['catch'](handleError(_0x51778d,null));};exports[_0x4288('0x54')]=function(_0x4fda62,_0x5d7842,_0x4bc744){var _0x15e0c5={};var _0x65c66c={};var _0x7fff03;var _0x53d552;return db[_0x4288('0x2f')][_0x4288('0x55')]({'where':{'id':_0x4fda62[_0x4288('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d7842,null))['then'](function(_0x12132e){if(_0x12132e){_0x7fff03=_0x12132e;_0x65c66c['model']=_['keys'](db[_0x4288('0x51')]['rawAttributes']);_0x65c66c[_0x4288('0x33')]=_[_0x4288('0x32')](_0x4fda62['query']);_0x65c66c[_0x4288('0x3d')]=_[_0x4288('0x34')](_0x65c66c['model'],_0x65c66c[_0x4288('0x33')]);_0x15e0c5['attributes']=_[_0x4288('0x34')](_0x65c66c[_0x4288('0x35')],qs[_0x4288('0x37')](_0x4fda62[_0x4288('0x33')][_0x4288('0x37')]));_0x15e0c5[_0x4288('0x36')]=_0x15e0c5['attributes'][_0x4288('0x38')]?_0x15e0c5['attributes']:_0x65c66c[_0x4288('0x35')];_0x15e0c5[_0x4288('0x3a')]=qs[_0x4288('0x3b')](_0x4fda62[_0x4288('0x33')][_0x4288('0x3b')]);_0x15e0c5[_0x4288('0x3c')]=qs[_0x4288('0x3d')](_[_0x4288('0x3e')](_0x4fda62[_0x4288('0x33')],_0x65c66c[_0x4288('0x3d')]));if(_0x4fda62[_0x4288('0x33')][_0x4288('0x3f')]){_0x15e0c5[_0x4288('0x3c')]=_[_0x4288('0x40')](_0x15e0c5[_0x4288('0x3c')],{'$or':_[_0x4288('0x2e')](_0x15e0c5[_0x4288('0x36')],function(_0x33ed79){var _0x2f5c41={};_0x2f5c41[_0x33ed79]={'$like':'%'+_0x4fda62['query']['filter']+'%'};return _0x2f5c41;})});}_0x15e0c5=_[_0x4288('0x40')]({},_0x15e0c5,_0x4fda62[_0x4288('0x46')]);return _0x7fff03[_0x4288('0x54')](_0x15e0c5);}})[_0x4288('0x25')](function(_0x4a5352){if(_0x4a5352){_0x53d552=_0x4a5352['length'];if(!_0x4fda62['query'][_0x4288('0x39')]('nolimit')){_0x15e0c5[_0x4288('0x1f')]=qs['limit'](_0x4fda62[_0x4288('0x33')][_0x4288('0x1f')]);_0x15e0c5[_0x4288('0x1d')]=qs[_0x4288('0x1d')](_0x4fda62[_0x4288('0x33')][_0x4288('0x1d')]);}return _0x7fff03[_0x4288('0x54')](_0x15e0c5);}})['then'](function(_0x31a42){if(_0x31a42){return _0x31a42?{'count':_0x53d552,'rows':_0x31a42}:null;}})[_0x4288('0x25')](respondWithResult(_0x5d7842,null))[_0x4288('0x47')](handleError(_0x5d7842,null));};exports[_0x4288('0x56')]=function(_0x5226e5,_0x151caa,_0x568ede){var _0x52be41={};var _0x50fa81={};var _0x280671;var _0x4fb863;return db['Trigger'][_0x4288('0x55')]({'where':{'id':_0x5226e5[_0x4288('0x44')]['id']}})[_0x4288('0x25')](handleEntityNotFound(_0x151caa,null))[_0x4288('0x25')](function(_0x4657f4){if(_0x4657f4){_0x280671=_0x4657f4;_0x50fa81[_0x4288('0x35')]=_['keys'](db[_0x4288('0x51')][_0x4288('0x45')]);_0x50fa81['query']=_[_0x4288('0x32')](_0x5226e5[_0x4288('0x33')]);_0x50fa81[_0x4288('0x3d')]=_[_0x4288('0x34')](_0x50fa81[_0x4288('0x35')],_0x50fa81[_0x4288('0x33')]);_0x52be41['attributes']=_[_0x4288('0x34')](_0x50fa81[_0x4288('0x35')],qs[_0x4288('0x37')](_0x5226e5[_0x4288('0x33')][_0x4288('0x37')]));_0x52be41['attributes']=_0x52be41['attributes']['length']?_0x52be41[_0x4288('0x36')]:_0x50fa81[_0x4288('0x35')];_0x52be41[_0x4288('0x3a')]=qs[_0x4288('0x3b')](_0x5226e5['query'][_0x4288('0x3b')]);_0x52be41[_0x4288('0x3c')]=qs[_0x4288('0x3d')](_[_0x4288('0x3e')](_0x5226e5[_0x4288('0x33')],_0x50fa81[_0x4288('0x3d')]));if(_0x5226e5[_0x4288('0x33')][_0x4288('0x3f')]){_0x52be41[_0x4288('0x3c')]=_[_0x4288('0x40')](_0x52be41['where'],{'$or':_[_0x4288('0x2e')](_0x52be41[_0x4288('0x36')],function(_0x103db4){var _0x1d584b={};_0x1d584b[_0x103db4]={'$like':'%'+_0x5226e5[_0x4288('0x33')][_0x4288('0x3f')]+'%'};return _0x1d584b;})});}_0x52be41=_['merge']({},_0x52be41,_0x5226e5['options']);return _0x280671[_0x4288('0x56')](_0x52be41);}})[_0x4288('0x25')](function(_0x527ec7){if(_0x527ec7){_0x4fb863=_0x527ec7[_0x4288('0x38')];if(!_0x5226e5[_0x4288('0x33')][_0x4288('0x39')](_0x4288('0x57'))){_0x52be41['limit']=qs[_0x4288('0x1f')](_0x5226e5[_0x4288('0x33')][_0x4288('0x1f')]);_0x52be41[_0x4288('0x1d')]=qs[_0x4288('0x1d')](_0x5226e5[_0x4288('0x33')]['offset']);}return _0x280671[_0x4288('0x56')](_0x52be41);}})['then'](function(_0xc6eca7){if(_0xc6eca7){return _0xc6eca7?{'count':_0x4fb863,'rows':_0xc6eca7}:null;}})[_0x4288('0x25')](respondWithResult(_0x151caa,null))[_0x4288('0x47')](handleError(_0x151caa,null));};exports[_0x4288('0x58')]=function(_0x482465,_0x17b183,_0x461cd6){if(_0x482465[_0x4288('0x49')]['id']){delete _0x482465[_0x4288('0x49')]['id'];}return db[_0x4288('0x2f')][_0x4288('0x4d')]({'where':{'id':_0x482465[_0x4288('0x44')]['id']}})[_0x4288('0x25')](handleEntityNotFound(_0x17b183,null))['then'](function(_0x580452){if(_0x580452){_0x482465[_0x4288('0x49')][_0x4288('0x59')]=_0x580452['id'];return db[_0x4288('0x5a')][_0x4288('0x48')](_0x482465[_0x4288('0x49')]);}})[_0x4288('0x25')](respondWithResult(_0x17b183,null))[_0x4288('0x47')](handleError(_0x17b183,null));};exports[_0x4288('0x5b')]=function(_0x21d287,_0x7e0b35,_0x505188){var _0x54cfe8={};var _0x4e83b6={};var _0x23455e;var _0x44e253;return db[_0x4288('0x2f')][_0x4288('0x55')]({'where':{'id':_0x21d287[_0x4288('0x44')]['id']}})['then'](handleEntityNotFound(_0x7e0b35,null))['then'](function(_0x17653){if(_0x17653){_0x23455e=_0x17653;_0x4e83b6[_0x4288('0x35')]=_['keys'](db[_0x4288('0x5a')][_0x4288('0x45')]);_0x4e83b6[_0x4288('0x33')]=_[_0x4288('0x32')](_0x21d287[_0x4288('0x33')]);_0x4e83b6[_0x4288('0x3d')]=_[_0x4288('0x34')](_0x4e83b6['model'],_0x4e83b6[_0x4288('0x33')]);_0x54cfe8[_0x4288('0x36')]=_[_0x4288('0x34')](_0x4e83b6[_0x4288('0x35')],qs[_0x4288('0x37')](_0x21d287[_0x4288('0x33')][_0x4288('0x37')]));_0x54cfe8[_0x4288('0x36')]=_0x54cfe8[_0x4288('0x36')]['length']?_0x54cfe8[_0x4288('0x36')]:_0x4e83b6[_0x4288('0x35')];_0x54cfe8[_0x4288('0x3a')]=qs[_0x4288('0x3b')](_0x21d287['query'][_0x4288('0x3b')]);_0x54cfe8[_0x4288('0x3c')]=qs[_0x4288('0x3d')](_['pick'](_0x21d287[_0x4288('0x33')],_0x4e83b6['filters']));if(_0x21d287[_0x4288('0x33')]['filter']){_0x54cfe8['where']=_['merge'](_0x54cfe8[_0x4288('0x3c')],{'$or':_['map'](_0x54cfe8[_0x4288('0x36')],function(_0x94ee36){var _0x25a5ad={};_0x25a5ad[_0x94ee36]={'$like':'%'+_0x21d287['query'][_0x4288('0x3f')]+'%'};return _0x25a5ad;})});}_0x54cfe8=_[_0x4288('0x40')]({},_0x54cfe8,_0x21d287['options']);return _0x23455e[_0x4288('0x5b')](_0x54cfe8);}})[_0x4288('0x25')](function(_0x1e3920){if(_0x1e3920){_0x44e253=_0x1e3920[_0x4288('0x38')];if(!_0x21d287[_0x4288('0x33')][_0x4288('0x39')](_0x4288('0x57'))){_0x54cfe8[_0x4288('0x1f')]=qs['limit'](_0x21d287['query']['limit']);_0x54cfe8[_0x4288('0x1d')]=qs[_0x4288('0x1d')](_0x21d287[_0x4288('0x33')][_0x4288('0x1d')]);}return _0x23455e[_0x4288('0x5b')](_0x54cfe8);}})[_0x4288('0x25')](function(_0x294348){if(_0x294348){return _0x294348?{'count':_0x44e253,'rows':_0x294348}:null;}})[_0x4288('0x25')](respondWithResult(_0x7e0b35,null))[_0x4288('0x47')](handleError(_0x7e0b35,null));}; \ No newline at end of file +var _0x9658=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','json','apply','save','then','get','UserProfileResource','destroy','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addAllCondition','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring'];(function(_0x4b782e,_0x51dc21){var _0x59cab1=function(_0x11b516){while(--_0x11b516){_0x4b782e['push'](_0x4b782e['shift']());}};_0x59cab1(++_0x51dc21);}(_0x9658,0x1c0));var _0x8965=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x9658[_0x810025];return _0x4dbc81;};'use strict';var emlformat=require(_0x8965('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8965('0x1'));var jsonpatch=require(_0x8965('0x2'));var rp=require(_0x8965('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8965('0x4'));var util=require('util');var path=require(_0x8965('0x5'));var sox=require(_0x8965('0x6'));var csv=require(_0x8965('0x7'));var ejs=require(_0x8965('0x8'));var fs=require('fs');var fs_extra=require(_0x8965('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8965('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8965('0xb'));var Papa=require(_0x8965('0xc'));var Redis=require(_0x8965('0xd'));var authService=require(_0x8965('0xe'));var qs=require(_0x8965('0xf'));var as=require(_0x8965('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8965('0x11'))(_0x8965('0x12'));var utils=require(_0x8965('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8965('0x14'));var db=require(_0x8965('0x15'))['db'];function respondWithStatusCode(_0x5296f5,_0x5df268){_0x5df268=_0x5df268||0xcc;return function(_0x3528c1){if(_0x3528c1){return _0x5296f5[_0x8965('0x16')](_0x5df268);}return _0x5296f5['status'](_0x5df268)[_0x8965('0x17')]();};}function respondWithResult(_0x3d8217,_0x1bd281){_0x1bd281=_0x1bd281||0xc8;return function(_0x121d33){if(_0x121d33){return _0x3d8217[_0x8965('0x18')](_0x1bd281)['json'](_0x121d33);}};}function respondWithFilteredResult(_0x496098,_0x339927){return function(_0x2ccfe7){if(_0x2ccfe7){var _0x59c9ba=typeof _0x339927[_0x8965('0x19')]==='undefined'&&typeof _0x339927[_0x8965('0x1a')]===_0x8965('0x1b');var _0x455189=_0x2ccfe7['count'];var _0x38d792=_0x59c9ba?0x0:_0x339927[_0x8965('0x19')];var _0x3a5042=_0x59c9ba?_0x2ccfe7[_0x8965('0x1c')]:_0x339927[_0x8965('0x19')]+_0x339927['limit'];var _0x538e6d;if(_0x3a5042>=_0x455189){_0x3a5042=_0x455189;_0x538e6d=0xc8;}else{_0x538e6d=0xce;}_0x496098[_0x8965('0x18')](_0x538e6d);return _0x496098['set']('Content-Range',_0x38d792+'-'+_0x3a5042+'/'+_0x455189)[_0x8965('0x1d')](_0x2ccfe7);}return null;};}function patchUpdates(_0x37bb2e){return function(_0x1e0117){try{jsonpatch[_0x8965('0x1e')](_0x1e0117,_0x37bb2e,!![]);}catch(_0x4023ed){return BPromise['reject'](_0x4023ed);}return _0x1e0117[_0x8965('0x1f')]();};}function saveUpdates(_0x50b86e,_0x36a5d3){return function(_0x552599){if(_0x552599){return _0x552599['update'](_0x50b86e)[_0x8965('0x20')](function(_0x1f5c2a){return _0x1f5c2a;});}return null;};}function removeEntity(_0x2abaf8,_0x1c8240){return function(_0xfc6322){if(_0xfc6322){return _0xfc6322['destroy']()[_0x8965('0x20')](function(){var _0x56c061=_0xfc6322[_0x8965('0x21')]({'plain':!![]});var _0x49886e='Triggers';return db[_0x8965('0x22')][_0x8965('0x23')]({'where':{'type':_0x49886e,'resourceId':_0x56c061['id']}})[_0x8965('0x20')](function(){return _0xfc6322;});})[_0x8965('0x20')](function(){_0x2abaf8[_0x8965('0x18')](0xcc)[_0x8965('0x17')]();});}};}function handleEntityNotFound(_0x404743,_0x3397ef){return function(_0x332309){if(!_0x332309){_0x404743['sendStatus'](0x194);}return _0x332309;};}function handleError(_0x234a2d,_0x712541){_0x712541=_0x712541||0x1f4;return function(_0xb31671){logger['error'](_0xb31671[_0x8965('0x24')]);if(_0xb31671[_0x8965('0x25')]){delete _0xb31671['name'];}_0x234a2d[_0x8965('0x18')](_0x712541)[_0x8965('0x26')](_0xb31671);};}exports[_0x8965('0x27')]=function(_0x38d5f8,_0x45877c){var _0xfa9fd3={},_0x55b935={},_0xbeac78={'count':0x0,'rows':[]};var _0x1acf5e=_[_0x8965('0x28')](db[_0x8965('0x29')][_0x8965('0x2a')],function(_0x126e53){return{'name':_0x126e53[_0x8965('0x2b')],'type':_0x126e53[_0x8965('0x2c')][_0x8965('0x2d')]};});_0x55b935['model']=_[_0x8965('0x28')](_0x1acf5e,'name');_0x55b935[_0x8965('0x2e')]=_['keys'](_0x38d5f8[_0x8965('0x2e')]);_0x55b935[_0x8965('0x2f')]=_['intersection'](_0x55b935[_0x8965('0x30')],_0x55b935[_0x8965('0x2e')]);_0xfa9fd3[_0x8965('0x31')]=_[_0x8965('0x32')](_0x55b935[_0x8965('0x30')],qs[_0x8965('0x33')](_0x38d5f8[_0x8965('0x2e')][_0x8965('0x33')]));_0xfa9fd3[_0x8965('0x31')]=_0xfa9fd3['attributes'][_0x8965('0x34')]?_0xfa9fd3[_0x8965('0x31')]:_0x55b935[_0x8965('0x30')];if(!_0x38d5f8[_0x8965('0x2e')][_0x8965('0x35')](_0x8965('0x36'))){_0xfa9fd3['limit']=qs['limit'](_0x38d5f8['query']['limit']);_0xfa9fd3[_0x8965('0x19')]=qs[_0x8965('0x19')](_0x38d5f8[_0x8965('0x2e')][_0x8965('0x19')]);}_0xfa9fd3[_0x8965('0x37')]=qs[_0x8965('0x38')](_0x38d5f8[_0x8965('0x2e')][_0x8965('0x38')]);_0xfa9fd3['where']=qs[_0x8965('0x2f')](_[_0x8965('0x39')](_0x38d5f8['query'],_0x55b935[_0x8965('0x2f')]),_0x1acf5e);if(_0x38d5f8[_0x8965('0x2e')][_0x8965('0x3a')]){_0xfa9fd3[_0x8965('0x3b')]=_[_0x8965('0x3c')](_0xfa9fd3[_0x8965('0x3b')],{'$or':_[_0x8965('0x28')](_0x1acf5e,function(_0x2f4134){if(_0x2f4134[_0x8965('0x2c')]!==_0x8965('0x3d')){var _0x3b55bb={};_0x3b55bb[_0x2f4134[_0x8965('0x25')]]={'$like':'%'+_0x38d5f8[_0x8965('0x2e')][_0x8965('0x3a')]+'%'};return _0x3b55bb;}})});}_0xfa9fd3=_[_0x8965('0x3c')]({},_0xfa9fd3,_0x38d5f8[_0x8965('0x3e')]);var _0x498bc0={'where':_0xfa9fd3['where']};return db[_0x8965('0x29')][_0x8965('0x1c')](_0x498bc0)[_0x8965('0x20')](function(_0x2d2051){_0xbeac78[_0x8965('0x1c')]=_0x2d2051;if(_0x38d5f8['query'][_0x8965('0x3f')]){_0xfa9fd3[_0x8965('0x40')]=[{'all':!![]}];}return db['Trigger'][_0x8965('0x41')](_0xfa9fd3);})[_0x8965('0x20')](function(_0x2500b4){_0xbeac78[_0x8965('0x42')]=_0x2500b4;return _0xbeac78;})['then'](respondWithFilteredResult(_0x45877c,_0xfa9fd3))[_0x8965('0x43')](handleError(_0x45877c,null));};exports[_0x8965('0x44')]=function(_0x2f88c7,_0x26547c){var _0x5eb1d8={'raw':![],'where':{'id':_0x2f88c7['params']['id']}},_0x2cdfcf={};_0x2cdfcf[_0x8965('0x30')]=_[_0x8965('0x45')](db[_0x8965('0x29')][_0x8965('0x2a')]);_0x2cdfcf[_0x8965('0x2e')]=_[_0x8965('0x45')](_0x2f88c7[_0x8965('0x2e')]);_0x2cdfcf[_0x8965('0x2f')]=_['intersection'](_0x2cdfcf[_0x8965('0x30')],_0x2cdfcf['query']);_0x5eb1d8[_0x8965('0x31')]=_[_0x8965('0x32')](_0x2cdfcf['model'],qs[_0x8965('0x33')](_0x2f88c7['query'][_0x8965('0x33')]));_0x5eb1d8[_0x8965('0x31')]=_0x5eb1d8['attributes'][_0x8965('0x34')]?_0x5eb1d8[_0x8965('0x31')]:_0x2cdfcf[_0x8965('0x30')];if(_0x2f88c7['query'][_0x8965('0x3f')]){_0x5eb1d8[_0x8965('0x40')]=[{'all':!![]}];}_0x5eb1d8=_[_0x8965('0x3c')]({},_0x5eb1d8,_0x2f88c7[_0x8965('0x3e')]);return db['Trigger'][_0x8965('0x46')](_0x5eb1d8)[_0x8965('0x20')](handleEntityNotFound(_0x26547c,null))[_0x8965('0x20')](respondWithResult(_0x26547c,null))[_0x8965('0x43')](handleError(_0x26547c,null));};exports[_0x8965('0x47')]=function(_0x2fb4f6,_0x1f471e){return db[_0x8965('0x29')]['create'](_0x2fb4f6['body'],{})[_0x8965('0x20')](function(_0x1fa1ae){var _0x42b576=_0x2fb4f6[_0x8965('0x48')][_0x8965('0x21')]({'plain':!![]});if(!_0x42b576)throw new Error(_0x8965('0x49'));if(_0x42b576[_0x8965('0x4a')]==='user'){var _0x6ed702=_0x1fa1ae[_0x8965('0x21')]({'plain':!![]});var _0x46c548=_0x8965('0x4b');return db['UserProfileSection'][_0x8965('0x46')]({'where':{'name':_0x46c548,'userProfileId':_0x42b576['userProfileId']},'raw':!![]})[_0x8965('0x20')](function(_0x4fdb89){if(_0x4fdb89&&_0x4fdb89[_0x8965('0x4c')]===0x0){return db['UserProfileResource'][_0x8965('0x47')]({'name':_0x6ed702[_0x8965('0x25')],'resourceId':_0x6ed702['id'],'type':_0x4fdb89[_0x8965('0x25')],'sectionId':_0x4fdb89['id']},{})['then'](function(){return _0x1fa1ae;});}else{return _0x1fa1ae;}})[_0x8965('0x43')](function(_0x50b72c){logger['error'](_0x8965('0x4d'),_0x50b72c);throw _0x50b72c;});}return _0x1fa1ae;})[_0x8965('0x20')](respondWithResult(_0x1f471e,0xc9))[_0x8965('0x43')](handleError(_0x1f471e,null));};exports[_0x8965('0x4e')]=function(_0x144730,_0x2eaef3){if(_0x144730['body']['id']){delete _0x144730[_0x8965('0x4f')]['id'];}return db[_0x8965('0x29')][_0x8965('0x46')]({'where':{'id':_0x144730['params']['id']}})['then'](handleEntityNotFound(_0x2eaef3,null))[_0x8965('0x20')](saveUpdates(_0x144730[_0x8965('0x4f')],null))['then'](respondWithResult(_0x2eaef3,null))[_0x8965('0x43')](handleError(_0x2eaef3,null));};exports[_0x8965('0x23')]=function(_0x11e741,_0x3968eb){return db[_0x8965('0x29')][_0x8965('0x46')]({'where':{'id':_0x11e741['params']['id']}})[_0x8965('0x20')](handleEntityNotFound(_0x3968eb,null))[_0x8965('0x20')](removeEntity(_0x3968eb,null))[_0x8965('0x43')](handleError(_0x3968eb,null));};exports[_0x8965('0x50')]=function(_0x22c25c,_0x1d96f4,_0x16cc7f){if(_0x22c25c['body']['id']){delete _0x22c25c[_0x8965('0x4f')]['id'];}return db[_0x8965('0x29')][_0x8965('0x46')]({'where':{'id':_0x22c25c[_0x8965('0x51')]['id']}})[_0x8965('0x20')](handleEntityNotFound(_0x1d96f4,null))[_0x8965('0x20')](function(_0x108e15){if(_0x108e15){_0x22c25c[_0x8965('0x4f')][_0x8965('0x52')]=_0x108e15['id'];return db[_0x8965('0x53')][_0x8965('0x47')](_0x22c25c['body']);}})[_0x8965('0x20')](respondWithResult(_0x1d96f4,null))['catch'](handleError(_0x1d96f4,null));};exports[_0x8965('0x54')]=function(_0x2f3416,_0x3d9d0d,_0x5caa03){if(_0x2f3416['body']['id']){delete _0x2f3416[_0x8965('0x4f')]['id'];}return db[_0x8965('0x29')][_0x8965('0x46')]({'where':{'id':_0x2f3416[_0x8965('0x51')]['id']}})[_0x8965('0x20')](handleEntityNotFound(_0x3d9d0d,null))[_0x8965('0x20')](function(_0x381a0c){if(_0x381a0c){_0x2f3416[_0x8965('0x4f')][_0x8965('0x55')]=_0x381a0c['id'];return db[_0x8965('0x53')]['create'](_0x2f3416[_0x8965('0x4f')]);}})[_0x8965('0x20')](respondWithResult(_0x3d9d0d,null))['catch'](handleError(_0x3d9d0d,null));};exports[_0x8965('0x56')]=function(_0x26b4d1,_0x3da8b1,_0x3cb941){var _0x3cb9f7={};var _0x3d031c={};var _0x277444;var _0x447be6;return db[_0x8965('0x29')][_0x8965('0x57')]({'where':{'id':_0x26b4d1[_0x8965('0x51')]['id']}})['then'](handleEntityNotFound(_0x3da8b1,null))[_0x8965('0x20')](function(_0x210999){if(_0x210999){_0x277444=_0x210999;_0x3d031c[_0x8965('0x30')]=_['keys'](db[_0x8965('0x53')]['rawAttributes']);_0x3d031c['query']=_['keys'](_0x26b4d1[_0x8965('0x2e')]);_0x3d031c[_0x8965('0x2f')]=_[_0x8965('0x32')](_0x3d031c[_0x8965('0x30')],_0x3d031c['query']);_0x3cb9f7[_0x8965('0x31')]=_[_0x8965('0x32')](_0x3d031c[_0x8965('0x30')],qs[_0x8965('0x33')](_0x26b4d1['query']['fields']));_0x3cb9f7[_0x8965('0x31')]=_0x3cb9f7[_0x8965('0x31')][_0x8965('0x34')]?_0x3cb9f7['attributes']:_0x3d031c[_0x8965('0x30')];_0x3cb9f7[_0x8965('0x37')]=qs['sort'](_0x26b4d1[_0x8965('0x2e')]['sort']);_0x3cb9f7[_0x8965('0x3b')]=qs[_0x8965('0x2f')](_['pick'](_0x26b4d1['query'],_0x3d031c['filters']));if(_0x26b4d1[_0x8965('0x2e')][_0x8965('0x3a')]){_0x3cb9f7[_0x8965('0x3b')]=_[_0x8965('0x3c')](_0x3cb9f7[_0x8965('0x3b')],{'$or':_[_0x8965('0x28')](_0x3cb9f7[_0x8965('0x31')],function(_0x16ec6f){var _0x5e68d1={};_0x5e68d1[_0x16ec6f]={'$like':'%'+_0x26b4d1['query'][_0x8965('0x3a')]+'%'};return _0x5e68d1;})});}_0x3cb9f7=_['merge']({},_0x3cb9f7,_0x26b4d1['options']);return _0x277444['getAllConditions'](_0x3cb9f7);}})[_0x8965('0x20')](function(_0x2debf1){if(_0x2debf1){_0x447be6=_0x2debf1[_0x8965('0x34')];if(!_0x26b4d1[_0x8965('0x2e')][_0x8965('0x35')](_0x8965('0x36'))){_0x3cb9f7[_0x8965('0x1a')]=qs[_0x8965('0x1a')](_0x26b4d1[_0x8965('0x2e')][_0x8965('0x1a')]);_0x3cb9f7[_0x8965('0x19')]=qs[_0x8965('0x19')](_0x26b4d1[_0x8965('0x2e')][_0x8965('0x19')]);}return _0x277444['getAllConditions'](_0x3cb9f7);}})[_0x8965('0x20')](function(_0x51e778){if(_0x51e778){return _0x51e778?{'count':_0x447be6,'rows':_0x51e778}:null;}})[_0x8965('0x20')](respondWithResult(_0x3da8b1,null))[_0x8965('0x43')](handleError(_0x3da8b1,null));};exports[_0x8965('0x58')]=function(_0x18a13b,_0x510f7a,_0x3aff42){var _0x1cceb2={};var _0x350a0d={};var _0x20626b;var _0x545145;return db[_0x8965('0x29')][_0x8965('0x57')]({'where':{'id':_0x18a13b['params']['id']}})[_0x8965('0x20')](handleEntityNotFound(_0x510f7a,null))['then'](function(_0x1b27b8){if(_0x1b27b8){_0x20626b=_0x1b27b8;_0x350a0d['model']=_['keys'](db[_0x8965('0x53')][_0x8965('0x2a')]);_0x350a0d[_0x8965('0x2e')]=_['keys'](_0x18a13b[_0x8965('0x2e')]);_0x350a0d['filters']=_[_0x8965('0x32')](_0x350a0d[_0x8965('0x30')],_0x350a0d[_0x8965('0x2e')]);_0x1cceb2[_0x8965('0x31')]=_[_0x8965('0x32')](_0x350a0d[_0x8965('0x30')],qs[_0x8965('0x33')](_0x18a13b[_0x8965('0x2e')][_0x8965('0x33')]));_0x1cceb2[_0x8965('0x31')]=_0x1cceb2['attributes'][_0x8965('0x34')]?_0x1cceb2[_0x8965('0x31')]:_0x350a0d[_0x8965('0x30')];_0x1cceb2[_0x8965('0x37')]=qs[_0x8965('0x38')](_0x18a13b['query'][_0x8965('0x38')]);_0x1cceb2[_0x8965('0x3b')]=qs['filters'](_[_0x8965('0x39')](_0x18a13b['query'],_0x350a0d[_0x8965('0x2f')]));if(_0x18a13b[_0x8965('0x2e')][_0x8965('0x3a')]){_0x1cceb2[_0x8965('0x3b')]=_['merge'](_0x1cceb2[_0x8965('0x3b')],{'$or':_['map'](_0x1cceb2[_0x8965('0x31')],function(_0x94d055){var _0x13e5b3={};_0x13e5b3[_0x94d055]={'$like':'%'+_0x18a13b[_0x8965('0x2e')][_0x8965('0x3a')]+'%'};return _0x13e5b3;})});}_0x1cceb2=_['merge']({},_0x1cceb2,_0x18a13b[_0x8965('0x3e')]);return _0x20626b['getAnyConditions'](_0x1cceb2);}})['then'](function(_0x27768f){if(_0x27768f){_0x545145=_0x27768f[_0x8965('0x34')];if(!_0x18a13b['query'][_0x8965('0x35')](_0x8965('0x36'))){_0x1cceb2[_0x8965('0x1a')]=qs[_0x8965('0x1a')](_0x18a13b['query'][_0x8965('0x1a')]);_0x1cceb2[_0x8965('0x19')]=qs['offset'](_0x18a13b['query'][_0x8965('0x19')]);}return _0x20626b['getAnyConditions'](_0x1cceb2);}})[_0x8965('0x20')](function(_0x146646){if(_0x146646){return _0x146646?{'count':_0x545145,'rows':_0x146646}:null;}})[_0x8965('0x20')](respondWithResult(_0x510f7a,null))[_0x8965('0x43')](handleError(_0x510f7a,null));};exports[_0x8965('0x59')]=function(_0xddc291,_0xb2a46b,_0x96baab){if(_0xddc291['body']['id']){delete _0xddc291[_0x8965('0x4f')]['id'];}return db[_0x8965('0x29')][_0x8965('0x46')]({'where':{'id':_0xddc291[_0x8965('0x51')]['id']}})[_0x8965('0x20')](handleEntityNotFound(_0xb2a46b,null))[_0x8965('0x20')](function(_0x56b818){if(_0x56b818){_0xddc291['body']['TriggerId']=_0x56b818['id'];return db[_0x8965('0x5a')][_0x8965('0x47')](_0xddc291[_0x8965('0x4f')]);}})[_0x8965('0x20')](respondWithResult(_0xb2a46b,null))[_0x8965('0x43')](handleError(_0xb2a46b,null));};exports['getActions']=function(_0x1d9ecb,_0x31bbaa,_0x3421b7){var _0x32347b={};var _0x16bccf={};var _0x317d31;var _0x12dea8;return db[_0x8965('0x29')]['findOne']({'where':{'id':_0x1d9ecb[_0x8965('0x51')]['id']}})[_0x8965('0x20')](handleEntityNotFound(_0x31bbaa,null))[_0x8965('0x20')](function(_0x44336f){if(_0x44336f){_0x317d31=_0x44336f;_0x16bccf[_0x8965('0x30')]=_[_0x8965('0x45')](db[_0x8965('0x5a')]['rawAttributes']);_0x16bccf[_0x8965('0x2e')]=_[_0x8965('0x45')](_0x1d9ecb[_0x8965('0x2e')]);_0x16bccf[_0x8965('0x2f')]=_[_0x8965('0x32')](_0x16bccf[_0x8965('0x30')],_0x16bccf[_0x8965('0x2e')]);_0x32347b[_0x8965('0x31')]=_[_0x8965('0x32')](_0x16bccf[_0x8965('0x30')],qs[_0x8965('0x33')](_0x1d9ecb[_0x8965('0x2e')][_0x8965('0x33')]));_0x32347b[_0x8965('0x31')]=_0x32347b['attributes']['length']?_0x32347b['attributes']:_0x16bccf[_0x8965('0x30')];_0x32347b[_0x8965('0x37')]=qs[_0x8965('0x38')](_0x1d9ecb[_0x8965('0x2e')][_0x8965('0x38')]);_0x32347b[_0x8965('0x3b')]=qs[_0x8965('0x2f')](_[_0x8965('0x39')](_0x1d9ecb[_0x8965('0x2e')],_0x16bccf[_0x8965('0x2f')]));if(_0x1d9ecb[_0x8965('0x2e')][_0x8965('0x3a')]){_0x32347b[_0x8965('0x3b')]=_[_0x8965('0x3c')](_0x32347b[_0x8965('0x3b')],{'$or':_[_0x8965('0x28')](_0x32347b[_0x8965('0x31')],function(_0x21fa92){var _0x23ebfb={};_0x23ebfb[_0x21fa92]={'$like':'%'+_0x1d9ecb['query']['filter']+'%'};return _0x23ebfb;})});}_0x32347b=_[_0x8965('0x3c')]({},_0x32347b,_0x1d9ecb['options']);return _0x317d31[_0x8965('0x5b')](_0x32347b);}})[_0x8965('0x20')](function(_0x30f4a4){if(_0x30f4a4){_0x12dea8=_0x30f4a4[_0x8965('0x34')];if(!_0x1d9ecb['query'][_0x8965('0x35')]('nolimit')){_0x32347b[_0x8965('0x1a')]=qs[_0x8965('0x1a')](_0x1d9ecb[_0x8965('0x2e')]['limit']);_0x32347b[_0x8965('0x19')]=qs[_0x8965('0x19')](_0x1d9ecb[_0x8965('0x2e')][_0x8965('0x19')]);}return _0x317d31[_0x8965('0x5b')](_0x32347b);}})[_0x8965('0x20')](function(_0x9d8692){if(_0x9d8692){return _0x9d8692?{'count':_0x12dea8,'rows':_0x9d8692}:null;}})['then'](respondWithResult(_0x31bbaa,null))[_0x8965('0x43')](handleError(_0x31bbaa,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a3bf39e..78f51bf 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 _0xf50b=['bluebird','request-promise','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','api','moment'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0xf50b,0xc8));var _0xbf50=function(_0x1c2c7b,_0x503308){_0x1c2c7b=_0x1c2c7b-0x0;var _0x2f2a84=_0xf50b[_0x1c2c7b];return _0x2f2a84;};'use strict';var _=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var logger=require('../../config/logger')(_0xbf50('0x2'));var moment=require(_0xbf50('0x3'));var BPromise=require(_0xbf50('0x4'));var rp=require(_0xbf50('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf50('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf50('0x7'));module[_0xbf50('0x8')]=function(_0x1ecb62,_0x117cc8){return _0x1ecb62[_0xbf50('0x9')](_0xbf50('0xa'),attributes,{'tableName':_0xbf50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe80c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','define','tools_triggers','util'];(function(_0x1a5141,_0x2dcd44){var _0x5e135b=function(_0x1a39c7){while(--_0x1a39c7){_0x1a5141['push'](_0x1a5141['shift']());}};_0x5e135b(++_0x2dcd44);}(_0xe80c,0x1c2));var _0xce80=function(_0x24327f,_0x41fd9a){_0x24327f=_0x24327f-0x0;var _0x33967f=_0xe80c[_0x24327f];return _0x33967f;};'use strict';var _=require('lodash');var util=require(_0xce80('0x0'));var logger=require(_0xce80('0x1'))(_0xce80('0x2'));var moment=require(_0xce80('0x3'));var BPromise=require(_0xce80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce80('0x5'));var rimraf=require(_0xce80('0x6'));var config=require(_0xce80('0x7'));var attributes=require(_0xce80('0x8'));module['exports']=function(_0xb10325,_0x150f6a){return _0xb10325[_0xce80('0x9')]('Trigger',attributes,{'tableName':_0xce80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 55d3090..1a676ff 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 _0x0ea3=['error','message','catch','GetTrigger','Trigger','options','raw','where','limit','include','map','model','attributes','ShowTrigger','find','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x41cd93,_0x382eb8){var _0x58a7f8=function(_0x19e25f){while(--_0x19e25f){_0x41cd93['push'](_0x41cd93['shift']());}};_0x58a7f8(++_0x382eb8);}(_0x0ea3,0xf6));var _0x30ea=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x0ea3[_0x25fa5c];return _0x1bade2;};'use strict';var _=require(_0x30ea('0x0'));var util=require(_0x30ea('0x1'));var moment=require(_0x30ea('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30ea('0x3'))['db'];var utils=require(_0x30ea('0x4'));var logger=require('../../config/logger')(_0x30ea('0x5'));var config=require(_0x30ea('0x6'));var jayson=require(_0x30ea('0x7'));var client=jayson[_0x30ea('0x8')][_0x30ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e70c7,_0xd12e88,_0x55fb26){return new BPromise(function(_0x339c21,_0x4fce34){return client[_0x30ea('0xa')](_0x3e70c7,_0x55fb26)[_0x30ea('0xb')](function(_0x26e903){logger[_0x30ea('0xc')](_0x30ea('0xd'),_0xd12e88,_0x30ea('0xe'));logger[_0x30ea('0xf')](_0x30ea('0x10'),_0xd12e88,'request\x20sent',JSON[_0x30ea('0x11')](_0x26e903));if(_0x26e903['error']){if(_0x26e903[_0x30ea('0x12')]['code']===0x1f4){logger[_0x30ea('0x12')](_0x30ea('0xd'),_0xd12e88,_0x26e903['error'][_0x30ea('0x13')]);return _0x4fce34(_0x26e903['error'][_0x30ea('0x13')]);}logger[_0x30ea('0x12')](_0x30ea('0xd'),_0xd12e88,_0x26e903['error'][_0x30ea('0x13')]);return _0x339c21(_0x26e903[_0x30ea('0x12')][_0x30ea('0x13')]);}else{logger[_0x30ea('0xc')](_0x30ea('0xd'),_0xd12e88,_0x30ea('0xe'));_0x339c21(_0x26e903['result'][_0x30ea('0x13')]);}})[_0x30ea('0x14')](function(_0xf676e7){logger['error'](_0x30ea('0xd'),_0xd12e88,_0xf676e7);_0x4fce34(_0xf676e7);});});}exports[_0x30ea('0x15')]=function(_0x3d512b){var _0x48737c=this;return new Promise(function(_0x362029,_0x316b69){return db[_0x30ea('0x16')]['findAll']({'raw':_0x3d512b['options']?_0x3d512b[_0x30ea('0x17')][_0x30ea('0x18')]===undefined?!![]:![]:!![],'where':_0x3d512b['options']?_0x3d512b[_0x30ea('0x17')][_0x30ea('0x19')]||null:null,'attributes':_0x3d512b[_0x30ea('0x17')]?_0x3d512b['options']['attributes']||null:null,'limit':_0x3d512b[_0x30ea('0x17')]?_0x3d512b[_0x30ea('0x17')][_0x30ea('0x1a')]||null:null,'include':_0x3d512b['options']?_0x3d512b['options'][_0x30ea('0x1b')]?_[_0x30ea('0x1c')](_0x3d512b[_0x30ea('0x17')]['include'],function(_0xbf3260){return{'model':db[_0xbf3260[_0x30ea('0x1d')]],'as':_0xbf3260['as'],'attributes':_0xbf3260[_0x30ea('0x1e')],'include':_0xbf3260['include']?_[_0x30ea('0x1c')](_0xbf3260['include'],function(_0x3cd28e){return{'model':db[_0x3cd28e[_0x30ea('0x1d')]],'as':_0x3cd28e['as'],'attributes':_0x3cd28e[_0x30ea('0x1e')],'include':_0x3cd28e[_0x30ea('0x1b')]?_['map'](_0x3cd28e[_0x30ea('0x1b')],function(_0x1f8d73){return{'model':db[_0x1f8d73[_0x30ea('0x1d')]],'as':_0x1f8d73['as'],'attributes':_0x1f8d73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dea12){logger[_0x30ea('0xc')](_0x30ea('0x15'),_0x3d512b);logger[_0x30ea('0xf')](_0x30ea('0x15'),_0x3d512b,JSON[_0x30ea('0x11')](_0x3dea12));_0x362029(_0x3dea12);})[_0x30ea('0x14')](function(_0x2b75bb){logger[_0x30ea('0x12')]('GetTrigger',_0x2b75bb['message'],_0x3d512b);_0x316b69(_0x48737c[_0x30ea('0x12')](0x1f4,_0x2b75bb[_0x30ea('0x13')]));});});};exports[_0x30ea('0x1f')]=function(_0x2b2d4c){var _0x1e9fe4=this;return new Promise(function(_0x1503da,_0x501733){return db[_0x30ea('0x16')][_0x30ea('0x20')]({'raw':_0x2b2d4c['options']?_0x2b2d4c[_0x30ea('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2b2d4c[_0x30ea('0x17')]?_0x2b2d4c['options'][_0x30ea('0x19')]||null:null,'attributes':_0x2b2d4c[_0x30ea('0x17')]?_0x2b2d4c[_0x30ea('0x17')][_0x30ea('0x1e')]||null:null,'include':_0x2b2d4c['options']?_0x2b2d4c[_0x30ea('0x17')][_0x30ea('0x1b')]?_[_0x30ea('0x1c')](_0x2b2d4c[_0x30ea('0x17')]['include'],function(_0x253115){return{'model':db[_0x253115[_0x30ea('0x1d')]],'as':_0x253115['as'],'attributes':_0x253115['attributes'],'include':_0x253115[_0x30ea('0x1b')]?_[_0x30ea('0x1c')](_0x253115[_0x30ea('0x1b')],function(_0x3b0d64){return{'model':db[_0x3b0d64[_0x30ea('0x1d')]],'as':_0x3b0d64['as'],'attributes':_0x3b0d64[_0x30ea('0x1e')],'include':_0x3b0d64['include']?_[_0x30ea('0x1c')](_0x3b0d64['include'],function(_0xb98ea0){return{'model':db[_0xb98ea0[_0x30ea('0x1d')]],'as':_0xb98ea0['as'],'attributes':_0xb98ea0['attributes']};}):[]};}):[]};}):[]:[]})[_0x30ea('0xb')](function(_0x20e8b5){logger['info']('ShowTrigger',_0x2b2d4c);logger['debug']('ShowTrigger',_0x2b2d4c,JSON[_0x30ea('0x11')](_0x20e8b5));_0x1503da(_0x20e8b5);})[_0x30ea('0x14')](function(_0x379c19){logger[_0x30ea('0x12')](_0x30ea('0x1f'),_0x379c19[_0x30ea('0x13')],_0x2b2d4c);_0x501733(_0x1e9fe4[_0x30ea('0x12')](0x1f4,_0x379c19['message']));});});}; \ No newline at end of file +var _0xc1d0=['rpc','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','ShowTrigger','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf2520b,_0x55548b){var _0x342b8b=function(_0x28422a){while(--_0x28422a){_0xf2520b['push'](_0xf2520b['shift']());}};_0x342b8b(++_0x55548b);}(_0xc1d0,0x18f));var _0x0c1d=function(_0x5aea5a,_0x346fe0){_0x5aea5a=_0x5aea5a-0x0;var _0x557a58=_0xc1d0[_0x5aea5a];return _0x557a58;};'use strict';var _=require(_0x0c1d('0x0'));var util=require(_0x0c1d('0x1'));var moment=require('moment');var BPromise=require(_0x0c1d('0x2'));var rs=require(_0x0c1d('0x3'));var fs=require('fs');var Redis=require(_0x0c1d('0x4'));var db=require(_0x0c1d('0x5'))['db'];var utils=require(_0x0c1d('0x6'));var logger=require(_0x0c1d('0x7'))(_0x0c1d('0x8'));var config=require('../../config/environment');var jayson=require(_0x0c1d('0x9'));var client=jayson[_0x0c1d('0xa')][_0x0c1d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d4788,_0x296519,_0x3d55b7){return new BPromise(function(_0x11bd3c,_0x28d785){return client[_0x0c1d('0xc')](_0x5d4788,_0x3d55b7)['then'](function(_0x55d8b0){logger['info'](_0x0c1d('0xd'),_0x296519,_0x0c1d('0xe'));logger[_0x0c1d('0xf')](_0x0c1d('0x10'),_0x296519,_0x0c1d('0xe'),JSON[_0x0c1d('0x11')](_0x55d8b0));if(_0x55d8b0[_0x0c1d('0x12')]){if(_0x55d8b0[_0x0c1d('0x12')][_0x0c1d('0x13')]===0x1f4){logger[_0x0c1d('0x12')](_0x0c1d('0xd'),_0x296519,_0x55d8b0[_0x0c1d('0x12')][_0x0c1d('0x14')]);return _0x28d785(_0x55d8b0[_0x0c1d('0x12')]['message']);}logger['error'](_0x0c1d('0xd'),_0x296519,_0x55d8b0['error'][_0x0c1d('0x14')]);return _0x11bd3c(_0x55d8b0['error'][_0x0c1d('0x14')]);}else{logger[_0x0c1d('0x15')](_0x0c1d('0xd'),_0x296519,_0x0c1d('0xe'));_0x11bd3c(_0x55d8b0[_0x0c1d('0x16')][_0x0c1d('0x14')]);}})['catch'](function(_0x40594d){logger[_0x0c1d('0x12')](_0x0c1d('0xd'),_0x296519,_0x40594d);_0x28d785(_0x40594d);});});}exports[_0x0c1d('0x17')]=function(_0x1d9bb2){var _0x48dc7f=this;return new Promise(function(_0x46b463,_0x2a1fa5){return db[_0x0c1d('0x18')][_0x0c1d('0x19')]({'raw':_0x1d9bb2[_0x0c1d('0x1a')]?_0x1d9bb2[_0x0c1d('0x1a')][_0x0c1d('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d9bb2[_0x0c1d('0x1a')]?_0x1d9bb2[_0x0c1d('0x1a')][_0x0c1d('0x1c')]||null:null,'attributes':_0x1d9bb2[_0x0c1d('0x1a')]?_0x1d9bb2[_0x0c1d('0x1a')][_0x0c1d('0x1d')]||null:null,'limit':_0x1d9bb2[_0x0c1d('0x1a')]?_0x1d9bb2[_0x0c1d('0x1a')][_0x0c1d('0x1e')]||null:null,'include':_0x1d9bb2[_0x0c1d('0x1a')]?_0x1d9bb2[_0x0c1d('0x1a')][_0x0c1d('0x1f')]?_[_0x0c1d('0x20')](_0x1d9bb2[_0x0c1d('0x1a')][_0x0c1d('0x1f')],function(_0x154a57){return{'model':db[_0x154a57[_0x0c1d('0x21')]],'as':_0x154a57['as'],'attributes':_0x154a57[_0x0c1d('0x1d')],'include':_0x154a57[_0x0c1d('0x1f')]?_[_0x0c1d('0x20')](_0x154a57['include'],function(_0x3d8d46){return{'model':db[_0x3d8d46[_0x0c1d('0x21')]],'as':_0x3d8d46['as'],'attributes':_0x3d8d46[_0x0c1d('0x1d')],'include':_0x3d8d46['include']?_['map'](_0x3d8d46[_0x0c1d('0x1f')],function(_0x4a83cd){return{'model':db[_0x4a83cd[_0x0c1d('0x21')]],'as':_0x4a83cd['as'],'attributes':_0x4a83cd[_0x0c1d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0c1d('0x22')](function(_0x16c999){logger[_0x0c1d('0x15')]('GetTrigger',_0x1d9bb2);logger[_0x0c1d('0xf')](_0x0c1d('0x17'),_0x1d9bb2,JSON[_0x0c1d('0x11')](_0x16c999));_0x46b463(_0x16c999);})[_0x0c1d('0x23')](function(_0x260805){logger['error'](_0x0c1d('0x17'),_0x260805[_0x0c1d('0x14')],_0x1d9bb2);_0x2a1fa5(_0x48dc7f[_0x0c1d('0x12')](0x1f4,_0x260805[_0x0c1d('0x14')]));});});};exports[_0x0c1d('0x24')]=function(_0x75502d){var _0x22d7f6=this;return new Promise(function(_0x17087a,_0x33f44d){return db[_0x0c1d('0x18')]['find']({'raw':_0x75502d[_0x0c1d('0x1a')]?_0x75502d['options'][_0x0c1d('0x1b')]===undefined?!![]:![]:!![],'where':_0x75502d['options']?_0x75502d['options'][_0x0c1d('0x1c')]||null:null,'attributes':_0x75502d[_0x0c1d('0x1a')]?_0x75502d['options'][_0x0c1d('0x1d')]||null:null,'include':_0x75502d[_0x0c1d('0x1a')]?_0x75502d['options']['include']?_['map'](_0x75502d[_0x0c1d('0x1a')][_0x0c1d('0x1f')],function(_0x55b2f3){return{'model':db[_0x55b2f3[_0x0c1d('0x21')]],'as':_0x55b2f3['as'],'attributes':_0x55b2f3[_0x0c1d('0x1d')],'include':_0x55b2f3['include']?_[_0x0c1d('0x20')](_0x55b2f3[_0x0c1d('0x1f')],function(_0x330d12){return{'model':db[_0x330d12[_0x0c1d('0x21')]],'as':_0x330d12['as'],'attributes':_0x330d12[_0x0c1d('0x1d')],'include':_0x330d12[_0x0c1d('0x1f')]?_[_0x0c1d('0x20')](_0x330d12[_0x0c1d('0x1f')],function(_0xfd97f3){return{'model':db[_0xfd97f3['model']],'as':_0xfd97f3['as'],'attributes':_0xfd97f3[_0x0c1d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1eb890){logger[_0x0c1d('0x15')](_0x0c1d('0x24'),_0x75502d);logger[_0x0c1d('0xf')](_0x0c1d('0x24'),_0x75502d,JSON[_0x0c1d('0x11')](_0x1eb890));_0x17087a(_0x1eb890);})[_0x0c1d('0x23')](function(_0x566c8b){logger[_0x0c1d('0x12')](_0x0c1d('0x24'),_0x566c8b['message'],_0x75502d);_0x33f44d(_0x22d7f6[_0x0c1d('0x12')](0x1f4,_0x566c8b['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 6c827cf..14d6180 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 _0x25f8=['delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','./trunk.controller','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update'];(function(_0x4534af,_0x48254f){var _0x2db6e2=function(_0x3c5d79){while(--_0x3c5d79){_0x4534af['push'](_0x4534af['shift']());}};_0x2db6e2(++_0x48254f);}(_0x25f8,0xfa));var _0x825f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x25f8[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x825f('0x0'));var util=require('util');var path=require(_0x825f('0x1'));var timeout=require('connect-timeout');var express=require(_0x825f('0x2'));var router=express['Router']();var fs_extra=require(_0x825f('0x3'));var auth=require(_0x825f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x825f('0x5'));router['get']('/',auth[_0x825f('0x6')](),controller[_0x825f('0x7')]);router['get'](_0x825f('0x8'),auth['isAuthenticated'](),controller[_0x825f('0x9')]);router[_0x825f('0xa')](_0x825f('0xb'),auth[_0x825f('0x6')](),controller[_0x825f('0xc')]);router['post']('/',auth[_0x825f('0x6')](),controller[_0x825f('0xd')]);router[_0x825f('0xe')](_0x825f('0x8'),auth[_0x825f('0x6')](),controller[_0x825f('0xf')]);router[_0x825f('0x10')]('/:id',auth[_0x825f('0x6')](),controller[_0x825f('0x11')]);module[_0x825f('0x12')]=router; \ No newline at end of file +var _0x2530=['post','clone','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','index','/:id','isAuthenticated'];(function(_0x34a4c2,_0x2653fd){var _0x5d5d37=function(_0x7659a7){while(--_0x7659a7){_0x34a4c2['push'](_0x34a4c2['shift']());}};_0x5d5d37(++_0x2653fd);}(_0x2530,0xb2));var _0x0253=function(_0x3df8b8,_0x57534f){_0x3df8b8=_0x3df8b8-0x0;var _0x391c84=_0x2530[_0x3df8b8];return _0x391c84;};'use strict';var multer=require(_0x0253('0x0'));var util=require(_0x0253('0x1'));var path=require(_0x0253('0x2'));var timeout=require('connect-timeout');var express=require(_0x0253('0x3'));var router=express[_0x0253('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0253('0x5'));var interaction=require(_0x0253('0x6'));var config=require('../../config/environment');var controller=require(_0x0253('0x7'));router[_0x0253('0x8')]('/',auth['isAuthenticated'](),controller[_0x0253('0x9')]);router['get'](_0x0253('0xa'),auth[_0x0253('0xb')](),controller['show']);router[_0x0253('0xc')]('/:id/clone',auth['isAuthenticated'](),controller[_0x0253('0xd')]);router[_0x0253('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0253('0xe')](_0x0253('0xa'),auth[_0x0253('0xb')](),controller[_0x0253('0xf')]);router[_0x0253('0x10')](_0x0253('0xa'),auth[_0x0253('0xb')](),controller[_0x0253('0x11')]);module[_0x0253('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index da57a0d..0bb2d22 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 _0x1c28=['update','update,nonat','sequelize','exports','name','friend','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','ENUM','yes','nonat','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic'];(function(_0x111332,_0x28ba9b){var _0x4ca61a=function(_0x1789c6){while(--_0x1789c6){_0x111332['push'](_0x111332['shift']());}};_0x4ca61a(++_0x28ba9b);}(_0x1c28,0x95));var _0x81c2=function(_0x5b0692,_0x2699a1){_0x5b0692=_0x5b0692-0x0;var _0x331a7b=_0x1c28[_0x5b0692];return _0x331a7b;};'use strict';var Sequelize=require(_0x81c2('0x0'));module[_0x81c2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x81c2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x81c2('0x3'),'user',_0x81c2('0x4')),'allowNull':![],'defaultValue':_0x81c2('0x3')},'context':{'type':Sequelize[_0x81c2('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x81c2('0x6'),'ALLOWED_PASSED_SCREEN',_0x81c2('0x7'),_0x81c2('0x8'),_0x81c2('0x9'),_0x81c2('0xa'),'PROHIB_FAILED_SCREEN',_0x81c2('0xb'))},'deny':{'type':Sequelize[_0x81c2('0x5')]},'permit':{'type':Sequelize[_0x81c2('0x5')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x81c2('0x5')]},'remotesecret':{'type':Sequelize[_0x81c2('0x5')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x81c2('0xc'),'set':function(_0x200a4f){this[_0x81c2('0xd')](_0x81c2('0xe'),_0x200a4f?_0x200a4f[_0x81c2('0xf')](','):null);},'get':function(){return this[_0x81c2('0x10')](_0x81c2('0xe'))?this['getDataValue']('transport')[_0x81c2('0x11')](','):null;},'comment':_0x81c2('0x12')},'dtmfmode':{'type':Sequelize['ENUM'](_0x81c2('0x13'),_0x81c2('0x14'),_0x81c2('0x15'),_0x81c2('0x16'),_0x81c2('0x17')),'defaultValue':_0x81c2('0x13')},'directmedia':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no',_0x81c2('0x1a'),'update',_0x81c2('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x81c2('0x5')]},'nat':{'type':Sequelize[_0x81c2('0x5')],'defaultValue':_0x81c2('0x1c'),'set':function(_0x1f5715){this[_0x81c2('0xd')](_0x81c2('0x1d'),_0x1f5715?_0x1f5715['join'](','):null);},'get':function(){return this['getDataValue'](_0x81c2('0x1d'))?this['getDataValue'](_0x81c2('0x1d'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x81c2('0x5')]},'namedcallgroup':{'type':Sequelize[_0x81c2('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x81c2('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x81c2('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x81c2('0x5')],'defaultValue':_0x81c2('0x1e')},'allow':{'type':Sequelize[_0x81c2('0x5')],'allowNull':![],'defaultValue':_0x81c2('0x1f'),'set':function(_0x5f4dd3){this['setDataValue'](_0x81c2('0x20'),_0x5f4dd3?_0x5f4dd3[_0x81c2('0xf')](';'):_0x81c2('0x1f'));},'get':function(){return this['getDataValue'](_0x81c2('0x20'))?this[_0x81c2('0x10')](_0x81c2('0x20'))[_0x81c2('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x81c2('0x19'),'no')},'insecure':{'type':Sequelize[_0x81c2('0x5')],'defaultValue':_0x81c2('0x21'),'set':function(_0x1b565b){this['setDataValue']('insecure',_0x1b565b?_0x1b565b[_0x81c2('0xf')](','):null);},'get':function(){return this[_0x81c2('0x10')](_0x81c2('0x22'))?this[_0x81c2('0x10')](_0x81c2('0x22'))[_0x81c2('0x11')](','):null;},'comment':_0x81c2('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x81c2('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no',_0x81c2('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0x81c2('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x81c2('0x19'),'no')},'accountcode':{'type':Sequelize[_0x81c2('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x81c2('0x5')]},'callcounter':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no'),'defaultValue':_0x81c2('0x19')},'busylevel':{'type':Sequelize[_0x81c2('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x81c2('0x18')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x81c2('0x5')]},'videosupport':{'type':Sequelize[_0x81c2('0x18')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x81c2('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x81c2('0x19'),'no')},'mailbox':{'type':Sequelize[_0x81c2('0x5')]},'session_timers':{'type':Sequelize[_0x81c2('0x18')]('accept','refuse',_0x81c2('0x26'))},'session_expires':{'type':Sequelize[_0x81c2('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x81c2('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x81c2('0x27'),_0x81c2('0x28')),'defaultValue':_0x81c2('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x81c2('0x5')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x81c2('0x5')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x81c2('0x25')](0x5)},'qualify':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no'),'defaultValue':_0x81c2('0x19')},'keepalive':{'type':Sequelize[_0x81c2('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x81c2('0x5')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x81c2('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x81c2('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x81c2('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no',_0x81c2('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x81c2('0x5')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x81c2('0x25')](0xb)},'timerb':{'type':Sequelize[_0x81c2('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x81c2('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x81c2('0x5')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x81c2('0x5')]},'use_q850_reason':{'type':Sequelize[_0x81c2('0x5')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no')},'force_avp':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no')},'icesupport':{'type':Sequelize[_0x81c2('0x18')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x81c2('0x18')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no',_0x81c2('0x2a'),_0x81c2('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x81c2('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x81c2('0x5')]},'dtlscipher':{'type':Sequelize[_0x81c2('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x81c2('0x5')]},'dtlssetup':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x2c'),_0x81c2('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x81c2('0x5')]},'usereqphone':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x81c2('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x81c2('0x19'),'no')},'vmexten':{'type':Sequelize[_0x81c2('0x5')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x81c2('0x5')]},'parkinglot':{'type':Sequelize[_0x81c2('0x5')]},'description':{'type':Sequelize[_0x81c2('0x5')]},'host':{'type':Sequelize[_0x81c2('0x5')],'defaultValue':_0x81c2('0x2e')},'canreinvite':{'type':Sequelize[_0x81c2('0x18')](_0x81c2('0x19'),'no','nonat',_0x81c2('0x2f'),_0x81c2('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x81c2('0x5')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x81c2('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb9fb=['setDataValue','transport','join','getDataValue','split','rfc2833','auto','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','always','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','BOOLEAN','exports','STRING','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x48fad2,_0x1a1c5b){var _0x3cc04e=function(_0x111f14){while(--_0x111f14){_0x48fad2['push'](_0x48fad2['shift']());}};_0x3cc04e(++_0x1a1c5b);}(_0xb9fb,0x172));var _0xbb9f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb9fb[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0xbb9f('0x0')]={'name':{'type':Sequelize[_0xbb9f('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x3'),_0xbb9f('0x4'),_0xbb9f('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xbb9f('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xbb9f('0x6'),_0xbb9f('0x7'),_0xbb9f('0x8'),'ALLOWED',_0xbb9f('0x9'),_0xbb9f('0xa'),_0xbb9f('0xb'),_0xbb9f('0xc'))},'deny':{'type':Sequelize[_0xbb9f('0x1')]},'permit':{'type':Sequelize[_0xbb9f('0x1')]},'secret':{'type':Sequelize[_0xbb9f('0x1')]},'md5secret':{'type':Sequelize[_0xbb9f('0x1')]},'remotesecret':{'type':Sequelize[_0xbb9f('0x1')]},'transport':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':_0xbb9f('0xd'),'set':function(_0x44bb02){this[_0xbb9f('0xe')](_0xbb9f('0xf'),_0x44bb02?_0x44bb02[_0xbb9f('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xbb9f('0x11')](_0xbb9f('0xf'))[_0xbb9f('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xbb9f('0x13'),'info','shortinfo','inband',_0xbb9f('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xbb9f('0x15'),_0xbb9f('0x16'),_0xbb9f('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbb9f('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb9f('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb9f('0x1')]},'nat':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':_0xbb9f('0x18'),'set':function(_0x1ef9a5){this[_0xbb9f('0xe')](_0xbb9f('0x19'),_0x1ef9a5?_0x1ef9a5['join'](','):null);},'get':function(){return this[_0xbb9f('0x11')](_0xbb9f('0x19'))?this[_0xbb9f('0x11')](_0xbb9f('0x19'))[_0xbb9f('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xbb9f('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb9f('0x1')]},'pickupgroup':{'type':Sequelize[_0xbb9f('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xbb9f('0x1')]},'language':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbb9f('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':_0xbb9f('0x1a')},'allow':{'type':Sequelize[_0xbb9f('0x1')],'allowNull':![],'defaultValue':_0xbb9f('0x1b'),'set':function(_0x516010){this[_0xbb9f('0xe')]('allow',_0x516010?_0x516010[_0xbb9f('0x10')](';'):_0xbb9f('0x1b'));},'get':function(){return this[_0xbb9f('0x11')](_0xbb9f('0x1c'))?this[_0xbb9f('0x11')](_0xbb9f('0x1c'))[_0xbb9f('0x12')](';'):null;},'comment':_0xbb9f('0x1d')},'autoframing':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'insecure':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':'port,invite','set':function(_0xe439ab){this[_0xbb9f('0xe')](_0xbb9f('0x1f'),_0xe439ab?_0xe439ab['join'](','):null);},'get':function(){return this[_0xbb9f('0x11')]('insecure')?this['getDataValue']('insecure')[_0xbb9f('0x12')](','):null;},'comment':_0xbb9f('0x20')},'trustrpid':{'type':Sequelize['ENUM'](_0xbb9f('0x1e'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xbb9f('0x1e'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb9f('0x1e'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xbb9f('0x1')]},'callerid':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':_0xbb9f('0x21')},'amaflags':{'type':Sequelize[_0xbb9f('0x1')]},'callcounter':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no'),'defaultValue':_0xbb9f('0x1e')},'busylevel':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xbb9f('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xbb9f('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no',_0xbb9f('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xbb9f('0x1')]},'session_timers':{'type':Sequelize[_0xbb9f('0x2')]('accept',_0xbb9f('0x24'),_0xbb9f('0x25'))},'session_expires':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x26'),_0xbb9f('0x27')),'defaultValue':_0xbb9f('0x27')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xbb9f('0x1')]},'port':{'type':Sequelize[_0xbb9f('0x22')](0x5)},'qualify':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no'),'defaultValue':_0xbb9f('0x1e')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb9f('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no',_0xbb9f('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'timerb':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xbb9f('0x1')]},'contactacl':{'type':Sequelize[_0xbb9f('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xbb9f('0x1')]},'maxforwards':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'encryption':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'dtlsenable':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'dtlsverify':{'type':Sequelize[_0xbb9f('0x2')]('yes','no',_0xbb9f('0x29'),_0xbb9f('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xbb9f('0x22')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xbb9f('0x1')]},'dtlscipher':{'type':Sequelize[_0xbb9f('0x1')]},'dtlscafile':{'type':Sequelize[_0xbb9f('0x1')]},'dtlscapath':{'type':Sequelize[_0xbb9f('0x1')]},'dtlssetup':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x2b'),_0xbb9f('0x2c'),_0xbb9f('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xbb9f('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb9f('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb9f('0x1')]},'call_limit':{'type':Sequelize[_0xbb9f('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'subscribemwi':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xbb9f('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb9f('0x1')]},'parkinglot':{'type':Sequelize[_0xbb9f('0x1')]},'description':{'type':Sequelize[_0xbb9f('0x1')]},'host':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':_0xbb9f('0x2e')},'canreinvite':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x1e'),'no','nonat',_0xbb9f('0x16'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb9f('0x1')]},'otherFields':{'type':Sequelize[_0xbb9f('0x1')]},'active':{'type':Sequelize[_0xbb9f('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb9f('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 de53558..7135a89 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 _0x9bde=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0x3070d5,_0x1d3284){var _0x2067e6=function(_0x15fe16){while(--_0x15fe16){_0x3070d5['push'](_0x3070d5['shift']());}};_0x2067e6(++_0x1d3284);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3f9ec0,_0x1dfe15){_0x3f9ec0=_0x3f9ec0-0x0;var _0x535722=_0x9bde[_0x3f9ec0];return _0x535722;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));}; \ No newline at end of file +var _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4c904d,_0x206fa6){var _0x4ee0eb=function(_0x565bcd){while(--_0x565bcd){_0x4c904d['push'](_0x4c904d['shift']());}};_0x4ee0eb(++_0x206fa6);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xf3cd[_0xce9195];return _0x530fe6;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index d610d3f..c587399 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 _0xeb25=['moment','request-promise','path','../../config/environment','define','Trunk','lodash','../../config/logger','api'];(function(_0xdc5cd3,_0xba713b){var _0x28d961=function(_0x2c11d9){while(--_0x2c11d9){_0xdc5cd3['push'](_0xdc5cd3['shift']());}};_0x28d961(++_0xba713b);}(_0xeb25,0x1a4));var _0x5eb2=function(_0x1a0d5f,_0x2dde4b){_0x1a0d5f=_0x1a0d5f-0x0;var _0x59d671=_0xeb25[_0x1a0d5f];return _0x59d671;};'use strict';var _=require(_0x5eb2('0x0'));var util=require('util');var logger=require(_0x5eb2('0x1'))(_0x5eb2('0x2'));var moment=require(_0x5eb2('0x3'));var BPromise=require('bluebird');var rp=require(_0x5eb2('0x4'));var fs=require('fs');var path=require(_0x5eb2('0x5'));var rimraf=require('rimraf');var config=require(_0x5eb2('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x513e52,_0x31ff21){return _0x513e52[_0x5eb2('0x7')](_0x5eb2('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['bluebird','rimraf','exports','define','tools_trunks','lodash','util','../../config/logger','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0120,0x1e2));var _0x0012=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0120[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))('api');var moment=require(_0x0012('0x3'));var BPromise=require(_0x0012('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0012('0x5'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x0012('0x6')]=function(_0xd20c84,_0x191890){return _0xd20c84[_0x0012('0x7')]('Trunk',attributes,{'tableName':_0x0012('0x8'),'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 5321cc2..8c86521 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 _0x3971=['stringify','find','ShowTrunk','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0xd03b8d,_0x315b17){var _0x5a3fd5=function(_0x389288){while(--_0x389288){_0xd03b8d['push'](_0xd03b8d['shift']());}};_0x5a3fd5(++_0x315b17);}(_0x3971,0xad));var _0x1397=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x3971[_0x5c5c52];return _0x4229ff;};'use strict';var _=require(_0x1397('0x0'));var util=require(_0x1397('0x1'));var moment=require(_0x1397('0x2'));var BPromise=require(_0x1397('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1397('0x4'))['db'];var utils=require(_0x1397('0x5'));var logger=require(_0x1397('0x6'))(_0x1397('0x7'));var config=require(_0x1397('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46f516,_0x3f17a3,_0x270485){return new BPromise(function(_0x53262a,_0x5d4182){return client['request'](_0x46f516,_0x270485)[_0x1397('0x9')](function(_0x3023f4){logger['info']('Trunk,\x20%s,\x20%s',_0x3f17a3,_0x1397('0xa'));logger[_0x1397('0xb')](_0x1397('0xc'),_0x3f17a3,_0x1397('0xa'),JSON['stringify'](_0x3023f4));if(_0x3023f4[_0x1397('0xd')]){if(_0x3023f4[_0x1397('0xd')][_0x1397('0xe')]===0x1f4){logger[_0x1397('0xd')](_0x1397('0xf'),_0x3f17a3,_0x3023f4[_0x1397('0xd')][_0x1397('0x10')]);return _0x5d4182(_0x3023f4['error'][_0x1397('0x10')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x3f17a3,_0x3023f4[_0x1397('0xd')]['message']);return _0x53262a(_0x3023f4[_0x1397('0xd')]['message']);}else{logger[_0x1397('0x11')](_0x1397('0xf'),_0x3f17a3,_0x1397('0xa'));_0x53262a(_0x3023f4[_0x1397('0x12')][_0x1397('0x10')]);}})[_0x1397('0x13')](function(_0x31b563){logger[_0x1397('0xd')](_0x1397('0xf'),_0x3f17a3,_0x31b563);_0x5d4182(_0x31b563);});});}exports[_0x1397('0x14')]=function(_0xe4d73b){var _0x3b66c7=this;return new Promise(function(_0x524377,_0x9ae1bb){return db[_0x1397('0x15')][_0x1397('0x16')]({'raw':_0xe4d73b[_0x1397('0x17')]?_0xe4d73b[_0x1397('0x17')][_0x1397('0x18')]===undefined?!![]:![]:!![],'where':_0xe4d73b['options']?_0xe4d73b['options'][_0x1397('0x19')]||null:null,'attributes':_0xe4d73b[_0x1397('0x17')]?_0xe4d73b['options'][_0x1397('0x1a')]||null:null,'limit':_0xe4d73b[_0x1397('0x17')]?_0xe4d73b['options'][_0x1397('0x1b')]||null:null,'include':_0xe4d73b[_0x1397('0x17')]?_0xe4d73b[_0x1397('0x17')][_0x1397('0x1c')]?_['map'](_0xe4d73b[_0x1397('0x17')][_0x1397('0x1c')],function(_0x21fe77){return{'model':db[_0x21fe77['model']],'as':_0x21fe77['as'],'attributes':_0x21fe77[_0x1397('0x1a')],'include':_0x21fe77[_0x1397('0x1c')]?_['map'](_0x21fe77[_0x1397('0x1c')],function(_0x4edc31){return{'model':db[_0x4edc31[_0x1397('0x1d')]],'as':_0x4edc31['as'],'attributes':_0x4edc31[_0x1397('0x1a')],'include':_0x4edc31[_0x1397('0x1c')]?_[_0x1397('0x1e')](_0x4edc31['include'],function(_0x2fa67e){return{'model':db[_0x2fa67e[_0x1397('0x1d')]],'as':_0x2fa67e['as'],'attributes':_0x2fa67e[_0x1397('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1397('0x9')](function(_0x398bf2){logger[_0x1397('0x11')](_0x1397('0x14'),_0xe4d73b);logger[_0x1397('0xb')](_0x1397('0x14'),_0xe4d73b,JSON[_0x1397('0x1f')](_0x398bf2));_0x524377(_0x398bf2);})[_0x1397('0x13')](function(_0x317438){logger['error'](_0x1397('0x14'),_0x317438[_0x1397('0x10')],_0xe4d73b);_0x9ae1bb(_0x3b66c7[_0x1397('0xd')](0x1f4,_0x317438[_0x1397('0x10')]));});});};exports['ShowTrunk']=function(_0x4ebc26){var _0x2c77db=this;return new Promise(function(_0x54b051,_0x8f36fb){return db['Trunk'][_0x1397('0x20')]({'raw':_0x4ebc26[_0x1397('0x17')]?_0x4ebc26[_0x1397('0x17')][_0x1397('0x18')]===undefined?!![]:![]:!![],'where':_0x4ebc26[_0x1397('0x17')]?_0x4ebc26['options'][_0x1397('0x19')]||null:null,'attributes':_0x4ebc26[_0x1397('0x17')]?_0x4ebc26[_0x1397('0x17')][_0x1397('0x1a')]||null:null,'include':_0x4ebc26[_0x1397('0x17')]?_0x4ebc26[_0x1397('0x17')]['include']?_[_0x1397('0x1e')](_0x4ebc26[_0x1397('0x17')][_0x1397('0x1c')],function(_0x298ddf){return{'model':db[_0x298ddf[_0x1397('0x1d')]],'as':_0x298ddf['as'],'attributes':_0x298ddf['attributes'],'include':_0x298ddf[_0x1397('0x1c')]?_[_0x1397('0x1e')](_0x298ddf[_0x1397('0x1c')],function(_0x27dbc3){return{'model':db[_0x27dbc3[_0x1397('0x1d')]],'as':_0x27dbc3['as'],'attributes':_0x27dbc3['attributes'],'include':_0x27dbc3['include']?_[_0x1397('0x1e')](_0x27dbc3[_0x1397('0x1c')],function(_0x3ad9a9){return{'model':db[_0x3ad9a9[_0x1397('0x1d')]],'as':_0x3ad9a9['as'],'attributes':_0x3ad9a9[_0x1397('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16d3ae){logger[_0x1397('0x11')]('ShowTrunk',_0x4ebc26);logger[_0x1397('0xb')]('ShowTrunk',_0x4ebc26,JSON['stringify'](_0x16d3ae));_0x54b051(_0x16d3ae);})[_0x1397('0x13')](function(_0x319e70){logger[_0x1397('0xd')](_0x1397('0x21'),_0x319e70[_0x1397('0x10')],_0x4ebc26);_0x8f36fb(_0x2c77db[_0x1397('0xd')](0x1f4,_0x319e70[_0x1397('0x10')]));});});}; \ No newline at end of file +var _0x645a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','map','model','include','ShowTrunk','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x97724f,_0x3ca050){var _0x34ef53=function(_0x361fab){while(--_0x361fab){_0x97724f['push'](_0x97724f['shift']());}};_0x34ef53(++_0x3ca050);}(_0x645a,0x171));var _0xa645=function(_0x13b8b1,_0x42882a){_0x13b8b1=_0x13b8b1-0x0;var _0x467f68=_0x645a[_0x13b8b1];return _0x467f68;};'use strict';var _=require(_0xa645('0x0'));var util=require(_0xa645('0x1'));var moment=require(_0xa645('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa645('0x3'))['db'];var utils=require(_0xa645('0x4'));var logger=require('../../config/logger')(_0xa645('0x5'));var config=require(_0xa645('0x6'));var jayson=require(_0xa645('0x7'));var client=jayson[_0xa645('0x8')][_0xa645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x456dd9,_0xb3be0,_0x269e6a){return new BPromise(function(_0x27aa1a,_0x12fa82){return client[_0xa645('0xa')](_0x456dd9,_0x269e6a)[_0xa645('0xb')](function(_0x279e5f){logger[_0xa645('0xc')](_0xa645('0xd'),_0xb3be0,_0xa645('0xe'));logger[_0xa645('0xf')](_0xa645('0x10'),_0xb3be0,_0xa645('0xe'),JSON[_0xa645('0x11')](_0x279e5f));if(_0x279e5f['error']){if(_0x279e5f[_0xa645('0x12')][_0xa645('0x13')]===0x1f4){logger['error'](_0xa645('0xd'),_0xb3be0,_0x279e5f[_0xa645('0x12')][_0xa645('0x14')]);return _0x12fa82(_0x279e5f['error'][_0xa645('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0xb3be0,_0x279e5f[_0xa645('0x12')][_0xa645('0x14')]);return _0x27aa1a(_0x279e5f[_0xa645('0x12')][_0xa645('0x14')]);}else{logger[_0xa645('0xc')](_0xa645('0xd'),_0xb3be0,_0xa645('0xe'));_0x27aa1a(_0x279e5f[_0xa645('0x15')]['message']);}})[_0xa645('0x16')](function(_0x273297){logger[_0xa645('0x12')](_0xa645('0xd'),_0xb3be0,_0x273297);_0x12fa82(_0x273297);});});}exports[_0xa645('0x17')]=function(_0x5151a8){var _0xedd8f8=this;return new Promise(function(_0x812844,_0x3fff0c){return db[_0xa645('0x18')]['findAll']({'raw':_0x5151a8['options']?_0x5151a8[_0xa645('0x19')][_0xa645('0x1a')]===undefined?!![]:![]:!![],'where':_0x5151a8[_0xa645('0x19')]?_0x5151a8[_0xa645('0x19')][_0xa645('0x1b')]||null:null,'attributes':_0x5151a8[_0xa645('0x19')]?_0x5151a8['options'][_0xa645('0x1c')]||null:null,'limit':_0x5151a8[_0xa645('0x19')]?_0x5151a8[_0xa645('0x19')][_0xa645('0x1d')]||null:null,'include':_0x5151a8[_0xa645('0x19')]?_0x5151a8[_0xa645('0x19')]['include']?_[_0xa645('0x1e')](_0x5151a8[_0xa645('0x19')]['include'],function(_0x2bb343){return{'model':db[_0x2bb343[_0xa645('0x1f')]],'as':_0x2bb343['as'],'attributes':_0x2bb343[_0xa645('0x1c')],'include':_0x2bb343[_0xa645('0x20')]?_[_0xa645('0x1e')](_0x2bb343[_0xa645('0x20')],function(_0x19b1d6){return{'model':db[_0x19b1d6['model']],'as':_0x19b1d6['as'],'attributes':_0x19b1d6[_0xa645('0x1c')],'include':_0x19b1d6['include']?_[_0xa645('0x1e')](_0x19b1d6['include'],function(_0x4dfda2){return{'model':db[_0x4dfda2[_0xa645('0x1f')]],'as':_0x4dfda2['as'],'attributes':_0x4dfda2[_0xa645('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa645('0xb')](function(_0xc79663){logger[_0xa645('0xc')](_0xa645('0x17'),_0x5151a8);logger[_0xa645('0xf')](_0xa645('0x17'),_0x5151a8,JSON[_0xa645('0x11')](_0xc79663));_0x812844(_0xc79663);})[_0xa645('0x16')](function(_0x3c2a37){logger['error'](_0xa645('0x17'),_0x3c2a37[_0xa645('0x14')],_0x5151a8);_0x3fff0c(_0xedd8f8['error'](0x1f4,_0x3c2a37['message']));});});};exports[_0xa645('0x21')]=function(_0x15ef15){var _0x1ed60d=this;return new Promise(function(_0x48f317,_0x65aab0){return db[_0xa645('0x18')]['find']({'raw':_0x15ef15[_0xa645('0x19')]?_0x15ef15[_0xa645('0x19')][_0xa645('0x1a')]===undefined?!![]:![]:!![],'where':_0x15ef15['options']?_0x15ef15[_0xa645('0x19')][_0xa645('0x1b')]||null:null,'attributes':_0x15ef15[_0xa645('0x19')]?_0x15ef15[_0xa645('0x19')][_0xa645('0x1c')]||null:null,'include':_0x15ef15[_0xa645('0x19')]?_0x15ef15[_0xa645('0x19')][_0xa645('0x20')]?_[_0xa645('0x1e')](_0x15ef15[_0xa645('0x19')][_0xa645('0x20')],function(_0x224772){return{'model':db[_0x224772[_0xa645('0x1f')]],'as':_0x224772['as'],'attributes':_0x224772[_0xa645('0x1c')],'include':_0x224772['include']?_[_0xa645('0x1e')](_0x224772[_0xa645('0x20')],function(_0x4b39ea){return{'model':db[_0x4b39ea[_0xa645('0x1f')]],'as':_0x4b39ea['as'],'attributes':_0x4b39ea[_0xa645('0x1c')],'include':_0x4b39ea['include']?_[_0xa645('0x1e')](_0x4b39ea['include'],function(_0x2a8181){return{'model':db[_0x2a8181[_0xa645('0x1f')]],'as':_0x2a8181['as'],'attributes':_0x2a8181[_0xa645('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa645('0xb')](function(_0x5cda3f){logger[_0xa645('0xc')](_0xa645('0x21'),_0x15ef15);logger[_0xa645('0xf')]('ShowTrunk',_0x15ef15,JSON[_0xa645('0x11')](_0x5cda3f));_0x48f317(_0x5cda3f);})[_0xa645('0x16')](function(_0x26c3eb){logger[_0xa645('0x12')](_0xa645('0x21'),_0x26c3eb['message'],_0x15ef15);_0x65aab0(_0x1ed60d[_0xa645('0x12')](0x1f4,_0x26c3eb[_0xa645('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index b6c84b6..0614546 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 _0xfd23=['exports','express','Router','isAuthenticated','update'];(function(_0x1df470,_0x43cff9){var _0x277849=function(_0x164f32){while(--_0x164f32){_0x1df470['push'](_0x1df470['shift']());}};_0x277849(++_0x43cff9);}(_0xfd23,0x1aa));var _0x3fd2=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xfd23[_0x4ae829];return _0x256b31;};'use strict';var express=require(_0x3fd2('0x0'));var router=express[_0x3fd2('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router['put']('/:id',auth[_0x3fd2('0x2')](),controller[_0x3fd2('0x3')]);module[_0x3fd2('0x4')]=router; \ No newline at end of file +var _0x7cc1=['put','/:id','isAuthenticated','exports','express','Router','../../components/auth/service','./user-setting.controller'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7cc1,0x64));var _0x17cc=function(_0x1e145e,_0x9704c9){_0x1e145e=_0x1e145e-0x0;var _0x16a959=_0x7cc1[_0x1e145e];return _0x16a959;};'use strict';var express=require(_0x17cc('0x0'));var router=express[_0x17cc('0x1')]();var auth=require(_0x17cc('0x2'));var controller=require(_0x17cc('0x3'));router[_0x17cc('0x4')](_0x17cc('0x5'),auth[_0x17cc('0x6')](),controller['update']);module[_0x17cc('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 150f148..52bc939 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 _0x4823=['UserId','sequelize','error','info','debug','exports','ENUM','BOOLEAN','TEXT','INTEGER'];(function(_0x167bed,_0x1ae56e){var _0x2e0d45=function(_0xe56428){while(--_0xe56428){_0x167bed['push'](_0x167bed['shift']());}};_0x2e0d45(++_0x1ae56e);}(_0x4823,0xf1));var _0x3482=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x4823[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0x3482('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x3482('0x1'),'warning',_0x3482('0x2'),_0x3482('0x3')];module[_0x3482('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3482('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3482('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3482('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3482('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3482('0x8')],'unique':_0x3482('0x9')}}; \ No newline at end of file +var _0x690f=['BOOLEAN','TEXT','UserId','sequelize','error','info','debug','exports','ENUM'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x690f,0x108));var _0xf690=function(_0x80cae7,_0xa639c4){_0x80cae7=_0x80cae7-0x0;var _0x1ba1f6=_0x690f[_0x80cae7];return _0x1ba1f6;};'use strict';var Sequelize=require(_0xf690('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf690('0x1'),'warning',_0xf690('0x2'),_0xf690('0x3')];module[_0xf690('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf690('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf690('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf690('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf690('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xf690('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 946012e..cfbdf6b 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 _0x6c63=['role','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','update','sendStatus','error','stack','name','send','user'];(function(_0x4216bd,_0x3a3358){var _0x5f1497=function(_0x4580c7){while(--_0x4580c7){_0x4216bd['push'](_0x4216bd['shift']());}};_0x5f1497(++_0x3a3358);}(_0x6c63,0x1ee));var _0x36c6=function(_0x481991,_0x4df104){_0x481991=_0x481991-0x0;var _0x4d471d=_0x6c63[_0x481991];return _0x4d471d;};'use strict';var _=require(_0x36c6('0x0'));var Redis=require(_0x36c6('0x1'));var logger=require(_0x36c6('0x2'))(_0x36c6('0x3'));var config=require(_0x36c6('0x4'));var db=require(_0x36c6('0x5'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x36c6('0x6')]));require(_0x36c6('0x7'))[_0x36c6('0x8')](socket);config[_0x36c6('0x6')]=_[_0x36c6('0x9')](config['redis'],{'host':_0x36c6('0xa'),'port':0x18eb});function respondWithResult(_0x16f996,_0x24268d){_0x24268d=_0x24268d||0xc8;return function(_0x1c3752){if(_0x1c3752){return _0x16f996[_0x36c6('0xb')](_0x24268d)['json'](_0x1c3752);}};}function saveUpdates(_0xe90f44){return function(_0x478b18){if(_0x478b18){return _0x478b18[_0x36c6('0xc')](_0xe90f44)['then'](function(_0x25fcbd){return _0x25fcbd;});}return null;};}function handleEntityNotFound(_0xbe21dc){return function(_0x2323b4){if(!_0x2323b4){_0xbe21dc[_0x36c6('0xd')](0x194);}return _0x2323b4;};}function handleError(_0x3a058a,_0x441cd9){_0x441cd9=_0x441cd9||0x1f4;return function(_0x3fe114){logger[_0x36c6('0xe')](_0x3fe114[_0x36c6('0xf')]);if(_0x3fe114[_0x36c6('0x10')]){delete _0x3fe114[_0x36c6('0x10')];}_0x3a058a[_0x36c6('0xb')](_0x441cd9)[_0x36c6('0x11')](_0x3fe114);};}exports[_0x36c6('0xc')]=function(_0x4a0e25,_0x5833fe){if(_0x4a0e25[_0x36c6('0x12')][_0x36c6('0x13')]!=='admin')throw new Error(_0x36c6('0x14'));if(isNaN(Number(_0x4a0e25[_0x36c6('0x15')]['id'])))throw new Error(_0x36c6('0x16'));return db[_0x36c6('0x17')][_0x36c6('0x18')]({'where':{'id':_0x4a0e25[_0x36c6('0x15')]['id']}})[_0x36c6('0x19')](handleEntityNotFound(_0x5833fe,null))[_0x36c6('0x19')](saveUpdates(_0x4a0e25[_0x36c6('0x1a')],null))[_0x36c6('0x19')](respondWithResult(_0x5833fe,null))['catch'](handleError(_0x5833fe,null));}; \ No newline at end of file +var _0xe630=['params','Invalid\x20user\x20setting\x20id','UserSetting','body','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error','stack','name','send','role','admin','Unauthorized'];(function(_0x3e8c6d,_0x1b536f){var _0x450309=function(_0x3cbb01){while(--_0x3cbb01){_0x3e8c6d['push'](_0x3e8c6d['shift']());}};_0x450309(++_0x1b536f);}(_0xe630,0x149));var _0x0e63=function(_0x2825ae,_0x47550e){_0x2825ae=_0x2825ae-0x0;var _0x4601fe=_0xe630[_0x2825ae];return _0x4601fe;};'use strict';var _=require(_0x0e63('0x0'));var Redis=require(_0x0e63('0x1'));var logger=require('../../config/logger')(_0x0e63('0x2'));var config=require(_0x0e63('0x3'));var db=require(_0x0e63('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x0e63('0x5')]));require(_0x0e63('0x6'))[_0x0e63('0x7')](socket);config['redis']=_[_0x0e63('0x8')](config[_0x0e63('0x5')],{'host':_0x0e63('0x9'),'port':0x18eb});function respondWithResult(_0x3e461b,_0x32e418){_0x32e418=_0x32e418||0xc8;return function(_0x563ad9){if(_0x563ad9){return _0x3e461b[_0x0e63('0xa')](_0x32e418)[_0x0e63('0xb')](_0x563ad9);}};}function saveUpdates(_0xf04128){return function(_0x1c11f2){if(_0x1c11f2){return _0x1c11f2[_0x0e63('0xc')](_0xf04128)[_0x0e63('0xd')](function(_0x16f195){return _0x16f195;});}return null;};}function handleEntityNotFound(_0x1240ea){return function(_0x3307f3){if(!_0x3307f3){_0x1240ea[_0x0e63('0xe')](0x194);}return _0x3307f3;};}function handleError(_0x407033,_0x4b88fe){_0x4b88fe=_0x4b88fe||0x1f4;return function(_0x29a1ad){logger[_0x0e63('0xf')](_0x29a1ad[_0x0e63('0x10')]);if(_0x29a1ad[_0x0e63('0x11')]){delete _0x29a1ad[_0x0e63('0x11')];}_0x407033[_0x0e63('0xa')](_0x4b88fe)[_0x0e63('0x12')](_0x29a1ad);};}exports[_0x0e63('0xc')]=function(_0x117d17,_0x56733c){if(_0x117d17['user'][_0x0e63('0x13')]!==_0x0e63('0x14'))throw new Error(_0x0e63('0x15'));if(isNaN(Number(_0x117d17[_0x0e63('0x16')]['id'])))throw new Error(_0x0e63('0x17'));return db[_0x0e63('0x18')]['find']({'where':{'id':_0x117d17['params']['id']}})['then'](handleEntityNotFound(_0x56733c,null))['then'](saveUpdates(_0x117d17[_0x0e63('0x19')],null))[_0x0e63('0xd')](respondWithResult(_0x56733c,null))[_0x0e63('0x1a')](handleError(_0x56733c,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 edc02ba..4856903 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 _0x75d4=['UserSetting','setMaxListeners','save','update','emit','exports','events'];(function(_0x23704b,_0x78d88){var _0xe107a=function(_0x4297f7){while(--_0x4297f7){_0x23704b['push'](_0x23704b['shift']());}};_0xe107a(++_0x78d88);}(_0x75d4,0x180));var _0x475d=function(_0x1c3eb1,_0xf7b74b){_0x1c3eb1=_0x1c3eb1-0x0;var _0x28281e=_0x75d4[_0x1c3eb1];return _0x28281e;};'use strict';var EventEmitter=require(_0x475d('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x475d('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x475d('0x2')](0x0);var events={'afterCreate':_0x475d('0x3'),'afterUpdate':_0x475d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x9aebdd){return function(_0x2eb3b0,_0xcc805c,_0x2ea12b){UserSettingEvents[_0x475d('0x5')](_0x9aebdd+':'+_0x2eb3b0['id'],_0x2eb3b0);UserSettingEvents[_0x475d('0x5')](_0x9aebdd,_0x2eb3b0);_0x2ea12b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x475d('0x6')]=UserSettingEvents; \ No newline at end of file +var _0x4b4e=['hook','exports','../../mysqldb','UserSetting','emit','hasOwnProperty'];(function(_0x322d4c,_0x43cfee){var _0x1137bf=function(_0x5e39dc){while(--_0x5e39dc){_0x322d4c['push'](_0x322d4c['shift']());}};_0x1137bf(++_0x43cfee);}(_0x4b4e,0x194));var _0xe4b4=function(_0x18e3a1,_0xd51faa){_0x18e3a1=_0x18e3a1-0x0;var _0x69b4a1=_0x4b4e[_0x18e3a1];return _0x69b4a1;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xe4b4('0x0'))['db'][_0xe4b4('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x158f46){return function(_0x36e370,_0x2a9ebe,_0x3ed81e){UserSettingEvents[_0xe4b4('0x2')](_0x158f46+':'+_0x36e370['id'],_0x36e370);UserSettingEvents[_0xe4b4('0x2')](_0x158f46,_0x36e370);_0x3ed81e(null);};}for(var e in events){if(events[_0xe4b4('0x3')](e)){var event=events[e];UserSetting[_0xe4b4('0x4')](e,emitEvent(event));}}module[_0xe4b4('0x5')]=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 c54b0e5..93385df 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 _0x081e=['exports','define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x2338b5,_0x592e1b){var _0x207f62=function(_0x3b8391){while(--_0x3b8391){_0x2338b5['push'](_0x2338b5['shift']());}};_0x207f62(++_0x592e1b);}(_0x081e,0xc5));var _0xe081=function(_0x20db3c,_0x2fda98){_0x20db3c=_0x20db3c-0x0;var _0x10daa=_0x081e[_0x20db3c];return _0x10daa;};'use strict';var attributes=require(_0xe081('0x0'));module[_0xe081('0x1')]=function(_0x526a85){return _0x526a85[_0xe081('0x2')]('UserSetting',attributes,{'tableName':_0xe081('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a48ae){if(!_0x3a48ae[_0xe081('0x4')])_0x3a48ae[_0xe081('0x5')]=null;else if(_0x3a48ae[_0xe081('0x5')]===null)_0x3a48ae[_0xe081('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xfc75=['UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x16a4df,_0x277e6e){var _0x262c30=function(_0x289594){while(--_0x289594){_0x16a4df['push'](_0x16a4df['shift']());}};_0x262c30(++_0x277e6e);}(_0xfc75,0xe1));var _0x5fc7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfc75[_0x432682];return _0x463d05;};'use strict';var attributes=require(_0x5fc7('0x0'));module[_0x5fc7('0x1')]=function(_0x3d2426){return _0x3d2426[_0x5fc7('0x2')](_0x5fc7('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55314c){if(!_0x55314c[_0x5fc7('0x4')])_0x55314c['clientSideLoggingEnabledSince']=null;else if(_0x55314c[_0x5fc7('0x5')]===null)_0x55314c[_0x5fc7('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 853304a..b7d1afe 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 _0x41f1=['user-setting:update','user-setting:update:user-','length','user-setting:','save','update'];(function(_0x25151f,_0x275d54){var _0x15393e=function(_0x55bb6b){while(--_0x55bb6b){_0x25151f['push'](_0x25151f['shift']());}};_0x15393e(++_0x275d54);}(_0x41f1,0x1d8));var _0x141f=function(_0x49fb23,_0x5340d4){_0x49fb23=_0x49fb23-0x0;var _0x4ef27b=_0x41f1[_0x49fb23];return _0x4ef27b;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x141f('0x0'),'remove',_0x141f('0x1')];function createListener(_0x13743c,_0x4a3079){return function(_0x3bd91b){_0x4a3079['emit'](_0x13743c,_0x3bd91b);if(_0x13743c===_0x141f('0x2')){_0x4a3079['emit'](_0x141f('0x3')+_0x3bd91b['UserId'],_0x3bd91b);}};}exports['register']=function(_0x2a151e){for(var _0x480ddb=0x0,_0x41d43a=events[_0x141f('0x4')];_0x480ddb<_0x41d43a;_0x480ddb++){var _0xb0acb5=events[_0x480ddb];var _0x4b6fda=createListener(_0x141f('0x5')+_0xb0acb5,_0x2a151e);UserSettingEvents['on'](_0xb0acb5,_0x4b6fda);}}; \ No newline at end of file +var _0xa222=['save','remove','update','user-setting:update','emit','user-setting:update:user-','register','length','user-setting:','./user-setting.events'];(function(_0x474a34,_0x1a7150){var _0x5bce62=function(_0xddaf3c){while(--_0xddaf3c){_0x474a34['push'](_0x474a34['shift']());}};_0x5bce62(++_0x1a7150);}(_0xa222,0x1b7));var _0x2a22=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xa222[_0x365e54];return _0x13317a;};'use strict';var UserSettingEvents=require(_0x2a22('0x0'));var events=[_0x2a22('0x1'),_0x2a22('0x2'),_0x2a22('0x3')];function createListener(_0x4346ce,_0x1883bf){return function(_0x4373ac){_0x1883bf['emit'](_0x4346ce,_0x4373ac);if(_0x4346ce===_0x2a22('0x4')){_0x1883bf[_0x2a22('0x5')](_0x2a22('0x6')+_0x4373ac['UserId'],_0x4373ac);}};}exports[_0x2a22('0x7')]=function(_0x2f2ace){for(var _0x69e26b=0x0,_0x3277d7=events[_0x2a22('0x8')];_0x69e26b<_0x3277d7;_0x69e26b++){var _0x13b21b=events[_0x69e26b];var _0x3d9749=createListener(_0x2a22('0x9')+_0x13b21b,_0x2f2ace);UserSettingEvents['on'](_0x13b21b,_0x3d9749);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 1c71e6e..6eff03f 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 _0x8b6c=['fs-extra','./user.controller','get','/describe','isAuthenticated','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','connect-timeout','express','Router'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x8b6c,0x1b7));var _0xc8b6=function(_0x6e402d,_0x53e936){_0x6e402d=_0x6e402d-0x0;var _0x5a8460=_0x8b6c[_0x6e402d];return _0x5a8460;};'use strict';var multer=require(_0xc8b6('0x0'));var util=require(_0xc8b6('0x1'));var path=require('path');var timeout=require(_0xc8b6('0x2'));var express=require(_0xc8b6('0x3'));var router=express[_0xc8b6('0x4')]();var fs_extra=require(_0xc8b6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8b6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc8b6('0x7')](_0xc8b6('0x8'),auth[_0xc8b6('0x9')](),controller['describe']);router['get'](_0xc8b6('0xa'),auth['isAuthenticated'](),controller['whoami']);router[_0xc8b6('0x7')](_0xc8b6('0xb'),auth[_0xc8b6('0x9')](),controller['getPresence']);router[_0xc8b6('0x7')](_0xc8b6('0xc'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0xd')]);router[_0xc8b6('0x7')](_0xc8b6('0xe'),controller[_0xc8b6('0xf')]);router[_0xc8b6('0x7')](_0xc8b6('0x10'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x11')]);router[_0xc8b6('0x7')](_0xc8b6('0x12'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x13')]);router[_0xc8b6('0x7')](_0xc8b6('0x14'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x15')]);router[_0xc8b6('0x7')]('/:id/queues_rt',auth[_0xc8b6('0x9')](),controller['getVoiceQueuesRt']);router[_0xc8b6('0x7')](_0xc8b6('0x16'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x17')]);router[_0xc8b6('0x7')](_0xc8b6('0x18'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x19')]);router[_0xc8b6('0x7')](_0xc8b6('0x1a'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x1b')]);router[_0xc8b6('0x7')]('/:id/chat/interactions',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x1c')]);router[_0xc8b6('0x7')]('/:id/openchannel/interactions',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x1d')]);router['get'](_0xc8b6('0x1e'),auth[_0xc8b6('0x9')](),controller['getMailInteractions']);router['get'](_0xc8b6('0x1f'),auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0xc8b6('0x20'),auth['isAuthenticated'](),controller[_0xc8b6('0x21')]);router[_0xc8b6('0x7')](_0xc8b6('0x22'),auth['isAuthenticated'](),controller[_0xc8b6('0x23')]);router[_0xc8b6('0x7')](_0xc8b6('0x24'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x25')]);router['get'](_0xc8b6('0x26'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x27')]);router[_0xc8b6('0x7')](_0xc8b6('0x28'),auth['isAuthenticated'](),controller['getAgents']);router[_0xc8b6('0x7')]('/:id/prefixes',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x29')]);router['get'](_0xc8b6('0x2a'),auth['isAuthenticated'](),controller[_0xc8b6('0x2b')]);router[_0xc8b6('0x7')](_0xc8b6('0x2c'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x2d')]);router[_0xc8b6('0x7')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xc8b6('0x2e')]);router['get'](_0xc8b6('0x2f'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x30')]);router['get']('/:id/chat_websites',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x31')]);router[_0xc8b6('0x7')](_0xc8b6('0x32'),auth[_0xc8b6('0x9')](),controller['getWhatsappAccounts']);router[_0xc8b6('0x7')](_0xc8b6('0x33'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x34')]);router[_0xc8b6('0x7')](_0xc8b6('0x35'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x36')]);router[_0xc8b6('0x37')]('/:id/contacts',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x38')]);router['post']('/',auth[_0xc8b6('0x9')](),controller['create']);router[_0xc8b6('0x37')]('/create_many',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x39')]);router[_0xc8b6('0x37')]('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xc8b6('0x3a')]({'destination':function(_0x41b6aa,_0x41b26f,_0x1f7957){_0x1f7957(null,path[_0xc8b6('0x3b')](config[_0xc8b6('0x3c')],_0xc8b6('0x3d')));},'filename':function(_0x5cc613,_0x29c256,_0x2d49b7){_0x2d49b7(null,util[_0xc8b6('0x3e')](_0xc8b6('0x3f'),Date[_0xc8b6('0x40')](),_0x29c256[_0xc8b6('0x41')]));}})});router['post'](_0xc8b6('0xe'),upload[_0xc8b6('0x42')](_0xc8b6('0x43')),controller[_0xc8b6('0x44')]);router[_0xc8b6('0x37')](_0xc8b6('0x45'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x46')]);router[_0xc8b6('0x37')](_0xc8b6('0x47'),auth[_0xc8b6('0x9')](),controller['logout']);router[_0xc8b6('0x37')](_0xc8b6('0x48'),auth[_0xc8b6('0x9')](),controller['pause']);router[_0xc8b6('0x37')](_0xc8b6('0x49'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x4a')]);router[_0xc8b6('0x37')]('/:id/teams',auth[_0xc8b6('0x9')](),controller['addTeams']);router[_0xc8b6('0x37')](_0xc8b6('0x4b'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0xc8b6('0x37')](_0xc8b6('0x4c'),auth[_0xc8b6('0x9')](),controller['addMailInteractions']);router[_0xc8b6('0x37')](_0xc8b6('0x4d'),auth[_0xc8b6('0x9')](),controller['addFaxInteractions']);router[_0xc8b6('0x37')](_0xc8b6('0x4e'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x4f')]);router[_0xc8b6('0x37')](_0xc8b6('0x50'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0xc8b6('0x37')]('/:id/whatsapp_interactions',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x51')]);router[_0xc8b6('0x37')](_0xc8b6('0x2a'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x52')]);router[_0xc8b6('0x37')](_0xc8b6('0x2c'),auth[_0xc8b6('0x9')](),controller['addMailAccounts']);router[_0xc8b6('0x37')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xc8b6('0x53')]);router[_0xc8b6('0x37')](_0xc8b6('0x2f'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x54')]);router[_0xc8b6('0x37')](_0xc8b6('0x55'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x56')]);router[_0xc8b6('0x37')](_0xc8b6('0x32'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x57')]);router['post']('/:id/api_key',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x58')]);router[_0xc8b6('0x59')](_0xc8b6('0xc'),auth[_0xc8b6('0x9')](),controller['update']);router['put'](_0xc8b6('0x5a'),auth['isAuthenticated'](),controller[_0xc8b6('0x5b')]);router[_0xc8b6('0x5c')](_0xc8b6('0x14'),auth['isAuthenticated'](),controller[_0xc8b6('0x5d')]);router['delete'](_0xc8b6('0x24'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x5e')]);router[_0xc8b6('0x5c')](_0xc8b6('0x4b'),auth['isAuthenticated'](),controller[_0xc8b6('0x5f')]);router[_0xc8b6('0x5c')](_0xc8b6('0x4c'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x60')]);router[_0xc8b6('0x5c')](_0xc8b6('0x4d'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x61')]);router[_0xc8b6('0x5c')]('/:id/sms_interactions',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x62')]);router['delete'](_0xc8b6('0x50'),auth[_0xc8b6('0x9')](),controller['removeOpenchannelInteractions']);router[_0xc8b6('0x5c')](_0xc8b6('0x63'),auth['isAuthenticated'](),controller[_0xc8b6('0x64')]);router[_0xc8b6('0x5c')](_0xc8b6('0x2a'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x65')]);router[_0xc8b6('0x5c')](_0xc8b6('0x2c'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x66')]);router['delete'](_0xc8b6('0x67'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x68')]);router['delete'](_0xc8b6('0x2f'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x69')]);router[_0xc8b6('0x5c')](_0xc8b6('0x55'),auth['isAuthenticated'](),controller[_0xc8b6('0x6a')]);router['delete']('/:id/whatsapp_accounts',auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x6b')]);router[_0xc8b6('0x5c')](_0xc8b6('0x35'),auth[_0xc8b6('0x9')](),controller[_0xc8b6('0x6c')]);router[_0xc8b6('0x37')](_0xc8b6('0x6d'),auth['isAuthenticated'](),controller['messengerSoundNotification']);module[_0xc8b6('0x6e')]=router; \ No newline at end of file +var _0xb6a1=['/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','format','now','originalname','single','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb6a1,0x14d));var _0x1b6a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb6a1[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var path=require(_0x1b6a('0x2'));var timeout=require(_0x1b6a('0x3'));var express=require('express');var router=express[_0x1b6a('0x4')]();var fs_extra=require(_0x1b6a('0x5'));var auth=require(_0x1b6a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1b6a('0x7'));var controller=require('./user.controller');router[_0x1b6a('0x8')]('/',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0xa')]);router['get'](_0x1b6a('0xb'),auth['isAuthenticated'](),controller[_0x1b6a('0xc')]);router[_0x1b6a('0x8')](_0x1b6a('0xd'),auth['isAuthenticated'](),controller[_0x1b6a('0xe')]);router[_0x1b6a('0x8')]('/presence',auth['isAuthenticated'](),controller[_0x1b6a('0xf')]);router['get'](_0x1b6a('0x10'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x11')]);router['get'](_0x1b6a('0x12'),controller[_0x1b6a('0x13')]);router[_0x1b6a('0x8')](_0x1b6a('0x14'),auth[_0x1b6a('0x9')](),controller['getOpenTabs']);router[_0x1b6a('0x8')](_0x1b6a('0x15'),auth['isAuthenticated'](),controller[_0x1b6a('0x16')]);router[_0x1b6a('0x8')](_0x1b6a('0x17'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x18')]);router[_0x1b6a('0x8')](_0x1b6a('0x19'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x1a')]);router[_0x1b6a('0x8')](_0x1b6a('0x1b'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x1c')]);router[_0x1b6a('0x8')](_0x1b6a('0x1d'),auth['isAuthenticated'](),controller[_0x1b6a('0x1e')]);router['get']('/:id/screen_recordings',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x1f')]);router[_0x1b6a('0x8')](_0x1b6a('0x20'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x21')]);router['get'](_0x1b6a('0x22'),auth[_0x1b6a('0x9')](),controller['getOpenchannelInteractions']);router[_0x1b6a('0x8')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x1b6a('0x23')]);router[_0x1b6a('0x8')](_0x1b6a('0x24'),auth[_0x1b6a('0x9')](),controller['getSmsInteractions']);router[_0x1b6a('0x8')](_0x1b6a('0x25'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x26')]);router['get'](_0x1b6a('0x27'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x1b6a('0x8')](_0x1b6a('0x28'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x1b6a('0x29'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x2a')]);router[_0x1b6a('0x8')](_0x1b6a('0x2b'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x2c')]);router[_0x1b6a('0x8')](_0x1b6a('0x2d'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x2e')]);router[_0x1b6a('0x8')](_0x1b6a('0x2f'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x30')]);router[_0x1b6a('0x8')](_0x1b6a('0x31'),auth['isAuthenticated'](),controller[_0x1b6a('0x32')]);router[_0x1b6a('0x8')](_0x1b6a('0x33'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x34')]);router['get'](_0x1b6a('0x35'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x36')]);router[_0x1b6a('0x8')](_0x1b6a('0x37'),auth['isAuthenticated'](),controller[_0x1b6a('0x38')]);router[_0x1b6a('0x8')](_0x1b6a('0x39'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x3a')]);router['get'](_0x1b6a('0x3b'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x3c')]);router['get'](_0x1b6a('0x3d'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x3e')]);router[_0x1b6a('0x3f')](_0x1b6a('0x15'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x40')]);router['post']('/',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x41')]);router[_0x1b6a('0x3f')]('/create_many',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x42')]);router[_0x1b6a('0x3f')](_0x1b6a('0x17'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x43')]);var upload=multer({'storage':multer[_0x1b6a('0x44')]({'destination':function(_0x416e8c,_0x967f24,_0x4845fc){_0x4845fc(null,path[_0x1b6a('0x45')](config[_0x1b6a('0x46')],'server/files/images/'));},'filename':function(_0x30b5fc,_0x413c2f,_0x1a375f){_0x1a375f(null,util[_0x1b6a('0x47')]('%s-%s',Date[_0x1b6a('0x48')](),_0x413c2f[_0x1b6a('0x49')]));}})});router[_0x1b6a('0x3f')]('/:id/avatar',upload[_0x1b6a('0x4a')]('file'),controller['addAvatar']);router['post'](_0x1b6a('0x4b'),auth[_0x1b6a('0x9')](),controller['login']);router['post'](_0x1b6a('0x4c'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x4d')]);router[_0x1b6a('0x3f')](_0x1b6a('0x4e'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x4f')]);router[_0x1b6a('0x3f')](_0x1b6a('0x50'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x51')]);router[_0x1b6a('0x3f')](_0x1b6a('0x28'),auth[_0x1b6a('0x9')](),controller['addTeams']);router[_0x1b6a('0x3f')]('/:id/chat_interactions',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x52')]);router['post'](_0x1b6a('0x53'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x54')]);router[_0x1b6a('0x3f')](_0x1b6a('0x55'),auth[_0x1b6a('0x9')](),controller['addFaxInteractions']);router[_0x1b6a('0x3f')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x1b6a('0x3f')](_0x1b6a('0x56'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x57')]);router[_0x1b6a('0x3f')](_0x1b6a('0x58'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x59')]);router[_0x1b6a('0x3f')](_0x1b6a('0x2f'),auth[_0x1b6a('0x9')](),controller['addFaxAccounts']);router[_0x1b6a('0x3f')]('/:id/mail_accounts',auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x5a')]);router[_0x1b6a('0x3f')](_0x1b6a('0x33'),auth['isAuthenticated'](),controller[_0x1b6a('0x5b')]);router['post'](_0x1b6a('0x35'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x5c')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x1b6a('0x5d')]);router['post'](_0x1b6a('0x39'),auth['isAuthenticated'](),controller[_0x1b6a('0x5e')]);router[_0x1b6a('0x3f')](_0x1b6a('0x3d'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x5f')]);router[_0x1b6a('0x60')](_0x1b6a('0x10'),auth[_0x1b6a('0x9')](),controller['update']);router[_0x1b6a('0x60')](_0x1b6a('0x61'),auth['isAuthenticated'](),controller[_0x1b6a('0x62')]);router[_0x1b6a('0x63')](_0x1b6a('0x17'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x64')]);router[_0x1b6a('0x63')](_0x1b6a('0x28'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x65')]);router[_0x1b6a('0x63')](_0x1b6a('0x10'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x66')]);router[_0x1b6a('0x63')](_0x1b6a('0x67'),auth['isAuthenticated'](),controller[_0x1b6a('0x68')]);router[_0x1b6a('0x63')](_0x1b6a('0x53'),auth['isAuthenticated'](),controller[_0x1b6a('0x69')]);router[_0x1b6a('0x63')](_0x1b6a('0x55'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x6a')]);router[_0x1b6a('0x63')](_0x1b6a('0x6b'),auth['isAuthenticated'](),controller[_0x1b6a('0x6c')]);router['delete'](_0x1b6a('0x56'),auth[_0x1b6a('0x9')](),controller['removeOpenchannelInteractions']);router[_0x1b6a('0x63')](_0x1b6a('0x58'),auth['isAuthenticated'](),controller[_0x1b6a('0x6d')]);router[_0x1b6a('0x63')](_0x1b6a('0x2f'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x6e')]);router[_0x1b6a('0x63')](_0x1b6a('0x31'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x1b6a('0x63')](_0x1b6a('0x33'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x6f')]);router[_0x1b6a('0x63')](_0x1b6a('0x35'),auth['isAuthenticated'](),controller[_0x1b6a('0x70')]);router[_0x1b6a('0x63')](_0x1b6a('0x37'),auth[_0x1b6a('0x9')](),controller['removeChatWebsites']);router[_0x1b6a('0x63')](_0x1b6a('0x39'),auth[_0x1b6a('0x9')](),controller[_0x1b6a('0x71')]);router[_0x1b6a('0x63')](_0x1b6a('0x3d'),auth['isAuthenticated'](),controller[_0x1b6a('0x72')]);router[_0x1b6a('0x3f')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller[_0x1b6a('0x73')]);module[_0x1b6a('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 22cf608..ac1eab4 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 _0xf473=['ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','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\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','update','TEXT','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','icesupport','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN'];(function(_0x4dfb22,_0x1fd1db){var _0x2dfbd7=function(_0x18bf81){while(--_0x18bf81){_0x4dfb22['push'](_0x4dfb22['shift']());}};_0x2dfbd7(++_0x1fd1db);}(_0xf473,0xa1));var _0x3f47=function(_0x439534,_0x4ff786){_0x439534=_0x439534-0x0;var _0x211660=_0xf473[_0x439534];return _0x211660;};'use strict';var Sequelize=require(_0x3f47('0x0'));var moment=require(_0x3f47('0x1'));var util=require(_0x3f47('0x2'));var _=require('lodash');module[_0x3f47('0x3')]={'name':{'type':Sequelize[_0x3f47('0x4')],'allowNull':![],'unique':_0x3f47('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2aa030){this[_0x3f47('0x6')](_0x3f47('0x5'),_0x2aa030);this['setDataValue'](_0x3f47('0x7'),_0x2aa030);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x3f47('0x4')],'allowNull':![],'set':function(_0x26fe36){this['setDataValue'](_0x3f47('0x8'),_0x26fe36);this['setDataValue'](_0x3f47('0x9'),util[_0x3f47('0xa')](_0x3f47('0xb'),_0x26fe36,this[_0x3f47('0xc')](_0x3f47('0xd'))));}},'alias':{'type':Sequelize[_0x3f47('0x4')]},'email':{'type':Sequelize[_0x3f47('0x4')],'allowNull':![],'unique':_0x3f47('0xe'),'validate':{'isEmail':!![]},'set':function(_0x392cdf){if(_0x392cdf){this[_0x3f47('0x6')](_0x3f47('0xe'),_0x392cdf[_0x3f47('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0x3f47('0x10'),'user',_0x3f47('0x11'),_0x3f47('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x3f47('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3f47('0x4')],'defaultValue':_0x3f47('0x13')},'internal':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':![],'unique':_0x3f47('0xd'),'set':function(_0xd3a594){this[_0x3f47('0x6')](_0x3f47('0xd'),_0xd3a594);this['setDataValue'](_0x3f47('0x15'),_0xd3a594);this[_0x3f47('0x6')](_0x3f47('0x9'),util[_0x3f47('0xa')](_0x3f47('0xb'),this[_0x3f47('0xc')](_0x3f47('0x8')),_0xd3a594));}},'salt':{'type':Sequelize[_0x3f47('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3f47('0x4')]},'address':{'type':Sequelize[_0x3f47('0x4')]},'zipcode':{'type':Sequelize[_0x3f47('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3f47('0x4')]},'country':{'type':Sequelize[_0x3f47('0x4')]},'online':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x3f47('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3f47('0x4')],'defaultValue':_0x3f47('0x18')},'lastPauseAt':{'type':Sequelize[_0x3f47('0x17')]},'chatCapacity':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3f47('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x3f47('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![],'defaultValue':_0x3f47('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x3f47('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x1b'),_0x3f47('0x1c'),_0x3f47('0x1d')),'allowNull':!![],'defaultValue':_0x3f47('0x1b')},'context':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x1e'),_0x3f47('0x1f'),_0x3f47('0x20'),_0x3f47('0x21'),_0x3f47('0x22'),_0x3f47('0x23'),_0x3f47('0x24'),_0x3f47('0x25')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![],'defaultValue':_0x3f47('0x26'),'set':function(_0x135008){this[_0x3f47('0x6')](_0x3f47('0x27'),_0x135008?_0x135008[_0x3f47('0x28')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x3f47('0xc')](_0x3f47('0x27'))['split'](','):null;},'comment':_0x3f47('0x29')},'dtmfmode':{'type':Sequelize[_0x3f47('0x1a')]('rfc2833',_0x3f47('0x2a'),_0x3f47('0x2b'),_0x3f47('0x2c'),_0x3f47('0x2d')),'allowNull':!![],'defaultValue':_0x3f47('0x2e')},'directmedia':{'type':Sequelize['ENUM'](_0x3f47('0x2f'),'no',_0x3f47('0x30'),'update',_0x3f47('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3f47('0x32'),'set':function(_0x3b8aed){this[_0x3f47('0x6')]('nat',_0x3b8aed?_0x3b8aed[_0x3f47('0x28')](','):null);},'get':function(){return this[_0x3f47('0xc')]('nat')?this[_0x3f47('0xc')]('nat')[_0x3f47('0x33')](','):null;},'comment':_0x3f47('0x34')},'callgroup':{'type':Sequelize[_0x3f47('0x4')]},'namedcallgroup':{'type':Sequelize[_0x3f47('0x4')]},'pickupgroup':{'type':Sequelize[_0x3f47('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x3f47('0x4')]},'language':{'type':Sequelize[_0x3f47('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3f47('0x4')]},'disallow':{'type':Sequelize[_0x3f47('0x4')],'allowNull':![],'defaultValue':_0x3f47('0x35')},'allow':{'type':Sequelize[_0x3f47('0x4')],'allowNull':![],'defaultValue':_0x3f47('0x36'),'set':function(_0x31f0a6){this[_0x3f47('0x6')]('allow',_0x31f0a6?_0x31f0a6[_0x3f47('0x28')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0x3f47('0x37'))[_0x3f47('0x33')](';'):null;},'comment':_0x3f47('0x38')},'autoframing':{'type':Sequelize[_0x3f47('0x1a')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x25a60b){this['setDataValue']('insecure',_0x25a60b?_0x25a60b[_0x3f47('0x28')](','):null);},'get':function(){return this[_0x3f47('0xc')](_0x3f47('0x39'))?this[_0x3f47('0xc')](_0x3f47('0x39'))[_0x3f47('0x33')](','):null;},'comment':_0x3f47('0x3a')},'trustrpid':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3f47('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x3f47('0x3b')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x3f47('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3f47('0x1a')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3f47('0x1a')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3f47('0x1a')]('yes','no',_0x3f47('0x3c')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x3d'),_0x3f47('0x3e'),_0x3f47('0x3f')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x40'),'uas'),'allowNull':!![],'defaultValue':_0x3f47('0x41')},'t38pt_usertpsource':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x3f47('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x3f47('0x2f'),'no',_0x3f47('0x42'),_0x3f47('0x43')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x3f47('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x3f47('0x1a')]('active',_0x3f47('0x44'),_0x3f47('0x45')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3f47('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x3f47('0x2f'),'no',_0x3f47('0x30'),_0x3f47('0x46'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3f47('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x3f47('0x17')]},'passwordResetAt':{'type':Sequelize[_0x3f47('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x3f47('0x47')]},'showWebBar':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0,'set':function(_0x5a24fb){this['setDataValue'](_0x3f47('0x48'),_0x5a24fb);var _0x2753c8=this['get']({'plain':!![]});switch(_0x5a24fb){case 0x0:case 0x1:var _0x1dda90=_0x2753c8[_0x3f47('0x27')]?_[_0x3f47('0x49')](_0x2753c8[_0x3f47('0x27')])?_0x2753c8[_0x3f47('0x27')]['join']():_0x2753c8[_0x3f47('0x27')]:_0x3f47('0x26');if(_0x1dda90===_0x3f47('0x4a')){_0x1dda90=_0x3f47('0x26');}this[_0x3f47('0x6')](_0x3f47('0x27'),_0x1dda90);this['setDataValue'](_0x3f47('0x4b'),'no');this[_0x3f47('0x6')](_0x3f47('0x4c'),null);this[_0x3f47('0x6')](_0x3f47('0x4d'),null);this['setDataValue']('icesupport',null);this[_0x3f47('0x6')](_0x3f47('0x4e'),null);this[_0x3f47('0x6')]('dtlsverify',null);this[_0x3f47('0x6')](_0x3f47('0x4f'),null);this['setDataValue'](_0x3f47('0x50'),null);this[_0x3f47('0x6')]('dtlsprivatekey',null);this[_0x3f47('0x6')](_0x3f47('0x51'),'no');break;case 0x2:this['setDataValue'](_0x3f47('0x27'),_0x3f47('0x4a'));this['setDataValue'](_0x3f47('0x4b'),_0x3f47('0x2f'));this[_0x3f47('0x6')](_0x3f47('0x4c'),_0x3f47('0x2f'));this['setDataValue'](_0x3f47('0x4d'),_0x3f47('0x2f'));this[_0x3f47('0x6')](_0x3f47('0x52'),_0x3f47('0x2f'));this[_0x3f47('0x6')]('dtlsenable','yes');this[_0x3f47('0x6')](_0x3f47('0x53'),'no');this[_0x3f47('0x6')](_0x3f47('0x4f'),_0x3f47('0x45'));this['setDataValue'](_0x3f47('0x50'),_0x2753c8['dtlscertfile']||_0x3f47('0x54'));this['setDataValue']('dtlsprivatekey',_0x2753c8['dtlsprivatekey']||_0x3f47('0x55'));this['setDataValue'](_0x3f47('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x3f47('0x47')],'set':function(_0x51da16){this[_0x3f47('0x6')]('permissions',_0x51da16?_0x51da16[_0x3f47('0x28')](','):[]);},'get':function(){return this[_0x3f47('0xc')](_0x3f47('0x56'))?_[_0x3f47('0x57')](this['getDataValue'](_0x3f47('0x56'))['split'](','),function(_0x399d53){return parseInt(_0x399d53,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3f47('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3f47('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x3f47('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3f47('0x1a')](_0x3f47('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3f47('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3f47('0x58')],'get':function(){return this[_0x3f47('0xc')]('phoneBarEnableScreenRecordingByAgent')?this[_0x3f47('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x3f47('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x3f47('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![],'set':function(_0x125d45){if(typeof _0x125d45===_0x3f47('0x59')){var _0x34da48=_0x125d45==='1'?!![]:_0x125d45==='0'?![]:_0x125d45===_0x3f47('0x5a')?!![]:_0x125d45===_0x3f47('0x5b')?![]:![];this['setDataValue'](_0x3f47('0x5c'),_0x34da48);}else{this[_0x3f47('0x6')](_0x3f47('0x5c'),_0x125d45);}}},'blocked':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![],'set':function(_0x877e7e){this['setDataValue'](_0x3f47('0x5d'),_0x877e7e);if(_0x877e7e===!![]){this[_0x3f47('0x6')](_0x3f47('0x5e'),moment());this['setDataValue'](_0x3f47('0x5f'),0x0);}else{this[_0x3f47('0x6')](_0x3f47('0x5e'),null);}}},'blockedAt':{'type':Sequelize[_0x3f47('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x3f47('0x14')](0x5)[_0x3f47('0x60')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x3f47('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x3f47('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xcd9b=['DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','util','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','BOOLEAN'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xcd9b,0xec));var _0xbcd9=function(_0x345215,_0x27980c){_0x345215=_0x345215-0x0;var _0x1049a8=_0xcd9b[_0x345215];return _0x1049a8;};'use strict';var Sequelize=require(_0xbcd9('0x0'));var moment=require(_0xbcd9('0x1'));var util=require(_0xbcd9('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':![],'unique':_0xbcd9('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xa20719){this[_0xbcd9('0x5')](_0xbcd9('0x4'),_0xa20719);this[_0xbcd9('0x5')](_0xbcd9('0x6'),_0xa20719);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':![],'set':function(_0x4cbe0d){this[_0xbcd9('0x5')](_0xbcd9('0x7'),_0x4cbe0d);this['setDataValue'](_0xbcd9('0x8'),util[_0xbcd9('0x9')](_0xbcd9('0xa'),_0x4cbe0d,this[_0xbcd9('0xb')](_0xbcd9('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x4e320d){if(_0x4e320d){this[_0xbcd9('0x5')](_0xbcd9('0xd'),_0x4e320d[_0xbcd9('0xe')]());}}},'role':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x10'),_0xbcd9('0x11'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xbcd9('0x12')},'internal':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x39c5c8){this['setDataValue'](_0xbcd9('0xc'),_0x39c5c8);this[_0xbcd9('0x5')](_0xbcd9('0x14'),_0x39c5c8);this[_0xbcd9('0x5')](_0xbcd9('0x8'),util[_0xbcd9('0x9')](_0xbcd9('0xa'),this['getDataValue']('fullname'),_0x39c5c8));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbcd9('0x3')]},'mobile':{'type':Sequelize[_0xbcd9('0x3')]},'address':{'type':Sequelize[_0xbcd9('0x3')]},'zipcode':{'type':Sequelize[_0xbcd9('0x3')]},'userpic':{'type':Sequelize[_0xbcd9('0x3')]},'city':{'type':Sequelize[_0xbcd9('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xbcd9('0x16')]},'voicePause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xbcd9('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xbcd9('0x16')]},'chatCapacity':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbcd9('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xbcd9('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![],'defaultValue':_0xbcd9('0x17')},'ipaddr':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xbcd9('0x18'),_0xbcd9('0x11'),_0xbcd9('0x19')),'allowNull':!![],'defaultValue':_0xbcd9('0x18')},'context':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x1a'),_0xbcd9('0x1b'),'ALLOWED_FAILED_SCREEN',_0xbcd9('0x1c'),_0xbcd9('0x1d'),_0xbcd9('0x1e'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x534e8e){this[_0xbcd9('0x5')](_0xbcd9('0x1f'),_0x534e8e?_0x534e8e[_0xbcd9('0x20')](','):null);},'get':function(){return this[_0xbcd9('0xb')](_0xbcd9('0x1f'))?this[_0xbcd9('0xb')]('transport')[_0xbcd9('0x21')](','):null;},'comment':_0xbcd9('0x22')},'dtmfmode':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x23'),_0xbcd9('0x24'),_0xbcd9('0x25'),_0xbcd9('0x26'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xbcd9('0x27'),'no',_0xbcd9('0x28'),_0xbcd9('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbcd9('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![],'defaultValue':_0xbcd9('0x2a'),'set':function(_0xfdeb9a){this[_0xbcd9('0x5')](_0xbcd9('0x2b'),_0xfdeb9a?_0xfdeb9a[_0xbcd9('0x20')](','):null);},'get':function(){return this[_0xbcd9('0xb')](_0xbcd9('0x2b'))?this['getDataValue'](_0xbcd9('0x2b'))[_0xbcd9('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xbcd9('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xbcd9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xbcd9('0x3')]},'language':{'type':Sequelize[_0xbcd9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':![],'defaultValue':_0xbcd9('0x2c'),'set':function(_0x2e1b4a){this[_0xbcd9('0x5')](_0xbcd9('0x2d'),_0x2e1b4a?_0x2e1b4a['join'](';'):_0xbcd9('0x2c'));},'get':function(){return this[_0xbcd9('0xb')]('allow')?this[_0xbcd9('0xb')](_0xbcd9('0x2d'))[_0xbcd9('0x21')](';'):null;},'comment':_0xbcd9('0x2e')},'autoframing':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![],'set':function(_0x39496a){this[_0xbcd9('0x5')](_0xbcd9('0x2f'),_0x39496a?_0x39496a[_0xbcd9('0x20')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xbcd9('0xb')](_0xbcd9('0x2f'))['split'](','):null;},'comment':_0xbcd9('0x30')},'trustrpid':{'type':Sequelize['ENUM'](_0xbcd9('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xbcd9('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no',_0xbcd9('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xbcd9('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xbcd9('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![],'defaultValue':_0xbcd9('0x32')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![],'defaultValue':_0xbcd9('0x27')},'busylevel':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xbcd9('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xbcd9('0x27'),'no',_0xbcd9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xbcd9('0xf')]('accept',_0xbcd9('0x34'),_0xbcd9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x36'),'uas'),'allowNull':!![],'defaultValue':_0xbcd9('0x37')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![],'defaultValue':_0xbcd9('0x27')},'keepalive':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbcd9('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no',_0xbcd9('0x38'),_0xbcd9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xbcd9('0x3a'),_0xbcd9('0x3b'),_0xbcd9('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xbcd9('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xbcd9('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xbcd9('0xf')]('yes','no',_0xbcd9('0x28'),'update',_0xbcd9('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbcd9('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xbcd9('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xbcd9('0x3e')]},'showWebBar':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0,'set':function(_0x34bc4e){this[_0xbcd9('0x5')](_0xbcd9('0x3f'),_0x34bc4e);var _0x47fc4d=this[_0xbcd9('0x40')]({'plain':!![]});switch(_0x34bc4e){case 0x0:case 0x1:var _0x9a623=_0x47fc4d['transport']?_[_0xbcd9('0x41')](_0x47fc4d[_0xbcd9('0x1f')])?_0x47fc4d['transport'][_0xbcd9('0x20')]():_0x47fc4d[_0xbcd9('0x1f')]:_0xbcd9('0x42');if(_0x9a623===_0xbcd9('0x43')){_0x9a623=_0xbcd9('0x42');}this[_0xbcd9('0x5')](_0xbcd9('0x1f'),_0x9a623);this[_0xbcd9('0x5')]('encryption','no');this[_0xbcd9('0x5')]('avpf',null);this[_0xbcd9('0x5')]('force_avp',null);this[_0xbcd9('0x5')](_0xbcd9('0x44'),null);this['setDataValue']('dtlsenable',null);this[_0xbcd9('0x5')](_0xbcd9('0x45'),null);this[_0xbcd9('0x5')](_0xbcd9('0x46'),null);this[_0xbcd9('0x5')](_0xbcd9('0x47'),null);this[_0xbcd9('0x5')](_0xbcd9('0x48'),null);this['setDataValue'](_0xbcd9('0x49'),'no');break;case 0x2:this[_0xbcd9('0x5')](_0xbcd9('0x1f'),_0xbcd9('0x43'));this[_0xbcd9('0x5')]('encryption',_0xbcd9('0x27'));this[_0xbcd9('0x5')]('avpf',_0xbcd9('0x27'));this[_0xbcd9('0x5')]('force_avp',_0xbcd9('0x27'));this[_0xbcd9('0x5')]('icesupport',_0xbcd9('0x27'));this[_0xbcd9('0x5')](_0xbcd9('0x4a'),_0xbcd9('0x27'));this[_0xbcd9('0x5')]('dtlsverify','no');this[_0xbcd9('0x5')]('dtlssetup','actpass');this[_0xbcd9('0x5')](_0xbcd9('0x47'),_0x47fc4d[_0xbcd9('0x47')]||'/etc/pki/tls/certs/motion.crt');this[_0xbcd9('0x5')]('dtlsprivatekey',_0x47fc4d[_0xbcd9('0x48')]||_0xbcd9('0x4b'));this[_0xbcd9('0x5')](_0xbcd9('0x49'),_0xbcd9('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0xbcd9('0x3e')],'set':function(_0x2acf79){this['setDataValue']('permissions',_0x2acf79?_0x2acf79[_0xbcd9('0x20')](','):[]);},'get':function(){return this[_0xbcd9('0xb')](_0xbcd9('0x4c'))?_['map'](this[_0xbcd9('0xb')](_0xbcd9('0x4c'))[_0xbcd9('0x21')](','),function(_0x472bca){return parseInt(_0x472bca,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xbcd9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xbcd9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xbcd9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xbcd9('0xf')](_0xbcd9('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbcd9('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xbcd9('0x4d')],'get':function(){return this[_0xbcd9('0xb')](_0xbcd9('0x4e'))?this[_0xbcd9('0xb')](_0xbcd9('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xbcd9('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xbcd9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![],'set':function(_0x111374){if(typeof _0x111374===_0xbcd9('0x4f')){var _0x2409a1=_0x111374==='1'?!![]:_0x111374==='0'?![]:_0x111374===_0xbcd9('0x50')?!![]:_0x111374===_0xbcd9('0x51')?![]:![];this[_0xbcd9('0x5')](_0xbcd9('0x52'),_0x2409a1);}else{this[_0xbcd9('0x5')](_0xbcd9('0x52'),_0x111374);}}},'blocked':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![],'set':function(_0x1105eb){this['setDataValue'](_0xbcd9('0x53'),_0x1105eb);if(_0x1105eb===!![]){this[_0xbcd9('0x5')]('blockedAt',moment());this[_0xbcd9('0x5')](_0xbcd9('0x54'),0x0);}else{this[_0xbcd9('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xbcd9('0x13')](0x5)[_0xbcd9('0x55')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xbcd9('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xbcd9('0x13')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 4dd3eac..6fa008d 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 _0xaeec=['../../components/contacts','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','handleError','../../mysqldb','redis','./user.socket','register','defaults','localhost','status','end','offset','limit','undefined','count','set','Content-Range','json','update','role','agent','emit','userNotification:recalc:','destroy','then','get','Users','user','Telephones','telephone','value','includes','find','UserProfileResource','error','stack','name','User','rawAttributes','map','fieldName','type','filter','password','previousPasswords','resetPasswordExpires','index','getOptions','query','include','userSetting','true','attributes','push','findAll','rows','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','catch','show','includeAll','UserSetting','merge','options','openTabs','body','describe','params','ids','omit','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','103','113','110','104','105','106','107','109','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','isEmpty','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','capitalize','QueueId','voice','format','SIP/%s','UserVoiceQueueRt','channel','isArray','addAvatar','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','getOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','hasOwnProperty','List','Tag','color','tag','getQueues','model','keys','Queue','filters','intersection','fields','order','sort','pick','where','Unknown\x20role','getVoiceQueuesRt','nolimit','getGroups','ChatGroup','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','forEach','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','Team','getTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','addAgent','getDataValue','TeamVoicePrefix','Queue:save','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','removeAgent','Voice','UserVoicePrefix','Queue:remove','CmList','getLists','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$notILike','$contains','$contained','lastName','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','unknown','ringing','queues','getAgents','toString','lower','col','asc','substring','uniqBy','orderBy','getRealtimeAgents','voiceStatus','unavailable','busy','slice','toUpperCase','select','field','ui.createdAt','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','../../components/auth/service'];(function(_0x397d0c,_0x58ad63){var _0x4d8b07=function(_0x337da4){while(--_0x337da4){_0x397d0c['push'](_0x397d0c['shift']());}};_0x4d8b07(++_0x58ad63);}(_0xaeec,0x178));var _0xcaee=function(_0x4ef111,_0x4b54a8){_0x4ef111=_0x4ef111-0x0;var _0x585654=_0xaeec[_0x4ef111];return _0x585654;};'use strict';var moment=require(_0xcaee('0x0'));var util=require(_0xcaee('0x1'));var path=require(_0xcaee('0x2'));var fs=require('fs');var _=require(_0xcaee('0x3'));var squel=require(_0xcaee('0x4'));var Redis=require(_0xcaee('0x5'));var authService=require(_0xcaee('0x6'));var contacts=require(_0xcaee('0x7'));var qs=require('../../components/parsers/qs');var rta=require(_0xcaee('0x8'));var logger=require(_0xcaee('0x9'))(_0xcaee('0xa'));var utils=require(_0xcaee('0xb'));var config=require('../../config/environment');var licenseUtil=require(_0xcaee('0xc'));var APIBadRequestError=require(_0xcaee('0xd'))[_0xcaee('0xe')];var APINotFoundError=require(_0xcaee('0xd'))['APINotFoundError'];var APIHandleError=require(_0xcaee('0xd'))[_0xcaee('0xf')];var db=require(_0xcaee('0x10'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xcaee('0x11')]));require(_0xcaee('0x12'))[_0xcaee('0x13')](socket);config['redis']=_[_0xcaee('0x14')](config['redis'],{'host':_0xcaee('0x15'),'port':0x18eb});var values;function respondWithStatusCode(_0x2d136f,_0x3f9aef){_0x3f9aef=_0x3f9aef||0xcc;return function(_0x2a42d5){if(_0x2a42d5){return _0x2d136f['sendStatus'](_0x3f9aef);}return _0x2d136f[_0xcaee('0x16')](_0x3f9aef)[_0xcaee('0x17')]();};}function respondWithResult(_0x25122c,_0x12acaf){_0x12acaf=_0x12acaf||0xc8;return function(_0x27d5f6){if(_0x27d5f6){return _0x25122c[_0xcaee('0x16')](_0x12acaf)['json'](_0x27d5f6);}};}function respondWithFilteredResult(_0xf64f79,_0x4643f4){return function(_0x396025){if(_0x396025){var _0x495dd4=typeof _0x4643f4[_0xcaee('0x18')]==='undefined'&&typeof _0x4643f4[_0xcaee('0x19')]===_0xcaee('0x1a');var _0x25c2f4=_0x396025['count'];var _0x45b2c9=_0x495dd4?0x0:_0x4643f4[_0xcaee('0x18')];var _0x173bc7=_0x495dd4?_0x396025[_0xcaee('0x1b')]:_0x4643f4[_0xcaee('0x18')]+_0x4643f4['limit'];var _0x3cfb2e;if(_0x173bc7>=_0x25c2f4){_0x173bc7=_0x25c2f4;_0x3cfb2e=0xc8;}else{_0x3cfb2e=0xce;}_0xf64f79[_0xcaee('0x16')](_0x3cfb2e);return _0xf64f79[_0xcaee('0x1c')](_0xcaee('0x1d'),_0x45b2c9+'-'+_0x173bc7+'/'+_0x25c2f4)[_0xcaee('0x1e')](_0x396025);}return null;};}function saveUpdates(_0x33ae26){return function(_0x858150){if(_0x858150){return _0x858150[_0xcaee('0x1f')](_0x33ae26)['then'](function(_0x29e068){if(_0x29e068[_0xcaee('0x20')]===_0xcaee('0x21')){socket[_0xcaee('0x22')](_0xcaee('0x23')+_0x29e068['id'],_0x29e068);}return _0x29e068;});}return null;};}function removeEntity(_0x356439){return function(_0x101562){if(_0x101562){return _0x101562[_0xcaee('0x24')]()[_0xcaee('0x25')](function(){var _0x48a5f9=_0x101562[_0xcaee('0x26')]({'plain':!![]});if(_0x48a5f9['role']==='admin')return;var _0x31cf95=[{'name':_0xcaee('0x27'),'value':_0xcaee('0x28'),'ignore':!![]},{'name':'Agents','value':_0xcaee('0x21'),'ignore':![]},{'name':_0xcaee('0x29'),'value':_0xcaee('0x2a'),'ignore':![]}];var _0x20b1b3=_(_0x31cf95)['filter']('ignore')['map'](_0xcaee('0x2b'))['value']();if(_[_0xcaee('0x2c')](_0x20b1b3,_0x48a5f9[_0xcaee('0x20')])){return;}var _0xa6af3f=_[_0xcaee('0x2d')](_0x31cf95,[_0xcaee('0x2b'),_0x48a5f9[_0xcaee('0x20')]])['name'];return db[_0xcaee('0x2e')][_0xcaee('0x24')]({'where':{'type':_0xa6af3f,'resourceId':_0x48a5f9['id']}})[_0xcaee('0x25')](function(){return _0x101562;});})[_0xcaee('0x25')](function(){_0x356439[_0xcaee('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b40a){return function(_0x1de019){if(!_0x1de019){_0x48b40a['sendStatus'](0x194);}return _0x1de019;};}function handleError(_0x49b5cc,_0x256949){_0x256949=_0x256949||0x1f4;return function(_0x3ad681){logger[_0xcaee('0x2f')](_0x3ad681[_0xcaee('0x30')]);if(_0x3ad681[_0xcaee('0x31')]){delete _0x3ad681[_0xcaee('0x31')];}_0x49b5cc[_0xcaee('0x16')](_0x256949)['send'](_0x3ad681);};}function getUserAttributes(){return _(db[_0xcaee('0x32')][_0xcaee('0x33')])[_0xcaee('0x34')](function(_0x2b3b69){return{'name':_0x2b3b69[_0xcaee('0x35')],'type':_0x2b3b69[_0xcaee('0x36')]['key']};})[_0xcaee('0x37')](function(_0x454ba6){return![_0xcaee('0x38'),'salt',_0xcaee('0x39'),'resetPasswordToken',_0xcaee('0x3a'),'md5secret'][_0xcaee('0x2c')](_0x454ba6[_0xcaee('0x31')]);})[_0xcaee('0x2b')]();}exports[_0xcaee('0x3b')]=function(_0x298f7b,_0x42aa9f){var _0xea37b3={},_0x318297={'count':0x0,'rows':[]};var _0xff5b5d=getUserAttributes();_0xea37b3=qs[_0xcaee('0x3c')](_0xff5b5d,_0x298f7b);var _0x1a01dd={'where':_0xea37b3['where']};return db[_0xcaee('0x32')][_0xcaee('0x1b')](_0x1a01dd)[_0xcaee('0x25')](function(_0x549c32){_0x318297[_0xcaee('0x1b')]=_0x549c32;if(_0x298f7b[_0xcaee('0x3d')]['includeAll']){_0xea37b3[_0xcaee('0x3e')]=[{'all':!![]}];}if(_0x298f7b[_0xcaee('0x3d')][_0xcaee('0x3f')]===_0xcaee('0x40')){_0xea37b3[_0xcaee('0x3e')]=[{'model':db['UserSetting'],'as':_0xcaee('0x3f')}];}if(!_[_0xcaee('0x2c')](_0xea37b3[_0xcaee('0x41')],'id')){_0xea37b3[_0xcaee('0x41')][_0xcaee('0x42')]('id');}return db[_0xcaee('0x32')][_0xcaee('0x43')](_0xea37b3);})[_0xcaee('0x25')](function(_0x149c5d){_0x318297[_0xcaee('0x44')]=_0x149c5d;if(_0x298f7b[_0xcaee('0x3d')]['openTabs']===_0xcaee('0x40')){var _0x247025=[];for(var _0xa7a31b=0x0;_0xa7a31b<_0x318297[_0xcaee('0x44')][_0xcaee('0x45')];_0xa7a31b++){_0x247025['push'](get_open_tabs(_0xcaee('0x46'),_0x318297[_0xcaee('0x44')][_0xa7a31b][_0xcaee('0x47')]));_0x247025[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x48'),_0x318297['rows'][_0xa7a31b][_0xcaee('0x47')]));_0x247025[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x49'),_0x318297[_0xcaee('0x44')][_0xa7a31b]['dataValues']));_0x247025['push'](get_open_tabs(_0xcaee('0x4a'),_0x318297[_0xcaee('0x44')][_0xa7a31b][_0xcaee('0x47')]));_0x247025['push'](get_open_tabs(_0xcaee('0x4b'),_0x318297[_0xcaee('0x44')][_0xa7a31b]['dataValues']));_0x247025['push'](get_open_tabs(_0xcaee('0x4c'),_0x318297[_0xcaee('0x44')][_0xa7a31b]['dataValues']));}return Promise['all'](_0x247025)[_0xcaee('0x25')](function(){return _0x318297;});}else{return _0x318297;}})[_0xcaee('0x25')](respondWithFilteredResult(_0x42aa9f,_0xea37b3))[_0xcaee('0x4d')](handleError(_0x42aa9f,null));};exports[_0xcaee('0x4e')]=function(_0x3423c7,_0xd7f7e8){var _0x1f6cc6=getUserAttributes();_0x3423c7['query']['id']=_0x3423c7['params']['id'];var _0x4ad59b=qs[_0xcaee('0x3c')](_0x1f6cc6,_0x3423c7);if(_0x3423c7[_0xcaee('0x3d')][_0xcaee('0x4f')]){_0x4ad59b[_0xcaee('0x3e')]=[{'all':!![]}];}if(_0x3423c7[_0xcaee('0x3d')][_0xcaee('0x3f')]===_0xcaee('0x40')){_0x4ad59b[_0xcaee('0x3e')]=[{'model':db[_0xcaee('0x50')],'as':_0xcaee('0x3f')}];}_0x4ad59b=_[_0xcaee('0x51')]({},_0x4ad59b,_0x3423c7[_0xcaee('0x52')]);if(!_[_0xcaee('0x2c')](_0x4ad59b[_0xcaee('0x41')],'id')){_0x4ad59b['attributes'][_0xcaee('0x42')]('id');}return db['User']['find'](_0x4ad59b)['then'](handleEntityNotFound(_0xd7f7e8,null))[_0xcaee('0x25')](function(_0x4e75e1){var _0x594077=[];values=_0x4e75e1;if(_0x3423c7[_0xcaee('0x3d')][_0xcaee('0x53')]===_0xcaee('0x40')){_0x594077['push'](get_open_tabs(_0xcaee('0x46'),_0x4e75e1[_0xcaee('0x47')]));_0x594077[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x48'),_0x4e75e1[_0xcaee('0x47')]));_0x594077[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x4b'),_0x4e75e1[_0xcaee('0x47')]));_0x594077['push'](get_open_tabs(_0xcaee('0x4c'),_0x4e75e1[_0xcaee('0x47')]));_0x594077[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x49'),_0x4e75e1[_0xcaee('0x47')]));_0x594077[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x4a'),_0x4e75e1['dataValues']));return Promise['all'](_0x594077);}else{return values;}})['then'](function(){return values;})[_0xcaee('0x25')](respondWithResult(_0xd7f7e8,null))[_0xcaee('0x4d')](handleError(_0xd7f7e8,null));};exports[_0xcaee('0x1f')]=function(_0x65018b,_0x208bcc){if(_0x65018b[_0xcaee('0x54')]['id']){delete _0x65018b['body']['id'];}delete _0x65018b['body'][_0xcaee('0x20')];return db['User'][_0xcaee('0x2d')]({'where':{'id':_0x65018b['params']['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x208bcc,null))['then'](saveUpdates(_0x65018b['body'],null))[_0xcaee('0x25')](respondWithResult(_0x208bcc,null))['catch'](handleError(_0x208bcc,null));};exports['describe']=function(_0xc3d264,_0x28b3e0){return db[_0xcaee('0x32')][_0xcaee('0x55')]()['then'](respondWithResult(_0x28b3e0,null))[_0xcaee('0x4d')](handleError(_0x28b3e0,null));};exports['addContacts']=function(_0x188240,_0x52a733){return db['User'][_0xcaee('0x2d')]({'where':{'id':_0x188240[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x52a733,null))['then'](function(_0x3d9f3e){if(_0x3d9f3e){return _0x3d9f3e['addContacts'](_0x188240['body'][_0xcaee('0x57')],_[_0xcaee('0x58')](_0x188240[_0xcaee('0x54')],[_0xcaee('0x57'),'id'])||{});}})[_0xcaee('0x25')](respondWithResult(_0x52a733,null))[_0xcaee('0x4d')](handleError(_0x52a733,null));};function validateUser(_0x51ae08){return new Promise(function(_0x2071c2,_0xf09c92){if(_0x51ae08[_0xcaee('0x59')])return _0x2071c2(_0x51ae08);return db[_0xcaee('0x5a')][_0xcaee('0x5b')](0x1)[_0xcaee('0x25')](function(_0x594694){if(_0x594694[_0xcaee('0x5c')])authService['validatePasswordPattern'](_0x51ae08['password']);db[_0xcaee('0x32')][_0xcaee('0x5d')](_0xcaee('0x59'))[_0xcaee('0x25')](function(_0x1fda59){if(_[_0xcaee('0x5e')](_0x1fda59)){_0x51ae08[_0xcaee('0x59')]=_0x594694[_0xcaee('0x5f')]||0x1;return;}if(_['isNil'](_0x594694[_0xcaee('0x5f')])||_0x594694[_0xcaee('0x5f')]===_0x1fda59){_0x51ae08[_0xcaee('0x59')]=_0x1fda59+0x1;return;}if(_0x594694['min_internal']>_0x1fda59){_0x51ae08['internal']=_0x594694['min_internal'];return;}return db[_0xcaee('0x60')][_0xcaee('0x3d')](_0xcaee('0x61'),{'type':db[_0xcaee('0x60')][_0xcaee('0x62')][_0xcaee('0x63')]})[_0xcaee('0x25')](function(_0x45d6f1){if(_0x45d6f1&&_0x45d6f1['length']){for(var _0x3501c5=0x0,_0x3ad2d9=_0x45d6f1[_0xcaee('0x45')];_0x3501c5<_0x3ad2d9&&_[_0xcaee('0x5e')](_0x51ae08['internal']);_0x3501c5++){if(_0x594694['min_internal']<=_0x45d6f1[_0x3501c5]['from']){_0x51ae08[_0xcaee('0x59')]=_0x45d6f1[_0x3501c5][_0xcaee('0x64')];}else if(_0x594694[_0xcaee('0x5f')]>_0x45d6f1[_0x3501c5][_0xcaee('0x64')]&&_0x594694[_0xcaee('0x5f')]<=_0x45d6f1[_0x3501c5]['to']){_0x51ae08['internal']=_0x594694[_0xcaee('0x5f')];}}}if(_['isNil'](_0x51ae08[_0xcaee('0x59')])){_0x51ae08[_0xcaee('0x59')]=_0x1fda59+0x1;}return _0x2071c2(_0x51ae08);});});})[_0xcaee('0x4d')](function(_0x225f85){_0xf09c92(_0x225f85);});});}function updateUser(_0x15ee64){return new Promise(function(_0xf441ef,_0x5971d6){try{if(_0x15ee64[_0xcaee('0x65')]){_0x15ee64[_0xcaee('0x66')]=_0x15ee64['internal'];_0x15ee64[_0xcaee('0x67')]={'mailbox':_0x15ee64[_0xcaee('0x59')],'password':_0x15ee64[_0xcaee('0x38')],'fullname':_0x15ee64[_0xcaee('0x68')],'email':_0x15ee64[_0xcaee('0x69')]};}if(_0x15ee64['role']==='agent'){if(!_0x15ee64['permissions'])_0x15ee64[_0xcaee('0x6a')]=['101','102',_0xcaee('0x6b'),_0xcaee('0x6c'),_0xcaee('0x6d'),_0xcaee('0x6e'),_0xcaee('0x6f'),_0xcaee('0x70'),_0xcaee('0x71'),'108',_0xcaee('0x72'),'100','111',_0xcaee('0x73'),_0xcaee('0x74')];}_0xf441ef(_0x15ee64);}catch(_0x543d25){_0x5971d6(_0x543d25);}});}exports[_0xcaee('0x75')]=function(_0x594dfd,_0x563422){if(_0x594dfd[_0xcaee('0x28')][_0xcaee('0x20')]===_0xcaee('0x21'))throw new Error(_0xcaee('0x76'));if(_0x594dfd[_0xcaee('0x54')][_0xcaee('0x20')]==='user'&&_0x594dfd[_0xcaee('0x28')][_0xcaee('0x20')]!=='admin'){throw new Error(_0xcaee('0x77'));}if(_0x594dfd[_0xcaee('0x54')]['role']==='admin'&&_0x594dfd[_0xcaee('0x28')]['role']!==_0xcaee('0x78')){throw new Error(_0xcaee('0x79'));}return licenseUtil[_0xcaee('0x7a')]([_0x594dfd[_0xcaee('0x54')]])[_0xcaee('0x25')](function(){return validateUser(_0x594dfd[_0xcaee('0x54')]);})['then'](function(_0x284819){return updateUser(_0x284819)['then'](function(_0x46e32d){if(_0x46e32d[_0xcaee('0x20')]===_0xcaee('0x78')){_0x46e32d['settingsEnabled']=_0x594dfd['user'][_0xcaee('0x7b')];delete _0x46e32d[_0xcaee('0x7c')];}return _0x46e32d;});})[_0xcaee('0x25')](function(_0x45ef1b){return db['User']['create'](_0x45ef1b,{'include':[{'model':db[_0xcaee('0x67')],'as':'VoiceMail'}]});})['then'](function(_0x4130ad){if(_0x594dfd[_0xcaee('0x54')]['role']===_0xcaee('0x28'))return _0x4130ad;if(_0x594dfd[_0xcaee('0x28')]['role']!==_0xcaee('0x28'))return _0x4130ad;return db[_0xcaee('0x7d')][_0xcaee('0x2d')]({'where':{'name':_0x4130ad[_0xcaee('0x20')]===_0xcaee('0x21')?_0xcaee('0x7e'):'Telephones','userProfileId':_0x594dfd[_0xcaee('0x28')][_0xcaee('0x7c')]},'raw':!![]})['then'](function(_0x18ecd6){if(!_0x18ecd6||_0x18ecd6[_0xcaee('0x7f')]!=0x0)return _0x4130ad;return db[_0xcaee('0x2e')][_0xcaee('0x75')]({'name':_0x4130ad['name'],'resourceId':_0x4130ad['id'],'type':_0x18ecd6[_0xcaee('0x31')],'sectionId':_0x18ecd6['id']},{})[_0xcaee('0x25')](function(){return _0x4130ad;});})[_0xcaee('0x4d')](function(_0xc1ca39){logger[_0xcaee('0x2f')](_0xcaee('0x80'),_0xc1ca39);throw _0xc1ca39;});})[_0xcaee('0x25')](respondWithResult(_0x563422,0xc9))[_0xcaee('0x4d')](handleError(_0x563422,null));};exports[_0xcaee('0x81')]=function(_0xcd8647,_0x1cb8f7){var _0x1dbe37=_0xcd8647['body'];var _0x43bfdf=[];if(_0xcd8647['user'][_0xcaee('0x20')]==='agent')throw new Error('Unauthorized');if(_[_0xcaee('0x82')](_0x1dbe37,['role','user'])&&_0xcd8647['user'][_0xcaee('0x20')]!==_0xcaee('0x78')){throw new Error(_0xcaee('0x77'));}if(_[_0xcaee('0x82')](_0x1dbe37,[_0xcaee('0x20'),'admin'])&&_0xcd8647[_0xcaee('0x28')][_0xcaee('0x20')]!==_0xcaee('0x78')){throw new Error(_0xcaee('0x83'));}return licenseUtil[_0xcaee('0x7a')](_0x1dbe37)[_0xcaee('0x25')](function(){return validateUser(_0x1dbe37[0x0]);})['then'](function(){for(var _0x2584f7=0x1;_0x2584f7<_0x1dbe37['length'];_0x2584f7++){var _0x101fa6=_0x1dbe37[_0x2584f7-0x1][_0xcaee('0x59')];if(!_0x1dbe37[_0x2584f7][_0xcaee('0x59')])_0x1dbe37[_0x2584f7][_0xcaee('0x59')]=_0x101fa6+0x1;_0x43bfdf[_0xcaee('0x42')](validateUser(_0x1dbe37[_0x2584f7]));}return Promise[_0xcaee('0x84')](_0x43bfdf);})[_0xcaee('0x25')](function(){_0x43bfdf=[];for(var _0x2dfbd2=0x0;_0x2dfbd2<_0x1dbe37['length'];_0x2dfbd2++){_0x43bfdf[_0xcaee('0x42')](updateUser(_0x1dbe37[_0x2dfbd2]));}return Promise[_0xcaee('0x84')](_0x43bfdf);})[_0xcaee('0x25')](function(){_0x43bfdf=_0x1dbe37[_0xcaee('0x34')](function(_0x3324dd){return db[_0xcaee('0x32')]['create'](_0x3324dd,{'include':[{'model':db['VoiceMail'],'as':_0xcaee('0x67')}]})[_0xcaee('0x25')](function(_0x2a0f46){_0x3324dd['id']=_0x2a0f46['id'];return _0x3324dd;});});return Promise[_0xcaee('0x84')](_0x43bfdf);})[_0xcaee('0x25')](function(_0x1e521b){if(_0xcd8647['body'][_0xcaee('0x20')]===_0xcaee('0x28'))return _0x1e521b;if(_0xcd8647[_0xcaee('0x28')][_0xcaee('0x20')]!==_0xcaee('0x28'))return _0x1e521b;var _0x26bff9=_[_0xcaee('0x82')](_0x1e521b,function(_0x286967){return _0x286967[_0xcaee('0x20')]===_0xcaee('0x21')||_0x286967[_0xcaee('0x20')]===_0xcaee('0x2a');});if(!_0x26bff9)return _0x1e521b;return db[_0xcaee('0x7d')][_0xcaee('0x43')]({'where':{'name':{'$or':[_0xcaee('0x7e'),_0xcaee('0x29')]},'userProfileId':_0xcd8647['user'][_0xcaee('0x7c')]},'raw':!![]})[_0xcaee('0x25')](function(_0x2198b9){if(_[_0xcaee('0x85')](_0x2198b9)||!_['some'](_0x2198b9,[_0xcaee('0x7f'),0x0]))return _0x1e521b;_0x43bfdf=[];var _0x16799d=_(_0x2198b9)[_0xcaee('0x34')](function(_0x2b96b0){if(_0x2b96b0[_0xcaee('0x7f')]===0x1)return;return _0x2b96b0[_0xcaee('0x31')]==='Agents'?'agent':_0xcaee('0x2a');})['compact']()[_0xcaee('0x2b')]();for(var _0x5cd688=0x0;_0x5cd688<_0x1e521b['length'];_0x5cd688++){if(!_[_0xcaee('0x2c')](_0x16799d,_0x1e521b[_0x5cd688][_0xcaee('0x20')]))return;var _0x2c9b19=_0x1e521b[_0x5cd688][_0xcaee('0x20')]===_0xcaee('0x21')?_0xcaee('0x7e'):_0xcaee('0x29');_0x43bfdf[_0xcaee('0x42')](db[_0xcaee('0x2e')]['create']({'name':_0x1e521b[_0x5cd688][_0xcaee('0x31')],'resourceId':_0x1e521b[_0x5cd688]['id'],'type':_0x2c9b19,'sectionId':_[_0xcaee('0x2d')](_0x2198b9,[_0xcaee('0x31'),_0x2c9b19])['id']},{}));}return Promise[_0xcaee('0x84')](_0x43bfdf);});})[_0xcaee('0x25')](respondWithResult(_0x1cb8f7,0xc9))[_0xcaee('0x4d')](handleError(_0x1cb8f7,null));};exports[_0xcaee('0x86')]=function(_0x3e27fa,_0x59025e){if(_0x3e27fa[_0xcaee('0x54')]['id']){delete _0x3e27fa['body']['id'];}return db['User'][_0xcaee('0x2d')]({'where':{'id':_0x3e27fa[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](function(_0x293c16){if(!_0x293c16)return null;if(_0x293c16['id']===_0x3e27fa[_0xcaee('0x28')]['id']){if(!_0x3e27fa['body'][_0xcaee('0x87')]||!_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')]){throw new db[(_0xcaee('0x89'))][(_0xcaee('0x8a'))](_0xcaee('0x8b'));}if(!_0x293c16['authenticate'](_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x87')])){throw new db[(_0xcaee('0x89'))]['ValidationError'](_0xcaee('0x8c'));}if(_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x87')]===_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')]){throw new db[(_0xcaee('0x89'))][(_0xcaee('0x8a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x3e27fa[_0xcaee('0x28')]['role']===_0xcaee('0x78')){if(!_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')]){throw new db[(_0xcaee('0x89'))][(_0xcaee('0x8a'))](_0xcaee('0x8d'));}}else if(_0x3e27fa[_0xcaee('0x28')][_0xcaee('0x20')]==='user'){if(!_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')]){throw new db['Sequelize'][(_0xcaee('0x8a'))](_0xcaee('0x8d'));}if(_0x293c16[_0xcaee('0x20')]!=='agent'){throw new db[(_0xcaee('0x89'))]['ValidationError']('Unauthorized');}}else{throw new db[(_0xcaee('0x89'))]['ValidationError'](_0xcaee('0x76'));}return _0x293c16;})[_0xcaee('0x25')](handleEntityNotFound(_0x59025e,null))[_0xcaee('0x25')](function(_0x1db6ff){return db[_0xcaee('0x5a')][_0xcaee('0x8e')]({'attributes':['id',_0xcaee('0x5c'),_0xcaee('0x8f'),_0xcaee('0x90')]})[_0xcaee('0x25')](function(_0x50ac7c){if(_0x50ac7c[_0xcaee('0x5c')])authService[_0xcaee('0x91')](_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')]);if(!_0x50ac7c['enforcePasswordHistory']||!_0x1db6ff[_0xcaee('0x39')])return _0x1db6ff;authService[_0xcaee('0x92')](_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')],_0x1db6ff[_0xcaee('0x39')],_0x50ac7c[_0xcaee('0x90')]);return _0x1db6ff;})[_0xcaee('0x25')](saveUpdates({'password':_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')],'passwordResetAt':_0x3e27fa['user']['id']==_0x3e27fa[_0xcaee('0x56')]['id']?moment():null,'previousPasswords':authService[_0xcaee('0x93')](_0x3e27fa[_0xcaee('0x54')][_0xcaee('0x88')],_0x1db6ff[_0xcaee('0x39')])},null));})[_0xcaee('0x25')](respondWithResult(_0x59025e,null))[_0xcaee('0x4d')](handleError(_0x59025e,null));};exports[_0xcaee('0x94')]=function(_0xd1010b,_0x24f20e){var _0x3c13c0=_0xd1010b['body']['channel'];return db['User'][_0xcaee('0x2d')]({'where':{'id':_0xd1010b[_0xcaee('0x56')]['id']},'attributes':['id',_0xcaee('0x31'),_0xcaee('0x20'),_0xcaee('0x95'),_0xcaee('0x96'),_0xcaee('0x97'),_0xcaee('0x98')]})['then'](handleEntityNotFound(_0x24f20e,null))['then'](function(_0x4649b6){if(_0x4649b6){if(!utils[_0xcaee('0x99')](_0x3c13c0)){throw new db['Sequelize'][(_0xcaee('0x8a'))](_0xcaee('0x9a'));}return _0x4649b6[_0xcaee('0x9b')+_['capitalize'](_0x3c13c0[_0xcaee('0x9c')]())+_0xcaee('0x9d')](_0xd1010b[_0xcaee('0x54')][_0xcaee('0x57')],{'penalty':_0xd1010b[_0xcaee('0x54')][_0xcaee('0x9e')]||0x0})[_0xcaee('0x9f')](function(_0x5a14f2){for(var _0x552728=0x0;_0x552728<_0xd1010b[_0xcaee('0x54')][_0xcaee('0x57')]['length'];_0x552728+=0x1){var _0x389203={'UserId':Number(_0xd1010b['params']['id'])};_0x389203[_[_0xcaee('0xa0')](_0x3c13c0['toLowerCase']())+_0xcaee('0xa1')]=Number(_0xd1010b['body'][_0xcaee('0x57')][_0x552728]);socket[_0xcaee('0x22')](_0xcaee('0x28')+_[_0xcaee('0xa0')](_0x3c13c0[_0xcaee('0x9c')]())+'Queue:save',_0x389203);}return _0x5a14f2;})[_0xcaee('0x25')](function(){if(_0x3c13c0==='voice'){return db['VoiceQueue'][_0xcaee('0x43')]({'where':{'id':_0xd1010b[_0xcaee('0x54')][_0xcaee('0x57')]||[]},'raw':!![],'attributes':['id',_0xcaee('0x31')]});}})[_0xcaee('0x25')](function(_0x30b1c2){var _0x1636e8=_0x4649b6[_0xcaee('0x26')]({'plain':!![]});var _0x87fa=[];if(_0x3c13c0===_0xcaee('0xa2')&&_0x1636e8[_0xcaee('0x20')]===_0xcaee('0x21')&&_0x1636e8['online']){for(let _0x2c4e51=0x0;_0x2c4e51<_0x30b1c2[_0xcaee('0x45')];_0x2c4e51+=0x1){_0x87fa[_0xcaee('0x42')]({'membername':_0x1636e8[_0xcaee('0x31')],'UserId':_0x1636e8['id'],'queue_name':_0x30b1c2[_0x2c4e51][_0xcaee('0x31')],'VoiceQueueId':_0x30b1c2[_0x2c4e51]['id'],'interface':_['isNil'](_0x1636e8['interface'])?util[_0xcaee('0xa3')](_0xcaee('0xa4'),_0x1636e8['name']):_0x1636e8[_0xcaee('0x98')],'paused':_0x1636e8[_0xcaee('0x97')]||![],'penalty':_0xd1010b[_0xcaee('0x54')][_0xcaee('0x9e')]||0x0});}return Promise['all'](_0x87fa[_0xcaee('0x34')](function(_0x545de5){return db[_0xcaee('0xa5')]['upsert'](_0x545de5);}));}return _0x4649b6;});}})['then'](respondWithStatusCode(_0x24f20e,null))[_0xcaee('0x4d')](handleError(_0x24f20e,null));};exports['removeQueues']=function(_0x24f770,_0x30ce7c){var _0x26ca51,_0x30aa62;return db[_0xcaee('0x32')][_0xcaee('0x2d')]({'where':{'id':_0x24f770['params']['id']},'attributes':['id','name',_0xcaee('0x20')]})['then'](handleEntityNotFound(_0x30ce7c,null))['then'](function(_0x17bcc7){if(_0x17bcc7){_0x26ca51=_0x17bcc7;if(!_0x24f770[_0xcaee('0x3d')][_0xcaee('0xa6')]||!utils[_0xcaee('0x99')](_0x24f770[_0xcaee('0x3d')]['channel'])){throw new db[(_0xcaee('0x89'))][(_0xcaee('0x8a'))]('Unknown\x20channel');}return _0x17bcc7['remove'+_[_0xcaee('0xa0')](_0x24f770[_0xcaee('0x3d')][_0xcaee('0xa6')][_0xcaee('0x9c')]())+_0xcaee('0x9d')](_0x24f770[_0xcaee('0x3d')][_0xcaee('0x57')]);}})[_0xcaee('0x25')](function(_0x3f65a5){if(_[_0xcaee('0xa7')](_0x24f770['query'][_0xcaee('0x57')])){for(var _0x3057cd=0x0;_0x3057cd<_0x24f770[_0xcaee('0x3d')][_0xcaee('0x57')][_0xcaee('0x45')];_0x3057cd+=0x1){_0x30aa62={'UserId':Number(_0x24f770[_0xcaee('0x56')]['id'])};_0x30aa62[_[_0xcaee('0xa0')](_0x24f770['query'][_0xcaee('0xa6')][_0xcaee('0x9c')]())+_0xcaee('0xa1')]=Number(_0x24f770[_0xcaee('0x3d')][_0xcaee('0x57')][_0x3057cd]);socket[_0xcaee('0x22')](_0xcaee('0x28')+_[_0xcaee('0xa0')](_0x24f770[_0xcaee('0x3d')][_0xcaee('0xa6')]['toLowerCase']())+'Queue:remove',_0x30aa62);}}else{_0x30aa62={'UserId':Number(_0x24f770[_0xcaee('0x56')]['id'])};_0x30aa62[_[_0xcaee('0xa0')](_0x24f770[_0xcaee('0x3d')]['channel'][_0xcaee('0x9c')]())+_0xcaee('0xa1')]=Number(_0x24f770[_0xcaee('0x3d')]['ids']);socket[_0xcaee('0x22')](_0xcaee('0x28')+_[_0xcaee('0xa0')](_0x24f770[_0xcaee('0x3d')]['channel']['toLowerCase']())+'Queue:remove',_0x30aa62);}return _0x3f65a5;})[_0xcaee('0x25')](function(){if(_0x24f770[_0xcaee('0x3d')]['channel']===_0xcaee('0xa2')){return db[_0xcaee('0xa5')][_0xcaee('0x24')]({'where':{'UserId':_0x24f770[_0xcaee('0x56')]['id'],'VoiceQueueId':_0x24f770['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x26ca51;});}return _0x26ca51;})['then'](respondWithStatusCode(_0x30ce7c,null))['catch'](handleError(_0x30ce7c,null));};exports[_0xcaee('0xa8')]=function(_0x3347d6,_0x5227d1){_0x3347d6[_0xcaee('0x54')]['userpic']=_0x3347d6[_0xcaee('0xa9')][_0xcaee('0xaa')];return db[_0xcaee('0x32')][_0xcaee('0x2d')]({'where':{'id':_0x3347d6['params']['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x5227d1,null))[_0xcaee('0x25')](saveUpdates(_0x3347d6[_0xcaee('0x54')],null))[_0xcaee('0x25')](respondWithResult(_0x5227d1,null))[_0xcaee('0x4d')](handleError(_0x5227d1,null));};exports[_0xcaee('0xab')]=function(_0x37583d,_0x154bb2){var _0x3a824c=path[_0xcaee('0xac')](config['root'],_0xcaee('0xad'));return db[_0xcaee('0x32')][_0xcaee('0x2d')]({'where':{'id':_0x37583d[_0xcaee('0x56')]['id']},'attributes':['id',_0xcaee('0xae')],'raw':!![]})[_0xcaee('0x25')](handleEntityNotFound(_0x154bb2,null))[_0xcaee('0x25')](function(_0x5bad46){if(_0x5bad46){if(_[_0xcaee('0x5e')](_0x5bad46[_0xcaee('0xae')])){return _0x154bb2[_0xcaee('0xaf')](_0x3a824c);}else{if(!fs[_0xcaee('0xb0')](path['join'](config[_0xcaee('0xb1')],_0xcaee('0xb2'),_0x5bad46['userpic']))){return _0x154bb2[_0xcaee('0xaf')](_0x3a824c);}return _0x154bb2[_0xcaee('0xaf')](path[_0xcaee('0xac')](config[_0xcaee('0xb1')],_0xcaee('0xb2'),_0x5bad46[_0xcaee('0xae')]));}}})[_0xcaee('0x4d')](handleError(_0x154bb2,null));};exports[_0xcaee('0xb3')]=function(_0x2c3a39,_0xede8f0){return db[_0xcaee('0x32')][_0xcaee('0x2d')]({'where':{'id':_0x2c3a39[_0xcaee('0x56')]['id']},'attributes':['id']})[_0xcaee('0x25')](handleEntityNotFound(_0xede8f0,null))[_0xcaee('0x25')](function(_0x47d33d){var _0x323492=[];values=_0x47d33d['dataValues'];_0x323492['push'](get_open_tabs(_0xcaee('0x46'),_0x47d33d[_0xcaee('0x47')]));_0x323492[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x48'),_0x47d33d[_0xcaee('0x47')]));_0x323492[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x4b'),_0x47d33d[_0xcaee('0x47')]));_0x323492[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x4c'),_0x47d33d[_0xcaee('0x47')]));_0x323492['push'](get_open_tabs(_0xcaee('0x49'),_0x47d33d[_0xcaee('0x47')]));_0x323492[_0xcaee('0x42')](get_open_tabs(_0xcaee('0x4a'),_0x47d33d[_0xcaee('0x47')]));return Promise['all'](_0x323492);})['then'](function(_0x1a30b8){if(_0x1a30b8){var _0xcc1a81=_[_0xcaee('0x34')](values['ChatOpenTabs'],function(_0x518674){return{'channel':_0xcaee('0xb4'),'id':_0x518674['id'],'createdAt':_0x518674[_0xcaee('0xb5')]};});var _0x444825=_['map'](values[_0xcaee('0xb6')],function(_0x5be5e4){return{'channel':'FAX','id':_0x5be5e4['id'],'createdAt':_0x5be5e4[_0xcaee('0xb5')]};});var _0x13c3b4=_[_0xcaee('0x34')](values[_0xcaee('0xb7')],function(_0x5dc08b){return{'channel':_0xcaee('0xb8'),'id':_0x5dc08b['id'],'createdAt':_0x5dc08b[_0xcaee('0xb5')]};});var _0x50660d=_[_0xcaee('0x34')](values[_0xcaee('0xb9')],function(_0x5d72ad){return{'channel':_0xcaee('0xba'),'id':_0x5d72ad['id'],'createdAt':_0x5d72ad['createdAt']};});var _0xd5be78=_['map'](values[_0xcaee('0xbb')],function(_0x3f16a3){return{'channel':_0xcaee('0xbc'),'id':_0x3f16a3['id'],'createdAt':_0x3f16a3['createdAt']};});var _0x5e9358=_['map'](values[_0xcaee('0xbd')],function(_0x3927d3){return{'channel':'WHATSAPP','id':_0x3927d3['id'],'createdAt':_0x3927d3['createdAt']};});var _0x3f450f=_[_0xcaee('0xbe')](_0xcc1a81,_0x444825,_0x13c3b4,_0x50660d,_0xd5be78,_0x5e9358);var _0x27e18a={'count':_0x3f450f[_0xcaee('0x45')],'rows':_0x3f450f};return _0x27e18a;}else return null;})[_0xcaee('0x25')](respondWithResult(_0xede8f0,null))[_0xcaee('0x4d')](handleError(_0xede8f0,null));};exports[_0xcaee('0xbf')]=function(_0x8faa98,_0x2c8496){var _0xdf1515={};return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x8faa98['params']['id']}})['then'](function(_0x43baea){if(!_0x43baea){throw new APINotFoundError(util[_0xcaee('0xa3')]('User\x20with\x20id\x20%s\x20not\x20found',_0x8faa98['params']['id']));}return contacts[_0xcaee('0x55')]();})['then'](function(_0x12867a){_0x8faa98[_0xcaee('0x3d')][_0xcaee('0x32')]=_0x8faa98['params']['id'];_0xdf1515=qs['getOptions'](_0x12867a,_0x8faa98);if(_0x8faa98[_0xcaee('0x3d')][_0xcaee('0xc0')](_0xcaee('0x4f'))){_0xdf1515['include']=[{'model':db['CmList'],'as':_0xcaee('0xc1'),'required':![]},{'model':db[_0xcaee('0xc2')],'as':'Tags','attributes':['id',_0xcaee('0x31'),_0xcaee('0xc3')],'where':_0x8faa98['query'][_0xcaee('0xc4')]?{'id':_0x8faa98[_0xcaee('0x3d')][_0xcaee('0xc4')]}:undefined,'required':_0x8faa98[_0xcaee('0x3d')][_0xcaee('0xc4')]?!![]:![]}];}return contacts[_0xcaee('0x43')](_0x8faa98[_0xcaee('0x3d')],_0x8faa98[_0xcaee('0x28')],_0xdf1515,_0x12867a);})['then'](respondWithFilteredResult(_0x2c8496,_0xdf1515))[_0xcaee('0x4d')](APIHandleError(_0x2c8496));};exports[_0xcaee('0xc5')]=function(_0x1888cc,_0xe2fdee){var _0x357c15;var _0x4fef65={};var _0x312b5c;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x1888cc[_0xcaee('0x56')]['id']},'attributes':['id','name',_0xcaee('0x20')]})[_0xcaee('0x25')](handleEntityNotFound(_0xe2fdee,null))[_0xcaee('0x25')](function(_0x3574f6){if(!utils[_0xcaee('0x99')](_0x1888cc['query'][_0xcaee('0xa6')])){throw new db[(_0xcaee('0x89'))][(_0xcaee('0x8a'))](_0xcaee('0x9a'));}_0x357c15=_0x3574f6;var _0x4cc9b1={};_0x4cc9b1[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db[_[_0xcaee('0xa0')](_0x1888cc[_0xcaee('0x3d')][_0xcaee('0xa6')])+_0xcaee('0xc8')][_0xcaee('0x33')]);_0x4cc9b1['query']=_[_0xcaee('0xc7')](_0x1888cc[_0xcaee('0x3d')]);_0x4cc9b1[_0xcaee('0xc9')]=_['intersection'](_0x4cc9b1[_0xcaee('0xc6')],_0x4cc9b1['query']);_0x4fef65[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x4cc9b1[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0x1888cc[_0xcaee('0x3d')]['fields']));_0x4fef65[_0xcaee('0x41')]=_0x4fef65[_0xcaee('0x41')][_0xcaee('0x45')]?_0x4fef65[_0xcaee('0x41')]:_0x4cc9b1[_0xcaee('0xc6')];_0x4fef65[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x1888cc[_0xcaee('0x3d')]['sort']);_0x4fef65['where']=qs['filters'](_[_0xcaee('0xce')](_0x1888cc[_0xcaee('0x3d')],_0x4cc9b1[_0xcaee('0xc9')]));if(_0x1888cc[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x4fef65[_0xcaee('0xcf')]=_[_0xcaee('0x51')](_0x4fef65[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x4fef65['attributes'],function(_0x43b9e8){var _0x228735={};_0x228735[_0x43b9e8]={'$like':'%'+_0x1888cc['query']['filter']+'%'};return _0x228735;})});}_0x4fef65=_[_0xcaee('0x51')]({},_0x4fef65,_0x1888cc[_0xcaee('0x52')]);switch(_0x357c15[_0xcaee('0x20')]){case _0xcaee('0x78'):return db[_[_0xcaee('0xa0')](_0x1888cc[_0xcaee('0x3d')][_0xcaee('0xa6')])+'Queue'][_0xcaee('0x43')](_0x4fef65);case _0xcaee('0x28'):case _0xcaee('0x21'):return _0x357c15[_0xcaee('0x26')+_[_0xcaee('0xa0')](_0x1888cc[_0xcaee('0x3d')][_0xcaee('0xa6')])+_0xcaee('0x9d')](_0x4fef65);default:throw new db['Sequelize'][(_0xcaee('0x8a'))](_0xcaee('0xd0'));}})[_0xcaee('0x25')](function(_0x520507){_0x312b5c=_0x520507['length'];if(!_0x1888cc[_0xcaee('0x3d')][_0xcaee('0xc0')]('nolimit')){_0x4fef65['limit']=qs[_0xcaee('0x19')](_0x1888cc[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x4fef65['offset']=qs[_0xcaee('0x18')](_0x1888cc[_0xcaee('0x3d')][_0xcaee('0x18')]);}switch(_0x357c15[_0xcaee('0x20')]){case _0xcaee('0x78'):return db[_[_0xcaee('0xa0')](_0x1888cc[_0xcaee('0x3d')][_0xcaee('0xa6')])+'Queue']['findAll'](_0x4fef65);case _0xcaee('0x28'):case _0xcaee('0x21'):return _0x357c15['get'+_[_0xcaee('0xa0')](_0x1888cc[_0xcaee('0x3d')]['channel'])+_0xcaee('0x9d')](_0x4fef65);}})[_0xcaee('0x25')](function(_0x361a3c){return{'count':_0x312b5c,'rows':_0x361a3c};})[_0xcaee('0x25')](respondWithResult(_0xe2fdee,null))[_0xcaee('0x4d')](handleError(_0xe2fdee,null));};exports[_0xcaee('0xd1')]=function(_0x156b46,_0x2a9114){var _0x37a531={};var _0xae1e20={};var _0x1a8e85;var _0x50c326;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x156b46[_0xcaee('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a9114,null))[_0xcaee('0x25')](function(_0x412f6a){if(_0x412f6a){_0x1a8e85=_0x412f6a;_0xae1e20['model']=_['keys'](db[_0xcaee('0xa5')]['rawAttributes']);_0xae1e20[_0xcaee('0x3d')]=_[_0xcaee('0xc7')](_0x156b46[_0xcaee('0x3d')]);_0xae1e20[_0xcaee('0xc9')]=_['intersection'](_0xae1e20[_0xcaee('0xc6')],_0xae1e20[_0xcaee('0x3d')]);_0x37a531[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0xae1e20['model'],qs[_0xcaee('0xcb')](_0x156b46[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x37a531[_0xcaee('0x41')]=_0x37a531[_0xcaee('0x41')]['length']?_0x37a531[_0xcaee('0x41')]:_0xae1e20[_0xcaee('0xc6')];_0x37a531[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x156b46[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x37a531[_0xcaee('0xcf')]=qs['filters'](_[_0xcaee('0xce')](_0x156b46[_0xcaee('0x3d')],_0xae1e20[_0xcaee('0xc9')]));if(_0x156b46[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x37a531[_0xcaee('0xcf')]=_['merge'](_0x37a531[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x37a531[_0xcaee('0x41')],function(_0x5fb320){var _0x3a117={};_0x3a117[_0x5fb320]={'$like':'%'+_0x156b46['query'][_0xcaee('0x37')]+'%'};return _0x3a117;})});}_0x37a531=_[_0xcaee('0x51')]({},_0x37a531,_0x156b46[_0xcaee('0x52')]);return _0x1a8e85[_0xcaee('0xd1')](_0x37a531);}})['then'](function(_0x541cad){if(_0x541cad){_0x50c326=_0x541cad['length'];if(!_0x156b46[_0xcaee('0x3d')]['hasOwnProperty'](_0xcaee('0xd2'))){_0x37a531[_0xcaee('0x19')]=qs['limit'](_0x156b46['query'][_0xcaee('0x19')]);_0x37a531[_0xcaee('0x18')]=qs['offset'](_0x156b46[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0x1a8e85[_0xcaee('0xd1')](_0x37a531);}})[_0xcaee('0x25')](function(_0x5b42e2){if(_0x5b42e2){return _0x5b42e2?{'count':_0x50c326,'rows':_0x5b42e2}:null;}})[_0xcaee('0x25')](respondWithResult(_0x2a9114,null))[_0xcaee('0x4d')](handleError(_0x2a9114,null));};exports[_0xcaee('0xd3')]=function(_0x2a10db,_0x929a59){var _0x502587={};var _0x19e91f={};var _0x320b05;var _0x101cf4;return db[_0xcaee('0x32')]['findOne']({'where':{'id':_0x2a10db[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x929a59,null))[_0xcaee('0x25')](function(_0x9b8e0a){if(_0x9b8e0a){_0x320b05=_0x9b8e0a;_0x19e91f[_0xcaee('0xc6')]=_['keys'](db[_0xcaee('0xd4')]['rawAttributes']);_0x19e91f[_0xcaee('0x3d')]=_[_0xcaee('0xc7')](_0x2a10db[_0xcaee('0x3d')]);_0x19e91f['filters']=_['intersection'](_0x19e91f['model'],_0x19e91f[_0xcaee('0x3d')]);_0x502587['attributes']=_[_0xcaee('0xca')](_0x19e91f[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0x2a10db[_0xcaee('0x3d')]['fields']));_0x502587[_0xcaee('0x41')]=_0x502587[_0xcaee('0x41')][_0xcaee('0x45')]?_0x502587[_0xcaee('0x41')]:_0x19e91f['model'];_0x502587[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x2a10db[_0xcaee('0x3d')]['sort']);_0x502587[_0xcaee('0xcf')]=qs[_0xcaee('0xc9')](_[_0xcaee('0xce')](_0x2a10db[_0xcaee('0x3d')],_0x19e91f[_0xcaee('0xc9')]));if(_0x2a10db[_0xcaee('0x3d')]['filter']){_0x502587[_0xcaee('0xcf')]=_[_0xcaee('0x51')](_0x502587['where'],{'$or':_['map'](_0x502587[_0xcaee('0x41')],function(_0x255118){var _0x521a4c={};_0x521a4c[_0x255118]={'$like':'%'+_0x2a10db[_0xcaee('0x3d')][_0xcaee('0x37')]+'%'};return _0x521a4c;})});}_0x502587=_['merge']({},_0x502587,_0x2a10db[_0xcaee('0x52')]);return _0x320b05[_0xcaee('0xd3')](_0x502587);}})[_0xcaee('0x25')](function(_0x46c13e){if(_0x46c13e){_0x101cf4=_0x46c13e['length'];if(!_0x2a10db[_0xcaee('0x3d')][_0xcaee('0xc0')](_0xcaee('0xd2'))){_0x502587[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x2a10db[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x502587['offset']=qs[_0xcaee('0x18')](_0x2a10db[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0x320b05[_0xcaee('0xd3')](_0x502587);}})[_0xcaee('0x25')](function(_0x46fc10){if(_0x46fc10){return _0x46fc10?{'count':_0x101cf4,'rows':_0x46fc10}:null;}})[_0xcaee('0x25')](respondWithResult(_0x929a59,null))[_0xcaee('0x4d')](handleError(_0x929a59,null));};exports['getRecordings']=function(_0x415b81,_0x32a552){var _0x5cb54c={'raw':!![],'where':{}};var _0x58f546={};var _0x38cc6a={'count':0x0,'rows':[]};return db['User'][_0xcaee('0x8e')]({'where':{'id':_0x415b81[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x32a552,null))['then'](function(_0x3a3888){if(_0x3a3888){_0x58f546[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db['VoiceRecording']['rawAttributes']);_0x58f546['query']=_[_0xcaee('0xc7')](_0x415b81[_0xcaee('0x3d')]);_0x58f546[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x58f546[_0xcaee('0xc6')],_0x58f546[_0xcaee('0x3d')]);_0x5cb54c[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x58f546[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0x415b81[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x5cb54c[_0xcaee('0x41')]=_0x5cb54c[_0xcaee('0x41')]['length']?_0x5cb54c['attributes']:_0x58f546[_0xcaee('0xc6')];if(!_0x415b81[_0xcaee('0x3d')][_0xcaee('0xc0')](_0xcaee('0xd2'))){_0x5cb54c[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x415b81[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x5cb54c[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0x415b81[_0xcaee('0x3d')][_0xcaee('0x18')]);}_0x5cb54c[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x415b81[_0xcaee('0x3d')]['sort']);_0x5cb54c[_0xcaee('0xcf')]=qs['filters'](_[_0xcaee('0xce')](_0x415b81[_0xcaee('0x3d')],_0x58f546['filters']));_0x5cb54c[_0xcaee('0xcf')][_0xcaee('0xd5')]=_0x3a3888['id'];if(_0x415b81[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x5cb54c[_0xcaee('0xcf')]=_[_0xcaee('0x51')](_0x5cb54c[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x5cb54c['attributes'],function(_0x13cc77){var _0x4210b3={};_0x4210b3[_0x13cc77]={'$like':'%'+_0x415b81[_0xcaee('0x3d')][_0xcaee('0x37')]+'%'};return _0x4210b3;})});}_0x5cb54c=_[_0xcaee('0x51')]({},_0x5cb54c,_0x415b81[_0xcaee('0x52')]);return db['VoiceRecording'][_0xcaee('0x1b')]({'where':_0x5cb54c[_0xcaee('0xcf')]})[_0xcaee('0x25')](function(_0x2c7a3c){_0x38cc6a['count']=_0x2c7a3c;if(_0x415b81[_0xcaee('0x3d')]['includeAll']){_0x5cb54c[_0xcaee('0x3e')]=[{'all':!![]}];}return db['VoiceRecording'][_0xcaee('0x43')](_0x5cb54c);})[_0xcaee('0x25')](function(_0x5c1f63){_0x38cc6a['rows']=_0x5c1f63;return _0x38cc6a;});}})['then'](respondWithFilteredResult(_0x32a552,_0x5cb54c))['catch'](handleError(_0x32a552,null));};exports[_0xcaee('0xd6')]=function(_0xe1cc60,_0x4edf0a){var _0x300176={'raw':!![],'where':{}};var _0x209a3e={};var _0x3559ea={'count':0x0,'rows':[]};return db['User'][_0xcaee('0x8e')]({'where':{'id':_0xe1cc60[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x4edf0a,null))[_0xcaee('0x25')](function(_0x3352a0){if(_0x3352a0){_0x209a3e[_0xcaee('0xc6')]=_['keys'](db[_0xcaee('0xd7')][_0xcaee('0x33')]);_0x209a3e[_0xcaee('0x3d')]=_['keys'](_0xe1cc60['query']);_0x209a3e[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x209a3e[_0xcaee('0xc6')],_0x209a3e[_0xcaee('0x3d')]);_0x300176[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x209a3e[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0xe1cc60['query']['fields']));_0x300176[_0xcaee('0x41')]=_0x300176['attributes'][_0xcaee('0x45')]?_0x300176[_0xcaee('0x41')]:_0x209a3e['model'];if(!_0xe1cc60['query'][_0xcaee('0xc0')](_0xcaee('0xd2'))){_0x300176[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0xe1cc60[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x300176[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0xe1cc60[_0xcaee('0x3d')]['offset']);}_0x300176[_0xcaee('0xcc')]=qs['sort'](_0xe1cc60[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x300176[_0xcaee('0xcf')]=qs[_0xcaee('0xc9')](_['pick'](_0xe1cc60[_0xcaee('0x3d')],_0x209a3e[_0xcaee('0xc9')]));_0x300176[_0xcaee('0xcf')][_0xcaee('0xd5')]=_0x3352a0['id'];if(_0xe1cc60['query']['filter']){_0x300176[_0xcaee('0xcf')]=_['merge'](_0x300176[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x300176[_0xcaee('0x41')],function(_0x124436){var _0x84cf93={};_0x84cf93[_0x124436]={'$like':'%'+_0xe1cc60['query'][_0xcaee('0x37')]+'%'};return _0x84cf93;})});}_0x300176=_[_0xcaee('0x51')]({},_0x300176,_0xe1cc60[_0xcaee('0x52')]);return db[_0xcaee('0xd7')]['count']({'where':_0x300176['where']})['then'](function(_0xbc7a8){_0x3559ea[_0xcaee('0x1b')]=_0xbc7a8;if(_0xe1cc60[_0xcaee('0x3d')][_0xcaee('0x4f')]){_0x300176['include']=[{'all':!![]}];}return db[_0xcaee('0xd7')][_0xcaee('0x43')](_0x300176);})['then'](function(_0x27b741){_0x3559ea['rows']=_0x27b741;return _0x3559ea;});}})[_0xcaee('0x25')](respondWithFilteredResult(_0x4edf0a,_0x300176))[_0xcaee('0x4d')](handleError(_0x4edf0a,null));};exports[_0xcaee('0xd8')]=function(_0x28d835,_0x37c1fc){var _0x192159={};var _0x31b150={};var _0x36ffd8;var _0x461233;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x28d835[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x37c1fc,null))['then'](function(_0x199da1){if(_0x199da1){_0x36ffd8=_0x199da1;_0x31b150[_0xcaee('0xc6')]=_['keys'](db['ChatInteraction'][_0xcaee('0x33')]);_0x31b150['query']=_[_0xcaee('0xc7')](_0x28d835['query']);_0x31b150[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x31b150[_0xcaee('0xc6')],_0x31b150[_0xcaee('0x3d')]);_0x192159['attributes']=_['intersection'](_0x31b150[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0x28d835[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x192159[_0xcaee('0x41')]=_0x192159['attributes'][_0xcaee('0x45')]?_0x192159[_0xcaee('0x41')]:_0x31b150['model'];_0x192159[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x28d835[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x192159['where']=qs[_0xcaee('0xc9')](_[_0xcaee('0xce')](_0x28d835[_0xcaee('0x3d')],_0x31b150[_0xcaee('0xc9')]));if(_0x28d835[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x192159[_0xcaee('0xcf')]=_[_0xcaee('0x51')](_0x192159[_0xcaee('0xcf')],{'$or':_['map'](_0x192159[_0xcaee('0x41')],function(_0x4792b8){var _0x119baa={};_0x119baa[_0x4792b8]={'$like':'%'+_0x28d835['query'][_0xcaee('0x37')]+'%'};return _0x119baa;})});}_0x192159=_[_0xcaee('0x51')]({},_0x192159,_0x28d835['options']);return _0x36ffd8['getChatInteractions'](_0x192159);}})[_0xcaee('0x25')](function(_0xbe05){if(_0xbe05){_0x461233=_0xbe05[_0xcaee('0x45')];if(!_0x28d835[_0xcaee('0x3d')]['hasOwnProperty'](_0xcaee('0xd2'))){_0x192159[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x28d835['query']['limit']);_0x192159[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0x28d835[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0x36ffd8[_0xcaee('0xd8')](_0x192159);}})[_0xcaee('0x25')](function(_0x2eb047){if(_0x2eb047){return _0x2eb047?{'count':_0x461233,'rows':_0x2eb047}:null;}})[_0xcaee('0x25')](respondWithResult(_0x37c1fc,null))[_0xcaee('0x4d')](handleError(_0x37c1fc,null));};exports[_0xcaee('0xd9')]=function(_0x39ab59,_0x4836de){var _0x430109={};var _0x388c28={};var _0x2e8eea;var _0x2691e3;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x39ab59[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x4836de,null))[_0xcaee('0x25')](function(_0x52a7d6){if(_0x52a7d6){_0x2e8eea=_0x52a7d6;_0x388c28[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db[_0xcaee('0xda')][_0xcaee('0x33')]);_0x388c28[_0xcaee('0x3d')]=_[_0xcaee('0xc7')](_0x39ab59[_0xcaee('0x3d')]);_0x388c28[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x388c28['model'],_0x388c28[_0xcaee('0x3d')]);_0x430109[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x388c28[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0x39ab59['query'][_0xcaee('0xcb')]));_0x430109[_0xcaee('0x41')]=_0x430109[_0xcaee('0x41')][_0xcaee('0x45')]?_0x430109[_0xcaee('0x41')]:_0x388c28[_0xcaee('0xc6')];_0x430109['order']=qs['sort'](_0x39ab59[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x430109[_0xcaee('0xcf')]=qs[_0xcaee('0xc9')](_['pick'](_0x39ab59[_0xcaee('0x3d')],_0x388c28[_0xcaee('0xc9')]));if(_0x39ab59[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x430109[_0xcaee('0xcf')]=_['merge'](_0x430109[_0xcaee('0xcf')],{'$or':_['map'](_0x430109[_0xcaee('0x41')],function(_0x21957e){var _0xc01e28={};_0xc01e28[_0x21957e]={'$like':'%'+_0x39ab59['query'][_0xcaee('0x37')]+'%'};return _0xc01e28;})});}_0x430109=_[_0xcaee('0x51')]({},_0x430109,_0x39ab59['options']);return _0x2e8eea[_0xcaee('0xd9')](_0x430109);}})[_0xcaee('0x25')](function(_0xdc5340){if(_0xdc5340){_0x2691e3=_0xdc5340[_0xcaee('0x45')];if(!_0x39ab59[_0xcaee('0x3d')]['hasOwnProperty'](_0xcaee('0xd2'))){_0x430109['limit']=qs[_0xcaee('0x19')](_0x39ab59['query'][_0xcaee('0x19')]);_0x430109[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0x39ab59[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0x2e8eea[_0xcaee('0xd9')](_0x430109);}})['then'](function(_0x15be79){if(_0x15be79){return _0x15be79?{'count':_0x2691e3,'rows':_0x15be79}:null;}})[_0xcaee('0x25')](respondWithResult(_0x4836de,null))[_0xcaee('0x4d')](handleError(_0x4836de,null));};exports[_0xcaee('0xdb')]=function(_0x572538,_0x417629){var _0x818d26={'raw':!![],'where':{}};var _0x40e727={};var _0x44dd7b={'count':0x0,'rows':[]};return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x572538[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x417629,null))[_0xcaee('0x25')](function(_0x5e13b1){if(_0x5e13b1){_0x40e727['model']=_[_0xcaee('0xc7')](db[_0xcaee('0xdc')][_0xcaee('0x33')]);_0x40e727[_0xcaee('0x3d')]=_[_0xcaee('0xc7')](_0x572538[_0xcaee('0x3d')]);_0x40e727[_0xcaee('0xc9')]=_['intersection'](_0x40e727[_0xcaee('0xc6')],_0x40e727[_0xcaee('0x3d')]);_0x818d26[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x40e727['model'],qs[_0xcaee('0xcb')](_0x572538[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x818d26[_0xcaee('0x41')]=_0x818d26[_0xcaee('0x41')][_0xcaee('0x45')]?_0x818d26[_0xcaee('0x41')]:_0x40e727[_0xcaee('0xc6')];if(!_0x572538['query']['hasOwnProperty'](_0xcaee('0xd2'))){_0x818d26[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x572538[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x818d26['offset']=qs[_0xcaee('0x18')](_0x572538[_0xcaee('0x3d')][_0xcaee('0x18')]);}_0x818d26[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x572538['query'][_0xcaee('0xcd')]);_0x818d26[_0xcaee('0xcf')]=qs[_0xcaee('0xc9')](_[_0xcaee('0xce')](_0x572538[_0xcaee('0x3d')],_0x40e727[_0xcaee('0xc9')]));_0x818d26[_0xcaee('0xcf')][_0xcaee('0xd5')]=_0x5e13b1['id'];if(_0x572538[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x818d26['where']=_[_0xcaee('0x51')](_0x818d26[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x818d26['attributes'],function(_0x4c27e3){var _0x427f8e={};_0x427f8e[_0x4c27e3]={'$like':'%'+_0x572538['query'][_0xcaee('0x37')]+'%'};return _0x427f8e;})});}_0x818d26=_[_0xcaee('0x51')]({},_0x818d26,_0x572538[_0xcaee('0x52')]);return db[_0xcaee('0xdc')][_0xcaee('0x1b')]({'where':_0x818d26[_0xcaee('0xcf')]})[_0xcaee('0x25')](function(_0x5783e){_0x44dd7b['count']=_0x5783e;if(_0x572538['query'][_0xcaee('0x4f')]){_0x818d26['include']=[{'all':!![]}];}return db[_0xcaee('0xdc')][_0xcaee('0x43')](_0x818d26);})[_0xcaee('0x25')](function(_0x8eb18d){_0x44dd7b[_0xcaee('0x44')]=_0x8eb18d;return _0x44dd7b;});}})[_0xcaee('0x25')](respondWithFilteredResult(_0x417629,_0x818d26))[_0xcaee('0x4d')](handleError(_0x417629,null));};exports[_0xcaee('0xdd')]=function(_0x4529ce,_0x5124af){var _0x343590={};var _0x5bd51b={};var _0x18d1c3;var _0x357505;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x4529ce[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x5124af,null))[_0xcaee('0x25')](function(_0x3443a2){if(_0x3443a2){_0x18d1c3=_0x3443a2;_0x5bd51b[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db[_0xcaee('0xde')]['rawAttributes']);_0x5bd51b['query']=_[_0xcaee('0xc7')](_0x4529ce[_0xcaee('0x3d')]);_0x5bd51b[_0xcaee('0xc9')]=_['intersection'](_0x5bd51b[_0xcaee('0xc6')],_0x5bd51b[_0xcaee('0x3d')]);_0x343590[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x5bd51b[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0x4529ce['query']['fields']));_0x343590[_0xcaee('0x41')]=_0x343590[_0xcaee('0x41')][_0xcaee('0x45')]?_0x343590[_0xcaee('0x41')]:_0x5bd51b[_0xcaee('0xc6')];_0x343590[_0xcaee('0xcc')]=qs['sort'](_0x4529ce[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x343590['where']=qs[_0xcaee('0xc9')](_[_0xcaee('0xce')](_0x4529ce[_0xcaee('0x3d')],_0x5bd51b[_0xcaee('0xc9')]));if(_0x4529ce[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x343590[_0xcaee('0xcf')]=_[_0xcaee('0x51')](_0x343590[_0xcaee('0xcf')],{'$or':_['map'](_0x343590[_0xcaee('0x41')],function(_0x28f805){var _0x3fe2ba={};_0x3fe2ba[_0x28f805]={'$like':'%'+_0x4529ce[_0xcaee('0x3d')][_0xcaee('0x37')]+'%'};return _0x3fe2ba;})});}_0x343590=_[_0xcaee('0x51')]({},_0x343590,_0x4529ce[_0xcaee('0x52')]);return _0x18d1c3[_0xcaee('0xdd')](_0x343590);}})[_0xcaee('0x25')](function(_0x4569ce){if(_0x4569ce){_0x357505=_0x4569ce['length'];if(!_0x4529ce[_0xcaee('0x3d')][_0xcaee('0xc0')](_0xcaee('0xd2'))){_0x343590[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x4529ce[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x343590[_0xcaee('0x18')]=qs['offset'](_0x4529ce['query'][_0xcaee('0x18')]);}return _0x18d1c3[_0xcaee('0xdd')](_0x343590);}})['then'](function(_0x1c2994){if(_0x1c2994){return _0x1c2994?{'count':_0x357505,'rows':_0x1c2994}:null;}})[_0xcaee('0x25')](respondWithResult(_0x5124af,null))[_0xcaee('0x4d')](handleError(_0x5124af,null));};exports[_0xcaee('0xdf')]=function(_0x550361,_0x7b9bc6){var _0x3aed2e={};var _0x1a0c20={};var _0x11495b;var _0x5ec1e2;return db['User'][_0xcaee('0x8e')]({'where':{'id':_0x550361['params']['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x7b9bc6,null))[_0xcaee('0x25')](function(_0x97caff){if(_0x97caff){_0x11495b=_0x97caff;_0x1a0c20[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db['FaxInteraction'][_0xcaee('0x33')]);_0x1a0c20['query']=_[_0xcaee('0xc7')](_0x550361['query']);_0x1a0c20['filters']=_[_0xcaee('0xca')](_0x1a0c20[_0xcaee('0xc6')],_0x1a0c20[_0xcaee('0x3d')]);_0x3aed2e[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x1a0c20['model'],qs[_0xcaee('0xcb')](_0x550361[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x3aed2e[_0xcaee('0x41')]=_0x3aed2e[_0xcaee('0x41')][_0xcaee('0x45')]?_0x3aed2e[_0xcaee('0x41')]:_0x1a0c20[_0xcaee('0xc6')];_0x3aed2e['order']=qs['sort'](_0x550361['query'][_0xcaee('0xcd')]);_0x3aed2e[_0xcaee('0xcf')]=qs['filters'](_[_0xcaee('0xce')](_0x550361['query'],_0x1a0c20['filters']));if(_0x550361[_0xcaee('0x3d')]['filter']){_0x3aed2e[_0xcaee('0xcf')]=_['merge'](_0x3aed2e[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x3aed2e[_0xcaee('0x41')],function(_0x140430){var _0x4f2131={};_0x4f2131[_0x140430]={'$like':'%'+_0x550361[_0xcaee('0x3d')][_0xcaee('0x37')]+'%'};return _0x4f2131;})});}_0x3aed2e=_['merge']({},_0x3aed2e,_0x550361[_0xcaee('0x52')]);return _0x11495b[_0xcaee('0xdf')](_0x3aed2e);}})[_0xcaee('0x25')](function(_0x51f7eb){if(_0x51f7eb){_0x5ec1e2=_0x51f7eb[_0xcaee('0x45')];if(!_0x550361[_0xcaee('0x3d')][_0xcaee('0xc0')](_0xcaee('0xd2'))){_0x3aed2e['limit']=qs[_0xcaee('0x19')](_0x550361['query'][_0xcaee('0x19')]);_0x3aed2e[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0x550361[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0x11495b[_0xcaee('0xdf')](_0x3aed2e);}})[_0xcaee('0x25')](function(_0x269612){if(_0x269612){return _0x269612?{'count':_0x5ec1e2,'rows':_0x269612}:null;}})[_0xcaee('0x25')](respondWithResult(_0x7b9bc6,null))[_0xcaee('0x4d')](handleError(_0x7b9bc6,null));};exports[_0xcaee('0xe0')]=function(_0x8c89a,_0x15ea45){var _0x2c2228={};var _0x5a7fe7={};var _0x574c53;var _0x3d50ab;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x8c89a[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x15ea45,null))[_0xcaee('0x25')](function(_0x3e2dd8){if(_0x3e2dd8){_0x574c53=_0x3e2dd8;_0x5a7fe7['model']=_[_0xcaee('0xc7')](db['WhatsappInteraction']['rawAttributes']);_0x5a7fe7['query']=_[_0xcaee('0xc7')](_0x8c89a[_0xcaee('0x3d')]);_0x5a7fe7[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x5a7fe7['model'],_0x5a7fe7['query']);_0x2c2228[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x5a7fe7['model'],qs['fields'](_0x8c89a['query']['fields']));_0x2c2228[_0xcaee('0x41')]=_0x2c2228[_0xcaee('0x41')]['length']?_0x2c2228[_0xcaee('0x41')]:_0x5a7fe7[_0xcaee('0xc6')];_0x2c2228[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x8c89a[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x2c2228[_0xcaee('0xcf')]=qs['filters'](_[_0xcaee('0xce')](_0x8c89a[_0xcaee('0x3d')],_0x5a7fe7[_0xcaee('0xc9')]));if(_0x8c89a[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x2c2228[_0xcaee('0xcf')]=_[_0xcaee('0x51')](_0x2c2228[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x2c2228[_0xcaee('0x41')],function(_0x116752){var _0xb1c41={};_0xb1c41[_0x116752]={'$like':'%'+_0x8c89a['query']['filter']+'%'};return _0xb1c41;})});}_0x2c2228=_['merge']({},_0x2c2228,_0x8c89a[_0xcaee('0x52')]);return _0x574c53[_0xcaee('0xe0')](_0x2c2228);}})['then'](function(_0x5d9084){if(_0x5d9084){_0x3d50ab=_0x5d9084[_0xcaee('0x45')];if(!_0x8c89a[_0xcaee('0x3d')][_0xcaee('0xc0')]('nolimit')){_0x2c2228[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x8c89a[_0xcaee('0x3d')]['limit']);_0x2c2228[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0x8c89a[_0xcaee('0x3d')]['offset']);}return _0x574c53[_0xcaee('0xe0')](_0x2c2228);}})[_0xcaee('0x25')](function(_0x860f76){if(_0x860f76){return _0x860f76?{'count':_0x3d50ab,'rows':_0x860f76}:null;}})[_0xcaee('0x25')](respondWithResult(_0x15ea45,null))[_0xcaee('0x4d')](handleError(_0x15ea45,null));};exports[_0xcaee('0xe1')]=function(_0x508629,_0x294300,_0x3b4ea7){var _0xf751f2;var _0x2fc0ba;var _0x49a944;var _0x2cf14b=!_[_0xcaee('0x5e')](_0x508629[_0xcaee('0x56')]['id'])?_0x508629[_0xcaee('0x56')]['id']:!_['isNil'](_0x508629[_0xcaee('0x28')]['id'])?_0x508629[_0xcaee('0x28')]['id']:null;return db[_0xcaee('0x32')][_0xcaee('0x2d')]({'where':{'id':_0x2cf14b,'role':{'$or':['admin',_0xcaee('0x28'),'agent']}},'attributes':['id',_0xcaee('0x31'),_0xcaee('0xe2'),_0xcaee('0xe3'),_0xcaee('0x20'),'internal','loginInPause']})[_0xcaee('0x25')](function(_0x2338a7){if(_0x2338a7){if(_0x2338a7[_0xcaee('0x20')]==='agent'){_0xf751f2=_0x2338a7;if(_0x508629[_0xcaee('0x54')][_0xcaee('0x98')]){_0x49a944=util['format'](_0xcaee('0xe4'),_0xf751f2[_0x508629[_0xcaee('0x54')][_0xcaee('0x98')]]);}else if(_0x508629['body'][_0xcaee('0xe5')]){_0x49a944=util[_0xcaee('0xa3')](_0xcaee('0xa4'),_0x508629[_0xcaee('0x54')][_0xcaee('0xe5')]);}else{_0x49a944=util[_0xcaee('0xa3')]('SIP/%s',_0xf751f2[_0xcaee('0x31')]);}socket['to'](util['format'](_0xcaee('0xe6'),_0xf751f2['name']))[_0xcaee('0x22')](_0xcaee('0xe7'),{'user':{'id':_0xf751f2['id'],'name':_0xf751f2[_0xcaee('0x31')]},'ip':_0x508629[_0xcaee('0xe8')][_0xcaee('0xe9')]||_0x508629[_0xcaee('0xea')][_0xcaee('0xeb')]||_0x508629[_0xcaee('0xec')]['remoteAddress']||_0x508629[_0xcaee('0xea')]['socket'][_0xcaee('0xeb')]});return db[_0xcaee('0xa5')][_0xcaee('0x24')]({'where':{'membername':_0xf751f2[_0xcaee('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0xcaee('0x89'))]['ValidationError'](_0xcaee('0xed'));}})[_0xcaee('0x25')](function(){if(_0xf751f2){return _0xf751f2[_0xcaee('0xee')]({'raw':!![]});}})[_0xcaee('0x25')](function(_0x408a7c){if(_0xf751f2){if(_0x408a7c){_0x2fc0ba=_0x408a7c;if(_0x2fc0ba[_0xcaee('0x45')]){var _0x3e29d4=_0x2fc0ba[_0xcaee('0x34')](function(_0x1bee01){var _0x5e240d={'membername':_0xf751f2[_0xcaee('0x31')],'UserId':_0xf751f2['id'],'queue_name':_0x1bee01[_0xcaee('0x31')],'VoiceQueueId':_0x1bee01['id'],'interface':_0x49a944,'paused':_0xf751f2[_0xcaee('0x96')]||![],'penalty':_0x1bee01[_0xcaee('0xef')]||0x0};return db[_0xcaee('0xa5')][_0xcaee('0xf0')](_0x5e240d);});return Promise[_0xcaee('0x84')](_0x3e29d4);}}}})[_0xcaee('0x25')](function(){if(_0xf751f2){return db[_0xcaee('0xf1')]['findAll']({'where':{'membername':_0xf751f2[_0xcaee('0x31')],'exitAt':null}});}})['then'](function(_0x316420){if(_0xf751f2){var _0x469bce=[];_0x316420['forEach'](function(_0x4f66e1){_0x469bce['push'](_0x4f66e1[_0xcaee('0x1f')]({'exitAt':moment()[_0xcaee('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xcaee('0x84')](_0x469bce);}})['then'](function(){if(_0xf751f2){var _0x37aa98=[];var _0x1a2c09=[];var _0x12da41=utils['getChannels']();var _0x1532cd={'membername':_0xf751f2[_0xcaee('0x31')],'interface':_0x49a944,'enterAt':moment()[_0xcaee('0xa3')](_0xcaee('0xf2')),'role':_0xf751f2['role'],'internal':_0xf751f2[_0xcaee('0x59')]};_0x12da41['forEach'](function(_0xeb25b9){_0x37aa98[_0xcaee('0x42')](_[_0xcaee('0x51')]({'channel':_0xeb25b9,'type':_0xcaee('0xf3'),'data1':_0x508629['body'][_0xcaee('0xf4')],'data2':_0x49a944},_0x1532cd));if(_0xf751f2['loginInPause']){_0x1a2c09[_0xcaee('0x42')](_[_0xcaee('0x51')]({'channel':_0xeb25b9,'type':_0xcaee('0xf5'),'data1':_0xcaee('0xf6')},_0x1532cd));}});return db[_0xcaee('0xf1')]['bulkCreate'](_0x37aa98[_0xcaee('0xbe')](_0x1a2c09),{'individualHooks':!![]});}})['then'](function(){if(_0xf751f2){return _0xf751f2['update']({'online':!![],'lastLoginAt':moment()[_0xcaee('0xa3')](_0xcaee('0xf2')),'voicePause':_0xf751f2[_0xcaee('0x96')]||![],'mailPause':_0xf751f2['loginInPause']||![],'chatPause':_0xf751f2[_0xcaee('0x96')]||![],'faxPause':_0xf751f2[_0xcaee('0x96')]||![],'smsPause':_0xf751f2[_0xcaee('0x96')]||![],'openchannelPause':_0xf751f2[_0xcaee('0x96')]||![],'whatsappPause':_0xf751f2[_0xcaee('0x96')]||![],'pauseType':_0xf751f2[_0xcaee('0x96')]?_0xcaee('0xf6'):null,'interface':_0x49a944,'lastPauseAt':moment()[_0xcaee('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x3dbaf3){if(_0x508629[_0xcaee('0xf7')]){return _0x3b4ea7();}else{return Promise[_0xcaee('0xf8')](_0x3dbaf3)[_0xcaee('0x25')](respondWithResult(_0x294300,null));}})[_0xcaee('0x4d')](handleError(_0x294300,null));};exports[_0xcaee('0xf9')]=function(_0x3805fb,_0x104b04){var _0x24c5f7;return db[_0xcaee('0x32')][_0xcaee('0x2d')]({'where':{'id':_0x3805fb[_0xcaee('0x56')]['id'],'role':_0xcaee('0x21')},'attributes':['id',_0xcaee('0x31'),'role']})[_0xcaee('0x25')](handleEntityNotFound(_0x104b04,null))[_0xcaee('0x25')](function(_0x496967){if(_0x496967){_0x24c5f7=_0x496967;return db[_0xcaee('0xa5')][_0xcaee('0x24')]({'where':{'membername':_0x24c5f7[_0xcaee('0x31')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0xcaee('0x43')]({'where':{'membername':_0x24c5f7[_0xcaee('0x31')],'exitAt':null}});})['then'](function(_0xf3afa4){var _0x5bc86c=[];_0xf3afa4[_0xcaee('0xfa')](function(_0x2d0d2b){_0x5bc86c['push'](_0x2d0d2b[_0xcaee('0x1f')]({'exitAt':moment()[_0xcaee('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xcaee('0x84')](_0x5bc86c);})[_0xcaee('0x25')](function(){return _0x24c5f7['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xcaee('0x25')](respondWithResult(_0x104b04,null))[_0xcaee('0x4d')](handleError(_0x104b04,null));};exports[_0xcaee('0xfb')]=function(_0x55f16a,_0x5dc74f){var _0x49eb30;return db[_0xcaee('0xa5')][_0xcaee('0x1f')]({'paused':0x1},{'where':{'UserId':_0x55f16a[_0xcaee('0x56')]['id']},'individualHooks':!![]})[_0xcaee('0x25')](function(){return db[_0xcaee('0x32')]['find']({'where':{'id':_0x55f16a['params']['id'],'role':_0xcaee('0x21')},'attributes':['id',_0xcaee('0x31'),_0xcaee('0x20'),'internal',_0xcaee('0x98'),_0xcaee('0x95')]});})[_0xcaee('0x25')](handleEntityNotFound(_0x5dc74f,null))[_0xcaee('0x25')](function(_0x40d113){if(_0x40d113){_0x49eb30=_0x40d113;return db[_0xcaee('0xf1')][_0xcaee('0x43')]({'where':{'membername':_0x49eb30[_0xcaee('0x31')],'type':_0xcaee('0xf5'),'exitAt':null}});}})['then'](function(_0x123837){if(_0x123837['length']){var _0x3792fb=moment()[_0xcaee('0xa3')](_0xcaee('0xf2'));for(var _0x20fe4e=0x0,_0x46e2c0=_0x123837[_0xcaee('0x45')];_0x20fe4e<_0x46e2c0;_0x20fe4e++){_0x123837[_0x20fe4e][_0xcaee('0xfc')]({'exitAt':_0x3792fb});}}})[_0xcaee('0x25')](function(){var _0x161782=[];var _0x1c6321=utils[_0xcaee('0xfd')]();_0x1c6321[_0xcaee('0xfa')](function(_0x94f87e){_0x161782['push']({'channel':_0x94f87e,'membername':_0x49eb30[_0xcaee('0x31')],'interface':_[_0xcaee('0x5e')](_0x49eb30[_0xcaee('0x98')])?util[_0xcaee('0xa3')](_0xcaee('0xa4'),_0x49eb30[_0xcaee('0x31')]):_0x49eb30[_0xcaee('0x98')],'type':'PAUSE','enterAt':moment()['format'](_0xcaee('0xf2')),'data1':_0x55f16a[_0xcaee('0x54')][_0xcaee('0x36')]||_0xcaee('0xfe'),'role':_0x49eb30[_0xcaee('0x20')],'internal':_0x49eb30[_0xcaee('0x59')]});});return db[_0xcaee('0xf1')][_0xcaee('0x81')](_0x161782,{'individualHooks':!![]});})['then'](function(){return _0x49eb30[_0xcaee('0x1f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x55f16a['body'][_0xcaee('0x36')]||_0xcaee('0xfe'),'lastPauseAt':moment()[_0xcaee('0xa3')](_0xcaee('0xf2'))});})[_0xcaee('0x25')](respondWithResult(_0x5dc74f,null))[_0xcaee('0x4d')](handleError(_0x5dc74f,null));};exports[_0xcaee('0xff')]=function(_0x2bc514,_0x30113e){if(_0x2bc514['body'][_0xcaee('0xa6')]&&!utils[_0xcaee('0x99')](_0x2bc514[_0xcaee('0x54')]['channel'])){throw new APIBadRequestError(util[_0xcaee('0xa3')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2bc514[_0xcaee('0x54')][_0xcaee('0xa6')]));}return db['User'][_0xcaee('0x2d')]({'where':{'id':_0x2bc514[_0xcaee('0x56')]['id']},'attributes':['id',_0xcaee('0x31'),_0xcaee('0x20'),_0xcaee('0x59'),'interface',_0xcaee('0x95'),_0xcaee('0x97'),_0xcaee('0x100'),_0xcaee('0x101'),'faxPause',_0xcaee('0x102'),'smsPause',_0xcaee('0x103'),_0xcaee('0x104'),'lastPauseAt']})[_0xcaee('0x25')](function(_0x303def){if(!_0x303def){throw new APINotFoundError(util['format'](_0xcaee('0x105'),_0x2bc514[_0xcaee('0x56')]['id']));}return _0x303def[_0xcaee('0xff')](_0x2bc514[_0xcaee('0x54')][_0xcaee('0xa6')]);})[_0xcaee('0x25')](respondWithResult(_0x30113e,null))[_0xcaee('0x4d')](APIHandleError(_0x30113e));};exports['getTeams']=function(_0xc2c53a,_0x1dc396){var _0x145564={};var _0x75a342={};var _0x565021;var _0x3ff204;return db['User'][_0xcaee('0x8e')]({'where':{'id':_0xc2c53a[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x1dc396,null))[_0xcaee('0x25')](function(_0xca4dd8){if(_0xca4dd8){_0x565021=_0xca4dd8;_0x75a342[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db[_0xcaee('0x106')][_0xcaee('0x33')]);_0x75a342[_0xcaee('0x3d')]=_[_0xcaee('0xc7')](_0xc2c53a['query']);_0x75a342[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x75a342[_0xcaee('0xc6')],_0x75a342[_0xcaee('0x3d')]);_0x145564['attributes']=_[_0xcaee('0xca')](_0x75a342[_0xcaee('0xc6')],qs[_0xcaee('0xcb')](_0xc2c53a[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x145564['attributes']=_0x145564[_0xcaee('0x41')]['length']?_0x145564[_0xcaee('0x41')]:_0x75a342['model'];_0x145564['order']=qs[_0xcaee('0xcd')](_0xc2c53a[_0xcaee('0x3d')][_0xcaee('0xcd')]);_0x145564[_0xcaee('0xcf')]=qs[_0xcaee('0xc9')](_[_0xcaee('0xce')](_0xc2c53a[_0xcaee('0x3d')],_0x75a342[_0xcaee('0xc9')]));if(_0xc2c53a[_0xcaee('0x3d')]['filter']){_0x145564['where']=_[_0xcaee('0x51')](_0x145564['where'],{'$or':_[_0xcaee('0x34')](_0x145564[_0xcaee('0x41')],function(_0x3a6ed5){var _0xa0ddc7={};_0xa0ddc7[_0x3a6ed5]={'$like':'%'+_0xc2c53a[_0xcaee('0x3d')][_0xcaee('0x37')]+'%'};return _0xa0ddc7;})});}_0x145564=_[_0xcaee('0x51')]({},_0x145564,_0xc2c53a[_0xcaee('0x52')]);return _0x565021[_0xcaee('0x107')](_0x145564);}})['then'](function(_0x2fab38){if(_0x2fab38){_0x3ff204=_0x2fab38['length'];if(!_0xc2c53a[_0xcaee('0x3d')][_0xcaee('0xc0')]('nolimit')){_0x145564[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0xc2c53a[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x145564[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0xc2c53a[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0x565021[_0xcaee('0x107')](_0x145564);}})['then'](function(_0x302fcd){if(_0x302fcd){return _0x302fcd?{'count':_0x3ff204,'rows':_0x302fcd}:null;}})[_0xcaee('0x25')](respondWithResult(_0x1dc396,null))[_0xcaee('0x4d')](handleError(_0x1dc396,null));};exports['addTeams']=function(_0x73e7af,_0xd2b6ad){var _0xf17fce=_0x73e7af[_0xcaee('0x56')]['id'];var _0x1ec18f=_0x73e7af[_0xcaee('0x54')]?_0x73e7af['body'][_0xcaee('0x57')]:null;var _0x3598be=[];return Promise[_0xcaee('0xf8')]()[_0xcaee('0x25')](function(){if(!_0x1ec18f)throw new APIBadRequestError(_0xcaee('0x108'));})[_0xcaee('0x25')](function(){return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0xf17fce}});})['then'](function(_0x1dd907){if(!_0x1dd907)throw new APINotFoundError(util[_0xcaee('0xa3')](_0xcaee('0x105'),_0x73e7af[_0xcaee('0x56')]['id']));return db[_0xcaee('0x60')][_0xcaee('0x109')](function(_0x4e8433){return _0x1dd907['addTeams'](_0x1ec18f,{'transaction':_0x4e8433})[_0xcaee('0x25')](function(){return db['Team'][_0xcaee('0x43')]({'where':{'id':{'$in':_0x1ec18f}}});})['then'](function(_0x3e970e){var _0x5a8c9b=_[_0xcaee('0x34')](_0x3e970e,function(_0x40e3ac){return _0x40e3ac['getAssociatedQueues']();});return Promise[_0xcaee('0x84')](_0x5a8c9b);})[_0xcaee('0x25')](function(_0x497dd6){_0x3598be=_[_0xcaee('0x10a')](_0x497dd6);var _0x462598=_[_0xcaee('0x34')](_0x3598be,function(_0x312fb5){return _0x312fb5[_0xcaee('0x10b')](_0x1dd907['id'],{'transaction':_0x4e8433});});return Promise['all'](_0x462598);})[_0xcaee('0x25')](function(){if(!_0x1dd907[_0xcaee('0x95')])return;var _0x4f142f=_[_0xcaee('0x37')](_0x3598be,function(_0x2d45ae){return _0x2d45ae[_0xcaee('0x10c')](_0xcaee('0xa6'))==='Voice';});var _0x58323f=_[_0xcaee('0x34')](_0x4f142f,function(_0x1deb2d){return db[_0xcaee('0xa5')][_0xcaee('0xf0')]({'membername':_0x1dd907[_0xcaee('0x31')],'UserId':_0x1dd907['id'],'queue_name':_0x1deb2d[_0xcaee('0x31')],'VoiceQueueId':_0x1deb2d['id'],'interface':_[_0xcaee('0x5e')](_0x1dd907[_0xcaee('0x98')])?util[_0xcaee('0xa3')](_0xcaee('0xa4'),_0x1dd907['name']):_0x1dd907[_0xcaee('0x98')],'paused':_0x1dd907[_0xcaee('0x97')]||![],'penalty':_0x1dd907[_0xcaee('0x9e')]},{'transaction':_0x4e8433});});return Promise[_0xcaee('0x84')](_0x58323f);})[_0xcaee('0x25')](function(){return db[_0xcaee('0x10d')]['findAll']({'where':{'teamId':{'$in':_0x1ec18f}}});})['then'](function(_0x54bad8){var _0x23dd5a=_[_0xcaee('0x34')](_0x54bad8,function(_0x18286){return db['UserVoicePrefix'][_0xcaee('0x75')]({'UserId':_0x1dd907['id'],'VoicePrefixId':_0x18286['VoicePrefixId']},{'transaction':_0x4e8433});});return Promise[_0xcaee('0x84')](_0x23dd5a);});});})[_0xcaee('0x25')](function(){for(var _0x30093e=0x0;_0x30093e<_0x3598be['length'];_0x30093e++){var _0x485263=_0x3598be[_0x30093e][_0xcaee('0x10c')]('channel');var _0x3849b2=_0x485263+_0xcaee('0xa1');socket[_0xcaee('0x22')](_0xcaee('0x28')+_0x485263+_0xcaee('0x10e'),{'UserId':_0xf17fce,['queueField']:_0x3598be[_0x30093e]['id']});}})[_0xcaee('0x25')](respondWithStatusCode(_0xd2b6ad,null))['catch'](APIHandleError(_0xd2b6ad));};exports[_0xcaee('0x10f')]=function(_0x2d015e,_0x3a94ee){var _0x309c3d=_0x2d015e[_0xcaee('0x56')]['id'];var _0x48579f=null;if(_0x2d015e[_0xcaee('0x3d')][_0xcaee('0x57')]){_0x48579f=_[_0xcaee('0xa7')](_0x2d015e[_0xcaee('0x3d')][_0xcaee('0x57')])?_0x2d015e[_0xcaee('0x3d')][_0xcaee('0x57')]:[_0x2d015e[_0xcaee('0x3d')][_0xcaee('0x57')]];}var _0x5a9757=[];return Promise[_0xcaee('0xf8')]()[_0xcaee('0x25')](function(){if(!_0x48579f)throw new APIBadRequestError(_0xcaee('0x110'));})[_0xcaee('0x25')](function(){return db['User'][_0xcaee('0x8e')]({'where':{'id':_0x309c3d}});})['then'](function(_0x4723c7){if(!_0x4723c7)throw new APINotFoundError(util[_0xcaee('0xa3')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2d015e[_0xcaee('0x56')]['id']));return db[_0xcaee('0x60')][_0xcaee('0x109')](function(_0x174b9e){return _0x4723c7[_0xcaee('0x10f')](_0x48579f,{'transaction':_0x174b9e})['then'](function(){return db['Team'][_0xcaee('0x43')]({'where':{'id':{'$in':_0x48579f}}});})[_0xcaee('0x25')](function(_0x2a4259){var _0x3e3559=_[_0xcaee('0x34')](_0x2a4259,function(_0x28e060){return _0x28e060[_0xcaee('0x111')]();});return Promise[_0xcaee('0x84')](_0x3e3559);})[_0xcaee('0x25')](function(_0x43effc){_0x5a9757=_['flattenDeep'](_0x43effc);var _0x248f37=_[_0xcaee('0x34')](_0x5a9757,function(_0x5d9bb9){return _0x5d9bb9[_0xcaee('0x112')](_0x4723c7['id'],{'transaction':_0x174b9e});});return Promise[_0xcaee('0x84')](_0x248f37);})['then'](function(){if(!_0x4723c7['online'])return;var _0x4584b4=_[_0xcaee('0x37')](_0x5a9757,function(_0x598cb9){return _0x598cb9[_0xcaee('0x10c')](_0xcaee('0xa6'))===_0xcaee('0x113');});var _0x2c90b6=_['map'](_0x4584b4,function(_0x3da92c){return db[_0xcaee('0xa5')][_0xcaee('0x24')]({'where':{'VoiceQueueId':_0x3da92c['id'],'UserId':_0x4723c7['id']},'transaction':_0x174b9e});});return Promise[_0xcaee('0x84')](_0x2c90b6);})[_0xcaee('0x25')](function(){return db[_0xcaee('0x10d')][_0xcaee('0x43')]({'where':{'teamId':{'$in':_0x48579f}}});})[_0xcaee('0x25')](function(_0x4f8dfa){var _0x23166b=_[_0xcaee('0x34')](_0x4f8dfa,function(_0x5d5da8){return db[_0xcaee('0x114')][_0xcaee('0x24')]({'where':{'UserId':_0x4723c7['id'],'VoicePrefixId':_0x5d5da8['VoicePrefixId']}},{'transaction':_0x174b9e});});return Promise[_0xcaee('0x84')](_0x23166b);});});})[_0xcaee('0x25')](function(){for(var _0x458e8f=0x0;_0x458e8f<_0x5a9757['length'];_0x458e8f++){var _0x51ad6c=_0x5a9757[_0x458e8f][_0xcaee('0x10c')](_0xcaee('0xa6'));var _0x521045=_0x51ad6c+_0xcaee('0xa1');socket[_0xcaee('0x22')](_0xcaee('0x28')+_0x51ad6c+_0xcaee('0x115'),{'UserId':_0x309c3d,['queueField']:_0x5a9757[_0x458e8f]['id']});}})[_0xcaee('0x25')](respondWithStatusCode(_0x3a94ee,null))['catch'](APIHandleError(_0x3a94ee));};exports['getLists']=function(_0x1f6601,_0x44b285){var _0x50be8b={};var _0x2e1da6={};var _0xe7042e;var _0xc0c193;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x1f6601[_0xcaee('0x56')]['id']}})['then'](handleEntityNotFound(_0x44b285,null))[_0xcaee('0x25')](function(_0x5cadc0){if(_0x5cadc0){_0xe7042e=_0x5cadc0;_0x2e1da6[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db[_0xcaee('0x116')]['rawAttributes']);_0x2e1da6['query']=_[_0xcaee('0xc7')](_0x1f6601[_0xcaee('0x3d')]);_0x2e1da6[_0xcaee('0xc9')]=_['intersection'](_0x2e1da6['model'],_0x2e1da6['query']);_0x50be8b[_0xcaee('0x41')]=_[_0xcaee('0xca')](_0x2e1da6['model'],qs[_0xcaee('0xcb')](_0x1f6601[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x50be8b[_0xcaee('0x41')]=_0x50be8b['attributes'][_0xcaee('0x45')]?_0x50be8b['attributes']:_0x2e1da6[_0xcaee('0xc6')];_0x50be8b['order']=qs[_0xcaee('0xcd')](_0x1f6601[_0xcaee('0x3d')]['sort']);_0x50be8b[_0xcaee('0xcf')]=qs['filters'](_[_0xcaee('0xce')](_0x1f6601['query'],_0x2e1da6[_0xcaee('0xc9')]));if(_0x1f6601[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x50be8b['where']=_['merge'](_0x50be8b['where'],{'$or':_['map'](_0x50be8b['attributes'],function(_0x32ba24){var _0x5a00e8={};_0x5a00e8[_0x32ba24]={'$like':'%'+_0x1f6601['query'][_0xcaee('0x37')]+'%'};return _0x5a00e8;})});}_0x50be8b=_[_0xcaee('0x51')]({},_0x50be8b,_0x1f6601[_0xcaee('0x52')]);return _0xe7042e['getLists'](_0x50be8b);}})[_0xcaee('0x25')](function(_0x5280b2){if(_0x5280b2){_0xc0c193=_0x5280b2[_0xcaee('0x45')];if(!_0x1f6601[_0xcaee('0x3d')][_0xcaee('0xc0')](_0xcaee('0xd2'))){_0x50be8b[_0xcaee('0x19')]=qs[_0xcaee('0x19')](_0x1f6601[_0xcaee('0x3d')][_0xcaee('0x19')]);_0x50be8b[_0xcaee('0x18')]=qs[_0xcaee('0x18')](_0x1f6601[_0xcaee('0x3d')][_0xcaee('0x18')]);}return _0xe7042e[_0xcaee('0x117')](_0x50be8b);}})[_0xcaee('0x25')](function(_0x32ac92){if(_0x32ac92){return _0x32ac92?{'count':_0xc0c193,'rows':_0x32ac92}:null;}})[_0xcaee('0x25')](respondWithResult(_0x44b285,null))[_0xcaee('0x4d')](handleError(_0x44b285,null));};exports['getAgents']=function(_0x3f0c37,_0x326a25){var _0x38fecf={};var _0x4e7227={};var _0x88cd7e;return db[_0xcaee('0x32')][_0xcaee('0x8e')]({'where':{'id':_0x3f0c37[_0xcaee('0x56')]['id']}})[_0xcaee('0x25')](handleEntityNotFound(_0x326a25,null))[_0xcaee('0x25')](function(_0x39c0c6){if(_0x39c0c6){_0x88cd7e=_0x39c0c6;_0x4e7227[_0xcaee('0xc6')]=_[_0xcaee('0xc7')](db[_0xcaee('0x32')][_0xcaee('0x33')]);_0x4e7227[_0xcaee('0x3d')]=_[_0xcaee('0xc7')](_0x3f0c37[_0xcaee('0x3d')]);_0x4e7227[_0xcaee('0xc9')]=_[_0xcaee('0xca')](_0x4e7227[_0xcaee('0xc6')],_0x4e7227[_0xcaee('0x3d')]);_0x38fecf['attributes']=_['intersection'](_0x4e7227[_0xcaee('0xc6')],qs['fields'](_0x3f0c37[_0xcaee('0x3d')][_0xcaee('0xcb')]));_0x38fecf[_0xcaee('0x41')]=_0x38fecf['attributes'][_0xcaee('0x45')]?_0x38fecf[_0xcaee('0x41')]:_0x4e7227[_0xcaee('0xc6')];_0x38fecf[_0xcaee('0xcc')]=qs[_0xcaee('0xcd')](_0x3f0c37['query']['sort']);_0x38fecf[_0xcaee('0xcf')]=qs[_0xcaee('0xc9')](_[_0xcaee('0xce')](_0x3f0c37[_0xcaee('0x3d')],_0x4e7227[_0xcaee('0xc9')]));if(_0x3f0c37[_0xcaee('0x3d')][_0xcaee('0x37')]){_0x38fecf['where']=_[_0xcaee('0x51')](_0x38fecf[_0xcaee('0xcf')],{'$or':_[_0xcaee('0x34')](_0x38fecf[_0xcaee('0x41')],function(_0x5cc97c){var _0x1a28f2={};_0x1a28f2[_0x5cc97c]={'$like':'%'+_0x3f0c37['query'][_0xcaee('0x37')]+'%'};return _0x1a28f2;})});}_0x38fecf[_0xcaee('0xc6')]=db[_0xcaee('0x32')];_0x38fecf['as']=_0xcaee('0x7e');_0x38fecf=_[_0xcaee('0x51')]({},_0x38fecf,_0x3f0c37[_0xcaee('0x52')]);return _0x88cd7e[_0xcaee('0xee')]({'include':[_0x38fecf]});}})[_0xcaee('0x25')](function(_0x3b4adb){if(_0x3b4adb){var _0x2397c4={},_0x573814=[];for(var _0x24b3fd=0x0;_0x24b3fd<_0x3b4adb['length'];_0x24b3fd+=0x1){for(var _0x2b1e40=0x0,_0x5176f6;_0x2b1e40<_0x3b4adb[_0x24b3fd][_0xcaee('0x7e')][_0xcaee('0x45')];_0x2b1e40+=0x1){_0x5176f6=_0x3b4adb[_0x24b3fd][_0xcaee('0x7e')][_0x2b1e40][_0xcaee('0x26')]({'plain':!![]});_0x2397c4[_0x5176f6['id']]=_0x5176f6;}}_0x2397c4=_[_0xcaee('0x118')](_0x2397c4);for(var _0x1c3077=qs[_0xcaee('0x18')](_0x3f0c37[_0xcaee('0x3d')][_0xcaee('0x18')]);_0x1c3077<_0x2397c4[_0xcaee('0x45')]&&_0x573814[_0xcaee('0x45')]=_0x299051){_0x472813=_0x299051;_0x24b512=0xc8;}else{_0x24b512=0xce;}_0x53ba44[_0xb0d0('0x14')](_0x24b512);return _0x53ba44['set']('Content-Range',_0x1da087+'-'+_0x472813+'/'+_0x299051)[_0xb0d0('0x16')](_0x25354a);}return null;};}function saveUpdates(_0x4a93fd){return function(_0x3c13d7){if(_0x3c13d7){return _0x3c13d7[_0xb0d0('0x1b')](_0x4a93fd)[_0xb0d0('0x1c')](function(_0x4e7941){if(_0x4e7941[_0xb0d0('0x1d')]==='agent'){socket[_0xb0d0('0x1e')](_0xb0d0('0x1f')+_0x4e7941['id'],_0x4e7941);}return _0x4e7941;});}return null;};}function removeEntity(_0x245cd7,_0x18bf33){return function(_0x58be54){if(_0x58be54){return _0x58be54[_0xb0d0('0x20')]({'transaction':_0x18bf33})[_0xb0d0('0x1c')](function(){var _0x3eb9b0=_0x58be54[_0xb0d0('0x21')]({'plain':!![]});if(_0x3eb9b0['role']===_0xb0d0('0x22'))return;var _0x24e777=[{'name':_0xb0d0('0x23'),'value':_0xb0d0('0x24'),'ignore':!![]},{'name':_0xb0d0('0x25'),'value':_0xb0d0('0x26'),'ignore':![]},{'name':_0xb0d0('0x27'),'value':_0xb0d0('0x28'),'ignore':![]}];var _0x2345b0=_(_0x24e777)[_0xb0d0('0x29')](_0xb0d0('0x2a'))[_0xb0d0('0x2b')](_0xb0d0('0x2c'))[_0xb0d0('0x2c')]();if(_['includes'](_0x2345b0,_0x3eb9b0['role'])){return;}var _0x3ac135=_[_0xb0d0('0x2d')](_0x24e777,[_0xb0d0('0x2c'),_0x3eb9b0['role']])[_0xb0d0('0x2e')];return db[_0xb0d0('0x2f')][_0xb0d0('0x20')]({'where':{'type':_0x3ac135,'resourceId':_0x3eb9b0['id']},'transaction':_0x18bf33})[_0xb0d0('0x1c')](function(){return _0x58be54;});})['then'](function(){_0x245cd7[_0xb0d0('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce4e1d){return function(_0x3fbaae){if(!_0x3fbaae){_0xce4e1d[_0xb0d0('0x13')](0x194);}return _0x3fbaae;};}function handleError(_0x14b96e,_0x3dd002){_0x3dd002=_0x3dd002||0x1f4;return function(_0x379dd9){logger[_0xb0d0('0x30')](_0x379dd9[_0xb0d0('0x31')]);if(_0x379dd9[_0xb0d0('0x2e')]){delete _0x379dd9[_0xb0d0('0x2e')];}_0x14b96e[_0xb0d0('0x14')](_0x3dd002)[_0xb0d0('0x32')](_0x379dd9);};}function getUserAttributes(){return _(db[_0xb0d0('0x33')][_0xb0d0('0x34')])[_0xb0d0('0x2b')](function(_0x1d2077){return{'name':_0x1d2077[_0xb0d0('0x35')],'type':_0x1d2077[_0xb0d0('0x36')][_0xb0d0('0x37')]};})[_0xb0d0('0x29')](function(_0x31969a){return!['password','salt',_0xb0d0('0x38'),_0xb0d0('0x39'),_0xb0d0('0x3a'),_0xb0d0('0x3b')][_0xb0d0('0x3c')](_0x31969a['name']);})[_0xb0d0('0x2c')]();}exports['index']=function(_0x361237,_0x31d66b){var _0x4dbc44={},_0x461e21={'count':0x0,'rows':[]};var _0x15418e=getUserAttributes();_0x4dbc44=qs['getOptions'](_0x15418e,_0x361237);var _0x2b5546={'where':_0x4dbc44[_0xb0d0('0x3d')]};return db[_0xb0d0('0x33')][_0xb0d0('0x18')](_0x2b5546)['then'](function(_0x5501d9){_0x461e21[_0xb0d0('0x18')]=_0x5501d9;if(_0x361237[_0xb0d0('0x3e')][_0xb0d0('0x3f')]){_0x4dbc44[_0xb0d0('0x40')]=[{'all':!![]}];}if(_0x361237[_0xb0d0('0x3e')][_0xb0d0('0x41')]==='true'){_0x4dbc44['include']=[{'model':db['UserSetting'],'as':_0xb0d0('0x41')}];}if(!_[_0xb0d0('0x3c')](_0x4dbc44['attributes'],'id')){_0x4dbc44['attributes'][_0xb0d0('0x42')]('id');}return db[_0xb0d0('0x33')][_0xb0d0('0x43')](_0x4dbc44);})[_0xb0d0('0x1c')](function(_0xb44c73){_0x461e21['rows']=_0xb44c73;if(_0x361237['query']['openTabs']==='true'){var _0x31d573=[];for(var _0x3726d0=0x0;_0x3726d0<_0x461e21[_0xb0d0('0x44')][_0xb0d0('0x45')];_0x3726d0++){_0x31d573['push'](get_open_tabs('chat',_0x461e21['rows'][_0x3726d0][_0xb0d0('0x46')]));_0x31d573[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x47'),_0x461e21['rows'][_0x3726d0][_0xb0d0('0x46')]));_0x31d573[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x48'),_0x461e21[_0xb0d0('0x44')][_0x3726d0][_0xb0d0('0x46')]));_0x31d573['push'](get_open_tabs('mail',_0x461e21[_0xb0d0('0x44')][_0x3726d0][_0xb0d0('0x46')]));_0x31d573[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x49'),_0x461e21['rows'][_0x3726d0]['dataValues']));_0x31d573[_0xb0d0('0x42')](get_open_tabs('whatsapp',_0x461e21[_0xb0d0('0x44')][_0x3726d0][_0xb0d0('0x46')]));}return Promise[_0xb0d0('0x4a')](_0x31d573)[_0xb0d0('0x1c')](function(){return _0x461e21;});}else{return _0x461e21;}})[_0xb0d0('0x1c')](respondWithFilteredResult(_0x31d66b,_0x4dbc44))[_0xb0d0('0x4b')](handleError(_0x31d66b,null));};exports['show']=function(_0x51370f,_0x1f1190){var _0xf86d29=getUserAttributes();_0x51370f['query']['id']=_0x51370f[_0xb0d0('0x4c')]['id'];var _0x351a8b=qs[_0xb0d0('0x4d')](_0xf86d29,_0x51370f);if(_0x51370f[_0xb0d0('0x3e')]['includeAll']){_0x351a8b[_0xb0d0('0x40')]=[{'all':!![]}];}if(_0x51370f[_0xb0d0('0x3e')][_0xb0d0('0x41')]===_0xb0d0('0x4e')){_0x351a8b[_0xb0d0('0x40')]=[{'model':db[_0xb0d0('0x4f')],'as':_0xb0d0('0x41')}];}_0x351a8b=_[_0xb0d0('0x50')]({},_0x351a8b,_0x51370f['options']);if(!_['includes'](_0x351a8b[_0xb0d0('0x51')],'id')){_0x351a8b[_0xb0d0('0x51')][_0xb0d0('0x42')]('id');}return db[_0xb0d0('0x33')][_0xb0d0('0x2d')](_0x351a8b)[_0xb0d0('0x1c')](handleEntityNotFound(_0x1f1190,null))[_0xb0d0('0x1c')](function(_0x8475a5){var _0x47b2a7=[];values=_0x8475a5;if(_0x51370f[_0xb0d0('0x3e')]['openTabs']===_0xb0d0('0x4e')){_0x47b2a7[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x52'),_0x8475a5[_0xb0d0('0x46')]));_0x47b2a7['push'](get_open_tabs(_0xb0d0('0x47'),_0x8475a5['dataValues']));_0x47b2a7[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x49'),_0x8475a5[_0xb0d0('0x46')]));_0x47b2a7[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x53'),_0x8475a5[_0xb0d0('0x46')]));_0x47b2a7[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x48'),_0x8475a5[_0xb0d0('0x46')]));_0x47b2a7['push'](get_open_tabs(_0xb0d0('0x54'),_0x8475a5[_0xb0d0('0x46')]));return Promise[_0xb0d0('0x4a')](_0x47b2a7);}else{return values;}})[_0xb0d0('0x1c')](function(){return values;})['then'](respondWithResult(_0x1f1190,null))[_0xb0d0('0x4b')](handleError(_0x1f1190,null));};exports[_0xb0d0('0x1b')]=function(_0x18f882,_0x2201dc){if(_0x18f882[_0xb0d0('0x55')]['id']){delete _0x18f882[_0xb0d0('0x55')]['id'];}delete _0x18f882[_0xb0d0('0x55')][_0xb0d0('0x1d')];return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x18f882[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x2201dc,null))[_0xb0d0('0x1c')](saveUpdates(_0x18f882[_0xb0d0('0x55')],null))[_0xb0d0('0x1c')](respondWithResult(_0x2201dc,null))[_0xb0d0('0x4b')](handleError(_0x2201dc,null));};exports[_0xb0d0('0x56')]=function(_0x3d1a15,_0x541ff0){return db['User'][_0xb0d0('0x56')]()['then'](respondWithResult(_0x541ff0,null))[_0xb0d0('0x4b')](handleError(_0x541ff0,null));};exports[_0xb0d0('0x57')]=function(_0x4ab063,_0x46dbb1){return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x4ab063[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x46dbb1,null))[_0xb0d0('0x1c')](function(_0x10478c){if(_0x10478c){return _0x10478c[_0xb0d0('0x57')](_0x4ab063['body'][_0xb0d0('0x58')],_[_0xb0d0('0x59')](_0x4ab063[_0xb0d0('0x55')],['ids','id'])||{});}})[_0xb0d0('0x1c')](respondWithResult(_0x46dbb1,null))[_0xb0d0('0x4b')](handleError(_0x46dbb1,null));};function validateUser(_0x41ddc4){return new Promise(function(_0x1f59f1,_0x2d6686){if(_0x41ddc4[_0xb0d0('0x5a')])return _0x1f59f1(_0x41ddc4);return db[_0xb0d0('0x5b')][_0xb0d0('0x5c')](0x1)['then'](function(_0xb0673d){if(_0xb0673d[_0xb0d0('0x5d')])authService[_0xb0d0('0x5e')](_0x41ddc4[_0xb0d0('0x5f')]);db['User'][_0xb0d0('0x60')](_0xb0d0('0x5a'))[_0xb0d0('0x1c')](function(_0x31e8ed){if(_[_0xb0d0('0x61')](_0x31e8ed)){_0x41ddc4['internal']=_0xb0673d[_0xb0d0('0x62')]||0x1;return;}if(_[_0xb0d0('0x61')](_0xb0673d['min_internal'])||_0xb0673d[_0xb0d0('0x62')]===_0x31e8ed){_0x41ddc4[_0xb0d0('0x5a')]=_0x31e8ed+0x1;return;}if(_0xb0673d[_0xb0d0('0x62')]>_0x31e8ed){_0x41ddc4['internal']=_0xb0673d[_0xb0d0('0x62')];return;}return db['sequelize'][_0xb0d0('0x3e')](_0xb0d0('0x63'),{'type':db[_0xb0d0('0x64')][_0xb0d0('0x65')]['SELECT']})['then'](function(_0x2b5dc1){if(_0x2b5dc1&&_0x2b5dc1[_0xb0d0('0x45')]){for(var _0x215427=0x0,_0x3a289a=_0x2b5dc1[_0xb0d0('0x45')];_0x215427<_0x3a289a&&_[_0xb0d0('0x61')](_0x41ddc4[_0xb0d0('0x5a')]);_0x215427++){if(_0xb0673d['min_internal']<=_0x2b5dc1[_0x215427]['from']){_0x41ddc4[_0xb0d0('0x5a')]=_0x2b5dc1[_0x215427][_0xb0d0('0x66')];}else if(_0xb0673d['min_internal']>_0x2b5dc1[_0x215427][_0xb0d0('0x66')]&&_0xb0673d[_0xb0d0('0x62')]<=_0x2b5dc1[_0x215427]['to']){_0x41ddc4['internal']=_0xb0673d[_0xb0d0('0x62')];}}}if(_[_0xb0d0('0x61')](_0x41ddc4[_0xb0d0('0x5a')])){_0x41ddc4[_0xb0d0('0x5a')]=_0x31e8ed+0x1;}return _0x1f59f1(_0x41ddc4);});});})['catch'](function(_0x413d94){_0x2d6686(_0x413d94);});});}function updateUser(_0x3b9d5d){return new Promise(function(_0x583465,_0x25f791){try{if(_0x3b9d5d[_0xb0d0('0x67')]){_0x3b9d5d[_0xb0d0('0x68')]=_0x3b9d5d[_0xb0d0('0x5a')];_0x3b9d5d[_0xb0d0('0x69')]={'mailbox':_0x3b9d5d[_0xb0d0('0x5a')],'password':_0x3b9d5d[_0xb0d0('0x5f')],'fullname':_0x3b9d5d[_0xb0d0('0x6a')],'email':_0x3b9d5d[_0xb0d0('0x6b')]};}if(_0x3b9d5d['role']===_0xb0d0('0x26')){if(!_0x3b9d5d[_0xb0d0('0x6c')])_0x3b9d5d['permissions']=['101','102',_0xb0d0('0x6d'),_0xb0d0('0x6e'),_0xb0d0('0x6f'),'104',_0xb0d0('0x70'),_0xb0d0('0x71'),'107',_0xb0d0('0x72'),_0xb0d0('0x73'),'100',_0xb0d0('0x74'),_0xb0d0('0x75'),_0xb0d0('0x76')];}_0x583465(_0x3b9d5d);}catch(_0x2c6cee){_0x25f791(_0x2c6cee);}});}exports[_0xb0d0('0x77')]=function(_0x17f414,_0x159171){if(_0x17f414[_0xb0d0('0x24')]['role']==='agent')throw new Error('Unauthorized');if(_0x17f414[_0xb0d0('0x55')][_0xb0d0('0x1d')]===_0xb0d0('0x24')&&_0x17f414[_0xb0d0('0x24')]['role']!==_0xb0d0('0x22')){throw new Error(_0xb0d0('0x78'));}if(_0x17f414['body']['role']===_0xb0d0('0x22')&&_0x17f414[_0xb0d0('0x24')]['role']!==_0xb0d0('0x22')){throw new Error(_0xb0d0('0x79'));}return licenseUtil[_0xb0d0('0x7a')]([_0x17f414[_0xb0d0('0x55')]])['then'](function(){return validateUser(_0x17f414[_0xb0d0('0x55')]);})['then'](function(_0x33189e){return updateUser(_0x33189e)['then'](function(_0x185037){if(_0x185037[_0xb0d0('0x1d')]==='admin'){_0x185037[_0xb0d0('0x7b')]=_0x17f414[_0xb0d0('0x24')]['settingsEnabled'];delete _0x185037['userProfileId'];}return _0x185037;});})[_0xb0d0('0x1c')](function(_0x5f4480){return db[_0xb0d0('0x33')][_0xb0d0('0x77')](_0x5f4480,{'include':[{'model':db[_0xb0d0('0x69')],'as':_0xb0d0('0x69')}]});})[_0xb0d0('0x1c')](function(_0x3c2764){if(_0x17f414[_0xb0d0('0x55')][_0xb0d0('0x1d')]===_0xb0d0('0x24'))return _0x3c2764;if(_0x17f414[_0xb0d0('0x24')][_0xb0d0('0x1d')]!==_0xb0d0('0x24'))return _0x3c2764;return db[_0xb0d0('0x7c')]['find']({'where':{'name':_0x3c2764['role']===_0xb0d0('0x26')?_0xb0d0('0x25'):_0xb0d0('0x27'),'userProfileId':_0x17f414['user'][_0xb0d0('0x7d')]},'raw':!![]})['then'](function(_0x5d5d4b){if(!_0x5d5d4b||_0x5d5d4b[_0xb0d0('0x7e')]!=0x0)return _0x3c2764;return db[_0xb0d0('0x2f')][_0xb0d0('0x77')]({'name':_0x3c2764[_0xb0d0('0x2e')],'resourceId':_0x3c2764['id'],'type':_0x5d5d4b['name'],'sectionId':_0x5d5d4b['id']},{})[_0xb0d0('0x1c')](function(){return _0x3c2764;});})[_0xb0d0('0x4b')](function(_0x3baa37){logger['error'](_0xb0d0('0x7f'),_0x3baa37);throw _0x3baa37;});})[_0xb0d0('0x1c')](respondWithResult(_0x159171,0xc9))[_0xb0d0('0x4b')](handleError(_0x159171,null));};exports[_0xb0d0('0x80')]=function(_0x4d61ad,_0x5113b5){var _0x2804d2=_0x4d61ad[_0xb0d0('0x55')];var _0x45a1d8=[];if(_0x4d61ad[_0xb0d0('0x24')][_0xb0d0('0x1d')]===_0xb0d0('0x26'))throw new Error(_0xb0d0('0x81'));if(_[_0xb0d0('0x82')](_0x2804d2,[_0xb0d0('0x1d'),_0xb0d0('0x24')])&&_0x4d61ad['user'][_0xb0d0('0x1d')]!==_0xb0d0('0x22')){throw new Error(_0xb0d0('0x78'));}if(_[_0xb0d0('0x82')](_0x2804d2,[_0xb0d0('0x1d'),_0xb0d0('0x22')])&&_0x4d61ad['user'][_0xb0d0('0x1d')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xb0d0('0x7a')](_0x2804d2)[_0xb0d0('0x1c')](function(){return validateUser(_0x2804d2[0x0]);})['then'](function(){for(var _0x1d8f26=0x1;_0x1d8f26<_0x2804d2['length'];_0x1d8f26++){var _0xb98b93=_0x2804d2[_0x1d8f26-0x1][_0xb0d0('0x5a')];if(!_0x2804d2[_0x1d8f26]['internal'])_0x2804d2[_0x1d8f26][_0xb0d0('0x5a')]=_0xb98b93+0x1;_0x45a1d8[_0xb0d0('0x42')](validateUser(_0x2804d2[_0x1d8f26]));}return Promise[_0xb0d0('0x4a')](_0x45a1d8);})['then'](function(){_0x45a1d8=[];for(var _0x2b5293=0x0;_0x2b5293<_0x2804d2[_0xb0d0('0x45')];_0x2b5293++){_0x45a1d8['push'](updateUser(_0x2804d2[_0x2b5293]));}return Promise[_0xb0d0('0x4a')](_0x45a1d8);})[_0xb0d0('0x1c')](function(){_0x45a1d8=_0x2804d2['map'](function(_0x457f9f){return db[_0xb0d0('0x33')][_0xb0d0('0x77')](_0x457f9f,{'include':[{'model':db['VoiceMail'],'as':_0xb0d0('0x69')}]})[_0xb0d0('0x1c')](function(_0x4d811a){_0x457f9f['id']=_0x4d811a['id'];return _0x457f9f;});});return Promise[_0xb0d0('0x4a')](_0x45a1d8);})[_0xb0d0('0x1c')](function(_0x2f4627){if(_0x4d61ad[_0xb0d0('0x55')][_0xb0d0('0x1d')]===_0xb0d0('0x24'))return _0x2f4627;if(_0x4d61ad[_0xb0d0('0x24')]['role']!==_0xb0d0('0x24'))return _0x2f4627;var _0x1736c6=_[_0xb0d0('0x82')](_0x2f4627,function(_0x9ae44e){return _0x9ae44e[_0xb0d0('0x1d')]===_0xb0d0('0x26')||_0x9ae44e['role']===_0xb0d0('0x28');});if(!_0x1736c6)return _0x2f4627;return db['UserProfileSection'][_0xb0d0('0x43')]({'where':{'name':{'$or':[_0xb0d0('0x25'),_0xb0d0('0x27')]},'userProfileId':_0x4d61ad['user'][_0xb0d0('0x7d')]},'raw':!![]})[_0xb0d0('0x1c')](function(_0x208d73){if(_[_0xb0d0('0x83')](_0x208d73)||!_['some'](_0x208d73,[_0xb0d0('0x7e'),0x0]))return _0x2f4627;_0x45a1d8=[];var _0x326624=_(_0x208d73)[_0xb0d0('0x2b')](function(_0x42113a){if(_0x42113a['autoAssociation']===0x1)return;return _0x42113a[_0xb0d0('0x2e')]==='Agents'?'agent':_0xb0d0('0x28');})[_0xb0d0('0x84')]()[_0xb0d0('0x2c')]();for(var _0x2cb485=0x0;_0x2cb485<_0x2f4627['length'];_0x2cb485++){if(!_[_0xb0d0('0x3c')](_0x326624,_0x2f4627[_0x2cb485][_0xb0d0('0x1d')]))return;var _0x1f413b=_0x2f4627[_0x2cb485][_0xb0d0('0x1d')]===_0xb0d0('0x26')?_0xb0d0('0x25'):_0xb0d0('0x27');_0x45a1d8[_0xb0d0('0x42')](db[_0xb0d0('0x2f')][_0xb0d0('0x77')]({'name':_0x2f4627[_0x2cb485]['name'],'resourceId':_0x2f4627[_0x2cb485]['id'],'type':_0x1f413b,'sectionId':_[_0xb0d0('0x2d')](_0x208d73,['name',_0x1f413b])['id']},{}));}return Promise[_0xb0d0('0x4a')](_0x45a1d8);});})[_0xb0d0('0x1c')](respondWithResult(_0x5113b5,0xc9))[_0xb0d0('0x4b')](handleError(_0x5113b5,null));};exports[_0xb0d0('0x85')]=function(_0x3aa425,_0x28bec3){if(_0x3aa425[_0xb0d0('0x55')]['id']){delete _0x3aa425[_0xb0d0('0x55')]['id'];}return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x3aa425['params']['id']}})[_0xb0d0('0x1c')](function(_0x32c463){if(!_0x32c463)return null;if(_0x32c463['id']===_0x3aa425[_0xb0d0('0x24')]['id']){if(!_0x3aa425[_0xb0d0('0x55')]['oldPassword']||!_0x3aa425[_0xb0d0('0x55')]['newPassword']){throw new db[(_0xb0d0('0x86'))][(_0xb0d0('0x87'))](_0xb0d0('0x88'));}if(!_0x32c463[_0xb0d0('0x89')](_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8a')])){throw new db[(_0xb0d0('0x86'))][(_0xb0d0('0x87'))](_0xb0d0('0x8b'));}if(_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8a')]===_0x3aa425['body'][_0xb0d0('0x8c')]){throw new db['Sequelize'][(_0xb0d0('0x87'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x3aa425['user'][_0xb0d0('0x1d')]==='admin'){if(!_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8c')]){throw new db['Sequelize'][(_0xb0d0('0x87'))](_0xb0d0('0x8d'));}}else if(_0x3aa425[_0xb0d0('0x24')]['role']==='user'){if(!_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8c')]){throw new db[(_0xb0d0('0x86'))][(_0xb0d0('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x32c463[_0xb0d0('0x1d')]!==_0xb0d0('0x26')){throw new db[(_0xb0d0('0x86'))][(_0xb0d0('0x87'))]('Unauthorized');}}else{throw new db[(_0xb0d0('0x86'))]['ValidationError'](_0xb0d0('0x81'));}return _0x32c463;})[_0xb0d0('0x1c')](handleEntityNotFound(_0x28bec3,null))[_0xb0d0('0x1c')](function(_0x5170e3){return db[_0xb0d0('0x5b')][_0xb0d0('0x8e')]({'attributes':['id',_0xb0d0('0x5d'),'enforcePasswordHistory',_0xb0d0('0x8f')]})[_0xb0d0('0x1c')](function(_0x768a0e){if(_0x768a0e[_0xb0d0('0x5d')])authService[_0xb0d0('0x5e')](_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8c')]);if(!_0x768a0e['enforcePasswordHistory']||!_0x5170e3[_0xb0d0('0x38')])return _0x5170e3;authService[_0xb0d0('0x90')](_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8c')],_0x5170e3['previousPasswords'],_0x768a0e[_0xb0d0('0x8f')]);return _0x5170e3;})[_0xb0d0('0x1c')](saveUpdates({'password':_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8c')],'passwordResetAt':_0x3aa425[_0xb0d0('0x24')]['id']==_0x3aa425[_0xb0d0('0x4c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x3aa425[_0xb0d0('0x55')][_0xb0d0('0x8c')],_0x5170e3[_0xb0d0('0x38')])},null));})[_0xb0d0('0x1c')](respondWithResult(_0x28bec3,null))[_0xb0d0('0x4b')](handleError(_0x28bec3,null));};exports[_0xb0d0('0x91')]=function(_0x180413,_0x4976c2){var _0xe6e0b2=_0x180413[_0xb0d0('0x55')]['channel'];return db[_0xb0d0('0x33')]['find']({'where':{'id':_0x180413['params']['id']},'attributes':['id',_0xb0d0('0x2e'),_0xb0d0('0x1d'),_0xb0d0('0x92'),'loginInPause',_0xb0d0('0x93'),'interface']})[_0xb0d0('0x1c')](handleEntityNotFound(_0x4976c2,null))[_0xb0d0('0x1c')](function(_0x210544){if(_0x210544){if(!utils[_0xb0d0('0x94')](_0xe6e0b2)){throw new db['Sequelize'][(_0xb0d0('0x87'))](_0xb0d0('0x95'));}return _0x210544[_0xb0d0('0x96')+_[_0xb0d0('0x97')](_0xe6e0b2[_0xb0d0('0x98')]())+_0xb0d0('0x99')](_0x180413[_0xb0d0('0x55')][_0xb0d0('0x58')],{'penalty':_0x180413[_0xb0d0('0x55')]['penalty']||0x0})['spread'](function(_0x42f273){for(var _0x13ccf5=0x0;_0x13ccf5<_0x180413[_0xb0d0('0x55')][_0xb0d0('0x58')][_0xb0d0('0x45')];_0x13ccf5+=0x1){var _0x333846={'UserId':Number(_0x180413[_0xb0d0('0x4c')]['id'])};_0x333846[_[_0xb0d0('0x97')](_0xe6e0b2[_0xb0d0('0x98')]())+_0xb0d0('0x9a')]=Number(_0x180413[_0xb0d0('0x55')][_0xb0d0('0x58')][_0x13ccf5]);socket[_0xb0d0('0x1e')](_0xb0d0('0x24')+_[_0xb0d0('0x97')](_0xe6e0b2[_0xb0d0('0x98')]())+_0xb0d0('0x9b'),_0x333846);}return _0x42f273;})[_0xb0d0('0x1c')](function(){if(_0xe6e0b2===_0xb0d0('0x9c')){return db[_0xb0d0('0x9d')][_0xb0d0('0x43')]({'where':{'id':_0x180413[_0xb0d0('0x55')][_0xb0d0('0x58')]||[]},'raw':!![],'attributes':['id',_0xb0d0('0x2e')]});}})[_0xb0d0('0x1c')](function(_0x36596b){var _0x2aba4e=_0x210544['get']({'plain':!![]});var _0x5b7b93=[];if(_0xe6e0b2===_0xb0d0('0x9c')&&_0x2aba4e[_0xb0d0('0x1d')]===_0xb0d0('0x26')&&_0x2aba4e['online']){for(let _0x5ab0bf=0x0;_0x5ab0bf<_0x36596b[_0xb0d0('0x45')];_0x5ab0bf+=0x1){_0x5b7b93['push']({'membername':_0x2aba4e['name'],'UserId':_0x2aba4e['id'],'queue_name':_0x36596b[_0x5ab0bf][_0xb0d0('0x2e')],'VoiceQueueId':_0x36596b[_0x5ab0bf]['id'],'interface':_[_0xb0d0('0x61')](_0x2aba4e['interface'])?util['format'](_0xb0d0('0x9e'),_0x2aba4e[_0xb0d0('0x2e')]):_0x2aba4e[_0xb0d0('0x9f')],'paused':_0x2aba4e[_0xb0d0('0x93')]||![],'penalty':_0x180413[_0xb0d0('0x55')][_0xb0d0('0xa0')]||0x0});}return Promise[_0xb0d0('0x4a')](_0x5b7b93[_0xb0d0('0x2b')](function(_0x3d5fab){return db[_0xb0d0('0xa1')][_0xb0d0('0xa2')](_0x3d5fab);}));}return _0x210544;});}})[_0xb0d0('0x1c')](respondWithStatusCode(_0x4976c2,null))[_0xb0d0('0x4b')](handleError(_0x4976c2,null));};exports[_0xb0d0('0xa3')]=function(_0xa83ffe,_0x33dfb8){var _0x32721d,_0x1e2f44;return db['User'][_0xb0d0('0x2d')]({'where':{'id':_0xa83ffe['params']['id']},'attributes':['id',_0xb0d0('0x2e'),_0xb0d0('0x1d')]})[_0xb0d0('0x1c')](handleEntityNotFound(_0x33dfb8,null))['then'](function(_0x1aeca2){if(_0x1aeca2){_0x32721d=_0x1aeca2;if(!_0xa83ffe['query'][_0xb0d0('0xa4')]||!utils['isValidChannel'](_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0xa4')])){throw new db[(_0xb0d0('0x86'))][(_0xb0d0('0x87'))](_0xb0d0('0x95'));}return _0x1aeca2[_0xb0d0('0xa5')+_[_0xb0d0('0x97')](_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0xa4')][_0xb0d0('0x98')]())+_0xb0d0('0x99')](_0xa83ffe['query'][_0xb0d0('0x58')]);}})[_0xb0d0('0x1c')](function(_0xb761e3){if(_['isArray'](_0xa83ffe[_0xb0d0('0x3e')]['ids'])){for(var _0x1671ca=0x0;_0x1671ca<_0xa83ffe['query'][_0xb0d0('0x58')]['length'];_0x1671ca+=0x1){_0x1e2f44={'UserId':Number(_0xa83ffe[_0xb0d0('0x4c')]['id'])};_0x1e2f44[_[_0xb0d0('0x97')](_0xa83ffe[_0xb0d0('0x3e')]['channel'][_0xb0d0('0x98')]())+'QueueId']=Number(_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0x58')][_0x1671ca]);socket['emit'](_0xb0d0('0x24')+_['capitalize'](_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0xa4')][_0xb0d0('0x98')]())+'Queue:remove',_0x1e2f44);}}else{_0x1e2f44={'UserId':Number(_0xa83ffe[_0xb0d0('0x4c')]['id'])};_0x1e2f44[_[_0xb0d0('0x97')](_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0xa4')][_0xb0d0('0x98')]())+_0xb0d0('0x9a')]=Number(_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0x58')]);socket[_0xb0d0('0x1e')](_0xb0d0('0x24')+_['capitalize'](_0xa83ffe['query'][_0xb0d0('0xa4')][_0xb0d0('0x98')]())+_0xb0d0('0xa6'),_0x1e2f44);}return _0xb761e3;})[_0xb0d0('0x1c')](function(){if(_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0xa4')]==='voice'){return db[_0xb0d0('0xa1')]['destroy']({'where':{'UserId':_0xa83ffe[_0xb0d0('0x4c')]['id'],'VoiceQueueId':_0xa83ffe[_0xb0d0('0x3e')][_0xb0d0('0x58')]},'individualHooks':!![]})[_0xb0d0('0x1c')](function(){return _0x32721d;});}return _0x32721d;})[_0xb0d0('0x1c')](respondWithStatusCode(_0x33dfb8,null))[_0xb0d0('0x4b')](handleError(_0x33dfb8,null));};exports[_0xb0d0('0xa7')]=function(_0x2a74d7,_0x14fd56){_0x2a74d7[_0xb0d0('0x55')][_0xb0d0('0xa8')]=_0x2a74d7[_0xb0d0('0xa9')][_0xb0d0('0xaa')];return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x2a74d7['params']['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x14fd56,null))[_0xb0d0('0x1c')](saveUpdates(_0x2a74d7[_0xb0d0('0x55')],null))[_0xb0d0('0x1c')](respondWithResult(_0x14fd56,null))['catch'](handleError(_0x14fd56,null));};exports[_0xb0d0('0xab')]=function(_0xc4dd94,_0x195511){var _0x420c4e=path[_0xb0d0('0xac')](config['root'],_0xb0d0('0xad'));return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0xc4dd94[_0xb0d0('0x4c')]['id']},'attributes':['id',_0xb0d0('0xa8')],'raw':!![]})['then'](handleEntityNotFound(_0x195511,null))[_0xb0d0('0x1c')](function(_0x1e1f90){if(_0x1e1f90){if(_[_0xb0d0('0x61')](_0x1e1f90[_0xb0d0('0xa8')])){return _0x195511[_0xb0d0('0xae')](_0x420c4e);}else{if(!fs[_0xb0d0('0xaf')](path['join'](config[_0xb0d0('0xb0')],_0xb0d0('0xb1'),_0x1e1f90[_0xb0d0('0xa8')]))){return _0x195511[_0xb0d0('0xae')](_0x420c4e);}return _0x195511['download'](path['join'](config[_0xb0d0('0xb0')],'server/files/images/',_0x1e1f90[_0xb0d0('0xa8')]));}}})['catch'](handleError(_0x195511,null));};exports[_0xb0d0('0xb2')]=function(_0x153bbb,_0x42d713){return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x153bbb[_0xb0d0('0x4c')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x42d713,null))[_0xb0d0('0x1c')](function(_0x520c43){var _0x3882d9=[];values=_0x520c43[_0xb0d0('0x46')];_0x3882d9['push'](get_open_tabs(_0xb0d0('0x52'),_0x520c43[_0xb0d0('0x46')]));_0x3882d9[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x47'),_0x520c43[_0xb0d0('0x46')]));_0x3882d9['push'](get_open_tabs('openchannel',_0x520c43['dataValues']));_0x3882d9[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x53'),_0x520c43['dataValues']));_0x3882d9['push'](get_open_tabs(_0xb0d0('0x48'),_0x520c43[_0xb0d0('0x46')]));_0x3882d9[_0xb0d0('0x42')](get_open_tabs(_0xb0d0('0x54'),_0x520c43[_0xb0d0('0x46')]));return Promise[_0xb0d0('0x4a')](_0x3882d9);})['then'](function(_0x1c0383){if(_0x1c0383){var _0x45b4ed=_[_0xb0d0('0x2b')](values[_0xb0d0('0xb3')],function(_0x496f69){return{'channel':'CHAT','id':_0x496f69['id'],'createdAt':_0x496f69[_0xb0d0('0xb4')]};});var _0x9269cf=_[_0xb0d0('0x2b')](values[_0xb0d0('0xb5')],function(_0x575162){return{'channel':_0xb0d0('0xb6'),'id':_0x575162['id'],'createdAt':_0x575162[_0xb0d0('0xb4')]};});var _0x53ab19=_[_0xb0d0('0x2b')](values[_0xb0d0('0xb7')],function(_0x43dd1a){return{'channel':_0xb0d0('0xb8'),'id':_0x43dd1a['id'],'createdAt':_0x43dd1a['createdAt']};});var _0x1cc36f=_[_0xb0d0('0x2b')](values[_0xb0d0('0xb9')],function(_0x388d40){return{'channel':_0xb0d0('0xba'),'id':_0x388d40['id'],'createdAt':_0x388d40[_0xb0d0('0xb4')]};});var _0x3f316f=_['map'](values[_0xb0d0('0xbb')],function(_0x185e5b){return{'channel':_0xb0d0('0xbc'),'id':_0x185e5b['id'],'createdAt':_0x185e5b['createdAt']};});var _0x307baf=_[_0xb0d0('0x2b')](values['WhatsappOpenTabs'],function(_0x347cba){return{'channel':_0xb0d0('0xbd'),'id':_0x347cba['id'],'createdAt':_0x347cba[_0xb0d0('0xb4')]};});var _0x32469c=_['concat'](_0x45b4ed,_0x9269cf,_0x53ab19,_0x1cc36f,_0x3f316f,_0x307baf);var _0x463305={'count':_0x32469c['length'],'rows':_0x32469c};return _0x463305;}else return null;})[_0xb0d0('0x1c')](respondWithResult(_0x42d713,null))[_0xb0d0('0x4b')](handleError(_0x42d713,null));};exports[_0xb0d0('0xbe')]=function(_0x468009,_0xfb7030){var _0x2aa5ae={};return db['User'][_0xb0d0('0x8e')]({'where':{'id':_0x468009[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](function(_0x1b9f70){if(!_0x1b9f70){throw new APINotFoundError(util[_0xb0d0('0xbf')]('User\x20with\x20id\x20%s\x20not\x20found',_0x468009[_0xb0d0('0x4c')]['id']));}return contacts[_0xb0d0('0x56')]();})['then'](function(_0x2b5a31){_0x468009['query'][_0xb0d0('0x33')]=_0x468009[_0xb0d0('0x4c')]['id'];_0x2aa5ae=qs[_0xb0d0('0x4d')](_0x2b5a31,_0x468009);if(_0x468009[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0x3f'))){_0x2aa5ae[_0xb0d0('0x40')]=[{'model':db[_0xb0d0('0xc1')],'as':_0xb0d0('0xc2'),'required':![]},{'model':db[_0xb0d0('0xc3')],'as':_0xb0d0('0xc4'),'attributes':['id','name',_0xb0d0('0xc5')],'where':_0x468009[_0xb0d0('0x3e')]['tag']?{'id':_0x468009[_0xb0d0('0x3e')][_0xb0d0('0xc6')]}:undefined,'required':_0x468009['query'][_0xb0d0('0xc6')]?!![]:![]}];}return contacts[_0xb0d0('0x43')](_0x468009['query'],_0x468009[_0xb0d0('0x24')],_0x2aa5ae,_0x2b5a31);})[_0xb0d0('0x1c')](respondWithFilteredResult(_0xfb7030,_0x2aa5ae))['catch'](APIHandleError(_0xfb7030));};exports[_0xb0d0('0xc7')]=function(_0x343947,_0x357a3c){var _0x45aee6;var _0x76e7dd={};var _0x1b170f;return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x343947[_0xb0d0('0x4c')]['id']},'attributes':['id','name',_0xb0d0('0x1d')]})[_0xb0d0('0x1c')](handleEntityNotFound(_0x357a3c,null))[_0xb0d0('0x1c')](function(_0x40e3b0){if(!utils[_0xb0d0('0x94')](_0x343947[_0xb0d0('0x3e')][_0xb0d0('0xa4')])){throw new db[(_0xb0d0('0x86'))]['ValidationError']('Unknown\x20channel');}_0x45aee6=_0x40e3b0;var _0x18f3b2={};_0x18f3b2['model']=_[_0xb0d0('0xc8')](db[_[_0xb0d0('0x97')](_0x343947['query'][_0xb0d0('0xa4')])+'Queue']['rawAttributes']);_0x18f3b2[_0xb0d0('0x3e')]=_[_0xb0d0('0xc8')](_0x343947[_0xb0d0('0x3e')]);_0x18f3b2[_0xb0d0('0xc9')]=_['intersection'](_0x18f3b2[_0xb0d0('0xca')],_0x18f3b2[_0xb0d0('0x3e')]);_0x76e7dd['attributes']=_[_0xb0d0('0xcb')](_0x18f3b2['model'],qs['fields'](_0x343947['query']['fields']));_0x76e7dd['attributes']=_0x76e7dd[_0xb0d0('0x51')]['length']?_0x76e7dd[_0xb0d0('0x51')]:_0x18f3b2[_0xb0d0('0xca')];_0x76e7dd[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x343947['query'][_0xb0d0('0xcd')]);_0x76e7dd[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x343947[_0xb0d0('0x3e')],_0x18f3b2['filters']));if(_0x343947[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x76e7dd[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x76e7dd[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x76e7dd[_0xb0d0('0x51')],function(_0x139eca){var _0x58dfab={};_0x58dfab[_0x139eca]={'$like':'%'+_0x343947[_0xb0d0('0x3e')][_0xb0d0('0x29')]+'%'};return _0x58dfab;})});}_0x76e7dd=_[_0xb0d0('0x50')]({},_0x76e7dd,_0x343947[_0xb0d0('0xcf')]);switch(_0x45aee6[_0xb0d0('0x1d')]){case _0xb0d0('0x22'):return db[_[_0xb0d0('0x97')](_0x343947[_0xb0d0('0x3e')][_0xb0d0('0xa4')])+'Queue'][_0xb0d0('0x43')](_0x76e7dd);case _0xb0d0('0x24'):case _0xb0d0('0x26'):return _0x45aee6['get'+_[_0xb0d0('0x97')](_0x343947['query'][_0xb0d0('0xa4')])+'Queues'](_0x76e7dd);default:throw new db['Sequelize']['ValidationError']('Unknown\x20role');}})[_0xb0d0('0x1c')](function(_0x250a92){_0x1b170f=_0x250a92[_0xb0d0('0x45')];if(!_0x343947[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x76e7dd[_0xb0d0('0x1a')]=qs['limit'](_0x343947['query'][_0xb0d0('0x1a')]);_0x76e7dd[_0xb0d0('0x19')]=qs['offset'](_0x343947['query'][_0xb0d0('0x19')]);}switch(_0x45aee6[_0xb0d0('0x1d')]){case'admin':return db[_[_0xb0d0('0x97')](_0x343947[_0xb0d0('0x3e')][_0xb0d0('0xa4')])+_0xb0d0('0xd1')][_0xb0d0('0x43')](_0x76e7dd);case'user':case _0xb0d0('0x26'):return _0x45aee6[_0xb0d0('0x21')+_[_0xb0d0('0x97')](_0x343947[_0xb0d0('0x3e')][_0xb0d0('0xa4')])+'Queues'](_0x76e7dd);}})[_0xb0d0('0x1c')](function(_0x597bdd){return{'count':_0x1b170f,'rows':_0x597bdd};})['then'](respondWithResult(_0x357a3c,null))[_0xb0d0('0x4b')](handleError(_0x357a3c,null));};exports['getVoiceQueuesRt']=function(_0x1921f7,_0x189024){var _0x5318f2={};var _0x3ce8c4={};var _0x295677;var _0x1b4cb3;return db[_0xb0d0('0x33')]['findOne']({'where':{'id':_0x1921f7['params']['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x189024,null))[_0xb0d0('0x1c')](function(_0xbd1237){if(_0xbd1237){_0x295677=_0xbd1237;_0x3ce8c4[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xa1')][_0xb0d0('0x34')]);_0x3ce8c4['query']=_[_0xb0d0('0xc8')](_0x1921f7[_0xb0d0('0x3e')]);_0x3ce8c4[_0xb0d0('0xc9')]=_['intersection'](_0x3ce8c4[_0xb0d0('0xca')],_0x3ce8c4[_0xb0d0('0x3e')]);_0x5318f2['attributes']=_[_0xb0d0('0xcb')](_0x3ce8c4[_0xb0d0('0xca')],qs['fields'](_0x1921f7['query'][_0xb0d0('0xd2')]));_0x5318f2['attributes']=_0x5318f2[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0x5318f2[_0xb0d0('0x51')]:_0x3ce8c4[_0xb0d0('0xca')];_0x5318f2[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x1921f7[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0x5318f2[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_['pick'](_0x1921f7[_0xb0d0('0x3e')],_0x3ce8c4[_0xb0d0('0xc9')]));if(_0x1921f7[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x5318f2[_0xb0d0('0x3d')]=_['merge'](_0x5318f2[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x5318f2[_0xb0d0('0x51')],function(_0x48b15d){var _0x5bd69f={};_0x5bd69f[_0x48b15d]={'$like':'%'+_0x1921f7[_0xb0d0('0x3e')]['filter']+'%'};return _0x5bd69f;})});}_0x5318f2=_[_0xb0d0('0x50')]({},_0x5318f2,_0x1921f7[_0xb0d0('0xcf')]);return _0x295677[_0xb0d0('0xd3')](_0x5318f2);}})['then'](function(_0x4a4e23){if(_0x4a4e23){_0x1b4cb3=_0x4a4e23[_0xb0d0('0x45')];if(!_0x1921f7[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x5318f2[_0xb0d0('0x1a')]=qs[_0xb0d0('0x1a')](_0x1921f7['query'][_0xb0d0('0x1a')]);_0x5318f2[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x1921f7['query'][_0xb0d0('0x19')]);}return _0x295677[_0xb0d0('0xd3')](_0x5318f2);}})[_0xb0d0('0x1c')](function(_0x554812){if(_0x554812){return _0x554812?{'count':_0x1b4cb3,'rows':_0x554812}:null;}})['then'](respondWithResult(_0x189024,null))[_0xb0d0('0x4b')](handleError(_0x189024,null));};exports[_0xb0d0('0xd4')]=function(_0x5c73f0,_0x33edb5){var _0x4d5a52={};var _0x2e4e9d={};var _0x3968b8;var _0x5a2e5a;return db[_0xb0d0('0x33')]['findOne']({'where':{'id':_0x5c73f0[_0xb0d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x33edb5,null))[_0xb0d0('0x1c')](function(_0x28133c){if(_0x28133c){_0x3968b8=_0x28133c;_0x2e4e9d[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xd5')][_0xb0d0('0x34')]);_0x2e4e9d['query']=_[_0xb0d0('0xc8')](_0x5c73f0[_0xb0d0('0x3e')]);_0x2e4e9d[_0xb0d0('0xc9')]=_['intersection'](_0x2e4e9d[_0xb0d0('0xca')],_0x2e4e9d[_0xb0d0('0x3e')]);_0x4d5a52[_0xb0d0('0x51')]=_[_0xb0d0('0xcb')](_0x2e4e9d['model'],qs[_0xb0d0('0xd2')](_0x5c73f0[_0xb0d0('0x3e')][_0xb0d0('0xd2')]));_0x4d5a52['attributes']=_0x4d5a52[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0x4d5a52[_0xb0d0('0x51')]:_0x2e4e9d[_0xb0d0('0xca')];_0x4d5a52['order']=qs[_0xb0d0('0xcd')](_0x5c73f0['query']['sort']);_0x4d5a52[_0xb0d0('0x3d')]=qs['filters'](_['pick'](_0x5c73f0[_0xb0d0('0x3e')],_0x2e4e9d['filters']));if(_0x5c73f0[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x4d5a52[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x4d5a52[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x4d5a52[_0xb0d0('0x51')],function(_0x23b584){var _0x525360={};_0x525360[_0x23b584]={'$like':'%'+_0x5c73f0['query']['filter']+'%'};return _0x525360;})});}_0x4d5a52=_['merge']({},_0x4d5a52,_0x5c73f0[_0xb0d0('0xcf')]);return _0x3968b8[_0xb0d0('0xd4')](_0x4d5a52);}})['then'](function(_0x54bb93){if(_0x54bb93){_0x5a2e5a=_0x54bb93['length'];if(!_0x5c73f0['query']['hasOwnProperty']('nolimit')){_0x4d5a52[_0xb0d0('0x1a')]=qs[_0xb0d0('0x1a')](_0x5c73f0[_0xb0d0('0x3e')][_0xb0d0('0x1a')]);_0x4d5a52[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x5c73f0[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}return _0x3968b8['getGroups'](_0x4d5a52);}})[_0xb0d0('0x1c')](function(_0x273710){if(_0x273710){return _0x273710?{'count':_0x5a2e5a,'rows':_0x273710}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0x33edb5,null))[_0xb0d0('0x4b')](handleError(_0x33edb5,null));};exports[_0xb0d0('0xd6')]=function(_0x5171a1,_0x18c202){var _0x53566b={'raw':!![],'where':{}};var _0x54d02c={};var _0x5e5095={'count':0x0,'rows':[]};return db[_0xb0d0('0x33')]['findOne']({'where':{'id':_0x5171a1[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x18c202,null))[_0xb0d0('0x1c')](function(_0x18b81e){if(_0x18b81e){_0x54d02c[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xd7')][_0xb0d0('0x34')]);_0x54d02c['query']=_[_0xb0d0('0xc8')](_0x5171a1[_0xb0d0('0x3e')]);_0x54d02c['filters']=_[_0xb0d0('0xcb')](_0x54d02c[_0xb0d0('0xca')],_0x54d02c[_0xb0d0('0x3e')]);_0x53566b[_0xb0d0('0x51')]=_[_0xb0d0('0xcb')](_0x54d02c[_0xb0d0('0xca')],qs['fields'](_0x5171a1[_0xb0d0('0x3e')]['fields']));_0x53566b[_0xb0d0('0x51')]=_0x53566b[_0xb0d0('0x51')]['length']?_0x53566b[_0xb0d0('0x51')]:_0x54d02c[_0xb0d0('0xca')];if(!_0x5171a1['query'][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x53566b['limit']=qs[_0xb0d0('0x1a')](_0x5171a1[_0xb0d0('0x3e')][_0xb0d0('0x1a')]);_0x53566b[_0xb0d0('0x19')]=qs['offset'](_0x5171a1['query'][_0xb0d0('0x19')]);}_0x53566b[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x5171a1[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0x53566b[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_['pick'](_0x5171a1['query'],_0x54d02c[_0xb0d0('0xc9')]));_0x53566b[_0xb0d0('0x3d')]['UserId']=_0x18b81e['id'];if(_0x5171a1[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x53566b['where']=_[_0xb0d0('0x50')](_0x53566b[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x53566b[_0xb0d0('0x51')],function(_0x3cbc16){var _0x4d3ce6={};_0x4d3ce6[_0x3cbc16]={'$like':'%'+_0x5171a1['query'][_0xb0d0('0x29')]+'%'};return _0x4d3ce6;})});}_0x53566b=_['merge']({},_0x53566b,_0x5171a1[_0xb0d0('0xcf')]);return db['VoiceRecording'][_0xb0d0('0x18')]({'where':_0x53566b[_0xb0d0('0x3d')]})[_0xb0d0('0x1c')](function(_0x450fdd){_0x5e5095[_0xb0d0('0x18')]=_0x450fdd;if(_0x5171a1[_0xb0d0('0x3e')]['includeAll']){_0x53566b[_0xb0d0('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0xb0d0('0x43')](_0x53566b);})[_0xb0d0('0x1c')](function(_0x10ba94){_0x5e5095['rows']=_0x10ba94;return _0x5e5095;});}})[_0xb0d0('0x1c')](respondWithFilteredResult(_0x18c202,_0x53566b))[_0xb0d0('0x4b')](handleError(_0x18c202,null));};exports[_0xb0d0('0xd8')]=function(_0x6c06c1,_0x446690){var _0x19812d={'raw':!![],'where':{}};var _0x178996={};var _0x18731e={'count':0x0,'rows':[]};return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x6c06c1[_0xb0d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x446690,null))['then'](function(_0x1dd5f0){if(_0x1dd5f0){_0x178996['model']=_[_0xb0d0('0xc8')](db['ScreenRecording']['rawAttributes']);_0x178996[_0xb0d0('0x3e')]=_['keys'](_0x6c06c1[_0xb0d0('0x3e')]);_0x178996['filters']=_[_0xb0d0('0xcb')](_0x178996[_0xb0d0('0xca')],_0x178996['query']);_0x19812d[_0xb0d0('0x51')]=_[_0xb0d0('0xcb')](_0x178996[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0x6c06c1[_0xb0d0('0x3e')]['fields']));_0x19812d[_0xb0d0('0x51')]=_0x19812d[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0x19812d[_0xb0d0('0x51')]:_0x178996[_0xb0d0('0xca')];if(!_0x6c06c1['query'][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x19812d[_0xb0d0('0x1a')]=qs[_0xb0d0('0x1a')](_0x6c06c1['query'][_0xb0d0('0x1a')]);_0x19812d[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x6c06c1[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}_0x19812d['order']=qs['sort'](_0x6c06c1[_0xb0d0('0x3e')]['sort']);_0x19812d[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x6c06c1[_0xb0d0('0x3e')],_0x178996['filters']));_0x19812d[_0xb0d0('0x3d')][_0xb0d0('0xd9')]=_0x1dd5f0['id'];if(_0x6c06c1[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x19812d[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x19812d['where'],{'$or':_[_0xb0d0('0x2b')](_0x19812d[_0xb0d0('0x51')],function(_0x597f96){var _0x25a9f5={};_0x25a9f5[_0x597f96]={'$like':'%'+_0x6c06c1[_0xb0d0('0x3e')][_0xb0d0('0x29')]+'%'};return _0x25a9f5;})});}_0x19812d=_[_0xb0d0('0x50')]({},_0x19812d,_0x6c06c1[_0xb0d0('0xcf')]);return db['ScreenRecording'][_0xb0d0('0x18')]({'where':_0x19812d[_0xb0d0('0x3d')]})['then'](function(_0x305dbe){_0x18731e[_0xb0d0('0x18')]=_0x305dbe;if(_0x6c06c1[_0xb0d0('0x3e')][_0xb0d0('0x3f')]){_0x19812d[_0xb0d0('0x40')]=[{'all':!![]}];}return db[_0xb0d0('0xda')][_0xb0d0('0x43')](_0x19812d);})['then'](function(_0x1fc401){_0x18731e['rows']=_0x1fc401;return _0x18731e;});}})[_0xb0d0('0x1c')](respondWithFilteredResult(_0x446690,_0x19812d))[_0xb0d0('0x4b')](handleError(_0x446690,null));};exports[_0xb0d0('0xdb')]=function(_0x56d1dc,_0x5e81b4){var _0x22b874={};var _0xbe5d35={};var _0x5551e7;var _0x326cfa;return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x56d1dc['params']['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x5e81b4,null))[_0xb0d0('0x1c')](function(_0x14a083){if(_0x14a083){_0x5551e7=_0x14a083;_0xbe5d35[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xdc')]['rawAttributes']);_0xbe5d35[_0xb0d0('0x3e')]=_[_0xb0d0('0xc8')](_0x56d1dc[_0xb0d0('0x3e')]);_0xbe5d35[_0xb0d0('0xc9')]=_[_0xb0d0('0xcb')](_0xbe5d35[_0xb0d0('0xca')],_0xbe5d35[_0xb0d0('0x3e')]);_0x22b874[_0xb0d0('0x51')]=_['intersection'](_0xbe5d35[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0x56d1dc[_0xb0d0('0x3e')][_0xb0d0('0xd2')]));_0x22b874['attributes']=_0x22b874[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0x22b874[_0xb0d0('0x51')]:_0xbe5d35[_0xb0d0('0xca')];_0x22b874[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x56d1dc[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0x22b874[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x56d1dc['query'],_0xbe5d35[_0xb0d0('0xc9')]));if(_0x56d1dc['query'][_0xb0d0('0x29')]){_0x22b874[_0xb0d0('0x3d')]=_['merge'](_0x22b874['where'],{'$or':_['map'](_0x22b874[_0xb0d0('0x51')],function(_0x497bfc){var _0x4fca53={};_0x4fca53[_0x497bfc]={'$like':'%'+_0x56d1dc[_0xb0d0('0x3e')][_0xb0d0('0x29')]+'%'};return _0x4fca53;})});}_0x22b874=_['merge']({},_0x22b874,_0x56d1dc[_0xb0d0('0xcf')]);return _0x5551e7[_0xb0d0('0xdb')](_0x22b874);}})[_0xb0d0('0x1c')](function(_0x1f9dfa){if(_0x1f9dfa){_0x326cfa=_0x1f9dfa[_0xb0d0('0x45')];if(!_0x56d1dc['query'][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x22b874[_0xb0d0('0x1a')]=qs['limit'](_0x56d1dc['query']['limit']);_0x22b874[_0xb0d0('0x19')]=qs['offset'](_0x56d1dc['query'][_0xb0d0('0x19')]);}return _0x5551e7[_0xb0d0('0xdb')](_0x22b874);}})[_0xb0d0('0x1c')](function(_0xb41b7c){if(_0xb41b7c){return _0xb41b7c?{'count':_0x326cfa,'rows':_0xb41b7c}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0x5e81b4,null))['catch'](handleError(_0x5e81b4,null));};exports[_0xb0d0('0xdd')]=function(_0x12621e,_0x5da893){var _0x3dc349={};var _0x4506c1={};var _0x36a23b;var _0xf7071b;return db['User']['findOne']({'where':{'id':_0x12621e[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x5da893,null))[_0xb0d0('0x1c')](function(_0x24572f){if(_0x24572f){_0x36a23b=_0x24572f;_0x4506c1[_0xb0d0('0xca')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x4506c1[_0xb0d0('0x3e')]=_['keys'](_0x12621e['query']);_0x4506c1['filters']=_['intersection'](_0x4506c1[_0xb0d0('0xca')],_0x4506c1[_0xb0d0('0x3e')]);_0x3dc349[_0xb0d0('0x51')]=_[_0xb0d0('0xcb')](_0x4506c1[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0x12621e['query'][_0xb0d0('0xd2')]));_0x3dc349['attributes']=_0x3dc349['attributes'][_0xb0d0('0x45')]?_0x3dc349[_0xb0d0('0x51')]:_0x4506c1[_0xb0d0('0xca')];_0x3dc349[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x12621e[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0x3dc349[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x12621e[_0xb0d0('0x3e')],_0x4506c1[_0xb0d0('0xc9')]));if(_0x12621e[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x3dc349[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x3dc349['where'],{'$or':_[_0xb0d0('0x2b')](_0x3dc349[_0xb0d0('0x51')],function(_0x756961){var _0x5b7510={};_0x5b7510[_0x756961]={'$like':'%'+_0x12621e[_0xb0d0('0x3e')][_0xb0d0('0x29')]+'%'};return _0x5b7510;})});}_0x3dc349=_['merge']({},_0x3dc349,_0x12621e[_0xb0d0('0xcf')]);return _0x36a23b[_0xb0d0('0xdd')](_0x3dc349);}})[_0xb0d0('0x1c')](function(_0xb6d8fa){if(_0xb6d8fa){_0xf7071b=_0xb6d8fa[_0xb0d0('0x45')];if(!_0x12621e[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x3dc349[_0xb0d0('0x1a')]=qs['limit'](_0x12621e[_0xb0d0('0x3e')]['limit']);_0x3dc349[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x12621e[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}return _0x36a23b[_0xb0d0('0xdd')](_0x3dc349);}})[_0xb0d0('0x1c')](function(_0x135d3a){if(_0x135d3a){return _0x135d3a?{'count':_0xf7071b,'rows':_0x135d3a}:null;}})['then'](respondWithResult(_0x5da893,null))[_0xb0d0('0x4b')](handleError(_0x5da893,null));};exports[_0xb0d0('0xde')]=function(_0x5c6d7b,_0x925a28){var _0x59ceee={'raw':!![],'where':{}};var _0x4a94f9={};var _0x46ec4f={'count':0x0,'rows':[]};return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x5c6d7b[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x925a28,null))[_0xb0d0('0x1c')](function(_0x5d150d){if(_0x5d150d){_0x4a94f9['model']=_[_0xb0d0('0xc8')](db[_0xb0d0('0xdf')][_0xb0d0('0x34')]);_0x4a94f9[_0xb0d0('0x3e')]=_[_0xb0d0('0xc8')](_0x5c6d7b[_0xb0d0('0x3e')]);_0x4a94f9['filters']=_['intersection'](_0x4a94f9[_0xb0d0('0xca')],_0x4a94f9[_0xb0d0('0x3e')]);_0x59ceee[_0xb0d0('0x51')]=_['intersection'](_0x4a94f9[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0xd2')]));_0x59ceee[_0xb0d0('0x51')]=_0x59ceee[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0x59ceee[_0xb0d0('0x51')]:_0x4a94f9[_0xb0d0('0xca')];if(!_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x59ceee[_0xb0d0('0x1a')]=qs[_0xb0d0('0x1a')](_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0x1a')]);_0x59ceee['offset']=qs[_0xb0d0('0x19')](_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}_0x59ceee[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0x59ceee[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x5c6d7b['query'],_0x4a94f9[_0xb0d0('0xc9')]));_0x59ceee[_0xb0d0('0x3d')][_0xb0d0('0xd9')]=_0x5d150d['id'];if(_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x59ceee[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x59ceee['where'],{'$or':_[_0xb0d0('0x2b')](_0x59ceee['attributes'],function(_0x5d7a3b){var _0x1a5314={};_0x1a5314[_0x5d7a3b]={'$like':'%'+_0x5c6d7b['query'][_0xb0d0('0x29')]+'%'};return _0x1a5314;})});}_0x59ceee=_[_0xb0d0('0x50')]({},_0x59ceee,_0x5c6d7b['options']);return db[_0xb0d0('0xdf')][_0xb0d0('0x18')]({'where':_0x59ceee[_0xb0d0('0x3d')]})['then'](function(_0x1dd0a5){_0x46ec4f[_0xb0d0('0x18')]=_0x1dd0a5;if(_0x5c6d7b[_0xb0d0('0x3e')][_0xb0d0('0x3f')]){_0x59ceee[_0xb0d0('0x40')]=[{'all':!![]}];}return db[_0xb0d0('0xdf')][_0xb0d0('0x43')](_0x59ceee);})[_0xb0d0('0x1c')](function(_0x6456c){_0x46ec4f[_0xb0d0('0x44')]=_0x6456c;return _0x46ec4f;});}})[_0xb0d0('0x1c')](respondWithFilteredResult(_0x925a28,_0x59ceee))[_0xb0d0('0x4b')](handleError(_0x925a28,null));};exports[_0xb0d0('0xe0')]=function(_0x896856,_0x4c5adc){var _0x4e07b2={};var _0x4c52eb={};var _0x1daa9a;var _0x12b2cd;return db['User']['findOne']({'where':{'id':_0x896856[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x4c5adc,null))[_0xb0d0('0x1c')](function(_0x34f2d8){if(_0x34f2d8){_0x1daa9a=_0x34f2d8;_0x4c52eb[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xe1')]['rawAttributes']);_0x4c52eb[_0xb0d0('0x3e')]=_[_0xb0d0('0xc8')](_0x896856[_0xb0d0('0x3e')]);_0x4c52eb[_0xb0d0('0xc9')]=_[_0xb0d0('0xcb')](_0x4c52eb['model'],_0x4c52eb['query']);_0x4e07b2['attributes']=_[_0xb0d0('0xcb')](_0x4c52eb['model'],qs['fields'](_0x896856['query'][_0xb0d0('0xd2')]));_0x4e07b2[_0xb0d0('0x51')]=_0x4e07b2[_0xb0d0('0x51')]['length']?_0x4e07b2['attributes']:_0x4c52eb[_0xb0d0('0xca')];_0x4e07b2['order']=qs[_0xb0d0('0xcd')](_0x896856[_0xb0d0('0x3e')]['sort']);_0x4e07b2['where']=qs['filters'](_['pick'](_0x896856[_0xb0d0('0x3e')],_0x4c52eb[_0xb0d0('0xc9')]));if(_0x896856[_0xb0d0('0x3e')]['filter']){_0x4e07b2['where']=_[_0xb0d0('0x50')](_0x4e07b2[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x4e07b2[_0xb0d0('0x51')],function(_0x3ffa17){var _0x5d9feb={};_0x5d9feb[_0x3ffa17]={'$like':'%'+_0x896856[_0xb0d0('0x3e')]['filter']+'%'};return _0x5d9feb;})});}_0x4e07b2=_[_0xb0d0('0x50')]({},_0x4e07b2,_0x896856['options']);return _0x1daa9a[_0xb0d0('0xe0')](_0x4e07b2);}})[_0xb0d0('0x1c')](function(_0x41fa85){if(_0x41fa85){_0x12b2cd=_0x41fa85[_0xb0d0('0x45')];if(!_0x896856['query'][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x4e07b2['limit']=qs[_0xb0d0('0x1a')](_0x896856[_0xb0d0('0x3e')]['limit']);_0x4e07b2[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x896856[_0xb0d0('0x3e')]['offset']);}return _0x1daa9a['getSmsInteractions'](_0x4e07b2);}})[_0xb0d0('0x1c')](function(_0x5ef365){if(_0x5ef365){return _0x5ef365?{'count':_0x12b2cd,'rows':_0x5ef365}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0x4c5adc,null))['catch'](handleError(_0x4c5adc,null));};exports[_0xb0d0('0xe2')]=function(_0x28321c,_0xb9ac68){var _0x593d5e={};var _0x4065e4={};var _0x77f52e;var _0x28aa1b;return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x28321c[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0xb9ac68,null))[_0xb0d0('0x1c')](function(_0x450e6e){if(_0x450e6e){_0x77f52e=_0x450e6e;_0x4065e4[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xe3')][_0xb0d0('0x34')]);_0x4065e4[_0xb0d0('0x3e')]=_['keys'](_0x28321c[_0xb0d0('0x3e')]);_0x4065e4['filters']=_['intersection'](_0x4065e4[_0xb0d0('0xca')],_0x4065e4[_0xb0d0('0x3e')]);_0x593d5e[_0xb0d0('0x51')]=_['intersection'](_0x4065e4[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0x28321c[_0xb0d0('0x3e')][_0xb0d0('0xd2')]));_0x593d5e[_0xb0d0('0x51')]=_0x593d5e['attributes']['length']?_0x593d5e[_0xb0d0('0x51')]:_0x4065e4[_0xb0d0('0xca')];_0x593d5e[_0xb0d0('0xcc')]=qs['sort'](_0x28321c[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0x593d5e[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x28321c[_0xb0d0('0x3e')],_0x4065e4[_0xb0d0('0xc9')]));if(_0x28321c[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x593d5e[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x593d5e['where'],{'$or':_[_0xb0d0('0x2b')](_0x593d5e[_0xb0d0('0x51')],function(_0x3f2d4e){var _0x4b9b0b={};_0x4b9b0b[_0x3f2d4e]={'$like':'%'+_0x28321c[_0xb0d0('0x3e')]['filter']+'%'};return _0x4b9b0b;})});}_0x593d5e=_[_0xb0d0('0x50')]({},_0x593d5e,_0x28321c[_0xb0d0('0xcf')]);return _0x77f52e[_0xb0d0('0xe2')](_0x593d5e);}})[_0xb0d0('0x1c')](function(_0x4c0881){if(_0x4c0881){_0x28aa1b=_0x4c0881[_0xb0d0('0x45')];if(!_0x28321c[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x593d5e['limit']=qs[_0xb0d0('0x1a')](_0x28321c['query'][_0xb0d0('0x1a')]);_0x593d5e[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x28321c[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}return _0x77f52e[_0xb0d0('0xe2')](_0x593d5e);}})['then'](function(_0x2aaa52){if(_0x2aaa52){return _0x2aaa52?{'count':_0x28aa1b,'rows':_0x2aaa52}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0xb9ac68,null))[_0xb0d0('0x4b')](handleError(_0xb9ac68,null));};exports[_0xb0d0('0xe4')]=function(_0x1a7630,_0x1bef75){var _0xe6d01b={};var _0x401a74={};var _0x2ecfb;var _0x5bd8ed;return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x1a7630['params']['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x1bef75,null))[_0xb0d0('0x1c')](function(_0x587cb0){if(_0x587cb0){_0x2ecfb=_0x587cb0;_0x401a74[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db['WhatsappInteraction'][_0xb0d0('0x34')]);_0x401a74[_0xb0d0('0x3e')]=_['keys'](_0x1a7630[_0xb0d0('0x3e')]);_0x401a74[_0xb0d0('0xc9')]=_[_0xb0d0('0xcb')](_0x401a74['model'],_0x401a74[_0xb0d0('0x3e')]);_0xe6d01b['attributes']=_[_0xb0d0('0xcb')](_0x401a74[_0xb0d0('0xca')],qs['fields'](_0x1a7630['query'][_0xb0d0('0xd2')]));_0xe6d01b[_0xb0d0('0x51')]=_0xe6d01b[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0xe6d01b[_0xb0d0('0x51')]:_0x401a74[_0xb0d0('0xca')];_0xe6d01b[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x1a7630[_0xb0d0('0x3e')][_0xb0d0('0xcd')]);_0xe6d01b[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x1a7630[_0xb0d0('0x3e')],_0x401a74[_0xb0d0('0xc9')]));if(_0x1a7630[_0xb0d0('0x3e')]['filter']){_0xe6d01b[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0xe6d01b[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0xe6d01b['attributes'],function(_0x59f47e){var _0x50d06d={};_0x50d06d[_0x59f47e]={'$like':'%'+_0x1a7630['query'][_0xb0d0('0x29')]+'%'};return _0x50d06d;})});}_0xe6d01b=_['merge']({},_0xe6d01b,_0x1a7630[_0xb0d0('0xcf')]);return _0x2ecfb[_0xb0d0('0xe4')](_0xe6d01b);}})[_0xb0d0('0x1c')](function(_0x517974){if(_0x517974){_0x5bd8ed=_0x517974[_0xb0d0('0x45')];if(!_0x1a7630[_0xb0d0('0x3e')][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0xe6d01b[_0xb0d0('0x1a')]=qs[_0xb0d0('0x1a')](_0x1a7630[_0xb0d0('0x3e')][_0xb0d0('0x1a')]);_0xe6d01b['offset']=qs[_0xb0d0('0x19')](_0x1a7630[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}return _0x2ecfb[_0xb0d0('0xe4')](_0xe6d01b);}})['then'](function(_0x5d5f9b){if(_0x5d5f9b){return _0x5d5f9b?{'count':_0x5bd8ed,'rows':_0x5d5f9b}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0x1bef75,null))[_0xb0d0('0x4b')](handleError(_0x1bef75,null));};exports[_0xb0d0('0xe5')]=function(_0x27dbd5,_0x1982df,_0x1faca2){var _0x292dfc;var _0xc3a7da;var _0x4b7543;var _0x3ae005=!_[_0xb0d0('0x61')](_0x27dbd5[_0xb0d0('0x4c')]['id'])?_0x27dbd5[_0xb0d0('0x4c')]['id']:!_['isNil'](_0x27dbd5['user']['id'])?_0x27dbd5[_0xb0d0('0x24')]['id']:null;return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x3ae005,'role':{'$or':['admin',_0xb0d0('0x24'),_0xb0d0('0x26')]}},'attributes':['id',_0xb0d0('0x2e'),_0xb0d0('0xe6'),'mobile',_0xb0d0('0x1d'),_0xb0d0('0x5a'),_0xb0d0('0xe7')]})[_0xb0d0('0x1c')](function(_0x235668){if(_0x235668){if(_0x235668[_0xb0d0('0x1d')]===_0xb0d0('0x26')){_0x292dfc=_0x235668;if(_0x27dbd5['body'][_0xb0d0('0x9f')]){_0x4b7543=util[_0xb0d0('0xbf')](_0xb0d0('0xe8'),_0x292dfc[_0x27dbd5[_0xb0d0('0x55')][_0xb0d0('0x9f')]]);}else if(_0x27dbd5[_0xb0d0('0x55')][_0xb0d0('0xe9')]){_0x4b7543=util[_0xb0d0('0xbf')](_0xb0d0('0x9e'),_0x27dbd5[_0xb0d0('0x55')][_0xb0d0('0xe9')]);}else{_0x4b7543=util[_0xb0d0('0xbf')](_0xb0d0('0x9e'),_0x292dfc[_0xb0d0('0x2e')]);}socket['to'](util[_0xb0d0('0xbf')](_0xb0d0('0xea'),_0x292dfc['name']))[_0xb0d0('0x1e')](_0xb0d0('0xeb'),{'user':{'id':_0x292dfc['id'],'name':_0x292dfc[_0xb0d0('0x2e')]},'ip':_0x27dbd5['headers']['x-forwarded-for']||_0x27dbd5[_0xb0d0('0xec')][_0xb0d0('0xed')]||_0x27dbd5['socket'][_0xb0d0('0xed')]||_0x27dbd5[_0xb0d0('0xec')][_0xb0d0('0xee')][_0xb0d0('0xed')]});return db['UserVoiceQueueRt'][_0xb0d0('0x20')]({'where':{'membername':_0x292dfc['name']},'individualHooks':!![]});}}else{throw new db[(_0xb0d0('0x86'))][(_0xb0d0('0x87'))](_0xb0d0('0xef'));}})[_0xb0d0('0x1c')](function(){if(_0x292dfc){return _0x292dfc[_0xb0d0('0xf0')]({'raw':!![]});}})[_0xb0d0('0x1c')](function(_0x109bba){if(_0x292dfc){if(_0x109bba){_0xc3a7da=_0x109bba;if(_0xc3a7da['length']){var _0x326232=_0xc3a7da[_0xb0d0('0x2b')](function(_0x451e7f){var _0x2e99b2={'membername':_0x292dfc[_0xb0d0('0x2e')],'UserId':_0x292dfc['id'],'queue_name':_0x451e7f[_0xb0d0('0x2e')],'VoiceQueueId':_0x451e7f['id'],'interface':_0x4b7543,'paused':_0x292dfc[_0xb0d0('0xe7')]||![],'penalty':_0x451e7f[_0xb0d0('0xf1')]||0x0};return db[_0xb0d0('0xa1')][_0xb0d0('0xa2')](_0x2e99b2);});return Promise['all'](_0x326232);}}}})[_0xb0d0('0x1c')](function(){if(_0x292dfc){return db['MemberReport'][_0xb0d0('0x43')]({'where':{'membername':_0x292dfc['name'],'exitAt':null}});}})[_0xb0d0('0x1c')](function(_0x14148c){if(_0x292dfc){var _0xbf9d8f=[];_0x14148c[_0xb0d0('0xf2')](function(_0xc9c93){_0xbf9d8f['push'](_0xc9c93[_0xb0d0('0x1b')]({'exitAt':moment()[_0xb0d0('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xb0d0('0x4a')](_0xbf9d8f);}})[_0xb0d0('0x1c')](function(){if(_0x292dfc){var _0x486f9e=[];var _0x39f07f=[];var _0x454779=utils['getChannels']();var _0x5e4768={'membername':_0x292dfc[_0xb0d0('0x2e')],'interface':_0x4b7543,'enterAt':moment()[_0xb0d0('0xbf')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x292dfc[_0xb0d0('0x1d')],'internal':_0x292dfc['internal']};_0x454779[_0xb0d0('0xf2')](function(_0x5de7ef){_0x486f9e[_0xb0d0('0x42')](_[_0xb0d0('0x50')]({'channel':_0x5de7ef,'type':_0xb0d0('0xf3'),'data1':_0x27dbd5[_0xb0d0('0x55')]['device'],'data2':_0x4b7543},_0x5e4768));if(_0x292dfc[_0xb0d0('0xe7')]){_0x39f07f[_0xb0d0('0x42')](_[_0xb0d0('0x50')]({'channel':_0x5de7ef,'type':'PAUSE','data1':_0xb0d0('0xf4')},_0x5e4768));}});return db[_0xb0d0('0xf5')][_0xb0d0('0x80')](_0x486f9e[_0xb0d0('0xf6')](_0x39f07f),{'individualHooks':!![]});}})[_0xb0d0('0x1c')](function(){if(_0x292dfc){return _0x292dfc['update']({'online':!![],'lastLoginAt':moment()[_0xb0d0('0xbf')](_0xb0d0('0xf7')),'voicePause':_0x292dfc['loginInPause']||![],'mailPause':_0x292dfc[_0xb0d0('0xe7')]||![],'chatPause':_0x292dfc[_0xb0d0('0xe7')]||![],'faxPause':_0x292dfc[_0xb0d0('0xe7')]||![],'smsPause':_0x292dfc[_0xb0d0('0xe7')]||![],'openchannelPause':_0x292dfc[_0xb0d0('0xe7')]||![],'whatsappPause':_0x292dfc[_0xb0d0('0xe7')]||![],'pauseType':_0x292dfc[_0xb0d0('0xe7')]?_0xb0d0('0xf4'):null,'interface':_0x4b7543,'lastPauseAt':moment()[_0xb0d0('0xbf')](_0xb0d0('0xf7'))});}})[_0xb0d0('0x1c')](function(_0x368e0c){if(_0x27dbd5['isMiddleware']){return _0x1faca2();}else{return Promise[_0xb0d0('0xf8')](_0x368e0c)[_0xb0d0('0x1c')](respondWithResult(_0x1982df,null));}})[_0xb0d0('0x4b')](handleError(_0x1982df,null));};exports[_0xb0d0('0xf9')]=function(_0x3e7b4c,_0x3b3d6a){var _0x49b1ed;return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x3e7b4c[_0xb0d0('0x4c')]['id'],'role':_0xb0d0('0x26')},'attributes':['id',_0xb0d0('0x2e'),'role']})[_0xb0d0('0x1c')](handleEntityNotFound(_0x3b3d6a,null))['then'](function(_0x42c891){if(_0x42c891){_0x49b1ed=_0x42c891;return db[_0xb0d0('0xa1')]['destroy']({'where':{'membername':_0x49b1ed['name']},'individualHooks':!![]});}})[_0xb0d0('0x1c')](function(){return db[_0xb0d0('0xf5')][_0xb0d0('0x43')]({'where':{'membername':_0x49b1ed[_0xb0d0('0x2e')],'exitAt':null}});})[_0xb0d0('0x1c')](function(_0x5bd5b4){var _0x44cb6a=[];_0x5bd5b4[_0xb0d0('0xf2')](function(_0x1fc2b9){_0x44cb6a['push'](_0x1fc2b9[_0xb0d0('0x1b')]({'exitAt':moment()[_0xb0d0('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xb0d0('0x4a')](_0x44cb6a);})[_0xb0d0('0x1c')](function(){return _0x49b1ed[_0xb0d0('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xb0d0('0x1c')](respondWithResult(_0x3b3d6a,null))[_0xb0d0('0x4b')](handleError(_0x3b3d6a,null));};exports[_0xb0d0('0xfa')]=function(_0x2d815a,_0x2f0e96){var _0x3237d8;return db[_0xb0d0('0xa1')][_0xb0d0('0x1b')]({'paused':0x1},{'where':{'UserId':_0x2d815a[_0xb0d0('0x4c')]['id']},'individualHooks':!![]})[_0xb0d0('0x1c')](function(){return db[_0xb0d0('0x33')]['find']({'where':{'id':_0x2d815a[_0xb0d0('0x4c')]['id'],'role':_0xb0d0('0x26')},'attributes':['id',_0xb0d0('0x2e'),'role',_0xb0d0('0x5a'),_0xb0d0('0x9f'),'online']});})[_0xb0d0('0x1c')](handleEntityNotFound(_0x2f0e96,null))[_0xb0d0('0x1c')](function(_0x40a382){if(_0x40a382){_0x3237d8=_0x40a382;return db[_0xb0d0('0xf5')]['findAll']({'where':{'membername':_0x3237d8[_0xb0d0('0x2e')],'type':_0xb0d0('0xfb'),'exitAt':null}});}})['then'](function(_0x2c320a){if(_0x2c320a[_0xb0d0('0x45')]){var _0x186b80=moment()[_0xb0d0('0xbf')](_0xb0d0('0xf7'));for(var _0x1fcf2c=0x0,_0x5b020c=_0x2c320a[_0xb0d0('0x45')];_0x1fcf2c<_0x5b020c;_0x1fcf2c++){_0x2c320a[_0x1fcf2c][_0xb0d0('0xfc')]({'exitAt':_0x186b80});}}})[_0xb0d0('0x1c')](function(){var _0x298849=[];var _0x4ebb5c=utils['getChannels']();_0x4ebb5c[_0xb0d0('0xf2')](function(_0x302083){_0x298849[_0xb0d0('0x42')]({'channel':_0x302083,'membername':_0x3237d8['name'],'interface':_[_0xb0d0('0x61')](_0x3237d8[_0xb0d0('0x9f')])?util[_0xb0d0('0xbf')](_0xb0d0('0x9e'),_0x3237d8[_0xb0d0('0x2e')]):_0x3237d8[_0xb0d0('0x9f')],'type':_0xb0d0('0xfb'),'enterAt':moment()[_0xb0d0('0xbf')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x2d815a[_0xb0d0('0x55')][_0xb0d0('0x36')]||_0xb0d0('0xfd'),'role':_0x3237d8[_0xb0d0('0x1d')],'internal':_0x3237d8['internal']});});return db[_0xb0d0('0xf5')]['bulkCreate'](_0x298849,{'individualHooks':!![]});})[_0xb0d0('0x1c')](function(){return _0x3237d8['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2d815a['body'][_0xb0d0('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xb0d0('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb0d0('0x1c')](respondWithResult(_0x2f0e96,null))[_0xb0d0('0x4b')](handleError(_0x2f0e96,null));};exports[_0xb0d0('0xfe')]=function(_0x13bb88,_0xcf1c38){if(_0x13bb88['body']['channel']&&!utils['isValidChannel'](_0x13bb88['body']['channel'])){throw new APIBadRequestError(util[_0xb0d0('0xbf')](_0xb0d0('0xff'),_0x13bb88['body']['channel']));}return db[_0xb0d0('0x33')][_0xb0d0('0x2d')]({'where':{'id':_0x13bb88[_0xb0d0('0x4c')]['id']},'attributes':['id','name',_0xb0d0('0x1d'),_0xb0d0('0x5a'),_0xb0d0('0x9f'),'online',_0xb0d0('0x93'),_0xb0d0('0x100'),'chatPause',_0xb0d0('0x101'),_0xb0d0('0x102'),_0xb0d0('0x103'),_0xb0d0('0x104'),'pauseType',_0xb0d0('0x105')]})[_0xb0d0('0x1c')](function(_0x7a59bc){if(!_0x7a59bc){throw new APINotFoundError(util[_0xb0d0('0xbf')]('User\x20with\x20id\x20%s\x20not\x20found',_0x13bb88[_0xb0d0('0x4c')]['id']));}return _0x7a59bc[_0xb0d0('0xfe')](_0x13bb88[_0xb0d0('0x55')][_0xb0d0('0xa4')]);})[_0xb0d0('0x1c')](respondWithResult(_0xcf1c38,null))[_0xb0d0('0x4b')](APIHandleError(_0xcf1c38));};exports[_0xb0d0('0x106')]=function(_0x4ef9d3,_0x8ee7fb){var _0x570f7b={};var _0x5c1707={};var _0x251c82;var _0x13a454;return db['User']['findOne']({'where':{'id':_0x4ef9d3[_0xb0d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8ee7fb,null))[_0xb0d0('0x1c')](function(_0x3849ff){if(_0x3849ff){_0x251c82=_0x3849ff;_0x5c1707[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0x107')][_0xb0d0('0x34')]);_0x5c1707['query']=_[_0xb0d0('0xc8')](_0x4ef9d3[_0xb0d0('0x3e')]);_0x5c1707[_0xb0d0('0xc9')]=_[_0xb0d0('0xcb')](_0x5c1707[_0xb0d0('0xca')],_0x5c1707[_0xb0d0('0x3e')]);_0x570f7b['attributes']=_[_0xb0d0('0xcb')](_0x5c1707[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0x4ef9d3[_0xb0d0('0x3e')][_0xb0d0('0xd2')]));_0x570f7b[_0xb0d0('0x51')]=_0x570f7b['attributes'][_0xb0d0('0x45')]?_0x570f7b[_0xb0d0('0x51')]:_0x5c1707[_0xb0d0('0xca')];_0x570f7b[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x4ef9d3[_0xb0d0('0x3e')]['sort']);_0x570f7b[_0xb0d0('0x3d')]=qs['filters'](_[_0xb0d0('0xce')](_0x4ef9d3[_0xb0d0('0x3e')],_0x5c1707['filters']));if(_0x4ef9d3[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x570f7b[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x570f7b[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x570f7b['attributes'],function(_0x399c2b){var _0x50a5a4={};_0x50a5a4[_0x399c2b]={'$like':'%'+_0x4ef9d3[_0xb0d0('0x3e')][_0xb0d0('0x29')]+'%'};return _0x50a5a4;})});}_0x570f7b=_[_0xb0d0('0x50')]({},_0x570f7b,_0x4ef9d3[_0xb0d0('0xcf')]);return _0x251c82[_0xb0d0('0x106')](_0x570f7b);}})[_0xb0d0('0x1c')](function(_0x44e513){if(_0x44e513){_0x13a454=_0x44e513[_0xb0d0('0x45')];if(!_0x4ef9d3['query'][_0xb0d0('0xc0')](_0xb0d0('0xd0'))){_0x570f7b[_0xb0d0('0x1a')]=qs['limit'](_0x4ef9d3[_0xb0d0('0x3e')][_0xb0d0('0x1a')]);_0x570f7b[_0xb0d0('0x19')]=qs[_0xb0d0('0x19')](_0x4ef9d3[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}return _0x251c82[_0xb0d0('0x106')](_0x570f7b);}})[_0xb0d0('0x1c')](function(_0x455b90){if(_0x455b90){return _0x455b90?{'count':_0x13a454,'rows':_0x455b90}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0x8ee7fb,null))[_0xb0d0('0x4b')](handleError(_0x8ee7fb,null));};exports['addTeams']=function(_0x52416f,_0x3a126a){var _0x558128=_0x52416f['params']['id'];var _0x391710=_0x52416f[_0xb0d0('0x55')]?_0x52416f[_0xb0d0('0x55')][_0xb0d0('0x58')]:null;var _0x3229ff=[];return Promise['resolve']()[_0xb0d0('0x1c')](function(){if(!_0x391710)throw new APIBadRequestError(_0xb0d0('0x108'));})['then'](function(){return db[_0xb0d0('0x33')]['findOne']({'where':{'id':_0x558128}});})[_0xb0d0('0x1c')](function(_0x3241c5){if(!_0x3241c5)throw new APINotFoundError(util[_0xb0d0('0xbf')](_0xb0d0('0x109'),_0x52416f[_0xb0d0('0x4c')]['id']));return db[_0xb0d0('0x64')][_0xb0d0('0x10a')](function(_0x325d31){return _0x3241c5[_0xb0d0('0x10b')](_0x391710,{'transaction':_0x325d31})[_0xb0d0('0x1c')](function(){return db[_0xb0d0('0x107')][_0xb0d0('0x43')]({'where':{'id':{'$in':_0x391710}}});})[_0xb0d0('0x1c')](function(_0x5308c3){var _0x39473e=_[_0xb0d0('0x2b')](_0x5308c3,function(_0x53136a){return _0x53136a[_0xb0d0('0x10c')]();});return Promise[_0xb0d0('0x4a')](_0x39473e);})['then'](function(_0x560499){_0x3229ff=_[_0xb0d0('0x10d')](_0x560499);var _0x55d50e=_[_0xb0d0('0x2b')](_0x3229ff,function(_0x425d97){return _0x425d97[_0xb0d0('0x10e')](_0x3241c5['id'],{'transaction':_0x325d31});});return Promise[_0xb0d0('0x4a')](_0x55d50e);})[_0xb0d0('0x1c')](function(){if(!_0x3241c5['online'])return;var _0x378d14=_[_0xb0d0('0x29')](_0x3229ff,function(_0x22fdfd){return _0x22fdfd[_0xb0d0('0x10f')](_0xb0d0('0xa4'))===_0xb0d0('0x110');});var _0x1982cc=_[_0xb0d0('0x2b')](_0x378d14,function(_0x2b1c3d){return db[_0xb0d0('0xa1')][_0xb0d0('0xa2')]({'membername':_0x3241c5['name'],'UserId':_0x3241c5['id'],'queue_name':_0x2b1c3d['name'],'VoiceQueueId':_0x2b1c3d['id'],'interface':_[_0xb0d0('0x61')](_0x3241c5[_0xb0d0('0x9f')])?util[_0xb0d0('0xbf')]('SIP/%s',_0x3241c5[_0xb0d0('0x2e')]):_0x3241c5['interface'],'paused':_0x3241c5[_0xb0d0('0x93')]||![],'penalty':_0x3241c5[_0xb0d0('0xa0')]},{'transaction':_0x325d31});});return Promise['all'](_0x1982cc);})['then'](function(){return db[_0xb0d0('0x111')]['findAll']({'where':{'teamId':{'$in':_0x391710}}});})['then'](function(_0xc8b87e){var _0x1a8190=_[_0xb0d0('0x2b')](_0xc8b87e,function(_0x24ea38){return db['UserVoicePrefix'][_0xb0d0('0x77')]({'UserId':_0x3241c5['id'],'VoicePrefixId':_0x24ea38[_0xb0d0('0x112')]},{'transaction':_0x325d31});});return Promise[_0xb0d0('0x4a')](_0x1a8190);});});})[_0xb0d0('0x1c')](function(){for(var _0x366a45=0x0;_0x366a45<_0x3229ff['length'];_0x366a45++){var _0xd6321=_0x3229ff[_0x366a45][_0xb0d0('0x10f')]('channel');var _0x463b20=_0xd6321+_0xb0d0('0x9a');socket[_0xb0d0('0x1e')](_0xb0d0('0x24')+_0xd6321+_0xb0d0('0x9b'),{'UserId':_0x558128,['queueField']:_0x3229ff[_0x366a45]['id']});}})[_0xb0d0('0x1c')](respondWithStatusCode(_0x3a126a,null))['catch'](APIHandleError(_0x3a126a));};exports[_0xb0d0('0x113')]=function(_0x371338,_0x5d4c39){var _0x2879d5=_0x371338['params']['id'];var _0x3387dc=null;if(_0x371338[_0xb0d0('0x3e')][_0xb0d0('0x58')]){_0x3387dc=_[_0xb0d0('0x114')](_0x371338['query'][_0xb0d0('0x58')])?_0x371338[_0xb0d0('0x3e')][_0xb0d0('0x58')]:[_0x371338[_0xb0d0('0x3e')]['ids']];}var _0x37f74d=[];return Promise[_0xb0d0('0xf8')]()[_0xb0d0('0x1c')](function(){if(!_0x3387dc)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xb0d0('0x1c')](function(){return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x2879d5}});})[_0xb0d0('0x1c')](function(_0x347dbe){if(!_0x347dbe)throw new APINotFoundError(util[_0xb0d0('0xbf')](_0xb0d0('0x109'),_0x371338[_0xb0d0('0x4c')]['id']));return db[_0xb0d0('0x64')][_0xb0d0('0x10a')](function(_0x374b72){return _0x347dbe['removeTeams'](_0x3387dc,{'transaction':_0x374b72})[_0xb0d0('0x1c')](function(){return db[_0xb0d0('0x107')]['findAll']({'where':{'id':{'$in':_0x3387dc}}});})['then'](function(_0x5494c8){var _0x152122=_[_0xb0d0('0x2b')](_0x5494c8,function(_0x2f5dcd){return _0x2f5dcd[_0xb0d0('0x10c')]();});return Promise[_0xb0d0('0x4a')](_0x152122);})[_0xb0d0('0x1c')](function(_0x2c3096){_0x37f74d=_[_0xb0d0('0x10d')](_0x2c3096);var _0x64569b=_['map'](_0x37f74d,function(_0x36a085){return _0x36a085[_0xb0d0('0x115')](_0x347dbe['id'],{'transaction':_0x374b72});});return Promise[_0xb0d0('0x4a')](_0x64569b);})[_0xb0d0('0x1c')](function(){if(!_0x347dbe[_0xb0d0('0x92')])return;var _0x5c9e43=_[_0xb0d0('0x29')](_0x37f74d,function(_0x2d881a){return _0x2d881a[_0xb0d0('0x10f')](_0xb0d0('0xa4'))===_0xb0d0('0x110');});var _0x54cda8=_[_0xb0d0('0x2b')](_0x5c9e43,function(_0x23a3a8){return db[_0xb0d0('0xa1')][_0xb0d0('0x20')]({'where':{'VoiceQueueId':_0x23a3a8['id'],'UserId':_0x347dbe['id']},'transaction':_0x374b72});});return Promise[_0xb0d0('0x4a')](_0x54cda8);})[_0xb0d0('0x1c')](function(){return db[_0xb0d0('0x111')][_0xb0d0('0x43')]({'where':{'teamId':{'$in':_0x3387dc}}});})['then'](function(_0x4f5b7f){var _0x5eb2cb=_[_0xb0d0('0x2b')](_0x4f5b7f,function(_0x27a3c0){return db['UserVoicePrefix'][_0xb0d0('0x20')]({'where':{'UserId':_0x347dbe['id'],'VoicePrefixId':_0x27a3c0['VoicePrefixId']}},{'transaction':_0x374b72});});return Promise[_0xb0d0('0x4a')](_0x5eb2cb);});});})['then'](function(){for(var _0x4f8f30=0x0;_0x4f8f30<_0x37f74d[_0xb0d0('0x45')];_0x4f8f30++){var _0x441f0a=_0x37f74d[_0x4f8f30][_0xb0d0('0x10f')]('channel');var _0x5781c2=_0x441f0a+_0xb0d0('0x9a');socket['emit'](_0xb0d0('0x24')+_0x441f0a+'Queue:remove',{'UserId':_0x2879d5,['queueField']:_0x37f74d[_0x4f8f30]['id']});}})['then'](respondWithStatusCode(_0x5d4c39,null))['catch'](APIHandleError(_0x5d4c39));};exports[_0xb0d0('0x116')]=function(_0x4788ef,_0x4bd130){var _0x30f786={};var _0x189c62={};var _0x4c8e18;var _0xf980c7;return db[_0xb0d0('0x33')][_0xb0d0('0x8e')]({'where':{'id':_0x4788ef[_0xb0d0('0x4c')]['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x4bd130,null))[_0xb0d0('0x1c')](function(_0x35756d){if(_0x35756d){_0x4c8e18=_0x35756d;_0x189c62[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0xc1')][_0xb0d0('0x34')]);_0x189c62[_0xb0d0('0x3e')]=_[_0xb0d0('0xc8')](_0x4788ef['query']);_0x189c62[_0xb0d0('0xc9')]=_[_0xb0d0('0xcb')](_0x189c62[_0xb0d0('0xca')],_0x189c62['query']);_0x30f786['attributes']=_[_0xb0d0('0xcb')](_0x189c62[_0xb0d0('0xca')],qs['fields'](_0x4788ef[_0xb0d0('0x3e')][_0xb0d0('0xd2')]));_0x30f786[_0xb0d0('0x51')]=_0x30f786[_0xb0d0('0x51')][_0xb0d0('0x45')]?_0x30f786[_0xb0d0('0x51')]:_0x189c62[_0xb0d0('0xca')];_0x30f786[_0xb0d0('0xcc')]=qs[_0xb0d0('0xcd')](_0x4788ef['query']['sort']);_0x30f786[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0x4788ef['query'],_0x189c62[_0xb0d0('0xc9')]));if(_0x4788ef[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x30f786[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x30f786[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x30f786[_0xb0d0('0x51')],function(_0x175a33){var _0x3b2590={};_0x3b2590[_0x175a33]={'$like':'%'+_0x4788ef['query'][_0xb0d0('0x29')]+'%'};return _0x3b2590;})});}_0x30f786=_['merge']({},_0x30f786,_0x4788ef['options']);return _0x4c8e18[_0xb0d0('0x116')](_0x30f786);}})['then'](function(_0x1ecec3){if(_0x1ecec3){_0xf980c7=_0x1ecec3[_0xb0d0('0x45')];if(!_0x4788ef[_0xb0d0('0x3e')][_0xb0d0('0xc0')]('nolimit')){_0x30f786['limit']=qs['limit'](_0x4788ef['query'][_0xb0d0('0x1a')]);_0x30f786['offset']=qs['offset'](_0x4788ef[_0xb0d0('0x3e')][_0xb0d0('0x19')]);}return _0x4c8e18['getLists'](_0x30f786);}})['then'](function(_0x589f06){if(_0x589f06){return _0x589f06?{'count':_0xf980c7,'rows':_0x589f06}:null;}})[_0xb0d0('0x1c')](respondWithResult(_0x4bd130,null))[_0xb0d0('0x4b')](handleError(_0x4bd130,null));};exports[_0xb0d0('0x117')]=function(_0xc8bd91,_0x1030bf){var _0x25d5f7={};var _0x90cc3b={};var _0x3838c5;return db[_0xb0d0('0x33')]['findOne']({'where':{'id':_0xc8bd91['params']['id']}})[_0xb0d0('0x1c')](handleEntityNotFound(_0x1030bf,null))[_0xb0d0('0x1c')](function(_0x14349f){if(_0x14349f){_0x3838c5=_0x14349f;_0x90cc3b[_0xb0d0('0xca')]=_[_0xb0d0('0xc8')](db[_0xb0d0('0x33')][_0xb0d0('0x34')]);_0x90cc3b[_0xb0d0('0x3e')]=_[_0xb0d0('0xc8')](_0xc8bd91['query']);_0x90cc3b[_0xb0d0('0xc9')]=_[_0xb0d0('0xcb')](_0x90cc3b[_0xb0d0('0xca')],_0x90cc3b['query']);_0x25d5f7[_0xb0d0('0x51')]=_[_0xb0d0('0xcb')](_0x90cc3b[_0xb0d0('0xca')],qs[_0xb0d0('0xd2')](_0xc8bd91['query'][_0xb0d0('0xd2')]));_0x25d5f7[_0xb0d0('0x51')]=_0x25d5f7[_0xb0d0('0x51')]['length']?_0x25d5f7['attributes']:_0x90cc3b[_0xb0d0('0xca')];_0x25d5f7['order']=qs[_0xb0d0('0xcd')](_0xc8bd91['query'][_0xb0d0('0xcd')]);_0x25d5f7[_0xb0d0('0x3d')]=qs[_0xb0d0('0xc9')](_[_0xb0d0('0xce')](_0xc8bd91[_0xb0d0('0x3e')],_0x90cc3b[_0xb0d0('0xc9')]));if(_0xc8bd91[_0xb0d0('0x3e')][_0xb0d0('0x29')]){_0x25d5f7[_0xb0d0('0x3d')]=_[_0xb0d0('0x50')](_0x25d5f7[_0xb0d0('0x3d')],{'$or':_[_0xb0d0('0x2b')](_0x25d5f7['attributes'],function(_0x34bf55){var _0x37e866={};_0x37e866[_0x34bf55]={'$like':'%'+_0xc8bd91[_0xb0d0('0x3e')]['filter']+'%'};return _0x37e866;})});}_0x25d5f7[_0xb0d0('0xca')]=db[_0xb0d0('0x33')];_0x25d5f7['as']=_0xb0d0('0x25');_0x25d5f7=_[_0xb0d0('0x50')]({},_0x25d5f7,_0xc8bd91[_0xb0d0('0xcf')]);return _0x3838c5[_0xb0d0('0xf0')]({'include':[_0x25d5f7]});}})[_0xb0d0('0x1c')](function(_0x297dc7){if(_0x297dc7){var _0xa42f92={},_0x4cd6f6=[];for(var _0x29b4b4=0x0;_0x29b4b4<_0x297dc7[_0xb0d0('0x45')];_0x29b4b4+=0x1){for(var _0x335c3a=0x0,_0x37fb4d;_0x335c3a<_0x297dc7[_0x29b4b4][_0xb0d0('0x25')]['length'];_0x335c3a+=0x1){_0x37fb4d=_0x297dc7[_0x29b4b4][_0xb0d0('0x25')][_0x335c3a][_0xb0d0('0x21')]({'plain':!![]});_0xa42f92[_0x37fb4d['id']]=_0x37fb4d;}}_0xa42f92=_[_0xb0d0('0x118')](_0xa42f92);for(var _0x55a93f=qs[_0xb0d0('0x19')](_0xc8bd91[_0xb0d0('0x3e')][_0xb0d0('0x19')]);_0x55a93f<_0xa42f92[_0xb0d0('0x45')]&&_0x4cd6f6[_0xb0d0('0x45')]=_0x1914fa[_0x4c15('0x4f')]){throw new Error(_0x4c15('0x50'));}})['then'](function(){if(_0x4c1b4b){return db[_0x4c15('0x22')][_0x4c15('0x51')]({'where':{'membername':_0x4c1b4b['name']},'individualHooks':!![]});}})['then'](function(){if(_0x4c1b4b){return _0x4c1b4b[_0x4c15('0x52')]({'raw':!![]});}})['then'](function(_0x8d141){if(_0x4c1b4b){if(_0x8d141){var _0x4baf7e=[];_0x4aa20b=_0x8d141;if(_0x4aa20b['length']){for(var _0x3ed729=0x0;_0x3ed729<_0x4aa20b[_0x4c15('0x27')];_0x3ed729++){_0x4baf7e[_0x4c15('0x45')](db[_0x4c15('0x22')]['upsert']({'membername':_0x4c1b4b['name'],'UserId':_0x4c1b4b['id'],'queue_name':_0x4aa20b[_0x3ed729][_0x4c15('0x25')],'VoiceQueueId':_0x4aa20b[_0x3ed729]['id'],'interface':_0x207850,'paused':_0x4c1b4b[_0x4c15('0x4a')]||![],'penalty':_0x4aa20b[_0x3ed729][_0x4c15('0x53')]||0x0}));}return BPromise['all'](_0x4baf7e);}}}})['then'](function(){if(_0x4c1b4b){return db[_0x4c15('0x32')][_0x4c15('0x24')]({'where':{'membername':_0x4c1b4b[_0x4c15('0x25')],'exitAt':null}});}})[_0x4c15('0x16')](function(_0x3b42ce){if(_0x4c1b4b){if(_0x3b42ce&&_0x3b42ce[_0x4c15('0x27')]){var _0x5e2e32=[];_0x3b42ce[_0x4c15('0x2b')](function(_0x28006f){_0x5e2e32[_0x4c15('0x45')](_0x28006f[_0x4c15('0x23')]({'exitAt':moment()[_0x4c15('0x21')](_0x4c15('0x28'))}));});return BPromise[_0x4c15('0x46')](_0x5e2e32);}}})[_0x4c15('0x16')](function(){if(_0x4c1b4b){var _0x2d6be9=[];var _0x1c0f42=[];var _0x21f7f5=utils[_0x4c15('0x2a')]();var _0x3803f5={'membername':_0x4c1b4b[_0x4c15('0x25')],'interface':_0x207850,'enterAt':moment()[_0x4c15('0x21')](_0x4c15('0x28')),'role':_0x4c1b4b[_0x4c15('0x1f')],'internal':_0x4c1b4b[_0x4c15('0x30')]};_0x21f7f5[_0x4c15('0x2b')](function(_0x5cdc5f){_0x2d6be9[_0x4c15('0x45')](_['merge']({'channel':_0x5cdc5f,'type':_0x4c15('0x54'),'data1':_0x4c15('0x55'),'data2':_0x207850},_0x3803f5));if(_0x4c1b4b[_0x4c15('0x4a')]){_0x1c0f42[_0x4c15('0x45')](_[_0x4c15('0x56')]({'channel':_0x5cdc5f,'type':_0x4c15('0x26'),'data1':_0x4c15('0x57')},_0x3803f5));}});return db['MemberReport'][_0x4c15('0x33')](_0x2d6be9[_0x4c15('0x58')](_0x1c0f42),{'individualHooks':!![]});}})[_0x4c15('0x16')](function(){if(_0x4c1b4b){return _0x4c1b4b[_0x4c15('0x23')]({'online':!![],'lastLoginAt':moment()[_0x4c15('0x21')](_0x4c15('0x28')),'voicePause':_0x4c1b4b[_0x4c15('0x4a')]||![],'mailPause':_0x4c1b4b[_0x4c15('0x4a')]||![],'chatPause':_0x4c1b4b[_0x4c15('0x4a')]||![],'faxPause':_0x4c1b4b[_0x4c15('0x4a')]||![],'smsPause':_0x4c1b4b[_0x4c15('0x4a')]||![],'openchannelPause':_0x4c1b4b[_0x4c15('0x4a')]||![],'pauseType':_0x4c1b4b[_0x4c15('0x4a')]?_0x4c15('0x57'):null,'lastPauseAt':moment()[_0x4c15('0x21')](_0x4c15('0x28')),'interface':_0x207850});}})[_0x4c15('0x16')](function(_0x22859e){_0x205051(_0x22859e);})[_0x4c15('0x1a')](function(_0x3f1e41){_0xc89359(_0x1d23bf[_0x4c15('0x1b')](0x1f4,_0x3f1e41[_0x4c15('0x15')]));});});}; \ No newline at end of file +var _0x65ed=['find','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','update','MemberReport','findAll','PAUSE','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','system','LogoutUser','findOne','UserVoiceQueueRt','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','length','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','concat','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','register','GetUser','options','where','attributes','limit','include','model','map','then','info','debug','stringify','error','message','raw','ShowUser','catch','PauseUser','User'];(function(_0x3a45db,_0x502490){var _0x59e4ca=function(_0x362486){while(--_0x362486){_0x3a45db['push'](_0x3a45db['shift']());}};_0x59e4ca(++_0x502490);}(_0x65ed,0x97));var _0xd65e=function(_0x3256bc,_0x957b5c){_0x3256bc=_0x3256bc-0x0;var _0x51f4b7=_0x65ed[_0x3256bc];return _0x51f4b7;};'use strict';var _=require(_0xd65e('0x0'));var util=require(_0xd65e('0x1'));var moment=require(_0xd65e('0x2'));var BPromise=require('bluebird');var Redis=require(_0xd65e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd65e('0x4'));var logger=require(_0xd65e('0x5'))(_0xd65e('0x6'));var config=require(_0xd65e('0x7'));config[_0xd65e('0x8')]=_[_0xd65e('0x9')](config[_0xd65e('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd65e('0xa'))(new Redis(config['redis']));require('./user.socket')[_0xd65e('0xb')](socket);exports[_0xd65e('0xc')]=function(_0x9e33a5){var _0xda54ce=this;return new Promise(function(_0x1d3f3e,_0x566070){return db['User']['findAll']({'raw':_0x9e33a5[_0xd65e('0xd')]?_0x9e33a5[_0xd65e('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x9e33a5[_0xd65e('0xd')]?_0x9e33a5[_0xd65e('0xd')][_0xd65e('0xe')]||null:null,'attributes':_0x9e33a5[_0xd65e('0xd')]?_0x9e33a5[_0xd65e('0xd')][_0xd65e('0xf')]||null:null,'limit':_0x9e33a5[_0xd65e('0xd')]?_0x9e33a5['options'][_0xd65e('0x10')]||null:null,'include':_0x9e33a5[_0xd65e('0xd')]?_0x9e33a5[_0xd65e('0xd')][_0xd65e('0x11')]?_['map'](_0x9e33a5[_0xd65e('0xd')][_0xd65e('0x11')],function(_0x4c8c76){return{'model':db[_0x4c8c76[_0xd65e('0x12')]],'as':_0x4c8c76['as'],'attributes':_0x4c8c76[_0xd65e('0xf')],'include':_0x4c8c76[_0xd65e('0x11')]?_['map'](_0x4c8c76[_0xd65e('0x11')],function(_0x4f7af6){return{'model':db[_0x4f7af6[_0xd65e('0x12')]],'as':_0x4f7af6['as'],'attributes':_0x4f7af6[_0xd65e('0xf')],'include':_0x4f7af6[_0xd65e('0x11')]?_[_0xd65e('0x13')](_0x4f7af6[_0xd65e('0x11')],function(_0x108f99){return{'model':db[_0x108f99[_0xd65e('0x12')]],'as':_0x108f99['as'],'attributes':_0x108f99[_0xd65e('0xf')]};}):[]};}):[]};}):[]:[]})[_0xd65e('0x14')](function(_0x21b384){logger[_0xd65e('0x15')](_0xd65e('0xc'),_0x9e33a5);logger[_0xd65e('0x16')](_0xd65e('0xc'),_0x9e33a5,JSON[_0xd65e('0x17')](_0x21b384));_0x1d3f3e(_0x21b384);})['catch'](function(_0x48022c){logger[_0xd65e('0x18')](_0xd65e('0xc'),_0x48022c[_0xd65e('0x19')],_0x9e33a5);_0x566070(_0xda54ce[_0xd65e('0x18')](0x1f4,_0x48022c[_0xd65e('0x19')]));});});};exports['ShowUser']=function(_0x25c694){var _0x4c993d=this;return new Promise(function(_0x184efd,_0x544564){return db['User']['find']({'raw':_0x25c694[_0xd65e('0xd')]?_0x25c694[_0xd65e('0xd')][_0xd65e('0x1a')]===undefined?!![]:![]:!![],'where':_0x25c694['options']?_0x25c694[_0xd65e('0xd')][_0xd65e('0xe')]||null:null,'attributes':_0x25c694[_0xd65e('0xd')]?_0x25c694[_0xd65e('0xd')][_0xd65e('0xf')]||null:null,'include':_0x25c694[_0xd65e('0xd')]?_0x25c694[_0xd65e('0xd')][_0xd65e('0x11')]?_[_0xd65e('0x13')](_0x25c694[_0xd65e('0xd')][_0xd65e('0x11')],function(_0x1bacad){return{'model':db[_0x1bacad[_0xd65e('0x12')]],'as':_0x1bacad['as'],'attributes':_0x1bacad[_0xd65e('0xf')],'include':_0x1bacad['include']?_[_0xd65e('0x13')](_0x1bacad[_0xd65e('0x11')],function(_0x1a12d9){return{'model':db[_0x1a12d9['model']],'as':_0x1a12d9['as'],'attributes':_0x1a12d9[_0xd65e('0xf')],'include':_0x1a12d9[_0xd65e('0x11')]?_[_0xd65e('0x13')](_0x1a12d9[_0xd65e('0x11')],function(_0x286723){return{'model':db[_0x286723[_0xd65e('0x12')]],'as':_0x286723['as'],'attributes':_0x286723['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a33e2){logger[_0xd65e('0x15')]('ShowUser',_0x25c694);logger[_0xd65e('0x16')](_0xd65e('0x1b'),_0x25c694,JSON[_0xd65e('0x17')](_0x5a33e2));_0x184efd(_0x5a33e2);})[_0xd65e('0x1c')](function(_0x4716b4){logger[_0xd65e('0x18')](_0xd65e('0x1b'),_0x4716b4[_0xd65e('0x19')],_0x25c694);_0x544564(_0x4c993d['error'](0x1f4,_0x4716b4[_0xd65e('0x19')]));});});};exports[_0xd65e('0x1d')]=function(_0x1190cb){var _0x55b947;return db[_0xd65e('0x1e')][_0xd65e('0x1f')]({'where':_0x1190cb[_0xd65e('0xd')]['where']||{},'attributes':['id',_0xd65e('0x20'),_0xd65e('0x21'),_0xd65e('0x22'),_0xd65e('0x23')]})[_0xd65e('0x14')](function(_0x763a40){if(!_0x763a40){throw new Error(util[_0xd65e('0x24')](_0xd65e('0x25'),_0x1190cb[_0xd65e('0x26')]['id']));}_0x55b947=_0x763a40;return db['UserVoiceQueueRt'][_0xd65e('0x27')]({'paused':0x1},{'where':{'UserId':_0x55b947['id']},'individualHooks':!![]});})[_0xd65e('0x14')](function(){return db[_0xd65e('0x28')][_0xd65e('0x29')]({'where':{'membername':_0x55b947[_0xd65e('0x20')],'type':_0xd65e('0x2a'),'exitAt':null}});})[_0xd65e('0x14')](function(_0x47ab52){if(_0x47ab52&&_0x47ab52['length']){var _0xfc5651=moment()[_0xd65e('0x24')](_0xd65e('0x2b'));for(var _0x4e886=0x0,_0x20a158=_0x47ab52['length'];_0x4e886<_0x20a158;_0x4e886++){_0x47ab52[_0x4e886]['updateAttributes']({'exitAt':_0xfc5651});}}})['then'](function(){var _0x594a32=[];var _0x1ff4bb=utils[_0xd65e('0x2c')]();_0x1ff4bb[_0xd65e('0x2d')](function(_0x151d18){_0x594a32[_0xd65e('0x2e')]({'channel':_0x151d18,'membername':_0x55b947['name'],'interface':_[_0xd65e('0x2f')](_0x55b947[_0xd65e('0x23')])?util['format'](_0xd65e('0x30'),_0x55b947[_0xd65e('0x20')]):_0x55b947[_0xd65e('0x23')],'type':_0xd65e('0x2a'),'enterAt':moment()[_0xd65e('0x24')](_0xd65e('0x2b')),'data1':_0x1190cb[_0xd65e('0x31')][_0xd65e('0x32')]||_0xd65e('0x33'),'role':_0x55b947[_0xd65e('0x21')],'internal':_0x55b947[_0xd65e('0x22')],'uniqueid':_0x1190cb[_0xd65e('0x31')][_0xd65e('0x34')]||null});});return db[_0xd65e('0x28')]['bulkCreate'](_0x594a32,{'individualHooks':!![]});})[_0xd65e('0x14')](function(){return _0x55b947[_0xd65e('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1190cb[_0xd65e('0x31')][_0xd65e('0x32')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd65e('0x24')](_0xd65e('0x2b'))});})['catch'](function(_0x4c4b65){throw _0x4c4b65;});};exports[_0xd65e('0x35')]=function(_0x274893){return Promise['resolve']()['then'](function(){if(_0x274893['body']['channel']&&!utils[_0xd65e('0x36')](_0x274893[_0xd65e('0x31')][_0xd65e('0x37')])){throw new Error(util[_0xd65e('0x24')](_0xd65e('0x38'),_0x274893[_0xd65e('0x31')][_0xd65e('0x37')]));}return db['User']['findOne']({'where':_0x274893['options'][_0xd65e('0xe')]||{},'attributes':['id',_0xd65e('0x20'),_0xd65e('0x21'),_0xd65e('0x22'),_0xd65e('0x23'),'online',_0xd65e('0x39'),_0xd65e('0x3a'),_0xd65e('0x3b'),_0xd65e('0x3c'),_0xd65e('0x3d'),_0xd65e('0x3e'),_0xd65e('0x3f'),_0xd65e('0x40'),_0xd65e('0x41')]});})[_0xd65e('0x14')](function(_0x38545a){if(!_0x38545a){throw new Error(util[_0xd65e('0x24')]('User\x20with\x20id\x20%s\x20not\x20found',_0x274893[_0xd65e('0x26')]['id']));}return _0x38545a[_0xd65e('0x42')](_0x274893[_0xd65e('0x31')][_0xd65e('0x37')],_0xd65e('0x43'));})[_0xd65e('0x1c')](function(_0x10c1bc){throw _0x10c1bc;});};exports[_0xd65e('0x44')]=function(_0x14a563){var _0x55e2b0=this;return new Promise(function(_0x443d56,_0x4cec37){var _0x4c30af;return db[_0xd65e('0x1e')][_0xd65e('0x45')]({'where':_0x14a563[_0xd65e('0xd')][_0xd65e('0xe')]||{},'attributes':['id','name']})[_0xd65e('0x14')](function(_0x29dd0b){if(_0x29dd0b){_0x4c30af=_0x29dd0b;return db[_0xd65e('0x46')][_0xd65e('0x47')]({'where':{'membername':_0x4c30af['name']},'individualHooks':!![]});}})[_0xd65e('0x14')](function(){if(_0x4c30af){return db[_0xd65e('0x28')]['findAll']({'where':{'membername':_0x4c30af[_0xd65e('0x20')],'exitAt':null}});}})[_0xd65e('0x14')](function(_0x542df4){if(_0x4c30af){if(_0x542df4&&_0x542df4['length']){var _0x63cea7=[];_0x542df4[_0xd65e('0x2d')](function(_0x37675e){_0x63cea7[_0xd65e('0x2e')](_0x37675e['update']({'exitAt':moment()[_0xd65e('0x24')](_0xd65e('0x2b'))}));});return BPromise[_0xd65e('0x48')](_0x63cea7);}}})[_0xd65e('0x14')](function(){if(_0x4c30af){return _0x4c30af[_0xd65e('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd65e('0x14')](function(_0x36d6a1){_0x443d56(_0x36d6a1);})[_0xd65e('0x1c')](function(_0xfb6d15){_0x4cec37(_0x55e2b0[_0xd65e('0x18')](0x1f4,_0xfb6d15[_0xd65e('0x19')]));});});};exports[_0xd65e('0x49')]=function(_0x2142c1){var _0x10b287=this;return new Promise(function(_0x432c65,_0x3a8bdd){var _0x5aa6d4;var _0x158296;var _0x84323e;var _0x20c134;return db[_0xd65e('0x1e')]['findOne']({'where':_0x2142c1['options'][_0xd65e('0xe')]||{},'attributes':['id',_0xd65e('0x20'),_0xd65e('0x21'),_0xd65e('0x4a'),_0xd65e('0x4b'),_0xd65e('0x22'),_0xd65e('0x4c'),'interface']})[_0xd65e('0x14')](function(_0x19d9da){if(_0x19d9da){_0x5aa6d4=_0x19d9da;_0x20c134=_0x2142c1[_0xd65e('0x31')]['interface']?_0x2142c1['body'][_0xd65e('0x23')]:util[_0xd65e('0x24')](_0xd65e('0x30'),_0x5aa6d4[_0xd65e('0x20')]);return db['User'][_0xd65e('0x4d')]({'where':{'role':_0xd65e('0x4e'),'online':!![],'id':{'$ne':_0x5aa6d4['id']}}});}})[_0xd65e('0x14')](function(_0x14750b){if(_0x14750b){_0x84323e=_0x14750b;return require(_0xd65e('0x4f'))[_0xd65e('0x50')]();}})[_0xd65e('0x14')](function(_0xfcfb12){if(_0xfcfb12&&_0xfcfb12[_0xd65e('0x51')]&&_0x84323e>=_0xfcfb12[_0xd65e('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xd65e('0x14')](function(){if(_0x5aa6d4){return db['UserVoiceQueueRt'][_0xd65e('0x47')]({'where':{'membername':_0x5aa6d4['name']},'individualHooks':!![]});}})[_0xd65e('0x14')](function(){if(_0x5aa6d4){return _0x5aa6d4['getVoiceQueues']({'raw':!![]});}})[_0xd65e('0x14')](function(_0x3bc9bf){if(_0x5aa6d4){if(_0x3bc9bf){var _0x2b7b33=[];_0x158296=_0x3bc9bf;if(_0x158296[_0xd65e('0x52')]){for(var _0x41fc2b=0x0;_0x41fc2b<_0x158296[_0xd65e('0x52')];_0x41fc2b++){_0x2b7b33[_0xd65e('0x2e')](db[_0xd65e('0x46')][_0xd65e('0x53')]({'membername':_0x5aa6d4[_0xd65e('0x20')],'UserId':_0x5aa6d4['id'],'queue_name':_0x158296[_0x41fc2b][_0xd65e('0x20')],'VoiceQueueId':_0x158296[_0x41fc2b]['id'],'interface':_0x20c134,'paused':_0x5aa6d4[_0xd65e('0x4c')]||![],'penalty':_0x158296[_0x41fc2b][_0xd65e('0x54')]||0x0}));}return BPromise[_0xd65e('0x48')](_0x2b7b33);}}}})[_0xd65e('0x14')](function(){if(_0x5aa6d4){return db['MemberReport']['findAll']({'where':{'membername':_0x5aa6d4[_0xd65e('0x20')],'exitAt':null}});}})[_0xd65e('0x14')](function(_0x2f53b1){if(_0x5aa6d4){if(_0x2f53b1&&_0x2f53b1[_0xd65e('0x52')]){var _0x9bec20=[];_0x2f53b1[_0xd65e('0x2d')](function(_0x1f5cb8){_0x9bec20[_0xd65e('0x2e')](_0x1f5cb8['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xd65e('0x48')](_0x9bec20);}}})[_0xd65e('0x14')](function(){if(_0x5aa6d4){var _0xc463d1=[];var _0x4a73e1=[];var _0x2db14c=utils[_0xd65e('0x2c')]();var _0x2152a9={'membername':_0x5aa6d4['name'],'interface':_0x20c134,'enterAt':moment()[_0xd65e('0x24')](_0xd65e('0x2b')),'role':_0x5aa6d4[_0xd65e('0x21')],'internal':_0x5aa6d4['internal']};_0x2db14c[_0xd65e('0x2d')](function(_0x2c7198){_0xc463d1[_0xd65e('0x2e')](_[_0xd65e('0x55')]({'channel':_0x2c7198,'type':_0xd65e('0x56'),'data1':_0xd65e('0x57'),'data2':_0x20c134},_0x2152a9));if(_0x5aa6d4[_0xd65e('0x4c')]){_0x4a73e1[_0xd65e('0x2e')](_[_0xd65e('0x55')]({'channel':_0x2c7198,'type':'PAUSE','data1':_0xd65e('0x58')},_0x2152a9));}});return db[_0xd65e('0x28')][_0xd65e('0x59')](_0xc463d1[_0xd65e('0x5a')](_0x4a73e1),{'individualHooks':!![]});}})['then'](function(){if(_0x5aa6d4){return _0x5aa6d4[_0xd65e('0x27')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5aa6d4['loginInPause']||![],'mailPause':_0x5aa6d4['loginInPause']||![],'chatPause':_0x5aa6d4[_0xd65e('0x4c')]||![],'faxPause':_0x5aa6d4[_0xd65e('0x4c')]||![],'smsPause':_0x5aa6d4[_0xd65e('0x4c')]||![],'openchannelPause':_0x5aa6d4[_0xd65e('0x4c')]||![],'pauseType':_0x5aa6d4['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xd65e('0x24')](_0xd65e('0x2b')),'interface':_0x20c134});}})[_0xd65e('0x14')](function(_0x389e25){_0x432c65(_0x389e25);})[_0xd65e('0x1c')](function(_0x2fb20b){_0x3a8bdd(_0x10b287[_0xd65e('0x18')](0x1f4,_0x2fb20b[_0xd65e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f7f9f46..d4bda4c 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 _0xe929=['length','user:','./user.events','save','update','emit','removeListener','register'];(function(_0x16991c,_0x577041){var _0x14111a=function(_0x4727c2){while(--_0x4727c2){_0x16991c['push'](_0x16991c['shift']());}};_0x14111a(++_0x577041);}(_0xe929,0x172));var _0x9e92=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe929[_0x4e9628];return _0x27bc8c;};'use strict';var UserEvents=require(_0x9e92('0x0'));var events=[_0x9e92('0x1'),'remove',_0x9e92('0x2')];function createListener(_0x185a2c,_0x5173f3){return function(_0x42097e){_0x5173f3[_0x9e92('0x3')](_0x185a2c,_0x42097e);};}function removeListener(_0x5348af,_0x2b837e){return function(){UserEvents[_0x9e92('0x4')](_0x5348af,_0x2b837e);};}exports[_0x9e92('0x5')]=function(_0x1a76de){for(var _0x2fb40c=0x0,_0x2eac36=events[_0x9e92('0x6')];_0x2fb40c<_0x2eac36;_0x2fb40c++){var _0x9d7a5d=events[_0x2fb40c];var _0x242c67=createListener(_0x9e92('0x7')+_0x9d7a5d,_0x1a76de);UserEvents['on'](_0x9d7a5d,_0x242c67);}}; \ No newline at end of file +var _0x8968=['length','user:','./user.events','save','remove','update','emit'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x8968,0xd4));var _0x8896=function(_0x57d96e,_0x1714ec){_0x57d96e=_0x57d96e-0x0;var _0x3d70cd=_0x8968[_0x57d96e];return _0x3d70cd;};'use strict';var UserEvents=require(_0x8896('0x0'));var events=[_0x8896('0x1'),_0x8896('0x2'),_0x8896('0x3')];function createListener(_0x4b4f4e,_0x2edcf6){return function(_0x5b49d9){_0x2edcf6[_0x8896('0x4')](_0x4b4f4e,_0x5b49d9);};}function removeListener(_0x536085,_0xd3b918){return function(){UserEvents['removeListener'](_0x536085,_0xd3b918);};}exports['register']=function(_0x4357f0){for(var _0x542100=0x0,_0x502fd5=events[_0x8896('0x5')];_0x542100<_0x502fd5;_0x542100++){var _0x103363=events[_0x542100];var _0x403f92=createListener(_0x8896('0x6')+_0x103363,_0x4357f0);UserEvents['on'](_0x103363,_0x403f92);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f6d973d..c5989e7 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(_0x452431,_0x509947){var _0x63e993=function(_0x4ade33){while(--_0x4ade33){_0x452431['push'](_0x452431['shift']());}};_0x63e993(++_0x509947);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4186ef,_0x5c8c96){var _0x1bcedb=function(_0x5aa29b){while(--_0x5aa29b){_0x4186ef['push'](_0x4186ef['shift']());}};_0x1bcedb(++_0x5c8c96);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4692769..1833cb9 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedc1=['exports','INTEGER','sequelize'];(function(_0xd8812d,_0x19243a){var _0x547b18=function(_0xe33149){while(--_0xe33149){_0xd8812d['push'](_0xd8812d['shift']());}};_0x547b18(++_0x19243a);}(_0xedc1,0x158));var _0x1edc=function(_0x24a737,_0x3ff299){_0x24a737=_0x24a737-0x0;var _0x37b618=_0xedc1[_0x24a737];return _0x37b618;};'use strict';var Sequelize=require(_0x1edc('0x0'));module[_0x1edc('0x1')]={'penalty':{'type':Sequelize[_0x1edc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb2bb=['sequelize','INTEGER'];(function(_0x3c9010,_0x970251){var _0x373e8a=function(_0x3a8a9e){while(--_0x3a8a9e){_0x3c9010['push'](_0x3c9010['shift']());}};_0x373e8a(++_0x970251);}(_0xb2bb,0x198));var _0xbb2b=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xb2bb[_0x3b7a0c];return _0x3bb70f;};'use strict';var Sequelize=require(_0xbb2b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb2b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 6b06360..ff063f2 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 _0xd8de=['rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3e58a1,_0x50bb86){var _0xa2c06c=function(_0x7aabc2){while(--_0x7aabc2){_0x3e58a1['push'](_0x3e58a1['shift']());}};_0xa2c06c(++_0x50bb86);}(_0xd8de,0xf6));var _0xed8d=function(_0x12313b,_0x213a6e){_0x12313b=_0x12313b-0x0;var _0x1a6b44=_0xd8de[_0x12313b];return _0x1a6b44;};'use strict';var _=require('lodash');var util=require(_0xed8d('0x0'));var logger=require(_0xed8d('0x1'))('api');var moment=require(_0xed8d('0x2'));var BPromise=require(_0xed8d('0x3'));var rp=require(_0xed8d('0x4'));var fs=require('fs');var path=require(_0xed8d('0x5'));var rimraf=require(_0xed8d('0x6'));var config=require(_0xed8d('0x7'));var attributes=require(_0xed8d('0x8'));module['exports']=function(_0x532fd1,_0x2fa05e){return _0x532fd1[_0xed8d('0x9')](_0xed8d('0xa'),attributes,{'tableName':_0xed8d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb68f=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb68f,0x1bf));var _0xfb68=function(_0xbace0,_0x3def9d){_0xbace0=_0xbace0-0x0;var _0x56f878=_0xb68f[_0xbace0];return _0x56f878;};'use strict';var _=require(_0xfb68('0x0'));var util=require('util');var logger=require(_0xfb68('0x1'))(_0xfb68('0x2'));var moment=require(_0xfb68('0x3'));var BPromise=require(_0xfb68('0x4'));var rp=require(_0xfb68('0x5'));var fs=require('fs');var path=require(_0xfb68('0x6'));var rimraf=require('rimraf');var config=require(_0xfb68('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xfb68('0x8')]=function(_0x5b7b1d,_0x3f2c48){return _0x5b7b1d[_0xfb68('0x9')](_0xfb68('0xa'),attributes,{'tableName':_0xfb68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index b8c77e1..8c69614 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 _0x547e=['then','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0x547e,0x1ee));var _0xe547=function(_0x4a555a,_0x1fafd9){_0x4a555a=_0x4a555a-0x0;var _0x597a1b=_0x547e[_0x4a555a];return _0x597a1b;};'use strict';var _=require(_0xe547('0x0'));var util=require(_0xe547('0x1'));var moment=require(_0xe547('0x2'));var BPromise=require(_0xe547('0x3'));var rs=require(_0xe547('0x4'));var fs=require('fs');var Redis=require(_0xe547('0x5'));var db=require(_0xe547('0x6'))['db'];var utils=require(_0xe547('0x7'));var logger=require('../../config/logger')(_0xe547('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe547('0x9')][_0xe547('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa5609b,_0x31dd58,_0x4530c5){return new BPromise(function(_0x6e418d,_0x3fbc69){return client[_0xe547('0xb')](_0xa5609b,_0x4530c5)[_0xe547('0xc')](function(_0x45f90f){logger['info'](_0xe547('0xd'),_0x31dd58,_0xe547('0xe'));logger['debug'](_0xe547('0xf'),_0x31dd58,_0xe547('0xe'),JSON[_0xe547('0x10')](_0x45f90f));if(_0x45f90f[_0xe547('0x11')]){if(_0x45f90f[_0xe547('0x11')][_0xe547('0x12')]===0x1f4){logger[_0xe547('0x11')](_0xe547('0xd'),_0x31dd58,_0x45f90f[_0xe547('0x11')][_0xe547('0x13')]);return _0x3fbc69(_0x45f90f[_0xe547('0x11')][_0xe547('0x13')]);}logger[_0xe547('0x11')](_0xe547('0xd'),_0x31dd58,_0x45f90f[_0xe547('0x11')][_0xe547('0x13')]);return _0x6e418d(_0x45f90f[_0xe547('0x11')][_0xe547('0x13')]);}else{logger[_0xe547('0x14')](_0xe547('0xd'),_0x31dd58,'request\x20sent');_0x6e418d(_0x45f90f[_0xe547('0x15')]['message']);}})['catch'](function(_0x49c206){logger['error'](_0xe547('0xd'),_0x31dd58,_0x49c206);_0x3fbc69(_0x49c206);});});} \ No newline at end of file +var _0x69d3=['http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x69d3,0xe8));var _0x369d=function(_0x588826,_0x507abf){_0x588826=_0x588826-0x0;var _0x214cf7=_0x69d3[_0x588826];return _0x214cf7;};'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('ioredis');var db=require(_0x369d('0x4'))['db'];var utils=require(_0x369d('0x5'));var logger=require(_0x369d('0x6'))(_0x369d('0x7'));var config=require('../../config/environment');var jayson=require(_0x369d('0x8'));var client=jayson[_0x369d('0x9')][_0x369d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c5b13,_0x5c6f06,_0x5dc3c4){return new BPromise(function(_0x23e6d2,_0x44ab3e){return client[_0x369d('0xb')](_0x4c5b13,_0x5dc3c4)[_0x369d('0xc')](function(_0x1ba79d){logger[_0x369d('0xd')](_0x369d('0xe'),_0x5c6f06,_0x369d('0xf'));logger[_0x369d('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5c6f06,_0x369d('0xf'),JSON[_0x369d('0x11')](_0x1ba79d));if(_0x1ba79d[_0x369d('0x12')]){if(_0x1ba79d[_0x369d('0x12')][_0x369d('0x13')]===0x1f4){logger['error'](_0x369d('0xe'),_0x5c6f06,_0x1ba79d[_0x369d('0x12')]['message']);return _0x44ab3e(_0x1ba79d[_0x369d('0x12')][_0x369d('0x14')]);}logger['error'](_0x369d('0xe'),_0x5c6f06,_0x1ba79d[_0x369d('0x12')][_0x369d('0x14')]);return _0x23e6d2(_0x1ba79d[_0x369d('0x12')][_0x369d('0x14')]);}else{logger[_0x369d('0xd')](_0x369d('0xe'),_0x5c6f06,_0x369d('0xf'));_0x23e6d2(_0x1ba79d[_0x369d('0x15')][_0x369d('0x14')]);}})['catch'](function(_0x1d3710){logger[_0x369d('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x5c6f06,_0x1d3710);_0x44ab3e(_0x1d3710);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9bb5188..ef7d876 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(_0x1eb54e,_0x448bd6){var _0x29cb8b=function(_0x38f238){while(--_0x38f238){_0x1eb54e['push'](_0x1eb54e['shift']());}};_0x29cb8b(++_0x448bd6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x9f721,_0x14bcc5){var _0x20052d=function(_0xba8047){while(--_0xba8047){_0x9f721['push'](_0x9f721['shift']());}};_0x20052d(++_0x14bcc5);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 6a88639..6500c0f 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 _0x3030=['STRING','sequelize','exports','INTEGER'];(function(_0x170b20,_0x49fc52){var _0xbe0395=function(_0x410eea){while(--_0x410eea){_0x170b20['push'](_0x170b20['shift']());}};_0xbe0395(++_0x49fc52);}(_0x3030,0x13d));var _0x0303=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x3030[_0x4314d7];return _0x5c599b;};'use strict';var Sequelize=require(_0x0303('0x0'));module[_0x0303('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0303('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0303('0x3')]}}; \ No newline at end of file +var _0x738f=['exports','INTEGER','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x738f,0x187));var _0xf738=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x738f[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0xf738('0x0'));module[_0xf738('0x1')]={'penalty':{'type':Sequelize[_0xf738('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf738('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf738('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2455375..4942b36 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 _0xe9b3=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues'];(function(_0x35b7e6,_0x5a5d23){var _0x2c7497=function(_0xa54e6b){while(--_0xa54e6b){_0x35b7e6['push'](_0x35b7e6['shift']());}};_0x2c7497(++_0x5a5d23);}(_0xe9b3,0x193));var _0x3e9b=function(_0x4105f9,_0x480c1c){_0x4105f9=_0x4105f9-0x0;var _0x5d60e1=_0xe9b3[_0x4105f9];return _0x5d60e1;};'use strict';var _=require(_0x3e9b('0x0'));var util=require(_0x3e9b('0x1'));var logger=require(_0x3e9b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3e9b('0x3'));var rp=require(_0x3e9b('0x4'));var fs=require('fs');var path=require(_0x3e9b('0x5'));var rimraf=require(_0x3e9b('0x6'));var config=require(_0x3e9b('0x7'));var attributes=require(_0x3e9b('0x8'));module[_0x3e9b('0x9')]=function(_0x44bb9b,_0x3f05ca){return _0x44bb9b[_0x3e9b('0xa')](_0x3e9b('0xb'),attributes,{'tableName':_0x3e9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38ed=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue'];(function(_0x49eb2c,_0x57cf5d){var _0x5816a3=function(_0x129d72){while(--_0x129d72){_0x49eb2c['push'](_0x49eb2c['shift']());}};_0x5816a3(++_0x57cf5d);}(_0x38ed,0xc0));var _0xd38e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x38ed[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xd38e('0x0'));var util=require(_0xd38e('0x1'));var logger=require(_0xd38e('0x2'))('api');var moment=require(_0xd38e('0x3'));var BPromise=require(_0xd38e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd38e('0x5'));var rimraf=require(_0xd38e('0x6'));var config=require(_0xd38e('0x7'));var attributes=require(_0xd38e('0x8'));module[_0xd38e('0x9')]=function(_0x153bb1,_0x240eb3){return _0x153bb1[_0xd38e('0xa')](_0xd38e('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 6b16d44..bd2bd2c 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 _0x5f1b=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x5f3d01,_0x251514){var _0x26183d=function(_0x3adc3e){while(--_0x3adc3e){_0x5f3d01['push'](_0x5f3d01['shift']());}};_0x26183d(++_0x251514);}(_0x5f1b,0x1b1));var _0xb5f1=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x5f1b[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0xb5f1('0x0'));var util=require(_0xb5f1('0x1'));var moment=require('moment');var BPromise=require(_0xb5f1('0x2'));var rs=require(_0xb5f1('0x3'));var fs=require('fs');var Redis=require(_0xb5f1('0x4'));var db=require(_0xb5f1('0x5'))['db'];var utils=require(_0xb5f1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb5f1('0x7'));var jayson=require(_0xb5f1('0x8'));var client=jayson[_0xb5f1('0x9')][_0xb5f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446aa8,_0x119e78,_0x214827){return new BPromise(function(_0x4338b1,_0x310cf0){return client[_0xb5f1('0xb')](_0x446aa8,_0x214827)[_0xb5f1('0xc')](function(_0x1e14ac){logger[_0xb5f1('0xd')](_0xb5f1('0xe'),_0x119e78,_0xb5f1('0xf'));logger[_0xb5f1('0x10')](_0xb5f1('0x11'),_0x119e78,'request\x20sent',JSON[_0xb5f1('0x12')](_0x1e14ac));if(_0x1e14ac['error']){if(_0x1e14ac[_0xb5f1('0x13')][_0xb5f1('0x14')]===0x1f4){logger['error'](_0xb5f1('0xe'),_0x119e78,_0x1e14ac[_0xb5f1('0x13')]['message']);return _0x310cf0(_0x1e14ac[_0xb5f1('0x13')]['message']);}logger[_0xb5f1('0x13')](_0xb5f1('0xe'),_0x119e78,_0x1e14ac[_0xb5f1('0x13')]['message']);return _0x4338b1(_0x1e14ac[_0xb5f1('0x13')][_0xb5f1('0x15')]);}else{logger[_0xb5f1('0xd')](_0xb5f1('0xe'),_0x119e78,_0xb5f1('0xf'));_0x4338b1(_0x1e14ac[_0xb5f1('0x16')]['message']);}})['catch'](function(_0x4593ae){logger['error'](_0xb5f1('0xe'),_0x119e78,_0x4593ae);_0x310cf0(_0x4593ae);});});} \ No newline at end of file +var _0xf827=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','util'];(function(_0x16efa6,_0x545448){var _0x556a4c=function(_0x120925){while(--_0x120925){_0x16efa6['push'](_0x16efa6['shift']());}};_0x556a4c(++_0x545448);}(_0xf827,0xa0));var _0x7f82=function(_0x33e2a1,_0xe57d79){_0x33e2a1=_0x33e2a1-0x0;var _0x1d37e8=_0xf827[_0x33e2a1];return _0x1d37e8;};'use strict';var _=require('lodash');var util=require(_0x7f82('0x0'));var moment=require('moment');var BPromise=require(_0x7f82('0x1'));var rs=require(_0x7f82('0x2'));var fs=require('fs');var Redis=require(_0x7f82('0x3'));var db=require(_0x7f82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f82('0x5'))(_0x7f82('0x6'));var config=require(_0x7f82('0x7'));var jayson=require(_0x7f82('0x8'));var client=jayson[_0x7f82('0x9')][_0x7f82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e0d79,_0x43f8af,_0x1efc58){return new BPromise(function(_0x594c68,_0x4775f5){return client[_0x7f82('0xb')](_0x5e0d79,_0x1efc58)[_0x7f82('0xc')](function(_0x524677){logger['info'](_0x7f82('0xd'),_0x43f8af,'request\x20sent');logger[_0x7f82('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x43f8af,'request\x20sent',JSON[_0x7f82('0xf')](_0x524677));if(_0x524677[_0x7f82('0x10')]){if(_0x524677[_0x7f82('0x10')][_0x7f82('0x11')]===0x1f4){logger[_0x7f82('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x43f8af,_0x524677[_0x7f82('0x10')]['message']);return _0x4775f5(_0x524677[_0x7f82('0x10')][_0x7f82('0x12')]);}logger[_0x7f82('0x10')](_0x7f82('0xd'),_0x43f8af,_0x524677[_0x7f82('0x10')]['message']);return _0x594c68(_0x524677['error'][_0x7f82('0x12')]);}else{logger[_0x7f82('0x13')](_0x7f82('0xd'),_0x43f8af,_0x7f82('0x14'));_0x594c68(_0x524677[_0x7f82('0x15')][_0x7f82('0x12')]);}})[_0x7f82('0x16')](function(_0x170505){logger[_0x7f82('0x10')](_0x7f82('0xd'),_0x43f8af,_0x170505);_0x4775f5(_0x170505);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 1232e96..48c7815 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x45598f,_0x1649ec){var _0x517e2b=function(_0xd0990e){while(--_0xd0990e){_0x45598f['push'](_0x45598f['shift']());}};_0x517e2b(++_0x1649ec);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x37d172,_0x55b556){var _0xc6dac3=function(_0x2a5742){while(--_0x2a5742){_0x37d172['push'](_0x37d172['shift']());}};_0xc6dac3(++_0x55b556);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index be50dfe..9592cac 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 _0x4614=['INTEGER','sequelize','exports'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x4614,0xfd));var _0x4461=function(_0x534907,_0x455d91){_0x534907=_0x534907-0x0;var _0x1d775e=_0x4614[_0x534907];return _0x1d775e;};'use strict';var Sequelize=require(_0x4461('0x0'));module[_0x4461('0x1')]={'penalty':{'type':Sequelize[_0x4461('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x84e7=['exports','INTEGER'];(function(_0x2df134,_0x2ddc62){var _0x299b6b=function(_0x166e9b){while(--_0x166e9b){_0x2df134['push'](_0x2df134['shift']());}};_0x299b6b(++_0x2ddc62);}(_0x84e7,0x122));var _0x784e=function(_0x5b93fd,_0x47eed1){_0x5b93fd=_0x5b93fd-0x0;var _0x484306=_0x84e7[_0x5b93fd];return _0x484306;};'use strict';var Sequelize=require('sequelize');module[_0x784e('0x0')]={'penalty':{'type':Sequelize[_0x784e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index cfa4a59..1870c2a 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 _0x574b=['define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x58c412,_0x36abfc){var _0x177626=function(_0x217c82){while(--_0x217c82){_0x58c412['push'](_0x58c412['shift']());}};_0x177626(++_0x36abfc);}(_0x574b,0xa8));var _0xb574=function(_0x247de5,_0x44c432){_0x247de5=_0x247de5-0x0;var _0x3ac214=_0x574b[_0x247de5];return _0x3ac214;};'use strict';var _=require(_0xb574('0x0'));var util=require('util');var logger=require(_0xb574('0x1'))('api');var moment=require(_0xb574('0x2'));var BPromise=require(_0xb574('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb574('0x4'));var rimraf=require(_0xb574('0x5'));var config=require(_0xb574('0x6'));var attributes=require(_0xb574('0x7'));module['exports']=function(_0x1b4fc7,_0xf6d566){return _0x1b4fc7[_0xb574('0x8')](_0xb574('0x9'),attributes,{'tableName':_0xb574('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cc8=['exports','define','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes'];(function(_0x5bf97d,_0x564839){var _0x2d37d1=function(_0xf137d2){while(--_0xf137d2){_0x5bf97d['push'](_0x5bf97d['shift']());}};_0x2d37d1(++_0x564839);}(_0x5cc8,0x142));var _0x85cc=function(_0x5caf4a,_0x100cec){_0x5caf4a=_0x5caf4a-0x0;var _0x5efdfe=_0x5cc8[_0x5caf4a];return _0x5efdfe;};'use strict';var _=require(_0x85cc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x85cc('0x1'));var moment=require(_0x85cc('0x2'));var BPromise=require(_0x85cc('0x3'));var rp=require(_0x85cc('0x4'));var fs=require('fs');var path=require(_0x85cc('0x5'));var rimraf=require('rimraf');var config=require(_0x85cc('0x6'));var attributes=require(_0x85cc('0x7'));module[_0x85cc('0x8')]=function(_0x41d466,_0x110236){return _0x41d466[_0x85cc('0x9')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','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 b3e3371..3df156e 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(_0x5d474d,_0x44d62f){var _0x51ce77=function(_0x500e10){while(--_0x500e10){_0x5d474d['push'](_0x5d474d['shift']());}};_0x51ce77(++_0x44d62f);}(_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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0xffaea3,_0x4c7c6b){var _0x1622a4=function(_0x428b05){while(--_0x428b05){_0xffaea3['push'](_0xffaea3['shift']());}};_0x1622a4(++_0x4c7c6b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x4b84[_0x5c2e5e];return _0x46a5da;};'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')]('UserMailQueue,\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')]('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index f72aaec..c11b3b8 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 _0xce5d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','isAuthenticated','sendUserNotification','exports'];(function(_0x86cce0,_0x1a4e58){var _0x4c34be=function(_0x43efe8){while(--_0x43efe8){_0x86cce0['push'](_0x86cce0['shift']());}};_0x4c34be(++_0x1a4e58);}(_0xce5d,0xd0));var _0xdce5=function(_0x1ca761,_0x341ed6){_0x1ca761=_0x1ca761-0x0;var _0x25104e=_0xce5d[_0x1ca761];return _0x25104e;};'use strict';var multer=require(_0xdce5('0x0'));var util=require(_0xdce5('0x1'));var path=require(_0xdce5('0x2'));var timeout=require(_0xdce5('0x3'));var express=require(_0xdce5('0x4'));var router=express[_0xdce5('0x5')]();var fs_extra=require(_0xdce5('0x6'));var auth=require(_0xdce5('0x7'));var interaction=require(_0xdce5('0x8'));var config=require('../../config/environment');var controller=require(_0xdce5('0x9'));router['post']('/',auth[_0xdce5('0xa')](),controller[_0xdce5('0xb')]);module[_0xdce5('0xc')]=router; \ No newline at end of file +var _0xc6a9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x46ffae,_0x2f210e){var _0x1abf9e=function(_0x206a5d){while(--_0x206a5d){_0x46ffae['push'](_0x46ffae['shift']());}};_0x1abf9e(++_0x2f210e);}(_0xc6a9,0x163));var _0x9c6a=function(_0x3aa0ac,_0x5f5da6){_0x3aa0ac=_0x3aa0ac-0x0;var _0x568a11=_0xc6a9[_0x3aa0ac];return _0x568a11;};'use strict';var multer=require(_0x9c6a('0x0'));var util=require(_0x9c6a('0x1'));var path=require(_0x9c6a('0x2'));var timeout=require(_0x9c6a('0x3'));var express=require(_0x9c6a('0x4'));var router=express[_0x9c6a('0x5')]();var fs_extra=require(_0x9c6a('0x6'));var auth=require(_0x9c6a('0x7'));var interaction=require(_0x9c6a('0x8'));var config=require(_0x9c6a('0x9'));var controller=require(_0x9c6a('0xa'));router[_0x9c6a('0xb')]('/',auth[_0x9c6a('0xc')](),controller[_0x9c6a('0xd')]);module[_0x9c6a('0xe')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 25034f7..8aede36 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 _0xe5d8=['STRING','sequelize','exports','TEXT'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xe5d8,0x85));var _0x8e5d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe5d8[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x8e5d('0x0'));module[_0x8e5d('0x1')]={'body':{'type':Sequelize[_0x8e5d('0x2')]},'senderName':{'type':Sequelize[_0x8e5d('0x3')]},'recipientsId':{'type':Sequelize[_0x8e5d('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0xbbcf=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x19d0a2,_0x3dd296){var _0x4c3252=function(_0x2a061b){while(--_0x2a061b){_0x19d0a2['push'](_0x19d0a2['shift']());}};_0x4c3252(++_0x3dd296);}(_0xbbcf,0x11d));var _0xfbbc=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xbbcf[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xfbbc('0x0'));module[_0xfbbc('0x1')]={'body':{'type':Sequelize[_0xfbbc('0x2')]},'senderName':{'type':Sequelize[_0xfbbc('0x3')]},'recipientsId':{'type':Sequelize[_0xfbbc('0x2')]},'recipientsDescription':{'type':Sequelize[_0xfbbc('0x3')]},'beep':{'type':Sequelize[_0xfbbc('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 2146f4f..be7a452 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 _0x91e5=['body','text','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','toLowerCase','union','queue','replace','ids','push','flatten','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name'];(function(_0x1e8d89,_0x470954){var _0x384320=function(_0x12df97){while(--_0x12df97){_0x1e8d89['push'](_0x1e8d89['shift']());}};_0x384320(++_0x470954);}(_0x91e5,0x165));var _0x591e=function(_0x30915f,_0xe17d73){_0x30915f=_0x30915f-0x0;var _0x39d4a8=_0x91e5[_0x30915f];return _0x39d4a8;};'use strict';var emlformat=require(_0x591e('0x0'));var rimraf=require(_0x591e('0x1'));var zipdir=require(_0x591e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x591e('0x3'));var moment=require(_0x591e('0x4'));var BPromise=require(_0x591e('0x5'));var Mustache=require(_0x591e('0x6'));var util=require('util');var path=require(_0x591e('0x7'));var sox=require(_0x591e('0x8'));var csv=require(_0x591e('0x9'));var ejs=require(_0x591e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x591e('0xb'));var squel=require(_0x591e('0xc'));var crypto=require(_0x591e('0xd'));var jsforce=require(_0x591e('0xe'));var deskjs=require(_0x591e('0xf'));var toCsv=require(_0x591e('0x9'));var querystring=require(_0x591e('0x10'));var Papa=require(_0x591e('0x11'));var Redis=require(_0x591e('0x12'));var authService=require(_0x591e('0x13'));var qs=require(_0x591e('0x14'));var as=require(_0x591e('0x15'));var hardwareService=require(_0x591e('0x16'));var logger=require(_0x591e('0x17'))(_0x591e('0x18'));var utils=require(_0x591e('0x19'));var config=require(_0x591e('0x1a'));var licenseUtil=require(_0x591e('0x1b'));var db=require(_0x591e('0x1c'))['db'];config['redis']=_[_0x591e('0x1d')](config[_0x591e('0x1e')],{'host':_0x591e('0x1f'),'port':0x18eb});var socket=require(_0x591e('0x20'))(new Redis(config[_0x591e('0x1e')]));require(_0x591e('0x21'))[_0x591e('0x22')](socket);function respondWithStatusCode(_0x26aa93,_0x235f4a){_0x235f4a=_0x235f4a||0xcc;return function(_0x5cf29c){if(_0x5cf29c){return _0x26aa93[_0x591e('0x23')](_0x235f4a);}return _0x26aa93['status'](_0x235f4a)[_0x591e('0x24')]();};}function respondWithResult(_0x1e10c8,_0x5a868c){_0x5a868c=_0x5a868c||0xc8;return function(_0x10cda9){if(_0x10cda9){return _0x1e10c8[_0x591e('0x25')](_0x5a868c)[_0x591e('0x26')](_0x10cda9);}};}function respondWithFilteredResult(_0x30a6ae,_0x2dd548){return function(_0x5d3069){if(_0x5d3069){var _0x5f1a58=typeof _0x2dd548[_0x591e('0x27')]==='undefined'&&typeof _0x2dd548[_0x591e('0x28')]===_0x591e('0x29');var _0x542367=_0x5d3069['count'];var _0x3b933c=_0x5f1a58?0x0:_0x2dd548[_0x591e('0x27')];var _0x249a2c=_0x5f1a58?_0x5d3069[_0x591e('0x2a')]:_0x2dd548[_0x591e('0x27')]+_0x2dd548[_0x591e('0x28')];var _0x21ad80;if(_0x249a2c>=_0x542367){_0x249a2c=_0x542367;_0x21ad80=0xc8;}else{_0x21ad80=0xce;}_0x30a6ae[_0x591e('0x25')](_0x21ad80);return _0x30a6ae['set'](_0x591e('0x2b'),_0x3b933c+'-'+_0x249a2c+'/'+_0x542367)[_0x591e('0x26')](_0x5d3069);}return null;};}function patchUpdates(_0x4100ee){return function(_0x1401f0){try{jsonpatch['apply'](_0x1401f0,_0x4100ee,!![]);}catch(_0xe7959f){return BPromise[_0x591e('0x2c')](_0xe7959f);}return _0x1401f0[_0x591e('0x2d')]();};}function saveUpdates(_0x303685,_0x4685b6){return function(_0xdeee5c){if(_0xdeee5c){return _0xdeee5c['update'](_0x303685)[_0x591e('0x2e')](function(_0x1b7559){return _0x1b7559;});}return null;};}function removeEntity(_0x440482,_0x2eda62){return function(_0x38afd1){if(_0x38afd1){return _0x38afd1[_0x591e('0x2f')]()[_0x591e('0x2e')](function(){_0x440482[_0x591e('0x25')](0xcc)[_0x591e('0x24')]();});}};}function handleEntityNotFound(_0x1b5dbe,_0x24f9f8){return function(_0x352ed2){if(!_0x352ed2){_0x1b5dbe[_0x591e('0x23')](0x194);}return _0x352ed2;};}function handleError(_0x1c8a13,_0x42a9d5){_0x42a9d5=_0x42a9d5||0x1f4;return function(_0xd1cca3){logger[_0x591e('0x30')](_0xd1cca3[_0x591e('0x31')]);if(_0xd1cca3['name']){delete _0xd1cca3[_0x591e('0x32')];}_0x1c8a13[_0x591e('0x25')](_0x42a9d5)['send'](_0xd1cca3);};}exports['sendUserNotification']=function(_0x139b49,_0xe201cd,_0x7782c0){if(!_0x139b49[_0x591e('0x33')]['hasOwnProperty'](_0x591e('0x34'))&&!_0x139b49['body'][_0x591e('0x35')](_0x591e('0x36'))){throw new db['Sequelize'][(_0x591e('0x37'))](_0x591e('0x38'));}else{if(_0x139b49[_0x591e('0x33')][_0x591e('0x35')](_0x591e('0x36'))&&!_0x139b49['body'][_0x591e('0x35')]('view')){throw new db[(_0x591e('0x39'))][(_0x591e('0x37'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x139b49[_0x591e('0x33')][_0x591e('0x35')]('recipients')){throw new db['Sequelize'][(_0x591e('0x37'))](_0x591e('0x3a'));}else{try{var _0x6f6f0d=JSON[_0x591e('0x3b')](_0x139b49[_0x591e('0x33')][_0x591e('0x3c')]);}catch(_0x4a439b){logger[_0x591e('0x30')](_0x4a439b);throw new db[(_0x591e('0x39'))][(_0x591e('0x37'))](_0x591e('0x3d'));}var _0x524d07=[_0x591e('0x3e'),_0x591e('0x3f'),_0x591e('0x40'),_0x591e('0x41'),'smsqueue','voicequeue',_0x591e('0x42'),_0x591e('0x43'),_0x591e('0x44')];if(_['some'](_0x6f6f0d,function(_0x4407ce){return!_[_0x591e('0x45')](_0x524d07,_0x4407ce['model']['toLowerCase']());})){throw new db[(_0x591e('0x39'))][(_0x591e('0x37'))](_0x591e('0x46'));}}}var _0x539a75={};_0x539a75['senderName']=_0x139b49[_0x591e('0x33')]['hasOwnProperty'](_0x591e('0x47'))?_0x139b49['body'][_0x591e('0x47')]:_0x139b49[_0x591e('0x44')]['fullname'];_0x539a75[_0x591e('0x48')]=_['isEmpty'](_0x139b49[_0x591e('0x33')][_0x591e('0x48')])?null:_0x139b49[_0x591e('0x33')][_0x591e('0x48')];_0x539a75[_0x591e('0x49')]=_0x139b49[_0x591e('0x33')][_0x591e('0x49')]||![];_0x539a75[_0x591e('0x4a')]=_0x139b49['user']['id'];return getContent(_0x139b49[_0x591e('0x33')])[_0x591e('0x2e')](function(_0x5829a9){_0x539a75[_0x591e('0x33')]=_0x5829a9;return getRecipients(_0x6f6f0d);})['then'](function(_0x48cfd3){_0x539a75[_0x591e('0x4b')]=_[_0x591e('0x4c')](_0x48cfd3)[_0x591e('0x4d')](',');return db[_0x591e('0x4e')][_0x591e('0x4f')](function(_0x5e060b){return db[_0x591e('0x50')][_0x591e('0x51')](_0x539a75,{'raw':!![],'transaction':_0x5e060b})[_0x591e('0x2e')](function(_0x23e13a){var _0x49a4af={'sender':_0x539a75[_0x591e('0x47')],'description':_0x539a75['recipientsDescription'],'content':_0x539a75[_0x591e('0x33')],'beep':_0x539a75[_0x591e('0x49')]};_0x48cfd3[_0x591e('0x52')](function(_0x558548){_0x49a4af['recipient']=_0x558548;socket[_0x591e('0x53')](_0x591e('0x54'),_0x49a4af);});return _0x23e13a;});});})[_0x591e('0x2e')](respondWithResult(_0xe201cd,0xc9))[_0x591e('0x55')](handleError(_0xe201cd,null));};function getContent(_0x279c12){return new BPromise(function(_0x54d1ad,_0xc6a62a){if(_0x279c12['text']){_0x54d1ad(_0x279c12[_0x591e('0x34')]);return;}return db[_0x591e('0x56')][_0x591e('0x57')]({'attributes':[_0x591e('0x58')],'where':{'id':_0x279c12[_0x591e('0x36')]},'raw':!![]})[_0x591e('0x2e')](function(_0x166d13){if(!_0x166d13)throw new db[(_0x591e('0x39'))][(_0x591e('0x37'))](_0x591e('0x59'));var _0x1e063e=Mustache[_0x591e('0x5a')](_0x166d13[_0x591e('0x58')],_0x279c12['view']);_0x54d1ad(_0x1e063e);})[_0x591e('0x55')](function(_0xae28fb){_0xc6a62a(_0xae28fb);});});}function getRecipients(_0x262d53){return new BPromise(function(_0x5b7c8b,_0x57009c){var _0x17d85e=[];var _0xcffc1c=[];_0x262d53['forEach'](function(_0x1d2a55){var _0x5da991=_[_0x591e('0x5b')](_0x1d2a55[_0x591e('0x5c')][_0x591e('0x5d')]());if(_0x5da991==='User'){_0x17d85e=_[_0x591e('0x5e')](_0x17d85e,_0x1d2a55['ids']);}else{if(_['includes'](_0x5da991,_0x591e('0x5f')))_0x5da991=_0x5da991[_0x591e('0x60')]('queue','Queue');_0x1d2a55[_0x591e('0x61')]['forEach'](function(_0x16058f){_0xcffc1c[_0x591e('0x62')](getAgents(_0x5da991,_0x16058f));});}});return BPromise['all'](_0xcffc1c)[_0x591e('0x2e')](function(_0x38d20c){_0x17d85e=_[_0x591e('0x5e')](_0x17d85e,_[_0x591e('0x63')](_0x38d20c));_0x5b7c8b(_0x17d85e);})[_0x591e('0x55')](function(_0xb550cf){_0x57009c(_0xb550cf);});});}function getAgents(_0x45ccec,_0x58f6cc){return new BPromise(function(_0x1ec732,_0x541865){return db[_0x45ccec][_0x591e('0x57')]({'where':{'id':_0x58f6cc}})[_0x591e('0x2e')](function(_0x561c5f){return _0x561c5f[_0x591e('0x64')]({'attributes':['id'],'raw':!![]})[_0x591e('0x2e')](function(_0x1abdf5){var _0x12e7e0=_[_0x591e('0x65')](_0x1abdf5,'id');_0x1ec732(_0x12e7e0);});})[_0x591e('0x55')](function(_0x399f7e){_0x541865(_0x399f7e);});});} \ No newline at end of file +var _0x3a61=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./userNotification.socket','sendStatus','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','status','error','stack','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','team','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','toLowerCase','User','union','ids','queue','replace','Queue','all','flatten','findOne','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1cd5b7,_0x1b4ae1){var _0x50f4a3=function(_0x3e779b){while(--_0x3e779b){_0x1cd5b7['push'](_0x1cd5b7['shift']());}};_0x50f4a3(++_0x1b4ae1);}(_0x3a61,0x112));var _0x13a6=function(_0x4bed2d,_0x4ebe20){_0x4bed2d=_0x4bed2d-0x0;var _0xe82d9f=_0x3a61[_0x4bed2d];return _0xe82d9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13a6('0x0'));var zipdir=require(_0x13a6('0x1'));var jsonpatch=require(_0x13a6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x13a6('0x3'));var Mustache=require(_0x13a6('0x4'));var util=require(_0x13a6('0x5'));var path=require('path');var sox=require(_0x13a6('0x6'));var csv=require(_0x13a6('0x7'));var ejs=require(_0x13a6('0x8'));var fs=require('fs');var fs_extra=require(_0x13a6('0x9'));var _=require(_0x13a6('0xa'));var squel=require(_0x13a6('0xb'));var crypto=require(_0x13a6('0xc'));var jsforce=require(_0x13a6('0xd'));var deskjs=require(_0x13a6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x13a6('0xf'));var Papa=require(_0x13a6('0x10'));var Redis=require(_0x13a6('0x11'));var authService=require(_0x13a6('0x12'));var qs=require(_0x13a6('0x13'));var as=require(_0x13a6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13a6('0x15'))(_0x13a6('0x16'));var utils=require('../../config/utils');var config=require(_0x13a6('0x17'));var licenseUtil=require(_0x13a6('0x18'));var db=require('../../mysqldb')['db'];config[_0x13a6('0x19')]=_[_0x13a6('0x1a')](config['redis'],{'host':_0x13a6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x13a6('0x1c'))['register'](socket);function respondWithStatusCode(_0x74d98d,_0xc659b5){_0xc659b5=_0xc659b5||0xcc;return function(_0x240f0a){if(_0x240f0a){return _0x74d98d[_0x13a6('0x1d')](_0xc659b5);}return _0x74d98d['status'](_0xc659b5)[_0x13a6('0x1e')]();};}function respondWithResult(_0x424a72,_0x1f1451){_0x1f1451=_0x1f1451||0xc8;return function(_0x4e97c0){if(_0x4e97c0){return _0x424a72['status'](_0x1f1451)[_0x13a6('0x1f')](_0x4e97c0);}};}function respondWithFilteredResult(_0x3d4467,_0x121de3){return function(_0x293e76){if(_0x293e76){var _0x3eff8f=typeof _0x121de3['offset']==='undefined'&&typeof _0x121de3[_0x13a6('0x20')]===_0x13a6('0x21');var _0x53ee53=_0x293e76[_0x13a6('0x22')];var _0x5443b3=_0x3eff8f?0x0:_0x121de3[_0x13a6('0x23')];var _0x1cf639=_0x3eff8f?_0x293e76[_0x13a6('0x22')]:_0x121de3[_0x13a6('0x23')]+_0x121de3[_0x13a6('0x20')];var _0x27f5cf;if(_0x1cf639>=_0x53ee53){_0x1cf639=_0x53ee53;_0x27f5cf=0xc8;}else{_0x27f5cf=0xce;}_0x3d4467['status'](_0x27f5cf);return _0x3d4467['set'](_0x13a6('0x24'),_0x5443b3+'-'+_0x1cf639+'/'+_0x53ee53)[_0x13a6('0x1f')](_0x293e76);}return null;};}function patchUpdates(_0x34c930){return function(_0x29c62d){try{jsonpatch[_0x13a6('0x25')](_0x29c62d,_0x34c930,!![]);}catch(_0x358aef){return BPromise[_0x13a6('0x26')](_0x358aef);}return _0x29c62d[_0x13a6('0x27')]();};}function saveUpdates(_0x954f3a,_0xa30883){return function(_0x533608){if(_0x533608){return _0x533608['update'](_0x954f3a)[_0x13a6('0x28')](function(_0x1394b0){return _0x1394b0;});}return null;};}function removeEntity(_0x20b01e,_0x4b3130){return function(_0x62b26){if(_0x62b26){return _0x62b26[_0x13a6('0x29')]()['then'](function(){_0x20b01e[_0x13a6('0x2a')](0xcc)[_0x13a6('0x1e')]();});}};}function handleEntityNotFound(_0xf1bfd6,_0x2f418b){return function(_0x3d8c13){if(!_0x3d8c13){_0xf1bfd6['sendStatus'](0x194);}return _0x3d8c13;};}function handleError(_0x2ace0e,_0x5e53c5){_0x5e53c5=_0x5e53c5||0x1f4;return function(_0x5e4f00){logger[_0x13a6('0x2b')](_0x5e4f00[_0x13a6('0x2c')]);if(_0x5e4f00[_0x13a6('0x2d')]){delete _0x5e4f00['name'];}_0x2ace0e[_0x13a6('0x2a')](_0x5e53c5)[_0x13a6('0x2e')](_0x5e4f00);};}exports['sendUserNotification']=function(_0x53e6e4,_0x54ce47,_0x262844){if(!_0x53e6e4[_0x13a6('0x2f')][_0x13a6('0x30')]('text')&&!_0x53e6e4['body'][_0x13a6('0x30')](_0x13a6('0x31'))){throw new db[(_0x13a6('0x32'))][(_0x13a6('0x33'))](_0x13a6('0x34'));}else{if(_0x53e6e4['body'][_0x13a6('0x30')](_0x13a6('0x31'))&&!_0x53e6e4[_0x13a6('0x2f')][_0x13a6('0x30')](_0x13a6('0x35'))){throw new db[(_0x13a6('0x32'))][(_0x13a6('0x33'))](_0x13a6('0x36'));}if(!_0x53e6e4[_0x13a6('0x2f')][_0x13a6('0x30')](_0x13a6('0x37'))){throw new db[(_0x13a6('0x32'))][(_0x13a6('0x33'))](_0x13a6('0x38'));}else{try{var _0x4dca74=JSON[_0x13a6('0x39')](_0x53e6e4[_0x13a6('0x2f')][_0x13a6('0x37')]);}catch(_0x341e20){logger[_0x13a6('0x2b')](_0x341e20);throw new db['Sequelize'][(_0x13a6('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5b2d88=[_0x13a6('0x3a'),_0x13a6('0x3b'),_0x13a6('0x3c'),_0x13a6('0x3d'),'smsqueue','voicequeue','whatsappqueue',_0x13a6('0x3e'),_0x13a6('0x3f')];if(_[_0x13a6('0x40')](_0x4dca74,function(_0x189824){return!_[_0x13a6('0x41')](_0x5b2d88,_0x189824[_0x13a6('0x42')]['toLowerCase']());})){throw new db[(_0x13a6('0x32'))][(_0x13a6('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x129b0a={};_0x129b0a[_0x13a6('0x43')]=_0x53e6e4[_0x13a6('0x2f')]['hasOwnProperty'](_0x13a6('0x43'))?_0x53e6e4[_0x13a6('0x2f')][_0x13a6('0x43')]:_0x53e6e4[_0x13a6('0x3f')][_0x13a6('0x44')];_0x129b0a[_0x13a6('0x45')]=_[_0x13a6('0x46')](_0x53e6e4['body'][_0x13a6('0x45')])?null:_0x53e6e4['body'][_0x13a6('0x45')];_0x129b0a['beep']=_0x53e6e4[_0x13a6('0x2f')][_0x13a6('0x47')]||![];_0x129b0a[_0x13a6('0x48')]=_0x53e6e4[_0x13a6('0x3f')]['id'];return getContent(_0x53e6e4[_0x13a6('0x2f')])[_0x13a6('0x28')](function(_0x3c80de){_0x129b0a['body']=_0x3c80de;return getRecipients(_0x4dca74);})[_0x13a6('0x28')](function(_0x4a46f7){_0x129b0a[_0x13a6('0x49')]=_['sortBy'](_0x4a46f7)['join'](',');return db[_0x13a6('0x4a')][_0x13a6('0x4b')](function(_0x48eef1){return db[_0x13a6('0x4c')]['create'](_0x129b0a,{'raw':!![],'transaction':_0x48eef1})[_0x13a6('0x28')](function(_0x11b1ea){var _0x10b4b2={'sender':_0x129b0a['senderName'],'description':_0x129b0a[_0x13a6('0x45')],'content':_0x129b0a['body'],'beep':_0x129b0a[_0x13a6('0x47')]};_0x4a46f7[_0x13a6('0x4d')](function(_0x51cee0){_0x10b4b2[_0x13a6('0x4e')]=_0x51cee0;socket[_0x13a6('0x4f')](_0x13a6('0x50'),_0x10b4b2);});return _0x11b1ea;});});})[_0x13a6('0x28')](respondWithResult(_0x54ce47,0xc9))[_0x13a6('0x51')](handleError(_0x54ce47,null));};function getContent(_0x37db64){return new BPromise(function(_0x2b0972,_0x120ac5){if(_0x37db64[_0x13a6('0x52')]){_0x2b0972(_0x37db64[_0x13a6('0x52')]);return;}return db[_0x13a6('0x53')]['findOne']({'attributes':[_0x13a6('0x54')],'where':{'id':_0x37db64[_0x13a6('0x31')]},'raw':!![]})[_0x13a6('0x28')](function(_0x719ec6){if(!_0x719ec6)throw new db[(_0x13a6('0x32'))]['ValidationError'](_0x13a6('0x55'));var _0x2bf6c7=Mustache[_0x13a6('0x56')](_0x719ec6[_0x13a6('0x54')],_0x37db64[_0x13a6('0x35')]);_0x2b0972(_0x2bf6c7);})['catch'](function(_0x3516da){_0x120ac5(_0x3516da);});});}function getRecipients(_0x2df88a){return new BPromise(function(_0x2bace1,_0x52dd2f){var _0x1a2557=[];var _0x28bc65=[];_0x2df88a['forEach'](function(_0x27e364){var _0x34f6cc=_['startCase'](_0x27e364[_0x13a6('0x42')][_0x13a6('0x57')]());if(_0x34f6cc===_0x13a6('0x58')){_0x1a2557=_[_0x13a6('0x59')](_0x1a2557,_0x27e364[_0x13a6('0x5a')]);}else{if(_[_0x13a6('0x41')](_0x34f6cc,_0x13a6('0x5b')))_0x34f6cc=_0x34f6cc[_0x13a6('0x5c')](_0x13a6('0x5b'),_0x13a6('0x5d'));_0x27e364[_0x13a6('0x5a')]['forEach'](function(_0x1db2ab){_0x28bc65['push'](getAgents(_0x34f6cc,_0x1db2ab));});}});return BPromise[_0x13a6('0x5e')](_0x28bc65)[_0x13a6('0x28')](function(_0x31863b){_0x1a2557=_[_0x13a6('0x59')](_0x1a2557,_[_0x13a6('0x5f')](_0x31863b));_0x2bace1(_0x1a2557);})['catch'](function(_0xd49851){_0x52dd2f(_0xd49851);});});}function getAgents(_0xe20d2b,_0x1ff07f){return new BPromise(function(_0x211b8a,_0x130c94){return db[_0xe20d2b][_0x13a6('0x60')]({'where':{'id':_0x1ff07f}})[_0x13a6('0x28')](function(_0x2240b6){return _0x2240b6[_0x13a6('0x61')]({'attributes':['id'],'raw':!![]})[_0x13a6('0x28')](function(_0x6733a0){var _0x4665ae=_['map'](_0x6733a0,'id');_0x211b8a(_0x4665ae);});})['catch'](function(_0x2614e8){_0x130c94(_0x2614e8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 8e29842..e8dce95 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 _0x4946=['exports','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x40227c,_0x5ba0a4){var _0x113636=function(_0x21b46c){while(--_0x21b46c){_0x40227c['push'](_0x40227c['shift']());}};_0x113636(++_0x5ba0a4);}(_0x4946,0x159));var _0x6494=function(_0x1102f6,_0xf579e6){_0x1102f6=_0x1102f6-0x0;var _0x5db145=_0x4946[_0x1102f6];return _0x5db145;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x6494('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6494('0x1')](0x0);var events={'afterCreate':_0x6494('0x2'),'afterUpdate':_0x6494('0x3'),'afterDestroy':_0x6494('0x4')};function emitEvent(_0x3d9316){return function(_0x482951,_0x19ae81,_0x418670){UserNotificationEvents[_0x6494('0x5')](_0x3d9316+':'+_0x482951['id'],_0x482951);UserNotificationEvents[_0x6494('0x5')](_0x3d9316,_0x482951);_0x418670(null);};}for(var e in events){if(events[_0x6494('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x6494('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xb0ad=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x2f70ba,_0x3eb2a4){var _0x5cb3e7=function(_0x5762e5){while(--_0x5762e5){_0x2f70ba['push'](_0x2f70ba['shift']());}};_0x5cb3e7(++_0x3eb2a4);}(_0xb0ad,0x87));var _0xdb0a=function(_0x3c5efa,_0x256459){_0x3c5efa=_0x3c5efa-0x0;var _0x4bc9ec=_0xb0ad[_0x3c5efa];return _0x4bc9ec;};'use strict';var EventEmitter=require(_0xdb0a('0x0'));var UserNotification=require(_0xdb0a('0x1'))['db'][_0xdb0a('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb0a('0x3')](0x0);var events={'afterCreate':_0xdb0a('0x4'),'afterUpdate':_0xdb0a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x448878){return function(_0x4feab3,_0x23ff99,_0x487eb2){UserNotificationEvents[_0xdb0a('0x6')](_0x448878+':'+_0x4feab3['id'],_0x4feab3);UserNotificationEvents['emit'](_0x448878,_0x4feab3);_0x487eb2(null);};}for(var e in events){if(events[_0xdb0a('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xdb0a('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 6dcda45..98cec53 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 _0xf2c9=['path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird'];(function(_0xdeea17,_0x2d08b7){var _0x467a89=function(_0x2d76e9){while(--_0x2d76e9){_0xdeea17['push'](_0xdeea17['shift']());}};_0x467a89(++_0x2d08b7);}(_0xf2c9,0xc3));var _0x9f2c=function(_0x2952fd,_0x57f845){_0x2952fd=_0x2952fd-0x0;var _0x49ccb5=_0xf2c9[_0x2952fd];return _0x49ccb5;};'use strict';var _=require('lodash');var util=require(_0x9f2c('0x0'));var logger=require('../../config/logger')(_0x9f2c('0x1'));var moment=require('moment');var BPromise=require(_0x9f2c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f2c('0x3'));var rimraf=require(_0x9f2c('0x4'));var config=require(_0x9f2c('0x5'));var attributes=require(_0x9f2c('0x6'));module['exports']=function(_0x4e8c25,_0x14d838){return _0x4e8c25[_0x9f2c('0x7')](_0x9f2c('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f2c('0x9'),'collate':_0x9f2c('0xa')});}; \ No newline at end of file +var _0xe0de=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci'];(function(_0x13405d,_0xe260e2){var _0x486569=function(_0x29457a){while(--_0x29457a){_0x13405d['push'](_0x13405d['shift']());}};_0x486569(++_0xe260e2);}(_0xe0de,0x1a0));var _0xee0d=function(_0x3105cf,_0x2382bf){_0x3105cf=_0x3105cf-0x0;var _0x2680fc=_0xe0de[_0x3105cf];return _0x2680fc;};'use strict';var _=require(_0xee0d('0x0'));var util=require(_0xee0d('0x1'));var logger=require(_0xee0d('0x2'))(_0xee0d('0x3'));var moment=require(_0xee0d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee0d('0x5'));var rimraf=require(_0xee0d('0x6'));var config=require(_0xee0d('0x7'));var attributes=require(_0xee0d('0x8'));module[_0xee0d('0x9')]=function(_0x1993db,_0x5e1297){return _0x1993db[_0xee0d('0xa')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee0d('0xb'),'collate':_0xee0d('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 5272e41..dedfe10 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 _0xbd61=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x37ae24,_0x197fbe){var _0x4b0056=function(_0x299952){while(--_0x299952){_0x37ae24['push'](_0x37ae24['shift']());}};_0x4b0056(++_0x197fbe);}(_0xbd61,0xe3));var _0x1bd6=function(_0x5c46cf,_0x39f5aa){_0x5c46cf=_0x5c46cf-0x0;var _0x13782e=_0xbd61[_0x5c46cf];return _0x13782e;};'use strict';var _=require(_0x1bd6('0x0'));var util=require(_0x1bd6('0x1'));var moment=require(_0x1bd6('0x2'));var BPromise=require(_0x1bd6('0x3'));var rs=require(_0x1bd6('0x4'));var fs=require('fs');var Redis=require(_0x1bd6('0x5'));var db=require(_0x1bd6('0x6'))['db'];var utils=require(_0x1bd6('0x7'));var logger=require(_0x1bd6('0x8'))(_0x1bd6('0x9'));var config=require(_0x1bd6('0xa'));var jayson=require(_0x1bd6('0xb'));var client=jayson[_0x1bd6('0xc')][_0x1bd6('0xd')]({'port':0x232a});config[_0x1bd6('0xe')]=_['defaults'](config[_0x1bd6('0xe')],{'host':_0x1bd6('0xf'),'port':0x18eb});var socket=require(_0x1bd6('0x10'))(new Redis(config[_0x1bd6('0xe')]));require(_0x1bd6('0x11'))[_0x1bd6('0x12')](socket);function respondWithRpcPromise(_0x4ae575,_0x98fdbc,_0x2ae641){return new BPromise(function(_0x3b2cec,_0x225897){return client['request'](_0x4ae575,_0x2ae641)[_0x1bd6('0x13')](function(_0xdfb8c5){logger[_0x1bd6('0x14')](_0x1bd6('0x15'),_0x98fdbc,_0x1bd6('0x16'));logger['debug'](_0x1bd6('0x17'),_0x98fdbc,_0x1bd6('0x16'),JSON[_0x1bd6('0x18')](_0xdfb8c5));if(_0xdfb8c5[_0x1bd6('0x19')]){if(_0xdfb8c5[_0x1bd6('0x19')][_0x1bd6('0x1a')]===0x1f4){logger[_0x1bd6('0x19')]('UserNotification,\x20%s,\x20%s',_0x98fdbc,_0xdfb8c5[_0x1bd6('0x19')]['message']);return _0x225897(_0xdfb8c5['error'][_0x1bd6('0x1b')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x98fdbc,_0xdfb8c5[_0x1bd6('0x19')][_0x1bd6('0x1b')]);return _0x3b2cec(_0xdfb8c5['error']['message']);}else{logger['info'](_0x1bd6('0x15'),_0x98fdbc,_0x1bd6('0x16'));_0x3b2cec(_0xdfb8c5[_0x1bd6('0x1c')][_0x1bd6('0x1b')]);}})['catch'](function(_0x24c7f4){logger[_0x1bd6('0x19')]('UserNotification,\x20%s,\x20%s',_0x98fdbc,_0x24c7f4);_0x225897(_0x24c7f4);});});} \ No newline at end of file +var _0xcea5=['localhost','redis','./userNotification.socket','request','info','request\x20sent','debug','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x5f18df,_0x3d99a0){var _0x26ec85=function(_0xaa1cfc){while(--_0xaa1cfc){_0x5f18df['push'](_0x5f18df['shift']());}};_0x26ec85(++_0x3d99a0);}(_0xcea5,0x145));var _0x5cea=function(_0x3dfe5b,_0x14a6b8){_0x3dfe5b=_0x3dfe5b-0x0;var _0x45def7=_0xcea5[_0x3dfe5b];return _0x45def7;};'use strict';var _=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var moment=require(_0x5cea('0x2'));var BPromise=require(_0x5cea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5cea('0x5'));var config=require(_0x5cea('0x6'));var jayson=require(_0x5cea('0x7'));var client=jayson[_0x5cea('0x8')][_0x5cea('0x9')]({'port':0x232a});config['redis']=_[_0x5cea('0xa')](config['redis'],{'host':_0x5cea('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5cea('0xc')]));require(_0x5cea('0xd'))['register'](socket);function respondWithRpcPromise(_0x97bef0,_0x3465a8,_0x261ee0){return new BPromise(function(_0x2fe27f,_0x2d030f){return client[_0x5cea('0xe')](_0x97bef0,_0x261ee0)['then'](function(_0x50efba){logger[_0x5cea('0xf')]('UserNotification,\x20%s,\x20%s',_0x3465a8,_0x5cea('0x10'));logger[_0x5cea('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3465a8,_0x5cea('0x10'),JSON[_0x5cea('0x12')](_0x50efba));if(_0x50efba[_0x5cea('0x13')]){if(_0x50efba['error'][_0x5cea('0x14')]===0x1f4){logger['error'](_0x5cea('0x15'),_0x3465a8,_0x50efba['error'][_0x5cea('0x16')]);return _0x2d030f(_0x50efba[_0x5cea('0x13')]['message']);}logger[_0x5cea('0x13')](_0x5cea('0x15'),_0x3465a8,_0x50efba[_0x5cea('0x13')][_0x5cea('0x16')]);return _0x2fe27f(_0x50efba[_0x5cea('0x13')]['message']);}else{logger[_0x5cea('0xf')](_0x5cea('0x15'),_0x3465a8,_0x5cea('0x10'));_0x2fe27f(_0x50efba[_0x5cea('0x17')][_0x5cea('0x16')]);}})['catch'](function(_0x4cfe47){logger[_0x5cea('0x13')](_0x5cea('0x15'),_0x3465a8,_0x4cfe47);_0x2d030f(_0x4cfe47);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 5fb4d8c..3fa6c5a 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 _0x3540=['length','update','removeListener'];(function(_0x1331ba,_0x25b4b3){var _0x5a7e89=function(_0xbc1425){while(--_0xbc1425){_0x1331ba['push'](_0x1331ba['shift']());}};_0x5a7e89(++_0x25b4b3);}(_0x3540,0x1cc));var _0x0354=function(_0x179f20,_0x3e7a96){_0x179f20=_0x179f20-0x0;var _0x2afe43=_0x3540[_0x179f20];return _0x2afe43;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save','remove',_0x0354('0x0')];function createListener(_0x14f0bf,_0x54db5f){return function(_0x520ad8){_0x54db5f['emit'](_0x14f0bf,_0x520ad8);};}function removeListener(_0x43e516,_0xf47a45){return function(){UserNotificationEvents[_0x0354('0x1')](_0x43e516,_0xf47a45);};}exports['register']=function(_0x185964){for(var _0x3c8512=0x0,_0x76ea16=events[_0x0354('0x2')];_0x3c8512<_0x76ea16;_0x3c8512++){var _0x4e541c=events[_0x3c8512];var _0x5f21d2=createListener('userNotification:'+_0x4e541c,_0x185964);UserNotificationEvents['on'](_0x4e541c,_0x5f21d2);}}; \ No newline at end of file +var _0x9682=['userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x27ac99,_0x44507f){var _0xad7b49=function(_0x3b231b){while(--_0x3b231b){_0x27ac99['push'](_0x27ac99['shift']());}};_0xad7b49(++_0x44507f);}(_0x9682,0x181));var _0x2968=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9682[_0x3dd15e];return _0x231fd0;};'use strict';var UserNotificationEvents=require(_0x2968('0x0'));var events=[_0x2968('0x1'),_0x2968('0x2'),_0x2968('0x3')];function createListener(_0x53f2a4,_0xb345d4){return function(_0x522d5e){_0xb345d4[_0x2968('0x4')](_0x53f2a4,_0x522d5e);};}function removeListener(_0xb8d234,_0x6cc560){return function(){UserNotificationEvents[_0x2968('0x5')](_0xb8d234,_0x6cc560);};}exports[_0x2968('0x6')]=function(_0x24287a){for(var _0x5e481d=0x0,_0x14665d=events['length'];_0x5e481d<_0x14665d;_0x5e481d++){var _0x42b571=events[_0x5e481d];var _0x4200b6=createListener(_0x2968('0x7')+_0x42b571,_0x24287a);UserNotificationEvents['on'](_0x42b571,_0x4200b6);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 3560e8f..efcdf29 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x11afa2,_0x19b874){var _0x56abd2=function(_0x2aea65){while(--_0x2aea65){_0x11afa2['push'](_0x11afa2['shift']());}};_0x56abd2(++_0x19b874);}(_0xe706,0xa3));var _0x6e70=function(_0x1e830c,_0x31776b){_0x1e830c=_0x1e830c-0x0;var _0x3196e9=_0xe706[_0x1e830c];return _0x3196e9;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4a026a,_0x1a2393){var _0x4cc14b=function(_0x1c0c59){while(--_0x1c0c59){_0x4a026a['push'](_0x4a026a['shift']());}};_0x4cc14b(++_0x1a2393);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xcb91[_0x43f881];return _0x365c14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index bf3c8d6..267bdb5 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 _0xf6ab=['INTEGER'];(function(_0x89cbd7,_0xf5abda){var _0x37df6e=function(_0x14aea6){while(--_0x14aea6){_0x89cbd7['push'](_0x89cbd7['shift']());}};_0x37df6e(++_0xf5abda);}(_0xf6ab,0xfe));var _0xbf6a=function(_0x2a84cf,_0x13d6c0){_0x2a84cf=_0x2a84cf-0x0;var _0x45e18a=_0xf6ab[_0x2a84cf];return _0x45e18a;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xbf6a('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xec6e=['sequelize','exports'];(function(_0x5e3892,_0x36a005){var _0x490318=function(_0xe18c86){while(--_0xe18c86){_0x5e3892['push'](_0x5e3892['shift']());}};_0x490318(++_0x36a005);}(_0xec6e,0x10a));var _0xeec6=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xec6e[_0x453e2b];return _0x50f306;};'use strict';var Sequelize=require(_0xeec6('0x0'));module[_0xeec6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index b40bc92..4c97f74 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 _0xc372=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','util','../../config/logger','api','request-promise'];(function(_0x5f0064,_0x3422f5){var _0x267f22=function(_0x2c42ae){while(--_0x2c42ae){_0x5f0064['push'](_0x5f0064['shift']());}};_0x267f22(++_0x3422f5);}(_0xc372,0x1d0));var _0x2c37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc372[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x2c37('0x0'));var logger=require(_0x2c37('0x1'))(_0x2c37('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2c37('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c37('0x4'));var config=require(_0x2c37('0x5'));var attributes=require(_0x2c37('0x6'));module[_0x2c37('0x7')]=function(_0x5d90ea,_0x43c12c){return _0x5d90ea[_0x2c37('0x8')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0274=['bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x38c81a,_0x3e0a4b){var _0x3ff022=function(_0x3d5db9){while(--_0x3d5db9){_0x38c81a['push'](_0x38c81a['shift']());}};_0x3ff022(++_0x3e0a4b);}(_0x0274,0x17d));var _0x4027=function(_0x28cc7c,_0x24742f){_0x28cc7c=_0x28cc7c-0x0;var _0x208193=_0x0274[_0x28cc7c];return _0x208193;};'use strict';var _=require(_0x4027('0x0'));var util=require('util');var logger=require(_0x4027('0x1'))(_0x4027('0x2'));var moment=require('moment');var BPromise=require(_0x4027('0x3'));var rp=require(_0x4027('0x4'));var fs=require('fs');var path=require(_0x4027('0x5'));var rimraf=require(_0x4027('0x6'));var config=require(_0x4027('0x7'));var attributes=require(_0x4027('0x8'));module[_0x4027('0x9')]=function(_0xa34fae,_0x43b394){return _0xa34fae[_0x4027('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x4027('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 621f699..e8eeda9 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 _0x6c5e=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6c5e,0x1a8));var _0xe6c5=function(_0x271474,_0x248441){_0x271474=_0x271474-0x0;var _0x72f117=_0x6c5e[_0x271474];return _0x72f117;};'use strict';var _=require('lodash');var util=require(_0xe6c5('0x0'));var moment=require(_0xe6c5('0x1'));var BPromise=require(_0xe6c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6c5('0x3'));var db=require(_0xe6c5('0x4'))['db'];var utils=require(_0xe6c5('0x5'));var logger=require(_0xe6c5('0x6'))(_0xe6c5('0x7'));var config=require(_0xe6c5('0x8'));var jayson=require(_0xe6c5('0x9'));var client=jayson[_0xe6c5('0xa')][_0xe6c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x564716,_0x266ec8,_0x25d6a0){return new BPromise(function(_0x5c8729,_0x2d7bcd){return client[_0xe6c5('0xc')](_0x564716,_0x25d6a0)[_0xe6c5('0xd')](function(_0x5a9acd){logger[_0xe6c5('0xe')](_0xe6c5('0xf'),_0x266ec8,_0xe6c5('0x10'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x266ec8,_0xe6c5('0x10'),JSON[_0xe6c5('0x11')](_0x5a9acd));if(_0x5a9acd['error']){if(_0x5a9acd[_0xe6c5('0x12')][_0xe6c5('0x13')]===0x1f4){logger[_0xe6c5('0x12')](_0xe6c5('0xf'),_0x266ec8,_0x5a9acd[_0xe6c5('0x12')][_0xe6c5('0x14')]);return _0x2d7bcd(_0x5a9acd[_0xe6c5('0x12')]['message']);}logger[_0xe6c5('0x12')](_0xe6c5('0xf'),_0x266ec8,_0x5a9acd[_0xe6c5('0x12')][_0xe6c5('0x14')]);return _0x5c8729(_0x5a9acd[_0xe6c5('0x12')][_0xe6c5('0x14')]);}else{logger[_0xe6c5('0xe')](_0xe6c5('0xf'),_0x266ec8,_0xe6c5('0x10'));_0x5c8729(_0x5a9acd[_0xe6c5('0x15')][_0xe6c5('0x14')]);}})[_0xe6c5('0x16')](function(_0x3a2d44){logger['error'](_0xe6c5('0xf'),_0x266ec8,_0x3a2d44);_0x2d7bcd(_0x3a2d44);});});} \ No newline at end of file +var _0x281d=['jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x555ef8,_0x43e041){var _0x38cc30=function(_0x105961){while(--_0x105961){_0x555ef8['push'](_0x555ef8['shift']());}};_0x38cc30(++_0x43e041);}(_0x281d,0xc5));var _0xd281=function(_0xb30206,_0x44ba88){_0xb30206=_0xb30206-0x0;var _0x8963fe=_0x281d[_0xb30206];return _0x8963fe;};'use strict';var _=require(_0xd281('0x0'));var util=require(_0xd281('0x1'));var moment=require('moment');var BPromise=require(_0xd281('0x2'));var rs=require(_0xd281('0x3'));var fs=require('fs');var Redis=require(_0xd281('0x4'));var db=require(_0xd281('0x5'))['db'];var utils=require(_0xd281('0x6'));var logger=require(_0xd281('0x7'))(_0xd281('0x8'));var config=require(_0xd281('0x9'));var jayson=require(_0xd281('0xa'));var client=jayson[_0xd281('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47fbea,_0x659b16,_0x300f57){return new BPromise(function(_0x330c51,_0x2c3be6){return client[_0xd281('0xc')](_0x47fbea,_0x300f57)[_0xd281('0xd')](function(_0x4c8cf8){logger[_0xd281('0xe')](_0xd281('0xf'),_0x659b16,_0xd281('0x10'));logger['debug'](_0xd281('0x11'),_0x659b16,'request\x20sent',JSON[_0xd281('0x12')](_0x4c8cf8));if(_0x4c8cf8[_0xd281('0x13')]){if(_0x4c8cf8[_0xd281('0x13')]['code']===0x1f4){logger[_0xd281('0x13')](_0xd281('0xf'),_0x659b16,_0x4c8cf8[_0xd281('0x13')]['message']);return _0x2c3be6(_0x4c8cf8[_0xd281('0x13')][_0xd281('0x14')]);}logger[_0xd281('0x13')](_0xd281('0xf'),_0x659b16,_0x4c8cf8[_0xd281('0x13')][_0xd281('0x14')]);return _0x330c51(_0x4c8cf8[_0xd281('0x13')][_0xd281('0x14')]);}else{logger[_0xd281('0xe')](_0xd281('0xf'),_0x659b16,_0xd281('0x10'));_0x330c51(_0x4c8cf8[_0xd281('0x15')][_0xd281('0x14')]);}})[_0xd281('0x16')](function(_0x3519d5){logger[_0xd281('0x13')](_0xd281('0xf'),_0x659b16,_0x3519d5);_0x2c3be6(_0x3519d5);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3d0b068..a1dc742 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 _0xf043=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','create','/:id/clone','post','addSections','addResources','put','update','removeSections','delete','removeResources','multer','path'];(function(_0x29371b,_0x36f0ae){var _0x15d12c=function(_0xa9c043){while(--_0xa9c043){_0x29371b['push'](_0x29371b['shift']());}};_0x15d12c(++_0x36f0ae);}(_0xf043,0x132));var _0x3f04=function(_0x5e52a8,_0x107ee2){_0x5e52a8=_0x5e52a8-0x0;var _0x528506=_0xf043[_0x5e52a8];return _0x528506;};'use strict';var multer=require(_0x3f04('0x0'));var util=require('util');var path=require(_0x3f04('0x1'));var timeout=require('connect-timeout');var express=require(_0x3f04('0x2'));var router=express[_0x3f04('0x3')]();var fs_extra=require(_0x3f04('0x4'));var auth=require(_0x3f04('0x5'));var interaction=require(_0x3f04('0x6'));var config=require(_0x3f04('0x7'));var controller=require(_0x3f04('0x8'));router[_0x3f04('0x9')]('/',auth[_0x3f04('0xa')](),controller[_0x3f04('0xb')]);router[_0x3f04('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3f04('0xc')]);router['get'](_0x3f04('0xd'),auth[_0x3f04('0xa')](),controller[_0x3f04('0xe')]);router['get'](_0x3f04('0xf'),auth[_0x3f04('0xa')](),controller[_0x3f04('0x10')]);router[_0x3f04('0x9')](_0x3f04('0x11'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0x3f04('0xa')](),controller[_0x3f04('0x12')]);router['post'](_0x3f04('0x13'),auth[_0x3f04('0xa')](),controller['clone']);router[_0x3f04('0x14')](_0x3f04('0xf'),auth[_0x3f04('0xa')](),controller[_0x3f04('0x15')]);router[_0x3f04('0x14')](_0x3f04('0x11'),auth[_0x3f04('0xa')](),controller[_0x3f04('0x16')]);router[_0x3f04('0x17')](_0x3f04('0xd'),auth['isAuthenticated'](),controller[_0x3f04('0x18')]);router['delete'](_0x3f04('0xd'),auth[_0x3f04('0xa')](),controller['destroy']);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0x3f04('0x19')]);router[_0x3f04('0x1a')]('/:id/resources',auth['isAuthenticated'](),controller[_0x3f04('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2610=['addResources','put','/:id','update','delete','destroy','removeResources','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','getSections','/:id/resources','post','create','/:id/clone','/:id/sections','addSections'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x2610,0xc4));var _0x0261=function(_0x3eb211,_0x4a2e7f){_0x3eb211=_0x3eb211-0x0;var _0xb32a15=_0x2610[_0x3eb211];return _0xb32a15;};'use strict';var multer=require(_0x0261('0x0'));var util=require(_0x0261('0x1'));var path=require(_0x0261('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0261('0x3')]();var fs_extra=require(_0x0261('0x4'));var auth=require(_0x0261('0x5'));var interaction=require(_0x0261('0x6'));var config=require(_0x0261('0x7'));var controller=require('./userProfile.controller');router[_0x0261('0x8')]('/',auth['isAuthenticated'](),controller[_0x0261('0x9')]);router[_0x0261('0x8')](_0x0261('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0261('0x8')]('/:id',auth[_0x0261('0xb')](),controller[_0x0261('0xc')]);router[_0x0261('0x8')]('/:id/sections',auth[_0x0261('0xb')](),controller[_0x0261('0xd')]);router[_0x0261('0x8')](_0x0261('0xe'),auth['isAuthenticated'](),controller['getResources']);router[_0x0261('0xf')]('/',auth[_0x0261('0xb')](),controller[_0x0261('0x10')]);router[_0x0261('0xf')](_0x0261('0x11'),auth[_0x0261('0xb')](),controller['clone']);router[_0x0261('0xf')](_0x0261('0x12'),auth[_0x0261('0xb')](),controller[_0x0261('0x13')]);router[_0x0261('0xf')](_0x0261('0xe'),auth[_0x0261('0xb')](),controller[_0x0261('0x14')]);router[_0x0261('0x15')](_0x0261('0x16'),auth['isAuthenticated'](),controller[_0x0261('0x17')]);router[_0x0261('0x18')](_0x0261('0x16'),auth[_0x0261('0xb')](),controller[_0x0261('0x19')]);router[_0x0261('0x18')]('/:id/sections',auth[_0x0261('0xb')](),controller['removeSections']);router[_0x0261('0x18')](_0x0261('0xe'),auth[_0x0261('0xb')](),controller[_0x0261('0x1a')]);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 136f3b4..21d2685 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 _0x22dc=['crudPermissions','getDataValue','BOOLEAN','exports','STRING','name','join'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x22dc,0x11b));var _0xc22d=function(_0x20df6b,_0x4f5b3e){_0x20df6b=_0x20df6b-0x0;var _0x392ba4=_0x22dc[_0x20df6b];return _0x392ba4;};'use strict';var Sequelize=require('sequelize');module[_0xc22d('0x0')]={'name':{'type':Sequelize[_0xc22d('0x1')],'allowNull':![],'unique':_0xc22d('0x2')},'crudPermissions':{'type':Sequelize[_0xc22d('0x1')],'set':function(_0x396b2f){this['setDataValue']('crudPermissions',_0x396b2f?_0x396b2f[_0xc22d('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0xc22d('0x4'))?this[_0xc22d('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc22d('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xab44=['getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x523d2f,_0x203c55){var _0x18447f=function(_0x1451f6){while(--_0x1451f6){_0x523d2f['push'](_0x523d2f['shift']());}};_0x18447f(++_0x203c55);}(_0xab44,0x93));var _0x4ab4=function(_0x535561,_0x565e89){_0x535561=_0x535561-0x0;var _0x3724c8=_0xab44[_0x535561];return _0x3724c8;};'use strict';var Sequelize=require('sequelize');module[_0x4ab4('0x0')]={'name':{'type':Sequelize[_0x4ab4('0x1')],'allowNull':![],'unique':_0x4ab4('0x2')},'crudPermissions':{'type':Sequelize[_0x4ab4('0x1')],'set':function(_0x1de8a1){this[_0x4ab4('0x3')](_0x4ab4('0x4'),_0x1de8a1?_0x1de8a1['join'](''):[]);},'get':function(){return this[_0x4ab4('0x5')]('crudPermissions')?this[_0x4ab4('0x5')](_0x4ab4('0x4'))[_0x4ab4('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4ab4('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4ab4('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4ab4('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4ab4('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4ab4('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index c050a4e..dca5371 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 _0x6def=['sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','sequelize','push','removeSections','ids','getSections','filter','includes','isEmpty','subsections','enabled','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register'];(function(_0x521b61,_0x47e2b4){var _0x476cdf=function(_0xbca2ca){while(--_0xbca2ca){_0x521b61['push'](_0x521b61['shift']());}};_0x476cdf(++_0x47e2b4);}(_0x6def,0x1c3));var _0xf6de=function(_0x2d5704,_0x4ce614){_0x2d5704=_0x2d5704-0x0;var _0x159794=_0x6def[_0x2d5704];return _0x159794;};'use strict';var emlformat=require(_0xf6de('0x0'));var rimraf=require(_0xf6de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6de('0x2'));var rp=require('request-promise');var moment=require(_0xf6de('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf6de('0x4'));var util=require(_0xf6de('0x5'));var path=require(_0xf6de('0x6'));var sox=require(_0xf6de('0x7'));var csv=require(_0xf6de('0x8'));var ejs=require(_0xf6de('0x9'));var fs=require('fs');var fs_extra=require(_0xf6de('0xa'));var _=require(_0xf6de('0xb'));var squel=require(_0xf6de('0xc'));var crypto=require(_0xf6de('0xd'));var jsforce=require(_0xf6de('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf6de('0x8'));var querystring=require(_0xf6de('0xf'));var Papa=require(_0xf6de('0x10'));var Redis=require(_0xf6de('0x11'));var authService=require(_0xf6de('0x12'));var qs=require(_0xf6de('0x13'));var as=require(_0xf6de('0x14'));var hardwareService=require(_0xf6de('0x15'));var logger=require(_0xf6de('0x16'))(_0xf6de('0x17'));var utils=require(_0xf6de('0x18'));var config=require(_0xf6de('0x19'));var licenseUtil=require(_0xf6de('0x1a'));var db=require(_0xf6de('0x1b'))['db'];config[_0xf6de('0x1c')]=_['defaults'](config[_0xf6de('0x1c')],{'host':_0xf6de('0x1d'),'port':0x18eb});var socket=require(_0xf6de('0x1e'))(new Redis(config[_0xf6de('0x1c')]));require(_0xf6de('0x1f'))[_0xf6de('0x20')](socket);function respondWithStatusCode(_0x46c511,_0x44f78e){_0x44f78e=_0x44f78e||0xcc;return function(_0x208597){if(_0x208597){return _0x46c511[_0xf6de('0x21')](_0x44f78e);}return _0x46c511[_0xf6de('0x22')](_0x44f78e)['end']();};}function respondWithResult(_0x1cdb50,_0x3d34da){_0x3d34da=_0x3d34da||0xc8;return function(_0x322503){if(_0x322503){return _0x1cdb50['status'](_0x3d34da)[_0xf6de('0x23')](_0x322503);}};}function respondWithFilteredResult(_0x363fda,_0x2d6e52){return function(_0xc4d732){if(_0xc4d732){var _0x1815dd=typeof _0x2d6e52[_0xf6de('0x24')]==='undefined'&&typeof _0x2d6e52[_0xf6de('0x25')]===_0xf6de('0x26');var _0x75c44b=_0xc4d732[_0xf6de('0x27')];var _0x10347f=_0x1815dd?0x0:_0x2d6e52[_0xf6de('0x24')];var _0x8c4c5b=_0x1815dd?_0xc4d732[_0xf6de('0x27')]:_0x2d6e52['offset']+_0x2d6e52['limit'];var _0x5913d7;if(_0x8c4c5b>=_0x75c44b){_0x8c4c5b=_0x75c44b;_0x5913d7=0xc8;}else{_0x5913d7=0xce;}_0x363fda[_0xf6de('0x22')](_0x5913d7);return _0x363fda[_0xf6de('0x28')](_0xf6de('0x29'),_0x10347f+'-'+_0x8c4c5b+'/'+_0x75c44b)['json'](_0xc4d732);}return null;};}function patchUpdates(_0x495e89){return function(_0x16dea4){try{jsonpatch[_0xf6de('0x2a')](_0x16dea4,_0x495e89,!![]);}catch(_0x1b4210){return BPromise[_0xf6de('0x2b')](_0x1b4210);}return _0x16dea4[_0xf6de('0x2c')]();};}function saveUpdates(_0x128729,_0x2ce7b9){return function(_0x5088b6){if(_0x5088b6){return _0x5088b6['update'](_0x128729)[_0xf6de('0x2d')](function(_0x2f9488){return _0x2f9488;});}return null;};}function removeEntity(_0x363dd3,_0x21de5b){return function(_0x389ef0){if(_0x389ef0){return _0x389ef0[_0xf6de('0x2e')]()[_0xf6de('0x2d')](function(){_0x363dd3[_0xf6de('0x22')](0xcc)[_0xf6de('0x2f')]();});}};}function handleEntityNotFound(_0x13cb05,_0x146480){return function(_0x297777){if(!_0x297777){_0x13cb05[_0xf6de('0x21')](0x194);}return _0x297777;};}function handleError(_0x1b547b,_0x36f0a3){_0x36f0a3=_0x36f0a3||0x1f4;return function(_0x35abac){logger[_0xf6de('0x30')](_0x35abac[_0xf6de('0x31')]);if(_0x35abac[_0xf6de('0x32')]){delete _0x35abac[_0xf6de('0x32')];}_0x1b547b[_0xf6de('0x22')](_0x36f0a3)['send'](_0x35abac);};}exports[_0xf6de('0x33')]=function(_0x179ea4,_0xbb6e51){var _0x471748={},_0x30b80a={},_0x25b687={'count':0x0,'rows':[]};var _0x5ef2a1=_[_0xf6de('0x34')](db[_0xf6de('0x35')][_0xf6de('0x36')],function(_0x210c22){return{'name':_0x210c22[_0xf6de('0x37')],'type':_0x210c22['type'][_0xf6de('0x38')]};});_0x30b80a[_0xf6de('0x39')]=_['map'](_0x5ef2a1,_0xf6de('0x32'));_0x30b80a[_0xf6de('0x3a')]=_[_0xf6de('0x3b')](_0x179ea4[_0xf6de('0x3a')]);_0x30b80a[_0xf6de('0x3c')]=_[_0xf6de('0x3d')](_0x30b80a[_0xf6de('0x39')],_0x30b80a[_0xf6de('0x3a')]);_0x471748[_0xf6de('0x3e')]=_['intersection'](_0x30b80a['model'],qs[_0xf6de('0x3f')](_0x179ea4[_0xf6de('0x3a')]['fields']));_0x471748[_0xf6de('0x3e')]=_0x471748[_0xf6de('0x3e')][_0xf6de('0x40')]?_0x471748[_0xf6de('0x3e')]:_0x30b80a['model'];if(!_0x179ea4[_0xf6de('0x3a')][_0xf6de('0x41')]('nolimit')){_0x471748[_0xf6de('0x25')]=qs[_0xf6de('0x25')](_0x179ea4[_0xf6de('0x3a')][_0xf6de('0x25')]);_0x471748['offset']=qs['offset'](_0x179ea4[_0xf6de('0x3a')][_0xf6de('0x24')]);}_0x471748[_0xf6de('0x42')]=qs[_0xf6de('0x43')](_0x179ea4[_0xf6de('0x3a')][_0xf6de('0x43')]);_0x471748[_0xf6de('0x44')]=qs['filters'](_['pick'](_0x179ea4[_0xf6de('0x3a')],_0x30b80a[_0xf6de('0x3c')]),_0x5ef2a1);if(_0x179ea4[_0xf6de('0x3a')]['filter']){_0x471748['where']=_[_0xf6de('0x45')](_0x471748[_0xf6de('0x44')],{'$or':_[_0xf6de('0x34')](_0x5ef2a1,function(_0x29f198){if(_0x29f198[_0xf6de('0x46')]!==_0xf6de('0x47')){var _0x13ee08={};_0x13ee08[_0x29f198[_0xf6de('0x32')]]={'$like':'%'+_0x179ea4[_0xf6de('0x3a')]['filter']+'%'};return _0x13ee08;}})});}_0x471748=_[_0xf6de('0x45')]({},_0x471748,_0x179ea4[_0xf6de('0x48')]);var _0x52eae3={'where':_0x471748[_0xf6de('0x44')]};return db[_0xf6de('0x35')]['count'](_0x52eae3)['then'](function(_0x17d816){_0x25b687[_0xf6de('0x27')]=_0x17d816;if(_0x179ea4['query'][_0xf6de('0x49')]){_0x471748[_0xf6de('0x4a')]=[{'all':!![]}];}return db[_0xf6de('0x35')][_0xf6de('0x4b')](_0x471748);})[_0xf6de('0x2d')](function(_0x1968d0){_0x25b687[_0xf6de('0x4c')]=_0x1968d0;return _0x25b687;})['then'](respondWithFilteredResult(_0xbb6e51,_0x471748))[_0xf6de('0x4d')](handleError(_0xbb6e51,null));};exports['show']=function(_0x5081b3,_0x64f087){var _0x1ba8fc={'raw':![],'where':{'id':_0x5081b3[_0xf6de('0x4e')]['id']}},_0x8e3067={};_0x8e3067[_0xf6de('0x39')]=_['keys'](db[_0xf6de('0x35')][_0xf6de('0x36')]);_0x8e3067[_0xf6de('0x3a')]=_[_0xf6de('0x3b')](_0x5081b3[_0xf6de('0x3a')]);_0x8e3067[_0xf6de('0x3c')]=_[_0xf6de('0x3d')](_0x8e3067[_0xf6de('0x39')],_0x8e3067[_0xf6de('0x3a')]);_0x1ba8fc[_0xf6de('0x3e')]=_['intersection'](_0x8e3067[_0xf6de('0x39')],qs[_0xf6de('0x3f')](_0x5081b3[_0xf6de('0x3a')][_0xf6de('0x3f')]));_0x1ba8fc[_0xf6de('0x3e')]=_0x1ba8fc[_0xf6de('0x3e')][_0xf6de('0x40')]?_0x1ba8fc['attributes']:_0x8e3067[_0xf6de('0x39')];if(_0x5081b3[_0xf6de('0x3a')][_0xf6de('0x49')]){_0x1ba8fc[_0xf6de('0x4a')]=[{'all':!![]}];}_0x1ba8fc=_[_0xf6de('0x45')]({},_0x1ba8fc,_0x5081b3[_0xf6de('0x48')]);return db[_0xf6de('0x35')][_0xf6de('0x4f')](_0x1ba8fc)['then'](handleEntityNotFound(_0x64f087,null))['then'](respondWithResult(_0x64f087,null))[_0xf6de('0x4d')](handleError(_0x64f087,null));};exports[_0xf6de('0x50')]=function(_0x2a25e5,_0x446445){return db['UserProfile']['create'](_0x2a25e5[_0xf6de('0x51')],{})['then'](respondWithResult(_0x446445,0xc9))[_0xf6de('0x4d')](handleError(_0x446445,null));};exports[_0xf6de('0x52')]=function(_0x17d6ad,_0x5f2e20){var _0x389341={'where':{'id':_0x17d6ad[_0xf6de('0x4e')]['id']}},_0x323be7={};_0x323be7[_0xf6de('0x39')]=_['keys'](db[_0xf6de('0x35')]['rawAttributes']);_0x389341[_0xf6de('0x3e')]=_['intersection'](_0x323be7[_0xf6de('0x39')],qs['fields'](_0x17d6ad[_0xf6de('0x3a')][_0xf6de('0x3f')]));_0x389341[_0xf6de('0x3e')]=_0x389341['attributes'][_0xf6de('0x40')]?_0x389341[_0xf6de('0x3e')]:_0x323be7[_0xf6de('0x39')];if(_0x17d6ad['query'][_0xf6de('0x49')]){_0x389341[_0xf6de('0x4a')]=[{'all':!![]}];}_0x389341=_[_0xf6de('0x45')]({},_0x389341,_0x17d6ad[_0xf6de('0x48')]);return db['UserProfile'][_0xf6de('0x4f')](_0x389341)[_0xf6de('0x2d')](handleEntityNotFound(_0x5f2e20,null))[_0xf6de('0x2d')](function(_0x4e41ee){if(_0x4e41ee){var _0x488bfd=_0x4e41ee[_0xf6de('0x53')]({'plain':!![]});_0x488bfd=qs[_0xf6de('0x54')](_0x488bfd,['id','createdAt',_0xf6de('0x55'),_0xf6de('0x56')]);_0x17d6ad[_0xf6de('0x51')]=_[_0xf6de('0x54')](_0x17d6ad[_0xf6de('0x51')],['id',_0xf6de('0x57'),_0xf6de('0x55')]);return db['sequelize'][_0xf6de('0x58')](function(_0x29f26a){return db[_0xf6de('0x35')]['create'](_[_0xf6de('0x45')](_0x488bfd,_0x17d6ad[_0xf6de('0x51')]),{'include':_0x17d6ad['query'][_0xf6de('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x29f26a})[_0xf6de('0x2d')](function(_0x4b3d21){var _0x51fb49=_0x4b3d21[_0xf6de('0x53')]({'plain':!![]});return db[_0xf6de('0x59')]['findAll']({'where':{'userProfileId':_0x17d6ad['params']['id']},'raw':!![]})[_0xf6de('0x2d')](function(_0x4a9732){if(_0x4a9732){return BPromise[_0xf6de('0x5a')](_0x4a9732,function(_0x38c7f9){return new BPromise(function(_0x49530b,_0x22be08){if(_0x38c7f9[_0xf6de('0x5b')]===null||_0x38c7f9[_0xf6de('0x5b')]===0x1)_0x49530b(null);return db[_0xf6de('0x5c')][_0xf6de('0x4b')]({'where':{'sectionId':_0x38c7f9['id']},'raw':!![]})[_0xf6de('0x2d')](function(_0x51aa3d){var _0xe5382e=_[_0xf6de('0x34')](_0x51aa3d,function(_0x314e8c){return qs[_0xf6de('0x54')](_0x314e8c,['id',_0xf6de('0x57'),_0xf6de('0x55'),_0xf6de('0x5d')]);});_0x49530b(_0xe5382e);})[_0xf6de('0x4d')](function(_0x112c69){_0x22be08(_0x112c69);});})[_0xf6de('0x2d')](function(_0x59605a){var _0x5d9173=qs[_0xf6de('0x54')](_0x38c7f9,['id',_0xf6de('0x57'),'updatedAt']);_0x5d9173[_0xf6de('0x5e')]=_0x51fb49['id'];if(_0x59605a)_0x5d9173[_0xf6de('0x5f')]=_0x59605a;return _0x5d9173;})[_0xf6de('0x2d')](function(_0x4a9b2f){return db[_0xf6de('0x59')]['create'](_0x4a9b2f,{'include':[{'model':db[_0xf6de('0x5c')],'as':'Resources'}],'raw':!![],'transaction':_0x29f26a});});})[_0xf6de('0x2d')](function(){return _0x51fb49;});}});});});}})[_0xf6de('0x2d')](respondWithResult(_0x5f2e20,0xc9))[_0xf6de('0x4d')](handleError(_0x5f2e20,null));};exports[_0xf6de('0x60')]=function(_0x47f325,_0x2f9a24){if(_0x47f325[_0xf6de('0x51')]['id']){delete _0x47f325[_0xf6de('0x51')]['id'];}return db[_0xf6de('0x35')][_0xf6de('0x4f')]({'where':{'id':_0x47f325['params']['id']}})[_0xf6de('0x2d')](handleEntityNotFound(_0x2f9a24,null))['then'](saveUpdates(_0x47f325['body'],null))['then'](respondWithResult(_0x2f9a24,null))['catch'](handleError(_0x2f9a24,null));};exports[_0xf6de('0x2e')]=function(_0xd9a7c4,_0x4334b8){return db[_0xf6de('0x35')][_0xf6de('0x4f')]({'where':{'id':_0xd9a7c4['params']['id']}})[_0xf6de('0x2d')](handleEntityNotFound(_0x4334b8,null))[_0xf6de('0x2d')](removeEntity(_0x4334b8,null))[_0xf6de('0x4d')](handleError(_0x4334b8,null));};exports[_0xf6de('0x61')]=function(_0x346fa2,_0x4d78e7){return db['UserProfile']['describe']()['then'](respondWithResult(_0x4d78e7,null))[_0xf6de('0x4d')](handleError(_0x4d78e7,null));};exports[_0xf6de('0x62')]=function(_0xb6759e,_0x2c5b1d){var _0x420cb6=_0xb6759e[_0xf6de('0x51')];return db['UserProfile']['find']({'where':{'id':_0xb6759e[_0xf6de('0x4e')]['id']}})[_0xf6de('0x2d')](handleEntityNotFound(_0x2c5b1d,null))['then'](function(_0x17a54f){if(_0x17a54f){return db[_0xf6de('0x63')]['transaction'](function(_0x23ddee){return db[_0xf6de('0x59')][_0xf6de('0x2e')]({'where':{'userProfileId':_0xb6759e[_0xf6de('0x4e')]['id'],'sectionId':_[_0xf6de('0x34')](_0x420cb6,function(_0x3c7c8c){return _0x3c7c8c['sectionId'];})},'transaction':_0x23ddee})[_0xf6de('0x2d')](function(){var _0x92126b=_[_0xf6de('0x34')](_0x420cb6,function(_0x4d6227){_0x4d6227['userProfileId']=_0xb6759e[_0xf6de('0x4e')]['id'];return _0x4d6227;});var _0x8fd34c=[];return BPromise[_0xf6de('0x5a')](_0x92126b,function(_0x21f14e){return db[_0xf6de('0x59')][_0xf6de('0x50')](_0x21f14e,{'include':[{'model':db[_0xf6de('0x5c')],'as':_0xf6de('0x5f')}],'raw':!![],'transaction':_0x23ddee})[_0xf6de('0x2d')](function(_0x3710da){_0x8fd34c[_0xf6de('0x64')](_0x3710da['get']({'plain':!![]}));});})[_0xf6de('0x2d')](function(){return _0x8fd34c;});});});}})['then'](function(_0x2786fe){return _0x2786fe;})[_0xf6de('0x2d')](respondWithResult(_0x2c5b1d,null))['catch'](handleError(_0x2c5b1d,null));};exports[_0xf6de('0x65')]=function(_0x86a422,_0x2d7317){var _0xb59a12;return db[_0xf6de('0x35')][_0xf6de('0x4f')]({'where':{'id':_0x86a422[_0xf6de('0x4e')]['id']},'attributes':['id','name']})[_0xf6de('0x2d')](handleEntityNotFound(_0x2d7317,null))[_0xf6de('0x2d')](function(_0x4d200c){if(_0x4d200c){_0xb59a12=_0x4d200c;return db[_0xf6de('0x59')]['destroy']({'where':{'userProfileId':_0x86a422[_0xf6de('0x4e')]['id'],'sectionId':_0x86a422[_0xf6de('0x3a')][_0xf6de('0x66')]}});}})['then'](function(){return _0xb59a12;})[_0xf6de('0x2d')](respondWithStatusCode(_0x2d7317,null))[_0xf6de('0x4d')](handleError(_0x2d7317,null));};exports[_0xf6de('0x67')]=function(_0x5be79e,_0x2b4f7e){var _0x8964b8=[];var _0x1043d4=[];return db[_0xf6de('0x59')][_0xf6de('0x4b')]({'where':{'userProfileId':_0x5be79e[_0xf6de('0x4e')]['id']},'raw':!![]})['then'](function(_0x52e568){_0x8964b8=_[_0xf6de('0x68')](_0x52e568,function(_0x53670f){return _0x53670f['enabled']===0x1||_[_0xf6de('0x69')]([0x3eb,0x709],_0x53670f[_0xf6de('0x5d')]);});if(!_[_0xf6de('0x6a')](_0x8964b8)){return _['map'](_0x8964b8,function(_0x1286f8){return _0x1286f8[_0xf6de('0x5d')];});}else{return;}})[_0xf6de('0x2d')](function(_0x26fa61){if(_0x26fa61)_0x1043d4=_0x26fa61;if(_[_0xf6de('0x69')](_0x1043d4,0x64)){var _0x44c6a5=_[_0xf6de('0x4f')](_0x8964b8,{'sectionId':0x64});return hasDefaultDashboard(_0x44c6a5)[_0xf6de('0x2d')](function(_0x5820b3){return _[_0xf6de('0x34')](_0x8964b8,function(_0x315bee){if(_0x315bee[_0xf6de('0x5d')]===0x64){_0x315bee[_0xf6de('0x6b')]=_0x5820b3;}return _0x315bee;});});}else{return;}})['then'](function(_0x2dc74d){if(_0x2dc74d)_0x8964b8=_0x2dc74d;if(_[_0xf6de('0x69')](_0x1043d4,0x3eb)){var _0x3a5dbc=_[_0xf6de('0x4f')](_0x8964b8,{'sectionId':0x3eb});return getCustomDashboards(_0x3a5dbc)[_0xf6de('0x2d')](function(_0x46269f){return _[_0xf6de('0x34')](_0x8964b8,function(_0x14d71b){if(_0x3a5dbc[_0xf6de('0x6c')]){if(_0x14d71b[_0xf6de('0x5d')]===0x3eb){_0x14d71b[_0xf6de('0x6b')]=_0x46269f;}}else{if(_0x14d71b[_0xf6de('0x5d')]===0x64){if(!_0x14d71b[_0xf6de('0x6b')]){_0x14d71b['subsections']=[];}_0x14d71b['subsections']=_0x14d71b[_0xf6de('0x6b')][_0xf6de('0x6d')](_0x46269f);}}return _0x14d71b;});});}else{return;}})['then'](function(_0x16a990){if(_0x16a990)_0x8964b8=_0x16a990;if(_[_0xf6de('0x69')](_0x1043d4,0x709)){var _0x523895=_[_0xf6de('0x4f')](_0x8964b8,{'sectionId':0x709});return getPlugins(_0x523895)[_0xf6de('0x2d')](function(_0xdf6674){if(_0x523895[_0xf6de('0x6c')]){return _[_0xf6de('0x34')](_0x8964b8,function(_0x544857){if(_0x544857[_0xf6de('0x5d')]===0x709){_0x544857[_0xf6de('0x6b')]=_0xdf6674;}return _0x544857;});}else{var _0x5ce9c1={'sectionId':0x76c,'enabled':0x1,'subsections':_0xdf6674};var _0x289d20=_[_0xf6de('0x34')](_0x8964b8);_0x289d20['push'](_0x5ce9c1);return _0x289d20;}});}else{return;}})[_0xf6de('0x2d')](function(_0x435a06){if(_0x435a06)_0x8964b8=_0x435a06;return _[_0xf6de('0x68')](_0x8964b8,[_0xf6de('0x6c'),0x1]);})[_0xf6de('0x2d')](respondWithResult(_0x2b4f7e,null))['catch'](handleError(_0x2b4f7e,null));};function hasDefaultDashboard(_0x199922){var _0x55fa9b=[0x65];return new BPromise(function(_0x25de83,_0x417720){try{if(_0x199922[_0xf6de('0x5b')]){_0x25de83(_0x55fa9b);}else{return db[_0xf6de('0x5c')][_0xf6de('0x6e')]({'where':{'sectionId':_0x199922['id']},'raw':!![]})[_0xf6de('0x2d')](function(_0x4abfe0){_0x4abfe0?_0x25de83(_0x55fa9b):_0x25de83();});}}catch(_0x3c39c0){_0x417720(_0x3c39c0);}});}function getCustomDashboards(_0x1067c8){var _0x1a2e56=[];return new BPromise(function(_0x29772a,_0x40fbf3){try{if(_0x1067c8[_0xf6de('0x5b')]){return db[_0xf6de('0x6f')][_0xf6de('0x4b')]({'raw':!![]})[_0xf6de('0x2d')](function(_0x421e80){_0x421e80[_0xf6de('0x70')](function(_0x30944e){_0x1a2e56['push'](_0x30944e['id']+0x1869f);});_0x29772a(_0x1a2e56);});}else{return db[_0xf6de('0x5c')][_0xf6de('0x4b')]({'where':{'sectionId':_0x1067c8['id']},'raw':!![]})[_0xf6de('0x2d')](function(_0x5ebf17){_0x5ebf17[_0xf6de('0x70')](function(_0x31a5be){_0x1a2e56[_0xf6de('0x64')](_0x31a5be[_0xf6de('0x71')]+0x1869f);});_0x29772a(_0x1a2e56);});}}catch(_0x5c13bf){_0x40fbf3(_0x5c13bf);}});}function getPlugins(_0x1500e9){var _0x39e454=[];return new BPromise(function(_0x461eaf,_0x412e08){try{if(_0x1500e9[_0xf6de('0x5b')]){return db['Plugin'][_0xf6de('0x4b')]({'raw':!![]})['then'](function(_0x3b6d41){_0x3b6d41[_0xf6de('0x70')](function(_0x1298c6){_0x39e454[_0xf6de('0x64')](_0x1298c6['id']+0x15b38);});_0x461eaf(_0x39e454);});}else{return db[_0xf6de('0x5c')][_0xf6de('0x4b')]({'where':{'sectionId':_0x1500e9['id']},'raw':!![]})[_0xf6de('0x2d')](function(_0x44d7ba){_0x44d7ba[_0xf6de('0x70')](function(_0x5e1235){_0x39e454['push'](_0x5e1235[_0xf6de('0x71')]+0x15b38);});_0x461eaf(_0x39e454);});}}catch(_0x5c12c9){_0x412e08(_0x5c12c9);}});}exports[_0xf6de('0x72')]=function(_0xc1ca5b,_0x156beb){return db[_0xf6de('0x35')][_0xf6de('0x4f')]({'where':{'id':_0xc1ca5b[_0xf6de('0x4e')]['id']}})['then'](handleEntityNotFound(_0x156beb,null))[_0xf6de('0x2d')](function(_0x276a8e){if(_0x276a8e){return db[_0xf6de('0x63')][_0xf6de('0x58')](function(_0x1004eb){return db[_0xf6de('0x59')]['findAll']({'where':{'userProfileId':_0xc1ca5b[_0xf6de('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0xf6de('0x2d')](function(_0x235167){if(_0x235167){return db[_0xf6de('0x59')][_0xf6de('0x2e')]({'where':{'userProfileId':_0xc1ca5b[_0xf6de('0x4e')]['id'],'id':_['map'](_0x235167,function(_0x14bce1){return _0x14bce1['id'];})},'transaction':_0x1004eb});}})[_0xf6de('0x2d')](function(_0x45ef31){var _0x49c4a8=_['map'](_0xc1ca5b[_0xf6de('0x51')],function(_0x31ea8d){_0x31ea8d[_0xf6de('0x5e')]=_0xc1ca5b['params']['id'];return _0x31ea8d;});return db[_0xf6de('0x59')][_0xf6de('0x73')](_0x49c4a8,{'raw':!![],'transaction':_0x1004eb});})[_0xf6de('0x2d')](function(_0x415254){var _0x24997f=_[_0xf6de('0x68')](_['map'](_0x415254,function(_0x44cf3b){return _0x44cf3b[_0xf6de('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0x24997f){return db['UserProfileSection'][_0xf6de('0x4b')]({'where':{'userProfileId':_0xc1ca5b['params']['id'],'sectionId':_['map'](_0x24997f,function(_0x441bd6){return _0x441bd6[_0xf6de('0x5d')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xf6de('0x2d')](function(_0x42bbe9){var _0x330de5=_[_0xf6de('0x34')](_0xc1ca5b['body'],function(_0xf51842){_0xf51842['userProfileId']=_0xc1ca5b[_0xf6de('0x4e')]['id'];return _0xf51842;});return db[_0xf6de('0x5c')][_0xf6de('0x73')](_0x330de5,{'raw':!![],'transaction':_0x1004eb});});}})[_0xf6de('0x4d')](handleError(_0x156beb,null));});}})['then'](function(_0x58396d){var _0x1df5b0=_['map'](_0x58396d,function(_0x31c6f6){return _0x31c6f6[_0xf6de('0x53')]({'plain':!![]});});})[_0xf6de('0x2d')](respondWithResult(_0x156beb,null))[_0xf6de('0x4d')](handleError(_0x156beb,null));};exports['removeResources']=function(_0x34dbd0,_0xcc9b5e,_0x51dd68){return db['UserProfile'][_0xf6de('0x4f')]({'where':{'id':_0x34dbd0[_0xf6de('0x4e')]['id']}})[_0xf6de('0x2d')](handleEntityNotFound(_0xcc9b5e,null))[_0xf6de('0x2d')](function(_0x436c44){if(_0x436c44){return _0x436c44[_0xf6de('0x74')](_0x34dbd0['query'][_0xf6de('0x66')]);}})[_0xf6de('0x2d')](respondWithStatusCode(_0xcc9b5e,null))[_0xf6de('0x4d')](handleError(_0xcc9b5e,null));};exports[_0xf6de('0x75')]=function(_0x31b758,_0x17373a){var _0xeba142={};if(!_0x31b758['query'][_0xf6de('0x76')])throw new Error(_0xf6de('0x77'));if(!_0x31b758[_0xf6de('0x3a')][_0xf6de('0x41')](_0xf6de('0x78'))){_0xeba142[_0xf6de('0x25')]=qs[_0xf6de('0x25')](_0x31b758[_0xf6de('0x3a')][_0xf6de('0x25')]);_0xeba142[_0xf6de('0x24')]=qs[_0xf6de('0x24')](_0x31b758[_0xf6de('0x3a')]['offset']);}return db['UserProfile'][_0xf6de('0x4f')]({'where':{'id':_0x31b758[_0xf6de('0x4e')]['id']}})['then'](function(_0x1363d9){if(!_0x1363d9)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x31b758[_0xf6de('0x4e')]['id']);return db['UserProfile'][_0xf6de('0x75')](_0x31b758);})[_0xf6de('0x2d')](respondWithFilteredResult(_0x17373a,_0xeba142))[_0xf6de('0x4d')](handleError(_0x17373a,null));}; \ No newline at end of file +var _0x12f3=['redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','error','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','find','create','body','clone','includeAll','get','omit','createdAt','updatedAt','crudPermissions','sequelize','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','transaction','push','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','ids','getResources','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4cf7be,_0x8ba571){var _0x37b454=function(_0x55a15e){while(--_0x55a15e){_0x4cf7be['push'](_0x4cf7be['shift']());}};_0x37b454(++_0x8ba571);}(_0x12f3,0x1a2));var _0x312f=function(_0x139041,_0x34bbae){_0x139041=_0x139041-0x0;var _0x53e455=_0x12f3[_0x139041];return _0x53e455;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x312f('0x0'));var zipdir=require(_0x312f('0x1'));var jsonpatch=require(_0x312f('0x2'));var rp=require(_0x312f('0x3'));var moment=require(_0x312f('0x4'));var BPromise=require(_0x312f('0x5'));var Mustache=require(_0x312f('0x6'));var util=require(_0x312f('0x7'));var path=require(_0x312f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x312f('0x9'));var _=require(_0x312f('0xa'));var squel=require(_0x312f('0xb'));var crypto=require(_0x312f('0xc'));var jsforce=require(_0x312f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x312f('0xe'));var querystring=require(_0x312f('0xf'));var Papa=require(_0x312f('0x10'));var Redis=require(_0x312f('0x11'));var authService=require(_0x312f('0x12'));var qs=require(_0x312f('0x13'));var as=require(_0x312f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x312f('0x15'))(_0x312f('0x16'));var utils=require(_0x312f('0x17'));var config=require(_0x312f('0x18'));var licenseUtil=require(_0x312f('0x19'));var db=require('../../mysqldb')['db'];config[_0x312f('0x1a')]=_[_0x312f('0x1b')](config['redis'],{'host':_0x312f('0x1c'),'port':0x18eb});var socket=require(_0x312f('0x1d'))(new Redis(config[_0x312f('0x1a')]));require(_0x312f('0x1e'))[_0x312f('0x1f')](socket);function respondWithStatusCode(_0x3dec76,_0x407177){_0x407177=_0x407177||0xcc;return function(_0x1f8bc8){if(_0x1f8bc8){return _0x3dec76[_0x312f('0x20')](_0x407177);}return _0x3dec76['status'](_0x407177)['end']();};}function respondWithResult(_0x51b60b,_0x408838){_0x408838=_0x408838||0xc8;return function(_0x64044d){if(_0x64044d){return _0x51b60b[_0x312f('0x21')](_0x408838)['json'](_0x64044d);}};}function respondWithFilteredResult(_0x2c0dfb,_0x623f99){return function(_0x452eca){if(_0x452eca){var _0x3395b3=typeof _0x623f99[_0x312f('0x22')]===_0x312f('0x23')&&typeof _0x623f99[_0x312f('0x24')]===_0x312f('0x23');var _0x17a4e5=_0x452eca[_0x312f('0x25')];var _0x37bd9e=_0x3395b3?0x0:_0x623f99[_0x312f('0x22')];var _0x5a2290=_0x3395b3?_0x452eca[_0x312f('0x25')]:_0x623f99[_0x312f('0x22')]+_0x623f99[_0x312f('0x24')];var _0x3bc3da;if(_0x5a2290>=_0x17a4e5){_0x5a2290=_0x17a4e5;_0x3bc3da=0xc8;}else{_0x3bc3da=0xce;}_0x2c0dfb[_0x312f('0x21')](_0x3bc3da);return _0x2c0dfb['set']('Content-Range',_0x37bd9e+'-'+_0x5a2290+'/'+_0x17a4e5)[_0x312f('0x26')](_0x452eca);}return null;};}function patchUpdates(_0x10c8e7){return function(_0x3c3d2e){try{jsonpatch[_0x312f('0x27')](_0x3c3d2e,_0x10c8e7,!![]);}catch(_0x574772){return BPromise[_0x312f('0x28')](_0x574772);}return _0x3c3d2e['save']();};}function saveUpdates(_0x55b39b,_0x4574ee){return function(_0x4191ad){if(_0x4191ad){return _0x4191ad[_0x312f('0x29')](_0x55b39b)[_0x312f('0x2a')](function(_0x14532d){return _0x14532d;});}return null;};}function removeEntity(_0x3ddf57,_0xa16029){return function(_0x4905b8){if(_0x4905b8){return _0x4905b8[_0x312f('0x2b')]()['then'](function(){_0x3ddf57['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11fb89,_0x24382b){return function(_0x5850af){if(!_0x5850af){_0x11fb89[_0x312f('0x20')](0x194);}return _0x5850af;};}function handleError(_0x591383,_0x28ed85){_0x28ed85=_0x28ed85||0x1f4;return function(_0x18e1a4){logger[_0x312f('0x2c')](_0x18e1a4['stack']);if(_0x18e1a4['name']){delete _0x18e1a4[_0x312f('0x2d')];}_0x591383['status'](_0x28ed85)[_0x312f('0x2e')](_0x18e1a4);};}exports[_0x312f('0x2f')]=function(_0x31b7d1,_0x340855){var _0x2555b5={},_0x1cad91={},_0x14710a={'count':0x0,'rows':[]};var _0x5cb524=_[_0x312f('0x30')](db[_0x312f('0x31')][_0x312f('0x32')],function(_0x22ee74){return{'name':_0x22ee74['fieldName'],'type':_0x22ee74[_0x312f('0x33')][_0x312f('0x34')]};});_0x1cad91[_0x312f('0x35')]=_[_0x312f('0x30')](_0x5cb524,_0x312f('0x2d'));_0x1cad91[_0x312f('0x36')]=_[_0x312f('0x37')](_0x31b7d1[_0x312f('0x36')]);_0x1cad91[_0x312f('0x38')]=_['intersection'](_0x1cad91[_0x312f('0x35')],_0x1cad91['query']);_0x2555b5[_0x312f('0x39')]=_[_0x312f('0x3a')](_0x1cad91[_0x312f('0x35')],qs[_0x312f('0x3b')](_0x31b7d1[_0x312f('0x36')][_0x312f('0x3b')]));_0x2555b5[_0x312f('0x39')]=_0x2555b5[_0x312f('0x39')][_0x312f('0x3c')]?_0x2555b5[_0x312f('0x39')]:_0x1cad91[_0x312f('0x35')];if(!_0x31b7d1[_0x312f('0x36')][_0x312f('0x3d')]('nolimit')){_0x2555b5[_0x312f('0x24')]=qs[_0x312f('0x24')](_0x31b7d1[_0x312f('0x36')][_0x312f('0x24')]);_0x2555b5[_0x312f('0x22')]=qs[_0x312f('0x22')](_0x31b7d1[_0x312f('0x36')][_0x312f('0x22')]);}_0x2555b5['order']=qs[_0x312f('0x3e')](_0x31b7d1[_0x312f('0x36')]['sort']);_0x2555b5[_0x312f('0x3f')]=qs[_0x312f('0x38')](_[_0x312f('0x40')](_0x31b7d1[_0x312f('0x36')],_0x1cad91['filters']),_0x5cb524);if(_0x31b7d1['query']['filter']){_0x2555b5[_0x312f('0x3f')]=_[_0x312f('0x41')](_0x2555b5[_0x312f('0x3f')],{'$or':_[_0x312f('0x30')](_0x5cb524,function(_0x13dfd7){if(_0x13dfd7[_0x312f('0x33')]!==_0x312f('0x42')){var _0x4d183a={};_0x4d183a[_0x13dfd7[_0x312f('0x2d')]]={'$like':'%'+_0x31b7d1['query'][_0x312f('0x43')]+'%'};return _0x4d183a;}})});}_0x2555b5=_[_0x312f('0x41')]({},_0x2555b5,_0x31b7d1[_0x312f('0x44')]);var _0x4cfff8={'where':_0x2555b5['where']};return db['UserProfile'][_0x312f('0x25')](_0x4cfff8)[_0x312f('0x2a')](function(_0x426600){_0x14710a[_0x312f('0x25')]=_0x426600;if(_0x31b7d1[_0x312f('0x36')]['includeAll']){_0x2555b5[_0x312f('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x312f('0x46')](_0x2555b5);})[_0x312f('0x2a')](function(_0x1235ab){_0x14710a['rows']=_0x1235ab;return _0x14710a;})[_0x312f('0x2a')](respondWithFilteredResult(_0x340855,_0x2555b5))[_0x312f('0x47')](handleError(_0x340855,null));};exports[_0x312f('0x48')]=function(_0x178809,_0x4ee2ab){var _0x27a70e={'raw':![],'where':{'id':_0x178809[_0x312f('0x49')]['id']}},_0x58d8f4={};_0x58d8f4['model']=_['keys'](db['UserProfile'][_0x312f('0x32')]);_0x58d8f4[_0x312f('0x36')]=_[_0x312f('0x37')](_0x178809[_0x312f('0x36')]);_0x58d8f4[_0x312f('0x38')]=_['intersection'](_0x58d8f4['model'],_0x58d8f4[_0x312f('0x36')]);_0x27a70e['attributes']=_['intersection'](_0x58d8f4[_0x312f('0x35')],qs[_0x312f('0x3b')](_0x178809['query'][_0x312f('0x3b')]));_0x27a70e[_0x312f('0x39')]=_0x27a70e['attributes'][_0x312f('0x3c')]?_0x27a70e[_0x312f('0x39')]:_0x58d8f4['model'];if(_0x178809[_0x312f('0x36')]['includeAll']){_0x27a70e[_0x312f('0x45')]=[{'all':!![]}];}_0x27a70e=_[_0x312f('0x41')]({},_0x27a70e,_0x178809[_0x312f('0x44')]);return db[_0x312f('0x31')][_0x312f('0x4a')](_0x27a70e)[_0x312f('0x2a')](handleEntityNotFound(_0x4ee2ab,null))[_0x312f('0x2a')](respondWithResult(_0x4ee2ab,null))[_0x312f('0x47')](handleError(_0x4ee2ab,null));};exports[_0x312f('0x4b')]=function(_0x4b1bb7,_0x2d3bbb){return db[_0x312f('0x31')][_0x312f('0x4b')](_0x4b1bb7[_0x312f('0x4c')],{})['then'](respondWithResult(_0x2d3bbb,0xc9))['catch'](handleError(_0x2d3bbb,null));};exports[_0x312f('0x4d')]=function(_0x25de6b,_0x47f416){var _0x314484={'where':{'id':_0x25de6b[_0x312f('0x49')]['id']}},_0x42fe7f={};_0x42fe7f['model']=_['keys'](db[_0x312f('0x31')][_0x312f('0x32')]);_0x314484[_0x312f('0x39')]=_[_0x312f('0x3a')](_0x42fe7f['model'],qs['fields'](_0x25de6b[_0x312f('0x36')]['fields']));_0x314484['attributes']=_0x314484[_0x312f('0x39')][_0x312f('0x3c')]?_0x314484['attributes']:_0x42fe7f[_0x312f('0x35')];if(_0x25de6b[_0x312f('0x36')][_0x312f('0x4e')]){_0x314484[_0x312f('0x45')]=[{'all':!![]}];}_0x314484=_[_0x312f('0x41')]({},_0x314484,_0x25de6b['options']);return db[_0x312f('0x31')][_0x312f('0x4a')](_0x314484)['then'](handleEntityNotFound(_0x47f416,null))[_0x312f('0x2a')](function(_0x1cfb6b){if(_0x1cfb6b){var _0x2bd75e=_0x1cfb6b[_0x312f('0x4f')]({'plain':!![]});_0x2bd75e=qs[_0x312f('0x50')](_0x2bd75e,['id',_0x312f('0x51'),_0x312f('0x52'),_0x312f('0x53')]);_0x25de6b['body']=_[_0x312f('0x50')](_0x25de6b[_0x312f('0x4c')],['id',_0x312f('0x51'),_0x312f('0x52')]);return db[_0x312f('0x54')]['transaction'](function(_0x59bce6){return db['UserProfile'][_0x312f('0x4b')](_['merge'](_0x2bd75e,_0x25de6b['body']),{'include':_0x25de6b[_0x312f('0x36')][_0x312f('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x59bce6})[_0x312f('0x2a')](function(_0x30759c){var _0x387a53=_0x30759c[_0x312f('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0x312f('0x46')]({'where':{'userProfileId':_0x25de6b[_0x312f('0x49')]['id']},'raw':!![]})[_0x312f('0x2a')](function(_0x525ce3){if(_0x525ce3){return BPromise['each'](_0x525ce3,function(_0x420e33){return new BPromise(function(_0xb1875f,_0x3d2fc0){if(_0x420e33['autoAssociation']===null||_0x420e33[_0x312f('0x55')]===0x1)_0xb1875f(null);return db[_0x312f('0x56')][_0x312f('0x46')]({'where':{'sectionId':_0x420e33['id']},'raw':!![]})['then'](function(_0x357ca6){var _0x156fed=_[_0x312f('0x30')](_0x357ca6,function(_0x364bb0){return qs[_0x312f('0x50')](_0x364bb0,['id',_0x312f('0x51'),'updatedAt',_0x312f('0x57')]);});_0xb1875f(_0x156fed);})[_0x312f('0x47')](function(_0x44b690){_0x3d2fc0(_0x44b690);});})[_0x312f('0x2a')](function(_0x4a4a18){var _0x326496=qs[_0x312f('0x50')](_0x420e33,['id','createdAt',_0x312f('0x52')]);_0x326496[_0x312f('0x58')]=_0x387a53['id'];if(_0x4a4a18)_0x326496[_0x312f('0x59')]=_0x4a4a18;return _0x326496;})['then'](function(_0x3ffc3e){return db[_0x312f('0x5a')]['create'](_0x3ffc3e,{'include':[{'model':db[_0x312f('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x59bce6});});})[_0x312f('0x2a')](function(){return _0x387a53;});}});});});}})[_0x312f('0x2a')](respondWithResult(_0x47f416,0xc9))[_0x312f('0x47')](handleError(_0x47f416,null));};exports['update']=function(_0x4b97d1,_0x3ece2e){if(_0x4b97d1[_0x312f('0x4c')]['id']){delete _0x4b97d1[_0x312f('0x4c')]['id'];}return db['UserProfile'][_0x312f('0x4a')]({'where':{'id':_0x4b97d1[_0x312f('0x49')]['id']}})[_0x312f('0x2a')](handleEntityNotFound(_0x3ece2e,null))['then'](saveUpdates(_0x4b97d1[_0x312f('0x4c')],null))[_0x312f('0x2a')](respondWithResult(_0x3ece2e,null))[_0x312f('0x47')](handleError(_0x3ece2e,null));};exports[_0x312f('0x2b')]=function(_0x2fa674,_0x2d70a7){return db[_0x312f('0x31')][_0x312f('0x4a')]({'where':{'id':_0x2fa674[_0x312f('0x49')]['id']}})[_0x312f('0x2a')](handleEntityNotFound(_0x2d70a7,null))[_0x312f('0x2a')](removeEntity(_0x2d70a7,null))[_0x312f('0x47')](handleError(_0x2d70a7,null));};exports[_0x312f('0x5b')]=function(_0x35b3b9,_0x14cc03){return db['UserProfile'][_0x312f('0x5b')]()[_0x312f('0x2a')](respondWithResult(_0x14cc03,null))[_0x312f('0x47')](handleError(_0x14cc03,null));};exports[_0x312f('0x5c')]=function(_0xdea52d,_0x13e8af){var _0x128fd5=_0xdea52d[_0x312f('0x4c')];return db[_0x312f('0x31')]['find']({'where':{'id':_0xdea52d[_0x312f('0x49')]['id']}})[_0x312f('0x2a')](handleEntityNotFound(_0x13e8af,null))['then'](function(_0x3796eb){if(_0x3796eb){return db[_0x312f('0x54')][_0x312f('0x5d')](function(_0x30464a){return db[_0x312f('0x5a')][_0x312f('0x2b')]({'where':{'userProfileId':_0xdea52d[_0x312f('0x49')]['id'],'sectionId':_[_0x312f('0x30')](_0x128fd5,function(_0x16d8ed){return _0x16d8ed['sectionId'];})},'transaction':_0x30464a})['then'](function(){var _0x5adfea=_[_0x312f('0x30')](_0x128fd5,function(_0x1ace15){_0x1ace15['userProfileId']=_0xdea52d[_0x312f('0x49')]['id'];return _0x1ace15;});var _0x4a5a2c=[];return BPromise['each'](_0x5adfea,function(_0x57ab7f){return db[_0x312f('0x5a')][_0x312f('0x4b')](_0x57ab7f,{'include':[{'model':db['UserProfileResource'],'as':_0x312f('0x59')}],'raw':!![],'transaction':_0x30464a})[_0x312f('0x2a')](function(_0x17c8bc){_0x4a5a2c[_0x312f('0x5e')](_0x17c8bc[_0x312f('0x4f')]({'plain':!![]}));});})['then'](function(){return _0x4a5a2c;});});});}})['then'](function(_0x8721f4){return _0x8721f4;})[_0x312f('0x2a')](respondWithResult(_0x13e8af,null))['catch'](handleError(_0x13e8af,null));};exports['removeSections']=function(_0x2d46fd,_0x1b6fdb){var _0x2adcb2;return db[_0x312f('0x31')][_0x312f('0x4a')]({'where':{'id':_0x2d46fd[_0x312f('0x49')]['id']},'attributes':['id','name']})[_0x312f('0x2a')](handleEntityNotFound(_0x1b6fdb,null))['then'](function(_0x304c98){if(_0x304c98){_0x2adcb2=_0x304c98;return db[_0x312f('0x5a')]['destroy']({'where':{'userProfileId':_0x2d46fd[_0x312f('0x49')]['id'],'sectionId':_0x2d46fd[_0x312f('0x36')]['ids']}});}})[_0x312f('0x2a')](function(){return _0x2adcb2;})[_0x312f('0x2a')](respondWithStatusCode(_0x1b6fdb,null))[_0x312f('0x47')](handleError(_0x1b6fdb,null));};exports['getSections']=function(_0x3db23a,_0x437c08){var _0x2d5b75=[];var _0x231328=[];return db[_0x312f('0x5a')][_0x312f('0x46')]({'where':{'userProfileId':_0x3db23a['params']['id']},'raw':!![]})[_0x312f('0x2a')](function(_0x2bdb00){_0x2d5b75=_['filter'](_0x2bdb00,function(_0x438a80){return _0x438a80[_0x312f('0x5f')]===0x1||_[_0x312f('0x60')]([0x3eb,0x709],_0x438a80[_0x312f('0x57')]);});if(!_[_0x312f('0x61')](_0x2d5b75)){return _[_0x312f('0x30')](_0x2d5b75,function(_0x53b040){return _0x53b040[_0x312f('0x57')];});}else{return;}})[_0x312f('0x2a')](function(_0x238668){if(_0x238668)_0x231328=_0x238668;if(_[_0x312f('0x60')](_0x231328,0x64)){var _0x433dfa=_[_0x312f('0x4a')](_0x2d5b75,{'sectionId':0x64});return hasDefaultDashboard(_0x433dfa)[_0x312f('0x2a')](function(_0x1a3b4e){return _['map'](_0x2d5b75,function(_0x16af99){if(_0x16af99[_0x312f('0x57')]===0x64){_0x16af99['subsections']=_0x1a3b4e;}return _0x16af99;});});}else{return;}})['then'](function(_0x28f3a4){if(_0x28f3a4)_0x2d5b75=_0x28f3a4;if(_['includes'](_0x231328,0x3eb)){var _0x512d99=_['find'](_0x2d5b75,{'sectionId':0x3eb});return getCustomDashboards(_0x512d99)[_0x312f('0x2a')](function(_0xf93c4f){return _[_0x312f('0x30')](_0x2d5b75,function(_0x18d232){if(_0x512d99['enabled']){if(_0x18d232[_0x312f('0x57')]===0x3eb){_0x18d232[_0x312f('0x62')]=_0xf93c4f;}}else{if(_0x18d232[_0x312f('0x57')]===0x64){if(!_0x18d232[_0x312f('0x62')]){_0x18d232[_0x312f('0x62')]=[];}_0x18d232[_0x312f('0x62')]=_0x18d232[_0x312f('0x62')][_0x312f('0x63')](_0xf93c4f);}}return _0x18d232;});});}else{return;}})[_0x312f('0x2a')](function(_0x4fc1c8){if(_0x4fc1c8)_0x2d5b75=_0x4fc1c8;if(_[_0x312f('0x60')](_0x231328,0x709)){var _0x31f128=_['find'](_0x2d5b75,{'sectionId':0x709});return getPlugins(_0x31f128)[_0x312f('0x2a')](function(_0x586e56){if(_0x31f128[_0x312f('0x5f')]){return _['map'](_0x2d5b75,function(_0x47cec9){if(_0x47cec9[_0x312f('0x57')]===0x709){_0x47cec9['subsections']=_0x586e56;}return _0x47cec9;});}else{var _0x3d629e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x586e56};var _0x250fd7=_[_0x312f('0x30')](_0x2d5b75);_0x250fd7[_0x312f('0x5e')](_0x3d629e);return _0x250fd7;}});}else{return;}})[_0x312f('0x2a')](function(_0x42b66f){if(_0x42b66f)_0x2d5b75=_0x42b66f;return _[_0x312f('0x43')](_0x2d5b75,['enabled',0x1]);})['then'](respondWithResult(_0x437c08,null))[_0x312f('0x47')](handleError(_0x437c08,null));};function hasDefaultDashboard(_0x14be5e){var _0x5d1d1d=[0x65];return new BPromise(function(_0x3b5397,_0x10a713){try{if(_0x14be5e[_0x312f('0x55')]){_0x3b5397(_0x5d1d1d);}else{return db[_0x312f('0x56')][_0x312f('0x64')]({'where':{'sectionId':_0x14be5e['id']},'raw':!![]})[_0x312f('0x2a')](function(_0x14c54f){_0x14c54f?_0x3b5397(_0x5d1d1d):_0x3b5397();});}}catch(_0x48d2c0){_0x10a713(_0x48d2c0);}});}function getCustomDashboards(_0x5173f2){var _0x5a10e2=[];return new BPromise(function(_0x46fbaf,_0x5a143f){try{if(_0x5173f2[_0x312f('0x55')]){return db[_0x312f('0x65')][_0x312f('0x46')]({'raw':!![]})[_0x312f('0x2a')](function(_0x535fee){_0x535fee['forEach'](function(_0x48ccf4){_0x5a10e2['push'](_0x48ccf4['id']+0x1869f);});_0x46fbaf(_0x5a10e2);});}else{return db[_0x312f('0x56')][_0x312f('0x46')]({'where':{'sectionId':_0x5173f2['id']},'raw':!![]})[_0x312f('0x2a')](function(_0x2df916){_0x2df916[_0x312f('0x66')](function(_0x5974fe){_0x5a10e2['push'](_0x5974fe[_0x312f('0x67')]+0x1869f);});_0x46fbaf(_0x5a10e2);});}}catch(_0x2dc592){_0x5a143f(_0x2dc592);}});}function getPlugins(_0x3783e6){var _0x2bfde7=[];return new BPromise(function(_0x4754c0,_0x32daf4){try{if(_0x3783e6[_0x312f('0x55')]){return db[_0x312f('0x68')][_0x312f('0x46')]({'raw':!![]})[_0x312f('0x2a')](function(_0x39b657){_0x39b657[_0x312f('0x66')](function(_0x3a052e){_0x2bfde7['push'](_0x3a052e['id']+0x15b38);});_0x4754c0(_0x2bfde7);});}else{return db['UserProfileResource'][_0x312f('0x46')]({'where':{'sectionId':_0x3783e6['id']},'raw':!![]})[_0x312f('0x2a')](function(_0x4311e7){_0x4311e7['forEach'](function(_0x23a235){_0x2bfde7[_0x312f('0x5e')](_0x23a235['resourceId']+0x15b38);});_0x4754c0(_0x2bfde7);});}}catch(_0x156781){_0x32daf4(_0x156781);}});}exports[_0x312f('0x69')]=function(_0x333edb,_0x10fcc1){return db[_0x312f('0x31')][_0x312f('0x4a')]({'where':{'id':_0x333edb[_0x312f('0x49')]['id']}})['then'](handleEntityNotFound(_0x10fcc1,null))[_0x312f('0x2a')](function(_0x130282){if(_0x130282){return db[_0x312f('0x54')][_0x312f('0x5d')](function(_0x408a6a){return db[_0x312f('0x5a')][_0x312f('0x46')]({'where':{'userProfileId':_0x333edb[_0x312f('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x312f('0x2a')](function(_0x538425){if(_0x538425){return db[_0x312f('0x5a')][_0x312f('0x2b')]({'where':{'userProfileId':_0x333edb['params']['id'],'id':_['map'](_0x538425,function(_0x171dc0){return _0x171dc0['id'];})},'transaction':_0x408a6a});}})[_0x312f('0x2a')](function(_0x439b63){var _0x851979=_[_0x312f('0x30')](_0x333edb[_0x312f('0x4c')],function(_0xfac328){_0xfac328[_0x312f('0x58')]=_0x333edb[_0x312f('0x49')]['id'];return _0xfac328;});return db['UserProfileSection'][_0x312f('0x6a')](_0x851979,{'raw':!![],'transaction':_0x408a6a});})['then'](function(_0x1a71aa){var _0xead671=_[_0x312f('0x43')](_[_0x312f('0x30')](_0x1a71aa,function(_0x577b07){return _0x577b07['get']({'plain':!![]});}),{'includeAll':![]});if(_0xead671){return db[_0x312f('0x5a')]['findAll']({'where':{'userProfileId':_0x333edb[_0x312f('0x49')]['id'],'sectionId':_[_0x312f('0x30')](_0xead671,function(_0x190c2e){return _0x190c2e[_0x312f('0x57')];})},'attributes':['id',_0x312f('0x57')],'raw':!![]})[_0x312f('0x2a')](function(_0x5d6b84){var _0x30064a=_['map'](_0x333edb[_0x312f('0x4c')],function(_0x30fdb1){_0x30fdb1[_0x312f('0x58')]=_0x333edb[_0x312f('0x49')]['id'];return _0x30fdb1;});return db['UserProfileResource'][_0x312f('0x6a')](_0x30064a,{'raw':!![],'transaction':_0x408a6a});});}})[_0x312f('0x47')](handleError(_0x10fcc1,null));});}})['then'](function(_0x6fd5a4){var _0x12bb56=_[_0x312f('0x30')](_0x6fd5a4,function(_0x1c7f00){return _0x1c7f00[_0x312f('0x4f')]({'plain':!![]});});})[_0x312f('0x2a')](respondWithResult(_0x10fcc1,null))[_0x312f('0x47')](handleError(_0x10fcc1,null));};exports['removeResources']=function(_0xe60874,_0x32b2d7,_0x34180c){return db[_0x312f('0x31')]['find']({'where':{'id':_0xe60874[_0x312f('0x49')]['id']}})[_0x312f('0x2a')](handleEntityNotFound(_0x32b2d7,null))[_0x312f('0x2a')](function(_0x2a798e){if(_0x2a798e){return _0x2a798e['removeResources'](_0xe60874[_0x312f('0x36')][_0x312f('0x6b')]);}})['then'](respondWithStatusCode(_0x32b2d7,null))[_0x312f('0x47')](handleError(_0x32b2d7,null));};exports[_0x312f('0x6c')]=function(_0x58515d,_0x1718fb){var _0x39bf31={};if(!_0x58515d[_0x312f('0x36')]['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x58515d[_0x312f('0x36')][_0x312f('0x3d')](_0x312f('0x6d'))){_0x39bf31['limit']=qs[_0x312f('0x24')](_0x58515d['query'][_0x312f('0x24')]);_0x39bf31[_0x312f('0x22')]=qs[_0x312f('0x22')](_0x58515d[_0x312f('0x36')]['offset']);}return db[_0x312f('0x31')][_0x312f('0x4a')]({'where':{'id':_0x58515d['params']['id']}})[_0x312f('0x2a')](function(_0x1fcaf8){if(!_0x1fcaf8)throw new Error(_0x312f('0x6e')+_0x58515d[_0x312f('0x49')]['id']);return db[_0x312f('0x31')][_0x312f('0x6c')](_0x58515d);})[_0x312f('0x2a')](respondWithFilteredResult(_0x1718fb,_0x39bf31))[_0x312f('0x47')](handleError(_0x1718fb,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5f484d8..fbb5f7c 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 _0xde46=['UserProfile','setMaxListeners','remove','emit','hook','events','../../mysqldb'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xde46,0x14e));var _0x6de4=function(_0x28736b,_0x58d1f5){_0x28736b=_0x28736b-0x0;var _0xd0fff5=_0xde46[_0x28736b];return _0xd0fff5;};'use strict';var EventEmitter=require(_0x6de4('0x0'));var UserProfile=require(_0x6de4('0x1'))['db'][_0x6de4('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6de4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6de4('0x4')};function emitEvent(_0x5ddab6){return function(_0x2aec40,_0x19e9a6,_0xd7f8a7){UserProfileEvents[_0x6de4('0x5')](_0x5ddab6+':'+_0x2aec40['id'],_0x2aec40);UserProfileEvents['emit'](_0x5ddab6,_0x2aec40);_0xd7f8a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6de4('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xfb11=['hasOwnProperty','exports','events','UserProfile','setMaxListeners','update','emit'];(function(_0x253e78,_0x8cf230){var _0x323ac8=function(_0x3b8d48){while(--_0x3b8d48){_0x253e78['push'](_0x253e78['shift']());}};_0x323ac8(++_0x8cf230);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xfb11[_0x481bf7];return _0x461787;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x1fb1('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1fb1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x18108f){return function(_0x5a830e,_0x190f74,_0x2ae20f){UserProfileEvents['emit'](_0x18108f+':'+_0x5a830e['id'],_0x5a830e);UserProfileEvents[_0x1fb1('0x4')](_0x18108f,_0x5a830e);_0x2ae20f(null);};}for(var e in events){if(events[_0x1fb1('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x1fb1('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8606d51..5c85bc3 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 _0x945c=['type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','role','Telephones','User','queue','VoiceQueue','inbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','sounds','Sound','tags','templates','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','UserProfile','user_profiles','../../components/parsers/qs','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','union','find','ignore','model','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','VIRTUAL','foreignKey','forEach','merge','options','include','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tag','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','value','findAll','then','associatedResources','map','field','catch','AnalyticExtractedReport','resourceId'];(function(_0x1b2e47,_0x194fef){var _0x2a1d1e=function(_0x14a193){while(--_0x14a193){_0x1b2e47['push'](_0x1b2e47['shift']());}};_0x2a1d1e(++_0x194fef);}(_0x945c,0x169));var _0xc945=function(_0x4fccf1,_0x1c7cb3){_0x4fccf1=_0x4fccf1-0x0;var _0x1de5d9=_0x945c[_0x4fccf1];return _0x1de5d9;};'use strict';var _=require(_0xc945('0x0'));var attributes=require(_0xc945('0x1'));var squel=require(_0xc945('0x2'));module[_0xc945('0x3')]=function(_0x157c39){var _0x2c666e=_0x157c39[_0xc945('0x4')];function _0x244bb9(_0x2cc5ca,_0x3ed164){return new Promise(function(_0x4efb36,_0x5cdb75){if(!_0x3ed164)return _0x4efb36(null);var _0x402325=_0x3ed164[_0xc945('0x5')]?{[_0x3ed164[_0xc945('0x5')]['field']]:_0x3ed164[_0xc945('0x5')][_0xc945('0x6')]}:undefined;return _0x2c666e[_0x2cc5ca][_0xc945('0x7')]({'where':_0x402325,'raw':!![]})[_0xc945('0x8')](function(_0x36ef4f){_0x3ed164[_0xc945('0x9')]=_[_0xc945('0xa')](_0x36ef4f,'id');_0x4efb36(_0x3ed164);})['catch'](function(_0x2409f1){_0x5cdb75(_0x2409f1);});});}function _0x33b830(_0x336160,_0x34a495){return new Promise(function(_0x508ef3,_0xbddfd2){var _0x2814cb=_0x336160['filter']?{[_0x336160['filter'][_0xc945('0xb')]]:_0x336160['filter'][_0xc945('0x6')]}:undefined;return _0x2c666e[_0x336160['model']][_0xc945('0x7')]({'where':_0x2814cb,'raw':!![]})[_0xc945('0x8')](function(_0x33e06){_0x34a495[_0xc945('0x9')]=_[_0xc945('0xa')](_0x33e06,function(_0x48ab22){return _0x48ab22['name'];});_0x508ef3(_0x34a495);})[_0xc945('0xc')](function(_0x1c1e3f){_0xbddfd2(_0x1c1e3f);});});}function _0x1ea958(_0x655d99,_0x212e73,_0x238a6d){if(!_0x212e73)return Promise['resolve'](null);return new Promise(function(_0x556274,_0x575c73){return _0x2c666e['UserProfileResource'][_0xc945('0x7')]({'where':{'sectionId':_0x212e73['id']},'raw':!![]})['then'](function(_0x451a18){if(_0x655d99[_0xc945('0xb')]&&_0x655d99[_0xc945('0xb')]!=='id'){_0x212e73[_0xc945('0x9')]=_[_0xc945('0xa')](_0x451a18,function(_0x395b09){return _0x395b09[_0x655d99['field']];});}else{if(_0x238a6d===_0xc945('0xd')){_0x212e73[_0xc945('0x9')]=_[_0xc945('0xa')](_0x451a18,function(_0x3986ec){return{'id':_0x3986ec[_0xc945('0xe')],'type':_0x3986ec[_0xc945('0xf')]};});}else{_0x212e73[_0xc945('0x9')]=_[_0xc945('0xa')](_0x451a18,function(_0x3382c2){return _0x3382c2['resourceId'];});}}_0x556274(_0x212e73);})[_0xc945('0xc')](function(_0x5504b8){_0x575c73(_0x5504b8);});});}function _0x381852(_0x42c74f,_0xd3d492){var _0x3cbf37={'parentSections':[]};switch(_0x42c74f[_0xc945('0x10')]()){case _0xc945('0x11'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x13');break;case _0xc945('0x14'):_0x3cbf37['childModel']=_0xc945('0x15');break;case _0xc945('0x16'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x17');_0x3cbf37[_0xc945('0x18')]=[{'name':_0xc945('0x19'),'field':_0xc945('0x1a'),'foreignKey':_0xc945('0x1b')}];break;case _0xc945('0x1c'):_0x3cbf37['childModel']=_0xc945('0x1d');break;case _0xc945('0x1e'):_0x3cbf37['childModel']=_0xc945('0x1f');_0x3cbf37[_0xc945('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0xc945('0x20')}];break;case _0xc945('0x21'):_0x3cbf37['childModel']=_0xc945('0x22');break;case _0xc945('0x23'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x24');break;case _0xc945('0x25'):_0x3cbf37['childModel']='CmCustomField';break;case _0xc945('0x26'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x27');break;case _0xc945('0x28'):_0x3cbf37[_0xc945('0x12')]='ChatWebsite';break;case _0xc945('0x29'):_0x3cbf37['childModel']=_0xc945('0x2a');break;case'faxaccounts':_0x3cbf37[_0xc945('0x12')]='FaxAccount';break;case _0xc945('0x2b'):case'internalroutes':case _0xc945('0x2c'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x2d');break;case _0xc945('0x2e'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x2f');break;case _0xc945('0x30'):_0x3cbf37['childModel']=_0xc945('0x31');break;case _0xc945('0x32'):_0x3cbf37[_0xc945('0x12')]='VoiceRecording';_0x3cbf37['parentSections']=[{'name':_0xc945('0x33'),'field':_0xc945('0x1a'),'foreignKey':'membername','model':'User','filter':{'field':_0xc945('0x34'),'value':['agent']}},{'name':_0xc945('0x35'),'field':'name','foreignKey':'membername','model':_0xc945('0x36'),'filter':{'field':_0xc945('0x34'),'value':['telephone']}},{'name':'VoiceQueues','field':_0xc945('0x1a'),'foreignKey':_0xc945('0x37'),'model':_0xc945('0x38'),'filter':{'field':_0xc945('0xf'),'value':[_0xc945('0x39')]}},{'name':'QueueCampaigns','field':_0xc945('0x1a'),'foreignKey':_0xc945('0x37'),'model':_0xc945('0x38'),'filter':{'field':_0xc945('0xf'),'value':['outbound']}}];break;case _0xc945('0x3a'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x3b');break;case _0xc945('0x3c'):_0x3cbf37['childModel']=_0xc945('0x3d');break;case'voiceprefixes':_0x3cbf37[_0xc945('0x12')]=_0xc945('0x3e');break;case _0xc945('0x3f'):_0x3cbf37['childModel']='Campaign';break;case'mailqueues':_0x3cbf37[_0xc945('0x12')]=_0xc945('0x40');break;case _0xc945('0x41'):_0x3cbf37[_0xc945('0x12')]='MailAccount';break;case _0xc945('0x42'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x43');break;case'openchannelqueues':_0x3cbf37[_0xc945('0x12')]=_0xc945('0x44');break;case _0xc945('0x45'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x46');break;case _0xc945('0x47'):_0x3cbf37['childModel']=_0xc945('0x48');break;case _0xc945('0x49'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x4a');break;case _0xc945('0x4b'):_0x3cbf37['childModel']=_0xc945('0x4c');break;case _0xc945('0x4d'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x4e');break;case _0xc945('0x4f'):_0x3cbf37['childModel']='Team';break;case _0xc945('0x50'):case _0xc945('0x51'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x38');if(_0xd3d492){_0x3cbf37['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case _0xc945('0x52'):case _0xc945('0x53'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x36');if(_0xd3d492){_0x3cbf37['parentSections']=[{'name':'Users','filter':{'field':_0xc945('0x34'),'value':[_0xc945('0x54'),_0xc945('0x55')]},'ignore':!![]},{'name':'Agents'},{'name':_0xc945('0x35')}];}break;case _0xc945('0x56'):_0x3cbf37['childModel']=_0xc945('0x57');break;case _0xc945('0x58'):_0x3cbf37['childModel']='SalesforceAccount';break;case _0xc945('0x59'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x5a');break;case _0xc945('0x5b'):_0x3cbf37['childModel']=_0xc945('0x5c');break;case _0xc945('0x5d'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x5e');break;case'zohoaccounts':_0x3cbf37['childModel']=_0xc945('0x5f');break;case _0xc945('0x60'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x36');break;case _0xc945('0x61'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x62');break;case _0xc945('0x63'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x64');break;case _0xc945('0x65'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x66');break;case'intervals':_0x3cbf37[_0xc945('0x12')]=_0xc945('0x67');break;case _0xc945('0x68'):_0x3cbf37[_0xc945('0x12')]='Pause';break;case'scheduler':_0x3cbf37[_0xc945('0x12')]='Schedule';break;case _0xc945('0x69'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x6a');break;case _0xc945('0x6b'):_0x3cbf37[_0xc945('0x12')]='Tag';break;case _0xc945('0x6c'):_0x3cbf37[_0xc945('0x12')]='Template';break;case _0xc945('0x6d'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x6e');break;case _0xc945('0x6f'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0x70');break;case'variables':_0x3cbf37[_0xc945('0x12')]=_0xc945('0x71');break;case _0xc945('0x72'):_0x3cbf37['childModel']=_0xc945('0x73');break;case _0xc945('0x74'):_0x3cbf37[_0xc945('0x12')]=_0xc945('0xd');_0x3cbf37[_0xc945('0x18')]=[{'name':_0xc945('0x75'),'field':'id','foreignKey':_0xc945('0x76')}];break;case _0xc945('0x77'):_0x3cbf37['childModel']=_0xc945('0x78');break;}return _0x3cbf37;}function _0x18861f(_0x23782f,_0x5ad053){var _0x1effa7=_0x23782f[_0xc945('0x79')](0x0)[_0xc945('0x7a')]()+_0x23782f['slice'](0x1);var _0x1d5cee={'type':_0x2c666e['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x3a3af8,_0x51f1ee){var _0x3fa87b=squel['select']()[_0xc945('0xb')](_0xc945('0x7b')+_0x1effa7+_0xc945('0x7c'),'id')[_0xc945('0xb')](_0xc945('0x7d'))[_0xc945('0x7e')](_0xc945('0x7f')+_0x23782f+_0xc945('0x80'),'ui')[_0xc945('0x81')]('ui.UserId\x20=\x20?',_0x5ad053['id']);return _0x2c666e[_0xc945('0x82')][_0xc945('0x83')](_0x3fa87b['toString'](),_0x1d5cee)['then'](function(_0x4b7804){_0x5ad053[_0x1effa7+'OpenTabs']=_0x4b7804;_0x3a3af8(_0x4b7804);})[_0xc945('0xc')](function(_0x124976){_0x51f1ee(_0x124976);});});}return _0x157c39['define'](_0xc945('0x84'),attributes,{'tableName':_0xc945('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x8abdd8){var _0x1ac770=require(_0xc945('0x86'));var _0x1a4aba={'raw':_0x8abdd8[_0xc945('0x83')][_0xc945('0x87')],'where':{}};var _0x21ac61={};var _0x52519d={'count':0x0,'rows':[]};var _0x51374c=_0x8abdd8[_0xc945('0x83')]['section'];var _0x3f6945=_0x8abdd8[_0xc945('0x83')][_0xc945('0x88')]||![];var _0x3833a1=_0x381852(_0x51374c,_0x3f6945);if(!_0x3833a1['childModel'])throw new Error(_0xc945('0x89')+_0x51374c+'\x27');var _0x1bbdf6=[{'name':_0x51374c}];if(!_[_0xc945('0x8a')](_0x3833a1[_0xc945('0x18')]))_0x1bbdf6=_0x3833a1['parentSections'];var _0x4c4337=[];for(var _0x180a0d=0x0;_0x180a0d<_0x1bbdf6[_0xc945('0x8b')];_0x180a0d++){_0x4c4337[_0xc945('0x8c')](_0x2c666e['UserProfileSection']['find']({'where':{'userProfileId':_0x8abdd8[_0xc945('0x8d')]['id'],'name':_0x1bbdf6[_0x180a0d][_0xc945('0x1a')]},'raw':!![]}));}return Promise[_0xc945('0x8e')](_0x4c4337)[_0xc945('0x8')](function(_0x1562c4){var _0x3ca482=_[_0xc945('0x5')](_0x1562c4,function(_0x3b0b6b){return _0x3b0b6b?_0x3b0b6b:undefined;});var _0x4e3b49=_[_0xc945('0x5')](_0x1bbdf6,['ignore',!![]]);var _0x5d1755=_['isEmpty'](_0x3ca482)&&_[_0xc945('0x8a')](_0x4e3b49)?null:_[_0xc945('0x8f')](_0x4e3b49,_0x3ca482);if(!_0x5d1755)return null;var _0xcf7b1c=[];for(var _0x665984=0x0;_0x665984<_0x5d1755[_0xc945('0x8b')];_0x665984++){var _0x18383e=_[_0xc945('0x90')](_0x1bbdf6,function(_0x488fbd){return _0x5d1755[_0x665984]?_0x488fbd[_0xc945('0x1a')]===_0x5d1755[_0x665984][_0xc945('0x1a')]:null;});if(_0x18383e){if(_0x5d1755[_0x665984][_0xc945('0x91')]){_0xcf7b1c[_0xc945('0x8c')](_0x244bb9(_0x3833a1['childModel'],_0x5d1755[_0x665984]));}else{if(!_0x5d1755[_0x665984]['autoAssociation']){_0xcf7b1c[_0xc945('0x8c')](_0x1ea958(_0x18383e,_0x5d1755[_0x665984],_0x3833a1[_0xc945('0x12')]));}else{if(_0x18383e[_0xc945('0x92')]){_0xcf7b1c[_0xc945('0x8c')](_0x33b830(_0x18383e,_0x5d1755[_0x665984]));}}}}}return Promise[_0xc945('0x8e')](_0xcf7b1c);})['then'](function(_0x5af360){var _0x1f0925=_0x5af360;var _0x293f7e=null;if(_0x1f0925){_0x293f7e=_0x1f0925[_0xc945('0x8b')]===0x1?_0x1f0925[0x0]:null;}if(!_0x293f7e&&!_0x1f0925)return _0x52519d;var _0x26aa79=_0x2c666e[_0x3833a1[_0xc945('0x12')]][_0xc945('0x93')];_0x21ac61[_0xc945('0x92')]=_[_0xc945('0x94')](_0x26aa79);_0x21ac61[_0xc945('0x83')]=_[_0xc945('0x94')](_0x8abdd8[_0xc945('0x83')]);_0x21ac61['filters']=_[_0xc945('0x95')](_0x21ac61['model'],_0x21ac61['query']);_0x1a4aba[_0xc945('0x96')]=_[_0xc945('0x95')](_0x21ac61[_0xc945('0x92')],_0x1ac770[_0xc945('0x97')](_0x8abdd8[_0xc945('0x83')][_0xc945('0x97')]));_0x1a4aba[_0xc945('0x96')]=_0x1a4aba[_0xc945('0x96')]['length']?_0x1a4aba[_0xc945('0x96')]:_0x21ac61['model'];if(!_0x8abdd8[_0xc945('0x83')][_0xc945('0x98')](_0xc945('0x99'))){_0x1a4aba['limit']=_0x1ac770[_0xc945('0x9a')](_0x8abdd8[_0xc945('0x83')][_0xc945('0x9a')]);_0x1a4aba['offset']=_0x1ac770['offset'](_0x8abdd8[_0xc945('0x83')][_0xc945('0x9b')]);}_0x1a4aba[_0xc945('0x9c')]=_0x1ac770[_0xc945('0x9d')](_0x8abdd8[_0xc945('0x83')][_0xc945('0x9d')]);_0x1a4aba['where']=_0x1ac770[_0xc945('0x9e')](_[_0xc945('0x9f')](_0x8abdd8[_0xc945('0x83')],_0x21ac61[_0xc945('0x9e')]));if(_0x8abdd8[_0xc945('0x83')]['filter']){_0x1a4aba['where']=_['merge'](_0x1a4aba[_0xc945('0x81')],{'$or':_['map'](_0x26aa79,function(_0x4dfaef){if(_0x4dfaef['type']['key']!==_0xc945('0xa0')){var _0x1c4f45={};_0x1c4f45[_0x4dfaef[_0xc945('0xb')]]={'$like':'%'+_0x8abdd8[_0xc945('0x83')][_0xc945('0x5')]+'%'};return _0x1c4f45;}})});}var _0xadd2e1=[];var _0x3fe7a5=null;var _0x15002b={};if(_0x293f7e){_0x3fe7a5=_[_0xc945('0x90')](_0x1bbdf6,['name',_0x293f7e[_0xc945('0x1a')]]);if(_0x3fe7a5[_0xc945('0xb')]){_0x15002b={};if(_0x3833a1['childModel']===_0xc945('0xd')){_0x15002b[_0x3fe7a5['foreignKey']]=_[_0xc945('0xa')](_0x293f7e['associatedResources'],'id');}else{_0x15002b[_0x3fe7a5[_0xc945('0xa1')]]=_0x293f7e[_0xc945('0x9')];}_0xadd2e1['push'](_0x15002b);}else{_0x1a4aba[_0xc945('0x81')]['id']=_0x293f7e[_0xc945('0x9')];}}else{for(var _0xe9c0ad=0x0;_0xe9c0ad<_0x1f0925[_0xc945('0x8b')];_0xe9c0ad++){_0x3fe7a5=_[_0xc945('0x90')](_0x1bbdf6,[_0xc945('0x1a'),_0x1f0925[_0xe9c0ad]['name']]);if(_0x3fe7a5[_0xc945('0xb')]){_0x15002b={};_0x15002b[_0x3fe7a5[_0xc945('0xa1')]]=_0x1f0925[_0xe9c0ad][_0xc945('0x9')];_0xadd2e1[_0xc945('0x8c')](_0x15002b);}else{if(!_0x1a4aba[_0xc945('0x81')]['id'])_0x1a4aba['where']['id']=[];_0x1f0925[_0xe9c0ad][_0xc945('0x9')][_0xc945('0xa2')](function(_0x25343f){_0x1a4aba[_0xc945('0x81')]['id'][_0xc945('0x8c')](_0x25343f);});}}}if(!_[_0xc945('0x8a')](_0xadd2e1)){_0x1a4aba[_0xc945('0x81')]=_['merge'](_0x1a4aba[_0xc945('0x81')],{'$and':{'$or':_0xadd2e1}});}_0x1a4aba=_[_0xc945('0xa3')]({},_0x1a4aba,_0x8abdd8[_0xc945('0xa4')]);if(_0x293f7e&&!_0x293f7e['autoAssociation']&&_0x3833a1[_0xc945('0x12')]==='AnalyticExtractedReport'){if(_0x8abdd8[_0xc945('0x83')]['includeAll']){_0x1a4aba[_0xc945('0xa5')]=[{'all':!![]}];}return _0x2c666e[_0x3833a1[_0xc945('0x12')]][_0xc945('0x7')](_0x1a4aba)['then'](function(_0x3c109b){var _0x37da43=[];_0x3c109b[_0xc945('0xa2')](function(_0x477577){var _0x18dca8;switch(_0x477577['reportType']){case _0xc945('0xa6'):_0x18dca8=_['find'](_0x293f7e[_0xc945('0x9')],function(_0x588dbf){return _0x588dbf['id']===_0x477577[_0xc945('0x76')]&&_0x588dbf[_0xc945('0xf')]===_0xc945('0xa7');});break;case _0xc945('0xa8'):_0x18dca8=_['find'](_0x293f7e[_0xc945('0x9')],function(_0x404770){return _0x404770['id']===_0x477577[_0xc945('0x76')]&&_0x404770[_0xc945('0xf')]===_0xc945('0xa9');});break;}if(_0x18dca8)_0x37da43[_0xc945('0x8c')](_0x477577);});_0x52519d[_0xc945('0xaa')]=_0x37da43[_0xc945('0x8b')];_0x52519d[_0xc945('0xab')]=_0x37da43;return _0x52519d;});}else{if(!_[_0xc945('0x8a')](_0x8abdd8[_0xc945('0x83')][_0xc945('0xac')])){_0x1a4aba[_0xc945('0x81')]['id']=_0x1a4aba[_0xc945('0x81')]['id']?_['intersection'](_0x1a4aba[_0xc945('0x81')]['id'],_0x8abdd8['query'][_0xc945('0xac')]):_0x8abdd8[_0xc945('0x83')][_0xc945('0xac')];if(_0x8abdd8['query']['customSorting']){_0x1a4aba['order']=_0x8abdd8['query'][_0xc945('0xad')];}}if(_0x8abdd8[_0xc945('0x83')][_0xc945('0xae')]){_0x1a4aba[_0xc945('0x81')]=_[_0xc945('0xa3')](_0x1a4aba[_0xc945('0x81')],{'$and':_0x8abdd8[_0xc945('0x83')][_0xc945('0xae')]});}return _0x2c666e[_0x3833a1[_0xc945('0x12')]][_0xc945('0xaa')]({'where':_0x1a4aba[_0xc945('0x81')]})[_0xc945('0x8')](function(_0x5741d9){_0x52519d[_0xc945('0xaa')]=_0x5741d9;if(_0x8abdd8[_0xc945('0x83')][_0xc945('0xaf')]){if(_0x3833a1[_0xc945('0x12')]===_0xc945('0x1f')){_0x1a4aba['include']=[{'model':_0x2c666e[_0xc945('0xb0')],'as':_0xc945('0xb1'),'attributes':['id',_0xc945('0x1a'),_0xc945('0xb2')],'required':_0x8abdd8[_0xc945('0x83')][_0xc945('0xb3')]?!![]:![]},{'model':_0x2c666e[_0xc945('0xb0')],'as':_0xc945('0xb4'),'attributes':['id',_0xc945('0x1a'),'color'],'through':_0x8abdd8[_0xc945('0x83')][_0xc945('0xb3')]?{'attributes':[],'where':{'TagId':_0x8abdd8[_0xc945('0x83')][_0xc945('0xb3')]||undefined}}:{},'required':_0x8abdd8[_0xc945('0x83')][_0xc945('0xb3')]?!![]:![]}];}else{_0x1a4aba['include']=[{'all':!![]}];}}return _0x2c666e[_0x3833a1['childModel']][_0xc945('0x7')](_0x1a4aba);})[_0xc945('0x8')](function(_0x4c8a9c){_0x52519d[_0xc945('0xab')]=_0x4c8a9c;if(_0x51374c===_0xc945('0x33')&&_0x8abdd8[_0xc945('0x83')][_0xc945('0xb5')]===_0xc945('0xb6')){var _0x3af5d1=[];for(var _0x23de51=0x0;_0x23de51<_0x52519d['rows'][_0xc945('0x8b')];_0x23de51++){_0x3af5d1[_0xc945('0x8c')](_0x18861f('chat',_0x52519d[_0xc945('0xab')][_0x23de51][_0xc945('0xb7')]));_0x3af5d1['push'](_0x18861f(_0xc945('0xb8'),_0x52519d[_0xc945('0xab')][_0x23de51][_0xc945('0xb7')]));_0x3af5d1[_0xc945('0x8c')](_0x18861f(_0xc945('0xb9'),_0x52519d[_0xc945('0xab')][_0x23de51][_0xc945('0xb7')]));_0x3af5d1[_0xc945('0x8c')](_0x18861f('mail',_0x52519d[_0xc945('0xab')][_0x23de51]['dataValues']));_0x3af5d1[_0xc945('0x8c')](_0x18861f(_0xc945('0xba'),_0x52519d[_0xc945('0xab')][_0x23de51][_0xc945('0xb7')]));_0x3af5d1[_0xc945('0x8c')](_0x18861f(_0xc945('0xbb'),_0x52519d[_0xc945('0xab')][_0x23de51][_0xc945('0xb7')]));}return Promise[_0xc945('0x8e')](_0x3af5d1)[_0xc945('0x8')](function(){return _0x52519d;});}return _0x52519d;});}});}}});}; \ No newline at end of file +var _0xdd79=['ThroughTags','openTabs','true','chat','dataValues','fax','openchannel','whatsapp','lodash','squel','exports','models','filter','findAll','map','field','value','model','then','associatedResources','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','type','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','QueueCampaigns','users','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','define','UserProfile','user_profiles','mergeResources','length','push','UserProfileSection','find','params','all','isEmpty','union','ignore','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','pick','key','VIRTUAL','foreignKey','merge','options','includeAll','include','forEach','reportType','default','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdd79,0xcb));var _0x9dd7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdd79[_0x432682];return _0x463d05;};'use strict';var _=require(_0x9dd7('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0x9dd7('0x1'));module[_0x9dd7('0x2')]=function(_0x3b7286){var _0x1b9c2f=_0x3b7286[_0x9dd7('0x3')];function _0x18e268(_0x4595a5,_0xaae0a8){return new Promise(function(_0x2b7c26,_0x46e750){if(!_0xaae0a8)return _0x2b7c26(null);var _0x1f4729=_0xaae0a8[_0x9dd7('0x4')]?{[_0xaae0a8[_0x9dd7('0x4')]['field']]:_0xaae0a8[_0x9dd7('0x4')]['value']}:undefined;return _0x1b9c2f[_0x4595a5][_0x9dd7('0x5')]({'where':_0x1f4729,'raw':!![]})['then'](function(_0x36f250){_0xaae0a8['associatedResources']=_[_0x9dd7('0x6')](_0x36f250,'id');_0x2b7c26(_0xaae0a8);})['catch'](function(_0x1b0b55){_0x46e750(_0x1b0b55);});});}function _0xebafd2(_0x2df8d9,_0x3fb5e9){return new Promise(function(_0x32cf44,_0x16818a){var _0xfd9b9e=_0x2df8d9[_0x9dd7('0x4')]?{[_0x2df8d9[_0x9dd7('0x4')][_0x9dd7('0x7')]]:_0x2df8d9[_0x9dd7('0x4')][_0x9dd7('0x8')]}:undefined;return _0x1b9c2f[_0x2df8d9[_0x9dd7('0x9')]]['findAll']({'where':_0xfd9b9e,'raw':!![]})[_0x9dd7('0xa')](function(_0x4b9515){_0x3fb5e9[_0x9dd7('0xb')]=_['map'](_0x4b9515,function(_0x267b51){return _0x267b51[_0x9dd7('0xc')];});_0x32cf44(_0x3fb5e9);})[_0x9dd7('0xd')](function(_0x19e18b){_0x16818a(_0x19e18b);});});}function _0x14357c(_0xdec692,_0xd359ad,_0x9ed4d2){if(!_0xd359ad)return Promise[_0x9dd7('0xe')](null);return new Promise(function(_0x379d56,_0x57c319){return _0x1b9c2f[_0x9dd7('0xf')]['findAll']({'where':{'sectionId':_0xd359ad['id']},'raw':!![]})[_0x9dd7('0xa')](function(_0x544bbc){if(_0xdec692[_0x9dd7('0x7')]&&_0xdec692[_0x9dd7('0x7')]!=='id'){_0xd359ad['associatedResources']=_[_0x9dd7('0x6')](_0x544bbc,function(_0x1924f0){return _0x1924f0[_0xdec692[_0x9dd7('0x7')]];});}else{if(_0x9ed4d2===_0x9dd7('0x10')){_0xd359ad[_0x9dd7('0xb')]=_[_0x9dd7('0x6')](_0x544bbc,function(_0x2fde58){return{'id':_0x2fde58[_0x9dd7('0x11')],'type':_0x2fde58['type']};});}else{_0xd359ad[_0x9dd7('0xb')]=_[_0x9dd7('0x6')](_0x544bbc,function(_0x3b0b75){return _0x3b0b75['resourceId'];});}}_0x379d56(_0xd359ad);})['catch'](function(_0x1958d5){_0x57c319(_0x1958d5);});});}function _0x30c725(_0x26557d,_0x81e22d){var _0x172471={'parentSections':[]};switch(_0x26557d[_0x9dd7('0x12')]()){case _0x9dd7('0x13'):_0x172471[_0x9dd7('0x14')]='SquareProject';break;case _0x9dd7('0x15'):_0x172471['childModel']=_0x9dd7('0x16');break;case _0x9dd7('0x17'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x18');_0x172471['parentSections']=[{'name':'SquareProjects','field':_0x9dd7('0xc'),'foreignKey':'projectName'}];break;case _0x9dd7('0x19'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x1a');break;case'contacts':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x1b');_0x172471[_0x9dd7('0x1c')]=[{'name':_0x9dd7('0x1d'),'field':'id','foreignKey':_0x9dd7('0x1e')}];break;case _0x9dd7('0x1f'):_0x172471[_0x9dd7('0x14')]='CmList';break;case'companies':_0x172471[_0x9dd7('0x14')]='CmCompany';break;case _0x9dd7('0x20'):_0x172471['childModel']=_0x9dd7('0x21');break;case _0x9dd7('0x22'):_0x172471['childModel']='ChatQueue';break;case _0x9dd7('0x23'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x24');break;case _0x9dd7('0x25'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x26');break;case'faxaccounts':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x27');break;case _0x9dd7('0x28'):case'internalroutes':case _0x9dd7('0x29'):_0x172471['childModel']='VoiceExtension';break;case _0x9dd7('0x2a'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x2b');break;case _0x9dd7('0x2c'):_0x172471['childModel']=_0x9dd7('0x2d');break;case _0x9dd7('0x2e'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x2f');_0x172471[_0x9dd7('0x1c')]=[{'name':_0x9dd7('0x30'),'field':_0x9dd7('0xc'),'foreignKey':_0x9dd7('0x31'),'model':_0x9dd7('0x32'),'filter':{'field':'role','value':[_0x9dd7('0x33')]}},{'name':_0x9dd7('0x34'),'field':_0x9dd7('0xc'),'foreignKey':_0x9dd7('0x31'),'model':_0x9dd7('0x32'),'filter':{'field':_0x9dd7('0x35'),'value':[_0x9dd7('0x36')]}},{'name':_0x9dd7('0x37'),'field':_0x9dd7('0xc'),'foreignKey':_0x9dd7('0x38'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x9dd7('0x38'),'model':_0x9dd7('0x39'),'filter':{'field':_0x9dd7('0x3a'),'value':[_0x9dd7('0x3b')]}}];break;case _0x9dd7('0x3c'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x3d');break;case _0x9dd7('0x3e'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x3f');break;case _0x9dd7('0x40'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x41');break;case _0x9dd7('0x42'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x43');break;case _0x9dd7('0x44'):_0x172471[_0x9dd7('0x14')]='MailQueue';break;case'mailaccounts':_0x172471['childModel']=_0x9dd7('0x45');break;case _0x9dd7('0x46'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x47');break;case'openchannelqueues':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x48');break;case _0x9dd7('0x49'):_0x172471[_0x9dd7('0x14')]='OpenchannelAccount';break;case _0x9dd7('0x4a'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x4b');break;case _0x9dd7('0x4c'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x4d');break;case'whatsappqueues':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x4e');break;case _0x9dd7('0x4f'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x50');break;case _0x9dd7('0x51'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x52');break;case _0x9dd7('0x53'):case'queuecampaigns':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x39');if(_0x81e22d){_0x172471[_0x9dd7('0x1c')]=[{'name':'VoiceQueues'},{'name':_0x9dd7('0x54')}];}break;case _0x9dd7('0x55'):case _0x9dd7('0x56'):case _0x9dd7('0x57'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x32');if(_0x81e22d){_0x172471[_0x9dd7('0x1c')]=[{'name':_0x9dd7('0x58'),'filter':{'field':'role','value':[_0x9dd7('0x59'),_0x9dd7('0x5a')]},'ignore':!![]},{'name':_0x9dd7('0x30')},{'name':_0x9dd7('0x34')}];}break;case'zendeskaccounts':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x5b');break;case _0x9dd7('0x5c'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x5d');break;case _0x9dd7('0x5e'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x5f');break;case _0x9dd7('0x60'):_0x172471['childModel']=_0x9dd7('0x61');break;case _0x9dd7('0x62'):_0x172471[_0x9dd7('0x14')]='DeskAccount';break;case _0x9dd7('0x63'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x64');break;case'vtigeraccounts':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x32');break;case _0x9dd7('0x65'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x66');break;case _0x9dd7('0x67'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x68');break;case _0x9dd7('0x69'):_0x172471['childModel']=_0x9dd7('0x6a');break;case _0x9dd7('0x6b'):_0x172471[_0x9dd7('0x14')]='Interval';break;case'pauses':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x6c');break;case _0x9dd7('0x6d'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x6e');break;case'sounds':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x6f');break;case _0x9dd7('0x70'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x71');break;case _0x9dd7('0x72'):_0x172471['childModel']=_0x9dd7('0x73');break;case _0x9dd7('0x74'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x75');break;case _0x9dd7('0x76'):_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x77');break;case _0x9dd7('0x78'):_0x172471['childModel']='Variable';break;case _0x9dd7('0x79'):_0x172471[_0x9dd7('0x14')]='Plugin';break;case _0x9dd7('0x7a'):_0x172471['childModel']=_0x9dd7('0x10');_0x172471[_0x9dd7('0x1c')]=[{'name':_0x9dd7('0x7b'),'field':'id','foreignKey':_0x9dd7('0x7c')}];break;case'metrics':_0x172471[_0x9dd7('0x14')]=_0x9dd7('0x7d');break;}return _0x172471;}function _0x29ac58(_0x39a53a,_0x41f208){var _0x4715b1=_0x39a53a[_0x9dd7('0x7e')](0x0)[_0x9dd7('0x7f')]()+_0x39a53a[_0x9dd7('0x80')](0x1);var _0x15ddd6={'type':_0x1b9c2f[_0x9dd7('0x81')][_0x9dd7('0x82')][_0x9dd7('0x83')],'raw':!![]};return new Promise(function(_0x4f79ca,_0x7c836e){var _0x3794e8=squel[_0x9dd7('0x84')]()['field'](_0x9dd7('0x85')+_0x4715b1+_0x9dd7('0x86'),'id')[_0x9dd7('0x7')](_0x9dd7('0x87'))[_0x9dd7('0x88')](_0x9dd7('0x89')+_0x39a53a+_0x9dd7('0x8a'),'ui')[_0x9dd7('0x8b')](_0x9dd7('0x8c'),_0x41f208['id']);return _0x1b9c2f['sequelize'][_0x9dd7('0x8d')](_0x3794e8['toString'](),_0x15ddd6)[_0x9dd7('0xa')](function(_0x398fa2){_0x41f208[_0x4715b1+'OpenTabs']=_0x398fa2;_0x4f79ca(_0x398fa2);})[_0x9dd7('0xd')](function(_0x45630b){_0x7c836e(_0x45630b);});});}return _0x3b7286[_0x9dd7('0x8e')](_0x9dd7('0x8f'),attributes,{'tableName':_0x9dd7('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x470e50){var _0x1fd503=require('../../components/parsers/qs');var _0x25c3ee={'raw':_0x470e50[_0x9dd7('0x8d')]['raw'],'where':{}};var _0x3e8501={};var _0x376415={'count':0x0,'rows':[]};var _0x4a7151=_0x470e50[_0x9dd7('0x8d')]['section'];var _0x4c3a30=_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0x91')]||![];var _0x5c1e93=_0x30c725(_0x4a7151,_0x4c3a30);if(!_0x5c1e93[_0x9dd7('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x4a7151+'\x27');var _0x36fa37=[{'name':_0x4a7151}];if(!_['isEmpty'](_0x5c1e93[_0x9dd7('0x1c')]))_0x36fa37=_0x5c1e93['parentSections'];var _0x3859bd=[];for(var _0x46cf13=0x0;_0x46cf13<_0x36fa37[_0x9dd7('0x92')];_0x46cf13++){_0x3859bd[_0x9dd7('0x93')](_0x1b9c2f[_0x9dd7('0x94')][_0x9dd7('0x95')]({'where':{'userProfileId':_0x470e50[_0x9dd7('0x96')]['id'],'name':_0x36fa37[_0x46cf13][_0x9dd7('0xc')]},'raw':!![]}));}return Promise[_0x9dd7('0x97')](_0x3859bd)[_0x9dd7('0xa')](function(_0x18a3a7){var _0x4a5e1f=_[_0x9dd7('0x4')](_0x18a3a7,function(_0x43831f){return _0x43831f?_0x43831f:undefined;});var _0x6c7479=_['filter'](_0x36fa37,['ignore',!![]]);var _0x299fdf=_['isEmpty'](_0x4a5e1f)&&_[_0x9dd7('0x98')](_0x6c7479)?null:_[_0x9dd7('0x99')](_0x6c7479,_0x4a5e1f);if(!_0x299fdf)return null;var _0x5dda6a=[];for(var _0x4620c4=0x0;_0x4620c4<_0x299fdf['length'];_0x4620c4++){var _0x2afd5c=_[_0x9dd7('0x95')](_0x36fa37,function(_0x7df9e){return _0x299fdf[_0x4620c4]?_0x7df9e[_0x9dd7('0xc')]===_0x299fdf[_0x4620c4][_0x9dd7('0xc')]:null;});if(_0x2afd5c){if(_0x299fdf[_0x4620c4][_0x9dd7('0x9a')]){_0x5dda6a['push'](_0x18e268(_0x5c1e93[_0x9dd7('0x14')],_0x299fdf[_0x4620c4]));}else{if(!_0x299fdf[_0x4620c4][_0x9dd7('0x9b')]){_0x5dda6a[_0x9dd7('0x93')](_0x14357c(_0x2afd5c,_0x299fdf[_0x4620c4],_0x5c1e93[_0x9dd7('0x14')]));}else{if(_0x2afd5c['model']){_0x5dda6a['push'](_0xebafd2(_0x2afd5c,_0x299fdf[_0x4620c4]));}}}}}return Promise[_0x9dd7('0x97')](_0x5dda6a);})[_0x9dd7('0xa')](function(_0x3624f2){var _0x13be91=_0x3624f2;var _0x373340=null;if(_0x13be91){_0x373340=_0x13be91['length']===0x1?_0x13be91[0x0]:null;}if(!_0x373340&&!_0x13be91)return _0x376415;var _0x168947=_0x1b9c2f[_0x5c1e93[_0x9dd7('0x14')]][_0x9dd7('0x9c')];_0x3e8501[_0x9dd7('0x9')]=_[_0x9dd7('0x9d')](_0x168947);_0x3e8501[_0x9dd7('0x8d')]=_[_0x9dd7('0x9d')](_0x470e50['query']);_0x3e8501[_0x9dd7('0x9e')]=_['intersection'](_0x3e8501[_0x9dd7('0x9')],_0x3e8501['query']);_0x25c3ee[_0x9dd7('0x9f')]=_[_0x9dd7('0xa0')](_0x3e8501['model'],_0x1fd503['fields'](_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xa1')]));_0x25c3ee[_0x9dd7('0x9f')]=_0x25c3ee[_0x9dd7('0x9f')][_0x9dd7('0x92')]?_0x25c3ee[_0x9dd7('0x9f')]:_0x3e8501['model'];if(!_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xa2')]('nolimit')){_0x25c3ee[_0x9dd7('0xa3')]=_0x1fd503['limit'](_0x470e50['query'][_0x9dd7('0xa3')]);_0x25c3ee[_0x9dd7('0xa4')]=_0x1fd503[_0x9dd7('0xa4')](_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xa4')]);}_0x25c3ee[_0x9dd7('0xa5')]=_0x1fd503['sort'](_0x470e50[_0x9dd7('0x8d')]['sort']);_0x25c3ee[_0x9dd7('0x8b')]=_0x1fd503[_0x9dd7('0x9e')](_[_0x9dd7('0xa6')](_0x470e50[_0x9dd7('0x8d')],_0x3e8501[_0x9dd7('0x9e')]));if(_0x470e50[_0x9dd7('0x8d')]['filter']){_0x25c3ee[_0x9dd7('0x8b')]=_['merge'](_0x25c3ee[_0x9dd7('0x8b')],{'$or':_[_0x9dd7('0x6')](_0x168947,function(_0x5ee07c){if(_0x5ee07c['type'][_0x9dd7('0xa7')]!==_0x9dd7('0xa8')){var _0x5d8820={};_0x5d8820[_0x5ee07c[_0x9dd7('0x7')]]={'$like':'%'+_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0x4')]+'%'};return _0x5d8820;}})});}var _0x53bb6b=[];var _0xdc00de=null;var _0x5f0dda={};if(_0x373340){_0xdc00de=_[_0x9dd7('0x95')](_0x36fa37,['name',_0x373340['name']]);if(_0xdc00de[_0x9dd7('0x7')]){_0x5f0dda={};if(_0x5c1e93[_0x9dd7('0x14')]===_0x9dd7('0x10')){_0x5f0dda[_0xdc00de[_0x9dd7('0xa9')]]=_[_0x9dd7('0x6')](_0x373340[_0x9dd7('0xb')],'id');}else{_0x5f0dda[_0xdc00de[_0x9dd7('0xa9')]]=_0x373340[_0x9dd7('0xb')];}_0x53bb6b[_0x9dd7('0x93')](_0x5f0dda);}else{_0x25c3ee[_0x9dd7('0x8b')]['id']=_0x373340['associatedResources'];}}else{for(var _0x140795=0x0;_0x140795<_0x13be91[_0x9dd7('0x92')];_0x140795++){_0xdc00de=_[_0x9dd7('0x95')](_0x36fa37,['name',_0x13be91[_0x140795][_0x9dd7('0xc')]]);if(_0xdc00de['field']){_0x5f0dda={};_0x5f0dda[_0xdc00de[_0x9dd7('0xa9')]]=_0x13be91[_0x140795][_0x9dd7('0xb')];_0x53bb6b[_0x9dd7('0x93')](_0x5f0dda);}else{if(!_0x25c3ee[_0x9dd7('0x8b')]['id'])_0x25c3ee[_0x9dd7('0x8b')]['id']=[];_0x13be91[_0x140795][_0x9dd7('0xb')]['forEach'](function(_0x29c3d7){_0x25c3ee[_0x9dd7('0x8b')]['id'][_0x9dd7('0x93')](_0x29c3d7);});}}}if(!_[_0x9dd7('0x98')](_0x53bb6b)){_0x25c3ee[_0x9dd7('0x8b')]=_[_0x9dd7('0xaa')](_0x25c3ee[_0x9dd7('0x8b')],{'$and':{'$or':_0x53bb6b}});}_0x25c3ee=_[_0x9dd7('0xaa')]({},_0x25c3ee,_0x470e50[_0x9dd7('0xab')]);if(_0x373340&&!_0x373340[_0x9dd7('0x9b')]&&_0x5c1e93[_0x9dd7('0x14')]===_0x9dd7('0x10')){if(_0x470e50['query'][_0x9dd7('0xac')]){_0x25c3ee[_0x9dd7('0xad')]=[{'all':!![]}];}return _0x1b9c2f[_0x5c1e93[_0x9dd7('0x14')]][_0x9dd7('0x5')](_0x25c3ee)[_0x9dd7('0xa')](function(_0x519360){var _0x3afe72=[];_0x519360[_0x9dd7('0xae')](function(_0x5777de){var _0x4f98b8;switch(_0x5777de[_0x9dd7('0xaf')]){case _0x9dd7('0xb0'):_0x4f98b8=_[_0x9dd7('0x95')](_0x373340['associatedResources'],function(_0x575686){return _0x575686['id']===_0x5777de[_0x9dd7('0x7c')]&&_0x575686[_0x9dd7('0x3a')]==='DefaultReports';});break;case _0x9dd7('0xb1'):_0x4f98b8=_[_0x9dd7('0x95')](_0x373340[_0x9dd7('0xb')],function(_0xe1dc64){return _0xe1dc64['id']===_0x5777de[_0x9dd7('0x7c')]&&_0xe1dc64['type']===_0x9dd7('0xb2');});break;}if(_0x4f98b8)_0x3afe72['push'](_0x5777de);});_0x376415[_0x9dd7('0xb3')]=_0x3afe72[_0x9dd7('0x92')];_0x376415[_0x9dd7('0xb4')]=_0x3afe72;return _0x376415;});}else{if(!_['isEmpty'](_0x470e50['query'][_0x9dd7('0xb5')])){_0x25c3ee[_0x9dd7('0x8b')]['id']=_0x25c3ee[_0x9dd7('0x8b')]['id']?_['intersection'](_0x25c3ee['where']['id'],_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xb5')]):_0x470e50[_0x9dd7('0x8d')]['ids'];if(_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xb6')]){_0x25c3ee[_0x9dd7('0xa5')]=_0x470e50['query'][_0x9dd7('0xb6')];}}if(_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xb7')]){_0x25c3ee[_0x9dd7('0x8b')]=_[_0x9dd7('0xaa')](_0x25c3ee[_0x9dd7('0x8b')],{'$and':_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xb7')]});}return _0x1b9c2f[_0x5c1e93[_0x9dd7('0x14')]][_0x9dd7('0xb3')]({'where':_0x25c3ee[_0x9dd7('0x8b')]})[_0x9dd7('0xa')](function(_0x1f3a91){_0x376415[_0x9dd7('0xb3')]=_0x1f3a91;if(_0x470e50[_0x9dd7('0x8d')]['includeAll']){if(_0x5c1e93['childModel']===_0x9dd7('0x1b')){_0x25c3ee[_0x9dd7('0xad')]=[{'model':_0x1b9c2f[_0x9dd7('0x71')],'as':_0x9dd7('0xb8'),'attributes':['id',_0x9dd7('0xc'),_0x9dd7('0xb9')],'required':_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xba')]?!![]:![]},{'model':_0x1b9c2f[_0x9dd7('0x71')],'as':_0x9dd7('0xbb'),'attributes':['id',_0x9dd7('0xc'),'color'],'through':_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xba')]?{'attributes':[],'where':{'TagId':_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xba')]||undefined}}:{},'required':_0x470e50[_0x9dd7('0x8d')][_0x9dd7('0xba')]?!![]:![]}];}else{_0x25c3ee[_0x9dd7('0xad')]=[{'all':!![]}];}}return _0x1b9c2f[_0x5c1e93['childModel']][_0x9dd7('0x5')](_0x25c3ee);})[_0x9dd7('0xa')](function(_0xe1179c){_0x376415['rows']=_0xe1179c;if(_0x4a7151==='Agents'&&_0x470e50['query'][_0x9dd7('0xbc')]===_0x9dd7('0xbd')){var _0x12362b=[];for(var _0x458ece=0x0;_0x458ece<_0x376415[_0x9dd7('0xb4')][_0x9dd7('0x92')];_0x458ece++){_0x12362b[_0x9dd7('0x93')](_0x29ac58(_0x9dd7('0xbe'),_0x376415[_0x9dd7('0xb4')][_0x458ece][_0x9dd7('0xbf')]));_0x12362b[_0x9dd7('0x93')](_0x29ac58('sms',_0x376415[_0x9dd7('0xb4')][_0x458ece][_0x9dd7('0xbf')]));_0x12362b[_0x9dd7('0x93')](_0x29ac58(_0x9dd7('0xc0'),_0x376415['rows'][_0x458ece][_0x9dd7('0xbf')]));_0x12362b[_0x9dd7('0x93')](_0x29ac58('mail',_0x376415[_0x9dd7('0xb4')][_0x458ece]['dataValues']));_0x12362b['push'](_0x29ac58(_0x9dd7('0xc1'),_0x376415[_0x9dd7('0xb4')][_0x458ece][_0x9dd7('0xbf')]));_0x12362b['push'](_0x29ac58(_0x9dd7('0xc2'),_0x376415['rows'][_0x458ece][_0x9dd7('0xbf')]));}return Promise[_0x9dd7('0x97')](_0x12362b)['then'](function(){return _0x376415;});}return _0x376415;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d72f729..836f292 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 _0x23bb=['catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','localhost','redis','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x359ea9,_0x5e3767){var _0xb5d14c=function(_0x2df30b){while(--_0x2df30b){_0x359ea9['push'](_0x359ea9['shift']());}};_0xb5d14c(++_0x5e3767);}(_0x23bb,0x79));var _0xb23b=function(_0x2e17a7,_0x5b5efa){_0x2e17a7=_0x2e17a7-0x0;var _0x443505=_0x23bb[_0x2e17a7];return _0x443505;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb23b('0x1'));var rs=require(_0xb23b('0x2'));var fs=require('fs');var Redis=require(_0xb23b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb23b('0x4'));var logger=require(_0xb23b('0x5'))(_0xb23b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb23b('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb23b('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb23b('0x9')]));require('./userProfile.socket')[_0xb23b('0xa')](socket);function respondWithRpcPromise(_0x33b27d,_0x49f92a,_0xa56813){return new BPromise(function(_0x2fe30e,_0x56e9ba){return client[_0xb23b('0xb')](_0x33b27d,_0xa56813)[_0xb23b('0xc')](function(_0x1b5f93){logger['info'](_0xb23b('0xd'),_0x49f92a,_0xb23b('0xe'));logger[_0xb23b('0xf')](_0xb23b('0x10'),_0x49f92a,_0xb23b('0xe'),JSON[_0xb23b('0x11')](_0x1b5f93));if(_0x1b5f93[_0xb23b('0x12')]){if(_0x1b5f93[_0xb23b('0x12')][_0xb23b('0x13')]===0x1f4){logger[_0xb23b('0x12')](_0xb23b('0xd'),_0x49f92a,_0x1b5f93[_0xb23b('0x12')][_0xb23b('0x14')]);return _0x56e9ba(_0x1b5f93[_0xb23b('0x12')][_0xb23b('0x14')]);}logger[_0xb23b('0x12')](_0xb23b('0xd'),_0x49f92a,_0x1b5f93['error'][_0xb23b('0x14')]);return _0x2fe30e(_0x1b5f93[_0xb23b('0x12')][_0xb23b('0x14')]);}else{logger[_0xb23b('0x15')](_0xb23b('0xd'),_0x49f92a,'request\x20sent');_0x2fe30e(_0x1b5f93[_0xb23b('0x16')]['message']);}})[_0xb23b('0x17')](function(_0x2ef602){logger[_0xb23b('0x12')]('UserProfile,\x20%s,\x20%s',_0x49f92a,_0x2ef602);_0x56e9ba(_0x2ef602);});});} \ No newline at end of file +var _0xa701=['UserProfile,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf466fc,_0xe6b550){var _0x1e6330=function(_0x3ccf87){while(--_0x3ccf87){_0xf466fc['push'](_0xf466fc['shift']());}};_0x1e6330(++_0xe6b550);}(_0xa701,0xd4));var _0x1a70=function(_0x2e697c,_0x454f2e){_0x2e697c=_0x2e697c-0x0;var _0x359c93=_0xa701[_0x2e697c];return _0x359c93;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var moment=require(_0x1a70('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a70('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a70('0x3'))(_0x1a70('0x4'));var config=require(_0x1a70('0x5'));var jayson=require(_0x1a70('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x1a70('0x7')]=_[_0x1a70('0x8')](config[_0x1a70('0x7')],{'host':_0x1a70('0x9'),'port':0x18eb});var socket=require(_0x1a70('0xa'))(new Redis(config[_0x1a70('0x7')]));require(_0x1a70('0xb'))['register'](socket);function respondWithRpcPromise(_0xe69b9b,_0x121091,_0x17015c){return new BPromise(function(_0x471b1f,_0x5772d9){return client[_0x1a70('0xc')](_0xe69b9b,_0x17015c)[_0x1a70('0xd')](function(_0x1b29e7){logger['info']('UserProfile,\x20%s,\x20%s',_0x121091,_0x1a70('0xe'));logger['debug'](_0x1a70('0xf'),_0x121091,'request\x20sent',JSON[_0x1a70('0x10')](_0x1b29e7));if(_0x1b29e7['error']){if(_0x1b29e7[_0x1a70('0x11')]['code']===0x1f4){logger[_0x1a70('0x11')](_0x1a70('0x12'),_0x121091,_0x1b29e7[_0x1a70('0x11')][_0x1a70('0x13')]);return _0x5772d9(_0x1b29e7[_0x1a70('0x11')]['message']);}logger['error'](_0x1a70('0x12'),_0x121091,_0x1b29e7['error'][_0x1a70('0x13')]);return _0x471b1f(_0x1b29e7[_0x1a70('0x11')]['message']);}else{logger[_0x1a70('0x14')]('UserProfile,\x20%s,\x20%s',_0x121091,_0x1a70('0xe'));_0x471b1f(_0x1b29e7[_0x1a70('0x15')]['message']);}})[_0x1a70('0x16')](function(_0x35de3b){logger['error']('UserProfile,\x20%s,\x20%s',_0x121091,_0x35de3b);_0x5772d9(_0x35de3b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5e3badc..93ce492 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 _0x7420=['length','userProfile:','save','update','emit','removeListener','register'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x7420,0x1d7));var _0x0742=function(_0x46466b,_0x4dbd3a){_0x46466b=_0x46466b-0x0;var _0x9abc06=_0x7420[_0x46466b];return _0x9abc06;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x0742('0x0'),'remove',_0x0742('0x1')];function createListener(_0x3b365a,_0x3120a5){return function(_0x4747d4){_0x3120a5[_0x0742('0x2')](_0x3b365a,_0x4747d4);};}function removeListener(_0x1931ea,_0x5edf06){return function(){UserProfileEvents[_0x0742('0x3')](_0x1931ea,_0x5edf06);};}exports[_0x0742('0x4')]=function(_0x5e7f18){for(var _0x438247=0x0,_0x19ea9c=events[_0x0742('0x5')];_0x438247<_0x19ea9c;_0x438247++){var _0x56f5eb=events[_0x438247];var _0x3fa85f=createListener(_0x0742('0x6')+_0x56f5eb,_0x5e7f18);UserProfileEvents['on'](_0x56f5eb,_0x3fa85f);}}; \ No newline at end of file +var _0xf56d=['save','update','emit','length','userProfile:','./userProfile.events'];(function(_0x43919c,_0x4ae0cb){var _0x23e219=function(_0x1b15f2){while(--_0x1b15f2){_0x43919c['push'](_0x43919c['shift']());}};_0x23e219(++_0x4ae0cb);}(_0xf56d,0xd1));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xdf56('0x0'));var events=[_0xdf56('0x1'),'remove',_0xdf56('0x2')];function createListener(_0x3b0988,_0x535ec4){return function(_0x2def30){_0x535ec4[_0xdf56('0x3')](_0x3b0988,_0x2def30);};}function removeListener(_0x256b4d,_0x53e835){return function(){UserProfileEvents['removeListener'](_0x256b4d,_0x53e835);};}exports['register']=function(_0x5c72b0){for(var _0x28ebdb=0x0,_0x3ea9b9=events[_0xdf56('0x4')];_0x28ebdb<_0x3ea9b9;_0x28ebdb++){var _0x2f368b=events[_0x28ebdb];var _0xcab2a8=createListener(_0xdf56('0x5')+_0x2f368b,_0x5c72b0);UserProfileEvents['on'](_0x2f368b,_0xcab2a8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 94ae602..98b7bc3 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 _0xf36b=['../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xb1d4de,_0x17eb0c){var _0x5d68f5=function(_0x23f590){while(--_0x23f590){_0xb1d4de['push'](_0xb1d4de['shift']());}};_0x5d68f5(++_0x17eb0c);}(_0xf36b,0x13a));var _0xbf36=function(_0x733826,_0x5931c0){_0x733826=_0x733826-0x0;var _0xaf4b52=_0xf36b[_0x733826];return _0xaf4b52;};'use strict';var multer=require(_0xbf36('0x0'));var util=require(_0xbf36('0x1'));var path=require(_0xbf36('0x2'));var timeout=require(_0xbf36('0x3'));var express=require(_0xbf36('0x4'));var router=express[_0xbf36('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbf36('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbf36('0x7'));var controller=require(_0xbf36('0x8'));router[_0xbf36('0x9')]('/',auth[_0xbf36('0xa')](),controller[_0xbf36('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xbf36('0x9')](_0xbf36('0xc'),auth[_0xbf36('0xa')](),controller[_0xbf36('0xd')]);router[_0xbf36('0xe')]('/',auth[_0xbf36('0xa')](),controller[_0xbf36('0xf')]);router[_0xbf36('0x10')](_0xbf36('0xc'),auth[_0xbf36('0xa')](),controller[_0xbf36('0x11')]);router[_0xbf36('0x12')](_0xbf36('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf36('0x13')]=router; \ No newline at end of file +var _0x72ef=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','show','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x5d478d,_0x2ac31f){var _0x1f8a3a=function(_0x1ff4cc){while(--_0x1ff4cc){_0x5d478d['push'](_0x5d478d['shift']());}};_0x1f8a3a(++_0x2ac31f);}(_0x72ef,0x1b6));var _0xf72e=function(_0x19b9e5,_0x3d5e41){_0x19b9e5=_0x19b9e5-0x0;var _0x33364d=_0x72ef[_0x19b9e5];return _0x33364d;};'use strict';var multer=require(_0xf72e('0x0'));var util=require(_0xf72e('0x1'));var path=require(_0xf72e('0x2'));var timeout=require(_0xf72e('0x3'));var express=require(_0xf72e('0x4'));var router=express[_0xf72e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf72e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf72e('0x7'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xf72e('0x8')](),controller[_0xf72e('0x9')]);router['get'](_0xf72e('0xa'),auth['isAuthenticated'](),controller[_0xf72e('0xb')]);router[_0xf72e('0xc')]('/:id',auth[_0xf72e('0x8')](),controller[_0xf72e('0xd')]);router[_0xf72e('0xe')]('/',auth['isAuthenticated'](),controller[_0xf72e('0xf')]);router[_0xf72e('0x10')](_0xf72e('0x11'),auth['isAuthenticated'](),controller[_0xf72e('0x12')]);router['delete'](_0xf72e('0x11'),auth[_0xf72e('0x8')](),controller[_0xf72e('0x13')]);module[_0xf72e('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 41b2fc2..a49a6dc 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 _0xb77e=['sequelize','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xb77e,0x1ce));var _0xeb77=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xb77e[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0xeb77('0x0'));module[_0xeb77('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x7c7c=['INTEGER','STRING','sequelize','exports'];(function(_0x75562e,_0x239701){var _0x1f52cf=function(_0x842419){while(--_0x842419){_0x75562e['push'](_0x75562e['shift']());}};_0x1f52cf(++_0x239701);}(_0x7c7c,0xee));var _0xc7c7=function(_0xe0b688,_0x16042c){_0xe0b688=_0xe0b688-0x0;var _0x2ebdaf=_0x7c7c[_0xe0b688];return _0x2ebdaf;};'use strict';var Sequelize=require(_0xc7c7('0x0'));module[_0xc7c7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc7c7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc7c7('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d63867f..f9ad16d 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 _0x01d9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['UserProfileResource'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['UserProfileResource'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};exports[_0x901d('0x4d')]=function(_0x52aa2d,_0x3a3ea6){return db[_0x901d('0x2f')][_0x901d('0x4d')]()[_0x901d('0x28')](respondWithResult(_0x3a3ea6,null))[_0x901d('0x46')](handleError(_0x3a3ea6,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(_0x3fd531,_0x538738){var _0x5bd9db=function(_0x676411){while(--_0x676411){_0x3fd531['push'](_0x3fd531['shift']());}};_0x5bd9db(++_0x538738);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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 29a0d4f..f6aaac0 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 _0xd787=['rimraf','exports','define','UserProfileResource','user_profile_has_resources','sectionId','lodash','../../config/logger','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd787,0xba));var _0x7d78=function(_0x150599,_0x3bdfb0){_0x150599=_0x150599-0x0;var _0x12c65f=_0xd787[_0x150599];return _0x12c65f;};'use strict';var _=require(_0x7d78('0x0'));var util=require('util');var logger=require(_0x7d78('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d78('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d78('0x3'));var rimraf=require(_0x7d78('0x4'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x7d78('0x5')]=function(_0x4d2415,_0x3e46b6){return _0x4d2415[_0x7d78('0x6')](_0x7d78('0x7'),attributes,{'tableName':_0x7d78('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x7d78('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfae8=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','util'];(function(_0x3a45a8,_0x1cccf6){var _0x3695b2=function(_0x24014b){while(--_0x24014b){_0x3a45a8['push'](_0x3a45a8['shift']());}};_0x3695b2(++_0x1cccf6);}(_0xfae8,0x16b));var _0x8fae=function(_0x400dc8,_0x4c099f){_0x400dc8=_0x400dc8-0x0;var _0x130d59=_0xfae8[_0x400dc8];return _0x130d59;};'use strict';var _=require('lodash');var util=require(_0x8fae('0x0'));var logger=require(_0x8fae('0x1'))(_0x8fae('0x2'));var moment=require(_0x8fae('0x3'));var BPromise=require(_0x8fae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8fae('0x5'));var config=require(_0x8fae('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x8fae('0x7')]=function(_0x779b57,_0x1c4a5b){return _0x779b57[_0x8fae('0x8')]('UserProfileResource',attributes,{'tableName':_0x8fae('0x9'),'paranoid':![],'indexes':[{'name':_0x8fae('0xa'),'fields':[_0x8fae('0xb'),_0x8fae('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index d5994ba..c0f6737 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 _0x4614=['UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x15c72f,_0xfeb066){var _0x2c4cb9=function(_0x4a658c){while(--_0x4a658c){_0x15c72f['push'](_0x15c72f['shift']());}};_0x2c4cb9(++_0xfeb066);}(_0x4614,0x85));var _0x4461=function(_0x2666a2,_0x58f4e5){_0x2666a2=_0x2666a2-0x0;var _0x5c22a8=_0x4614[_0x2666a2];return _0x5c22a8;};'use strict';var _=require(_0x4461('0x0'));var util=require(_0x4461('0x1'));var moment=require(_0x4461('0x2'));var BPromise=require(_0x4461('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4461('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4461('0x5'))(_0x4461('0x6'));var config=require(_0x4461('0x7'));var jayson=require(_0x4461('0x8'));var client=jayson[_0x4461('0x9')][_0x4461('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f96b8,_0xbdf0b4,_0x32d563){return new BPromise(function(_0x1616c0,_0x56e63d){return client[_0x4461('0xb')](_0x5f96b8,_0x32d563)[_0x4461('0xc')](function(_0x48c6bb){logger[_0x4461('0xd')](_0x4461('0xe'),_0xbdf0b4,_0x4461('0xf'));logger['debug'](_0x4461('0x10'),_0xbdf0b4,_0x4461('0xf'),JSON[_0x4461('0x11')](_0x48c6bb));if(_0x48c6bb['error']){if(_0x48c6bb[_0x4461('0x12')]['code']===0x1f4){logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x48c6bb['error'][_0x4461('0x13')]);return _0x56e63d(_0x48c6bb[_0x4461('0x12')][_0x4461('0x13')]);}logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x48c6bb['error'][_0x4461('0x13')]);return _0x1616c0(_0x48c6bb[_0x4461('0x12')][_0x4461('0x13')]);}else{logger[_0x4461('0xd')](_0x4461('0xe'),_0xbdf0b4,'request\x20sent');_0x1616c0(_0x48c6bb[_0x4461('0x14')][_0x4461('0x13')]);}})['catch'](function(_0x1ce854){logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x1ce854);_0x56e63d(_0x1ce854);});});} \ No newline at end of file +var _0xff91=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff91,0x18b));var _0x1ff9=function(_0x5ceae3,_0x20cb8c){_0x5ceae3=_0x5ceae3-0x0;var _0x1f8edd=_0xff91[_0x5ceae3];return _0x1f8edd;};'use strict';var _=require('lodash');var util=require(_0x1ff9('0x0'));var moment=require(_0x1ff9('0x1'));var BPromise=require(_0x1ff9('0x2'));var rs=require(_0x1ff9('0x3'));var fs=require('fs');var Redis=require(_0x1ff9('0x4'));var db=require(_0x1ff9('0x5'))['db'];var utils=require(_0x1ff9('0x6'));var logger=require(_0x1ff9('0x7'))(_0x1ff9('0x8'));var config=require(_0x1ff9('0x9'));var jayson=require(_0x1ff9('0xa'));var client=jayson[_0x1ff9('0xb')][_0x1ff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bcc03,_0x59fe2e,_0x1905a1){return new BPromise(function(_0xbd21f8,_0x5119c4){return client[_0x1ff9('0xd')](_0x3bcc03,_0x1905a1)['then'](function(_0x1071bc){logger[_0x1ff9('0xe')](_0x1ff9('0xf'),_0x59fe2e,'request\x20sent');logger[_0x1ff9('0x10')](_0x1ff9('0x11'),_0x59fe2e,_0x1ff9('0x12'),JSON[_0x1ff9('0x13')](_0x1071bc));if(_0x1071bc[_0x1ff9('0x14')]){if(_0x1071bc[_0x1ff9('0x14')][_0x1ff9('0x15')]===0x1f4){logger[_0x1ff9('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x59fe2e,_0x1071bc[_0x1ff9('0x14')][_0x1ff9('0x16')]);return _0x5119c4(_0x1071bc[_0x1ff9('0x14')][_0x1ff9('0x16')]);}logger[_0x1ff9('0x14')](_0x1ff9('0xf'),_0x59fe2e,_0x1071bc[_0x1ff9('0x14')][_0x1ff9('0x16')]);return _0xbd21f8(_0x1071bc['error'][_0x1ff9('0x16')]);}else{logger[_0x1ff9('0xe')](_0x1ff9('0xf'),_0x59fe2e,_0x1ff9('0x12'));_0xbd21f8(_0x1071bc[_0x1ff9('0x17')][_0x1ff9('0x16')]);}})[_0x1ff9('0x18')](function(_0x3b0784){logger[_0x1ff9('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x59fe2e,_0x3b0784);_0x5119c4(_0x3b0784);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9ef275b..1fb05cd 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 _0x0b28=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index'];(function(_0x846ae8,_0x33a70b){var _0x356b00=function(_0xa96f69){while(--_0xa96f69){_0x846ae8['push'](_0x846ae8['shift']());}};_0x356b00(++_0x33a70b);}(_0x0b28,0x11b));var _0x80b2=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x0b28[_0x2ff238];return _0x204a56;};'use strict';var multer=require(_0x80b2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x80b2('0x1'));var express=require(_0x80b2('0x2'));var router=express[_0x80b2('0x3')]();var fs_extra=require(_0x80b2('0x4'));var auth=require(_0x80b2('0x5'));var interaction=require(_0x80b2('0x6'));var config=require('../../config/environment');var controller=require(_0x80b2('0x7'));router[_0x80b2('0x8')]('/',auth[_0x80b2('0x9')](),controller[_0x80b2('0xa')]);router[_0x80b2('0x8')](_0x80b2('0xb'),auth[_0x80b2('0x9')](),controller[_0x80b2('0xc')]);router[_0x80b2('0x8')](_0x80b2('0xd'),auth['isAuthenticated'](),controller[_0x80b2('0xe')]);router['post']('/',auth[_0x80b2('0x9')](),controller[_0x80b2('0xf')]);router[_0x80b2('0x10')](_0x80b2('0xd'),auth['isAuthenticated'](),controller[_0x80b2('0x11')]);router[_0x80b2('0x12')](_0x80b2('0xd'),auth[_0x80b2('0x9')](),controller[_0x80b2('0x13')]);module[_0x80b2('0x14')]=router; \ No newline at end of file +var _0x2325=['isAuthenticated','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','index','get','/describe'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2325,0x170));var _0x5232=function(_0x2ce709,_0x41ab1e){_0x2ce709=_0x2ce709-0x0;var _0x908e80=_0x2325[_0x2ce709];return _0x908e80;};'use strict';var multer=require(_0x5232('0x0'));var util=require(_0x5232('0x1'));var path=require('path');var timeout=require(_0x5232('0x2'));var express=require(_0x5232('0x3'));var router=express[_0x5232('0x4')]();var fs_extra=require(_0x5232('0x5'));var auth=require(_0x5232('0x6'));var interaction=require(_0x5232('0x7'));var config=require('../../config/environment');var controller=require(_0x5232('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5232('0x9')]);router[_0x5232('0xa')](_0x5232('0xb'),auth[_0x5232('0xc')](),controller['describe']);router['get']('/:id',auth[_0x5232('0xc')](),controller['show']);router[_0x5232('0xd')]('/',auth[_0x5232('0xc')](),controller[_0x5232('0xe')]);router[_0x5232('0xf')](_0x5232('0x10'),auth[_0x5232('0xc')](),controller[_0x5232('0x11')]);router[_0x5232('0x12')](_0x5232('0x10'),auth[_0x5232('0xc')](),controller['destroy']);module[_0x5232('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index dc116a3..7fbc873 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 _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x3a5dac,_0x5b3b9b){var _0x35ba62=function(_0x405b3c){while(--_0x405b3c){_0x3a5dac['push'](_0x3a5dac['shift']());}};_0x35ba62(++_0x5b3b9b);}(_0x6cb4,0xff));var _0x46cb=function(_0x12c2bb,_0x1fefcb){_0x12c2bb=_0x12c2bb-0x0;var _0x47d4cb=_0x6cb4[_0x12c2bb];return _0x47d4cb;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}}; \ No newline at end of file +var _0xdb94=['INTEGER','BOOLEAN','crudPermissions','sequelize','exports','STRING'];(function(_0x556ca4,_0x39fb17){var _0x4fd021=function(_0x4ca6da){while(--_0x4ca6da){_0x556ca4['push'](_0x556ca4['shift']());}};_0x4fd021(++_0x39fb17);}(_0xdb94,0xab));var _0x4db9=function(_0x19787a,_0x499fc8){_0x19787a=_0x19787a-0x0;var _0x1398b4=_0xdb94[_0x19787a];return _0x1398b4;};'use strict';var Sequelize=require(_0x4db9('0x0'));module[_0x4db9('0x1')]={'name':{'type':Sequelize[_0x4db9('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x4db9('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4db9('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4db9('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4db9('0x2')],'set':function(_0x554bd5){this['setDataValue'](_0x4db9('0x5'),_0x554bd5?_0x554bd5['join'](''):[]);},'get':function(){return this['getDataValue'](_0x4db9('0x5'))?this['getDataValue'](_0x4db9('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 9c7d4f9..7c6ff53 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 _0x167d=['../../mysqldb','sendStatus','status','end','json','offset','undefined','set','reject','update','then','error','name','send','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','VIRTUAL','merge','options','count','include','findAll','rows','params','rawAttributes','includeAll','find','create','catch','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util'];(function(_0x3d13bb,_0x262a54){var _0x4b5a1b=function(_0x53417e){while(--_0x53417e){_0x3d13bb['push'](_0x3d13bb['shift']());}};_0x4b5a1b(++_0x262a54);}(_0x167d,0x1df));var _0xd167=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x167d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd167('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd167('0x1'));var jsonpatch=require(_0xd167('0x2'));var rp=require(_0xd167('0x3'));var moment=require(_0xd167('0x4'));var BPromise=require(_0xd167('0x5'));var Mustache=require(_0xd167('0x6'));var util=require(_0xd167('0x7'));var path=require(_0xd167('0x8'));var sox=require(_0xd167('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd167('0xa'));var _=require(_0xd167('0xb'));var squel=require(_0xd167('0xc'));var crypto=require('crypto');var jsforce=require(_0xd167('0xd'));var deskjs=require(_0xd167('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd167('0xf'));var Papa=require(_0xd167('0x10'));var Redis=require('ioredis');var authService=require(_0xd167('0x11'));var qs=require(_0xd167('0x12'));var as=require(_0xd167('0x13'));var hardwareService=require(_0xd167('0x14'));var logger=require(_0xd167('0x15'))(_0xd167('0x16'));var utils=require('../../config/utils');var config=require(_0xd167('0x17'));var licenseUtil=require(_0xd167('0x18'));var db=require(_0xd167('0x19'))['db'];function respondWithStatusCode(_0x443271,_0x407347){_0x407347=_0x407347||0xcc;return function(_0x218238){if(_0x218238){return _0x443271[_0xd167('0x1a')](_0x407347);}return _0x443271[_0xd167('0x1b')](_0x407347)[_0xd167('0x1c')]();};}function respondWithResult(_0x44c59c,_0x574af3){_0x574af3=_0x574af3||0xc8;return function(_0x3b7efb){if(_0x3b7efb){return _0x44c59c[_0xd167('0x1b')](_0x574af3)[_0xd167('0x1d')](_0x3b7efb);}};}function respondWithFilteredResult(_0x168322,_0x1b196e){return function(_0x1ef78f){if(_0x1ef78f){var _0x35fb13=typeof _0x1b196e[_0xd167('0x1e')]==='undefined'&&typeof _0x1b196e['limit']===_0xd167('0x1f');var _0x55cd8d=_0x1ef78f['count'];var _0x3215b3=_0x35fb13?0x0:_0x1b196e[_0xd167('0x1e')];var _0x3540c0=_0x35fb13?_0x1ef78f['count']:_0x1b196e['offset']+_0x1b196e['limit'];var _0x168bfe;if(_0x3540c0>=_0x55cd8d){_0x3540c0=_0x55cd8d;_0x168bfe=0xc8;}else{_0x168bfe=0xce;}_0x168322['status'](_0x168bfe);return _0x168322[_0xd167('0x20')]('Content-Range',_0x3215b3+'-'+_0x3540c0+'/'+_0x55cd8d)[_0xd167('0x1d')](_0x1ef78f);}return null;};}function patchUpdates(_0x2dd5b7){return function(_0x1e56b4){try{jsonpatch['apply'](_0x1e56b4,_0x2dd5b7,!![]);}catch(_0x5631d8){return BPromise[_0xd167('0x21')](_0x5631d8);}return _0x1e56b4['save']();};}function saveUpdates(_0x3a12b4,_0x464ec2){return function(_0x473104){if(_0x473104){return _0x473104[_0xd167('0x22')](_0x3a12b4)['then'](function(_0x3e284e){return _0x3e284e;});}return null;};}function removeEntity(_0x564cf3,_0x5d4c54){return function(_0x872609){if(_0x872609){return _0x872609['destroy']()[_0xd167('0x23')](function(){_0x564cf3['status'](0xcc)[_0xd167('0x1c')]();});}};}function handleEntityNotFound(_0x599b91,_0x1e0cde){return function(_0x4ab62c){if(!_0x4ab62c){_0x599b91['sendStatus'](0x194);}return _0x4ab62c;};}function handleError(_0x20fefc,_0x343651){_0x343651=_0x343651||0x1f4;return function(_0x45956f){logger[_0xd167('0x24')](_0x45956f['stack']);if(_0x45956f[_0xd167('0x25')]){delete _0x45956f['name'];}_0x20fefc[_0xd167('0x1b')](_0x343651)[_0xd167('0x26')](_0x45956f);};}exports['index']=function(_0x12e479,_0x5b108b){var _0x93d6fc={},_0x5def97={},_0x5c72ac={'count':0x0,'rows':[]};var _0x1e2d64=_[_0xd167('0x27')](db[_0xd167('0x28')]['rawAttributes'],function(_0x28f8bb){return{'name':_0x28f8bb[_0xd167('0x29')],'type':_0x28f8bb[_0xd167('0x2a')][_0xd167('0x2b')]};});_0x5def97[_0xd167('0x2c')]=_[_0xd167('0x27')](_0x1e2d64,_0xd167('0x25'));_0x5def97[_0xd167('0x2d')]=_[_0xd167('0x2e')](_0x12e479['query']);_0x5def97[_0xd167('0x2f')]=_['intersection'](_0x5def97['model'],_0x5def97[_0xd167('0x2d')]);_0x93d6fc[_0xd167('0x30')]=_[_0xd167('0x31')](_0x5def97[_0xd167('0x2c')],qs[_0xd167('0x32')](_0x12e479[_0xd167('0x2d')]['fields']));_0x93d6fc[_0xd167('0x30')]=_0x93d6fc[_0xd167('0x30')][_0xd167('0x33')]?_0x93d6fc[_0xd167('0x30')]:_0x5def97[_0xd167('0x2c')];if(!_0x12e479['query'][_0xd167('0x34')]('nolimit')){_0x93d6fc[_0xd167('0x35')]=qs['limit'](_0x12e479['query']['limit']);_0x93d6fc[_0xd167('0x1e')]=qs[_0xd167('0x1e')](_0x12e479[_0xd167('0x2d')]['offset']);}_0x93d6fc['order']=qs[_0xd167('0x36')](_0x12e479[_0xd167('0x2d')][_0xd167('0x36')]);_0x93d6fc[_0xd167('0x37')]=qs['filters'](_['pick'](_0x12e479[_0xd167('0x2d')],_0x5def97['filters']),_0x1e2d64);if(_0x12e479[_0xd167('0x2d')]['filter']){_0x93d6fc[_0xd167('0x37')]=_['merge'](_0x93d6fc['where'],{'$or':_[_0xd167('0x27')](_0x1e2d64,function(_0x1ec384){if(_0x1ec384[_0xd167('0x2a')]!==_0xd167('0x38')){var _0x5971c1={};_0x5971c1[_0x1ec384['name']]={'$like':'%'+_0x12e479[_0xd167('0x2d')]['filter']+'%'};return _0x5971c1;}})});}_0x93d6fc=_[_0xd167('0x39')]({},_0x93d6fc,_0x12e479[_0xd167('0x3a')]);var _0x34bf0c={'where':_0x93d6fc[_0xd167('0x37')]};return db[_0xd167('0x28')][_0xd167('0x3b')](_0x34bf0c)[_0xd167('0x23')](function(_0xbd6587){_0x5c72ac[_0xd167('0x3b')]=_0xbd6587;if(_0x12e479[_0xd167('0x2d')]['includeAll']){_0x93d6fc[_0xd167('0x3c')]=[{'all':!![]}];}return db['UserProfileSection'][_0xd167('0x3d')](_0x93d6fc);})['then'](function(_0x28c11f){_0x5c72ac[_0xd167('0x3e')]=_0x28c11f;return _0x5c72ac;})[_0xd167('0x23')](respondWithFilteredResult(_0x5b108b,_0x93d6fc))['catch'](handleError(_0x5b108b,null));};exports['show']=function(_0x38493f,_0x3fa3ae){var _0x4ecbca={'raw':![],'where':{'id':_0x38493f[_0xd167('0x3f')]['id']}},_0x37d7c7={};_0x37d7c7['model']=_[_0xd167('0x2e')](db['UserProfileSection'][_0xd167('0x40')]);_0x37d7c7[_0xd167('0x2d')]=_['keys'](_0x38493f['query']);_0x37d7c7[_0xd167('0x2f')]=_[_0xd167('0x31')](_0x37d7c7[_0xd167('0x2c')],_0x37d7c7['query']);_0x4ecbca[_0xd167('0x30')]=_['intersection'](_0x37d7c7['model'],qs[_0xd167('0x32')](_0x38493f['query']['fields']));_0x4ecbca['attributes']=_0x4ecbca[_0xd167('0x30')]['length']?_0x4ecbca[_0xd167('0x30')]:_0x37d7c7[_0xd167('0x2c')];if(_0x38493f[_0xd167('0x2d')][_0xd167('0x41')]){_0x4ecbca[_0xd167('0x3c')]=[{'all':!![]}];}_0x4ecbca=_[_0xd167('0x39')]({},_0x4ecbca,_0x38493f[_0xd167('0x3a')]);return db[_0xd167('0x28')][_0xd167('0x42')](_0x4ecbca)['then'](handleEntityNotFound(_0x3fa3ae,null))[_0xd167('0x23')](respondWithResult(_0x3fa3ae,null))['catch'](handleError(_0x3fa3ae,null));};exports[_0xd167('0x43')]=function(_0x1d3dad,_0x4ab109){return db[_0xd167('0x28')]['create'](_0x1d3dad['body'],{})['then'](respondWithResult(_0x4ab109,0xc9))[_0xd167('0x44')](handleError(_0x4ab109,null));};exports[_0xd167('0x22')]=function(_0x56ccae,_0xac48cf){if(_0x56ccae[_0xd167('0x45')]['id']){delete _0x56ccae[_0xd167('0x45')]['id'];}return db['UserProfileSection'][_0xd167('0x42')]({'where':{'id':_0x56ccae[_0xd167('0x3f')]['id']}})[_0xd167('0x23')](handleEntityNotFound(_0xac48cf,null))[_0xd167('0x23')](saveUpdates(_0x56ccae[_0xd167('0x45')],null))[_0xd167('0x23')](respondWithResult(_0xac48cf,null))['catch'](handleError(_0xac48cf,null));};exports[_0xd167('0x46')]=function(_0x2705b7,_0x434ca0){return db[_0xd167('0x28')][_0xd167('0x42')]({'where':{'id':_0x2705b7[_0xd167('0x3f')]['id']}})[_0xd167('0x23')](handleEntityNotFound(_0x434ca0,null))['then'](removeEntity(_0x434ca0,null))[_0xd167('0x44')](handleError(_0x434ca0,null));};exports[_0xd167('0x47')]=function(_0x13e970,_0x68e81){return db[_0xd167('0x28')][_0xd167('0x47')]()[_0xd167('0x23')](respondWithResult(_0x68e81,null))[_0xd167('0x44')](handleError(_0x68e81,null));}; \ No newline at end of file +var _0x3849=['keys','filters','intersection','model','fields','attributes','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','UserProfileSection','findAll','show','params','length','catch','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../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','then','destroy','name','send','index','map','rawAttributes','key','query'];(function(_0x2c5e1e,_0x32adff){var _0x5c085e=function(_0x1e7561){while(--_0x1e7561){_0x2c5e1e['push'](_0x2c5e1e['shift']());}};_0x5c085e(++_0x32adff);}(_0x3849,0xf1));var _0x9384=function(_0x1b905c,_0x287883){_0x1b905c=_0x1b905c-0x0;var _0x1f0195=_0x3849[_0x1b905c];return _0x1f0195;};'use strict';var emlformat=require(_0x9384('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9384('0x1'));var jsonpatch=require(_0x9384('0x2'));var rp=require(_0x9384('0x3'));var moment=require('moment');var BPromise=require(_0x9384('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9384('0x5'));var sox=require(_0x9384('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9384('0x7'));var squel=require('squel');var crypto=require(_0x9384('0x8'));var jsforce=require(_0x9384('0x9'));var deskjs=require(_0x9384('0xa'));var toCsv=require(_0x9384('0xb'));var querystring=require(_0x9384('0xc'));var Papa=require(_0x9384('0xd'));var Redis=require('ioredis');var authService=require(_0x9384('0xe'));var qs=require(_0x9384('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9384('0x10'));var logger=require(_0x9384('0x11'))(_0x9384('0x12'));var utils=require(_0x9384('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9384('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x368e99,_0x223350){_0x223350=_0x223350||0xcc;return function(_0x3940fc){if(_0x3940fc){return _0x368e99[_0x9384('0x15')](_0x223350);}return _0x368e99[_0x9384('0x16')](_0x223350)[_0x9384('0x17')]();};}function respondWithResult(_0x914a16,_0x51da1f){_0x51da1f=_0x51da1f||0xc8;return function(_0x27122e){if(_0x27122e){return _0x914a16[_0x9384('0x16')](_0x51da1f)[_0x9384('0x18')](_0x27122e);}};}function respondWithFilteredResult(_0x1afd48,_0xd77d14){return function(_0x14fbb6){if(_0x14fbb6){var _0x3550c5=typeof _0xd77d14[_0x9384('0x19')]==='undefined'&&typeof _0xd77d14[_0x9384('0x1a')]===_0x9384('0x1b');var _0x3c0456=_0x14fbb6[_0x9384('0x1c')];var _0x32ae66=_0x3550c5?0x0:_0xd77d14[_0x9384('0x19')];var _0xd3a7e4=_0x3550c5?_0x14fbb6[_0x9384('0x1c')]:_0xd77d14[_0x9384('0x19')]+_0xd77d14[_0x9384('0x1a')];var _0x2aca3f;if(_0xd3a7e4>=_0x3c0456){_0xd3a7e4=_0x3c0456;_0x2aca3f=0xc8;}else{_0x2aca3f=0xce;}_0x1afd48['status'](_0x2aca3f);return _0x1afd48[_0x9384('0x1d')](_0x9384('0x1e'),_0x32ae66+'-'+_0xd3a7e4+'/'+_0x3c0456)[_0x9384('0x18')](_0x14fbb6);}return null;};}function patchUpdates(_0x1e14ff){return function(_0x3ed4b7){try{jsonpatch[_0x9384('0x1f')](_0x3ed4b7,_0x1e14ff,!![]);}catch(_0x1af82d){return BPromise[_0x9384('0x20')](_0x1af82d);}return _0x3ed4b7[_0x9384('0x21')]();};}function saveUpdates(_0x2a51c3,_0x3aeb66){return function(_0x40f3cf){if(_0x40f3cf){return _0x40f3cf['update'](_0x2a51c3)[_0x9384('0x22')](function(_0x3cf11b){return _0x3cf11b;});}return null;};}function removeEntity(_0x5545e7,_0x42e773){return function(_0x13fe78){if(_0x13fe78){return _0x13fe78[_0x9384('0x23')]()['then'](function(){_0x5545e7[_0x9384('0x16')](0xcc)[_0x9384('0x17')]();});}};}function handleEntityNotFound(_0x4420ef,_0x437d65){return function(_0x3632ba){if(!_0x3632ba){_0x4420ef['sendStatus'](0x194);}return _0x3632ba;};}function handleError(_0x1543a2,_0x2bb5db){_0x2bb5db=_0x2bb5db||0x1f4;return function(_0x305dd7){logger['error'](_0x305dd7['stack']);if(_0x305dd7['name']){delete _0x305dd7[_0x9384('0x24')];}_0x1543a2[_0x9384('0x16')](_0x2bb5db)[_0x9384('0x25')](_0x305dd7);};}exports[_0x9384('0x26')]=function(_0x3bf5db,_0x3930a8){var _0x1b51e3={},_0xd0082e={},_0x1592a5={'count':0x0,'rows':[]};var _0x427b06=_[_0x9384('0x27')](db['UserProfileSection'][_0x9384('0x28')],function(_0x479bda){return{'name':_0x479bda['fieldName'],'type':_0x479bda['type'][_0x9384('0x29')]};});_0xd0082e['model']=_[_0x9384('0x27')](_0x427b06,_0x9384('0x24'));_0xd0082e[_0x9384('0x2a')]=_[_0x9384('0x2b')](_0x3bf5db[_0x9384('0x2a')]);_0xd0082e[_0x9384('0x2c')]=_[_0x9384('0x2d')](_0xd0082e[_0x9384('0x2e')],_0xd0082e['query']);_0x1b51e3['attributes']=_[_0x9384('0x2d')](_0xd0082e[_0x9384('0x2e')],qs[_0x9384('0x2f')](_0x3bf5db[_0x9384('0x2a')]['fields']));_0x1b51e3['attributes']=_0x1b51e3[_0x9384('0x30')]['length']?_0x1b51e3[_0x9384('0x30')]:_0xd0082e[_0x9384('0x2e')];if(!_0x3bf5db[_0x9384('0x2a')]['hasOwnProperty'](_0x9384('0x31'))){_0x1b51e3['limit']=qs['limit'](_0x3bf5db[_0x9384('0x2a')]['limit']);_0x1b51e3[_0x9384('0x19')]=qs[_0x9384('0x19')](_0x3bf5db['query'][_0x9384('0x19')]);}_0x1b51e3[_0x9384('0x32')]=qs[_0x9384('0x33')](_0x3bf5db['query'][_0x9384('0x33')]);_0x1b51e3['where']=qs[_0x9384('0x2c')](_['pick'](_0x3bf5db[_0x9384('0x2a')],_0xd0082e[_0x9384('0x2c')]),_0x427b06);if(_0x3bf5db[_0x9384('0x2a')][_0x9384('0x34')]){_0x1b51e3[_0x9384('0x35')]=_[_0x9384('0x36')](_0x1b51e3[_0x9384('0x35')],{'$or':_['map'](_0x427b06,function(_0x3cca74){if(_0x3cca74[_0x9384('0x37')]!==_0x9384('0x38')){var _0x4817db={};_0x4817db[_0x3cca74[_0x9384('0x24')]]={'$like':'%'+_0x3bf5db[_0x9384('0x2a')][_0x9384('0x34')]+'%'};return _0x4817db;}})});}_0x1b51e3=_[_0x9384('0x36')]({},_0x1b51e3,_0x3bf5db[_0x9384('0x39')]);var _0x55c139={'where':_0x1b51e3['where']};return db['UserProfileSection'][_0x9384('0x1c')](_0x55c139)[_0x9384('0x22')](function(_0x4a5910){_0x1592a5[_0x9384('0x1c')]=_0x4a5910;if(_0x3bf5db[_0x9384('0x2a')][_0x9384('0x3a')]){_0x1b51e3[_0x9384('0x3b')]=[{'all':!![]}];}return db[_0x9384('0x3c')][_0x9384('0x3d')](_0x1b51e3);})[_0x9384('0x22')](function(_0x6cae70){_0x1592a5['rows']=_0x6cae70;return _0x1592a5;})['then'](respondWithFilteredResult(_0x3930a8,_0x1b51e3))['catch'](handleError(_0x3930a8,null));};exports[_0x9384('0x3e')]=function(_0x4b5783,_0x3b6b81){var _0x267ec6={'raw':![],'where':{'id':_0x4b5783[_0x9384('0x3f')]['id']}},_0x1fd03c={};_0x1fd03c[_0x9384('0x2e')]=_[_0x9384('0x2b')](db['UserProfileSection'][_0x9384('0x28')]);_0x1fd03c['query']=_[_0x9384('0x2b')](_0x4b5783[_0x9384('0x2a')]);_0x1fd03c[_0x9384('0x2c')]=_['intersection'](_0x1fd03c[_0x9384('0x2e')],_0x1fd03c[_0x9384('0x2a')]);_0x267ec6[_0x9384('0x30')]=_[_0x9384('0x2d')](_0x1fd03c['model'],qs[_0x9384('0x2f')](_0x4b5783[_0x9384('0x2a')][_0x9384('0x2f')]));_0x267ec6['attributes']=_0x267ec6[_0x9384('0x30')][_0x9384('0x40')]?_0x267ec6['attributes']:_0x1fd03c['model'];if(_0x4b5783[_0x9384('0x2a')][_0x9384('0x3a')]){_0x267ec6[_0x9384('0x3b')]=[{'all':!![]}];}_0x267ec6=_[_0x9384('0x36')]({},_0x267ec6,_0x4b5783[_0x9384('0x39')]);return db[_0x9384('0x3c')]['find'](_0x267ec6)[_0x9384('0x22')](handleEntityNotFound(_0x3b6b81,null))[_0x9384('0x22')](respondWithResult(_0x3b6b81,null))[_0x9384('0x41')](handleError(_0x3b6b81,null));};exports[_0x9384('0x42')]=function(_0x2173ae,_0x1e5266){return db[_0x9384('0x3c')][_0x9384('0x42')](_0x2173ae[_0x9384('0x43')],{})[_0x9384('0x22')](respondWithResult(_0x1e5266,0xc9))[_0x9384('0x41')](handleError(_0x1e5266,null));};exports[_0x9384('0x44')]=function(_0x283d34,_0x4b66b5){if(_0x283d34[_0x9384('0x43')]['id']){delete _0x283d34[_0x9384('0x43')]['id'];}return db[_0x9384('0x3c')][_0x9384('0x45')]({'where':{'id':_0x283d34[_0x9384('0x3f')]['id']}})[_0x9384('0x22')](handleEntityNotFound(_0x4b66b5,null))[_0x9384('0x22')](saveUpdates(_0x283d34['body'],null))['then'](respondWithResult(_0x4b66b5,null))[_0x9384('0x41')](handleError(_0x4b66b5,null));};exports[_0x9384('0x23')]=function(_0x494ebe,_0x646bd9){return db['UserProfileSection']['find']({'where':{'id':_0x494ebe[_0x9384('0x3f')]['id']}})['then'](handleEntityNotFound(_0x646bd9,null))[_0x9384('0x22')](removeEntity(_0x646bd9,null))[_0x9384('0x41')](handleError(_0x646bd9,null));};exports[_0x9384('0x46')]=function(_0x46daac,_0x68004e){return db[_0x9384('0x3c')]['describe']()['then'](respondWithResult(_0x68004e,null))[_0x9384('0x41')](handleError(_0x68004e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 921fce9..ff372fe 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 _0x843f=['../../config/logger','api','moment','bluebird','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x843f,0x1b7));var _0xf843=function(_0x488679,_0x3fd9d8){_0x488679=_0x488679-0x0;var _0xff5217=_0x843f[_0x488679];return _0xff5217;};'use strict';var _=require('lodash');var util=require(_0xf843('0x0'));var logger=require(_0xf843('0x1'))(_0xf843('0x2'));var moment=require(_0xf843('0x3'));var BPromise=require(_0xf843('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(_0xf843('0x5'));module[_0xf843('0x6')]=function(_0x35f0f9,_0x50188a){return _0x35f0f9[_0xf843('0x7')](_0xf843('0x8'),attributes,{'tableName':_0xf843('0x9'),'paranoid':![],'indexes':[{'name':_0xf843('0xa'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xea66=['lodash','../../config/logger','bluebird','request-promise','path','./userProfileSection.attributes','exports','UserProfileSection','sectionId','userProfileId'];(function(_0xc66305,_0x1fdd9d){var _0x256dd7=function(_0x38b19d){while(--_0x38b19d){_0xc66305['push'](_0xc66305['shift']());}};_0x256dd7(++_0x1fdd9d);}(_0xea66,0x104));var _0x6ea6=function(_0x5442a5,_0x4110f1){_0x5442a5=_0x5442a5-0x0;var _0x130af0=_0xea66[_0x5442a5];return _0x130af0;};'use strict';var _=require(_0x6ea6('0x0'));var util=require('util');var logger=require(_0x6ea6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6ea6('0x2'));var rp=require(_0x6ea6('0x3'));var fs=require('fs');var path=require(_0x6ea6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ea6('0x5'));module[_0x6ea6('0x6')]=function(_0x4660a0,_0x3f8563){return _0x4660a0['define'](_0x6ea6('0x7'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x6ea6('0x8'),_0x6ea6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index f87003a..24fe052 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 _0x4577=['rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4577,0x117));var _0x7457=function(_0x254081,_0x20731a){_0x254081=_0x254081-0x0;var _0x5d1e2a=_0x4577[_0x254081];return _0x5d1e2a;};'use strict';var _=require(_0x7457('0x0'));var util=require('util');var moment=require(_0x7457('0x1'));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(_0x7457('0x6'))(_0x7457('0x7'));var config=require(_0x7457('0x8'));var jayson=require(_0x7457('0x9'));var client=jayson[_0x7457('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55e6e2,_0x114c3c,_0x1a9f03){return new BPromise(function(_0x5312e1,_0x68b19){return client['request'](_0x55e6e2,_0x1a9f03)[_0x7457('0xb')](function(_0x2f57df){logger[_0x7457('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x114c3c,_0x7457('0xd'));logger[_0x7457('0xe')](_0x7457('0xf'),_0x114c3c,_0x7457('0xd'),JSON[_0x7457('0x10')](_0x2f57df));if(_0x2f57df[_0x7457('0x11')]){if(_0x2f57df['error'][_0x7457('0x12')]===0x1f4){logger[_0x7457('0x11')](_0x7457('0x13'),_0x114c3c,_0x2f57df[_0x7457('0x11')][_0x7457('0x14')]);return _0x68b19(_0x2f57df[_0x7457('0x11')][_0x7457('0x14')]);}logger['error'](_0x7457('0x13'),_0x114c3c,_0x2f57df['error'][_0x7457('0x14')]);return _0x5312e1(_0x2f57df['error'][_0x7457('0x14')]);}else{logger[_0x7457('0xc')](_0x7457('0x13'),_0x114c3c,_0x7457('0xd'));_0x5312e1(_0x2f57df[_0x7457('0x15')][_0x7457('0x14')]);}})['catch'](function(_0x416b22){logger[_0x7457('0x11')](_0x7457('0x13'),_0x114c3c,_0x416b22);_0x68b19(_0x416b22);});});} \ No newline at end of file +var _0x9efe=['code','UserProfileSection,\x20%s,\x20%s','message','info','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c08e2,_0x5f1a22){var _0x8b8e60=function(_0xcac5dc){while(--_0xcac5dc){_0x2c08e2['push'](_0x2c08e2['shift']());}};_0x8b8e60(++_0x5f1a22);}(_0x9efe,0xca));var _0xe9ef=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x9efe[_0x1a5946];return _0x25e9d5;};'use strict';var _=require('lodash');var util=require(_0xe9ef('0x0'));var moment=require(_0xe9ef('0x1'));var BPromise=require(_0xe9ef('0x2'));var rs=require(_0xe9ef('0x3'));var fs=require('fs');var Redis=require(_0xe9ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9ef('0x5'));var logger=require(_0xe9ef('0x6'))(_0xe9ef('0x7'));var config=require(_0xe9ef('0x8'));var jayson=require(_0xe9ef('0x9'));var client=jayson[_0xe9ef('0xa')][_0xe9ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58d664,_0x47df46,_0x590cea){return new BPromise(function(_0x40ffdc,_0x2f7280){return client[_0xe9ef('0xc')](_0x58d664,_0x590cea)['then'](function(_0x51b634){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x47df46,_0xe9ef('0xd'));logger[_0xe9ef('0xe')](_0xe9ef('0xf'),_0x47df46,'request\x20sent',JSON[_0xe9ef('0x10')](_0x51b634));if(_0x51b634[_0xe9ef('0x11')]){if(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x12')]===0x1f4){logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x51b634['error'][_0xe9ef('0x14')]);return _0x2f7280(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x14')]);}logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x51b634['error'][_0xe9ef('0x14')]);return _0x40ffdc(_0x51b634[_0xe9ef('0x11')][_0xe9ef('0x14')]);}else{logger[_0xe9ef('0x15')](_0xe9ef('0x13'),_0x47df46,'request\x20sent');_0x40ffdc(_0x51b634['result'][_0xe9ef('0x14')]);}})['catch'](function(_0x8ed5e3){logger[_0xe9ef('0x11')](_0xe9ef('0x13'),_0x47df46,_0x8ed5e3);_0x2f7280(_0x8ed5e3);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 4ac897f..d4e9916 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x55c7dd,_0x5cf58b){var _0x46c3e5=function(_0xe48f5f){while(--_0xe48f5f){_0x55c7dd['push'](_0x55c7dd['shift']());}};_0x46c3e5(++_0x5cf58b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xcb91[_0x18f152];return _0xa10b34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3403b9,_0x51c920){var _0x4c9d81=function(_0x4a6f4f){while(--_0x4a6f4f){_0x3403b9['push'](_0x3403b9['shift']());}};_0x4c9d81(++_0x51c920);}(_0xe706,0xa3));var _0x6e70=function(_0x1d38fc,_0x27cd20){_0x1d38fc=_0x1d38fc-0x0;var _0x1a260c=_0xe706[_0x1d38fc];return _0x1a260c;};'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 4c74fc3..5f00580 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 _0xbdba=['INTEGER','sequelize'];(function(_0x10aebb,_0x2fd10a){var _0x1b1b8f=function(_0x1161be){while(--_0x1161be){_0x10aebb['push'](_0x10aebb['shift']());}};_0x1b1b8f(++_0x2fd10a);}(_0xbdba,0x107));var _0xabdb=function(_0x354288,_0xb1bb72){_0x354288=_0x354288-0x0;var _0x32bb86=_0xbdba[_0x354288];return _0x32bb86;};'use strict';var Sequelize=require(_0xabdb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xabdb('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c8d=['sequelize','exports','INTEGER'];(function(_0x2eedf6,_0x15b808){var _0x5a3be0=function(_0x16ac5e){while(--_0x16ac5e){_0x2eedf6['push'](_0x2eedf6['shift']());}};_0x5a3be0(++_0x15b808);}(_0x9c8d,0x177));var _0xd9c8=function(_0x3a1754,_0x6fb79a){_0x3a1754=_0x3a1754-0x0;var _0x503ddd=_0x9c8d[_0x3a1754];return _0x503ddd;};'use strict';var Sequelize=require(_0xd9c8('0x0'));module[_0xd9c8('0x1')]={'penalty':{'type':Sequelize[_0xd9c8('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 5445eee..cae65bd 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 _0x444e=['moment','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','../../config/logger'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x444e,0xe8));var _0xe444=function(_0x347dc9,_0x12bea0){_0x347dc9=_0x347dc9-0x0;var _0x5a0d51=_0x444e[_0x347dc9];return _0x5a0d51;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var logger=require(_0xe444('0x1'))('api');var moment=require(_0xe444('0x2'));var BPromise=require('bluebird');var rp=require(_0xe444('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe444('0x4'));var config=require(_0xe444('0x5'));var attributes=require(_0xe444('0x6'));module[_0xe444('0x7')]=function(_0x36ac3b,_0x1ddb27){return _0x36ac3b['define'](_0xe444('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5232=['user_has_sms_queues','lodash','util','../../config/logger','api','moment','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue'];(function(_0x27b651,_0x4ec097){var _0x409de1=function(_0x2c6435){while(--_0x2c6435){_0x27b651['push'](_0x27b651['shift']());}};_0x409de1(++_0x4ec097);}(_0x5232,0x1c9));var _0x2523=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x5232[_0x23c6f2];return _0x4c270b;};'use strict';var _=require(_0x2523('0x0'));var util=require(_0x2523('0x1'));var logger=require(_0x2523('0x2'))(_0x2523('0x3'));var moment=require(_0x2523('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2523('0x5'));var rimraf=require(_0x2523('0x6'));var config=require('../../config/environment');var attributes=require(_0x2523('0x7'));module[_0x2523('0x8')]=function(_0x1c3b74,_0x45ae69){return _0x1c3b74[_0x2523('0x9')](_0x2523('0xa'),attributes,{'tableName':_0x2523('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index dc87ad6..7209874 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 _0xda93=['client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a8f54,_0x1ad330){var _0x4c7d7b=function(_0xc32f28){while(--_0xc32f28){_0x4a8f54['push'](_0x4a8f54['shift']());}};_0x4c7d7b(++_0x1ad330);}(_0xda93,0x147));var _0x3da9=function(_0x591f1b,_0x530845){_0x591f1b=_0x591f1b-0x0;var _0x550ce9=_0xda93[_0x591f1b];return _0x550ce9;};'use strict';var _=require(_0x3da9('0x0'));var util=require(_0x3da9('0x1'));var moment=require(_0x3da9('0x2'));var BPromise=require('bluebird');var rs=require(_0x3da9('0x3'));var fs=require('fs');var Redis=require(_0x3da9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3da9('0x5'));var logger=require(_0x3da9('0x6'))(_0x3da9('0x7'));var config=require(_0x3da9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3da9('0x9')][_0x3da9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd6124c,_0x113902,_0x591022){return new BPromise(function(_0x642338,_0x93c16d){return client[_0x3da9('0xb')](_0xd6124c,_0x591022)[_0x3da9('0xc')](function(_0x93f89d){logger['info'](_0x3da9('0xd'),_0x113902,_0x3da9('0xe'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x113902,'request\x20sent',JSON['stringify'](_0x93f89d));if(_0x93f89d[_0x3da9('0xf')]){if(_0x93f89d['error'][_0x3da9('0x10')]===0x1f4){logger[_0x3da9('0xf')](_0x3da9('0xd'),_0x113902,_0x93f89d[_0x3da9('0xf')]['message']);return _0x93c16d(_0x93f89d[_0x3da9('0xf')][_0x3da9('0x11')]);}logger[_0x3da9('0xf')](_0x3da9('0xd'),_0x113902,_0x93f89d['error']['message']);return _0x642338(_0x93f89d[_0x3da9('0xf')][_0x3da9('0x11')]);}else{logger[_0x3da9('0x12')](_0x3da9('0xd'),_0x113902,_0x3da9('0xe'));_0x642338(_0x93f89d[_0x3da9('0x13')][_0x3da9('0x11')]);}})[_0x3da9('0x14')](function(_0xc484f2){logger[_0x3da9('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x113902,_0xc484f2);_0x93c16d(_0xc484f2);});});} \ No newline at end of file +var _0x9ed4=['debug','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x6019ad,_0x177ce3){var _0x327802=function(_0x214cce){while(--_0x214cce){_0x6019ad['push'](_0x6019ad['shift']());}};_0x327802(++_0x177ce3);}(_0x9ed4,0x1e3));var _0x49ed=function(_0x39f442,_0x5086eb){_0x39f442=_0x39f442-0x0;var _0x715722=_0x9ed4[_0x39f442];return _0x715722;};'use strict';var _=require('lodash');var util=require(_0x49ed('0x0'));var moment=require('moment');var BPromise=require(_0x49ed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49ed('0x2'));var db=require(_0x49ed('0x3'))['db'];var utils=require(_0x49ed('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x49ed('0x5'));var client=jayson['client'][_0x49ed('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x75bef,_0x4da07b,_0x8dd507){return new BPromise(function(_0x9324dc,_0x270497){return client[_0x49ed('0x7')](_0x75bef,_0x8dd507)[_0x49ed('0x8')](function(_0x6e5ff6){logger[_0x49ed('0x9')]('UserSmsQueue,\x20%s,\x20%s',_0x4da07b,_0x49ed('0xa'));logger[_0x49ed('0xb')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4da07b,_0x49ed('0xa'),JSON[_0x49ed('0xc')](_0x6e5ff6));if(_0x6e5ff6[_0x49ed('0xd')]){if(_0x6e5ff6['error'][_0x49ed('0xe')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x4da07b,_0x6e5ff6['error'][_0x49ed('0xf')]);return _0x270497(_0x6e5ff6[_0x49ed('0xd')][_0x49ed('0xf')]);}logger[_0x49ed('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4da07b,_0x6e5ff6[_0x49ed('0xd')][_0x49ed('0xf')]);return _0x9324dc(_0x6e5ff6[_0x49ed('0xd')][_0x49ed('0xf')]);}else{logger[_0x49ed('0x9')](_0x49ed('0x10'),_0x4da07b,_0x49ed('0xa'));_0x9324dc(_0x6e5ff6[_0x49ed('0x11')][_0x49ed('0xf')]);}})[_0x49ed('0x12')](function(_0x485343){logger[_0x49ed('0xd')](_0x49ed('0x10'),_0x4da07b,_0x485343);_0x270497(_0x485343);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 71fdb4e..885249e 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 _0x608f=['INTEGER','sequelize','exports'];(function(_0x20145c,_0x4d17de){var _0x102e18=function(_0x29089c){while(--_0x29089c){_0x20145c['push'](_0x20145c['shift']());}};_0x102e18(++_0x4d17de);}(_0x608f,0x8e));var _0xf608=function(_0x135d0a,_0x2cf6d9){_0x135d0a=_0x135d0a-0x0;var _0xcf4dd4=_0x608f[_0x135d0a];return _0xcf4dd4;};'use strict';var Sequelize=require(_0xf608('0x0'));module[_0xf608('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf608('0x2')]}}; \ No newline at end of file +var _0x7f57=['exports','INTEGER','sequelize'];(function(_0x1f459f,_0x21ac07){var _0x4a555b=function(_0x10a4ca){while(--_0x10a4ca){_0x1f459f['push'](_0x1f459f['shift']());}};_0x4a555b(++_0x21ac07);}(_0x7f57,0x194));var _0x77f5=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x7f57[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0x77f5('0x0'));module[_0x77f5('0x1')]={'UserId':{'type':Sequelize[_0x77f5('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e3a1f08..62a1b7e 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(_0x95b64c,_0x1b91fe){var _0x572d8e=function(_0x41ff0f){while(--_0x41ff0f){_0x95b64c['push'](_0x95b64c['shift']());}};_0x572d8e(++_0x1b91fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x3ca240,_0xe40810){var _0x28608=function(_0x4e57f7){while(--_0x4e57f7){_0x3ca240['push'](_0x3ca240['shift']());}};_0x28608(++_0xe40810);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 56740ec..30aa0bf 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1a96c7,_0x11dcd1){var _0x3c9af1=function(_0x48b6a6){while(--_0x48b6a6){_0x1a96c7['push'](_0x1a96c7['shift']());}};_0x3c9af1(++_0x11dcd1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0xcb91[_0x3b0912];return _0xa8f339;};'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(_0x855676,_0x130028){var _0xcbcac0=function(_0x5206a6){while(--_0x5206a6){_0x855676['push'](_0x855676['shift']());}};_0xcbcac0(++_0x130028);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ec89136..1e5e817 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 _0x5fa2=['exports','INTEGER','sequelize'];(function(_0x991a90,_0x3572ff){var _0x2bf73f=function(_0x18020b){while(--_0x18020b){_0x991a90['push'](_0x991a90['shift']());}};_0x2bf73f(++_0x3572ff);}(_0x5fa2,0x1b2));var _0x25fa=function(_0x4df614,_0x1884bc){_0x4df614=_0x4df614-0x0;var _0x54a721=_0x5fa2[_0x4df614];return _0x54a721;};'use strict';var Sequelize=require(_0x25fa('0x0'));module[_0x25fa('0x1')]={'penalty':{'type':Sequelize[_0x25fa('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9975=['sequelize','exports','INTEGER'];(function(_0x1e03a0,_0x2afce6){var _0xc2a522=function(_0x39bfaa){while(--_0x39bfaa){_0x1e03a0['push'](_0x1e03a0['shift']());}};_0xc2a522(++_0x2afce6);}(_0x9975,0xf6));var _0x5997=function(_0x28172c,_0x400e0c){_0x28172c=_0x28172c-0x0;var _0x54e6d8=_0x9975[_0x28172c];return _0x54e6d8;};'use strict';var Sequelize=require(_0x5997('0x0'));module[_0x5997('0x1')]={'penalty':{'type':Sequelize[_0x5997('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 638db37..4f58925 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 _0x2714=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x2714,0x7b));var _0x4271=function(_0x345419,_0x358faf){_0x345419=_0x345419-0x0;var _0x3a219d=_0x2714[_0x345419];return _0x3a219d;};'use strict';var _=require(_0x4271('0x0'));var util=require(_0x4271('0x1'));var logger=require(_0x4271('0x2'))(_0x4271('0x3'));var moment=require(_0x4271('0x4'));var BPromise=require(_0x4271('0x5'));var rp=require(_0x4271('0x6'));var fs=require('fs');var path=require(_0x4271('0x7'));var rimraf=require(_0x4271('0x8'));var config=require(_0x4271('0x9'));var attributes=require(_0x4271('0xa'));module[_0x4271('0xb')]=function(_0x44b81d,_0x5b02ba){return _0x44b81d[_0x4271('0xc')](_0x4271('0xd'),attributes,{'tableName':_0x4271('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e0=['request-promise','path','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb4e0,0x1a8));var _0x0b4e=function(_0x646208,_0x1c3a8e){_0x646208=_0x646208-0x0;var _0x39c7aa=_0xb4e0[_0x646208];return _0x39c7aa;};'use strict';var _=require(_0x0b4e('0x0'));var util=require('util');var logger=require(_0x0b4e('0x1'))(_0x0b4e('0x2'));var moment=require(_0x0b4e('0x3'));var BPromise=require(_0x0b4e('0x4'));var rp=require(_0x0b4e('0x5'));var fs=require('fs');var path=require(_0x0b4e('0x6'));var rimraf=require('rimraf');var config=require(_0x0b4e('0x7'));var attributes=require(_0x0b4e('0x8'));module['exports']=function(_0x4ef8c9,_0x364f2f){return _0x4ef8c9[_0x0b4e('0x9')](_0x0b4e('0xa'),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 13db42a..b08cf90 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 _0x1169=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x253201,_0x55488a){var _0x4a479a=function(_0x219cda){while(--_0x219cda){_0x253201['push'](_0x253201['shift']());}};_0x4a479a(++_0x55488a);}(_0x1169,0x13c));var _0x9116=function(_0x24b468,_0x2d1d4f){_0x24b468=_0x24b468-0x0;var _0x50da26=_0x1169[_0x24b468];return _0x50da26;};'use strict';var _=require(_0x9116('0x0'));var util=require(_0x9116('0x1'));var moment=require('moment');var BPromise=require(_0x9116('0x2'));var rs=require(_0x9116('0x3'));var fs=require('fs');var Redis=require(_0x9116('0x4'));var db=require(_0x9116('0x5'))['db'];var utils=require(_0x9116('0x6'));var logger=require(_0x9116('0x7'))(_0x9116('0x8'));var config=require(_0x9116('0x9'));var jayson=require(_0x9116('0xa'));var client=jayson['client'][_0x9116('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x510ba4,_0x646db8,_0x1c0357){return new BPromise(function(_0x4e6bb9,_0x4b42f1){return client[_0x9116('0xc')](_0x510ba4,_0x1c0357)['then'](function(_0x4ebd34){logger[_0x9116('0xd')](_0x9116('0xe'),_0x646db8,'request\x20sent');logger[_0x9116('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x646db8,_0x9116('0x10'),JSON[_0x9116('0x11')](_0x4ebd34));if(_0x4ebd34[_0x9116('0x12')]){if(_0x4ebd34[_0x9116('0x12')][_0x9116('0x13')]===0x1f4){logger[_0x9116('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x646db8,_0x4ebd34['error'][_0x9116('0x14')]);return _0x4b42f1(_0x4ebd34[_0x9116('0x12')][_0x9116('0x14')]);}logger[_0x9116('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x646db8,_0x4ebd34['error'][_0x9116('0x14')]);return _0x4e6bb9(_0x4ebd34['error'][_0x9116('0x14')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x646db8,_0x9116('0x10'));_0x4e6bb9(_0x4ebd34[_0x9116('0x15')][_0x9116('0x14')]);}})[_0x9116('0x16')](function(_0x27d8b1){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x646db8,_0x27d8b1);_0x4b42f1(_0x27d8b1);});});} \ No newline at end of file +var _0x5706=['info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x296b44,_0x462e92){var _0x3517bd=function(_0x59d2eb){while(--_0x59d2eb){_0x296b44['push'](_0x296b44['shift']());}};_0x3517bd(++_0x462e92);}(_0x5706,0xf9));var _0x6570=function(_0x27b829,_0x335538){_0x27b829=_0x27b829-0x0;var _0x229d6c=_0x5706[_0x27b829];return _0x229d6c;};'use strict';var _=require(_0x6570('0x0'));var util=require(_0x6570('0x1'));var moment=require(_0x6570('0x2'));var BPromise=require(_0x6570('0x3'));var rs=require(_0x6570('0x4'));var fs=require('fs');var Redis=require(_0x6570('0x5'));var db=require(_0x6570('0x6'))['db'];var utils=require(_0x6570('0x7'));var logger=require(_0x6570('0x8'))(_0x6570('0x9'));var config=require(_0x6570('0xa'));var jayson=require(_0x6570('0xb'));var client=jayson[_0x6570('0xc')][_0x6570('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a1113,_0x4bea0b,_0x1c1258){return new BPromise(function(_0x26f629,_0x59d964){return client['request'](_0x1a1113,_0x1c1258)[_0x6570('0xe')](function(_0x32ef7b){logger[_0x6570('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4bea0b,_0x6570('0x10'));logger[_0x6570('0x11')](_0x6570('0x12'),_0x4bea0b,'request\x20sent',JSON[_0x6570('0x13')](_0x32ef7b));if(_0x32ef7b[_0x6570('0x14')]){if(_0x32ef7b[_0x6570('0x14')][_0x6570('0x15')]===0x1f4){logger[_0x6570('0x14')](_0x6570('0x16'),_0x4bea0b,_0x32ef7b[_0x6570('0x14')][_0x6570('0x17')]);return _0x59d964(_0x32ef7b[_0x6570('0x14')]['message']);}logger[_0x6570('0x14')](_0x6570('0x16'),_0x4bea0b,_0x32ef7b[_0x6570('0x14')]['message']);return _0x26f629(_0x32ef7b[_0x6570('0x14')][_0x6570('0x17')]);}else{logger[_0x6570('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x4bea0b,_0x6570('0x10'));_0x26f629(_0x32ef7b['result']['message']);}})['catch'](function(_0x3076b3){logger[_0x6570('0x14')](_0x6570('0x16'),_0x4bea0b,_0x3076b3);_0x59d964(_0x3076b3);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a8a6087..259a1b8 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f4932,_0x45c9e2){var _0xe5c26d=function(_0x398fb1){while(--_0x398fb1){_0x1f4932['push'](_0x1f4932['shift']());}};_0xe5c26d(++_0x45c9e2);}(_0xe706,0xa3));var _0x6e70=function(_0x34a087,_0x4bd68e){_0x34a087=_0x34a087-0x0;var _0x5c15d7=_0xe706[_0x34a087];return _0x5c15d7;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x28006e,_0xe7108f){var _0x34dc6e=function(_0x4bccb3){while(--_0x4bccb3){_0x28006e['push'](_0x28006e['shift']());}};_0x34dc6e(++_0xe7108f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 5bb0939..66ed519 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 _0x223c=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x5e386a,_0x2f4b0a){var _0x4b6760=function(_0x57528b){while(--_0x57528b){_0x5e386a['push'](_0x5e386a['shift']());}};_0x4b6760(++_0x2f4b0a);}(_0x223c,0x1c9));var _0xc223=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x223c[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xc223('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc223('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc223('0x2')},'membername':{'type':Sequelize[_0xc223('0x3')],'allowNull':![],'comment':_0xc223('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc223('0x3')],'allowNull':![],'unique':_0xc223('0x4'),'comment':_0xc223('0x2')},'VoiceQueueId':{'type':Sequelize[_0xc223('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xc223('0x3')],'allowNull':![],'unique':_0xc223('0x4'),'comment':_0xc223('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xc223('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xc223('0x2')}}; \ No newline at end of file +var _0x3372=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x41bc3c,_0x576154){var _0xab142c=function(_0x270afa){while(--_0x270afa){_0x41bc3c['push'](_0x41bc3c['shift']());}};_0xab142c(++_0x576154);}(_0x3372,0x125));var _0x2337=function(_0x517067,_0xbf6fd4){_0x517067=_0x517067-0x0;var _0x18017e=_0x3372[_0x517067];return _0x18017e;};'use strict';var Sequelize=require(_0x2337('0x0'));module[_0x2337('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2337('0x2')},'membername':{'type':Sequelize[_0x2337('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x2337('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2337('0x5'),'comment':_0x2337('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2337('0x5'),'comment':_0x2337('0x2')},'penalty':{'type':Sequelize[_0x2337('0x4')](0xb),'defaultValue':0x0,'comment':_0x2337('0x2')},'paused':{'type':Sequelize[_0x2337('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index e51fecb..39473ca 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 _0x1735=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x358927,_0x1eee11){var _0x4d5873=function(_0x46cc25){while(--_0x46cc25){_0x358927['push'](_0x358927['shift']());}};_0x4d5873(++_0x1eee11);}(_0x1735,0x114));var _0x5173=function(_0x5bd9e5,_0x2980ec){_0x5bd9e5=_0x5bd9e5-0x0;var _0x2a87c7=_0x1735[_0x5bd9e5];return _0x2a87c7;};'use strict';var EventEmitter=require(_0x5173('0x0'));var UserVoiceQueueRt=require(_0x5173('0x1'))['db'][_0x5173('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5173('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5173('0x4'),'afterDestroy':_0x5173('0x5')};function emitEvent(_0x5d6d9b){return function(_0x1cf1d8,_0x5b0ef3,_0x226e38){UserVoiceQueueRtEvents[_0x5173('0x6')](_0x5d6d9b+':'+_0x1cf1d8['id'],_0x1cf1d8);UserVoiceQueueRtEvents[_0x5173('0x6')](_0x5d6d9b,_0x1cf1d8);_0x226e38(null);};}for(var e in events){if(events[_0x5173('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x5173('0x8')](e,emitEvent(event));}}module[_0x5173('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xde33=['save','update','remove','emit','hook','exports','events','UserVoiceQueueRt'];(function(_0x130f50,_0x1e2083){var _0x49fbae=function(_0x2259af){while(--_0x2259af){_0x130f50['push'](_0x130f50['shift']());}};_0x49fbae(++_0x1e2083);}(_0xde33,0x86));var _0x3de3=function(_0x187391,_0x52ea16){_0x187391=_0x187391-0x0;var _0x2c2598=_0xde33[_0x187391];return _0x2c2598;};'use strict';var EventEmitter=require(_0x3de3('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x3de3('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3de3('0x2'),'afterUpdate':_0x3de3('0x3'),'afterDestroy':_0x3de3('0x4')};function emitEvent(_0x56a7bd){return function(_0x10d121,_0x3aff89,_0x1f1eb4){UserVoiceQueueRtEvents[_0x3de3('0x5')](_0x56a7bd+':'+_0x10d121['id'],_0x10d121);UserVoiceQueueRtEvents[_0x3de3('0x5')](_0x56a7bd,_0x10d121);_0x1f1eb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3de3('0x6')](e,emitEvent(event));}}module[_0x3de3('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index bb457c8..36f357d 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 _0x4161=['../../config/logger','api','moment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x4161,0x17f));var _0x1416=function(_0x5f2207,_0x21eea2){_0x5f2207=_0x5f2207-0x0;var _0x337b08=_0x4161[_0x5f2207];return _0x337b08;};'use strict';var _=require(_0x1416('0x0'));var util=require('util');var logger=require(_0x1416('0x1'))(_0x1416('0x2'));var moment=require(_0x1416('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('../../config/environment');var attributes=require(_0x1416('0x4'));module[_0x1416('0x5')]=function(_0x34d325,_0x3c33bc){return _0x34d325[_0x1416('0x6')](_0x1416('0x7'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6dd=['moment','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0xc6dd,0xa4));var _0xdc6d=function(_0x45a2a5,_0x54996e){_0x45a2a5=_0x45a2a5-0x0;var _0x34f4f6=_0xc6dd[_0x45a2a5];return _0x34f4f6;};'use strict';var _=require(_0xdc6d('0x0'));var util=require(_0xdc6d('0x1'));var logger=require(_0xdc6d('0x2'))(_0xdc6d('0x3'));var moment=require(_0xdc6d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc6d('0x5'));var rimraf=require(_0xdc6d('0x6'));var config=require(_0xdc6d('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xdc6d('0x8')]=function(_0x2c3df3,_0x44e4d4){return _0x2c3df3[_0xdc6d('0x9')](_0xdc6d('0xa'),attributes,{'tableName':_0xdc6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 0e4292d..d7ef814 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 _0x1669=['code','message','info','result','catch','GetVoiceQueueRtPauses','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0x1669,0x73));var _0x9166=function(_0x3a60a1,_0x525e92){_0x3a60a1=_0x3a60a1-0x0;var _0x492eef=_0x1669[_0x3a60a1];return _0x492eef;};'use strict';var _=require(_0x9166('0x0'));var util=require(_0x9166('0x1'));var moment=require(_0x9166('0x2'));var BPromise=require('bluebird');var rs=require(_0x9166('0x3'));var fs=require('fs');var Redis=require(_0x9166('0x4'));var db=require(_0x9166('0x5'))['db'];var utils=require(_0x9166('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9166('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9166('0x8')][_0x9166('0x9')]({'port':0x232a});config[_0x9166('0xa')]=_[_0x9166('0xb')](config[_0x9166('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9166('0xc'))(new Redis(config[_0x9166('0xa')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x501a51,_0x32fdfb,_0x13f18e){return new BPromise(function(_0x53bd77,_0x3235e9){return client[_0x9166('0xd')](_0x501a51,_0x13f18e)[_0x9166('0xe')](function(_0x14e2be){logger['info'](_0x9166('0xf'),_0x32fdfb,_0x9166('0x10'));logger[_0x9166('0x11')](_0x9166('0x12'),_0x32fdfb,'request\x20sent',JSON[_0x9166('0x13')](_0x14e2be));if(_0x14e2be[_0x9166('0x14')]){if(_0x14e2be[_0x9166('0x14')][_0x9166('0x15')]===0x1f4){logger['error'](_0x9166('0xf'),_0x32fdfb,_0x14e2be['error'][_0x9166('0x16')]);return _0x3235e9(_0x14e2be[_0x9166('0x14')][_0x9166('0x16')]);}logger[_0x9166('0x14')](_0x9166('0xf'),_0x32fdfb,_0x14e2be[_0x9166('0x14')][_0x9166('0x16')]);return _0x53bd77(_0x14e2be[_0x9166('0x14')]['message']);}else{logger[_0x9166('0x17')](_0x9166('0xf'),_0x32fdfb,_0x9166('0x10'));_0x53bd77(_0x14e2be[_0x9166('0x18')][_0x9166('0x16')]);}})[_0x9166('0x19')](function(_0x305fa4){logger[_0x9166('0x14')](_0x9166('0xf'),_0x32fdfb,_0x305fa4);_0x3235e9(_0x305fa4);});});}exports[_0x9166('0x1a')]=function(_0x59d73d){var _0x4f453a=this;return new Promise(function(_0x54409c,_0x54777d){return db['UserVoiceQueueRt']['findAll']({'raw':_0x59d73d['options']?_0x59d73d[_0x9166('0x1b')][_0x9166('0x1c')]===undefined?!![]:![]:!![],'where':_0x59d73d[_0x9166('0x1b')]?_0x59d73d[_0x9166('0x1b')][_0x9166('0x1d')]||null:null,'attributes':[[db[_0x9166('0x1e')]['fn'](_0x9166('0x1f'),db[_0x9166('0x1e')]['fn']('IF',db[_0x9166('0x1e')]['literal'](_0x9166('0x20')))),_0x9166('0x21')]]})[_0x9166('0xe')](function(_0x19be70){logger[_0x9166('0x17')]('GetVoiceQueueRtPauses',_0x59d73d);logger['debug'](_0x9166('0x1a'),_0x59d73d,JSON[_0x9166('0x13')](_0x19be70));_0x54409c(_0x19be70);})[_0x9166('0x19')](function(_0x5ed97a){logger[_0x9166('0x14')](_0x9166('0x1a'),_0x5ed97a['message'],_0x59d73d);_0x54777d(_0x4f453a[_0x9166('0x14')](0x1f4,_0x5ed97a[_0x9166('0x16')]));});});}; \ No newline at end of file +var _0x6279=['./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6279,0x8a));var _0x9627=function(_0x37858a,_0x3b523f){_0x37858a=_0x37858a-0x0;var _0x1ff350=_0x6279[_0x37858a];return _0x1ff350;};'use strict';var _=require(_0x9627('0x0'));var util=require(_0x9627('0x1'));var moment=require(_0x9627('0x2'));var BPromise=require(_0x9627('0x3'));var rs=require(_0x9627('0x4'));var fs=require('fs');var Redis=require(_0x9627('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9627('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9627('0x7'));var jayson=require(_0x9627('0x8'));var client=jayson['client'][_0x9627('0x9')]({'port':0x232a});config['redis']=_[_0x9627('0xa')](config[_0x9627('0xb')],{'host':_0x9627('0xc'),'port':0x18eb});var socket=require(_0x9627('0xd'))(new Redis(config['redis']));require(_0x9627('0xe'))[_0x9627('0xf')](socket);function respondWithRpcPromise(_0x39a242,_0x2c8f2a,_0x12e737){return new BPromise(function(_0x2c89e6,_0x25d729){return client[_0x9627('0x10')](_0x39a242,_0x12e737)[_0x9627('0x11')](function(_0x53ba09){logger[_0x9627('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c8f2a,_0x9627('0x13'));logger['debug'](_0x9627('0x14'),_0x2c8f2a,_0x9627('0x13'),JSON[_0x9627('0x15')](_0x53ba09));if(_0x53ba09[_0x9627('0x16')]){if(_0x53ba09[_0x9627('0x16')]['code']===0x1f4){logger[_0x9627('0x16')](_0x9627('0x17'),_0x2c8f2a,_0x53ba09[_0x9627('0x16')][_0x9627('0x18')]);return _0x25d729(_0x53ba09[_0x9627('0x16')][_0x9627('0x18')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c8f2a,_0x53ba09['error'][_0x9627('0x18')]);return _0x2c89e6(_0x53ba09[_0x9627('0x16')][_0x9627('0x18')]);}else{logger[_0x9627('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2c8f2a,_0x9627('0x13'));_0x2c89e6(_0x53ba09[_0x9627('0x19')]['message']);}})[_0x9627('0x1a')](function(_0x30aeee){logger[_0x9627('0x16')](_0x9627('0x17'),_0x2c8f2a,_0x30aeee);_0x25d729(_0x30aeee);});});}exports['GetVoiceQueueRtPauses']=function(_0x5b77d5){var _0x36e28c=this;return new Promise(function(_0x43881e,_0x2e5312){return db['UserVoiceQueueRt'][_0x9627('0x1b')]({'raw':_0x5b77d5[_0x9627('0x1c')]?_0x5b77d5['options'][_0x9627('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b77d5['options']?_0x5b77d5[_0x9627('0x1c')][_0x9627('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9627('0x1f'),db[_0x9627('0x20')]['fn']('IF',db[_0x9627('0x20')][_0x9627('0x21')](_0x9627('0x22')))),_0x9627('0x23')]]})[_0x9627('0x11')](function(_0x203fc8){logger[_0x9627('0x12')](_0x9627('0x24'),_0x5b77d5);logger[_0x9627('0x25')](_0x9627('0x24'),_0x5b77d5,JSON[_0x9627('0x15')](_0x203fc8));_0x43881e(_0x203fc8);})[_0x9627('0x1a')](function(_0x3be22d){logger['error'](_0x9627('0x24'),_0x3be22d[_0x9627('0x18')],_0x5b77d5);_0x2e5312(_0x36e28c['error'](0x1f4,_0x3be22d[_0x9627('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7fcaf93..f2804cb 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 _0xd2bb=['save','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x33cbfe,_0x1d046f){var _0x2af792=function(_0x41771d){while(--_0x41771d){_0x33cbfe['push'](_0x33cbfe['shift']());}};_0x2af792(++_0x1d046f);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x1797ce,_0x490039){_0x1797ce=_0x1797ce-0x0;var _0x3a6e20=_0xd2bb[_0x1797ce];return _0x3a6e20;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xbd2b('0x0'),'remove',_0xbd2b('0x1')];function createListener(_0x1b0c46,_0x29f98f){return function(_0x334128){_0x29f98f[_0xbd2b('0x2')](_0x1b0c46,_0x334128);};}function removeListener(_0x3c67c1,_0x5c41c7){return function(){UserVoiceQueueRtEvents[_0xbd2b('0x3')](_0x3c67c1,_0x5c41c7);};}exports[_0xbd2b('0x4')]=function(_0xdcd8bd){for(var _0x2f64a8=0x0,_0x296d68=events[_0xbd2b('0x5')];_0x2f64a8<_0x296d68;_0x2f64a8++){var _0x42fee1=events[_0x2f64a8];var _0x30cd3f=createListener(_0xbd2b('0x6')+_0x42fee1,_0xdcd8bd);UserVoiceQueueRtEvents['on'](_0x42fee1,_0x30cd3f);}}; \ No newline at end of file +var _0x8ca9=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','register'];(function(_0x586f16,_0x2d8027){var _0x4e0cb0=function(_0xe1a9f){while(--_0xe1a9f){_0x586f16['push'](_0x586f16['shift']());}};_0x4e0cb0(++_0x2d8027);}(_0x8ca9,0x9c));var _0x98ca=function(_0x3f2cdb,_0x123c97){_0x3f2cdb=_0x3f2cdb-0x0;var _0xe804ee=_0x8ca9[_0x3f2cdb];return _0xe804ee;};'use strict';var UserVoiceQueueRtEvents=require(_0x98ca('0x0'));var events=[_0x98ca('0x1'),_0x98ca('0x2'),_0x98ca('0x3')];function createListener(_0x3d9153,_0x22047f){return function(_0xe479d6){_0x22047f['emit'](_0x3d9153,_0xe479d6);};}function removeListener(_0x4c230f,_0x142793){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4c230f,_0x142793);};}exports[_0x98ca('0x4')]=function(_0x48415d){for(var _0x219619=0x0,_0xca4097=events[_0x98ca('0x5')];_0x219619<_0xca4097;_0x219619++){var _0x2852a0=events[_0x219619];var _0x323c95=createListener(_0x98ca('0x6')+_0x2852a0,_0x48415d);UserVoiceQueueRtEvents['on'](_0x2852a0,_0x323c95);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index fd54e2c..4b829dd 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x173dd9,_0x4ecf44){var _0x5a0d5a=function(_0x4d731a){while(--_0x4d731a){_0x173dd9['push'](_0x173dd9['shift']());}};_0x5a0d5a(++_0x4ecf44);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x37d239,_0x9890dc){var _0x219891=function(_0xff7ebb){while(--_0xff7ebb){_0x37d239['push'](_0x37d239['shift']());}};_0x219891(++_0x9890dc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 1097778..b3f6994 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 _0x27a5=['sequelize','exports','INTEGER'];(function(_0x4588be,_0x462196){var _0xbaaafb=function(_0x28b79d){while(--_0x28b79d){_0x4588be['push'](_0x4588be['shift']());}};_0xbaaafb(++_0x462196);}(_0x27a5,0x66));var _0x527a=function(_0x1f5139,_0x4e442e){_0x1f5139=_0x1f5139-0x0;var _0x2d6c53=_0x27a5[_0x1f5139];return _0x2d6c53;};'use strict';var Sequelize=require(_0x527a('0x0'));module[_0x527a('0x1')]={'penalty':{'type':Sequelize[_0x527a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3b56=['exports','sequelize'];(function(_0x531584,_0x1487ae){var _0x24783b=function(_0x2feb93){while(--_0x2feb93){_0x531584['push'](_0x531584['shift']());}};_0x24783b(++_0x1487ae);}(_0x3b56,0x97));var _0x63b5=function(_0x2478a0,_0x597611){_0x2478a0=_0x2478a0-0x0;var _0x3135e3=_0x3b56[_0x2478a0];return _0x3135e3;};'use strict';var Sequelize=require(_0x63b5('0x0'));module[_0x63b5('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 d4b1ce0..8fdbda9 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 _0xc0e9=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xc0e9,0x78));var _0x9c0e=function(_0x38c8be,_0x587707){_0x38c8be=_0x38c8be-0x0;var _0x3d6e33=_0xc0e9[_0x38c8be];return _0x3d6e33;};'use strict';var _=require(_0x9c0e('0x0'));var util=require('util');var logger=require(_0x9c0e('0x1'))(_0x9c0e('0x2'));var moment=require(_0x9c0e('0x3'));var BPromise=require(_0x9c0e('0x4'));var rp=require(_0x9c0e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c0e('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c0e('0x7'));module[_0x9c0e('0x8')]=function(_0x50501b,_0x5cc637){return _0x50501b['define'](_0x9c0e('0x9'),attributes,{'tableName':_0x9c0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe6d=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','user_has_whatsapp_queues','../../config/logger','api','bluebird','path'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xbe6d,0x1b5));var _0xdbe6=function(_0x38f02e,_0xe73a0d){_0x38f02e=_0x38f02e-0x0;var _0x206435=_0xbe6d[_0x38f02e];return _0x206435;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdbe6('0x0'))(_0xdbe6('0x1'));var moment=require('moment');var BPromise=require(_0xdbe6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbe6('0x3'));var rimraf=require(_0xdbe6('0x4'));var config=require(_0xdbe6('0x5'));var attributes=require(_0xdbe6('0x6'));module[_0xdbe6('0x7')]=function(_0x172167,_0x57bab2){return _0x172167['define']('UserWhatsappQueue',attributes,{'tableName':_0xdbe6('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 8c30614..5073a73 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 _0xb92b=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','util'];(function(_0x23285f,_0x5529ce){var _0x1a5a34=function(_0x57cd52){while(--_0x57cd52){_0x23285f['push'](_0x23285f['shift']());}};_0x1a5a34(++_0x5529ce);}(_0xb92b,0x14f));var _0xbb92=function(_0x1ae648,_0x470395){_0x1ae648=_0x1ae648-0x0;var _0x560698=_0xb92b[_0x1ae648];return _0x560698;};'use strict';var _=require('lodash');var util=require(_0xbb92('0x0'));var moment=require(_0xbb92('0x1'));var BPromise=require(_0xbb92('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb92('0x3'))['db'];var utils=require(_0xbb92('0x4'));var logger=require(_0xbb92('0x5'))(_0xbb92('0x6'));var config=require('../../config/environment');var jayson=require(_0xbb92('0x7'));var client=jayson[_0xbb92('0x8')][_0xbb92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x514334,_0x38dfc7,_0x34aa17){return new BPromise(function(_0x594298,_0x302b12){return client[_0xbb92('0xa')](_0x514334,_0x34aa17)[_0xbb92('0xb')](function(_0x4a12be){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x38dfc7,'request\x20sent');logger[_0xbb92('0xc')](_0xbb92('0xd'),_0x38dfc7,_0xbb92('0xe'),JSON[_0xbb92('0xf')](_0x4a12be));if(_0x4a12be[_0xbb92('0x10')]){if(_0x4a12be[_0xbb92('0x10')]['code']===0x1f4){logger[_0xbb92('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x38dfc7,_0x4a12be['error'][_0xbb92('0x11')]);return _0x302b12(_0x4a12be['error']['message']);}logger[_0xbb92('0x10')](_0xbb92('0x12'),_0x38dfc7,_0x4a12be[_0xbb92('0x10')][_0xbb92('0x11')]);return _0x594298(_0x4a12be[_0xbb92('0x10')][_0xbb92('0x11')]);}else{logger['info'](_0xbb92('0x12'),_0x38dfc7,'request\x20sent');_0x594298(_0x4a12be[_0xbb92('0x13')][_0xbb92('0x11')]);}})[_0xbb92('0x14')](function(_0x40e08e){logger[_0xbb92('0x10')](_0xbb92('0x12'),_0x38dfc7,_0x40e08e);_0x302b12(_0x40e08e);});});} \ No newline at end of file +var _0x4ddb=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','info'];(function(_0x25ede0,_0x29dc39){var _0x16fc37=function(_0x13e4d1){while(--_0x13e4d1){_0x25ede0['push'](_0x25ede0['shift']());}};_0x16fc37(++_0x29dc39);}(_0x4ddb,0x1ef));var _0xb4dd=function(_0x7f677f,_0x5f2c1c){_0x7f677f=_0x7f677f-0x0;var _0x5acea1=_0x4ddb[_0x7f677f];return _0x5acea1;};'use strict';var _=require(_0xb4dd('0x0'));var util=require(_0xb4dd('0x1'));var moment=require('moment');var BPromise=require(_0xb4dd('0x2'));var rs=require(_0xb4dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4dd('0x5'))(_0xb4dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xb4dd('0x7'));var client=jayson[_0xb4dd('0x8')][_0xb4dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x89cdf1,_0x4f4631,_0xb23a6d){return new BPromise(function(_0x33e53b,_0x5d4b1d){return client[_0xb4dd('0xa')](_0x89cdf1,_0xb23a6d)['then'](function(_0x1d1b38){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x4f4631,'request\x20sent');logger['debug'](_0xb4dd('0xb'),_0x4f4631,_0xb4dd('0xc'),JSON[_0xb4dd('0xd')](_0x1d1b38));if(_0x1d1b38[_0xb4dd('0xe')]){if(_0x1d1b38['error']['code']===0x1f4){logger['error'](_0xb4dd('0xf'),_0x4f4631,_0x1d1b38[_0xb4dd('0xe')][_0xb4dd('0x10')]);return _0x5d4b1d(_0x1d1b38[_0xb4dd('0xe')][_0xb4dd('0x10')]);}logger['error'](_0xb4dd('0xf'),_0x4f4631,_0x1d1b38[_0xb4dd('0xe')]['message']);return _0x33e53b(_0x1d1b38[_0xb4dd('0xe')][_0xb4dd('0x10')]);}else{logger[_0xb4dd('0x11')](_0xb4dd('0xf'),_0x4f4631,'request\x20sent');_0x33e53b(_0x1d1b38['result'][_0xb4dd('0x10')]);}})[_0xb4dd('0x12')](function(_0x55f38e){logger[_0xb4dd('0xe')](_0xb4dd('0xf'),_0x4f4631,_0x55f38e);_0x5d4b1d(_0x55f38e);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 65321d9..f1c3023 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 _0x96a2=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x1d38fc,_0x27cd20){var _0x1a260c=function(_0x3f31ab){while(--_0x3f31ab){_0x1d38fc['push'](_0x1d38fc['shift']());}};_0x1a260c(++_0x27cd20);}(_0x96a2,0x96));var _0x296a=function(_0x44ee92,_0x5ee2dd){_0x44ee92=_0x44ee92-0x0;var _0x1a6e0e=_0x96a2[_0x44ee92];return _0x1a6e0e;};'use strict';var multer=require(_0x296a('0x0'));var util=require('util');var path=require(_0x296a('0x1'));var timeout=require(_0x296a('0x2'));var express=require(_0x296a('0x3'));var router=express[_0x296a('0x4')]();var fs_extra=require(_0x296a('0x5'));var auth=require(_0x296a('0x6'));var interaction=require(_0x296a('0x7'));var config=require(_0x296a('0x8'));var controller=require(_0x296a('0x9'));router[_0x296a('0xa')]('/',auth[_0x296a('0xb')](),controller[_0x296a('0xc')]);router[_0x296a('0xa')](_0x296a('0xd'),auth[_0x296a('0xb')](),controller[_0x296a('0xe')]);router[_0x296a('0xf')]('/',auth[_0x296a('0xb')](),controller['create']);router[_0x296a('0x10')](_0x296a('0xd'),auth['isAuthenticated'](),controller[_0x296a('0x11')]);router[_0x296a('0x12')](_0x296a('0xd'),auth[_0x296a('0xb')](),controller[_0x296a('0x13')]);module[_0x296a('0x14')]=router; \ No newline at end of file +var _0x9305=['show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index'];(function(_0x4939c7,_0x3c3b68){var _0x293af6=function(_0x44329d){while(--_0x44329d){_0x4939c7['push'](_0x4939c7['shift']());}};_0x293af6(++_0x3c3b68);}(_0x9305,0x1e2));var _0x5930=function(_0x543217,_0x35f5af){_0x543217=_0x543217-0x0;var _0x1e39cb=_0x9305[_0x543217];return _0x1e39cb;};'use strict';var multer=require(_0x5930('0x0'));var util=require(_0x5930('0x1'));var path=require(_0x5930('0x2'));var timeout=require(_0x5930('0x3'));var express=require('express');var router=express[_0x5930('0x4')]();var fs_extra=require(_0x5930('0x5'));var auth=require(_0x5930('0x6'));var interaction=require(_0x5930('0x7'));var config=require('../../config/environment');var controller=require(_0x5930('0x8'));router[_0x5930('0x9')]('/',auth[_0x5930('0xa')](),controller[_0x5930('0xb')]);router['get']('/:id',auth[_0x5930('0xa')](),controller[_0x5930('0xc')]);router[_0x5930('0xd')]('/',auth['isAuthenticated'](),controller[_0x5930('0xe')]);router['put'](_0x5930('0xf'),auth['isAuthenticated'](),controller[_0x5930('0x10')]);router[_0x5930('0x11')]('/:id',auth[_0x5930('0xa')](),controller[_0x5930('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 744297d..54d96ea 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 _0x60d1=['STRING','name','sequelize'];(function(_0x17b078,_0x1bc6a5){var _0x39f3ce=function(_0x33e280){while(--_0x33e280){_0x17b078['push'](_0x17b078['shift']());}};_0x39f3ce(++_0x1bc6a5);}(_0x60d1,0x74));var _0x160d=function(_0x50a4e4,_0x47d800){_0x50a4e4=_0x50a4e4-0x0;var _0x186e96=_0x60d1[_0x50a4e4];return _0x186e96;};'use strict';var Sequelize=require(_0x160d('0x0'));module['exports']={'name':{'type':Sequelize[_0x160d('0x1')],'unique':_0x160d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6439=['sequelize','name','STRING'];(function(_0x49b138,_0x5e3024){var _0x2f7678=function(_0x504711){while(--_0x504711){_0x49b138['push'](_0x49b138['shift']());}};_0x2f7678(++_0x5e3024);}(_0x6439,0x1ce));var _0x9643=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x6439[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x9643('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9643('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9643('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 44a85ce..b2cdd66 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 _0xf608=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','send','index','map','Variable','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','autoAssociation','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x45a15b,_0x66e99d){var _0x1d46c9=function(_0x116f0d){while(--_0x116f0d){_0x45a15b['push'](_0x45a15b['shift']());}};_0x1d46c9(++_0x66e99d);}(_0xf608,0x1be));var _0x8f60=function(_0x5b57ae,_0x31bac6){_0x5b57ae=_0x5b57ae-0x0;var _0x1877c2=_0xf608[_0x5b57ae];return _0x1877c2;};'use strict';var emlformat=require(_0x8f60('0x0'));var rimraf=require(_0x8f60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f60('0x2'));var rp=require(_0x8f60('0x3'));var moment=require(_0x8f60('0x4'));var BPromise=require(_0x8f60('0x5'));var Mustache=require(_0x8f60('0x6'));var util=require(_0x8f60('0x7'));var path=require(_0x8f60('0x8'));var sox=require('sox');var csv=require(_0x8f60('0x9'));var ejs=require(_0x8f60('0xa'));var fs=require('fs');var fs_extra=require(_0x8f60('0xb'));var _=require(_0x8f60('0xc'));var squel=require(_0x8f60('0xd'));var crypto=require('crypto');var jsforce=require(_0x8f60('0xe'));var deskjs=require(_0x8f60('0xf'));var toCsv=require(_0x8f60('0x9'));var querystring=require('querystring');var Papa=require(_0x8f60('0x10'));var Redis=require(_0x8f60('0x11'));var authService=require(_0x8f60('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8f60('0x13'));var hardwareService=require(_0x8f60('0x14'));var logger=require(_0x8f60('0x15'))(_0x8f60('0x16'));var utils=require(_0x8f60('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8f60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46b04e,_0x53cf73){_0x53cf73=_0x53cf73||0xcc;return function(_0x1760a3){if(_0x1760a3){return _0x46b04e[_0x8f60('0x19')](_0x53cf73);}return _0x46b04e[_0x8f60('0x1a')](_0x53cf73)[_0x8f60('0x1b')]();};}function respondWithResult(_0x2fced0,_0x4d33a5){_0x4d33a5=_0x4d33a5||0xc8;return function(_0x245ba1){if(_0x245ba1){return _0x2fced0['status'](_0x4d33a5)[_0x8f60('0x1c')](_0x245ba1);}};}function respondWithFilteredResult(_0x36e1bf,_0x118b8f){return function(_0x4e2c15){if(_0x4e2c15){var _0xb62288=typeof _0x118b8f['offset']===_0x8f60('0x1d')&&typeof _0x118b8f[_0x8f60('0x1e')]==='undefined';var _0x4ae1a9=_0x4e2c15[_0x8f60('0x1f')];var _0x541ecb=_0xb62288?0x0:_0x118b8f[_0x8f60('0x20')];var _0xdb75fe=_0xb62288?_0x4e2c15['count']:_0x118b8f[_0x8f60('0x20')]+_0x118b8f[_0x8f60('0x1e')];var _0x123666;if(_0xdb75fe>=_0x4ae1a9){_0xdb75fe=_0x4ae1a9;_0x123666=0xc8;}else{_0x123666=0xce;}_0x36e1bf[_0x8f60('0x1a')](_0x123666);return _0x36e1bf['set'](_0x8f60('0x21'),_0x541ecb+'-'+_0xdb75fe+'/'+_0x4ae1a9)[_0x8f60('0x1c')](_0x4e2c15);}return null;};}function patchUpdates(_0x151542){return function(_0x284cf3){try{jsonpatch[_0x8f60('0x22')](_0x284cf3,_0x151542,!![]);}catch(_0x5d50ff){return BPromise[_0x8f60('0x23')](_0x5d50ff);}return _0x284cf3['save']();};}function saveUpdates(_0x257db5,_0x2ff94e){return function(_0x1d3283){if(_0x1d3283){return _0x1d3283['update'](_0x257db5)[_0x8f60('0x24')](function(_0x104231){return _0x104231;});}return null;};}function removeEntity(_0x35a85c,_0x39ac39){return function(_0x526ead){if(_0x526ead){return _0x526ead['destroy']()[_0x8f60('0x24')](function(){var _0x5277f2=_0x526ead['get']({'plain':!![]});var _0x4a1875='Variables';return db['UserProfileResource'][_0x8f60('0x25')]({'where':{'type':_0x4a1875,'resourceId':_0x5277f2['id']}})[_0x8f60('0x24')](function(){return _0x526ead;});})[_0x8f60('0x24')](function(){_0x35a85c[_0x8f60('0x1a')](0xcc)[_0x8f60('0x1b')]();});}};}function handleEntityNotFound(_0x31e1db,_0x2befb3){return function(_0x56bc19){if(!_0x56bc19){_0x31e1db[_0x8f60('0x19')](0x194);}return _0x56bc19;};}function handleError(_0x38a736,_0x2e1389){_0x2e1389=_0x2e1389||0x1f4;return function(_0x3d51a5){logger['error'](_0x3d51a5['stack']);if(_0x3d51a5['name']){delete _0x3d51a5['name'];}_0x38a736[_0x8f60('0x1a')](_0x2e1389)[_0x8f60('0x26')](_0x3d51a5);};}exports[_0x8f60('0x27')]=function(_0x42879a,_0x542baa){var _0x2c1fe0={},_0x4f1a1a={},_0x5f4f04={'count':0x0,'rows':[]};var _0xd8cc1a=_[_0x8f60('0x28')](db[_0x8f60('0x29')][_0x8f60('0x2a')],function(_0x77e5fe){return{'name':_0x77e5fe[_0x8f60('0x2b')],'type':_0x77e5fe[_0x8f60('0x2c')][_0x8f60('0x2d')]};});_0x4f1a1a[_0x8f60('0x2e')]=_['map'](_0xd8cc1a,_0x8f60('0x2f'));_0x4f1a1a[_0x8f60('0x30')]=_[_0x8f60('0x31')](_0x42879a['query']);_0x4f1a1a[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0x4f1a1a[_0x8f60('0x2e')],_0x4f1a1a['query']);_0x2c1fe0[_0x8f60('0x34')]=_[_0x8f60('0x33')](_0x4f1a1a['model'],qs[_0x8f60('0x35')](_0x42879a[_0x8f60('0x30')][_0x8f60('0x35')]));_0x2c1fe0['attributes']=_0x2c1fe0['attributes']['length']?_0x2c1fe0[_0x8f60('0x34')]:_0x4f1a1a[_0x8f60('0x2e')];if(!_0x42879a[_0x8f60('0x30')]['hasOwnProperty'](_0x8f60('0x36'))){_0x2c1fe0[_0x8f60('0x1e')]=qs['limit'](_0x42879a[_0x8f60('0x30')]['limit']);_0x2c1fe0[_0x8f60('0x20')]=qs[_0x8f60('0x20')](_0x42879a[_0x8f60('0x30')][_0x8f60('0x20')]);}_0x2c1fe0['order']=qs[_0x8f60('0x37')](_0x42879a[_0x8f60('0x30')][_0x8f60('0x37')]);_0x2c1fe0[_0x8f60('0x38')]=qs[_0x8f60('0x32')](_[_0x8f60('0x39')](_0x42879a[_0x8f60('0x30')],_0x4f1a1a[_0x8f60('0x32')]),_0xd8cc1a);if(_0x42879a[_0x8f60('0x30')][_0x8f60('0x3a')]){_0x2c1fe0[_0x8f60('0x38')]=_[_0x8f60('0x3b')](_0x2c1fe0[_0x8f60('0x38')],{'$or':_[_0x8f60('0x28')](_0xd8cc1a,function(_0x28d80c){if(_0x28d80c[_0x8f60('0x2c')]!==_0x8f60('0x3c')){var _0x368c6e={};_0x368c6e[_0x28d80c[_0x8f60('0x2f')]]={'$like':'%'+_0x42879a[_0x8f60('0x30')][_0x8f60('0x3a')]+'%'};return _0x368c6e;}})});}_0x2c1fe0=_[_0x8f60('0x3b')]({},_0x2c1fe0,_0x42879a[_0x8f60('0x3d')]);var _0x5caf52={'where':_0x2c1fe0[_0x8f60('0x38')]};return db[_0x8f60('0x29')][_0x8f60('0x1f')](_0x5caf52)[_0x8f60('0x24')](function(_0x80d477){_0x5f4f04[_0x8f60('0x1f')]=_0x80d477;if(_0x42879a['query'][_0x8f60('0x3e')]){_0x2c1fe0[_0x8f60('0x3f')]=[{'all':!![]}];}return db['Variable'][_0x8f60('0x40')](_0x2c1fe0);})[_0x8f60('0x24')](function(_0x463087){_0x5f4f04['rows']=_0x463087;return _0x5f4f04;})[_0x8f60('0x24')](respondWithFilteredResult(_0x542baa,_0x2c1fe0))['catch'](handleError(_0x542baa,null));};exports[_0x8f60('0x41')]=function(_0x163d9f,_0x55ae1e){var _0x5e1a12={'raw':!![],'where':{'id':_0x163d9f[_0x8f60('0x42')]['id']}},_0xc097ae={};_0xc097ae[_0x8f60('0x2e')]=_[_0x8f60('0x31')](db['Variable'][_0x8f60('0x2a')]);_0xc097ae[_0x8f60('0x30')]=_['keys'](_0x163d9f[_0x8f60('0x30')]);_0xc097ae[_0x8f60('0x32')]=_[_0x8f60('0x33')](_0xc097ae[_0x8f60('0x2e')],_0xc097ae[_0x8f60('0x30')]);_0x5e1a12['attributes']=_[_0x8f60('0x33')](_0xc097ae[_0x8f60('0x2e')],qs[_0x8f60('0x35')](_0x163d9f[_0x8f60('0x30')][_0x8f60('0x35')]));_0x5e1a12[_0x8f60('0x34')]=_0x5e1a12[_0x8f60('0x34')]['length']?_0x5e1a12['attributes']:_0xc097ae[_0x8f60('0x2e')];if(_0x163d9f[_0x8f60('0x30')][_0x8f60('0x3e')]){_0x5e1a12[_0x8f60('0x3f')]=[{'all':!![]}];}_0x5e1a12=_['merge']({},_0x5e1a12,_0x163d9f[_0x8f60('0x3d')]);return db[_0x8f60('0x29')][_0x8f60('0x43')](_0x5e1a12)[_0x8f60('0x24')](handleEntityNotFound(_0x55ae1e,null))[_0x8f60('0x24')](respondWithResult(_0x55ae1e,null))[_0x8f60('0x44')](handleError(_0x55ae1e,null));};exports[_0x8f60('0x45')]=function(_0x1c4c8d,_0x1068f2){return db[_0x8f60('0x29')][_0x8f60('0x45')](_0x1c4c8d[_0x8f60('0x46')],{})[_0x8f60('0x24')](function(_0x2a6a5f){var _0x15d207=_0x1c4c8d['user'][_0x8f60('0x47')]({'plain':!![]});if(!_0x15d207)throw new Error(_0x8f60('0x48'));if(_0x15d207['role']==='user'){var _0x2c9c6a=_0x2a6a5f[_0x8f60('0x47')]({'plain':!![]});var _0x380fcb=_0x8f60('0x49');return db[_0x8f60('0x4a')][_0x8f60('0x43')]({'where':{'name':_0x380fcb,'userProfileId':_0x15d207['userProfileId']},'raw':!![]})[_0x8f60('0x24')](function(_0x1294c0){if(_0x1294c0&&_0x1294c0[_0x8f60('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x2c9c6a[_0x8f60('0x2f')],'resourceId':_0x2c9c6a['id'],'type':_0x1294c0[_0x8f60('0x2f')],'sectionId':_0x1294c0['id']},{})[_0x8f60('0x24')](function(){return _0x2a6a5f;});}else{return _0x2a6a5f;}})['catch'](function(_0x22c7c5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22c7c5);throw _0x22c7c5;});}return _0x2a6a5f;})[_0x8f60('0x24')](respondWithResult(_0x1068f2,0xc9))[_0x8f60('0x44')](handleError(_0x1068f2,null));};exports[_0x8f60('0x4c')]=function(_0x3f289a,_0x1a5d61){if(_0x3f289a[_0x8f60('0x46')]['id']){delete _0x3f289a[_0x8f60('0x46')]['id'];}return db[_0x8f60('0x29')]['find']({'where':{'id':_0x3f289a[_0x8f60('0x42')]['id']}})[_0x8f60('0x24')](handleEntityNotFound(_0x1a5d61,null))[_0x8f60('0x24')](saveUpdates(_0x3f289a['body'],null))['then'](respondWithResult(_0x1a5d61,null))[_0x8f60('0x44')](handleError(_0x1a5d61,null));};exports[_0x8f60('0x25')]=function(_0x36bc51,_0x4405e0){return db['Variable'][_0x8f60('0x43')]({'where':{'id':_0x36bc51[_0x8f60('0x42')]['id']}})[_0x8f60('0x24')](handleEntityNotFound(_0x4405e0,null))[_0x8f60('0x24')](removeEntity(_0x4405e0,null))[_0x8f60('0x44')](handleError(_0x4405e0,null));}; \ No newline at end of file +var _0x2534=['filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','find','eml-format','rimraf','request-promise','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','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','index','Variable','type','key','model','map','query','keys'];(function(_0x1dffed,_0x3c1f87){var _0xa6afc4=function(_0x546ede){while(--_0x546ede){_0x1dffed['push'](_0x1dffed['shift']());}};_0xa6afc4(++_0x3c1f87);}(_0x2534,0x16a));var _0x4253=function(_0xe02b00,_0x40b978){_0xe02b00=_0xe02b00-0x0;var _0x247425=_0x2534[_0xe02b00];return _0x247425;};'use strict';var emlformat=require(_0x4253('0x0'));var rimraf=require(_0x4253('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4253('0x2'));var moment=require(_0x4253('0x3'));var BPromise=require(_0x4253('0x4'));var Mustache=require('mustache');var util=require(_0x4253('0x5'));var path=require(_0x4253('0x6'));var sox=require(_0x4253('0x7'));var csv=require(_0x4253('0x8'));var ejs=require(_0x4253('0x9'));var fs=require('fs');var fs_extra=require(_0x4253('0xa'));var _=require(_0x4253('0xb'));var squel=require(_0x4253('0xc'));var crypto=require(_0x4253('0xd'));var jsforce=require(_0x4253('0xe'));var deskjs=require(_0x4253('0xf'));var toCsv=require(_0x4253('0x8'));var querystring=require('querystring');var Papa=require(_0x4253('0x10'));var Redis=require('ioredis');var authService=require(_0x4253('0x11'));var qs=require(_0x4253('0x12'));var as=require(_0x4253('0x13'));var hardwareService=require(_0x4253('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4253('0x15'));var config=require(_0x4253('0x16'));var licenseUtil=require(_0x4253('0x17'));var db=require(_0x4253('0x18'))['db'];function respondWithStatusCode(_0x4178a5,_0x1b1710){_0x1b1710=_0x1b1710||0xcc;return function(_0x2b5926){if(_0x2b5926){return _0x4178a5[_0x4253('0x19')](_0x1b1710);}return _0x4178a5[_0x4253('0x1a')](_0x1b1710)[_0x4253('0x1b')]();};}function respondWithResult(_0x2ef306,_0x2ee9d0){_0x2ee9d0=_0x2ee9d0||0xc8;return function(_0x1211ec){if(_0x1211ec){return _0x2ef306[_0x4253('0x1a')](_0x2ee9d0)[_0x4253('0x1c')](_0x1211ec);}};}function respondWithFilteredResult(_0xdf8661,_0x33f456){return function(_0x2bb899){if(_0x2bb899){var _0x18256b=typeof _0x33f456['offset']===_0x4253('0x1d')&&typeof _0x33f456['limit']===_0x4253('0x1d');var _0x581f24=_0x2bb899[_0x4253('0x1e')];var _0x2543ef=_0x18256b?0x0:_0x33f456['offset'];var _0x112c89=_0x18256b?_0x2bb899[_0x4253('0x1e')]:_0x33f456[_0x4253('0x1f')]+_0x33f456[_0x4253('0x20')];var _0x576304;if(_0x112c89>=_0x581f24){_0x112c89=_0x581f24;_0x576304=0xc8;}else{_0x576304=0xce;}_0xdf8661[_0x4253('0x1a')](_0x576304);return _0xdf8661[_0x4253('0x21')](_0x4253('0x22'),_0x2543ef+'-'+_0x112c89+'/'+_0x581f24)['json'](_0x2bb899);}return null;};}function patchUpdates(_0x4b143c){return function(_0x4b01a8){try{jsonpatch[_0x4253('0x23')](_0x4b01a8,_0x4b143c,!![]);}catch(_0x22fd75){return BPromise['reject'](_0x22fd75);}return _0x4b01a8[_0x4253('0x24')]();};}function saveUpdates(_0x37abcd,_0x5f016b){return function(_0x46ea80){if(_0x46ea80){return _0x46ea80[_0x4253('0x25')](_0x37abcd)[_0x4253('0x26')](function(_0x288ee0){return _0x288ee0;});}return null;};}function removeEntity(_0x40d9ff,_0x473093){return function(_0x5946ac){if(_0x5946ac){return _0x5946ac[_0x4253('0x27')]()[_0x4253('0x26')](function(){var _0x464e16=_0x5946ac[_0x4253('0x28')]({'plain':!![]});var _0x1b9704=_0x4253('0x29');return db[_0x4253('0x2a')][_0x4253('0x27')]({'where':{'type':_0x1b9704,'resourceId':_0x464e16['id']}})['then'](function(){return _0x5946ac;});})[_0x4253('0x26')](function(){_0x40d9ff[_0x4253('0x1a')](0xcc)[_0x4253('0x1b')]();});}};}function handleEntityNotFound(_0x367de6,_0x561ab9){return function(_0x42c36b){if(!_0x42c36b){_0x367de6[_0x4253('0x19')](0x194);}return _0x42c36b;};}function handleError(_0x6d8b67,_0x234894){_0x234894=_0x234894||0x1f4;return function(_0x55cca2){logger['error'](_0x55cca2[_0x4253('0x2b')]);if(_0x55cca2[_0x4253('0x2c')]){delete _0x55cca2[_0x4253('0x2c')];}_0x6d8b67[_0x4253('0x1a')](_0x234894)['send'](_0x55cca2);};}exports[_0x4253('0x2d')]=function(_0x587e20,_0x2c2c2d){var _0x5423ee={},_0x41efe8={},_0x49dbcf={'count':0x0,'rows':[]};var _0x4598cd=_['map'](db[_0x4253('0x2e')]['rawAttributes'],function(_0x1fa95b){return{'name':_0x1fa95b['fieldName'],'type':_0x1fa95b[_0x4253('0x2f')][_0x4253('0x30')]};});_0x41efe8[_0x4253('0x31')]=_[_0x4253('0x32')](_0x4598cd,'name');_0x41efe8[_0x4253('0x33')]=_[_0x4253('0x34')](_0x587e20[_0x4253('0x33')]);_0x41efe8[_0x4253('0x35')]=_[_0x4253('0x36')](_0x41efe8['model'],_0x41efe8['query']);_0x5423ee['attributes']=_[_0x4253('0x36')](_0x41efe8[_0x4253('0x31')],qs[_0x4253('0x37')](_0x587e20['query'][_0x4253('0x37')]));_0x5423ee[_0x4253('0x38')]=_0x5423ee[_0x4253('0x38')][_0x4253('0x39')]?_0x5423ee['attributes']:_0x41efe8[_0x4253('0x31')];if(!_0x587e20[_0x4253('0x33')]['hasOwnProperty'](_0x4253('0x3a'))){_0x5423ee[_0x4253('0x20')]=qs[_0x4253('0x20')](_0x587e20['query'][_0x4253('0x20')]);_0x5423ee[_0x4253('0x1f')]=qs[_0x4253('0x1f')](_0x587e20[_0x4253('0x33')]['offset']);}_0x5423ee['order']=qs[_0x4253('0x3b')](_0x587e20[_0x4253('0x33')][_0x4253('0x3b')]);_0x5423ee[_0x4253('0x3c')]=qs[_0x4253('0x35')](_[_0x4253('0x3d')](_0x587e20[_0x4253('0x33')],_0x41efe8[_0x4253('0x35')]),_0x4598cd);if(_0x587e20[_0x4253('0x33')]['filter']){_0x5423ee[_0x4253('0x3c')]=_[_0x4253('0x3e')](_0x5423ee[_0x4253('0x3c')],{'$or':_[_0x4253('0x32')](_0x4598cd,function(_0x2fd150){if(_0x2fd150['type']!==_0x4253('0x3f')){var _0xede940={};_0xede940[_0x2fd150['name']]={'$like':'%'+_0x587e20['query'][_0x4253('0x40')]+'%'};return _0xede940;}})});}_0x5423ee=_['merge']({},_0x5423ee,_0x587e20[_0x4253('0x41')]);var _0x5bf0fd={'where':_0x5423ee[_0x4253('0x3c')]};return db[_0x4253('0x2e')][_0x4253('0x1e')](_0x5bf0fd)['then'](function(_0x1f594e){_0x49dbcf['count']=_0x1f594e;if(_0x587e20[_0x4253('0x33')][_0x4253('0x42')]){_0x5423ee[_0x4253('0x43')]=[{'all':!![]}];}return db['Variable'][_0x4253('0x44')](_0x5423ee);})['then'](function(_0x1d523f){_0x49dbcf[_0x4253('0x45')]=_0x1d523f;return _0x49dbcf;})[_0x4253('0x26')](respondWithFilteredResult(_0x2c2c2d,_0x5423ee))[_0x4253('0x46')](handleError(_0x2c2c2d,null));};exports[_0x4253('0x47')]=function(_0x150acf,_0x4eda40){var _0x4b8172={'raw':!![],'where':{'id':_0x150acf[_0x4253('0x48')]['id']}},_0x18f6df={};_0x18f6df[_0x4253('0x31')]=_[_0x4253('0x34')](db[_0x4253('0x2e')][_0x4253('0x49')]);_0x18f6df[_0x4253('0x33')]=_['keys'](_0x150acf[_0x4253('0x33')]);_0x18f6df[_0x4253('0x35')]=_['intersection'](_0x18f6df[_0x4253('0x31')],_0x18f6df[_0x4253('0x33')]);_0x4b8172[_0x4253('0x38')]=_[_0x4253('0x36')](_0x18f6df['model'],qs['fields'](_0x150acf['query'][_0x4253('0x37')]));_0x4b8172['attributes']=_0x4b8172[_0x4253('0x38')]['length']?_0x4b8172[_0x4253('0x38')]:_0x18f6df[_0x4253('0x31')];if(_0x150acf[_0x4253('0x33')][_0x4253('0x42')]){_0x4b8172['include']=[{'all':!![]}];}_0x4b8172=_[_0x4253('0x3e')]({},_0x4b8172,_0x150acf[_0x4253('0x41')]);return db['Variable']['find'](_0x4b8172)[_0x4253('0x26')](handleEntityNotFound(_0x4eda40,null))[_0x4253('0x26')](respondWithResult(_0x4eda40,null))['catch'](handleError(_0x4eda40,null));};exports[_0x4253('0x4a')]=function(_0x344476,_0x412e62){return db[_0x4253('0x2e')]['create'](_0x344476[_0x4253('0x4b')],{})[_0x4253('0x26')](function(_0x310614){var _0x20fdb4=_0x344476['user'][_0x4253('0x28')]({'plain':!![]});if(!_0x20fdb4)throw new Error(_0x4253('0x4c'));if(_0x20fdb4['role']===_0x4253('0x4d')){var _0x1820ae=_0x310614['get']({'plain':!![]});var _0x5d5b7b=_0x4253('0x29');return db[_0x4253('0x4e')]['find']({'where':{'name':_0x5d5b7b,'userProfileId':_0x20fdb4[_0x4253('0x4f')]},'raw':!![]})[_0x4253('0x26')](function(_0x37aea0){if(_0x37aea0&&_0x37aea0[_0x4253('0x50')]===0x0){return db[_0x4253('0x2a')][_0x4253('0x4a')]({'name':_0x1820ae[_0x4253('0x2c')],'resourceId':_0x1820ae['id'],'type':_0x37aea0[_0x4253('0x2c')],'sectionId':_0x37aea0['id']},{})['then'](function(){return _0x310614;});}else{return _0x310614;}})[_0x4253('0x46')](function(_0x290e1b){logger[_0x4253('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x290e1b);throw _0x290e1b;});}return _0x310614;})[_0x4253('0x26')](respondWithResult(_0x412e62,0xc9))[_0x4253('0x46')](handleError(_0x412e62,null));};exports['update']=function(_0x3fe466,_0x2a4b71){if(_0x3fe466[_0x4253('0x4b')]['id']){delete _0x3fe466[_0x4253('0x4b')]['id'];}return db[_0x4253('0x2e')][_0x4253('0x52')]({'where':{'id':_0x3fe466[_0x4253('0x48')]['id']}})[_0x4253('0x26')](handleEntityNotFound(_0x2a4b71,null))[_0x4253('0x26')](saveUpdates(_0x3fe466[_0x4253('0x4b')],null))[_0x4253('0x26')](respondWithResult(_0x2a4b71,null))['catch'](handleError(_0x2a4b71,null));};exports[_0x4253('0x27')]=function(_0x59686f,_0x41d9c9){return db['Variable'][_0x4253('0x52')]({'where':{'id':_0x59686f[_0x4253('0x48')]['id']}})[_0x4253('0x26')](handleEntityNotFound(_0x41d9c9,null))[_0x4253('0x26')](removeEntity(_0x41d9c9,null))[_0x4253('0x46')](handleError(_0x41d9c9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 04c2f29..91ff99b 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 _0x5bf1=['bluebird','request-promise','path','../../config/environment','./variable.attributes','Variable','tools_variables','lodash','util','moment'];(function(_0x3d0dc8,_0x4b9365){var _0x2926bd=function(_0x43d35d){while(--_0x43d35d){_0x3d0dc8['push'](_0x3d0dc8['shift']());}};_0x2926bd(++_0x4b9365);}(_0x5bf1,0x165));var _0x15bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x15bf('0x0'));var util=require(_0x15bf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x15bf('0x2'));var BPromise=require(_0x15bf('0x3'));var rp=require(_0x15bf('0x4'));var fs=require('fs');var path=require(_0x15bf('0x5'));var rimraf=require('rimraf');var config=require(_0x15bf('0x6'));var attributes=require(_0x15bf('0x7'));module['exports']=function(_0x39e016,_0xa71a1){return _0x39e016['define'](_0x15bf('0x8'),attributes,{'tableName':_0x15bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b93=['bluebird','request-promise','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','util','api','moment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1b93,0xb8));var _0x31b9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1b93[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x31b9('0x0'));var logger=require('../../config/logger')(_0x31b9('0x1'));var moment=require(_0x31b9('0x2'));var BPromise=require(_0x31b9('0x3'));var rp=require(_0x31b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x31b9('0x5'));var attributes=require(_0x31b9('0x6'));module[_0x31b9('0x7')]=function(_0x1e9257,_0x1e6db8){return _0x1e9257[_0x31b9('0x8')](_0x31b9('0x9'),attributes,{'tableName':_0x31b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 9981a9e..2c0e418 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 _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x37b2b0,_0x1f61c2){var _0x4b7cea=function(_0x205562){while(--_0x205562){_0x37b2b0['push'](_0x37b2b0['shift']());}};_0x4b7cea(++_0x1f61c2);}(_0x6aa7,0x178));var _0x76aa=function(_0x58210c,_0x5c2f36){_0x58210c=_0x58210c-0x0;var _0x4836fa=_0x6aa7[_0x58210c];return _0x4836fa;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x2a4a22,_0x27face){var _0x27c72f=function(_0x3bb240){while(--_0x3bb240){_0x2a4a22['push'](_0x2a4a22['shift']());}};_0x27c72f(++_0x27face);}(_0x6aa7,0x178));var _0x76aa=function(_0x4d28cc,_0x31e6dc){_0x4d28cc=_0x4d28cc-0x0;var _0xb6b58d=_0x6aa7[_0x4d28cc];return _0xb6b58d;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 5844e6d..34c9023 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 _0xa25a=['/fetch','isAuthenticated','canUpdate','fetch','/reset','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get'];(function(_0x14d1c4,_0x28c0ce){var _0x11884d=function(_0x1d11b8){while(--_0x1d11b8){_0x14d1c4['push'](_0x14d1c4['shift']());}};_0x11884d(++_0x28c0ce);}(_0xa25a,0x1d0));var _0xaa25=function(_0x46c7c1,_0x414087){_0x46c7c1=_0x46c7c1-0x0;var _0x2c11de=_0xa25a[_0x46c7c1];return _0x2c11de;};'use strict';var express=require('express');var router=express[_0xaa25('0x0')]();var auth=require(_0xaa25('0x1'));var controller=require(_0xaa25('0x2'));router[_0xaa25('0x3')]('/',controller['index']);router[_0xaa25('0x3')](_0xaa25('0x4'),auth[_0xaa25('0x5')](),auth[_0xaa25('0x6')](),controller[_0xaa25('0x7')]);router[_0xaa25('0x3')](_0xaa25('0x8'),auth['isAuthenticated'](),auth[_0xaa25('0x6')](),controller['reset']);router[_0xaa25('0x3')]('/pull',auth[_0xaa25('0x5')](),auth[_0xaa25('0x6')](),controller['pull']);router['get']('/restart',auth['isAuthenticated'](),controller[_0xaa25('0x9')]);router[_0xaa25('0x3')](_0xaa25('0xa'),controller[_0xaa25('0xb')]);module[_0xaa25('0xc')]=router; \ No newline at end of file +var _0x636f=['/restart','/migrations','migrations','exports','express','./version.controller','get','/fetch','canUpdate','/reset','isAuthenticated','reset','/pull','pull'];(function(_0x1a1e42,_0x45b0d9){var _0x409105=function(_0x46421a){while(--_0x46421a){_0x1a1e42['push'](_0x1a1e42['shift']());}};_0x409105(++_0x45b0d9);}(_0x636f,0xe4));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var express=require(_0xf636('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xf636('0x1'));router[_0xf636('0x2')]('/',controller['index']);router[_0xf636('0x2')](_0xf636('0x3'),auth['isAuthenticated'](),auth[_0xf636('0x4')](),controller['fetch']);router[_0xf636('0x2')](_0xf636('0x5'),auth[_0xf636('0x6')](),auth[_0xf636('0x4')](),controller[_0xf636('0x7')]);router[_0xf636('0x2')](_0xf636('0x8'),auth[_0xf636('0x6')](),auth[_0xf636('0x4')](),controller[_0xf636('0x9')]);router[_0xf636('0x2')](_0xf636('0xa'),auth[_0xf636('0x6')](),controller['restart']);router['get'](_0xf636('0xb'),controller[_0xf636('0xc')]);module[_0xf636('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 522d4c3..4cfd809 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 _0x2f26=['push','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','2.0.0','status','json','fetch','origin','error','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','root','server','length'];(function(_0x529592,_0x911272){var _0x5dfe7e=function(_0x24f638){while(--_0x24f638){_0x529592['push'](_0x529592['shift']());}};_0x5dfe7e(++_0x911272);}(_0x2f26,0xd4));var _0x62f2=function(_0x3c44ab,_0x5ae15a){_0x3c44ab=_0x3c44ab-0x0;var _0x2a9bc4=_0x2f26[_0x3c44ab];return _0x2a9bc4;};'use strict';var Umzug=require(_0x62f2('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x62f2('0x1'));var pkginfo=require(_0x62f2('0x2'))(module,_0x62f2('0x3'));var compareVersions=require(_0x62f2('0x4'));var exec=require(_0x62f2('0x5'))['exec'];var db=require(_0x62f2('0x6'))['db'];var config=require(_0x62f2('0x7'));var pm2=require(_0x62f2('0x8'));var logger=require(_0x62f2('0x9'))(_0x62f2('0xa'));var git=require(_0x62f2('0xb'))(config['root']);exports[_0x62f2('0xc')]=function(_0x3c0a63,_0x2d5969){var _0xd7d017={'current':module[_0x62f2('0xd')]['version'],'phonebar':0x2};if(_0x3c0a63[_0x62f2('0xe')]&&_0x3c0a63[_0x62f2('0xe')][_0x62f2('0xf')]){return git['fetch']()['tags'](function(_0xf45343,_0x150763){_0xd7d017[_0x62f2('0xf')]=(_0xf45343?module[_0x62f2('0xd')][_0x62f2('0x3')]:_0x150763[_0x62f2('0xf')])||_0x62f2('0x10');return _0x2d5969[_0x62f2('0x11')](0xc8)['json'](_0xd7d017);});}else{return _0x2d5969[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')](_0xd7d017);}};exports[_0x62f2('0x13')]=function(_0x50fe7e,_0x17a4c8){return git['fetch']([_0x62f2('0x14'),'master'],function(_0x3ac94d){if(_0x3ac94d){logger[_0x62f2('0x15')](_0x3ac94d);return _0x17a4c8[_0x62f2('0x11')](0x1f4)['json'](_0x3ac94d);}logger['info']('git\x20fetch');return _0x17a4c8[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x62f2('0x16')]=function(_0x155f4c,_0x29fc2d){return git[_0x62f2('0x16')](['--hard',_0x62f2('0x17')],function(_0x1ad4a0){if(_0x1ad4a0){logger[_0x62f2('0x15')](_0x1ad4a0);return _0x29fc2d[_0x62f2('0x11')](0x1f4)['json'](_0x1ad4a0);}logger[_0x62f2('0x18')](_0x62f2('0x19'));return _0x29fc2d[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')]({'output':_0x62f2('0x1a')});});};exports[_0x62f2('0x1b')]=function(_0x4d80f0,_0x59e64c){exec('npm\x20install\x20--production',function(_0x2811d4,_0x472bca,_0x23ee13){logger[_0x62f2('0x18')](_0x472bca);logger[_0x62f2('0x18')](_0x23ee13);if(_0x2811d4){logger[_0x62f2('0x15')](_0x2811d4);return _0x59e64c[_0x62f2('0x11')](0x1f4)[_0x62f2('0x12')](_0x2811d4);}return _0x59e64c[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')]({'output':_0x472bca});});};exports[_0x62f2('0x1c')]=function(_0x530303,_0x7bc468){return pm2[_0x62f2('0x1c')]('motion2')[_0x62f2('0x1d')](function(_0x5f83e3){logger['info'](_0x62f2('0x1e'),_0x5f83e3);return _0x7bc468[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')]({'output':_0x62f2('0x1f')});})[_0x62f2('0x20')](function(_0x3374e2){logger[_0x62f2('0x15')](_0x3374e2);return _0x7bc468[_0x62f2('0x11')](0x1f4)[_0x62f2('0x12')](_0x3374e2);});};exports[_0x62f2('0x21')]=function(_0x3cea6c,_0x296ff0){var _0x29b7f4=fs[_0x62f2('0x22')](path['join'](config[_0x62f2('0x23')],_0x62f2('0x24'),'migrations'));var _0xe10fc3=[];for(var _0x5345ab=0x0;_0x5345ab<_0x29b7f4[_0x62f2('0x25')];_0x5345ab++){var _0xa67d56=_0x29b7f4[_0x5345ab]['replace']('.js','');if(compareVersions(module[_0x62f2('0xd')][_0x62f2('0x3')],_0xa67d56)===-0x1){_0xe10fc3[_0x62f2('0x26')](_0xa67d56);}}if(_0xe10fc3['length']){var _0x5530f7=_0xe10fc3['sort'](compareVersions);var _0x3cbf60=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x62f2('0x27')],'modelName':_0x62f2('0x27'),'columnName':'version'},'migrations':{'params':[db[_0x62f2('0x28')]['getQueryInterface'](),db[_0x62f2('0x28')][_0x62f2('0x29')],function(){throw new Error(_0x62f2('0x2a'));}],'path':path[_0x62f2('0x2b')](config[_0x62f2('0x23')],_0x62f2('0x24'),_0x62f2('0x21')),'pattern':/\.js$/}});_0x3cbf60['up']({'migrations':_['map'](_0x5530f7,function(_0x428df1){return _0x428df1+_0x62f2('0x2c');})})[_0x62f2('0x1d')](function(){return _0x296ff0[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')]({'output':_0x62f2('0x2d')+module[_0x62f2('0xd')][_0x62f2('0x3')]+_0x62f2('0x2e')+_[_0x62f2('0x2f')](_0x5530f7),'migrations':_['join'](_0x5530f7)});})[_0x62f2('0x20')](function(_0x27252c){if(_0x27252c instanceof db[_0x62f2('0x28')][_0x62f2('0x30')]){return _0x296ff0[_0x62f2('0x11')](0xc8)[_0x62f2('0x12')]({'output':_0x62f2('0x31')});}else{return _0x296ff0['status'](0x1f4)[_0x62f2('0x12')](_0x27252c);}});}else{return _0x296ff0['status'](0xc8)[_0x62f2('0x12')]({'output':_0x62f2('0x31')});}}; \ No newline at end of file +var _0x82ae=['replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../config/environment','../../config/pm2','../../config/logger','update','root','index','query','fetch','tags','latest','exports','2.0.0','json','status','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','error','restart','catch','migrations','readdirSync','join','server','length'];(function(_0x1ab1bf,_0x144262){var _0x2a00a5=function(_0x42f0bd){while(--_0x42f0bd){_0x1ab1bf['push'](_0x1ab1bf['shift']());}};_0x2a00a5(++_0x144262);}(_0x82ae,0x1c0));var _0xe82a=function(_0x16b37f,_0x583267){_0x16b37f=_0x16b37f-0x0;var _0x322013=_0x82ae[_0x16b37f];return _0x322013;};'use strict';var Umzug=require(_0xe82a('0x0'));var path=require(_0xe82a('0x1'));var fs=require('fs');var _=require(_0xe82a('0x2'));var pkginfo=require(_0xe82a('0x3'))(module,_0xe82a('0x4'));var compareVersions=require(_0xe82a('0x5'));var exec=require(_0xe82a('0x6'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xe82a('0x7'));var pm2=require(_0xe82a('0x8'));var logger=require(_0xe82a('0x9'))(_0xe82a('0xa'));var git=require('simple-git')(config[_0xe82a('0xb')]);exports[_0xe82a('0xc')]=function(_0x4df3ba,_0x3803de){var _0x3dd768={'current':module['exports'][_0xe82a('0x4')],'phonebar':0x2};if(_0x4df3ba[_0xe82a('0xd')]&&_0x4df3ba[_0xe82a('0xd')]['latest']){return git[_0xe82a('0xe')]()[_0xe82a('0xf')](function(_0x56ec8e,_0x49ae63){_0x3dd768[_0xe82a('0x10')]=(_0x56ec8e?module[_0xe82a('0x11')][_0xe82a('0x4')]:_0x49ae63[_0xe82a('0x10')])||_0xe82a('0x12');return _0x3803de['status'](0xc8)[_0xe82a('0x13')](_0x3dd768);});}else{return _0x3803de[_0xe82a('0x14')](0xc8)[_0xe82a('0x13')](_0x3dd768);}};exports['fetch']=function(_0x328ed1,_0x422020){return git[_0xe82a('0xe')]([_0xe82a('0x15'),_0xe82a('0x16')],function(_0x39c5e1){if(_0x39c5e1){logger['error'](_0x39c5e1);return _0x422020[_0xe82a('0x14')](0x1f4)[_0xe82a('0x13')](_0x39c5e1);}logger[_0xe82a('0x17')]('git\x20fetch');return _0x422020[_0xe82a('0x14')](0xc8)['json']({'output':_0xe82a('0x18')});});};exports[_0xe82a('0x19')]=function(_0x4d3c8f,_0x4c2d3e){return git[_0xe82a('0x19')]([_0xe82a('0x1a'),'FETCH_HEAD'],function(_0x34cae1){if(_0x34cae1){logger['error'](_0x34cae1);return _0x4c2d3e[_0xe82a('0x14')](0x1f4)[_0xe82a('0x13')](_0x34cae1);}logger['info'](_0xe82a('0x1b'));return _0x4c2d3e[_0xe82a('0x14')](0xc8)[_0xe82a('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0xe82a('0x1c')]=function(_0x53df23,_0x99bf31){exec(_0xe82a('0x1d'),function(_0x168725,_0x1f2e1d,_0x28f06a){logger['info'](_0x1f2e1d);logger['info'](_0x28f06a);if(_0x168725){logger[_0xe82a('0x1e')](_0x168725);return _0x99bf31[_0xe82a('0x14')](0x1f4)[_0xe82a('0x13')](_0x168725);}return _0x99bf31[_0xe82a('0x14')](0xc8)[_0xe82a('0x13')]({'output':_0x1f2e1d});});};exports['restart']=function(_0x21cc00,_0x338e68){return pm2[_0xe82a('0x1f')]('motion2')['then'](function(_0x1ac3ae){logger['info']('pm2\x20restart\x20motion\x20%s',_0x1ac3ae);return _0x338e68[_0xe82a('0x14')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xe82a('0x20')](function(_0x2172db){logger['error'](_0x2172db);return _0x338e68[_0xe82a('0x14')](0x1f4)[_0xe82a('0x13')](_0x2172db);});};exports[_0xe82a('0x21')]=function(_0x3ec713,_0x631fc7){var _0x587894=fs[_0xe82a('0x22')](path[_0xe82a('0x23')](config[_0xe82a('0xb')],_0xe82a('0x24'),_0xe82a('0x21')));var _0x34cacb=[];for(var _0x3234af=0x0;_0x3234af<_0x587894[_0xe82a('0x25')];_0x3234af++){var _0x2cd140=_0x587894[_0x3234af][_0xe82a('0x26')](_0xe82a('0x27'),'');if(compareVersions(module[_0xe82a('0x11')]['version'],_0x2cd140)===-0x1){_0x34cacb[_0xe82a('0x28')](_0x2cd140);}}if(_0x34cacb[_0xe82a('0x25')]){var _0x1a48ff=_0x34cacb[_0xe82a('0x29')](compareVersions);var _0x15fd34=new Umzug({'storage':_0xe82a('0x2a'),'storageOptions':{'model':db[_0xe82a('0x2b')],'modelName':'Migration','columnName':_0xe82a('0x4')},'migrations':{'params':[db[_0xe82a('0x2a')][_0xe82a('0x2c')](),db[_0xe82a('0x2a')][_0xe82a('0x2d')],function(){throw new Error(_0xe82a('0x2e'));}],'path':path[_0xe82a('0x23')](config[_0xe82a('0xb')],'server','migrations'),'pattern':/\.js$/}});_0x15fd34['up']({'migrations':_[_0xe82a('0x2f')](_0x1a48ff,function(_0x3651fd){return _0x3651fd+'.js';})})[_0xe82a('0x30')](function(){return _0x631fc7[_0xe82a('0x14')](0xc8)['json']({'output':_0xe82a('0x31')+module[_0xe82a('0x11')][_0xe82a('0x4')]+_0xe82a('0x32')+_[_0xe82a('0x33')](_0x1a48ff),'migrations':_['join'](_0x1a48ff)});})['catch'](function(_0x3c8170){if(_0x3c8170 instanceof db[_0xe82a('0x2a')][_0xe82a('0x34')]){return _0x631fc7[_0xe82a('0x14')](0xc8)['json']({'output':_0xe82a('0x35')});}else{return _0x631fc7['status'](0x1f4)[_0xe82a('0x13')](_0x3c8170);}});}else{return _0x631fc7[_0xe82a('0x14')](0xc8)[_0xe82a('0x13')]({'output':_0xe82a('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 8cfbb6c..a981e64 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 _0x46ff=['multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x19e147,_0x29c011){var _0x262ad1=function(_0x25b49c){while(--_0x25b49c){_0x19e147['push'](_0x19e147['shift']());}};_0x262ad1(++_0x29c011);}(_0x46ff,0x85));var _0xf46f=function(_0x255faf,_0x2263ae){_0x255faf=_0x255faf-0x0;var _0x403477=_0x46ff[_0x255faf];return _0x403477;};'use strict';var multer=require(_0xf46f('0x0'));var util=require(_0xf46f('0x1'));var path=require(_0xf46f('0x2'));var timeout=require('connect-timeout');var express=require(_0xf46f('0x3'));var router=express['Router']();var fs_extra=require(_0xf46f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf46f('0x5'));var config=require(_0xf46f('0x6'));var controller=require('./voiceAgentReport.controller');router[_0xf46f('0x7')]('/',auth[_0xf46f('0x8')](),controller[_0xf46f('0x9')]);router[_0xf46f('0x7')](_0xf46f('0xa'),auth[_0xf46f('0x8')](),controller['describe']);router['get'](_0xf46f('0xb'),auth[_0xf46f('0x8')](),controller[_0xf46f('0xc')]);router[_0xf46f('0xd')]('/',auth[_0xf46f('0x8')](),controller[_0xf46f('0xe')]);router[_0xf46f('0xf')](_0xf46f('0xb'),auth[_0xf46f('0x8')](),controller[_0xf46f('0x10')]);router[_0xf46f('0x11')](_0xf46f('0xb'),auth[_0xf46f('0x8')](),controller[_0xf46f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x92a2=['describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x5db11e,_0x4db1d8){var _0x6f956c=function(_0x13250b){while(--_0x13250b){_0x5db11e['push'](_0x5db11e['shift']());}};_0x6f956c(++_0x4db1d8);}(_0x92a2,0x1ee));var _0x292a=function(_0x2854f3,_0x110718){_0x2854f3=_0x2854f3-0x0;var _0xacc9c0=_0x92a2[_0x2854f3];return _0xacc9c0;};'use strict';var multer=require(_0x292a('0x0'));var util=require(_0x292a('0x1'));var path=require(_0x292a('0x2'));var timeout=require(_0x292a('0x3'));var express=require('express');var router=express[_0x292a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x292a('0x5'));var interaction=require(_0x292a('0x6'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x292a('0x7')]('/',auth[_0x292a('0x8')](),controller['index']);router[_0x292a('0x7')](_0x292a('0x9'),auth[_0x292a('0x8')](),controller[_0x292a('0xa')]);router[_0x292a('0x7')]('/:id',auth[_0x292a('0x8')](),controller[_0x292a('0xb')]);router['post']('/',auth[_0x292a('0x8')](),controller[_0x292a('0xc')]);router['put'](_0x292a('0xd'),auth['isAuthenticated'](),controller[_0x292a('0xe')]);router[_0x292a('0xf')](_0x292a('0xd'),auth[_0x292a('0x8')](),controller[_0x292a('0x10')]);module[_0x292a('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 6a7c5d5..fdd80cd 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 _0x6132=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x8f7cb6,_0xf929c8){var _0xf4d3a1=function(_0x3e3d31){while(--_0x3e3d31){_0x8f7cb6['push'](_0x8f7cb6['shift']());}};_0xf4d3a1(++_0xf929c8);}(_0x6132,0xf3));var _0x2613=function(_0x3acc78,_0x510a81){_0x3acc78=_0x3acc78-0x0;var _0x41cde6=_0x6132[_0x3acc78];return _0x41cde6;};'use strict';var Sequelize=require('sequelize');module[_0x2613('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2613('0x1')]},'calleridnum':{'type':Sequelize[_0x2613('0x1')]},'calleridname':{'type':Sequelize[_0x2613('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2613('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x2613('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x2613('0x2')]},'agentdumpAt':{'type':Sequelize[_0x2613('0x2')]},'holdtime':{'type':Sequelize[_0x2613('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2613('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x2613('0x1')]},'channel':{'type':Sequelize[_0x2613('0x1')]},'channelstate':{'type':Sequelize[_0x2613('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2613('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2613('0x1')]},'connectedlinename':{'type':Sequelize[_0x2613('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x2613('0x1')]},'context':{'type':Sequelize[_0x2613('0x1')]},'exten':{'type':Sequelize[_0x2613('0x1')]},'priority':{'type':Sequelize[_0x2613('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x2613('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2613('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2613('0x1')]},'destcalleridname':{'type':Sequelize[_0x2613('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2613('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x2613('0x1')]},'destlanguage':{'type':Sequelize[_0x2613('0x1')]},'destaccountcode':{'type':Sequelize[_0x2613('0x1')]},'destcontext':{'type':Sequelize[_0x2613('0x1')]},'destexten':{'type':Sequelize[_0x2613('0x1')]},'destpriority':{'type':Sequelize[_0x2613('0x1')]},'destuniqueid':{'type':Sequelize[_0x2613('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x2613('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x2613('0x1')]},'transfer':{'type':Sequelize[_0x2613('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2613('0x1')],'comment':_0x2613('0x5')},'transferexten':{'type':Sequelize[_0x2613('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2613('0x1')]},'agententerreason':{'type':Sequelize[_0x2613('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8374=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x51b169,_0x5efbc2){var _0x12605a=function(_0x570f5e){while(--_0x570f5e){_0x51b169['push'](_0x51b169['shift']());}};_0x12605a(++_0x5efbc2);}(_0x8374,0x174));var _0x4837=function(_0x3ac8e0,_0x35293c){_0x3ac8e0=_0x3ac8e0-0x0;var _0x2a719d=_0x8374[_0x3ac8e0];return _0x2a719d;};'use strict';var Sequelize=require(_0x4837('0x0'));module[_0x4837('0x1')]={'type':{'type':Sequelize[_0x4837('0x2')]},'uniqueid':{'type':Sequelize[_0x4837('0x2')]},'calleridnum':{'type':Sequelize[_0x4837('0x2')]},'calleridname':{'type':Sequelize[_0x4837('0x2')]},'queue':{'type':Sequelize[_0x4837('0x2')]},'interface':{'type':Sequelize[_0x4837('0x2')]},'membername':{'type':Sequelize[_0x4837('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4837('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4837('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x4837('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4837('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4837('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4837('0x5')]},'agentacw':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4837('0x5')]},'reason':{'type':Sequelize[_0x4837('0x2')]},'lastevent':{'type':Sequelize[_0x4837('0x2')]},'channel':{'type':Sequelize[_0x4837('0x2')]},'channelstate':{'type':Sequelize[_0x4837('0x5')]},'channelstatedesc':{'type':Sequelize[_0x4837('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4837('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4837('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4837('0x2')]},'priority':{'type':Sequelize[_0x4837('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4837('0x2')]},'destcalleridname':{'type':Sequelize[_0x4837('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4837('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4837('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4837('0x2')]},'destcontext':{'type':Sequelize[_0x4837('0x2')]},'destexten':{'type':Sequelize[_0x4837('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4837('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4837('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4837('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4837('0x2')],'comment':_0x4837('0x6')},'transferexten':{'type':Sequelize[_0x4837('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4837('0x2')]},'agententerreason':{'type':Sequelize[_0x4837('0x5')],'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 f477032..ac0bbd4 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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index bd19c70..b4c8da1 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 _0x3f27=['path','exports','define','VoiceAgentReport','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4a7d9d,_0x374587){var _0x1fc35e=function(_0x42caef){while(--_0x42caef){_0x4a7d9d['push'](_0x4a7d9d['shift']());}};_0x1fc35e(++_0x374587);}(_0x3f27,0x1f4));var _0x73f2=function(_0x35bcc1,_0x3af900){_0x35bcc1=_0x35bcc1-0x0;var _0x19cd90=_0x3f27[_0x35bcc1];return _0x19cd90;};'use strict';var _=require(_0x73f2('0x0'));var util=require(_0x73f2('0x1'));var logger=require(_0x73f2('0x2'))(_0x73f2('0x3'));var moment=require(_0x73f2('0x4'));var BPromise=require('bluebird');var rp=require(_0x73f2('0x5'));var fs=require('fs');var path=require(_0x73f2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x73f2('0x7')]=function(_0x54631b,_0x17f054){return _0x54631b[_0x73f2('0x8')](_0x73f2('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0x73f2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x37cc=['api','moment','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','util','../../config/logger'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x37cc,0x185));var _0xc37c=function(_0x3ce153,_0x2e5ac8){_0x3ce153=_0x3ce153-0x0;var _0x3a3b76=_0x37cc[_0x3ce153];return _0x3a3b76;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var logger=require(_0xc37c('0x2'))(_0xc37c('0x3'));var moment=require(_0xc37c('0x4'));var BPromise=require(_0xc37c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var attributes=require(_0xc37c('0x8'));module[_0xc37c('0x9')]=function(_0x4c9dcd,_0x582100){return _0x4c9dcd[_0xc37c('0xa')](_0xc37c('0xb'),attributes,{'tableName':_0xc37c('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xc37c('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 af21126..602fed8 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 _0x488d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','update','where','lodash','util','randomstring'];(function(_0x3237a4,_0x2bf0e5){var _0x2c0259=function(_0x360407){while(--_0x360407){_0x3237a4['push'](_0x3237a4['shift']());}};_0x2c0259(++_0x2bf0e5);}(_0x488d,0x1ea));var _0xd488=function(_0x1321ff,_0x216c5f){_0x1321ff=_0x1321ff-0x0;var _0x167365=_0x488d[_0x1321ff];return _0x167365;};'use strict';var _=require(_0xd488('0x0'));var util=require(_0xd488('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd488('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd488('0x3'))['db'];var utils=require(_0xd488('0x4'));var logger=require(_0xd488('0x5'))(_0xd488('0x6'));var config=require('../../config/environment');var jayson=require(_0xd488('0x7'));var client=jayson[_0xd488('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4bb5,_0x571fc4,_0x16551a){return new BPromise(function(_0x227492,_0x2371d3){return client['request'](_0x1f4bb5,_0x16551a)[_0xd488('0x9')](function(_0x4cdedd){logger[_0xd488('0xa')](_0xd488('0xb'),_0x571fc4,_0xd488('0xc'));logger[_0xd488('0xd')](_0xd488('0xe'),_0x571fc4,_0xd488('0xc'),JSON[_0xd488('0xf')](_0x4cdedd));if(_0x4cdedd[_0xd488('0x10')]){if(_0x4cdedd[_0xd488('0x10')][_0xd488('0x11')]===0x1f4){logger[_0xd488('0x10')](_0xd488('0xb'),_0x571fc4,_0x4cdedd[_0xd488('0x10')][_0xd488('0x12')]);return _0x2371d3(_0x4cdedd[_0xd488('0x10')][_0xd488('0x12')]);}logger[_0xd488('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x571fc4,_0x4cdedd['error'][_0xd488('0x12')]);return _0x227492(_0x4cdedd['error'][_0xd488('0x12')]);}else{logger[_0xd488('0xa')](_0xd488('0xb'),_0x571fc4,_0xd488('0xc'));_0x227492(_0x4cdedd[_0xd488('0x13')][_0xd488('0x12')]);}})[_0xd488('0x14')](function(_0x30ac43){logger[_0xd488('0x10')](_0xd488('0xb'),_0x571fc4,_0x30ac43);_0x2371d3(_0x30ac43);});});}exports[_0xd488('0x15')]=function(_0x4aea19){var _0x2d8b2e=this;return new Promise(function(_0x1192c5,_0x4cd5c3){return db[_0xd488('0x16')]['create'](_0x4aea19[_0xd488('0x17')],{'raw':_0x4aea19[_0xd488('0x18')]?_0x4aea19[_0xd488('0x18')][_0xd488('0x19')]===undefined?!![]:![]:!![]})[_0xd488('0x9')](function(_0x24b2f6){logger[_0xd488('0xa')](_0xd488('0x15'),_0x4aea19);logger['debug']('CreateVoiceAgentReport',_0x4aea19,JSON[_0xd488('0xf')](_0x24b2f6));_0x1192c5(_0x24b2f6);})[_0xd488('0x14')](function(_0x399293){logger[_0xd488('0x10')](_0xd488('0x15'),_0x399293[_0xd488('0x12')],_0x4aea19);_0x4cd5c3(_0x2d8b2e[_0xd488('0x10')](0x1f4,_0x399293[_0xd488('0x12')]));});});};exports[_0xd488('0x1a')]=function(_0x3d105f){var _0x5166ee=this;return new Promise(function(_0x177fbb,_0x4f5e4b){return db[_0xd488('0x16')][_0xd488('0x1b')](_0x3d105f['body'],{'raw':_0x3d105f[_0xd488('0x18')]?_0x3d105f['options'][_0xd488('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d105f['options']?_0x3d105f['options'][_0xd488('0x1c')]||null:null,'attributes':_0x3d105f[_0xd488('0x18')]?_0x3d105f['options']['attributes']||null:null,'limit':_0x3d105f[_0xd488('0x18')]?_0x3d105f[_0xd488('0x18')]['limit']||null:null})[_0xd488('0x9')](function(_0x41ba89){logger['info'](_0xd488('0x1a'),_0x3d105f);logger[_0xd488('0xd')](_0xd488('0x1a'),_0x3d105f,JSON['stringify'](_0x41ba89));_0x177fbb(_0x41ba89);})['catch'](function(_0x5e53b3){logger['error'](_0xd488('0x1a'),_0x5e53b3['message'],_0x3d105f);_0x4f5e4b(_0x5166ee['error'](0x1f4,_0x5e53b3['message']));});});}; \ No newline at end of file +var _0xed5a=['stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','VoiceAgentReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xed5a,0x1c1));var _0xaed5=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xed5a[_0xb0de07];return _0x4633d8;};'use strict';var _=require(_0xaed5('0x0'));var util=require('util');var moment=require(_0xaed5('0x1'));var BPromise=require(_0xaed5('0x2'));var rs=require(_0xaed5('0x3'));var fs=require('fs');var Redis=require(_0xaed5('0x4'));var db=require(_0xaed5('0x5'))['db'];var utils=require(_0xaed5('0x6'));var logger=require(_0xaed5('0x7'))(_0xaed5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xaed5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26a22a,_0x2078e3,_0x1417af){return new BPromise(function(_0x4b9d24,_0x1652c9){return client[_0xaed5('0xa')](_0x26a22a,_0x1417af)[_0xaed5('0xb')](function(_0x17a4b8){logger[_0xaed5('0xc')](_0xaed5('0xd'),_0x2078e3,_0xaed5('0xe'));logger[_0xaed5('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x2078e3,'request\x20sent',JSON[_0xaed5('0x10')](_0x17a4b8));if(_0x17a4b8[_0xaed5('0x11')]){if(_0x17a4b8['error'][_0xaed5('0x12')]===0x1f4){logger[_0xaed5('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x2078e3,_0x17a4b8['error'][_0xaed5('0x13')]);return _0x1652c9(_0x17a4b8['error'][_0xaed5('0x13')]);}logger[_0xaed5('0x11')](_0xaed5('0xd'),_0x2078e3,_0x17a4b8[_0xaed5('0x11')]['message']);return _0x4b9d24(_0x17a4b8[_0xaed5('0x11')][_0xaed5('0x13')]);}else{logger['info'](_0xaed5('0xd'),_0x2078e3,_0xaed5('0xe'));_0x4b9d24(_0x17a4b8[_0xaed5('0x14')][_0xaed5('0x13')]);}})[_0xaed5('0x15')](function(_0x2c594f){logger['error'](_0xaed5('0xd'),_0x2078e3,_0x2c594f);_0x1652c9(_0x2c594f);});});}exports[_0xaed5('0x16')]=function(_0x2f40b4){var _0x340c96=this;return new Promise(function(_0x5c3562,_0x23c77e){return db['VoiceAgentReport'][_0xaed5('0x17')](_0x2f40b4[_0xaed5('0x18')],{'raw':_0x2f40b4[_0xaed5('0x19')]?_0x2f40b4[_0xaed5('0x19')][_0xaed5('0x1a')]===undefined?!![]:![]:!![]})[_0xaed5('0xb')](function(_0xb3778b){logger[_0xaed5('0xc')](_0xaed5('0x16'),_0x2f40b4);logger[_0xaed5('0xf')](_0xaed5('0x16'),_0x2f40b4,JSON[_0xaed5('0x10')](_0xb3778b));_0x5c3562(_0xb3778b);})[_0xaed5('0x15')](function(_0x77b055){logger[_0xaed5('0x11')](_0xaed5('0x16'),_0x77b055[_0xaed5('0x13')],_0x2f40b4);_0x23c77e(_0x340c96[_0xaed5('0x11')](0x1f4,_0x77b055[_0xaed5('0x13')]));});});};exports[_0xaed5('0x1b')]=function(_0x1b5bde){var _0x4ad738=this;return new Promise(function(_0x1f3323,_0x8c8474){return db[_0xaed5('0x1c')][_0xaed5('0x1d')](_0x1b5bde[_0xaed5('0x18')],{'raw':_0x1b5bde[_0xaed5('0x19')]?_0x1b5bde['options'][_0xaed5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5bde[_0xaed5('0x19')]?_0x1b5bde[_0xaed5('0x19')][_0xaed5('0x1e')]||null:null,'attributes':_0x1b5bde[_0xaed5('0x19')]?_0x1b5bde[_0xaed5('0x19')]['attributes']||null:null,'limit':_0x1b5bde[_0xaed5('0x19')]?_0x1b5bde['options']['limit']||null:null})[_0xaed5('0xb')](function(_0x39e738){logger[_0xaed5('0xc')](_0xaed5('0x1b'),_0x1b5bde);logger[_0xaed5('0xf')]('UpdateVoiceAgentReport',_0x1b5bde,JSON[_0xaed5('0x10')](_0x39e738));_0x1f3323(_0x39e738);})[_0xaed5('0x15')](function(_0x35d526){logger[_0xaed5('0x11')](_0xaed5('0x1b'),_0x35d526['message'],_0x1b5bde);_0x8c8474(_0x4ad738['error'](0x1f4,_0x35d526[_0xaed5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 3ce78a1..aedb291 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 _0xae24=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0xae24,0x182));var _0x4ae2=function(_0x3a2395,_0x2cc594){_0x3a2395=_0x3a2395-0x0;var _0xce6c8c=_0xae24[_0x3a2395];return _0xce6c8c;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['update']);router[_0x4ae2('0xf')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0x10')]=router; \ No newline at end of file +var _0x826a=['post','create','put','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x543409,_0x3f5bae){var _0x3f4e23=function(_0x59418c){while(--_0x59418c){_0x543409['push'](_0x543409['shift']());}};_0x3f4e23(++_0x3f5bae);}(_0x826a,0x1aa));var _0xa826=function(_0x280f09,_0x2eb5fb){_0x280f09=_0x280f09-0x0;var _0x1d2b81=_0x826a[_0x280f09];return _0x1d2b81;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var fs_extra=require(_0xa826('0x3'));var auth=require(_0xa826('0x4'));var interaction=require(_0xa826('0x5'));var config=require('../../config/environment');var controller=require(_0xa826('0x6'));router[_0xa826('0x7')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0x9')]);router[_0xa826('0x7')](_0xa826('0xa'),auth[_0xa826('0x8')](),controller[_0xa826('0xb')]);router[_0xa826('0x7')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0xd')]);router[_0xa826('0xe')]('/',auth[_0xa826('0x8')](),controller[_0xa826('0xf')]);router[_0xa826('0x10')]('/:id',auth[_0xa826('0x8')](),controller['update']);router[_0xa826('0x11')](_0xa826('0xc'),auth[_0xa826('0x8')](),controller[_0xa826('0x12')]);module[_0xa826('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 d51ca54..722428c 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 _0x223e=['INTEGER','sequelize','exports','STRING','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x49b0ed,_0x16efec){var _0x11e03f=function(_0xcbeac){while(--_0xcbeac){_0x49b0ed['push'](_0x49b0ed['shift']());}};_0x11e03f(++_0x16efec);}(_0x223e,0x1b1));var _0xe223=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x223e[_0x41d432];return _0x1650f9;};'use strict';var Sequelize=require(_0xe223('0x0'));module[_0xe223('0x1')]={'uniqueid':{'type':Sequelize[_0xe223('0x2')]},'type':{'type':Sequelize['ENUM'](_0xe223('0x3'),_0xe223('0x4'),_0xe223('0x5'),_0xe223('0x6'),_0xe223('0x7'),_0xe223('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xe223('0x2')]},'destination':{'type':Sequelize[_0xe223('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe223('0x2')]},'channel':{'type':Sequelize[_0xe223('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xe223('0x2')]},'lastdata':{'type':Sequelize[_0xe223('0x9')]},'starttime':{'type':Sequelize[_0xe223('0xa')]},'systemanswertime':{'type':Sequelize[_0xe223('0xa')]},'answertime':{'type':Sequelize[_0xe223('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xe223('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xe223('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe223('0x2')]},'amaflags':{'type':Sequelize[_0xe223('0x2')]},'userfield':{'type':Sequelize[_0xe223('0x2')]},'userDisposition':{'type':Sequelize[_0xe223('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe223('0x2')]},'note':{'type':Sequelize[_0xe223('0x2')]},'prefix':{'type':Sequelize[_0xe223('0x2')]},'routeid':{'type':Sequelize[_0xe223('0xb')]},'sipcallid':{'type':Sequelize[_0xe223('0x2')]}}; \ No newline at end of file +var _0x9421=['exports','STRING','ENUM','inbound','outbound','inbound-fax','DATE','INTEGER','sequelize'];(function(_0x5cffce,_0xa06ef4){var _0x1a0a52=function(_0x146c78){while(--_0x146c78){_0x5cffce['push'](_0x5cffce['shift']());}};_0x1a0a52(++_0xa06ef4);}(_0x9421,0x155));var _0x1942=function(_0x92b418,_0x9ac1f8){_0x92b418=_0x92b418-0x0;var _0xbf931c=_0x9421[_0x92b418];return _0xbf931c;};'use strict';var Sequelize=require(_0x1942('0x0'));module[_0x1942('0x1')]={'uniqueid':{'type':Sequelize[_0x1942('0x2')]},'type':{'type':Sequelize[_0x1942('0x3')](_0x1942('0x4'),'internal',_0x1942('0x5'),_0x1942('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x1942('0x2')]},'accountcode':{'type':Sequelize[_0x1942('0x2')]},'source':{'type':Sequelize[_0x1942('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x1942('0x2')]},'callerid':{'type':Sequelize[_0x1942('0x2')]},'channel':{'type':Sequelize[_0x1942('0x2')]},'destinationchannel':{'type':Sequelize[_0x1942('0x2')]},'lastapplication':{'type':Sequelize[_0x1942('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x1942('0x7')]},'systemanswertime':{'type':Sequelize[_0x1942('0x7')]},'answertime':{'type':Sequelize[_0x1942('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x1942('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1942('0x2')]},'amaflags':{'type':Sequelize[_0x1942('0x2')]},'userfield':{'type':Sequelize[_0x1942('0x2')]},'userDisposition':{'type':Sequelize[_0x1942('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x1942('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x1942('0x2')]},'note':{'type':Sequelize[_0x1942('0x2')]},'prefix':{'type':Sequelize[_0x1942('0x2')]},'routeid':{'type':Sequelize[_0x1942('0x8')]},'sipcallid':{'type':Sequelize[_0x1942('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 18282f3..601e855 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x2ef3,0xba));var _0x32ef=function(_0x527b37,_0x4da6e7){_0x527b37=_0x527b37-0x0;var _0x13e38f=_0x2ef3[_0x527b37];return _0x13e38f;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x46b216,_0x5d9ba0){var _0x143358=function(_0x2a96f4){while(--_0x2a96f4){_0x46b216['push'](_0x46b216['shift']());}};_0x143358(++_0x5d9ba0);}(_0xdb28,0x106));var _0x8db2=function(_0x256029,_0xb0e48c){_0x256029=_0x256029-0x0;var _0x3fc4d9=_0xdb28[_0x256029];return _0x3fc4d9;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 7c36026..3785dc3 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 _0x821e=['moment','bluebird','path','../../config/environment','./voiceCallReport.attributes','exports','report_call','uniqueid','util','../../config/logger'];(function(_0x11927f,_0x59ee62){var _0x23ae59=function(_0x138ddf){while(--_0x138ddf){_0x11927f['push'](_0x11927f['shift']());}};_0x23ae59(++_0x59ee62);}(_0x821e,0x76));var _0xe821=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x821e[_0x40d8d7];return _0x3454cc;};'use strict';var _=require('lodash');var util=require(_0xe821('0x0'));var logger=require(_0xe821('0x1'))('api');var moment=require(_0xe821('0x2'));var BPromise=require(_0xe821('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe821('0x4'));var rimraf=require('rimraf');var config=require(_0xe821('0x5'));var attributes=require(_0xe821('0x6'));module[_0xe821('0x7')]=function(_0x467c57,_0x4c5a9b){return _0x467c57['define']('VoiceCallReport',attributes,{'tableName':_0xe821('0x8'),'paranoid':![],'indexes':[{'fields':[_0xe821('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1836=['path','rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fd441,_0x2629bf){var _0x411a91=function(_0x5d14e3){while(--_0x5d14e3){_0x1fd441['push'](_0x1fd441['shift']());}};_0x411a91(++_0x2629bf);}(_0x1836,0x1b4));var _0x6183=function(_0x35e647,_0x5217a5){_0x35e647=_0x35e647-0x0;var _0x18c2ac=_0x1836[_0x35e647];return _0x18c2ac;};'use strict';var _=require('lodash');var util=require(_0x6183('0x0'));var logger=require(_0x6183('0x1'))(_0x6183('0x2'));var moment=require(_0x6183('0x3'));var BPromise=require(_0x6183('0x4'));var rp=require(_0x6183('0x5'));var fs=require('fs');var path=require(_0x6183('0x6'));var rimraf=require(_0x6183('0x7'));var config=require(_0x6183('0x8'));var attributes=require(_0x6183('0x9'));module['exports']=function(_0x1f5252,_0x531464){return _0x1f5252['define'](_0x6183('0xa'),attributes,{'tableName':_0x6183('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6183('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 3ae1914..8cd80a1 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 _0xcf8a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','where','attributes','limit','include','model','map','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','body','raw','update','UpdateVoiceCallReport','lodash','util','moment'];(function(_0x5a9310,_0x27a812){var _0x374858=function(_0x2f763a){while(--_0x2f763a){_0x5a9310['push'](_0x5a9310['shift']());}};_0x374858(++_0x27a812);}(_0xcf8a,0x1cb));var _0xacf8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcf8a[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xacf8('0x0'));var util=require(_0xacf8('0x1'));var moment=require(_0xacf8('0x2'));var BPromise=require(_0xacf8('0x3'));var rs=require(_0xacf8('0x4'));var fs=require('fs');var Redis=require(_0xacf8('0x5'));var db=require(_0xacf8('0x6'))['db'];var utils=require(_0xacf8('0x7'));var logger=require('../../config/logger')(_0xacf8('0x8'));var config=require(_0xacf8('0x9'));var jayson=require(_0xacf8('0xa'));var client=jayson[_0xacf8('0xb')][_0xacf8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a1a41,_0x583e8b,_0x4e8e53){return new BPromise(function(_0xf4a074,_0x4896f8){return client[_0xacf8('0xd')](_0x1a1a41,_0x4e8e53)[_0xacf8('0xe')](function(_0xacad53){logger[_0xacf8('0xf')](_0xacf8('0x10'),_0x583e8b,_0xacf8('0x11'));logger[_0xacf8('0x12')](_0xacf8('0x13'),_0x583e8b,'request\x20sent',JSON[_0xacf8('0x14')](_0xacad53));if(_0xacad53[_0xacf8('0x15')]){if(_0xacad53[_0xacf8('0x15')][_0xacf8('0x16')]===0x1f4){logger['error'](_0xacf8('0x10'),_0x583e8b,_0xacad53['error']['message']);return _0x4896f8(_0xacad53[_0xacf8('0x15')][_0xacf8('0x17')]);}logger[_0xacf8('0x15')](_0xacf8('0x10'),_0x583e8b,_0xacad53[_0xacf8('0x15')][_0xacf8('0x17')]);return _0xf4a074(_0xacad53[_0xacf8('0x15')][_0xacf8('0x17')]);}else{logger[_0xacf8('0xf')](_0xacf8('0x10'),_0x583e8b,_0xacf8('0x11'));_0xf4a074(_0xacad53[_0xacf8('0x18')][_0xacf8('0x17')]);}})[_0xacf8('0x19')](function(_0x46e9fd){logger[_0xacf8('0x15')](_0xacf8('0x10'),_0x583e8b,_0x46e9fd);_0x4896f8(_0x46e9fd);});});}exports['GetVoiceCallReport']=function(_0x134172){var _0x2a6a33=this;return new Promise(function(_0xe5812,_0x1fd240){return db['VoiceCallReport'][_0xacf8('0x1a')]({'raw':_0x134172[_0xacf8('0x1b')]?_0x134172[_0xacf8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x134172[_0xacf8('0x1b')]?_0x134172['options'][_0xacf8('0x1c')]||null:null,'attributes':_0x134172['options']?_0x134172['options'][_0xacf8('0x1d')]||null:null,'limit':_0x134172[_0xacf8('0x1b')]?_0x134172[_0xacf8('0x1b')][_0xacf8('0x1e')]||null:null,'include':_0x134172[_0xacf8('0x1b')]?_0x134172['options'][_0xacf8('0x1f')]?_['map'](_0x134172[_0xacf8('0x1b')][_0xacf8('0x1f')],function(_0x4886be){return{'model':db[_0x4886be[_0xacf8('0x20')]],'as':_0x4886be['as'],'attributes':_0x4886be[_0xacf8('0x1d')],'include':_0x4886be[_0xacf8('0x1f')]?_[_0xacf8('0x21')](_0x4886be[_0xacf8('0x1f')],function(_0x574abc){return{'model':db[_0x574abc[_0xacf8('0x20')]],'as':_0x574abc['as'],'attributes':_0x574abc[_0xacf8('0x1d')],'include':_0x574abc['include']?_[_0xacf8('0x21')](_0x574abc[_0xacf8('0x1f')],function(_0x410198){return{'model':db[_0x410198[_0xacf8('0x20')]],'as':_0x410198['as'],'attributes':_0x410198[_0xacf8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xacf8('0xe')](function(_0x24952c){logger['info']('GetVoiceCallReport',_0x134172);logger[_0xacf8('0x12')](_0xacf8('0x22'),_0x134172,JSON[_0xacf8('0x14')](_0x24952c));_0xe5812(_0x24952c);})[_0xacf8('0x19')](function(_0x3edde3){logger['error']('GetVoiceCallReport',_0x3edde3[_0xacf8('0x17')],_0x134172);_0x1fd240(_0x2a6a33[_0xacf8('0x15')](0x1f4,_0x3edde3[_0xacf8('0x17')]));});});};exports[_0xacf8('0x23')]=function(_0x5343b3){var _0x3e5989=this;return new Promise(function(_0x318ab6,_0x1107bb){return db[_0xacf8('0x24')][_0xacf8('0x25')](_0x5343b3[_0xacf8('0x26')],{'raw':_0x5343b3[_0xacf8('0x1b')]?_0x5343b3[_0xacf8('0x1b')][_0xacf8('0x27')]===undefined?!![]:![]:!![]})['then'](function(_0x1e2361){logger[_0xacf8('0xf')](_0xacf8('0x23'),_0x5343b3);logger[_0xacf8('0x12')](_0xacf8('0x23'),_0x5343b3,JSON['stringify'](_0x1e2361));_0x318ab6(_0x1e2361);})[_0xacf8('0x19')](function(_0x3f7d9d){logger[_0xacf8('0x15')](_0xacf8('0x23'),_0x3f7d9d['message'],_0x5343b3);_0x1107bb(_0x3e5989[_0xacf8('0x15')](0x1f4,_0x3f7d9d[_0xacf8('0x17')]));});});};exports['UpdateVoiceCallReport']=function(_0x16c0dd){var _0x94c972=this;return new Promise(function(_0x125e87,_0x1b74d5){return db['VoiceCallReport'][_0xacf8('0x28')](_0x16c0dd['body'],{'raw':_0x16c0dd[_0xacf8('0x1b')]?_0x16c0dd['options'][_0xacf8('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c0dd[_0xacf8('0x1b')]?_0x16c0dd['options']['where']||null:null,'attributes':_0x16c0dd[_0xacf8('0x1b')]?_0x16c0dd[_0xacf8('0x1b')][_0xacf8('0x1d')]||null:null,'limit':_0x16c0dd[_0xacf8('0x1b')]?_0x16c0dd[_0xacf8('0x1b')]['limit']||null:null})[_0xacf8('0xe')](function(_0x4c636e){logger['info']('UpdateVoiceCallReport',_0x16c0dd);logger[_0xacf8('0x12')](_0xacf8('0x29'),_0x16c0dd,JSON[_0xacf8('0x14')](_0x4c636e));_0x125e87(_0x4c636e);})[_0xacf8('0x19')](function(_0x22527e){logger[_0xacf8('0x15')]('UpdateVoiceCallReport',_0x22527e[_0xacf8('0x17')],_0x16c0dd);_0x1b74d5(_0x94c972[_0xacf8('0x15')](0x1f4,_0x22527e[_0xacf8('0x17')]));});});}; \ No newline at end of file +var _0xb628=['jayson/promise','client','request','info','request\x20sent','debug','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','limit','map','model','attributes','include','then','CreateVoiceCallReport','body','UpdateVoiceCallReport','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2ddd52,_0x4e3b17){var _0x4bb4ec=function(_0x41905f){while(--_0x41905f){_0x2ddd52['push'](_0x2ddd52['shift']());}};_0x4bb4ec(++_0x4e3b17);}(_0xb628,0x10f));var _0x8b62=function(_0x25b589,_0xf300f9){_0x25b589=_0x25b589-0x0;var _0x5f562f=_0xb628[_0x25b589];return _0x5f562f;};'use strict';var _=require(_0x8b62('0x0'));var util=require('util');var moment=require(_0x8b62('0x1'));var BPromise=require(_0x8b62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b62('0x3'));var db=require(_0x8b62('0x4'))['db'];var utils=require(_0x8b62('0x5'));var logger=require(_0x8b62('0x6'))(_0x8b62('0x7'));var config=require(_0x8b62('0x8'));var jayson=require(_0x8b62('0x9'));var client=jayson[_0x8b62('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14ce29,_0x4334e2,_0x25819b){return new BPromise(function(_0x38939c,_0x5a9464){return client[_0x8b62('0xb')](_0x14ce29,_0x25819b)['then'](function(_0x5b54ea){logger[_0x8b62('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x4334e2,_0x8b62('0xd'));logger[_0x8b62('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x4334e2,_0x8b62('0xd'),JSON[_0x8b62('0xf')](_0x5b54ea));if(_0x5b54ea['error']){if(_0x5b54ea[_0x8b62('0x10')]['code']===0x1f4){logger['error'](_0x8b62('0x11'),_0x4334e2,_0x5b54ea['error'][_0x8b62('0x12')]);return _0x5a9464(_0x5b54ea[_0x8b62('0x10')]['message']);}logger[_0x8b62('0x10')](_0x8b62('0x11'),_0x4334e2,_0x5b54ea[_0x8b62('0x10')][_0x8b62('0x12')]);return _0x38939c(_0x5b54ea[_0x8b62('0x10')]['message']);}else{logger['info'](_0x8b62('0x11'),_0x4334e2,_0x8b62('0xd'));_0x38939c(_0x5b54ea[_0x8b62('0x13')][_0x8b62('0x12')]);}})[_0x8b62('0x14')](function(_0x12e2bd){logger['error'](_0x8b62('0x11'),_0x4334e2,_0x12e2bd);_0x5a9464(_0x12e2bd);});});}exports[_0x8b62('0x15')]=function(_0x37bc2b){var _0x232d0b=this;return new Promise(function(_0x355ab0,_0x599427){return db[_0x8b62('0x16')][_0x8b62('0x17')]({'raw':_0x37bc2b[_0x8b62('0x18')]?_0x37bc2b[_0x8b62('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x37bc2b[_0x8b62('0x18')]?_0x37bc2b[_0x8b62('0x18')]['where']||null:null,'attributes':_0x37bc2b[_0x8b62('0x18')]?_0x37bc2b['options']['attributes']||null:null,'limit':_0x37bc2b[_0x8b62('0x18')]?_0x37bc2b[_0x8b62('0x18')][_0x8b62('0x19')]||null:null,'include':_0x37bc2b[_0x8b62('0x18')]?_0x37bc2b[_0x8b62('0x18')]['include']?_[_0x8b62('0x1a')](_0x37bc2b[_0x8b62('0x18')]['include'],function(_0x73398){return{'model':db[_0x73398[_0x8b62('0x1b')]],'as':_0x73398['as'],'attributes':_0x73398[_0x8b62('0x1c')],'include':_0x73398[_0x8b62('0x1d')]?_[_0x8b62('0x1a')](_0x73398[_0x8b62('0x1d')],function(_0x90b1c2){return{'model':db[_0x90b1c2[_0x8b62('0x1b')]],'as':_0x90b1c2['as'],'attributes':_0x90b1c2[_0x8b62('0x1c')],'include':_0x90b1c2['include']?_['map'](_0x90b1c2[_0x8b62('0x1d')],function(_0x35c8bc){return{'model':db[_0x35c8bc['model']],'as':_0x35c8bc['as'],'attributes':_0x35c8bc[_0x8b62('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8b62('0x1e')](function(_0x27e5bf){logger['info'](_0x8b62('0x15'),_0x37bc2b);logger[_0x8b62('0xe')](_0x8b62('0x15'),_0x37bc2b,JSON[_0x8b62('0xf')](_0x27e5bf));_0x355ab0(_0x27e5bf);})[_0x8b62('0x14')](function(_0x3704d1){logger['error'](_0x8b62('0x15'),_0x3704d1[_0x8b62('0x12')],_0x37bc2b);_0x599427(_0x232d0b[_0x8b62('0x10')](0x1f4,_0x3704d1[_0x8b62('0x12')]));});});};exports[_0x8b62('0x1f')]=function(_0x1b9e25){var _0x5f3e58=this;return new Promise(function(_0x8ee443,_0x4f0020){return db['VoiceCallReport']['create'](_0x1b9e25[_0x8b62('0x20')],{'raw':_0x1b9e25[_0x8b62('0x18')]?_0x1b9e25[_0x8b62('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3617b0){logger['info']('CreateVoiceCallReport',_0x1b9e25);logger[_0x8b62('0xe')](_0x8b62('0x1f'),_0x1b9e25,JSON[_0x8b62('0xf')](_0x3617b0));_0x8ee443(_0x3617b0);})[_0x8b62('0x14')](function(_0x1f6942){logger[_0x8b62('0x10')]('CreateVoiceCallReport',_0x1f6942[_0x8b62('0x12')],_0x1b9e25);_0x4f0020(_0x5f3e58[_0x8b62('0x10')](0x1f4,_0x1f6942[_0x8b62('0x12')]));});});};exports[_0x8b62('0x21')]=function(_0x52a7cb){var _0x43a71c=this;return new Promise(function(_0xec97fe,_0x2b53bc){return db[_0x8b62('0x16')]['update'](_0x52a7cb['body'],{'raw':_0x52a7cb[_0x8b62('0x18')]?_0x52a7cb[_0x8b62('0x18')][_0x8b62('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52a7cb[_0x8b62('0x18')]?_0x52a7cb['options']['where']||null:null,'attributes':_0x52a7cb[_0x8b62('0x18')]?_0x52a7cb[_0x8b62('0x18')][_0x8b62('0x1c')]||null:null,'limit':_0x52a7cb[_0x8b62('0x18')]?_0x52a7cb[_0x8b62('0x18')][_0x8b62('0x19')]||null:null})[_0x8b62('0x1e')](function(_0x45d388){logger[_0x8b62('0xc')]('UpdateVoiceCallReport',_0x52a7cb);logger[_0x8b62('0xe')]('UpdateVoiceCallReport',_0x52a7cb,JSON['stringify'](_0x45d388));_0xec97fe(_0x45d388);})[_0x8b62('0x14')](function(_0x593c83){logger[_0x8b62('0x10')]('UpdateVoiceCallReport',_0x593c83[_0x8b62('0x12')],_0x52a7cb);_0x2b53bc(_0x43a71c[_0x8b62('0x10')](0x1f4,_0x593c83[_0x8b62('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e1bd395..0f7df45 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 _0x8412=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x226427,_0x55662b){var _0x53d95c=function(_0x1dd579){while(--_0x1dd579){_0x226427['push'](_0x226427['shift']());}};_0x53d95c(++_0x55662b);}(_0x8412,0x12e));var _0x2841=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x8412[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x2841('0x0'));var util=require(_0x2841('0x1'));var path=require(_0x2841('0x2'));var timeout=require(_0x2841('0x3'));var express=require(_0x2841('0x4'));var router=express[_0x2841('0x5')]();var fs_extra=require(_0x2841('0x6'));var auth=require(_0x2841('0x7'));var interaction=require(_0x2841('0x8'));var config=require(_0x2841('0x9'));var controller=require(_0x2841('0xa'));router[_0x2841('0xb')]('/',auth['isAuthenticated'](),controller[_0x2841('0xc')]);router[_0x2841('0xb')](_0x2841('0xd'),auth[_0x2841('0xe')](),controller[_0x2841('0xf')]);router[_0x2841('0x10')]('/',auth['isAuthenticated'](),controller[_0x2841('0x11')]);router['put'](_0x2841('0xd'),auth[_0x2841('0xe')](),controller[_0x2841('0x12')]);router[_0x2841('0x13')](_0x2841('0xd'),auth['isAuthenticated'](),controller[_0x2841('0x14')]);module[_0x2841('0x15')]=router; \ No newline at end of file +var _0xbc6e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4f107c,_0x3288a3){var _0x5e495c=function(_0x3e2256){while(--_0x3e2256){_0x4f107c['push'](_0x4f107c['shift']());}};_0x5e495c(++_0x3288a3);}(_0xbc6e,0x8c));var _0xebc6=function(_0xea5ca5,_0x4bc5c2){_0xea5ca5=_0xea5ca5-0x0;var _0x470205=_0xbc6e[_0xea5ca5];return _0x470205;};'use strict';var multer=require(_0xebc6('0x0'));var util=require(_0xebc6('0x1'));var path=require(_0xebc6('0x2'));var timeout=require(_0xebc6('0x3'));var express=require(_0xebc6('0x4'));var router=express[_0xebc6('0x5')]();var fs_extra=require(_0xebc6('0x6'));var auth=require(_0xebc6('0x7'));var interaction=require(_0xebc6('0x8'));var config=require(_0xebc6('0x9'));var controller=require('./voiceChanSpy.controller');router[_0xebc6('0xa')]('/',auth['isAuthenticated'](),controller[_0xebc6('0xb')]);router['get']('/:id',auth[_0xebc6('0xc')](),controller['show']);router[_0xebc6('0xd')]('/',auth[_0xebc6('0xc')](),controller[_0xebc6('0xe')]);router[_0xebc6('0xf')](_0xebc6('0x10'),auth[_0xebc6('0xc')](),controller[_0xebc6('0x11')]);router[_0xebc6('0x12')](_0xebc6('0x10'),auth[_0xebc6('0xc')](),controller[_0xebc6('0x13')]);module[_0xebc6('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index f9b63e7..7cc49b5 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 _0xd41f=['STRING','options','split','BOOLEAN','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd41f,0xa6));var _0xfd41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd41f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xfd41('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xfd41('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xfd41('0x2')],'set':function(_0x227f8c){this['setDataValue'](_0xfd41('0x3'),_0x227f8c?_0x227f8c['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this['getDataValue'](_0xfd41('0x3'))[_0xfd41('0x4')](''):[];}},'auth':{'type':Sequelize[_0xfd41('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0xfd41('0x2')]},'record':{'type':Sequelize[_0xfd41('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfd41('0x2')]}}; \ No newline at end of file +var _0x368e=['join','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x368e,0x163));var _0xe368=function(_0x5f002d,_0x1b9dc8){_0x5f002d=_0x5f002d-0x0;var _0x544598=_0x368e[_0x5f002d];return _0x544598;};'use strict';var Sequelize=require(_0xe368('0x0'));module[_0xe368('0x1')]={'name':{'type':Sequelize[_0xe368('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xe368('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xe368('0x2')],'set':function(_0x21e623){this[_0xe368('0x4')]('options',_0x21e623?_0x21e623[_0xe368('0x5')](''):[]);},'get':function(){return this[_0xe368('0x6')](_0xe368('0x7'))?this['getDataValue'](_0xe368('0x7'))[_0xe368('0x8')](''):[];}},'auth':{'type':Sequelize[_0xe368('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xe368('0x2')]},'record':{'type':Sequelize[_0xe368('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe368('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8485150..c583d87 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 _0xdfe9=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','VoiceChanSpy','rawAttributes','type','key','query','keys','intersection'];(function(_0x34473f,_0x2b9c5c){var _0x25cf6f=function(_0x4214a2){while(--_0x4214a2){_0x34473f['push'](_0x34473f['shift']());}};_0x25cf6f(++_0x2b9c5c);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x8343f0,_0x292f8a){_0x8343f0=_0x8343f0-0x0;var _0x1f57d3=_0xdfe9[_0x8343f0];return _0x1f57d3;};'use strict';var emlformat=require(_0x9dfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9dfe('0x2'));var BPromise=require(_0x9dfe('0x3'));var Mustache=require(_0x9dfe('0x4'));var util=require(_0x9dfe('0x5'));var path=require(_0x9dfe('0x6'));var sox=require(_0x9dfe('0x7'));var csv=require(_0x9dfe('0x8'));var ejs=require(_0x9dfe('0x9'));var fs=require('fs');var fs_extra=require(_0x9dfe('0xa'));var _=require(_0x9dfe('0xb'));var squel=require(_0x9dfe('0xc'));var crypto=require('crypto');var jsforce=require(_0x9dfe('0xd'));var deskjs=require(_0x9dfe('0xe'));var toCsv=require(_0x9dfe('0x8'));var querystring=require(_0x9dfe('0xf'));var Papa=require(_0x9dfe('0x10'));var Redis=require(_0x9dfe('0x11'));var authService=require(_0x9dfe('0x12'));var qs=require(_0x9dfe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dfe('0x14'));var logger=require(_0x9dfe('0x15'))(_0x9dfe('0x16'));var utils=require(_0x9dfe('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9dfe('0x18'))['db'];function respondWithStatusCode(_0x1f3678,_0x4da42d){_0x4da42d=_0x4da42d||0xcc;return function(_0x547ae1){if(_0x547ae1){return _0x1f3678['sendStatus'](_0x4da42d);}return _0x1f3678[_0x9dfe('0x19')](_0x4da42d)[_0x9dfe('0x1a')]();};}function respondWithResult(_0x2a7734,_0x12794d){_0x12794d=_0x12794d||0xc8;return function(_0x189edc){if(_0x189edc){return _0x2a7734[_0x9dfe('0x19')](_0x12794d)[_0x9dfe('0x1b')](_0x189edc);}};}function respondWithFilteredResult(_0x7e1918,_0x316205){return function(_0x56c864){if(_0x56c864){var _0x538be3=typeof _0x316205[_0x9dfe('0x1c')]==='undefined'&&typeof _0x316205[_0x9dfe('0x1d')]===_0x9dfe('0x1e');var _0xc5e804=_0x56c864[_0x9dfe('0x1f')];var _0x15e32b=_0x538be3?0x0:_0x316205[_0x9dfe('0x1c')];var _0x5c7158=_0x538be3?_0x56c864[_0x9dfe('0x1f')]:_0x316205[_0x9dfe('0x1c')]+_0x316205[_0x9dfe('0x1d')];var _0x145e4d;if(_0x5c7158>=_0xc5e804){_0x5c7158=_0xc5e804;_0x145e4d=0xc8;}else{_0x145e4d=0xce;}_0x7e1918[_0x9dfe('0x19')](_0x145e4d);return _0x7e1918[_0x9dfe('0x20')](_0x9dfe('0x21'),_0x15e32b+'-'+_0x5c7158+'/'+_0xc5e804)[_0x9dfe('0x1b')](_0x56c864);}return null;};}function patchUpdates(_0x439cd4){return function(_0x1cf33d){try{jsonpatch[_0x9dfe('0x22')](_0x1cf33d,_0x439cd4,!![]);}catch(_0x2971b){return BPromise[_0x9dfe('0x23')](_0x2971b);}return _0x1cf33d[_0x9dfe('0x24')]();};}function saveUpdates(_0x54ee52,_0x484f22){return function(_0x35cb5c){if(_0x35cb5c){return _0x35cb5c[_0x9dfe('0x25')](_0x54ee52)[_0x9dfe('0x26')](function(_0x12ef2a){return _0x12ef2a;});}return null;};}function removeEntity(_0x30f0cd,_0x3da663){return function(_0x3354b7){if(_0x3354b7){return _0x3354b7[_0x9dfe('0x27')]()[_0x9dfe('0x26')](function(){var _0xf7fc28=_0x3354b7[_0x9dfe('0x28')]({'plain':!![]});var _0x512599='ChanSpies';return db[_0x9dfe('0x29')][_0x9dfe('0x27')]({'where':{'type':_0x512599,'resourceId':_0xf7fc28['id']}})['then'](function(){return _0x3354b7;});})[_0x9dfe('0x26')](function(){_0x30f0cd[_0x9dfe('0x19')](0xcc)[_0x9dfe('0x1a')]();});}};}function handleEntityNotFound(_0x5bb850,_0x2fba44){return function(_0xac36fc){if(!_0xac36fc){_0x5bb850[_0x9dfe('0x2a')](0x194);}return _0xac36fc;};}function handleError(_0x29a127,_0x2c8a09){_0x2c8a09=_0x2c8a09||0x1f4;return function(_0x4ae7ad){logger[_0x9dfe('0x2b')](_0x4ae7ad['stack']);if(_0x4ae7ad[_0x9dfe('0x2c')]){delete _0x4ae7ad[_0x9dfe('0x2c')];}_0x29a127[_0x9dfe('0x19')](_0x2c8a09)[_0x9dfe('0x2d')](_0x4ae7ad);};}exports[_0x9dfe('0x2e')]=function(_0x10c2d4,_0x3bf281){var _0x222cea={},_0x4de29c={},_0x580bd4={'count':0x0,'rows':[]};var _0x458521=_['map'](db[_0x9dfe('0x2f')][_0x9dfe('0x30')],function(_0x2fe43e){return{'name':_0x2fe43e['fieldName'],'type':_0x2fe43e[_0x9dfe('0x31')][_0x9dfe('0x32')]};});_0x4de29c['model']=_['map'](_0x458521,_0x9dfe('0x2c'));_0x4de29c[_0x9dfe('0x33')]=_[_0x9dfe('0x34')](_0x10c2d4[_0x9dfe('0x33')]);_0x4de29c['filters']=_[_0x9dfe('0x35')](_0x4de29c[_0x9dfe('0x36')],_0x4de29c[_0x9dfe('0x33')]);_0x222cea[_0x9dfe('0x37')]=_[_0x9dfe('0x35')](_0x4de29c['model'],qs[_0x9dfe('0x38')](_0x10c2d4[_0x9dfe('0x33')][_0x9dfe('0x38')]));_0x222cea[_0x9dfe('0x37')]=_0x222cea[_0x9dfe('0x37')][_0x9dfe('0x39')]?_0x222cea[_0x9dfe('0x37')]:_0x4de29c['model'];if(!_0x10c2d4[_0x9dfe('0x33')][_0x9dfe('0x3a')](_0x9dfe('0x3b'))){_0x222cea[_0x9dfe('0x1d')]=qs[_0x9dfe('0x1d')](_0x10c2d4['query'][_0x9dfe('0x1d')]);_0x222cea[_0x9dfe('0x1c')]=qs['offset'](_0x10c2d4[_0x9dfe('0x33')]['offset']);}_0x222cea[_0x9dfe('0x3c')]=qs[_0x9dfe('0x3d')](_0x10c2d4[_0x9dfe('0x33')][_0x9dfe('0x3d')]);_0x222cea[_0x9dfe('0x3e')]=qs['filters'](_['pick'](_0x10c2d4[_0x9dfe('0x33')],_0x4de29c[_0x9dfe('0x3f')]),_0x458521);if(_0x10c2d4['query'][_0x9dfe('0x40')]){_0x222cea['where']=_[_0x9dfe('0x41')](_0x222cea['where'],{'$or':_['map'](_0x458521,function(_0x5cd65d){if(_0x5cd65d[_0x9dfe('0x31')]!=='VIRTUAL'){var _0x4a1c6f={};_0x4a1c6f[_0x5cd65d[_0x9dfe('0x2c')]]={'$like':'%'+_0x10c2d4['query'][_0x9dfe('0x40')]+'%'};return _0x4a1c6f;}})});}_0x222cea=_[_0x9dfe('0x41')]({},_0x222cea,_0x10c2d4[_0x9dfe('0x42')]);var _0x207454={'where':_0x222cea[_0x9dfe('0x3e')]};return db[_0x9dfe('0x2f')][_0x9dfe('0x1f')](_0x207454)[_0x9dfe('0x26')](function(_0x340f34){_0x580bd4[_0x9dfe('0x1f')]=_0x340f34;if(_0x10c2d4[_0x9dfe('0x33')][_0x9dfe('0x43')]){_0x222cea[_0x9dfe('0x44')]=[{'all':!![]}];}return db[_0x9dfe('0x2f')][_0x9dfe('0x45')](_0x222cea);})[_0x9dfe('0x26')](function(_0x5dfa4b){_0x580bd4[_0x9dfe('0x46')]=_0x5dfa4b;return _0x580bd4;})[_0x9dfe('0x26')](respondWithFilteredResult(_0x3bf281,_0x222cea))[_0x9dfe('0x47')](handleError(_0x3bf281,null));};exports['show']=function(_0x4a17f5,_0x27fa70){var _0x551bbb={'raw':![],'where':{'id':_0x4a17f5[_0x9dfe('0x48')]['id']}},_0x50e327={};_0x50e327[_0x9dfe('0x36')]=_[_0x9dfe('0x34')](db[_0x9dfe('0x2f')][_0x9dfe('0x30')]);_0x50e327[_0x9dfe('0x33')]=_[_0x9dfe('0x34')](_0x4a17f5[_0x9dfe('0x33')]);_0x50e327[_0x9dfe('0x3f')]=_[_0x9dfe('0x35')](_0x50e327['model'],_0x50e327[_0x9dfe('0x33')]);_0x551bbb[_0x9dfe('0x37')]=_[_0x9dfe('0x35')](_0x50e327[_0x9dfe('0x36')],qs[_0x9dfe('0x38')](_0x4a17f5[_0x9dfe('0x33')]['fields']));_0x551bbb[_0x9dfe('0x37')]=_0x551bbb[_0x9dfe('0x37')][_0x9dfe('0x39')]?_0x551bbb[_0x9dfe('0x37')]:_0x50e327[_0x9dfe('0x36')];if(_0x4a17f5[_0x9dfe('0x33')]['includeAll']){_0x551bbb[_0x9dfe('0x44')]=[{'all':!![]}];}_0x551bbb=_[_0x9dfe('0x41')]({},_0x551bbb,_0x4a17f5[_0x9dfe('0x42')]);return db[_0x9dfe('0x2f')][_0x9dfe('0x49')](_0x551bbb)[_0x9dfe('0x26')](handleEntityNotFound(_0x27fa70,null))[_0x9dfe('0x26')](respondWithResult(_0x27fa70,null))[_0x9dfe('0x47')](handleError(_0x27fa70,null));};exports[_0x9dfe('0x4a')]=function(_0x36a433,_0xb597b1){return db[_0x9dfe('0x2f')][_0x9dfe('0x4a')](_0x36a433[_0x9dfe('0x4b')],{})[_0x9dfe('0x26')](function(_0x47b346){var _0x2c9c7a=_0x36a433[_0x9dfe('0x4c')]['get']({'plain':!![]});if(!_0x2c9c7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c9c7a[_0x9dfe('0x4d')]===_0x9dfe('0x4c')){var _0x556309=_0x47b346['get']({'plain':!![]});var _0x554811=_0x9dfe('0x4e');return db[_0x9dfe('0x4f')][_0x9dfe('0x49')]({'where':{'name':_0x554811,'userProfileId':_0x2c9c7a[_0x9dfe('0x50')]},'raw':!![]})['then'](function(_0x396bbe){if(_0x396bbe&&_0x396bbe[_0x9dfe('0x51')]===0x0){return db[_0x9dfe('0x29')][_0x9dfe('0x4a')]({'name':_0x556309[_0x9dfe('0x2c')],'resourceId':_0x556309['id'],'type':_0x396bbe['name'],'sectionId':_0x396bbe['id']},{})[_0x9dfe('0x26')](function(){return _0x47b346;});}else{return _0x47b346;}})[_0x9dfe('0x47')](function(_0x5a1f13){logger[_0x9dfe('0x2b')](_0x9dfe('0x52'),_0x5a1f13);throw _0x5a1f13;});}return _0x47b346;})['then'](respondWithResult(_0xb597b1,0xc9))[_0x9dfe('0x47')](handleError(_0xb597b1,null));};exports[_0x9dfe('0x25')]=function(_0x435486,_0x5b2d25){if(_0x435486[_0x9dfe('0x4b')]['id']){delete _0x435486[_0x9dfe('0x4b')]['id'];}return db['VoiceChanSpy']['find']({'where':{'id':_0x435486[_0x9dfe('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b2d25,null))['then'](saveUpdates(_0x435486[_0x9dfe('0x4b')],null))[_0x9dfe('0x26')](respondWithResult(_0x5b2d25,null))[_0x9dfe('0x47')](handleError(_0x5b2d25,null));};exports['destroy']=function(_0x514083,_0x15e6e0){return db[_0x9dfe('0x2f')][_0x9dfe('0x49')]({'where':{'id':_0x514083[_0x9dfe('0x48')]['id']}})[_0x9dfe('0x26')](handleEntityNotFound(_0x15e6e0,null))[_0x9dfe('0x26')](removeEntity(_0x15e6e0,null))[_0x9dfe('0x47')](handleError(_0x15e6e0,null));}; \ No newline at end of file +var _0x1491=['query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','includeAll','include','rows','catch','params','keys','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','error','name','send','map','VoiceChanSpy','rawAttributes','type','key','intersection','model'];(function(_0x438a35,_0x973546){var _0x28ebd8=function(_0x17bca6){while(--_0x17bca6){_0x438a35['push'](_0x438a35['shift']());}};_0x28ebd8(++_0x973546);}(_0x1491,0x1b1));var _0x1149=function(_0x107b8a,_0x3188a3){_0x107b8a=_0x107b8a-0x0;var _0x477480=_0x1491[_0x107b8a];return _0x477480;};'use strict';var emlformat=require(_0x1149('0x0'));var rimraf=require(_0x1149('0x1'));var zipdir=require(_0x1149('0x2'));var jsonpatch=require(_0x1149('0x3'));var rp=require('request-promise');var moment=require(_0x1149('0x4'));var BPromise=require(_0x1149('0x5'));var Mustache=require(_0x1149('0x6'));var util=require(_0x1149('0x7'));var path=require(_0x1149('0x8'));var sox=require(_0x1149('0x9'));var csv=require(_0x1149('0xa'));var ejs=require(_0x1149('0xb'));var fs=require('fs');var fs_extra=require(_0x1149('0xc'));var _=require(_0x1149('0xd'));var squel=require(_0x1149('0xe'));var crypto=require(_0x1149('0xf'));var jsforce=require(_0x1149('0x10'));var deskjs=require(_0x1149('0x11'));var toCsv=require(_0x1149('0xa'));var querystring=require(_0x1149('0x12'));var Papa=require(_0x1149('0x13'));var Redis=require(_0x1149('0x14'));var authService=require(_0x1149('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x1149('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1149('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1149('0x18'))['db'];function respondWithStatusCode(_0x55ba22,_0x439553){_0x439553=_0x439553||0xcc;return function(_0x3531e6){if(_0x3531e6){return _0x55ba22[_0x1149('0x19')](_0x439553);}return _0x55ba22[_0x1149('0x1a')](_0x439553)[_0x1149('0x1b')]();};}function respondWithResult(_0x22a1b6,_0x5aa405){_0x5aa405=_0x5aa405||0xc8;return function(_0x4749f1){if(_0x4749f1){return _0x22a1b6['status'](_0x5aa405)['json'](_0x4749f1);}};}function respondWithFilteredResult(_0x669ae,_0xdac107){return function(_0x552de8){if(_0x552de8){var _0xdee3e5=typeof _0xdac107[_0x1149('0x1c')]===_0x1149('0x1d')&&typeof _0xdac107[_0x1149('0x1e')]===_0x1149('0x1d');var _0x27f49f=_0x552de8[_0x1149('0x1f')];var _0x373ca0=_0xdee3e5?0x0:_0xdac107[_0x1149('0x1c')];var _0x88c9b1=_0xdee3e5?_0x552de8[_0x1149('0x1f')]:_0xdac107[_0x1149('0x1c')]+_0xdac107[_0x1149('0x1e')];var _0x517c77;if(_0x88c9b1>=_0x27f49f){_0x88c9b1=_0x27f49f;_0x517c77=0xc8;}else{_0x517c77=0xce;}_0x669ae['status'](_0x517c77);return _0x669ae[_0x1149('0x20')](_0x1149('0x21'),_0x373ca0+'-'+_0x88c9b1+'/'+_0x27f49f)[_0x1149('0x22')](_0x552de8);}return null;};}function patchUpdates(_0x4781b8){return function(_0x27a2fb){try{jsonpatch['apply'](_0x27a2fb,_0x4781b8,!![]);}catch(_0x20b2bc){return BPromise[_0x1149('0x23')](_0x20b2bc);}return _0x27a2fb[_0x1149('0x24')]();};}function saveUpdates(_0x4d5649,_0x3a891c){return function(_0x2d6b4b){if(_0x2d6b4b){return _0x2d6b4b[_0x1149('0x25')](_0x4d5649)['then'](function(_0x695140){return _0x695140;});}return null;};}function removeEntity(_0x214f3e,_0x20a1b6){return function(_0x59eb5e){if(_0x59eb5e){return _0x59eb5e[_0x1149('0x26')]()[_0x1149('0x27')](function(){var _0x1f36ff=_0x59eb5e[_0x1149('0x28')]({'plain':!![]});var _0x1d6843=_0x1149('0x29');return db[_0x1149('0x2a')][_0x1149('0x26')]({'where':{'type':_0x1d6843,'resourceId':_0x1f36ff['id']}})[_0x1149('0x27')](function(){return _0x59eb5e;});})[_0x1149('0x27')](function(){_0x214f3e['status'](0xcc)[_0x1149('0x1b')]();});}};}function handleEntityNotFound(_0x17cf9b,_0x56a81e){return function(_0x5516d4){if(!_0x5516d4){_0x17cf9b[_0x1149('0x19')](0x194);}return _0x5516d4;};}function handleError(_0x4dc164,_0x593df7){_0x593df7=_0x593df7||0x1f4;return function(_0x1b633a){logger[_0x1149('0x2b')](_0x1b633a['stack']);if(_0x1b633a[_0x1149('0x2c')]){delete _0x1b633a[_0x1149('0x2c')];}_0x4dc164[_0x1149('0x1a')](_0x593df7)[_0x1149('0x2d')](_0x1b633a);};}exports['index']=function(_0x5d267a,_0x4f9834){var _0x1ce0e8={},_0x27619c={},_0x337569={'count':0x0,'rows':[]};var _0x482c8e=_[_0x1149('0x2e')](db[_0x1149('0x2f')][_0x1149('0x30')],function(_0x123317){return{'name':_0x123317['fieldName'],'type':_0x123317[_0x1149('0x31')][_0x1149('0x32')]};});_0x27619c['model']=_['map'](_0x482c8e,_0x1149('0x2c'));_0x27619c['query']=_['keys'](_0x5d267a['query']);_0x27619c['filters']=_[_0x1149('0x33')](_0x27619c[_0x1149('0x34')],_0x27619c[_0x1149('0x35')]);_0x1ce0e8['attributes']=_[_0x1149('0x33')](_0x27619c['model'],qs['fields'](_0x5d267a[_0x1149('0x35')][_0x1149('0x36')]));_0x1ce0e8[_0x1149('0x37')]=_0x1ce0e8[_0x1149('0x37')][_0x1149('0x38')]?_0x1ce0e8['attributes']:_0x27619c[_0x1149('0x34')];if(!_0x5d267a[_0x1149('0x35')][_0x1149('0x39')](_0x1149('0x3a'))){_0x1ce0e8[_0x1149('0x1e')]=qs['limit'](_0x5d267a[_0x1149('0x35')][_0x1149('0x1e')]);_0x1ce0e8[_0x1149('0x1c')]=qs[_0x1149('0x1c')](_0x5d267a[_0x1149('0x35')][_0x1149('0x1c')]);}_0x1ce0e8[_0x1149('0x3b')]=qs[_0x1149('0x3c')](_0x5d267a['query'][_0x1149('0x3c')]);_0x1ce0e8[_0x1149('0x3d')]=qs['filters'](_['pick'](_0x5d267a[_0x1149('0x35')],_0x27619c[_0x1149('0x3e')]),_0x482c8e);if(_0x5d267a[_0x1149('0x35')][_0x1149('0x3f')]){_0x1ce0e8['where']=_['merge'](_0x1ce0e8['where'],{'$or':_[_0x1149('0x2e')](_0x482c8e,function(_0x38a980){if(_0x38a980[_0x1149('0x31')]!=='VIRTUAL'){var _0x478a5c={};_0x478a5c[_0x38a980['name']]={'$like':'%'+_0x5d267a[_0x1149('0x35')]['filter']+'%'};return _0x478a5c;}})});}_0x1ce0e8=_['merge']({},_0x1ce0e8,_0x5d267a[_0x1149('0x40')]);var _0x47c84d={'where':_0x1ce0e8[_0x1149('0x3d')]};return db['VoiceChanSpy']['count'](_0x47c84d)['then'](function(_0x37ad54){_0x337569['count']=_0x37ad54;if(_0x5d267a['query'][_0x1149('0x41')]){_0x1ce0e8[_0x1149('0x42')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x1ce0e8);})[_0x1149('0x27')](function(_0x31e646){_0x337569[_0x1149('0x43')]=_0x31e646;return _0x337569;})[_0x1149('0x27')](respondWithFilteredResult(_0x4f9834,_0x1ce0e8))[_0x1149('0x44')](handleError(_0x4f9834,null));};exports['show']=function(_0x58b434,_0x3ccf97){var _0x31df65={'raw':![],'where':{'id':_0x58b434[_0x1149('0x45')]['id']}},_0x47af09={};_0x47af09['model']=_[_0x1149('0x46')](db['VoiceChanSpy'][_0x1149('0x30')]);_0x47af09[_0x1149('0x35')]=_[_0x1149('0x46')](_0x58b434[_0x1149('0x35')]);_0x47af09[_0x1149('0x3e')]=_['intersection'](_0x47af09[_0x1149('0x34')],_0x47af09[_0x1149('0x35')]);_0x31df65[_0x1149('0x37')]=_[_0x1149('0x33')](_0x47af09[_0x1149('0x34')],qs['fields'](_0x58b434['query'][_0x1149('0x36')]));_0x31df65[_0x1149('0x37')]=_0x31df65[_0x1149('0x37')][_0x1149('0x38')]?_0x31df65['attributes']:_0x47af09[_0x1149('0x34')];if(_0x58b434[_0x1149('0x35')]['includeAll']){_0x31df65[_0x1149('0x42')]=[{'all':!![]}];}_0x31df65=_[_0x1149('0x47')]({},_0x31df65,_0x58b434['options']);return db['VoiceChanSpy'][_0x1149('0x48')](_0x31df65)[_0x1149('0x27')](handleEntityNotFound(_0x3ccf97,null))['then'](respondWithResult(_0x3ccf97,null))[_0x1149('0x44')](handleError(_0x3ccf97,null));};exports[_0x1149('0x49')]=function(_0x3af860,_0x24bcc0){return db['VoiceChanSpy'][_0x1149('0x49')](_0x3af860[_0x1149('0x4a')],{})[_0x1149('0x27')](function(_0x332c28){var _0x19b5b1=_0x3af860[_0x1149('0x4b')][_0x1149('0x28')]({'plain':!![]});if(!_0x19b5b1)throw new Error(_0x1149('0x4c'));if(_0x19b5b1[_0x1149('0x4d')]===_0x1149('0x4b')){var _0xff32f4=_0x332c28[_0x1149('0x28')]({'plain':!![]});var _0x13c8ed='ChanSpies';return db[_0x1149('0x4e')][_0x1149('0x48')]({'where':{'name':_0x13c8ed,'userProfileId':_0x19b5b1[_0x1149('0x4f')]},'raw':!![]})[_0x1149('0x27')](function(_0x22e18d){if(_0x22e18d&&_0x22e18d['autoAssociation']===0x0){return db[_0x1149('0x2a')][_0x1149('0x49')]({'name':_0xff32f4[_0x1149('0x2c')],'resourceId':_0xff32f4['id'],'type':_0x22e18d[_0x1149('0x2c')],'sectionId':_0x22e18d['id']},{})[_0x1149('0x27')](function(){return _0x332c28;});}else{return _0x332c28;}})[_0x1149('0x44')](function(_0x301796){logger[_0x1149('0x2b')](_0x1149('0x50'),_0x301796);throw _0x301796;});}return _0x332c28;})[_0x1149('0x27')](respondWithResult(_0x24bcc0,0xc9))['catch'](handleError(_0x24bcc0,null));};exports[_0x1149('0x25')]=function(_0x44d8d6,_0x37c82e){if(_0x44d8d6['body']['id']){delete _0x44d8d6['body']['id'];}return db[_0x1149('0x2f')][_0x1149('0x48')]({'where':{'id':_0x44d8d6[_0x1149('0x45')]['id']}})['then'](handleEntityNotFound(_0x37c82e,null))['then'](saveUpdates(_0x44d8d6[_0x1149('0x4a')],null))[_0x1149('0x27')](respondWithResult(_0x37c82e,null))[_0x1149('0x44')](handleError(_0x37c82e,null));};exports[_0x1149('0x26')]=function(_0x5b6924,_0x16c12e){return db['VoiceChanSpy'][_0x1149('0x48')]({'where':{'id':_0x5b6924[_0x1149('0x45')]['id']}})[_0x1149('0x27')](handleEntityNotFound(_0x16c12e,null))['then'](removeEntity(_0x16c12e,null))['catch'](handleError(_0x16c12e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 87a1db4..aeaa4ec 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 _0xf352=['bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','util'];(function(_0x4f2666,_0xb056fb){var _0x4ea27d=function(_0x50a728){while(--_0x50a728){_0x4f2666['push'](_0x4f2666['shift']());}};_0x4ea27d(++_0xb056fb);}(_0xf352,0x11e));var _0x2f35=function(_0x3ebbf9,_0x21e579){_0x3ebbf9=_0x3ebbf9-0x0;var _0x1a27cc=_0xf352[_0x3ebbf9];return _0x1a27cc;};'use strict';var _=require('lodash');var util=require(_0x2f35('0x0'));var BPromise=require(_0x2f35('0x1'));var attributes=require(_0x2f35('0x2'));var getUserApplications=function(_0x1e36aa,_0x2178fb,_0x2d2099){var _0x15cf9a=0x1;var _0x4d34a4=[];var _0x4917ea={'context':_0x2178fb[_0x2f35('0x3')]||_0x2f35('0x4'),'exten':util['format'](_0x2f35('0x5'),_0x1e36aa[_0x2f35('0x6')],_0x2d2099),'type':_0x2f35('0x7'),'isApp':![],'ChanSpyId':_0x1e36aa['id'],'UserId':_0x2178fb['id']};_0x4d34a4['push'](_[_0x2f35('0x8')]({'app':_0x2f35('0x9'),'appdata':util[_0x2f35('0xa')](_0x2f35('0xb'),_0x2f35('0xc')),'priority':_0x15cf9a++},_0x4917ea));if(_0x1e36aa['record']){_0x4d34a4[_0x2f35('0xd')](_[_0x2f35('0x8')]({'app':_0x2f35('0xe'),'appdata':util['format'](_0x2f35('0xf'),_0x1e36aa[_0x2f35('0x10')]),'priority':_0x15cf9a++},_0x4917ea));}if(_0x1e36aa['auth']){_0x4d34a4['push'](_['merge']({'app':_0x2f35('0x11'),'appdata':_0x1e36aa[_0x2f35('0x12')],'priority':_0x15cf9a++},_0x4917ea));}_0x4d34a4[_0x2f35('0xd')](_['merge']({'app':_0x2f35('0x13'),'appdata':util['format'](_0x2f35('0x14'),_0x2178fb[_0x2f35('0x15')],_0x1e36aa[_0x2f35('0x16')]?_0x1e36aa[_0x2f35('0x16')][_0x2f35('0x17')](''):''),'priority':_0x15cf9a++},_0x4917ea));if(_0x1e36aa[_0x2f35('0x18')]){_0x4d34a4[_0x2f35('0xd')](_['merge']({'app':_0x2f35('0x19'),'priority':_0x15cf9a++},_0x4917ea));}return _0x4d34a4;};var getChanSpyApplications=function(_0x2c795a,_0x345ea5){var _0x45b77a=[];for(var _0x1d0b2a=0x0,_0x20fcb1=0x1;_0x1d0b2a<_0x345ea5[_0x2f35('0x1a')];_0x1d0b2a++,_0x20fcb1=0x1){_0x45b77a=_0x45b77a[_0x2f35('0x1b')](getUserApplications(_0x2c795a,_0x345ea5[_0x1d0b2a],_0x345ea5[_0x1d0b2a][_0x2f35('0x1c')]));if(_0x345ea5[_0x1d0b2a][_0x2f35('0x1c')]!=_0x345ea5[_0x1d0b2a][_0x2f35('0x15')]){_0x45b77a=_0x45b77a[_0x2f35('0x1b')](getUserApplications(_0x2c795a,_0x345ea5[_0x1d0b2a],_0x345ea5[_0x1d0b2a]['name']));}}return _0x45b77a;};var getChanSpyPromise=function(_0x4c5372,_0x10599f){return new BPromise(function(_0x25c933,_0x480712){return _0x4c5372[_0x2f35('0x1d')][_0x2f35('0x1e')]({'attributes':['id',_0x2f35('0x15'),'internal'],'where':{'role':_0x2f35('0x1f'),'chanspy':!![]},'raw':!![]})[_0x2f35('0x20')](function(_0x56915f){if(_0x56915f){return _0x25c933(getChanSpyApplications(_0x10599f,_0x56915f));}return _0x25c933([]);})[_0x2f35('0x21')](function(_0x1c4511){_0x480712(_0x1c4511);});});};module[_0x2f35('0x22')]=function(_0x1555d6,_0xe3c2da){var _0x100213=_0x1555d6[_0x2f35('0x23')];return _0x1555d6[_0x2f35('0x24')](_0x2f35('0x25'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x54ce84,_0x1a9054,_0x2935c2){return getChanSpyPromise(_0x100213,_0x54ce84)[_0x2f35('0x20')](function(_0x33985d){if(_0x33985d&&_0x33985d[_0x2f35('0x1a')]){return _0x100213[_0x2f35('0x26')][_0x2f35('0x27')](_0x33985d);}})[_0x2f35('0x20')](function(){_0x2935c2();})['catch'](function(_0x1eb2de){_0x2935c2(_0x1eb2de);});},'afterUpdate':function(_0x58174a,_0x9016de,_0x4834a7){return _0x100213[_0x2f35('0x26')][_0x2f35('0x28')]({'where':{'ChanSpyId':_0x58174a['id']}})['then'](function(){return getChanSpyPromise(_0x100213,_0x58174a);})[_0x2f35('0x20')](function(_0x5b463a){if(_0x5b463a&&_0x5b463a[_0x2f35('0x1a')]){return _0x100213[_0x2f35('0x26')][_0x2f35('0x27')](_0x5b463a);}})['then'](function(){_0x4834a7();})[_0x2f35('0x21')](function(_0x1bd93d){_0x4834a7(_0x1bd93d);});},'afterDestroy':function(_0x4203dd,_0x5da3c9,_0x26e811){return _0x100213[_0x2f35('0x26')][_0x2f35('0x28')]({'where':{'ChanSpyId':_0x4203dd['id']}})[_0x2f35('0x20')](function(){_0x26e811();})[_0x2f35('0x21')](function(_0x49b515){_0x26e811(_0x49b515);});}}});}; \ No newline at end of file +var _0x107f=['prefix','push','Set','format','chanspy','record','MixMonitor','recordingFormat','auth','merge','Authenticate','password','ChanSpy','name','options','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','models','VoiceChanSpy','bulkCreate','destroy','VoiceExtension','util','./voiceChanSpy.attributes','from-sip'];(function(_0x1f10ca,_0x4ad220){var _0x2efd67=function(_0xac031c){while(--_0xac031c){_0x1f10ca['push'](_0x1f10ca['shift']());}};_0x2efd67(++_0x4ad220);}(_0x107f,0x17d));var _0xf107=function(_0xc7fbc0,_0x41c0be){_0xc7fbc0=_0xc7fbc0-0x0;var _0x21c34c=_0x107f[_0xc7fbc0];return _0x21c34c;};'use strict';var _=require('lodash');var util=require(_0xf107('0x0'));var BPromise=require('bluebird');var attributes=require(_0xf107('0x1'));var getUserApplications=function(_0x373fc3,_0x5cc5df,_0x36be10){var _0x20c29e=0x1;var _0x367ad1=[];var _0xed88da={'context':_0x5cc5df['context']||_0xf107('0x2'),'exten':util['format']('%s%s',_0x373fc3[_0xf107('0x3')],_0x36be10),'type':'system','isApp':![],'ChanSpyId':_0x373fc3['id'],'UserId':_0x5cc5df['id']};_0x367ad1[_0xf107('0x4')](_['merge']({'app':_0xf107('0x5'),'appdata':util[_0xf107('0x6')]('CDR(type)=%s',_0xf107('0x7')),'priority':_0x20c29e++},_0xed88da));if(_0x373fc3[_0xf107('0x8')]){_0x367ad1[_0xf107('0x4')](_['merge']({'app':_0xf107('0x9'),'appdata':util[_0xf107('0x6')]('${UNIQUEID}.%s,a',_0x373fc3[_0xf107('0xa')]),'priority':_0x20c29e++},_0xed88da));}if(_0x373fc3[_0xf107('0xb')]){_0x367ad1[_0xf107('0x4')](_[_0xf107('0xc')]({'app':_0xf107('0xd'),'appdata':_0x373fc3[_0xf107('0xe')],'priority':_0x20c29e++},_0xed88da));}_0x367ad1[_0xf107('0x4')](_[_0xf107('0xc')]({'app':_0xf107('0xf'),'appdata':util[_0xf107('0x6')]('SIP/%s,%s',_0x5cc5df[_0xf107('0x10')],_0x373fc3['options']?_0x373fc3[_0xf107('0x11')]['join'](''):''),'priority':_0x20c29e++},_0xed88da));if(_0x373fc3[_0xf107('0x8')]){_0x367ad1['push'](_[_0xf107('0xc')]({'app':_0xf107('0x12'),'priority':_0x20c29e++},_0xed88da));}return _0x367ad1;};var getChanSpyApplications=function(_0x58bc64,_0x1ad8b2){var _0x12af36=[];for(var _0x47b828=0x0,_0xd0867e=0x1;_0x47b828<_0x1ad8b2[_0xf107('0x13')];_0x47b828++,_0xd0867e=0x1){_0x12af36=_0x12af36[_0xf107('0x14')](getUserApplications(_0x58bc64,_0x1ad8b2[_0x47b828],_0x1ad8b2[_0x47b828][_0xf107('0x15')]));if(_0x1ad8b2[_0x47b828][_0xf107('0x15')]!=_0x1ad8b2[_0x47b828]['name']){_0x12af36=_0x12af36[_0xf107('0x14')](getUserApplications(_0x58bc64,_0x1ad8b2[_0x47b828],_0x1ad8b2[_0x47b828][_0xf107('0x10')]));}}return _0x12af36;};var getChanSpyPromise=function(_0x833e7d,_0x34807a){return new BPromise(function(_0x53a597,_0x401bd7){return _0x833e7d[_0xf107('0x16')]['findAll']({'attributes':['id',_0xf107('0x10'),'internal'],'where':{'role':_0xf107('0x17'),'chanspy':!![]},'raw':!![]})[_0xf107('0x18')](function(_0x6be82a){if(_0x6be82a){return _0x53a597(getChanSpyApplications(_0x34807a,_0x6be82a));}return _0x53a597([]);})[_0xf107('0x19')](function(_0x236c49){_0x401bd7(_0x236c49);});});};module[_0xf107('0x1a')]=function(_0x5beaf5,_0x213b1c){var _0x56220a=_0x5beaf5[_0xf107('0x1b')];return _0x5beaf5['define'](_0xf107('0x1c'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ef3ac,_0x2eb3f9,_0x1d22fa){return getChanSpyPromise(_0x56220a,_0x4ef3ac)['then'](function(_0x25ea26){if(_0x25ea26&&_0x25ea26[_0xf107('0x13')]){return _0x56220a['VoiceExtension'][_0xf107('0x1d')](_0x25ea26);}})[_0xf107('0x18')](function(){_0x1d22fa();})[_0xf107('0x19')](function(_0x18a62d){_0x1d22fa(_0x18a62d);});},'afterUpdate':function(_0x2183d8,_0x12e5ec,_0x3aa3cb){return _0x56220a['VoiceExtension'][_0xf107('0x1e')]({'where':{'ChanSpyId':_0x2183d8['id']}})['then'](function(){return getChanSpyPromise(_0x56220a,_0x2183d8);})[_0xf107('0x18')](function(_0x18741c){if(_0x18741c&&_0x18741c['length']){return _0x56220a[_0xf107('0x1f')][_0xf107('0x1d')](_0x18741c);}})[_0xf107('0x18')](function(){_0x3aa3cb();})[_0xf107('0x19')](function(_0x12c8fb){_0x3aa3cb(_0x12c8fb);});},'afterDestroy':function(_0x2c126e,_0x262f81,_0x1a3c1a){return _0x56220a[_0xf107('0x1f')][_0xf107('0x1e')]({'where':{'ChanSpyId':_0x2c126e['id']}})[_0xf107('0x18')](function(){_0x1a3c1a();})[_0xf107('0x19')](function(_0x435fc5){_0x1a3c1a(_0x435fc5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 195e9cf..5e44359 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 _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x47f33d,_0x11a7b5){var _0x3cbf7b=function(_0x258286){while(--_0x258286){_0x47f33d['push'](_0x47f33d['shift']());}};_0x3cbf7b(++_0x11a7b5);}(_0x54f3,0x120));var _0x354f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x54f3[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});} \ No newline at end of file +var _0x2356=['then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','rpc','client','http'];(function(_0x392b5c,_0x386e46){var _0x3896c5=function(_0x3684ed){while(--_0x3684ed){_0x392b5c['push'](_0x392b5c['shift']());}};_0x3896c5(++_0x386e46);}(_0x2356,0x14f));var _0x6235=function(_0x54df11,_0x45d037){_0x54df11=_0x54df11-0x0;var _0xdacff5=_0x2356[_0x54df11];return _0xdacff5;};'use strict';var _=require('lodash');var util=require(_0x6235('0x0'));var moment=require(_0x6235('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6235('0x2'));var db=require(_0x6235('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6235('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6235('0x5')][_0x6235('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3663e7,_0x47f3a5,_0x4c15c6){return new BPromise(function(_0x547159,_0x3a5750){return client['request'](_0x3663e7,_0x4c15c6)[_0x6235('0x7')](function(_0x11d1f9){logger[_0x6235('0x8')](_0x6235('0x9'),_0x47f3a5,'request\x20sent');logger[_0x6235('0xa')](_0x6235('0xb'),_0x47f3a5,_0x6235('0xc'),JSON[_0x6235('0xd')](_0x11d1f9));if(_0x11d1f9[_0x6235('0xe')]){if(_0x11d1f9['error'][_0x6235('0xf')]===0x1f4){logger[_0x6235('0xe')](_0x6235('0x9'),_0x47f3a5,_0x11d1f9[_0x6235('0xe')]['message']);return _0x3a5750(_0x11d1f9[_0x6235('0xe')][_0x6235('0x10')]);}logger['error'](_0x6235('0x9'),_0x47f3a5,_0x11d1f9['error'][_0x6235('0x10')]);return _0x547159(_0x11d1f9[_0x6235('0xe')]['message']);}else{logger[_0x6235('0x8')](_0x6235('0x9'),_0x47f3a5,_0x6235('0xc'));_0x547159(_0x11d1f9[_0x6235('0x11')]['message']);}})[_0x6235('0x12')](function(_0x190d7c){logger[_0x6235('0xe')](_0x6235('0x9'),_0x47f3a5,_0x190d7c);_0x3a5750(_0x190d7c);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 56c76a2..10c6d95 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 _0xa7de=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xa7de,0x11e));var _0xea7d=function(_0x2e1147,_0xb9659){_0x2e1147=_0x2e1147-0x0;var _0xe4a6d1=_0xa7de[_0x2e1147];return _0xe4a6d1;};'use strict';var multer=require(_0xea7d('0x0'));var util=require(_0xea7d('0x1'));var path=require(_0xea7d('0x2'));var timeout=require(_0xea7d('0x3'));var express=require(_0xea7d('0x4'));var router=express['Router']();var fs_extra=require(_0xea7d('0x5'));var auth=require(_0xea7d('0x6'));var interaction=require(_0xea7d('0x7'));var config=require(_0xea7d('0x8'));var controller=require(_0xea7d('0x9'));router[_0xea7d('0xa')]('/',auth[_0xea7d('0xb')](),controller[_0xea7d('0xc')]);router['get'](_0xea7d('0xd'),auth[_0xea7d('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xea7d('0xe')]);router[_0xea7d('0xf')](_0xea7d('0xd'),auth['isAuthenticated'](),controller[_0xea7d('0x10')]);router[_0xea7d('0x11')](_0xea7d('0xd'),auth[_0xea7d('0xb')](),controller[_0xea7d('0x12')]);module[_0xea7d('0x13')]=router; \ No newline at end of file +var _0xe154=['../../components/interaction/service','./voiceContext.controller','isAuthenticated','get','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0xf5d72e,_0x54c93f){var _0x3df354=function(_0xfc3748){while(--_0xfc3748){_0xf5d72e['push'](_0xf5d72e['shift']());}};_0x3df354(++_0x54c93f);}(_0xe154,0xab));var _0x4e15=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0xe154[_0x2dc7c9];return _0x3e6536;};'use strict';var multer=require(_0x4e15('0x0'));var util=require(_0x4e15('0x1'));var path=require('path');var timeout=require(_0x4e15('0x2'));var express=require(_0x4e15('0x3'));var router=express[_0x4e15('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4e15('0x5'));var config=require('../../config/environment');var controller=require(_0x4e15('0x6'));router['get']('/',auth[_0x4e15('0x7')](),controller['index']);router[_0x4e15('0x8')](_0x4e15('0x9'),auth['isAuthenticated'](),controller[_0x4e15('0xa')]);router['post']('/',auth[_0x4e15('0x7')](),controller[_0x4e15('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4e15('0xc')]);router[_0x4e15('0xd')]('/:id',auth[_0x4e15('0x7')](),controller[_0x4e15('0xe')]);module[_0x4e15('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index c5495e1..40f2f6d 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 _0xa618=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x2b792e,_0x2b5915){var _0xc9707d=function(_0x2424ff){while(--_0x2424ff){_0x2b792e['push'](_0x2b792e['shift']());}};_0xc9707d(++_0x2b5915);}(_0xa618,0x13d));var _0x8a61=function(_0x4afe24,_0x3be41d){_0x4afe24=_0x4afe24-0x0;var _0xb6d06a=_0xa618[_0x4afe24];return _0xb6d06a;};'use strict';var Sequelize=require(_0x8a61('0x0'));module[_0x8a61('0x1')]={'name':{'type':Sequelize[_0x8a61('0x2')],'unique':_0x8a61('0x3')},'description':{'type':Sequelize[_0x8a61('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8a61('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae1a=['exports','STRING','name','sequelize'];(function(_0x1a0d1f,_0x4b9979){var _0x15b44d=function(_0x25aa78){while(--_0x25aa78){_0x1a0d1f['push'](_0x1a0d1f['shift']());}};_0x15b44d(++_0x4b9979);}(_0xae1a,0x193));var _0xaae1=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xae1a[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0xaae1('0x0'));module[_0xaae1('0x1')]={'name':{'type':Sequelize[_0xaae1('0x2')],'unique':_0xaae1('0x3')},'description':{'type':Sequelize[_0xaae1('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 42b3007..32184bd 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 _0x916b=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','show','params','rawAttributes','keys','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','chan_sip.so','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','Reload','destroy','join','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','sendStatus','stack','name','send','map','VoiceContext','type','key','model','query','filters','intersection','attributes'];(function(_0x148259,_0x48f002){var _0x420e93=function(_0x1796d3){while(--_0x1796d3){_0x148259['push'](_0x148259['shift']());}};_0x420e93(++_0x48f002);}(_0x916b,0xf7));var _0xb916=function(_0x2358d4,_0x49ef04){_0x2358d4=_0x2358d4-0x0;var _0x31d577=_0x916b[_0x2358d4];return _0x31d577;};'use strict';var emlformat=require(_0xb916('0x0'));var rimraf=require(_0xb916('0x1'));var zipdir=require(_0xb916('0x2'));var jsonpatch=require(_0xb916('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb916('0x4'));var Mustache=require(_0xb916('0x5'));var util=require(_0xb916('0x6'));var path=require(_0xb916('0x7'));var sox=require('sox');var csv=require(_0xb916('0x8'));var ejs=require(_0xb916('0x9'));var fs=require('fs');var fs_extra=require(_0xb916('0xa'));var _=require(_0xb916('0xb'));var squel=require(_0xb916('0xc'));var crypto=require('crypto');var jsforce=require(_0xb916('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb916('0x8'));var querystring=require('querystring');var Papa=require(_0xb916('0xe'));var Redis=require(_0xb916('0xf'));var authService=require(_0xb916('0x10'));var qs=require(_0xb916('0x11'));var as=require(_0xb916('0x12'));var hardwareService=require(_0xb916('0x13'));var logger=require(_0xb916('0x14'))(_0xb916('0x15'));var utils=require('../../config/utils');var config=require(_0xb916('0x16'));var licenseUtil=require(_0xb916('0x17'));var db=require(_0xb916('0x18'))['db'];var jayson=require(_0xb916('0x19'));var client=jayson[_0xb916('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x567a0c,_0x5df436,_0x211f9c,_0x1c00a8){return new BPromise(function(_0x30d69d,_0xf25705){var _0x48194f=_0x1c00a8||client;return _0x48194f[_0xb916('0x1b')](_0x567a0c,_0x211f9c)[_0xb916('0x1c')](function(_0x55696f){logger[_0xb916('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x5df436,_0xb916('0x1e'));logger[_0xb916('0x1f')](_0xb916('0x20'),_0x5df436,_0xb916('0x1e'),JSON[_0xb916('0x21')](_0x55696f));if(_0x55696f[_0xb916('0x22')]){if(_0x55696f[_0xb916('0x22')][_0xb916('0x23')]===0x1f4){logger[_0xb916('0x22')](_0xb916('0x24'),_0x5df436,_0x55696f[_0xb916('0x22')][_0xb916('0x25')]);return _0xf25705(_0x55696f[_0xb916('0x22')][_0xb916('0x25')]);}logger[_0xb916('0x22')](_0xb916('0x24'),_0x5df436,_0x55696f[_0xb916('0x22')]['message']);return _0x30d69d(_0x55696f['error'][_0xb916('0x25')]);}else{logger[_0xb916('0x1d')](_0xb916('0x24'),_0x5df436,_0xb916('0x1e'));_0x30d69d(_0x55696f['result'][_0xb916('0x25')]);}})[_0xb916('0x26')](function(_0x2aa2e1){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5df436,_0x2aa2e1);_0xf25705(_0x2aa2e1);});});}function respondWithStatusCode(_0x66b413,_0x5463b1){_0x5463b1=_0x5463b1||0xcc;return function(_0x36dbf5){if(_0x36dbf5){return _0x66b413['sendStatus'](_0x5463b1);}return _0x66b413[_0xb916('0x27')](_0x5463b1)[_0xb916('0x28')]();};}function respondWithResult(_0x1820d9,_0x5e0100){_0x5e0100=_0x5e0100||0xc8;return function(_0x9720c3){if(_0x9720c3){return _0x1820d9['status'](_0x5e0100)[_0xb916('0x29')](_0x9720c3);}};}function respondWithFilteredResult(_0x15c342,_0x2325a5){return function(_0x16601a){if(_0x16601a){var _0x41c0dd=typeof _0x2325a5[_0xb916('0x2a')]===_0xb916('0x2b')&&typeof _0x2325a5[_0xb916('0x2c')]===_0xb916('0x2b');var _0x3e45fe=_0x16601a[_0xb916('0x2d')];var _0x53a6cf=_0x41c0dd?0x0:_0x2325a5[_0xb916('0x2a')];var _0x233c5c=_0x41c0dd?_0x16601a['count']:_0x2325a5['offset']+_0x2325a5[_0xb916('0x2c')];var _0x4c1dc2;if(_0x233c5c>=_0x3e45fe){_0x233c5c=_0x3e45fe;_0x4c1dc2=0xc8;}else{_0x4c1dc2=0xce;}_0x15c342['status'](_0x4c1dc2);return _0x15c342[_0xb916('0x2e')](_0xb916('0x2f'),_0x53a6cf+'-'+_0x233c5c+'/'+_0x3e45fe)['json'](_0x16601a);}return null;};}function patchUpdates(_0x3ee468){return function(_0x410e12){try{jsonpatch[_0xb916('0x30')](_0x410e12,_0x3ee468,!![]);}catch(_0x4ad9ae){return BPromise[_0xb916('0x31')](_0x4ad9ae);}return _0x410e12[_0xb916('0x32')]();};}function saveUpdates(_0x3e44b3,_0x24ec78){return function(_0x249d22){if(_0x249d22){return _0x249d22[_0xb916('0x33')](_0x3e44b3)['then'](function(_0x27e092){return _0x27e092;});}return null;};}function removeEntity(_0x313152,_0x4595e0){return function(_0x58cbfc){if(_0x58cbfc){return _0x58cbfc['destroy']()[_0xb916('0x1c')](function(){var _0x45e9f7=_0x58cbfc[_0xb916('0x34')]({'plain':!![]});var _0x19f40c=_0xb916('0x35');return db[_0xb916('0x36')]['destroy']({'where':{'type':_0x19f40c,'resourceId':_0x45e9f7['id']}})[_0xb916('0x1c')](function(){return _0x58cbfc;});})[_0xb916('0x1c')](function(){_0x313152['status'](0xcc)[_0xb916('0x28')]();});}};}function handleEntityNotFound(_0x2816e5,_0x7af48){return function(_0x1f6f69){if(!_0x1f6f69){_0x2816e5[_0xb916('0x37')](0x194);}return _0x1f6f69;};}function handleError(_0xd434a6,_0x584f6e){_0x584f6e=_0x584f6e||0x1f4;return function(_0x4bf71c){logger[_0xb916('0x22')](_0x4bf71c[_0xb916('0x38')]);if(_0x4bf71c[_0xb916('0x39')]){delete _0x4bf71c[_0xb916('0x39')];}_0xd434a6[_0xb916('0x27')](_0x584f6e)[_0xb916('0x3a')](_0x4bf71c);};}exports['index']=function(_0x3348d1,_0x304c14){var _0x2b348c={},_0x519003={},_0x1fd11f={'count':0x0,'rows':[]};var _0x3445d2=_[_0xb916('0x3b')](db[_0xb916('0x3c')]['rawAttributes'],function(_0x41868a){return{'name':_0x41868a['fieldName'],'type':_0x41868a[_0xb916('0x3d')][_0xb916('0x3e')]};});_0x519003[_0xb916('0x3f')]=_[_0xb916('0x3b')](_0x3445d2,'name');_0x519003[_0xb916('0x40')]=_['keys'](_0x3348d1[_0xb916('0x40')]);_0x519003[_0xb916('0x41')]=_[_0xb916('0x42')](_0x519003[_0xb916('0x3f')],_0x519003[_0xb916('0x40')]);_0x2b348c[_0xb916('0x43')]=_[_0xb916('0x42')](_0x519003[_0xb916('0x3f')],qs[_0xb916('0x44')](_0x3348d1[_0xb916('0x40')][_0xb916('0x44')]));_0x2b348c[_0xb916('0x43')]=_0x2b348c['attributes'][_0xb916('0x45')]?_0x2b348c[_0xb916('0x43')]:_0x519003[_0xb916('0x3f')];if(!_0x3348d1[_0xb916('0x40')][_0xb916('0x46')](_0xb916('0x47'))){_0x2b348c['limit']=qs[_0xb916('0x2c')](_0x3348d1[_0xb916('0x40')][_0xb916('0x2c')]);_0x2b348c[_0xb916('0x2a')]=qs[_0xb916('0x2a')](_0x3348d1[_0xb916('0x40')][_0xb916('0x2a')]);}_0x2b348c[_0xb916('0x48')]=qs['sort'](_0x3348d1[_0xb916('0x40')][_0xb916('0x49')]);_0x2b348c[_0xb916('0x4a')]=qs[_0xb916('0x41')](_[_0xb916('0x4b')](_0x3348d1['query'],_0x519003[_0xb916('0x41')]),_0x3445d2);if(_0x3348d1['query']['filter']){_0x2b348c['where']=_[_0xb916('0x4c')](_0x2b348c[_0xb916('0x4a')],{'$or':_[_0xb916('0x3b')](_0x3445d2,function(_0xa720c6){if(_0xa720c6[_0xb916('0x3d')]!=='VIRTUAL'){var _0x3de300={};_0x3de300[_0xa720c6[_0xb916('0x39')]]={'$like':'%'+_0x3348d1[_0xb916('0x40')][_0xb916('0x4d')]+'%'};return _0x3de300;}})});}_0x2b348c=_['merge']({},_0x2b348c,_0x3348d1[_0xb916('0x4e')]);var _0x287124={'where':_0x2b348c[_0xb916('0x4a')]};return db[_0xb916('0x3c')][_0xb916('0x2d')](_0x287124)[_0xb916('0x1c')](function(_0x695b77){_0x1fd11f['count']=_0x695b77;if(_0x3348d1[_0xb916('0x40')][_0xb916('0x4f')]){_0x2b348c[_0xb916('0x50')]=[{'all':!![]}];}return db[_0xb916('0x3c')][_0xb916('0x51')](_0x2b348c);})[_0xb916('0x1c')](function(_0x267be7){_0x1fd11f['rows']=_0x267be7;return _0x1fd11f;})[_0xb916('0x1c')](respondWithFilteredResult(_0x304c14,_0x2b348c))[_0xb916('0x26')](handleError(_0x304c14,null));};exports[_0xb916('0x52')]=function(_0x68cf92,_0x43e4e9){var _0x2cb467={'raw':![],'where':{'id':_0x68cf92[_0xb916('0x53')]['id']}},_0x9a4d05={};_0x9a4d05[_0xb916('0x3f')]=_['keys'](db[_0xb916('0x3c')][_0xb916('0x54')]);_0x9a4d05[_0xb916('0x40')]=_[_0xb916('0x55')](_0x68cf92['query']);_0x9a4d05[_0xb916('0x41')]=_[_0xb916('0x42')](_0x9a4d05['model'],_0x9a4d05[_0xb916('0x40')]);_0x2cb467[_0xb916('0x43')]=_[_0xb916('0x42')](_0x9a4d05[_0xb916('0x3f')],qs['fields'](_0x68cf92[_0xb916('0x40')][_0xb916('0x44')]));_0x2cb467[_0xb916('0x43')]=_0x2cb467[_0xb916('0x43')][_0xb916('0x45')]?_0x2cb467[_0xb916('0x43')]:_0x9a4d05[_0xb916('0x3f')];if(_0x68cf92['query']['includeAll']){_0x2cb467[_0xb916('0x50')]=[{'all':!![]}];}_0x2cb467=_[_0xb916('0x4c')]({},_0x2cb467,_0x68cf92[_0xb916('0x4e')]);return db['VoiceContext']['find'](_0x2cb467)[_0xb916('0x1c')](handleEntityNotFound(_0x43e4e9,null))[_0xb916('0x1c')](respondWithResult(_0x43e4e9,null))[_0xb916('0x26')](handleError(_0x43e4e9,null));};exports['create']=function(_0x5b7c6a,_0x5d35aa,_0x5edfe8){var _0x3a66fd;return db['VoiceContext'][_0xb916('0x56')](_0x5b7c6a['body'],{'raw':!![]})['then'](function(_0x19d009){_0x3a66fd=_0x19d009;return db['VoiceContext'][_0xb916('0x51')]({'raw':!![]});})[_0xb916('0x1c')](function(_0x1e868f){var _0x38910e=fs[_0xb916('0x57')](path['join'](config[_0xb916('0x58')],_0xb916('0x59')),_0xb916('0x5a'));var _0x5dcc4f=ejs[_0xb916('0x5b')](_0x38910e,{'contexts':_0x1e868f||[]});fs[_0xb916('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5dcc4f);})['then'](function(){return respondWithRpcPromise('Reload',_0xb916('0x56'),{'module':_0xb916('0x5d')});})[_0xb916('0x1c')](function(){var _0x4e69f2=_0x5b7c6a[_0xb916('0x5e')][_0xb916('0x34')]({'plain':!![]});if(!_0x4e69f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e69f2[_0xb916('0x5f')]===_0xb916('0x5e')){var _0x34e85c=_0x3a66fd[_0xb916('0x34')]({'plain':!![]});return db[_0xb916('0x60')][_0xb916('0x61')]({'where':{'name':_0xb916('0x35'),'userProfileId':_0x4e69f2[_0xb916('0x62')]},'raw':!![]})[_0xb916('0x1c')](function(_0x4b3cc7){if(_0x4b3cc7&&_0x4b3cc7[_0xb916('0x63')]===0x0){return db[_0xb916('0x36')][_0xb916('0x56')]({'name':_0x34e85c[_0xb916('0x39')],'resourceId':_0x34e85c['id'],'type':_0x4b3cc7[_0xb916('0x39')],'sectionId':_0x4b3cc7['id']},{})[_0xb916('0x1c')](function(){return _0x3a66fd;});}else{return _0x3a66fd;}})['catch'](function(_0x1bac1e){logger[_0xb916('0x22')](_0xb916('0x64'),_0x1bac1e);throw _0x1bac1e;});}return _0x3a66fd;})['then'](respondWithResult(_0x5d35aa,0xc9))[_0xb916('0x26')](handleError(_0x5d35aa,null));};exports[_0xb916('0x33')]=function(_0x2b6503,_0x30b3d9,_0x3fcf7a){var _0x4d03a2;return db[_0xb916('0x3c')][_0xb916('0x61')]({'where':{'id':_0x2b6503[_0xb916('0x53')]['id']}})[_0xb916('0x1c')](handleEntityNotFound(_0x30b3d9,null))['then'](saveUpdates(_0x2b6503['body'],null))[_0xb916('0x1c')](function(_0x5a4c5b){if(_0x5a4c5b){_0x4d03a2=_0x5a4c5b;return db['VoiceContext'][_0xb916('0x51')]({'raw':!![]});}})[_0xb916('0x1c')](function(_0x571ccf){var _0xa05769=fs[_0xb916('0x57')](path['join'](config[_0xb916('0x58')],'server/files/templates/context.ejs'),_0xb916('0x5a'));var _0x21f7fc=ejs['render'](_0xa05769,{'contexts':_0x571ccf||[]});fs[_0xb916('0x5c')](_0xb916('0x65'),_0x21f7fc);})[_0xb916('0x1c')](function(){return respondWithRpcPromise(_0xb916('0x66'),_0xb916('0x33'),{'module':_0xb916('0x5d')});})['then'](function(){return _0x4d03a2;})[_0xb916('0x1c')](respondWithResult(_0x30b3d9,null))[_0xb916('0x26')](handleError(_0x30b3d9,null));};exports[_0xb916('0x67')]=function(_0x2c6822,_0x523b6f,_0x38d010){var _0x381614;return db[_0xb916('0x3c')][_0xb916('0x61')]({'where':{'id':_0x2c6822[_0xb916('0x53')]['id']}})[_0xb916('0x1c')](handleEntityNotFound(_0x523b6f,null))[_0xb916('0x1c')](removeEntity(_0x523b6f,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xb916('0x1c')](function(_0x3b583d){var _0x100f0b=fs['readFileSync'](path[_0xb916('0x68')](config[_0xb916('0x58')],'server/files/templates/context.ejs'),_0xb916('0x5a'));var _0x30599a=ejs[_0xb916('0x5b')](_0x100f0b,{'contexts':_0x3b583d});fs[_0xb916('0x5c')](_0xb916('0x65'),_0x30599a);return respondWithRpcPromise(_0xb916('0x66'),'destroy',{'module':_0xb916('0x5d')});})[_0xb916('0x26')](handleError(_0x523b6f,null));}; \ No newline at end of file +var _0x7654=['user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','set','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','merge','filter','options','count','include','findAll','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so'];(function(_0x139a23,_0x184a3f){var _0x4da424=function(_0x5d6309){while(--_0x5d6309){_0x139a23['push'](_0x139a23['shift']());}};_0x4da424(++_0x184a3f);}(_0x7654,0x179));var _0x4765=function(_0x46b6f1,_0x46a2dd){_0x46b6f1=_0x46b6f1-0x0;var _0x72ce25=_0x7654[_0x46b6f1];return _0x72ce25;};'use strict';var emlformat=require(_0x4765('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4765('0x1'));var jsonpatch=require(_0x4765('0x2'));var rp=require(_0x4765('0x3'));var moment=require(_0x4765('0x4'));var BPromise=require(_0x4765('0x5'));var Mustache=require(_0x4765('0x6'));var util=require('util');var path=require(_0x4765('0x7'));var sox=require('sox');var csv=require(_0x4765('0x8'));var ejs=require(_0x4765('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4765('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4765('0xb'));var toCsv=require(_0x4765('0x8'));var querystring=require(_0x4765('0xc'));var Papa=require(_0x4765('0xd'));var Redis=require(_0x4765('0xe'));var authService=require(_0x4765('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4765('0x10'))(_0x4765('0x11'));var utils=require('../../config/utils');var config=require(_0x4765('0x12'));var licenseUtil=require(_0x4765('0x13'));var db=require(_0x4765('0x14'))['db'];var jayson=require(_0x4765('0x15'));var client=jayson['client'][_0x4765('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x296894,_0x187639,_0x4c5147,_0x262049){return new BPromise(function(_0x4db297,_0x356eca){var _0x1e82c7=_0x262049||client;return _0x1e82c7['request'](_0x296894,_0x4c5147)[_0x4765('0x17')](function(_0x4ca42b){logger[_0x4765('0x18')](_0x4765('0x19'),_0x187639,_0x4765('0x1a'));logger[_0x4765('0x1b')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x187639,_0x4765('0x1a'),JSON[_0x4765('0x1c')](_0x4ca42b));if(_0x4ca42b[_0x4765('0x1d')]){if(_0x4ca42b[_0x4765('0x1d')][_0x4765('0x1e')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x187639,_0x4ca42b[_0x4765('0x1d')][_0x4765('0x1f')]);return _0x356eca(_0x4ca42b[_0x4765('0x1d')]['message']);}logger[_0x4765('0x1d')](_0x4765('0x19'),_0x187639,_0x4ca42b['error'][_0x4765('0x1f')]);return _0x4db297(_0x4ca42b[_0x4765('0x1d')]['message']);}else{logger[_0x4765('0x18')](_0x4765('0x19'),_0x187639,_0x4765('0x1a'));_0x4db297(_0x4ca42b['result'][_0x4765('0x1f')]);}})[_0x4765('0x20')](function(_0x467cd0){logger[_0x4765('0x1d')](_0x4765('0x19'),_0x187639,_0x467cd0);_0x356eca(_0x467cd0);});});}function respondWithStatusCode(_0x197f95,_0xe7084f){_0xe7084f=_0xe7084f||0xcc;return function(_0x4ce526){if(_0x4ce526){return _0x197f95[_0x4765('0x21')](_0xe7084f);}return _0x197f95[_0x4765('0x22')](_0xe7084f)[_0x4765('0x23')]();};}function respondWithResult(_0x47d1d2,_0x348cf4){_0x348cf4=_0x348cf4||0xc8;return function(_0x8060eb){if(_0x8060eb){return _0x47d1d2[_0x4765('0x22')](_0x348cf4)[_0x4765('0x24')](_0x8060eb);}};}function respondWithFilteredResult(_0x2e3778,_0x119ec6){return function(_0x8f3069){if(_0x8f3069){var _0x28bb93=typeof _0x119ec6[_0x4765('0x25')]==='undefined'&&typeof _0x119ec6[_0x4765('0x26')]===_0x4765('0x27');var _0x5193a9=_0x8f3069['count'];var _0x38eff4=_0x28bb93?0x0:_0x119ec6[_0x4765('0x25')];var _0x93b931=_0x28bb93?_0x8f3069['count']:_0x119ec6[_0x4765('0x25')]+_0x119ec6[_0x4765('0x26')];var _0x28376b;if(_0x93b931>=_0x5193a9){_0x93b931=_0x5193a9;_0x28376b=0xc8;}else{_0x28376b=0xce;}_0x2e3778[_0x4765('0x22')](_0x28376b);return _0x2e3778[_0x4765('0x28')]('Content-Range',_0x38eff4+'-'+_0x93b931+'/'+_0x5193a9)[_0x4765('0x24')](_0x8f3069);}return null;};}function patchUpdates(_0x2042be){return function(_0x420203){try{jsonpatch['apply'](_0x420203,_0x2042be,!![]);}catch(_0x1f21c8){return BPromise[_0x4765('0x29')](_0x1f21c8);}return _0x420203[_0x4765('0x2a')]();};}function saveUpdates(_0x42f0d6,_0x424ff7){return function(_0x4b8a18){if(_0x4b8a18){return _0x4b8a18[_0x4765('0x2b')](_0x42f0d6)[_0x4765('0x17')](function(_0x265be9){return _0x265be9;});}return null;};}function removeEntity(_0x5cfb4d,_0x1624c8){return function(_0xeaae11){if(_0xeaae11){return _0xeaae11[_0x4765('0x2c')]()[_0x4765('0x17')](function(){var _0x260b09=_0xeaae11[_0x4765('0x2d')]({'plain':!![]});var _0x2e96b5=_0x4765('0x2e');return db[_0x4765('0x2f')][_0x4765('0x2c')]({'where':{'type':_0x2e96b5,'resourceId':_0x260b09['id']}})[_0x4765('0x17')](function(){return _0xeaae11;});})[_0x4765('0x17')](function(){_0x5cfb4d[_0x4765('0x22')](0xcc)[_0x4765('0x23')]();});}};}function handleEntityNotFound(_0x5403aa,_0x14ddd0){return function(_0x8b0513){if(!_0x8b0513){_0x5403aa[_0x4765('0x21')](0x194);}return _0x8b0513;};}function handleError(_0x45522c,_0x2c06bd){_0x2c06bd=_0x2c06bd||0x1f4;return function(_0x925961){logger[_0x4765('0x1d')](_0x925961[_0x4765('0x30')]);if(_0x925961[_0x4765('0x31')]){delete _0x925961['name'];}_0x45522c[_0x4765('0x22')](_0x2c06bd)[_0x4765('0x32')](_0x925961);};}exports[_0x4765('0x33')]=function(_0x5ee8d1,_0x20ae2d){var _0x116336={},_0xe1a211={},_0x26ef15={'count':0x0,'rows':[]};var _0x1cf573=_[_0x4765('0x34')](db[_0x4765('0x35')][_0x4765('0x36')],function(_0x2575d9){return{'name':_0x2575d9[_0x4765('0x37')],'type':_0x2575d9[_0x4765('0x38')][_0x4765('0x39')]};});_0xe1a211[_0x4765('0x3a')]=_[_0x4765('0x34')](_0x1cf573,_0x4765('0x31'));_0xe1a211[_0x4765('0x3b')]=_[_0x4765('0x3c')](_0x5ee8d1[_0x4765('0x3b')]);_0xe1a211['filters']=_[_0x4765('0x3d')](_0xe1a211['model'],_0xe1a211['query']);_0x116336[_0x4765('0x3e')]=_['intersection'](_0xe1a211['model'],qs[_0x4765('0x3f')](_0x5ee8d1['query'][_0x4765('0x3f')]));_0x116336[_0x4765('0x3e')]=_0x116336[_0x4765('0x3e')][_0x4765('0x40')]?_0x116336[_0x4765('0x3e')]:_0xe1a211[_0x4765('0x3a')];if(!_0x5ee8d1['query']['hasOwnProperty'](_0x4765('0x41'))){_0x116336['limit']=qs['limit'](_0x5ee8d1[_0x4765('0x3b')][_0x4765('0x26')]);_0x116336[_0x4765('0x25')]=qs[_0x4765('0x25')](_0x5ee8d1[_0x4765('0x3b')][_0x4765('0x25')]);}_0x116336[_0x4765('0x42')]=qs[_0x4765('0x43')](_0x5ee8d1[_0x4765('0x3b')][_0x4765('0x43')]);_0x116336['where']=qs[_0x4765('0x44')](_['pick'](_0x5ee8d1[_0x4765('0x3b')],_0xe1a211[_0x4765('0x44')]),_0x1cf573);if(_0x5ee8d1[_0x4765('0x3b')]['filter']){_0x116336['where']=_[_0x4765('0x45')](_0x116336['where'],{'$or':_['map'](_0x1cf573,function(_0x550ff4){if(_0x550ff4[_0x4765('0x38')]!=='VIRTUAL'){var _0x23910e={};_0x23910e[_0x550ff4[_0x4765('0x31')]]={'$like':'%'+_0x5ee8d1[_0x4765('0x3b')][_0x4765('0x46')]+'%'};return _0x23910e;}})});}_0x116336=_[_0x4765('0x45')]({},_0x116336,_0x5ee8d1[_0x4765('0x47')]);var _0x1521e2={'where':_0x116336['where']};return db[_0x4765('0x35')][_0x4765('0x48')](_0x1521e2)[_0x4765('0x17')](function(_0x3857e4){_0x26ef15[_0x4765('0x48')]=_0x3857e4;if(_0x5ee8d1[_0x4765('0x3b')]['includeAll']){_0x116336[_0x4765('0x49')]=[{'all':!![]}];}return db[_0x4765('0x35')][_0x4765('0x4a')](_0x116336);})[_0x4765('0x17')](function(_0x3dac37){_0x26ef15['rows']=_0x3dac37;return _0x26ef15;})[_0x4765('0x17')](respondWithFilteredResult(_0x20ae2d,_0x116336))[_0x4765('0x20')](handleError(_0x20ae2d,null));};exports['show']=function(_0x3c08d8,_0x1d78e2){var _0x4b95f0={'raw':![],'where':{'id':_0x3c08d8['params']['id']}},_0x1d5097={};_0x1d5097['model']=_[_0x4765('0x3c')](db[_0x4765('0x35')]['rawAttributes']);_0x1d5097['query']=_[_0x4765('0x3c')](_0x3c08d8[_0x4765('0x3b')]);_0x1d5097[_0x4765('0x44')]=_[_0x4765('0x3d')](_0x1d5097[_0x4765('0x3a')],_0x1d5097['query']);_0x4b95f0[_0x4765('0x3e')]=_[_0x4765('0x3d')](_0x1d5097['model'],qs[_0x4765('0x3f')](_0x3c08d8['query'][_0x4765('0x3f')]));_0x4b95f0[_0x4765('0x3e')]=_0x4b95f0[_0x4765('0x3e')]['length']?_0x4b95f0[_0x4765('0x3e')]:_0x1d5097[_0x4765('0x3a')];if(_0x3c08d8[_0x4765('0x3b')]['includeAll']){_0x4b95f0[_0x4765('0x49')]=[{'all':!![]}];}_0x4b95f0=_[_0x4765('0x45')]({},_0x4b95f0,_0x3c08d8[_0x4765('0x47')]);return db[_0x4765('0x35')][_0x4765('0x4b')](_0x4b95f0)[_0x4765('0x17')](handleEntityNotFound(_0x1d78e2,null))[_0x4765('0x17')](respondWithResult(_0x1d78e2,null))['catch'](handleError(_0x1d78e2,null));};exports[_0x4765('0x4c')]=function(_0x7ba3b8,_0xa29f21,_0x819860){var _0x561541;return db[_0x4765('0x35')][_0x4765('0x4c')](_0x7ba3b8[_0x4765('0x4d')],{'raw':!![]})[_0x4765('0x17')](function(_0x34d545){_0x561541=_0x34d545;return db['VoiceContext'][_0x4765('0x4a')]({'raw':!![]});})[_0x4765('0x17')](function(_0x2e59d4){var _0x2be284=fs[_0x4765('0x4e')](path[_0x4765('0x4f')](config[_0x4765('0x50')],_0x4765('0x51')),_0x4765('0x52'));var _0x165450=ejs[_0x4765('0x53')](_0x2be284,{'contexts':_0x2e59d4||[]});fs[_0x4765('0x54')](_0x4765('0x55'),_0x165450);})[_0x4765('0x17')](function(){return respondWithRpcPromise(_0x4765('0x56'),_0x4765('0x4c'),{'module':_0x4765('0x57')});})[_0x4765('0x17')](function(){var _0x22cf7f=_0x7ba3b8[_0x4765('0x58')]['get']({'plain':!![]});if(!_0x22cf7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22cf7f[_0x4765('0x59')]===_0x4765('0x58')){var _0xdbdb9c=_0x561541[_0x4765('0x2d')]({'plain':!![]});return db[_0x4765('0x5a')][_0x4765('0x4b')]({'where':{'name':'Contexts','userProfileId':_0x22cf7f['userProfileId']},'raw':!![]})[_0x4765('0x17')](function(_0x380c9e){if(_0x380c9e&&_0x380c9e['autoAssociation']===0x0){return db[_0x4765('0x2f')][_0x4765('0x4c')]({'name':_0xdbdb9c[_0x4765('0x31')],'resourceId':_0xdbdb9c['id'],'type':_0x380c9e['name'],'sectionId':_0x380c9e['id']},{})[_0x4765('0x17')](function(){return _0x561541;});}else{return _0x561541;}})['catch'](function(_0x205b21){logger[_0x4765('0x1d')](_0x4765('0x5b'),_0x205b21);throw _0x205b21;});}return _0x561541;})[_0x4765('0x17')](respondWithResult(_0xa29f21,0xc9))['catch'](handleError(_0xa29f21,null));};exports['update']=function(_0x11887b,_0x21c1ff,_0x2b80c0){var _0x285470;return db[_0x4765('0x35')]['find']({'where':{'id':_0x11887b[_0x4765('0x5c')]['id']}})[_0x4765('0x17')](handleEntityNotFound(_0x21c1ff,null))[_0x4765('0x17')](saveUpdates(_0x11887b[_0x4765('0x4d')],null))['then'](function(_0x4c6a0b){if(_0x4c6a0b){_0x285470=_0x4c6a0b;return db[_0x4765('0x35')][_0x4765('0x4a')]({'raw':!![]});}})[_0x4765('0x17')](function(_0x4fb20b){var _0x37acf3=fs['readFileSync'](path[_0x4765('0x4f')](config[_0x4765('0x50')],_0x4765('0x51')),_0x4765('0x52'));var _0x345e9c=ejs['render'](_0x37acf3,{'contexts':_0x4fb20b||[]});fs[_0x4765('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x345e9c);})[_0x4765('0x17')](function(){return respondWithRpcPromise(_0x4765('0x56'),_0x4765('0x2b'),{'module':_0x4765('0x57')});})[_0x4765('0x17')](function(){return _0x285470;})[_0x4765('0x17')](respondWithResult(_0x21c1ff,null))[_0x4765('0x20')](handleError(_0x21c1ff,null));};exports[_0x4765('0x2c')]=function(_0x674d54,_0x305ff5,_0x30ef6e){var _0x48c2cb;return db[_0x4765('0x35')][_0x4765('0x4b')]({'where':{'id':_0x674d54[_0x4765('0x5c')]['id']}})[_0x4765('0x17')](handleEntityNotFound(_0x305ff5,null))[_0x4765('0x17')](removeEntity(_0x305ff5,null))[_0x4765('0x17')](function(){return db[_0x4765('0x35')][_0x4765('0x4a')]({'raw':!![]});})[_0x4765('0x17')](function(_0x515d36){var _0x1647d7=fs[_0x4765('0x4e')](path[_0x4765('0x4f')](config[_0x4765('0x50')],'server/files/templates/context.ejs'),'utf8');var _0x3b00f8=ejs[_0x4765('0x53')](_0x1647d7,{'contexts':_0x515d36});fs[_0x4765('0x54')](_0x4765('0x55'),_0x3b00f8);return respondWithRpcPromise(_0x4765('0x56'),_0x4765('0x2c'),{'module':_0x4765('0x57')});})[_0x4765('0x20')](handleError(_0x305ff5,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 8552674..ee80eb7 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 _0xaa35=['moment','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0xaa35,0x112));var _0x5aa3=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xaa35[_0x2c1114];return _0x2b877c;};'use strict';var _=require(_0x5aa3('0x0'));var util=require('util');var logger=require(_0x5aa3('0x1'))('api');var moment=require(_0x5aa3('0x2'));var BPromise=require(_0x5aa3('0x3'));var rp=require(_0x5aa3('0x4'));var fs=require('fs');var path=require(_0x5aa3('0x5'));var rimraf=require('rimraf');var config=require(_0x5aa3('0x6'));var attributes=require(_0x5aa3('0x7'));module[_0x5aa3('0x8')]=function(_0x436689,_0x322267){return _0x436689[_0x5aa3('0x9')](_0x5aa3('0xa'),attributes,{'tableName':_0x5aa3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3748=['VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x428e39,_0x180402){var _0x463ad6=function(_0x4b96a2){while(--_0x4b96a2){_0x428e39['push'](_0x428e39['shift']());}};_0x463ad6(++_0x180402);}(_0x3748,0x12d));var _0x8374=function(_0x220d93,_0x129be3){_0x220d93=_0x220d93-0x0;var _0x59e707=_0x3748[_0x220d93];return _0x59e707;};'use strict';var _=require(_0x8374('0x0'));var util=require(_0x8374('0x1'));var logger=require(_0x8374('0x2'))('api');var moment=require(_0x8374('0x3'));var BPromise=require(_0x8374('0x4'));var rp=require(_0x8374('0x5'));var fs=require('fs');var path=require(_0x8374('0x6'));var rimraf=require(_0x8374('0x7'));var config=require(_0x8374('0x8'));var attributes=require(_0x8374('0x9'));module[_0x8374('0xa')]=function(_0x411103,_0x1fa689){return _0x411103['define'](_0x8374('0xb'),attributes,{'tableName':'voice_contexts','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 c2c0c39..8e76688 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 _0x19c3=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x3ad737,_0x300131){var _0x16c1e2=function(_0x4c64fe){while(--_0x4c64fe){_0x3ad737['push'](_0x3ad737['shift']());}};_0x16c1e2(++_0x300131);}(_0x19c3,0xf9));var _0x319c=function(_0x34832f,_0x34e014){_0x34832f=_0x34832f-0x0;var _0x587cdd=_0x19c3[_0x34832f];return _0x587cdd;};'use strict';var _=require(_0x319c('0x0'));var util=require('util');var moment=require(_0x319c('0x1'));var BPromise=require(_0x319c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x319c('0x3'));var db=require(_0x319c('0x4'))['db'];var utils=require(_0x319c('0x5'));var logger=require(_0x319c('0x6'))(_0x319c('0x7'));var config=require(_0x319c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x319c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e38c4,_0x2df1a9,_0x9a5cf8){return new BPromise(function(_0x306a4b,_0x3662ed){return client['request'](_0x2e38c4,_0x9a5cf8)[_0x319c('0xa')](function(_0x1b7ffd){logger[_0x319c('0xb')](_0x319c('0xc'),_0x2df1a9,_0x319c('0xd'));logger[_0x319c('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2df1a9,_0x319c('0xd'),JSON['stringify'](_0x1b7ffd));if(_0x1b7ffd[_0x319c('0xf')]){if(_0x1b7ffd[_0x319c('0xf')][_0x319c('0x10')]===0x1f4){logger[_0x319c('0xf')](_0x319c('0xc'),_0x2df1a9,_0x1b7ffd[_0x319c('0xf')][_0x319c('0x11')]);return _0x3662ed(_0x1b7ffd['error']['message']);}logger[_0x319c('0xf')](_0x319c('0xc'),_0x2df1a9,_0x1b7ffd['error'][_0x319c('0x11')]);return _0x306a4b(_0x1b7ffd[_0x319c('0xf')][_0x319c('0x11')]);}else{logger[_0x319c('0xb')](_0x319c('0xc'),_0x2df1a9,_0x319c('0xd'));_0x306a4b(_0x1b7ffd[_0x319c('0x12')]['message']);}})['catch'](function(_0x9415a5){logger[_0x319c('0xf')]('VoiceContext,\x20%s,\x20%s',_0x2df1a9,_0x9415a5);_0x3662ed(_0x9415a5);});});} \ No newline at end of file +var _0xc493=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2cee5f,_0x27fab5){var _0x238460=function(_0x146b3b){while(--_0x146b3b){_0x2cee5f['push'](_0x2cee5f['shift']());}};_0x238460(++_0x27fab5);}(_0xc493,0x76));var _0x3c49=function(_0x141a2f,_0x58d944){_0x141a2f=_0x141a2f-0x0;var _0x1e84d3=_0xc493[_0x141a2f];return _0x1e84d3;};'use strict';var _=require(_0x3c49('0x0'));var util=require(_0x3c49('0x1'));var moment=require(_0x3c49('0x2'));var BPromise=require(_0x3c49('0x3'));var rs=require(_0x3c49('0x4'));var fs=require('fs');var Redis=require(_0x3c49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c49('0x6'));var logger=require(_0x3c49('0x7'))(_0x3c49('0x8'));var config=require(_0x3c49('0x9'));var jayson=require(_0x3c49('0xa'));var client=jayson[_0x3c49('0xb')][_0x3c49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24dbfa,_0x3a7e4f,_0x3b2cae){return new BPromise(function(_0x1f3310,_0x1a1c70){return client['request'](_0x24dbfa,_0x3b2cae)[_0x3c49('0xd')](function(_0x1607e1){logger[_0x3c49('0xe')](_0x3c49('0xf'),_0x3a7e4f,_0x3c49('0x10'));logger[_0x3c49('0x11')](_0x3c49('0x12'),_0x3a7e4f,_0x3c49('0x10'),JSON[_0x3c49('0x13')](_0x1607e1));if(_0x1607e1[_0x3c49('0x14')]){if(_0x1607e1['error'][_0x3c49('0x15')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3a7e4f,_0x1607e1['error'][_0x3c49('0x16')]);return _0x1a1c70(_0x1607e1['error'][_0x3c49('0x16')]);}logger['error'](_0x3c49('0xf'),_0x3a7e4f,_0x1607e1['error']['message']);return _0x1f3310(_0x1607e1[_0x3c49('0x14')][_0x3c49('0x16')]);}else{logger['info'](_0x3c49('0xf'),_0x3a7e4f,_0x3c49('0x10'));_0x1f3310(_0x1607e1[_0x3c49('0x17')][_0x3c49('0x16')]);}})[_0x3c49('0x18')](function(_0x402df8){logger[_0x3c49('0x14')]('VoiceContext,\x20%s,\x20%s',_0x3a7e4f,_0x402df8);_0x1a1c70(_0x402df8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 50bc40c..7342b5c 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 _0x55c0=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x20a498,_0x1f4fcd){var _0x218057=function(_0x433dfd){while(--_0x433dfd){_0x20a498['push'](_0x20a498['shift']());}};_0x218057(++_0x1f4fcd);}(_0x55c0,0x140));var _0x055c=function(_0x4b8980,_0x2559d8){_0x4b8980=_0x4b8980-0x0;var _0x2e93b4=_0x55c0[_0x4b8980];return _0x2e93b4;};'use strict';var multer=require(_0x055c('0x0'));var util=require('util');var path=require(_0x055c('0x1'));var timeout=require(_0x055c('0x2'));var express=require(_0x055c('0x3'));var router=express['Router']();var fs_extra=require(_0x055c('0x4'));var auth=require(_0x055c('0x5'));var interaction=require(_0x055c('0x6'));var config=require(_0x055c('0x7'));var controller=require(_0x055c('0x8'));router[_0x055c('0x9')]('/',auth[_0x055c('0xa')](),controller[_0x055c('0xb')]);router[_0x055c('0x9')](_0x055c('0xc'),auth[_0x055c('0xa')](),controller[_0x055c('0xd')]);router[_0x055c('0x9')](_0x055c('0xe'),auth[_0x055c('0xa')](),controller[_0x055c('0xf')]);router[_0x055c('0x10')]('/',auth[_0x055c('0xa')](),controller[_0x055c('0x11')]);router[_0x055c('0x12')]('/:id',auth[_0x055c('0xa')](),controller[_0x055c('0x13')]);router[_0x055c('0x14')](_0x055c('0xe'),auth[_0x055c('0xa')](),controller[_0x055c('0x15')]);module[_0x055c('0x16')]=router; \ No newline at end of file +var _0xf7fd=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7fd,0x14c));var _0xdf7f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf7fd[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xdf7f('0x0'));var util=require(_0xdf7f('0x1'));var path=require(_0xdf7f('0x2'));var timeout=require(_0xdf7f('0x3'));var express=require('express');var router=express[_0xdf7f('0x4')]();var fs_extra=require(_0xdf7f('0x5'));var auth=require(_0xdf7f('0x6'));var interaction=require(_0xdf7f('0x7'));var config=require(_0xdf7f('0x8'));var controller=require('./voiceDialReport.controller');router[_0xdf7f('0x9')]('/',auth['isAuthenticated'](),controller[_0xdf7f('0xa')]);router[_0xdf7f('0x9')](_0xdf7f('0xb'),auth[_0xdf7f('0xc')](),controller[_0xdf7f('0xd')]);router[_0xdf7f('0x9')](_0xdf7f('0xe'),auth[_0xdf7f('0xc')](),controller[_0xdf7f('0xf')]);router[_0xdf7f('0x10')]('/',auth[_0xdf7f('0xc')](),controller[_0xdf7f('0x11')]);router[_0xdf7f('0x12')]('/:id',auth[_0xdf7f('0xc')](),controller[_0xdf7f('0x13')]);router[_0xdf7f('0x14')](_0xdf7f('0xe'),auth['isAuthenticated'](),controller[_0xdf7f('0x15')]);module[_0xdf7f('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 a6cf83e..9dd07c9 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x544dc6,_0x186b5a){var _0x46be85=function(_0x73256d){while(--_0x73256d){_0x544dc6['push'](_0x544dc6['shift']());}};_0x46be85(++_0x186b5a);}(_0xa41a,0x6b));var _0xaa41=function(_0xb1aba8,_0x3087da){_0xb1aba8=_0xb1aba8-0x0;var _0xc6a42e=_0xa41a[_0xb1aba8];return _0xc6a42e;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x9f62,0x154));var _0x29f6=function(_0x23d619,_0x2024f5){_0x23d619=_0x23d619-0x0;var _0x21f926=_0x9f62[_0x23d619];return _0x21f926;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ff263bd..d513ac6 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 _0xbf9a=['then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','create','body','params','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','apply','reject','update'];(function(_0x477491,_0x5ca700){var _0xac6aec=function(_0x180568){while(--_0x180568){_0x477491['push'](_0x477491['shift']());}};_0xac6aec(++_0x5ca700);}(_0xbf9a,0x70));var _0xabf9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xbf9a[_0x44a64f];return _0x52024b;};'use strict';var emlformat=require(_0xabf9('0x0'));var rimraf=require(_0xabf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabf9('0x2'));var rp=require(_0xabf9('0x3'));var moment=require(_0xabf9('0x4'));var BPromise=require(_0xabf9('0x5'));var Mustache=require('mustache');var util=require(_0xabf9('0x6'));var path=require('path');var sox=require(_0xabf9('0x7'));var csv=require(_0xabf9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabf9('0x9'));var _=require(_0xabf9('0xa'));var squel=require(_0xabf9('0xb'));var crypto=require(_0xabf9('0xc'));var jsforce=require(_0xabf9('0xd'));var deskjs=require(_0xabf9('0xe'));var toCsv=require(_0xabf9('0x8'));var querystring=require(_0xabf9('0xf'));var Papa=require(_0xabf9('0x10'));var Redis=require(_0xabf9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xabf9('0x12'));var as=require(_0xabf9('0x13'));var hardwareService=require(_0xabf9('0x14'));var logger=require(_0xabf9('0x15'))('api');var utils=require(_0xabf9('0x16'));var config=require(_0xabf9('0x17'));var licenseUtil=require(_0xabf9('0x18'));var db=require(_0xabf9('0x19'))['db'];function respondWithStatusCode(_0x12ebb4,_0x14d980){_0x14d980=_0x14d980||0xcc;return function(_0x1ed3b8){if(_0x1ed3b8){return _0x12ebb4[_0xabf9('0x1a')](_0x14d980);}return _0x12ebb4['status'](_0x14d980)[_0xabf9('0x1b')]();};}function respondWithResult(_0x2b5df8,_0x35b0ec){_0x35b0ec=_0x35b0ec||0xc8;return function(_0x28ffef){if(_0x28ffef){return _0x2b5df8[_0xabf9('0x1c')](_0x35b0ec)[_0xabf9('0x1d')](_0x28ffef);}};}function respondWithFilteredResult(_0x5627df,_0x4fa39c){return function(_0x5a3c35){if(_0x5a3c35){var _0x4f20b7=typeof _0x4fa39c[_0xabf9('0x1e')]==='undefined'&&typeof _0x4fa39c[_0xabf9('0x1f')]==='undefined';var _0x2d834c=_0x5a3c35[_0xabf9('0x20')];var _0x1c1523=_0x4f20b7?0x0:_0x4fa39c[_0xabf9('0x1e')];var _0xfa9f30=_0x4f20b7?_0x5a3c35[_0xabf9('0x20')]:_0x4fa39c[_0xabf9('0x1e')]+_0x4fa39c[_0xabf9('0x1f')];var _0x39666c;if(_0xfa9f30>=_0x2d834c){_0xfa9f30=_0x2d834c;_0x39666c=0xc8;}else{_0x39666c=0xce;}_0x5627df[_0xabf9('0x1c')](_0x39666c);return _0x5627df['set']('Content-Range',_0x1c1523+'-'+_0xfa9f30+'/'+_0x2d834c)[_0xabf9('0x1d')](_0x5a3c35);}return null;};}function patchUpdates(_0x1bfd32){return function(_0x212706){try{jsonpatch[_0xabf9('0x21')](_0x212706,_0x1bfd32,!![]);}catch(_0x5115bd){return BPromise[_0xabf9('0x22')](_0x5115bd);}return _0x212706['save']();};}function saveUpdates(_0x2b97b8,_0x284468){return function(_0x50aeaf){if(_0x50aeaf){return _0x50aeaf[_0xabf9('0x23')](_0x2b97b8)[_0xabf9('0x24')](function(_0x5ecbeb){return _0x5ecbeb;});}return null;};}function removeEntity(_0x135a95,_0x437394){return function(_0x236b49){if(_0x236b49){return _0x236b49[_0xabf9('0x25')]()[_0xabf9('0x24')](function(){_0x135a95[_0xabf9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x437811,_0xa4f6f3){return function(_0x50ba0e){if(!_0x50ba0e){_0x437811[_0xabf9('0x1a')](0x194);}return _0x50ba0e;};}function handleError(_0x5d8182,_0x4408ed){_0x4408ed=_0x4408ed||0x1f4;return function(_0xc4fbe1){logger[_0xabf9('0x26')](_0xc4fbe1[_0xabf9('0x27')]);if(_0xc4fbe1[_0xabf9('0x28')]){delete _0xc4fbe1[_0xabf9('0x28')];}_0x5d8182[_0xabf9('0x1c')](_0x4408ed)[_0xabf9('0x29')](_0xc4fbe1);};}exports[_0xabf9('0x2a')]=function(_0x1b6c7e,_0x9d9b51){var _0x26d646={},_0x1e82b2={},_0x3369d1={'count':0x0,'rows':[]};var _0x9b28f7=_[_0xabf9('0x2b')](db[_0xabf9('0x2c')][_0xabf9('0x2d')],function(_0x515f9d){return{'name':_0x515f9d['fieldName'],'type':_0x515f9d[_0xabf9('0x2e')]['key']};});_0x1e82b2['model']=_[_0xabf9('0x2b')](_0x9b28f7,'name');_0x1e82b2[_0xabf9('0x2f')]=_[_0xabf9('0x30')](_0x1b6c7e[_0xabf9('0x2f')]);_0x1e82b2['filters']=_[_0xabf9('0x31')](_0x1e82b2[_0xabf9('0x32')],_0x1e82b2[_0xabf9('0x2f')]);_0x26d646[_0xabf9('0x33')]=_[_0xabf9('0x31')](_0x1e82b2[_0xabf9('0x32')],qs['fields'](_0x1b6c7e['query'][_0xabf9('0x34')]));_0x26d646[_0xabf9('0x33')]=_0x26d646[_0xabf9('0x33')][_0xabf9('0x35')]?_0x26d646[_0xabf9('0x33')]:_0x1e82b2[_0xabf9('0x32')];if(!_0x1b6c7e[_0xabf9('0x2f')][_0xabf9('0x36')](_0xabf9('0x37'))){_0x26d646[_0xabf9('0x1f')]=qs[_0xabf9('0x1f')](_0x1b6c7e[_0xabf9('0x2f')][_0xabf9('0x1f')]);_0x26d646[_0xabf9('0x1e')]=qs[_0xabf9('0x1e')](_0x1b6c7e[_0xabf9('0x2f')][_0xabf9('0x1e')]);}_0x26d646['order']=qs[_0xabf9('0x38')](_0x1b6c7e[_0xabf9('0x2f')][_0xabf9('0x38')]);_0x26d646[_0xabf9('0x39')]=qs[_0xabf9('0x3a')](_[_0xabf9('0x3b')](_0x1b6c7e[_0xabf9('0x2f')],_0x1e82b2[_0xabf9('0x3a')]),_0x9b28f7);if(_0x1b6c7e['query'][_0xabf9('0x3c')]){_0x26d646[_0xabf9('0x39')]=_[_0xabf9('0x3d')](_0x26d646[_0xabf9('0x39')],{'$or':_[_0xabf9('0x2b')](_0x9b28f7,function(_0x7e60ce){if(_0x7e60ce[_0xabf9('0x2e')]!==_0xabf9('0x3e')){var _0x431880={};_0x431880[_0x7e60ce[_0xabf9('0x28')]]={'$like':'%'+_0x1b6c7e[_0xabf9('0x2f')][_0xabf9('0x3c')]+'%'};return _0x431880;}})});}_0x26d646=_['merge']({},_0x26d646,_0x1b6c7e[_0xabf9('0x3f')]);var _0x588346={'where':_0x26d646[_0xabf9('0x39')]};return db[_0xabf9('0x2c')]['count'](_0x588346)[_0xabf9('0x24')](function(_0x4b90bf){_0x3369d1['count']=_0x4b90bf;if(_0x1b6c7e[_0xabf9('0x2f')]['includeAll']){_0x26d646['include']=[{'all':!![]}];}return db[_0xabf9('0x2c')]['findAll'](_0x26d646);})[_0xabf9('0x24')](function(_0x1bbc8e){_0x3369d1[_0xabf9('0x40')]=_0x1bbc8e;return _0x3369d1;})[_0xabf9('0x24')](respondWithFilteredResult(_0x9d9b51,_0x26d646))[_0xabf9('0x41')](handleError(_0x9d9b51,null));};exports[_0xabf9('0x42')]=function(_0x432f99,_0x302996){var _0x286f9b={'raw':!![],'where':{'id':_0x432f99['params']['id']}},_0x4277d4={};_0x4277d4[_0xabf9('0x32')]=_[_0xabf9('0x30')](db[_0xabf9('0x2c')][_0xabf9('0x2d')]);_0x4277d4['query']=_[_0xabf9('0x30')](_0x432f99[_0xabf9('0x2f')]);_0x4277d4[_0xabf9('0x3a')]=_[_0xabf9('0x31')](_0x4277d4['model'],_0x4277d4[_0xabf9('0x2f')]);_0x286f9b[_0xabf9('0x33')]=_[_0xabf9('0x31')](_0x4277d4[_0xabf9('0x32')],qs[_0xabf9('0x34')](_0x432f99[_0xabf9('0x2f')][_0xabf9('0x34')]));_0x286f9b[_0xabf9('0x33')]=_0x286f9b['attributes'][_0xabf9('0x35')]?_0x286f9b[_0xabf9('0x33')]:_0x4277d4[_0xabf9('0x32')];if(_0x432f99[_0xabf9('0x2f')][_0xabf9('0x43')]){_0x286f9b[_0xabf9('0x44')]=[{'all':!![]}];}_0x286f9b=_[_0xabf9('0x3d')]({},_0x286f9b,_0x432f99[_0xabf9('0x3f')]);return db['VoiceDialReport']['find'](_0x286f9b)[_0xabf9('0x24')](handleEntityNotFound(_0x302996,null))[_0xabf9('0x24')](respondWithResult(_0x302996,null))[_0xabf9('0x41')](handleError(_0x302996,null));};exports[_0xabf9('0x45')]=function(_0x51768c,_0x3696f5){return db[_0xabf9('0x2c')][_0xabf9('0x45')](_0x51768c[_0xabf9('0x46')],{})[_0xabf9('0x24')](respondWithResult(_0x3696f5,0xc9))[_0xabf9('0x41')](handleError(_0x3696f5,null));};exports['update']=function(_0x463243,_0x136f79){if(_0x463243[_0xabf9('0x46')]['id']){delete _0x463243[_0xabf9('0x46')]['id'];}return db[_0xabf9('0x2c')]['find']({'where':{'id':_0x463243[_0xabf9('0x47')]['id']}})[_0xabf9('0x24')](handleEntityNotFound(_0x136f79,null))[_0xabf9('0x24')](saveUpdates(_0x463243[_0xabf9('0x46')],null))['then'](respondWithResult(_0x136f79,null))[_0xabf9('0x41')](handleError(_0x136f79,null));};exports[_0xabf9('0x25')]=function(_0x4d55b3,_0x444ed2){return db[_0xabf9('0x2c')][_0xabf9('0x48')]({'where':{'id':_0x4d55b3[_0xabf9('0x47')]['id']}})['then'](handleEntityNotFound(_0x444ed2,null))[_0xabf9('0x24')](removeEntity(_0x444ed2,null))[_0xabf9('0x41')](handleError(_0x444ed2,null));};exports[_0xabf9('0x49')]=function(_0xdf0a25,_0x45fb9e){return db[_0xabf9('0x2c')][_0xabf9('0x49')]()['then'](respondWithResult(_0x45fb9e,null))[_0xabf9('0x41')](handleError(_0x45fb9e,null));}; \ No newline at end of file +var _0x8a54=['end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x380af2,_0x36cf66){var _0x1789dc=function(_0x37b604){while(--_0x37b604){_0x380af2['push'](_0x380af2['shift']());}};_0x1789dc(++_0x36cf66);}(_0x8a54,0x80));var _0x48a5=function(_0x162dcc,_0xbb7c6c){_0x162dcc=_0x162dcc-0x0;var _0x4ebced=_0x8a54[_0x162dcc];return _0x4ebced;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48a5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48a5('0x1'));var rp=require(_0x48a5('0x2'));var moment=require(_0x48a5('0x3'));var BPromise=require(_0x48a5('0x4'));var Mustache=require(_0x48a5('0x5'));var util=require('util');var path=require(_0x48a5('0x6'));var sox=require(_0x48a5('0x7'));var csv=require(_0x48a5('0x8'));var ejs=require(_0x48a5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x48a5('0xa'));var crypto=require(_0x48a5('0xb'));var jsforce=require(_0x48a5('0xc'));var deskjs=require(_0x48a5('0xd'));var toCsv=require(_0x48a5('0x8'));var querystring=require(_0x48a5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x48a5('0xf'));var qs=require(_0x48a5('0x10'));var as=require(_0x48a5('0x11'));var hardwareService=require(_0x48a5('0x12'));var logger=require(_0x48a5('0x13'))('api');var utils=require(_0x48a5('0x14'));var config=require(_0x48a5('0x15'));var licenseUtil=require(_0x48a5('0x16'));var db=require(_0x48a5('0x17'))['db'];function respondWithStatusCode(_0x586584,_0xacf7e8){_0xacf7e8=_0xacf7e8||0xcc;return function(_0x19fb25){if(_0x19fb25){return _0x586584[_0x48a5('0x18')](_0xacf7e8);}return _0x586584[_0x48a5('0x19')](_0xacf7e8)[_0x48a5('0x1a')]();};}function respondWithResult(_0x2d694c,_0x78b0b1){_0x78b0b1=_0x78b0b1||0xc8;return function(_0x4d237b){if(_0x4d237b){return _0x2d694c[_0x48a5('0x19')](_0x78b0b1)[_0x48a5('0x1b')](_0x4d237b);}};}function respondWithFilteredResult(_0x3a4147,_0x4ca173){return function(_0x42bc17){if(_0x42bc17){var _0x2c8a12=typeof _0x4ca173[_0x48a5('0x1c')]===_0x48a5('0x1d')&&typeof _0x4ca173['limit']==='undefined';var _0x5fefa6=_0x42bc17[_0x48a5('0x1e')];var _0x5c49a2=_0x2c8a12?0x0:_0x4ca173['offset'];var _0x1c22e6=_0x2c8a12?_0x42bc17[_0x48a5('0x1e')]:_0x4ca173['offset']+_0x4ca173[_0x48a5('0x1f')];var _0x328cd3;if(_0x1c22e6>=_0x5fefa6){_0x1c22e6=_0x5fefa6;_0x328cd3=0xc8;}else{_0x328cd3=0xce;}_0x3a4147[_0x48a5('0x19')](_0x328cd3);return _0x3a4147[_0x48a5('0x20')](_0x48a5('0x21'),_0x5c49a2+'-'+_0x1c22e6+'/'+_0x5fefa6)[_0x48a5('0x1b')](_0x42bc17);}return null;};}function patchUpdates(_0x3ce4bb){return function(_0x14cba9){try{jsonpatch['apply'](_0x14cba9,_0x3ce4bb,!![]);}catch(_0x226777){return BPromise[_0x48a5('0x22')](_0x226777);}return _0x14cba9[_0x48a5('0x23')]();};}function saveUpdates(_0x193519,_0x1e3193){return function(_0x40a200){if(_0x40a200){return _0x40a200[_0x48a5('0x24')](_0x193519)[_0x48a5('0x25')](function(_0x5a676b){return _0x5a676b;});}return null;};}function removeEntity(_0x14275d,_0x18dbbd){return function(_0x397a9e){if(_0x397a9e){return _0x397a9e[_0x48a5('0x26')]()[_0x48a5('0x25')](function(){_0x14275d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x270c46,_0x23f8e9){return function(_0x37d1f7){if(!_0x37d1f7){_0x270c46[_0x48a5('0x18')](0x194);}return _0x37d1f7;};}function handleError(_0x37649f,_0x50217b){_0x50217b=_0x50217b||0x1f4;return function(_0x465432){logger[_0x48a5('0x27')](_0x465432[_0x48a5('0x28')]);if(_0x465432[_0x48a5('0x29')]){delete _0x465432['name'];}_0x37649f['status'](_0x50217b)[_0x48a5('0x2a')](_0x465432);};}exports[_0x48a5('0x2b')]=function(_0x3bbdc8,_0x50dd20){var _0x455245={},_0xe973c5={},_0x1016ba={'count':0x0,'rows':[]};var _0x507a3a=_['map'](db[_0x48a5('0x2c')][_0x48a5('0x2d')],function(_0x50a7df){return{'name':_0x50a7df['fieldName'],'type':_0x50a7df[_0x48a5('0x2e')][_0x48a5('0x2f')]};});_0xe973c5[_0x48a5('0x30')]=_[_0x48a5('0x31')](_0x507a3a,_0x48a5('0x29'));_0xe973c5[_0x48a5('0x32')]=_[_0x48a5('0x33')](_0x3bbdc8[_0x48a5('0x32')]);_0xe973c5[_0x48a5('0x34')]=_[_0x48a5('0x35')](_0xe973c5[_0x48a5('0x30')],_0xe973c5[_0x48a5('0x32')]);_0x455245[_0x48a5('0x36')]=_['intersection'](_0xe973c5[_0x48a5('0x30')],qs['fields'](_0x3bbdc8[_0x48a5('0x32')][_0x48a5('0x37')]));_0x455245[_0x48a5('0x36')]=_0x455245[_0x48a5('0x36')][_0x48a5('0x38')]?_0x455245[_0x48a5('0x36')]:_0xe973c5['model'];if(!_0x3bbdc8[_0x48a5('0x32')][_0x48a5('0x39')](_0x48a5('0x3a'))){_0x455245[_0x48a5('0x1f')]=qs[_0x48a5('0x1f')](_0x3bbdc8['query'][_0x48a5('0x1f')]);_0x455245[_0x48a5('0x1c')]=qs['offset'](_0x3bbdc8['query'][_0x48a5('0x1c')]);}_0x455245[_0x48a5('0x3b')]=qs[_0x48a5('0x3c')](_0x3bbdc8[_0x48a5('0x32')][_0x48a5('0x3c')]);_0x455245[_0x48a5('0x3d')]=qs['filters'](_[_0x48a5('0x3e')](_0x3bbdc8['query'],_0xe973c5['filters']),_0x507a3a);if(_0x3bbdc8[_0x48a5('0x32')][_0x48a5('0x3f')]){_0x455245[_0x48a5('0x3d')]=_[_0x48a5('0x40')](_0x455245[_0x48a5('0x3d')],{'$or':_[_0x48a5('0x31')](_0x507a3a,function(_0x364e3d){if(_0x364e3d[_0x48a5('0x2e')]!==_0x48a5('0x41')){var _0x2b94c8={};_0x2b94c8[_0x364e3d[_0x48a5('0x29')]]={'$like':'%'+_0x3bbdc8['query'][_0x48a5('0x3f')]+'%'};return _0x2b94c8;}})});}_0x455245=_[_0x48a5('0x40')]({},_0x455245,_0x3bbdc8[_0x48a5('0x42')]);var _0x18f615={'where':_0x455245['where']};return db[_0x48a5('0x2c')][_0x48a5('0x1e')](_0x18f615)['then'](function(_0x3c4b67){_0x1016ba[_0x48a5('0x1e')]=_0x3c4b67;if(_0x3bbdc8['query'][_0x48a5('0x43')]){_0x455245[_0x48a5('0x44')]=[{'all':!![]}];}return db[_0x48a5('0x2c')]['findAll'](_0x455245);})['then'](function(_0x5843c2){_0x1016ba[_0x48a5('0x45')]=_0x5843c2;return _0x1016ba;})[_0x48a5('0x25')](respondWithFilteredResult(_0x50dd20,_0x455245))[_0x48a5('0x46')](handleError(_0x50dd20,null));};exports[_0x48a5('0x47')]=function(_0x382d29,_0x1a4054){var _0x2b16f2={'raw':!![],'where':{'id':_0x382d29[_0x48a5('0x48')]['id']}},_0x14449f={};_0x14449f[_0x48a5('0x30')]=_['keys'](db[_0x48a5('0x2c')][_0x48a5('0x2d')]);_0x14449f[_0x48a5('0x32')]=_[_0x48a5('0x33')](_0x382d29[_0x48a5('0x32')]);_0x14449f[_0x48a5('0x34')]=_[_0x48a5('0x35')](_0x14449f[_0x48a5('0x30')],_0x14449f[_0x48a5('0x32')]);_0x2b16f2[_0x48a5('0x36')]=_[_0x48a5('0x35')](_0x14449f[_0x48a5('0x30')],qs[_0x48a5('0x37')](_0x382d29[_0x48a5('0x32')][_0x48a5('0x37')]));_0x2b16f2['attributes']=_0x2b16f2[_0x48a5('0x36')][_0x48a5('0x38')]?_0x2b16f2[_0x48a5('0x36')]:_0x14449f[_0x48a5('0x30')];if(_0x382d29[_0x48a5('0x32')]['includeAll']){_0x2b16f2[_0x48a5('0x44')]=[{'all':!![]}];}_0x2b16f2=_[_0x48a5('0x40')]({},_0x2b16f2,_0x382d29[_0x48a5('0x42')]);return db[_0x48a5('0x2c')][_0x48a5('0x49')](_0x2b16f2)[_0x48a5('0x25')](handleEntityNotFound(_0x1a4054,null))[_0x48a5('0x25')](respondWithResult(_0x1a4054,null))[_0x48a5('0x46')](handleError(_0x1a4054,null));};exports[_0x48a5('0x4a')]=function(_0x8def06,_0x2a809d){return db[_0x48a5('0x2c')]['create'](_0x8def06[_0x48a5('0x4b')],{})['then'](respondWithResult(_0x2a809d,0xc9))[_0x48a5('0x46')](handleError(_0x2a809d,null));};exports[_0x48a5('0x24')]=function(_0x2a69e8,_0x59ac35){if(_0x2a69e8[_0x48a5('0x4b')]['id']){delete _0x2a69e8[_0x48a5('0x4b')]['id'];}return db[_0x48a5('0x2c')]['find']({'where':{'id':_0x2a69e8['params']['id']}})[_0x48a5('0x25')](handleEntityNotFound(_0x59ac35,null))['then'](saveUpdates(_0x2a69e8[_0x48a5('0x4b')],null))['then'](respondWithResult(_0x59ac35,null))['catch'](handleError(_0x59ac35,null));};exports[_0x48a5('0x26')]=function(_0x552cda,_0x21e3a8){return db['VoiceDialReport']['find']({'where':{'id':_0x552cda[_0x48a5('0x48')]['id']}})[_0x48a5('0x25')](handleEntityNotFound(_0x21e3a8,null))[_0x48a5('0x25')](removeEntity(_0x21e3a8,null))[_0x48a5('0x46')](handleError(_0x21e3a8,null));};exports['describe']=function(_0xbe5552,_0x21a567){return db['VoiceDialReport'][_0x48a5('0x4c')]()[_0x48a5('0x25')](respondWithResult(_0x21a567,null))['catch'](handleError(_0x21a567,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 47d06d6..b081b6e 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 _0xe5bc=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid'];(function(_0x30123b,_0x2b155d){var _0x24eb6f=function(_0x31e0fd){while(--_0x31e0fd){_0x30123b['push'](_0x30123b['shift']());}};_0x24eb6f(++_0x2b155d);}(_0xe5bc,0x8c));var _0xce5b=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xe5bc[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require(_0xce5b('0x0'));var util=require(_0xce5b('0x1'));var logger=require(_0xce5b('0x2'))(_0xce5b('0x3'));var moment=require(_0xce5b('0x4'));var BPromise=require(_0xce5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce5b('0x6'));var rimraf=require(_0xce5b('0x7'));var config=require(_0xce5b('0x8'));var attributes=require(_0xce5b('0x9'));module[_0xce5b('0xa')]=function(_0x2d890c,_0x59ed4f){return _0x2d890c[_0xce5b('0xb')]('VoiceDialReport',attributes,{'tableName':_0xce5b('0xc'),'paranoid':![],'indexes':[{'fields':[_0xce5b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x17d7=['bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment'];(function(_0x5c9985,_0x3fc7e4){var _0x48a86f=function(_0x4612cf){while(--_0x4612cf){_0x5c9985['push'](_0x5c9985['shift']());}};_0x48a86f(++_0x3fc7e4);}(_0x17d7,0x15b));var _0x717d=function(_0x13471e,_0x25c80f){_0x13471e=_0x13471e-0x0;var _0x544f62=_0x17d7[_0x13471e];return _0x544f62;};'use strict';var _=require(_0x717d('0x0'));var util=require(_0x717d('0x1'));var logger=require('../../config/logger')(_0x717d('0x2'));var moment=require(_0x717d('0x3'));var BPromise=require(_0x717d('0x4'));var rp=require(_0x717d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x717d('0x6'));var config=require(_0x717d('0x7'));var attributes=require(_0x717d('0x8'));module[_0x717d('0x9')]=function(_0x4bbb38,_0x16e3ac){return _0x4bbb38['define'](_0x717d('0xa'),attributes,{'tableName':_0x717d('0xb'),'paranoid':![],'indexes':[{'fields':[_0x717d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index dae26b5..43cea10 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 _0x5db1=['rpc','../../config/environment','jayson/promise','http','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','raw','then','info','UpdateVoiceDialReport','update','options','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x5db1,0x1d4));var _0x15db=function(_0x1f2f66,_0x269b6b){_0x1f2f66=_0x1f2f66-0x0;var _0x264af1=_0x5db1[_0x1f2f66];return _0x264af1;};'use strict';var _=require('lodash');var util=require(_0x15db('0x0'));var moment=require(_0x15db('0x1'));var BPromise=require(_0x15db('0x2'));var rs=require(_0x15db('0x3'));var fs=require('fs');var Redis=require(_0x15db('0x4'));var db=require(_0x15db('0x5'))['db'];var utils=require(_0x15db('0x6'));var logger=require(_0x15db('0x7'))(_0x15db('0x8'));var config=require(_0x15db('0x9'));var jayson=require(_0x15db('0xa'));var client=jayson['client'][_0x15db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x411ad2,_0x5f7175,_0x410366){return new BPromise(function(_0x8906ee,_0x1509fe){return client[_0x15db('0xc')](_0x411ad2,_0x410366)['then'](function(_0x21c1b3){logger['info'](_0x15db('0xd'),_0x5f7175,_0x15db('0xe'));logger[_0x15db('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5f7175,_0x15db('0xe'),JSON[_0x15db('0x10')](_0x21c1b3));if(_0x21c1b3[_0x15db('0x11')]){if(_0x21c1b3[_0x15db('0x11')][_0x15db('0x12')]===0x1f4){logger['error'](_0x15db('0xd'),_0x5f7175,_0x21c1b3[_0x15db('0x11')][_0x15db('0x13')]);return _0x1509fe(_0x21c1b3[_0x15db('0x11')][_0x15db('0x13')]);}logger[_0x15db('0x11')](_0x15db('0xd'),_0x5f7175,_0x21c1b3[_0x15db('0x11')]['message']);return _0x8906ee(_0x21c1b3[_0x15db('0x11')][_0x15db('0x13')]);}else{logger['info'](_0x15db('0xd'),_0x5f7175,_0x15db('0xe'));_0x8906ee(_0x21c1b3[_0x15db('0x14')][_0x15db('0x13')]);}})[_0x15db('0x15')](function(_0x1416d2){logger[_0x15db('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x5f7175,_0x1416d2);_0x1509fe(_0x1416d2);});});}exports[_0x15db('0x16')]=function(_0x5b4124){var _0x502132=this;return new Promise(function(_0x54ead9,_0x20e4cd){return db[_0x15db('0x17')]['create'](_0x5b4124[_0x15db('0x18')],{'raw':_0x5b4124['options']?_0x5b4124['options'][_0x15db('0x19')]===undefined?!![]:![]:!![]})[_0x15db('0x1a')](function(_0x417642){logger[_0x15db('0x1b')](_0x15db('0x16'),_0x5b4124);logger[_0x15db('0xf')](_0x15db('0x16'),_0x5b4124,JSON[_0x15db('0x10')](_0x417642));_0x54ead9(_0x417642);})[_0x15db('0x15')](function(_0x4a4f96){logger[_0x15db('0x11')]('CreateVoiceDialReport',_0x4a4f96['message'],_0x5b4124);_0x20e4cd(_0x502132[_0x15db('0x11')](0x1f4,_0x4a4f96['message']));});});};exports[_0x15db('0x1c')]=function(_0x44c772){var _0x488e44=this;return new Promise(function(_0x3e127e,_0x41636){return db[_0x15db('0x17')][_0x15db('0x1d')](_0x44c772[_0x15db('0x18')],{'raw':_0x44c772[_0x15db('0x1e')]?_0x44c772['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44c772[_0x15db('0x1e')]?_0x44c772[_0x15db('0x1e')][_0x15db('0x1f')]||null:null,'attributes':_0x44c772[_0x15db('0x1e')]?_0x44c772[_0x15db('0x1e')][_0x15db('0x20')]||null:null,'limit':_0x44c772[_0x15db('0x1e')]?_0x44c772[_0x15db('0x1e')][_0x15db('0x21')]||null:null})[_0x15db('0x1a')](function(_0x5e4d28){logger['info'](_0x15db('0x1c'),_0x44c772);logger['debug']('UpdateVoiceDialReport',_0x44c772,JSON[_0x15db('0x10')](_0x5e4d28));_0x3e127e(_0x5e4d28);})['catch'](function(_0xc4916b){logger[_0x15db('0x11')]('UpdateVoiceDialReport',_0xc4916b[_0x15db('0x13')],_0x44c772);_0x41636(_0x488e44[_0x15db('0x11')](0x1f4,_0xc4916b[_0x15db('0x13')]));});});}; \ No newline at end of file +var _0xb7d7=['../../config/logger','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','raw','debug','UpdateVoiceDialReport','update','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xb7d7,0xc4));var _0x7b7d=function(_0x53fee0,_0xe5e0fd){_0x53fee0=_0x53fee0-0x0;var _0x547925=_0xb7d7[_0x53fee0];return _0x547925;};'use strict';var _=require(_0x7b7d('0x0'));var util=require(_0x7b7d('0x1'));var moment=require(_0x7b7d('0x2'));var BPromise=require(_0x7b7d('0x3'));var rs=require(_0x7b7d('0x4'));var fs=require('fs');var Redis=require(_0x7b7d('0x5'));var db=require(_0x7b7d('0x6'))['db'];var utils=require(_0x7b7d('0x7'));var logger=require(_0x7b7d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b7d('0x9'));var client=jayson['client'][_0x7b7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5667d0,_0xe85394,_0x445451){return new BPromise(function(_0x4ff56b,_0x4fbd4a){return client[_0x7b7d('0xb')](_0x5667d0,_0x445451)[_0x7b7d('0xc')](function(_0x46a09c){logger[_0x7b7d('0xd')](_0x7b7d('0xe'),_0xe85394,_0x7b7d('0xf'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xe85394,_0x7b7d('0xf'),JSON[_0x7b7d('0x10')](_0x46a09c));if(_0x46a09c['error']){if(_0x46a09c['error'][_0x7b7d('0x11')]===0x1f4){logger[_0x7b7d('0x12')](_0x7b7d('0xe'),_0xe85394,_0x46a09c[_0x7b7d('0x12')]['message']);return _0x4fbd4a(_0x46a09c[_0x7b7d('0x12')][_0x7b7d('0x13')]);}logger['error'](_0x7b7d('0xe'),_0xe85394,_0x46a09c[_0x7b7d('0x12')][_0x7b7d('0x13')]);return _0x4ff56b(_0x46a09c['error'][_0x7b7d('0x13')]);}else{logger[_0x7b7d('0xd')](_0x7b7d('0xe'),_0xe85394,_0x7b7d('0xf'));_0x4ff56b(_0x46a09c[_0x7b7d('0x14')]['message']);}})[_0x7b7d('0x15')](function(_0x21f382){logger['error'](_0x7b7d('0xe'),_0xe85394,_0x21f382);_0x4fbd4a(_0x21f382);});});}exports[_0x7b7d('0x16')]=function(_0x38c061){var _0x49287c=this;return new Promise(function(_0x1c8f01,_0x5a0cd1){return db[_0x7b7d('0x17')][_0x7b7d('0x18')](_0x38c061[_0x7b7d('0x19')],{'raw':_0x38c061['options']?_0x38c061['options'][_0x7b7d('0x1a')]===undefined?!![]:![]:!![]})[_0x7b7d('0xc')](function(_0x3755f8){logger['info'](_0x7b7d('0x16'),_0x38c061);logger[_0x7b7d('0x1b')](_0x7b7d('0x16'),_0x38c061,JSON['stringify'](_0x3755f8));_0x1c8f01(_0x3755f8);})[_0x7b7d('0x15')](function(_0x4ca668){logger[_0x7b7d('0x12')](_0x7b7d('0x16'),_0x4ca668[_0x7b7d('0x13')],_0x38c061);_0x5a0cd1(_0x49287c['error'](0x1f4,_0x4ca668[_0x7b7d('0x13')]));});});};exports[_0x7b7d('0x1c')]=function(_0x28f440){var _0xed26c9=this;return new Promise(function(_0x2664f4,_0x68a950){return db[_0x7b7d('0x17')][_0x7b7d('0x1d')](_0x28f440[_0x7b7d('0x19')],{'raw':_0x28f440['options']?_0x28f440['options'][_0x7b7d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28f440[_0x7b7d('0x1e')]?_0x28f440[_0x7b7d('0x1e')][_0x7b7d('0x1f')]||null:null,'attributes':_0x28f440[_0x7b7d('0x1e')]?_0x28f440[_0x7b7d('0x1e')][_0x7b7d('0x20')]||null:null,'limit':_0x28f440[_0x7b7d('0x1e')]?_0x28f440[_0x7b7d('0x1e')][_0x7b7d('0x21')]||null:null})[_0x7b7d('0xc')](function(_0x4f5a2d){logger['info']('UpdateVoiceDialReport',_0x28f440);logger['debug'](_0x7b7d('0x1c'),_0x28f440,JSON['stringify'](_0x4f5a2d));_0x2664f4(_0x4f5a2d);})['catch'](function(_0x21dc37){logger[_0x7b7d('0x12')](_0x7b7d('0x1c'),_0x21dc37[_0x7b7d('0x13')],_0x28f440);_0x68a950(_0xed26c9[_0x7b7d('0x12')](0x1f4,_0x21dc37[_0x7b7d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 46e8db0..baec2af 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 _0xbafa=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','index','isAuthenticated','create','post','/:id/applications','addApplications','put','update','delete','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x3a97b9,_0x19e387){var _0x5727f7=function(_0x157d7e){while(--_0x157d7e){_0x3a97b9['push'](_0x3a97b9['shift']());}};_0x5727f7(++_0x19e387);}(_0xbafa,0x13a));var _0xabaf=function(_0x5e5c61,_0x256d18){_0x5e5c61=_0x5e5c61-0x0;var _0x1bc5cb=_0xbafa[_0x5e5c61];return _0x1bc5cb;};'use strict';var multer=require(_0xabaf('0x0'));var util=require(_0xabaf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xabaf('0x2'));var router=express[_0xabaf('0x3')]();var fs_extra=require(_0xabaf('0x4'));var auth=require(_0xabaf('0x5'));var interaction=require(_0xabaf('0x6'));var config=require(_0xabaf('0x7'));var controller=require(_0xabaf('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xabaf('0x9')]);router['get']('/:id',auth[_0xabaf('0xa')](),controller['show']);router['post']('/',auth[_0xabaf('0xa')](),controller[_0xabaf('0xb')]);router[_0xabaf('0xc')](_0xabaf('0xd'),auth[_0xabaf('0xa')](),controller[_0xabaf('0xe')]);router[_0xabaf('0xf')]('/:id',auth[_0xabaf('0xa')](),controller[_0xabaf('0x10')]);router[_0xabaf('0x11')](_0xabaf('0x12'),auth[_0xabaf('0xa')](),controller['destroy']);module[_0xabaf('0x13')]=router; \ No newline at end of file +var _0x5462=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','create','post','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4d6763,_0x31d63b){var _0x5e5177=function(_0x22e644){while(--_0x22e644){_0x4d6763['push'](_0x4d6763['shift']());}};_0x5e5177(++_0x31d63b);}(_0x5462,0xf6));var _0x2546=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x5462[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0x2546('0x0'));var util=require(_0x2546('0x1'));var path=require(_0x2546('0x2'));var timeout=require(_0x2546('0x3'));var express=require(_0x2546('0x4'));var router=express[_0x2546('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2546('0x6'));var interaction=require(_0x2546('0x7'));var config=require(_0x2546('0x8'));var controller=require(_0x2546('0x9'));router[_0x2546('0xa')]('/',auth['isAuthenticated'](),controller[_0x2546('0xb')]);router[_0x2546('0xa')](_0x2546('0xc'),auth[_0x2546('0xd')](),controller[_0x2546('0xe')]);router['post']('/',auth[_0x2546('0xd')](),controller[_0x2546('0xf')]);router[_0x2546('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0x2546('0x11')]);router[_0x2546('0x12')]('/:id',auth[_0x2546('0xd')](),controller[_0x2546('0x13')]);router[_0x2546('0x14')](_0x2546('0xc'),auth['isAuthenticated'](),controller[_0x2546('0x15')]);module[_0x2546('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6d71b26..0cbb1a2 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 _0xd2ac=['exten','sequelize','STRING','compositeIndex','ENUM','outbound','internal','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue'];(function(_0x10502e,_0x56272f){var _0x4aa9bd=function(_0x3932ea){while(--_0x3932ea){_0x10502e['push'](_0x10502e['shift']());}};_0x4aa9bd(++_0x56272f);}(_0xd2ac,0xb1));var _0xcd2a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd2ac[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xcd2a('0x0'));module['exports']={'context':{'type':Sequelize[_0xcd2a('0x1')],'allowNull':![],'unique':_0xcd2a('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xcd2a('0x1')],'allowNull':![],'unique':_0xcd2a('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xcd2a('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xcd2a('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xcd2a('0x3')]('inbound',_0xcd2a('0x4'),_0xcd2a('0x5'),'inbound-fax',_0xcd2a('0x6'),_0xcd2a('0x7'),_0xcd2a('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xcd2a('0x1')]},'interval':{'type':Sequelize[_0xcd2a('0x1')],'allowNull':![],'defaultValue':_0xcd2a('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xcd2a('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xcd2a('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xcd2a('0xb')]},'recordingFormat':{'type':Sequelize[_0xcd2a('0x1')],'defaultValue':_0xcd2a('0xc')},'answer':{'type':Sequelize[_0xcd2a('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xcd2a('0xd')],'get':function(_0x5bf8c9){return this[_0xcd2a('0xe')](_0xcd2a('0xf'));}},'alias':{'type':Sequelize[_0xcd2a('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xd6b6=['exports','STRING','compositeIndex','NoOp','ENUM','internal','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','getDataValue'];(function(_0x454589,_0x3e852e){var _0x468c5c=function(_0xa5b1f5){while(--_0xa5b1f5){_0x454589['push'](_0x454589['shift']());}};_0x468c5c(++_0x3e852e);}(_0xd6b6,0xb6));var _0x6d6b=function(_0x4ec7d6,_0x544954){_0x4ec7d6=_0x4ec7d6-0x0;var _0xb59e7b=_0xd6b6[_0x4ec7d6];return _0xb59e7b;};'use strict';var Sequelize=require('sequelize');module[_0x6d6b('0x0')]={'context':{'type':Sequelize[_0x6d6b('0x1')],'allowNull':![],'unique':_0x6d6b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6d6b('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x6d6b('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x6d6b('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d6b('0x3')},'appdata':{'type':Sequelize[_0x6d6b('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6d6b('0x4')]('inbound','outbound',_0x6d6b('0x5'),_0x6d6b('0x6'),'outbound-fax',_0x6d6b('0x7'),_0x6d6b('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6d6b('0x1')],'allowNull':![],'defaultValue':_0x6d6b('0x9')},'IntervalId':{'type':Sequelize[_0x6d6b('0xa')]},'isApp':{'type':Sequelize[_0x6d6b('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6d6b('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6d6b('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6d6b('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x6d6b('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x6d6b('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4461de){return this[_0x6d6b('0xc')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 560cd26..c88320c 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 _0xec1f=['../../config/environment','redis','register','sendStatus','status','json','offset','undefined','limit','count','set','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','includes','find','value','UserProfileResource','end','error','stack','name','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','startsWith','concat','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','createRouting','bulkCreate','findAndCountAll','finally','send','lodash','../../components/parsers/qs','../../config/logger','api'];(function(_0x2bd757,_0x118a1f){var _0x4ce3e9=function(_0x2f8233){while(--_0x2f8233){_0x2bd757['push'](_0x2bd757['shift']());}};_0x4ce3e9(++_0x118a1f);}(_0xec1f,0xb2));var _0xfec1=function(_0x9fdce3,_0x31a83e){_0x9fdce3=_0x9fdce3-0x0;var _0x17ffd2=_0xec1f[_0x9fdce3];return _0x17ffd2;};'use strict';var _=require(_0xfec1('0x0'));var Redis=require('ioredis');var qs=require(_0xfec1('0x1'));var logger=require(_0xfec1('0x2'))(_0xfec1('0x3'));var config=require(_0xfec1('0x4'));var db=require('../../mysqldb')['db'];config[_0xfec1('0x5')]=_['defaults'](config[_0xfec1('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfec1('0x5')]));require('./voiceExtension.socket')[_0xfec1('0x6')](socket);function respondWithStatusCode(_0xdbc211,_0xfe9616){_0xfe9616=_0xfe9616||0xcc;return function(_0x2df9d5){if(_0x2df9d5){return _0xdbc211[_0xfec1('0x7')](_0xfe9616);}return _0xdbc211[_0xfec1('0x8')](_0xfe9616)['end']();};}function respondWithResult(_0xfbc381,_0x68e83f){_0x68e83f=_0x68e83f||0xc8;return function(_0x1c28fb){if(_0x1c28fb){return _0xfbc381[_0xfec1('0x8')](_0x68e83f)[_0xfec1('0x9')](_0x1c28fb);}};}function respondWithFilteredResult(_0x52e9d7,_0x5a8499){return function(_0x727ac8){if(_0x727ac8){var _0x325bf5=typeof _0x5a8499[_0xfec1('0xa')]===_0xfec1('0xb')&&typeof _0x5a8499[_0xfec1('0xc')]===_0xfec1('0xb');var _0x2c8d0d=_0x727ac8['count'];var _0x7f601=_0x325bf5?0x0:_0x5a8499[_0xfec1('0xa')];var _0x2fc70a=_0x325bf5?_0x727ac8[_0xfec1('0xd')]:_0x5a8499[_0xfec1('0xa')]+_0x5a8499[_0xfec1('0xc')];var _0x5dd205;if(_0x2fc70a>=_0x2c8d0d){_0x2fc70a=_0x2c8d0d;_0x5dd205=0xc8;}else{_0x5dd205=0xce;}_0x52e9d7[_0xfec1('0x8')](_0x5dd205);return _0x52e9d7[_0xfec1('0xe')]('Content-Range',_0x7f601+'-'+_0x2fc70a+'/'+_0x2c8d0d)[_0xfec1('0x9')](_0x727ac8);}return null;};}function removeEntity(_0x1c94ce){return function(_0x46b015){if(_0x46b015){return _0x46b015[_0xfec1('0xf')]()[_0xfec1('0x10')](function(){var _0x62f1a0=_0x46b015[_0xfec1('0x11')]({'plain':!![]});var _0x10ca21=[{'name':_0xfec1('0x12'),'value':_0xfec1('0x13'),'ignore':![]},{'name':_0xfec1('0x14'),'value':_0xfec1('0x15'),'ignore':![]},{'name':_0xfec1('0x16'),'value':_0xfec1('0x17'),'ignore':![]}];var _0x4ff042=_(_0x10ca21)['filter'](_0xfec1('0x18'))[_0xfec1('0x19')]('value')['value']();if(_[_0xfec1('0x1a')](_0x4ff042,_0x62f1a0['type'])){return;}var _0x58cd2f=_[_0xfec1('0x1b')](_0x10ca21,[_0xfec1('0x1c'),_0x62f1a0['type']])['name'];return db[_0xfec1('0x1d')][_0xfec1('0xf')]({'where':{'type':_0x58cd2f,'resourceId':_0x62f1a0['id']}})[_0xfec1('0x10')](function(){return _0x46b015;});})[_0xfec1('0x10')](function(){_0x1c94ce[_0xfec1('0x8')](0xcc)[_0xfec1('0x1e')]();});}};}function handleEntityNotFound(_0x597d6d){return function(_0x14a520){if(!_0x14a520){_0x597d6d[_0xfec1('0x7')](0x194);}return _0x14a520;};}function handleError(_0x549b8f,_0x44e295){_0x44e295=_0x44e295||0x1f4;return function(_0x538c78){logger[_0xfec1('0x1f')](_0x538c78[_0xfec1('0x20')]);if(_0x538c78[_0xfec1('0x21')]){delete _0x538c78[_0xfec1('0x21')];}_0x549b8f[_0xfec1('0x8')](_0x44e295)['send'](_0x538c78);};}exports[_0xfec1('0x22')]=function(_0x18dc4d,_0x57a2d8){var _0x267d5e={},_0x171068={},_0x207a8c={'count':0x0,'rows':[]};var _0x29d9bd=_[_0xfec1('0x19')](db[_0xfec1('0x23')][_0xfec1('0x24')],function(_0x25c7f2){return{'name':_0x25c7f2[_0xfec1('0x25')],'type':_0x25c7f2['type'][_0xfec1('0x26')]};});_0x171068[_0xfec1('0x27')]=_[_0xfec1('0x19')](_0x29d9bd,_0xfec1('0x21'));_0x171068['query']=_[_0xfec1('0x28')](_0x18dc4d[_0xfec1('0x29')]);_0x171068['filters']=_[_0xfec1('0x2a')](_0x171068[_0xfec1('0x27')],_0x171068[_0xfec1('0x29')]);_0x267d5e[_0xfec1('0x2b')]=_[_0xfec1('0x2a')](_0x171068['model'],qs[_0xfec1('0x2c')](_0x18dc4d[_0xfec1('0x29')]['fields']));_0x267d5e[_0xfec1('0x2b')]=_0x267d5e[_0xfec1('0x2b')]['length']?_0x267d5e[_0xfec1('0x2b')]:_0x171068[_0xfec1('0x27')];if(!_0x18dc4d['query']['hasOwnProperty'](_0xfec1('0x2d'))){_0x267d5e[_0xfec1('0xc')]=qs[_0xfec1('0xc')](_0x18dc4d[_0xfec1('0x29')]['limit']);_0x267d5e[_0xfec1('0xa')]=qs[_0xfec1('0xa')](_0x18dc4d['query'][_0xfec1('0xa')]);}_0x267d5e[_0xfec1('0x2e')]=qs[_0xfec1('0x2f')](_0x18dc4d[_0xfec1('0x29')][_0xfec1('0x2f')]);_0x267d5e[_0xfec1('0x30')]=qs['filters'](_[_0xfec1('0x31')](_0x18dc4d[_0xfec1('0x29')],_0x171068[_0xfec1('0x32')]),_0x29d9bd);if(_0x18dc4d[_0xfec1('0x29')][_0xfec1('0x33')]){_0x267d5e[_0xfec1('0x30')]=_[_0xfec1('0x34')](_0x267d5e['where'],{'$or':_[_0xfec1('0x19')](_0x29d9bd,function(_0x42ec1c){if(_0x42ec1c[_0xfec1('0x35')]!==_0xfec1('0x36')){var _0x360cae={};_0x360cae[_0x42ec1c[_0xfec1('0x21')]]={'$like':'%'+_0x18dc4d['query'][_0xfec1('0x33')]+'%'};return _0x360cae;}})});}_0x267d5e=_['merge']({},_0x267d5e,_0x18dc4d[_0xfec1('0x37')]);var _0x185b21={'where':_0x267d5e[_0xfec1('0x30')]};return db[_0xfec1('0x23')][_0xfec1('0xd')](_0x185b21)[_0xfec1('0x10')](function(_0x922781){_0x207a8c['count']=_0x922781;if(_0x18dc4d[_0xfec1('0x29')]['includeAll']){_0x267d5e[_0xfec1('0x38')]=[{'all':!![]}];}return db[_0xfec1('0x23')][_0xfec1('0x39')](_0x267d5e);})[_0xfec1('0x10')](function(_0x1a86a1){_0x207a8c[_0xfec1('0x3a')]=_0x1a86a1;return _0x207a8c;})[_0xfec1('0x10')](respondWithFilteredResult(_0x57a2d8,_0x267d5e))[_0xfec1('0x3b')](handleError(_0x57a2d8,null));};exports[_0xfec1('0x3c')]=function(_0x4a9403,_0x22d6e7){var _0x4b45c5={'raw':![],'where':{'id':_0x4a9403[_0xfec1('0x3d')]['id']}},_0x4ccade={};_0x4ccade['model']=_[_0xfec1('0x28')](db[_0xfec1('0x23')][_0xfec1('0x24')]);_0x4ccade[_0xfec1('0x29')]=_[_0xfec1('0x28')](_0x4a9403[_0xfec1('0x29')]);_0x4ccade[_0xfec1('0x32')]=_[_0xfec1('0x2a')](_0x4ccade[_0xfec1('0x27')],_0x4ccade['query']);_0x4b45c5[_0xfec1('0x2b')]=_[_0xfec1('0x2a')](_0x4ccade[_0xfec1('0x27')],qs[_0xfec1('0x2c')](_0x4a9403[_0xfec1('0x29')]['fields']));_0x4b45c5[_0xfec1('0x2b')]=_0x4b45c5[_0xfec1('0x2b')]['length']?_0x4b45c5[_0xfec1('0x2b')]:_0x4ccade[_0xfec1('0x27')];if(_0x4a9403[_0xfec1('0x29')][_0xfec1('0x3e')]){_0x4b45c5[_0xfec1('0x38')]=[{'all':!![]}];}_0x4b45c5=_[_0xfec1('0x34')]({},_0x4b45c5,_0x4a9403[_0xfec1('0x37')]);return db[_0xfec1('0x23')]['find'](_0x4b45c5)[_0xfec1('0x10')](handleEntityNotFound(_0x22d6e7,null))[_0xfec1('0x10')](respondWithResult(_0x22d6e7,null))[_0xfec1('0x3b')](handleError(_0x22d6e7,null));};exports['destroy']=function(_0x16d01f,_0x5cee2d){return db[_0xfec1('0x23')][_0xfec1('0x1b')]({'where':{'id':_0x16d01f[_0xfec1('0x3d')]['id']}})[_0xfec1('0x10')](handleEntityNotFound(_0x5cee2d,null))['then'](removeEntity(_0x5cee2d,null))[_0xfec1('0x3b')](handleError(_0x5cee2d,null));};exports[_0xfec1('0x3f')]=function(_0x59450a,_0x16ecf7){if(_0x59450a[_0xfec1('0x40')][_0xfec1('0x35')]===_0xfec1('0x15')&&!_[_0xfec1('0x41')](_0x59450a[_0xfec1('0x40')]['exten'],'_')){_0x59450a['body']['exten']='_'[_0xfec1('0x42')](_0x59450a[_0xfec1('0x40')][_0xfec1('0x43')]);}return db[_0xfec1('0x23')][_0xfec1('0x3f')](_0x59450a[_0xfec1('0x40')],{'raw':![]})[_0xfec1('0x10')](function(_0x4ab0db){var _0x5456fe=_0x59450a[_0xfec1('0x44')][_0xfec1('0x11')]({'plain':!![]});if(!_0x5456fe)throw new Error(_0xfec1('0x45'));if(_0x5456fe['role']===_0xfec1('0x44')){var _0x5f4f11=_0x4ab0db[_0xfec1('0x11')]({'plain':!![]});var _0x30eafd=[{'name':'InboundRoutes','value':_0xfec1('0x13')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xfec1('0x16'),'value':_0xfec1('0x17')}];var _0x543e9f=_[_0xfec1('0x1b')](_0x30eafd,[_0xfec1('0x1c'),_0x5f4f11[_0xfec1('0x35')]])[_0xfec1('0x21')];return db[_0xfec1('0x46')][_0xfec1('0x1b')]({'where':{'name':_0x543e9f,'userProfileId':_0x5456fe[_0xfec1('0x47')]},'raw':!![]})[_0xfec1('0x10')](function(_0x10d5e5){if(_0x10d5e5&&_0x10d5e5[_0xfec1('0x48')]===0x0){return db[_0xfec1('0x1d')][_0xfec1('0x3f')]({'name':_0x5f4f11['name'],'resourceId':_0x5f4f11['id'],'type':_0x10d5e5['name'],'sectionId':_0x10d5e5['id']},{})[_0xfec1('0x10')](function(){return _0x4ab0db;});}else{return _0x4ab0db;}})[_0xfec1('0x3b')](function(_0x2576a0){logger[_0xfec1('0x1f')](_0xfec1('0x49'),_0x2576a0);throw _0x2576a0;});}return _0x4ab0db;})[_0xfec1('0x10')](respondWithResult(_0x16ecf7,0xc9))[_0xfec1('0x3b')](handleError(_0x16ecf7,null));};exports[_0xfec1('0x4a')]=function(_0x313235,_0x5c0968){if(_0x313235['body']['id']){delete _0x313235[_0xfec1('0x40')]['id'];}return db['VoiceExtension'][_0xfec1('0x1b')]({'where':{'id':_0x313235[_0xfec1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5c0968,null))[_0xfec1('0x10')](function(_0x4a6d89){if(_0x4a6d89){return db[_0xfec1('0x23')][_0xfec1('0x4a')](_[_0xfec1('0x31')](_0x313235[_0xfec1('0x40')],[_0xfec1('0x43'),_0xfec1('0x4b'),_0xfec1('0x4c'),_0xfec1('0x4d'),_0xfec1('0x4e'),_0xfec1('0x4f'),_0xfec1('0x50')]),{'where':{'context':_0x4a6d89[_0xfec1('0x4b')],'exten':_0x4a6d89[_0xfec1('0x43')]},'individualHooks':!![]})[_0xfec1('0x10')](function(_0x3b9a37){return _0x3b9a37;});}return null;})[_0xfec1('0x10')](respondWithStatusCode(_0x5c0968,null))[_0xfec1('0x3b')](handleError(_0x5c0968,null));};exports[_0xfec1('0x51')]=function(_0x177481,_0x2e695d){var _0x32dc0d=_0x177481[_0xfec1('0x3d')]['id'];var _0x3ba231=_0x177481[_0xfec1('0x40')];var _0x21e95c=0xc8;var _0x5201bf=null;return db['sequelize'][_0xfec1('0x52')]({'isolationLevel':db['sequelize'][_0xfec1('0x53')][_0xfec1('0x54')][_0xfec1('0x55')]},function(_0x51abe0){return db[_0xfec1('0x23')]['findOne']({'where':{'id':_0x32dc0d},'transaction':_0x51abe0})[_0xfec1('0x10')](function(_0x3dd861){if(_0x3dd861){return db['VoiceExtension'][_0xfec1('0xf')]({'where':{'VoiceExtensionId':_0x32dc0d},'transaction':_0x51abe0})[_0xfec1('0x10')](function(){var _0x43ca2c=_[_0xfec1('0x19')](_0x3ba231,function(_0x4fde19){_0x4fde19['VoiceExtensionId']=_0x32dc0d;_0x4fde19['isApp']=!![];return _0x4fde19;});return _0x3dd861[_0xfec1('0x56')](_0x43ca2c);})[_0xfec1('0x10')](function(_0x1f621f){return db['VoiceExtension'][_0xfec1('0x57')](_0x1f621f,{'transaction':_0x51abe0});});}else{_0x21e95c=0x194;_0x5201bf=[];}});})[_0xfec1('0x10')](function(){if(_0x21e95c!==0x194){return db['VoiceExtension'][_0xfec1('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x32dc0d},'order':'cast(priority\x20as\x20unsigned)'})[_0xfec1('0x10')](function(_0x41dd8b){_0x5201bf=_0x41dd8b;});}})['catch'](function(_0x3ffcc9){_0x21e95c=0x1f4;logger[_0xfec1('0x1f')](_0x3ffcc9[_0xfec1('0x20')]);if(_0x3ffcc9[_0xfec1('0x21')]){delete _0x3ffcc9[_0xfec1('0x21')];}_0x5201bf=_0x3ffcc9;})[_0xfec1('0x59')](function(){if(_0x5201bf===null){_0x2e695d['sendStatus'](_0x21e95c);}else{if(_0x21e95c===0x1f4){_0x2e695d[_0xfec1('0x8')](_0x21e95c)[_0xfec1('0x5a')](_0x5201bf);}else{_0x2e695d[_0xfec1('0x8')](_0x21e95c)[_0xfec1('0x9')](_0x5201bf);}}});}; \ No newline at end of file +var _0xb2ea=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','destroy','end','error','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','include','findAll','catch','show','params','length','includeAll','merge','options','body','outbound','startsWith','exten','concat','create','user','role'];(function(_0x3012ed,_0x6d8b42){var _0x249fba=function(_0x4758be){while(--_0x4758be){_0x3012ed['push'](_0x3012ed['shift']());}};_0x249fba(++_0x6d8b42);}(_0xb2ea,0x191));var _0xab2e=function(_0x4513e8,_0x16f480){_0x4513e8=_0x4513e8-0x0;var _0x1e8758=_0xb2ea[_0x4513e8];return _0x1e8758;};'use strict';var _=require(_0xab2e('0x0'));var Redis=require(_0xab2e('0x1'));var qs=require(_0xab2e('0x2'));var logger=require(_0xab2e('0x3'))(_0xab2e('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xab2e('0x5')]=_[_0xab2e('0x6')](config[_0xab2e('0x5')],{'host':_0xab2e('0x7'),'port':0x18eb});var socket=require(_0xab2e('0x8'))(new Redis(config[_0xab2e('0x5')]));require(_0xab2e('0x9'))['register'](socket);function respondWithStatusCode(_0x416383,_0x361a76){_0x361a76=_0x361a76||0xcc;return function(_0x35029a){if(_0x35029a){return _0x416383[_0xab2e('0xa')](_0x361a76);}return _0x416383['status'](_0x361a76)['end']();};}function respondWithResult(_0x452757,_0x5bfc54){_0x5bfc54=_0x5bfc54||0xc8;return function(_0x4cc45e){if(_0x4cc45e){return _0x452757['status'](_0x5bfc54)['json'](_0x4cc45e);}};}function respondWithFilteredResult(_0x19f347,_0x5c2f90){return function(_0x7f661b){if(_0x7f661b){var _0x838ab3=typeof _0x5c2f90[_0xab2e('0xb')]===_0xab2e('0xc')&&typeof _0x5c2f90[_0xab2e('0xd')]===_0xab2e('0xc');var _0x3a9b0f=_0x7f661b[_0xab2e('0xe')];var _0x491034=_0x838ab3?0x0:_0x5c2f90[_0xab2e('0xb')];var _0x472bf2=_0x838ab3?_0x7f661b[_0xab2e('0xe')]:_0x5c2f90[_0xab2e('0xb')]+_0x5c2f90['limit'];var _0x139613;if(_0x472bf2>=_0x3a9b0f){_0x472bf2=_0x3a9b0f;_0x139613=0xc8;}else{_0x139613=0xce;}_0x19f347[_0xab2e('0xf')](_0x139613);return _0x19f347[_0xab2e('0x10')](_0xab2e('0x11'),_0x491034+'-'+_0x472bf2+'/'+_0x3a9b0f)[_0xab2e('0x12')](_0x7f661b);}return null;};}function removeEntity(_0x285dda){return function(_0x17a0c0){if(_0x17a0c0){return _0x17a0c0['destroy']()[_0xab2e('0x13')](function(){var _0x25cdbf=_0x17a0c0[_0xab2e('0x14')]({'plain':!![]});var _0xf9f67b=[{'name':_0xab2e('0x15'),'value':_0xab2e('0x16'),'ignore':![]},{'name':_0xab2e('0x17'),'value':'outbound','ignore':![]},{'name':_0xab2e('0x18'),'value':_0xab2e('0x19'),'ignore':![]}];var _0x4ebe36=_(_0xf9f67b)[_0xab2e('0x1a')](_0xab2e('0x1b'))[_0xab2e('0x1c')](_0xab2e('0x1d'))['value']();if(_[_0xab2e('0x1e')](_0x4ebe36,_0x25cdbf[_0xab2e('0x1f')])){return;}var _0x3d8e66=_[_0xab2e('0x20')](_0xf9f67b,[_0xab2e('0x1d'),_0x25cdbf[_0xab2e('0x1f')]])['name'];return db[_0xab2e('0x21')][_0xab2e('0x22')]({'where':{'type':_0x3d8e66,'resourceId':_0x25cdbf['id']}})[_0xab2e('0x13')](function(){return _0x17a0c0;});})['then'](function(){_0x285dda['status'](0xcc)[_0xab2e('0x23')]();});}};}function handleEntityNotFound(_0x4dd7b1){return function(_0x5a4033){if(!_0x5a4033){_0x4dd7b1[_0xab2e('0xa')](0x194);}return _0x5a4033;};}function handleError(_0x5a2949,_0x4a7710){_0x4a7710=_0x4a7710||0x1f4;return function(_0x1f91a0){logger[_0xab2e('0x24')](_0x1f91a0[_0xab2e('0x25')]);if(_0x1f91a0[_0xab2e('0x26')]){delete _0x1f91a0[_0xab2e('0x26')];}_0x5a2949[_0xab2e('0xf')](_0x4a7710)[_0xab2e('0x27')](_0x1f91a0);};}exports[_0xab2e('0x28')]=function(_0x2cd58e,_0x5aaaec){var _0x18ff68={},_0x181efe={},_0x30b47f={'count':0x0,'rows':[]};var _0x5d0c8c=_[_0xab2e('0x1c')](db[_0xab2e('0x29')][_0xab2e('0x2a')],function(_0x3396e9){return{'name':_0x3396e9[_0xab2e('0x2b')],'type':_0x3396e9[_0xab2e('0x1f')][_0xab2e('0x2c')]};});_0x181efe['model']=_['map'](_0x5d0c8c,'name');_0x181efe['query']=_[_0xab2e('0x2d')](_0x2cd58e[_0xab2e('0x2e')]);_0x181efe[_0xab2e('0x2f')]=_[_0xab2e('0x30')](_0x181efe[_0xab2e('0x31')],_0x181efe['query']);_0x18ff68[_0xab2e('0x32')]=_['intersection'](_0x181efe['model'],qs[_0xab2e('0x33')](_0x2cd58e[_0xab2e('0x2e')][_0xab2e('0x33')]));_0x18ff68['attributes']=_0x18ff68['attributes']['length']?_0x18ff68[_0xab2e('0x32')]:_0x181efe[_0xab2e('0x31')];if(!_0x2cd58e['query']['hasOwnProperty'](_0xab2e('0x34'))){_0x18ff68[_0xab2e('0xd')]=qs['limit'](_0x2cd58e[_0xab2e('0x2e')][_0xab2e('0xd')]);_0x18ff68['offset']=qs[_0xab2e('0xb')](_0x2cd58e[_0xab2e('0x2e')][_0xab2e('0xb')]);}_0x18ff68[_0xab2e('0x35')]=qs['sort'](_0x2cd58e[_0xab2e('0x2e')][_0xab2e('0x36')]);_0x18ff68[_0xab2e('0x37')]=qs['filters'](_[_0xab2e('0x38')](_0x2cd58e[_0xab2e('0x2e')],_0x181efe[_0xab2e('0x2f')]),_0x5d0c8c);if(_0x2cd58e[_0xab2e('0x2e')]['filter']){_0x18ff68[_0xab2e('0x37')]=_['merge'](_0x18ff68[_0xab2e('0x37')],{'$or':_[_0xab2e('0x1c')](_0x5d0c8c,function(_0x2fee7e){if(_0x2fee7e[_0xab2e('0x1f')]!=='VIRTUAL'){var _0x290b7f={};_0x290b7f[_0x2fee7e['name']]={'$like':'%'+_0x2cd58e[_0xab2e('0x2e')][_0xab2e('0x1a')]+'%'};return _0x290b7f;}})});}_0x18ff68=_['merge']({},_0x18ff68,_0x2cd58e['options']);var _0x1def5d={'where':_0x18ff68[_0xab2e('0x37')]};return db[_0xab2e('0x29')][_0xab2e('0xe')](_0x1def5d)[_0xab2e('0x13')](function(_0x5cf681){_0x30b47f[_0xab2e('0xe')]=_0x5cf681;if(_0x2cd58e[_0xab2e('0x2e')]['includeAll']){_0x18ff68[_0xab2e('0x39')]=[{'all':!![]}];}return db[_0xab2e('0x29')][_0xab2e('0x3a')](_0x18ff68);})['then'](function(_0x5103cc){_0x30b47f['rows']=_0x5103cc;return _0x30b47f;})[_0xab2e('0x13')](respondWithFilteredResult(_0x5aaaec,_0x18ff68))[_0xab2e('0x3b')](handleError(_0x5aaaec,null));};exports[_0xab2e('0x3c')]=function(_0x1cff75,_0x6f298a){var _0x1bc715={'raw':![],'where':{'id':_0x1cff75[_0xab2e('0x3d')]['id']}},_0x52f712={};_0x52f712[_0xab2e('0x31')]=_[_0xab2e('0x2d')](db[_0xab2e('0x29')][_0xab2e('0x2a')]);_0x52f712['query']=_['keys'](_0x1cff75[_0xab2e('0x2e')]);_0x52f712[_0xab2e('0x2f')]=_[_0xab2e('0x30')](_0x52f712[_0xab2e('0x31')],_0x52f712[_0xab2e('0x2e')]);_0x1bc715['attributes']=_[_0xab2e('0x30')](_0x52f712['model'],qs['fields'](_0x1cff75[_0xab2e('0x2e')][_0xab2e('0x33')]));_0x1bc715['attributes']=_0x1bc715[_0xab2e('0x32')][_0xab2e('0x3e')]?_0x1bc715[_0xab2e('0x32')]:_0x52f712[_0xab2e('0x31')];if(_0x1cff75[_0xab2e('0x2e')][_0xab2e('0x3f')]){_0x1bc715['include']=[{'all':!![]}];}_0x1bc715=_[_0xab2e('0x40')]({},_0x1bc715,_0x1cff75[_0xab2e('0x41')]);return db[_0xab2e('0x29')][_0xab2e('0x20')](_0x1bc715)[_0xab2e('0x13')](handleEntityNotFound(_0x6f298a,null))[_0xab2e('0x13')](respondWithResult(_0x6f298a,null))[_0xab2e('0x3b')](handleError(_0x6f298a,null));};exports[_0xab2e('0x22')]=function(_0x2cc79f,_0x35a852){return db[_0xab2e('0x29')][_0xab2e('0x20')]({'where':{'id':_0x2cc79f['params']['id']}})[_0xab2e('0x13')](handleEntityNotFound(_0x35a852,null))['then'](removeEntity(_0x35a852,null))[_0xab2e('0x3b')](handleError(_0x35a852,null));};exports['create']=function(_0x5673eb,_0x231a7d){if(_0x5673eb[_0xab2e('0x42')]['type']===_0xab2e('0x43')&&!_[_0xab2e('0x44')](_0x5673eb[_0xab2e('0x42')][_0xab2e('0x45')],'_')){_0x5673eb['body'][_0xab2e('0x45')]='_'[_0xab2e('0x46')](_0x5673eb['body'][_0xab2e('0x45')]);}return db['VoiceExtension'][_0xab2e('0x47')](_0x5673eb[_0xab2e('0x42')],{'raw':![]})[_0xab2e('0x13')](function(_0x39bc8b){var _0x475961=_0x5673eb[_0xab2e('0x48')][_0xab2e('0x14')]({'plain':!![]});if(!_0x475961)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x475961[_0xab2e('0x49')]===_0xab2e('0x48')){var _0x2f2a34=_0x39bc8b[_0xab2e('0x14')]({'plain':!![]});var _0x31531c=[{'name':'InboundRoutes','value':_0xab2e('0x16')},{'name':_0xab2e('0x17'),'value':_0xab2e('0x43')},{'name':_0xab2e('0x18'),'value':_0xab2e('0x19')}];var _0x5bd56d=_[_0xab2e('0x20')](_0x31531c,[_0xab2e('0x1d'),_0x2f2a34['type']])[_0xab2e('0x26')];return db[_0xab2e('0x4a')][_0xab2e('0x20')]({'where':{'name':_0x5bd56d,'userProfileId':_0x475961[_0xab2e('0x4b')]},'raw':!![]})[_0xab2e('0x13')](function(_0x393fc4){if(_0x393fc4&&_0x393fc4[_0xab2e('0x4c')]===0x0){return db[_0xab2e('0x21')][_0xab2e('0x47')]({'name':_0x2f2a34['name'],'resourceId':_0x2f2a34['id'],'type':_0x393fc4[_0xab2e('0x26')],'sectionId':_0x393fc4['id']},{})['then'](function(){return _0x39bc8b;});}else{return _0x39bc8b;}})[_0xab2e('0x3b')](function(_0x3cdb2e){logger[_0xab2e('0x24')](_0xab2e('0x4d'),_0x3cdb2e);throw _0x3cdb2e;});}return _0x39bc8b;})['then'](respondWithResult(_0x231a7d,0xc9))[_0xab2e('0x3b')](handleError(_0x231a7d,null));};exports[_0xab2e('0x4e')]=function(_0x2179a0,_0x10c269){if(_0x2179a0[_0xab2e('0x42')]['id']){delete _0x2179a0[_0xab2e('0x42')]['id'];}return db[_0xab2e('0x29')][_0xab2e('0x20')]({'where':{'id':_0x2179a0['params']['id']}})['then'](handleEntityNotFound(_0x10c269,null))['then'](function(_0x2bafde){if(_0x2bafde){return db[_0xab2e('0x29')][_0xab2e('0x4e')](_[_0xab2e('0x38')](_0x2179a0[_0xab2e('0x42')],[_0xab2e('0x45'),_0xab2e('0x4f'),_0xab2e('0x50'),_0xab2e('0x51'),_0xab2e('0x52'),_0xab2e('0x53'),_0xab2e('0x54')]),{'where':{'context':_0x2bafde['context'],'exten':_0x2bafde[_0xab2e('0x45')]},'individualHooks':!![]})[_0xab2e('0x13')](function(_0x3b92c6){return _0x3b92c6;});}return null;})[_0xab2e('0x13')](respondWithStatusCode(_0x10c269,null))[_0xab2e('0x3b')](handleError(_0x10c269,null));};exports[_0xab2e('0x55')]=function(_0x2a4a50,_0x185077){var _0x3036fc=_0x2a4a50['params']['id'];var _0x347d6e=_0x2a4a50[_0xab2e('0x42')];var _0x1301ee=0xc8;var _0xc10bf3=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xab2e('0x56')][_0xab2e('0x57')][_0xab2e('0x58')]},function(_0x4b5ef2){return db[_0xab2e('0x29')][_0xab2e('0x59')]({'where':{'id':_0x3036fc},'transaction':_0x4b5ef2})[_0xab2e('0x13')](function(_0x24e607){if(_0x24e607){return db[_0xab2e('0x29')]['destroy']({'where':{'VoiceExtensionId':_0x3036fc},'transaction':_0x4b5ef2})[_0xab2e('0x13')](function(){var _0x3cf3da=_[_0xab2e('0x1c')](_0x347d6e,function(_0x3a618e){_0x3a618e[_0xab2e('0x5a')]=_0x3036fc;_0x3a618e['isApp']=!![];return _0x3a618e;});return _0x24e607[_0xab2e('0x5b')](_0x3cf3da);})[_0xab2e('0x13')](function(_0x482966){return db[_0xab2e('0x29')][_0xab2e('0x5c')](_0x482966,{'transaction':_0x4b5ef2});});}else{_0x1301ee=0x194;_0xc10bf3=[];}});})[_0xab2e('0x13')](function(){if(_0x1301ee!==0x194){return db[_0xab2e('0x29')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x3036fc},'order':_0xab2e('0x5d')})[_0xab2e('0x13')](function(_0x1386ec){_0xc10bf3=_0x1386ec;});}})[_0xab2e('0x3b')](function(_0x614edb){_0x1301ee=0x1f4;logger[_0xab2e('0x24')](_0x614edb[_0xab2e('0x25')]);if(_0x614edb[_0xab2e('0x26')]){delete _0x614edb[_0xab2e('0x26')];}_0xc10bf3=_0x614edb;})[_0xab2e('0x5e')](function(){if(_0xc10bf3===null){_0x185077['sendStatus'](_0x1301ee);}else{if(_0x1301ee===0x1f4){_0x185077[_0xab2e('0xf')](_0x1301ee)[_0xab2e('0x27')](_0xc10bf3);}else{_0x185077[_0xab2e('0xf')](_0x1301ee)[_0xab2e('0x12')](_0xc10bf3);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ced630b..e8c219a 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 _0x9317=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x3f46b0,_0x7a813a){var _0x2873fe=function(_0x46194c){while(--_0x46194c){_0x3f46b0['push'](_0x3f46b0['shift']());}};_0x2873fe(++_0x7a813a);}(_0x9317,0x1e7));var _0x7931=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x9317[_0x4de1b1];return _0x639f27;};'use strict';var EventEmitter=require(_0x7931('0x0'));var VoiceExtension=require(_0x7931('0x1'))['db'][_0x7931('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7931('0x3'),'afterUpdate':_0x7931('0x4'),'afterDestroy':_0x7931('0x5')};function emitEvent(_0x4945e7){return function(_0x4aed9a,_0x5ee361,_0x3f3474){VoiceExtensionEvents['emit'](_0x4945e7+':'+_0x4aed9a['id'],_0x4aed9a);VoiceExtensionEvents[_0x7931('0x6')](_0x4945e7,_0x4aed9a);_0x3f3474(null);};}for(var e in events){if(events[_0x7931('0x7')](e)){var event=events[e];VoiceExtension[_0x7931('0x8')](e,emitEvent(event));}}module[_0x7931('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x6e65=['exports','events','VoiceExtension','update','remove','emit','hook'];(function(_0xe835b5,_0x53aa99){var _0x274f40=function(_0x4869e1){while(--_0x4869e1){_0xe835b5['push'](_0xe835b5['shift']());}};_0x274f40(++_0x53aa99);}(_0x6e65,0x158));var _0x56e6=function(_0x2f39cf,_0x3c59ec){_0x2f39cf=_0x2f39cf-0x0;var _0xd0ece8=_0x6e65[_0x2f39cf];return _0xd0ece8;};'use strict';var EventEmitter=require(_0x56e6('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x56e6('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x56e6('0x2'),'afterDestroy':_0x56e6('0x3')};function emitEvent(_0x4eda6f){return function(_0x4daabd,_0x168450,_0xeb688c){VoiceExtensionEvents[_0x56e6('0x4')](_0x4eda6f+':'+_0x4daabd['id'],_0x4daabd);VoiceExtensionEvents[_0x56e6('0x4')](_0x4eda6f,_0x4daabd);_0xeb688c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x56e6('0x5')](e,emitEvent(event));}}module[_0x56e6('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 882a991..4847d0a 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 _0xf6ca=['length','*,*,*,*','intervals','map','toLowerCase','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','name','param','prefix','phone','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then'];(function(_0x7b7eb,_0x375077){var _0x1558f1=function(_0x480d93){while(--_0x480d93){_0x7b7eb['push'](_0x7b7eb['shift']());}};_0x1558f1(++_0x375077);}(_0xf6ca,0x11e));var _0xaf6c=function(_0x4ad46e,_0x447376){_0x4ad46e=_0x4ad46e-0x0;var _0x198834=_0xf6ca[_0x4ad46e];return _0x198834;};'use strict';var _=require(_0xaf6c('0x0'));var attributes=require(_0xaf6c('0x1'));module[_0xaf6c('0x2')]=function(_0x57e02d){var _0x2d08cb=_0x57e02d[_0xaf6c('0x3')];function _0x5c1632(_0x21bca7){var _0x37f2eb=0x2;var _0x9512b6=[{'type':_0x21bca7[_0xaf6c('0x4')],'app':'Set','appdata':_0xaf6c('0x5')+_0x21bca7[_0xaf6c('0x4')],'context':_0x21bca7[_0xaf6c('0x6')],'exten':_0x21bca7[_0xaf6c('0x7')],'priority':_0x37f2eb++,'VoiceExtensionId':_0x21bca7['id']},{'type':_0x21bca7[_0xaf6c('0x4')],'app':_0x21bca7[_0xaf6c('0x8')]?_0xaf6c('0x9'):_0xaf6c('0xa'),'appdata':_0x21bca7['alias']?_0xaf6c('0xb')+_0x21bca7['alias']:'No\x20alias\x20set','context':_0x21bca7[_0xaf6c('0x6')],'exten':_0x21bca7[_0xaf6c('0x7')],'priority':_0x37f2eb++,'VoiceExtensionId':_0x21bca7['id']}];if(_0x21bca7[_0xaf6c('0x4')]==='inbound'){_0x9512b6[_0xaf6c('0xc')]({'type':_0xaf6c('0xd'),'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0xe')+_0x21bca7['id'],'context':_0x21bca7[_0xaf6c('0x6')],'exten':_0x21bca7[_0xaf6c('0x7')],'priority':_0x37f2eb++,'VoiceExtensionId':_0x21bca7['id']});}_0x9512b6[_0xaf6c('0xc')]({'type':_0x21bca7[_0xaf6c('0x4')],'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0xf'),'context':_0x21bca7[_0xaf6c('0x6')],'exten':_0x21bca7[_0xaf6c('0x7')],'priority':_0x37f2eb++,'VoiceExtensionId':_0x21bca7['id']},{'type':_0x21bca7['type'],'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0x10'),'context':_0x21bca7[_0xaf6c('0x6')],'exten':_0x21bca7[_0xaf6c('0x7')],'priority':_0x37f2eb++,'VoiceExtensionId':_0x21bca7['id']},{'type':_0x21bca7[_0xaf6c('0x4')],'app':'Set','appdata':_0xaf6c('0x11'),'context':_0x21bca7[_0xaf6c('0x6')],'exten':_0x21bca7[_0xaf6c('0x7')],'priority':_0x37f2eb++,'VoiceExtensionId':_0x21bca7['id']});return _0x9512b6;}function _0x1c9898(_0x44f6c7){var _0x54f5d6=0x2;var _0x44fc78=[{'type':_0xaf6c('0x12'),'app':_0xaf6c('0x9'),'appdata':'CDR(type)=outbound','context':_0x44f6c7['context'],'exten':_0x44f6c7['exten'],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':_0xaf6c('0x12'),'app':_0x44f6c7[_0xaf6c('0x8')]?_0xaf6c('0x9'):_0xaf6c('0xa'),'appdata':_0x44f6c7[_0xaf6c('0x8')]?'CDR(routeAlias)='+_0x44f6c7[_0xaf6c('0x8')]:'No\x20alias\x20set','context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':_0xaf6c('0x12'),'app':'Set','appdata':_0xaf6c('0x13')+(_0x44f6c7['cutdigits']?_0xaf6c('0x14')+_0x44f6c7[_0xaf6c('0x15')]+'}':_0xaf6c('0x16')),'context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':'outbound','app':_0xaf6c('0x9'),'appdata':_0xaf6c('0xe')+_0x44f6c7['id'],'context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':_0xaf6c('0x12'),'app':'ExecIf','appdata':_0xaf6c('0x17')+(_0x54f5d6+0x2)+_0xaf6c('0x18')+(_0x54f5d6+0x1)+')','context':_0x44f6c7['context'],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':'outbound','app':_0xaf6c('0x9'),'appdata':_0x44f6c7[_0xaf6c('0x15')]?_0xaf6c('0x19')+_0x44f6c7[_0xaf6c('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x44f6c7['context'],'exten':_0x44f6c7['exten'],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':_0xaf6c('0x12'),'app':'Set','appdata':_0xaf6c('0xf'),'context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':'outbound','app':_0xaf6c('0x9'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x44f6c7['context'],'exten':_0x44f6c7['exten'],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':'outbound','app':_0xaf6c('0x9'),'appdata':_0xaf6c('0x11'),'context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7['exten'],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':_0xaf6c('0x12'),'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0x1a')+_0x44f6c7['id'],'context':_0x44f6c7['context'],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']}];if(_0x44f6c7[_0xaf6c('0x1b')](_0xaf6c('0x1c'))&&_0x44f6c7[_0xaf6c('0x1c')]!==_0xaf6c('0x1d')){_0x44fc78[_0xaf6c('0xc')]({'type':_0xaf6c('0x12'),'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0x1e'),'context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7['exten'],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']},{'type':'outbound','app':_0xaf6c('0x9'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x44f6c7['recordingFormat']||_0xaf6c('0x1f'),'context':_0x44f6c7[_0xaf6c('0x6')],'exten':_0x44f6c7[_0xaf6c('0x7')],'priority':_0x54f5d6++,'VoiceExtensionId':_0x44f6c7['id']});}return _0x44fc78;}function _0x4598bd(_0x253a44,_0x218fbc){var _0x56c905=[{'name':_0xaf6c('0x20'),'param':0x0},{'name':_0xaf6c('0x21'),'param':0x1},{'name':_0xaf6c('0x22'),'param':0x2},{'name':_0xaf6c('0x23'),'param':0x3}];var _0x3dd179={};var _0x2073fc=_0x218fbc[_0xaf6c('0x24')](',');var _0x51addd=[];for(var _0x59f2ba=0x0;_0x59f2ba<_0x56c905['length'];_0x59f2ba++){switch(_0x56c905[_0x59f2ba][_0xaf6c('0x25')]){case'trunk':_0x3dd179[_0xaf6c('0x20')]=_0x2073fc[_0x56c905[_0x59f2ba]['param']][_0xaf6c('0x24')]('/')[0x1];_0x3dd179['phone']=_0x2073fc[_0x56c905[_0x59f2ba][_0xaf6c('0x26')]][_0xaf6c('0x24')]('/')[0x2];_0x3dd179[_0xaf6c('0x27')]=_0x3dd179['phone']?_0x3dd179[_0xaf6c('0x28')][_0xaf6c('0x24')]('$')[0x0]:undefined;_0x3dd179[_0xaf6c('0x28')]=_0x253a44[_0xaf6c('0x15')]?(_0x3dd179[_0xaf6c('0x27')]||'')+'${EXTEN:'+_0x253a44['cutdigits']+'}':(_0x3dd179[_0xaf6c('0x27')]||'')+'${EXTEN}';_0x51addd[_0x56c905[_0x59f2ba][_0xaf6c('0x26')]]=[_0xaf6c('0x29'),_0x3dd179[_0xaf6c('0x20')],_0x3dd179[_0xaf6c('0x28')]][_0xaf6c('0x2a')]('/');break;case _0xaf6c('0x22'):_0x3dd179[_0xaf6c('0x22')]=_0x2073fc[_0x56c905[_0x59f2ba][_0xaf6c('0x26')]];if(_0x253a44['recordingFormat']!==_0xaf6c('0x1d')){if(_0x3dd179['options']['indexOf'](_0xaf6c('0x2b'))<0x0){_0x3dd179['options']+=_0xaf6c('0x2b');}}else{_0x3dd179[_0xaf6c('0x22')]=_0x3dd179['options'][_0xaf6c('0x2c')]('U(xcally-mixmonitor-context)','');}_0x51addd[_0x56c905[_0x59f2ba][_0xaf6c('0x26')]]=_0x3dd179['options'];break;default:_0x51addd[_0x56c905[_0x59f2ba][_0xaf6c('0x26')]]=_0x2073fc[_0x56c905[_0x59f2ba]['param']];}}return _0x51addd[_0xaf6c('0x2a')](',');}function _0xa5d033(_0x2e2a5e,_0x1730b1,_0xf3a410){return new Promise(function(_0x4765ca,_0x426e64){var _0x261f37=[];if(_[_0xaf6c('0x2d')](_0x1730b1))return _0x4765ca(_0x261f37);_0x2d08cb['Interval'][_0xaf6c('0x2e')]({'attributes':['id',_0xaf6c('0x2f'),_0xaf6c('0x30')],'raw':!![]})[_0xaf6c('0x31')](function(_0x111570){for(var _0x4f931d=0x0,_0x2a30d1=0x0;_0x4f931d<_0x1730b1[_0xaf6c('0x32')];_0x4f931d++,_0x2a30d1=0x0){var _0x4242a1=_0x1730b1[_0x4f931d];var _0x1652d2=[];var _0x11fd26=[];delete _0x4242a1['id'];if(_0x4242a1['interval']!==_0xaf6c('0x33')){_0x4242a1['intervals']=[_0x4242a1['interval']];}else{_0x4242a1[_0xaf6c('0x34')]=_0x4242a1[_0xaf6c('0x30')]?_[_0xaf6c('0x35')](_['filter'](_0x111570,{'IntervalId':_0x4242a1[_0xaf6c('0x30')]}),'interval'):[];}_0x4242a1[_0xaf6c('0x6')]=_0x2e2a5e['context'];_0x4242a1[_0xaf6c('0x7')]=_0x2e2a5e[_0xaf6c('0x7')];if(_0x4242a1[_0xaf6c('0x4')])_0x4242a1[_0xaf6c('0x4')]=_0x4242a1[_0xaf6c('0x4')][_0xaf6c('0x36')]();if(_0x2e2a5e[_0xaf6c('0x4')]===_0xaf6c('0x12')){if(_0x4242a1[_0xaf6c('0x1b')](_0xaf6c('0x37'))&&_0x4242a1[_0xaf6c('0x37')]&&_0x4242a1[_0xaf6c('0x37')]!=='--'){_0x1652d2[_0xaf6c('0xc')]({'type':_0x4242a1[_0xaf6c('0x4')][_0xaf6c('0x36')](),'app':_0xaf6c('0x9'),'appdata':'CDR(tag)='+_0x4242a1[_0xaf6c('0x37')],'context':_0x2e2a5e[_0xaf6c('0x6')],'exten':_0x2e2a5e['exten'],'priority':_0x4242a1[_0xaf6c('0x34')]['length']+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});}_0x1652d2['push']({'type':_0x4242a1[_0xaf6c('0x4')][_0xaf6c('0x36')](),'app':_0xaf6c('0x38'),'appdata':_0xaf6c('0x39')+(_0x4242a1[_0xaf6c('0x3a')]?_0xaf6c('0x3b')+_0x4242a1[_0xaf6c('0x3a')]+')':_0xaf6c('0x3c')),'context':_0x2e2a5e[_0xaf6c('0x6')],'exten':_0x2e2a5e['exten'],'priority':_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')]+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});}else{if(_0x4242a1['hasOwnProperty'](_0xaf6c('0x3d'))){if([_0xaf6c('0x3e'),_0xaf6c('0x3f')][_0xaf6c('0x40')](_0x4242a1['app'][_0xaf6c('0x36')]())&&_0x4242a1[_0xaf6c('0x41')]!==_0xaf6c('0x42')){if(_0x4242a1[_0xaf6c('0x3d')]){_0x1652d2['push']({'type':_0x4242a1[_0xaf6c('0x4')][_0xaf6c('0x36')](),'app':'ExecIf','appdata':_0xaf6c('0x43'),'context':_0x2e2a5e[_0xaf6c('0x6')],'exten':_0x2e2a5e['exten'],'priority':_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')]+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});_0x1652d2['push']({'type':_0x4242a1[_0xaf6c('0x4')][_0xaf6c('0x36')](),'app':'Set','appdata':_0xaf6c('0x44'),'context':_0x2e2a5e[_0xaf6c('0x6')],'exten':_0x2e2a5e[_0xaf6c('0x7')],'priority':_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')]+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});}else{_0x1652d2[_0xaf6c('0xc')]({'type':_0x4242a1[_0xaf6c('0x4')][_0xaf6c('0x36')](),'app':_0xaf6c('0x38'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2e2a5e['context'],'exten':_0x2e2a5e['exten'],'priority':_0x4242a1[_0xaf6c('0x34')]['length']+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});_0x1652d2['push']({'type':_0x4242a1['type'][_0xaf6c('0x36')](),'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0x45'),'context':_0x2e2a5e['context'],'exten':_0x2e2a5e[_0xaf6c('0x7')],'priority':_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')]+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});}}}}for(var _0x58dde7=0x0;_0x58dde7<_0x4242a1[_0xaf6c('0x34')]['length'];_0x58dde7++){var _0x40f04b=_0xf3a410+_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')];var _0x1697db=_0x58dde7===_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')]-0x1?_0xf3a410+_0x1652d2['length']+_0x11fd26['length']+0x2:_0xf3a410+_0x58dde7+0x1;_0x1652d2[_0xaf6c('0x46')](_0x58dde7,0x0,{'type':_0x2e2a5e[_0xaf6c('0x4')],'app':_0xaf6c('0x47'),'appdata':_0x4242a1[_0xaf6c('0x34')][_0x58dde7]+'?'+_0x2e2a5e['context']+',${EXTEN},'+_0x40f04b+':'+_0x2e2a5e[_0xaf6c('0x6')]+_0xaf6c('0x48')+_0x1697db,'exten':_0x2e2a5e[_0xaf6c('0x7')],'context':_0x2e2a5e['context'],'priority':_0xf3a410+_0x58dde7,'VoiceExtensionId':_0x2e2a5e['id']});}if(_0x4242a1[_0xaf6c('0x41')]==='outboundDial'){_0x4242a1[_0xaf6c('0x49')]=_0x4598bd(_0x2e2a5e,_0x4242a1['appdata']);}if(_0x4242a1[_0xaf6c('0x41')]===_0xaf6c('0x4a')){_0x1652d2[_0xaf6c('0xc')]({'type':_0x4242a1[_0xaf6c('0x4')]['toLowerCase'](),'app':_0xaf6c('0x9'),'appdata':_0xaf6c('0x4b'),'context':_0x2e2a5e[_0xaf6c('0x6')],'exten':_0x2e2a5e[_0xaf6c('0x7')],'priority':_0x4242a1[_0xaf6c('0x34')][_0xaf6c('0x32')]+_0xf3a410+_0x2a30d1++,'VoiceExtensionId':_0x2e2a5e['id']});}_0x4242a1['priority']=_0x1652d2[_0xaf6c('0x32')]?_[_0xaf6c('0x4c')](_0x1652d2)[_0xaf6c('0x4d')]+0x1:_0xf3a410;_0x261f37=_['concat'](_0x261f37,_0x1652d2,[_0x4242a1],_0x11fd26);_0xf3a410=_['last'](_0x261f37)[_0xaf6c('0x4d')]+0x1;}return _0x4765ca(_0x261f37);})[_0xaf6c('0x4e')](function(_0x4139b0){_0x426e64(_0x4139b0);});});}return _0x57e02d[_0xaf6c('0x4f')](_0xaf6c('0x50'),attributes,{'tableName':_0xaf6c('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x55fc90){var _0x214fe9=this[_0xaf6c('0x52')]({'plain':!![]});var _0x41fad1=_0x214fe9[_0xaf6c('0x4')]===_0xaf6c('0x12')?_0x1c9898(_0x214fe9):_0x5c1632(_0x214fe9);return _0xa5d033(_0x214fe9,_0x55fc90,_['last'](_0x41fad1)[_0xaf6c('0x4d')]+0x1)['then'](function(_0x39c78c){var _0x1fb196=_['concat'](_0x41fad1,_0x39c78c);_0x1fb196[_0xaf6c('0xc')]({'type':_0x214fe9[_0xaf6c('0x4')],'app':_0xaf6c('0x53'),'exten':_0x214fe9[_0xaf6c('0x7')],'context':_0x214fe9[_0xaf6c('0x6')],'priority':_[_0xaf6c('0x4c')](_0x1fb196)[_0xaf6c('0x4d')]+0x1,'VoiceExtensionId':_0x214fe9['id']});return _0x1fb196;});}}});}; \ No newline at end of file +var _0x18b8=['alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','name','param','split','phone','prefix','${EXTEN:','SIP','join','none','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','then','length','interval','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','includes','app','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten'];(function(_0x166709,_0x40e83e){var _0x35826c=function(_0x146f16){while(--_0x146f16){_0x166709['push'](_0x166709['shift']());}};_0x35826c(++_0x40e83e);}(_0x18b8,0xff));var _0x818b=function(_0x29c6b2,_0x1d9cdb){_0x29c6b2=_0x29c6b2-0x0;var _0x489460=_0x18b8[_0x29c6b2];return _0x489460;};'use strict';var _=require(_0x818b('0x0'));var attributes=require(_0x818b('0x1'));module[_0x818b('0x2')]=function(_0x263530){var _0x2b8488=_0x263530[_0x818b('0x3')];function _0x40793d(_0x1bf5f4){var _0x47047f=0x2;var _0x3717c6=[{'type':_0x1bf5f4['type'],'app':_0x818b('0x4'),'appdata':_0x818b('0x5')+_0x1bf5f4[_0x818b('0x6')],'context':_0x1bf5f4[_0x818b('0x7')],'exten':_0x1bf5f4[_0x818b('0x8')],'priority':_0x47047f++,'VoiceExtensionId':_0x1bf5f4['id']},{'type':_0x1bf5f4[_0x818b('0x6')],'app':_0x1bf5f4[_0x818b('0x9')]?_0x818b('0x4'):'NoOp','appdata':_0x1bf5f4[_0x818b('0x9')]?_0x818b('0xa')+_0x1bf5f4[_0x818b('0x9')]:_0x818b('0xb'),'context':_0x1bf5f4['context'],'exten':_0x1bf5f4[_0x818b('0x8')],'priority':_0x47047f++,'VoiceExtensionId':_0x1bf5f4['id']}];if(_0x1bf5f4[_0x818b('0x6')]===_0x818b('0xc')){_0x3717c6[_0x818b('0xd')]({'type':_0x818b('0xc'),'app':_0x818b('0x4'),'appdata':_0x818b('0xe')+_0x1bf5f4['id'],'context':_0x1bf5f4[_0x818b('0x7')],'exten':_0x1bf5f4[_0x818b('0x8')],'priority':_0x47047f++,'VoiceExtensionId':_0x1bf5f4['id']});}_0x3717c6['push']({'type':_0x1bf5f4['type'],'app':'Set','appdata':_0x818b('0xf'),'context':_0x1bf5f4[_0x818b('0x7')],'exten':_0x1bf5f4[_0x818b('0x8')],'priority':_0x47047f++,'VoiceExtensionId':_0x1bf5f4['id']},{'type':_0x1bf5f4[_0x818b('0x6')],'app':_0x818b('0x4'),'appdata':_0x818b('0x10'),'context':_0x1bf5f4[_0x818b('0x7')],'exten':_0x1bf5f4[_0x818b('0x8')],'priority':_0x47047f++,'VoiceExtensionId':_0x1bf5f4['id']},{'type':_0x1bf5f4[_0x818b('0x6')],'app':_0x818b('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1bf5f4[_0x818b('0x7')],'exten':_0x1bf5f4[_0x818b('0x8')],'priority':_0x47047f++,'VoiceExtensionId':_0x1bf5f4['id']});return _0x3717c6;}function _0x463153(_0x3d426b){var _0xd53def=0x2;var _0x47eca3=[{'type':_0x818b('0x11'),'app':_0x818b('0x4'),'appdata':_0x818b('0x12'),'context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':_0x818b('0x11'),'app':_0x3d426b[_0x818b('0x9')]?_0x818b('0x4'):_0x818b('0x13'),'appdata':_0x3d426b[_0x818b('0x9')]?_0x818b('0xa')+_0x3d426b['alias']:_0x818b('0xb'),'context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':'outbound','app':_0x818b('0x4'),'appdata':_0x818b('0x14')+(_0x3d426b[_0x818b('0x15')]?'${EXTEN:'+_0x3d426b[_0x818b('0x15')]+'}':_0x818b('0x16')),'context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':_0x818b('0x11'),'app':_0x818b('0x4'),'appdata':_0x818b('0xe')+_0x3d426b['id'],'context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':'outbound','app':_0x818b('0x17'),'appdata':_0x818b('0x18')+(_0xd53def+0x2)+_0x818b('0x19')+(_0xd53def+0x1)+')','context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b['exten'],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':_0x818b('0x11'),'app':_0x818b('0x4'),'appdata':_0x3d426b[_0x818b('0x15')]?_0x818b('0x1a')+_0x3d426b['cutdigits']+'}':_0x818b('0x1b'),'context':_0x3d426b['context'],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':'outbound','app':_0x818b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':_0x818b('0x11'),'app':_0x818b('0x4'),'appdata':_0x818b('0x10'),'context':_0x3d426b['context'],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':'outbound','app':_0x818b('0x4'),'appdata':_0x818b('0x1c'),'context':_0x3d426b['context'],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':_0x818b('0x11'),'app':'Set','appdata':_0x818b('0x1d')+_0x3d426b['id'],'context':_0x3d426b[_0x818b('0x7')],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']}];if(_0x3d426b[_0x818b('0x1e')]('recordingFormat')&&_0x3d426b[_0x818b('0x1f')]!=='none'){_0x47eca3[_0x818b('0xd')]({'type':'outbound','app':_0x818b('0x4'),'appdata':_0x818b('0x20'),'context':_0x3d426b['context'],'exten':_0x3d426b['exten'],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']},{'type':_0x818b('0x11'),'app':_0x818b('0x4'),'appdata':_0x818b('0x21')+_0x3d426b['recordingFormat']||_0x818b('0x22'),'context':_0x3d426b['context'],'exten':_0x3d426b[_0x818b('0x8')],'priority':_0xd53def++,'VoiceExtensionId':_0x3d426b['id']});}return _0x47eca3;}function _0x417950(_0xc65875,_0x1ce40a){var _0x5864bc=[{'name':_0x818b('0x23'),'param':0x0},{'name':_0x818b('0x24'),'param':0x1},{'name':'options','param':0x2},{'name':_0x818b('0x25'),'param':0x3}];var _0x2771b0={};var _0x1cebc9=_0x1ce40a['split'](',');var _0x4df1bf=[];for(var _0x5823e3=0x0;_0x5823e3<_0x5864bc['length'];_0x5823e3++){switch(_0x5864bc[_0x5823e3][_0x818b('0x26')]){case'trunk':_0x2771b0[_0x818b('0x23')]=_0x1cebc9[_0x5864bc[_0x5823e3][_0x818b('0x27')]][_0x818b('0x28')]('/')[0x1];_0x2771b0[_0x818b('0x29')]=_0x1cebc9[_0x5864bc[_0x5823e3][_0x818b('0x27')]][_0x818b('0x28')]('/')[0x2];_0x2771b0[_0x818b('0x2a')]=_0x2771b0['phone']?_0x2771b0['phone'][_0x818b('0x28')]('$')[0x0]:undefined;_0x2771b0['phone']=_0xc65875[_0x818b('0x15')]?(_0x2771b0[_0x818b('0x2a')]||'')+_0x818b('0x2b')+_0xc65875[_0x818b('0x15')]+'}':(_0x2771b0[_0x818b('0x2a')]||'')+'${EXTEN}';_0x4df1bf[_0x5864bc[_0x5823e3]['param']]=[_0x818b('0x2c'),_0x2771b0[_0x818b('0x23')],_0x2771b0[_0x818b('0x29')]][_0x818b('0x2d')]('/');break;case'options':_0x2771b0['options']=_0x1cebc9[_0x5864bc[_0x5823e3][_0x818b('0x27')]];if(_0xc65875[_0x818b('0x1f')]!==_0x818b('0x2e')){if(_0x2771b0[_0x818b('0x2f')][_0x818b('0x30')]('U(xcally-mixmonitor-context)')<0x0){_0x2771b0[_0x818b('0x2f')]+=_0x818b('0x31');}}else{_0x2771b0[_0x818b('0x2f')]=_0x2771b0[_0x818b('0x2f')][_0x818b('0x32')](_0x818b('0x31'),'');}_0x4df1bf[_0x5864bc[_0x5823e3][_0x818b('0x27')]]=_0x2771b0[_0x818b('0x2f')];break;default:_0x4df1bf[_0x5864bc[_0x5823e3][_0x818b('0x27')]]=_0x1cebc9[_0x5864bc[_0x5823e3]['param']];}}return _0x4df1bf[_0x818b('0x2d')](',');}function _0x59714c(_0x4acce1,_0x345d2f,_0x512c48){return new Promise(function(_0x341633,_0x29b562){var _0x1d5dcb=[];if(_[_0x818b('0x33')](_0x345d2f))return _0x341633(_0x1d5dcb);_0x2b8488['Interval'][_0x818b('0x34')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x818b('0x35')](function(_0x5a40f6){for(var _0x263e94=0x0,_0x3f489d=0x0;_0x263e94<_0x345d2f[_0x818b('0x36')];_0x263e94++,_0x3f489d=0x0){var _0x5893ad=_0x345d2f[_0x263e94];var _0x34abea=[];var _0x37e17f=[];delete _0x5893ad['id'];if(_0x5893ad[_0x818b('0x37')]!==_0x818b('0x38')){_0x5893ad[_0x818b('0x39')]=[_0x5893ad[_0x818b('0x37')]];}else{_0x5893ad['intervals']=_0x5893ad[_0x818b('0x3a')]?_[_0x818b('0x3b')](_[_0x818b('0x3c')](_0x5a40f6,{'IntervalId':_0x5893ad[_0x818b('0x3a')]}),'interval'):[];}_0x5893ad['context']=_0x4acce1['context'];_0x5893ad[_0x818b('0x8')]=_0x4acce1['exten'];if(_0x5893ad[_0x818b('0x6')])_0x5893ad[_0x818b('0x6')]=_0x5893ad[_0x818b('0x6')][_0x818b('0x3d')]();if(_0x4acce1[_0x818b('0x6')]===_0x818b('0x11')){if(_0x5893ad[_0x818b('0x1e')](_0x818b('0x3e'))&&_0x5893ad['tag']&&_0x5893ad[_0x818b('0x3e')]!=='--'){_0x34abea[_0x818b('0xd')]({'type':_0x5893ad[_0x818b('0x6')][_0x818b('0x3d')](),'app':_0x818b('0x4'),'appdata':_0x818b('0x3f')+_0x5893ad[_0x818b('0x3e')],'context':_0x4acce1[_0x818b('0x7')],'exten':_0x4acce1[_0x818b('0x8')],'priority':_0x5893ad[_0x818b('0x39')][_0x818b('0x36')]+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});}_0x34abea[_0x818b('0xd')]({'type':_0x5893ad[_0x818b('0x6')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x5893ad[_0x818b('0x40')]?_0x818b('0x41')+_0x5893ad[_0x818b('0x40')]+')':_0x818b('0x42')),'context':_0x4acce1[_0x818b('0x7')],'exten':_0x4acce1[_0x818b('0x8')],'priority':_0x5893ad[_0x818b('0x39')]['length']+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});}else{if(_0x5893ad['hasOwnProperty']('answer')){if(['queue','playback'][_0x818b('0x43')](_0x5893ad[_0x818b('0x44')][_0x818b('0x3d')]())&&_0x5893ad['appType']!=='custom'){if(_0x5893ad[_0x818b('0x45')]){_0x34abea[_0x818b('0xd')]({'type':_0x5893ad[_0x818b('0x6')][_0x818b('0x3d')](),'app':_0x818b('0x17'),'appdata':_0x818b('0x46'),'context':_0x4acce1[_0x818b('0x7')],'exten':_0x4acce1['exten'],'priority':_0x5893ad['intervals']['length']+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});_0x34abea[_0x818b('0xd')]({'type':_0x5893ad['type'][_0x818b('0x3d')](),'app':_0x818b('0x4'),'appdata':_0x818b('0x47'),'context':_0x4acce1['context'],'exten':_0x4acce1[_0x818b('0x8')],'priority':_0x5893ad[_0x818b('0x39')][_0x818b('0x36')]+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});}else{_0x34abea[_0x818b('0xd')]({'type':_0x5893ad[_0x818b('0x6')][_0x818b('0x3d')](),'app':_0x818b('0x17'),'appdata':_0x818b('0x48'),'context':_0x4acce1[_0x818b('0x7')],'exten':_0x4acce1[_0x818b('0x8')],'priority':_0x5893ad[_0x818b('0x39')][_0x818b('0x36')]+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});_0x34abea[_0x818b('0xd')]({'type':_0x5893ad[_0x818b('0x6')][_0x818b('0x3d')](),'app':'Set','appdata':_0x818b('0x49'),'context':_0x4acce1['context'],'exten':_0x4acce1['exten'],'priority':_0x5893ad[_0x818b('0x39')][_0x818b('0x36')]+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});}}}}for(var _0x338406=0x0;_0x338406<_0x5893ad[_0x818b('0x39')][_0x818b('0x36')];_0x338406++){var _0x6d118b=_0x512c48+_0x5893ad[_0x818b('0x39')][_0x818b('0x36')];var _0x5d3054=_0x338406===_0x5893ad['intervals']['length']-0x1?_0x512c48+_0x34abea['length']+_0x37e17f['length']+0x2:_0x512c48+_0x338406+0x1;_0x34abea[_0x818b('0x4a')](_0x338406,0x0,{'type':_0x4acce1[_0x818b('0x6')],'app':_0x818b('0x4b'),'appdata':_0x5893ad['intervals'][_0x338406]+'?'+_0x4acce1['context']+_0x818b('0x4c')+_0x6d118b+':'+_0x4acce1[_0x818b('0x7')]+_0x818b('0x4c')+_0x5d3054,'exten':_0x4acce1['exten'],'context':_0x4acce1[_0x818b('0x7')],'priority':_0x512c48+_0x338406,'VoiceExtensionId':_0x4acce1['id']});}if(_0x5893ad[_0x818b('0x4d')]==='outboundDial'){_0x5893ad[_0x818b('0x4e')]=_0x417950(_0x4acce1,_0x5893ad[_0x818b('0x4e')]);}if(_0x5893ad[_0x818b('0x4d')]==='agi'){_0x34abea[_0x818b('0xd')]({'type':_0x5893ad[_0x818b('0x6')][_0x818b('0x3d')](),'app':_0x818b('0x4'),'appdata':_0x818b('0x4f'),'context':_0x4acce1[_0x818b('0x7')],'exten':_0x4acce1[_0x818b('0x8')],'priority':_0x5893ad[_0x818b('0x39')][_0x818b('0x36')]+_0x512c48+_0x3f489d++,'VoiceExtensionId':_0x4acce1['id']});}_0x5893ad[_0x818b('0x50')]=_0x34abea[_0x818b('0x36')]?_[_0x818b('0x51')](_0x34abea)['priority']+0x1:_0x512c48;_0x1d5dcb=_[_0x818b('0x52')](_0x1d5dcb,_0x34abea,[_0x5893ad],_0x37e17f);_0x512c48=_['last'](_0x1d5dcb)[_0x818b('0x50')]+0x1;}return _0x341633(_0x1d5dcb);})[_0x818b('0x53')](function(_0x50fec9){_0x29b562(_0x50fec9);});});}return _0x263530[_0x818b('0x54')]('VoiceExtension',attributes,{'tableName':_0x818b('0x55'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xfac06d){var _0x541c74=this[_0x818b('0x56')]({'plain':!![]});var _0x572b6d=_0x541c74[_0x818b('0x6')]===_0x818b('0x11')?_0x463153(_0x541c74):_0x40793d(_0x541c74);return _0x59714c(_0x541c74,_0xfac06d,_[_0x818b('0x51')](_0x572b6d)[_0x818b('0x50')]+0x1)['then'](function(_0x965cdd){var _0x32acb1=_[_0x818b('0x52')](_0x572b6d,_0x965cdd);_0x32acb1['push']({'type':_0x541c74[_0x818b('0x6')],'app':_0x818b('0x57'),'exten':_0x541c74['exten'],'context':_0x541c74['context'],'priority':_[_0x818b('0x51')](_0x32acb1)[_0x818b('0x50')]+0x1,'VoiceExtensionId':_0x541c74['id']});return _0x32acb1;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 55a9fa2..28f6574 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 _0x280b=['where','attributes','include','model','map','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw'];(function(_0x1d33ba,_0x42d7b6){var _0x53285e=function(_0xa7e6f9){while(--_0xa7e6f9){_0x1d33ba['push'](_0x1d33ba['shift']());}};_0x53285e(++_0x42d7b6);}(_0x280b,0xce));var _0xb280=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x280b[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var moment=require('moment');var BPromise=require(_0xb280('0x2'));var rs=require(_0xb280('0x3'));var fs=require('fs');var Redis=require(_0xb280('0x4'));var db=require(_0xb280('0x5'))['db'];var utils=require(_0xb280('0x6'));var logger=require(_0xb280('0x7'))(_0xb280('0x8'));var config=require(_0xb280('0x9'));var jayson=require(_0xb280('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xb280('0xb')]=_[_0xb280('0xc')](config['redis'],{'host':_0xb280('0xd'),'port':0x18eb});var socket=require(_0xb280('0xe'))(new Redis(config[_0xb280('0xb')]));require(_0xb280('0xf'))[_0xb280('0x10')](socket);function respondWithRpcPromise(_0xde790d,_0x36ae93,_0x586fd9){return new BPromise(function(_0x5dd4c8,_0x42c5da){return client[_0xb280('0x11')](_0xde790d,_0x586fd9)['then'](function(_0x36f5c7){logger[_0xb280('0x12')](_0xb280('0x13'),_0x36ae93,_0xb280('0x14'));logger[_0xb280('0x15')](_0xb280('0x16'),_0x36ae93,_0xb280('0x14'),JSON[_0xb280('0x17')](_0x36f5c7));if(_0x36f5c7[_0xb280('0x18')]){if(_0x36f5c7[_0xb280('0x18')][_0xb280('0x19')]===0x1f4){logger[_0xb280('0x18')](_0xb280('0x13'),_0x36ae93,_0x36f5c7[_0xb280('0x18')][_0xb280('0x1a')]);return _0x42c5da(_0x36f5c7[_0xb280('0x18')][_0xb280('0x1a')]);}logger['error'](_0xb280('0x13'),_0x36ae93,_0x36f5c7['error'][_0xb280('0x1a')]);return _0x5dd4c8(_0x36f5c7[_0xb280('0x18')]['message']);}else{logger[_0xb280('0x12')](_0xb280('0x13'),_0x36ae93,_0xb280('0x14'));_0x5dd4c8(_0x36f5c7[_0xb280('0x1b')][_0xb280('0x1a')]);}})[_0xb280('0x1c')](function(_0x7b0e4d){logger[_0xb280('0x18')](_0xb280('0x13'),_0x36ae93,_0x7b0e4d);_0x42c5da(_0x7b0e4d);});});}exports[_0xb280('0x1d')]=function(_0x2104ab){var _0x578a8b=this;return new Promise(function(_0x27c453,_0x507222){return db[_0xb280('0x1e')][_0xb280('0x1f')]({'raw':_0x2104ab[_0xb280('0x20')]?_0x2104ab[_0xb280('0x20')][_0xb280('0x21')]===undefined?!![]:![]:!![],'where':_0x2104ab[_0xb280('0x20')]?_0x2104ab[_0xb280('0x20')][_0xb280('0x22')]||null:null,'attributes':_0x2104ab['options']?_0x2104ab[_0xb280('0x20')][_0xb280('0x23')]||null:null,'limit':_0x2104ab[_0xb280('0x20')]?_0x2104ab['options']['limit']||null:null,'include':_0x2104ab[_0xb280('0x20')]?_0x2104ab['options']['include']?_['map'](_0x2104ab[_0xb280('0x20')][_0xb280('0x24')],function(_0x16de3b){return{'model':db[_0x16de3b[_0xb280('0x25')]],'as':_0x16de3b['as'],'attributes':_0x16de3b[_0xb280('0x23')],'include':_0x16de3b['include']?_[_0xb280('0x26')](_0x16de3b[_0xb280('0x24')],function(_0x12c311){return{'model':db[_0x12c311[_0xb280('0x25')]],'as':_0x12c311['as'],'attributes':_0x12c311['attributes'],'include':_0x12c311['include']?_[_0xb280('0x26')](_0x12c311[_0xb280('0x24')],function(_0x2cefe4){return{'model':db[_0x2cefe4['model']],'as':_0x2cefe4['as'],'attributes':_0x2cefe4[_0xb280('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb280('0x27')](function(_0x489f2e){logger[_0xb280('0x12')](_0xb280('0x1d'),_0x2104ab);logger[_0xb280('0x15')](_0xb280('0x1d'),_0x2104ab,JSON[_0xb280('0x17')](_0x489f2e));_0x27c453(_0x489f2e);})[_0xb280('0x1c')](function(_0x1c6002){logger[_0xb280('0x18')](_0xb280('0x1d'),_0x1c6002['message'],_0x2104ab);_0x507222(_0x578a8b[_0xb280('0x18')](0x1f4,_0x1c6002['message']));});});}; \ No newline at end of file +var _0xea1c=['result','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','stringify','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcea1('0x0'));var BPromise=require(_0xcea1('0x1'));var rs=require(_0xcea1('0x2'));var fs=require('fs');var Redis=require(_0xcea1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcea1('0x4'));var logger=require(_0xcea1('0x5'))(_0xcea1('0x6'));var config=require(_0xcea1('0x7'));var jayson=require(_0xcea1('0x8'));var client=jayson[_0xcea1('0x9')][_0xcea1('0xa')]({'port':0x232a});config[_0xcea1('0xb')]=_[_0xcea1('0xc')](config[_0xcea1('0xb')],{'host':_0xcea1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcea1('0xb')]));require(_0xcea1('0xe'))[_0xcea1('0xf')](socket);function respondWithRpcPromise(_0x4b2863,_0x4613d4,_0x1a31de){return new BPromise(function(_0x1e9298,_0x4097ed){return client[_0xcea1('0x10')](_0x4b2863,_0x1a31de)[_0xcea1('0x11')](function(_0x3eb7a9){logger[_0xcea1('0x12')](_0xcea1('0x13'),_0x4613d4,_0xcea1('0x14'));logger[_0xcea1('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4613d4,_0xcea1('0x14'),JSON['stringify'](_0x3eb7a9));if(_0x3eb7a9[_0xcea1('0x16')]){if(_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x17')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x4613d4,_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);return _0x4097ed(_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);}logger[_0xcea1('0x16')](_0xcea1('0x13'),_0x4613d4,_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);return _0x1e9298(_0x3eb7a9[_0xcea1('0x16')][_0xcea1('0x18')]);}else{logger[_0xcea1('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x4613d4,'request\x20sent');_0x1e9298(_0x3eb7a9[_0xcea1('0x19')][_0xcea1('0x18')]);}})['catch'](function(_0x5eaec4){logger[_0xcea1('0x16')](_0xcea1('0x13'),_0x4613d4,_0x5eaec4);_0x4097ed(_0x5eaec4);});});}exports[_0xcea1('0x1a')]=function(_0xf206ac){var _0x4af892=this;return new Promise(function(_0x43fd48,_0x808fd4){return db[_0xcea1('0x1b')][_0xcea1('0x1c')]({'raw':_0xf206ac[_0xcea1('0x1d')]?_0xf206ac['options'][_0xcea1('0x1e')]===undefined?!![]:![]:!![],'where':_0xf206ac[_0xcea1('0x1d')]?_0xf206ac[_0xcea1('0x1d')]['where']||null:null,'attributes':_0xf206ac['options']?_0xf206ac[_0xcea1('0x1d')][_0xcea1('0x1f')]||null:null,'limit':_0xf206ac[_0xcea1('0x1d')]?_0xf206ac[_0xcea1('0x1d')][_0xcea1('0x20')]||null:null,'include':_0xf206ac[_0xcea1('0x1d')]?_0xf206ac[_0xcea1('0x1d')][_0xcea1('0x21')]?_['map'](_0xf206ac['options']['include'],function(_0x51eccc){return{'model':db[_0x51eccc['model']],'as':_0x51eccc['as'],'attributes':_0x51eccc['attributes'],'include':_0x51eccc[_0xcea1('0x21')]?_[_0xcea1('0x22')](_0x51eccc[_0xcea1('0x21')],function(_0x23d8cb){return{'model':db[_0x23d8cb[_0xcea1('0x23')]],'as':_0x23d8cb['as'],'attributes':_0x23d8cb['attributes'],'include':_0x23d8cb[_0xcea1('0x21')]?_[_0xcea1('0x22')](_0x23d8cb[_0xcea1('0x21')],function(_0x36f9e1){return{'model':db[_0x36f9e1[_0xcea1('0x23')]],'as':_0x36f9e1['as'],'attributes':_0x36f9e1['attributes']};}):[]};}):[]};}):[]:[]})[_0xcea1('0x11')](function(_0x23d82c){logger[_0xcea1('0x12')](_0xcea1('0x1a'),_0xf206ac);logger[_0xcea1('0x15')](_0xcea1('0x1a'),_0xf206ac,JSON[_0xcea1('0x24')](_0x23d82c));_0x43fd48(_0x23d82c);})[_0xcea1('0x25')](function(_0x20f6c9){logger['error'](_0xcea1('0x1a'),_0x20f6c9[_0xcea1('0x18')],_0xf206ac);_0x808fd4(_0x4af892['error'](0x1f4,_0x20f6c9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 7b39384..15fb7b4 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 _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x2f0807,_0x382830){var _0x19feb3=function(_0x57095e){while(--_0x57095e){_0x2f0807['push'](_0x2f0807['shift']());}};_0x19feb3(++_0x382830);}(_0x53ec,0x192));var _0xc53e=function(_0x5a7cbc,_0x573d85){_0x5a7cbc=_0x5a7cbc-0x0;var _0x44d2cc=_0x53ec[_0x5a7cbc];return _0x44d2cc;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x29e85a,_0x211370){var _0x3ddbe8=function(_0x1cc430){while(--_0x1cc430){_0x29e85a['push'](_0x29e85a['shift']());}};_0x3ddbe8(++_0x211370);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f1ea8bd..3e04f26 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 _0x958a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x57dc7a,_0x4beeab){var _0x909421=function(_0x4eda67){while(--_0x4eda67){_0x57dc7a['push'](_0x57dc7a['shift']());}};_0x909421(++_0x4beeab);}(_0x958a,0x128));var _0xa958=function(_0x5a3c98,_0x119209){_0x5a3c98=_0x5a3c98-0x0;var _0x570717=_0x958a[_0x5a3c98];return _0x570717;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./voiceMail.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['get']('/:id/messages',auth[_0xa958('0x9')](),controller[_0xa958('0xd')]);router[_0xa958('0xe')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x10')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);router[_0xa958('0x12')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2272=['express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x35f748,_0x2cd546){var _0x17ae2b=function(_0xec9002){while(--_0xec9002){_0x35f748['push'](_0x35f748['shift']());}};_0x17ae2b(++_0x2cd546);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var path=require(_0x2227('0x2'));var timeout=require(_0x2227('0x3'));var express=require(_0x2227('0x4'));var router=express['Router']();var fs_extra=require(_0x2227('0x5'));var auth=require(_0x2227('0x6'));var interaction=require(_0x2227('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x2227('0x8')]('/',auth[_0x2227('0x9')](),controller[_0x2227('0xa')]);router[_0x2227('0x8')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0xc')]);router[_0x2227('0x8')](_0x2227('0xd'),auth[_0x2227('0x9')](),controller['getMessages']);router[_0x2227('0xe')]('/',auth['isAuthenticated'](),controller[_0x2227('0xf')]);router[_0x2227('0x10')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x11')]);router['delete'](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x12')]);module[_0x2227('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 7b6e84d..b2e2737 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 _0x4e4b=['STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x4e4b,0xfa));var _0xb4e4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4e4b[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xb4e4('0x0'));module[_0xb4e4('0x1')]={'customer_id':{'type':Sequelize[_0xb4e4('0x2')]},'context':{'type':Sequelize[_0xb4e4('0x2')],'defaultValue':'from-voicemail','unique':_0xb4e4('0x3')},'mailbox':{'type':Sequelize[_0xb4e4('0x2')],'defaultValue':'','allowNull':![],'unique':_0xb4e4('0x3')},'password':{'type':Sequelize[_0xb4e4('0x2')]},'fullname':{'type':Sequelize[_0xb4e4('0x2')]},'email':{'type':Sequelize[_0xb4e4('0x2')],'validate':{'isEmail':!![]},'set':function(_0x12144a){this[_0xb4e4('0x4')](_0xb4e4('0x5'),typeof _0x12144a===_0xb4e4('0x6')&&_0x12144a[_0xb4e4('0x7')]()?_0x12144a[_0xb4e4('0x7')]():null);}},'pager':{'type':Sequelize[_0xb4e4('0x2')]},'tz':{'type':Sequelize[_0xb4e4('0x2')],'defaultValue':_0xb4e4('0x8')},'attach':{'type':Sequelize[_0xb4e4('0x9')](_0xb4e4('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xb4e4('0x9')](_0xb4e4('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xb4e4('0x2')]},'callback':{'type':Sequelize[_0xb4e4('0x2')]},'review':{'type':Sequelize[_0xb4e4('0x9')](_0xb4e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xb4e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xb4e4('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xb4e4('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xb4e4('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xb4e4('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xb4e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xb4e4('0x9')](_0xb4e4('0xa'),'no'),'defaultValue':_0xb4e4('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xb4e4('0x9')](_0xb4e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xb4e4('0x9')](_0xb4e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xb4e4('0xa'),'no'),'defaultValue':_0xb4e4('0xa'),'allowNull':![]},'stamp':{'type':_0xb4e4('0xc')},'emailsubject':{'type':Sequelize[_0xb4e4('0x2')]},'emailbody':{'type':Sequelize[_0xb4e4('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xb4e4('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xb4e4('0xe')],'get':function(){return this[_0xb4e4('0xf')](_0xb4e4('0x10'))+_0xb4e4('0x11')+this['getDataValue']('mailbox');}}}; \ No newline at end of file +var _0xcc11=['sequelize','exports','from-voicemail','contest_mailbox','STRING','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x28bce5,_0x18aa44){var _0x8fcd61=function(_0x30883a){while(--_0x30883a){_0x28bce5['push'](_0x28bce5['shift']());}};_0x8fcd61(++_0x18aa44);}(_0xcc11,0xcc));var _0x1cc1=function(_0x22d398,_0x3d552a){_0x22d398=_0x22d398-0x0;var _0x18fa77=_0xcc11[_0x22d398];return _0x18fa77;};'use strict';var Sequelize=require(_0x1cc1('0x0'));module[_0x1cc1('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x1cc1('0x2'),'unique':_0x1cc1('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x1cc1('0x3')},'password':{'type':Sequelize[_0x1cc1('0x4')]},'fullname':{'type':Sequelize[_0x1cc1('0x4')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2a1085){this['setDataValue'](_0x1cc1('0x5'),typeof _0x2a1085===_0x1cc1('0x6')&&_0x2a1085[_0x1cc1('0x7')]()?_0x2a1085[_0x1cc1('0x7')]():null);}},'pager':{'type':Sequelize[_0x1cc1('0x4')]},'tz':{'type':Sequelize[_0x1cc1('0x4')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x1cc1('0x8')](_0x1cc1('0x9'),'no'),'defaultValue':_0x1cc1('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1cc1('0x8')](_0x1cc1('0x9'),'no'),'defaultValue':_0x1cc1('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1cc1('0x4')]},'callback':{'type':Sequelize[_0x1cc1('0x4')]},'review':{'type':Sequelize[_0x1cc1('0x8')](_0x1cc1('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x1cc1('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1cc1('0x8')](_0x1cc1('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1cc1('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x1cc1('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1cc1('0x8')](_0x1cc1('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x1cc1('0x9'),'no'),'defaultValue':_0x1cc1('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1cc1('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1cc1('0x8')](_0x1cc1('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x1cc1('0xb')},'emailsubject':{'type':Sequelize[_0x1cc1('0x4')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x1cc1('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1cc1('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1cc1('0xd')](_0x1cc1('0xe'))+_0x1cc1('0xf')+this['getDataValue'](_0x1cc1('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 4675b3e..389fdc6 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 _0xbaf0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','Voicemails','UserProfileResource','then','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user'];(function(_0x155708,_0x48faca){var _0x4b2644=function(_0x253ca1){while(--_0x253ca1){_0x155708['push'](_0x155708['shift']());}};_0x4b2644(++_0x48faca);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xcc;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0x1b')](_0xe4378c);}return _0x465dd7['status'](_0xe4378c)[_0x0baf('0x1c')]();};}function respondWithResult(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0xc8;return function(_0x1f50c3){if(_0x1f50c3){return _0x49e44b[_0x0baf('0x1d')](_0x1c76a8)[_0x0baf('0x1e')](_0x1f50c3);}};}function respondWithFilteredResult(_0xb8339e,_0x469599){return function(_0x4f80a8){if(_0x4f80a8){var _0x4cd79d=typeof _0x469599[_0x0baf('0x1f')]===_0x0baf('0x20')&&typeof _0x469599[_0x0baf('0x21')]===_0x0baf('0x20');var _0x2cf7da=_0x4f80a8[_0x0baf('0x22')];var _0x53c338=_0x4cd79d?0x0:_0x469599[_0x0baf('0x1f')];var _0xfbecec=_0x4cd79d?_0x4f80a8[_0x0baf('0x22')]:_0x469599[_0x0baf('0x1f')]+_0x469599[_0x0baf('0x21')];var _0x42b7f2;if(_0xfbecec>=_0x2cf7da){_0xfbecec=_0x2cf7da;_0x42b7f2=0xc8;}else{_0x42b7f2=0xce;}_0xb8339e['status'](_0x42b7f2);return _0xb8339e['set'](_0x0baf('0x23'),_0x53c338+'-'+_0xfbecec+'/'+_0x2cf7da)[_0x0baf('0x1e')](_0x4f80a8);}return null;};}function patchUpdates(_0x32e839){return function(_0x1848e8){try{jsonpatch[_0x0baf('0x24')](_0x1848e8,_0x32e839,!![]);}catch(_0x3e3e20){return BPromise[_0x0baf('0x25')](_0x3e3e20);}return _0x1848e8[_0x0baf('0x26')]();};}function saveUpdates(_0x2c42e2,_0x15a2c3){return function(_0x54f2fa){if(_0x54f2fa){return _0x54f2fa[_0x0baf('0x27')](_0x2c42e2)['then'](function(_0xf6c158){return _0xf6c158;});}return null;};}function removeEntity(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(_0x2ef0aa){return _0x2ef0aa['destroy']()['then'](function(){var _0x47c4b=_0x2ef0aa[_0x0baf('0x28')]({'plain':!![]});var _0x34e264=_0x0baf('0x29');return db[_0x0baf('0x2a')]['destroy']({'where':{'type':_0x34e264,'resourceId':_0x47c4b['id']}})[_0x0baf('0x2b')](function(){return _0x2ef0aa;});})[_0x0baf('0x2b')](function(){_0x5dbf00[_0x0baf('0x1d')](0xcc)[_0x0baf('0x1c')]();});}};}function handleEntityNotFound(_0x3843b8,_0x3b9b31){return function(_0x453525){if(!_0x453525){_0x3843b8['sendStatus'](0x194);}return _0x453525;};}function handleError(_0x1590b4,_0x393a5a){_0x393a5a=_0x393a5a||0x1f4;return function(_0xcaf13d){logger[_0x0baf('0x2c')](_0xcaf13d['stack']);if(_0xcaf13d[_0x0baf('0x2d')]){delete _0xcaf13d[_0x0baf('0x2d')];}_0x1590b4['status'](_0x393a5a)[_0x0baf('0x2e')](_0xcaf13d);};}exports[_0x0baf('0x2f')]=function(_0x478ce8,_0xb4dbb1){var _0xd14f0f={},_0x366924={},_0x213a6a={'count':0x0,'rows':[]};var _0x57476f=_[_0x0baf('0x30')](db[_0x0baf('0x31')][_0x0baf('0x32')],function(_0x3ed995){return{'name':_0x3ed995[_0x0baf('0x33')],'type':_0x3ed995[_0x0baf('0x34')][_0x0baf('0x35')]};});_0x366924[_0x0baf('0x36')]=_[_0x0baf('0x30')](_0x57476f,_0x0baf('0x2d'));_0x366924[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x478ce8[_0x0baf('0x37')]);_0x366924[_0x0baf('0x39')]=_['intersection'](_0x366924[_0x0baf('0x36')],_0x366924['query']);_0xd14f0f[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x366924[_0x0baf('0x36')],qs[_0x0baf('0x3c')](_0x478ce8['query'][_0x0baf('0x3c')]));_0xd14f0f[_0x0baf('0x3a')]=_0xd14f0f['attributes'][_0x0baf('0x3d')]?_0xd14f0f[_0x0baf('0x3a')]:_0x366924[_0x0baf('0x36')];if(!_0x478ce8[_0x0baf('0x37')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0xd14f0f[_0x0baf('0x21')]=qs[_0x0baf('0x21')](_0x478ce8['query'][_0x0baf('0x21')]);_0xd14f0f[_0x0baf('0x1f')]=qs['offset'](_0x478ce8[_0x0baf('0x37')]['offset']);}_0xd14f0f['order']=qs[_0x0baf('0x40')](_0x478ce8[_0x0baf('0x37')]['sort']);_0xd14f0f['where']=qs[_0x0baf('0x39')](_[_0x0baf('0x41')](_0x478ce8[_0x0baf('0x37')],_0x366924[_0x0baf('0x39')]),_0x57476f);if(_0x478ce8[_0x0baf('0x37')][_0x0baf('0x42')]){_0xd14f0f[_0x0baf('0x43')]=_[_0x0baf('0x44')](_0xd14f0f[_0x0baf('0x43')],{'$or':_[_0x0baf('0x30')](_0x57476f,function(_0x200864){if(_0x200864[_0x0baf('0x34')]!==_0x0baf('0x45')){var _0x229ea6={};_0x229ea6[_0x200864['name']]={'$like':'%'+_0x478ce8[_0x0baf('0x37')][_0x0baf('0x42')]+'%'};return _0x229ea6;}})});}_0xd14f0f=_['merge']({},_0xd14f0f,_0x478ce8[_0x0baf('0x46')]);var _0x324369={'where':_0xd14f0f[_0x0baf('0x43')]};return db[_0x0baf('0x31')][_0x0baf('0x22')](_0x324369)[_0x0baf('0x2b')](function(_0x57b581){_0x213a6a[_0x0baf('0x22')]=_0x57b581;if(_0x478ce8[_0x0baf('0x37')]['includeAll']){_0xd14f0f[_0x0baf('0x47')]=[{'all':!![]}];}return db[_0x0baf('0x31')][_0x0baf('0x48')](_0xd14f0f);})[_0x0baf('0x2b')](function(_0x504031){_0x213a6a[_0x0baf('0x49')]=_0x504031;return _0x213a6a;})[_0x0baf('0x2b')](respondWithFilteredResult(_0xb4dbb1,_0xd14f0f))[_0x0baf('0x4a')](handleError(_0xb4dbb1,null));};exports[_0x0baf('0x4b')]=function(_0x2b6d54,_0x385b24){var _0x33da34={'raw':!![],'where':{'id':_0x2b6d54[_0x0baf('0x4c')]['id']}},_0x1fa237={};_0x1fa237[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0x31')][_0x0baf('0x32')]);_0x1fa237[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x2b6d54[_0x0baf('0x37')]);_0x1fa237['filters']=_[_0x0baf('0x3b')](_0x1fa237[_0x0baf('0x36')],_0x1fa237[_0x0baf('0x37')]);_0x33da34[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1fa237['model'],qs[_0x0baf('0x3c')](_0x2b6d54[_0x0baf('0x37')][_0x0baf('0x3c')]));_0x33da34[_0x0baf('0x3a')]=_0x33da34[_0x0baf('0x3a')][_0x0baf('0x3d')]?_0x33da34[_0x0baf('0x3a')]:_0x1fa237['model'];if(_0x2b6d54[_0x0baf('0x37')][_0x0baf('0x4d')]){_0x33da34[_0x0baf('0x47')]=[{'all':!![]}];}_0x33da34=_['merge']({},_0x33da34,_0x2b6d54[_0x0baf('0x46')]);return db[_0x0baf('0x31')][_0x0baf('0x4e')](_0x33da34)[_0x0baf('0x2b')](handleEntityNotFound(_0x385b24,null))[_0x0baf('0x2b')](respondWithResult(_0x385b24,null))[_0x0baf('0x4a')](handleError(_0x385b24,null));};exports[_0x0baf('0x4f')]=function(_0x5a54bb,_0x22c451){return db[_0x0baf('0x31')][_0x0baf('0x4f')](_0x5a54bb[_0x0baf('0x50')],{})[_0x0baf('0x2b')](function(_0xc427b2){var _0x40d4a6=_0x5a54bb[_0x0baf('0x51')][_0x0baf('0x28')]({'plain':!![]});if(!_0x40d4a6)throw new Error(_0x0baf('0x52'));if(_0x40d4a6[_0x0baf('0x53')]==='user'){var _0x528ff6=_0xc427b2[_0x0baf('0x28')]({'plain':!![]});var _0x3d6b19=_0x0baf('0x29');return db[_0x0baf('0x54')][_0x0baf('0x4e')]({'where':{'name':_0x3d6b19,'userProfileId':_0x40d4a6[_0x0baf('0x55')]},'raw':!![]})[_0x0baf('0x2b')](function(_0x4b492c){if(_0x4b492c&&_0x4b492c[_0x0baf('0x56')]===0x0){return db[_0x0baf('0x2a')][_0x0baf('0x4f')]({'name':_0x528ff6[_0x0baf('0x2d')],'resourceId':_0x528ff6['id'],'type':_0x4b492c[_0x0baf('0x2d')],'sectionId':_0x4b492c['id']},{})[_0x0baf('0x2b')](function(){return _0xc427b2;});}else{return _0xc427b2;}})['catch'](function(_0x3eebe5){logger['error'](_0x0baf('0x57'),_0x3eebe5);throw _0x3eebe5;});}return _0xc427b2;})['then'](respondWithResult(_0x22c451,0xc9))[_0x0baf('0x4a')](handleError(_0x22c451,null));};exports['update']=function(_0x35b1a5,_0x4c035b){if(_0x35b1a5[_0x0baf('0x50')]['id']){delete _0x35b1a5[_0x0baf('0x50')]['id'];}return db[_0x0baf('0x31')][_0x0baf('0x4e')]({'where':{'id':_0x35b1a5[_0x0baf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c035b,null))[_0x0baf('0x2b')](saveUpdates(_0x35b1a5[_0x0baf('0x50')],null))[_0x0baf('0x2b')](respondWithResult(_0x4c035b,null))[_0x0baf('0x4a')](handleError(_0x4c035b,null));};exports[_0x0baf('0x58')]=function(_0xa19b21,_0x480834){return db[_0x0baf('0x31')][_0x0baf('0x4e')]({'where':{'id':_0xa19b21[_0x0baf('0x4c')]['id']}})[_0x0baf('0x2b')](handleEntityNotFound(_0x480834,null))[_0x0baf('0x2b')](removeEntity(_0x480834,null))[_0x0baf('0x4a')](handleError(_0x480834,null));};exports[_0x0baf('0x59')]=function(_0x565292,_0x48e855,_0x23f6ea){return db[_0x0baf('0x31')][_0x0baf('0x5a')]({'where':{'id':_0x565292[_0x0baf('0x4c')]['id']}})[_0x0baf('0x2b')](handleEntityNotFound(_0x48e855,null))[_0x0baf('0x2b')](function(_0xaa4293){var _0x14a667;var _0x3d9a32={},_0x585969={};_0x585969[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x5b')][_0x0baf('0x32')]);_0x585969[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x565292[_0x0baf('0x37')]);_0x585969['filters']=_[_0x0baf('0x3b')](_0x585969[_0x0baf('0x36')],_0x585969[_0x0baf('0x37')]);_0x3d9a32[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x585969[_0x0baf('0x36')],qs[_0x0baf('0x3c')](_0x565292[_0x0baf('0x37')]['fields']));_0x3d9a32[_0x0baf('0x3a')]=_0x3d9a32['attributes'][_0x0baf('0x3d')]?_0x3d9a32['attributes']:_0x585969['model'];if(!_0x565292[_0x0baf('0x37')]['hasOwnProperty'](_0x0baf('0x3f'))){_0x3d9a32[_0x0baf('0x21')]=qs['limit'](_0x565292[_0x0baf('0x37')][_0x0baf('0x21')]);_0x3d9a32[_0x0baf('0x1f')]=qs['offset'](_0x565292['query'][_0x0baf('0x1f')]);}_0x3d9a32[_0x0baf('0x5c')]=qs[_0x0baf('0x40')](_0x565292[_0x0baf('0x37')][_0x0baf('0x40')]);_0x3d9a32['where']=qs[_0x0baf('0x39')](_['pick'](_0x565292['query'],_0x585969['filters']));if(_0x565292[_0x0baf('0x37')]['filter']){_0x3d9a32['where']=_[_0x0baf('0x44')](_0x3d9a32[_0x0baf('0x43')],{'$or':_[_0x0baf('0x30')](_0x3d9a32[_0x0baf('0x3a')],function(_0x245967){var _0x27ddc7={};_0x27ddc7[_0x245967]={'$like':'%'+_0x565292['query'][_0x0baf('0x42')]+'%'};return _0x27ddc7;})});}_0x3d9a32[_0x0baf('0x43')]=_[_0x0baf('0x44')](_0x3d9a32[_0x0baf('0x43')],{'mailboxuser':_0xaa4293[_0x0baf('0x5d')]});_0x3d9a32=_[_0x0baf('0x44')]({},_0x3d9a32,_0x565292['options']);return db[_0x0baf('0x5b')][_0x0baf('0x5e')](_0x3d9a32)[_0x0baf('0x2b')](respondWithFilteredResult(_0x48e855,_0x3d9a32));})['catch'](handleError(_0x48e855,null));}; \ No newline at end of file +var _0xb574=['filter','merge','VoiceMail','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','length','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xb574,0x106));var _0x4b57=function(_0xcb39de,_0x39d4a9){_0xcb39de=_0xcb39de-0x0;var _0x4f8ef9=_0xb574[_0xcb39de];return _0x4f8ef9;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){var _0x25d190=_0x4d07c9[_0x4b57('0x25')]({'plain':!![]});var _0x540eff=_0x4b57('0x26');return db['UserProfileResource'][_0x4b57('0x24')]({'where':{'type':_0x540eff,'resourceId':_0x25d190['id']}})['then'](function(){return _0x4d07c9;});})[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x6584c4,_0x104f52){return function(_0x392e37){if(!_0x392e37){_0x6584c4['sendStatus'](0x194);}return _0x392e37;};}function handleError(_0x5c3c7a,_0x16d196){_0x16d196=_0x16d196||0x1f4;return function(_0x4c58e4){logger[_0x4b57('0x27')](_0x4c58e4[_0x4b57('0x28')]);if(_0x4c58e4[_0x4b57('0x29')]){delete _0x4c58e4[_0x4b57('0x29')];}_0x5c3c7a[_0x4b57('0x17')](_0x16d196)[_0x4b57('0x2a')](_0x4c58e4);};}exports['index']=function(_0xab365c,_0x2e9922){var _0x68be27={},_0x3cd331={},_0x4ccf89={'count':0x0,'rows':[]};var _0xa91ba=_[_0x4b57('0x2b')](db['VoiceMail'][_0x4b57('0x2c')],function(_0xa5b5dc){return{'name':_0xa5b5dc[_0x4b57('0x2d')],'type':_0xa5b5dc[_0x4b57('0x2e')]['key']};});_0x3cd331['model']=_['map'](_0xa91ba,_0x4b57('0x29'));_0x3cd331[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0xab365c[_0x4b57('0x2f')]);_0x3cd331[_0x4b57('0x31')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],_0x3cd331[_0x4b57('0x2f')]);_0x68be27[_0x4b57('0x33')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0xab365c[_0x4b57('0x2f')]['fields']));_0x68be27[_0x4b57('0x33')]=_0x68be27[_0x4b57('0x33')]['length']?_0x68be27[_0x4b57('0x33')]:_0x3cd331[_0x4b57('0x32')];if(!_0xab365c[_0x4b57('0x2f')][_0x4b57('0x35')](_0x4b57('0x36'))){_0x68be27[_0x4b57('0x1b')]=qs['limit'](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1b')]);_0x68be27[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1d')]);}_0x68be27[_0x4b57('0x37')]=qs['sort'](_0xab365c['query'][_0x4b57('0x38')]);_0x68be27[_0x4b57('0x39')]=qs[_0x4b57('0x31')](_['pick'](_0xab365c[_0x4b57('0x2f')],_0x3cd331[_0x4b57('0x31')]),_0xa91ba);if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]){_0x68be27['where']=_[_0x4b57('0x3b')](_0x68be27[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0xa91ba,function(_0x2d24ab){if(_0x2d24ab['type']!=='VIRTUAL'){var _0x5d624c={};_0x5d624c[_0x2d24ab[_0x4b57('0x29')]]={'$like':'%'+_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]+'%'};return _0x5d624c;}})});}_0x68be27=_[_0x4b57('0x3b')]({},_0x68be27,_0xab365c['options']);var _0x445353={'where':_0x68be27[_0x4b57('0x39')]};return db[_0x4b57('0x3c')][_0x4b57('0x1c')](_0x445353)[_0x4b57('0x23')](function(_0x453129){_0x4ccf89[_0x4b57('0x1c')]=_0x453129;if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3d')]){_0x68be27['include']=[{'all':!![]}];}return db[_0x4b57('0x3c')][_0x4b57('0x3e')](_0x68be27);})[_0x4b57('0x23')](function(_0x5b2f50){_0x4ccf89[_0x4b57('0x3f')]=_0x5b2f50;return _0x4ccf89;})['then'](respondWithFilteredResult(_0x2e9922,_0x68be27))[_0x4b57('0x40')](handleError(_0x2e9922,null));};exports[_0x4b57('0x41')]=function(_0x457273,_0x19ba66){var _0x189fd0={'raw':!![],'where':{'id':_0x457273[_0x4b57('0x42')]['id']}},_0x477352={};_0x477352[_0x4b57('0x32')]=_[_0x4b57('0x30')](db[_0x4b57('0x3c')][_0x4b57('0x2c')]);_0x477352[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x457273['query']);_0x477352['filters']=_[_0x4b57('0x43')](_0x477352[_0x4b57('0x32')],_0x477352[_0x4b57('0x2f')]);_0x189fd0[_0x4b57('0x33')]=_['intersection'](_0x477352[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x457273['query'][_0x4b57('0x34')]));_0x189fd0['attributes']=_0x189fd0[_0x4b57('0x33')]['length']?_0x189fd0['attributes']:_0x477352[_0x4b57('0x32')];if(_0x457273[_0x4b57('0x2f')]['includeAll']){_0x189fd0[_0x4b57('0x44')]=[{'all':!![]}];}_0x189fd0=_[_0x4b57('0x3b')]({},_0x189fd0,_0x457273[_0x4b57('0x45')]);return db[_0x4b57('0x3c')][_0x4b57('0x46')](_0x189fd0)[_0x4b57('0x23')](handleEntityNotFound(_0x19ba66,null))['then'](respondWithResult(_0x19ba66,null))[_0x4b57('0x40')](handleError(_0x19ba66,null));};exports[_0x4b57('0x47')]=function(_0x4a632c,_0xd529fb){return db[_0x4b57('0x3c')][_0x4b57('0x47')](_0x4a632c['body'],{})[_0x4b57('0x23')](function(_0x5cba5f){var _0x213dca=_0x4a632c[_0x4b57('0x48')][_0x4b57('0x25')]({'plain':!![]});if(!_0x213dca)throw new Error(_0x4b57('0x49'));if(_0x213dca[_0x4b57('0x4a')]===_0x4b57('0x48')){var _0x3d1ecd=_0x5cba5f[_0x4b57('0x25')]({'plain':!![]});var _0x5ab120=_0x4b57('0x26');return db[_0x4b57('0x4b')][_0x4b57('0x46')]({'where':{'name':_0x5ab120,'userProfileId':_0x213dca['userProfileId']},'raw':!![]})[_0x4b57('0x23')](function(_0xcf72b6){if(_0xcf72b6&&_0xcf72b6[_0x4b57('0x4c')]===0x0){return db['UserProfileResource'][_0x4b57('0x47')]({'name':_0x3d1ecd[_0x4b57('0x29')],'resourceId':_0x3d1ecd['id'],'type':_0xcf72b6[_0x4b57('0x29')],'sectionId':_0xcf72b6['id']},{})[_0x4b57('0x23')](function(){return _0x5cba5f;});}else{return _0x5cba5f;}})[_0x4b57('0x40')](function(_0xb7c37c){logger[_0x4b57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb7c37c);throw _0xb7c37c;});}return _0x5cba5f;})['then'](respondWithResult(_0xd529fb,0xc9))[_0x4b57('0x40')](handleError(_0xd529fb,null));};exports[_0x4b57('0x22')]=function(_0x3b4cbf,_0x2e64c2){if(_0x3b4cbf['body']['id']){delete _0x3b4cbf[_0x4b57('0x4d')]['id'];}return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x3b4cbf[_0x4b57('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e64c2,null))['then'](saveUpdates(_0x3b4cbf[_0x4b57('0x4d')],null))[_0x4b57('0x23')](respondWithResult(_0x2e64c2,null))['catch'](handleError(_0x2e64c2,null));};exports['destroy']=function(_0x451737,_0x5c1082){return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x451737[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x5c1082,null))[_0x4b57('0x23')](removeEntity(_0x5c1082,null))['catch'](handleError(_0x5c1082,null));};exports['getMessages']=function(_0x54ff9d,_0x4c241a,_0x179802){return db[_0x4b57('0x3c')]['findOne']({'where':{'id':_0x54ff9d[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x4c241a,null))[_0x4b57('0x23')](function(_0x9ed750){var _0x64b0fd;var _0x1fcc10={},_0xf1bf63={};_0xf1bf63[_0x4b57('0x32')]=_[_0x4b57('0x30')](db['VoiceMailMessage'][_0x4b57('0x2c')]);_0xf1bf63['query']=_[_0x4b57('0x30')](_0x54ff9d[_0x4b57('0x2f')]);_0xf1bf63['filters']=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],_0xf1bf63[_0x4b57('0x2f')]);_0x1fcc10[_0x4b57('0x33')]=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x34')]));_0x1fcc10[_0x4b57('0x33')]=_0x1fcc10[_0x4b57('0x33')][_0x4b57('0x4e')]?_0x1fcc10['attributes']:_0xf1bf63[_0x4b57('0x32')];if(!_0x54ff9d[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x36'))){_0x1fcc10['limit']=qs['limit'](_0x54ff9d['query'][_0x4b57('0x1b')]);_0x1fcc10['offset']=qs[_0x4b57('0x1d')](_0x54ff9d[_0x4b57('0x2f')]['offset']);}_0x1fcc10['order']=qs[_0x4b57('0x38')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x38')]);_0x1fcc10['where']=qs[_0x4b57('0x31')](_[_0x4b57('0x4f')](_0x54ff9d['query'],_0xf1bf63[_0x4b57('0x31')]));if(_0x54ff9d[_0x4b57('0x2f')]['filter']){_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0x1fcc10[_0x4b57('0x33')],function(_0x5d9dd5){var _0x2112d5={};_0x2112d5[_0x5d9dd5]={'$like':'%'+_0x54ff9d['query']['filter']+'%'};return _0x2112d5;})});}_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10['where'],{'mailboxuser':_0x9ed750['mailbox']});_0x1fcc10=_[_0x4b57('0x3b')]({},_0x1fcc10,_0x54ff9d[_0x4b57('0x45')]);return db['VoiceMailMessage']['findAndCountAll'](_0x1fcc10)['then'](respondWithFilteredResult(_0x4c241a,_0x1fcc10));})[_0x4b57('0x40')](handleError(_0x4c241a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 8cfe8ab..97c063f 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 _0x303f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','voice_voicemail','context','lodash'];(function(_0x12582e,_0x5bd1bd){var _0x39bf61=function(_0x21c415){while(--_0x21c415){_0x12582e['push'](_0x12582e['shift']());}};_0x39bf61(++_0x5bd1bd);}(_0x303f,0xb5));var _0xf303=function(_0x52e6ca,_0x5db711){_0x52e6ca=_0x52e6ca-0x0;var _0x195f37=_0x303f[_0x52e6ca];return _0x195f37;};'use strict';var _=require(_0xf303('0x0'));var util=require(_0xf303('0x1'));var logger=require(_0xf303('0x2'))(_0xf303('0x3'));var moment=require(_0xf303('0x4'));var BPromise=require(_0xf303('0x5'));var rp=require(_0xf303('0x6'));var fs=require('fs');var path=require(_0xf303('0x7'));var rimraf=require(_0xf303('0x8'));var config=require(_0xf303('0x9'));var attributes=require(_0xf303('0xa'));module[_0xf303('0xb')]=function(_0x1a1eb3,_0x499c93){return _0x1a1eb3['define']('VoiceMail',attributes,{'tableName':_0xf303('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xf303('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa8d8=['VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports'];(function(_0xff76a0,_0x2e0f3e){var _0x275571=function(_0x28a67f){while(--_0x28a67f){_0xff76a0['push'](_0xff76a0['shift']());}};_0x275571(++_0x2e0f3e);}(_0xa8d8,0x9e));var _0x8a8d=function(_0x29a7ac,_0x24f67c){_0x29a7ac=_0x29a7ac-0x0;var _0xb96e99=_0xa8d8[_0x29a7ac];return _0xb96e99;};'use strict';var _=require(_0x8a8d('0x0'));var util=require(_0x8a8d('0x1'));var logger=require(_0x8a8d('0x2'))(_0x8a8d('0x3'));var moment=require('moment');var BPromise=require(_0x8a8d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a8d('0x5'));var rimraf=require(_0x8a8d('0x6'));var config=require(_0x8a8d('0x7'));var attributes=require(_0x8a8d('0x8'));module[_0x8a8d('0x9')]=function(_0x3deb43,_0x97082){return _0x3deb43['define'](_0x8a8d('0xa'),attributes,{'tableName':_0x8a8d('0xb'),'paranoid':![],'indexes':[{'name':_0x8a8d('0xc'),'fields':['mailbox',_0x8a8d('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 8f51b8a..c0062d5 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 _0xf075=['stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf075,0x148));var _0x5f07=function(_0x5988e3,_0x428371){_0x5988e3=_0x5988e3-0x0;var _0x50aeb6=_0xf075[_0x5988e3];return _0x50aeb6;};'use strict';var _=require(_0x5f07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5f07('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f07('0x2'));var db=require(_0x5f07('0x3'))['db'];var utils=require(_0x5f07('0x4'));var logger=require('../../config/logger')(_0x5f07('0x5'));var config=require(_0x5f07('0x6'));var jayson=require(_0x5f07('0x7'));var client=jayson[_0x5f07('0x8')][_0x5f07('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d5f5c,_0x1dc9a4,_0x238ae7){return new BPromise(function(_0x4f8e58,_0x16c4ef){return client[_0x5f07('0xa')](_0x3d5f5c,_0x238ae7)[_0x5f07('0xb')](function(_0x406b05){logger[_0x5f07('0xc')](_0x5f07('0xd'),_0x1dc9a4,_0x5f07('0xe'));logger[_0x5f07('0xf')](_0x5f07('0x10'),_0x1dc9a4,'request\x20sent',JSON[_0x5f07('0x11')](_0x406b05));if(_0x406b05[_0x5f07('0x12')]){if(_0x406b05[_0x5f07('0x12')][_0x5f07('0x13')]===0x1f4){logger[_0x5f07('0x12')](_0x5f07('0xd'),_0x1dc9a4,_0x406b05[_0x5f07('0x12')]['message']);return _0x16c4ef(_0x406b05[_0x5f07('0x12')][_0x5f07('0x14')]);}logger[_0x5f07('0x12')]('VoiceMail,\x20%s,\x20%s',_0x1dc9a4,_0x406b05[_0x5f07('0x12')][_0x5f07('0x14')]);return _0x4f8e58(_0x406b05['error'][_0x5f07('0x14')]);}else{logger[_0x5f07('0xc')]('VoiceMail,\x20%s,\x20%s',_0x1dc9a4,_0x5f07('0xe'));_0x4f8e58(_0x406b05[_0x5f07('0x15')][_0x5f07('0x14')]);}})[_0x5f07('0x16')](function(_0x1d0c45){logger[_0x5f07('0x12')](_0x5f07('0xd'),_0x1dc9a4,_0x1d0c45);_0x16c4ef(_0x1d0c45);});});} \ No newline at end of file +var _0xe0ff=['client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe0ff,0xc9));var _0xfe0f=function(_0x37edc0,_0xf096d){_0x37edc0=_0x37edc0-0x0;var _0x1cae12=_0xe0ff[_0x37edc0];return _0x1cae12;};'use strict';var _=require('lodash');var util=require(_0xfe0f('0x0'));var moment=require('moment');var BPromise=require(_0xfe0f('0x1'));var rs=require(_0xfe0f('0x2'));var fs=require('fs');var Redis=require(_0xfe0f('0x3'));var db=require(_0xfe0f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe0f('0x5'))(_0xfe0f('0x6'));var config=require(_0xfe0f('0x7'));var jayson=require(_0xfe0f('0x8'));var client=jayson[_0xfe0f('0x9')][_0xfe0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bfebe,_0x510ee3,_0x5bf9bb){return new BPromise(function(_0x311977,_0x2be4ab){return client['request'](_0x3bfebe,_0x5bf9bb)[_0xfe0f('0xb')](function(_0x2eaf06){logger[_0xfe0f('0xc')](_0xfe0f('0xd'),_0x510ee3,_0xfe0f('0xe'));logger[_0xfe0f('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x510ee3,_0xfe0f('0xe'),JSON[_0xfe0f('0x10')](_0x2eaf06));if(_0x2eaf06[_0xfe0f('0x11')]){if(_0x2eaf06['error']['code']===0x1f4){logger[_0xfe0f('0x11')]('VoiceMail,\x20%s,\x20%s',_0x510ee3,_0x2eaf06[_0xfe0f('0x11')][_0xfe0f('0x12')]);return _0x2be4ab(_0x2eaf06[_0xfe0f('0x11')][_0xfe0f('0x12')]);}logger['error'](_0xfe0f('0xd'),_0x510ee3,_0x2eaf06[_0xfe0f('0x11')]['message']);return _0x311977(_0x2eaf06[_0xfe0f('0x11')][_0xfe0f('0x12')]);}else{logger[_0xfe0f('0xc')](_0xfe0f('0xd'),_0x510ee3,_0xfe0f('0xe'));_0x311977(_0x2eaf06[_0xfe0f('0x13')]['message']);}})[_0xfe0f('0x14')](function(_0x453a66){logger[_0xfe0f('0x11')](_0xfe0f('0xd'),_0x510ee3,_0x453a66);_0x2be4ab(_0x453a66);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2fcd3af..64bc3f4 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 _0xe69d=['express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe69d,0x150));var _0xde69=function(_0x49329c,_0x4529f5){_0x49329c=_0x49329c-0x0;var _0x826f33=_0xe69d[_0x49329c];return _0x826f33;};'use strict';var multer=require(_0xde69('0x0'));var util=require(_0xde69('0x1'));var path=require(_0xde69('0x2'));var timeout=require(_0xde69('0x3'));var express=require(_0xde69('0x4'));var router=express[_0xde69('0x5')]();var fs_extra=require(_0xde69('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde69('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xde69('0x8')]('/',auth[_0xde69('0x9')](),controller[_0xde69('0xa')]);router[_0xde69('0x8')](_0xde69('0xb'),auth[_0xde69('0x9')](),controller[_0xde69('0xc')]);router[_0xde69('0x8')]('/:id/download',auth[_0xde69('0x9')](),controller[_0xde69('0xd')]);router['post']('/',auth[_0xde69('0x9')](),controller[_0xde69('0xe')]);router[_0xde69('0xf')]('/:id',auth[_0xde69('0x9')](),controller[_0xde69('0x10')]);router[_0xde69('0x11')](_0xde69('0xb'),auth[_0xde69('0x9')](),controller[_0xde69('0x12')]);module[_0xde69('0x13')]=router; \ No newline at end of file +var _0x1570=['put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post'];(function(_0x3414da,_0x391790){var _0x3a4819=function(_0x400991){while(--_0x400991){_0x3414da['push'](_0x3414da['shift']());}};_0x3a4819(++_0x391790);}(_0x1570,0x1df));var _0x0157=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x1570[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require(_0x0157('0x0'));var util=require('util');var path=require(_0x0157('0x1'));var timeout=require('connect-timeout');var express=require(_0x0157('0x2'));var router=express[_0x0157('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0157('0x4'));var interaction=require(_0x0157('0x5'));var config=require(_0x0157('0x6'));var controller=require(_0x0157('0x7'));router[_0x0157('0x8')]('/',auth[_0x0157('0x9')](),controller['index']);router['get'](_0x0157('0xa'),auth[_0x0157('0x9')](),controller[_0x0157('0xb')]);router[_0x0157('0x8')](_0x0157('0xc'),auth['isAuthenticated'](),controller[_0x0157('0xd')]);router[_0x0157('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0157('0xf')]('/:id',auth[_0x0157('0x9')](),controller[_0x0157('0x10')]);router['delete'](_0x0157('0xa'),auth['isAuthenticated'](),controller[_0x0157('0x11')]);module[_0x0157('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 0b7a2fc..82c7558 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 _0xaae5=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','literal'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0xaae5,0x106));var _0x5aae=function(_0x51e599,_0x7471c3){_0x51e599=_0x51e599-0x0;var _0xe44680=_0xaae5[_0x51e599];return _0xe44680;};'use strict';var Sequelize=require(_0x5aae('0x0'));module[_0x5aae('0x1')]={'name':{'type':Sequelize[_0x5aae('0x2')],'get':function(_0x26c772){return this[_0x5aae('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x5aae('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x5aae('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5aae('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x5aae('0x7')](_0x5aae('0x8'))}}; \ No newline at end of file +var _0xda46=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xda46,0x113));var _0x6da4=function(_0x57b3ae,_0xd9ae56){_0x57b3ae=_0x57b3ae-0x0;var _0x3be583=_0xda46[_0x57b3ae];return _0x3be583;};'use strict';var Sequelize=require('sequelize');module[_0x6da4('0x0')]={'name':{'type':Sequelize[_0x6da4('0x1')],'get':function(_0x35f008){return this[_0x6da4('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x6da4('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6da4('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x6da4('0x5')](_0x6da4('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a0a71d4..ae2334b 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 _0xa836=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','set','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','update','then','end','error','stack','name','send','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa836,0x171));var _0x6a83=function(_0x13dfc4,_0x274ea6){_0x13dfc4=_0x13dfc4-0x0;var _0x19b2d3=_0xa836[_0x13dfc4];return _0x19b2d3;};'use strict';var emlformat=require(_0x6a83('0x0'));var rimraf=require(_0x6a83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6a83('0x2'));var moment=require('moment');var BPromise=require(_0x6a83('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6a83('0x4'));var sox=require(_0x6a83('0x5'));var csv=require(_0x6a83('0x6'));var ejs=require(_0x6a83('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a83('0x8'));var squel=require(_0x6a83('0x9'));var crypto=require('crypto');var jsforce=require(_0x6a83('0xa'));var deskjs=require(_0x6a83('0xb'));var toCsv=require(_0x6a83('0x6'));var querystring=require(_0x6a83('0xc'));var Papa=require(_0x6a83('0xd'));var Redis=require('ioredis');var authService=require(_0x6a83('0xe'));var qs=require(_0x6a83('0xf'));var as=require(_0x6a83('0x10'));var hardwareService=require(_0x6a83('0x11'));var logger=require('../../config/logger')(_0x6a83('0x12'));var utils=require(_0x6a83('0x13'));var config=require(_0x6a83('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a83('0x15'))['db'];function respondWithStatusCode(_0xbb9d71,_0x23fe72){_0x23fe72=_0x23fe72||0xcc;return function(_0x9b3716){if(_0x9b3716){return _0xbb9d71[_0x6a83('0x16')](_0x23fe72);}return _0xbb9d71[_0x6a83('0x17')](_0x23fe72)['end']();};}function respondWithResult(_0x435345,_0x54de8f){_0x54de8f=_0x54de8f||0xc8;return function(_0x5867a8){if(_0x5867a8){return _0x435345['status'](_0x54de8f)[_0x6a83('0x18')](_0x5867a8);}};}function respondWithFilteredResult(_0x16b137,_0x529c2b){return function(_0x9d6e13){if(_0x9d6e13){var _0x2d74f0=typeof _0x529c2b[_0x6a83('0x19')]==='undefined'&&typeof _0x529c2b['limit']===_0x6a83('0x1a');var _0x553d0=_0x9d6e13['count'];var _0x3161fd=_0x2d74f0?0x0:_0x529c2b[_0x6a83('0x19')];var _0x3c78bd=_0x2d74f0?_0x9d6e13[_0x6a83('0x1b')]:_0x529c2b[_0x6a83('0x19')]+_0x529c2b[_0x6a83('0x1c')];var _0x3c78eb;if(_0x3c78bd>=_0x553d0){_0x3c78bd=_0x553d0;_0x3c78eb=0xc8;}else{_0x3c78eb=0xce;}_0x16b137[_0x6a83('0x17')](_0x3c78eb);return _0x16b137['set']('Content-Range',_0x3161fd+'-'+_0x3c78bd+'/'+_0x553d0)[_0x6a83('0x18')](_0x9d6e13);}return null;};}function patchUpdates(_0x2d4a82){return function(_0x28df53){try{jsonpatch[_0x6a83('0x1d')](_0x28df53,_0x2d4a82,!![]);}catch(_0x568060){return BPromise[_0x6a83('0x1e')](_0x568060);}return _0x28df53[_0x6a83('0x1f')]();};}function saveUpdates(_0x431651,_0x158b08){return function(_0x2a0fa9){if(_0x2a0fa9){return _0x2a0fa9[_0x6a83('0x20')](_0x431651)[_0x6a83('0x21')](function(_0x25a13b){return _0x25a13b;});}return null;};}function removeEntity(_0x2ca3a7,_0x4849bf){return function(_0x4aa54d){if(_0x4aa54d){return _0x4aa54d['destroy']()[_0x6a83('0x21')](function(){_0x2ca3a7[_0x6a83('0x17')](0xcc)[_0x6a83('0x22')]();});}};}function handleEntityNotFound(_0x1bc4a4,_0x5baae7){return function(_0x2c3411){if(!_0x2c3411){_0x1bc4a4[_0x6a83('0x16')](0x194);}return _0x2c3411;};}function handleError(_0x5ce0da,_0x5b6ec0){_0x5b6ec0=_0x5b6ec0||0x1f4;return function(_0xa726b2){logger[_0x6a83('0x23')](_0xa726b2[_0x6a83('0x24')]);if(_0xa726b2['name']){delete _0xa726b2[_0x6a83('0x25')];}_0x5ce0da[_0x6a83('0x17')](_0x5b6ec0)[_0x6a83('0x26')](_0xa726b2);};}exports['index']=function(_0x5743e6,_0x239903){var _0x377909={},_0x41b108={},_0x4996c2={'count':0x0,'rows':[]};var _0x30b4c2=_[_0x6a83('0x27')](db[_0x6a83('0x28')][_0x6a83('0x29')],function(_0xb243b9){return{'name':_0xb243b9['fieldName'],'type':_0xb243b9[_0x6a83('0x2a')][_0x6a83('0x2b')]};});_0x41b108[_0x6a83('0x2c')]=_[_0x6a83('0x2d')](_[_0x6a83('0x27')](_0x30b4c2,_0x6a83('0x25')),[_0x6a83('0x25')]);_0x41b108[_0x6a83('0x2e')]=_[_0x6a83('0x2f')](_0x5743e6['query']);_0x41b108[_0x6a83('0x30')]=_[_0x6a83('0x31')](_0x41b108[_0x6a83('0x2c')],_0x41b108[_0x6a83('0x2e')]);_0x377909[_0x6a83('0x32')]=_['intersection'](_0x41b108[_0x6a83('0x2c')],qs[_0x6a83('0x33')](_0x5743e6[_0x6a83('0x2e')][_0x6a83('0x33')]));_0x377909[_0x6a83('0x32')]=_0x377909['attributes']['length']?_0x377909[_0x6a83('0x32')]:_0x41b108[_0x6a83('0x2c')];if(!_0x5743e6[_0x6a83('0x2e')][_0x6a83('0x34')](_0x6a83('0x35'))){_0x377909[_0x6a83('0x1c')]=qs[_0x6a83('0x1c')](_0x5743e6['query'][_0x6a83('0x1c')]);_0x377909[_0x6a83('0x19')]=qs['offset'](_0x5743e6['query'][_0x6a83('0x19')]);}_0x377909[_0x6a83('0x36')]=qs[_0x6a83('0x37')](_0x5743e6[_0x6a83('0x2e')][_0x6a83('0x37')]);_0x377909[_0x6a83('0x38')]=qs[_0x6a83('0x30')](_['pick'](_0x5743e6[_0x6a83('0x2e')],_0x41b108[_0x6a83('0x30')]),_0x30b4c2);if(_0x5743e6['query'][_0x6a83('0x39')]){_0x377909[_0x6a83('0x38')]=_['merge'](_0x377909[_0x6a83('0x38')],{'$or':_[_0x6a83('0x27')](_0x30b4c2,function(_0x482be8){if(_0x482be8[_0x6a83('0x2a')]!==_0x6a83('0x3a')){var _0x2e5a25={};_0x2e5a25[_0x482be8[_0x6a83('0x25')]]={'$like':'%'+_0x5743e6[_0x6a83('0x2e')][_0x6a83('0x39')]+'%'};return _0x2e5a25;}})});}_0x377909=_[_0x6a83('0x3b')]({},_0x377909,_0x5743e6['options']);var _0x404e9b={'where':_0x377909[_0x6a83('0x38')]};return db['VoiceMailMessage'][_0x6a83('0x1b')](_0x404e9b)[_0x6a83('0x21')](function(_0x1b4d59){_0x4996c2[_0x6a83('0x1b')]=_0x1b4d59;if(_0x5743e6[_0x6a83('0x2e')][_0x6a83('0x3c')]){_0x377909['include']=[{'all':!![]}];}return db[_0x6a83('0x28')][_0x6a83('0x3d')](_0x377909);})['then'](function(_0x3b4f42){_0x4996c2[_0x6a83('0x3e')]=_0x3b4f42;return _0x4996c2;})[_0x6a83('0x21')](respondWithFilteredResult(_0x239903,_0x377909))[_0x6a83('0x3f')](handleError(_0x239903,null));};exports[_0x6a83('0x40')]=function(_0x4deaad,_0x3f3fc2){var _0x148ad2={'raw':!![],'where':{'id':_0x4deaad[_0x6a83('0x41')]['id']}},_0x271738={};_0x271738['model']=_[_0x6a83('0x2f')](db[_0x6a83('0x28')][_0x6a83('0x29')]);_0x271738[_0x6a83('0x2e')]=_[_0x6a83('0x2f')](_0x4deaad['query']);_0x271738[_0x6a83('0x30')]=_[_0x6a83('0x31')](_0x271738[_0x6a83('0x2c')],_0x271738[_0x6a83('0x2e')]);_0x148ad2['attributes']=_[_0x6a83('0x31')](_0x271738[_0x6a83('0x2c')],qs[_0x6a83('0x33')](_0x4deaad['query']['fields']));_0x148ad2[_0x6a83('0x32')]=_0x148ad2[_0x6a83('0x32')][_0x6a83('0x42')]?_0x148ad2[_0x6a83('0x32')]:_0x271738[_0x6a83('0x2c')];if(_0x4deaad[_0x6a83('0x2e')][_0x6a83('0x3c')]){_0x148ad2[_0x6a83('0x43')]=[{'all':!![]}];}_0x148ad2=_[_0x6a83('0x3b')]({},_0x148ad2,_0x4deaad['options']);return db[_0x6a83('0x28')][_0x6a83('0x44')](_0x148ad2)[_0x6a83('0x21')](handleEntityNotFound(_0x3f3fc2,null))[_0x6a83('0x21')](respondWithResult(_0x3f3fc2,null))[_0x6a83('0x3f')](handleError(_0x3f3fc2,null));};exports[_0x6a83('0x45')]=function(_0xcf5195,_0x45db3d){return db[_0x6a83('0x28')][_0x6a83('0x45')](_0xcf5195[_0x6a83('0x46')],{})[_0x6a83('0x21')](respondWithResult(_0x45db3d,0xc9))[_0x6a83('0x3f')](handleError(_0x45db3d,null));};exports['update']=function(_0x2a19f9,_0x52d986){if(_0x2a19f9[_0x6a83('0x46')]['id']){delete _0x2a19f9['body']['id'];}return db['VoiceMailMessage'][_0x6a83('0x44')]({'where':{'id':_0x2a19f9[_0x6a83('0x41')]['id']}})['then'](handleEntityNotFound(_0x52d986,null))['then'](saveUpdates(_0x2a19f9[_0x6a83('0x46')],null))[_0x6a83('0x21')](respondWithResult(_0x52d986,null))[_0x6a83('0x3f')](handleError(_0x52d986,null));};exports[_0x6a83('0x47')]=function(_0x5c39e4,_0xc07c99){return db[_0x6a83('0x28')][_0x6a83('0x44')]({'where':{'id':_0x5c39e4['params']['id']}})[_0x6a83('0x21')](handleEntityNotFound(_0xc07c99,null))['then'](removeEntity(_0xc07c99,null))[_0x6a83('0x3f')](handleError(_0xc07c99,null));};exports[_0x6a83('0x48')]=function(_0x11c725,_0x43fab6,_0x17b6d8){return db[_0x6a83('0x28')][_0x6a83('0x44')]({'where':{'id':_0x11c725[_0x6a83('0x41')]['id']},'attributes':['id',_0x6a83('0x49'),'msg_id']})[_0x6a83('0x21')](handleEntityNotFound(_0x43fab6,null))['then'](function(_0x14d535){if(_0x14d535){if(!_0x14d535[_0x6a83('0x49')]){throw new db[(_0x6a83('0x4a'))][(_0x6a83('0x4b'))](_0x6a83('0x4c'));}var _0x2a8154={'Content-Type':_0x6a83('0x4d'),'Content-Disposition':_0x6a83('0x4e')};if(_0x14d535[_0x6a83('0x4f')]){_0x2a8154[_0x6a83('0x50')]='attachment;\x20filename=\x22'+_0x14d535[_0x6a83('0x4f')]+_0x6a83('0x51');}_0x43fab6[_0x6a83('0x52')](_0x2a8154);return _0x43fab6[_0x6a83('0x26')](new Buffer(_0x14d535['recording']));}})[_0x6a83('0x3f')](handleError(_0x43fab6,null));}; \ No newline at end of file +var _0xe6f6=['../../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','destroy','then','error','name','send','fieldName','type','key','model','differenceBy','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','VoiceMailMessage','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','download','recording','ValidationError','audio/wav','msg_id','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2f349d,_0x41bded){var _0x3bcae2=function(_0x32153f){while(--_0x32153f){_0x2f349d['push'](_0x2f349d['shift']());}};_0x3bcae2(++_0x41bded);}(_0xe6f6,0xf0));var _0x6e6f=function(_0x22f27b,_0x3919ea){_0x22f27b=_0x22f27b-0x0;var _0x346916=_0xe6f6[_0x22f27b];return _0x346916;};'use strict';var emlformat=require(_0x6e6f('0x0'));var rimraf=require(_0x6e6f('0x1'));var zipdir=require(_0x6e6f('0x2'));var jsonpatch=require(_0x6e6f('0x3'));var rp=require(_0x6e6f('0x4'));var moment=require(_0x6e6f('0x5'));var BPromise=require(_0x6e6f('0x6'));var Mustache=require(_0x6e6f('0x7'));var util=require(_0x6e6f('0x8'));var path=require(_0x6e6f('0x9'));var sox=require(_0x6e6f('0xa'));var csv=require(_0x6e6f('0xb'));var ejs=require(_0x6e6f('0xc'));var fs=require('fs');var fs_extra=require(_0x6e6f('0xd'));var _=require(_0x6e6f('0xe'));var squel=require(_0x6e6f('0xf'));var crypto=require(_0x6e6f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x6e6f('0x11'));var toCsv=require(_0x6e6f('0xb'));var querystring=require('querystring');var Papa=require(_0x6e6f('0x12'));var Redis=require(_0x6e6f('0x13'));var authService=require(_0x6e6f('0x14'));var qs=require(_0x6e6f('0x15'));var as=require(_0x6e6f('0x16'));var hardwareService=require(_0x6e6f('0x17'));var logger=require(_0x6e6f('0x18'))(_0x6e6f('0x19'));var utils=require(_0x6e6f('0x1a'));var config=require(_0x6e6f('0x1b'));var licenseUtil=require(_0x6e6f('0x1c'));var db=require(_0x6e6f('0x1d'))['db'];function respondWithStatusCode(_0x499199,_0x2f0c99){_0x2f0c99=_0x2f0c99||0xcc;return function(_0x21b272){if(_0x21b272){return _0x499199[_0x6e6f('0x1e')](_0x2f0c99);}return _0x499199[_0x6e6f('0x1f')](_0x2f0c99)[_0x6e6f('0x20')]();};}function respondWithResult(_0x4421f5,_0x40bc2b){_0x40bc2b=_0x40bc2b||0xc8;return function(_0x306eaa){if(_0x306eaa){return _0x4421f5[_0x6e6f('0x1f')](_0x40bc2b)[_0x6e6f('0x21')](_0x306eaa);}};}function respondWithFilteredResult(_0x2da493,_0xc4626b){return function(_0x2cee8f){if(_0x2cee8f){var _0x78ff9f=typeof _0xc4626b[_0x6e6f('0x22')]===_0x6e6f('0x23')&&typeof _0xc4626b[_0x6e6f('0x24')]===_0x6e6f('0x23');var _0x10293d=_0x2cee8f[_0x6e6f('0x25')];var _0x444d12=_0x78ff9f?0x0:_0xc4626b[_0x6e6f('0x22')];var _0x4f0cd5=_0x78ff9f?_0x2cee8f[_0x6e6f('0x25')]:_0xc4626b[_0x6e6f('0x22')]+_0xc4626b[_0x6e6f('0x24')];var _0x595ccb;if(_0x4f0cd5>=_0x10293d){_0x4f0cd5=_0x10293d;_0x595ccb=0xc8;}else{_0x595ccb=0xce;}_0x2da493[_0x6e6f('0x1f')](_0x595ccb);return _0x2da493[_0x6e6f('0x26')](_0x6e6f('0x27'),_0x444d12+'-'+_0x4f0cd5+'/'+_0x10293d)[_0x6e6f('0x21')](_0x2cee8f);}return null;};}function patchUpdates(_0x1f7672){return function(_0x138104){try{jsonpatch[_0x6e6f('0x28')](_0x138104,_0x1f7672,!![]);}catch(_0x5cf518){return BPromise[_0x6e6f('0x29')](_0x5cf518);}return _0x138104['save']();};}function saveUpdates(_0x31a2a2,_0x3c9f78){return function(_0x2ce02f){if(_0x2ce02f){return _0x2ce02f[_0x6e6f('0x2a')](_0x31a2a2)['then'](function(_0x20f4ef){return _0x20f4ef;});}return null;};}function removeEntity(_0x7c7cd5,_0x4ef38c){return function(_0x137c6e){if(_0x137c6e){return _0x137c6e[_0x6e6f('0x2b')]()[_0x6e6f('0x2c')](function(){_0x7c7cd5['status'](0xcc)[_0x6e6f('0x20')]();});}};}function handleEntityNotFound(_0x45ec4e,_0x34f4cd){return function(_0x5a52a7){if(!_0x5a52a7){_0x45ec4e['sendStatus'](0x194);}return _0x5a52a7;};}function handleError(_0x4e5de7,_0x17b9a0){_0x17b9a0=_0x17b9a0||0x1f4;return function(_0x2d75f3){logger[_0x6e6f('0x2d')](_0x2d75f3['stack']);if(_0x2d75f3[_0x6e6f('0x2e')]){delete _0x2d75f3[_0x6e6f('0x2e')];}_0x4e5de7[_0x6e6f('0x1f')](_0x17b9a0)[_0x6e6f('0x2f')](_0x2d75f3);};}exports['index']=function(_0x32ff8d,_0x2dabb0){var _0x52c430={},_0x5f3e61={},_0x35284e={'count':0x0,'rows':[]};var _0x5b3103=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x1fef25){return{'name':_0x1fef25[_0x6e6f('0x30')],'type':_0x1fef25[_0x6e6f('0x31')][_0x6e6f('0x32')]};});_0x5f3e61[_0x6e6f('0x33')]=_[_0x6e6f('0x34')](_[_0x6e6f('0x35')](_0x5b3103,_0x6e6f('0x2e')),[_0x6e6f('0x2e')]);_0x5f3e61[_0x6e6f('0x36')]=_['keys'](_0x32ff8d[_0x6e6f('0x36')]);_0x5f3e61[_0x6e6f('0x37')]=_['intersection'](_0x5f3e61[_0x6e6f('0x33')],_0x5f3e61[_0x6e6f('0x36')]);_0x52c430[_0x6e6f('0x38')]=_[_0x6e6f('0x39')](_0x5f3e61['model'],qs['fields'](_0x32ff8d['query'][_0x6e6f('0x3a')]));_0x52c430['attributes']=_0x52c430['attributes'][_0x6e6f('0x3b')]?_0x52c430['attributes']:_0x5f3e61['model'];if(!_0x32ff8d['query'][_0x6e6f('0x3c')](_0x6e6f('0x3d'))){_0x52c430[_0x6e6f('0x24')]=qs[_0x6e6f('0x24')](_0x32ff8d['query'][_0x6e6f('0x24')]);_0x52c430[_0x6e6f('0x22')]=qs[_0x6e6f('0x22')](_0x32ff8d[_0x6e6f('0x36')][_0x6e6f('0x22')]);}_0x52c430['order']=qs[_0x6e6f('0x3e')](_0x32ff8d[_0x6e6f('0x36')][_0x6e6f('0x3e')]);_0x52c430[_0x6e6f('0x3f')]=qs[_0x6e6f('0x37')](_[_0x6e6f('0x40')](_0x32ff8d[_0x6e6f('0x36')],_0x5f3e61[_0x6e6f('0x37')]),_0x5b3103);if(_0x32ff8d[_0x6e6f('0x36')][_0x6e6f('0x41')]){_0x52c430[_0x6e6f('0x3f')]=_['merge'](_0x52c430[_0x6e6f('0x3f')],{'$or':_[_0x6e6f('0x35')](_0x5b3103,function(_0x37eccd){if(_0x37eccd['type']!==_0x6e6f('0x42')){var _0x469e73={};_0x469e73[_0x37eccd[_0x6e6f('0x2e')]]={'$like':'%'+_0x32ff8d['query']['filter']+'%'};return _0x469e73;}})});}_0x52c430=_[_0x6e6f('0x43')]({},_0x52c430,_0x32ff8d[_0x6e6f('0x44')]);var _0x2461dd={'where':_0x52c430[_0x6e6f('0x3f')]};return db[_0x6e6f('0x45')][_0x6e6f('0x25')](_0x2461dd)[_0x6e6f('0x2c')](function(_0x228a67){_0x35284e[_0x6e6f('0x25')]=_0x228a67;if(_0x32ff8d[_0x6e6f('0x36')]['includeAll']){_0x52c430[_0x6e6f('0x46')]=[{'all':!![]}];}return db[_0x6e6f('0x45')][_0x6e6f('0x47')](_0x52c430);})['then'](function(_0x12d51e){_0x35284e[_0x6e6f('0x48')]=_0x12d51e;return _0x35284e;})['then'](respondWithFilteredResult(_0x2dabb0,_0x52c430))[_0x6e6f('0x49')](handleError(_0x2dabb0,null));};exports[_0x6e6f('0x4a')]=function(_0x5f15da,_0x5e8cc0){var _0x49f042={'raw':!![],'where':{'id':_0x5f15da['params']['id']}},_0x3e856e={};_0x3e856e[_0x6e6f('0x33')]=_[_0x6e6f('0x4b')](db[_0x6e6f('0x45')]['rawAttributes']);_0x3e856e[_0x6e6f('0x36')]=_['keys'](_0x5f15da[_0x6e6f('0x36')]);_0x3e856e[_0x6e6f('0x37')]=_[_0x6e6f('0x39')](_0x3e856e['model'],_0x3e856e[_0x6e6f('0x36')]);_0x49f042[_0x6e6f('0x38')]=_[_0x6e6f('0x39')](_0x3e856e['model'],qs[_0x6e6f('0x3a')](_0x5f15da['query'][_0x6e6f('0x3a')]));_0x49f042[_0x6e6f('0x38')]=_0x49f042[_0x6e6f('0x38')][_0x6e6f('0x3b')]?_0x49f042[_0x6e6f('0x38')]:_0x3e856e[_0x6e6f('0x33')];if(_0x5f15da[_0x6e6f('0x36')][_0x6e6f('0x4c')]){_0x49f042[_0x6e6f('0x46')]=[{'all':!![]}];}_0x49f042=_[_0x6e6f('0x43')]({},_0x49f042,_0x5f15da[_0x6e6f('0x44')]);return db[_0x6e6f('0x45')][_0x6e6f('0x4d')](_0x49f042)[_0x6e6f('0x2c')](handleEntityNotFound(_0x5e8cc0,null))[_0x6e6f('0x2c')](respondWithResult(_0x5e8cc0,null))[_0x6e6f('0x49')](handleError(_0x5e8cc0,null));};exports[_0x6e6f('0x4e')]=function(_0x473f2d,_0x3f59cd){return db[_0x6e6f('0x45')][_0x6e6f('0x4e')](_0x473f2d[_0x6e6f('0x4f')],{})['then'](respondWithResult(_0x3f59cd,0xc9))['catch'](handleError(_0x3f59cd,null));};exports[_0x6e6f('0x2a')]=function(_0x22a569,_0x4a8c06){if(_0x22a569[_0x6e6f('0x4f')]['id']){delete _0x22a569[_0x6e6f('0x4f')]['id'];}return db['VoiceMailMessage'][_0x6e6f('0x4d')]({'where':{'id':_0x22a569[_0x6e6f('0x50')]['id']}})[_0x6e6f('0x2c')](handleEntityNotFound(_0x4a8c06,null))[_0x6e6f('0x2c')](saveUpdates(_0x22a569[_0x6e6f('0x4f')],null))[_0x6e6f('0x2c')](respondWithResult(_0x4a8c06,null))[_0x6e6f('0x49')](handleError(_0x4a8c06,null));};exports['destroy']=function(_0x1e7b9d,_0x475c31){return db[_0x6e6f('0x45')][_0x6e6f('0x4d')]({'where':{'id':_0x1e7b9d[_0x6e6f('0x50')]['id']}})[_0x6e6f('0x2c')](handleEntityNotFound(_0x475c31,null))['then'](removeEntity(_0x475c31,null))[_0x6e6f('0x49')](handleError(_0x475c31,null));};exports[_0x6e6f('0x51')]=function(_0x35f2c8,_0x30a0cb,_0xc96ecc){return db[_0x6e6f('0x45')][_0x6e6f('0x4d')]({'where':{'id':_0x35f2c8[_0x6e6f('0x50')]['id']},'attributes':['id',_0x6e6f('0x52'),'msg_id']})[_0x6e6f('0x2c')](handleEntityNotFound(_0x30a0cb,null))[_0x6e6f('0x2c')](function(_0x237b61){if(_0x237b61){if(!_0x237b61[_0x6e6f('0x52')]){throw new db['Sequelize'][(_0x6e6f('0x53'))]('VoiceMailMessage\x20not\x20found');}var _0xdc7e65={'Content-Type':_0x6e6f('0x54'),'Content-Disposition':'attachment'};if(_0x237b61[_0x6e6f('0x55')]){_0xdc7e65['Content-Disposition']=_0x6e6f('0x56')+_0x237b61[_0x6e6f('0x55')]+_0x6e6f('0x57');}_0x30a0cb[_0x6e6f('0x26')](_0xdc7e65);return _0x30a0cb[_0x6e6f('0x2f')](new Buffer(_0x237b61['recording']));}})[_0x6e6f('0x49')](handleError(_0x30a0cb,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2a25c09..8c9b731 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 _0xd51a=['../../config/environment','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x460e9f,_0x31d36c){var _0x8bb388=function(_0x4bb081){while(--_0x4bb081){_0x460e9f['push'](_0x460e9f['shift']());}};_0x8bb388(++_0x31d36c);}(_0xd51a,0x1c1));var _0xad51=function(_0x3528ad,_0x6256a5){_0x3528ad=_0x3528ad-0x0;var _0x66df4f=_0xd51a[_0x3528ad];return _0x66df4f;};'use strict';var _=require(_0xad51('0x0'));var util=require(_0xad51('0x1'));var logger=require(_0xad51('0x2'))(_0xad51('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad51('0x4'));var fs=require('fs');var path=require(_0xad51('0x5'));var rimraf=require(_0xad51('0x6'));var config=require(_0xad51('0x7'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x3fbb0a,_0x29637e){return _0x3fbb0a[_0xad51('0x8')](_0xad51('0x9'),attributes,{'tableName':_0xad51('0xa'),'paranoid':![],'indexes':[{'name':_0xad51('0xb'),'fields':[_0xad51('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xbf81=['api','moment','request-promise','../../config/environment','exports','define','VoiceMailMessage','dir','lodash'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xbf81,0x1d3));var _0x1bf8=function(_0x3464e0,_0x1b8e8a){_0x3464e0=_0x3464e0-0x0;var _0x266ab2=_0xbf81[_0x3464e0];return _0x266ab2;};'use strict';var _=require(_0x1bf8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1bf8('0x1'));var moment=require(_0x1bf8('0x2'));var BPromise=require('bluebird');var rp=require(_0x1bf8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1bf8('0x4'));var attributes=require('./voiceMailMessage.attributes');module[_0x1bf8('0x5')]=function(_0x1747f8,_0x574df0){return _0x1747f8[_0x1bf8('0x6')](_0x1bf8('0x7'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x1bf8('0x8'),'fields':[_0x1bf8('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 6f9b28b..c1f3fb3 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 _0x286c=['debug','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x286c,0x12b));var _0xc286=function(_0x415797,_0xb52692){_0x415797=_0x415797-0x0;var _0x2d0a8c=_0x286c[_0x415797];return _0x2d0a8c;};'use strict';var _=require(_0xc286('0x0'));var util=require(_0xc286('0x1'));var moment=require(_0xc286('0x2'));var BPromise=require(_0xc286('0x3'));var rs=require(_0xc286('0x4'));var fs=require('fs');var Redis=require(_0xc286('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc286('0x6'));var logger=require('../../config/logger')(_0xc286('0x7'));var config=require(_0xc286('0x8'));var jayson=require(_0xc286('0x9'));var client=jayson[_0xc286('0xa')][_0xc286('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x178b59,_0x1d0da9,_0x29c035){return new BPromise(function(_0x37752f,_0x142fcf){return client[_0xc286('0xc')](_0x178b59,_0x29c035)[_0xc286('0xd')](function(_0x96c915){logger[_0xc286('0xe')](_0xc286('0xf'),_0x1d0da9,'request\x20sent');logger[_0xc286('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1d0da9,_0xc286('0x11'),JSON['stringify'](_0x96c915));if(_0x96c915[_0xc286('0x12')]){if(_0x96c915[_0xc286('0x12')]['code']===0x1f4){logger[_0xc286('0x12')](_0xc286('0xf'),_0x1d0da9,_0x96c915[_0xc286('0x12')][_0xc286('0x13')]);return _0x142fcf(_0x96c915[_0xc286('0x12')][_0xc286('0x13')]);}logger[_0xc286('0x12')](_0xc286('0xf'),_0x1d0da9,_0x96c915[_0xc286('0x12')][_0xc286('0x13')]);return _0x37752f(_0x96c915[_0xc286('0x12')][_0xc286('0x13')]);}else{logger[_0xc286('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d0da9,'request\x20sent');_0x37752f(_0x96c915['result'][_0xc286('0x13')]);}})[_0xc286('0x14')](function(_0x40416b){logger[_0xc286('0x12')](_0xc286('0xf'),_0x1d0da9,_0x40416b);_0x142fcf(_0x40416b);});});} \ No newline at end of file +var _0xde24=['error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x50c30a,_0x46b644){var _0x4c9cff=function(_0x33f5f9){while(--_0x33f5f9){_0x50c30a['push'](_0x50c30a['shift']());}};_0x4c9cff(++_0x46b644);}(_0xde24,0x1f2));var _0x4de2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde24[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4de2('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de2('0x1'));var db=require(_0x4de2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4de2('0x3'))('rpc');var config=require(_0x4de2('0x4'));var jayson=require(_0x4de2('0x5'));var client=jayson[_0x4de2('0x6')][_0x4de2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x39f279,_0x24d056,_0x57d60b){return new BPromise(function(_0x5057f1,_0x3f0bfd){return client[_0x4de2('0x8')](_0x39f279,_0x57d60b)[_0x4de2('0x9')](function(_0x59c463){logger[_0x4de2('0xa')](_0x4de2('0xb'),_0x24d056,_0x4de2('0xc'));logger['debug'](_0x4de2('0xd'),_0x24d056,_0x4de2('0xc'),JSON[_0x4de2('0xe')](_0x59c463));if(_0x59c463[_0x4de2('0xf')]){if(_0x59c463[_0x4de2('0xf')][_0x4de2('0x10')]===0x1f4){logger['error'](_0x4de2('0xb'),_0x24d056,_0x59c463[_0x4de2('0xf')][_0x4de2('0x11')]);return _0x3f0bfd(_0x59c463['error'][_0x4de2('0x11')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x24d056,_0x59c463[_0x4de2('0xf')][_0x4de2('0x11')]);return _0x5057f1(_0x59c463[_0x4de2('0xf')][_0x4de2('0x11')]);}else{logger[_0x4de2('0xa')](_0x4de2('0xb'),_0x24d056,_0x4de2('0xc'));_0x5057f1(_0x59c463[_0x4de2('0x12')][_0x4de2('0x11')]);}})['catch'](function(_0x47b6f6){logger[_0x4de2('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x24d056,_0x47b6f6);_0x3f0bfd(_0x47b6f6);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 786133a..93ad976 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 _0xfb43=['destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','delete'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xfb43,0xcc));var _0x3fb4=function(_0x4d6dce,_0x3b45ee){_0x4d6dce=_0x4d6dce-0x0;var _0x14b5b3=_0xfb43[_0x4d6dce];return _0x14b5b3;};'use strict';var multer=require(_0x3fb4('0x0'));var util=require('util');var path=require(_0x3fb4('0x1'));var timeout=require(_0x3fb4('0x2'));var express=require(_0x3fb4('0x3'));var router=express[_0x3fb4('0x4')]();var fs_extra=require(_0x3fb4('0x5'));var auth=require(_0x3fb4('0x6'));var interaction=require(_0x3fb4('0x7'));var config=require(_0x3fb4('0x8'));var controller=require(_0x3fb4('0x9'));router['get']('/',auth[_0x3fb4('0xa')](),controller['index']);router[_0x3fb4('0xb')](_0x3fb4('0xc'),auth[_0x3fb4('0xa')](),controller[_0x3fb4('0xd')]);router[_0x3fb4('0xb')](_0x3fb4('0xe'),auth['isAuthenticated'](),controller[_0x3fb4('0xf')]);router[_0x3fb4('0x10')]('/',auth[_0x3fb4('0xa')](),controller[_0x3fb4('0x11')]);router['post'](_0x3fb4('0xe'),auth[_0x3fb4('0xa')](),controller[_0x3fb4('0x12')]);router[_0x3fb4('0x13')]('/:id',auth[_0x3fb4('0xa')](),controller['update']);router[_0x3fb4('0x14')](_0x3fb4('0xc'),auth[_0x3fb4('0xa')](),controller[_0x3fb4('0x15')]);router[_0x3fb4('0x14')](_0x3fb4('0x16'),auth['isAuthenticated'](),controller[_0x3fb4('0x17')]);module[_0x3fb4('0x18')]=router; \ No newline at end of file +var _0xb5c6=['path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/sounds','getSounds','post','create','addSound','put','delete','removeSound','exports','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb5c6,0x1cc));var _0x6b5c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb5c6[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x6b5c('0x0'));var util=require(_0x6b5c('0x1'));var path=require(_0x6b5c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b5c('0x3'));var router=express[_0x6b5c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b5c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b5c('0x6'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x6b5c('0x7')](),controller[_0x6b5c('0x8')]);router['get'](_0x6b5c('0x9'),auth[_0x6b5c('0x7')](),controller[_0x6b5c('0xa')]);router[_0x6b5c('0xb')](_0x6b5c('0xc'),auth['isAuthenticated'](),controller[_0x6b5c('0xd')]);router[_0x6b5c('0xe')]('/',auth[_0x6b5c('0x7')](),controller[_0x6b5c('0xf')]);router['post'](_0x6b5c('0xc'),auth[_0x6b5c('0x7')](),controller[_0x6b5c('0x10')]);router[_0x6b5c('0x11')](_0x6b5c('0x9'),auth[_0x6b5c('0x7')](),controller['update']);router[_0x6b5c('0x12')]('/:id',auth[_0x6b5c('0x7')](),controller['destroy']);router[_0x6b5c('0x12')]('/:id/sounds/:id2',auth[_0x6b5c('0x7')](),controller[_0x6b5c('0x13')]);module[_0x6b5c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 4619eb2..0e925a4 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 _0xde2d=['files','mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0xde2d,0x159));var _0xdde2=function(_0x53a1be,_0x42dff2){_0x53a1be=_0x53a1be-0x0;var _0x38ae84=_0xde2d[_0x53a1be];return _0x38ae84;};'use strict';var Sequelize=require(_0xdde2('0x0'));module[_0xdde2('0x1')]={'name':{'type':Sequelize[_0xdde2('0x2')],'allowNull':![],'unique':_0xdde2('0x3')},'mode':{'type':Sequelize[_0xdde2('0x4')](_0xdde2('0x5'),_0xdde2('0x6'),_0xdde2('0x7'),_0xdde2('0x8'),_0xdde2('0x9'),_0xdde2('0xa')),'allowNull':!![],'defaultValue':_0xdde2('0x6')},'directory':{'type':Sequelize[_0xdde2('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xdde2('0x2')],'allowNull':!![]},'stamp':{'type':_0xdde2('0xb')},'defaultEntry':{'type':Sequelize[_0xdde2('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7a2f=['files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','BOOLEAN','sequelize','name','custom'];(function(_0x58601a,_0x4e936e){var _0x590c49=function(_0x34e5ec){while(--_0x34e5ec){_0x58601a['push'](_0x58601a['shift']());}};_0x590c49(++_0x4e936e);}(_0x7a2f,0xef));var _0xf7a2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a2f[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xf7a2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf7a2('0x1')},'mode':{'type':Sequelize['ENUM'](_0xf7a2('0x2'),_0xf7a2('0x3'),_0xf7a2('0x4'),_0xf7a2('0x5'),_0xf7a2('0x6'),_0xf7a2('0x7')),'allowNull':!![],'defaultValue':_0xf7a2('0x3')},'directory':{'type':Sequelize[_0xf7a2('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xf7a2('0x8')],'allowNull':!![]},'stamp':{'type':_0xf7a2('0x9')},'defaultEntry':{'type':Sequelize[_0xf7a2('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 8b3af82..184aa3f 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 _0xbfe6=['server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','basename','format','symlinkSync','message','removeSound','id2','%s.%s','getSounds','Sound','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','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','set','Content-Range','apply','reject','save','update','destroy','then','get','MusicOnHolds','error','name','send','map','VoiceMusicOnHold','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','sequelize','transaction','mode','directory','join','root'];(function(_0xce58df,_0x4b6850){var _0x57b86a=function(_0x4599cd){while(--_0x4599cd){_0xce58df['push'](_0xce58df['shift']());}};_0x57b86a(++_0x4b6850);}(_0xbfe6,0x166));var _0x6bfe=function(_0x35ecfc,_0xa522ae){_0x35ecfc=_0x35ecfc-0x0;var _0x5d759d=_0xbfe6[_0x35ecfc];return _0x5d759d;};'use strict';var emlformat=require(_0x6bfe('0x0'));var rimraf=require(_0x6bfe('0x1'));var zipdir=require(_0x6bfe('0x2'));var jsonpatch=require(_0x6bfe('0x3'));var rp=require(_0x6bfe('0x4'));var moment=require('moment');var BPromise=require(_0x6bfe('0x5'));var Mustache=require(_0x6bfe('0x6'));var util=require('util');var path=require(_0x6bfe('0x7'));var sox=require(_0x6bfe('0x8'));var csv=require(_0x6bfe('0x9'));var ejs=require(_0x6bfe('0xa'));var fs=require('fs');var fs_extra=require(_0x6bfe('0xb'));var _=require('lodash');var squel=require(_0x6bfe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6bfe('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bfe('0xe'));var authService=require(_0x6bfe('0xf'));var qs=require(_0x6bfe('0x10'));var as=require(_0x6bfe('0x11'));var hardwareService=require(_0x6bfe('0x12'));var logger=require(_0x6bfe('0x13'))(_0x6bfe('0x14'));var utils=require(_0x6bfe('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6bfe('0x16'))['db'];function respondWithStatusCode(_0x2888d7,_0x18d8dc){_0x18d8dc=_0x18d8dc||0xcc;return function(_0x1cb341){if(_0x1cb341){return _0x2888d7[_0x6bfe('0x17')](_0x18d8dc);}return _0x2888d7[_0x6bfe('0x18')](_0x18d8dc)[_0x6bfe('0x19')]();};}function respondWithResult(_0x1c6ee7,_0x2ef45e){_0x2ef45e=_0x2ef45e||0xc8;return function(_0x50ac70){if(_0x50ac70){return _0x1c6ee7[_0x6bfe('0x18')](_0x2ef45e)[_0x6bfe('0x1a')](_0x50ac70);}};}function respondWithFilteredResult(_0x4586de,_0x1b1ee9){return function(_0x511857){if(_0x511857){var _0x1fe51d=typeof _0x1b1ee9[_0x6bfe('0x1b')]==='undefined'&&typeof _0x1b1ee9[_0x6bfe('0x1c')]===_0x6bfe('0x1d');var _0x4665c4=_0x511857['count'];var _0x4c0287=_0x1fe51d?0x0:_0x1b1ee9[_0x6bfe('0x1b')];var _0x3d5317=_0x1fe51d?_0x511857[_0x6bfe('0x1e')]:_0x1b1ee9['offset']+_0x1b1ee9['limit'];var _0x120817;if(_0x3d5317>=_0x4665c4){_0x3d5317=_0x4665c4;_0x120817=0xc8;}else{_0x120817=0xce;}_0x4586de[_0x6bfe('0x18')](_0x120817);return _0x4586de[_0x6bfe('0x1f')](_0x6bfe('0x20'),_0x4c0287+'-'+_0x3d5317+'/'+_0x4665c4)[_0x6bfe('0x1a')](_0x511857);}return null;};}function patchUpdates(_0x4d012a){return function(_0xca7214){try{jsonpatch[_0x6bfe('0x21')](_0xca7214,_0x4d012a,!![]);}catch(_0xa30bb1){return BPromise[_0x6bfe('0x22')](_0xa30bb1);}return _0xca7214[_0x6bfe('0x23')]();};}function saveUpdates(_0x3ddea2,_0x283912){return function(_0x24f192){if(_0x24f192){return _0x24f192[_0x6bfe('0x24')](_0x3ddea2)['then'](function(_0x2560f0){return _0x2560f0;});}return null;};}function removeEntity(_0x513664,_0x492112){return function(_0x312c03){if(_0x312c03){return _0x312c03[_0x6bfe('0x25')]()[_0x6bfe('0x26')](function(){var _0x3f4698=_0x312c03[_0x6bfe('0x27')]({'plain':!![]});var _0x15f53f=_0x6bfe('0x28');return db['UserProfileResource'][_0x6bfe('0x25')]({'where':{'type':_0x15f53f,'resourceId':_0x3f4698['id']}})[_0x6bfe('0x26')](function(){return _0x312c03;});})[_0x6bfe('0x26')](function(){_0x513664[_0x6bfe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc55419,_0x296f74){return function(_0xbe9a90){if(!_0xbe9a90){_0xc55419[_0x6bfe('0x17')](0x194);}return _0xbe9a90;};}function handleError(_0x5c9836,_0x1c62dc){_0x1c62dc=_0x1c62dc||0x1f4;return function(_0x256e64){logger[_0x6bfe('0x29')](_0x256e64['stack']);if(_0x256e64['name']){delete _0x256e64[_0x6bfe('0x2a')];}_0x5c9836[_0x6bfe('0x18')](_0x1c62dc)[_0x6bfe('0x2b')](_0x256e64);};}exports['index']=function(_0x1ae40c,_0x21b1a2){var _0x20d8f5={},_0x57e9b7={},_0x4fa4be={'count':0x0,'rows':[]};var _0x4def1b=_[_0x6bfe('0x2c')](db[_0x6bfe('0x2d')]['rawAttributes'],function(_0x355cdd){return{'name':_0x355cdd[_0x6bfe('0x2e')],'type':_0x355cdd['type'][_0x6bfe('0x2f')]};});_0x57e9b7[_0x6bfe('0x30')]=_['map'](_0x4def1b,_0x6bfe('0x2a'));_0x57e9b7['query']=_[_0x6bfe('0x31')](_0x1ae40c[_0x6bfe('0x32')]);_0x57e9b7[_0x6bfe('0x33')]=_['intersection'](_0x57e9b7['model'],_0x57e9b7[_0x6bfe('0x32')]);_0x20d8f5[_0x6bfe('0x34')]=_[_0x6bfe('0x35')](_0x57e9b7[_0x6bfe('0x30')],qs[_0x6bfe('0x36')](_0x1ae40c[_0x6bfe('0x32')][_0x6bfe('0x36')]));_0x20d8f5['attributes']=_0x20d8f5[_0x6bfe('0x34')][_0x6bfe('0x37')]?_0x20d8f5[_0x6bfe('0x34')]:_0x57e9b7[_0x6bfe('0x30')];if(!_0x1ae40c['query'][_0x6bfe('0x38')](_0x6bfe('0x39'))){_0x20d8f5[_0x6bfe('0x1c')]=qs['limit'](_0x1ae40c[_0x6bfe('0x32')]['limit']);_0x20d8f5['offset']=qs[_0x6bfe('0x1b')](_0x1ae40c[_0x6bfe('0x32')]['offset']);}_0x20d8f5['order']=qs['sort'](_0x1ae40c['query'][_0x6bfe('0x3a')]);delete _0x1ae40c[_0x6bfe('0x32')][_0x6bfe('0x3a')];_0x20d8f5[_0x6bfe('0x3b')]=qs[_0x6bfe('0x33')](_[_0x6bfe('0x3c')](_0x1ae40c[_0x6bfe('0x32')],_0x57e9b7[_0x6bfe('0x33')]),_0x4def1b);if(_0x1ae40c[_0x6bfe('0x32')][_0x6bfe('0x3d')]){_0x20d8f5[_0x6bfe('0x3b')]=_[_0x6bfe('0x3e')](_0x20d8f5[_0x6bfe('0x3b')],{'$or':_[_0x6bfe('0x2c')](_0x4def1b,function(_0x2e8661){if(_0x2e8661[_0x6bfe('0x3f')]!=='VIRTUAL'){var _0x756ea1={};_0x756ea1[_0x2e8661['name']]={'$like':'%'+_0x1ae40c['query'][_0x6bfe('0x3d')]+'%'};return _0x756ea1;}})});}_0x20d8f5=_[_0x6bfe('0x3e')]({},_0x20d8f5,_0x1ae40c[_0x6bfe('0x40')]);var _0x2b0790={'where':_0x20d8f5[_0x6bfe('0x3b')]};return db['VoiceMusicOnHold'][_0x6bfe('0x1e')](_0x2b0790)[_0x6bfe('0x26')](function(_0x75f653){_0x4fa4be[_0x6bfe('0x1e')]=_0x75f653;if(_0x1ae40c['query'][_0x6bfe('0x41')]){_0x20d8f5[_0x6bfe('0x42')]=[{'all':!![]}];}return db[_0x6bfe('0x2d')][_0x6bfe('0x43')](_0x20d8f5);})['then'](function(_0x19515c){_0x4fa4be[_0x6bfe('0x44')]=_0x19515c;return _0x4fa4be;})[_0x6bfe('0x26')](respondWithFilteredResult(_0x21b1a2,_0x20d8f5))[_0x6bfe('0x45')](handleError(_0x21b1a2,null));};exports[_0x6bfe('0x46')]=function(_0x28da72,_0x117777){var _0x2fd9dd={'raw':![],'where':{'id':_0x28da72[_0x6bfe('0x47')]['id']}},_0x57d9f4={};_0x57d9f4[_0x6bfe('0x30')]=_[_0x6bfe('0x31')](db['VoiceMusicOnHold'][_0x6bfe('0x48')]);_0x57d9f4[_0x6bfe('0x32')]=_[_0x6bfe('0x31')](_0x28da72[_0x6bfe('0x32')]);_0x57d9f4[_0x6bfe('0x33')]=_['intersection'](_0x57d9f4[_0x6bfe('0x30')],_0x57d9f4['query']);_0x2fd9dd['attributes']=_['intersection'](_0x57d9f4['model'],qs['fields'](_0x28da72['query'][_0x6bfe('0x36')]));_0x2fd9dd['attributes']=_0x2fd9dd[_0x6bfe('0x34')][_0x6bfe('0x37')]?_0x2fd9dd['attributes']:_0x57d9f4[_0x6bfe('0x30')];if(_0x28da72['query'][_0x6bfe('0x41')]){_0x2fd9dd[_0x6bfe('0x42')]=[{'all':!![]}];}_0x2fd9dd=_['merge']({},_0x2fd9dd,_0x28da72[_0x6bfe('0x40')]);return db[_0x6bfe('0x2d')][_0x6bfe('0x49')](_0x2fd9dd)[_0x6bfe('0x26')](handleEntityNotFound(_0x117777,null))['then'](respondWithResult(_0x117777,null))[_0x6bfe('0x45')](handleError(_0x117777,null));};exports['update']=function(_0x367aae,_0x3fb7b8){if(_0x367aae[_0x6bfe('0x4a')]['id']){delete _0x367aae['body']['id'];}return db[_0x6bfe('0x2d')][_0x6bfe('0x49')]({'where':{'id':_0x367aae[_0x6bfe('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fb7b8,null))[_0x6bfe('0x26')](saveUpdates(_0x367aae[_0x6bfe('0x4a')],null))[_0x6bfe('0x26')](respondWithResult(_0x3fb7b8,null))[_0x6bfe('0x45')](handleError(_0x3fb7b8,null));};exports[_0x6bfe('0x4b')]=function(_0x4aa9a7,_0x4d7600,_0x56cb07){return db[_0x6bfe('0x4c')][_0x6bfe('0x4d')](function(_0x513fc1){if(_0x4aa9a7[_0x6bfe('0x4a')][_0x6bfe('0x4e')]==='files'){_0x4aa9a7[_0x6bfe('0x4a')][_0x6bfe('0x4f')]=path[_0x6bfe('0x50')](config[_0x6bfe('0x51')],_0x6bfe('0x52'),_0x4aa9a7[_0x6bfe('0x4a')][_0x6bfe('0x2a')]);}return db[_0x6bfe('0x2d')][_0x6bfe('0x4b')](_0x4aa9a7[_0x6bfe('0x4a')],{'transaction':_0x513fc1})['then'](function(_0x56ea6e){if(_0x4aa9a7[_0x6bfe('0x4a')][_0x6bfe('0x4e')]==='files'){fs[_0x6bfe('0x53')](_0x56ea6e['directory'],parseInt('0777',0x8));}var _0x42913a=_0x4aa9a7[_0x6bfe('0x54')][_0x6bfe('0x27')]({'plain':!![]});if(!_0x42913a)throw new Error(_0x6bfe('0x55'));if(_0x42913a[_0x6bfe('0x56')]===_0x6bfe('0x54')){var _0x45f394=_0x56ea6e[_0x6bfe('0x27')]({'plain':!![]});return db[_0x6bfe('0x57')][_0x6bfe('0x49')]({'where':{'name':_0x6bfe('0x28'),'userProfileId':_0x42913a[_0x6bfe('0x58')]},'raw':!![]})[_0x6bfe('0x26')](function(_0x3dab4b){if(_0x3dab4b&&_0x3dab4b['autoAssociation']===0x0){return db[_0x6bfe('0x59')][_0x6bfe('0x4b')]({'name':_0x45f394['name'],'resourceId':_0x45f394['id'],'type':_0x3dab4b[_0x6bfe('0x2a')],'sectionId':_0x3dab4b['id']},{})[_0x6bfe('0x26')](function(){return _0x56ea6e;});}else{return _0x56ea6e;}})['catch'](function(_0x5a24ec){logger[_0x6bfe('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a24ec);});}return _0x56ea6e;});})[_0x6bfe('0x26')](respondWithResult(_0x4d7600,0xc9))['catch'](handleError(_0x4d7600,null));};exports[_0x6bfe('0x25')]=function(_0x30104e,_0x305a83,_0x38c5eb){var _0x590f0a;return db[_0x6bfe('0x2d')][_0x6bfe('0x49')]({'where':{'id':_0x30104e[_0x6bfe('0x47')]['id']}})[_0x6bfe('0x26')](function(_0x553322){if(_0x553322){return db[_0x6bfe('0x4c')][_0x6bfe('0x4d')](function(_0x3e73e7){return _0x553322[_0x6bfe('0x25')]({'transaction':_0x3e73e7,'raw':!![]})['then'](function(_0x37dba7){if(_0x37dba7['directory']){fs[_0x6bfe('0x5a')](_0x37dba7[_0x6bfe('0x4f')])[_0x6bfe('0x5b')](function(_0x1aaa33){fs[_0x6bfe('0x5c')](path['join'](_0x37dba7[_0x6bfe('0x4f')],_0x1aaa33));});fs[_0x6bfe('0x5d')](_0x37dba7['directory']);}return _0x37dba7;});})[_0x6bfe('0x45')](function(_0x4e6d01){throw new db['Sequelize'][(_0x6bfe('0x5e'))](_0x4e6d01['message']);});}})[_0x6bfe('0x26')](handleEntityNotFound(_0x305a83,null))[_0x6bfe('0x26')](removeEntity(_0x305a83,null))[_0x6bfe('0x45')](handleError(_0x305a83,null));};exports[_0x6bfe('0x5f')]=function(_0x111d56,_0x3ce63d,_0x58f8ee){return db[_0x6bfe('0x4c')]['transaction'](function(_0x266a4f){var _0x55994e;return db[_0x6bfe('0x2d')][_0x6bfe('0x49')]({'where':{'id':_0x111d56['params']['id']}})['then'](function(_0x5ba175){if(_0x5ba175){_0x55994e=_0x5ba175;return _0x5ba175[_0x6bfe('0x5f')](_0x111d56[_0x6bfe('0x4a')]['id'],{'transaction':_0x266a4f});}})[_0x6bfe('0x26')](function(_0x1706a6){if(_0x1706a6){return db['Sound'][_0x6bfe('0x60')]({'where':{'id':_0x111d56[_0x6bfe('0x4a')]['id']},'attributes':['id',_0x6bfe('0x2a'),_0x6bfe('0x61'),_0x6bfe('0x62'),_0x6bfe('0x63')],'raw':!![]});}})['then'](function(_0x4a53b5){if(_0x4a53b5){var _0x4e0959=path['join'](config[_0x6bfe('0x51')],_0x6bfe('0x64'),util['format']('%s.%s',path[_0x6bfe('0x65')](_0x4a53b5[_0x6bfe('0x61')],path['extname'](_0x4a53b5[_0x6bfe('0x61')])),_0x4a53b5[_0x6bfe('0x62')]));var _0x108b7a=path[_0x6bfe('0x50')](config['root'],'server/files/moh',_0x55994e['name'],util[_0x6bfe('0x66')]('%s.%s',_0x4a53b5[_0x6bfe('0x2a')],_0x4a53b5[_0x6bfe('0x62')]));fs[_0x6bfe('0x67')](_0x4e0959,_0x108b7a);return _0x4a53b5;}})[_0x6bfe('0x45')](function(_0x4b83af){throw new db['Sequelize'][(_0x6bfe('0x5e'))](_0x4b83af[_0x6bfe('0x68')]);});})[_0x6bfe('0x26')](handleEntityNotFound(_0x3ce63d,null))[_0x6bfe('0x26')](respondWithResult(_0x3ce63d,0xc9))['catch'](handleError(_0x3ce63d,null));};exports['removeSound']=function(_0x12c484,_0x4346b9,_0x77f3ce){return db[_0x6bfe('0x4c')][_0x6bfe('0x4d')](function(_0x485a67){var _0xff2829;return db[_0x6bfe('0x2d')][_0x6bfe('0x60')]({'where':{'id':_0x12c484[_0x6bfe('0x47')]['id']}})[_0x6bfe('0x26')](handleEntityNotFound(_0x4346b9,null))[_0x6bfe('0x26')](function(_0x2f3141){if(_0x2f3141){_0xff2829=_0x2f3141;return _0x2f3141[_0x6bfe('0x69')](_0x12c484[_0x6bfe('0x47')]['id2']);}})[_0x6bfe('0x26')](function(_0x3a039a){if(_0x3a039a){return db['Sound']['findOne']({'where':{'id':_0x12c484[_0x6bfe('0x47')][_0x6bfe('0x6a')]},'attributes':['id',_0x6bfe('0x2a'),_0x6bfe('0x61'),'converted_format',_0x6bfe('0x63')],'raw':!![]});}})[_0x6bfe('0x26')](function(_0xdf2d9){if(_0xdf2d9){fs[_0x6bfe('0x5c')](path[_0x6bfe('0x50')](_0xff2829[_0x6bfe('0x4f')],util[_0x6bfe('0x66')](_0x6bfe('0x6b'),_0xdf2d9[_0x6bfe('0x2a')],_0xdf2d9['converted_format'])));return _0xdf2d9;}})[_0x6bfe('0x45')](function(_0x4a9b5e){throw new db['Sequelize'][(_0x6bfe('0x5e'))](_0x4a9b5e['message']);});})['then'](handleEntityNotFound(_0x4346b9,null))[_0x6bfe('0x26')](respondWithStatusCode(_0x4346b9,0xcc))[_0x6bfe('0x45')](handleError(_0x4346b9,null));};exports[_0x6bfe('0x6c')]=function(_0x10e707,_0x34b6a8,_0x17c791){var _0x2dfe9f={};var _0x4e542a={};var _0x38f8f4;var _0x57b92a;return db[_0x6bfe('0x2d')]['findOne']({'where':{'id':_0x10e707[_0x6bfe('0x47')]['id']}})['then'](handleEntityNotFound(_0x34b6a8,null))['then'](function(_0x2095de){if(_0x2095de){_0x38f8f4=_0x2095de;_0x4e542a[_0x6bfe('0x30')]=_[_0x6bfe('0x31')](db[_0x6bfe('0x6d')][_0x6bfe('0x48')]);_0x4e542a[_0x6bfe('0x32')]=_['keys'](_0x10e707[_0x6bfe('0x32')]);_0x4e542a[_0x6bfe('0x33')]=_[_0x6bfe('0x35')](_0x4e542a[_0x6bfe('0x30')],_0x4e542a[_0x6bfe('0x32')]);_0x2dfe9f[_0x6bfe('0x34')]=_[_0x6bfe('0x35')](_0x4e542a[_0x6bfe('0x30')],qs[_0x6bfe('0x36')](_0x10e707[_0x6bfe('0x32')][_0x6bfe('0x36')]));_0x2dfe9f[_0x6bfe('0x34')]=_0x2dfe9f[_0x6bfe('0x34')][_0x6bfe('0x37')]?_0x2dfe9f[_0x6bfe('0x34')]:_0x4e542a[_0x6bfe('0x30')];_0x2dfe9f['order']=qs[_0x6bfe('0x3a')](_0x10e707['query'][_0x6bfe('0x3a')]);_0x2dfe9f[_0x6bfe('0x3b')]=qs[_0x6bfe('0x33')](_['pick'](_0x10e707['query'],_0x4e542a[_0x6bfe('0x33')]));if(_0x10e707[_0x6bfe('0x32')]['filter']){_0x2dfe9f[_0x6bfe('0x3b')]=_[_0x6bfe('0x3e')](_0x2dfe9f['where'],{'$or':_[_0x6bfe('0x2c')](_0x2dfe9f[_0x6bfe('0x34')],function(_0x4fd8b5){var _0x380e4e={};_0x380e4e[_0x4fd8b5]={'$like':'%'+_0x10e707[_0x6bfe('0x32')][_0x6bfe('0x3d')]+'%'};return _0x380e4e;})});}_0x2dfe9f=_[_0x6bfe('0x3e')]({},_0x2dfe9f,_0x10e707[_0x6bfe('0x40')]);return _0x38f8f4[_0x6bfe('0x6c')](_0x2dfe9f);}})['then'](function(_0xde7e98){if(_0xde7e98){_0x57b92a=_0xde7e98[_0x6bfe('0x37')];if(!_0x10e707['query']['hasOwnProperty'](_0x6bfe('0x39'))){_0x2dfe9f['limit']=qs[_0x6bfe('0x1c')](_0x10e707['query'][_0x6bfe('0x1c')]);_0x2dfe9f[_0x6bfe('0x1b')]=qs[_0x6bfe('0x1b')](_0x10e707[_0x6bfe('0x32')]['offset']);}return _0x38f8f4[_0x6bfe('0x6c')](_0x2dfe9f);}})['then'](function(_0x5ed46f){if(_0x5ed46f){return _0x5ed46f?{'count':_0x57b92a,'rows':_0x5ed46f}:null;}})[_0x6bfe('0x26')](respondWithResult(_0x34b6a8,null))[_0x6bfe('0x45')](handleError(_0x34b6a8,null));}; \ No newline at end of file +var _0x1db2=['length','update','body','find','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','readdirSync','forEach','unlinkSync','ValidationError','addSound','params','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','Sequelize','message','removeSound','findOne','id2','getSounds','hasOwnProperty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','MusicOnHolds','UserProfileResource','name','send','index','map','VoiceMusicOnHold','fieldName','key','keys','intersection','attributes','model','fields','query','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes'];(function(_0x517c5c,_0x55ee2a){var _0x35a848=function(_0x5d19ca){while(--_0x5d19ca){_0x517c5c['push'](_0x517c5c['shift']());}};_0x35a848(++_0x55ee2a);}(_0x1db2,0x114));var _0x21db=function(_0x4d7120,_0x2ab618){_0x4d7120=_0x4d7120-0x0;var _0x3d76f3=_0x1db2[_0x4d7120];return _0x3d76f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x21db('0x0'));var jsonpatch=require(_0x21db('0x1'));var rp=require(_0x21db('0x2'));var moment=require(_0x21db('0x3'));var BPromise=require(_0x21db('0x4'));var Mustache=require(_0x21db('0x5'));var util=require(_0x21db('0x6'));var path=require(_0x21db('0x7'));var sox=require(_0x21db('0x8'));var csv=require('to-csv');var ejs=require(_0x21db('0x9'));var fs=require('fs');var fs_extra=require(_0x21db('0xa'));var _=require(_0x21db('0xb'));var squel=require(_0x21db('0xc'));var crypto=require(_0x21db('0xd'));var jsforce=require(_0x21db('0xe'));var deskjs=require(_0x21db('0xf'));var toCsv=require(_0x21db('0x10'));var querystring=require(_0x21db('0x11'));var Papa=require(_0x21db('0x12'));var Redis=require(_0x21db('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x21db('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21db('0x15'));var logger=require(_0x21db('0x16'))(_0x21db('0x17'));var utils=require('../../config/utils');var config=require(_0x21db('0x18'));var licenseUtil=require(_0x21db('0x19'));var db=require(_0x21db('0x1a'))['db'];function respondWithStatusCode(_0x5dfa57,_0x4752fb){_0x4752fb=_0x4752fb||0xcc;return function(_0x3e5fa6){if(_0x3e5fa6){return _0x5dfa57[_0x21db('0x1b')](_0x4752fb);}return _0x5dfa57[_0x21db('0x1c')](_0x4752fb)[_0x21db('0x1d')]();};}function respondWithResult(_0x4975e7,_0x3310a8){_0x3310a8=_0x3310a8||0xc8;return function(_0x19bfff){if(_0x19bfff){return _0x4975e7[_0x21db('0x1c')](_0x3310a8)['json'](_0x19bfff);}};}function respondWithFilteredResult(_0x2f5710,_0x1aaa65){return function(_0x55ec84){if(_0x55ec84){var _0x29ad73=typeof _0x1aaa65[_0x21db('0x1e')]===_0x21db('0x1f')&&typeof _0x1aaa65[_0x21db('0x20')]===_0x21db('0x1f');var _0x2df6fe=_0x55ec84[_0x21db('0x21')];var _0x1c2565=_0x29ad73?0x0:_0x1aaa65[_0x21db('0x1e')];var _0x3873c4=_0x29ad73?_0x55ec84['count']:_0x1aaa65[_0x21db('0x1e')]+_0x1aaa65[_0x21db('0x20')];var _0x25ac87;if(_0x3873c4>=_0x2df6fe){_0x3873c4=_0x2df6fe;_0x25ac87=0xc8;}else{_0x25ac87=0xce;}_0x2f5710['status'](_0x25ac87);return _0x2f5710[_0x21db('0x22')](_0x21db('0x23'),_0x1c2565+'-'+_0x3873c4+'/'+_0x2df6fe)[_0x21db('0x24')](_0x55ec84);}return null;};}function patchUpdates(_0x4db919){return function(_0x4c9111){try{jsonpatch[_0x21db('0x25')](_0x4c9111,_0x4db919,!![]);}catch(_0x28a408){return BPromise[_0x21db('0x26')](_0x28a408);}return _0x4c9111[_0x21db('0x27')]();};}function saveUpdates(_0x580e30,_0x2f915b){return function(_0x2fedd6){if(_0x2fedd6){return _0x2fedd6['update'](_0x580e30)[_0x21db('0x28')](function(_0x5d66f3){return _0x5d66f3;});}return null;};}function removeEntity(_0xe777d7,_0x321497){return function(_0x444a0a){if(_0x444a0a){return _0x444a0a['destroy']()[_0x21db('0x28')](function(){var _0x41919d=_0x444a0a[_0x21db('0x29')]({'plain':!![]});var _0x49522f=_0x21db('0x2a');return db[_0x21db('0x2b')]['destroy']({'where':{'type':_0x49522f,'resourceId':_0x41919d['id']}})[_0x21db('0x28')](function(){return _0x444a0a;});})['then'](function(){_0xe777d7[_0x21db('0x1c')](0xcc)[_0x21db('0x1d')]();});}};}function handleEntityNotFound(_0x3a53ae,_0x5dcfc2){return function(_0x2acd0a){if(!_0x2acd0a){_0x3a53ae['sendStatus'](0x194);}return _0x2acd0a;};}function handleError(_0x389992,_0x1761d3){_0x1761d3=_0x1761d3||0x1f4;return function(_0x37aeb5){logger['error'](_0x37aeb5['stack']);if(_0x37aeb5[_0x21db('0x2c')]){delete _0x37aeb5[_0x21db('0x2c')];}_0x389992[_0x21db('0x1c')](_0x1761d3)[_0x21db('0x2d')](_0x37aeb5);};}exports[_0x21db('0x2e')]=function(_0x3d1022,_0x1af369){var _0x1170a7={},_0xd1db5d={},_0x4201ba={'count':0x0,'rows':[]};var _0x5b8376=_[_0x21db('0x2f')](db[_0x21db('0x30')]['rawAttributes'],function(_0x4423b2){return{'name':_0x4423b2[_0x21db('0x31')],'type':_0x4423b2['type'][_0x21db('0x32')]};});_0xd1db5d['model']=_['map'](_0x5b8376,_0x21db('0x2c'));_0xd1db5d['query']=_[_0x21db('0x33')](_0x3d1022['query']);_0xd1db5d['filters']=_[_0x21db('0x34')](_0xd1db5d['model'],_0xd1db5d['query']);_0x1170a7[_0x21db('0x35')]=_[_0x21db('0x34')](_0xd1db5d[_0x21db('0x36')],qs[_0x21db('0x37')](_0x3d1022[_0x21db('0x38')][_0x21db('0x37')]));_0x1170a7[_0x21db('0x35')]=_0x1170a7[_0x21db('0x35')]['length']?_0x1170a7['attributes']:_0xd1db5d['model'];if(!_0x3d1022['query']['hasOwnProperty'](_0x21db('0x39'))){_0x1170a7[_0x21db('0x20')]=qs[_0x21db('0x20')](_0x3d1022[_0x21db('0x38')][_0x21db('0x20')]);_0x1170a7[_0x21db('0x1e')]=qs[_0x21db('0x1e')](_0x3d1022['query']['offset']);}_0x1170a7[_0x21db('0x3a')]=qs[_0x21db('0x3b')](_0x3d1022[_0x21db('0x38')][_0x21db('0x3b')]);delete _0x3d1022[_0x21db('0x38')][_0x21db('0x3b')];_0x1170a7[_0x21db('0x3c')]=qs[_0x21db('0x3d')](_[_0x21db('0x3e')](_0x3d1022[_0x21db('0x38')],_0xd1db5d[_0x21db('0x3d')]),_0x5b8376);if(_0x3d1022[_0x21db('0x38')][_0x21db('0x3f')]){_0x1170a7[_0x21db('0x3c')]=_['merge'](_0x1170a7[_0x21db('0x3c')],{'$or':_['map'](_0x5b8376,function(_0x13f763){if(_0x13f763['type']!=='VIRTUAL'){var _0x47bdd2={};_0x47bdd2[_0x13f763[_0x21db('0x2c')]]={'$like':'%'+_0x3d1022[_0x21db('0x38')][_0x21db('0x3f')]+'%'};return _0x47bdd2;}})});}_0x1170a7=_[_0x21db('0x40')]({},_0x1170a7,_0x3d1022[_0x21db('0x41')]);var _0x23b11e={'where':_0x1170a7['where']};return db[_0x21db('0x30')][_0x21db('0x21')](_0x23b11e)[_0x21db('0x28')](function(_0x5cec0a){_0x4201ba[_0x21db('0x21')]=_0x5cec0a;if(_0x3d1022[_0x21db('0x38')][_0x21db('0x42')]){_0x1170a7[_0x21db('0x43')]=[{'all':!![]}];}return db[_0x21db('0x30')][_0x21db('0x44')](_0x1170a7);})[_0x21db('0x28')](function(_0x4efcf0){_0x4201ba[_0x21db('0x45')]=_0x4efcf0;return _0x4201ba;})['then'](respondWithFilteredResult(_0x1af369,_0x1170a7))[_0x21db('0x46')](handleError(_0x1af369,null));};exports['show']=function(_0x283605,_0x3376b0){var _0x5a9b9f={'raw':![],'where':{'id':_0x283605['params']['id']}},_0xa94731={};_0xa94731[_0x21db('0x36')]=_[_0x21db('0x33')](db[_0x21db('0x30')][_0x21db('0x47')]);_0xa94731['query']=_[_0x21db('0x33')](_0x283605[_0x21db('0x38')]);_0xa94731[_0x21db('0x3d')]=_[_0x21db('0x34')](_0xa94731[_0x21db('0x36')],_0xa94731[_0x21db('0x38')]);_0x5a9b9f[_0x21db('0x35')]=_['intersection'](_0xa94731[_0x21db('0x36')],qs[_0x21db('0x37')](_0x283605[_0x21db('0x38')][_0x21db('0x37')]));_0x5a9b9f['attributes']=_0x5a9b9f[_0x21db('0x35')][_0x21db('0x48')]?_0x5a9b9f[_0x21db('0x35')]:_0xa94731[_0x21db('0x36')];if(_0x283605[_0x21db('0x38')][_0x21db('0x42')]){_0x5a9b9f[_0x21db('0x43')]=[{'all':!![]}];}_0x5a9b9f=_[_0x21db('0x40')]({},_0x5a9b9f,_0x283605[_0x21db('0x41')]);return db[_0x21db('0x30')]['find'](_0x5a9b9f)[_0x21db('0x28')](handleEntityNotFound(_0x3376b0,null))[_0x21db('0x28')](respondWithResult(_0x3376b0,null))['catch'](handleError(_0x3376b0,null));};exports[_0x21db('0x49')]=function(_0x5a37c0,_0xc43a70){if(_0x5a37c0['body']['id']){delete _0x5a37c0[_0x21db('0x4a')]['id'];}return db[_0x21db('0x30')][_0x21db('0x4b')]({'where':{'id':_0x5a37c0['params']['id']}})['then'](handleEntityNotFound(_0xc43a70,null))['then'](saveUpdates(_0x5a37c0[_0x21db('0x4a')],null))[_0x21db('0x28')](respondWithResult(_0xc43a70,null))['catch'](handleError(_0xc43a70,null));};exports[_0x21db('0x4c')]=function(_0x4f591e,_0x3440f0,_0x53c5d0){return db[_0x21db('0x4d')][_0x21db('0x4e')](function(_0x26f087){if(_0x4f591e[_0x21db('0x4a')][_0x21db('0x4f')]===_0x21db('0x50')){_0x4f591e['body'][_0x21db('0x51')]=path[_0x21db('0x52')](config[_0x21db('0x53')],_0x21db('0x54'),_0x4f591e[_0x21db('0x4a')][_0x21db('0x2c')]);}return db[_0x21db('0x30')]['create'](_0x4f591e[_0x21db('0x4a')],{'transaction':_0x26f087})['then'](function(_0x42957e){if(_0x4f591e['body']['mode']===_0x21db('0x50')){fs[_0x21db('0x55')](_0x42957e[_0x21db('0x51')],parseInt(_0x21db('0x56'),0x8));}var _0x206b6a=_0x4f591e[_0x21db('0x57')][_0x21db('0x29')]({'plain':!![]});if(!_0x206b6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x206b6a[_0x21db('0x58')]==='user'){var _0x4f1c38=_0x42957e[_0x21db('0x29')]({'plain':!![]});return db[_0x21db('0x59')][_0x21db('0x4b')]({'where':{'name':_0x21db('0x2a'),'userProfileId':_0x206b6a[_0x21db('0x5a')]},'raw':!![]})['then'](function(_0x24848){if(_0x24848&&_0x24848[_0x21db('0x5b')]===0x0){return db['UserProfileResource'][_0x21db('0x4c')]({'name':_0x4f1c38[_0x21db('0x2c')],'resourceId':_0x4f1c38['id'],'type':_0x24848[_0x21db('0x2c')],'sectionId':_0x24848['id']},{})['then'](function(){return _0x42957e;});}else{return _0x42957e;}})[_0x21db('0x46')](function(_0x1f6d79){logger['error'](_0x21db('0x5c'),_0x1f6d79);});}return _0x42957e;});})['then'](respondWithResult(_0x3440f0,0xc9))[_0x21db('0x46')](handleError(_0x3440f0,null));};exports[_0x21db('0x5d')]=function(_0x45cd88,_0x48ae48,_0x14f718){var _0x39926c;return db[_0x21db('0x30')]['find']({'where':{'id':_0x45cd88['params']['id']}})[_0x21db('0x28')](function(_0x283867){if(_0x283867){return db[_0x21db('0x4d')][_0x21db('0x4e')](function(_0x47651b){return _0x283867[_0x21db('0x5d')]({'transaction':_0x47651b,'raw':!![]})['then'](function(_0x5dda03){if(_0x5dda03[_0x21db('0x51')]){fs[_0x21db('0x5e')](_0x5dda03['directory'])[_0x21db('0x5f')](function(_0x19d867){fs[_0x21db('0x60')](path[_0x21db('0x52')](_0x5dda03[_0x21db('0x51')],_0x19d867));});fs['rmdirSync'](_0x5dda03[_0x21db('0x51')]);}return _0x5dda03;});})['catch'](function(_0x6f6fbb){throw new db['Sequelize'][(_0x21db('0x61'))](_0x6f6fbb['message']);});}})[_0x21db('0x28')](handleEntityNotFound(_0x48ae48,null))['then'](removeEntity(_0x48ae48,null))['catch'](handleError(_0x48ae48,null));};exports[_0x21db('0x62')]=function(_0x4481b1,_0x2a230b,_0x4e3345){return db[_0x21db('0x4d')][_0x21db('0x4e')](function(_0xd194b7){var _0x4cd824;return db[_0x21db('0x30')][_0x21db('0x4b')]({'where':{'id':_0x4481b1[_0x21db('0x63')]['id']}})[_0x21db('0x28')](function(_0x400f51){if(_0x400f51){_0x4cd824=_0x400f51;return _0x400f51['addSound'](_0x4481b1[_0x21db('0x4a')]['id'],{'transaction':_0xd194b7});}})[_0x21db('0x28')](function(_0x104bf7){if(_0x104bf7){return db[_0x21db('0x64')]['findOne']({'where':{'id':_0x4481b1[_0x21db('0x4a')]['id']},'attributes':['id',_0x21db('0x2c'),_0x21db('0x65'),_0x21db('0x66'),_0x21db('0x67')],'raw':!![]});}})[_0x21db('0x28')](function(_0x138305){if(_0x138305){var _0x4b1394=path['join'](config[_0x21db('0x53')],_0x21db('0x68'),util[_0x21db('0x69')](_0x21db('0x6a'),path[_0x21db('0x6b')](_0x138305[_0x21db('0x65')],path['extname'](_0x138305[_0x21db('0x65')])),_0x138305['converted_format']));var _0x32eb8d=path['join'](config[_0x21db('0x53')],_0x21db('0x54'),_0x4cd824[_0x21db('0x2c')],util[_0x21db('0x69')]('%s.%s',_0x138305[_0x21db('0x2c')],_0x138305[_0x21db('0x66')]));fs[_0x21db('0x6c')](_0x4b1394,_0x32eb8d);return _0x138305;}})[_0x21db('0x46')](function(_0x35e82d){throw new db[(_0x21db('0x6d'))][(_0x21db('0x61'))](_0x35e82d[_0x21db('0x6e')]);});})['then'](handleEntityNotFound(_0x2a230b,null))[_0x21db('0x28')](respondWithResult(_0x2a230b,0xc9))['catch'](handleError(_0x2a230b,null));};exports[_0x21db('0x6f')]=function(_0x12a040,_0x36b08b,_0x40466f){return db[_0x21db('0x4d')][_0x21db('0x4e')](function(_0x27bb38){var _0x31bafa;return db['VoiceMusicOnHold'][_0x21db('0x70')]({'where':{'id':_0x12a040[_0x21db('0x63')]['id']}})[_0x21db('0x28')](handleEntityNotFound(_0x36b08b,null))['then'](function(_0x70c111){if(_0x70c111){_0x31bafa=_0x70c111;return _0x70c111['removeSound'](_0x12a040['params'][_0x21db('0x71')]);}})['then'](function(_0x4c12d1){if(_0x4c12d1){return db[_0x21db('0x64')][_0x21db('0x70')]({'where':{'id':_0x12a040[_0x21db('0x63')][_0x21db('0x71')]},'attributes':['id',_0x21db('0x2c'),_0x21db('0x65'),_0x21db('0x66'),'createdAt'],'raw':!![]});}})['then'](function(_0x205a5c){if(_0x205a5c){fs[_0x21db('0x60')](path[_0x21db('0x52')](_0x31bafa[_0x21db('0x51')],util[_0x21db('0x69')](_0x21db('0x6a'),_0x205a5c[_0x21db('0x2c')],_0x205a5c['converted_format'])));return _0x205a5c;}})[_0x21db('0x46')](function(_0x165604){throw new db[(_0x21db('0x6d'))][(_0x21db('0x61'))](_0x165604['message']);});})['then'](handleEntityNotFound(_0x36b08b,null))[_0x21db('0x28')](respondWithStatusCode(_0x36b08b,0xcc))[_0x21db('0x46')](handleError(_0x36b08b,null));};exports[_0x21db('0x72')]=function(_0x3973ed,_0x309c7d,_0x5a1ea9){var _0x2078e8={};var _0x5f08ad={};var _0x1fe753;var _0x401db6;return db[_0x21db('0x30')]['findOne']({'where':{'id':_0x3973ed[_0x21db('0x63')]['id']}})[_0x21db('0x28')](handleEntityNotFound(_0x309c7d,null))[_0x21db('0x28')](function(_0x9ae1bd){if(_0x9ae1bd){_0x1fe753=_0x9ae1bd;_0x5f08ad[_0x21db('0x36')]=_[_0x21db('0x33')](db[_0x21db('0x64')]['rawAttributes']);_0x5f08ad[_0x21db('0x38')]=_[_0x21db('0x33')](_0x3973ed[_0x21db('0x38')]);_0x5f08ad['filters']=_[_0x21db('0x34')](_0x5f08ad[_0x21db('0x36')],_0x5f08ad[_0x21db('0x38')]);_0x2078e8[_0x21db('0x35')]=_['intersection'](_0x5f08ad[_0x21db('0x36')],qs['fields'](_0x3973ed[_0x21db('0x38')]['fields']));_0x2078e8[_0x21db('0x35')]=_0x2078e8['attributes'][_0x21db('0x48')]?_0x2078e8['attributes']:_0x5f08ad[_0x21db('0x36')];_0x2078e8[_0x21db('0x3a')]=qs[_0x21db('0x3b')](_0x3973ed[_0x21db('0x38')][_0x21db('0x3b')]);_0x2078e8[_0x21db('0x3c')]=qs[_0x21db('0x3d')](_[_0x21db('0x3e')](_0x3973ed[_0x21db('0x38')],_0x5f08ad[_0x21db('0x3d')]));if(_0x3973ed[_0x21db('0x38')][_0x21db('0x3f')]){_0x2078e8[_0x21db('0x3c')]=_[_0x21db('0x40')](_0x2078e8[_0x21db('0x3c')],{'$or':_['map'](_0x2078e8[_0x21db('0x35')],function(_0x3f581b){var _0x1904ce={};_0x1904ce[_0x3f581b]={'$like':'%'+_0x3973ed[_0x21db('0x38')]['filter']+'%'};return _0x1904ce;})});}_0x2078e8=_['merge']({},_0x2078e8,_0x3973ed['options']);return _0x1fe753[_0x21db('0x72')](_0x2078e8);}})['then'](function(_0x2cfbc0){if(_0x2cfbc0){_0x401db6=_0x2cfbc0[_0x21db('0x48')];if(!_0x3973ed[_0x21db('0x38')][_0x21db('0x73')]('nolimit')){_0x2078e8[_0x21db('0x20')]=qs[_0x21db('0x20')](_0x3973ed[_0x21db('0x38')][_0x21db('0x20')]);_0x2078e8[_0x21db('0x1e')]=qs['offset'](_0x3973ed[_0x21db('0x38')]['offset']);}return _0x1fe753[_0x21db('0x72')](_0x2078e8);}})[_0x21db('0x28')](function(_0xd15660){if(_0xd15660){return _0xd15660?{'count':_0x401db6,'rows':_0xd15660}:null;}})[_0x21db('0x28')](respondWithResult(_0x309c7d,null))[_0x21db('0x46')](handleError(_0x309c7d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 4a3eb94..b62bcc9 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 _0x8ba5=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x8ba5,0x190));var _0x58ba=function(_0x10a0ab,_0x37b227){_0x10a0ab=_0x10a0ab-0x0;var _0x35f4c3=_0x8ba5[_0x10a0ab];return _0x35f4c3;};'use strict';var _=require(_0x58ba('0x0'));var util=require(_0x58ba('0x1'));var logger=require(_0x58ba('0x2'))(_0x58ba('0x3'));var moment=require('moment');var BPromise=require(_0x58ba('0x4'));var rp=require(_0x58ba('0x5'));var fs=require('fs');var path=require(_0x58ba('0x6'));var rimraf=require(_0x58ba('0x7'));var config=require(_0x58ba('0x8'));var attributes=require(_0x58ba('0x9'));module[_0x58ba('0xa')]=function(_0xe302c8,_0x2d07d5){return _0xe302c8[_0x58ba('0xb')](_0x58ba('0xc'),attributes,{'tableName':_0x58ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03fb=['VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x33de2d,_0x5bc79b){var _0x2049ed=function(_0x4b0811){while(--_0x4b0811){_0x33de2d['push'](_0x33de2d['shift']());}};_0x2049ed(++_0x5bc79b);}(_0x03fb,0x120));var _0xb03f=function(_0x329ac8,_0x55aade){_0x329ac8=_0x329ac8-0x0;var _0xf14dca=_0x03fb[_0x329ac8];return _0xf14dca;};'use strict';var _=require('lodash');var util=require(_0xb03f('0x0'));var logger=require(_0xb03f('0x1'))('api');var moment=require(_0xb03f('0x2'));var BPromise=require(_0xb03f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb03f('0x4'));var rimraf=require(_0xb03f('0x5'));var config=require(_0xb03f('0x6'));var attributes=require(_0xb03f('0x7'));module[_0xb03f('0x8')]=function(_0x3a2e3f,_0x5eb8d0){return _0x3a2e3f['define'](_0xb03f('0x9'),attributes,{'tableName':_0xb03f('0xa'),'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 47eee46..54a3a15 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x398f28,_0x21a647){var _0x4137bc=function(_0x2174db){while(--_0x2174db){_0x398f28['push'](_0x398f28['shift']());}};_0x4137bc(++_0x21a647);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcb91[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x4f5316,_0x143fd5){var _0x215bad=function(_0x5c77c0){while(--_0x5c77c0){_0x4f5316['push'](_0x4f5316['shift']());}};_0x215bad(++_0x143fd5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xcb91[_0x5e4563];return _0x8d1bf5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 43d2c83..dfb2675 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 _0x6ede=['addTeams','put','/:id','update','delete','destroy','removeAgents','removeTeams','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/users','getAgents','/:id/teams','post','create'];(function(_0x730e1f,_0x9b7407){var _0x39078a=function(_0x23da5c){while(--_0x23da5c){_0x730e1f['push'](_0x730e1f['shift']());}};_0x39078a(++_0x9b7407);}(_0x6ede,0x140));var _0xe6ed=function(_0x56ca61,_0x187321){_0x56ca61=_0x56ca61-0x0;var _0x1e7bee=_0x6ede[_0x56ca61];return _0x1e7bee;};'use strict';var multer=require('multer');var util=require(_0xe6ed('0x0'));var path=require('path');var timeout=require(_0xe6ed('0x1'));var express=require(_0xe6ed('0x2'));var router=express[_0xe6ed('0x3')]();var fs_extra=require(_0xe6ed('0x4'));var auth=require(_0xe6ed('0x5'));var interaction=require(_0xe6ed('0x6'));var config=require(_0xe6ed('0x7'));var controller=require('./voicePrefix.controller');router[_0xe6ed('0x8')]('/',auth[_0xe6ed('0x9')](),controller[_0xe6ed('0xa')]);router[_0xe6ed('0x8')](_0xe6ed('0xb'),auth[_0xe6ed('0x9')](),controller[_0xe6ed('0xc')]);router[_0xe6ed('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe6ed('0x8')](_0xe6ed('0xd'),auth[_0xe6ed('0x9')](),controller[_0xe6ed('0xe')]);router[_0xe6ed('0x8')](_0xe6ed('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe6ed('0x10')]('/',auth['isAuthenticated'](),controller[_0xe6ed('0x11')]);router[_0xe6ed('0x10')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xe6ed('0x10')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe6ed('0x12')]);router[_0xe6ed('0x13')](_0xe6ed('0x14'),auth[_0xe6ed('0x9')](),controller[_0xe6ed('0x15')]);router[_0xe6ed('0x16')](_0xe6ed('0x14'),auth[_0xe6ed('0x9')](),controller[_0xe6ed('0x17')]);router[_0xe6ed('0x16')](_0xe6ed('0xd'),auth[_0xe6ed('0x9')](),controller[_0xe6ed('0x18')]);router['delete'](_0xe6ed('0xf'),auth['isAuthenticated'](),controller[_0xe6ed('0x19')]);module['exports']=router; \ No newline at end of file +var _0x1159=['create','post','/:id/users','addAgents','put','delete','/:id','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','show','/:id/teams','getTeams'];(function(_0x21ab13,_0x5abaf1){var _0x2bb86e=function(_0x5dc607){while(--_0x5dc607){_0x21ab13['push'](_0x21ab13['shift']());}};_0x2bb86e(++_0x5abaf1);}(_0x1159,0xf3));var _0x9115=function(_0x439d10,_0x1fc64b){_0x439d10=_0x439d10-0x0;var _0x4031bc=_0x1159[_0x439d10];return _0x4031bc;};'use strict';var multer=require(_0x9115('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9115('0x1'));var express=require(_0x9115('0x2'));var router=express[_0x9115('0x3')]();var fs_extra=require(_0x9115('0x4'));var auth=require(_0x9115('0x5'));var interaction=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var controller=require(_0x9115('0x8'));router['get']('/',auth[_0x9115('0x9')](),controller[_0x9115('0xa')]);router[_0x9115('0xb')](_0x9115('0xc'),auth[_0x9115('0x9')](),controller[_0x9115('0xd')]);router[_0x9115('0xb')]('/:id',auth[_0x9115('0x9')](),controller[_0x9115('0xe')]);router['get']('/:id/users',auth[_0x9115('0x9')](),controller['getAgents']);router[_0x9115('0xb')](_0x9115('0xf'),auth[_0x9115('0x9')](),controller[_0x9115('0x10')]);router['post']('/',auth[_0x9115('0x9')](),controller[_0x9115('0x11')]);router[_0x9115('0x12')](_0x9115('0x13'),auth[_0x9115('0x9')](),controller[_0x9115('0x14')]);router[_0x9115('0x12')](_0x9115('0xf'),auth[_0x9115('0x9')](),controller['addTeams']);router[_0x9115('0x15')]('/:id',auth[_0x9115('0x9')](),controller['update']);router[_0x9115('0x16')](_0x9115('0x17'),auth[_0x9115('0x9')](),controller['destroy']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x9115('0x18')]);router[_0x9115('0x16')](_0x9115('0xf'),auth[_0x9115('0x9')](),controller['removeTeams']);module[_0x9115('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3667ef9..7ae090e 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 _0x14cb=['VIRTUAL','system-','getDataValue','sequelize','STRING','name'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x14cb,0xb1));var _0xb14c=function(_0xda3b07,_0x2c8d66){_0xda3b07=_0xda3b07-0x0;var _0x517d4e=_0x14cb[_0xda3b07];return _0x517d4e;};'use strict';var Sequelize=require(_0xb14c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb14c('0x1')],'allowNull':![],'unique':_0xb14c('0x2')},'prefix':{'type':Sequelize[_0xb14c('0x3')],'get':function(_0x3cc9b5){return _0xb14c('0x4')+this[_0xb14c('0x5')](_0xb14c('0x2'))+'-';}},'description':{'type':Sequelize[_0xb14c('0x1')]},'callerIdAll':{'type':Sequelize[_0xb14c('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3622=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x3622,0x8c));var _0x2362=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x3622[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x2362('0x0'));module[_0x2362('0x1')]={'name':{'type':Sequelize[_0x2362('0x2')],'allowNull':![],'unique':_0x2362('0x3')},'prefix':{'type':Sequelize[_0x2362('0x4')],'get':function(_0x246f50){return _0x2362('0x5')+this[_0x2362('0x6')](_0x2362('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x2362('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 67b1628..a131802 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 _0x5fdc=['fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','catch','show','include','options','find','params','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','addAgents','ids','omit','spread','emit','removeAgents','isArray','getAgents','findOne','User','filter','getTeams','Team','findAll','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','Agents','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x5fdc,0x127));var _0xc5fd=function(_0x35482b,_0x243d5c){_0x35482b=_0x35482b-0x0;var _0x434cef=_0x5fdc[_0x35482b];return _0x434cef;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc5fd('0x19')](config[_0xc5fd('0x1a')],{'host':_0xc5fd('0x1b'),'port':0x18eb});var socket=require(_0xc5fd('0x1c'))(new Redis(config[_0xc5fd('0x1a')]));require(_0xc5fd('0x1d'))[_0xc5fd('0x1e')](socket);function respondWithStatusCode(_0xa7a954,_0x51233a){_0x51233a=_0x51233a||0xcc;return function(_0x124651){if(_0x124651){return _0xa7a954[_0xc5fd('0x1f')](_0x51233a);}return _0xa7a954[_0xc5fd('0x20')](_0x51233a)[_0xc5fd('0x21')]();};}function respondWithResult(_0x4d3636,_0x4fd364){_0x4fd364=_0x4fd364||0xc8;return function(_0x4efafd){if(_0x4efafd){return _0x4d3636['status'](_0x4fd364)['json'](_0x4efafd);}};}function respondWithFilteredResult(_0x35a9d0,_0x430e52){return function(_0x27f611){if(_0x27f611){var _0xd0a9f1=typeof _0x430e52[_0xc5fd('0x22')]===_0xc5fd('0x23')&&typeof _0x430e52[_0xc5fd('0x24')]==='undefined';var _0xb7bab1=_0x27f611[_0xc5fd('0x25')];var _0x32eac2=_0xd0a9f1?0x0:_0x430e52[_0xc5fd('0x22')];var _0x3b3093=_0xd0a9f1?_0x27f611['count']:_0x430e52[_0xc5fd('0x22')]+_0x430e52[_0xc5fd('0x24')];var _0x18048e;if(_0x3b3093>=_0xb7bab1){_0x3b3093=_0xb7bab1;_0x18048e=0xc8;}else{_0x18048e=0xce;}_0x35a9d0[_0xc5fd('0x20')](_0x18048e);return _0x35a9d0['set']('Content-Range',_0x32eac2+'-'+_0x3b3093+'/'+_0xb7bab1)[_0xc5fd('0x26')](_0x27f611);}return null;};}function patchUpdates(_0x2ab935){return function(_0x3d7211){try{jsonpatch[_0xc5fd('0x27')](_0x3d7211,_0x2ab935,!![]);}catch(_0x334401){return BPromise[_0xc5fd('0x28')](_0x334401);}return _0x3d7211['save']();};}function saveUpdates(_0x1a3f21,_0x2701f7){return function(_0x1a5174){if(_0x1a5174){return _0x1a5174[_0xc5fd('0x29')](_0x1a3f21)[_0xc5fd('0x2a')](function(_0x4020af){return _0x4020af;});}return null;};}function removeEntity(_0x475b91,_0x527018){return function(_0x3a86f9){if(_0x3a86f9){return _0x3a86f9['destroy']()[_0xc5fd('0x2a')](function(){var _0x231368=_0x3a86f9[_0xc5fd('0x2b')]({'plain':!![]});var _0x2bee22='VoicePrefixes';return db[_0xc5fd('0x2c')][_0xc5fd('0x2d')]({'where':{'type':_0x2bee22,'resourceId':_0x231368['id']}})[_0xc5fd('0x2a')](function(){return _0x3a86f9;});})[_0xc5fd('0x2a')](function(){_0x475b91[_0xc5fd('0x20')](0xcc)[_0xc5fd('0x21')]();});}};}function handleEntityNotFound(_0x541c12,_0x412ef7){return function(_0x5d4f70){if(!_0x5d4f70){_0x541c12['sendStatus'](0x194);}return _0x5d4f70;};}function handleError(_0x12a962,_0x165ee2){_0x165ee2=_0x165ee2||0x1f4;return function(_0x39b21a){logger[_0xc5fd('0x2e')](_0x39b21a[_0xc5fd('0x2f')]);if(_0x39b21a[_0xc5fd('0x30')]){delete _0x39b21a[_0xc5fd('0x30')];}_0x12a962[_0xc5fd('0x20')](_0x165ee2)['send'](_0x39b21a);};}exports[_0xc5fd('0x31')]=function(_0x1b2957,_0x6bb14d){var _0x3b9699={},_0x14c832={},_0x40ed4d={'count':0x0,'rows':[]};var _0x3c0f64=_[_0xc5fd('0x32')](db[_0xc5fd('0x33')][_0xc5fd('0x34')],function(_0x104f37){return{'name':_0x104f37[_0xc5fd('0x35')],'type':_0x104f37['type'][_0xc5fd('0x36')]};});_0x14c832[_0xc5fd('0x37')]=_[_0xc5fd('0x32')](_0x3c0f64,_0xc5fd('0x30'));_0x14c832[_0xc5fd('0x38')]=_[_0xc5fd('0x39')](_0x1b2957[_0xc5fd('0x38')]);_0x14c832[_0xc5fd('0x3a')]=_[_0xc5fd('0x3b')](_0x14c832['model'],_0x14c832[_0xc5fd('0x38')]);_0x3b9699[_0xc5fd('0x3c')]=_[_0xc5fd('0x3b')](_0x14c832[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x3d')]));_0x3b9699['attributes']=_0x3b9699[_0xc5fd('0x3c')][_0xc5fd('0x3e')]?_0x3b9699['attributes']:_0x14c832[_0xc5fd('0x37')];if(!_0x1b2957['query'][_0xc5fd('0x3f')](_0xc5fd('0x40'))){_0x3b9699[_0xc5fd('0x24')]=qs['limit'](_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x24')]);_0x3b9699['offset']=qs[_0xc5fd('0x22')](_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x22')]);}_0x3b9699[_0xc5fd('0x41')]=qs[_0xc5fd('0x42')](_0x1b2957[_0xc5fd('0x38')]['sort']);_0x3b9699[_0xc5fd('0x43')]=qs[_0xc5fd('0x3a')](_[_0xc5fd('0x44')](_0x1b2957[_0xc5fd('0x38')],_0x14c832['filters']),_0x3c0f64);if(_0x1b2957['query']['filter']){_0x3b9699[_0xc5fd('0x43')]=_[_0xc5fd('0x45')](_0x3b9699[_0xc5fd('0x43')],{'$or':_[_0xc5fd('0x32')](_0x3c0f64,function(_0x125c02){if(_0x125c02[_0xc5fd('0x46')]!==_0xc5fd('0x47')){var _0x2ef96f={};_0x2ef96f[_0x125c02[_0xc5fd('0x30')]]={'$like':'%'+_0x1b2957['query']['filter']+'%'};return _0x2ef96f;}})});}_0x3b9699=_[_0xc5fd('0x45')]({},_0x3b9699,_0x1b2957['options']);var _0x970623={'where':_0x3b9699[_0xc5fd('0x43')]};return db[_0xc5fd('0x33')]['count'](_0x970623)[_0xc5fd('0x2a')](function(_0x350753){_0x40ed4d['count']=_0x350753;if(_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x48')]){_0x3b9699['include']=[{'all':!![]}];}return db[_0xc5fd('0x33')]['findAll'](_0x3b9699);})[_0xc5fd('0x2a')](function(_0x17ce12){_0x40ed4d['rows']=_0x17ce12;return _0x40ed4d;})[_0xc5fd('0x2a')](respondWithFilteredResult(_0x6bb14d,_0x3b9699))[_0xc5fd('0x49')](handleError(_0x6bb14d,null));};exports[_0xc5fd('0x4a')]=function(_0x4825fa,_0x408edb){var _0x74a071={'raw':![],'where':{'id':_0x4825fa['params']['id']}},_0x559282={};_0x559282[_0xc5fd('0x37')]=_['keys'](db['VoicePrefix']['rawAttributes']);_0x559282[_0xc5fd('0x38')]=_[_0xc5fd('0x39')](_0x4825fa[_0xc5fd('0x38')]);_0x559282[_0xc5fd('0x3a')]=_[_0xc5fd('0x3b')](_0x559282[_0xc5fd('0x37')],_0x559282['query']);_0x74a071['attributes']=_['intersection'](_0x559282[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x4825fa[_0xc5fd('0x38')]['fields']));_0x74a071[_0xc5fd('0x3c')]=_0x74a071['attributes'][_0xc5fd('0x3e')]?_0x74a071[_0xc5fd('0x3c')]:_0x559282[_0xc5fd('0x37')];if(_0x4825fa[_0xc5fd('0x38')][_0xc5fd('0x48')]){_0x74a071[_0xc5fd('0x4b')]=[{'all':!![]}];}_0x74a071=_['merge']({},_0x74a071,_0x4825fa[_0xc5fd('0x4c')]);return db[_0xc5fd('0x33')]['find'](_0x74a071)['then'](handleEntityNotFound(_0x408edb,null))[_0xc5fd('0x2a')](respondWithResult(_0x408edb,null))['catch'](handleError(_0x408edb,null));};exports['destroy']=function(_0x6e5626,_0x2436e9){return db['VoicePrefix'][_0xc5fd('0x4d')]({'where':{'id':_0x6e5626[_0xc5fd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2436e9,null))[_0xc5fd('0x2a')](removeEntity(_0x2436e9,null))[_0xc5fd('0x49')](handleError(_0x2436e9,null));};exports[_0xc5fd('0x4f')]=function(_0x12b847,_0x1940e3){return db[_0xc5fd('0x33')][_0xc5fd('0x4f')]()[_0xc5fd('0x2a')](respondWithResult(_0x1940e3,null))[_0xc5fd('0x49')](handleError(_0x1940e3,null));};exports[_0xc5fd('0x50')]=function(_0x3e1471,_0x4c10a7){var _0x3c9b99;return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x4989ce){return db[_0xc5fd('0x33')][_0xc5fd('0x50')](_0x3e1471[_0xc5fd('0x53')],{'transaction':_0x4989ce})[_0xc5fd('0x2a')](function(_0x5c7d68){_0x3c9b99=_0x5c7d68[_0xc5fd('0x2b')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x3c9b99[_0xc5fd('0x54')]},'raw':!![]})[_0xc5fd('0x2a')](function(_0x236d04){return createVoicePrefixExtensions(_0x3c9b99,_0x236d04,_0x4989ce);});});})[_0xc5fd('0x2a')](function(){var _0x275e18=_0x3e1471['user']['get']({'plain':!![]});if(!_0x275e18)throw new Error(_0xc5fd('0x55'));if(_0x275e18[_0xc5fd('0x56')]==='user'){var _0x4e9495=_0x3c9b99;return db['UserProfileSection'][_0xc5fd('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0x275e18[_0xc5fd('0x57')]},'raw':!![]})[_0xc5fd('0x2a')](function(_0x2503cd){if(_0x2503cd&&_0x2503cd[_0xc5fd('0x58')]===0x0){return db[_0xc5fd('0x2c')][_0xc5fd('0x50')]({'name':_0x4e9495[_0xc5fd('0x30')],'resourceId':_0x4e9495['id'],'type':_0x2503cd['name'],'sectionId':_0x2503cd['id']},{})[_0xc5fd('0x2a')](function(){return _0x3c9b99;});}else{return _0x3c9b99;}})[_0xc5fd('0x49')](function(_0x228e40){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x228e40);throw _0x228e40;});}return _0x3c9b99;})[_0xc5fd('0x2a')](respondWithResult(_0x4c10a7,null))[_0xc5fd('0x49')](handleError(_0x4c10a7,null));};function Extension(_0x2f30d6,_0x149483,_0x69367,_0x45f9fd){this[_0xc5fd('0x59')]=_0xc5fd('0x5a');this[_0xc5fd('0x5b')]=_0x2f30d6;this[_0xc5fd('0x5c')]=_0x69367;this[_0xc5fd('0x46')]=_0xc5fd('0x5d');this[_0xc5fd('0x5e')]=_0xc5fd('0x5f');this[_0xc5fd('0x60')]=_0x149483;this[_0xc5fd('0x61')]=_0x45f9fd;}function createVoicePrefixExtensions(_0x548b65,_0x404759,_0xc05f80){return new BPromise(function(_0x3eeae0,_0x53a3ee){var _0x32a240=new Extension(formatPrefixName(_0x548b65[_0xc5fd('0x62')]),0x1,_0xc5fd('0x63'),_0xc5fd('0x64'));_0x32a240['VoicePrefixId']=_0x548b65['id'];return db[_0xc5fd('0x65')][_0xc5fd('0x50')](_0x32a240,{'transaction':_0xc05f80})['then'](function(_0x27a1f5){var _0x53ea3d=_0x27a1f5[_0xc5fd('0x2b')]({'plain':!![]});var _0x70a6d=_[_0xc5fd('0x32')](addVoicePrefixExtensions(_0x548b65,_0x404759),function(_0xcaa6b0){_0xcaa6b0[_0xc5fd('0x54')]=_0x53ea3d['id'];_0xcaa6b0[_0xc5fd('0x66')]=_0x548b65['id'];return _0xcaa6b0;});return db['VoiceExtension']['bulkCreate'](_0x70a6d,{'transaction':_0xc05f80})[_0xc5fd('0x2a')](function(_0x1ff40b){if(!_0x1ff40b){return _0x53a3ee(_0xc5fd('0x67'));}else{return _0x3eeae0(_0x1ff40b);}})[_0xc5fd('0x49')](function(_0x27b533){return _0x53a3ee(_0x27b533);});});;});};function addVoicePrefixExtensions(_0x2f4b60,_0x189d7d){var _0x77a940=[];var _0x4d6f97=formatPrefixName(_0x2f4b60[_0xc5fd('0x62')]);_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x2,'Set','CDR(prefix)='+_0x2f4b60[_0xc5fd('0x30')]));if(_0x2f4b60[_0xc5fd('0x69')]){_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x3,_0xc5fd('0x6a'),_0xc5fd('0x6b')+_0x2f4b60[_0xc5fd('0x69')]));}else{_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x3,_0xc5fd('0x63'),'No\x20callerid\x20available'));}_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x4,_0xc5fd('0x6c'),_0x189d7d['context']+','+_0xc5fd('0x6d')+(0x8+_0x2f4b60[_0xc5fd('0x30')]['length'])+'}'+','+0x1));return _0x77a940;}function formatPrefixName(_0x4591be){var _0x2a8c7f='_';for(var _0x5e3f8=0x0;_0x5e3f8<_0x4591be[_0xc5fd('0x3e')];_0x5e3f8++){if(_0x4591be[_0xc5fd('0x6e')](_0x5e3f8)=='-'){_0x2a8c7f+=_0x4591be[_0xc5fd('0x6e')](_0x5e3f8);}else{_0x2a8c7f+='['+_0x4591be[_0xc5fd('0x6e')](_0x5e3f8)+']';}}_0x2a8c7f+='.';return _0x2a8c7f;}exports[_0xc5fd('0x29')]=function(_0x3d1940,_0x130b7b,_0x539c0a){var _0x5131ba=_0x3d1940[_0xc5fd('0x53')];_0x5131ba[_0xc5fd('0x62')]=_0xc5fd('0x6f')+_0x5131ba['name']+'-';return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x2696be){return db['VoicePrefix'][_0xc5fd('0x29')](_0x5131ba,{'where':{'id':_0x5131ba['id']},'transaction':_0x2696be})[_0xc5fd('0x2a')](function(){return db[_0xc5fd('0x65')]['destroy']({'where':{'VoicePrefixId':_0x5131ba['id']},'transaction':_0x2696be})['then'](function(){return db[_0xc5fd('0x65')][_0xc5fd('0x4d')]({'where':{'id':_0x5131ba['VoiceExtensionId']},'raw':!![]})[_0xc5fd('0x2a')](function(_0x55d691){return createVoicePrefixExtensions(_0x5131ba,_0x55d691,_0x2696be);});});});})[_0xc5fd('0x2a')](function(){return db[_0xc5fd('0x33')]['findById'](_0x5131ba['id']);})['then'](respondWithResult(_0x130b7b,null))[_0xc5fd('0x49')](handleError(_0x130b7b,null));};exports[_0xc5fd('0x70')]=function(_0x39624c,_0x152212,_0x281cf9){return db[_0xc5fd('0x33')]['find']({'where':{'id':_0x39624c[_0xc5fd('0x4e')]['id']}})[_0xc5fd('0x2a')](handleEntityNotFound(_0x152212,null))[_0xc5fd('0x2a')](function(_0x24ecc2){if(_0x24ecc2){return _0x24ecc2[_0xc5fd('0x70')](_0x39624c[_0xc5fd('0x53')][_0xc5fd('0x71')],_[_0xc5fd('0x72')](_0x39624c[_0xc5fd('0x53')],['ids','id'])||{})[_0xc5fd('0x73')](function(_0x58ca76){for(var _0x151d13=0x0;_0x151d13<_0x39624c[_0xc5fd('0x53')][_0xc5fd('0x71')]['length'];_0x151d13+=0x1){socket[_0xc5fd('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x39624c['body'][_0xc5fd('0x71')][_0x151d13]),'VoicePrefixId':Number(_0x39624c[_0xc5fd('0x4e')]['id'])});}return _0x58ca76;});}})[_0xc5fd('0x2a')](respondWithResult(_0x152212,null))[_0xc5fd('0x49')](handleError(_0x152212,null));};exports[_0xc5fd('0x75')]=function(_0x58df99,_0x4b43fc,_0x1ab84b){return db[_0xc5fd('0x33')][_0xc5fd('0x4d')]({'where':{'id':_0x58df99[_0xc5fd('0x4e')]['id']}})[_0xc5fd('0x2a')](handleEntityNotFound(_0x4b43fc,null))['then'](function(_0x3a89a9){if(_0x3a89a9){return _0x3a89a9[_0xc5fd('0x75')](_0x58df99[_0xc5fd('0x38')][_0xc5fd('0x71')])[_0xc5fd('0x2a')](function(){if(_[_0xc5fd('0x76')](_0x58df99[_0xc5fd('0x38')]['ids'])){for(var _0x9e84d2=0x0;_0x9e84d2<_0x58df99[_0xc5fd('0x38')][_0xc5fd('0x71')][_0xc5fd('0x3e')];_0x9e84d2+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x58df99['query'][_0xc5fd('0x71')][_0x9e84d2]),'VoicePrefixId':Number(_0x58df99[_0xc5fd('0x4e')]['id'])});}}else{socket[_0xc5fd('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x58df99[_0xc5fd('0x38')][_0xc5fd('0x71')]),'VoicePrefixId':Number(_0x58df99[_0xc5fd('0x4e')]['id'])});}});}})[_0xc5fd('0x2a')](respondWithStatusCode(_0x4b43fc,null))[_0xc5fd('0x49')](handleError(_0x4b43fc,null));};exports[_0xc5fd('0x77')]=function(_0x31fb3d,_0x5199f3,_0x32a6f3){var _0xe69dd8={};var _0x312b34={};var _0x38c97e;var _0x320249;return db[_0xc5fd('0x33')][_0xc5fd('0x78')]({'where':{'id':_0x31fb3d[_0xc5fd('0x4e')]['id']}})[_0xc5fd('0x2a')](handleEntityNotFound(_0x5199f3,null))[_0xc5fd('0x2a')](function(_0x4e67e7){if(_0x4e67e7){_0x38c97e=_0x4e67e7;_0x312b34[_0xc5fd('0x37')]=_[_0xc5fd('0x39')](db[_0xc5fd('0x79')][_0xc5fd('0x34')]);_0x312b34[_0xc5fd('0x38')]=_[_0xc5fd('0x39')](_0x31fb3d[_0xc5fd('0x38')]);_0x312b34['filters']=_[_0xc5fd('0x3b')](_0x312b34['model'],_0x312b34[_0xc5fd('0x38')]);_0xe69dd8[_0xc5fd('0x3c')]=_[_0xc5fd('0x3b')](_0x312b34[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x31fb3d[_0xc5fd('0x38')]['fields']));_0xe69dd8[_0xc5fd('0x3c')]=_0xe69dd8['attributes'][_0xc5fd('0x3e')]?_0xe69dd8[_0xc5fd('0x3c')]:_0x312b34['model'];_0xe69dd8[_0xc5fd('0x41')]=qs[_0xc5fd('0x42')](_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x42')]);_0xe69dd8[_0xc5fd('0x43')]=qs[_0xc5fd('0x3a')](_[_0xc5fd('0x44')](_0x31fb3d[_0xc5fd('0x38')],_0x312b34[_0xc5fd('0x3a')]));if(_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x7a')]){_0xe69dd8[_0xc5fd('0x43')]=_['merge'](_0xe69dd8[_0xc5fd('0x43')],{'$or':_['map'](_0xe69dd8[_0xc5fd('0x3c')],function(_0xcab6e8){var _0x5951b4={};_0x5951b4[_0xcab6e8]={'$like':'%'+_0x31fb3d['query'][_0xc5fd('0x7a')]+'%'};return _0x5951b4;})});}_0xe69dd8=_['merge']({},_0xe69dd8,_0x31fb3d['options']);return _0x38c97e[_0xc5fd('0x77')](_0xe69dd8);}})[_0xc5fd('0x2a')](function(_0x58b8ce){if(_0x58b8ce){_0x320249=_0x58b8ce[_0xc5fd('0x3e')];if(!_0x31fb3d[_0xc5fd('0x38')]['hasOwnProperty'](_0xc5fd('0x40'))){_0xe69dd8[_0xc5fd('0x24')]=qs[_0xc5fd('0x24')](_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x24')]);_0xe69dd8[_0xc5fd('0x22')]=qs[_0xc5fd('0x22')](_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x22')]);}return _0x38c97e['getAgents'](_0xe69dd8);}})[_0xc5fd('0x2a')](function(_0x41d546){if(_0x41d546){return _0x41d546?{'count':_0x320249,'rows':_0x41d546}:null;}})[_0xc5fd('0x2a')](respondWithResult(_0x5199f3,null))[_0xc5fd('0x49')](handleError(_0x5199f3,null));};exports[_0xc5fd('0x7b')]=function(_0x3260de,_0x52f4a2,_0x3b04bb){var _0x54625d={};var _0x8cc5f6={};var _0x1f8bec;var _0x5cccd3;return db[_0xc5fd('0x33')][_0xc5fd('0x78')]({'where':{'id':_0x3260de['params']['id']}})['then'](handleEntityNotFound(_0x52f4a2,null))[_0xc5fd('0x2a')](function(_0x588469){if(_0x588469){_0x1f8bec=_0x588469;_0x8cc5f6[_0xc5fd('0x37')]=_[_0xc5fd('0x39')](db[_0xc5fd('0x7c')][_0xc5fd('0x34')]);_0x8cc5f6[_0xc5fd('0x38')]=_['keys'](_0x3260de[_0xc5fd('0x38')]);_0x8cc5f6[_0xc5fd('0x3a')]=_[_0xc5fd('0x3b')](_0x8cc5f6['model'],_0x8cc5f6[_0xc5fd('0x38')]);_0x54625d[_0xc5fd('0x3c')]=_['intersection'](_0x8cc5f6[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x3260de['query'][_0xc5fd('0x3d')]));_0x54625d[_0xc5fd('0x3c')]=_0x54625d[_0xc5fd('0x3c')][_0xc5fd('0x3e')]?_0x54625d[_0xc5fd('0x3c')]:_0x8cc5f6[_0xc5fd('0x37')];_0x54625d['order']=qs[_0xc5fd('0x42')](_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x42')]);_0x54625d[_0xc5fd('0x43')]=qs[_0xc5fd('0x3a')](_[_0xc5fd('0x44')](_0x3260de['query'],_0x8cc5f6[_0xc5fd('0x3a')]));if(_0x3260de[_0xc5fd('0x38')]['filter']){_0x54625d[_0xc5fd('0x43')]=_[_0xc5fd('0x45')](_0x54625d[_0xc5fd('0x43')],{'$or':_[_0xc5fd('0x32')](_0x54625d[_0xc5fd('0x3c')],function(_0x431e42){var _0x147657={};_0x147657[_0x431e42]={'$like':'%'+_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x7a')]+'%'};return _0x147657;})});}_0x54625d=_[_0xc5fd('0x45')]({},_0x54625d,_0x3260de['options']);return _0x1f8bec[_0xc5fd('0x7b')](_0x54625d);}})[_0xc5fd('0x2a')](function(_0x815f86){if(_0x815f86){_0x5cccd3=_0x815f86[_0xc5fd('0x3e')];if(!_0x3260de[_0xc5fd('0x38')]['hasOwnProperty'](_0xc5fd('0x40'))){_0x54625d[_0xc5fd('0x24')]=qs[_0xc5fd('0x24')](_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x24')]);_0x54625d[_0xc5fd('0x22')]=qs[_0xc5fd('0x22')](_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x22')]);}return _0x1f8bec['getTeams'](_0x54625d);}})[_0xc5fd('0x2a')](function(_0x1e9c2c){if(_0x1e9c2c){return _0x1e9c2c?{'count':_0x5cccd3,'rows':_0x1e9c2c}:null;}})[_0xc5fd('0x2a')](respondWithResult(_0x52f4a2,null))[_0xc5fd('0x49')](handleError(_0x52f4a2,null));};exports['addTeams']=function(_0x1e5d78,_0x4bcd48,_0x5afaf5){var _0x5e0206=_0x1e5d78['body'][_0xc5fd('0x71')];var _0x5a3c8c;return db[_0xc5fd('0x7c')][_0xc5fd('0x7d')]({'where':{'id':_0x5e0206},'attributes':['id'],'include':[{'model':db[_0xc5fd('0x79')],'as':'Agents','attributes':['id',_0xc5fd('0x30'),'online','voicePause','interface'],'raw':!![]}]})[_0xc5fd('0x2a')](function(_0x1cb1a6){if(_0x1cb1a6){_0x5a3c8c=_0x1cb1a6;var _0x358648=_['flatMap'](_0x1cb1a6,function(_0x56a5d0){var _0x2bf91e=_0x56a5d0[_0xc5fd('0x2b')]({'plain':!![]});return _0x2bf91e['Agents'];});return db[_0xc5fd('0x33')][_0xc5fd('0x4d')]({'where':{'id':_0x1e5d78['params']['id']}})[_0xc5fd('0x2a')](function(_0x3c94ec){return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x3bd95a){return _0x3c94ec[_0xc5fd('0x7e')](_0x5e0206,{'transaction':_0x3bd95a})[_0xc5fd('0x2a')](function(){return BPromise[_0xc5fd('0x7f')](_0x5a3c8c,function(_0x1e23e7){return db[_0xc5fd('0x80')][_0xc5fd('0x81')]({'TeamId':_0x1e23e7['id'],'VoicePrefixId':_0x1e5d78[_0xc5fd('0x4e')]['id']},{'transaction':_0x3bd95a});});})['then'](function(){return BPromise[_0xc5fd('0x7f')](_0x358648,function(_0x4c3fbb){return db[_0xc5fd('0x82')][_0xc5fd('0x83')]({'where':{'UserId':_0x4c3fbb['id'],'VoicePrefixId':_0x1e5d78[_0xc5fd('0x4e')]['id']},'transaction':_0x3bd95a});});})['then'](function(){_0x358648[_0xc5fd('0x84')](function(_0x5a438e){socket[_0xc5fd('0x74')](_0xc5fd('0x85'),{'UserId':_0x5a438e['id'],'VoicePrefixId':_0x3c94ec['id']});});});});});}})[_0xc5fd('0x2a')](respondWithStatusCode(_0x4bcd48,null))[_0xc5fd('0x49')](handleError(_0x4bcd48,null));};exports[_0xc5fd('0x86')]=function(_0x4065d9,_0xf709eb,_0x241693){return db[_0xc5fd('0x7c')][_0xc5fd('0x7d')]({'where':{'id':_0x4065d9[_0xc5fd('0x38')][_0xc5fd('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc5fd('0x79')],'as':_0xc5fd('0x87'),'attributes':['id'],'raw':!![]}]})[_0xc5fd('0x2a')](handleEntityNotFound(_0xf709eb,null))[_0xc5fd('0x2a')](function(_0x2fb5f4){var _0x281c9e=_[_0xc5fd('0x32')](_0x2fb5f4,'id');var _0x5ca2a9=[];var _0x6594ae=[];var _0x1af269=squel[_0xc5fd('0x88')]();_0x1af269[_0xc5fd('0x89')](_0xc5fd('0x8a'))['from'](_0xc5fd('0x8b'),'tq')['join'](_0xc5fd('0x8c'),'ut',_0xc5fd('0x8d'))['where']('VoicePrefixId\x20=\x20?',_0x4065d9[_0xc5fd('0x4e')]['id']);for(var _0x4debb8=0x0;_0x4debb8<_0x2fb5f4[_0xc5fd('0x3e')];_0x4debb8+=0x1){let _0x474579=_0x2fb5f4[_0x4debb8];for(var _0x2ab188=0x0;_0x2ab188<_0x474579['Agents']['length'];_0x2ab188+=0x1){let _0x516a64=_0x474579[_0xc5fd('0x87')][_0x2ab188];var _0x41a3b6=_0x1af269[_0xc5fd('0x8e')]();_0x41a3b6[_0xc5fd('0x43')](_0xc5fd('0x8f'),_0x516a64['id']);_0x6594ae[_0xc5fd('0x68')](db[_0xc5fd('0x51')][_0xc5fd('0x38')](_0x41a3b6[_0xc5fd('0x90')](),{'type':db[_0xc5fd('0x51')][_0xc5fd('0x91')][_0xc5fd('0x92')]})[_0xc5fd('0x2a')](function(_0x492f78){if(_0x492f78[_0xc5fd('0x3e')]===0x1){return _0x516a64['id'];}else{var _0x12e1a8=_[_0xc5fd('0x93')](_[_0xc5fd('0x32')](_0x492f78,'TeamId'),function(_0x4751af){return _[_0xc5fd('0x94')](_0x281c9e,_0x4751af);});if(_0x12e1a8){return _0x516a64['id'];}}}));}}return BPromise[_0xc5fd('0x95')](_0x6594ae)[_0xc5fd('0x2a')](function(_0x2917b5){_0x5ca2a9=_(_0x5ca2a9)[_0xc5fd('0x96')](_0x2917b5)[_0xc5fd('0x97')]()[_0xc5fd('0x98')]();return db[_0xc5fd('0x33')][_0xc5fd('0x4d')]({'where':{'id':_0x4065d9['params']['id']}})[_0xc5fd('0x2a')](function(_0x21526e){return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x2456d8){return _0x21526e['removeTeams'](_0x4065d9[_0xc5fd('0x38')][_0xc5fd('0x71')],{'transaction':_0x2456d8})['then'](function(){if(!_[_0xc5fd('0x99')](_0x5ca2a9)){return _0x21526e['removeAgents'](_0x5ca2a9,{'transaction':_0x2456d8});}})[_0xc5fd('0x2a')](function(){_0x5ca2a9['forEach'](function(_0x233398){socket[_0xc5fd('0x74')]('userVoicePrefix:remove',{'UserId':_0x233398,'VoicePrefixId':_0x21526e['id']});});});});});});})['then'](respondWithStatusCode(_0xf709eb,null))['catch'](handleError(_0xf709eb,null));}; \ No newline at end of file +var _0xcf66=['error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','emit','userVoicePrefix:remove','findOne','User','getAgents','Team','getTeams','online','voicePause','interface','flatMap','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','isEmpty','removeAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','VoicePrefixes','UserProfileResource','sendStatus'];(function(_0x4c1aa6,_0x3a7155){var _0x1db755=function(_0x3a48b7){while(--_0x3a48b7){_0x4c1aa6['push'](_0x4c1aa6['shift']());}};_0x1db755(++_0x3a7155);}(_0xcf66,0x71));var _0x6cf6=function(_0xd49374,_0x4afcdb){_0xd49374=_0xd49374-0x0;var _0x5cdb2d=_0xcf66[_0xd49374];return _0x5cdb2d;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6cf6('0x14')]=_[_0x6cf6('0x15')](config[_0x6cf6('0x14')],{'host':_0x6cf6('0x16'),'port':0x18eb});var socket=require(_0x6cf6('0x17'))(new Redis(config[_0x6cf6('0x14')]));require('./voicePrefix.socket')[_0x6cf6('0x18')](socket);function respondWithStatusCode(_0x494ece,_0x4dbae8){_0x4dbae8=_0x4dbae8||0xcc;return function(_0x18360e){if(_0x18360e){return _0x494ece['sendStatus'](_0x4dbae8);}return _0x494ece[_0x6cf6('0x19')](_0x4dbae8)[_0x6cf6('0x1a')]();};}function respondWithResult(_0x2d23ab,_0x74486a){_0x74486a=_0x74486a||0xc8;return function(_0x2b6d7b){if(_0x2b6d7b){return _0x2d23ab[_0x6cf6('0x19')](_0x74486a)[_0x6cf6('0x1b')](_0x2b6d7b);}};}function respondWithFilteredResult(_0x39ec25,_0x18c2f9){return function(_0x2ca2b1){if(_0x2ca2b1){var _0x5e8b11=typeof _0x18c2f9[_0x6cf6('0x1c')]===_0x6cf6('0x1d')&&typeof _0x18c2f9[_0x6cf6('0x1e')]==='undefined';var _0x18abd9=_0x2ca2b1[_0x6cf6('0x1f')];var _0x101e39=_0x5e8b11?0x0:_0x18c2f9[_0x6cf6('0x1c')];var _0x440634=_0x5e8b11?_0x2ca2b1[_0x6cf6('0x1f')]:_0x18c2f9[_0x6cf6('0x1c')]+_0x18c2f9['limit'];var _0x19f2cd;if(_0x440634>=_0x18abd9){_0x440634=_0x18abd9;_0x19f2cd=0xc8;}else{_0x19f2cd=0xce;}_0x39ec25[_0x6cf6('0x19')](_0x19f2cd);return _0x39ec25[_0x6cf6('0x20')](_0x6cf6('0x21'),_0x101e39+'-'+_0x440634+'/'+_0x18abd9)[_0x6cf6('0x1b')](_0x2ca2b1);}return null;};}function patchUpdates(_0x470ea4){return function(_0x41344f){try{jsonpatch[_0x6cf6('0x22')](_0x41344f,_0x470ea4,!![]);}catch(_0x5b2767){return BPromise['reject'](_0x5b2767);}return _0x41344f[_0x6cf6('0x23')]();};}function saveUpdates(_0x59f838,_0x45ce6e){return function(_0x18c8cd){if(_0x18c8cd){return _0x18c8cd[_0x6cf6('0x24')](_0x59f838)[_0x6cf6('0x25')](function(_0x3f9871){return _0x3f9871;});}return null;};}function removeEntity(_0x565fad,_0x1c966e){return function(_0x4e0e85){if(_0x4e0e85){return _0x4e0e85[_0x6cf6('0x26')]()[_0x6cf6('0x25')](function(){var _0x3eaa31=_0x4e0e85['get']({'plain':!![]});var _0xf4eec5=_0x6cf6('0x27');return db[_0x6cf6('0x28')][_0x6cf6('0x26')]({'where':{'type':_0xf4eec5,'resourceId':_0x3eaa31['id']}})['then'](function(){return _0x4e0e85;});})['then'](function(){_0x565fad[_0x6cf6('0x19')](0xcc)[_0x6cf6('0x1a')]();});}};}function handleEntityNotFound(_0x57099f,_0x5869e9){return function(_0x5ccc8f){if(!_0x5ccc8f){_0x57099f[_0x6cf6('0x29')](0x194);}return _0x5ccc8f;};}function handleError(_0x52717d,_0x4ceeb9){_0x4ceeb9=_0x4ceeb9||0x1f4;return function(_0x519a70){logger[_0x6cf6('0x2a')](_0x519a70[_0x6cf6('0x2b')]);if(_0x519a70[_0x6cf6('0x2c')]){delete _0x519a70[_0x6cf6('0x2c')];}_0x52717d[_0x6cf6('0x19')](_0x4ceeb9)['send'](_0x519a70);};}exports[_0x6cf6('0x2d')]=function(_0x2ae422,_0x356340){var _0x535b28={},_0x3c4b7a={},_0x145363={'count':0x0,'rows':[]};var _0xfcb0e5=_[_0x6cf6('0x2e')](db[_0x6cf6('0x2f')][_0x6cf6('0x30')],function(_0x11f66d){return{'name':_0x11f66d[_0x6cf6('0x31')],'type':_0x11f66d[_0x6cf6('0x32')][_0x6cf6('0x33')]};});_0x3c4b7a[_0x6cf6('0x34')]=_[_0x6cf6('0x2e')](_0xfcb0e5,_0x6cf6('0x2c'));_0x3c4b7a[_0x6cf6('0x35')]=_[_0x6cf6('0x36')](_0x2ae422[_0x6cf6('0x35')]);_0x3c4b7a[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x3c4b7a['model'],_0x3c4b7a[_0x6cf6('0x35')]);_0x535b28[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x3c4b7a[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x3a')]));_0x535b28[_0x6cf6('0x39')]=_0x535b28[_0x6cf6('0x39')][_0x6cf6('0x3b')]?_0x535b28[_0x6cf6('0x39')]:_0x3c4b7a['model'];if(!_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x3c')](_0x6cf6('0x3d'))){_0x535b28[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x1e')]);_0x535b28[_0x6cf6('0x1c')]=qs[_0x6cf6('0x1c')](_0x2ae422['query'][_0x6cf6('0x1c')]);}_0x535b28[_0x6cf6('0x3e')]=qs[_0x6cf6('0x3f')](_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x3f')]);_0x535b28[_0x6cf6('0x40')]=qs[_0x6cf6('0x37')](_[_0x6cf6('0x41')](_0x2ae422[_0x6cf6('0x35')],_0x3c4b7a['filters']),_0xfcb0e5);if(_0x2ae422[_0x6cf6('0x35')]['filter']){_0x535b28[_0x6cf6('0x40')]=_[_0x6cf6('0x42')](_0x535b28[_0x6cf6('0x40')],{'$or':_[_0x6cf6('0x2e')](_0xfcb0e5,function(_0x2cf96b){if(_0x2cf96b[_0x6cf6('0x32')]!==_0x6cf6('0x43')){var _0x26b817={};_0x26b817[_0x2cf96b['name']]={'$like':'%'+_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x44')]+'%'};return _0x26b817;}})});}_0x535b28=_['merge']({},_0x535b28,_0x2ae422[_0x6cf6('0x45')]);var _0x41c16a={'where':_0x535b28[_0x6cf6('0x40')]};return db['VoicePrefix'][_0x6cf6('0x1f')](_0x41c16a)[_0x6cf6('0x25')](function(_0x51d915){_0x145363[_0x6cf6('0x1f')]=_0x51d915;if(_0x2ae422[_0x6cf6('0x35')][_0x6cf6('0x46')]){_0x535b28[_0x6cf6('0x47')]=[{'all':!![]}];}return db[_0x6cf6('0x2f')][_0x6cf6('0x48')](_0x535b28);})[_0x6cf6('0x25')](function(_0x5a2ef8){_0x145363[_0x6cf6('0x49')]=_0x5a2ef8;return _0x145363;})['then'](respondWithFilteredResult(_0x356340,_0x535b28))[_0x6cf6('0x4a')](handleError(_0x356340,null));};exports[_0x6cf6('0x4b')]=function(_0x4927d4,_0x18efca){var _0x14dd21={'raw':![],'where':{'id':_0x4927d4[_0x6cf6('0x4c')]['id']}},_0x235f37={};_0x235f37[_0x6cf6('0x34')]=_['keys'](db[_0x6cf6('0x2f')][_0x6cf6('0x30')]);_0x235f37[_0x6cf6('0x35')]=_['keys'](_0x4927d4[_0x6cf6('0x35')]);_0x235f37[_0x6cf6('0x37')]=_[_0x6cf6('0x38')](_0x235f37['model'],_0x235f37[_0x6cf6('0x35')]);_0x14dd21['attributes']=_['intersection'](_0x235f37[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x4927d4[_0x6cf6('0x35')][_0x6cf6('0x3a')]));_0x14dd21[_0x6cf6('0x39')]=_0x14dd21[_0x6cf6('0x39')][_0x6cf6('0x3b')]?_0x14dd21[_0x6cf6('0x39')]:_0x235f37[_0x6cf6('0x34')];if(_0x4927d4[_0x6cf6('0x35')][_0x6cf6('0x46')]){_0x14dd21[_0x6cf6('0x47')]=[{'all':!![]}];}_0x14dd21=_[_0x6cf6('0x42')]({},_0x14dd21,_0x4927d4['options']);return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')](_0x14dd21)['then'](handleEntityNotFound(_0x18efca,null))['then'](respondWithResult(_0x18efca,null))[_0x6cf6('0x4a')](handleError(_0x18efca,null));};exports[_0x6cf6('0x26')]=function(_0x1db524,_0x20a106){return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x1db524['params']['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x20a106,null))[_0x6cf6('0x25')](removeEntity(_0x20a106,null))[_0x6cf6('0x4a')](handleError(_0x20a106,null));};exports['describe']=function(_0x5df6d3,_0x211b89){return db[_0x6cf6('0x2f')][_0x6cf6('0x4e')]()[_0x6cf6('0x25')](respondWithResult(_0x211b89,null))[_0x6cf6('0x4a')](handleError(_0x211b89,null));};exports[_0x6cf6('0x4f')]=function(_0x2cb470,_0x3e8aee){var _0x3800fe;return db[_0x6cf6('0x50')]['transaction'](function(_0x217072){return db[_0x6cf6('0x2f')][_0x6cf6('0x4f')](_0x2cb470[_0x6cf6('0x51')],{'transaction':_0x217072})[_0x6cf6('0x25')](function(_0x31947d){_0x3800fe=_0x31947d[_0x6cf6('0x52')]({'plain':!![]});return db[_0x6cf6('0x53')][_0x6cf6('0x4d')]({'where':{'id':_0x3800fe[_0x6cf6('0x54')]},'raw':!![]})[_0x6cf6('0x25')](function(_0x4fb831){return createVoicePrefixExtensions(_0x3800fe,_0x4fb831,_0x217072);});});})[_0x6cf6('0x25')](function(){var _0x4ec56b=_0x2cb470[_0x6cf6('0x55')][_0x6cf6('0x52')]({'plain':!![]});if(!_0x4ec56b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec56b[_0x6cf6('0x56')]===_0x6cf6('0x55')){var _0x4699d5=_0x3800fe;return db[_0x6cf6('0x57')][_0x6cf6('0x4d')]({'where':{'name':_0x6cf6('0x27'),'userProfileId':_0x4ec56b['userProfileId']},'raw':!![]})[_0x6cf6('0x25')](function(_0x167356){if(_0x167356&&_0x167356[_0x6cf6('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x4699d5[_0x6cf6('0x2c')],'resourceId':_0x4699d5['id'],'type':_0x167356[_0x6cf6('0x2c')],'sectionId':_0x167356['id']},{})['then'](function(){return _0x3800fe;});}else{return _0x3800fe;}})[_0x6cf6('0x4a')](function(_0x3559ab){logger[_0x6cf6('0x2a')](_0x6cf6('0x59'),_0x3559ab);throw _0x3559ab;});}return _0x3800fe;})[_0x6cf6('0x25')](respondWithResult(_0x3e8aee,null))['catch'](handleError(_0x3e8aee,null));};function Extension(_0x3e7e5b,_0x40b31f,_0x57f26b,_0x4cd6fe){this[_0x6cf6('0x5a')]=_0x6cf6('0x5b');this[_0x6cf6('0x5c')]=_0x3e7e5b;this[_0x6cf6('0x5d')]=_0x57f26b;this[_0x6cf6('0x32')]='system';this['description']=_0x6cf6('0x5e');this[_0x6cf6('0x5f')]=_0x40b31f;this[_0x6cf6('0x60')]=_0x4cd6fe;}function createVoicePrefixExtensions(_0x238002,_0xf8c052,_0x591a24){return new BPromise(function(_0x51dfcf,_0x52df24){var _0x39c857=new Extension(formatPrefixName(_0x238002[_0x6cf6('0x61')]),0x1,_0x6cf6('0x62'),_0x6cf6('0x63'));_0x39c857['VoicePrefixId']=_0x238002['id'];return db[_0x6cf6('0x53')]['create'](_0x39c857,{'transaction':_0x591a24})[_0x6cf6('0x25')](function(_0x54ef08){var _0x3842ff=_0x54ef08[_0x6cf6('0x52')]({'plain':!![]});var _0x2f2ee3=_[_0x6cf6('0x2e')](addVoicePrefixExtensions(_0x238002,_0xf8c052),function(_0x38ebcc){_0x38ebcc['VoiceExtensionId']=_0x3842ff['id'];_0x38ebcc[_0x6cf6('0x64')]=_0x238002['id'];return _0x38ebcc;});return db['VoiceExtension'][_0x6cf6('0x65')](_0x2f2ee3,{'transaction':_0x591a24})['then'](function(_0x4363f7){if(!_0x4363f7){return _0x52df24('Extensions\x20creation\x20failed');}else{return _0x51dfcf(_0x4363f7);}})[_0x6cf6('0x4a')](function(_0x42daab){return _0x52df24(_0x42daab);});});;});};function addVoicePrefixExtensions(_0x5df21f,_0x3b4cb){var _0x15ae6c=[];var _0x1c98c2=formatPrefixName(_0x5df21f[_0x6cf6('0x61')]);_0x15ae6c[_0x6cf6('0x66')](new Extension(_0x1c98c2,0x2,_0x6cf6('0x67'),_0x6cf6('0x68')+_0x5df21f['name']));if(_0x5df21f['callerIdAll']){_0x15ae6c[_0x6cf6('0x66')](new Extension(_0x1c98c2,0x3,_0x6cf6('0x67'),'PREFIX-CALLERIDALL='+_0x5df21f[_0x6cf6('0x69')]));}else{_0x15ae6c['push'](new Extension(_0x1c98c2,0x3,'NoOp',_0x6cf6('0x6a')));}_0x15ae6c['push'](new Extension(_0x1c98c2,0x4,'goto',_0x3b4cb[_0x6cf6('0x5a')]+','+_0x6cf6('0x6b')+(0x8+_0x5df21f[_0x6cf6('0x2c')]['length'])+'}'+','+0x1));return _0x15ae6c;}function formatPrefixName(_0x18b60c){var _0x4a2451='_';for(var _0x2dedba=0x0;_0x2dedba<_0x18b60c[_0x6cf6('0x3b')];_0x2dedba++){if(_0x18b60c['charAt'](_0x2dedba)=='-'){_0x4a2451+=_0x18b60c[_0x6cf6('0x6c')](_0x2dedba);}else{_0x4a2451+='['+_0x18b60c[_0x6cf6('0x6c')](_0x2dedba)+']';}}_0x4a2451+='.';return _0x4a2451;}exports[_0x6cf6('0x24')]=function(_0x421819,_0xa36ee1,_0x40ea5e){var _0x59180d=_0x421819[_0x6cf6('0x51')];_0x59180d[_0x6cf6('0x61')]=_0x6cf6('0x6d')+_0x59180d[_0x6cf6('0x2c')]+'-';return db[_0x6cf6('0x50')][_0x6cf6('0x6e')](function(_0x55ea84){return db['VoicePrefix']['update'](_0x59180d,{'where':{'id':_0x59180d['id']},'transaction':_0x55ea84})[_0x6cf6('0x25')](function(){return db['VoiceExtension'][_0x6cf6('0x26')]({'where':{'VoicePrefixId':_0x59180d['id']},'transaction':_0x55ea84})['then'](function(){return db[_0x6cf6('0x53')][_0x6cf6('0x4d')]({'where':{'id':_0x59180d['VoiceExtensionId']},'raw':!![]})[_0x6cf6('0x25')](function(_0xd11d4b){return createVoicePrefixExtensions(_0x59180d,_0xd11d4b,_0x55ea84);});});});})[_0x6cf6('0x25')](function(){return db['VoicePrefix'][_0x6cf6('0x6f')](_0x59180d['id']);})['then'](respondWithResult(_0xa36ee1,null))[_0x6cf6('0x4a')](handleError(_0xa36ee1,null));};exports[_0x6cf6('0x70')]=function(_0x1635dc,_0x308076,_0x33b436){return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x1635dc['params']['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x308076,null))['then'](function(_0x3f3d67){if(_0x3f3d67){return _0x3f3d67[_0x6cf6('0x70')](_0x1635dc[_0x6cf6('0x51')][_0x6cf6('0x71')],_['omit'](_0x1635dc['body'],[_0x6cf6('0x71'),'id'])||{})[_0x6cf6('0x72')](function(_0x1a0c49){for(var _0x3060d=0x0;_0x3060d<_0x1635dc[_0x6cf6('0x51')][_0x6cf6('0x71')]['length'];_0x3060d+=0x1){socket['emit'](_0x6cf6('0x73'),{'UserId':Number(_0x1635dc['body'][_0x6cf6('0x71')][_0x3060d]),'VoicePrefixId':Number(_0x1635dc[_0x6cf6('0x4c')]['id'])});}return _0x1a0c49;});}})[_0x6cf6('0x25')](respondWithResult(_0x308076,null))[_0x6cf6('0x4a')](handleError(_0x308076,null));};exports['removeAgents']=function(_0x4435bc,_0x4c5f0d,_0x49cf03){return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x4435bc['params']['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x4c5f0d,null))[_0x6cf6('0x25')](function(_0x37fa59){if(_0x37fa59){return _0x37fa59['removeAgents'](_0x4435bc[_0x6cf6('0x35')][_0x6cf6('0x71')])[_0x6cf6('0x25')](function(){if(_['isArray'](_0x4435bc['query'][_0x6cf6('0x71')])){for(var _0x5189b6=0x0;_0x5189b6<_0x4435bc['query'][_0x6cf6('0x71')][_0x6cf6('0x3b')];_0x5189b6+=0x1){socket[_0x6cf6('0x74')](_0x6cf6('0x75'),{'UserId':Number(_0x4435bc[_0x6cf6('0x35')][_0x6cf6('0x71')][_0x5189b6]),'VoicePrefixId':Number(_0x4435bc[_0x6cf6('0x4c')]['id'])});}}else{socket[_0x6cf6('0x74')](_0x6cf6('0x75'),{'UserId':Number(_0x4435bc['query'][_0x6cf6('0x71')]),'VoicePrefixId':Number(_0x4435bc[_0x6cf6('0x4c')]['id'])});}});}})[_0x6cf6('0x25')](respondWithStatusCode(_0x4c5f0d,null))['catch'](handleError(_0x4c5f0d,null));};exports['getAgents']=function(_0x38b830,_0x169a33,_0x204f3d){var _0x1c254d={};var _0x38652f={};var _0x1fee93;var _0x5e953e;return db[_0x6cf6('0x2f')][_0x6cf6('0x76')]({'where':{'id':_0x38b830[_0x6cf6('0x4c')]['id']}})[_0x6cf6('0x25')](handleEntityNotFound(_0x169a33,null))[_0x6cf6('0x25')](function(_0x260a62){if(_0x260a62){_0x1fee93=_0x260a62;_0x38652f[_0x6cf6('0x34')]=_['keys'](db[_0x6cf6('0x77')][_0x6cf6('0x30')]);_0x38652f['query']=_[_0x6cf6('0x36')](_0x38b830[_0x6cf6('0x35')]);_0x38652f[_0x6cf6('0x37')]=_['intersection'](_0x38652f[_0x6cf6('0x34')],_0x38652f[_0x6cf6('0x35')]);_0x1c254d[_0x6cf6('0x39')]=_[_0x6cf6('0x38')](_0x38652f[_0x6cf6('0x34')],qs[_0x6cf6('0x3a')](_0x38b830['query']['fields']));_0x1c254d['attributes']=_0x1c254d[_0x6cf6('0x39')]['length']?_0x1c254d[_0x6cf6('0x39')]:_0x38652f[_0x6cf6('0x34')];_0x1c254d['order']=qs[_0x6cf6('0x3f')](_0x38b830[_0x6cf6('0x35')][_0x6cf6('0x3f')]);_0x1c254d[_0x6cf6('0x40')]=qs[_0x6cf6('0x37')](_['pick'](_0x38b830[_0x6cf6('0x35')],_0x38652f[_0x6cf6('0x37')]));if(_0x38b830[_0x6cf6('0x35')]['filter']){_0x1c254d['where']=_[_0x6cf6('0x42')](_0x1c254d[_0x6cf6('0x40')],{'$or':_[_0x6cf6('0x2e')](_0x1c254d[_0x6cf6('0x39')],function(_0x296664){var _0x1841b5={};_0x1841b5[_0x296664]={'$like':'%'+_0x38b830[_0x6cf6('0x35')]['filter']+'%'};return _0x1841b5;})});}_0x1c254d=_[_0x6cf6('0x42')]({},_0x1c254d,_0x38b830[_0x6cf6('0x45')]);return _0x1fee93[_0x6cf6('0x78')](_0x1c254d);}})['then'](function(_0x27c0cb){if(_0x27c0cb){_0x5e953e=_0x27c0cb[_0x6cf6('0x3b')];if(!_0x38b830[_0x6cf6('0x35')][_0x6cf6('0x3c')]('nolimit')){_0x1c254d[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x38b830[_0x6cf6('0x35')][_0x6cf6('0x1e')]);_0x1c254d[_0x6cf6('0x1c')]=qs[_0x6cf6('0x1c')](_0x38b830[_0x6cf6('0x35')]['offset']);}return _0x1fee93['getAgents'](_0x1c254d);}})['then'](function(_0x5b1385){if(_0x5b1385){return _0x5b1385?{'count':_0x5e953e,'rows':_0x5b1385}:null;}})[_0x6cf6('0x25')](respondWithResult(_0x169a33,null))[_0x6cf6('0x4a')](handleError(_0x169a33,null));};exports['getTeams']=function(_0x165121,_0x16f407,_0x558601){var _0x41b355={};var _0x4fb1d9={};var _0x5b4b7c;var _0x267856;return db[_0x6cf6('0x2f')][_0x6cf6('0x76')]({'where':{'id':_0x165121[_0x6cf6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16f407,null))[_0x6cf6('0x25')](function(_0x12196d){if(_0x12196d){_0x5b4b7c=_0x12196d;_0x4fb1d9['model']=_[_0x6cf6('0x36')](db[_0x6cf6('0x79')]['rawAttributes']);_0x4fb1d9[_0x6cf6('0x35')]=_['keys'](_0x165121[_0x6cf6('0x35')]);_0x4fb1d9['filters']=_[_0x6cf6('0x38')](_0x4fb1d9[_0x6cf6('0x34')],_0x4fb1d9['query']);_0x41b355[_0x6cf6('0x39')]=_['intersection'](_0x4fb1d9['model'],qs[_0x6cf6('0x3a')](_0x165121[_0x6cf6('0x35')][_0x6cf6('0x3a')]));_0x41b355[_0x6cf6('0x39')]=_0x41b355['attributes'][_0x6cf6('0x3b')]?_0x41b355[_0x6cf6('0x39')]:_0x4fb1d9[_0x6cf6('0x34')];_0x41b355[_0x6cf6('0x3e')]=qs[_0x6cf6('0x3f')](_0x165121[_0x6cf6('0x35')][_0x6cf6('0x3f')]);_0x41b355[_0x6cf6('0x40')]=qs[_0x6cf6('0x37')](_[_0x6cf6('0x41')](_0x165121[_0x6cf6('0x35')],_0x4fb1d9[_0x6cf6('0x37')]));if(_0x165121[_0x6cf6('0x35')][_0x6cf6('0x44')]){_0x41b355[_0x6cf6('0x40')]=_[_0x6cf6('0x42')](_0x41b355[_0x6cf6('0x40')],{'$or':_[_0x6cf6('0x2e')](_0x41b355[_0x6cf6('0x39')],function(_0x44ec79){var _0x506275={};_0x506275[_0x44ec79]={'$like':'%'+_0x165121[_0x6cf6('0x35')][_0x6cf6('0x44')]+'%'};return _0x506275;})});}_0x41b355=_[_0x6cf6('0x42')]({},_0x41b355,_0x165121[_0x6cf6('0x45')]);return _0x5b4b7c[_0x6cf6('0x7a')](_0x41b355);}})[_0x6cf6('0x25')](function(_0x1013cb){if(_0x1013cb){_0x267856=_0x1013cb['length'];if(!_0x165121['query']['hasOwnProperty'](_0x6cf6('0x3d'))){_0x41b355['limit']=qs[_0x6cf6('0x1e')](_0x165121[_0x6cf6('0x35')]['limit']);_0x41b355['offset']=qs[_0x6cf6('0x1c')](_0x165121['query'][_0x6cf6('0x1c')]);}return _0x5b4b7c[_0x6cf6('0x7a')](_0x41b355);}})[_0x6cf6('0x25')](function(_0x1ff190){if(_0x1ff190){return _0x1ff190?{'count':_0x267856,'rows':_0x1ff190}:null;}})[_0x6cf6('0x25')](respondWithResult(_0x16f407,null))[_0x6cf6('0x4a')](handleError(_0x16f407,null));};exports['addTeams']=function(_0x14cafd,_0x43e3ff,_0x5bf895){var _0x42098b=_0x14cafd[_0x6cf6('0x51')]['ids'];var _0x200234;return db[_0x6cf6('0x79')][_0x6cf6('0x48')]({'where':{'id':_0x42098b},'attributes':['id'],'include':[{'model':db[_0x6cf6('0x77')],'as':'Agents','attributes':['id',_0x6cf6('0x2c'),_0x6cf6('0x7b'),_0x6cf6('0x7c'),_0x6cf6('0x7d')],'raw':!![]}]})['then'](function(_0xc0ecf4){if(_0xc0ecf4){_0x200234=_0xc0ecf4;var _0x17b193=_[_0x6cf6('0x7e')](_0xc0ecf4,function(_0x2b083f){var _0x54422f=_0x2b083f['get']({'plain':!![]});return _0x54422f[_0x6cf6('0x7f')];});return db[_0x6cf6('0x2f')][_0x6cf6('0x4d')]({'where':{'id':_0x14cafd[_0x6cf6('0x4c')]['id']}})['then'](function(_0x4a5e51){return db[_0x6cf6('0x50')][_0x6cf6('0x6e')](function(_0xb9cbc3){return _0x4a5e51[_0x6cf6('0x80')](_0x42098b,{'transaction':_0xb9cbc3})[_0x6cf6('0x25')](function(){return BPromise[_0x6cf6('0x81')](_0x200234,function(_0x53f0a3){return db[_0x6cf6('0x82')][_0x6cf6('0x83')]({'TeamId':_0x53f0a3['id'],'VoicePrefixId':_0x14cafd[_0x6cf6('0x4c')]['id']},{'transaction':_0xb9cbc3});});})[_0x6cf6('0x25')](function(){return BPromise[_0x6cf6('0x81')](_0x17b193,function(_0x450ffb){return db[_0x6cf6('0x84')][_0x6cf6('0x85')]({'where':{'UserId':_0x450ffb['id'],'VoicePrefixId':_0x14cafd[_0x6cf6('0x4c')]['id']},'transaction':_0xb9cbc3});});})[_0x6cf6('0x25')](function(){_0x17b193[_0x6cf6('0x86')](function(_0x476abd){socket[_0x6cf6('0x74')](_0x6cf6('0x73'),{'UserId':_0x476abd['id'],'VoicePrefixId':_0x4a5e51['id']});});});});});}})[_0x6cf6('0x25')](respondWithStatusCode(_0x43e3ff,null))[_0x6cf6('0x4a')](handleError(_0x43e3ff,null));};exports['removeTeams']=function(_0x17b497,_0x1f5c50,_0x46ecdb){return db['Team']['findAll']({'where':{'id':_0x17b497['query'][_0x6cf6('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6cf6('0x25')](handleEntityNotFound(_0x1f5c50,null))[_0x6cf6('0x25')](function(_0x41aae0){var _0x208719=_['map'](_0x41aae0,'id');var _0x395343=[];var _0x4669b2=[];var _0x91f143=squel[_0x6cf6('0x87')]();_0x91f143[_0x6cf6('0x88')](_0x6cf6('0x89'))[_0x6cf6('0x8a')](_0x6cf6('0x8b'),'tq')[_0x6cf6('0x8c')](_0x6cf6('0x8d'),'ut',_0x6cf6('0x8e'))[_0x6cf6('0x40')](_0x6cf6('0x8f'),_0x17b497['params']['id']);for(var _0x210578=0x0;_0x210578<_0x41aae0['length'];_0x210578+=0x1){let _0xeff7c=_0x41aae0[_0x210578];for(var _0x5e90f0=0x0;_0x5e90f0<_0xeff7c[_0x6cf6('0x7f')][_0x6cf6('0x3b')];_0x5e90f0+=0x1){let _0x193ad7=_0xeff7c['Agents'][_0x5e90f0];var _0x50def2=_0x91f143[_0x6cf6('0x90')]();_0x50def2[_0x6cf6('0x40')](_0x6cf6('0x91'),_0x193ad7['id']);_0x4669b2[_0x6cf6('0x66')](db['sequelize']['query'](_0x50def2[_0x6cf6('0x92')](),{'type':db['sequelize'][_0x6cf6('0x93')][_0x6cf6('0x94')]})[_0x6cf6('0x25')](function(_0x279675){if(_0x279675[_0x6cf6('0x3b')]===0x1){return _0x193ad7['id'];}else{var _0x3e0d2d=_[_0x6cf6('0x95')](_[_0x6cf6('0x2e')](_0x279675,'TeamId'),function(_0x414e9e){return _[_0x6cf6('0x96')](_0x208719,_0x414e9e);});if(_0x3e0d2d){return _0x193ad7['id'];}}}));}}return BPromise[_0x6cf6('0x97')](_0x4669b2)[_0x6cf6('0x25')](function(_0x1b32e6){_0x395343=_(_0x395343)['union'](_0x1b32e6)[_0x6cf6('0x98')]()['value']();return db['VoicePrefix'][_0x6cf6('0x4d')]({'where':{'id':_0x17b497['params']['id']}})['then'](function(_0x2ca336){return db[_0x6cf6('0x50')][_0x6cf6('0x6e')](function(_0x3a1d61){return _0x2ca336['removeTeams'](_0x17b497[_0x6cf6('0x35')]['ids'],{'transaction':_0x3a1d61})[_0x6cf6('0x25')](function(){if(!_[_0x6cf6('0x99')](_0x395343)){return _0x2ca336[_0x6cf6('0x9a')](_0x395343,{'transaction':_0x3a1d61});}})[_0x6cf6('0x25')](function(){_0x395343[_0x6cf6('0x86')](function(_0x48e595){socket[_0x6cf6('0x74')](_0x6cf6('0x75'),{'UserId':_0x48e595,'VoicePrefixId':_0x2ca336['id']});});});});});});})[_0x6cf6('0x25')](respondWithStatusCode(_0x1f5c50,null))[_0x6cf6('0x4a')](handleError(_0x1f5c50,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 242ddc0..c8aad2f 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 _0x32a5=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x19d610,_0x1bc8c9){var _0xd25be0=function(_0x334779){while(--_0x334779){_0x19d610['push'](_0x19d610['shift']());}};_0xd25be0(++_0x1bc8c9);}(_0x32a5,0xfb));var _0x532a=function(_0x2537cf,_0x24d9fc){_0x2537cf=_0x2537cf-0x0;var _0x95a8d5=_0x32a5[_0x2537cf];return _0x95a8d5;};'use strict';var EventEmitter=require(_0x532a('0x0'));var VoicePrefix=require(_0x532a('0x1'))['db'][_0x532a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x532a('0x3')](0x0);var events={'afterCreate':_0x532a('0x4'),'afterUpdate':_0x532a('0x5'),'afterDestroy':_0x532a('0x6')};function emitEvent(_0x199165){return function(_0x5d2945,_0x3a18e3,_0x46ad09){VoicePrefixEvents[_0x532a('0x7')](_0x199165+':'+_0x5d2945['id'],_0x5d2945);VoicePrefixEvents[_0x532a('0x7')](_0x199165,_0x5d2945);_0x46ad09(null);};}for(var e in events){if(events[_0x532a('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xbcd2=['hasOwnProperty','setMaxListeners','save','update','remove','emit'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xbcd2,0x85));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2bcd('0x0')](0x0);var events={'afterCreate':_0x2bcd('0x1'),'afterUpdate':_0x2bcd('0x2'),'afterDestroy':_0x2bcd('0x3')};function emitEvent(_0x133528){return function(_0x55df7b,_0x345a5e,_0x38a368){VoicePrefixEvents[_0x2bcd('0x4')](_0x133528+':'+_0x55df7b['id'],_0x55df7b);VoicePrefixEvents[_0x2bcd('0x4')](_0x133528,_0x55df7b);_0x38a368(null);};}for(var e in events){if(events[_0x2bcd('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index bc27d57..f84127b 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 _0x44fa=['define','VoicePrefix','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x4d4f00,_0x26cd13){var _0x170bd5=function(_0x390de9){while(--_0x390de9){_0x4d4f00['push'](_0x4d4f00['shift']());}};_0x170bd5(++_0x26cd13);}(_0x44fa,0x152));var _0xa44f=function(_0x24cbce,_0xaa1cd){_0x24cbce=_0x24cbce-0x0;var _0x514ec7=_0x44fa[_0x24cbce];return _0x514ec7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa44f('0x0'));var BPromise=require('bluebird');var rp=require(_0xa44f('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa44f('0x2'));var config=require(_0xa44f('0x3'));var attributes=require(_0xa44f('0x4'));module[_0xa44f('0x5')]=function(_0x4c04cb,_0x2a380a){return _0x4c04cb[_0xa44f('0x6')](_0xa44f('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c39=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x2a8c0b,_0x58bf04){var _0x5878ec=function(_0x59fe7f){while(--_0x59fe7f){_0x2a8c0b['push'](_0x2a8c0b['shift']());}};_0x5878ec(++_0x58bf04);}(_0x2c39,0x7c));var _0x92c3=function(_0xfee10f,_0x53470e){_0xfee10f=_0xfee10f-0x0;var _0xb91051=_0x2c39[_0xfee10f];return _0xb91051;};'use strict';var _=require(_0x92c3('0x0'));var util=require(_0x92c3('0x1'));var logger=require(_0x92c3('0x2'))(_0x92c3('0x3'));var moment=require(_0x92c3('0x4'));var BPromise=require(_0x92c3('0x5'));var rp=require(_0x92c3('0x6'));var fs=require('fs');var path=require(_0x92c3('0x7'));var rimraf=require(_0x92c3('0x8'));var config=require(_0x92c3('0x9'));var attributes=require(_0x92c3('0xa'));module['exports']=function(_0x5b63bd,_0xaface2){return _0x5b63bd[_0x92c3('0xb')](_0x92c3('0xc'),attributes,{'tableName':_0x92c3('0xd'),'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 48b4e6c..2f16733 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 _0xa498=['socket.io-emitter','./voicePrefix.socket','register','request','then','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x34646f,_0x55a313){var _0x490624=function(_0x327c4f){while(--_0x327c4f){_0x34646f['push'](_0x34646f['shift']());}};_0x490624(++_0x55a313);}(_0xa498,0x179));var _0x8a49=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0xa498[_0x3d00db];return _0x41f115;};'use strict';var _=require(_0x8a49('0x0'));var util=require(_0x8a49('0x1'));var moment=require(_0x8a49('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a49('0x3'));var fs=require('fs');var Redis=require(_0x8a49('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a49('0x5'));var logger=require(_0x8a49('0x6'))(_0x8a49('0x7'));var config=require(_0x8a49('0x8'));var jayson=require(_0x8a49('0x9'));var client=jayson[_0x8a49('0xa')]['http']({'port':0x232a});config[_0x8a49('0xb')]=_['defaults'](config['redis'],{'host':_0x8a49('0xc'),'port':0x18eb});var socket=require(_0x8a49('0xd'))(new Redis(config[_0x8a49('0xb')]));require(_0x8a49('0xe'))[_0x8a49('0xf')](socket);function respondWithRpcPromise(_0x1e098e,_0x49dca9,_0x2ae425){return new BPromise(function(_0x224a4b,_0x19f10a){return client[_0x8a49('0x10')](_0x1e098e,_0x2ae425)[_0x8a49('0x11')](function(_0x59885a){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x49dca9,_0x8a49('0x12'));logger['debug'](_0x8a49('0x13'),_0x49dca9,'request\x20sent',JSON['stringify'](_0x59885a));if(_0x59885a[_0x8a49('0x14')]){if(_0x59885a[_0x8a49('0x14')]['code']===0x1f4){logger[_0x8a49('0x14')](_0x8a49('0x15'),_0x49dca9,_0x59885a['error'][_0x8a49('0x16')]);return _0x19f10a(_0x59885a[_0x8a49('0x14')]['message']);}logger[_0x8a49('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x49dca9,_0x59885a[_0x8a49('0x14')]['message']);return _0x224a4b(_0x59885a['error']['message']);}else{logger[_0x8a49('0x17')](_0x8a49('0x15'),_0x49dca9,'request\x20sent');_0x224a4b(_0x59885a[_0x8a49('0x18')][_0x8a49('0x16')]);}})[_0x8a49('0x19')](function(_0xc4bd0b){logger[_0x8a49('0x14')](_0x8a49('0x15'),_0x49dca9,_0xc4bd0b);_0x19f10a(_0xc4bd0b);});});} \ No newline at end of file +var _0xfba8=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d0ea8,_0x2ceb1a){var _0xe1b503=function(_0x149cca){while(--_0x149cca){_0x4d0ea8['push'](_0x4d0ea8['shift']());}};_0xe1b503(++_0x2ceb1a);}(_0xfba8,0x1d6));var _0x8fba=function(_0x3d27d0,_0x4823ab){_0x3d27d0=_0x3d27d0-0x0;var _0x254699=_0xfba8[_0x3d27d0];return _0x254699;};'use strict';var _=require(_0x8fba('0x0'));var util=require(_0x8fba('0x1'));var moment=require(_0x8fba('0x2'));var BPromise=require(_0x8fba('0x3'));var rs=require(_0x8fba('0x4'));var fs=require('fs');var Redis=require(_0x8fba('0x5'));var db=require(_0x8fba('0x6'))['db'];var utils=require(_0x8fba('0x7'));var logger=require(_0x8fba('0x8'))('rpc');var config=require(_0x8fba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8fba('0xa')][_0x8fba('0xb')]({'port':0x232a});config[_0x8fba('0xc')]=_[_0x8fba('0xd')](config[_0x8fba('0xc')],{'host':_0x8fba('0xe'),'port':0x18eb});var socket=require(_0x8fba('0xf'))(new Redis(config['redis']));require(_0x8fba('0x10'))['register'](socket);function respondWithRpcPromise(_0x352eda,_0x228103,_0x3816fc){return new BPromise(function(_0x139921,_0x47dda0){return client[_0x8fba('0x11')](_0x352eda,_0x3816fc)[_0x8fba('0x12')](function(_0x526513){logger[_0x8fba('0x13')](_0x8fba('0x14'),_0x228103,'request\x20sent');logger['debug'](_0x8fba('0x15'),_0x228103,'request\x20sent',JSON[_0x8fba('0x16')](_0x526513));if(_0x526513[_0x8fba('0x17')]){if(_0x526513[_0x8fba('0x17')][_0x8fba('0x18')]===0x1f4){logger[_0x8fba('0x17')](_0x8fba('0x14'),_0x228103,_0x526513['error']['message']);return _0x47dda0(_0x526513[_0x8fba('0x17')][_0x8fba('0x19')]);}logger[_0x8fba('0x17')](_0x8fba('0x14'),_0x228103,_0x526513[_0x8fba('0x17')][_0x8fba('0x19')]);return _0x139921(_0x526513['error'][_0x8fba('0x19')]);}else{logger[_0x8fba('0x13')](_0x8fba('0x14'),_0x228103,_0x8fba('0x1a'));_0x139921(_0x526513[_0x8fba('0x1b')][_0x8fba('0x19')]);}})[_0x8fba('0x1c')](function(_0x1e9cf9){logger['error'](_0x8fba('0x14'),_0x228103,_0x1e9cf9);_0x47dda0(_0x1e9cf9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 25e0d7c..1f9041d 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 _0xc125=['register','save','update','emit','removeListener'];(function(_0x5ab105,_0x2d43a4){var _0x33054e=function(_0x1b99d7){while(--_0x1b99d7){_0x5ab105['push'](_0x5ab105['shift']());}};_0x33054e(++_0x2d43a4);}(_0xc125,0x150));var _0x5c12=function(_0x5a080c,_0x20a58b){_0x5a080c=_0x5a080c-0x0;var _0x195330=_0xc125[_0x5a080c];return _0x195330;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x5c12('0x0'),'remove',_0x5c12('0x1')];function createListener(_0x44b9de,_0x2b4f53){return function(_0x2423dc){_0x2b4f53[_0x5c12('0x2')](_0x44b9de,_0x2423dc);};}function removeListener(_0x46f293,_0x31bd53){return function(){VoicePrefixEvents[_0x5c12('0x3')](_0x46f293,_0x31bd53);};}exports[_0x5c12('0x4')]=function(_0x3f1c8b){for(var _0x1a1608=0x0,_0x11ace0=events['length'];_0x1a1608<_0x11ace0;_0x1a1608++){var _0x1d0635=events[_0x1a1608];var _0x4465e3=createListener('voicePrefix:'+_0x1d0635,_0x3f1c8b);VoicePrefixEvents['on'](_0x1d0635,_0x4465e3);}}; \ No newline at end of file +var _0x2917=['length','voicePrefix:','./voicePrefix.events','save','remove','update','removeListener','register'];(function(_0xa5d2e9,_0x8c03a8){var _0x2bf37b=function(_0x242c0d){while(--_0x242c0d){_0xa5d2e9['push'](_0xa5d2e9['shift']());}};_0x2bf37b(++_0x8c03a8);}(_0x2917,0x142));var _0x7291=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x2917[_0x59162a];return _0x35e50d;};'use strict';var VoicePrefixEvents=require(_0x7291('0x0'));var events=[_0x7291('0x1'),_0x7291('0x2'),_0x7291('0x3')];function createListener(_0x37515c,_0x398f9f){return function(_0x90e67){_0x398f9f['emit'](_0x37515c,_0x90e67);};}function removeListener(_0x5d5d51,_0x22afb9){return function(){VoicePrefixEvents[_0x7291('0x4')](_0x5d5d51,_0x22afb9);};}exports[_0x7291('0x5')]=function(_0x6aac19){for(var _0x1ee790=0x0,_0x237997=events[_0x7291('0x6')];_0x1ee790<_0x237997;_0x1ee790++){var _0x1f0fd8=events[_0x1ee790];var _0x452fc5=createListener(_0x7291('0x7')+_0x1f0fd8,_0x6aac19);VoicePrefixEvents['on'](_0x1f0fd8,_0x452fc5);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 9514b24..16b011d 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x5cbb32,_0x233ace){var _0x49363c=function(_0x4649d1){while(--_0x4649d1){_0x5cbb32['push'](_0x5cbb32['shift']());}};_0x49363c(++_0x233ace);}(_0xb10b,0x12a));var _0xbb10=function(_0x3be82b,_0x3ef4fb){_0x3be82b=_0x3be82b-0x0;var _0x293c0e=_0xb10b[_0x3be82b];return _0x293c0e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _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(_0x1f997b,_0x316cc8){var _0xc879f2=function(_0x5e6da3){while(--_0x5e6da3){_0x1f997b['push'](_0x1f997b['shift']());}};_0xc879f2(++_0x316cc8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 3f4ad70..e4d786d 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 _0x4304=['Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','preview','booked','roundrobin','INTEGER','ENUM','yes','once','join','periodic_announce','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4304,0x16d));var _0x4430=function(_0x1c57ed,_0x4c9ffd){_0x1c57ed=_0x1c57ed-0x0;var _0x50100e=_0x4304[_0x1c57ed];return _0x50100e;};'use strict';var Sequelize=require(_0x4430('0x0'));module[_0x4430('0x1')]={'name':{'type':Sequelize[_0x4430('0x2')],'allowNull':![],'unique':_0x4430('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x4430('0x4'),_0x4430('0x5')),'allowNull':![],'defaultValue':_0x4430('0x4')},'musiconhold':{'type':Sequelize[_0x4430('0x2')],'defaultValue':_0x4430('0x6')},'announce':{'type':Sequelize[_0x4430('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x4430('0x7'),_0x4430('0x8'),_0x4430('0x9'),'random',_0x4430('0xa'),_0x4430('0xb'),'wrandom',_0x4430('0xc')),'allowNull':![],'defaultValue':_0x4430('0x7'),'set':function(_0x1936fa){this[_0x4430('0xd')](_0x4430('0xe'),_0x1936fa?_0x1936fa:'rrmemory');},'get':function(){var _0x556ead=this['getDataValue']('type');var _0x123f38=this[_0x4430('0xf')]('dialMethod');var _0x46455d=this['getDataValue']('strategy');if(_0x556ead===_0x4430('0x5')){if(_0x123f38===_0x4430('0x10')){return null;}if(_0x123f38===_0x4430('0x11')&&![_0x4430('0xa'),_0x4430('0x12')]['includes'](_0x46455d)){this[_0x4430('0xd')](_0x4430('0xe'),_0x4430('0xa'));}}return _0x46455d;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4430('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4430('0x13')](0xb)},'timeout':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4430('0x2')]},'weight':{'type':Sequelize[_0x4430('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4430('0x14')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4430('0x13')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x4430('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4430('0x14')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4430('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':_0x4430('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x4430('0x15'),'no',_0x4430('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4430('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x4430('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4430('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4430('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4430('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4430('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x4430('0x2')]},'queue_less_than':{'type':Sequelize[_0x4430('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0xeeabe){this[_0x4430('0xd')]('periodic_announce',_0xeeabe?_0xeeabe[_0x4430('0x17')](','):[]);},'get':function(){return this[_0x4430('0xf')](_0x4430('0x18'))?this[_0x4430('0xf')]('periodic_announce')[_0x4430('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x4430('0x2')],'defaultValue':_0x4430('0x15'),'set':function(_0xc84642){this[_0x4430('0xd')](_0x4430('0x1a'),_0xc84642?_0xc84642[_0x4430('0x17')](','):undefined);},'get':function(){return this[_0x4430('0xf')](_0x4430('0x1a'))?this[_0x4430('0xf')](_0x4430('0x1a'))[_0x4430('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4430('0x2')],'defaultValue':'no','set':function(_0x252ca3){this[_0x4430('0xd')]('leavewhenempty',_0x252ca3?_0x252ca3[_0x4430('0x17')](','):undefined);},'get':function(){return this[_0x4430('0xf')](_0x4430('0x1b'))?this[_0x4430('0xf')](_0x4430('0x1b'))[_0x4430('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4430('0x14')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4430('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x11d611){this[_0x4430('0xd')](_0x4430('0x1c'),_0x11d611);if(_0x11d611){if(this['getDataValue'](_0x4430('0x1d'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4430('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4430('0x1e')],'defaultValue':0x0,'comment':_0x4430('0x1f')},'dialMethod':{'type':Sequelize[_0x4430('0x14')]('preview',_0x4430('0x20'),_0x4430('0x21'),_0x4430('0x22'),_0x4430('0x11')),'defaultValue':'progressive','comment':_0x4430('0x23')},'dialLimitChannel':{'type':Sequelize[_0x4430('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4430('0x24')},'dialLimitQueue':{'type':Sequelize[_0x4430('0x13')](0x4)[_0x4430('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4430('0x26')},'dialPowerLevel':{'type':Sequelize[_0x4430('0x27')](0x2)[_0x4430('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4430('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x29'),'dropRate'),'defaultValue':'dropRate','comment':_0x4430('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x4430('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4430('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x4430('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x4430('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4430('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x4430('0x2')],'defaultValue':_0x4430('0x2d'),'comment':_0x4430('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x4430('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x3,'comment':_0x4430('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4430('0x33')},'dialTimezone':{'type':Sequelize[_0x4430('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4430('0x2')],'defaultValue':_0x4430('0x34')},'dialPrefix':{'type':Sequelize[_0x4430('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x35'),_0x4430('0x36'),_0x4430('0x37')),'defaultValue':_0x4430('0x35')},'dialAMDActive':{'type':Sequelize[_0x4430('0x1e')],'defaultValue':0x0,'comment':_0x4430('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x4430('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4430('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4430('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4430('0x13')](0x9)[_0x4430('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4430('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4430('0x13')](0x9)[_0x4430('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4430('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x4430('0x13')](0x9)[_0x4430('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4430('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4430('0x13')](0x9)[_0x4430('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4430('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x4430('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4430('0x13')](0x5)[_0x4430('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4430('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4430('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4430('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x4430('0x13')](0x5)[_0x4430('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4430('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4430('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4430('0x14')](_0x4430('0x42'),_0x4430('0x43')),'defaultValue':_0x4430('0x42')},'dialQueueProject2':{'type':Sequelize[_0x4430('0x2')],'comment':_0x4430('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4430('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4430('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4430('0x44')},'dialCutDigit':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4430('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4430('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4430('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4430('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)[_0x4430('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4430('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4430('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4430('0x13')](0x5)[_0x4430('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4430('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4430('0x13')],'allowNull':!![],'comment':_0x4430('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4430('0x4e'),'set':function(_0x1e0da9){if(!_0x1e0da9)this['setDataValue'](_0x4430('0x4f'),null);this[_0x4430('0xd')](_0x4430('0x50'),_0x1e0da9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4430('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4430('0x13')](0x3)[_0x4430('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4430('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x8f3e=['UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','ringall','fewestcalls','rrmemory','linear','wrandom','getDataValue','dialMethod','strategy','booked','roundrobin','includes','setDataValue','INTEGER','yes','all','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','progressive','power','predictive','Dial\x20Method.'];(function(_0x4ba8df,_0x5ab338){var _0x24ac87=function(_0x8cd0dd){while(--_0x8cd0dd){_0x4ba8df['push'](_0x4ba8df['shift']());}};_0x24ac87(++_0x5ab338);}(_0x8f3e,0x11b));var _0xe8f3=function(_0x5b9949,_0x5cf975){_0x5b9949=_0x5b9949-0x0;var _0x48fe5a=_0x8f3e[_0x5b9949];return _0x48fe5a;};'use strict';var Sequelize=require(_0xe8f3('0x0'));module[_0xe8f3('0x1')]={'name':{'type':Sequelize[_0xe8f3('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xe8f3('0x4')},'musiconhold':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xe8f3('0x5'),'leastrecent',_0xe8f3('0x6'),'random',_0xe8f3('0x7'),_0xe8f3('0x8'),_0xe8f3('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x5d4698){this['setDataValue']('strategy',_0x5d4698?_0x5d4698:'rrmemory');},'get':function(){var _0xcd5361=this[_0xe8f3('0xa')]('type');var _0x2626c0=this[_0xe8f3('0xa')](_0xe8f3('0xb'));var _0x33eafe=this[_0xe8f3('0xa')](_0xe8f3('0xc'));if(_0xcd5361==='outbound'){if(_0x2626c0==='preview'){return null;}if(_0x2626c0===_0xe8f3('0xd')&&![_0xe8f3('0x7'),_0xe8f3('0xe')][_0xe8f3('0xf')](_0x33eafe)){this[_0xe8f3('0x10')](_0xe8f3('0xc'),'rrmemory');}}return _0x33eafe;}},'servicelevel':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe8f3('0x11')](0xb)},'timeout':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe8f3('0x11')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe8f3('0x12')},'autopause':{'type':Sequelize['ENUM'](_0xe8f3('0x12'),'no',_0xe8f3('0x13')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe8f3('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xe8f3('0x12'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xe8f3('0x12'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe8f3('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe8f3('0x12')},'announce_holdtime':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe8f3('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe8f3('0x2')]},'queue_youarenext':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe8f3('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe8f3('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe8f3('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xe8f3('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x23bdca){this[_0xe8f3('0x10')](_0xe8f3('0x14'),_0x23bdca?_0x23bdca[_0xe8f3('0x15')](','):[]);},'get':function(){return this[_0xe8f3('0xa')]('periodic_announce')?this[_0xe8f3('0xa')]('periodic_announce')[_0xe8f3('0x16')](','):[];}},'joinempty':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':'yes','set':function(_0x27542a){this[_0xe8f3('0x10')](_0xe8f3('0x17'),_0x27542a?_0x27542a[_0xe8f3('0x15')](','):undefined);},'get':function(){return this[_0xe8f3('0xa')](_0xe8f3('0x17'))?this['getDataValue'](_0xe8f3('0x17'))[_0xe8f3('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':'no','set':function(_0x3f2bc9){this[_0xe8f3('0x10')](_0xe8f3('0x18'),_0x3f2bc9?_0x3f2bc9[_0xe8f3('0x15')](','):undefined);},'get':function(){return this[_0xe8f3('0xa')]('leavewhenempty')?this['getDataValue'](_0xe8f3('0x18'))[_0xe8f3('0x16')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe8f3('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe8f3('0x11')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x12'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe8f3('0x2')]},'acw':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':0x0,'set':function(_0x4220b2){this[_0xe8f3('0x10')](_0xe8f3('0x1a'),_0x4220b2);if(_0x4220b2){if(this[_0xe8f3('0xa')]('wrapuptime')<0x2){this[_0xe8f3('0x10')](_0xe8f3('0x1b'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x1c'),_0xe8f3('0x1d'),_0xe8f3('0x1e'),_0xe8f3('0x1f'),_0xe8f3('0xd')),'defaultValue':'progressive','comment':_0xe8f3('0x20')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xe8f3('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe8f3('0x22')},'dialLimitQueue':{'type':Sequelize[_0xe8f3('0x11')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe8f3('0x23')},'dialPowerLevel':{'type':Sequelize[_0xe8f3('0x24')](0x2)[_0xe8f3('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe8f3('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0xe8f3('0x3')](_0xe8f3('0x26'),_0xe8f3('0x27')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe8f3('0x24')](0x2)[_0xe8f3('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe8f3('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0xe8f3('0x11')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe8f3('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe8f3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe8f3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x2a')},'dialQueueOptions':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':'tTxX','comment':_0xe8f3('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x2c')},'dialQueueProject':{'type':Sequelize[_0xe8f3('0x2')],'comment':_0xe8f3('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe8f3('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x30')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe8f3('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe8f3('0x21')],'defaultValue':0x3,'comment':_0xe8f3('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe8f3('0x11')](0x5)[_0xe8f3('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x33')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe8f3('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xe8f3('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xe8f3('0x35'),_0xe8f3('0x36'),'onlyIfOpen'),'defaultValue':_0xe8f3('0x35')},'dialAMDActive':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':0x0,'comment':_0xe8f3('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xe8f3('0x11')](0x9)[_0xe8f3('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe8f3('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xe8f3('0x11')](0x9)[_0xe8f3('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe8f3('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe8f3('0x11')](0x9)[_0xe8f3('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe8f3('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe8f3('0x11')](0x9)[_0xe8f3('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe8f3('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe8f3('0x11')](0x9)[_0xe8f3('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe8f3('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe8f3('0x11')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe8f3('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe8f3('0x11')](0x5)[_0xe8f3('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe8f3('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe8f3('0x11')](0x9)[_0xe8f3('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe8f3('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0xe8f3('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':0x0,'comment':_0xe8f3('0x40')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xe8f3('0x2')],'comment':_0xe8f3('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe8f3('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe8f3('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x43')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xe8f3('0x11')](0x5)[_0xe8f3('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe8f3('0x11')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe8f3('0x11')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x47')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe8f3('0x11')](0x5)[_0xe8f3('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe8f3('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe8f3('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe8f3('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':![],'comment':_0xe8f3('0x4c'),'set':function(_0x2cb796){if(!_0x2cb796)this[_0xe8f3('0x10')](_0xe8f3('0x4d'),null);this['setDataValue'](_0xe8f3('0x4e'),_0x2cb796);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe8f3('0x11')](0x3)[_0xe8f3('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe8f3('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe8f3('0x11')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe8f3('0x19')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index d8c2cf4..85085d5 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 _0xe14b=['QueueCampaigns','outbound','filter','map','value','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','UserProfileResource','clone','merge','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','interface','flatMap','penalty','sequelize','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','voicePause','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','squel','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','inbound'];(function(_0x14b9a2,_0x4a1d77){var _0xff0524=function(_0x4ef4cc){while(--_0x4ef4cc){_0x14b9a2['push'](_0x14b9a2['shift']());}};_0xff0524(++_0x4a1d77);}(_0xe14b,0x93));var _0xbe14=function(_0x3dce48,_0x2683b9){_0x3dce48=_0x3dce48-0x0;var _0x3e9a92=_0xe14b[_0x3dce48];return _0x3e9a92;};'use strict';var moment=require(_0xbe14('0x0'));var BPromise=require(_0xbe14('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0xbe14('0x2'));var Redis=require(_0xbe14('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe14('0x4'))('api');var config=require('../../config/environment');var db=require(_0xbe14('0x5'))['db'];config[_0xbe14('0x6')]=_[_0xbe14('0x7')](config[_0xbe14('0x6')],{'host':_0xbe14('0x8'),'port':0x18eb});var socket=require(_0xbe14('0x9'))(new Redis(config[_0xbe14('0x6')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x496063,_0x30c355){_0x30c355=_0x30c355||0xcc;return function(_0x6fceff){if(_0x6fceff){return _0x496063[_0xbe14('0xa')](_0x30c355);}return _0x496063[_0xbe14('0xb')](_0x30c355)['end']();};}function respondWithResult(_0x5b9fc6,_0x113243){_0x113243=_0x113243||0xc8;return function(_0x3f70cb){if(_0x3f70cb){return _0x5b9fc6['status'](_0x113243)[_0xbe14('0xc')](_0x3f70cb);}};}function respondWithFilteredResult(_0x35aa19,_0x886a5e){return function(_0x3d38c2){if(_0x3d38c2){var _0x27792f=typeof _0x886a5e[_0xbe14('0xd')]===_0xbe14('0xe')&&typeof _0x886a5e[_0xbe14('0xf')]===_0xbe14('0xe');var _0xa2cf72=_0x3d38c2[_0xbe14('0x10')];var _0x33fd54=_0x27792f?0x0:_0x886a5e[_0xbe14('0xd')];var _0x530538=_0x27792f?_0x3d38c2['count']:_0x886a5e[_0xbe14('0xd')]+_0x886a5e[_0xbe14('0xf')];var _0xf4ac9;if(_0x530538>=_0xa2cf72){_0x530538=_0xa2cf72;_0xf4ac9=0xc8;}else{_0xf4ac9=0xce;}_0x35aa19[_0xbe14('0xb')](_0xf4ac9);return _0x35aa19['set'](_0xbe14('0x11'),_0x33fd54+'-'+_0x530538+'/'+_0xa2cf72)[_0xbe14('0xc')](_0x3d38c2);}return null;};}function saveUpdates(_0xfd7b8f){return function(_0x123ede){if(_0x123ede){return _0x123ede[_0xbe14('0x12')](_0xfd7b8f)[_0xbe14('0x13')](function(_0x17ae86){return _0x17ae86;});}return null;};}function removeEntity(_0x5ea1f8){return function(_0x137ee5){if(_0x137ee5){return _0x137ee5[_0xbe14('0x14')]()[_0xbe14('0x13')](function(){var _0x433459=_0x137ee5[_0xbe14('0x15')]({'plain':!![]});var _0x37e4c1=[{'name':'VoiceQueues','value':_0xbe14('0x16'),'ignore':![]},{'name':_0xbe14('0x17'),'value':_0xbe14('0x18'),'ignore':![]}];var _0xc12977=_(_0x37e4c1)[_0xbe14('0x19')]('ignore')[_0xbe14('0x1a')]('value')[_0xbe14('0x1b')]();if(_['includes'](_0xc12977,_0x433459[_0xbe14('0x1c')])){return;}var _0x4a25fa=_[_0xbe14('0x1d')](_0x37e4c1,[_0xbe14('0x1b'),_0x433459['type']])[_0xbe14('0x1e')];return db['UserProfileResource'][_0xbe14('0x14')]({'where':{'type':_0x4a25fa,'resourceId':_0x433459['id']}})['then'](function(){return _0x137ee5;});})[_0xbe14('0x13')](function(){_0x5ea1f8[_0xbe14('0xb')](0xcc)[_0xbe14('0x1f')]();});}};}function handleEntityNotFound(_0x39cc81){return function(_0x15ef02){if(!_0x15ef02){_0x39cc81[_0xbe14('0xa')](0x194);}return _0x15ef02;};}function handleError(_0x55d001,_0x1822e0){_0x1822e0=_0x1822e0||0x1f4;return function(_0x1ba46a){logger[_0xbe14('0x20')](_0x1ba46a[_0xbe14('0x21')]);if(_0x1ba46a['name']){delete _0x1ba46a[_0xbe14('0x1e')];}_0x55d001[_0xbe14('0xb')](_0x1822e0)['send'](_0x1ba46a);};}exports[_0xbe14('0x22')]=function(_0x3b3e84,_0x1c7cc7){var _0x19252f={};var _0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x1a')](db[_0xbe14('0x23')][_0xbe14('0x24')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x25')],'type':_0x16a159[_0xbe14('0x1c')][_0xbe14('0x26')]};});_0x19252f=qs[_0xbe14('0x27')](_0x36d4b2,_0x3b3e84);var _0x223f7a={'where':_0x19252f[_0xbe14('0x28')]};return db[_0xbe14('0x23')][_0xbe14('0x10')](_0x223f7a)[_0xbe14('0x13')](function(_0x14e7c4){_0x34d648['count']=_0x14e7c4;_0x19252f[_0xbe14('0x29')]=qs['include'](_0x3b3e84['query']);return db[_0xbe14('0x23')]['findAll'](_0x19252f);})[_0xbe14('0x13')](function(_0x345b0){_0x34d648['rows']=_0x345b0;return _0x34d648;})['then'](respondWithFilteredResult(_0x1c7cc7,_0x19252f))['catch'](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x2a')]=function(_0xa3d24,_0x5f27b6){var _0x46c570={'raw':![],'where':{'id':_0xa3d24[_0xbe14('0x2b')]['id']}},_0x1faf3e={};_0x1faf3e[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['VoiceQueue']['rawAttributes']);_0x1faf3e[_0xbe14('0x2e')]=_['keys'](_0xa3d24['query']);_0x1faf3e['filters']=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],_0x1faf3e[_0xbe14('0x2e')]);_0x46c570[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x46c570[_0xbe14('0x30')]=_0x46c570[_0xbe14('0x30')][_0xbe14('0x32')]?_0x46c570['attributes']:_0x1faf3e['model'];if(_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x46c570[_0xbe14('0x29')]=[{'all':!![]}];}_0x46c570=_['merge']({},_0x46c570,_0xa3d24[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x46c570)[_0xbe14('0x13')](handleEntityNotFound(_0x5f27b6,null))[_0xbe14('0x13')](respondWithResult(_0x5f27b6,null))[_0xbe14('0x35')](handleError(_0x5f27b6,null));};exports[_0xbe14('0x36')]=function(_0x128843,_0x1b2608){return db['VoiceQueue'][_0xbe14('0x36')](_0x128843[_0xbe14('0x37')],{})[_0xbe14('0x13')](function(_0x1b3118){var _0x3287b9=_0x128843[_0xbe14('0x38')]['get']({'plain':!![]});if(!_0x3287b9)throw new Error(_0xbe14('0x39'));if(_0x3287b9[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x36263c=_0x1b3118['get']({'plain':!![]});var _0x4bfa96=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x5d5318=_[_0xbe14('0x1d')](_0x4bfa96,['value',_0x36263c['type']])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x5d5318,'userProfileId':_0x3287b9['userProfileId']},'raw':!![]})['then'](function(_0x5aaa4f){if(_0x5aaa4f&&_0x5aaa4f[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x36263c['name'],'resourceId':_0x36263c['id'],'type':_0x5aaa4f[_0xbe14('0x1e')],'sectionId':_0x5aaa4f['id']},{})[_0xbe14('0x13')](function(){return _0x1b3118;});}else{return _0x1b3118;}})[_0xbe14('0x35')](function(_0x3ab0f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab0f6);throw _0x3ab0f6;});}return _0x1b3118;})[_0xbe14('0x13')](respondWithResult(_0x1b2608,0xc9))[_0xbe14('0x35')](handleError(_0x1b2608,null));};exports[_0xbe14('0x3f')]=function(_0xb2b285,_0x2550dc){var _0x4f2d95={'where':{'id':_0xb2b285[_0xbe14('0x2b')]['id']}},_0x51023a={};_0x51023a[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x23')]['rawAttributes']);_0x4f2d95[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x51023a['model'],qs[_0xbe14('0x31')](_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x4f2d95[_0xbe14('0x30')]=_0x4f2d95['attributes']['length']?_0x4f2d95[_0xbe14('0x30')]:_0x51023a[_0xbe14('0x2c')];if(_0xb2b285['query']['includeAll']){_0x4f2d95[_0xbe14('0x29')]=[{'all':!![]}];}_0x4f2d95=_[_0xbe14('0x40')]({},_0x4f2d95,_0xb2b285[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x4f2d95)[_0xbe14('0x13')](handleEntityNotFound(_0x2550dc,null))[_0xbe14('0x13')](function(_0x5a4068){if(_0x5a4068){var _0xf32e93=_0x5a4068[_0xbe14('0x15')]({'plain':!![]});_0xf32e93=qs[_0xbe14('0x41')](_0xf32e93,['id',_0xbe14('0x42'),_0xbe14('0x43')]);_0xb2b285['body']=_[_0xbe14('0x41')](_0xb2b285[_0xbe14('0x37')],['id',_0xbe14('0x42'),_0xbe14('0x43')]);return db[_0xbe14('0x23')][_0xbe14('0x36')](_['merge'](_0xf32e93,_0xb2b285['body']),{'include':_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x33')]?[{'all':!![]}]:undefined})[_0xbe14('0x13')](function(_0x48554a){var _0x497b00=_0xb2b285[_0xbe14('0x38')][_0xbe14('0x15')]({'plain':!![]});if(!_0x497b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497b00[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x50c2a0=_0x48554a[_0xbe14('0x15')]({'plain':!![]});var _0x4a40d2=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x435c8d=_[_0xbe14('0x1d')](_0x4a40d2,['value',_0x50c2a0[_0xbe14('0x1c')]])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x435c8d,'userProfileId':_0x497b00[_0xbe14('0x44')]},'raw':!![]})['then'](function(_0x42a346){if(_0x42a346&&_0x42a346[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x50c2a0[_0xbe14('0x1e')],'resourceId':_0x50c2a0['id'],'type':_0x42a346[_0xbe14('0x1e')],'sectionId':_0x42a346['id']},{})[_0xbe14('0x13')](function(){return _0x48554a;});}else{return _0x48554a;}})['catch'](function(_0x72c875){logger[_0xbe14('0x20')](_0xbe14('0x45'),_0x72c875);throw _0x72c875;});}return _0x48554a;});}})[_0xbe14('0x13')](respondWithResult(_0x2550dc,0xc9))[_0xbe14('0x35')](handleError(_0x2550dc,null));};exports[_0xbe14('0x12')]=function(_0xd8f78f,_0x32df3c){if(_0xd8f78f[_0xbe14('0x37')]['id']){delete _0xd8f78f[_0xbe14('0x37')]['id'];}return db[_0xbe14('0x23')]['find']({'where':{'id':_0xd8f78f['params']['id']}})['then'](handleEntityNotFound(_0x32df3c,null))[_0xbe14('0x13')](saveUpdates(_0xd8f78f[_0xbe14('0x37')],null))[_0xbe14('0x13')](respondWithResult(_0x32df3c,null))[_0xbe14('0x35')](handleError(_0x32df3c,null));};exports[_0xbe14('0x14')]=function(_0x66ddf,_0x16ee48){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x66ddf[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x16ee48,null))[_0xbe14('0x13')](removeEntity(_0x16ee48,null))[_0xbe14('0x35')](handleError(_0x16ee48,null));};exports[_0xbe14('0x46')]=function(_0x1c831a,_0xcef8e3){var _0x179077={'raw':![],'where':{}};var _0x2225d9={};var _0x29761b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x1c831a[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xcef8e3,null))[_0xbe14('0x13')](function(_0x46b49c){if(_0x46b49c){_0x2225d9[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x47')][_0xbe14('0x24')]);_0x2225d9[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x1c831a['query']);_0x2225d9[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x2225d9[_0xbe14('0x2c')],_0x2225d9[_0xbe14('0x2e')]);_0x179077[_0xbe14('0x30')]=_['intersection'](_0x2225d9[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x179077[_0xbe14('0x30')]=_0x179077['attributes'][_0xbe14('0x32')]?_0x179077[_0xbe14('0x30')]:_0x2225d9[_0xbe14('0x2c')];if(!_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x179077[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x1c831a['query'][_0xbe14('0xf')]);_0x179077[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x179077[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x1c831a['query']['sort']);_0x179077[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x1c831a[_0xbe14('0x2e')],_0x2225d9[_0xbe14('0x48')]));_0x179077[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x46b49c['id'];if(_0x1c831a[_0xbe14('0x2e')]['filter']){_0x179077['where']=_[_0xbe14('0x40')](_0x179077[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x179077['attributes'],function(_0x76e91e){var _0x16bca1={};_0x16bca1[_0x76e91e]={'$like':'%'+_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x16bca1;})});}_0x179077=_[_0xbe14('0x40')]({},_0x179077,_0x1c831a[_0xbe14('0x34')]);return db[_0xbe14('0x47')]['count']({'where':_0x179077[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x3baa26){_0x29761b[_0xbe14('0x10')]=_0x3baa26;if(_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x179077[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopper'][_0xbe14('0x4f')](_0x179077);})[_0xbe14('0x13')](function(_0x3cd17e){_0x29761b[_0xbe14('0x50')]=_0x3cd17e;return _0x29761b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0xcef8e3,_0x179077))[_0xbe14('0x35')](handleError(_0xcef8e3,null));};exports[_0xbe14('0x51')]=function(_0xd756b2,_0x5d064e){var _0x1e5ce1={'raw':!![],'where':{}};var _0x401968={};var _0x362999={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0xd756b2[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d064e,null))[_0xbe14('0x13')](function(_0x175213){if(_0x175213){_0x401968[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperHistory'][_0xbe14('0x24')]);_0x401968[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0xd756b2[_0xbe14('0x2e')]);_0x401968[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x401968[_0xbe14('0x2c')],_0x401968['query']);_0x1e5ce1[_0xbe14('0x30')]=_['intersection'](_0x401968[_0xbe14('0x2c')],qs['fields'](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e5ce1[_0xbe14('0x30')]=_0x1e5ce1['attributes'][_0xbe14('0x32')]?_0x1e5ce1[_0xbe14('0x30')]:_0x401968[_0xbe14('0x2c')];if(!_0xd756b2['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e5ce1[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0xd756b2['query'][_0xbe14('0xf')]);_0x1e5ce1[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x1e5ce1[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0xd756b2['query'][_0xbe14('0x4c')]);_0x1e5ce1[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0xd756b2[_0xbe14('0x2e')],_0x401968[_0xbe14('0x48')]));_0x1e5ce1[_0xbe14('0x28')]['VoiceQueueId']=_0x175213['id'];if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e5ce1['where']=_[_0xbe14('0x40')](_0x1e5ce1['where'],{'$or':_[_0xbe14('0x1a')](_0x1e5ce1[_0xbe14('0x30')],function(_0x4dfa19){var _0x55d729={};_0x55d729[_0x4dfa19]={'$like':'%'+_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x55d729;})});}_0x1e5ce1=_[_0xbe14('0x40')]({},_0x1e5ce1,_0xd756b2['options']);return db[_0xbe14('0x53')][_0xbe14('0x10')]({'where':_0x1e5ce1[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x5ee624){_0x362999['count']=_0x5ee624;if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x1e5ce1[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x53')][_0xbe14('0x4f')](_0x1e5ce1);})[_0xbe14('0x13')](function(_0x139aab){_0x362999['rows']=_0x139aab;return _0x362999;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x5d064e,_0x1e5ce1))['catch'](handleError(_0x5d064e,null));};exports[_0xbe14('0x54')]=function(_0x3a01bb,_0x8d47f2){var _0x2382c4={'raw':!![],'where':{}};var _0x55a3ae={};var _0x1e160b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3a01bb['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x8d47f2,null))[_0xbe14('0x13')](function(_0x4090bc){if(_0x4090bc){_0x55a3ae[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x55')][_0xbe14('0x24')]);_0x55a3ae[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x3a01bb[_0xbe14('0x2e')]);_0x55a3ae[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],_0x55a3ae[_0xbe14('0x2e')]);_0x2382c4[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x2382c4['attributes']=_0x2382c4[_0xbe14('0x30')]['length']?_0x2382c4[_0xbe14('0x30')]:_0x55a3ae[_0xbe14('0x2c')];if(!_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x2382c4['limit']=qs['limit'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x2382c4[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x3a01bb['query'][_0xbe14('0xd')]);}_0x2382c4[_0xbe14('0x4b')]=qs['sort'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x2382c4[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x3a01bb[_0xbe14('0x2e')],_0x55a3ae['filters']));_0x2382c4['where'][_0xbe14('0x4e')]=_0x4090bc['id'];if(_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x2382c4[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x2382c4['where'],{'$or':_[_0xbe14('0x1a')](_0x2382c4[_0xbe14('0x30')],function(_0x5dc793){var _0x4e35ed={};_0x4e35ed[_0x5dc793]={'$like':'%'+_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x4e35ed;})});}_0x2382c4=_['merge']({},_0x2382c4,_0x3a01bb[_0xbe14('0x34')]);return db['CmHopperFinal'][_0xbe14('0x10')]({'where':_0x2382c4['where']})[_0xbe14('0x13')](function(_0x5d4431){_0x1e160b[_0xbe14('0x10')]=_0x5d4431;if(_0x3a01bb['query'][_0xbe14('0x33')]){_0x2382c4[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2382c4);})[_0xbe14('0x13')](function(_0x4db7e8){_0x1e160b['rows']=_0x4db7e8;return _0x1e160b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x8d47f2,_0x2382c4))[_0xbe14('0x35')](handleError(_0x8d47f2,null));};exports[_0xbe14('0x56')]=function(_0x11c341,_0x1a780a){var _0x313a87={'raw':!![],'where':{}};var _0x30d2b0={};var _0x57ad22={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x11c341[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1a780a,null))['then'](function(_0x26372a){if(_0x26372a){_0x30d2b0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperBlack'][_0xbe14('0x24')]);_0x30d2b0[_0xbe14('0x2e')]=_['keys'](_0x11c341[_0xbe14('0x2e')]);_0x30d2b0['filters']=_[_0xbe14('0x2f')](_0x30d2b0[_0xbe14('0x2c')],_0x30d2b0[_0xbe14('0x2e')]);_0x313a87['attributes']=_[_0xbe14('0x2f')](_0x30d2b0['model'],qs[_0xbe14('0x31')](_0x11c341['query']['fields']));_0x313a87[_0xbe14('0x30')]=_0x313a87['attributes'][_0xbe14('0x32')]?_0x313a87['attributes']:_0x30d2b0[_0xbe14('0x2c')];if(!_0x11c341[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x313a87[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x313a87[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x313a87[_0xbe14('0x4b')]=qs['sort'](_0x11c341[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x313a87[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x11c341['query'],_0x30d2b0['filters']));_0x313a87[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x26372a['id'];if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x313a87[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x313a87[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x313a87[_0xbe14('0x30')],function(_0x26e7a7){var _0x761b3d={};_0x761b3d[_0x26e7a7]={'$like':'%'+_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x761b3d;})});}_0x313a87=_[_0xbe14('0x40')]({},_0x313a87,_0x11c341[_0xbe14('0x34')]);return db[_0xbe14('0x57')][_0xbe14('0x10')]({'where':_0x313a87[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x28a1e9){_0x57ad22[_0xbe14('0x10')]=_0x28a1e9;if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x313a87[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x57')]['findAll'](_0x313a87);})[_0xbe14('0x13')](function(_0x3303a4){_0x57ad22[_0xbe14('0x50')]=_0x3303a4;return _0x57ad22;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x1a780a,_0x313a87))[_0xbe14('0x35')](handleError(_0x1a780a,null));};exports[_0xbe14('0x58')]=function(_0x52b75d,_0x5b161c){var _0x165b7a={};var _0x4a44e0={};var _0x3730d1;var _0x4babba;return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x52b75d[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x5b161c,null))[_0xbe14('0x13')](function(_0x12498f){if(_0x12498f){_0x3730d1=_0x12498f;_0x4a44e0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x59')][_0xbe14('0x24')]);_0x4a44e0[_0xbe14('0x2e')]=_['keys'](_0x52b75d[_0xbe14('0x2e')]);_0x4a44e0[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x4a44e0[_0xbe14('0x2c')],_0x4a44e0['query']);_0x165b7a[_0xbe14('0x30')]=_['intersection'](_0x4a44e0[_0xbe14('0x2c')],qs['fields'](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x165b7a[_0xbe14('0x30')]=_0x165b7a['attributes'][_0xbe14('0x32')]?_0x165b7a['attributes']:_0x4a44e0[_0xbe14('0x2c')];_0x165b7a[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x165b7a[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x52b75d[_0xbe14('0x2e')],_0x4a44e0['filters']));if(_0x52b75d[_0xbe14('0x2e')]['filter']){_0x165b7a[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x165b7a[_0xbe14('0x28')],{'$or':_['map'](_0x165b7a[_0xbe14('0x30')],function(_0x1c5fbc){var _0x219403={};_0x219403[_0x1c5fbc]={'$like':'%'+_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x219403;})});}_0x165b7a=_['merge']({},_0x165b7a,_0x52b75d['options']);return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})['then'](function(_0x16b1c8){if(_0x16b1c8){_0x4babba=_0x16b1c8[_0xbe14('0x32')];if(!_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x165b7a[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x52b75d['query'][_0xbe14('0xf')]);_0x165b7a[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x52b75d[_0xbe14('0x2e')]['offset']);}return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})[_0xbe14('0x13')](function(_0x37aff6){if(_0x37aff6){return _0x37aff6?{'count':_0x4babba,'rows':_0x37aff6}:null;}})[_0xbe14('0x13')](respondWithResult(_0x5b161c,null))[_0xbe14('0x35')](handleError(_0x5b161c,null));};exports[_0xbe14('0x5a')]=function(_0x208fae,_0x310d42){var _0x9c229f=_0x208fae[_0xbe14('0x37')]['teams'];var _0xdb5515=_[_0xbe14('0x1a')](_0x9c229f,'id');return db[_0xbe14('0x59')][_0xbe14('0x4f')]({'where':{'id':_0xdb5515},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbe14('0x5b'),'attributes':['id',_0xbe14('0x1e'),_0xbe14('0x5c'),'voicePause',_0xbe14('0x5d')],'raw':!![]}]})[_0xbe14('0x13')](function(_0x1ec868){if(_0x1ec868){var _0x1a7321=_[_0xbe14('0x5e')](_0x1ec868,function(_0x2306f6){var _0x426189=_0x2306f6['get']({'plain':!![]});_0x426189[_0xbe14('0x5b')]['forEach'](function(_0x24d528){_0x24d528[_0xbe14('0x5f')]=_[_0xbe14('0x1d')](_0x9c229f,{'id':_0x426189['id']})[_0xbe14('0x5f')];});return _0x426189[_0xbe14('0x5b')];});return db['VoiceQueue']['find']({'where':{'id':_0x208fae[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(_0x29a892){return db[_0xbe14('0x60')]['transaction'](function(_0x46a251){return _0x29a892[_0xbe14('0x5a')](_0xdb5515,{'transaction':_0x46a251})[_0xbe14('0x13')](function(){return BPromise['each'](_0x9c229f,function(_0xe69b0e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xe69b0e['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id'],'penalty':_0xe69b0e[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_0x1a7321,function(_0x3ea9c2){return db[_0xbe14('0x61')]['findOrCreate']({'where':{'UserId':_0x3ea9c2['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id']},'defaults':{'penalty':_0x3ea9c2[_0xbe14('0x5f')]},'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_[_0xbe14('0x19')](_0x1a7321,{'online':!![]}),function(_0x1e2559){return db[_0xbe14('0x62')][_0xbe14('0x63')]({'membername':_0x1e2559[_0xbe14('0x1e')],'UserId':_0x1e2559['id'],'queue_name':_0x29a892['name'],'VoiceQueueId':_0x29a892['id'],'interface':_[_0xbe14('0x64')](_0x1e2559[_0xbe14('0x5d')])?util[_0xbe14('0x65')]('SIP/%s',_0x1e2559[_0xbe14('0x1e')]):_0x1e2559[_0xbe14('0x5d')],'paused':_0x1e2559[_0xbe14('0x66')]||![],'penalty':_0x1e2559[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){_0x1a7321[_0xbe14('0x67')](function(_0x1b22a0){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':_0x1b22a0['id'],'VoiceQueueId':_0x29a892['id']});});});});});}})[_0xbe14('0x13')](respondWithStatusCode(_0x310d42,null))[_0xbe14('0x35')](handleError(_0x310d42,null));};exports['removeTeams']=function(_0xf549ec,_0x2c3647){return db[_0xbe14('0x59')]['findAll']({'where':{'id':_0xf549ec[_0xbe14('0x2e')][_0xbe14('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbe14('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbe14('0x13')](handleEntityNotFound(_0x2c3647,null))['then'](function(_0x2d4b18){var _0xcd8cf6=_['map'](_0x2d4b18,'id');var _0x269e5a=[];var _0x4c7e2b=[];var _0x587f58=squel[_0xbe14('0x6c')]();_0x587f58[_0xbe14('0x6d')](_0xbe14('0x6e'))[_0xbe14('0x6f')](_0xbe14('0x70'),'tq')[_0xbe14('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbe14('0x28')](_0xbe14('0x72'),_0xf549ec[_0xbe14('0x2b')]['id']);for(var _0x3c23fc=0x0;_0x3c23fc<_0x2d4b18['length'];_0x3c23fc+=0x1){let _0x1d5333=_0x2d4b18[_0x3c23fc];for(var _0x4cb29c=0x0;_0x4cb29c<_0x1d5333[_0xbe14('0x5b')][_0xbe14('0x32')];_0x4cb29c+=0x1){let _0x5270b2=_0x1d5333[_0xbe14('0x5b')][_0x4cb29c];var _0x273df5=_0x587f58[_0xbe14('0x3f')]();_0x273df5[_0xbe14('0x28')](_0xbe14('0x73'),_0x5270b2['id']);_0x4c7e2b[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x273df5[_0xbe14('0x75')](),{'type':db[_0xbe14('0x60')][_0xbe14('0x76')][_0xbe14('0x77')]})['then'](function(_0x20f196){if(_0x20f196[_0xbe14('0x32')]===0x1){return _0x5270b2['id'];}else{var _0x1eb33b=_[_0xbe14('0x78')](_['map'](_0x20f196,_0xbe14('0x79')),function(_0xede1c1){return _['includes'](_0xcd8cf6,_0xede1c1);});if(_0x1eb33b){return _0x5270b2['id'];}}}));}}return BPromise[_0xbe14('0x7a')](_0x4c7e2b)[_0xbe14('0x13')](function(_0x11085c){_0x269e5a=_(_0x269e5a)['union'](_0x11085c)[_0xbe14('0x7b')]()[_0xbe14('0x1b')]();return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0xf549ec[_0xbe14('0x2b')]['id']}})['then'](function(_0x23208d){return db[_0xbe14('0x60')][_0xbe14('0x7c')](function(_0x3f7732){return _0x23208d[_0xbe14('0x7d')](_0xf549ec['query'][_0xbe14('0x6a')],{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){if(!_[_0xbe14('0x7e')](_0x269e5a)){return _0x23208d[_0xbe14('0x7f')](_0x269e5a,{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0xf549ec[_0xbe14('0x2b')]['id'],'UserId':_0x269e5a},'transaction':_0x3f7732});});}})['then'](function(){_0x269e5a['forEach'](function(_0x129ef6){socket[_0xbe14('0x68')](_0xbe14('0x80'),{'UserId':_0x129ef6,'VoiceQueueId':_0x23208d['id']});});});});});});})[_0xbe14('0x13')](respondWithStatusCode(_0x2c3647,null))[_0xbe14('0x35')](handleError(_0x2c3647,null));};exports['addAgents']=function(_0x15c93c,_0xf6ff8){var _0x3eaabe,_0x1ea11a;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x15c93c[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xf6ff8,null))['then'](function(_0xf6da38){if(_0xf6da38){_0x1ea11a=_0xf6da38;return _0xf6da38[_0xbe14('0x81')](_0x15c93c['body']['ids'],_[_0xbe14('0x41')](_0x15c93c['body'],[_0xbe14('0x6a'),'id'])||{})[_0xbe14('0x82')](function(_0x776e93){for(var _0x3f5ca3=0x0;_0x3f5ca3<_0x15c93c[_0xbe14('0x37')]['ids'][_0xbe14('0x32')];_0x3f5ca3+=0x1){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':Number(_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')][_0x3f5ca3]),'VoiceQueueId':Number(_0x15c93c[_0xbe14('0x2b')]['id'])});}return _0x776e93;});}})['then'](function(_0x4eea48){_0x3eaabe=_0x4eea48||[];if(_0x1ea11a){return db[_0xbe14('0x6b')]['findAll']({'where':{'id':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')]},'attributes':['id',_0xbe14('0x1e'),'online',_0xbe14('0x66'),_0xbe14('0x5d')],'raw':!![]});}})[_0xbe14('0x13')](function(_0x1ad15d){if(!_[_0xbe14('0x7e')](_0x1ad15d)){var _0x2e5106=[];for(var _0x156fb3=0x0;_0x156fb3<_0x1ad15d['length'];_0x156fb3++){if(_0x1ad15d[_0x156fb3][_0xbe14('0x5c')]){_0x2e5106['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x1ad15d[_0x156fb3]['name'],'UserId':_0x1ad15d[_0x156fb3]['id'],'queue_name':_0x1ea11a[_0xbe14('0x1e')],'VoiceQueueId':_0x1ea11a['id'],'interface':_[_0xbe14('0x64')](_0x1ad15d[_0x156fb3]['interface'])?util[_0xbe14('0x65')]('SIP/%s',_0x1ad15d[_0x156fb3][_0xbe14('0x1e')]):_0x1ad15d[_0x156fb3]['interface'],'paused':_0x1ad15d[_0x156fb3][_0xbe14('0x66')]||![],'penalty':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x5f')]||0x0}));}}return BPromise[_0xbe14('0x7a')](_0x2e5106);}})[_0xbe14('0x13')](function(){return _0x3eaabe;})['then'](respondWithResult(_0xf6ff8,null))[_0xbe14('0x35')](handleError(_0xf6ff8,null));};exports[_0xbe14('0x7f')]=function(_0x3aaa54,_0x413893){return db['VoiceQueue']['find']({'where':{'id':_0x3aaa54['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x413893,null))[_0xbe14('0x13')](function(_0x3826cf){if(_0x3826cf){return _0x3826cf[_0xbe14('0x7f')](_0x3aaa54[_0xbe14('0x2e')]['ids'])['then'](function(){if(_[_0xbe14('0x83')](_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')])){for(var _0x26092b=0x0;_0x26092b<_0x3aaa54[_0xbe14('0x2e')]['ids'][_0xbe14('0x32')];_0x26092b+=0x1){socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')][_0x26092b]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}}else{socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}});}})['then'](function(_0x44c341){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0x3aaa54['params']['id'],'UserId':_0x3aaa54['query'][_0xbe14('0x6a')]}})[_0xbe14('0x13')](function(){return _0x44c341;});})[_0xbe14('0x13')](respondWithStatusCode(_0x413893,null))['catch'](handleError(_0x413893,null));};exports[_0xbe14('0x84')]=function(_0x2f0d14,_0x180e61){var _0x952322={};var _0x3ae00b={};var _0x41962a;var _0x4ebf01;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x2f0d14[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x180e61,null))[_0xbe14('0x13')](function(_0x5f28dd){if(_0x5f28dd){_0x41962a=_0x5f28dd;_0x3ae00b['model']=_[_0xbe14('0x2d')](db['User'][_0xbe14('0x24')]);_0x3ae00b['query']=_[_0xbe14('0x2d')](_0x2f0d14[_0xbe14('0x2e')]);_0x3ae00b[_0xbe14('0x48')]=_['intersection'](_0x3ae00b[_0xbe14('0x2c')],_0x3ae00b[_0xbe14('0x2e')]);_0x952322[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x3ae00b[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x952322[_0xbe14('0x30')]=_0x952322[_0xbe14('0x30')]['length']?_0x952322[_0xbe14('0x30')]:_0x3ae00b[_0xbe14('0x2c')];_0x952322[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x952322[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x2f0d14[_0xbe14('0x2e')],_0x3ae00b[_0xbe14('0x48')]));if(_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x952322[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x952322['where'],{'$or':_['map'](_0x952322['attributes'],function(_0x598ccc){var _0x446b3f={};_0x446b3f[_0x598ccc]={'$like':'%'+_0x2f0d14[_0xbe14('0x2e')]['filter']+'%'};return _0x446b3f;})});}_0x952322=_[_0xbe14('0x40')]({},_0x952322,_0x2f0d14['options']);return _0x41962a[_0xbe14('0x84')](_0x952322);}})[_0xbe14('0x13')](function(_0x111ff0){if(_0x111ff0){_0x4ebf01=_0x111ff0[_0xbe14('0x32')];if(!_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x952322[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x952322[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x41962a[_0xbe14('0x84')](_0x952322);}})['then'](function(_0x2eb5e6){if(_0x2eb5e6){return _0x2eb5e6?{'count':_0x4ebf01,'rows':_0x2eb5e6}:null;}})['then'](respondWithResult(_0x180e61,null))[_0xbe14('0x35')](handleError(_0x180e61,null));};exports['getMembers']=function(_0x49cddc,_0x3bdbf7){var _0x19a1ae={};var _0x167dee={};var _0x4f6252;var _0x4536b9;return db['VoiceQueue'][_0xbe14('0x52')]({'where':{'id':_0x49cddc['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3bdbf7,null))[_0xbe14('0x13')](function(_0x21f14e){if(_0x21f14e){_0x4f6252=_0x21f14e;_0x167dee[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x62')]['rawAttributes']);_0x167dee[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x49cddc['query']);_0x167dee['filters']=_['intersection'](_0x167dee[_0xbe14('0x2c')],_0x167dee[_0xbe14('0x2e')]);_0x19a1ae[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x167dee[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x49cddc[_0xbe14('0x2e')]['fields']));_0x19a1ae[_0xbe14('0x30')]=_0x19a1ae[_0xbe14('0x30')][_0xbe14('0x32')]?_0x19a1ae['attributes']:_0x167dee[_0xbe14('0x2c')];_0x19a1ae[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x49cddc['query']['sort']);_0x19a1ae[_0xbe14('0x28')]=qs['filters'](_[_0xbe14('0x4d')](_0x49cddc[_0xbe14('0x2e')],_0x167dee[_0xbe14('0x48')]));if(_0x49cddc[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x19a1ae[_0xbe14('0x28')]=_['merge'](_0x19a1ae[_0xbe14('0x28')],{'$or':_['map'](_0x19a1ae[_0xbe14('0x30')],function(_0x2d0568){var _0x26bb56={};_0x26bb56[_0x2d0568]={'$like':'%'+_0x49cddc['query'][_0xbe14('0x19')]+'%'};return _0x26bb56;})});}_0x19a1ae=_[_0xbe14('0x40')]({},_0x19a1ae,_0x49cddc['options']);return _0x4f6252['getMembers'](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x3d9061){if(_0x3d9061){_0x4536b9=_0x3d9061[_0xbe14('0x32')];if(!_0x49cddc['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x19a1ae['limit']=qs['limit'](_0x49cddc['query']['limit']);_0x19a1ae[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x49cddc['query']['offset']);}return _0x4f6252[_0xbe14('0x85')](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x1046a0){return _0x1046a0?{'count':_0x4536b9,'rows':_0x1046a0}:null;})['then'](respondWithResult(_0x3bdbf7,null))[_0xbe14('0x35')](handleError(_0x3bdbf7,null));};exports[_0xbe14('0x86')]=function(_0x3933c7,_0x416c65){var _0x56f870={};var _0x28b3c4={};var _0x6fe862;var _0x5f4675;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3933c7[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x416c65,null))[_0xbe14('0x13')](function(_0x4c4ab9){if(_0x4c4ab9){_0x6fe862=_0x4c4ab9;_0x28b3c4['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x87')][_0xbe14('0x24')]);_0x28b3c4[_0xbe14('0x2e')]=_['keys'](_0x3933c7[_0xbe14('0x2e')]);_0x28b3c4[_0xbe14('0x48')]=_['intersection'](_0x28b3c4[_0xbe14('0x2c')],_0x28b3c4['query']);_0x56f870[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x28b3c4['model'],qs[_0xbe14('0x31')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x56f870[_0xbe14('0x30')]=_0x56f870[_0xbe14('0x30')][_0xbe14('0x32')]?_0x56f870[_0xbe14('0x30')]:_0x28b3c4[_0xbe14('0x2c')];_0x56f870['order']=qs[_0xbe14('0x4c')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x56f870['where']=qs['filters'](_['pick'](_0x3933c7[_0xbe14('0x2e')],_0x28b3c4[_0xbe14('0x48')]));if(_0x3933c7[_0xbe14('0x2e')]['filter']){_0x56f870['where']=_[_0xbe14('0x40')](_0x56f870[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x56f870[_0xbe14('0x30')],function(_0x2ac6c0){var _0x3d381e={};_0x3d381e[_0x2ac6c0]={'$like':'%'+_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x3d381e;})});}_0x56f870=_[_0xbe14('0x40')]({},_0x56f870,_0x3933c7['options']);return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2ca4de){if(_0x2ca4de){_0x5f4675=_0x2ca4de[_0xbe14('0x32')];if(!_0x3933c7[_0xbe14('0x2e')]['hasOwnProperty'](_0xbe14('0x4a'))){_0x56f870['limit']=qs['limit'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x56f870['offset']=qs['offset'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2e7c31){if(_0x2e7c31){return _0x2e7c31?{'count':_0x5f4675,'rows':_0x2e7c31}:null;}})['then'](respondWithResult(_0x416c65,null))['catch'](handleError(_0x416c65,null));};exports[_0xbe14('0x88')]=function(_0x4b07fc,_0x76e84){var _0x3f687f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4f4b69,_0x43d760;return db['VoiceQueue'][_0xbe14('0x1d')]({'where':{'id':_0x4b07fc[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x76e84,null))[_0xbe14('0x13')](function(_0x30657c){if(_0x30657c){_0x43d760=_0x30657c;return _0x30657c[_0xbe14('0x88')](_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x6a')],_['omit'](_0x4b07fc[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0xd97d02){var _0x15082b;_0x4f4b69=_0xd97d02||[];var _0x5d15c7=[];if(_0xd97d02){for(var _0x66b6a7=0x0;_0x66b6a7<_0xd97d02[_0xbe14('0x32')];_0x66b6a7+=0x1){var _0x4dfe2c=_0xd97d02[_0x66b6a7][_0xbe14('0x15')]({'plain':!![]});_0x43d760['dialCheckDuplicateType']=_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]?_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]:_0x43d760[_0xbe14('0x89')];switch(_0x43d760[_0xbe14('0x89')]){case'always':_0x15082b=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x96'))[_0xbe14('0x6f')](_0xbe14('0x97'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id']['toString']()))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x98'))[_0xbe14('0x6f')]('cm_hopper')[_0xbe14('0x28')](_0xbe14('0x72'),_0x4b07fc[_0xbe14('0x2b')]['id']['toString']())))[_0xbe14('0x75')]();break;case _0xbe14('0x99'):_0x15082b=squel['insert']()[_0xbe14('0x8b')]('cm_hopper')[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),'ListId','VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x4b07fc[_0xbe14('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))['where'](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x98'))[_0xbe14('0x6f')](_0xbe14('0x8c'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id'][_0xbe14('0x75')]())))['toString']();break;default:_0x15082b=squel['insert']()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')](['phone',_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))['field']('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c['CmListId'][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),'VoiceQueueId')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')[_0xbe14('0x28')](_0xbe14('0x9b'))['where'](_0xbe14('0x93'),_0x4dfe2c[_0xbe14('0x92')]['toString']())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();}_0x5d15c7['push'](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x15082b));}return BPromise[_0xbe14('0x7a')](_0x5d15c7);}})[_0xbe14('0x13')](function(){var _0x4bc564=[];var _0x19e7ce=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x9c'))[_0xbe14('0x8d')]([_0xbe14('0x9d'),_0xbe14('0x8e'),_0xbe14('0x9e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()['field']('h.id')[_0xbe14('0x6d')](_0xbe14('0x9f'))['field'](_0xbe14('0xa0'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27','createdAt')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0xa1'),'ci')[_0xbe14('0x71')](_0xbe14('0x8c'),'h','h.ContactId=ci.CmContactId')['where'](_0xbe14('0xa2'),_0x3f687f)['where'](_0xbe14('0xa3'),_0xbe14('0xa4')))['toString']();_0x4bc564[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x19e7ce));return BPromise[_0xbe14('0x7a')](_0x4bc564);})[_0xbe14('0x13')](function(){return _0x4f4b69;})[_0xbe14('0x13')](respondWithResult(_0x76e84,null))[_0xbe14('0x35')](handleError(_0x76e84,null));};exports['removeLists']=function(_0x4ceca6,_0x23f4a3){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x23f4a3,null))[_0xbe14('0x13')](function(_0x2fe8b0){if(_0x2fe8b0){return _0x2fe8b0[_0xbe14('0xa5')](_0x4ceca6['query'][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x186284){if(_0x186284){return db['CmHopper'][_0xbe14('0x14')]({'where':{'ListId':_0x4ceca6[_0xbe14('0x2e')][_0xbe14('0x6a')],'VoiceQueueId':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(){return _0x186284;});}})['then'](respondWithStatusCode(_0x23f4a3,null))[_0xbe14('0x35')](handleError(_0x23f4a3,null));};exports[_0xbe14('0xa6')]=function(_0x4c9319,_0x1173f0){var _0x1e0c81={};var _0x5349a7={};var _0x5e3819;var _0x28c5fe;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x4c9319['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1173f0,null))[_0xbe14('0x13')](function(_0x59434a){if(_0x59434a){_0x5e3819=_0x59434a;_0x5349a7[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x87')]['rawAttributes']);_0x5349a7[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x4c9319[_0xbe14('0x2e')]);_0x5349a7[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x5349a7[_0xbe14('0x2c')],_0x5349a7[_0xbe14('0x2e')]);_0x1e0c81[_0xbe14('0x30')]=_['intersection'](_0x5349a7[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e0c81[_0xbe14('0x30')]=_0x1e0c81['attributes'][_0xbe14('0x32')]?_0x1e0c81[_0xbe14('0x30')]:_0x5349a7[_0xbe14('0x2c')];_0x1e0c81[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x4c9319[_0xbe14('0x2e')]['sort']);_0x1e0c81['where']=qs['filters'](_[_0xbe14('0x4d')](_0x4c9319[_0xbe14('0x2e')],_0x5349a7['filters']));if(_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e0c81[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x1e0c81['where'],{'$or':_[_0xbe14('0x1a')](_0x1e0c81[_0xbe14('0x30')],function(_0x52bbc1){var _0x2797ef={};_0x2797ef[_0x52bbc1]={'$like':'%'+_0x4c9319['query']['filter']+'%'};return _0x2797ef;})});}_0x1e0c81=_[_0xbe14('0x40')]({},_0x1e0c81,_0x4c9319[_0xbe14('0x34')]);return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})[_0xbe14('0x13')](function(_0x47bba1){if(_0x47bba1){_0x28c5fe=_0x47bba1[_0xbe14('0x32')];if(!_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e0c81['limit']=qs[_0xbe14('0xf')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x1e0c81[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})['then'](function(_0x2592ab){if(_0x2592ab){return _0x2592ab?{'count':_0x28c5fe,'rows':_0x2592ab}:null;}})[_0xbe14('0x13')](respondWithResult(_0x1173f0,null))['catch'](handleError(_0x1173f0,null));};exports['addBlackLists']=function(_0x6a0f29,_0x3d04b9){var _0x21f793;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x6a0f29[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3d04b9,null))[_0xbe14('0x13')](function(_0x37e5e8){if(_0x37e5e8){return _0x37e5e8['addBlackLists'](_0x6a0f29[_0xbe14('0x37')][_0xbe14('0x6a')],_[_0xbe14('0x41')](_0x6a0f29[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0x14cec7){var _0x524603;_0x21f793=_0x14cec7||[];var _0x38d720=[];if(_0x14cec7){for(var _0x379446=0x0;_0x379446<_0x14cec7[_0xbe14('0x32')];_0x379446+=0x1){var _0x1489c9=_0x14cec7[_0x379446][_0xbe14('0x15')]({'plain':!![]});_0x524603=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0xa7'))['fromQuery']([_0xbe14('0x8e'),_0xbe14('0x90'),_0xbe14('0x91'),'VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x6a0f29['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')](_0xbe14('0xa8'),_0xbe14('0x42'))[_0xbe14('0x6d')](_0xbe14('0xa8'),'updatedAt')[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();_0x38d720[_0xbe14('0x74')](db['sequelize'][_0xbe14('0x2e')](_0x524603));}return BPromise[_0xbe14('0x7a')](_0x38d720);}})['then'](function(){return _0x21f793;})['then'](respondWithResult(_0x3d04b9,null))[_0xbe14('0x35')](handleError(_0x3d04b9,null));};exports[_0xbe14('0xa9')]=function(_0x7533c3,_0x3ec670){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x7533c3[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3ec670,null))['then'](function(_0x3ee9e2){if(_0x3ee9e2){return _0x3ee9e2['removeBlackLists'](_0x7533c3[_0xbe14('0x2e')][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x1d343a){if(_0x1d343a){return db[_0xbe14('0x57')][_0xbe14('0x14')]({'where':{'ListId':_0x7533c3['query']['ids'],'VoiceQueueId':_0x7533c3['params']['id']}})['then'](function(){return _0x1d343a;});}})['then'](respondWithStatusCode(_0x3ec670,null))[_0xbe14('0x35')](handleError(_0x3ec670,null));}; \ No newline at end of file +var _0x55ca=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','VoiceQueues','UserProfileResource','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','where','rows','getHopperHistories','CmHopperHistory','pick','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','push','cm_hopper_additional_phones','CmHopperId','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','sendStatus','error','stack','name','send','index','map','VoiceQueue','key','getOptions','include','query','findAll','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x1c7c89,_0x25906c){var _0x59c6e1=function(_0x2e9a41){while(--_0x2e9a41){_0x1c7c89['push'](_0x1c7c89['shift']());}};_0x59c6e1(++_0x25906c);}(_0x55ca,0x126));var _0xa55c=function(_0x36feba,_0x541932){_0x36feba=_0x36feba-0x0;var _0x358e41=_0x55ca[_0x36feba];return _0x358e41;};'use strict';var moment=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xa55c('0x2'));var qs=require(_0xa55c('0x3'));var logger=require('../../config/logger')(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var db=require(_0xa55c('0x6'))['db'];config[_0xa55c('0x7')]=_[_0xa55c('0x8')](config[_0xa55c('0x7')],{'host':_0xa55c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0x7')]));require(_0xa55c('0xa'))['register'](socket);function respondWithStatusCode(_0x291996,_0x290d28){_0x290d28=_0x290d28||0xcc;return function(_0x52a3bc){if(_0x52a3bc){return _0x291996['sendStatus'](_0x290d28);}return _0x291996[_0xa55c('0xb')](_0x290d28)[_0xa55c('0xc')]();};}function respondWithResult(_0x381d07,_0x5d8e5a){_0x5d8e5a=_0x5d8e5a||0xc8;return function(_0x31646d){if(_0x31646d){return _0x381d07[_0xa55c('0xb')](_0x5d8e5a)[_0xa55c('0xd')](_0x31646d);}};}function respondWithFilteredResult(_0x70c2de,_0x3998f7){return function(_0x15eec8){if(_0x15eec8){var _0x5d47ff=typeof _0x3998f7['offset']===_0xa55c('0xe')&&typeof _0x3998f7['limit']==='undefined';var _0x59ea8d=_0x15eec8[_0xa55c('0xf')];var _0x3930e4=_0x5d47ff?0x0:_0x3998f7[_0xa55c('0x10')];var _0x938bd6=_0x5d47ff?_0x15eec8[_0xa55c('0xf')]:_0x3998f7[_0xa55c('0x10')]+_0x3998f7['limit'];var _0x3ccf65;if(_0x938bd6>=_0x59ea8d){_0x938bd6=_0x59ea8d;_0x3ccf65=0xc8;}else{_0x3ccf65=0xce;}_0x70c2de[_0xa55c('0xb')](_0x3ccf65);return _0x70c2de[_0xa55c('0x11')](_0xa55c('0x12'),_0x3930e4+'-'+_0x938bd6+'/'+_0x59ea8d)[_0xa55c('0xd')](_0x15eec8);}return null;};}function saveUpdates(_0x3ae86b){return function(_0x51590e){if(_0x51590e){return _0x51590e[_0xa55c('0x13')](_0x3ae86b)[_0xa55c('0x14')](function(_0x4cee3c){return _0x4cee3c;});}return null;};}function removeEntity(_0x3d4c9e){return function(_0x104a99){if(_0x104a99){return _0x104a99[_0xa55c('0x15')]()[_0xa55c('0x14')](function(){var _0x23a1ae=_0x104a99[_0xa55c('0x16')]({'plain':!![]});var _0x4c0daf=[{'name':'VoiceQueues','value':_0xa55c('0x17'),'ignore':![]},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19'),'ignore':![]}];var _0x4cfe10=_(_0x4c0daf)[_0xa55c('0x1a')](_0xa55c('0x1b'))['map'](_0xa55c('0x1c'))[_0xa55c('0x1c')]();if(_[_0xa55c('0x1d')](_0x4cfe10,_0x23a1ae[_0xa55c('0x1e')])){return;}var _0x234372=_['find'](_0x4c0daf,[_0xa55c('0x1c'),_0x23a1ae['type']])['name'];return db['UserProfileResource'][_0xa55c('0x15')]({'where':{'type':_0x234372,'resourceId':_0x23a1ae['id']}})['then'](function(){return _0x104a99;});})[_0xa55c('0x14')](function(){_0x3d4c9e[_0xa55c('0xb')](0xcc)[_0xa55c('0xc')]();});}};}function handleEntityNotFound(_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0xf0e574[_0xa55c('0x1f')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x20')](_0x192df2[_0xa55c('0x21')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x22')];}_0x1da633[_0xa55c('0xb')](_0x11e7f7)[_0xa55c('0x23')](_0x192df2);};}exports[_0xa55c('0x24')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={};var _0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x25')](db[_0xa55c('0x26')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x1e')][_0xa55c('0x27')]};});_0x22f6b6=qs[_0xa55c('0x28')](_0x201941,_0x5d940d);var _0x223813={'where':_0x22f6b6['where']};return db[_0xa55c('0x26')][_0xa55c('0xf')](_0x223813)[_0xa55c('0x14')](function(_0x20da31){_0x1b8388[_0xa55c('0xf')]=_0x20da31;_0x22f6b6[_0xa55c('0x29')]=qs[_0xa55c('0x29')](_0x5d940d[_0xa55c('0x2a')]);return db[_0xa55c('0x26')][_0xa55c('0x2b')](_0x22f6b6);})[_0xa55c('0x14')](function(_0x4eb7c4){_0x1b8388['rows']=_0x4eb7c4;return _0x1b8388;})[_0xa55c('0x14')](respondWithFilteredResult(_0x1377b0,_0x22f6b6))[_0xa55c('0x2c')](handleError(_0x1377b0,null));};exports['show']=function(_0x30fadd,_0x2f0110){var _0x2e9623={'raw':![],'where':{'id':_0x30fadd[_0xa55c('0x2d')]['id']}},_0x1839ac={};_0x1839ac[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x26')][_0xa55c('0x30')]);_0x1839ac['query']=_['keys'](_0x30fadd['query']);_0x1839ac[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x1839ac[_0xa55c('0x2e')],_0x1839ac['query']);_0x2e9623[_0xa55c('0x33')]=_['intersection'](_0x1839ac[_0xa55c('0x2e')],qs['fields'](_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2e9623[_0xa55c('0x33')]=_0x2e9623['attributes'][_0xa55c('0x35')]?_0x2e9623[_0xa55c('0x33')]:_0x1839ac['model'];if(_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x2e9623['include']=[{'all':!![]}];}_0x2e9623=_['merge']({},_0x2e9623,_0x30fadd[_0xa55c('0x37')]);return db['VoiceQueue'][_0xa55c('0x38')](_0x2e9623)[_0xa55c('0x14')](handleEntityNotFound(_0x2f0110,null))['then'](respondWithResult(_0x2f0110,null))['catch'](handleError(_0x2f0110,null));};exports['create']=function(_0x4de781,_0x3b3308){return db[_0xa55c('0x26')][_0xa55c('0x39')](_0x4de781[_0xa55c('0x3a')],{})[_0xa55c('0x14')](function(_0x56d17c){var _0x3d52d8=_0x4de781[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x3d52d8)throw new Error(_0xa55c('0x3c'));if(_0x3d52d8[_0xa55c('0x3d')]===_0xa55c('0x3b')){var _0x554620=_0x56d17c[_0xa55c('0x16')]({'plain':!![]});var _0x5ee63d=[{'name':'VoiceQueues','value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':'outbound'}];var _0x2bd98b=_['find'](_0x5ee63d,['value',_0x554620[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x2bd98b,'userProfileId':_0x3d52d8[_0xa55c('0x3f')]},'raw':!![]})[_0xa55c('0x14')](function(_0x5d9d5d){if(_0x5d9d5d&&_0x5d9d5d[_0xa55c('0x40')]===0x0){return db['UserProfileResource'][_0xa55c('0x39')]({'name':_0x554620[_0xa55c('0x22')],'resourceId':_0x554620['id'],'type':_0x5d9d5d['name'],'sectionId':_0x5d9d5d['id']},{})[_0xa55c('0x14')](function(){return _0x56d17c;});}else{return _0x56d17c;}})[_0xa55c('0x2c')](function(_0x5d834d){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x5d834d);throw _0x5d834d;});}return _0x56d17c;})[_0xa55c('0x14')](respondWithResult(_0x3b3308,0xc9))['catch'](handleError(_0x3b3308,null));};exports[_0xa55c('0x42')]=function(_0x582901,_0x2f9717){var _0x3a8af4={'where':{'id':_0x582901['params']['id']}},_0x451269={};_0x451269[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['VoiceQueue'][_0xa55c('0x30')]);_0x3a8af4[_0xa55c('0x33')]=_['intersection'](_0x451269[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x582901['query'][_0xa55c('0x34')]));_0x3a8af4[_0xa55c('0x33')]=_0x3a8af4[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3a8af4['attributes']:_0x451269[_0xa55c('0x2e')];if(_0x582901['query'][_0xa55c('0x36')]){_0x3a8af4[_0xa55c('0x29')]=[{'all':!![]}];}_0x3a8af4=_[_0xa55c('0x43')]({},_0x3a8af4,_0x582901['options']);return db[_0xa55c('0x26')][_0xa55c('0x38')](_0x3a8af4)['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x14')](function(_0x34de95){if(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x16')]({'plain':!![]});_0x3822b7=qs[_0xa55c('0x44')](_0x3822b7,['id',_0xa55c('0x45'),_0xa55c('0x46')]);_0x582901[_0xa55c('0x3a')]=_[_0xa55c('0x44')](_0x582901[_0xa55c('0x3a')],['id','createdAt',_0xa55c('0x46')]);return db[_0xa55c('0x26')][_0xa55c('0x39')](_['merge'](_0x3822b7,_0x582901[_0xa55c('0x3a')]),{'include':_0x582901[_0xa55c('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x14')](function(_0x4fa412){var _0x2b6a0e=_0x582901[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x2b6a0e)throw new Error(_0xa55c('0x3c'));if(_0x2b6a0e[_0xa55c('0x3d')]==='user'){var _0x44b7c1=_0x4fa412[_0xa55c('0x16')]({'plain':!![]});var _0x4b85cc=[{'name':_0xa55c('0x47'),'value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19')}];var _0x50176b=_['find'](_0x4b85cc,[_0xa55c('0x1c'),_0x44b7c1[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x50176b,'userProfileId':_0x2b6a0e[_0xa55c('0x3f')]},'raw':!![]})['then'](function(_0x2742e4){if(_0x2742e4&&_0x2742e4[_0xa55c('0x40')]===0x0){return db[_0xa55c('0x48')][_0xa55c('0x39')]({'name':_0x44b7c1[_0xa55c('0x22')],'resourceId':_0x44b7c1['id'],'type':_0x2742e4['name'],'sectionId':_0x2742e4['id']},{})[_0xa55c('0x14')](function(){return _0x4fa412;});}else{return _0x4fa412;}})['catch'](function(_0x23f67f){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x23f67f);throw _0x23f67f;});}return _0x4fa412;});}})[_0xa55c('0x14')](respondWithResult(_0x2f9717,0xc9))[_0xa55c('0x2c')](handleError(_0x2f9717,null));};exports[_0xa55c('0x13')]=function(_0x5d14e0,_0x53e2be){if(_0x5d14e0[_0xa55c('0x3a')]['id']){delete _0x5d14e0[_0xa55c('0x3a')]['id'];}return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x5d14e0[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x53e2be,null))[_0xa55c('0x14')](saveUpdates(_0x5d14e0[_0xa55c('0x3a')],null))[_0xa55c('0x14')](respondWithResult(_0x53e2be,null))[_0xa55c('0x2c')](handleError(_0x53e2be,null));};exports[_0xa55c('0x15')]=function(_0x493f51,_0xdd92c1){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x493f51[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0xdd92c1,null))['then'](removeEntity(_0xdd92c1,null))[_0xa55c('0x2c')](handleError(_0xdd92c1,null));};exports['getHoppers']=function(_0x2e482a,_0x5e3a28){var _0x3495a7={'raw':![],'where':{}};var _0x5a8897={};var _0x34edc5={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x2e482a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x5e3a28,null))[_0xa55c('0x14')](function(_0xafaf8c){if(_0xafaf8c){_0x5a8897[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x4a')]['rawAttributes']);_0x5a8897[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x2e482a['query']);_0x5a8897[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],_0x5a8897[_0xa55c('0x2a')]);_0x3495a7[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x2e482a['query'][_0xa55c('0x34')]));_0x3495a7[_0xa55c('0x33')]=_0x3495a7[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3495a7[_0xa55c('0x33')]:_0x5a8897[_0xa55c('0x2e')];if(!_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x3495a7['limit']=qs[_0xa55c('0x4d')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x3495a7[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x3495a7[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x3495a7['where']=qs[_0xa55c('0x31')](_['pick'](_0x2e482a[_0xa55c('0x2a')],_0x5a8897[_0xa55c('0x31')]));_0x3495a7[_0xa55c('0x50')]['VoiceQueueId']=_0xafaf8c['id'];if(_0x2e482a['query'][_0xa55c('0x1a')]){_0x3495a7[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x50')],{'$or':_['map'](_0x3495a7[_0xa55c('0x33')],function(_0xd02251){var _0x8ea1c6={};_0x8ea1c6[_0xd02251]={'$like':'%'+_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x8ea1c6;})});}_0x3495a7=_['merge']({},_0x3495a7,_0x2e482a['options']);return db[_0xa55c('0x4a')][_0xa55c('0xf')]({'where':_0x3495a7[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x1af9d5){_0x34edc5['count']=_0x1af9d5;if(_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x3495a7['include']=[{'all':!![]}];}return db[_0xa55c('0x4a')][_0xa55c('0x2b')](_0x3495a7);})[_0xa55c('0x14')](function(_0x4dcb93){_0x34edc5[_0xa55c('0x51')]=_0x4dcb93;return _0x34edc5;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x5e3a28,_0x3495a7))[_0xa55c('0x2c')](handleError(_0x5e3a28,null));};exports[_0xa55c('0x52')]=function(_0x232143,_0x506f74){var _0x25bd5b={'raw':!![],'where':{}};var _0x2e2cf6={};var _0x4bf233={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x232143['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x506f74,null))[_0xa55c('0x14')](function(_0x2f13db){if(_0x2f13db){_0x2e2cf6[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x53')][_0xa55c('0x30')]);_0x2e2cf6[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x232143['query']);_0x2e2cf6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],_0x2e2cf6[_0xa55c('0x2a')]);_0x25bd5b['attributes']=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x232143[_0xa55c('0x2a')]['fields']));_0x25bd5b['attributes']=_0x25bd5b[_0xa55c('0x33')][_0xa55c('0x35')]?_0x25bd5b[_0xa55c('0x33')]:_0x2e2cf6[_0xa55c('0x2e')];if(!_0x232143['query']['hasOwnProperty'](_0xa55c('0x4c'))){_0x25bd5b[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x232143[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x25bd5b[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x232143['query'][_0xa55c('0x10')]);}_0x25bd5b['order']=qs[_0xa55c('0x4f')](_0x232143['query'][_0xa55c('0x4f')]);_0x25bd5b[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x232143[_0xa55c('0x2a')],_0x2e2cf6[_0xa55c('0x31')]));_0x25bd5b[_0xa55c('0x50')][_0xa55c('0x55')]=_0x2f13db['id'];if(_0x232143['query']['filter']){_0x25bd5b[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x25bd5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x25bd5b[_0xa55c('0x33')],function(_0x137728){var _0x47e8e2={};_0x47e8e2[_0x137728]={'$like':'%'+_0x232143[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x47e8e2;})});}_0x25bd5b=_[_0xa55c('0x43')]({},_0x25bd5b,_0x232143[_0xa55c('0x37')]);return db[_0xa55c('0x53')][_0xa55c('0xf')]({'where':_0x25bd5b[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x58b670){_0x4bf233[_0xa55c('0xf')]=_0x58b670;if(_0x232143[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x25bd5b[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x53')]['findAll'](_0x25bd5b);})[_0xa55c('0x14')](function(_0x2ab1f2){_0x4bf233['rows']=_0x2ab1f2;return _0x4bf233;});}})['then'](respondWithFilteredResult(_0x506f74,_0x25bd5b))[_0xa55c('0x2c')](handleError(_0x506f74,null));};exports[_0xa55c('0x56')]=function(_0x5c2229,_0x559e71){var _0x579726={'raw':!![],'where':{}};var _0x5ab79e={};var _0xf8e295={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x5c2229[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x559e71,null))[_0xa55c('0x14')](function(_0x568a5b){if(_0x568a5b){_0x5ab79e[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x57')][_0xa55c('0x30')]);_0x5ab79e['query']=_[_0xa55c('0x2f')](_0x5c2229[_0xa55c('0x2a')]);_0x5ab79e[_0xa55c('0x31')]=_['intersection'](_0x5ab79e[_0xa55c('0x2e')],_0x5ab79e['query']);_0x579726['attributes']=_[_0xa55c('0x32')](_0x5ab79e[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x579726[_0xa55c('0x33')]=_0x579726[_0xa55c('0x33')]['length']?_0x579726['attributes']:_0x5ab79e[_0xa55c('0x2e')];if(!_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x579726[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x579726[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x5c2229['query'][_0xa55c('0x10')]);}_0x579726[_0xa55c('0x4e')]=qs['sort'](_0x5c2229[_0xa55c('0x2a')]['sort']);_0x579726[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x5c2229[_0xa55c('0x2a')],_0x5ab79e[_0xa55c('0x31')]));_0x579726['where'][_0xa55c('0x55')]=_0x568a5b['id'];if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x579726[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x579726[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x579726['attributes'],function(_0x49a307){var _0x5c08e5={};_0x5c08e5[_0x49a307]={'$like':'%'+_0x5c2229[_0xa55c('0x2a')]['filter']+'%'};return _0x5c08e5;})});}_0x579726=_[_0xa55c('0x43')]({},_0x579726,_0x5c2229[_0xa55c('0x37')]);return db[_0xa55c('0x57')][_0xa55c('0xf')]({'where':_0x579726[_0xa55c('0x50')]})['then'](function(_0x253d7a){_0xf8e295['count']=_0x253d7a;if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x579726[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x57')]['findAll'](_0x579726);})[_0xa55c('0x14')](function(_0x46f8ab){_0xf8e295[_0xa55c('0x51')]=_0x46f8ab;return _0xf8e295;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x559e71,_0x579726))[_0xa55c('0x2c')](handleError(_0x559e71,null));};exports[_0xa55c('0x58')]=function(_0x270bd0,_0x472c73){var _0x5bae40={'raw':!![],'where':{}};var _0x147962={};var _0x1538dc={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x270bd0[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x472c73,null))['then'](function(_0x46124b){if(_0x46124b){_0x147962['model']=_[_0xa55c('0x2f')](db['CmHopperBlack'][_0xa55c('0x30')]);_0x147962[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x270bd0['query']);_0x147962[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x147962[_0xa55c('0x2e')],_0x147962['query']);_0x5bae40[_0xa55c('0x33')]=_['intersection'](_0x147962[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x270bd0['query'][_0xa55c('0x34')]));_0x5bae40['attributes']=_0x5bae40[_0xa55c('0x33')][_0xa55c('0x35')]?_0x5bae40['attributes']:_0x147962[_0xa55c('0x2e')];if(!_0x270bd0[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x5bae40[_0xa55c('0x4d')]=qs['limit'](_0x270bd0[_0xa55c('0x2a')]['limit']);_0x5bae40['offset']=qs[_0xa55c('0x10')](_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x5bae40[_0xa55c('0x4e')]=qs['sort'](_0x270bd0[_0xa55c('0x2a')]['sort']);_0x5bae40[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x270bd0['query'],_0x147962[_0xa55c('0x31')]));_0x5bae40['where']['VoiceQueueId']=_0x46124b['id'];if(_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x5bae40[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x5bae40[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x5bae40[_0xa55c('0x33')],function(_0x9225d9){var _0x465801={};_0x465801[_0x9225d9]={'$like':'%'+_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x465801;})});}_0x5bae40=_[_0xa55c('0x43')]({},_0x5bae40,_0x270bd0[_0xa55c('0x37')]);return db['CmHopperBlack'][_0xa55c('0xf')]({'where':_0x5bae40['where']})['then'](function(_0x5c8003){_0x1538dc[_0xa55c('0xf')]=_0x5c8003;if(_0x270bd0['query'][_0xa55c('0x36')]){_0x5bae40['include']=[{'all':!![]}];}return db[_0xa55c('0x59')]['findAll'](_0x5bae40);})['then'](function(_0xfb1954){_0x1538dc['rows']=_0xfb1954;return _0x1538dc;});}})['then'](respondWithFilteredResult(_0x472c73,_0x5bae40))[_0xa55c('0x2c')](handleError(_0x472c73,null));};exports[_0xa55c('0x5a')]=function(_0x4ba496,_0x11349d){var _0x55caeb={};var _0x294e54={};var _0x403dff;var _0x1dcd8a;return db['VoiceQueue']['findOne']({'where':{'id':_0x4ba496[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x11349d,null))[_0xa55c('0x14')](function(_0xfda07f){if(_0xfda07f){_0x403dff=_0xfda07f;_0x294e54[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x5b')][_0xa55c('0x30')]);_0x294e54['query']=_[_0xa55c('0x2f')](_0x4ba496[_0xa55c('0x2a')]);_0x294e54[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],_0x294e54[_0xa55c('0x2a')]);_0x55caeb[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],qs['fields'](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x55caeb[_0xa55c('0x33')]=_0x55caeb['attributes']['length']?_0x55caeb['attributes']:_0x294e54[_0xa55c('0x2e')];_0x55caeb['order']=qs[_0xa55c('0x4f')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x55caeb[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x4ba496[_0xa55c('0x2a')],_0x294e54[_0xa55c('0x31')]));if(_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x55caeb[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x55caeb[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x55caeb[_0xa55c('0x33')],function(_0x1c7aec){var _0xf0bcac={};_0xf0bcac[_0x1c7aec]={'$like':'%'+_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0xf0bcac;})});}_0x55caeb=_[_0xa55c('0x43')]({},_0x55caeb,_0x4ba496[_0xa55c('0x37')]);return _0x403dff[_0xa55c('0x5a')](_0x55caeb);}})[_0xa55c('0x14')](function(_0x168b3f){if(_0x168b3f){_0x1dcd8a=_0x168b3f['length'];if(!_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4b')]('nolimit')){_0x55caeb[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x55caeb[_0xa55c('0x10')]=qs['offset'](_0x4ba496[_0xa55c('0x2a')]['offset']);}return _0x403dff['getTeams'](_0x55caeb);}})[_0xa55c('0x14')](function(_0x1c9903){if(_0x1c9903){return _0x1c9903?{'count':_0x1dcd8a,'rows':_0x1c9903}:null;}})[_0xa55c('0x14')](respondWithResult(_0x11349d,null))[_0xa55c('0x2c')](handleError(_0x11349d,null));};exports[_0xa55c('0x5c')]=function(_0x23b513,_0x1e4464){var _0xd9f634=_0x23b513[_0xa55c('0x3a')][_0xa55c('0x5d')];var _0x1036b3=_[_0xa55c('0x25')](_0xd9f634,'id');return db[_0xa55c('0x5b')][_0xa55c('0x2b')]({'where':{'id':_0x1036b3},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':_0xa55c('0x5f'),'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x55a98d){if(_0x55a98d){var _0x200c28=_[_0xa55c('0x62')](_0x55a98d,function(_0x5e41b3){var _0x45b329=_0x5e41b3['get']({'plain':!![]});_0x45b329[_0xa55c('0x5f')]['forEach'](function(_0x3060f2){_0x3060f2[_0xa55c('0x63')]=_[_0xa55c('0x38')](_0xd9f634,{'id':_0x45b329['id']})[_0xa55c('0x63')];});return _0x45b329[_0xa55c('0x5f')];});return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x23b513[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x665054){return db[_0xa55c('0x64')]['transaction'](function(_0x59f3a4){return _0x665054[_0xa55c('0x5c')](_0x1036b3,{'transaction':_0x59f3a4})['then'](function(){return BPromise[_0xa55c('0x65')](_0xd9f634,function(_0x5447a4){return db[_0xa55c('0x66')][_0xa55c('0x67')]({'TeamId':_0x5447a4['id'],'VoiceQueueId':_0x23b513[_0xa55c('0x2d')]['id'],'penalty':_0x5447a4['penalty']},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){return BPromise[_0xa55c('0x65')](_0x200c28,function(_0x130c5f){return db['UserVoiceQueue'][_0xa55c('0x68')]({'where':{'UserId':_0x130c5f['id'],'VoiceQueueId':_0x23b513['params']['id']},'defaults':{'penalty':_0x130c5f[_0xa55c('0x63')]},'transaction':_0x59f3a4});});})['then'](function(){return BPromise['each'](_[_0xa55c('0x1a')](_0x200c28,{'online':!![]}),function(_0x40e121){return db[_0xa55c('0x69')]['upsert']({'membername':_0x40e121[_0xa55c('0x22')],'UserId':_0x40e121['id'],'queue_name':_0x665054[_0xa55c('0x22')],'VoiceQueueId':_0x665054['id'],'interface':_[_0xa55c('0x6a')](_0x40e121[_0xa55c('0x6b')])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0x40e121[_0xa55c('0x22')]):_0x40e121[_0xa55c('0x6b')],'paused':_0x40e121['voicePause']||![],'penalty':_0x40e121[_0xa55c('0x63')]},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){_0x200c28[_0xa55c('0x6e')](function(_0x151533){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':_0x151533['id'],'VoiceQueueId':_0x665054['id']});});});});});}})[_0xa55c('0x14')](respondWithStatusCode(_0x1e4464,null))[_0xa55c('0x2c')](handleError(_0x1e4464,null));};exports[_0xa55c('0x71')]=function(_0x261087,_0x2ef9dd){return db['Team'][_0xa55c('0x2b')]({'where':{'id':_0x261087['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa55c('0x14')](handleEntityNotFound(_0x2ef9dd,null))['then'](function(_0x302284){var _0x231499=_[_0xa55c('0x25')](_0x302284,'id');var _0x2d3e42=[];var _0x97275b=[];var _0x5c7c60=squel[_0xa55c('0x72')]();_0x5c7c60['field'](_0xa55c('0x73'))['from']('team_has_voice_queues','tq')[_0xa55c('0x74')](_0xa55c('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa55c('0x50')](_0xa55c('0x76'),_0x261087[_0xa55c('0x2d')]['id']);for(var _0x485652=0x0;_0x485652<_0x302284['length'];_0x485652+=0x1){let _0x57a1fc=_0x302284[_0x485652];for(var _0x50018c=0x0;_0x50018c<_0x57a1fc[_0xa55c('0x5f')][_0xa55c('0x35')];_0x50018c+=0x1){let _0x4c77c4=_0x57a1fc[_0xa55c('0x5f')][_0x50018c];var _0x1322a0=_0x5c7c60[_0xa55c('0x42')]();_0x1322a0['where'](_0xa55c('0x77'),_0x4c77c4['id']);_0x97275b['push'](db['sequelize']['query'](_0x1322a0[_0xa55c('0x78')](),{'type':db['sequelize'][_0xa55c('0x79')]['SELECT']})[_0xa55c('0x14')](function(_0x21e529){if(_0x21e529[_0xa55c('0x35')]===0x1){return _0x4c77c4['id'];}else{var _0x5063e7=_[_0xa55c('0x7a')](_[_0xa55c('0x25')](_0x21e529,_0xa55c('0x7b')),function(_0x16401f){return _[_0xa55c('0x1d')](_0x231499,_0x16401f);});if(_0x5063e7){return _0x4c77c4['id'];}}}));}}return BPromise[_0xa55c('0x7c')](_0x97275b)[_0xa55c('0x14')](function(_0x34d755){_0x2d3e42=_(_0x2d3e42)[_0xa55c('0x7d')](_0x34d755)['compact']()[_0xa55c('0x1c')]();return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x261087[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x2c0b71){return db['sequelize'][_0xa55c('0x7e')](function(_0x5bae58){return _0x2c0b71[_0xa55c('0x71')](_0x261087[_0xa55c('0x2a')]['ids'],{'transaction':_0x5bae58})[_0xa55c('0x14')](function(){if(!_[_0xa55c('0x7f')](_0x2d3e42)){return _0x2c0b71['removeAgents'](_0x2d3e42,{'transaction':_0x5bae58})['then'](function(){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0x261087[_0xa55c('0x2d')]['id'],'UserId':_0x2d3e42},'transaction':_0x5bae58});});}})[_0xa55c('0x14')](function(){_0x2d3e42[_0xa55c('0x6e')](function(_0x1a335b){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':_0x1a335b,'VoiceQueueId':_0x2c0b71['id']});});});});});});})['then'](respondWithStatusCode(_0x2ef9dd,null))[_0xa55c('0x2c')](handleError(_0x2ef9dd,null));};exports[_0xa55c('0x81')]=function(_0xc8cd97,_0x21a206){var _0x29469d,_0x59a69d;return db[_0xa55c('0x26')]['find']({'where':{'id':_0xc8cd97['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x21a206,null))[_0xa55c('0x14')](function(_0x6fcc){if(_0x6fcc){_0x59a69d=_0x6fcc;return _0x6fcc[_0xa55c('0x81')](_0xc8cd97['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0xc8cd97[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{})[_0xa55c('0x83')](function(_0x4295c1){for(var _0x37f242=0x0;_0x37f242<_0xc8cd97[_0xa55c('0x3a')]['ids'][_0xa55c('0x35')];_0x37f242+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':Number(_0xc8cd97[_0xa55c('0x3a')]['ids'][_0x37f242]),'VoiceQueueId':Number(_0xc8cd97[_0xa55c('0x2d')]['id'])});}return _0x4295c1;});}})[_0xa55c('0x14')](function(_0x65c752){_0x29469d=_0x65c752||[];if(_0x59a69d){return db['User'][_0xa55c('0x2b')]({'where':{'id':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x82')]},'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x6b')],'raw':!![]});}})['then'](function(_0xcd4f3a){if(!_[_0xa55c('0x7f')](_0xcd4f3a)){var _0x496e8c=[];for(var _0x1c930b=0x0;_0x1c930b<_0xcd4f3a[_0xa55c('0x35')];_0x1c930b++){if(_0xcd4f3a[_0x1c930b][_0xa55c('0x60')]){_0x496e8c['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0xcd4f3a[_0x1c930b][_0xa55c('0x22')],'UserId':_0xcd4f3a[_0x1c930b]['id'],'queue_name':_0x59a69d[_0xa55c('0x22')],'VoiceQueueId':_0x59a69d['id'],'interface':_['isNil'](_0xcd4f3a[_0x1c930b]['interface'])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0xcd4f3a[_0x1c930b]['name']):_0xcd4f3a[_0x1c930b]['interface'],'paused':_0xcd4f3a[_0x1c930b][_0xa55c('0x61')]||![],'penalty':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x63')]||0x0}));}}return BPromise['all'](_0x496e8c);}})['then'](function(){return _0x29469d;})[_0xa55c('0x14')](respondWithResult(_0x21a206,null))['catch'](handleError(_0x21a206,null));};exports[_0xa55c('0x84')]=function(_0xe0a356,_0x5a4e69){return db[_0xa55c('0x26')]['find']({'where':{'id':_0xe0a356['params']['id']}})['then'](handleEntityNotFound(_0x5a4e69,null))['then'](function(_0x527669){if(_0x527669){return _0x527669[_0xa55c('0x84')](_0xe0a356['query'][_0xa55c('0x82')])[_0xa55c('0x14')](function(){if(_[_0xa55c('0x85')](_0xe0a356['query'][_0xa55c('0x82')])){for(var _0x111ff8=0x0;_0x111ff8<_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0xa55c('0x35')];_0x111ff8+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0x111ff8]),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}}else{socket['emit'](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')]['ids']),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}});}})[_0xa55c('0x14')](function(_0x940871){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0xe0a356[_0xa55c('0x2d')]['id'],'UserId':_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')]}})[_0xa55c('0x14')](function(){return _0x940871;});})[_0xa55c('0x14')](respondWithStatusCode(_0x5a4e69,null))[_0xa55c('0x2c')](handleError(_0x5a4e69,null));};exports[_0xa55c('0x86')]=function(_0x262d72,_0x228d12){var _0x16e229={};var _0x5c8713={};var _0x2d03b2;var _0x4b2e75;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x262d72[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x228d12,null))['then'](function(_0x537011){if(_0x537011){_0x2d03b2=_0x537011;_0x5c8713[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['User'][_0xa55c('0x30')]);_0x5c8713[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x262d72['query']);_0x5c8713[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5c8713[_0xa55c('0x2e')],_0x5c8713['query']);_0x16e229[_0xa55c('0x33')]=_['intersection'](_0x5c8713[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x16e229[_0xa55c('0x33')]=_0x16e229['attributes'][_0xa55c('0x35')]?_0x16e229[_0xa55c('0x33')]:_0x5c8713[_0xa55c('0x2e')];_0x16e229['order']=qs[_0xa55c('0x4f')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x16e229['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x262d72[_0xa55c('0x2a')],_0x5c8713[_0xa55c('0x31')]));if(_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x16e229[_0xa55c('0x50')]=_['merge'](_0x16e229[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x16e229[_0xa55c('0x33')],function(_0x100ccb){var _0x531e60={};_0x531e60[_0x100ccb]={'$like':'%'+_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x531e60;})});}_0x16e229=_[_0xa55c('0x43')]({},_0x16e229,_0x262d72[_0xa55c('0x37')]);return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0x243cf3){if(_0x243cf3){_0x4b2e75=_0x243cf3['length'];if(!_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x16e229[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x262d72['query']['limit']);_0x16e229['offset']=qs[_0xa55c('0x10')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0xb22076){if(_0xb22076){return _0xb22076?{'count':_0x4b2e75,'rows':_0xb22076}:null;}})[_0xa55c('0x14')](respondWithResult(_0x228d12,null))[_0xa55c('0x2c')](handleError(_0x228d12,null));};exports['getMembers']=function(_0x35c42c,_0x3b2174){var _0x35375e={};var _0x19a5f1={};var _0x3e7cfa;var _0xd511c0;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x35c42c['params']['id']}})['then'](handleEntityNotFound(_0x3b2174,null))['then'](function(_0x58831d){if(_0x58831d){_0x3e7cfa=_0x58831d;_0x19a5f1[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x69')][_0xa55c('0x30')]);_0x19a5f1[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x35c42c[_0xa55c('0x2a')]);_0x19a5f1[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x19a5f1[_0xa55c('0x2e')],_0x19a5f1[_0xa55c('0x2a')]);_0x35375e['attributes']=_['intersection'](_0x19a5f1[_0xa55c('0x2e')],qs['fields'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x35375e[_0xa55c('0x33')]=_0x35375e[_0xa55c('0x33')][_0xa55c('0x35')]?_0x35375e[_0xa55c('0x33')]:_0x19a5f1[_0xa55c('0x2e')];_0x35375e[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x35c42c['query'][_0xa55c('0x4f')]);_0x35375e[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x35c42c[_0xa55c('0x2a')],_0x19a5f1[_0xa55c('0x31')]));if(_0x35c42c[_0xa55c('0x2a')]['filter']){_0x35375e[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x35375e[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x35375e['attributes'],function(_0x55459c){var _0x33d58c={};_0x33d58c[_0x55459c]={'$like':'%'+_0x35c42c['query']['filter']+'%'};return _0x33d58c;})});}_0x35375e=_[_0xa55c('0x43')]({},_0x35375e,_0x35c42c[_0xa55c('0x37')]);return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})[_0xa55c('0x14')](function(_0x5184ea){if(_0x5184ea){_0xd511c0=_0x5184ea[_0xa55c('0x35')];if(!_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x35375e[_0xa55c('0x4d')]=qs['limit'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x35375e[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})['then'](function(_0x2d5e0e){return _0x2d5e0e?{'count':_0xd511c0,'rows':_0x2d5e0e}:null;})['then'](respondWithResult(_0x3b2174,null))[_0xa55c('0x2c')](handleError(_0x3b2174,null));};exports[_0xa55c('0x88')]=function(_0x3755a7,_0x50663f){var _0x50b42f={};var _0x307b39={};var _0x1319c6;var _0x536e1d;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x3755a7[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50663f,null))[_0xa55c('0x14')](function(_0x568a42){if(_0x568a42){_0x1319c6=_0x568a42;_0x307b39[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x89')][_0xa55c('0x30')]);_0x307b39['query']=_[_0xa55c('0x2f')](_0x3755a7[_0xa55c('0x2a')]);_0x307b39[_0xa55c('0x31')]=_['intersection'](_0x307b39['model'],_0x307b39[_0xa55c('0x2a')]);_0x50b42f['attributes']=_['intersection'](_0x307b39[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x50b42f[_0xa55c('0x33')]=_0x50b42f[_0xa55c('0x33')][_0xa55c('0x35')]?_0x50b42f[_0xa55c('0x33')]:_0x307b39[_0xa55c('0x2e')];_0x50b42f[_0xa55c('0x4e')]=qs['sort'](_0x3755a7['query'][_0xa55c('0x4f')]);_0x50b42f[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x3755a7['query'],_0x307b39[_0xa55c('0x31')]));if(_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x50b42f[_0xa55c('0x50')]=_['merge'](_0x50b42f[_0xa55c('0x50')],{'$or':_['map'](_0x50b42f['attributes'],function(_0x545806){var _0x4fbb59={};_0x4fbb59[_0x545806]={'$like':'%'+_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x4fbb59;})});}_0x50b42f=_['merge']({},_0x50b42f,_0x3755a7[_0xa55c('0x37')]);return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x3899bd){if(_0x3899bd){_0x536e1d=_0x3899bd[_0xa55c('0x35')];if(!_0x3755a7[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x50b42f[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x3755a7[_0xa55c('0x2a')]['limit']);_0x50b42f['offset']=qs['offset'](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x1205cb){if(_0x1205cb){return _0x1205cb?{'count':_0x536e1d,'rows':_0x1205cb}:null;}})[_0xa55c('0x14')](respondWithResult(_0x50663f,null))[_0xa55c('0x2c')](handleError(_0x50663f,null));};exports[_0xa55c('0x8a')]=function(_0x499008,_0x4ef239){var _0x3e3208=moment()[_0xa55c('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e19d6,_0x286b33;return db['VoiceQueue']['find']({'where':{'id':_0x499008[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x4ef239,null))[_0xa55c('0x14')](function(_0x236015){if(_0x236015){_0x286b33=_0x236015;return _0x236015['addLists'](_0x499008['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0x499008[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x18e4fd){var _0x185c5b;_0x1e19d6=_0x18e4fd||[];var _0x2511fe=[];if(_0x18e4fd){for(var _0x3ba948=0x0;_0x3ba948<_0x18e4fd[_0xa55c('0x35')];_0x3ba948+=0x1){var _0x5e83e9=_0x18e4fd[_0x3ba948][_0xa55c('0x16')]({'plain':!![]});_0x286b33['dialCheckDuplicateType']=_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]?_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]:_0x286b33[_0xa55c('0x8b')];switch(_0x286b33[_0xa55c('0x8b')]){case _0xa55c('0x8c'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('phone',_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','scheduledAt')[_0xa55c('0x94')]('id',_0xa55c('0x95'))['field'](_0x5e83e9[_0xa55c('0x96')]['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')]['toString']())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()['field'](_0xa55c('0x9c'))[_0xa55c('0x97')](_0xa55c('0x9d'))[_0xa55c('0x50')]('VoiceQueueId\x20=\x20?',_0x499008['params']['id'][_0xa55c('0x78')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008['params']['id'][_0xa55c('0x78')]())))[_0xa55c('0x78')]();break;case _0xa55c('0x9e'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))['field']('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))['field']('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))['where'](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x9f'))[_0xa55c('0x97')](_0xa55c('0x8f'))[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008[_0xa55c('0x2d')]['id']['toString']())))[_0xa55c('0x78')]();break;default:_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),'VoiceQueueId',_0xa55c('0x45'),'updatedAt'],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))['field'](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL'))[_0xa55c('0x78')]();}_0x2511fe[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x185c5b));}return BPromise[_0xa55c('0x7c')](_0x2511fe);}})[_0xa55c('0x14')](function(){var _0x4457e9=[];var _0x456cb9=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xa1'))[_0xa55c('0x90')]([_0xa55c('0xa2'),_0xa55c('0x91'),'OrderBy',_0xa55c('0x45'),_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0xa3'))['field']('ci.item')['field']('ci.OrderBy+1')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0xa4'),'ci')[_0xa55c('0x74')](_0xa55c('0x8f'),'h',_0xa55c('0xa5'))[_0xa55c('0x50')](_0xa55c('0xa6'),_0x3e3208)[_0xa55c('0x50')](_0xa55c('0xa7'),'PHONE'))[_0xa55c('0x78')]();_0x4457e9[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x456cb9));return BPromise['all'](_0x4457e9);})['then'](function(){return _0x1e19d6;})[_0xa55c('0x14')](respondWithResult(_0x4ef239,null))[_0xa55c('0x2c')](handleError(_0x4ef239,null));};exports[_0xa55c('0xa8')]=function(_0x27cd1b,_0x3ed3a5){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x27cd1b[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x3ed3a5,null))[_0xa55c('0x14')](function(_0x3def57){if(_0x3def57){return _0x3def57[_0xa55c('0xa8')](_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x4f5f1a){if(_0x4f5f1a){return db[_0xa55c('0x4a')]['destroy']({'where':{'ListId':_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x27cd1b[_0xa55c('0x2d')]['id']}})['then'](function(){return _0x4f5f1a;});}})['then'](respondWithStatusCode(_0x3ed3a5,null))[_0xa55c('0x2c')](handleError(_0x3ed3a5,null));};exports[_0xa55c('0xa9')]=function(_0x30af02,_0x5ebd8a){var _0x2420da={};var _0x2a4b78={};var _0x1e4c2d;var _0x2bf777;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x30af02[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ebd8a,null))[_0xa55c('0x14')](function(_0x266b12){if(_0x266b12){_0x1e4c2d=_0x266b12;_0x2a4b78[_0xa55c('0x2e')]=_['keys'](db[_0xa55c('0x89')]['rawAttributes']);_0x2a4b78[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x30af02['query']);_0x2a4b78[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2a4b78[_0xa55c('0x2e')],_0x2a4b78['query']);_0x2420da[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x2a4b78['model'],qs['fields'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2420da[_0xa55c('0x33')]=_0x2420da[_0xa55c('0x33')][_0xa55c('0x35')]?_0x2420da['attributes']:_0x2a4b78[_0xa55c('0x2e')];_0x2420da['order']=qs['sort'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x2420da['where']=qs[_0xa55c('0x31')](_['pick'](_0x30af02[_0xa55c('0x2a')],_0x2a4b78[_0xa55c('0x31')]));if(_0x30af02['query'][_0xa55c('0x1a')]){_0x2420da[_0xa55c('0x50')]=_['merge'](_0x2420da[_0xa55c('0x50')],{'$or':_['map'](_0x2420da['attributes'],function(_0x37273b){var _0x1cd529={};_0x1cd529[_0x37273b]={'$like':'%'+_0x30af02[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x1cd529;})});}_0x2420da=_[_0xa55c('0x43')]({},_0x2420da,_0x30af02[_0xa55c('0x37')]);return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})['then'](function(_0x27e791){if(_0x27e791){_0x2bf777=_0x27e791[_0xa55c('0x35')];if(!_0x30af02['query'][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x2420da['limit']=qs[_0xa55c('0x4d')](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x2420da[_0xa55c('0x10')]=qs['offset'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})[_0xa55c('0x14')](function(_0x365331){if(_0x365331){return _0x365331?{'count':_0x2bf777,'rows':_0x365331}:null;}})[_0xa55c('0x14')](respondWithResult(_0x5ebd8a,null))['catch'](handleError(_0x5ebd8a,null));};exports[_0xa55c('0xaa')]=function(_0x4d7cd6,_0x1ca9bd){var _0x2bf932;return db['VoiceQueue']['find']({'where':{'id':_0x4d7cd6[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x1ca9bd,null))[_0xa55c('0x14')](function(_0x3c9d2b){if(_0x3c9d2b){return _0x3c9d2b[_0xa55c('0xaa')](_0x4d7cd6[_0xa55c('0x3a')][_0xa55c('0x82')],_['omit'](_0x4d7cd6[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x158b01){var _0x19f576;_0x2bf932=_0x158b01||[];var _0x10da4b=[];if(_0x158b01){for(var _0x3320ab=0x0;_0x3320ab<_0x158b01[_0xa55c('0x35')];_0x3320ab+=0x1){var _0x298cf5=_0x158b01[_0x3320ab][_0xa55c('0x16')]({'plain':!![]});_0x19f576=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xab'))['fromQuery']([_0xa55c('0x91'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))['field']('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x298cf5[_0xa55c('0x96')]['toString'](),'ListId')['field'](_0x4d7cd6[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),'VoiceQueueId')[_0xa55c('0x94')](_0xa55c('0xac'),_0xa55c('0x45'))[_0xa55c('0x94')](_0xa55c('0xac'),'updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')]('ListId\x20=\x20?',_0x298cf5['CmListId'][_0xa55c('0x78')]())[_0xa55c('0x50')](_0xa55c('0xad')))['toString']();_0x10da4b[_0xa55c('0xa0')](db[_0xa55c('0x64')][_0xa55c('0x2a')](_0x19f576));}return BPromise[_0xa55c('0x7c')](_0x10da4b);}})[_0xa55c('0x14')](function(){return _0x2bf932;})[_0xa55c('0x14')](respondWithResult(_0x1ca9bd,null))[_0xa55c('0x2c')](handleError(_0x1ca9bd,null));};exports[_0xa55c('0xae')]=function(_0x23862a,_0xb432d1){return db['VoiceQueue'][_0xa55c('0x38')]({'where':{'id':_0x23862a[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb432d1,null))[_0xa55c('0x14')](function(_0x5bc270){if(_0x5bc270){return _0x5bc270[_0xa55c('0xae')](_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x543b4a){if(_0x543b4a){return db[_0xa55c('0x59')]['destroy']({'where':{'ListId':_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x23862a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(){return _0x543b4a;});}})[_0xa55c('0x14')](respondWithStatusCode(_0xb432d1,null))['catch'](handleError(_0xb432d1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 20aec12..ae3b283 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 _0x5fdf=['update','remove','exports','../../mysqldb','VoiceQueue','setMaxListeners','save'];(function(_0x5b4dea,_0x99def6){var _0x1b6b84=function(_0x2f9dfa){while(--_0x2f9dfa){_0x5b4dea['push'](_0x5b4dea['shift']());}};_0x1b6b84(++_0x99def6);}(_0x5fdf,0xea));var _0xf5fd=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x5fdf[_0x39e164];return _0x13fa6b;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xf5fd('0x0'))['db'][_0xf5fd('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf5fd('0x2')](0x0);var events={'afterCreate':_0xf5fd('0x3'),'afterUpdate':_0xf5fd('0x4'),'afterDestroy':_0xf5fd('0x5')};function emitEvent(_0x39cf7b){return function(_0x37965d,_0x36f8f0,_0x2eafcb){VoiceQueueEvents['emit'](_0x39cf7b+':'+_0x37965d['id'],_0x37965d);VoiceQueueEvents['emit'](_0x39cf7b,_0x37965d);_0x2eafcb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xf5fd('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xe42a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x16139e,_0x2b5b50){var _0x29351e=function(_0x34052d){while(--_0x34052d){_0x16139e['push'](_0x16139e['shift']());}};_0x29351e(++_0x2b5b50);}(_0xe42a,0xaa));var _0xae42=function(_0x2eaf57,_0x43764b){_0x2eaf57=_0x2eaf57-0x0;var _0x245a23=_0xe42a[_0x2eaf57];return _0x245a23;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xae42('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xae42('0x1')](0x0);var events={'afterCreate':_0xae42('0x2'),'afterUpdate':_0xae42('0x3'),'afterDestroy':_0xae42('0x4')};function emitEvent(_0x223183){return function(_0x297d18,_0x14d251,_0x5d522e){VoiceQueueEvents[_0xae42('0x5')](_0x223183+':'+_0x297d18['id'],_0x297d18);VoiceQueueEvents['emit'](_0x223183,_0x297d18);_0x5d522e(null);};}for(var e in events){if(events[_0xae42('0x6')](e)){var event=events[e];VoiceQueue[_0xae42('0x7')](e,emitEvent(event));}}module[_0xae42('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 347e14d..4bfb6a9 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(_0x46186d,_0x474594){var _0x1a9a56=function(_0x296d16){while(--_0x296d16){_0x46186d['push'](_0x46186d['shift']());}};_0x1a9a56(++_0x474594);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1f9bce,_0x1554e6){var _0x549bf3=function(_0x45cc74){while(--_0x45cc74){_0x1f9bce['push'](_0x1f9bce['shift']());}};_0x549bf3(++_0x1554e6);}(_0x70e0,0x17b));var _0x070e=function(_0xb17b4d,_0x22e73d){_0xb17b4d=_0xb17b4d-0x0;var _0xc91c76=_0x70e0[_0xb17b4d];return _0xc91c76;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 0cf8628..55306e8 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 _0x821a=['client','http','redis','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xb2fc60,_0x3295ed){var _0x40fbde=function(_0x29aca5){while(--_0x29aca5){_0xb2fc60['push'](_0xb2fc60['shift']());}};_0x40fbde(++_0x3295ed);}(_0x821a,0x172));var _0xa821=function(_0x55527a,_0xbffef8){_0x55527a=_0x55527a-0x0;var _0x4ddc0d=_0x821a[_0x55527a];return _0x4ddc0d;};'use strict';var _=require(_0xa821('0x0'));var util=require(_0xa821('0x1'));var moment=require(_0xa821('0x2'));var BPromise=require(_0xa821('0x3'));var rs=require(_0xa821('0x4'));var fs=require('fs');var Redis=require(_0xa821('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa821('0x6'));var logger=require(_0xa821('0x7'))(_0xa821('0x8'));var config=require(_0xa821('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa821('0xa')][_0xa821('0xb')]({'port':0x232a});config[_0xa821('0xc')]=_['defaults'](config[_0xa821('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa821('0xd'))(new Redis(config[_0xa821('0xc')]));require('./voiceQueue.socket')[_0xa821('0xe')](socket);function respondWithRpcPromise(_0x367a51,_0x4226df,_0x10f091){return new BPromise(function(_0x8b3c9f,_0x4b1488){return client['request'](_0x367a51,_0x10f091)[_0xa821('0xf')](function(_0x139bbe){logger[_0xa821('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x4226df,_0xa821('0x11'));logger[_0xa821('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4226df,_0xa821('0x11'),JSON[_0xa821('0x13')](_0x139bbe));if(_0x139bbe[_0xa821('0x14')]){if(_0x139bbe[_0xa821('0x14')]['code']===0x1f4){logger[_0xa821('0x14')](_0xa821('0x15'),_0x4226df,_0x139bbe[_0xa821('0x14')]['message']);return _0x4b1488(_0x139bbe[_0xa821('0x14')]['message']);}logger[_0xa821('0x14')](_0xa821('0x15'),_0x4226df,_0x139bbe['error']['message']);return _0x8b3c9f(_0x139bbe[_0xa821('0x14')][_0xa821('0x16')]);}else{logger[_0xa821('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x4226df,'request\x20sent');_0x8b3c9f(_0x139bbe[_0xa821('0x17')][_0xa821('0x16')]);}})[_0xa821('0x18')](function(_0x44aca1){logger[_0xa821('0x14')](_0xa821('0x15'),_0x4226df,_0x44aca1);_0x4b1488(_0x44aca1);});});}exports[_0xa821('0x19')]=function(_0x437a4b){var _0x46f0bd=this;return new Promise(function(_0x5b6fa5,_0x2c0ebc){return db[_0xa821('0x1a')][_0xa821('0x1b')]({'raw':_0x437a4b['options']?_0x437a4b[_0xa821('0x1c')][_0xa821('0x1d')]===undefined?!![]:![]:!![],'where':_0x437a4b[_0xa821('0x1c')]?_0x437a4b[_0xa821('0x1c')]['where']||null:null,'attributes':_0x437a4b[_0xa821('0x1c')]?_0x437a4b['options'][_0xa821('0x1e')]||null:null,'limit':_0x437a4b[_0xa821('0x1c')]?_0x437a4b[_0xa821('0x1c')][_0xa821('0x1f')]||null:null,'include':_0x437a4b[_0xa821('0x1c')]?_0x437a4b[_0xa821('0x1c')][_0xa821('0x20')]?_[_0xa821('0x21')](_0x437a4b['options'][_0xa821('0x20')],function(_0xafe6b1){return{'model':db[_0xafe6b1[_0xa821('0x22')]],'as':_0xafe6b1['as'],'attributes':_0xafe6b1[_0xa821('0x1e')],'include':_0xafe6b1[_0xa821('0x20')]?_[_0xa821('0x21')](_0xafe6b1[_0xa821('0x20')],function(_0x5eb8ab){return{'model':db[_0x5eb8ab['model']],'as':_0x5eb8ab['as'],'attributes':_0x5eb8ab[_0xa821('0x1e')],'include':_0x5eb8ab[_0xa821('0x20')]?_[_0xa821('0x21')](_0x5eb8ab[_0xa821('0x20')],function(_0x333779){return{'model':db[_0x333779[_0xa821('0x22')]],'as':_0x333779['as'],'attributes':_0x333779[_0xa821('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa821('0xf')](function(_0x24d6b3){logger[_0xa821('0x10')](_0xa821('0x19'),_0x437a4b);logger[_0xa821('0x12')]('GetVoiceQueue',_0x437a4b,JSON[_0xa821('0x13')](_0x24d6b3));_0x5b6fa5(_0x24d6b3);})['catch'](function(_0x2d2578){logger[_0xa821('0x14')](_0xa821('0x19'),_0x2d2578[_0xa821('0x16')],_0x437a4b);_0x2c0ebc(_0x46f0bd[_0xa821('0x14')](0x1f4,_0x2d2578[_0xa821('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x377d56){var _0x2cf021=this;return new Promise(function(_0x333282,_0x2eee7b){return db[_0xa821('0x1a')][_0xa821('0x23')]({'raw':_0x377d56['options']?_0x377d56[_0xa821('0x1c')][_0xa821('0x1d')]===undefined?!![]:![]:!![],'where':_0x377d56['options']?_0x377d56['options'][_0xa821('0x24')]||null:null,'attributes':_0x377d56['options']?_0x377d56[_0xa821('0x1c')][_0xa821('0x1e')]||null:null,'include':_0x377d56[_0xa821('0x1c')]?_0x377d56['options']['include']?_[_0xa821('0x21')](_0x377d56[_0xa821('0x1c')][_0xa821('0x20')],function(_0x2a963a){return{'model':db[_0x2a963a[_0xa821('0x22')]],'as':_0x2a963a['as'],'attributes':_0x2a963a['attributes'],'include':_0x2a963a[_0xa821('0x20')]?_[_0xa821('0x21')](_0x2a963a['include'],function(_0x385016){return{'model':db[_0x385016[_0xa821('0x22')]],'as':_0x385016['as'],'attributes':_0x385016[_0xa821('0x1e')],'include':_0x385016[_0xa821('0x20')]?_['map'](_0x385016[_0xa821('0x20')],function(_0xda27e7){return{'model':db[_0xda27e7[_0xa821('0x22')]],'as':_0xda27e7['as'],'attributes':_0xda27e7['attributes']};}):[]};}):[]};}):[]:[]})[_0xa821('0xf')](function(_0x2119d0){logger['info']('ShowVoiceQueue',_0x377d56);logger['debug'](_0xa821('0x25'),_0x377d56,JSON['stringify'](_0x2119d0));_0x333282(_0x2119d0);})['catch'](function(_0x42ac8b){logger['error'](_0xa821('0x25'),_0x42ac8b[_0xa821('0x16')],_0x377d56);_0x2eee7b(_0x2cf021[_0xa821('0x14')](0x1f4,_0x42ac8b[_0xa821('0x16')]));});});}; \ No newline at end of file +var _0xb81f=['options','raw','where','attributes','limit','include','model','map','find','ShowVoiceQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetVoiceQueue','VoiceQueue','findAll'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb81f,0x186));var _0xfb81=function(_0x2e1ada,_0x32519c){_0x2e1ada=_0x2e1ada-0x0;var _0x127abb=_0xb81f[_0x2e1ada];return _0x127abb;};'use strict';var _=require(_0xfb81('0x0'));var util=require(_0xfb81('0x1'));var moment=require(_0xfb81('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb81('0x4'))['db'];var utils=require(_0xfb81('0x5'));var logger=require(_0xfb81('0x6'))('rpc');var config=require(_0xfb81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfb81('0x8')][_0xfb81('0x9')]({'port':0x232a});config['redis']=_[_0xfb81('0xa')](config['redis'],{'host':_0xfb81('0xb'),'port':0x18eb});var socket=require(_0xfb81('0xc'))(new Redis(config[_0xfb81('0xd')]));require('./voiceQueue.socket')[_0xfb81('0xe')](socket);function respondWithRpcPromise(_0x314fd4,_0x1b51bc,_0x11fb59){return new BPromise(function(_0x1dfaaf,_0x3f34f8){return client[_0xfb81('0xf')](_0x314fd4,_0x11fb59)[_0xfb81('0x10')](function(_0x2c0039){logger[_0xfb81('0x11')](_0xfb81('0x12'),_0x1b51bc,_0xfb81('0x13'));logger[_0xfb81('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1b51bc,_0xfb81('0x13'),JSON[_0xfb81('0x15')](_0x2c0039));if(_0x2c0039[_0xfb81('0x16')]){if(_0x2c0039['error']['code']===0x1f4){logger[_0xfb81('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1b51bc,_0x2c0039[_0xfb81('0x16')][_0xfb81('0x17')]);return _0x3f34f8(_0x2c0039[_0xfb81('0x16')][_0xfb81('0x17')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x1b51bc,_0x2c0039[_0xfb81('0x16')][_0xfb81('0x17')]);return _0x1dfaaf(_0x2c0039['error'][_0xfb81('0x17')]);}else{logger['info'](_0xfb81('0x12'),_0x1b51bc,'request\x20sent');_0x1dfaaf(_0x2c0039['result'][_0xfb81('0x17')]);}})[_0xfb81('0x18')](function(_0x2635fd){logger[_0xfb81('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1b51bc,_0x2635fd);_0x3f34f8(_0x2635fd);});});}exports[_0xfb81('0x19')]=function(_0x34f93f){var _0x10e148=this;return new Promise(function(_0x9a9d9c,_0x5d03a0){return db[_0xfb81('0x1a')][_0xfb81('0x1b')]({'raw':_0x34f93f[_0xfb81('0x1c')]?_0x34f93f[_0xfb81('0x1c')][_0xfb81('0x1d')]===undefined?!![]:![]:!![],'where':_0x34f93f[_0xfb81('0x1c')]?_0x34f93f[_0xfb81('0x1c')][_0xfb81('0x1e')]||null:null,'attributes':_0x34f93f[_0xfb81('0x1c')]?_0x34f93f['options'][_0xfb81('0x1f')]||null:null,'limit':_0x34f93f[_0xfb81('0x1c')]?_0x34f93f['options'][_0xfb81('0x20')]||null:null,'include':_0x34f93f[_0xfb81('0x1c')]?_0x34f93f[_0xfb81('0x1c')][_0xfb81('0x21')]?_['map'](_0x34f93f[_0xfb81('0x1c')][_0xfb81('0x21')],function(_0x14049c){return{'model':db[_0x14049c[_0xfb81('0x22')]],'as':_0x14049c['as'],'attributes':_0x14049c[_0xfb81('0x1f')],'include':_0x14049c[_0xfb81('0x21')]?_[_0xfb81('0x23')](_0x14049c[_0xfb81('0x21')],function(_0x3e2b60){return{'model':db[_0x3e2b60[_0xfb81('0x22')]],'as':_0x3e2b60['as'],'attributes':_0x3e2b60[_0xfb81('0x1f')],'include':_0x3e2b60[_0xfb81('0x21')]?_['map'](_0x3e2b60[_0xfb81('0x21')],function(_0x568fd4){return{'model':db[_0x568fd4['model']],'as':_0x568fd4['as'],'attributes':_0x568fd4[_0xfb81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb81('0x10')](function(_0x4b5dd5){logger[_0xfb81('0x11')](_0xfb81('0x19'),_0x34f93f);logger[_0xfb81('0x14')](_0xfb81('0x19'),_0x34f93f,JSON[_0xfb81('0x15')](_0x4b5dd5));_0x9a9d9c(_0x4b5dd5);})[_0xfb81('0x18')](function(_0x2d002f){logger['error'](_0xfb81('0x19'),_0x2d002f['message'],_0x34f93f);_0x5d03a0(_0x10e148[_0xfb81('0x16')](0x1f4,_0x2d002f[_0xfb81('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x3901c5){var _0x2c5078=this;return new Promise(function(_0x4c4c2a,_0x1f8dbb){return db[_0xfb81('0x1a')][_0xfb81('0x24')]({'raw':_0x3901c5[_0xfb81('0x1c')]?_0x3901c5[_0xfb81('0x1c')][_0xfb81('0x1d')]===undefined?!![]:![]:!![],'where':_0x3901c5[_0xfb81('0x1c')]?_0x3901c5[_0xfb81('0x1c')][_0xfb81('0x1e')]||null:null,'attributes':_0x3901c5[_0xfb81('0x1c')]?_0x3901c5[_0xfb81('0x1c')][_0xfb81('0x1f')]||null:null,'include':_0x3901c5[_0xfb81('0x1c')]?_0x3901c5['options']['include']?_[_0xfb81('0x23')](_0x3901c5[_0xfb81('0x1c')][_0xfb81('0x21')],function(_0x509ee1){return{'model':db[_0x509ee1[_0xfb81('0x22')]],'as':_0x509ee1['as'],'attributes':_0x509ee1[_0xfb81('0x1f')],'include':_0x509ee1[_0xfb81('0x21')]?_[_0xfb81('0x23')](_0x509ee1[_0xfb81('0x21')],function(_0x2e3148){return{'model':db[_0x2e3148[_0xfb81('0x22')]],'as':_0x2e3148['as'],'attributes':_0x2e3148[_0xfb81('0x1f')],'include':_0x2e3148[_0xfb81('0x21')]?_[_0xfb81('0x23')](_0x2e3148[_0xfb81('0x21')],function(_0x3ea54d){return{'model':db[_0x3ea54d['model']],'as':_0x3ea54d['as'],'attributes':_0x3ea54d[_0xfb81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfb81('0x10')](function(_0x30d09f){logger[_0xfb81('0x11')](_0xfb81('0x25'),_0x3901c5);logger[_0xfb81('0x14')]('ShowVoiceQueue',_0x3901c5,JSON[_0xfb81('0x15')](_0x30d09f));_0x4c4c2a(_0x30d09f);})[_0xfb81('0x18')](function(_0x479a4f){logger[_0xfb81('0x16')](_0xfb81('0x25'),_0x479a4f['message'],_0x3901c5);_0x1f8dbb(_0x2c5078['error'](0x1f4,_0x479a4f[_0xfb81('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e6acff0..1a0d50c 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 _0x0dee=['removeListener','register','length','voiceQueue:','update'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x0dee,0xe0));var _0xe0de=function(_0x18289e,_0x57a2ff){_0x18289e=_0x18289e-0x0;var _0x2faf4f=_0x0dee[_0x18289e];return _0x2faf4f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save','remove',_0xe0de('0x0')];function createListener(_0x3f0488,_0x3a90f4){return function(_0x29926a){_0x3a90f4['emit'](_0x3f0488,_0x29926a);};}function removeListener(_0x109c82,_0x5182b8){return function(){VoiceQueueEvents[_0xe0de('0x1')](_0x109c82,_0x5182b8);};}exports[_0xe0de('0x2')]=function(_0x5c4bf9){for(var _0x172f88=0x0,_0x78615b=events[_0xe0de('0x3')];_0x172f88<_0x78615b;_0x172f88++){var _0x10ff6b=events[_0x172f88];var _0x1ebb39=createListener(_0xe0de('0x4')+_0x10ff6b,_0x5c4bf9);VoiceQueueEvents['on'](_0x10ff6b,_0x1ebb39);}}; \ No newline at end of file +var _0x0bb3=['save','remove','update','emit','register','length','./voiceQueue.events'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0bb3,0x1e2));var _0x30bb=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x0bb3[_0x1b4b23];return _0x2a325b;};'use strict';var VoiceQueueEvents=require(_0x30bb('0x0'));var events=[_0x30bb('0x1'),_0x30bb('0x2'),_0x30bb('0x3')];function createListener(_0x9f082e,_0x54dc88){return function(_0x11cbbc){_0x54dc88[_0x30bb('0x4')](_0x9f082e,_0x11cbbc);};}function removeListener(_0x31c9bc,_0x4454a5){return function(){VoiceQueueEvents['removeListener'](_0x31c9bc,_0x4454a5);};}exports[_0x30bb('0x5')]=function(_0xf4e9f){for(var _0x34e6d3=0x0,_0x382f3b=events[_0x30bb('0x6')];_0x34e6d3<_0x382f3b;_0x34e6d3++){var _0x271008=events[_0x34e6d3];var _0x681b7a=createListener('voiceQueue:'+_0x271008,_0xf4e9f);VoiceQueueEvents['on'](_0x271008,_0x681b7a);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 0044cc0..a0e09d7 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 _0xb905=['post','create','put','/:id','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport'];(function(_0x1eaf93,_0x241082){var _0x2825bc=function(_0x2da047){while(--_0x2da047){_0x1eaf93['push'](_0x1eaf93['shift']());}};_0x2825bc(++_0x241082);}(_0xb905,0x131));var _0x5b90=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb905[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require(_0x5b90('0x0'));var path=require(_0x5b90('0x1'));var timeout=require(_0x5b90('0x2'));var express=require('express');var router=express[_0x5b90('0x3')]();var fs_extra=require(_0x5b90('0x4'));var auth=require(_0x5b90('0x5'));var interaction=require(_0x5b90('0x6'));var config=require(_0x5b90('0x7'));var controller=require(_0x5b90('0x8'));router[_0x5b90('0x9')]('/',auth[_0x5b90('0xa')](),controller[_0x5b90('0xb')]);router['get'](_0x5b90('0xc'),auth[_0x5b90('0xa')](),controller[_0x5b90('0xd')]);router[_0x5b90('0x9')]('/index',auth[_0x5b90('0xa')](),controller[_0x5b90('0xe')]);router[_0x5b90('0x9')]('/:id',auth[_0x5b90('0xa')](),controller['show']);router[_0x5b90('0xf')]('/',auth[_0x5b90('0xa')](),controller[_0x5b90('0x10')]);router[_0x5b90('0x11')]('/:id',auth[_0x5b90('0xa')](),controller['update']);router['delete'](_0x5b90('0x12'),auth[_0x5b90('0xa')](),controller[_0x5b90('0x13')]);module['exports']=router; \ No newline at end of file +var _0xbcfc=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0xadd542,_0x2815a5){var _0x2ff5a5=function(_0x4f1be0){while(--_0x4f1be0){_0xadd542['push'](_0xadd542['shift']());}};_0x2ff5a5(++_0x2815a5);}(_0xbcfc,0x15d));var _0xcbcf=function(_0x5a2963,_0x2bbab1){_0x5a2963=_0x5a2963-0x0;var _0x4952ca=_0xbcfc[_0x5a2963];return _0x4952ca;};'use strict';var multer=require(_0xcbcf('0x0'));var util=require('util');var path=require(_0xcbcf('0x1'));var timeout=require('connect-timeout');var express=require(_0xcbcf('0x2'));var router=express[_0xcbcf('0x3')]();var fs_extra=require(_0xcbcf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcbcf('0x5'));var config=require(_0xcbcf('0x6'));var controller=require(_0xcbcf('0x7'));router[_0xcbcf('0x8')]('/',auth[_0xcbcf('0x9')](),controller[_0xcbcf('0xa')]);router[_0xcbcf('0x8')](_0xcbcf('0xb'),auth[_0xcbcf('0x9')](),controller['describe']);router[_0xcbcf('0x8')](_0xcbcf('0xc'),auth[_0xcbcf('0x9')](),controller[_0xcbcf('0xd')]);router[_0xcbcf('0x8')](_0xcbcf('0xe'),auth[_0xcbcf('0x9')](),controller['show']);router[_0xcbcf('0xf')]('/',auth[_0xcbcf('0x9')](),controller[_0xcbcf('0x10')]);router[_0xcbcf('0x11')](_0xcbcf('0xe'),auth[_0xcbcf('0x9')](),controller[_0xcbcf('0x12')]);router[_0xcbcf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xcbcf('0x14')]);module[_0xcbcf('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8117ff8..8cd7ea2 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 _0x7cd5=['format','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x7cd5,0xbd));var _0x57cd=function(_0x52b52c,_0x3b4a77){_0x52b52c=_0x52b52c-0x0;var _0xbdb209=_0x7cd5[_0x52b52c];return _0xbdb209;};'use strict';var Sequelize=require(_0x57cd('0x0'));var moment=require('moment');module[_0x57cd('0x1')]={'type':{'type':Sequelize[_0x57cd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x57cd('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x57cd('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x57cd('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x527149){var _0x7de88e=moment(_0x527149);var _0x5c5c00=moment(this[_0x57cd('0x4')](_0x57cd('0x5')))[_0x57cd('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x28691b=_0x7de88e[_0x57cd('0x7')](_0x5c5c00,_0x57cd('0x8'));this[_0x57cd('0x9')](_0x57cd('0xa'),_0x527149);this['setDataValue']('holdtime',_0x28691b||null);}},'position':{'type':Sequelize[_0x57cd('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x57cd('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x57cd('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x57cd('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x57cd('0x3')]},'queuecallerexit':{'type':Sequelize[_0x57cd('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x57cd('0x2')],'comment':_0x57cd('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x57cd('0x2')]},'connectedlinenum':{'type':Sequelize[_0x57cd('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x57cd('0x2')]},'context':{'type':Sequelize[_0x57cd('0x2')]},'exten':{'type':Sequelize[_0x57cd('0x2')]},'priority':{'type':Sequelize[_0x57cd('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x57cd('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x57cd('0x2')]},'transfer':{'type':Sequelize[_0x57cd('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x57cd('0x2')],'comment':_0x57cd('0xe')},'transferexten':{'type':Sequelize[_0x57cd('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x57cd('0x2')]},'secondDisposition':{'type':Sequelize[_0x57cd('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x57cd('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x57cd('0x2')]}}; \ No newline at end of file +var _0x0561=['YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','format'];(function(_0x172eb4,_0x4ae801){var _0x7ff428=function(_0x35dcbd){while(--_0x35dcbd){_0x172eb4['push'](_0x172eb4['shift']());}};_0x7ff428(++_0x4ae801);}(_0x0561,0x1da));var _0x1056=function(_0xe94703,_0x30f740){_0xe94703=_0xe94703-0x0;var _0x5cfc3f=_0x0561[_0xe94703];return _0x5cfc3f;};'use strict';var Sequelize=require(_0x1056('0x0'));var moment=require('moment');module[_0x1056('0x1')]={'type':{'type':Sequelize[_0x1056('0x2')]},'uniqueid':{'type':Sequelize[_0x1056('0x2')]},'calleridnum':{'type':Sequelize[_0x1056('0x2')]},'calleridname':{'type':Sequelize[_0x1056('0x2')]},'queue':{'type':Sequelize[_0x1056('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x1056('0x3')],'set':function(_0x128d51){var _0x2977a0=moment(_0x128d51);var _0x42d85d=moment(this[_0x1056('0x4')]('queuecallerjoinAt'))[_0x1056('0x5')](_0x1056('0x6'));var _0x54cea7=_0x2977a0[_0x1056('0x7')](_0x42d85d,'seconds');this[_0x1056('0x8')](_0x1056('0x9'),_0x128d51);this['setDataValue'](_0x1056('0xa'),_0x54cea7||null);}},'position':{'type':Sequelize[_0x1056('0xb')]},'count':{'type':Sequelize[_0x1056('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x1056('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1056('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x1056('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1056('0x3')]},'queuecallerexit':{'type':Sequelize[_0x1056('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1056('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x1056('0x2')],'comment':_0x1056('0xd')},'originalposition':{'type':Sequelize[_0x1056('0xb')]},'channel':{'type':Sequelize[_0x1056('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1056('0x2')]},'connectedlinename':{'type':Sequelize[_0x1056('0x2')]},'accountcode':{'type':Sequelize[_0x1056('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1056('0x2')]},'priority':{'type':Sequelize[_0x1056('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x1056('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1056('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1056('0x2')]},'transfer':{'type':Sequelize[_0x1056('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1056('0xe')},'transferexten':{'type':Sequelize[_0x1056('0x2')]},'transferuniqueid':{'type':Sequelize[_0x1056('0x2')]},'disposition':{'type':Sequelize[_0x1056('0x2')]},'secondDisposition':{'type':Sequelize[_0x1056('0x2')]},'thirdDisposition':{'type':Sequelize[_0x1056('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x1056('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x1056('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 151c64a..427b719 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 _0x6957=['set','Content-Range','apply','save','update','destroy','end','error','name','send','index','map','VoiceQueueReport','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','show','keys','options','find','create','body','describe','getVoiceQueuesReport','nolimit','findAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','limit','undefined','count'];(function(_0x59d3b4,_0x42eebe){var _0x137fc4=function(_0x3a34c3){while(--_0x3a34c3){_0x59d3b4['push'](_0x59d3b4['shift']());}};_0x137fc4(++_0x42eebe);}(_0x6957,0x7b));var _0x7695=function(_0x544d95,_0x306aa2){_0x544d95=_0x544d95-0x0;var _0x5a788f=_0x6957[_0x544d95];return _0x5a788f;};'use strict';var emlformat=require(_0x7695('0x0'));var rimraf=require(_0x7695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7695('0x2'));var rp=require(_0x7695('0x3'));var moment=require('moment');var BPromise=require(_0x7695('0x4'));var Mustache=require(_0x7695('0x5'));var util=require(_0x7695('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7695('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7695('0x8'));var squel=require(_0x7695('0x9'));var crypto=require(_0x7695('0xa'));var jsforce=require(_0x7695('0xb'));var deskjs=require(_0x7695('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7695('0xd'));var Papa=require(_0x7695('0xe'));var Redis=require('ioredis');var authService=require(_0x7695('0xf'));var qs=require(_0x7695('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7695('0x11'));var logger=require('../../config/logger')(_0x7695('0x12'));var utils=require('../../config/utils');var config=require(_0x7695('0x13'));var licenseUtil=require(_0x7695('0x14'));var db=require(_0x7695('0x15'))['db'];config[_0x7695('0x16')]=_['defaults'](config[_0x7695('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x7695('0x17'))(new Redis(config[_0x7695('0x16')]));require(_0x7695('0x18'))[_0x7695('0x19')](socket);function respondWithStatusCode(_0x12fd38,_0xc6e5cf){_0xc6e5cf=_0xc6e5cf||0xcc;return function(_0x3ff26c){if(_0x3ff26c){return _0x12fd38[_0x7695('0x1a')](_0xc6e5cf);}return _0x12fd38[_0x7695('0x1b')](_0xc6e5cf)['end']();};}function respondWithResult(_0x4dead9,_0x4f2088){_0x4f2088=_0x4f2088||0xc8;return function(_0x375060){if(_0x375060){return _0x4dead9[_0x7695('0x1b')](_0x4f2088)[_0x7695('0x1c')](_0x375060);}};}function respondWithFilteredResult(_0x1ea249,_0x1dfa5e){return function(_0x32b2bd){if(_0x32b2bd){var _0x5b2d09=typeof _0x1dfa5e[_0x7695('0x1d')]==='undefined'&&typeof _0x1dfa5e[_0x7695('0x1e')]===_0x7695('0x1f');var _0x42a692=_0x32b2bd['count'];var _0x32c34d=_0x5b2d09?0x0:_0x1dfa5e[_0x7695('0x1d')];var _0x20be3f=_0x5b2d09?_0x32b2bd[_0x7695('0x20')]:_0x1dfa5e[_0x7695('0x1d')]+_0x1dfa5e[_0x7695('0x1e')];var _0x5c31c3;if(_0x20be3f>=_0x42a692){_0x20be3f=_0x42a692;_0x5c31c3=0xc8;}else{_0x5c31c3=0xce;}_0x1ea249[_0x7695('0x1b')](_0x5c31c3);return _0x1ea249[_0x7695('0x21')](_0x7695('0x22'),_0x32c34d+'-'+_0x20be3f+'/'+_0x42a692)[_0x7695('0x1c')](_0x32b2bd);}return null;};}function patchUpdates(_0xfb6068){return function(_0x4e8423){try{jsonpatch[_0x7695('0x23')](_0x4e8423,_0xfb6068,!![]);}catch(_0x14b9a9){return BPromise['reject'](_0x14b9a9);}return _0x4e8423[_0x7695('0x24')]();};}function saveUpdates(_0x21d81a,_0x14c18c){return function(_0x17e5ab){if(_0x17e5ab){return _0x17e5ab[_0x7695('0x25')](_0x21d81a)['then'](function(_0x2b9f4b){return _0x2b9f4b;});}return null;};}function removeEntity(_0x23f56a,_0x565e6a){return function(_0x565c38){if(_0x565c38){return _0x565c38[_0x7695('0x26')]()['then'](function(){_0x23f56a[_0x7695('0x1b')](0xcc)[_0x7695('0x27')]();});}};}function handleEntityNotFound(_0xa6d7dd,_0x4bc250){return function(_0x1f4a13){if(!_0x1f4a13){_0xa6d7dd[_0x7695('0x1a')](0x194);}return _0x1f4a13;};}function handleError(_0x59af2a,_0x53703e){_0x53703e=_0x53703e||0x1f4;return function(_0x5064c1){logger[_0x7695('0x28')](_0x5064c1['stack']);if(_0x5064c1[_0x7695('0x29')]){delete _0x5064c1[_0x7695('0x29')];}_0x59af2a[_0x7695('0x1b')](_0x53703e)[_0x7695('0x2a')](_0x5064c1);};}exports[_0x7695('0x2b')]=function(_0x298b38,_0x202f49){var _0x42eb48={},_0x47b374={},_0x102553={'count':0x0,'rows':[]};var _0x112c06=_[_0x7695('0x2c')](db[_0x7695('0x2d')]['rawAttributes'],function(_0xf7cb91){return{'name':_0xf7cb91['fieldName'],'type':_0xf7cb91[_0x7695('0x2e')][_0x7695('0x2f')]};});_0x47b374[_0x7695('0x30')]=_['map'](_0x112c06,_0x7695('0x29'));_0x47b374[_0x7695('0x31')]=_['keys'](_0x298b38[_0x7695('0x31')]);_0x47b374['filters']=_[_0x7695('0x32')](_0x47b374[_0x7695('0x30')],_0x47b374[_0x7695('0x31')]);_0x42eb48['attributes']=_['intersection'](_0x47b374['model'],qs[_0x7695('0x33')](_0x298b38[_0x7695('0x31')][_0x7695('0x33')]));_0x42eb48[_0x7695('0x34')]=_0x42eb48[_0x7695('0x34')][_0x7695('0x35')]?_0x42eb48[_0x7695('0x34')]:_0x47b374[_0x7695('0x30')];if(!_0x298b38[_0x7695('0x31')][_0x7695('0x36')]('nolimit')){_0x42eb48[_0x7695('0x1e')]=qs['limit'](_0x298b38[_0x7695('0x31')][_0x7695('0x1e')]);_0x42eb48['offset']=qs[_0x7695('0x1d')](_0x298b38[_0x7695('0x31')][_0x7695('0x1d')]);}_0x42eb48[_0x7695('0x37')]=qs[_0x7695('0x38')](_0x298b38[_0x7695('0x31')][_0x7695('0x38')]);_0x42eb48[_0x7695('0x39')]=qs[_0x7695('0x3a')](_[_0x7695('0x3b')](_0x298b38['query'],_0x47b374[_0x7695('0x3a')]),_0x112c06);if(_0x298b38['query'][_0x7695('0x3c')]){_0x42eb48[_0x7695('0x39')]=_[_0x7695('0x3d')](_0x42eb48[_0x7695('0x39')],{'$or':_['map'](_0x112c06,function(_0x1aca6e){if(_0x1aca6e['type']!==_0x7695('0x3e')){var _0x4ca826={};_0x4ca826[_0x1aca6e[_0x7695('0x29')]]={'$like':'%'+_0x298b38[_0x7695('0x31')][_0x7695('0x3c')]+'%'};return _0x4ca826;}})});}_0x42eb48=_[_0x7695('0x3d')]({},_0x42eb48,_0x298b38['options']);var _0x387dad={'where':_0x42eb48['where']};return db[_0x7695('0x2d')][_0x7695('0x20')](_0x387dad)[_0x7695('0x3f')](function(_0x203229){_0x102553[_0x7695('0x20')]=_0x203229;if(_0x298b38[_0x7695('0x31')][_0x7695('0x40')]){_0x42eb48[_0x7695('0x41')]=[{'all':!![]}];}return db[_0x7695('0x2d')]['findAll'](_0x42eb48);})[_0x7695('0x3f')](function(_0x20a87c){_0x102553[_0x7695('0x42')]=_0x20a87c;return _0x102553;})[_0x7695('0x3f')](respondWithFilteredResult(_0x202f49,_0x42eb48))[_0x7695('0x43')](handleError(_0x202f49,null));};exports[_0x7695('0x44')]=function(_0x516deb,_0x2ca6bd){var _0x436b8c={'raw':![],'where':{'id':_0x516deb['params']['id']}},_0xaa2929={};_0xaa2929[_0x7695('0x30')]=_[_0x7695('0x45')](db[_0x7695('0x2d')]['rawAttributes']);_0xaa2929[_0x7695('0x31')]=_[_0x7695('0x45')](_0x516deb[_0x7695('0x31')]);_0xaa2929[_0x7695('0x3a')]=_[_0x7695('0x32')](_0xaa2929[_0x7695('0x30')],_0xaa2929['query']);_0x436b8c[_0x7695('0x34')]=_[_0x7695('0x32')](_0xaa2929['model'],qs['fields'](_0x516deb[_0x7695('0x31')][_0x7695('0x33')]));_0x436b8c[_0x7695('0x34')]=_0x436b8c[_0x7695('0x34')][_0x7695('0x35')]?_0x436b8c[_0x7695('0x34')]:_0xaa2929[_0x7695('0x30')];if(_0x516deb[_0x7695('0x31')][_0x7695('0x40')]){_0x436b8c[_0x7695('0x41')]=[{'all':!![]}];}_0x436b8c=_[_0x7695('0x3d')]({},_0x436b8c,_0x516deb[_0x7695('0x46')]);return db[_0x7695('0x2d')][_0x7695('0x47')](_0x436b8c)['then'](handleEntityNotFound(_0x2ca6bd,null))[_0x7695('0x3f')](respondWithResult(_0x2ca6bd,null))[_0x7695('0x43')](handleError(_0x2ca6bd,null));};exports['create']=function(_0x9541b4,_0x40e667){return db[_0x7695('0x2d')][_0x7695('0x48')](_0x9541b4['body'],{})[_0x7695('0x3f')](respondWithResult(_0x40e667,0xc9))['catch'](handleError(_0x40e667,null));};exports[_0x7695('0x25')]=function(_0x1b7661,_0xe725fa){if(_0x1b7661['body']['id']){delete _0x1b7661[_0x7695('0x49')]['id'];}return db['VoiceQueueReport'][_0x7695('0x47')]({'where':{'id':_0x1b7661['params']['id']}})['then'](handleEntityNotFound(_0xe725fa,null))[_0x7695('0x3f')](saveUpdates(_0x1b7661['body'],null))['then'](respondWithResult(_0xe725fa,null))[_0x7695('0x43')](handleError(_0xe725fa,null));};exports[_0x7695('0x26')]=function(_0x34f88a,_0x4d484f){return db[_0x7695('0x2d')][_0x7695('0x47')]({'where':{'id':_0x34f88a['params']['id']}})[_0x7695('0x3f')](handleEntityNotFound(_0x4d484f,null))['then'](removeEntity(_0x4d484f,null))['catch'](handleError(_0x4d484f,null));};exports['describe']=function(_0x2a0789,_0x3f1e3c){return db[_0x7695('0x2d')][_0x7695('0x4a')]()[_0x7695('0x3f')](respondWithResult(_0x3f1e3c,null))[_0x7695('0x43')](handleError(_0x3f1e3c,null));};exports[_0x7695('0x4b')]=function(_0x192cf3,_0x4748f2){var _0x2e8639={},_0x4571ad={},_0x1b4e29={'count':0x0,'rows':[]};_0x4571ad['model']=_[_0x7695('0x45')](db['VoiceQueueReport']['rawAttributes']);_0x4571ad[_0x7695('0x31')]=_[_0x7695('0x45')](_0x192cf3[_0x7695('0x31')]);_0x4571ad['filters']=_[_0x7695('0x32')](_0x4571ad['model'],_0x4571ad[_0x7695('0x31')]);_0x2e8639[_0x7695('0x34')]=_[_0x7695('0x32')](_0x4571ad['model'],qs[_0x7695('0x33')](_0x192cf3[_0x7695('0x31')]['fields']));_0x2e8639['attributes']=_0x2e8639[_0x7695('0x34')]['length']?_0x2e8639[_0x7695('0x34')]:_0x4571ad[_0x7695('0x30')];if(!_0x192cf3['query'][_0x7695('0x36')](_0x7695('0x4c'))){_0x2e8639[_0x7695('0x1e')]=qs['limit'](_0x192cf3['query']['limit']);_0x2e8639[_0x7695('0x1d')]=qs[_0x7695('0x1d')](_0x192cf3[_0x7695('0x31')][_0x7695('0x1d')]);}_0x2e8639['order']=qs[_0x7695('0x38')](_0x192cf3[_0x7695('0x31')][_0x7695('0x38')]);_0x2e8639[_0x7695('0x39')]=qs[_0x7695('0x3a')](_[_0x7695('0x3b')](_0x192cf3[_0x7695('0x31')],_0x4571ad['filters']));if(_0x192cf3[_0x7695('0x31')]['filter']){_0x2e8639[_0x7695('0x39')]=_[_0x7695('0x3d')](_0x2e8639[_0x7695('0x39')],{'$or':_[_0x7695('0x2c')](_0x2e8639['attributes'],function(_0x29e6fb){var _0x3fc014={};_0x3fc014[_0x29e6fb]={'$like':'%'+_0x192cf3[_0x7695('0x31')][_0x7695('0x3c')]+'%'};return _0x3fc014;})});}_0x2e8639=_['merge']({},_0x2e8639,_0x192cf3[_0x7695('0x46')]);var _0x314fc1={'where':_0x2e8639['where']};return db[_0x7695('0x2d')][_0x7695('0x20')](_0x314fc1)[_0x7695('0x3f')](function(_0x4f8494){_0x1b4e29[_0x7695('0x20')]=_0x4f8494;if(_0x192cf3[_0x7695('0x31')][_0x7695('0x40')]){_0x2e8639['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7695('0x4d')](_0x2e8639);})[_0x7695('0x3f')](function(_0x31e2aa){_0x1b4e29['rows']=_0x31e2aa;return _0x1b4e29;})[_0x7695('0x3f')](respondWithFilteredResult(_0x4748f2,_0x2e8639,_0x7695('0x4b')))[_0x7695('0x43')](handleError(_0x4748f2,null,_0x7695('0x4b')));}; \ No newline at end of file +var _0x6c59=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','catch','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6c59,0x13d));var _0x96c5=function(_0x1802a9,_0x3d7e28){_0x1802a9=_0x1802a9-0x0;var _0x328492=_0x6c59[_0x1802a9];return _0x328492;};'use strict';var emlformat=require(_0x96c5('0x0'));var rimraf=require(_0x96c5('0x1'));var zipdir=require(_0x96c5('0x2'));var jsonpatch=require(_0x96c5('0x3'));var rp=require(_0x96c5('0x4'));var moment=require(_0x96c5('0x5'));var BPromise=require(_0x96c5('0x6'));var Mustache=require(_0x96c5('0x7'));var util=require(_0x96c5('0x8'));var path=require(_0x96c5('0x9'));var sox=require(_0x96c5('0xa'));var csv=require('to-csv');var ejs=require(_0x96c5('0xb'));var fs=require('fs');var fs_extra=require(_0x96c5('0xc'));var _=require(_0x96c5('0xd'));var squel=require(_0x96c5('0xe'));var crypto=require(_0x96c5('0xf'));var jsforce=require(_0x96c5('0x10'));var deskjs=require(_0x96c5('0x11'));var toCsv=require('to-csv');var querystring=require(_0x96c5('0x12'));var Papa=require(_0x96c5('0x13'));var Redis=require(_0x96c5('0x14'));var authService=require(_0x96c5('0x15'));var qs=require(_0x96c5('0x16'));var as=require(_0x96c5('0x17'));var hardwareService=require(_0x96c5('0x18'));var logger=require('../../config/logger')(_0x96c5('0x19'));var utils=require(_0x96c5('0x1a'));var config=require(_0x96c5('0x1b'));var licenseUtil=require(_0x96c5('0x1c'));var db=require(_0x96c5('0x1d'))['db'];config['redis']=_[_0x96c5('0x1e')](config[_0x96c5('0x1f')],{'host':'localhost','port':0x18eb});var socket=require(_0x96c5('0x20'))(new Redis(config['redis']));require(_0x96c5('0x21'))[_0x96c5('0x22')](socket);function respondWithStatusCode(_0x488588,_0x589c94){_0x589c94=_0x589c94||0xcc;return function(_0x33b52c){if(_0x33b52c){return _0x488588[_0x96c5('0x23')](_0x589c94);}return _0x488588[_0x96c5('0x24')](_0x589c94)[_0x96c5('0x25')]();};}function respondWithResult(_0x21f545,_0x5578b6){_0x5578b6=_0x5578b6||0xc8;return function(_0x2575d0){if(_0x2575d0){return _0x21f545['status'](_0x5578b6)[_0x96c5('0x26')](_0x2575d0);}};}function respondWithFilteredResult(_0xd3af24,_0x153bc6){return function(_0x1d9f27){if(_0x1d9f27){var _0xd0298f=typeof _0x153bc6[_0x96c5('0x27')]===_0x96c5('0x28')&&typeof _0x153bc6[_0x96c5('0x29')]===_0x96c5('0x28');var _0x2bee27=_0x1d9f27[_0x96c5('0x2a')];var _0x24a862=_0xd0298f?0x0:_0x153bc6['offset'];var _0x1094aa=_0xd0298f?_0x1d9f27['count']:_0x153bc6[_0x96c5('0x27')]+_0x153bc6[_0x96c5('0x29')];var _0xc3d70d;if(_0x1094aa>=_0x2bee27){_0x1094aa=_0x2bee27;_0xc3d70d=0xc8;}else{_0xc3d70d=0xce;}_0xd3af24[_0x96c5('0x24')](_0xc3d70d);return _0xd3af24[_0x96c5('0x2b')](_0x96c5('0x2c'),_0x24a862+'-'+_0x1094aa+'/'+_0x2bee27)[_0x96c5('0x26')](_0x1d9f27);}return null;};}function patchUpdates(_0xb9ec2e){return function(_0x3f9596){try{jsonpatch[_0x96c5('0x2d')](_0x3f9596,_0xb9ec2e,!![]);}catch(_0x1b79b9){return BPromise[_0x96c5('0x2e')](_0x1b79b9);}return _0x3f9596[_0x96c5('0x2f')]();};}function saveUpdates(_0x59af08,_0xd0faed){return function(_0x342c6e){if(_0x342c6e){return _0x342c6e[_0x96c5('0x30')](_0x59af08)[_0x96c5('0x31')](function(_0x46388e){return _0x46388e;});}return null;};}function removeEntity(_0x2e95e3,_0x46e8d6){return function(_0x3bfc34){if(_0x3bfc34){return _0x3bfc34[_0x96c5('0x32')]()[_0x96c5('0x31')](function(){_0x2e95e3[_0x96c5('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1d7,_0x511b41){return function(_0x40938){if(!_0x40938){_0x4f1d7[_0x96c5('0x23')](0x194);}return _0x40938;};}function handleError(_0x2dcbbf,_0x5754d3){_0x5754d3=_0x5754d3||0x1f4;return function(_0xf75cdd){logger[_0x96c5('0x33')](_0xf75cdd[_0x96c5('0x34')]);if(_0xf75cdd[_0x96c5('0x35')]){delete _0xf75cdd[_0x96c5('0x35')];}_0x2dcbbf[_0x96c5('0x24')](_0x5754d3)[_0x96c5('0x36')](_0xf75cdd);};}exports[_0x96c5('0x37')]=function(_0x476efa,_0x165d84){var _0x366a41={},_0x5f2667={},_0x29771a={'count':0x0,'rows':[]};var _0x425a89=_[_0x96c5('0x38')](db[_0x96c5('0x39')]['rawAttributes'],function(_0x2233ab){return{'name':_0x2233ab[_0x96c5('0x3a')],'type':_0x2233ab[_0x96c5('0x3b')]['key']};});_0x5f2667[_0x96c5('0x3c')]=_[_0x96c5('0x38')](_0x425a89,_0x96c5('0x35'));_0x5f2667[_0x96c5('0x3d')]=_[_0x96c5('0x3e')](_0x476efa[_0x96c5('0x3d')]);_0x5f2667['filters']=_[_0x96c5('0x3f')](_0x5f2667[_0x96c5('0x3c')],_0x5f2667['query']);_0x366a41[_0x96c5('0x40')]=_[_0x96c5('0x3f')](_0x5f2667[_0x96c5('0x3c')],qs[_0x96c5('0x41')](_0x476efa[_0x96c5('0x3d')][_0x96c5('0x41')]));_0x366a41['attributes']=_0x366a41['attributes'][_0x96c5('0x42')]?_0x366a41[_0x96c5('0x40')]:_0x5f2667[_0x96c5('0x3c')];if(!_0x476efa[_0x96c5('0x3d')][_0x96c5('0x43')]('nolimit')){_0x366a41[_0x96c5('0x29')]=qs[_0x96c5('0x29')](_0x476efa['query'][_0x96c5('0x29')]);_0x366a41['offset']=qs[_0x96c5('0x27')](_0x476efa[_0x96c5('0x3d')][_0x96c5('0x27')]);}_0x366a41[_0x96c5('0x44')]=qs[_0x96c5('0x45')](_0x476efa['query'][_0x96c5('0x45')]);_0x366a41['where']=qs['filters'](_[_0x96c5('0x46')](_0x476efa['query'],_0x5f2667[_0x96c5('0x47')]),_0x425a89);if(_0x476efa['query'][_0x96c5('0x48')]){_0x366a41[_0x96c5('0x49')]=_[_0x96c5('0x4a')](_0x366a41[_0x96c5('0x49')],{'$or':_[_0x96c5('0x38')](_0x425a89,function(_0x5910a6){if(_0x5910a6[_0x96c5('0x3b')]!=='VIRTUAL'){var _0x2bb591={};_0x2bb591[_0x5910a6[_0x96c5('0x35')]]={'$like':'%'+_0x476efa[_0x96c5('0x3d')][_0x96c5('0x48')]+'%'};return _0x2bb591;}})});}_0x366a41=_[_0x96c5('0x4a')]({},_0x366a41,_0x476efa['options']);var _0x5a7251={'where':_0x366a41[_0x96c5('0x49')]};return db[_0x96c5('0x39')][_0x96c5('0x2a')](_0x5a7251)[_0x96c5('0x31')](function(_0x1ab6fa){_0x29771a[_0x96c5('0x2a')]=_0x1ab6fa;if(_0x476efa[_0x96c5('0x3d')][_0x96c5('0x4b')]){_0x366a41[_0x96c5('0x4c')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x366a41);})['then'](function(_0x47382a){_0x29771a[_0x96c5('0x4d')]=_0x47382a;return _0x29771a;})[_0x96c5('0x31')](respondWithFilteredResult(_0x165d84,_0x366a41))['catch'](handleError(_0x165d84,null));};exports[_0x96c5('0x4e')]=function(_0x4da1f2,_0x25b7c7){var _0x59cdeb={'raw':![],'where':{'id':_0x4da1f2[_0x96c5('0x4f')]['id']}},_0x1f0fcf={};_0x1f0fcf[_0x96c5('0x3c')]=_['keys'](db['VoiceQueueReport'][_0x96c5('0x50')]);_0x1f0fcf[_0x96c5('0x3d')]=_[_0x96c5('0x3e')](_0x4da1f2[_0x96c5('0x3d')]);_0x1f0fcf['filters']=_[_0x96c5('0x3f')](_0x1f0fcf[_0x96c5('0x3c')],_0x1f0fcf['query']);_0x59cdeb[_0x96c5('0x40')]=_['intersection'](_0x1f0fcf[_0x96c5('0x3c')],qs[_0x96c5('0x41')](_0x4da1f2[_0x96c5('0x3d')][_0x96c5('0x41')]));_0x59cdeb[_0x96c5('0x40')]=_0x59cdeb[_0x96c5('0x40')][_0x96c5('0x42')]?_0x59cdeb[_0x96c5('0x40')]:_0x1f0fcf[_0x96c5('0x3c')];if(_0x4da1f2[_0x96c5('0x3d')][_0x96c5('0x4b')]){_0x59cdeb[_0x96c5('0x4c')]=[{'all':!![]}];}_0x59cdeb=_['merge']({},_0x59cdeb,_0x4da1f2[_0x96c5('0x51')]);return db[_0x96c5('0x39')][_0x96c5('0x52')](_0x59cdeb)[_0x96c5('0x31')](handleEntityNotFound(_0x25b7c7,null))[_0x96c5('0x31')](respondWithResult(_0x25b7c7,null))['catch'](handleError(_0x25b7c7,null));};exports[_0x96c5('0x53')]=function(_0x190f7d,_0x5c806b){return db[_0x96c5('0x39')][_0x96c5('0x53')](_0x190f7d[_0x96c5('0x54')],{})['then'](respondWithResult(_0x5c806b,0xc9))['catch'](handleError(_0x5c806b,null));};exports['update']=function(_0x5c005f,_0x51f0b1){if(_0x5c005f[_0x96c5('0x54')]['id']){delete _0x5c005f[_0x96c5('0x54')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x5c005f[_0x96c5('0x4f')]['id']}})[_0x96c5('0x31')](handleEntityNotFound(_0x51f0b1,null))[_0x96c5('0x31')](saveUpdates(_0x5c005f['body'],null))[_0x96c5('0x31')](respondWithResult(_0x51f0b1,null))[_0x96c5('0x55')](handleError(_0x51f0b1,null));};exports['destroy']=function(_0x4acc1e,_0x338ac3){return db[_0x96c5('0x39')][_0x96c5('0x52')]({'where':{'id':_0x4acc1e['params']['id']}})[_0x96c5('0x31')](handleEntityNotFound(_0x338ac3,null))[_0x96c5('0x31')](removeEntity(_0x338ac3,null))[_0x96c5('0x55')](handleError(_0x338ac3,null));};exports[_0x96c5('0x56')]=function(_0x46838e,_0x3d3c57){return db[_0x96c5('0x39')]['describe']()['then'](respondWithResult(_0x3d3c57,null))[_0x96c5('0x55')](handleError(_0x3d3c57,null));};exports[_0x96c5('0x57')]=function(_0x1bbfa3,_0x428db7){var _0x29a1e0={},_0x5e5c75={},_0x3af436={'count':0x0,'rows':[]};_0x5e5c75['model']=_['keys'](db['VoiceQueueReport'][_0x96c5('0x50')]);_0x5e5c75[_0x96c5('0x3d')]=_[_0x96c5('0x3e')](_0x1bbfa3[_0x96c5('0x3d')]);_0x5e5c75[_0x96c5('0x47')]=_[_0x96c5('0x3f')](_0x5e5c75['model'],_0x5e5c75[_0x96c5('0x3d')]);_0x29a1e0[_0x96c5('0x40')]=_[_0x96c5('0x3f')](_0x5e5c75[_0x96c5('0x3c')],qs[_0x96c5('0x41')](_0x1bbfa3[_0x96c5('0x3d')]['fields']));_0x29a1e0[_0x96c5('0x40')]=_0x29a1e0[_0x96c5('0x40')][_0x96c5('0x42')]?_0x29a1e0['attributes']:_0x5e5c75[_0x96c5('0x3c')];if(!_0x1bbfa3[_0x96c5('0x3d')][_0x96c5('0x43')](_0x96c5('0x58'))){_0x29a1e0['limit']=qs[_0x96c5('0x29')](_0x1bbfa3[_0x96c5('0x3d')][_0x96c5('0x29')]);_0x29a1e0[_0x96c5('0x27')]=qs[_0x96c5('0x27')](_0x1bbfa3[_0x96c5('0x3d')][_0x96c5('0x27')]);}_0x29a1e0[_0x96c5('0x44')]=qs['sort'](_0x1bbfa3['query'][_0x96c5('0x45')]);_0x29a1e0[_0x96c5('0x49')]=qs[_0x96c5('0x47')](_[_0x96c5('0x46')](_0x1bbfa3[_0x96c5('0x3d')],_0x5e5c75[_0x96c5('0x47')]));if(_0x1bbfa3[_0x96c5('0x3d')][_0x96c5('0x48')]){_0x29a1e0[_0x96c5('0x49')]=_[_0x96c5('0x4a')](_0x29a1e0[_0x96c5('0x49')],{'$or':_[_0x96c5('0x38')](_0x29a1e0['attributes'],function(_0x44c303){var _0x17a5dd={};_0x17a5dd[_0x44c303]={'$like':'%'+_0x1bbfa3['query'][_0x96c5('0x48')]+'%'};return _0x17a5dd;})});}_0x29a1e0=_[_0x96c5('0x4a')]({},_0x29a1e0,_0x1bbfa3[_0x96c5('0x51')]);var _0x58dc6e={'where':_0x29a1e0['where']};return db[_0x96c5('0x39')]['count'](_0x58dc6e)[_0x96c5('0x31')](function(_0x531ea7){_0x3af436[_0x96c5('0x2a')]=_0x531ea7;if(_0x1bbfa3[_0x96c5('0x3d')][_0x96c5('0x4b')]){_0x29a1e0['include']=[{'all':!![]}];}return db[_0x96c5('0x39')]['findAll'](_0x29a1e0);})['then'](function(_0x148610){_0x3af436['rows']=_0x148610;return _0x3af436;})['then'](respondWithFilteredResult(_0x428db7,_0x29a1e0,_0x96c5('0x57')))[_0x96c5('0x55')](handleError(_0x428db7,null,_0x96c5('0x57')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 1c84cf1..ce2982d 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 _0x1afa=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1afa,0xa4));var _0xa1af=function(_0xbaf39,_0x1553c4){_0xbaf39=_0xbaf39-0x0;var _0x32d560=_0x1afa[_0xbaf39];return _0x32d560;};'use strict';var EventEmitter=require(_0xa1af('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa1af('0x1')](0x0);var events={'afterCreate':_0xa1af('0x2'),'afterUpdate':_0xa1af('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3a1472){return function(_0x28cac7,_0x426cd0,_0x14702e){VoiceQueueReportEvents['emit'](_0x3a1472+':'+_0x28cac7['id'],_0x28cac7);VoiceQueueReportEvents[_0xa1af('0x4')](_0x3a1472,_0x28cac7);_0x14702e(null);};}for(var e in events){if(events[_0xa1af('0x5')](e)){var event=events[e];VoiceQueueReport[_0xa1af('0x6')](e,emitEvent(event));}}module[_0xa1af('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xaecd=['VoiceQueueReport','setMaxListeners','save','remove','emit','exports','events'];(function(_0x1cea87,_0x1a1252){var _0x16655e=function(_0x3659a3){while(--_0x3659a3){_0x1cea87['push'](_0x1cea87['shift']());}};_0x16655e(++_0x1a1252);}(_0xaecd,0x11e));var _0xdaec=function(_0x127789,_0x2dfd2d){_0x127789=_0x127789-0x0;var _0x1f1faa=_0xaecd[_0x127789];return _0x1f1faa;};'use strict';var EventEmitter=require(_0xdaec('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xdaec('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xdaec('0x2')](0x0);var events={'afterCreate':_0xdaec('0x3'),'afterUpdate':'update','afterDestroy':_0xdaec('0x4')};function emitEvent(_0x55a9e6){return function(_0x520271,_0x1f0fc4,_0x4a31ee){VoiceQueueReportEvents[_0xdaec('0x5')](_0x55a9e6+':'+_0x520271['id'],_0x520271);VoiceQueueReportEvents['emit'](_0x55a9e6,_0x520271);_0x4a31ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xdaec('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 1045828..332f562 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 _0xd8db=['report_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','VoiceQueueReport'];(function(_0x47d763,_0x28305c){var _0x380909=function(_0x9f4c76){while(--_0x9f4c76){_0x47d763['push'](_0x47d763['shift']());}};_0x380909(++_0x28305c);}(_0xd8db,0xd2));var _0xbd8d=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0xd8db[_0x4d0df6];return _0x4e2615;};'use strict';var _=require(_0xbd8d('0x0'));var util=require(_0xbd8d('0x1'));var logger=require(_0xbd8d('0x2'))(_0xbd8d('0x3'));var moment=require(_0xbd8d('0x4'));var BPromise=require(_0xbd8d('0x5'));var rp=require(_0xbd8d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd8d('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xbd8d('0x8')]=function(_0x3da23b,_0x38e574){return _0x3da23b[_0xbd8d('0x9')](_0xbd8d('0xa'),attributes,{'tableName':_0xbd8d('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbd8d('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc391=['VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./voiceQueueReport.attributes','define'];(function(_0x5d4f70,_0x5e8506){var _0x39bc3b=function(_0x40741b){while(--_0x40741b){_0x5d4f70['push'](_0x5d4f70['shift']());}};_0x39bc3b(++_0x5e8506);}(_0xc391,0x115));var _0x1c39=function(_0x4e0fc5,_0x693464){_0x4e0fc5=_0x4e0fc5-0x0;var _0x3fe6e5=_0xc391[_0x4e0fc5];return _0x3fe6e5;};'use strict';var _=require(_0x1c39('0x0'));var util=require(_0x1c39('0x1'));var logger=require(_0x1c39('0x2'))(_0x1c39('0x3'));var moment=require('moment');var BPromise=require(_0x1c39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c39('0x5'));var rimraf=require('rimraf');var config=require(_0x1c39('0x6'));var attributes=require(_0x1c39('0x7'));module['exports']=function(_0x3db6e8,_0x8b9ced){return _0x3db6e8[_0x1c39('0x8')](_0x1c39('0x9'),attributes,{'tableName':_0x1c39('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1c39('0xb')]},{'fields':[_0x1c39('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 5e34070..020f8c9 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 _0xe758=['VoiceQueueReport','findAll','options','raw','where','attributes','map','include','model','debug','CreateVoiceQueueReport','create','body','update','limit','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport'];(function(_0x3e3f3f,_0x40b1f3){var _0x48cbc9=function(_0x631150){while(--_0x631150){_0x3e3f3f['push'](_0x3e3f3f['shift']());}};_0x48cbc9(++_0x40b1f3);}(_0xe758,0x19c));var _0x8e75=function(_0x582287,_0x19cf5b){_0x582287=_0x582287-0x0;var _0x1c4d7c=_0xe758[_0x582287];return _0x1c4d7c;};'use strict';var _=require(_0x8e75('0x0'));var util=require(_0x8e75('0x1'));var moment=require(_0x8e75('0x2'));var BPromise=require('bluebird');var rs=require(_0x8e75('0x3'));var fs=require('fs');var Redis=require(_0x8e75('0x4'));var db=require(_0x8e75('0x5'))['db'];var utils=require(_0x8e75('0x6'));var logger=require(_0x8e75('0x7'))(_0x8e75('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8e75('0x9')]({'port':0x232a});config[_0x8e75('0xa')]=_['defaults'](config[_0x8e75('0xa')],{'host':_0x8e75('0xb'),'port':0x18eb});var socket=require(_0x8e75('0xc'))(new Redis(config[_0x8e75('0xa')]));require(_0x8e75('0xd'))[_0x8e75('0xe')](socket);function respondWithRpcPromise(_0x28b3ea,_0x3f3f1f,_0x259ead){return new BPromise(function(_0x303fba,_0x380dbd){return client[_0x8e75('0xf')](_0x28b3ea,_0x259ead)[_0x8e75('0x10')](function(_0x397143){logger[_0x8e75('0x11')](_0x8e75('0x12'),_0x3f3f1f,_0x8e75('0x13'));logger['debug'](_0x8e75('0x14'),_0x3f3f1f,'request\x20sent',JSON[_0x8e75('0x15')](_0x397143));if(_0x397143[_0x8e75('0x16')]){if(_0x397143[_0x8e75('0x16')][_0x8e75('0x17')]===0x1f4){logger[_0x8e75('0x16')](_0x8e75('0x12'),_0x3f3f1f,_0x397143[_0x8e75('0x16')]['message']);return _0x380dbd(_0x397143[_0x8e75('0x16')][_0x8e75('0x18')]);}logger[_0x8e75('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x3f3f1f,_0x397143[_0x8e75('0x16')][_0x8e75('0x18')]);return _0x303fba(_0x397143['error'][_0x8e75('0x18')]);}else{logger['info'](_0x8e75('0x12'),_0x3f3f1f,_0x8e75('0x13'));_0x303fba(_0x397143[_0x8e75('0x19')][_0x8e75('0x18')]);}})[_0x8e75('0x1a')](function(_0x2a0aa5){logger[_0x8e75('0x16')](_0x8e75('0x12'),_0x3f3f1f,_0x2a0aa5);_0x380dbd(_0x2a0aa5);});});}exports[_0x8e75('0x1b')]=function(_0x13677e){var _0x5d1b1a=this;return new Promise(function(_0x1355d1,_0x4a517c){return db[_0x8e75('0x1c')][_0x8e75('0x1d')]({'raw':_0x13677e['options']?_0x13677e[_0x8e75('0x1e')][_0x8e75('0x1f')]===undefined?!![]:![]:!![],'where':_0x13677e[_0x8e75('0x1e')]?_0x13677e[_0x8e75('0x1e')][_0x8e75('0x20')]||null:null,'attributes':_0x13677e[_0x8e75('0x1e')]?_0x13677e[_0x8e75('0x1e')][_0x8e75('0x21')]||null:null,'limit':_0x13677e[_0x8e75('0x1e')]?_0x13677e[_0x8e75('0x1e')]['limit']||null:null,'include':_0x13677e['options']?_0x13677e[_0x8e75('0x1e')]['include']?_[_0x8e75('0x22')](_0x13677e['options']['include'],function(_0xbb3f54){return{'model':db[_0xbb3f54['model']],'as':_0xbb3f54['as'],'attributes':_0xbb3f54[_0x8e75('0x21')],'include':_0xbb3f54[_0x8e75('0x23')]?_[_0x8e75('0x22')](_0xbb3f54[_0x8e75('0x23')],function(_0x1270b3){return{'model':db[_0x1270b3[_0x8e75('0x24')]],'as':_0x1270b3['as'],'attributes':_0x1270b3[_0x8e75('0x21')],'include':_0x1270b3[_0x8e75('0x23')]?_[_0x8e75('0x22')](_0x1270b3[_0x8e75('0x23')],function(_0x330781){return{'model':db[_0x330781['model']],'as':_0x330781['as'],'attributes':_0x330781[_0x8e75('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8e75('0x10')](function(_0x79605f){logger['info'](_0x8e75('0x1b'),_0x13677e);logger[_0x8e75('0x25')](_0x8e75('0x1b'),_0x13677e,JSON['stringify'](_0x79605f));_0x1355d1(_0x79605f);})[_0x8e75('0x1a')](function(_0x5d133c){logger[_0x8e75('0x16')]('GetVoiceQueueReport',_0x5d133c[_0x8e75('0x18')],_0x13677e);_0x4a517c(_0x5d1b1a['error'](0x1f4,_0x5d133c[_0x8e75('0x18')]));});});};exports[_0x8e75('0x26')]=function(_0x20827a){var _0x18bb6b=this;return new Promise(function(_0x5461d8,_0x29336b){return db[_0x8e75('0x1c')][_0x8e75('0x27')](_0x20827a[_0x8e75('0x28')],{'raw':_0x20827a[_0x8e75('0x1e')]?_0x20827a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e0d71){logger['info'](_0x8e75('0x26'),_0x20827a);logger[_0x8e75('0x25')](_0x8e75('0x26'),_0x20827a,JSON[_0x8e75('0x15')](_0x2e0d71));_0x5461d8(_0x2e0d71);})['catch'](function(_0xaa16e){logger[_0x8e75('0x16')]('CreateVoiceQueueReport',_0xaa16e[_0x8e75('0x18')],_0x20827a);_0x29336b(_0x18bb6b[_0x8e75('0x16')](0x1f4,_0xaa16e[_0x8e75('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x31a910){var _0x353b01=this;return new Promise(function(_0xf7d26d,_0x7206df){return db[_0x8e75('0x1c')][_0x8e75('0x29')](_0x31a910['body'],{'raw':_0x31a910[_0x8e75('0x1e')]?_0x31a910[_0x8e75('0x1e')][_0x8e75('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31a910[_0x8e75('0x1e')]?_0x31a910[_0x8e75('0x1e')][_0x8e75('0x20')]||null:null,'attributes':_0x31a910[_0x8e75('0x1e')]?_0x31a910['options'][_0x8e75('0x21')]||null:null,'limit':_0x31a910[_0x8e75('0x1e')]?_0x31a910[_0x8e75('0x1e')][_0x8e75('0x2a')]||null:null})[_0x8e75('0x10')](function(_0x3d008b){logger[_0x8e75('0x11')](_0x8e75('0x2b'),_0x31a910);logger[_0x8e75('0x25')]('UpdateVoiceQueueReport',_0x31a910,JSON[_0x8e75('0x15')](_0x3d008b));_0xf7d26d(_0x3d008b);})[_0x8e75('0x1a')](function(_0x5c9915){logger[_0x8e75('0x16')]('UpdateVoiceQueueReport',_0x5c9915[_0x8e75('0x18')],_0x31a910);_0x7206df(_0x353b01[_0x8e75('0x16')](0x1f4,_0x5c9915[_0x8e75('0x18')]));});});}; \ No newline at end of file +var _0xcbeb=['options','raw','attributes','include','map','model','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','where','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x35df9a,_0x21bfde){var _0x3d2bfd=function(_0x2e6628){while(--_0x2e6628){_0x35df9a['push'](_0x35df9a['shift']());}};_0x3d2bfd(++_0x21bfde);}(_0xcbeb,0x1d0));var _0xbcbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbeb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xbcbe('0x0'));var moment=require(_0xbcbe('0x1'));var BPromise=require(_0xbcbe('0x2'));var rs=require(_0xbcbe('0x3'));var fs=require('fs');var Redis=require(_0xbcbe('0x4'));var db=require(_0xbcbe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcbe('0x6'))(_0xbcbe('0x7'));var config=require(_0xbcbe('0x8'));var jayson=require(_0xbcbe('0x9'));var client=jayson['client'][_0xbcbe('0xa')]({'port':0x232a});config[_0xbcbe('0xb')]=_[_0xbcbe('0xc')](config['redis'],{'host':_0xbcbe('0xd'),'port':0x18eb});var socket=require(_0xbcbe('0xe'))(new Redis(config[_0xbcbe('0xb')]));require(_0xbcbe('0xf'))[_0xbcbe('0x10')](socket);function respondWithRpcPromise(_0x4f9470,_0x58496e,_0x38e8e7){return new BPromise(function(_0x88df61,_0xbabbac){return client[_0xbcbe('0x11')](_0x4f9470,_0x38e8e7)[_0xbcbe('0x12')](function(_0xea5096){logger[_0xbcbe('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x58496e,_0xbcbe('0x14'));logger['debug'](_0xbcbe('0x15'),_0x58496e,_0xbcbe('0x14'),JSON[_0xbcbe('0x16')](_0xea5096));if(_0xea5096[_0xbcbe('0x17')]){if(_0xea5096[_0xbcbe('0x17')]['code']===0x1f4){logger[_0xbcbe('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x58496e,_0xea5096[_0xbcbe('0x17')][_0xbcbe('0x18')]);return _0xbabbac(_0xea5096[_0xbcbe('0x17')][_0xbcbe('0x18')]);}logger['error'](_0xbcbe('0x19'),_0x58496e,_0xea5096['error'][_0xbcbe('0x18')]);return _0x88df61(_0xea5096[_0xbcbe('0x17')][_0xbcbe('0x18')]);}else{logger['info'](_0xbcbe('0x19'),_0x58496e,_0xbcbe('0x14'));_0x88df61(_0xea5096[_0xbcbe('0x1a')][_0xbcbe('0x18')]);}})[_0xbcbe('0x1b')](function(_0x192c49){logger[_0xbcbe('0x17')](_0xbcbe('0x19'),_0x58496e,_0x192c49);_0xbabbac(_0x192c49);});});}exports[_0xbcbe('0x1c')]=function(_0x11502a){var _0x206914=this;return new Promise(function(_0x1019b8,_0x2eb8a1){return db[_0xbcbe('0x1d')][_0xbcbe('0x1e')]({'raw':_0x11502a[_0xbcbe('0x1f')]?_0x11502a[_0xbcbe('0x1f')][_0xbcbe('0x20')]===undefined?!![]:![]:!![],'where':_0x11502a[_0xbcbe('0x1f')]?_0x11502a['options']['where']||null:null,'attributes':_0x11502a['options']?_0x11502a['options'][_0xbcbe('0x21')]||null:null,'limit':_0x11502a['options']?_0x11502a['options']['limit']||null:null,'include':_0x11502a[_0xbcbe('0x1f')]?_0x11502a['options'][_0xbcbe('0x22')]?_[_0xbcbe('0x23')](_0x11502a[_0xbcbe('0x1f')][_0xbcbe('0x22')],function(_0x6fcf50){return{'model':db[_0x6fcf50[_0xbcbe('0x24')]],'as':_0x6fcf50['as'],'attributes':_0x6fcf50['attributes'],'include':_0x6fcf50['include']?_[_0xbcbe('0x23')](_0x6fcf50[_0xbcbe('0x22')],function(_0x34cb8b){return{'model':db[_0x34cb8b[_0xbcbe('0x24')]],'as':_0x34cb8b['as'],'attributes':_0x34cb8b['attributes'],'include':_0x34cb8b[_0xbcbe('0x22')]?_['map'](_0x34cb8b[_0xbcbe('0x22')],function(_0x5e5966){return{'model':db[_0x5e5966[_0xbcbe('0x24')]],'as':_0x5e5966['as'],'attributes':_0x5e5966[_0xbcbe('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbcbe('0x12')](function(_0xf51fb2){logger[_0xbcbe('0x13')](_0xbcbe('0x1c'),_0x11502a);logger['debug'](_0xbcbe('0x1c'),_0x11502a,JSON[_0xbcbe('0x16')](_0xf51fb2));_0x1019b8(_0xf51fb2);})[_0xbcbe('0x1b')](function(_0x5e32af){logger[_0xbcbe('0x17')](_0xbcbe('0x1c'),_0x5e32af['message'],_0x11502a);_0x2eb8a1(_0x206914['error'](0x1f4,_0x5e32af['message']));});});};exports['CreateVoiceQueueReport']=function(_0x5b18cf){var _0x307398=this;return new Promise(function(_0x493d82,_0x96048f){return db['VoiceQueueReport'][_0xbcbe('0x25')](_0x5b18cf['body'],{'raw':_0x5b18cf['options']?_0x5b18cf[_0xbcbe('0x1f')][_0xbcbe('0x20')]===undefined?!![]:![]:!![]})[_0xbcbe('0x12')](function(_0x235d79){logger['info'](_0xbcbe('0x26'),_0x5b18cf);logger['debug']('CreateVoiceQueueReport',_0x5b18cf,JSON[_0xbcbe('0x16')](_0x235d79));_0x493d82(_0x235d79);})[_0xbcbe('0x1b')](function(_0xf6a6b5){logger[_0xbcbe('0x17')](_0xbcbe('0x26'),_0xf6a6b5[_0xbcbe('0x18')],_0x5b18cf);_0x96048f(_0x307398['error'](0x1f4,_0xf6a6b5['message']));});});};exports[_0xbcbe('0x27')]=function(_0x2d5753){var _0x4cd2fe=this;return new Promise(function(_0xf737e6,_0x1154da){return db[_0xbcbe('0x1d')][_0xbcbe('0x28')](_0x2d5753[_0xbcbe('0x29')],{'raw':_0x2d5753[_0xbcbe('0x1f')]?_0x2d5753[_0xbcbe('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5753[_0xbcbe('0x1f')]?_0x2d5753[_0xbcbe('0x1f')][_0xbcbe('0x2a')]||null:null,'attributes':_0x2d5753[_0xbcbe('0x1f')]?_0x2d5753['options'][_0xbcbe('0x21')]||null:null,'limit':_0x2d5753[_0xbcbe('0x1f')]?_0x2d5753[_0xbcbe('0x1f')][_0xbcbe('0x2b')]||null:null})[_0xbcbe('0x12')](function(_0x4aabb0){logger['info']('UpdateVoiceQueueReport',_0x2d5753);logger[_0xbcbe('0x2c')](_0xbcbe('0x27'),_0x2d5753,JSON['stringify'](_0x4aabb0));_0xf737e6(_0x4aabb0);})[_0xbcbe('0x1b')](function(_0x2b3ea4){logger['error'](_0xbcbe('0x27'),_0x2b3ea4[_0xbcbe('0x18')],_0x2d5753);_0x1154da(_0x4cd2fe[_0xbcbe('0x17')](0x1f4,_0x2b3ea4[_0xbcbe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index a114c8b..b086cd0 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 _0xa5ca=['emit','removeListener','length','./voiceQueueReport.events','save','remove'];(function(_0xa7fa55,_0x565d1a){var _0x2f1c1f=function(_0x334a2e){while(--_0x334a2e){_0xa7fa55['push'](_0xa7fa55['shift']());}};_0x2f1c1f(++_0x565d1a);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0xa5ca[_0x429948];return _0x35d5d1;};'use strict';var VoiceQueueReportEvents=require(_0xaa5c('0x0'));var events=[_0xaa5c('0x1'),_0xaa5c('0x2'),'update'];function createListener(_0x547df0,_0x2b5bb2){return function(_0x410764){_0x2b5bb2[_0xaa5c('0x3')](_0x547df0,_0x410764);};}function removeListener(_0x12c12f,_0x1d9faf){return function(){VoiceQueueReportEvents[_0xaa5c('0x4')](_0x12c12f,_0x1d9faf);};}exports['register']=function(_0x5bbe71){for(var _0x49da9b=0x0,_0x41b86b=events[_0xaa5c('0x5')];_0x49da9b<_0x41b86b;_0x49da9b++){var _0x283bc5=events[_0x49da9b];var _0x5b39a7=createListener('voiceQueueReport:'+_0x283bc5,_0x5bbe71);VoiceQueueReportEvents['on'](_0x283bc5,_0x5b39a7);}}; \ No newline at end of file +var _0x4bc6=['emit','removeListener','register','voiceQueueReport:','save','remove'];(function(_0x5be7a4,_0xfc8426){var _0x3aff49=function(_0x439233){while(--_0x439233){_0x5be7a4['push'](_0x5be7a4['shift']());}};_0x3aff49(++_0xfc8426);}(_0x4bc6,0xd0));var _0x64bc=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x4bc6[_0x2c7618];return _0x5ce3f0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x64bc('0x0'),_0x64bc('0x1'),'update'];function createListener(_0x18f29a,_0x5e4156){return function(_0x1c95e8){_0x5e4156[_0x64bc('0x2')](_0x18f29a,_0x1c95e8);};}function removeListener(_0x1264d9,_0x156149){return function(){VoiceQueueReportEvents[_0x64bc('0x3')](_0x1264d9,_0x156149);};}exports[_0x64bc('0x4')]=function(_0x1e5c2b){for(var _0x2443d7=0x0,_0x4a2287=events['length'];_0x2443d7<_0x4a2287;_0x2443d7++){var _0x491c96=events[_0x2443d7];var _0x5a436a=createListener(_0x64bc('0x5')+_0x491c96,_0x1e5c2b);VoiceQueueReportEvents['on'](_0x491c96,_0x5a436a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index ca023a8..05d60fb 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 _0xc006=['post','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','/:id','show'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0xc006,0x1e5));var _0x6c00=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0xc006[_0xcdf809];return _0x4d4d70;};'use strict';var multer=require(_0x6c00('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c00('0x1'));var express=require(_0x6c00('0x2'));var router=express[_0x6c00('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6c00('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6c00('0x5'));var controller=require(_0x6c00('0x6'));router['get']('/',auth[_0x6c00('0x7')](),controller['index']);router['get'](_0x6c00('0x8'),auth[_0x6c00('0x7')](),controller[_0x6c00('0x9')]);router[_0x6c00('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6c00('0xb')](_0x6c00('0x8'),auth[_0x6c00('0x7')](),controller['update']);router[_0x6c00('0xc')](_0x6c00('0x8'),auth[_0x6c00('0x7')](),controller[_0x6c00('0xd')]);module[_0x6c00('0xe')]=router; \ No newline at end of file +var _0x2bd6=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','/:id','post','create','put','update'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x2bd6,0x173));var _0x62bd=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x2bd6[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x62bd('0x0'));var util=require(_0x62bd('0x1'));var path=require('path');var timeout=require(_0x62bd('0x2'));var express=require(_0x62bd('0x3'));var router=express[_0x62bd('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x62bd('0x5'));var controller=require(_0x62bd('0x6'));router['get']('/',auth[_0x62bd('0x7')](),controller['index']);router['get'](_0x62bd('0x8'),auth[_0x62bd('0x7')](),controller['show']);router[_0x62bd('0x9')]('/',auth[_0x62bd('0x7')](),controller[_0x62bd('0xa')]);router[_0x62bd('0xb')]('/:id',auth[_0x62bd('0x7')](),controller[_0x62bd('0xc')]);router[_0x62bd('0xd')](_0x62bd('0x8'),auth[_0x62bd('0x7')](),controller[_0x62bd('0xe')]);module[_0x62bd('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index de642de..105a608 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 _0x6d75=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING','DATE','literal'];(function(_0x4f34e6,_0x54fde1){var _0x437308=function(_0x4a4527){while(--_0x4a4527){_0x4f34e6['push'](_0x4f34e6['shift']());}};_0x437308(++_0x54fde1);}(_0x6d75,0x175));var _0x56d7=function(_0x3dfb56,_0xfe844d){_0x3dfb56=_0x3dfb56-0x0;var _0x5e6e1b=_0x6d75[_0x3dfb56];return _0x5e6e1b;};'use strict';var Sequelize=require(_0x56d7('0x0'));var moment=require('moment');module[_0x56d7('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x56d7('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x56d7('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x56d7('0x4')](_0x56d7('0x5'))}}; \ No newline at end of file +var _0x8ae1=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','STRING','DATE'];(function(_0x5c6f4d,_0x24f825){var _0x21c8f6=function(_0x82f9a8){while(--_0x82f9a8){_0x5c6f4d['push'](_0x5c6f4d['shift']());}};_0x21c8f6(++_0x24f825);}(_0x8ae1,0x116));var _0x18ae=function(_0x4ed4f0,_0x2ef617){_0x4ed4f0=_0x4ed4f0-0x0;var _0xfee2ae=_0x8ae1[_0x4ed4f0];return _0xfee2ae;};'use strict';var Sequelize=require(_0x18ae('0x0'));var moment=require(_0x18ae('0x1'));module['exports']={'time':{'type':Sequelize[_0x18ae('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x18ae('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x18ae('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x18ae('0x4')](_0x18ae('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 5af403a..ab00947 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 _0xf99c=['filters','fields','attributes','nolimit','order','sort','where','pick','merge','type','filter','options','findAll','rows','catch','show','keys','intersection','length','includeAll','include','find','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','model','query'];(function(_0x56147b,_0x1427a8){var _0x1ea80a=function(_0x115d28){while(--_0x115d28){_0x56147b['push'](_0x56147b['shift']());}};_0x1ea80a(++_0x1427a8);}(_0xf99c,0x64));var _0xcf99=function(_0x56e4d4,_0x29978){_0x56e4d4=_0x56e4d4-0x0;var _0x125dc8=_0xf99c[_0x56e4d4];return _0x125dc8;};'use strict';var emlformat=require(_0xcf99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf99('0x1'));var jsonpatch=require(_0xcf99('0x2'));var rp=require(_0xcf99('0x3'));var moment=require(_0xcf99('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf99('0x5'));var util=require(_0xcf99('0x6'));var path=require(_0xcf99('0x7'));var sox=require(_0xcf99('0x8'));var csv=require(_0xcf99('0x9'));var ejs=require(_0xcf99('0xa'));var fs=require('fs');var fs_extra=require(_0xcf99('0xb'));var _=require(_0xcf99('0xc'));var squel=require('squel');var crypto=require(_0xcf99('0xd'));var jsforce=require(_0xcf99('0xe'));var deskjs=require(_0xcf99('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf99('0x10'));var Papa=require('papaparse');var Redis=require(_0xcf99('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcf99('0x12'));var as=require(_0xcf99('0x13'));var hardwareService=require(_0xcf99('0x14'));var logger=require(_0xcf99('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcf99('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf99('0x17'))['db'];function respondWithStatusCode(_0x6e8639,_0x260b50){_0x260b50=_0x260b50||0xcc;return function(_0x333477){if(_0x333477){return _0x6e8639[_0xcf99('0x18')](_0x260b50);}return _0x6e8639['status'](_0x260b50)[_0xcf99('0x19')]();};}function respondWithResult(_0x2234ad,_0x589c3c){_0x589c3c=_0x589c3c||0xc8;return function(_0x4f5c10){if(_0x4f5c10){return _0x2234ad[_0xcf99('0x1a')](_0x589c3c)['json'](_0x4f5c10);}};}function respondWithFilteredResult(_0x3800b7,_0x5c4e2e){return function(_0x4724cd){if(_0x4724cd){var _0x3b84de=typeof _0x5c4e2e[_0xcf99('0x1b')]===_0xcf99('0x1c')&&typeof _0x5c4e2e[_0xcf99('0x1d')]===_0xcf99('0x1c');var _0x5569e3=_0x4724cd[_0xcf99('0x1e')];var _0x1e2599=_0x3b84de?0x0:_0x5c4e2e[_0xcf99('0x1b')];var _0x9dd054=_0x3b84de?_0x4724cd[_0xcf99('0x1e')]:_0x5c4e2e[_0xcf99('0x1b')]+_0x5c4e2e[_0xcf99('0x1d')];var _0x3f6a57;if(_0x9dd054>=_0x5569e3){_0x9dd054=_0x5569e3;_0x3f6a57=0xc8;}else{_0x3f6a57=0xce;}_0x3800b7['status'](_0x3f6a57);return _0x3800b7[_0xcf99('0x1f')](_0xcf99('0x20'),_0x1e2599+'-'+_0x9dd054+'/'+_0x5569e3)[_0xcf99('0x21')](_0x4724cd);}return null;};}function patchUpdates(_0x5e0c4f){return function(_0x58ff11){try{jsonpatch['apply'](_0x58ff11,_0x5e0c4f,!![]);}catch(_0x3bcbb2){return BPromise[_0xcf99('0x22')](_0x3bcbb2);}return _0x58ff11[_0xcf99('0x23')]();};}function saveUpdates(_0x3f6147,_0x8f2b3b){return function(_0x407c76){if(_0x407c76){return _0x407c76['update'](_0x3f6147)['then'](function(_0x5d04cb){return _0x5d04cb;});}return null;};}function removeEntity(_0xf4b12e,_0x1e4fce){return function(_0x5d50e2){if(_0x5d50e2){return _0x5d50e2[_0xcf99('0x24')]()[_0xcf99('0x25')](function(){_0xf4b12e['status'](0xcc)[_0xcf99('0x19')]();});}};}function handleEntityNotFound(_0x4b9990,_0x1cac35){return function(_0x34b023){if(!_0x34b023){_0x4b9990[_0xcf99('0x18')](0x194);}return _0x34b023;};}function handleError(_0x236e4c,_0x44901d){_0x44901d=_0x44901d||0x1f4;return function(_0x3ad5f9){logger[_0xcf99('0x26')](_0x3ad5f9[_0xcf99('0x27')]);if(_0x3ad5f9[_0xcf99('0x28')]){delete _0x3ad5f9[_0xcf99('0x28')];}_0x236e4c[_0xcf99('0x1a')](_0x44901d)[_0xcf99('0x29')](_0x3ad5f9);};}exports['index']=function(_0x8c4324,_0x3f6bb6){var _0x555216={},_0x4b7208={},_0x133b03={'count':0x0,'rows':[]};var _0x357d2c=_[_0xcf99('0x2a')](db[_0xcf99('0x2b')][_0xcf99('0x2c')],function(_0xe3533b){return{'name':_0xe3533b[_0xcf99('0x2d')],'type':_0xe3533b['type']['key']};});_0x4b7208[_0xcf99('0x2e')]=_[_0xcf99('0x2a')](_0x357d2c,_0xcf99('0x28'));_0x4b7208[_0xcf99('0x2f')]=_['keys'](_0x8c4324[_0xcf99('0x2f')]);_0x4b7208[_0xcf99('0x30')]=_['intersection'](_0x4b7208[_0xcf99('0x2e')],_0x4b7208[_0xcf99('0x2f')]);_0x555216['attributes']=_['intersection'](_0x4b7208['model'],qs['fields'](_0x8c4324[_0xcf99('0x2f')][_0xcf99('0x31')]));_0x555216[_0xcf99('0x32')]=_0x555216[_0xcf99('0x32')]['length']?_0x555216[_0xcf99('0x32')]:_0x4b7208[_0xcf99('0x2e')];if(!_0x8c4324[_0xcf99('0x2f')]['hasOwnProperty'](_0xcf99('0x33'))){_0x555216[_0xcf99('0x1d')]=qs[_0xcf99('0x1d')](_0x8c4324[_0xcf99('0x2f')][_0xcf99('0x1d')]);_0x555216[_0xcf99('0x1b')]=qs[_0xcf99('0x1b')](_0x8c4324[_0xcf99('0x2f')][_0xcf99('0x1b')]);}_0x555216[_0xcf99('0x34')]=qs['sort'](_0x8c4324[_0xcf99('0x2f')][_0xcf99('0x35')]);_0x555216[_0xcf99('0x36')]=qs['filters'](_[_0xcf99('0x37')](_0x8c4324[_0xcf99('0x2f')],_0x4b7208[_0xcf99('0x30')]),_0x357d2c);if(_0x8c4324[_0xcf99('0x2f')]['filter']){_0x555216['where']=_[_0xcf99('0x38')](_0x555216[_0xcf99('0x36')],{'$or':_['map'](_0x357d2c,function(_0x3314c6){if(_0x3314c6[_0xcf99('0x39')]!=='VIRTUAL'){var _0x1104ee={};_0x1104ee[_0x3314c6[_0xcf99('0x28')]]={'$like':'%'+_0x8c4324[_0xcf99('0x2f')][_0xcf99('0x3a')]+'%'};return _0x1104ee;}})});}_0x555216=_[_0xcf99('0x38')]({},_0x555216,_0x8c4324[_0xcf99('0x3b')]);var _0x2eed82={'where':_0x555216[_0xcf99('0x36')]};return db[_0xcf99('0x2b')][_0xcf99('0x1e')](_0x2eed82)[_0xcf99('0x25')](function(_0x3fbea1){_0x133b03[_0xcf99('0x1e')]=_0x3fbea1;if(_0x8c4324['query']['includeAll']){_0x555216['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xcf99('0x3c')](_0x555216);})[_0xcf99('0x25')](function(_0xf3b934){_0x133b03[_0xcf99('0x3d')]=_0xf3b934;return _0x133b03;})[_0xcf99('0x25')](respondWithFilteredResult(_0x3f6bb6,_0x555216))[_0xcf99('0x3e')](handleError(_0x3f6bb6,null));};exports[_0xcf99('0x3f')]=function(_0x2825d4,_0x1d6f7b){var _0x313b19={'raw':!![],'where':{'id':_0x2825d4['params']['id']}},_0x1c6cf0={};_0x1c6cf0[_0xcf99('0x2e')]=_[_0xcf99('0x40')](db[_0xcf99('0x2b')][_0xcf99('0x2c')]);_0x1c6cf0[_0xcf99('0x2f')]=_[_0xcf99('0x40')](_0x2825d4[_0xcf99('0x2f')]);_0x1c6cf0['filters']=_[_0xcf99('0x41')](_0x1c6cf0[_0xcf99('0x2e')],_0x1c6cf0[_0xcf99('0x2f')]);_0x313b19[_0xcf99('0x32')]=_[_0xcf99('0x41')](_0x1c6cf0[_0xcf99('0x2e')],qs[_0xcf99('0x31')](_0x2825d4['query'][_0xcf99('0x31')]));_0x313b19[_0xcf99('0x32')]=_0x313b19[_0xcf99('0x32')][_0xcf99('0x42')]?_0x313b19[_0xcf99('0x32')]:_0x1c6cf0[_0xcf99('0x2e')];if(_0x2825d4[_0xcf99('0x2f')][_0xcf99('0x43')]){_0x313b19[_0xcf99('0x44')]=[{'all':!![]}];}_0x313b19=_[_0xcf99('0x38')]({},_0x313b19,_0x2825d4['options']);return db['VoiceQueuesLog'][_0xcf99('0x45')](_0x313b19)['then'](handleEntityNotFound(_0x1d6f7b,null))['then'](respondWithResult(_0x1d6f7b,null))['catch'](handleError(_0x1d6f7b,null));};exports[_0xcf99('0x46')]=function(_0x554e77,_0x53356c){return db[_0xcf99('0x2b')][_0xcf99('0x46')](_0x554e77[_0xcf99('0x47')],{})[_0xcf99('0x25')](respondWithResult(_0x53356c,0xc9))['catch'](handleError(_0x53356c,null));};exports[_0xcf99('0x48')]=function(_0x236672,_0x2d9542){if(_0x236672[_0xcf99('0x47')]['id']){delete _0x236672[_0xcf99('0x47')]['id'];}return db['VoiceQueuesLog'][_0xcf99('0x45')]({'where':{'id':_0x236672[_0xcf99('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d9542,null))[_0xcf99('0x25')](saveUpdates(_0x236672[_0xcf99('0x47')],null))[_0xcf99('0x25')](respondWithResult(_0x2d9542,null))[_0xcf99('0x3e')](handleError(_0x2d9542,null));};exports[_0xcf99('0x24')]=function(_0x28b8de,_0x3fffb7){return db[_0xcf99('0x2b')][_0xcf99('0x45')]({'where':{'id':_0x28b8de[_0xcf99('0x49')]['id']}})[_0xcf99('0x25')](handleEntityNotFound(_0x3fffb7,null))[_0xcf99('0x25')](removeEntity(_0x3fffb7,null))[_0xcf99('0x3e')](handleError(_0x3fffb7,null));}; \ No newline at end of file +var _0xc8df=['end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','sendStatus','status'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xc8df,0xc6));var _0xfc8d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc8df[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0xfc8d('0x0'));var rimraf=require(_0xfc8d('0x1'));var zipdir=require(_0xfc8d('0x2'));var jsonpatch=require(_0xfc8d('0x3'));var rp=require(_0xfc8d('0x4'));var moment=require(_0xfc8d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfc8d('0x6'));var ejs=require(_0xfc8d('0x7'));var fs=require('fs');var fs_extra=require(_0xfc8d('0x8'));var _=require(_0xfc8d('0x9'));var squel=require(_0xfc8d('0xa'));var crypto=require(_0xfc8d('0xb'));var jsforce=require(_0xfc8d('0xc'));var deskjs=require(_0xfc8d('0xd'));var toCsv=require(_0xfc8d('0x6'));var querystring=require(_0xfc8d('0xe'));var Papa=require(_0xfc8d('0xf'));var Redis=require(_0xfc8d('0x10'));var authService=require(_0xfc8d('0x11'));var qs=require(_0xfc8d('0x12'));var as=require(_0xfc8d('0x13'));var hardwareService=require(_0xfc8d('0x14'));var logger=require(_0xfc8d('0x15'))(_0xfc8d('0x16'));var utils=require(_0xfc8d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfc8d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dad3f,_0x160787){_0x160787=_0x160787||0xcc;return function(_0x11602a){if(_0x11602a){return _0x3dad3f[_0xfc8d('0x19')](_0x160787);}return _0x3dad3f[_0xfc8d('0x1a')](_0x160787)[_0xfc8d('0x1b')]();};}function respondWithResult(_0x457ea6,_0x501afc){_0x501afc=_0x501afc||0xc8;return function(_0x393c9b){if(_0x393c9b){return _0x457ea6[_0xfc8d('0x1a')](_0x501afc)[_0xfc8d('0x1c')](_0x393c9b);}};}function respondWithFilteredResult(_0x4c9e1b,_0x5e272e){return function(_0x1cce71){if(_0x1cce71){var _0x2512f8=typeof _0x5e272e[_0xfc8d('0x1d')]==='undefined'&&typeof _0x5e272e[_0xfc8d('0x1e')]===_0xfc8d('0x1f');var _0x3094f5=_0x1cce71[_0xfc8d('0x20')];var _0x2ca11d=_0x2512f8?0x0:_0x5e272e[_0xfc8d('0x1d')];var _0x9e4de0=_0x2512f8?_0x1cce71[_0xfc8d('0x20')]:_0x5e272e[_0xfc8d('0x1d')]+_0x5e272e[_0xfc8d('0x1e')];var _0x23369e;if(_0x9e4de0>=_0x3094f5){_0x9e4de0=_0x3094f5;_0x23369e=0xc8;}else{_0x23369e=0xce;}_0x4c9e1b[_0xfc8d('0x1a')](_0x23369e);return _0x4c9e1b[_0xfc8d('0x21')](_0xfc8d('0x22'),_0x2ca11d+'-'+_0x9e4de0+'/'+_0x3094f5)[_0xfc8d('0x1c')](_0x1cce71);}return null;};}function patchUpdates(_0x43cb87){return function(_0x17b711){try{jsonpatch[_0xfc8d('0x23')](_0x17b711,_0x43cb87,!![]);}catch(_0x31dfb9){return BPromise['reject'](_0x31dfb9);}return _0x17b711[_0xfc8d('0x24')]();};}function saveUpdates(_0x3f79c1,_0x1c8783){return function(_0x3572ac){if(_0x3572ac){return _0x3572ac[_0xfc8d('0x25')](_0x3f79c1)[_0xfc8d('0x26')](function(_0x3b7435){return _0x3b7435;});}return null;};}function removeEntity(_0x5dbcb0,_0x2db7ff){return function(_0x1b3a0a){if(_0x1b3a0a){return _0x1b3a0a[_0xfc8d('0x27')]()[_0xfc8d('0x26')](function(){_0x5dbcb0[_0xfc8d('0x1a')](0xcc)[_0xfc8d('0x1b')]();});}};}function handleEntityNotFound(_0x1ba951,_0x611ed5){return function(_0x47ab24){if(!_0x47ab24){_0x1ba951[_0xfc8d('0x19')](0x194);}return _0x47ab24;};}function handleError(_0x89aa93,_0x17c913){_0x17c913=_0x17c913||0x1f4;return function(_0x49480a){logger[_0xfc8d('0x28')](_0x49480a[_0xfc8d('0x29')]);if(_0x49480a[_0xfc8d('0x2a')]){delete _0x49480a[_0xfc8d('0x2a')];}_0x89aa93['status'](_0x17c913)[_0xfc8d('0x2b')](_0x49480a);};}exports[_0xfc8d('0x2c')]=function(_0x39e4a9,_0x12d40c){var _0x5a2f28={},_0x6e42c2={},_0x5a783c={'count':0x0,'rows':[]};var _0x23a28d=_['map'](db[_0xfc8d('0x2d')][_0xfc8d('0x2e')],function(_0x2b3433){return{'name':_0x2b3433[_0xfc8d('0x2f')],'type':_0x2b3433[_0xfc8d('0x30')][_0xfc8d('0x31')]};});_0x6e42c2['model']=_['map'](_0x23a28d,_0xfc8d('0x2a'));_0x6e42c2[_0xfc8d('0x32')]=_[_0xfc8d('0x33')](_0x39e4a9['query']);_0x6e42c2[_0xfc8d('0x34')]=_['intersection'](_0x6e42c2['model'],_0x6e42c2[_0xfc8d('0x32')]);_0x5a2f28[_0xfc8d('0x35')]=_[_0xfc8d('0x36')](_0x6e42c2[_0xfc8d('0x37')],qs[_0xfc8d('0x38')](_0x39e4a9['query'][_0xfc8d('0x38')]));_0x5a2f28[_0xfc8d('0x35')]=_0x5a2f28['attributes'][_0xfc8d('0x39')]?_0x5a2f28['attributes']:_0x6e42c2[_0xfc8d('0x37')];if(!_0x39e4a9[_0xfc8d('0x32')][_0xfc8d('0x3a')](_0xfc8d('0x3b'))){_0x5a2f28[_0xfc8d('0x1e')]=qs[_0xfc8d('0x1e')](_0x39e4a9[_0xfc8d('0x32')][_0xfc8d('0x1e')]);_0x5a2f28[_0xfc8d('0x1d')]=qs[_0xfc8d('0x1d')](_0x39e4a9[_0xfc8d('0x32')]['offset']);}_0x5a2f28[_0xfc8d('0x3c')]=qs['sort'](_0x39e4a9[_0xfc8d('0x32')]['sort']);_0x5a2f28[_0xfc8d('0x3d')]=qs[_0xfc8d('0x34')](_[_0xfc8d('0x3e')](_0x39e4a9[_0xfc8d('0x32')],_0x6e42c2[_0xfc8d('0x34')]),_0x23a28d);if(_0x39e4a9[_0xfc8d('0x32')]['filter']){_0x5a2f28[_0xfc8d('0x3d')]=_[_0xfc8d('0x3f')](_0x5a2f28[_0xfc8d('0x3d')],{'$or':_['map'](_0x23a28d,function(_0x16d033){if(_0x16d033[_0xfc8d('0x30')]!==_0xfc8d('0x40')){var _0x22cf45={};_0x22cf45[_0x16d033[_0xfc8d('0x2a')]]={'$like':'%'+_0x39e4a9['query'][_0xfc8d('0x41')]+'%'};return _0x22cf45;}})});}_0x5a2f28=_['merge']({},_0x5a2f28,_0x39e4a9[_0xfc8d('0x42')]);var _0x5a1ea9={'where':_0x5a2f28['where']};return db[_0xfc8d('0x2d')][_0xfc8d('0x20')](_0x5a1ea9)[_0xfc8d('0x26')](function(_0x194854){_0x5a783c[_0xfc8d('0x20')]=_0x194854;if(_0x39e4a9[_0xfc8d('0x32')][_0xfc8d('0x43')]){_0x5a2f28[_0xfc8d('0x44')]=[{'all':!![]}];}return db[_0xfc8d('0x2d')]['findAll'](_0x5a2f28);})[_0xfc8d('0x26')](function(_0x32cceb){_0x5a783c[_0xfc8d('0x45')]=_0x32cceb;return _0x5a783c;})[_0xfc8d('0x26')](respondWithFilteredResult(_0x12d40c,_0x5a2f28))[_0xfc8d('0x46')](handleError(_0x12d40c,null));};exports['show']=function(_0x4f2553,_0xebb05f){var _0x4878d8={'raw':!![],'where':{'id':_0x4f2553[_0xfc8d('0x47')]['id']}},_0x363d73={};_0x363d73[_0xfc8d('0x37')]=_[_0xfc8d('0x33')](db[_0xfc8d('0x2d')][_0xfc8d('0x2e')]);_0x363d73[_0xfc8d('0x32')]=_[_0xfc8d('0x33')](_0x4f2553[_0xfc8d('0x32')]);_0x363d73['filters']=_[_0xfc8d('0x36')](_0x363d73['model'],_0x363d73['query']);_0x4878d8[_0xfc8d('0x35')]=_['intersection'](_0x363d73[_0xfc8d('0x37')],qs[_0xfc8d('0x38')](_0x4f2553[_0xfc8d('0x32')][_0xfc8d('0x38')]));_0x4878d8['attributes']=_0x4878d8['attributes']['length']?_0x4878d8['attributes']:_0x363d73['model'];if(_0x4f2553[_0xfc8d('0x32')]['includeAll']){_0x4878d8[_0xfc8d('0x44')]=[{'all':!![]}];}_0x4878d8=_[_0xfc8d('0x3f')]({},_0x4878d8,_0x4f2553['options']);return db[_0xfc8d('0x2d')][_0xfc8d('0x48')](_0x4878d8)[_0xfc8d('0x26')](handleEntityNotFound(_0xebb05f,null))[_0xfc8d('0x26')](respondWithResult(_0xebb05f,null))[_0xfc8d('0x46')](handleError(_0xebb05f,null));};exports[_0xfc8d('0x49')]=function(_0x468d66,_0x509e92){return db[_0xfc8d('0x2d')][_0xfc8d('0x49')](_0x468d66[_0xfc8d('0x4a')],{})['then'](respondWithResult(_0x509e92,0xc9))[_0xfc8d('0x46')](handleError(_0x509e92,null));};exports[_0xfc8d('0x25')]=function(_0x2a0868,_0x32d74c){if(_0x2a0868[_0xfc8d('0x4a')]['id']){delete _0x2a0868[_0xfc8d('0x4a')]['id'];}return db['VoiceQueuesLog'][_0xfc8d('0x48')]({'where':{'id':_0x2a0868['params']['id']}})[_0xfc8d('0x26')](handleEntityNotFound(_0x32d74c,null))[_0xfc8d('0x26')](saveUpdates(_0x2a0868[_0xfc8d('0x4a')],null))[_0xfc8d('0x26')](respondWithResult(_0x32d74c,null))['catch'](handleError(_0x32d74c,null));};exports[_0xfc8d('0x27')]=function(_0x47e711,_0x451f00){return db[_0xfc8d('0x2d')]['find']({'where':{'id':_0x47e711['params']['id']}})[_0xfc8d('0x26')](handleEntityNotFound(_0x451f00,null))['then'](removeEntity(_0x451f00,null))[_0xfc8d('0x46')](handleError(_0x451f00,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e84f07a..d318cc3 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 _0xe148=['event','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe148,0x109));var _0x8e14=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0xe148[_0x3e8270];return _0x1ccde9;};'use strict';var _=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var logger=require(_0x8e14('0x2'))(_0x8e14('0x3'));var moment=require(_0x8e14('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e14('0x5'));var rimraf=require(_0x8e14('0x6'));var config=require(_0x8e14('0x7'));var attributes=require(_0x8e14('0x8'));module['exports']=function(_0x4e0dd8,_0x47ad6b){return _0x4e0dd8[_0x8e14('0x9')](_0x8e14('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x8e14('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xd50d=['./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','event','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x19cc6c,_0x4ab358){var _0x2aea2c=function(_0x2f73b0){while(--_0x2f73b0){_0x19cc6c['push'](_0x19cc6c['shift']());}};_0x2aea2c(++_0x4ab358);}(_0xd50d,0xc9));var _0xdd50=function(_0x1f3769,_0x241a17){_0x1f3769=_0x1f3769-0x0;var _0x28cffa=_0xd50d[_0x1f3769];return _0x28cffa;};'use strict';var _=require(_0xdd50('0x0'));var util=require(_0xdd50('0x1'));var logger=require(_0xdd50('0x2'))(_0xdd50('0x3'));var moment=require(_0xdd50('0x4'));var BPromise=require('bluebird');var rp=require(_0xdd50('0x5'));var fs=require('fs');var path=require(_0xdd50('0x6'));var rimraf=require(_0xdd50('0x7'));var config=require(_0xdd50('0x8'));var attributes=require(_0xdd50('0x9'));module[_0xdd50('0xa')]=function(_0x5a7ad9,_0x3a8e93){return _0x5a7ad9['define'](_0xdd50('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xdd50('0xc'),'fields':[_0xdd50('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index f8c3cdd..f684dda 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 _0x6aa0=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x3a91db,_0x25c165){var _0x1d51b6=function(_0x2e5868){while(--_0x2e5868){_0x3a91db['push'](_0x3a91db['shift']());}};_0x1d51b6(++_0x25c165);}(_0x6aa0,0xb8));var _0x06aa=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x6aa0[_0x4c9380];return _0x49a523;};'use strict';var _=require('lodash');var util=require(_0x06aa('0x0'));var moment=require(_0x06aa('0x1'));var BPromise=require('bluebird');var rs=require(_0x06aa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06aa('0x3'))['db'];var utils=require(_0x06aa('0x4'));var logger=require(_0x06aa('0x5'))('rpc');var config=require(_0x06aa('0x6'));var jayson=require(_0x06aa('0x7'));var client=jayson[_0x06aa('0x8')][_0x06aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45395a,_0x52918d,_0x309c1d){return new BPromise(function(_0xd605f9,_0x5735c2){return client[_0x06aa('0xa')](_0x45395a,_0x309c1d)[_0x06aa('0xb')](function(_0x573433){logger['info'](_0x06aa('0xc'),_0x52918d,_0x06aa('0xd'));logger[_0x06aa('0xe')](_0x06aa('0xf'),_0x52918d,_0x06aa('0xd'),JSON[_0x06aa('0x10')](_0x573433));if(_0x573433['error']){if(_0x573433[_0x06aa('0x11')]['code']===0x1f4){logger[_0x06aa('0x11')](_0x06aa('0xc'),_0x52918d,_0x573433[_0x06aa('0x11')][_0x06aa('0x12')]);return _0x5735c2(_0x573433[_0x06aa('0x11')][_0x06aa('0x12')]);}logger[_0x06aa('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x52918d,_0x573433[_0x06aa('0x11')][_0x06aa('0x12')]);return _0xd605f9(_0x573433[_0x06aa('0x11')][_0x06aa('0x12')]);}else{logger[_0x06aa('0x13')](_0x06aa('0xc'),_0x52918d,_0x06aa('0xd'));_0xd605f9(_0x573433[_0x06aa('0x14')][_0x06aa('0x12')]);}})[_0x06aa('0x15')](function(_0x53b9e7){logger[_0x06aa('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x52918d,_0x53b9e7);_0x5735c2(_0x53b9e7);});});} \ No newline at end of file +var _0x957b=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xbc3ac4,_0x883d10){var _0x68169a=function(_0x3fa5b8){while(--_0x3fa5b8){_0xbc3ac4['push'](_0xbc3ac4['shift']());}};_0x68169a(++_0x883d10);}(_0x957b,0x1ee));var _0xb957=function(_0x1c23c3,_0x48edcd){_0x1c23c3=_0x1c23c3-0x0;var _0x18ad7d=_0x957b[_0x1c23c3];return _0x18ad7d;};'use strict';var _=require(_0xb957('0x0'));var util=require(_0xb957('0x1'));var moment=require(_0xb957('0x2'));var BPromise=require(_0xb957('0x3'));var rs=require(_0xb957('0x4'));var fs=require('fs');var Redis=require(_0xb957('0x5'));var db=require(_0xb957('0x6'))['db'];var utils=require(_0xb957('0x7'));var logger=require(_0xb957('0x8'))(_0xb957('0x9'));var config=require('../../config/environment');var jayson=require(_0xb957('0xa'));var client=jayson[_0xb957('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5daf95,_0x67885,_0x3731f7){return new BPromise(function(_0x5822f8,_0x38c1d9){return client['request'](_0x5daf95,_0x3731f7)[_0xb957('0xc')](function(_0x353c31){logger[_0xb957('0xd')](_0xb957('0xe'),_0x67885,_0xb957('0xf'));logger[_0xb957('0x10')](_0xb957('0x11'),_0x67885,'request\x20sent',JSON[_0xb957('0x12')](_0x353c31));if(_0x353c31[_0xb957('0x13')]){if(_0x353c31['error']['code']===0x1f4){logger[_0xb957('0x13')](_0xb957('0xe'),_0x67885,_0x353c31['error'][_0xb957('0x14')]);return _0x38c1d9(_0x353c31['error']['message']);}logger[_0xb957('0x13')](_0xb957('0xe'),_0x67885,_0x353c31[_0xb957('0x13')][_0xb957('0x14')]);return _0x5822f8(_0x353c31['error'][_0xb957('0x14')]);}else{logger[_0xb957('0xd')](_0xb957('0xe'),_0x67885,_0xb957('0xf'));_0x5822f8(_0x353c31['result'][_0xb957('0x14')]);}})[_0xb957('0x15')](function(_0x37da86){logger[_0xb957('0x13')](_0xb957('0xe'),_0x67885,_0x37da86);_0x38c1d9(_0x37da86);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 61e1870..c43235d 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 _0x5d8d=['/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d8d,0x7e));var _0xd5d8=function(_0x467d16,_0x2423f5){_0x467d16=_0x467d16-0x0;var _0x591962=_0x5d8d[_0x467d16];return _0x591962;};'use strict';var multer=require(_0xd5d8('0x0'));var util=require(_0xd5d8('0x1'));var path=require('path');var timeout=require(_0xd5d8('0x2'));var express=require(_0xd5d8('0x3'));var router=express[_0xd5d8('0x4')]();var fs_extra=require(_0xd5d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd5d8('0x6'));var config=require(_0xd5d8('0x7'));var controller=require(_0xd5d8('0x8'));router['get']('/',auth[_0xd5d8('0x9')](),controller['index']);router[_0xd5d8('0xa')](_0xd5d8('0xb'),auth[_0xd5d8('0x9')](),controller[_0xd5d8('0xc')]);router[_0xd5d8('0xa')](_0xd5d8('0xd'),auth[_0xd5d8('0x9')](),controller['show']);router['get'](_0xd5d8('0xe'),auth[_0xd5d8('0x9')](),controller[_0xd5d8('0xf')]);router[_0xd5d8('0xa')](_0xd5d8('0x10'),controller[_0xd5d8('0x11')]);router[_0xd5d8('0xa')](_0xd5d8('0x12'),auth[_0xd5d8('0x9')](),controller[_0xd5d8('0x13')]);router[_0xd5d8('0x14')]('/',auth[_0xd5d8('0x9')](),controller[_0xd5d8('0x15')]);router[_0xd5d8('0x14')](_0xd5d8('0x12'),auth[_0xd5d8('0x9')](),controller[_0xd5d8('0x16')]);router[_0xd5d8('0x17')](_0xd5d8('0xd'),auth['isAuthenticated'](),controller[_0xd5d8('0x18')]);router[_0xd5d8('0x19')](_0xd5d8('0xd'),auth[_0xd5d8('0x9')](),controller[_0xd5d8('0x1a')]);module[_0xd5d8('0x1b')]=router; \ No newline at end of file +var _0x78aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','post','/:id/transcribe','runTranscribe','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x4695c4,_0x5f3704){var _0xe1738d=function(_0x6f56be){while(--_0x6f56be){_0x4695c4['push'](_0x4695c4['shift']());}};_0xe1738d(++_0x5f3704);}(_0x78aa,0x1b6));var _0xa78a=function(_0x5af6b8,_0x4823c5){_0x5af6b8=_0x5af6b8-0x0;var _0x19e2e4=_0x78aa[_0x5af6b8];return _0x19e2e4;};'use strict';var multer=require(_0xa78a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa78a('0x1'));var express=require(_0xa78a('0x2'));var router=express[_0xa78a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa78a('0x4'));var interaction=require(_0xa78a('0x5'));var config=require(_0xa78a('0x6'));var controller=require(_0xa78a('0x7'));router[_0xa78a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa78a('0x8')](_0xa78a('0x9'),auth['isAuthenticated'](),controller[_0xa78a('0xa')]);router['get'](_0xa78a('0xb'),auth[_0xa78a('0xc')](),controller[_0xa78a('0xd')]);router[_0xa78a('0x8')](_0xa78a('0xe'),auth[_0xa78a('0xc')](),controller[_0xa78a('0xf')]);router[_0xa78a('0x8')](_0xa78a('0x10'),controller[_0xa78a('0x11')]);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller['downloadTranscribe']);router[_0xa78a('0x12')]('/',auth[_0xa78a('0xc')](),controller['create']);router[_0xa78a('0x12')](_0xa78a('0x13'),auth[_0xa78a('0xc')](),controller[_0xa78a('0x14')]);router[_0xa78a('0x15')](_0xa78a('0xb'),auth[_0xa78a('0xc')](),controller[_0xa78a('0x16')]);router[_0xa78a('0x17')](_0xa78a('0xb'),auth[_0xa78a('0xc')](),controller[_0xa78a('0x18')]);module[_0xa78a('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ad5de46..bfa32b0 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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 49e9c84..f6ad59b 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 _0x56b3=['Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','then','error','name','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','update','body','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','send','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','existsSync','ValidationError','extname','destroy','isNil'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x56b3,0x162));var _0x356b=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x56b3[_0x2002b3];return _0x2756f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x356b('0x0'));var zipdir=require(_0x356b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x356b('0x2'));var moment=require('moment');var BPromise=require(_0x356b('0x3'));var Mustache=require(_0x356b('0x4'));var util=require(_0x356b('0x5'));var path=require(_0x356b('0x6'));var sox=require('sox');var csv=require(_0x356b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x356b('0x8'));var _=require('lodash');var squel=require(_0x356b('0x9'));var crypto=require('crypto');var jsforce=require(_0x356b('0xa'));var deskjs=require(_0x356b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x356b('0xc'));var Papa=require(_0x356b('0xd'));var AWS=require(_0x356b('0xe'));var uuidv4=require(_0x356b('0xf'));var Redis=require(_0x356b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x356b('0x11'));var as=require(_0x356b('0x12'));var hardwareService=require(_0x356b('0x13'));var logger=require(_0x356b('0x14'))(_0x356b('0x15'));var utils=require(_0x356b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x356b('0x17'));var db=require(_0x356b('0x18'))['db'];function respondWithStatusCode(_0x2b2bf8,_0x2c64c2){_0x2c64c2=_0x2c64c2||0xcc;return function(_0x4fff0b){if(_0x4fff0b){return _0x2b2bf8[_0x356b('0x19')](_0x2c64c2);}return _0x2b2bf8[_0x356b('0x1a')](_0x2c64c2)[_0x356b('0x1b')]();};}function respondWithResult(_0x4bc9c9,_0x529704){_0x529704=_0x529704||0xc8;return function(_0x1e209a){if(_0x1e209a){return _0x4bc9c9['status'](_0x529704)[_0x356b('0x1c')](_0x1e209a);}};}function respondWithFilteredResult(_0x3dd115,_0xa6cfc5){return function(_0x50b461){if(_0x50b461){var _0x2a484f=typeof _0xa6cfc5['offset']==='undefined'&&typeof _0xa6cfc5[_0x356b('0x1d')]===_0x356b('0x1e');var _0x39bb66=_0x50b461[_0x356b('0x1f')];var _0x1824cf=_0x2a484f?0x0:_0xa6cfc5[_0x356b('0x20')];var _0x3ac09d=_0x2a484f?_0x50b461[_0x356b('0x1f')]:_0xa6cfc5[_0x356b('0x20')]+_0xa6cfc5[_0x356b('0x1d')];var _0x3e24b0;if(_0x3ac09d>=_0x39bb66){_0x3ac09d=_0x39bb66;_0x3e24b0=0xc8;}else{_0x3e24b0=0xce;}_0x3dd115['status'](_0x3e24b0);return _0x3dd115['set'](_0x356b('0x21'),_0x1824cf+'-'+_0x3ac09d+'/'+_0x39bb66)[_0x356b('0x1c')](_0x50b461);}return null;};}function patchUpdates(_0x237947){return function(_0x46ca93){try{jsonpatch['apply'](_0x46ca93,_0x237947,!![]);}catch(_0x26cafe){return BPromise[_0x356b('0x22')](_0x26cafe);}return _0x46ca93[_0x356b('0x23')]();};}function saveUpdates(_0x25894f,_0x33767c){return function(_0x49004b){if(_0x49004b){return _0x49004b['update'](_0x25894f)[_0x356b('0x24')](function(_0x5c40ff){return _0x5c40ff;});}return null;};}function removeEntity(_0x26d48f,_0xe20433){return function(_0x2d8e4a){if(_0x2d8e4a){return _0x2d8e4a['destroy']()['then'](function(){_0x26d48f[_0x356b('0x1a')](0xcc)[_0x356b('0x1b')]();});}};}function handleEntityNotFound(_0x536103,_0x415f64){return function(_0x1e22a2){if(!_0x1e22a2){_0x536103[_0x356b('0x19')](0x194);}return _0x1e22a2;};}function handleError(_0x244ab7,_0xecf3d9){_0xecf3d9=_0xecf3d9||0x1f4;return function(_0x529742){logger[_0x356b('0x25')](_0x529742['stack']);if(_0x529742['name']){delete _0x529742[_0x356b('0x26')];}_0x244ab7['status'](_0xecf3d9)['send'](_0x529742);};}exports['index']=function(_0x3ecd10,_0xdafc36){var _0x4fbdd4={},_0x16d23f={},_0xe0554b={'count':0x0,'rows':[]};var _0x4d5cc9=_[_0x356b('0x27')](db[_0x356b('0x28')][_0x356b('0x29')],function(_0x138997){return{'name':_0x138997['fieldName'],'type':_0x138997[_0x356b('0x2a')][_0x356b('0x2b')]};});_0x16d23f[_0x356b('0x2c')]=_[_0x356b('0x2d')](_['map'](_0x4d5cc9,_0x356b('0x26')),[_0x356b('0x2e')]);_0x16d23f[_0x356b('0x2f')]=_['keys'](_0x3ecd10[_0x356b('0x2f')]);_0x16d23f['filters']=_[_0x356b('0x30')](_0x16d23f['model'],_0x16d23f['query']);_0x4fbdd4[_0x356b('0x31')]=_[_0x356b('0x30')](_0x16d23f[_0x356b('0x2c')],qs[_0x356b('0x32')](_0x3ecd10['query'][_0x356b('0x32')]));_0x4fbdd4[_0x356b('0x31')]=_0x4fbdd4[_0x356b('0x31')][_0x356b('0x33')]?_0x4fbdd4[_0x356b('0x31')]:_0x16d23f[_0x356b('0x2c')];if(!_0x3ecd10[_0x356b('0x2f')][_0x356b('0x34')]('nolimit')){_0x4fbdd4[_0x356b('0x1d')]=qs[_0x356b('0x1d')](_0x3ecd10[_0x356b('0x2f')][_0x356b('0x1d')]);_0x4fbdd4[_0x356b('0x20')]=qs[_0x356b('0x20')](_0x3ecd10['query'][_0x356b('0x20')]);}_0x4fbdd4['order']=qs[_0x356b('0x35')](_0x3ecd10[_0x356b('0x2f')][_0x356b('0x35')]);_0x4fbdd4[_0x356b('0x36')]=qs[_0x356b('0x37')](_[_0x356b('0x38')](_0x3ecd10[_0x356b('0x2f')],_0x16d23f[_0x356b('0x37')]),_0x4d5cc9);if(_0x3ecd10['query'][_0x356b('0x39')]){_0x4fbdd4['where']=_[_0x356b('0x3a')](_0x4fbdd4[_0x356b('0x36')],{'$or':_[_0x356b('0x27')](_0x4d5cc9,function(_0x3e563c){if(_0x3e563c[_0x356b('0x2a')]!==_0x356b('0x3b')){var _0x204937={};_0x204937[_0x3e563c[_0x356b('0x26')]]={'$like':'%'+_0x3ecd10[_0x356b('0x2f')]['filter']+'%'};return _0x204937;}})});}_0x4fbdd4=_[_0x356b('0x3a')]({},_0x4fbdd4,_0x3ecd10[_0x356b('0x3c')]);var _0xe3b4cb={'where':_0x4fbdd4['where']};return db[_0x356b('0x28')]['count'](_0xe3b4cb)[_0x356b('0x24')](function(_0x2cc60d){_0xe0554b[_0x356b('0x1f')]=_0x2cc60d;if(_0x3ecd10[_0x356b('0x2f')][_0x356b('0x3d')]){_0x4fbdd4[_0x356b('0x3e')]=[{'all':!![]}];}return db[_0x356b('0x28')]['findAll'](_0x4fbdd4);})[_0x356b('0x24')](function(_0x485bca){_0xe0554b[_0x356b('0x3f')]=_0x485bca;return _0xe0554b;})[_0x356b('0x24')](respondWithFilteredResult(_0xdafc36,_0x4fbdd4))[_0x356b('0x40')](handleError(_0xdafc36,null));};exports[_0x356b('0x41')]=function(_0xd331c9,_0x404d1f){var _0x89995f={'raw':![],'where':{'id':_0xd331c9[_0x356b('0x42')]['id']}},_0x4816c3={};_0x4816c3[_0x356b('0x2c')]=_[_0x356b('0x43')](db['VoiceRecording'][_0x356b('0x29')]);_0x4816c3['query']=_['keys'](_0xd331c9[_0x356b('0x2f')]);_0x4816c3[_0x356b('0x37')]=_['intersection'](_0x4816c3[_0x356b('0x2c')],_0x4816c3[_0x356b('0x2f')]);_0x89995f['attributes']=_[_0x356b('0x30')](_0x4816c3[_0x356b('0x2c')],qs[_0x356b('0x32')](_0xd331c9[_0x356b('0x2f')][_0x356b('0x32')]));_0x89995f['attributes']=_0x89995f['attributes']['length']?_0x89995f[_0x356b('0x31')]:_0x4816c3[_0x356b('0x2c')];if(_0xd331c9['query'][_0x356b('0x3d')]){_0x89995f[_0x356b('0x3e')]=[{'all':!![]}];}_0x89995f=_[_0x356b('0x3a')]({},_0x89995f,_0xd331c9[_0x356b('0x3c')]);return db['VoiceRecording']['find'](_0x89995f)[_0x356b('0x24')](handleEntityNotFound(_0x404d1f,null))[_0x356b('0x24')](respondWithResult(_0x404d1f,null))['catch'](handleError(_0x404d1f,null));};exports[_0x356b('0x44')]=function(_0x2cf1ca,_0x8ebbe5){return db[_0x356b('0x28')]['create'](_0x2cf1ca['body'],{})[_0x356b('0x24')](respondWithResult(_0x8ebbe5,0xc9))[_0x356b('0x40')](handleError(_0x8ebbe5,null));};exports[_0x356b('0x45')]=function(_0x55c325,_0x5afcc7){if(_0x55c325[_0x356b('0x46')]['id']){delete _0x55c325[_0x356b('0x46')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x55c325['params']['id']}})[_0x356b('0x24')](handleEntityNotFound(_0x5afcc7,null))[_0x356b('0x24')](saveUpdates(_0x55c325[_0x356b('0x46')],null))[_0x356b('0x24')](respondWithResult(_0x5afcc7,null))['catch'](handleError(_0x5afcc7,null));};exports['describe']=function(_0x1e3a7d,_0x3caa5c){return db['VoiceRecording'][_0x356b('0x47')]()[_0x356b('0x24')](respondWithResult(_0x3caa5c,null))['catch'](handleError(_0x3caa5c,null));};exports[_0x356b('0x48')]=function(_0x6a0c09,_0x5a3c3f,_0x3e0b2e){var _0x5bc312=require(_0x356b('0x49'));var _0x3ea5f0=![];var _0xf109ee={};if(_0x6a0c09[_0x356b('0x2f')]['type']&&_0x6a0c09[_0x356b('0x2f')][_0x356b('0x2a')]===_0x356b('0x4a')){_0xf109ee[_0x356b('0x4a')]=_0x6a0c09[_0x356b('0x42')]['id'];}else{_0xf109ee['id']=_0x6a0c09['params']['id'];}return db[_0x356b('0x28')][_0x356b('0x4b')]({'where':_0xf109ee,'attributes':['id',_0x356b('0x4c')],'raw':!![]})[_0x356b('0x24')](handleEntityNotFound(_0x5a3c3f,null))[_0x356b('0x24')](function(_0x11bd2c){if(_0x11bd2c){var _0x3ab41c=_0x11bd2c[_0x356b('0x4c')];var _0x1d7d18=util[_0x356b('0x2e')](_0x356b('0x4d'),_0x3ab41c);if(fs['existsSync'](_0x1d7d18)){_0x3ea5f0=!![];return _0x5bc312[_0x356b('0x4e')](_0x1d7d18,_0x3ab41c,config[_0x356b('0x4f')][_0x356b('0x50')])[_0x356b('0x24')](function(){return _0x11bd2c;});}return _0x11bd2c;}})[_0x356b('0x24')](function(_0x13d4cf){if(_0x13d4cf){var _0x4c92cd=_0x13d4cf[_0x356b('0x4c')];if(!fs['existsSync'](_0x4c92cd)){throw new db[(_0x356b('0x51'))]['ValidationError'](_0x356b('0x52'));}if(_0x13d4cf[_0x356b('0x53')]){return _0x5a3c3f[_0x356b('0x48')](_0x4c92cd,_0x13d4cf['filename']+path['extname'](_0x4c92cd),function(){if(_0x3ea5f0){fs[_0x356b('0x54')](_0x4c92cd);}});}else{return _0x5a3c3f[_0x356b('0x48')](_0x4c92cd,function(_0x1792ee){if(_0x3ea5f0){fs[_0x356b('0x54')](_0x4c92cd);}});}}})['catch'](function(_0x11b6d3){if(_0x11b6d3['message']===_0x356b('0x52')){_0x5a3c3f[_0x356b('0x1a')](0x194)[_0x356b('0x55')](_0x356b('0x56'));}else{return handleError(_0x5a3c3f,null);}});};exports[_0x356b('0x57')]=function(_0x370264,_0xad27e4,_0x383ea9){var _0x4922a0=require(_0x356b('0x49'));var _0x31b1b1=![];var _0x3bdccf={'$and':[db[_0x356b('0x58')][_0x356b('0x36')](db[_0x356b('0x58')]['fn'](_0x356b('0x59'),db[_0x356b('0x58')][_0x356b('0x5a')](_0x356b('0x4a'))),_0x370264['query'][_0x356b('0x5b')])]};if(_0x370264[_0x356b('0x2f')][_0x356b('0x2a')]&&_0x370264['query'][_0x356b('0x2a')]===_0x356b('0x4a')){_0x3bdccf['$and'][_0x356b('0x5c')]({'uniqueid':_0x370264[_0x356b('0x42')]['id']});}else{_0x3bdccf[_0x356b('0x5d')][_0x356b('0x5c')]({'id':_0x370264[_0x356b('0x42')]['id']});}return db['VoiceRecording'][_0x356b('0x4b')]({'where':_0x3bdccf,'attributes':['id',_0x356b('0x4c')],'raw':!![]})[_0x356b('0x24')](handleEntityNotFound(_0xad27e4,null))[_0x356b('0x24')](function(_0xcf1d40){if(_0xcf1d40){var _0x50e0ba=util[_0x356b('0x2e')]('%s.cypher',_0xcf1d40[_0x356b('0x4c')]);if(fs[_0x356b('0x5e')](_0x50e0ba)){_0x31b1b1=!![];return _0x4922a0[_0x356b('0x4e')](_0x50e0ba,_0xcf1d40[_0x356b('0x4c')],config[_0x356b('0x4f')][_0x356b('0x50')])[_0x356b('0x24')](function(){return _0xcf1d40;});}return _0xcf1d40;}})[_0x356b('0x24')](function(_0x75e9a6){if(_0x75e9a6){if(!fs[_0x356b('0x5e')](_0x75e9a6['value'])){throw new db['Sequelize'][(_0x356b('0x5f'))](_0x356b('0x52'));}if(_0x75e9a6[_0x356b('0x53')]){return _0xad27e4[_0x356b('0x48')](_0x75e9a6[_0x356b('0x4c')],_0x75e9a6['filename']+path[_0x356b('0x60')](_0x75e9a6[_0x356b('0x4c')]),function(){if(_0x31b1b1){fs[_0x356b('0x54')](_0x75e9a6[_0x356b('0x4c')]);}});}else{return _0xad27e4[_0x356b('0x48')](_0x75e9a6[_0x356b('0x4c')],function(_0x30cf36){if(_0x31b1b1){fs[_0x356b('0x54')](_0x75e9a6[_0x356b('0x4c')]);}});}}})[_0x356b('0x40')](handleError(_0xad27e4,null));};exports[_0x356b('0x61')]=function(_0x1f58de,_0x4fe347){return db[_0x356b('0x28')]['find']({'where':{'id':_0x1f58de[_0x356b('0x42')]['id']}})[_0x356b('0x24')](function(_0x56b367){if(_[_0x356b('0x62')](_0x56b367)){throw new ReferenceError(_0x356b('0x63'));}return _0x56b367;})[_0x356b('0x24')](function(_0x94be39){var _0x36b407=_0x94be39[_0x356b('0x4c')];logger[_0x356b('0x64')](_0x356b('0x65'),_0x36b407);if(!_[_0x356b('0x62')](_0x94be39['value'])&&fs[_0x356b('0x5e')](_0x36b407)){logger[_0x356b('0x64')](_0x356b('0x66')+_0x36b407+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x36b407);}_0x36b407=_0x36b407+'.cypher';if(!_[_0x356b('0x62')](_0x94be39[_0x356b('0x4c')])&&fs[_0x356b('0x5e')](_0x36b407)){logger[_0x356b('0x64')](_0x356b('0x66')+_0x36b407+_0x356b('0x67'));fs[_0x356b('0x68')](_0x36b407);}return _0x94be39;})[_0x356b('0x24')](function(_0x54bd40){if(!_0x54bd40)throw new InternalError();return _0x54bd40[_0x356b('0x61')]();})[_0x356b('0x24')](function(){_0x4fe347[_0x356b('0x1a')](0xcc)[_0x356b('0x1b')]();})['catch'](handleError(_0x4fe347,null));};function getBucketslist(_0x5d467,_0x14221a,_0x37bc34){return new Promise(function(_0x4a2d79,_0x4656b5){var _0x3432cd=new AWS['S3']({'accessKeyId':_0x14221a,'secretAccessKey':_0x5d467,'region':_0x37bc34});_0x3432cd[_0x356b('0x69')]({},function(_0x57b9cb,_0x878c57){if(_0x57b9cb){return _0x4656b5(_0x57b9cb);}else{return _0x4a2d79(_0x878c57);}});});}function createBucket(_0x52664c,_0x557b97,_0x416677,_0x52a3f0){return new Promise(function(_0x10b00a,_0x13431d){var _0x112504=new AWS['S3']({'accessKeyId':_0x557b97,'secretAccessKey':_0x52664c,'region':_0x416677});_0x112504[_0x356b('0x6a')]({'Bucket':_0x52a3f0},function(_0x2bef18,_0x3d64d6){if(_0x2bef18){return _0x13431d(_0x2bef18);}else{return _0x10b00a(_0x3d64d6);}});});}function uploadFile(_0x3bd9ff,_0x246db6,_0x284afa,_0x4d4023,_0xd36480,_0x256bea){return new Promise(function(_0x2998cf,_0x353c56){var _0xc16566=new AWS['S3']({'accessKeyId':_0x246db6,'secretAccessKey':_0x3bd9ff,'region':_0x284afa});_0xc16566[_0x356b('0x6b')]({'Bucket':_0x4d4023,'Key':_0xd36480,'Body':_0x256bea},function(_0x3ef537,_0x1dea43){if(_0x3ef537){return _0x353c56(_0x3ef537);}else{return _0x2998cf(_0x1dea43);}});});}function startTranscribe(_0x44d74b,_0x2b537a,_0x24e43d,_0x4583ad,_0x8ea458,_0x5e2dbb){return new Promise(function(_0x20a3c4,_0x93fc6a){var _0x381a76=new AWS['TranscribeService']({'accessKeyId':_0x2b537a,'secretAccessKey':_0x44d74b,'region':_0x24e43d});_0x381a76['startTranscriptionJob']({'TranscriptionJobName':_0x4583ad,'LanguageCode':_0x8ea458,'Media':{'MediaFileUri':_0x5e2dbb}},function(_0x13b25d,_0x4a4602){if(_0x13b25d){return _0x93fc6a(_0x13b25d);}else{return _0x20a3c4(_0x4a4602);}});});}function transcribe(_0x379484,_0x2e1920,_0x15d83c,_0x277334,_0x2357bd,_0xd8af53,_0x2842ee){return new Promise(function(_0x283961,_0x42583c){var _0x46701b={};logger[_0x356b('0x64')](util['format'](_0x356b('0x6c'),_0x379484,_0x2357bd));return uploadFile(_0x2e1920,_0x15d83c,_0x277334,_0x2357bd,path[_0x356b('0x6d')](_0xd8af53),fs[_0x356b('0x6e')](_0xd8af53))['then'](function(_0x3c596b){logger[_0x356b('0x64')](util['format'](_0x356b('0x6f'),_0x379484,_0x2357bd,_0x3c596b['Location']));_0x46701b[_0x356b('0x70')]=_0x3c596b[_0x356b('0x71')];_0x46701b[_0x356b('0x72')]=_0x3c596b[_0x356b('0x73')];logger[_0x356b('0x64')](util[_0x356b('0x2e')](_0x356b('0x74'),_0x379484));return startTranscribe(_0x2e1920,_0x15d83c,_0x277334,uuidv4(),_0x2842ee,_0x3c596b['Location']);})[_0x356b('0x24')](function(_0x127e2d){logger[_0x356b('0x64')](util[_0x356b('0x2e')](_0x356b('0x75'),_0x379484,_0x127e2d[_0x356b('0x76')]['TranscriptionJobName']));_0x46701b[_0x356b('0x77')]=_0x127e2d['TranscriptionJob']['TranscriptionJobName'];_0x46701b['transcribeStatus']=_0x127e2d['TranscriptionJob']['TranscriptionJobStatus'];return _0x283961(_0x46701b);})[_0x356b('0x40')](function(_0xc3917d){return _0x42583c(_0xc3917d);});});}exports['runTranscribe']=function(_0x13c70e,_0x4548d5,_0xeac7cc){var _0x5a7fce;var _0x41c5da;var _0x26889d;var _0x2dfca2=require(_0x356b('0x49'));return db[_0x356b('0x28')]['findOne']({'where':{'id':_0x13c70e[_0x356b('0x42')]['id']}})[_0x356b('0x24')](function(_0x2089b4){if(_0x2089b4){var _0x3bd482=util[_0x356b('0x2e')](_0x356b('0x4d'),_0x2089b4['value']);if(fs[_0x356b('0x5e')](_0x3bd482)){cypher=!![];return _0x2dfca2['decryptFile'](_0x3bd482,_0x2089b4['value'],config[_0x356b('0x4f')][_0x356b('0x50')])[_0x356b('0x24')](function(){return _0x2089b4;});}return _0x2089b4;}})[_0x356b('0x24')](function(_0x47fa17){if(!_0x47fa17){throw new db[(_0x356b('0x51'))][(_0x356b('0x5f'))](_0x356b('0x78'));}_0x41c5da=_0x47fa17;return db[_0x356b('0x79')][_0x356b('0x7a')]({'where':{'id':0x1}});})[_0x356b('0x24')](handleEntityNotFound(_0x4548d5,null))[_0x356b('0x24')](function(_0x361a65){if(_0x361a65){_0x5a7fce=_0x361a65;if(!_0x5a7fce[_0x356b('0x7b')]||!_0x5a7fce[_0x356b('0x7c')]||!_0x5a7fce['transcribeRegion']||!_0x5a7fce[_0x356b('0x7d')]||!_0x5a7fce[_0x356b('0x70')]){throw new db[(_0x356b('0x51'))]['ValidationError'](_0x356b('0x7e'));}if(_0x13c70e[_0x356b('0x46')]['runSentiment']&&(!_0x5a7fce[_0x356b('0x7f')]||!_0x5a7fce[_0x356b('0x80')]||!_0x5a7fce[_0x356b('0x81')]||!_0x5a7fce[_0x356b('0x7d')]||!_0x5a7fce[_0x356b('0x70')])){throw new db['Sequelize'][(_0x356b('0x5f'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x356b('0x82')][_0x356b('0x7a')]({'where':{'id':_0x5a7fce[_0x356b('0x7c')]}});}})[_0x356b('0x24')](function(_0x20e57b){if(!_0x20e57b){throw new db[(_0x356b('0x51'))][(_0x356b('0x5f'))](_0x356b('0x83'));}if(!_0x20e57b['data1']||!_0x20e57b[_0x356b('0x84')]){throw new db[(_0x356b('0x51'))][(_0x356b('0x5f'))](_0x356b('0x85'));}_0x26889d=_0x20e57b;return getBucketslist(_0x26889d[_0x356b('0x86')],_0x26889d['data2'],_0x5a7fce[_0x356b('0x87')]);})[_0x356b('0x24')](function(_0x3b7cef){if(_0x3b7cef&&_0x3b7cef[_0x356b('0x88')]){var _0x3356cb=_[_0x356b('0x4b')](_0x3b7cef['Buckets'],function(_0x71c4dc){return _0x71c4dc['Name']===_0x5a7fce[_0x356b('0x70')];});if(!_0x3356cb){logger[_0x356b('0x64')](util['format'](_0x356b('0x89'),_0x13c70e[_0x356b('0x42')]['id'],_0x5a7fce[_0x356b('0x70')]));return createBucket(_0x26889d[_0x356b('0x86')],_0x26889d[_0x356b('0x84')],_0x5a7fce[_0x356b('0x87')],_0x5a7fce[_0x356b('0x70')]);}logger[_0x356b('0x64')](util[_0x356b('0x2e')](_0x356b('0x8a'),_0x13c70e[_0x356b('0x42')]['id'],_0x5a7fce[_0x356b('0x70')]));return;}})[_0x356b('0x24')](function(_0x5ab745){if(_0x41c5da[_0x356b('0x8b')]===_0x356b('0x8c')){return transcribe(_0x13c70e[_0x356b('0x42')]['id'],_0x26889d[_0x356b('0x86')],_0x26889d[_0x356b('0x84')],_0x5a7fce[_0x356b('0x87')],_0x5a7fce[_0x356b('0x70')],_0x41c5da[_0x356b('0x4c')],_0x5a7fce[_0x356b('0x7d')]);}else{logger[_0x356b('0x64')](util[_0x356b('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x13c70e['params']['id']));return{'transcribeStatus':_0x356b('0x8d')};}})[_0x356b('0x24')](function(_0x2389b3){if(_0x2389b3){_0x2389b3[_0x356b('0x8e')]=_0x13c70e['body'][_0x356b('0x8f')];return _0x41c5da[_0x356b('0x90')](_0x2389b3);}})[_0x356b('0x24')](respondWithResult(_0x4548d5,null))[_0x356b('0x40')](handleError(_0x4548d5,null));};function writeFile(_0x599f4d,_0x463523){return new Promise(function(_0x56edac,_0x3ff8ad){fs[_0x356b('0x91')](_0x463523,_0x599f4d,function(_0x2fd3b,_0x44e715){if(_0x2fd3b){return _0x3ff8ad(_0x2fd3b);}else{return _0x56edac(_0x44e715);}});});}exports[_0x356b('0x92')]=function(_0x27b35f,_0x1b9a40,_0x36656b){return db[_0x356b('0x28')][_0x356b('0x7a')]({'where':{'id':_0x27b35f['params']['id']}})['then'](handleEntityNotFound(_0x1b9a40))[_0x356b('0x24')](function(_0x27ebe9){if(_0x27ebe9&&_0x27ebe9['fileText']){var _0x44e142=_0x27ebe9[_0x356b('0x93')];var _0x47d26e=config['root']+_0x356b('0x94')+_0x27ebe9['id']+_0x356b('0x95');if(fs[_0x356b('0x5e')](_0x47d26e)){return _0x47d26e;}return writeFile(_0x44e142,_0x47d26e)[_0x356b('0x24')](function(){return _0x47d26e;});}else{throw new db[(_0x356b('0x51'))][(_0x356b('0x5f'))](_0x356b('0x96'));}})[_0x356b('0x24')](function(_0x3a651d){return _0x1b9a40[_0x356b('0x48')](_0x3a651d);})[_0x356b('0x40')](handleError(_0x1b9a40));}; \ No newline at end of file +var _0x264e=['name','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','VoiceRecording','findAll','catch','include','create','body','find','describe','download','../../components/encryptor','uniqueid','params','value','existsSync','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','push','$and','%s.cypher','decryptFile','VoiceRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','createBucket','upload','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','json','apply','save','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','differenceBy'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x264e,0x195));var _0xe264=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x264e[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe264('0x0'));var zipdir=require(_0xe264('0x1'));var jsonpatch=require(_0xe264('0x2'));var rp=require(_0xe264('0x3'));var moment=require(_0xe264('0x4'));var BPromise=require(_0xe264('0x5'));var Mustache=require(_0xe264('0x6'));var util=require(_0xe264('0x7'));var path=require('path');var sox=require(_0xe264('0x8'));var csv=require(_0xe264('0x9'));var ejs=require(_0xe264('0xa'));var fs=require('fs');var fs_extra=require(_0xe264('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe264('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe264('0x9'));var querystring=require(_0xe264('0xd'));var Papa=require(_0xe264('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0xe264('0xf'));var Redis=require(_0xe264('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe264('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe264('0x12'))(_0xe264('0x13'));var utils=require(_0xe264('0x14'));var config=require(_0xe264('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe264('0x16'))['db'];function respondWithStatusCode(_0x298a75,_0xeb75be){_0xeb75be=_0xeb75be||0xcc;return function(_0x19c681){if(_0x19c681){return _0x298a75[_0xe264('0x17')](_0xeb75be);}return _0x298a75[_0xe264('0x18')](_0xeb75be)[_0xe264('0x19')]();};}function respondWithResult(_0x3ec9ba,_0x558264){_0x558264=_0x558264||0xc8;return function(_0x101eb4){if(_0x101eb4){return _0x3ec9ba[_0xe264('0x18')](_0x558264)['json'](_0x101eb4);}};}function respondWithFilteredResult(_0x41e29d,_0x12a25b){return function(_0x924e0f){if(_0x924e0f){var _0x4c5e6a=typeof _0x12a25b['offset']===_0xe264('0x1a')&&typeof _0x12a25b['limit']===_0xe264('0x1a');var _0x49b7d6=_0x924e0f[_0xe264('0x1b')];var _0x36c35d=_0x4c5e6a?0x0:_0x12a25b[_0xe264('0x1c')];var _0x144120=_0x4c5e6a?_0x924e0f[_0xe264('0x1b')]:_0x12a25b[_0xe264('0x1c')]+_0x12a25b['limit'];var _0x3ee912;if(_0x144120>=_0x49b7d6){_0x144120=_0x49b7d6;_0x3ee912=0xc8;}else{_0x3ee912=0xce;}_0x41e29d['status'](_0x3ee912);return _0x41e29d['set']('Content-Range',_0x36c35d+'-'+_0x144120+'/'+_0x49b7d6)[_0xe264('0x1d')](_0x924e0f);}return null;};}function patchUpdates(_0x2562ea){return function(_0x1004ca){try{jsonpatch[_0xe264('0x1e')](_0x1004ca,_0x2562ea,!![]);}catch(_0x3d07c9){return BPromise['reject'](_0x3d07c9);}return _0x1004ca[_0xe264('0x1f')]();};}function saveUpdates(_0x2bcad8,_0x4b1497){return function(_0x131ea8){if(_0x131ea8){return _0x131ea8[_0xe264('0x20')](_0x2bcad8)[_0xe264('0x21')](function(_0x30e8a5){return _0x30e8a5;});}return null;};}function removeEntity(_0x404140,_0x5662e8){return function(_0x30edc8){if(_0x30edc8){return _0x30edc8[_0xe264('0x22')]()['then'](function(){_0x404140[_0xe264('0x18')](0xcc)[_0xe264('0x19')]();});}};}function handleEntityNotFound(_0x365919,_0x3f1b30){return function(_0x120719){if(!_0x120719){_0x365919['sendStatus'](0x194);}return _0x120719;};}function handleError(_0x76d6b3,_0x33af0b){_0x33af0b=_0x33af0b||0x1f4;return function(_0x30c43c){logger[_0xe264('0x23')](_0x30c43c[_0xe264('0x24')]);if(_0x30c43c['name']){delete _0x30c43c['name'];}_0x76d6b3[_0xe264('0x18')](_0x33af0b)[_0xe264('0x25')](_0x30c43c);};}exports['index']=function(_0x324967,_0xbe19da){var _0x49f62d={},_0xf6ea0a={},_0x137989={'count':0x0,'rows':[]};var _0xc93f02=_[_0xe264('0x26')](db['VoiceRecording'][_0xe264('0x27')],function(_0x473f66){return{'name':_0x473f66[_0xe264('0x28')],'type':_0x473f66[_0xe264('0x29')][_0xe264('0x2a')]};});_0xf6ea0a[_0xe264('0x2b')]=_[_0xe264('0x2c')](_[_0xe264('0x26')](_0xc93f02,_0xe264('0x2d')),[_0xe264('0x2e')]);_0xf6ea0a[_0xe264('0x2f')]=_[_0xe264('0x30')](_0x324967['query']);_0xf6ea0a['filters']=_[_0xe264('0x31')](_0xf6ea0a['model'],_0xf6ea0a[_0xe264('0x2f')]);_0x49f62d[_0xe264('0x32')]=_['intersection'](_0xf6ea0a[_0xe264('0x2b')],qs[_0xe264('0x33')](_0x324967['query'][_0xe264('0x33')]));_0x49f62d[_0xe264('0x32')]=_0x49f62d[_0xe264('0x32')][_0xe264('0x34')]?_0x49f62d[_0xe264('0x32')]:_0xf6ea0a['model'];if(!_0x324967[_0xe264('0x2f')][_0xe264('0x35')](_0xe264('0x36'))){_0x49f62d[_0xe264('0x37')]=qs[_0xe264('0x37')](_0x324967[_0xe264('0x2f')]['limit']);_0x49f62d[_0xe264('0x1c')]=qs['offset'](_0x324967[_0xe264('0x2f')][_0xe264('0x1c')]);}_0x49f62d['order']=qs[_0xe264('0x38')](_0x324967[_0xe264('0x2f')]['sort']);_0x49f62d[_0xe264('0x39')]=qs[_0xe264('0x3a')](_[_0xe264('0x3b')](_0x324967[_0xe264('0x2f')],_0xf6ea0a[_0xe264('0x3a')]),_0xc93f02);if(_0x324967[_0xe264('0x2f')][_0xe264('0x3c')]){_0x49f62d['where']=_[_0xe264('0x3d')](_0x49f62d[_0xe264('0x39')],{'$or':_['map'](_0xc93f02,function(_0x5110de){if(_0x5110de['type']!==_0xe264('0x3e')){var _0x55626c={};_0x55626c[_0x5110de[_0xe264('0x2d')]]={'$like':'%'+_0x324967[_0xe264('0x2f')][_0xe264('0x3c')]+'%'};return _0x55626c;}})});}_0x49f62d=_['merge']({},_0x49f62d,_0x324967[_0xe264('0x3f')]);var _0x4bd2bc={'where':_0x49f62d['where']};return db['VoiceRecording'][_0xe264('0x1b')](_0x4bd2bc)[_0xe264('0x21')](function(_0x29f749){_0x137989[_0xe264('0x1b')]=_0x29f749;if(_0x324967['query'][_0xe264('0x40')]){_0x49f62d['include']=[{'all':!![]}];}return db[_0xe264('0x41')][_0xe264('0x42')](_0x49f62d);})[_0xe264('0x21')](function(_0x3d43f2){_0x137989['rows']=_0x3d43f2;return _0x137989;})[_0xe264('0x21')](respondWithFilteredResult(_0xbe19da,_0x49f62d))[_0xe264('0x43')](handleError(_0xbe19da,null));};exports['show']=function(_0x54dec2,_0x13a56a){var _0x1ea45a={'raw':![],'where':{'id':_0x54dec2['params']['id']}},_0x2145d5={};_0x2145d5[_0xe264('0x2b')]=_['keys'](db[_0xe264('0x41')][_0xe264('0x27')]);_0x2145d5['query']=_[_0xe264('0x30')](_0x54dec2[_0xe264('0x2f')]);_0x2145d5[_0xe264('0x3a')]=_[_0xe264('0x31')](_0x2145d5[_0xe264('0x2b')],_0x2145d5[_0xe264('0x2f')]);_0x1ea45a[_0xe264('0x32')]=_[_0xe264('0x31')](_0x2145d5[_0xe264('0x2b')],qs[_0xe264('0x33')](_0x54dec2[_0xe264('0x2f')][_0xe264('0x33')]));_0x1ea45a[_0xe264('0x32')]=_0x1ea45a[_0xe264('0x32')][_0xe264('0x34')]?_0x1ea45a[_0xe264('0x32')]:_0x2145d5[_0xe264('0x2b')];if(_0x54dec2[_0xe264('0x2f')][_0xe264('0x40')]){_0x1ea45a[_0xe264('0x44')]=[{'all':!![]}];}_0x1ea45a=_[_0xe264('0x3d')]({},_0x1ea45a,_0x54dec2[_0xe264('0x3f')]);return db[_0xe264('0x41')]['find'](_0x1ea45a)[_0xe264('0x21')](handleEntityNotFound(_0x13a56a,null))[_0xe264('0x21')](respondWithResult(_0x13a56a,null))[_0xe264('0x43')](handleError(_0x13a56a,null));};exports['create']=function(_0x1b8680,_0x3a22ae){return db[_0xe264('0x41')][_0xe264('0x45')](_0x1b8680[_0xe264('0x46')],{})[_0xe264('0x21')](respondWithResult(_0x3a22ae,0xc9))[_0xe264('0x43')](handleError(_0x3a22ae,null));};exports[_0xe264('0x20')]=function(_0x5c3b73,_0xfd1926){if(_0x5c3b73['body']['id']){delete _0x5c3b73[_0xe264('0x46')]['id'];}return db[_0xe264('0x41')][_0xe264('0x47')]({'where':{'id':_0x5c3b73['params']['id']}})['then'](handleEntityNotFound(_0xfd1926,null))[_0xe264('0x21')](saveUpdates(_0x5c3b73['body'],null))['then'](respondWithResult(_0xfd1926,null))[_0xe264('0x43')](handleError(_0xfd1926,null));};exports[_0xe264('0x48')]=function(_0x46d83c,_0x228548){return db['VoiceRecording'][_0xe264('0x48')]()[_0xe264('0x21')](respondWithResult(_0x228548,null))[_0xe264('0x43')](handleError(_0x228548,null));};exports[_0xe264('0x49')]=function(_0x207ea9,_0x2f1fb6,_0x5ddf4c){var _0xf06963=require(_0xe264('0x4a'));var _0x26a033=![];var _0x36390d={};if(_0x207ea9[_0xe264('0x2f')][_0xe264('0x29')]&&_0x207ea9['query'][_0xe264('0x29')]===_0xe264('0x4b')){_0x36390d[_0xe264('0x4b')]=_0x207ea9[_0xe264('0x4c')]['id'];}else{_0x36390d['id']=_0x207ea9[_0xe264('0x4c')]['id'];}return db[_0xe264('0x41')][_0xe264('0x47')]({'where':_0x36390d,'attributes':['id',_0xe264('0x4d')],'raw':!![]})[_0xe264('0x21')](handleEntityNotFound(_0x2f1fb6,null))[_0xe264('0x21')](function(_0x295759){if(_0x295759){var _0x300aaa=_0x295759['value'];var _0x49be32=util[_0xe264('0x2e')]('%s.cypher',_0x300aaa);if(fs[_0xe264('0x4e')](_0x49be32)){_0x26a033=!![];return _0xf06963['decryptFile'](_0x49be32,_0x300aaa,config[_0xe264('0x4f')][_0xe264('0x50')])[_0xe264('0x21')](function(){return _0x295759;});}return _0x295759;}})['then'](function(_0x31dcf6){if(_0x31dcf6){var _0x2c2749=_0x31dcf6[_0xe264('0x4d')];if(!fs[_0xe264('0x4e')](_0x2c2749)){throw new db[(_0xe264('0x51'))][(_0xe264('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x31dcf6['filename']){return _0x2f1fb6[_0xe264('0x49')](_0x2c2749,_0x31dcf6[_0xe264('0x53')]+path[_0xe264('0x54')](_0x2c2749),function(){if(_0x26a033){fs[_0xe264('0x55')](_0x2c2749);}});}else{return _0x2f1fb6[_0xe264('0x49')](_0x2c2749,function(_0x45061e){if(_0x26a033){fs[_0xe264('0x55')](_0x2c2749);}});}}})['catch'](function(_0x2eb075){if(_0x2eb075[_0xe264('0x56')]==='VoiceRecording\x20not\x20found'){_0x2f1fb6[_0xe264('0x18')](0x194)[_0xe264('0x25')](_0xe264('0x57'));}else{return handleError(_0x2f1fb6,null);}});};exports[_0xe264('0x58')]=function(_0x465ac4,_0x184d86,_0x463c3c){var _0x35ddca=require(_0xe264('0x4a'));var _0x19dece=![];var _0x25ca19={'$and':[db[_0xe264('0x59')][_0xe264('0x39')](db['sequelize']['fn'](_0xe264('0x5a'),db[_0xe264('0x59')]['col'](_0xe264('0x4b'))),_0x465ac4['query'][_0xe264('0x5b')])]};if(_0x465ac4['query'][_0xe264('0x29')]&&_0x465ac4[_0xe264('0x2f')][_0xe264('0x29')]===_0xe264('0x4b')){_0x25ca19['$and'][_0xe264('0x5c')]({'uniqueid':_0x465ac4['params']['id']});}else{_0x25ca19[_0xe264('0x5d')][_0xe264('0x5c')]({'id':_0x465ac4[_0xe264('0x4c')]['id']});}return db['VoiceRecording'][_0xe264('0x47')]({'where':_0x25ca19,'attributes':['id',_0xe264('0x4d')],'raw':!![]})[_0xe264('0x21')](handleEntityNotFound(_0x184d86,null))[_0xe264('0x21')](function(_0xfb57fa){if(_0xfb57fa){var _0x50db70=util[_0xe264('0x2e')](_0xe264('0x5e'),_0xfb57fa[_0xe264('0x4d')]);if(fs[_0xe264('0x4e')](_0x50db70)){_0x19dece=!![];return _0x35ddca[_0xe264('0x5f')](_0x50db70,_0xfb57fa[_0xe264('0x4d')],config['secrets'][_0xe264('0x50')])['then'](function(){return _0xfb57fa;});}return _0xfb57fa;}})[_0xe264('0x21')](function(_0x5e0837){if(_0x5e0837){if(!fs[_0xe264('0x4e')](_0x5e0837[_0xe264('0x4d')])){throw new db[(_0xe264('0x51'))][(_0xe264('0x52'))](_0xe264('0x60'));}if(_0x5e0837[_0xe264('0x53')]){return _0x184d86[_0xe264('0x49')](_0x5e0837[_0xe264('0x4d')],_0x5e0837['filename']+path['extname'](_0x5e0837[_0xe264('0x4d')]),function(){if(_0x19dece){fs[_0xe264('0x55')](_0x5e0837[_0xe264('0x4d')]);}});}else{return _0x184d86['download'](_0x5e0837[_0xe264('0x4d')],function(_0xbd694e){if(_0x19dece){fs[_0xe264('0x55')](_0x5e0837['value']);}});}}})[_0xe264('0x43')](handleError(_0x184d86,null));};exports[_0xe264('0x22')]=function(_0x4ef791,_0x1494aa){return db[_0xe264('0x41')][_0xe264('0x47')]({'where':{'id':_0x4ef791['params']['id']}})[_0xe264('0x21')](function(_0x77f230){if(_[_0xe264('0x61')](_0x77f230)){throw new ReferenceError('Entity\x20not\x20found');}return _0x77f230;})['then'](function(_0x5d4ca5){var _0x168b95=_0x5d4ca5[_0xe264('0x4d')];logger[_0xe264('0x62')](_0xe264('0x63'),_0x168b95);if(!_[_0xe264('0x61')](_0x5d4ca5[_0xe264('0x4d')])&&fs[_0xe264('0x4e')](_0x168b95)){logger['info']('File:\x20\x22'+_0x168b95+_0xe264('0x64'));fs['unlinkSync'](_0x168b95);}_0x168b95=_0x168b95+_0xe264('0x65');if(!_[_0xe264('0x61')](_0x5d4ca5['value'])&&fs[_0xe264('0x4e')](_0x168b95)){logger[_0xe264('0x62')]('File:\x20\x22'+_0x168b95+_0xe264('0x64'));fs[_0xe264('0x66')](_0x168b95);}return _0x5d4ca5;})[_0xe264('0x21')](function(_0x21c8ef){if(!_0x21c8ef)throw new InternalError();return _0x21c8ef[_0xe264('0x22')]();})[_0xe264('0x21')](function(){_0x1494aa[_0xe264('0x18')](0xcc)['end']();})[_0xe264('0x43')](handleError(_0x1494aa,null));};function getBucketslist(_0x17150e,_0x6bedde,_0x3d5424){return new Promise(function(_0x11c3ff,_0x4c7ec5){var _0x1da4fb=new AWS['S3']({'accessKeyId':_0x6bedde,'secretAccessKey':_0x17150e,'region':_0x3d5424});_0x1da4fb['listBuckets']({},function(_0x413466,_0x3566ee){if(_0x413466){return _0x4c7ec5(_0x413466);}else{return _0x11c3ff(_0x3566ee);}});});}function createBucket(_0x430e4c,_0xf32741,_0x52e0ff,_0x272669){return new Promise(function(_0x2bf119,_0x1f84b6){var _0x4d8834=new AWS['S3']({'accessKeyId':_0xf32741,'secretAccessKey':_0x430e4c,'region':_0x52e0ff});_0x4d8834[_0xe264('0x67')]({'Bucket':_0x272669},function(_0x2e27c1,_0x5d1fb8){if(_0x2e27c1){return _0x1f84b6(_0x2e27c1);}else{return _0x2bf119(_0x5d1fb8);}});});}function uploadFile(_0x1728d3,_0x2de057,_0x2cfd96,_0x6ad501,_0x5a09a9,_0x562510){return new Promise(function(_0x59ed52,_0x140cc8){var _0x2379de=new AWS['S3']({'accessKeyId':_0x2de057,'secretAccessKey':_0x1728d3,'region':_0x2cfd96});_0x2379de[_0xe264('0x68')]({'Bucket':_0x6ad501,'Key':_0x5a09a9,'Body':_0x562510},function(_0x14b2e8,_0x5412fb){if(_0x14b2e8){return _0x140cc8(_0x14b2e8);}else{return _0x59ed52(_0x5412fb);}});});}function startTranscribe(_0xa072ee,_0xcda98,_0x25ac9c,_0x65f6c1,_0x5f1ac2,_0x3ff6de){return new Promise(function(_0x16ca9a,_0x515819){var _0x15c89a=new AWS[(_0xe264('0x69'))]({'accessKeyId':_0xcda98,'secretAccessKey':_0xa072ee,'region':_0x25ac9c});_0x15c89a[_0xe264('0x6a')]({'TranscriptionJobName':_0x65f6c1,'LanguageCode':_0x5f1ac2,'Media':{'MediaFileUri':_0x3ff6de}},function(_0x1bc8e4,_0x2554e3){if(_0x1bc8e4){return _0x515819(_0x1bc8e4);}else{return _0x16ca9a(_0x2554e3);}});});}function transcribe(_0xa2aab,_0x1ca381,_0x1c5993,_0x2c91f4,_0x2dd3bc,_0x1fec9c,_0x522fc1){return new Promise(function(_0x50067f,_0x5a668a){var _0x156e00={};logger[_0xe264('0x62')](util[_0xe264('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xa2aab,_0x2dd3bc));return uploadFile(_0x1ca381,_0x1c5993,_0x2c91f4,_0x2dd3bc,path[_0xe264('0x6b')](_0x1fec9c),fs['readFileSync'](_0x1fec9c))[_0xe264('0x21')](function(_0x3fd87b){logger[_0xe264('0x62')](util[_0xe264('0x2e')](_0xe264('0x6c'),_0xa2aab,_0x2dd3bc,_0x3fd87b[_0xe264('0x6d')]));_0x156e00[_0xe264('0x6e')]=_0x3fd87b['Bucket'];_0x156e00[_0xe264('0x6f')]=_0x3fd87b[_0xe264('0x6d')];logger[_0xe264('0x62')](util[_0xe264('0x2e')](_0xe264('0x70'),_0xa2aab));return startTranscribe(_0x1ca381,_0x1c5993,_0x2c91f4,uuidv4(),_0x522fc1,_0x3fd87b[_0xe264('0x6d')]);})['then'](function(_0x2c0ef0){logger[_0xe264('0x62')](util[_0xe264('0x2e')](_0xe264('0x71'),_0xa2aab,_0x2c0ef0[_0xe264('0x72')][_0xe264('0x73')]));_0x156e00[_0xe264('0x74')]=_0x2c0ef0['TranscriptionJob']['TranscriptionJobName'];_0x156e00[_0xe264('0x75')]=_0x2c0ef0['TranscriptionJob'][_0xe264('0x76')];return _0x50067f(_0x156e00);})[_0xe264('0x43')](function(_0x283773){return _0x5a668a(_0x283773);});});}exports[_0xe264('0x77')]=function(_0x1f802b,_0xf029ad,_0x33aed9){var _0x1baef9;var _0x2d8dd8;var _0x29f770;var _0x4d446a=require(_0xe264('0x4a'));return db[_0xe264('0x41')][_0xe264('0x78')]({'where':{'id':_0x1f802b['params']['id']}})['then'](function(_0x2b7fd3){if(_0x2b7fd3){var _0x15b985=util[_0xe264('0x2e')](_0xe264('0x5e'),_0x2b7fd3['value']);if(fs['existsSync'](_0x15b985)){cypher=!![];return _0x4d446a[_0xe264('0x5f')](_0x15b985,_0x2b7fd3['value'],config[_0xe264('0x4f')][_0xe264('0x50')])[_0xe264('0x21')](function(){return _0x2b7fd3;});}return _0x2b7fd3;}})[_0xe264('0x21')](function(_0x3a401e){if(!_0x3a401e){throw new db[(_0xe264('0x51'))][(_0xe264('0x52'))](_0xe264('0x79'));}_0x2d8dd8=_0x3a401e;return db['Setting'][_0xe264('0x78')]({'where':{'id':0x1}});})[_0xe264('0x21')](handleEntityNotFound(_0xf029ad,null))[_0xe264('0x21')](function(_0x34d05f){if(_0x34d05f){_0x1baef9=_0x34d05f;if(!_0x1baef9[_0xe264('0x7a')]||!_0x1baef9[_0xe264('0x7b')]||!_0x1baef9[_0xe264('0x7c')]||!_0x1baef9[_0xe264('0x7d')]||!_0x1baef9['bucket']){throw new db[(_0xe264('0x51'))]['ValidationError'](_0xe264('0x7e'));}if(_0x1f802b[_0xe264('0x46')][_0xe264('0x7f')]&&(!_0x1baef9['sentiment']||!_0x1baef9[_0xe264('0x80')]||!_0x1baef9[_0xe264('0x81')]||!_0x1baef9[_0xe264('0x7d')]||!_0x1baef9[_0xe264('0x6e')])){throw new db[(_0xe264('0x51'))]['ValidationError'](_0xe264('0x82'));}return db[_0xe264('0x83')][_0xe264('0x78')]({'where':{'id':_0x1baef9['transcribeAccountId']}});}})[_0xe264('0x21')](function(_0x13d829){if(!_0x13d829){throw new db[(_0xe264('0x51'))][(_0xe264('0x52'))](_0xe264('0x84'));}if(!_0x13d829[_0xe264('0x85')]||!_0x13d829[_0xe264('0x86')]){throw new db[(_0xe264('0x51'))][(_0xe264('0x52'))](_0xe264('0x87'));}_0x29f770=_0x13d829;return getBucketslist(_0x29f770[_0xe264('0x85')],_0x29f770['data2'],_0x1baef9['transcribeRegion']);})[_0xe264('0x21')](function(_0x1397b3){if(_0x1397b3&&_0x1397b3[_0xe264('0x88')]){var _0x252d86=_[_0xe264('0x47')](_0x1397b3[_0xe264('0x88')],function(_0x1af7fe){return _0x1af7fe['Name']===_0x1baef9['bucket'];});if(!_0x252d86){logger[_0xe264('0x62')](util[_0xe264('0x2e')](_0xe264('0x89'),_0x1f802b['params']['id'],_0x1baef9[_0xe264('0x6e')]));return createBucket(_0x29f770['data1'],_0x29f770[_0xe264('0x86')],_0x1baef9[_0xe264('0x7c')],_0x1baef9['bucket']);}logger[_0xe264('0x62')](util[_0xe264('0x2e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1f802b[_0xe264('0x4c')]['id'],_0x1baef9[_0xe264('0x6e')]));return;}})[_0xe264('0x21')](function(_0xe393f5){if(_0x2d8dd8[_0xe264('0x75')]===_0xe264('0x8a')){return transcribe(_0x1f802b[_0xe264('0x4c')]['id'],_0x29f770[_0xe264('0x85')],_0x29f770[_0xe264('0x86')],_0x1baef9[_0xe264('0x7c')],_0x1baef9['bucket'],_0x2d8dd8[_0xe264('0x4d')],_0x1baef9[_0xe264('0x7d')]);}else{logger[_0xe264('0x62')](util[_0xe264('0x2e')](_0xe264('0x8b'),_0x1f802b[_0xe264('0x4c')]['id']));return{'transcribeStatus':_0xe264('0x8c')};}})[_0xe264('0x21')](function(_0x363e16){if(_0x363e16){_0x363e16[_0xe264('0x8d')]=_0x1f802b['body']['runSentiment'];return _0x2d8dd8[_0xe264('0x8e')](_0x363e16);}})[_0xe264('0x21')](respondWithResult(_0xf029ad,null))[_0xe264('0x43')](handleError(_0xf029ad,null));};function writeFile(_0x19d0d9,_0x1e681a){return new Promise(function(_0x3d3fee,_0x146925){fs[_0xe264('0x8f')](_0x1e681a,_0x19d0d9,function(_0x91e1e8,_0x56e67c){if(_0x91e1e8){return _0x146925(_0x91e1e8);}else{return _0x3d3fee(_0x56e67c);}});});}exports[_0xe264('0x90')]=function(_0x6e861f,_0x151189,_0x5478ab){return db['VoiceRecording'][_0xe264('0x78')]({'where':{'id':_0x6e861f[_0xe264('0x4c')]['id']}})['then'](handleEntityNotFound(_0x151189))[_0xe264('0x21')](function(_0x37da28){if(_0x37da28&&_0x37da28['fileText']){var _0x3b445f=_0x37da28[_0xe264('0x91')];var _0x246b25=config[_0xe264('0x92')]+_0xe264('0x93')+_0x37da28['id']+_0xe264('0x94');if(fs[_0xe264('0x4e')](_0x246b25)){return _0x246b25;}return writeFile(_0x3b445f,_0x246b25)['then'](function(){return _0x246b25;});}else{throw new db[(_0xe264('0x51'))]['ValidationError'](_0xe264('0x95'));}})[_0xe264('0x21')](function(_0x44124e){return _0x151189[_0xe264('0x49')](_0x44124e);})[_0xe264('0x43')](handleError(_0x151189));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 621f978..8285565 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 _0xcabc=['uniqueid','transcribeStatus','exports','define','VoiceRecording'];(function(_0x3ec527,_0xd00554){var _0x27d534=function(_0x1c26ed){while(--_0x1c26ed){_0x3ec527['push'](_0x3ec527['shift']());}};_0x27d534(++_0xd00554);}(_0xcabc,0x16a));var _0xccab=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcabc[_0x46e363];return _0x3fb059;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xccab('0x0')]=function(_0x2eab55,_0x38d361){return _0x2eab55[_0xccab('0x1')](_0xccab('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xccab('0x3'),'fields':[_0xccab('0x3')]},{'name':'transcribeStatus','fields':[_0xccab('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5044=['uniqueid','transcribeStatus','exports','define','VoiceRecording','voice_recordings'];(function(_0x2e382d,_0x2425d5){var _0x4be5ff=function(_0x427da6){while(--_0x427da6){_0x2e382d['push'](_0x2e382d['shift']());}};_0x4be5ff(++_0x2425d5);}(_0x5044,0xc8));var _0x4504=function(_0x3d39d4,_0x28426d){_0x3d39d4=_0x3d39d4-0x0;var _0x18f002=_0x5044[_0x3d39d4];return _0x18f002;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x4504('0x0')]=function(_0x5a60e3,_0x42508e){return _0x5a60e3[_0x4504('0x1')](_0x4504('0x2'),attributes,{'tableName':_0x4504('0x3'),'paranoid':![],'indexes':[{'name':_0x4504('0x4'),'fields':[_0x4504('0x4')]},{'name':_0x4504('0x5'),'fields':[_0x4504('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 69b4385..925fe28 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 _0x9536=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','callRecordingEncryption','create','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x5b1d45,_0x1bc88f){var _0x2b8d39=function(_0x3542d6){while(--_0x3542d6){_0x5b1d45['push'](_0x5b1d45['shift']());}};_0x2b8d39(++_0x1bc88f);}(_0x9536,0x179));var _0x6953=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x9536[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});}exports[_0x6953('0x17')]=function(_0x2da771){var _0x4b43ae=this;return new Promise(function(_0x10858a,_0x3207dd){return db[_0x6953('0x18')][_0x6953('0x19')](_0x2da771[_0x6953('0x1a')],{'raw':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da771[_0x6953('0x1b')]?_0x2da771[_0x6953('0x1b')][_0x6953('0x1d')]||null:null,'attributes':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1e')]||null:null,'limit':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1f')]||null:null})[_0x6953('0xc')](function(_0x171dd8){logger['info'](_0x6953('0x17'),_0x2da771);logger[_0x6953('0xf')](_0x6953('0x17'),_0x2da771,JSON['stringify'](_0x171dd8));_0x10858a(_0x171dd8);})['catch'](function(_0x5a4cd7){logger[_0x6953('0x12')](_0x6953('0x17'),_0x5a4cd7['message'],_0x2da771);_0x3207dd(_0x4b43ae[_0x6953('0x12')](0x1f4,_0x5a4cd7['message']));});});};exports[_0x6953('0x20')]=function(_0x2bf39b){var _0xcdbce8=this;return new Promise(function(_0x2cc01e,_0x191d80){var _0x1497e3=require('../../components/encryptor');var _0x3dd890;return db[_0x6953('0x21')]['findOne']({'attributes':['id',_0x6953('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x173b3c){_0x3dd890=_0x173b3c;return db[_0x6953('0x18')][_0x6953('0x23')](_0x2bf39b['body']);})[_0x6953('0xc')](function(_0x3d7b04){if(_0x3dd890[_0x6953('0x22')]&&fs['existsSync'](_0x3d7b04[_0x6953('0x24')])){var _0x132a71=util['format']('%s.cypher',_0x3d7b04[_0x6953('0x24')]);return _0x1497e3[_0x6953('0x25')](_0x3d7b04[_0x6953('0x24')],_0x132a71,config[_0x6953('0x26')][_0x6953('0x27')])['then'](function(){fs[_0x6953('0x28')](_0x3d7b04['value']);logger[_0x6953('0x15')](_0x6953('0x29'));return _0x3d7b04;});}return _0x3d7b04;})['then'](function(_0x4a4d41){logger[_0x6953('0x15')](_0x6953('0x20'),_0x2bf39b);logger[_0x6953('0xf')]('CreateVoiceRecording',_0x2bf39b,JSON[_0x6953('0x11')](_0x4a4d41));_0x2cc01e(_0x4a4d41);})['catch'](function(_0x4e95f1){logger['error']('CreateVoiceRecording',_0x4e95f1[_0x6953('0x14')],_0x2bf39b);_0x191d80(_0xcdbce8[_0x6953('0x12')](0x1f4,_0x4e95f1[_0x6953('0x14')]));});});}; \ No newline at end of file +var _0x32f4=['unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','../../components/encryptor','findOne','callRecordingEncryption','existsSync','format','encryptFile','value','secrets','recording'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x32f4,0x154));var _0x432f=function(_0x42281f,_0x2f9728){_0x42281f=_0x42281f-0x0;var _0x571f2f=_0x32f4[_0x42281f];return _0x571f2f;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['update'](_0x243cf[_0x432f('0x18')],{'raw':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1b')]||null:null,'attributes':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')][_0x432f('0x1c')]||null:null,'limit':_0x243cf[_0x432f('0x19')]?_0x243cf[_0x432f('0x19')]['limit']||null:null})['then'](function(_0x343d13){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON[_0x432f('0x10')](_0x343d13));_0x129582(_0x343d13);})[_0x432f('0x15')](function(_0x89ea50){logger[_0x432f('0x11')](_0x432f('0x16'),_0x89ea50['message'],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x89ea50[_0x432f('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2cbde9){var _0x3e37ec=this;return new Promise(function(_0x2bcbb4,_0x23347e){var _0x44839=require(_0x432f('0x1d'));var _0x138a6a;return db['Setting'][_0x432f('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x432f('0xb')](function(_0x573cc5){_0x138a6a=_0x573cc5;return db[_0x432f('0x17')]['create'](_0x2cbde9[_0x432f('0x18')]);})['then'](function(_0x325a9c){if(_0x138a6a[_0x432f('0x1f')]&&fs[_0x432f('0x20')](_0x325a9c['value'])){var _0x6a116e=util[_0x432f('0x21')]('%s.cypher',_0x325a9c['value']);return _0x44839[_0x432f('0x22')](_0x325a9c[_0x432f('0x23')],_0x6a116e,config[_0x432f('0x24')][_0x432f('0x25')])[_0x432f('0xb')](function(){fs[_0x432f('0x26')](_0x325a9c['value']);logger['info'](_0x432f('0x27'));return _0x325a9c;});}return _0x325a9c;})[_0x432f('0xb')](function(_0x184203){logger['info'](_0x432f('0x28'),_0x2cbde9);logger[_0x432f('0x29')](_0x432f('0x28'),_0x2cbde9,JSON[_0x432f('0x10')](_0x184203));_0x2bcbb4(_0x184203);})[_0x432f('0x15')](function(_0x3ad632){logger[_0x432f('0x11')](_0x432f('0x28'),_0x3ad632['message'],_0x2cbde9);_0x23347e(_0x3e37ec['error'](0x1f4,_0x3ad632[_0x432f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 743ef45..bb2d44d 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 _0x78c6=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x46fca6,_0x545d38){var _0x32148f=function(_0x1d0d23){while(--_0x1d0d23){_0x46fca6['push'](_0x46fca6['shift']());}};_0x32148f(++_0x545d38);}(_0x78c6,0x76));var _0x678c=function(_0xf24edc,_0x64b3e){_0xf24edc=_0xf24edc-0x0;var _0x2aace8=_0x78c6[_0xf24edc];return _0x2aace8;};'use strict';var multer=require(_0x678c('0x0'));var util=require(_0x678c('0x1'));var path=require('path');var timeout=require(_0x678c('0x2'));var express=require(_0x678c('0x3'));var router=express[_0x678c('0x4')]();var fs_extra=require(_0x678c('0x5'));var auth=require(_0x678c('0x6'));var interaction=require(_0x678c('0x7'));var config=require(_0x678c('0x8'));var controller=require(_0x678c('0x9'));router['get']('/',auth[_0x678c('0xa')](),controller['index']);router[_0x678c('0xb')](_0x678c('0xc'),auth[_0x678c('0xa')](),controller[_0x678c('0xd')]);router[_0x678c('0xb')](_0x678c('0xe'),auth[_0x678c('0xa')](),controller[_0x678c('0xf')]);router[_0x678c('0x10')]('/',auth[_0x678c('0xa')](),controller[_0x678c('0x11')]);router[_0x678c('0x12')](_0x678c('0xe'),auth['isAuthenticated'](),controller[_0x678c('0x13')]);router[_0x678c('0x14')]('/:id',auth[_0x678c('0xa')](),controller[_0x678c('0x15')]);module[_0x678c('0x16')]=router; \ No newline at end of file +var _0x77ce=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4b753c,_0x484508){var _0x482448=function(_0xd42431){while(--_0xd42431){_0x4b753c['push'](_0x4b753c['shift']());}};_0x482448(++_0x484508);}(_0x77ce,0x1aa));var _0xe77c=function(_0x3e3f24,_0x4b7306){_0x3e3f24=_0x3e3f24-0x0;var _0x4d2fcb=_0x77ce[_0x3e3f24];return _0x4d2fcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe77c('0x0'));var timeout=require(_0xe77c('0x1'));var express=require(_0xe77c('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe77c('0x3'));var interaction=require(_0xe77c('0x4'));var config=require('../../config/environment');var controller=require(_0xe77c('0x5'));router[_0xe77c('0x6')]('/',auth[_0xe77c('0x7')](),controller['index']);router[_0xe77c('0x6')](_0xe77c('0x8'),auth['isAuthenticated'](),controller[_0xe77c('0x9')]);router[_0xe77c('0x6')](_0xe77c('0xa'),auth['isAuthenticated'](),controller[_0xe77c('0xb')]);router[_0xe77c('0xc')]('/',auth[_0xe77c('0x7')](),controller[_0xe77c('0xd')]);router[_0xe77c('0xe')](_0xe77c('0xa'),auth['isAuthenticated'](),controller[_0xe77c('0xf')]);router[_0xe77c('0x10')](_0xe77c('0xa'),auth[_0xe77c('0x7')](),controller[_0xe77c('0x11')]);module[_0xe77c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index fc1ffdb..7cf03a8 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 _0x63e1=['blind','attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x2a37ac,_0x8f5d3b){var _0x13f019=function(_0x26cdfd){while(--_0x26cdfd){_0x2a37ac['push'](_0x2a37ac['shift']());}};_0x13f019(++_0x8f5d3b);}(_0x63e1,0x6d));var _0x163e=function(_0x56375b,_0x2867b7){_0x56375b=_0x56375b-0x0;var _0x571ce4=_0x63e1[_0x56375b];return _0x571ce4;};'use strict';var Sequelize=require(_0x163e('0x0'));var moment=require(_0x163e('0x1'));module['exports']={'type':{'type':Sequelize[_0x163e('0x2')](_0x163e('0x3'),_0x163e('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x163e('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x163e('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x163e('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x163e('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x163e('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x163e('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x163e('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x163e('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x163e('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x163e('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x163e('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x163e('0x2')](_0x163e('0x6'),'No')},'context':{'type':Sequelize[_0x163e('0x5')]},'extension':{'type':Sequelize[_0x163e('0x5')]}}; \ No newline at end of file +var _0x03fc=['moment','ENUM','blind','attended','STRING'];(function(_0x427444,_0xf966d1){var _0x356dca=function(_0x28b183){while(--_0x28b183){_0x427444['push'](_0x427444['shift']());}};_0x356dca(++_0xf966d1);}(_0x03fc,0x91));var _0xc03f=function(_0x557fb5,_0x1a85d7){_0x557fb5=_0x557fb5-0x0;var _0x572eca=_0x03fc[_0x557fb5];return _0x572eca;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc03f('0x0'));module['exports']={'type':{'type':Sequelize[_0xc03f('0x1')](_0xc03f('0x2'),_0xc03f('0x3'))},'result':{'type':Sequelize[_0xc03f('0x4')]},'transfererchannel':{'type':Sequelize[_0xc03f('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xc03f('0x4')]},'transferercalleridname':{'type':Sequelize[_0xc03f('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc03f('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xc03f('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xc03f('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xc03f('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xc03f('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xc03f('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xc03f('0x4')]},'transfereecontext':{'type':Sequelize[_0xc03f('0x4')]},'transfereeexten':{'type':Sequelize[_0xc03f('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xc03f('0x4')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3dc1f6a..0aa6d54 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 _0x8076=['create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','then','stack','name','map','VoiceTransferReport','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','where','merge','VIRTUAL','includeAll','include','findAll','params','keys','options','catch'];(function(_0x11fcf6,_0x3789fe){var _0x224bc8=function(_0x14b6c5){while(--_0x14b6c5){_0x11fcf6['push'](_0x11fcf6['shift']());}};_0x224bc8(++_0x3789fe);}(_0x8076,0x118));var _0x6807=function(_0x597403,_0x5e5609){_0x597403=_0x597403-0x0;var _0x4c8793=_0x8076[_0x597403];return _0x4c8793;};'use strict';var emlformat=require(_0x6807('0x0'));var rimraf=require(_0x6807('0x1'));var zipdir=require(_0x6807('0x2'));var jsonpatch=require(_0x6807('0x3'));var rp=require(_0x6807('0x4'));var moment=require(_0x6807('0x5'));var BPromise=require(_0x6807('0x6'));var Mustache=require(_0x6807('0x7'));var util=require('util');var path=require(_0x6807('0x8'));var sox=require(_0x6807('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6807('0xa'));var deskjs=require(_0x6807('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6807('0xc'));var Papa=require(_0x6807('0xd'));var Redis=require(_0x6807('0xe'));var authService=require(_0x6807('0xf'));var qs=require(_0x6807('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6807('0x11'));var logger=require(_0x6807('0x12'))(_0x6807('0x13'));var utils=require(_0x6807('0x14'));var config=require(_0x6807('0x15'));var licenseUtil=require(_0x6807('0x16'));var db=require(_0x6807('0x17'))['db'];function respondWithStatusCode(_0x16e701,_0xccda4a){_0xccda4a=_0xccda4a||0xcc;return function(_0x5c41c1){if(_0x5c41c1){return _0x16e701[_0x6807('0x18')](_0xccda4a);}return _0x16e701[_0x6807('0x19')](_0xccda4a)[_0x6807('0x1a')]();};}function respondWithResult(_0x21ecee,_0x9a5b7c){_0x9a5b7c=_0x9a5b7c||0xc8;return function(_0x4a52c5){if(_0x4a52c5){return _0x21ecee[_0x6807('0x19')](_0x9a5b7c)['json'](_0x4a52c5);}};}function respondWithFilteredResult(_0x1f44fd,_0x5875f2){return function(_0x1d0751){if(_0x1d0751){var _0x228647=typeof _0x5875f2[_0x6807('0x1b')]===_0x6807('0x1c')&&typeof _0x5875f2['limit']==='undefined';var _0x322002=_0x1d0751[_0x6807('0x1d')];var _0x9baeea=_0x228647?0x0:_0x5875f2[_0x6807('0x1b')];var _0x4c0159=_0x228647?_0x1d0751[_0x6807('0x1d')]:_0x5875f2[_0x6807('0x1b')]+_0x5875f2[_0x6807('0x1e')];var _0x45ef6e;if(_0x4c0159>=_0x322002){_0x4c0159=_0x322002;_0x45ef6e=0xc8;}else{_0x45ef6e=0xce;}_0x1f44fd[_0x6807('0x19')](_0x45ef6e);return _0x1f44fd[_0x6807('0x1f')](_0x6807('0x20'),_0x9baeea+'-'+_0x4c0159+'/'+_0x322002)[_0x6807('0x21')](_0x1d0751);}return null;};}function patchUpdates(_0x5aa329){return function(_0x4bbdd0){try{jsonpatch[_0x6807('0x22')](_0x4bbdd0,_0x5aa329,!![]);}catch(_0x348b1e){return BPromise[_0x6807('0x23')](_0x348b1e);}return _0x4bbdd0['save']();};}function saveUpdates(_0x2aa40a,_0x47d986){return function(_0x2f728b){if(_0x2f728b){return _0x2f728b[_0x6807('0x24')](_0x2aa40a)['then'](function(_0x27aba7){return _0x27aba7;});}return null;};}function removeEntity(_0x5bc500,_0x2e320f){return function(_0x527443){if(_0x527443){return _0x527443[_0x6807('0x25')]()[_0x6807('0x26')](function(){_0x5bc500['status'](0xcc)[_0x6807('0x1a')]();});}};}function handleEntityNotFound(_0x34f4d2,_0x14491d){return function(_0x3c1752){if(!_0x3c1752){_0x34f4d2[_0x6807('0x18')](0x194);}return _0x3c1752;};}function handleError(_0x21f8fa,_0x26a077){_0x26a077=_0x26a077||0x1f4;return function(_0x226eaf){logger['error'](_0x226eaf[_0x6807('0x27')]);if(_0x226eaf[_0x6807('0x28')]){delete _0x226eaf['name'];}_0x21f8fa[_0x6807('0x19')](_0x26a077)['send'](_0x226eaf);};}exports['index']=function(_0xcd01df,_0x47819c){var _0x47f8a4={},_0x2aa21d={},_0x5084b5={'count':0x0,'rows':[]};var _0xe59eb6=_[_0x6807('0x29')](db[_0x6807('0x2a')]['rawAttributes'],function(_0x5cf0e6){return{'name':_0x5cf0e6[_0x6807('0x2b')],'type':_0x5cf0e6[_0x6807('0x2c')]['key']};});_0x2aa21d[_0x6807('0x2d')]=_[_0x6807('0x29')](_0xe59eb6,_0x6807('0x28'));_0x2aa21d[_0x6807('0x2e')]=_['keys'](_0xcd01df['query']);_0x2aa21d[_0x6807('0x2f')]=_['intersection'](_0x2aa21d['model'],_0x2aa21d[_0x6807('0x2e')]);_0x47f8a4[_0x6807('0x30')]=_[_0x6807('0x31')](_0x2aa21d[_0x6807('0x2d')],qs[_0x6807('0x32')](_0xcd01df[_0x6807('0x2e')][_0x6807('0x32')]));_0x47f8a4['attributes']=_0x47f8a4[_0x6807('0x30')][_0x6807('0x33')]?_0x47f8a4[_0x6807('0x30')]:_0x2aa21d[_0x6807('0x2d')];if(!_0xcd01df[_0x6807('0x2e')][_0x6807('0x34')](_0x6807('0x35'))){_0x47f8a4['limit']=qs[_0x6807('0x1e')](_0xcd01df[_0x6807('0x2e')][_0x6807('0x1e')]);_0x47f8a4['offset']=qs[_0x6807('0x1b')](_0xcd01df['query'][_0x6807('0x1b')]);}_0x47f8a4['order']=qs['sort'](_0xcd01df[_0x6807('0x2e')]['sort']);_0x47f8a4['where']=qs[_0x6807('0x2f')](_[_0x6807('0x36')](_0xcd01df['query'],_0x2aa21d[_0x6807('0x2f')]),_0xe59eb6);if(_0xcd01df[_0x6807('0x2e')]['filter']){_0x47f8a4[_0x6807('0x37')]=_[_0x6807('0x38')](_0x47f8a4[_0x6807('0x37')],{'$or':_[_0x6807('0x29')](_0xe59eb6,function(_0x469589){if(_0x469589['type']!==_0x6807('0x39')){var _0x5f288f={};_0x5f288f[_0x469589['name']]={'$like':'%'+_0xcd01df[_0x6807('0x2e')]['filter']+'%'};return _0x5f288f;}})});}_0x47f8a4=_['merge']({},_0x47f8a4,_0xcd01df['options']);var _0x5a392c={'where':_0x47f8a4[_0x6807('0x37')]};return db['VoiceTransferReport'][_0x6807('0x1d')](_0x5a392c)[_0x6807('0x26')](function(_0x515d39){_0x5084b5['count']=_0x515d39;if(_0xcd01df[_0x6807('0x2e')][_0x6807('0x3a')]){_0x47f8a4[_0x6807('0x3b')]=[{'all':!![]}];}return db[_0x6807('0x2a')][_0x6807('0x3c')](_0x47f8a4);})[_0x6807('0x26')](function(_0x10a075){_0x5084b5['rows']=_0x10a075;return _0x5084b5;})[_0x6807('0x26')](respondWithFilteredResult(_0x47819c,_0x47f8a4))['catch'](handleError(_0x47819c,null));};exports['show']=function(_0x6de883,_0x18429a){var _0x1b56c9={'raw':!![],'where':{'id':_0x6de883[_0x6807('0x3d')]['id']}},_0x25126d={};_0x25126d[_0x6807('0x2d')]=_[_0x6807('0x3e')](db[_0x6807('0x2a')]['rawAttributes']);_0x25126d['query']=_[_0x6807('0x3e')](_0x6de883[_0x6807('0x2e')]);_0x25126d[_0x6807('0x2f')]=_['intersection'](_0x25126d[_0x6807('0x2d')],_0x25126d[_0x6807('0x2e')]);_0x1b56c9[_0x6807('0x30')]=_[_0x6807('0x31')](_0x25126d['model'],qs[_0x6807('0x32')](_0x6de883[_0x6807('0x2e')][_0x6807('0x32')]));_0x1b56c9[_0x6807('0x30')]=_0x1b56c9[_0x6807('0x30')][_0x6807('0x33')]?_0x1b56c9[_0x6807('0x30')]:_0x25126d[_0x6807('0x2d')];if(_0x6de883['query'][_0x6807('0x3a')]){_0x1b56c9['include']=[{'all':!![]}];}_0x1b56c9=_['merge']({},_0x1b56c9,_0x6de883[_0x6807('0x3f')]);return db[_0x6807('0x2a')]['find'](_0x1b56c9)[_0x6807('0x26')](handleEntityNotFound(_0x18429a,null))[_0x6807('0x26')](respondWithResult(_0x18429a,null))[_0x6807('0x40')](handleError(_0x18429a,null));};exports[_0x6807('0x41')]=function(_0x161fbe,_0x1d3ca9){return db[_0x6807('0x2a')][_0x6807('0x41')](_0x161fbe[_0x6807('0x42')],{})[_0x6807('0x26')](respondWithResult(_0x1d3ca9,0xc9))[_0x6807('0x40')](handleError(_0x1d3ca9,null));};exports[_0x6807('0x24')]=function(_0x45cdca,_0x3da715){if(_0x45cdca[_0x6807('0x42')]['id']){delete _0x45cdca[_0x6807('0x42')]['id'];}return db['VoiceTransferReport'][_0x6807('0x43')]({'where':{'id':_0x45cdca[_0x6807('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3da715,null))[_0x6807('0x26')](saveUpdates(_0x45cdca[_0x6807('0x42')],null))[_0x6807('0x26')](respondWithResult(_0x3da715,null))['catch'](handleError(_0x3da715,null));};exports[_0x6807('0x25')]=function(_0x34426c,_0x596def){return db['VoiceTransferReport'][_0x6807('0x43')]({'where':{'id':_0x34426c[_0x6807('0x3d')]['id']}})[_0x6807('0x26')](handleEntityNotFound(_0x596def,null))['then'](removeEntity(_0x596def,null))[_0x6807('0x40')](handleError(_0x596def,null));};exports[_0x6807('0x44')]=function(_0x26e15b,_0x411fdb){return db[_0x6807('0x2a')][_0x6807('0x44')]()['then'](respondWithResult(_0x411fdb,null))[_0x6807('0x40')](handleError(_0x411fdb,null));}; \ No newline at end of file +var _0x7a29=['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','set','Content-Range','apply','save','then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x7a29,0xd1));var _0x97a2=function(_0x2fdbc8,_0x5c3bba){_0x2fdbc8=_0x2fdbc8-0x0;var _0x555411=_0x7a29[_0x2fdbc8];return _0x555411;};'use strict';var emlformat=require(_0x97a2('0x0'));var rimraf=require(_0x97a2('0x1'));var zipdir=require(_0x97a2('0x2'));var jsonpatch=require(_0x97a2('0x3'));var rp=require(_0x97a2('0x4'));var moment=require('moment');var BPromise=require(_0x97a2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x97a2('0x6'));var sox=require('sox');var csv=require(_0x97a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x97a2('0x9'));var deskjs=require(_0x97a2('0xa'));var toCsv=require(_0x97a2('0x7'));var querystring=require(_0x97a2('0xb'));var Papa=require(_0x97a2('0xc'));var Redis=require(_0x97a2('0xd'));var authService=require(_0x97a2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x97a2('0xf'));var hardwareService=require(_0x97a2('0x10'));var logger=require(_0x97a2('0x11'))(_0x97a2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x97a2('0x13'));var db=require(_0x97a2('0x14'))['db'];function respondWithStatusCode(_0x51d98a,_0x4364c5){_0x4364c5=_0x4364c5||0xcc;return function(_0x29e5f9){if(_0x29e5f9){return _0x51d98a[_0x97a2('0x15')](_0x4364c5);}return _0x51d98a[_0x97a2('0x16')](_0x4364c5)[_0x97a2('0x17')]();};}function respondWithResult(_0x515a11,_0x4497a2){_0x4497a2=_0x4497a2||0xc8;return function(_0x48fc0c){if(_0x48fc0c){return _0x515a11[_0x97a2('0x16')](_0x4497a2)[_0x97a2('0x18')](_0x48fc0c);}};}function respondWithFilteredResult(_0x543740,_0x234826){return function(_0x1a681b){if(_0x1a681b){var _0x4384f7=typeof _0x234826[_0x97a2('0x19')]===_0x97a2('0x1a')&&typeof _0x234826[_0x97a2('0x1b')]==='undefined';var _0x2c2684=_0x1a681b[_0x97a2('0x1c')];var _0x1162df=_0x4384f7?0x0:_0x234826['offset'];var _0x154af6=_0x4384f7?_0x1a681b[_0x97a2('0x1c')]:_0x234826[_0x97a2('0x19')]+_0x234826[_0x97a2('0x1b')];var _0x41a05d;if(_0x154af6>=_0x2c2684){_0x154af6=_0x2c2684;_0x41a05d=0xc8;}else{_0x41a05d=0xce;}_0x543740[_0x97a2('0x16')](_0x41a05d);return _0x543740[_0x97a2('0x1d')](_0x97a2('0x1e'),_0x1162df+'-'+_0x154af6+'/'+_0x2c2684)[_0x97a2('0x18')](_0x1a681b);}return null;};}function patchUpdates(_0x590d3f){return function(_0x4dd180){try{jsonpatch[_0x97a2('0x1f')](_0x4dd180,_0x590d3f,!![]);}catch(_0x444404){return BPromise['reject'](_0x444404);}return _0x4dd180[_0x97a2('0x20')]();};}function saveUpdates(_0x5df103,_0x410a28){return function(_0x552016){if(_0x552016){return _0x552016['update'](_0x5df103)[_0x97a2('0x21')](function(_0x4a2156){return _0x4a2156;});}return null;};}function removeEntity(_0x283f05,_0x3e68f1){return function(_0x401b6f){if(_0x401b6f){return _0x401b6f[_0x97a2('0x22')]()[_0x97a2('0x21')](function(){_0x283f05['status'](0xcc)[_0x97a2('0x17')]();});}};}function handleEntityNotFound(_0x18c46f,_0x364815){return function(_0x332251){if(!_0x332251){_0x18c46f[_0x97a2('0x15')](0x194);}return _0x332251;};}function handleError(_0x451c1b,_0x5cad84){_0x5cad84=_0x5cad84||0x1f4;return function(_0x29f822){logger['error'](_0x29f822[_0x97a2('0x23')]);if(_0x29f822[_0x97a2('0x24')]){delete _0x29f822['name'];}_0x451c1b[_0x97a2('0x16')](_0x5cad84)[_0x97a2('0x25')](_0x29f822);};}exports[_0x97a2('0x26')]=function(_0x5d57d9,_0x1298f0){var _0xd793f6={},_0x678267={},_0x2203fe={'count':0x0,'rows':[]};var _0x2ea26b=_[_0x97a2('0x27')](db[_0x97a2('0x28')][_0x97a2('0x29')],function(_0x3ba616){return{'name':_0x3ba616[_0x97a2('0x2a')],'type':_0x3ba616[_0x97a2('0x2b')][_0x97a2('0x2c')]};});_0x678267[_0x97a2('0x2d')]=_[_0x97a2('0x27')](_0x2ea26b,_0x97a2('0x24'));_0x678267[_0x97a2('0x2e')]=_[_0x97a2('0x2f')](_0x5d57d9[_0x97a2('0x2e')]);_0x678267[_0x97a2('0x30')]=_[_0x97a2('0x31')](_0x678267['model'],_0x678267[_0x97a2('0x2e')]);_0xd793f6['attributes']=_['intersection'](_0x678267[_0x97a2('0x2d')],qs['fields'](_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x32')]));_0xd793f6[_0x97a2('0x33')]=_0xd793f6[_0x97a2('0x33')][_0x97a2('0x34')]?_0xd793f6[_0x97a2('0x33')]:_0x678267[_0x97a2('0x2d')];if(!_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x35')](_0x97a2('0x36'))){_0xd793f6[_0x97a2('0x1b')]=qs[_0x97a2('0x1b')](_0x5d57d9['query'][_0x97a2('0x1b')]);_0xd793f6['offset']=qs[_0x97a2('0x19')](_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x19')]);}_0xd793f6[_0x97a2('0x37')]=qs[_0x97a2('0x38')](_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x38')]);_0xd793f6['where']=qs[_0x97a2('0x30')](_[_0x97a2('0x39')](_0x5d57d9[_0x97a2('0x2e')],_0x678267[_0x97a2('0x30')]),_0x2ea26b);if(_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x3a')]){_0xd793f6['where']=_[_0x97a2('0x3b')](_0xd793f6[_0x97a2('0x3c')],{'$or':_['map'](_0x2ea26b,function(_0x24aba0){if(_0x24aba0[_0x97a2('0x2b')]!==_0x97a2('0x3d')){var _0x2212c2={};_0x2212c2[_0x24aba0[_0x97a2('0x24')]]={'$like':'%'+_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x3a')]+'%'};return _0x2212c2;}})});}_0xd793f6=_[_0x97a2('0x3b')]({},_0xd793f6,_0x5d57d9['options']);var _0x1c3172={'where':_0xd793f6['where']};return db['VoiceTransferReport']['count'](_0x1c3172)[_0x97a2('0x21')](function(_0x245cf2){_0x2203fe[_0x97a2('0x1c')]=_0x245cf2;if(_0x5d57d9[_0x97a2('0x2e')][_0x97a2('0x3e')]){_0xd793f6[_0x97a2('0x3f')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0xd793f6);})['then'](function(_0x2ba852){_0x2203fe[_0x97a2('0x40')]=_0x2ba852;return _0x2203fe;})[_0x97a2('0x21')](respondWithFilteredResult(_0x1298f0,_0xd793f6))[_0x97a2('0x41')](handleError(_0x1298f0,null));};exports[_0x97a2('0x42')]=function(_0x520550,_0x2d150c){var _0x5e9dbb={'raw':!![],'where':{'id':_0x520550['params']['id']}},_0x51d0b2={};_0x51d0b2[_0x97a2('0x2d')]=_[_0x97a2('0x2f')](db[_0x97a2('0x28')][_0x97a2('0x29')]);_0x51d0b2[_0x97a2('0x2e')]=_['keys'](_0x520550[_0x97a2('0x2e')]);_0x51d0b2[_0x97a2('0x30')]=_[_0x97a2('0x31')](_0x51d0b2['model'],_0x51d0b2[_0x97a2('0x2e')]);_0x5e9dbb[_0x97a2('0x33')]=_[_0x97a2('0x31')](_0x51d0b2['model'],qs[_0x97a2('0x32')](_0x520550[_0x97a2('0x2e')][_0x97a2('0x32')]));_0x5e9dbb[_0x97a2('0x33')]=_0x5e9dbb[_0x97a2('0x33')][_0x97a2('0x34')]?_0x5e9dbb[_0x97a2('0x33')]:_0x51d0b2[_0x97a2('0x2d')];if(_0x520550['query'][_0x97a2('0x3e')]){_0x5e9dbb[_0x97a2('0x3f')]=[{'all':!![]}];}_0x5e9dbb=_['merge']({},_0x5e9dbb,_0x520550[_0x97a2('0x43')]);return db[_0x97a2('0x28')][_0x97a2('0x44')](_0x5e9dbb)['then'](handleEntityNotFound(_0x2d150c,null))[_0x97a2('0x21')](respondWithResult(_0x2d150c,null))[_0x97a2('0x41')](handleError(_0x2d150c,null));};exports[_0x97a2('0x45')]=function(_0x5b2553,_0xce76ed){return db[_0x97a2('0x28')][_0x97a2('0x45')](_0x5b2553[_0x97a2('0x46')],{})[_0x97a2('0x21')](respondWithResult(_0xce76ed,0xc9))['catch'](handleError(_0xce76ed,null));};exports[_0x97a2('0x47')]=function(_0x5e5322,_0x142a7e){if(_0x5e5322['body']['id']){delete _0x5e5322[_0x97a2('0x46')]['id'];}return db[_0x97a2('0x28')]['find']({'where':{'id':_0x5e5322[_0x97a2('0x48')]['id']}})[_0x97a2('0x21')](handleEntityNotFound(_0x142a7e,null))[_0x97a2('0x21')](saveUpdates(_0x5e5322[_0x97a2('0x46')],null))[_0x97a2('0x21')](respondWithResult(_0x142a7e,null))[_0x97a2('0x41')](handleError(_0x142a7e,null));};exports[_0x97a2('0x22')]=function(_0x32b855,_0x5a5779){return db[_0x97a2('0x28')][_0x97a2('0x44')]({'where':{'id':_0x32b855[_0x97a2('0x48')]['id']}})[_0x97a2('0x21')](handleEntityNotFound(_0x5a5779,null))[_0x97a2('0x21')](removeEntity(_0x5a5779,null))[_0x97a2('0x41')](handleError(_0x5a5779,null));};exports[_0x97a2('0x49')]=function(_0x1b4359,_0x4c52aa){return db[_0x97a2('0x28')][_0x97a2('0x49')]()[_0x97a2('0x21')](respondWithResult(_0x4c52aa,null))[_0x97a2('0x41')](handleError(_0x4c52aa,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 44af278..fd8d8f5 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 _0xa1c3=['bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0xa1c3,0xac));var _0x3a1c=function(_0x4aeed0,_0x4b6534){_0x4aeed0=_0x4aeed0-0x0;var _0x5a27f4=_0xa1c3[_0x4aeed0];return _0x5a27f4;};'use strict';var _=require('lodash');var util=require(_0x3a1c('0x0'));var logger=require(_0x3a1c('0x1'))(_0x3a1c('0x2'));var moment=require(_0x3a1c('0x3'));var BPromise=require(_0x3a1c('0x4'));var rp=require(_0x3a1c('0x5'));var fs=require('fs');var path=require(_0x3a1c('0x6'));var rimraf=require('rimraf');var config=require(_0x3a1c('0x7'));var attributes=require(_0x3a1c('0x8'));module['exports']=function(_0x4662c5,_0x42b8d8){return _0x4662c5['define'](_0x3a1c('0x9'),attributes,{'tableName':_0x3a1c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb81=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xcb81,0x74));var _0x1cb8=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0xcb81[_0x5c1345];return _0x1c070d;};'use strict';var _=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var logger=require(_0x1cb8('0x2'))('api');var moment=require(_0x1cb8('0x3'));var BPromise=require(_0x1cb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb8('0x5'));var rimraf=require(_0x1cb8('0x6'));var config=require(_0x1cb8('0x7'));var attributes=require(_0x1cb8('0x8'));module[_0x1cb8('0x9')]=function(_0x4dd4d8,_0x1eddc0){return _0x4dd4d8[_0x1cb8('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 4b3c859..a32e460 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 _0x1e30=['VoiceTransferReport','create','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1e30,0x1c5));var _0x01e3=function(_0x1ed99c,_0x52bb43){_0x1ed99c=_0x1ed99c-0x0;var _0x19c308=_0x1e30[_0x1ed99c];return _0x19c308;};'use strict';var _=require(_0x01e3('0x0'));var util=require(_0x01e3('0x1'));var moment=require('moment');var BPromise=require(_0x01e3('0x2'));var rs=require(_0x01e3('0x3'));var fs=require('fs');var Redis=require(_0x01e3('0x4'));var db=require(_0x01e3('0x5'))['db'];var utils=require(_0x01e3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x01e3('0x7'));var jayson=require(_0x01e3('0x8'));var client=jayson[_0x01e3('0x9')][_0x01e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdcabe6,_0x907beb,_0x1e7e7e){return new BPromise(function(_0x472e15,_0x35f41b){return client['request'](_0xdcabe6,_0x1e7e7e)[_0x01e3('0xb')](function(_0x5db614){logger['info'](_0x01e3('0xc'),_0x907beb,_0x01e3('0xd'));logger['debug'](_0x01e3('0xe'),_0x907beb,_0x01e3('0xd'),JSON[_0x01e3('0xf')](_0x5db614));if(_0x5db614['error']){if(_0x5db614[_0x01e3('0x10')][_0x01e3('0x11')]===0x1f4){logger['error'](_0x01e3('0xc'),_0x907beb,_0x5db614['error']['message']);return _0x35f41b(_0x5db614[_0x01e3('0x10')][_0x01e3('0x12')]);}logger[_0x01e3('0x10')](_0x01e3('0xc'),_0x907beb,_0x5db614[_0x01e3('0x10')]['message']);return _0x472e15(_0x5db614['error'][_0x01e3('0x12')]);}else{logger[_0x01e3('0x13')](_0x01e3('0xc'),_0x907beb,_0x01e3('0xd'));_0x472e15(_0x5db614[_0x01e3('0x14')][_0x01e3('0x12')]);}})[_0x01e3('0x15')](function(_0x1054e3){logger[_0x01e3('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x907beb,_0x1054e3);_0x35f41b(_0x1054e3);});});}exports[_0x01e3('0x16')]=function(_0x255dcd){var _0x5ab20f=this;return new Promise(function(_0x18bbee,_0x4b4ebe){return db[_0x01e3('0x17')][_0x01e3('0x18')](_0x255dcd['body'],{'raw':_0x255dcd[_0x01e3('0x19')]?_0x255dcd['options'][_0x01e3('0x1a')]===undefined?!![]:![]:!![]})[_0x01e3('0xb')](function(_0x1a104e){logger['info'](_0x01e3('0x16'),_0x255dcd);logger[_0x01e3('0x1b')](_0x01e3('0x16'),_0x255dcd,JSON[_0x01e3('0xf')](_0x1a104e));_0x18bbee(_0x1a104e);})[_0x01e3('0x15')](function(_0x3f0d39){logger[_0x01e3('0x10')](_0x01e3('0x16'),_0x3f0d39[_0x01e3('0x12')],_0x255dcd);_0x4b4ebe(_0x5ab20f[_0x01e3('0x10')](0x1f4,_0x3f0d39[_0x01e3('0x12')]));});});}; \ No newline at end of file +var _0x624b=['VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','VoiceTransferReport','options','raw','CreateVoiceTransferReport','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0x624b,0x1cb));var _0xb624=function(_0x41196d,_0x4a178e){_0x41196d=_0x41196d-0x0;var _0x270b0b=_0x624b[_0x41196d];return _0x270b0b;};'use strict';var _=require(_0xb624('0x0'));var util=require(_0xb624('0x1'));var moment=require(_0xb624('0x2'));var BPromise=require('bluebird');var rs=require(_0xb624('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb624('0x4'));var logger=require(_0xb624('0x5'))('rpc');var config=require(_0xb624('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb624('0x7')][_0xb624('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x320949,_0x1f0451,_0x41dec3){return new BPromise(function(_0x340412,_0x4d5ffb){return client[_0xb624('0x9')](_0x320949,_0x41dec3)[_0xb624('0xa')](function(_0x4c099d){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1f0451,'request\x20sent');logger[_0xb624('0xb')](_0xb624('0xc'),_0x1f0451,'request\x20sent',JSON[_0xb624('0xd')](_0x4c099d));if(_0x4c099d[_0xb624('0xe')]){if(_0x4c099d['error'][_0xb624('0xf')]===0x1f4){logger[_0xb624('0xe')](_0xb624('0x10'),_0x1f0451,_0x4c099d['error']['message']);return _0x4d5ffb(_0x4c099d[_0xb624('0xe')]['message']);}logger[_0xb624('0xe')](_0xb624('0x10'),_0x1f0451,_0x4c099d[_0xb624('0xe')]['message']);return _0x340412(_0x4c099d[_0xb624('0xe')][_0xb624('0x11')]);}else{logger[_0xb624('0x12')](_0xb624('0x10'),_0x1f0451,'request\x20sent');_0x340412(_0x4c099d[_0xb624('0x13')]['message']);}})[_0xb624('0x14')](function(_0xa6f7f1){logger[_0xb624('0xe')](_0xb624('0x10'),_0x1f0451,_0xa6f7f1);_0x4d5ffb(_0xa6f7f1);});});}exports['CreateVoiceTransferReport']=function(_0x49a604){var _0x50276b=this;return new Promise(function(_0x3af9b6,_0x36991d){return db[_0xb624('0x15')]['create'](_0x49a604['body'],{'raw':_0x49a604[_0xb624('0x16')]?_0x49a604[_0xb624('0x16')][_0xb624('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2b3c71){logger['info']('CreateVoiceTransferReport',_0x49a604);logger[_0xb624('0xb')]('CreateVoiceTransferReport',_0x49a604,JSON[_0xb624('0xd')](_0x2b3c71));_0x3af9b6(_0x2b3c71);})[_0xb624('0x14')](function(_0x53939e){logger['error'](_0xb624('0x18'),_0x53939e[_0xb624('0x11')],_0x49a604);_0x36991d(_0x50276b[_0xb624('0xe')](0x1f4,_0x53939e[_0xb624('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 4f1d9f1..96a558e 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 _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x5385f5,_0x554c1b){var _0x1eac01=function(_0x422b4c){while(--_0x422b4c){_0x5385f5['push'](_0x5385f5['shift']());}};_0x1eac01(++_0x554c1b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3a556e,_0x32191b){_0x3a556e=_0x3a556e-0x0;var _0xfe3a36=_0xe5b3[_0x3a556e];return _0xfe3a36;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0x3eceb9,_0x1040d2){var _0x41b857=function(_0x1239ec){while(--_0x1239ec){_0x3eceb9['push'](_0x3eceb9['shift']());}};_0x41b857(++_0x1040d2);}(_0x0bb5,0x148));var _0x50bb=function(_0xb95e52,_0x57f0fe){_0xb95e52=_0xb95e52-0x0;var _0x533c2a=_0x0bb5[_0xb95e52];return _0x533c2a;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 41c1b6c..7207b38 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 _0x6737=['answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','catch','User','VoiceChannels','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','webbar:hangup','answer\x20fired:','webbar:answer'];(function(_0x22a9c2,_0x2247d9){var _0x4dc0c9=function(_0x1f2520){while(--_0x1f2520){_0x22a9c2['push'](_0x22a9c2['shift']());}};_0x4dc0c9(++_0x2247d9);}(_0x6737,0xe2));var _0x7673=function(_0x2f9f13,_0x3b2e94){_0x2f9f13=_0x2f9f13-0x0;var _0x1fbeae=_0x6737[_0x2f9f13];return _0x1fbeae;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x7673('0x0'));var db=require(_0x7673('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var jayson=require(_0x7673('0x4'));var amiClient=jayson[_0x7673('0x5')]['http']({'port':0x232a});var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var Redis=require('ioredis');config[_0x7673('0x8')]=_[_0x7673('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x7673('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'callNumber':{'type':_0x7673('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x7673('0xc')},'callbackUrl':{'type':_0x7673('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xe')]},'transferNumber':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});function emit(_0x2a2840,_0x4a8ea0,_0x5ed354){logger[_0x7673('0x10')](_0x2a2840,_0x4a8ea0,JSON[_0x7673('0x11')](_0x5ed354));io['to'](_0x2a2840)['emit'](_0x4a8ea0,_0x5ed354);}function handleError(_0x3afbb3){return function(_0x17699a){console['log'](_0x7673('0x12'),_0x17699a,_0x17699a instanceof RangeError);logger[_0x7673('0x13')](_0x17699a[_0x7673('0x14')]);if(_0x17699a instanceof RangeError){if(_0x17699a['name']){delete _0x17699a['name'];}_0x3afbb3[_0x7673('0x15')](0x194)[_0x7673('0x16')](_0x17699a);}else{if(_0x17699a['name']){delete _0x17699a[_0x7673('0x17')];}_0x3afbb3[_0x7673('0x15')](0x1f4)[_0x7673('0x16')](_0x17699a);}};}function checkError(){return function(_0x33eb47){if(!_0x33eb47){throw new RangeError(_0x7673('0x18'));}return _0x33eb47;};}function respondWithRpcPromise(_0x3e28ca,_0x59879a){return new BPromise(function(_0x557161,_0xea9b37){var _0x21774f=amiClient;return _0x21774f[_0x7673('0x19')](_0x3e28ca,_0x59879a)[_0x7673('0x1a')](function(_0x16bb16){if(_0x16bb16['error']){if(_0x16bb16[_0x7673('0x13')][_0x7673('0x1b')]===0x1f4){return _0xea9b37(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}return _0x557161(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}else{_0x557161(_0x16bb16['result']);}})[_0x7673('0x1d')](function(_0xaca974){_0xea9b37(_0xaca974);});});}function getAgent(_0x425897){return db[_0x7673('0x1e')]['findOne']({'where':{'id':_0x425897,'role':'agent'}})[_0x7673('0x1a')](checkError());}function getAgentCheckSession(_0x11b42b,_0x291d10){return new BPromise(function(_0x9d9eab,_0x119a21){var _0x45a045=respondWithRpcPromise(_0x7673('0x1f'));var _0x5a59f9=getAgent(_0x11b42b);Promise['all']([_0x45a045,_0x5a59f9])[_0x7673('0x1a')](function(_0x2d4c0a){var _0x1dd436=_0x2d4c0a[0x0];var _0x335743=_0x2d4c0a[0x1];var _0x12ac6b=_[_0x7673('0x20')](_0x1dd436[_0x7673('0x21')],function(_0x4f12b9){return _0x4f12b9['UserId']==_0x335743['id']&&_0x4f12b9[_0x7673('0x22')]==_0x291d10;});if(_0x12ac6b[_0x7673('0x23')]==0x1){_0x9d9eab(_0x335743);}else{_0x119a21(new RangeError(_0x7673('0x24')+_0x291d10+_0x7673('0x25')));}});});}exports['originate']=function(_0x3aa249,_0x497760){logger[_0x7673('0x10')](_0x7673('0x26'),_0x3aa249[_0x7673('0x27')]);var _0x1b924f=originateValidation[_0x7673('0xa')](_0x3aa249[_0x7673('0x27')]);if(_0x1b924f[_0x7673('0x23')]>0x0){return _0x497760[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1b924f);}var _0x1b6061=_0x3aa249[_0x7673('0x27')][_0x7673('0x29')];var _0x26cccd=_0x3aa249['body'][_0x7673('0x2a')];var _0x42f658=_0x3aa249[_0x7673('0x27')][_0x7673('0x2b')];var _0x30ddec=_0x3aa249[_0x7673('0x27')][_0x7673('0x2c')];return getAgent(_0x1b6061)['then'](function(_0x563e2d){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x563e2d[_0x7673('0x17')]);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x563e2d[_0x7673('0x17')]),_0x7673('0x30'),{'callNumber':_0x26cccd,'callerId':_0x42f658,'callbackUrl':_0x30ddec});return _0x497760['status'](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x31')});})['catch'](handleError(_0x497760));};exports[_0x7673('0x32')]=function(_0x400f3c,_0x287eee){logger[_0x7673('0x10')]('hangup\x20fired:',_0x400f3c[_0x7673('0x27')]);var _0x1f77c0=hangupValidation['validate'](_0x400f3c[_0x7673('0x27')]);if(_0x1f77c0[_0x7673('0x23')]>0x0){return _0x287eee[_0x7673('0x15')](0x190)['json'](_0x1f77c0);}var _0xe50aa5=_0x400f3c[_0x7673('0x27')][_0x7673('0x29')];var _0x5dfb9a=_0x400f3c['body'][_0x7673('0x22')];return getAgent(_0xe50aa5)['then'](function(_0x4ba2b4){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4ba2b4['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4ba2b4[_0x7673('0x17')]),_0x7673('0x33'),{'sessionId':_0x5dfb9a});return _0x287eee[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x7673('0x1d')](handleError(_0x287eee));};exports['answer']=function(_0xf43bb7,_0x52f803){logger[_0x7673('0x10')](_0x7673('0x34'),_0xf43bb7['body']);var _0x5b2e69=answerValidation[_0x7673('0xa')](_0xf43bb7['body']);if(_0x5b2e69[_0x7673('0x23')]>0x0){return _0x52f803[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x5b2e69);}var _0x3b6223=_0xf43bb7[_0x7673('0x27')]['userId'];var _0x4ea8b3=_0xf43bb7[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x3b6223)['then'](function(_0x4005ee){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4005ee['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4005ee[_0x7673('0x17')]),_0x7673('0x35'),{'sessionId':_0x4ea8b3});return _0x52f803[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x36')});})[_0x7673('0x1d')](handleError(_0x52f803));};exports[_0x7673('0x37')]=function(_0x4ed31d,_0x126981){logger[_0x7673('0x10')](_0x7673('0x38'),_0x4ed31d[_0x7673('0x27')]);var _0x332b5a=holdValidation[_0x7673('0xa')](_0x4ed31d[_0x7673('0x27')]);if(_0x332b5a['length']>0x0){return _0x126981[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x332b5a);}var _0x461ac3=_0x4ed31d[_0x7673('0x27')][_0x7673('0x29')];var _0x4b844d=_0x4ed31d[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x461ac3)[_0x7673('0x1a')](function(_0x2397fb){logger[_0x7673('0x10')]('entityFound:',_0x2397fb['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x2397fb['name']),_0x7673('0x39'),{'sessionId':_0x4b844d});return _0x126981[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3a')});})[_0x7673('0x1d')](handleError(_0x126981));};exports['unhold']=function(_0x23789d,_0x3afffa){logger[_0x7673('0x10')](_0x7673('0x3b'),_0x23789d['body']);var _0x1691a5=unholdValidation[_0x7673('0xa')](_0x23789d[_0x7673('0x27')]);if(_0x1691a5[_0x7673('0x23')]>0x0){return _0x3afffa[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1691a5);}var _0x115eef=_0x23789d[_0x7673('0x27')][_0x7673('0x29')];var _0x362409=_0x23789d[_0x7673('0x27')]['sessionId'];return getAgent(_0x115eef)[_0x7673('0x1a')](function(_0x4a0d99){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4a0d99[_0x7673('0x17')]);emit(util['format'](_0x7673('0x2f'),_0x4a0d99[_0x7673('0x17')]),_0x7673('0x3c'),{'sessionId':_0x362409});return _0x3afffa[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3d')});})[_0x7673('0x1d')](handleError(_0x3afffa));};exports[_0x7673('0x3e')]=function(_0x375bca,_0x1064d5){logger[_0x7673('0x10')](_0x7673('0x3f'),_0x1064d5[_0x7673('0x27')]);var _0xb3c9e9=callsValidation['validate'](_0x375bca[_0x7673('0x27')]);if(_0xb3c9e9['length']>0x0){return _0x1064d5[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xb3c9e9);}var _0x1d424a=_0x375bca['body'][_0x7673('0x29')];var _0x5d71b7=respondWithRpcPromise('VoiceChannels');var _0x1804a4=getAgent(_0x1d424a);return Promise['all']([_0x5d71b7,_0x1804a4])['then'](function(_0x1dd141){var _0x3f6ef3=_0x1dd141[0x0];var _0x215a32=_0x1dd141[0x1];var _0xeaa731=_[_0x7673('0x20')](_0x3f6ef3[_0x7673('0x21')],function(_0x151276){return _0x151276[_0x7673('0x40')]==_0x215a32['id'];});return _0x1064d5[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'count':_0xeaa731[_0x7673('0x23')],'rows':_0xeaa731});})['catch'](handleError(_0x1064d5));};exports['conference']=function(_0x2aa032,_0x297744){logger[_0x7673('0x10')](_0x7673('0x41'),_0x2aa032[_0x7673('0x27')]);var _0x48e51c=conferenceValidation['validate'](_0x2aa032[_0x7673('0x27')]);if(_0x48e51c[_0x7673('0x23')]>0x0){return _0x297744[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x48e51c);}var _0x51c617=_0x2aa032['body'][_0x7673('0x29')];return getAgent(_0x51c617)[_0x7673('0x1a')](function(_0x1cf039){logger['info'](_0x7673('0x2d'),_0x1cf039['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x1cf039[_0x7673('0x17')]),'webbar:conference');return _0x297744[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x297744));};exports['transfer']=function(_0x32dcfc,_0x2dd367){logger[_0x7673('0x10')](_0x7673('0x42'),_0x32dcfc['body']);var _0xed9040=transferValidation['validate'](_0x32dcfc[_0x7673('0x27')]);if(_0xed9040[_0x7673('0x23')]>0x0){return _0x2dd367[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xed9040);}var _0x5abb12=_0x32dcfc[_0x7673('0x27')][_0x7673('0x29')];var _0x308a9e=_0x32dcfc['body']['sessionId'];var _0x2d21f2=_0x32dcfc[_0x7673('0x27')][_0x7673('0x43')];return getAgent(_0x5abb12)[_0x7673('0x1a')](function(_0x20e9bd){logger['info'](_0x7673('0x2d'),_0x20e9bd[_0x7673('0x17')]);emit(util['format']('user:%s',_0x20e9bd['name']),_0x7673('0x44'),{'sessionId':_0x308a9e,'transferNumber':_0x2d21f2});return _0x2dd367[_0x7673('0x15')](0xc8)['json']({'error':![],'message':_0x7673('0x45')});})['catch'](handleError(_0x2dd367));}; \ No newline at end of file +var _0x54ef=['callerId','format','user:%s','webbar:originate','originate\x20executed!','hangup','validate','userId','entityFound:','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','defaults','redis','localhost','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callNumber'];(function(_0x51d830,_0xe80672){var _0x54c940=function(_0x2a032f){while(--_0x2a032f){_0x51d830['push'](_0x51d830['shift']());}};_0x54c940(++_0xe80672);}(_0x54ef,0x112));var _0xf54e=function(_0x5481a9,_0x44ae92){_0x5481a9=_0x5481a9-0x0;var _0x448f68=_0x54ef[_0x5481a9];return _0x448f68;};'use strict';var path=require(_0xf54e('0x0'));var fs=require('fs');var _=require(_0xf54e('0x1'));var db=require(_0xf54e('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var jayson=require(_0xf54e('0x5'));var amiClient=jayson[_0xf54e('0x6')][_0xf54e('0x7')]({'port':0x232a});var logger=require(_0xf54e('0x8'))(_0xf54e('0x9'));var Redis=require('ioredis');config['redis']=_[_0xf54e('0xa')](config[_0xf54e('0xb')],{'host':_0xf54e('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],_0xf54e('0xe')]},'callNumber':{'type':'string','required':[!![],_0xf54e('0xf')]},'callerId':{'type':_0xf54e('0x10')},'callbackUrl':{'type':_0xf54e('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf54e('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],_0xf54e('0xe')]},'sessionId':{'type':_0xf54e('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf54e('0xe')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xf54e('0x10'),'required':[!![],_0xf54e('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],_0xf54e('0xe')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],_0xf54e('0xe')]},'sessionId':{'type':_0xf54e('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xf54e('0xd'),'required':[!![],_0xf54e('0xe')]}});function emit(_0x3eb415,_0x5c5d00,_0x4af633){logger[_0xf54e('0x12')](_0x3eb415,_0x5c5d00,JSON[_0xf54e('0x13')](_0x4af633));io['to'](_0x3eb415)[_0xf54e('0x14')](_0x5c5d00,_0x4af633);}function handleError(_0x9647f){return function(_0x15cc48){console[_0xf54e('0x15')](_0xf54e('0x16'),_0x15cc48,_0x15cc48 instanceof RangeError);logger[_0xf54e('0x17')](_0x15cc48[_0xf54e('0x18')]);if(_0x15cc48 instanceof RangeError){if(_0x15cc48[_0xf54e('0x19')]){delete _0x15cc48[_0xf54e('0x19')];}_0x9647f['status'](0x194)['send'](_0x15cc48);}else{if(_0x15cc48[_0xf54e('0x19')]){delete _0x15cc48['name'];}_0x9647f[_0xf54e('0x1a')](0x1f4)[_0xf54e('0x1b')](_0x15cc48);}};}function checkError(){return function(_0x106362){if(!_0x106362){throw new RangeError(_0xf54e('0x1c'));}return _0x106362;};}function respondWithRpcPromise(_0xf64f12,_0x3887b0){return new BPromise(function(_0x388aa0,_0x11985e){var _0x3c0169=amiClient;return _0x3c0169[_0xf54e('0x1d')](_0xf64f12,_0x3887b0)[_0xf54e('0x1e')](function(_0x5b83df){if(_0x5b83df[_0xf54e('0x17')]){if(_0x5b83df['error'][_0xf54e('0x1f')]===0x1f4){return _0x11985e(_0x5b83df[_0xf54e('0x17')][_0xf54e('0x20')]);}return _0x388aa0(_0x5b83df[_0xf54e('0x17')][_0xf54e('0x20')]);}else{_0x388aa0(_0x5b83df[_0xf54e('0x21')]);}})[_0xf54e('0x22')](function(_0x43488d){_0x11985e(_0x43488d);});});}function getAgent(_0x2342a9){return db[_0xf54e('0x23')][_0xf54e('0x24')]({'where':{'id':_0x2342a9,'role':_0xf54e('0x25')}})[_0xf54e('0x1e')](checkError());}function getAgentCheckSession(_0x5390b8,_0xb3706e){return new BPromise(function(_0x4cbf7c,_0x282c63){var _0x5e63f4=respondWithRpcPromise(_0xf54e('0x26'));var _0x269f47=getAgent(_0x5390b8);Promise[_0xf54e('0x27')]([_0x5e63f4,_0x269f47])[_0xf54e('0x1e')](function(_0x25b643){var _0x3993e4=_0x25b643[0x0];var _0x36f985=_0x25b643[0x1];var _0x54bd8f=_['filter'](_0x3993e4[_0xf54e('0x28')],function(_0x258d29){return _0x258d29[_0xf54e('0x29')]==_0x36f985['id']&&_0x258d29[_0xf54e('0x2a')]==_0xb3706e;});if(_0x54bd8f[_0xf54e('0x2b')]==0x1){_0x4cbf7c(_0x36f985);}else{_0x282c63(new RangeError(_0xf54e('0x2c')+_0xb3706e+_0xf54e('0x2d')));}});});}exports[_0xf54e('0x2e')]=function(_0x3ae704,_0x12edc3){logger['info']('originate\x20fired:',_0x3ae704[_0xf54e('0x2f')]);var _0x3169dd=originateValidation['validate'](_0x3ae704[_0xf54e('0x2f')]);if(_0x3169dd[_0xf54e('0x2b')]>0x0){return _0x12edc3[_0xf54e('0x1a')](0x190)[_0xf54e('0x30')](_0x3169dd);}var _0x576b46=_0x3ae704['body']['userId'];var _0x3c0cca=_0x3ae704[_0xf54e('0x2f')][_0xf54e('0x31')];var _0x399e68=_0x3ae704[_0xf54e('0x2f')][_0xf54e('0x32')];var _0x49ba1c=_0x3ae704['body']['callbackUrl'];return getAgent(_0x576b46)[_0xf54e('0x1e')](function(_0x734187){logger['info']('entityFound:',_0x734187[_0xf54e('0x19')]);emit(util[_0xf54e('0x33')](_0xf54e('0x34'),_0x734187['name']),_0xf54e('0x35'),{'callNumber':_0x3c0cca,'callerId':_0x399e68,'callbackUrl':_0x49ba1c});return _0x12edc3[_0xf54e('0x1a')](0xc8)['json']({'error':![],'message':_0xf54e('0x36')});})[_0xf54e('0x22')](handleError(_0x12edc3));};exports[_0xf54e('0x37')]=function(_0x1eeeb4,_0x12ef97){logger[_0xf54e('0x12')]('hangup\x20fired:',_0x1eeeb4['body']);var _0x3d5a68=hangupValidation[_0xf54e('0x38')](_0x1eeeb4[_0xf54e('0x2f')]);if(_0x3d5a68['length']>0x0){return _0x12ef97[_0xf54e('0x1a')](0x190)[_0xf54e('0x30')](_0x3d5a68);}var _0x448054=_0x1eeeb4[_0xf54e('0x2f')][_0xf54e('0x39')];var _0x23f297=_0x1eeeb4[_0xf54e('0x2f')][_0xf54e('0x2a')];return getAgent(_0x448054)[_0xf54e('0x1e')](function(_0x2087b3){logger[_0xf54e('0x12')](_0xf54e('0x3a'),_0x2087b3[_0xf54e('0x19')]);emit(util[_0xf54e('0x33')](_0xf54e('0x34'),_0x2087b3['name']),'webbar:hangup',{'sessionId':_0x23f297});return _0x12ef97['status'](0xc8)[_0xf54e('0x30')]({'error':![],'message':_0xf54e('0x3b')});})['catch'](handleError(_0x12ef97));};exports[_0xf54e('0x3c')]=function(_0x311ce1,_0x381c03){logger['info'](_0xf54e('0x3d'),_0x311ce1[_0xf54e('0x2f')]);var _0x1e016e=answerValidation[_0xf54e('0x38')](_0x311ce1[_0xf54e('0x2f')]);if(_0x1e016e[_0xf54e('0x2b')]>0x0){return _0x381c03[_0xf54e('0x1a')](0x190)[_0xf54e('0x30')](_0x1e016e);}var _0x5b4ea1=_0x311ce1['body'][_0xf54e('0x39')];var _0x3447fd=_0x311ce1[_0xf54e('0x2f')][_0xf54e('0x2a')];return getAgent(_0x5b4ea1)[_0xf54e('0x1e')](function(_0x2fce4f){logger['info'](_0xf54e('0x3a'),_0x2fce4f['name']);emit(util[_0xf54e('0x33')]('user:%s',_0x2fce4f[_0xf54e('0x19')]),_0xf54e('0x3e'),{'sessionId':_0x3447fd});return _0x381c03[_0xf54e('0x1a')](0xc8)['json']({'error':![],'message':_0xf54e('0x3f')});})[_0xf54e('0x22')](handleError(_0x381c03));};exports[_0xf54e('0x40')]=function(_0x32fb46,_0x3a5a87){logger['info'](_0xf54e('0x41'),_0x32fb46[_0xf54e('0x2f')]);var _0x346bb4=holdValidation[_0xf54e('0x38')](_0x32fb46['body']);if(_0x346bb4[_0xf54e('0x2b')]>0x0){return _0x3a5a87[_0xf54e('0x1a')](0x190)['json'](_0x346bb4);}var _0x22c842=_0x32fb46[_0xf54e('0x2f')][_0xf54e('0x39')];var _0xca0141=_0x32fb46['body'][_0xf54e('0x2a')];return getAgent(_0x22c842)[_0xf54e('0x1e')](function(_0x2527f6){logger[_0xf54e('0x12')](_0xf54e('0x3a'),_0x2527f6[_0xf54e('0x19')]);emit(util[_0xf54e('0x33')](_0xf54e('0x34'),_0x2527f6[_0xf54e('0x19')]),_0xf54e('0x42'),{'sessionId':_0xca0141});return _0x3a5a87[_0xf54e('0x1a')](0xc8)[_0xf54e('0x30')]({'error':![],'message':_0xf54e('0x43')});})[_0xf54e('0x22')](handleError(_0x3a5a87));};exports[_0xf54e('0x44')]=function(_0xa6c305,_0x40d8ab){logger[_0xf54e('0x12')](_0xf54e('0x45'),_0xa6c305[_0xf54e('0x2f')]);var _0x4e25e4=unholdValidation['validate'](_0xa6c305[_0xf54e('0x2f')]);if(_0x4e25e4[_0xf54e('0x2b')]>0x0){return _0x40d8ab[_0xf54e('0x1a')](0x190)[_0xf54e('0x30')](_0x4e25e4);}var _0xba297c=_0xa6c305[_0xf54e('0x2f')][_0xf54e('0x39')];var _0x149d0b=_0xa6c305[_0xf54e('0x2f')][_0xf54e('0x2a')];return getAgent(_0xba297c)[_0xf54e('0x1e')](function(_0x59c313){logger[_0xf54e('0x12')](_0xf54e('0x3a'),_0x59c313[_0xf54e('0x19')]);emit(util[_0xf54e('0x33')](_0xf54e('0x34'),_0x59c313[_0xf54e('0x19')]),_0xf54e('0x46'),{'sessionId':_0x149d0b});return _0x40d8ab['status'](0xc8)[_0xf54e('0x30')]({'error':![],'message':_0xf54e('0x47')});})[_0xf54e('0x22')](handleError(_0x40d8ab));};exports['calls']=function(_0x3ce832,_0x54ac1a){logger[_0xf54e('0x12')](_0xf54e('0x48'),_0x54ac1a[_0xf54e('0x2f')]);var _0x5b882f=callsValidation[_0xf54e('0x38')](_0x3ce832[_0xf54e('0x2f')]);if(_0x5b882f[_0xf54e('0x2b')]>0x0){return _0x54ac1a[_0xf54e('0x1a')](0x190)[_0xf54e('0x30')](_0x5b882f);}var _0x2ec72a=_0x3ce832[_0xf54e('0x2f')]['userId'];var _0x55de5c=respondWithRpcPromise(_0xf54e('0x26'));var _0x9ab4c4=getAgent(_0x2ec72a);return Promise['all']([_0x55de5c,_0x9ab4c4])[_0xf54e('0x1e')](function(_0x49fd97){var _0xf39552=_0x49fd97[0x0];var _0x528a64=_0x49fd97[0x1];var _0x324167=_[_0xf54e('0x49')](_0xf39552[_0xf54e('0x28')],function(_0x241198){return _0x241198[_0xf54e('0x29')]==_0x528a64['id'];});return _0x54ac1a[_0xf54e('0x1a')](0xc8)['json']({'count':_0x324167['length'],'rows':_0x324167});})[_0xf54e('0x22')](handleError(_0x54ac1a));};exports[_0xf54e('0x4a')]=function(_0x493011,_0x57a48e){logger[_0xf54e('0x12')]('conference\x20fired:',_0x493011[_0xf54e('0x2f')]);var _0x43f9bf=conferenceValidation[_0xf54e('0x38')](_0x493011[_0xf54e('0x2f')]);if(_0x43f9bf[_0xf54e('0x2b')]>0x0){return _0x57a48e[_0xf54e('0x1a')](0x190)[_0xf54e('0x30')](_0x43f9bf);}var _0x3d706a=_0x493011[_0xf54e('0x2f')][_0xf54e('0x39')];return getAgent(_0x3d706a)[_0xf54e('0x1e')](function(_0x2c6d0e){logger[_0xf54e('0x12')](_0xf54e('0x3a'),_0x2c6d0e['name']);emit(util[_0xf54e('0x33')](_0xf54e('0x34'),_0x2c6d0e[_0xf54e('0x19')]),_0xf54e('0x4b'));return _0x57a48e[_0xf54e('0x1a')](0xc8)['json']({'error':![],'message':_0xf54e('0x4c')});})[_0xf54e('0x22')](handleError(_0x57a48e));};exports['transfer']=function(_0x51ec35,_0x2818cf){logger['info'](_0xf54e('0x4d'),_0x51ec35[_0xf54e('0x2f')]);var _0x105cf4=transferValidation[_0xf54e('0x38')](_0x51ec35['body']);if(_0x105cf4[_0xf54e('0x2b')]>0x0){return _0x2818cf['status'](0x190)[_0xf54e('0x30')](_0x105cf4);}var _0x3759d4=_0x51ec35[_0xf54e('0x2f')]['userId'];var _0x2d04db=_0x51ec35['body'][_0xf54e('0x2a')];var _0x3e2101=_0x51ec35['body'][_0xf54e('0x4e')];return getAgent(_0x3759d4)['then'](function(_0x3aa7e5){logger[_0xf54e('0x12')](_0xf54e('0x3a'),_0x3aa7e5[_0xf54e('0x19')]);emit(util[_0xf54e('0x33')]('user:%s',_0x3aa7e5[_0xf54e('0x19')]),_0xf54e('0x4f'),{'sessionId':_0x2d04db,'transferNumber':_0x3e2101});return _0x2818cf['status'](0xc8)[_0xf54e('0x30')]({'error':![],'message':_0xf54e('0x50')});})['catch'](handleError(_0x2818cf));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4261099..03898e0 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 _0xebf3=['put','update','delete','removeDispositions','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send'];(function(_0x1139fe,_0x2eee8c){var _0x339a31=function(_0xc946c5){while(--_0xc946c5){_0x1139fe['push'](_0x1139fe['shift']());}};_0x339a31(++_0x2eee8c);}(_0xebf3,0x94));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ebf('0x0'));var util=require(_0x3ebf('0x1'));var path=require(_0x3ebf('0x2'));var timeout=require(_0x3ebf('0x3'));var express=require(_0x3ebf('0x4'));var router=express['Router']();var fs_extra=require(_0x3ebf('0x5'));var auth=require(_0x3ebf('0x6'));var interaction=require(_0x3ebf('0x7'));var config=require(_0x3ebf('0x8'));var controller=require(_0x3ebf('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3ebf('0xa')]);router['get'](_0x3ebf('0xb'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0xd')]);router[_0x3ebf('0xe')](_0x3ebf('0xf'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x10')]);router['get'](_0x3ebf('0x11'),auth['isAuthenticated'](),controller[_0x3ebf('0x12')]);router[_0x3ebf('0xe')](_0x3ebf('0x13'),auth[_0x3ebf('0xc')](),controller['getAnswers']);router[_0x3ebf('0xe')](_0x3ebf('0x14'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x15')]);router[_0x3ebf('0xe')](_0x3ebf('0x16'),auth['isAuthenticated'](),controller[_0x3ebf('0x17')]);router[_0x3ebf('0x18')]('/',auth[_0x3ebf('0xc')](),controller['create']);router[_0x3ebf('0x18')]('/:id/dispositions',auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x19')]);router[_0x3ebf('0x18')](_0x3ebf('0x13'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x1a')]);router[_0x3ebf('0x18')](_0x3ebf('0x14'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x1b')]);router[_0x3ebf('0x18')](_0x3ebf('0x16'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x1c')]);router['post'](_0x3ebf('0x1d'),controller[_0x3ebf('0x1e')]);router[_0x3ebf('0x18')](_0x3ebf('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x3ebf('0x20')](_0x3ebf('0xf'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x21')]);router[_0x3ebf('0x22')](_0x3ebf('0xf'),auth[_0x3ebf('0xc')](),controller['destroy']);router['delete'](_0x3ebf('0x11'),auth[_0x3ebf('0xc')](),controller[_0x3ebf('0x23')]);router[_0x3ebf('0x22')]('/:id/canned_answers',auth[_0x3ebf('0xc')](),controller['removeAnswers']);router[_0x3ebf('0x22')](_0x3ebf('0x14'),auth[_0x3ebf('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xefbc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAnswer','addApplications','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout'];(function(_0x391932,_0x3c1b9f){var _0x49ca90=function(_0x589776){while(--_0x589776){_0x391932['push'](_0x391932['shift']());}};_0x49ca90(++_0x3c1b9f);}(_0xefbc,0x11e));var _0xcefb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xefbc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xcefb('0x0'));var path=require('path');var timeout=require(_0xcefb('0x1'));var express=require('express');var router=express[_0xcefb('0x2')]();var fs_extra=require(_0xcefb('0x3'));var auth=require(_0xcefb('0x4'));var interaction=require(_0xcefb('0x5'));var config=require(_0xcefb('0x6'));var controller=require(_0xcefb('0x7'));router[_0xcefb('0x8')]('/',auth[_0xcefb('0x9')](),controller[_0xcefb('0xa')]);router['get'](_0xcefb('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xcefb('0x9')](),controller[_0xcefb('0xc')]);router['get'](_0xcefb('0xd'),auth[_0xcefb('0x9')](),controller[_0xcefb('0xe')]);router[_0xcefb('0x8')](_0xcefb('0xf'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x10')]);router[_0xcefb('0x8')](_0xcefb('0x11'),auth[_0xcefb('0x9')](),controller['getAgents']);router['get'](_0xcefb('0x12'),auth[_0xcefb('0x9')](),controller['getApplications']);router[_0xcefb('0x13')]('/',auth[_0xcefb('0x9')](),controller[_0xcefb('0x14')]);router[_0xcefb('0x13')](_0xcefb('0xd'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x15')]);router[_0xcefb('0x13')]('/:id/canned_answers',auth[_0xcefb('0x9')](),controller[_0xcefb('0x16')]);router[_0xcefb('0x13')]('/:id/users',auth[_0xcefb('0x9')](),controller['addAgents']);router[_0xcefb('0x13')](_0xcefb('0x12'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x17')]);router[_0xcefb('0x13')]('/:id/notify',controller[_0xcefb('0x18')]);router['post'](_0xcefb('0x19'),auth['isAuthenticated'](),controller[_0xcefb('0x1a')]);router[_0xcefb('0x1b')](_0xcefb('0x1c'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x1d')]);router[_0xcefb('0x1e')](_0xcefb('0x1c'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x1f')]);router[_0xcefb('0x1e')](_0xcefb('0xd'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x20')]);router[_0xcefb('0x1e')](_0xcefb('0xf'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x21')]);router[_0xcefb('0x1e')](_0xcefb('0x11'),auth[_0xcefb('0x9')](),controller[_0xcefb('0x22')]);module[_0xcefb('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index bb1671d..bdea59c 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 _0x00bc=['name','twilio','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING'];(function(_0x1d125f,_0x59749e){var _0x2ac863=function(_0x4ed853){while(--_0x4ed853){_0x1d125f['push'](_0x1d125f['shift']());}};_0x2ac863(++_0x59749e);}(_0x00bc,0x17c));var _0xc00b=function(_0x51ccb4,_0x1c395e){_0x51ccb4=_0x51ccb4-0x0;var _0x29328e=_0x00bc[_0x51ccb4];return _0x29328e;};'use strict';var Sequelize=require(_0xc00b('0x0'));var rs=require(_0xc00b('0x1'));module[_0xc00b('0x2')]={'name':{'type':Sequelize[_0xc00b('0x3')],'unique':_0xc00b('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xc00b('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc00b('0x3')]},'type':{'type':Sequelize['ENUM'](_0xc00b('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0xc00b('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc00b('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc00b('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc00b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc00b('0x7')],'comment':_0xc00b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc00b('0x6')],'defaultValue':![],'comment':_0xc00b('0x9'),'set':function(_0x14062f){if(!_0x14062f){this[_0xc00b('0xa')](_0xc00b('0xb'),null);}this[_0xc00b('0xa')]('mandatoryDisposition',_0x14062f);}},'description':{'type':Sequelize[_0xc00b('0x3')]}}; \ No newline at end of file +var _0xbc5d=['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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x1ecfff,_0x803cd){var _0xb12a6=function(_0x3994a1){while(--_0x3994a1){_0x1ecfff['push'](_0x1ecfff['shift']());}};_0xb12a6(++_0x803cd);}(_0xbc5d,0x19e));var _0xdbc5=function(_0xd1ec2b,_0x395dba){_0xd1ec2b=_0xd1ec2b-0x0;var _0x1d1b54=_0xbc5d[_0xd1ec2b];return _0x1d1b54;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdbc5('0x0'));module[_0xdbc5('0x1')]={'name':{'type':Sequelize[_0xdbc5('0x2')],'unique':_0xdbc5('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xdbc5('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xdbc5('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xdbc5('0x2')],'defaultValue':function(){return rs[_0xdbc5('0x4')]();}},'phone':{'type':Sequelize[_0xdbc5('0x2')]},'type':{'type':Sequelize[_0xdbc5('0x5')]('twilio',_0xdbc5('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xdbc5('0x2')]},'authToken':{'type':Sequelize[_0xdbc5('0x2')]},'notificationTemplate':{'type':Sequelize[_0xdbc5('0x7')],'defaultValue':function(){return _0xdbc5('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdbc5('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdbc5('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdbc5('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdbc5('0xa')],'comment':_0xdbc5('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xdbc5('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x6ef2f5){if(!_0x6ef2f5){this[_0xdbc5('0xc')](_0xdbc5('0xd'),null);}this[_0xdbc5('0xc')](_0xdbc5('0xe'),_0x6ef2f5);}},'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 78df3a9..2d2c5f9 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 _0x228f=['describe','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','WhatsappQueue','queueId','queue','waitForTheAssignedQueue','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','get','WhatsappAccounts','UserProfileResource','destroy','name','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','priority','stack','send','getApplications','WhatsappApplication','Applications','account','type','sinch','statuses','read','timestamp','message_id','applications','orderBy','asc','CmContact'];(function(_0x4c0f57,_0x26f2a1){var _0x6278c=function(_0x4a2a77){while(--_0x4a2a77){_0x4c0f57['push'](_0x4c0f57['shift']());}};_0x6278c(++_0x26f2a1);}(_0x228f,0xf6));var _0xf228=function(_0x46cedb,_0x53b2ff){_0x46cedb=_0x46cedb-0x0;var _0x4b8ccb=_0x228f[_0x46cedb];return _0x4b8ccb;};'use strict';var emlformat=require(_0xf228('0x0'));var rimraf=require(_0xf228('0x1'));var zipdir=require(_0xf228('0x2'));var jsonpatch=require(_0xf228('0x3'));var rp=require(_0xf228('0x4'));var moment=require(_0xf228('0x5'));var BPromise=require(_0xf228('0x6'));var Mustache=require(_0xf228('0x7'));var util=require(_0xf228('0x8'));var path=require(_0xf228('0x9'));var sox=require('sox');var csv=require(_0xf228('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf228('0xb'));var _=require(_0xf228('0xc'));var squel=require('squel');var crypto=require(_0xf228('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf228('0xe'));var toCsv=require(_0xf228('0xa'));var querystring=require('querystring');var Papa=require(_0xf228('0xf'));var Redis=require('ioredis');var authService=require(_0xf228('0x10'));var qs=require(_0xf228('0x11'));var as=require(_0xf228('0x12'));var hardwareService=require(_0xf228('0x13'));var logger=require(_0xf228('0x14'))(_0xf228('0x15'));var utils=require(_0xf228('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf228('0x17'))['db'];config[_0xf228('0x18')]=_[_0xf228('0x19')](config[_0xf228('0x18')],{'host':_0xf228('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf228('0x18')]));require(_0xf228('0x1b'))[_0xf228('0x1c')](socket);var jayson=require(_0xf228('0x1d'));var client=jayson['client'][_0xf228('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2e740d,_0x4fcf91,_0x33e1c4,_0x42315d){return new BPromise(function(_0x5575aa,_0x62160a){var _0x23768a=_0x42315d||client;return _0x23768a['request'](_0x2e740d,_0x33e1c4)[_0xf228('0x1f')](function(_0x1e4dfe){logger[_0xf228('0x20')](_0xf228('0x21'),_0x4fcf91,'request\x20sent');logger[_0xf228('0x22')](_0xf228('0x23'),_0x4fcf91,'request\x20sent',JSON[_0xf228('0x24')](_0x1e4dfe));if(_0x1e4dfe[_0xf228('0x25')]){if(_0x1e4dfe[_0xf228('0x25')][_0xf228('0x26')]===0x1f4){logger[_0xf228('0x25')](_0xf228('0x21'),_0x4fcf91,_0x1e4dfe[_0xf228('0x25')][_0xf228('0x27')]);return _0x62160a(_0x1e4dfe[_0xf228('0x25')][_0xf228('0x27')]);}logger['error'](_0xf228('0x21'),_0x4fcf91,_0x1e4dfe['error'][_0xf228('0x27')]);return _0x5575aa(_0x1e4dfe['error']['message']);}else{logger[_0xf228('0x20')](_0xf228('0x21'),_0x4fcf91,_0xf228('0x28'));_0x5575aa(_0x1e4dfe[_0xf228('0x29')][_0xf228('0x27')]);}})[_0xf228('0x2a')](function(_0x4b1c52){logger[_0xf228('0x25')](_0xf228('0x21'),_0x4fcf91,_0x4b1c52);_0x62160a(_0x4b1c52);});});}function respondWithStatusCode(_0xa49787,_0x47ba50){_0x47ba50=_0x47ba50||0xcc;return function(_0x27c321){if(_0x27c321){return _0xa49787[_0xf228('0x2b')](_0x47ba50);}return _0xa49787[_0xf228('0x2c')](_0x47ba50)[_0xf228('0x2d')]();};}function respondWithResult(_0x2c06a5,_0x22d23e){_0x22d23e=_0x22d23e||0xc8;return function(_0x233598){if(_0x233598){return _0x2c06a5[_0xf228('0x2c')](_0x22d23e)[_0xf228('0x2e')](_0x233598);}};}function respondWithFilteredResult(_0x1a5f31,_0x54f9a9){return function(_0x58adfe){if(_0x58adfe){var _0x5c9435=typeof _0x54f9a9[_0xf228('0x2f')]==='undefined'&&typeof _0x54f9a9['limit']==='undefined';var _0x33a12a=_0x58adfe['count'];var _0x162a3d=_0x5c9435?0x0:_0x54f9a9[_0xf228('0x2f')];var _0x11baf3=_0x5c9435?_0x58adfe['count']:_0x54f9a9[_0xf228('0x2f')]+_0x54f9a9['limit'];var _0xe5dff2;if(_0x11baf3>=_0x33a12a){_0x11baf3=_0x33a12a;_0xe5dff2=0xc8;}else{_0xe5dff2=0xce;}_0x1a5f31['status'](_0xe5dff2);return _0x1a5f31[_0xf228('0x30')](_0xf228('0x31'),_0x162a3d+'-'+_0x11baf3+'/'+_0x33a12a)[_0xf228('0x2e')](_0x58adfe);}return null;};}function patchUpdates(_0xb5ff85){return function(_0x15f11d){try{jsonpatch[_0xf228('0x32')](_0x15f11d,_0xb5ff85,!![]);}catch(_0x5db7a2){return BPromise[_0xf228('0x33')](_0x5db7a2);}return _0x15f11d[_0xf228('0x34')]();};}function saveUpdates(_0x5460f3,_0x53d4d2){return function(_0xe0ece4){if(_0xe0ece4){return _0xe0ece4[_0xf228('0x35')](_0x5460f3)[_0xf228('0x1f')](function(_0x4cdbb2){return _0x4cdbb2;});}return null;};}function removeEntity(_0x430696,_0x469936){return function(_0x204924){if(_0x204924){return _0x204924['destroy']()[_0xf228('0x1f')](function(){var _0x48d63e=_0x204924[_0xf228('0x36')]({'plain':!![]});var _0x2cfd94=_0xf228('0x37');return db[_0xf228('0x38')][_0xf228('0x39')]({'where':{'type':_0x2cfd94,'resourceId':_0x48d63e['id']}})[_0xf228('0x1f')](function(){return _0x204924;});})[_0xf228('0x1f')](function(){_0x430696['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12e311,_0x3b2c80){return function(_0x18f9fc){if(!_0x18f9fc){_0x12e311[_0xf228('0x2b')](0x194);}return _0x18f9fc;};}function handleError(_0x7d370d,_0x3a5623){_0x3a5623=_0x3a5623||0x1f4;return function(_0xdde1dd){logger[_0xf228('0x25')](_0xdde1dd['stack']);if(_0xdde1dd['name']){delete _0xdde1dd[_0xf228('0x3a')];}_0x7d370d[_0xf228('0x2c')](_0x3a5623)['send'](_0xdde1dd);};}exports['index']=function(_0x3eacff,_0x5b9df4){var _0x3fbaac={'include':[{'model':db[_0xf228('0x3b')],'as':_0xf228('0x3c')}]},_0x3b0ad7={},_0x275230={'count':0x0,'rows':[]};var _0x216a93=_['map'](db[_0xf228('0x3d')]['rawAttributes'],function(_0x1b5e27){return{'name':_0x1b5e27[_0xf228('0x3e')],'type':_0x1b5e27['type'][_0xf228('0x3f')]};});_0x3b0ad7['model']=_[_0xf228('0x40')](_0x216a93,_0xf228('0x3a'));_0x3b0ad7[_0xf228('0x41')]=_[_0xf228('0x42')](_0x3eacff[_0xf228('0x41')]);_0x3b0ad7[_0xf228('0x43')]=_[_0xf228('0x44')](_0x3b0ad7[_0xf228('0x45')],_0x3b0ad7['query']);_0x3fbaac[_0xf228('0x46')]=_[_0xf228('0x44')](_0x3b0ad7['model'],qs[_0xf228('0x47')](_0x3eacff[_0xf228('0x41')]['fields']));_0x3fbaac[_0xf228('0x46')]=_0x3fbaac[_0xf228('0x46')][_0xf228('0x48')]?_0x3fbaac[_0xf228('0x46')]:_0x3b0ad7[_0xf228('0x45')];if(!_0x3eacff[_0xf228('0x41')][_0xf228('0x49')](_0xf228('0x4a'))){_0x3fbaac[_0xf228('0x4b')]=qs[_0xf228('0x4b')](_0x3eacff[_0xf228('0x41')][_0xf228('0x4b')]);_0x3fbaac['offset']=qs[_0xf228('0x2f')](_0x3eacff[_0xf228('0x41')][_0xf228('0x2f')]);}_0x3fbaac[_0xf228('0x4c')]=qs[_0xf228('0x4d')](_0x3eacff[_0xf228('0x41')][_0xf228('0x4d')]);_0x3fbaac[_0xf228('0x4e')]=qs[_0xf228('0x43')](_[_0xf228('0x4f')](_0x3eacff[_0xf228('0x41')],_0x3b0ad7[_0xf228('0x43')]),_0x216a93);if(_0x3eacff[_0xf228('0x41')][_0xf228('0x50')]){_0x3fbaac[_0xf228('0x4e')]=_[_0xf228('0x51')](_0x3fbaac[_0xf228('0x4e')],{'$or':_[_0xf228('0x40')](_0x216a93,function(_0x19f8d7){if(_0x19f8d7['type']!==_0xf228('0x52')){var _0x4d8396={};_0x4d8396[_0x19f8d7[_0xf228('0x3a')]]={'$like':'%'+_0x3eacff[_0xf228('0x41')][_0xf228('0x50')]+'%'};return _0x4d8396;}})});}_0x3fbaac=_[_0xf228('0x51')]({},_0x3fbaac,_0x3eacff[_0xf228('0x53')]);var _0x23df2a={'where':_0x3fbaac['where']};return db[_0xf228('0x3d')]['count'](_0x23df2a)[_0xf228('0x1f')](function(_0x284f56){_0x275230['count']=_0x284f56;if(_0x3eacff[_0xf228('0x41')]['includeAll']){_0x3fbaac[_0xf228('0x54')]=[{'all':!![]}];}return db[_0xf228('0x3d')][_0xf228('0x55')](_0x3fbaac);})[_0xf228('0x1f')](function(_0x2c2d02){_0x275230[_0xf228('0x56')]=_0x2c2d02;return _0x275230;})[_0xf228('0x1f')](respondWithFilteredResult(_0x5b9df4,_0x3fbaac))[_0xf228('0x2a')](handleError(_0x5b9df4,null));};exports[_0xf228('0x57')]=function(_0x10d081,_0x40faf6){var _0x5d2357={'raw':![],'where':{'id':_0x10d081[_0xf228('0x58')]['id']},'include':[{'model':db[_0xf228('0x3b')],'as':_0xf228('0x3c')}]},_0x582da8={};_0x582da8[_0xf228('0x45')]=_[_0xf228('0x42')](db[_0xf228('0x3d')][_0xf228('0x59')]);_0x582da8[_0xf228('0x41')]=_[_0xf228('0x42')](_0x10d081[_0xf228('0x41')]);_0x582da8[_0xf228('0x43')]=_[_0xf228('0x44')](_0x582da8[_0xf228('0x45')],_0x582da8['query']);_0x5d2357['attributes']=_['intersection'](_0x582da8[_0xf228('0x45')],qs[_0xf228('0x47')](_0x10d081[_0xf228('0x41')][_0xf228('0x47')]));_0x5d2357[_0xf228('0x46')]=_0x5d2357[_0xf228('0x46')][_0xf228('0x48')]?_0x5d2357[_0xf228('0x46')]:_0x582da8[_0xf228('0x45')];if(_0x10d081[_0xf228('0x41')][_0xf228('0x5a')]){_0x5d2357['include']=[{'all':!![]}];}_0x5d2357=_[_0xf228('0x51')]({},_0x5d2357,_0x10d081[_0xf228('0x53')]);return db[_0xf228('0x3d')]['find'](_0x5d2357)[_0xf228('0x1f')](handleEntityNotFound(_0x40faf6,null))[_0xf228('0x1f')](respondWithResult(_0x40faf6,null))[_0xf228('0x2a')](handleError(_0x40faf6,null));};exports['create']=function(_0x4921a0,_0x1970a5){return db[_0xf228('0x3d')][_0xf228('0x5b')](_0x4921a0[_0xf228('0x5c')],{})[_0xf228('0x1f')](function(_0x1bfa87){var _0xa68cc8=_0x4921a0[_0xf228('0x5d')][_0xf228('0x36')]({'plain':!![]});if(!_0xa68cc8)throw new Error(_0xf228('0x5e'));if(_0xa68cc8[_0xf228('0x5f')]===_0xf228('0x5d')){var _0x15cd0a=_0x1bfa87[_0xf228('0x36')]({'plain':!![]});var _0x33014d=_0xf228('0x37');return db[_0xf228('0x60')][_0xf228('0x61')]({'where':{'name':_0x33014d,'userProfileId':_0xa68cc8['userProfileId']},'raw':!![]})[_0xf228('0x1f')](function(_0x5be2a1){if(_0x5be2a1&&_0x5be2a1[_0xf228('0x62')]===0x0){return db[_0xf228('0x38')]['create']({'name':_0x15cd0a[_0xf228('0x3a')],'resourceId':_0x15cd0a['id'],'type':_0x5be2a1[_0xf228('0x3a')],'sectionId':_0x5be2a1['id']},{})[_0xf228('0x1f')](function(){return _0x1bfa87;});}else{return _0x1bfa87;}})[_0xf228('0x2a')](function(_0x45a07e){logger[_0xf228('0x25')](_0xf228('0x63'),_0x45a07e);throw _0x45a07e;});}return _0x1bfa87;})['then'](respondWithResult(_0x1970a5,0xc9))[_0xf228('0x2a')](handleError(_0x1970a5,null));};exports['update']=function(_0x46e352,_0x1bac12){if(_0x46e352[_0xf228('0x5c')]['id']){delete _0x46e352['body']['id'];}return db['WhatsappAccount'][_0xf228('0x61')]({'where':{'id':_0x46e352[_0xf228('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xf228('0x3c')}]})[_0xf228('0x1f')](handleEntityNotFound(_0x1bac12,null))[_0xf228('0x1f')](saveUpdates(_0x46e352[_0xf228('0x5c')],null))[_0xf228('0x1f')](respondWithResult(_0x1bac12,null))['catch'](handleError(_0x1bac12,null));};exports[_0xf228('0x39')]=function(_0x6c6af4,_0x309c34){return db[_0xf228('0x3d')][_0xf228('0x61')]({'where':{'id':_0x6c6af4[_0xf228('0x58')]['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x309c34,null))['then'](removeEntity(_0x309c34,null))[_0xf228('0x2a')](handleError(_0x309c34,null));};exports['describe']=function(_0x47224e,_0x154aeb){return db[_0xf228('0x3d')]['describe']()[_0xf228('0x1f')](respondWithResult(_0x154aeb,null))[_0xf228('0x2a')](handleError(_0x154aeb,null));};exports[_0xf228('0x64')]=function(_0x4803b5,_0x24eefb,_0x335465){if(_0x4803b5[_0xf228('0x5c')]['id']){delete _0x4803b5[_0xf228('0x5c')]['id'];}return db[_0xf228('0x3d')][_0xf228('0x61')]({'where':{'id':_0x4803b5[_0xf228('0x58')]['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x24eefb,null))[_0xf228('0x1f')](function(_0x4d8203){if(_0x4d8203){_0x4803b5[_0xf228('0x5c')][_0xf228('0x65')]=_0x4d8203['id'];return db[_0xf228('0x66')][_0xf228('0x5b')](_0x4803b5[_0xf228('0x5c')]);}})[_0xf228('0x1f')](respondWithResult(_0x24eefb,null))[_0xf228('0x2a')](handleError(_0x24eefb,null));};exports[_0xf228('0x67')]=function(_0x440677,_0x37dbda,_0x1c4476){var _0x1fe2c5={'raw':![],'where':{}};var _0x40cbe1={};var _0x5a243c={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf228('0x68')]({'where':{'id':_0x440677[_0xf228('0x58')]['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x37dbda,null))['then'](function(_0xb36303){if(_0xb36303){_0x40cbe1[_0xf228('0x45')]=_[_0xf228('0x42')](db[_0xf228('0x66')][_0xf228('0x59')]);_0x40cbe1[_0xf228('0x41')]=_[_0xf228('0x42')](_0x440677[_0xf228('0x41')]);_0x40cbe1[_0xf228('0x43')]=_[_0xf228('0x44')](_0x40cbe1['model'],_0x40cbe1[_0xf228('0x41')]);_0x1fe2c5[_0xf228('0x46')]=_[_0xf228('0x44')](_0x40cbe1[_0xf228('0x45')],qs[_0xf228('0x47')](_0x440677[_0xf228('0x41')][_0xf228('0x47')]));_0x1fe2c5[_0xf228('0x46')]=_0x1fe2c5[_0xf228('0x46')][_0xf228('0x48')]?_0x1fe2c5[_0xf228('0x46')]:_0x40cbe1['model'];if(!_0x440677['query'][_0xf228('0x49')]('nolimit')){_0x1fe2c5[_0xf228('0x4b')]=qs['limit'](_0x440677[_0xf228('0x41')]['limit']);_0x1fe2c5[_0xf228('0x2f')]=qs[_0xf228('0x2f')](_0x440677['query'][_0xf228('0x2f')]);}_0x1fe2c5[_0xf228('0x4c')]=qs[_0xf228('0x4d')](_0x440677[_0xf228('0x41')][_0xf228('0x4d')]);_0x1fe2c5[_0xf228('0x4e')]=qs[_0xf228('0x43')](_[_0xf228('0x4f')](_0x440677[_0xf228('0x41')],_0x40cbe1[_0xf228('0x43')]));_0x1fe2c5[_0xf228('0x4e')][_0xf228('0x65')]=_0xb36303['id'];if(_0x440677[_0xf228('0x41')][_0xf228('0x50')]){_0x1fe2c5[_0xf228('0x4e')]=_[_0xf228('0x51')](_0x1fe2c5[_0xf228('0x4e')],{'$or':_[_0xf228('0x40')](_0x1fe2c5[_0xf228('0x46')],function(_0xab59da){var _0xc7fe15={};_0xc7fe15[_0xab59da]={'$like':'%'+_0x440677[_0xf228('0x41')][_0xf228('0x50')]+'%'};return _0xc7fe15;})});}_0x1fe2c5=_[_0xf228('0x51')]({},_0x1fe2c5,_0x440677[_0xf228('0x53')]);return db[_0xf228('0x66')]['count']({'where':_0x1fe2c5[_0xf228('0x4e')]})[_0xf228('0x1f')](function(_0x362ea3){_0x5a243c[_0xf228('0x69')]=_0x362ea3;if(_0x440677[_0xf228('0x41')][_0xf228('0x5a')]){_0x1fe2c5[_0xf228('0x54')]=[{'all':!![]}];}return db['Disposition'][_0xf228('0x55')](_0x1fe2c5);})[_0xf228('0x1f')](function(_0x4c8669){_0x5a243c['rows']=_0x4c8669;return _0x5a243c;});}})[_0xf228('0x1f')](respondWithFilteredResult(_0x37dbda,_0x1fe2c5))['catch'](handleError(_0x37dbda,null));};exports[_0xf228('0x6a')]=function(_0x121c83,_0x5031b1,_0x21a168){return db[_0xf228('0x3d')][_0xf228('0x61')]({'where':{'id':_0x121c83[_0xf228('0x58')]['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x5031b1,null))['then'](function(_0x3cdd13){if(_0x3cdd13){return _0x3cdd13[_0xf228('0x6a')](_0x121c83[_0xf228('0x41')][_0xf228('0x6b')]);}})[_0xf228('0x1f')](respondWithStatusCode(_0x5031b1,null))['catch'](handleError(_0x5031b1,null));};exports[_0xf228('0x6c')]=function(_0x3041dd,_0x4838ea,_0x43531e){if(_0x3041dd[_0xf228('0x5c')]['id']){delete _0x3041dd[_0xf228('0x5c')]['id'];}return db[_0xf228('0x3d')][_0xf228('0x61')]({'where':{'id':_0x3041dd['params']['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x4838ea,null))[_0xf228('0x1f')](function(_0x1fbe7e){if(_0x1fbe7e){_0x3041dd[_0xf228('0x5c')][_0xf228('0x65')]=_0x1fbe7e['id'];return db['CannedAnswer'][_0xf228('0x5b')](_0x3041dd['body']);}})[_0xf228('0x1f')](respondWithResult(_0x4838ea,null))['catch'](handleError(_0x4838ea,null));};exports[_0xf228('0x6d')]=function(_0x2aeb55,_0x293fe5,_0x10bf58){var _0x24ab98={'raw':![],'where':{}};var _0x582961={};var _0x8690df={'count':0x0,'rows':[]};return db[_0xf228('0x3d')][_0xf228('0x68')]({'where':{'id':_0x2aeb55[_0xf228('0x58')]['id']}})['then'](handleEntityNotFound(_0x293fe5,null))['then'](function(_0x1c2635){if(_0x1c2635){_0x582961['model']=_[_0xf228('0x42')](db['CannedAnswer'][_0xf228('0x59')]);_0x582961[_0xf228('0x41')]=_[_0xf228('0x42')](_0x2aeb55[_0xf228('0x41')]);_0x582961['filters']=_[_0xf228('0x44')](_0x582961[_0xf228('0x45')],_0x582961[_0xf228('0x41')]);_0x24ab98[_0xf228('0x46')]=_[_0xf228('0x44')](_0x582961[_0xf228('0x45')],qs[_0xf228('0x47')](_0x2aeb55['query']['fields']));_0x24ab98[_0xf228('0x46')]=_0x24ab98[_0xf228('0x46')][_0xf228('0x48')]?_0x24ab98['attributes']:_0x582961['model'];if(!_0x2aeb55[_0xf228('0x41')][_0xf228('0x49')]('nolimit')){_0x24ab98[_0xf228('0x4b')]=qs[_0xf228('0x4b')](_0x2aeb55[_0xf228('0x41')]['limit']);_0x24ab98[_0xf228('0x2f')]=qs[_0xf228('0x2f')](_0x2aeb55[_0xf228('0x41')]['offset']);}_0x24ab98[_0xf228('0x4c')]=qs[_0xf228('0x4d')](_0x2aeb55[_0xf228('0x41')]['sort']);_0x24ab98[_0xf228('0x4e')]=qs['filters'](_[_0xf228('0x4f')](_0x2aeb55['query'],_0x582961['filters']));_0x24ab98[_0xf228('0x4e')][_0xf228('0x65')]=_0x1c2635['id'];if(_0x2aeb55[_0xf228('0x41')]['filter']){_0x24ab98[_0xf228('0x4e')]=_[_0xf228('0x51')](_0x24ab98['where'],{'$or':_[_0xf228('0x40')](_0x24ab98['attributes'],function(_0x3cfcb5){var _0x56f290={};_0x56f290[_0x3cfcb5]={'$like':'%'+_0x2aeb55[_0xf228('0x41')][_0xf228('0x50')]+'%'};return _0x56f290;})});}_0x24ab98=_['merge']({},_0x24ab98,_0x2aeb55['options']);return db['CannedAnswer'][_0xf228('0x69')]({'where':_0x24ab98[_0xf228('0x4e')]})[_0xf228('0x1f')](function(_0x3bc6eb){_0x8690df[_0xf228('0x69')]=_0x3bc6eb;if(_0x2aeb55[_0xf228('0x41')][_0xf228('0x5a')]){_0x24ab98[_0xf228('0x54')]=[{'all':!![]}];}return db[_0xf228('0x6e')][_0xf228('0x55')](_0x24ab98);})[_0xf228('0x1f')](function(_0x26d7c6){_0x8690df[_0xf228('0x56')]=_0x26d7c6;return _0x8690df;});}})['then'](respondWithFilteredResult(_0x293fe5,_0x24ab98))[_0xf228('0x2a')](handleError(_0x293fe5,null));};exports[_0xf228('0x6f')]=function(_0x4b2358,_0x481e72,_0x4c8f1c){return db[_0xf228('0x3d')][_0xf228('0x61')]({'where':{'id':_0x4b2358['params']['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x481e72,null))[_0xf228('0x1f')](function(_0x22787e){if(_0x22787e){return _0x22787e[_0xf228('0x6f')](_0x4b2358[_0xf228('0x41')][_0xf228('0x6b')]);}})[_0xf228('0x1f')](respondWithStatusCode(_0x481e72,null))[_0xf228('0x2a')](handleError(_0x481e72,null));};exports[_0xf228('0x70')]=function(_0x1c634f,_0x5343b7,_0xa4cd2b){return db[_0xf228('0x3d')][_0xf228('0x61')]({'where':{'id':_0x1c634f[_0xf228('0x58')]['id']}})['then'](handleEntityNotFound(_0x5343b7,null))['then'](function(_0x3fa03d){if(_0x3fa03d){return _0x3fa03d['addAgents'](_0x1c634f[_0xf228('0x5c')]['ids'],_[_0xf228('0x71')](_0x1c634f['body'],[_0xf228('0x6b'),'id'])||{})[_0xf228('0x72')](function(_0x3ccbf5){for(var _0x11c6d9=0x0;_0x11c6d9<_0x1c634f['body']['ids'][_0xf228('0x48')];_0x11c6d9+=0x1){socket[_0xf228('0x73')](_0xf228('0x74'),{'UserId':Number(_0x1c634f[_0xf228('0x5c')]['ids'][_0x11c6d9]),'WhatsappAccountId':Number(_0x1c634f['params']['id'])});}return _0x3ccbf5;});}})[_0xf228('0x1f')](respondWithResult(_0x5343b7,null))[_0xf228('0x2a')](handleError(_0x5343b7,null));};exports[_0xf228('0x75')]=function(_0x1d2cb7,_0x4b961f,_0x5b0b20){return db['WhatsappAccount'][_0xf228('0x61')]({'where':{'id':_0x1d2cb7[_0xf228('0x58')]['id']}})['then'](handleEntityNotFound(_0x4b961f,null))[_0xf228('0x1f')](function(_0x491cef){if(_0x491cef){return _0x491cef[_0xf228('0x75')](_0x1d2cb7[_0xf228('0x41')][_0xf228('0x6b')])[_0xf228('0x1f')](function(){if(_['isArray'](_0x1d2cb7[_0xf228('0x41')][_0xf228('0x6b')])){for(var _0x158260=0x0;_0x158260<_0x1d2cb7['query'][_0xf228('0x6b')][_0xf228('0x48')];_0x158260+=0x1){socket[_0xf228('0x73')](_0xf228('0x76'),{'UserId':Number(_0x1d2cb7[_0xf228('0x41')][_0xf228('0x6b')][_0x158260]),'WhatsappAccountId':Number(_0x1d2cb7[_0xf228('0x58')]['id'])});}}else{socket['emit'](_0xf228('0x76'),{'UserId':Number(_0x1d2cb7['query'][_0xf228('0x6b')]),'WhatsappAccountId':Number(_0x1d2cb7['params']['id'])});}});}})[_0xf228('0x1f')](respondWithStatusCode(_0x4b961f,null))[_0xf228('0x2a')](handleError(_0x4b961f,null));};exports[_0xf228('0x77')]=function(_0x1e21a6,_0x148b9a,_0x42c2ca){var _0x4dab75={};var _0x238caf={};var _0x265b05;var _0x5e9019;return db[_0xf228('0x3d')][_0xf228('0x68')]({'where':{'id':_0x1e21a6[_0xf228('0x58')]['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x148b9a,null))[_0xf228('0x1f')](function(_0x44cd8d){if(_0x44cd8d){_0x265b05=_0x44cd8d;_0x238caf[_0xf228('0x45')]=_[_0xf228('0x42')](db['User']['rawAttributes']);_0x238caf['query']=_[_0xf228('0x42')](_0x1e21a6[_0xf228('0x41')]);_0x238caf[_0xf228('0x43')]=_[_0xf228('0x44')](_0x238caf[_0xf228('0x45')],_0x238caf[_0xf228('0x41')]);_0x4dab75[_0xf228('0x46')]=_[_0xf228('0x44')](_0x238caf[_0xf228('0x45')],qs[_0xf228('0x47')](_0x1e21a6[_0xf228('0x41')]['fields']));_0x4dab75[_0xf228('0x46')]=_0x4dab75[_0xf228('0x46')][_0xf228('0x48')]?_0x4dab75[_0xf228('0x46')]:_0x238caf[_0xf228('0x45')];_0x4dab75[_0xf228('0x4c')]=qs[_0xf228('0x4d')](_0x1e21a6[_0xf228('0x41')]['sort']);_0x4dab75[_0xf228('0x4e')]=qs[_0xf228('0x43')](_['pick'](_0x1e21a6[_0xf228('0x41')],_0x238caf[_0xf228('0x43')]));if(_0x1e21a6[_0xf228('0x41')][_0xf228('0x50')]){_0x4dab75[_0xf228('0x4e')]=_[_0xf228('0x51')](_0x4dab75[_0xf228('0x4e')],{'$or':_[_0xf228('0x40')](_0x4dab75[_0xf228('0x46')],function(_0x54786d){var _0x1de311={};_0x1de311[_0x54786d]={'$like':'%'+_0x1e21a6['query'][_0xf228('0x50')]+'%'};return _0x1de311;})});}_0x4dab75=_[_0xf228('0x51')]({},_0x4dab75,_0x1e21a6[_0xf228('0x53')]);return _0x265b05['getAgents'](_0x4dab75);}})['then'](function(_0x30d67a){if(_0x30d67a){_0x5e9019=_0x30d67a[_0xf228('0x48')];if(!_0x1e21a6[_0xf228('0x41')][_0xf228('0x49')]('nolimit')){_0x4dab75['limit']=qs[_0xf228('0x4b')](_0x1e21a6[_0xf228('0x41')][_0xf228('0x4b')]);_0x4dab75[_0xf228('0x2f')]=qs['offset'](_0x1e21a6[_0xf228('0x41')]['offset']);}return _0x265b05[_0xf228('0x77')](_0x4dab75);}})[_0xf228('0x1f')](function(_0x2540bc){if(_0x2540bc){return _0x2540bc?{'count':_0x5e9019,'rows':_0x2540bc}:null;}})[_0xf228('0x1f')](respondWithResult(_0x148b9a,null))[_0xf228('0x2a')](handleError(_0x148b9a,null));};exports['addApplications']=function(_0x1438d6,_0x497474){var _0x6a048=_0x1438d6[_0xf228('0x58')]['id'];var _0x52c956=_0x1438d6[_0xf228('0x5c')];var _0x730513=0xc8;var _0x37d373=null;return db[_0xf228('0x78')][_0xf228('0x79')]({'isolationLevel':db[_0xf228('0x78')][_0xf228('0x7a')]['ISOLATION_LEVELS'][_0xf228('0x7b')]},function(_0x294350){return db[_0xf228('0x3d')][_0xf228('0x68')]({'where':{'id':_0x6a048},'transaction':_0x294350})[_0xf228('0x1f')](function(_0x1aeeb4){if(_0x1aeeb4){return db['WhatsappApplication'][_0xf228('0x39')]({'where':{'WhatsappAccountId':_0x6a048},'transaction':_0x294350})[_0xf228('0x1f')](function(){var _0x358b0d=_[_0xf228('0x40')](_0x52c956,function(_0xd6f54){_0xd6f54[_0xf228('0x65')]=_0x6a048;return _0xd6f54;});return db['WhatsappApplication'][_0xf228('0x7c')](_0x358b0d,{'transaction':_0x294350});});}else{_0x730513=0x194;_0x37d373=[];}});})[_0xf228('0x1f')](function(){if(_0x730513!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x6a048},'order':_0xf228('0x7d')})[_0xf228('0x1f')](function(_0x42182b){_0x37d373=_0x42182b;});}})['catch'](function(_0x3d4cf0){_0x730513=0x1f4;logger[_0xf228('0x25')](_0x3d4cf0[_0xf228('0x7e')]);if(_0x3d4cf0[_0xf228('0x3a')]){delete _0x3d4cf0[_0xf228('0x3a')];}_0x37d373=_0x3d4cf0;})['finally'](function(){if(_0x37d373===null){_0x497474[_0xf228('0x2b')](_0x730513);}else{if(_0x730513===0x1f4){_0x497474[_0xf228('0x2c')](_0x730513)[_0xf228('0x7f')](_0x37d373);}else{_0x497474[_0xf228('0x2c')](_0x730513)[_0xf228('0x2e')](_0x37d373);}}});};exports[_0xf228('0x80')]=function(_0x1df9a4,_0x291b99,_0x5ab967){var _0x33cd65={};var _0x15aebc={};var _0x5c5683;var _0xa5f73d;return db[_0xf228('0x3d')][_0xf228('0x68')]({'where':{'id':_0x1df9a4[_0xf228('0x58')]['id']}})[_0xf228('0x1f')](handleEntityNotFound(_0x291b99,null))[_0xf228('0x1f')](function(_0x470f49){if(_0x470f49){_0x5c5683=_0x470f49;_0x15aebc[_0xf228('0x45')]=_[_0xf228('0x42')](db[_0xf228('0x81')][_0xf228('0x59')]);_0x15aebc[_0xf228('0x41')]=_[_0xf228('0x42')](_0x1df9a4['query']);_0x15aebc[_0xf228('0x43')]=_['intersection'](_0x15aebc['model'],_0x15aebc[_0xf228('0x41')]);_0x33cd65['attributes']=_['intersection'](_0x15aebc[_0xf228('0x45')],qs[_0xf228('0x47')](_0x1df9a4['query']['fields']));_0x33cd65[_0xf228('0x46')]=_0x33cd65['attributes'][_0xf228('0x48')]?_0x33cd65['attributes']:_0x15aebc[_0xf228('0x45')];_0x33cd65[_0xf228('0x4c')]=qs['sort'](_0x1df9a4['query'][_0xf228('0x4d')]);_0x33cd65[_0xf228('0x4e')]=qs[_0xf228('0x43')](_[_0xf228('0x4f')](_0x1df9a4[_0xf228('0x41')],_0x15aebc[_0xf228('0x43')]));if(_0x1df9a4[_0xf228('0x41')][_0xf228('0x50')]){_0x33cd65[_0xf228('0x4e')]=_[_0xf228('0x51')](_0x33cd65[_0xf228('0x4e')],{'$or':_[_0xf228('0x40')](_0x33cd65['attributes'],function(_0x394c5b){var _0x145783={};_0x145783[_0x394c5b]={'$like':'%'+_0x1df9a4['query'][_0xf228('0x50')]+'%'};return _0x145783;})});}_0x33cd65=_[_0xf228('0x51')]({},_0x33cd65,_0x1df9a4[_0xf228('0x53')]);return _0x5c5683[_0xf228('0x80')](_0x33cd65);}})[_0xf228('0x1f')](function(_0x405635){if(_0x405635){_0xa5f73d=_0x405635[_0xf228('0x48')];if(!_0x1df9a4[_0xf228('0x41')][_0xf228('0x49')](_0xf228('0x4a'))){_0x33cd65[_0xf228('0x4b')]=qs[_0xf228('0x4b')](_0x1df9a4[_0xf228('0x41')][_0xf228('0x4b')]);_0x33cd65['offset']=qs[_0xf228('0x2f')](_0x1df9a4[_0xf228('0x41')][_0xf228('0x2f')]);}return _0x5c5683[_0xf228('0x80')](_0x33cd65);}})[_0xf228('0x1f')](function(_0x1e6454){if(_0x1e6454){return _0x1e6454?{'count':_0xa5f73d,'rows':_0x1e6454}:null;}})[_0xf228('0x1f')](respondWithResult(_0x291b99,null))['catch'](handleError(_0x291b99,null));};exports['notify']=function(_0x147b07,_0x59d5bd,_0x142fdc){var _0x29dec5={'channel':'whatsapp'};var _0x557016=[];var _0x219134=[];var _0x4a1ae8={};return db['WhatsappAccount']['find']({'where':{'id':_0x147b07[_0xf228('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xf228('0x82')}]})[_0xf228('0x1f')](handleEntityNotFound(_0x59d5bd,null))['then'](function(_0x4823bc){_0x29dec5['account']=_0x4823bc;if(_0x29dec5[_0xf228('0x83')]&&_0x29dec5['account'][_0xf228('0x84')]===_0xf228('0x85')&&_0x147b07['body'][_0xf228('0x86')]){if(_0x147b07['body']['statuses'][_0xf228('0x48')]===0x0)return;if(_0x147b07['body'][_0xf228('0x86')][0x0]['state']!==_0xf228('0x87'))return;return db['WhatsappMessage'][_0xf228('0x35')]({'read':!![],'readAt':_0x147b07[_0xf228('0x5c')][_0xf228('0x86')][0x0][_0xf228('0x88')]},{'where':{'messageId':_0x147b07[_0xf228('0x5c')][_0xf228('0x86')][0x0][_0xf228('0x89')]},'individualHooks':!![]})['then'](function(_0x523810){return _0x59d5bd[_0xf228('0x2c')](0xc8)[_0xf228('0x2e')](_0x523810);});}_0x29dec5[_0xf228('0x8a')]=_[_0xf228('0x8b')](_0x4823bc[_0xf228('0x82')],[_0xf228('0x7d')],[_0xf228('0x8c')]);if(_0x29dec5[_0xf228('0x83')][_0xf228('0x82')]){delete _0x29dec5[_0xf228('0x83')][_0xf228('0x82')];}return db[_0xf228('0x8d')][_0xf228('0x8e')]()[_0xf228('0x1f')](function(_0xe6fac0){if(!_0xe6fac0){throw new db[(_0xf228('0x8f'))][(_0xf228('0x90'))]('no\x20available\x20attributes');}_0x557016=_[_0xf228('0x91')](_['keys'](_0xe6fac0),[_0xf228('0x92'),_0xf228('0x93')]);_0x219134=_[_0xf228('0x91')](_[_0xf228('0x42')](_0xe6fac0),[_0xf228('0x92'),_0xf228('0x93'),_0xf228('0x94'),_0xf228('0x95')]);_0x29dec5[_0xf228('0x5c')]={'mapKey':_0xf228('0x96')};if(_0x29dec5[_0xf228('0x83')]&&_0x29dec5[_0xf228('0x83')][_0xf228('0x84')]==='twilio'){_0x29dec5[_0xf228('0x5c')][_0xf228('0x97')]=_0x147b07['body'][_0xf228('0x98')]['replace']('whatsapp:','');_0x29dec5[_0xf228('0x5c')]['body']=_0x147b07[_0xf228('0x5c')]['Body'];_0x29dec5[_0xf228('0x5c')][_0xf228('0x99')]=_0x147b07[_0xf228('0x5c')][_0xf228('0x9a')];}if(_0x29dec5[_0xf228('0x83')]&&_0x29dec5[_0xf228('0x83')][_0xf228('0x84')]===_0xf228('0x85')){_0x29dec5[_0xf228('0x5c')][_0xf228('0x97')]=_0x147b07['body'][_0xf228('0x9b')][0x0][_0xf228('0x97')];_0x29dec5[_0xf228('0x5c')][_0xf228('0x5c')]=_0x147b07['body'][_0xf228('0x9b')][0x0][_0xf228('0x27')][_0xf228('0x5c')];_0x29dec5[_0xf228('0x5c')]['messageId']=_0x147b07[_0xf228('0x5c')][_0xf228('0x9b')][0x0][_0xf228('0x89')];}if(_0x29dec5['body']['id']){delete _0x29dec5[_0xf228('0x5c')]['id'];}if(_['isNil'](_0x29dec5[_0xf228('0x5c')][_0xf228('0x97')])){throw new db['Sequelize']['ValidationError'](_0xf228('0x9c'));}if(_[_0xf228('0x9d')](_0x29dec5[_0xf228('0x5c')]['body'])||_0x29dec5['body'][_0xf228('0x5c')]===''){throw new db[(_0xf228('0x8f'))][(_0xf228('0x90'))](_0xf228('0x9e'));}if(_[_0xf228('0x9d')](_0x29dec5['body']['mapKey'])){throw new db[(_0xf228('0x8f'))]['ValidationError'](_0xf228('0x9f')+_0x219134);}if(!_[_0xf228('0xa0')](_0x219134,_0x29dec5[_0xf228('0x5c')][_0xf228('0xa1')])){throw new db[(_0xf228('0x8f'))][(_0xf228('0x90'))](_0xf228('0xa2')+_0x219134);}_0x4a1ae8[_0x29dec5['body'][_0xf228('0xa1')]]=_0x29dec5[_0xf228('0x5c')][_0xf228('0x97')];return db[_0xf228('0xa3')]['find']({'where':{'id':_0x29dec5['account'][_0xf228('0x95')]},'include':[{'model':db[_0xf228('0x8d')],'as':_0xf228('0xa4'),'where':_0x4a1ae8,'limit':0x1,'order':[[_0xf228('0x93'),_0xf228('0xa5')]]}]});})[_0xf228('0x1f')](handleEntityNotFound(_0x59d5bd,null))['then'](function(_0x2f60f1){if(_0x2f60f1){_0x29dec5[_0xf228('0xa6')]=_[_0xf228('0x71')](_0x2f60f1,[_0xf228('0xa4')]);if(_0x2f60f1[_0xf228('0xa4')][_0xf228('0x48')]){return _0x2f60f1['Contacts'][0x0];}var _0x5b1d5c=_['defaults'](_0x29dec5[_0xf228('0x5c')],{'firstName':_0x29dec5['body'][_0xf228('0x97')],'ListId':_0x2f60f1['id']});_0x5b1d5c[_0x29dec5[_0xf228('0x5c')][_0xf228('0xa1')]]=_0x29dec5[_0xf228('0x5c')][_0xf228('0x97')];return db['CmContact'][_0xf228('0x5b')](_0x5b1d5c,{'fields':_0x557016,'raw':!![]});}})[_0xf228('0x1f')](handleEntityNotFound(_0x59d5bd,null))['then'](function(_0x4cc9d6){if(_0x4cc9d6){_0x29dec5[_0xf228('0xa7')]=_0x4cc9d6;var _0x34a1ba={'ContactId':_0x4cc9d6['id'],'phone':_0x29dec5['body'][_0xf228('0x97')],'WhatsappAccountId':_0x147b07['params']['id']};var _0x149663={'ContactId':_0x4cc9d6['id'],'WhatsappAccountId':_0x147b07[_0xf228('0x58')]['id'],'closed':![]};return db[_0xf228('0xa8')][_0xf228('0x61')]({'where':_0x149663})[_0xf228('0x1f')](function(_0x14e219){if(_0x14e219){return[_0x14e219,![]];}return db[_0xf228('0xa8')]['create'](_0x34a1ba)[_0xf228('0x1f')](function(_0x4c509f){return[_0x4c509f,!![]];});});}})[_0xf228('0x72')](function(_0x43d3f2,_0x1dfedb){_0x29dec5[_0xf228('0xa9')]=_0x43d3f2[_0xf228('0x36')]({'plain':!![]});_0x29dec5[_0xf228('0xa9')][_0xf228('0xaa')]=![];if(_0x1dfedb){if(_0x29dec5[_0xf228('0x83')]['autoclose']){_0x29dec5[_0xf228('0x8a')][_0xf228('0xab')]({'id':0x0,'priority':_0x29dec5['applications']['length']+0x1,'app':'close','appdata':_0xf228('0xac'),'interval':_0xf228('0xad')});}_0x29dec5[_0xf228('0xa9')]['created']=!![];}return db[_0xf228('0xae')][_0xf228('0x5b')]({'phone':_0x29dec5[_0xf228('0x5c')][_0xf228('0x97')],'messageId':_0x29dec5[_0xf228('0x5c')][_0xf228('0x99')],'body':_0x29dec5[_0xf228('0x5c')][_0xf228('0x5c')],'WhatsappAccountId':_0x147b07[_0xf228('0x58')]['id'],'WhatsappInteractionId':_0x43d3f2['id'],'direction':'in','ContactId':_0x43d3f2[_0xf228('0xaf')],'AttachmentId':_0x29dec5['body'][_0xf228('0xb0')]});})[_0xf228('0x1f')](function(_0x1bde05){_0x29dec5[_0xf228('0x27')]=_0x1bde05;if(!_0x29dec5[_0xf228('0xa9')][_0xf228('0xb1')])return;return db['User'][_0xf228('0x61')]({'attributes':['id',_0xf228('0x3a')],'where':{'id':_0x29dec5['interaction'][_0xf228('0xb1')]}});})[_0xf228('0x1f')](function(_0x1b12a5){if(_0x1b12a5){_0x29dec5[_0xf228('0x8a')][_0xf228('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1b12a5[_0xf228('0x3a')]+','+(_0x29dec5['account'][_0xf228('0xb3')]||0xa),'interval':'*,*,*,*'});}if(!_0x29dec5['interaction']['queueId'])return;return db[_0xf228('0xb4')]['find']({'attributes':['id',_0xf228('0x3a')],'where':{'id':_0x29dec5[_0xf228('0xa9')][_0xf228('0xb5')]}});})[_0xf228('0x1f')](function(_0x4624eb){if(_0x4624eb){_0x29dec5['applications'][_0xf228('0xb2')]({'id':0x0,'priority':0x1,'app':_0xf228('0xb6'),'appdata':_0x4624eb[_0xf228('0x3a')]+','+(_0x29dec5[_0xf228('0x83')][_0xf228('0xb7')]||0x12c),'interval':_0xf228('0xad')});}return respondWithRpcPromise('Start',_0xf228('0xb8'),_0x29dec5);})[_0xf228('0x1f')](function(_0x2357f3){if(_0x2357f3){var _0x2c4baa=0xc8;var _0x4a03c0='receiveMessage';logger['info'](_0xf228('0x23'),_0x4a03c0,_0x2c4baa,'entity\x20found');logger[_0xf228('0x22')](_0xf228('0xb9'),_0x4a03c0,_0x2c4baa,'entity\x20found',JSON[_0xf228('0x24')](_0x2357f3));if(_0x29dec5[_0xf228('0x83')][_0xf228('0x84')]===_0xf228('0xba')){return _0x59d5bd[_0xf228('0x2c')](_0x2c4baa)[_0xf228('0x30')]('Content-Type',_0xf228('0xbb'))[_0xf228('0x7f')](_0xf228('0xbc'));}else{return _0x59d5bd['status'](_0x2c4baa)[_0xf228('0x2e')](_0x2357f3);}}});})[_0xf228('0x2a')](handleError(_0x59d5bd,null));};exports[_0xf228('0x7f')]=function(_0x50eede,_0x45dcd8,_0x4d8b05){var _0x18c7bb,_0x2db4ce,_0x4d1cc9;if(_['isNil'](_0x50eede[_0xf228('0x5c')]['body'])||_0x50eede['body'][_0xf228('0x5c')]===''){throw new db[(_0xf228('0x8f'))][(_0xf228('0x90'))](_0xf228('0x9e'));}if(_[_0xf228('0x9d')](_0x50eede[_0xf228('0x5c')]['to'])){throw new db[(_0xf228('0x8f'))][(_0xf228('0x90'))](_0xf228('0xbd'));}_0x18c7bb=_0x50eede[_0xf228('0x5c')]['to'];return db['WhatsappAccount'][_0xf228('0x61')]({'where':{'id':_0x50eede[_0xf228('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xf228('0xbe'),'include':[{'model':db['CmContact'],'as':_0xf228('0xa4'),'where':{'mobile':_0x18c7bb},'limit':0x1,'order':[[_0xf228('0x93'),'DESC']]}]}]})[_0xf228('0x1f')](handleEntityNotFound(_0x45dcd8,null))[_0xf228('0x1f')](function(_0x4e0bc2){if(_0x4e0bc2&&_0x4e0bc2['List']){_0x2db4ce=_0x4e0bc2['get']({'plain':!![]});if(_0x2db4ce['List']&&_0x2db4ce['List']['Contacts'][_0xf228('0x48')]){return _0x2db4ce[_0xf228('0xbe')]['Contacts'][0x0];}return db['CmContact'][_0xf228('0x5b')](_[_0xf228('0x19')](_0x50eede[_0xf228('0x5c')],{'firstName':_0x18c7bb,'mobile':_0x18c7bb,'phone':_0x18c7bb,'ListId':_0x2db4ce['ListId']}));}})[_0xf228('0x1f')](handleEntityNotFound(_0x45dcd8,null))['then'](function(_0x326a05){if(_0x326a05){_0x4d1cc9=_0x326a05;return db[_0xf228('0xa8')][_0xf228('0x61')]({'where':{'ContactId':_0x4d1cc9['id'],'closed':![],'WhatsappAccountId':_0x2db4ce['id']}})['then'](function(_0x52261b){if(_0x52261b){return[_0x52261b,![]];}return db[_0xf228('0xa8')][_0xf228('0x5b')]({'UserId':_0x50eede[_0xf228('0x5d')]['id'],'ContactId':_0x4d1cc9['id'],'WhatsappAccountId':_0x2db4ce['id'],'phone':_0x18c7bb,'firstMsgDirection':_0xf228('0xbf'),'Messages':[_['merge'](_0x50eede[_0xf228('0x5c')],{'read':![],'body':_0x50eede[_0xf228('0x5c')][_0xf228('0x5c')],'phone':_0x18c7bb,'WhatsappAccountId':_0x2db4ce['id'],'UserId':_0x50eede[_0xf228('0x5d')]['id'],'ContactId':_0x4d1cc9['id']})]},{'include':[{'model':db[_0xf228('0xae')],'as':_0xf228('0xc0')}]})['then'](function(_0x383c07){return[_0x383c07,!![]];});});}})[_0xf228('0x72')](function(_0x451252,_0x2ba471){if(_0x2ba471){return _0x451252;}return db['WhatsappMessage'][_0xf228('0x5b')](_[_0xf228('0x51')](_0x50eede[_0xf228('0x5c')],{'read':![],'body':_0x50eede[_0xf228('0x5c')][_0xf228('0x5c')],'phone':_0x18c7bb,'WhatsappAccountId':_0x2db4ce['id'],'WhatsappInteractionId':_0x451252['id'],'UserId':_0x50eede['user']['id'],'ContactId':_0x4d1cc9['id']}))[_0xf228('0x1f')](function(_0x13a175){_0x451252[_0xf228('0xc1')][_0xf228('0xc0')]=[];_0x451252[_0xf228('0xc1')][_0xf228('0xc0')][_0xf228('0xab')](_0x13a175[_0xf228('0xc1')]);return _0x451252;});})[_0xf228('0x1f')](respondWithResult(_0x45dcd8,null))[_0xf228('0x2a')](handleError(_0x45dcd8,null));}; \ No newline at end of file +var _0xe813=['MessageSid','from','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','WhatsappInteraction','created','autoclose','push','close','unmanaged','WhatsappMessage','ContactId','interaction','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','queueId','WhatsappQueue','waitForTheAssignedQueue','Start','receiveMessage','entity\x20found','debug','Content-Type','List','defaults','out','dataValues','Messages','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','findOne','rawAttributes','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','send','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId'];(function(_0x172019,_0x1e710e){var _0x32be7a=function(_0x461550){while(--_0x461550){_0x172019['push'](_0x172019['shift']());}};_0x32be7a(++_0x1e710e);}(_0xe813,0x1b2));var _0x3e81=function(_0xae1364,_0x44863f){_0xae1364=_0xae1364-0x0;var _0x55104f=_0xe813[_0xae1364];return _0x55104f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e81('0x0'));var zipdir=require(_0x3e81('0x1'));var jsonpatch=require(_0x3e81('0x2'));var rp=require('request-promise');var moment=require(_0x3e81('0x3'));var BPromise=require(_0x3e81('0x4'));var Mustache=require(_0x3e81('0x5'));var util=require(_0x3e81('0x6'));var path=require(_0x3e81('0x7'));var sox=require('sox');var csv=require(_0x3e81('0x8'));var ejs=require(_0x3e81('0x9'));var fs=require('fs');var fs_extra=require(_0x3e81('0xa'));var _=require(_0x3e81('0xb'));var squel=require('squel');var crypto=require(_0x3e81('0xc'));var jsforce=require(_0x3e81('0xd'));var deskjs=require(_0x3e81('0xe'));var toCsv=require(_0x3e81('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e81('0xf'));var authService=require(_0x3e81('0x10'));var qs=require(_0x3e81('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e81('0x12'))(_0x3e81('0x13'));var utils=require(_0x3e81('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3e81('0x15'));var db=require('../../mysqldb')['db'];config[_0x3e81('0x16')]=_['defaults'](config[_0x3e81('0x16')],{'host':_0x3e81('0x17'),'port':0x18eb});var socket=require(_0x3e81('0x18'))(new Redis(config[_0x3e81('0x16')]));require(_0x3e81('0x19'))[_0x3e81('0x1a')](socket);var jayson=require(_0x3e81('0x1b'));var client=jayson['client'][_0x3e81('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x3e6546,_0x12fd16,_0x1386ee,_0x30795a){return new BPromise(function(_0x2b9716,_0x50a791){var _0x1f3e3f=_0x30795a||client;return _0x1f3e3f[_0x3e81('0x1d')](_0x3e6546,_0x1386ee)[_0x3e81('0x1e')](function(_0x8c2450){logger[_0x3e81('0x1f')](_0x3e81('0x20'),_0x12fd16,_0x3e81('0x21'));logger['debug'](_0x3e81('0x22'),_0x12fd16,_0x3e81('0x21'),JSON[_0x3e81('0x23')](_0x8c2450));if(_0x8c2450[_0x3e81('0x24')]){if(_0x8c2450[_0x3e81('0x24')][_0x3e81('0x25')]===0x1f4){logger[_0x3e81('0x24')](_0x3e81('0x20'),_0x12fd16,_0x8c2450['error'][_0x3e81('0x26')]);return _0x50a791(_0x8c2450[_0x3e81('0x24')]['message']);}logger['error'](_0x3e81('0x20'),_0x12fd16,_0x8c2450[_0x3e81('0x24')]['message']);return _0x2b9716(_0x8c2450[_0x3e81('0x24')][_0x3e81('0x26')]);}else{logger[_0x3e81('0x1f')](_0x3e81('0x20'),_0x12fd16,_0x3e81('0x21'));_0x2b9716(_0x8c2450['result'][_0x3e81('0x26')]);}})['catch'](function(_0x573154){logger[_0x3e81('0x24')](_0x3e81('0x20'),_0x12fd16,_0x573154);_0x50a791(_0x573154);});});}function respondWithStatusCode(_0x134a4b,_0x2555f2){_0x2555f2=_0x2555f2||0xcc;return function(_0xf52483){if(_0xf52483){return _0x134a4b[_0x3e81('0x27')](_0x2555f2);}return _0x134a4b[_0x3e81('0x28')](_0x2555f2)['end']();};}function respondWithResult(_0x3128a5,_0x3fbe18){_0x3fbe18=_0x3fbe18||0xc8;return function(_0x1b5a9f){if(_0x1b5a9f){return _0x3128a5[_0x3e81('0x28')](_0x3fbe18)['json'](_0x1b5a9f);}};}function respondWithFilteredResult(_0x2da53f,_0x17b7fa){return function(_0x10c458){if(_0x10c458){var _0x23d71e=typeof _0x17b7fa[_0x3e81('0x29')]===_0x3e81('0x2a')&&typeof _0x17b7fa[_0x3e81('0x2b')]===_0x3e81('0x2a');var _0x2eef71=_0x10c458[_0x3e81('0x2c')];var _0x5d7be0=_0x23d71e?0x0:_0x17b7fa['offset'];var _0x56c92b=_0x23d71e?_0x10c458[_0x3e81('0x2c')]:_0x17b7fa[_0x3e81('0x29')]+_0x17b7fa[_0x3e81('0x2b')];var _0x4dc9a3;if(_0x56c92b>=_0x2eef71){_0x56c92b=_0x2eef71;_0x4dc9a3=0xc8;}else{_0x4dc9a3=0xce;}_0x2da53f['status'](_0x4dc9a3);return _0x2da53f[_0x3e81('0x2d')]('Content-Range',_0x5d7be0+'-'+_0x56c92b+'/'+_0x2eef71)[_0x3e81('0x2e')](_0x10c458);}return null;};}function patchUpdates(_0x39943f){return function(_0x1f9c60){try{jsonpatch['apply'](_0x1f9c60,_0x39943f,!![]);}catch(_0x6f3d1b){return BPromise[_0x3e81('0x2f')](_0x6f3d1b);}return _0x1f9c60[_0x3e81('0x30')]();};}function saveUpdates(_0x385ba3,_0x58da87){return function(_0x533792){if(_0x533792){return _0x533792[_0x3e81('0x31')](_0x385ba3)['then'](function(_0x492c0c){return _0x492c0c;});}return null;};}function removeEntity(_0x2b64e7,_0x48a6d9){return function(_0x2642b1){if(_0x2642b1){return _0x2642b1[_0x3e81('0x32')]()[_0x3e81('0x1e')](function(){var _0x798e3c=_0x2642b1[_0x3e81('0x33')]({'plain':!![]});var _0x264524=_0x3e81('0x34');return db[_0x3e81('0x35')][_0x3e81('0x32')]({'where':{'type':_0x264524,'resourceId':_0x798e3c['id']}})[_0x3e81('0x1e')](function(){return _0x2642b1;});})[_0x3e81('0x1e')](function(){_0x2b64e7[_0x3e81('0x28')](0xcc)[_0x3e81('0x36')]();});}};}function handleEntityNotFound(_0xbf99d3,_0x5ddf94){return function(_0xe09b09){if(!_0xe09b09){_0xbf99d3['sendStatus'](0x194);}return _0xe09b09;};}function handleError(_0x35daec,_0x41c186){_0x41c186=_0x41c186||0x1f4;return function(_0x649c23){logger[_0x3e81('0x24')](_0x649c23[_0x3e81('0x37')]);if(_0x649c23[_0x3e81('0x38')]){delete _0x649c23[_0x3e81('0x38')];}_0x35daec[_0x3e81('0x28')](_0x41c186)['send'](_0x649c23);};}exports[_0x3e81('0x39')]=function(_0x55efd8,_0x4e44d5){var _0x57d8d6={'include':[{'model':db[_0x3e81('0x3a')],'as':_0x3e81('0x3b')}]},_0x5ec2c8={},_0x417c8b={'count':0x0,'rows':[]};var _0x4f28ce=_[_0x3e81('0x3c')](db[_0x3e81('0x3d')]['rawAttributes'],function(_0x3df116){return{'name':_0x3df116[_0x3e81('0x3e')],'type':_0x3df116[_0x3e81('0x3f')][_0x3e81('0x40')]};});_0x5ec2c8[_0x3e81('0x41')]=_[_0x3e81('0x3c')](_0x4f28ce,'name');_0x5ec2c8[_0x3e81('0x42')]=_[_0x3e81('0x43')](_0x55efd8[_0x3e81('0x42')]);_0x5ec2c8[_0x3e81('0x44')]=_[_0x3e81('0x45')](_0x5ec2c8['model'],_0x5ec2c8['query']);_0x57d8d6['attributes']=_[_0x3e81('0x45')](_0x5ec2c8[_0x3e81('0x41')],qs[_0x3e81('0x46')](_0x55efd8[_0x3e81('0x42')]['fields']));_0x57d8d6[_0x3e81('0x47')]=_0x57d8d6[_0x3e81('0x47')][_0x3e81('0x48')]?_0x57d8d6[_0x3e81('0x47')]:_0x5ec2c8[_0x3e81('0x41')];if(!_0x55efd8[_0x3e81('0x42')][_0x3e81('0x49')](_0x3e81('0x4a'))){_0x57d8d6[_0x3e81('0x2b')]=qs[_0x3e81('0x2b')](_0x55efd8[_0x3e81('0x42')]['limit']);_0x57d8d6[_0x3e81('0x29')]=qs[_0x3e81('0x29')](_0x55efd8[_0x3e81('0x42')]['offset']);}_0x57d8d6[_0x3e81('0x4b')]=qs[_0x3e81('0x4c')](_0x55efd8[_0x3e81('0x42')][_0x3e81('0x4c')]);_0x57d8d6[_0x3e81('0x4d')]=qs['filters'](_[_0x3e81('0x4e')](_0x55efd8['query'],_0x5ec2c8[_0x3e81('0x44')]),_0x4f28ce);if(_0x55efd8[_0x3e81('0x42')][_0x3e81('0x4f')]){_0x57d8d6[_0x3e81('0x4d')]=_[_0x3e81('0x50')](_0x57d8d6['where'],{'$or':_[_0x3e81('0x3c')](_0x4f28ce,function(_0x3ab350){if(_0x3ab350[_0x3e81('0x3f')]!==_0x3e81('0x51')){var _0xd6a5ae={};_0xd6a5ae[_0x3ab350['name']]={'$like':'%'+_0x55efd8['query'][_0x3e81('0x4f')]+'%'};return _0xd6a5ae;}})});}_0x57d8d6=_[_0x3e81('0x50')]({},_0x57d8d6,_0x55efd8[_0x3e81('0x52')]);var _0x4473a9={'where':_0x57d8d6[_0x3e81('0x4d')]};return db['WhatsappAccount']['count'](_0x4473a9)[_0x3e81('0x1e')](function(_0x3f4cc8){_0x417c8b['count']=_0x3f4cc8;if(_0x55efd8[_0x3e81('0x42')][_0x3e81('0x53')]){_0x57d8d6['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x3e81('0x54')](_0x57d8d6);})[_0x3e81('0x1e')](function(_0x33afcf){_0x417c8b[_0x3e81('0x55')]=_0x33afcf;return _0x417c8b;})[_0x3e81('0x1e')](respondWithFilteredResult(_0x4e44d5,_0x57d8d6))[_0x3e81('0x56')](handleError(_0x4e44d5,null));};exports[_0x3e81('0x57')]=function(_0x44b238,_0x4bebd2){var _0xa23427={'raw':![],'where':{'id':_0x44b238[_0x3e81('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x3e81('0x3b')}]},_0xec042c={};_0xec042c[_0x3e81('0x41')]=_[_0x3e81('0x43')](db[_0x3e81('0x3d')]['rawAttributes']);_0xec042c[_0x3e81('0x42')]=_[_0x3e81('0x43')](_0x44b238[_0x3e81('0x42')]);_0xec042c[_0x3e81('0x44')]=_[_0x3e81('0x45')](_0xec042c[_0x3e81('0x41')],_0xec042c[_0x3e81('0x42')]);_0xa23427[_0x3e81('0x47')]=_['intersection'](_0xec042c[_0x3e81('0x41')],qs[_0x3e81('0x46')](_0x44b238['query'][_0x3e81('0x46')]));_0xa23427[_0x3e81('0x47')]=_0xa23427[_0x3e81('0x47')][_0x3e81('0x48')]?_0xa23427[_0x3e81('0x47')]:_0xec042c[_0x3e81('0x41')];if(_0x44b238[_0x3e81('0x42')]['includeAll']){_0xa23427[_0x3e81('0x59')]=[{'all':!![]}];}_0xa23427=_[_0x3e81('0x50')]({},_0xa23427,_0x44b238[_0x3e81('0x52')]);return db[_0x3e81('0x3d')][_0x3e81('0x5a')](_0xa23427)[_0x3e81('0x1e')](handleEntityNotFound(_0x4bebd2,null))['then'](respondWithResult(_0x4bebd2,null))[_0x3e81('0x56')](handleError(_0x4bebd2,null));};exports[_0x3e81('0x5b')]=function(_0x475ea7,_0x101782){return db['WhatsappAccount'][_0x3e81('0x5b')](_0x475ea7[_0x3e81('0x5c')],{})[_0x3e81('0x1e')](function(_0xddb3ef){var _0x41c700=_0x475ea7[_0x3e81('0x5d')]['get']({'plain':!![]});if(!_0x41c700)throw new Error(_0x3e81('0x5e'));if(_0x41c700[_0x3e81('0x5f')]===_0x3e81('0x5d')){var _0x599d57=_0xddb3ef[_0x3e81('0x33')]({'plain':!![]});var _0x530cf2=_0x3e81('0x34');return db[_0x3e81('0x60')][_0x3e81('0x5a')]({'where':{'name':_0x530cf2,'userProfileId':_0x41c700[_0x3e81('0x61')]},'raw':!![]})[_0x3e81('0x1e')](function(_0x29ae08){if(_0x29ae08&&_0x29ae08[_0x3e81('0x62')]===0x0){return db['UserProfileResource'][_0x3e81('0x5b')]({'name':_0x599d57['name'],'resourceId':_0x599d57['id'],'type':_0x29ae08[_0x3e81('0x38')],'sectionId':_0x29ae08['id']},{})[_0x3e81('0x1e')](function(){return _0xddb3ef;});}else{return _0xddb3ef;}})[_0x3e81('0x56')](function(_0x514c87){logger[_0x3e81('0x24')](_0x3e81('0x63'),_0x514c87);throw _0x514c87;});}return _0xddb3ef;})['then'](respondWithResult(_0x101782,0xc9))[_0x3e81('0x56')](handleError(_0x101782,null));};exports[_0x3e81('0x31')]=function(_0x500fec,_0x470d08){if(_0x500fec[_0x3e81('0x5c')]['id']){delete _0x500fec[_0x3e81('0x5c')]['id'];}return db[_0x3e81('0x3d')]['find']({'where':{'id':_0x500fec[_0x3e81('0x58')]['id']},'include':[{'model':db[_0x3e81('0x3a')],'as':_0x3e81('0x3b')}]})['then'](handleEntityNotFound(_0x470d08,null))[_0x3e81('0x1e')](saveUpdates(_0x500fec[_0x3e81('0x5c')],null))['then'](respondWithResult(_0x470d08,null))[_0x3e81('0x56')](handleError(_0x470d08,null));};exports['destroy']=function(_0x1f341c,_0x7e26c1){return db[_0x3e81('0x3d')][_0x3e81('0x5a')]({'where':{'id':_0x1f341c['params']['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x7e26c1,null))[_0x3e81('0x1e')](removeEntity(_0x7e26c1,null))[_0x3e81('0x56')](handleError(_0x7e26c1,null));};exports[_0x3e81('0x64')]=function(_0x449427,_0x11798a){return db['WhatsappAccount'][_0x3e81('0x64')]()[_0x3e81('0x1e')](respondWithResult(_0x11798a,null))[_0x3e81('0x56')](handleError(_0x11798a,null));};exports[_0x3e81('0x65')]=function(_0x3b7a77,_0x34719c,_0x3fc326){if(_0x3b7a77[_0x3e81('0x5c')]['id']){delete _0x3b7a77[_0x3e81('0x5c')]['id'];}return db[_0x3e81('0x3d')][_0x3e81('0x5a')]({'where':{'id':_0x3b7a77[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x34719c,null))[_0x3e81('0x1e')](function(_0x26e5f3){if(_0x26e5f3){_0x3b7a77[_0x3e81('0x5c')][_0x3e81('0x66')]=_0x26e5f3['id'];return db[_0x3e81('0x67')][_0x3e81('0x5b')](_0x3b7a77[_0x3e81('0x5c')]);}})[_0x3e81('0x1e')](respondWithResult(_0x34719c,null))[_0x3e81('0x56')](handleError(_0x34719c,null));};exports['getDispositions']=function(_0x326282,_0xbccd8c,_0x39e248){var _0x55071d={'raw':![],'where':{}};var _0x125fc7={};var _0x186a79={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x3e81('0x68')]({'where':{'id':_0x326282[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0xbccd8c,null))[_0x3e81('0x1e')](function(_0xc3983b){if(_0xc3983b){_0x125fc7['model']=_[_0x3e81('0x43')](db[_0x3e81('0x67')][_0x3e81('0x69')]);_0x125fc7[_0x3e81('0x42')]=_['keys'](_0x326282['query']);_0x125fc7[_0x3e81('0x44')]=_[_0x3e81('0x45')](_0x125fc7[_0x3e81('0x41')],_0x125fc7['query']);_0x55071d[_0x3e81('0x47')]=_['intersection'](_0x125fc7[_0x3e81('0x41')],qs[_0x3e81('0x46')](_0x326282[_0x3e81('0x42')]['fields']));_0x55071d[_0x3e81('0x47')]=_0x55071d[_0x3e81('0x47')][_0x3e81('0x48')]?_0x55071d[_0x3e81('0x47')]:_0x125fc7[_0x3e81('0x41')];if(!_0x326282[_0x3e81('0x42')][_0x3e81('0x49')](_0x3e81('0x4a'))){_0x55071d[_0x3e81('0x2b')]=qs[_0x3e81('0x2b')](_0x326282['query'][_0x3e81('0x2b')]);_0x55071d[_0x3e81('0x29')]=qs[_0x3e81('0x29')](_0x326282[_0x3e81('0x42')][_0x3e81('0x29')]);}_0x55071d[_0x3e81('0x4b')]=qs[_0x3e81('0x4c')](_0x326282['query'][_0x3e81('0x4c')]);_0x55071d[_0x3e81('0x4d')]=qs[_0x3e81('0x44')](_['pick'](_0x326282[_0x3e81('0x42')],_0x125fc7['filters']));_0x55071d[_0x3e81('0x4d')]['WhatsappAccountId']=_0xc3983b['id'];if(_0x326282[_0x3e81('0x42')][_0x3e81('0x4f')]){_0x55071d[_0x3e81('0x4d')]=_['merge'](_0x55071d[_0x3e81('0x4d')],{'$or':_['map'](_0x55071d[_0x3e81('0x47')],function(_0x467090){var _0x52a939={};_0x52a939[_0x467090]={'$like':'%'+_0x326282[_0x3e81('0x42')][_0x3e81('0x4f')]+'%'};return _0x52a939;})});}_0x55071d=_[_0x3e81('0x50')]({},_0x55071d,_0x326282[_0x3e81('0x52')]);return db['Disposition']['count']({'where':_0x55071d[_0x3e81('0x4d')]})[_0x3e81('0x1e')](function(_0x5dd8de){_0x186a79[_0x3e81('0x2c')]=_0x5dd8de;if(_0x326282[_0x3e81('0x42')][_0x3e81('0x53')]){_0x55071d['include']=[{'all':!![]}];}return db['Disposition'][_0x3e81('0x54')](_0x55071d);})[_0x3e81('0x1e')](function(_0x3c5176){_0x186a79[_0x3e81('0x55')]=_0x3c5176;return _0x186a79;});}})[_0x3e81('0x1e')](respondWithFilteredResult(_0xbccd8c,_0x55071d))['catch'](handleError(_0xbccd8c,null));};exports[_0x3e81('0x6a')]=function(_0x314602,_0x1b86bb,_0x1698f6){return db[_0x3e81('0x3d')][_0x3e81('0x5a')]({'where':{'id':_0x314602[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x1b86bb,null))[_0x3e81('0x1e')](function(_0xc446fb){if(_0xc446fb){return _0xc446fb[_0x3e81('0x6a')](_0x314602['query'][_0x3e81('0x6b')]);}})[_0x3e81('0x1e')](respondWithStatusCode(_0x1b86bb,null))[_0x3e81('0x56')](handleError(_0x1b86bb,null));};exports[_0x3e81('0x6c')]=function(_0x3fcc57,_0x15ffa6,_0x52544f){if(_0x3fcc57[_0x3e81('0x5c')]['id']){delete _0x3fcc57[_0x3e81('0x5c')]['id'];}return db[_0x3e81('0x3d')][_0x3e81('0x5a')]({'where':{'id':_0x3fcc57[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x15ffa6,null))[_0x3e81('0x1e')](function(_0x2c27ef){if(_0x2c27ef){_0x3fcc57[_0x3e81('0x5c')]['WhatsappAccountId']=_0x2c27ef['id'];return db[_0x3e81('0x6d')]['create'](_0x3fcc57['body']);}})[_0x3e81('0x1e')](respondWithResult(_0x15ffa6,null))['catch'](handleError(_0x15ffa6,null));};exports[_0x3e81('0x6e')]=function(_0x3e9b1f,_0x903249,_0x5b40ea){var _0x29e284={'raw':![],'where':{}};var _0x4ae2d5={};var _0x1e13f={'count':0x0,'rows':[]};return db[_0x3e81('0x3d')]['findOne']({'where':{'id':_0x3e9b1f['params']['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x903249,null))[_0x3e81('0x1e')](function(_0x1c87b3){if(_0x1c87b3){_0x4ae2d5[_0x3e81('0x41')]=_[_0x3e81('0x43')](db[_0x3e81('0x6d')][_0x3e81('0x69')]);_0x4ae2d5[_0x3e81('0x42')]=_[_0x3e81('0x43')](_0x3e9b1f['query']);_0x4ae2d5[_0x3e81('0x44')]=_[_0x3e81('0x45')](_0x4ae2d5[_0x3e81('0x41')],_0x4ae2d5[_0x3e81('0x42')]);_0x29e284['attributes']=_[_0x3e81('0x45')](_0x4ae2d5[_0x3e81('0x41')],qs[_0x3e81('0x46')](_0x3e9b1f[_0x3e81('0x42')][_0x3e81('0x46')]));_0x29e284[_0x3e81('0x47')]=_0x29e284[_0x3e81('0x47')][_0x3e81('0x48')]?_0x29e284[_0x3e81('0x47')]:_0x4ae2d5['model'];if(!_0x3e9b1f[_0x3e81('0x42')]['hasOwnProperty']('nolimit')){_0x29e284[_0x3e81('0x2b')]=qs[_0x3e81('0x2b')](_0x3e9b1f[_0x3e81('0x42')][_0x3e81('0x2b')]);_0x29e284[_0x3e81('0x29')]=qs['offset'](_0x3e9b1f[_0x3e81('0x42')][_0x3e81('0x29')]);}_0x29e284[_0x3e81('0x4b')]=qs[_0x3e81('0x4c')](_0x3e9b1f[_0x3e81('0x42')][_0x3e81('0x4c')]);_0x29e284[_0x3e81('0x4d')]=qs['filters'](_[_0x3e81('0x4e')](_0x3e9b1f[_0x3e81('0x42')],_0x4ae2d5['filters']));_0x29e284['where']['WhatsappAccountId']=_0x1c87b3['id'];if(_0x3e9b1f[_0x3e81('0x42')][_0x3e81('0x4f')]){_0x29e284['where']=_['merge'](_0x29e284[_0x3e81('0x4d')],{'$or':_[_0x3e81('0x3c')](_0x29e284[_0x3e81('0x47')],function(_0x99aa21){var _0x37f34e={};_0x37f34e[_0x99aa21]={'$like':'%'+_0x3e9b1f['query'][_0x3e81('0x4f')]+'%'};return _0x37f34e;})});}_0x29e284=_[_0x3e81('0x50')]({},_0x29e284,_0x3e9b1f[_0x3e81('0x52')]);return db[_0x3e81('0x6d')][_0x3e81('0x2c')]({'where':_0x29e284[_0x3e81('0x4d')]})[_0x3e81('0x1e')](function(_0x503bbe){_0x1e13f[_0x3e81('0x2c')]=_0x503bbe;if(_0x3e9b1f['query'][_0x3e81('0x53')]){_0x29e284[_0x3e81('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3e81('0x54')](_0x29e284);})[_0x3e81('0x1e')](function(_0x1e851c){_0x1e13f['rows']=_0x1e851c;return _0x1e13f;});}})[_0x3e81('0x1e')](respondWithFilteredResult(_0x903249,_0x29e284))[_0x3e81('0x56')](handleError(_0x903249,null));};exports[_0x3e81('0x6f')]=function(_0x27f3f1,_0x48f710,_0x3b1edb){return db[_0x3e81('0x3d')][_0x3e81('0x5a')]({'where':{'id':_0x27f3f1[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x48f710,null))['then'](function(_0x3a06f8){if(_0x3a06f8){return _0x3a06f8[_0x3e81('0x6f')](_0x27f3f1[_0x3e81('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x48f710,null))[_0x3e81('0x56')](handleError(_0x48f710,null));};exports[_0x3e81('0x70')]=function(_0x2f7b30,_0x4913ec,_0x1310e2){return db[_0x3e81('0x3d')]['find']({'where':{'id':_0x2f7b30[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x4913ec,null))[_0x3e81('0x1e')](function(_0x5c3ea6){if(_0x5c3ea6){return _0x5c3ea6[_0x3e81('0x70')](_0x2f7b30[_0x3e81('0x5c')][_0x3e81('0x6b')],_[_0x3e81('0x71')](_0x2f7b30['body'],[_0x3e81('0x6b'),'id'])||{})[_0x3e81('0x72')](function(_0x1d0a2a){for(var _0x197892=0x0;_0x197892<_0x2f7b30['body']['ids']['length'];_0x197892+=0x1){socket[_0x3e81('0x73')](_0x3e81('0x74'),{'UserId':Number(_0x2f7b30[_0x3e81('0x5c')]['ids'][_0x197892]),'WhatsappAccountId':Number(_0x2f7b30['params']['id'])});}return _0x1d0a2a;});}})[_0x3e81('0x1e')](respondWithResult(_0x4913ec,null))[_0x3e81('0x56')](handleError(_0x4913ec,null));};exports[_0x3e81('0x75')]=function(_0x5e78d3,_0x220285,_0x11e7fd){return db[_0x3e81('0x3d')][_0x3e81('0x5a')]({'where':{'id':_0x5e78d3[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x220285,null))[_0x3e81('0x1e')](function(_0xf2295a){if(_0xf2295a){return _0xf2295a[_0x3e81('0x75')](_0x5e78d3['query']['ids'])['then'](function(){if(_[_0x3e81('0x76')](_0x5e78d3[_0x3e81('0x42')][_0x3e81('0x6b')])){for(var _0x483edf=0x0;_0x483edf<_0x5e78d3[_0x3e81('0x42')][_0x3e81('0x6b')]['length'];_0x483edf+=0x1){socket[_0x3e81('0x73')](_0x3e81('0x77'),{'UserId':Number(_0x5e78d3[_0x3e81('0x42')]['ids'][_0x483edf]),'WhatsappAccountId':Number(_0x5e78d3[_0x3e81('0x58')]['id'])});}}else{socket[_0x3e81('0x73')](_0x3e81('0x77'),{'UserId':Number(_0x5e78d3['query']['ids']),'WhatsappAccountId':Number(_0x5e78d3[_0x3e81('0x58')]['id'])});}});}})[_0x3e81('0x1e')](respondWithStatusCode(_0x220285,null))[_0x3e81('0x56')](handleError(_0x220285,null));};exports[_0x3e81('0x78')]=function(_0x1e8c08,_0x310b49,_0x5ea266){var _0x301f60={};var _0xc6cc9c={};var _0x4ab758;var _0xd9e16f;return db[_0x3e81('0x3d')][_0x3e81('0x68')]({'where':{'id':_0x1e8c08['params']['id']}})['then'](handleEntityNotFound(_0x310b49,null))[_0x3e81('0x1e')](function(_0x4f9330){if(_0x4f9330){_0x4ab758=_0x4f9330;_0xc6cc9c[_0x3e81('0x41')]=_[_0x3e81('0x43')](db['User'][_0x3e81('0x69')]);_0xc6cc9c[_0x3e81('0x42')]=_[_0x3e81('0x43')](_0x1e8c08[_0x3e81('0x42')]);_0xc6cc9c[_0x3e81('0x44')]=_[_0x3e81('0x45')](_0xc6cc9c[_0x3e81('0x41')],_0xc6cc9c[_0x3e81('0x42')]);_0x301f60[_0x3e81('0x47')]=_['intersection'](_0xc6cc9c[_0x3e81('0x41')],qs[_0x3e81('0x46')](_0x1e8c08[_0x3e81('0x42')][_0x3e81('0x46')]));_0x301f60[_0x3e81('0x47')]=_0x301f60['attributes'][_0x3e81('0x48')]?_0x301f60['attributes']:_0xc6cc9c[_0x3e81('0x41')];_0x301f60[_0x3e81('0x4b')]=qs[_0x3e81('0x4c')](_0x1e8c08[_0x3e81('0x42')][_0x3e81('0x4c')]);_0x301f60[_0x3e81('0x4d')]=qs['filters'](_[_0x3e81('0x4e')](_0x1e8c08[_0x3e81('0x42')],_0xc6cc9c['filters']));if(_0x1e8c08[_0x3e81('0x42')]['filter']){_0x301f60['where']=_[_0x3e81('0x50')](_0x301f60['where'],{'$or':_[_0x3e81('0x3c')](_0x301f60[_0x3e81('0x47')],function(_0x192d3b){var _0x5eb4a4={};_0x5eb4a4[_0x192d3b]={'$like':'%'+_0x1e8c08[_0x3e81('0x42')]['filter']+'%'};return _0x5eb4a4;})});}_0x301f60=_[_0x3e81('0x50')]({},_0x301f60,_0x1e8c08[_0x3e81('0x52')]);return _0x4ab758['getAgents'](_0x301f60);}})[_0x3e81('0x1e')](function(_0x33696a){if(_0x33696a){_0xd9e16f=_0x33696a[_0x3e81('0x48')];if(!_0x1e8c08['query']['hasOwnProperty'](_0x3e81('0x4a'))){_0x301f60[_0x3e81('0x2b')]=qs[_0x3e81('0x2b')](_0x1e8c08[_0x3e81('0x42')][_0x3e81('0x2b')]);_0x301f60[_0x3e81('0x29')]=qs[_0x3e81('0x29')](_0x1e8c08[_0x3e81('0x42')][_0x3e81('0x29')]);}return _0x4ab758['getAgents'](_0x301f60);}})[_0x3e81('0x1e')](function(_0x446acb){if(_0x446acb){return _0x446acb?{'count':_0xd9e16f,'rows':_0x446acb}:null;}})[_0x3e81('0x1e')](respondWithResult(_0x310b49,null))[_0x3e81('0x56')](handleError(_0x310b49,null));};exports[_0x3e81('0x79')]=function(_0x129e5f,_0x56d9f2){var _0x5cb6f1=_0x129e5f[_0x3e81('0x58')]['id'];var _0x5db899=_0x129e5f[_0x3e81('0x5c')];var _0x638256=0xc8;var _0x432ee1=null;return db[_0x3e81('0x7a')][_0x3e81('0x7b')]({'isolationLevel':db['sequelize'][_0x3e81('0x7c')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5adb77){return db[_0x3e81('0x3d')][_0x3e81('0x68')]({'where':{'id':_0x5cb6f1},'transaction':_0x5adb77})[_0x3e81('0x1e')](function(_0x449e09){if(_0x449e09){return db[_0x3e81('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x5cb6f1},'transaction':_0x5adb77})[_0x3e81('0x1e')](function(){var _0x1169a6=_[_0x3e81('0x3c')](_0x5db899,function(_0x16a509){_0x16a509[_0x3e81('0x66')]=_0x5cb6f1;return _0x16a509;});return db[_0x3e81('0x7d')][_0x3e81('0x7e')](_0x1169a6,{'transaction':_0x5adb77});});}else{_0x638256=0x194;_0x432ee1=[];}});})[_0x3e81('0x1e')](function(){if(_0x638256!==0x194){return db[_0x3e81('0x7d')][_0x3e81('0x7f')]({'where':{'WhatsappAccountId':_0x5cb6f1},'order':_0x3e81('0x80')})[_0x3e81('0x1e')](function(_0x8259e){_0x432ee1=_0x8259e;});}})[_0x3e81('0x56')](function(_0x4f3a01){_0x638256=0x1f4;logger['error'](_0x4f3a01[_0x3e81('0x37')]);if(_0x4f3a01[_0x3e81('0x38')]){delete _0x4f3a01[_0x3e81('0x38')];}_0x432ee1=_0x4f3a01;})['finally'](function(){if(_0x432ee1===null){_0x56d9f2[_0x3e81('0x27')](_0x638256);}else{if(_0x638256===0x1f4){_0x56d9f2[_0x3e81('0x28')](_0x638256)[_0x3e81('0x81')](_0x432ee1);}else{_0x56d9f2[_0x3e81('0x28')](_0x638256)[_0x3e81('0x2e')](_0x432ee1);}}});};exports['getApplications']=function(_0x224c9a,_0x24ea64,_0x179e1f){var _0x2f26dd={};var _0x5f15a9={};var _0xb37d67;var _0x274139;return db[_0x3e81('0x3d')][_0x3e81('0x68')]({'where':{'id':_0x224c9a[_0x3e81('0x58')]['id']}})[_0x3e81('0x1e')](handleEntityNotFound(_0x24ea64,null))[_0x3e81('0x1e')](function(_0x50acae){if(_0x50acae){_0xb37d67=_0x50acae;_0x5f15a9['model']=_['keys'](db[_0x3e81('0x7d')][_0x3e81('0x69')]);_0x5f15a9[_0x3e81('0x42')]=_['keys'](_0x224c9a[_0x3e81('0x42')]);_0x5f15a9[_0x3e81('0x44')]=_[_0x3e81('0x45')](_0x5f15a9[_0x3e81('0x41')],_0x5f15a9[_0x3e81('0x42')]);_0x2f26dd[_0x3e81('0x47')]=_[_0x3e81('0x45')](_0x5f15a9[_0x3e81('0x41')],qs[_0x3e81('0x46')](_0x224c9a['query'][_0x3e81('0x46')]));_0x2f26dd[_0x3e81('0x47')]=_0x2f26dd[_0x3e81('0x47')]['length']?_0x2f26dd[_0x3e81('0x47')]:_0x5f15a9[_0x3e81('0x41')];_0x2f26dd[_0x3e81('0x4b')]=qs[_0x3e81('0x4c')](_0x224c9a['query'][_0x3e81('0x4c')]);_0x2f26dd['where']=qs[_0x3e81('0x44')](_[_0x3e81('0x4e')](_0x224c9a[_0x3e81('0x42')],_0x5f15a9[_0x3e81('0x44')]));if(_0x224c9a[_0x3e81('0x42')]['filter']){_0x2f26dd[_0x3e81('0x4d')]=_[_0x3e81('0x50')](_0x2f26dd[_0x3e81('0x4d')],{'$or':_[_0x3e81('0x3c')](_0x2f26dd['attributes'],function(_0x59f3f3){var _0x53975e={};_0x53975e[_0x59f3f3]={'$like':'%'+_0x224c9a[_0x3e81('0x42')]['filter']+'%'};return _0x53975e;})});}_0x2f26dd=_['merge']({},_0x2f26dd,_0x224c9a[_0x3e81('0x52')]);return _0xb37d67[_0x3e81('0x82')](_0x2f26dd);}})['then'](function(_0x55ec0c){if(_0x55ec0c){_0x274139=_0x55ec0c[_0x3e81('0x48')];if(!_0x224c9a['query'][_0x3e81('0x49')](_0x3e81('0x4a'))){_0x2f26dd[_0x3e81('0x2b')]=qs[_0x3e81('0x2b')](_0x224c9a['query'][_0x3e81('0x2b')]);_0x2f26dd[_0x3e81('0x29')]=qs[_0x3e81('0x29')](_0x224c9a[_0x3e81('0x42')][_0x3e81('0x29')]);}return _0xb37d67[_0x3e81('0x82')](_0x2f26dd);}})['then'](function(_0xb1dfdf){if(_0xb1dfdf){return _0xb1dfdf?{'count':_0x274139,'rows':_0xb1dfdf}:null;}})['then'](respondWithResult(_0x24ea64,null))[_0x3e81('0x56')](handleError(_0x24ea64,null));};exports['notify']=function(_0x4682bc,_0x3f7d7d,_0x3be71f){var _0x509ede={'channel':_0x3e81('0x83')};var _0x1d0a5a=[];var _0x10c44b=[];var _0x50f65e={};return db[_0x3e81('0x3d')]['find']({'where':{'id':_0x4682bc[_0x3e81('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x3e81('0x84')}]})[_0x3e81('0x1e')](handleEntityNotFound(_0x3f7d7d,null))[_0x3e81('0x1e')](function(_0x2ec7d2){_0x509ede[_0x3e81('0x85')]=_0x2ec7d2;if(_0x509ede[_0x3e81('0x85')]&&_0x509ede['account'][_0x3e81('0x3f')]===_0x3e81('0x86')&&_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x87')]){if(_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x87')][_0x3e81('0x48')]===0x0)return;if(_0x4682bc[_0x3e81('0x5c')]['statuses'][0x0][_0x3e81('0x88')]!==_0x3e81('0x89'))return;return db['WhatsappMessage'][_0x3e81('0x31')]({'read':!![],'readAt':_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x87')][0x0]['timestamp']},{'where':{'messageId':_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x87')][0x0][_0x3e81('0x8a')]},'individualHooks':!![]})[_0x3e81('0x1e')](function(_0x3745f7){return _0x3f7d7d[_0x3e81('0x28')](0xc8)[_0x3e81('0x2e')](_0x3745f7);});}_0x509ede[_0x3e81('0x8b')]=_[_0x3e81('0x8c')](_0x2ec7d2['Applications'],[_0x3e81('0x80')],[_0x3e81('0x8d')]);if(_0x509ede[_0x3e81('0x85')][_0x3e81('0x84')]){delete _0x509ede['account']['Applications'];}return db[_0x3e81('0x8e')][_0x3e81('0x64')]()['then'](function(_0x15ebc2){if(!_0x15ebc2){throw new db[(_0x3e81('0x8f'))][(_0x3e81('0x90'))](_0x3e81('0x91'));}_0x1d0a5a=_[_0x3e81('0x92')](_[_0x3e81('0x43')](_0x15ebc2),[_0x3e81('0x93'),_0x3e81('0x94')]);_0x10c44b=_[_0x3e81('0x92')](_[_0x3e81('0x43')](_0x15ebc2),[_0x3e81('0x93'),_0x3e81('0x94'),'CompanyId',_0x3e81('0x95')]);_0x509ede[_0x3e81('0x5c')]={'mapKey':_0x3e81('0x96')};if(_0x509ede[_0x3e81('0x85')]&&_0x509ede[_0x3e81('0x85')][_0x3e81('0x3f')]===_0x3e81('0x97')){_0x509ede[_0x3e81('0x5c')]['from']=_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x98')][_0x3e81('0x99')](_0x3e81('0x9a'),'');_0x509ede[_0x3e81('0x5c')][_0x3e81('0x5c')]=_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x9b')];_0x509ede['body'][_0x3e81('0x9c')]=_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x9d')];}if(_0x509ede[_0x3e81('0x85')]&&_0x509ede[_0x3e81('0x85')][_0x3e81('0x3f')]===_0x3e81('0x86')){_0x509ede[_0x3e81('0x5c')][_0x3e81('0x9e')]=_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x9f')][0x0][_0x3e81('0x9e')];_0x509ede['body'][_0x3e81('0x5c')]=_0x4682bc[_0x3e81('0x5c')]['notifications'][0x0][_0x3e81('0x26')][_0x3e81('0x5c')];_0x509ede['body'][_0x3e81('0x9c')]=_0x4682bc[_0x3e81('0x5c')][_0x3e81('0x9f')][0x0][_0x3e81('0x8a')];}if(_0x509ede[_0x3e81('0x5c')]['id']){delete _0x509ede[_0x3e81('0x5c')]['id'];}if(_[_0x3e81('0xa0')](_0x509ede[_0x3e81('0x5c')][_0x3e81('0x9e')])){throw new db['Sequelize']['ValidationError'](_0x3e81('0xa1'));}if(_[_0x3e81('0xa0')](_0x509ede[_0x3e81('0x5c')][_0x3e81('0x5c')])||_0x509ede[_0x3e81('0x5c')][_0x3e81('0x5c')]===''){throw new db[(_0x3e81('0x8f'))]['ValidationError'](_0x3e81('0xa2'));}if(_[_0x3e81('0xa0')](_0x509ede[_0x3e81('0x5c')][_0x3e81('0xa3')])){throw new db[(_0x3e81('0x8f'))][(_0x3e81('0x90'))](_0x3e81('0xa4')+_0x10c44b);}if(!_[_0x3e81('0xa5')](_0x10c44b,_0x509ede[_0x3e81('0x5c')][_0x3e81('0xa3')])){throw new db[(_0x3e81('0x8f'))][(_0x3e81('0x90'))](_0x3e81('0xa6')+_0x10c44b);}_0x50f65e[_0x509ede['body'][_0x3e81('0xa3')]]=_0x509ede[_0x3e81('0x5c')][_0x3e81('0x9e')];return db[_0x3e81('0xa7')][_0x3e81('0x5a')]({'where':{'id':_0x509ede[_0x3e81('0x85')]['ListId']},'include':[{'model':db[_0x3e81('0x8e')],'as':_0x3e81('0xa8'),'where':_0x50f65e,'limit':0x1,'order':[[_0x3e81('0x94'),_0x3e81('0xa9')]]}]});})[_0x3e81('0x1e')](handleEntityNotFound(_0x3f7d7d,null))[_0x3e81('0x1e')](function(_0x24438b){if(_0x24438b){_0x509ede[_0x3e81('0xaa')]=_[_0x3e81('0x71')](_0x24438b,['Contacts']);if(_0x24438b[_0x3e81('0xa8')][_0x3e81('0x48')]){return _0x24438b['Contacts'][0x0];}var _0xe856bc=_['defaults'](_0x509ede['body'],{'firstName':_0x509ede[_0x3e81('0x5c')]['from'],'ListId':_0x24438b['id']});_0xe856bc[_0x509ede[_0x3e81('0x5c')]['mapKey']]=_0x509ede[_0x3e81('0x5c')][_0x3e81('0x9e')];return db['CmContact'][_0x3e81('0x5b')](_0xe856bc,{'fields':_0x1d0a5a,'raw':!![]});}})[_0x3e81('0x1e')](handleEntityNotFound(_0x3f7d7d,null))['then'](function(_0x1baee0){if(_0x1baee0){_0x509ede['contact']=_0x1baee0;var _0x4b4d79={'ContactId':_0x1baee0['id'],'phone':_0x509ede[_0x3e81('0x5c')]['from'],'WhatsappAccountId':_0x4682bc['params']['id']};var _0x36c742={'ContactId':_0x1baee0['id'],'WhatsappAccountId':_0x4682bc[_0x3e81('0x58')]['id'],'closed':![]};return db[_0x3e81('0xab')][_0x3e81('0x5a')]({'where':_0x36c742})[_0x3e81('0x1e')](function(_0x358778){if(_0x358778){return[_0x358778,![]];}return db[_0x3e81('0xab')][_0x3e81('0x5b')](_0x4b4d79)[_0x3e81('0x1e')](function(_0x4d1d15){return[_0x4d1d15,!![]];});});}})[_0x3e81('0x72')](function(_0x550f1b,_0x46f42c){_0x509ede['interaction']=_0x550f1b[_0x3e81('0x33')]({'plain':!![]});_0x509ede['interaction'][_0x3e81('0xac')]=![];if(_0x46f42c){if(_0x509ede[_0x3e81('0x85')][_0x3e81('0xad')]){_0x509ede['applications'][_0x3e81('0xae')]({'id':0x0,'priority':_0x509ede[_0x3e81('0x8b')][_0x3e81('0x48')]+0x1,'app':_0x3e81('0xaf'),'appdata':_0x3e81('0xb0'),'interval':'*,*,*,*'});}_0x509ede['interaction']['created']=!![];}return db[_0x3e81('0xb1')][_0x3e81('0x5b')]({'phone':_0x509ede[_0x3e81('0x5c')][_0x3e81('0x9e')],'messageId':_0x509ede['body'][_0x3e81('0x9c')],'body':_0x509ede['body'][_0x3e81('0x5c')],'WhatsappAccountId':_0x4682bc['params']['id'],'WhatsappInteractionId':_0x550f1b['id'],'direction':'in','ContactId':_0x550f1b[_0x3e81('0xb2')],'AttachmentId':_0x509ede['body']['AttachmentId']});})[_0x3e81('0x1e')](function(_0x467271){_0x509ede[_0x3e81('0x26')]=_0x467271;if(!_0x509ede[_0x3e81('0xb3')]['UserId'])return;return db['User'][_0x3e81('0x5a')]({'attributes':['id','name'],'where':{'id':_0x509ede['interaction'][_0x3e81('0xb4')]}});})[_0x3e81('0x1e')](function(_0xaa5966){if(_0xaa5966){_0x509ede['applications'][_0x3e81('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xaa5966[_0x3e81('0x38')]+','+(_0x509ede[_0x3e81('0x85')][_0x3e81('0xb6')]||0xa),'interval':_0x3e81('0xb7')});}if(!_0x509ede[_0x3e81('0xb3')][_0x3e81('0xb8')])return;return db[_0x3e81('0xb9')][_0x3e81('0x5a')]({'attributes':['id',_0x3e81('0x38')],'where':{'id':_0x509ede[_0x3e81('0xb3')][_0x3e81('0xb8')]}});})[_0x3e81('0x1e')](function(_0x41dc29){if(_0x41dc29){_0x509ede['applications'][_0x3e81('0xb5')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x41dc29[_0x3e81('0x38')]+','+(_0x509ede['account'][_0x3e81('0xba')]||0x12c),'interval':_0x3e81('0xb7')});}return respondWithRpcPromise(_0x3e81('0xbb'),'startRouting',_0x509ede);})[_0x3e81('0x1e')](function(_0x2e1ecc){if(_0x2e1ecc){var _0x3550ce=0xc8;var _0x6511aa=_0x3e81('0xbc');logger['info'](_0x3e81('0x22'),_0x6511aa,_0x3550ce,_0x3e81('0xbd'));logger[_0x3e81('0xbe')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x6511aa,_0x3550ce,_0x3e81('0xbd'),JSON[_0x3e81('0x23')](_0x2e1ecc));if(_0x509ede[_0x3e81('0x85')][_0x3e81('0x3f')]==='twilio'){return _0x3f7d7d['status'](_0x3550ce)['set'](_0x3e81('0xbf'),'text/xml')['send']('\x0a');}else{return _0x3f7d7d[_0x3e81('0x28')](_0x3550ce)[_0x3e81('0x2e')](_0x2e1ecc);}}});})['catch'](handleError(_0x3f7d7d,null));};exports[_0x3e81('0x81')]=function(_0x5d266d,_0x4a1980,_0x3aeed5){var _0x466146,_0x4c7142,_0x3be263;if(_[_0x3e81('0xa0')](_0x5d266d[_0x3e81('0x5c')][_0x3e81('0x5c')])||_0x5d266d['body'][_0x3e81('0x5c')]===''){throw new db[(_0x3e81('0x8f'))]['ValidationError'](_0x3e81('0xa2'));}if(_[_0x3e81('0xa0')](_0x5d266d['body']['to'])){throw new db[(_0x3e81('0x8f'))][(_0x3e81('0x90'))]('to\x20is\x20mandatory');}_0x466146=_0x5d266d[_0x3e81('0x5c')]['to'];return db['WhatsappAccount'][_0x3e81('0x5a')]({'where':{'id':_0x5d266d[_0x3e81('0x58')]['id']},'include':[{'model':db[_0x3e81('0xa7')],'as':_0x3e81('0xc0'),'include':[{'model':db[_0x3e81('0x8e')],'as':_0x3e81('0xa8'),'where':{'mobile':_0x466146},'limit':0x1,'order':[[_0x3e81('0x94'),_0x3e81('0xa9')]]}]}]})[_0x3e81('0x1e')](handleEntityNotFound(_0x4a1980,null))[_0x3e81('0x1e')](function(_0x4b4024){if(_0x4b4024&&_0x4b4024[_0x3e81('0xc0')]){_0x4c7142=_0x4b4024[_0x3e81('0x33')]({'plain':!![]});if(_0x4c7142[_0x3e81('0xc0')]&&_0x4c7142[_0x3e81('0xc0')][_0x3e81('0xa8')][_0x3e81('0x48')]){return _0x4c7142[_0x3e81('0xc0')][_0x3e81('0xa8')][0x0];}return db['CmContact'][_0x3e81('0x5b')](_[_0x3e81('0xc1')](_0x5d266d[_0x3e81('0x5c')],{'firstName':_0x466146,'mobile':_0x466146,'phone':_0x466146,'ListId':_0x4c7142[_0x3e81('0x95')]}));}})[_0x3e81('0x1e')](handleEntityNotFound(_0x4a1980,null))[_0x3e81('0x1e')](function(_0x590216){if(_0x590216){_0x3be263=_0x590216;return db['WhatsappInteraction'][_0x3e81('0x5a')]({'where':{'ContactId':_0x3be263['id'],'closed':![],'WhatsappAccountId':_0x4c7142['id']}})[_0x3e81('0x1e')](function(_0x5e59d0){if(_0x5e59d0){return[_0x5e59d0,![]];}return db[_0x3e81('0xab')][_0x3e81('0x5b')]({'UserId':_0x5d266d[_0x3e81('0x5d')]['id'],'ContactId':_0x3be263['id'],'WhatsappAccountId':_0x4c7142['id'],'phone':_0x466146,'firstMsgDirection':_0x3e81('0xc2'),'Messages':[_[_0x3e81('0x50')](_0x5d266d[_0x3e81('0x5c')],{'read':![],'body':_0x5d266d[_0x3e81('0x5c')][_0x3e81('0x5c')],'phone':_0x466146,'WhatsappAccountId':_0x4c7142['id'],'UserId':_0x5d266d[_0x3e81('0x5d')]['id'],'ContactId':_0x3be263['id']})]},{'include':[{'model':db[_0x3e81('0xb1')],'as':'Messages'}]})[_0x3e81('0x1e')](function(_0x55ded5){return[_0x55ded5,!![]];});});}})[_0x3e81('0x72')](function(_0x549955,_0x3b3856){if(_0x3b3856){return _0x549955;}return db[_0x3e81('0xb1')]['create'](_[_0x3e81('0x50')](_0x5d266d[_0x3e81('0x5c')],{'read':![],'body':_0x5d266d['body'][_0x3e81('0x5c')],'phone':_0x466146,'WhatsappAccountId':_0x4c7142['id'],'WhatsappInteractionId':_0x549955['id'],'UserId':_0x5d266d[_0x3e81('0x5d')]['id'],'ContactId':_0x3be263['id']}))['then'](function(_0x427af5){_0x549955['dataValues']['Messages']=[];_0x549955[_0x3e81('0xc3')][_0x3e81('0xc4')]['push'](_0x427af5[_0x3e81('0xc3')]);return _0x549955;});})[_0x3e81('0x1e')](respondWithResult(_0x4a1980,null))[_0x3e81('0x56')](handleError(_0x4a1980,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 64c6e6d..6896bf5 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 _0x5f11=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x5f11,0x1b7));var _0x15f1=function(_0x408928,_0x568f1f){_0x408928=_0x408928-0x0;var _0x1daf71=_0x5f11[_0x408928];return _0x1daf71;};'use strict';var EventEmitter=require(_0x15f1('0x0'));var WhatsappAccount=require(_0x15f1('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15f1('0x2'),'afterUpdate':'update','afterDestroy':_0x15f1('0x3')};function emitEvent(_0xe72aa3){return function(_0x1afedc,_0x355f4a,_0x570339){WhatsappAccountEvents[_0x15f1('0x4')](_0xe72aa3+':'+_0x1afedc['id'],_0x1afedc);WhatsappAccountEvents[_0x15f1('0x4')](_0xe72aa3,_0x1afedc);_0x570339(null);};}for(var e in events){if(events[_0x15f1('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x15f1('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x8b9a=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x966527,_0x579714){var _0x46ba9c=function(_0x4078be){while(--_0x4078be){_0x966527['push'](_0x966527['shift']());}};_0x46ba9c(++_0x579714);}(_0x8b9a,0x1e7));var _0xa8b9=function(_0x244259,_0x229538){_0x244259=_0x244259-0x0;var _0x27cfc0=_0x8b9a[_0x244259];return _0x27cfc0;};'use strict';var EventEmitter=require(_0xa8b9('0x0'));var WhatsappAccount=require(_0xa8b9('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa8b9('0x2')](0x0);var events={'afterCreate':_0xa8b9('0x3'),'afterUpdate':'update','afterDestroy':_0xa8b9('0x4')};function emitEvent(_0x103ef7){return function(_0x5f2f11,_0x462111,_0x5bdd02){WhatsappAccountEvents[_0xa8b9('0x5')](_0x103ef7+':'+_0x5f2f11['id'],_0x5f2f11);WhatsappAccountEvents[_0xa8b9('0x5')](_0x103ef7,_0x5f2f11);_0x5bdd02(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xa8b9('0x6')](e,emitEvent(event));}}module[_0xa8b9('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index aad631d..1bec912 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 _0x7819=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','WhatsappAccount'];(function(_0x2c91e8,_0x2cfccb){var _0x1bada2=function(_0x52af27){while(--_0x52af27){_0x2c91e8['push'](_0x2c91e8['shift']());}};_0x1bada2(++_0x2cfccb);}(_0x7819,0x176));var _0x9781=function(_0x4a42d9,_0x331972){_0x4a42d9=_0x4a42d9-0x0;var _0x4b8485=_0x7819[_0x4a42d9];return _0x4b8485;};'use strict';var _=require(_0x9781('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9781('0x1'));var moment=require(_0x9781('0x2'));var BPromise=require(_0x9781('0x3'));var rp=require(_0x9781('0x4'));var fs=require('fs');var path=require(_0x9781('0x5'));var rimraf=require(_0x9781('0x6'));var config=require(_0x9781('0x7'));var attributes=require(_0x9781('0x8'));module[_0x9781('0x9')]=function(_0x17ad7f,_0x10d41b){return _0x17ad7f['define'](_0x9781('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0aa=['lodash','util','../../config/logger','moment','path','rimraf','exports','WhatsappAccount','whatsapp_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0aa,0x195));var _0xaf0a=function(_0x1c66a6,_0x1d59cb){_0x1c66a6=_0x1c66a6-0x0;var _0x28e949=_0xf0aa[_0x1c66a6];return _0x28e949;};'use strict';var _=require(_0xaf0a('0x0'));var util=require(_0xaf0a('0x1'));var logger=require(_0xaf0a('0x2'))('api');var moment=require(_0xaf0a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf0a('0x4'));var rimraf=require(_0xaf0a('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xaf0a('0x6')]=function(_0x1270a5,_0x495935){return _0x1270a5['define'](_0xaf0a('0x7'),attributes,{'tableName':_0xaf0a('0x8'),'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 0207b9c..7aa818d 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 _0x8786=['register','request','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3a5d72,_0x3fd11e){var _0x5e1699=function(_0x191753){while(--_0x191753){_0x3a5d72['push'](_0x3a5d72['shift']());}};_0x5e1699(++_0x3fd11e);}(_0x8786,0x138));var _0x6878=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8786[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6878('0x0'));var util=require('util');var moment=require(_0x6878('0x1'));var BPromise=require(_0x6878('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6878('0x3'))['db'];var utils=require(_0x6878('0x4'));var logger=require('../../config/logger')(_0x6878('0x5'));var config=require(_0x6878('0x6'));var jayson=require(_0x6878('0x7'));var client=jayson[_0x6878('0x8')][_0x6878('0x9')]({'port':0x232a});config[_0x6878('0xa')]=_[_0x6878('0xb')](config[_0x6878('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x6878('0xc')](socket);function respondWithRpcPromise(_0x76b3bb,_0x11e66b,_0x50938d){return new BPromise(function(_0x50483b,_0x2f7e8d){return client[_0x6878('0xd')](_0x76b3bb,_0x50938d)['then'](function(_0x4d99b9){logger[_0x6878('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x11e66b,_0x6878('0xf'));logger['debug'](_0x6878('0x10'),_0x11e66b,'request\x20sent',JSON[_0x6878('0x11')](_0x4d99b9));if(_0x4d99b9[_0x6878('0x12')]){if(_0x4d99b9['error'][_0x6878('0x13')]===0x1f4){logger[_0x6878('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x11e66b,_0x4d99b9[_0x6878('0x12')][_0x6878('0x14')]);return _0x2f7e8d(_0x4d99b9[_0x6878('0x12')]['message']);}logger[_0x6878('0x12')](_0x6878('0x15'),_0x11e66b,_0x4d99b9[_0x6878('0x12')]['message']);return _0x50483b(_0x4d99b9[_0x6878('0x12')][_0x6878('0x14')]);}else{logger[_0x6878('0xe')](_0x6878('0x15'),_0x11e66b,_0x6878('0xf'));_0x50483b(_0x4d99b9[_0x6878('0x16')][_0x6878('0x14')]);}})[_0x6878('0x17')](function(_0x53b998){logger[_0x6878('0x12')](_0x6878('0x15'),_0x11e66b,_0x53b998);_0x2f7e8d(_0x53b998);});});}exports[_0x6878('0x18')]=function(_0x2f4943){var _0x4c9ade=this;return new Promise(function(_0xbcfe5b,_0x1341d5){return db[_0x6878('0x19')][_0x6878('0x1a')]({'raw':_0x2f4943[_0x6878('0x1b')]?_0x2f4943['options'][_0x6878('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f4943[_0x6878('0x1b')]?_0x2f4943[_0x6878('0x1b')][_0x6878('0x1d')]||null:null,'attributes':_0x2f4943['options']?_0x2f4943[_0x6878('0x1b')][_0x6878('0x1e')]||null:null,'include':_0x2f4943[_0x6878('0x1b')]?_0x2f4943[_0x6878('0x1b')][_0x6878('0x1f')]?_[_0x6878('0x20')](_0x2f4943['options'][_0x6878('0x1f')],function(_0xa0fd3a){return{'model':db[_0xa0fd3a[_0x6878('0x21')]],'as':_0xa0fd3a['as'],'attributes':_0xa0fd3a[_0x6878('0x1e')],'include':_0xa0fd3a[_0x6878('0x1f')]?_[_0x6878('0x20')](_0xa0fd3a[_0x6878('0x1f')],function(_0x4ca8f6){return{'model':db[_0x4ca8f6[_0x6878('0x21')]],'as':_0x4ca8f6['as'],'attributes':_0x4ca8f6[_0x6878('0x1e')],'include':_0x4ca8f6[_0x6878('0x1f')]?_[_0x6878('0x20')](_0x4ca8f6[_0x6878('0x1f')],function(_0x44c023){return{'model':db[_0x44c023['model']],'as':_0x44c023['as'],'attributes':_0x44c023[_0x6878('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6878('0x22')](function(_0x563657){logger['info'](_0x6878('0x18'),_0x2f4943);logger[_0x6878('0x23')](_0x6878('0x18'),_0x2f4943,JSON[_0x6878('0x11')](_0x563657));_0xbcfe5b(_0x563657);})[_0x6878('0x17')](function(_0x10f41c){logger[_0x6878('0x12')](_0x6878('0x18'),_0x10f41c['message'],_0x2f4943);_0x1341d5(_0x4c9ade['error'](0x1f4,_0x10f41c[_0x6878('0x14')]));});});}; \ No newline at end of file +var _0x26c2=['ShowWhatsappAccount','find','options','raw','attributes','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x26c2,0x1d6));var _0x226c=function(_0x3532b3,_0x4dc264){_0x3532b3=_0x3532b3-0x0;var _0x2959fb=_0x26c2[_0x3532b3];return _0x2959fb;};'use strict';var _=require('lodash');var util=require(_0x226c('0x0'));var moment=require(_0x226c('0x1'));var BPromise=require(_0x226c('0x2'));var rs=require(_0x226c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x226c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x5'))(_0x226c('0x6'));var config=require(_0x226c('0x7'));var jayson=require(_0x226c('0x8'));var client=jayson[_0x226c('0x9')][_0x226c('0xa')]({'port':0x232a});config[_0x226c('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x226c('0xc'))(new Redis(config[_0x226c('0xb')]));require('./whatsappAccount.socket')[_0x226c('0xd')](socket);function respondWithRpcPromise(_0x355c1f,_0x85ed80,_0x36d64b){return new BPromise(function(_0x1ae421,_0x1001f9){return client[_0x226c('0xe')](_0x355c1f,_0x36d64b)['then'](function(_0x4dd4f5){logger[_0x226c('0xf')](_0x226c('0x10'),_0x85ed80,_0x226c('0x11'));logger[_0x226c('0x12')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x85ed80,'request\x20sent',JSON[_0x226c('0x13')](_0x4dd4f5));if(_0x4dd4f5[_0x226c('0x14')]){if(_0x4dd4f5[_0x226c('0x14')][_0x226c('0x15')]===0x1f4){logger[_0x226c('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x85ed80,_0x4dd4f5[_0x226c('0x14')][_0x226c('0x16')]);return _0x1001f9(_0x4dd4f5[_0x226c('0x14')]['message']);}logger[_0x226c('0x14')](_0x226c('0x10'),_0x85ed80,_0x4dd4f5[_0x226c('0x14')][_0x226c('0x16')]);return _0x1ae421(_0x4dd4f5[_0x226c('0x14')][_0x226c('0x16')]);}else{logger[_0x226c('0xf')](_0x226c('0x10'),_0x85ed80,_0x226c('0x11'));_0x1ae421(_0x4dd4f5[_0x226c('0x17')][_0x226c('0x16')]);}})[_0x226c('0x18')](function(_0x1ecb10){logger['error'](_0x226c('0x10'),_0x85ed80,_0x1ecb10);_0x1001f9(_0x1ecb10);});});}exports[_0x226c('0x19')]=function(_0x1abe31){var _0x49f43d=this;return new Promise(function(_0x4038b0,_0x9fae06){return db['WhatsappAccount'][_0x226c('0x1a')]({'raw':_0x1abe31[_0x226c('0x1b')]?_0x1abe31[_0x226c('0x1b')][_0x226c('0x1c')]===undefined?!![]:![]:!![],'where':_0x1abe31[_0x226c('0x1b')]?_0x1abe31[_0x226c('0x1b')]['where']||null:null,'attributes':_0x1abe31[_0x226c('0x1b')]?_0x1abe31[_0x226c('0x1b')][_0x226c('0x1d')]||null:null,'include':_0x1abe31[_0x226c('0x1b')]?_0x1abe31[_0x226c('0x1b')][_0x226c('0x1e')]?_['map'](_0x1abe31[_0x226c('0x1b')][_0x226c('0x1e')],function(_0x418d7e){return{'model':db[_0x418d7e['model']],'as':_0x418d7e['as'],'attributes':_0x418d7e[_0x226c('0x1d')],'include':_0x418d7e['include']?_[_0x226c('0x1f')](_0x418d7e[_0x226c('0x1e')],function(_0x1a9454){return{'model':db[_0x1a9454[_0x226c('0x20')]],'as':_0x1a9454['as'],'attributes':_0x1a9454['attributes'],'include':_0x1a9454['include']?_['map'](_0x1a9454['include'],function(_0x52d2aa){return{'model':db[_0x52d2aa[_0x226c('0x20')]],'as':_0x52d2aa['as'],'attributes':_0x52d2aa[_0x226c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8c67bc){logger[_0x226c('0xf')](_0x226c('0x19'),_0x1abe31);logger[_0x226c('0x12')](_0x226c('0x19'),_0x1abe31,JSON['stringify'](_0x8c67bc));_0x4038b0(_0x8c67bc);})[_0x226c('0x18')](function(_0x164632){logger['error'](_0x226c('0x19'),_0x164632[_0x226c('0x16')],_0x1abe31);_0x9fae06(_0x49f43d[_0x226c('0x14')](0x1f4,_0x164632['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e9381a5..612324f 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 _0x609a=['update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x1417c6,_0x194309){var _0x44db97=function(_0xa2a293){while(--_0xa2a293){_0x1417c6['push'](_0x1417c6['shift']());}};_0x44db97(++_0x194309);}(_0x609a,0x145));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var WhatsappAccountEvents=require(_0xa609('0x0'));var events=[_0xa609('0x1'),_0xa609('0x2'),_0xa609('0x3')];function createListener(_0x3857e0,_0x4e0143){return function(_0xf0f679){_0x4e0143[_0xa609('0x4')](_0x3857e0,_0xf0f679);};}function removeListener(_0x18bf56,_0x35a086){return function(){WhatsappAccountEvents[_0xa609('0x5')](_0x18bf56,_0x35a086);};}exports[_0xa609('0x6')]=function(_0x1e93b5){for(var _0x4a1a44=0x0,_0x1b20c0=events['length'];_0x4a1a44<_0x1b20c0;_0x4a1a44++){var _0x5c32e4=events[_0x4a1a44];var _0xa7e9d9=createListener(_0xa609('0x7')+_0x5c32e4,_0x1e93b5);WhatsappAccountEvents['on'](_0x5c32e4,_0xa7e9d9);}}; \ No newline at end of file +var _0x2e72=['update','removeListener','length','whatsappAccount:','./whatsappAccount.events','remove'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x2e72,0xa0));var _0x22e7=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x2e72[_0x3cb86b];return _0x3c10a0;};'use strict';var WhatsappAccountEvents=require(_0x22e7('0x0'));var events=['save',_0x22e7('0x1'),_0x22e7('0x2')];function createListener(_0x2d44ed,_0x53f94b){return function(_0x1857ff){_0x53f94b['emit'](_0x2d44ed,_0x1857ff);};}function removeListener(_0x5bbc54,_0x258a76){return function(){WhatsappAccountEvents[_0x22e7('0x3')](_0x5bbc54,_0x258a76);};}exports['register']=function(_0x558119){for(var _0x59b323=0x0,_0x10dfe0=events[_0x22e7('0x4')];_0x59b323<_0x10dfe0;_0x59b323++){var _0x4ec8e4=events[_0x59b323];var _0x178ebb=createListener(_0x22e7('0x5')+_0x4ec8e4,_0x558119);WhatsappAccountEvents['on'](_0x4ec8e4,_0x178ebb);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 8139d42..84f2f81 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 _0x62b6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','show','post','create','put','update','isAuthenticated','destroy','multer','util'];(function(_0x318f19,_0x1ad0fc){var _0x1adf1d=function(_0x52202d){while(--_0x52202d){_0x318f19['push'](_0x318f19['shift']());}};_0x1adf1d(++_0x1ad0fc);}(_0x62b6,0xfd));var _0x662b=function(_0x55b285,_0xdaaec0){_0x55b285=_0x55b285-0x0;var _0x432b38=_0x62b6[_0x55b285];return _0x432b38;};'use strict';var multer=require(_0x662b('0x0'));var util=require(_0x662b('0x1'));var path=require('path');var timeout=require(_0x662b('0x2'));var express=require(_0x662b('0x3'));var router=express[_0x662b('0x4')]();var fs_extra=require(_0x662b('0x5'));var auth=require(_0x662b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x662b('0x7'));var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x662b('0x8')](_0x662b('0x9'),auth['isAuthenticated'](),controller[_0x662b('0xa')]);router[_0x662b('0xb')]('/',auth['isAuthenticated'](),controller[_0x662b('0xc')]);router[_0x662b('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x662b('0xe')]);router['delete']('/:id',auth[_0x662b('0xf')](),controller[_0x662b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc8dc=['express','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2a2fdb,_0x5b5d57){var _0x34fbbf=function(_0x414ba3){while(--_0x414ba3){_0x2a2fdb['push'](_0x2a2fdb['shift']());}};_0x34fbbf(++_0x5b5d57);}(_0xc8dc,0xf8));var _0xcc8d=function(_0x4fadb8,_0x11b539){_0x4fadb8=_0x4fadb8-0x0;var _0x3c9e20=_0xc8dc[_0x4fadb8];return _0x3c9e20;};'use strict';var multer=require(_0xcc8d('0x0'));var util=require(_0xcc8d('0x1'));var path=require(_0xcc8d('0x2'));var timeout=require(_0xcc8d('0x3'));var express=require(_0xcc8d('0x4'));var router=express[_0xcc8d('0x5')]();var fs_extra=require(_0xcc8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcc8d('0x7'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router[_0xcc8d('0x8')]('/',auth['isAuthenticated'](),controller[_0xcc8d('0x9')]);router['get'](_0xcc8d('0xa'),auth[_0xcc8d('0xb')](),controller['show']);router['post']('/',auth[_0xcc8d('0xb')](),controller[_0xcc8d('0xc')]);router[_0xcc8d('0xd')](_0xcc8d('0xa'),auth[_0xcc8d('0xb')](),controller[_0xcc8d('0xe')]);router[_0xcc8d('0xf')](_0xcc8d('0xa'),auth[_0xcc8d('0xb')](),controller[_0xcc8d('0x10')]);module[_0xcc8d('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 4f15895..b93874e 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 _0xd8c4=['TEXT','STRING','*,*,*,*'];(function(_0x4d1fff,_0x27e7e5){var _0x3375bd=function(_0x4c8c48){while(--_0x4c8c48){_0x4d1fff['push'](_0x4d1fff['shift']());}};_0x3375bd(++_0x27e7e5);}(_0xd8c4,0xd8));var _0x4d8c=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xd8c4[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x4d8c('0x0')]()},'description':{'type':Sequelize[_0x4d8c('0x1')]},'interval':{'type':Sequelize[_0x4d8c('0x1')],'defaultValue':_0x4d8c('0x2')}}; \ No newline at end of file +var _0xd7db=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x592744,_0x3bd497){var _0x12ff21=function(_0x3d7664){while(--_0x3d7664){_0x592744['push'](_0x592744['shift']());}};_0x12ff21(++_0x3bd497);}(_0xd7db,0x17b));var _0xbd7d=function(_0x46ad9b,_0x64bfaa){_0x46ad9b=_0x46ad9b-0x0;var _0x16f7a0=_0xd7db[_0x46ad9b];return _0x16f7a0;};'use strict';var Sequelize=require(_0xbd7d('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbd7d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbd7d('0x2')],'allowNull':![],'defaultValue':_0xbd7d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbd7d('0x2')]},'interval':{'type':Sequelize[_0xbd7d('0x2')],'defaultValue':_0xbd7d('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e7d8b2b..0085bf9 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 _0x9541=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','show','params','length','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x3c2624,_0x3d6389){var _0x124cd2=function(_0x470531){while(--_0x470531){_0x3c2624['push'](_0x3c2624['shift']());}};_0x124cd2(++_0x3d6389);}(_0x9541,0xb3));var _0x1954=function(_0x1b8e6a,_0x278495){_0x1b8e6a=_0x1b8e6a-0x0;var _0x7fab1a=_0x9541[_0x1b8e6a];return _0x7fab1a;};'use strict';var emlformat=require(_0x1954('0x0'));var rimraf=require(_0x1954('0x1'));var zipdir=require(_0x1954('0x2'));var jsonpatch=require(_0x1954('0x3'));var rp=require(_0x1954('0x4'));var moment=require(_0x1954('0x5'));var BPromise=require(_0x1954('0x6'));var Mustache=require(_0x1954('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1954('0x8'));var csv=require(_0x1954('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1954('0xa'));var _=require(_0x1954('0xb'));var squel=require(_0x1954('0xc'));var crypto=require(_0x1954('0xd'));var jsforce=require(_0x1954('0xe'));var deskjs=require(_0x1954('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1954('0x10'));var Papa=require(_0x1954('0x11'));var Redis=require(_0x1954('0x12'));var authService=require(_0x1954('0x13'));var qs=require(_0x1954('0x14'));var as=require(_0x1954('0x15'));var hardwareService=require(_0x1954('0x16'));var logger=require(_0x1954('0x17'))('api');var utils=require(_0x1954('0x18'));var config=require(_0x1954('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1954('0x1a'))['db'];function respondWithStatusCode(_0x5e8400,_0x289155){_0x289155=_0x289155||0xcc;return function(_0x4dc96b){if(_0x4dc96b){return _0x5e8400['sendStatus'](_0x289155);}return _0x5e8400['status'](_0x289155)[_0x1954('0x1b')]();};}function respondWithResult(_0x1b33cb,_0x96906a){_0x96906a=_0x96906a||0xc8;return function(_0x520dc7){if(_0x520dc7){return _0x1b33cb[_0x1954('0x1c')](_0x96906a)['json'](_0x520dc7);}};}function respondWithFilteredResult(_0x5daee1,_0xaeb0e3){return function(_0xf43d28){if(_0xf43d28){var _0x36565c=typeof _0xaeb0e3[_0x1954('0x1d')]===_0x1954('0x1e')&&typeof _0xaeb0e3[_0x1954('0x1f')]===_0x1954('0x1e');var _0x46b400=_0xf43d28[_0x1954('0x20')];var _0xb9c2cd=_0x36565c?0x0:_0xaeb0e3[_0x1954('0x1d')];var _0x3da757=_0x36565c?_0xf43d28[_0x1954('0x20')]:_0xaeb0e3[_0x1954('0x1d')]+_0xaeb0e3[_0x1954('0x1f')];var _0x4503d7;if(_0x3da757>=_0x46b400){_0x3da757=_0x46b400;_0x4503d7=0xc8;}else{_0x4503d7=0xce;}_0x5daee1[_0x1954('0x1c')](_0x4503d7);return _0x5daee1[_0x1954('0x21')](_0x1954('0x22'),_0xb9c2cd+'-'+_0x3da757+'/'+_0x46b400)[_0x1954('0x23')](_0xf43d28);}return null;};}function patchUpdates(_0x5e20b8){return function(_0x2105d5){try{jsonpatch[_0x1954('0x24')](_0x2105d5,_0x5e20b8,!![]);}catch(_0x3a84c0){return BPromise[_0x1954('0x25')](_0x3a84c0);}return _0x2105d5[_0x1954('0x26')]();};}function saveUpdates(_0x5e549f,_0x61107d){return function(_0x15dd0b){if(_0x15dd0b){return _0x15dd0b[_0x1954('0x27')](_0x5e549f)[_0x1954('0x28')](function(_0x6d8a2){return _0x6d8a2;});}return null;};}function removeEntity(_0x5a7256,_0x4d1b25){return function(_0x18a883){if(_0x18a883){return _0x18a883[_0x1954('0x29')]()[_0x1954('0x28')](function(){_0x5a7256[_0x1954('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f395,_0x26484f){return function(_0x27dc66){if(!_0x27dc66){_0x21f395[_0x1954('0x2a')](0x194);}return _0x27dc66;};}function handleError(_0x3f06de,_0x1bfa18){_0x1bfa18=_0x1bfa18||0x1f4;return function(_0x46fdc1){logger['error'](_0x46fdc1[_0x1954('0x2b')]);if(_0x46fdc1[_0x1954('0x2c')]){delete _0x46fdc1['name'];}_0x3f06de[_0x1954('0x1c')](_0x1bfa18)[_0x1954('0x2d')](_0x46fdc1);};}exports[_0x1954('0x2e')]=function(_0x3a488b,_0x1d8f32){var _0x251386={},_0x41b143={},_0x41c850={'count':0x0,'rows':[]};var _0xde7055=_[_0x1954('0x2f')](db[_0x1954('0x30')][_0x1954('0x31')],function(_0x40da25){return{'name':_0x40da25[_0x1954('0x32')],'type':_0x40da25[_0x1954('0x33')][_0x1954('0x34')]};});_0x41b143[_0x1954('0x35')]=_[_0x1954('0x2f')](_0xde7055,_0x1954('0x2c'));_0x41b143[_0x1954('0x36')]=_[_0x1954('0x37')](_0x3a488b[_0x1954('0x36')]);_0x41b143[_0x1954('0x38')]=_[_0x1954('0x39')](_0x41b143['model'],_0x41b143['query']);_0x251386[_0x1954('0x3a')]=_['intersection'](_0x41b143[_0x1954('0x35')],qs[_0x1954('0x3b')](_0x3a488b['query'][_0x1954('0x3b')]));_0x251386[_0x1954('0x3a')]=_0x251386['attributes']['length']?_0x251386[_0x1954('0x3a')]:_0x41b143[_0x1954('0x35')];if(!_0x3a488b[_0x1954('0x36')][_0x1954('0x3c')](_0x1954('0x3d'))){_0x251386[_0x1954('0x1f')]=qs[_0x1954('0x1f')](_0x3a488b['query']['limit']);_0x251386[_0x1954('0x1d')]=qs[_0x1954('0x1d')](_0x3a488b[_0x1954('0x36')][_0x1954('0x1d')]);}_0x251386[_0x1954('0x3e')]=qs[_0x1954('0x3f')](_0x3a488b['query'][_0x1954('0x3f')]);_0x251386[_0x1954('0x40')]=qs['filters'](_[_0x1954('0x41')](_0x3a488b[_0x1954('0x36')],_0x41b143['filters']),_0xde7055);if(_0x3a488b['query'][_0x1954('0x42')]){_0x251386[_0x1954('0x40')]=_['merge'](_0x251386[_0x1954('0x40')],{'$or':_[_0x1954('0x2f')](_0xde7055,function(_0x13725c){if(_0x13725c[_0x1954('0x33')]!=='VIRTUAL'){var _0x339b28={};_0x339b28[_0x13725c['name']]={'$like':'%'+_0x3a488b[_0x1954('0x36')][_0x1954('0x42')]+'%'};return _0x339b28;}})});}_0x251386=_[_0x1954('0x43')]({},_0x251386,_0x3a488b['options']);var _0x1c2f3={'where':_0x251386[_0x1954('0x40')]};return db[_0x1954('0x30')][_0x1954('0x20')](_0x1c2f3)[_0x1954('0x28')](function(_0x517492){_0x41c850[_0x1954('0x20')]=_0x517492;if(_0x3a488b['query'][_0x1954('0x44')]){_0x251386['include']=[{'all':!![]}];}return db[_0x1954('0x30')][_0x1954('0x45')](_0x251386);})[_0x1954('0x28')](function(_0x4334f9){_0x41c850['rows']=_0x4334f9;return _0x41c850;})[_0x1954('0x28')](respondWithFilteredResult(_0x1d8f32,_0x251386))['catch'](handleError(_0x1d8f32,null));};exports[_0x1954('0x46')]=function(_0x1435d6,_0x59c4cb){var _0x1dede8={'raw':!![],'where':{'id':_0x1435d6[_0x1954('0x47')]['id']}},_0x45f70e={};_0x45f70e[_0x1954('0x35')]=_[_0x1954('0x37')](db[_0x1954('0x30')][_0x1954('0x31')]);_0x45f70e[_0x1954('0x36')]=_[_0x1954('0x37')](_0x1435d6['query']);_0x45f70e['filters']=_['intersection'](_0x45f70e[_0x1954('0x35')],_0x45f70e['query']);_0x1dede8[_0x1954('0x3a')]=_[_0x1954('0x39')](_0x45f70e[_0x1954('0x35')],qs[_0x1954('0x3b')](_0x1435d6[_0x1954('0x36')][_0x1954('0x3b')]));_0x1dede8[_0x1954('0x3a')]=_0x1dede8[_0x1954('0x3a')][_0x1954('0x48')]?_0x1dede8['attributes']:_0x45f70e['model'];if(_0x1435d6[_0x1954('0x36')]['includeAll']){_0x1dede8[_0x1954('0x49')]=[{'all':!![]}];}_0x1dede8=_['merge']({},_0x1dede8,_0x1435d6[_0x1954('0x4a')]);return db[_0x1954('0x30')][_0x1954('0x4b')](_0x1dede8)[_0x1954('0x28')](handleEntityNotFound(_0x59c4cb,null))[_0x1954('0x28')](respondWithResult(_0x59c4cb,null))[_0x1954('0x4c')](handleError(_0x59c4cb,null));};exports[_0x1954('0x4d')]=function(_0x15ff45,_0x15295e){return db[_0x1954('0x30')]['create'](_0x15ff45[_0x1954('0x4e')],{})[_0x1954('0x28')](respondWithResult(_0x15295e,0xc9))[_0x1954('0x4c')](handleError(_0x15295e,null));};exports[_0x1954('0x27')]=function(_0x510b62,_0x1cd2dd){if(_0x510b62[_0x1954('0x4e')]['id']){delete _0x510b62['body']['id'];}return db[_0x1954('0x30')]['find']({'where':{'id':_0x510b62[_0x1954('0x47')]['id']}})[_0x1954('0x28')](handleEntityNotFound(_0x1cd2dd,null))[_0x1954('0x28')](saveUpdates(_0x510b62[_0x1954('0x4e')],null))[_0x1954('0x28')](respondWithResult(_0x1cd2dd,null))[_0x1954('0x4c')](handleError(_0x1cd2dd,null));};exports[_0x1954('0x29')]=function(_0x49003e,_0x1b4557){return db['WhatsappApplication'][_0x1954('0x4b')]({'where':{'id':_0x49003e[_0x1954('0x47')]['id']}})[_0x1954('0x28')](handleEntityNotFound(_0x1b4557,null))['then'](removeEntity(_0x1b4557,null))[_0x1954('0x4c')](handleError(_0x1b4557,null));}; \ No newline at end of file +var _0x9805=['hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length'];(function(_0x506ef2,_0x51b95b){var _0x1f6e40=function(_0x1b066a){while(--_0x1b066a){_0x506ef2['push'](_0x506ef2['shift']());}};_0x1f6e40(++_0x51b95b);}(_0x9805,0x18f));var _0x5980=function(_0x58bec1,_0x42c53f){_0x58bec1=_0x58bec1-0x0;var _0x16439f=_0x9805[_0x58bec1];return _0x16439f;};'use strict';var emlformat=require(_0x5980('0x0'));var rimraf=require(_0x5980('0x1'));var zipdir=require(_0x5980('0x2'));var jsonpatch=require(_0x5980('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5980('0x4'));var Mustache=require(_0x5980('0x5'));var util=require(_0x5980('0x6'));var path=require(_0x5980('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5980('0x8'));var fs=require('fs');var fs_extra=require(_0x5980('0x9'));var _=require(_0x5980('0xa'));var squel=require(_0x5980('0xb'));var crypto=require(_0x5980('0xc'));var jsforce=require(_0x5980('0xd'));var deskjs=require(_0x5980('0xe'));var toCsv=require(_0x5980('0xf'));var querystring=require(_0x5980('0x10'));var Papa=require(_0x5980('0x11'));var Redis=require(_0x5980('0x12'));var authService=require(_0x5980('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5980('0x14'));var logger=require(_0x5980('0x15'))(_0x5980('0x16'));var utils=require(_0x5980('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5980('0x18'));var db=require(_0x5980('0x19'))['db'];function respondWithStatusCode(_0x59f545,_0x4feb61){_0x4feb61=_0x4feb61||0xcc;return function(_0x1892d4){if(_0x1892d4){return _0x59f545[_0x5980('0x1a')](_0x4feb61);}return _0x59f545[_0x5980('0x1b')](_0x4feb61)[_0x5980('0x1c')]();};}function respondWithResult(_0x9e7cee,_0x3cce48){_0x3cce48=_0x3cce48||0xc8;return function(_0x15fd1a){if(_0x15fd1a){return _0x9e7cee[_0x5980('0x1b')](_0x3cce48)['json'](_0x15fd1a);}};}function respondWithFilteredResult(_0x247cb8,_0x53af6e){return function(_0x46cf94){if(_0x46cf94){var _0x2fcdf2=typeof _0x53af6e[_0x5980('0x1d')]===_0x5980('0x1e')&&typeof _0x53af6e[_0x5980('0x1f')]==='undefined';var _0x278a57=_0x46cf94[_0x5980('0x20')];var _0x462408=_0x2fcdf2?0x0:_0x53af6e[_0x5980('0x1d')];var _0x336ad3=_0x2fcdf2?_0x46cf94[_0x5980('0x20')]:_0x53af6e[_0x5980('0x1d')]+_0x53af6e[_0x5980('0x1f')];var _0x1d1050;if(_0x336ad3>=_0x278a57){_0x336ad3=_0x278a57;_0x1d1050=0xc8;}else{_0x1d1050=0xce;}_0x247cb8[_0x5980('0x1b')](_0x1d1050);return _0x247cb8[_0x5980('0x21')]('Content-Range',_0x462408+'-'+_0x336ad3+'/'+_0x278a57)['json'](_0x46cf94);}return null;};}function patchUpdates(_0x4f5300){return function(_0x216f4a){try{jsonpatch['apply'](_0x216f4a,_0x4f5300,!![]);}catch(_0x47af1d){return BPromise[_0x5980('0x22')](_0x47af1d);}return _0x216f4a[_0x5980('0x23')]();};}function saveUpdates(_0x329cbf,_0x3fa8fe){return function(_0x453aeb){if(_0x453aeb){return _0x453aeb[_0x5980('0x24')](_0x329cbf)[_0x5980('0x25')](function(_0x34a943){return _0x34a943;});}return null;};}function removeEntity(_0x300259,_0x509100){return function(_0x5826d3){if(_0x5826d3){return _0x5826d3[_0x5980('0x26')]()[_0x5980('0x25')](function(){_0x300259[_0x5980('0x1b')](0xcc)[_0x5980('0x1c')]();});}};}function handleEntityNotFound(_0x50c929,_0x5d36f6){return function(_0x5b428e){if(!_0x5b428e){_0x50c929[_0x5980('0x1a')](0x194);}return _0x5b428e;};}function handleError(_0x481cb1,_0x3443a8){_0x3443a8=_0x3443a8||0x1f4;return function(_0x3c84da){logger[_0x5980('0x27')](_0x3c84da[_0x5980('0x28')]);if(_0x3c84da[_0x5980('0x29')]){delete _0x3c84da['name'];}_0x481cb1[_0x5980('0x1b')](_0x3443a8)[_0x5980('0x2a')](_0x3c84da);};}exports[_0x5980('0x2b')]=function(_0x2b436d,_0x13a134){var _0x55e6f6={},_0x55dd71={},_0x4d7e02={'count':0x0,'rows':[]};var _0x34066c=_[_0x5980('0x2c')](db[_0x5980('0x2d')][_0x5980('0x2e')],function(_0x5c97c5){return{'name':_0x5c97c5[_0x5980('0x2f')],'type':_0x5c97c5['type'][_0x5980('0x30')]};});_0x55dd71['model']=_[_0x5980('0x2c')](_0x34066c,'name');_0x55dd71[_0x5980('0x31')]=_[_0x5980('0x32')](_0x2b436d['query']);_0x55dd71[_0x5980('0x33')]=_[_0x5980('0x34')](_0x55dd71[_0x5980('0x35')],_0x55dd71[_0x5980('0x31')]);_0x55e6f6['attributes']=_[_0x5980('0x34')](_0x55dd71[_0x5980('0x35')],qs[_0x5980('0x36')](_0x2b436d[_0x5980('0x31')][_0x5980('0x36')]));_0x55e6f6[_0x5980('0x37')]=_0x55e6f6[_0x5980('0x37')][_0x5980('0x38')]?_0x55e6f6[_0x5980('0x37')]:_0x55dd71[_0x5980('0x35')];if(!_0x2b436d[_0x5980('0x31')][_0x5980('0x39')](_0x5980('0x3a'))){_0x55e6f6[_0x5980('0x1f')]=qs['limit'](_0x2b436d['query'][_0x5980('0x1f')]);_0x55e6f6['offset']=qs['offset'](_0x2b436d[_0x5980('0x31')]['offset']);}_0x55e6f6[_0x5980('0x3b')]=qs['sort'](_0x2b436d[_0x5980('0x31')][_0x5980('0x3c')]);_0x55e6f6[_0x5980('0x3d')]=qs[_0x5980('0x33')](_[_0x5980('0x3e')](_0x2b436d['query'],_0x55dd71[_0x5980('0x33')]),_0x34066c);if(_0x2b436d[_0x5980('0x31')]['filter']){_0x55e6f6[_0x5980('0x3d')]=_[_0x5980('0x3f')](_0x55e6f6[_0x5980('0x3d')],{'$or':_[_0x5980('0x2c')](_0x34066c,function(_0x350169){if(_0x350169[_0x5980('0x40')]!==_0x5980('0x41')){var _0x2f99ab={};_0x2f99ab[_0x350169[_0x5980('0x29')]]={'$like':'%'+_0x2b436d['query']['filter']+'%'};return _0x2f99ab;}})});}_0x55e6f6=_['merge']({},_0x55e6f6,_0x2b436d[_0x5980('0x42')]);var _0x4f152e={'where':_0x55e6f6[_0x5980('0x3d')]};return db['WhatsappApplication'][_0x5980('0x20')](_0x4f152e)['then'](function(_0x35ce10){_0x4d7e02['count']=_0x35ce10;if(_0x2b436d[_0x5980('0x31')][_0x5980('0x43')]){_0x55e6f6[_0x5980('0x44')]=[{'all':!![]}];}return db[_0x5980('0x2d')][_0x5980('0x45')](_0x55e6f6);})[_0x5980('0x25')](function(_0xb14c6f){_0x4d7e02['rows']=_0xb14c6f;return _0x4d7e02;})[_0x5980('0x25')](respondWithFilteredResult(_0x13a134,_0x55e6f6))[_0x5980('0x46')](handleError(_0x13a134,null));};exports[_0x5980('0x47')]=function(_0x251d07,_0x111708){var _0x54ace1={'raw':!![],'where':{'id':_0x251d07[_0x5980('0x48')]['id']}},_0x22d838={};_0x22d838[_0x5980('0x35')]=_[_0x5980('0x32')](db[_0x5980('0x2d')]['rawAttributes']);_0x22d838[_0x5980('0x31')]=_[_0x5980('0x32')](_0x251d07[_0x5980('0x31')]);_0x22d838[_0x5980('0x33')]=_[_0x5980('0x34')](_0x22d838[_0x5980('0x35')],_0x22d838['query']);_0x54ace1[_0x5980('0x37')]=_[_0x5980('0x34')](_0x22d838[_0x5980('0x35')],qs['fields'](_0x251d07[_0x5980('0x31')][_0x5980('0x36')]));_0x54ace1[_0x5980('0x37')]=_0x54ace1[_0x5980('0x37')][_0x5980('0x38')]?_0x54ace1[_0x5980('0x37')]:_0x22d838[_0x5980('0x35')];if(_0x251d07['query'][_0x5980('0x43')]){_0x54ace1[_0x5980('0x44')]=[{'all':!![]}];}_0x54ace1=_[_0x5980('0x3f')]({},_0x54ace1,_0x251d07[_0x5980('0x42')]);return db[_0x5980('0x2d')]['find'](_0x54ace1)[_0x5980('0x25')](handleEntityNotFound(_0x111708,null))['then'](respondWithResult(_0x111708,null))[_0x5980('0x46')](handleError(_0x111708,null));};exports[_0x5980('0x49')]=function(_0x48967a,_0x52f87a){return db[_0x5980('0x2d')]['create'](_0x48967a[_0x5980('0x4a')],{})['then'](respondWithResult(_0x52f87a,0xc9))[_0x5980('0x46')](handleError(_0x52f87a,null));};exports[_0x5980('0x24')]=function(_0x48a5fe,_0x54f017){if(_0x48a5fe[_0x5980('0x4a')]['id']){delete _0x48a5fe[_0x5980('0x4a')]['id'];}return db[_0x5980('0x2d')][_0x5980('0x4b')]({'where':{'id':_0x48a5fe['params']['id']}})[_0x5980('0x25')](handleEntityNotFound(_0x54f017,null))[_0x5980('0x25')](saveUpdates(_0x48a5fe['body'],null))[_0x5980('0x25')](respondWithResult(_0x54f017,null))[_0x5980('0x46')](handleError(_0x54f017,null));};exports[_0x5980('0x26')]=function(_0x4c35ac,_0x8863f1){return db['WhatsappApplication']['find']({'where':{'id':_0x4c35ac['params']['id']}})[_0x5980('0x25')](handleEntityNotFound(_0x8863f1,null))[_0x5980('0x25')](removeEntity(_0x8863f1,null))[_0x5980('0x46')](handleError(_0x8863f1,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index f6a7721..19a5563 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 _0x26d1=['api','moment','bluebird','rimraf','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x3741a3,_0x236559){var _0x3beacd=function(_0x1f30b5){while(--_0x1f30b5){_0x3741a3['push'](_0x3741a3['shift']());}};_0x3beacd(++_0x236559);}(_0x26d1,0x8e));var _0x126d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x26d1[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x126d('0x0'));var util=require('util');var logger=require(_0x126d('0x1'))(_0x126d('0x2'));var moment=require(_0x126d('0x3'));var BPromise=require(_0x126d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x126d('0x5'));var config=require('../../config/environment');var attributes=require(_0x126d('0x6'));module[_0x126d('0x7')]=function(_0x442e04,_0x449ed0){return _0x442e04[_0x126d('0x8')]('WhatsappApplication',attributes,{'tableName':_0x126d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x126d('0xa'),'collate':_0x126d('0xb')});}; \ No newline at end of file +var _0x43fd=['path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','moment','bluebird'];(function(_0x10e75e,_0x286ee2){var _0x15afa8=function(_0x183439){while(--_0x183439){_0x10e75e['push'](_0x10e75e['shift']());}};_0x15afa8(++_0x286ee2);}(_0x43fd,0x1ec));var _0xd43f=function(_0x3a8623,_0xc59a1c){_0x3a8623=_0x3a8623-0x0;var _0x291d1a=_0x43fd[_0x3a8623];return _0x291d1a;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd43f('0x1'));var BPromise=require(_0xd43f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd43f('0x3'));var rimraf=require('rimraf');var config=require(_0xd43f('0x4'));var attributes=require(_0xd43f('0x5'));module[_0xd43f('0x6')]=function(_0x33ddff,_0x52e75f){return _0x33ddff[_0xd43f('0x7')](_0xd43f('0x8'),attributes,{'tableName':_0xd43f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd43f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 41e61ad..86b8bc5 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 _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e94e7,_0x4f3eb2){var _0x208ced=function(_0x5d83d3){while(--_0x5d83d3){_0x5e94e7['push'](_0x5e94e7['shift']());}};_0x208ced(++_0x4f3eb2);}(_0xac31,0xca));var _0x1ac3=function(_0x125dfb,_0x2808f3){_0x125dfb=_0x125dfb-0x0;var _0x3655ee=_0xac31[_0x125dfb];return _0x3655ee;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0xeec6=['then','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0xeec6,0x1c2));var _0x6eec=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xeec6[_0x1a4748];return _0x28ca99;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 080f1f8..c42c1a2 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 _0x6c7b=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages'];(function(_0xa1897d,_0x27ff3e){var _0x144f7e=function(_0x539eef){while(--_0x539eef){_0xa1897d['push'](_0xa1897d['shift']());}};_0x144f7e(++_0x27ff3e);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x5257f4,_0x54558d){_0x5257f4=_0x5257f4-0x0;var _0x463559=_0x6c7b[_0x5257f4];return _0x463559;};'use strict';var multer=require(_0xb6c7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6c7('0x1'));var router=express['Router']();var fs_extra=require(_0xb6c7('0x2'));var auth=require(_0xb6c7('0x3'));var interaction=require(_0xb6c7('0x4'));var config=require('../../config/environment');var controller=require(_0xb6c7('0x5'));router[_0xb6c7('0x6')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x8')]);router[_0xb6c7('0x6')]('/describe',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x9')]);router[_0xb6c7('0x6')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xb')]);router[_0xb6c7('0x6')](_0xb6c7('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb6c7('0x6')](_0xb6c7('0xd'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xe')]);router[_0xb6c7('0xf')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x10')]);router['post'](_0xb6c7('0xc'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x11')]);router[_0xb6c7('0xf')](_0xb6c7('0x12'),auth[_0xb6c7('0x7')](),interaction[_0xb6c7('0x13')]('whatsapp',_0xb6c7('0x14')),controller['addTags']);router['put']('/:id',auth[_0xb6c7('0x7')](),interaction['tracked'](_0xb6c7('0x15'),_0xb6c7('0x16')),controller[_0xb6c7('0x17')]);router[_0xb6c7('0x18')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),interaction[_0xb6c7('0x13')](_0xb6c7('0x15'),_0xb6c7('0x19')),controller[_0xb6c7('0x1a')]);router[_0xb6c7('0x18')](_0xb6c7('0x12'),auth[_0xb6c7('0x7')](),controller['removeTags']);module[_0xb6c7('0x1b')]=router; \ No newline at end of file +var _0x5f6f=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','delete','whatsappinteraction:destroy'];(function(_0x37df7f,_0x4c827d){var _0x59fd67=function(_0x3069ce){while(--_0x3069ce){_0x37df7f['push'](_0x37df7f['shift']());}};_0x59fd67(++_0x4c827d);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x4dfb1b,_0x26850a){_0x4dfb1b=_0x4dfb1b-0x0;var _0x4dc88=_0x5f6f[_0x4dfb1b];return _0x4dc88;};'use strict';var multer=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var path=require(_0xf5f6('0x2'));var timeout=require(_0xf5f6('0x3'));var express=require(_0xf5f6('0x4'));var router=express['Router']();var fs_extra=require(_0xf5f6('0x5'));var auth=require(_0xf5f6('0x6'));var interaction=require(_0xf5f6('0x7'));var config=require('../../config/environment');var controller=require(_0xf5f6('0x8'));router[_0xf5f6('0x9')]('/',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xb')]);router['get']('/describe',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xc')]);router[_0xf5f6('0x9')](_0xf5f6('0xd'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xe')]);router['get']('/:id/messages',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xf')]);router['get'](_0xf5f6('0x10'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x11')]);router[_0xf5f6('0x12')]('/',auth[_0xf5f6('0xa')](),controller['create']);router[_0xf5f6('0x12')]('/:id/messages',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x13')]);router[_0xf5f6('0x12')](_0xf5f6('0x14'),auth['isAuthenticated'](),interaction[_0xf5f6('0x15')](_0xf5f6('0x16'),_0xf5f6('0x17')),controller[_0xf5f6('0x18')]);router['put'](_0xf5f6('0xd'),auth[_0xf5f6('0xa')](),interaction[_0xf5f6('0x15')](_0xf5f6('0x16'),'whatsappinteraction:update'),controller['update']);router[_0xf5f6('0x19')]('/:id',auth[_0xf5f6('0xa')](),interaction['tracked'](_0xf5f6('0x16'),_0xf5f6('0x1a')),controller[_0xf5f6('0x1b')]);router[_0xf5f6('0x19')](_0xf5f6('0x14'),auth[_0xf5f6('0xa')](),controller['removeTags']);module[_0xf5f6('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 45bfc7f..c6d9caa 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 _0x1e82=['STRING','out','ENUM','INTEGER','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x3d42ba,_0x1b6cf4){var _0x35a185=function(_0x35ff89){while(--_0x35ff89){_0x3d42ba['push'](_0x3d42ba['shift']());}};_0x35a185(++_0x1b6cf4);}(_0x1e82,0x8b));var _0x21e8=function(_0x44b717,_0x501b08){_0x44b717=_0x44b717-0x0;var _0x1d50df=_0x1e82[_0x44b717];return _0x1d50df;};'use strict';var Sequelize=require(_0x21e8('0x0'));var moment=require(_0x21e8('0x1'));module[_0x21e8('0x2')]={'closed':{'type':Sequelize[_0x21e8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x21e8('0x4')]},'disposition':{'type':Sequelize[_0x21e8('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x21e8('0x5')]},'note':{'type':Sequelize[_0x21e8('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x21e8('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x21e8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x21e8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x21e8('0x7')]('in',_0x21e8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x21e8('0x8')]}}; \ No newline at end of file +var _0x2884=['ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x4887b7,_0x3f541b){var _0x5168dd=function(_0x2c291c){while(--_0x2c291c){_0x4887b7['push'](_0x4887b7['shift']());}};_0x5168dd(++_0x3f541b);}(_0x2884,0x1eb));var _0x4288=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0x2884[_0x4b64a4];return _0xd19b0e;};'use strict';var Sequelize=require(_0x4288('0x0'));var moment=require('moment');module[_0x4288('0x1')]={'closed':{'type':Sequelize[_0x4288('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4288('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4288('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4288('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4288('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4288('0x5')]('in',_0x4288('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4288('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4288('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index b2d4659..8ec6a55 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 _0xa896=['destroy','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','findOne','hasOwnProperty','order','sort','where','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','omit','Tag','emit','whatsappInteractionTags:save','download','unix','toString','server','tmp','root','attachments','transcript-%d-%s.zip','join','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','closedAt','existsSync','createReadStream','pipe','createWriteStream','basename','System','Contact','out','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then'];(function(_0xd8fc8e,_0x34e2b5){var _0xcb25c=function(_0x1c1a03){while(--_0x1c1a03){_0xd8fc8e['push'](_0xd8fc8e['shift']());}};_0xcb25c(++_0x34e2b5);}(_0xa896,0xe0));var _0x6a89=function(_0x5c3528,_0x57448d){_0x5c3528=_0x5c3528-0x0;var _0x91ad9f=_0xa896[_0x5c3528];return _0x91ad9f;};'use strict';var rimraf=require(_0x6a89('0x0'));var zipdir=require(_0x6a89('0x1'));var moment=require('moment');var BPromise=require(_0x6a89('0x2'));var util=require(_0x6a89('0x3'));var path=require(_0x6a89('0x4'));var ejs=require(_0x6a89('0x5'));var fs=require('fs');var _=require(_0x6a89('0x6'));var Redis=require(_0x6a89('0x7'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x6a89('0x8'));var logger=require(_0x6a89('0x9'))(_0x6a89('0xa'));var config=require(_0x6a89('0xb'));var db=require('../../mysqldb')['db'];config[_0x6a89('0xc')]=_[_0x6a89('0xd')](config[_0x6a89('0xc')],{'host':_0x6a89('0xe'),'port':0x18eb});var socket=require(_0x6a89('0xf'))(new Redis(config[_0x6a89('0xc')]));require(_0x6a89('0x10'))[_0x6a89('0x11')](socket);function respondWithStatusCode(_0x148055,_0x57b7e0){_0x57b7e0=_0x57b7e0||0xcc;return function(_0x11f650){if(_0x11f650){return _0x148055[_0x6a89('0x12')](_0x57b7e0);}return _0x148055[_0x6a89('0x13')](_0x57b7e0)[_0x6a89('0x14')]();};}function respondWithResult(_0x55d946,_0x42f1b4){_0x42f1b4=_0x42f1b4||0xc8;return function(_0x1fc17b){if(_0x1fc17b){return _0x55d946[_0x6a89('0x13')](_0x42f1b4)['json'](_0x1fc17b);}};}function respondWithFilteredResult(_0x5dbef6,_0x31f984){return function(_0x306705){if(_0x306705){var _0x6e11a4=typeof _0x31f984[_0x6a89('0x15')]===_0x6a89('0x16')&&typeof _0x31f984[_0x6a89('0x17')]===_0x6a89('0x16');var _0xd7427=_0x306705[_0x6a89('0x18')];var _0x4480eb=_0x6e11a4?0x0:_0x31f984[_0x6a89('0x15')];var _0x278669=_0x6e11a4?_0x306705[_0x6a89('0x18')]:_0x31f984[_0x6a89('0x15')]+_0x31f984[_0x6a89('0x17')];var _0x5edfaa;if(_0x278669>=_0xd7427){_0x278669=_0xd7427;_0x5edfaa=0xc8;}else{_0x5edfaa=0xce;}_0x5dbef6['status'](_0x5edfaa);return _0x5dbef6[_0x6a89('0x19')](_0x6a89('0x1a'),_0x4480eb+'-'+_0x278669+'/'+_0xd7427)[_0x6a89('0x1b')](_0x306705);}return null;};}function saveUpdates(_0x460d21){return function(_0x10524b){if(_0x10524b){return _0x10524b[_0x6a89('0x1c')](_0x460d21)[_0x6a89('0x1d')](function(_0x3c8399){return _0x3c8399;});}return null;};}function removeEntity(_0x4d92f){return function(_0x3967e4){if(_0x3967e4){return _0x3967e4[_0x6a89('0x1e')]()['then'](function(){_0x4d92f[_0x6a89('0x13')](0xcc)[_0x6a89('0x14')]();});}};}function handleEntityNotFound(_0xac9ef){return function(_0x5d91c0){if(!_0x5d91c0){_0xac9ef[_0x6a89('0x12')](0x194);}return _0x5d91c0;};}function handleError(_0x7b8b9,_0x4e8993){_0x4e8993=_0x4e8993||0x1f4;return function(_0x29b598){logger['error'](_0x29b598[_0x6a89('0x1f')]);if(_0x29b598[_0x6a89('0x20')]){delete _0x29b598[_0x6a89('0x20')];}_0x7b8b9[_0x6a89('0x13')](_0x4e8993)[_0x6a89('0x21')](_0x29b598);};}exports[_0x6a89('0x22')]=function(_0x180b6d,_0x565ac5){var _0x562b3a={};var _0x2a2d91=_[_0x6a89('0x23')](db[_0x6a89('0x24')][_0x6a89('0x25')],function(_0x5a7343){return{'name':_0x5a7343[_0x6a89('0x26')],'type':_0x5a7343[_0x6a89('0x27')][_0x6a89('0x28')]};});_0x562b3a=qs[_0x6a89('0x29')](_0x2a2d91,_0x180b6d);return interaction[_0x6a89('0x2a')](_0x6a89('0x2b'),_0x180b6d['query'],_0x180b6d['user'],_0x562b3a,_0x2a2d91)[_0x6a89('0x1d')](respondWithFilteredResult(_0x565ac5,_0x562b3a))[_0x6a89('0x2c')](handleError(_0x565ac5,null));};exports[_0x6a89('0x2d')]=function(_0x54e5bb,_0x3f1a8b){var _0x4c6a4f={'raw':![],'where':{'id':_0x54e5bb[_0x6a89('0x2e')]['id']}},_0x3b5ee4={};_0x3b5ee4[_0x6a89('0x2f')]=_[_0x6a89('0x30')](db[_0x6a89('0x24')][_0x6a89('0x25')]);_0x3b5ee4['query']=_['keys'](_0x54e5bb[_0x6a89('0x31')]);_0x3b5ee4[_0x6a89('0x32')]=_[_0x6a89('0x33')](_0x3b5ee4[_0x6a89('0x2f')],_0x3b5ee4[_0x6a89('0x31')]);_0x4c6a4f[_0x6a89('0x34')]=_[_0x6a89('0x33')](_0x3b5ee4[_0x6a89('0x2f')],qs[_0x6a89('0x35')](_0x54e5bb[_0x6a89('0x31')][_0x6a89('0x35')]));_0x4c6a4f[_0x6a89('0x34')]=_0x4c6a4f['attributes'][_0x6a89('0x36')]?_0x4c6a4f['attributes']:_0x3b5ee4[_0x6a89('0x2f')];if(_0x54e5bb[_0x6a89('0x31')][_0x6a89('0x37')]){_0x4c6a4f[_0x6a89('0x38')]=[{'all':!![]}];}_0x4c6a4f=_[_0x6a89('0x39')]({},_0x4c6a4f,_0x54e5bb[_0x6a89('0x3a')]);return db[_0x6a89('0x24')][_0x6a89('0x3b')](_0x4c6a4f)[_0x6a89('0x1d')](handleEntityNotFound(_0x3f1a8b,null))[_0x6a89('0x1d')](respondWithResult(_0x3f1a8b,null))[_0x6a89('0x2c')](handleError(_0x3f1a8b,null));};exports[_0x6a89('0x3c')]=function(_0x24d2a2,_0x208043){return db[_0x6a89('0x24')]['create'](_0x24d2a2['body'],{})[_0x6a89('0x1d')](respondWithResult(_0x208043,0xc9))[_0x6a89('0x2c')](handleError(_0x208043,null));};exports[_0x6a89('0x1c')]=function(_0x5bcc77,_0x20c8aa){if(_0x5bcc77[_0x6a89('0x3d')]['id']){delete _0x5bcc77['body']['id'];}return db[_0x6a89('0x24')][_0x6a89('0x3b')]({'where':{'id':_0x5bcc77['params']['id']}})['then'](handleEntityNotFound(_0x20c8aa,null))[_0x6a89('0x1d')](saveUpdates(_0x5bcc77[_0x6a89('0x3d')],null))[_0x6a89('0x1d')](respondWithResult(_0x20c8aa,null))[_0x6a89('0x2c')](handleError(_0x20c8aa,null));};exports[_0x6a89('0x1e')]=function(_0xf60ac8,_0x1e777c){return db[_0x6a89('0x24')]['find']({'where':{'id':_0xf60ac8[_0x6a89('0x2e')]['id']}})[_0x6a89('0x1d')](handleEntityNotFound(_0x1e777c,null))[_0x6a89('0x1d')](removeEntity(_0x1e777c,null))[_0x6a89('0x2c')](handleError(_0x1e777c,null));};exports[_0x6a89('0x3e')]=function(_0x513028,_0x1b7257){return db[_0x6a89('0x24')][_0x6a89('0x3e')]()[_0x6a89('0x1d')](respondWithResult(_0x1b7257,null))[_0x6a89('0x2c')](handleError(_0x1b7257,null));};exports[_0x6a89('0x3f')]=function(_0x3adf22,_0x1941c9){return db[_0x6a89('0x40')]['find']({'where':{'id':_0x3adf22[_0x6a89('0x2e')]['id']}})[_0x6a89('0x1d')](handleEntityNotFound(_0x1941c9,null))[_0x6a89('0x1d')](function(_0x4ee2ef){if(_0x4ee2ef){return _0x4ee2ef[_0x6a89('0x3f')](_0x3adf22[_0x6a89('0x3d')][_0x6a89('0x41')],_['omit'](_0x3adf22[_0x6a89('0x3d')],[_0x6a89('0x41'),'id'])||{});}})['then'](respondWithResult(_0x1941c9,null))[_0x6a89('0x2c')](handleError(_0x1941c9,null));};exports['getMessages']=function(_0x4eccae,_0xc948bd){var _0xab4e66={'raw':![],'where':{}};var _0x142412={};var _0x19dae8={'count':0x0,'rows':[]};return db[_0x6a89('0x24')][_0x6a89('0x42')]({'where':{'id':_0x4eccae['params']['id']}})[_0x6a89('0x1d')](handleEntityNotFound(_0xc948bd,null))[_0x6a89('0x1d')](function(_0x5030dc){if(_0x5030dc){_0x142412[_0x6a89('0x2f')]=_[_0x6a89('0x30')](db['WhatsappMessage'][_0x6a89('0x25')]);_0x142412[_0x6a89('0x31')]=_[_0x6a89('0x30')](_0x4eccae[_0x6a89('0x31')]);_0x142412[_0x6a89('0x32')]=_[_0x6a89('0x33')](_0x142412[_0x6a89('0x2f')],_0x142412['query']);_0xab4e66[_0x6a89('0x34')]=_[_0x6a89('0x33')](_0x142412[_0x6a89('0x2f')],qs[_0x6a89('0x35')](_0x4eccae[_0x6a89('0x31')][_0x6a89('0x35')]));_0xab4e66[_0x6a89('0x34')]=_0xab4e66['attributes'][_0x6a89('0x36')]?_0xab4e66[_0x6a89('0x34')]:_0x142412[_0x6a89('0x2f')];if(!_0x4eccae[_0x6a89('0x31')][_0x6a89('0x43')]('nolimit')){_0xab4e66[_0x6a89('0x17')]=qs[_0x6a89('0x17')](_0x4eccae[_0x6a89('0x31')][_0x6a89('0x17')]);_0xab4e66['offset']=qs[_0x6a89('0x15')](_0x4eccae[_0x6a89('0x31')][_0x6a89('0x15')]);}_0xab4e66[_0x6a89('0x44')]=qs[_0x6a89('0x45')](_0x4eccae[_0x6a89('0x31')][_0x6a89('0x45')]);_0xab4e66[_0x6a89('0x46')]=qs['filters'](_[_0x6a89('0x47')](_0x4eccae[_0x6a89('0x31')],_0x142412[_0x6a89('0x32')]));_0xab4e66[_0x6a89('0x46')]['WhatsappInteractionId']=_0x5030dc['id'];if(_0x4eccae[_0x6a89('0x31')][_0x6a89('0x48')]){_0xab4e66['where']=_['merge'](_0xab4e66[_0x6a89('0x46')],{'$or':_[_0x6a89('0x23')](_0xab4e66['attributes'],function(_0x574223){var _0x225516={};_0x225516[_0x574223]={'$like':'%'+_0x4eccae[_0x6a89('0x31')][_0x6a89('0x48')]+'%'};return _0x225516;})});}if(_0x4eccae[_0x6a89('0x31')][_0x6a89('0x49')]){var _0x34d7c5=_0x4eccae[_0x6a89('0x31')][_0x6a89('0x49')]['split'](',');var _0x496f88={};_0x496f88[_0x34d7c5[0x0]]={'$gte':moment(_0x34d7c5[0x1])[_0x6a89('0x4a')](_0x6a89('0x4b'))};_0xab4e66[_0x6a89('0x46')]=_['merge'](_0xab4e66['where'],_0x496f88);}_0xab4e66=_[_0x6a89('0x39')]({},_0xab4e66,_0x4eccae[_0x6a89('0x3a')]);return db[_0x6a89('0x40')][_0x6a89('0x18')]({'where':_0xab4e66[_0x6a89('0x46')]})[_0x6a89('0x1d')](function(_0x5b65b3){_0x19dae8[_0x6a89('0x18')]=_0x5b65b3;if(_0x4eccae[_0x6a89('0x31')][_0x6a89('0x37')]){_0xab4e66[_0x6a89('0x38')]=[{'all':!![]}];}return db[_0x6a89('0x40')][_0x6a89('0x2a')](_0xab4e66);})[_0x6a89('0x1d')](function(_0x255033){_0x19dae8[_0x6a89('0x4c')]=_0x255033;return _0x19dae8;});}})[_0x6a89('0x1d')](respondWithFilteredResult(_0xc948bd,_0xab4e66))['catch'](handleError(_0xc948bd,null));};exports['addTags']=function(_0x303037,_0xa4f18a){return db['WhatsappInteraction'][_0x6a89('0x3b')]({'where':{'id':_0x303037[_0x6a89('0x2e')]['id']}})[_0x6a89('0x1d')](handleEntityNotFound(_0xa4f18a,null))[_0x6a89('0x1d')](function(_0x49180e){if(_0x49180e){return _0x49180e['setTags'](_0x303037['body'][_0x6a89('0x41')],_[_0x6a89('0x4d')](_0x303037['body'],[_0x6a89('0x41'),'id'])||{})['spread'](function(){return db[_0x6a89('0x4e')][_0x6a89('0x2a')]({'attributes':['id',_0x6a89('0x20'),'color'],'where':{'id':_0x303037['body'][_0x6a89('0x41')]}});})[_0x6a89('0x1d')](function(_0x5ae143){socket[_0x6a89('0x4f')](_0x6a89('0x50'),{'id':Number(_0x303037[_0x6a89('0x2e')]['id']),'tags':_0x5ae143||[]});return{'id':Number(_0x303037[_0x6a89('0x2e')]['id']),'tags':_0x5ae143||[]};});}})['then'](respondWithResult(_0xa4f18a,null))[_0x6a89('0x2c')](handleError(_0xa4f18a,null));};exports['removeTags']=function(_0x41d025,_0x373ccd){return db['WhatsappInteraction'][_0x6a89('0x3b')]({'where':{'id':_0x41d025['params']['id']}})['then'](handleEntityNotFound(_0x373ccd,null))[_0x6a89('0x1d')](function(_0x2c5522){if(_0x2c5522){return _0x2c5522['removeTags'](_0x41d025[_0x6a89('0x31')][_0x6a89('0x41')]);}})[_0x6a89('0x1d')](respondWithStatusCode(_0x373ccd,null))['catch'](handleError(_0x373ccd,null));};exports[_0x6a89('0x51')]=function(_0x4c1569,_0x294402){var _0x40efeb=moment()[_0x6a89('0x52')]()[_0x6a89('0x53')]();var _0x51e8c1=path['join'](config['root'],_0x6a89('0x54'),'files',_0x6a89('0x55'));var _0x76e856=path['join'](config[_0x6a89('0x56')],'server','files',_0x6a89('0x57'));var _0x8dcee2=path['join'](_0x51e8c1,_0x40efeb);var _0x1f212d=util[_0x6a89('0x4a')](_0x6a89('0x58'),_0x4c1569[_0x6a89('0x2e')]['id'],_0x40efeb);var _0x6436b2=path[_0x6a89('0x59')](_0x51e8c1,_0x1f212d);var _0x52a4e0=[];_0x52a4e0[_0x6a89('0x5a')]({'model':db[_0x6a89('0x5b')],'as':'User','attributes':['id',_0x6a89('0x5c')],'raw':!![]});_0x52a4e0[_0x6a89('0x5a')]({'model':db[_0x6a89('0x5d')],'as':'Contact','attributes':['id',_0x6a89('0x5e'),_0x6a89('0x5f')],'raw':!![]});if(_0x4c1569[_0x6a89('0x31')][_0x6a89('0x57')]){_0x52a4e0[_0x6a89('0x5a')]({'model':db[_0x6a89('0x60')],'as':'Attachment','raw':!![]});}var _0x4145a1=[{'model':db[_0x6a89('0x40')],'as':_0x6a89('0x61'),'attributes':['id',_0x6a89('0x3d'),_0x6a89('0x62'),_0x6a89('0x63'),_0x6a89('0x64'),'read'],'include':_0x52a4e0}];_0x4145a1[_0x6a89('0x5a')]({'model':db[_0x6a89('0x65')],'as':_0x6a89('0x66'),'attributes':['id',_0x6a89('0x20')]});_0x4145a1['push']({'model':db[_0x6a89('0x5b')],'as':_0x6a89('0x67'),'attributes':['id',_0x6a89('0x5c')]});return db[_0x6a89('0x24')][_0x6a89('0x3b')]({'where':{'id':_0x4c1569[_0x6a89('0x2e')]['id']},'include':_0x4145a1})[_0x6a89('0x1d')](handleEntityNotFound(_0x294402,null))['then'](function(_0x39e7e9){if(_0x39e7e9){var _0x331fe6=_0x39e7e9[_0x6a89('0x68')]({'plain':!![]});fs[_0x6a89('0x69')](_0x8dcee2);var _0x4b238d={'channel':'Whatsapp','account':_0x331fe6[_0x6a89('0x66')][_0x6a89('0x20')],'agent':_0x331fe6[_0x6a89('0x67')]?_0x331fe6[_0x6a89('0x67')][_0x6a89('0x5c')]:_0x6a89('0x6a'),'createdAt':moment(_0x331fe6[_0x6a89('0x62')])[_0x6a89('0x4a')](_0x6a89('0x4b'))[_0x6a89('0x53')](),'closedAt':_0x331fe6['closed']?moment(_0x331fe6[_0x6a89('0x6b')])[_0x6a89('0x4a')](_0x6a89('0x4b'))[_0x6a89('0x53')]():'','disposition':_0x331fe6['disposition'],'messages':_(_0x331fe6['Messages'])['filter']({'secret':![]})[_0x6a89('0x23')](function(_0x4e6f12){if(_0x4e6f12[_0x6a89('0x60')]){var _0x3c90f5=path[_0x6a89('0x59')](_0x76e856,_0x4e6f12['Attachment']['basename']);if(fs[_0x6a89('0x6c')](_0x3c90f5)){fs[_0x6a89('0x6d')](_0x3c90f5)[_0x6a89('0x6e')](fs[_0x6a89('0x6f')](path['join'](_0x8dcee2,_0x4e6f12[_0x6a89('0x60')][_0x6a89('0x70')])));}}return{'date':moment(_0x4e6f12[_0x6a89('0x62')])[_0x6a89('0x4a')](_0x6a89('0x4b'))['toString'](),'sender':_0x4e6f12['direction']==='out'?_0x4e6f12[_0x6a89('0x5b')]?_0x4e6f12[_0x6a89('0x5b')]['fullname']:_0x6a89('0x71'):_0x4e6f12[_0x6a89('0x72')][_0x6a89('0x5e')]+(_0x4e6f12[_0x6a89('0x72')][_0x6a89('0x5f')]?'\x20'+_0x4e6f12[_0x6a89('0x72')][_0x6a89('0x5f')]:''),'body':_0x4e6f12[_0x6a89('0x60')]?_0x4e6f12[_0x6a89('0x60')][_0x6a89('0x70')]:_0x4e6f12[_0x6a89('0x3d')],'direction':_0x4e6f12[_0x6a89('0x63')]===_0x6a89('0x73')?'A':'C','secret':_0x4e6f12[_0x6a89('0x64')],'read':_0x4e6f12[_0x6a89('0x74')],'attachment':_0x4e6f12[_0x6a89('0x60')]};})[_0x6a89('0x75')]()};return ejs[_0x6a89('0x76')](path['join'](config['root'],'server',_0x6a89('0x77'),_0x6a89('0x78')),{'interaction':_0x4b238d})[_0x6a89('0x1d')](function(_0x1c69a9){var _0x5915ab=path[_0x6a89('0x59')](_0x8dcee2,_0x6a89('0x79')+_0x331fe6['id']+'-'+_0x40efeb+_0x6a89('0x7a'));var _0x5a3fb2={'path':_0x5915ab,'channel':_0x6a89('0x7b'),'interactionId':_0x331fe6['id']};return pdf[_0x6a89('0x7c')](_0x1c69a9,_0x5a3fb2);})['then'](function(){return new BPromise(function(_0x22a35e,_0x2b4cfc){zipdir(_0x8dcee2,{'saveTo':_0x6436b2},function(_0x1d4b5f,_0x15bb06){if(_0x1d4b5f)return _0x2b4cfc(_0x1d4b5f);return _0x22a35e(_0x15bb06);});})['then'](function(){return new BPromise(function(_0x27f5dc,_0x5c751c){rimraf(_0x8dcee2,function(_0x21b9a0){if(_0x21b9a0)_0x5c751c(_0x21b9a0);return _0x27f5dc();});});})[_0x6a89('0x1d')](function(){return _0x294402[_0x6a89('0x51')](_0x6436b2,_0x1f212d,function(_0x1a0a38){if(_0x1a0a38){console['log'](_0x6a89('0x7d'),_0x1a0a38);}else{fs[_0x6a89('0x7e')](_0x6436b2);}});});});}else{return _0x294402[_0x6a89('0x12')](0xc8);}})['catch'](handleError(_0x294402,null));}; \ No newline at end of file +var _0xc102=['path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','sendStatus','end','status','json','offset','undefined','limit','count','set','then','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Owner','get','Whatsapp','Account','disposition','basename','createReadStream','pipe','createWriteStream','out','System','lastName','read','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc102,0x77));var _0x2c10=function(_0x78b2d4,_0x4069b1){_0x78b2d4=_0x78b2d4-0x0;var _0x12290e=_0xc102[_0x78b2d4];return _0x12290e;};'use strict';var rimraf=require(_0x2c10('0x0'));var zipdir=require(_0x2c10('0x1'));var moment=require(_0x2c10('0x2'));var BPromise=require(_0x2c10('0x3'));var util=require(_0x2c10('0x4'));var path=require(_0x2c10('0x5'));var ejs=require(_0x2c10('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c10('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x2c10('0x8'));var pdf=require(_0x2c10('0x9'));var logger=require(_0x2c10('0xa'))('api');var config=require(_0x2c10('0xb'));var db=require(_0x2c10('0xc'))['db'];config['redis']=_[_0x2c10('0xd')](config['redis'],{'host':_0x2c10('0xe'),'port':0x18eb});var socket=require(_0x2c10('0xf'))(new Redis(config[_0x2c10('0x10')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x54c0d6,_0x5da98b){_0x5da98b=_0x5da98b||0xcc;return function(_0x428a8a){if(_0x428a8a){return _0x54c0d6[_0x2c10('0x11')](_0x5da98b);}return _0x54c0d6['status'](_0x5da98b)[_0x2c10('0x12')]();};}function respondWithResult(_0x3255cc,_0x54bdcc){_0x54bdcc=_0x54bdcc||0xc8;return function(_0x17abe0){if(_0x17abe0){return _0x3255cc[_0x2c10('0x13')](_0x54bdcc)[_0x2c10('0x14')](_0x17abe0);}};}function respondWithFilteredResult(_0x1f6d8e,_0x2b2262){return function(_0xd1934){if(_0xd1934){var _0x37bcfa=typeof _0x2b2262[_0x2c10('0x15')]===_0x2c10('0x16')&&typeof _0x2b2262[_0x2c10('0x17')]===_0x2c10('0x16');var _0x2e45bb=_0xd1934['count'];var _0xace6b2=_0x37bcfa?0x0:_0x2b2262[_0x2c10('0x15')];var _0x570c0c=_0x37bcfa?_0xd1934[_0x2c10('0x18')]:_0x2b2262[_0x2c10('0x15')]+_0x2b2262['limit'];var _0x39a47f;if(_0x570c0c>=_0x2e45bb){_0x570c0c=_0x2e45bb;_0x39a47f=0xc8;}else{_0x39a47f=0xce;}_0x1f6d8e[_0x2c10('0x13')](_0x39a47f);return _0x1f6d8e[_0x2c10('0x19')]('Content-Range',_0xace6b2+'-'+_0x570c0c+'/'+_0x2e45bb)['json'](_0xd1934);}return null;};}function saveUpdates(_0x36eb93){return function(_0x3ec6ee){if(_0x3ec6ee){return _0x3ec6ee['update'](_0x36eb93)[_0x2c10('0x1a')](function(_0x42dd8c){return _0x42dd8c;});}return null;};}function removeEntity(_0xe20e9f){return function(_0x4f78c0){if(_0x4f78c0){return _0x4f78c0['destroy']()[_0x2c10('0x1a')](function(){_0xe20e9f['status'](0xcc)[_0x2c10('0x12')]();});}};}function handleEntityNotFound(_0xa774e2){return function(_0x4492c4){if(!_0x4492c4){_0xa774e2['sendStatus'](0x194);}return _0x4492c4;};}function handleError(_0x2e48a5,_0x959949){_0x959949=_0x959949||0x1f4;return function(_0x86e0c1){logger[_0x2c10('0x1b')](_0x86e0c1[_0x2c10('0x1c')]);if(_0x86e0c1[_0x2c10('0x1d')]){delete _0x86e0c1[_0x2c10('0x1d')];}_0x2e48a5['status'](_0x959949)[_0x2c10('0x1e')](_0x86e0c1);};}exports[_0x2c10('0x1f')]=function(_0xc33981,_0x413b99){var _0x4fab3b={};var _0x31379e=_[_0x2c10('0x20')](db[_0x2c10('0x21')][_0x2c10('0x22')],function(_0x54097f){return{'name':_0x54097f[_0x2c10('0x23')],'type':_0x54097f[_0x2c10('0x24')]['key']};});_0x4fab3b=qs[_0x2c10('0x25')](_0x31379e,_0xc33981);return interaction[_0x2c10('0x26')]('whatsapp',_0xc33981[_0x2c10('0x27')],_0xc33981[_0x2c10('0x28')],_0x4fab3b,_0x31379e)['then'](respondWithFilteredResult(_0x413b99,_0x4fab3b))[_0x2c10('0x29')](handleError(_0x413b99,null));};exports['show']=function(_0x38d66e,_0x1b2800){var _0x4ef386={'raw':![],'where':{'id':_0x38d66e[_0x2c10('0x2a')]['id']}},_0x378dfc={};_0x378dfc[_0x2c10('0x2b')]=_[_0x2c10('0x2c')](db[_0x2c10('0x21')][_0x2c10('0x22')]);_0x378dfc[_0x2c10('0x27')]=_[_0x2c10('0x2c')](_0x38d66e[_0x2c10('0x27')]);_0x378dfc[_0x2c10('0x2d')]=_[_0x2c10('0x2e')](_0x378dfc[_0x2c10('0x2b')],_0x378dfc[_0x2c10('0x27')]);_0x4ef386[_0x2c10('0x2f')]=_[_0x2c10('0x2e')](_0x378dfc[_0x2c10('0x2b')],qs['fields'](_0x38d66e['query'][_0x2c10('0x30')]));_0x4ef386['attributes']=_0x4ef386[_0x2c10('0x2f')][_0x2c10('0x31')]?_0x4ef386['attributes']:_0x378dfc['model'];if(_0x38d66e['query'][_0x2c10('0x32')]){_0x4ef386[_0x2c10('0x33')]=[{'all':!![]}];}_0x4ef386=_[_0x2c10('0x34')]({},_0x4ef386,_0x38d66e[_0x2c10('0x35')]);return db['WhatsappInteraction'][_0x2c10('0x36')](_0x4ef386)[_0x2c10('0x1a')](handleEntityNotFound(_0x1b2800,null))[_0x2c10('0x1a')](respondWithResult(_0x1b2800,null))['catch'](handleError(_0x1b2800,null));};exports[_0x2c10('0x37')]=function(_0xe344b,_0x25280c){return db[_0x2c10('0x21')]['create'](_0xe344b[_0x2c10('0x38')],{})['then'](respondWithResult(_0x25280c,0xc9))[_0x2c10('0x29')](handleError(_0x25280c,null));};exports['update']=function(_0x880059,_0x127a74){if(_0x880059[_0x2c10('0x38')]['id']){delete _0x880059[_0x2c10('0x38')]['id'];}return db[_0x2c10('0x21')][_0x2c10('0x36')]({'where':{'id':_0x880059['params']['id']}})[_0x2c10('0x1a')](handleEntityNotFound(_0x127a74,null))[_0x2c10('0x1a')](saveUpdates(_0x880059['body'],null))[_0x2c10('0x1a')](respondWithResult(_0x127a74,null))[_0x2c10('0x29')](handleError(_0x127a74,null));};exports[_0x2c10('0x39')]=function(_0x3a9b29,_0x55d454){return db['WhatsappInteraction'][_0x2c10('0x36')]({'where':{'id':_0x3a9b29['params']['id']}})[_0x2c10('0x1a')](handleEntityNotFound(_0x55d454,null))[_0x2c10('0x1a')](removeEntity(_0x55d454,null))[_0x2c10('0x29')](handleError(_0x55d454,null));};exports['describe']=function(_0xa4da1d,_0x3bd199){return db[_0x2c10('0x21')][_0x2c10('0x3a')]()[_0x2c10('0x1a')](respondWithResult(_0x3bd199,null))[_0x2c10('0x29')](handleError(_0x3bd199,null));};exports[_0x2c10('0x3b')]=function(_0x27492f,_0x3afb52){return db[_0x2c10('0x3c')][_0x2c10('0x36')]({'where':{'id':_0x27492f['params']['id']}})[_0x2c10('0x1a')](handleEntityNotFound(_0x3afb52,null))[_0x2c10('0x1a')](function(_0x1a9f96){if(_0x1a9f96){return _0x1a9f96[_0x2c10('0x3b')](_0x27492f[_0x2c10('0x38')][_0x2c10('0x3d')],_[_0x2c10('0x3e')](_0x27492f[_0x2c10('0x38')],[_0x2c10('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x3afb52,null))[_0x2c10('0x29')](handleError(_0x3afb52,null));};exports[_0x2c10('0x3f')]=function(_0x28cea5,_0x252301){var _0x2dada4={'raw':![],'where':{}};var _0x1e74c1={};var _0x3de768={'count':0x0,'rows':[]};return db[_0x2c10('0x21')][_0x2c10('0x40')]({'where':{'id':_0x28cea5[_0x2c10('0x2a')]['id']}})[_0x2c10('0x1a')](handleEntityNotFound(_0x252301,null))['then'](function(_0x5bbd2b){if(_0x5bbd2b){_0x1e74c1[_0x2c10('0x2b')]=_[_0x2c10('0x2c')](db[_0x2c10('0x3c')][_0x2c10('0x22')]);_0x1e74c1[_0x2c10('0x27')]=_[_0x2c10('0x2c')](_0x28cea5[_0x2c10('0x27')]);_0x1e74c1[_0x2c10('0x2d')]=_[_0x2c10('0x2e')](_0x1e74c1['model'],_0x1e74c1[_0x2c10('0x27')]);_0x2dada4[_0x2c10('0x2f')]=_['intersection'](_0x1e74c1[_0x2c10('0x2b')],qs[_0x2c10('0x30')](_0x28cea5[_0x2c10('0x27')][_0x2c10('0x30')]));_0x2dada4[_0x2c10('0x2f')]=_0x2dada4[_0x2c10('0x2f')][_0x2c10('0x31')]?_0x2dada4['attributes']:_0x1e74c1['model'];if(!_0x28cea5[_0x2c10('0x27')][_0x2c10('0x41')](_0x2c10('0x42'))){_0x2dada4['limit']=qs['limit'](_0x28cea5[_0x2c10('0x27')]['limit']);_0x2dada4[_0x2c10('0x15')]=qs['offset'](_0x28cea5[_0x2c10('0x27')][_0x2c10('0x15')]);}_0x2dada4[_0x2c10('0x43')]=qs[_0x2c10('0x44')](_0x28cea5[_0x2c10('0x27')][_0x2c10('0x44')]);_0x2dada4[_0x2c10('0x45')]=qs[_0x2c10('0x2d')](_['pick'](_0x28cea5[_0x2c10('0x27')],_0x1e74c1[_0x2c10('0x2d')]));_0x2dada4[_0x2c10('0x45')]['WhatsappInteractionId']=_0x5bbd2b['id'];if(_0x28cea5['query']['filter']){_0x2dada4[_0x2c10('0x45')]=_['merge'](_0x2dada4['where'],{'$or':_['map'](_0x2dada4['attributes'],function(_0x202a26){var _0x4533ce={};_0x4533ce[_0x202a26]={'$like':'%'+_0x28cea5[_0x2c10('0x27')][_0x2c10('0x46')]+'%'};return _0x4533ce;})});}if(_0x28cea5[_0x2c10('0x27')][_0x2c10('0x47')]){var _0x5780b9=_0x28cea5['query'][_0x2c10('0x47')]['split'](',');var _0x57781e={};_0x57781e[_0x5780b9[0x0]]={'$gte':moment(_0x5780b9[0x1])[_0x2c10('0x48')](_0x2c10('0x49'))};_0x2dada4[_0x2c10('0x45')]=_['merge'](_0x2dada4[_0x2c10('0x45')],_0x57781e);}_0x2dada4=_['merge']({},_0x2dada4,_0x28cea5[_0x2c10('0x35')]);return db[_0x2c10('0x3c')][_0x2c10('0x18')]({'where':_0x2dada4[_0x2c10('0x45')]})[_0x2c10('0x1a')](function(_0x2b2788){_0x3de768['count']=_0x2b2788;if(_0x28cea5[_0x2c10('0x27')][_0x2c10('0x32')]){_0x2dada4['include']=[{'all':!![]}];}return db[_0x2c10('0x3c')][_0x2c10('0x26')](_0x2dada4);})[_0x2c10('0x1a')](function(_0x22dd53){_0x3de768[_0x2c10('0x4a')]=_0x22dd53;return _0x3de768;});}})[_0x2c10('0x1a')](respondWithFilteredResult(_0x252301,_0x2dada4))[_0x2c10('0x29')](handleError(_0x252301,null));};exports[_0x2c10('0x4b')]=function(_0x1b4809,_0x431a04){return db[_0x2c10('0x21')]['find']({'where':{'id':_0x1b4809[_0x2c10('0x2a')]['id']}})[_0x2c10('0x1a')](handleEntityNotFound(_0x431a04,null))[_0x2c10('0x1a')](function(_0x649219){if(_0x649219){return _0x649219[_0x2c10('0x4c')](_0x1b4809[_0x2c10('0x38')][_0x2c10('0x3d')],_[_0x2c10('0x3e')](_0x1b4809[_0x2c10('0x38')],[_0x2c10('0x3d'),'id'])||{})[_0x2c10('0x4d')](function(){return db[_0x2c10('0x4e')][_0x2c10('0x26')]({'attributes':['id',_0x2c10('0x1d'),_0x2c10('0x4f')],'where':{'id':_0x1b4809['body'][_0x2c10('0x3d')]}});})['then'](function(_0x5ed016){socket[_0x2c10('0x50')]('whatsappInteractionTags:save',{'id':Number(_0x1b4809[_0x2c10('0x2a')]['id']),'tags':_0x5ed016||[]});return{'id':Number(_0x1b4809[_0x2c10('0x2a')]['id']),'tags':_0x5ed016||[]};});}})[_0x2c10('0x1a')](respondWithResult(_0x431a04,null))[_0x2c10('0x29')](handleError(_0x431a04,null));};exports[_0x2c10('0x51')]=function(_0x226b0c,_0x594c21){return db[_0x2c10('0x21')][_0x2c10('0x36')]({'where':{'id':_0x226b0c[_0x2c10('0x2a')]['id']}})[_0x2c10('0x1a')](handleEntityNotFound(_0x594c21,null))[_0x2c10('0x1a')](function(_0x434fc6){if(_0x434fc6){return _0x434fc6['removeTags'](_0x226b0c[_0x2c10('0x27')][_0x2c10('0x3d')]);}})['then'](respondWithStatusCode(_0x594c21,null))['catch'](handleError(_0x594c21,null));};exports[_0x2c10('0x52')]=function(_0x494594,_0x305142){var _0x45f9c1=moment()[_0x2c10('0x53')]()[_0x2c10('0x54')]();var _0xf7f2b7=path['join'](config[_0x2c10('0x55')],_0x2c10('0x56'),_0x2c10('0x57'),_0x2c10('0x58'));var _0x1c3519=path[_0x2c10('0x59')](config[_0x2c10('0x55')],'server',_0x2c10('0x57'),_0x2c10('0x5a'));var _0x5cf359=path['join'](_0xf7f2b7,_0x45f9c1);var _0x120fe5=util[_0x2c10('0x48')](_0x2c10('0x5b'),_0x494594['params']['id'],_0x45f9c1);var _0x590795=path['join'](_0xf7f2b7,_0x120fe5);var _0x172b5d=[];_0x172b5d['push']({'model':db[_0x2c10('0x5c')],'as':'User','attributes':['id',_0x2c10('0x5d')],'raw':!![]});_0x172b5d[_0x2c10('0x5e')]({'model':db[_0x2c10('0x5f')],'as':_0x2c10('0x60'),'attributes':['id',_0x2c10('0x61'),'lastName'],'raw':!![]});if(_0x494594['query']['attachments']){_0x172b5d['push']({'model':db[_0x2c10('0x62')],'as':_0x2c10('0x62'),'raw':!![]});}var _0x3c8865=[{'model':db[_0x2c10('0x3c')],'as':_0x2c10('0x63'),'attributes':['id',_0x2c10('0x38'),_0x2c10('0x64'),_0x2c10('0x65'),_0x2c10('0x66'),'read'],'include':_0x172b5d}];_0x3c8865[_0x2c10('0x5e')]({'model':db[_0x2c10('0x67')],'as':'Account','attributes':['id','name']});_0x3c8865['push']({'model':db['User'],'as':_0x2c10('0x68'),'attributes':['id',_0x2c10('0x5d')]});return db[_0x2c10('0x21')][_0x2c10('0x36')]({'where':{'id':_0x494594[_0x2c10('0x2a')]['id']},'include':_0x3c8865})[_0x2c10('0x1a')](handleEntityNotFound(_0x305142,null))[_0x2c10('0x1a')](function(_0x607b04){if(_0x607b04){var _0x2bc9be=_0x607b04[_0x2c10('0x69')]({'plain':!![]});fs['mkdirSync'](_0x5cf359);var _0x652b49={'channel':_0x2c10('0x6a'),'account':_0x2bc9be[_0x2c10('0x6b')]['name'],'agent':_0x2bc9be[_0x2c10('0x68')]?_0x2bc9be[_0x2c10('0x68')][_0x2c10('0x5d')]:'N.A.','createdAt':moment(_0x2bc9be[_0x2c10('0x64')])[_0x2c10('0x48')](_0x2c10('0x49'))[_0x2c10('0x54')](),'closedAt':_0x2bc9be['closed']?moment(_0x2bc9be['closedAt'])[_0x2c10('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2c10('0x54')]():'','disposition':_0x2bc9be[_0x2c10('0x6c')],'messages':_(_0x2bc9be[_0x2c10('0x63')])[_0x2c10('0x46')]({'secret':![]})[_0x2c10('0x20')](function(_0x1cf3f4){if(_0x1cf3f4['Attachment']){var _0x237e36=path[_0x2c10('0x59')](_0x1c3519,_0x1cf3f4[_0x2c10('0x62')][_0x2c10('0x6d')]);if(fs['existsSync'](_0x237e36)){fs[_0x2c10('0x6e')](_0x237e36)[_0x2c10('0x6f')](fs[_0x2c10('0x70')](path[_0x2c10('0x59')](_0x5cf359,_0x1cf3f4[_0x2c10('0x62')][_0x2c10('0x6d')])));}}return{'date':moment(_0x1cf3f4['createdAt'])[_0x2c10('0x48')](_0x2c10('0x49'))[_0x2c10('0x54')](),'sender':_0x1cf3f4['direction']===_0x2c10('0x71')?_0x1cf3f4[_0x2c10('0x5c')]?_0x1cf3f4[_0x2c10('0x5c')][_0x2c10('0x5d')]:_0x2c10('0x72'):_0x1cf3f4[_0x2c10('0x60')]['firstName']+(_0x1cf3f4[_0x2c10('0x60')][_0x2c10('0x73')]?'\x20'+_0x1cf3f4[_0x2c10('0x60')][_0x2c10('0x73')]:''),'body':_0x1cf3f4['Attachment']?_0x1cf3f4[_0x2c10('0x62')]['basename']:_0x1cf3f4[_0x2c10('0x38')],'direction':_0x1cf3f4['direction']==='out'?'A':'C','secret':_0x1cf3f4[_0x2c10('0x66')],'read':_0x1cf3f4[_0x2c10('0x74')],'attachment':_0x1cf3f4[_0x2c10('0x62')]};})['value']()};return ejs[_0x2c10('0x75')](path['join'](config[_0x2c10('0x55')],_0x2c10('0x56'),_0x2c10('0x76'),'downloadInteraction.ejs'),{'interaction':_0x652b49})[_0x2c10('0x1a')](function(_0x373692){var _0x1db19=path[_0x2c10('0x59')](_0x5cf359,_0x2c10('0x77')+_0x2bc9be['id']+'-'+_0x45f9c1+_0x2c10('0x78'));var _0x576418={'path':_0x1db19,'channel':'Whatsapp','interactionId':_0x2bc9be['id']};return pdf[_0x2c10('0x79')](_0x373692,_0x576418);})['then'](function(){return new BPromise(function(_0x4f8ec6,_0x2caab7){zipdir(_0x5cf359,{'saveTo':_0x590795},function(_0x1def84,_0x1a0657){if(_0x1def84)return _0x2caab7(_0x1def84);return _0x4f8ec6(_0x1a0657);});})[_0x2c10('0x1a')](function(){return new BPromise(function(_0x15eae5,_0x1ee6c8){rimraf(_0x5cf359,function(_0x5bfcb9){if(_0x5bfcb9)_0x1ee6c8(_0x5bfcb9);return _0x15eae5();});});})['then'](function(){return _0x305142[_0x2c10('0x52')](_0x590795,_0x120fe5,function(_0x48557c){if(_0x48557c){console[_0x2c10('0x7a')]('err',_0x48557c);}else{fs[_0x2c10('0x7b')](_0x590795);}});});});}else{return _0x305142['sendStatus'](0xc8);}})[_0x2c10('0x29')](handleError(_0x305142,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 499119c..a9b70bb 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 _0x87ae=['findAll','setDataValue','unreadMessages','length','emit','catch','exports','WhatsappInteraction','setMaxListeners','save','update','then','Users','map'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x87ae,0xf5));var _0xe87a=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x87ae[_0x421196];return _0x2738af;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xe87a('0x0')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe87a('0x1')](0x0);var events={'afterCreate':_0xe87a('0x2'),'afterUpdate':_0xe87a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x28899c){return function(_0x1fa362,_0x1820dc,_0x5ef978){_0x1fa362['getUsers']({'attributes':['id'],'raw':!![]})[_0xe87a('0x4')](function(_0x2fbd6b){_0x1fa362['setDataValue'](_0xe87a('0x5'),_0x2fbd6b[_0xe87a('0x6')](function(_0x48873f){return{'id':_0x48873f['id']};}));return WhatsappMessage[_0xe87a('0x7')]({'where':{'WhatsappInteractionId':_0x1fa362['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe87a('0x4')](function(_0x499cb8){_0x1fa362[_0xe87a('0x8')](_0xe87a('0x9'),_0x499cb8[_0xe87a('0xa')]);WhatsappInteractionEvents[_0xe87a('0xb')](_0x28899c+':'+_0x1fa362['id'],_0x1fa362);WhatsappInteractionEvents[_0xe87a('0xb')](_0x28899c,_0x1fa362);_0x5ef978(null);})[_0xe87a('0xc')](_0x5ef978(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xe87a('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xd52a=['map','length','emit','catch','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','then','setDataValue'];(function(_0x302c21,_0xad779a){var _0x443243=function(_0x3112e5){while(--_0x3112e5){_0x302c21['push'](_0x302c21['shift']());}};_0x443243(++_0xad779a);}(_0xd52a,0xca));var _0xad52=function(_0x3d9280,_0x43c548){_0x3d9280=_0x3d9280-0x0;var _0x478aa6=_0xd52a[_0x3d9280];return _0x478aa6;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xad52('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xad52('0x0'))['db'][_0xad52('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xad52('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad52('0x3'),'afterDestroy':_0xad52('0x4')};function emitEvent(_0x130d6d){return function(_0x27cbf3,_0x4ed1e9,_0x525806){_0x27cbf3['getUsers']({'attributes':['id'],'raw':!![]})[_0xad52('0x5')](function(_0x55f7a7){_0x27cbf3[_0xad52('0x6')]('Users',_0x55f7a7[_0xad52('0x7')](function(_0x4244f3){return{'id':_0x4244f3['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x27cbf3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xad52('0x5')](function(_0x47db32){_0x27cbf3[_0xad52('0x6')]('unreadMessages',_0x47db32[_0xad52('0x8')]);WhatsappInteractionEvents[_0xad52('0x9')](_0x130d6d+':'+_0x27cbf3['id'],_0x27cbf3);WhatsappInteractionEvents[_0xad52('0x9')](_0x130d6d,_0x27cbf3);_0x525806(null);})[_0xad52('0xa')](_0x525806(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](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 e02b390..8c27d54 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 _0x8911=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x8911,0x76));var _0x1891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8911[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1891('0x0'));var util=require(_0x1891('0x1'));var logger=require(_0x1891('0x2'))('api');var moment=require(_0x1891('0x3'));var BPromise=require(_0x1891('0x4'));var rp=require(_0x1891('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1891('0x6'));var config=require(_0x1891('0x7'));var attributes=require(_0x1891('0x8'));module[_0x1891('0x9')]=function(_0xcd7b7b,_0x1a689b){return _0xcd7b7b[_0x1891('0xa')](_0x1891('0xb'),attributes,{'tableName':_0x1891('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f5bef,_0x2d75ba,_0x58ecb4){if(_0x3f5bef[_0x1891('0xd')](_0x1891('0xe'))){_0x3f5bef['closedAt']=moment()[_0x1891('0xf')](_0x1891('0x10'));}_0x58ecb4(null,_0x3f5bef);}}});}; \ No newline at end of file +var _0xbd6b=['bluebird','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x1fdfd7,_0xc4cc26){var _0x3626ea=function(_0x139e66){while(--_0x139e66){_0x1fdfd7['push'](_0x1fdfd7['shift']());}};_0x3626ea(++_0xc4cc26);}(_0xbd6b,0x17c));var _0xbbd6=function(_0x134f80,_0x400b7a){_0x134f80=_0x134f80-0x0;var _0x19f9a9=_0xbd6b[_0x134f80];return _0x19f9a9;};'use strict';var _=require(_0xbbd6('0x0'));var util=require(_0xbbd6('0x1'));var logger=require('../../config/logger')(_0xbbd6('0x2'));var moment=require(_0xbbd6('0x3'));var BPromise=require(_0xbbd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbd6('0x5'));var rimraf=require(_0xbbd6('0x6'));var config=require(_0xbbd6('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xbbd6('0x8')]=function(_0x3cc5ad,_0x36a963){return _0x3cc5ad[_0xbbd6('0x9')](_0xbbd6('0xa'),attributes,{'tableName':_0xbbd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b3f51,_0x1dfff0,_0x465d6b){if(_0x2b3f51[_0xbbd6('0xc')]('closed')){_0x2b3f51[_0xbbd6('0xd')]=moment()[_0xbbd6('0xe')](_0xbbd6('0xf'));}_0x465d6b(null,_0x2b3f51);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index edd9ebc..648fb94 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 _0x3fce=['UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','where','addTags','ids','AddTags','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','WhatsappInteraction','update','body','options','raw','attributes'];(function(_0x135bbe,_0x1101ce){var _0x4792a5=function(_0x172ea3){while(--_0x172ea3){_0x135bbe['push'](_0x135bbe['shift']());}};_0x4792a5(++_0x1101ce);}(_0x3fce,0x197));var _0xe3fc=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x3fce[_0x8b8564];return _0x360c61;};'use strict';var _=require(_0xe3fc('0x0'));var util=require(_0xe3fc('0x1'));var moment=require('moment');var BPromise=require(_0xe3fc('0x2'));var rs=require(_0xe3fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe3fc('0x4'));var logger=require(_0xe3fc('0x5'))(_0xe3fc('0x6'));var config=require(_0xe3fc('0x7'));var jayson=require(_0xe3fc('0x8'));var client=jayson[_0xe3fc('0x9')][_0xe3fc('0xa')]({'port':0x232a});config[_0xe3fc('0xb')]=_['defaults'](config[_0xe3fc('0xb')],{'host':_0xe3fc('0xc'),'port':0x18eb});var socket=require(_0xe3fc('0xd'))(new Redis(config[_0xe3fc('0xb')]));require(_0xe3fc('0xe'))[_0xe3fc('0xf')](socket);function respondWithRpcPromise(_0x36576c,_0x4d8592,_0x1077cf){return new BPromise(function(_0x31ea1c,_0x37a4bd){return client[_0xe3fc('0x10')](_0x36576c,_0x1077cf)[_0xe3fc('0x11')](function(_0x560c53){logger[_0xe3fc('0x12')](_0xe3fc('0x13'),_0x4d8592,'request\x20sent');logger[_0xe3fc('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4d8592,_0xe3fc('0x15'),JSON[_0xe3fc('0x16')](_0x560c53));if(_0x560c53[_0xe3fc('0x17')]){if(_0x560c53['error'][_0xe3fc('0x18')]===0x1f4){logger[_0xe3fc('0x17')](_0xe3fc('0x13'),_0x4d8592,_0x560c53[_0xe3fc('0x17')][_0xe3fc('0x19')]);return _0x37a4bd(_0x560c53[_0xe3fc('0x17')][_0xe3fc('0x19')]);}logger[_0xe3fc('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x4d8592,_0x560c53[_0xe3fc('0x17')][_0xe3fc('0x19')]);return _0x31ea1c(_0x560c53['error']['message']);}else{logger[_0xe3fc('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x4d8592,_0xe3fc('0x15'));_0x31ea1c(_0x560c53[_0xe3fc('0x1a')][_0xe3fc('0x19')]);}})['catch'](function(_0xc7eef1){logger[_0xe3fc('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x4d8592,_0xc7eef1);_0x37a4bd(_0xc7eef1);});});}exports['UpdateWhatsappInteraction']=function(_0x216862){var _0x5cb732=this;return new Promise(function(_0x40ee2e,_0x40e066){return db[_0xe3fc('0x1b')][_0xe3fc('0x1c')](_0x216862[_0xe3fc('0x1d')],{'raw':_0x216862[_0xe3fc('0x1e')]?_0x216862[_0xe3fc('0x1e')][_0xe3fc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x216862['options']?_0x216862[_0xe3fc('0x1e')]['where']||null:null,'attributes':_0x216862[_0xe3fc('0x1e')]?_0x216862[_0xe3fc('0x1e')][_0xe3fc('0x20')]||null:null,'limit':_0x216862['options']?_0x216862[_0xe3fc('0x1e')]['limit']||null:null})[_0xe3fc('0x11')](function(_0x4e2b42){logger['info'](_0xe3fc('0x21'),_0x216862);logger[_0xe3fc('0x14')](_0xe3fc('0x21'),_0x216862,JSON[_0xe3fc('0x16')](_0x4e2b42));_0x40ee2e(_0x4e2b42);})['catch'](function(_0x45602a){logger[_0xe3fc('0x17')](_0xe3fc('0x21'),_0x45602a['message'],_0x216862);_0x40e066(_0x5cb732[_0xe3fc('0x17')](0x1f4,_0x45602a[_0xe3fc('0x19')]));});});};exports[_0xe3fc('0x22')]=function(_0x2905e8){return new Promise(function(_0x4309dc,_0x4e0152){return db['WhatsappInteraction']['find']({'where':_0x2905e8[_0xe3fc('0x1e')]?_0x2905e8[_0xe3fc('0x1e')][_0xe3fc('0x23')]||null:null})[_0xe3fc('0x11')](function(_0x4c5626){if(_0x4c5626){return _0x4c5626[_0xe3fc('0x24')](_0x2905e8[_0xe3fc('0x1d')][_0xe3fc('0x25')],_['omit'](_0x2905e8['body'],[_0xe3fc('0x25'),'id'])||{});}})['spread'](function(_0x22bcb2){logger[_0xe3fc('0x12')](_0xe3fc('0x26'),_0x2905e8);logger[_0xe3fc('0x14')](_0xe3fc('0x26'),_0x2905e8,JSON[_0xe3fc('0x16')](_0x22bcb2));_0x4309dc(_0x22bcb2);})[_0xe3fc('0x27')](function(_0x5d53f1){logger[_0xe3fc('0x17')]('AddTags',_0x5d53f1[_0xe3fc('0x19')],_0x2905e8);_0x4e0152(_this['error'](0x1f4,_0x5d53f1['message']));});});}; \ No newline at end of file +var _0x411d=['find','addTags','ids','omit','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToWhatsappInteraction'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0x411d,0xbb));var _0xd411=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x411d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xd411('0x0'));var util=require(_0xd411('0x1'));var moment=require(_0xd411('0x2'));var BPromise=require(_0xd411('0x3'));var rs=require(_0xd411('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd411('0x5'))['db'];var utils=require(_0xd411('0x6'));var logger=require(_0xd411('0x7'))(_0xd411('0x8'));var config=require(_0xd411('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd411('0xa')][_0xd411('0xb')]({'port':0x232a});config[_0xd411('0xc')]=_[_0xd411('0xd')](config[_0xd411('0xc')],{'host':_0xd411('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd411('0xc')]));require(_0xd411('0xf'))[_0xd411('0x10')](socket);function respondWithRpcPromise(_0x110373,_0x148910,_0x375b90){return new BPromise(function(_0x1f4035,_0x3a45ee){return client[_0xd411('0x11')](_0x110373,_0x375b90)[_0xd411('0x12')](function(_0xcb86c8){logger[_0xd411('0x13')](_0xd411('0x14'),_0x148910,_0xd411('0x15'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x148910,_0xd411('0x15'),JSON[_0xd411('0x16')](_0xcb86c8));if(_0xcb86c8[_0xd411('0x17')]){if(_0xcb86c8[_0xd411('0x17')][_0xd411('0x18')]===0x1f4){logger[_0xd411('0x17')](_0xd411('0x14'),_0x148910,_0xcb86c8[_0xd411('0x17')][_0xd411('0x19')]);return _0x3a45ee(_0xcb86c8[_0xd411('0x17')][_0xd411('0x19')]);}logger[_0xd411('0x17')](_0xd411('0x14'),_0x148910,_0xcb86c8['error'][_0xd411('0x19')]);return _0x1f4035(_0xcb86c8['error']['message']);}else{logger[_0xd411('0x13')](_0xd411('0x14'),_0x148910,_0xd411('0x15'));_0x1f4035(_0xcb86c8[_0xd411('0x1a')]['message']);}})['catch'](function(_0x2c5b06){logger[_0xd411('0x17')](_0xd411('0x14'),_0x148910,_0x2c5b06);_0x3a45ee(_0x2c5b06);});});}exports[_0xd411('0x1b')]=function(_0x3df73e){var _0x1cb156=this;return new Promise(function(_0x1474de,_0x5a7434){return db[_0xd411('0x1c')][_0xd411('0x1d')](_0x3df73e[_0xd411('0x1e')],{'raw':_0x3df73e[_0xd411('0x1f')]?_0x3df73e[_0xd411('0x1f')][_0xd411('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df73e[_0xd411('0x1f')]?_0x3df73e[_0xd411('0x1f')][_0xd411('0x21')]||null:null,'attributes':_0x3df73e[_0xd411('0x1f')]?_0x3df73e[_0xd411('0x1f')][_0xd411('0x22')]||null:null,'limit':_0x3df73e[_0xd411('0x1f')]?_0x3df73e['options'][_0xd411('0x23')]||null:null})[_0xd411('0x12')](function(_0x4df1bd){logger[_0xd411('0x13')](_0xd411('0x1b'),_0x3df73e);logger[_0xd411('0x24')](_0xd411('0x1b'),_0x3df73e,JSON[_0xd411('0x16')](_0x4df1bd));_0x1474de(_0x4df1bd);})['catch'](function(_0x238e07){logger[_0xd411('0x17')]('UpdateWhatsappInteraction',_0x238e07[_0xd411('0x19')],_0x3df73e);_0x5a7434(_0x1cb156['error'](0x1f4,_0x238e07['message']));});});};exports[_0xd411('0x25')]=function(_0x228c80){return new Promise(function(_0x49aacb,_0xf36ac2){return db[_0xd411('0x1c')][_0xd411('0x26')]({'where':_0x228c80['options']?_0x228c80[_0xd411('0x1f')][_0xd411('0x21')]||null:null})[_0xd411('0x12')](function(_0x57364e){if(_0x57364e){return _0x57364e[_0xd411('0x27')](_0x228c80[_0xd411('0x1e')][_0xd411('0x28')],_[_0xd411('0x29')](_0x228c80[_0xd411('0x1e')],['ids','id'])||{});}})[_0xd411('0x2a')](function(_0x59c24e){logger[_0xd411('0x13')](_0xd411('0x2b'),_0x228c80);logger[_0xd411('0x24')]('AddTags',_0x228c80,JSON[_0xd411('0x16')](_0x59c24e));_0x49aacb(_0x59c24e);})[_0xd411('0x2c')](function(_0x57326b){logger[_0xd411('0x17')](_0xd411('0x2b'),_0x57326b[_0xd411('0x19')],_0x228c80);_0xf36ac2(_this['error'](0x1f4,_0x57326b[_0xd411('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 117a310..80184d1 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 _0x8ac6=['update','emit','removeListener','register','length','whatsappInteraction:','save','remove'];(function(_0x5d5401,_0x142d9b){var _0x38ae22=function(_0x32ee12){while(--_0x32ee12){_0x5d5401['push'](_0x5d5401['shift']());}};_0x38ae22(++_0x142d9b);}(_0x8ac6,0xf6));var _0x68ac=function(_0x4eff18,_0x5b103d){_0x4eff18=_0x4eff18-0x0;var _0x3a1db2=_0x8ac6[_0x4eff18];return _0x3a1db2;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x68ac('0x0'),_0x68ac('0x1'),_0x68ac('0x2')];function createListener(_0x3b273e,_0x4d277e){return function(_0x5b2fc2){_0x4d277e[_0x68ac('0x3')](_0x3b273e,_0x5b2fc2);};}function removeListener(_0xdbabc8,_0x10ed74){return function(){WhatsappInteractionEvents[_0x68ac('0x4')](_0xdbabc8,_0x10ed74);};}exports[_0x68ac('0x5')]=function(_0x4750ce){for(var _0x50a29a=0x0,_0x5a4f21=events[_0x68ac('0x6')];_0x50a29a<_0x5a4f21;_0x50a29a++){var _0x2aac35=events[_0x50a29a];var _0x284881=createListener(_0x68ac('0x7')+_0x2aac35,_0x4750ce);WhatsappInteractionEvents['on'](_0x2aac35,_0x284881);}}; \ No newline at end of file +var _0x4668=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x19c14c,_0x194938){var _0x3bf46e=function(_0x322350){while(--_0x322350){_0x19c14c['push'](_0x19c14c['shift']());}};_0x3bf46e(++_0x194938);}(_0x4668,0x1d7));var _0x8466=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4668[_0x2641f9];return _0x585741;};'use strict';var WhatsappInteractionEvents=require(_0x8466('0x0'));var events=[_0x8466('0x1'),_0x8466('0x2'),_0x8466('0x3')];function createListener(_0x5b8c36,_0x270f4a){return function(_0x9817a3){_0x270f4a[_0x8466('0x4')](_0x5b8c36,_0x9817a3);};}function removeListener(_0x77d6c4,_0x31cc3f){return function(){WhatsappInteractionEvents['removeListener'](_0x77d6c4,_0x31cc3f);};}exports['register']=function(_0x1d291d){for(var _0x185671=0x0,_0x1011b8=events[_0x8466('0x5')];_0x185671<_0x1011b8;_0x185671++){var _0x18fc02=events[_0x185671];var _0x330020=createListener(_0x8466('0x6')+_0x18fc02,_0x1d291d);WhatsappInteractionEvents['on'](_0x18fc02,_0x330020);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 583fbbc..7b1e876 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 _0x370c=['index','get','/describe','describe','/:id','show','whatsapp','whatsappmessage:create','create','post','/:id/status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated'];(function(_0x3936a6,_0x396d78){var _0x3a329c=function(_0x411642){while(--_0x411642){_0x3936a6['push'](_0x3936a6['shift']());}};_0x3a329c(++_0x396d78);}(_0x370c,0xb5));var _0xc370=function(_0x15cb11,_0x3b844b){_0x15cb11=_0x15cb11-0x0;var _0x2f9cd9=_0x370c[_0x15cb11];return _0x2f9cd9;};'use strict';var multer=require('multer');var util=require(_0xc370('0x0'));var path=require(_0xc370('0x1'));var timeout=require(_0xc370('0x2'));var express=require('express');var router=express[_0xc370('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc370('0x4'));var config=require(_0xc370('0x5'));var controller=require(_0xc370('0x6'));router['get']('/',auth[_0xc370('0x7')](),controller[_0xc370('0x8')]);router[_0xc370('0x9')](_0xc370('0xa'),auth[_0xc370('0x7')](),controller[_0xc370('0xb')]);router['get'](_0xc370('0xc'),auth[_0xc370('0x7')](),controller[_0xc370('0xd')]);router['post']('/',auth[_0xc370('0x7')](),interaction['tracked'](_0xc370('0xe'),_0xc370('0xf')),controller[_0xc370('0x10')]);router[_0xc370('0x11')](_0xc370('0x12'),controller['status']);router[_0xc370('0x13')](_0xc370('0xc'),auth['isAuthenticated'](),controller[_0xc370('0x14')]);router['put'](_0xc370('0x15'),auth['isAuthenticated'](),controller[_0xc370('0x16')]);router['put'](_0xc370('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0xc370('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xc370('0x19')]);module[_0xc370('0x1a')]=router; \ No newline at end of file +var _0xaa28=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0xaa28,0xd1));var _0x8aa2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaa28[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x8aa2('0x0'));var util=require(_0x8aa2('0x1'));var path=require(_0x8aa2('0x2'));var timeout=require(_0x8aa2('0x3'));var express=require(_0x8aa2('0x4'));var router=express[_0x8aa2('0x5')]();var fs_extra=require(_0x8aa2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8aa2('0x7'));var config=require(_0x8aa2('0x8'));var controller=require('./whatsappMessage.controller');router[_0x8aa2('0x9')]('/',auth[_0x8aa2('0xa')](),controller['index']);router[_0x8aa2('0x9')](_0x8aa2('0xb'),auth[_0x8aa2('0xa')](),controller[_0x8aa2('0xc')]);router['get'](_0x8aa2('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x8aa2('0xe')](_0x8aa2('0xf'),_0x8aa2('0x10')),controller[_0x8aa2('0x11')]);router['post'](_0x8aa2('0x12'),controller[_0x8aa2('0x13')]);router[_0x8aa2('0x14')](_0x8aa2('0xd'),auth[_0x8aa2('0xa')](),controller[_0x8aa2('0x15')]);router[_0x8aa2('0x14')](_0x8aa2('0x16'),auth[_0x8aa2('0xa')](),controller['accept']);router['put'](_0x8aa2('0x17'),auth['isAuthenticated'](),controller[_0x8aa2('0x18')]);router[_0x8aa2('0x19')](_0x8aa2('0xd'),auth[_0x8aa2('0xa')](),controller['destroy']);module[_0x8aa2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index bf56ae9..584c8d1 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 _0x394f=['ENUM','out','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0xfc1dc4,_0x44375e){var _0x4af19d=function(_0x2bf394){while(--_0x2bf394){_0xfc1dc4['push'](_0xfc1dc4['shift']());}};_0x4af19d(++_0x44375e);}(_0x394f,0x8f));var _0xf394=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x394f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf394('0x0'));module['exports']={'body':{'type':Sequelize[_0xf394('0x1')](_0xf394('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf394('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf394('0x4')]('in',_0xf394('0x5')),'defaultValue':_0xf394('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf394('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xe0bf=['medium','BOOLEAN','ENUM','out','STRING','TEXT','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xe0bf,0xa7));var _0xfe0b=function(_0x58a75e,_0x7c17c5){_0x58a75e=_0x58a75e-0x0;var _0x12d7b0=_0xe0bf[_0x58a75e];return _0x12d7b0;};'use strict';var Sequelize=require('sequelize');module[_0xfe0b('0x0')]={'body':{'type':Sequelize['TEXT'](_0xfe0b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfe0b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfe0b('0x3')]('in','out'),'defaultValue':_0xfe0b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xfe0b('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xfe0b('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfe0b('0x5')]},'providerResponse':{'type':Sequelize[_0xfe0b('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 06cd06c..91e73b5 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 _0xef54=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','save','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','keys','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','internal','manual','channel','motionChannel','event','EventManager','reject','WhatsappInteraction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','SIP/%s','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5a5623,_0x2990db){var _0x502e91=function(_0x3fe16a){while(--_0x3fe16a){_0x5a5623['push'](_0x5a5623['shift']());}};_0x502e91(++_0x2990db);}(_0xef54,0x18b));var _0x4ef5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xef54[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4ef5('0x0'));var rimraf=require(_0x4ef5('0x1'));var zipdir=require(_0x4ef5('0x2'));var jsonpatch=require(_0x4ef5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ef5('0x4'));var Mustache=require(_0x4ef5('0x5'));var util=require(_0x4ef5('0x6'));var path=require(_0x4ef5('0x7'));var sox=require(_0x4ef5('0x8'));var csv=require(_0x4ef5('0x9'));var ejs=require(_0x4ef5('0xa'));var fs=require('fs');var fs_extra=require(_0x4ef5('0xb'));var _=require(_0x4ef5('0xc'));var squel=require(_0x4ef5('0xd'));var crypto=require(_0x4ef5('0xe'));var jsforce=require(_0x4ef5('0xf'));var deskjs=require(_0x4ef5('0x10'));var toCsv=require(_0x4ef5('0x9'));var querystring=require(_0x4ef5('0x11'));var Papa=require(_0x4ef5('0x12'));var Redis=require(_0x4ef5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4ef5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ef5('0x15'));var logger=require(_0x4ef5('0x16'))('api');var utils=require(_0x4ef5('0x17'));var config=require(_0x4ef5('0x18'));var licenseUtil=require(_0x4ef5('0x19'));var db=require('../../mysqldb')['db'];config[_0x4ef5('0x1a')]=_['defaults'](config[_0x4ef5('0x1a')],{'host':_0x4ef5('0x1b'),'port':0x18eb});var socket=require(_0x4ef5('0x1c'))(new Redis(config[_0x4ef5('0x1a')]));require(_0x4ef5('0x1d'))[_0x4ef5('0x1e')](socket);var jayson=require(_0x4ef5('0x1f'));var client=jayson['client'][_0x4ef5('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x4ef5('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x49748b,_0x5c4c75,_0x12cfed,_0x5544a1){return new BPromise(function(_0x3a8622,_0x266415){var _0x24e09d=_0x5544a1||client;return _0x24e09d[_0x4ef5('0x21')](_0x49748b,_0x12cfed)[_0x4ef5('0x22')](function(_0x35ccdd){logger[_0x4ef5('0x23')](_0x4ef5('0x24'),_0x5c4c75,_0x4ef5('0x25'));logger[_0x4ef5('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5c4c75,_0x4ef5('0x25'),JSON[_0x4ef5('0x27')](_0x35ccdd));if(_0x35ccdd[_0x4ef5('0x28')]){if(_0x35ccdd['error'][_0x4ef5('0x29')]===0x1f4){logger[_0x4ef5('0x28')](_0x4ef5('0x24'),_0x5c4c75,_0x35ccdd[_0x4ef5('0x28')]['message']);return _0x266415(_0x35ccdd['error'][_0x4ef5('0x2a')]);}logger[_0x4ef5('0x28')](_0x4ef5('0x24'),_0x5c4c75,_0x35ccdd[_0x4ef5('0x28')][_0x4ef5('0x2a')]);return _0x3a8622(_0x35ccdd[_0x4ef5('0x28')][_0x4ef5('0x2a')]);}else{logger[_0x4ef5('0x23')](_0x4ef5('0x24'),_0x5c4c75,'request\x20sent');_0x3a8622(_0x35ccdd[_0x4ef5('0x2b')]['message']);}})[_0x4ef5('0x2c')](function(_0x2e728e){logger[_0x4ef5('0x28')](_0x4ef5('0x24'),_0x5c4c75,_0x2e728e);_0x266415(_0x2e728e);});});}function respondWithStatusCode(_0xd49a55,_0x2f3a75){_0x2f3a75=_0x2f3a75||0xcc;return function(_0x2d8706){if(_0x2d8706){return _0xd49a55[_0x4ef5('0x2d')](_0x2f3a75);}return _0xd49a55[_0x4ef5('0x2e')](_0x2f3a75)[_0x4ef5('0x2f')]();};}function respondWithResult(_0x3599b5,_0x35c00c){_0x35c00c=_0x35c00c||0xc8;return function(_0x4cf7f4){if(_0x4cf7f4){return _0x3599b5[_0x4ef5('0x2e')](_0x35c00c)['json'](_0x4cf7f4);}};}function respondWithFilteredResult(_0xa019af,_0x372dd5){return function(_0x4a6867){if(_0x4a6867){var _0x55ebef=typeof _0x372dd5['offset']===_0x4ef5('0x30')&&typeof _0x372dd5[_0x4ef5('0x31')]===_0x4ef5('0x30');var _0x430916=_0x4a6867['count'];var _0xf48fcb=_0x55ebef?0x0:_0x372dd5[_0x4ef5('0x32')];var _0x1724dc=_0x55ebef?_0x4a6867[_0x4ef5('0x33')]:_0x372dd5['offset']+_0x372dd5[_0x4ef5('0x31')];var _0x2061f2;if(_0x1724dc>=_0x430916){_0x1724dc=_0x430916;_0x2061f2=0xc8;}else{_0x2061f2=0xce;}_0xa019af[_0x4ef5('0x2e')](_0x2061f2);return _0xa019af[_0x4ef5('0x34')](_0x4ef5('0x35'),_0xf48fcb+'-'+_0x1724dc+'/'+_0x430916)[_0x4ef5('0x36')](_0x4a6867);}return null;};}function patchUpdates(_0x20adca){return function(_0x5ad0c1){try{jsonpatch[_0x4ef5('0x37')](_0x5ad0c1,_0x20adca,!![]);}catch(_0x349922){return BPromise['reject'](_0x349922);}return _0x5ad0c1[_0x4ef5('0x38')]();};}function saveUpdates(_0x28c222,_0x3f549c){return function(_0x146037){if(_0x146037){return _0x146037['update'](_0x28c222)['then'](function(_0x2abbf3){return _0x2abbf3;});}return null;};}function removeEntity(_0x29f47c,_0x26d3bb){return function(_0x36cb36){if(_0x36cb36){return _0x36cb36[_0x4ef5('0x39')]()[_0x4ef5('0x22')](function(){_0x29f47c[_0x4ef5('0x2e')](0xcc)[_0x4ef5('0x2f')]();});}};}function handleEntityNotFound(_0x446a80,_0x40274a){return function(_0x3497ab){if(!_0x3497ab){_0x446a80[_0x4ef5('0x2d')](0x194);}return _0x3497ab;};}function handleError(_0x1beccc,_0x5e6c21){_0x5e6c21=_0x5e6c21||0x1f4;return function(_0x37b31d){logger[_0x4ef5('0x28')](_0x37b31d[_0x4ef5('0x3a')]);if(_0x37b31d[_0x4ef5('0x3b')]){delete _0x37b31d[_0x4ef5('0x3b')];}_0x1beccc['status'](_0x5e6c21)[_0x4ef5('0x3c')](_0x37b31d);};}exports[_0x4ef5('0x3d')]=function(_0x3b7776,_0x363713){var _0x4a437e={},_0x4699da={},_0x3fb226={'count':0x0,'rows':[]};var _0x11971a=_['map'](db[_0x4ef5('0x3e')][_0x4ef5('0x3f')],function(_0x2b12fd){return{'name':_0x2b12fd[_0x4ef5('0x40')],'type':_0x2b12fd[_0x4ef5('0x41')]['key']};});_0x4699da[_0x4ef5('0x42')]=_[_0x4ef5('0x43')](_0x11971a,_0x4ef5('0x3b'));_0x4699da[_0x4ef5('0x44')]=_['keys'](_0x3b7776[_0x4ef5('0x44')]);_0x4699da[_0x4ef5('0x45')]=_[_0x4ef5('0x46')](_0x4699da['model'],_0x4699da[_0x4ef5('0x44')]);_0x4a437e['attributes']=_[_0x4ef5('0x46')](_0x4699da[_0x4ef5('0x42')],qs['fields'](_0x3b7776[_0x4ef5('0x44')][_0x4ef5('0x47')]));_0x4a437e[_0x4ef5('0x48')]=_0x4a437e[_0x4ef5('0x48')][_0x4ef5('0x49')]?_0x4a437e[_0x4ef5('0x48')]:_0x4699da[_0x4ef5('0x42')];if(!_0x3b7776[_0x4ef5('0x44')]['hasOwnProperty']('nolimit')){_0x4a437e[_0x4ef5('0x31')]=qs[_0x4ef5('0x31')](_0x3b7776[_0x4ef5('0x44')][_0x4ef5('0x31')]);_0x4a437e['offset']=qs[_0x4ef5('0x32')](_0x3b7776['query'][_0x4ef5('0x32')]);}_0x4a437e[_0x4ef5('0x4a')]=qs[_0x4ef5('0x4b')](_0x3b7776[_0x4ef5('0x44')]['sort']);_0x4a437e[_0x4ef5('0x4c')]=qs[_0x4ef5('0x45')](_[_0x4ef5('0x4d')](_0x3b7776[_0x4ef5('0x44')],_0x4699da[_0x4ef5('0x45')]),_0x11971a);if(_0x3b7776[_0x4ef5('0x44')][_0x4ef5('0x4e')]){_0x4a437e[_0x4ef5('0x4c')]=_['merge'](_0x4a437e['where'],{'$or':_[_0x4ef5('0x43')](_0x11971a,function(_0x37b8f6){if(_0x37b8f6[_0x4ef5('0x41')]!==_0x4ef5('0x4f')){var _0x1ee726={};_0x1ee726[_0x37b8f6['name']]={'$like':'%'+_0x3b7776[_0x4ef5('0x44')]['filter']+'%'};return _0x1ee726;}})});}_0x4a437e=_[_0x4ef5('0x50')]({},_0x4a437e,_0x3b7776[_0x4ef5('0x51')]);var _0x5045ae={'where':_0x4a437e[_0x4ef5('0x4c')]};return db[_0x4ef5('0x3e')][_0x4ef5('0x33')](_0x5045ae)[_0x4ef5('0x22')](function(_0x190812){_0x3fb226[_0x4ef5('0x33')]=_0x190812;if(_0x3b7776['query'][_0x4ef5('0x52')]){_0x4a437e[_0x4ef5('0x53')]=[{'all':!![]}];}return db[_0x4ef5('0x3e')][_0x4ef5('0x54')](_0x4a437e);})[_0x4ef5('0x22')](function(_0x55d2f9){_0x3fb226['rows']=_0x55d2f9;return _0x3fb226;})[_0x4ef5('0x22')](respondWithFilteredResult(_0x363713,_0x4a437e))[_0x4ef5('0x2c')](handleError(_0x363713,null));};exports['show']=function(_0x470677,_0x20128c){var _0x4bf043={'raw':!![],'where':{'id':_0x470677[_0x4ef5('0x55')]['id']}},_0x1efc27={};_0x1efc27[_0x4ef5('0x42')]=_[_0x4ef5('0x56')](db[_0x4ef5('0x3e')]['rawAttributes']);_0x1efc27[_0x4ef5('0x44')]=_['keys'](_0x470677['query']);_0x1efc27['filters']=_[_0x4ef5('0x46')](_0x1efc27[_0x4ef5('0x42')],_0x1efc27[_0x4ef5('0x44')]);_0x4bf043[_0x4ef5('0x48')]=_[_0x4ef5('0x46')](_0x1efc27['model'],qs[_0x4ef5('0x47')](_0x470677[_0x4ef5('0x44')][_0x4ef5('0x47')]));_0x4bf043['attributes']=_0x4bf043[_0x4ef5('0x48')][_0x4ef5('0x49')]?_0x4bf043[_0x4ef5('0x48')]:_0x1efc27[_0x4ef5('0x42')];if(_0x470677[_0x4ef5('0x44')][_0x4ef5('0x52')]){_0x4bf043[_0x4ef5('0x53')]=[{'all':!![]}];}_0x4bf043=_[_0x4ef5('0x50')]({},_0x4bf043,_0x470677[_0x4ef5('0x51')]);return db[_0x4ef5('0x3e')]['find'](_0x4bf043)[_0x4ef5('0x22')](handleEntityNotFound(_0x20128c,null))['then'](respondWithResult(_0x20128c,null))[_0x4ef5('0x2c')](handleError(_0x20128c,null));};exports['create']=function(_0x154c66,_0x4d7e67){return db[_0x4ef5('0x3e')][_0x4ef5('0x57')](_0x154c66[_0x4ef5('0x58')],{})[_0x4ef5('0x22')](respondWithResult(_0x4d7e67,0xc9))[_0x4ef5('0x2c')](handleError(_0x4d7e67,null));};exports['update']=function(_0xcbb3f7,_0x5a965f){if(_0xcbb3f7[_0x4ef5('0x58')]['id']){delete _0xcbb3f7[_0x4ef5('0x58')]['id'];}return db[_0x4ef5('0x3e')][_0x4ef5('0x59')]({'where':{'id':_0xcbb3f7[_0x4ef5('0x55')]['id']}})[_0x4ef5('0x22')](handleEntityNotFound(_0x5a965f,null))[_0x4ef5('0x22')](saveUpdates(_0xcbb3f7[_0x4ef5('0x58')],null))[_0x4ef5('0x22')](respondWithResult(_0x5a965f,null))[_0x4ef5('0x2c')](handleError(_0x5a965f,null));};exports[_0x4ef5('0x39')]=function(_0x45fd48,_0xfc00e7){return db[_0x4ef5('0x3e')][_0x4ef5('0x59')]({'where':{'id':_0x45fd48[_0x4ef5('0x55')]['id']}})[_0x4ef5('0x22')](handleEntityNotFound(_0xfc00e7,null))[_0x4ef5('0x22')](removeEntity(_0xfc00e7,null))[_0x4ef5('0x2c')](handleError(_0xfc00e7,null));};exports[_0x4ef5('0x5a')]=function(_0x5baac8,_0x498c9a){return db['WhatsappMessage'][_0x4ef5('0x5a')]()['then'](respondWithResult(_0x498c9a,null))[_0x4ef5('0x2c')](handleError(_0x498c9a,null));};var interaction_log=require('../../config/logger')(_0x4ef5('0x5b'));exports[_0x4ef5('0x5c')]=function(_0x19dabb,_0x3c3a65,_0x325595){var _0x55a2d0={'agent':{},'channel':_0x4ef5('0x5d')};if(_0x19dabb[_0x4ef5('0x58')]['id']){delete _0x19dabb[_0x4ef5('0x58')]['id'];}_0x19dabb[_0x4ef5('0x58')][_0x4ef5('0x5e')]=!![];_0x19dabb[_0x4ef5('0x58')]['readAt']=moment()[_0x4ef5('0x5f')](_0x4ef5('0x60'));_0x19dabb['body'][_0x4ef5('0x61')]=_0x19dabb[_0x4ef5('0x58')][_0x4ef5('0x61')]||_0x19dabb[_0x4ef5('0x62')]['id'];_0x55a2d0[_0x4ef5('0x63')]['id']=_0x19dabb['body'][_0x4ef5('0x61')];return db[_0x4ef5('0x3e')][_0x4ef5('0x59')]({'where':{'id':_0x19dabb['params']['id'],'UserId':null}})[_0x4ef5('0x22')](handleEntityNotFound(_0x3c3a65,null))['then'](saveUpdates(_0x19dabb[_0x4ef5('0x58')],null))[_0x4ef5('0x22')](function(_0x11cb10){if(_0x11cb10){_0x55a2d0[_0x4ef5('0x2a')]=_0x11cb10[_0x4ef5('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0x4ef5('0x59')]({'where':{'id':_0x11cb10[_0x4ef5('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3c3a65,null))[_0x4ef5('0x22')](function(_0x1bea44){if(_0x1bea44){return _0x1bea44['update']({'UserId':_0x19dabb['body'][_0x4ef5('0x61')],'read1stAt':_[_0x4ef5('0x66')](_0x1bea44['read1stAt'])?moment()[_0x4ef5('0x5f')](_0x4ef5('0x60')):undefined});}return null;})[_0x4ef5('0x22')](function(_0xdce6f3){if(_0xdce6f3){_0x55a2d0[_0x4ef5('0x67')]=_0xdce6f3[_0x4ef5('0x64')]({'plain':!![]});interaction_log[_0x4ef5('0x23')](_0x4ef5('0x68'),_0x19dabb['user']['id'],_0x19dabb[_0x4ef5('0x62')][_0x4ef5('0x3b')],_0x19dabb['user'][_0x4ef5('0x69')],_0x55a2d0[_0x4ef5('0x67')]['id'],_0x19dabb[_0x4ef5('0x58')]?JSON[_0x4ef5('0x27')](_0x19dabb[_0x4ef5('0x58')]):_0x4ef5('0x6a'));return respondWithRpcPromise(_0x4ef5('0x6b'),_0x4ef5('0x6c'),_0x55a2d0);}return null;})[_0x4ef5('0x22')](function(_0x1b41f2){var _0x3c3b8b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1b41f2[_0x4ef5('0x2a')][_0x4ef5('0x6d')];return db[_0x4ef5('0x6e')][_0x4ef5('0x44')](_0x3c3b8b,{'type':db[_0x4ef5('0x6f')][_0x4ef5('0x70')][_0x4ef5('0x71')],'raw':!![]})[_0x4ef5('0x22')](function(_0x516622){return _0x516622;});})['then'](function(_0x4e4813){if(_0x4e4813){_0x55a2d0[_0x4ef5('0x2a')][_0x4ef5('0x72')]=_0x4e4813[0x0];if(!_0x19dabb[_0x4ef5('0x58')][_0x4ef5('0x61')])return;return db['User'][_0x4ef5('0x59')]({'where':{'id':_0x19dabb['body'][_0x4ef5('0x61')],'role':_0x4ef5('0x63')},'attributes':['id','name','fullname','email',_0x4ef5('0x73')],'raw':!![]});}return null;})['then'](function(_0x36afbb){if(!_0x36afbb)return null;_0x55a2d0[_0x4ef5('0x2a')]['agent']=_0x36afbb;return _0x55a2d0;})[_0x4ef5('0x22')](function(_0x46ed8e){if(_0x46ed8e){if(_0x19dabb[_0x4ef5('0x58')][_0x4ef5('0x74')]){_0x55a2d0['message']['interface']=util['format']('SIP/%s',_0x19dabb['user']['name']);_0x55a2d0[_0x4ef5('0x2a')][_0x4ef5('0x75')]=_0x55a2d0['channel'];_0x55a2d0[_0x4ef5('0x2a')][_0x4ef5('0x76')]=_0x55a2d0[_0x4ef5('0x75')];_0x55a2d0[_0x4ef5('0x2a')][_0x4ef5('0x77')]=_0x4ef5('0x5c');return respondWithRpcPromise('EventManager',_0x4ef5('0x78'),{'event':'acceptmessage','message':_0x55a2d0[_0x4ef5('0x2a')]},client9002)[_0x4ef5('0x22')](function(){return _0x55a2d0;});}return _0x55a2d0;}return null;})[_0x4ef5('0x22')](respondWithResult(_0x3c3a65,null))[_0x4ef5('0x2c')](handleError(_0x3c3a65,null));};var interaction_log=require(_0x4ef5('0x16'))(_0x4ef5('0x5b'));exports[_0x4ef5('0x79')]=function(_0x1b6b1f,_0x518ed4,_0xfd95fb){var _0x34ef43={'agent':{},'channel':'whatsapp'};if(_0x1b6b1f[_0x4ef5('0x58')]['id']){delete _0x1b6b1f[_0x4ef5('0x58')]['id'];}_0x1b6b1f['body']['UserId']=_0x1b6b1f['body'][_0x4ef5('0x61')]||_0x1b6b1f[_0x4ef5('0x62')]['id'];_0x34ef43['agent']['id']=_0x1b6b1f['body']['UserId'];return db['WhatsappMessage'][_0x4ef5('0x59')]({'where':{'id':_0x1b6b1f[_0x4ef5('0x55')]['id'],'UserId':null}})[_0x4ef5('0x22')](handleEntityNotFound(_0x518ed4,null))[_0x4ef5('0x22')](function(_0x43b480){if(_0x43b480){_0x34ef43['message']=_0x43b480[_0x4ef5('0x64')]({'plain':!![]});return db[_0x4ef5('0x7a')][_0x4ef5('0x59')]({'where':{'id':_0x43b480[_0x4ef5('0x65')]}});}return null;})[_0x4ef5('0x22')](handleEntityNotFound(_0x518ed4,null))[_0x4ef5('0x22')](function(_0x44e83e){if(_0x44e83e){_0x34ef43[_0x4ef5('0x67')]=_0x44e83e['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b6b1f[_0x4ef5('0x62')]['id'],_0x1b6b1f['user'][_0x4ef5('0x3b')],_0x1b6b1f[_0x4ef5('0x62')]['role'],_0x34ef43['interaction']['id'],_0x1b6b1f[_0x4ef5('0x58')]?JSON[_0x4ef5('0x27')](_0x1b6b1f[_0x4ef5('0x58')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x34ef43);}return null;})[_0x4ef5('0x22')](function(_0x21f1d2){var _0x4a0779=_0x4ef5('0x7b')+_0x21f1d2[_0x4ef5('0x2a')][_0x4ef5('0x6d')];return db[_0x4ef5('0x6e')][_0x4ef5('0x44')](_0x4a0779,{'type':db['Sequelize']['QueryTypes'][_0x4ef5('0x71')],'raw':!![]})[_0x4ef5('0x22')](function(_0x54b3ee){return _0x54b3ee;});})[_0x4ef5('0x22')](function(_0x4eea8){if(_0x4eea8){_0x34ef43[_0x4ef5('0x2a')][_0x4ef5('0x72')]=_0x4eea8[0x0];if(!_0x1b6b1f[_0x4ef5('0x58')][_0x4ef5('0x61')])return;return db['User'][_0x4ef5('0x59')]({'where':{'id':_0x1b6b1f[_0x4ef5('0x58')][_0x4ef5('0x61')],'role':_0x4ef5('0x63')},'attributes':['id',_0x4ef5('0x3b'),'fullname',_0x4ef5('0x7c'),_0x4ef5('0x73')],'raw':!![]});}return null;})[_0x4ef5('0x22')](function(_0x58c941){if(!_0x58c941)return null;_0x34ef43['message']['agent']=_0x58c941;return _0x34ef43;})[_0x4ef5('0x22')](function(_0x19cd60){if(_0x19cd60){_0x19cd60[_0x4ef5('0x2a')]['interface']=util[_0x4ef5('0x5f')](_0x4ef5('0x7d'),_0x1b6b1f[_0x4ef5('0x62')][_0x4ef5('0x3b')]);_0x19cd60[_0x4ef5('0x2a')][_0x4ef5('0x75')]=_0x34ef43[_0x4ef5('0x75')];_0x19cd60[_0x4ef5('0x2a')]['motionChannel']=_0x34ef43['channel'];_0x19cd60[_0x4ef5('0x2a')][_0x4ef5('0x77')]=_0x4ef5('0x79');respondWithRpcPromise(_0x4ef5('0x78'),_0x4ef5('0x78'),{'event':'rejectmessage','message':_0x19cd60[_0x4ef5('0x2a')]},client9002);return _0x34ef43;}return null;})['then'](respondWithResult(_0x518ed4,null))['catch'](handleError(_0x518ed4,null));};exports[_0x4ef5('0x2e')]=function(_0x2213be,_0x378fdd,_0x2f46a9){if(_0x2213be[_0x4ef5('0x58')]['id']){delete _0x2213be['body']['id'];}var _0x20533e;return db[_0x4ef5('0x3e')]['find']({'where':{'id':_0x2213be[_0x4ef5('0x55')]['id']}})[_0x4ef5('0x22')](handleEntityNotFound(_0x378fdd,null))['then'](function(_0x2b74ec){if(_0x2b74ec){_0x20533e=_0x2b74ec;return db[_0x4ef5('0x7e')][_0x4ef5('0x59')]({'where':{'id':_0x2b74ec[_0x4ef5('0x7f')]}});}})['then'](handleEntityNotFound(_0x378fdd,null))[_0x4ef5('0x22')](function(_0x704141){if(_0x704141){logger[_0x4ef5('0x26')](_0x4ef5('0x80'),_0x4ef5('0x2e'),_0x4ef5('0x81'),_0x704141['type'],util[_0x4ef5('0x82')](_0x2213be[_0x4ef5('0x58')],{'showHidden':![],'depth':null}));switch(_0x704141[_0x4ef5('0x41')]){case _0x4ef5('0x83'):if(_0x2213be[_0x4ef5('0x58')][_0x4ef5('0x84')]&&_0x2213be[_0x4ef5('0x58')][_0x4ef5('0x84')]===_0x20533e[_0x4ef5('0x85')]&&_0x2213be[_0x4ef5('0x58')][_0x4ef5('0x86')]&&_0x2213be['body']['MessageStatus']==='read'){return _0x20533e['update']({'read':!![]});}else{logger[_0x4ef5('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4ef5('0x2e'),_0x4ef5('0x83'),util['inspect'](_0x2213be[_0x4ef5('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x20533e;}})[_0x4ef5('0x22')](respondWithResult(_0x378fdd,null))[_0x4ef5('0x2c')](handleError(_0x378fdd,null));}; \ No newline at end of file +var _0x5b5a=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','destroy','stack','name','send','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','type','VIRTUAL','options','WhatsappMessage','include','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','interaction','get','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','email','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5b5a,0x126));var _0xa5b5=function(_0x319e2e,_0x2f727f){_0x319e2e=_0x319e2e-0x0;var _0x302524=_0x5b5a[_0x319e2e];return _0x302524;};'use strict';var emlformat=require(_0xa5b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5b5('0x1'));var jsonpatch=require(_0xa5b5('0x2'));var rp=require(_0xa5b5('0x3'));var moment=require(_0xa5b5('0x4'));var BPromise=require(_0xa5b5('0x5'));var Mustache=require(_0xa5b5('0x6'));var util=require(_0xa5b5('0x7'));var path=require(_0xa5b5('0x8'));var sox=require('sox');var csv=require(_0xa5b5('0x9'));var ejs=require(_0xa5b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5b5('0xb'));var squel=require(_0xa5b5('0xc'));var crypto=require(_0xa5b5('0xd'));var jsforce=require(_0xa5b5('0xe'));var deskjs=require(_0xa5b5('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa5b5('0x10'));var Papa=require('papaparse');var Redis=require(_0xa5b5('0x11'));var authService=require(_0xa5b5('0x12'));var qs=require(_0xa5b5('0x13'));var as=require(_0xa5b5('0x14'));var hardwareService=require(_0xa5b5('0x15'));var logger=require('../../config/logger')(_0xa5b5('0x16'));var utils=require(_0xa5b5('0x17'));var config=require(_0xa5b5('0x18'));var licenseUtil=require(_0xa5b5('0x19'));var db=require(_0xa5b5('0x1a'))['db'];config[_0xa5b5('0x1b')]=_[_0xa5b5('0x1c')](config[_0xa5b5('0x1b')],{'host':_0xa5b5('0x1d'),'port':0x18eb});var socket=require(_0xa5b5('0x1e'))(new Redis(config['redis']));require(_0xa5b5('0x1f'))['register'](socket);var jayson=require(_0xa5b5('0x20'));var client=jayson[_0xa5b5('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xa5b5('0x21')][_0xa5b5('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5772f0,_0x36346a,_0x2d1a3d,_0x50b23c){return new BPromise(function(_0x2e9513,_0x195c21){var _0x2a7165=_0x50b23c||client;return _0x2a7165[_0xa5b5('0x23')](_0x5772f0,_0x2d1a3d)[_0xa5b5('0x24')](function(_0x2c3585){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x36346a,'request\x20sent');logger[_0xa5b5('0x25')](_0xa5b5('0x26'),_0x36346a,_0xa5b5('0x27'),JSON[_0xa5b5('0x28')](_0x2c3585));if(_0x2c3585[_0xa5b5('0x29')]){if(_0x2c3585[_0xa5b5('0x29')][_0xa5b5('0x2a')]===0x1f4){logger[_0xa5b5('0x29')](_0xa5b5('0x2b'),_0x36346a,_0x2c3585[_0xa5b5('0x29')][_0xa5b5('0x2c')]);return _0x195c21(_0x2c3585[_0xa5b5('0x29')][_0xa5b5('0x2c')]);}logger[_0xa5b5('0x29')](_0xa5b5('0x2b'),_0x36346a,_0x2c3585[_0xa5b5('0x29')][_0xa5b5('0x2c')]);return _0x2e9513(_0x2c3585[_0xa5b5('0x29')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x36346a,'request\x20sent');_0x2e9513(_0x2c3585[_0xa5b5('0x2d')][_0xa5b5('0x2c')]);}})['catch'](function(_0x4be20f){logger[_0xa5b5('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x36346a,_0x4be20f);_0x195c21(_0x4be20f);});});}function respondWithStatusCode(_0x732a8f,_0x48acdd){_0x48acdd=_0x48acdd||0xcc;return function(_0x433e3b){if(_0x433e3b){return _0x732a8f[_0xa5b5('0x2e')](_0x48acdd);}return _0x732a8f[_0xa5b5('0x2f')](_0x48acdd)[_0xa5b5('0x30')]();};}function respondWithResult(_0x1ec55a,_0x30370e){_0x30370e=_0x30370e||0xc8;return function(_0x2c5d4e){if(_0x2c5d4e){return _0x1ec55a[_0xa5b5('0x2f')](_0x30370e)[_0xa5b5('0x31')](_0x2c5d4e);}};}function respondWithFilteredResult(_0x246554,_0x59377b){return function(_0x604a52){if(_0x604a52){var _0x332861=typeof _0x59377b[_0xa5b5('0x32')]===_0xa5b5('0x33')&&typeof _0x59377b['limit']===_0xa5b5('0x33');var _0x6fd617=_0x604a52[_0xa5b5('0x34')];var _0x380321=_0x332861?0x0:_0x59377b[_0xa5b5('0x32')];var _0x3a657f=_0x332861?_0x604a52[_0xa5b5('0x34')]:_0x59377b[_0xa5b5('0x32')]+_0x59377b['limit'];var _0x2c0776;if(_0x3a657f>=_0x6fd617){_0x3a657f=_0x6fd617;_0x2c0776=0xc8;}else{_0x2c0776=0xce;}_0x246554[_0xa5b5('0x2f')](_0x2c0776);return _0x246554[_0xa5b5('0x35')](_0xa5b5('0x36'),_0x380321+'-'+_0x3a657f+'/'+_0x6fd617)[_0xa5b5('0x31')](_0x604a52);}return null;};}function patchUpdates(_0x2ba328){return function(_0x5af9b0){try{jsonpatch[_0xa5b5('0x37')](_0x5af9b0,_0x2ba328,!![]);}catch(_0x5db97f){return BPromise['reject'](_0x5db97f);}return _0x5af9b0['save']();};}function saveUpdates(_0x293123,_0x58026a){return function(_0x3b02a1){if(_0x3b02a1){return _0x3b02a1[_0xa5b5('0x38')](_0x293123)[_0xa5b5('0x24')](function(_0x5e5a71){return _0x5e5a71;});}return null;};}function removeEntity(_0x5308b7,_0x42801b){return function(_0x12e649){if(_0x12e649){return _0x12e649[_0xa5b5('0x39')]()['then'](function(){_0x5308b7['status'](0xcc)[_0xa5b5('0x30')]();});}};}function handleEntityNotFound(_0x57ecba,_0x2e13e0){return function(_0xfce76){if(!_0xfce76){_0x57ecba[_0xa5b5('0x2e')](0x194);}return _0xfce76;};}function handleError(_0x3828da,_0x5269c9){_0x5269c9=_0x5269c9||0x1f4;return function(_0x1336c7){logger[_0xa5b5('0x29')](_0x1336c7[_0xa5b5('0x3a')]);if(_0x1336c7['name']){delete _0x1336c7[_0xa5b5('0x3b')];}_0x3828da[_0xa5b5('0x2f')](_0x5269c9)[_0xa5b5('0x3c')](_0x1336c7);};}exports[_0xa5b5('0x3d')]=function(_0x5fda9e,_0x5eba3c){var _0xd26d1c={},_0x21d510={},_0x3fba17={'count':0x0,'rows':[]};var _0x28a5f6=_[_0xa5b5('0x3e')](db['WhatsappMessage']['rawAttributes'],function(_0x265247){return{'name':_0x265247[_0xa5b5('0x3f')],'type':_0x265247['type']['key']};});_0x21d510[_0xa5b5('0x40')]=_['map'](_0x28a5f6,_0xa5b5('0x3b'));_0x21d510[_0xa5b5('0x41')]=_[_0xa5b5('0x42')](_0x5fda9e[_0xa5b5('0x41')]);_0x21d510[_0xa5b5('0x43')]=_[_0xa5b5('0x44')](_0x21d510[_0xa5b5('0x40')],_0x21d510['query']);_0xd26d1c['attributes']=_[_0xa5b5('0x44')](_0x21d510[_0xa5b5('0x40')],qs[_0xa5b5('0x45')](_0x5fda9e[_0xa5b5('0x41')][_0xa5b5('0x45')]));_0xd26d1c[_0xa5b5('0x46')]=_0xd26d1c[_0xa5b5('0x46')][_0xa5b5('0x47')]?_0xd26d1c[_0xa5b5('0x46')]:_0x21d510['model'];if(!_0x5fda9e['query'][_0xa5b5('0x48')](_0xa5b5('0x49'))){_0xd26d1c[_0xa5b5('0x4a')]=qs[_0xa5b5('0x4a')](_0x5fda9e[_0xa5b5('0x41')]['limit']);_0xd26d1c[_0xa5b5('0x32')]=qs[_0xa5b5('0x32')](_0x5fda9e[_0xa5b5('0x41')][_0xa5b5('0x32')]);}_0xd26d1c['order']=qs['sort'](_0x5fda9e[_0xa5b5('0x41')]['sort']);_0xd26d1c[_0xa5b5('0x4b')]=qs[_0xa5b5('0x43')](_[_0xa5b5('0x4c')](_0x5fda9e[_0xa5b5('0x41')],_0x21d510[_0xa5b5('0x43')]),_0x28a5f6);if(_0x5fda9e[_0xa5b5('0x41')][_0xa5b5('0x4d')]){_0xd26d1c[_0xa5b5('0x4b')]=_[_0xa5b5('0x4e')](_0xd26d1c[_0xa5b5('0x4b')],{'$or':_['map'](_0x28a5f6,function(_0x1f7c76){if(_0x1f7c76[_0xa5b5('0x4f')]!==_0xa5b5('0x50')){var _0x19b6a3={};_0x19b6a3[_0x1f7c76[_0xa5b5('0x3b')]]={'$like':'%'+_0x5fda9e['query']['filter']+'%'};return _0x19b6a3;}})});}_0xd26d1c=_[_0xa5b5('0x4e')]({},_0xd26d1c,_0x5fda9e[_0xa5b5('0x51')]);var _0xc7ca94={'where':_0xd26d1c[_0xa5b5('0x4b')]};return db[_0xa5b5('0x52')]['count'](_0xc7ca94)['then'](function(_0x5ef952){_0x3fba17['count']=_0x5ef952;if(_0x5fda9e['query']['includeAll']){_0xd26d1c[_0xa5b5('0x53')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0xd26d1c);})[_0xa5b5('0x24')](function(_0x11fa3a){_0x3fba17[_0xa5b5('0x54')]=_0x11fa3a;return _0x3fba17;})[_0xa5b5('0x24')](respondWithFilteredResult(_0x5eba3c,_0xd26d1c))[_0xa5b5('0x55')](handleError(_0x5eba3c,null));};exports[_0xa5b5('0x56')]=function(_0x60a90e,_0x323119){var _0x5e0255={'raw':!![],'where':{'id':_0x60a90e[_0xa5b5('0x57')]['id']}},_0x1218e5={};_0x1218e5['model']=_[_0xa5b5('0x42')](db['WhatsappMessage'][_0xa5b5('0x58')]);_0x1218e5['query']=_[_0xa5b5('0x42')](_0x60a90e['query']);_0x1218e5[_0xa5b5('0x43')]=_['intersection'](_0x1218e5[_0xa5b5('0x40')],_0x1218e5[_0xa5b5('0x41')]);_0x5e0255['attributes']=_[_0xa5b5('0x44')](_0x1218e5[_0xa5b5('0x40')],qs[_0xa5b5('0x45')](_0x60a90e[_0xa5b5('0x41')][_0xa5b5('0x45')]));_0x5e0255[_0xa5b5('0x46')]=_0x5e0255['attributes'][_0xa5b5('0x47')]?_0x5e0255[_0xa5b5('0x46')]:_0x1218e5[_0xa5b5('0x40')];if(_0x60a90e[_0xa5b5('0x41')][_0xa5b5('0x59')]){_0x5e0255[_0xa5b5('0x53')]=[{'all':!![]}];}_0x5e0255=_[_0xa5b5('0x4e')]({},_0x5e0255,_0x60a90e[_0xa5b5('0x51')]);return db[_0xa5b5('0x52')]['find'](_0x5e0255)[_0xa5b5('0x24')](handleEntityNotFound(_0x323119,null))[_0xa5b5('0x24')](respondWithResult(_0x323119,null))[_0xa5b5('0x55')](handleError(_0x323119,null));};exports[_0xa5b5('0x5a')]=function(_0x210e65,_0xe32556){return db[_0xa5b5('0x52')][_0xa5b5('0x5a')](_0x210e65[_0xa5b5('0x5b')],{})[_0xa5b5('0x24')](respondWithResult(_0xe32556,0xc9))[_0xa5b5('0x55')](handleError(_0xe32556,null));};exports[_0xa5b5('0x38')]=function(_0x4cca0c,_0x197d4a){if(_0x4cca0c['body']['id']){delete _0x4cca0c['body']['id'];}return db['WhatsappMessage'][_0xa5b5('0x5c')]({'where':{'id':_0x4cca0c[_0xa5b5('0x57')]['id']}})['then'](handleEntityNotFound(_0x197d4a,null))[_0xa5b5('0x24')](saveUpdates(_0x4cca0c['body'],null))[_0xa5b5('0x24')](respondWithResult(_0x197d4a,null))['catch'](handleError(_0x197d4a,null));};exports[_0xa5b5('0x39')]=function(_0x555ece,_0x380a6e){return db[_0xa5b5('0x52')][_0xa5b5('0x5c')]({'where':{'id':_0x555ece[_0xa5b5('0x57')]['id']}})[_0xa5b5('0x24')](handleEntityNotFound(_0x380a6e,null))[_0xa5b5('0x24')](removeEntity(_0x380a6e,null))[_0xa5b5('0x55')](handleError(_0x380a6e,null));};exports['describe']=function(_0x25b369,_0x33b4a1){return db['WhatsappMessage'][_0xa5b5('0x5d')]()[_0xa5b5('0x24')](respondWithResult(_0x33b4a1,null))[_0xa5b5('0x55')](handleError(_0x33b4a1,null));};var interaction_log=require(_0xa5b5('0x5e'))(_0xa5b5('0x5f'));exports[_0xa5b5('0x60')]=function(_0x47fce2,_0x465922,_0xa0c392){var _0xa8a55={'agent':{},'channel':_0xa5b5('0x61')};if(_0x47fce2[_0xa5b5('0x5b')]['id']){delete _0x47fce2['body']['id'];}_0x47fce2[_0xa5b5('0x5b')][_0xa5b5('0x62')]=!![];_0x47fce2[_0xa5b5('0x5b')][_0xa5b5('0x63')]=moment()[_0xa5b5('0x64')](_0xa5b5('0x65'));_0x47fce2[_0xa5b5('0x5b')]['UserId']=_0x47fce2[_0xa5b5('0x5b')][_0xa5b5('0x66')]||_0x47fce2[_0xa5b5('0x67')]['id'];_0xa8a55[_0xa5b5('0x68')]['id']=_0x47fce2[_0xa5b5('0x5b')][_0xa5b5('0x66')];return db[_0xa5b5('0x52')][_0xa5b5('0x5c')]({'where':{'id':_0x47fce2[_0xa5b5('0x57')]['id'],'UserId':null}})[_0xa5b5('0x24')](handleEntityNotFound(_0x465922,null))['then'](saveUpdates(_0x47fce2[_0xa5b5('0x5b')],null))[_0xa5b5('0x24')](function(_0x833c05){if(_0x833c05){_0xa8a55[_0xa5b5('0x2c')]=_0x833c05['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x833c05[_0xa5b5('0x69')]}});}return null;})[_0xa5b5('0x24')](handleEntityNotFound(_0x465922,null))[_0xa5b5('0x24')](function(_0x1a8649){if(_0x1a8649){return _0x1a8649[_0xa5b5('0x38')]({'UserId':_0x47fce2[_0xa5b5('0x5b')][_0xa5b5('0x66')],'read1stAt':_[_0xa5b5('0x6a')](_0x1a8649['read1stAt'])?moment()[_0xa5b5('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa5b5('0x24')](function(_0x2b6b01){if(_0x2b6b01){_0xa8a55[_0xa5b5('0x6b')]=_0x2b6b01[_0xa5b5('0x6c')]({'plain':!![]});interaction_log[_0xa5b5('0x6d')](_0xa5b5('0x6e'),_0x47fce2[_0xa5b5('0x67')]['id'],_0x47fce2[_0xa5b5('0x67')]['name'],_0x47fce2['user'][_0xa5b5('0x6f')],_0xa8a55[_0xa5b5('0x6b')]['id'],_0x47fce2['body']?JSON[_0xa5b5('0x28')](_0x47fce2[_0xa5b5('0x5b')]):_0xa5b5('0x70'));return respondWithRpcPromise(_0xa5b5('0x71'),_0xa5b5('0x72'),_0xa8a55);}return null;})['then'](function(_0xe6c1d3){var _0x552ed7=_0xa5b5('0x73')+_0xe6c1d3[_0xa5b5('0x2c')][_0xa5b5('0x74')];return db['sequelize'][_0xa5b5('0x41')](_0x552ed7,{'type':db[_0xa5b5('0x75')]['QueryTypes'][_0xa5b5('0x76')],'raw':!![]})['then'](function(_0x461da4){return _0x461da4;});})[_0xa5b5('0x24')](function(_0x2af462){if(_0x2af462){_0xa8a55[_0xa5b5('0x2c')][_0xa5b5('0x77')]=_0x2af462[0x0];if(!_0x47fce2['body'][_0xa5b5('0x66')])return;return db[_0xa5b5('0x78')][_0xa5b5('0x5c')]({'where':{'id':_0x47fce2[_0xa5b5('0x5b')][_0xa5b5('0x66')],'role':_0xa5b5('0x68')},'attributes':['id',_0xa5b5('0x3b'),_0xa5b5('0x79'),'email',_0xa5b5('0x7a')],'raw':!![]});}return null;})['then'](function(_0x57b039){if(!_0x57b039)return null;_0xa8a55['message'][_0xa5b5('0x68')]=_0x57b039;return _0xa8a55;})[_0xa5b5('0x24')](function(_0x168ed2){if(_0x168ed2){if(_0x47fce2['body'][_0xa5b5('0x7b')]){_0xa8a55[_0xa5b5('0x2c')][_0xa5b5('0x7c')]=util[_0xa5b5('0x64')](_0xa5b5('0x7d'),_0x47fce2[_0xa5b5('0x67')][_0xa5b5('0x3b')]);_0xa8a55['message'][_0xa5b5('0x7e')]=_0xa8a55[_0xa5b5('0x7e')];_0xa8a55[_0xa5b5('0x2c')][_0xa5b5('0x7f')]=_0xa8a55[_0xa5b5('0x7e')];_0xa8a55[_0xa5b5('0x2c')][_0xa5b5('0x80')]=_0xa5b5('0x60');return respondWithRpcPromise(_0xa5b5('0x81'),_0xa5b5('0x81'),{'event':_0xa5b5('0x82'),'message':_0xa8a55[_0xa5b5('0x2c')]},client9002)[_0xa5b5('0x24')](function(){return _0xa8a55;});}return _0xa8a55;}return null;})['then'](respondWithResult(_0x465922,null))[_0xa5b5('0x55')](handleError(_0x465922,null));};var interaction_log=require('../../config/logger')(_0xa5b5('0x5f'));exports[_0xa5b5('0x83')]=function(_0x1b989c,_0x57e715,_0x668846){var _0x3a2fe2={'agent':{},'channel':'whatsapp'};if(_0x1b989c['body']['id']){delete _0x1b989c[_0xa5b5('0x5b')]['id'];}_0x1b989c['body']['UserId']=_0x1b989c['body'][_0xa5b5('0x66')]||_0x1b989c['user']['id'];_0x3a2fe2['agent']['id']=_0x1b989c[_0xa5b5('0x5b')][_0xa5b5('0x66')];return db['WhatsappMessage'][_0xa5b5('0x5c')]({'where':{'id':_0x1b989c[_0xa5b5('0x57')]['id'],'UserId':null}})[_0xa5b5('0x24')](handleEntityNotFound(_0x57e715,null))[_0xa5b5('0x24')](function(_0x4d6f15){if(_0x4d6f15){_0x3a2fe2[_0xa5b5('0x2c')]=_0x4d6f15[_0xa5b5('0x6c')]({'plain':!![]});return db[_0xa5b5('0x84')][_0xa5b5('0x5c')]({'where':{'id':_0x4d6f15[_0xa5b5('0x69')]}});}return null;})[_0xa5b5('0x24')](handleEntityNotFound(_0x57e715,null))['then'](function(_0x3f2430){if(_0x3f2430){_0x3a2fe2['interaction']=_0x3f2430['get']({'plain':!![]});interaction_log['info'](_0xa5b5('0x85'),_0x1b989c[_0xa5b5('0x67')]['id'],_0x1b989c[_0xa5b5('0x67')][_0xa5b5('0x3b')],_0x1b989c[_0xa5b5('0x67')]['role'],_0x3a2fe2[_0xa5b5('0x6b')]['id'],_0x1b989c[_0xa5b5('0x5b')]?JSON[_0xa5b5('0x28')](_0x1b989c[_0xa5b5('0x5b')]):_0xa5b5('0x70'));return respondWithRpcPromise(_0xa5b5('0x86'),_0xa5b5('0x87'),_0x3a2fe2);}return null;})[_0xa5b5('0x24')](function(_0x1cbba9){var _0x83f06a=_0xa5b5('0x73')+_0x1cbba9[_0xa5b5('0x2c')][_0xa5b5('0x74')];return db[_0xa5b5('0x88')][_0xa5b5('0x41')](_0x83f06a,{'type':db[_0xa5b5('0x75')][_0xa5b5('0x89')][_0xa5b5('0x76')],'raw':!![]})['then'](function(_0x15b0f6){return _0x15b0f6;});})[_0xa5b5('0x24')](function(_0x35c54e){if(_0x35c54e){_0x3a2fe2[_0xa5b5('0x2c')]['contact']=_0x35c54e[0x0];if(!_0x1b989c[_0xa5b5('0x5b')][_0xa5b5('0x66')])return;return db[_0xa5b5('0x78')][_0xa5b5('0x5c')]({'where':{'id':_0x1b989c[_0xa5b5('0x5b')][_0xa5b5('0x66')],'role':'agent'},'attributes':['id','name',_0xa5b5('0x79'),_0xa5b5('0x8a'),_0xa5b5('0x7a')],'raw':!![]});}return null;})['then'](function(_0x5dadd8){if(!_0x5dadd8)return null;_0x3a2fe2[_0xa5b5('0x2c')][_0xa5b5('0x68')]=_0x5dadd8;return _0x3a2fe2;})[_0xa5b5('0x24')](function(_0xf5d0d4){if(_0xf5d0d4){_0xf5d0d4['message'][_0xa5b5('0x7c')]=util[_0xa5b5('0x64')](_0xa5b5('0x7d'),_0x1b989c[_0xa5b5('0x67')][_0xa5b5('0x3b')]);_0xf5d0d4[_0xa5b5('0x2c')][_0xa5b5('0x7e')]=_0x3a2fe2[_0xa5b5('0x7e')];_0xf5d0d4[_0xa5b5('0x2c')][_0xa5b5('0x7f')]=_0x3a2fe2[_0xa5b5('0x7e')];_0xf5d0d4['message']['event']=_0xa5b5('0x83');respondWithRpcPromise(_0xa5b5('0x81'),_0xa5b5('0x81'),{'event':'rejectmessage','message':_0xf5d0d4[_0xa5b5('0x2c')]},client9002);return _0x3a2fe2;}return null;})[_0xa5b5('0x24')](respondWithResult(_0x57e715,null))[_0xa5b5('0x55')](handleError(_0x57e715,null));};exports[_0xa5b5('0x2f')]=function(_0x42df08,_0x31b5ff,_0xa6b989){if(_0x42df08[_0xa5b5('0x5b')]['id']){delete _0x42df08[_0xa5b5('0x5b')]['id'];}var _0x48ff63;return db[_0xa5b5('0x52')]['find']({'where':{'id':_0x42df08[_0xa5b5('0x57')]['id']}})[_0xa5b5('0x24')](handleEntityNotFound(_0x31b5ff,null))[_0xa5b5('0x24')](function(_0x36794e){if(_0x36794e){_0x48ff63=_0x36794e;return db[_0xa5b5('0x8b')][_0xa5b5('0x5c')]({'where':{'id':_0x36794e[_0xa5b5('0x8c')]}});}})['then'](handleEntityNotFound(_0x31b5ff,null))[_0xa5b5('0x24')](function(_0x47d665){if(_0x47d665){logger[_0xa5b5('0x25')](_0xa5b5('0x8d'),_0xa5b5('0x2f'),'received\x20delivery\x20report\x20from',_0x47d665[_0xa5b5('0x4f')],util[_0xa5b5('0x8e')](_0x42df08[_0xa5b5('0x5b')],{'showHidden':![],'depth':null}));switch(_0x47d665[_0xa5b5('0x4f')]){case _0xa5b5('0x8f'):if(_0x42df08[_0xa5b5('0x5b')][_0xa5b5('0x90')]&&_0x42df08[_0xa5b5('0x5b')][_0xa5b5('0x90')]===_0x48ff63[_0xa5b5('0x91')]&&_0x42df08[_0xa5b5('0x5b')]['MessageStatus']&&_0x42df08[_0xa5b5('0x5b')][_0xa5b5('0x92')]===_0xa5b5('0x62')){return _0x48ff63[_0xa5b5('0x38')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xa5b5('0x2f'),_0xa5b5('0x8f'),util[_0xa5b5('0x8e')](_0x42df08[_0xa5b5('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x48ff63;}})[_0xa5b5('0x24')](respondWithResult(_0x31b5ff,null))[_0xa5b5('0x55')](handleError(_0x31b5ff,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 39d1723..687363e 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 _0x24cf=['WhatsappMessage','setMaxListeners','save','update','remove','emit','exports'];(function(_0x12e073,_0x2a6387){var _0x17e67b=function(_0x61b780){while(--_0x61b780){_0x12e073['push'](_0x12e073['shift']());}};_0x17e67b(++_0x2a6387);}(_0x24cf,0x1d5));var _0xf24c=function(_0x22e937,_0xf3befd){_0x22e937=_0x22e937-0x0;var _0x49e239=_0x24cf[_0x22e937];return _0x49e239;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xf24c('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf24c('0x1')](0x0);var events={'afterCreate':_0xf24c('0x2'),'afterUpdate':_0xf24c('0x3'),'afterDestroy':_0xf24c('0x4')};function emitEvent(_0x4cc9b1){return function(_0x3cfc01,_0x417bb2,_0x1eafb4){WhatsappMessageEvents[_0xf24c('0x5')](_0x4cc9b1+':'+_0x3cfc01['id'],_0x3cfc01);WhatsappMessageEvents['emit'](_0x4cc9b1,_0x3cfc01);_0x1eafb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xf24c('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x57f8=['emit','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x250322,_0x726b38){var _0x24a9f0=function(_0x33ceb7){while(--_0x33ceb7){_0x250322['push'](_0x250322['shift']());}};_0x24a9f0(++_0x726b38);}(_0x57f8,0x198));var _0x857f=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x57f8[_0x4bb145];return _0x4db596;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x857f('0x0'))['db'][_0x857f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x857f('0x2')](0x0);var events={'afterCreate':_0x857f('0x3'),'afterUpdate':_0x857f('0x4'),'afterDestroy':_0x857f('0x5')};function emitEvent(_0x2ff336){return function(_0x6f054b,_0x318050,_0xced48e){WhatsappMessageEvents[_0x857f('0x6')](_0x2ff336+':'+_0x6f054b['id'],_0x6f054b);WhatsappMessageEvents[_0x857f('0x6')](_0x2ff336,_0x6f054b);_0xced48e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x857f('0x7')](e,emitEvent(event));}}module[_0x857f('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 b45371a..c43fee7 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 _0x03dc=['/whatsapp/v1/','/messages/','body','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','catch','WhatsappAccount','find','WhatsappAccountId','type','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken'];(function(_0x2261de,_0x118ef8){var _0xea5cf2=function(_0x4117db){while(--_0x4117db){_0x2261de['push'](_0x2261de['shift']());}};_0xea5cf2(++_0x118ef8);}(_0x03dc,0x85));var _0xc03d=function(_0x3de52,_0x225195){_0x3de52=_0x3de52-0x0;var _0x3c4e9a=_0x03dc[_0x3de52];return _0x3c4e9a;};'use strict';var _=require(_0xc03d('0x0'));var util=require(_0xc03d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc03d('0x2'));var BPromise=require(_0xc03d('0x3'));var rp=require(_0xc03d('0x4'));var fetch=require(_0xc03d('0x5'));var fs=require('fs');var path=require(_0xc03d('0x6'));var rimraf=require(_0xc03d('0x7'));var config=require('../../config/environment');var attributes=require(_0xc03d('0x8'));module[_0xc03d('0x9')]=function(_0x255e98,_0x20982c){return _0x255e98[_0xc03d('0xa')](_0xc03d('0xb'),attributes,{'tableName':_0xc03d('0xc'),'paranoid':![],'indexes':[{'name':_0xc03d('0xd'),'fields':[_0xc03d('0xd')]},{'name':_0xc03d('0xe'),'fields':['body'],'type':_0xc03d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf832c6,_0x3f2c98,_0x1cea03){var _0x3297e5=_0x255e98[_0xc03d('0x10')];var _0x20b28b=_0xf832c6[_0xc03d('0x11')]({'plain':!![]});if(_0x20b28b[_0xc03d('0x12')][_0xc03d('0x13')]()==='in'||_0x20b28b['direction'][_0xc03d('0x13')]()===_0xc03d('0x14')&&!_0x20b28b[_0xc03d('0x15')]&&!_[_0xc03d('0x16')](_0x20b28b[_0xc03d('0x17')])){_0x3297e5[_0xc03d('0x18')]['findOne']({'where':{'id':_0x20b28b[_0xc03d('0x19')]}})[_0xc03d('0x1a')](function(_0x5a5d60){if(_0x5a5d60){_0x5a5d60[_0xc03d('0x1b')]({'lastMsgAt':_0x20b28b['createdAt'],'lastMsgDirection':_0x20b28b['direction']['toLowerCase']()});}})[_0xc03d('0x1c')](function(_0xc581c){console['error'](_0xc581c);});}if(_0x20b28b['direction']===_0xc03d('0x14')&&!_0x20b28b['secret']){var _0x7987e2;_0x3297e5[_0xc03d('0x1d')][_0xc03d('0x1e')]({'where':{'id':_0x20b28b[_0xc03d('0x1f')]},'raw':!![]})[_0xc03d('0x1a')](function(_0x5995fb){_0x7987e2=_0x5995fb;if(_0x7987e2&&_0x7987e2[_0xc03d('0x20')]){switch(_0x7987e2[_0xc03d('0x20')]){case'twilio':var _0x8c8c9a=require('twilio');if(_0x7987e2[_0xc03d('0x21')]&&_0x7987e2[_0xc03d('0x22')]&&_0x7987e2[_0xc03d('0x23')]){var _0x4f5508=new _0x8c8c9a(_0x7987e2[_0xc03d('0x21')],_0x7987e2['authToken']);_0x4f5508[_0xc03d('0x24')][_0xc03d('0x25')]({'body':_0x20b28b['body'],'to':_0xc03d('0x26')+_0x20b28b[_0xc03d('0x23')],'from':_0xc03d('0x26')+_0x7987e2[_0xc03d('0x23')],'statusCallback':_0x7987e2[_0xc03d('0x27')]+_0xc03d('0x28')+_0x20b28b['id']+_0xc03d('0x29')+_0x7987e2[_0xc03d('0x2a')]})[_0xc03d('0x1a')](function(_0x263533){if(_0x263533[_0xc03d('0x2b')]){return _0xf832c6['update']({'messageId':_0x263533['sid']});}})[_0xc03d('0x1c')](function(_0x2cfba3){logger[_0xc03d('0x2c')](_0xc03d('0x2d'),'afterCreate',_0xc03d('0x2e'),util[_0xc03d('0x2f')](_0x2cfba3,{'showHidden':![],'depth':null}));});}else{logger[_0xc03d('0x2c')](_0xc03d('0x2d'),_0xc03d('0x30'),_0xc03d('0x2e'),_0xc03d('0x31'));}break;case'sinch':var _0x3cc183=_0x7987e2[_0xc03d('0x21')];var _0x4f54aa=_0x7987e2[_0xc03d('0x22')];var _0x39657b=_0x7987e2['baseUrl']+_0xc03d('0x32')+_0x3cc183+_0xc03d('0x33');var _0x2204b1={'to':[_0x20b28b[_0xc03d('0x23')]],'message':{'type':'text','text':_0x20b28b[_0xc03d('0x34')]}};var _0x3fe3f6={'method':_0xc03d('0x35'),'uri':_0x39657b,'headers':{'Authorization':'Bearer\x20'+_0x4f54aa,'Content-Type':_0xc03d('0x36')},'body':_0x2204b1,'json':!![]};rp(_0x3fe3f6)[_0xc03d('0x1a')](function(_0x374d94){if(_0x374d94[_0xc03d('0x37')][0x0][_0xc03d('0x38')]){return _0xf832c6[_0xc03d('0x1b')]({'messageId':_0x374d94[_0xc03d('0x37')][0x0]['message_id']});}})[_0xc03d('0x1c')](function(_0x12c7d8){logger[_0xc03d('0x39')](_0xc03d('0x3a'),_0x12c7d8);});break;}}})[_0xc03d('0x3b')](function(){_0x1cea03();});}else{_0x1cea03();}}},'charset':'utf8mb4','collate':_0xc03d('0x3c')});}; \ No newline at end of file +var _0x28e5=['messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','out','WhatsappAccount','find','type','twilio','authToken','accountSid','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','message_id','statuses','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','exports','define'];(function(_0x4ea48f,_0x1a7ef1){var _0x132a76=function(_0x1a72e5){while(--_0x1a72e5){_0x4ea48f['push'](_0x4ea48f['shift']());}};_0x132a76(++_0x1a7ef1);}(_0x28e5,0x1a6));var _0x528e=function(_0x534f34,_0x705b1c){_0x534f34=_0x534f34-0x0;var _0x2f4a9c=_0x28e5[_0x534f34];return _0x2f4a9c;};'use strict';var _=require(_0x528e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x528e('0x1'));var moment=require(_0x528e('0x2'));var BPromise=require('bluebird');var rp=require(_0x528e('0x3'));var fetch=require(_0x528e('0x4'));var fs=require('fs');var path=require(_0x528e('0x5'));var rimraf=require(_0x528e('0x6'));var config=require(_0x528e('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x528e('0x8')]=function(_0x2bf665,_0x4ba962){return _0x2bf665[_0x528e('0x9')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x528e('0xa'),'fields':[_0x528e('0xa')]},{'name':_0x528e('0xb'),'fields':[_0x528e('0xc')],'type':_0x528e('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x544670,_0x217fd8,_0x1a9656){var _0x288531=_0x2bf665[_0x528e('0xe')];var _0x25bb1d=_0x544670['get']({'plain':!![]});if(_0x25bb1d[_0x528e('0xf')]['toLowerCase']()==='in'||_0x25bb1d[_0x528e('0xf')][_0x528e('0x10')]()==='out'&&!_0x25bb1d[_0x528e('0x11')]&&!_[_0x528e('0x12')](_0x25bb1d[_0x528e('0x13')])){_0x288531[_0x528e('0x14')]['findOne']({'where':{'id':_0x25bb1d[_0x528e('0x15')]}})[_0x528e('0x16')](function(_0x217274){if(_0x217274){_0x217274[_0x528e('0x17')]({'lastMsgAt':_0x25bb1d[_0x528e('0x18')],'lastMsgDirection':_0x25bb1d['direction']['toLowerCase']()});}})[_0x528e('0x19')](function(_0x2fe62b){console[_0x528e('0x1a')](_0x2fe62b);});}if(_0x25bb1d[_0x528e('0xf')]===_0x528e('0x1b')&&!_0x25bb1d[_0x528e('0x11')]){var _0x337a5f;_0x288531[_0x528e('0x1c')][_0x528e('0x1d')]({'where':{'id':_0x25bb1d['WhatsappAccountId']},'raw':!![]})['then'](function(_0x5e5145){_0x337a5f=_0x5e5145;if(_0x337a5f&&_0x337a5f[_0x528e('0x1e')]){switch(_0x337a5f[_0x528e('0x1e')]){case _0x528e('0x1f'):var _0x324f8f=require(_0x528e('0x1f'));if(_0x337a5f['accountSid']&&_0x337a5f[_0x528e('0x20')]&&_0x337a5f['phone']){var _0xcf05cb=new _0x324f8f(_0x337a5f[_0x528e('0x21')],_0x337a5f[_0x528e('0x20')]);_0xcf05cb['messages'][_0x528e('0x22')]({'body':_0x25bb1d['body'],'to':_0x528e('0x23')+_0x25bb1d[_0x528e('0x24')],'from':_0x528e('0x23')+_0x337a5f[_0x528e('0x24')],'statusCallback':_0x337a5f[_0x528e('0x25')]+_0x528e('0x26')+_0x25bb1d['id']+_0x528e('0x27')+_0x337a5f['token']})['then'](function(_0x882ccf){if(_0x882ccf['sid']){return _0x544670[_0x528e('0x17')]({'messageId':_0x882ccf['sid']});}})[_0x528e('0x19')](function(_0x82b734){logger['error'](_0x528e('0x28'),'afterCreate','twilio',util[_0x528e('0x29')](_0x82b734,{'showHidden':![],'depth':null}));});}else{logger[_0x528e('0x1a')](_0x528e('0x28'),_0x528e('0x2a'),_0x528e('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x528e('0x2b'):var _0x2699a5=_0x337a5f[_0x528e('0x21')];var _0x3f9ce6=_0x337a5f[_0x528e('0x20')];var _0x27a3d3=_0x337a5f[_0x528e('0x2c')]+_0x528e('0x2d')+_0x2699a5+_0x528e('0x2e');var _0x414220={'to':[_0x25bb1d[_0x528e('0x24')]],'message':{'type':_0x528e('0x2f'),'text':_0x25bb1d[_0x528e('0xc')]}};var _0x46eb9b={'method':_0x528e('0x30'),'uri':_0x27a3d3,'headers':{'Authorization':_0x528e('0x31')+_0x3f9ce6,'Content-Type':'application/json'},'body':_0x414220,'json':!![]};rp(_0x46eb9b)[_0x528e('0x16')](function(_0x497601){if(_0x497601['statuses'][0x0][_0x528e('0x32')]){return _0x544670[_0x528e('0x17')]({'messageId':_0x497601[_0x528e('0x33')][0x0][_0x528e('0x32')]});}})[_0x528e('0x19')](function(_0x442bf7){logger['err'](_0x528e('0x34'),_0x442bf7);});break;}}})['finally'](function(){_0x1a9656();});}else{_0x1a9656();}}},'charset':'utf8mb4','collate':_0x528e('0x35')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 2b3b465..5953e70 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 _0x6e10=['options','then','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateWhatsappMessage','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6e10,0x189));var _0x06e1=function(_0x5a3ec9,_0x126602){_0x5a3ec9=_0x5a3ec9-0x0;var _0x2c79d3=_0x6e10[_0x5a3ec9];return _0x2c79d3;};'use strict';var _=require(_0x06e1('0x0'));var util=require(_0x06e1('0x1'));var moment=require(_0x06e1('0x2'));var BPromise=require(_0x06e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06e1('0x4'));var db=require(_0x06e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x06e1('0x6'));var config=require(_0x06e1('0x7'));var jayson=require(_0x06e1('0x8'));var client=jayson[_0x06e1('0x9')][_0x06e1('0xa')]({'port':0x232a});config[_0x06e1('0xb')]=_[_0x06e1('0xc')](config[_0x06e1('0xb')],{'host':_0x06e1('0xd'),'port':0x18eb});var socket=require(_0x06e1('0xe'))(new Redis(config[_0x06e1('0xb')]));require(_0x06e1('0xf'))[_0x06e1('0x10')](socket);function respondWithRpcPromise(_0x1d2ef2,_0x24345a,_0x1600ab){return new BPromise(function(_0x222bf,_0x1aa109){return client['request'](_0x1d2ef2,_0x1600ab)['then'](function(_0x49f78a){logger['info'](_0x06e1('0x11'),_0x24345a,_0x06e1('0x12'));logger[_0x06e1('0x13')](_0x06e1('0x14'),_0x24345a,_0x06e1('0x12'),JSON[_0x06e1('0x15')](_0x49f78a));if(_0x49f78a['error']){if(_0x49f78a[_0x06e1('0x16')][_0x06e1('0x17')]===0x1f4){logger['error'](_0x06e1('0x11'),_0x24345a,_0x49f78a[_0x06e1('0x16')][_0x06e1('0x18')]);return _0x1aa109(_0x49f78a[_0x06e1('0x16')][_0x06e1('0x18')]);}logger['error'](_0x06e1('0x11'),_0x24345a,_0x49f78a[_0x06e1('0x16')]['message']);return _0x222bf(_0x49f78a[_0x06e1('0x16')]['message']);}else{logger['info'](_0x06e1('0x11'),_0x24345a,_0x06e1('0x12'));_0x222bf(_0x49f78a['result'][_0x06e1('0x18')]);}})['catch'](function(_0x1043e6){logger[_0x06e1('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x24345a,_0x1043e6);_0x1aa109(_0x1043e6);});});}exports[_0x06e1('0x19')]=function(_0x2129e7){var _0x336c99=this;return new Promise(function(_0x102def,_0x31d8c8){return db['WhatsappMessage'][_0x06e1('0x1a')](_0x2129e7['body'],{'raw':_0x2129e7['options']?_0x2129e7[_0x06e1('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x06e1('0x1c')](function(_0x48d64d){logger[_0x06e1('0x1d')]('CreateWhatsappMessage',_0x2129e7);logger[_0x06e1('0x13')](_0x06e1('0x19'),_0x2129e7,JSON[_0x06e1('0x15')](_0x48d64d));_0x102def(_0x48d64d);})['catch'](function(_0x52e7ba){logger[_0x06e1('0x16')](_0x06e1('0x19'),_0x52e7ba['message'],_0x2129e7);_0x31d8c8(_0x336c99[_0x06e1('0x16')](0x1f4,_0x52e7ba[_0x06e1('0x18')]));});});}; \ No newline at end of file +var _0xb99d=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','create','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./whatsappMessage.socket','request','then'];(function(_0x36e8fb,_0xd3701c){var _0x3399c2=function(_0x2d325c){while(--_0x2d325c){_0x36e8fb['push'](_0x36e8fb['shift']());}};_0x3399c2(++_0xd3701c);}(_0xb99d,0xb5));var _0xdb99=function(_0x66e2cf,_0x58eae6){_0x66e2cf=_0x66e2cf-0x0;var _0x2c7c91=_0xb99d[_0x66e2cf];return _0x2c7c91;};'use strict';var _=require(_0xdb99('0x0'));var util=require(_0xdb99('0x1'));var moment=require(_0xdb99('0x2'));var BPromise=require(_0xdb99('0x3'));var rs=require(_0xdb99('0x4'));var fs=require('fs');var Redis=require(_0xdb99('0x5'));var db=require(_0xdb99('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb99('0x7'))(_0xdb99('0x8'));var config=require(_0xdb99('0x9'));var jayson=require(_0xdb99('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xdb99('0xb')]=_[_0xdb99('0xc')](config[_0xdb99('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb99('0xd'))(new Redis(config[_0xdb99('0xb')]));require(_0xdb99('0xe'))['register'](socket);function respondWithRpcPromise(_0x32b879,_0x501d27,_0x341587){return new BPromise(function(_0x16a84a,_0x46aa3f){return client[_0xdb99('0xf')](_0x32b879,_0x341587)[_0xdb99('0x10')](function(_0x53f8da){logger[_0xdb99('0x11')](_0xdb99('0x12'),_0x501d27,_0xdb99('0x13'));logger[_0xdb99('0x14')](_0xdb99('0x15'),_0x501d27,'request\x20sent',JSON[_0xdb99('0x16')](_0x53f8da));if(_0x53f8da[_0xdb99('0x17')]){if(_0x53f8da['error'][_0xdb99('0x18')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x501d27,_0x53f8da['error']['message']);return _0x46aa3f(_0x53f8da['error'][_0xdb99('0x19')]);}logger[_0xdb99('0x17')](_0xdb99('0x12'),_0x501d27,_0x53f8da[_0xdb99('0x17')][_0xdb99('0x19')]);return _0x16a84a(_0x53f8da[_0xdb99('0x17')][_0xdb99('0x19')]);}else{logger[_0xdb99('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x501d27,_0xdb99('0x13'));_0x16a84a(_0x53f8da[_0xdb99('0x1a')]['message']);}})[_0xdb99('0x1b')](function(_0x4ccb52){logger[_0xdb99('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x501d27,_0x4ccb52);_0x46aa3f(_0x4ccb52);});});}exports['CreateWhatsappMessage']=function(_0x8b5036){var _0x5ad5ef=this;return new Promise(function(_0x13276a,_0x542c98){return db[_0xdb99('0x1c')][_0xdb99('0x1d')](_0x8b5036['body'],{'raw':_0x8b5036[_0xdb99('0x1e')]?_0x8b5036[_0xdb99('0x1e')][_0xdb99('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x19d854){logger[_0xdb99('0x11')](_0xdb99('0x20'),_0x8b5036);logger['debug']('CreateWhatsappMessage',_0x8b5036,JSON[_0xdb99('0x16')](_0x19d854));_0x13276a(_0x19d854);})[_0xdb99('0x1b')](function(_0x4b98a0){logger['error'](_0xdb99('0x20'),_0x4b98a0[_0xdb99('0x19')],_0x8b5036);_0x542c98(_0x5ad5ef[_0xdb99('0x17')](0x1f4,_0x4b98a0['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c3ea08a..0bad32c 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 _0x9da3=['remove','update','register','./whatsappMessage.events','save'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x9da3,0x1c0));var _0x39da=function(_0x458b85,_0x2c070f){_0x458b85=_0x458b85-0x0;var _0x5cdc17=_0x9da3[_0x458b85];return _0x5cdc17;};'use strict';var WhatsappMessageEvents=require(_0x39da('0x0'));var events=[_0x39da('0x1'),_0x39da('0x2'),_0x39da('0x3')];function createListener(_0x2d17af,_0x5407a6){return function(_0x3f06f9){_0x5407a6['emit'](_0x2d17af,_0x3f06f9);};}function removeListener(_0x32d4f9,_0x35834e){return function(){WhatsappMessageEvents['removeListener'](_0x32d4f9,_0x35834e);};}exports[_0x39da('0x4')]=function(_0x2df89e){for(var _0x59195c=0x0,_0x4f8f75=events['length'];_0x59195c<_0x4f8f75;_0x59195c++){var _0x5e550b=events[_0x59195c];var _0x467f50=createListener('whatsappMessage:'+_0x5e550b,_0x2df89e);WhatsappMessageEvents['on'](_0x5e550b,_0x467f50);}}; \ No newline at end of file +var _0x5b89=['emit','removeListener','./whatsappMessage.events','save','update'];(function(_0x259cdb,_0x3696ff){var _0x102792=function(_0x59aa1e){while(--_0x59aa1e){_0x259cdb['push'](_0x259cdb['shift']());}};_0x102792(++_0x3696ff);}(_0x5b89,0xd9));var _0x95b8=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x5b89[_0x2601b4];return _0x3e3661;};'use strict';var WhatsappMessageEvents=require(_0x95b8('0x0'));var events=[_0x95b8('0x1'),'remove',_0x95b8('0x2')];function createListener(_0x53ceee,_0x4b1042){return function(_0x164da1){_0x4b1042[_0x95b8('0x3')](_0x53ceee,_0x164da1);};}function removeListener(_0x1ef509,_0x652c75){return function(){WhatsappMessageEvents[_0x95b8('0x4')](_0x1ef509,_0x652c75);};}exports['register']=function(_0x2b29f1){for(var _0x1309c4=0x0,_0x4f3ef8=events['length'];_0x1309c4<_0x4f3ef8;_0x1309c4++){var _0x15c7ff=events[_0x1309c4];var _0x254341=createListener('whatsappMessage:'+_0x15c7ff,_0x2b29f1);WhatsappMessageEvents['on'](_0x15c7ff,_0x254341);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index fd5cc27..028806b 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 _0x135c=['isAuthenticated','index','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x4f633b,_0x52b8e4){var _0x8932d4=function(_0x74d097){while(--_0x74d097){_0x4f633b['push'](_0x4f633b['shift']());}};_0x8932d4(++_0x52b8e4);}(_0x135c,0x199));var _0xc135=function(_0x2f64a0,_0x3658e5){_0x2f64a0=_0x2f64a0-0x0;var _0x2f9ea5=_0x135c[_0x2f64a0];return _0x2f9ea5;};'use strict';var multer=require(_0xc135('0x0'));var util=require(_0xc135('0x1'));var path=require(_0xc135('0x2'));var timeout=require(_0xc135('0x3'));var express=require(_0xc135('0x4'));var router=express[_0xc135('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc135('0x6'));var interaction=require(_0xc135('0x7'));var config=require(_0xc135('0x8'));var controller=require(_0xc135('0x9'));router[_0xc135('0xa')]('/',auth[_0xc135('0xb')](),controller[_0xc135('0xc')]);router['get']('/describe',auth[_0xc135('0xb')](),controller['describe']);router['get'](_0xc135('0xd'),auth['isAuthenticated'](),controller[_0xc135('0xe')]);router[_0xc135('0xa')](_0xc135('0xf'),auth[_0xc135('0xb')](),controller[_0xc135('0x10')]);router['get'](_0xc135('0x11'),auth[_0xc135('0xb')](),controller[_0xc135('0x12')]);router[_0xc135('0xa')]('/:id/users',auth[_0xc135('0xb')](),controller[_0xc135('0x13')]);router[_0xc135('0x14')]('/',auth[_0xc135('0xb')](),controller['create']);router[_0xc135('0x14')](_0xc135('0x11'),auth[_0xc135('0xb')](),controller[_0xc135('0x15')]);router[_0xc135('0x14')](_0xc135('0x16'),auth['isAuthenticated'](),controller[_0xc135('0x17')]);router['put'](_0xc135('0xd'),auth[_0xc135('0xb')](),controller[_0xc135('0x18')]);router['delete'](_0xc135('0xd'),auth[_0xc135('0xb')](),controller[_0xc135('0x19')]);router[_0xc135('0x1a')](_0xc135('0x11'),auth[_0xc135('0xb')](),controller[_0xc135('0x1b')]);router[_0xc135('0x1a')](_0xc135('0x16'),auth['isAuthenticated'](),controller[_0xc135('0x1c')]);module[_0xc135('0x1d')]=router; \ No newline at end of file +var _0x734d=['get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','addAgents','put','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','../../components/interaction/service','./whatsappQueue.controller','isAuthenticated','index'];(function(_0x1a998b,_0x36bc42){var _0x46fdd4=function(_0x532782){while(--_0x532782){_0x1a998b['push'](_0x1a998b['shift']());}};_0x46fdd4(++_0x36bc42);}(_0x734d,0x1d3));var _0xd734=function(_0x20b531,_0x35a6cb){_0x20b531=_0x20b531-0x0;var _0x3f09c1=_0x734d[_0x20b531];return _0x3f09c1;};'use strict';var multer=require('multer');var util=require(_0xd734('0x0'));var path=require(_0xd734('0x1'));var timeout=require(_0xd734('0x2'));var express=require(_0xd734('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd734('0x4'));var config=require('../../config/environment');var controller=require(_0xd734('0x5'));router['get']('/',auth[_0xd734('0x6')](),controller[_0xd734('0x7')]);router[_0xd734('0x8')](_0xd734('0x9'),auth[_0xd734('0x6')](),controller[_0xd734('0xa')]);router['get'](_0xd734('0xb'),auth[_0xd734('0x6')](),controller[_0xd734('0xc')]);router[_0xd734('0x8')](_0xd734('0xd'),auth[_0xd734('0x6')](),controller[_0xd734('0xe')]);router[_0xd734('0x8')](_0xd734('0xf'),auth[_0xd734('0x6')](),controller[_0xd734('0x10')]);router[_0xd734('0x8')](_0xd734('0x11'),auth[_0xd734('0x6')](),controller['getAgents']);router['post']('/',auth[_0xd734('0x6')](),controller[_0xd734('0x12')]);router['post'](_0xd734('0xf'),auth[_0xd734('0x6')](),controller['addTeams']);router['post'](_0xd734('0x11'),auth[_0xd734('0x6')](),controller[_0xd734('0x13')]);router[_0xd734('0x14')](_0xd734('0xb'),auth[_0xd734('0x6')](),controller['update']);router[_0xd734('0x15')]('/:id',auth[_0xd734('0x6')](),controller[_0xd734('0x16')]);router['delete'](_0xd734('0xf'),auth[_0xd734('0x6')](),controller[_0xd734('0x17')]);router['delete'](_0xd734('0x11'),auth[_0xd734('0x6')](),controller['removeAgents']);module[_0xd734('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 3c894ce..641cc1e 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 _0x0f9f=['name','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x231b2e,_0xc6a0e7){var _0x345b84=function(_0x4071f2){while(--_0x4071f2){_0x231b2e['push'](_0x231b2e['shift']());}};_0x345b84(++_0xc6a0e7);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x0f9f[_0x81f000];return _0x337aa2;};'use strict';var Sequelize=require('sequelize');module[_0xf0f9('0x0')]={'name':{'type':Sequelize[_0xf0f9('0x1')],'unique':_0xf0f9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf0f9('0x3')](_0xf0f9('0x4'),_0xf0f9('0x5'),_0xf0f9('0x6'))},'description':{'type':Sequelize[_0xf0f9('0x1')]}}; \ No newline at end of file +var _0xa25c=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x498d05,_0xb6b01f){var _0x5ca6e2=function(_0x2e854d){while(--_0x2e854d){_0x498d05['push'](_0x498d05['shift']());}};_0x5ca6e2(++_0xb6b01f);}(_0xa25c,0x13f));var _0xca25=function(_0x4a81c3,_0x504a70){_0x4a81c3=_0x4a81c3-0x0;var _0x17a34f=_0xa25c[_0x4a81c3];return _0x17a34f;};'use strict';var Sequelize=require('sequelize');module[_0xca25('0x0')]={'name':{'type':Sequelize[_0xca25('0x1')],'unique':_0xca25('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xca25('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca25('0x4')](_0xca25('0x5'),_0xca25('0x6'),_0xca25('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 9e2ed1f..f5419f7 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 _0x412c=['transaction','each','forEach','emit','removeTeams','field','tq.TeamId','from','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./whatsappQueue.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','map','WhatsappQueue','type','key','getOptions','where','include','query','findAll','rows','show','params','keys','filters','model','intersection','fields','attributes','length','includeAll','options','find','catch','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','get','rawAttributes','sort','pick','WhatsappQueueId','filter','merge','User','UserId','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','getTeams','findOne','Team','order','hasOwnProperty','nolimit','addTeams','online','voicePause','Agents','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x412c,0x182));var _0xc412=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x412c[_0x16d10f];return _0x50c823;};'use strict';var BPromise=require(_0xc412('0x0'));var util=require(_0xc412('0x1'));var _=require(_0xc412('0x2'));var squel=require(_0xc412('0x3'));var Redis=require(_0xc412('0x4'));var qs=require(_0xc412('0x5'));var logger=require(_0xc412('0x6'))(_0xc412('0x7'));var config=require('../../config/environment');var db=require(_0xc412('0x8'))['db'];config['redis']=_[_0xc412('0x9')](config[_0xc412('0xa')],{'host':_0xc412('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc412('0xa')]));require(_0xc412('0xc'))[_0xc412('0xd')](socket);function respondWithStatusCode(_0x1f83dc,_0x5561cc){_0x5561cc=_0x5561cc||0xcc;return function(_0x10b2d4){if(_0x10b2d4){return _0x1f83dc['sendStatus'](_0x5561cc);}return _0x1f83dc['status'](_0x5561cc)[_0xc412('0xe')]();};}function respondWithResult(_0x5223de,_0x42e4e5){_0x42e4e5=_0x42e4e5||0xc8;return function(_0x2c0c6c){if(_0x2c0c6c){return _0x5223de[_0xc412('0xf')](_0x42e4e5)[_0xc412('0x10')](_0x2c0c6c);}};}function respondWithFilteredResult(_0x1d5a6b,_0x4d5814){return function(_0x33c2f3){if(_0x33c2f3){var _0xc32a78=typeof _0x4d5814[_0xc412('0x11')]==='undefined'&&typeof _0x4d5814[_0xc412('0x12')]===_0xc412('0x13');var _0x55c0cc=_0x33c2f3['count'];var _0x24f368=_0xc32a78?0x0:_0x4d5814[_0xc412('0x11')];var _0x1f6ada=_0xc32a78?_0x33c2f3[_0xc412('0x14')]:_0x4d5814['offset']+_0x4d5814['limit'];var _0x55d0e3;if(_0x1f6ada>=_0x55c0cc){_0x1f6ada=_0x55c0cc;_0x55d0e3=0xc8;}else{_0x55d0e3=0xce;}_0x1d5a6b[_0xc412('0xf')](_0x55d0e3);return _0x1d5a6b[_0xc412('0x15')](_0xc412('0x16'),_0x24f368+'-'+_0x1f6ada+'/'+_0x55c0cc)[_0xc412('0x10')](_0x33c2f3);}return null;};}function saveUpdates(_0x3cda51){return function(_0x21cce4){if(_0x21cce4){return _0x21cce4[_0xc412('0x17')](_0x3cda51)[_0xc412('0x18')](function(_0x2e28da){return _0x2e28da;});}return null;};}function removeEntity(_0x563a8b){return function(_0x5a623a){if(_0x5a623a){return _0x5a623a[_0xc412('0x19')]()[_0xc412('0x18')](function(){var _0x48ba31=_0x5a623a['get']({'plain':!![]});var _0x3762ba=_0xc412('0x1a');return db[_0xc412('0x1b')][_0xc412('0x19')]({'where':{'type':_0x3762ba,'resourceId':_0x48ba31['id']}})[_0xc412('0x18')](function(){return _0x5a623a;});})['then'](function(){_0x563a8b[_0xc412('0xf')](0xcc)[_0xc412('0xe')]();});}};}function handleEntityNotFound(_0x5baeed){return function(_0x2238bd){if(!_0x2238bd){_0x5baeed[_0xc412('0x1c')](0x194);}return _0x2238bd;};}function handleError(_0x45e911,_0x19056d){_0x19056d=_0x19056d||0x1f4;return function(_0x258375){logger[_0xc412('0x1d')](_0x258375[_0xc412('0x1e')]);if(_0x258375['name']){delete _0x258375[_0xc412('0x1f')];}_0x45e911[_0xc412('0xf')](_0x19056d)[_0xc412('0x20')](_0x258375);};}exports['index']=function(_0x6136cc,_0x53d374){var _0x36970d={};var _0x2e00eb={'count':0x0,'rows':[]};var _0x5d0191=_[_0xc412('0x21')](db[_0xc412('0x22')]['rawAttributes'],function(_0x3366e9){return{'name':_0x3366e9['fieldName'],'type':_0x3366e9[_0xc412('0x23')][_0xc412('0x24')]};});_0x36970d=qs[_0xc412('0x25')](_0x5d0191,_0x6136cc);var _0x425df6={'where':_0x36970d[_0xc412('0x26')]};return db[_0xc412('0x22')][_0xc412('0x14')](_0x425df6)['then'](function(_0x3dad4f){_0x2e00eb['count']=_0x3dad4f;_0x36970d[_0xc412('0x27')]=qs[_0xc412('0x27')](_0x6136cc[_0xc412('0x28')]);return db[_0xc412('0x22')][_0xc412('0x29')](_0x36970d);})[_0xc412('0x18')](function(_0x57d72b){_0x2e00eb[_0xc412('0x2a')]=_0x57d72b;return _0x2e00eb;})[_0xc412('0x18')](respondWithFilteredResult(_0x53d374,_0x36970d))['catch'](handleError(_0x53d374,null));};exports[_0xc412('0x2b')]=function(_0x4620d6,_0x45a611){var _0x5296a2={'raw':!![],'where':{'id':_0x4620d6[_0xc412('0x2c')]['id']}},_0x2491c1={};_0x2491c1['model']=_['keys'](db[_0xc412('0x22')]['rawAttributes']);_0x2491c1['query']=_[_0xc412('0x2d')](_0x4620d6['query']);_0x2491c1[_0xc412('0x2e')]=_['intersection'](_0x2491c1[_0xc412('0x2f')],_0x2491c1[_0xc412('0x28')]);_0x5296a2['attributes']=_[_0xc412('0x30')](_0x2491c1[_0xc412('0x2f')],qs[_0xc412('0x31')](_0x4620d6[_0xc412('0x28')]['fields']));_0x5296a2[_0xc412('0x32')]=_0x5296a2[_0xc412('0x32')][_0xc412('0x33')]?_0x5296a2[_0xc412('0x32')]:_0x2491c1['model'];if(_0x4620d6[_0xc412('0x28')][_0xc412('0x34')]){_0x5296a2[_0xc412('0x27')]=[{'all':!![]}];}_0x5296a2=_['merge']({},_0x5296a2,_0x4620d6[_0xc412('0x35')]);return db[_0xc412('0x22')][_0xc412('0x36')](_0x5296a2)[_0xc412('0x18')](handleEntityNotFound(_0x45a611,null))[_0xc412('0x18')](respondWithResult(_0x45a611,null))[_0xc412('0x37')](handleError(_0x45a611,null));};exports[_0xc412('0x38')]=function(_0x722dc3,_0x286667){return db['WhatsappQueue'][_0xc412('0x38')](_0x722dc3['body'],{})['then'](function(_0x4de2a9){var _0x101e3f=_0x722dc3[_0xc412('0x39')]['get']({'plain':!![]});if(!_0x101e3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x101e3f[_0xc412('0x3a')]===_0xc412('0x39')){var _0x5b9dfc=_0x4de2a9['get']({'plain':!![]});var _0x3c46ef=_0xc412('0x1a');return db[_0xc412('0x3b')][_0xc412('0x36')]({'where':{'name':_0x3c46ef,'userProfileId':_0x101e3f['userProfileId']},'raw':!![]})[_0xc412('0x18')](function(_0x2cc5eb){if(_0x2cc5eb&&_0x2cc5eb['autoAssociation']===0x0){return db[_0xc412('0x1b')][_0xc412('0x38')]({'name':_0x5b9dfc['name'],'resourceId':_0x5b9dfc['id'],'type':_0x2cc5eb[_0xc412('0x1f')],'sectionId':_0x2cc5eb['id']},{})[_0xc412('0x18')](function(){return _0x4de2a9;});}else{return _0x4de2a9;}})[_0xc412('0x37')](function(_0x2a9680){logger['error'](_0xc412('0x3c'),_0x2a9680);throw _0x2a9680;});}return _0x4de2a9;})[_0xc412('0x18')](respondWithResult(_0x286667,0xc9))[_0xc412('0x37')](handleError(_0x286667,null));};exports[_0xc412('0x17')]=function(_0x2dd1ef,_0x5b45b2){if(_0x2dd1ef['body']['id']){delete _0x2dd1ef[_0xc412('0x3d')]['id'];}return db[_0xc412('0x22')][_0xc412('0x36')]({'where':{'id':_0x2dd1ef[_0xc412('0x2c')]['id']}})[_0xc412('0x18')](handleEntityNotFound(_0x5b45b2,null))['then'](saveUpdates(_0x2dd1ef['body'],null))[_0xc412('0x18')](respondWithResult(_0x5b45b2,null))['catch'](handleError(_0x5b45b2,null));};exports[_0xc412('0x19')]=function(_0x579c46,_0xd970ef){return db[_0xc412('0x22')][_0xc412('0x36')]({'where':{'id':_0x579c46[_0xc412('0x2c')]['id']}})[_0xc412('0x18')](handleEntityNotFound(_0xd970ef,null))[_0xc412('0x18')](removeEntity(_0xd970ef,null))[_0xc412('0x37')](handleError(_0xd970ef,null));};exports[_0xc412('0x3e')]=function(_0x4ebac6,_0x5ec440){return db[_0xc412('0x22')][_0xc412('0x3e')]()[_0xc412('0x18')](respondWithResult(_0x5ec440,null))[_0xc412('0x37')](handleError(_0x5ec440,null));};exports[_0xc412('0x3f')]=function(_0x5ed650,_0x5b26fd){var _0x3cbad4={'raw':!![],'where':{}},_0x15fe43={},_0x436532;return db[_0xc412('0x22')]['findOne']({'where':{'id':_0x5ed650[_0xc412('0x2c')]['id']}})[_0xc412('0x18')](handleEntityNotFound(_0x5b26fd,null))[_0xc412('0x18')](function(_0x2cadcc){if(_0x2cadcc){_0x436532=_0x2cadcc[_0xc412('0x40')]({'plain':!![]});_0x15fe43['model']=_[_0xc412('0x2d')](db['UserWhatsappQueue'][_0xc412('0x41')]);_0x15fe43[_0xc412('0x28')]=_[_0xc412('0x2d')](_0x5ed650[_0xc412('0x28')]);_0x15fe43['filters']=_[_0xc412('0x30')](_0x15fe43[_0xc412('0x2f')],_0x15fe43['query']);_0x3cbad4[_0xc412('0x32')]=_['intersection'](_0x15fe43['model'],qs[_0xc412('0x31')](_0x5ed650[_0xc412('0x28')]['fields']));_0x3cbad4[_0xc412('0x32')]=_0x3cbad4[_0xc412('0x32')][_0xc412('0x33')]?_0x3cbad4[_0xc412('0x32')]:_0x15fe43['model'];if(!_0x5ed650[_0xc412('0x28')]['hasOwnProperty']('nolimit')){_0x3cbad4['limit']=qs[_0xc412('0x12')](_0x5ed650[_0xc412('0x28')]['limit']);_0x3cbad4[_0xc412('0x11')]=qs[_0xc412('0x11')](_0x5ed650[_0xc412('0x28')][_0xc412('0x11')]);}_0x3cbad4['order']=qs[_0xc412('0x42')](_0x5ed650['query']['sort']);_0x3cbad4['where']=qs[_0xc412('0x2e')](_[_0xc412('0x43')](_0x5ed650[_0xc412('0x28')],_0x15fe43[_0xc412('0x2e')]));_0x3cbad4[_0xc412('0x26')][_0xc412('0x44')]=_0x2cadcc['id'];if(_0x5ed650[_0xc412('0x28')][_0xc412('0x45')]){_0x3cbad4['where']=_[_0xc412('0x46')](_0x3cbad4['where'],{'$or':_['map'](_0x3cbad4[_0xc412('0x32')],function(_0x1b469e){var _0x416e0f={};_0x416e0f[_0x1b469e]={'$like':'%'+_0x5ed650[_0xc412('0x28')][_0xc412('0x45')]+'%'};return _0x416e0f;})});}_0x3cbad4=_[_0xc412('0x46')]({},_0x3cbad4,_0x5ed650[_0xc412('0x35')]);return db['UserWhatsappQueue']['findAll'](_0x3cbad4);}})[_0xc412('0x18')](function(_0x25f6a2){if(_0x25f6a2){return db[_0xc412('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x25f6a2,_0xc412('0x48')),'role':'agent'},'attributes':['id','name','whatsappPause',_0xc412('0x49'),_0xc412('0x4a')]});}})[_0xc412('0x18')](function(_0x5cfb84){if(_0x5cfb84){return{'count':_0x5cfb84['count'],'rows':_[_0xc412('0x21')](_0x5cfb84[_0xc412('0x2a')],function(_0xd01553){return{'membername':_0xd01553[_0xc412('0x1f')],'UserId':_0xd01553['id'],'queue_name':_0x436532['name'],'WhatsappQueueId':_0x436532['id'],'interface':util[_0xc412('0x4b')](_0xc412('0x4c'),_0xc412('0x4d'),_0xd01553[_0xc412('0x1f')]),'penalty':0x0,'paused':_0xd01553[_0xc412('0x4e')],'createdAt':_0xd01553[_0xc412('0x4a')],'updatedAt':_0xd01553[_0xc412('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc412('0x18')](respondWithFilteredResult(_0x5b26fd,_0x3cbad4))[_0xc412('0x37')](handleError(_0x5b26fd,null));};exports[_0xc412('0x4f')]=function(_0x4382a2,_0x46a2ff){var _0x24ed7d={};var _0x1e1500={};var _0x37ad8b;var _0x46908b;return db[_0xc412('0x22')][_0xc412('0x50')]({'where':{'id':_0x4382a2[_0xc412('0x2c')]['id']}})['then'](handleEntityNotFound(_0x46a2ff,null))[_0xc412('0x18')](function(_0x4471d7){if(_0x4471d7){_0x37ad8b=_0x4471d7;_0x1e1500[_0xc412('0x2f')]=_[_0xc412('0x2d')](db[_0xc412('0x51')]['rawAttributes']);_0x1e1500['query']=_[_0xc412('0x2d')](_0x4382a2[_0xc412('0x28')]);_0x1e1500[_0xc412('0x2e')]=_['intersection'](_0x1e1500[_0xc412('0x2f')],_0x1e1500['query']);_0x24ed7d['attributes']=_['intersection'](_0x1e1500[_0xc412('0x2f')],qs['fields'](_0x4382a2[_0xc412('0x28')]['fields']));_0x24ed7d[_0xc412('0x32')]=_0x24ed7d['attributes'][_0xc412('0x33')]?_0x24ed7d[_0xc412('0x32')]:_0x1e1500[_0xc412('0x2f')];_0x24ed7d[_0xc412('0x52')]=qs[_0xc412('0x42')](_0x4382a2[_0xc412('0x28')]['sort']);_0x24ed7d[_0xc412('0x26')]=qs[_0xc412('0x2e')](_['pick'](_0x4382a2['query'],_0x1e1500[_0xc412('0x2e')]));if(_0x4382a2[_0xc412('0x28')]['filter']){_0x24ed7d[_0xc412('0x26')]=_[_0xc412('0x46')](_0x24ed7d[_0xc412('0x26')],{'$or':_[_0xc412('0x21')](_0x24ed7d[_0xc412('0x32')],function(_0xd67915){var _0x5475eb={};_0x5475eb[_0xd67915]={'$like':'%'+_0x4382a2[_0xc412('0x28')]['filter']+'%'};return _0x5475eb;})});}_0x24ed7d=_[_0xc412('0x46')]({},_0x24ed7d,_0x4382a2[_0xc412('0x35')]);return _0x37ad8b[_0xc412('0x4f')](_0x24ed7d);}})[_0xc412('0x18')](function(_0x149449){if(_0x149449){_0x46908b=_0x149449[_0xc412('0x33')];if(!_0x4382a2[_0xc412('0x28')][_0xc412('0x53')](_0xc412('0x54'))){_0x24ed7d[_0xc412('0x12')]=qs[_0xc412('0x12')](_0x4382a2[_0xc412('0x28')]['limit']);_0x24ed7d[_0xc412('0x11')]=qs['offset'](_0x4382a2['query'][_0xc412('0x11')]);}return _0x37ad8b[_0xc412('0x4f')](_0x24ed7d);}})['then'](function(_0x1b684e){if(_0x1b684e){return _0x1b684e?{'count':_0x46908b,'rows':_0x1b684e}:null;}})[_0xc412('0x18')](respondWithResult(_0x46a2ff,null))[_0xc412('0x37')](handleError(_0x46a2ff,null));};exports[_0xc412('0x55')]=function(_0x1c6d28,_0x53c1a7){var _0x461890=_0x1c6d28[_0xc412('0x3d')]['ids'];return db[_0xc412('0x51')][_0xc412('0x29')]({'where':{'id':_0x461890},'attributes':['id'],'include':[{'model':db[_0xc412('0x47')],'as':'Agents','attributes':['id',_0xc412('0x1f'),_0xc412('0x56'),_0xc412('0x57'),'interface'],'raw':!![]}]})['then'](function(_0x5a097e){if(_0x5a097e){var _0x256018=_['flatMap'](_0x5a097e,function(_0x1b5101){var _0x588268=_0x1b5101[_0xc412('0x40')]({'plain':!![]});return _0x588268[_0xc412('0x58')];});return db[_0xc412('0x22')][_0xc412('0x36')]({'where':{'id':_0x1c6d28['params']['id']}})['then'](function(_0x41a2a4){return db[_0xc412('0x59')][_0xc412('0x5a')](function(_0x3339b7){return _0x41a2a4['addTeams'](_0x461890,{'transaction':_0x3339b7})[_0xc412('0x18')](function(){return BPromise[_0xc412('0x5b')](_0x256018,function(_0x504459){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x504459['id'],'WhatsappQueueId':_0x1c6d28[_0xc412('0x2c')]['id']},'transaction':_0x3339b7});});})['then'](function(){_0x256018[_0xc412('0x5c')](function(_0x1c8910){socket[_0xc412('0x5d')]('userWhatsappQueue:save',{'UserId':_0x1c8910['id'],'WhatsappQueueId':_0x41a2a4['id']});});});});});}})[_0xc412('0x18')](respondWithStatusCode(_0x53c1a7,null))['catch'](handleError(_0x53c1a7,null));};exports[_0xc412('0x5e')]=function(_0xc589cc,_0x314eb){return db[_0xc412('0x51')][_0xc412('0x29')]({'where':{'id':_0xc589cc['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc412('0x58'),'attributes':['id'],'raw':!![]}]})[_0xc412('0x18')](handleEntityNotFound(_0x314eb,null))[_0xc412('0x18')](function(_0x1b32de){var _0x480ef5=_[_0xc412('0x21')](_0x1b32de,'id');var _0x1ee0cb=[];var _0x22f7e7=[];var _0x2b37ba=squel['select']();_0x2b37ba[_0xc412('0x5f')](_0xc412('0x60'))[_0xc412('0x61')]('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xc412('0x62'),_0xc589cc[_0xc412('0x2c')]['id']);for(var _0x5314dd=0x0;_0x5314dd<_0x1b32de[_0xc412('0x33')];_0x5314dd+=0x1){let _0x566cc4=_0x1b32de[_0x5314dd];for(var _0x24a998=0x0;_0x24a998<_0x566cc4['Agents']['length'];_0x24a998+=0x1){let _0x551156=_0x566cc4['Agents'][_0x24a998];var _0x325964=_0x2b37ba[_0xc412('0x63')]();_0x325964[_0xc412('0x26')]('ut.UserId\x20=\x20?',_0x551156['id']);_0x22f7e7[_0xc412('0x64')](db[_0xc412('0x59')][_0xc412('0x28')](_0x325964[_0xc412('0x65')](),{'type':db[_0xc412('0x59')][_0xc412('0x66')][_0xc412('0x67')]})['then'](function(_0x2a30bf){if(_0x2a30bf[_0xc412('0x33')]===0x1){return _0x551156['id'];}else{var _0x4df686=_[_0xc412('0x68')](_['map'](_0x2a30bf,_0xc412('0x69')),function(_0xa6156){return _[_0xc412('0x6a')](_0x480ef5,_0xa6156);});if(_0x4df686){return _0x551156['id'];}}}));}}return BPromise['all'](_0x22f7e7)[_0xc412('0x18')](function(_0x54eb1b){_0x1ee0cb=_(_0x1ee0cb)[_0xc412('0x6b')](_0x54eb1b)[_0xc412('0x6c')]()[_0xc412('0x6d')]();return db[_0xc412('0x22')][_0xc412('0x36')]({'where':{'id':_0xc589cc[_0xc412('0x2c')]['id']}})['then'](function(_0x25c853){return db['sequelize']['transaction'](function(_0x9a0933){return _0x25c853[_0xc412('0x5e')](_0xc589cc[_0xc412('0x28')][_0xc412('0x6e')],{'transaction':_0x9a0933})[_0xc412('0x18')](function(){if(!_[_0xc412('0x6f')](_0x1ee0cb)){return _0x25c853[_0xc412('0x70')](_0x1ee0cb,{'transaction':_0x9a0933});}})[_0xc412('0x18')](function(){_0x1ee0cb[_0xc412('0x5c')](function(_0x571343){socket['emit'](_0xc412('0x71'),{'UserId':_0x571343,'WhatsappQueueId':_0x25c853['id']});});});});});});})[_0xc412('0x18')](respondWithStatusCode(_0x314eb,null))[_0xc412('0x37')](handleError(_0x314eb,null));};exports[_0xc412('0x72')]=function(_0x5e97ab,_0x1d4e52){return db[_0xc412('0x22')][_0xc412('0x36')]({'where':{'id':_0x5e97ab[_0xc412('0x2c')]['id']}})[_0xc412('0x18')](handleEntityNotFound(_0x1d4e52,null))['then'](function(_0x258fb6){if(_0x258fb6){return _0x258fb6['addAgents'](_0x5e97ab['body'][_0xc412('0x6e')],_[_0xc412('0x73')](_0x5e97ab['body'],[_0xc412('0x6e'),'id'])||{})[_0xc412('0x74')](function(_0x3ea49e){for(var _0x53d275=0x0;_0x53d275<_0x5e97ab['body']['ids'][_0xc412('0x33')];_0x53d275+=0x1){socket[_0xc412('0x5d')]('userWhatsappQueue:save',{'UserId':Number(_0x5e97ab[_0xc412('0x3d')][_0xc412('0x6e')][_0x53d275]),'WhatsappQueueId':Number(_0x5e97ab[_0xc412('0x2c')]['id'])});}return _0x3ea49e;});}})[_0xc412('0x18')](respondWithResult(_0x1d4e52,null))['catch'](handleError(_0x1d4e52,null));};exports[_0xc412('0x70')]=function(_0x2cb9af,_0xde60fe){return db['WhatsappQueue'][_0xc412('0x36')]({'where':{'id':_0x2cb9af[_0xc412('0x2c')]['id']}})[_0xc412('0x18')](handleEntityNotFound(_0xde60fe,null))[_0xc412('0x18')](function(_0x3252bc){if(_0x3252bc){return _0x3252bc[_0xc412('0x70')](_0x2cb9af[_0xc412('0x28')][_0xc412('0x6e')])['then'](function(){if(_[_0xc412('0x75')](_0x2cb9af[_0xc412('0x28')]['ids'])){for(var _0x347bb6=0x0;_0x347bb6<_0x2cb9af[_0xc412('0x28')]['ids'][_0xc412('0x33')];_0x347bb6+=0x1){socket[_0xc412('0x5d')](_0xc412('0x71'),{'UserId':Number(_0x2cb9af[_0xc412('0x28')][_0xc412('0x6e')][_0x347bb6]),'WhatsappQueueId':Number(_0x2cb9af[_0xc412('0x2c')]['id'])});}}else{socket[_0xc412('0x5d')]('userWhatsappQueue:remove',{'UserId':Number(_0x2cb9af[_0xc412('0x28')][_0xc412('0x6e')]),'WhatsappQueueId':Number(_0x2cb9af[_0xc412('0x2c')]['id'])});}});}})['then'](respondWithStatusCode(_0xde60fe,null))[_0xc412('0x37')](handleError(_0xde60fe,null));};exports[_0xc412('0x76')]=function(_0x132c53,_0x3814bc){var _0x4411ae={};var _0x3cb64b={};var _0x213d44;var _0x55b111;return db[_0xc412('0x22')][_0xc412('0x50')]({'where':{'id':_0x132c53[_0xc412('0x2c')]['id']}})[_0xc412('0x18')](handleEntityNotFound(_0x3814bc,null))[_0xc412('0x18')](function(_0x7b06f1){if(_0x7b06f1){_0x213d44=_0x7b06f1;_0x3cb64b['model']=_[_0xc412('0x2d')](db[_0xc412('0x47')]['rawAttributes']);_0x3cb64b[_0xc412('0x28')]=_['keys'](_0x132c53['query']);_0x3cb64b[_0xc412('0x2e')]=_[_0xc412('0x30')](_0x3cb64b[_0xc412('0x2f')],_0x3cb64b[_0xc412('0x28')]);_0x4411ae[_0xc412('0x32')]=_[_0xc412('0x30')](_0x3cb64b[_0xc412('0x2f')],qs[_0xc412('0x31')](_0x132c53[_0xc412('0x28')][_0xc412('0x31')]));_0x4411ae[_0xc412('0x32')]=_0x4411ae['attributes']['length']?_0x4411ae[_0xc412('0x32')]:_0x3cb64b[_0xc412('0x2f')];_0x4411ae[_0xc412('0x52')]=qs[_0xc412('0x42')](_0x132c53[_0xc412('0x28')]['sort']);_0x4411ae[_0xc412('0x26')]=qs[_0xc412('0x2e')](_[_0xc412('0x43')](_0x132c53[_0xc412('0x28')],_0x3cb64b[_0xc412('0x2e')]));if(_0x132c53[_0xc412('0x28')][_0xc412('0x45')]){_0x4411ae['where']=_[_0xc412('0x46')](_0x4411ae['where'],{'$or':_['map'](_0x4411ae[_0xc412('0x32')],function(_0x5e81e4){var _0x19bfab={};_0x19bfab[_0x5e81e4]={'$like':'%'+_0x132c53[_0xc412('0x28')][_0xc412('0x45')]+'%'};return _0x19bfab;})});}_0x4411ae=_[_0xc412('0x46')]({},_0x4411ae,_0x132c53[_0xc412('0x35')]);return _0x213d44['getAgents'](_0x4411ae);}})['then'](function(_0x14d38d){if(_0x14d38d){_0x55b111=_0x14d38d[_0xc412('0x33')];if(!_0x132c53[_0xc412('0x28')][_0xc412('0x53')](_0xc412('0x54'))){_0x4411ae[_0xc412('0x12')]=qs[_0xc412('0x12')](_0x132c53[_0xc412('0x28')][_0xc412('0x12')]);_0x4411ae[_0xc412('0x11')]=qs['offset'](_0x132c53[_0xc412('0x28')][_0xc412('0x11')]);}return _0x213d44[_0xc412('0x76')](_0x4411ae);}})[_0xc412('0x18')](function(_0x2c822f){if(_0x2c822f){return _0x2c822f?{'count':_0x55b111,'rows':_0x2c822f}:null;}})[_0xc412('0x18')](respondWithResult(_0x3814bc,null))[_0xc412('0x37')](handleError(_0x3814bc,null));}; \ No newline at end of file +var _0xeec8=['keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','order','sort','WhatsappQueueId','filter','merge','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','pick','nolimit','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','compact','value','transaction','removeTeams','removeAgents','userWhatsappQueue:remove','addAgents','spread','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','where','include','query','show','params','model'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xeec8,0x1bf));var _0x8eec=function(_0xa4f1de,_0x56358b){_0xa4f1de=_0xa4f1de-0x0;var _0x25a1d8=_0xeec8[_0xa4f1de];return _0x25a1d8;};'use strict';var BPromise=require(_0x8eec('0x0'));var util=require(_0x8eec('0x1'));var _=require(_0x8eec('0x2'));var squel=require(_0x8eec('0x3'));var Redis=require(_0x8eec('0x4'));var qs=require(_0x8eec('0x5'));var logger=require('../../config/logger')(_0x8eec('0x6'));var config=require(_0x8eec('0x7'));var db=require(_0x8eec('0x8'))['db'];config[_0x8eec('0x9')]=_[_0x8eec('0xa')](config[_0x8eec('0x9')],{'host':_0x8eec('0xb'),'port':0x18eb});var socket=require(_0x8eec('0xc'))(new Redis(config['redis']));require(_0x8eec('0xd'))[_0x8eec('0xe')](socket);function respondWithStatusCode(_0x230e01,_0x373476){_0x373476=_0x373476||0xcc;return function(_0x15f9b3){if(_0x15f9b3){return _0x230e01[_0x8eec('0xf')](_0x373476);}return _0x230e01['status'](_0x373476)[_0x8eec('0x10')]();};}function respondWithResult(_0x371ade,_0x2b6536){_0x2b6536=_0x2b6536||0xc8;return function(_0x2622bc){if(_0x2622bc){return _0x371ade[_0x8eec('0x11')](_0x2b6536)[_0x8eec('0x12')](_0x2622bc);}};}function respondWithFilteredResult(_0x10821d,_0x1c2554){return function(_0x4e7be4){if(_0x4e7be4){var _0x58a12b=typeof _0x1c2554[_0x8eec('0x13')]===_0x8eec('0x14')&&typeof _0x1c2554[_0x8eec('0x15')]===_0x8eec('0x14');var _0x42f7ca=_0x4e7be4[_0x8eec('0x16')];var _0x54a320=_0x58a12b?0x0:_0x1c2554[_0x8eec('0x13')];var _0x3ed397=_0x58a12b?_0x4e7be4[_0x8eec('0x16')]:_0x1c2554['offset']+_0x1c2554['limit'];var _0x3f94cf;if(_0x3ed397>=_0x42f7ca){_0x3ed397=_0x42f7ca;_0x3f94cf=0xc8;}else{_0x3f94cf=0xce;}_0x10821d[_0x8eec('0x11')](_0x3f94cf);return _0x10821d[_0x8eec('0x17')](_0x8eec('0x18'),_0x54a320+'-'+_0x3ed397+'/'+_0x42f7ca)[_0x8eec('0x12')](_0x4e7be4);}return null;};}function saveUpdates(_0x21b4fe){return function(_0x459704){if(_0x459704){return _0x459704[_0x8eec('0x19')](_0x21b4fe)[_0x8eec('0x1a')](function(_0x142d45){return _0x142d45;});}return null;};}function removeEntity(_0x2ffc2c){return function(_0x5ec3f8){if(_0x5ec3f8){return _0x5ec3f8[_0x8eec('0x1b')]()[_0x8eec('0x1a')](function(){var _0x2ea856=_0x5ec3f8[_0x8eec('0x1c')]({'plain':!![]});var _0x54868d='WhatsappQueues';return db[_0x8eec('0x1d')]['destroy']({'where':{'type':_0x54868d,'resourceId':_0x2ea856['id']}})[_0x8eec('0x1a')](function(){return _0x5ec3f8;});})[_0x8eec('0x1a')](function(){_0x2ffc2c[_0x8eec('0x11')](0xcc)[_0x8eec('0x10')]();});}};}function handleEntityNotFound(_0x173205){return function(_0x3038dc){if(!_0x3038dc){_0x173205[_0x8eec('0xf')](0x194);}return _0x3038dc;};}function handleError(_0x1fe4d6,_0x499bd7){_0x499bd7=_0x499bd7||0x1f4;return function(_0xf58c00){logger['error'](_0xf58c00[_0x8eec('0x1e')]);if(_0xf58c00[_0x8eec('0x1f')]){delete _0xf58c00[_0x8eec('0x1f')];}_0x1fe4d6[_0x8eec('0x11')](_0x499bd7)[_0x8eec('0x20')](_0xf58c00);};}exports[_0x8eec('0x21')]=function(_0x56ba76,_0x5cb665){var _0x26f73d={};var _0x3bc11a={'count':0x0,'rows':[]};var _0x7c597d=_[_0x8eec('0x22')](db[_0x8eec('0x23')]['rawAttributes'],function(_0x48060c){return{'name':_0x48060c[_0x8eec('0x24')],'type':_0x48060c[_0x8eec('0x25')][_0x8eec('0x26')]};});_0x26f73d=qs['getOptions'](_0x7c597d,_0x56ba76);var _0x2003d5={'where':_0x26f73d[_0x8eec('0x27')]};return db[_0x8eec('0x23')][_0x8eec('0x16')](_0x2003d5)[_0x8eec('0x1a')](function(_0x32d4f3){_0x3bc11a[_0x8eec('0x16')]=_0x32d4f3;_0x26f73d['include']=qs[_0x8eec('0x28')](_0x56ba76[_0x8eec('0x29')]);return db[_0x8eec('0x23')]['findAll'](_0x26f73d);})[_0x8eec('0x1a')](function(_0x393c23){_0x3bc11a['rows']=_0x393c23;return _0x3bc11a;})[_0x8eec('0x1a')](respondWithFilteredResult(_0x5cb665,_0x26f73d))['catch'](handleError(_0x5cb665,null));};exports[_0x8eec('0x2a')]=function(_0x110615,_0x34431a){var _0x2180d2={'raw':!![],'where':{'id':_0x110615[_0x8eec('0x2b')]['id']}},_0x34cfd3={};_0x34cfd3[_0x8eec('0x2c')]=_[_0x8eec('0x2d')](db['WhatsappQueue'][_0x8eec('0x2e')]);_0x34cfd3['query']=_[_0x8eec('0x2d')](_0x110615['query']);_0x34cfd3[_0x8eec('0x2f')]=_[_0x8eec('0x30')](_0x34cfd3['model'],_0x34cfd3[_0x8eec('0x29')]);_0x2180d2[_0x8eec('0x31')]=_[_0x8eec('0x30')](_0x34cfd3[_0x8eec('0x2c')],qs[_0x8eec('0x32')](_0x110615['query'][_0x8eec('0x32')]));_0x2180d2[_0x8eec('0x31')]=_0x2180d2['attributes'][_0x8eec('0x33')]?_0x2180d2[_0x8eec('0x31')]:_0x34cfd3[_0x8eec('0x2c')];if(_0x110615[_0x8eec('0x29')][_0x8eec('0x34')]){_0x2180d2[_0x8eec('0x28')]=[{'all':!![]}];}_0x2180d2=_['merge']({},_0x2180d2,_0x110615[_0x8eec('0x35')]);return db['WhatsappQueue'][_0x8eec('0x36')](_0x2180d2)[_0x8eec('0x1a')](handleEntityNotFound(_0x34431a,null))[_0x8eec('0x1a')](respondWithResult(_0x34431a,null))['catch'](handleError(_0x34431a,null));};exports['create']=function(_0x18208,_0x244747){return db[_0x8eec('0x23')][_0x8eec('0x37')](_0x18208[_0x8eec('0x38')],{})['then'](function(_0x492b2d){var _0x18a55b=_0x18208[_0x8eec('0x39')]['get']({'plain':!![]});if(!_0x18a55b)throw new Error(_0x8eec('0x3a'));if(_0x18a55b[_0x8eec('0x3b')]==='user'){var _0x535a2f=_0x492b2d[_0x8eec('0x1c')]({'plain':!![]});var _0x353dc1='WhatsappQueues';return db[_0x8eec('0x3c')]['find']({'where':{'name':_0x353dc1,'userProfileId':_0x18a55b[_0x8eec('0x3d')]},'raw':!![]})[_0x8eec('0x1a')](function(_0x354614){if(_0x354614&&_0x354614[_0x8eec('0x3e')]===0x0){return db[_0x8eec('0x1d')]['create']({'name':_0x535a2f[_0x8eec('0x1f')],'resourceId':_0x535a2f['id'],'type':_0x354614['name'],'sectionId':_0x354614['id']},{})['then'](function(){return _0x492b2d;});}else{return _0x492b2d;}})[_0x8eec('0x3f')](function(_0x5c347a){logger['error'](_0x8eec('0x40'),_0x5c347a);throw _0x5c347a;});}return _0x492b2d;})[_0x8eec('0x1a')](respondWithResult(_0x244747,0xc9))[_0x8eec('0x3f')](handleError(_0x244747,null));};exports[_0x8eec('0x19')]=function(_0x20505c,_0x5341f4){if(_0x20505c[_0x8eec('0x38')]['id']){delete _0x20505c['body']['id'];}return db[_0x8eec('0x23')][_0x8eec('0x36')]({'where':{'id':_0x20505c[_0x8eec('0x2b')]['id']}})[_0x8eec('0x1a')](handleEntityNotFound(_0x5341f4,null))[_0x8eec('0x1a')](saveUpdates(_0x20505c[_0x8eec('0x38')],null))[_0x8eec('0x1a')](respondWithResult(_0x5341f4,null))['catch'](handleError(_0x5341f4,null));};exports[_0x8eec('0x1b')]=function(_0x503ba8,_0x17e2c0){return db[_0x8eec('0x23')][_0x8eec('0x36')]({'where':{'id':_0x503ba8[_0x8eec('0x2b')]['id']}})[_0x8eec('0x1a')](handleEntityNotFound(_0x17e2c0,null))[_0x8eec('0x1a')](removeEntity(_0x17e2c0,null))[_0x8eec('0x3f')](handleError(_0x17e2c0,null));};exports['describe']=function(_0x4733f4,_0xb037a1){return db[_0x8eec('0x23')][_0x8eec('0x41')]()[_0x8eec('0x1a')](respondWithResult(_0xb037a1,null))['catch'](handleError(_0xb037a1,null));};exports[_0x8eec('0x42')]=function(_0x6bc1ca,_0x1539c5){var _0x3e36d0={'raw':!![],'where':{}},_0xc3778f={},_0x4ed733;return db[_0x8eec('0x23')][_0x8eec('0x43')]({'where':{'id':_0x6bc1ca['params']['id']}})[_0x8eec('0x1a')](handleEntityNotFound(_0x1539c5,null))[_0x8eec('0x1a')](function(_0x3402c3){if(_0x3402c3){_0x4ed733=_0x3402c3[_0x8eec('0x1c')]({'plain':!![]});_0xc3778f[_0x8eec('0x2c')]=_['keys'](db[_0x8eec('0x44')]['rawAttributes']);_0xc3778f['query']=_[_0x8eec('0x2d')](_0x6bc1ca[_0x8eec('0x29')]);_0xc3778f[_0x8eec('0x2f')]=_[_0x8eec('0x30')](_0xc3778f['model'],_0xc3778f['query']);_0x3e36d0['attributes']=_['intersection'](_0xc3778f[_0x8eec('0x2c')],qs[_0x8eec('0x32')](_0x6bc1ca[_0x8eec('0x29')][_0x8eec('0x32')]));_0x3e36d0[_0x8eec('0x31')]=_0x3e36d0[_0x8eec('0x31')][_0x8eec('0x33')]?_0x3e36d0[_0x8eec('0x31')]:_0xc3778f[_0x8eec('0x2c')];if(!_0x6bc1ca['query'][_0x8eec('0x45')]('nolimit')){_0x3e36d0[_0x8eec('0x15')]=qs[_0x8eec('0x15')](_0x6bc1ca['query'][_0x8eec('0x15')]);_0x3e36d0[_0x8eec('0x13')]=qs[_0x8eec('0x13')](_0x6bc1ca[_0x8eec('0x29')][_0x8eec('0x13')]);}_0x3e36d0[_0x8eec('0x46')]=qs[_0x8eec('0x47')](_0x6bc1ca['query'][_0x8eec('0x47')]);_0x3e36d0[_0x8eec('0x27')]=qs[_0x8eec('0x2f')](_['pick'](_0x6bc1ca['query'],_0xc3778f[_0x8eec('0x2f')]));_0x3e36d0[_0x8eec('0x27')][_0x8eec('0x48')]=_0x3402c3['id'];if(_0x6bc1ca[_0x8eec('0x29')][_0x8eec('0x49')]){_0x3e36d0[_0x8eec('0x27')]=_[_0x8eec('0x4a')](_0x3e36d0[_0x8eec('0x27')],{'$or':_['map'](_0x3e36d0[_0x8eec('0x31')],function(_0x24d4b2){var _0x3ee91e={};_0x3ee91e[_0x24d4b2]={'$like':'%'+_0x6bc1ca[_0x8eec('0x29')][_0x8eec('0x49')]+'%'};return _0x3ee91e;})});}_0x3e36d0=_['merge']({},_0x3e36d0,_0x6bc1ca['options']);return db['UserWhatsappQueue'][_0x8eec('0x4b')](_0x3e36d0);}})[_0x8eec('0x1a')](function(_0xc9b688){if(_0xc9b688){return db['User'][_0x8eec('0x4c')]({'where':{'id':_[_0x8eec('0x22')](_0xc9b688,_0x8eec('0x4d')),'role':_0x8eec('0x4e')},'attributes':['id',_0x8eec('0x1f'),'whatsappPause',_0x8eec('0x4f'),_0x8eec('0x50')]});}})['then'](function(_0x2b0630){if(_0x2b0630){return{'count':_0x2b0630[_0x8eec('0x16')],'rows':_['map'](_0x2b0630[_0x8eec('0x51')],function(_0x2bb633){return{'membername':_0x2bb633[_0x8eec('0x1f')],'UserId':_0x2bb633['id'],'queue_name':_0x4ed733[_0x8eec('0x1f')],'WhatsappQueueId':_0x4ed733['id'],'interface':util[_0x8eec('0x52')](_0x8eec('0x53'),_0x8eec('0x54'),_0x2bb633[_0x8eec('0x1f')]),'penalty':0x0,'paused':_0x2bb633['whatsappPause'],'createdAt':_0x2bb633['createdAt'],'updatedAt':_0x2bb633[_0x8eec('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8eec('0x1a')](respondWithFilteredResult(_0x1539c5,_0x3e36d0))[_0x8eec('0x3f')](handleError(_0x1539c5,null));};exports[_0x8eec('0x55')]=function(_0x3ed024,_0x5649c7){var _0x1c183f={};var _0x2962e4={};var _0x1b634d;var _0x218b27;return db[_0x8eec('0x23')][_0x8eec('0x43')]({'where':{'id':_0x3ed024[_0x8eec('0x2b')]['id']}})[_0x8eec('0x1a')](handleEntityNotFound(_0x5649c7,null))['then'](function(_0x2662fa){if(_0x2662fa){_0x1b634d=_0x2662fa;_0x2962e4[_0x8eec('0x2c')]=_['keys'](db[_0x8eec('0x56')][_0x8eec('0x2e')]);_0x2962e4[_0x8eec('0x29')]=_[_0x8eec('0x2d')](_0x3ed024[_0x8eec('0x29')]);_0x2962e4['filters']=_[_0x8eec('0x30')](_0x2962e4[_0x8eec('0x2c')],_0x2962e4[_0x8eec('0x29')]);_0x1c183f['attributes']=_[_0x8eec('0x30')](_0x2962e4[_0x8eec('0x2c')],qs['fields'](_0x3ed024[_0x8eec('0x29')][_0x8eec('0x32')]));_0x1c183f[_0x8eec('0x31')]=_0x1c183f[_0x8eec('0x31')][_0x8eec('0x33')]?_0x1c183f['attributes']:_0x2962e4['model'];_0x1c183f['order']=qs['sort'](_0x3ed024[_0x8eec('0x29')][_0x8eec('0x47')]);_0x1c183f[_0x8eec('0x27')]=qs[_0x8eec('0x2f')](_[_0x8eec('0x57')](_0x3ed024[_0x8eec('0x29')],_0x2962e4[_0x8eec('0x2f')]));if(_0x3ed024[_0x8eec('0x29')][_0x8eec('0x49')]){_0x1c183f[_0x8eec('0x27')]=_[_0x8eec('0x4a')](_0x1c183f[_0x8eec('0x27')],{'$or':_[_0x8eec('0x22')](_0x1c183f[_0x8eec('0x31')],function(_0x507c47){var _0x3915bd={};_0x3915bd[_0x507c47]={'$like':'%'+_0x3ed024[_0x8eec('0x29')]['filter']+'%'};return _0x3915bd;})});}_0x1c183f=_[_0x8eec('0x4a')]({},_0x1c183f,_0x3ed024[_0x8eec('0x35')]);return _0x1b634d[_0x8eec('0x55')](_0x1c183f);}})[_0x8eec('0x1a')](function(_0x3bb14f){if(_0x3bb14f){_0x218b27=_0x3bb14f['length'];if(!_0x3ed024[_0x8eec('0x29')]['hasOwnProperty'](_0x8eec('0x58'))){_0x1c183f['limit']=qs[_0x8eec('0x15')](_0x3ed024[_0x8eec('0x29')][_0x8eec('0x15')]);_0x1c183f[_0x8eec('0x13')]=qs[_0x8eec('0x13')](_0x3ed024[_0x8eec('0x29')][_0x8eec('0x13')]);}return _0x1b634d[_0x8eec('0x55')](_0x1c183f);}})[_0x8eec('0x1a')](function(_0x5efbaa){if(_0x5efbaa){return _0x5efbaa?{'count':_0x218b27,'rows':_0x5efbaa}:null;}})['then'](respondWithResult(_0x5649c7,null))['catch'](handleError(_0x5649c7,null));};exports[_0x8eec('0x59')]=function(_0x56bcc1,_0x56b141){var _0x22af20=_0x56bcc1[_0x8eec('0x38')][_0x8eec('0x5a')];return db[_0x8eec('0x56')][_0x8eec('0x4b')]({'where':{'id':_0x22af20},'attributes':['id'],'include':[{'model':db[_0x8eec('0x5b')],'as':_0x8eec('0x5c'),'attributes':['id','name','online',_0x8eec('0x5d'),_0x8eec('0x5e')],'raw':!![]}]})[_0x8eec('0x1a')](function(_0x519a41){if(_0x519a41){var _0x5c5299=_[_0x8eec('0x5f')](_0x519a41,function(_0xb6a8a3){var _0xb50e58=_0xb6a8a3[_0x8eec('0x1c')]({'plain':!![]});return _0xb50e58[_0x8eec('0x5c')];});return db[_0x8eec('0x23')][_0x8eec('0x36')]({'where':{'id':_0x56bcc1[_0x8eec('0x2b')]['id']}})[_0x8eec('0x1a')](function(_0x3d03ca){return db[_0x8eec('0x60')]['transaction'](function(_0x24ba97){return _0x3d03ca['addTeams'](_0x22af20,{'transaction':_0x24ba97})[_0x8eec('0x1a')](function(){return BPromise['each'](_0x5c5299,function(_0xa6cf2f){return db[_0x8eec('0x44')]['findOrCreate']({'where':{'UserId':_0xa6cf2f['id'],'WhatsappQueueId':_0x56bcc1[_0x8eec('0x2b')]['id']},'transaction':_0x24ba97});});})[_0x8eec('0x1a')](function(){_0x5c5299[_0x8eec('0x61')](function(_0x3e59ef){socket[_0x8eec('0x62')](_0x8eec('0x63'),{'UserId':_0x3e59ef['id'],'WhatsappQueueId':_0x3d03ca['id']});});});});});}})[_0x8eec('0x1a')](respondWithStatusCode(_0x56b141,null))[_0x8eec('0x3f')](handleError(_0x56b141,null));};exports['removeTeams']=function(_0x12b1c4,_0x50be25){return db['Team'][_0x8eec('0x4b')]({'where':{'id':_0x12b1c4[_0x8eec('0x29')][_0x8eec('0x5a')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8eec('0x1a')](handleEntityNotFound(_0x50be25,null))[_0x8eec('0x1a')](function(_0x1fb49c){var _0x517597=_[_0x8eec('0x22')](_0x1fb49c,'id');var _0x683e87=[];var _0x30ce70=[];var _0x58812b=squel[_0x8eec('0x64')]();_0x58812b[_0x8eec('0x65')](_0x8eec('0x66'))['from'](_0x8eec('0x67'),'tq')[_0x8eec('0x68')](_0x8eec('0x69'),'ut',_0x8eec('0x6a'))[_0x8eec('0x27')](_0x8eec('0x6b'),_0x12b1c4[_0x8eec('0x2b')]['id']);for(var _0x4a4161=0x0;_0x4a4161<_0x1fb49c[_0x8eec('0x33')];_0x4a4161+=0x1){let _0x323995=_0x1fb49c[_0x4a4161];for(var _0x208aaa=0x0;_0x208aaa<_0x323995[_0x8eec('0x5c')][_0x8eec('0x33')];_0x208aaa+=0x1){let _0x147c1e=_0x323995['Agents'][_0x208aaa];var _0x6b6fd3=_0x58812b[_0x8eec('0x6c')]();_0x6b6fd3['where']('ut.UserId\x20=\x20?',_0x147c1e['id']);_0x30ce70['push'](db[_0x8eec('0x60')][_0x8eec('0x29')](_0x6b6fd3[_0x8eec('0x6d')](),{'type':db['sequelize'][_0x8eec('0x6e')][_0x8eec('0x6f')]})[_0x8eec('0x1a')](function(_0x386dc6){if(_0x386dc6[_0x8eec('0x33')]===0x1){return _0x147c1e['id'];}else{var _0x5709bb=_['every'](_[_0x8eec('0x22')](_0x386dc6,_0x8eec('0x70')),function(_0x4713e0){return _[_0x8eec('0x71')](_0x517597,_0x4713e0);});if(_0x5709bb){return _0x147c1e['id'];}}}));}}return BPromise['all'](_0x30ce70)[_0x8eec('0x1a')](function(_0x5f3df6){_0x683e87=_(_0x683e87)['union'](_0x5f3df6)[_0x8eec('0x72')]()[_0x8eec('0x73')]();return db[_0x8eec('0x23')][_0x8eec('0x36')]({'where':{'id':_0x12b1c4['params']['id']}})[_0x8eec('0x1a')](function(_0x22c83d){return db[_0x8eec('0x60')][_0x8eec('0x74')](function(_0x10bec0){return _0x22c83d[_0x8eec('0x75')](_0x12b1c4[_0x8eec('0x29')]['ids'],{'transaction':_0x10bec0})[_0x8eec('0x1a')](function(){if(!_['isEmpty'](_0x683e87)){return _0x22c83d[_0x8eec('0x76')](_0x683e87,{'transaction':_0x10bec0});}})[_0x8eec('0x1a')](function(){_0x683e87[_0x8eec('0x61')](function(_0x4b3318){socket[_0x8eec('0x62')](_0x8eec('0x77'),{'UserId':_0x4b3318,'WhatsappQueueId':_0x22c83d['id']});});});});});});})[_0x8eec('0x1a')](respondWithStatusCode(_0x50be25,null))[_0x8eec('0x3f')](handleError(_0x50be25,null));};exports['addAgents']=function(_0x403077,_0x16a213){return db[_0x8eec('0x23')][_0x8eec('0x36')]({'where':{'id':_0x403077['params']['id']}})[_0x8eec('0x1a')](handleEntityNotFound(_0x16a213,null))[_0x8eec('0x1a')](function(_0x3d3863){if(_0x3d3863){return _0x3d3863[_0x8eec('0x78')](_0x403077[_0x8eec('0x38')][_0x8eec('0x5a')],_['omit'](_0x403077[_0x8eec('0x38')],[_0x8eec('0x5a'),'id'])||{})[_0x8eec('0x79')](function(_0x4a2aa4){for(var _0x154534=0x0;_0x154534<_0x403077[_0x8eec('0x38')]['ids'][_0x8eec('0x33')];_0x154534+=0x1){socket[_0x8eec('0x62')]('userWhatsappQueue:save',{'UserId':Number(_0x403077[_0x8eec('0x38')]['ids'][_0x154534]),'WhatsappQueueId':Number(_0x403077[_0x8eec('0x2b')]['id'])});}return _0x4a2aa4;});}})['then'](respondWithResult(_0x16a213,null))[_0x8eec('0x3f')](handleError(_0x16a213,null));};exports[_0x8eec('0x76')]=function(_0x132312,_0x4eec86){return db[_0x8eec('0x23')][_0x8eec('0x36')]({'where':{'id':_0x132312[_0x8eec('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4eec86,null))[_0x8eec('0x1a')](function(_0x41055b){if(_0x41055b){return _0x41055b[_0x8eec('0x76')](_0x132312[_0x8eec('0x29')]['ids'])[_0x8eec('0x1a')](function(){if(_['isArray'](_0x132312[_0x8eec('0x29')]['ids'])){for(var _0xb2ce37=0x0;_0xb2ce37<_0x132312[_0x8eec('0x29')]['ids'][_0x8eec('0x33')];_0xb2ce37+=0x1){socket[_0x8eec('0x62')](_0x8eec('0x77'),{'UserId':Number(_0x132312[_0x8eec('0x29')][_0x8eec('0x5a')][_0xb2ce37]),'WhatsappQueueId':Number(_0x132312[_0x8eec('0x2b')]['id'])});}}else{socket[_0x8eec('0x62')]('userWhatsappQueue:remove',{'UserId':Number(_0x132312[_0x8eec('0x29')][_0x8eec('0x5a')]),'WhatsappQueueId':Number(_0x132312[_0x8eec('0x2b')]['id'])});}});}})[_0x8eec('0x1a')](respondWithStatusCode(_0x4eec86,null))['catch'](handleError(_0x4eec86,null));};exports[_0x8eec('0x7a')]=function(_0x3c0218,_0x2cfe45){var _0x3dee4a={};var _0x16506e={};var _0x867a9f;var _0x16c4d8;return db[_0x8eec('0x23')][_0x8eec('0x43')]({'where':{'id':_0x3c0218['params']['id']}})[_0x8eec('0x1a')](handleEntityNotFound(_0x2cfe45,null))['then'](function(_0xda475f){if(_0xda475f){_0x867a9f=_0xda475f;_0x16506e[_0x8eec('0x2c')]=_[_0x8eec('0x2d')](db['User'][_0x8eec('0x2e')]);_0x16506e[_0x8eec('0x29')]=_['keys'](_0x3c0218['query']);_0x16506e[_0x8eec('0x2f')]=_[_0x8eec('0x30')](_0x16506e[_0x8eec('0x2c')],_0x16506e[_0x8eec('0x29')]);_0x3dee4a[_0x8eec('0x31')]=_[_0x8eec('0x30')](_0x16506e[_0x8eec('0x2c')],qs[_0x8eec('0x32')](_0x3c0218[_0x8eec('0x29')][_0x8eec('0x32')]));_0x3dee4a[_0x8eec('0x31')]=_0x3dee4a[_0x8eec('0x31')][_0x8eec('0x33')]?_0x3dee4a[_0x8eec('0x31')]:_0x16506e[_0x8eec('0x2c')];_0x3dee4a[_0x8eec('0x46')]=qs[_0x8eec('0x47')](_0x3c0218[_0x8eec('0x29')][_0x8eec('0x47')]);_0x3dee4a[_0x8eec('0x27')]=qs[_0x8eec('0x2f')](_[_0x8eec('0x57')](_0x3c0218[_0x8eec('0x29')],_0x16506e[_0x8eec('0x2f')]));if(_0x3c0218['query'][_0x8eec('0x49')]){_0x3dee4a[_0x8eec('0x27')]=_['merge'](_0x3dee4a[_0x8eec('0x27')],{'$or':_[_0x8eec('0x22')](_0x3dee4a[_0x8eec('0x31')],function(_0x2b9688){var _0x4d6674={};_0x4d6674[_0x2b9688]={'$like':'%'+_0x3c0218[_0x8eec('0x29')][_0x8eec('0x49')]+'%'};return _0x4d6674;})});}_0x3dee4a=_['merge']({},_0x3dee4a,_0x3c0218[_0x8eec('0x35')]);return _0x867a9f[_0x8eec('0x7a')](_0x3dee4a);}})['then'](function(_0x36ee7a){if(_0x36ee7a){_0x16c4d8=_0x36ee7a['length'];if(!_0x3c0218[_0x8eec('0x29')][_0x8eec('0x45')](_0x8eec('0x58'))){_0x3dee4a[_0x8eec('0x15')]=qs['limit'](_0x3c0218['query'][_0x8eec('0x15')]);_0x3dee4a['offset']=qs[_0x8eec('0x13')](_0x3c0218[_0x8eec('0x29')]['offset']);}return _0x867a9f[_0x8eec('0x7a')](_0x3dee4a);}})[_0x8eec('0x1a')](function(_0x3d76e1){if(_0x3d76e1){return _0x3d76e1?{'count':_0x16c4d8,'rows':_0x3d76e1}:null;}})['then'](respondWithResult(_0x2cfe45,null))[_0x8eec('0x3f')](handleError(_0x2cfe45,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 1d5dd2a..a12a347 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 _0x1635=['remove','emit','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','update'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0x1635,0x133));var _0x5163=function(_0x4af280,_0x5be9bc){_0x4af280=_0x4af280-0x0;var _0x98c920=_0x1635[_0x4af280];return _0x98c920;};'use strict';var EventEmitter=require(_0x5163('0x0'));var WhatsappQueue=require(_0x5163('0x1'))['db'][_0x5163('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5163('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5163('0x4'),'afterDestroy':_0x5163('0x5')};function emitEvent(_0x28f3b9){return function(_0x1fe9d0,_0x3cf477,_0x19c081){WhatsappQueueEvents[_0x5163('0x6')](_0x28f3b9+':'+_0x1fe9d0['id'],_0x1fe9d0);WhatsappQueueEvents[_0x5163('0x6')](_0x28f3b9,_0x1fe9d0);_0x19c081(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x5163('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x2306=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x3370e3,_0x252902){var _0x5598db=function(_0x5a40fa){while(--_0x5a40fa){_0x3370e3['push'](_0x3370e3['shift']());}};_0x5598db(++_0x252902);}(_0x2306,0x105));var _0x6230=function(_0x1633e5,_0x2f8001){_0x1633e5=_0x1633e5-0x0;var _0x5367aa=_0x2306[_0x1633e5];return _0x5367aa;};'use strict';var EventEmitter=require(_0x6230('0x0'));var WhatsappQueue=require(_0x6230('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6230('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6230('0x3'),'afterDestroy':_0x6230('0x4')};function emitEvent(_0x53c73c){return function(_0x175076,_0x95f38c,_0x41e163){WhatsappQueueEvents['emit'](_0x53c73c+':'+_0x175076['id'],_0x175076);WhatsappQueueEvents[_0x6230('0x5')](_0x53c73c,_0x175076);_0x41e163(null);};}for(var e in events){if(events[_0x6230('0x6')](e)){var event=events[e];WhatsappQueue[_0x6230('0x7')](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 1061588..1b53837 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 _0x4088=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','moment','bluebird','request-promise'];(function(_0x128495,_0x25a304){var _0xcb1a0e=function(_0x451f3f){while(--_0x451f3f){_0x128495['push'](_0x128495['shift']());}};_0xcb1a0e(++_0x25a304);}(_0x4088,0x163));var _0x8408=function(_0x12fde3,_0x4800c6){_0x12fde3=_0x12fde3-0x0;var _0x521038=_0x4088[_0x12fde3];return _0x521038;};'use strict';var _=require(_0x8408('0x0'));var util=require(_0x8408('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8408('0x2'));var BPromise=require(_0x8408('0x3'));var rp=require(_0x8408('0x4'));var fs=require('fs');var path=require(_0x8408('0x5'));var rimraf=require(_0x8408('0x6'));var config=require(_0x8408('0x7'));var attributes=require(_0x8408('0x8'));module[_0x8408('0x9')]=function(_0x2ffd9b,_0x1fb982){return _0x2ffd9b[_0x8408('0xa')](_0x8408('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eec=['request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','util','moment'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x8eec,0xe8));var _0xc8ee=function(_0x4115dd,_0x27127a){_0x4115dd=_0x4115dd-0x0;var _0x5d1333=_0x8eec[_0x4115dd];return _0x5d1333;};'use strict';var _=require('lodash');var util=require(_0xc8ee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc8ee('0x1'));var BPromise=require('bluebird');var rp=require(_0xc8ee('0x2'));var fs=require('fs');var path=require(_0xc8ee('0x3'));var rimraf=require('rimraf');var config=require(_0xc8ee('0x4'));var attributes=require(_0xc8ee('0x5'));module[_0xc8ee('0x6')]=function(_0x4888fd,_0x2dc259){return _0x4888fd[_0xc8ee('0x7')]('WhatsappQueue',attributes,{'tableName':_0xc8ee('0x8'),'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 6dd97d4..a95306e 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 _0xf507=['request\x20sent','debug','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','ShowWhatsappQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0x3212de,_0x372cc4){var _0x49f6d0=function(_0x35d8d8){while(--_0x35d8d8){_0x3212de['push'](_0x3212de['shift']());}};_0x49f6d0(++_0x372cc4);}(_0xf507,0xba));var _0x7f50=function(_0x59904f,_0x4bc36d){_0x59904f=_0x59904f-0x0;var _0x16d547=_0xf507[_0x59904f];return _0x16d547;};'use strict';var _=require('lodash');var util=require(_0x7f50('0x0'));var moment=require(_0x7f50('0x1'));var BPromise=require(_0x7f50('0x2'));var rs=require(_0x7f50('0x3'));var fs=require('fs');var Redis=require(_0x7f50('0x4'));var db=require(_0x7f50('0x5'))['db'];var utils=require(_0x7f50('0x6'));var logger=require(_0x7f50('0x7'))(_0x7f50('0x8'));var config=require(_0x7f50('0x9'));var jayson=require(_0x7f50('0xa'));var client=jayson[_0x7f50('0xb')]['http']({'port':0x232a});config[_0x7f50('0xc')]=_[_0x7f50('0xd')](config[_0x7f50('0xc')],{'host':_0x7f50('0xe'),'port':0x18eb});var socket=require(_0x7f50('0xf'))(new Redis(config[_0x7f50('0xc')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4bdba8,_0x50168d,_0x4c4807){return new BPromise(function(_0x54d5ec,_0x34f93b){return client[_0x7f50('0x10')](_0x4bdba8,_0x4c4807)[_0x7f50('0x11')](function(_0x575ec7){logger[_0x7f50('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x50168d,_0x7f50('0x13'));logger[_0x7f50('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x50168d,'request\x20sent',JSON[_0x7f50('0x15')](_0x575ec7));if(_0x575ec7['error']){if(_0x575ec7[_0x7f50('0x16')][_0x7f50('0x17')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x50168d,_0x575ec7['error']['message']);return _0x34f93b(_0x575ec7['error'][_0x7f50('0x18')]);}logger['error'](_0x7f50('0x19'),_0x50168d,_0x575ec7[_0x7f50('0x16')]['message']);return _0x54d5ec(_0x575ec7[_0x7f50('0x16')][_0x7f50('0x18')]);}else{logger[_0x7f50('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x50168d,_0x7f50('0x13'));_0x54d5ec(_0x575ec7[_0x7f50('0x1a')][_0x7f50('0x18')]);}})[_0x7f50('0x1b')](function(_0x149e16){logger[_0x7f50('0x16')](_0x7f50('0x19'),_0x50168d,_0x149e16);_0x34f93b(_0x149e16);});});}exports[_0x7f50('0x1c')]=function(_0x445e29){var _0xfb81e7=this;return new Promise(function(_0x3e75a1,_0x15794a){return db[_0x7f50('0x1d')][_0x7f50('0x1e')]({'raw':_0x445e29[_0x7f50('0x1f')]?_0x445e29['options'][_0x7f50('0x20')]===undefined?!![]:![]:!![],'where':_0x445e29[_0x7f50('0x1f')]?_0x445e29['options']['where']||null:null,'attributes':_0x445e29[_0x7f50('0x1f')]?_0x445e29[_0x7f50('0x1f')][_0x7f50('0x21')]||null:null,'limit':_0x445e29[_0x7f50('0x1f')]?_0x445e29[_0x7f50('0x1f')][_0x7f50('0x22')]||null:null,'include':_0x445e29[_0x7f50('0x1f')]?_0x445e29[_0x7f50('0x1f')][_0x7f50('0x23')]?_[_0x7f50('0x24')](_0x445e29[_0x7f50('0x1f')][_0x7f50('0x23')],function(_0x45ac83){return{'model':db[_0x45ac83['model']],'as':_0x45ac83['as'],'attributes':_0x45ac83[_0x7f50('0x21')],'include':_0x45ac83[_0x7f50('0x23')]?_[_0x7f50('0x24')](_0x45ac83[_0x7f50('0x23')],function(_0x3c0ba3){return{'model':db[_0x3c0ba3[_0x7f50('0x25')]],'as':_0x3c0ba3['as'],'attributes':_0x3c0ba3[_0x7f50('0x21')],'include':_0x3c0ba3[_0x7f50('0x23')]?_['map'](_0x3c0ba3[_0x7f50('0x23')],function(_0x5a201e){return{'model':db[_0x5a201e[_0x7f50('0x25')]],'as':_0x5a201e['as'],'attributes':_0x5a201e[_0x7f50('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23bb0c){logger[_0x7f50('0x12')](_0x7f50('0x1c'),_0x445e29);logger[_0x7f50('0x14')]('GetWhatsappQueue',_0x445e29,JSON[_0x7f50('0x15')](_0x23bb0c));_0x3e75a1(_0x23bb0c);})['catch'](function(_0x42add9){logger[_0x7f50('0x16')](_0x7f50('0x1c'),_0x42add9[_0x7f50('0x18')],_0x445e29);_0x15794a(_0xfb81e7[_0x7f50('0x16')](0x1f4,_0x42add9['message']));});});};exports[_0x7f50('0x26')]=function(_0xdcd6c7){var _0x2e88e2=this;return new Promise(function(_0x167353,_0x4f3d8c){return db['WhatsappQueue'][_0x7f50('0x27')]({'raw':_0xdcd6c7[_0x7f50('0x1f')]?_0xdcd6c7['options'][_0x7f50('0x20')]===undefined?!![]:![]:!![],'where':_0xdcd6c7[_0x7f50('0x1f')]?_0xdcd6c7[_0x7f50('0x1f')][_0x7f50('0x28')]||null:null,'attributes':_0xdcd6c7[_0x7f50('0x1f')]?_0xdcd6c7[_0x7f50('0x1f')]['attributes']||null:null,'include':_0xdcd6c7['options']?_0xdcd6c7[_0x7f50('0x1f')]['include']?_['map'](_0xdcd6c7[_0x7f50('0x1f')]['include'],function(_0x1ef1f3){return{'model':db[_0x1ef1f3[_0x7f50('0x25')]],'as':_0x1ef1f3['as'],'attributes':_0x1ef1f3[_0x7f50('0x21')],'include':_0x1ef1f3['include']?_[_0x7f50('0x24')](_0x1ef1f3['include'],function(_0x40b539){return{'model':db[_0x40b539['model']],'as':_0x40b539['as'],'attributes':_0x40b539[_0x7f50('0x21')],'include':_0x40b539['include']?_[_0x7f50('0x24')](_0x40b539[_0x7f50('0x23')],function(_0x5063b9){return{'model':db[_0x5063b9[_0x7f50('0x25')]],'as':_0x5063b9['as'],'attributes':_0x5063b9[_0x7f50('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7f50('0x11')](function(_0x352c35){logger[_0x7f50('0x12')](_0x7f50('0x26'),_0xdcd6c7);logger[_0x7f50('0x14')](_0x7f50('0x26'),_0xdcd6c7,JSON[_0x7f50('0x15')](_0x352c35));_0x167353(_0x352c35);})[_0x7f50('0x1b')](function(_0x368b72){logger['error'](_0x7f50('0x26'),_0x368b72[_0x7f50('0x18')],_0xdcd6c7);_0x4f3d8c(_0x2e88e2[_0x7f50('0x16')](0x1f4,_0x368b72['message']));});});}; \ No newline at end of file +var _0x21f6=['WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','debug','GetWhatsappQueue','ShowWhatsappQueue','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4dbba7,_0x34d6d1){var _0x43ef83=function(_0x27acf1){while(--_0x27acf1){_0x4dbba7['push'](_0x4dbba7['shift']());}};_0x43ef83(++_0x34d6d1);}(_0x21f6,0x110));var _0x621f=function(_0x208622,_0x124de9){_0x208622=_0x208622-0x0;var _0x5ae7d2=_0x21f6[_0x208622];return _0x5ae7d2;};'use strict';var _=require(_0x621f('0x0'));var util=require(_0x621f('0x1'));var moment=require(_0x621f('0x2'));var BPromise=require(_0x621f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x621f('0x4'));var logger=require(_0x621f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x621f('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x621f('0x7')]=_[_0x621f('0x8')](config[_0x621f('0x7')],{'host':_0x621f('0x9'),'port':0x18eb});var socket=require(_0x621f('0xa'))(new Redis(config[_0x621f('0x7')]));require(_0x621f('0xb'))[_0x621f('0xc')](socket);function respondWithRpcPromise(_0x12f3bb,_0x463746,_0x4660ff){return new BPromise(function(_0x3677d9,_0x54c07a){return client['request'](_0x12f3bb,_0x4660ff)['then'](function(_0x5c5e53){logger[_0x621f('0xd')](_0x621f('0xe'),_0x463746,_0x621f('0xf'));logger['debug'](_0x621f('0x10'),_0x463746,_0x621f('0xf'),JSON[_0x621f('0x11')](_0x5c5e53));if(_0x5c5e53['error']){if(_0x5c5e53[_0x621f('0x12')][_0x621f('0x13')]===0x1f4){logger['error'](_0x621f('0xe'),_0x463746,_0x5c5e53[_0x621f('0x12')][_0x621f('0x14')]);return _0x54c07a(_0x5c5e53[_0x621f('0x12')][_0x621f('0x14')]);}logger[_0x621f('0x12')](_0x621f('0xe'),_0x463746,_0x5c5e53['error'][_0x621f('0x14')]);return _0x3677d9(_0x5c5e53[_0x621f('0x12')][_0x621f('0x14')]);}else{logger[_0x621f('0xd')](_0x621f('0xe'),_0x463746,_0x621f('0xf'));_0x3677d9(_0x5c5e53[_0x621f('0x15')]['message']);}})[_0x621f('0x16')](function(_0x452fb8){logger['error'](_0x621f('0xe'),_0x463746,_0x452fb8);_0x54c07a(_0x452fb8);});});}exports['GetWhatsappQueue']=function(_0x87b33f){var _0x4b49bd=this;return new Promise(function(_0x33e042,_0x220792){return db[_0x621f('0x17')][_0x621f('0x18')]({'raw':_0x87b33f[_0x621f('0x19')]?_0x87b33f[_0x621f('0x19')][_0x621f('0x1a')]===undefined?!![]:![]:!![],'where':_0x87b33f[_0x621f('0x19')]?_0x87b33f[_0x621f('0x19')][_0x621f('0x1b')]||null:null,'attributes':_0x87b33f[_0x621f('0x19')]?_0x87b33f['options'][_0x621f('0x1c')]||null:null,'limit':_0x87b33f[_0x621f('0x19')]?_0x87b33f['options']['limit']||null:null,'include':_0x87b33f[_0x621f('0x19')]?_0x87b33f['options']['include']?_[_0x621f('0x1d')](_0x87b33f[_0x621f('0x19')][_0x621f('0x1e')],function(_0x2caf03){return{'model':db[_0x2caf03[_0x621f('0x1f')]],'as':_0x2caf03['as'],'attributes':_0x2caf03[_0x621f('0x1c')],'include':_0x2caf03[_0x621f('0x1e')]?_[_0x621f('0x1d')](_0x2caf03[_0x621f('0x1e')],function(_0x37d67e){return{'model':db[_0x37d67e[_0x621f('0x1f')]],'as':_0x37d67e['as'],'attributes':_0x37d67e['attributes'],'include':_0x37d67e[_0x621f('0x1e')]?_[_0x621f('0x1d')](_0x37d67e[_0x621f('0x1e')],function(_0x21b33a){return{'model':db[_0x21b33a[_0x621f('0x1f')]],'as':_0x21b33a['as'],'attributes':_0x21b33a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a51c){logger[_0x621f('0xd')]('GetWhatsappQueue',_0x87b33f);logger[_0x621f('0x20')](_0x621f('0x21'),_0x87b33f,JSON[_0x621f('0x11')](_0x16a51c));_0x33e042(_0x16a51c);})[_0x621f('0x16')](function(_0x48e3a8){logger[_0x621f('0x12')]('GetWhatsappQueue',_0x48e3a8[_0x621f('0x14')],_0x87b33f);_0x220792(_0x4b49bd[_0x621f('0x12')](0x1f4,_0x48e3a8[_0x621f('0x14')]));});});};exports[_0x621f('0x22')]=function(_0x88ba83){var _0x424acb=this;return new Promise(function(_0x1fcb6c,_0x377f98){return db[_0x621f('0x17')]['find']({'raw':_0x88ba83['options']?_0x88ba83[_0x621f('0x19')][_0x621f('0x1a')]===undefined?!![]:![]:!![],'where':_0x88ba83[_0x621f('0x19')]?_0x88ba83[_0x621f('0x19')][_0x621f('0x1b')]||null:null,'attributes':_0x88ba83[_0x621f('0x19')]?_0x88ba83[_0x621f('0x19')]['attributes']||null:null,'include':_0x88ba83[_0x621f('0x19')]?_0x88ba83[_0x621f('0x19')]['include']?_[_0x621f('0x1d')](_0x88ba83[_0x621f('0x19')][_0x621f('0x1e')],function(_0xcd8bf0){return{'model':db[_0xcd8bf0[_0x621f('0x1f')]],'as':_0xcd8bf0['as'],'attributes':_0xcd8bf0['attributes'],'include':_0xcd8bf0[_0x621f('0x1e')]?_[_0x621f('0x1d')](_0xcd8bf0[_0x621f('0x1e')],function(_0x2369fb){return{'model':db[_0x2369fb['model']],'as':_0x2369fb['as'],'attributes':_0x2369fb[_0x621f('0x1c')],'include':_0x2369fb['include']?_[_0x621f('0x1d')](_0x2369fb[_0x621f('0x1e')],function(_0x4d0932){return{'model':db[_0x4d0932[_0x621f('0x1f')]],'as':_0x4d0932['as'],'attributes':_0x4d0932['attributes']};}):[]};}):[]};}):[]:[]})[_0x621f('0x23')](function(_0x74c8a5){logger[_0x621f('0xd')](_0x621f('0x22'),_0x88ba83);logger[_0x621f('0x20')](_0x621f('0x22'),_0x88ba83,JSON[_0x621f('0x11')](_0x74c8a5));_0x1fcb6c(_0x74c8a5);})[_0x621f('0x16')](function(_0x3e08d5){logger[_0x621f('0x12')](_0x621f('0x22'),_0x3e08d5[_0x621f('0x14')],_0x88ba83);_0x377f98(_0x424acb['error'](0x1f4,_0x3e08d5[_0x621f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 534d89a..273ef88 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 _0x4d25=['emit','register','length','whatsappQueue:','remove'];(function(_0x4e0797,_0x5b5b11){var _0x25a686=function(_0x3a3143){while(--_0x3a3143){_0x4e0797['push'](_0x4e0797['shift']());}};_0x25a686(++_0x5b5b11);}(_0x4d25,0x167));var _0x54d2=function(_0x391c0e,_0xf90f40){_0x391c0e=_0x391c0e-0x0;var _0x2b77c7=_0x4d25[_0x391c0e];return _0x2b77c7;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x54d2('0x0'),'update'];function createListener(_0x578c8e,_0x20762d){return function(_0x3c2a9a){_0x20762d[_0x54d2('0x1')](_0x578c8e,_0x3c2a9a);};}function removeListener(_0x4b415e,_0x5ca69c){return function(){WhatsappQueueEvents['removeListener'](_0x4b415e,_0x5ca69c);};}exports[_0x54d2('0x2')]=function(_0x16b6e7){for(var _0x15b7dd=0x0,_0xc1b201=events[_0x54d2('0x3')];_0x15b7dd<_0xc1b201;_0x15b7dd++){var _0x570e26=events[_0x15b7dd];var _0x159663=createListener(_0x54d2('0x4')+_0x570e26,_0x16b6e7);WhatsappQueueEvents['on'](_0x570e26,_0x159663);}}; \ No newline at end of file +var _0x2ad2=['update','emit','removeListener','register','length','save','remove'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x2ad2,0x91));var _0x22ad=function(_0x4f7588,_0x399e6b){_0x4f7588=_0x4f7588-0x0;var _0x535c70=_0x2ad2[_0x4f7588];return _0x535c70;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x22ad('0x0'),_0x22ad('0x1'),_0x22ad('0x2')];function createListener(_0x155882,_0x4a7442){return function(_0x3766a3){_0x4a7442[_0x22ad('0x3')](_0x155882,_0x3766a3);};}function removeListener(_0xfbee33,_0x53c4be){return function(){WhatsappQueueEvents[_0x22ad('0x4')](_0xfbee33,_0x53c4be);};}exports[_0x22ad('0x5')]=function(_0x79718f){for(var _0x5f15d7=0x0,_0x52b1eb=events[_0x22ad('0x6')];_0x5f15d7<_0x52b1eb;_0x5f15d7++){var _0xeb4b3b=events[_0x5f15d7];var _0x3e8466=createListener('whatsappQueue:'+_0xeb4b3b,_0x79718f);WhatsappQueueEvents['on'](_0xeb4b3b,_0x3e8466);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 4c0ac9c..d59e205 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 _0xda9c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','destroy','exports'];(function(_0x1dce05,_0x3d43f7){var _0x3dabb1=function(_0x415a5b){while(--_0x415a5b){_0x1dce05['push'](_0x1dce05['shift']());}};_0x3dabb1(++_0x3d43f7);}(_0xda9c,0x126));var _0xcda9=function(_0x3d122c,_0x7efb42){_0x3d122c=_0x3d122c-0x0;var _0x339ae1=_0xda9c[_0x3d122c];return _0x339ae1;};'use strict';var multer=require(_0xcda9('0x0'));var util=require(_0xcda9('0x1'));var path=require(_0xcda9('0x2'));var timeout=require(_0xcda9('0x3'));var express=require(_0xcda9('0x4'));var router=express[_0xcda9('0x5')]();var fs_extra=require(_0xcda9('0x6'));var auth=require(_0xcda9('0x7'));var interaction=require(_0xcda9('0x8'));var config=require(_0xcda9('0x9'));var controller=require(_0xcda9('0xa'));router[_0xcda9('0xb')]('/',auth[_0xcda9('0xc')](),controller['index']);router['get'](_0xcda9('0xd'),auth[_0xcda9('0xc')](),controller['describe']);router[_0xcda9('0xb')](_0xcda9('0xe'),auth[_0xcda9('0xc')](),controller[_0xcda9('0xf')]);router[_0xcda9('0x10')]('/',auth[_0xcda9('0xc')](),controller[_0xcda9('0x11')]);router[_0xcda9('0x12')](_0xcda9('0xe'),auth[_0xcda9('0xc')](),controller['update']);router['delete'](_0xcda9('0xe'),auth['isAuthenticated'](),controller[_0xcda9('0x13')]);module[_0xcda9('0x14')]=router; \ No newline at end of file +var _0x30eb=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x314041,_0x716dc9){var _0x31a119=function(_0x393e11){while(--_0x393e11){_0x314041['push'](_0x314041['shift']());}};_0x31a119(++_0x716dc9);}(_0x30eb,0xb8));var _0xb30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30eb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xb30e('0x0'));var util=require(_0xb30e('0x1'));var path=require(_0xb30e('0x2'));var timeout=require(_0xb30e('0x3'));var express=require(_0xb30e('0x4'));var router=express[_0xb30e('0x5')]();var fs_extra=require(_0xb30e('0x6'));var auth=require(_0xb30e('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb30e('0x8'));router[_0xb30e('0x9')]('/',auth[_0xb30e('0xa')](),controller[_0xb30e('0xb')]);router[_0xb30e('0x9')](_0xb30e('0xc'),auth[_0xb30e('0xa')](),controller[_0xb30e('0xd')]);router[_0xb30e('0x9')](_0xb30e('0xe'),auth['isAuthenticated'](),controller[_0xb30e('0xf')]);router[_0xb30e('0x10')]('/',auth[_0xb30e('0xa')](),controller['create']);router[_0xb30e('0x11')](_0xb30e('0xe'),auth[_0xb30e('0xa')](),controller[_0xb30e('0x12')]);router[_0xb30e('0x13')](_0xb30e('0xe'),auth[_0xb30e('0xa')](),controller[_0xb30e('0x14')]);module[_0xb30e('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 64b9575..02b9460 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(_0x5cba15,_0x858bdd){var _0x39dde6=function(_0x424500){while(--_0x424500){_0x5cba15['push'](_0x5cba15['shift']());}};_0x39dde6(++_0x858bdd);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x497c0e,_0x57084c){var _0x404438=function(_0x6097fb){while(--_0x6097fb){_0x497c0e['push'](_0x497c0e['shift']());}};_0x404438(++_0x57084c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 274502a..6fc146c 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 _0xa902=['ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','WhatsappQueueReport','findAll','rows','catch','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv'];(function(_0x21b1fa,_0x640318){var _0x5dd9e0=function(_0x3c4082){while(--_0x3c4082){_0x21b1fa['push'](_0x21b1fa['shift']());}};_0x5dd9e0(++_0x640318);}(_0xa902,0x8d));var _0x2a90=function(_0x560526,_0x3396ea){_0x560526=_0x560526-0x0;var _0x2977d2=_0xa902[_0x560526];return _0x2977d2;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x2a212c,_0x1303d9){return function(_0x29ed73){if(!_0x29ed73){_0x2a212c[_0x2a90('0x17')](0x194);}return _0x29ed73;};}function handleError(_0x48c2f9,_0x27f883){_0x27f883=_0x27f883||0x1f4;return function(_0x17f978){logger[_0x2a90('0x27')](_0x17f978[_0x2a90('0x28')]);if(_0x17f978[_0x2a90('0x29')]){delete _0x17f978['name'];}_0x48c2f9['status'](_0x27f883)[_0x2a90('0x2a')](_0x17f978);};}exports['index']=function(_0x53391e,_0x4969c3){var _0x2d83b3={},_0x3c78f5={},_0x595638={'count':0x0,'rows':[]};var _0x5bd700=_[_0x2a90('0x2b')](db['WhatsappQueueReport'][_0x2a90('0x2c')],function(_0x6892e1){return{'name':_0x6892e1[_0x2a90('0x2d')],'type':_0x6892e1[_0x2a90('0x2e')][_0x2a90('0x2f')]};});_0x3c78f5[_0x2a90('0x30')]=_[_0x2a90('0x2b')](_0x5bd700,'name');_0x3c78f5[_0x2a90('0x31')]=_[_0x2a90('0x32')](_0x53391e[_0x2a90('0x31')]);_0x3c78f5['filters']=_[_0x2a90('0x33')](_0x3c78f5[_0x2a90('0x30')],_0x3c78f5[_0x2a90('0x31')]);_0x2d83b3[_0x2a90('0x34')]=_['intersection'](_0x3c78f5[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x53391e[_0x2a90('0x31')][_0x2a90('0x35')]));_0x2d83b3[_0x2a90('0x34')]=_0x2d83b3[_0x2a90('0x34')]['length']?_0x2d83b3[_0x2a90('0x34')]:_0x3c78f5[_0x2a90('0x30')];if(!_0x53391e[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x2d83b3[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x53391e['query'][_0x2a90('0x1d')]);_0x2d83b3[_0x2a90('0x1b')]=qs['offset'](_0x53391e['query'][_0x2a90('0x1b')]);}_0x2d83b3[_0x2a90('0x37')]=qs[_0x2a90('0x38')](_0x53391e['query'][_0x2a90('0x38')]);_0x2d83b3['where']=qs[_0x2a90('0x39')](_['pick'](_0x53391e[_0x2a90('0x31')],_0x3c78f5['filters']),_0x5bd700);if(_0x53391e['query'][_0x2a90('0x3a')]){_0x2d83b3['where']=_[_0x2a90('0x3b')](_0x2d83b3[_0x2a90('0x3c')],{'$or':_[_0x2a90('0x2b')](_0x5bd700,function(_0x573aee){if(_0x573aee[_0x2a90('0x2e')]!==_0x2a90('0x3d')){var _0x3be438={};_0x3be438[_0x573aee['name']]={'$like':'%'+_0x53391e[_0x2a90('0x31')][_0x2a90('0x3a')]+'%'};return _0x3be438;}})});}_0x2d83b3=_[_0x2a90('0x3b')]({},_0x2d83b3,_0x53391e['options']);var _0x1aa096={'where':_0x2d83b3[_0x2a90('0x3c')]};return db['WhatsappQueueReport'][_0x2a90('0x1e')](_0x1aa096)[_0x2a90('0x25')](function(_0x2a6bea){_0x595638[_0x2a90('0x1e')]=_0x2a6bea;if(_0x53391e[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x2d83b3[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x41')](_0x2d83b3);})[_0x2a90('0x25')](function(_0x45b41c){_0x595638[_0x2a90('0x42')]=_0x45b41c;return _0x595638;})[_0x2a90('0x25')](respondWithFilteredResult(_0x4969c3,_0x2d83b3))[_0x2a90('0x43')](handleError(_0x4969c3,null));};exports['show']=function(_0x45cbc2,_0x3a70fe){var _0x528b41={'raw':!![],'where':{'id':_0x45cbc2[_0x2a90('0x44')]['id']}},_0x1045bb={};_0x1045bb[_0x2a90('0x30')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')]['rawAttributes']);_0x1045bb[_0x2a90('0x31')]=_['keys'](_0x45cbc2[_0x2a90('0x31')]);_0x1045bb['filters']=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],_0x1045bb[_0x2a90('0x31')]);_0x528b41[_0x2a90('0x34')]=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x45cbc2['query']['fields']));_0x528b41[_0x2a90('0x34')]=_0x528b41[_0x2a90('0x34')][_0x2a90('0x45')]?_0x528b41[_0x2a90('0x34')]:_0x1045bb[_0x2a90('0x30')];if(_0x45cbc2[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x528b41[_0x2a90('0x3f')]=[{'all':!![]}];}_0x528b41=_['merge']({},_0x528b41,_0x45cbc2[_0x2a90('0x46')]);return db['WhatsappQueueReport'][_0x2a90('0x47')](_0x528b41)[_0x2a90('0x25')](handleEntityNotFound(_0x3a70fe,null))['then'](respondWithResult(_0x3a70fe,null))[_0x2a90('0x43')](handleError(_0x3a70fe,null));};exports[_0x2a90('0x48')]=function(_0x280e63,_0x1d55db){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x280e63[_0x2a90('0x49')],{})['then'](respondWithResult(_0x1d55db,0xc9))['catch'](handleError(_0x1d55db,null));};exports[_0x2a90('0x24')]=function(_0x2611d0,_0x42c890){if(_0x2611d0[_0x2a90('0x49')]['id']){delete _0x2611d0[_0x2a90('0x49')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x2611d0[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x42c890,null))['then'](saveUpdates(_0x2611d0['body'],null))['then'](respondWithResult(_0x42c890,null))[_0x2a90('0x43')](handleError(_0x42c890,null));};exports['destroy']=function(_0x370da3,_0x3dfe72){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x370da3[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3dfe72,null))['then'](removeEntity(_0x3dfe72,null))[_0x2a90('0x43')](handleError(_0x3dfe72,null));};exports[_0x2a90('0x4a')]=function(_0x48d3bc,_0x265769){return db['WhatsappQueueReport']['describe']()[_0x2a90('0x25')](respondWithResult(_0x265769,null))[_0x2a90('0x43')](handleError(_0x265769,null));}; \ No newline at end of file +var _0xeb74=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x48b680,_0x472cb8){var _0x25e381=function(_0x5e92ec){while(--_0x5e92ec){_0x48b680['push'](_0x48b680['shift']());}};_0x25e381(++_0x472cb8);}(_0xeb74,0xe3));var _0x4eb7=function(_0x2ee03a,_0x379b03){_0x2ee03a=_0x2ee03a-0x0;var _0x29bb2d=_0xeb74[_0x2ee03a];return _0x29bb2d;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['WhatsappQueueReport'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['WhatsappQueueReport'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['WhatsappQueueReport'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));};exports[_0x4eb7('0x50')]=function(_0x1580ba,_0x1411c9){return db[_0x4eb7('0x44')]['describe']()[_0x4eb7('0x25')](respondWithResult(_0x1411c9,null))['catch'](handleError(_0x1411c9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 58ae749..7a71931 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 _0xa634=['request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','moment'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xa634,0x74));var _0x4a63=function(_0x3c1a72,_0x52fa7c){_0x3c1a72=_0x3c1a72-0x0;var _0x223089=_0xa634[_0x3c1a72];return _0x223089;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4a63('0x0'));var BPromise=require('bluebird');var rp=require(_0x4a63('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4a63('0x2'));var config=require(_0x4a63('0x3'));var attributes=require(_0x4a63('0x4'));module[_0x4a63('0x5')]=function(_0x4dae97,_0x550ac7){return _0x4dae97[_0x4a63('0x6')]('WhatsappQueueReport',attributes,{'tableName':_0x4a63('0x7'),'paranoid':![],'indexes':[{'name':_0x4a63('0x8'),'fields':[_0x4a63('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6063=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x453f59,_0x49e585){var _0x44bd73=function(_0x1e812f){while(--_0x1e812f){_0x453f59['push'](_0x453f59['shift']());}};_0x44bd73(++_0x49e585);}(_0x6063,0xfc));var _0x3606=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6063[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3606('0x0'));var util=require(_0x3606('0x1'));var logger=require(_0x3606('0x2'))(_0x3606('0x3'));var moment=require(_0x3606('0x4'));var BPromise=require(_0x3606('0x5'));var rp=require(_0x3606('0x6'));var fs=require('fs');var path=require(_0x3606('0x7'));var rimraf=require(_0x3606('0x8'));var config=require(_0x3606('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0x3606('0xa')]=function(_0x463da8,_0x2c5b1d){return _0x463da8[_0x3606('0xb')](_0x3606('0xc'),attributes,{'tableName':_0x3606('0xd'),'paranoid':![],'indexes':[{'name':_0x3606('0xe'),'fields':[_0x3606('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 a522ae3..2d6c96f 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 _0x0a6c=['../../config/environment','jayson/promise','http','request','then','request\x20sent','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','CreateWhatsappQueueReport','body','options','catch','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x204be4,_0x2d18f4){var _0x437aea=function(_0x4619e8){while(--_0x4619e8){_0x204be4['push'](_0x204be4['shift']());}};_0x437aea(++_0x2d18f4);}(_0x0a6c,0xf7));var _0xc0a6=function(_0x437426,_0x507cbd){_0x437426=_0x437426-0x0;var _0x2d8530=_0x0a6c[_0x437426];return _0x2d8530;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc0a6('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0a6('0x1'))['db'];var utils=require(_0xc0a6('0x2'));var logger=require(_0xc0a6('0x3'))(_0xc0a6('0x4'));var config=require(_0xc0a6('0x5'));var jayson=require(_0xc0a6('0x6'));var client=jayson['client'][_0xc0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x259866,_0x33a80f,_0x9b9b75){return new BPromise(function(_0x1a2382,_0x48843c){return client[_0xc0a6('0x8')](_0x259866,_0x9b9b75)[_0xc0a6('0x9')](function(_0x38b1ea){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x33a80f,_0xc0a6('0xa'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x33a80f,_0xc0a6('0xa'),JSON[_0xc0a6('0xb')](_0x38b1ea));if(_0x38b1ea[_0xc0a6('0xc')]){if(_0x38b1ea['error'][_0xc0a6('0xd')]===0x1f4){logger[_0xc0a6('0xc')](_0xc0a6('0xe'),_0x33a80f,_0x38b1ea[_0xc0a6('0xc')]['message']);return _0x48843c(_0x38b1ea[_0xc0a6('0xc')]['message']);}logger[_0xc0a6('0xc')](_0xc0a6('0xe'),_0x33a80f,_0x38b1ea[_0xc0a6('0xc')][_0xc0a6('0xf')]);return _0x1a2382(_0x38b1ea[_0xc0a6('0xc')][_0xc0a6('0xf')]);}else{logger[_0xc0a6('0x10')](_0xc0a6('0xe'),_0x33a80f,_0xc0a6('0xa'));_0x1a2382(_0x38b1ea[_0xc0a6('0x11')]['message']);}})['catch'](function(_0x3c59c0){logger[_0xc0a6('0xc')](_0xc0a6('0xe'),_0x33a80f,_0x3c59c0);_0x48843c(_0x3c59c0);});});}exports[_0xc0a6('0x12')]=function(_0x151f0a){var _0x2214a5=this;return new Promise(function(_0x419e76,_0x416577){return db['WhatsappQueueReport']['create'](_0x151f0a[_0xc0a6('0x13')],{'raw':_0x151f0a[_0xc0a6('0x14')]?_0x151f0a[_0xc0a6('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xc0a6('0x9')](function(_0xe91a82){logger['info'](_0xc0a6('0x12'),_0x151f0a);logger['debug']('CreateWhatsappQueueReport',_0x151f0a,JSON[_0xc0a6('0xb')](_0xe91a82));_0x419e76(_0xe91a82);})[_0xc0a6('0x15')](function(_0x44fb34){logger[_0xc0a6('0xc')](_0xc0a6('0x12'),_0x44fb34['message'],_0x151f0a);_0x416577(_0x2214a5[_0xc0a6('0xc')](0x1f4,_0x44fb34[_0xc0a6('0xf')]));});});};exports[_0xc0a6('0x16')]=function(_0x1e20df){var _0x5a8d13=this;return new Promise(function(_0x265cdf,_0x57b9a2){return db['WhatsappQueueReport'][_0xc0a6('0x17')](_0x1e20df[_0xc0a6('0x13')],{'raw':_0x1e20df['options']?_0x1e20df[_0xc0a6('0x14')][_0xc0a6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e20df[_0xc0a6('0x14')]?_0x1e20df[_0xc0a6('0x14')][_0xc0a6('0x19')]||null:null,'attributes':_0x1e20df['options']?_0x1e20df[_0xc0a6('0x14')][_0xc0a6('0x1a')]||null:null,'limit':_0x1e20df['options']?_0x1e20df[_0xc0a6('0x14')][_0xc0a6('0x1b')]||null:null})[_0xc0a6('0x9')](function(_0x6e7063){logger['info']('UpdateWhatsappQueueReport',_0x1e20df);logger['debug'](_0xc0a6('0x16'),_0x1e20df,JSON[_0xc0a6('0xb')](_0x6e7063));_0x265cdf(_0x6e7063);})[_0xc0a6('0x15')](function(_0x406717){logger[_0xc0a6('0xc')]('UpdateWhatsappQueueReport',_0x406717[_0xc0a6('0xf')],_0x1e20df);_0x57b9a2(_0x5a8d13[_0xc0a6('0xc')](0x1f4,_0x406717[_0xc0a6('0xf')]));});});}; \ No newline at end of file +var _0x9e93=['../../config/logger','rpc','../../config/environment','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','then','debug','UpdateWhatsappQueueReport','update','body','raw','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x722c72,_0x179935){var _0x3b3cce=function(_0x42adaa){while(--_0x42adaa){_0x722c72['push'](_0x722c72['shift']());}};_0x3b3cce(++_0x179935);}(_0x9e93,0x1ad));var _0x39e9=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x9e93[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0x39e9('0x0'));var util=require(_0x39e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x39e9('0x2'));var fs=require('fs');var Redis=require(_0x39e9('0x3'));var db=require(_0x39e9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39e9('0x5'))(_0x39e9('0x6'));var config=require(_0x39e9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x39e9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35e017,_0x1024a0,_0x922ac8){return new BPromise(function(_0xde239e,_0x2f58ef){return client['request'](_0x35e017,_0x922ac8)['then'](function(_0x20fa4f){logger[_0x39e9('0x9')](_0x39e9('0xa'),_0x1024a0,_0x39e9('0xb'));logger['debug'](_0x39e9('0xc'),_0x1024a0,'request\x20sent',JSON[_0x39e9('0xd')](_0x20fa4f));if(_0x20fa4f[_0x39e9('0xe')]){if(_0x20fa4f[_0x39e9('0xe')][_0x39e9('0xf')]===0x1f4){logger[_0x39e9('0xe')](_0x39e9('0xa'),_0x1024a0,_0x20fa4f[_0x39e9('0xe')][_0x39e9('0x10')]);return _0x2f58ef(_0x20fa4f[_0x39e9('0xe')][_0x39e9('0x10')]);}logger[_0x39e9('0xe')](_0x39e9('0xa'),_0x1024a0,_0x20fa4f[_0x39e9('0xe')]['message']);return _0xde239e(_0x20fa4f['error'][_0x39e9('0x10')]);}else{logger['info'](_0x39e9('0xa'),_0x1024a0,_0x39e9('0xb'));_0xde239e(_0x20fa4f[_0x39e9('0x11')][_0x39e9('0x10')]);}})[_0x39e9('0x12')](function(_0x3d5934){logger[_0x39e9('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1024a0,_0x3d5934);_0x2f58ef(_0x3d5934);});});}exports[_0x39e9('0x13')]=function(_0x2440d7){var _0x1e7ed6=this;return new Promise(function(_0x50e48a,_0x4e5d6d){return db[_0x39e9('0x14')][_0x39e9('0x15')](_0x2440d7['body'],{'raw':_0x2440d7[_0x39e9('0x16')]?_0x2440d7[_0x39e9('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x39e9('0x17')](function(_0x3a6f36){logger[_0x39e9('0x9')](_0x39e9('0x13'),_0x2440d7);logger[_0x39e9('0x18')](_0x39e9('0x13'),_0x2440d7,JSON[_0x39e9('0xd')](_0x3a6f36));_0x50e48a(_0x3a6f36);})['catch'](function(_0x26f120){logger[_0x39e9('0xe')](_0x39e9('0x13'),_0x26f120['message'],_0x2440d7);_0x4e5d6d(_0x1e7ed6['error'](0x1f4,_0x26f120['message']));});});};exports[_0x39e9('0x19')]=function(_0x2d052e){var _0x423cf8=this;return new Promise(function(_0x296053,_0x528e87){return db[_0x39e9('0x14')][_0x39e9('0x1a')](_0x2d052e[_0x39e9('0x1b')],{'raw':_0x2d052e['options']?_0x2d052e[_0x39e9('0x16')][_0x39e9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d052e[_0x39e9('0x16')]?_0x2d052e[_0x39e9('0x16')][_0x39e9('0x1d')]||null:null,'attributes':_0x2d052e[_0x39e9('0x16')]?_0x2d052e['options'][_0x39e9('0x1e')]||null:null,'limit':_0x2d052e[_0x39e9('0x16')]?_0x2d052e[_0x39e9('0x16')]['limit']||null:null})[_0x39e9('0x17')](function(_0x2f134d){logger[_0x39e9('0x9')](_0x39e9('0x19'),_0x2d052e);logger[_0x39e9('0x18')](_0x39e9('0x19'),_0x2d052e,JSON[_0x39e9('0xd')](_0x2f134d));_0x296053(_0x2f134d);})[_0x39e9('0x12')](function(_0x25c6d5){logger[_0x39e9('0xe')](_0x39e9('0x19'),_0x25c6d5[_0x39e9('0x10')],_0x2d052e);_0x528e87(_0x423cf8[_0x39e9('0xe')](0x1f4,_0x25c6d5['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9f9966e..0e00870 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 _0x7833=['describe','get','/:id','show','post','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','/describe'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x7833,0xb2));var _0x3783=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x7833[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require(_0x3783('0x0'));var path=require(_0x3783('0x1'));var timeout=require(_0x3783('0x2'));var express=require(_0x3783('0x3'));var router=express[_0x3783('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3783('0x5'));var interaction=require(_0x3783('0x6'));var config=require(_0x3783('0x7'));var controller=require(_0x3783('0x8'));router['get']('/',auth[_0x3783('0x9')](),controller[_0x3783('0xa')]);router['get'](_0x3783('0xb'),auth[_0x3783('0x9')](),controller[_0x3783('0xc')]);router[_0x3783('0xd')](_0x3783('0xe'),auth[_0x3783('0x9')](),controller[_0x3783('0xf')]);router[_0x3783('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3783('0x11')](_0x3783('0xe'),auth[_0x3783('0x9')](),controller['update']);router['delete'](_0x3783('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3783('0x12')]=router; \ No newline at end of file +var _0xfbe1=['get','isAuthenticated','index','/describe','/:id','post','create','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x455aa2,_0x5934f5){var _0x5b8d8d=function(_0x391550){while(--_0x391550){_0x455aa2['push'](_0x455aa2['shift']());}};_0x5b8d8d(++_0x5934f5);}(_0xfbe1,0x129));var _0x1fbe=function(_0x57db94,_0x349c53){_0x57db94=_0x57db94-0x0;var _0x1c1385=_0xfbe1[_0x57db94];return _0x1c1385;};'use strict';var multer=require(_0x1fbe('0x0'));var util=require(_0x1fbe('0x1'));var path=require(_0x1fbe('0x2'));var timeout=require(_0x1fbe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1fbe('0x4'));var auth=require(_0x1fbe('0x5'));var interaction=require(_0x1fbe('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x1fbe('0x7')]('/',auth[_0x1fbe('0x8')](),controller[_0x1fbe('0x9')]);router[_0x1fbe('0x7')](_0x1fbe('0xa'),auth[_0x1fbe('0x8')](),controller['describe']);router['get'](_0x1fbe('0xb'),auth[_0x1fbe('0x8')](),controller['show']);router[_0x1fbe('0xc')]('/',auth[_0x1fbe('0x8')](),controller[_0x1fbe('0xd')]);router['put']('/:id',auth[_0x1fbe('0x8')](),controller[_0x1fbe('0xe')]);router['delete'](_0x1fbe('0xb'),auth[_0x1fbe('0x8')](),controller['destroy']);module[_0x1fbe('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 076c47f..6c83449 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 _0x17a7=['agent','queue','ENUM','account'];(function(_0x1b0d1a,_0x5d701b){var _0x83cc7c=function(_0x228621){while(--_0x228621){_0x1b0d1a['push'](_0x1b0d1a['shift']());}};_0x83cc7c(++_0x5d701b);}(_0x17a7,0xc2));var _0x717a=function(_0x516282,_0x2aa3b8){_0x516282=_0x516282-0x0;var _0x1ed8fc=_0x17a7[_0x516282];return _0x1ed8fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x717a('0x0')](_0x717a('0x1'),_0x717a('0x2'),_0x717a('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x6d0c=['sequelize','exports','STRING','ENUM','account','agent','DATE'];(function(_0x261075,_0xe4c49a){var _0x3256ed=function(_0x1364cc){while(--_0x1364cc){_0x261075['push'](_0x261075['shift']());}};_0x3256ed(++_0xe4c49a);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x2e7f34,_0x3d0a52){_0x2e7f34=_0x2e7f34-0x0;var _0x6fafca=_0x6d0c[_0x2e7f34];return _0x6fafca;};'use strict';var Sequelize=require(_0xc6d0('0x0'));module[_0xc6d0('0x1')]={'uniqueid':{'type':Sequelize[_0xc6d0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc6d0('0x3')](_0xc6d0('0x4'),_0xc6d0('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc6d0('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 6d3029c..7f2e075 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 _0x8425=['name','index','map','rawAttributes','fieldName','key','query','filters','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','WhatsappTransferReport','findAll','catch','show','params','keys','intersection','options','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','error'];(function(_0x212972,_0x2dc30f){var _0x1c321a=function(_0x500d6c){while(--_0x500d6c){_0x212972['push'](_0x212972['shift']());}};_0x1c321a(++_0x2dc30f);}(_0x8425,0x1a5));var _0x5842=function(_0x2e6641,_0x5aec12){_0x2e6641=_0x2e6641-0x0;var _0xc7b92d=_0x8425[_0x2e6641];return _0xc7b92d;};'use strict';var emlformat=require(_0x5842('0x0'));var rimraf=require(_0x5842('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5842('0x2'));var rp=require(_0x5842('0x3'));var moment=require(_0x5842('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5842('0x5'));var util=require(_0x5842('0x6'));var path=require(_0x5842('0x7'));var sox=require(_0x5842('0x8'));var csv=require(_0x5842('0x9'));var ejs=require(_0x5842('0xa'));var fs=require('fs');var fs_extra=require(_0x5842('0xb'));var _=require(_0x5842('0xc'));var squel=require(_0x5842('0xd'));var crypto=require(_0x5842('0xe'));var jsforce=require(_0x5842('0xf'));var deskjs=require(_0x5842('0x10'));var toCsv=require(_0x5842('0x9'));var querystring=require(_0x5842('0x11'));var Papa=require(_0x5842('0x12'));var Redis=require(_0x5842('0x13'));var authService=require(_0x5842('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5842('0x15'));var hardwareService=require(_0x5842('0x16'));var logger=require(_0x5842('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5842('0x18'));var licenseUtil=require(_0x5842('0x19'));var db=require(_0x5842('0x1a'))['db'];function respondWithStatusCode(_0x364196,_0x9e73ea){_0x9e73ea=_0x9e73ea||0xcc;return function(_0x54538e){if(_0x54538e){return _0x364196[_0x5842('0x1b')](_0x9e73ea);}return _0x364196['status'](_0x9e73ea)[_0x5842('0x1c')]();};}function respondWithResult(_0x143c92,_0x5d57d5){_0x5d57d5=_0x5d57d5||0xc8;return function(_0x4555db){if(_0x4555db){return _0x143c92[_0x5842('0x1d')](_0x5d57d5)[_0x5842('0x1e')](_0x4555db);}};}function respondWithFilteredResult(_0x5229ff,_0x263449){return function(_0x4bc130){if(_0x4bc130){var _0x37b8af=typeof _0x263449['offset']===_0x5842('0x1f')&&typeof _0x263449['limit']===_0x5842('0x1f');var _0x582f4d=_0x4bc130[_0x5842('0x20')];var _0x381b83=_0x37b8af?0x0:_0x263449['offset'];var _0x5151da=_0x37b8af?_0x4bc130['count']:_0x263449[_0x5842('0x21')]+_0x263449[_0x5842('0x22')];var _0x27c234;if(_0x5151da>=_0x582f4d){_0x5151da=_0x582f4d;_0x27c234=0xc8;}else{_0x27c234=0xce;}_0x5229ff[_0x5842('0x1d')](_0x27c234);return _0x5229ff[_0x5842('0x23')](_0x5842('0x24'),_0x381b83+'-'+_0x5151da+'/'+_0x582f4d)[_0x5842('0x1e')](_0x4bc130);}return null;};}function patchUpdates(_0xea9be){return function(_0x363e5a){try{jsonpatch['apply'](_0x363e5a,_0xea9be,!![]);}catch(_0x4f7391){return BPromise[_0x5842('0x25')](_0x4f7391);}return _0x363e5a[_0x5842('0x26')]();};}function saveUpdates(_0x2eccc3,_0x4a5434){return function(_0x409868){if(_0x409868){return _0x409868['update'](_0x2eccc3)[_0x5842('0x27')](function(_0x105f6a){return _0x105f6a;});}return null;};}function removeEntity(_0x58e615,_0x344fc6){return function(_0x592d3c){if(_0x592d3c){return _0x592d3c['destroy']()['then'](function(){_0x58e615[_0x5842('0x1d')](0xcc)[_0x5842('0x1c')]();});}};}function handleEntityNotFound(_0x4f5dd7,_0xe977a4){return function(_0x2c1881){if(!_0x2c1881){_0x4f5dd7[_0x5842('0x1b')](0x194);}return _0x2c1881;};}function handleError(_0x3318fc,_0x45cff4){_0x45cff4=_0x45cff4||0x1f4;return function(_0x1a26a7){logger[_0x5842('0x28')](_0x1a26a7['stack']);if(_0x1a26a7[_0x5842('0x29')]){delete _0x1a26a7[_0x5842('0x29')];}_0x3318fc[_0x5842('0x1d')](_0x45cff4)['send'](_0x1a26a7);};}exports[_0x5842('0x2a')]=function(_0x13fdfe,_0x64ae26){var _0x26c8f6={},_0x283347={},_0x63d95f={'count':0x0,'rows':[]};var _0x2dd3fe=_[_0x5842('0x2b')](db['WhatsappTransferReport'][_0x5842('0x2c')],function(_0x29cc6d){return{'name':_0x29cc6d[_0x5842('0x2d')],'type':_0x29cc6d['type'][_0x5842('0x2e')]};});_0x283347['model']=_[_0x5842('0x2b')](_0x2dd3fe,_0x5842('0x29'));_0x283347[_0x5842('0x2f')]=_['keys'](_0x13fdfe[_0x5842('0x2f')]);_0x283347[_0x5842('0x30')]=_['intersection'](_0x283347['model'],_0x283347[_0x5842('0x2f')]);_0x26c8f6[_0x5842('0x31')]=_['intersection'](_0x283347[_0x5842('0x32')],qs[_0x5842('0x33')](_0x13fdfe[_0x5842('0x2f')]['fields']));_0x26c8f6[_0x5842('0x31')]=_0x26c8f6[_0x5842('0x31')][_0x5842('0x34')]?_0x26c8f6[_0x5842('0x31')]:_0x283347['model'];if(!_0x13fdfe[_0x5842('0x2f')]['hasOwnProperty'](_0x5842('0x35'))){_0x26c8f6[_0x5842('0x22')]=qs[_0x5842('0x22')](_0x13fdfe[_0x5842('0x2f')]['limit']);_0x26c8f6[_0x5842('0x21')]=qs['offset'](_0x13fdfe[_0x5842('0x2f')]['offset']);}_0x26c8f6[_0x5842('0x36')]=qs[_0x5842('0x37')](_0x13fdfe[_0x5842('0x2f')][_0x5842('0x37')]);_0x26c8f6['where']=qs['filters'](_[_0x5842('0x38')](_0x13fdfe[_0x5842('0x2f')],_0x283347['filters']),_0x2dd3fe);if(_0x13fdfe[_0x5842('0x2f')][_0x5842('0x39')]){_0x26c8f6[_0x5842('0x3a')]=_[_0x5842('0x3b')](_0x26c8f6['where'],{'$or':_[_0x5842('0x2b')](_0x2dd3fe,function(_0x1b6833){if(_0x1b6833['type']!==_0x5842('0x3c')){var _0x83f080={};_0x83f080[_0x1b6833[_0x5842('0x29')]]={'$like':'%'+_0x13fdfe['query'][_0x5842('0x39')]+'%'};return _0x83f080;}})});}_0x26c8f6=_[_0x5842('0x3b')]({},_0x26c8f6,_0x13fdfe['options']);var _0x306018={'where':_0x26c8f6[_0x5842('0x3a')]};return db['WhatsappTransferReport'][_0x5842('0x20')](_0x306018)[_0x5842('0x27')](function(_0x326a89){_0x63d95f[_0x5842('0x20')]=_0x326a89;if(_0x13fdfe['query'][_0x5842('0x3d')]){_0x26c8f6[_0x5842('0x3e')]=[{'all':!![]}];}return db[_0x5842('0x3f')][_0x5842('0x40')](_0x26c8f6);})['then'](function(_0x43ef01){_0x63d95f['rows']=_0x43ef01;return _0x63d95f;})['then'](respondWithFilteredResult(_0x64ae26,_0x26c8f6))[_0x5842('0x41')](handleError(_0x64ae26,null));};exports[_0x5842('0x42')]=function(_0xbb8b77,_0x1245bc){var _0x456d17={'raw':!![],'where':{'id':_0xbb8b77[_0x5842('0x43')]['id']}},_0xb05865={};_0xb05865[_0x5842('0x32')]=_['keys'](db[_0x5842('0x3f')]['rawAttributes']);_0xb05865[_0x5842('0x2f')]=_[_0x5842('0x44')](_0xbb8b77[_0x5842('0x2f')]);_0xb05865[_0x5842('0x30')]=_[_0x5842('0x45')](_0xb05865[_0x5842('0x32')],_0xb05865['query']);_0x456d17['attributes']=_[_0x5842('0x45')](_0xb05865[_0x5842('0x32')],qs[_0x5842('0x33')](_0xbb8b77[_0x5842('0x2f')][_0x5842('0x33')]));_0x456d17[_0x5842('0x31')]=_0x456d17[_0x5842('0x31')][_0x5842('0x34')]?_0x456d17[_0x5842('0x31')]:_0xb05865[_0x5842('0x32')];if(_0xbb8b77[_0x5842('0x2f')][_0x5842('0x3d')]){_0x456d17['include']=[{'all':!![]}];}_0x456d17=_[_0x5842('0x3b')]({},_0x456d17,_0xbb8b77[_0x5842('0x46')]);return db[_0x5842('0x3f')][_0x5842('0x47')](_0x456d17)['then'](handleEntityNotFound(_0x1245bc,null))[_0x5842('0x27')](respondWithResult(_0x1245bc,null))['catch'](handleError(_0x1245bc,null));};exports[_0x5842('0x48')]=function(_0x44442e,_0x30c825){return db[_0x5842('0x3f')]['create'](_0x44442e[_0x5842('0x49')],{})[_0x5842('0x27')](respondWithResult(_0x30c825,0xc9))[_0x5842('0x41')](handleError(_0x30c825,null));};exports[_0x5842('0x4a')]=function(_0x217f62,_0x376003){if(_0x217f62[_0x5842('0x49')]['id']){delete _0x217f62[_0x5842('0x49')]['id'];}return db[_0x5842('0x3f')][_0x5842('0x47')]({'where':{'id':_0x217f62['params']['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x376003,null))[_0x5842('0x27')](saveUpdates(_0x217f62[_0x5842('0x49')],null))['then'](respondWithResult(_0x376003,null))['catch'](handleError(_0x376003,null));};exports[_0x5842('0x4b')]=function(_0x73fad5,_0x28bcfd){return db[_0x5842('0x3f')]['find']({'where':{'id':_0x73fad5['params']['id']}})[_0x5842('0x27')](handleEntityNotFound(_0x28bcfd,null))[_0x5842('0x27')](removeEntity(_0x28bcfd,null))[_0x5842('0x41')](handleError(_0x28bcfd,null));};exports[_0x5842('0x4c')]=function(_0x4ef0dd,_0x4d7204){return db[_0x5842('0x3f')]['describe']()[_0x5842('0x27')](respondWithResult(_0x4d7204,null))[_0x5842('0x41')](handleError(_0x4d7204,null));}; \ No newline at end of file +var _0x209e=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','destroy','then','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','describe','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x30194b,_0x319dd7){var _0x149bca=function(_0x1f0b32){while(--_0x1f0b32){_0x30194b['push'](_0x30194b['shift']());}};_0x149bca(++_0x319dd7);}(_0x209e,0x89));var _0xe209=function(_0x1c0ab7,_0x5e1325){_0x1c0ab7=_0x1c0ab7-0x0;var _0x38bc9c=_0x209e[_0x1c0ab7];return _0x38bc9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe209('0x0'));var zipdir=require(_0xe209('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe209('0x2'));var Mustache=require(_0xe209('0x3'));var util=require('util');var path=require(_0xe209('0x4'));var sox=require(_0xe209('0x5'));var csv=require(_0xe209('0x6'));var ejs=require(_0xe209('0x7'));var fs=require('fs');var fs_extra=require(_0xe209('0x8'));var _=require('lodash');var squel=require(_0xe209('0x9'));var crypto=require(_0xe209('0xa'));var jsforce=require(_0xe209('0xb'));var deskjs=require(_0xe209('0xc'));var toCsv=require(_0xe209('0x6'));var querystring=require('querystring');var Papa=require(_0xe209('0xd'));var Redis=require(_0xe209('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe209('0xf'));var hardwareService=require(_0xe209('0x10'));var logger=require(_0xe209('0x11'))('api');var utils=require(_0xe209('0x12'));var config=require(_0xe209('0x13'));var licenseUtil=require(_0xe209('0x14'));var db=require(_0xe209('0x15'))['db'];function respondWithStatusCode(_0x167594,_0x8bc0c4){_0x8bc0c4=_0x8bc0c4||0xcc;return function(_0x133246){if(_0x133246){return _0x167594[_0xe209('0x16')](_0x8bc0c4);}return _0x167594[_0xe209('0x17')](_0x8bc0c4)[_0xe209('0x18')]();};}function respondWithResult(_0x24930,_0x45663f){_0x45663f=_0x45663f||0xc8;return function(_0x35d713){if(_0x35d713){return _0x24930['status'](_0x45663f)[_0xe209('0x19')](_0x35d713);}};}function respondWithFilteredResult(_0x3278b9,_0x2746ec){return function(_0x496fa1){if(_0x496fa1){var _0x27516a=typeof _0x2746ec[_0xe209('0x1a')]===_0xe209('0x1b')&&typeof _0x2746ec['limit']==='undefined';var _0x1298fe=_0x496fa1[_0xe209('0x1c')];var _0x3a6622=_0x27516a?0x0:_0x2746ec['offset'];var _0x17e472=_0x27516a?_0x496fa1[_0xe209('0x1c')]:_0x2746ec[_0xe209('0x1a')]+_0x2746ec[_0xe209('0x1d')];var _0x1a3d80;if(_0x17e472>=_0x1298fe){_0x17e472=_0x1298fe;_0x1a3d80=0xc8;}else{_0x1a3d80=0xce;}_0x3278b9[_0xe209('0x17')](_0x1a3d80);return _0x3278b9['set'](_0xe209('0x1e'),_0x3a6622+'-'+_0x17e472+'/'+_0x1298fe)['json'](_0x496fa1);}return null;};}function patchUpdates(_0x2a33a3){return function(_0x2ee7b3){try{jsonpatch['apply'](_0x2ee7b3,_0x2a33a3,!![]);}catch(_0x206602){return BPromise['reject'](_0x206602);}return _0x2ee7b3[_0xe209('0x1f')]();};}function saveUpdates(_0x3c850a,_0x37a4ad){return function(_0x6c67da){if(_0x6c67da){return _0x6c67da[_0xe209('0x20')](_0x3c850a)['then'](function(_0x47eef9){return _0x47eef9;});}return null;};}function removeEntity(_0xd8e5a3,_0x2e404d){return function(_0x278a68){if(_0x278a68){return _0x278a68[_0xe209('0x21')]()[_0xe209('0x22')](function(){_0xd8e5a3[_0xe209('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cff21,_0x5deac4){return function(_0x36db5c){if(!_0x36db5c){_0x1cff21[_0xe209('0x16')](0x194);}return _0x36db5c;};}function handleError(_0x56ece8,_0x22d72d){_0x22d72d=_0x22d72d||0x1f4;return function(_0x1f6899){logger[_0xe209('0x23')](_0x1f6899[_0xe209('0x24')]);if(_0x1f6899[_0xe209('0x25')]){delete _0x1f6899[_0xe209('0x25')];}_0x56ece8[_0xe209('0x17')](_0x22d72d)[_0xe209('0x26')](_0x1f6899);};}exports[_0xe209('0x27')]=function(_0x217bc8,_0x54c6ec){var _0x46f66b={},_0x4ca443={},_0x49a4de={'count':0x0,'rows':[]};var _0x549c6f=_['map'](db[_0xe209('0x28')][_0xe209('0x29')],function(_0x2fd8a3){return{'name':_0x2fd8a3[_0xe209('0x2a')],'type':_0x2fd8a3['type'][_0xe209('0x2b')]};});_0x4ca443['model']=_[_0xe209('0x2c')](_0x549c6f,_0xe209('0x25'));_0x4ca443[_0xe209('0x2d')]=_[_0xe209('0x2e')](_0x217bc8['query']);_0x4ca443[_0xe209('0x2f')]=_[_0xe209('0x30')](_0x4ca443['model'],_0x4ca443[_0xe209('0x2d')]);_0x46f66b[_0xe209('0x31')]=_[_0xe209('0x30')](_0x4ca443[_0xe209('0x32')],qs[_0xe209('0x33')](_0x217bc8['query'][_0xe209('0x33')]));_0x46f66b[_0xe209('0x31')]=_0x46f66b[_0xe209('0x31')]['length']?_0x46f66b[_0xe209('0x31')]:_0x4ca443[_0xe209('0x32')];if(!_0x217bc8[_0xe209('0x2d')]['hasOwnProperty'](_0xe209('0x34'))){_0x46f66b[_0xe209('0x1d')]=qs[_0xe209('0x1d')](_0x217bc8[_0xe209('0x2d')][_0xe209('0x1d')]);_0x46f66b['offset']=qs[_0xe209('0x1a')](_0x217bc8['query'][_0xe209('0x1a')]);}_0x46f66b[_0xe209('0x35')]=qs[_0xe209('0x36')](_0x217bc8[_0xe209('0x2d')]['sort']);_0x46f66b[_0xe209('0x37')]=qs[_0xe209('0x2f')](_[_0xe209('0x38')](_0x217bc8['query'],_0x4ca443[_0xe209('0x2f')]),_0x549c6f);if(_0x217bc8[_0xe209('0x2d')][_0xe209('0x39')]){_0x46f66b[_0xe209('0x37')]=_[_0xe209('0x3a')](_0x46f66b[_0xe209('0x37')],{'$or':_[_0xe209('0x2c')](_0x549c6f,function(_0xfc8c55){if(_0xfc8c55[_0xe209('0x3b')]!==_0xe209('0x3c')){var _0x190b18={};_0x190b18[_0xfc8c55['name']]={'$like':'%'+_0x217bc8['query'][_0xe209('0x39')]+'%'};return _0x190b18;}})});}_0x46f66b=_[_0xe209('0x3a')]({},_0x46f66b,_0x217bc8[_0xe209('0x3d')]);var _0x520d5d={'where':_0x46f66b[_0xe209('0x37')]};return db[_0xe209('0x28')][_0xe209('0x1c')](_0x520d5d)['then'](function(_0x193e86){_0x49a4de[_0xe209('0x1c')]=_0x193e86;if(_0x217bc8[_0xe209('0x2d')][_0xe209('0x3e')]){_0x46f66b[_0xe209('0x3f')]=[{'all':!![]}];}return db[_0xe209('0x28')][_0xe209('0x40')](_0x46f66b);})['then'](function(_0x366665){_0x49a4de[_0xe209('0x41')]=_0x366665;return _0x49a4de;})['then'](respondWithFilteredResult(_0x54c6ec,_0x46f66b))[_0xe209('0x42')](handleError(_0x54c6ec,null));};exports[_0xe209('0x43')]=function(_0x215e96,_0x2b9895){var _0x24cbd6={'raw':!![],'where':{'id':_0x215e96[_0xe209('0x44')]['id']}},_0x3f3be0={};_0x3f3be0[_0xe209('0x32')]=_[_0xe209('0x2e')](db[_0xe209('0x28')][_0xe209('0x29')]);_0x3f3be0[_0xe209('0x2d')]=_[_0xe209('0x2e')](_0x215e96[_0xe209('0x2d')]);_0x3f3be0[_0xe209('0x2f')]=_[_0xe209('0x30')](_0x3f3be0['model'],_0x3f3be0[_0xe209('0x2d')]);_0x24cbd6[_0xe209('0x31')]=_[_0xe209('0x30')](_0x3f3be0[_0xe209('0x32')],qs[_0xe209('0x33')](_0x215e96[_0xe209('0x2d')][_0xe209('0x33')]));_0x24cbd6[_0xe209('0x31')]=_0x24cbd6[_0xe209('0x31')][_0xe209('0x45')]?_0x24cbd6[_0xe209('0x31')]:_0x3f3be0['model'];if(_0x215e96['query']['includeAll']){_0x24cbd6[_0xe209('0x3f')]=[{'all':!![]}];}_0x24cbd6=_[_0xe209('0x3a')]({},_0x24cbd6,_0x215e96[_0xe209('0x3d')]);return db[_0xe209('0x28')]['find'](_0x24cbd6)[_0xe209('0x22')](handleEntityNotFound(_0x2b9895,null))[_0xe209('0x22')](respondWithResult(_0x2b9895,null))[_0xe209('0x42')](handleError(_0x2b9895,null));};exports[_0xe209('0x46')]=function(_0x3d429a,_0x449653){return db[_0xe209('0x28')]['create'](_0x3d429a['body'],{})[_0xe209('0x22')](respondWithResult(_0x449653,0xc9))[_0xe209('0x42')](handleError(_0x449653,null));};exports[_0xe209('0x20')]=function(_0x5491eb,_0x3c2140){if(_0x5491eb[_0xe209('0x47')]['id']){delete _0x5491eb[_0xe209('0x47')]['id'];}return db[_0xe209('0x28')]['find']({'where':{'id':_0x5491eb[_0xe209('0x44')]['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x3c2140,null))[_0xe209('0x22')](saveUpdates(_0x5491eb[_0xe209('0x47')],null))['then'](respondWithResult(_0x3c2140,null))['catch'](handleError(_0x3c2140,null));};exports[_0xe209('0x21')]=function(_0x35f2f7,_0x4cc8d8){return db[_0xe209('0x28')]['find']({'where':{'id':_0x35f2f7['params']['id']}})[_0xe209('0x22')](handleEntityNotFound(_0x4cc8d8,null))['then'](removeEntity(_0x4cc8d8,null))[_0xe209('0x42')](handleError(_0x4cc8d8,null));};exports[_0xe209('0x48')]=function(_0x50e2fa,_0x2d7e1a){return db[_0xe209('0x28')]['describe']()[_0xe209('0x22')](respondWithResult(_0x2d7e1a,null))[_0xe209('0x42')](handleError(_0x2d7e1a,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index f7611e8..7455635 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 _0x3924=['./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x553623,_0x498b63){var _0x41bd0b=function(_0x4799e0){while(--_0x4799e0){_0x553623['push'](_0x553623['shift']());}};_0x41bd0b(++_0x498b63);}(_0x3924,0xfc));var _0x4392=function(_0x161a2e,_0x28ad8e){_0x161a2e=_0x161a2e-0x0;var _0x2ba717=_0x3924[_0x161a2e];return _0x2ba717;};'use strict';var _=require(_0x4392('0x0'));var util=require(_0x4392('0x1'));var logger=require(_0x4392('0x2'))('api');var moment=require(_0x4392('0x3'));var BPromise=require(_0x4392('0x4'));var rp=require(_0x4392('0x5'));var fs=require('fs');var path=require(_0x4392('0x6'));var rimraf=require(_0x4392('0x7'));var config=require('../../config/environment');var attributes=require(_0x4392('0x8'));module['exports']=function(_0x1ecd85,_0x5aaebb){return _0x1ecd85[_0x4392('0x9')](_0x4392('0xa'),attributes,{'tableName':_0x4392('0xb'),'paranoid':![],'indexes':[{'name':_0x4392('0xc'),'fields':[_0x4392('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45e0=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','bluebird'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x45e0,0x141));var _0x045e=function(_0x4e49af,_0x88e71){_0x4e49af=_0x4e49af-0x0;var _0x8cc12c=_0x45e0[_0x4e49af];return _0x8cc12c;};'use strict';var _=require(_0x045e('0x0'));var util=require(_0x045e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x045e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x045e('0x3'));var rimraf=require(_0x045e('0x4'));var config=require(_0x045e('0x5'));var attributes=require(_0x045e('0x6'));module[_0x045e('0x7')]=function(_0x9966ed,_0x3b58e0){return _0x9966ed[_0x045e('0x8')](_0x045e('0x9'),attributes,{'tableName':_0x045e('0xa'),'paranoid':![],'indexes':[{'name':_0x045e('0xb'),'fields':[_0x045e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 07c3242..a343d3b 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 _0x1b45=['WhatsappTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x1b45,0x96));var _0x51b4=function(_0x49fcfc,_0x104175){_0x49fcfc=_0x49fcfc-0x0;var _0x4ab162=_0x1b45[_0x49fcfc];return _0x4ab162;};'use strict';var _=require(_0x51b4('0x0'));var util=require(_0x51b4('0x1'));var moment=require(_0x51b4('0x2'));var BPromise=require(_0x51b4('0x3'));var rs=require(_0x51b4('0x4'));var fs=require('fs');var Redis=require(_0x51b4('0x5'));var db=require(_0x51b4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x51b4('0x7'))('rpc');var config=require(_0x51b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x51b4('0x9')][_0x51b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43ba9f,_0x489864,_0x3d1d06){return new BPromise(function(_0x13c2df,_0x3f2693){return client[_0x51b4('0xb')](_0x43ba9f,_0x3d1d06)[_0x51b4('0xc')](function(_0x1fbe02){logger[_0x51b4('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x489864,_0x51b4('0xe'));logger['debug'](_0x51b4('0xf'),_0x489864,_0x51b4('0xe'),JSON[_0x51b4('0x10')](_0x1fbe02));if(_0x1fbe02['error']){if(_0x1fbe02[_0x51b4('0x11')]['code']===0x1f4){logger[_0x51b4('0x11')](_0x51b4('0x12'),_0x489864,_0x1fbe02[_0x51b4('0x11')][_0x51b4('0x13')]);return _0x3f2693(_0x1fbe02[_0x51b4('0x11')][_0x51b4('0x13')]);}logger[_0x51b4('0x11')](_0x51b4('0x12'),_0x489864,_0x1fbe02['error'][_0x51b4('0x13')]);return _0x13c2df(_0x1fbe02[_0x51b4('0x11')][_0x51b4('0x13')]);}else{logger[_0x51b4('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x489864,'request\x20sent');_0x13c2df(_0x1fbe02[_0x51b4('0x14')][_0x51b4('0x13')]);}})['catch'](function(_0x3ce994){logger[_0x51b4('0x11')](_0x51b4('0x12'),_0x489864,_0x3ce994);_0x3f2693(_0x3ce994);});});} \ No newline at end of file +var _0xe470=['then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x450f00,_0xbc4229){var _0x5b5ba1=function(_0x5dbfa4){while(--_0x5dbfa4){_0x450f00['push'](_0x450f00['shift']());}};_0x5b5ba1(++_0xbc4229);}(_0xe470,0x120));var _0x0e47=function(_0x54bd67,_0x2c6b89){_0x54bd67=_0x54bd67-0x0;var _0x35de73=_0xe470[_0x54bd67];return _0x35de73;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e47('0x0'));var BPromise=require(_0x0e47('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e47('0x2'));var db=require(_0x0e47('0x3'))['db'];var utils=require(_0x0e47('0x4'));var logger=require(_0x0e47('0x5'))(_0x0e47('0x6'));var config=require(_0x0e47('0x7'));var jayson=require(_0x0e47('0x8'));var client=jayson[_0x0e47('0x9')][_0x0e47('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235f8b,_0x211672,_0xaa3055){return new BPromise(function(_0x2c16c4,_0x1d0777){return client[_0x0e47('0xb')](_0x235f8b,_0xaa3055)[_0x0e47('0xc')](function(_0x5dc587){logger[_0x0e47('0xd')](_0x0e47('0xe'),_0x211672,'request\x20sent');logger['debug'](_0x0e47('0xf'),_0x211672,_0x0e47('0x10'),JSON['stringify'](_0x5dc587));if(_0x5dc587[_0x0e47('0x11')]){if(_0x5dc587[_0x0e47('0x11')][_0x0e47('0x12')]===0x1f4){logger['error'](_0x0e47('0xe'),_0x211672,_0x5dc587['error'][_0x0e47('0x13')]);return _0x1d0777(_0x5dc587[_0x0e47('0x11')][_0x0e47('0x13')]);}logger[_0x0e47('0x11')](_0x0e47('0xe'),_0x211672,_0x5dc587[_0x0e47('0x11')][_0x0e47('0x13')]);return _0x2c16c4(_0x5dc587[_0x0e47('0x11')][_0x0e47('0x13')]);}else{logger[_0x0e47('0xd')](_0x0e47('0xe'),_0x211672,_0x0e47('0x10'));_0x2c16c4(_0x5dc587['result'][_0x0e47('0x13')]);}})['catch'](function(_0x3a2da1){logger[_0x0e47('0x11')](_0x0e47('0xe'),_0x211672,_0x3a2da1);_0x1d0777(_0x3a2da1);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 2fe9128..27c3c4f 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5419=['seedDB','listen','info','start','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','filter','online','Offline\x20apps:','status','join','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then'];(function(_0x29d1b1,_0x14c1c0){var _0x137543=function(_0x38966f){while(--_0x38966f){_0x29d1b1['push'](_0x29d1b1['shift']());}};_0x137543(++_0x14c1c0);}(_0x5419,0x175));var _0x9541=function(_0xfae941,_0x31dc68){_0xfae941=_0xfae941-0x0;var _0xd21834=_0x5419[_0xfae941];return _0xd21834;};'use strict';var _=require(_0x9541('0x0'));var db=require(_0x9541('0x1'))['db'];var seedDb=require(_0x9541('0x2'));var checkLicense=require(_0x9541('0x3'));var rpc=require(_0x9541('0x4'));var config=require(_0x9541('0x5'));var logger=require(_0x9541('0x6'))(_0x9541('0x7'));var pm2=require(_0x9541('0x8'));var pm2Config=require(_0x9541('0x9'));var schedule=require('./config/schedule');var chat=require(_0x9541('0xa'));var whatsapp=require(_0x9541('0xb'));var transcribe=require(_0x9541('0xc'));var provider=require(_0x9541('0xd'));function main(){return db[_0x9541('0xe')][_0x9541('0xf')]()[_0x9541('0x10')](function(){if(config[_0x9541('0x11')]){return seedDb['default']();}})[_0x9541('0x10')](function(){return checkLicense['default']();})[_0x9541('0x10')](function(){return rpc[_0x9541('0x12')]();})[_0x9541('0x10')](function(_0x46dd8a){logger[_0x9541('0x13')](_0x46dd8a);return chat[_0x9541('0x14')]();})[_0x9541('0x10')](function(){return whatsapp['start']();})[_0x9541('0x10')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x9541('0x14')]();})['then'](function(){return provider[_0x9541('0x14')]();})['then'](function(_0x1a733a){logger[_0x9541('0x13')](_0x1a733a);return pm2[_0x9541('0x14')](pm2Config);})[_0x9541('0x10')](function(_0x28316e){var _0x4114bf=_0x28316e['filter'](function(_0x37a48e){return typeof _0x37a48e['exitCode']===_0x9541('0x15')&&_0x37a48e['exitCode']>=0x0;});if(_0x4114bf[_0x9541('0x16')]>0x0){throw new Error(_0x4114bf['length']+_0x9541('0x17')+_[_0x9541('0x18')](_0x4114bf,function(_0xcc7699){return'\x22'+_0xcc7699[_0x9541('0x19')][_0x9541('0x1a')]+'\x22';}));}logger[_0x9541('0x13')]('Online\x20apps:',_['map'](_[_0x9541('0x1b')](_0x28316e,{'status':_0x9541('0x1c')}),'name')['join']());logger[_0x9541('0x13')](_0x9541('0x1d'),_[_0x9541('0x18')](_[_0x9541('0x1b')](_0x28316e,function(_0xfbcffc){return _0xfbcffc[_0x9541('0x1e')]!==_0x9541('0x1c');}),_0x9541('0x1a'))[_0x9541('0x1f')]()||_0x9541('0x20'));console[_0x9541('0x21')]('App\x20Ready!');})[_0x9541('0x22')](function(_0xd894d4){console[_0x9541('0x21')](_0x9541('0x23'),_0xd894d4);logger[_0x9541('0x24')](_0x9541('0x25'),_0xd894d4);process[_0x9541('0x26')](0x1);});}main(); \ No newline at end of file +var _0x9330=['sequelize','sync','then','seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','online','join','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/license','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider'];(function(_0x41ed39,_0x53e88f){var _0x396a8b=function(_0x345fb2){while(--_0x345fb2){_0x41ed39['push'](_0x41ed39['shift']());}};_0x396a8b(++_0x53e88f);}(_0x9330,0x14a));var _0x0933=function(_0x515fc3,_0x1b6984){_0x515fc3=_0x515fc3-0x0;var _0x2c7793=_0x9330[_0x515fc3];return _0x2c7793;};'use strict';var _=require(_0x0933('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x0933('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0x0933('0x2'))(_0x0933('0x3'));var pm2=require(_0x0933('0x4'));var pm2Config=require(_0x0933('0x5'));var schedule=require(_0x0933('0x6'));var chat=require(_0x0933('0x7'));var whatsapp=require(_0x0933('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x0933('0x9'));function main(){return db[_0x0933('0xa')][_0x0933('0xb')]()[_0x0933('0xc')](function(){if(config[_0x0933('0xd')]){return seedDb[_0x0933('0xe')]();}})[_0x0933('0xc')](function(){return checkLicense[_0x0933('0xe')]();})[_0x0933('0xc')](function(){return rpc[_0x0933('0xf')]();})[_0x0933('0xc')](function(_0x30bbf8){logger[_0x0933('0x10')](_0x30bbf8);return chat[_0x0933('0x11')]();})['then'](function(){return whatsapp['start']();})['then'](function(){return schedule['start']();})[_0x0933('0xc')](function(){return transcribe['start']();})['then'](function(){return provider['start']();})[_0x0933('0xc')](function(_0x36fe3c){logger['info'](_0x36fe3c);return pm2[_0x0933('0x11')](pm2Config);})[_0x0933('0xc')](function(_0x5cb5ba){var _0x54bdd4=_0x5cb5ba[_0x0933('0x12')](function(_0xb019db){return typeof _0xb019db['exitCode']===_0x0933('0x13')&&_0xb019db[_0x0933('0x14')]>=0x0;});if(_0x54bdd4[_0x0933('0x15')]>0x0){throw new Error(_0x54bdd4[_0x0933('0x15')]+_0x0933('0x16')+_[_0x0933('0x17')](_0x54bdd4,function(_0x536799){return'\x22'+_0x536799['pm2_env'][_0x0933('0x18')]+'\x22';}));}logger[_0x0933('0x10')](_0x0933('0x19'),_[_0x0933('0x17')](_[_0x0933('0x12')](_0x5cb5ba,{'status':_0x0933('0x1a')}),_0x0933('0x18'))[_0x0933('0x1b')]());logger[_0x0933('0x10')]('Offline\x20apps:',_['map'](_[_0x0933('0x12')](_0x5cb5ba,function(_0x5a5eae){return _0x5a5eae[_0x0933('0x1c')]!==_0x0933('0x1a');}),'name')[_0x0933('0x1b')]()||_0x0933('0x1d'));console[_0x0933('0x1e')]('App\x20Ready!');})[_0x0933('0x1f')](function(_0x28f723){console[_0x0933('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x28f723);logger['error'](_0x0933('0x20'),_0x28f723);process[_0x0933('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 65538ca..accc3dd 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 _0xdd4f=['allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User\x20object\x20not\x20found.','getLicense','Forbidden','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','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','split','length','splice','unshift','encryptString','promisify','sign','secret','payload','options','verify','toString','hex','floor','now','HS512','../../mysqldb','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session','fullname','internal','email','userpic','md5secret','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','disposition','then','closed','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','find','authenticate','pass','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5d3f61,_0x2073e7){_0x5d3f61=_0x5d3f61-0x0;var _0x3ba397=_0xdd4f[_0x5d3f61];return _0x3ba397;};'use strict';var db=require(_0xfdd4('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xfdd4('0x1'));var _=require(_0xfdd4('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xfdd4('0x3'));var compose=require(_0xfdd4('0x4'));var basicAuth=require(_0xfdd4('0x5'));var crypto=require('crypto');var BPromise=require(_0xfdd4('0x6'));var util=require(_0xfdd4('0x7'));var moment=require(_0xfdd4('0x8'));var validateJwt=expressJwt({'secret':config[_0xfdd4('0x9')][_0xfdd4('0xa')]});var userAttributes=['id','role',_0xfdd4('0xb'),'name',_0xfdd4('0xc'),_0xfdd4('0xd'),_0xfdd4('0xe'),'permissions',_0xfdd4('0xf'),'voicePause',_0xfdd4('0x10'),_0xfdd4('0x11'),_0xfdd4('0x12'),_0xfdd4('0x13'),_0xfdd4('0x14'),_0xfdd4('0x15'),_0xfdd4('0x16'),_0xfdd4('0x17'),_0xfdd4('0x18'),_0xfdd4('0x19'),_0xfdd4('0x1a'),'passwordResetAt',_0xfdd4('0x1b'),_0xfdd4('0x1c'),_0xfdd4('0x1d'),'phoneBarDnd',_0xfdd4('0x1e'),'phoneBarEnableDtmfTone',_0xfdd4('0x1f'),_0xfdd4('0x20'),_0xfdd4('0x21'),_0xfdd4('0x22'),_0xfdd4('0x23'),'hotdesk','interface','userProfileId',_0xfdd4('0x24'),_0xfdd4('0x25'),_0xfdd4('0x26'),_0xfdd4('0x27'),_0xfdd4('0x28'),_0xfdd4('0x29'),_0xfdd4('0x2a'),_0xfdd4('0x2b'),_0xfdd4('0x2c'),'chatAutoanswerDelay',_0xfdd4('0x2d'),_0xfdd4('0x2e'),_0xfdd4('0x2f'),_0xfdd4('0x30'),_0xfdd4('0x31'),_0xfdd4('0x32'),_0xfdd4('0x33'),_0xfdd4('0x34'),'whatsappAutoanswer',_0xfdd4('0x35'),_0xfdd4('0x36')];exports[_0xfdd4('0x37')]=function(){return this[_0xfdd4('0x38')](!![])[_0xfdd4('0x39')](function(_0x144acd,_0x451767,_0x277ec1){if(_0x144acd['user']){_0x277ec1();}else{return db[_0xfdd4('0x3a')][_0xfdd4('0x3b')]({'where':{'id':_0x144acd[_0xfdd4('0x3c')]['id']},'attributes':['id','closed',_0xfdd4('0x3d')],'raw':!![]})[_0xfdd4('0x3e')](function(_0xf9c346){if(_0xf9c346&&_0xf9c346[_0xfdd4('0x3f')]){return _0x451767[_0xfdd4('0x40')](_0xf9c346['disposition']===_0xfdd4('0x41')?0x195:0x193)[_0xfdd4('0x42')]({'message':_0xf9c346[_0xfdd4('0x3d')]===_0xfdd4('0x41')?_0xfdd4('0x43'):_0xfdd4('0x44')});}else{_0x277ec1();}})[_0xfdd4('0x45')](function(_0x37b7a2){_0x277ec1(_0x37b7a2);});}});};exports['isAuthenticated']=function isAuthenticated(_0xcbd1fb){return compose()[_0xfdd4('0x39')](function(_0x385a68,_0xef012e,_0x2207ae){var _0x4a36a2;if(_0x385a68[_0xfdd4('0x46')][_0xfdd4('0x47')]){if(_[_0xfdd4('0x48')](_0x385a68[_0xfdd4('0x46')][_0xfdd4('0x47')],'Basic')){var _0x374e98=basicAuth(_0x385a68);db[_0xfdd4('0x49')][_0xfdd4('0x4a')]({'where':{'name':_0x374e98['name']}})[_0xfdd4('0x3e')](function(_0x502776){if(!_0x502776||!_0x502776[_0xfdd4('0x4b')](_0x374e98[_0xfdd4('0x4c')])){return _0xef012e['status'](0x191)['json']({'message':_0xfdd4('0x4d')});}_0x385a68[_0xfdd4('0x4e')]={'id':_0x502776['id']};_0x2207ae();})['catch'](function(_0x557d7b){_0x2207ae(_0x557d7b);});}else if(_[_0xfdd4('0x48')](_0x385a68[_0xfdd4('0x46')][_0xfdd4('0x47')],_0xfdd4('0x4f'))){validateJwt(_0x385a68,_0xef012e,_0x2207ae);}else{if(_0xcbd1fb){_0x2207ae();}else{return _0xef012e[_0xfdd4('0x40')](0x193)[_0xfdd4('0x42')]({'message':_0xfdd4('0x50')});}}}else if(_0x385a68[_0xfdd4('0x51')][_0xfdd4('0x52')]){try{var _0x457ab5={'audience':hardwareConf[_0xfdd4('0x53')](),'issuer':hardwareConf[_0xfdd4('0x53')]()};verifyJwt(_0x385a68[_0xfdd4('0x51')][_0xfdd4('0x52')],_0x457ab5)[_0xfdd4('0x3e')](function(_0x3f5c5a){return db[_0xfdd4('0x49')][_0xfdd4('0x4a')]({'where':{'id':_0x3f5c5a[_0xfdd4('0x54')]}})[_0xfdd4('0x3e')](function(_0xc9549b){_0x4a36a2=_0xc9549b;return db[_0xfdd4('0x55')][_0xfdd4('0x3b')]({'where':{'id':0x1},'attributes':[_0xfdd4('0x56'),_0xfdd4('0x57')],'raw':!![]});})[_0xfdd4('0x3e')](function(_0x5348a6){if(!_0x4a36a2||!_[_0xfdd4('0x58')](_0x4a36a2[_0xfdd4('0x59')],_0x3f5c5a[_0xfdd4('0x5a')])){return _0xef012e[_0xfdd4('0x40')](0x191)[_0xfdd4('0x42')]({'message':_0xfdd4('0x5b')});}if(_0x4a36a2['disabled']){return _0xef012e[_0xfdd4('0x40')](0x191)['json']({'message':_0xfdd4('0x5c')});}if(_0x4a36a2[_0xfdd4('0x5d')]){if(_0x5348a6[_0xfdd4('0x57')]>0x0){if(moment(_0x4a36a2[_0xfdd4('0x5e')])['add'](_0x5348a6[_0xfdd4('0x57')],_0xfdd4('0x5f'))>moment()){return _0xef012e[_0xfdd4('0x40')](0x191)[_0xfdd4('0x42')]({'message':_0xfdd4('0x5c')});}}else{return _0xef012e[_0xfdd4('0x40')](0x191)[_0xfdd4('0x42')]({'message':_0xfdd4('0x5c')});}}_0x385a68[_0xfdd4('0x4e')]={'id':_0x4a36a2['id']};_0x2207ae();});})[_0xfdd4('0x45')](function(){return _0xef012e['status'](0x191)[_0xfdd4('0x42')]({'message':_0xfdd4('0x5c')});});}catch(_0x210a15){_0x2207ae(_0x210a15);}}else if(_0xcbd1fb){_0x2207ae();}else{return _0xef012e[_0xfdd4('0x40')](0x193)['json']({'message':_0xfdd4('0x50')});}})[_0xfdd4('0x39')](function(_0x30524f,_0x2341e5,_0x362c4f){if(_0x30524f['user']){db[_0xfdd4('0x49')][_0xfdd4('0x4a')]({'where':{'id':_0x30524f[_0xfdd4('0x4e')]['id']},'attributes':userAttributes})[_0xfdd4('0x3e')](function(_0x912520){if(!_0x912520){return _0x2341e5[_0xfdd4('0x40')](0x194)[_0xfdd4('0x42')]({'message':'User\x20not\x20found.'});}_0x30524f[_0xfdd4('0x4e')]=_0x912520;_0x362c4f();})['catch'](function(_0x3a0de9){_0x362c4f(_0x3a0de9);});}else if(_0xcbd1fb){_0x362c4f();}else{return _0x2341e5[_0xfdd4('0x40')](0x194)[_0xfdd4('0x42')]({'message':_0xfdd4('0x60')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xfdd4('0x39')](function(_0x11e90a,_0x4d1dfe,_0x2916ea){return licenseUtil[_0xfdd4('0x61')]()['then'](function(_0x218ca5){if(_0x218ca5['update']){_0x2916ea();}else{return _0x4d1dfe['status'](0x193)['json']({'message':_0xfdd4('0x62')});}})[_0xfdd4('0x45')](function(_0xc3933e){_0x2916ea(_0xc3933e);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xfdd4('0x39')](function(_0x169d72,_0x4d11d1,_0x25e3c9){return licenseUtil[_0xfdd4('0x61')]()[_0xfdd4('0x3e')](function(_0x2bb94a){if(_0x2bb94a[_0xfdd4('0x63')]){_0x25e3c9();}else{return _0x4d11d1[_0xfdd4('0x40')](0x193)[_0xfdd4('0x42')]({'message':_0xfdd4('0x62')});}})[_0xfdd4('0x45')](function(_0xe82eff){_0x25e3c9(_0xe82eff);});});};exports[_0xfdd4('0x64')]=function(_0x2aab84,_0x300965,_0x3c0ee1){_0x2aab84['isMiddleware']=!![];return _0x3c0ee1();};exports['signToken']=function signToken(_0x43e631){return signJwt(_0x43e631);};exports[_0xfdd4('0x65')]=function(_0x1296e6,_0x1932ef){if(!_0x1296e6['user']){return _0x1932ef[_0xfdd4('0x40')](0x194)[_0xfdd4('0x42')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x58cdab={'payload':{'id':_0x1296e6['user']['id'],'role':_0x1296e6['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x58cdab)[_0xfdd4('0x3e')](function(_0x88e9ef){_0x1932ef[_0xfdd4('0x66')](_0xfdd4('0x67'),_0x88e9ef);_0x1932ef[_0xfdd4('0x68')](_0xfdd4('0x69'));})['catch'](function(_0x17bbab){return _0x1932ef[_0xfdd4('0x40')](0x1f4)[_0xfdd4('0x6a')](_0x17bbab);});};exports[_0xfdd4('0x6b')]=function(_0x4e790d){if(_[_0xfdd4('0x6c')](_0x4e790d[_0xfdd4('0x59')])||_['isNil'](_0x4e790d[_0xfdd4('0x6d')])){return null;}else{return createJwt(_0x4e790d);}};exports[_0xfdd4('0x6e')]=function(_0x555e50){_0x555e50['apiKeyNonce']=generateNonce();_0x555e50[_0xfdd4('0x6d')]=generateIssuedAt();return createJwt(_0x555e50);};exports[_0xfdd4('0x6f')]=function(_0x18f071,_0x30ce95){var _0xce9f02=_0x18f071[_0xfdd4('0x51')][_0xfdd4('0x52')];if(_0xce9f02){var _0x3de4fd={'nonce':_0x30ce95['apiKeyNonce'],'iat':_0x30ce95[_0xfdd4('0x6d')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xce9f02,_0x3de4fd)[_0xfdd4('0x3e')](function(){return generateApiKey(_0x30ce95);});}else{throw{'message':_0xfdd4('0x70')};}};exports['validatePasswordPattern']=function(_0x4f2160){var _0x4df9d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4df9d4[_0xfdd4('0x71')](_0x4f2160))throw new db[(_0xfdd4('0x72'))]['ValidationError'](_0xfdd4('0x73'));return;};exports[_0xfdd4('0x74')]=function(_0x466b75,_0xe6c601,_0x24d995){var _0x52887d=encryptor['decryptString'](_0xe6c601)['split'](',');for(var _0x5d0136=0x0;_0x5d0136<_0x24d995;_0x5d0136++){if(!_0x52887d[_0x5d0136])break;if(_0x466b75[_0xfdd4('0x75')]()===_0x52887d[_0x5d0136][_0xfdd4('0x75')]()){var _0x5ddc25=util[_0xfdd4('0x76')](_0xfdd4('0x77'),_0x24d995);if(_0x24d995===0x1){_0x5ddc25='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xfdd4('0x72'))][(_0xfdd4('0x78'))](_0x5ddc25);}}return;};exports['updatePasswordsHistory']=function(_0x1497ff,_0x2b7081){var _0xd4e5e4=_0x2b7081?encryptor['decryptString'](_0x2b7081)[_0xfdd4('0x79')](','):[];if(_0xd4e5e4[_0xfdd4('0x7a')]===0x5){_0xd4e5e4[_0xfdd4('0x7b')](-0x1,0x1);}_0xd4e5e4[_0xfdd4('0x7c')](_0x1497ff);return encryptor[_0xfdd4('0x7d')](_0xd4e5e4['join'](','));};function signJwt(_0x2cc3e2){var _0x2ee4b6=BPromise[_0xfdd4('0x7e')](jwt[_0xfdd4('0x7f')],{'context':jwt});var _0x3dd05c=_0x2cc3e2[_0xfdd4('0x80')]||config[_0xfdd4('0x9')][_0xfdd4('0xa')];return new BPromise(function(_0x38b58b,_0x5e0a1c){_0x2ee4b6(_0x2cc3e2[_0xfdd4('0x81')],_0x3dd05c,_0x2cc3e2[_0xfdd4('0x82')])[_0xfdd4('0x3e')](function(_0x2ad8e8){_0x38b58b(_0x2ad8e8);})[_0xfdd4('0x45')](function(_0x593f5c){_0x5e0a1c(_0x593f5c);});});}function verifyJwt(_0x46e7eb,_0x3b809a,_0x255175){var _0x12e917=BPromise[_0xfdd4('0x7e')](jwt[_0xfdd4('0x83')],{'context':jwt});var _0x180ad9=_0x255175||config[_0xfdd4('0x9')][_0xfdd4('0xa')];return new BPromise(function(_0x2a0dd8,_0x2fff30){_0x12e917(_0x46e7eb,_0x180ad9,_0x3b809a)[_0xfdd4('0x3e')](function(_0x1205b8){_0x2a0dd8(_0x1205b8);})['catch'](function(_0xb9d86a){_0x2fff30(_0xb9d86a);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xfdd4('0x84')](_0xfdd4('0x85'));}function generateIssuedAt(){return Math[_0xfdd4('0x86')](Date[_0xfdd4('0x87')]()/0x3e8)[_0xfdd4('0x84')]();}function createJwt(_0x3a89a4){var _0xea89a1={'payload':{'iat':_0x3a89a4[_0xfdd4('0x6d')],'nonce':_0x3a89a4[_0xfdd4('0x59')]},'options':{'algorithm':_0xfdd4('0x88'),'subject':_0x3a89a4['id'][_0xfdd4('0x84')](),'issuer':hardwareConf[_0xfdd4('0x53')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xea89a1)['then'](function(_0x55a566){return{'iat':_0x3a89a4[_0xfdd4('0x6d')],'nonce':_0x3a89a4[_0xfdd4('0x59')],'token':_0x55a566};});} \ No newline at end of file +var _0x9c00=['floor','toString','../../mysqldb','../../config/environment','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','role','fullname','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','find','then','authenticate','pass','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','canUpdate','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','sign','secret','payload','options','promisify','randomBytes','hex'];(function(_0x5b54c5,_0x315d97){var _0x1f5749=function(_0x239e5f){while(--_0x239e5f){_0x5b54c5['push'](_0x5b54c5['shift']());}};_0x1f5749(++_0x315d97);}(_0x9c00,0x1a0));var _0x09c0=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c00[_0x68c979];return _0x4f0001;};'use strict';var db=require(_0x09c0('0x0'))['db'];var config=require(_0x09c0('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x09c0('0x2'));var _=require(_0x09c0('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x09c0('0x4'));var compose=require(_0x09c0('0x5'));var basicAuth=require(_0x09c0('0x6'));var crypto=require(_0x09c0('0x7'));var BPromise=require(_0x09c0('0x8'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x09c0('0x9')][_0x09c0('0xa')]});var userAttributes=['id',_0x09c0('0xb'),_0x09c0('0xc'),_0x09c0('0xd'),'internal',_0x09c0('0xe'),_0x09c0('0xf'),_0x09c0('0x10'),_0x09c0('0x11'),_0x09c0('0x12'),_0x09c0('0x13'),_0x09c0('0x14'),_0x09c0('0x15'),_0x09c0('0x16'),_0x09c0('0x17'),_0x09c0('0x18'),_0x09c0('0x19'),_0x09c0('0x1a'),_0x09c0('0x1b'),_0x09c0('0x1c'),_0x09c0('0x1d'),_0x09c0('0x1e'),_0x09c0('0x1f'),_0x09c0('0x20'),_0x09c0('0x21'),_0x09c0('0x22'),_0x09c0('0x23'),_0x09c0('0x24'),_0x09c0('0x25'),_0x09c0('0x26'),_0x09c0('0x27'),'phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk',_0x09c0('0x28'),_0x09c0('0x29'),_0x09c0('0x2a'),_0x09c0('0x2b'),'wssPort',_0x09c0('0x2c'),'downloadOmnichannelInteractions','downloadAttachments',_0x09c0('0x2d'),'selectRecallMeCampaign',_0x09c0('0x2e'),_0x09c0('0x2f'),_0x09c0('0x30'),'emailAutoanswerDelay',_0x09c0('0x31'),_0x09c0('0x32'),_0x09c0('0x33'),_0x09c0('0x34'),_0x09c0('0x35'),_0x09c0('0x36'),_0x09c0('0x37'),'whatsappAutoanswerDelay',_0x09c0('0x38')];exports[_0x09c0('0x39')]=function(){return this[_0x09c0('0x3a')](!![])[_0x09c0('0x3b')](function(_0x59a76a,_0x4f6824,_0x321bcc){if(_0x59a76a[_0x09c0('0x3c')]){_0x321bcc();}else{return db[_0x09c0('0x3d')][_0x09c0('0x3e')]({'where':{'id':_0x59a76a['params']['id']},'attributes':['id',_0x09c0('0x3f'),_0x09c0('0x40')],'raw':!![]})['then'](function(_0x2c7202){if(_0x2c7202&&_0x2c7202[_0x09c0('0x3f')]){return _0x4f6824[_0x09c0('0x41')](_0x2c7202[_0x09c0('0x40')]===_0x09c0('0x42')?0x195:0x193)[_0x09c0('0x43')]({'message':_0x2c7202[_0x09c0('0x40')]===_0x09c0('0x42')?_0x09c0('0x44'):_0x09c0('0x45')});}else{_0x321bcc();}})[_0x09c0('0x46')](function(_0x5e53ac){_0x321bcc(_0x5e53ac);});}});};exports[_0x09c0('0x3a')]=function isAuthenticated(_0x1bdde9){return compose()['use'](function(_0x1d09e0,_0x5aa0b9,_0x3f5b10){var _0x4d6bdc;if(_0x1d09e0[_0x09c0('0x47')][_0x09c0('0x48')]){if(_[_0x09c0('0x49')](_0x1d09e0[_0x09c0('0x47')]['authorization'],'Basic')){var _0x17c374=basicAuth(_0x1d09e0);db[_0x09c0('0x4a')][_0x09c0('0x4b')]({'where':{'name':_0x17c374['name']}})[_0x09c0('0x4c')](function(_0x4bdae9){if(!_0x4bdae9||!_0x4bdae9[_0x09c0('0x4d')](_0x17c374[_0x09c0('0x4e')])){return _0x5aa0b9[_0x09c0('0x41')](0x191)['json']({'message':_0x09c0('0x4f')});}_0x1d09e0[_0x09c0('0x3c')]={'id':_0x4bdae9['id']};_0x3f5b10();})[_0x09c0('0x46')](function(_0x184c0b){_0x3f5b10(_0x184c0b);});}else if(_[_0x09c0('0x49')](_0x1d09e0[_0x09c0('0x47')][_0x09c0('0x48')],'Bearer')){validateJwt(_0x1d09e0,_0x5aa0b9,_0x3f5b10);}else{if(_0x1bdde9){_0x3f5b10();}else{return _0x5aa0b9[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x50')});}}}else if(_0x1d09e0[_0x09c0('0x51')][_0x09c0('0x52')]){try{var _0x50a37e={'audience':hardwareConf[_0x09c0('0x53')](),'issuer':hardwareConf[_0x09c0('0x53')]()};verifyJwt(_0x1d09e0[_0x09c0('0x51')][_0x09c0('0x52')],_0x50a37e)[_0x09c0('0x4c')](function(_0x541d0a){return db[_0x09c0('0x4a')][_0x09c0('0x4b')]({'where':{'id':_0x541d0a[_0x09c0('0x54')]}})[_0x09c0('0x4c')](function(_0x419d1c){_0x4d6bdc=_0x419d1c;return db[_0x09c0('0x55')][_0x09c0('0x3e')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x09c0('0x56')],'raw':!![]});})[_0x09c0('0x4c')](function(_0x3ab3d9){if(!_0x4d6bdc||!_[_0x09c0('0x57')](_0x4d6bdc[_0x09c0('0x58')],_0x541d0a['nonce'])){return _0x5aa0b9['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4d6bdc[_0x09c0('0x59')]){return _0x5aa0b9[_0x09c0('0x41')](0x191)[_0x09c0('0x43')]({'message':_0x09c0('0x5a')});}if(_0x4d6bdc[_0x09c0('0x5b')]){if(_0x3ab3d9['blockDuration']>0x0){if(moment(_0x4d6bdc[_0x09c0('0x5c')])[_0x09c0('0x5d')](_0x3ab3d9['blockDuration'],_0x09c0('0x5e'))>moment()){return _0x5aa0b9['status'](0x191)[_0x09c0('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5aa0b9[_0x09c0('0x41')](0x191)[_0x09c0('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x1d09e0[_0x09c0('0x3c')]={'id':_0x4d6bdc['id']};_0x3f5b10();});})[_0x09c0('0x46')](function(){return _0x5aa0b9['status'](0x191)[_0x09c0('0x43')]({'message':_0x09c0('0x5a')});});}catch(_0xb8a592){_0x3f5b10(_0xb8a592);}}else if(_0x1bdde9){_0x3f5b10();}else{return _0x5aa0b9[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x50')});}})['use'](function(_0x24bb97,_0x3e0686,_0x2d6344){if(_0x24bb97['user']){db[_0x09c0('0x4a')][_0x09c0('0x4b')]({'where':{'id':_0x24bb97[_0x09c0('0x3c')]['id']},'attributes':userAttributes})['then'](function(_0x184340){if(!_0x184340){return _0x3e0686[_0x09c0('0x41')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x24bb97[_0x09c0('0x3c')]=_0x184340;_0x2d6344();})[_0x09c0('0x46')](function(_0x576f10){_0x2d6344(_0x576f10);});}else if(_0x1bdde9){_0x2d6344();}else{return _0x3e0686[_0x09c0('0x41')](0x194)[_0x09c0('0x43')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x09c0('0x5f')]=function canUpdate(){return compose()[_0x09c0('0x3b')](function(_0x2e7d4f,_0x33fc26,_0x2cef94){return licenseUtil['getLicense']()[_0x09c0('0x4c')](function(_0x499fe8){if(_0x499fe8['update']){_0x2cef94();}else{return _0x33fc26[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x60')});}})[_0x09c0('0x46')](function(_0x252496){_0x2cef94(_0x252496);});});};exports[_0x09c0('0x61')]=function isWebrtcLicence(){return compose()['use'](function(_0x5e239a,_0x502eff,_0xf54a1f){return licenseUtil[_0x09c0('0x62')]()[_0x09c0('0x4c')](function(_0x56ec01){if(_0x56ec01[_0x09c0('0x63')]){_0xf54a1f();}else{return _0x502eff[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x60')});}})[_0x09c0('0x46')](function(_0x7ba10f){_0xf54a1f(_0x7ba10f);});});};exports[_0x09c0('0x64')]=function(_0x2b3c56,_0x3f6d14,_0x38085c){_0x2b3c56[_0x09c0('0x64')]=!![];return _0x38085c();};exports[_0x09c0('0x65')]=function signToken(_0x28bd8a){return signJwt(_0x28bd8a);};exports[_0x09c0('0x66')]=function(_0x332b69,_0x32abbe){if(!_0x332b69[_0x09c0('0x3c')]){return _0x32abbe[_0x09c0('0x41')](0x194)[_0x09c0('0x43')]({'message':_0x09c0('0x67')});}var _0x5b27a4={'payload':{'id':_0x332b69[_0x09c0('0x3c')]['id'],'role':_0x332b69[_0x09c0('0x3c')][_0x09c0('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5b27a4)[_0x09c0('0x4c')](function(_0x22f8b7){_0x32abbe['cookie'](_0x09c0('0x68'),_0x22f8b7);_0x32abbe[_0x09c0('0x69')](_0x09c0('0x6a'));})['catch'](function(_0xe0b82a){return _0x32abbe[_0x09c0('0x41')](0x1f4)[_0x09c0('0x6b')](_0xe0b82a);});};exports[_0x09c0('0x6c')]=function(_0x55b0f0){if(_[_0x09c0('0x6d')](_0x55b0f0[_0x09c0('0x58')])||_['isNil'](_0x55b0f0[_0x09c0('0x6e')])){return null;}else{return createJwt(_0x55b0f0);}};exports[_0x09c0('0x6f')]=function(_0x12f881){_0x12f881[_0x09c0('0x58')]=generateNonce();_0x12f881[_0x09c0('0x6e')]=generateIssuedAt();return createJwt(_0x12f881);};exports[_0x09c0('0x70')]=function(_0x3ebabb,_0x4987cf){var _0x4b6402=_0x3ebabb[_0x09c0('0x51')][_0x09c0('0x52')];if(_0x4b6402){var _0x1ab662={'nonce':_0x4987cf['apiKeyNonce'],'iat':_0x4987cf[_0x09c0('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x09c0('0x53')]()};return verifyJwt(_0x4b6402,_0x1ab662)[_0x09c0('0x4c')](function(){return generateApiKey(_0x4987cf);});}else{throw{'message':_0x09c0('0x71')};}};exports[_0x09c0('0x72')]=function(_0x1df729){var _0xa94cfa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xa94cfa[_0x09c0('0x73')](_0x1df729))throw new db['Sequelize'][(_0x09c0('0x74'))](_0x09c0('0x75'));return;};exports[_0x09c0('0x76')]=function(_0x270ff2,_0x3a6845,_0x219195){var _0x1ad79f=encryptor[_0x09c0('0x77')](_0x3a6845)[_0x09c0('0x78')](',');for(var _0x123ad7=0x0;_0x123ad7<_0x219195;_0x123ad7++){if(!_0x1ad79f[_0x123ad7])break;if(_0x270ff2[_0x09c0('0x79')]()===_0x1ad79f[_0x123ad7]['toLowerCase']()){var _0x34cc0a=util[_0x09c0('0x7a')](_0x09c0('0x7b'),_0x219195);if(_0x219195===0x1){_0x34cc0a=_0x09c0('0x7c');}throw new db['Sequelize'][(_0x09c0('0x74'))](_0x34cc0a);}}return;};exports['updatePasswordsHistory']=function(_0x29205f,_0x9a4f4){var _0x1cfdb3=_0x9a4f4?encryptor['decryptString'](_0x9a4f4)['split'](','):[];if(_0x1cfdb3[_0x09c0('0x7d')]===0x5){_0x1cfdb3[_0x09c0('0x7e')](-0x1,0x1);}_0x1cfdb3[_0x09c0('0x7f')](_0x29205f);return encryptor[_0x09c0('0x80')](_0x1cfdb3['join'](','));};function signJwt(_0x247c3d){var _0x17eba7=BPromise['promisify'](jwt[_0x09c0('0x81')],{'context':jwt});var _0x47722f=_0x247c3d[_0x09c0('0x82')]||config[_0x09c0('0x9')]['session'];return new BPromise(function(_0x8d27a5,_0x24f23b){_0x17eba7(_0x247c3d[_0x09c0('0x83')],_0x47722f,_0x247c3d[_0x09c0('0x84')])[_0x09c0('0x4c')](function(_0x4613e0){_0x8d27a5(_0x4613e0);})[_0x09c0('0x46')](function(_0x63dda8){_0x24f23b(_0x63dda8);});});}function verifyJwt(_0x17931c,_0x2722fb,_0x85adc7){var _0x2906cb=BPromise[_0x09c0('0x85')](jwt['verify'],{'context':jwt});var _0x13f3af=_0x85adc7||config[_0x09c0('0x9')][_0x09c0('0xa')];return new BPromise(function(_0x4163fc,_0x356dcd){_0x2906cb(_0x17931c,_0x13f3af,_0x2722fb)['then'](function(_0x1205da){_0x4163fc(_0x1205da);})[_0x09c0('0x46')](function(_0x2e54f1){_0x356dcd(_0x2e54f1);});});}function generateNonce(){return crypto[_0x09c0('0x86')](0x10)['toString'](_0x09c0('0x87'));}function generateIssuedAt(){return Math[_0x09c0('0x88')](Date['now']()/0x3e8)[_0x09c0('0x89')]();}function createJwt(_0x1920c9){var _0x20dd29={'payload':{'iat':_0x1920c9[_0x09c0('0x6e')],'nonce':_0x1920c9[_0x09c0('0x58')]},'options':{'algorithm':'HS512','subject':_0x1920c9['id'][_0x09c0('0x89')](),'issuer':hardwareConf[_0x09c0('0x53')](),'audience':hardwareConf[_0x09c0('0x53')]()}};return signJwt(_0x20dd29)[_0x09c0('0x4c')](function(_0xe5af77){return{'iat':_0x1920c9['apiKeyIat'],'nonce':_0x1920c9[_0x09c0('0x58')],'token':_0xe5af77};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f1ebcab..f24ec5c 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3264=['type','../../mysqldb','findAll','skipContactsQuery','getContactsSubquery','resolve','then','parseAdvancedSearchFilter','parseQueryParameters','where','fields','clause','tags','user','checkListsRestrictions','search','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','filter','startsWith','map','CmCustomField','findOne','slice','all','length','fieldType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3264,0x1d5));var _0x4326=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3264[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var db=require(_0x4326('0x0'))['db'];exports[_0x4326('0x1')]=function(_0xf55c2d,_0x57f1f7,_0x4730eb,_0x19fe8f){var _0x2174b5={'count':0x0,'rows':[]};var _0x2df0ac=sqlUtils[_0x4326('0x2')](_0x57f1f7,_0xf55c2d);if(_0x2df0ac){return Promise['resolve'](_0x2174b5);}var _0x492f1c=sqlUtils[_0x4326('0x3')]();var _0x2ee26e={};var _0x170076=![];var _0x5233cd=![];return Promise[_0x4326('0x4')]()[_0x4326('0x5')](function(){if(_0xf55c2d['search']){return sqlUtils[_0x4326('0x6')](_0xf55c2d['search'],_0x19fe8f);}else{return sqlUtils[_0x4326('0x7')](_0xf55c2d,_0x19fe8f);}})['then'](function(_0x5ca14a){_0x492f1c['where'](_0x5ca14a['default']);_0x492f1c[_0x4326('0x8')](_0x5ca14a[_0x4326('0x9')]);_0x492f1c[_0x4326('0x8')](_0x5ca14a['filter']);_0x492f1c[_0x4326('0x8')](_0x5ca14a['user'][_0x4326('0xa')]);_0x2ee26e=_0x5ca14a[_0x4326('0xb')];_0x5233cd=_0x5ca14a[_0x4326('0xc')]['skip'];return sqlUtils[_0x4326('0xd')](_0x57f1f7,_0xf55c2d,_0x5233cd);})[_0x4326('0x5')](function(_0x1f3a4a){_0x492f1c['where'](_0x1f3a4a);var _0x926d25=_0xf55c2d[_0x4326('0xe')]?_0x2ee26e['ids']:_0xf55c2d[_0x4326('0xf')];_0x170076=_0x926d25?!![]:![];return sqlUtils[_0x4326('0x10')](_0x492f1c,_0x926d25);})[_0x4326('0x5')](function(_0x2e6102){_0x2174b5[_0x4326('0x11')]=_0x2e6102;if(_0x2174b5[_0x4326('0x11')]===0x0){return;}if(_0xf55c2d[_0x4326('0x12')]){_0x5233cd=!![];}return sqlUtils[_0x4326('0x13')](_0x492f1c,_0xf55c2d[_0x4326('0x9')],_0x4730eb,_0x170076,_0x2ee26e[_0x4326('0xa')],_0x5233cd);})['then'](function(_0x3909b4){if(!_0x3909b4){return[];}return sqlUtils[_0x4326('0x14')](_0x3909b4,_0xf55c2d,_0x4730eb);})['then'](function(_0x1344f4){_0x2174b5[_0x4326('0x15')]=_0x1344f4;return _0x2174b5;})[_0x4326('0x16')](function(_0x3fa978){throw _0x3fa978;});};exports['describe']=function(){var _0x1b1a68={};var _0x36e540=[];return db[_0x4326('0x17')][_0x4326('0x18')]()[_0x4326('0x5')](function(_0x3e0e7b){_0x1b1a68=_0x3e0e7b;var _0x5459b7=Object[_0x4326('0x19')](_0x1b1a68)[_0x4326('0x1a')](function(_0x1815ac){return _[_0x4326('0x1b')](_0x1815ac,'cf_')?_0x1815ac:undefined;});var _0x362154=_0x5459b7[_0x4326('0x1c')](function(_0x3d9ca5){return db[_0x4326('0x1d')][_0x4326('0x1e')]({'where':{'id':_0x3d9ca5[_0x4326('0x1f')](0x3)},'raw':!![]});});return Promise[_0x4326('0x20')](_0x362154);})[_0x4326('0x5')](function(_0x9a5196){for(var _0x435c59=0x0;_0x435c59<_0x9a5196[_0x4326('0x21')];_0x435c59++){if(_0x9a5196[_0x435c59]){var _0x5b7c3b='cf_'+_0x9a5196[_0x435c59]['id'];_0x1b1a68[_0x5b7c3b][_0x4326('0x22')]=_0x9a5196[_0x435c59][_0x4326('0x23')];}}_0x36e540=_[_0x4326('0x1c')](Object['keys'](_0x1b1a68),function(_0x3d9199){return{'name':_0x3d9199,'type':_0x1b1a68[_0x3d9199][_0x4326('0x23')]};});return _0x36e540;})['catch'](function(_0x274e75){throw _0x274e75;});}; \ No newline at end of file +var _0x02ab=['getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','all','length','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','parseAdvancedSearchFilter','search','parseQueryParameters','where','default','fields','filter','user','clause','checkListsRestrictions','then','ids','count','User','buildContactsQuery'];(function(_0x3de377,_0x1b5d04){var _0x417a5d=function(_0x5cebbf){while(--_0x5cebbf){_0x3de377['push'](_0x3de377['shift']());}};_0x417a5d(++_0x1b5d04);}(_0x02ab,0x9f));var _0xb02a=function(_0x131150,_0x3f92a6){_0x131150=_0x131150-0x0;var _0x1dad9b=_0x02ab[_0x131150];return _0x1dad9b;};'use strict';var _=require(_0xb02a('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xb02a('0x1'))['db'];exports[_0xb02a('0x2')]=function(_0x150e82,_0x244174,_0xcd9dad,_0x11e1a0){var _0x24f3f3={'count':0x0,'rows':[]};var _0x275815=sqlUtils[_0xb02a('0x3')](_0x244174,_0x150e82);if(_0x275815){return Promise[_0xb02a('0x4')](_0x24f3f3);}var _0x2d651a=sqlUtils[_0xb02a('0x5')]();var _0x550ab4={};var _0x2daccc=![];var _0xe4e76a=![];return Promise[_0xb02a('0x4')]()['then'](function(){if(_0x150e82['search']){return sqlUtils[_0xb02a('0x6')](_0x150e82[_0xb02a('0x7')],_0x11e1a0);}else{return sqlUtils[_0xb02a('0x8')](_0x150e82,_0x11e1a0);}})['then'](function(_0x20d44c){_0x2d651a[_0xb02a('0x9')](_0x20d44c[_0xb02a('0xa')]);_0x2d651a[_0xb02a('0x9')](_0x20d44c[_0xb02a('0xb')]);_0x2d651a[_0xb02a('0x9')](_0x20d44c[_0xb02a('0xc')]);_0x2d651a[_0xb02a('0x9')](_0x20d44c[_0xb02a('0xd')][_0xb02a('0xe')]);_0x550ab4=_0x20d44c['tags'];_0xe4e76a=_0x20d44c[_0xb02a('0xd')]['skip'];return sqlUtils[_0xb02a('0xf')](_0x244174,_0x150e82,_0xe4e76a);})[_0xb02a('0x10')](function(_0x1d4740){_0x2d651a[_0xb02a('0x9')](_0x1d4740);var _0x52c5ed=_0x150e82['search']?_0x550ab4[_0xb02a('0x11')]:_0x150e82['tag'];_0x2daccc=_0x52c5ed?!![]:![];return sqlUtils['countFilteredContacts'](_0x2d651a,_0x52c5ed);})[_0xb02a('0x10')](function(_0x1cfc30){_0x24f3f3[_0xb02a('0x12')]=_0x1cfc30;if(_0x24f3f3[_0xb02a('0x12')]===0x0){return;}if(_0x150e82[_0xb02a('0x13')]){_0xe4e76a=!![];}return sqlUtils[_0xb02a('0x14')](_0x2d651a,_0x150e82[_0xb02a('0xb')],_0xcd9dad,_0x2daccc,_0x550ab4[_0xb02a('0xe')],_0xe4e76a);})[_0xb02a('0x10')](function(_0x4e4ed9){if(!_0x4e4ed9){return[];}return sqlUtils[_0xb02a('0x15')](_0x4e4ed9,_0x150e82,_0xcd9dad);})['then'](function(_0x540eba){_0x24f3f3[_0xb02a('0x16')]=_0x540eba;return _0x24f3f3;})[_0xb02a('0x17')](function(_0x5611cc){throw _0x5611cc;});};exports[_0xb02a('0x18')]=function(){var _0x4ac85b={};var _0x124c59=[];return db[_0xb02a('0x19')]['describe']()[_0xb02a('0x10')](function(_0x21802a){_0x4ac85b=_0x21802a;var _0x453e1f=Object[_0xb02a('0x1a')](_0x4ac85b)['filter'](function(_0xd1a3d){return _[_0xb02a('0x1b')](_0xd1a3d,_0xb02a('0x1c'))?_0xd1a3d:undefined;});var _0x2b5b0a=_0x453e1f[_0xb02a('0x1d')](function(_0x17b881){return db[_0xb02a('0x1e')][_0xb02a('0x1f')]({'where':{'id':_0x17b881['slice'](0x3)},'raw':!![]});});return Promise[_0xb02a('0x20')](_0x2b5b0a);})[_0xb02a('0x10')](function(_0x59a28c){for(var _0x2933bb=0x0;_0x2933bb<_0x59a28c[_0xb02a('0x21')];_0x2933bb++){if(_0x59a28c[_0x2933bb]){var _0x178e39=_0xb02a('0x1c')+_0x59a28c[_0x2933bb]['id'];_0x4ac85b[_0x178e39][_0xb02a('0x22')]=_0x59a28c[_0x2933bb][_0xb02a('0x23')];}}_0x124c59=_[_0xb02a('0x1d')](Object[_0xb02a('0x1a')](_0x4ac85b),function(_0x5225c5){return{'name':_0x5225c5,'type':_0x4ac85b[_0x5225c5][_0xb02a('0x23')]};});return _0x124c59;})[_0xb02a('0x17')](function(_0x2ab486){throw _0x2ab486;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 6c8ec9a..61a2bc9 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x844b=['c.id','limit','offset','group','subqry.id','having','order','DESC','Tag','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','t.id\x20IN\x20?','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','email','updatedAt','deletedAt','TagIds','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','castTo','DATE','type','default','text','value','end','tags','ids','User','user','clause','and','uc.UserId\x20=\x20?','map','some','Contact','c.ListId\x20IN\x20?','concat','resolve','then','fields','tag','filter','c.ListId\x20IS\x20NULL','attributes'];(function(_0x453d45,_0x2c344d){var _0x155308=function(_0x38bfe2){while(--_0x38bfe2){_0x453d45['push'](_0x453d45['shift']());}};_0x155308(++_0x2c344d);}(_0x844b,0x1b6));var _0xb844=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x844b[_0x4c9f6a];return _0x5df5b9;};'use strict';var _=require(_0xb844('0x0'));var squel=require('squel');var as=require(_0xb844('0x1'));var qs=require(_0xb844('0x2'));var utils=require(_0xb844('0x3'));var db=require(_0xb844('0x4'))['db'];function skipContactsQuery(_0x232596,_0x2fb855){var _0x4b6f4e=![];if(_0x232596[_0xb844('0x5')]===_0xb844('0x6')&&!_0x2fb855[_0xb844('0x7')]&&!_0x2fb855[_0xb844('0x8')]&&_0x2fb855['autocomplete']!==_0xb844('0x9')){_0x4b6f4e=!![];}return _0x4b6f4e;}function getContactsSubquery(){return squel[_0xb844('0xa')]()[_0xb844('0xb')](_0xb844('0xc'),'c')[_0xb844('0xd')](_0xb844('0xe'));}function applyJoinClauses(_0x22f046,_0x5d8aaf){var _0x5d367d=_0x5d8aaf?'c':_0xb844('0xf');_0x22f046[_0xb844('0x10')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x5d367d+'.id')['left_join'](_0xb844('0x11'),'ct',_0xb844('0x12')+_0x5d367d+_0xb844('0x13'))[_0xb844('0x10')](_0xb844('0x14'),'t',_0xb844('0x15'));return _0x22f046;}function addFieldsToQuery(_0x3fea03,_0x20f022,_0x5e65b1,_0x5d4529,_0x36a81d){var _0x1d035e=_0x36a81d?'c':_0xb844('0xf');if(!_0x20f022){_0x20f022=['id','firstName',_0xb844('0x16'),_0xb844('0x17'),_0xb844('0x18'),'fax',_0xb844('0x19'),_0xb844('0x8'),'CompanyId','createdAt',_0xb844('0x1a'),_0xb844('0x1b'),_0xb844('0x1c')];}else if(!_0x20f022['includes']('id')){_0x20f022[_0xb844('0x1d')]('id');}var _0x21b5dc=_0x5e65b1&&_0x36a81d||!_0x5e65b1&&!_0x36a81d;if(_0x5d4529){_0x21b5dc=_0x5d4529&&_0x36a81d||!_0x5d4529&&!_0x36a81d;}_0x20f022[_0xb844('0x1e')](function(_0x2b4dd0){if(_0x2b4dd0==='TagIds'){if(_0x21b5dc){_0x3fea03[_0xb844('0x1f')](_0xb844('0x20'),_0x2b4dd0);}else if(_0x5e65b1||_0x5d4529){_0x3fea03[_0xb844('0x1f')](_0x1d035e+'.'+_0x2b4dd0);}}else{_0x3fea03[_0xb844('0x1f')](_0x1d035e+'.'+_0x2b4dd0);}});return _0x3fea03;}function getSqlClauses(){var _0x2e3f11={'default':squel[_0xb844('0x21')](),'fields':squel[_0xb844('0x21')](),'filter':squel['expr'](),'tags':{'clause':squel[_0xb844('0x21')](),'ids':null},'user':{'clause':squel[_0xb844('0x21')](),'skip':![]}};return _0x2e3f11;}function parseTagParameter(_0x2c919d){var _0x3e7a62=squel[_0xb844('0x21')]();if(_0x2c919d){var _0x55cc0b=utils[_0xb844('0x22')](_0x2c919d);_0x55cc0b[_0xb844('0x1e')](function(_0x7c609c){_0x3e7a62['or'](_0xb844('0x23'),'%,'+_0x7c609c+',%');});}return _0x3e7a62;}function parseSearchFilter(_0xaacbbc){var _0x1dcd58=squel[_0xb844('0x21')]();if(_0xaacbbc){var _0x456d3c=_0xaacbbc[_0xb844('0x24')]('\x5c','\x5c\x5c')[_0xb844('0x24')](/'/g,'\x27\x27');if(_0x456d3c[_0xb844('0x25')]('\x20')[_0xb844('0x26')]>0x1){_0x1dcd58['or'](_0xb844('0x27'),qs[_0xb844('0x28')](_0x456d3c,!![]),null);}else{if(qs[_0xb844('0x29')](_0x456d3c)){_0x1dcd58['or'](_0xb844('0x2a'),_0x456d3c+'%');_0x1dcd58['or'](_0xb844('0x2b'),_0x456d3c+'%');_0x1dcd58['or'](_0xb844('0x2c'),_0x456d3c+'%');_0x1dcd58['or'](_0xb844('0x2d'),_0x456d3c+'%');}else if(qs[_0xb844('0x2e')](_0x456d3c)){_0x1dcd58['or'](_0xb844('0x2f'),_0x456d3c+'%');}else{_0x1dcd58['or'](_0xb844('0x30'),'%'+_0x456d3c+'%');_0x1dcd58['or'](_0xb844('0x31'),'%'+_0x456d3c+'%');_0x1dcd58['or'](_0xb844('0x2f'),'%'+_0x456d3c+'%');}}}return _0x1dcd58;}function parseAdvancedSearchFilter(_0x608360,_0x223bb0){var _0x44a98b=getSqlClauses();var _0x29dfbd=as[_0xb844('0x32')](_0x608360);var _0xeff6a5=_0x29dfbd[_0xb844('0x33')];for(var _0x56eb12=0x0;_0x56eb12<_0x29dfbd[_0xb844('0x34')][_0xb844('0x26')];_0x56eb12++){var _0x5d1410=_0x29dfbd[_0xb844('0x34')][_0x56eb12];var _0x3b1a45='c';var _0x150462=_[_0xb844('0x35')](_0x223bb0,[_0xb844('0x36'),_0x5d1410[_0xb844('0x1f')]]);if(_0x150462){if(_0x5d1410[_0xb844('0x1f')]===_0xb844('0x37')||_0x150462['fieldType']==='datetime'){_0x5d1410[_0xb844('0x38')]=_0xb844('0x39');}var _0x5650e2=as['buildExpression'](_0x3b1a45,_0x150462[_0xb844('0x3a')],_0x5d1410);_0x44a98b[_0xb844('0x3b')][_0xeff6a5](_0x5650e2[_0xb844('0x3c')],_0x5650e2['value']['start'],_0x5650e2[_0xb844('0x3d')][_0xb844('0x3e')]);}else{if(_0x5d1410[_0xb844('0x1f')]==='Tag'){var _0x3d9381=_0x5d1410[_0xb844('0x3d')]['split'](',')['map'](function(_0xba1e9b){return Number(_0xba1e9b);});var _0x3ee901=parseTagParameter(_0x3d9381);_0x44a98b['tags']['clause']['and'](_0x3ee901);_0x44a98b[_0xb844('0x3f')][_0xb844('0x40')]=_0x3d9381;}else if(_0x5d1410[_0xb844('0x1f')]===_0xb844('0x41')){_0x44a98b[_0xb844('0x42')][_0xb844('0x43')][_0xb844('0x44')](_0xb844('0x45'),_0x5d1410[_0xb844('0x3d')]);_0x44a98b[_0xb844('0x42')]['skip']=!![];}}}return _0x44a98b;}function parseModelFields(_0x3a4ea4,_0x5040ec){var _0x12a7ea=squel[_0xb844('0x21')]();var _0x3bdd4b=_(_0x3a4ea4)['keys']()[_0xb844('0x46')](function(_0x2358e3){return _[_0xb844('0x47')](_0x5040ec,['name',_0x2358e3])?_0x2358e3:undefined;})['compact']()['value']();if(_0x3a4ea4[_0xb844('0x48')]){_0x3bdd4b['push'](_0xb844('0x48'));}if(_0x3a4ea4[_0xb844('0x41')]){_0x3bdd4b[_0xb844('0x1d')](_0xb844('0x41'));}if(_0x3bdd4b[_0xb844('0x26')]>0x0){_0x3bdd4b['forEach'](function(_0x2cb460){if(_0x2cb460===_0xb844('0x8')){_0x12a7ea[_0xb844('0x44')](_0xb844('0x49'),[][_0xb844('0x4a')](_0x3a4ea4[_0x2cb460]));}else if(_0x2cb460===_0xb844('0x48')){var _0x5cbd88='%'+_0x3a4ea4[_0x2cb460]+'%';_0x12a7ea[_0xb844('0x44')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x5cbd88);}else if(_0x2cb460==='User'){_0x12a7ea[_0xb844('0x44')]('uc.UserId\x20=\x20?',_0x3a4ea4[_0x2cb460]);}else{_0x12a7ea[_0xb844('0x44')]('c.'+_0x2cb460+'\x20=\x20?',_0x3a4ea4[_0x2cb460]);}});}return _0x12a7ea;}function parseQueryParameters(_0x1cf85d,_0x23b7d7){var _0xbf6464=getSqlClauses();return Promise[_0xb844('0x4b')]()[_0xb844('0x4c')](function(){return parseModelFields(_0x1cf85d,_0x23b7d7);})['then'](function(_0x3dd622){_0xbf6464[_0xb844('0x4d')][_0xb844('0x44')](_0x3dd622);return parseTagParameter(_0x1cf85d[_0xb844('0x4e')]);})[_0xb844('0x4c')](function(_0x2659da){_0xbf6464['tags'][_0xb844('0x43')]['and'](_0x2659da);return parseSearchFilter(_0x1cf85d[_0xb844('0x4f')]);})['then'](function(_0x279e1d){_0xbf6464[_0xb844('0x4f')]=_0x279e1d;return _0xbf6464;});}function checkListsRestrictions(_0x10de2a,_0x49450d,_0x33246c){var _0x411b5a=squel[_0xb844('0x21')]();return Promise[_0xb844('0x4b')]()[_0xb844('0x4c')](function(){if(_0x49450d[_0xb844('0x7')]&&_0x10de2a[_0xb844('0x5')]===_0xb844('0x6')&&!_0x33246c){return _0x10de2a['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x377624){if(_0x377624){if(_0x377624[_0xb844('0x26')]===0x0){_0x411b5a[_0xb844('0x44')](_0xb844('0x50'));}else{_0x411b5a[_0xb844('0x44')](_0xb844('0x49'),_['map'](_0x377624,'id'));}}})[_0xb844('0x4c')](function(){return _0x411b5a;});}function buildContactsQuery(_0x5464d4,_0x39bf41,_0x41267d,_0x587cac,_0x581e83,_0xebbbfe){if(_0x39bf41){_0x39bf41=_0x41267d[_0xb844('0x51')];}_0x5464d4=addFieldsToQuery(_0x5464d4,_0x39bf41,_0x587cac,_0xebbbfe,!![]);var _0x48ad85=squel['select']();_0x48ad85=addFieldsToQuery(_0x48ad85,_0x39bf41,_0x587cac,_0xebbbfe,![]);if(_0x587cac||_0xebbbfe){_0x5464d4=applyJoinClauses(_0x5464d4,!![]);_0x5464d4['group'](_0xb844('0x52'));if(_0x41267d['limit']){_0x48ad85['limit'](_0x41267d[_0xb844('0x53')]);}if(_0x41267d[_0xb844('0x54')]){_0x48ad85[_0xb844('0x54')](_0x41267d[_0xb844('0x54')]);}}else{_0x48ad85=applyJoinClauses(_0x48ad85,![]);_0x48ad85[_0xb844('0x55')](_0xb844('0x56'));if(_0x41267d['limit']){_0x5464d4[_0xb844('0x53')](_0x41267d[_0xb844('0x53')]);}if(_0x41267d[_0xb844('0x54')]){_0x5464d4['offset'](_0x41267d[_0xb844('0x54')]);}}_0x48ad85[_0xb844('0x57')](_0x581e83);if(_0x41267d[_0xb844('0x58')]){_0x41267d[_0xb844('0x58')][_0xb844('0x1e')](function(_0x1678cb){_0x5464d4[_0xb844('0x58')]('c.'+_0x1678cb[0x0],_0x1678cb[0x1]===_0xb844('0x59')?![]:!![]);_0x48ad85[_0xb844('0x58')]('subqry.'+_0x1678cb[0x0],_0x1678cb[0x1]===_0xb844('0x59')?![]:!![]);});}_0x48ad85[_0xb844('0xb')](_0x5464d4,_0xb844('0xf'));return _0x48ad85;}function getFilteredContacts(_0x1073ff){var _0xd40a5a=[];return db[_0xb844('0x5a')]['findAll']({'attributes':['id','name',_0xb844('0x5b')],'raw':!![]})[_0xb844('0x4c')](function(_0x5bdcea){_0xd40a5a=_[_0xb844('0x5c')](_0x5bdcea,'id');var _0x3c23ed={'type':db[_0xb844('0x5d')][_0xb844('0x5e')][_0xb844('0x5f')],'model':db[_0xb844('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xb844('0x61')][_0xb844('0x62')](_0x1073ff[_0xb844('0x63')](),_0x3c23ed);})['then'](function(_0x228b51){_0x228b51[_0xb844('0x1e')](function(_0xc3b779){if(_0xc3b779[_0xb844('0x1c')]){_0xc3b779[_0xb844('0x64')]=[];_0xc3b779[_0xb844('0x1c')][_0xb844('0x25')](',')[_0xb844('0x1e')](function(_0x559d05){_0xc3b779['Tags'][_0xb844('0x1d')](_0xd40a5a[_0x559d05]);});}delete _0xc3b779[_0xb844('0x1c')];});return _0x228b51;});}function countFilteredContacts(_0x48bc84,_0x183b9f){var _0x2b7327=_0x48bc84[_0xb844('0x65')]();_0x2b7327[_0xb844('0x1f')](_0xb844('0x66'));_0x2b7327=applyJoinClauses(_0x2b7327,!![]);_0x48bc84['group']('c.id');var _0x50bd67=utils[_0xb844('0x22')](_0x183b9f);if(!_['isEmpty'](_0x50bd67)){_0x2b7327[_0xb844('0xd')](_0xb844('0x67'),_0x50bd67);}var _0x5aa919={'type':db[_0xb844('0x5d')][_0xb844('0x5e')]['SELECT'],'raw':!![]};return db[_0xb844('0x61')][_0xb844('0x62')](_0x2b7327[_0xb844('0x63')](),_0x5aa919)[_0xb844('0x4c')](function(_0x584ffb){return _0x584ffb[0x0][_0xb844('0x66')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x51c9=['order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','toString','Tags','clone','COUNT(*)','c.id','isEmpty','t.id\x20IN\x20?','query','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','autocomplete','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','ListId','CompanyId','createdAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','fieldType','datetime','castTo','DATE','buildExpression','type','text','value','start','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','attributes','group','limit','offset','subqry.id','having'];(function(_0x21cd3b,_0x3be914){var _0x506db8=function(_0x52185a){while(--_0x52185a){_0x21cd3b['push'](_0x21cd3b['shift']());}};_0x506db8(++_0x3be914);}(_0x51c9,0x1d3));var _0x951c=function(_0x1b2ed2,_0x506c54){_0x1b2ed2=_0x1b2ed2-0x0;var _0x113b56=_0x51c9[_0x1b2ed2];return _0x113b56;};'use strict';var _=require(_0x951c('0x0'));var squel=require(_0x951c('0x1'));var as=require(_0x951c('0x2'));var qs=require(_0x951c('0x3'));var utils=require(_0x951c('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x248021,_0x48b459){var _0x1f63ff=![];if(_0x248021[_0x951c('0x5')]===_0x951c('0x6')&&!_0x48b459[_0x951c('0x7')]&&!_0x48b459['ListId']&&_0x48b459[_0x951c('0x8')]!=='true'){_0x1f63ff=!![];}return _0x1f63ff;}function getContactsSubquery(){return squel[_0x951c('0x9')]()[_0x951c('0xa')](_0x951c('0xb'),'c')[_0x951c('0xc')](_0x951c('0xd'));}function applyJoinClauses(_0x5edb70,_0x3c4fd6){var _0x3bc864=_0x3c4fd6?'c':'subqry';_0x5edb70[_0x951c('0xe')](_0x951c('0xf'),'uc',_0x951c('0x10')+_0x3bc864+_0x951c('0x11'))[_0x951c('0xe')](_0x951c('0x12'),'ct',_0x951c('0x13')+_0x3bc864+'.id')[_0x951c('0xe')](_0x951c('0x14'),'t',_0x951c('0x15'));return _0x5edb70;}function addFieldsToQuery(_0x554be5,_0xadbb50,_0x7c8e7,_0xae0a,_0x4a112a){var _0x5df95c=_0x4a112a?'c':_0x951c('0x16');if(!_0xadbb50){_0xadbb50=['id',_0x951c('0x17'),_0x951c('0x18'),_0x951c('0x19'),_0x951c('0x1a'),_0x951c('0x1b'),_0x951c('0x1c'),_0x951c('0x1d'),_0x951c('0x1e'),_0x951c('0x1f'),'updatedAt',_0x951c('0x20'),_0x951c('0x21')];}else if(!_0xadbb50[_0x951c('0x22')]('id')){_0xadbb50[_0x951c('0x23')]('id');}var _0x568caa=_0x7c8e7&&_0x4a112a||!_0x7c8e7&&!_0x4a112a;if(_0xae0a){_0x568caa=_0xae0a&&_0x4a112a||!_0xae0a&&!_0x4a112a;}_0xadbb50[_0x951c('0x24')](function(_0x47ab0e){if(_0x47ab0e==='TagIds'){if(_0x568caa){_0x554be5[_0x951c('0x25')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x47ab0e);}else if(_0x7c8e7||_0xae0a){_0x554be5[_0x951c('0x25')](_0x5df95c+'.'+_0x47ab0e);}}else{_0x554be5['field'](_0x5df95c+'.'+_0x47ab0e);}});return _0x554be5;}function getSqlClauses(){var _0x1c8b89={'default':squel['expr'](),'fields':squel[_0x951c('0x26')](),'filter':squel[_0x951c('0x26')](),'tags':{'clause':squel[_0x951c('0x26')](),'ids':null},'user':{'clause':squel[_0x951c('0x26')](),'skip':![]}};return _0x1c8b89;}function parseTagParameter(_0x1c5e38){var _0x5cb6a7=squel[_0x951c('0x26')]();if(_0x1c5e38){var _0x30fb01=utils[_0x951c('0x27')](_0x1c5e38);_0x30fb01[_0x951c('0x24')](function(_0x45a3ec){_0x5cb6a7['or'](_0x951c('0x28'),'%,'+_0x45a3ec+',%');});}return _0x5cb6a7;}function parseSearchFilter(_0x19189a){var _0x1a33a1=squel[_0x951c('0x26')]();if(_0x19189a){var _0x4c9c3f=_0x19189a['replace']('\x5c','\x5c\x5c')[_0x951c('0x29')](/'/g,'\x27\x27');if(_0x4c9c3f[_0x951c('0x2a')]('\x20')[_0x951c('0x2b')]>0x1){_0x1a33a1['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x951c('0x2c')](_0x4c9c3f,!![]),null);}else{if(qs[_0x951c('0x2d')](_0x4c9c3f)){_0x1a33a1['or']('c.id\x20LIKE\x20?',_0x4c9c3f+'%');_0x1a33a1['or'](_0x951c('0x2e'),_0x4c9c3f+'%');_0x1a33a1['or'](_0x951c('0x2f'),_0x4c9c3f+'%');_0x1a33a1['or'](_0x951c('0x30'),_0x4c9c3f+'%');}else if(qs[_0x951c('0x31')](_0x4c9c3f)){_0x1a33a1['or'](_0x951c('0x32'),_0x4c9c3f+'%');}else{_0x1a33a1['or'](_0x951c('0x33'),'%'+_0x4c9c3f+'%');_0x1a33a1['or'](_0x951c('0x34'),'%'+_0x4c9c3f+'%');_0x1a33a1['or']('c.email\x20LIKE\x20?','%'+_0x4c9c3f+'%');}}}return _0x1a33a1;}function parseAdvancedSearchFilter(_0x58a791,_0x2c98e0){var _0x39d7e7=getSqlClauses();var _0x5701ec=as['parseSearch'](_0x58a791);var _0x229338=_0x5701ec[_0x951c('0x35')];for(var _0x1be326=0x0;_0x1be326<_0x5701ec[_0x951c('0x36')]['length'];_0x1be326++){var _0x2e7d72=_0x5701ec[_0x951c('0x36')][_0x1be326];var _0x298c75='c';var _0x444218=_[_0x951c('0x37')](_0x2c98e0,[_0x951c('0x38'),_0x2e7d72[_0x951c('0x25')]]);if(_0x444218){if(_0x2e7d72[_0x951c('0x25')]==='dateOfBirth'||_0x444218[_0x951c('0x39')]===_0x951c('0x3a')){_0x2e7d72[_0x951c('0x3b')]=_0x951c('0x3c');}var _0x13479f=as[_0x951c('0x3d')](_0x298c75,_0x444218[_0x951c('0x3e')],_0x2e7d72);_0x39d7e7['default'][_0x229338](_0x13479f[_0x951c('0x3f')],_0x13479f[_0x951c('0x40')][_0x951c('0x41')],_0x13479f['value']['end']);}else{if(_0x2e7d72[_0x951c('0x25')]==='Tag'){var _0x34df7e=_0x2e7d72[_0x951c('0x40')]['split'](',')[_0x951c('0x42')](function(_0xc33457){return Number(_0xc33457);});var _0x12af03=parseTagParameter(_0x34df7e);_0x39d7e7[_0x951c('0x43')][_0x951c('0x44')][_0x951c('0x45')](_0x12af03);_0x39d7e7['tags'][_0x951c('0x46')]=_0x34df7e;}else if(_0x2e7d72[_0x951c('0x25')]===_0x951c('0x47')){_0x39d7e7[_0x951c('0x48')]['clause'][_0x951c('0x45')](_0x951c('0x49'),_0x2e7d72[_0x951c('0x40')]);_0x39d7e7['user'][_0x951c('0x4a')]=!![];}}}return _0x39d7e7;}function parseModelFields(_0x366172,_0x56510a){var _0x18e2d0=squel[_0x951c('0x26')]();var _0x2b009c=_(_0x366172)['keys']()[_0x951c('0x42')](function(_0x48423e){return _['some'](_0x56510a,[_0x951c('0x38'),_0x48423e])?_0x48423e:undefined;})[_0x951c('0x4b')]()[_0x951c('0x40')]();if(_0x366172['Contact']){_0x2b009c[_0x951c('0x23')](_0x951c('0x4c'));}if(_0x366172[_0x951c('0x47')]){_0x2b009c[_0x951c('0x23')](_0x951c('0x47'));}if(_0x2b009c[_0x951c('0x2b')]>0x0){_0x2b009c[_0x951c('0x24')](function(_0x5760ec){if(_0x5760ec===_0x951c('0x1d')){_0x18e2d0[_0x951c('0x45')](_0x951c('0x4d'),[][_0x951c('0x4e')](_0x366172[_0x5760ec]));}else if(_0x5760ec===_0x951c('0x4c')){var _0x5145df='%'+_0x366172[_0x5760ec]+'%';_0x18e2d0[_0x951c('0x45')](_0x951c('0x4f'),_0x5145df);}else if(_0x5760ec===_0x951c('0x47')){_0x18e2d0[_0x951c('0x45')](_0x951c('0x49'),_0x366172[_0x5760ec]);}else{_0x18e2d0[_0x951c('0x45')]('c.'+_0x5760ec+_0x951c('0x50'),_0x366172[_0x5760ec]);}});}return _0x18e2d0;}function parseQueryParameters(_0x17f3e4,_0x53af6a){var _0x2727ca=getSqlClauses();return Promise[_0x951c('0x51')]()[_0x951c('0x52')](function(){return parseModelFields(_0x17f3e4,_0x53af6a);})[_0x951c('0x52')](function(_0x56f8a3){_0x2727ca[_0x951c('0x53')][_0x951c('0x45')](_0x56f8a3);return parseTagParameter(_0x17f3e4[_0x951c('0x54')]);})[_0x951c('0x52')](function(_0x4daf22){_0x2727ca[_0x951c('0x43')]['clause'][_0x951c('0x45')](_0x4daf22);return parseSearchFilter(_0x17f3e4[_0x951c('0x55')]);})[_0x951c('0x52')](function(_0x5f57fb){_0x2727ca['filter']=_0x5f57fb;return _0x2727ca;});}function checkListsRestrictions(_0x4956d3,_0x3e83fd,_0x41c61a){var _0x53a662=squel[_0x951c('0x26')]();return Promise['resolve']()[_0x951c('0x52')](function(){if(_0x3e83fd[_0x951c('0x7')]&&_0x4956d3[_0x951c('0x5')]===_0x951c('0x6')&&!_0x41c61a){return _0x4956d3[_0x951c('0x56')]({'attributes':['id'],'raw':!![]});}})[_0x951c('0x52')](function(_0x46cc5c){if(_0x46cc5c){if(_0x46cc5c[_0x951c('0x2b')]===0x0){_0x53a662[_0x951c('0x45')]('c.ListId\x20IS\x20NULL');}else{_0x53a662[_0x951c('0x45')]('c.ListId\x20IN\x20?',_[_0x951c('0x42')](_0x46cc5c,'id'));}}})[_0x951c('0x52')](function(){return _0x53a662;});}function buildContactsQuery(_0x20759f,_0x53827b,_0x95712a,_0x3426e7,_0x373d19,_0x2267ad){if(_0x53827b){_0x53827b=_0x95712a[_0x951c('0x57')];}_0x20759f=addFieldsToQuery(_0x20759f,_0x53827b,_0x3426e7,_0x2267ad,!![]);var _0x1de7b2=squel['select']();_0x1de7b2=addFieldsToQuery(_0x1de7b2,_0x53827b,_0x3426e7,_0x2267ad,![]);if(_0x3426e7||_0x2267ad){_0x20759f=applyJoinClauses(_0x20759f,!![]);_0x20759f[_0x951c('0x58')]('c.id');if(_0x95712a['limit']){_0x1de7b2[_0x951c('0x59')](_0x95712a[_0x951c('0x59')]);}if(_0x95712a[_0x951c('0x5a')]){_0x1de7b2[_0x951c('0x5a')](_0x95712a[_0x951c('0x5a')]);}}else{_0x1de7b2=applyJoinClauses(_0x1de7b2,![]);_0x1de7b2[_0x951c('0x58')](_0x951c('0x5b'));if(_0x95712a[_0x951c('0x59')]){_0x20759f[_0x951c('0x59')](_0x95712a[_0x951c('0x59')]);}if(_0x95712a[_0x951c('0x5a')]){_0x20759f['offset'](_0x95712a[_0x951c('0x5a')]);}}_0x1de7b2[_0x951c('0x5c')](_0x373d19);if(_0x95712a['order']){_0x95712a[_0x951c('0x5d')]['forEach'](function(_0x4911f2){_0x20759f[_0x951c('0x5d')]('c.'+_0x4911f2[0x0],_0x4911f2[0x1]===_0x951c('0x5e')?![]:!![]);_0x1de7b2['order'](_0x951c('0x5f')+_0x4911f2[0x0],_0x4911f2[0x1]===_0x951c('0x5e')?![]:!![]);});}_0x1de7b2[_0x951c('0xa')](_0x20759f,'subqry');return _0x1de7b2;}function getFilteredContacts(_0x540d37){var _0x185a41=[];return db['Tag'][_0x951c('0x60')]({'attributes':['id','name',_0x951c('0x61')],'raw':!![]})[_0x951c('0x52')](function(_0x43831b){_0x185a41=_[_0x951c('0x62')](_0x43831b,'id');var _0x4db220={'type':db[_0x951c('0x63')][_0x951c('0x64')][_0x951c('0x65')],'model':db[_0x951c('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x540d37[_0x951c('0x67')](),_0x4db220);})[_0x951c('0x52')](function(_0x31cafe){_0x31cafe[_0x951c('0x24')](function(_0x28c046){if(_0x28c046[_0x951c('0x21')]){_0x28c046[_0x951c('0x68')]=[];_0x28c046[_0x951c('0x21')]['split'](',')[_0x951c('0x24')](function(_0x327804){_0x28c046[_0x951c('0x68')]['push'](_0x185a41[_0x327804]);});}delete _0x28c046[_0x951c('0x21')];});return _0x31cafe;});}function countFilteredContacts(_0x44a92d,_0x146b6c){var _0x2efe34=_0x44a92d[_0x951c('0x69')]();_0x2efe34[_0x951c('0x25')](_0x951c('0x6a'));_0x2efe34=applyJoinClauses(_0x2efe34,!![]);_0x44a92d['group'](_0x951c('0x6b'));var _0x1749ea=utils[_0x951c('0x27')](_0x146b6c);if(!_[_0x951c('0x6c')](_0x1749ea)){_0x2efe34[_0x951c('0xc')](_0x951c('0x6d'),_0x1749ea);}var _0x365dea={'type':db[_0x951c('0x63')]['QueryTypes'][_0x951c('0x65')],'raw':!![]};return db['sequelize'][_0x951c('0x6e')](_0x2efe34['toString'](),_0x365dea)['then'](function(_0x264790){return _0x264790[0x0][_0x951c('0x6a')];});}module[_0x951c('0x6f')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 9dde47b..b355e29 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 _0x8d86=['aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','data','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session'];(function(_0x497f38,_0x4ee65e){var _0xb809d1=function(_0x4814db){while(--_0x4814db){_0x497f38['push'](_0x497f38['shift']());}};_0xb809d1(++_0x4ee65e);}(_0x8d86,0x111));var _0x68d8=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x8d86[_0x68ee8b];return _0x5148f7;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x68d8('0x0'));var _=require(_0x68d8('0x1'));var config=require(_0x68d8('0x2'));var logger=require(_0x68d8('0x3'))(_0x68d8('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x68d8('0x5')][_0x68d8('0x6')],'algorithm':_0x68d8('0x7')};const fileOptions={'algorithm':_0x68d8('0x8')};if(config[_0x68d8('0x9')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x68d8('0x9')]['algorithm']);if(isSupported){fileOptions[_0x68d8('0xa')]=config[_0x68d8('0x9')][_0x68d8('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x68d8('0xb')](',\x20');logger['error'](config[_0x68d8('0x9')][_0x68d8('0xa')],_0x68d8('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x52cfcf){return AES_SUPPORTED_RX[_0x68d8('0xd')](_0x52cfcf);}function getSupportedCiphers(){return crypto[_0x68d8('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x14badb){return getSupportedCiphers()[_0x68d8('0xf')](_0x14badb)>-0x1;}function combineOptions(_0x6da14e){var _0x3d84f3={};for(var _0x2f384d in fileOptions){if(fileOptions['hasOwnProperty'](_0x2f384d)){_0x3d84f3[_0x2f384d]=fileOptions[_0x2f384d];}}if(_0x6da14e){for(var _0x5dd656 in _0x6da14e){if(_0x6da14e['hasOwnProperty'](_0x5dd656)){_0x3d84f3[_0x5dd656]=_0x6da14e[_0x5dd656];}}}return _0x3d84f3;}exports[_0x68d8('0x10')]=function(_0x58fb0d,_0x52f44f,_0x55ce7c,_0x491033){return new BPromise(function(_0x34a76e,_0x527e79){_0x491033=combineOptions(_0x491033);var _0x5b7ad=new Buffer(_0x55ce7c);var _0x4412db=fs[_0x68d8('0x11')](_0x58fb0d);var _0x3dfbb0=fs[_0x68d8('0x12')](_0x52f44f);var _0x2cd688=crypto[_0x68d8('0x13')](_0x491033[_0x68d8('0xa')],_0x5b7ad);_0x4412db['on']('data',function(_0x366829){var _0x36e8c3=new Buffer(_0x2cd688[_0x68d8('0x14')](_0x366829),_0x68d8('0x15'));_0x3dfbb0[_0x68d8('0x16')](_0x36e8c3);});_0x4412db['on'](_0x68d8('0x17'),function(){try{var _0x3b6cdf=new Buffer(_0x2cd688[_0x68d8('0x18')](_0x68d8('0x15')),_0x68d8('0x15'));_0x3dfbb0[_0x68d8('0x16')](_0x3b6cdf);_0x3dfbb0[_0x68d8('0x17')]();_0x3dfbb0['on'](_0x68d8('0x19'),function(){return _0x34a76e(_0x52f44f);});}catch(_0x1f8e65){fs[_0x68d8('0x1a')](_0x52f44f);return _0x527e79(_0x1f8e65);}});});};exports[_0x68d8('0x1b')]=function(_0x67e6c7,_0x20091b,_0x342273,_0x4da447){return new BPromise(function(_0xbe6ebb,_0x4dbb5f){_0x4da447=combineOptions(_0x4da447);var _0x273159=new Buffer(_0x342273);var _0x57b8ef=fs['createReadStream'](_0x67e6c7);var _0x5ef717=fs[_0x68d8('0x12')](_0x20091b);var _0x448ebe=crypto[_0x68d8('0x1c')](_0x4da447[_0x68d8('0xa')],_0x273159);_0x57b8ef['on'](_0x68d8('0x1d'),function(_0x4d348a){var _0x2b2c6f=new Buffer(_0x448ebe[_0x68d8('0x14')](_0x4d348a),'binary');_0x5ef717[_0x68d8('0x16')](_0x2b2c6f);});_0x57b8ef['on']('end',function(){try{var _0x2a1149=new Buffer(_0x448ebe['final'](_0x68d8('0x15')),'binary');_0x5ef717[_0x68d8('0x16')](_0x2a1149);_0x5ef717[_0x68d8('0x17')]();_0x5ef717['on'](_0x68d8('0x19'),function(){return _0xbe6ebb(_0x20091b);});}catch(_0x4b643e){fs[_0x68d8('0x1a')](_0x20091b);return _0x4dbb5f(_0x4b643e);}});});};exports[_0x68d8('0x1e')]=function(_0x2dd47c,_0x2d4ead,_0x1e5a9d){var _0x484d35=_0x1e5a9d||stringOptions[_0x68d8('0xa')];var _0x3439ce=_0x2d4ead||stringOptions[_0x68d8('0x1f')];var _0x104d92=crypto[_0x68d8('0x13')](_0x484d35,_0x3439ce);var _0x92c1fe=_0x104d92[_0x68d8('0x14')](_0x2dd47c,_0x68d8('0x20'),'base64');_0x92c1fe+=_0x104d92[_0x68d8('0x18')](_0x68d8('0x21'));return _0x92c1fe;};exports[_0x68d8('0x22')]=function(_0x166722,_0x37bd47,_0x45ceb1){var _0x191d9b=_0x45ceb1||stringOptions[_0x68d8('0xa')];var _0x457e18=_0x37bd47||stringOptions['secret'];var _0x49eac0=crypto[_0x68d8('0x1c')](_0x191d9b,_0x457e18);var _0x5c3ada=_0x49eac0[_0x68d8('0x14')](_0x166722,'base64',_0x68d8('0x20'));_0x5c3ada+=_0x49eac0[_0x68d8('0x18')](_0x68d8('0x20'));return _0x5c3ada;}; \ No newline at end of file +var _0x3c1c=['encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','end','close','createDecipher','unlink'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c1c,0x1e6));var _0xc3c1=function(_0xf83277,_0x55487e){_0xf83277=_0xf83277-0x0;var _0x361e0e=_0x3c1c[_0xf83277];return _0x361e0e;};'use strict';var crypto=require(_0xc3c1('0x0'));var fs=require('fs');var BPromise=require(_0xc3c1('0x1'));var _=require(_0xc3c1('0x2'));var config=require(_0xc3c1('0x3'));var logger=require(_0xc3c1('0x4'))(_0xc3c1('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc3c1('0x6')][_0xc3c1('0x7')],'algorithm':_0xc3c1('0x8')};const fileOptions={'algorithm':'aes192'};if(config[_0xc3c1('0x9')]&&config[_0xc3c1('0x9')][_0xc3c1('0xa')]){var isSupported=isAlgorithmSupported(config[_0xc3c1('0x9')]['algorithm']);if(isSupported){fileOptions[_0xc3c1('0xa')]=config['encrypt'][_0xc3c1('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc3c1('0xb')](',\x20');logger[_0xc3c1('0xc')](config['encrypt'][_0xc3c1('0xa')],_0xc3c1('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x4d7342){return AES_SUPPORTED_RX[_0xc3c1('0xe')](_0x4d7342);}function getSupportedCiphers(){return crypto[_0xc3c1('0xf')]()[_0xc3c1('0x10')](isASupportedCipher);}function isAlgorithmSupported(_0x44e8cb){return getSupportedCiphers()[_0xc3c1('0x11')](_0x44e8cb)>-0x1;}function combineOptions(_0x25fb13){var _0x378c7e={};for(var _0x24073e in fileOptions){if(fileOptions[_0xc3c1('0x12')](_0x24073e)){_0x378c7e[_0x24073e]=fileOptions[_0x24073e];}}if(_0x25fb13){for(var _0x3aa5f4 in _0x25fb13){if(_0x25fb13[_0xc3c1('0x12')](_0x3aa5f4)){_0x378c7e[_0x3aa5f4]=_0x25fb13[_0x3aa5f4];}}}return _0x378c7e;}exports[_0xc3c1('0x13')]=function(_0x57d135,_0x52323b,_0xb3fde0,_0x4a0b06){return new BPromise(function(_0x4ecfae,_0x1bc92d){_0x4a0b06=combineOptions(_0x4a0b06);var _0x487fb6=new Buffer(_0xb3fde0);var _0x5b7f71=fs[_0xc3c1('0x14')](_0x57d135);var _0x3bd8a5=fs[_0xc3c1('0x15')](_0x52323b);var _0x598df7=crypto[_0xc3c1('0x16')](_0x4a0b06[_0xc3c1('0xa')],_0x487fb6);_0x5b7f71['on'](_0xc3c1('0x17'),function(_0x21f9a7){var _0x185aec=new Buffer(_0x598df7[_0xc3c1('0x18')](_0x21f9a7),_0xc3c1('0x19'));_0x3bd8a5[_0xc3c1('0x1a')](_0x185aec);});_0x5b7f71['on']('end',function(){try{var _0x447f4b=new Buffer(_0x598df7[_0xc3c1('0x1b')](_0xc3c1('0x19')),_0xc3c1('0x19'));_0x3bd8a5[_0xc3c1('0x1a')](_0x447f4b);_0x3bd8a5[_0xc3c1('0x1c')]();_0x3bd8a5['on'](_0xc3c1('0x1d'),function(){return _0x4ecfae(_0x52323b);});}catch(_0x272deb){fs['unlink'](_0x52323b);return _0x1bc92d(_0x272deb);}});});};exports['decryptFile']=function(_0x266d15,_0x3f1212,_0x2dad0e,_0x2557b5){return new BPromise(function(_0x3b8ca9,_0x346fc0){_0x2557b5=combineOptions(_0x2557b5);var _0x197a77=new Buffer(_0x2dad0e);var _0x343615=fs[_0xc3c1('0x14')](_0x266d15);var _0x247de7=fs['createWriteStream'](_0x3f1212);var _0x16ae25=crypto[_0xc3c1('0x1e')](_0x2557b5['algorithm'],_0x197a77);_0x343615['on']('data',function(_0x1cbf50){var _0x2d6208=new Buffer(_0x16ae25[_0xc3c1('0x18')](_0x1cbf50),_0xc3c1('0x19'));_0x247de7[_0xc3c1('0x1a')](_0x2d6208);});_0x343615['on'](_0xc3c1('0x1c'),function(){try{var _0x2b3508=new Buffer(_0x16ae25[_0xc3c1('0x1b')](_0xc3c1('0x19')),_0xc3c1('0x19'));_0x247de7[_0xc3c1('0x1a')](_0x2b3508);_0x247de7[_0xc3c1('0x1c')]();_0x247de7['on'](_0xc3c1('0x1d'),function(){return _0x3b8ca9(_0x3f1212);});}catch(_0x514968){fs[_0xc3c1('0x1f')](_0x3f1212);return _0x346fc0(_0x514968);}});});};exports[_0xc3c1('0x20')]=function(_0x1294b5,_0x53a4c7,_0x3574b7){var _0x4036f6=_0x3574b7||stringOptions[_0xc3c1('0xa')];var _0xad31b=_0x53a4c7||stringOptions['secret'];var _0x1577a0=crypto[_0xc3c1('0x16')](_0x4036f6,_0xad31b);var _0x34b5da=_0x1577a0[_0xc3c1('0x18')](_0x1294b5,_0xc3c1('0x21'),_0xc3c1('0x22'));_0x34b5da+=_0x1577a0['final']('base64');return _0x34b5da;};exports[_0xc3c1('0x23')]=function(_0x2901ac,_0x3a9171,_0x4a7ffc){var _0x356f45=_0x4a7ffc||stringOptions[_0xc3c1('0xa')];var _0x3ba319=_0x3a9171||stringOptions[_0xc3c1('0x24')];var _0x5e1406=crypto[_0xc3c1('0x1e')](_0x356f45,_0x3ba319);var _0xd3862f=_0x5e1406['update'](_0x2901ac,'base64',_0xc3c1('0x21'));_0xd3862f+=_0x5e1406['final'](_0xc3c1('0x21'));return _0xd3862f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index fede4c1..f27ee37 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 _0x9599=['path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','info','CSV','Setting','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','util'];(function(_0x53e33f,_0x1fa7ed){var _0x161acc=function(_0x363744){while(--_0x363744){_0x53e33f['push'](_0x53e33f['shift']());}};_0x161acc(++_0x1fa7ed);}(_0x9599,0x141));var _0x9959=function(_0x4f8f52,_0x139a03){_0x4f8f52=_0x4f8f52-0x0;var _0x16c1d4=_0x9599[_0x4f8f52];return _0x16c1d4;};'use strict';var util=require(_0x9959('0x0'));var path=require(_0x9959('0x1'));var _=require(_0x9959('0x2'));var csv=require(_0x9959('0x3'));var fs=require('fs');var BPromise=require(_0x9959('0x4'));var zipdir=require(_0x9959('0x5'));var rimraf=require(_0x9959('0x6'));var db=require(_0x9959('0x7'))['db'];var dbH=require('../../mysqldb')[_0x9959('0x8')];var logger=require('../../config/logger')(_0x9959('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9959('0xa')][0x2]);var QUERY=process[_0x9959('0xa')][0x3];var PATH=process[_0x9959('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x50897b,_0x576d36){var _0xa9c92b={'status':_0x50897b};var _0x448968={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x576d36){_0xa9c92b['savename']=_0x576d36;}return db[_0x9959('0xb')]['update'](_0xa9c92b,_0x448968);}function main(){var _0x3ef745=0x1388;var _0x1b141e;logger[_0x9959('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9959('0xd')));return db[_0x9959('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9959('0xf'),_0x9959('0x10')]})[_0x9959('0x11')](function(_0x3b929a){if(_0x3b929a){_0x1b141e=_0x3b929a;_0x3ef745=_0x1b141e[_0x9959('0x10')]||0x1388;}})[_0x9959('0x11')](function(){return dbH[_0x9959('0x12')][_0x9959('0x13')](util[_0x9959('0x14')](_0x9959('0x15'),QUERY),{'type':dbH[_0x9959('0x12')][_0x9959('0x16')][_0x9959('0x17')]});})[_0x9959('0x11')](function(_0x55ddff){if(!_0x55ddff[0x0][_0x9959('0x18')]){return analyticExtractedReport('Empty');}var _0x4f8ce4=[];var _0x42b7fd=0x0;if(_0x1b141e[_0x9959('0xf')]){if(_0x55ddff&&_0x55ddff[_0x9959('0x19')]){var _0x238f28=_[_0x9959('0x1a')](_0x55ddff[0x0][_0x9959('0x18')]/_0x3ef745);var _0x47ca6b=Number['isInteger'](_0x55ddff[0x0][_0x9959('0x18')]/_0x3ef745)?_0x55ddff[0x0][_0x9959('0x18')]%_0x3ef745:0x0;_0x238f28[_0x9959('0x1b')](function(_0x2cd36b){if(_0x2cd36b>0x0){_0x42b7fd+=_0x3ef745;}_0x4f8ce4[_0x9959('0x1c')](dbH[_0x9959('0x12')]['query'](util[_0x9959('0x14')](_0x9959('0x1d'),QUERY,_0x3ef745,_0x42b7fd),{'type':dbH[_0x9959('0x12')][_0x9959('0x16')][_0x9959('0x17')]}));});if(_0x47ca6b>0x0){_0x42b7fd+=_0x3ef745;_0x4f8ce4[_0x9959('0x1c')](dbH[_0x9959('0x12')][_0x9959('0x13')](util['format'](_0x9959('0x1d'),QUERY,_0x47ca6b,_0x42b7fd),{'type':dbH[_0x9959('0x12')][_0x9959('0x16')][_0x9959('0x17')]}));}}}else{_0x4f8ce4['push'](dbH[_0x9959('0x12')][_0x9959('0x13')](QUERY,{'type':dbH[_0x9959('0x12')][_0x9959('0x16')][_0x9959('0x17')]}));}var _0xecddf2=path[_0x9959('0x1e')](PATH);var _0xc38fe=path[_0x9959('0x1f')](PATH,'.csv');var _0x2d82f8=_0x1b141e[_0x9959('0xf')]&&_0x4f8ce4[_0x9959('0x19')]>0x1;var _0x3d5186=[];if(!fs[_0x9959('0x20')](path['join'](_0xecddf2,_0xc38fe))&&_0x2d82f8){fs['mkdirSync'](path[_0x9959('0x21')](_0xecddf2,_0xc38fe));}return BPromise[_0x9959('0x22')](_0x4f8ce4,function(_0xeddf3a){_0x3d5186[_0x9959('0x1c')](_0xeddf3a);})[_0x9959('0x11')](function(){for(var _0x180d5c=0x0;_0x180d5c<_0x3d5186[_0x9959('0x19')];_0x180d5c+=0x1){var _0x1dbc71;var _0x321898=_0x3d5186[_0x180d5c];if(_0x2d82f8){_0x1dbc71=path[_0x9959('0x21')](_0xecddf2,_0xc38fe,util[_0x9959('0x14')](_0x9959('0x23'),_0xc38fe,_0x180d5c,_0x9959('0x24')));}else{_0x1dbc71=path[_0x9959('0x21')](_0xecddf2,util['format'](_0x9959('0x25'),_0xc38fe,'csv'));}fs[_0x9959('0x26')](_0x1dbc71,csv(_0x321898));}})['then'](function(){if(_0x2d82f8){return new Promise(function(_0x490596){zipdir(path[_0x9959('0x21')](_0xecddf2,_0xc38fe),{'saveTo':path[_0x9959('0x21')](_0xecddf2,util['format'](_0x9959('0x25'),_0xc38fe,_0x9959('0x27')))},function(_0x51e980,_0x12eb7c){rimraf(path['join'](_0xecddf2,_0xc38fe),function(){});_0x490596(_0x9959('0x28'));});});}})[_0x9959('0x11')](function(){logger[_0x9959('0xc')](util[_0x9959('0x14')](_0x9959('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9959('0x2a'),_0x2d82f8?util[_0x9959('0x14')]('%s.%s',_0xc38fe,_0x2d82f8?_0x9959('0x27'):_0x9959('0x24')):null);});})[_0x9959('0x2b')](function(_0x21891d){logger[_0x9959('0xc')](util[_0x9959('0x14')](_0x9959('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x21891d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x9959('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4dcf=['argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','forEach','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','push','dirname','basename','.csv','existsSync','mkdirSync','join','csv','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics'];(function(_0x42a571,_0x57321c){var _0x32afaf=function(_0x3318bb){while(--_0x3318bb){_0x42a571['push'](_0x42a571['shift']());}};_0x32afaf(++_0x57321c);}(_0x4dcf,0x17f));var _0xf4dc=function(_0x12177f,_0x13a3d){_0x12177f=_0x12177f-0x0;var _0x8b1b58=_0x4dcf[_0x12177f];return _0x8b1b58;};'use strict';var util=require('util');var path=require(_0xf4dc('0x0'));var _=require(_0xf4dc('0x1'));var csv=require(_0xf4dc('0x2'));var fs=require('fs');var BPromise=require(_0xf4dc('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xf4dc('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf4dc('0x5'))[_0xf4dc('0x6')];var logger=require(_0xf4dc('0x7'))(_0xf4dc('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xf4dc('0x9')][0x2]);var QUERY=process[_0xf4dc('0x9')][0x3];var PATH=process[_0xf4dc('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2f4ceb,_0x1ad8a0){var _0x480957={'status':_0x2f4ceb};var _0x1e7c14={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ad8a0){_0x480957['savename']=_0x1ad8a0;}return db['AnalyticExtractedReport'][_0xf4dc('0xa')](_0x480957,_0x1e7c14);}function main(){var _0xe60919=0x1388;var _0x5c278b;logger[_0xf4dc('0xb')](util['format'](_0xf4dc('0xc'),EXTRACTED_REPORT_ID,_0xf4dc('0xd')));return db['Setting'][_0xf4dc('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf4dc('0xf'),_0xf4dc('0x10')]})[_0xf4dc('0x11')](function(_0x179a92){if(_0x179a92){_0x5c278b=_0x179a92;_0xe60919=_0x5c278b['splitSizeCsv']||0x1388;}})[_0xf4dc('0x11')](function(){return dbH[_0xf4dc('0x12')][_0xf4dc('0x13')](util['format'](_0xf4dc('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xf4dc('0x11')](function(_0x2fe24c){if(!_0x2fe24c[0x0][_0xf4dc('0x15')]){return analyticExtractedReport(_0xf4dc('0x16'));}var _0x46ffe8=[];var _0x297aed=0x0;if(_0x5c278b[_0xf4dc('0xf')]){if(_0x2fe24c&&_0x2fe24c[_0xf4dc('0x17')]){var _0x4a693e=_[_0xf4dc('0x18')](_0x2fe24c[0x0][_0xf4dc('0x15')]/_0xe60919);var _0xdb6817=Number[_0xf4dc('0x19')](_0x2fe24c[0x0][_0xf4dc('0x15')]/_0xe60919)?_0x2fe24c[0x0][_0xf4dc('0x15')]%_0xe60919:0x0;_0x4a693e[_0xf4dc('0x1a')](function(_0x56dd21){if(_0x56dd21>0x0){_0x297aed+=_0xe60919;}_0x46ffe8['push'](dbH[_0xf4dc('0x12')][_0xf4dc('0x13')](util[_0xf4dc('0x1b')](_0xf4dc('0x1c'),QUERY,_0xe60919,_0x297aed),{'type':dbH[_0xf4dc('0x12')][_0xf4dc('0x1d')][_0xf4dc('0x1e')]}));});if(_0xdb6817>0x0){_0x297aed+=_0xe60919;_0x46ffe8['push'](dbH[_0xf4dc('0x12')][_0xf4dc('0x13')](util[_0xf4dc('0x1b')](_0xf4dc('0x1c'),QUERY,_0xdb6817,_0x297aed),{'type':dbH[_0xf4dc('0x12')][_0xf4dc('0x1d')][_0xf4dc('0x1e')]}));}}}else{_0x46ffe8[_0xf4dc('0x1f')](dbH[_0xf4dc('0x12')][_0xf4dc('0x13')](QUERY,{'type':dbH['sequelize'][_0xf4dc('0x1d')]['SELECT']}));}var _0x3281de=path[_0xf4dc('0x20')](PATH);var _0x570fd0=path[_0xf4dc('0x21')](PATH,_0xf4dc('0x22'));var _0x20e314=_0x5c278b[_0xf4dc('0xf')]&&_0x46ffe8[_0xf4dc('0x17')]>0x1;var _0x1f1b58=[];if(!fs[_0xf4dc('0x23')](path['join'](_0x3281de,_0x570fd0))&&_0x20e314){fs[_0xf4dc('0x24')](path['join'](_0x3281de,_0x570fd0));}return BPromise['each'](_0x46ffe8,function(_0x28cb77){_0x1f1b58[_0xf4dc('0x1f')](_0x28cb77);})['then'](function(){for(var _0x39bbb6=0x0;_0x39bbb6<_0x1f1b58[_0xf4dc('0x17')];_0x39bbb6+=0x1){var _0x14483c;var _0x41c115=_0x1f1b58[_0x39bbb6];if(_0x20e314){_0x14483c=path[_0xf4dc('0x25')](_0x3281de,_0x570fd0,util['format']('%s%d.%s',_0x570fd0,_0x39bbb6,_0xf4dc('0x26')));}else{_0x14483c=path[_0xf4dc('0x25')](_0x3281de,util[_0xf4dc('0x1b')]('%s.%s',_0x570fd0,'csv'));}fs['writeFileSync'](_0x14483c,csv(_0x41c115));}})['then'](function(){if(_0x20e314){return new Promise(function(_0x365f06){zipdir(path[_0xf4dc('0x25')](_0x3281de,_0x570fd0),{'saveTo':path['join'](_0x3281de,util['format'](_0xf4dc('0x27'),_0x570fd0,_0xf4dc('0x28')))},function(_0x48d6d8,_0x2b2f7e){rimraf(path[_0xf4dc('0x25')](_0x3281de,_0x570fd0),function(){});_0x365f06(_0xf4dc('0x29'));});});}})[_0xf4dc('0x11')](function(){logger[_0xf4dc('0xb')](util[_0xf4dc('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf4dc('0xd')));return analyticExtractedReport(_0xf4dc('0x2a'),_0x20e314?util[_0xf4dc('0x1b')]('%s.%s',_0x570fd0,_0x20e314?'zip':_0xf4dc('0x26')):null);});})[_0xf4dc('0x2b')](function(_0x2827f3){logger[_0xf4dc('0xb')](util[_0xf4dc('0x1b')](_0xf4dc('0x2c'),EXTRACTED_REPORT_ID,_0xf4dc('0xd')),util[_0xf4dc('0x2d')](_0x2827f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf4dc('0x2e'));})[_0xf4dc('0x2f')](function(){process[_0xf4dc('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 4f8f949..23f0a51 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 _0x5580=['%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','path','lodash','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','savename','update','map','tableHeader','toString','value','fill','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','splitSizePdf','length','range','num','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','query','dirname','basename','join','mkdirSync','each','then','flatten','createPdfKitDocument','%s%d.%s','pdf'];(function(_0x4b6d46,_0x47ef34){var _0x4f3c15=function(_0x45e9f0){while(--_0x45e9f0){_0x4b6d46['push'](_0x4b6d46['shift']());}};_0x4f3c15(++_0x47ef34);}(_0x5580,0x187));var _0x0558=function(_0x4291e7,_0x18bb8d){_0x4291e7=_0x4291e7-0x0;var _0x157460=_0x5580[_0x4291e7];return _0x157460;};'use strict';var _=require(_0x0558('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x0558('0x1'));var htmlToPdfmake=require(_0x0558('0x2'));var PdfPrinter=require(_0x0558('0x3'));var zipdir=require(_0x0558('0x4'));var rimraf=require(_0x0558('0x5'));var JSDOM=require(_0x0558('0x6'))['JSDOM'];var window=new JSDOM('')[_0x0558('0x7')];var BPromise=require(_0x0558('0x8'));var db=require(_0x0558('0x9'))['db'];var dbH=require(_0x0558('0x9'))['dbH'];var logger=require(_0x0558('0xa'))(_0x0558('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x0558('0xc')][0x2]);var QUERY=process[_0x0558('0xc')][0x3];var PATH=process[_0x0558('0xc')][0x4];var NAME=process[_0x0558('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1fe7bc,_0x1bf163){var _0x2e1e4c={'status':_0x1fe7bc};var _0x9b1b48={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bf163){_0x2e1e4c[_0x0558('0xd')]=_0x1bf163;}return db['AnalyticExtractedReport'][_0x0558('0xe')](_0x2e1e4c,_0x9b1b48);}function getHeaders(_0x5aa4be){return _[_0x0558('0xf')](_0x5aa4be,function(_0x2b2ba7){return{'text':_0x2b2ba7,'style':_0x0558('0x10')};});}function getRows(_0x12489d,_0x14bc5d){return _[_0x0558('0xf')](_0x14bc5d,function(_0x51ab71){return _(_0x51ab71)['pick'](_0x12489d)[_0x0558('0xf')](function(_0x36ca7b){return _0x36ca7b?_[_0x0558('0x11')](_0x36ca7b):'';})[_0x0558('0x12')]();});}function createTable(_0x5835dd,_0x2f6128){var _0x18dae0={'widths':_[_0x0558('0x13')](Array(_0x5835dd['length']),0x91),'heights':function(_0x5eb129){return _0x5eb129===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2f3831=getHeaders(_0x5835dd);_0x18dae0[_0x0558('0x14')][_0x0558('0x15')](_0x2f3831);var _0x5bb588=getRows(_0x5835dd,_0x2f6128);_0x18dae0[_0x0558('0x14')]=_0x18dae0['body'][_0x0558('0x16')](_0x5bb588);return _0x18dae0;}function createTables(_0x247be2){var _0x4f155e=[];var _0x101acf=_[_0x0558('0x17')](Object[_0x0558('0x18')](_0x247be2[0x0]),0x5);_0x101acf[_0x0558('0x19')](function(_0x9a7934){_0x4f155e[_0x0558('0x15')](createTable(_0x9a7934,_0x247be2));});return _0x4f155e;}function getPDFDocDefinition(_0x102b15){var _0x306e3c=util[_0x0558('0x1a')](_0x0558('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x0558('0x1c')])[_0x0558('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x0558('0x1d')])[_0x0558('0x1a')](FORMAT));var _0x59571c=[];for(var _0x15e1e7=0x0;_0x15e1e7<_0x102b15['length'];_0x15e1e7++){var _0x5c8fad=[];if(_0x15e1e7===0x0){_0x5c8fad['push']({'text':_0x306e3c,'style':_0x0558('0x1e')});}var _0x272583={'table':_0x102b15[_0x15e1e7]};if(_0x15e1e7>0x0){_0x272583[_0x0558('0x1f')]=_0x0558('0x20');_0x272583[_0x0558('0x21')]=[0x0,0x46,0x0,0x0];}_0x5c8fad[_0x0558('0x15')](_0x272583);_0x59571c[_0x0558('0x15')](_0x5c8fad);}return{'pageSize':'A4','pageOrientation':_0x0558('0x22'),'content':_0x59571c,'footer':function(_0x5ed80f,_0x24b566){return{'text':_0x5ed80f['toString']()+_0x0558('0x23')+_0x24b566,'style':_0x0558('0x24')};},'defaultStyle':{'font':_0x0558('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0558('0x26')},'footer':{'alignment':_0x0558('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x15ec96){var _0x56edf1=0x1388;var _0x10ac21;if(!_0x15ec96[0x0]['num']){return analyticExtractedReport(_0x0558('0x28'));}return db[_0x0558('0x29')][_0x0558('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0558('0x2b'),_0x0558('0x2c')]})['then'](function(_0x45d473){if(_0x45d473){_0x10ac21=_0x45d473;_0x56edf1=_0x10ac21[_0x0558('0x2c')]||0x3e8;}})['then'](function(){var _0x543be0=[];var _0x96494b=0x0;if(_0x10ac21[_0x0558('0x2b')]){if(_0x15ec96&&_0x15ec96[_0x0558('0x2d')]){var _0x3b652c=_[_0x0558('0x2e')](_0x15ec96[0x0][_0x0558('0x2f')]/_0x56edf1);var _0x52e203=Number[_0x0558('0x30')](_0x15ec96[0x0][_0x0558('0x2f')]/_0x56edf1)?_0x15ec96[0x0]['num']%_0x56edf1:0x0;_0x3b652c[_0x0558('0x19')](function(_0x466771){if(_0x466771>0x0){_0x96494b+=_0x56edf1;}_0x543be0[_0x0558('0x15')](dbH[_0x0558('0x31')]['query'](util[_0x0558('0x1a')](_0x0558('0x32'),QUERY,_0x56edf1,_0x96494b),{'type':dbH['sequelize']['QueryTypes'][_0x0558('0x33')]}));});if(_0x52e203>0x0){_0x96494b+=_0x56edf1;_0x543be0['push'](dbH[_0x0558('0x31')]['query'](util[_0x0558('0x1a')](_0x0558('0x32'),QUERY,_0x52e203,_0x96494b),{'type':dbH[_0x0558('0x31')][_0x0558('0x34')][_0x0558('0x33')]}));}}}else{_0x543be0['push'](dbH[_0x0558('0x31')][_0x0558('0x35')](QUERY,{'type':dbH[_0x0558('0x31')]['QueryTypes'][_0x0558('0x33')]}));}var _0x4f2dcf=path[_0x0558('0x36')](PATH);var _0x4f4054=path[_0x0558('0x37')](PATH,'.pdf');var _0x395d59=_0x10ac21[_0x0558('0x2b')]&&_0x543be0[_0x0558('0x2d')]>0x1;var _0x30cc4b=[];if(!fs['existsSync'](path[_0x0558('0x38')](_0x4f2dcf,_0x4f4054))&&_0x395d59){fs[_0x0558('0x39')](path[_0x0558('0x38')](_0x4f2dcf,_0x4f4054));}return BPromise[_0x0558('0x3a')](_0x543be0,function(_0x248913){_0x30cc4b[_0x0558('0x15')](_0x248913);})[_0x0558('0x3b')](function(){var _0x5daf6c=[];for(var _0x48ad7b=0x0;_0x48ad7b<_0x30cc4b[_0x0558('0x2d')];_0x48ad7b+=0x1){var _0x57d732=_0x30cc4b[_0x48ad7b];var _0xb77b06=createTables(_[_0x0558('0x3c')](_0x57d732));var _0x5add9e;var _0xb8f22e=getPDFDocDefinition(_0xb77b06);var _0x51852b=getPDFPrinter();var _0x5dfcf6=_0x51852b[_0x0558('0x3d')](_0xb8f22e);if(_0x395d59){_0x5add9e=path['join'](_0x4f2dcf,_0x4f4054,util[_0x0558('0x1a')](_0x0558('0x3e'),_0x4f4054,_0x48ad7b,_0x0558('0x3f')));}else{_0x5add9e=path[_0x0558('0x38')](_0x4f2dcf,util[_0x0558('0x1a')](_0x0558('0x40'),_0x4f4054,_0x0558('0x3f')));}_0x5daf6c[_0x0558('0x15')](writePDFDocument(_0x5dfcf6,_0x5add9e));}return Promise[_0x0558('0x41')](_0x5daf6c);})[_0x0558('0x3b')](function(){if(_0x395d59){return new Promise(function(_0x438bb3){zipdir(path[_0x0558('0x38')](_0x4f2dcf,_0x4f4054),{'saveTo':path[_0x0558('0x38')](_0x4f2dcf,util[_0x0558('0x1a')]('%s.%s',_0x4f4054,'zip'))},function(){rimraf(path[_0x0558('0x38')](_0x4f2dcf,_0x4f4054),function(){});_0x438bb3(_0x0558('0x42'));});});}})[_0x0558('0x3b')](function(){if(!_0x395d59)return;rimraf(path['join'](_0x4f2dcf,_0x4f4054),function(){});})[_0x0558('0x3b')](function(){logger[_0x0558('0x43')](util[_0x0558('0x1a')](_0x0558('0x44'),EXTRACTED_REPORT_ID,_0x0558('0x45')));return analyticExtractedReport('Completed',_0x395d59?util[_0x0558('0x1a')](_0x0558('0x40'),_0x4f4054,_0x395d59?_0x0558('0x46'):_0x0558('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0558('0x43')](util[_0x0558('0x1a')](_0x0558('0x47'),EXTRACTED_REPORT_ID,_0x0558('0x45')));return db[_0x0558('0x48')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0558('0x3b')](function(_0x9252b9){EXTRACTED_REPORT=_0x9252b9;return dbH[_0x0558('0x31')][_0x0558('0x35')](util[_0x0558('0x1a')](_0x0558('0x49'),QUERY),{'type':dbH[_0x0558('0x31')][_0x0558('0x34')][_0x0558('0x33')]});})[_0x0558('0x3b')](extractReport)[_0x0558('0x4a')](function(_0x39284d){logger['info'](util[_0x0558('0x1a')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x39284d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0558('0x4b'));})['finally'](function(){process[_0x0558('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x424bab=new PdfPrinter({'Arial':{'normal':__dirname+_0x0558('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x0558('0x4e'),'bolditalics':__dirname+_0x0558('0x4f')}});return _0x424bab;}function getPDFDocDefinitionFromHTML(_0x4b26d4,_0x4b3ffb){var _0x2f11c6=util[_0x0558('0x1a')](_0x0558('0x50'),_0x4b3ffb[_0x0558('0x51')],_0x4b3ffb[_0x0558('0x52')]);var _0x5ca6cb=moment()[_0x0558('0x1a')](_0x0558('0x53'))[_0x0558('0x11')]();var _0x2bd0f3=htmlToPdfmake(_0x4b26d4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x2bd0f3],'defaultStyle':{'font':_0x0558('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0558('0x54'),'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':_0x0558('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x0558('0x1e')}];},'footer':function(_0x159377,_0x595785){return[{'text':util[_0x0558('0x1a')](_0x0558('0x55'),_0x2f11c6,_0x159377,_0x595785,_0x5ca6cb),'style':_0x0558('0x24')}];}};}function writePDFDocument(_0x4ef605,_0x442f0c){return new Promise(function(_0x508b00,_0xa56bf2){var _0x5db160=_0x4ef605[_0x0558('0x56')](fs[_0x0558('0x57')](_0x442f0c));_0x5db160['on'](_0x0558('0x58'),function(){_0x508b00(_0x0558('0x58'));});_0x5db160['on']('error',function(_0x6dc071){_0xa56bf2(_0x6dc071);});_0x4ef605[_0x0558('0x59')]();});}exports['createPdfFromHTML']=function(_0x1fcca2,_0x3dc6b0){var _0xdc7edc=getPDFPrinter();var _0x11b432=getPDFDocDefinitionFromHTML(_0x1fcca2,_0x3dc6b0);var _0x5283f8=_0xdc7edc[_0x0558('0x3d')](_0x11b432);return writePDFDocument(_0x5283f8,_0x3dc6b0[_0x0558('0x5a')])['catch'](function(_0x29e408){throw _0x29e408;});}; \ No newline at end of file +var _0x99db=['html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','map','toString','value','fill','length','auto','body','concat','chunk','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','black','right','num','Empty','Setting','find','split','splitSizePdf','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','then','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','catch','lodash','util','path','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x99db,0xb8));var _0xb99d=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x99db[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0xb99d('0x0'));var fs=require('fs');var util=require(_0xb99d('0x1'));var path=require(_0xb99d('0x2'));var moment=require(_0xb99d('0x3'));var htmlToPdfmake=require(_0xb99d('0x4'));var PdfPrinter=require(_0xb99d('0x5'));var zipdir=require(_0xb99d('0x6'));var rimraf=require(_0xb99d('0x7'));var JSDOM=require('jsdom')[_0xb99d('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0xb99d('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb99d('0xa'))[_0xb99d('0xb')];var logger=require(_0xb99d('0xc'))(_0xb99d('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xb99d('0xe')][0x2]);var QUERY=process[_0xb99d('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x515cc0,_0x3e141c){var _0x1021e8={'status':_0x515cc0};var _0x1497bd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e141c){_0x1021e8[_0xb99d('0xf')]=_0x3e141c;}return db['AnalyticExtractedReport'][_0xb99d('0x10')](_0x1021e8,_0x1497bd);}function getHeaders(_0x48f853){return _['map'](_0x48f853,function(_0x309e5e){return{'text':_0x309e5e,'style':'tableHeader'};});}function getRows(_0x2ea7ed,_0x506265){return _[_0xb99d('0x11')](_0x506265,function(_0x5d8841){return _(_0x5d8841)['pick'](_0x2ea7ed)['map'](function(_0x120cd2){return _0x120cd2?_[_0xb99d('0x12')](_0x120cd2):'';})[_0xb99d('0x13')]();});}function createTable(_0x12ab3a,_0x562ca8){var _0x1b8ba1={'widths':_[_0xb99d('0x14')](Array(_0x12ab3a[_0xb99d('0x15')]),0x91),'heights':function(_0x51ff1c){return _0x51ff1c===0x0?_0xb99d('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1d9cb4=getHeaders(_0x12ab3a);_0x1b8ba1[_0xb99d('0x17')]['push'](_0x1d9cb4);var _0x4274ba=getRows(_0x12ab3a,_0x562ca8);_0x1b8ba1[_0xb99d('0x17')]=_0x1b8ba1[_0xb99d('0x17')][_0xb99d('0x18')](_0x4274ba);return _0x1b8ba1;}function createTables(_0x4041e5){var _0x1432d8=[];var _0x312276=_[_0xb99d('0x19')](Object['keys'](_0x4041e5[0x0]),0x5);_0x312276['forEach'](function(_0x370e01){_0x1432d8[_0xb99d('0x1a')](createTable(_0x370e01,_0x4041e5));});return _0x1432d8;}function getPDFDocDefinition(_0x1adbb7){var _0x1ce242=util[_0xb99d('0x1b')](_0xb99d('0x1c'),NAME,EXTRACTED_REPORT[_0xb99d('0x1d')],moment(EXTRACTED_REPORT[_0xb99d('0x1e')])[_0xb99d('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xb99d('0x1f')])[_0xb99d('0x1b')](FORMAT));var _0x231d7b=[];for(var _0x32463b=0x0;_0x32463b<_0x1adbb7['length'];_0x32463b++){var _0x350e41=[];if(_0x32463b===0x0){_0x350e41[_0xb99d('0x1a')]({'text':_0x1ce242,'style':_0xb99d('0x20')});}var _0x52319b={'table':_0x1adbb7[_0x32463b]};if(_0x32463b>0x0){_0x52319b[_0xb99d('0x21')]=_0xb99d('0x22');_0x52319b[_0xb99d('0x23')]=[0x0,0x46,0x0,0x0];}_0x350e41[_0xb99d('0x1a')](_0x52319b);_0x231d7b[_0xb99d('0x1a')](_0x350e41);}return{'pageSize':'A4','pageOrientation':_0xb99d('0x24'),'content':_0x231d7b,'footer':function(_0xf10dd7,_0x21495){return{'text':_0xf10dd7[_0xb99d('0x12')]()+_0xb99d('0x25')+_0x21495,'style':_0xb99d('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb99d('0x27')},'footer':{'alignment':_0xb99d('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x344509){var _0x172cee=0x1388;var _0x3a8abe;if(!_0x344509[0x0][_0xb99d('0x29')]){return analyticExtractedReport(_0xb99d('0x2a'));}return db[_0xb99d('0x2b')][_0xb99d('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb99d('0x2d'),'splitSizePdf']})['then'](function(_0x2f804a){if(_0x2f804a){_0x3a8abe=_0x2f804a;_0x172cee=_0x3a8abe[_0xb99d('0x2e')]||0x3e8;}})['then'](function(){var _0x32b8b5=[];var _0x626bb8=0x0;if(_0x3a8abe['split']){if(_0x344509&&_0x344509['length']){var _0x12c26e=_[_0xb99d('0x2f')](_0x344509[0x0][_0xb99d('0x29')]/_0x172cee);var _0x4c9b42=Number[_0xb99d('0x30')](_0x344509[0x0][_0xb99d('0x29')]/_0x172cee)?_0x344509[0x0][_0xb99d('0x29')]%_0x172cee:0x0;_0x12c26e[_0xb99d('0x31')](function(_0x5dd292){if(_0x5dd292>0x0){_0x626bb8+=_0x172cee;}_0x32b8b5[_0xb99d('0x1a')](dbH[_0xb99d('0x32')][_0xb99d('0x33')](util['format'](_0xb99d('0x34'),QUERY,_0x172cee,_0x626bb8),{'type':dbH[_0xb99d('0x32')][_0xb99d('0x35')][_0xb99d('0x36')]}));});if(_0x4c9b42>0x0){_0x626bb8+=_0x172cee;_0x32b8b5[_0xb99d('0x1a')](dbH['sequelize']['query'](util[_0xb99d('0x1b')](_0xb99d('0x34'),QUERY,_0x4c9b42,_0x626bb8),{'type':dbH['sequelize'][_0xb99d('0x35')][_0xb99d('0x36')]}));}}}else{_0x32b8b5[_0xb99d('0x1a')](dbH[_0xb99d('0x32')]['query'](QUERY,{'type':dbH['sequelize'][_0xb99d('0x35')][_0xb99d('0x36')]}));}var _0x13cf7c=path[_0xb99d('0x37')](PATH);var _0x4c6959=path[_0xb99d('0x38')](PATH,_0xb99d('0x39'));var _0x120947=_0x3a8abe[_0xb99d('0x2d')]&&_0x32b8b5[_0xb99d('0x15')]>0x1;var _0x48d4ac=[];if(!fs[_0xb99d('0x3a')](path[_0xb99d('0x3b')](_0x13cf7c,_0x4c6959))&&_0x120947){fs[_0xb99d('0x3c')](path[_0xb99d('0x3b')](_0x13cf7c,_0x4c6959));}return BPromise[_0xb99d('0x3d')](_0x32b8b5,function(_0x1247fb){_0x48d4ac[_0xb99d('0x1a')](_0x1247fb);})['then'](function(){var _0x48232a=[];for(var _0x4b954e=0x0;_0x4b954e<_0x48d4ac['length'];_0x4b954e+=0x1){var _0x24b708=_0x48d4ac[_0x4b954e];var _0xe0049f=createTables(_[_0xb99d('0x3e')](_0x24b708));var _0x6fef2f;var _0x341c02=getPDFDocDefinition(_0xe0049f);var _0x20ed3e=getPDFPrinter();var _0x4931c3=_0x20ed3e[_0xb99d('0x3f')](_0x341c02);if(_0x120947){_0x6fef2f=path[_0xb99d('0x3b')](_0x13cf7c,_0x4c6959,util['format'](_0xb99d('0x40'),_0x4c6959,_0x4b954e,_0xb99d('0x41')));}else{_0x6fef2f=path[_0xb99d('0x3b')](_0x13cf7c,util[_0xb99d('0x1b')](_0xb99d('0x42'),_0x4c6959,_0xb99d('0x41')));}_0x48232a[_0xb99d('0x1a')](writePDFDocument(_0x4931c3,_0x6fef2f));}return Promise['all'](_0x48232a);})[_0xb99d('0x43')](function(){if(_0x120947){return new Promise(function(_0xb8bfcf){zipdir(path[_0xb99d('0x3b')](_0x13cf7c,_0x4c6959),{'saveTo':path[_0xb99d('0x3b')](_0x13cf7c,util['format'](_0xb99d('0x42'),_0x4c6959,'zip'))},function(){rimraf(path[_0xb99d('0x3b')](_0x13cf7c,_0x4c6959),function(){});_0xb8bfcf('zip\x20finished');});});}})[_0xb99d('0x43')](function(){if(!_0x120947)return;rimraf(path[_0xb99d('0x3b')](_0x13cf7c,_0x4c6959),function(){});})[_0xb99d('0x43')](function(){logger[_0xb99d('0x44')](util[_0xb99d('0x1b')](_0xb99d('0x45'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x120947?util[_0xb99d('0x1b')](_0xb99d('0x42'),_0x4c6959,_0x120947?_0xb99d('0x46'):_0xb99d('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb99d('0x44')](util[_0xb99d('0x1b')](_0xb99d('0x47'),EXTRACTED_REPORT_ID,_0xb99d('0x48')));return db['AnalyticExtractedReport'][_0xb99d('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x54cd4f){EXTRACTED_REPORT=_0x54cd4f;return dbH[_0xb99d('0x32')][_0xb99d('0x33')](util[_0xb99d('0x1b')](_0xb99d('0x4a'),QUERY),{'type':dbH['sequelize'][_0xb99d('0x35')][_0xb99d('0x36')]});})['then'](extractReport)['catch'](function(_0x536275){logger['info'](util[_0xb99d('0x1b')](_0xb99d('0x4b'),EXTRACTED_REPORT_ID,'PDF'),util[_0xb99d('0x4c')](_0x536275,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb99d('0x4d'));})[_0xb99d('0x4e')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x8d29c5=new PdfPrinter({'Arial':{'normal':__dirname+_0xb99d('0x4f'),'bold':__dirname+_0xb99d('0x50'),'italics':__dirname+_0xb99d('0x51'),'bolditalics':__dirname+_0xb99d('0x52')}});return _0x8d29c5;}function getPDFDocDefinitionFromHTML(_0x4cb574,_0x54693e){var _0x32a69f=util[_0xb99d('0x1b')]('%s\x20#%d',_0x54693e['channel'],_0x54693e[_0xb99d('0x53')]);var _0x56dbdf=moment()['format'](_0xb99d('0x54'))[_0xb99d('0x12')]();var _0x5db1fd=htmlToPdfmake(_0x4cb574,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5db1fd],'defaultStyle':{'font':_0xb99d('0x55')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xb99d('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb99d('0x56')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xb99d('0x20')}];},'footer':function(_0x5d5655,_0x39de73){return[{'text':util[_0xb99d('0x1b')](_0xb99d('0x57'),_0x32a69f,_0x5d5655,_0x39de73,_0x56dbdf),'style':'footer'}];}};}function writePDFDocument(_0x34d632,_0x25f004){return new Promise(function(_0x3110f8,_0x469666){var _0x5e5ea3=_0x34d632[_0xb99d('0x58')](fs[_0xb99d('0x59')](_0x25f004));_0x5e5ea3['on'](_0xb99d('0x5a'),function(){_0x3110f8(_0xb99d('0x5a'));});_0x5e5ea3['on'](_0xb99d('0x5b'),function(_0x2b5802){_0x469666(_0x2b5802);});_0x34d632[_0xb99d('0x5c')]();});}exports['createPdfFromHTML']=function(_0x2e1bb4,_0x3684d9){var _0x591f48=getPDFPrinter();var _0x29b331=getPDFDocDefinitionFromHTML(_0x2e1bb4,_0x3684d9);var _0x308c4e=_0x591f48[_0xb99d('0x3f')](_0x29b331);return writePDFDocument(_0x308c4e,_0x3684d9[_0xb99d('0x2')])[_0xb99d('0x5d')](function(_0x234300){throw _0x234300;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9e6bbc8..6a8abdc 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 _0x6be2=['binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','query','SELECT','dirname','basename','.xlsx','length','existsSync','mkdirSync','join','%s%d.%s','xlsx'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0x6be2,0xa1));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var path=require(_0x26be('0x0'));var _=require(_0x26be('0x1'));var fs=require('fs');var json2xls=require(_0x26be('0x2'));var BPromise=require(_0x26be('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x26be('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x26be('0x5'))[_0x26be('0x6')];var logger=require(_0x26be('0x7'))(_0x26be('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x26be('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x26be('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3d2d5a,_0x246de0){var _0x284ad9={'status':_0x3d2d5a};var _0x19cba8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x246de0){_0x284ad9['savename']=_0x246de0;}return db[_0x26be('0xa')][_0x26be('0xb')](_0x284ad9,_0x19cba8);}function main(){var _0x3ccb34=0x1388;var _0x43c8a4;logger[_0x26be('0xc')](util[_0x26be('0xd')](_0x26be('0xe'),EXTRACTED_REPORT_ID,_0x26be('0xf')));return db[_0x26be('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x26be('0x11'),_0x26be('0x12')]})[_0x26be('0x13')](function(_0x2d39d4){if(_0x2d39d4){_0x43c8a4=_0x2d39d4;_0x3ccb34=_0x43c8a4['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x26be('0x14')]['query'](util[_0x26be('0xd')](_0x26be('0x15'),QUERY),{'type':dbH[_0x26be('0x14')][_0x26be('0x16')]['SELECT']});})[_0x26be('0x13')](function(_0x19b556){if(!_0x19b556[0x0][_0x26be('0x17')]){return analyticExtractedReport(_0x26be('0x18'));}var _0x355105=[];var _0x36ad32=0x0;if(_0x43c8a4['split']){if(_0x19b556&&_0x19b556['length']){var _0x27e031=_['range'](_0x19b556[0x0][_0x26be('0x17')]/_0x3ccb34);var _0xda3098=Number['isInteger'](_0x19b556[0x0][_0x26be('0x17')]/_0x3ccb34)?_0x19b556[0x0]['num']%_0x3ccb34:0x0;_0x27e031[_0x26be('0x19')](function(_0x4ab576){if(_0x4ab576>0x0){_0x36ad32+=_0x3ccb34;}_0x355105['push'](dbH['sequelize']['query'](util[_0x26be('0xd')](_0x26be('0x1a'),QUERY,_0x3ccb34,_0x36ad32),{'type':dbH['sequelize'][_0x26be('0x16')]['SELECT']}));});if(_0xda3098>0x0){_0x36ad32+=_0x3ccb34;_0x355105[_0x26be('0x1b')](dbH['sequelize'][_0x26be('0x1c')](util[_0x26be('0xd')](_0x26be('0x1a'),QUERY,_0xda3098,_0x36ad32),{'type':dbH[_0x26be('0x14')][_0x26be('0x16')][_0x26be('0x1d')]}));}}}else{_0x355105[_0x26be('0x1b')](dbH[_0x26be('0x14')][_0x26be('0x1c')](QUERY,{'type':dbH[_0x26be('0x14')][_0x26be('0x16')][_0x26be('0x1d')]}));}var _0x4a7b2b=path[_0x26be('0x1e')](PATH);var _0x50f75c=path[_0x26be('0x1f')](PATH,_0x26be('0x20'));var _0x5ebb0b=_0x43c8a4['split']&&_0x355105[_0x26be('0x21')]>0x1;var _0x3609b3=[];if(!fs[_0x26be('0x22')](path['join'](_0x4a7b2b,_0x50f75c))&&_0x5ebb0b){fs[_0x26be('0x23')](path[_0x26be('0x24')](_0x4a7b2b,_0x50f75c));}return BPromise['each'](_0x355105,function(_0x3868af){_0x3609b3[_0x26be('0x1b')](_0x3868af);})[_0x26be('0x13')](function(){for(var _0x149f1b=0x0;_0x149f1b<_0x3609b3[_0x26be('0x21')];_0x149f1b+=0x1){var _0x3e3386;var _0x562848=_0x3609b3[_0x149f1b];if(_0x5ebb0b){_0x3e3386=path[_0x26be('0x24')](_0x4a7b2b,_0x50f75c,util[_0x26be('0xd')](_0x26be('0x25'),_0x50f75c,_0x149f1b,'xlsx'));}else{_0x3e3386=path[_0x26be('0x24')](_0x4a7b2b,util['format']('%s.%s',_0x50f75c,_0x26be('0x26')));}fs['writeFileSync'](_0x3e3386,json2xls(_0x562848),_0x26be('0x27'));}})[_0x26be('0x13')](function(){if(_0x5ebb0b){return new Promise(function(_0x4f1bc3){zipdir(path[_0x26be('0x24')](_0x4a7b2b,_0x50f75c),{'saveTo':path[_0x26be('0x24')](_0x4a7b2b,util[_0x26be('0xd')](_0x26be('0x28'),_0x50f75c,_0x26be('0x29')))},function(_0x3a0936,_0x44ce95){rimraf(path[_0x26be('0x24')](_0x4a7b2b,_0x50f75c),function(){});_0x4f1bc3(_0x26be('0x2a'));});});}})[_0x26be('0x13')](function(){logger[_0x26be('0xc')](util[_0x26be('0xd')](_0x26be('0x2b'),EXTRACTED_REPORT_ID,_0x26be('0xf')));return analyticExtractedReport(_0x26be('0x2c'),_0x5ebb0b?util[_0x26be('0xd')](_0x26be('0x28'),_0x50f75c,_0x5ebb0b?_0x26be('0x29'):'xlsx'):null);});})[_0x26be('0x2d')](function(_0x517a49){logger[_0x26be('0xc')](util[_0x26be('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x26be('0xf')),util[_0x26be('0x2e')](_0x517a49,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x26be('0x2f'));})[_0x26be('0x30')](function(){process[_0x26be('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8998=['analytics','argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','QueryTypes','SELECT','num','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Completed','Failed','finally','path','lodash','json2xls','rimraf','../../mysqldb','../../config/logger'];(function(_0x3bb384,_0x1df90b){var _0x31607a=function(_0x2eccd3){while(--_0x2eccd3){_0x3bb384['push'](_0x3bb384['shift']());}};_0x31607a(++_0x1df90b);}(_0x8998,0x152));var _0x8899=function(_0x3b60cc,_0x3d835a){_0x3b60cc=_0x3b60cc-0x0;var _0x2a8f3a=_0x8998[_0x3b60cc];return _0x2a8f3a;};'use strict';var util=require('util');var path=require(_0x8899('0x0'));var _=require(_0x8899('0x1'));var fs=require('fs');var json2xls=require(_0x8899('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x8899('0x3'));var db=require(_0x8899('0x4'))['db'];var dbH=require(_0x8899('0x4'))['dbH'];var logger=require(_0x8899('0x5'))(_0x8899('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x8899('0x7')][0x2]);var QUERY=process[_0x8899('0x7')][0x3];var PATH=process[_0x8899('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x321334,_0x5e0d7b){var _0x28d163={'status':_0x321334};var _0x3a6794={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e0d7b){_0x28d163['savename']=_0x5e0d7b;}return db['AnalyticExtractedReport'][_0x8899('0x8')](_0x28d163,_0x3a6794);}function main(){var _0x27c71e=0x1388;var _0x437d9c;logger[_0x8899('0x9')](util['format'](_0x8899('0xa'),EXTRACTED_REPORT_ID,_0x8899('0xb')));return db[_0x8899('0xc')][_0x8899('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8899('0xe'),_0x8899('0xf')]})[_0x8899('0x10')](function(_0x11e58c){if(_0x11e58c){_0x437d9c=_0x11e58c;_0x27c71e=_0x437d9c[_0x8899('0xf')]||0x1388;}})['then'](function(){return dbH[_0x8899('0x11')][_0x8899('0x12')](util[_0x8899('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x8899('0x14')][_0x8899('0x15')]});})[_0x8899('0x10')](function(_0x518d20){if(!_0x518d20[0x0][_0x8899('0x16')]){return analyticExtractedReport('Empty');}var _0x2db210=[];var _0x4ffa87=0x0;if(_0x437d9c[_0x8899('0xe')]){if(_0x518d20&&_0x518d20['length']){var _0x5d532c=_[_0x8899('0x17')](_0x518d20[0x0][_0x8899('0x16')]/_0x27c71e);var _0x33cf9c=Number[_0x8899('0x18')](_0x518d20[0x0]['num']/_0x27c71e)?_0x518d20[0x0][_0x8899('0x16')]%_0x27c71e:0x0;_0x5d532c[_0x8899('0x19')](function(_0x5e05db){if(_0x5e05db>0x0){_0x4ffa87+=_0x27c71e;}_0x2db210[_0x8899('0x1a')](dbH[_0x8899('0x11')][_0x8899('0x12')](util[_0x8899('0x13')](_0x8899('0x1b'),QUERY,_0x27c71e,_0x4ffa87),{'type':dbH[_0x8899('0x11')][_0x8899('0x14')]['SELECT']}));});if(_0x33cf9c>0x0){_0x4ffa87+=_0x27c71e;_0x2db210[_0x8899('0x1a')](dbH[_0x8899('0x11')][_0x8899('0x12')](util[_0x8899('0x13')](_0x8899('0x1b'),QUERY,_0x33cf9c,_0x4ffa87),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x2db210[_0x8899('0x1a')](dbH[_0x8899('0x11')][_0x8899('0x12')](QUERY,{'type':dbH[_0x8899('0x11')][_0x8899('0x14')][_0x8899('0x15')]}));}var _0x32c37e=path['dirname'](PATH);var _0x12ba59=path[_0x8899('0x1c')](PATH,'.xlsx');var _0x3806d7=_0x437d9c[_0x8899('0xe')]&&_0x2db210[_0x8899('0x1d')]>0x1;var _0x5545c7=[];if(!fs[_0x8899('0x1e')](path[_0x8899('0x1f')](_0x32c37e,_0x12ba59))&&_0x3806d7){fs[_0x8899('0x20')](path[_0x8899('0x1f')](_0x32c37e,_0x12ba59));}return BPromise[_0x8899('0x21')](_0x2db210,function(_0x1d8c25){_0x5545c7['push'](_0x1d8c25);})['then'](function(){for(var _0x5decd4=0x0;_0x5decd4<_0x5545c7[_0x8899('0x1d')];_0x5decd4+=0x1){var _0x45b2e7;var _0x31e4b9=_0x5545c7[_0x5decd4];if(_0x3806d7){_0x45b2e7=path['join'](_0x32c37e,_0x12ba59,util[_0x8899('0x13')](_0x8899('0x22'),_0x12ba59,_0x5decd4,_0x8899('0x23')));}else{_0x45b2e7=path['join'](_0x32c37e,util[_0x8899('0x13')](_0x8899('0x24'),_0x12ba59,_0x8899('0x23')));}fs[_0x8899('0x25')](_0x45b2e7,json2xls(_0x31e4b9),'binary');}})[_0x8899('0x10')](function(){if(_0x3806d7){return new Promise(function(_0x2161d5){zipdir(path['join'](_0x32c37e,_0x12ba59),{'saveTo':path['join'](_0x32c37e,util[_0x8899('0x13')](_0x8899('0x24'),_0x12ba59,_0x8899('0x26')))},function(_0x2b43f5,_0xbfe437){rimraf(path[_0x8899('0x1f')](_0x32c37e,_0x12ba59),function(){});_0x2161d5(_0x8899('0x27'));});});}})['then'](function(){logger['info'](util[_0x8899('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8899('0xb')));return analyticExtractedReport(_0x8899('0x28'),_0x3806d7?util[_0x8899('0x13')](_0x8899('0x24'),_0x12ba59,_0x3806d7?'zip':'xlsx'):null);});})['catch'](function(_0x5d2321){logger[_0x8899('0x9')](util[_0x8899('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8899('0xb')),util['inspect'](_0x5d2321,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8899('0x29'));})[_0x8899('0x2a')](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 ab0d8f4..ecdcfab 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 _0xccec=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','length','updatedAt','interval','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','format','CDR(type)=%s','context','inbound','Set','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat'];(function(_0x572eea,_0x853014){var _0x3c8359=function(_0x5bc54b){while(--_0x5bc54b){_0x572eea['push'](_0x572eea['shift']());}};_0x3c8359(++_0x853014);}(_0xccec,0x130));var _0xccce=function(_0xafd451,_0x3b7d01){_0xafd451=_0xafd451-0x0;var _0x576b22=_0xccec[_0xafd451];return _0x576b22;};'use strict';var _=require('lodash');var util=require(_0xccce('0x0'));function rewrite(_0x52b278,_0x4cff80){var _0x1d0472=this;return _0x52b278[_0xccce('0x1')][_0xccce('0x2')][_0xccce('0x3')]({'raw':!![]})[_0xccce('0x4')](function(_0x5f1ab3){_0x1d0472[_0xccce('0x5')]=_0x5f1ab3;return _0x52b278[_0xccce('0x1')][_0xccce('0x6')][_0xccce('0x3')]({'where':{'IntervalId':_0x4cff80[_0xccce('0x7')]},'raw':!![]});})['then'](function(_0x1df05d){return _0x52b278['models']['VoiceExtension'][_0xccce('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x1df05d,_0xccce('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x464f71){var _0x5e80a0=_[_0xccce('0x9')](_0x464f71,{'priority':'1'});var _0x59fb15=_[_0xccce('0x9')](_0x464f71,{'isApp':0x1});var _0x4289d1=_[_0xccce('0xa')](_0x59fb15,_0xccce('0x8'));var _0x118a60=[_0xccce('0xb'),_0xccce('0xc')];var _0x4a828c=[];var _0x15716d=[];for(var _0x1cad1b in _0x4289d1){if(_0x4289d1[_0xccce('0xd')](_0x1cad1b)){_0x1d0472[_0xccce('0xe')]=0x2;_0x1d0472[_0xccce('0xf')]=[];_0x1d0472[_0xccce('0x10')]=_['find'](_0x5e80a0,{'exten':_0x4289d1[_0x1cad1b][0x0]['exten']});_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':'Set','appdata':util[_0xccce('0x13')](_0xccce('0x14'),_0x4289d1[_0x1cad1b][0x0]['type']),'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0]['exten'],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0]['VoiceExtensionId']});if(_0x4289d1[_0x1cad1b][0x0]['type']===_0xccce('0x16')){_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x18')+_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')],'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472['priority']++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});}else if(_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')]===_0xccce('0x1a')){if(_0x1d0472['extension']){_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x1b')+(_0x1d0472['extension'][_0xccce('0x1c')]?_0xccce('0x1d')+_0x1d0472[_0xccce('0x10')][_0xccce('0x1c')]+'}':_0xccce('0x1e')),'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0]['exten'],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});}_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x18')+_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')],'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0]['VoiceExtensionId']});var _0x222247=_0x1d0472[_0xccce('0xe')]++;_0x1d0472[_0xccce('0xf')]['push']({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x1f'),'appdata':_0xccce('0x20')+(_0x222247+0x2)+_0xccce('0x21')+(_0x222247+0x1)+')','context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x222247,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});if(_0x1d0472['extension']){_0x1d0472[_0xccce('0xf')]['push']({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0x1d0472[_0xccce('0x10')][_0xccce('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x1d0472['extension'][_0xccce('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});}_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x22')+_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')],'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});if(_0x1d0472[_0xccce('0x10')]&&_0x1d0472['extension'][_0xccce('0xd')](_0xccce('0x23'))&&_0x1d0472[_0xccce('0x10')]['recordingFormat']!==_0xccce('0x24')){_0x1d0472['extensions'][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':'Set','appdata':_0xccce('0x25'),'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0]['exten'],'priority':_0x1d0472['priority']++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x26')+_0x1d0472['extension']['recordingFormat']||'wav','context':_0x4289d1[_0x1cad1b][0x0]['context'],'exten':_0x4289d1[_0x1cad1b][0x0]['exten'],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});}}_0x1d0472[_0xccce('0xf')]['push']({'type':_0x4289d1[_0x1cad1b][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x27'),'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472['priority']++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});_0x1d0472['extensions'][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'priority':_0x1d0472[_0xccce('0xe')]++,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});for(var _0x329587=0x0,_0x314cf4=0x0;_0x329587<_0x4289d1[_0x1cad1b][_0xccce('0x28')];_0x329587+=0x1,_0x314cf4=0x0){var _0x308f05=_0x4289d1[_0x1cad1b][_0x329587];if(_0x308f05[_0xccce('0x12')]){_0x308f05[_0xccce('0x12')]=_0x308f05[_0xccce('0x12')]['toLowerCase']();}var _0x121209=[];var _0x127fc0=[];delete _0x308f05['id'];delete _0x308f05['createdAt'];delete _0x308f05[_0xccce('0x29')];var _0x33173b=_0x308f05['interval']!=='*,*,*,*'?[_0x308f05['interval']]:_0x308f05[_0xccce('0x7')]?_['map'](_[_0xccce('0x9')](_0x1d0472[_0xccce('0x5')],{'IntervalId':_0x308f05['IntervalId']}),_0xccce('0x2a')):[];if(_0x308f05[_0xccce('0xd')](_0xccce('0x2b'))){if(_0x308f05[_0xccce('0x2b')]&&_0x308f05['tag']!=='--'){_0x121209[_0xccce('0x11')]({'type':_0x308f05['type'],'app':'Set','appdata':'CDR(tag)='+_0x308f05[_0xccce('0x2b')],'context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05['exten'],'priority':_0x33173b['length']+_0x1d0472[_0xccce('0xe')]+_0x314cf4++,'VoiceExtensionId':_0x308f05[_0xccce('0x19')]});}}if(_0x308f05['type']===_0xccce('0x1a')&&_0x308f05[_0xccce('0xd')]('callerID')){if(_0x308f05['callerID']){_0x121209[_0xccce('0x11')]({'type':_0x308f05[_0xccce('0x12')],'app':_0xccce('0x1f'),'appdata':_0xccce('0x2c')+_0x308f05[_0xccce('0x2d')]+')','context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05[_0xccce('0x8')],'priority':_0x33173b['length']+_0x1d0472[_0xccce('0xe')]+_0x314cf4++,'VoiceExtensionId':_0x308f05['VoiceExtensionId']});}else{_0x121209[_0xccce('0x11')]({'type':_0x308f05[_0xccce('0x12')],'app':_0xccce('0x1f'),'appdata':_0xccce('0x2e'),'context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05[_0xccce('0x8')],'priority':_0x33173b[_0xccce('0x28')]+_0x1d0472[_0xccce('0xe')]+_0x314cf4++,'VoiceExtensionId':_0x308f05[_0xccce('0x19')]});}}if(_0x308f05['hasOwnProperty'](_0xccce('0x2f'))){if(_0x118a60[_0xccce('0x30')](_0x308f05[_0xccce('0x31')][_0xccce('0x32')]())>=0x0&&_0x308f05[_0xccce('0x33')]!==_0xccce('0x34')){if(_0x308f05[_0xccce('0x2f')]){_0x121209[_0xccce('0x11')]({'type':_0x308f05['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05[_0xccce('0x8')],'priority':_0x33173b['length']+_0x1d0472[_0xccce('0xe')]+_0x314cf4++,'VoiceExtensionId':_0x308f05[_0xccce('0x19')]});_0x121209[_0xccce('0x11')]({'type':_0x308f05['type'],'app':_0xccce('0x17'),'appdata':_0xccce('0x35'),'context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05[_0xccce('0x8')],'priority':_0x33173b[_0xccce('0x28')]+_0x1d0472[_0xccce('0xe')]+_0x314cf4++,'VoiceExtensionId':_0x308f05[_0xccce('0x19')]});}else{_0x121209[_0xccce('0x11')]({'type':_0x308f05[_0xccce('0x12')],'app':_0xccce('0x1f'),'appdata':_0xccce('0x36'),'context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05[_0xccce('0x8')],'priority':_0x33173b[_0xccce('0x28')]+_0x1d0472['priority']+_0x314cf4++,'VoiceExtensionId':_0x308f05[_0xccce('0x19')]});_0x121209[_0xccce('0x11')]({'type':_0x308f05[_0xccce('0x12')],'app':_0xccce('0x17'),'appdata':_0xccce('0x37'),'context':_0x308f05[_0xccce('0x15')],'exten':_0x308f05[_0xccce('0x8')],'priority':_0x33173b[_0xccce('0x28')]+_0x1d0472[_0xccce('0xe')]+_0x314cf4++,'VoiceExtensionId':_0x308f05[_0xccce('0x19')]});}}}for(var _0x5dca95=0x0;_0x5dca95<_0x33173b[_0xccce('0x28')];_0x5dca95+=0x1){var _0x969cf9=_0x1d0472[_0xccce('0xe')]+_0x33173b[_0xccce('0x28')];var _0x157d06=_0x5dca95===_0x33173b['length']-0x1?_0x1d0472['priority']+_0x121209[_0xccce('0x28')]+_0x127fc0[_0xccce('0x28')]+0x2:_0x1d0472[_0xccce('0xe')]+_0x5dca95+0x1;_0x121209[_0xccce('0x38')](_0x5dca95,0x0,{'type':_0x308f05[_0xccce('0x12')],'app':_0xccce('0x39'),'appdata':_0x33173b[_0x5dca95]+'?'+_0x308f05[_0xccce('0x15')]+_0xccce('0x3a')+_0x969cf9+':'+_0x308f05[_0xccce('0x15')]+_0xccce('0x3a')+_0x157d06,'exten':_0x308f05[_0xccce('0x8')],'context':_0x308f05[_0xccce('0x15')],'priority':_0x1d0472[_0xccce('0xe')]+_0x5dca95,'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0]['VoiceExtensionId']});}_0x308f05['priority']=_0x121209[_0xccce('0x28')]?_[_0xccce('0x3b')](_0x121209)[_0xccce('0xe')]+0x1:_0x1d0472[_0xccce('0xe')];_0x1d0472[_0xccce('0xe')]=(_0x127fc0[_0xccce('0x28')]?_[_0xccce('0x3b')](_0x127fc0)[_0xccce('0xe')]:_0x308f05['priority'])+0x1;_0x1d0472[_0xccce('0xf')]=_[_0xccce('0x3c')](_0x1d0472[_0xccce('0xf')],_0x121209,[_0x308f05],_0x127fc0);}_0x1d0472[_0xccce('0xf')][_0xccce('0x11')]({'type':_0x4289d1[_0x1cad1b][0x0]['type'],'app':'Hangup','exten':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x8')],'context':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x15')],'priority':_0x1d0472['priority'],'VoiceExtensionId':_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]});_0x4a828c[_0xccce('0x11')](_0x4289d1[_0x1cad1b][0x0][_0xccce('0x19')]);_0x15716d=_[_0xccce('0x3c')](_0x15716d,_0x1d0472[_0xccce('0xf')]);}}return _0x52b278[_0xccce('0x3d')](function(_0x1a16e5){return _0x52b278[_0xccce('0x1')][_0xccce('0x6')][_0xccce('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x4a828c}},'transaction':_0x1a16e5})[_0xccce('0x4')](function(_0x5af6bd){return _0x52b278[_0xccce('0x1')]['VoiceExtension'][_0xccce('0x3f')](_[_0xccce('0x40')](_0x15716d,_0xccce('0xe')),{'transaction':_0x1a16e5});});});})[_0xccce('0x41')](function(_0x2f3488){console[_0xccce('0x42')](_0x2f3488);});}exports[_0xccce('0x43')]=rewrite; \ No newline at end of file +var _0x5ba3=['context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','cutdigits','${EXTEN:','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','IntervalId','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','ExecIf','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','models','then','intervals','VoiceExtension','findAll','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','exten','extensions','push','Set','format','CDR(type)=%s','type'];(function(_0x4d686e,_0x4feb5b){var _0x477f11=function(_0x496734){while(--_0x496734){_0x4d686e['push'](_0x4d686e['shift']());}};_0x477f11(++_0x4feb5b);}(_0x5ba3,0x1be));var _0x35ba=function(_0x84e89a,_0x32aa10){_0x84e89a=_0x84e89a-0x0;var _0x3f07aa=_0x5ba3[_0x84e89a];return _0x3f07aa;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');function rewrite(_0x84607e,_0x2f42d6){var _0x4b2806=this;return _0x84607e[_0x35ba('0x1')]['Interval']['findAll']({'raw':!![]})[_0x35ba('0x2')](function(_0x431f69){_0x4b2806[_0x35ba('0x3')]=_0x431f69;return _0x84607e[_0x35ba('0x1')][_0x35ba('0x4')][_0x35ba('0x5')]({'where':{'IntervalId':_0x2f42d6['IntervalId']},'raw':!![]});})[_0x35ba('0x2')](function(_0x22522b){return _0x84607e[_0x35ba('0x1')][_0x35ba('0x4')]['findAll']({'where':{'exten':{'$in':_[_0x35ba('0x6')](_[_0x35ba('0x7')](_0x22522b,'exten'))}},'order':[{'raw':_0x35ba('0x8')}],'raw':!![]});})['then'](function(_0x3ca0e6){var _0x1c1e33=_[_0x35ba('0x9')](_0x3ca0e6,{'priority':'1'});var _0x5e5044=_[_0x35ba('0x9')](_0x3ca0e6,{'isApp':0x1});var _0x2a3dba=_[_0x35ba('0xa')](_0x5e5044,'exten');var _0x4bfa58=[_0x35ba('0xb'),_0x35ba('0xc')];var _0x4739ad=[];var _0x24507d=[];for(var _0x47b844 in _0x2a3dba){if(_0x2a3dba[_0x35ba('0xd')](_0x47b844)){_0x4b2806[_0x35ba('0xe')]=0x2;_0x4b2806['extensions']=[];_0x4b2806[_0x35ba('0xf')]=_['find'](_0x1c1e33,{'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')]});_0x4b2806[_0x35ba('0x11')][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0]['type'],'app':_0x35ba('0x13'),'appdata':util[_0x35ba('0x14')](_0x35ba('0x15'),_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')]),'context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806[_0x35ba('0xe')]++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});if(_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')]===_0x35ba('0x19')){_0x4b2806[_0x35ba('0x11')]['push']({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':_0x35ba('0x1a')+_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')],'context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806[_0x35ba('0xe')]++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});}else if(_0x2a3dba[_0x47b844][0x0]['type']===_0x35ba('0x1b')){if(_0x4b2806[_0x35ba('0xf')]){_0x4b2806[_0x35ba('0x11')][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0]['type'],'app':_0x35ba('0x13'),'appdata':'CDR(destination)='+(_0x4b2806[_0x35ba('0xf')][_0x35ba('0x1c')]?_0x35ba('0x1d')+_0x4b2806[_0x35ba('0xf')][_0x35ba('0x1c')]+'}':'${EXTEN}'),'context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0]['exten'],'priority':_0x4b2806['priority']++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});}_0x4b2806['extensions']['push']({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':'Set','appdata':'CDR(routeid)='+_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')],'context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806[_0x35ba('0xe')]++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0]['VoiceExtensionId']});var _0x40db68=_0x4b2806['priority']++;_0x4b2806['extensions'][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':'ExecIf','appdata':_0x35ba('0x1e')+(_0x40db68+0x2)+_0x35ba('0x1f')+(_0x40db68+0x1)+')','context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x40db68,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});if(_0x4b2806[_0x35ba('0xf')]){_0x4b2806[_0x35ba('0x11')][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':_0x4b2806[_0x35ba('0xf')][_0x35ba('0x1c')]?_0x35ba('0x20')+_0x4b2806[_0x35ba('0xf')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x2a3dba[_0x47b844][0x0]['context'],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806[_0x35ba('0xe')]++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0]['VoiceExtensionId']});}_0x4b2806['extensions']['push']({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':'Set','appdata':'outboundrouteid='+_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')],'context':_0x2a3dba[_0x47b844][0x0]['context'],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806['priority']++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});if(_0x4b2806['extension']&&_0x4b2806['extension'][_0x35ba('0xd')](_0x35ba('0x21'))&&_0x4b2806[_0x35ba('0xf')][_0x35ba('0x21')]!=='none'){_0x4b2806[_0x35ba('0x11')]['push']({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806[_0x35ba('0xe')]++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});_0x4b2806['extensions'][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':_0x35ba('0x22')+_0x4b2806[_0x35ba('0xf')]['recordingFormat']||_0x35ba('0x23'),'context':_0x2a3dba[_0x47b844][0x0]['context'],'exten':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x10')],'priority':_0x4b2806['priority']++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0]['VoiceExtensionId']});}}_0x4b2806[_0x35ba('0x11')][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':'Set','appdata':_0x35ba('0x24'),'context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'exten':_0x2a3dba[_0x47b844][0x0]['exten'],'priority':_0x4b2806['priority']++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});_0x4b2806['extensions']['push']({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2a3dba[_0x47b844][0x0]['context'],'exten':_0x2a3dba[_0x47b844][0x0]['exten'],'priority':_0x4b2806['priority']++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});_0x4b2806[_0x35ba('0x11')][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':_0x35ba('0x25'),'context':_0x2a3dba[_0x47b844][0x0]['context'],'exten':_0x2a3dba[_0x47b844][0x0]['exten'],'priority':_0x4b2806[_0x35ba('0xe')]++,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});for(var _0x3c8bd8=0x0,_0xd0e7b0=0x0;_0x3c8bd8<_0x2a3dba[_0x47b844][_0x35ba('0x26')];_0x3c8bd8+=0x1,_0xd0e7b0=0x0){var _0x552a9b=_0x2a3dba[_0x47b844][_0x3c8bd8];if(_0x552a9b[_0x35ba('0x16')]){_0x552a9b[_0x35ba('0x16')]=_0x552a9b['type'][_0x35ba('0x27')]();}var _0x108c6c=[];var _0x565d55=[];delete _0x552a9b['id'];delete _0x552a9b[_0x35ba('0x28')];delete _0x552a9b[_0x35ba('0x29')];var _0x5e0cd3=_0x552a9b['interval']!==_0x35ba('0x2a')?[_0x552a9b['interval']]:_0x552a9b['IntervalId']?_[_0x35ba('0x7')](_[_0x35ba('0x9')](_0x4b2806[_0x35ba('0x3')],{'IntervalId':_0x552a9b[_0x35ba('0x2b')]}),_0x35ba('0x2c')):[];if(_0x552a9b[_0x35ba('0xd')](_0x35ba('0x2d'))){if(_0x552a9b[_0x35ba('0x2d')]&&_0x552a9b[_0x35ba('0x2d')]!=='--'){_0x108c6c['push']({'type':_0x552a9b[_0x35ba('0x16')],'app':'Set','appdata':_0x35ba('0x2e')+_0x552a9b[_0x35ba('0x2d')],'context':_0x552a9b[_0x35ba('0x17')],'exten':_0x552a9b['exten'],'priority':_0x5e0cd3['length']+_0x4b2806[_0x35ba('0xe')]+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b[_0x35ba('0x18')]});}}if(_0x552a9b[_0x35ba('0x16')]===_0x35ba('0x1b')&&_0x552a9b['hasOwnProperty'](_0x35ba('0x2f'))){if(_0x552a9b[_0x35ba('0x2f')]){_0x108c6c[_0x35ba('0x12')]({'type':_0x552a9b[_0x35ba('0x16')],'app':'ExecIf','appdata':_0x35ba('0x30')+_0x552a9b[_0x35ba('0x2f')]+')','context':_0x552a9b[_0x35ba('0x17')],'exten':_0x552a9b[_0x35ba('0x10')],'priority':_0x5e0cd3['length']+_0x4b2806[_0x35ba('0xe')]+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b[_0x35ba('0x18')]});}else{_0x108c6c[_0x35ba('0x12')]({'type':_0x552a9b[_0x35ba('0x16')],'app':'ExecIf','appdata':_0x35ba('0x31'),'context':_0x552a9b[_0x35ba('0x17')],'exten':_0x552a9b[_0x35ba('0x10')],'priority':_0x5e0cd3['length']+_0x4b2806[_0x35ba('0xe')]+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b[_0x35ba('0x18')]});}}if(_0x552a9b['hasOwnProperty'](_0x35ba('0x32'))){if(_0x4bfa58[_0x35ba('0x33')](_0x552a9b['app'][_0x35ba('0x27')]())>=0x0&&_0x552a9b[_0x35ba('0x34')]!=='custom'){if(_0x552a9b[_0x35ba('0x32')]){_0x108c6c[_0x35ba('0x12')]({'type':_0x552a9b[_0x35ba('0x16')],'app':_0x35ba('0x35'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x552a9b[_0x35ba('0x17')],'exten':_0x552a9b['exten'],'priority':_0x5e0cd3[_0x35ba('0x26')]+_0x4b2806['priority']+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b[_0x35ba('0x18')]});_0x108c6c[_0x35ba('0x12')]({'type':_0x552a9b[_0x35ba('0x16')],'app':'Set','appdata':_0x35ba('0x36'),'context':_0x552a9b[_0x35ba('0x17')],'exten':_0x552a9b[_0x35ba('0x10')],'priority':_0x5e0cd3[_0x35ba('0x26')]+_0x4b2806[_0x35ba('0xe')]+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b['VoiceExtensionId']});}else{_0x108c6c['push']({'type':_0x552a9b[_0x35ba('0x16')],'app':'ExecIf','appdata':_0x35ba('0x37'),'context':_0x552a9b['context'],'exten':_0x552a9b[_0x35ba('0x10')],'priority':_0x5e0cd3['length']+_0x4b2806[_0x35ba('0xe')]+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b[_0x35ba('0x18')]});_0x108c6c[_0x35ba('0x12')]({'type':_0x552a9b[_0x35ba('0x16')],'app':_0x35ba('0x13'),'appdata':_0x35ba('0x38'),'context':_0x552a9b[_0x35ba('0x17')],'exten':_0x552a9b['exten'],'priority':_0x5e0cd3[_0x35ba('0x26')]+_0x4b2806[_0x35ba('0xe')]+_0xd0e7b0++,'VoiceExtensionId':_0x552a9b['VoiceExtensionId']});}}}for(var _0x59dade=0x0;_0x59dade<_0x5e0cd3['length'];_0x59dade+=0x1){var _0x2aa207=_0x4b2806[_0x35ba('0xe')]+_0x5e0cd3[_0x35ba('0x26')];var _0x4d839d=_0x59dade===_0x5e0cd3[_0x35ba('0x26')]-0x1?_0x4b2806[_0x35ba('0xe')]+_0x108c6c[_0x35ba('0x26')]+_0x565d55['length']+0x2:_0x4b2806['priority']+_0x59dade+0x1;_0x108c6c[_0x35ba('0x39')](_0x59dade,0x0,{'type':_0x552a9b[_0x35ba('0x16')],'app':_0x35ba('0x3a'),'appdata':_0x5e0cd3[_0x59dade]+'?'+_0x552a9b[_0x35ba('0x17')]+',${EXTEN},'+_0x2aa207+':'+_0x552a9b[_0x35ba('0x17')]+',${EXTEN},'+_0x4d839d,'exten':_0x552a9b[_0x35ba('0x10')],'context':_0x552a9b[_0x35ba('0x17')],'priority':_0x4b2806[_0x35ba('0xe')]+_0x59dade,'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});}_0x552a9b[_0x35ba('0xe')]=_0x108c6c[_0x35ba('0x26')]?_[_0x35ba('0x3b')](_0x108c6c)[_0x35ba('0xe')]+0x1:_0x4b2806['priority'];_0x4b2806[_0x35ba('0xe')]=(_0x565d55[_0x35ba('0x26')]?_[_0x35ba('0x3b')](_0x565d55)[_0x35ba('0xe')]:_0x552a9b['priority'])+0x1;_0x4b2806[_0x35ba('0x11')]=_['concat'](_0x4b2806[_0x35ba('0x11')],_0x108c6c,[_0x552a9b],_0x565d55);}_0x4b2806['extensions'][_0x35ba('0x12')]({'type':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x16')],'app':_0x35ba('0x3c'),'exten':_0x2a3dba[_0x47b844][0x0]['exten'],'context':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x17')],'priority':_0x4b2806['priority'],'VoiceExtensionId':_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]});_0x4739ad[_0x35ba('0x12')](_0x2a3dba[_0x47b844][0x0][_0x35ba('0x18')]);_0x24507d=_['concat'](_0x24507d,_0x4b2806[_0x35ba('0x11')]);}}return _0x84607e[_0x35ba('0x3d')](function(_0x1ec792){return _0x84607e[_0x35ba('0x1')]['VoiceExtension'][_0x35ba('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x4739ad}},'transaction':_0x1ec792})[_0x35ba('0x2')](function(_0x505b19){return _0x84607e[_0x35ba('0x1')]['VoiceExtension'][_0x35ba('0x3f')](_['sortBy'](_0x24507d,_0x35ba('0xe')),{'transaction':_0x1ec792});});});})[_0x35ba('0x40')](function(_0x606e15){console[_0x35ba('0x41')](_0x606e15);});}exports[_0x35ba('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 c8a4a78..eafce08 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 _0x5202=['insert','into','cm_hopper','scheduledAt','ContactId','updatedAt','field','NOW()','toString','createdAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','ListId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','fromQuery','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','VoiceQueueId','all','BlackLists','Campaign','CmList','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','CmContact','then','push','catch','stringify','checkHopper','inspect'];(function(_0x9d4954,_0x4faa32){var _0x4d5494=function(_0x53fc16){while(--_0x53fc16){_0x9d4954['push'](_0x9d4954['shift']());}};_0x4d5494(++_0x4faa32);}(_0x5202,0x17d));var _0x2520=function(_0x37fb84,_0x743651){_0x37fb84=_0x37fb84-0x0;var _0x4a5192=_0x5202[_0x37fb84];return _0x4a5192;};'use strict';var BPromise=require(_0x2520('0x0'));var util=require(_0x2520('0x1'));var _=require(_0x2520('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x2520('0x3'));var Redis=require(_0x2520('0x4'));var db=require(_0x2520('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x2520('0x6'))('api');config[_0x2520('0x7')]=_['defaults'](config[_0x2520('0x7')],{'host':_0x2520('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2520('0x7')]));require(_0x2520('0x9'))[_0x2520('0xa')](socket);try{if(!process[_0x2520('0xb')][0x2]||process[_0x2520('0xb')][0x2]===_0x2520('0xc')||process[_0x2520('0xb')][0x2]===_0x2520('0xd')){throw new Error(_0x2520('0xe'));}var FILEPATH=process[_0x2520('0xb')][0x2];if(!process[_0x2520('0xb')][0x3]||process[_0x2520('0xb')][0x3]===_0x2520('0xc')||process[_0x2520('0xb')][0x3]==='null'||!process[_0x2520('0xb')][0x4]||process['argv'][0x4]===_0x2520('0xc')||process['argv'][0x4]===_0x2520('0xd')){throw new Error(_0x2520('0xf'));}var FIELDS=_[_0x2520('0x10')](process[_0x2520('0xb')][0x3]['split'](','),process['argv'][0x4][_0x2520('0x11')](','));if(!process[_0x2520('0xb')][0x5]||process[_0x2520('0xb')][0x5]===_0x2520('0xc')||process[_0x2520('0xb')][0x5]===_0x2520('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x2520('0xb')][0x5];var COMPANYID=process[_0x2520('0xb')][0x6]&&process[_0x2520('0xb')][0x6]!=='undefined'&&process[_0x2520('0xb')][0x6]!=='null'?process[_0x2520('0xb')][0x6]:null;var DUPLICATES=process[_0x2520('0xb')][0x7]&&process[_0x2520('0xb')][0x7]!==_0x2520('0xc')&&process['argv'][0x7]!==_0x2520('0xd')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x2520('0xb')][0x8]===_0x2520('0xc')||process['argv'][0x8]===_0x2520('0xd')){throw new Error(_0x2520('0x12'));}var SOCKET_TIMESTAMP=process[_0x2520('0xb')][0x8];}catch(_0x51201e){logger[_0x2520('0x13')](_0x51201e);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(_0x2d181f,_0x4e2c8b,_0x2754c1,_0x423171){var _0x42db18={'message':_0x4e2c8b};_0x42db18[_0x2d181f]=!![];if(_0x2754c1){_0x42db18[_0x2520('0x14')]=_0x2754c1;}if(_0x423171){_0x42db18[_0x2520('0x15')]=_0x423171;}return _0x42db18;}function isEmail(_0x584f1e){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))*$/[_0x2520('0x16')](_0x584f1e);}function checkRow(_0x170622,_0x12d78f,_0x29dc48){return new BPromise(function(_0x77ac93,_0x3e4558){if(_[_0x2520('0x17')](_0x170622)){return _0x3e4558(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x29dc48));}if(_0x170622[_0x2520('0x18')]&&_0x170622[_0x2520('0x18')][_0x2520('0x19')]){var _0x508bda=_['map'](_0x170622[_0x2520('0x18')],_0x2520('0x1a'))[_0x2520('0x1b')](';');return _0x3e4558(handleCheckRowError('error',_0x508bda,null,_0x29dc48));}var _0xd0855d={};for(var _0x11169b in FIELDS){if(FIELDS[_0x2520('0x1c')](_0x11169b)&&FIELDS[_0x11169b]){_0xd0855d[_0x11169b]=_0x170622[_0x2520('0x1d')][0x0][FIELDS[_0x11169b]]||_0x170622[_0x2520('0x1d')][0x0]['\ufeff'+FIELDS[_0x11169b]];}}if(!_0xd0855d['firstName']){return _0x3e4558(handleCheckRowError(_0x2520('0x13'),_0x2520('0x1e'),null,_0x29dc48));}if(!_0xd0855d[_0x2520('0x1f')]){return _0x3e4558(handleCheckRowError(_0x2520('0x13'),_0x2520('0x20'),null,_0x29dc48));}if(_0xd0855d[_0x2520('0x21')]){var _0x3ba390=moment(_0xd0855d[_0x2520('0x21')],_0x2520('0x22'));if(!_0x3ba390[_0x2520('0x23')]()){return _0x3e4558(handleCheckRowError(_0x2520('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x29dc48));}}if(_0xd0855d[_0x2520('0x24')]){if(!isEmail(_0xd0855d[_0x2520('0x24')])){return _0x3e4558(handleCheckRowError(_0x2520('0x13'),_0x2520('0x25'),null,_0x29dc48));}}_0xd0855d['ListId']=LISTID;_0xd0855d[_0x2520('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2520('0x19')]&&_0x12d78f){var _0x992f2={};for(var _0x4784de=0x0,_0x555782=DUPLICATES[_0x2520('0x19')];_0x4784de<_0x555782;_0x4784de+=0x1){_0x992f2[DUPLICATES[_0x4784de]]=_0xd0855d[DUPLICATES[_0x4784de]];}var _0x895ba=_[_0x2520('0x27')](_0x12d78f,_0x992f2);if(_0x895ba){return _0x3e4558(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x895ba,_0x29dc48));}}return db[_0x2520('0x28')]['create'](_0xd0855d,{'raw':!![],'hooks':![],'fields':_['keys'](_0xd0855d)})[_0x2520('0x29')](function(_0x3a2f7f){if(DUPLICATES&&DUPLICATES[_0x2520('0x19')]&&_0x12d78f){_0x12d78f[_0x2520('0x2a')](_['pick'](_0xd0855d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3a2f7f['id'];return _0x77ac93();})[_0x2520('0x2b')](function(_0x3f4b6c){return _0x3e4558(handleCheckRowError(_0x2520('0x13'),'Error\x20while\x20creating\x20contact:\x20'+(_0x3f4b6c[_0x2520('0x1a')]||JSON[_0x2520('0x2c')](_0x3f4b6c)),null,_0x29dc48));});});}function checkHopper(){function _0xf2cd6d(){return function(_0xea26a8){logger[_0x2520('0x13')]('cmContact',_0x2520('0x2d'),util[_0x2520('0x2e')](_0xea26a8,{'showHidden':![],'depth':null}));};}var _0x309424=function(_0x158b33,_0x5dd2c5){var _0x1a9fae=squel[_0x2520('0x2f')]()[_0x2520('0x30')](_0x2520('0x31'))['fromQuery'](['phone',_0x2520('0x32'),_0x2520('0x33'),'ListId',_0x5dd2c5,'createdAt',_0x2520('0x34')],squel['select']()[_0x2520('0x35')](_0x2520('0x1f'),_0x2520('0x1f'))[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x32'))[_0x2520('0x35')]('id',_0x2520('0x33'))[_0x2520('0x35')](LISTID['toString'](),'ListId')[_0x2520('0x35')](_0x158b33['id'][_0x2520('0x37')](),_0x5dd2c5)['field'](_0x2520('0x36'),_0x2520('0x38'))[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x34'))[_0x2520('0x39')](_0x2520('0x3a'))[_0x2520('0x3b')]('deletedAt\x20IS\x20NULL')[_0x2520('0x3b')](_0x2520('0x3c'),LISTID[_0x2520('0x37')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x2520('0x3d'),squel[_0x2520('0x3e')]()[_0x2520('0x35')](_0x2520('0x1f'))['from'](_0x2520('0x31'))[_0x2520('0x3b')](_0x5dd2c5+_0x2520('0x3f'),_0x158b33['id'][_0x2520('0x37')]())))[_0x2520('0x37')]();return _0x1a9fae;};var _0x2a3dba=function(_0x22677b,_0x220555){var _0x1a9322=squel[_0x2520('0x2f')]()[_0x2520('0x30')](_0x2520('0x31'))['fromQuery']([_0x2520('0x1f'),_0x2520('0x32'),_0x2520('0x33'),_0x2520('0x40'),_0x220555,_0x2520('0x38'),'updatedAt'],squel['select']()['field'](_0x2520('0x1f'),_0x2520('0x1f'))[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x32'))[_0x2520('0x35')]('id','ContactId')[_0x2520('0x35')](LISTID[_0x2520('0x37')](),_0x2520('0x40'))['field'](_0x22677b['id'][_0x2520('0x37')](),_0x220555)[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x38'))[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x34'))[_0x2520('0x39')]('cm_contacts')[_0x2520('0x3b')](_0x2520('0x41'))[_0x2520('0x3b')]('ListId\x20=\x20?',LISTID['toString']())[_0x2520('0x3b')](_0x2520('0x42'),squel[_0x2520('0x43')](hopperContacts))['where'](_0x2520('0x44'))[_0x2520('0x3b')](_0x2520('0x3d'),squel[_0x2520('0x3e')]()[_0x2520('0x35')]('calleridnum')[_0x2520('0x39')](_0x2520('0x45'))[_0x2520('0x3b')](_0x220555+_0x2520('0x3f'),_0x22677b['id'][_0x2520('0x37')]()))[_0x2520('0x3b')](_0x2520('0x3d'),squel['select']()['field'](_0x2520('0x1f'))[_0x2520('0x39')](_0x2520('0x31'))[_0x2520('0x3b')](_0x220555+_0x2520('0x3f'),_0x22677b['id']['toString']())))[_0x2520('0x37')]();return _0x1a9322;};function _0x21f895(_0x4043a8,_0x51a0d4){var _0x279ac2=squel['insert']()[_0x2520('0x30')](_0x2520('0x31'))[_0x2520('0x46')]([_0x2520('0x1f'),_0x2520('0x32'),_0x2520('0x33'),_0x2520('0x40'),_0x51a0d4,_0x2520('0x38'),_0x2520('0x34')],squel[_0x2520('0x3e')]()[_0x2520('0x35')](_0x2520('0x1f'),_0x2520('0x1f'))[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x32'))[_0x2520('0x35')]('id',_0x2520('0x33'))[_0x2520('0x35')](LISTID[_0x2520('0x37')](),_0x2520('0x40'))['field'](_0x4043a8['id'][_0x2520('0x37')](),_0x51a0d4)[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x38'))['field'](_0x2520('0x36'),_0x2520('0x34'))[_0x2520('0x39')]('cm_contacts')[_0x2520('0x3b')](_0x2520('0x41'))[_0x2520('0x3b')](_0x2520('0x3c'),LISTID[_0x2520('0x37')]())[_0x2520('0x3b')](_0x2520('0x42'),squel[_0x2520('0x43')](hopperContacts))[_0x2520('0x3b')](_0x2520('0x44')))[_0x2520('0x37')]();return _0x279ac2;}function _0x15daaf(_0x2b36be,_0x51c6b2){var _0x2146da=squel[_0x2520('0x2f')]()['into'](_0x2520('0x47'))[_0x2520('0x46')]([_0x2520('0x1f'),'ContactId',_0x2520('0x40'),_0x51c6b2,_0x2520('0x38'),_0x2520('0x34')],squel[_0x2520('0x3e')]()[_0x2520('0x35')]('phone',_0x2520('0x1f'))[_0x2520('0x35')]('id',_0x2520('0x33'))['field'](LISTID[_0x2520('0x37')](),'ListId')[_0x2520('0x35')](_0x2b36be['id'][_0x2520('0x37')](),_0x51c6b2)['field'](_0x2520('0x36'),_0x2520('0x38'))[_0x2520('0x35')](_0x2520('0x36'),_0x2520('0x34'))['from'](_0x2520('0x3a'))[_0x2520('0x3b')]('deletedAt\x20IS\x20NULL')[_0x2520('0x3b')](_0x2520('0x3c'),LISTID[_0x2520('0x37')]())[_0x2520('0x3b')](_0x2520('0x42'),squel[_0x2520('0x43')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2520('0x37')]();return _0x2146da;}return db[_0x2520('0x48')][_0x2520('0x49')]({'where':{'type':_0x2520('0x4a')},'attributes':['id',_0x2520('0x4b')],'include':[{'model':db['CmList'],'as':_0x2520('0x4c'),'where':{'id':LISTID}}]})[_0x2520('0x29')](function(_0x62ebe){var _0x106b12=[];if(_0x62ebe){var _0x1c7a2;for(var _0x4e66e1=0x0,_0x11bbc2;_0x4e66e1<_0x62ebe[_0x2520('0x19')];_0x4e66e1+=0x1){_0x11bbc2=_0x62ebe[_0x4e66e1][_0x2520('0x4d')]({'plain':!![]});switch(_0x11bbc2['dialCheckDuplicateType']){case _0x2520('0x4e'):_0x106b12['push'](db[_0x2520('0x4f')][_0x2520('0x50')](_0x2a3dba(_0x11bbc2,'VoiceQueueId'))['then'](function(){})[_0x2520('0x2b')](_0xf2cd6d()));break;case'onlyIfOpen':_0x106b12[_0x2520('0x2a')](db['sequelize'][_0x2520('0x50')](_0x309424(_0x11bbc2,_0x2520('0x51')))[_0x2520('0x29')](function(){})['catch'](_0xf2cd6d()));break;default:_0x106b12[_0x2520('0x2a')](db[_0x2520('0x4f')][_0x2520('0x50')](_0x21f895(_0x11bbc2,_0x2520('0x51')))[_0x2520('0x29')](function(){})['catch'](_0xf2cd6d()));}}}return _0x106b12;})[_0x2520('0x52')]()[_0x2520('0x29')](function(){return db[_0x2520('0x48')]['findAll']({'where':{'type':_0x2520('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x2520('0x53'),'where':{'id':LISTID}}]})[_0x2520('0x29')](function(_0x245f5d){var _0x3906d5=[];if(_0x245f5d){var _0x1280e7;for(var _0x740b54=0x0,_0x3d14b6;_0x740b54<_0x245f5d[_0x2520('0x19')];_0x740b54+=0x1){_0x3d14b6=_0x245f5d[_0x740b54][_0x2520('0x4d')]({'plain':!![]});_0x3906d5[_0x2520('0x2a')](db[_0x2520('0x4f')][_0x2520('0x50')](_0x15daaf(_0x3d14b6,_0x2520('0x51')))['then'](function(){})['catch'](_0xf2cd6d()));}}return _0x3906d5;})[_0x2520('0x52')]();})[_0x2520('0x29')](function(){return db[_0x2520('0x54')][_0x2520('0x49')]({'attributes':['id',_0x2520('0x4b')],'include':[{'model':db[_0x2520('0x55')],'as':'Lists','where':{'id':LISTID}}]})[_0x2520('0x29')](function(_0x1bc1c0){var _0x11d325=[];if(_0x1bc1c0){for(var _0x32cdfb=0x0,_0x547b93;_0x32cdfb<_0x1bc1c0[_0x2520('0x19')];_0x32cdfb+=0x1){_0x547b93=_0x1bc1c0[_0x32cdfb]['get']({'plain':!![]});switch(_0x547b93[_0x2520('0x4b')]){case _0x2520('0x4e'):_0x11d325[_0x2520('0x2a')](db[_0x2520('0x4f')][_0x2520('0x50')](_0x2a3dba(_0x547b93,_0x2520('0x56')))[_0x2520('0x29')](function(){})[_0x2520('0x2b')](_0xf2cd6d()));break;case _0x2520('0x57'):_0x11d325[_0x2520('0x2a')](db['sequelize'][_0x2520('0x50')](_0x309424(_0x547b93,_0x2520('0x56')))[_0x2520('0x29')](function(){})[_0x2520('0x2b')](_0xf2cd6d()));break;default:_0x11d325['push'](db[_0x2520('0x4f')]['query'](_0x21f895(_0x547b93,_0x2520('0x56')))['then'](function(){})['catch'](_0xf2cd6d()));}}}return _0x11d325;})[_0x2520('0x52')]();})['then'](function(){return db[_0x2520('0x54')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x2520('0x55')],'as':_0x2520('0x53'),'where':{'id':LISTID}}]})[_0x2520('0x29')](function(_0x3da313){var _0x388e41=[];if(_0x3da313){for(var _0x5b3cca=0x0,_0x176724;_0x5b3cca<_0x3da313[_0x2520('0x19')];_0x5b3cca+=0x1){_0x176724=_0x3da313[_0x5b3cca][_0x2520('0x4d')]({'plain':!![]});_0x388e41[_0x2520('0x2a')](db[_0x2520('0x4f')][_0x2520('0x50')](_0x15daaf(_0x176724,_0x2520('0x56')))[_0x2520('0x29')](function(){})[_0x2520('0x2b')](_0xf2cd6d()));}}return _0x388e41;})[_0x2520('0x52')]();})[_0x2520('0x2b')](function(_0x2940f8){logger[_0x2520('0x13')](_0x2520('0x58'),_0x2520('0x59'),_0x2940f8[_0x2520('0x1a')]);});}var processPromises=function(_0x58e00f){return BPromise[_0x2520('0x52')](promises)['then'](function(_0x20f57d){})[_0x2520('0x2b')](function(_0x335875){logger[_0x2520('0x13')](_0x2520('0x5a'),JSON[_0x2520('0x2c')](_0x335875));})[_0x2520('0x5b')](function(){socket[_0x2520('0x5c')](_0x2520('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x58e00f){return _0x58e00f[_0x2520('0x5e')]();}});};var endCsv=function(){return BPromise[_0x2520('0x5f')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x2520('0x5c')](_0x2520('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2520('0x60')](FILEPATH);}catch(_0x52b23){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x2520('0x2c')](_0x52b23));}finally{process[_0x2520('0x61')](0x0);}});};process['on'](_0x2520('0x62'),function(){logger[_0x2520('0x63')](_0x2520('0x64'));endCsv();});function main(){return BPromise['resolve']()[_0x2520('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2520('0x11')](',');return db[_0x2520('0x28')][_0x2520('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x2520('0x29')](function(_0x2f3ca1){var _0x47f278=fs[_0x2520('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x2520('0x66')](_0x47f278,{'header':!![],'skipEmptyLines':!![],'step':function(_0x596ba5,_0x5d7672){total+=0x1;var _0x101a88=total;promises['push'](checkRow(_0x596ba5,_0x2f3ca1,_0x101a88)[_0x2520('0x29')](function(){success+=0x1;})['catch'](function(_0x4a4b3d){if(_0x4a4b3d['error']){errors+=0x1;delete _0x4a4b3d[_0x2520('0x13')];}else if(_0x4a4b3d[_0x2520('0x67')]){duplicates+=0x1;delete _0x4a4b3d[_0x2520('0x67')];}rows['push'](_0x4a4b3d);}));if(total%0xc8===0x0){_0x5d7672[_0x2520('0x68')]();return processPromises(_0x5d7672);}},'complete':function(){return processPromises()[_0x2520('0x29')](function(){logger[_0x2520('0x63')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5c3dc2,_0x3f6ac7){logger[_0x2520('0x63')](_0x2520('0x69'),JSON['stringify'](_0x5c3dc2));endCsv();}});})[_0x2520('0x2b')](function(_0x460780){logger['error'](_0x2520('0x6a'),JSON[_0x2520('0x2c')](_0x460780));});}main(); \ No newline at end of file +var _0xc97b=['../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','catch','stringify','checkHopper','inspect','into','scheduledAt','ListId','createdAt','field','ContactId','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','insert','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','fromQuery','VoiceQueue','dialCheckDuplicateType','CmList','Lists','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','findAll','outbound','get','CampaignId','Campaign','BlackLists','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter'];(function(_0x127575,_0x303eb0){var _0x2e1e35=function(_0x4c0eb5){while(--_0x4c0eb5){_0x127575['push'](_0x127575['shift']());}};_0x2e1e35(++_0x303eb0);}(_0xc97b,0xcf));var _0xbc97=function(_0x35a59c,_0x3c08ef){_0x35a59c=_0x35a59c-0x0;var _0x11bf0e=_0xc97b[_0x35a59c];return _0x11bf0e;};'use strict';var BPromise=require(_0xbc97('0x0'));var util=require(_0xbc97('0x1'));var _=require(_0xbc97('0x2'));var fs=require('fs');var squel=require(_0xbc97('0x3'));var Papa=require('papaparse');var Redis=require(_0xbc97('0x4'));var db=require(_0xbc97('0x5'))['db'];var config=require(_0xbc97('0x6'));var logger=require(_0xbc97('0x7'))(_0xbc97('0x8'));config[_0xbc97('0x9')]=_[_0xbc97('0xa')](config[_0xbc97('0x9')],{'host':_0xbc97('0xb'),'port':0x18eb});var socket=require(_0xbc97('0xc'))(new Redis(config['redis']));require(_0xbc97('0xd'))[_0xbc97('0xe')](socket);try{if(!process[_0xbc97('0xf')][0x2]||process[_0xbc97('0xf')][0x2]===_0xbc97('0x10')||process['argv'][0x2]===_0xbc97('0x11')){throw new Error(_0xbc97('0x12'));}var FILEPATH=process[_0xbc97('0xf')][0x2];if(!process[_0xbc97('0xf')][0x3]||process[_0xbc97('0xf')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process[_0xbc97('0xf')][0x4]||process[_0xbc97('0xf')][0x4]===_0xbc97('0x10')||process['argv'][0x4]===_0xbc97('0x11')){throw new Error(_0xbc97('0x13'));}var FIELDS=_['zipObject'](process[_0xbc97('0xf')][0x3][_0xbc97('0x14')](','),process[_0xbc97('0xf')][0x4][_0xbc97('0x14')](','));if(!process[_0xbc97('0xf')][0x5]||process[_0xbc97('0xf')][0x5]==='undefined'||process[_0xbc97('0xf')][0x5]===_0xbc97('0x11')){throw new Error(_0xbc97('0x15'));}var LISTID=process[_0xbc97('0xf')][0x5];var COMPANYID=process[_0xbc97('0xf')][0x6]&&process[_0xbc97('0xf')][0x6]!==_0xbc97('0x10')&&process[_0xbc97('0xf')][0x6]!=='null'?process[_0xbc97('0xf')][0x6]:null;var DUPLICATES=process[_0xbc97('0xf')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xbc97('0xf')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xbc97('0xf')][0x8]||process[_0xbc97('0xf')][0x8]===_0xbc97('0x10')||process['argv'][0x8]===_0xbc97('0x11')){throw new Error(_0xbc97('0x16'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x394537){logger[_0xbc97('0x17')](_0x394537);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(_0x2d89ea,_0x12e5c2,_0x5df8c1,_0x1a15e0){var _0x504d7b={'message':_0x12e5c2};_0x504d7b[_0x2d89ea]=!![];if(_0x5df8c1){_0x504d7b['contact']=_0x5df8c1;}if(_0x1a15e0){_0x504d7b[_0xbc97('0x18')]=_0x1a15e0;}return _0x504d7b;}function isEmail(_0x37ce95){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))*$/[_0xbc97('0x19')](_0x37ce95);}function checkRow(_0x3c7daf,_0x5bf45d,_0x510774){return new BPromise(function(_0x455f46,_0x18c059){if(_['isNil'](_0x3c7daf)){return _0x18c059(handleCheckRowError(_0xbc97('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x510774));}if(_0x3c7daf[_0xbc97('0x1a')]&&_0x3c7daf[_0xbc97('0x1a')]['length']){var _0x23e719=_[_0xbc97('0x1b')](_0x3c7daf[_0xbc97('0x1a')],_0xbc97('0x1c'))[_0xbc97('0x1d')](';');return _0x18c059(handleCheckRowError('error',_0x23e719,null,_0x510774));}var _0x51cedc={};for(var _0x1c2528 in FIELDS){if(FIELDS[_0xbc97('0x1e')](_0x1c2528)&&FIELDS[_0x1c2528]){_0x51cedc[_0x1c2528]=_0x3c7daf[_0xbc97('0x1f')][0x0][FIELDS[_0x1c2528]]||_0x3c7daf[_0xbc97('0x1f')][0x0]['\ufeff'+FIELDS[_0x1c2528]];}}if(!_0x51cedc[_0xbc97('0x20')]){return _0x18c059(handleCheckRowError('error',_0xbc97('0x21'),null,_0x510774));}if(!_0x51cedc[_0xbc97('0x22')]){return _0x18c059(handleCheckRowError(_0xbc97('0x17'),_0xbc97('0x23'),null,_0x510774));}if(_0x51cedc[_0xbc97('0x24')]){var _0x4baf76=moment(_0x51cedc[_0xbc97('0x24')],_0xbc97('0x25'));if(!_0x4baf76[_0xbc97('0x26')]()){return _0x18c059(handleCheckRowError(_0xbc97('0x17'),_0xbc97('0x27'),null,_0x510774));}}if(_0x51cedc['email']){if(!isEmail(_0x51cedc['email'])){return _0x18c059(handleCheckRowError(_0xbc97('0x17'),_0xbc97('0x28'),null,_0x510774));}}_0x51cedc['ListId']=LISTID;_0x51cedc[_0xbc97('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xbc97('0x2a')]&&_0x5bf45d){var _0x1c38b1={};for(var _0x1bec50=0x0,_0x3244d2=DUPLICATES[_0xbc97('0x2a')];_0x1bec50<_0x3244d2;_0x1bec50+=0x1){_0x1c38b1[DUPLICATES[_0x1bec50]]=_0x51cedc[DUPLICATES[_0x1bec50]];}var _0x39d013=_[_0xbc97('0x2b')](_0x5bf45d,_0x1c38b1);if(_0x39d013){return _0x18c059(handleCheckRowError(_0xbc97('0x2c'),_0xbc97('0x2d'),_0x39d013,_0x510774));}}return db[_0xbc97('0x2e')]['create'](_0x51cedc,{'raw':!![],'hooks':![],'fields':_[_0xbc97('0x2f')](_0x51cedc)})[_0xbc97('0x30')](function(_0x25cc19){if(DUPLICATES&&DUPLICATES[_0xbc97('0x2a')]&&_0x5bf45d){_0x5bf45d[_0xbc97('0x31')](_['pick'](_0x51cedc,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x25cc19['id'];return _0x455f46();})[_0xbc97('0x32')](function(_0x9d1fca){return _0x18c059(handleCheckRowError(_0xbc97('0x17'),'Error\x20while\x20creating\x20contact:\x20'+(_0x9d1fca[_0xbc97('0x1c')]||JSON[_0xbc97('0x33')](_0x9d1fca)),null,_0x510774));});});}function checkHopper(){function _0x251371(){return function(_0x2dc3a4){logger[_0xbc97('0x17')]('cmContact',_0xbc97('0x34'),util[_0xbc97('0x35')](_0x2dc3a4,{'showHidden':![],'depth':null}));};}var _0x56c1c5=function(_0x4eb44f,_0x3dded3){var _0x388fc4=squel['insert']()[_0xbc97('0x36')]('cm_hopper')['fromQuery']([_0xbc97('0x22'),_0xbc97('0x37'),'ContactId',_0xbc97('0x38'),_0x3dded3,_0xbc97('0x39'),'updatedAt'],squel['select']()[_0xbc97('0x3a')](_0xbc97('0x22'),_0xbc97('0x22'))[_0xbc97('0x3a')]('NOW()',_0xbc97('0x37'))[_0xbc97('0x3a')]('id',_0xbc97('0x3b'))[_0xbc97('0x3a')](LISTID[_0xbc97('0x3c')](),_0xbc97('0x38'))[_0xbc97('0x3a')](_0x4eb44f['id'][_0xbc97('0x3c')](),_0x3dded3)[_0xbc97('0x3a')](_0xbc97('0x3d'),'createdAt')['field']('NOW()',_0xbc97('0x3e'))[_0xbc97('0x3f')](_0xbc97('0x40'))[_0xbc97('0x41')](_0xbc97('0x42'))[_0xbc97('0x41')](_0xbc97('0x43'),LISTID[_0xbc97('0x3c')]())[_0xbc97('0x41')](_0xbc97('0x44'))[_0xbc97('0x41')](_0xbc97('0x45'),squel[_0xbc97('0x46')]()[_0xbc97('0x3a')](_0xbc97('0x22'))['from'](_0xbc97('0x47'))[_0xbc97('0x41')](_0x3dded3+'\x20=\x20?',_0x4eb44f['id'][_0xbc97('0x3c')]())))[_0xbc97('0x3c')]();return _0x388fc4;};var _0x3f84f9=function(_0x1d297f,_0xcde927){var _0xf45799=squel[_0xbc97('0x48')]()[_0xbc97('0x36')](_0xbc97('0x47'))['fromQuery']([_0xbc97('0x22'),_0xbc97('0x37'),_0xbc97('0x3b'),_0xbc97('0x38'),_0xcde927,_0xbc97('0x39'),'updatedAt'],squel[_0xbc97('0x46')]()[_0xbc97('0x3a')](_0xbc97('0x22'),_0xbc97('0x22'))[_0xbc97('0x3a')]('NOW()',_0xbc97('0x37'))[_0xbc97('0x3a')]('id',_0xbc97('0x3b'))[_0xbc97('0x3a')](LISTID[_0xbc97('0x3c')](),_0xbc97('0x38'))[_0xbc97('0x3a')](_0x1d297f['id'][_0xbc97('0x3c')](),_0xcde927)['field']('NOW()',_0xbc97('0x39'))[_0xbc97('0x3a')]('NOW()',_0xbc97('0x3e'))[_0xbc97('0x3f')](_0xbc97('0x40'))[_0xbc97('0x41')]('deletedAt\x20IS\x20NULL')[_0xbc97('0x41')](_0xbc97('0x43'),LISTID[_0xbc97('0x3c')]())[_0xbc97('0x41')](_0xbc97('0x49'),squel[_0xbc97('0x4a')](hopperContacts))[_0xbc97('0x41')](_0xbc97('0x44'))[_0xbc97('0x41')](_0xbc97('0x45'),squel[_0xbc97('0x46')]()[_0xbc97('0x3a')](_0xbc97('0x4b'))[_0xbc97('0x3f')](_0xbc97('0x4c'))[_0xbc97('0x41')](_0xcde927+_0xbc97('0x4d'),_0x1d297f['id'][_0xbc97('0x3c')]()))['where'](_0xbc97('0x45'),squel[_0xbc97('0x46')]()[_0xbc97('0x3a')](_0xbc97('0x22'))[_0xbc97('0x3f')](_0xbc97('0x47'))['where'](_0xcde927+_0xbc97('0x4d'),_0x1d297f['id'][_0xbc97('0x3c')]())))[_0xbc97('0x3c')]();return _0xf45799;};function _0x5b7fb5(_0x1c0434,_0x2cc35b){var _0x2336fc=squel['insert']()[_0xbc97('0x36')](_0xbc97('0x47'))['fromQuery']([_0xbc97('0x22'),_0xbc97('0x37'),_0xbc97('0x3b'),_0xbc97('0x38'),_0x2cc35b,_0xbc97('0x39'),_0xbc97('0x3e')],squel[_0xbc97('0x46')]()[_0xbc97('0x3a')](_0xbc97('0x22'),_0xbc97('0x22'))[_0xbc97('0x3a')](_0xbc97('0x3d'),_0xbc97('0x37'))[_0xbc97('0x3a')]('id',_0xbc97('0x3b'))[_0xbc97('0x3a')](LISTID[_0xbc97('0x3c')](),_0xbc97('0x38'))[_0xbc97('0x3a')](_0x1c0434['id'][_0xbc97('0x3c')](),_0x2cc35b)['field'](_0xbc97('0x3d'),_0xbc97('0x39'))[_0xbc97('0x3a')](_0xbc97('0x3d'),'updatedAt')['from'](_0xbc97('0x40'))['where'](_0xbc97('0x42'))[_0xbc97('0x41')](_0xbc97('0x43'),LISTID[_0xbc97('0x3c')]())[_0xbc97('0x41')](_0xbc97('0x49'),squel['str'](hopperContacts))[_0xbc97('0x41')](_0xbc97('0x44')))['toString']();return _0x2336fc;}function _0x50fc64(_0x14af58,_0x382c56){var _0x1205c5=squel['insert']()[_0xbc97('0x36')]('cm_hopper_black')[_0xbc97('0x4e')]([_0xbc97('0x22'),_0xbc97('0x3b'),_0xbc97('0x38'),_0x382c56,_0xbc97('0x39'),'updatedAt'],squel['select']()[_0xbc97('0x3a')]('phone','phone')[_0xbc97('0x3a')]('id',_0xbc97('0x3b'))['field'](LISTID[_0xbc97('0x3c')](),_0xbc97('0x38'))[_0xbc97('0x3a')](_0x14af58['id']['toString'](),_0x382c56)[_0xbc97('0x3a')](_0xbc97('0x3d'),_0xbc97('0x39'))['field'](_0xbc97('0x3d'),_0xbc97('0x3e'))[_0xbc97('0x3f')](_0xbc97('0x40'))[_0xbc97('0x41')](_0xbc97('0x42'))['where'](_0xbc97('0x43'),LISTID[_0xbc97('0x3c')]())[_0xbc97('0x41')](_0xbc97('0x49'),squel[_0xbc97('0x4a')](hopperContacts))[_0xbc97('0x41')](_0xbc97('0x44')))['toString']();return _0x1205c5;}return db[_0xbc97('0x4f')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xbc97('0x50')],'include':[{'model':db[_0xbc97('0x51')],'as':_0xbc97('0x52'),'where':{'id':LISTID}}]})[_0xbc97('0x30')](function(_0x57b31a){var _0x2cb07e=[];if(_0x57b31a){var _0xbc985b;for(var _0x58f130=0x0,_0x62b238;_0x58f130<_0x57b31a[_0xbc97('0x2a')];_0x58f130+=0x1){_0x62b238=_0x57b31a[_0x58f130]['get']({'plain':!![]});switch(_0x62b238[_0xbc97('0x50')]){case _0xbc97('0x53'):_0x2cb07e['push'](db[_0xbc97('0x54')]['query'](_0x3f84f9(_0x62b238,_0xbc97('0x55')))[_0xbc97('0x30')](function(){})[_0xbc97('0x32')](_0x251371()));break;case _0xbc97('0x56'):_0x2cb07e[_0xbc97('0x31')](db[_0xbc97('0x54')]['query'](_0x56c1c5(_0x62b238,_0xbc97('0x55')))['then'](function(){})['catch'](_0x251371()));break;default:_0x2cb07e['push'](db[_0xbc97('0x54')][_0xbc97('0x57')](_0x5b7fb5(_0x62b238,_0xbc97('0x55')))[_0xbc97('0x30')](function(){})[_0xbc97('0x32')](_0x251371()));}}}return _0x2cb07e;})[_0xbc97('0x58')]()[_0xbc97('0x30')](function(){return db[_0xbc97('0x4f')][_0xbc97('0x59')]({'where':{'type':_0xbc97('0x5a')},'attributes':['id'],'include':[{'model':db[_0xbc97('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xbc97('0x30')](function(_0x44f74b){var _0x4c5b59=[];if(_0x44f74b){var _0xdad1f8;for(var _0x494b51=0x0,_0xfa55d7;_0x494b51<_0x44f74b[_0xbc97('0x2a')];_0x494b51+=0x1){_0xfa55d7=_0x44f74b[_0x494b51]['get']({'plain':!![]});_0x4c5b59[_0xbc97('0x31')](db['sequelize'][_0xbc97('0x57')](_0x50fc64(_0xfa55d7,_0xbc97('0x55')))[_0xbc97('0x30')](function(){})[_0xbc97('0x32')](_0x251371()));}}return _0x4c5b59;})[_0xbc97('0x58')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xbc97('0x51')],'as':_0xbc97('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x138f72){var _0x25287a=[];if(_0x138f72){for(var _0x28db6c=0x0,_0x33161d;_0x28db6c<_0x138f72[_0xbc97('0x2a')];_0x28db6c+=0x1){_0x33161d=_0x138f72[_0x28db6c][_0xbc97('0x5b')]({'plain':!![]});switch(_0x33161d['dialCheckDuplicateType']){case _0xbc97('0x53'):_0x25287a['push'](db[_0xbc97('0x54')][_0xbc97('0x57')](_0x3f84f9(_0x33161d,_0xbc97('0x5c')))[_0xbc97('0x30')](function(){})[_0xbc97('0x32')](_0x251371()));break;case _0xbc97('0x56'):_0x25287a[_0xbc97('0x31')](db['sequelize'][_0xbc97('0x57')](_0x56c1c5(_0x33161d,'CampaignId'))[_0xbc97('0x30')](function(){})[_0xbc97('0x32')](_0x251371()));break;default:_0x25287a[_0xbc97('0x31')](db['sequelize'][_0xbc97('0x57')](_0x5b7fb5(_0x33161d,'CampaignId'))[_0xbc97('0x30')](function(){})[_0xbc97('0x32')](_0x251371()));}}}return _0x25287a;})[_0xbc97('0x58')]();})[_0xbc97('0x30')](function(){return db[_0xbc97('0x5d')][_0xbc97('0x59')]({'attributes':['id'],'include':[{'model':db[_0xbc97('0x51')],'as':_0xbc97('0x5e'),'where':{'id':LISTID}}]})[_0xbc97('0x30')](function(_0x3829d8){var _0x40d36f=[];if(_0x3829d8){for(var _0x3463bf=0x0,_0x2ee8aa;_0x3463bf<_0x3829d8[_0xbc97('0x2a')];_0x3463bf+=0x1){_0x2ee8aa=_0x3829d8[_0x3463bf]['get']({'plain':!![]});_0x40d36f[_0xbc97('0x31')](db[_0xbc97('0x54')]['query'](_0x50fc64(_0x2ee8aa,_0xbc97('0x5c')))[_0xbc97('0x30')](function(){})['catch'](_0x251371()));}}return _0x40d36f;})[_0xbc97('0x58')]();})['catch'](function(_0x29b15a){logger[_0xbc97('0x17')]('cmContact,\x20%s,\x20%s',_0xbc97('0x5f'),_0x29b15a[_0xbc97('0x1c')]);});}var processPromises=function(_0x9cfbaa){return BPromise[_0xbc97('0x58')](promises)[_0xbc97('0x30')](function(_0x56f371){})['catch'](function(_0xf24293){logger['error'](_0xbc97('0x60'),JSON[_0xbc97('0x33')](_0xf24293));})['finally'](function(){socket[_0xbc97('0x61')](_0xbc97('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x9cfbaa){return _0x9cfbaa[_0xbc97('0x63')]();}});};var endCsv=function(){return BPromise[_0xbc97('0x64')]()[_0xbc97('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0xbc97('0x30')](function(){socket[_0xbc97('0x61')](_0xbc97('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x30e2de){logger['error'](_0xbc97('0x65'),JSON[_0xbc97('0x33')](_0x30e2de));}finally{process[_0xbc97('0x66')](0x0);}});};process['on'](_0xbc97('0x67'),function(){logger['info'](_0xbc97('0x68'));endCsv();});function main(){return BPromise[_0xbc97('0x64')]()[_0xbc97('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xbc97('0x14')](',');return db[_0xbc97('0x2e')][_0xbc97('0x59')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xbc97('0x30')](function(_0x52a0e6){var _0x386d61=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xbc97('0x69')](_0x386d61,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3db450,_0x53b034){total+=0x1;var _0x1c0bdd=total;promises[_0xbc97('0x31')](checkRow(_0x3db450,_0x52a0e6,_0x1c0bdd)[_0xbc97('0x30')](function(){success+=0x1;})[_0xbc97('0x32')](function(_0x44dbd0){if(_0x44dbd0[_0xbc97('0x17')]){errors+=0x1;delete _0x44dbd0[_0xbc97('0x17')];}else if(_0x44dbd0[_0xbc97('0x2c')]){duplicates+=0x1;delete _0x44dbd0[_0xbc97('0x2c')];}rows[_0xbc97('0x31')](_0x44dbd0);}));if(total%0xc8===0x0){_0x53b034['pause']();return processPromises(_0x53b034);}},'complete':function(){return processPromises()[_0xbc97('0x30')](function(){logger[_0xbc97('0x6a')](_0xbc97('0x6b'));endCsv();});},'error':function(_0x377869,_0x488ae8){logger['info'](_0xbc97('0x6c'),JSON[_0xbc97('0x33')](_0x377869));endCsv();}});})[_0xbc97('0x32')](function(_0x29f41b){logger[_0xbc97('0x17')](_0xbc97('0x6d'),JSON[_0xbc97('0x33')](_0x29f41b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 2037e0e..aefb862 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 _0x8ff0=['cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','info','Received\x20SIGINT','message','exit','errors','code','query','spread','catch','error','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','main','start','clone','socket_timestamp','header','ContactItemType','name','writeFileSync','parse','createReadStream','data','rows','find','_description','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','hasOwnProperty','trim','itemTypeId','description','SystemRow','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','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','scheduledat',',\x20scheduledAt\x20=\x20NOW()','each','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','arguments\x20\x20\x20','argv','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','then','length','push','all','AdditionalPhones','split','isNil','filter','update','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','into','fromQuery','ContactId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','cm_contacts.createdAt','insert','cm_hopper_black','ListId','updatedAt','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','\x22onlyIfOpen\x22','toString','cm_hopper.id','cm_contact_has_items.item'];(function(_0x8eb414,_0x518e6b){var _0x4ab0d0=function(_0x506522){while(--_0x506522){_0x8eb414['push'](_0x8eb414['shift']());}};_0x4ab0d0(++_0x518e6b);}(_0x8ff0,0x6f));var _0x08ff=function(_0x812136,_0x5df217){_0x812136=_0x812136-0x0;var _0x3b5c29=_0x8ff0[_0x812136];return _0x3b5c29;};'use strict';var fs=require('fs');var path=require(_0x08ff('0x0'));var _=require('lodash');var Papa=require(_0x08ff('0x1'));var util=require('util');var BPromise=require(_0x08ff('0x2'));var moment=require(_0x08ff('0x3'));var squel=require('squel');var Redis=require(_0x08ff('0x4'));var db=require(_0x08ff('0x5'))['db'];var config=require(_0x08ff('0x6'));var shared=require(_0x08ff('0x7'));var logger=require(_0x08ff('0x8'))(_0x08ff('0x9'));config['redis']=_[_0x08ff('0xa')](config[_0x08ff('0xb')],{'host':_0x08ff('0xc'),'port':0x18eb});var socket=require(_0x08ff('0xd'))(new Redis(config[_0x08ff('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x08ff('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x08ff('0xf')](_0x08ff('0xe'));function isEmail(_0x35ebab){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))*$/[_0x08ff('0x10')](_0x35ebab);}function selectNotIn(_0x24ab13,_0x4fe063,_0x13938d,_0x234863,_0x4a556e){return squel[_0x08ff('0x11')]()[_0x08ff('0x12')](_0x08ff('0x13'))[_0x08ff('0x14')](_0x234863)[_0x08ff('0x15')](_0x4fe063,null,_0x4fe063+'.id\x20=\x20'+_0x234863+'.'+_0x13938d)[_0x08ff('0x16')](_0x234863+'.'+_0x13938d+_0x08ff('0x17')+_0x24ab13+'.'+_0x13938d)[_0x08ff('0x16')](_0x4fe063+_0x08ff('0x18')+_0x4a556e[_0x08ff('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4661f5,_0x262bd8){promisesAdditionalPhones=[];return db[_0x08ff('0x19')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x08ff('0x1a')](function(_0x33918e){if(_0x33918e!==null){var _0x5af127=[];for(var _0x33fa6f=0x0;_0x33fa6f<_0x33918e[_0x08ff('0x1b')];_0x33fa6f++){var _0x15ef70=_0x33918e[_0x33fa6f];_0x5af127[_0x08ff('0x1c')](insertAdditionalPhones(_0x15ef70));}}Promise[_0x08ff('0x1d')](_0x5af127)['then'](function(){_0x4661f5({'val':0x1});});});});}function insertAdditionalPhones(_0x3229c7){return new Promise(function(_0x2816f4,_0x27b5f3){var _0x4a96ef=_0x3229c7[_0x08ff('0x1e')];var _0xe52fff=_0x4a96ef[_0x08ff('0x1f')](';');var _0x49dd8b=[];orderBy=0x0;for(var _0x2e988b=0x0;_0x2e988b<_0xe52fff[_0x08ff('0x1b')];_0x2e988b++){_0x49dd8b['push'](splitAdditionalPhone(_0x3229c7['id'],_0xe52fff[_0x2e988b]));}Promise[_0x08ff('0x1d')](_0x49dd8b)[_0x08ff('0x1a')](function(){_0x2816f4({'val':_0xe52fff['length']});});});}function splitAdditionalPhone(_0x32af89,_0x4f0c4f){return new Promise(function(_0x566dd8,_0x4327e9){var _0x2812b5=_0x4f0c4f[_0x08ff('0x1f')](':');var _0x3156bb=_0x2812b5[0x0];var _0x280f6a=_0x2812b5[0x1];if(!_[_0x08ff('0x20')](_0x280f6a)){var _0x108b50=_0x280f6a['split']('|');var _0x4178e5=[];for(var _0xc7f632=0x0;_0xc7f632<_0x108b50['length'];_0xc7f632++){if(_0x108b50[_0xc7f632]!==''){var _0x493c52=_[_0x08ff('0x21')](promisesAdditionalPhones,{'contactId':_0x32af89,'phone':_0x108b50[_0xc7f632]});if(_0x493c52['length']==0x0){orderBy++;promisesAdditionalPhones[_0x08ff('0x1c')]({'contactId':_0x32af89,'contactTypeId':_0x3156bb,'phone':_0x108b50[_0xc7f632],'orderBy':orderBy});}}}_0x566dd8({'ok':0x1});}else _0x566dd8({'res':0x0});});}function createAdditionalPhone(_0x3aa346,_0x23edad,_0x292213,_0x21e692){var _0x4083a8='';var _0x2707fa='';var _0x10999d=_0x292213[_0x08ff('0x1f')]('§');_0x4083a8=_0x10999d[0x0];if(_0x10999d['length']==0x2)_0x2707fa=_0x10999d[0x1];return new Promise(function(_0x5b1e3a,_0x399665){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x3aa346,'item':_0x4083a8}})[_0x08ff('0x1a')](function(_0xc21d83){if(_0xc21d83){return db['CmContactHasItem'][_0x08ff('0x22')]({'ItemTypeId':_0x23edad,'description':_0x2707fa,'OrderBy':_0x21e692},{'where':{'CmContactId':_0x3aa346,'item':_0x4083a8}})[_0x08ff('0x1a')](function(_0x45b469){_0x5b1e3a({'res':'updated'});});}else{return db[_0x08ff('0x23')][_0x08ff('0x24')]({'CmContactId':_0x3aa346,'item':_0x4083a8,'description':_0x2707fa,'ItemTypeId':_0x23edad,'OrderBy':_0x21e692,'ItemClass':_0x08ff('0x25')})[_0x08ff('0x1a')](function(_0xc6fca5){_0x5b1e3a({'res':_0x08ff('0x26')});});}});});}function insertCmHopper(_0x1947b4,_0xa59970,_0x26062e,_0x38552c,_0x1a9800){var _0x3db1db=[_0x08ff('0x27'),_0x08ff('0x28'),_0x08ff('0x29'),_0x08ff('0x2a'),_0xa59970+'.'+_0x38552c,'cm_contacts.createdAt',_0x08ff('0x2b'),'cm_contacts.priority',_0x08ff('0x2c'),'\x22'+_0x1a9800+'\x22'];return squel['insert']()[_0x08ff('0x2d')]('cm_hopper')[_0x08ff('0x2e')]([_0x08ff('0x13'),'scheduledat',_0x08ff('0x2f'),'ListId',_0x38552c,_0x08ff('0x30'),'updatedAt',_0x08ff('0x31'),_0x08ff('0x32'),_0x08ff('0x33')],squel[_0x08ff('0x11')]()[_0x08ff('0x34')](_0x3db1db)[_0x08ff('0x14')](_0xa59970)[_0x08ff('0x15')](_0x08ff('0x35'),null,_0x08ff('0x36')+_0xa59970+_0x08ff('0x37'))['join'](_0x26062e,null,_0x26062e+_0x08ff('0x38')+_0xa59970+'.'+_0x38552c)[_0x08ff('0x16')](_0xa59970+_0x08ff('0x39'),_0x1947b4)[_0x08ff('0x16')](_0x08ff('0x3a'),NOW)[_0x08ff('0x16')](_0x08ff('0x3b'),selectNotIn(_0xa59970,_0x26062e,_0x38552c,_0x08ff('0x3c'),[_0x08ff('0x3d'),'\x22onlyIfOpen\x22']))[_0x08ff('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xa59970,_0x26062e,_0x38552c,_0x08ff('0x3c'),[_0x08ff('0x3d')])))['toString']();}function insertCmHopperBlack(_0x40de4f,_0x166c82,_0x234e81,_0x1bb0b2){var _0x1db6b8=[_0x08ff('0x27'),_0x08ff('0x29'),_0x08ff('0x2a'),_0x166c82+'.'+_0x1bb0b2,_0x08ff('0x3e'),'cm_contacts.updatedAt'];return squel[_0x08ff('0x3f')]()[_0x08ff('0x2d')](_0x08ff('0x40'))[_0x08ff('0x2e')](['phone',_0x08ff('0x2f'),_0x08ff('0x41'),_0x1bb0b2,_0x08ff('0x30'),_0x08ff('0x42')],squel[_0x08ff('0x11')]()[_0x08ff('0x34')](_0x1db6b8)['from'](_0x166c82)[_0x08ff('0x15')](_0x08ff('0x35'),null,_0x08ff('0x36')+_0x166c82+'.CmListId')[_0x08ff('0x15')](_0x234e81,null,_0x234e81+_0x08ff('0x38')+_0x166c82+'.'+_0x1bb0b2)[_0x08ff('0x16')](_0x166c82+_0x08ff('0x39'),_0x40de4f)[_0x08ff('0x16')](_0x08ff('0x3a'),NOW)[_0x08ff('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x08ff('0x13'))[_0x08ff('0x14')](_0x08ff('0x40'))[_0x08ff('0x16')](_0x08ff('0x43'),_0x40de4f)[_0x08ff('0x16')](_0x1bb0b2+_0x08ff('0x17')+_0x166c82+'.'+_0x1bb0b2)))['toString']();}function insertTzCmHopper(_0x315844,_0x3ecd89,_0x54fe76,_0x42875f,_0x2b8f17,_0x21fcb4){var _0x58bbc5=['cm_contacts.phone',_0x08ff('0x44')+_0x21fcb4+_0x08ff('0x45'),_0x08ff('0x29'),'cm_contacts.ListId',_0x3ecd89+'.'+_0x42875f,_0x08ff('0x3e'),'cm_contacts.updatedAt',_0x08ff('0x46'),_0x08ff('0x2c'),'\x22'+_0x2b8f17+'\x22'];var _0x1abcc4=squel[_0x08ff('0x3f')]()['into'](_0x08ff('0x3c'))[_0x08ff('0x2e')](['phone','scheduledat',_0x08ff('0x2f'),_0x08ff('0x41'),_0x42875f,_0x08ff('0x30'),'updatedAt',_0x08ff('0x31'),'UserId',_0x08ff('0x33')],squel[_0x08ff('0x11')]()[_0x08ff('0x34')](_0x58bbc5)[_0x08ff('0x14')](_0x3ecd89)[_0x08ff('0x15')](_0x08ff('0x35'),null,_0x08ff('0x36')+_0x3ecd89+_0x08ff('0x37'))['join'](_0x54fe76,null,_0x54fe76+_0x08ff('0x38')+_0x3ecd89+'.'+_0x42875f)['join'](_0x21fcb4,null,_0x21fcb4+_0x08ff('0x38')+_0x3ecd89+'.'+_0x42875f)[_0x08ff('0x16')](_0x3ecd89+'.CmListId\x20=\x20?',_0x315844)[_0x08ff('0x16')](_0x08ff('0x3a'),NOW)[_0x08ff('0x16')](_0x08ff('0x3b'),selectNotIn(_0x3ecd89,_0x54fe76,_0x42875f,_0x08ff('0x3c'),['\x22always\x22',_0x08ff('0x47')]))[_0x08ff('0x16')](_0x08ff('0x3b'),selectNotIn(_0x3ecd89,_0x54fe76,_0x42875f,_0x08ff('0x3c'),[_0x08ff('0x3d')])))[_0x08ff('0x48')]();return _0x1abcc4;}function insertTzCmHopperBlack(_0xdb33c5,_0x1f262f,_0x24e996,_0x5239aa){var _0x110405=[_0x08ff('0x27'),'cm_contacts.id',_0x08ff('0x2a'),_0x1f262f+'.'+_0x5239aa,'cm_contacts.createdAt',_0x08ff('0x2b')];return squel[_0x08ff('0x3f')]()[_0x08ff('0x2d')](_0x08ff('0x40'))[_0x08ff('0x2e')](['phone',_0x08ff('0x2f'),_0x08ff('0x41'),_0x5239aa,_0x08ff('0x30'),_0x08ff('0x42')],squel['select']()['fields'](_0x110405)['from'](_0x1f262f)[_0x08ff('0x15')](_0x08ff('0x35'),null,_0x08ff('0x36')+_0x1f262f+_0x08ff('0x37'))[_0x08ff('0x15')](_0x24e996,null,_0x24e996+_0x08ff('0x38')+_0x1f262f+'.'+_0x5239aa)[_0x08ff('0x16')](_0x1f262f+_0x08ff('0x39'),_0xdb33c5)[_0x08ff('0x16')](_0x08ff('0x3a'),NOW)[_0x08ff('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x08ff('0x11')]()['field']('phone')[_0x08ff('0x14')](_0x08ff('0x40'))['where']('ListId\x20=\x20?',_0xdb33c5)[_0x08ff('0x16')](_0x5239aa+_0x08ff('0x17')+_0x1f262f+'.'+_0x5239aa)))['toString']();}function insertCmHopperAdditionalPhones(_0x22f5ef){var _0x364589=[_0x08ff('0x49'),_0x08ff('0x4a'),'cm_contact_has_items.OrderBy',_0x08ff('0x4b'),'cm_contact_has_items.updatedAt'];return squel[_0x08ff('0x3f')]()['into'](_0x08ff('0x4c'))[_0x08ff('0x2e')](['CmHopperId',_0x08ff('0x13'),_0x08ff('0x4d'),_0x08ff('0x30'),_0x08ff('0x42')],squel[_0x08ff('0x11')]()['fields'](_0x364589)[_0x08ff('0x14')](_0x08ff('0x3c'))[_0x08ff('0x15')](_0x08ff('0x35'),null,_0x08ff('0x4e'))['join'](_0x08ff('0x4f'),null,_0x08ff('0x50'))[_0x08ff('0x16')]('cm_hopper.ListId\x20=\x20?',_0x22f5ef)[_0x08ff('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x37c1dd,_0x28f1a4,_0x32a71c,_0x204ddf){var _0x3f8616=_[_0x08ff('0x51')](_[_0x08ff('0x52')](_0x204ddf),[_0x08ff('0x41'),_0x08ff('0x53'),_0x08ff('0x30'),_0x08ff('0x42'),_0x08ff('0x54')]);return squel[_0x08ff('0x3f')]()[_0x08ff('0x2d')](_0x08ff('0x35'))[_0x08ff('0x2e')](_0x3f8616,squel[_0x08ff('0x11')]()[_0x08ff('0x34')](_0x3f8616)[_0x08ff('0x14')](_0x28f1a4)[_0x08ff('0x16')]('('+_0x32a71c[_0x08ff('0x15')](',')+_0x08ff('0x55'),squel[_0x08ff('0x11')]()['fields'](_0x32a71c)[_0x08ff('0x14')](_0x08ff('0x35'))[_0x08ff('0x16')](_0x08ff('0x43'),_0x37c1dd)[_0x08ff('0x16')](_0x08ff('0x56')))[_0x08ff('0x16')](_0x08ff('0x57'),squel[_0x08ff('0x11')]()[_0x08ff('0x12')]('MIN(id)',_0x08ff('0x58'))[_0x08ff('0x14')](_0x28f1a4)['group'](_0x32a71c[_0x08ff('0x15')](','))))[_0x08ff('0x48')]();}function handleStop(){logger[_0x08ff('0x59')](_0x08ff('0x5a'));stopped=!![];}function handleUncaughtException(_0x4c654d){logger['error'](_0x4c654d[_0x08ff('0x5b')]);process[_0x08ff('0x5c')](0x1);}function handleError(_0x3ae8b0,_0x55112a){stats[_0x08ff('0x5d')][_0x08ff('0x1c')]({'name':_0x55112a[_0x08ff('0x5e')],'message':_0x55112a[_0x08ff('0x5b')],'row':_0x3ae8b0});}function handleQuery(_0x495087){logger[_0x08ff('0x59')](_0x495087);return db['sequelize'][_0x08ff('0x5f')](_0x495087)[_0x08ff('0x60')](function(_0x5f4195){results[_0x08ff('0x1c')](_0x5f4195);})[_0x08ff('0x61')](function(_0x42be0d){logger[_0x08ff('0x62')](_0x42be0d['message']);});}function updateTzCampaigns(_0x23078b){return new Promise(function(_0x5cf587,_0x49f0e7){var _0x1ff47d=squel['select']()[_0x08ff('0x34')]([_0x08ff('0x63'),'campaigns.dialTimezone'])[_0x08ff('0x14')]('campaigns')[_0x08ff('0x15')](_0x08ff('0x64'),null,_0x08ff('0x65'))['where'](_0x08ff('0x66')+_0x23078b);db[_0x08ff('0x67')][_0x08ff('0x5f')](_0x1ff47d[_0x08ff('0x48')]())['spread'](function(_0x14f28c){var _0x58365e=[];for(var _0x36da9=0x0;_0x36da9<_0x14f28c['length'];_0x36da9++){_0x58365e[_0x08ff('0x1c')](getTimezoneData(_0x14f28c[_0x36da9],tmp_campaigns));}BPromise[_0x08ff('0x1d')](_0x58365e)['then'](function(){_0x5cf587({'val':0x1});});})[_0x08ff('0x61')](function(_0x57ed80){logger[_0x08ff('0x62')](_0x57ed80['message']);_0x5cf587({'val':0x0});});});}function updateTzVoiceQueues(_0x115405){return new Promise(function(_0x5481dc,_0x48ad49){var _0x20ca59=squel['select']()[_0x08ff('0x34')]([_0x08ff('0x68'),_0x08ff('0x69')])[_0x08ff('0x14')](_0x08ff('0x6a'))['join'](_0x08ff('0x6b'),null,_0x08ff('0x6c'))['where'](_0x08ff('0x6d')+_0x115405);db['sequelize'][_0x08ff('0x5f')](_0x20ca59[_0x08ff('0x48')]())['spread'](function(_0x487a74){var _0x4547dd=[];for(var _0x26c9ac=0x0;_0x26c9ac<_0x487a74[_0x08ff('0x1b')];_0x26c9ac++){_0x4547dd[_0x08ff('0x1c')](getTimezoneData(_0x487a74[_0x26c9ac],tmp_voice_queues));}BPromise['all'](_0x4547dd)[_0x08ff('0x1a')](function(){_0x5481dc({'val':0x1});});})[_0x08ff('0x61')](function(_0x24023d){logger[_0x08ff('0x62')](_0x24023d[_0x08ff('0x5b')]);_0x5481dc({'val':0x0});});});}function getTimezoneData(_0x54979c,_0x383231){return new Promise(function(_0x1e503b,_0x2314c6){var _0x440755=shared[_0x08ff('0x6e')];var _0x305c18=_0x440755[_0x54979c['dialTimezone']];if(_[_0x08ff('0x20')](_0x305c18)){_0x1e503b({'ret':0x1});}else{var _0x4fe59d=_0x305c18[_0x08ff('0x6f')];var _0x35dfb8=squel['insert']()[_0x08ff('0x2d')](_0x383231)['set']('id',_0x54979c['id'])[_0x08ff('0x70')](_0x08ff('0x71'),_0x4fe59d)[_0x08ff('0x70')](_0x08ff('0x72'),_0x54979c[_0x08ff('0x72')])[_0x08ff('0x48')]();return db[_0x08ff('0x67')][_0x08ff('0x5f')](_0x35dfb8)[_0x08ff('0x60')](function(_0x1886e9){_0x1e503b({'ret':0x1});})[_0x08ff('0x61')](function(_0x3f16cf){logger[_0x08ff('0x62')](_0x3f16cf[_0x08ff('0x5b')]);_0x2314c6({'ret':0x1});});}});}function handleTZQuery(_0x348314){logger[_0x08ff('0x59')](_0x348314);return db['sequelize']['query'](_0x348314)[_0x08ff('0x60')](function(_0x204601){})[_0x08ff('0x61')](function(_0x47edf8){logger['error'](_0x47edf8[_0x08ff('0x5b')]);});}function main(_0x23f6f3,_0x1ac8ee,_0x40e230,_0x54cdd2){logger[_0x08ff('0x59')](_0x08ff('0x73'),_0x23f6f3,JSON['stringify'](_0x1ac8ee));process['send'](_0x08ff('0x74'));var _0x52915d=_0x1ac8ee['binding'];var _0x520187=_[_0x08ff('0x75')](_0x52915d);var _0x36e498=_0x1ac8ee[_0x08ff('0x76')];var _0x37872d=path[_0x08ff('0x15')](config['root'],'server/files/tmp',_0x36e498+'.csv');hasTZ=_['keys'](_0x52915d)['includes'](_0x08ff('0x72'));var _0x2034b8=_[_0x08ff('0x52')](_0x52915d)['join']();logger[_0x08ff('0x59')](_0x08ff('0x77'),_0x2034b8);db[_0x08ff('0x78')]['findAll']({'raw':!![],'attributes':['id',_0x08ff('0x79')]})['then'](function(_0x4b77c3){for(var _0x49b1c4=0x0;_0x49b1c4<_0x4b77c3[_0x08ff('0x1b')];_0x49b1c4++){if(_0x4b77c3[_0x49b1c4][_0x08ff('0x79')]in _0x52915d){contactItemTypes[_0x08ff('0x1c')](_0x4b77c3[_0x49b1c4]);delete _0x520187[_0x4b77c3[_0x49b1c4][_0x08ff('0x79')]];hasAdditionalPhones=!![];}for(var _0x44b9e9 in _0x52915d){if(_0x4b77c3[_0x49b1c4][_0x08ff('0x79')]+'_description'===_0x44b9e9){phoneDescriptions['push']({'itemTypeId':_0x4b77c3[_0x49b1c4]['id'],'description':_0x44b9e9});delete _0x520187[_0x44b9e9];}}}if(hasAdditionalPhones)_0x520187[_0x08ff('0x1e')]='';var _0x453941=_['keys'](_0x520187)[_0x08ff('0x15')]();logger[_0x08ff('0x59')]('header',_0x453941);fs[_0x08ff('0x7a')](_0x37872d,_0x453941+'\x0a');Papa[_0x08ff('0x7b')](fs[_0x08ff('0x7c')](_0x23f6f3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x563c13,_0x293df7){try{for(var _0x366a9c=0x0,_0x326d7f=[];_0x366a9c<_0x563c13[_0x08ff('0x7d')]['length'];_0x366a9c++){stats[_0x08ff('0x7e')]+=0x1;if(_0x563c13[_0x08ff('0x5d')][_0x366a9c]){handleError(_0x563c13[_0x08ff('0x7d')][_0x366a9c],_0x563c13[_0x08ff('0x5d')][_0x366a9c]);}else{var _0x4a62ce=[];var _0x491213=[];var _0x21d13c={};for(var _0x51f17f in _0x52915d){let _0x163a39=contactItemTypes[_0x08ff('0x7f')](_0x5822e5=>_0x5822e5[_0x08ff('0x79')]===_0x51f17f);let _0x11c114=contactItemTypes[_0x08ff('0x7f')](_0x549e71=>_0x549e71[_0x08ff('0x79')]+_0x08ff('0x80')===_0x51f17f);if(_[_0x08ff('0x20')](_0x163a39)&&_['isNil'](_0x11c114)){if(_0x52915d['hasOwnProperty'](_0x51f17f)){if(_0x563c13[_0x08ff('0x7d')][_0x366a9c][_0x52915d[_0x51f17f]]){var _0x14b47e=_['trim'](_0x563c13[_0x08ff('0x7d')][_0x366a9c][_0x52915d[_0x51f17f]][_0x08ff('0x81')](/"/g,'\x27'));switch(_0x51f17f){case'scheduledat':var _0x5de097=moment(_0x14b47e,_0x08ff('0xe'),!![]);if(_0x5de097[_0x08ff('0x82')]()){_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x14b47e+'\x22');}else{_0x4a62ce[_0x08ff('0x1c')](_0x08ff('0x83'));}break;case _0x08ff('0x31'):var _0x5486cc=parseInt(_0x14b47e);_0x14b47e=_['isNaN'](_0x5486cc)||_0x5486cc<0x0||_0x5486cc>0x4?_0x54cdd2?0x3:0x2:_0x5486cc;_0x326d7f['push']('\x22'+_0x14b47e+'\x22');break;case'UserId':var _0x58864e=parseInt(_0x14b47e);if(_[_0x08ff('0x84')](_0x58864e)&&_[_0x08ff('0x85')](_0x40e230,_0x58864e)){_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x58864e+'\x22');}else{_0x4a62ce[_0x08ff('0x1c')](_0x08ff('0x86'));}break;case _0x08ff('0x87'):if(isEmail(_0x14b47e)){_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x14b47e+'\x22');}else{_0x4a62ce[_0x08ff('0x1c')](_0x08ff('0x88'));}break;case _0x08ff('0x89'):var _0x54ddae=moment(_0x14b47e,'YYYY-MM-DD',!![]);if(_0x54ddae[_0x08ff('0x82')]()){_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x14b47e+'\x22');}else{_0x4a62ce[_0x08ff('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x08ff('0x72'):var _0x5d0976=shared[_0x08ff('0x6e')];var _0x5082db=_0x5d0976[_0x14b47e];if(!_[_0x08ff('0x20')](_0x5082db)){var _0x19240e=_0x5082db[_0x08ff('0x6f')];_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x14b47e+'\x22');_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x19240e+'\x22');}break;default:_0x326d7f[_0x08ff('0x1c')]('\x22'+_0x14b47e+'\x22');}}else{switch(_0x51f17f){case _0x08ff('0x8a'):case _0x08ff('0x13'):_0x4a62ce[_0x08ff('0x1c')](_0x51f17f+_0x08ff('0x8b'));break;default:_0x326d7f[_0x08ff('0x1c')]('\x22\x22');}}}}else{var _0x191495='';if(!_[_0x08ff('0x20')](_0x163a39)){if(!_0x21d13c[_0x08ff('0x8c')](_0x163a39['id'])){if(!_[_0x08ff('0x20')](_0x563c13[_0x08ff('0x7d')][_0x366a9c][_0x52915d[_0x51f17f]])){var _0x14b47e=_[_0x08ff('0x8d')](_0x563c13[_0x08ff('0x7d')][_0x366a9c][_0x52915d[_0x51f17f]][_0x08ff('0x81')](/"/g,'\x27'));var _0x588fc1=phoneDescriptions[_0x08ff('0x7f')](_0x493989=>_0x493989[_0x08ff('0x8e')]===_0x163a39['id']);if(!_[_0x08ff('0x20')](_0x588fc1)){var _0x3758e4=_[_0x08ff('0x8d')](_0x563c13[_0x08ff('0x7d')][_0x366a9c][_0x52915d[_0x588fc1[_0x08ff('0x8f')]]][_0x08ff('0x81')](/"/g,'\x27'));if(!_['isNil'](_0x3758e4))_0x14b47e=_0x14b47e+'§'+_0x3758e4;}if(_0x191495=='')_0x191495=_0x14b47e;else _0x191495+='|'+_0x14b47e;}_0x491213[_0x08ff('0x1c')](_0x163a39['id']+':'+_0x191495);_0x21d13c[_0x163a39['id']]=0x1;}}}}if(hasAdditionalPhones){_0x326d7f['push']('\x22'+_0x491213[_0x08ff('0x15')](';')+'\x22');}if(_0x4a62ce[_0x08ff('0x1b')]){handleError(_0x563c13['data'][_0x366a9c],{'code':_0x08ff('0x90'),'message':_0x4a62ce[_0x08ff('0x15')]()});}else{fs['appendFileSync'](_0x37872d,_0x326d7f[_0x08ff('0x15')]()+'\x0a');}_0x326d7f=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x08ff('0x91')+_0x36e498,stats);stats['errors']=[];}}if(stopped){logger[_0x08ff('0x59')](_0x08ff('0x92'));_0x293df7[_0x08ff('0x93')]();}}catch(_0x1e6aed){handleError(_0x563c13[_0x08ff('0x7d')][_0x366a9c],{'code':_0x08ff('0x94'),'message':_0x1e6aed[_0x08ff('0x5b')]});logger[_0x08ff('0x62')]('step',_0x1e6aed[_0x08ff('0x5b')]);}},'complete':function(){try{var _0x2c4b4c=[];var _0x4bf378=[];var _0x264fba=_0x08ff('0x35');if(_0x1ac8ee[_0x08ff('0x95')]&&_0x1ac8ee[_0x08ff('0x95')][_0x08ff('0x1b')]){_0x264fba=_0x08ff('0x96')+_0x36e498;_0x2c4b4c['push'](_0x08ff('0x97')+_0x264fba+_0x08ff('0x98'));}tmp_campaigns=_0x08ff('0x99')+_0x36e498;tmp_voice_queues='voice_queues_'+_0x36e498;_0x4bf378['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x08ff('0x9a'));_0x4bf378[_0x08ff('0x1c')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x4bf378,handleTZQuery)[_0x08ff('0x1a')](function(_0x257dcf){updateTzCampaigns(_0x1ac8ee['ListId'])[_0x08ff('0x1a')](function(_0x34d756){updateTzVoiceQueues(_0x1ac8ee[_0x08ff('0x41')])[_0x08ff('0x1a')](function(_0x569964){if(hasTZ)_0x453941=_0x453941[_0x08ff('0x81')](_0x08ff('0x72'),_0x08ff('0x9b'));var _0x24432a=util[_0x08ff('0xf')](_0x08ff('0x9c'),_0x37872d,_0x264fba,_0x453941,_0x1ac8ee['ListId'],_0x1ac8ee[_0x08ff('0x53')]||null,NOW,NOW);if(_[_0x08ff('0x20')](_0x52915d[_0x08ff('0x9d')])){_0x24432a+=_0x08ff('0x9e');}_0x2c4b4c[_0x08ff('0x1c')](_0x24432a);if(_0x1ac8ee[_0x08ff('0x95')]&&_0x1ac8ee['duplicates'][_0x08ff('0x1b')]){_0x2c4b4c[_0x08ff('0x1c')](insertCmContact(_0x1ac8ee[_0x08ff('0x41')],_0x264fba,_0x1ac8ee[_0x08ff('0x95')],_0x52915d));_0x2c4b4c[_0x08ff('0x1c')]('DROP\x20TABLE\x20'+_0x264fba+';');}BPromise[_0x08ff('0x9f')](_0x2c4b4c,handleQuery)[_0x08ff('0x1a')](function(_0x173fcc){BPromise[_0x08ff('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x2c4b4c=[];for(var _0x916616=0x0;_0x916616\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','update','create','inserted','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','phone','scheduledat','ListId','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_contacts.phone','cm_contacts.ListId','cm_contacts.updatedAt','insert','createdAt','updatedAt','fields','from','ListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','ContactId','cm_hopper_black','.CmListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','query','spread','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId='];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x16d7,0x1b9));var _0x716d=function(_0x38200e,_0x1eddef){_0x38200e=_0x38200e-0x0;var _0x2916ba=_0x16d7[_0x38200e];return _0x2916ba;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x716d('0x0'));var Papa=require(_0x716d('0x1'));var util=require(_0x716d('0x2'));var BPromise=require(_0x716d('0x3'));var moment=require(_0x716d('0x4'));var squel=require(_0x716d('0x5'));var Redis=require(_0x716d('0x6'));var db=require(_0x716d('0x7'))['db'];var config=require(_0x716d('0x8'));var shared=require(_0x716d('0x9'));var logger=require('../../../config/logger')('import');config[_0x716d('0xa')]=_[_0x716d('0xb')](config[_0x716d('0xa')],{'host':_0x716d('0xc'),'port':0x18eb});var socket=require(_0x716d('0xd'))(new Redis(config[_0x716d('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x716d('0xe')](_0x716d('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x716d('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x5203a1){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))*$/[_0x716d('0x10')](_0x5203a1);}function selectNotIn(_0x575c6e,_0x57de7,_0x409c2d,_0x5de0bd,_0x3006f6){return squel[_0x716d('0x11')]()[_0x716d('0x12')]('phone')['from'](_0x5de0bd)[_0x716d('0x13')](_0x57de7,null,_0x57de7+_0x716d('0x14')+_0x5de0bd+'.'+_0x409c2d)[_0x716d('0x15')](_0x5de0bd+'.'+_0x409c2d+_0x716d('0x16')+_0x575c6e+'.'+_0x409c2d)[_0x716d('0x15')](_0x57de7+_0x716d('0x17')+_0x3006f6['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x476c77,_0x13c7d9){promisesAdditionalPhones=[];return db['CmContact'][_0x716d('0x18')]({'raw':!![],'attributes':['id',_0x716d('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x716d('0x1a')](function(_0x3adbe1){if(_0x3adbe1!==null){var _0x4d5b3a=[];for(var _0x10060f=0x0;_0x10060f<_0x3adbe1[_0x716d('0x1b')];_0x10060f++){var _0x4f7973=_0x3adbe1[_0x10060f];_0x4d5b3a[_0x716d('0x1c')](insertAdditionalPhones(_0x4f7973));}}Promise[_0x716d('0x1d')](_0x4d5b3a)['then'](function(){_0x476c77({'val':0x1});});});});}function insertAdditionalPhones(_0x5c8081){return new Promise(function(_0x443bdc,_0x305359){var _0x33fe35=_0x5c8081['AdditionalPhones'];var _0x4d7c7f=_0x33fe35[_0x716d('0x1e')](';');var _0x5274bd=[];orderBy=0x0;for(var _0x3b178a=0x0;_0x3b178a<_0x4d7c7f[_0x716d('0x1b')];_0x3b178a++){_0x5274bd[_0x716d('0x1c')](splitAdditionalPhone(_0x5c8081['id'],_0x4d7c7f[_0x3b178a]));}Promise[_0x716d('0x1d')](_0x5274bd)[_0x716d('0x1a')](function(){_0x443bdc({'val':_0x4d7c7f[_0x716d('0x1b')]});});});}function splitAdditionalPhone(_0x331285,_0x2c1f62){return new Promise(function(_0x1e6428,_0x27418a){var _0x31a967=_0x2c1f62[_0x716d('0x1e')](':');var _0x48b31b=_0x31a967[0x0];var _0x126573=_0x31a967[0x1];if(!_[_0x716d('0x1f')](_0x126573)){var _0x21ae97=_0x126573[_0x716d('0x1e')]('|');var _0x499092=[];for(var _0x7df1b=0x0;_0x7df1b<_0x21ae97[_0x716d('0x1b')];_0x7df1b++){if(_0x21ae97[_0x7df1b]!==''){var _0x565ead=_[_0x716d('0x20')](promisesAdditionalPhones,{'contactId':_0x331285,'phone':_0x21ae97[_0x7df1b]});if(_0x565ead[_0x716d('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x716d('0x1c')]({'contactId':_0x331285,'contactTypeId':_0x48b31b,'phone':_0x21ae97[_0x7df1b],'orderBy':orderBy});}}}_0x1e6428({'ok':0x1});}else _0x1e6428({'res':0x0});});}function createAdditionalPhone(_0x49f826,_0x168442,_0x1570e3,_0x53ac30){var _0x463ac2='';var _0x5dc2fd='';var _0x376c53=_0x1570e3[_0x716d('0x1e')]('§');_0x463ac2=_0x376c53[0x0];if(_0x376c53[_0x716d('0x1b')]==0x2)_0x5dc2fd=_0x376c53[0x1];return new Promise(function(_0x36f314,_0x3c8551){return db[_0x716d('0x21')]['findOne']({'where':{'CmContactId':_0x49f826,'item':_0x463ac2}})[_0x716d('0x1a')](function(_0x33c9fb){if(_0x33c9fb){return db[_0x716d('0x21')][_0x716d('0x22')]({'ItemTypeId':_0x168442,'description':_0x5dc2fd,'OrderBy':_0x53ac30},{'where':{'CmContactId':_0x49f826,'item':_0x463ac2}})['then'](function(_0x26124a){_0x36f314({'res':'updated'});});}else{return db[_0x716d('0x21')][_0x716d('0x23')]({'CmContactId':_0x49f826,'item':_0x463ac2,'description':_0x5dc2fd,'ItemTypeId':_0x168442,'OrderBy':_0x53ac30,'ItemClass':'PHONE'})['then'](function(_0x177c4f){_0x36f314({'res':_0x716d('0x24')});});}});});}function insertCmHopper(_0x158ab1,_0x1ec229,_0x59d41a,_0x5edc5e,_0x3b02e9){var _0x211083=['cm_contacts.phone','cm_contacts.scheduledat',_0x716d('0x25'),'cm_contacts.ListId',_0x1ec229+'.'+_0x5edc5e,_0x716d('0x26'),'cm_contacts.updatedAt',_0x716d('0x27'),_0x716d('0x28'),'\x22'+_0x3b02e9+'\x22'];return squel['insert']()[_0x716d('0x29')](_0x716d('0x2a'))[_0x716d('0x2b')]([_0x716d('0x2c'),_0x716d('0x2d'),'ContactId',_0x716d('0x2e'),_0x5edc5e,'createdAt','updatedAt',_0x716d('0x2f'),_0x716d('0x30'),_0x716d('0x31')],squel[_0x716d('0x11')]()['fields'](_0x211083)['from'](_0x1ec229)[_0x716d('0x13')](_0x716d('0x32'),null,_0x716d('0x33')+_0x1ec229+_0x716d('0x34'))[_0x716d('0x13')](_0x59d41a,null,_0x59d41a+_0x716d('0x14')+_0x1ec229+'.'+_0x5edc5e)['where'](_0x1ec229+'.CmListId\x20=\x20?',_0x158ab1)[_0x716d('0x15')](_0x716d('0x35'),NOW)[_0x716d('0x15')](_0x716d('0x36'),selectNotIn(_0x1ec229,_0x59d41a,_0x5edc5e,_0x716d('0x2a'),['\x22always\x22',_0x716d('0x37')]))[_0x716d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1ec229,_0x59d41a,_0x5edc5e,_0x716d('0x2a'),[_0x716d('0x38')])))['toString']();}function insertCmHopperBlack(_0xbef558,_0x59ac9b,_0x111363,_0x582768){var _0x37aef5=[_0x716d('0x39'),_0x716d('0x25'),_0x716d('0x3a'),_0x59ac9b+'.'+_0x582768,_0x716d('0x26'),_0x716d('0x3b')];return squel[_0x716d('0x3c')]()['into']('cm_hopper_black')[_0x716d('0x2b')]([_0x716d('0x2c'),'ContactId',_0x716d('0x2e'),_0x582768,_0x716d('0x3d'),_0x716d('0x3e')],squel[_0x716d('0x11')]()[_0x716d('0x3f')](_0x37aef5)['from'](_0x59ac9b)[_0x716d('0x13')](_0x716d('0x32'),null,_0x716d('0x33')+_0x59ac9b+'.CmListId')[_0x716d('0x13')](_0x111363,null,_0x111363+'.id\x20=\x20'+_0x59ac9b+'.'+_0x582768)[_0x716d('0x15')](_0x59ac9b+'.CmListId\x20=\x20?',_0xbef558)[_0x716d('0x15')](_0x716d('0x35'),NOW)[_0x716d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x716d('0x11')]()['field'](_0x716d('0x2c'))[_0x716d('0x40')]('cm_hopper_black')[_0x716d('0x15')](_0x716d('0x41'),_0xbef558)[_0x716d('0x15')](_0x582768+_0x716d('0x16')+_0x59ac9b+'.'+_0x582768)))[_0x716d('0x42')]();}function insertTzCmHopper(_0x61a4a6,_0x3a1b40,_0x2162ef,_0x224ad0,_0x53a324,_0x346944){var _0x45d95c=['cm_contacts.phone',_0x716d('0x43')+_0x346944+'.offset-cm_contacts.utcOffset\x20minute)',_0x716d('0x25'),_0x716d('0x3a'),_0x3a1b40+'.'+_0x224ad0,_0x716d('0x26'),_0x716d('0x3b'),_0x716d('0x27'),_0x716d('0x28'),'\x22'+_0x53a324+'\x22'];var _0x395da8=squel[_0x716d('0x3c')]()[_0x716d('0x29')](_0x716d('0x2a'))['fromQuery'](['phone',_0x716d('0x2d'),_0x716d('0x44'),_0x716d('0x2e'),_0x224ad0,'createdAt',_0x716d('0x3e'),_0x716d('0x2f'),_0x716d('0x30'),_0x716d('0x31')],squel[_0x716d('0x11')]()[_0x716d('0x3f')](_0x45d95c)[_0x716d('0x40')](_0x3a1b40)[_0x716d('0x13')](_0x716d('0x32'),null,_0x716d('0x33')+_0x3a1b40+_0x716d('0x34'))['join'](_0x2162ef,null,_0x2162ef+_0x716d('0x14')+_0x3a1b40+'.'+_0x224ad0)[_0x716d('0x13')](_0x346944,null,_0x346944+_0x716d('0x14')+_0x3a1b40+'.'+_0x224ad0)['where'](_0x3a1b40+'.CmListId\x20=\x20?',_0x61a4a6)['where'](_0x716d('0x35'),NOW)['where'](_0x716d('0x36'),selectNotIn(_0x3a1b40,_0x2162ef,_0x224ad0,'cm_hopper',[_0x716d('0x38'),_0x716d('0x37')]))[_0x716d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3a1b40,_0x2162ef,_0x224ad0,_0x716d('0x2a'),[_0x716d('0x38')])))[_0x716d('0x42')]();return _0x395da8;}function insertTzCmHopperBlack(_0xd1d12,_0x5f2b88,_0x4086e2,_0x3c32bc){var _0x269617=[_0x716d('0x39'),'cm_contacts.id',_0x716d('0x3a'),_0x5f2b88+'.'+_0x3c32bc,_0x716d('0x26'),_0x716d('0x3b')];return squel[_0x716d('0x3c')]()[_0x716d('0x29')](_0x716d('0x45'))['fromQuery']([_0x716d('0x2c'),_0x716d('0x44'),_0x716d('0x2e'),_0x3c32bc,_0x716d('0x3d'),'updatedAt'],squel[_0x716d('0x11')]()['fields'](_0x269617)[_0x716d('0x40')](_0x5f2b88)[_0x716d('0x13')](_0x716d('0x32'),null,_0x716d('0x33')+_0x5f2b88+_0x716d('0x34'))['join'](_0x4086e2,null,_0x4086e2+_0x716d('0x14')+_0x5f2b88+'.'+_0x3c32bc)[_0x716d('0x15')](_0x5f2b88+_0x716d('0x46'),_0xd1d12)[_0x716d('0x15')](_0x716d('0x35'),NOW)[_0x716d('0x15')](_0x716d('0x36'),squel[_0x716d('0x11')]()['field'](_0x716d('0x2c'))[_0x716d('0x40')]('cm_hopper_black')['where'](_0x716d('0x41'),_0xd1d12)[_0x716d('0x15')](_0x3c32bc+_0x716d('0x16')+_0x5f2b88+'.'+_0x3c32bc)))[_0x716d('0x42')]();}function insertCmHopperAdditionalPhones(_0xaf0b45){var _0x23c3c2=[_0x716d('0x47'),'cm_contact_has_items.item',_0x716d('0x48'),'cm_contact_has_items.createdAt',_0x716d('0x49')];return squel[_0x716d('0x3c')]()[_0x716d('0x29')](_0x716d('0x4a'))['fromQuery']([_0x716d('0x4b'),_0x716d('0x2c'),_0x716d('0x4c'),_0x716d('0x3d'),_0x716d('0x3e')],squel['select']()[_0x716d('0x3f')](_0x23c3c2)[_0x716d('0x40')]('cm_hopper')[_0x716d('0x13')](_0x716d('0x32'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x716d('0x13')](_0x716d('0x4d'),null,_0x716d('0x4e'))[_0x716d('0x15')]('cm_hopper.ListId\x20=\x20?',_0xaf0b45)[_0x716d('0x15')](_0x716d('0x35'),NOW))[_0x716d('0x42')]();}function insertCmContact(_0x482fc5,_0x2287f3,_0x75cb28,_0x2a681c){var _0x3df562=_[_0x716d('0x4f')](_[_0x716d('0x50')](_0x2a681c),[_0x716d('0x2e'),_0x716d('0x51'),_0x716d('0x3d'),'updatedAt',_0x716d('0x52')]);return squel['insert']()[_0x716d('0x29')](_0x716d('0x32'))[_0x716d('0x2b')](_0x3df562,squel[_0x716d('0x11')]()['fields'](_0x3df562)[_0x716d('0x40')](_0x2287f3)[_0x716d('0x15')]('('+_0x75cb28[_0x716d('0x13')](',')+_0x716d('0x53'),squel['select']()[_0x716d('0x3f')](_0x75cb28)[_0x716d('0x40')](_0x716d('0x32'))['where'](_0x716d('0x41'),_0x482fc5)['where'](_0x716d('0x54')))['where']('id\x20IN\x20?',squel[_0x716d('0x11')]()[_0x716d('0x12')](_0x716d('0x55'),_0x716d('0x56'))['from'](_0x2287f3)[_0x716d('0x57')](_0x75cb28['join'](','))))[_0x716d('0x42')]();}function handleStop(){logger[_0x716d('0x58')](_0x716d('0x59'));stopped=!![];}function handleUncaughtException(_0x462e8a){logger['error'](_0x462e8a[_0x716d('0x5a')]);process[_0x716d('0x5b')](0x1);}function handleError(_0x34411a,_0x120ed4){stats[_0x716d('0x5c')][_0x716d('0x1c')]({'name':_0x120ed4['code'],'message':_0x120ed4[_0x716d('0x5a')],'row':_0x34411a});}function handleQuery(_0x2203c9){logger[_0x716d('0x58')](_0x2203c9);return db['sequelize'][_0x716d('0x5d')](_0x2203c9)[_0x716d('0x5e')](function(_0x241ff6){results[_0x716d('0x1c')](_0x241ff6);})['catch'](function(_0x57ae6d){logger[_0x716d('0x5f')](_0x57ae6d[_0x716d('0x5a')]);});}function updateTzCampaigns(_0x437ee2){return new Promise(function(_0x19589a,_0x13fcf2){var _0x4f273d=squel[_0x716d('0x11')]()[_0x716d('0x3f')]([_0x716d('0x60'),_0x716d('0x61')])[_0x716d('0x40')](_0x716d('0x62'))['join'](_0x716d('0x63'),null,_0x716d('0x64'))[_0x716d('0x15')](_0x716d('0x65')+_0x437ee2);db[_0x716d('0x66')][_0x716d('0x5d')](_0x4f273d[_0x716d('0x42')]())[_0x716d('0x5e')](function(_0x5eee75){var _0x10982d=[];for(var _0xccfa57=0x0;_0xccfa57<_0x5eee75[_0x716d('0x1b')];_0xccfa57++){_0x10982d[_0x716d('0x1c')](getTimezoneData(_0x5eee75[_0xccfa57],tmp_campaigns));}BPromise[_0x716d('0x1d')](_0x10982d)['then'](function(){_0x19589a({'val':0x1});});})['catch'](function(_0x3d308d){logger[_0x716d('0x5f')](_0x3d308d[_0x716d('0x5a')]);_0x19589a({'val':0x0});});});}function updateTzVoiceQueues(_0x5468ef){return new Promise(function(_0x1f346d,_0x47f0e6){var _0x3fbaae=squel[_0x716d('0x11')]()[_0x716d('0x3f')]([_0x716d('0x67'),_0x716d('0x68')])[_0x716d('0x40')](_0x716d('0x69'))[_0x716d('0x13')](_0x716d('0x6a'),null,_0x716d('0x6b'))[_0x716d('0x15')](_0x716d('0x6c')+_0x5468ef);db[_0x716d('0x66')][_0x716d('0x5d')](_0x3fbaae[_0x716d('0x42')]())['spread'](function(_0x4fa0ab){var _0xe585f4=[];for(var _0x5523a0=0x0;_0x5523a0<_0x4fa0ab[_0x716d('0x1b')];_0x5523a0++){_0xe585f4[_0x716d('0x1c')](getTimezoneData(_0x4fa0ab[_0x5523a0],tmp_voice_queues));}BPromise[_0x716d('0x1d')](_0xe585f4)[_0x716d('0x1a')](function(){_0x1f346d({'val':0x1});});})[_0x716d('0x6d')](function(_0x470782){logger[_0x716d('0x5f')](_0x470782[_0x716d('0x5a')]);_0x1f346d({'val':0x0});});});}function getTimezoneData(_0x24571b,_0x118aa8){return new Promise(function(_0x308745,_0x51fc27){var _0x2c8005=shared[_0x716d('0x6e')];var _0x4e2818=_0x2c8005[_0x24571b[_0x716d('0x6f')]];if(_[_0x716d('0x1f')](_0x4e2818)){_0x308745({'ret':0x1});}else{var _0x167674=_0x4e2818['utcOffset'];var _0x20f764=squel[_0x716d('0x3c')]()[_0x716d('0x29')](_0x118aa8)['set']('id',_0x24571b['id'])[_0x716d('0x70')]('offset',_0x167674)[_0x716d('0x70')](_0x716d('0x6f'),_0x24571b[_0x716d('0x6f')])[_0x716d('0x42')]();return db[_0x716d('0x66')][_0x716d('0x5d')](_0x20f764)[_0x716d('0x5e')](function(_0x443eb3){_0x308745({'ret':0x1});})[_0x716d('0x6d')](function(_0x1586d9){logger[_0x716d('0x5f')](_0x1586d9[_0x716d('0x5a')]);_0x51fc27({'ret':0x1});});}});}function handleTZQuery(_0x2f2513){logger[_0x716d('0x58')](_0x2f2513);return db['sequelize'][_0x716d('0x5d')](_0x2f2513)[_0x716d('0x5e')](function(_0x262447){})[_0x716d('0x6d')](function(_0x2b80ff){logger['error'](_0x2b80ff[_0x716d('0x5a')]);});}function main(_0x4ccb95,_0x143707,_0x3bd0ff,_0x139123){logger[_0x716d('0x58')](_0x716d('0x71'),_0x4ccb95,JSON['stringify'](_0x143707));process['send'](_0x716d('0x72'));var _0x17ef94=_0x143707[_0x716d('0x73')];var _0x540fd5=_[_0x716d('0x74')](_0x17ef94);var _0x2b10a9=_0x143707[_0x716d('0x75')];var _0x9fd025=path[_0x716d('0x13')](config['root'],_0x716d('0x76'),_0x2b10a9+_0x716d('0x77'));hasTZ=_[_0x716d('0x50')](_0x17ef94)[_0x716d('0x78')](_0x716d('0x6f'));var _0x1ddfd2=_[_0x716d('0x50')](_0x17ef94)[_0x716d('0x13')]();logger[_0x716d('0x58')](_0x716d('0x79'),_0x1ddfd2);db[_0x716d('0x7a')][_0x716d('0x18')]({'raw':!![],'attributes':['id',_0x716d('0x7b')]})[_0x716d('0x1a')](function(_0x31ff0d){for(var _0x5c36fc=0x0;_0x5c36fc<_0x31ff0d[_0x716d('0x1b')];_0x5c36fc++){if(_0x31ff0d[_0x5c36fc][_0x716d('0x7b')]in _0x17ef94){contactItemTypes['push'](_0x31ff0d[_0x5c36fc]);delete _0x540fd5[_0x31ff0d[_0x5c36fc]['name']];hasAdditionalPhones=!![];}for(var _0xb74184 in _0x17ef94){if(_0x31ff0d[_0x5c36fc][_0x716d('0x7b')]+_0x716d('0x7c')===_0xb74184){phoneDescriptions[_0x716d('0x1c')]({'itemTypeId':_0x31ff0d[_0x5c36fc]['id'],'description':_0xb74184});delete _0x540fd5[_0xb74184];}}}if(hasAdditionalPhones)_0x540fd5['AdditionalPhones']='';var _0x27d330=_[_0x716d('0x50')](_0x540fd5)[_0x716d('0x13')]();logger[_0x716d('0x58')](_0x716d('0x79'),_0x27d330);fs[_0x716d('0x7d')](_0x9fd025,_0x27d330+'\x0a');Papa[_0x716d('0x7e')](fs['createReadStream'](_0x4ccb95),{'header':!![],'skipEmptyLines':!![],'step':function(_0x161c7d,_0x2f3c03){try{for(var _0x5c8a37=0x0,_0x22e487=[];_0x5c8a37<_0x161c7d[_0x716d('0x7f')][_0x716d('0x1b')];_0x5c8a37++){stats[_0x716d('0x80')]+=0x1;if(_0x161c7d['errors'][_0x5c8a37]){handleError(_0x161c7d[_0x716d('0x7f')][_0x5c8a37],_0x161c7d['errors'][_0x5c8a37]);}else{var _0x53a6f3=[];var _0x1e2b4a=[];var _0x36c7d5={};for(var _0xea01c2 in _0x17ef94){let _0x11c2c1=contactItemTypes[_0x716d('0x81')](_0x2a1250=>_0x2a1250[_0x716d('0x7b')]===_0xea01c2);let _0x46729c=contactItemTypes[_0x716d('0x81')](_0x538b6c=>_0x538b6c[_0x716d('0x7b')]+_0x716d('0x7c')===_0xea01c2);if(_[_0x716d('0x1f')](_0x11c2c1)&&_[_0x716d('0x1f')](_0x46729c)){if(_0x17ef94[_0x716d('0x82')](_0xea01c2)){if(_0x161c7d['data'][_0x5c8a37][_0x17ef94[_0xea01c2]]){var _0x5724ed=_[_0x716d('0x83')](_0x161c7d[_0x716d('0x7f')][_0x5c8a37][_0x17ef94[_0xea01c2]][_0x716d('0x84')](/"/g,'\x27'));switch(_0xea01c2){case'scheduledat':var _0x435629=moment(_0x5724ed,_0x716d('0xf'),!![]);if(_0x435629[_0x716d('0x85')]()){_0x22e487[_0x716d('0x1c')]('\x22'+_0x5724ed+'\x22');}else{_0x53a6f3[_0x716d('0x1c')](_0x716d('0x86'));}break;case'priority':var _0x58dfab=parseInt(_0x5724ed);_0x5724ed=_[_0x716d('0x87')](_0x58dfab)||_0x58dfab<0x0||_0x58dfab>0x4?_0x139123?0x3:0x2:_0x58dfab;_0x22e487[_0x716d('0x1c')]('\x22'+_0x5724ed+'\x22');break;case _0x716d('0x30'):var _0x14dc7e=parseInt(_0x5724ed);if(_[_0x716d('0x88')](_0x14dc7e)&&_[_0x716d('0x78')](_0x3bd0ff,_0x14dc7e)){_0x22e487[_0x716d('0x1c')]('\x22'+_0x14dc7e+'\x22');}else{_0x53a6f3[_0x716d('0x1c')](_0x716d('0x89'));}break;case _0x716d('0x8a'):if(isEmail(_0x5724ed)){_0x22e487[_0x716d('0x1c')]('\x22'+_0x5724ed+'\x22');}else{_0x53a6f3[_0x716d('0x1c')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x43a1bc=moment(_0x5724ed,_0x716d('0x8b'),!![]);if(_0x43a1bc[_0x716d('0x85')]()){_0x22e487[_0x716d('0x1c')]('\x22'+_0x5724ed+'\x22');}else{_0x53a6f3['push'](_0x716d('0x8c'));}break;case _0x716d('0x6f'):var _0x2ca484=shared['timezones'];var _0x54bb8e=_0x2ca484[_0x5724ed];if(!_[_0x716d('0x1f')](_0x54bb8e)){var _0x1fd056=_0x54bb8e[_0x716d('0x8d')];_0x22e487[_0x716d('0x1c')]('\x22'+_0x5724ed+'\x22');_0x22e487[_0x716d('0x1c')]('\x22'+_0x1fd056+'\x22');}break;default:_0x22e487[_0x716d('0x1c')]('\x22'+_0x5724ed+'\x22');}}else{switch(_0xea01c2){case _0x716d('0x8e'):case _0x716d('0x2c'):_0x53a6f3[_0x716d('0x1c')](_0xea01c2+_0x716d('0x8f'));break;default:_0x22e487['push']('\x22\x22');}}}}else{var _0x2dd4b5='';if(!_[_0x716d('0x1f')](_0x11c2c1)){if(!_0x36c7d5[_0x716d('0x82')](_0x11c2c1['id'])){if(!_[_0x716d('0x1f')](_0x161c7d[_0x716d('0x7f')][_0x5c8a37][_0x17ef94[_0xea01c2]])){var _0x5724ed=_[_0x716d('0x83')](_0x161c7d['data'][_0x5c8a37][_0x17ef94[_0xea01c2]][_0x716d('0x84')](/"/g,'\x27'));var _0x49e31a=phoneDescriptions[_0x716d('0x81')](_0x3909a1=>_0x3909a1[_0x716d('0x90')]===_0x11c2c1['id']);if(!_['isNil'](_0x49e31a)){var _0x50345d=_[_0x716d('0x83')](_0x161c7d[_0x716d('0x7f')][_0x5c8a37][_0x17ef94[_0x49e31a[_0x716d('0x91')]]][_0x716d('0x84')](/"/g,'\x27'));if(!_[_0x716d('0x1f')](_0x50345d))_0x5724ed=_0x5724ed+'§'+_0x50345d;}if(_0x2dd4b5=='')_0x2dd4b5=_0x5724ed;else _0x2dd4b5+='|'+_0x5724ed;}_0x1e2b4a[_0x716d('0x1c')](_0x11c2c1['id']+':'+_0x2dd4b5);_0x36c7d5[_0x11c2c1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x22e487['push']('\x22'+_0x1e2b4a['join'](';')+'\x22');}if(_0x53a6f3[_0x716d('0x1b')]){handleError(_0x161c7d[_0x716d('0x7f')][_0x5c8a37],{'code':_0x716d('0x92'),'message':_0x53a6f3[_0x716d('0x13')]()});}else{fs[_0x716d('0x93')](_0x9fd025,_0x22e487[_0x716d('0x13')]()+'\x0a');}_0x22e487=[];}if(!(stats[_0x716d('0x80')]%0xc8)){socket[_0x716d('0x94')](_0x716d('0x95')+_0x2b10a9,stats);stats[_0x716d('0x5c')]=[];}}if(stopped){logger['info'](_0x716d('0x96'));_0x2f3c03[_0x716d('0x97')]();}}catch(_0x387492){handleError(_0x161c7d[_0x716d('0x7f')][_0x5c8a37],{'code':'SystemError','message':_0x387492[_0x716d('0x5a')]});logger[_0x716d('0x5f')](_0x716d('0x98'),_0x387492[_0x716d('0x5a')]);}},'complete':function(){try{var _0x513fc8=[];var _0x59e5a8=[];var _0x24b98f=_0x716d('0x32');if(_0x143707[_0x716d('0x99')]&&_0x143707['duplicates']['length']){_0x24b98f=_0x716d('0x9a')+_0x2b10a9;_0x513fc8[_0x716d('0x1c')]('CREATE\x20TABLE\x20'+_0x24b98f+_0x716d('0x9b'));}tmp_campaigns='campaigns_'+_0x2b10a9;tmp_voice_queues=_0x716d('0x9c')+_0x2b10a9;_0x59e5a8['push']('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x59e5a8[_0x716d('0x1c')](_0x716d('0x9d')+tmp_voice_queues+_0x716d('0x9e'));BPromise[_0x716d('0x9f')](_0x59e5a8,handleTZQuery)['then'](function(_0x48404a){updateTzCampaigns(_0x143707[_0x716d('0x2e')])[_0x716d('0x1a')](function(_0x1d94f6){updateTzVoiceQueues(_0x143707['ListId'])[_0x716d('0x1a')](function(_0x2a3497){if(hasTZ)_0x27d330=_0x27d330[_0x716d('0x84')](_0x716d('0x6f'),_0x716d('0xa0'));var _0x1b5370=util[_0x716d('0xe')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x9fd025,_0x24b98f,_0x27d330,_0x143707[_0x716d('0x2e')],_0x143707[_0x716d('0x51')]||null,NOW,NOW);if(_[_0x716d('0x1f')](_0x17ef94[_0x716d('0x2d')])){_0x1b5370+=',\x20scheduledAt\x20=\x20NOW()';}_0x513fc8[_0x716d('0x1c')](_0x1b5370);if(_0x143707[_0x716d('0x99')]&&_0x143707[_0x716d('0x99')][_0x716d('0x1b')]){_0x513fc8[_0x716d('0x1c')](insertCmContact(_0x143707[_0x716d('0x2e')],_0x24b98f,_0x143707[_0x716d('0x99')],_0x17ef94));_0x513fc8[_0x716d('0x1c')]('DROP\x20TABLE\x20'+_0x24b98f+';');}BPromise[_0x716d('0x9f')](_0x513fc8,handleQuery)[_0x716d('0x1a')](function(_0x1e4f9f){BPromise[_0x716d('0x1d')]([handleAdditionalPhones()])[_0x716d('0x1a')](function(){_0x513fc8=[];for(var _0x3903a4=0x0;_0x3903a4\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','select','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','query','length','isNil','AdditionalPhones','all','then','message','split','filter','push','findOne','CmContactHasItem','update','updated','create','PHONE','CmContact','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','createdAt','priority','UserId','recallme','fields','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','ContactId','updatedAt','.CmListId\x20=\x20?','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','ListId',')\x20NOT\x20IN\x20?','MIN(id)','info','error','exit','code','spread','catch','main','stringify','send','start','binding','clone','socket_timestamp','root','.csv','body','ContactItemType','name','_description','header','parse','createReadStream','data','find','hasOwnProperty','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)','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','rows'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd958,0xb8));var _0x8d95=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xd958[_0x44bcb0];return _0xfaf881;};'use strict';var fs=require('fs');var path=require(_0x8d95('0x0'));var _=require(_0x8d95('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x8d95('0x2'));var moment=require('moment');var squel=require(_0x8d95('0x3'));var Redis=require(_0x8d95('0x4'));var db=require(_0x8d95('0x5'))['db'];var config=require(_0x8d95('0x6'));var logger=require(_0x8d95('0x7'))(_0x8d95('0x8'));config[_0x8d95('0x9')]=_[_0x8d95('0xa')](config['redis'],{'host':_0x8d95('0xb'),'port':0x18eb});var socket=require(_0x8d95('0xc'))(new Redis(config[_0x8d95('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x8d95('0xd')](_0x8d95('0xe'));var tempTableName='cm_contacts_temp_'+moment()[_0x8d95('0xd')](_0x8d95('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1e0760){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x1e0760);}function selectNotIn(_0x5ddceb,_0x471317,_0xd71379,_0x2bb0ef,_0x4c0a28){return squel[_0x8d95('0x10')]()['field'](_0x8d95('0x11'))[_0x8d95('0x12')](_0x2bb0ef)['join'](_0x471317,null,_0x471317+_0x8d95('0x13')+_0x2bb0ef+'.'+_0xd71379)[_0x8d95('0x14')](_0x2bb0ef+'.'+_0xd71379+'\x20=\x20'+_0x5ddceb+'.'+_0xd71379)[_0x8d95('0x14')](_0x471317+_0x8d95('0x15')+_0x4c0a28[_0x8d95('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x31d0ef,_0x58f9fc){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8d95('0x17')][_0x8d95('0x18')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x11f4fd){if(_0x11f4fd!==null){var _0x39186b=[];for(var _0x439d74=0x0;_0x439d74<_0x11f4fd[_0x8d95('0x19')];_0x439d74++){var _0x24d18f=_0x11f4fd[_0x439d74];if(!_[_0x8d95('0x1a')](_0x24d18f[_0x8d95('0x11')])){if(!_[_0x8d95('0x1a')](_0x24d18f[_0x8d95('0x1b')]))_0x39186b['push'](insertAdditionalPhones(_0x24d18f));promisesContact['push']({'contact':_0x24d18f});}}}Promise[_0x8d95('0x1c')](_0x39186b)[_0x8d95('0x1d')](function(){_0x31d0ef({'val':0x1});});})['catch'](function(_0x759a7d){logger['error'](_0x759a7d[_0x8d95('0x1e')]);});});}function insertAdditionalPhones(_0x1a529c){return new Promise(function(_0x5e93d2,_0x591466){var _0x2b1a02=_0x1a529c['AdditionalPhones'];if(_['isNil'](_0x2b1a02))_0x591466({'val':0x0});else{var _0x242596=_0x2b1a02[_0x8d95('0x1f')](';');var _0x3c700e=[];orderBy=0x0;for(var _0x1ad861=0x0;_0x1ad861<_0x242596['length'];_0x1ad861++){_0x3c700e['push'](splitAdditionalPhone(_0x1a529c['id'],_0x242596[_0x1ad861]));}Promise[_0x8d95('0x1c')](_0x3c700e)[_0x8d95('0x1d')](function(){_0x5e93d2({'val':_0x242596['length']});});}});}function splitAdditionalPhone(_0x1b4e1c,_0x2b8564){return new Promise(function(_0x2fa82b,_0x1b01b5){var _0x34c2f6=_0x2b8564[_0x8d95('0x1f')](':');var _0x41e432=_0x34c2f6[0x0];var _0x395535=_0x34c2f6[0x1];if(_0x395535!==''){var _0x4a90c1=_0x395535[_0x8d95('0x1f')]('|');var _0xe59e86=[];for(var _0x2865a2=0x0;_0x2865a2<_0x4a90c1[_0x8d95('0x19')];_0x2865a2++){if(_0x4a90c1[_0x2865a2]!==''){var _0x44cb0b=_[_0x8d95('0x20')](promisesAdditionalPhones,{'contactId':_0x1b4e1c,'phone':_0x4a90c1[_0x2865a2]});if(_0x44cb0b[_0x8d95('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x8d95('0x21')]({'contactId':_0x1b4e1c,'contactTypeId':_0x41e432,'phone':_0x4a90c1[_0x2865a2],'orderBy':orderBy});}}}_0x2fa82b({'ok':0x1});}else _0x2fa82b({'res':0x0});});}function createAdditionalPhone(_0x436f5a,_0xe3c6d,_0xf87282,_0x4a2dea){var _0x2dd4be='';var _0x4026a4='';var _0x5d5bac=_0xf87282[_0x8d95('0x1f')]('§');_0x2dd4be=_0x5d5bac[0x0];if(_0x5d5bac[_0x8d95('0x19')]==0x2)_0x4026a4=_0x5d5bac[0x1];return new Promise(function(_0x23b2c4,_0x16fd40){return db['CmContactHasItem'][_0x8d95('0x22')]({'where':{'CmContactId':_0x436f5a,'item':_0x2dd4be}})[_0x8d95('0x1d')](function(_0x2f9d2e){if(_0x2f9d2e){return db[_0x8d95('0x23')][_0x8d95('0x24')]({'ItemTypeId':_0xe3c6d,'description':_0x4026a4,'OrderBy':_0x4a2dea},{'where':{'CmContactId':_0x436f5a,'item':_0x2dd4be}})['then'](function(_0x32f308){_0x23b2c4({'res':_0x8d95('0x25')});});}else{return db['CmContactHasItem'][_0x8d95('0x26')]({'CmContactId':_0x436f5a,'item':_0x2dd4be,'ItemTypeId':_0xe3c6d,'description':_0x4026a4,'OrderBy':_0x4a2dea,'ItemClass':_0x8d95('0x27')})[_0x8d95('0x1d')](function(_0x8c5e72){_0x23b2c4({'res':'inserted'});});}});});}function updateContact(_0x5ede97){return new Promise(function(_0x106e26,_0x1ce189){var _0x10cb09=_0x5ede97['id'];delete _0x5ede97['id'];return db[_0x8d95('0x28')]['update'](_0x5ede97,{'where':{'id':_0x10cb09}})['then'](function(_0x36297e){updatedRows+=0x1;return db['CmHopper'][_0x8d95('0x24')]({'phone':_0x5ede97[_0x8d95('0x11')]},{'where':{'ContactId':_0x10cb09}})[_0x8d95('0x1d')](function(_0x5e70e0){_0x106e26({'ret':'OK'});});});});}function insertCmHopper(_0x437f8e,_0x477129,_0x1eceb9,_0x5dd4b8,_0x309bef){var _0x1d191a=['cm_contacts.phone',_0x8d95('0x29'),_0x8d95('0x2a'),_0x8d95('0x2b'),_0x477129+'.'+_0x5dd4b8,_0x8d95('0x2c'),_0x8d95('0x2d'),_0x8d95('0x2e'),_0x8d95('0x2f'),'\x22'+_0x309bef+'\x22'];return squel[_0x8d95('0x30')]()[_0x8d95('0x31')]('cm_hopper')[_0x8d95('0x32')]([_0x8d95('0x11'),_0x8d95('0x33'),'ContactId','ListId',_0x5dd4b8,_0x8d95('0x34'),'updatedAt',_0x8d95('0x35'),_0x8d95('0x36'),_0x8d95('0x37')],squel[_0x8d95('0x10')]()[_0x8d95('0x38')](_0x1d191a)[_0x8d95('0x12')](_0x477129)[_0x8d95('0x16')](_0x8d95('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x477129+_0x8d95('0x3a'))[_0x8d95('0x16')](_0x1eceb9,null,_0x1eceb9+_0x8d95('0x13')+_0x477129+'.'+_0x5dd4b8)[_0x8d95('0x14')](_0x477129+'.CmListId\x20=\x20?',_0x437f8e)[_0x8d95('0x14')](_0x8d95('0x3b'),NOW)['where'](_0x8d95('0x3c'),selectNotIn(_0x477129,_0x1eceb9,_0x5dd4b8,_0x8d95('0x3d'),[_0x8d95('0x3e'),_0x8d95('0x3f')]))[_0x8d95('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x477129,_0x1eceb9,_0x5dd4b8,'cm_hopper',[_0x8d95('0x3e')])))[_0x8d95('0x40')]();}function insertCmHopperBlack(_0x57ac09,_0x54779c,_0x40edfe,_0x12b322){var _0x3f48b1=[_0x8d95('0x41'),'cm_contacts.id',_0x8d95('0x2b'),_0x54779c+'.'+_0x12b322,'cm_contacts.createdAt',_0x8d95('0x2d')];return squel[_0x8d95('0x30')]()['into'](_0x8d95('0x42'))['fromQuery']([_0x8d95('0x11'),_0x8d95('0x43'),'ListId',_0x12b322,_0x8d95('0x34'),_0x8d95('0x44')],squel[_0x8d95('0x10')]()[_0x8d95('0x38')](_0x3f48b1)[_0x8d95('0x12')](_0x54779c)[_0x8d95('0x16')](_0x8d95('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x54779c+'.CmListId')[_0x8d95('0x16')](_0x40edfe,null,_0x40edfe+_0x8d95('0x13')+_0x54779c+'.'+_0x12b322)[_0x8d95('0x14')](_0x54779c+_0x8d95('0x45'),_0x57ac09)[_0x8d95('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8d95('0x14')](_0x8d95('0x3c'),squel[_0x8d95('0x10')]()[_0x8d95('0x46')](_0x8d95('0x11'))[_0x8d95('0x12')](_0x8d95('0x42'))['where'](_0x8d95('0x47'),_0x57ac09)[_0x8d95('0x14')](_0x12b322+'\x20=\x20?',_0x54779c+'.'+_0x12b322)))[_0x8d95('0x40')]();}function insertCmHopperAdditionalPhones(_0xc0bcf9){var _0x297903=[_0x8d95('0x48'),_0x8d95('0x49'),_0x8d95('0x4a'),_0x8d95('0x4b'),_0x8d95('0x4c')];return squel['insert']()[_0x8d95('0x31')](_0x8d95('0x4d'))[_0x8d95('0x32')]([_0x8d95('0x4e'),_0x8d95('0x11'),'OrderBy',_0x8d95('0x34'),'updatedAt'],squel[_0x8d95('0x10')]()[_0x8d95('0x38')](_0x297903)[_0x8d95('0x12')](_0x8d95('0x3d'))[_0x8d95('0x16')](_0x8d95('0x39'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x8d95('0x16')]('cm_contact_has_items',null,_0x8d95('0x4f'))[_0x8d95('0x14')](_0x8d95('0x50'),_0xc0bcf9)[_0x8d95('0x14')](_0x8d95('0x3b'),NOW))[_0x8d95('0x40')]();}function insertCmContact(_0x47b85b,_0x5bd9dc,_0x2db813,_0x3d6fd9){var _0x882365=_[_0x8d95('0x51')](_[_0x8d95('0x52')](_0x3d6fd9),[_0x8d95('0x53'),'CompanyId','createdAt','updatedAt']);return squel[_0x8d95('0x30')]()[_0x8d95('0x31')]('cm_contacts')[_0x8d95('0x32')](_0x882365,squel[_0x8d95('0x10')]()[_0x8d95('0x38')](_0x882365)[_0x8d95('0x12')](_0x5bd9dc)['where']('('+_0x2db813[_0x8d95('0x16')](',')+_0x8d95('0x54'),squel[_0x8d95('0x10')]()[_0x8d95('0x38')](_0x2db813)[_0x8d95('0x12')]('cm_contacts')[_0x8d95('0x14')](_0x8d95('0x47'),_0x47b85b))['where']('id\x20IN\x20?',squel[_0x8d95('0x10')]()['field'](_0x8d95('0x55'),'min_id')[_0x8d95('0x12')](_0x5bd9dc)['group'](_0x2db813[_0x8d95('0x16')](','))))['toString']();}function handleStop(){logger[_0x8d95('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x23fc03){logger[_0x8d95('0x57')](_0x23fc03[_0x8d95('0x1e')]);process[_0x8d95('0x58')](0x1);}function handleError(_0x47c02a,_0xb4ac24){stats['errors'][_0x8d95('0x21')]({'name':_0xb4ac24[_0x8d95('0x59')],'message':_0xb4ac24[_0x8d95('0x1e')],'row':_0x47c02a});}function handleQuery(_0x188abf){logger[_0x8d95('0x56')](_0x188abf);return db[_0x8d95('0x17')][_0x8d95('0x18')](_0x188abf)[_0x8d95('0x5a')](function(_0x43d33d){results['push'](_0x43d33d);})[_0x8d95('0x5b')](function(_0x10ac7c){logger['error'](_0x10ac7c[_0x8d95('0x1e')]);});}function main(_0x4b45ae,_0x3b55fb,_0x173efc,_0x21a087){logger['info'](_0x8d95('0x5c'),_0x4b45ae,JSON[_0x8d95('0x5d')](_0x3b55fb));process[_0x8d95('0x5e')](_0x8d95('0x5f'));var _0x3d2c65=_0x3b55fb[_0x8d95('0x60')];var _0xe273aa=_[_0x8d95('0x61')](_0x3d2c65);var _0x227c31=_0x3b55fb[_0x8d95('0x62')];var _0x1e5978=path['join'](config[_0x8d95('0x63')],'server/files/tmp',_0x227c31+_0x8d95('0x64'));logger[_0x8d95('0x56')](_0x8d95('0x65'),_0x3b55fb);db[_0x8d95('0x66')]['findAll']({'raw':!![],'attributes':['id',_0x8d95('0x67')]})[_0x8d95('0x1d')](function(_0x346d5d){for(var _0x5c7f2f=0x0;_0x5c7f2f<_0x346d5d['length'];_0x5c7f2f++){if(_0x346d5d[_0x5c7f2f]['name']in _0x3d2c65){contactItemTypes[_0x8d95('0x21')](_0x346d5d[_0x5c7f2f]);delete _0xe273aa[_0x346d5d[_0x5c7f2f]['name']];hasAdditionalPhones=!![];}for(var _0x365210 in _0x3d2c65){if(_0x346d5d[_0x5c7f2f][_0x8d95('0x67')]+_0x8d95('0x68')===_0x365210){phoneDescriptions[_0x8d95('0x21')]({'itemTypeId':_0x346d5d[_0x5c7f2f]['id'],'description':_0x365210});delete _0xe273aa[_0x365210];}}}if(hasAdditionalPhones)_0xe273aa[_0x8d95('0x1b')]='';var _0x4975e3=_[_0x8d95('0x52')](_0xe273aa)[_0x8d95('0x16')]();logger[_0x8d95('0x56')](_0x8d95('0x69'),_0x4975e3);fs['writeFileSync'](_0x1e5978,_0x4975e3+'\x0a');Papa[_0x8d95('0x6a')](fs[_0x8d95('0x6b')](_0x4b45ae),{'header':!![],'skipEmptyLines':!![],'step':function(_0x320cc4,_0x85e1a2){try{for(var _0x5ec515=0x0,_0x599099=[];_0x5ec515<_0x320cc4[_0x8d95('0x6c')][_0x8d95('0x19')];_0x5ec515++){stats['rows']+=0x1;if(_0x320cc4['errors'][_0x5ec515]){handleError(_0x320cc4['data'][_0x5ec515],_0x320cc4['errors'][_0x5ec515]);}else{var _0x3fb5b8=[];var _0x476a52=[];var _0xb06e21={};for(var _0x6b154a in _0x3d2c65){let _0x21b0a6=contactItemTypes[_0x8d95('0x6d')](_0x5ae870=>_0x5ae870[_0x8d95('0x67')]===_0x6b154a);let _0xd4a728=contactItemTypes[_0x8d95('0x6d')](_0x3b1e7f=>_0x3b1e7f['name']+_0x8d95('0x68')===_0x6b154a);if(_[_0x8d95('0x1a')](_0x21b0a6)&&_[_0x8d95('0x1a')](_0xd4a728)){if(_0x3d2c65[_0x8d95('0x6e')](_0x6b154a)){if(_0x320cc4[_0x8d95('0x6c')][_0x5ec515][_0x3d2c65[_0x6b154a]]){var _0x578349=_[_0x8d95('0x6f')](_0x320cc4['data'][_0x5ec515][_0x3d2c65[_0x6b154a]][_0x8d95('0x70')](/"/g,'\x27'));switch(_0x6b154a){case _0x8d95('0x33'):var _0x13c978=moment(_0x578349,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x13c978[_0x8d95('0x71')]()){_0x599099['push']('\x22'+_0x578349+'\x22');}else{_0x3fb5b8[_0x8d95('0x21')](_0x8d95('0x72'));}break;case _0x8d95('0x35'):var _0x3b7892=parseInt(_0x578349);_0x578349=_[_0x8d95('0x73')](_0x3b7892)||_0x3b7892<0x0||_0x3b7892>0x4?_0x21a087?0x3:0x2:_0x3b7892;_0x599099['push']('\x22'+_0x578349+'\x22');break;case _0x8d95('0x36'):var _0x358680=parseInt(_0x578349);if(_[_0x8d95('0x74')](_0x358680)&&_[_0x8d95('0x75')](_0x173efc,_0x358680)){_0x599099[_0x8d95('0x21')]('\x22'+_0x358680+'\x22');}else{_0x3fb5b8[_0x8d95('0x21')](_0x8d95('0x76'));}break;case _0x8d95('0x77'):if(isEmail(_0x578349)){_0x599099[_0x8d95('0x21')]('\x22'+_0x578349+'\x22');}else{_0x3fb5b8[_0x8d95('0x21')](_0x8d95('0x78'));}break;case _0x8d95('0x79'):var _0x421bd6=moment(_0x578349,'YYYY-MM-DD',!![]);if(_0x421bd6['isValid']()){_0x599099['push']('\x22'+_0x578349+'\x22');}else{_0x3fb5b8['push'](_0x8d95('0x7a'));}break;default:_0x599099[_0x8d95('0x21')]('\x22'+_0x578349+'\x22');}}else{switch(_0x6b154a){case _0x8d95('0x7b'):case _0x8d95('0x11'):_0x3fb5b8[_0x8d95('0x21')](_0x6b154a+_0x8d95('0x7c'));break;default:_0x599099[_0x8d95('0x21')]('\x22\x22');}}}}else{var _0x127396='';if(!_['isNil'](_0x21b0a6)){if(!_0xb06e21['hasOwnProperty'](_0x21b0a6['id'])){for(var _0x47cd56=0x0;_0x47cd56<_0x3d2c65[_0x6b154a][_0x8d95('0x19')];_0x47cd56++){var _0x578349=_[_0x8d95('0x6f')](_0x320cc4['data'][_0x5ec515][_0x3d2c65[_0x6b154a][_0x47cd56]]['replace'](/"/g,'\x27'));var _0x931af=phoneDescriptions[_0x8d95('0x6d')](_0x380dcd=>_0x380dcd[_0x8d95('0x7d')]===_0x21b0a6['id']);if(!_[_0x8d95('0x1a')](_0x931af)){var _0x565827=_['trim'](_0x320cc4[_0x8d95('0x6c')][_0x5ec515][_0x3d2c65[_0x931af[_0x8d95('0x7e')]][0x0]][_0x8d95('0x70')](/"/g,'\x27'));if(!_[_0x8d95('0x1a')](_0x565827))_0x578349=_0x578349+'§'+_0x565827;}if(_0x127396=='')_0x127396=_0x578349;else _0x127396+='|'+_0x578349;}_0x476a52[_0x8d95('0x21')](_0x21b0a6['id']+':'+_0x127396);_0xb06e21[_0x21b0a6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x599099[_0x8d95('0x21')]('\x22'+_0x476a52[_0x8d95('0x16')](';')+'\x22');}if(_0x3fb5b8['length']){handleError(_0x320cc4[_0x8d95('0x6c')][_0x5ec515],{'code':_0x8d95('0x7f'),'message':_0x3fb5b8[_0x8d95('0x16')]()});}else{fs[_0x8d95('0x80')](_0x1e5978,_0x599099[_0x8d95('0x16')]()+'\x0a');}_0x599099=[];}if(!(stats[_0x8d95('0x81')]%0xc8)){socket[_0x8d95('0x82')](_0x8d95('0x83')+_0x227c31,stats);stats[_0x8d95('0x84')]=[];}}if(stopped){logger['info'](_0x8d95('0x85'));_0x85e1a2[_0x8d95('0x86')]();}}catch(_0x371961){handleError(_0x320cc4[_0x8d95('0x6c')][_0x5ec515],{'code':_0x8d95('0x87'),'message':_0x371961[_0x8d95('0x1e')]});logger[_0x8d95('0x57')]('step',_0x371961[_0x8d95('0x1e')]);}},'complete':function(){try{var _0x21de11=[];var _0x14e7c5=tempTableName;_0x21de11[_0x8d95('0x21')](_0x8d95('0x88')+_0x14e7c5+'\x20LIKE\x20cm_contacts;');logger[_0x8d95('0x56')](_0x8d95('0x89'),contactItemTypes[_0x8d95('0x19')]);var _0x22cc12=util[_0x8d95('0xd')](_0x8d95('0x8a'),_0x1e5978,_0x14e7c5,_0x4975e3,_0x3b55fb[_0x8d95('0x53')],_0x3b55fb[_0x8d95('0x8b')]||null,NOW,NOW);if(_[_0x8d95('0x1a')](_0x3d2c65[_0x8d95('0x33')])){_0x22cc12+=_0x8d95('0x8c');}_0x21de11[_0x8d95('0x21')](_0x22cc12);BPromise['each'](_0x21de11,handleQuery)[_0x8d95('0x1d')](function(_0x27f2fb){BPromise[_0x8d95('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x21de11=[];for(var _0x36e877=0x0;_0x36e877_0x4d07ea[_0x39bb('0x62')]===_0x1db4ee);let _0x5d44b4=contactItemTypes[_0x39bb('0x6a')](_0x23899f=>_0x23899f['name']+_0x39bb('0x63')===_0x1db4ee);if(_[_0x39bb('0x1b')](_0x2c4010)&&_['isNil'](_0x5d44b4)){if(_0x1af7c1['hasOwnProperty'](_0x1db4ee)){if(_0x15a2e9[_0x39bb('0x68')][_0x50dbbb][_0x1af7c1[_0x1db4ee]]){var _0x295bdb=_['trim'](_0x15a2e9['data'][_0x50dbbb][_0x1af7c1[_0x1db4ee]][_0x39bb('0x6b')](/"/g,'\x27'));switch(_0x1db4ee){case _0x39bb('0x32'):var _0x3f77a2=moment(_0x295bdb,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3f77a2['isValid']()){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}else{_0x15d18a['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x39bb('0x37'):var _0x1c11e6=parseInt(_0x295bdb);_0x295bdb=_['isNaN'](_0x1c11e6)||_0x1c11e6<0x0||_0x1c11e6>0x4?_0x54a3a1?0x3:0x2:_0x1c11e6;_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');break;case'UserId':var _0x10873e=parseInt(_0x295bdb);if(_['isNumber'](_0x10873e)&&_[_0x39bb('0x6c')](_0x17062e,_0x10873e)){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x10873e+'\x22');}else{_0x15d18a[_0x39bb('0x1d')](_0x39bb('0x6d'));}break;case'email':if(isEmail(_0x295bdb)){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}else{_0x15d18a['push'](_0x39bb('0x6e'));}break;case'dateOfBirth':var _0x4b22a4=moment(_0x295bdb,'YYYY-MM-DD',!![]);if(_0x4b22a4[_0x39bb('0x6f')]()){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}else{_0x15d18a[_0x39bb('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x295bdb+'\x22');}}else{switch(_0x1db4ee){case'firstName':case'phone':_0x15d18a[_0x39bb('0x1d')](_0x1db4ee+_0x39bb('0x70'));break;default:_0x38cb9f[_0x39bb('0x1d')]('\x22\x22');}}}}else{var _0x4b653e='';if(!_[_0x39bb('0x1b')](_0x2c4010)){if(!_0x337bcd['hasOwnProperty'](_0x2c4010['id'])){for(var _0x22ec45=0x0;_0x22ec45<_0x1af7c1[_0x1db4ee]['length'];_0x22ec45++){var _0x295bdb=_[_0x39bb('0x71')](_0x15a2e9['data'][_0x50dbbb][_0x1af7c1[_0x1db4ee][_0x22ec45]][_0x39bb('0x6b')](/"/g,'\x27'));var _0x402206=phoneDescriptions['find'](_0x39979a=>_0x39979a[_0x39bb('0x72')]===_0x2c4010['id']);if(!_[_0x39bb('0x1b')](_0x402206)){var _0x5d4d0d=_[_0x39bb('0x71')](_0x15a2e9['data'][_0x50dbbb][_0x1af7c1[_0x402206[_0x39bb('0x73')]][0x0]][_0x39bb('0x6b')](/"/g,'\x27'));if(!_[_0x39bb('0x1b')](_0x5d4d0d))_0x295bdb=_0x295bdb+'§'+_0x5d4d0d;}if(_0x4b653e=='')_0x4b653e=_0x295bdb;else _0x4b653e+='|'+_0x295bdb;}_0x4c0f29[_0x39bb('0x1d')](_0x2c4010['id']+':'+_0x4b653e);_0x337bcd[_0x2c4010['id']]=0x1;}}}}if(hasAdditionalPhones){_0x38cb9f[_0x39bb('0x1d')]('\x22'+_0x4c0f29[_0x39bb('0x12')](';')+'\x22');}if(_0x15d18a[_0x39bb('0x1a')]){handleError(_0x15a2e9['data'][_0x50dbbb],{'code':_0x39bb('0x74'),'message':_0x15d18a[_0x39bb('0x12')]()});}else{fs['appendFileSync'](_0x99ed06,_0x38cb9f['join']()+'\x0a');}_0x38cb9f=[];}if(!(stats[_0x39bb('0x69')]%0xc8)){socket[_0x39bb('0x75')](_0x39bb('0x76')+_0x369028,stats);stats[_0x39bb('0x59')]=[];}}if(stopped){logger[_0x39bb('0x57')]('Abort\x20parser');_0x10c647['abort']();}}catch(_0x3b385f){handleError(_0x15a2e9[_0x39bb('0x68')][_0x50dbbb],{'code':_0x39bb('0x77'),'message':_0x3b385f['message']});logger['error'](_0x39bb('0x78'),_0x3b385f[_0x39bb('0x21')]);}},'complete':function(){try{var _0x67d6d3=[];var _0x54b96e=tempTableName;_0x67d6d3[_0x39bb('0x1d')]('CREATE\x20TABLE\x20'+_0x54b96e+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes[_0x39bb('0x1a')]);var _0x4892ae=util[_0x39bb('0xe')](_0x39bb('0x79'),_0x99ed06,_0x54b96e,_0x31ffe2,_0x196c07[_0x39bb('0x34')],_0x196c07[_0x39bb('0x52')]||null,NOW,NOW);if(_[_0x39bb('0x1b')](_0x1af7c1[_0x39bb('0x32')])){_0x4892ae+=_0x39bb('0x7a');}_0x67d6d3[_0x39bb('0x1d')](_0x4892ae);BPromise['each'](_0x67d6d3,handleQuery)[_0x39bb('0x22')](function(_0xfbc732){BPromise[_0x39bb('0x1e')]([handleAdditionalPhones()])[_0x39bb('0x22')](function(){_0x67d6d3=[];for(var _0x14a72f=0x0;_0x14a72f\x20\x20');}var _0x92b6a0=path['join'](config[_0x39bb('0x86')],_0x39bb('0x60'),process[_0x39bb('0x85')][0x2]);if(!fs[_0x39bb('0x87')](_0x92b6a0)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x10ab34={};try{_0x10ab34=JSON[_0x39bb('0x66')](process['argv'][0x3]);if(!_0x10ab34[_0x39bb('0x88')]){throw new Error(_0x39bb('0x89'));}var _0x138034=0x0;if(_0x10ab34[_0x39bb('0x88')][_0x39bb('0x38')]){_0x138034=0x1;}if(!_0x10ab34[_0x39bb('0x34')]){throw new Error(_0x39bb('0x8a'));}}catch(_0x3c112e){throw new Error(_0x39bb('0x8b'));}var _0x5d00d1=[];try{_0x5d00d1=_[_0x39bb('0x8c')](JSON[_0x39bb('0x66')](process[_0x39bb('0x85')][0x4]),'id');}catch(_0x20ee5b){logger[_0x39bb('0x57')](_0x39bb('0x8d'));}main(_0x92b6a0,_0x10ab34,_0x5d00d1,_0x138034);}validate();process['on'](_0x39bb('0x8e'),handleStop);process['on'](_0x39bb('0x8f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 7fb5a1a..fba1091 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 _0xd173=['Agent\x20Number','destcalleridnum','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','variable','queue','push','calleridnum','outbound','Outbound\x20Call','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x4b2b5a,_0x3f7555){var _0x47f812=function(_0x4de6ef){while(--_0x4de6ef){_0x4b2b5a['push'](_0x4b2b5a['shift']());}};_0x47f812(++_0x3f7555);}(_0xd173,0x9f));var _0x3d17=function(_0x253b7c,_0x4d79ee){_0x253b7c=_0x253b7c-0x0;var _0x36e8bf=_0xd173[_0x253b7c];return _0x36e8bf;};'use strict';exports[_0x3d17('0x0')]=function(_0x75755e,_0x53d72a){var _0x478540=[{'type':_0x3d17('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x75755e[_0x3d17('0x2')]()){case _0x3d17('0x3'):switch(_0x53d72a[_0x3d17('0x2')]()){case'inbound':_0x478540['push']({'type':_0x3d17('0x4'),'content':'','variableName':_0x3d17('0x5')});_0x478540[_0x3d17('0x6')]({'type':_0x3d17('0x4'),'content':'','variableName':_0x3d17('0x7')});break;case _0x3d17('0x8'):_0x478540[_0x3d17('0x6')]({'type':'string','content':_0x3d17('0x9'),'variableName':null});_0x478540[_0x3d17('0x6')]({'type':_0x3d17('0x4'),'content':'','variableName':'destcalleridnum'});break;}}return _0x478540;};exports[_0x3d17('0xa')]=function(_0x21d937,_0x46a28d){var _0x3e4144=[];switch(_0x21d937[_0x3d17('0x2')]()){case _0x3d17('0x3'):switch(_0x46a28d['toLowerCase']()){case _0x3d17('0xb'):_0x3e4144=[{'type':_0x3d17('0x1'),'content':_0x3d17('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x3d17('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x3d17('0x4'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x3d17('0xe'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0xf')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x10'),'keyType':_0x3d17('0x4'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0x3d17('0x11'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x5')},{'type':'keyValue','content':'','key':_0x3d17('0x12'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x13')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x14'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x15')},{'type':_0x3d17('0x1'),'content':_0x3d17('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x17'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x18')},{'type':'keyValue','content':'','key':_0x3d17('0x19'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x1a')},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x1b'),'keyType':_0x3d17('0x4'),'variableName':'agentcalledAt'},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x1c'),'keyType':'variable','variableName':_0x3d17('0x1d')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x1e'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x1f')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x20'),'keyType':_0x3d17('0x4'),'variableName':_0x3d17('0x21')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x22'),'keyType':_0x3d17('0x4'),'variableName':'talktime'}];break;case _0x3d17('0x8'):_0x3e4144=[{'type':_0x3d17('0x1'),'content':_0x3d17('0xc'),'variableName':null},{'type':'keyValue','content':'','key':_0x3d17('0x23'),'keyType':_0x3d17('0x4'),'keyContent':'','variableName':_0x3d17('0x1a')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x24'),'keyType':_0x3d17('0x4'),'keyContent':'','variableName':_0x3d17('0x25')},{'type':_0x3d17('0xd'),'content':'','key':'UniqueId','keyType':_0x3d17('0x4'),'keyContent':'','variableName':_0x3d17('0x13')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x14'),'keyType':_0x3d17('0x4'),'keyContent':'','variableName':_0x3d17('0x26')},{'type':_0x3d17('0x1'),'content':_0x3d17('0x27')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x28'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x3d17('0x29'),'keyType':_0x3d17('0x4'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x3d17('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x3d17('0x2b')},{'type':_0x3d17('0xd'),'content':'','key':_0x3d17('0x2c'),'keyType':_0x3d17('0x4'),'keyContent':'','variableName':_0x3d17('0x2d')}];break;}}return _0x3e4144;}; \ No newline at end of file +var _0x8b49=['queue','calleridnum','outbound','voice','toLowerCase','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Member\x20Name','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','inbound','push','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8b49,0x75));var _0x98b4=function(_0x3d7f7d,_0x5d57d7){_0x3d7f7d=_0x3d7f7d-0x0;var _0x59c78b=_0x8b49[_0x3d7f7d];return _0x59c78b;};'use strict';exports[_0x98b4('0x0')]=function(_0x2eef2d,_0x23b96c){var _0x294896=[{'type':_0x98b4('0x1'),'content':_0x98b4('0x2'),'variableName':null}];switch(_0x2eef2d['toLowerCase']()){case'voice':switch(_0x23b96c['toLowerCase']()){case _0x98b4('0x3'):_0x294896[_0x98b4('0x4')]({'type':_0x98b4('0x5'),'content':'','variableName':_0x98b4('0x6')});_0x294896[_0x98b4('0x4')]({'type':'variable','content':'','variableName':_0x98b4('0x7')});break;case _0x98b4('0x8'):_0x294896[_0x98b4('0x4')]({'type':_0x98b4('0x1'),'content':'Outbound\x20Call','variableName':null});_0x294896[_0x98b4('0x4')]({'type':_0x98b4('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x294896;};exports['getDescriptions']=function(_0x271d39,_0x328096){var _0x2b8cd8=[];switch(_0x271d39['toLowerCase']()){case _0x98b4('0x9'):switch(_0x328096[_0x98b4('0xa')]()){case _0x98b4('0x3'):_0x2b8cd8=[{'type':_0x98b4('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x98b4('0xb'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0x98b4('0x7')},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0xc'),'keyType':'variable','variableName':'calleridname'},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0xd'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0xe')},{'type':'keyValue','content':'','key':_0x98b4('0xf'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x6')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x10')},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x11'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x12')},{'type':_0x98b4('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x13'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x14')},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x15'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x16')},{'type':_0x98b4('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x17'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x18'),'keyType':_0x98b4('0x5'),'variableName':'agentconnectAt'},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x19'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x1a')},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x1b'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x1c')},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x1d'),'keyType':_0x98b4('0x5'),'variableName':_0x98b4('0x1e')}];break;case'outbound':_0x2b8cd8=[{'type':'string','content':_0x98b4('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0x98b4('0x16')},{'type':'keyValue','content':'','key':_0x98b4('0x20'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x98b4('0xb'),'content':'','key':'UniqueId','keyType':_0x98b4('0x5'),'keyContent':'','variableName':_0x98b4('0x10')},{'type':_0x98b4('0xb'),'content':'','key':'Date','keyType':_0x98b4('0x5'),'keyContent':'','variableName':_0x98b4('0x21')},{'type':_0x98b4('0x1'),'content':_0x98b4('0x22')},{'type':'keyValue','content':'','key':_0x98b4('0x23'),'keyType':_0x98b4('0x5'),'keyContent':'','variableName':_0x98b4('0x24')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x98b4('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x25'),'keyType':_0x98b4('0x5'),'keyContent':'','variableName':_0x98b4('0x26')},{'type':_0x98b4('0xb'),'content':'','key':_0x98b4('0x27'),'keyType':'variable','keyContent':'','variableName':_0x98b4('0x28')}];break;}}return _0x2b8cd8;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index fc3dc35..d4cea26 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 _0x3002=['findAll','then','search','body','where','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','ids','tag','countFilteredInteractions','count','clause','order','DESC','getClosedOrderClause','rows','catch','tracked','clone','omit','html','phone','lodash','./sql-utils','./utils'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x3002,0x81));var _0x2300=function(_0x587d02,_0x2ad0ba){_0x587d02=_0x587d02-0x0;var _0x18b956=_0x3002[_0x587d02];return _0x18b956;};'use strict';var _=require(_0x2300('0x0'));var sqlUtils=require(_0x2300('0x1'));var utils=require(_0x2300('0x2'));exports[_0x2300('0x3')]=function(_0x39b96f,_0x566efc,_0x14a328,_0x5806eb,_0x311269){var _0x2faa91={'count':0x0,'rows':[]};var _0x4d73a4=sqlUtils['skipInteractionsQuery'](_0x39b96f,_0x14a328,_0x566efc);if(_0x4d73a4){return Promise['resolve'](_0x2faa91);}var _0x473d9f=sqlUtils['getInteractionsQuery'](_0x39b96f);var _0x118675={};return Promise['resolve']()[_0x2300('0x4')](function(){if(_0x566efc[_0x2300('0x5')]){return sqlUtils['parseAdvancedSearchFilter'](_0x566efc[_0x2300('0x5')],_0x311269);}else{return sqlUtils['parseQueryParameters'](_0x39b96f,_0x566efc,_0x311269);}})[_0x2300('0x4')](function(_0x9f8e7d){_0x473d9f['where'](_0x9f8e7d[_0x2300('0x6')]);_0x473d9f[_0x2300('0x7')](_0x9f8e7d[_0x2300('0x8')]);_0x473d9f['where'](_0x9f8e7d[_0x2300('0x9')]);_0x473d9f['where'](_0x9f8e7d[_0x2300('0xa')]);_0x473d9f[_0x2300('0x7')](_0x9f8e7d[_0x2300('0xb')]);_0x473d9f[_0x2300('0x7')](_0x9f8e7d[_0x2300('0xc')]);_0x473d9f[_0x2300('0xd')](_0x9f8e7d[_0x2300('0xe')]);_0x118675=_0x9f8e7d[_0x2300('0xf')];return sqlUtils[_0x2300('0x10')](_0x39b96f,_0x14a328,_0x566efc);})[_0x2300('0x4')](function(_0x1a6611){_0x473d9f[_0x2300('0x7')](_0x1a6611);_0x473d9f[_0x2300('0x11')]('i.id');var _0x4c5ab4=_0x566efc[_0x2300('0x5')]?_0x118675[_0x2300('0x12')]:_0x566efc[_0x2300('0x13')];return sqlUtils[_0x2300('0x14')](_0x473d9f,_0x4c5ab4);})[_0x2300('0x4')](function(_0x11b889){_0x2faa91['count']=_0x11b889['length'];if(_0x2faa91[_0x2300('0x15')]===0x0){return[];}_0x473d9f['having'](_0x118675[_0x2300('0x16')]);if(_0x5806eb[_0x2300('0x17')]){_0x5806eb[_0x2300('0x17')]['forEach'](function(_0x474e09){var _0x2461d8=_0x474e09[0x0]==='contactName'?_0x474e09[0x0]:'i.'+_0x474e09[0x0];_0x473d9f['order'](_0x2461d8,_0x474e09[0x1]===_0x2300('0x18')?![]:!![]);if(_0x474e09[0x0]==='closed'){var _0x1dea03=sqlUtils[_0x2300('0x19')](_0x39b96f,_0x566efc);_0x473d9f[_0x2300('0x17')](_0x1dea03,_0x474e09[0x1]===_0x2300('0x18')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x39b96f,_0x473d9f,_0x566efc,_0x5806eb);})[_0x2300('0x4')](function(_0x181a85){_0x2faa91[_0x2300('0x1a')]=_0x181a85;return _0x2faa91;})[_0x2300('0x1b')](function(_0x418fe4){throw _0x418fe4;});};exports[_0x2300('0x1c')]=function(_0x1ba677,_0x32ad35){return function(_0x2035a9,_0x1d1e6d,_0x5a8cf7){var _0x4076e1=_0x2035a9[_0x2300('0xc')];var _0x23b5bb={};var _0xb1631a=_0x2035a9['query'];if(_0x23b5bb){_0x23b5bb=_[_0x2300('0x1d')](_0x2035a9[_0x2300('0x6')]);_0x23b5bb=_[_0x2300('0x1e')](_0x23b5bb,[_0x2300('0x6'),_0x2300('0x1f'),_0x2300('0x20'),'fax','mobile']);}utils['updateUser'](_0x4076e1,_0x23b5bb,_0xb1631a,_0x1ba677,_0x32ad35);_0x5a8cf7(null);};}; \ No newline at end of file +var _0x4a27=['body','where','contact','default','fields','having','read','tags','checkAccountsRestrictions','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','order','DESC','closed','getClosedOrderClause','rows','catch','tracked','query','clone','omit','html','phone','mobile','updateUser','lodash','./sql-utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','parseAdvancedSearchFilter','search','parseQueryParameters'];(function(_0x40edbb,_0x4b8e85){var _0x1c34e1=function(_0x4cb6dc){while(--_0x4cb6dc){_0x40edbb['push'](_0x40edbb['shift']());}};_0x1c34e1(++_0x4b8e85);}(_0x4a27,0x13e));var _0x74a2=function(_0x1237b1,_0x19ce6b){_0x1237b1=_0x1237b1-0x0;var _0x429a0c=_0x4a27[_0x1237b1];return _0x429a0c;};'use strict';var _=require(_0x74a2('0x0'));var sqlUtils=require(_0x74a2('0x1'));var utils=require('./utils');exports[_0x74a2('0x2')]=function(_0x17f254,_0x121a68,_0x5ed1b5,_0x2b1299,_0x178a1e){var _0x4b67={'count':0x0,'rows':[]};var _0x1012f2=sqlUtils[_0x74a2('0x3')](_0x17f254,_0x5ed1b5,_0x121a68);if(_0x1012f2){return Promise[_0x74a2('0x4')](_0x4b67);}var _0x2bb624=sqlUtils[_0x74a2('0x5')](_0x17f254);var _0x3ab9e5={};return Promise['resolve']()[_0x74a2('0x6')](function(){if(_0x121a68['search']){return sqlUtils[_0x74a2('0x7')](_0x121a68[_0x74a2('0x8')],_0x178a1e);}else{return sqlUtils[_0x74a2('0x9')](_0x17f254,_0x121a68,_0x178a1e);}})[_0x74a2('0x6')](function(_0x3f3318){_0x2bb624['where'](_0x3f3318[_0x74a2('0xa')]);_0x2bb624[_0x74a2('0xb')](_0x3f3318[_0x74a2('0xc')]);_0x2bb624[_0x74a2('0xb')](_0x3f3318[_0x74a2('0xd')]);_0x2bb624['where'](_0x3f3318[_0x74a2('0xe')]);_0x2bb624[_0x74a2('0xb')](_0x3f3318['filter']);_0x2bb624[_0x74a2('0xb')](_0x3f3318['user']);_0x2bb624[_0x74a2('0xf')](_0x3f3318[_0x74a2('0x10')]);_0x3ab9e5=_0x3f3318[_0x74a2('0x11')];return sqlUtils[_0x74a2('0x12')](_0x17f254,_0x5ed1b5,_0x121a68);})['then'](function(_0x445e62){_0x2bb624[_0x74a2('0xb')](_0x445e62);_0x2bb624[_0x74a2('0x13')](_0x74a2('0x14'));var _0x16979e=_0x121a68[_0x74a2('0x8')]?_0x3ab9e5[_0x74a2('0x15')]:_0x121a68[_0x74a2('0x16')];return sqlUtils[_0x74a2('0x17')](_0x2bb624,_0x16979e);})[_0x74a2('0x6')](function(_0x2590cd){_0x4b67[_0x74a2('0x18')]=_0x2590cd[_0x74a2('0x19')];if(_0x4b67[_0x74a2('0x18')]===0x0){return[];}_0x2bb624[_0x74a2('0xf')](_0x3ab9e5[_0x74a2('0x1a')]);if(_0x2b1299[_0x74a2('0x1b')]){_0x2b1299[_0x74a2('0x1b')]['forEach'](function(_0x51ec55){var _0x152094=_0x51ec55[0x0]==='contactName'?_0x51ec55[0x0]:'i.'+_0x51ec55[0x0];_0x2bb624[_0x74a2('0x1b')](_0x152094,_0x51ec55[0x1]===_0x74a2('0x1c')?![]:!![]);if(_0x51ec55[0x0]===_0x74a2('0x1d')){var _0x3e5c2f=sqlUtils[_0x74a2('0x1e')](_0x17f254,_0x121a68);_0x2bb624[_0x74a2('0x1b')](_0x3e5c2f,_0x51ec55[0x1]===_0x74a2('0x1c')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x17f254,_0x2bb624,_0x121a68,_0x2b1299);})[_0x74a2('0x6')](function(_0x51152b){_0x4b67[_0x74a2('0x1f')]=_0x51152b;return _0x4b67;})[_0x74a2('0x20')](function(_0x2fe897){throw _0x2fe897;});};exports[_0x74a2('0x21')]=function(_0x12cb14,_0x5c5619){return function(_0x1c7797,_0x4d4532,_0x43206b){var _0x2cb81a=_0x1c7797['user'];var _0xf736cf={};var _0x3b9b2f=_0x1c7797[_0x74a2('0x22')];if(_0xf736cf){_0xf736cf=_[_0x74a2('0x23')](_0x1c7797[_0x74a2('0xa')]);_0xf736cf=_[_0x74a2('0x24')](_0xf736cf,[_0x74a2('0xa'),_0x74a2('0x25'),_0x74a2('0x26'),'fax',_0x74a2('0x27')]);}utils[_0x74a2('0x28')](_0x2cb81a,_0xf736cf,_0x3b9b2f,_0x12cb14,_0x5c5619);_0x43206b(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 16c5cac..d3f16d4 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc62a=['c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','../parsers/advancedSearch','../parsers/qs','../../mysqldb','getAccountFK','role','agent','search','field','name','color','from','tools_tags','user_has_','select','u.id','u.fullname','ui.','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','accounts','a.id\x20=\x20i.','messages','it.','\x20=\x20i.id','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','buildExpression','default','text','value','start','end','unreadMessages','read','and','operator','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','Tag','map','tags','clause','ids','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','then','fields','tag','filter','get','capitalize','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','join','getInteractionFK','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','c.email','Contact.email','c.phone'];(function(_0x2343c2,_0x2e960e){var _0x294542=function(_0x210675){while(--_0x210675){_0x2343c2['push'](_0x2343c2['shift']());}};_0x294542(++_0x2e960e);}(_0xc62a,0x15e));var _0xac62=function(_0x1d0e6d,_0x4b57bc){_0x1d0e6d=_0x1d0e6d-0x0;var _0x4707ee=_0xc62a[_0x1d0e6d];return _0x4707ee;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0xac62('0x0'));var qs=require(_0xac62('0x1'));var updateInteraction=require('./update-interaction')['updateInteraction'];var utils=require('./utils');var db=require(_0xac62('0x2'))['db'];function skipInteractionsQuery(_0x442869,_0x4cfe39,_0x37c86b){var _0x12338e=![];var _0x4cfef7=utils[_0xac62('0x3')](_0x442869);if(_0x4cfe39[_0xac62('0x4')]===_0xac62('0x5')&&!_0x37c86b[_0xac62('0x6')]&&!_0x37c86b[_0x4cfef7]){_0x12338e=!![];}return _0x12338e;}function getTagsQuery(){return squel['select']()[_0xac62('0x7')]('id')[_0xac62('0x7')](_0xac62('0x8'))[_0xac62('0x7')](_0xac62('0x9'))[_0xac62('0xa')](_0xac62('0xb'));}function getUsersQuery(_0x439605,_0x41e7d3){var _0x330d9b=utils['getInteractionFK'](_0x439605);var _0x1d3c72=_0xac62('0xc')+_0x439605+'_interactions';var _0x45f790=squel[_0xac62('0xd')]()[_0xac62('0x7')](_0xac62('0xe'))['field'](_0xac62('0xf'))[_0xac62('0x7')](_0xac62('0x10')+_0x330d9b)[_0xac62('0xa')](_0x1d3c72,'ui')['left_join']('users','u',_0xac62('0x11'));if(_0x41e7d3[_0xac62('0x12')]>0x0){_0x45f790[_0xac62('0x13')]('ui.'+_0x330d9b+_0xac62('0x14'),_['map'](_0x41e7d3,'id'));}return _0x45f790;}function getInteractionsQuery(_0x1c3170){var _0x531d62=utils['getInteractionsTables'](_0x1c3170);var _0x2cf574=utils[_0xac62('0x3')](_0x1c3170);var _0x162ab4=utils['getInteractionFK'](_0x1c3170);return squel['select']()[_0xac62('0xa')](_0x531d62[_0xac62('0x15')],'i')[_0xac62('0x16')](_0xac62('0x17'),'c',_0xac62('0x18'))[_0xac62('0x16')](_0xac62('0x19'),'o','o.id\x20=\x20i.UserId')[_0xac62('0x16')](_0x531d62[_0xac62('0x1a')],'a',_0xac62('0x1b')+_0x2cf574)[_0xac62('0x16')](_0x531d62[_0xac62('0x1c')],'me','me.'+_0x162ab4+'\x20=\x20i.id')[_0xac62('0x16')](_0x531d62['interactionsTags'],'it',_0xac62('0x1d')+_0x162ab4+_0xac62('0x1e'))['left_join'](_0xac62('0xb'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x2681e4={'body':squel['expr'](),'contact':squel[_0xac62('0x1f')](),'default':squel['expr'](),'fields':squel[_0xac62('0x1f')](),'filter':squel[_0xac62('0x1f')](),'read':squel[_0xac62('0x1f')](),'tags':{'clause':squel[_0xac62('0x1f')](),'ids':null},'user':squel[_0xac62('0x1f')]()};return _0x2681e4;}function parseTagParameter(_0x283c1f){var _0x28efd5=squel[_0xac62('0x1f')]();if(_0x283c1f){var _0x2bf16f=utils['getSelectedTags'](_0x283c1f);_0x2bf16f[_0xac62('0x20')](function(_0x13214f){_0x28efd5['or'](_0xac62('0x21'),'%,'+_0x13214f+',%');});}return _0x28efd5;}function parseReadParameter(_0x4c7f06){var _0x5e6dc2='';if(_0x4c7f06){_0x5e6dc2=_0xac62('0x22');if(_0x4c7f06==='1'){_0x5e6dc2=_0x5e6dc2[_0xac62('0x23')](_0xac62('0x24'),'=');}else{_0x5e6dc2=_0x5e6dc2[_0xac62('0x23')](_0xac62('0x24'),'>');}}return _0x5e6dc2;}function parseSearchFilter(_0x32db33,_0xb8cdf8){var _0x3e8d4d=squel[_0xac62('0x1f')]();if(_0xb8cdf8){var _0x6f5cf8=_0xb8cdf8[_0xac62('0x23')]('\x5c','\x5c\x5c')[_0xac62('0x23')](/'/g,'\x27\x27');if(qs[_0xac62('0x25')](_0x6f5cf8)){_0x3e8d4d['or'](_0xac62('0x26'),_0x6f5cf8+'%');if([_0xac62('0x27'),_0xac62('0x28')][_0xac62('0x29')](_0x32db33)){_0x3e8d4d['or']('i.phone\x20LIKE\x20?',_0x6f5cf8+'%');}else if(_0x32db33==='fax'){_0x3e8d4d['or'](_0xac62('0x2a'),_0x6f5cf8+'%');}else if(_0x32db33===_0xac62('0x2b')){_0x3e8d4d['or'](_0xac62('0x2c'),_0x6f5cf8+'%');}}else if(_0x32db33===_0xac62('0x2d')&&qs[_0xac62('0x2e')](_0x6f5cf8)){_0x3e8d4d['or'](_0xac62('0x2f'),_0x6f5cf8+'%');}else{if(_0x32db33===_0xac62('0x2d')){_0x3e8d4d['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6f5cf8,!![]))['or'](_0xac62('0x30'),qs[_0xac62('0x31')](_0x6f5cf8));}else if(_0x32db33!==_0xac62('0x32')){_0x3e8d4d['or'](_0xac62('0x33'),qs[_0xac62('0x31')](_0x6f5cf8));}_0x3e8d4d['or'](_0xac62('0x34'),qs[_0xac62('0x31')](_0x6f5cf8,!![]),null);}}return _0x3e8d4d;}function parseAdvancedSearchFilter(_0x66f1b,_0xd235c){var _0x57c9fb=getSqlClauses();var _0x2e04e6=as['parseSearch'](_0x66f1b);var _0x4205ca=_0x2e04e6[_0xac62('0x35')];for(var _0x2c66c9=0x0;_0x2c66c9<_0x2e04e6['conditions'][_0xac62('0x12')];_0x2c66c9++){var _0x1813dd=_0x2e04e6[_0xac62('0x36')][_0x2c66c9];var _0x29a9a8='i';var _0x50ca1d=_[_0xac62('0x37')](_0xd235c,[_0xac62('0x8'),_0x1813dd[_0xac62('0x7')]]);if(_0x50ca1d){var _0x55356b=as[_0xac62('0x38')](_0x29a9a8,_0x50ca1d['type'],_0x1813dd);_0x57c9fb[_0xac62('0x39')][_0x4205ca](_0x55356b[_0xac62('0x3a')],_0x55356b[_0xac62('0x3b')][_0xac62('0x3c')],_0x55356b[_0xac62('0x3b')][_0xac62('0x3d')]);}else{switch(_0x1813dd[_0xac62('0x7')]){case _0xac62('0x3e'):var _0x4d7e47=parseReadParameter(_0x1813dd['value']);_0x57c9fb[_0xac62('0x3f')][_0xac62('0x40')](_0x4d7e47);break;case'Contact':if(_0x1813dd[_0xac62('0x41')]==='$substring'){if(_0x1813dd[_0xac62('0x3b')][_0xac62('0x42')]('\x20')[_0xac62('0x12')]>0x1){_0x57c9fb[_0xac62('0x43')][_0x4205ca](_0xac62('0x34'),qs[_0xac62('0x31')](_0x1813dd[_0xac62('0x3b')],!![]),null);}else{var _0x37496b='%'+_0x1813dd[_0xac62('0x3b')]+'%';_0x57c9fb['contact'][_0x4205ca](_0xac62('0x44'),_0x37496b,_0x37496b,_0x37496b);}}else{_0x50ca1d=_[_0xac62('0x37')](_0xd235c,[_0xac62('0x8'),_0xac62('0x45')]);_0x1813dd[_0xac62('0x7')]=_0xac62('0x45');_0x55356b=as[_0xac62('0x38')](_0x29a9a8,_0x50ca1d[_0xac62('0x46')],_0x1813dd);_0x57c9fb[_0xac62('0x43')][_0x4205ca](_0x55356b['text'],_0x55356b[_0xac62('0x3b')][_0xac62('0x3c')],_0x55356b['value'][_0xac62('0x3d')]);}break;case _0xac62('0x47'):var _0x334f54=_0x1813dd[_0xac62('0x3b')][_0xac62('0x42')](',')[_0xac62('0x48')](function(_0x49afc4){return Number(_0x49afc4);});var _0x2af87f=parseTagParameter(_0x334f54);_0x57c9fb[_0xac62('0x49')][_0xac62('0x4a')][_0xac62('0x40')](_0x2af87f);_0x57c9fb[_0xac62('0x49')][_0xac62('0x4b')]=_0x334f54;break;case'User':if(_0x1813dd[_0xac62('0x41')]===_0xac62('0x4c')){_0x57c9fb[_0xac62('0x4d')][_0x4205ca](_0xac62('0x4e'),'%'+_0x1813dd[_0xac62('0x3b')]+'%',null);}else{_0x50ca1d=_['find'](_0xd235c,[_0xac62('0x8'),'UserId']);_0x1813dd[_0xac62('0x7')]=_0xac62('0x4f');_0x55356b=as[_0xac62('0x38')](_0x29a9a8,_0x50ca1d[_0xac62('0x46')],_0x1813dd);_0x57c9fb[_0xac62('0x4d')][_0x4205ca](_0x55356b[_0xac62('0x3a')],_0x55356b[_0xac62('0x3b')][_0xac62('0x3c')],_0x55356b[_0xac62('0x3b')][_0xac62('0x3d')]);}break;case _0xac62('0x50'):case'plainBody':_0x55356b=as['buildExpression']('me',null,_0x1813dd);_0x57c9fb[_0xac62('0x50')][_0x4205ca](_0x55356b['text'],_0x55356b['value'][_0xac62('0x3c')],_0x55356b['value'][_0xac62('0x3d')]);break;}}}return _0x57c9fb;}function parseModelFields(_0xeaec00,_0x27db3e,_0x50d33d){var _0x3e4182=utils[_0xac62('0x3')](_0xeaec00);var _0x49a9ab=squel[_0xac62('0x1f')]();var _0x489ded=_(_0x27db3e)[_0xac62('0x51')]()[_0xac62('0x48')](function(_0x27d1ed){return _[_0xac62('0x52')](_0x50d33d,[_0xac62('0x8'),_0x27d1ed])?_0x27d1ed:undefined;})[_0xac62('0x53')]()[_0xac62('0x3b')]();if(_0x489ded[_0xac62('0x12')]>0x0){_0x489ded[_0xac62('0x20')](function(_0x3233cd){if(_0x3233cd===_0x3e4182){_0x49a9ab[_0xac62('0x40')]('i.'+_0x3e4182+_0xac62('0x14'),[][_0xac62('0x54')](_0x27db3e[_0x3233cd]));}else if(_0x3233cd===_0xac62('0x55')){var _0x1e1390=JSON[_0xac62('0x56')](_0x27db3e[_0x3233cd])['$gte'];var _0x5597f5=JSON['parse'](_0x27db3e[_0x3233cd])[_0xac62('0x57')];_0x49a9ab[_0xac62('0x40')](_0xac62('0x58'),_0x1e1390,_0x5597f5);}else{if(_0x27db3e[_0x3233cd]==='null'){_0x49a9ab[_0xac62('0x40')]('i.'+_0x3233cd+_0xac62('0x59'));}else{_0x49a9ab['and']('i.'+_0x3233cd+'\x20=\x20?',_0x27db3e[_0x3233cd]);}}});}return _0x49a9ab;}function parseQueryParameters(_0x33c69f,_0x2b2634,_0x352741){var _0x42bbfa=getSqlClauses();return Promise['resolve']()[_0xac62('0x5a')](function(){return parseModelFields(_0x33c69f,_0x2b2634,_0x352741);})['then'](function(_0x16b102){_0x42bbfa[_0xac62('0x5b')][_0xac62('0x40')](_0x16b102);return parseReadParameter(_0x2b2634['read']);})['then'](function(_0x5ad23d){_0x42bbfa[_0xac62('0x3f')][_0xac62('0x40')](_0x5ad23d);return parseTagParameter(_0x2b2634[_0xac62('0x5c')]);})['then'](function(_0x39de56){_0x42bbfa[_0xac62('0x49')][_0xac62('0x4a')][_0xac62('0x40')](_0x39de56);return parseSearchFilter(_0x33c69f,_0x2b2634[_0xac62('0x5d')]);})[_0xac62('0x5a')](function(_0x2a959d){_0x42bbfa['filter']=_0x2a959d;return _0x42bbfa;});}function checkAccountsRestrictions(_0x4ddb46,_0x73011b,_0x51f602){var _0x2507e7=utils[_0xac62('0x3')](_0x4ddb46);var _0x30be83=_0xac62('0x5e')+_[_0xac62('0x5f')](_0x4ddb46)+(_0x4ddb46==='chat'?_0xac62('0x60'):_0xac62('0x61'));var _0x4fabb0=squel['expr']();return Promise[_0xac62('0x62')]()[_0xac62('0x5a')](function(){if(_0x51f602[_0xac62('0x6')]&&_0x73011b['role']==='agent'){return _0x73011b[_0x30be83]({'attributes':['id'],'raw':!![]});}})[_0xac62('0x5a')](function(_0x1d9e82){if(_0x1d9e82){if(_0x1d9e82[_0xac62('0x12')]===0x0){_0x4fabb0[_0xac62('0x40')]('i.'+_0x2507e7+_0xac62('0x59'));}else{_0x4fabb0['and']('i.'+_0x2507e7+_0xac62('0x14'),_[_0xac62('0x48')](_0x1d9e82,'id'));}}else if(!_0x51f602[_0x2507e7]){_0x4fabb0[_0xac62('0x40')]('i.'+_0x2507e7+_0xac62('0x63'));}})['then'](function(){return _0x4fabb0;});}function getClosedOrderClause(_0xd910d6,_0x568d52){var _0x423e67='';var _0x288c26=[_0xac62('0x64'),'i.secondDisposition',_0xac62('0x65')];if(_0xd910d6==='mail'){_0x288c26[_0xac62('0x66')](_0xac62('0x67'));}if(_0x568d52[_0xac62('0x68')]==='0'&&_0xd910d6==='mail'){_0x423e67=_0xac62('0x67');}else{if(_0x568d52[_0xac62('0x68')]==='1'){_0x288c26[_0xac62('0x69')]();}_0x423e67='CONCAT_WS(\x27\x27,\x20'+_0x288c26[_0xac62('0x6a')](',\x20')+')';}return _0x423e67;}function getFilteredInteractions(_0x1feeb8,_0x2217eb,_0x4a22ea,_0x263a1e){var _0x10de20=utils[_0xac62('0x6b')](_0x1feeb8);var _0x5d6618=_['capitalize'](_0x1feeb8)+_0xac62('0x6c');var _0x2066c3=[];var _0x344dde=getTagsQuery();var _0x1eee04={'type':db[_0xac62('0x6d')][_0xac62('0x6e')][_0xac62('0x6f')],'raw':!![]};var _0x4d146e=[];var _0x17a42e=[];return db[_0xac62('0x70')][_0xac62('0x71')](_0x344dde[_0xac62('0x72')](),_0x1eee04)[_0xac62('0x5a')](function(_0x373a58){_0x2066c3=_[_0xac62('0x73')](_0x373a58,'id');_0x1eee04=_[_0xac62('0x74')](_0x1eee04,{'model':db[_0x5d6618],'mapToModel':!![],'nest':!![]});if(_0x4a22ea['fields']){_0x263a1e[_0xac62('0x75')][_0xac62('0x20')](function(_0x352678){_0x2217eb[_0xac62('0x7')]('i.'+_0x352678);});}else{_0x2217eb[_0xac62('0x7')](_0xac62('0x76'),'unreadMessages');_0x2217eb[_0xac62('0x7')](_0xac62('0x77'),'Account.key');_0x2217eb[_0xac62('0x7')](_0xac62('0x78'),_0xac62('0x79'));if(_0x1feeb8===_0xac62('0x2d')){_0x2217eb['field'](_0xac62('0x7a'),'Account.email');_0x2217eb['field'](_0xac62('0x7b'),_0xac62('0x7c'));_0x2217eb[_0xac62('0x7')](_0xac62('0x7d'));_0x2217eb[_0xac62('0x7')](_0xac62('0x7e'));_0x2217eb[_0xac62('0x7')](_0xac62('0x7f'));_0x2217eb[_0xac62('0x7')](_0xac62('0x80'));_0x2217eb['field'](_0xac62('0x81'));_0x2217eb['field'](_0xac62('0x82'));_0x2217eb[_0xac62('0x7')](_0xac62('0x83'));_0x2217eb[_0xac62('0x7')](_0xac62('0x84'));_0x2217eb['field'](_0xac62('0x85'));_0x2217eb[_0xac62('0x7')]('i.disposition');_0x2217eb[_0xac62('0x7')](_0xac62('0x86'));_0x2217eb[_0xac62('0x7')](_0xac62('0x64'));_0x2217eb[_0xac62('0x7')](_0xac62('0x67'));_0x2217eb[_0xac62('0x7')](_0xac62('0x87'));_0x2217eb[_0xac62('0x7')](_0xac62('0x88'));_0x2217eb[_0xac62('0x7')](_0xac62('0x89'));_0x2217eb[_0xac62('0x7')]('i.UserId');}else if(_0x1feeb8===_0xac62('0x2b')){_0x2217eb['field'](_0xac62('0x8a'),_0xac62('0x7c'));}else{_0x2217eb['field'](_0xac62('0x8b'),_0xac62('0x7c'));}if(_0x1feeb8!==_0xac62('0x2d')){_0x2217eb[_0xac62('0x7')]('i.*');}_0x2217eb[_0xac62('0x7')]('c.firstName',_0xac62('0x8c'));_0x2217eb[_0xac62('0x7')](_0xac62('0x8d'),'Contact.lastName');_0x2217eb[_0xac62('0x7')](_0xac62('0x8e'),_0xac62('0x8f'));_0x2217eb['field'](_0xac62('0x90'),'Contact.phone');_0x2217eb[_0xac62('0x7')](_0xac62('0x91'),_0xac62('0x92'));_0x2217eb[_0xac62('0x7')]('c.fax',_0xac62('0x93'));_0x2217eb['field'](_0xac62('0x94'),'Owner.fullname');_0x2217eb[_0xac62('0x7')](_0xac62('0x95'),_0xac62('0x96'));_0x2217eb[_0xac62('0x7')](_0xac62('0x97'),_0xac62('0x98'));}if(_0x263a1e[_0xac62('0x99')]){_0x2217eb[_0xac62('0x99')](_0x263a1e[_0xac62('0x99')]);}if(_0x263a1e[_0xac62('0x9a')]){_0x2217eb[_0xac62('0x9a')](_0x263a1e[_0xac62('0x9a')]);}return db[_0xac62('0x70')]['query'](_0x2217eb['toString'](),_0x1eee04);})['then'](function(_0x2d0282){_0x4d146e=_0x2d0282;var _0x2347be=getUsersQuery(_0x1feeb8,_0x4d146e);return db[_0xac62('0x70')][_0xac62('0x71')](_0x2347be['toString'](),_0x1eee04);})[_0xac62('0x5a')](function(_0x260e17){_0x17a42e=_[_0xac62('0x9b')](_0x260e17,_0x10de20);if(_0x1feeb8==='mail'){return db[_0xac62('0x9c')][_0xac62('0x9d')]({'attributes':[_0xac62('0x9e')],'raw':!![]});}})[_0xac62('0x5a')](function(_0x265b12){var _0x428c2b=_0x265b12?_0x265b12[_0xac62('0x9e')]:undefined;var _0x24cb23=_0x4d146e[_0xac62('0x48')](function(_0x5c8873){return updateInteraction(_0x5c8873,_0x2066c3,_0x17a42e,_0x428c2b);});return Promise[_0xac62('0x9f')](_0x24cb23);});}function countFilteredInteractions(_0x1c9756,_0x531fa0){var _0x2b493d=_0x1c9756[_0xac62('0xa0')]();_0x2b493d[_0xac62('0x7')](_0xac62('0xa1'));_0x2b493d[_0xac62('0x7')](_0xac62('0x76'),_0xac62('0x3e'));var _0x1ad355=utils[_0xac62('0xa2')](_0x531fa0);if(!_[_0xac62('0xa3')](_0x1ad355)){_0x2b493d[_0xac62('0x13')](_0xac62('0xa4'),_0x1ad355);}var _0xe07c9f={'type':db[_0xac62('0x6d')][_0xac62('0x6e')][_0xac62('0x6f')],'raw':!![]};return db[_0xac62('0x70')]['query'](_0x2b493d[_0xac62('0x72')](),_0xe07c9f);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x6044=['i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','TagIds','limit','offset','query','Setting','findOne','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','users','length','map','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','messages','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','fax','i.fax\x20LIKE\x20?','openchannel','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','name','buildExpression','text','value','end','unreadMessages','and','operator','split','contact','ContactId','start','Tag','tags','clause','ids','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','user','body','plainBody','keys','some','compact','\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','resolve','then','read','tag','filter','get','capitalize','chat','Accounts','agent','\x20IS\x20NULL','i.thirdDisposition','i.secondDisposition','mail','unshift','closed','i.substatus','shift','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','toString','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id'];(function(_0x29be3f,_0x3725e6){var _0x5d89c2=function(_0x4fef18){while(--_0x4fef18){_0x29be3f['push'](_0x29be3f['shift']());}};_0x5d89c2(++_0x3725e6);}(_0x6044,0xc5));var _0x4604=function(_0x3b4266,_0x5006f6){_0x3b4266=_0x3b4266-0x0;var _0x3df94c=_0x6044[_0x3b4266];return _0x3df94c;};'use strict';var _=require('lodash');var squel=require(_0x4604('0x0'));var as=require(_0x4604('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x4604('0x2'))[_0x4604('0x3')];var utils=require(_0x4604('0x4'));var db=require(_0x4604('0x5'))['db'];function skipInteractionsQuery(_0x339bcd,_0x4f8d8d,_0x16cb6a){var _0x3c3223=![];var _0x152c4d=utils[_0x4604('0x6')](_0x339bcd);if(_0x4f8d8d[_0x4604('0x7')]==='agent'&&!_0x16cb6a[_0x4604('0x8')]&&!_0x16cb6a[_0x152c4d]){_0x3c3223=!![];}return _0x3c3223;}function getTagsQuery(){return squel[_0x4604('0x9')]()[_0x4604('0xa')]('id')[_0x4604('0xa')]('name')['field'](_0x4604('0xb'))[_0x4604('0xc')](_0x4604('0xd'));}function getUsersQuery(_0x1c4c82,_0x4e4964){var _0x25f5f9=utils[_0x4604('0xe')](_0x1c4c82);var _0x1aed5f='user_has_'+_0x1c4c82+_0x4604('0xf');var _0xd4e1b3=squel[_0x4604('0x9')]()[_0x4604('0xa')](_0x4604('0x10'))[_0x4604('0xa')](_0x4604('0x11'))['field'](_0x4604('0x12')+_0x25f5f9)['from'](_0x1aed5f,'ui')['left_join'](_0x4604('0x13'),'u','u.id\x20=\x20ui.UserId');if(_0x4e4964[_0x4604('0x14')]>0x0){_0xd4e1b3['where']('ui.'+_0x25f5f9+'\x20IN\x20?',_[_0x4604('0x15')](_0x4e4964,'id'));}return _0xd4e1b3;}function getInteractionsQuery(_0x2263ee){var _0x563782=utils['getInteractionsTables'](_0x2263ee);var _0x1e4093=utils['getAccountFK'](_0x2263ee);var _0x496472=utils['getInteractionFK'](_0x2263ee);return squel['select']()[_0x4604('0xc')](_0x563782['interactions'],'i')[_0x4604('0x16')](_0x4604('0x17'),'c',_0x4604('0x18'))['left_join'](_0x4604('0x13'),'o',_0x4604('0x19'))[_0x4604('0x16')](_0x563782[_0x4604('0x1a')],'a','a.id\x20=\x20i.'+_0x1e4093)['left_join'](_0x563782[_0x4604('0x1b')],'me','me.'+_0x496472+_0x4604('0x1c'))[_0x4604('0x16')](_0x563782['interactionsTags'],'it',_0x4604('0x1d')+_0x496472+_0x4604('0x1c'))[_0x4604('0x16')]('tools_tags','t',_0x4604('0x1e'));}function getSqlClauses(){var _0x2d437={'body':squel[_0x4604('0x1f')](),'contact':squel[_0x4604('0x1f')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x4604('0x1f')](),'read':squel[_0x4604('0x1f')](),'tags':{'clause':squel[_0x4604('0x1f')](),'ids':null},'user':squel[_0x4604('0x1f')]()};return _0x2d437;}function parseTagParameter(_0x1b28b4){var _0x6db857=squel['expr']();if(_0x1b28b4){var _0x22e7c0=utils[_0x4604('0x20')](_0x1b28b4);_0x22e7c0[_0x4604('0x21')](function(_0x35ffeb){_0x6db857['or'](_0x4604('0x22'),'%,'+_0x35ffeb+',%');});}return _0x6db857;}function parseReadParameter(_0x4effd1){var _0x1ae3aa='';if(_0x4effd1){_0x1ae3aa=_0x4604('0x23');if(_0x4effd1==='1'){_0x1ae3aa=_0x1ae3aa[_0x4604('0x24')](_0x4604('0x25'),'=');}else{_0x1ae3aa=_0x1ae3aa[_0x4604('0x24')]('{OPERATOR}','>');}}return _0x1ae3aa;}function parseSearchFilter(_0x287c76,_0x3efbed){var _0x930437=squel[_0x4604('0x1f')]();if(_0x3efbed){var _0x474209=_0x3efbed[_0x4604('0x24')]('\x5c','\x5c\x5c')[_0x4604('0x24')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x474209)){_0x930437['or'](_0x4604('0x26'),_0x474209+'%');if([_0x4604('0x27'),_0x4604('0x28')]['includes'](_0x287c76)){_0x930437['or']('i.phone\x20LIKE\x20?',_0x474209+'%');}else if(_0x287c76===_0x4604('0x29')){_0x930437['or'](_0x4604('0x2a'),_0x474209+'%');}else if(_0x287c76===_0x4604('0x2b')){_0x930437['or']('i.from\x20LIKE\x20?',_0x474209+'%');}}else if(_0x287c76==='mail'&&qs[_0x4604('0x2c')](_0x474209)){_0x930437['or']('c.email\x20LIKE\x20?',_0x474209+'%');}else{if(_0x287c76==='mail'){_0x930437['or'](_0x4604('0x2d'),qs[_0x4604('0x2e')](_0x474209,!![]))['or'](_0x4604('0x2f'),qs[_0x4604('0x2e')](_0x474209));}else if(_0x287c76!==_0x4604('0x29')){_0x930437['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4604('0x2e')](_0x474209));}_0x930437['or'](_0x4604('0x30'),qs['getFullTextValue'](_0x474209,!![]),null);}}return _0x930437;}function parseAdvancedSearchFilter(_0x56395b,_0x461b3e){var _0x1570cc=getSqlClauses();var _0x5b0671=as[_0x4604('0x31')](_0x56395b);var _0x169a6e=_0x5b0671[_0x4604('0x32')];for(var _0x23d20=0x0;_0x23d20<_0x5b0671[_0x4604('0x33')][_0x4604('0x14')];_0x23d20++){var _0x11fd2d=_0x5b0671[_0x4604('0x33')][_0x23d20];var _0xa973f7='i';var _0x10578a=_[_0x4604('0x34')](_0x461b3e,[_0x4604('0x35'),_0x11fd2d[_0x4604('0xa')]]);if(_0x10578a){var _0x3c5692=as[_0x4604('0x36')](_0xa973f7,_0x10578a['type'],_0x11fd2d);_0x1570cc['default'][_0x169a6e](_0x3c5692[_0x4604('0x37')],_0x3c5692[_0x4604('0x38')]['start'],_0x3c5692[_0x4604('0x38')][_0x4604('0x39')]);}else{switch(_0x11fd2d[_0x4604('0xa')]){case _0x4604('0x3a'):var _0x5e4b16=parseReadParameter(_0x11fd2d[_0x4604('0x38')]);_0x1570cc['read'][_0x4604('0x3b')](_0x5e4b16);break;case'Contact':if(_0x11fd2d[_0x4604('0x3c')]==='$substring'){if(_0x11fd2d['value'][_0x4604('0x3d')]('\x20')[_0x4604('0x14')]>0x1){_0x1570cc[_0x4604('0x3e')][_0x169a6e](_0x4604('0x30'),qs[_0x4604('0x2e')](_0x11fd2d[_0x4604('0x38')],!![]),null);}else{var _0x293993='%'+_0x11fd2d['value']+'%';_0x1570cc['contact'][_0x169a6e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x293993,_0x293993,_0x293993);}}else{_0x10578a=_[_0x4604('0x34')](_0x461b3e,[_0x4604('0x35'),_0x4604('0x3f')]);_0x11fd2d[_0x4604('0xa')]=_0x4604('0x3f');_0x3c5692=as[_0x4604('0x36')](_0xa973f7,_0x10578a['type'],_0x11fd2d);_0x1570cc[_0x4604('0x3e')][_0x169a6e](_0x3c5692['text'],_0x3c5692[_0x4604('0x38')][_0x4604('0x40')],_0x3c5692['value'][_0x4604('0x39')]);}break;case _0x4604('0x41'):var _0x3cb23e=_0x11fd2d['value'][_0x4604('0x3d')](',')[_0x4604('0x15')](function(_0xacd73b){return Number(_0xacd73b);});var _0x517ebd=parseTagParameter(_0x3cb23e);_0x1570cc[_0x4604('0x42')][_0x4604('0x43')][_0x4604('0x3b')](_0x517ebd);_0x1570cc[_0x4604('0x42')][_0x4604('0x44')]=_0x3cb23e;break;case'User':if(_0x11fd2d[_0x4604('0x3c')]===_0x4604('0x45')){_0x1570cc['user'][_0x169a6e](_0x4604('0x46'),'%'+_0x11fd2d[_0x4604('0x38')]+'%',null);}else{_0x10578a=_[_0x4604('0x34')](_0x461b3e,[_0x4604('0x35'),_0x4604('0x47')]);_0x11fd2d[_0x4604('0xa')]=_0x4604('0x47');_0x3c5692=as[_0x4604('0x36')](_0xa973f7,_0x10578a[_0x4604('0x48')],_0x11fd2d);_0x1570cc[_0x4604('0x49')][_0x169a6e](_0x3c5692[_0x4604('0x37')],_0x3c5692[_0x4604('0x38')][_0x4604('0x40')],_0x3c5692['value'][_0x4604('0x39')]);}break;case _0x4604('0x4a'):case _0x4604('0x4b'):_0x3c5692=as[_0x4604('0x36')]('me',null,_0x11fd2d);_0x1570cc[_0x4604('0x4a')][_0x169a6e](_0x3c5692[_0x4604('0x37')],_0x3c5692[_0x4604('0x38')][_0x4604('0x40')],_0x3c5692[_0x4604('0x38')]['end']);break;}}}return _0x1570cc;}function parseModelFields(_0x2d75b7,_0x20de30,_0x36e816){var _0x34da35=utils[_0x4604('0x6')](_0x2d75b7);var _0x1cc930=squel[_0x4604('0x1f')]();var _0x301f9a=_(_0x20de30)[_0x4604('0x4c')]()[_0x4604('0x15')](function(_0x44d95c){return _[_0x4604('0x4d')](_0x36e816,[_0x4604('0x35'),_0x44d95c])?_0x44d95c:undefined;})[_0x4604('0x4e')]()[_0x4604('0x38')]();if(_0x301f9a[_0x4604('0x14')]>0x0){_0x301f9a[_0x4604('0x21')](function(_0x376f18){if(_0x376f18===_0x34da35){_0x1cc930['and']('i.'+_0x34da35+_0x4604('0x4f'),[][_0x4604('0x50')](_0x20de30[_0x376f18]));}else if(_0x376f18===_0x4604('0x51')){var _0x43bea5=JSON['parse'](_0x20de30[_0x376f18])['$gte'];var _0x5cdc51=JSON['parse'](_0x20de30[_0x376f18])[_0x4604('0x52')];_0x1cc930['and'](_0x4604('0x53'),_0x43bea5,_0x5cdc51);}else{if(_0x20de30[_0x376f18]==='null'){_0x1cc930[_0x4604('0x3b')]('i.'+_0x376f18+'\x20IS\x20NULL');}else{_0x1cc930['and']('i.'+_0x376f18+_0x4604('0x54'),_0x20de30[_0x376f18]);}}});}return _0x1cc930;}function parseQueryParameters(_0x3b67f7,_0x47eefc,_0x3e5ca4){var _0x597cf0=getSqlClauses();return Promise[_0x4604('0x55')]()[_0x4604('0x56')](function(){return parseModelFields(_0x3b67f7,_0x47eefc,_0x3e5ca4);})[_0x4604('0x56')](function(_0x1ac669){_0x597cf0['fields'][_0x4604('0x3b')](_0x1ac669);return parseReadParameter(_0x47eefc[_0x4604('0x57')]);})['then'](function(_0x25152d){_0x597cf0[_0x4604('0x57')][_0x4604('0x3b')](_0x25152d);return parseTagParameter(_0x47eefc[_0x4604('0x58')]);})[_0x4604('0x56')](function(_0x2cc7fe){_0x597cf0[_0x4604('0x42')][_0x4604('0x43')][_0x4604('0x3b')](_0x2cc7fe);return parseSearchFilter(_0x3b67f7,_0x47eefc['filter']);})[_0x4604('0x56')](function(_0x4f118e){_0x597cf0[_0x4604('0x59')]=_0x4f118e;return _0x597cf0;});}function checkAccountsRestrictions(_0x13426c,_0x109ba0,_0x168e06){var _0x1392ec=utils['getAccountFK'](_0x13426c);var _0x4ef868=_0x4604('0x5a')+_[_0x4604('0x5b')](_0x13426c)+(_0x13426c===_0x4604('0x5c')?'Websites':_0x4604('0x5d'));var _0x56ceaa=squel[_0x4604('0x1f')]();return Promise[_0x4604('0x55')]()[_0x4604('0x56')](function(){if(_0x168e06[_0x4604('0x8')]&&_0x109ba0['role']===_0x4604('0x5e')){return _0x109ba0[_0x4ef868]({'attributes':['id'],'raw':!![]});}})[_0x4604('0x56')](function(_0x28f85f){if(_0x28f85f){if(_0x28f85f['length']===0x0){_0x56ceaa[_0x4604('0x3b')]('i.'+_0x1392ec+_0x4604('0x5f'));}else{_0x56ceaa[_0x4604('0x3b')]('i.'+_0x1392ec+_0x4604('0x4f'),_[_0x4604('0x15')](_0x28f85f,'id'));}}else if(!_0x168e06[_0x1392ec]){_0x56ceaa['and']('i.'+_0x1392ec+'\x20IS\x20NOT\x20NULL');}})[_0x4604('0x56')](function(){return _0x56ceaa;});}function getClosedOrderClause(_0x171046,_0x10a5fa){var _0x4fb45d='';var _0x59d749=[_0x4604('0x60'),_0x4604('0x61'),'i.disposition'];if(_0x171046===_0x4604('0x62')){_0x59d749[_0x4604('0x63')]('i.substatus');}if(_0x10a5fa[_0x4604('0x64')]==='0'&&_0x171046===_0x4604('0x62')){_0x4fb45d=_0x4604('0x65');}else{if(_0x10a5fa['closed']==='1'){_0x59d749[_0x4604('0x66')]();}_0x4fb45d='CONCAT_WS(\x27\x27,\x20'+_0x59d749[_0x4604('0x67')](',\x20')+')';}return _0x4fb45d;}function getFilteredInteractions(_0x438172,_0x568bba,_0x42b2ca,_0x238edb){var _0x3145fd=utils[_0x4604('0xe')](_0x438172);var _0x1e5303=_[_0x4604('0x5b')](_0x438172)+_0x4604('0x68');var _0x148adf=[];var _0x456361=getTagsQuery();var _0x1dd4f4={'type':db[_0x4604('0x69')][_0x4604('0x6a')][_0x4604('0x6b')],'raw':!![]};var _0x2f7e61=[];var _0x4b551d=[];return db[_0x4604('0x6c')]['query'](_0x456361[_0x4604('0x6d')](),_0x1dd4f4)[_0x4604('0x56')](function(_0x5914be){_0x148adf=_['keyBy'](_0x5914be,'id');_0x1dd4f4=_[_0x4604('0x6e')](_0x1dd4f4,{'model':db[_0x1e5303],'mapToModel':!![],'nest':!![]});if(_0x42b2ca[_0x4604('0x6f')]){_0x238edb[_0x4604('0x70')][_0x4604('0x21')](function(_0x47dd53){_0x568bba[_0x4604('0xa')]('i.'+_0x47dd53);});}else{_0x568bba[_0x4604('0xa')](_0x4604('0x71'),_0x4604('0x3a'));_0x568bba[_0x4604('0xa')]('a.key',_0x4604('0x72'));_0x568bba[_0x4604('0xa')](_0x4604('0x73'),_0x4604('0x74'));if(_0x438172===_0x4604('0x62')){_0x568bba[_0x4604('0xa')](_0x4604('0x75'),'Account.email');_0x568bba['field'](_0x4604('0x76'),_0x4604('0x77'));_0x568bba[_0x4604('0xa')](_0x4604('0x78'));_0x568bba[_0x4604('0xa')]('i.createdAt');_0x568bba[_0x4604('0xa')](_0x4604('0x79'));_0x568bba[_0x4604('0xa')](_0x4604('0x7a'));_0x568bba[_0x4604('0xa')](_0x4604('0x7b'));_0x568bba['field'](_0x4604('0x7c'));_0x568bba['field'](_0x4604('0x7d'));_0x568bba['field'](_0x4604('0x7e'));_0x568bba[_0x4604('0xa')](_0x4604('0x7f'));_0x568bba[_0x4604('0xa')]('i.disposition');_0x568bba[_0x4604('0xa')]('i.secondDisposition');_0x568bba[_0x4604('0xa')]('i.thirdDisposition');_0x568bba[_0x4604('0xa')]('i.substatus');_0x568bba['field'](_0x4604('0x80'));_0x568bba[_0x4604('0xa')](_0x4604('0x81'));_0x568bba['field']('i.MailAccountId');_0x568bba[_0x4604('0xa')](_0x4604('0x82'));}else if(_0x438172===_0x4604('0x2b')){_0x568bba[_0x4604('0xa')](_0x4604('0x83'),'contactName');}else{_0x568bba[_0x4604('0xa')](_0x4604('0x84'),_0x4604('0x77'));}if(_0x438172!==_0x4604('0x62')){_0x568bba['field'](_0x4604('0x85'));}_0x568bba[_0x4604('0xa')](_0x4604('0x86'),_0x4604('0x87'));_0x568bba[_0x4604('0xa')](_0x4604('0x88'),_0x4604('0x89'));_0x568bba['field'](_0x4604('0x8a'),_0x4604('0x8b'));_0x568bba[_0x4604('0xa')](_0x4604('0x8c'),_0x4604('0x8d'));_0x568bba['field'](_0x4604('0x8e'),_0x4604('0x8f'));_0x568bba[_0x4604('0xa')]('c.fax','Contact.fax');_0x568bba[_0x4604('0xa')](_0x4604('0x90'),_0x4604('0x91'));_0x568bba[_0x4604('0xa')](_0x4604('0x92'),'Owner.internal');_0x568bba[_0x4604('0xa')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4604('0x93'));}if(_0x238edb[_0x4604('0x94')]){_0x568bba[_0x4604('0x94')](_0x238edb['limit']);}if(_0x238edb[_0x4604('0x95')]){_0x568bba['offset'](_0x238edb[_0x4604('0x95')]);}return db[_0x4604('0x6c')][_0x4604('0x96')](_0x568bba['toString'](),_0x1dd4f4);})['then'](function(_0x525f94){_0x2f7e61=_0x525f94;var _0x9e91da=getUsersQuery(_0x438172,_0x2f7e61);return db[_0x4604('0x6c')][_0x4604('0x96')](_0x9e91da[_0x4604('0x6d')](),_0x1dd4f4);})[_0x4604('0x56')](function(_0x175c2d){_0x4b551d=_['groupBy'](_0x175c2d,_0x3145fd);if(_0x438172===_0x4604('0x62')){return db[_0x4604('0x97')][_0x4604('0x98')]({'attributes':[_0x4604('0x99')],'raw':!![]});}})['then'](function(_0x116623){var _0x258858=_0x116623?_0x116623[_0x4604('0x99')]:undefined;var _0x460833=_0x2f7e61[_0x4604('0x15')](function(_0x5d8679){return updateInteraction(_0x5d8679,_0x148adf,_0x4b551d,_0x258858);});return Promise[_0x4604('0x9a')](_0x460833);});}function countFilteredInteractions(_0x576b67,_0x52c0d1){var _0x43e35c=_0x576b67[_0x4604('0x9b')]();_0x43e35c[_0x4604('0xa')]('COUNT(*)');_0x43e35c[_0x4604('0xa')](_0x4604('0x71'),_0x4604('0x3a'));var _0x544b9d=utils[_0x4604('0x20')](_0x52c0d1);if(!_[_0x4604('0x9c')](_0x544b9d)){_0x43e35c['where'](_0x4604('0x9d'),_0x544b9d);}var _0x39c9e8={'type':db['Sequelize'][_0x4604('0x6a')][_0x4604('0x6b')],'raw':!![]};return db['sequelize']['query'](_0x43e35c['toString'](),_0x39c9e8);}module[_0x4604('0x9e')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 17b8e88..3c2197d 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a0d=['-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','../../mysqldb','map','fullname','forEach','push','waiting','answered','unmanaged','total','closed','disposition','abandoned','UserId','talking','MailMessage','out','plainBody'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x0a0d,0x198));var _0xd0a0=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0x0a0d[_0x198247];return _0x2b18bc;};'use strict';var _=require('lodash');var db=require(_0xd0a0('0x0'))['db'];function getInteractionUsers(_0x2c861e,_0x383bb8){return new Promise(function(_0x7f6887,_0x4c1503){try{var _0x537165=[];if(_0x383bb8[_0x2c861e]){_0x537165=_0x383bb8[_0x2c861e][_0xd0a0('0x1')](function(_0x115106){return{'id':_0x115106['id'],'fullname':_0x115106[_0xd0a0('0x2')]};});}return _0x7f6887(_0x537165);}catch(_0x5713bd){_0x4c1503(_0x5713bd);}});}function getInteractionTags(_0x3d36f6,_0x30f562){var _0x99f815=[];if(_0x3d36f6){_0x3d36f6['split'](',')[_0xd0a0('0x3')](function(_0x1883df){_0x99f815[_0xd0a0('0x4')](_0x30f562[_0x1883df]);});}return _0x99f815;}function updateWaitingCounter(_0x4e2858){if(_0x4e2858['waiting']){_0x4e2858[_0xd0a0('0x5')]-=0x1;}}function updateInteractionCounters(_0x40d3ae){_0x40d3ae['waiting']=0x0;_0x40d3ae['talking']=0x0;_0x40d3ae[_0xd0a0('0x6')]=0x0;_0x40d3ae[_0xd0a0('0x7')]=0x0;_0x40d3ae['abandoned']=0x0;_0x40d3ae[_0xd0a0('0x8')]=0x0;if(_0x40d3ae[_0xd0a0('0x9')]){if(_0x40d3ae[_0xd0a0('0xa')]===_0xd0a0('0xb')){_0x40d3ae[_0xd0a0('0xb')]+=0x1;updateWaitingCounter(_0x40d3ae);}if(_0x40d3ae[_0xd0a0('0xc')]){_0x40d3ae['answered']+=0x1;if(_0x40d3ae[_0xd0a0('0xd')]){_0x40d3ae[_0xd0a0('0xd')]-=0x1;}}else{if(_0x40d3ae[_0xd0a0('0xa')]){_0x40d3ae['unmanaged']+=0x1;updateWaitingCounter(_0x40d3ae);}}}else{if(!_0x40d3ae[_0xd0a0('0xc')]){_0x40d3ae[_0xd0a0('0x5')]+=0x1;}if(_0x40d3ae[_0xd0a0('0xc')]){_0x40d3ae[_0xd0a0('0xd')]+=0x1;updateWaitingCounter(_0x40d3ae);}}_0x40d3ae[_0xd0a0('0x8')]+=0x1;return _0x40d3ae;}function getLastMessageText(_0x1fba90){return db[_0xd0a0('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1fba90['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd0a0('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd0a0('0x10')],'order':_0xd0a0('0x11'),'raw':!![]})[_0xd0a0('0x12')](function(_0x6269c3){if(_0x6269c3&&_0x6269c3[_0xd0a0('0x10')]){_0x1fba90[_0xd0a0('0x13')]=_[_0xd0a0('0x14')](_0x6269c3[_0xd0a0('0x10')]);}return _0x1fba90;})[_0xd0a0('0x15')](function(_0x3ab1b8){throw _0x3ab1b8;});}exports[_0xd0a0('0x16')]=function(_0x28d88c,_0x37e18a,_0x526059,_0xfcae2a){return new Promise(function(_0x4c4f2e,_0x4d3bd7){return getInteractionUsers(_0x28d88c['id'],_0x526059)[_0xd0a0('0x12')](function(_0x172340){_0x28d88c[_0xd0a0('0x17')]=_0x172340;return getInteractionTags(_0x28d88c[_0xd0a0('0x18')],_0x37e18a);})[_0xd0a0('0x12')](function(_0x51b38f){_0x28d88c['Tags']=_0x51b38f;delete _0x28d88c[_0xd0a0('0x18')];return updateInteractionCounters(_0x28d88c);})[_0xd0a0('0x12')](function(_0x3bdb20){if(_0xfcae2a){return getLastMessageText(_0x3bdb20);}else{return _0x3bdb20;}})['then'](function(_0x167fcd){_0x4c4f2e(_0x167fcd);})['catch'](function(_0x5633ea){_0x4d3bd7(_0x5633ea);});});}; \ No newline at end of file +var _0xc83b=['trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','total','closed','abandoned','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then'];(function(_0x4f2df5,_0x182771){var _0x75e1b9=function(_0x38a649){while(--_0x38a649){_0x4f2df5['push'](_0x4f2df5['shift']());}};_0x75e1b9(++_0x182771);}(_0xc83b,0x12e));var _0xbc83=function(_0x29d9bf,_0x37d4b1){_0x29d9bf=_0x29d9bf-0x0;var _0x22ed7b=_0xc83b[_0x29d9bf];return _0x22ed7b;};'use strict';var _=require(_0xbc83('0x0'));var db=require(_0xbc83('0x1'))['db'];function getInteractionUsers(_0x36143c,_0x5f16fe){return new Promise(function(_0x5a348c,_0x5848ff){try{var _0x24e51f=[];if(_0x5f16fe[_0x36143c]){_0x24e51f=_0x5f16fe[_0x36143c][_0xbc83('0x2')](function(_0x106c63){return{'id':_0x106c63['id'],'fullname':_0x106c63[_0xbc83('0x3')]};});}return _0x5a348c(_0x24e51f);}catch(_0x31f52a){_0x5848ff(_0x31f52a);}});}function getInteractionTags(_0x121205,_0x62e6ae){var _0x19374a=[];if(_0x121205){_0x121205[_0xbc83('0x4')](',')[_0xbc83('0x5')](function(_0x7a1803){_0x19374a[_0xbc83('0x6')](_0x62e6ae[_0x7a1803]);});}return _0x19374a;}function updateWaitingCounter(_0x429832){if(_0x429832[_0xbc83('0x7')]){_0x429832[_0xbc83('0x7')]-=0x1;}}function updateInteractionCounters(_0x2024ee){_0x2024ee[_0xbc83('0x7')]=0x0;_0x2024ee[_0xbc83('0x8')]=0x0;_0x2024ee[_0xbc83('0x9')]=0x0;_0x2024ee[_0xbc83('0xa')]=0x0;_0x2024ee['abandoned']=0x0;_0x2024ee[_0xbc83('0xb')]=0x0;if(_0x2024ee[_0xbc83('0xc')]){if(_0x2024ee['disposition']===_0xbc83('0xd')){_0x2024ee[_0xbc83('0xd')]+=0x1;updateWaitingCounter(_0x2024ee);}if(_0x2024ee['UserId']){_0x2024ee[_0xbc83('0x9')]+=0x1;if(_0x2024ee[_0xbc83('0x8')]){_0x2024ee[_0xbc83('0x8')]-=0x1;}}else{if(_0x2024ee[_0xbc83('0xe')]){_0x2024ee['unmanaged']+=0x1;updateWaitingCounter(_0x2024ee);}}}else{if(!_0x2024ee['UserId']){_0x2024ee['waiting']+=0x1;}if(_0x2024ee[_0xbc83('0xf')]){_0x2024ee['talking']+=0x1;updateWaitingCounter(_0x2024ee);}}_0x2024ee['total']+=0x1;return _0x2024ee;}function getLastMessageText(_0x5780ca){return db[_0xbc83('0x10')][_0xbc83('0x11')]({'where':{'$and':[{'MailInteractionId':_0x5780ca['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbc83('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbc83('0x13')],'order':_0xbc83('0x14'),'raw':!![]})[_0xbc83('0x15')](function(_0x1a8fc3){if(_0x1a8fc3&&_0x1a8fc3['plainBody']){_0x5780ca['lastMsgText']=_[_0xbc83('0x16')](_0x1a8fc3[_0xbc83('0x13')]);}return _0x5780ca;})[_0xbc83('0x17')](function(_0x4a1bb2){throw _0x4a1bb2;});}exports[_0xbc83('0x18')]=function(_0x5af239,_0x373806,_0x273686,_0x6f21df){return new Promise(function(_0x4d3fa2,_0x215f09){return getInteractionUsers(_0x5af239['id'],_0x273686)[_0xbc83('0x15')](function(_0x2c14a2){_0x5af239['Users']=_0x2c14a2;return getInteractionTags(_0x5af239[_0xbc83('0x19')],_0x373806);})[_0xbc83('0x15')](function(_0xa4f57){_0x5af239[_0xbc83('0x1a')]=_0xa4f57;delete _0x5af239[_0xbc83('0x19')];return updateInteractionCounters(_0x5af239);})[_0xbc83('0x15')](function(_0x428bf3){if(_0x6f21df){return getLastMessageText(_0x428bf3);}else{return _0x428bf3;}})[_0xbc83('0x15')](function(_0x2eb531){_0x4d3fa2(_0x2eb531);})[_0xbc83('0x17')](function(_0x1ea01f){_0x215f09(_0x1ea01f);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 227f302..d4cf343 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc809=['unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','isArray','toLowerCase','toUpperCase','name','null','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','chat','Website','Account','capitalize','InteractionId','upperFirst'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xc809,0x15d));var _0x9c80=function(_0x3c1f8e,_0x373bba){_0x3c1f8e=_0x3c1f8e-0x0;var _0x3b6926=_0xc809[_0x3c1f8e];return _0x3b6926;};'use strict';var _=require(_0x9c80('0x0'));var db=require(_0x9c80('0x1'))['db'];var loggers={'openchannel':require(_0x9c80('0x2'))(_0x9c80('0x3')),'mail':require(_0x9c80('0x2'))(_0x9c80('0x4')),'fax':require(_0x9c80('0x2'))('fax-interactions'),'sms':require(_0x9c80('0x2'))(_0x9c80('0x5')),'chat':require(_0x9c80('0x2'))(_0x9c80('0x6')),'whatsapp':require('../../config/logger')(_0x9c80('0x7'))};function getAccountFK(_0x47fb26){return _['capitalize'](_0x47fb26)+(_0x47fb26===_0x9c80('0x8')?_0x9c80('0x9'):_0x9c80('0xa'))+'Id';}function getInteractionFK(_0xf594ee){return _[_0x9c80('0xb')](_0xf594ee)+_0x9c80('0xc');}function getInteractionId(_0x1b1f8d,_0x369a27,_0x4dd706){if(_0x1b1f8d&&_0x1b1f8d[_[_0x9c80('0xd')](_0x4dd706)+_0x9c80('0xc')]){return _0x1b1f8d[_[_0x9c80('0xd')](_0x4dd706)+_0x9c80('0xc')];}else if(_0x1b1f8d&&_0x1b1f8d['id']){return _0x1b1f8d['id'];}else if(_0x369a27&&_0x369a27['id']){return _0x369a27['id'];}else{return _0x9c80('0xe');}}function getInteractionsTables(_0x570a0e){return{'accounts':_0x570a0e+'_'+(_0x570a0e===_0x9c80('0x8')?_0x9c80('0xf'):_0x9c80('0x10')),'interactions':_0x570a0e+_0x9c80('0x11'),'interactionsTags':_0x570a0e+_0x9c80('0x12'),'messages':_0x570a0e+_0x9c80('0x13'),'userInteractions':'user_has_'+_0x570a0e+_0x9c80('0x11')};}function getSelectedTags(_0x57ad61){var _0x2bf72a=[];if(_0x57ad61){_0x2bf72a=Array[_0x9c80('0x14')](_0x57ad61)?_0x57ad61:[_0x57ad61];}return _0x2bf72a;}function log(_0x49f3f5,_0x33be3f,_0x960840,_0x334b85,_0x15af7f,_0x20fd82){loggers[_0x15af7f[_0x9c80('0x15')]()][_0x49f3f5]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x20fd82[_0x9c80('0x16')](),_0x33be3f?_0x33be3f['id']:null,_0x33be3f?_0x33be3f[_0x9c80('0x17')]:null,_0x33be3f?_0x33be3f['role']:null,getInteractionId(_0x960840,_0x334b85,_0x15af7f),_0x960840?JSON['stringify'](_0x960840):_0x9c80('0x18'));}function updateUser(_0x35d6ab,_0x127455,_0x47aa5d,_0x530cc6,_0x4c2e48){db[_['upperFirst'](_0x530cc6)+_0x9c80('0x19')][_0x9c80('0x1a')]({'where':{'id':getInteractionId(_0x127455,_0x47aa5d,_0x530cc6)}})[_0x9c80('0x1b')](function(_0x3fbc73){if(_0x3fbc73){return _0x3fbc73[_0x9c80('0x1c')]({'UserId':_0x35d6ab?_0x35d6ab['id']:null});}})[_0x9c80('0x1b')](function(_0x14e47d){if(_0x14e47d){log(_0x9c80('0x1d'),_0x35d6ab,_0x127455,_0x47aa5d,_0x530cc6,_0x4c2e48);}})[_0x9c80('0x1e')](function(){log(_0x9c80('0x1f'),_0x35d6ab,_0x127455,_0x47aa5d,_0x530cc6,_0x4c2e48);});}module[_0x9c80('0x20')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x7cd0=['then','info','error','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','findOne'];(function(_0x582e16,_0x479342){var _0x5d73d7=function(_0x24bcbb){while(--_0x24bcbb){_0x582e16['push'](_0x582e16['shift']());}};_0x5d73d7(++_0x479342);}(_0x7cd0,0xc7));var _0x07cd=function(_0xa72345,_0x1fd304){_0xa72345=_0xa72345-0x0;var _0xbc82fb=_0x7cd0[_0xa72345];return _0xbc82fb;};'use strict';var _=require('lodash');var db=require(_0x07cd('0x0'))['db'];var loggers={'openchannel':require(_0x07cd('0x1'))(_0x07cd('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x07cd('0x1'))(_0x07cd('0x3')),'sms':require(_0x07cd('0x1'))('sms-interactions'),'chat':require(_0x07cd('0x1'))(_0x07cd('0x4')),'whatsapp':require(_0x07cd('0x1'))(_0x07cd('0x5'))};function getAccountFK(_0x3a08ff){return _[_0x07cd('0x6')](_0x3a08ff)+(_0x3a08ff===_0x07cd('0x7')?_0x07cd('0x8'):_0x07cd('0x9'))+'Id';}function getInteractionFK(_0x320168){return _['capitalize'](_0x320168)+_0x07cd('0xa');}function getInteractionId(_0xab9fc4,_0x357d0a,_0x3f8002){if(_0xab9fc4&&_0xab9fc4[_[_0x07cd('0xb')](_0x3f8002)+_0x07cd('0xa')]){return _0xab9fc4[_[_0x07cd('0xb')](_0x3f8002)+_0x07cd('0xa')];}else if(_0xab9fc4&&_0xab9fc4['id']){return _0xab9fc4['id'];}else if(_0x357d0a&&_0x357d0a['id']){return _0x357d0a['id'];}else{return _0x07cd('0xc');}}function getInteractionsTables(_0x2fc758){return{'accounts':_0x2fc758+'_'+(_0x2fc758===_0x07cd('0x7')?_0x07cd('0xd'):_0x07cd('0xe')),'interactions':_0x2fc758+_0x07cd('0xf'),'interactionsTags':_0x2fc758+'_interaction_has_tags','messages':_0x2fc758+_0x07cd('0x10'),'userInteractions':'user_has_'+_0x2fc758+'_interactions'};}function getSelectedTags(_0x3a9afa){var _0xfb2b1e=[];if(_0x3a9afa){_0xfb2b1e=Array[_0x07cd('0x11')](_0x3a9afa)?_0x3a9afa:[_0x3a9afa];}return _0xfb2b1e;}function log(_0x1b3dc1,_0x333b1d,_0x5bd91c,_0x59cb6a,_0x1ae91c,_0x46e382){loggers[_0x1ae91c[_0x07cd('0x12')]()][_0x1b3dc1](_0x07cd('0x13'),_0x46e382[_0x07cd('0x14')](),_0x333b1d?_0x333b1d['id']:null,_0x333b1d?_0x333b1d[_0x07cd('0x15')]:null,_0x333b1d?_0x333b1d[_0x07cd('0x16')]:null,getInteractionId(_0x5bd91c,_0x59cb6a,_0x1ae91c),_0x5bd91c?JSON['stringify'](_0x5bd91c):_0x07cd('0x17'));}function updateUser(_0x11d8d0,_0x407f0b,_0xf77449,_0x410dca,_0x55bdf9){db[_[_0x07cd('0xb')](_0x410dca)+'Interaction'][_0x07cd('0x18')]({'where':{'id':getInteractionId(_0x407f0b,_0xf77449,_0x410dca)}})[_0x07cd('0x19')](function(_0x408b1c){if(_0x408b1c){return _0x408b1c['update']({'UserId':_0x11d8d0?_0x11d8d0['id']:null});}})['then'](function(_0x36737e){if(_0x36737e){log(_0x07cd('0x1a'),_0x11d8d0,_0x407f0b,_0xf77449,_0x410dca,_0x55bdf9);}})['catch'](function(){log(_0x07cd('0x1b'),_0x11d8d0,_0x407f0b,_0xf77449,_0x410dca,_0x55bdf9);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 22dac11..9df46c3 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 _0x6d26=['license','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','json','catch','users','User','user','isUserLimit','util','../../mysqldb','../../config/environment','data1'];(function(_0x297b3d,_0x527cc2){var _0x3b81a8=function(_0x118980){while(--_0x118980){_0x297b3d['push'](_0x297b3d['shift']());}};_0x3b81a8(++_0x527cc2);}(_0x6d26,0x92));var _0x66d2=function(_0x117cb5,_0x4b0da3){_0x117cb5=_0x117cb5-0x0;var _0x17e4e8=_0x6d26[_0x117cb5];return _0x17e4e8;};'use strict';var crypto=require('crypto');var util=require(_0x66d2('0x0'));var compose=require('composable-middleware');var db=require(_0x66d2('0x1'))['db'];var config=require(_0x66d2('0x2'));function getValueFromLicense(_0x51e7bf,_0x51cd02){if(_0x51e7bf&&_0x51cd02){if(_0x51cd02[_0x66d2('0x3')]&&_0x51cd02[_0x66d2('0x4')]){var _0xdb647e=_0x51cd02[_0x66d2('0x3')];var _0x1355ba=_0x51cd02[_0x66d2('0x4')];var _0x4d6bb9=_0xdb647e['split']('-')[0x4];var _0x26b01f=_0xdb647e['split']('-')[0x0];var _0x51021b=crypto[_0x66d2('0x5')](_0x66d2('0x6'),util[_0x66d2('0x7')](_0x66d2('0x8'),_0x4d6bb9,_0xdb647e,_0x26b01f));var _0x54303d=_0x51021b[_0x66d2('0x9')](_0x1355ba,'base64',_0x66d2('0xa'));_0x54303d+=_0x51021b[_0x66d2('0xb')](_0x66d2('0xa'));var _0x40556b=JSON[_0x66d2('0xc')](_0x54303d);return _0x40556b[_0x66d2('0xd')](_0x51e7bf)?_0x40556b[_0x51e7bf]:null;}}return null;}function isLimit(_0x1dbade,_0x3bac3b,_0x5d6b2e,_0x3af65c){var _0x367d9c=_0x3bac3b;return compose()[_0x66d2('0xe')](function(_0x300c77,_0x21cc0b,_0x8ddae0){return db[_0x66d2('0xf')][_0x66d2('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x66d2('0x11')](function(_0x3caa1a){var _0xcc8ff4=getValueFromLicense(_0x1dbade,_0x3caa1a);return _0xcc8ff4?_0xcc8ff4:_0x367d9c;})[_0x66d2('0x11')](function(_0x2e687f){_0x367d9c=_0x2e687f;return _0x5d6b2e[_0x66d2('0x12')](_0x3af65c);})[_0x66d2('0x11')](function(_0xfd1576){if(_0xfd1576>=_0x367d9c){return _0x21cc0b['status'](0x193)[_0x66d2('0x13')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1dbade)});}_0x8ddae0();})[_0x66d2('0x14')](function(_0x167a76){_0x8ddae0(_0x167a76);});});}function isUserLimit(){return isLimit(_0x66d2('0x15'),0x1,db[_0x66d2('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x66d2('0x17')}]}});}exports[_0x66d2('0x18')]=isUserLimit; \ No newline at end of file +var _0xeb36=['parse','hasOwnProperty','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','split','aes-256-ctr','format','update','base64','utf8'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeb36,0x1d0));var _0x6eb3=function(_0x1b3656,_0x3d1e4c){_0x1b3656=_0x1b3656-0x0;var _0x570576=_0xeb36[_0x1b3656];return _0x570576;};'use strict';var crypto=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var compose=require(_0x6eb3('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x6eb3('0x3'));function getValueFromLicense(_0x28a2e7,_0x31de2c){if(_0x28a2e7&&_0x31de2c){if(_0x31de2c[_0x6eb3('0x4')]&&_0x31de2c['license']){var _0x2d93d0=_0x31de2c[_0x6eb3('0x4')];var _0x470ca1=_0x31de2c['license'];var _0x4584be=_0x2d93d0[_0x6eb3('0x5')]('-')[0x4];var _0x118e14=_0x2d93d0[_0x6eb3('0x5')]('-')[0x0];var _0x55d7fa=crypto['createDecipher'](_0x6eb3('0x6'),util[_0x6eb3('0x7')]('%s:%s:%s',_0x4584be,_0x2d93d0,_0x118e14));var _0x12036f=_0x55d7fa[_0x6eb3('0x8')](_0x470ca1,_0x6eb3('0x9'),_0x6eb3('0xa'));_0x12036f+=_0x55d7fa['final'](_0x6eb3('0xa'));var _0x465375=JSON[_0x6eb3('0xb')](_0x12036f);return _0x465375[_0x6eb3('0xc')](_0x28a2e7)?_0x465375[_0x28a2e7]:null;}}return null;}function isLimit(_0xd935ca,_0x3ce331,_0x60b67d,_0x2e9788){var _0x2e3299=_0x3ce331;return compose()['use'](function(_0x251354,_0x4c0768,_0x3a1a5){return db[_0x6eb3('0xd')][_0x6eb3('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x23e0bd){var _0x7a7e9a=getValueFromLicense(_0xd935ca,_0x23e0bd);return _0x7a7e9a?_0x7a7e9a:_0x2e3299;})[_0x6eb3('0xf')](function(_0x3910d3){_0x2e3299=_0x3910d3;return _0x60b67d[_0x6eb3('0x10')](_0x2e9788);})['then'](function(_0x56ecf7){if(_0x56ecf7>=_0x2e3299){return _0x4c0768[_0x6eb3('0x11')](0x193)['json']({'message':util[_0x6eb3('0x7')](_0x6eb3('0x12'),_0xd935ca)});}_0x3a1a5();})[_0x6eb3('0x13')](function(_0x5694d9){_0x3a1a5(_0x5694d9);});});}function isUserLimit(){return isLimit(_0x6eb3('0x14'),0x1,db[_0x6eb3('0x15')],{'where':{'$or':[{'role':_0x6eb3('0x16')},{'role':_0x6eb3('0x17')}]}});}exports[_0x6eb3('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 6d98a57..125d67f 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 _0x6780=['parseSearch','sqlOperator','[$or]','replace','[$and]','length','split','slice','shift','match','forEach','filter','indexOf','map','buildExpression','DATE','operator','value','includes','$lte','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','>=\x20?','$between','start','$substring','utcOffset','hours','seconds','lodash'];(function(_0x7a598c,_0x145a1d){var _0x285f03=function(_0xc92777){while(--_0xc92777){_0x7a598c['push'](_0x7a598c['shift']());}};_0x285f03(++_0x145a1d);}(_0x6780,0x9e));var _0x0678=function(_0x1517e3,_0x19bab4){_0x1517e3=_0x1517e3-0x0;var _0x3c2013=_0x6780[_0x1517e3];return _0x3c2013;};'use strict';var _=require(_0x0678('0x0'));var moment=require('moment');exports[_0x0678('0x1')]=function(_0xbe930c){var _0x2bee26={'conditions':[]};_0x2bee26[_0x0678('0x2')]=_['startsWith'](_0xbe930c,_0x0678('0x3'))?'or':'and';var _0x48fe7b=_0xbe930c[_0x0678('0x4')](_0x0678('0x5'),'')[_0x0678('0x4')]('[$or]','')['split']('||');for(var _0x1af697=0x0;_0x1af697<_0x48fe7b[_0x0678('0x6')];_0x1af697++){var _0xe8f3d2=_0x48fe7b[_0x1af697][_0x0678('0x7')](':=');var _0x3c4aaa=_0xe8f3d2[0x0];var _0x33702c=_0xe8f3d2[_0x0678('0x8')](0x1);_0x33702c['forEach'](function(_0x1a82d9){var _0x15cdd5=_0x1a82d9[_0x0678('0x7')]('[')[_0x0678('0x9')]();var _0x549847=_0x1a82d9[_0x0678('0xa')](/\[(.*?)\]/g);_0x549847[_0x0678('0xb')](function(_0xd1dfea){var _0x464489=_0xd1dfea[_0x0678('0x7')]('[')[_0x0678('0xc')](function(_0x357e3b){return _0x357e3b[_0x0678('0xd')](']')>-0x1;})[_0x0678('0xe')](function(_0x59ad52){return _0x59ad52['split'](']')[0x0];})[0x0];_0x2bee26['conditions']['push']({'field':_0x3c4aaa,'operator':_0x15cdd5,'value':_0x464489});});});}return _0x2bee26;};exports[_0x0678('0xf')]=function(_0x5599f3,_0x2b71f4,_0xa36594){var _0x333c19={};if(_0x2b71f4===_0x0678('0x10')){if(_0xa36594[_0x0678('0x11')]==='$eq'){_0xa36594[_0x0678('0x11')]='$between';_0xa36594[_0x0678('0x12')]+=','+_0xa36594[_0x0678('0x12')];}else if(_[_0x0678('0x13')](['$gt',_0x0678('0x14')],_0xa36594[_0x0678('0x11')])){_0xa36594['value']=moment(_0xa36594[_0x0678('0x12')])[_0x0678('0x15')](0x1,_0x0678('0x16'))[_0x0678('0x17')](_0x0678('0x18'));}}if(_0xa36594['castTo']){_0x2b71f4=_0xa36594['castTo'];_0x333c19[_0x0678('0x19')]=_0x0678('0x1a')+_0x5599f3+'.'+_0xa36594[_0x0678('0x1b')]+_0x0678('0x1c')+_0xa36594[_0x0678('0x1d')]+')\x20'+parseOperator(_0xa36594['operator']);}else{_0x333c19['text']=_0x5599f3+'.'+_0xa36594['field']+'\x20'+parseOperator(_0xa36594[_0x0678('0x11')]);}if(_['includes']([_0x0678('0x1e'),_0x0678('0x1f')],_0xa36594['operator']))_0x333c19[_0x0678('0x19')]='('+_0x333c19['text']+_0x0678('0x20')+_0x5599f3+'.'+_0xa36594[_0x0678('0x1b')]+_0x0678('0x21');_0x333c19[_0x0678('0x12')]=parseValue(_0x2b71f4,_0xa36594[_0x0678('0x11')],_0xa36594['value']);return _0x333c19;};function parseOperator(_0x3b895b){var _0x30befc;switch(_0x3b895b){case _0x0678('0x22'):_0x30befc=_0x0678('0x23');break;case _0x0678('0x1f'):_0x30befc=_0x0678('0x24');break;case'$eq':_0x30befc=_0x0678('0x25');break;case'$ne':_0x30befc=_0x0678('0x26');break;case'$substring':case _0x0678('0x27'):case _0x0678('0x28'):_0x30befc=_0x0678('0x29');break;case _0x0678('0x2a'):_0x30befc=_0x0678('0x2b');break;case _0x0678('0x2c'):_0x30befc=_0x0678('0x2d');break;case _0x0678('0x14'):_0x30befc='<=\x20?';break;case'$gte':_0x30befc=_0x0678('0x2e');break;case _0x0678('0x2f'):_0x30befc='BETWEEN\x20?\x20AND\x20?';break;}return _0x30befc;}function parseValue(_0x512ab8,_0x29593e,_0x180f3a){var _0x11539b={'start':undefined,'end':undefined};switch(_0x29593e){case'$in':case _0x0678('0x1f'):_0x11539b[_0x0678('0x30')]=_0x180f3a[_0x0678('0x7')](',');break;case _0x0678('0x31'):_0x11539b[_0x0678('0x30')]='%'+_0x180f3a+'%';break;case _0x0678('0x27'):_0x11539b[_0x0678('0x30')]=_0x180f3a+'%';break;case _0x0678('0x28'):_0x11539b[_0x0678('0x30')]='%'+_0x180f3a;break;case'$between':var _0x5ce756=_0x180f3a['split'](',');var _0x180f3a=_0x5ce756['shift']();var _0x58e3a6=_0x5ce756['pop']();if(_0x512ab8===_0x0678('0x10')){_0x180f3a=moment(_0x180f3a)[_0x0678('0x32')](0x0,!![])[_0x0678('0x17')]();_0x58e3a6=moment(_0x58e3a6)[_0x0678('0x32')](0x0,!![])[_0x0678('0x15')](0x17,_0x0678('0x33'))[_0x0678('0x15')](0x3b,'minutes')[_0x0678('0x15')](0x3b,_0x0678('0x34'))[_0x0678('0x17')]();}_0x11539b={'start':_0x180f3a,'end':_0x58e3a6};break;default:_0x11539b[_0x0678('0x30')]=_0x180f3a;break;}return _0x11539b;} \ No newline at end of file +var _0x63a6=['indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','text','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$startsWith','utcOffset','format','add','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match'];(function(_0x585a61,_0x20bc81){var _0x3007bf=function(_0x131ec2){while(--_0x131ec2){_0x585a61['push'](_0x585a61['shift']());}};_0x3007bf(++_0x20bc81);}(_0x63a6,0x13d));var _0x663a=function(_0x53c1a1,_0x1f401c){_0x53c1a1=_0x53c1a1-0x0;var _0x4f2ddf=_0x63a6[_0x53c1a1];return _0x4f2ddf;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x663a('0x0')]=function(_0x58d17a){var _0x33020a={'conditions':[]};_0x33020a[_0x663a('0x1')]=_[_0x663a('0x2')](_0x58d17a,_0x663a('0x3'))?'or':_0x663a('0x4');var _0x13fa3f=_0x58d17a[_0x663a('0x5')](_0x663a('0x6'),'')[_0x663a('0x5')](_0x663a('0x3'),'')[_0x663a('0x7')]('||');for(var _0x1532df=0x0;_0x1532df<_0x13fa3f[_0x663a('0x8')];_0x1532df++){var _0x54d9e8=_0x13fa3f[_0x1532df]['split'](':=');var _0x172b38=_0x54d9e8[0x0];var _0x56d7e1=_0x54d9e8[_0x663a('0x9')](0x1);_0x56d7e1[_0x663a('0xa')](function(_0x21a0b5){var _0x2852fe=_0x21a0b5[_0x663a('0x7')]('[')[_0x663a('0xb')]();var _0x5601ba=_0x21a0b5[_0x663a('0xc')](/\[(.*?)\]/g);_0x5601ba[_0x663a('0xa')](function(_0x266242){var _0x11e187=_0x266242[_0x663a('0x7')]('[')['filter'](function(_0x27acf6){return _0x27acf6[_0x663a('0xd')](']')>-0x1;})[_0x663a('0xe')](function(_0x19265e){return _0x19265e[_0x663a('0x7')](']')[0x0];})[0x0];_0x33020a['conditions'][_0x663a('0xf')]({'field':_0x172b38,'operator':_0x2852fe,'value':_0x11e187});});});}return _0x33020a;};exports[_0x663a('0x10')]=function(_0x3be612,_0x17efe3,_0x5637a5){var _0x511b91={};if(_0x17efe3===_0x663a('0x11')){if(_0x5637a5[_0x663a('0x12')]===_0x663a('0x13')){_0x5637a5['operator']=_0x663a('0x14');_0x5637a5[_0x663a('0x15')]+=','+_0x5637a5['value'];}else if(_[_0x663a('0x16')]([_0x663a('0x17'),_0x663a('0x18')],_0x5637a5[_0x663a('0x12')])){_0x5637a5['value']=moment(_0x5637a5[_0x663a('0x15')])['add'](0x1,_0x663a('0x19'))['format'](_0x663a('0x1a'));}}if(_0x5637a5[_0x663a('0x1b')]){_0x17efe3=_0x5637a5[_0x663a('0x1b')];_0x511b91[_0x663a('0x1c')]='CAST('+_0x3be612+'.'+_0x5637a5['field']+_0x663a('0x1d')+_0x5637a5[_0x663a('0x1b')]+')\x20'+parseOperator(_0x5637a5[_0x663a('0x12')]);}else{_0x511b91[_0x663a('0x1c')]=_0x3be612+'.'+_0x5637a5[_0x663a('0x1e')]+'\x20'+parseOperator(_0x5637a5['operator']);}if(_[_0x663a('0x16')]([_0x663a('0x1f'),_0x663a('0x20')],_0x5637a5[_0x663a('0x12')]))_0x511b91[_0x663a('0x1c')]='('+_0x511b91[_0x663a('0x1c')]+_0x663a('0x21')+_0x3be612+'.'+_0x5637a5['field']+_0x663a('0x22');_0x511b91[_0x663a('0x15')]=parseValue(_0x17efe3,_0x5637a5[_0x663a('0x12')],_0x5637a5['value']);return _0x511b91;};function parseOperator(_0x5e836d){var _0x198978;switch(_0x5e836d){case _0x663a('0x23'):_0x198978='IN\x20?';break;case _0x663a('0x20'):_0x198978=_0x663a('0x24');break;case _0x663a('0x13'):_0x198978=_0x663a('0x25');break;case _0x663a('0x1f'):_0x198978=_0x663a('0x26');break;case _0x663a('0x27'):case'$startsWith':case _0x663a('0x28'):_0x198978=_0x663a('0x29');break;case _0x663a('0x2a'):_0x198978=_0x663a('0x2b');break;case _0x663a('0x17'):_0x198978='>\x20?';break;case'$lte':_0x198978=_0x663a('0x2c');break;case _0x663a('0x2d'):_0x198978='>=\x20?';break;case _0x663a('0x14'):_0x198978=_0x663a('0x2e');break;}return _0x198978;}function parseValue(_0x4773d9,_0x4c376a,_0x1abd2f){var _0x4d8a84={'start':undefined,'end':undefined};switch(_0x4c376a){case _0x663a('0x23'):case _0x663a('0x20'):_0x4d8a84[_0x663a('0x2f')]=_0x1abd2f[_0x663a('0x7')](',');break;case _0x663a('0x27'):_0x4d8a84['start']='%'+_0x1abd2f+'%';break;case _0x663a('0x30'):_0x4d8a84[_0x663a('0x2f')]=_0x1abd2f+'%';break;case _0x663a('0x28'):_0x4d8a84[_0x663a('0x2f')]='%'+_0x1abd2f;break;case _0x663a('0x14'):var _0x22ee0a=_0x1abd2f['split'](',');var _0x1abd2f=_0x22ee0a[_0x663a('0xb')]();var _0x3821ae=_0x22ee0a['pop']();if(_0x4773d9===_0x663a('0x11')){_0x1abd2f=moment(_0x1abd2f)[_0x663a('0x31')](0x0,!![])[_0x663a('0x32')]();_0x3821ae=moment(_0x3821ae)[_0x663a('0x31')](0x0,!![])[_0x663a('0x33')](0x17,_0x663a('0x34'))[_0x663a('0x33')](0x3b,_0x663a('0x35'))[_0x663a('0x33')](0x3b,_0x663a('0x36'))[_0x663a('0x32')]();}_0x4d8a84={'start':_0x1abd2f,'end':_0x3821ae};break;default:_0x4d8a84['start']=_0x1abd2f;break;}return _0x4d8a84;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index e906ea3..52d2325 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 _0x4da5=['format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','priority','cast','col','unsigned','substr','ASC','isObject','isString','length','unset','hasOwnProperty','omit','isNumeric','^[+]?[0-9]*$','match','getFullTextValue','{EXPR}','replace','push','join','getOptions','query','$id','intersection','attributes','fields','nolimit','limit','order','where','pick','filter','object','columns','lower','options','include','includeAll','sequelize','moment','../../mysqldb','parse','keys','includes','model','alias','raw','split','filters','isEmpty','forOwn','find','type','isPlainObject'];(function(_0x1a3474,_0x24fb50){var _0x35d9d1=function(_0x29476c){while(--_0x29476c){_0x1a3474['push'](_0x1a3474['shift']());}};_0x35d9d1(++_0x24fb50);}(_0x4da5,0x1b7));var _0x54da=function(_0x165ba0,_0x5024fc){_0x165ba0=_0x165ba0-0x0;var _0xa2bbd3=_0x4da5[_0x165ba0];return _0xa2bbd3;};'use strict';var _=require('lodash');var sequelize=require(_0x54da('0x0'));var moment=require(_0x54da('0x1'));var db=require(_0x54da('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4f4293){var _0x3281bc=['ne'];try{var _0x4cdd6e=JSON[_0x54da('0x3')](_0x4f4293);var _0x3b7cdc=Object[_0x54da('0x4')](_0x4cdd6e)[0x0];return _0x3281bc[_0x54da('0x5')](_0x3b7cdc);}catch(_0x4a1b4e){return![];}}function getOperatorValue(_0x200b6c){var _0xf6aaf3=JSON[_0x54da('0x3')](_0x200b6c);var _0x1b2b5c=Object[_0x54da('0x4')](_0xf6aaf3)[0x0];var _0x30c17d=_0xf6aaf3[_0x1b2b5c];return{['$'+_0x1b2b5c]:_0x30c17d};}function parseIncludeModel(_0x1e2c78){var _0x5bfa08=JSON[_0x54da('0x3')](_0x1e2c78);return{'model':db[_0x5bfa08[_0x54da('0x6')]],'as':_0x5bfa08[_0x54da('0x7')],'attributes':_0x5bfa08['fields'],'raw':_0x5bfa08[_0x54da('0x8')]};}exports['fields']=function(_0x5f4383){var _0x37f957=null;if(_0x5f4383){_0x37f957=_0x5f4383[_0x54da('0x9')](',');}return _0x37f957;};exports[_0x54da('0xa')]=function(_0x40a9b6,_0x37a5ed){var _0x30c6d4={};if(!_[_0x54da('0xb')](_0x40a9b6)){_[_0x54da('0xc')](_0x40a9b6,function(_0x1963fe,_0x1ff5fc){try{if(_0x37a5ed){var _0x38694b=_[_0x54da('0xd')](_0x37a5ed,{'name':_0x1ff5fc})||{};if(hasSequelizeOperator(_0x1963fe)){_0x30c6d4[_0x1ff5fc]=getOperatorValue(_0x1963fe);}else if(_0x38694b[_0x54da('0xe')]==='DATE'&&_[_0x54da('0xf')](_0x1963fe)){var _0x193108=JSON[_0x54da('0x3')](_0x1963fe);var _0x2754fd={'$gte':moment(moment(_0x193108['$gte'])[_0x54da('0x10')](_0x54da('0x11')))[_0x54da('0x12')]()[_0x54da('0x10')](),'$lte':moment(moment(_0x193108[_0x54da('0x13')])[_0x54da('0x10')]('YYYY-MM-DD'))[_0x54da('0x12')]()[_0x54da('0x14')](0x1,'s')['format']()};_0x30c6d4[_0x1ff5fc]=_0x2754fd;}else if(_0x38694b[_0x54da('0x15')]===_0x54da('0x16')){_0x30c6d4[_0x1ff5fc]=_0x1963fe;}else{_0x30c6d4[_0x1ff5fc]=_['isArray'](_0x1963fe)?_0x1963fe:JSON['parse'](_0x1963fe);}}else{_0x30c6d4[_0x1ff5fc]=_[_0x54da('0x17')](_0x1963fe)?_0x1963fe:JSON['parse'](_0x1963fe);}}catch(_0x3fcbcf){_0x30c6d4[_0x1ff5fc]=_0x1963fe[_0x54da('0x9')](',');}});}return _0x30c6d4;};exports['limit']=function(_0x123cac){_0x123cac=parseInt(_0x123cac,0xa);if(!_0x123cac||_0x123cac<0x0){_0x123cac=LIMIT_VALUE;}return _0x123cac;};exports[_0x54da('0x18')]=function(_0x2eb3a3){_0x2eb3a3=parseInt(_0x2eb3a3,0xa);if(!_0x2eb3a3||_0x2eb3a3<0x0){_0x2eb3a3=0x0;}return _0x2eb3a3;};exports[_0x54da('0x19')]=function(_0x1be61f){var _0x371b9e,_0x348c56=null;if(_0x1be61f){_0x371b9e=_0x1be61f[_0x54da('0x9')](',');_0x348c56=_[_0x54da('0x1a')](_0x371b9e,function(_0x341db3){if(_0x341db3['indexOf']('-')===0x0){return[_0x341db3===_0x54da('0x1b')?sequelize[_0x54da('0x1c')](sequelize[_0x54da('0x1d')](_0x54da('0x1b')),_0x54da('0x1e')):_0x341db3[_0x54da('0x1f')](0x1),'DESC'];}else{return[_0x341db3===_0x54da('0x1b')?sequelize[_0x54da('0x1c')](sequelize[_0x54da('0x1d')](_0x54da('0x1b')),_0x54da('0x1e')):_0x341db3,_0x54da('0x20')];}});}return _0x348c56;};exports['omit']=function(_0x9ea13f,_0x4babec){if(_[_0x54da('0xb')](_0x9ea13f)){return _0x9ea13f;}if(_[_0x54da('0x17')](_0x9ea13f)){for(var _0x77024e=0x0;_0x77024e<_0x9ea13f['length'];_0x77024e+=0x1){_0x9ea13f[_0x77024e]=this['omit'](_0x9ea13f[_0x77024e],_0x4babec);}return _0x9ea13f;}if(!_[_0x54da('0x21')](_0x9ea13f)){return _0x9ea13f;}if(_[_0x54da('0x22')](_0x4babec)){_0x4babec=[_0x4babec];}if(!_[_0x54da('0x17')](_0x4babec)){return _0x9ea13f;}for(var _0x4f7f84=0x0;_0x4f7f84<_0x4babec[_0x54da('0x23')];_0x4f7f84+=0x1){_[_0x54da('0x24')](_0x9ea13f,_0x4babec[_0x4f7f84]);}for(var _0x56942a in _0x9ea13f){if(_0x9ea13f[_0x54da('0x25')](_0x56942a)){_0x9ea13f[_0x56942a]=this[_0x54da('0x26')](_0x9ea13f[_0x56942a],_0x4babec);}}return _0x9ea13f;};exports[_0x54da('0x27')]=function(_0x4f7ee2){return _0x4f7ee2['match'](RegExp(_0x54da('0x28')))?!![]:![];};exports['isEmail']=function(_0x20a0c6){return _0x20a0c6[_0x54da('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0x54da('0x2a')]=function(_0x23b48e,_0x86e5e5){var _0x408027=[];var _0x42fd8c=/[ `!@#$%^&*()_\-?~]/;var _0x4676e6=_0x86e5e5?'\x22{EXPR}\x22':_0x54da('0x2b');_0x23b48e[_0x54da('0x9')](/[ ,]+/)['forEach'](function(_0x55c25d){_0x55c25d=_0x55c25d[_0x54da('0x2c')](/([^:]")"+/g,'$1');_0x55c25d='+'+_0x55c25d+'*';var _0x39a448=_0x55c25d[_0x54da('0x29')](_0x42fd8c);if(_0x39a448){_0x55c25d='\x22'+_0x55c25d+'\x22';}_0x408027[_0x54da('0x2d')](_0x55c25d);});_0x4676e6=_0x4676e6[_0x54da('0x2c')](_0x54da('0x2b'),_0x408027[_0x54da('0x2e')]('\x20'));return _0x4676e6;};exports[_0x54da('0x2f')]=function(_0x119aff,_0xe2afc4,_0x10f188){var _0x361c6f={},_0x5e58d3={};if(_0xe2afc4[_0x54da('0x30')][_0x54da('0x31')]){_0xe2afc4['query']['id']=_0xe2afc4[_0x54da('0x30')][_0x54da('0x31')];delete _0xe2afc4[_0x54da('0x30')][_0x54da('0x31')];}_0x361c6f[_0x54da('0x6')]=_['map'](_0x119aff,'name');_0x361c6f[_0x54da('0x30')]=_['keys'](_0xe2afc4['query']);_0x361c6f['filters']=_[_0x54da('0x32')](_0x361c6f[_0x54da('0x6')],_0x361c6f[_0x54da('0x30')]);_0x5e58d3[_0x54da('0x33')]=_[_0x54da('0x32')](_0x361c6f[_0x54da('0x6')],this[_0x54da('0x34')](_0xe2afc4[_0x54da('0x30')][_0x54da('0x34')]));_0x5e58d3[_0x54da('0x33')]=_0x5e58d3[_0x54da('0x33')][_0x54da('0x23')]?_0x5e58d3[_0x54da('0x33')]:_0x361c6f[_0x54da('0x6')];if(!_0xe2afc4[_0x54da('0x30')][_0x54da('0x25')](_0x54da('0x35'))){_0x5e58d3[_0x54da('0x36')]=this['limit'](_0xe2afc4[_0x54da('0x30')]['limit']);_0x5e58d3[_0x54da('0x18')]=this['offset'](_0xe2afc4[_0x54da('0x30')][_0x54da('0x18')]);}_0x5e58d3[_0x54da('0x37')]=this['sort'](_0xe2afc4[_0x54da('0x30')]['sort']);_0x5e58d3[_0x54da('0x38')]=this[_0x54da('0xa')](_[_0x54da('0x39')](_0xe2afc4['query'],_0x361c6f[_0x54da('0xa')]),_0x119aff);if(_0xe2afc4[_0x54da('0x30')][_0x54da('0x3a')]){var _0x314af0=_0x119aff;var _0x260c32=_0xe2afc4[_0x54da('0x30')][_0x54da('0x3a')];if(typeof _0x260c32===_0x54da('0x3b')){_0x314af0=_[_0x54da('0x3a')](_0x119aff,function(_0x4e290b){return _[_0x54da('0x5')](_0x260c32[_0x54da('0x3c')],_0x4e290b[_0x54da('0x15')]);});_0x260c32=_0x260c32['value'];}_0x5e58d3[_0x54da('0x38')]=_['merge'](_0x5e58d3[_0x54da('0x38')],{'$or':_[_0x54da('0x1a')](_0x314af0,function(_0x5e24e7){if(_0x5e24e7[_0x54da('0xe')]!=='VIRTUAL'){if(_0x10f188){return sequelize['where'](sequelize['fn'](_0x54da('0x3d'),sequelize['col'](_0x5e24e7[_0x54da('0x15')])),{'$like':sequelize['fn']('lower','%'+_0xe2afc4['query'][_0x54da('0x3a')]+'%')});}else{var _0xc3bfcd={};_0xc3bfcd[_0x5e24e7[_0x54da('0x15')]]={'$like':'%'+_0xe2afc4[_0x54da('0x30')][_0x54da('0x3a')]+'%'};return _0xc3bfcd;}}})});}_0x5e58d3=_['merge']({},_0x5e58d3,_0xe2afc4[_0x54da('0x3e')]);return _0x5e58d3;};exports[_0x54da('0x3f')]=function(_0x1d9014){var _0x14ed8e=[];if(_0x1d9014[_0x54da('0x40')]){_0x14ed8e[_0x54da('0x2d')]({'all':!![]});}else if(_0x1d9014['include']){if(Array[_0x54da('0x17')](_0x1d9014[_0x54da('0x3f')])){_0x14ed8e=Object[_0x54da('0x4')](_0x1d9014['include'])[_0x54da('0x1a')](function(_0x4c98e1){return parseIncludeModel(_0x1d9014[_0x54da('0x3f')][_0x4c98e1]);});}else{var _0x604a93=parseIncludeModel(_0x1d9014[_0x54da('0x3f')]);_0x14ed8e['push'](_0x604a93);}}return _0x14ed8e;}; \ No newline at end of file +var _0xa4bf=['\x22{EXPR}\x22','{EXPR}','forEach','replace','join','getOptions','query','$id','attributes','intersection','fields','limit','pick','object','filter','columns','value','where','VIRTUAL','lower','merge','options','includeAll','push','include','lodash','sequelize','moment','../../mysqldb','parse','keys','includes','model','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast','ASC','omit','isArray','isObject','isString','length','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4bf,0xa7));var _0xfa4b=function(_0x567bf6,_0x1a0462){_0x567bf6=_0x567bf6-0x0;var _0x27c12d=_0xa4bf[_0x567bf6];return _0x27c12d;};'use strict';var _=require(_0xfa4b('0x0'));var sequelize=require(_0xfa4b('0x1'));var moment=require(_0xfa4b('0x2'));var db=require(_0xfa4b('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x228202){var _0x2889ae=['ne'];try{var _0x56c73b=JSON[_0xfa4b('0x4')](_0x228202);var _0x2c7fd6=Object[_0xfa4b('0x5')](_0x56c73b)[0x0];return _0x2889ae[_0xfa4b('0x6')](_0x2c7fd6);}catch(_0x5264f6){return![];}}function getOperatorValue(_0x2b3ae7){var _0x17b722=JSON[_0xfa4b('0x4')](_0x2b3ae7);var _0x2544c6=Object[_0xfa4b('0x5')](_0x17b722)[0x0];var _0x292d66=_0x17b722[_0x2544c6];return{['$'+_0x2544c6]:_0x292d66};}function parseIncludeModel(_0x4b7c28){var _0x184fbf=JSON[_0xfa4b('0x4')](_0x4b7c28);return{'model':db[_0x184fbf[_0xfa4b('0x7')]],'as':_0x184fbf['alias'],'attributes':_0x184fbf['fields'],'raw':_0x184fbf[_0xfa4b('0x8')]};}exports['fields']=function(_0x427005){var _0xead829=null;if(_0x427005){_0xead829=_0x427005[_0xfa4b('0x9')](',');}return _0xead829;};exports[_0xfa4b('0xa')]=function(_0x1a5ab6,_0x4e50a1){var _0x242ccf={};if(!_[_0xfa4b('0xb')](_0x1a5ab6)){_[_0xfa4b('0xc')](_0x1a5ab6,function(_0x4a1892,_0x556854){try{if(_0x4e50a1){var _0x339d65=_[_0xfa4b('0xd')](_0x4e50a1,{'name':_0x556854})||{};if(hasSequelizeOperator(_0x4a1892)){_0x242ccf[_0x556854]=getOperatorValue(_0x4a1892);}else if(_0x339d65[_0xfa4b('0xe')]===_0xfa4b('0xf')&&_[_0xfa4b('0x10')](_0x4a1892)){var _0x3103a4=JSON[_0xfa4b('0x4')](_0x4a1892);var _0x4f405e={'$gte':moment(moment(_0x3103a4[_0xfa4b('0x11')])[_0xfa4b('0x12')]('YYYY-MM-DD'))[_0xfa4b('0x13')]()[_0xfa4b('0x12')](),'$lte':moment(moment(_0x3103a4[_0xfa4b('0x14')])[_0xfa4b('0x12')](_0xfa4b('0x15')))[_0xfa4b('0x13')]()[_0xfa4b('0x16')](0x1,'s')[_0xfa4b('0x12')]()};_0x242ccf[_0x556854]=_0x4f405e;}else if(_0x339d65[_0xfa4b('0x17')]===_0xfa4b('0x18')){_0x242ccf[_0x556854]=_0x4a1892;}else{_0x242ccf[_0x556854]=_['isArray'](_0x4a1892)?_0x4a1892:JSON[_0xfa4b('0x4')](_0x4a1892);}}else{_0x242ccf[_0x556854]=_['isArray'](_0x4a1892)?_0x4a1892:JSON[_0xfa4b('0x4')](_0x4a1892);}}catch(_0x4a8c24){_0x242ccf[_0x556854]=_0x4a1892['split'](',');}});}return _0x242ccf;};exports['limit']=function(_0x148e40){_0x148e40=parseInt(_0x148e40,0xa);if(!_0x148e40||_0x148e40<0x0){_0x148e40=LIMIT_VALUE;}return _0x148e40;};exports[_0xfa4b('0x19')]=function(_0x18d7fb){_0x18d7fb=parseInt(_0x18d7fb,0xa);if(!_0x18d7fb||_0x18d7fb<0x0){_0x18d7fb=0x0;}return _0x18d7fb;};exports[_0xfa4b('0x1a')]=function(_0xc23532){var _0x32fe60,_0x4186dd=null;if(_0xc23532){_0x32fe60=_0xc23532[_0xfa4b('0x9')](',');_0x4186dd=_[_0xfa4b('0x1b')](_0x32fe60,function(_0x1a55bb){if(_0x1a55bb[_0xfa4b('0x1c')]('-')===0x0){return[_0x1a55bb===_0xfa4b('0x1d')?sequelize['cast'](sequelize[_0xfa4b('0x1e')](_0xfa4b('0x1d')),_0xfa4b('0x1f')):_0x1a55bb[_0xfa4b('0x20')](0x1),_0xfa4b('0x21')];}else{return[_0x1a55bb==='priority'?sequelize[_0xfa4b('0x22')](sequelize[_0xfa4b('0x1e')]('priority'),_0xfa4b('0x1f')):_0x1a55bb,_0xfa4b('0x23')];}});}return _0x4186dd;};exports[_0xfa4b('0x24')]=function(_0x2c48f6,_0x2d3ab4){if(_[_0xfa4b('0xb')](_0x2c48f6)){return _0x2c48f6;}if(_[_0xfa4b('0x25')](_0x2c48f6)){for(var _0x3ecb35=0x0;_0x3ecb35<_0x2c48f6['length'];_0x3ecb35+=0x1){_0x2c48f6[_0x3ecb35]=this[_0xfa4b('0x24')](_0x2c48f6[_0x3ecb35],_0x2d3ab4);}return _0x2c48f6;}if(!_[_0xfa4b('0x26')](_0x2c48f6)){return _0x2c48f6;}if(_[_0xfa4b('0x27')](_0x2d3ab4)){_0x2d3ab4=[_0x2d3ab4];}if(!_[_0xfa4b('0x25')](_0x2d3ab4)){return _0x2c48f6;}for(var _0x2ff714=0x0;_0x2ff714<_0x2d3ab4[_0xfa4b('0x28')];_0x2ff714+=0x1){_['unset'](_0x2c48f6,_0x2d3ab4[_0x2ff714]);}for(var _0x30126e in _0x2c48f6){if(_0x2c48f6[_0xfa4b('0x29')](_0x30126e)){_0x2c48f6[_0x30126e]=this[_0xfa4b('0x24')](_0x2c48f6[_0x30126e],_0x2d3ab4);}}return _0x2c48f6;};exports['isNumeric']=function(_0x2fb803){return _0x2fb803[_0xfa4b('0x2a')](RegExp(_0xfa4b('0x2b')))?!![]:![];};exports[_0xfa4b('0x2c')]=function(_0x4f3eac){return _0x4f3eac['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xfa4b('0x2d')]=function(_0x45c842,_0x55794e){var _0x2ab459=[];var _0x50d8c4=/[ `!@#$%^&*()_\-?~]/;var _0x3dae41=_0x55794e?_0xfa4b('0x2e'):_0xfa4b('0x2f');_0x45c842[_0xfa4b('0x9')](/[ ,]+/)[_0xfa4b('0x30')](function(_0x7912a1){_0x7912a1=_0x7912a1[_0xfa4b('0x31')](/([^:]")"+/g,'$1');_0x7912a1='+'+_0x7912a1+'*';var _0x368fda=_0x7912a1['match'](_0x50d8c4);if(_0x368fda){_0x7912a1='\x22'+_0x7912a1+'\x22';}_0x2ab459['push'](_0x7912a1);});_0x3dae41=_0x3dae41['replace'](_0xfa4b('0x2f'),_0x2ab459[_0xfa4b('0x32')]('\x20'));return _0x3dae41;};exports[_0xfa4b('0x33')]=function(_0x1dcd59,_0x89db94,_0x4c6335){var _0x5dc142={},_0x57678c={};if(_0x89db94['query']['$id']){_0x89db94[_0xfa4b('0x34')]['id']=_0x89db94[_0xfa4b('0x34')][_0xfa4b('0x35')];delete _0x89db94[_0xfa4b('0x34')]['$id'];}_0x5dc142[_0xfa4b('0x7')]=_[_0xfa4b('0x1b')](_0x1dcd59,'name');_0x5dc142[_0xfa4b('0x34')]=_[_0xfa4b('0x5')](_0x89db94[_0xfa4b('0x34')]);_0x5dc142['filters']=_['intersection'](_0x5dc142[_0xfa4b('0x7')],_0x5dc142[_0xfa4b('0x34')]);_0x57678c[_0xfa4b('0x36')]=_[_0xfa4b('0x37')](_0x5dc142['model'],this[_0xfa4b('0x38')](_0x89db94[_0xfa4b('0x34')]['fields']));_0x57678c[_0xfa4b('0x36')]=_0x57678c['attributes'][_0xfa4b('0x28')]?_0x57678c[_0xfa4b('0x36')]:_0x5dc142['model'];if(!_0x89db94[_0xfa4b('0x34')]['hasOwnProperty']('nolimit')){_0x57678c['limit']=this[_0xfa4b('0x39')](_0x89db94[_0xfa4b('0x34')][_0xfa4b('0x39')]);_0x57678c[_0xfa4b('0x19')]=this[_0xfa4b('0x19')](_0x89db94[_0xfa4b('0x34')][_0xfa4b('0x19')]);}_0x57678c['order']=this[_0xfa4b('0x1a')](_0x89db94[_0xfa4b('0x34')][_0xfa4b('0x1a')]);_0x57678c['where']=this['filters'](_[_0xfa4b('0x3a')](_0x89db94[_0xfa4b('0x34')],_0x5dc142[_0xfa4b('0xa')]),_0x1dcd59);if(_0x89db94[_0xfa4b('0x34')]['filter']){var _0x404bcd=_0x1dcd59;var _0x31555f=_0x89db94[_0xfa4b('0x34')]['filter'];if(typeof _0x31555f===_0xfa4b('0x3b')){_0x404bcd=_[_0xfa4b('0x3c')](_0x1dcd59,function(_0x5f751c){return _[_0xfa4b('0x6')](_0x31555f[_0xfa4b('0x3d')],_0x5f751c['name']);});_0x31555f=_0x31555f[_0xfa4b('0x3e')];}_0x57678c[_0xfa4b('0x3f')]=_['merge'](_0x57678c[_0xfa4b('0x3f')],{'$or':_[_0xfa4b('0x1b')](_0x404bcd,function(_0x3bbdb8){if(_0x3bbdb8[_0xfa4b('0xe')]!==_0xfa4b('0x40')){if(_0x4c6335){return sequelize[_0xfa4b('0x3f')](sequelize['fn'](_0xfa4b('0x41'),sequelize[_0xfa4b('0x1e')](_0x3bbdb8[_0xfa4b('0x17')])),{'$like':sequelize['fn'](_0xfa4b('0x41'),'%'+_0x89db94[_0xfa4b('0x34')][_0xfa4b('0x3c')]+'%')});}else{var _0x672bdd={};_0x672bdd[_0x3bbdb8['name']]={'$like':'%'+_0x89db94[_0xfa4b('0x34')][_0xfa4b('0x3c')]+'%'};return _0x672bdd;}}})});}_0x57678c=_[_0xfa4b('0x42')]({},_0x57678c,_0x89db94[_0xfa4b('0x43')]);return _0x57678c;};exports['include']=function(_0x2f7455){var _0x5a2ef7=[];if(_0x2f7455[_0xfa4b('0x44')]){_0x5a2ef7[_0xfa4b('0x45')]({'all':!![]});}else if(_0x2f7455[_0xfa4b('0x46')]){if(Array['isArray'](_0x2f7455[_0xfa4b('0x46')])){_0x5a2ef7=Object[_0xfa4b('0x5')](_0x2f7455[_0xfa4b('0x46')])[_0xfa4b('0x1b')](function(_0xe538c){return parseIncludeModel(_0x2f7455[_0xfa4b('0x46')][_0xe538c]);});}else{var _0x20006c=parseIncludeModel(_0x2f7455[_0xfa4b('0x46')]);_0x5a2ef7[_0xfa4b('0x45')](_0x20006c);}}return _0x5a2ef7;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 73af621..6f873f0 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','name','chatPause','pauseType','find','globalStatus','fields','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','role','openchannelStatusTime','smsStatusTime','chatCurrentCapacity','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','onhold','getRealtimeAgentsQueryFields','lodash','../../mysqldb','client','http','mailPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','Agents','then','error','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value'];(function(_0x18bdc4,_0x2a6dd3){var _0xc29134=function(_0x1cf6de){while(--_0x1cf6de){_0x18bdc4['push'](_0x18bdc4['shift']());}};_0xc29134(++_0x2a6dd3);}(_0x6aa7,0x178));var _0x76aa=function(_0x278963,_0x543104){_0x278963=_0x278963-0x0;var _0x107db5=_0x6aa7[_0x278963];return _0x107db5;};'use strict';var _=require(_0x76aa('0x0'));var jayson=require('jayson/promise');var db=require(_0x76aa('0x1'))['db'];var amiClient=jayson[_0x76aa('0x2')][_0x76aa('0x3')]({'port':0x232a});var routingClient=jayson[_0x76aa('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x13f62b,_0xef15ef){var _0x1d6e04=[_0x13f62b['chatPause'],_0x13f62b['faxPause'],_0x13f62b[_0x76aa('0x4')],_0x13f62b['openchannelPause'],_0x13f62b[_0x76aa('0x5')],_0x13f62b[_0x76aa('0x6')],_0x13f62b[_0x76aa('0x7')]];if(!_0xef15ef)return _['every'](_0x1d6e04);var _0x3dae33=_[_0x76aa('0x8')](_0x1d6e04);return _0x3dae33[_0x76aa('0x9')]>0x0&&_0x3dae33['length']<_0x1d6e04[_0x76aa('0x9')]?!![]:![];}function isIdle(_0x25856d){return _0x25856d===_0x76aa('0xa')||_0x25856d===_0x76aa('0xb')||_0x25856d===_0x76aa('0xc')||_0x25856d===_0x76aa('0xd')||_[_0x76aa('0xe')](_0x25856d);}function isAgentIdle(_0x8dc35c){if(_0x8dc35c[_0x76aa('0xf')]!==_0x76aa('0xa')&&_0x8dc35c['voicePause']){_0x8dc35c[_0x76aa('0xf')]='pause';return![];}return _[_0x76aa('0x10')]([_0x8dc35c[_0x76aa('0x11')],_0x8dc35c[_0x76aa('0x12')],_0x8dc35c[_0x76aa('0x13')],_0x8dc35c[_0x76aa('0x14')],_0x8dc35c['smsStatus'],_0x8dc35c['voiceStatus'],_0x8dc35c[_0x76aa('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x76aa('0x16'),{})[_0x76aa('0x17')](function(_0x5cf594){if(_0x5cf594[_0x76aa('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x328381=_0x5cf594['result'];return routingClient[_0x76aa('0x19')](_0x76aa('0x16'),{})[_0x76aa('0x17')](function(_0x21c16d){if(_0x21c16d[_0x76aa('0x18')]){throw new Error(_0x76aa('0x1a'));}var _0x496902=_0x21c16d['result'];return _[_0x76aa('0x1b')]({},_0x328381,_0x496902);});})[_0x76aa('0x1c')](function(_0xf0711){throw _0xf0711;});}exports[_0x76aa('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x15109b){var _0x191560=_0x76aa('0xb');if(isAgentPaused(_0x15109b))_0x191560=_0x76aa('0x1e');else if(isAgentPaused(_0x15109b,!![]))_0x191560=_0x76aa('0x1f');else if(isAgentIdle(_0x15109b))_0x191560='idle';else _0x191560=_0x76aa('0x20');return _0x191560;}exports[_0x76aa('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x338a6b,_0x5b3f55){var _0x41463a=_[_0x76aa('0x22')](_0x338a6b)?_0x338a6b:[_0x338a6b];var _0x31252f=_[_0x76aa('0x23')](_0x5b3f55)+_0x76aa('0x24');var _0xc1044c=_[_0x76aa('0x25')](_0x41463a,function(_0x3363b3){return db[_0x31252f][_0x76aa('0x26')]({'where':{'id':_0x3363b3}})[_0x76aa('0x17')](function(_0x37f1ab){if(!_0x37f1ab)return[];return _0x37f1ab[_0x76aa('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x76aa('0x28')](_0xc1044c)['then'](function(_0xb5e8a9){var _0x1d6d15=_(_0xb5e8a9)[_0x76aa('0x29')]()[_0x76aa('0x25')]('id')[_0x76aa('0x2a')]()[_0x76aa('0x2b')]();return _0x1d6d15;});}exports[_0x76aa('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x282d0a,_0xd12a99,_0x1bdc3d){try{if(_0xd12a99['length']>0x0){_0x282d0a=_0x282d0a[_0x76aa('0x8')](function(_0x5a8030){return _0xd12a99[_0x76aa('0x2d')](_0x5a8030['id']);});}var _0x365ff8=_0x282d0a[_0x76aa('0x8')](function(_0x1e90b9){var _0x1eecd9=_0x76aa('0x20');if(isAgentIdle(_0x1e90b9)){_0x1eecd9=_0x76aa('0xa');}return _0x1eecd9===_0x1bdc3d;});return _[_0x76aa('0x25')](_0x365ff8,'id');}catch(_0x19fd4f){throw _0x19fd4f;}}exports[_0x76aa('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5edcd8,_0x430ad6,_0x5532c7){return Promise[_0x76aa('0x2f')]()[_0x76aa('0x17')](function(){if(_0x430ad6[_0x76aa('0x9')]>0x0){_0x5edcd8=_0x5edcd8[_0x76aa('0x8')](function(_0x35a705){return _0x430ad6['includes'](_0x35a705['id']);});}return _0x5edcd8;})[_0x76aa('0x17')](function(){return db[_0x76aa('0x30')]['findAll']({'attributes':['id',_0x76aa('0x31'),'fullname',_0x76aa('0x32'),'faxPause',_0x76aa('0x4'),'openchannelPause','smsPause',_0x76aa('0x6'),_0x76aa('0x7'),_0x76aa('0x33')],'where':{'id':{'$in':_[_0x76aa('0x25')](_0x5edcd8,'id')}},'raw':!![]});})['then'](function(_0x592596){return _0x592596[_0x76aa('0x25')](function(_0x1c7b6f){var _0x58127c=_[_0x76aa('0x34')](_0x5edcd8,['id',_0x1c7b6f['id']]);var _0x23029e=filterAgentAttributes(_0x58127c);_['merge'](_0x1c7b6f,_0x23029e);_0x1c7b6f[_0x76aa('0x35')]=getAgentStatus(_0x1c7b6f);return _0x1c7b6f;});})['then'](function(_0x5086f5){var _0x4fdbde=sortAgentsByStatus(_0x5086f5,_0x5532c7);return _[_0x76aa('0x25')](_0x4fdbde,'id');})[_0x76aa('0x1c')](function(_0x127bc4){throw _0x127bc4;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x401c07){var _0x1c22f7={'fields':[],'order':null};var _0x2eea79=_0x401c07['split'](',');_0x1c22f7[_0x76aa('0x36')]=_[_0x76aa('0x8')](_0x2eea79,function(_0x2f7726){if(!_0x2f7726[_0x76aa('0x2d')](_0x76aa('0x35'))){return!![];}_0x1c22f7[_0x76aa('0x37')]=_[_0x76aa('0x38')](_0x2f7726,'-')?_0x76aa('0x39'):_0x76aa('0x3a');return![];});return _0x1c22f7;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x1525cb){if(!_0x1525cb){_0x1525cb=_0x76aa('0x3b');}if(_0x1525cb[_0x76aa('0x2d')](_0x76aa('0x3c'))&&!_0x1525cb[_0x76aa('0x2d')](_0x76aa('0x3d'))){var _0x572fdb=_0x1525cb['substring'](0x0,_0x1525cb[_0x76aa('0x3e')](_0x76aa('0x3c')));_0x1525cb+=','+_0x572fdb+_0x76aa('0x3d');}return _0x1525cb;}exports[_0x76aa('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x50599f,_0x174a14){var _0x403084=_0x50599f[_0x76aa('0x40')](function(_0x30cdcb,_0x1138b5){if(_0x30cdcb['globalStatus']===_0x1138b5[_0x76aa('0x35')]){if(_0x30cdcb['globalStatus']===_0x76aa('0x1e')){if(_0x174a14==='DESC'){return(_0x30cdcb['pauseType']||'')<(_0x1138b5['pauseType']||'')||_0x30cdcb[_0x76aa('0x3c')]['toLowerCase']()>_0x1138b5['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x30cdcb[_0x76aa('0x33')]||'')<(_0x1138b5[_0x76aa('0x33')]||'')||_0x30cdcb[_0x76aa('0x3c')][_0x76aa('0x41')]()>_0x1138b5[_0x76aa('0x3c')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x174a14===_0x76aa('0x39')){return _0x30cdcb[_0x76aa('0x3c')][_0x76aa('0x41')]()<_0x1138b5[_0x76aa('0x3c')][_0x76aa('0x41')]()?0x1:-0x1;}else{return _0x30cdcb['fullname'][_0x76aa('0x41')]()<_0x1138b5[_0x76aa('0x3c')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x174a14===_0x76aa('0x39')){return _0x30cdcb['globalStatus']<_0x1138b5[_0x76aa('0x35')]?0x1:-0x1;}else{return _0x30cdcb[_0x76aa('0x35')]<_0x1138b5[_0x76aa('0x35')]?-0x1:0x1;}}});return _0x403084;}exports[_0x76aa('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x2d0bc4){var _0x3e0315=[_0x76aa('0x43'),_0x76aa('0x44'),_0x76aa('0x45'),_0x76aa('0x46'),'pauseType',_0x76aa('0x46'),'internal',_0x76aa('0x47'),_0x76aa('0x32'),_0x76aa('0x48'),_0x76aa('0x4'),'smsPause','whatsappPause',_0x76aa('0x49'),'voicePause',_0x76aa('0x4a'),_0x76aa('0x4b'),_0x76aa('0x4c'),_0x76aa('0x4d'),_0x76aa('0x4e'),_0x76aa('0x4f'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x76aa('0x50'),_0x76aa('0x51'),_0x76aa('0x52'),_0x76aa('0x53'),_0x76aa('0x11'),_0x76aa('0x14'),'mailStatus',_0x76aa('0x54'),_0x76aa('0x15'),_0x76aa('0x12'),'voiceStatus',_0x76aa('0x55'),'openchannelStatusTime',_0x76aa('0x56'),'smsStatusTime',_0x76aa('0x57'),_0x76aa('0x58'),_0x76aa('0x59'),_0x76aa('0x5a'),_0x76aa('0x5b'),_0x76aa('0x5c'),_0x76aa('0x5d'),'phoneBarEnableAutomaticScreenRecording',_0x76aa('0x5e')];var _0x5eeaa5=[_0x76aa('0x32'),_0x76aa('0x48'),_0x76aa('0x4'),_0x76aa('0x5'),_0x76aa('0x7'),_0x76aa('0x49'),_0x76aa('0x6'),'online'];var _0x333a3a=_(_0x2d0bc4)[_0x76aa('0x5f')](_0x5eeaa5)[_0x76aa('0x60')](_0x3e0315)[_0x76aa('0x2b')]();return _0x333a3a;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x76aa('0x31'),_0x76aa('0x3c'),_0x76aa('0x61'),_0x76aa('0x3d'),_0x76aa('0x44'),_0x76aa('0x35'),'userpic',_0x76aa('0x45'),_0x76aa('0x33'),_0x76aa('0x46'),_0x76aa('0x49'),_0x76aa('0x32'),_0x76aa('0x4'),_0x76aa('0x48'),'smsPause','voicePause',_0x76aa('0x7'),_0x76aa('0x11'),'faxStatus',_0x76aa('0x13'),_0x76aa('0x14'),'smsStatus',_0x76aa('0xf'),_0x76aa('0x15'),_0x76aa('0x55'),_0x76aa('0x58'),_0x76aa('0x56'),_0x76aa('0x62'),_0x76aa('0x63'),_0x76aa('0x59'),_0x76aa('0x57'),'chatCapacity',_0x76aa('0x4f'),'mailCapacity',_0x76aa('0x4b'),_0x76aa('0x4d'),_0x76aa('0x4e'),_0x76aa('0x64'),_0x76aa('0x53'),_0x76aa('0x50'),_0x76aa('0x65'),_0x76aa('0x51'),_0x76aa('0x52'),'phoneBarEnableScreenRecordingByAgent',_0x76aa('0x66'),_0x76aa('0x5b'),_0x76aa('0x67'),_0x76aa('0x5a'),_0x76aa('0x5e'),_0x76aa('0x5c')];}exports[_0x76aa('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x3f8a=['includes','order','startsWith','DESC','getUpdatedSortOptions','substring','indexOf','internal','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','role','openchannelStatusTime','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','map','findOne','getAgents','all','flatten','uniq','getAgentIdsByQueues','getAgentIdsByStatus','resolve','User','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','fields'];(function(_0x2d8daf,_0x52bfaf){var _0x3b93c4=function(_0x5a05c9){while(--_0x5a05c9){_0x2d8daf['push'](_0x2d8daf['shift']());}};_0x3b93c4(++_0x52bfaf);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3deb78,_0x5b8496){_0x3deb78=_0x3deb78-0x0;var _0x4d9808=_0x3f8a[_0x3deb78];return _0x4d9808;};'use strict';var _=require(_0xa3f8('0x0'));var jayson=require(_0xa3f8('0x1'));var db=require(_0xa3f8('0x2'))['db'];var amiClient=jayson[_0xa3f8('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xa3f8('0x3')][_0xa3f8('0x4')]({'port':0x232c});function isAgentPaused(_0x928738,_0x15b6aa){var _0x2553fd=[_0x928738[_0xa3f8('0x5')],_0x928738[_0xa3f8('0x6')],_0x928738[_0xa3f8('0x7')],_0x928738[_0xa3f8('0x8')],_0x928738[_0xa3f8('0x9')],_0x928738[_0xa3f8('0xa')],_0x928738[_0xa3f8('0xb')]];if(!_0x15b6aa)return _[_0xa3f8('0xc')](_0x2553fd);var _0x2448de=_[_0xa3f8('0xd')](_0x2553fd);return _0x2448de[_0xa3f8('0xe')]>0x0&&_0x2448de[_0xa3f8('0xe')]<_0x2553fd['length']?!![]:![];}function isIdle(_0x47496a){return _0x47496a===_0xa3f8('0xf')||_0x47496a===_0xa3f8('0x10')||_0x47496a===_0xa3f8('0x11')||_0x47496a==='ringing'||_[_0xa3f8('0x12')](_0x47496a);}function isAgentIdle(_0x26f0a0){if(_0x26f0a0[_0xa3f8('0x13')]!==_0xa3f8('0xf')&&_0x26f0a0[_0xa3f8('0xa')]){_0x26f0a0[_0xa3f8('0x13')]=_0xa3f8('0x14');return![];}return _[_0xa3f8('0xc')]([_0x26f0a0[_0xa3f8('0x15')],_0x26f0a0[_0xa3f8('0x16')],_0x26f0a0[_0xa3f8('0x17')],_0x26f0a0[_0xa3f8('0x18')],_0x26f0a0['smsStatus'],_0x26f0a0[_0xa3f8('0x13')],_0x26f0a0[_0xa3f8('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa3f8('0x1a')](_0xa3f8('0x1b'),{})['then'](function(_0x39c450){if(_0x39c450[_0xa3f8('0x1c')]){throw new Error(_0xa3f8('0x1d'));}var _0x8cd130=_0x39c450[_0xa3f8('0x1e')];return routingClient[_0xa3f8('0x1a')](_0xa3f8('0x1b'),{})[_0xa3f8('0x1f')](function(_0x2cb49f){if(_0x2cb49f[_0xa3f8('0x1c')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3ad8cd=_0x2cb49f['result'];return _[_0xa3f8('0x20')]({},_0x8cd130,_0x3ad8cd);});})[_0xa3f8('0x21')](function(_0x191f99){throw _0x191f99;});}exports[_0xa3f8('0x22')]=getRealtimeAgents;function getAgentStatus(_0x5c916e){var _0x1f0bb8='unknown';if(isAgentPaused(_0x5c916e))_0x1f0bb8=_0xa3f8('0x14');else if(isAgentPaused(_0x5c916e,!![]))_0x1f0bb8='*pause';else if(isAgentIdle(_0x5c916e))_0x1f0bb8=_0xa3f8('0xf');else _0x1f0bb8=_0xa3f8('0x23');return _0x1f0bb8;}exports[_0xa3f8('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x474893,_0x3a6a57){var _0x1e5f30=_[_0xa3f8('0x25')](_0x474893)?_0x474893:[_0x474893];var _0x490717=_[_0xa3f8('0x26')](_0x3a6a57)+'Queue';var _0x3ce57b=_[_0xa3f8('0x27')](_0x1e5f30,function(_0x24985a){return db[_0x490717][_0xa3f8('0x28')]({'where':{'id':_0x24985a}})[_0xa3f8('0x1f')](function(_0x2c5d10){if(!_0x2c5d10)return[];return _0x2c5d10[_0xa3f8('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa3f8('0x2a')](_0x3ce57b)[_0xa3f8('0x1f')](function(_0x1eb2b9){var _0x545a28=_(_0x1eb2b9)[_0xa3f8('0x2b')]()[_0xa3f8('0x27')]('id')[_0xa3f8('0x2c')]()['value']();return _0x545a28;});}exports[_0xa3f8('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57f6be,_0xbad6a6,_0x3a3746){try{if(_0xbad6a6[_0xa3f8('0xe')]>0x0){_0x57f6be=_0x57f6be['filter'](function(_0x458824){return _0xbad6a6['includes'](_0x458824['id']);});}var _0x21c57e=_0x57f6be[_0xa3f8('0xd')](function(_0x226153){var _0x406140=_0xa3f8('0x23');if(isAgentIdle(_0x226153)){_0x406140=_0xa3f8('0xf');}return _0x406140===_0x3a3746;});return _[_0xa3f8('0x27')](_0x21c57e,'id');}catch(_0x424a3e){throw _0x424a3e;}}exports[_0xa3f8('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x290a4e,_0x6e83b0,_0x57c465){return Promise[_0xa3f8('0x2f')]()[_0xa3f8('0x1f')](function(){if(_0x6e83b0[_0xa3f8('0xe')]>0x0){_0x290a4e=_0x290a4e[_0xa3f8('0xd')](function(_0x3bb4b0){return _0x6e83b0['includes'](_0x3bb4b0['id']);});}return _0x290a4e;})[_0xa3f8('0x1f')](function(){return db[_0xa3f8('0x30')]['findAll']({'attributes':['id',_0xa3f8('0x31'),_0xa3f8('0x32'),'chatPause',_0xa3f8('0x6'),'mailPause','openchannelPause',_0xa3f8('0x9'),_0xa3f8('0xa'),'whatsappPause',_0xa3f8('0x33')],'where':{'id':{'$in':_['map'](_0x290a4e,'id')}},'raw':!![]});})[_0xa3f8('0x1f')](function(_0x30a972){return _0x30a972[_0xa3f8('0x27')](function(_0x22e8ea){var _0x52a80b=_[_0xa3f8('0x34')](_0x290a4e,['id',_0x22e8ea['id']]);var _0x53c7b2=filterAgentAttributes(_0x52a80b);_[_0xa3f8('0x20')](_0x22e8ea,_0x53c7b2);_0x22e8ea['globalStatus']=getAgentStatus(_0x22e8ea);return _0x22e8ea;});})[_0xa3f8('0x1f')](function(_0x5f459a){var _0x5eca3c=sortAgentsByStatus(_0x5f459a,_0x57c465);return _['map'](_0x5eca3c,'id');})[_0xa3f8('0x21')](function(_0x1674f1){throw _0x1674f1;});}exports[_0xa3f8('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2ffeb3){var _0x4b93ba={'fields':[],'order':null};var _0x447824=_0x2ffeb3[_0xa3f8('0x36')](',');_0x4b93ba[_0xa3f8('0x37')]=_[_0xa3f8('0xd')](_0x447824,function(_0x238da1){if(!_0x238da1[_0xa3f8('0x38')]('globalStatus')){return!![];}_0x4b93ba[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x238da1,'-')?_0xa3f8('0x3b'):'ASC';return![];});return _0x4b93ba;}exports[_0xa3f8('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x110b23){if(!_0x110b23){_0x110b23='fullname,internal';}if(_0x110b23[_0xa3f8('0x38')]('fullname')&&!_0x110b23[_0xa3f8('0x38')]('internal')){var _0x9ede8d=_0x110b23[_0xa3f8('0x3d')](0x0,_0x110b23[_0xa3f8('0x3e')](_0xa3f8('0x32')));_0x110b23+=','+_0x9ede8d+_0xa3f8('0x3f');}return _0x110b23;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0xa6f0a4,_0x88108){var _0x4db9c5=_0xa6f0a4[_0xa3f8('0x40')](function(_0x4e13f1,_0x6ff4d4){if(_0x4e13f1[_0xa3f8('0x41')]===_0x6ff4d4[_0xa3f8('0x41')]){if(_0x4e13f1[_0xa3f8('0x41')]===_0xa3f8('0x14')){if(_0x88108==='DESC'){return(_0x4e13f1[_0xa3f8('0x33')]||'')<(_0x6ff4d4[_0xa3f8('0x33')]||'')||_0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()>_0x6ff4d4[_0xa3f8('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x4e13f1[_0xa3f8('0x33')]||'')<(_0x6ff4d4[_0xa3f8('0x33')]||'')||_0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()>_0x6ff4d4[_0xa3f8('0x32')][_0xa3f8('0x42')]()?-0x1:0x1;}}else{if(_0x88108===_0xa3f8('0x3b')){return _0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()<_0x6ff4d4[_0xa3f8('0x32')][_0xa3f8('0x42')]()?0x1:-0x1;}else{return _0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()<_0x6ff4d4['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0x88108==='DESC'){return _0x4e13f1[_0xa3f8('0x41')]<_0x6ff4d4[_0xa3f8('0x41')]?0x1:-0x1;}else{return _0x4e13f1[_0xa3f8('0x41')]<_0x6ff4d4[_0xa3f8('0x41')]?-0x1:0x1;}}});return _0x4db9c5;}exports[_0xa3f8('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x33a141){var _0x4a751f=[_0xa3f8('0x44'),_0xa3f8('0x45'),_0xa3f8('0x46'),_0xa3f8('0x47'),'pauseType',_0xa3f8('0x47'),_0xa3f8('0x3f'),_0xa3f8('0x48'),'chatPause','openchannelPause','mailPause',_0xa3f8('0x9'),_0xa3f8('0xb'),'faxPause',_0xa3f8('0xa'),_0xa3f8('0x49'),_0xa3f8('0x4a'),_0xa3f8('0x4b'),_0xa3f8('0x4c'),_0xa3f8('0x4d'),_0xa3f8('0x4e'),_0xa3f8('0x4f'),_0xa3f8('0x50'),_0xa3f8('0x51'),_0xa3f8('0x52'),_0xa3f8('0x53'),_0xa3f8('0x54'),_0xa3f8('0x15'),_0xa3f8('0x18'),_0xa3f8('0x17'),_0xa3f8('0x55'),'whatsappStatus','faxStatus',_0xa3f8('0x13'),_0xa3f8('0x56'),'openchannelStatusTime',_0xa3f8('0x57'),_0xa3f8('0x58'),_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),_0xa3f8('0x5c'),_0xa3f8('0x5d'),_0xa3f8('0x5e'),_0xa3f8('0x5f'),_0xa3f8('0x60'),_0xa3f8('0x61')];var _0x3752fa=[_0xa3f8('0x5'),_0xa3f8('0x8'),_0xa3f8('0x7'),_0xa3f8('0x9'),'whatsappPause','faxPause',_0xa3f8('0xa'),'online'];var _0x2410aa=_(_0x33a141)[_0xa3f8('0x62')](_0x3752fa)[_0xa3f8('0x63')](_0x4a751f)['value']();return _0x2410aa;}exports[_0xa3f8('0x64')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xa3f8('0x31'),_0xa3f8('0x32'),_0xa3f8('0x65'),'internal',_0xa3f8('0x45'),'globalStatus',_0xa3f8('0x44'),_0xa3f8('0x46'),_0xa3f8('0x33'),'lastPauseAt','faxPause',_0xa3f8('0x5'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9'),'voicePause',_0xa3f8('0xb'),_0xa3f8('0x15'),_0xa3f8('0x16'),_0xa3f8('0x17'),_0xa3f8('0x18'),'smsStatus','voiceStatus',_0xa3f8('0x19'),_0xa3f8('0x56'),_0xa3f8('0x5a'),_0xa3f8('0x57'),_0xa3f8('0x66'),_0xa3f8('0x58'),_0xa3f8('0x5b'),'whatsappStatusTime','chatCapacity','faxCapacity',_0xa3f8('0x4b'),_0xa3f8('0x4a'),_0xa3f8('0x4c'),_0xa3f8('0x4d'),_0xa3f8('0x4f'),_0xa3f8('0x54'),_0xa3f8('0x51'),_0xa3f8('0x50'),'smsCurrentCapacity',_0xa3f8('0x53'),_0xa3f8('0x5f'),_0xa3f8('0x60'),_0xa3f8('0x5d'),_0xa3f8('0x67'),_0xa3f8('0x5c'),_0xa3f8('0x61'),'screenrecording'];}exports[_0xa3f8('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 52de0d5..af95da6 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a2f=['dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedInDb','talking','originated','find','merge','initializeQueues','lodash','jayson/promise','util','http','client','available','loggedIn','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringInUse','unknown','pTalking','message','statusMessage','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold'];(function(_0xdd5e28,_0x175afa){var _0x4b7a61=function(_0x41776a){while(--_0x41776a){_0xdd5e28['push'](_0xdd5e28['shift']());}};_0x4b7a61(++_0x175afa);}(_0x6a2f,0xf8));var _0xf6a2=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0x6a2f[_0x5be7aa];return _0x215408;};'use strict';var _=require(_0xf6a2('0x0'));var jayson=require(_0xf6a2('0x1'));var util=require(_0xf6a2('0x2'));var amiClient=jayson['client'][_0xf6a2('0x3')]({'port':0x232a});var routingClient=jayson[_0xf6a2('0x4')][_0xf6a2('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xf6a2('0x5'),_0xf6a2('0x6'),_0xf6a2('0x7'),_0xf6a2('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0xf6a2('0x9'),_0xf6a2('0xa'),_0xf6a2('0xb'),'loggedInDb',_0xf6a2('0xc'),_0xf6a2('0xd'),'ringing',_0xf6a2('0xe'),'talking','unavailable',_0xf6a2('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xf6a2('0x10'),'originated',_0xf6a2('0x11'),_0xf6a2('0x12'),'dialActive',_0xf6a2('0x13'),_0xf6a2('0x14'),_0xf6a2('0x15'),_0xf6a2('0x16'),'erlangCalls',_0xf6a2('0x17'),_0xf6a2('0x18'),_0xf6a2('0x19'),'dialPredictiveInterval',_0xf6a2('0x1a'),_0xf6a2('0x1b'),_0xf6a2('0x1c'),_0xf6a2('0x1d'),_0xf6a2('0x1e'),_0xf6a2('0x1f'),_0xf6a2('0x20'),_0xf6a2('0x21'),_0xf6a2('0x22')];function getRealtimeQueues(_0xfc7dac,_0x7122d){var _0x2e3dce=_0x7122d===_0xf6a2('0x23')?amiClient:routingClient;return _0x2e3dce[_0xf6a2('0x24')](_[_0xf6a2('0x25')](_0x7122d)+_0xf6a2('0x26'),_0xfc7dac)['then'](function(_0x3f4d41){if(_0x3f4d41['error'])throw new Error(util[_0xf6a2('0x27')](_0xf6a2('0x28'),_0x7122d));return _0x3f4d41[_0xf6a2('0x29')];})[_0xf6a2('0x2a')](function(_0x476bef){throw _0x476bef;});}exports[_0xf6a2('0x2b')]=getRealtimeQueues;function initializeQueues(_0x37e239,_0x3a528e,_0x3213e1,_0x4cbc2e){var _0xe467cb=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3213e1===_0xf6a2('0x23')){if(_0x4cbc2e===_0xf6a2('0x2c')){_0xe467cb=_0xe467cb[_0xf6a2('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4cbc2e===_0xf6a2('0x2e')){_0xe467cb=_0xe467cb[_0xf6a2('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x37e239[_0xf6a2('0x2f')](function(_0x39df95){var _0x1c8bd1=_0x39df95[_0xf6a2('0x30')]({'plain':!![]});_0x1c8bd1['paused']=0x0;_0x1c8bd1[_0xf6a2('0x31')]=0x0;_0x1c8bd1[_0xf6a2('0x6')]=0x0;_0x1c8bd1[_0xf6a2('0x5')]=0x0;_0x1c8bd1[_0xf6a2('0x8')]=0x0;if(_0x3213e1===_0xf6a2('0x23')){_0x1c8bd1[_0xf6a2('0x32')]=0x0;_0x1c8bd1[_0xf6a2('0x9')]=0x0;if(_0x4cbc2e===_0xf6a2('0x2e')){_0x1c8bd1[_0xf6a2('0x10')]=0x0;_0x1c8bd1[_0xf6a2('0x33')]=0x0;}}var _0x30b03b=_[_0xf6a2('0x34')](_0x3a528e,['id',_0x1c8bd1['id']]);if(_0x30b03b){_[_0xf6a2('0x35')](_0x1c8bd1,_['pick'](_0x30b03b,_0xe467cb));}return _0x1c8bd1;});}exports[_0xf6a2('0x36')]=initializeQueues; \ No newline at end of file +var _0xeae5=['find','merge','pick','initializeQueues','jayson/promise','util','client','http','available','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','ringing','ringInUse','unavailable','pTalking','message','statusMessage','dialMethod','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedIn','originated'];(function(_0x34768e,_0x7eca56){var _0xd040f2=function(_0x43af85){while(--_0x43af85){_0x34768e['push'](_0x34768e['shift']());}};_0xd040f2(++_0x7eca56);}(_0xeae5,0x1ee));var _0x5eae=function(_0x23dc09,_0x5ab018){_0x23dc09=_0x23dc09-0x0;var _0x2e81ea=_0xeae5[_0x23dc09];return _0x2e81ea;};'use strict';var _=require('lodash');var jayson=require(_0x5eae('0x0'));var util=require(_0x5eae('0x1'));var amiClient=jayson[_0x5eae('0x2')][_0x5eae('0x3')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x5eae('0x4'),'loggedIn',_0x5eae('0x5'),_0x5eae('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x5eae('0x7'),_0x5eae('0x8'),_0x5eae('0x9'),_0x5eae('0xa'),_0x5eae('0xb'),'onHold',_0x5eae('0xc'),_0x5eae('0xd'),'talking',_0x5eae('0xe'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x5eae('0xf'),'originated',_0x5eae('0x10'),_0x5eae('0x11'),'dialActive',_0x5eae('0x12'),_0x5eae('0x13'),'startPredictive','startProgressive',_0x5eae('0x14'),_0x5eae('0x15'),_0x5eae('0x16'),_0x5eae('0x17'),_0x5eae('0x18'),_0x5eae('0x19'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x5eae('0x1a'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x5eae('0x1b'),_0x5eae('0x1c'),_0x5eae('0x1d')];function getRealtimeQueues(_0x4080fd,_0x1620ee){var _0x4a4554=_0x1620ee===_0x5eae('0x1e')?amiClient:routingClient;return _0x4a4554[_0x5eae('0x1f')](_[_0x5eae('0x20')](_0x1620ee)+_0x5eae('0x21'),_0x4080fd)[_0x5eae('0x22')](function(_0x93ebfd){if(_0x93ebfd['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1620ee));return _0x93ebfd[_0x5eae('0x23')];})[_0x5eae('0x24')](function(_0x2c9158){throw _0x2c9158;});}exports[_0x5eae('0x25')]=getRealtimeQueues;function initializeQueues(_0x2f8dc7,_0x4df81a,_0xb2c3f1,_0x5bed26){var _0x2f606a=DEFAULT_QUEUE_ATTRIBUTES;if(_0xb2c3f1===_0x5eae('0x1e')){if(_0x5bed26===_0x5eae('0x26')){_0x2f606a=_0x2f606a[_0x5eae('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5bed26===_0x5eae('0x28')){_0x2f606a=_0x2f606a[_0x5eae('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2f8dc7[_0x5eae('0x29')](function(_0x84e32d){var _0x2bdfbb=_0x84e32d[_0x5eae('0x2a')]({'plain':!![]});_0x2bdfbb[_0x5eae('0x5')]=0x0;_0x2bdfbb['loggedInDb']=0x0;_0x2bdfbb[_0x5eae('0x2b')]=0x0;_0x2bdfbb[_0x5eae('0x4')]=0x0;_0x2bdfbb['waiting']=0x0;if(_0xb2c3f1===_0x5eae('0x1e')){_0x2bdfbb['talking']=0x0;_0x2bdfbb[_0x5eae('0x7')]=0x0;if(_0x5bed26==='outbound'){_0x2bdfbb[_0x5eae('0xf')]=0x0;_0x2bdfbb[_0x5eae('0x2c')]=0x0;}}var _0x73858a=_[_0x5eae('0x2d')](_0x4df81a,['id',_0x2bdfbb['id']]);if(_0x73858a){_[_0x5eae('0x2e')](_0x2bdfbb,_[_0x5eae('0x2f')](_0x73858a,_0x2f606a));}return _0x2bdfbb;});}exports[_0x5eae('0x30')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 2191733..718e14d 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x354e7a,_0x4e4dc0){var _0x17b550=function(_0x3fe219){while(--_0x3fe219){_0x354e7a['push'](_0x354e7a['shift']());}};_0x17b550(++_0x4e4dc0);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 56763ce..8968900 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 _0x1f1e=['macAddress','ipAddress','digest','substring','lodash','bimedia-machine-uuid','../environment','networkInterfaces','orderBy','length','family','IPv4','internal','concat','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','hex','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x1fd9f3,_0x377f5){var _0x2efc66=function(_0x17e386){while(--_0x17e386){_0x1fd9f3['push'](_0x1fd9f3['shift']());}};_0x2efc66(++_0x377f5);}(_0x1f1e,0x112));var _0xe1f1=function(_0x102d77,_0x4c9013){_0x102d77=_0x102d77-0x0;var _0x1ef61b=_0x1f1e[_0x102d77];return _0x1ef61b;};'use strict';var _=require(_0xe1f1('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xe1f1('0x1'));var exec=require('child_process')['execSync'];var config=require(_0xe1f1('0x2'));function getInterfaces(){var _0xc54cb7=[];var _0x58a003=os[_0xe1f1('0x3')]();var _0x5dd5ad=_[_0xe1f1('0x4')](_['keys'](_0x58a003));for(var _0x2acc56=0x0;_0x2acc56<_0x5dd5ad[_0xe1f1('0x5')];_0x2acc56++){var _0x299827=_0x58a003[_0x5dd5ad[_0x2acc56]]['filter'](function(_0x944597){return _0x944597[_0xe1f1('0x6')]===_0xe1f1('0x7')&&_0x944597[_0xe1f1('0x8')]===![];});_0xc54cb7=_0xc54cb7[_0xe1f1('0x9')](_0x299827);}return _0xc54cb7;}function getFirstInterface(){var _0x18a608=_['head'](getInterfaces());return{'macAddress':_0x18a608&&_0x18a608[_0xe1f1('0xa')]?_0x18a608['mac']:'00:00:00:00:00:00','ipAddress':_0x18a608&&_0x18a608[_0xe1f1('0xb')]?_0x18a608[_0xe1f1('0xb')]:_0xe1f1('0xc')};}exports[_0xe1f1('0xd')]=getFirstInterface;function getCPUhash(){var _0x10d3df=_[_0xe1f1('0x4')](os[_0xe1f1('0xe')]()[_0xe1f1('0xf')](function(_0x4bab6c){return _0x4bab6c[_0xe1f1('0x10')];}))[_0xe1f1('0x11')](':');return crypto[_0xe1f1('0x12')](_0xe1f1('0x13'))['update'](_0x10d3df)['digest'](_0xe1f1('0x14'));}exports['getUuid']=function(){var _0x34ade3=os['platform']();var _0x425ee4=/[0-9a-f-]{36}/;if(config[_0xe1f1('0x15')]&&_0x425ee4['test'](config[_0xe1f1('0x15')])){return config['licenseToken'];}else if(_0x34ade3===_0xe1f1('0x16')){return exec(_0xe1f1('0x17'),{'encoding':_0xe1f1('0x18')})[_0xe1f1('0x19')]('\x0d\x0a','');}else{var _0x5d6ce1=getFirstInterface();var _0x5d3641=getCPUhash();var _0x39d148=_0x5d3641+'|'+os['hostname']()+'|'+_0x5d6ce1[_0xe1f1('0x1a')]+'|'+_0x5d6ce1[_0xe1f1('0x1b')];var _0x1403fa=crypto[_0xe1f1('0x12')](_0xe1f1('0x13'))['update'](_0x39d148)[_0xe1f1('0x1c')](_0xe1f1('0x14'));return _0x1403fa[_0xe1f1('0x1d')](0x0,0x8)+'-'+_0x1403fa[_0xe1f1('0x1d')](0x8,0xc)+'-'+_0x1403fa['substring'](0xc,0x10)+'-'+_0x1403fa[_0xe1f1('0x1d')](0x10,0x14)+'-'+_0x1403fa[_0xe1f1('0x1d')](0x14);}}; \ No newline at end of file +var _0x7e8b=['mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','map','model','md5','update','digest','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','bimedia-machine-uuid','child_process','../environment','keys','filter','family','internal','concat','head'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7e8b,0x8c));var _0xb7e8=function(_0xd33d44,_0x398fa4){_0xd33d44=_0xd33d44-0x0;var _0x3c1655=_0x7e8b[_0xd33d44];return _0x3c1655;};'use strict';var _=require(_0xb7e8('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xb7e8('0x1'));var exec=require(_0xb7e8('0x2'))['execSync'];var config=require(_0xb7e8('0x3'));function getInterfaces(){var _0x4fd015=[];var _0x2677ef=os['networkInterfaces']();var _0x405780=_['orderBy'](_[_0xb7e8('0x4')](_0x2677ef));for(var _0x3b0482=0x0;_0x3b0482<_0x405780['length'];_0x3b0482++){var _0xa25230=_0x2677ef[_0x405780[_0x3b0482]][_0xb7e8('0x5')](function(_0x22ce5b){return _0x22ce5b[_0xb7e8('0x6')]==='IPv4'&&_0x22ce5b[_0xb7e8('0x7')]===![];});_0x4fd015=_0x4fd015[_0xb7e8('0x8')](_0xa25230);}return _0x4fd015;}function getFirstInterface(){var _0x41e4aa=_[_0xb7e8('0x9')](getInterfaces());return{'macAddress':_0x41e4aa&&_0x41e4aa[_0xb7e8('0xa')]?_0x41e4aa[_0xb7e8('0xa')]:_0xb7e8('0xb'),'ipAddress':_0x41e4aa&&_0x41e4aa[_0xb7e8('0xc')]?_0x41e4aa[_0xb7e8('0xc')]:'127.0.0.1'};}exports[_0xb7e8('0xd')]=getFirstInterface;function getCPUhash(){var _0x250eb6=_[_0xb7e8('0xe')](os['cpus']()[_0xb7e8('0xf')](function(_0x23aae0){return _0x23aae0[_0xb7e8('0x10')];}))['join'](':');return crypto['createHash'](_0xb7e8('0x11'))[_0xb7e8('0x12')](_0x250eb6)[_0xb7e8('0x13')]('hex');}exports['getUuid']=function(){var _0x4f7549=os['platform']();var _0x1852eb=/[0-9a-f-]{36}/;if(config[_0xb7e8('0x14')]&&_0x1852eb[_0xb7e8('0x15')](config['licenseToken'])){return config[_0xb7e8('0x14')];}else if(_0x4f7549===_0xb7e8('0x16')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xb7e8('0x17')})[_0xb7e8('0x18')]('\x0d\x0a','');}else{var _0x28b95a=getFirstInterface();var _0x9d8302=getCPUhash();var _0x3c1892=_0x9d8302+'|'+os[_0xb7e8('0x19')]()+'|'+_0x28b95a[_0xb7e8('0x1a')]+'|'+_0x28b95a[_0xb7e8('0x1b')];var _0x2cc4bd=crypto[_0xb7e8('0x1c')](_0xb7e8('0x11'))['update'](_0x3c1892)['digest']('hex');return _0x2cc4bd[_0xb7e8('0x1d')](0x0,0x8)+'-'+_0x2cc4bd['substring'](0x8,0xc)+'-'+_0x2cc4bd[_0xb7e8('0x1d')](0xc,0x10)+'-'+_0x2cc4bd[_0xb7e8('0x1d')](0x10,0x14)+'-'+_0x2cc4bd[_0xb7e8('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index b30d9ce..39cd119 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 _0x7c27=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','version','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data1','then','active','license','data2','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','update','diff','decryptString','DEMO\x20START\x20AT\x20%s','catch'];(function(_0x5f3094,_0x33af18){var _0x2b452d=function(_0x3385a6){while(--_0x3385a6){_0x5f3094['push'](_0x5f3094['shift']());}};_0x2b452d(++_0x33af18);}(_0x7c27,0xc6));var _0x77c2=function(_0x1229df,_0x39bc91){_0x1229df=_0x1229df-0x0;var _0x28301f=_0x7c27[_0x1229df];return _0x28301f;};'use strict';var util=require(_0x77c2('0x0'));var moment=require(_0x77c2('0x1'));var rp=require(_0x77c2('0x2'));var BPromise=require(_0x77c2('0x3'));var pkginfo=require('pkginfo')(module,_0x77c2('0x4'));var db=require(_0x77c2('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x77c2('0x6'));var logger=require(_0x77c2('0x7'))('license');var HOST=_0x77c2('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xf8231d){return new BPromise(function(_0x2c27dd,_0xee3354){var _0x534435=util[_0x77c2('0x9')](_0x77c2('0xa'),HOST,_0xf8231d,module[_0x77c2('0xb')]['version']);if(oldToken){_0x534435=util[_0x77c2('0x9')](_0x77c2('0xc'),HOST,_0xf8231d,module[_0x77c2('0xb')][_0x77c2('0x4')],oldToken);}var _0x2e8d28={'uri':_0x534435,'method':_0x77c2('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2e8d28)['then'](function(_0x37a1e4){_0x2c27dd(_0x37a1e4);})['catch'](function(_0x3f62a9){_0xee3354(_0x3f62a9);});});}function manageLicense(_0xda6c03,_0x5b64f9){var _0x2ab5ca=_0x5b64f9[_0x77c2('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x2ab5ca[_0x77c2('0xf')]!==_0xda6c03&&!_0x2ab5ca['data2']){oldToken=_0x2ab5ca[_0x77c2('0xf')];}httpRequest(_0xda6c03)[_0x77c2('0x10')](function(_0x23cb49){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x23cb49[_0x77c2('0x11')]){isOldTokenSent=![];if(!_0x2ab5ca[_0x77c2('0x12')]&&_0x2ab5ca[_0x77c2('0x12')]!=_0x23cb49[_0x77c2('0x12')]||_0x2ab5ca[_0x77c2('0x12')]&&_0x2ab5ca[_0x77c2('0x13')]){logger[_0x77c2('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2ab5ca[_0x77c2('0x12')]&&!_0x2ab5ca['data2']&&_0x2ab5ca[_0x77c2('0x12')]!=_0x23cb49['license']){logger[_0x77c2('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2ab5ca[_0x77c2('0x12')]&&!_0x2ab5ca[_0x77c2('0x13')]&&_0x2ab5ca[_0x77c2('0x12')]==_0x23cb49[_0x77c2('0x12')]){return _0x5b64f9;}return _0x5b64f9['update']({'data1':_0xda6c03,'data2':null,'license':_0x23cb49[_0x77c2('0x12')]});}else{if(_0x23cb49[_0x77c2('0x12')]||_0x2ab5ca[_0x77c2('0x12')]){if(!_0x2ab5ca['data2']){if(_0x2ab5ca[_0x77c2('0xf')]==_0xda6c03){GRAY_PERIOD_REASON=_0x77c2('0x15');logger[_0x77c2('0x14')](_0x77c2('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x77c2('0x14')](_0x77c2('0x17'),_0x2ab5ca[_0x77c2('0xf')],_0xda6c03);}logger[_0x77c2('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x77c2('0x9')](_0x77c2('0x18')));return _0x5b64f9[_0x77c2('0x19')]({'data2':encryptor['encryptString'](moment()[_0x77c2('0x9')](_0x77c2('0x18')))});}else{if(moment()[_0x77c2('0x1a')](encryptor[_0x77c2('0x1b')](_0x2ab5ca[_0x77c2('0x13')]),'days')>DAYS){logger[_0x77c2('0x14')](_0x77c2('0x1c'),moment()['format'](_0x77c2('0x18')));isOldTokenSent=![];return _0x5b64f9[_0x77c2('0x19')]({'data1':_0xda6c03,'data2':null,'license':null});}}}else{if(_0x2ab5ca['data1']!=_0xda6c03){logger[_0x77c2('0x14')](_0x77c2('0x17'),_0x2ab5ca[_0x77c2('0xf')],_0xda6c03);return _0x5b64f9[_0x77c2('0x19')]({'data1':_0xda6c03,'data2':null,'license':null});}}}return _0x5b64f9;})[_0x77c2('0x10')](function(_0x2e34ad){_0x5b64f9=_0x2e34ad;})[_0x77c2('0x1d')](function(_0xad9817){logger['error'](_0xad9817['message']);})[_0x77c2('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x77c2('0x1f')](),_0x5b64f9);},TIME);});}function defaultLicense(){var _0x4a27c9=hardware[_0x77c2('0x1f')]();if(_0x4a27c9){return db[_0x77c2('0x20')][_0x77c2('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x4a27c9}})[_0x77c2('0x22')](function(_0x550be2,_0x4cc621){logger[_0x77c2('0x14')](_0x77c2('0x23'),_0x4a27c9);manageLicense(_0x4a27c9,_0x550be2);})[_0x77c2('0x1d')](function(_0x5e8a19){logger[_0x77c2('0x24')](_0x5e8a19['message']);});}}exports[_0x77c2('0x25')]=defaultLicense; \ No newline at end of file +var _0x7bab=['data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','catch'];(function(_0x1c3cb1,_0x4380cc){var _0x5967c6=function(_0xf8fc7a){while(--_0xf8fc7a){_0x1c3cb1['push'](_0x1c3cb1['shift']());}};_0x5967c6(++_0x4380cc);}(_0x7bab,0x193));var _0xb7ba=function(_0x4e9520,_0x5ab95c){_0x4e9520=_0x4e9520-0x0;var _0x5f515e=_0x7bab[_0x4e9520];return _0x5f515e;};'use strict';var util=require(_0xb7ba('0x0'));var moment=require(_0xb7ba('0x1'));var rp=require(_0xb7ba('0x2'));var BPromise=require(_0xb7ba('0x3'));var pkginfo=require(_0xb7ba('0x4'))(module,_0xb7ba('0x5'));var db=require(_0xb7ba('0x6'))['db'];var encryptor=require(_0xb7ba('0x7'));var hardware=require(_0xb7ba('0x8'));var logger=require(_0xb7ba('0x9'))(_0xb7ba('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5595be){return new BPromise(function(_0x1162e0,_0x2d2fee){var _0x597da0=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x5595be,module['exports'][_0xb7ba('0x5')]);if(oldToken){_0x597da0=util[_0xb7ba('0xb')](_0xb7ba('0xc'),HOST,_0x5595be,module[_0xb7ba('0xd')][_0xb7ba('0x5')],oldToken);}var _0x377284={'uri':_0x597da0,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x377284)['then'](function(_0x1c062f){_0x1162e0(_0x1c062f);})[_0xb7ba('0xe')](function(_0x20fd24){_0x2d2fee(_0x20fd24);});});}function manageLicense(_0x354c71,_0x2c5444){var _0x5504b7=_0x2c5444['get']({'plain':!![]});if(!isOldTokenSent&&_0x5504b7[_0xb7ba('0xf')]!==_0x354c71&&!_0x5504b7[_0xb7ba('0x10')]){oldToken=_0x5504b7['data1'];}httpRequest(_0x354c71)[_0xb7ba('0x11')](function(_0x3d59bc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3d59bc[_0xb7ba('0x12')]){isOldTokenSent=![];if(!_0x5504b7[_0xb7ba('0xa')]&&_0x5504b7[_0xb7ba('0xa')]!=_0x3d59bc['license']||_0x5504b7[_0xb7ba('0xa')]&&_0x5504b7[_0xb7ba('0x10')]){logger[_0xb7ba('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5504b7[_0xb7ba('0xa')]&&!_0x5504b7[_0xb7ba('0x10')]&&_0x5504b7['license']!=_0x3d59bc[_0xb7ba('0xa')]){logger[_0xb7ba('0x13')](_0xb7ba('0x14'));}if(_0x5504b7[_0xb7ba('0xa')]&&!_0x5504b7[_0xb7ba('0x10')]&&_0x5504b7[_0xb7ba('0xa')]==_0x3d59bc[_0xb7ba('0xa')]){return _0x2c5444;}return _0x2c5444[_0xb7ba('0x15')]({'data1':_0x354c71,'data2':null,'license':_0x3d59bc[_0xb7ba('0xa')]});}else{if(_0x3d59bc['license']||_0x5504b7[_0xb7ba('0xa')]){if(!_0x5504b7[_0xb7ba('0x10')]){if(_0x5504b7[_0xb7ba('0xf')]==_0x354c71){GRAY_PERIOD_REASON=_0xb7ba('0x16');logger[_0xb7ba('0x13')](_0xb7ba('0x17'));}else{GRAY_PERIOD_REASON=_0xb7ba('0x18');logger[_0xb7ba('0x13')](_0xb7ba('0x19'),_0x5504b7[_0xb7ba('0xf')],_0x354c71);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xb7ba('0xb')](_0xb7ba('0x1a')));return _0x2c5444['update']({'data2':encryptor[_0xb7ba('0x1b')](moment()[_0xb7ba('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xb7ba('0x1c')](encryptor[_0xb7ba('0x1d')](_0x5504b7['data2']),_0xb7ba('0x1e'))>DAYS){logger['info'](_0xb7ba('0x1f'),moment()['format'](_0xb7ba('0x1a')));isOldTokenSent=![];return _0x2c5444[_0xb7ba('0x15')]({'data1':_0x354c71,'data2':null,'license':null});}}}else{if(_0x5504b7[_0xb7ba('0xf')]!=_0x354c71){logger[_0xb7ba('0x13')](_0xb7ba('0x19'),_0x5504b7['data1'],_0x354c71);return _0x2c5444['update']({'data1':_0x354c71,'data2':null,'license':null});}}}return _0x2c5444;})[_0xb7ba('0x11')](function(_0x15933b){_0x2c5444=_0x15933b;})[_0xb7ba('0xe')](function(_0xfeac97){logger[_0xb7ba('0x20')](_0xfeac97['message']);})[_0xb7ba('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xb7ba('0x22')](),_0x2c5444);},TIME);});}function defaultLicense(){var _0x435798=hardware[_0xb7ba('0x22')]();if(_0x435798){return db[_0xb7ba('0x23')][_0xb7ba('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x435798}})['spread'](function(_0x2caa9c,_0x4437ac){logger[_0xb7ba('0x13')](_0xb7ba('0x25'),_0x435798);manageLicense(_0x435798,_0x2caa9c);})[_0xb7ba('0xe')](function(_0x53d8ba){logger['error'](_0x53d8ba['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 36b9e99..5b1f0a1 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 _0xe32f=['format','%s:%s:%s','parse','machineUuid','gray','add','grayReason','changed','disabled','message','findAll','COUNT','sequelize','role','admin','user','telephone','forEach','count','pick','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe32f,0x1c3));var _0xfe32=function(_0xed9982,_0x485849){_0xed9982=_0xed9982-0x0;var _0x4216f6=_0xe32f[_0xed9982];return _0x4216f6;};'use strict';var util=require(_0xfe32('0x0'));var _=require(_0xfe32('0x1'));var moment=require(_0xfe32('0x2'));var BPromise=require(_0xfe32('0x3'));var hardware=require(_0xfe32('0x4'));var encryptor=require(_0xfe32('0x5'));var db=require(_0xfe32('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfe32('0x7'),'machineUuid':hardware[_0xfe32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfe32('0x9'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xfe32('0xa'),'machineUuid':hardware[_0xfe32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x124838){return new BPromise(function(_0x5056d1,_0x1db848){return db['License']['find'](_[_0xfe32('0xb')](_0x124838,{'raw':!![],'where':{'id':0x1}}))[_0xfe32('0xc')](function(_0x52b401){return checkLicense(_0x52b401,null);})[_0xfe32('0xc')](function(_0x445600){_0x5056d1(_0x445600);return;})[_0xfe32('0xd')](function(_0x506d1d){_0x1db848(_0x506d1d);});});}function checkLicense(_0x546f74,_0x2e494a){if(!_0x546f74){demoLicense[_0xfe32('0xe')]=_0x546f74[_0xfe32('0xf')];return demoLicense;}try{var _0x3af9fb=_0x2e494a||_0x546f74[_0xfe32('0x10')];if(_[_0xfe32('0x11')](_0x3af9fb)){throw new Error(_0xfe32('0x12'));}var _0x28e1e2=_0x546f74['data1'];var _0x7437e0=_0x546f74[_0xfe32('0x13')];var _0x2aaba0=_0x28e1e2[_0xfe32('0x14')]('-')[0x4];var _0x2cf406=_0x28e1e2['split']('-')[0x0];var _0x1f73a7=encryptor[_0xfe32('0x15')](_0x3af9fb,util[_0xfe32('0x16')](_0xfe32('0x17'),_0x2aaba0,_0x28e1e2,_0x2cf406));var _0x52af05=JSON[_0xfe32('0x18')](_0x1f73a7);_0x52af05['demo']=![];_0x52af05[_0xfe32('0xe')]=_0x28e1e2;_0x52af05[_0xfe32('0x19')]=hardware['getUuid']();if(_0x7437e0){var _0x2dbfa0=encryptor[_0xfe32('0x15')](_0x7437e0);_0x52af05[_0xfe32('0x1a')]=_0x2dbfa0;_0x52af05['deadline']=moment(_0x2dbfa0)[_0xfe32('0x1b')](0x7,'days')[_0xfe32('0x16')]();_0x52af05[_0xfe32('0x1c')]=_0x52af05[_0xfe32('0xe')]!=_0x52af05[_0xfe32('0x19')]?_0xfe32('0x1d'):_0xfe32('0x1e');}return _0x52af05;}catch(_0xb6b6b4){breakingLicense['uuid']=_0x546f74[_0xfe32('0xf')];breakingLicense[_0xfe32('0x1f')]=_0xb6b6b4[_0xfe32('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x41ca82,_0x560990){getLicense()[_0xfe32('0xc')](function(_0x3a9ebc){return db['User'][_0xfe32('0x20')]({'attributes':['role',[db['sequelize']['fn'](_0xfe32('0x21'),db[_0xfe32('0x22')]['col'](_0xfe32('0x23'))),'count']],'group':'role','where':{'role':{'$or':[_0xfe32('0x24'),_0xfe32('0x25'),_0xfe32('0x26')]}},'raw':!![]})[_0xfe32('0xc')](function(_0x41c5c9){var _0x5021a6={'user':_0x3a9ebc['users']||0x0,'telephone':_0x3a9ebc['telephones']||0x0};_0x41c5c9[_0xfe32('0x27')](function(_0x2155cb){var _0x158089=_0x2155cb['role']==='admin'?_0xfe32('0x25'):_0x2155cb[_0xfe32('0x23')];_0x5021a6[_0x158089]-=_0x2155cb[_0xfe32('0x28')];if(_0x5021a6[_0x158089]<0x0)_0x5021a6[_0x158089]=0x0;});_0x41ca82(_0x5021a6);return;});})[_0xfe32('0xd')](function(_0xf475d3){_0x560990(_0xf475d3);});});}function checkUserLimits(_0xd17029){return new BPromise(function(_0x50e267,_0x37ec2f){getLimits()[_0xfe32('0xc')](function(_0x4fa8d7){var _0x4396f8=_[_0xfe32('0x29')](_['countBy'](_0xd17029,_0xfe32('0x23')),[_0xfe32('0x24'),_0xfe32('0x25'),_0xfe32('0x26')]);var _0x1c2087=(_0x4396f8[_0xfe32('0x24')]||0x0)+(_0x4396f8['user']||0x0);var _0x20fc1c=_0x4396f8[_0xfe32('0x26')]||0x0;if(_0x1c2087>_0x4fa8d7[_0xfe32('0x25')])return _0x37ec2f('License\x20limit\x20reached\x20for\x20users');if(_0x20fc1c>_0x4fa8d7[_0xfe32('0x26')])return _0x37ec2f('License\x20limit\x20reached\x20for\x20telephones');return _0x50e267();})[_0xfe32('0xd')](function(_0x2c3dd3){_0x37ec2f(_0x2c3dd3);});});}module[_0xfe32('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xfa09=['./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','machineUuid','gray','deadline','days','grayReason','changed','disabled','message','findAll','COUNT','sequelize','col','role','count','admin','user','telephone','users','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird'];(function(_0x2b34b0,_0x279048){var _0x3c88d4=function(_0x11325e){while(--_0x11325e){_0x2b34b0['push'](_0x2b34b0['shift']());}};_0x3c88d4(++_0x279048);}(_0xfa09,0x10b));var _0x9fa0=function(_0x164a45,_0x2e5ba1){_0x164a45=_0x164a45-0x0;var _0x2aad8d=_0xfa09[_0x164a45];return _0x2aad8d;};'use strict';var util=require(_0x9fa0('0x0'));var _=require('lodash');var moment=require(_0x9fa0('0x1'));var BPromise=require(_0x9fa0('0x2'));var hardware=require(_0x9fa0('0x3'));var encryptor=require(_0x9fa0('0x4'));var db=require(_0x9fa0('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9fa0('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9fa0('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x9fa0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x482c8f){return new BPromise(function(_0x18e6fb,_0x49adb9){return db[_0x9fa0('0x8')][_0x9fa0('0x9')](_[_0x9fa0('0xa')](_0x482c8f,{'raw':!![],'where':{'id':0x1}}))[_0x9fa0('0xb')](function(_0x240b42){return checkLicense(_0x240b42,null);})[_0x9fa0('0xb')](function(_0x529208){_0x18e6fb(_0x529208);return;})['catch'](function(_0x412da9){_0x49adb9(_0x412da9);});});}function checkLicense(_0x59921e,_0x9fedc4){if(!_0x59921e){demoLicense[_0x9fa0('0xc')]=_0x59921e[_0x9fa0('0xd')];return demoLicense;}try{var _0x588f87=_0x9fedc4||_0x59921e['license'];if(_[_0x9fa0('0xe')](_0x588f87)){throw new Error(_0x9fa0('0xf'));}var _0x5c6110=_0x59921e[_0x9fa0('0xd')];var _0x2fe3b3=_0x59921e[_0x9fa0('0x10')];var _0x24b6a3=_0x5c6110[_0x9fa0('0x11')]('-')[0x4];var _0x200f1f=_0x5c6110[_0x9fa0('0x11')]('-')[0x0];var _0x373a5f=encryptor[_0x9fa0('0x12')](_0x588f87,util[_0x9fa0('0x13')]('%s:%s:%s',_0x24b6a3,_0x5c6110,_0x200f1f));var _0x2742fd=JSON['parse'](_0x373a5f);_0x2742fd['demo']=![];_0x2742fd[_0x9fa0('0xc')]=_0x5c6110;_0x2742fd[_0x9fa0('0x14')]=hardware['getUuid']();if(_0x2fe3b3){var _0xecd428=encryptor[_0x9fa0('0x12')](_0x2fe3b3);_0x2742fd[_0x9fa0('0x15')]=_0xecd428;_0x2742fd[_0x9fa0('0x16')]=moment(_0xecd428)['add'](0x7,_0x9fa0('0x17'))[_0x9fa0('0x13')]();_0x2742fd[_0x9fa0('0x18')]=_0x2742fd[_0x9fa0('0xc')]!=_0x2742fd[_0x9fa0('0x14')]?_0x9fa0('0x19'):_0x9fa0('0x1a');}return _0x2742fd;}catch(_0x597707){breakingLicense[_0x9fa0('0xc')]=_0x59921e[_0x9fa0('0xd')];breakingLicense[_0x9fa0('0x1b')]=_0x597707['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x6f61fc,_0x26f087){getLicense()[_0x9fa0('0xb')](function(_0x5bdfa9){return db['User'][_0x9fa0('0x1c')]({'attributes':['role',[db['sequelize']['fn'](_0x9fa0('0x1d'),db[_0x9fa0('0x1e')][_0x9fa0('0x1f')](_0x9fa0('0x20'))),_0x9fa0('0x21')]],'group':_0x9fa0('0x20'),'where':{'role':{'$or':[_0x9fa0('0x22'),_0x9fa0('0x23'),_0x9fa0('0x24')]}},'raw':!![]})[_0x9fa0('0xb')](function(_0x30c93b){var _0x3dd471={'user':_0x5bdfa9[_0x9fa0('0x25')]||0x0,'telephone':_0x5bdfa9[_0x9fa0('0x26')]||0x0};_0x30c93b[_0x9fa0('0x27')](function(_0x2fe2a7){var _0x51c39f=_0x2fe2a7['role']===_0x9fa0('0x22')?_0x9fa0('0x23'):_0x2fe2a7[_0x9fa0('0x20')];_0x3dd471[_0x51c39f]-=_0x2fe2a7[_0x9fa0('0x21')];if(_0x3dd471[_0x51c39f]<0x0)_0x3dd471[_0x51c39f]=0x0;});_0x6f61fc(_0x3dd471);return;});})[_0x9fa0('0x28')](function(_0x4f6ae0){_0x26f087(_0x4f6ae0);});});}function checkUserLimits(_0x386e05){return new BPromise(function(_0x14b4b2,_0x5a45ae){getLimits()['then'](function(_0x5c5667){var _0xf30ace=_[_0x9fa0('0x29')](_[_0x9fa0('0x2a')](_0x386e05,_0x9fa0('0x20')),[_0x9fa0('0x22'),_0x9fa0('0x23'),_0x9fa0('0x24')]);var _0x54620f=(_0xf30ace[_0x9fa0('0x22')]||0x0)+(_0xf30ace[_0x9fa0('0x23')]||0x0);var _0x32968c=_0xf30ace['telephone']||0x0;if(_0x54620f>_0x5c5667[_0x9fa0('0x23')])return _0x5a45ae('License\x20limit\x20reached\x20for\x20users');if(_0x32968c>_0x5c5667[_0x9fa0('0x24')])return _0x5a45ae(_0x9fa0('0x2b'));return _0x14b4b2();})[_0x9fa0('0x28')](function(_0x4b19fe){_0x5a45ae(_0x4b19fe);});});}module[_0x9fa0('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 272763c..251920c 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 _0xd943=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd943,0x15d));var _0x3d94=function(_0x3c2228,_0x5df513){_0x3c2228=_0x3c2228-0x0;var _0x1919db=_0xd943[_0x3c2228];return _0x1919db;};'use strict';module[_0x3d94('0x0')]={'DOMAIN':_0x3d94('0x1'),'SESSION_SECRET':_0x3d94('0x2'),'GOOGLE_ID':_0x3d94('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x2032=['app-id','http://localhost:9000','myappanuglar-secret'];(function(_0x16a0f3,_0x47e087){var _0x41384e=function(_0x3bca3c){while(--_0x3bca3c){_0x16a0f3['push'](_0x16a0f3['shift']());}};_0x41384e(++_0x47e087);}(_0x2032,0xd9));var _0x2203=function(_0x3d497b,_0x3f5766){_0x3d497b=_0x3d497b-0x0;var _0xf9fd5d=_0x2032[_0x3d497b];return _0xf9fd5d;};'use strict';module['exports']={'DOMAIN':_0x2203('0x0'),'SESSION_SECRET':_0x2203('0x1'),'GOOGLE_ID':_0x2203('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 054c075..12e69e4 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf088=['exports','../utils/loggers'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf088,0xb7));var _0x8f08=function(_0x522caf,_0x1bb991){_0x522caf=_0x522caf-0x0;var _0x29cdc2=_0xf088[_0x522caf];return _0x29cdc2;};'use strict';var fileLogger=require(_0x8f08('0x0'))['fileLogger'];module[_0x8f08('0x1')]=fileLogger; \ No newline at end of file +var _0x131a=['fileLogger','../utils/loggers'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x131a,0x187));var _0xa131=function(_0xfa5997,_0x20efa0){_0xfa5997=_0xfa5997-0x0;var _0x434998=_0x131a[_0xfa5997];return _0x434998;};'use strict';var fileLogger=require(_0xa131('0x0'))[_0xa131('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 4f4ce06..388a3dc 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 _0x0704=['express','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr','exports','path','../../config/environment','resolve','join','root','legacy-libs'];(function(_0x5c3177,_0x280bab){var _0x332ba5=function(_0x27e0dc){while(--_0x27e0dc){_0x5c3177['push'](_0x5c3177['shift']());}};_0x332ba5(++_0x280bab);}(_0x0704,0x10a));var _0x4070=function(_0x3133cb,_0x4ff642){_0x3133cb=_0x3133cb-0x0;var _0x3dbcb3=_0x0704[_0x3133cb];return _0x3dbcb3;};'use strict';var path=require(_0x4070('0x0'));var cfg=require(_0x4070('0x1'));var env={'NODE_PATH':path[_0x4070('0x2')](path[_0x4070('0x3')](cfg[_0x4070('0x4')],_0x4070('0x5')))};var pm2config={'apps':[{'name':_0x4070('0x6'),'script':path[_0x4070('0x3')](__dirname,_0x4070('0x7')),'env':env},{'name':_0x4070('0x8'),'script':path['join'](__dirname,_0x4070('0x9')),'env':env},{'name':'agi','script':path[_0x4070('0x3')](__dirname,_0x4070('0xa')),'env':env},{'name':_0x4070('0xb'),'script':path[_0x4070('0x3')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x4070('0xc'),'script':path[_0x4070('0x3')](__dirname,_0x4070('0xd')),'env':env},{'name':_0x4070('0xe'),'script':path[_0x4070('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x4070('0xf')]=pm2config; \ No newline at end of file +var _0x163c=['../../config/environment','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x163c,0x1cb));var _0xc163=function(_0x46aaa8,_0x250a83){_0x46aaa8=_0x46aaa8-0x0;var _0x981ffa=_0x163c[_0x46aaa8];return _0x981ffa;};'use strict';var path=require('path');var cfg=require(_0xc163('0x0'));var env={'NODE_PATH':path[_0xc163('0x1')](path[_0xc163('0x2')](cfg[_0xc163('0x3')],_0xc163('0x4')))};var pm2config={'apps':[{'name':_0xc163('0x5'),'script':path['join'](__dirname,_0xc163('0x6')),'env':env},{'name':_0xc163('0x7'),'script':path['join'](__dirname,_0xc163('0x8')),'env':env},{'name':_0xc163('0x9'),'script':path['join'](__dirname,_0xc163('0xa')),'env':env},{'name':_0xc163('0xb'),'script':path[_0xc163('0x2')](__dirname,_0xc163('0xc')),'env':env},{'name':'routing','script':path[_0xc163('0x2')](__dirname,_0xc163('0xd')),'env':env},{'name':_0xc163('0xe'),'script':path[_0xc163('0x2')](__dirname,_0xc163('0xf')),'env':env}]};module[_0xc163('0x10')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 27cbacb..06e7c08 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 _0xc20e=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','connected','start','then','disconnect'];(function(_0x5ee89d,_0x1a7c29){var _0x3fa4cc=function(_0x397114){while(--_0x397114){_0x5ee89d['push'](_0x5ee89d['shift']());}};_0x3fa4cc(++_0x1a7c29);}(_0xc20e,0x1e3));var _0xec20=function(_0x5414d8,_0x477b1e){_0x5414d8=_0x5414d8-0x0;var _0x2ed957=_0xc20e[_0x5414d8];return _0x2ed957;};'use strict';var pm2=require(_0xec20('0x0'));var BPromise=require(_0xec20('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x4b89a4,_0x2f88a1){return pm2[_0xec20('0x2')](function(_0xa0e29c){if(_0xa0e29c){return _0x2f88a1(_0xa0e29c);}return _0x4b89a4(_0xec20('0x3'));});});};exports[_0xec20('0x4')]=function(_0x4c738a){return connect()[_0xec20('0x5')](function(){return new BPromise(function(_0x1adc71,_0x16aa3b){return pm2[_0xec20('0x4')](_0x4c738a,function(_0x550cd0,_0x67a828){if(_0x550cd0){return _0x16aa3b(_0x550cd0);}pm2[_0xec20('0x6')]();return _0x1adc71(_0x67a828);});});});};exports[_0xec20('0x7')]=function(_0x5db0f9){return connect()[_0xec20('0x5')](function(){return new BPromise(function(_0x4dad31,_0x391193){return pm2[_0xec20('0x7')](_0x5db0f9,function(_0x19ae3b,_0x5e7aba){if(_0x19ae3b){return _0x391193(_0x19ae3b);}pm2[_0xec20('0x6')]();return _0x4dad31(_0x5e7aba);});});});};exports['restart']=function(_0x3c30f0){return connect()[_0xec20('0x5')](function(){return new BPromise(function(_0x582998,_0x22bfcf){return pm2[_0xec20('0x8')](_0x3c30f0,function(_0x581004,_0x57cbff){if(_0x581004){return _0x22bfcf(_0x581004);}pm2[_0xec20('0x6')]();return _0x582998(_0x57cbff);});});});};exports[_0xec20('0x9')]=function(){return connect()[_0xec20('0x5')](function(){return new BPromise(function(_0xcd2ef9,_0x279609){return pm2['list'](function(_0x5eaab2,_0x5039c6){if(_0x5eaab2){return _0x279609(_0x5eaab2);}pm2[_0xec20('0x6')]();return _0xcd2ef9(_0x5039c6);});});});};exports[_0xec20('0xa')]=function(_0x28e95a){return connect()['then'](function(){return new BPromise(function(_0x2dff39,_0x41669a){return pm2[_0xec20('0xa')](_0x28e95a,function(_0x2f85b7,_0x46d70a){if(_0x2f85b7){return _0x41669a(_0x2f85b7);}pm2[_0xec20('0x6')]();return _0x2dff39(_0x46d70a);});});});};exports['delete']=function(_0x4aab9d){return connect()['then'](function(){return new BPromise(function(_0x4ce3ec,_0x1cc036){return pm2[_0xec20('0xb')](_0x4aab9d,function(_0x9fab95,_0x3806ee){if(_0x9fab95){return _0x1cc036(_0x9fab95);}pm2[_0xec20('0x6')]();return _0x4ce3ec(_0x3806ee);});});});};exports['dump']=function(){return connect()[_0xec20('0x5')](function(){return new BPromise(function(_0x11a3f3,_0x2641b3){return pm2[_0xec20('0xc')](function(_0x245745){if(_0x245745){return _0x2641b3(_0x245745);}return _0x11a3f3(_0xec20('0xd'));});});});}; \ No newline at end of file +var _0xc1e6=['connected','start','disconnect','stop','then','restart','list','describe','delete','saved','bluebird','./config'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0xc1e6,0x15a));var _0x6c1e=function(_0x136936,_0x3e7685){_0x136936=_0x136936-0x0;var _0x2965d3=_0xc1e6[_0x136936];return _0x2965d3;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6c1e('0x0'));var config=require(_0x6c1e('0x1'));function connect(){return new BPromise(function(_0x3c4517,_0x3e18da){return pm2['connect'](function(_0x4d5627){if(_0x4d5627){return _0x3e18da(_0x4d5627);}return _0x3c4517(_0x6c1e('0x2'));});});};exports['start']=function(_0x3f9c8a){return connect()['then'](function(){return new BPromise(function(_0xd8dee9,_0x24d8fa){return pm2[_0x6c1e('0x3')](_0x3f9c8a,function(_0x3d15e9,_0x495f51){if(_0x3d15e9){return _0x24d8fa(_0x3d15e9);}pm2[_0x6c1e('0x4')]();return _0xd8dee9(_0x495f51);});});});};exports[_0x6c1e('0x5')]=function(_0x547627){return connect()[_0x6c1e('0x6')](function(){return new BPromise(function(_0x27069c,_0x4b0bf3){return pm2[_0x6c1e('0x5')](_0x547627,function(_0x9a5e9f,_0x1ab441){if(_0x9a5e9f){return _0x4b0bf3(_0x9a5e9f);}pm2[_0x6c1e('0x4')]();return _0x27069c(_0x1ab441);});});});};exports['restart']=function(_0x3f4f63){return connect()[_0x6c1e('0x6')](function(){return new BPromise(function(_0x271f3c,_0x84c2e1){return pm2[_0x6c1e('0x7')](_0x3f4f63,function(_0x11dcb8,_0x21e8c8){if(_0x11dcb8){return _0x84c2e1(_0x11dcb8);}pm2[_0x6c1e('0x4')]();return _0x271f3c(_0x21e8c8);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0xced72f,_0x323314){return pm2[_0x6c1e('0x8')](function(_0x6ec391,_0x59c2a9){if(_0x6ec391){return _0x323314(_0x6ec391);}pm2['disconnect']();return _0xced72f(_0x59c2a9);});});});};exports[_0x6c1e('0x9')]=function(_0x8de069){return connect()[_0x6c1e('0x6')](function(){return new BPromise(function(_0xf1183e,_0x2b2587){return pm2[_0x6c1e('0x9')](_0x8de069,function(_0x22205e,_0xb061){if(_0x22205e){return _0x2b2587(_0x22205e);}pm2['disconnect']();return _0xf1183e(_0xb061);});});});};exports[_0x6c1e('0xa')]=function(_0x5d86d5){return connect()[_0x6c1e('0x6')](function(){return new BPromise(function(_0x4f7c48,_0x1980ee){return pm2['delete'](_0x5d86d5,function(_0x240225,_0x3c2aaf){if(_0x240225){return _0x1980ee(_0x240225);}pm2[_0x6c1e('0x4')]();return _0x4f7c48(_0x3c2aaf);});});});};exports['dump']=function(){return connect()[_0x6c1e('0x6')](function(){return new BPromise(function(_0x1a9613,_0x48b1d3){return pm2['dump'](function(_0x4bbf31){if(_0x4bbf31){return _0x48b1d3(_0x4bbf31);}return _0x1a9613(_0x6c1e('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8248e80..7448eca 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 _0xd63b=['moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','find','chatTimeout','ChatInteraction','lastMsgAt','minutes','then','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0xd4d369,_0x4f6ad2){var _0x293e5d=function(_0xb0e6a4){while(--_0xb0e6a4){_0xd4d369['push'](_0xd4d369['shift']());}};_0x293e5d(++_0x4f6ad2);}(_0xd63b,0x1ed));var _0xbd63=function(_0x18fc4a,_0x5613ad){_0x18fc4a=_0x18fc4a-0x0;var _0xccad53=_0xd63b[_0x18fc4a];return _0xccad53;};'use strict';var _=require('lodash');var moment=require(_0xbd63('0x0'));var Redis=require(_0xbd63('0x1'));var util=require(_0xbd63('0x2'));var config=require(_0xbd63('0x3'));var db=require(_0xbd63('0x4'))['db'];var logger=require(_0xbd63('0x5'))('schedule');config[_0xbd63('0x6')]=_['defaults'](config[_0xbd63('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x59149c=0x0;var _0x2cd014=[];return db['Setting'][_0xbd63('0x7')]({'raw':!![],'attributes':['id',_0xbd63('0x8')],'where':{'id':0x1}})['then'](function(_0x25358b){_0x59149c=_0x25358b['chatTimeout'];if(_0x59149c){return db[_0xbd63('0x9')]['findAll']({'raw':!![],'attributes':['id',_0xbd63('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x25358b[_0xbd63('0x8')],_0xbd63('0xb'))}}});}else{return[];}})[_0xbd63('0xc')](function(_0x4f3190){if(_0x4f3190&&_0x4f3190[_0xbd63('0xd')]){_0x2cd014=_[_0xbd63('0xe')](_0x4f3190||[],'id');logger['info'](_0xbd63('0xf'),_0x2cd014[_0xbd63('0x10')]());return db['ChatInteraction'][_0xbd63('0x11')]({'closeReason':_0xbd63('0x12'),'disposition':_0xbd63('0x13'),'closed':!![],'closedAt':moment()[_0xbd63('0x14')](_0xbd63('0x15'))},{'where':{'id':_0x2cd014}});}})[_0xbd63('0xc')](function(){if(_0x2cd014&&_0x2cd014[_0xbd63('0xd')]){logger[_0xbd63('0x16')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x2cd014[_0xbd63('0x10')]());for(var _0x4d4401=0x0;_0x4d4401<_0x2cd014['length'];_0x4d4401++){io[_0xbd63('0x17')](_0xbd63('0x18'),{'id':_0x2cd014[_0x4d4401],'closed':!![]});}}})[_0xbd63('0x19')](function(_0x1ca519){logger[_0xbd63('0x1a')](_0xbd63('0x1b'),_0x1ca519?util[_0xbd63('0x1c')](_0x1ca519,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9141=['defaults','localhost','Setting','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','info','[CHAT]\x20Interactions\x20to\x20close:','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9141,0x1ab));var _0x1914=function(_0x5ea951,_0x38eb1a){_0x5ea951=_0x5ea951-0x0;var _0xd3077=_0x9141[_0x5ea951];return _0xd3077;};'use strict';var _=require(_0x1914('0x0'));var moment=require(_0x1914('0x1'));var Redis=require(_0x1914('0x2'));var util=require(_0x1914('0x3'));var config=require('../../config/environment');var db=require(_0x1914('0x4'))['db'];var logger=require(_0x1914('0x5'))(_0x1914('0x6'));config[_0x1914('0x7')]=_[_0x1914('0x8')](config[_0x1914('0x7')],{'host':_0x1914('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1914('0x7')]));function closeInteractions(){var _0x1f843e=0x0;var _0x573676=[];return db[_0x1914('0xa')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x45e6b6){_0x1f843e=_0x45e6b6[_0x1914('0xb')];if(_0x1f843e){return db[_0x1914('0xc')][_0x1914('0xd')]({'raw':!![],'attributes':['id',_0x1914('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1914('0xf')](_0x45e6b6[_0x1914('0xb')],_0x1914('0x10'))}}});}else{return[];}})[_0x1914('0x11')](function(_0x3d8f54){if(_0x3d8f54&&_0x3d8f54[_0x1914('0x12')]){_0x573676=_['map'](_0x3d8f54||[],'id');logger[_0x1914('0x13')](_0x1914('0x14'),_0x573676['join']());return db[_0x1914('0xc')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x1914('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x573676}});}})[_0x1914('0x11')](function(){if(_0x573676&&_0x573676[_0x1914('0x12')]){logger[_0x1914('0x13')](_0x1914('0x16'),_0x573676[_0x1914('0x17')]());for(var _0x356963=0x0;_0x356963<_0x573676['length'];_0x356963++){io[_0x1914('0x18')](_0x1914('0x19'),{'id':_0x573676[_0x356963],'closed':!![]});}}})['catch'](function(_0x2e7e53){logger['error'](_0x1914('0x1a'),_0x2e7e53?util[_0x1914('0x1b')](_0x2e7e53,{'showHidden':![],'depth':null}):'');});}exports[_0x1914('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 789ef8f..504ee12 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 _0x0978=['startAllRefreshIntervals','exports'];(function(_0x12768f,_0x5e0b48){var _0x1b957b=function(_0x45cd97){while(--_0x45cd97){_0x12768f['push'](_0x12768f['shift']());}};_0x1b957b(++_0x5e0b48);}(_0x0978,0x118));var _0x8097=function(_0x104008,_0x1c419d){_0x104008=_0x104008-0x0;var _0x133c7e=_0x0978[_0x104008];return _0x133c7e;};'use strict';function start(){var _0xd6d72e=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0xd6d72e[_0x8097('0x0')]();}module[_0x8097('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x2bf5=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x2bf5,0x173));var _0x52bf=function(_0x364ba3,_0x148892){_0x364ba3=_0x364ba3-0x0;var _0x100d47=_0x2bf5[_0x364ba3];return _0x100d47;};'use strict';function start(){var _0x38369e=require(_0x52bf('0x0'));return _0x38369e[_0x52bf('0x1')]();}module[_0x52bf('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 77bf812..0f120ce 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 _0x12e6=['stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','catch','error\x20mail','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','email','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','length','exists','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','isBetween','endAt','add','start','add\x20cron','stop','stop\x20cron','startAt','update','update\x20cron','run','path','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','format','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','savename','%s.%s','extname','zip','status','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'];(function(_0x58e253,_0x30a9c3){var _0x2ffe75=function(_0x22d30b){while(--_0x22d30b){_0x58e253['push'](_0x58e253['shift']());}};_0x2ffe75(++_0x30a9c3);}(_0x12e6,0x184));var _0x612e=function(_0x3fe349,_0x25f932){_0x3fe349=_0x3fe349-0x0;var _0x5b46a6=_0x12e6[_0x3fe349];return _0x5b46a6;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x612e('0x0'));var _=require('lodash');var moment=require(_0x612e('0x1'));var CronJobManager=require(_0x612e('0x2'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x612e('0x3'))(_0x612e('0x4'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x612e('0x5'));var analyticDefaultReportController=require(_0x612e('0x6'));var client=jayson[_0x612e('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x59b10b,_0x443b98){return function(){logger[_0x612e('0x8')](_0x612e('0x9'),_0x59b10b['email']);var _0x14db07=!![];var _0x455e1a=_0x59b10b[_0x612e('0xa')]['getSmtpOptions']();var _0x434c87={'account':_0x455e1a,'message':{'from':util[_0x612e('0xb')]('\x22%s\x22\x20<%s>',_0x59b10b[_0x612e('0xa')]['name'],_0x59b10b[_0x612e('0xa')]['email']||_0x59b10b[_0x612e('0xa')]['Smtp'][_0x612e('0xc')]),'to':_0x59b10b['email'],'cc':_0x59b10b['cc'],'bcc':_0x59b10b[_0x612e('0xd')],'subject':util['format'](_0x612e('0xe'),_0x443b98[_0x612e('0xf')],_0x59b10b[_0x612e('0x10')],_0x59b10b['subtractUnit'])}};var _0x490f97=path[_0x612e('0x11')](__dirname,'../../files/reports');var _0x10a5a9=_0x443b98[_0x612e('0x12')];var _0x5ea999=util[_0x612e('0xb')](_0x612e('0x13'),path['basename'](_0x443b98[_0x612e('0x12')],path[_0x612e('0x14')](_0x443b98[_0x612e('0x12')])),_0x612e('0x15'));var _0x28a63c=path[_0x612e('0x11')](_0x490f97,_0x10a5a9);var _0x4f5ef4=path[_0x612e('0x11')](_0x490f97,_0x5ea999);if(fs['existsSync'](_0x28a63c)){_0x443b98[_0x612e('0x16')]='Sent';_0x434c87[_0x612e('0x17')][_0x612e('0x18')]=[{'filename':_0x10a5a9,'path':_0x28a63c}];_0x434c87['message'][_0x612e('0x19')]=util['format'](_0x612e('0x1a'),JSON[_0x612e('0x1b')](_0x443b98,null,0x2));}else if(fs[_0x612e('0x1c')](_0x4f5ef4)){_0x443b98[_0x612e('0x16')]='Sent';_0x434c87[_0x612e('0x17')][_0x612e('0x18')]=[{'filename':_0x5ea999,'path':_0x4f5ef4}];}else{_0x434c87[_0x612e('0x17')][_0x612e('0x19')]=_0x612e('0x1d');if(!_0x59b10b[_0x612e('0x1e')]){_0x14db07=![];logger[_0x612e('0x8')](_0x612e('0x1f'));}}if(_0x14db07){return client[_0x612e('0x20')](_0x612e('0x21'),_0x434c87)[_0x612e('0x22')](function(_0x3647b1){if(_0x3647b1[_0x612e('0x23')]){return logger[_0x612e('0x23')]('error\x20mail',JSON[_0x612e('0x1b')](_0x3647b1));}return logger['info']('email\x20sent');})[_0x612e('0x24')](function(_0x5ba5c9){return logger[_0x612e('0x23')](_0x612e('0x25'),JSON[_0x612e('0x1b')](_0x5ba5c9));});}};}function handleError(){return function(_0x4dc3fa){return logger[_0x612e('0x23')](JSON[_0x612e('0x1b')](_0x4dc3fa));};}function handleResult(_0x417fa9){return function(_0x57616e){logger[_0x612e('0x8')]('data',JSON['stringify'](_0x57616e));if(_0x417fa9[_0x612e('0xa')]&&_0x417fa9['MailAccount'][_0x612e('0x26')]&&!_['isNil'](_0x417fa9['email'])){setTimeout(handleSendEmail(_0x417fa9,_0x57616e),0x3c*0x3e8);}};}function handleJob(_0x3f1a09){return function(){try{if(_[_0x612e('0x27')](_0x3f1a09[_0x612e('0x10')])){return logger[_0x612e('0x8')](_0x612e('0x28'));}if(_[_0x612e('0x27')](_0x3f1a09[_0x612e('0x29')])){return logger[_0x612e('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5eb15b={'startDate':moment()[_0x612e('0x2a')](_0x3f1a09[_0x612e('0x10')],_0x3f1a09[_0x612e('0x29')])[_0x612e('0xb')](_0x612e('0x2b')),'endDate':moment()[_0x612e('0xb')](_0x612e('0x2b')),'type':_0x612e('0x2c'),'output':_0x3f1a09[_0x612e('0x2d')],'name':_0x3f1a09['name']};if(!_['isNil'](_0x3f1a09['DefaultReportId'])){logger[_0x612e('0x8')](_0x612e('0x2e'),_0x3f1a09[_0x612e('0x2f')]);return analyticDefaultReportController[_0x612e('0x30')]({'id':_0x3f1a09[_0x612e('0x2f')]},_0x5eb15b)[_0x612e('0x22')](handleResult(_0x3f1a09))[_0x612e('0x24')](handleError());}if(!_[_0x612e('0x27')](_0x3f1a09[_0x612e('0x31')])){logger[_0x612e('0x8')](_0x612e('0x32'),_0x3f1a09[_0x612e('0x31')]);return analyticCustomReportController['runReport']({'id':_0x3f1a09[_0x612e('0x31')]},_0x5eb15b)['then'](handleResult(_0x3f1a09))[_0x612e('0x24')](handleError());}}catch(_0x1dbb0b){logger[_0x612e('0x23')](JSON[_0x612e('0x1b')](_0x1dbb0b));}return logger[_0x612e('0x8')](_0x612e('0x33'));};}function getJobs(_0x110efc){var _0xde26d7={};if(_0x110efc){_0xde26d7['id']=_0x110efc;}return db[_0x612e('0x34')][_0x612e('0x35')]({'where':_0xde26d7,'include':[{'model':db[_0x612e('0xa')],'attributes':['id',_0x612e('0xf'),_0x612e('0x36')],'include':[{'model':db[_0x612e('0x37')],'as':_0x612e('0x26'),'include':[{'model':db[_0x612e('0x38')],'as':_0x612e('0x38')}]}]}]})[_0x612e('0x22')](function(_0xe4109b){var _0xd6b3d1=_[_0x612e('0x39')](manager[_0x612e('0x3a')]);var _0x4dab90=_[_0x612e('0x3b')](_0xe4109b,function(_0x5f3a80){return _0x5f3a80['id'][_0x612e('0x3c')]();});var _0xc6acac=_[_0x612e('0x3d')](_0xe4109b,function(_0x2e89ef){return _0x2e89ef['id'][_0x612e('0x3c')]();});var _0x526e04=_0x110efc?_0x4dab90:_['difference'](_0x4dab90,_0xd6b3d1);var _0xf7dd81=_['intersection'](_0x4dab90,_0xd6b3d1);var _0x4a2dba=_[_0x612e('0x3e')](_0xd6b3d1,_0x4dab90);var _0x28cf92;var _0x1dd9e1;for(_0x28cf92=0x0;_0x28cf92<_0x4a2dba[_0x612e('0x3f')]&&!_0x110efc;_0x28cf92+=0x1){_0x1dd9e1=_0x4a2dba[_0x28cf92][_0x612e('0x3c')]();if(manager[_0x612e('0x40')](_0x1dd9e1)){manager['stop'](_0x1dd9e1);manager[_0x612e('0x41')](_0x1dd9e1);logger[_0x612e('0x8')](_0x612e('0x42'),_0x1dd9e1);}}logger[_0x612e('0x8')]('toRun',JSON[_0x612e('0x1b')](_0x526e04));for(_0x28cf92=0x0;_0x28cf92<_0x526e04[_0x612e('0x3f')];_0x28cf92+=0x1){_0x1dd9e1=_0x526e04[_0x28cf92][_0x612e('0x3c')]();logger[_0x612e('0x8')](_0x612e('0x43'),_0x1dd9e1);if(_0x110efc){logger[_0x612e('0x8')](_0x612e('0x44'),_0x110efc);logger[_0x612e('0x8')](JSON[_0x612e('0x1b')](_0xc6acac[_0x1dd9e1]));BPromise[_0x612e('0x45')]()['then'](handleJob(_0xc6acac[_0x1dd9e1]));logger[_0x612e('0x8')](_0x612e('0x46'),_0xc6acac[_0x1dd9e1][_0x612e('0xf')],_0xc6acac[_0x1dd9e1][_0x612e('0x47')]);}else if(_0xc6acac[_0x1dd9e1][_0x612e('0x47')]&&_0xc6acac[_0x1dd9e1]['active']&&moment()[_0x612e('0x48')](_0xc6acac[_0x1dd9e1]['startAt'],_0xc6acac[_0x1dd9e1][_0x612e('0x49')])){manager[_0x612e('0x4a')](_0x1dd9e1,_0xc6acac[_0x1dd9e1]['cron'],handleJob(_0xc6acac[_0x1dd9e1]));manager[_0x612e('0x4b')](_0x1dd9e1);logger['info'](_0x612e('0x4c'),_0xc6acac[_0x1dd9e1]['name'],_0xc6acac[_0x1dd9e1]['cron']);}else if(manager[_0x612e('0x40')](_0x1dd9e1)){manager[_0x612e('0x4d')](_0x1dd9e1);manager[_0x612e('0x41')](_0x1dd9e1);logger['info'](_0x612e('0x4e'),_0xc6acac[_0x1dd9e1][_0x612e('0xf')],_0xc6acac[_0x1dd9e1]['cron']);}}for(_0x28cf92=0x0,_0x1dd9e1;_0x28cf92<_0xf7dd81[_0x612e('0x3f')]&&!_0x110efc;_0x28cf92+=0x1){_0x1dd9e1=_0xf7dd81[_0x28cf92][_0x612e('0x3c')]();if(manager[_0x612e('0x40')](_0x1dd9e1)){if(_0xc6acac[_0x1dd9e1][_0x612e('0x47')]&&_0xc6acac[_0x1dd9e1]['active']&&moment()[_0x612e('0x48')](_0xc6acac[_0x1dd9e1][_0x612e('0x4f')],_0xc6acac[_0x1dd9e1][_0x612e('0x49')])){manager[_0x612e('0x50')](_0x1dd9e1,_0xc6acac[_0x1dd9e1]['cron'],handleJob(_0xc6acac[_0x1dd9e1]));logger[_0x612e('0x8')](_0x612e('0x51'),_0xc6acac[_0x1dd9e1][_0x612e('0xf')],_0xc6acac[_0x1dd9e1][_0x612e('0x47')]);}else{manager[_0x612e('0x4d')](_0x1dd9e1);manager[_0x612e('0x41')](_0x1dd9e1);logger[_0x612e('0x8')]('stop\x20cron',_0xc6acac[_0x1dd9e1][_0x612e('0xf')],_0xc6acac[_0x1dd9e1][_0x612e('0x47')]);}}}})[_0x612e('0x24')](function(_0x2755ba){logger[_0x612e('0x23')](JSON['stringify'](_0x2755ba));});}exports[_0x612e('0x52')]=function(_0x29b39d){return getJobs(_0x29b39d);};exports[_0x612e('0x4b')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9013=['join','../../files/reports','savename','basename','extname','zip','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','Schedule','MailServerOut','CloudProvider','keys','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','lodash','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber'];(function(_0x34c8f3,_0x2b34fb){var _0x580102=function(_0x5624f5){while(--_0x5624f5){_0x34c8f3['push'](_0x34c8f3['shift']());}};_0x580102(++_0x2b34fb);}(_0x9013,0x140));var _0x3901=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9013[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x3901('0x0'));var moment=require(_0x3901('0x1'));var CronJobManager=require(_0x3901('0x2'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3901('0x3'))(_0x3901('0x4'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3901('0x5'));var analyticDefaultReportController=require(_0x3901('0x6'));var client=jayson[_0x3901('0x7')][_0x3901('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x264fe9,_0x122658){return function(){logger[_0x3901('0x9')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x264fe9[_0x3901('0xa')]);var _0x3dc963=!![];var _0x3269ff=_0x264fe9['MailAccount'][_0x3901('0xb')]();var _0x59810b={'account':_0x3269ff,'message':{'from':util[_0x3901('0xc')](_0x3901('0xd'),_0x264fe9[_0x3901('0xe')]['name'],_0x264fe9['MailAccount'][_0x3901('0xa')]||_0x264fe9[_0x3901('0xe')][_0x3901('0xf')]['user']),'to':_0x264fe9[_0x3901('0xa')],'cc':_0x264fe9['cc'],'bcc':_0x264fe9[_0x3901('0x10')],'subject':util[_0x3901('0xc')](_0x3901('0x11'),_0x122658[_0x3901('0x12')],_0x264fe9[_0x3901('0x13')],_0x264fe9['subtractUnit'])}};var _0x4637f4=path[_0x3901('0x14')](__dirname,_0x3901('0x15'));var _0x1cb778=_0x122658[_0x3901('0x16')];var _0x328f41=util[_0x3901('0xc')]('%s.%s',path[_0x3901('0x17')](_0x122658[_0x3901('0x16')],path[_0x3901('0x18')](_0x122658[_0x3901('0x16')])),_0x3901('0x19'));var _0x3bc6a2=path['join'](_0x4637f4,_0x1cb778);var _0x173e79=path[_0x3901('0x14')](_0x4637f4,_0x328f41);if(fs['existsSync'](_0x3bc6a2)){_0x122658[_0x3901('0x1a')]=_0x3901('0x1b');_0x59810b[_0x3901('0x1c')][_0x3901('0x1d')]=[{'filename':_0x1cb778,'path':_0x3bc6a2}];_0x59810b[_0x3901('0x1c')][_0x3901('0x1e')]=util['format'](_0x3901('0x1f'),JSON[_0x3901('0x20')](_0x122658,null,0x2));}else if(fs[_0x3901('0x21')](_0x173e79)){_0x122658[_0x3901('0x1a')]='Sent';_0x59810b[_0x3901('0x1c')][_0x3901('0x1d')]=[{'filename':_0x328f41,'path':_0x173e79}];}else{_0x59810b['message']['text']=_0x3901('0x22');if(!_0x264fe9[_0x3901('0x23')]){_0x3dc963=![];logger['info'](_0x3901('0x24'));}}if(_0x3dc963){return client[_0x3901('0x25')](_0x3901('0x26'),_0x59810b)[_0x3901('0x27')](function(_0x5c5dc5){if(_0x5c5dc5[_0x3901('0x28')]){return logger['error'](_0x3901('0x29'),JSON['stringify'](_0x5c5dc5));}return logger[_0x3901('0x9')](_0x3901('0x2a'));})['catch'](function(_0x4815c8){return logger[_0x3901('0x28')]('error\x20mail',JSON['stringify'](_0x4815c8));});}};}function handleError(){return function(_0x269654){return logger[_0x3901('0x28')](JSON[_0x3901('0x20')](_0x269654));};}function handleResult(_0x38a790){return function(_0x507e79){logger[_0x3901('0x9')](_0x3901('0x2b'),JSON[_0x3901('0x20')](_0x507e79));if(_0x38a790[_0x3901('0xe')]&&_0x38a790[_0x3901('0xe')]['Smtp']&&!_[_0x3901('0x2c')](_0x38a790['email'])){setTimeout(handleSendEmail(_0x38a790,_0x507e79),0x3c*0x3e8);}};}function handleJob(_0x2cf0b0){return function(){try{if(_['isNil'](_0x2cf0b0['subtractNumber'])){return logger[_0x3901('0x9')](_0x3901('0x2d'));}if(_['isNil'](_0x2cf0b0[_0x3901('0x2e')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x2016ba={'startDate':moment()[_0x3901('0x2f')](_0x2cf0b0['subtractNumber'],_0x2cf0b0[_0x3901('0x2e')])[_0x3901('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x3901('0xc')](_0x3901('0x30')),'type':_0x3901('0x31'),'output':_0x2cf0b0[_0x3901('0x32')],'name':_0x2cf0b0[_0x3901('0x12')]};if(!_[_0x3901('0x2c')](_0x2cf0b0[_0x3901('0x33')])){logger[_0x3901('0x9')](_0x3901('0x34'),_0x2cf0b0['DefaultReportId']);return analyticDefaultReportController[_0x3901('0x35')]({'id':_0x2cf0b0[_0x3901('0x33')]},_0x2016ba)[_0x3901('0x27')](handleResult(_0x2cf0b0))[_0x3901('0x36')](handleError());}if(!_[_0x3901('0x2c')](_0x2cf0b0['CustomReportId'])){logger[_0x3901('0x9')]('exec\x20custom\x20report\x20id:%s',_0x2cf0b0[_0x3901('0x37')]);return analyticCustomReportController[_0x3901('0x35')]({'id':_0x2cf0b0[_0x3901('0x37')]},_0x2016ba)[_0x3901('0x27')](handleResult(_0x2cf0b0))[_0x3901('0x36')](handleError());}}catch(_0x26729a){logger['error'](JSON[_0x3901('0x20')](_0x26729a));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x3905f3){var _0x4b9765={};if(_0x3905f3){_0x4b9765['id']=_0x3905f3;}return db[_0x3901('0x38')]['findAll']({'where':_0x4b9765,'include':[{'model':db[_0x3901('0xe')],'attributes':['id',_0x3901('0x12'),_0x3901('0xa')],'include':[{'model':db[_0x3901('0x39')],'as':_0x3901('0xf'),'include':[{'model':db['CloudProvider'],'as':_0x3901('0x3a')}]}]}]})[_0x3901('0x27')](function(_0x37c5be){var _0x17bdfd=_[_0x3901('0x3b')](manager['jobs']);var _0x2a18fe=_[_0x3901('0x3c')](_0x37c5be,function(_0x112d66){return _0x112d66['id'][_0x3901('0x3d')]();});var _0x369875=_['keyBy'](_0x37c5be,function(_0x3aff74){return _0x3aff74['id'][_0x3901('0x3d')]();});var _0x48fa8b=_0x3905f3?_0x2a18fe:_[_0x3901('0x3e')](_0x2a18fe,_0x17bdfd);var _0x3f2528=_[_0x3901('0x3f')](_0x2a18fe,_0x17bdfd);var _0x1a0a39=_[_0x3901('0x3e')](_0x17bdfd,_0x2a18fe);var _0x45ff60;var _0xacb651;for(_0x45ff60=0x0;_0x45ff60<_0x1a0a39[_0x3901('0x40')]&&!_0x3905f3;_0x45ff60+=0x1){_0xacb651=_0x1a0a39[_0x45ff60][_0x3901('0x3d')]();if(manager[_0x3901('0x41')](_0xacb651)){manager[_0x3901('0x42')](_0xacb651);manager[_0x3901('0x43')](_0xacb651);logger[_0x3901('0x9')](_0x3901('0x44'),_0xacb651);}}logger['info'](_0x3901('0x45'),JSON['stringify'](_0x48fa8b));for(_0x45ff60=0x0;_0x45ff60<_0x48fa8b[_0x3901('0x40')];_0x45ff60+=0x1){_0xacb651=_0x48fa8b[_0x45ff60][_0x3901('0x3d')]();logger[_0x3901('0x9')]('index',_0xacb651);if(_0x3905f3){logger['info'](_0x3901('0x46'),_0x3905f3);logger[_0x3901('0x9')](JSON[_0x3901('0x20')](_0x369875[_0xacb651]));BPromise[_0x3901('0x47')]()[_0x3901('0x27')](handleJob(_0x369875[_0xacb651]));logger['info'](_0x3901('0x48'),_0x369875[_0xacb651][_0x3901('0x12')],_0x369875[_0xacb651][_0x3901('0x49')]);}else if(_0x369875[_0xacb651][_0x3901('0x49')]&&_0x369875[_0xacb651][_0x3901('0x4a')]&&moment()[_0x3901('0x4b')](_0x369875[_0xacb651][_0x3901('0x4c')],_0x369875[_0xacb651][_0x3901('0x4d')])){manager[_0x3901('0x4e')](_0xacb651,_0x369875[_0xacb651][_0x3901('0x49')],handleJob(_0x369875[_0xacb651]));manager[_0x3901('0x4f')](_0xacb651);logger[_0x3901('0x9')](_0x3901('0x50'),_0x369875[_0xacb651]['name'],_0x369875[_0xacb651][_0x3901('0x49')]);}else if(manager[_0x3901('0x41')](_0xacb651)){manager[_0x3901('0x42')](_0xacb651);manager[_0x3901('0x43')](_0xacb651);logger[_0x3901('0x9')](_0x3901('0x51'),_0x369875[_0xacb651][_0x3901('0x12')],_0x369875[_0xacb651][_0x3901('0x49')]);}}for(_0x45ff60=0x0,_0xacb651;_0x45ff60<_0x3f2528[_0x3901('0x40')]&&!_0x3905f3;_0x45ff60+=0x1){_0xacb651=_0x3f2528[_0x45ff60][_0x3901('0x3d')]();if(manager[_0x3901('0x41')](_0xacb651)){if(_0x369875[_0xacb651][_0x3901('0x49')]&&_0x369875[_0xacb651][_0x3901('0x4a')]&&moment()['isBetween'](_0x369875[_0xacb651]['startAt'],_0x369875[_0xacb651]['endAt'])){manager[_0x3901('0x52')](_0xacb651,_0x369875[_0xacb651]['cron'],handleJob(_0x369875[_0xacb651]));logger[_0x3901('0x9')](_0x3901('0x53'),_0x369875[_0xacb651]['name'],_0x369875[_0xacb651][_0x3901('0x49')]);}else{manager['stop'](_0xacb651);manager[_0x3901('0x43')](_0xacb651);logger[_0x3901('0x9')]('stop\x20cron',_0x369875[_0xacb651][_0x3901('0x12')],_0x369875[_0xacb651][_0x3901('0x49')]);}}}})['catch'](function(_0x434028){logger[_0x3901('0x28')](JSON[_0x3901('0x20')](_0x434028));});}exports[_0x3901('0x54')]=function(_0x23137a){return getJobs(_0x23137a);};exports[_0x3901('0x4f')]=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 10b52f3..91f6cc3 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 _0x4cf8=['transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20configured','Positive','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length'];(function(_0x220e70,_0x2db201){var _0x1d2c11=function(_0x55475f){while(--_0x55475f){_0x220e70['push'](_0x220e70['shift']());}};_0x1d2c11(++_0x2db201);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0x4cf8[_0x5f12fd];return _0x58bd80;};var _=require(_0x84cf('0x0'));var AWS=require(_0x84cf('0x1'));var rp=require(_0x84cf('0x2'));var util=require(_0x84cf('0x3'));var BPromise=require(_0x84cf('0x4'));var db=require(_0x84cf('0x5'))['db'];var logger=require(_0x84cf('0x6'))(_0x84cf('0x7'));function getTranscriptionJob(_0x3bbbc3,_0x2d38c0,_0x5844d7,_0x2c613d){return new Promise(function(_0x50ade2,_0x4af3f1){var _0x455345=new AWS['TranscribeService']({'accessKeyId':_0x2d38c0,'secretAccessKey':_0x3bbbc3,'region':_0x5844d7});_0x455345[_0x84cf('0x8')]({'TranscriptionJobName':_0x2c613d},function(_0x2c11b0,_0x51b84c){if(_0x2c11b0){return _0x4af3f1(_0x2c11b0);}else{return _0x50ade2(_0x51b84c);}});});}function sentiment(_0x2e0b79,_0x39c6bc,_0x489063,_0xfb5398,_0x1b223d){return new Promise(function(_0x390ce9,_0x369ce6){var _0x50d667=new AWS[(_0x84cf('0x9'))]({'accessKeyId':_0x39c6bc,'secretAccessKey':_0x2e0b79,'region':_0x489063});_0x50d667[_0x84cf('0xa')]({'Text':_0xfb5398,'LanguageCode':_0x1b223d['substring'](0x0,0x2)},function(_0x51d315,_0x7a00bf){if(_0x51d315){return _0x369ce6(_0x51d315);}else{return _0x390ce9(_0x7a00bf);}});});}function checkTranscribeJob(_0x27efbf,_0x35f852,_0x33f83e){var _0x172d04;return new BPromise(function(_0x214ca0,_0x1fd6cb){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0xd'),_0x27efbf['id'],_0x27efbf[_0x84cf('0xe')]));return getTranscriptionJob(_0x33f83e[_0x84cf('0xf')],_0x33f83e[_0x84cf('0x10')],_0x35f852[_0x84cf('0x11')],_0x27efbf[_0x84cf('0xe')])[_0x84cf('0x12')](function(_0x464e70){logger[_0x84cf('0xb')](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x27efbf['id'],_0x27efbf[_0x84cf('0xe')],_0x464e70[_0x84cf('0x13')][_0x84cf('0x14')]));if(!_0x27efbf[_0x84cf('0x15')]){switch(_0x464e70[_0x84cf('0x13')][_0x84cf('0x14')]){case _0x84cf('0x16'):var _0x5d5650={'transcribeStatus':_0x464e70['TranscriptionJob'][_0x84cf('0x14')],'fileUri':_0x464e70[_0x84cf('0x13')][_0x84cf('0x17')][_0x84cf('0x18')]};logger[_0x84cf('0xb')](util['format'](_0x84cf('0x19'),_0x27efbf['id']));return rp({'uri':_0x464e70[_0x84cf('0x13')][_0x84cf('0x17')][_0x84cf('0x18')],'json':!![]})[_0x84cf('0x12')](function(_0x54405a){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1a'),_0x27efbf['id']));if(_0x54405a&&_0x54405a[_0x84cf('0x1b')]&&_0x54405a[_0x84cf('0x1b')][_0x84cf('0x1c')]&&_0x54405a[_0x84cf('0x1b')]['transcripts'][_0x84cf('0x1d')]){_0x5d5650[_0x84cf('0x15')]='';for(var _0x1c7747=0x0;_0x1c7747<_0x54405a[_0x84cf('0x1b')][_0x84cf('0x1c')][_0x84cf('0x1d')];_0x1c7747++){_0x5d5650[_0x84cf('0x15')]+=_0x54405a[_0x84cf('0x1b')][_0x84cf('0x1c')][_0x1c7747][_0x84cf('0x1e')]+'';}}return _0x27efbf['update'](_0x5d5650);})[_0x84cf('0x12')](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));if(!_0x27efbf['tempSentiment']){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x21'));}if(!_0x35f852[_0x84cf('0x22')]||!_0x35f852[_0x84cf('0x23')]||!_0x35f852[_0x84cf('0x24')]||!_0x35f852[_0x84cf('0x25')]||!_0x35f852[_0x84cf('0x26')]){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))](_0x84cf('0x28'));}if(!_0x5d5650[_0x84cf('0x15')]){throw new Error(_0x84cf('0x29'));}if(_0x35f852[_0x84cf('0x23')]===_0x33f83e['id']){return _0x33f83e;}else{return db[_0x84cf('0x2a')][_0x84cf('0x2b')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2795ef){if(!_0x2795ef){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))](_0x84cf('0x2c'));}if(!_0x2795ef[_0x84cf('0xf')]||!_0x2795ef[_0x84cf('0x10')]){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))]('Cloud\x20Provider\x20not\x20configured');}_0x172d04=_0x2795ef;logger[_0x84cf('0xb')](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x27efbf['id']));return sentiment(_0x172d04[_0x84cf('0xf')],_0x172d04['data2'],_0x35f852[_0x84cf('0x24')],_0x5d5650[_0x84cf('0x15')],_0x35f852[_0x84cf('0x25')]);})[_0x84cf('0x12')](function(_0x172ce9){logger['info'](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x27efbf['id']));return _0x27efbf['update']({'sentiment':_0x172ce9[_0x84cf('0x2d')],'sPositive':_0x172ce9[_0x84cf('0x2e')]['Positive'],'sNegative':_0x172ce9[_0x84cf('0x2e')][_0x84cf('0x2f')],'sMixed':_0x172ce9[_0x84cf('0x2e')][_0x84cf('0x30')],'sNeutral':_0x172ce9[_0x84cf('0x2e')][_0x84cf('0x31')]});})['then'](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));_0x214ca0();});case _0x84cf('0x32'):return _0x27efbf[_0x84cf('0x33')]({'transcribeStatus':_0x84cf('0x32'),'failureReason':_0x464e70['TranscriptionJob'][_0x84cf('0x34')]})['then'](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));_0x214ca0();});default:logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x35'),_0x27efbf['id']));break;}}else{return BPromise[_0x84cf('0x36')]()[_0x84cf('0x12')](function(){if(!_0x27efbf[_0x84cf('0x37')]){throw new db['Sequelize'][(_0x84cf('0x27'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x35f852[_0x84cf('0x22')]||!_0x35f852[_0x84cf('0x23')]||!_0x35f852['sentimentRegion']||!_0x35f852[_0x84cf('0x25')]||!_0x35f852['bucket']){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x28'));}if(!_0x27efbf['fileText']){throw new Error(_0x84cf('0x29'));}if(_0x35f852[_0x84cf('0x23')]===_0x33f83e['id']){return _0x33f83e;}else{return db['CloudProvider'][_0x84cf('0x2b')]({'where':{'id':_settings[_0x84cf('0x23')]}});}})[_0x84cf('0x12')](function(_0x5ef5fb){if(!_0x5ef5fb){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x2c'));}if(!_0x5ef5fb['data1']||!_0x5ef5fb['data2']){throw new db['Sequelize'][(_0x84cf('0x27'))](_0x84cf('0x38'));}_0x172d04=_0x5ef5fb;logger['info'](util[_0x84cf('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x27efbf['id']));return sentiment(_0x172d04[_0x84cf('0xf')],_0x172d04[_0x84cf('0x10')],_0x35f852['sentimentRegion'],_0x27efbf[_0x84cf('0x15')],_0x35f852['language']);})[_0x84cf('0x12')](function(_0x593b35){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x27efbf['id']));return _0x27efbf['update']({'sentiment':_0x593b35['Sentiment'],'sPositive':_0x593b35['SentimentScore'][_0x84cf('0x39')],'sNegative':_0x593b35[_0x84cf('0x2e')][_0x84cf('0x2f')],'sMixed':_0x593b35[_0x84cf('0x2e')]['Mixed'],'sNeutral':_0x593b35[_0x84cf('0x2e')]['Neutral'],'transcribeStatus':_0x84cf('0x16')});})[_0x84cf('0x12')](function(){logger[_0x84cf('0xb')](util[_0x84cf('0xc')](_0x84cf('0x1f'),_0x27efbf['id']));_0x214ca0();});}})[_0x84cf('0x3a')](function(_0x4fba7f){if(_0x4fba7f){if(!_0x4fba7f[_0x84cf('0x3b')]||_0x4fba7f[_0x84cf('0x3b')]!=='SequelizeValidationError'){logger[_0x84cf('0x3c')](util[_0x84cf('0xc')](_0x84cf('0x3d'),_0x27efbf['id']),util['inspect'](_0x4fba7f,{'showHidden':![],'depth':null}));}}_0x214ca0();});});}function checkTranscribe(){var _0x5e8cde;var _0x5499f9;var _0x1cf3f6;return db[_0x84cf('0x3e')][_0x84cf('0x3f')]({'where':{'transcribeStatus':_0x84cf('0x40')}})[_0x84cf('0x12')](function(_0xdfade6){if(!_0xdfade6||!_0xdfade6['length']){throw new db[(_0x84cf('0x20'))]['ValidationError'](_0x84cf('0x41'));}_0x5e8cde=_0xdfade6;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x84cf('0x12')](function(_0xb1c3a8){if(!_0xb1c3a8){throw new db[(_0x84cf('0x20'))]['ValidationError']('Settings\x20not\x20available');}_0x5499f9=_0xb1c3a8;if(!_0x5499f9[_0x84cf('0x7')]||!_0x5499f9[_0x84cf('0x42')]||!_0x5499f9[_0x84cf('0x11')]||!_0x5499f9[_0x84cf('0x25')]||!_0x5499f9[_0x84cf('0x26')]){throw new db['Sequelize'][(_0x84cf('0x27'))](_0x84cf('0x43'));}return db['CloudProvider'][_0x84cf('0x2b')]({'where':{'id':_0x5499f9['transcribeAccountId']}});})['then'](function(_0x147194){if(!_0x147194){throw new db[(_0x84cf('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x147194[_0x84cf('0xf')]||!_0x147194[_0x84cf('0x10')]){throw new db[(_0x84cf('0x20'))][(_0x84cf('0x27'))](_0x84cf('0x38'));}_0x1cf3f6=_0x147194;var _0x3edaec=[];_0x5e8cde[_0x84cf('0x44')](function(_0x20ae02){_0x3edaec['push'](checkTranscribeJob(_0x20ae02,_0x5499f9,_0x1cf3f6));});return BPromise[_0x84cf('0x45')](_0x3edaec);})[_0x84cf('0x3a')](function(_0x52991f){if(_0x52991f){if(!_0x52991f['name']||_0x52991f[_0x84cf('0x3b')]!==_0x84cf('0x46')){logger[_0x84cf('0x3c')](util[_0x84cf('0x47')](_0x52991f,{'showHidden':![],'depth':null}));}}});}exports[_0x84cf('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x0efe=['fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','tempSentiment','Cloud\x20Provider\x20not\x20available','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','bucket','Transcribe\x20not\x20configured','forEach','push','all','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus'];(function(_0x13f043,_0xb9654a){var _0x2c0ed5=function(_0x1e66d9){while(--_0x1e66d9){_0x13f043['push'](_0x13f043['shift']());}};_0x2c0ed5(++_0xb9654a);}(_0x0efe,0x110));var _0xe0ef=function(_0x4ae924,_0x190e68){_0x4ae924=_0x4ae924-0x0;var _0x427f72=_0x0efe[_0x4ae924];return _0x427f72;};var _=require(_0xe0ef('0x0'));var AWS=require(_0xe0ef('0x1'));var rp=require('request-promise');var util=require(_0xe0ef('0x2'));var BPromise=require(_0xe0ef('0x3'));var db=require(_0xe0ef('0x4'))['db'];var logger=require(_0xe0ef('0x5'))(_0xe0ef('0x6'));function getTranscriptionJob(_0xef12b3,_0x1119dd,_0x2d1505,_0x36249e){return new Promise(function(_0x35a50e,_0x5e9176){var _0x49643a=new AWS[(_0xe0ef('0x7'))]({'accessKeyId':_0x1119dd,'secretAccessKey':_0xef12b3,'region':_0x2d1505});_0x49643a[_0xe0ef('0x8')]({'TranscriptionJobName':_0x36249e},function(_0x161f87,_0xa4f9be){if(_0x161f87){return _0x5e9176(_0x161f87);}else{return _0x35a50e(_0xa4f9be);}});});}function sentiment(_0x27cb2b,_0x27fbb1,_0x18f982,_0x4ec5dd,_0x538d1f){return new Promise(function(_0x12e93a,_0x62fd61){var _0x1e000c=new AWS['Comprehend']({'accessKeyId':_0x27fbb1,'secretAccessKey':_0x27cb2b,'region':_0x18f982});_0x1e000c[_0xe0ef('0x9')]({'Text':_0x4ec5dd,'LanguageCode':_0x538d1f[_0xe0ef('0xa')](0x0,0x2)},function(_0x55d67b,_0x34041a){if(_0x55d67b){return _0x62fd61(_0x55d67b);}else{return _0x12e93a(_0x34041a);}});});}function checkTranscribeJob(_0x4d959a,_0x38c64f,_0x90c232){var _0x3cce82;return new BPromise(function(_0x4fbb4d,_0x4b96d3){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0xd'),_0x4d959a['id'],_0x4d959a[_0xe0ef('0xe')]));return getTranscriptionJob(_0x90c232[_0xe0ef('0xf')],_0x90c232[_0xe0ef('0x10')],_0x38c64f[_0xe0ef('0x11')],_0x4d959a[_0xe0ef('0xe')])['then'](function(_0x401f4a){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0x12'),_0x4d959a['id'],_0x4d959a[_0xe0ef('0xe')],_0x401f4a['TranscriptionJob'][_0xe0ef('0x13')]));if(!_0x4d959a[_0xe0ef('0x14')]){switch(_0x401f4a[_0xe0ef('0x15')][_0xe0ef('0x13')]){case _0xe0ef('0x16'):var _0x214c7f={'transcribeStatus':_0x401f4a[_0xe0ef('0x15')][_0xe0ef('0x13')],'fileUri':_0x401f4a[_0xe0ef('0x15')][_0xe0ef('0x17')][_0xe0ef('0x18')]};logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x4d959a['id']));return rp({'uri':_0x401f4a[_0xe0ef('0x15')][_0xe0ef('0x17')][_0xe0ef('0x18')],'json':!![]})[_0xe0ef('0x19')](function(_0x58810f){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0x1a'),_0x4d959a['id']));if(_0x58810f&&_0x58810f[_0xe0ef('0x1b')]&&_0x58810f[_0xe0ef('0x1b')][_0xe0ef('0x1c')]&&_0x58810f[_0xe0ef('0x1b')]['transcripts'][_0xe0ef('0x1d')]){_0x214c7f[_0xe0ef('0x14')]='';for(var _0x5a44a9=0x0;_0x5a44a9<_0x58810f[_0xe0ef('0x1b')][_0xe0ef('0x1c')]['length'];_0x5a44a9++){_0x214c7f['fileText']+=_0x58810f['results'][_0xe0ef('0x1c')][_0x5a44a9]['transcript']+'';}}return _0x4d959a[_0xe0ef('0x1e')](_0x214c7f);})[_0xe0ef('0x19')](function(){logger[_0xe0ef('0xb')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4d959a['id']));if(!_0x4d959a['tempSentiment']){throw new db[(_0xe0ef('0x1f'))][(_0xe0ef('0x20'))](_0xe0ef('0x21'));}if(!_0x38c64f[_0xe0ef('0x22')]||!_0x38c64f[_0xe0ef('0x23')]||!_0x38c64f[_0xe0ef('0x24')]||!_0x38c64f['language']||!_0x38c64f['bucket']){throw new db[(_0xe0ef('0x1f'))]['ValidationError'](_0xe0ef('0x25'));}if(!_0x214c7f[_0xe0ef('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x38c64f['sentimentAccountId']===_0x90c232['id']){return _0x90c232;}else{return db[_0xe0ef('0x26')][_0xe0ef('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xe0ef('0x19')](function(_0x40cb9d){if(!_0x40cb9d){throw new db[(_0xe0ef('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x40cb9d['data1']||!_0x40cb9d[_0xe0ef('0x10')]){throw new db['Sequelize'][(_0xe0ef('0x20'))](_0xe0ef('0x28'));}_0x3cce82=_0x40cb9d;logger['info'](util[_0xe0ef('0xc')](_0xe0ef('0x29'),_0x4d959a['id']));return sentiment(_0x3cce82['data1'],_0x3cce82[_0xe0ef('0x10')],_0x38c64f[_0xe0ef('0x24')],_0x214c7f[_0xe0ef('0x14')],_0x38c64f[_0xe0ef('0x2a')]);})['then'](function(_0xe88770){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0x2b'),_0x4d959a['id']));return _0x4d959a['update']({'sentiment':_0xe88770[_0xe0ef('0x2c')],'sPositive':_0xe88770[_0xe0ef('0x2d')][_0xe0ef('0x2e')],'sNegative':_0xe88770[_0xe0ef('0x2d')][_0xe0ef('0x2f')],'sMixed':_0xe88770[_0xe0ef('0x2d')][_0xe0ef('0x30')],'sNeutral':_0xe88770[_0xe0ef('0x2d')][_0xe0ef('0x31')]});})['then'](function(){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0x32'),_0x4d959a['id']));_0x4fbb4d();});case _0xe0ef('0x33'):return _0x4d959a[_0xe0ef('0x1e')]({'transcribeStatus':_0xe0ef('0x33'),'failureReason':_0x401f4a[_0xe0ef('0x15')][_0xe0ef('0x34')]})[_0xe0ef('0x19')](function(){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0x32'),_0x4d959a['id']));_0x4fbb4d();});default:logger[_0xe0ef('0xb')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4d959a['id']));break;}}else{return BPromise[_0xe0ef('0x35')]()[_0xe0ef('0x19')](function(){if(!_0x4d959a[_0xe0ef('0x36')]){throw new db[(_0xe0ef('0x1f'))]['ValidationError'](_0xe0ef('0x21'));}if(!_0x38c64f[_0xe0ef('0x22')]||!_0x38c64f['sentimentAccountId']||!_0x38c64f[_0xe0ef('0x24')]||!_0x38c64f['language']||!_0x38c64f['bucket']){throw new db[(_0xe0ef('0x1f'))][(_0xe0ef('0x20'))](_0xe0ef('0x25'));}if(!_0x4d959a[_0xe0ef('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x38c64f[_0xe0ef('0x23')]===_0x90c232['id']){return _0x90c232;}else{return db[_0xe0ef('0x26')]['findOne']({'where':{'id':_settings[_0xe0ef('0x23')]}});}})[_0xe0ef('0x19')](function(_0x24080b){if(!_0x24080b){throw new db[(_0xe0ef('0x1f'))][(_0xe0ef('0x20'))](_0xe0ef('0x37'));}if(!_0x24080b[_0xe0ef('0xf')]||!_0x24080b[_0xe0ef('0x10')]){throw new db[(_0xe0ef('0x1f'))][(_0xe0ef('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x3cce82=_0x24080b;logger[_0xe0ef('0xb')](util['format'](_0xe0ef('0x29'),_0x4d959a['id']));return sentiment(_0x3cce82['data1'],_0x3cce82[_0xe0ef('0x10')],_0x38c64f[_0xe0ef('0x24')],_0x4d959a[_0xe0ef('0x14')],_0x38c64f['language']);})['then'](function(_0x331b9c){logger['info'](util[_0xe0ef('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4d959a['id']));return _0x4d959a[_0xe0ef('0x1e')]({'sentiment':_0x331b9c[_0xe0ef('0x2c')],'sPositive':_0x331b9c[_0xe0ef('0x2d')][_0xe0ef('0x2e')],'sNegative':_0x331b9c[_0xe0ef('0x2d')][_0xe0ef('0x2f')],'sMixed':_0x331b9c[_0xe0ef('0x2d')]['Mixed'],'sNeutral':_0x331b9c[_0xe0ef('0x2d')][_0xe0ef('0x31')],'transcribeStatus':_0xe0ef('0x16')});})['then'](function(){logger[_0xe0ef('0xb')](util[_0xe0ef('0xc')](_0xe0ef('0x32'),_0x4d959a['id']));_0x4fbb4d();});}})['catch'](function(_0x43f87d){if(_0x43f87d){if(!_0x43f87d[_0xe0ef('0x38')]||_0x43f87d[_0xe0ef('0x38')]!==_0xe0ef('0x39')){logger['error'](util[_0xe0ef('0xc')](_0xe0ef('0x3a'),_0x4d959a['id']),util[_0xe0ef('0x3b')](_0x43f87d,{'showHidden':![],'depth':null}));}}_0x4fbb4d();});});}function checkTranscribe(){var _0x2f1747;var _0x5914f7;var _0x14ef85;return db[_0xe0ef('0x3c')][_0xe0ef('0x3d')]({'where':{'transcribeStatus':_0xe0ef('0x3e')}})[_0xe0ef('0x19')](function(_0x1d8fe0){if(!_0x1d8fe0||!_0x1d8fe0[_0xe0ef('0x1d')]){throw new db[(_0xe0ef('0x1f'))][(_0xe0ef('0x20'))](_0xe0ef('0x3f'));}_0x2f1747=_0x1d8fe0;return db[_0xe0ef('0x40')][_0xe0ef('0x27')]({'where':{'id':0x1}});})[_0xe0ef('0x19')](function(_0x1788db){if(!_0x1788db){throw new db[(_0xe0ef('0x1f'))]['ValidationError']('Settings\x20not\x20available');}_0x5914f7=_0x1788db;if(!_0x5914f7[_0xe0ef('0x6')]||!_0x5914f7[_0xe0ef('0x41')]||!_0x5914f7[_0xe0ef('0x11')]||!_0x5914f7[_0xe0ef('0x2a')]||!_0x5914f7[_0xe0ef('0x42')]){throw new db[(_0xe0ef('0x1f'))]['ValidationError'](_0xe0ef('0x43'));}return db[_0xe0ef('0x26')][_0xe0ef('0x27')]({'where':{'id':_0x5914f7[_0xe0ef('0x41')]}});})[_0xe0ef('0x19')](function(_0x53fcdb){if(!_0x53fcdb){throw new db[(_0xe0ef('0x1f'))]['ValidationError'](_0xe0ef('0x37'));}if(!_0x53fcdb[_0xe0ef('0xf')]||!_0x53fcdb[_0xe0ef('0x10')]){throw new db['Sequelize']['ValidationError'](_0xe0ef('0x28'));}_0x14ef85=_0x53fcdb;var _0x369a3e=[];_0x2f1747[_0xe0ef('0x44')](function(_0x362271){_0x369a3e[_0xe0ef('0x45')](checkTranscribeJob(_0x362271,_0x5914f7,_0x14ef85));});return BPromise[_0xe0ef('0x46')](_0x369a3e);})['catch'](function(_0x26663e){if(_0x26663e){if(!_0x26663e[_0xe0ef('0x38')]||_0x26663e[_0xe0ef('0x38')]!=='SequelizeValidationError'){logger[_0xe0ef('0x47')](util['inspect'](_0x26663e,{'showHidden':![],'depth':null}));}}});}exports[_0xe0ef('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 3f80f8d..ad95c54 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 _0xfa34=['emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','length'];(function(_0x452f24,_0x5bb1e2){var _0x2a3b77=function(_0x1d4302){while(--_0x1d4302){_0x452f24['push'](_0x452f24['shift']());}};_0x2a3b77(++_0x5bb1e2);}(_0xfa34,0x74));var _0x4fa3=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0xfa34[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0x4fa3('0x0'));var moment=require(_0x4fa3('0x1'));var Redis=require(_0x4fa3('0x2'));var util=require(_0x4fa3('0x3'));var config=require(_0x4fa3('0x4'));var db=require(_0x4fa3('0x5'))['db'];var logger=require(_0x4fa3('0x6'))('schedule');config[_0x4fa3('0x7')]=_[_0x4fa3('0x8')](config[_0x4fa3('0x7')],{'host':_0x4fa3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4fa3('0x7')]));function closeInteractions(){var _0x735afc=[];return db[_0x4fa3('0xa')][_0x4fa3('0xb')]({'raw':!![],'attributes':['id',_0x4fa3('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4fa3('0xd')](0x18,_0x4fa3('0xe'))}}})[_0x4fa3('0xf')](function(_0x2cbbc9){if(_0x2cbbc9&&_0x2cbbc9['length']){_0x735afc=_[_0x4fa3('0x10')](_0x2cbbc9||[],'id');logger[_0x4fa3('0x11')](_0x4fa3('0x12'),_0x735afc[_0x4fa3('0x13')]());return db['WhatsappInteraction'][_0x4fa3('0x14')]({'closeReason':_0x4fa3('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x4fa3('0x16'))},{'where':{'id':_0x735afc}});}})[_0x4fa3('0xf')](function(){if(_0x735afc&&_0x735afc[_0x4fa3('0x17')]){logger[_0x4fa3('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x735afc[_0x4fa3('0x13')]());for(var _0x32b585=0x0;_0x32b585<_0x735afc[_0x4fa3('0x17')];_0x32b585++){io[_0x4fa3('0x18')](_0x4fa3('0x19'),{'id':_0x735afc[_0x32b585],'closed':!![]});}}})[_0x4fa3('0x1a')](function(_0x1df8fd){logger['error'](_0x4fa3('0x1b'),_0x1df8fd?util['inspect'](_0x1df8fd,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb714=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format'];(function(_0x5c6acd,_0x475638){var _0x20bb67=function(_0x409112){while(--_0x409112){_0x5c6acd['push'](_0x5c6acd['shift']());}};_0x20bb67(++_0x475638);}(_0xb714,0x1eb));var _0x4b71=function(_0x133f36,_0x5047f5){_0x133f36=_0x133f36-0x0;var _0x1120b1=_0xb714[_0x133f36];return _0x1120b1;};'use strict';var _=require('lodash');var moment=require(_0x4b71('0x0'));var Redis=require(_0x4b71('0x1'));var util=require(_0x4b71('0x2'));var config=require(_0x4b71('0x3'));var db=require(_0x4b71('0x4'))['db'];var logger=require(_0x4b71('0x5'))(_0x4b71('0x6'));config[_0x4b71('0x7')]=_['defaults'](config[_0x4b71('0x7')],{'host':_0x4b71('0x8'),'port':0x18eb});var io=require(_0x4b71('0x9'))(new Redis(config[_0x4b71('0x7')]));function closeInteractions(){var _0x4c2c24=[];return db[_0x4b71('0xa')][_0x4b71('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4b71('0xc')](0x18,'hours')}}})[_0x4b71('0xd')](function(_0x5573d7){if(_0x5573d7&&_0x5573d7[_0x4b71('0xe')]){_0x4c2c24=_['map'](_0x5573d7||[],'id');logger[_0x4b71('0xf')](_0x4b71('0x10'),_0x4c2c24[_0x4b71('0x11')]());return db[_0x4b71('0xa')][_0x4b71('0x12')]({'closeReason':_0x4b71('0x13'),'disposition':_0x4b71('0x14'),'closed':!![],'closedAt':moment()[_0x4b71('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4c2c24}});}})[_0x4b71('0xd')](function(){if(_0x4c2c24&&_0x4c2c24[_0x4b71('0xe')]){logger[_0x4b71('0xf')](_0x4b71('0x16'),_0x4c2c24[_0x4b71('0x11')]());for(var _0x50fe40=0x0;_0x50fe40<_0x4c2c24['length'];_0x50fe40++){io[_0x4b71('0x17')]('whatsappInteraction:update',{'id':_0x4c2c24[_0x50fe40],'closed':!![]});}}})['catch'](function(_0x5e7213){logger[_0x4b71('0x18')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x5e7213?util[_0x4b71('0x19')](_0x5e7213,{'showHidden':![],'depth':null}):'');});}exports[_0x4b71('0x1a')]=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 c3dbb1a..11e7879 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60d8=['innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','contacts2','hopper2','catch','../mysqldb','Innocenzo','Biondo'];(function(_0xa69f02,_0x3fd71f){var _0x4f4108=function(_0x2d7762){while(--_0x2d7762){_0xa69f02['push'](_0xa69f02['shift']());}};_0x4f4108(++_0x3fd71f);}(_0x60d8,0xd5));var _0x860d=function(_0x4ce4f3,_0x263935){_0x4ce4f3=_0x4ce4f3-0x0;var _0x450dc5=_0x60d8[_0x4ce4f3];return _0x450dc5;};'use strict';var util=require('util');var db=require(_0x860d('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x860d('0x1')+i,'lastName':_0x860d('0x2')+i,'phone':0xf879fb460+i,'email':_0x860d('0x3')+i+_0x860d('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x860d('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x860d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x860d('0x6')](),'updatedAt':Date[_0x860d('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x860d('0x5')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x860d('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x860d('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x860d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x860d('0x6')](),'updatedAt':Date['now']()});}db[_0x860d('0x7')][_0x860d('0x8')]({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x860d('0x9')](function(){console[_0x860d('0xa')](_0x860d('0xb'),_0x860d('0xc'));return db[_0x860d('0xd')][_0x860d('0x8')]({'where':{}});})['then'](function(){return db[_0x860d('0xd')]['bulkCreate'](hopper);})[_0x860d('0x9')](function(){console[_0x860d('0xa')](_0x860d('0xb'),'hopper1');return db[_0x860d('0x7')][_0x860d('0xe')](contacts2);})['then'](function(){console['log']('finished\x20populating',_0x860d('0xf'));return db[_0x860d('0xd')][_0x860d('0xe')](hopper2);})[_0x860d('0x9')](function(){console[_0x860d('0xa')](_0x860d('0xb'),_0x860d('0x10'));})[_0x860d('0x11')](function(_0x5bd6b0){console[_0x860d('0xa')](_0x5bd6b0);}); \ No newline at end of file +var _0xdff7=['Biondo','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','now'];(function(_0x17f1c9,_0x278f28){var _0x592cfb=function(_0xf2d422){while(--_0xf2d422){_0x17f1c9['push'](_0x17f1c9['shift']());}};_0x592cfb(++_0x278f28);}(_0xdff7,0x182));var _0x7dff=function(_0x5902ee,_0x3d0a9c){_0x5902ee=_0x5902ee-0x0;var _0x56ef9c=_0xdff7[_0x5902ee];return _0x56ef9c;};'use strict';var util=require(_0x7dff('0x0'));var db=require(_0x7dff('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7dff('0x2')]({'id':i,'firstName':_0x7dff('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7dff('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7dff('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7dff('0x4')](),'updatedAt':Date[_0x7dff('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x7dff('0x3')+i,'lastName':_0x7dff('0x5')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x7dff('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7dff('0x4')](),'updatedAt':Date['now']()});}db[_0x7dff('0x6')][_0x7dff('0x7')]({'where':{}})[_0x7dff('0x8')](function(){return db[_0x7dff('0x6')][_0x7dff('0x9')](contacts);})[_0x7dff('0x8')](function(){console[_0x7dff('0xa')]('finished\x20populating',_0x7dff('0xb'));return db[_0x7dff('0xc')][_0x7dff('0x7')]({'where':{}});})[_0x7dff('0x8')](function(){return db['CmHopper'][_0x7dff('0x9')](hopper);})[_0x7dff('0x8')](function(){console[_0x7dff('0xa')](_0x7dff('0xd'),'hopper1');return db[_0x7dff('0x6')][_0x7dff('0x9')](contacts2);})['then'](function(){console['log']('finished\x20populating',_0x7dff('0xe'));return db[_0x7dff('0xc')][_0x7dff('0x9')](hopper2);})['then'](function(){console[_0x7dff('0xa')]('finished\x20populating',_0x7dff('0xf'));})[_0x7dff('0x10')](function(_0x3ba47f){console[_0x7dff('0xa')](_0x3ba47f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1f419dd..e3957fe 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45fc=['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','log','add\x20user','catch','util','push','format','%s%s'];(function(_0x5a0291,_0x4e0418){var _0x2608f5=function(_0x1e7a80){while(--_0x1e7a80){_0x5a0291['push'](_0x5a0291['shift']());}};_0x2608f5(++_0x4e0418);}(_0x45fc,0x88));var _0xc45f=function(_0x2faeb6,_0x2829b3){_0x2faeb6=_0x2faeb6-0x0;var _0xfefc7e=_0x45fc[_0x2faeb6];return _0xfefc7e;};'use strict';var util=require(_0xc45f('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc45f('0x1')]({'name':util[_0xc45f('0x2')](_0xc45f('0x3'),_0xc45f('0x4'),i),'fullname':util[_0xc45f('0x2')]('%s%s',_0xc45f('0x4'),i),'email':util[_0xc45f('0x2')](_0xc45f('0x5'),'agent',i),'role':_0xc45f('0x4'),'password':'password','internal':0xfa0+i,'type':_0xc45f('0x6'),'transport':[_0xc45f('0x7'),'ws',_0xc45f('0x8')],'disallow':['all'],'allow':[_0xc45f('0x9')],'defaultuser':util[_0xc45f('0x2')]('%s%s',_0xc45f('0x4'),i),'encryption':'yes','avpf':_0xc45f('0xa'),'force_avp':_0xc45f('0xa'),'icesupport':_0xc45f('0xa'),'dtlsenable':_0xc45f('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xc45f('0xb'),'dtlssetup':_0xc45f('0xc'),'callerid':util[_0xc45f('0x2')](_0xc45f('0xd'),util[_0xc45f('0x2')]('%s%s',_0xc45f('0x4'),i),0xfa0+i)});}db[_0xc45f('0xe')][_0xc45f('0xf')](users)[_0xc45f('0x10')](function(){console[_0xc45f('0x11')](_0xc45f('0x12'));})[_0xc45f('0x13')](function(_0x1bc441){console[_0xc45f('0x11')](_0x1bc441);}); \ No newline at end of file +var _0xfacd=['log','catch','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xfacd,0xd4));var _0xdfac=function(_0x19a59c,_0x9eec67){_0x19a59c=_0x19a59c-0x0;var _0x112b95=_0xfacd[_0x19a59c];return _0x112b95;};'use strict';var util=require(_0xdfac('0x0'));var db=require(_0xdfac('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xdfac('0x2')]({'name':util[_0xdfac('0x3')](_0xdfac('0x4'),_0xdfac('0x5'),i),'fullname':util['format'](_0xdfac('0x4'),_0xdfac('0x5'),i),'email':util[_0xdfac('0x3')]('%s%s@xcally.com',_0xdfac('0x5'),i),'role':_0xdfac('0x5'),'password':_0xdfac('0x6'),'internal':0xfa0+i,'type':_0xdfac('0x7'),'transport':[_0xdfac('0x8'),'ws',_0xdfac('0x9')],'disallow':[_0xdfac('0xa')],'allow':[_0xdfac('0xb')],'defaultuser':util[_0xdfac('0x3')](_0xdfac('0x4'),_0xdfac('0x5'),i),'encryption':_0xdfac('0xc'),'avpf':_0xdfac('0xc'),'force_avp':_0xdfac('0xc'),'icesupport':'yes','dtlsenable':_0xdfac('0xc'),'dtlsverify':'no','dtlscertfile':_0xdfac('0xd'),'dtlsprivatekey':_0xdfac('0xe'),'dtlssetup':'actpass','callerid':util[_0xdfac('0x3')](_0xdfac('0xf'),util[_0xdfac('0x3')]('%s%s',_0xdfac('0x5'),i),0xfa0+i)});}db[_0xdfac('0x10')][_0xdfac('0x11')](users)[_0xdfac('0x12')](function(){console[_0xdfac('0x13')]('add\x20user');})[_0xdfac('0x14')](function(_0x7ded94){console[_0xdfac('0x13')](_0x7ded94);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8bb53c1..79d68e3 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf25=['UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where','%s:queue:%s','Agents','length','user:%s','query','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','format','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','VoiceQueue','WhatsappQueue','Trunks','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','DISCONNECTED','lodash','util','../mysqldb','./environment','User','name','role','agent','telephone','type','ivr'];(function(_0x358bf3,_0x40ec1f){var _0x248106=function(_0x2eb1f3){while(--_0x2eb1f3){_0x358bf3['push'](_0x358bf3['shift']());}};_0x248106(++_0x40ec1f);}(_0xbf25,0x12d));var _0x5bf2=function(_0x5a5e00,_0x530ae1){_0x5a5e00=_0x5a5e00-0x0;var _0x5a5cf6=_0xbf25[_0x5a5e00];return _0x5a5cf6;};'use strict';var _=require(_0x5bf2('0x0'));var util=require(_0x5bf2('0x1'));var BPromise=require('bluebird');var db=require(_0x5bf2('0x2'))['db'];var config=require(_0x5bf2('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x5bf2('0x4')],'attributes':['id',_0x5bf2('0x5'),_0x5bf2('0x6')],'raw':!![],'where':{'role':_0x5bf2('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5bf2('0x5')],'where':{'role':_0x5bf2('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5bf2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x5bf2('0x5')],'where':{'role':_0x5bf2('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5bf2('0x5'),_0x5bf2('0x9')],'where':{'type':_0x5bf2('0xa')}};function getAssociatedResources(_0x547d93,_0x570e49,_0x4e0d68){return db[_0x5bf2('0xb')][_0x5bf2('0xc')]({'where':{'name':_0x547d93,'userProfileId':_0x570e49},'raw':!![]})[_0x5bf2('0xd')](function(_0xbb7982){if(_0xbb7982){if(_0xbb7982[_0x5bf2('0xe')]){switch(_0x547d93){case _0x5bf2('0xf'):case _0x5bf2('0x10'):case _0x5bf2('0x11'):case _0x5bf2('0x12'):case _0x5bf2('0x13'):case'OpenchannelQueues':case _0x5bf2('0x14'):return db[_0x4e0d68][_0x5bf2('0x15')](queryQueues);case _0x5bf2('0x16'):return db[_0x4e0d68][_0x5bf2('0x15')](queryTelephones);case'Trunks':return db[_0x4e0d68][_0x5bf2('0x15')](queryTrunks);case _0x5bf2('0x17'):return db[_0x4e0d68][_0x5bf2('0x15')](queryCampaigns);}}else{return db[_0x5bf2('0x18')][_0x5bf2('0x15')]({'attributes':[_0x5bf2('0x19')],'where':{'sectionId':_0xbb7982['id']},'raw':!![]})[_0x5bf2('0xd')](function(_0x47ce50){if(_0x47ce50){var _0x5d2d80={'where':{'id':_[_0x5bf2('0x1a')](_0x47ce50,'resourceId')},'raw':!![]};switch(_0x4e0d68){case _0x5bf2('0x4'):_0x5d2d80[_0x5bf2('0x1b')][_0x5bf2('0x6')]=_0x5bf2('0x8');break;case'Campaign':_0x5d2d80[_0x5bf2('0x1b')][_0x5bf2('0x9')]=_0x5bf2('0xa');break;}return db[_0x4e0d68][_0x5bf2('0x15')](_0x5d2d80);}else{return[];}});}}else{return[];}})[_0x5bf2('0xd')](function(_0x36c37d){return _0x36c37d;});}function joinOrLeaveQueues(_0x1b163a,_0x4ef767,_0x289261,_0x18f8a0){_0x1b163a[_0x4ef767](util['format'](_0x5bf2('0x1c'),_0x289261,_0x18f8a0[_0x5bf2('0x5')]));if(_0x18f8a0[_0x5bf2('0x1d')]){for(var _0x4b96df=0x0;_0x4b96df<_0x18f8a0[_0x5bf2('0x1d')][_0x5bf2('0x1e')];_0x4b96df+=0x1){_0x1b163a[_0x4ef767](util['format'](_0x5bf2('0x1f'),_0x18f8a0[_0x5bf2('0x1d')][_0x4b96df][_0x5bf2('0x5')]));}}}function joinOrLeave(_0x1f7bee,_0x326816,_0x5a8897){var _0x157b33;if(_0x1f7bee['handshake'][_0x5bf2('0x20')]['id']){db[_0x5bf2('0x4')][_0x5bf2('0x21')]({'attributes':['id',_0x5bf2('0x5'),_0x5bf2('0x6'),_0x5bf2('0x22')],'where':{'id':_0x1f7bee[_0x5bf2('0x23')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x5bf2('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x5bf2('0x25')],'as':_0x5bf2('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x5bf2('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5bf2('0x28')],'as':_0x5bf2('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x5bf2('0x2a')],'as':_0x5bf2('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x5bf2('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x5bf2('0xd')](function(_0x33a309){if(_0x33a309){_0x157b33=_0x33a309;_0x1f7bee[_0x326816](util[_0x5bf2('0x2d')]('user:%s',_0x33a309[_0x5bf2('0x5')]));var _0x2f7f2f=[];switch(_0x33a309['role']){case _0x5bf2('0x2e'):_0x1f7bee[_0x326816](_0x5bf2('0x2f'));_0x1f7bee[_0x326816](_0x5bf2('0x30'));if(queryQueues[_0x5bf2('0x31')](_0x5bf2('0x32'))){delete queryQueues[_0x5bf2('0x32')];}_0x2f7f2f['push'](db['VoiceQueue'][_0x5bf2('0x15')](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x34')][_0x5bf2('0x15')](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x35')][_0x5bf2('0x15')](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x36')]['findAll'](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x37')][_0x5bf2('0x15')](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x38')][_0x5bf2('0x15')](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db['WhatsappQueue'][_0x5bf2('0x15')](queryQueues));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x4')][_0x5bf2('0x15')](queryTelephones));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x39')][_0x5bf2('0x15')](queryTrunks));_0x2f7f2f[_0x5bf2('0x33')](db[_0x5bf2('0x3a')]['findAll'](queryCampaigns));_0x2f7f2f[_0x5bf2('0x33')](db['User'][_0x5bf2('0x15')](queryAgents));break;case _0x5bf2('0x3b'):_0x1f7bee[_0x326816](_0x5bf2('0x2f'));_0x1f7bee[_0x326816]('voice:outbound');_0x2f7f2f['push'](getAssociatedResources('VoiceQueues',_0x33a309[_0x5bf2('0x22')],_0x5bf2('0x3c')));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources(_0x5bf2('0x10'),_0x33a309[_0x5bf2('0x22')],'ChatQueue'));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources(_0x5bf2('0x11'),_0x33a309['userProfileId'],_0x5bf2('0x35')));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources(_0x5bf2('0x12'),_0x33a309[_0x5bf2('0x22')],_0x5bf2('0x36')));_0x2f7f2f['push'](getAssociatedResources(_0x5bf2('0x13'),_0x33a309['userProfileId'],'MailQueue'));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources('OpenchannelQueues',_0x33a309[_0x5bf2('0x22')],_0x5bf2('0x38')));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources('WhatsappQueues',_0x33a309['userProfileId'],_0x5bf2('0x3d')));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources('Telephones',_0x33a309[_0x5bf2('0x22')],_0x5bf2('0x4')));_0x2f7f2f[_0x5bf2('0x33')](getAssociatedResources(_0x5bf2('0x3e'),_0x33a309[_0x5bf2('0x22')],_0x5bf2('0x39')));_0x2f7f2f['push'](getAssociatedResources(_0x5bf2('0x17'),_0x33a309[_0x5bf2('0x22')],_0x5bf2('0x3a')));_0x2f7f2f['push'](db[_0x5bf2('0x4')]['findAll'](queryAgents));break;case'agent':_0x1f7bee[_0x326816]('voice:inbound');_0x1f7bee[_0x326816](_0x5bf2('0x30'));_0x2f7f2f[_0x5bf2('0x33')](_0x33a309['getVoiceQueues']({'attributes':['id','name']}));_0x2f7f2f[_0x5bf2('0x33')](_0x33a309[_0x5bf2('0x3f')]({'attributes':['id',_0x5bf2('0x5')]}));_0x2f7f2f['push'](_0x33a309['getFaxQueues']({'attributes':['id',_0x5bf2('0x5')]}));_0x2f7f2f[_0x5bf2('0x33')](_0x33a309[_0x5bf2('0x40')]({'attributes':['id','name']}));_0x2f7f2f[_0x5bf2('0x33')](_0x33a309[_0x5bf2('0x41')]({'attributes':['id',_0x5bf2('0x5')]}));_0x2f7f2f['push'](_0x33a309[_0x5bf2('0x42')]({'attributes':['id',_0x5bf2('0x5')]}));_0x2f7f2f[_0x5bf2('0x33')](_0x33a309[_0x5bf2('0x43')]({'attributes':['id','name']}));break;}return BPromise[_0x5bf2('0x44')](_0x2f7f2f);}})[_0x5bf2('0xd')](function(_0x5ec8f6){if(_0x5ec8f6&&_0x5ec8f6['length']){for(var _0x41fe1b=0x0;_0x41fe1b<_0x5ec8f6[_0x5bf2('0x1e')];_0x41fe1b+=0x1){for(var _0x4421c6=0x0;_0x4421c6<_0x5ec8f6[_0x41fe1b][_0x5bf2('0x1e')];_0x4421c6+=0x1){switch(_0x41fe1b){case 0x0:joinOrLeaveQueues(_0x1f7bee,_0x326816,_0x5bf2('0x45'),_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x1:joinOrLeaveQueues(_0x1f7bee,_0x326816,_0x5bf2('0x46'),_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x2:joinOrLeaveQueues(_0x1f7bee,_0x326816,_0x5bf2('0x47'),_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x3:joinOrLeaveQueues(_0x1f7bee,_0x326816,_0x5bf2('0x48'),_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x4:joinOrLeaveQueues(_0x1f7bee,_0x326816,'mail',_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x5:joinOrLeaveQueues(_0x1f7bee,_0x326816,_0x5bf2('0x49'),_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x6:joinOrLeaveQueues(_0x1f7bee,_0x326816,_0x5bf2('0x4a'),_0x5ec8f6[_0x41fe1b][_0x4421c6]);break;case 0x7:if(_0x157b33['role']!==_0x5bf2('0x7'))_0x1f7bee[_0x326816](util[_0x5bf2('0x2d')](_0x5bf2('0x4b'),_0x5ec8f6[_0x41fe1b][_0x4421c6][_0x5bf2('0x5')]));break;case 0x8:if(_0x157b33['role']!==_0x5bf2('0x7'))_0x1f7bee[_0x326816](util[_0x5bf2('0x2d')](_0x5bf2('0x4c'),_0x5ec8f6[_0x41fe1b][_0x4421c6]['name']));break;case 0x9:if(_0x157b33[_0x5bf2('0x6')]!==_0x5bf2('0x7'))_0x1f7bee[_0x326816](util[_0x5bf2('0x2d')](_0x5bf2('0x4d'),_0x5ec8f6[_0x41fe1b][_0x4421c6][_0x5bf2('0x9')],_0x5ec8f6[_0x41fe1b][_0x4421c6][_0x5bf2('0x5')]));break;case 0xa:_0x1f7bee[_0x326816](util[_0x5bf2('0x2d')](_0x5bf2('0x1f'),_0x5ec8f6[_0x41fe1b][_0x4421c6][_0x5bf2('0x5')]));break;}}}}})[_0x5bf2('0xd')](function(){if(_0x326816===_0x5bf2('0x4e')){var _0x1b39b1=_[_0x5bf2('0x1a')](_0x157b33['ChatInteractions'],'id');return _0x157b33[_0x5bf2('0x4f')](_0x1b39b1)[_0x5bf2('0xd')](function(){for(var _0x50d2a1=0x0;_0x50d2a1<_0x1b39b1[_0x5bf2('0x1e')];_0x50d2a1+=0x1){_0x5a8897[_0x5bf2('0x50')](_0x5bf2('0x51'),{'ChatInteractionId':Number(_0x1b39b1[_0x50d2a1]),'UserId':Number(_0x157b33['id'])});}});}})[_0x5bf2('0xd')](function(){if(_0x326816===_0x5bf2('0x4e')){var _0x498cf6=_[_0x5bf2('0x1a')](_0x157b33[_0x5bf2('0x26')],'id');return _0x157b33[_0x5bf2('0x52')](_0x498cf6)[_0x5bf2('0xd')](function(){for(var _0x47efdb=0x0;_0x47efdb<_0x498cf6['length'];_0x47efdb+=0x1){_0x5a8897[_0x5bf2('0x50')](_0x5bf2('0x53'),{'MailInteractionId':Number(_0x498cf6[_0x47efdb]),'UserId':Number(_0x157b33['id'])});}});}})[_0x5bf2('0xd')](function(){if(_0x326816===_0x5bf2('0x4e')){var _0x191b5f=_[_0x5bf2('0x1a')](_0x157b33['FaxInteractions'],'id');return _0x157b33[_0x5bf2('0x54')](_0x191b5f)[_0x5bf2('0xd')](function(){for(var _0x198f78=0x0;_0x198f78<_0x191b5f['length'];_0x198f78+=0x1){_0x5a8897['emit'](_0x5bf2('0x55'),{'FaxInteractionId':Number(_0x191b5f[_0x198f78]),'UserId':Number(_0x157b33['id'])});}});}})[_0x5bf2('0xd')](function(){if(_0x326816==='leave'){var _0x5382bf=_[_0x5bf2('0x1a')](_0x157b33[_0x5bf2('0x29')],'id');return _0x157b33[_0x5bf2('0x56')](_0x5382bf)[_0x5bf2('0xd')](function(){for(var _0x5b63e2=0x0;_0x5b63e2<_0x5382bf[_0x5bf2('0x1e')];_0x5b63e2+=0x1){_0x5a8897[_0x5bf2('0x50')](_0x5bf2('0x57'),{'SmsInteractionId':Number(_0x5382bf[_0x5b63e2]),'UserId':Number(_0x157b33['id'])});}});}})[_0x5bf2('0xd')](function(){if(_0x326816==='leave'){var _0x492c8c=_[_0x5bf2('0x1a')](_0x157b33['OpenchannelInteractions'],'id');return _0x157b33[_0x5bf2('0x58')](_0x492c8c)[_0x5bf2('0xd')](function(){for(var _0x39ae07=0x0;_0x39ae07<_0x492c8c[_0x5bf2('0x1e')];_0x39ae07+=0x1){_0x5a8897[_0x5bf2('0x50')](_0x5bf2('0x59'),{'OpenchannelInteractionId':Number(_0x492c8c[_0x39ae07]),'UserId':Number(_0x157b33['id'])});}});}})[_0x5bf2('0xd')](function(){if(_0x326816===_0x5bf2('0x4e')){var _0x4e2502=_[_0x5bf2('0x1a')](_0x157b33['WhatsappInteractions'],'id');return _0x157b33[_0x5bf2('0x5a')](_0x4e2502)[_0x5bf2('0xd')](function(){for(var _0x5b22eb=0x0;_0x5b22eb<_0x4e2502[_0x5bf2('0x1e')];_0x5b22eb+=0x1){_0x5a8897[_0x5bf2('0x50')](_0x5bf2('0x5b'),{'WhatsappInteractionId':Number(_0x4e2502[_0x5b22eb]),'UserId':Number(_0x157b33['id'])});}});}})[_0x5bf2('0x5c')](function(_0x1be1bf){_0x1f7bee[_0x5bf2('0x5d')](_0x1be1bf);});}}function onDisconnect(_0x1f390e,_0x226d87){joinOrLeave(_0x1f390e,_0x5bf2('0x4e'),_0x226d87);}function onConnect(_0x4b8fb3){joinOrLeave(_0x4b8fb3,_0x5bf2('0x5e'));}exports[_0x5bf2('0x5f')]=function(_0x25faca){_0x25faca['on'](_0x5bf2('0x60'),function(_0x735c93){_0x735c93['setMaxListeners'](0x0);_0x735c93[_0x5bf2('0x61')]=_0x735c93[_0x5bf2('0x62')][_0x5bf2('0x60')][_0x5bf2('0x63')]+':'+_0x735c93[_0x5bf2('0x62')]['connection'][_0x5bf2('0x64')];_0x735c93[_0x5bf2('0x65')]=new Date();_0x735c93['log']=function(_0x2b0d45){console[_0x5bf2('0x5d')](_0x5bf2('0x66')+_0x735c93['nsp'][_0x5bf2('0x5')]+'['+_0x735c93['address']+']',_0x2b0d45);};_0x735c93['on']('disconnect',function(){onDisconnect(_0x735c93,_0x25faca);_0x735c93[_0x5bf2('0x5d')](_0x5bf2('0x67'));});onConnect(_0x735c93);_0x735c93[_0x5bf2('0x5d')]('CONNECTED');});}; \ No newline at end of file +var _0xb0d4=['map','where','role','format','%s:queue:%s','length','find','userProfileId','handshake','query','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','SmsQueue','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId'];(function(_0x4f777e,_0x64bdbb){var _0x410839=function(_0x250a89){while(--_0x250a89){_0x4f777e['push'](_0x4f777e['shift']());}};_0x410839(++_0x64bdbb);}(_0xb0d4,0x1e1));var _0x4b0d=function(_0x5db4c8,_0x46462a){_0x5db4c8=_0x5db4c8-0x0;var _0x27d8c2=_0xb0d4[_0x5db4c8];return _0x27d8c2;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x4b0d('0x0'));var db=require(_0x4b0d('0x1'))['db'];var config=require(_0x4b0d('0x2'));var queryQueues={'attributes':['id',_0x4b0d('0x3')],'include':[{'as':_0x4b0d('0x4'),'model':db[_0x4b0d('0x5')],'attributes':['id',_0x4b0d('0x3'),'role'],'raw':!![],'where':{'role':_0x4b0d('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4b0d('0x3')],'where':{'role':_0x4b0d('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4b0d('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x4b0d('0x3')],'where':{'role':_0x4b0d('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4b0d('0x3'),_0x4b0d('0x8')],'where':{'type':_0x4b0d('0x9')}};function getAssociatedResources(_0x369b77,_0x51ff3e,_0x329fe4){return db['UserProfileSection'][_0x4b0d('0xa')]({'where':{'name':_0x369b77,'userProfileId':_0x51ff3e},'raw':!![]})[_0x4b0d('0xb')](function(_0x5e851f){if(_0x5e851f){if(_0x5e851f[_0x4b0d('0xc')]){switch(_0x369b77){case _0x4b0d('0xd'):case'ChatQueues':case _0x4b0d('0xe'):case _0x4b0d('0xf'):case _0x4b0d('0x10'):case _0x4b0d('0x11'):case _0x4b0d('0x12'):return db[_0x329fe4][_0x4b0d('0x13')](queryQueues);case'Telephones':return db[_0x329fe4][_0x4b0d('0x13')](queryTelephones);case _0x4b0d('0x14'):return db[_0x329fe4]['findAll'](queryTrunks);case _0x4b0d('0x15'):return db[_0x329fe4][_0x4b0d('0x13')](queryCampaigns);}}else{return db[_0x4b0d('0x16')][_0x4b0d('0x13')]({'attributes':[_0x4b0d('0x17')],'where':{'sectionId':_0x5e851f['id']},'raw':!![]})['then'](function(_0x494844){if(_0x494844){var _0x4b008b={'where':{'id':_[_0x4b0d('0x18')](_0x494844,'resourceId')},'raw':!![]};switch(_0x329fe4){case _0x4b0d('0x5'):_0x4b008b[_0x4b0d('0x19')][_0x4b0d('0x1a')]='telephone';break;case'Campaign':_0x4b008b[_0x4b0d('0x19')][_0x4b0d('0x8')]='ivr';break;}return db[_0x329fe4][_0x4b0d('0x13')](_0x4b008b);}else{return[];}});}}else{return[];}})['then'](function(_0x1fa4ba){return _0x1fa4ba;});}function joinOrLeaveQueues(_0x140f13,_0x15aa25,_0x2bd70f,_0x34154f){_0x140f13[_0x15aa25](util[_0x4b0d('0x1b')](_0x4b0d('0x1c'),_0x2bd70f,_0x34154f[_0x4b0d('0x3')]));if(_0x34154f[_0x4b0d('0x4')]){for(var _0x3b2786=0x0;_0x3b2786<_0x34154f[_0x4b0d('0x4')][_0x4b0d('0x1d')];_0x3b2786+=0x1){_0x140f13[_0x15aa25](util['format']('user:%s',_0x34154f['Agents'][_0x3b2786][_0x4b0d('0x3')]));}}}function joinOrLeave(_0x20e1ba,_0x301ca5,_0x2be178){var _0x3ccc22;if(_0x20e1ba['handshake']['query']['id']){db[_0x4b0d('0x5')][_0x4b0d('0x1e')]({'attributes':['id','name',_0x4b0d('0x1a'),_0x4b0d('0x1f')],'where':{'id':_0x20e1ba[_0x4b0d('0x20')][_0x4b0d('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x4b0d('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x4b0d('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4b0d('0x24')],'as':_0x4b0d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4b0d('0x26')],'as':_0x4b0d('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x4b0d('0x28')],'as':_0x4b0d('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x4b0d('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x4b0d('0xb')](function(_0x58260a){if(_0x58260a){_0x3ccc22=_0x58260a;_0x20e1ba[_0x301ca5](util[_0x4b0d('0x1b')](_0x4b0d('0x2b'),_0x58260a['name']));var _0x538852=[];switch(_0x58260a['role']){case _0x4b0d('0x2c'):_0x20e1ba[_0x301ca5](_0x4b0d('0x2d'));_0x20e1ba[_0x301ca5](_0x4b0d('0x2e'));if(queryQueues[_0x4b0d('0x2f')](_0x4b0d('0x30'))){delete queryQueues['include'];}_0x538852[_0x4b0d('0x31')](db[_0x4b0d('0x32')][_0x4b0d('0x13')](queryQueues));_0x538852[_0x4b0d('0x31')](db[_0x4b0d('0x33')][_0x4b0d('0x13')](queryQueues));_0x538852['push'](db[_0x4b0d('0x34')][_0x4b0d('0x13')](queryQueues));_0x538852[_0x4b0d('0x31')](db['SmsQueue'][_0x4b0d('0x13')](queryQueues));_0x538852[_0x4b0d('0x31')](db['MailQueue'][_0x4b0d('0x13')](queryQueues));_0x538852[_0x4b0d('0x31')](db[_0x4b0d('0x35')][_0x4b0d('0x13')](queryQueues));_0x538852['push'](db[_0x4b0d('0x36')][_0x4b0d('0x13')](queryQueues));_0x538852[_0x4b0d('0x31')](db['User'][_0x4b0d('0x13')](queryTelephones));_0x538852['push'](db[_0x4b0d('0x37')][_0x4b0d('0x13')](queryTrunks));_0x538852[_0x4b0d('0x31')](db[_0x4b0d('0x38')][_0x4b0d('0x13')](queryCampaigns));_0x538852['push'](db[_0x4b0d('0x5')][_0x4b0d('0x13')](queryAgents));break;case _0x4b0d('0x39'):_0x20e1ba[_0x301ca5](_0x4b0d('0x2d'));_0x20e1ba[_0x301ca5](_0x4b0d('0x2e'));_0x538852[_0x4b0d('0x31')](getAssociatedResources(_0x4b0d('0xd'),_0x58260a[_0x4b0d('0x1f')],_0x4b0d('0x32')));_0x538852[_0x4b0d('0x31')](getAssociatedResources('ChatQueues',_0x58260a[_0x4b0d('0x1f')],_0x4b0d('0x33')));_0x538852[_0x4b0d('0x31')](getAssociatedResources('FaxQueues',_0x58260a[_0x4b0d('0x1f')],'FaxQueue'));_0x538852[_0x4b0d('0x31')](getAssociatedResources(_0x4b0d('0xf'),_0x58260a['userProfileId'],_0x4b0d('0x3a')));_0x538852['push'](getAssociatedResources(_0x4b0d('0x10'),_0x58260a['userProfileId'],'MailQueue'));_0x538852[_0x4b0d('0x31')](getAssociatedResources(_0x4b0d('0x11'),_0x58260a[_0x4b0d('0x1f')],'OpenchannelQueue'));_0x538852['push'](getAssociatedResources(_0x4b0d('0x12'),_0x58260a[_0x4b0d('0x1f')],_0x4b0d('0x36')));_0x538852[_0x4b0d('0x31')](getAssociatedResources('Telephones',_0x58260a['userProfileId'],_0x4b0d('0x5')));_0x538852[_0x4b0d('0x31')](getAssociatedResources(_0x4b0d('0x14'),_0x58260a[_0x4b0d('0x1f')],_0x4b0d('0x37')));_0x538852[_0x4b0d('0x31')](getAssociatedResources(_0x4b0d('0x15'),_0x58260a[_0x4b0d('0x1f')],_0x4b0d('0x38')));_0x538852[_0x4b0d('0x31')](db['User']['findAll'](queryAgents));break;case _0x4b0d('0x6'):_0x20e1ba[_0x301ca5](_0x4b0d('0x2d'));_0x20e1ba[_0x301ca5](_0x4b0d('0x2e'));_0x538852[_0x4b0d('0x31')](_0x58260a[_0x4b0d('0x3b')]({'attributes':['id',_0x4b0d('0x3')]}));_0x538852['push'](_0x58260a['getChatQueues']({'attributes':['id',_0x4b0d('0x3')]}));_0x538852[_0x4b0d('0x31')](_0x58260a['getFaxQueues']({'attributes':['id',_0x4b0d('0x3')]}));_0x538852[_0x4b0d('0x31')](_0x58260a[_0x4b0d('0x3c')]({'attributes':['id',_0x4b0d('0x3')]}));_0x538852[_0x4b0d('0x31')](_0x58260a[_0x4b0d('0x3d')]({'attributes':['id',_0x4b0d('0x3')]}));_0x538852[_0x4b0d('0x31')](_0x58260a[_0x4b0d('0x3e')]({'attributes':['id',_0x4b0d('0x3')]}));_0x538852[_0x4b0d('0x31')](_0x58260a[_0x4b0d('0x3f')]({'attributes':['id',_0x4b0d('0x3')]}));break;}return BPromise[_0x4b0d('0x40')](_0x538852);}})[_0x4b0d('0xb')](function(_0x3ba8d0){if(_0x3ba8d0&&_0x3ba8d0[_0x4b0d('0x1d')]){for(var _0x5b910f=0x0;_0x5b910f<_0x3ba8d0['length'];_0x5b910f+=0x1){for(var _0x1d7ebf=0x0;_0x1d7ebf<_0x3ba8d0[_0x5b910f]['length'];_0x1d7ebf+=0x1){switch(_0x5b910f){case 0x0:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,_0x4b0d('0x41'),_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x1:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,_0x4b0d('0x42'),_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x2:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,_0x4b0d('0x43'),_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x3:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,'sms',_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x4:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,_0x4b0d('0x44'),_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x5:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,_0x4b0d('0x45'),_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x6:joinOrLeaveQueues(_0x20e1ba,_0x301ca5,_0x4b0d('0x46'),_0x3ba8d0[_0x5b910f][_0x1d7ebf]);break;case 0x7:if(_0x3ccc22[_0x4b0d('0x1a')]!==_0x4b0d('0x6'))_0x20e1ba[_0x301ca5](util[_0x4b0d('0x1b')](_0x4b0d('0x47'),_0x3ba8d0[_0x5b910f][_0x1d7ebf][_0x4b0d('0x3')]));break;case 0x8:if(_0x3ccc22[_0x4b0d('0x1a')]!==_0x4b0d('0x6'))_0x20e1ba[_0x301ca5](util[_0x4b0d('0x1b')](_0x4b0d('0x48'),_0x3ba8d0[_0x5b910f][_0x1d7ebf][_0x4b0d('0x3')]));break;case 0x9:if(_0x3ccc22[_0x4b0d('0x1a')]!==_0x4b0d('0x6'))_0x20e1ba[_0x301ca5](util['format'](_0x4b0d('0x49'),_0x3ba8d0[_0x5b910f][_0x1d7ebf][_0x4b0d('0x8')],_0x3ba8d0[_0x5b910f][_0x1d7ebf][_0x4b0d('0x3')]));break;case 0xa:_0x20e1ba[_0x301ca5](util[_0x4b0d('0x1b')](_0x4b0d('0x2b'),_0x3ba8d0[_0x5b910f][_0x1d7ebf][_0x4b0d('0x3')]));break;}}}}})[_0x4b0d('0xb')](function(){if(_0x301ca5===_0x4b0d('0x4a')){var _0x2443ad=_['map'](_0x3ccc22[_0x4b0d('0x22')],'id');return _0x3ccc22['removeChatInteractions'](_0x2443ad)['then'](function(){for(var _0x343551=0x0;_0x343551<_0x2443ad[_0x4b0d('0x1d')];_0x343551+=0x1){_0x2be178[_0x4b0d('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2443ad[_0x343551]),'UserId':Number(_0x3ccc22['id'])});}});}})['then'](function(){if(_0x301ca5===_0x4b0d('0x4a')){var _0x10d771=_[_0x4b0d('0x18')](_0x3ccc22['MailInteractions'],'id');return _0x3ccc22[_0x4b0d('0x4c')](_0x10d771)['then'](function(){for(var _0x4044e4=0x0;_0x4044e4<_0x10d771[_0x4b0d('0x1d')];_0x4044e4+=0x1){_0x2be178[_0x4b0d('0x4b')](_0x4b0d('0x4d'),{'MailInteractionId':Number(_0x10d771[_0x4044e4]),'UserId':Number(_0x3ccc22['id'])});}});}})['then'](function(){if(_0x301ca5==='leave'){var _0x2aaa95=_[_0x4b0d('0x18')](_0x3ccc22[_0x4b0d('0x25')],'id');return _0x3ccc22[_0x4b0d('0x4e')](_0x2aaa95)[_0x4b0d('0xb')](function(){for(var _0xc3c14c=0x0;_0xc3c14c<_0x2aaa95[_0x4b0d('0x1d')];_0xc3c14c+=0x1){_0x2be178[_0x4b0d('0x4b')](_0x4b0d('0x4f'),{'FaxInteractionId':Number(_0x2aaa95[_0xc3c14c]),'UserId':Number(_0x3ccc22['id'])});}});}})['then'](function(){if(_0x301ca5===_0x4b0d('0x4a')){var _0x735ad8=_['map'](_0x3ccc22[_0x4b0d('0x27')],'id');return _0x3ccc22[_0x4b0d('0x50')](_0x735ad8)[_0x4b0d('0xb')](function(){for(var _0x5432a6=0x0;_0x5432a6<_0x735ad8['length'];_0x5432a6+=0x1){_0x2be178[_0x4b0d('0x4b')](_0x4b0d('0x51'),{'SmsInteractionId':Number(_0x735ad8[_0x5432a6]),'UserId':Number(_0x3ccc22['id'])});}});}})['then'](function(){if(_0x301ca5===_0x4b0d('0x4a')){var _0x14bb49=_[_0x4b0d('0x18')](_0x3ccc22[_0x4b0d('0x29')],'id');return _0x3ccc22[_0x4b0d('0x52')](_0x14bb49)[_0x4b0d('0xb')](function(){for(var _0x1d8c61=0x0;_0x1d8c61<_0x14bb49[_0x4b0d('0x1d')];_0x1d8c61+=0x1){_0x2be178[_0x4b0d('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x14bb49[_0x1d8c61]),'UserId':Number(_0x3ccc22['id'])});}});}})['then'](function(){if(_0x301ca5===_0x4b0d('0x4a')){var _0xfb79d3=_[_0x4b0d('0x18')](_0x3ccc22[_0x4b0d('0x53')],'id');return _0x3ccc22[_0x4b0d('0x54')](_0xfb79d3)[_0x4b0d('0xb')](function(){for(var _0x36468f=0x0;_0x36468f<_0xfb79d3[_0x4b0d('0x1d')];_0x36468f+=0x1){_0x2be178[_0x4b0d('0x4b')](_0x4b0d('0x55'),{'WhatsappInteractionId':Number(_0xfb79d3[_0x36468f]),'UserId':Number(_0x3ccc22['id'])});}});}})[_0x4b0d('0x56')](function(_0x36a6be){_0x20e1ba[_0x4b0d('0x57')](_0x36a6be);});}}function onDisconnect(_0x524776,_0x251161){joinOrLeave(_0x524776,_0x4b0d('0x4a'),_0x251161);}function onConnect(_0x35c09d){joinOrLeave(_0x35c09d,_0x4b0d('0x58'));}exports[_0x4b0d('0x59')]=function(_0x4b67a5){_0x4b67a5['on'](_0x4b0d('0x5a'),function(_0x36435c){_0x36435c[_0x4b0d('0x5b')](0x0);_0x36435c[_0x4b0d('0x5c')]=_0x36435c['request']['connection']['remoteAddress']+':'+_0x36435c[_0x4b0d('0x5d')]['connection'][_0x4b0d('0x5e')];_0x36435c[_0x4b0d('0x5f')]=new Date();_0x36435c[_0x4b0d('0x57')]=function(_0x1a9be7){console[_0x4b0d('0x57')](_0x4b0d('0x60')+_0x36435c[_0x4b0d('0x61')][_0x4b0d('0x3')]+'['+_0x36435c[_0x4b0d('0x5c')]+']',_0x1a9be7);};_0x36435c['on'](_0x4b0d('0x62'),function(){onDisconnect(_0x36435c,_0x4b67a5);_0x36435c[_0x4b0d('0x57')](_0x4b0d('0x63'));});onConnect(_0x36435c);_0x36435c[_0x4b0d('0x57')](_0x4b0d('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 8a90a6d..076c771 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 _0x2520=['SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','catch','get','channel','motionChannel','resolve','ContactId','undefined','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','AfterCreateMessage','event','offlineMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','agent','AfterCreate','closed','changed','substatus','name','AfterUpdate','find','internal','default','hasOwnProperty','model','callback','toLowerCase','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2520,0x7b));var _0x0252=function(_0xf4e2,_0x141bdf){_0xf4e2=_0xf4e2-0x0;var _0x4b0d4a=_0x2520[_0xf4e2];return _0x4b0d4a;};'use strict';var util=require('util');var db=require(_0x0252('0x0'))['db'];var jayson=require(_0x0252('0x1'));var logger=require(_0x0252('0x2'))(_0x0252('0x3'));var client=jayson[_0x0252('0x4')][_0x0252('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x0252('0x6'),'event':_0x0252('0x7'),'condition':_0x0252('0x8'),'callback':afterCreate},{'channel':_0x0252('0x9'),'model':'ChatInteraction','event':_0x0252('0xa'),'condition':_0x0252('0xb'),'callback':afterUpdate},{'channel':_0x0252('0x9'),'model':_0x0252('0xc'),'event':_0x0252('0x7'),'condition':_0x0252('0xd'),'callback':afterCreateMessage},{'channel':_0x0252('0x9'),'model':'ChatOfflineMessage','event':_0x0252('0x7'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x0252('0xe'),'model':_0x0252('0xf'),'event':'afterCreate','condition':_0x0252('0x8'),'callback':afterCreate},{'channel':_0x0252('0xe'),'model':_0x0252('0xf'),'event':'afterUpdate','condition':_0x0252('0xb'),'callback':afterUpdate},{'channel':'Sms','model':_0x0252('0x10'),'event':'afterCreate','condition':_0x0252('0xd'),'callback':afterCreateMessage},{'channel':_0x0252('0x11'),'model':_0x0252('0x12'),'event':_0x0252('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0252('0x11'),'model':_0x0252('0x12'),'event':_0x0252('0xa'),'condition':_0x0252('0xb'),'callback':afterUpdate},{'channel':_0x0252('0x11'),'model':_0x0252('0x13'),'event':_0x0252('0x7'),'condition':_0x0252('0xd'),'callback':afterCreateMessage},{'channel':_0x0252('0x14'),'model':_0x0252('0x15'),'event':_0x0252('0x7'),'condition':_0x0252('0x8'),'callback':afterCreate},{'channel':_0x0252('0x14'),'model':_0x0252('0x15'),'event':_0x0252('0xa'),'condition':_0x0252('0xb'),'callback':afterUpdate},{'channel':'Fax','model':_0x0252('0x16'),'event':_0x0252('0x7'),'condition':_0x0252('0xd'),'callback':afterCreateMessage},{'channel':_0x0252('0x17'),'model':_0x0252('0x18'),'event':_0x0252('0x7'),'condition':_0x0252('0x8'),'callback':afterCreate},{'channel':_0x0252('0x17'),'model':_0x0252('0x18'),'event':_0x0252('0xa'),'condition':_0x0252('0xb'),'callback':afterUpdate},{'channel':_0x0252('0x17'),'model':_0x0252('0x19'),'event':_0x0252('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0252('0x1a'),'model':_0x0252('0x1b'),'event':_0x0252('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0252('0x1a'),'model':'OpenchannelInteraction','event':_0x0252('0xa'),'condition':_0x0252('0xb'),'callback':afterUpdate},{'channel':_0x0252('0x1a'),'model':_0x0252('0x1c'),'event':_0x0252('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x54fe4d){return client[_0x0252('0x1d')](_0x0252('0x1e'),_0x54fe4d)[_0x0252('0x1f')](function(_0x176fd3){logger[_0x0252('0x20')](_0x0252('0x21'),_0x0252('0x1e'),_0x176fd3);if(_0x176fd3[_0x0252('0x22')]){if(_0x176fd3[_0x0252('0x22')]['code']===0x1f4){logger[_0x0252('0x22')](_0x0252('0x21'),_0x0252('0x1e'),_0x176fd3[_0x0252('0x22')]);}}})[_0x0252('0x23')](function(_0x1d3572){logger['error']('Trigger,\x20%s','EventManager',_0x1d3572);});}function afterCreateMessage(_0x205f08){return function(_0x162ae8){_0x162ae8=_0x162ae8[_0x0252('0x24')]({'plain':!![]});_0x162ae8[_0x0252('0x25')]=_0x205f08;_0x162ae8[_0x0252('0x26')]=_0x205f08;_0x162ae8['event']=_0x162ae8['direction'];Promise[_0x0252('0x27')]()[_0x0252('0x1f')](function(){if(typeof _0x162ae8[_0x0252('0x28')]===_0x0252('0x29'))return null;var _0x540527='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x162ae8[_0x0252('0x28')];return db[_0x0252('0x2a')]['query'](_0x540527,{'type':db[_0x0252('0x2b')][_0x0252('0x2c')][_0x0252('0x2d')],'raw':!![]});})['then'](function(_0x1f93d9){if(_0x1f93d9){_0x162ae8[_0x0252('0x2e')]=_0x1f93d9[0x0];}if(typeof _0x162ae8[_0x0252('0x2f')]===_0x0252('0x29'))return;return getAgent(_0x162ae8[_0x0252('0x2f')]);})[_0x0252('0x1f')](function(_0x31afea){if(_0x31afea){_0x162ae8[_0x0252('0x30')]=util[_0x0252('0x31')](_0x0252('0x32'),_0x31afea['name']);_0x162ae8['agent']=_0x31afea;_0x162ae8[_0x0252('0x25')]=_0x205f08;return request({'event':'incomingmessage','message':_0x162ae8});}else{return request({'event':'outgoingmessage','message':_0x162ae8});}})[_0x0252('0x23')](function(_0x2a8744){logger['error'](_0x0252('0x21'),_0x0252('0x33'),_0x2a8744);});};}function afterCreateOfflineMessage(_0x4067dd){return function(_0x31e581){_0x31e581=_0x31e581[_0x0252('0x24')]({'plain':!![]});_0x31e581['channel']=_0x4067dd;_0x31e581[_0x0252('0x26')]=_0x4067dd;_0x31e581[_0x0252('0x34')]=_0x0252('0x35');return request({'event':_0x31e581[_0x0252('0x34')],'message':_0x31e581});};}function afterCreate(_0x5d45ea,_0x46a75b){return function(_0x3ddaca){_0x3ddaca=_0x3ddaca[_0x0252('0x24')]({'plain':!![]});_0x3ddaca[_0x0252('0x25')]=_0x5d45ea;_0x3ddaca[_0x0252('0x26')]=_0x5d45ea;_0x3ddaca[_0x0252('0x34')]='opened';Promise[_0x0252('0x27')]()[_0x0252('0x1f')](function(){var _0x188ff4=_0x0252('0x36')+_0x3ddaca[_0x0252('0x28')];return db[_0x0252('0x2a')]['query'](_0x188ff4,{'type':db[_0x0252('0x2b')][_0x0252('0x2c')][_0x0252('0x2d')],'raw':!![]});})[_0x0252('0x1f')](function(_0xc27ce7){if(_0xc27ce7){_0x3ddaca['contact']=_0xc27ce7[0x0];}if(typeof _0x3ddaca[_0x0252('0x2f')]===_0x0252('0x29'))return;return getAgent(_0x3ddaca[_0x0252('0x2f')]);})['then'](function(_0x5c0c5c){if(_0x5c0c5c){_0x3ddaca[_0x0252('0x30')]=util['format']('SIP/%s',_0x5c0c5c['name']);_0x3ddaca[_0x0252('0x37')]=_0x5c0c5c;}return request({'event':_0x46a75b,'message':_0x3ddaca});})[_0x0252('0x23')](function(_0xedacc5){logger['error'](_0x0252('0x21'),_0x0252('0x38'),_0xedacc5);});};}function afterUpdate(_0x1797c7){return function(_0x4f7b82){var _0x163403=_0x4f7b82['changed'](_0x0252('0x39'))&&_0x4f7b82[_0x0252('0x39')];var _0x2f42db=_0x4f7b82[_0x0252('0x3a')](_0x0252('0x3b'));if(_0x163403||_0x2f42db){var _0x4e3a8a=_0x163403?_0x0252('0xb'):'substatus';var _0x35231e=_0x4f7b82[_0x0252('0x24')]({'plain':!![]});_0x35231e[_0x0252('0x25')]=_0x1797c7;_0x35231e['motionChannel']=_0x1797c7;_0x35231e[_0x0252('0x34')]=_0x163403?_0x0252('0x39'):_0x0252('0x3b');var _0x5287a5=_0x0252('0x36')+_0x35231e[_0x0252('0x28')];return db[_0x0252('0x2a')]['query'](_0x5287a5,{'type':db[_0x0252('0x2b')]['QueryTypes'][_0x0252('0x2d')],'raw':!![]})['then'](function(_0x1614a6){if(_0x1614a6){_0x35231e[_0x0252('0x2e')]=_0x1614a6[0x0];}if(typeof _0x35231e[_0x0252('0x2f')]===_0x0252('0x29'))return;return getAgent(_0x35231e[_0x0252('0x2f')]);})[_0x0252('0x1f')](function(_0x4e2398){if(_0x4e2398){_0x35231e[_0x0252('0x30')]=util['format'](_0x0252('0x32'),_0x4e2398[_0x0252('0x3c')]);_0x35231e[_0x0252('0x37')]=_0x4e2398;}return request({'event':_0x4e3a8a,'message':_0x35231e});})['catch'](function(_0x5ae076){logger['error'](_0x0252('0x21'),_0x0252('0x3d'),_0x5ae076);});}};}function getAgent(_0x3ad375){return db['User'][_0x0252('0x3e')]({'where':{'id':_0x3ad375},'attributes':['id',_0x0252('0x3c'),'fullname','email',_0x0252('0x3f')],'raw':!![]})[_0x0252('0x1f')](function(_0x308feb){return _0x308feb;});}exports[_0x0252('0x40')]=function(){for(var _0x21ee0c=0x0;_0x21ee0c=_0x88dc25[_0xbc3e('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2b1ed5(_0x29ac7b);})[_0xbc3e('0x12')](function(_0xfda497){_0x14fdd8(_0xfda497);});});}; \ No newline at end of file +var _0x82f1=['clearBlockUser','updateAttributes','role','agent','count','then','getLicense','agents','catch','bluebird','./license/util','voice','mail','chat','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes'];(function(_0x472b13,_0x2979cd){var _0x359904=function(_0x1fd404){while(--_0x1fd404){_0x472b13['push'](_0x472b13['shift']());}};_0x359904(++_0x2979cd);}(_0x82f1,0x1e9));var _0x182f=function(_0x1f4f6f,_0x5c782a){_0x1f4f6f=_0x1f4f6f-0x0;var _0x26e504=_0x82f1[_0x1f4f6f];return _0x26e504;};'use strict';var _=require('lodash');var BPromise=require(_0x182f('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x182f('0x1'));var channels=[_0x182f('0x2'),_0x182f('0x3'),_0x182f('0x4'),'fax',_0x182f('0x5'),'whatsapp',_0x182f('0x6')];exports[_0x182f('0x7')]=function(){return channels;};exports[_0x182f('0x8')]=function(_0x9b9f13){_0x9b9f13=_0x9b9f13[_0x182f('0x9')]();return _[_0x182f('0xa')](channels,_0x9b9f13);};exports[_0x182f('0xb')]=function(_0x10a6e6,_0x3b87db,_0xdaf9e9,_0x497474){var _0x422bfc={'loginAttempts':_0x3b87db,'blocked':_0xdaf9e9};if(!_['isUndefined'](_0x497474)){_0x422bfc['blockedAt']=_0x497474;}return _0x10a6e6[_0x182f('0xc')](_0x422bfc);};exports['getLicense']=function(_0x5eb383){return new BPromise(function(_0x184251,_0x5535e5){var _0x555ef3=0x0;if(_0x5eb383[_0x182f('0xd')]!==_0x182f('0xe')){_0x184251(_0x5eb383);}db['User'][_0x182f('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5eb383['id']}}})[_0x182f('0x10')](function(_0x6382e2){_0x555ef3=_0x6382e2;return util[_0x182f('0x11')]();})[_0x182f('0x10')](function(_0x24d3e4){if(_0x24d3e4&&_0x24d3e4[_0x182f('0x12')]&&_0x555ef3>=_0x24d3e4[_0x182f('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x184251(_0x5eb383);})[_0x182f('0x13')](function(_0x152f0f){_0x5535e5(_0x152f0f);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 1721cd8..29733bb 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4279=['code','details','OutOfInterval','Forbidden','error','stack','statusMessage','exports','../config/logger','api','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x4279,0x8d));var _0x9427=function(_0xcc9be7,_0x429615){_0xcc9be7=_0xcc9be7-0x0;var _0x435cb5=_0x4279[_0xcc9be7];return _0x435cb5;};'use strict';var util=require('util');var logger=require(_0x9427('0x0'))(_0x9427('0x1'));var APIError=function(_0x594cbc,_0x24fd0c){this[_0x9427('0x2')]=_0x594cbc||_0x9427('0x3');this[_0x9427('0x4')]=_0x24fd0c||'Error';util[_0x9427('0x5')](APIError,Error);};var APIBadRequestError=function(_0x57f12b){this[_0x9427('0x2')]=_0x57f12b||_0x9427('0x6');this['name']=_0x9427('0x6');util[_0x9427('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x25ba0b){this['message']=_0x25ba0b||_0x9427('0x7');this['name']=_0x9427('0x8');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x559a48){this[_0x9427('0x2')]=_0x559a48||_0x9427('0x9');this[_0x9427('0x4')]=_0x9427('0xa');this[_0x9427('0xb')]=0x193;this[_0x9427('0xc')]={'type':_0x9427('0xd')};util[_0x9427('0x5')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x5e003e){switch(_0x5e003e){case _0x9427('0x6'):return 0x190;case _0x9427('0xe'),_0x9427('0xa'):return 0x193;case _0x9427('0x8'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x27c98e){if(_0x27c98e===_0x9427('0xa'))return _0x27c98e;return null;}function handleError(_0x380739){return function(_0x1f6b92){logger[_0x9427('0xf')](_0x1f6b92[_0x9427('0x10')]);var _0x282406=getStatusCode(_0x1f6b92[_0x9427('0x4')]);var _0x418e37=getCustomStatusMessage(_0x1f6b92['name']);if(_0x1f6b92[_0x9427('0x4')]){delete _0x1f6b92[_0x9427('0x4')];}if(_0x418e37){_0x380739[_0x9427('0x11')]=_0x418e37;}return _0x380739['status'](_0x282406)['send'](_0x1f6b92);};}module[_0x9427('0x12')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'handleError':handleError}; \ No newline at end of file +var _0x86f0=['message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','inherits','Forbidden','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','stack','statusMessage','status','send','../config/logger','api'];(function(_0x349ddf,_0x9072fc){var _0x3d7a09=function(_0x23aeda){while(--_0x23aeda){_0x349ddf['push'](_0x349ddf['shift']());}};_0x3d7a09(++_0x9072fc);}(_0x86f0,0x64));var _0x086f=function(_0x2ec74b,_0x2b2cf6){_0x2ec74b=_0x2ec74b-0x0;var _0x534108=_0x86f0[_0x2ec74b];return _0x534108;};'use strict';var util=require('util');var logger=require(_0x086f('0x0'))(_0x086f('0x1'));var APIError=function(_0x33459b,_0x15277f){this[_0x086f('0x2')]=_0x33459b||_0x086f('0x3');this[_0x086f('0x4')]=_0x15277f||_0x086f('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x2ae944){this[_0x086f('0x2')]=_0x2ae944||'Bad\x20Request';this[_0x086f('0x4')]=_0x086f('0x6');util[_0x086f('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x290fc1){this[_0x086f('0x2')]=_0x290fc1||'Forbidden';this['name']=_0x086f('0x8');util[_0x086f('0x7')](APIForbiddenError,APIError);};var APINotFoundError=function(_0xb219bd){this[_0x086f('0x2')]=_0xb219bd||'Entity\x20not\x20found';this[_0x086f('0x4')]=_0x086f('0x9');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4b7b96){this[_0x086f('0x2')]=_0x4b7b96||_0x086f('0xa');this[_0x086f('0x4')]=_0x086f('0xb');util[_0x086f('0x7')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x5e36b2){switch(_0x5e36b2){case _0x086f('0x6'):return 0x190;case'Forbidden','Out\x20Of\x20Interval':return 0x193;case _0x086f('0x9'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x10d1f2){if(_0x10d1f2===_0x086f('0xb'))return _0x10d1f2;return null;}function handleError(_0x8eedba){return function(_0x1aaa6e){logger[_0x086f('0xc')](_0x1aaa6e[_0x086f('0xd')]);var _0x433caa=getStatusCode(_0x1aaa6e[_0x086f('0x4')]);var _0x1b5eaf=getCustomStatusMessage(_0x1aaa6e['name']);if(_0x1aaa6e['name'])delete _0x1aaa6e[_0x086f('0x4')];if(_0x1b5eaf)_0x8eedba[_0x086f('0xe')]=_0x1b5eaf;return _0x8eedba[_0x086f('0xf')](_0x433caa)[_0x086f('0x10')](_0x1aaa6e);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d761f39..49a4df3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1de7=['status','render','send','exports','404'];(function(_0x5c85ab,_0x23545b){var _0x263258=function(_0x2be252){while(--_0x2be252){_0x5c85ab['push'](_0x5c85ab['shift']());}};_0x263258(++_0x23545b);}(_0x1de7,0x1de));var _0x71de=function(_0x4743c5,_0x114dca){_0x4743c5=_0x4743c5-0x0;var _0xf0c189=_0x1de7[_0x4743c5];return _0xf0c189;};'use strict';module[_0x71de('0x0')][0x194]=function pageNotFound(_0x13af2f,_0x7a0021){var _0x4fd13a=_0x71de('0x1');var _0x170218=0x194;var _0x15cfb5={'status':_0x170218};_0x7a0021[_0x71de('0x2')](_0x15cfb5[_0x71de('0x2')]);_0x7a0021[_0x71de('0x3')](_0x4fd13a,{},function(_0x3724a2,_0x13dc69){if(_0x3724a2){return _0x7a0021['status'](_0x15cfb5['status'])['json'](_0x15cfb5);}_0x7a0021[_0x71de('0x4')](_0x13dc69);});}; \ No newline at end of file +var _0xecbd=['status','render','json','exports','404'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xecbd,0x1a7));var _0xdecb=function(_0xba97cf,_0x4dca80){_0xba97cf=_0xba97cf-0x0;var _0x37b435=_0xecbd[_0xba97cf];return _0x37b435;};'use strict';module[_0xdecb('0x0')][0x194]=function pageNotFound(_0x396368,_0x2675b1){var _0x443ca9=_0xdecb('0x1');var _0x4df4e4=0x194;var _0x2515ba={'status':_0x4df4e4};_0x2675b1[_0xdecb('0x2')](_0x2515ba[_0xdecb('0x2')]);_0x2675b1[_0xdecb('0x3')](_0x443ca9,{},function(_0x2fa221,_0x2846f8){if(_0x2fa221){return _0x2675b1[_0xdecb('0x2')](_0x2515ba[_0xdecb('0x2')])[_0xdecb('0x4')](_0x2515ba);}_0x2675b1['send'](_0x2846f8);});}; \ No newline at end of file diff --git a/server/migrations/2.6.22.js b/server/migrations/2.6.22.js index a59425a..c3f0d98 100644 --- a/server/migrations/2.6.22.js +++ b/server/migrations/2.6.22.js @@ -152,11 +152,16 @@ Migration.prototype.final = function(resolve) { }; module.exports = { - up: function(queryInterface /*, Sequelize */) { + up: function(queryInterface /*, Sequelize */ ) { return new BPromise(function(resolve) { var migration = new Migration(queryInterface); // Add your migration code here + //START cm_hopper + migration.query('ALTER TABLE `cm_hopper` DROP FOREIGN KEY `cm_hopper_ibfk_3`;'); + migration.query('ALTER TABLE `cm_hopper` ADD CONSTRAINT `cm_hopper_ibfk_3` FOREIGN KEY (`UserId`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;'); + //END cm_hopper + // START FINAL migration.final(resolve); // END FINAL diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 3571887..ebcff23 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x4d9e=['CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','UserId','hasOne','userSetting','cascade','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','Hoppers','belongsTo','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','CmList','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','ScreenRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Disposition','Dispositions','Answers','MailMessage','Interactions','List','ListId','TemplateId','user_has_mail_accounts','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','ChatOfflineMessageId','TagId','Items','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','Interaction','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','ChatWebsiteId','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','Phones','CmContactId','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','All','OneAll','Any','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','ItemType','ItemTypeId','Hopper','TriggerAllId','AnyConditions','TriggerAnyId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','Subject','Description','DescriptionId','Field','FieldId','VariableId','DeskField','int_desk_configuration_has_tags','ZendeskConfiguration','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','ChatQueueReport','ToId','SessionId','ProjectId','user_has_teams','VoiceQueues','team_has_mail_queues','ChatQueues','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkBackup','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromUserId','FromOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','TeamVoicePrefix','UserProfileSections','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','UserSetting','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','mysql','name','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.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','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x4d9e,0x17c));var _0xe4d9=function(_0x4eea31,_0x31f591){_0x4eea31=_0x4eea31-0x0;var _0x1eb2f9=_0x4d9e[_0x4eea31];return _0x1eb2f9;};'use strict';var config=require(_0xe4d9('0x0'));var Sequelize=require(_0xe4d9('0x1'));var _=require('lodash');var jstz=require(_0xe4d9('0x2'));var timezone=jstz[_0xe4d9('0x3')]();config[_0xe4d9('0x1')]=_[_0xe4d9('0x4')](config[_0xe4d9('0x1')],{'database':_0xe4d9('0x5'),'username':_0xe4d9('0x6'),'password':_0xe4d9('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe4d9('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe4d9('0x9'),'collate':_0xe4d9('0xa')}}});config[_0xe4d9('0xb')]=_['defaultsDeep'](config[_0xe4d9('0xb')],{'database':_0xe4d9('0x5'),'username':'xcall','password':_0xe4d9('0x7'),'options':{'host':_0xe4d9('0xc'),'port':0xcea,'dialect':_0xe4d9('0xd'),'dialectOptions':{'charset':_0xe4d9('0x8')},'logging':![],'timezone':timezone[_0xe4d9('0xe')](),'define':{'charset':_0xe4d9('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe4d9('0x1')][_0xe4d9('0xf')],config[_0xe4d9('0x1')][_0xe4d9('0x10')],config['sequelize'][_0xe4d9('0x11')],config[_0xe4d9('0x1')][_0xe4d9('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xe4d9('0xf')],config[_0xe4d9('0xb')][_0xe4d9('0x10')],config[_0xe4d9('0xb')][_0xe4d9('0x11')],config[_0xe4d9('0xb')][_0xe4d9('0x12')])};db[_0xe4d9('0x13')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x15'));db['VoiceChanSpy']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x16'));db['VoiceContext']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x17'));db[_0xe4d9('0x18')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xe4d9('0x19')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x1a'));db[_0xe4d9('0x1b')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0xe4d9('0x1c')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x1d'));db['ScreenRecording']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x1e'));db[_0xe4d9('0x1f')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x20'));db['VoiceMailMessage']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x21'));db[_0xe4d9('0x22')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x23'));db[_0xe4d9('0x24')]=db[_0xe4d9('0x1')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xe4d9('0x25')]=db['sequelize'][_0xe4d9('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xe4d9('0x26')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x27'));db['MemberReport']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x28'));db[_0xe4d9('0x29')]=db['sequelize']['import'](_0xe4d9('0x2a'));db[_0xe4d9('0x2b')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x2c'));db[_0xe4d9('0x2d')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xe4d9('0x2e')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x2f'));db[_0xe4d9('0x30')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x31'));db[_0xe4d9('0x32')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x33'));db[_0xe4d9('0x34')]=db['sequelize']['import'](_0xe4d9('0x35'));db[_0xe4d9('0x36')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x37'));db[_0xe4d9('0x38')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x39'));db['UserWhatsappQueue']=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xe4d9('0x3a')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x3b'));db[_0xe4d9('0x3c')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x3d'));db[_0xe4d9('0x3e')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/mailAccount/mailAccount.model');db[_0xe4d9('0x3f')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/mailQueue/mailQueue.model');db[_0xe4d9('0x40')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x41'));db[_0xe4d9('0x42')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x43'));db['MailMessage']=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x44'));db[_0xe4d9('0x45')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x46'));db[_0xe4d9('0x47')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x48'));db[_0xe4d9('0x49')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x4a'));db[_0xe4d9('0x4b')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x4c'));db[_0xe4d9('0x4d')]=db[_0xe4d9('0x1')]['import']('../api/faxAccount/faxAccount.model');db[_0xe4d9('0x4e')]=db['sequelize'][_0xe4d9('0x14')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xe4d9('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize'][_0xe4d9('0x14')]('../api/faxMessage/faxMessage.model');db[_0xe4d9('0x4f')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x50'));db[_0xe4d9('0x51')]=db['sequelize'][_0xe4d9('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xe4d9('0x52')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x53'));db[_0xe4d9('0x54')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x55'));db[_0xe4d9('0x56')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x57'));db[_0xe4d9('0x58')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x59'));db[_0xe4d9('0x5a')]=db[_0xe4d9('0x1')]['import']('../api/smsQueue/smsQueue.model');db[_0xe4d9('0x5b')]=db[_0xe4d9('0x1')]['import']('../api/openchannelAccount/openchannelAccount.model');db[_0xe4d9('0x5c')]=db['sequelize'][_0xe4d9('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0xe4d9('0x5d')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x5e'));db[_0xe4d9('0x5f')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x60'));db[_0xe4d9('0x61')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x62'));db['ChatWebsite']=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x63'));db[_0xe4d9('0x64')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x65'));db[_0xe4d9('0x66')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x67'));db['ChatInteraction']=db['sequelize'][_0xe4d9('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0xe4d9('0x68')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x69'));db[_0xe4d9('0x6a')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x6b'));db[_0xe4d9('0x6c')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x6d'));db[_0xe4d9('0x6e')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x6f'));db[_0xe4d9('0x70')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x71'));db[_0xe4d9('0x72')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x73'));db['CmContact']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x74'));db[_0xe4d9('0x75')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/cmHopper/cmHopper.model');db[_0xe4d9('0x76')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x77'));db[_0xe4d9('0x78')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x79'));db['CmHopperHistory']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x7a'));db['ReportAgentPreview']=db['sequelize']['import'](_0xe4d9('0x7b'));db[_0xe4d9('0x7c')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x7d'));db[_0xe4d9('0x7e')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x7f'));db[_0xe4d9('0x80')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x81'));db[_0xe4d9('0x82')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x83'));db['Disposition']=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x84'));db[_0xe4d9('0x85')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x86'));db[_0xe4d9('0x87')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x88'));db[_0xe4d9('0x89')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x8a'));db[_0xe4d9('0x8b')]=db['sequelize']['import'](_0xe4d9('0x8c'));db[_0xe4d9('0x8d')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xe4d9('0x8e')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x8f'));db[_0xe4d9('0x90')]=db['sequelize']['import'](_0xe4d9('0x91'));db['Tag']=db['sequelize']['import'](_0xe4d9('0x92'));db[_0xe4d9('0x93')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x94'));db[_0xe4d9('0x95')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x96'));db[_0xe4d9('0x97')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x98'));db[_0xe4d9('0x99')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x9a'));db[_0xe4d9('0x9b')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x9c'));db[_0xe4d9('0x9d')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x9e'));db[_0xe4d9('0x9f')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xa0'));db[_0xe4d9('0xa1')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xa2'));db['AnalyticCustomReport']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xa3'));db[_0xe4d9('0xa4')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xa5'));db[_0xe4d9('0xa6')]=db[_0xe4d9('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xe4d9('0xa7')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0xe4d9('0xa8')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xa9'));db[_0xe4d9('0xaa')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xab'));db[_0xe4d9('0xac')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xad'));db['SalesforceField']=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xae'));db[_0xe4d9('0xaf')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xb0'));db[_0xe4d9('0xb1')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xb2'));db[_0xe4d9('0xb3')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xb4'));db[_0xe4d9('0xb5')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xb6'));db[_0xe4d9('0xb7')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xb8'));db['DeskField']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xb9'));db[_0xe4d9('0xba')]=db['sequelize']['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xe4d9('0xbb')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xbc'));db[_0xe4d9('0xbd')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xbe'));db[_0xe4d9('0xbf')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xc0'));db['ZendeskConfiguration']=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xc1'));db[_0xe4d9('0xc2')]=db['sequelize']['import'](_0xe4d9('0xc3'));db[_0xe4d9('0xc4')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xc5'));db['FreshdeskField']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xc6'));db[_0xe4d9('0xc7')]=db['sequelize']['import'](_0xe4d9('0xc8'));db[_0xe4d9('0xc9')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xca'));db['VtigerField']=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0xe4d9('0xcb')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xcc'));db[_0xe4d9('0xcd')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xce'));db[_0xe4d9('0xcf')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xd0'));db['Dynamics365Account']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xd1'));db[_0xe4d9('0xd2')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xe4d9('0xd3')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xd4'));db[_0xe4d9('0xd5')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xe4d9('0xd6')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xd7'));db[_0xe4d9('0xd8')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xe4d9('0x9f')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xa0'));db[_0xe4d9('0xd9')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xda'));db['ChatQueueReport']=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xdb'));db[_0xe4d9('0xdc')]=db['sequelize'][_0xe4d9('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xe4d9('0xdd')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xde'));db[_0xe4d9('0xdf')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xe0'));db[_0xe4d9('0xe1')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xe2'));db[_0xe4d9('0xe3')]=db['sequelize'][_0xe4d9('0x14')]('../api/squareReport/squareReport.model');db[_0xe4d9('0xe4')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xe5'));db[_0xe4d9('0xe6')]=db['sequelize'][_0xe4d9('0x14')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize']['import'](_0xe4d9('0xe7'));db['SquareOdbc']=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xe8'));db[_0xe4d9('0xe9')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xea'));db[_0xe4d9('0xeb')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xec'));db['SquareMessage']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xed'));db[_0xe4d9('0xee')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xef'));db['License']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xf0'));db[_0xe4d9('0xf1')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xf2'));db['Migration']=db[_0xe4d9('0x1')]['import']('../api/migration/migration.model');db[_0xe4d9('0xf3')]=db[_0xe4d9('0x1')]['import']('../api/attachment/attachment.model');db[_0xe4d9('0xf4')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0xf5'));db[_0xe4d9('0xf6')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xf7'));db[_0xe4d9('0xf8')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0xf9'));db[_0xe4d9('0xfa')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xfb'));db[_0xe4d9('0xfc')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xfd'));db[_0xe4d9('0xfe')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0xff'));db['CmList']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x100'));db[_0xe4d9('0x101')]=db[_0xe4d9('0x1')]['import'](_0xe4d9('0x102'));db[_0xe4d9('0x103')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x104'));db[_0xe4d9('0x105')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0xe4d9('0x106')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x107'));db['UserNotification']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x108'));db['WhatsappAccount']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x109'));db[_0xe4d9('0x10a')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0xe4d9('0x10b')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x10c'));db[_0xe4d9('0x10d')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0xe4d9('0x10e')]=db['sequelize'][_0xe4d9('0x14')](_0xe4d9('0x10f'));db[_0xe4d9('0x110')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x111'));db[_0xe4d9('0x112')]=db['sequelize'][_0xe4d9('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0xe4d9('0x113')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x114'));db[_0xe4d9('0x115')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x116'));db['TeamVoicePrefix']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x117'));db[_0xe4d9('0x118')]=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x119'));db['UserSetting']=db[_0xe4d9('0x1')][_0xe4d9('0x14')](_0xe4d9('0x11a'));db[_0xe4d9('0x13')]['hasOne'](db[_0xe4d9('0x1f')],{'as':_0xe4d9('0x1f'),'onDelete':'cascade','foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')][_0xe4d9('0x11c')](db['UserSetting'],{'as':_0xe4d9('0x11d'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db[_0xe4d9('0x1c')],{'as':_0xe4d9('0x120'),'foreignKey':_0xe4d9('0x11b')});db['User'][_0xe4d9('0x11f')](db[_0xe4d9('0x2d')],{'as':_0xe4d9('0x121'),'foreignKey':_0xe4d9('0x11b')});db['User']['hasMany'](db[_0xe4d9('0x18')],{'as':_0xe4d9('0x122'),'onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db[_0xe4d9('0x78')],{'as':_0xe4d9('0x123'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')]['hasMany'](db[_0xe4d9('0x124')],{'as':_0xe4d9('0x125'),'foreignKey':_0xe4d9('0x11b')});db['User'][_0xe4d9('0x11f')](db[_0xe4d9('0x126')],{'as':_0xe4d9('0x126'),'foreignKey':'UserId'});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db[_0xe4d9('0x5d')],{'as':_0xe4d9('0x127'),'foreignKey':_0xe4d9('0x11b')});db['User'][_0xe4d9('0x11f')](db[_0xe4d9('0x128')],{'as':_0xe4d9('0x129'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db[_0xe4d9('0x56')],{'as':'SmsInteractions','foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db[_0xe4d9('0x12a')],{'as':_0xe4d9('0x12b'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db['MailInteraction'],{'as':_0xe4d9('0x12c'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')]['hasMany'](db[_0xe4d9('0x10b')],{'as':_0xe4d9('0x12d'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db['UserNotification'],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xe4d9('0x13')][_0xe4d9('0x11f')](db[_0xe4d9('0x75')],{'as':_0xe4d9('0x12e'),'foreignKey':_0xe4d9('0x11b'),'onDelete':'SET\x20NULL'});db[_0xe4d9('0x13')][_0xe4d9('0x12f')](db[_0xe4d9('0x103')],{'as':_0xe4d9('0x103'),'foreignKey':'userProfileId'});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db['ChatGroup'],{'as':_0xe4d9('0x131'),'through':_0xe4d9('0x132')});db['User'][_0xe4d9('0x130')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x134'),'through':'cm_user_has_contacts'});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x136'),'through':_0xe4d9('0x137')});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'through':'user_has_teams'});db[_0xe4d9('0x13')]['belongsToMany'](db[_0xe4d9('0x42')],{'as':'MailInteractions','through':_0xe4d9('0x138')});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x128')],{'as':_0xe4d9('0x129'),'through':_0xe4d9('0x139')});db[_0xe4d9('0x13')]['belongsToMany'](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xe4d9('0x13a')});db[_0xe4d9('0x13')]['belongsToMany'](db[_0xe4d9('0x56')],{'as':_0xe4d9('0x13b'),'through':_0xe4d9('0x13c')});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x5d')],{'as':_0xe4d9('0x127'),'through':_0xe4d9('0x13d')});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x10b')],{'as':_0xe4d9('0x12d'),'through':_0xe4d9('0x13e')});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x1b')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x101')],{'as':_0xe4d9('0x13f'),'through':_0xe4d9('0x118'),'required':![]});db[_0xe4d9('0x13')]['belongsToMany'](db[_0xe4d9('0x3f')],{'as':_0xe4d9('0x140'),'through':_0xe4d9('0x32'),'required':![]});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db['ChatQueue'],{'as':'ChatQueues','through':_0xe4d9('0x30'),'required':![],'hooks':!![]});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x4f')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x5a')],{'as':_0xe4d9('0x141'),'through':_0xe4d9('0x36'),'required':![]});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x61')],{'as':_0xe4d9('0x142'),'through':_0xe4d9('0x38'),'required':![]});db['User']['belongsToMany'](db[_0xe4d9('0x112')],{'as':_0xe4d9('0x143'),'through':_0xe4d9('0x144'),'required':![]});db[_0xe4d9('0x13')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x145')],{'as':_0xe4d9('0x146'),'through':_0xe4d9('0x147')});db['User'][_0xe4d9('0x130')](db[_0xe4d9('0x4d')],{'as':_0xe4d9('0x148'),'through':_0xe4d9('0x149')});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x3e')],{'as':_0xe4d9('0x14a'),'through':'user_has_mail_accounts'});db['User'][_0xe4d9('0x130')](db[_0xe4d9('0x5b')],{'as':_0xe4d9('0x14b'),'through':'user_has_openchannel_accounts'});db[_0xe4d9('0x13')][_0xe4d9('0x130')](db[_0xe4d9('0x52')],{'as':_0xe4d9('0x14c'),'through':_0xe4d9('0x14d')});db[_0xe4d9('0x13')]['belongsToMany'](db[_0xe4d9('0x14e')],{'as':'WhatsappAccounts','through':_0xe4d9('0x14f')});db[_0xe4d9('0x150')]['hasMany'](db[_0xe4d9('0x18')],{'as':_0xe4d9('0x151'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'ChanSpyId'});db[_0xe4d9('0x152')][_0xe4d9('0x11f')](db[_0xe4d9('0x18')],{'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x18')]['hasMany'](db['VoiceExtension'],{'as':_0xe4d9('0x153'),'onDelete':'cascade'});db[_0xe4d9('0x19')][_0xe4d9('0x130')](db[_0xe4d9('0x90')],{'as':_0xe4d9('0x154'),'through':_0xe4d9('0x155')});db[_0xe4d9('0x1b')][_0xe4d9('0x11f')](db[_0xe4d9('0x2d')],{'as':_0xe4d9('0x156'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xe4d9('0x75')],{'as':_0xe4d9('0x12e'),'foreignKey':_0xe4d9('0x157')});db[_0xe4d9('0x1b')]['hasMany'](db[_0xe4d9('0x78')],{'as':'HopperFinals','foreignKey':_0xe4d9('0x157')});db[_0xe4d9('0x1b')]['hasMany'](db['CmHopperHistory'],{'as':_0xe4d9('0x158'),'foreignKey':_0xe4d9('0x157')});db[_0xe4d9('0x1b')]['hasMany'](db[_0xe4d9('0x126')],{'as':_0xe4d9('0x126'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe4d9('0x11f')](db['CmHopperBlack'],{'as':_0xe4d9('0x159'),'foreignKey':_0xe4d9('0x157')});db[_0xe4d9('0x1b')][_0xe4d9('0x11f')](db['JscriptySessionReport'],{'as':_0xe4d9('0x15a'),'foreignKey':_0xe4d9('0x157')});db['VoiceQueue'][_0xe4d9('0x12f')](db['Trunk'],{'as':'Trunk','foreignKey':_0xe4d9('0x15b')});db[_0xe4d9('0x1b')][_0xe4d9('0x12f')](db[_0xe4d9('0x29')],{'as':'TrunkBackup','foreignKey':_0xe4d9('0x15c')});db[_0xe4d9('0x1b')][_0xe4d9('0x12f')](db[_0xe4d9('0x87')],{'as':_0xe4d9('0x87'),'foreignKey':_0xe4d9('0x15d')});db[_0xe4d9('0x1b')][_0xe4d9('0x12f')](db['Pause'],{'as':_0xe4d9('0x15e'),'foreignKey':_0xe4d9('0x15f')});db[_0xe4d9('0x1b')]['belongsToMany'](db[_0xe4d9('0x135')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xe4d9('0x1b')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x2e')});db[_0xe4d9('0x1b')][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'as':_0xe4d9('0x161'),'through':_0xe4d9('0x115')});db['VoiceQueue'][_0xe4d9('0x130')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x162'),'through':'voice_queues_has_cm_blacklists'});db[_0xe4d9('0x1c')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x163')][_0xe4d9('0x12f')](db['User'],{'as':_0xe4d9('0x13'),'foreignKey':_0xe4d9('0x11b')});db['VoiceMail'][_0xe4d9('0x11f')](db[_0xe4d9('0x164')],{'as':_0xe4d9('0x165'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'mailboxuser','sourceKey':_0xe4d9('0x166')});db['VoiceMailMessage'][_0xe4d9('0x12f')](db[_0xe4d9('0x1f')],{'foreignKey':_0xe4d9('0x167'),'targetKey':_0xe4d9('0x166')});db[_0xe4d9('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xe4d9('0x168'),'foreignKey':_0xe4d9('0x169'),'constraints':![]});db[_0xe4d9('0x22')][_0xe4d9('0x11f')](db[_0xe4d9('0x25')],{'as':_0xe4d9('0x16a'),'foreignKey':'uniqueid','constraints':![]});db[_0xe4d9('0x22')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x13'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x22')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x3a')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{'as':_0xe4d9('0x3e'),'foreignKey':_0xe4d9('0x16d')});db['MailServerIn'][_0xe4d9('0x12f')](db[_0xe4d9('0x113')],{'as':_0xe4d9('0x113'),'foreignKey':_0xe4d9('0x16e'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x3c')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{'as':_0xe4d9('0x3e'),'foreignKey':_0xe4d9('0x16d')});db['MailServerOut'][_0xe4d9('0x12f')](db[_0xe4d9('0x113')],{'as':'CloudProvider','foreignKey':_0xe4d9('0x16e'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x3e')][_0xe4d9('0x11c')](db[_0xe4d9('0x3a')],{'as':_0xe4d9('0x170'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x3e')]['hasOne'](db[_0xe4d9('0x3c')],{'as':_0xe4d9('0x171'),'onDelete':'cascade'});db[_0xe4d9('0x3e')][_0xe4d9('0x11f')](db[_0xe4d9('0x172')],{'as':_0xe4d9('0x173'),'foreignKey':_0xe4d9('0x16d'),'onDelete':'cascade'});db[_0xe4d9('0x3e')]['hasMany'](db[_0xe4d9('0x82')],{'as':_0xe4d9('0x174'),'foreignKey':_0xe4d9('0x16d')});db['MailAccount'][_0xe4d9('0x11f')](db[_0xe4d9('0x175')],{'as':'Messages','foreignKey':_0xe4d9('0x16d')});db[_0xe4d9('0x3e')][_0xe4d9('0x11f')](db['MailInteraction'],{'as':_0xe4d9('0x176')});db[_0xe4d9('0x3e')][_0xe4d9('0x11f')](db[_0xe4d9('0x45')],{'as':'Applications','foreignKey':_0xe4d9('0x16d'),'onDelete':_0xe4d9('0x11e')});db['MailAccount']['belongsTo'](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x3e')]['belongsTo'](db[_0xe4d9('0x99')],{'as':'Template','foreignKey':_0xe4d9('0x179')});db[_0xe4d9('0x3e')]['belongsTo'](db['Pause'],{'as':_0xe4d9('0x15e'),'foreignKey':_0xe4d9('0x15f')});db[_0xe4d9('0x3e')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x17a')});db['MailQueue'][_0xe4d9('0x130')](db['User'],{'as':'Agents','through':_0xe4d9('0x32')});db['MailQueue'][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'through':'team_has_mail_queues','as':_0xe4d9('0x161')});db[_0xe4d9('0x42')][_0xe4d9('0x11f')](db[_0xe4d9('0x175')],{'as':_0xe4d9('0x165'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0xe4d9('0x42')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x16d')});db['MailInteraction'][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':'ContactId'});db[_0xe4d9('0x42')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x17c'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x42')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x17e'),'as':_0xe4d9('0x17f')});db[_0xe4d9('0x42')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':'mail_interaction_has_tags','as':_0xe4d9('0x180')});db[_0xe4d9('0x42')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x181'),'through':'user_has_mail_interactions','foreignKey':_0xe4d9('0x182')});db[_0xe4d9('0x175')]['hasMany'](db['Attachment'],{'as':_0xe4d9('0x183'),'onDelete':_0xe4d9('0x11e')});db['MailMessage']['belongsTo'](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x13')});db[_0xe4d9('0x175')]['belongsTo'](db[_0xe4d9('0x133')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x16b')});db['MailMessage'][_0xe4d9('0x12f')](db[_0xe4d9('0x42')],{'as':'Interaction','foreignKey':_0xe4d9('0x182')});db[_0xe4d9('0x175')][_0xe4d9('0x12f')](db['MailAccount'],{'as':_0xe4d9('0x17b'),'foreignKey':'MailAccountId'});db[_0xe4d9('0x175')][_0xe4d9('0x12f')](db['ChatWebsite'],{'as':_0xe4d9('0x145'),'foreignKey':'ChatWebsiteId'});db[_0xe4d9('0x175')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xe4d9('0x6a'),'foreignKey':_0xe4d9('0x184')});db[_0xe4d9('0x45')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'onDelete':'restrict'});db['MailApplication'][_0xe4d9('0x12f')](db[_0xe4d9('0x3f')],{'onDelete':'restrict'});db[_0xe4d9('0x45')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x45')]['belongsTo'](db[_0xe4d9('0x87')],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x15d')});db[_0xe4d9('0x45')][_0xe4d9('0x12f')](db['Tag'],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x185')});db[_0xe4d9('0x47')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{});db[_0xe4d9('0x47')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x47')][_0xe4d9('0x12f')](db['CmContact'],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db['MailQueueReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x42')],{});db[_0xe4d9('0x47')][_0xe4d9('0x12f')](db[_0xe4d9('0x175')],{});db['MailQueueReport'][_0xe4d9('0x12f')](db['User'],{});db[_0xe4d9('0x47')][_0xe4d9('0x12f')](db[_0xe4d9('0x3f')],{});db['Dashboard']['hasMany'](db[_0xe4d9('0x4b')],{'as':_0xe4d9('0x186'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x4d')][_0xe4d9('0x11f')](db[_0xe4d9('0x172')],{'as':_0xe4d9('0x173'),'foreignKey':_0xe4d9('0x187'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x4d')][_0xe4d9('0x11f')](db[_0xe4d9('0x82')],{'as':_0xe4d9('0x174'),'foreignKey':'FaxAccountId'});db[_0xe4d9('0x4d')][_0xe4d9('0x11f')](db[_0xe4d9('0x12a')],{'as':_0xe4d9('0x176')});db['FaxAccount'][_0xe4d9('0x11f')](db[_0xe4d9('0x4e')],{'as':_0xe4d9('0x153'),'foreignKey':_0xe4d9('0x187'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x4d')][_0xe4d9('0x11f')](db[_0xe4d9('0x18')],{'as':_0xe4d9('0x188'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x4d')]['hasMany'](db['FaxMessage'],{'as':'Messages'});db[_0xe4d9('0x4d')][_0xe4d9('0x12f')](db['Trunk'],{'as':'Trunk'});db[_0xe4d9('0x4d')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x4d')]['belongsTo'](db['Pause'],{'as':_0xe4d9('0x15e'),'foreignKey':_0xe4d9('0x15f')});db['FaxAccount'][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x149')});db[_0xe4d9('0x4e')]['belongsTo'](db[_0xe4d9('0x13')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x4e')][_0xe4d9('0x12f')](db[_0xe4d9('0x4f')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x4e')][_0xe4d9('0x12f')](db[_0xe4d9('0x4d')],{'onDelete':_0xe4d9('0x16f')});db['FaxApplication'][_0xe4d9('0x12f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xe4d9('0x185')});db['FaxInteraction'][_0xe4d9('0x11f')](db[_0xe4d9('0x189')],{'as':_0xe4d9('0x165'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x18a')});db['FaxInteraction']['belongsTo'](db[_0xe4d9('0x4d')],{'as':'Account','foreignKey':_0xe4d9('0x187')});db[_0xe4d9('0x12a')][_0xe4d9('0x12f')](db['CmContact'],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db['FaxInteraction']['belongsTo'](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x17c'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x12a')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x18b'),'as':'Tags'});db[_0xe4d9('0x12a')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':'fax_interaction_has_tags','as':_0xe4d9('0x180')});db[_0xe4d9('0x12a')]['belongsToMany'](db['User'],{'as':_0xe4d9('0x181'),'through':_0xe4d9('0x13a'),'foreignKey':_0xe4d9('0x18a')});db[_0xe4d9('0x189')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'onDelete':'cascade','as':_0xe4d9('0x13')});db[_0xe4d9('0x189')][_0xe4d9('0x12f')](db[_0xe4d9('0x12a')],{'as':_0xe4d9('0x18c'),'foreignKey':_0xe4d9('0x18a')});db[_0xe4d9('0x189')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x16b')});db['FaxMessage'][_0xe4d9('0x12f')](db[_0xe4d9('0xf3')],{'as':_0xe4d9('0xf3'),'foreignKey':'AttachmentId'});db[_0xe4d9('0x189')][_0xe4d9('0x12f')](db[_0xe4d9('0x4d')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x187')});db[_0xe4d9('0x4f')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x34')});db[_0xe4d9('0x4f')][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'through':_0xe4d9('0x18d'),'as':_0xe4d9('0x161')});db[_0xe4d9('0x51')][_0xe4d9('0x12f')](db[_0xe4d9('0x4d')],{});db[_0xe4d9('0x51')]['belongsTo'](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x51')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':'ContactId'});db[_0xe4d9('0x51')][_0xe4d9('0x12f')](db['FaxInteraction'],{});db[_0xe4d9('0x51')]['belongsTo'](db[_0xe4d9('0x189')],{});db[_0xe4d9('0x51')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{});db[_0xe4d9('0x51')][_0xe4d9('0x12f')](db[_0xe4d9('0x4f')],{});db[_0xe4d9('0x52')][_0xe4d9('0x11f')](db[_0xe4d9('0x172')],{'as':'Dispositions','foreignKey':_0xe4d9('0x18e'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x52')][_0xe4d9('0x11f')](db[_0xe4d9('0x82')],{'as':_0xe4d9('0x174'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db['SmsMessage'],{'as':_0xe4d9('0x165'),'foreignKey':_0xe4d9('0x18e')});db[_0xe4d9('0x52')][_0xe4d9('0x11f')](db[_0xe4d9('0x56')],{'as':_0xe4d9('0x176')});db[_0xe4d9('0x52')]['hasMany'](db['SmsApplication'],{'as':_0xe4d9('0x153'),'foreignKey':_0xe4d9('0x18e'),'onDelete':'cascade'});db[_0xe4d9('0x52')]['belongsTo'](db[_0xe4d9('0x135')],{'as':'List','foreignKey':'ListId'});db[_0xe4d9('0x52')]['belongsTo'](db[_0xe4d9('0x89')],{'as':_0xe4d9('0x15e'),'foreignKey':_0xe4d9('0x15f')});db[_0xe4d9('0x52')]['belongsToMany'](db['User'],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x14d')});db[_0xe4d9('0x54')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x54')][_0xe4d9('0x12f')](db['SmsQueue'],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x54')][_0xe4d9('0x12f')](db[_0xe4d9('0x52')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x54')]['belongsTo'](db[_0xe4d9('0x87')],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x15d')});db['SmsApplication']['belongsTo'](db[_0xe4d9('0x17d')],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x185')});db[_0xe4d9('0x56')][_0xe4d9('0x11f')](db[_0xe4d9('0x58')],{'as':_0xe4d9('0x165'),'onDelete':'cascade','foreignKey':_0xe4d9('0x18f')});db[_0xe4d9('0x56')][_0xe4d9('0x12f')](db[_0xe4d9('0x52')],{'as':_0xe4d9('0x17b'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x56')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x17c'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x56')][_0xe4d9('0x130')](db['Tag'],{'through':_0xe4d9('0x190'),'as':_0xe4d9('0x17f')});db[_0xe4d9('0x56')][_0xe4d9('0x130')](db['Tag'],{'through':_0xe4d9('0x190'),'as':_0xe4d9('0x180')});db[_0xe4d9('0x56')][_0xe4d9('0x130')](db['User'],{'as':_0xe4d9('0x181'),'through':_0xe4d9('0x13c'),'foreignKey':'SmsInteractionId'});db[_0xe4d9('0x58')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x13')});db[_0xe4d9('0x58')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x16b')});db[_0xe4d9('0x58')][_0xe4d9('0x12f')](db['SmsInteraction'],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x18c'),'foreignKey':_0xe4d9('0x18f')});db[_0xe4d9('0x58')]['belongsTo'](db['SmsAccount'],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x18e')});db[_0xe4d9('0x5a')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x36'),'foreignKey':_0xe4d9('0x191')});db[_0xe4d9('0x5a')][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'through':_0xe4d9('0x192'),'as':_0xe4d9('0x161')});db[_0xe4d9('0x5b')][_0xe4d9('0x11f')](db[_0xe4d9('0x172')],{'as':_0xe4d9('0x173'),'foreignKey':_0xe4d9('0x193'),'onDelete':'cascade'});db[_0xe4d9('0x5b')][_0xe4d9('0x11f')](db[_0xe4d9('0x82')],{'as':_0xe4d9('0x174'),'foreignKey':_0xe4d9('0x193')});db['OpenchannelAccount'][_0xe4d9('0x11f')](db[_0xe4d9('0x5d')],{'as':_0xe4d9('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0xe4d9('0x5b')][_0xe4d9('0x11f')](db[_0xe4d9('0x5f')],{'as':_0xe4d9('0x165'),'foreignKey':_0xe4d9('0x193')});db[_0xe4d9('0x5b')][_0xe4d9('0x11f')](db[_0xe4d9('0x5c')],{'as':_0xe4d9('0x153'),'foreignKey':_0xe4d9('0x193'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x5b')]['belongsTo'](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x5b')][_0xe4d9('0x12f')](db[_0xe4d9('0x89')],{'as':_0xe4d9('0x15e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe4d9('0x5b')]['belongsToMany'](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x194')});db[_0xe4d9('0x5c')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x5c')][_0xe4d9('0x12f')](db[_0xe4d9('0x61')],{'onDelete':'restrict','foreignKey':_0xe4d9('0x195')});db[_0xe4d9('0x5c')][_0xe4d9('0x12f')](db[_0xe4d9('0x5b')],{'onDelete':_0xe4d9('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0xe4d9('0x5c')][_0xe4d9('0x12f')](db[_0xe4d9('0x87')],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x15d')});db[_0xe4d9('0x5c')][_0xe4d9('0x12f')](db['Tag'],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x185')});db[_0xe4d9('0x5d')][_0xe4d9('0x11f')](db[_0xe4d9('0x5f')],{'as':_0xe4d9('0x165'),'onDelete':'cascade','foreignKey':_0xe4d9('0x196')});db[_0xe4d9('0x5d')]['belongsTo'](db[_0xe4d9('0x5b')],{'as':_0xe4d9('0x17b'),'foreignKey':'OpenchannelAccountId'});db[_0xe4d9('0x5d')]['belongsTo'](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x5d')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':'Owner','foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x5d')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0xe4d9('0x5d')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x197'),'as':_0xe4d9('0x180')});db[_0xe4d9('0x5d')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':'Users','through':_0xe4d9('0x13d'),'foreignKey':_0xe4d9('0x196')});db[_0xe4d9('0x5f')]['belongsTo'](db[_0xe4d9('0x13')],{'onDelete':'cascade','as':'User'});db['OpenchannelMessage']['belongsTo'](db[_0xe4d9('0x133')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x16b')});db['OpenchannelMessage'][_0xe4d9('0x12f')](db[_0xe4d9('0x5d')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x18c'),'foreignKey':_0xe4d9('0x196')});db[_0xe4d9('0x5f')][_0xe4d9('0x12f')](db[_0xe4d9('0xf3')],{'as':_0xe4d9('0xf3'),'foreignKey':_0xe4d9('0x198')});db[_0xe4d9('0x5f')][_0xe4d9('0x12f')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xe4d9('0x193')});db['OpenchannelQueue'][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':'UserOpenchannelQueue','foreignKey':_0xe4d9('0x195')});db[_0xe4d9('0x61')][_0xe4d9('0x130')](db['Team'],{'through':'team_has_openchannel_queues','as':_0xe4d9('0x161')});db['ChatWebsite']['hasMany'](db[_0xe4d9('0x172')],{'as':_0xe4d9('0x173'),'foreignKey':'ChatWebsiteId','onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x145')][_0xe4d9('0x11f')](db[_0xe4d9('0x82')],{'as':_0xe4d9('0x174'),'foreignKey':_0xe4d9('0x199')});db[_0xe4d9('0x145')]['hasMany'](db[_0xe4d9('0x70')],{'as':_0xe4d9('0x19a')});db[_0xe4d9('0x145')]['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db['ChatWebsite'][_0xe4d9('0x11f')](db[_0xe4d9('0x66')],{'as':_0xe4d9('0x153'),'foreignKey':'ChatWebsiteId','onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x145')]['hasMany'](db[_0xe4d9('0x68')],{'as':'Messages'});db[_0xe4d9('0x145')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':'List','foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x145')][_0xe4d9('0x12f')](db[_0xe4d9('0x87')],{'as':'Interval','foreignKey':_0xe4d9('0x15d')});db['ChatWebsite'][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{'as':_0xe4d9('0x3e'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xe4d9('0x12f')](db[_0xe4d9('0x89')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xe4d9('0x145')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':'user_has_chat_websites'});db[_0xe4d9('0x64')]['belongsTo'](db[_0xe4d9('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x64')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db['OpenchannelQueueReport'][_0xe4d9('0x12f')](db['OpenchannelInteraction'],{});db[_0xe4d9('0x64')][_0xe4d9('0x12f')](db[_0xe4d9('0x5f')],{});db[_0xe4d9('0x64')]['belongsTo'](db['User'],{});db['OpenchannelQueueReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x61')],{});db[_0xe4d9('0x66')]['belongsTo'](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x19b'),'foreignKey':'UserId','onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x66')][_0xe4d9('0x12f')](db['ChatQueue'],{'as':_0xe4d9('0x19c'),'foreignKey':'ChatQueueId','onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x66')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'as':_0xe4d9('0x19d'),'foreignKey':_0xe4d9('0x199'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x66')][_0xe4d9('0x12f')](db['Tag'],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x185')});db[_0xe4d9('0x128')][_0xe4d9('0x11f')](db[_0xe4d9('0x68')],{'as':_0xe4d9('0x165'),'onDelete':'cascade','foreignKey':_0xe4d9('0x19e')});db['ChatInteraction'][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xe4d9('0x128')]['belongsTo'](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db['ChatInteraction'][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x17c'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x128')]['belongsToMany'](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x19f'),'as':'Tags'});db[_0xe4d9('0x128')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x19f'),'as':_0xe4d9('0x180')});db[_0xe4d9('0x128')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x181'),'through':_0xe4d9('0x139'),'foreignKey':_0xe4d9('0x19e')});db[_0xe4d9('0x68')]['belongsTo'](db[_0xe4d9('0x13')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x13')});db[_0xe4d9('0x68')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x68')][_0xe4d9('0x12f')](db['ChatInteraction'],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x18c'),'foreignKey':'ChatInteractionId'});db[_0xe4d9('0x68')]['belongsTo'](db[_0xe4d9('0xf3')],{'as':_0xe4d9('0xf3'),'foreignKey':_0xe4d9('0x198')});db[_0xe4d9('0x68')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x199')});db[_0xe4d9('0x6a')][_0xe4d9('0x11f')](db[_0xe4d9('0xf3')],{'as':'Attachments','foreignKey':_0xe4d9('0x184'),'onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x6a')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x16b'),'foreignKey':'ContactId'});db[_0xe4d9('0x6a')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x199')});db[_0xe4d9('0x6c')][_0xe4d9('0x130')](db['User'],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x30'),'hooks':!![]});db[_0xe4d9('0x6c')][_0xe4d9('0x130')](db['Team'],{'through':_0xe4d9('0x1a0'),'as':'Teams'});db[_0xe4d9('0x6e')]['hasMany'](db[_0xe4d9('0x1a1')],{'as':_0xe4d9('0x165'),'foreignKey':_0xe4d9('0x1a2'),'onDelete':'cascade'});db[_0xe4d9('0x6e')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x156'),'through':_0xe4d9('0x132')});db[_0xe4d9('0x70')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'as':_0xe4d9('0x19d'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xe4d9('0x11f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x134'),'foreignKey':_0xe4d9('0x1a3')});db[_0xe4d9('0x133')]['hasMany'](db['CmContactHasItem'],{'as':_0xe4d9('0x1a4'),'foreignKey':_0xe4d9('0x1a5')});db[_0xe4d9('0x133')][_0xe4d9('0x11f')](db[_0xe4d9('0x75')],{'as':_0xe4d9('0x12e'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x133')][_0xe4d9('0x11f')](db['CmHopperFinal'],{'as':_0xe4d9('0x123'),'foreignKey':'ContactId'});db['CmContact'][_0xe4d9('0x11f')](db[_0xe4d9('0x124')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xe4d9('0x133')][_0xe4d9('0x11f')](db['ReportAgentPreview'],{'as':_0xe4d9('0x126'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x133')][_0xe4d9('0x11f')](db[_0xe4d9('0xdf')],{'as':_0xe4d9('0x15a'),'foreignKey':_0xe4d9('0x16c')});db['CmContact'][_0xe4d9('0x11f')](db[_0xe4d9('0x5d')],{'as':_0xe4d9('0x127'),'foreignKey':_0xe4d9('0x16c'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x133')][_0xe4d9('0x11f')](db['ChatInteraction'],{'as':_0xe4d9('0x129'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xe4d9('0x133')]['hasMany'](db['SmsInteraction'],{'as':_0xe4d9('0x13b'),'foreignKey':_0xe4d9('0x16c'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x133')]['hasMany'](db[_0xe4d9('0x12a')],{'as':_0xe4d9('0x12b'),'foreignKey':'ContactId','onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x133')][_0xe4d9('0x11f')](db[_0xe4d9('0x42')],{'as':_0xe4d9('0x12c'),'foreignKey':_0xe4d9('0x16c'),'onDelete':'restrict'});db[_0xe4d9('0x133')][_0xe4d9('0x12f')](db[_0xe4d9('0x72')],{'as':'Company','foreignKey':_0xe4d9('0x1a3')});db[_0xe4d9('0x133')]['belongsTo'](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x133')][_0xe4d9('0x130')](db['User'],{'as':_0xe4d9('0x181'),'through':'cm_user_has_contacts'});db['CmContact'][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'as':_0xe4d9('0x17f'),'through':_0xe4d9('0x1a6')});db['CmContact'][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x1a6'),'as':'ThroughTags'});db[_0xe4d9('0x75')]['hasMany'](db['CmHopperAdditionalPhone'],{'as':_0xe4d9('0x1a7'),'foreignKey':_0xe4d9('0x1a8')});db['CmHopper'][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':'Contact','foreignKey':_0xe4d9('0x16c'),'onDelete':_0xe4d9('0x11e')});db['CmHopper']['belongsTo'](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178'),'onDelete':_0xe4d9('0x11e')});db['CmHopper'][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x19b'),'foreignKey':_0xe4d9('0x11b')});db[_0xe4d9('0x75')][_0xe4d9('0x12f')](db[_0xe4d9('0x1b')],{'as':_0xe4d9('0x19c'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xe4d9('0x75')][_0xe4d9('0x12f')](db[_0xe4d9('0xf1')],{'as':_0xe4d9('0xf1'),'foreignKey':'CampaignId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0xe4d9('0x13')],{'as':'Owner','foreignKey':'OwnerId'});db[_0xe4d9('0x76')][_0xe4d9('0x12f')](db['CmContact'],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x76')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':'List','foreignKey':_0xe4d9('0x178'),'onDelete':'cascade'});db[_0xe4d9('0x76')]['belongsTo'](db[_0xe4d9('0x1b')],{'as':_0xe4d9('0x19c'),'foreignKey':_0xe4d9('0x157'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x76')][_0xe4d9('0x12f')](db['Campaign'],{'as':_0xe4d9('0xf1'),'foreignKey':_0xe4d9('0x1a9'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x80')]['hasMany'](db[_0xe4d9('0x85')],{'as':{'plural':_0xe4d9('0x1aa'),'singular':_0xe4d9('0x1ab')},'foreignKey':'AutomationAllId','onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x80')][_0xe4d9('0x11f')](db[_0xe4d9('0x85')],{'as':{'plural':_0xe4d9('0x1ac'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x80')]['hasMany'](db[_0xe4d9('0x7e')],{'as':_0xe4d9('0x1ad'),'foreignKey':_0xe4d9('0x1ae'),'onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x172')]['hasMany'](db[_0xe4d9('0x172')],{'as':_0xe4d9('0x173'),'foreignKey':'ParentId','onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x87')][_0xe4d9('0x11f')](db['Interval'],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xe4d9('0x11e'),'hooks':!![],'required':![]});db[_0xe4d9('0x87')][_0xe4d9('0x11f')](db[_0xe4d9('0x18')],{'as':_0xe4d9('0x122'),'foreignKey':'IntervalId','onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x87')][_0xe4d9('0x11f')](db['MailApplication'],{'as':_0xe4d9('0x1af'),'foreignKey':_0xe4d9('0x15d')});db[_0xe4d9('0x87')][_0xe4d9('0x11f')](db['ChatApplication'],{'as':_0xe4d9('0x1b0'),'foreignKey':_0xe4d9('0x15d')});db[_0xe4d9('0x87')][_0xe4d9('0x11f')](db['FaxApplication'],{'as':_0xe4d9('0x1b1'),'foreignKey':'IntervalId'});db[_0xe4d9('0x87')][_0xe4d9('0x11f')](db['SmsApplication'],{'as':_0xe4d9('0x1b2'),'foreignKey':'IntervalId'});db[_0xe4d9('0x8e')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{});db[_0xe4d9('0x8e')]['belongsTo'](db[_0xe4d9('0xa4')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xe4d9('0x12f')](db['AnalyticCustomReport'],{'foreignKey':_0xe4d9('0x1b3')});db[_0xe4d9('0x90')][_0xe4d9('0x130')](db[_0xe4d9('0x19')],{'as':'Mohs','through':'moh_has_sounds','onDelete':'restrict'});db[_0xe4d9('0x17d')][_0xe4d9('0x130')](db[_0xe4d9('0x133')],{'through':_0xe4d9('0x1a6')});db[_0xe4d9('0x17d')]['belongsToMany'](db[_0xe4d9('0x128')],{'through':_0xe4d9('0x19f')});db[_0xe4d9('0x17d')][_0xe4d9('0x130')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xe4d9('0x56')],{'through':_0xe4d9('0x190')});db[_0xe4d9('0x17d')]['belongsToMany'](db[_0xe4d9('0x12a')],{'through':_0xe4d9('0x18b')});db['Tag'][_0xe4d9('0x130')](db[_0xe4d9('0x5d')],{'through':_0xe4d9('0x197')});db[_0xe4d9('0x17d')][_0xe4d9('0x130')](db[_0xe4d9('0x10b')],{'through':'whatsapp_interaction_has_tags'});db[_0xe4d9('0x95')][_0xe4d9('0x12f')](db[_0xe4d9('0x93')],{'as':_0xe4d9('0x1b4'),'foreignKey':_0xe4d9('0x1b5')});db[_0xe4d9('0x97')][_0xe4d9('0x12f')](db[_0xe4d9('0x75')],{'as':_0xe4d9('0x1b6'),'foreignKey':_0xe4d9('0x1a8')});db[_0xe4d9('0x95')][_0xe4d9('0x12f')](db['CmContact'],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x1a5')});db['Trigger']['hasMany'](db[_0xe4d9('0x85')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xe4d9('0x1b7'),'onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x9b')][_0xe4d9('0x11f')](db[_0xe4d9('0x85')],{'as':{'plural':_0xe4d9('0x1b8'),'singular':'AnyCondition'},'foreignKey':_0xe4d9('0x1b9'),'onDelete':_0xe4d9('0x11e'),'hooks':!![]});db[_0xe4d9('0x9b')]['hasMany'](db[_0xe4d9('0x7e')],{'as':_0xe4d9('0x1ad'),'foreignKey':'TriggerId','onDelete':_0xe4d9('0x11e'),'hooks':!![]});db['AnalyticCustomReport'][_0xe4d9('0x11f')](db['AnalyticFieldReport'],{'as':_0xe4d9('0x1ba'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xe4d9('0xa4')][_0xe4d9('0x11f')](db[_0xe4d9('0xa8')],{'as':_0xe4d9('0x1ba'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xe4d9('0x1bb')});db['AnalyticFieldReport'][_0xe4d9('0x12f')](db[_0xe4d9('0xa7')],{'foreignKey':'MetricId'});db[_0xe4d9('0xaa')][_0xe4d9('0x11f')](db[_0xe4d9('0xac')],{'as':_0xe4d9('0x1bc'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0xac')][_0xe4d9('0x11f')](db[_0xe4d9('0x1be')],{'as':_0xe4d9('0x1bf'),'onDelete':'cascade','foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xac')][_0xe4d9('0x11f')](db[_0xe4d9('0x1be')],{'as':_0xe4d9('0x1c1'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'DescriptionId'});db[_0xe4d9('0xac')]['hasMany'](db[_0xe4d9('0x1be')],{'as':_0xe4d9('0x1ba'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'FieldId'});db[_0xe4d9('0xac')][_0xe4d9('0x12f')](db[_0xe4d9('0xaa')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0x1be')][_0xe4d9('0x11f')](db['SalesforceField'],{'as':_0xe4d9('0x1c2'),'foreignKey':_0xe4d9('0x1c0')});db['SalesforceField'][_0xe4d9('0x11f')](db['SalesforceField'],{'as':_0xe4d9('0x1c3'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0x1be')][_0xe4d9('0x11f')](db[_0xe4d9('0x1be')],{'as':_0xe4d9('0x1c5'),'foreignKey':_0xe4d9('0x1c6')});db['SalesforceField'][_0xe4d9('0x12f')](db[_0xe4d9('0x9d')],{'as':_0xe4d9('0x9d'),'foreignKey':_0xe4d9('0x1c7')});db[_0xe4d9('0xaf')]['hasMany'](db[_0xe4d9('0xb1')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xe4d9('0xb1')][_0xe4d9('0x11f')](db[_0xe4d9('0xb3')],{'as':'Subjects','onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xb1')]['hasMany'](db[_0xe4d9('0xb3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xb1')][_0xe4d9('0x11f')](db['SugarcrmField'],{'as':_0xe4d9('0x1ba'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xe4d9('0x12f')](db[_0xe4d9('0xaf')],{'as':_0xe4d9('0x17b'),'foreignKey':'AccountId'});db[_0xe4d9('0xb3')][_0xe4d9('0x11f')](db[_0xe4d9('0xb3')],{'as':'Subject','foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xb3')]['hasMany'](db[_0xe4d9('0xb3')],{'as':_0xe4d9('0x1c3'),'foreignKey':'DescriptionId'});db[_0xe4d9('0xb3')]['hasMany'](db[_0xe4d9('0xb3')],{'as':_0xe4d9('0x1c5'),'foreignKey':_0xe4d9('0x1c6')});db['SugarcrmField'][_0xe4d9('0x12f')](db[_0xe4d9('0x9d')],{'as':'Variable','foreignKey':_0xe4d9('0x1c7')});db[_0xe4d9('0xb5')][_0xe4d9('0x11f')](db[_0xe4d9('0xb7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0xb7')][_0xe4d9('0x11f')](db[_0xe4d9('0x1c8')],{'as':'Subjects','onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c0')});db['DeskConfiguration'][_0xe4d9('0x11f')](db[_0xe4d9('0x1c8')],{'as':_0xe4d9('0x1c1'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'DescriptionId'});db[_0xe4d9('0xb7')][_0xe4d9('0x11f')](db[_0xe4d9('0x1c8')],{'as':_0xe4d9('0x1ba'),'onDelete':'cascade','foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0xb7')][_0xe4d9('0x12f')](db[_0xe4d9('0xb5')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0xb7')][_0xe4d9('0x130')](db['Tag'],{'through':_0xe4d9('0x1c9')});db['DeskField'][_0xe4d9('0x11f')](db[_0xe4d9('0x1c8')],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0xe4d9('0x1c8')],{'as':_0xe4d9('0x1c3'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0x1c8')][_0xe4d9('0x11f')](db[_0xe4d9('0x1c8')],{'as':_0xe4d9('0x1c5'),'foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0x1c8')][_0xe4d9('0x12f')](db[_0xe4d9('0x9d')],{'as':_0xe4d9('0x9d'),'foreignKey':_0xe4d9('0x1c7')});db[_0xe4d9('0xba')]['hasMany'](db[_0xe4d9('0xbb')],{'as':'Configurations','onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1bd')});db['ZohoConfiguration'][_0xe4d9('0x11f')](db[_0xe4d9('0xbd')],{'as':_0xe4d9('0x1bf'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xbb')][_0xe4d9('0x11f')](db[_0xe4d9('0xbd')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xe4d9('0x1c4')});db['ZohoConfiguration']['hasMany'](db[_0xe4d9('0xbd')],{'as':_0xe4d9('0x1ba'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0xbb')][_0xe4d9('0x12f')](db[_0xe4d9('0xba')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0xe4d9('0x11f')](db[_0xe4d9('0xbd')],{'as':_0xe4d9('0x1c2'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xbd')][_0xe4d9('0x11f')](db[_0xe4d9('0xbd')],{'as':'Description','foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xbd')]['hasMany'](db[_0xe4d9('0xbd')],{'as':_0xe4d9('0x1c5'),'foreignKey':'FieldId'});db[_0xe4d9('0xbd')][_0xe4d9('0x12f')](db['Variable'],{'as':'Variable','foreignKey':_0xe4d9('0x1c7')});db['ZendeskAccount'][_0xe4d9('0x11f')](db['ZendeskConfiguration'],{'as':_0xe4d9('0x1bc'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0x1ca')]['hasMany'](db[_0xe4d9('0xc2')],{'as':_0xe4d9('0x1bf'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0x1ca')][_0xe4d9('0x11f')](db[_0xe4d9('0xc2')],{'as':_0xe4d9('0x1c1'),'foreignKey':_0xe4d9('0x1c4')});db['ZendeskConfiguration'][_0xe4d9('0x11f')](db[_0xe4d9('0xc2')],{'as':_0xe4d9('0x1ba'),'foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0x1ca')][_0xe4d9('0x12f')](db[_0xe4d9('0xbf')],{'as':'Account','foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0x1ca')]['belongsToMany'](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0xe4d9('0xc2')]['hasMany'](db['ZendeskField'],{'as':_0xe4d9('0x1c2'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xc2')][_0xe4d9('0x11f')](db['ZendeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xe4d9('0xc2')][_0xe4d9('0x11f')](db['ZendeskField'],{'as':'Field','foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0xc2')][_0xe4d9('0x12f')](db[_0xe4d9('0x9d')],{'as':_0xe4d9('0x9d'),'foreignKey':_0xe4d9('0x1c7')});db[_0xe4d9('0xc4')][_0xe4d9('0x11f')](db[_0xe4d9('0x1cb')],{'as':_0xe4d9('0x1bc'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'AccountId'});db[_0xe4d9('0x1cb')][_0xe4d9('0x11f')](db[_0xe4d9('0x1cc')],{'as':_0xe4d9('0x1bf'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'SubjectId'});db[_0xe4d9('0x1cb')][_0xe4d9('0x11f')](db[_0xe4d9('0x1cc')],{'as':_0xe4d9('0x1c1'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c4')});db['FreshdeskConfiguration'][_0xe4d9('0x11f')](db[_0xe4d9('0x1cc')],{'as':_0xe4d9('0x1ba'),'onDelete':'cascade','foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0x1cb')][_0xe4d9('0x12f')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xe4d9('0x1bd')});db['FreshdeskConfiguration'][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x1cd')});db['FreshdeskField']['hasMany'](db[_0xe4d9('0x1cc')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xe4d9('0x11f')](db[_0xe4d9('0x1cc')],{'as':_0xe4d9('0x1c3'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0xe4d9('0x11f')](db[_0xe4d9('0x1cc')],{'as':_0xe4d9('0x1c5'),'foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0x1cc')][_0xe4d9('0x12f')](db['Variable'],{'as':'Variable','foreignKey':_0xe4d9('0x1c7')});db['VtigerAccount']['hasMany'](db[_0xe4d9('0xc9')],{'as':_0xe4d9('0x1bc'),'onDelete':'cascade','foreignKey':_0xe4d9('0x1bd')});db['VtigerConfiguration'][_0xe4d9('0x11f')](db[_0xe4d9('0x1ce')],{'as':_0xe4d9('0x1bf'),'foreignKey':_0xe4d9('0x1c0')});db['VtigerConfiguration'][_0xe4d9('0x11f')](db[_0xe4d9('0x1ce')],{'as':_0xe4d9('0x1c1'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xc9')][_0xe4d9('0x11f')](db['VtigerField'],{'as':'Fields','foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0xc9')]['belongsTo'](db['VtigerAccount'],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0x1ce')][_0xe4d9('0x11f')](db[_0xe4d9('0x1ce')],{'as':_0xe4d9('0x1c2'),'foreignKey':_0xe4d9('0x1c0')});db['VtigerField'][_0xe4d9('0x11f')](db['VtigerField'],{'as':_0xe4d9('0x1c3'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0x1ce')][_0xe4d9('0x11f')](db[_0xe4d9('0x1ce')],{'as':_0xe4d9('0x1c5'),'foreignKey':'FieldId'});db[_0xe4d9('0x1ce')]['belongsTo'](db['Variable'],{'as':_0xe4d9('0x9d'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xe4d9('0x11f')](db[_0xe4d9('0xcd')],{'as':_0xe4d9('0x1bc'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'AccountId'});db[_0xe4d9('0xcd')]['hasMany'](db['ServicenowField'],{'as':_0xe4d9('0x1bf'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xcd')][_0xe4d9('0x11f')](db[_0xe4d9('0xcf')],{'as':_0xe4d9('0x1c1'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xcd')]['hasMany'](db[_0xe4d9('0xcf')],{'as':'Fields','foreignKey':'FieldId'});db[_0xe4d9('0xcd')][_0xe4d9('0x12f')](db[_0xe4d9('0xcb')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x1bd')});db['ServicenowField'][_0xe4d9('0x11f')](db['ServicenowField'],{'as':_0xe4d9('0x1c2'),'foreignKey':'SubjectId'});db[_0xe4d9('0xcf')][_0xe4d9('0x11f')](db[_0xe4d9('0xcf')],{'as':_0xe4d9('0x1c3'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xcf')][_0xe4d9('0x11f')](db[_0xe4d9('0xcf')],{'as':_0xe4d9('0x1c5'),'foreignKey':_0xe4d9('0x1c6')});db['ServicenowField'][_0xe4d9('0x12f')](db['Variable'],{'as':_0xe4d9('0x9d'),'foreignKey':_0xe4d9('0x1c7')});db['Dynamics365Account'][_0xe4d9('0x11f')](db['Dynamics365Configuration'],{'as':_0xe4d9('0x1bc'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1bd')});db['Dynamics365Account'][_0xe4d9('0x12f')](db[_0xe4d9('0x113')],{'as':_0xe4d9('0x113'),'foreignKey':_0xe4d9('0x16e')});db['Dynamics365Configuration'][_0xe4d9('0x11f')](db[_0xe4d9('0xd3')],{'as':_0xe4d9('0x1bf'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xd2')][_0xe4d9('0x11f')](db[_0xe4d9('0xd3')],{'as':_0xe4d9('0x1c1'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xd2')]['hasMany'](db[_0xe4d9('0xd3')],{'as':_0xe4d9('0x1ba'),'onDelete':_0xe4d9('0x11e'),'foreignKey':'FieldId'});db[_0xe4d9('0xd2')]['belongsTo'](db[_0xe4d9('0x1cf')],{'as':'Account','foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0xd3')][_0xe4d9('0x11f')](db[_0xe4d9('0xd3')],{'as':_0xe4d9('0x1c2'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xd3')][_0xe4d9('0x11f')](db[_0xe4d9('0xd3')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xe4d9('0xd3')][_0xe4d9('0x11f')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0xd3')]['belongsTo'](db['Variable'],{'as':_0xe4d9('0x9d'),'foreignKey':_0xe4d9('0x1c7')});db[_0xe4d9('0xd5')]['hasMany'](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0xd6')]['hasMany'](db['FreshsalesField'],{'as':_0xe4d9('0x1bf'),'foreignKey':'SubjectId'});db[_0xe4d9('0xd6')]['hasMany'](db[_0xe4d9('0xd8')],{'as':_0xe4d9('0x1c1'),'foreignKey':_0xe4d9('0x1c4')});db[_0xe4d9('0xd6')][_0xe4d9('0x11f')](db[_0xe4d9('0xd8')],{'as':'Fields','foreignKey':'FieldId'});db[_0xe4d9('0xd6')][_0xe4d9('0x12f')](db[_0xe4d9('0xd5')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x1bd')});db[_0xe4d9('0xd8')][_0xe4d9('0x11f')](db[_0xe4d9('0xd8')],{'as':_0xe4d9('0x1c2'),'foreignKey':_0xe4d9('0x1c0')});db[_0xe4d9('0xd8')][_0xe4d9('0x11f')](db[_0xe4d9('0xd8')],{'as':'Description','foreignKey':_0xe4d9('0x1c4')});db['FreshsalesField'][_0xe4d9('0x11f')](db[_0xe4d9('0xd8')],{'as':_0xe4d9('0x1c5'),'foreignKey':_0xe4d9('0x1c6')});db[_0xe4d9('0xd8')][_0xe4d9('0x12f')](db[_0xe4d9('0x9d')],{'as':_0xe4d9('0x9d'),'foreignKey':_0xe4d9('0x1c7')});db[_0xe4d9('0x1d0')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{});db[_0xe4d9('0x1d0')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':'List','foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x1d0')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0x1d0')][_0xe4d9('0x12f')](db[_0xe4d9('0x128')],{});db['ChatQueueReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x68')],{});db[_0xe4d9('0x1d0')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{});db[_0xe4d9('0x1d0')][_0xe4d9('0x12f')](db['ChatQueue'],{});db[_0xe4d9('0x1a1')]['belongsTo'](db[_0xe4d9('0x13')],{'onDelete':_0xe4d9('0x11e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xe4d9('0x12f')](db['User'],{'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x1d1')});db['JscriptySessionReport'][_0xe4d9('0x11f')](db[_0xe4d9('0xdd')],{'foreignKey':_0xe4d9('0x1d2'),'onDelete':_0xe4d9('0x11e')});db['JscriptySessionReport'][_0xe4d9('0x11f')](db[_0xe4d9('0xdc')],{'foreignKey':_0xe4d9('0x1d2'),'onDelete':_0xe4d9('0x11e')});db['SmsQueueReport'][_0xe4d9('0x12f')](db['SmsAccount'],{});db[_0xe4d9('0xe1')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':'ListId'});db[_0xe4d9('0xe1')]['belongsTo'](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':_0xe4d9('0x16c')});db[_0xe4d9('0xe1')][_0xe4d9('0x12f')](db[_0xe4d9('0x56')],{});db[_0xe4d9('0xe1')][_0xe4d9('0x12f')](db[_0xe4d9('0x58')],{});db[_0xe4d9('0xe1')][_0xe4d9('0x12f')](db['User'],{});db['SmsQueueReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x5a')],{});db[_0xe4d9('0xe6')][_0xe4d9('0x11f')](db[_0xe4d9('0xdf')],{'foreignKey':_0xe4d9('0x1d3')});db['JscriptyProject'][_0xe4d9('0x11f')](db['JscriptyQuestionReport'],{'foreignKey':_0xe4d9('0x1d3')});db[_0xe4d9('0xe6')][_0xe4d9('0x11f')](db[_0xe4d9('0xdc')],{'foreignKey':_0xe4d9('0x1d3')});db[_0xe4d9('0xee')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':'Agents','through':_0xe4d9('0x1d4')});db[_0xe4d9('0xee')][_0xe4d9('0x130')](db[_0xe4d9('0x1b')],{'through':_0xe4d9('0x115'),'as':_0xe4d9('0x1d5')});db[_0xe4d9('0xee')]['belongsToMany'](db[_0xe4d9('0x3f')],{'through':_0xe4d9('0x1d6'),'as':_0xe4d9('0x140')});db[_0xe4d9('0xee')]['belongsToMany'](db['ChatQueue'],{'through':_0xe4d9('0x1a0'),'as':_0xe4d9('0x1d7')});db[_0xe4d9('0xee')][_0xe4d9('0x130')](db['FaxQueue'],{'through':_0xe4d9('0x18d'),'as':_0xe4d9('0x1d8')});db[_0xe4d9('0xee')]['belongsToMany'](db[_0xe4d9('0x5a')],{'through':'team_has_sms_queues','as':_0xe4d9('0x141')});db[_0xe4d9('0xee')][_0xe4d9('0x130')](db[_0xe4d9('0x61')],{'through':_0xe4d9('0x1d9'),'as':_0xe4d9('0x142')});db[_0xe4d9('0xee')]['belongsToMany'](db[_0xe4d9('0x112')],{'through':_0xe4d9('0x1da'),'as':_0xe4d9('0x143')});db[_0xe4d9('0xee')][_0xe4d9('0x130')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0xe4d9('0xf1')][_0xe4d9('0x11f')](db['CmHopper'],{'as':_0xe4d9('0x12e'),'foreignKey':'CampaignId'});db[_0xe4d9('0xf1')]['hasMany'](db['CmHopperFinal'],{'as':_0xe4d9('0x123'),'foreignKey':_0xe4d9('0x1a9')});db[_0xe4d9('0xf1')][_0xe4d9('0x11f')](db[_0xe4d9('0x124')],{'as':_0xe4d9('0x158'),'foreignKey':'CampaignId'});db['Campaign'][_0xe4d9('0x11f')](db[_0xe4d9('0x76')],{'as':_0xe4d9('0x159'),'foreignKey':'CampaignId'});db['Campaign'][_0xe4d9('0x12f')](db[_0xe4d9('0x29')],{'as':'Trunk','foreignKey':_0xe4d9('0x15b')});db[_0xe4d9('0xf1')]['belongsTo'](db[_0xe4d9('0x29')],{'as':_0xe4d9('0x1db'),'foreignKey':_0xe4d9('0x15c')});db[_0xe4d9('0xf1')][_0xe4d9('0x12f')](db[_0xe4d9('0x87')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xe4d9('0xf1')][_0xe4d9('0x12f')](db[_0xe4d9('0xe9')],{'as':_0xe4d9('0xe9'),'foreignKey':'SquareProjectId'});db[_0xe4d9('0xf1')][_0xe4d9('0x130')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x136'),'through':_0xe4d9('0x1dc')});db[_0xe4d9('0xf1')]['belongsToMany'](db['CmList'],{'as':_0xe4d9('0x162'),'through':'campaigns_has_cm_blacklists'});db[_0xe4d9('0xf3')][_0xe4d9('0x12f')](db['ChatOfflineMessage'],{'as':_0xe4d9('0x6a'),'foreignKey':'ChatOfflineMessageId'});db[_0xe4d9('0xf6')][_0xe4d9('0x12f')](db[_0xe4d9('0x175')],{});db[_0xe4d9('0xf6')][_0xe4d9('0x12f')](db[_0xe4d9('0x42')],{});db['MailTransferReport']['belongsTo'](db[_0xe4d9('0x3e')],{'foreignKey':_0xe4d9('0x1dd'),'as':_0xe4d9('0x1de')});db['MailTransferReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':'FromUserId','as':_0xe4d9('0x1df')});db[_0xe4d9('0xf6')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e0'),'as':'ToAgent'});db[_0xe4d9('0xf6')][_0xe4d9('0x12f')](db['MailQueue'],{'foreignKey':_0xe4d9('0x1e1'),'as':_0xe4d9('0x1e2')});db[_0xe4d9('0xf6')][_0xe4d9('0x12f')](db[_0xe4d9('0x3e')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xe4d9('0xf8')][_0xe4d9('0x12f')](db[_0xe4d9('0x68')],{});db[_0xe4d9('0xf8')][_0xe4d9('0x12f')](db[_0xe4d9('0x128')],{});db[_0xe4d9('0xf8')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'foreignKey':_0xe4d9('0x1e3'),'as':_0xe4d9('0x1de')});db[_0xe4d9('0xf8')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xe4d9('0xf8')]['belongsTo'](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e0'),'as':_0xe4d9('0x1e4')});db[_0xe4d9('0xf8')][_0xe4d9('0x12f')](db[_0xe4d9('0x6c')],{'foreignKey':_0xe4d9('0x1e5'),'as':_0xe4d9('0x1e2')});db[_0xe4d9('0xf8')][_0xe4d9('0x12f')](db[_0xe4d9('0x145')],{'foreignKey':_0xe4d9('0x1e6'),'as':_0xe4d9('0x1e7')});db[_0xe4d9('0xfa')][_0xe4d9('0x12f')](db[_0xe4d9('0x189')],{});db[_0xe4d9('0xfa')]['belongsTo'](db[_0xe4d9('0x12a')],{});db[_0xe4d9('0xfa')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xe4d9('0x1e8'),'as':_0xe4d9('0x1de')});db[_0xe4d9('0xfa')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e9'),'as':_0xe4d9('0x1df')});db[_0xe4d9('0xfa')]['belongsTo'](db['User'],{'foreignKey':_0xe4d9('0x1e0'),'as':_0xe4d9('0x1e4')});db[_0xe4d9('0xfa')][_0xe4d9('0x12f')](db[_0xe4d9('0x4f')],{'foreignKey':'ToFaxQueueId','as':_0xe4d9('0x1e2')});db[_0xe4d9('0xfa')]['belongsTo'](db[_0xe4d9('0x4d')],{'foreignKey':'ToFaxAccountId','as':_0xe4d9('0x1e7')});db[_0xe4d9('0xfc')][_0xe4d9('0x12f')](db[_0xe4d9('0x5f')],{});db[_0xe4d9('0xfc')]['belongsTo'](db[_0xe4d9('0x5d')],{});db[_0xe4d9('0xfc')][_0xe4d9('0x12f')](db[_0xe4d9('0x5b')],{'foreignKey':_0xe4d9('0x1ea'),'as':'FromAccount'});db[_0xe4d9('0xfc')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':'FromUserId','as':_0xe4d9('0x1df')});db[_0xe4d9('0xfc')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e0'),'as':_0xe4d9('0x1e4')});db[_0xe4d9('0xfc')][_0xe4d9('0x12f')](db[_0xe4d9('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0xe4d9('0x1e2')});db[_0xe4d9('0xfc')][_0xe4d9('0x12f')](db[_0xe4d9('0x5b')],{'foreignKey':'ToOpenchannelAccountId','as':_0xe4d9('0x1e7')});db[_0xe4d9('0xfe')][_0xe4d9('0x12f')](db[_0xe4d9('0x58')],{});db['SmsTransferReport'][_0xe4d9('0x12f')](db['SmsInteraction'],{});db[_0xe4d9('0xfe')][_0xe4d9('0x12f')](db[_0xe4d9('0x52')],{'foreignKey':_0xe4d9('0x1eb'),'as':_0xe4d9('0x1de')});db['SmsTransferReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e9'),'as':_0xe4d9('0x1df')});db[_0xe4d9('0xfe')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e0'),'as':_0xe4d9('0x1e4')});db[_0xe4d9('0xfe')][_0xe4d9('0x12f')](db[_0xe4d9('0x5a')],{'foreignKey':_0xe4d9('0x1ec'),'as':_0xe4d9('0x1e2')});db[_0xe4d9('0xfe')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xe4d9('0x1ed'),'as':_0xe4d9('0x1e7')});db[_0xe4d9('0x135')][_0xe4d9('0x11f')](db[_0xe4d9('0x172')],{'as':_0xe4d9('0x173'),'foreignKey':_0xe4d9('0x178'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x135')][_0xe4d9('0x11f')](db[_0xe4d9('0x7c')],{'as':_0xe4d9('0x1ee'),'foreignKey':_0xe4d9('0x178')});db['CmList']['hasMany'](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x134'),'onDelete':_0xe4d9('0x11e'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x135')]['hasMany'](db[_0xe4d9('0x78')],{'as':'HopperFinals','foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x135')][_0xe4d9('0x11f')](db['CmHopperHistory'],{'as':_0xe4d9('0x125'),'foreignKey':'ListId'});db['CmList'][_0xe4d9('0x11f')](db[_0xe4d9('0x126')],{'as':_0xe4d9('0x126'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x135')][_0xe4d9('0x130')](db[_0xe4d9('0x1b')],{'as':_0xe4d9('0x1ef'),'through':_0xe4d9('0x1f0')});db[_0xe4d9('0x135')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':'Agents','through':_0xe4d9('0x137')});db[_0xe4d9('0x101')][_0xe4d9('0x11f')](db[_0xe4d9('0x18')],{'as':_0xe4d9('0x122'),'onDelete':'cascade'});db[_0xe4d9('0x101')][_0xe4d9('0x130')](db['User'],{'as':_0xe4d9('0x160'),'through':_0xe4d9('0x118')});db[_0xe4d9('0x101')][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'through':_0xe4d9('0x1f1'),'as':_0xe4d9('0x161')});db['UserProfile'][_0xe4d9('0x11f')](db['User'],{'as':_0xe4d9('0x181'),'foreignKey':'userProfileId'});db[_0xe4d9('0x103')]['hasMany'](db[_0xe4d9('0x105')],{'as':_0xe4d9('0x1f2'),'foreignKey':_0xe4d9('0x1f3'),'onDelete':'cascade'});db[_0xe4d9('0x105')]['hasMany'](db[_0xe4d9('0x106')],{'as':_0xe4d9('0x1f4'),'foreignKey':_0xe4d9('0x1f5'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x14e')]['hasMany'](db[_0xe4d9('0x172')],{'as':'Dispositions','foreignKey':_0xe4d9('0x1f6'),'onDelete':_0xe4d9('0x11e')});db[_0xe4d9('0x14e')]['hasMany'](db['CannedAnswer'],{'as':_0xe4d9('0x174'),'foreignKey':'WhatsappAccountId'});db[_0xe4d9('0x14e')]['hasMany'](db[_0xe4d9('0x10d')],{'as':_0xe4d9('0x165'),'foreignKey':_0xe4d9('0x1f6')});db[_0xe4d9('0x14e')][_0xe4d9('0x11f')](db[_0xe4d9('0x10b')],{'as':_0xe4d9('0x176')});db[_0xe4d9('0x14e')][_0xe4d9('0x11f')](db[_0xe4d9('0x10a')],{'as':_0xe4d9('0x153'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db['WhatsappAccount']['belongsTo'](db['CmList'],{'as':_0xe4d9('0x177'),'foreignKey':'ListId'});db[_0xe4d9('0x14e')][_0xe4d9('0x12f')](db[_0xe4d9('0x89')],{'as':_0xe4d9('0x15e'),'foreignKey':_0xe4d9('0x15f')});db[_0xe4d9('0x14e')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':'Agents','through':_0xe4d9('0x14f')});db[_0xe4d9('0x10a')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x10a')]['belongsTo'](db[_0xe4d9('0x112')],{'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x10a')][_0xe4d9('0x12f')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0xe4d9('0x10a')][_0xe4d9('0x12f')](db[_0xe4d9('0x87')],{'onDelete':_0xe4d9('0x16f'),'foreignKey':_0xe4d9('0x15d')});db[_0xe4d9('0x10a')][_0xe4d9('0x12f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xe4d9('0x185')});db[_0xe4d9('0x10b')][_0xe4d9('0x11f')](db[_0xe4d9('0x10d')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe4d9('0x1f7')});db[_0xe4d9('0x10b')][_0xe4d9('0x12f')](db[_0xe4d9('0x14e')],{'as':_0xe4d9('0x17b'),'foreignKey':_0xe4d9('0x1f6')});db[_0xe4d9('0x10b')][_0xe4d9('0x12f')](db[_0xe4d9('0x133')],{'as':_0xe4d9('0x16b'),'foreignKey':'ContactId'});db[_0xe4d9('0x10b')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':'Owner','foreignKey':_0xe4d9('0x11b')});db['WhatsappInteraction'][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x1f8'),'as':_0xe4d9('0x17f')});db[_0xe4d9('0x10b')][_0xe4d9('0x130')](db[_0xe4d9('0x17d')],{'through':_0xe4d9('0x1f8'),'as':_0xe4d9('0x180')});db[_0xe4d9('0x10b')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0xe4d9('0x10d')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x13')});db[_0xe4d9('0x10d')]['belongsTo'](db[_0xe4d9('0x133')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x16b')});db[_0xe4d9('0x10d')][_0xe4d9('0x12f')](db[_0xe4d9('0x10b')],{'onDelete':_0xe4d9('0x11e'),'as':_0xe4d9('0x18c'),'foreignKey':_0xe4d9('0x1f7')});db[_0xe4d9('0x10d')]['belongsTo'](db[_0xe4d9('0x14e')],{'as':_0xe4d9('0x17b'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xe4d9('0x12f')](db['WhatsappAccount'],{});db[_0xe4d9('0x10e')][_0xe4d9('0x12f')](db[_0xe4d9('0x135')],{'as':_0xe4d9('0x177'),'foreignKey':_0xe4d9('0x178')});db[_0xe4d9('0x10e')][_0xe4d9('0x12f')](db['CmContact'],{'as':_0xe4d9('0x16b'),'foreignKey':'ContactId'});db['WhatsappQueueReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x10b')],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappQueue'],{});db[_0xe4d9('0x10e')]['belongsTo'](db['WhatsappMessage'],{});db[_0xe4d9('0x10e')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{});db[_0xe4d9('0x110')][_0xe4d9('0x12f')](db['WhatsappMessage'],{});db[_0xe4d9('0x110')]['belongsTo'](db[_0xe4d9('0x10b')],{});db['WhatsappTransferReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x14e')],{'foreignKey':_0xe4d9('0x1f9'),'as':_0xe4d9('0x1de')});db['WhatsappTransferReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x14e')],{'foreignKey':_0xe4d9('0x1fa'),'as':'ToAccount'});db[_0xe4d9('0x110')][_0xe4d9('0x12f')](db[_0xe4d9('0x112')],{'foreignKey':_0xe4d9('0x1fb'),'as':_0xe4d9('0x1e2')});db['WhatsappTransferReport'][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e9'),'as':_0xe4d9('0x1df')});db[_0xe4d9('0x110')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'foreignKey':_0xe4d9('0x1e0'),'as':'ToAgent'});db[_0xe4d9('0x112')][_0xe4d9('0x130')](db[_0xe4d9('0x13')],{'as':_0xe4d9('0x160'),'through':'UserWhatsappQueue','foreignKey':_0xe4d9('0x1fc')});db['WhatsappQueue'][_0xe4d9('0x130')](db[_0xe4d9('0xee')],{'through':_0xe4d9('0x1da'),'as':_0xe4d9('0x161')});db[_0xe4d9('0x1fd')][_0xe4d9('0x12f')](db[_0xe4d9('0x13')],{'as':'user','foreignKey':'UserId','onDelete':_0xe4d9('0x11e'),'hooks':!![]});db['CloudProvider'][_0xe4d9('0x11c')](db[_0xe4d9('0x1cf')],{'as':_0xe4d9('0x1cf'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x113')][_0xe4d9('0x11c')](db[_0xe4d9('0x3a')],{'as':_0xe4d9('0x170'),'onDelete':_0xe4d9('0x16f')});db[_0xe4d9('0x113')][_0xe4d9('0x11c')](db[_0xe4d9('0x3c')],{'as':_0xe4d9('0x171'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8242d48..d9a8397 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3684=['/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/userProfiles','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','snippet','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./utils/client-side-logger','./api/client-side-logs','then','/api/users','./api/user','use','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/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/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue'];(function(_0x19ff9f,_0x1258b5){var _0x303cb1=function(_0x2487a2){while(--_0x2487a2){_0x19ff9f['push'](_0x19ff9f['shift']());}};_0x303cb1(++_0x1258b5);}(_0x3684,0x169));var _0x4368=function(_0x5493fa,_0x4803ff){_0x5493fa=_0x5493fa-0x0;var _0x5b2e23=_0x3684[_0x5493fa];return _0x5b2e23;};'use strict';var path=require(_0x4368('0x0'));var express=require(_0x4368('0x1'));var errors=require(_0x4368('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x4368('0x3'))['setupLoggers'];var clientSideLogs=require(_0x4368('0x4'));exports['default']=function(_0x49a90a){return setupLoggers(_0x49a90a)[_0x4368('0x5')](function(){_0x49a90a['use'](_0x4368('0x6'),require(_0x4368('0x7')));_0x49a90a[_0x4368('0x8')](_0x4368('0x9'),require('./api/voiceChanSpy'));_0x49a90a[_0x4368('0x8')](_0x4368('0xa'),require('./api/voiceContext'));_0x49a90a['use'](_0x4368('0xb'),require(_0x4368('0xc')));_0x49a90a[_0x4368('0x8')](_0x4368('0xd'),require('./api/voiceMusicOnHold'));_0x49a90a[_0x4368('0x8')]('/api/voice/queues',require(_0x4368('0xe')));_0x49a90a[_0x4368('0x8')]('/api/voice/recordings',require(_0x4368('0xf')));_0x49a90a[_0x4368('0x8')](_0x4368('0x10'),require('./api/screenRecording'));_0x49a90a['use'](_0x4368('0x11'),require(_0x4368('0x12')));_0x49a90a['use'](_0x4368('0x13'),require(_0x4368('0x14')));_0x49a90a['use'](_0x4368('0x15'),require(_0x4368('0x16')));_0x49a90a[_0x4368('0x8')](_0x4368('0x17'),require(_0x4368('0x18')));_0x49a90a['use'](_0x4368('0x19'),require('./api/voiceAgentReport'));_0x49a90a[_0x4368('0x8')](_0x4368('0x1a'),require('./api/voiceQueueReport'));_0x49a90a['use'](_0x4368('0x1b'),require('./api/memberReport'));_0x49a90a['use']('/api/trunks',require(_0x4368('0x1c')));_0x49a90a['use']('/api/voice/transfers/reports',require(_0x4368('0x1d')));_0x49a90a[_0x4368('0x8')](_0x4368('0x1e'),require(_0x4368('0x1f')));_0x49a90a[_0x4368('0x8')](_0x4368('0x20'),require(_0x4368('0x21')));_0x49a90a[_0x4368('0x8')]('/api/mail/queues',require(_0x4368('0x22')));_0x49a90a[_0x4368('0x8')]('/api/mail/substatuses',require(_0x4368('0x23')));_0x49a90a[_0x4368('0x8')](_0x4368('0x24'),require('./api/mailInteraction'));_0x49a90a[_0x4368('0x8')]('/api/mail/messages',require('./api/mailMessage'));_0x49a90a[_0x4368('0x8')](_0x4368('0x25'),require(_0x4368('0x26')));_0x49a90a[_0x4368('0x8')]('/api/mail/reports/queue',require(_0x4368('0x27')));_0x49a90a[_0x4368('0x8')](_0x4368('0x28'),require('./api/dashboard'));_0x49a90a[_0x4368('0x8')](_0x4368('0x29'),require('./api/dashboardItem'));_0x49a90a[_0x4368('0x8')](_0x4368('0x2a'),require(_0x4368('0x2b')));_0x49a90a[_0x4368('0x8')](_0x4368('0x2c'),require(_0x4368('0x2d')));_0x49a90a['use']('/api/fax/interactions',require(_0x4368('0x2e')));_0x49a90a[_0x4368('0x8')](_0x4368('0x2f'),require(_0x4368('0x30')));_0x49a90a['use'](_0x4368('0x31'),require(_0x4368('0x32')));_0x49a90a[_0x4368('0x8')]('/api/fax/reports/queue',require(_0x4368('0x33')));_0x49a90a[_0x4368('0x8')]('/api/sms/accounts',require(_0x4368('0x34')));_0x49a90a[_0x4368('0x8')](_0x4368('0x35'),require(_0x4368('0x36')));_0x49a90a[_0x4368('0x8')](_0x4368('0x37'),require(_0x4368('0x38')));_0x49a90a[_0x4368('0x8')](_0x4368('0x39'),require(_0x4368('0x3a')));_0x49a90a[_0x4368('0x8')]('/api/sms/queues',require(_0x4368('0x3b')));_0x49a90a[_0x4368('0x8')](_0x4368('0x3c'),require(_0x4368('0x3d')));_0x49a90a[_0x4368('0x8')](_0x4368('0x3e'),require('./api/openchannelApplication'));_0x49a90a[_0x4368('0x8')](_0x4368('0x3f'),require(_0x4368('0x40')));_0x49a90a[_0x4368('0x8')](_0x4368('0x41'),require(_0x4368('0x42')));_0x49a90a['use'](_0x4368('0x43'),require(_0x4368('0x44')));_0x49a90a[_0x4368('0x8')](_0x4368('0x45'),require(_0x4368('0x46')));_0x49a90a[_0x4368('0x8')](_0x4368('0x47'),require(_0x4368('0x48')));_0x49a90a[_0x4368('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x49a90a[_0x4368('0x8')](_0x4368('0x49'),require(_0x4368('0x4a')));_0x49a90a[_0x4368('0x8')]('/api/chat/messages',require(_0x4368('0x4b')));_0x49a90a[_0x4368('0x8')](_0x4368('0x4c'),require(_0x4368('0x4d')));_0x49a90a[_0x4368('0x8')](_0x4368('0x4e'),require('./api/chatQueue'));_0x49a90a[_0x4368('0x8')](_0x4368('0x4f'),require(_0x4368('0x50')));_0x49a90a[_0x4368('0x8')](_0x4368('0x51'),require(_0x4368('0x52')));_0x49a90a[_0x4368('0x8')](_0x4368('0x53'),require(_0x4368('0x54')));_0x49a90a['use'](_0x4368('0x55'),require(_0x4368('0x56')));_0x49a90a[_0x4368('0x8')](_0x4368('0x57'),require('./api/cmHopper'));_0x49a90a[_0x4368('0x8')](_0x4368('0x58'),require(_0x4368('0x59')));_0x49a90a[_0x4368('0x8')](_0x4368('0x5a'),require(_0x4368('0x5b')));_0x49a90a['use'](_0x4368('0x5c'),require(_0x4368('0x5d')));_0x49a90a[_0x4368('0x8')](_0x4368('0x5e'),require(_0x4368('0x5f')));_0x49a90a[_0x4368('0x8')](_0x4368('0x60'),require(_0x4368('0x61')));_0x49a90a[_0x4368('0x8')]('/api/automations',require(_0x4368('0x62')));_0x49a90a[_0x4368('0x8')]('/api/canned_answers',require(_0x4368('0x63')));_0x49a90a[_0x4368('0x8')]('/api/dispositions',require(_0x4368('0x64')));_0x49a90a[_0x4368('0x8')](_0x4368('0x65'),require(_0x4368('0x66')));_0x49a90a[_0x4368('0x8')](_0x4368('0x67'),require(_0x4368('0x68')));_0x49a90a[_0x4368('0x8')](_0x4368('0x69'),require(_0x4368('0x6a')));_0x49a90a['use'](_0x4368('0x6b'),require('./api/cdr'));_0x49a90a[_0x4368('0x8')]('/api/voiceQueuesLog',require(_0x4368('0x6c')));_0x49a90a[_0x4368('0x8')](_0x4368('0x6d'),require(_0x4368('0x6e')));_0x49a90a['use']('/api/sounds',require(_0x4368('0x6f')));_0x49a90a['use']('/api/tags',require(_0x4368('0x70')));_0x49a90a['use'](_0x4368('0x71'),require(_0x4368('0x72')));_0x49a90a['use'](_0x4368('0x73'),require(_0x4368('0x74')));_0x49a90a[_0x4368('0x8')](_0x4368('0x75'),require('./api/cmHopperAdditionalPhone'));_0x49a90a[_0x4368('0x8')](_0x4368('0x76'),require(_0x4368('0x77')));_0x49a90a['use'](_0x4368('0x78'),require(_0x4368('0x79')));_0x49a90a['use'](_0x4368('0x7a'),require(_0x4368('0x7b')));_0x49a90a['use'](_0x4368('0x7c'),require(_0x4368('0x7d')));_0x49a90a[_0x4368('0x8')]('/api/integrations/reports',require(_0x4368('0x7e')));_0x49a90a[_0x4368('0x8')](_0x4368('0x7f'),require('./api/analyticCustomReport'));_0x49a90a[_0x4368('0x8')](_0x4368('0x80'),require(_0x4368('0x81')));_0x49a90a[_0x4368('0x8')](_0x4368('0x82'),require(_0x4368('0x83')));_0x49a90a['use'](_0x4368('0x84'),require('./api/analyticMetric'));_0x49a90a[_0x4368('0x8')]('/api/analytics/field_reports',require(_0x4368('0x85')));_0x49a90a[_0x4368('0x8')](_0x4368('0x86'),require(_0x4368('0x87')));_0x49a90a[_0x4368('0x8')](_0x4368('0x88'),require('./api/intSalesforceAccount'));_0x49a90a[_0x4368('0x8')](_0x4368('0x89'),require('./api/intSalesforceConfiguration'));_0x49a90a[_0x4368('0x8')](_0x4368('0x8a'),require(_0x4368('0x8b')));_0x49a90a['use'](_0x4368('0x8c'),require(_0x4368('0x8d')));_0x49a90a[_0x4368('0x8')](_0x4368('0x8e'),require(_0x4368('0x8f')));_0x49a90a[_0x4368('0x8')](_0x4368('0x90'),require(_0x4368('0x91')));_0x49a90a[_0x4368('0x8')](_0x4368('0x92'),require(_0x4368('0x93')));_0x49a90a['use'](_0x4368('0x94'),require(_0x4368('0x95')));_0x49a90a['use'](_0x4368('0x96'),require(_0x4368('0x97')));_0x49a90a['use'](_0x4368('0x98'),require('./api/intZohoAccount'));_0x49a90a[_0x4368('0x8')]('/api/integrations/zoho/configurations',require(_0x4368('0x99')));_0x49a90a['use']('/api/integrations/zoho/fields',require(_0x4368('0x9a')));_0x49a90a[_0x4368('0x8')](_0x4368('0x9b'),require(_0x4368('0x9c')));_0x49a90a[_0x4368('0x8')]('/api/integrations/zendesk/configurations',require(_0x4368('0x9d')));_0x49a90a[_0x4368('0x8')](_0x4368('0x9e'),require(_0x4368('0x9f')));_0x49a90a[_0x4368('0x8')](_0x4368('0xa0'),require('./api/intFreshdeskAccount'));_0x49a90a[_0x4368('0x8')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x49a90a[_0x4368('0x8')](_0x4368('0xa1'),require(_0x4368('0xa2')));_0x49a90a['use'](_0x4368('0xa3'),require(_0x4368('0xa4')));_0x49a90a[_0x4368('0x8')](_0x4368('0xa5'),require(_0x4368('0xa6')));_0x49a90a[_0x4368('0x8')](_0x4368('0xa7'),require(_0x4368('0xa8')));_0x49a90a[_0x4368('0x8')](_0x4368('0xa9'),require('./api/intServicenowAccount'));_0x49a90a[_0x4368('0x8')](_0x4368('0xaa'),require(_0x4368('0xab')));_0x49a90a[_0x4368('0x8')](_0x4368('0xac'),require(_0x4368('0xad')));_0x49a90a[_0x4368('0x8')](_0x4368('0xae'),require(_0x4368('0xaf')));_0x49a90a[_0x4368('0x8')](_0x4368('0xb0'),require('./api/intDynamics365Configuration'));_0x49a90a[_0x4368('0x8')](_0x4368('0xb1'),require('./api/intDynamics365Field'));_0x49a90a[_0x4368('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x49a90a[_0x4368('0x8')](_0x4368('0xb2'),require('./api/intFreshsalesConfiguration'));_0x49a90a['use'](_0x4368('0xb3'),require(_0x4368('0xb4')));_0x49a90a['use'](_0x4368('0xb5'),require('./api/network'));_0x49a90a[_0x4368('0x8')](_0x4368('0xb6'),require('./api/chatQueueReport'));_0x49a90a[_0x4368('0x8')](_0x4368('0xb7'),require('./api/chatInternalMessage'));_0x49a90a[_0x4368('0x8')](_0x4368('0xb8'),require('./api/jscriptyAnswerReport'));_0x49a90a[_0x4368('0x8')](_0x4368('0xb9'),require(_0x4368('0xba')));_0x49a90a[_0x4368('0x8')](_0x4368('0xbb'),require(_0x4368('0xbc')));_0x49a90a[_0x4368('0x8')](_0x4368('0xbd'),require(_0x4368('0xbe')));_0x49a90a[_0x4368('0x8')](_0x4368('0xbf'),require(_0x4368('0xc0')));_0x49a90a[_0x4368('0x8')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x49a90a[_0x4368('0x8')]('/api/jscripty/projects',require(_0x4368('0xc1')));_0x49a90a['use']('/api/settings',require(_0x4368('0xc2')));_0x49a90a[_0x4368('0x8')](_0x4368('0xc3'),require(_0x4368('0xc4')));_0x49a90a[_0x4368('0x8')](_0x4368('0xc5'),require(_0x4368('0xc6')));_0x49a90a[_0x4368('0x8')](_0x4368('0xc7'),require(_0x4368('0xc8')));_0x49a90a[_0x4368('0x8')](_0x4368('0xc9'),require(_0x4368('0xca')));_0x49a90a[_0x4368('0x8')]('/api/teams',require(_0x4368('0xcb')));_0x49a90a[_0x4368('0x8')]('/api/license',require(_0x4368('0xcc')));_0x49a90a['use'](_0x4368('0xcd'),require(_0x4368('0xce')));_0x49a90a['use'](_0x4368('0xcf'),require('./api/migration'));_0x49a90a['use'](_0x4368('0xd0'),require(_0x4368('0xd1')));_0x49a90a[_0x4368('0x8')](_0x4368('0xd2'),require(_0x4368('0xd3')));_0x49a90a[_0x4368('0x8')](_0x4368('0xd4'),require(_0x4368('0xd5')));_0x49a90a['use'](_0x4368('0xd6'),require(_0x4368('0xd7')));_0x49a90a[_0x4368('0x8')](_0x4368('0xd8'),require(_0x4368('0xd9')));_0x49a90a[_0x4368('0x8')](_0x4368('0xda'),require(_0x4368('0xdb')));_0x49a90a[_0x4368('0x8')](_0x4368('0xdc'),require('./api/smsTransferReport'));_0x49a90a[_0x4368('0x8')](_0x4368('0xdd'),require('./api/cmList'));_0x49a90a[_0x4368('0x8')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x49a90a['use'](_0x4368('0xde'),require(_0x4368('0xdf')));_0x49a90a[_0x4368('0x8')]('/api/userProfile/sections',require(_0x4368('0xe0')));_0x49a90a[_0x4368('0x8')]('/api/userProfile/resources',require(_0x4368('0xe1')));_0x49a90a[_0x4368('0x8')](_0x4368('0xe2'),require(_0x4368('0xe3')));_0x49a90a[_0x4368('0x8')](_0x4368('0xe4'),require('./api/whatsappAccount'));_0x49a90a[_0x4368('0x8')](_0x4368('0xe5'),require(_0x4368('0xe6')));_0x49a90a[_0x4368('0x8')]('/api/whatsapp/interactions',require(_0x4368('0xe7')));_0x49a90a[_0x4368('0x8')](_0x4368('0xe8'),require('./api/whatsappMessage'));_0x49a90a[_0x4368('0x8')](_0x4368('0xe9'),require(_0x4368('0xea')));_0x49a90a[_0x4368('0x8')](_0x4368('0xeb'),require(_0x4368('0xec')));_0x49a90a[_0x4368('0x8')](_0x4368('0xed'),require(_0x4368('0xee')));_0x49a90a[_0x4368('0x8')](_0x4368('0xef'),require(_0x4368('0xf0')));_0x49a90a[_0x4368('0x8')](_0x4368('0xf1'),require(_0x4368('0xf2')));_0x49a90a['use'](_0x4368('0xf3'),require(_0x4368('0xf4')));_0x49a90a['use'](_0x4368('0xf5'),require(_0x4368('0xf6')));_0x49a90a[_0x4368('0x8')]('/api/auth/google',require(_0x4368('0xf7')));_0x49a90a[_0x4368('0x8')](_0x4368('0xf8'),require(_0x4368('0xf9')));_0x49a90a['use']('/api/jira',require(_0x4368('0xfa')));_0x49a90a[_0x4368('0x8')](_0x4368('0xfb'),require('./api/rpc'));_0x49a90a[_0x4368('0x8')](_0x4368('0xfc'),require('./api/version'));_0x49a90a[_0x4368('0x8')](_0x4368('0xfd'),require('./api/system'));_0x49a90a['use'](_0x4368('0xfe'),require(_0x4368('0xff')));_0x49a90a[_0x4368('0x8')]('/api/webbar',require(_0x4368('0x100')));_0x49a90a[_0x4368('0x8')](_0x4368('0x101'),clientSideLogs);_0x49a90a[_0x4368('0x8')](_0x4368('0x102'),express[_0x4368('0x103')](path[_0x4368('0x104')](config[_0x4368('0x105')],_0x4368('0x102'))));_0x49a90a[_0x4368('0x8')]('/www',express[_0x4368('0x103')](path['join'](config[_0x4368('0x105')],_0x4368('0x106'))));_0x49a90a[_0x4368('0x8')](_0x4368('0x107'),express[_0x4368('0x103')](path[_0x4368('0x104')](config[_0x4368('0x105')],_0x4368('0x107'))));_0x49a90a[_0x4368('0x8')]('/snippet',express['static'](path['join'](config[_0x4368('0x105')],_0x4368('0x108'),'3.7.0')));_0x49a90a[_0x4368('0x8')]('/plugins',express[_0x4368('0x103')](path['join'](config['root'],_0x4368('0x109'))));_0x49a90a['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x49a90a[_0x4368('0x10a')]('/*')[_0x4368('0x10b')](function(_0x131865,_0x329073){_0x329073[_0x4368('0x10c')](path[_0x4368('0x10d')](_0x49a90a[_0x4368('0x10b')](_0x4368('0x10e'))+_0x4368('0x10f')));});return _0x49a90a;});}; \ No newline at end of file +var _0x4853=['./api/cloudProvider','/api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','/api/webbar','/api/logs','/apidoc','static','root','/demo','join','snippet','3.5.0','/plugins','/server/files/plugins','route','get','sendFile','appPath','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/voice/mails','./api/voiceMail','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','/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/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/migration','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./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/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders'];(function(_0x363cfa,_0x12a78a){var _0x1d22d2=function(_0x40d2cb){while(--_0x40d2cb){_0x363cfa['push'](_0x363cfa['shift']());}};_0x1d22d2(++_0x12a78a);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var path=require('path');var express=require(_0x3485('0x0'));var errors=require('./errors');var config=require(_0x3485('0x1'));var setupLoggers=require(_0x3485('0x2'))[_0x3485('0x3')];var clientSideLogs=require(_0x3485('0x4'));exports[_0x3485('0x5')]=function(_0xd1a964){return setupLoggers(_0xd1a964)['then'](function(){_0xd1a964['use']('/api/users',require(_0x3485('0x6')));_0xd1a964[_0x3485('0x7')](_0x3485('0x8'),require(_0x3485('0x9')));_0xd1a964[_0x3485('0x7')](_0x3485('0xa'),require(_0x3485('0xb')));_0xd1a964['use'](_0x3485('0xc'),require(_0x3485('0xd')));_0xd1a964[_0x3485('0x7')](_0x3485('0xe'),require(_0x3485('0xf')));_0xd1a964[_0x3485('0x7')](_0x3485('0x10'),require(_0x3485('0x11')));_0xd1a964[_0x3485('0x7')]('/api/voice/recordings',require(_0x3485('0x12')));_0xd1a964[_0x3485('0x7')]('/api/screen/recordings',require('./api/screenRecording'));_0xd1a964[_0x3485('0x7')](_0x3485('0x13'),require(_0x3485('0x14')));_0xd1a964['use']('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0xd1a964['use']('/api/voice/calls/reports',require(_0x3485('0x15')));_0xd1a964[_0x3485('0x7')](_0x3485('0x16'),require('./api/voiceDialReport'));_0xd1a964[_0x3485('0x7')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0xd1a964[_0x3485('0x7')]('/api/voice/queues/reports',require(_0x3485('0x17')));_0xd1a964[_0x3485('0x7')](_0x3485('0x18'),require(_0x3485('0x19')));_0xd1a964['use']('/api/trunks',require('./api/trunk'));_0xd1a964['use']('/api/voice/transfers/reports',require(_0x3485('0x1a')));_0xd1a964[_0x3485('0x7')](_0x3485('0x1b'),require(_0x3485('0x1c')));_0xd1a964[_0x3485('0x7')](_0x3485('0x1d'),require(_0x3485('0x1e')));_0xd1a964[_0x3485('0x7')](_0x3485('0x1f'),require(_0x3485('0x20')));_0xd1a964[_0x3485('0x7')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0xd1a964[_0x3485('0x7')]('/api/mail/interactions',require(_0x3485('0x21')));_0xd1a964[_0x3485('0x7')](_0x3485('0x22'),require(_0x3485('0x23')));_0xd1a964[_0x3485('0x7')](_0x3485('0x24'),require(_0x3485('0x25')));_0xd1a964[_0x3485('0x7')]('/api/mail/reports/queue',require(_0x3485('0x26')));_0xd1a964[_0x3485('0x7')](_0x3485('0x27'),require(_0x3485('0x28')));_0xd1a964[_0x3485('0x7')](_0x3485('0x29'),require(_0x3485('0x2a')));_0xd1a964[_0x3485('0x7')](_0x3485('0x2b'),require(_0x3485('0x2c')));_0xd1a964[_0x3485('0x7')](_0x3485('0x2d'),require(_0x3485('0x2e')));_0xd1a964['use'](_0x3485('0x2f'),require(_0x3485('0x30')));_0xd1a964[_0x3485('0x7')](_0x3485('0x31'),require(_0x3485('0x32')));_0xd1a964['use'](_0x3485('0x33'),require('./api/faxQueue'));_0xd1a964[_0x3485('0x7')](_0x3485('0x34'),require('./api/faxQueueReport'));_0xd1a964[_0x3485('0x7')](_0x3485('0x35'),require(_0x3485('0x36')));_0xd1a964[_0x3485('0x7')]('/api/sms/applications',require('./api/smsApplication'));_0xd1a964[_0x3485('0x7')]('/api/sms/interactions',require(_0x3485('0x37')));_0xd1a964[_0x3485('0x7')]('/api/sms/messages',require(_0x3485('0x38')));_0xd1a964[_0x3485('0x7')](_0x3485('0x39'),require(_0x3485('0x3a')));_0xd1a964[_0x3485('0x7')](_0x3485('0x3b'),require('./api/openchannelAccount'));_0xd1a964[_0x3485('0x7')]('/api/openchannel/applications',require(_0x3485('0x3c')));_0xd1a964[_0x3485('0x7')](_0x3485('0x3d'),require(_0x3485('0x3e')));_0xd1a964['use']('/api/openchannel/messages',require(_0x3485('0x3f')));_0xd1a964[_0x3485('0x7')](_0x3485('0x40'),require('./api/openchannelQueue'));_0xd1a964[_0x3485('0x7')](_0x3485('0x41'),require(_0x3485('0x42')));_0xd1a964['use'](_0x3485('0x43'),require('./api/openchannelQueueReport'));_0xd1a964['use'](_0x3485('0x44'),require('./api/chatApplication'));_0xd1a964[_0x3485('0x7')](_0x3485('0x45'),require(_0x3485('0x46')));_0xd1a964[_0x3485('0x7')](_0x3485('0x47'),require(_0x3485('0x48')));_0xd1a964[_0x3485('0x7')]('/api/chat/offline_messages',require(_0x3485('0x49')));_0xd1a964[_0x3485('0x7')]('/api/chat/queues',require('./api/chatQueue'));_0xd1a964[_0x3485('0x7')](_0x3485('0x4a'),require(_0x3485('0x4b')));_0xd1a964[_0x3485('0x7')](_0x3485('0x4c'),require(_0x3485('0x4d')));_0xd1a964[_0x3485('0x7')](_0x3485('0x4e'),require(_0x3485('0x4f')));_0xd1a964[_0x3485('0x7')](_0x3485('0x50'),require('./api/cmContact'));_0xd1a964['use']('/api/cm/hopper',require(_0x3485('0x51')));_0xd1a964[_0x3485('0x7')](_0x3485('0x52'),require(_0x3485('0x53')));_0xd1a964[_0x3485('0x7')](_0x3485('0x54'),require('./api/cmHopperFinal'));_0xd1a964[_0x3485('0x7')]('/api/cm/hopper_history',require(_0x3485('0x55')));_0xd1a964[_0x3485('0x7')](_0x3485('0x56'),require('./api/cmCustomField'));_0xd1a964[_0x3485('0x7')](_0x3485('0x57'),require(_0x3485('0x58')));_0xd1a964[_0x3485('0x7')](_0x3485('0x59'),require('./api/automation'));_0xd1a964[_0x3485('0x7')](_0x3485('0x5a'),require('./api/cannedAnswer'));_0xd1a964[_0x3485('0x7')]('/api/dispositions',require(_0x3485('0x5b')));_0xd1a964[_0x3485('0x7')](_0x3485('0x5c'),require(_0x3485('0x5d')));_0xd1a964['use'](_0x3485('0x5e'),require(_0x3485('0x5f')));_0xd1a964['use']('/api/pauses',require(_0x3485('0x60')));_0xd1a964[_0x3485('0x7')]('/api/cdr',require(_0x3485('0x61')));_0xd1a964[_0x3485('0x7')](_0x3485('0x62'),require(_0x3485('0x63')));_0xd1a964[_0x3485('0x7')](_0x3485('0x64'),require(_0x3485('0x65')));_0xd1a964[_0x3485('0x7')](_0x3485('0x66'),require(_0x3485('0x67')));_0xd1a964['use'](_0x3485('0x68'),require(_0x3485('0x69')));_0xd1a964[_0x3485('0x7')](_0x3485('0x6a'),require('./api/contactItemType'));_0xd1a964[_0x3485('0x7')](_0x3485('0x6b'),require('./api/cmContactHasItem'));_0xd1a964[_0x3485('0x7')](_0x3485('0x6c'),require(_0x3485('0x6d')));_0xd1a964[_0x3485('0x7')](_0x3485('0x6e'),require(_0x3485('0x6f')));_0xd1a964['use'](_0x3485('0x70'),require(_0x3485('0x71')));_0xd1a964['use'](_0x3485('0x72'),require('./api/variable'));_0xd1a964[_0x3485('0x7')](_0x3485('0x73'),require('./api/integration'));_0xd1a964[_0x3485('0x7')](_0x3485('0x74'),require('./api/integrationReport'));_0xd1a964['use'](_0x3485('0x75'),require(_0x3485('0x76')));_0xd1a964[_0x3485('0x7')]('/api/analytics/default_reports',require(_0x3485('0x77')));_0xd1a964[_0x3485('0x7')](_0x3485('0x78'),require('./api/analyticExtractedReport'));_0xd1a964[_0x3485('0x7')]('/api/analytics/metrics',require(_0x3485('0x79')));_0xd1a964[_0x3485('0x7')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0xd1a964[_0x3485('0x7')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0xd1a964['use'](_0x3485('0x7a'),require(_0x3485('0x7b')));_0xd1a964[_0x3485('0x7')](_0x3485('0x7c'),require('./api/intSalesforceConfiguration'));_0xd1a964[_0x3485('0x7')](_0x3485('0x7d'),require(_0x3485('0x7e')));_0xd1a964[_0x3485('0x7')](_0x3485('0x7f'),require(_0x3485('0x80')));_0xd1a964[_0x3485('0x7')](_0x3485('0x81'),require('./api/intSugarcrmConfiguration'));_0xd1a964[_0x3485('0x7')]('/api/integrations/sugarcrm/fields',require(_0x3485('0x82')));_0xd1a964['use']('/api/integrations/desk/accounts',require(_0x3485('0x83')));_0xd1a964[_0x3485('0x7')](_0x3485('0x84'),require(_0x3485('0x85')));_0xd1a964[_0x3485('0x7')](_0x3485('0x86'),require(_0x3485('0x87')));_0xd1a964[_0x3485('0x7')]('/api/integrations/zoho/accounts',require(_0x3485('0x88')));_0xd1a964[_0x3485('0x7')](_0x3485('0x89'),require(_0x3485('0x8a')));_0xd1a964[_0x3485('0x7')](_0x3485('0x8b'),require(_0x3485('0x8c')));_0xd1a964[_0x3485('0x7')]('/api/integrations/zendesk/accounts',require(_0x3485('0x8d')));_0xd1a964[_0x3485('0x7')](_0x3485('0x8e'),require('./api/intZendeskConfiguration'));_0xd1a964[_0x3485('0x7')]('/api/integrations/zendesk/fields',require(_0x3485('0x8f')));_0xd1a964[_0x3485('0x7')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0xd1a964[_0x3485('0x7')]('/api/integrations/freshdesk/configurations',require(_0x3485('0x90')));_0xd1a964[_0x3485('0x7')](_0x3485('0x91'),require(_0x3485('0x92')));_0xd1a964[_0x3485('0x7')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0xd1a964[_0x3485('0x7')](_0x3485('0x93'),require(_0x3485('0x94')));_0xd1a964['use']('/api/integrations/vtiger/fields',require(_0x3485('0x95')));_0xd1a964['use'](_0x3485('0x96'),require('./api/intServicenowAccount'));_0xd1a964[_0x3485('0x7')](_0x3485('0x97'),require(_0x3485('0x98')));_0xd1a964['use'](_0x3485('0x99'),require(_0x3485('0x9a')));_0xd1a964[_0x3485('0x7')]('/api/integrations/dynamics365/accounts',require(_0x3485('0x9b')));_0xd1a964['use'](_0x3485('0x9c'),require('./api/intDynamics365Configuration'));_0xd1a964[_0x3485('0x7')](_0x3485('0x9d'),require('./api/intDynamics365Field'));_0xd1a964[_0x3485('0x7')](_0x3485('0x9e'),require('./api/intFreshsalesAccount'));_0xd1a964[_0x3485('0x7')](_0x3485('0x9f'),require(_0x3485('0xa0')));_0xd1a964[_0x3485('0x7')](_0x3485('0xa1'),require('./api/intFreshsalesField'));_0xd1a964[_0x3485('0x7')](_0x3485('0xa2'),require(_0x3485('0xa3')));_0xd1a964[_0x3485('0x7')](_0x3485('0xa4'),require('./api/chatQueueReport'));_0xd1a964[_0x3485('0x7')](_0x3485('0xa5'),require(_0x3485('0xa6')));_0xd1a964[_0x3485('0x7')](_0x3485('0xa7'),require('./api/jscriptyAnswerReport'));_0xd1a964[_0x3485('0x7')](_0x3485('0xa8'),require(_0x3485('0xa9')));_0xd1a964[_0x3485('0x7')](_0x3485('0xaa'),require(_0x3485('0xab')));_0xd1a964[_0x3485('0x7')](_0x3485('0xac'),require(_0x3485('0xad')));_0xd1a964['use'](_0x3485('0xae'),require(_0x3485('0xaf')));_0xd1a964[_0x3485('0x7')](_0x3485('0xb0'),require(_0x3485('0xb1')));_0xd1a964[_0x3485('0x7')](_0x3485('0xb2'),require(_0x3485('0xb3')));_0xd1a964[_0x3485('0x7')]('/api/settings',require(_0x3485('0xb4')));_0xd1a964['use'](_0x3485('0xb5'),require(_0x3485('0xb6')));_0xd1a964[_0x3485('0x7')]('/api/square/projects',require('./api/squareProject'));_0xd1a964['use'](_0x3485('0xb7'),require(_0x3485('0xb8')));_0xd1a964[_0x3485('0x7')](_0x3485('0xb9'),require(_0x3485('0xba')));_0xd1a964[_0x3485('0x7')](_0x3485('0xbb'),require(_0x3485('0xbc')));_0xd1a964[_0x3485('0x7')]('/api/license',require(_0x3485('0xbd')));_0xd1a964[_0x3485('0x7')](_0x3485('0xbe'),require('./api/campaign'));_0xd1a964['use']('/api/migrations',require(_0x3485('0xbf')));_0xd1a964['use']('/api/attachments',require(_0x3485('0xc0')));_0xd1a964[_0x3485('0x7')](_0x3485('0xc1'),require(_0x3485('0xc2')));_0xd1a964[_0x3485('0x7')]('/api/mail/reports/transfer',require(_0x3485('0xc3')));_0xd1a964[_0x3485('0x7')](_0x3485('0xc4'),require(_0x3485('0xc5')));_0xd1a964[_0x3485('0x7')](_0x3485('0xc6'),require(_0x3485('0xc7')));_0xd1a964[_0x3485('0x7')]('/api/openchannel/reports/transfer',require(_0x3485('0xc8')));_0xd1a964[_0x3485('0x7')](_0x3485('0xc9'),require(_0x3485('0xca')));_0xd1a964[_0x3485('0x7')](_0x3485('0xcb'),require(_0x3485('0xcc')));_0xd1a964[_0x3485('0x7')](_0x3485('0xcd'),require(_0x3485('0xce')));_0xd1a964[_0x3485('0x7')](_0x3485('0xcf'),require(_0x3485('0xd0')));_0xd1a964[_0x3485('0x7')](_0x3485('0xd1'),require(_0x3485('0xd2')));_0xd1a964[_0x3485('0x7')]('/api/userProfile/resources',require(_0x3485('0xd3')));_0xd1a964[_0x3485('0x7')](_0x3485('0xd4'),require(_0x3485('0xd5')));_0xd1a964[_0x3485('0x7')](_0x3485('0xd6'),require('./api/whatsappAccount'));_0xd1a964['use'](_0x3485('0xd7'),require(_0x3485('0xd8')));_0xd1a964[_0x3485('0x7')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0xd1a964[_0x3485('0x7')](_0x3485('0xd9'),require('./api/whatsappMessage'));_0xd1a964[_0x3485('0x7')](_0x3485('0xda'),require('./api/whatsappQueueReport'));_0xd1a964[_0x3485('0x7')](_0x3485('0xdb'),require(_0x3485('0xdc')));_0xd1a964[_0x3485('0x7')](_0x3485('0xdd'),require('./api/whatsappQueue'));_0xd1a964['use'](_0x3485('0xde'),require(_0x3485('0xdf')));_0xd1a964[_0x3485('0x7')](_0x3485('0xe0'),require('./api/realtime'));_0xd1a964[_0x3485('0x7')](_0x3485('0xe1'),require('./api/user-setting'));_0xd1a964[_0x3485('0x7')](_0x3485('0xe2'),require(_0x3485('0xe3')));_0xd1a964[_0x3485('0x7')]('/api/auth/google',require(_0x3485('0xe4')));_0xd1a964[_0x3485('0x7')](_0x3485('0xe5'),require(_0x3485('0xe6')));_0xd1a964['use'](_0x3485('0xe7'),require(_0x3485('0xe8')));_0xd1a964[_0x3485('0x7')](_0x3485('0xe9'),require(_0x3485('0xea')));_0xd1a964['use'](_0x3485('0xeb'),require(_0x3485('0xec')));_0xd1a964['use'](_0x3485('0xed'),require('./api/system'));_0xd1a964[_0x3485('0x7')](_0x3485('0xee'),require('./api/pm2'));_0xd1a964['use'](_0x3485('0xef'),require('./api/webbar'));_0xd1a964[_0x3485('0x7')](_0x3485('0xf0'),clientSideLogs);_0xd1a964[_0x3485('0x7')](_0x3485('0xf1'),express[_0x3485('0xf2')](path['join'](config[_0x3485('0xf3')],_0x3485('0xf1'))));_0xd1a964['use']('/www',express[_0x3485('0xf2')](path['join'](config[_0x3485('0xf3')],'/www')));_0xd1a964['use'](_0x3485('0xf4'),express[_0x3485('0xf2')](path[_0x3485('0xf5')](config[_0x3485('0xf3')],'/demo')));_0xd1a964[_0x3485('0x7')]('/snippet',express['static'](path['join'](config[_0x3485('0xf3')],_0x3485('0xf6'),_0x3485('0xf7'))));_0xd1a964[_0x3485('0x7')](_0x3485('0xf8'),express[_0x3485('0xf2')](path['join'](config[_0x3485('0xf3')],_0x3485('0xf9'))));_0xd1a964[_0x3485('0xfa')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x3485('0xfb')](errors[0x194]);_0xd1a964[_0x3485('0xfa')]('/*')[_0x3485('0xfb')](function(_0x58dad1,_0xcf58ec){_0xcf58ec[_0x3485('0xfc')](path['resolve'](_0xd1a964[_0x3485('0xfb')](_0x3485('0xfd'))+'/index.html'));});return _0xd1a964;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 22e8be6..d484f17 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27d1=['../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc'];(function(_0xb27233,_0x493a2c){var _0x55ace8=function(_0x282780){while(--_0x282780){_0xb27233['push'](_0xb27233['shift']());}};_0x55ace8(++_0x493a2c);}(_0x27d1,0x1f4));var _0x127d=function(_0x179442,_0x2b88bb){_0x179442=_0x179442-0x0;var _0x7d9db4=_0x27d1[_0x179442];return _0x7d9db4;};'use strict';var jayson=require(_0x127d('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x127d('0x1')]=function(){return new Promise(function(_0x39dcce,_0x129c8c){var _0x373685={};_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x4')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x5')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x6')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x7')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x8')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x9')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0xa')));_0x373685=_['merge'](_0x373685,require(_0x127d('0xb')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/trunk/trunk.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0xc')));_0x373685=_['merge'](_0x373685,require(_0x127d('0xd')));_0x373685=_['merge'](_0x373685,require(_0x127d('0xe')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0xf')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x10')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x11')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x12')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x13')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x14')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x15')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x16')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x17')));_0x373685=_['merge'](_0x373685,require('../api/faxMessage/faxMessage.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/faxQueue/faxQueue.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x18')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/smsAccount/smsAccount.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x19')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x1a')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x1b')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x1c')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x1d')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x1e')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x1f')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x20')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x21')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/chatQueue/chatQueue.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/cmContact/cmContact.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x22')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x23')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x24')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x25')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x26')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x27')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x28')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x29')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x2a')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x2b')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x2c')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x373685=_['merge'](_0x373685,require(_0x127d('0x2d')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x2e')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x2f')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x30')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x31')));_0x373685=_['merge'](_0x373685,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x32')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x33')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x34')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x35')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x36')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x37')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x38')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x39')));_0x373685=_[_0x127d('0x2')](_0x373685,require('../api/squareRecording/squareRecording.rpc'));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3a')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3b')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3c')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3d')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3e')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x3f')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x40')));_0x373685=_['merge'](_0x373685,require(_0x127d('0x41')));_0x373685=_[_0x127d('0x2')](_0x373685,require(_0x127d('0x42')));var _0x2635cf=jayson[_0x127d('0x43')](_0x373685)[_0x127d('0x44')]();var _0x224f40=config[_0x127d('0x45')][_0x127d('0x46')]||config[_0x127d('0x46')]+0x1;var _0x4aec3c=config['rpc']['ip']||_0x127d('0x47');_0x2635cf['on'](_0x127d('0x48'),function(_0x26ad0d){return _0x129c8c(_0x26ad0d);});_0x2635cf[_0x127d('0x1')](_0x224f40,_0x4aec3c,function(){console[_0x127d('0x49')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4aec3c,_0x224f40);require(_0x127d('0x4a'))[_0x127d('0x4b')]();return _0x39dcce(_0x127d('0x4c')+_0x4aec3c+':'+_0x224f40);});});}; \ No newline at end of file +var _0x3939=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.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/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc'];(function(_0x4001f5,_0x566d30){var _0x1da8ad=function(_0xce3179){while(--_0xce3179){_0x4001f5['push'](_0x4001f5['shift']());}};_0x1da8ad(++_0x566d30);}(_0x3939,0xe8));var _0x9393=function(_0x48cb2,_0x376297){_0x48cb2=_0x48cb2-0x0;var _0x5e5051=_0x3939[_0x48cb2];return _0x5e5051;};'use strict';var jayson=require(_0x9393('0x0'));var _=require(_0x9393('0x1'));var config=require(_0x9393('0x2'));exports[_0x9393('0x3')]=function(){return new Promise(function(_0x1ceca6,_0x5e4dbf){var _0x4688e6={};_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x5')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x6')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x7')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x8')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x9')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0xa')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0xb')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0xc')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0xd')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0xe')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0xf')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x10')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x11')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x12')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/mailMessage/mailMessage.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x13')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x14')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x15')));_0x4688e6=_['merge'](_0x4688e6,require('../api/faxInteraction/faxInteraction.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x16')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x17')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x18')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/smsInteraction/smsInteraction.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x19')));_0x4688e6=_['merge'](_0x4688e6,require('../api/smsQueue/smsQueue.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x1a')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x1b')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x1c')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x1d')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x1e')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x1f')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x20')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/chatQueue/chatQueue.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/cmContact/cmContact.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/cmHopper/cmHopper.rpc'));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x21')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x22')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x23')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x24')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/interval/interval.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x25')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x26')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x27')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x28')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/trigger/trigger.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/variable/variable.rpc'));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x29')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x2a')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4688e6=_['merge'](_0x4688e6,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x2b')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4688e6=_['merge'](_0x4688e6,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x2c')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x2d')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x2e')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x2f')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x30')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x31')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x32')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x33')));_0x4688e6=_['merge'](_0x4688e6,require('../api/squareRecording/squareRecording.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x34')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x35')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/attachment/attachment.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x36')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x37')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x38')));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x4688e6=_[_0x9393('0x4')](_0x4688e6,require(_0x9393('0x39')));_0x4688e6=_['merge'](_0x4688e6,require(_0x9393('0x3a')));var _0x32b1c3=jayson[_0x9393('0x3b')](_0x4688e6)['http']();var _0x123e6b=config[_0x9393('0x3c')][_0x9393('0x3d')]||config[_0x9393('0x3d')]+0x1;var _0x1f050a=config[_0x9393('0x3c')]['ip']||'localhost';_0x32b1c3['on']('error',function(_0x5cf010){return _0x5e4dbf(_0x5cf010);});_0x32b1c3['listen'](_0x123e6b,_0x1f050a,function(){console[_0x9393('0x3e')](_0x9393('0x3f'),_0x1f050a,_0x123e6b);require(_0x9393('0x40'))[_0x9393('0x41')]();return _0x1ceca6(_0x9393('0x42')+_0x1f050a+':'+_0x123e6b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index aee8390..621d671 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 _0x3b74=['code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','function','write','destroy','inherits','sendRequest','command','sync','prototype','answer','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','recordFile','wav','BEEP','streamFile','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','ready','line','toLowerCase','emit','hangup','search','520\x20End\x20of\x20proper','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error'];(function(_0x251ca2,_0x4ea0a5){var _0x18cd4b=function(_0x418395){while(--_0x418395){_0x251ca2['push'](_0x251ca2['shift']());}};_0x18cd4b(++_0x4ea0a5);}(_0x3b74,0x80));var _0x43b7=function(_0x1298c6,_0x31ab9a){_0x1298c6=_0x1298c6-0x0;var _0xffe910=_0x3b74[_0x1298c6];return _0xffe910;};'use strict';var util=require(_0x43b7('0x0'));var _=require(_0x43b7('0x1'));var EventEmitter=require(_0x43b7('0x2'))[_0x43b7('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x43b7('0x4'));function AGIChannel(_0x16a8cc){var _0x432549=this,_0x3891a0=new AGIReply(),_0x4ca8d6=![],_0x2a27d9={};EventEmitter[_0x43b7('0x5')](_0x432549);_0x16a8cc[_0x43b7('0x6')](_0x43b7('0x7'));_0x16a8cc[_0x43b7('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3891a0[_0x43b7('0x6')]('utf8');_0x3891a0['on']('headers',function(_0x1d88bc){for(var _0xb07b65 in _0x1d88bc){_0x432549[_0xb07b65]=_0x1d88bc[_0xb07b65];}_0x432549['emit'](_0x43b7('0x9'));});_0x3891a0['on'](_0x43b7('0xa'),function(_0x55ce4a){if(_0x55ce4a[_0x43b7('0xb')]()=='hangup'){_0x432549[_0x43b7('0xc')](_0x43b7('0xd'));return;}if(_0x55ce4a['substring'](0x0,0xb)=='520-Invalid'){_0x4ca8d6=!![];}if(_0x4ca8d6){_0x2a27d9['rx']+=_0x55ce4a+'\x0a';if(_0x55ce4a[_0x43b7('0xe')](_0x43b7('0xf'))!=-0x1){_0x4ca8d6=![];}}else{_0x2a27d9['rx']=_0x55ce4a;}if(_0x4ca8d6){return;}if(typeof _0x2a27d9['cb']=='function'){var _0x255666=_0x2a27d9['rx'][_0x43b7('0x10')](0x0,0x3),_0x47ae2d=null,_0x360083=null;_0x255666=parseInt(_0x255666);if(isNaN(_0x255666)){_0x2a27d9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x43b7('0x11')});return;}if(_0x255666!=0xc8){_0x2a27d9['cb'](null,{'code':_0x255666,'result':-0x1,'extra':'KO'});return;}_0x47ae2d=_0x2a27d9['rx']['substring'](0x4)[_0x43b7('0x12')](_0x43b7('0x13'),'');if(_0x47ae2d[_0x43b7('0x14')]('\x20')!=-0x1){_0x47ae2d=_0x47ae2d[_0x43b7('0x15')](0x0,_0x47ae2d[_0x43b7('0x14')]('\x20'));}if(_[_0x43b7('0x16')](_0x47ae2d,'-1')){_0x47ae2d=parseInt(_0x47ae2d);}_0x360083=_0x2a27d9['rx'][_0x43b7('0x17')]('\x20');if(_0x360083[_0x43b7('0x18')]==0x3){_0x360083=_0x360083[0x2]['substring'](0x1,_0x360083[0x2][_0x43b7('0x18')]-0x1);}else if(_0x360083['length']>0x3){var _0x1c7b95=/\((.+)\)/;var _0xecf488=_0x2a27d9['rx']['match'](_0x1c7b95);if(_0xecf488){_0x360083=_0xecf488[0x1];}else{_0x360083=null;}}else{_0x360083=null;}_0x2a27d9['cb'](null,{'code':_0x255666,'result':_0x47ae2d,'extra':_0x360083});}});_0x16a8cc['on'](_0x43b7('0x19'),function(_0xaaeba5){_0x432549[_0x43b7('0xc')](_0x43b7('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0xaaeba5[_0x43b7('0x1a')]));});_0x16a8cc['on'](_0x43b7('0x1b'),function(){_0x432549[_0x43b7('0xc')](_0x43b7('0x1b'),new AGIError(_0x43b7('0x1c')));});_0x16a8cc['on'](_0x43b7('0x1d'),function(){_0x432549[_0x43b7('0xc')](_0x43b7('0x1d'),new AGIError(_0x43b7('0x1e')));_0x16a8cc['destroy']();});_0x16a8cc[_0x43b7('0x1f')](_0x3891a0);this['command']=function(_0x1a4832,_0x732e2c){var _0x1a4832=_0x1a4832||'',_0x732e2c=typeof _0x732e2c==_0x43b7('0x20')?_0x732e2c:new Function();_0x2a27d9={'tx':_0x1a4832,'rx':'','cb':_0x732e2c};_0x16a8cc[_0x43b7('0x21')](_0x1a4832+'\x0a');},this['close']=function(){_0x16a8cc[_0x43b7('0x22')]();};}util[_0x43b7('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x43b7('0x24')]=function(_0x4fcce3){return this[_0x43b7('0x25')][_0x43b7('0x26')](this,_0x4fcce3);};AGIChannel[_0x43b7('0x27')][_0x43b7('0x28')]=function(){return this[_0x43b7('0x24')](_0x43b7('0x29'));};AGIChannel['prototype'][_0x43b7('0x2a')]=function(_0x3be8a9,_0x4a0fd8,_0x16ff13){_0x3be8a9=_0x3be8a9===undefined?_0x43b7('0x2b'):_0x3be8a9;_0x4a0fd8=_0x4a0fd8===undefined?'5':_0x4a0fd8;_0x16ff13=_0x16ff13===undefined?'1':_0x16ff13;return this[_0x43b7('0x24')](util[_0x43b7('0x2c')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3be8a9,_0x4a0fd8*0x3e8,_0x16ff13));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x2d')]=function(_0x580f77){_0x580f77=_0x580f77||_0x43b7('0x2e');return this[_0x43b7('0x24')](util['format'](_0x43b7('0x2f'),_0x580f77));};AGIChannel['prototype'][_0x43b7('0x30')]=function(_0x1379bb,_0x3047ca){if(_[_0x43b7('0x31')](_0x3047ca)){return this[_0x43b7('0x24')](util[_0x43b7('0x2c')](_0x43b7('0x32'),_0x1379bb,_0x3047ca[_0x43b7('0x33')](',')));}return this['sendRequest'](util[_0x43b7('0x2c')](_0x43b7('0x32'),_0x1379bb,_0x3047ca));};AGIChannel['prototype'][_0x43b7('0x34')]=function(_0x41d54a){return this[_0x43b7('0x24')](util[_0x43b7('0x2c')](_0x43b7('0x35'),_0x41d54a));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x36')]=function(_0x3188f3){return this['sendRequest'](util[_0x43b7('0x2c')](_0x43b7('0x37'),_0x3188f3));};AGIChannel[_0x43b7('0x27')]['setPriority']=function(_0x5f4412){return this[_0x43b7('0x24')](util[_0x43b7('0x2c')]('SET\x20PRIORITY\x20%s',_0x5f4412));};AGIChannel[_0x43b7('0x27')][_0x43b7('0xd')]=function(){return this[_0x43b7('0x24')](_0x43b7('0x38'));};AGIChannel[_0x43b7('0x27')]['setVariable']=function(_0x1f844c,_0x289fcf){var _0x43801f=_['isBoolean'](_0x289fcf)||_[_0x43b7('0x39')](_0x289fcf)?_0x289fcf[_0x43b7('0x3a')]():_0x289fcf;return this[_0x43b7('0x24')](util[_0x43b7('0x2c')](_0x43b7('0x3b'),_0x1f844c,_0x43801f?_0x43801f[_0x43b7('0x3a')]()[_0x43b7('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x3c')]=function(_0x2eb3a1,_0x1b87ad){return this['sendRequest'](util['format'](_0x43b7('0x3d'),_0x2eb3a1,_0x1b87ad));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x3e')]=function(_0x3e7f78,_0x1c7d79){return this['sendRequest'](util[_0x43b7('0x2c')](_0x43b7('0x3f'),_0x3e7f78,_0x1c7d79));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x40')]=function(_0x337cbc,_0x35ecb9){return this[_0x43b7('0x24')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x337cbc,_0x35ecb9));};AGIChannel['prototype'][_0x43b7('0x41')]=function(_0x543112,_0x5226e3,_0x23c3b7){_0x5226e3=_0x5226e3||this[_0x43b7('0x42')];_0x23c3b7=_0x23c3b7||0x1;this[_0x43b7('0x34')](_0x543112);this[_0x43b7('0x36')](_0x5226e3);this['setPriority'](_0x23c3b7);return this['noop'](util[_0x43b7('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x543112,_0x5226e3,_0x23c3b7));};AGIChannel[_0x43b7('0x27')]['getVariable']=function(_0x272656){return this[_0x43b7('0x24')](util[_0x43b7('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x272656));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x43')]=function(_0x486776,_0x2bdd40,_0x5b7744,_0x14fb26,_0xd98c62,_0x47b580){_0x2bdd40=_0x2bdd40||_0x43b7('0x44');_0x5b7744=_0x5b7744||'';_0x14fb26=_0x14fb26===undefined?-0x1:_0x14fb26==='-1'?-0x1:_0x14fb26*0x3e8;_0xd98c62=_0xd98c62===undefined?'':'s='+_0xd98c62;_0x47b580=_0x47b580?_0x43b7('0x45'):'';return this[_0x43b7('0x24')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x486776,_0x2bdd40,_0x5b7744,_0x14fb26,_0x47b580,_0xd98c62));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x46')]=function(_0x9afa4,_0x5e9809){_0x5e9809=_0x5e9809||'';return this[_0x43b7('0x24')](util[_0x43b7('0x2c')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x9afa4,_0x5e9809));};AGIChannel[_0x43b7('0x27')][_0x43b7('0x47')]=function(_0xfdee3){return this[_0x43b7('0x30')]('AGI',_0xfdee3);};AGIChannel[_0x43b7('0x27')][_0x43b7('0x48')]=function(_0x131ec9){return this[_0x43b7('0x30')](_0x43b7('0x49'),_0x131ec9);};AGIChannel[_0x43b7('0x27')][_0x43b7('0x19')]=function(_0x5e4569,_0x5f0b23){this['noop'](util['format'](_0x43b7('0x4a'),_0x5e4569['id'],_0x5e4569[_0x43b7('0x4b')],_0x5f0b23));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x43b7('0x4c')]=AGIChannel; \ No newline at end of file +var _0x3914=['GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','label','util','lodash','EventEmitter','./reply','call','utf8','setEncoding','headers','ready','line','hangup','emit','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','sendRequest','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0x3914,0xeb));var _0x4391=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x3914[_0x8c1005];return _0x175354;};'use strict';var util=require(_0x4391('0x0'));var _=require(_0x4391('0x1'));var EventEmitter=require('events')[_0x4391('0x2')];var AGIReply=require(_0x4391('0x3'));var AGIError=require('./error');function AGIChannel(_0x1e8010){var _0x343fb7=this,_0x175dbc=new AGIReply(),_0x5b5acb=![],_0x1eecd4={};EventEmitter[_0x4391('0x4')](_0x343fb7);_0x1e8010['setEncoding'](_0x4391('0x5'));_0x1e8010['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x175dbc[_0x4391('0x6')]('utf8');_0x175dbc['on'](_0x4391('0x7'),function(_0x17bcfb){for(var _0x57c763 in _0x17bcfb){_0x343fb7[_0x57c763]=_0x17bcfb[_0x57c763];}_0x343fb7['emit'](_0x4391('0x8'));});_0x175dbc['on'](_0x4391('0x9'),function(_0x3539e3){if(_0x3539e3['toLowerCase']()==_0x4391('0xa')){_0x343fb7[_0x4391('0xb')](_0x4391('0xa'));return;}if(_0x3539e3[_0x4391('0xc')](0x0,0xb)=='520-Invalid'){_0x5b5acb=!![];}if(_0x5b5acb){_0x1eecd4['rx']+=_0x3539e3+'\x0a';if(_0x3539e3[_0x4391('0xd')](_0x4391('0xe'))!=-0x1){_0x5b5acb=![];}}else{_0x1eecd4['rx']=_0x3539e3;}if(_0x5b5acb){return;}if(typeof _0x1eecd4['cb']==_0x4391('0xf')){var _0x137902=_0x1eecd4['rx'][_0x4391('0xc')](0x0,0x3),_0x254ffb=null,_0xdebb72=null;_0x137902=parseInt(_0x137902);if(isNaN(_0x137902)){_0x1eecd4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4391('0x10')});return;}if(_0x137902!=0xc8){_0x1eecd4['cb'](null,{'code':_0x137902,'result':-0x1,'extra':'KO'});return;}_0x254ffb=_0x1eecd4['rx']['substring'](0x4)[_0x4391('0x11')](_0x4391('0x12'),'');if(_0x254ffb[_0x4391('0x13')]('\x20')!=-0x1){_0x254ffb=_0x254ffb[_0x4391('0x14')](0x0,_0x254ffb['indexOf']('\x20'));}if(_[_0x4391('0x15')](_0x254ffb,'-1')){_0x254ffb=parseInt(_0x254ffb);}_0xdebb72=_0x1eecd4['rx']['split']('\x20');if(_0xdebb72[_0x4391('0x16')]==0x3){_0xdebb72=_0xdebb72[0x2][_0x4391('0xc')](0x1,_0xdebb72[0x2][_0x4391('0x16')]-0x1);}else if(_0xdebb72[_0x4391('0x16')]>0x3){var _0x2a79a4=/\((.+)\)/;var _0x15e884=_0x1eecd4['rx'][_0x4391('0x17')](_0x2a79a4);if(_0x15e884){_0xdebb72=_0x15e884[0x1];}else{_0xdebb72=null;}}else{_0xdebb72=null;}_0x1eecd4['cb'](null,{'code':_0x137902,'result':_0x254ffb,'extra':_0xdebb72});}});_0x1e8010['on'](_0x4391('0x18'),function(_0x58a311){_0x343fb7['emit'](_0x4391('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x58a311[_0x4391('0x19')]));});_0x1e8010['on'](_0x4391('0x1a'),function(){_0x343fb7[_0x4391('0xb')](_0x4391('0x1a'),new AGIError(_0x4391('0x1b')));});_0x1e8010['on']('timeout',function(){_0x343fb7['emit'](_0x4391('0x1c'),new AGIError(_0x4391('0x1d')));_0x1e8010[_0x4391('0x1e')]();});_0x1e8010['pipe'](_0x175dbc);this[_0x4391('0x1f')]=function(_0x23fe8c,_0x737d10){var _0x23fe8c=_0x23fe8c||'',_0x737d10=typeof _0x737d10==_0x4391('0xf')?_0x737d10:new Function();_0x1eecd4={'tx':_0x23fe8c,'rx':'','cb':_0x737d10};_0x1e8010[_0x4391('0x20')](_0x23fe8c+'\x0a');},this[_0x4391('0x1a')]=function(){_0x1e8010[_0x4391('0x1e')]();};}util[_0x4391('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x4391('0x22')]['sendRequest']=function(_0x474666){return this[_0x4391('0x1f')][_0x4391('0x23')](this,_0x474666);};AGIChannel[_0x4391('0x22')]['answer']=function(){return this['sendRequest'](_0x4391('0x24'));};AGIChannel[_0x4391('0x22')][_0x4391('0x25')]=function(_0x197408,_0x3785a8,_0x53363c){_0x197408=_0x197408===undefined?'beep':_0x197408;_0x3785a8=_0x3785a8===undefined?'5':_0x3785a8;_0x53363c=_0x53363c===undefined?'1':_0x53363c;return this['sendRequest'](util['format'](_0x4391('0x26'),_0x197408,_0x3785a8*0x3e8,_0x53363c));};AGIChannel[_0x4391('0x22')][_0x4391('0x27')]=function(_0x2f7b18){_0x2f7b18=_0x2f7b18||'NO\x20MESSAGE';return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x2a'),_0x2f7b18));};AGIChannel[_0x4391('0x22')][_0x4391('0x2b')]=function(_0x47b39a,_0x1a8df0){if(_[_0x4391('0x2c')](_0x1a8df0)){return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x2d'),_0x47b39a,_0x1a8df0[_0x4391('0x2e')](',')));}return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x2d'),_0x47b39a,_0x1a8df0));};AGIChannel[_0x4391('0x22')][_0x4391('0x2f')]=function(_0x4dad76){return this[_0x4391('0x28')](util['format'](_0x4391('0x30'),_0x4dad76));};AGIChannel['prototype']['setExtension']=function(_0x174788){return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x31'),_0x174788));};AGIChannel[_0x4391('0x22')][_0x4391('0x32')]=function(_0x205b8e){return this['sendRequest'](util[_0x4391('0x29')]('SET\x20PRIORITY\x20%s',_0x205b8e));};AGIChannel[_0x4391('0x22')]['hangup']=function(){return this[_0x4391('0x28')](_0x4391('0x33'));};AGIChannel[_0x4391('0x22')][_0x4391('0x34')]=function(_0x321aed,_0x4696c8){var _0x44f1e2=_[_0x4391('0x35')](_0x4696c8)||_[_0x4391('0x36')](_0x4696c8)?_0x4696c8[_0x4391('0x37')]():_0x4696c8;return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x38'),_0x321aed,_0x44f1e2?_0x44f1e2[_0x4391('0x37')]()[_0x4391('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4391('0x22')][_0x4391('0x39')]=function(_0x3cac53,_0x4c2828){return this['sendRequest'](util[_0x4391('0x29')](_0x4391('0x3a'),_0x3cac53,_0x4c2828));};AGIChannel[_0x4391('0x22')][_0x4391('0x3b')]=function(_0x127d6c,_0x1c716c){return this[_0x4391('0x28')](util[_0x4391('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x127d6c,_0x1c716c));};AGIChannel[_0x4391('0x22')]['sayPhonetic']=function(_0x5ec1cf,_0x5097cc){return this['sendRequest'](util[_0x4391('0x29')](_0x4391('0x3c'),_0x5ec1cf,_0x5097cc));};AGIChannel[_0x4391('0x22')][_0x4391('0x3d')]=function(_0x5edfbd,_0x50f983,_0x1b640d){_0x50f983=_0x50f983||this['extension'];_0x1b640d=_0x1b640d||0x1;this[_0x4391('0x2f')](_0x5edfbd);this[_0x4391('0x3e')](_0x50f983);this[_0x4391('0x32')](_0x1b640d);return this[_0x4391('0x27')](util[_0x4391('0x29')](_0x4391('0x3f'),_0x5edfbd,_0x50f983,_0x1b640d));};AGIChannel['prototype'][_0x4391('0x40')]=function(_0x3da701){return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x41'),_0x3da701));};AGIChannel[_0x4391('0x22')][_0x4391('0x42')]=function(_0x5dcdd5,_0x191560,_0x1ba3e3,_0x2991ac,_0x254593,_0x3c9e54){_0x191560=_0x191560||_0x4391('0x43');_0x1ba3e3=_0x1ba3e3||'';_0x2991ac=_0x2991ac===undefined?-0x1:_0x2991ac==='-1'?-0x1:_0x2991ac*0x3e8;_0x254593=_0x254593===undefined?'':'s='+_0x254593;_0x3c9e54=_0x3c9e54?_0x4391('0x44'):'';return this['sendRequest'](util[_0x4391('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x5dcdd5,_0x191560,_0x1ba3e3,_0x2991ac,_0x3c9e54,_0x254593));};AGIChannel[_0x4391('0x22')][_0x4391('0x45')]=function(_0x36beed,_0x55653e){_0x55653e=_0x55653e||'';return this[_0x4391('0x28')](util[_0x4391('0x29')](_0x4391('0x46'),_0x36beed,_0x55653e));};AGIChannel[_0x4391('0x22')][_0x4391('0x47')]=function(_0x20859b){return this[_0x4391('0x2b')](_0x4391('0x48'),_0x20859b);};AGIChannel[_0x4391('0x22')]['wait']=function(_0x5901cf){return this[_0x4391('0x2b')](_0x4391('0x49'),_0x5901cf);};AGIChannel[_0x4391('0x22')][_0x4391('0x18')]=function(_0x29fdab,_0x25c7f6){this['noop'](util[_0x4391('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x29fdab['id'],_0x29fdab[_0x4391('0x4a')],_0x25c7f6));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5abd70a..5400fc4 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 _0x96e5=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','Undefined\x20error.'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0x96e5,0xff));var _0x596e=function(_0x10416f,_0x261152){_0x10416f=_0x10416f-0x0;var _0x3f0908=_0x96e5[_0x10416f];return _0x3f0908;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x596e('0x0'),'E_AGI_ARGUMENT_PORT':_0x596e('0x1'),'E_AGI_SERVER_ERROR':_0x596e('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x596e('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x596e('0x4'),'E_AGI_SOCKET_ERROR':_0x596e('0x5'),'E_AGI_SOCKET_CLOSE':_0x596e('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x596e('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x596e('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2e0841){var _0x2e0841=_0x2e0841||null,_0xfd11b3=_0xfd11b3||[],_0x4443fb=0x1,_0x93340a='';if(!error[_0x2e0841]){_0x2e0841=_0x596e('0x9');}_0xfd11b3[_0x596e('0xa')](error[_0x2e0841]);while(arguments[_0x4443fb]){_0xfd11b3[_0x596e('0xa')](arguments[_0x4443fb]);_0x4443fb++;}_0x93340a=util[_0x596e('0xb')][_0x596e('0xc')](util,_0xfd11b3);this[_0x596e('0xd')]=_0x93340a;this[_0x596e('0xe')]=_0x2e0841;}module[_0x596e('0xf')]=AGIError; \ No newline at end of file +var _0x6a80=['message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','push','format','apply'];(function(_0x34432f,_0x92cc08){var _0x4452c2=function(_0x10ebe4){while(--_0x10ebe4){_0x34432f['push'](_0x34432f['shift']());}};_0x4452c2(++_0x92cc08);}(_0x6a80,0xe4));var _0x06a8=function(_0x4b74ed,_0x3bd12f){_0x4b74ed=_0x4b74ed-0x0;var _0x3d91a4=_0x6a80[_0x4b74ed];return _0x3d91a4;};'use strict';var util=require(_0x06a8('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x06a8('0x1'),'E_AGI_SERVER_ERROR':_0x06a8('0x2'),'E_AGI_SERVER_CLOSE':_0x06a8('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x06a8('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x06a8('0x5'),'E_AGI_SOCKET_CLOSE':_0x06a8('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x06a8('0x7'),'E_AGI_COMMAND_EMPTY':_0x06a8('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x203881){var _0x203881=_0x203881||null,_0x283fd7=_0x283fd7||[],_0x3dd837=0x1,_0x58c742='';if(!error[_0x203881]){_0x203881='E_AGI_UNDEFINED';}_0x283fd7[_0x06a8('0x9')](error[_0x203881]);while(arguments[_0x3dd837]){_0x283fd7['push'](arguments[_0x3dd837]);_0x3dd837++;}_0x58c742=util[_0x06a8('0xa')][_0x06a8('0xb')](util,_0x283fd7);this[_0x06a8('0xc')]=_0x58c742;this[_0x06a8('0xd')]=_0x203881;}module[_0x06a8('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index adbec90..beb31f5 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab1e=['E_AGI_SERVER_ERROR','parse','projectUpdate','emit','error','exports','lodash','EventEmitter','./error','../../config/environment','subscribe','agi'];(function(_0x2d014f,_0x2a83ed){var _0x463de7=function(_0x1a142e){while(--_0x1a142e){_0x2d014f['push'](_0x2d014f['shift']());}};_0x463de7(++_0x2a83ed);}(_0xab1e,0x1e6));var _0xeab1=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xab1e[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xeab1('0x0'));var EventEmitter=require('events')[_0xeab1('0x1')];var Redis=require('ioredis');var AGIError=require(_0xeab1('0x2'));var config=require(_0xeab1('0x3'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xeab1('0x4')](_0xeab1('0x5'),function(_0x171dde){if(_0x171dde)return eventEmitter['emit']('error',new AGIError(_0xeab1('0x6'),_0x171dde));});sub['on']('message',function(_0x55005f,_0x17ddaa){if(_0x55005f!==_0xeab1('0x5'))return;try{var _0x141e91=JSON[_0xeab1('0x7')](_0x17ddaa);eventEmitter['emit'](_0xeab1('0x8'),_0x141e91);}catch(_0x454c04){eventEmitter[_0xeab1('0x9')](_0xeab1('0xa'),new AGIError(_0xeab1('0x6'),_0x454c04));}});module[_0xeab1('0xb')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xd004=['subscribe','agi','error','message','parse','emit','projectUpdate','E_AGI_SERVER_ERROR','lodash','events','ioredis','./error','../../config/environment','redis','localhost'];(function(_0x746c12,_0x5f3bd4){var _0x52c88c=function(_0x431cb5){while(--_0x431cb5){_0x746c12['push'](_0x746c12['shift']());}};_0x52c88c(++_0x5f3bd4);}(_0xd004,0x152));var _0x4d00=function(_0x46c59b,_0x5635dd){_0x46c59b=_0x46c59b-0x0;var _0x16dd2d=_0xd004[_0x46c59b];return _0x16dd2d;};'use strict';var _=require(_0x4d00('0x0'));var EventEmitter=require(_0x4d00('0x1'))['EventEmitter'];var Redis=require(_0x4d00('0x2'));var AGIError=require(_0x4d00('0x3'));var config=require(_0x4d00('0x4'));config[_0x4d00('0x5')]=_['defaults'](config[_0x4d00('0x5')],{'host':_0x4d00('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x4d00('0x5')]);sub[_0x4d00('0x7')](_0x4d00('0x8'),function(_0x433acb){if(_0x433acb)return eventEmitter['emit'](_0x4d00('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x433acb));});sub['on'](_0x4d00('0xa'),function(_0x43c644,_0x26bbf9){if(_0x43c644!==_0x4d00('0x8'))return;try{var _0x5e66ce=JSON[_0x4d00('0xb')](_0x26bbf9);eventEmitter[_0x4d00('0xc')](_0x4d00('0xd'),_0x5e66ce);}catch(_0x74aff1){eventEmitter['emit'](_0x4d00('0x9'),new AGIError(_0x4d00('0xe'),_0x74aff1));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 543735a..2e54eb0 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 _0xf640=['edges','numberOfEdges','addVertex','addEdge','push','prototype','size','relations','getVertex','traverseBFS','info','stop\x20traverse','condition','split','agicommand','vswitch','target','default','invalid','length','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices'];(function(_0x1492a4,_0x56d5fc){var _0x49724b=function(_0x567900){while(--_0x567900){_0x1492a4['push'](_0x1492a4['shift']());}};_0x49724b(++_0x56d5fc);}(_0xf640,0x16e));var _0x0f64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf640[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0f64('0x0'));var logger=require(_0x0f64('0x1'))(_0x0f64('0x2'));var verticesWithRetry=[_0x0f64('0x3'),'getdigits',_0x0f64('0x4')];var Graph=function(){this[_0x0f64('0x5')]={};this[_0x0f64('0x6')]={};this[_0x0f64('0x7')]=0x0;};Graph['prototype'][_0x0f64('0x8')]=function(_0x5c7b0c){this[_0x0f64('0x5')][_0x5c7b0c['id']]=_0x5c7b0c;this[_0x0f64('0x6')][_0x5c7b0c['id']]=[];};Graph['prototype'][_0x0f64('0x9')]=function(_0xbb7460,_0x3b1630,_0x14058f){this[_0x0f64('0x6')][_0xbb7460][_0x0f64('0xa')]({'target':_0x3b1630,'condition':_0x14058f});this[_0x0f64('0x7')]+=0x1;};Graph[_0x0f64('0xb')]['size']=function(){return _[_0x0f64('0xc')](this['vertices']);};Graph[_0x0f64('0xb')][_0x0f64('0xd')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x0f64('0xe')]=function(_0x259bb5){return this[_0x0f64('0x5')][_0x259bb5];};Graph[_0x0f64('0xb')][_0x0f64('0xf')]=function(_0x9f57ef,_0x4058d5){if(!this[_0x0f64('0x5')][_0x9f57ef]){return logger[_0x0f64('0x10')]('no\x20vertex\x20found');}var _0x48667a=_0x4058d5(this['vertices'][_0x9f57ef]);if(!_0x48667a){return logger['info'](_0x0f64('0x11'));}if(this[_0x0f64('0x6')][_0x9f57ef]['length']===0x0){return logger[_0x0f64('0x10')]('no\x20edge/s\x20available');}for(var _0x440c32=0x0,_0x9dc6de=[],_0x4c23c9=![];_0x440c32\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','callerid','uniqueid','evtHangup','createSquareReport','then','catch','hasOwnProperty','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','production','getLicense'];(function(_0x3affb2,_0x315807){var _0x520e35=function(_0x442674){while(--_0x442674){_0x3affb2['push'](_0x3affb2['shift']());}};_0x520e35(++_0x315807);}(_0xcd37,0x75));var _0x7cd3=function(_0x4a1bb1,_0x184ecd){_0x4a1bb1=_0x4a1bb1-0x0;var _0x5657ec=_0xcd37[_0x4a1bb1];return _0x5657ec;};'use strict';var _=require(_0x7cd3('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0x7cd3('0x1'));var logger=require(_0x7cd3('0x2'))(_0x7cd3('0x3'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0x7cd3('0x4'));var AGIEmitter=require('./events')[_0x7cd3('0x5')];var projects=[];config['agi']=_[_0x7cd3('0x6')](config['agi'],{'ip':_0x7cd3('0x7'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x41619e){process[_0x7cd3('0x8')](function(){syncho(function(){try{setChannelVariables(_0x41619e);agiHandler(_0x41619e);}catch(_0x1fb77a){logger[_0x7cd3('0x9')](_0x1fb77a[_0x7cd3('0xa')]);}});});}function projectUpdateHandler(_0x312287){try{var _0x1bdd5a=_[_0x7cd3('0xb')](projects,['id',_0x312287['id']]);if(_0x1bdd5a>-0x1){if(_0x312287['deleted']===!![]){projects[_0x7cd3('0xc')](_0x1bdd5a,0x1);}else{projects[_0x1bdd5a]=_0x312287;}}else{projects[_0x7cd3('0xd')](_0x312287);}}catch(_0x4733dc){logger[_0x7cd3('0x9')](_0x4733dc[_0x7cd3('0xa')]);}}function listeningHandler(){console[_0x7cd3('0xe')](_0x7cd3('0xf'),config[_0x7cd3('0x3')][_0x7cd3('0x10')]);logger[_0x7cd3('0x11')](util[_0x7cd3('0x12')](_0x7cd3('0x13'),config[_0x7cd3('0x3')]['ip'],config[_0x7cd3('0x3')][_0x7cd3('0x10')]));}function errorHandler(_0x3876d4){if(_0x3876d4&&_0x3876d4[_0x7cd3('0x14')]&&_0x3876d4[_0x7cd3('0x15')]){logger[_0x7cd3('0x9')](util[_0x7cd3('0x12')]('[%s]\x20%s',_0x3876d4[_0x7cd3('0x14')],_0x3876d4[_0x7cd3('0x15')]));}else{logger[_0x7cd3('0x9')](util['format'](_0x7cd3('0x16'),_0x3876d4[_0x7cd3('0xa')]));}}function closeHandler(){logger[_0x7cd3('0x11')](util[_0x7cd3('0x12')](_0x7cd3('0x17'),this[_0x7cd3('0x18')],this[_0x7cd3('0x19')],this['callerid'],this[_0x7cd3('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x23bda1){logger['error'](_0x23bda1[_0x7cd3('0xa')]);}}function timeoutHandler(){logger[_0x7cd3('0x11')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7cd3('0x18')],this[_0x7cd3('0x19')],this[_0x7cd3('0x1b')],this[_0x7cd3('0x1a')],this[_0x7cd3('0x1c')]));}function hangupHandler(){logger['info'](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7cd3('0x18')],this[_0x7cd3('0x19')],this[_0x7cd3('0x1b')],this[_0x7cd3('0x1a')],this['uniqueid']));this[_0x7cd3('0x1d')]=!![];}function createSquareReport(_0x1c554f,_0x204cf2){rpc[_0x7cd3('0x1e')](_0x1c554f)[_0x7cd3('0x1f')](function(_0x5c50a5){if(_0x204cf2){_0x204cf2(null,_0x5c50a5);}})[_0x7cd3('0x20')](function(_0xcc4995){if(_0x204cf2){_0x204cf2(null,_0xcc4995);}});}function setChannelVariables(_0x45eed0){for(var _0x942502 in _0x45eed0){if(_0x45eed0[_0x7cd3('0x21')](_0x942502)){if(_0x942502['indexOf']('agi_')===0x0){_0x45eed0[_0x942502['substring'](0x4)]=_0x45eed0[_0x942502];delete _0x45eed0[_0x942502];}}}}function agiHandler(_0x27f621){logger[_0x7cd3('0x22')](_0x7cd3('0x23'),JSON[_0x7cd3('0x24')](_0x27f621,null,0x2));logger[_0x7cd3('0x11')](util[_0x7cd3('0x12')](_0x7cd3('0x25'),_0x27f621['arg_1'],_0x27f621[_0x7cd3('0x19')],_0x27f621['callerid'],_0x27f621[_0x7cd3('0x1a')],_0x27f621[_0x7cd3('0x1c')]));_0x27f621['on']('error',errorHandler);_0x27f621['on'](_0x7cd3('0x26'),closeHandler);_0x27f621['on'](_0x7cd3('0x27'),timeoutHandler);_0x27f621[_0x7cd3('0x1d')]=![];_0x27f621['on'](_0x7cd3('0x28'),hangupHandler);var _0x5d0ca2=_[_0x7cd3('0x29')](projects,[_0x7cd3('0x14'),_0x27f621['arg_1']]);if(!_0x5d0ca2)return Project[_0x7cd3('0x2a')](_0x27f621);if(!_0x5d0ca2[_0x7cd3('0x2b')])return Project['handleUnpublished'](_0x27f621);return Project['initialize'](_0x5d0ca2,_0x27f621);}function main(){var _0x7320f1;return utilLicense[_0x7cd3('0x2c')]()[_0x7cd3('0x1f')](function(_0x41ea71){if(!_0x41ea71)return;if(_0x41ea71[_0x7cd3('0x2d')]){if(_0x41ea71['callysquare']&&_0x41ea71[_0x7cd3('0x2e')]>0x0){logger[_0x7cd3('0x11')](util[_0x7cd3('0x12')]('[LICENSE]\x20CHANNELS:\x20%s',_0x41ea71['callysquare']));_0x7320f1=_0x41ea71[_0x7cd3('0x2e')];}else{logger['info'](_0x7cd3('0x2f'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x7320f1=-0x1;}})[_0x7cd3('0x1f')](function(){return Project[_0x7cd3('0x30')]();})[_0x7cd3('0x1f')](function(_0x5771ad){projects=_0x5771ad;return;})['catch'](function(_0x323c76){logger[_0x7cd3('0x9')](_0x7cd3('0x31'),_0x323c76[_0x7cd3('0xa')]);})[_0x7cd3('0x32')](function(){var _0xa24779=require(_0x7cd3('0x33'))(config[_0x7cd3('0x3')]['port'],config['agi']['ip'],_0x7320f1);_0xa24779['on']('error',errorHandler);_0xa24779['on'](_0x7cd3('0x34'),listeningHandler);_0xa24779['on'](_0x7cd3('0x35'),connectionHandler);_0xa24779['on'](_0x7cd3('0x26'),closeHandler);});}main(); \ No newline at end of file +var _0x6a9c=['catch','hasOwnProperty','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','timeout','handleNotFound','production','handleUnpublished','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','finally','listening','lodash','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','findIndex','deleted','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then'];(function(_0xd28419,_0x513f08){var _0x5216a1=function(_0x171014){while(--_0x171014){_0xd28419['push'](_0xd28419['shift']());}};_0x5216a1(++_0x513f08);}(_0x6a9c,0x8d));var _0xc6a9=function(_0x1cbeec,_0x833cff){_0x1cbeec=_0x1cbeec-0x0;var _0x26313a=_0x6a9c[_0x1cbeec];return _0x26313a;};'use strict';var _=require(_0xc6a9('0x0'));var syncho=require(_0xc6a9('0x1'));var util=require(_0xc6a9('0x2'));var config=require(_0xc6a9('0x3'));var logger=require('../../config/logger')(_0xc6a9('0x4'));var utilLicense=require(_0xc6a9('0x5'));var rpc=require(_0xc6a9('0x6'));var Project=require(_0xc6a9('0x7'));var AGIEmitter=require(_0xc6a9('0x8'))[_0xc6a9('0x9')];var projects=[];config[_0xc6a9('0x4')]=_[_0xc6a9('0xa')](config[_0xc6a9('0x4')],{'ip':_0xc6a9('0xb'),'port':0x11dd});AGIEmitter['on'](_0xc6a9('0xc'),projectUpdateHandler);function connectionHandler(_0x9cf41b){process[_0xc6a9('0xd')](function(){syncho(function(){try{setChannelVariables(_0x9cf41b);agiHandler(_0x9cf41b);}catch(_0x4cda7a){logger[_0xc6a9('0xe')](_0x4cda7a['stack']);}});});}function projectUpdateHandler(_0x1ad077){try{var _0x2979da=_[_0xc6a9('0xf')](projects,['id',_0x1ad077['id']]);if(_0x2979da>-0x1){if(_0x1ad077[_0xc6a9('0x10')]===!![]){projects['splice'](_0x2979da,0x1);}else{projects[_0x2979da]=_0x1ad077;}}else{projects[_0xc6a9('0x11')](_0x1ad077);}}catch(_0x4eefdc){logger[_0xc6a9('0xe')](_0x4eefdc[_0xc6a9('0x12')]);}}function listeningHandler(){console[_0xc6a9('0x13')](_0xc6a9('0x14'),config[_0xc6a9('0x4')][_0xc6a9('0x15')]);logger[_0xc6a9('0x16')](util[_0xc6a9('0x17')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xc6a9('0x4')]['ip'],config[_0xc6a9('0x4')][_0xc6a9('0x15')]));}function errorHandler(_0x2f9005){if(_0x2f9005&&_0x2f9005[_0xc6a9('0x18')]&&_0x2f9005[_0xc6a9('0x19')]){logger[_0xc6a9('0xe')](util['format'](_0xc6a9('0x1a'),_0x2f9005['name'],_0x2f9005[_0xc6a9('0x19')]));}else{logger[_0xc6a9('0xe')](util[_0xc6a9('0x17')](_0xc6a9('0x1b'),_0x2f9005[_0xc6a9('0x12')]));}}function closeHandler(){logger[_0xc6a9('0x16')](util[_0xc6a9('0x17')](_0xc6a9('0x1c'),this['arg_1'],this['calleridname'],this[_0xc6a9('0x1d')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x315a0b){logger[_0xc6a9('0xe')](_0x315a0b[_0xc6a9('0x12')]);}}function timeoutHandler(){logger[_0xc6a9('0x16')](util[_0xc6a9('0x17')](_0xc6a9('0x1e'),this[_0xc6a9('0x1f')],this[_0xc6a9('0x20')],this[_0xc6a9('0x1d')],this[_0xc6a9('0x21')],this[_0xc6a9('0x22')]));}function hangupHandler(){logger[_0xc6a9('0x16')](util[_0xc6a9('0x17')](_0xc6a9('0x23'),this[_0xc6a9('0x1f')],this[_0xc6a9('0x20')],this['callerid'],this[_0xc6a9('0x21')],this[_0xc6a9('0x22')]));this[_0xc6a9('0x24')]=!![];}function createSquareReport(_0x581a95,_0x2b3aca){rpc[_0xc6a9('0x25')](_0x581a95)[_0xc6a9('0x26')](function(_0x15ea08){if(_0x2b3aca){_0x2b3aca(null,_0x15ea08);}})[_0xc6a9('0x27')](function(_0x2c15e1){if(_0x2b3aca){_0x2b3aca(null,_0x2c15e1);}});}function setChannelVariables(_0x3bc1ff){for(var _0x1fca4a in _0x3bc1ff){if(_0x3bc1ff[_0xc6a9('0x28')](_0x1fca4a)){if(_0x1fca4a[_0xc6a9('0x29')](_0xc6a9('0x2a'))===0x0){_0x3bc1ff[_0x1fca4a['substring'](0x4)]=_0x3bc1ff[_0x1fca4a];delete _0x3bc1ff[_0x1fca4a];}}}}function agiHandler(_0x6cb480){logger[_0xc6a9('0x2b')](_0xc6a9('0x2c'),JSON[_0xc6a9('0x2d')](_0x6cb480,null,0x2));logger['info'](util[_0xc6a9('0x17')](_0xc6a9('0x2e'),_0x6cb480[_0xc6a9('0x1f')],_0x6cb480[_0xc6a9('0x20')],_0x6cb480[_0xc6a9('0x1d')],_0x6cb480[_0xc6a9('0x21')],_0x6cb480['uniqueid']));_0x6cb480['on'](_0xc6a9('0xe'),errorHandler);_0x6cb480['on'](_0xc6a9('0x2f'),closeHandler);_0x6cb480['on'](_0xc6a9('0x30'),timeoutHandler);_0x6cb480[_0xc6a9('0x24')]=![];_0x6cb480['on']('hangup',hangupHandler);var _0x59be0c=_['find'](projects,['name',_0x6cb480[_0xc6a9('0x1f')]]);if(!_0x59be0c)return Project[_0xc6a9('0x31')](_0x6cb480);if(!_0x59be0c[_0xc6a9('0x32')])return Project[_0xc6a9('0x33')](_0x6cb480);return Project['initialize'](_0x59be0c,_0x6cb480);}function main(){var _0x3b2f2b;return utilLicense[_0xc6a9('0x34')]()[_0xc6a9('0x26')](function(_0x521891){if(!_0x521891)return;if(_0x521891[_0xc6a9('0x35')]){if(_0x521891[_0xc6a9('0x36')]&&_0x521891['callysquare']>0x0){logger['info'](util['format'](_0xc6a9('0x37'),_0x521891[_0xc6a9('0x36')]));_0x3b2f2b=_0x521891[_0xc6a9('0x36')];}else{logger['info'](_0xc6a9('0x38'));}}else{logger[_0xc6a9('0x16')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3b2f2b=-0x1;}})[_0xc6a9('0x26')](function(){return Project[_0xc6a9('0x39')]();})[_0xc6a9('0x26')](function(_0x476e2f){projects=_0x476e2f;return;})['catch'](function(_0x75c722){logger[_0xc6a9('0xe')]('[LICENSE]',_0x75c722['stack']);})[_0xc6a9('0x3a')](function(){var _0x591095=require('./server')(config[_0xc6a9('0x4')][_0xc6a9('0x15')],config['agi']['ip'],_0x3b2f2b);_0x591095['on']('error',errorHandler);_0x591095['on'](_0xc6a9('0x3b'),listeningHandler);_0x591095['on']('connection',connectionHandler);_0x591095['on'](_0xc6a9('0x2f'),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 fc7bb95..ee150cc 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 _0x8c75=['sendMailMessage','SendMail','jayson/promise','client','http','then','error','message','result','catch'];(function(_0x5a068d,_0x4b680c){var _0x3d3ca6=function(_0x5461d7){while(--_0x5461d7){_0x5a068d['push'](_0x5a068d['shift']());}};_0x3d3ca6(++_0x4b680c);}(_0x8c75,0x142));var _0x58c7=function(_0x40055a,_0x352bdb){_0x40055a=_0x40055a-0x0;var _0x52bfaf=_0x8c75[_0x40055a];return _0x52bfaf;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x58c7('0x0'));var client=jayson[_0x58c7('0x1')][_0x58c7('0x2')]({'port':0x232b});function request(_0x1552fa,_0x15af1b){return new BPromise(function(_0x2675ed,_0x32b4e8){return client['request'](_0x1552fa,_0x15af1b)[_0x58c7('0x3')](function(_0x57f9fe){if(_0x57f9fe[_0x58c7('0x4')]){return _0x32b4e8(_0x57f9fe[_0x58c7('0x4')][_0x58c7('0x5')]);}else{return _0x2675ed(_0x57f9fe[_0x58c7('0x6')]);}})[_0x58c7('0x7')](function(_0x3ca109){return _0x32b4e8(_0x3ca109);});});}exports[_0x58c7('0x8')]=function(_0x5c348e,_0x3148f1){return request(_0x58c7('0x9'),{'account':_0x5c348e,'message':_0x3148f1});}; \ No newline at end of file +var _0x4d1c=['bluebird','jayson/promise','client','http','request','then','error','message','result','catch','SendMail'];(function(_0x5aebfe,_0x2b21a9){var _0xc831b8=function(_0x4b8fce){while(--_0x4b8fce){_0x5aebfe['push'](_0x5aebfe['shift']());}};_0xc831b8(++_0x2b21a9);}(_0x4d1c,0x16b));var _0xc4d1=function(_0xe4daed,_0x18e902){_0xe4daed=_0xe4daed-0x0;var _0x4177d2=_0x4d1c[_0xe4daed];return _0x4177d2;};'use strict';var BPromise=require(_0xc4d1('0x0'));var jayson=require(_0xc4d1('0x1'));var client=jayson[_0xc4d1('0x2')][_0xc4d1('0x3')]({'port':0x232b});function request(_0x39cff7,_0x40045c){return new BPromise(function(_0x315570,_0x4a899c){return client[_0xc4d1('0x4')](_0x39cff7,_0x40045c)[_0xc4d1('0x5')](function(_0x5ef5d1){if(_0x5ef5d1[_0xc4d1('0x6')]){return _0x4a899c(_0x5ef5d1[_0xc4d1('0x6')][_0xc4d1('0x7')]);}else{return _0x315570(_0x5ef5d1[_0xc4d1('0x8')]);}})[_0xc4d1('0x9')](function(_0x40dc9e){return _0x4a899c(_0x40dc9e);});});}exports['sendMailMessage']=function(_0x1621b2,_0x1fa68e){return request(_0xc4d1('0xa'),{'account':_0x1621b2,'message':_0x1fa68e});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index d79fb48..7fa1411 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf96f=['result','evtHangup','isUndefined','agicommand\x20not\x20found','finally','[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\x20found','continueAt','lodash','moment','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','stack','agicommand','hasOwnProperty','retry','addVertex','isArray','length','source','target','value','toJson','mxGraphModel','production','start','debug','root','joinAt','format','omit','mxCell','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','info','response','code'];(function(_0x1688d9,_0x2989ae){var _0x4d06cc=function(_0x356e40){while(--_0x356e40){_0x1688d9['push'](_0x1688d9['shift']());}};_0x4d06cc(++_0x2989ae);}(_0xf96f,0x11d));var _0xff96=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf96f[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xff96('0x0'));var moment=require(_0xff96('0x1'));var parser=require('xml2json');var util=require('util');var logger=require('../../config/logger')('agi');var rpc=require(_0xff96('0x2'));var mailRpc=require(_0xff96('0x3'));var Graph=require('./graph');var Vertices=require(_0xff96('0x4'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xff96('0x5')]()[_0xff96('0x6')](function(_0x517d3){logger[_0xff96('0x7')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x517d3[_0xff96('0x8')]);return[];});}function addVertex(_0x5f0216,_0x4619c9,_0x3b19f0){_0x4619c9[_0xff96('0x9')]=_0x3b19f0;if(_0x4619c9[_0xff96('0xa')](_0xff96('0xb'))){_0x4619c9['maxRetry']=parseInt(_0x4619c9[_0xff96('0xb')],0xa);}_0x5f0216[_0xff96('0xc')](_['omit'](_0x4619c9,'mxCell'));}function initGraph(_0x88cabc,_0x148962){var _0x2b74c2=new Graph();for(var _0x263628 in _0x88cabc){if(_0x88cabc[_0xff96('0xa')](_0x263628)){if(_[_0xff96('0xd')](_0x88cabc[_0x263628])){for(var _0x5f4239=0x0;_0x5f4239<_0x88cabc[_0x263628][_0xff96('0xe')];_0x5f4239+=0x1){addVertex(_0x2b74c2,_0x88cabc[_0x263628][_0x5f4239],_0x263628);}}else{addVertex(_0x2b74c2,_0x88cabc[_0x263628],_0x263628);}}}for(var _0x2004a1=0x0;_0x2004a1<_0x148962[_0xff96('0xe')];_0x2004a1+=0x1){if(_0x148962[_0x2004a1][_0xff96('0xf')]&&_0x148962[_0x2004a1][_0xff96('0x10')]){_0x2b74c2['addEdge'](_0x148962[_0x2004a1][_0xff96('0xf')],_0x148962[_0x2004a1][_0xff96('0x10')],_0x148962[_0x2004a1][_0xff96('0x11')]);}}return _0x2b74c2;}function getRoot(_0x2cba1f){return parser[_0xff96('0x12')](_0x2cba1f,{'object':!![]})[_0xff96('0x13')]['root'];}function inspect(_0x3762e0){return util['inspect'](_0x3762e0,{'showHidden':![],'depth':null});}function initialize(_0x5811b5,_0x4b19a7){var _0x78a8a=getRoot(_0x5811b5[_0xff96('0x14')]);if(!_0x78a8a||!_0x78a8a[_0xff96('0x15')])return;var _0xa711e1,_0x19458d,_0x3aa0a6;logger[_0xff96('0x16')](_0xff96('0x17'),JSON['stringify'](_0x78a8a,null,0x2));_0x4b19a7[_0xff96('0x18')]=moment()[_0xff96('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0xa711e1=initGraph(_[_0xff96('0x1a')](_0x78a8a,_0xff96('0x1b')),_0x78a8a['mxCell']);_0x19458d=new Vertices(_0x4b19a7,rpc,mailRpc);logger['info'](util[_0xff96('0x19')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4b19a7[_0xff96('0x1c')],_0x4b19a7[_0xff96('0x1d')],_0x4b19a7[_0xff96('0x1e')],_0x4b19a7[_0xff96('0x1f')],_0x4b19a7[_0xff96('0x20')]));_0xa711e1[_0xff96('0x21')](_0x78a8a[_0xff96('0x15')]['id'],function(_0x34a35b){try{_0x34a35b=_0x19458d[_0xff96('0x22')](_0x34a35b);logger['debug'](_0xff96('0x23'),JSON[_0xff96('0x24')](_0x34a35b,null,0x2));if(_0x34a35b[_0xff96('0x9')]===_0xff96('0x25')){logger['info'](_0xff96('0x26'));_0x4b19a7[_0xff96('0x27')]=_0x34a35b[_0xff96('0x27')]||_0x4b19a7[_0xff96('0x27')];_0x4b19a7['extension']=_0x34a35b[_0xff96('0x28')];_0x4b19a7['priority']=_0x34a35b[_0xff96('0x29')]?_0x34a35b[_0xff96('0x29')]-0x1:0x1;return null;}else if(_0x34a35b&&_0x19458d[_0x34a35b['agicommand']]){_0x3aa0a6=_0x19458d[_0x34a35b[_0xff96('0x9')]](_0x34a35b);logger[_0xff96('0x2a')](_0xff96('0x2b'),JSON[_0xff96('0x24')](_0x3aa0a6,null,0x2));if(_0x3aa0a6&&_0x3aa0a6[_0xff96('0x2c')]===AGI_CODE_SUCCESS&&_0x3aa0a6[_0xff96('0x2d')]!==AGI_RESULT_ERROR&&!_0x4b19a7[_0xff96('0x2e')]){logger[_0xff96('0x16')](_0xff96('0x2b'),inspect(_0x3aa0a6));return _[_0xff96('0x2f')](_0x3aa0a6['result'])?null:_0x3aa0a6[_0xff96('0x2d')]['toString']();}else{logger[_0xff96('0x7')](_0xff96('0x2b'),inspect(_0x3aa0a6));return null;}}else{logger[_0xff96('0x7')](_0xff96('0x30'));return null;}}catch(_0x58d7df){logger[_0xff96('0x7')](_0x58d7df['stack']);return null;}});if(_0x78a8a[_0xff96('0x31')]){logger[_0xff96('0x2a')](util[_0xff96('0x19')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4b19a7[_0xff96('0x1c')],_0x4b19a7['calleridname'],_0x4b19a7[_0xff96('0x1e')],_0x4b19a7['dnid'],_0x4b19a7['uniqueid']));_0xa711e1[_0xff96('0x21')](_0x78a8a[_0xff96('0x31')]['id'],function(_0x3455f3){try{_0x3455f3=_0x19458d[_0xff96('0x22')](_0x3455f3);logger['debug'](_0xff96('0x23'),JSON[_0xff96('0x24')](_0x3455f3,null,0x2));if(_0x3455f3&&_0x19458d[_0x3455f3['agicommand']]){_0x3aa0a6=_0x19458d[_0x3455f3[_0xff96('0x9')]](_0x3455f3);if(_0x3aa0a6){logger[_0xff96('0x16')](_0xff96('0x2b'),inspect(_0x3aa0a6));return _[_0xff96('0x2f')](_0x3aa0a6[_0xff96('0x2d')])?null:_0x3aa0a6['result']['toString']();}else{logger[_0xff96('0x7')](_0xff96('0x2b'),inspect(_0x3aa0a6));return null;}}else{logger[_0xff96('0x7')]('agicommand\x20not\x20found');return null;}}catch(_0xeed237){logger[_0xff96('0x7')](_0xeed237[_0xff96('0x8')]);return null;}});}logger[_0xff96('0x2a')](util[_0xff96('0x19')](_0xff96('0x32'),_0x4b19a7[_0xff96('0x1c')],_0x4b19a7[_0xff96('0x1d')],_0x4b19a7['callerid'],_0x4b19a7[_0xff96('0x1f')],_0x4b19a7[_0xff96('0x20')]));logger[_0xff96('0x2a')](util['format'](_0xff96('0x33'),_0x4b19a7[_0xff96('0x27')],_0x4b19a7['extension'],parseInt(_0x4b19a7['priority'],0xa)+0x1));_0x4b19a7['continueAt'](_0x4b19a7[_0xff96('0x27')],_0x4b19a7[_0xff96('0x28')],parseInt(_0x4b19a7[_0xff96('0x29')],0xa)+0x1);_0x4b19a7[_0xff96('0x34')]();}function handleNotFound(_0x37b13e){logger['error'](util[_0xff96('0x19')](_0xff96('0x35'),_0x37b13e[_0xff96('0x1c')]));_0x37b13e[_0xff96('0x36')](_0x37b13e['context'],_0x37b13e['extension'],parseInt(_0x37b13e[_0xff96('0x29')],0xa)+0x1);_0x37b13e[_0xff96('0x34')]();}function handleUnpublished(_0x43dacf){logger[_0xff96('0x7')](util[_0xff96('0x19')]('Project\x20%s\x20not\x20published',_0x43dacf[_0xff96('0x1c')]));_0x43dacf[_0xff96('0x36')](_0x43dacf[_0xff96('0x27')],_0x43dacf['extension'],parseInt(_0x43dacf[_0xff96('0x29')],0xa)+0x1);_0x43dacf['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xce29=['debug','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','start','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','stringify','result','response','isUndefined','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','lodash','moment','xml2json','../../config/logger','agi','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','omit','isArray','length','source','target','value','mxGraphModel','root','inspect','production'];(function(_0x2c6a9c,_0x433116){var _0x15affb=function(_0x260f4b){while(--_0x260f4b){_0x2c6a9c['push'](_0x2c6a9c['shift']());}};_0x15affb(++_0x433116);}(_0xce29,0x149));var _0x9ce2=function(_0x55d31e,_0x18a46e){_0x55d31e=_0x55d31e-0x0;var _0x2fb215=_0xce29[_0x55d31e];return _0x2fb215;};'use strict';var _=require(_0x9ce2('0x0'));var moment=require(_0x9ce2('0x1'));var parser=require(_0x9ce2('0x2'));var util=require('util');var logger=require(_0x9ce2('0x3'))(_0x9ce2('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x9ce2('0x5'));var Graph=require(_0x9ce2('0x6'));var Vertices=require(_0x9ce2('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9ce2('0x8')]()[_0x9ce2('0x9')](function(_0x3f67ae){logger[_0x9ce2('0xa')](_0x9ce2('0xb'),_0x3f67ae[_0x9ce2('0xc')]);return[];});}function addVertex(_0x4aa4e6,_0x8bf13d,_0x2d2b35){_0x8bf13d['agicommand']=_0x2d2b35;if(_0x8bf13d[_0x9ce2('0xd')]('retry')){_0x8bf13d['maxRetry']=parseInt(_0x8bf13d[_0x9ce2('0xe')],0xa);}_0x4aa4e6['addVertex'](_[_0x9ce2('0xf')](_0x8bf13d,'mxCell'));}function initGraph(_0x6b0f17,_0x4d1afe){var _0x4f28f9=new Graph();for(var _0x5d735c in _0x6b0f17){if(_0x6b0f17[_0x9ce2('0xd')](_0x5d735c)){if(_[_0x9ce2('0x10')](_0x6b0f17[_0x5d735c])){for(var _0x521bfe=0x0;_0x521bfe<_0x6b0f17[_0x5d735c][_0x9ce2('0x11')];_0x521bfe+=0x1){addVertex(_0x4f28f9,_0x6b0f17[_0x5d735c][_0x521bfe],_0x5d735c);}}else{addVertex(_0x4f28f9,_0x6b0f17[_0x5d735c],_0x5d735c);}}}for(var _0x227341=0x0;_0x227341<_0x4d1afe[_0x9ce2('0x11')];_0x227341+=0x1){if(_0x4d1afe[_0x227341][_0x9ce2('0x12')]&&_0x4d1afe[_0x227341]['target']){_0x4f28f9['addEdge'](_0x4d1afe[_0x227341][_0x9ce2('0x12')],_0x4d1afe[_0x227341][_0x9ce2('0x13')],_0x4d1afe[_0x227341][_0x9ce2('0x14')]);}}return _0x4f28f9;}function getRoot(_0x107d94){return parser['toJson'](_0x107d94,{'object':!![]})[_0x9ce2('0x15')][_0x9ce2('0x16')];}function inspect(_0x5044b2){return util[_0x9ce2('0x17')](_0x5044b2,{'showHidden':![],'depth':null});}function initialize(_0x3b5369,_0x2773be){var _0x1d50a2=getRoot(_0x3b5369[_0x9ce2('0x18')]);if(!_0x1d50a2||!_0x1d50a2['start'])return;var _0x4fd6ff,_0x3fcdd5,_0x2d9bfa;logger[_0x9ce2('0x19')](_0x9ce2('0x16'),JSON['stringify'](_0x1d50a2,null,0x2));_0x2773be[_0x9ce2('0x1a')]=moment()[_0x9ce2('0x1b')](_0x9ce2('0x1c'));_0x4fd6ff=initGraph(_[_0x9ce2('0xf')](_0x1d50a2,_0x9ce2('0x1d')),_0x1d50a2[_0x9ce2('0x1d')]);_0x3fcdd5=new Vertices(_0x2773be,rpc,mailRpc);logger[_0x9ce2('0x1e')](util[_0x9ce2('0x1b')](_0x9ce2('0x1f'),_0x2773be[_0x9ce2('0x20')],_0x2773be[_0x9ce2('0x21')],_0x2773be[_0x9ce2('0x22')],_0x2773be[_0x9ce2('0x23')],_0x2773be[_0x9ce2('0x24')]));_0x4fd6ff[_0x9ce2('0x25')](_0x1d50a2[_0x9ce2('0x26')]['id'],function(_0x21cb72){try{_0x21cb72=_0x3fcdd5[_0x9ce2('0x27')](_0x21cb72);logger[_0x9ce2('0x19')](_0x9ce2('0x28'),JSON['stringify'](_0x21cb72,null,0x2));if(_0x21cb72[_0x9ce2('0x29')]===_0x9ce2('0x2a')){logger[_0x9ce2('0x1e')](_0x9ce2('0x2b'));_0x2773be['context']=_0x21cb72['context']||_0x2773be[_0x9ce2('0x2c')];_0x2773be[_0x9ce2('0x2d')]=_0x21cb72[_0x9ce2('0x2d')];_0x2773be[_0x9ce2('0x2e')]=_0x21cb72[_0x9ce2('0x2e')]?_0x21cb72[_0x9ce2('0x2e')]-0x1:0x1;return null;}else if(_0x21cb72&&_0x3fcdd5[_0x21cb72[_0x9ce2('0x29')]]){_0x2d9bfa=_0x3fcdd5[_0x21cb72['agicommand']](_0x21cb72);logger[_0x9ce2('0x1e')]('response',JSON[_0x9ce2('0x2f')](_0x2d9bfa,null,0x2));if(_0x2d9bfa&&_0x2d9bfa['code']===AGI_CODE_SUCCESS&&_0x2d9bfa[_0x9ce2('0x30')]!==AGI_RESULT_ERROR&&!_0x2773be['evtHangup']){logger[_0x9ce2('0x19')](_0x9ce2('0x31'),inspect(_0x2d9bfa));return _[_0x9ce2('0x32')](_0x2d9bfa['result'])?null:_0x2d9bfa[_0x9ce2('0x30')]['toString']();}else{logger[_0x9ce2('0xa')](_0x9ce2('0x31'),inspect(_0x2d9bfa));return null;}}else{logger[_0x9ce2('0xa')](_0x9ce2('0x33'));return null;}}catch(_0x3b5b50){logger[_0x9ce2('0xa')](_0x3b5b50[_0x9ce2('0xc')]);return null;}});if(_0x1d50a2['finally']){logger[_0x9ce2('0x1e')](util[_0x9ce2('0x1b')](_0x9ce2('0x34'),_0x2773be['arg_1'],_0x2773be[_0x9ce2('0x21')],_0x2773be[_0x9ce2('0x22')],_0x2773be[_0x9ce2('0x23')],_0x2773be['uniqueid']));_0x4fd6ff[_0x9ce2('0x25')](_0x1d50a2[_0x9ce2('0x35')]['id'],function(_0x14cd8f){try{_0x14cd8f=_0x3fcdd5['clear'](_0x14cd8f);logger[_0x9ce2('0x19')](_0x9ce2('0x28'),JSON[_0x9ce2('0x2f')](_0x14cd8f,null,0x2));if(_0x14cd8f&&_0x3fcdd5[_0x14cd8f[_0x9ce2('0x29')]]){_0x2d9bfa=_0x3fcdd5[_0x14cd8f[_0x9ce2('0x29')]](_0x14cd8f);if(_0x2d9bfa){logger[_0x9ce2('0x19')]('response',inspect(_0x2d9bfa));return _[_0x9ce2('0x32')](_0x2d9bfa[_0x9ce2('0x30')])?null:_0x2d9bfa['result']['toString']();}else{logger[_0x9ce2('0xa')]('response',inspect(_0x2d9bfa));return null;}}else{logger[_0x9ce2('0xa')](_0x9ce2('0x33'));return null;}}catch(_0xcfc8e2){logger[_0x9ce2('0xa')](_0xcfc8e2[_0x9ce2('0xc')]);return null;}});}logger[_0x9ce2('0x1e')](util[_0x9ce2('0x1b')](_0x9ce2('0x36'),_0x2773be[_0x9ce2('0x20')],_0x2773be[_0x9ce2('0x21')],_0x2773be['callerid'],_0x2773be[_0x9ce2('0x23')],_0x2773be['uniqueid']));logger[_0x9ce2('0x1e')](util[_0x9ce2('0x1b')](_0x9ce2('0x37'),_0x2773be[_0x9ce2('0x2c')],_0x2773be[_0x9ce2('0x2d')],parseInt(_0x2773be[_0x9ce2('0x2e')],0xa)+0x1));_0x2773be[_0x9ce2('0x38')](_0x2773be[_0x9ce2('0x2c')],_0x2773be[_0x9ce2('0x2d')],parseInt(_0x2773be[_0x9ce2('0x2e')],0xa)+0x1);_0x2773be[_0x9ce2('0x39')]();}function handleNotFound(_0xd8e299){logger['error'](util[_0x9ce2('0x1b')](_0x9ce2('0x3a'),_0xd8e299[_0x9ce2('0x20')]));_0xd8e299['continueAt'](_0xd8e299[_0x9ce2('0x2c')],_0xd8e299['extension'],parseInt(_0xd8e299[_0x9ce2('0x2e')],0xa)+0x1);_0xd8e299[_0x9ce2('0x39')]();}function handleUnpublished(_0x2a4698){logger[_0x9ce2('0xa')](util[_0x9ce2('0x1b')]('Project\x20%s\x20not\x20published',_0x2a4698[_0x9ce2('0x20')]));_0x2a4698['continueAt'](_0x2a4698[_0x9ce2('0x2c')],_0x2a4698[_0x9ce2('0x2d')],parseInt(_0x2a4698[_0x9ce2('0x2e')],0xa)+0x1);_0x2a4698[_0x9ce2('0x39')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 91b9e77..6f874f4 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 _0xefe3=['trim','length','emit','headers','exports','util','call','_localBuffer','_inBody','inherits','_transform','toString','indexOf','substring','split','slice'];(function(_0x7f1e6f,_0x44a12e){var _0x49d26f=function(_0x1a62f1){while(--_0x1a62f1){_0x7f1e6f['push'](_0x7f1e6f['shift']());}};_0x49d26f(++_0x44a12e);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x3efe('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x4c4932){Transform[_0x3efe('0x1')](this,_0x4c4932);this[_0x3efe('0x2')]='';this[_0x3efe('0x3')]=![];}util[_0x3efe('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x3efe('0x5')]=function(_0x58e1bb,_0x89aaa1,_0x4b5006){var _0x3a1c0a='\x0a',_0x60487e=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x1f697b=-0x1,_0x195d5d=-0x1,_0x30d2e8='',_0x474c9a=0x0,_0x4b9766='',_0x3fecac='';this[_0x3efe('0x2')]+=_0x58e1bb[_0x3efe('0x6')]();_0x4b9766=this[_0x3efe('0x2')];if(!this[_0x3efe('0x3')]){_0x474c9a=0x0;while(_0x60487e[_0x474c9a]){while((_0x195d5d=_0x4b9766[_0x3efe('0x7')](_0x60487e[_0x474c9a]))!=-0x1){_0x30d2e8=_0x60487e[_0x474c9a];_0x3fecac=_0x4b9766[_0x3efe('0x8')](0x0,_0x195d5d);_0x4b9766=_0x4b9766['substring'](_0x195d5d+_0x30d2e8['length']);var _0x42732b=_0x3fecac[_0x3efe('0x9')](_0x3a1c0a),_0x2f19af=0x0,_0x276ca9={},_0x3ad584='',_0x11b9b4='',_0x3778ec=-0x1;while(_0x42732b[_0x2f19af]){_0x3778ec=_0x42732b[_0x2f19af][_0x3efe('0x7')](':');if(_0x3778ec!=-0x1){_0x3ad584=_0x42732b[_0x2f19af][_0x3efe('0xa')](0x0,_0x3778ec)[_0x3efe('0xb')]();_0x11b9b4=_0x42732b[_0x2f19af][_0x3efe('0xa')](_0x3778ec+0x1)['trim']();if(_0x3ad584[_0x3efe('0xc')]>0x0){_0x276ca9[_0x3ad584]=_0x11b9b4;}}else{}_0x2f19af++;}this[_0x3efe('0xd')](_0x3efe('0xe'),_0x276ca9);this[_0x3efe('0x3')]=!![];}_0x474c9a++;}this['_localBuffer']=_0x4b9766;}else{while((_0x1f697b=_0x4b9766[_0x3efe('0x7')](_0x3a1c0a))!=-0x1){_0x3fecac=_0x4b9766[_0x3efe('0x8')](0x0,_0x1f697b);this[_0x3efe('0xd')]('line',_0x3fecac);_0x4b9766=_0x4b9766['substring'](_0x1f697b+_0x3a1c0a[_0x3efe('0xc')]);}this[_0x3efe('0x2')]=_0x4b9766;}_0x4b5006();};module[_0x3efe('0xf')]=AGIReply; \ No newline at end of file +var _0x4273=['exports','util','stream','Transform','call','_localBuffer','_inBody','toString','indexOf','substring','length','slice','trim','emit'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4273,0xc5));var _0x3427=function(_0x20fd23,_0x5d3358){_0x20fd23=_0x20fd23-0x0;var _0x573b67=_0x4273[_0x20fd23];return _0x573b67;};'use strict';var util=require(_0x3427('0x0'));var Transform=require(_0x3427('0x1'))[_0x3427('0x2')];function AGIReply(_0x47a3ec){Transform[_0x3427('0x3')](this,_0x47a3ec);this[_0x3427('0x4')]='';this[_0x3427('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x5c833c,_0x385b8d,_0x13cd6f){var _0x539d20='\x0a',_0x33850e=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x51fd04=-0x1,_0x763889=-0x1,_0x21637a='',_0x50c06d=0x0,_0x34cdd4='',_0x4fbbfb='';this[_0x3427('0x4')]+=_0x5c833c[_0x3427('0x6')]();_0x34cdd4=this[_0x3427('0x4')];if(!this[_0x3427('0x5')]){_0x50c06d=0x0;while(_0x33850e[_0x50c06d]){while((_0x763889=_0x34cdd4[_0x3427('0x7')](_0x33850e[_0x50c06d]))!=-0x1){_0x21637a=_0x33850e[_0x50c06d];_0x4fbbfb=_0x34cdd4[_0x3427('0x8')](0x0,_0x763889);_0x34cdd4=_0x34cdd4[_0x3427('0x8')](_0x763889+_0x21637a[_0x3427('0x9')]);var _0x2fe0ef=_0x4fbbfb['split'](_0x539d20),_0x169e51=0x0,_0x4069bf={},_0x3d2ada='',_0x30db01='',_0x432f28=-0x1;while(_0x2fe0ef[_0x169e51]){_0x432f28=_0x2fe0ef[_0x169e51][_0x3427('0x7')](':');if(_0x432f28!=-0x1){_0x3d2ada=_0x2fe0ef[_0x169e51]['slice'](0x0,_0x432f28)['trim']();_0x30db01=_0x2fe0ef[_0x169e51][_0x3427('0xa')](_0x432f28+0x1)[_0x3427('0xb')]();if(_0x3d2ada[_0x3427('0x9')]>0x0){_0x4069bf[_0x3d2ada]=_0x30db01;}}else{}_0x169e51++;}this[_0x3427('0xc')]('headers',_0x4069bf);this[_0x3427('0x5')]=!![];}_0x50c06d++;}this[_0x3427('0x4')]=_0x34cdd4;}else{while((_0x51fd04=_0x34cdd4[_0x3427('0x7')](_0x539d20))!=-0x1){_0x4fbbfb=_0x34cdd4[_0x3427('0x8')](0x0,_0x51fd04);this[_0x3427('0xc')]('line',_0x4fbbfb);_0x34cdd4=_0x34cdd4['substring'](_0x51fd04+_0x539d20[_0x3427('0x9')]);}this[_0x3427('0x4')]=_0x34cdd4;}_0x13cd6f();};module[_0x3427('0xd')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 0d73332..5433498 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 _0x0c29=['GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','jayson/promise','http','request','then','error','message','result','catch','getSquareProjects'];(function(_0x3a5885,_0x285d94){var _0x45c31d=function(_0x32061d){while(--_0x32061d){_0x3a5885['push'](_0x3a5885['shift']());}};_0x45c31d(++_0x285d94);}(_0x0c29,0xb7));var _0x90c2=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x0c29[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0x90c2('0x0'));var client=jayson['client'][_0x90c2('0x1')]({'port':0x2329});function request(_0x3093c8,_0x3aaaf2){return new Promise(function(_0x59a229,_0x4a0464){return client[_0x90c2('0x2')](_0x3093c8,_0x3aaaf2)[_0x90c2('0x3')](function(_0x36df43){if(_0x36df43[_0x90c2('0x4')]){return _0x4a0464(_0x36df43[_0x90c2('0x4')][_0x90c2('0x5')]);}else{return _0x59a229(_0x36df43[_0x90c2('0x6')]);}})[_0x90c2('0x7')](function(_0x16288c){return _0x4a0464(_0x16288c);});});}exports[_0x90c2('0x8')]=function(){return request(_0x90c2('0x9'),{'options':{'raw':![],'attributes':['id',_0x90c2('0xa'),_0x90c2('0xb')]}});};exports[_0x90c2('0xc')]=function(_0x2c7753){return request(_0x90c2('0xd'),{'options':{'raw':![],'where':{'name':_0x2c7753},'attributes':[_0x90c2('0xb')]}});};exports[_0x90c2('0xe')]=function(_0x252ba9){return request(_0x90c2('0xf'),{'options':{'raw':![],'where':{'id':_0x252ba9},'include':[{'model':'MailServerOut','as':_0x90c2('0x10'),'include':[{'model':_0x90c2('0x11'),'as':'CloudProvider'}]}],'attributes':['id',_0x90c2('0xa'),_0x90c2('0x12')],'smtp':!![]}});};exports[_0x90c2('0x13')]=function(_0x20d60f){return request(_0x90c2('0xd'),{'options':{'where':{'id':_0x20d60f},'attributes':[_0x90c2('0xa')]}});};exports[_0x90c2('0x14')]=function(_0x5dbf9d){return request(_0x90c2('0x15'),{'options':{'where':{'id':_0x5dbf9d},'attributes':[_0x90c2('0xa')]}});};exports[_0x90c2('0x16')]=function(_0x159ad3){return request('ShowVariable',{'options':{'where':{'id':_0x159ad3},'attributes':[_0x90c2('0xa')]}});};exports['getSquareOdbcById']=function(_0x30457e){return request(_0x90c2('0x17'),{'options':{'where':{'id':_0x30457e},'attributes':[_0x90c2('0x18')]}});};exports[_0x90c2('0x19')]=function(_0x48fa7c){return request(_0x90c2('0x1a'),{'options':{'where':{'id':_0x48fa7c},'attributes':[_0x90c2('0xa')]}});};exports['getContactByPhone']=function(_0x2946d6){return request(_0x90c2('0x1b'),{'options':{'where':{'phone':_0x2946d6['phone']},'attributes':['id']}});};exports[_0x90c2('0x1c')]=function(_0x27fe47){return request(_0x90c2('0x1d'),{'options':{'where':{'id':_0x27fe47},'attributes':['name']}});};exports[_0x90c2('0x1e')]=function(_0x2c5cd0){return request(_0x90c2('0x1f'),{'options':{'where':{'id':_0x2c5cd0},'attributes':[_0x90c2('0x20')]}});};exports['getIntervalById']=function(_0x5ef51d){return request(_0x90c2('0x21'),{'options':{'raw':![],'where':{'id':_0x5ef51d},'include':[{'model':_0x90c2('0x22'),'as':_0x90c2('0x23')}]}});};exports[_0x90c2('0x24')]=function(_0x1e88a8){return request(_0x90c2('0x25'),{'options':{'where':{'id':_0x1e88a8},'attributes':['id',_0x90c2('0xa')]}});};exports[_0x90c2('0x26')]=function(_0x590d8d){return request('CreateSmsMessage',{'body':_0x590d8d});};exports['createSquareDetailsReport']=function(_0x7e8af9){return request(_0x90c2('0x27'),{'body':_0x7e8af9});};exports[_0x90c2('0x28')]=function(_0x1f4135){return request(_0x90c2('0x29'),{'body':_[_0x90c2('0x2a')](_0x1f4135,{'project_name':_0x1f4135[_0x90c2('0x2b')],'prev_project_name':_0x1f4135[_0x90c2('0x2c')]||'','is_subproject':_0x1f4135['arg_2']?!![]:![],'leaveAt':moment()[_0x90c2('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x90c2('0x2e')]=function(_0x41758b){return request(_0x90c2('0x2f'),{'body':_0x41758b});};exports[_0x90c2('0x30')]=function(_0x47b6f9){return request(_0x90c2('0x31'),{'body':_0x47b6f9});};exports[_0x90c2('0x32')]=function(_0x5e9adf){return request(_0x90c2('0x33'),{'options':{'raw':![],'where':{'phone':_0x5e9adf[_0x90c2('0x34')],'ListId':_0x5e9adf[_0x90c2('0x35')]}}})[_0x90c2('0x3')](function(_0x52b385){if(_0x52b385){return _0x52b385;}return request(_0x90c2('0x36'),{'body':_0x5e9adf});});};exports[_0x90c2('0x37')]=function(_0x49bf1d){return request(_0x90c2('0x38'),{'options':{'where':{'id':_0x49bf1d},'attributes':[_0x90c2('0xa')]}});};exports[_0x90c2('0x39')]=function(_0x180ee3,_0x5eb5d1){return request(_0x90c2('0x3a'),{'body':{'interface':_0x5eb5d1},'options':{'where':_0x180ee3}});};exports[_0x90c2('0x3b')]=function(_0x149acf,_0x4d27c1,_0x4ea8d4){return request(_0x90c2('0x3c'),{'body':{'type':_0x4d27c1,'uniqueid':_0x4ea8d4},'options':{'where':_0x149acf}});};exports['agentUnpause']=function(_0x5d2f41){return request(_0x90c2('0x3d'),{'body':{},'options':{'where':_0x5d2f41}});};exports[_0x90c2('0x3e')]=function(_0x2ce51b){return request(_0x90c2('0x3f'),{'body':{},'options':{'where':_0x2ce51b}});}; \ No newline at end of file +var _0x10af=['getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_2','format','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId','then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','error','result','catch','getSquareProjects','name','getSquareProject','ShowSquareProject','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x10af,0xfc));var _0xf10a=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x10af[_0x369151];return _0x4292d5;};'use strict';var _=require(_0xf10a('0x0'));var moment=require('moment');var jayson=require(_0xf10a('0x1'));var client=jayson[_0xf10a('0x2')][_0xf10a('0x3')]({'port':0x2329});function request(_0x211890,_0x453e1a){return new Promise(function(_0x53a66f,_0xbffc71){return client[_0xf10a('0x4')](_0x211890,_0x453e1a)['then'](function(_0x32060a){if(_0x32060a[_0xf10a('0x5')]){return _0xbffc71(_0x32060a['error']['message']);}else{return _0x53a66f(_0x32060a[_0xf10a('0x6')]);}})[_0xf10a('0x7')](function(_0x2ade36){return _0xbffc71(_0x2ade36);});});}exports[_0xf10a('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xf10a('0x9'),'production']}});};exports[_0xf10a('0xa')]=function(_0x5e3d9b){return request(_0xf10a('0xb'),{'options':{'raw':![],'where':{'name':_0x5e3d9b},'attributes':['production']}});};exports['getMailAccountById']=function(_0x208c5a){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x208c5a},'include':[{'model':_0xf10a('0xc'),'as':_0xf10a('0xd'),'include':[{'model':'CloudProvider','as':_0xf10a('0xe')}]}],'attributes':['id',_0xf10a('0x9'),_0xf10a('0xf')],'smtp':!![]}});};exports[_0xf10a('0x10')]=function(_0xa98797){return request(_0xf10a('0xb'),{'options':{'where':{'id':_0xa98797},'attributes':[_0xf10a('0x9')]}});};exports[_0xf10a('0x11')]=function(_0xe03766){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xe03766},'attributes':[_0xf10a('0x9')]}});};exports['getVariableById']=function(_0x5b72ad){return request(_0xf10a('0x12'),{'options':{'where':{'id':_0x5b72ad},'attributes':[_0xf10a('0x9')]}});};exports[_0xf10a('0x13')]=function(_0x10fa6f){return request(_0xf10a('0x14'),{'options':{'where':{'id':_0x10fa6f},'attributes':['dsn']}});};exports[_0xf10a('0x15')]=function(_0x10ab5){return request(_0xf10a('0x16'),{'options':{'where':{'id':_0x10ab5},'attributes':[_0xf10a('0x9')]}});};exports[_0xf10a('0x17')]=function(_0x20a858){return request(_0xf10a('0x18'),{'options':{'where':{'phone':_0x20a858[_0xf10a('0x19')]},'attributes':['id']}});};exports[_0xf10a('0x1a')]=function(_0x463e75){return request(_0xf10a('0x1b'),{'options':{'where':{'id':_0x463e75},'attributes':['name']}});};exports[_0xf10a('0x1c')]=function(_0x2e658e){return request(_0xf10a('0x1d'),{'options':{'where':{'id':_0x2e658e},'attributes':['save_name']}});};exports[_0xf10a('0x1e')]=function(_0x5c55b0){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x5c55b0},'include':[{'model':'Interval','as':_0xf10a('0x1f')}]}});};exports[_0xf10a('0x20')]=function(_0x2dc858){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2dc858},'attributes':['id',_0xf10a('0x9')]}});};exports[_0xf10a('0x21')]=function(_0x569bb5){return request(_0xf10a('0x22'),{'body':_0x569bb5});};exports[_0xf10a('0x23')]=function(_0x5377c5){return request(_0xf10a('0x24'),{'body':_0x5377c5});};exports[_0xf10a('0x25')]=function(_0x2989c6){return request('CreateSquareReport',{'body':_[_0xf10a('0x26')](_0x2989c6,{'project_name':_0x2989c6['arg_1'],'prev_project_name':_0x2989c6[_0xf10a('0x27')]||'','is_subproject':_0x2989c6[_0xf10a('0x27')]?!![]:![],'leaveAt':moment()[_0xf10a('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x48cb1a){return request(_0xf10a('0x29'),{'body':_0x48cb1a});};exports['createSquareMessage']=function(_0x5b8c64){return request(_0xf10a('0x2a'),{'body':_0x5b8c64});};exports[_0xf10a('0x2b')]=function(_0x3cf00d){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3cf00d[_0xf10a('0x19')],'ListId':_0x3cf00d[_0xf10a('0x2c')]}}})[_0xf10a('0x2d')](function(_0x457a53){if(_0x457a53){return _0x457a53;}return request(_0xf10a('0x2e'),{'body':_0x3cf00d});});};exports[_0xf10a('0x2f')]=function(_0x3b6a2a){return request('ShowPause',{'options':{'where':{'id':_0x3b6a2a},'attributes':[_0xf10a('0x9')]}});};exports[_0xf10a('0x30')]=function(_0x4c3373,_0x3f87b1){return request(_0xf10a('0x31'),{'body':{'interface':_0x3f87b1},'options':{'where':_0x4c3373}});};exports[_0xf10a('0x32')]=function(_0x400d2f,_0x57c5d6,_0x548842){return request('PauseUser',{'body':{'type':_0x57c5d6,'uniqueid':_0x548842},'options':{'where':_0x400d2f}});};exports[_0xf10a('0x33')]=function(_0x136e84){return request(_0xf10a('0x34'),{'body':{},'options':{'where':_0x136e84}});};exports[_0xf10a('0x35')]=function(_0x250381){return request(_0xf10a('0x36'),{'body':{},'options':{'where':_0x250381}});}; \ 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 212c5f3..d160b43 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 _0x077e=['./polly','./lex','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x077e,0x14a));var _0xe077=function(_0x227b62,_0x5121b){_0x227b62=_0x227b62-0x0;var _0x5ec873=_0x077e[_0x227b62];return _0x5ec873;};var polly=require(_0xe077('0x0'));var lex=require(_0xe077('0x1'));module[_0xe077('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfb15=['./polly','./lex','exports'];(function(_0x1de4d6,_0x312aec){var _0x2c3fa2=function(_0x583a37){while(--_0x583a37){_0x1de4d6['push'](_0x1de4d6['shift']());}};_0x2c3fa2(++_0x312aec);}(_0xfb15,0x12f));var _0x5fb1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfb15[_0x5b644e];return _0x49c6bf;};var polly=require(_0x5fb1('0x0'));var lex=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 05bfe00..a9ec881 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 _0x6f7a=['./lib/api','exports'];(function(_0x59efaa,_0x12b791){var _0x5f0e2d=function(_0x526778){while(--_0x526778){_0x59efaa['push'](_0x59efaa['shift']());}};_0x5f0e2d(++_0x12b791);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x246694,_0xbf4f52){_0x246694=_0x246694-0x0;var _0x2eb7b1=_0x6f7a[_0x246694];return _0x2eb7b1;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e){return lex(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e);}; \ 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 b408e7d..85761c1 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(_0x505dd8,_0x296ce1){var _0x13dd8f=function(_0x2632bd){while(--_0x2632bd){_0x505dd8['push'](_0x505dd8['shift']());}};_0x13dd8f(++_0x296ce1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x2ca778,_0x26c9df){var _0x754c16=function(_0x1162cc){while(--_0x1162cc){_0x2ca778['push'](_0x2ca778['shift']());}};_0x754c16(++_0x26c9df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 e9c19f5..665d1ee 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6c5=['exports','./lib/api'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xf6c5,0x187));var _0x5f6c=function(_0x3432c6,_0x1d2fcf){_0x3432c6=_0x3432c6-0x0;var _0x2a893f=_0xf6c5[_0x3432c6];return _0x2a893f;};'use strict';var polly=require(_0x5f6c('0x0'));module[_0x5f6c('0x1')]=function(_0x5ecb79,_0x354525,_0x82890b,_0x3e5f7c,_0x307ab3,_0xd8d9dc,_0x3f7a71){return polly(_0x5ecb79,_0x354525,_0x82890b,_0x3e5f7c,_0x307ab3,_0xd8d9dc,_0x3f7a71);}; \ No newline at end of file +var _0x1e83=['exports'];(function(_0x56c714,_0x3f2d8c){var _0x7115d2=function(_0xb0b085){while(--_0xb0b085){_0x56c714['push'](_0x56c714['shift']());}};_0x7115d2(++_0x3f2d8c);}(_0x1e83,0x192));var _0x31e8=function(_0xac84e8,_0x88b205){_0xac84e8=_0xac84e8-0x0;var _0x1c4ca1=_0x1e83[_0xac84e8];return _0x1c4ca1;};'use strict';var polly=require('./lib/api');module[_0x31e8('0x0')]=function(_0x1cc83b,_0x161fd5,_0x515662,_0x19aa9a,_0x21232c,_0x3f9b74,_0x114b94){return polly(_0x1cc83b,_0x161fd5,_0x515662,_0x19aa9a,_0x21232c,_0x3f9b74,_0x114b94);}; \ 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 3b2834e..4c055ce 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 _0x9da9=['exports','Polly','text','bluebird','randomstring','synthesizeSpeech','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x4f6d9d,_0x15c242){var _0x1b599b=function(_0xc7e7b5){while(--_0xc7e7b5){_0x4f6d9d['push'](_0x4f6d9d['shift']());}};_0x1b599b(++_0x15c242);}(_0x9da9,0x1f3));var _0x99da=function(_0x2606e7,_0xcbe32c){_0x2606e7=_0x2606e7-0x0;var _0x56d2b6=_0x9da9[_0x2606e7];return _0x56d2b6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x99da('0x0'));var rs=require(_0x99da('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x771b6,_0x2a4c33,_0x4b8a2c){return new BPromise(function(_0x4e1f25,_0xa74146){_0x771b6[_0x99da('0x2')](_0x2a4c33,function(_0x85de7d,_0x81cd0e){if(_0x85de7d){_0xa74146(_0x85de7d);}else if(_0x81cd0e){if(_0x81cd0e['AudioStream']instanceof Buffer){fs[_0x99da('0x3')](_0x4b8a2c,_0x81cd0e['AudioStream'],function(_0x484725){if(_0x484725){_0xa74146(_0x484725);}else{_0x4e1f25();}});}else{_0xa74146(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xa74146(new Error(_0x99da('0x4')));}});});}module[_0x99da('0x5')]=function(_0x4023b5,_0x530dcc,_0x51e93f,_0x241cc5,_0x2f48a4,_0x31ebd6,_0x5bef72){var _0x397371=new AWS[(_0x99da('0x6'))]({'accessKeyId':_0x4023b5,'secretAccessKey':_0x530dcc,'region':_0x51e93f});var _0x44686d={'Text':_0x2f48a4,'TextType':_0x31ebd6||_0x99da('0x7'),'OutputFormat':'mp3','VoiceId':_0x241cc5};return pollyResult(_0x397371,_0x44686d,_0x5bef72);}; \ No newline at end of file +var _0x66d4=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3'];(function(_0x14714f,_0x36b8e2){var _0x5677d5=function(_0x46954e){while(--_0x46954e){_0x14714f['push'](_0x14714f['shift']());}};_0x5677d5(++_0x36b8e2);}(_0x66d4,0x14a));var _0x466d=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x66d4[_0x32b30c];return _0xcfc212;};'use strict';var fs=require('fs');var path=require(_0x466d('0x0'));var BPromise=require(_0x466d('0x1'));var rs=require(_0x466d('0x2'));var AWS=require(_0x466d('0x3'));function pollyResult(_0x49c8bf,_0x3231be,_0xb04c6a){return new BPromise(function(_0x3cc375,_0x14bd74){_0x49c8bf[_0x466d('0x4')](_0x3231be,function(_0x55f25d,_0x55eca){if(_0x55f25d){_0x14bd74(_0x55f25d);}else if(_0x55eca){if(_0x55eca['AudioStream']instanceof Buffer){fs['writeFile'](_0xb04c6a,_0x55eca[_0x466d('0x5')],function(_0x152769){if(_0x152769){_0x14bd74(_0x152769);}else{_0x3cc375();}});}else{_0x14bd74(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x14bd74(new Error(_0x466d('0x6')));}});});}module['exports']=function(_0x92e743,_0x3d6320,_0x1f48ce,_0x7682c0,_0xb2317b,_0x3215d5,_0x1b61a8){var _0x48226a=new AWS[(_0x466d('0x7'))]({'accessKeyId':_0x92e743,'secretAccessKey':_0x3d6320,'region':_0x1f48ce});var _0x47bde1={'Text':_0xb2317b,'TextType':_0x3215d5||_0x466d('0x8'),'OutputFormat':_0x466d('0x9'),'VoiceId':_0x7682c0};return pollyResult(_0x48226a,_0x47bde1,_0x1b61a8);}; \ 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 808f342..c4797c0 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 _0xb10c=['./lib/api','exports'];(function(_0x27789c,_0x5508ef){var _0x4bea31=function(_0x1c0677){while(--_0x1c0677){_0x27789c['push'](_0x27789c['shift']());}};_0x4bea31(++_0x5508ef);}(_0xb10c,0xa4));var _0xcb10=function(_0x3a2295,_0x3064c9){_0x3a2295=_0x3a2295-0x0;var _0x569710=_0xb10c[_0x3a2295];return _0x569710;};'use strict';var asr=require(_0xcb10('0x0'));module[_0xcb10('0x1')]=function(_0x41ca8a,_0x1dc107,_0x353674,_0x5e4da1){return asr(_0x41ca8a,_0x1dc107,_0x353674);}; \ No newline at end of file +var _0xf4e7=['exports','./lib/api'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0xf4e7,0x139));var _0x7f4e=function(_0x5cf27e,_0xc88b76){_0x5cf27e=_0x5cf27e-0x0;var _0x221edc=_0xf4e7[_0x5cf27e];return _0x221edc;};'use strict';var asr=require(_0x7f4e('0x0'));module[_0x7f4e('0x1')]=function(_0x483947,_0x7976c9,_0x4a9946,_0x85c711){return asr(_0x483947,_0x7976c9,_0x4a9946);}; \ 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 d61d285..1294239 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 _0x78f0=['base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x78f0,0x15d));var _0x078f=function(_0x2db76e,_0x5d0467){_0x2db76e=_0x2db76e-0x0;var _0x53386d=_0x78f0[_0x2db76e];return _0x53386d;};'use strict';var url=require(_0x078f('0x0'));var BPromise=require(_0x078f('0x1'));var fs=require('fs');var host=_0x078f('0x2');module[_0x078f('0x3')]=function(_0x11b4c1,_0x2bde34,_0x34a715){return new BPromise(function(_0x316f1c,_0x5785fd){var _0x2f3d53;if(typeof _0x11b4c1!==_0x078f('0x4')||_0x11b4c1[_0x078f('0x5')]===0x0){return _0x5785fd(_0x078f('0x6'));}if(typeof _0x2bde34!=='string'||_0x2bde34[_0x078f('0x5')]===0x0){return _0x5785fd(_0x078f('0x7'));}if(typeof _0x34a715!=='undefined'&&(typeof _0x34a715!==_0x078f('0x4')||_0x34a715[_0x078f('0x5')]===0x0)){return _0x5785fd(_0x078f('0x8'));}try{_0x2f3d53=fs[_0x078f('0x9')](_0x11b4c1)[_0x078f('0xa')](_0x078f('0xb'));}catch(_0x4207d0){return _0x5785fd(_0x4207d0);}return _0x316f1c({'method':_0x078f('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x2bde34,'body':{'config':{'encoding':_0x078f('0xd'),'sampleRateHertz':_0x078f('0xe'),'languageCode':_0x34a715},'audio':{'content':_0x2f3d53}},'json':!![]});});}; \ No newline at end of file +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(_0x4a0e56,_0x43dc17){_0x4a0e56=_0x4a0e56-0x0;var _0x15fc68=_0xaf93[_0x4a0e56];return _0x15fc68;};'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 diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index bac979f..4fab044 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 _0x20af=['exports','./asr'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x20af,0x10d));var _0xf20a=function(_0x33ff23,_0x203109){_0x33ff23=_0x33ff23-0x0;var _0xfa314=_0x20af[_0x33ff23];return _0xfa314;};var asr=require(_0xf20a('0x0'));module[_0xf20a('0x1')]={'asr':asr}; \ No newline at end of file +var _0xa258=['exports','./asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa258,0x125));var _0x8a25=function(_0x431c07,_0x1f3c46){_0x431c07=_0x431c07-0x0;var _0x12864a=_0xa258[_0x431c07];return _0x12864a;};var asr=require(_0x8a25('0x0'));module[_0x8a25('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index d7d56a8..463f3d2 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 _0xbfee=['queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','nda','CustomAction','channelData','AudioFromTts','Data','apiai-promise','bluebird','http','https','md5','path','querystring','request-promise','randomstring','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','WHAT_EVER','data','transcode','wav','start','tmp','generate','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','resolve','.mp3','from','audioContent','writeFile','.wav','split','googleTTS','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','catch','textRequest','stringify','result','resolvedQuery','actionIncomplete','fulfillment','code','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:'];(function(_0x132c1d,_0x7d74b6){var _0x303030=function(_0x3d8b37){while(--_0x3d8b37){_0x132c1d['push'](_0x132c1d['shift']());}};_0x303030(++_0x7d74b6);}(_0xbfee,0x1ad));var _0xebfe=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xbfee[_0x8c43de];return _0xa6591b;};'use strict';var apiai=require(_0xebfe('0x0'));var BPromise=require(_0xebfe('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xebfe('0x2'));var https=require(_0xebfe('0x3'));var md5=require(_0xebfe('0x4'));var path=require(_0xebfe('0x5'));var querystring=require(_0xebfe('0x6'));var rp=require(_0xebfe('0x7'));var rs=require(_0xebfe('0x8'));var sox=require('sox');var tts=require(_0xebfe('0x9'));var urlParse=require(_0xebfe('0xa'))['parse'];var util=require(_0xebfe('0xb'));var aws=require(_0xebfe('0xc'));var google=require(_0xebfe('0xd'));var sestek=require(_0xebfe('0xe'));var tilde=require(_0xebfe('0xf'));var logger=require(_0xebfe('0x10'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x78431b,_0x4ccc72){return new BPromise(function(_0x59986a,_0x20b3e9){var _0x17fbad=urlParse(_0x78431b);var _0x40f735=_0x17fbad[_0xebfe('0x11')]===_0xebfe('0x12')?https:http;var _0x26932f={'host':_0x17fbad[_0xebfe('0x13')],'path':_0x17fbad[_0xebfe('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x40f735[_0xebfe('0x14')](_0x26932f,function(_0x2450f7){if(_0x2450f7[_0xebfe('0x15')]!==0xc8){logger[_0xebfe('0x16')](_0xebfe('0x17')+_0x78431b+_0xebfe('0x18')+_0x2450f7[_0xebfe('0x15')]+'\x20('+_0x2450f7[_0xebfe('0x19')]+')');_0x20b3e9(new Error(_0xebfe('0x17')+_0x78431b+_0xebfe('0x18')+_0x2450f7['statusCode']+'\x20('+_0x2450f7[_0xebfe('0x19')]+')'));return;}var _0x1d443c=fs[_0xebfe('0x1a')](_0x4ccc72);_0x1d443c['on'](_0xebfe('0x1b'),function(){logger[_0xebfe('0x1c')](_0xebfe('0x1d'));_0x1d443c[_0xebfe('0x1e')](_0x59986a);});_0x1d443c['on'](_0xebfe('0x16'),function(_0x3ae8b6){fs[_0xebfe('0x1f')](_0x4ccc72);logger[_0xebfe('0x16')](_0xebfe('0x20'),_0x3ae8b6);_0x20b3e9(_0x3ae8b6);});_0x2450f7[_0xebfe('0x21')](_0x1d443c);})['on'](_0xebfe('0x16'),function(_0x392dca){logger[_0xebfe('0x16')](_0x392dca);_0x20b3e9(_0x392dca);})[_0xebfe('0x22')]();});}function uploadFile(_0x3e2055){return new BPromise(function(_0x1d32e6,_0x143e4e){var _0x1370cb=urlParse(_0x3e2055);var _0x2e8095=_0x1370cb[_0xebfe('0x11')]===_0xebfe('0x12')?https:http;var _0x409fba={'host':_0x1370cb[_0xebfe('0x13')],'path':_0x1370cb[_0xebfe('0x5')],'headers':{'user-agent':_0xebfe('0x23')}};_0x2e8095[_0xebfe('0x14')](_0x409fba,function(_0x1723ac){if(_0x1723ac[_0xebfe('0x15')]!==0xc8){_0x143e4e(new Error('request\x20to\x20'+_0x3e2055+'\x20failed,\x20status\x20code\x20=\x20'+_0x1723ac[_0xebfe('0x15')]+'\x20('+_0x1723ac[_0xebfe('0x19')]+')'));return;}var _0x594ca0='';_0x1723ac['on'](_0xebfe('0x24'),function(_0x4f8ed5){_0x594ca0+=_0x4f8ed5;});_0x1723ac['on'](_0xebfe('0x22'),function(){_0x1d32e6(_0x594ca0);});})['on']('error',function(_0x1296eb){_0x143e4e(_0x1296eb);})[_0xebfe('0x22')]();});}function convertFile(_0x4e3222,_0x196e75){return new BPromise(function(_0x5be7a1,_0x20dda1){var _0x5bd645=sox[_0xebfe('0x25')](_0x4e3222,_0x196e75,{'sampleRate':0x1f40,'format':_0xebfe('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5bd645['on']('error',function(_0x33c161){logger[_0xebfe('0x16')]('error\x20convert',_0x33c161);_0x20dda1(_0x33c161);});_0x5bd645['on'](_0xebfe('0x22'),function(){logger[_0xebfe('0x1c')]('finish\x20to\x20convert');_0x5be7a1();});_0x5bd645[_0xebfe('0x27')]();});}function base64Decode(_0x2b6a27,_0x3d9274){var _0x24030f=path['resolve'](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+'.wav');fs[_0xebfe('0x2a')](_0x24030f,_0x2b6a27,_0xebfe('0x2b'));return convertFile(_0x24030f,_0x3d9274)[_0xebfe('0x2c')](function(){try{fs['unlink'](_0x24030f);fs[_0xebfe('0x2d')](_0x3d9274,_0xebfe('0x2e'));}catch(_0x280caf){logger[_0xebfe('0x16')](_0x280caf);}return _0x3d9274['split']('.')[0x0];});}function base64Encode(_0x2ece84){var _0x37a4ab=fs[_0xebfe('0x2f')](_0x2ece84);return new Buffer(_0x37a4ab)[_0xebfe('0x30')](_0xebfe('0x2b'));}exports['googleCloudTTS']=function(_0x5403d7,_0x25735d,_0x3e3a9d,_0x34b21d,_0x5ddac5,_0xbf9289){var _0x61dd35,_0x2bfc3c;var _0x5b845e=_0xebfe('0x31');var _0x4f74ce=_0xebfe('0x32')+_0x5403d7;var _0x31e54a={};if(_0x25735d===_0xebfe('0x33')){_0x31e54a[_0xebfe('0x34')]={'ssml':_0x3e3a9d};}else{_0x31e54a[_0xebfe('0x34')]={'text':_0x3e3a9d};};_0x31e54a['voice']={'languageCode':_0x34b21d,'ssmlGender':_0x5ddac5};_0x31e54a[_0xebfe('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2b7407={'url':_0x5b845e+_0xebfe('0x36')+_0x4f74ce,'method':'POST','json':!![],'body':_0x31e54a};return rp(_0x2b7407)[_0xebfe('0x2c')](function(_0x48cf06){return new BPromise(function(_0x4b322e,_0x4635c3){_0x61dd35=path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+_0xebfe('0x38'));var _0x2c3d71=Buffer[_0xebfe('0x39')](_0x48cf06[_0xebfe('0x3a')],_0xebfe('0x2b'));return fs[_0xebfe('0x3b')](_0x61dd35,_0x2c3d71,function(_0xb94faa){_0x4635c3(_0xb94faa);},function(_0x41b696){fs['chmodSync'](_0x61dd35,_0xebfe('0x2e'));_0x4b322e(_0x41b696);});});})['then'](function(_0xa328c4){_0x2bfc3c=path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+_0xebfe('0x3c'));return convertFile(_0x61dd35,_0x2bfc3c);})[_0xebfe('0x2c')](function(){try{fs[_0xebfe('0x1f')](_0x61dd35);fs['chmodSync'](_0x2bfc3c,'777');}catch(_0x5adf14){logger['error'](_0x5adf14);}logger[_0xebfe('0x1c')]('googleCloudTTS\x20path',_0x2bfc3c[_0xebfe('0x3d')]('.')[0x0]);return _0x2bfc3c['split']('.')[0x0];});};exports[_0xebfe('0x3e')]=function(_0x2bc9c4,_0x1f32d3){var _0x1d22b0='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5d3ebb,_0x191d9a;var _0x2778da;var _0x1d5c58={'encoding':_0xebfe('0x3f'),'method':_0xebfe('0x40'),'timeout':0x2710,'url':_0x1d22b0,'headers':{'Content-Type':_0xebfe('0x41')},'body':_0xebfe('0x42')+encodeURIComponent(JSON['stringify']([[[_0xebfe('0x43'),JSON['stringify']([_0x2bc9c4,_0x1f32d3||'en',![],'null']),null,_0xebfe('0x44')]]]))};return rp(_0x1d5c58)[_0xebfe('0x2c')](function(_0x2f0a26){try{_0x2778da=eval(_0x2f0a26[_0xebfe('0x45')](0x5))[0x0][0x2];}catch(_0x362828){throw new Error(_0xebfe('0x46')+_0x2f0a26[_0xebfe('0x24')]);}if(!_0x2778da){if(_0x2bc9c4[_0xebfe('0x47')]>0xc8){throw new Error(_0xebfe('0x48'));}else{throw new Error(_0xebfe('0x49')+_0x1f32d3+'\x22\x20might\x20not\x20exist');}}try{_0x2778da=eval(_0x2778da)[0x0];}catch(_0x35fe13){throw new Error(_0xebfe('0x46')+res[_0xebfe('0x24')]);}const _0x228506=_0x2778da;_0x5d3ebb=path[_0xebfe('0x37')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');fs[_0xebfe('0x2a')](_0x5d3ebb,_0x2778da,{'encoding':_0xebfe('0x2b')});_0x191d9a=path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+_0xebfe('0x3c'));return convertFile(_0x5d3ebb,_0x191d9a);})[_0xebfe('0x2c')](function(){try{fs[_0xebfe('0x1f')](_0x5d3ebb);fs[_0xebfe('0x2d')](_0x191d9a,'777');}catch(_0x2bf76e){logger[_0xebfe('0x16')](_0x2bf76e);}logger[_0xebfe('0x1c')](_0xebfe('0x4a'),_0x191d9a[_0xebfe('0x3d')]('.')[0x0]);return _0x191d9a[_0xebfe('0x3d')]('.')[0x0];});};exports[_0xebfe('0x4b')]=function(_0x33b3ee,_0x621696,_0x31ff70){return google[_0xebfe('0x4c')](_0x33b3ee,_0x621696,_0x31ff70)[_0xebfe('0x2c')](function(_0x1603b2){logger[_0xebfe('0x1c')](_0x1603b2[_0xebfe('0x4d')]);return rp(_0x1603b2);})[_0xebfe('0x2c')](function(_0xd10e0a){var _0x1ca1e1='';var _0x5950b6=0x0;try{fs[_0xebfe('0x1f')](_0x33b3ee);}catch(_0x2686e5){logger[_0xebfe('0x16')](_0x2686e5);}if(_0xd10e0a&&_0xd10e0a[_0xebfe('0x4e')]){_0x1ca1e1=_0xd10e0a[_0xebfe('0x4e')][_0xebfe('0x4f')](function(_0xf90f0d){return _0xf90f0d&&_0xf90f0d['alternatives'][0x0]&&_0xf90f0d[_0xebfe('0x50')][0x0][_0xebfe('0x51')]?_0xf90f0d[_0xebfe('0x50')][0x0][_0xebfe('0x51')]:'';})['join']('\x0a');_0x5950b6=_0xd10e0a['results'][_0xebfe('0x4f')](function(_0x55c8a3){return _0x55c8a3&&_0x55c8a3[_0xebfe('0x50')][0x0]&&_0x55c8a3['alternatives'][0x0][_0xebfe('0x52')]?_0x55c8a3['alternatives'][0x0][_0xebfe('0x52')]:0x0;})['join']('\x0a');}logger[_0xebfe('0x1c')](_0xebfe('0x53'),_0x1ca1e1);logger[_0xebfe('0x1c')]('googleASR\x20confidence',_0x5950b6);return{'transcript':_0x1ca1e1,'confidence':_0x5950b6};})[_0xebfe('0x54')](function(_0x397b47){logger[_0xebfe('0x16')]('[%s]\x20%s:%s',_0x397b47[_0xebfe('0x15')],_0x397b47['name'],_0x397b47['message']);});};exports['googleDialogflow']=function(_0x49c74a,_0x3962e3,_0x1ba367,_0x248a7a){var _0x5c38d6=apiai(_0x3962e3,{'language':_0x248a7a||'en'});return _0x5c38d6[_0xebfe('0x55')](_0x1ba367,{'sessionId':md5(_0x49c74a)})[_0xebfe('0x2c')](function(_0x5b2085){logger[_0xebfe('0x1c')](JSON[_0xebfe('0x56')](_0x5b2085));return{'source':_0x5b2085[_0xebfe('0x57')]['source'],'resolvedQuery':_0x5b2085[_0xebfe('0x57')][_0xebfe('0x58')],'action':_0x5b2085[_0xebfe('0x57')]['action'],'actionIncomplete':_0x5b2085[_0xebfe('0x57')][_0xebfe('0x59')],'speech':_0x5b2085['result'][_0xebfe('0x5a')]['speech'],'score':_0x5b2085['result']['score'],'statusCode':_0x5b2085['status'][_0xebfe('0x5b')],'endConversation':_0x5b2085[_0xebfe('0x57')]['metadata']['endConversation']||![],'isFallbackIntent':_0x5b2085[_0xebfe('0x57')]['metadata'][_0xebfe('0x5c')]};});};exports[_0xebfe('0x5d')]=function(_0x4ffb4e,_0x3bdac7,_0x2c3b60,_0x4004be,_0x142ab2,_0x1f4c19){var _0x270cb5=_0x4004be[_0xebfe('0x5e')](/\\n/g,'\x0a');var _0x490462={'credentials':{'private_key':_0x270cb5,'client_email':_0x2c3b60}};var _0x380347=new dialogflow[(_0xebfe('0x5f'))](_0x490462);var _0x45e39a=_0x380347[_0xebfe('0x60')](_0x3bdac7,md5(_0x4ffb4e));var _0xd58b0d={'session':_0x45e39a,'queryInput':{'text':{'text':_0x142ab2,'languageCode':_0x1f4c19}}};return _0x380347[_0xebfe('0x61')](_0xd58b0d)[_0xebfe('0x2c')](function(_0x287f0a){if(_0x287f0a&&_0x287f0a[_0xebfe('0x47')]){logger['info'](_0xebfe('0x62'),JSON[_0xebfe('0x56')](_0x287f0a));var _0x5bcedf=_0x287f0a[0x0];if(_0x5bcedf){var _0x2ad235={'action':_0x5bcedf[_0xebfe('0x63')]['action'],'allRequiredParamsPresent':_0x5bcedf['queryResult'][_0xebfe('0x64')],'endConversation':_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x65')]&&_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x65')][_0xebfe('0x66')]?_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x65')]['fields'][_0xebfe('0x67')][_0xebfe('0x68')]:![],'fulfillmentText':_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x69')],'intentName':_0x5bcedf[_0xebfe('0x63')]['intent']['name'],'intentDisplayName':_0x5bcedf['queryResult'][_0xebfe('0x6a')][_0xebfe('0x6b')],'isFallbackIntent':_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x6a')][_0xebfe('0x6c')],'languageCode':_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x6d')],'queryText':_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x6e')],'responseId':_0x5bcedf[_0xebfe('0x6f')],'score':_0x5bcedf[_0xebfe('0x63')][_0xebfe('0x70')],'speech':_0x5bcedf['queryResult'][_0xebfe('0x69')],'providerResponse':JSON[_0xebfe('0x56')](_0x287f0a)};return _0x2ad235;}}});};exports[_0xebfe('0x71')]=function(_0x7c3731,_0x470a4f,_0x351074,_0x5f3012){return tilde[_0xebfe('0x4c')](_0x7c3731,_0x470a4f,_0x351074,_0x5f3012)[_0xebfe('0x2c')](function(_0xba3e38){try{fs['unlink'](_0x7c3731);}catch(_0x4b266){logger[_0xebfe('0x16')](_0x4b266);}logger[_0xebfe('0x1c')](_0xebfe('0x72'),_0xba3e38[_0xebfe('0x51')]);logger[_0xebfe('0x1c')](_0xebfe('0x73'),_0xba3e38[_0xebfe('0x52')]);return _0xba3e38;});};exports[_0xebfe('0x74')]=function(_0x1c0800,_0x47d002,_0xcf444b,_0x1cc9bc,_0x36be35,_0x27dce9){var _0x5c4eab=path['resolve'](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+_0xebfe('0x38'));var _0x5e2eca;return aws['polly'](_0x1c0800,_0x47d002,_0xcf444b,_0x1cc9bc,_0x36be35,_0x27dce9,_0x5c4eab)['then'](function(){_0x5e2eca=path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+_0xebfe('0x3c'));return convertFile(_0x5c4eab,_0x5e2eca);})['then'](function(){try{fs[_0xebfe('0x1f')](_0x5c4eab);fs[_0xebfe('0x2d')](_0x5e2eca,_0xebfe('0x2e'));}catch(_0x5ab734){logger[_0xebfe('0x16')](_0x5ab734);}return _0x5e2eca['split']('.')[0x0];});};exports[_0xebfe('0x75')]=function(_0x2ca12d,_0x574503,_0xb44b7,_0x488d20,_0x1c4540,_0x4abcd6){return aws[_0xebfe('0x76')](_0x2ca12d,_0x574503,_0xb44b7,_0x488d20,_0x1c4540,_0x4abcd6)[_0xebfe('0x2c')](function(_0x3ff70d){logger[_0xebfe('0x1c')](JSON['stringify'](_0x3ff70d));return _0x3ff70d;});};exports[_0xebfe('0x77')]=function(_0x45a1e8,_0x16609d,_0x300e46,_0x7f7e28){var _0x413c46=util['format'](_0xebfe('0x78'),ISPEECH_API,_0x45a1e8,encodeURIComponent(_0x16609d),_0x300e46,_0x7f7e28);var _0x30cf1f=path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs['generate'](0x4)+_0xebfe('0x38'));var _0x1c424a;return downloadFile(_0x413c46,_0x30cf1f)[_0xebfe('0x2c')](function(){_0x1c424a=path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs[_0xebfe('0x29')](0x4)+_0xebfe('0x3c'));return convertFile(_0x30cf1f,_0x1c424a);})[_0xebfe('0x2c')](function(){try{fs[_0xebfe('0x1f')](_0x30cf1f);fs[_0xebfe('0x2d')](_0x1c424a,'777');}catch(_0x41a4a1){logger[_0xebfe('0x16')](_0x41a4a1);}return _0x1c424a[_0xebfe('0x3d')]('.')[0x0];});};exports[_0xebfe('0x79')]=function(_0x35722f,_0x40c391,_0x2cef0a,_0x2170e3){var _0x131de1=util[_0xebfe('0x7a')](_0xebfe('0x7b'),ISPEECH_API,_0x40c391,_0x2cef0a,base64Encode(_0x35722f),_0x2170e3?util[_0xebfe('0x7a')](_0xebfe('0x7c'),encodeURIComponent(_0x2170e3)):'freeform=3');return uploadFile(_0x131de1)[_0xebfe('0x2c')](function(_0x462d74){return querystring[_0xebfe('0x7d')](_0x462d74);});};exports[_0xebfe('0x7e')]=function(_0xcc1f96,_0xe0fc20){return sestek[_0xebfe('0x7f')](_0xcc1f96,_0xe0fc20)[_0xebfe('0x2c')](function(_0x388389){logger[_0xebfe('0x1c')](JSON[_0xebfe('0x56')](_0x388389));var _0x5e2e46={'speech':_0x388389['text'],'action':_0x388389['channelData']?_0x388389['channelData'][_0xebfe('0x80')]:undefined,'actiondata':_0x388389[_0xebfe('0x81')]?_0x388389[_0xebfe('0x81')]['CustomActionData']:undefined};if(_0x388389[_0xebfe('0x81')]&&_0x388389[_0xebfe('0x81')]['AudioFromTts']){return base64Decode(_0x388389['channelData'][_0xebfe('0x82')][_0xebfe('0x83')],path[_0xebfe('0x37')](__dirname,_0xebfe('0x28'),rs['generate'](0x4)+_0xebfe('0x3c')))[_0xebfe('0x2c')](function(_0x19b40a){_0x5e2e46['audiofile']=_0x19b40a;return _0x5e2e46;});}return _0x5e2e46;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x81a7=['./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','finish','unlink','pipe','end','https:','WHAT_EVER','transcode','error\x20convert','info','finish\x20to\x20convert','start','tmp','.wav','then','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','chmodSync','resolve','googleCloudTTS\x20path','application/x-www-form-urlencoded','f.req=','stringify','null','slice','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','metadata','isFallbackIntent','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','name','isFallback','languageCode','queryText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','randomstring','google-tts-api','url','parse','util','./aws','./sestek'];(function(_0x44b9d5,_0x178036){var _0x280137=function(_0xa0bfb1){while(--_0xa0bfb1){_0x44b9d5['push'](_0x44b9d5['shift']());}};_0x280137(++_0x178036);}(_0x81a7,0x76));var _0x781a=function(_0x46686c,_0x7fe4c5){_0x46686c=_0x46686c-0x0;var _0x4dff94=_0x81a7[_0x46686c];return _0x4dff94;};'use strict';var apiai=require(_0x781a('0x0'));var BPromise=require(_0x781a('0x1'));var dialogflow=require(_0x781a('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x781a('0x3'));var md5=require(_0x781a('0x4'));var path=require(_0x781a('0x5'));var querystring=require(_0x781a('0x6'));var rp=require('request-promise');var rs=require(_0x781a('0x7'));var sox=require('sox');var tts=require(_0x781a('0x8'));var urlParse=require(_0x781a('0x9'))[_0x781a('0xa')];var util=require(_0x781a('0xb'));var aws=require(_0x781a('0xc'));var google=require('./google');var sestek=require(_0x781a('0xd'));var tilde=require(_0x781a('0xe'));var logger=require(_0x781a('0xf'))('agi');var ISPEECH_API=_0x781a('0x10');function downloadFile(_0x3720ea,_0x5d63d7){return new BPromise(function(_0x1865d7,_0x1961a7){var _0x32069a=urlParse(_0x3720ea);var _0x4ddc8c=_0x32069a[_0x781a('0x11')]==='https:'?https:http;var _0x1b5b51={'host':_0x32069a['host'],'path':_0x32069a[_0x781a('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4ddc8c[_0x781a('0x12')](_0x1b5b51,function(_0x3941ea){if(_0x3941ea[_0x781a('0x13')]!==0xc8){logger[_0x781a('0x14')]('request\x20to\x20'+_0x3720ea+_0x781a('0x15')+_0x3941ea[_0x781a('0x13')]+'\x20('+_0x3941ea['statusMessage']+')');_0x1961a7(new Error(_0x781a('0x16')+_0x3720ea+'\x20failed,\x20status\x20code\x20=\x20'+_0x3941ea[_0x781a('0x13')]+'\x20('+_0x3941ea[_0x781a('0x17')]+')'));return;}var _0x5d263a=fs[_0x781a('0x18')](_0x5d63d7);_0x5d263a['on'](_0x781a('0x19'),function(){logger['info']('finish\x20download\x20file');_0x5d263a['close'](_0x1865d7);});_0x5d263a['on'](_0x781a('0x14'),function(_0x362817){fs[_0x781a('0x1a')](_0x5d63d7);logger[_0x781a('0x14')]('download\x20error',_0x362817);_0x1961a7(_0x362817);});_0x3941ea[_0x781a('0x1b')](_0x5d263a);})['on'](_0x781a('0x14'),function(_0x124359){logger[_0x781a('0x14')](_0x124359);_0x1961a7(_0x124359);})[_0x781a('0x1c')]();});}function uploadFile(_0x10e947){return new BPromise(function(_0x2b7fec,_0x8b0c){var _0x4d0e39=urlParse(_0x10e947);var _0xd74d7c=_0x4d0e39[_0x781a('0x11')]===_0x781a('0x1d')?https:http;var _0x58e4dc={'host':_0x4d0e39['host'],'path':_0x4d0e39[_0x781a('0x5')],'headers':{'user-agent':_0x781a('0x1e')}};_0xd74d7c[_0x781a('0x12')](_0x58e4dc,function(_0xfa10e1){if(_0xfa10e1[_0x781a('0x13')]!==0xc8){_0x8b0c(new Error(_0x781a('0x16')+_0x10e947+_0x781a('0x15')+_0xfa10e1[_0x781a('0x13')]+'\x20('+_0xfa10e1[_0x781a('0x17')]+')'));return;}var _0x53332d='';_0xfa10e1['on']('data',function(_0x135e84){_0x53332d+=_0x135e84;});_0xfa10e1['on'](_0x781a('0x1c'),function(){_0x2b7fec(_0x53332d);});})['on'](_0x781a('0x14'),function(_0x4f6c77){_0x8b0c(_0x4f6c77);})[_0x781a('0x1c')]();});}function convertFile(_0x3b32b1,_0x163ff7){return new BPromise(function(_0x4cc1f2,_0x46ebfe){var _0x7c528b=sox[_0x781a('0x1f')](_0x3b32b1,_0x163ff7,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x7c528b['on'](_0x781a('0x14'),function(_0x2d8812){logger['error'](_0x781a('0x20'),_0x2d8812);_0x46ebfe(_0x2d8812);});_0x7c528b['on'](_0x781a('0x1c'),function(){logger[_0x781a('0x21')](_0x781a('0x22'));_0x4cc1f2();});_0x7c528b[_0x781a('0x23')]();});}function base64Decode(_0x388bae,_0x49a3ed){var _0x1845aa=path['resolve'](__dirname,_0x781a('0x24'),rs['generate'](0x4)+_0x781a('0x25'));fs['writeFileSync'](_0x1845aa,_0x388bae,'base64');return convertFile(_0x1845aa,_0x49a3ed)[_0x781a('0x26')](function(){try{fs[_0x781a('0x1a')](_0x1845aa);fs['chmodSync'](_0x49a3ed,_0x781a('0x27'));}catch(_0x3ef82b){logger[_0x781a('0x14')](_0x3ef82b);}return _0x49a3ed[_0x781a('0x28')]('.')[0x0];});}function base64Encode(_0x3361e1){var _0x940d2a=fs[_0x781a('0x29')](_0x3361e1);return new Buffer(_0x940d2a)[_0x781a('0x2a')](_0x781a('0x2b'));}exports[_0x781a('0x2c')]=function(_0x191cab,_0xe531f1,_0x4f906b,_0x998034,_0x6a65bc,_0x4794ea){var _0x25ac05,_0x48a30b;var _0x472b68=_0x781a('0x2d');var _0x497699='?key='+_0x191cab;var _0xd73b27={};if(_0xe531f1===_0x781a('0x2e')){_0xd73b27[_0x781a('0x2f')]={'ssml':_0x4f906b};}else{_0xd73b27['input']={'text':_0x4f906b};};_0xd73b27[_0x781a('0x30')]={'languageCode':_0x998034,'ssmlGender':_0x6a65bc};_0xd73b27[_0x781a('0x31')]={'audioEncoding':_0x781a('0x32'),'sampleRateHertz':0x1f40};var _0x45dc7d={'url':_0x472b68+_0x781a('0x33')+_0x497699,'method':_0x781a('0x34'),'json':!![],'body':_0xd73b27};return rp(_0x45dc7d)[_0x781a('0x26')](function(_0x4633fe){return new BPromise(function(_0x5a3a99,_0x5d3f0f){_0x25ac05=path['resolve'](__dirname,_0x781a('0x24'),rs[_0x781a('0x35')](0x4)+_0x781a('0x36'));var _0x29a58a=Buffer[_0x781a('0x37')](_0x4633fe[_0x781a('0x38')],_0x781a('0x2b'));return fs[_0x781a('0x39')](_0x25ac05,_0x29a58a,function(_0x240733){_0x5d3f0f(_0x240733);},function(_0x4fb4e7){fs[_0x781a('0x3a')](_0x25ac05,_0x781a('0x27'));_0x5a3a99(_0x4fb4e7);});});})['then'](function(_0x153db6){_0x48a30b=path[_0x781a('0x3b')](__dirname,_0x781a('0x24'),rs[_0x781a('0x35')](0x4)+_0x781a('0x25'));return convertFile(_0x25ac05,_0x48a30b);})['then'](function(){try{fs[_0x781a('0x1a')](_0x25ac05);fs[_0x781a('0x3a')](_0x48a30b,_0x781a('0x27'));}catch(_0x230a0e){logger[_0x781a('0x14')](_0x230a0e);}logger[_0x781a('0x21')](_0x781a('0x3c'),_0x48a30b['split']('.')[0x0]);return _0x48a30b['split']('.')[0x0];});};exports['googleTTS']=function(_0x3feae9,_0x2ac1a5){var _0x3c4466='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x256242,_0x20eba8;var _0x48217c;var _0x3e23f6={'encoding':'utf8','method':_0x781a('0x34'),'timeout':0x2710,'url':_0x3c4466,'headers':{'Content-Type':_0x781a('0x3d')},'body':_0x781a('0x3e')+encodeURIComponent(JSON[_0x781a('0x3f')]([[['jQ1olc',JSON['stringify']([_0x3feae9,_0x2ac1a5||'en',![],_0x781a('0x40')]),null,'generic']]]))};return rp(_0x3e23f6)['then'](function(_0x17028c){try{_0x48217c=eval(_0x17028c[_0x781a('0x41')](0x5))[0x0][0x2];}catch(_0x50ff3d){throw new Error('parse\x20response\x20failed:\x0a'+_0x17028c[_0x781a('0x42')]);}if(!_0x48217c){if(_0x3feae9[_0x781a('0x43')]>0xc8){throw new Error(_0x781a('0x44'));}else{throw new Error(_0x781a('0x45')+_0x2ac1a5+'\x22\x20might\x20not\x20exist');}}try{_0x48217c=eval(_0x48217c)[0x0];}catch(_0x5dbf04){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x493b7c=_0x48217c;_0x256242=path['resolve'](__dirname,'tmp',rs[_0x781a('0x35')](0x4)+_0x781a('0x36'));fs[_0x781a('0x46')](_0x256242,_0x48217c,{'encoding':'base64'});_0x20eba8=path[_0x781a('0x3b')](__dirname,_0x781a('0x24'),rs[_0x781a('0x35')](0x4)+_0x781a('0x25'));return convertFile(_0x256242,_0x20eba8);})[_0x781a('0x26')](function(){try{fs['unlink'](_0x256242);fs[_0x781a('0x3a')](_0x20eba8,_0x781a('0x27'));}catch(_0x6d2266){logger[_0x781a('0x14')](_0x6d2266);}logger[_0x781a('0x21')](_0x781a('0x47'),_0x20eba8[_0x781a('0x28')]('.')[0x0]);return _0x20eba8[_0x781a('0x28')]('.')[0x0];});};exports[_0x781a('0x48')]=function(_0x4c3171,_0x368afd,_0x1fa2fb){return google[_0x781a('0x49')](_0x4c3171,_0x368afd,_0x1fa2fb)[_0x781a('0x26')](function(_0x5840e3){logger['info'](_0x5840e3['uri']);return rp(_0x5840e3);})[_0x781a('0x26')](function(_0x5ac610){var _0x4fad45='';var _0x37c9ea=0x0;try{fs['unlink'](_0x4c3171);}catch(_0x27aa13){logger[_0x781a('0x14')](_0x27aa13);}if(_0x5ac610&&_0x5ac610[_0x781a('0x4a')]){_0x4fad45=_0x5ac610[_0x781a('0x4a')][_0x781a('0x4b')](function(_0x45682b){return _0x45682b&&_0x45682b[_0x781a('0x4c')][0x0]&&_0x45682b[_0x781a('0x4c')][0x0][_0x781a('0x4d')]?_0x45682b[_0x781a('0x4c')][0x0][_0x781a('0x4d')]:'';})[_0x781a('0x4e')]('\x0a');_0x37c9ea=_0x5ac610[_0x781a('0x4a')]['map'](function(_0x3484ec){return _0x3484ec&&_0x3484ec['alternatives'][0x0]&&_0x3484ec[_0x781a('0x4c')][0x0][_0x781a('0x4f')]?_0x3484ec['alternatives'][0x0][_0x781a('0x4f')]:0x0;})[_0x781a('0x4e')]('\x0a');}logger[_0x781a('0x21')](_0x781a('0x50'),_0x4fad45);logger['info'](_0x781a('0x51'),_0x37c9ea);return{'transcript':_0x4fad45,'confidence':_0x37c9ea};})[_0x781a('0x52')](function(_0x6455fd){logger[_0x781a('0x14')](_0x781a('0x53'),_0x6455fd[_0x781a('0x13')],_0x6455fd['name'],_0x6455fd[_0x781a('0x54')]);});};exports[_0x781a('0x55')]=function(_0x56023e,_0x159c0c,_0x1a6f8c,_0x56291c){var _0x37145f=apiai(_0x159c0c,{'language':_0x56291c||'en'});return _0x37145f[_0x781a('0x56')](_0x1a6f8c,{'sessionId':md5(_0x56023e)})[_0x781a('0x26')](function(_0xd381f1){logger['info'](JSON[_0x781a('0x3f')](_0xd381f1));return{'source':_0xd381f1[_0x781a('0x57')][_0x781a('0x58')],'resolvedQuery':_0xd381f1[_0x781a('0x57')][_0x781a('0x59')],'action':_0xd381f1[_0x781a('0x57')][_0x781a('0x5a')],'actionIncomplete':_0xd381f1[_0x781a('0x57')][_0x781a('0x5b')],'speech':_0xd381f1[_0x781a('0x57')][_0x781a('0x5c')][_0x781a('0x5d')],'score':_0xd381f1[_0x781a('0x57')]['score'],'statusCode':_0xd381f1[_0x781a('0x5e')][_0x781a('0x5f')],'endConversation':_0xd381f1['result']['metadata']['endConversation']||![],'isFallbackIntent':_0xd381f1[_0x781a('0x57')][_0x781a('0x60')][_0x781a('0x61')]};});};exports['googleDialogflowV2']=function(_0x3efd47,_0x5a178c,_0x3c6c90,_0x51ec6c,_0x4c32ff,_0xb52d4b){var _0x4a5426=_0x51ec6c['replace'](/\\n/g,'\x0a');var _0x3ae2c1={'credentials':{'private_key':_0x4a5426,'client_email':_0x3c6c90}};var _0x595047=new dialogflow[(_0x781a('0x62'))](_0x3ae2c1);var _0x234368=_0x595047[_0x781a('0x63')](_0x5a178c,md5(_0x3efd47));var _0xdb9fa5={'session':_0x234368,'queryInput':{'text':{'text':_0x4c32ff,'languageCode':_0xb52d4b}}};return _0x595047[_0x781a('0x64')](_0xdb9fa5)[_0x781a('0x26')](function(_0x335044){if(_0x335044&&_0x335044[_0x781a('0x43')]){logger['info'](_0x781a('0x65'),JSON[_0x781a('0x3f')](_0x335044));var _0x1d95f9=_0x335044[0x0];if(_0x1d95f9){var _0x2b439d={'action':_0x1d95f9['queryResult'][_0x781a('0x5a')],'allRequiredParamsPresent':_0x1d95f9['queryResult'][_0x781a('0x66')],'endConversation':_0x1d95f9[_0x781a('0x67')][_0x781a('0x68')]&&_0x1d95f9[_0x781a('0x67')][_0x781a('0x68')][_0x781a('0x69')]?_0x1d95f9[_0x781a('0x67')][_0x781a('0x68')]['fields'][_0x781a('0x6a')]['boolValue']:![],'fulfillmentText':_0x1d95f9[_0x781a('0x67')][_0x781a('0x6b')],'intentName':_0x1d95f9['queryResult'][_0x781a('0x6c')][_0x781a('0x6d')],'intentDisplayName':_0x1d95f9[_0x781a('0x67')][_0x781a('0x6c')]['displayName'],'isFallbackIntent':_0x1d95f9[_0x781a('0x67')][_0x781a('0x6c')][_0x781a('0x6e')],'languageCode':_0x1d95f9[_0x781a('0x67')][_0x781a('0x6f')],'queryText':_0x1d95f9[_0x781a('0x67')][_0x781a('0x70')],'responseId':_0x1d95f9['responseId'],'score':_0x1d95f9[_0x781a('0x67')]['intentDetectionConfidence'],'speech':_0x1d95f9[_0x781a('0x67')][_0x781a('0x6b')],'providerResponse':JSON[_0x781a('0x3f')](_0x335044)};return _0x2b439d;}}});};exports[_0x781a('0x71')]=function(_0x499ea0,_0x47fec9,_0x1a0fd3,_0xa3ee25){return tilde[_0x781a('0x49')](_0x499ea0,_0x47fec9,_0x1a0fd3,_0xa3ee25)[_0x781a('0x26')](function(_0x25baee){try{fs[_0x781a('0x1a')](_0x499ea0);}catch(_0x2a9ad0){logger['error'](_0x2a9ad0);}logger[_0x781a('0x21')](_0x781a('0x72'),_0x25baee[_0x781a('0x4d')]);logger[_0x781a('0x21')](_0x781a('0x73'),_0x25baee[_0x781a('0x4f')]);return _0x25baee;});};exports[_0x781a('0x74')]=function(_0x135bab,_0x140809,_0x1b6e12,_0x558307,_0x4824fa,_0x5cbec4){var _0x591880=path[_0x781a('0x3b')](__dirname,_0x781a('0x24'),rs[_0x781a('0x35')](0x4)+_0x781a('0x36'));var _0x124014;return aws[_0x781a('0x75')](_0x135bab,_0x140809,_0x1b6e12,_0x558307,_0x4824fa,_0x5cbec4,_0x591880)['then'](function(){_0x124014=path['resolve'](__dirname,_0x781a('0x24'),rs[_0x781a('0x35')](0x4)+_0x781a('0x25'));return convertFile(_0x591880,_0x124014);})[_0x781a('0x26')](function(){try{fs[_0x781a('0x1a')](_0x591880);fs[_0x781a('0x3a')](_0x124014,_0x781a('0x27'));}catch(_0x1f5950){logger[_0x781a('0x14')](_0x1f5950);}return _0x124014[_0x781a('0x28')]('.')[0x0];});};exports['awsLex']=function(_0x4db967,_0x30bac9,_0x1d29af,_0x4bdfd3,_0x2adc1e,_0x3fc3bf){return aws['lex'](_0x4db967,_0x30bac9,_0x1d29af,_0x4bdfd3,_0x2adc1e,_0x3fc3bf)[_0x781a('0x26')](function(_0x2be668){logger[_0x781a('0x21')](JSON[_0x781a('0x3f')](_0x2be668));return _0x2be668;});};exports[_0x781a('0x76')]=function(_0x3b2063,_0x545127,_0x18c287,_0x1f1495){var _0x415e75=util[_0x781a('0x77')](_0x781a('0x78'),ISPEECH_API,_0x3b2063,encodeURIComponent(_0x545127),_0x18c287,_0x1f1495);var _0x241ce1=path[_0x781a('0x3b')](__dirname,_0x781a('0x24'),rs['generate'](0x4)+'.mp3');var _0xb4576e;return downloadFile(_0x415e75,_0x241ce1)['then'](function(){_0xb4576e=path['resolve'](__dirname,_0x781a('0x24'),rs[_0x781a('0x35')](0x4)+_0x781a('0x25'));return convertFile(_0x241ce1,_0xb4576e);})[_0x781a('0x26')](function(){try{fs[_0x781a('0x1a')](_0x241ce1);fs[_0x781a('0x3a')](_0xb4576e,_0x781a('0x27'));}catch(_0x40532c){logger[_0x781a('0x14')](_0x40532c);}return _0xb4576e[_0x781a('0x28')]('.')[0x0];});};exports['ispeechASR']=function(_0x1a06f0,_0x5751e5,_0x137931,_0x538530){var _0x345421=util[_0x781a('0x77')](_0x781a('0x79'),ISPEECH_API,_0x5751e5,_0x137931,base64Encode(_0x1a06f0),_0x538530?util[_0x781a('0x77')](_0x781a('0x7a'),encodeURIComponent(_0x538530)):_0x781a('0x7b'));return uploadFile(_0x345421)[_0x781a('0x26')](function(_0x481537){return querystring[_0x781a('0xa')](_0x481537);});};exports[_0x781a('0x7c')]=function(_0x26763a,_0x3e4a32){return sestek['nda'](_0x26763a,_0x3e4a32)[_0x781a('0x26')](function(_0x5acd30){logger['info'](JSON[_0x781a('0x3f')](_0x5acd30));var _0x3b4d4e={'speech':_0x5acd30[_0x781a('0x7d')],'action':_0x5acd30[_0x781a('0x7e')]?_0x5acd30[_0x781a('0x7e')][_0x781a('0x7f')]:undefined,'actiondata':_0x5acd30['channelData']?_0x5acd30[_0x781a('0x7e')][_0x781a('0x80')]:undefined};if(_0x5acd30[_0x781a('0x7e')]&&_0x5acd30[_0x781a('0x7e')][_0x781a('0x81')]){return base64Decode(_0x5acd30['channelData'][_0x781a('0x81')]['Data'],path[_0x781a('0x3b')](__dirname,_0x781a('0x24'),rs['generate'](0x4)+_0x781a('0x25')))[_0x781a('0x26')](function(_0x2c06d1){_0x3b4d4e[_0x781a('0x82')]=_0x2c06d1;return _0x3b4d4e;});}return _0x3b4d4e;});};exports[_0x781a('0x83')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 3379a50..0f4b3c0 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 _0x5313=['./nda'];(function(_0x2b8f7c,_0x5756e1){var _0x4ba77d=function(_0x363ac1){while(--_0x363ac1){_0x2b8f7c['push'](_0x2b8f7c['shift']());}};_0x4ba77d(++_0x5756e1);}(_0x5313,0x6e));var _0x3531=function(_0x44bcac,_0x2e413f){_0x44bcac=_0x44bcac-0x0;var _0x50b93e=_0x5313[_0x44bcac];return _0x50b93e;};var nda=require(_0x3531('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x5ff6=['exports','./nda'];(function(_0x2782f8,_0xf6f957){var _0x5e4405=function(_0x21bcce){while(--_0x21bcce){_0x2782f8['push'](_0x2782f8['shift']());}};_0x5e4405(++_0xf6f957);}(_0x5ff6,0x1d1));var _0x65ff=function(_0x37f933,_0x8844e7){_0x37f933=_0x37f933-0x0;var _0x1dd205=_0x5ff6[_0x37f933];return _0x1dd205;};var nda=require(_0x65ff('0x0'));module[_0x65ff('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 6042889..8aef0c1 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 _0xf17f=['resolve','ndauth_url','password','username','then','ndassistant_url','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','access_token','project','body','ProjectName','channelData','CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','exports','POST'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf17f,0x113));var _0xff17=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0xf17f[_0x212579];return _0x55d50e;};'use strict';var rp=require(_0xff17('0x0'));var url=require(_0xff17('0x1'));var logger=require(_0xff17('0x2'))('agi');module[_0xff17('0x3')]=function(_0x482b13,_0x5bcb25){var _0x2330c4={'method':_0xff17('0x4'),'uri':url[_0xff17('0x5')](_0x5bcb25[_0xff17('0x6')],'/token'),'form':{'grant_type':_0xff17('0x7'),'username':_0x5bcb25[_0xff17('0x8')],'password':_0x5bcb25['password']},'json':!![]};return rp(_0x2330c4)[_0xff17('0x9')](function(_0x3a264d){var _0x58e9f8={'method':_0xff17('0x4'),'uri':url[_0xff17('0x5')](_0x5bcb25[_0xff17('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5bcb25[_0xff17('0xb')]||_0xff17('0xc'),'channelId':_0xff17('0xd'),'conversation':{'id':_0x482b13['uniqueid']},'from':{'id':_0x482b13[_0xff17('0xe')],'name':_0x482b13[_0xff17('0xf')]},'recipient':{'id':_0x482b13[_0xff17('0x10')],'name':_0x482b13[_0xff17('0x11')]},'text':_0x5bcb25['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3a264d[_0xff17('0x12')]},'json':!![]};if(_0x5bcb25[_0xff17('0x13')]){_0x58e9f8[_0xff17('0x14')]['channelData'][_0xff17('0x15')]=_0x5bcb25[_0xff17('0x13')];}if(_0x5bcb25['ndagenerate_audio']=='1'){_0x58e9f8[_0xff17('0x14')][_0xff17('0x16')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5bcb25['custom_action']){_0x58e9f8[_0xff17('0x14')]['channelData'][_0xff17('0x17')]=_0x5bcb25[_0xff17('0x18')];if(_0x5bcb25[_0xff17('0x19')]){_0x58e9f8[_0xff17('0x14')][_0xff17('0x16')]['CustomActionData']=_0x5bcb25[_0xff17('0x19')];}}logger[_0xff17('0x1a')](JSON[_0xff17('0x1b')](_0x58e9f8));return rp(_0x58e9f8);});}; \ No newline at end of file +var _0xa1e8=['exports','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','ndaactivity_type','Nda','uniqueid','dnid','extension','text','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','CustomAction','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi'];(function(_0x796734,_0x23296f){var _0x3378ee=function(_0x5a626f){while(--_0x5a626f){_0x796734['push'](_0x796734['shift']());}};_0x3378ee(++_0x23296f);}(_0xa1e8,0x1af));var _0x8a1e=function(_0xb6454a,_0x5576d4){_0xb6454a=_0xb6454a-0x0;var _0x40561f=_0xa1e8[_0xb6454a];return _0x40561f;};'use strict';var rp=require(_0x8a1e('0x0'));var url=require('url');var logger=require(_0x8a1e('0x1'))(_0x8a1e('0x2'));module[_0x8a1e('0x3')]=function(_0x55e9fc,_0x4e112e){var _0x5dd1f6={'method':_0x8a1e('0x4'),'uri':url[_0x8a1e('0x5')](_0x4e112e[_0x8a1e('0x6')],_0x8a1e('0x7')),'form':{'grant_type':'password','username':_0x4e112e[_0x8a1e('0x8')],'password':_0x4e112e[_0x8a1e('0x9')]},'json':!![]};return rp(_0x5dd1f6)[_0x8a1e('0xa')](function(_0x238e9e){var _0x483e06={'method':_0x8a1e('0x4'),'uri':url[_0x8a1e('0x5')](_0x4e112e[_0x8a1e('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4e112e[_0x8a1e('0xc')]||'message','channelId':_0x8a1e('0xd'),'conversation':{'id':_0x55e9fc[_0x8a1e('0xe')]},'from':{'id':_0x55e9fc['callerid'],'name':_0x55e9fc['calleridname']},'recipient':{'id':_0x55e9fc[_0x8a1e('0xf')],'name':_0x55e9fc[_0x8a1e('0x10')]},'text':_0x4e112e[_0x8a1e('0x11')],'channelData':{}},'headers':{'Authorization':_0x8a1e('0x12')+_0x238e9e[_0x8a1e('0x13')]},'json':!![]};if(_0x4e112e[_0x8a1e('0x14')]){_0x483e06[_0x8a1e('0x15')]['channelData'][_0x8a1e('0x16')]=_0x4e112e[_0x8a1e('0x14')];}if(_0x4e112e[_0x8a1e('0x17')]=='1'){_0x483e06['body'][_0x8a1e('0x18')][_0x8a1e('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8a1e('0x1a')};}if(_0x4e112e['custom_action']){_0x483e06[_0x8a1e('0x15')][_0x8a1e('0x18')][_0x8a1e('0x1b')]=_0x4e112e['custom_action'];if(_0x4e112e['custom_action_data']){_0x483e06['body'][_0x8a1e('0x18')][_0x8a1e('0x1c')]=_0x4e112e['custom_action_data'];}}logger[_0x8a1e('0x1d')](JSON[_0x8a1e('0x1e')](_0x483e06));return rp(_0x483e06);});}; \ 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 73f0573..421abe2 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 _0xc5c0=['exports','./lib/api'];(function(_0x1a124d,_0x3e04b0){var _0x5f0830=function(_0x1e0ce3){while(--_0x1e0ce3){_0x1a124d['push'](_0x1a124d['shift']());}};_0x5f0830(++_0x3e04b0);}(_0xc5c0,0x125));var _0x0c5c=function(_0x49cdca,_0x634792){_0x49cdca=_0x49cdca-0x0;var _0x36e943=_0xc5c0[_0x49cdca];return _0x36e943;};'use strict';var asr=require(_0x0c5c('0x0'));module[_0x0c5c('0x1')]=function(_0x5b9265,_0x1cec6e,_0x33349d,_0x4162d9){return asr(_0x5b9265,_0x1cec6e,_0x33349d,_0x4162d9);}; \ No newline at end of file +var _0x30d0=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x30d0,0x166));var _0x030d=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x30d0[_0x1f36bb];return _0xaf97fa;};'use strict';var asr=require('./lib/api');module[_0x030d('0x0')]=function(_0x2f61a6,_0x82b760,_0x1d7945,_0x56afd8){return asr(_0x2f61a6,_0x82b760,_0x1d7945,_0x56afd8);}; \ 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 5f4d24a..c7cee31 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 _0xae96=['Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','data','close','send','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','stringify','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xae96,0x188));var _0x6ae9=function(_0x5db17e,_0x321c86){_0x5db17e=_0x5db17e-0x0;var _0x1d444e=_0xae96[_0x5db17e];return _0x1d444e;};'use strict';var BPromise=require(_0x6ae9('0x0'));var _=require(_0x6ae9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6ae9('0x2'));var crypto=require(_0x6ae9('0x3'));var logger=require(_0x6ae9('0x4'))(_0x6ae9('0x5'));module[_0x6ae9('0x6')]=function(_0x4dab4e,_0x2b787b,_0x3b760b,_0x4a348c){return new BPromise(function(_0x17f447,_0xae76f2){logger[_0x6ae9('0x7')](_0x6ae9('0x8'),_0x4a348c||_0x6ae9('0x9'));var _0x55d9e9=new WebSocket(_0x4a348c||_0x6ae9('0x9'),{'perMessageDeflate':![]});var _0x119d10='';var _0x24f63c='0';var _0x27b69c='1';var _0x2a374e=_0x6ae9('0xa');function _0x252ed2(_0x537b26){var _0x39aac5=crypto['createHash']('sha1');_0x39aac5[_0x6ae9('0xb')](_0x537b26);return _0x39aac5['digest'](_0x6ae9('0xc'));}function _0x4e1c06(){try{logger[_0x6ae9('0x7')](_0x6ae9('0xd'));var _0x421c12=moment()[_0x6ae9('0xe')]();var _0x6ff912=_0x252ed2(_0x421c12+_0x2b787b+_0x3b760b);_0x55d9e9['send'](JSON['stringify']({'appID':_0x2b787b,'timestamp':_0x421c12,'appKey':_0x6ff912}));var _0x1409b6=fs[_0x6ae9('0xf')](_0x4dab4e);_0x1409b6['on'](_0x6ae9('0x10'),function(_0x18720b){_0x55d9e9['send'](_0x18720b);});_0x1409b6['on'](_0x6ae9('0x11'),function(){_0x55d9e9[_0x6ae9('0x12')](_0x6ae9('0x13'));});}catch(_0x255b15){logger[_0x6ae9('0x14')](_0x6ae9('0x15'),JSON['stringify'](_0x255b15));_0x55d9e9[_0x6ae9('0x16')]();}}function _0x4e00e1(_0x30af96){try{if(_0x30af96){var _0xc1d8a9=JSON[_0x6ae9('0x17')](_0x30af96);switch(_0xc1d8a9[_0x6ae9('0x18')]){case 0x0:if(_0xc1d8a9[_0x6ae9('0x19')]){if(_0xc1d8a9[_0x6ae9('0x19')][_0x6ae9('0x1a')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0xc1d8a9['result'][_0x6ae9('0x1b')]));_0x119d10=_0xc1d8a9['result'][_0x6ae9('0x1b')][0x0][_0x6ae9('0x1c')];_0x24f63c=_0xc1d8a9[_0x6ae9('0x19')][_0x6ae9('0x1b')][0x0][_0x6ae9('0x1d')];_0x27b69c='0';_0x2a374e=_0x6ae9('0x1e');_0x55d9e9[_0x6ae9('0x16')]();}}break;case 0x1:logger[_0x6ae9('0x7')](_0x6ae9('0xa'));_0x27b69c='1';_0x2a374e=_0x6ae9('0xa');break;case 0x2:logger[_0x6ae9('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x27b69c='2';_0x2a374e=_0x6ae9('0x1f');break;case 0x9:logger[_0x6ae9('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x27b69c='9';_0x2a374e='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x6ae9('0x20'));_0x27b69c='10';_0x2a374e=_0x6ae9('0x20');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x27b69c='11';_0x2a374e=_0x6ae9('0x21');}}}catch(_0x5dc439){logger[_0x6ae9('0x14')](_0x6ae9('0x22'),JSON['stringify'](_0x5dc439));_0x55d9e9['terminate']();}}function _0x2f5bed(){logger[_0x6ae9('0x7')](_0x6ae9('0x23'));_0x17f447({'transcript':_0x119d10,'confidence':_0x24f63c,'status':_0x27b69c,'status_message':_0x2a374e});}function _0x4da971(_0x5cd0e3){logger[_0x6ae9('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x6ae9('0x24')](_0x5cd0e3)){logger[_0x6ae9('0x14')](_[_0x6ae9('0x25')](_0x5cd0e3)?JSON[_0x6ae9('0x26')](_0x5cd0e3):_0x5cd0e3);}}_0x55d9e9['on']('open',_0x4e1c06);_0x55d9e9['on'](_0x6ae9('0x27'),_0x4e00e1);_0x55d9e9['on'](_0x6ae9('0x11'),_0x2f5bed);_0x55d9e9['on'](_0x6ae9('0x14'),_0x4da971);});}; \ No newline at end of file +var _0xd016=['crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','unix','send','stringify','createReadStream','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','bluebird','lodash','moment'];(function(_0x205635,_0x29aca0){var _0x4a4a9e=function(_0x2bcb4e){while(--_0x2bcb4e){_0x205635['push'](_0x205635['shift']());}};_0x4a4a9e(++_0x29aca0);}(_0xd016,0x1e9));var _0x6d01=function(_0x491e91,_0x25743b){_0x491e91=_0x491e91-0x0;var _0x25ae85=_0xd016[_0x491e91];return _0x25ae85;};'use strict';var BPromise=require(_0x6d01('0x0'));var _=require(_0x6d01('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6d01('0x2'));var crypto=require(_0x6d01('0x3'));var logger=require(_0x6d01('0x4'))(_0x6d01('0x5'));module['exports']=function(_0x5d6c26,_0x338d75,_0x3da001,_0x559ad4){return new BPromise(function(_0x6823ae,_0x30e190){logger[_0x6d01('0x6')](_0x6d01('0x7'),_0x559ad4||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x346fca=new WebSocket(_0x559ad4||_0x6d01('0x8'),{'perMessageDeflate':![]});var _0x338dd7='';var _0x4aca55='0';var _0xee4dfd='1';var _0x30dfef='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x32ae2c(_0x3fb585){var _0x509dc2=crypto['createHash'](_0x6d01('0x9'));_0x509dc2[_0x6d01('0xa')](_0x3fb585);return _0x509dc2[_0x6d01('0xb')](_0x6d01('0xc'));}function _0x4ed5ca(){try{logger[_0x6d01('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x46d7a8=moment()[_0x6d01('0xd')]();var _0x56675d=_0x32ae2c(_0x46d7a8+_0x338d75+_0x3da001);_0x346fca[_0x6d01('0xe')](JSON[_0x6d01('0xf')]({'appID':_0x338d75,'timestamp':_0x46d7a8,'appKey':_0x56675d}));var _0x4bbc8c=fs[_0x6d01('0x10')](_0x5d6c26);_0x4bbc8c['on']('data',function(_0x25e9e3){_0x346fca[_0x6d01('0xe')](_0x25e9e3);});_0x4bbc8c['on']('close',function(){_0x346fca[_0x6d01('0xe')](_0x6d01('0x11'));});}catch(_0x3f3bea){logger[_0x6d01('0x12')](_0x6d01('0x13'),JSON[_0x6d01('0xf')](_0x3f3bea));_0x346fca[_0x6d01('0x14')]();}}function _0x39dba1(_0x46121c){try{if(_0x46121c){var _0x1c27a5=JSON[_0x6d01('0x15')](_0x46121c);switch(_0x1c27a5['status']){case 0x0:if(_0x1c27a5[_0x6d01('0x16')]){if(_0x1c27a5[_0x6d01('0x16')][_0x6d01('0x17')]){logger['info'](_0x6d01('0x18'),JSON['stringify'](_0x1c27a5[_0x6d01('0x16')][_0x6d01('0x19')]));_0x338dd7=_0x1c27a5[_0x6d01('0x16')][_0x6d01('0x19')][0x0][_0x6d01('0x1a')];_0x4aca55=_0x1c27a5[_0x6d01('0x16')][_0x6d01('0x19')][0x0][_0x6d01('0x1b')];_0xee4dfd='0';_0x30dfef=_0x6d01('0x1c');_0x346fca[_0x6d01('0x14')]();}}break;case 0x1:logger[_0x6d01('0x6')](_0x6d01('0x1d'));_0xee4dfd='1';_0x30dfef=_0x6d01('0x1d');break;case 0x2:logger[_0x6d01('0x6')](_0x6d01('0x1e'));_0xee4dfd='2';_0x30dfef=_0x6d01('0x1e');break;case 0x9:logger[_0x6d01('0x6')](_0x6d01('0x1f'));_0xee4dfd='9';_0x30dfef=_0x6d01('0x1f');break;case 0xa:logger['info'](_0x6d01('0x20'));_0xee4dfd='10';_0x30dfef=_0x6d01('0x20');break;case 0xb:logger[_0x6d01('0x6')](_0x6d01('0x21'));_0xee4dfd='11';_0x30dfef=_0x6d01('0x21');}}}catch(_0x5bc1a6){logger[_0x6d01('0x12')](_0x6d01('0x22'),JSON[_0x6d01('0xf')](_0x5bc1a6));_0x346fca[_0x6d01('0x14')]();}}function _0x323aec(){logger[_0x6d01('0x6')](_0x6d01('0x23'));_0x6823ae({'transcript':_0x338dd7,'confidence':_0x4aca55,'status':_0xee4dfd,'status_message':_0x30dfef});}function _0x673df3(_0x7c8275){logger[_0x6d01('0x12')](_0x6d01('0x24'));if(!_[_0x6d01('0x25')](_0x7c8275)){logger[_0x6d01('0x12')](_[_0x6d01('0x26')](_0x7c8275)?JSON['stringify'](_0x7c8275):_0x7c8275);}}_0x346fca['on']('open',_0x4ed5ca);_0x346fca['on'](_0x6d01('0x27'),_0x39dba1);_0x346fca['on'](_0x6d01('0x28'),_0x323aec);_0x346fca['on'](_0x6d01('0x12'),_0x673df3);});}; \ 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 00e6061..420d4fe 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 _0x35e4=['./asr','exports'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x35e4,0x134));var _0x435e=function(_0x4677dc,_0x496395){_0x4677dc=_0x4677dc-0x0;var _0x1d1587=_0x35e4[_0x4677dc];return _0x1d1587;};var asr=require(_0x435e('0x0'));module[_0x435e('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe199=['./asr'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0xe199,0x1ea));var _0x9e19=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0xe199[_0x29d623];return _0x242e59;};var asr=require(_0x9e19('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 7dcdebe..08bd206 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x4fd905,_0x529ac1){var _0x2d3204=function(_0x3e5e89){while(--_0x3e5e89){_0x4fd905['push'](_0x4fd905['shift']());}};_0x2d3204(++_0x529ac1);}(_0x34e8,0x12c));var _0x834e=function(_0x492b28,_0x2343e9){_0x492b28=_0x492b28-0x0;var _0x50b23b=_0x34e8[_0x492b28];return _0x50b23b;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 6c6a405..03c97d7 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 _0x0b78=['getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','interval','map','Intervals','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','close','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','calleridname','context','extension','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','text','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','toUpperCase','parse','rawBody','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','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','mrcpsynth','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','Trying\x20aws\x20Polly\x20%s','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','Smtp','user','bcc','subject','template_id','debug','smtpOptions','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','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','XMCS-UNIQUEID','answer','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0x0b78,0x1ad));var _0x80b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b78[_0xfae23b];return _0x200640;};'use strict';var fs=require('fs');var util=require(_0x80b7('0x0'));var _=require(_0x80b7('0x1'));var sh=require('shelljs');var odbc=require(_0x80b7('0x2'))();var rs=require(_0x80b7('0x3'));var moment=require('moment');var Mustache=require(_0x80b7('0x4'));var rp=require('request-promise');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x80b7('0x8'),'rawBody'];var verticesWithRetry=[_0x80b7('0x9'),_0x80b7('0xa'),_0x80b7('0xb')];var AGIVertices=function(_0x445c23,_0x5b8fe9,_0x74b4a8){this[_0x80b7('0xc')]=_0x445c23;this[_0x80b7('0xd')]=_0x5b8fe9;this['mailRpc']=_0x74b4a8;};AGIVertices[_0x80b7('0xe')]['getVariable']=function(_0x2b1a00,_0x4599c1){this[_0x80b7('0xd')][_0x80b7('0xf')](_0x2b1a00)[_0x80b7('0x10')](function(_0x2d61d4){_0x4599c1(null,_0x2d61d4?_0x2d61d4[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x323d06){_0x4599c1(_0x323d06);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x13')]=function(_0x519401,_0x2c2668){this[_0x80b7('0xd')]['getVoiceQueueById'](_0x519401)[_0x80b7('0x10')](function(_0x1a6317){_0x2c2668(null,_0x1a6317?_0x1a6317['name']:![]);})[_0x80b7('0x12')](function(_0x3b6b13){_0x2c2668(_0x3b6b13);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x14')]=function(_0x36d0bb,_0x352805){this[_0x80b7('0xd')][_0x80b7('0x15')](_0x36d0bb)[_0x80b7('0x10')](function(_0x34299c){_0x352805(null,_0x34299c?_0x34299c['name']:![]);})[_0x80b7('0x12')](function(_0x1d62ed){_0x352805(_0x1d62ed);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x16')]=function(_0x58dbda,_0x48c356){this[_0x80b7('0xd')][_0x80b7('0x17')](_0x58dbda)[_0x80b7('0x10')](function(_0xd51ad9){_0x48c356(null,_0xd51ad9?_0xd51ad9['dsn']:![]);})['catch'](function(_0x2aebe3){_0x48c356(_0x2aebe3);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x18')]=function(_0x3ad8c1,_0x527d0f){this[_0x80b7('0xd')]['getUserById'](_0x3ad8c1)['then'](function(_0x37dd00){_0x527d0f(null,_0x37dd00?_0x37dd00[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x155c00){_0x527d0f(_0x155c00);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x19')]=function(_0x29a4e6,_0x8fa95e){this[_0x80b7('0xd')][_0x80b7('0x1a')](_0x29a4e6)[_0x80b7('0x10')](function(_0x311aa3){_0x8fa95e(null,_0x311aa3?_0x311aa3[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x3995b5){_0x8fa95e(_0x3995b5);});};AGIVertices['prototype'][_0x80b7('0x1b')]=function(_0x1661be,_0x5e3f6f){var _0x370bfb=this;this[_0x80b7('0xd')][_0x80b7('0x1c')](_0x1661be)['then'](function(_0x1b7715){_0x5e3f6f(null,_0x1b7715?_0x370bfb[_0x80b7('0x1d')](_0x1b7715[_0x80b7('0x1e')]):![]);})[_0x80b7('0x12')](function(_0x1c4607){_0x5e3f6f(_0x1c4607);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1f')]=function(_0x44f03e,_0x3fbdf3){this[_0x80b7('0xd')][_0x80b7('0x20')](_0x44f03e)[_0x80b7('0x10')](function(_0xf35e83){_0x3fbdf3(null,_0xf35e83?_0xf35e83:![]);})['catch'](function(_0x5a65b0){_0x3fbdf3(_0x5a65b0);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x21')]=function(_0x4fa26a,_0x4e8557,_0x106921){this[_0x80b7('0x22')][_0x80b7('0x21')](_0x4fa26a,_0x4e8557)[_0x80b7('0x10')](function(){_0x106921(null);})[_0x80b7('0x12')](function(_0x2339cf){_0x106921(_0x2339cf);});};AGIVertices['prototype'][_0x80b7('0x23')]=function(_0x1f9041,_0x6e7535){this[_0x80b7('0xd')]['getIntervalById'](_0x1f9041)[_0x80b7('0x10')](function(_0x25335e){if(_0x25335e){if(_0x25335e['IntervalId']){_0x6e7535(null,[_0x25335e[_0x80b7('0x24')]]);}else{_0x6e7535(null,_[_0x80b7('0x25')](_0x25335e[_0x80b7('0x26')],_0x80b7('0x24')));}}else{_0x6e7535(null,![]);}})[_0x80b7('0x12')](function(_0xfbd58e){_0x6e7535(_0xfbd58e);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1d')]=function(_0x4c7084){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x4c7084);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x27')]=function(_0x6f55,_0x28cc08,_0x462eb0){odbc[_0x80b7('0x28')](_0x6f55,function(_0x1c2341){if(_0x1c2341){logger[_0x80b7('0x29')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1c2341);_0x462eb0(_0x1c2341);}else{logger[_0x80b7('0x2a')](_0x80b7('0x2b'));odbc[_0x80b7('0x2c')](_0x28cc08,function(_0x44acf2,_0x44cfcd){if(_0x44acf2){logger[_0x80b7('0x2a')]('Error\x20executing\x20query\x20%s',_0x28cc08);_0x462eb0(_0x44acf2);}else{logger[_0x80b7('0x2a')]('Query\x20executed\x20correctly\x20%s',_0x28cc08);odbc[_0x80b7('0x2d')](function(_0x1a6e69){if(_0x1a6e69){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1a6e69);}_0x462eb0(null,_0x44cfcd);});}});}});};AGIVertices[_0x80b7('0xe')]['getSmsAccount']=function(_0x5c91d8,_0x295ca6){this[_0x80b7('0xd')]['getSmsAccountById'](_0x5c91d8)[_0x80b7('0x10')](function(_0x196f48){_0x295ca6(null,_0x196f48?_0x196f48:![]);})['catch'](function(_0x59e0c4){_0x295ca6(_0x59e0c4);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x2e')]=function(_0x3b89b4,_0x29170c){this[_0x80b7('0xd')][_0x80b7('0x2e')](_0x3b89b4)['then'](function(_0x1c28d2){_0x29170c(null,_0x1c28d2);})[_0x80b7('0x12')](function(_0x2cb860){_0x29170c(_0x2cb860);});};AGIVertices[_0x80b7('0xe')]['createSquareDetailsReport']=function(_0x20a9b9,_0x5741ec,_0x382fd7){this[_0x80b7('0xd')][_0x80b7('0x2f')]({'uniqueid':this[_0x80b7('0xc')][_0x80b7('0x30')],'node':_0x20a9b9[_0x80b7('0x31')],'application':_0x20a9b9[_0x80b7('0x32')],'data':_0x5741ec||null,'project_name':this[_0x80b7('0xc')][_0x80b7('0x33')],'callerid':this[_0x80b7('0xc')][_0x80b7('0x34')]})[_0x80b7('0x10')](function(_0x1384b7){if(_0x382fd7){_0x382fd7(null,_0x1384b7);}})['catch'](function(_0x311142){if(_0x382fd7){_0x382fd7(_0x311142);}});};AGIVertices[_0x80b7('0xe')]['createSquareRecording']=function(_0x435022,_0x5ac956,_0x4ef52d,_0x4418c3){this['rpc']['createSquareRecording']({'uniqueid':this[_0x80b7('0xc')][_0x80b7('0x30')],'callerid':this['channel'][_0x80b7('0x34')],'calleridname':this[_0x80b7('0xc')][_0x80b7('0x35')],'context':this['channel'][_0x80b7('0x36')],'extension':this[_0x80b7('0xc')][_0x80b7('0x37')],'priority':this[_0x80b7('0xc')]['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0x80b7('0xc')][_0x80b7('0x38')],'projectName':this[_0x80b7('0xc')][_0x80b7('0x33')],'saveName':_0x5ac956,'filename':_0x435022[_0x80b7('0x39')]||_0x5ac956,'savePath':_0x4ef52d})[_0x80b7('0x10')](function(_0x398925){_0x4418c3(null,_0x398925);})[_0x80b7('0x12')](function(_0x4a6cb5){_0x4418c3(_0x4a6cb5);});};AGIVertices['prototype'][_0x80b7('0x3a')]=function(_0x13ebaa,_0x3d01c6,_0x2d9168,_0x1fff8c,_0x2da4a1){this['rpc'][_0x80b7('0x3a')]({'uniqueid':this[_0x80b7('0xc')]['uniqueid'],'body':_0x13ebaa,'direction':_0x3d01c6,'providerName':_0x2d9168,'providerResponse':_0x1fff8c})[_0x80b7('0x10')](function(_0x40b524){if(_0x2da4a1){_0x2da4a1(null,_0x40b524);}})[_0x80b7('0x12')](function(_0x49ada9){if(_0x2da4a1){_0x2da4a1(_0x49ada9);}});};AGIVertices['prototype'][_0x80b7('0x3b')]=function(_0x66202,_0xbc9686){this[_0x80b7('0xd')][_0x80b7('0x3b')]({'firstName':_[_0x80b7('0x3c')](_0x66202['name'])||_[_0x80b7('0x3d')](_0x66202[_0x80b7('0x11')])?_0x80b7('0x3e')+Math[_0x80b7('0x3f')]():_0x66202[_0x80b7('0x11')],'lastName':_['isEmpty'](_0x66202['lastName'])||_[_0x80b7('0x3d')](_0x66202[_0x80b7('0x40')])?null:_0x66202[_0x80b7('0x40')],'phone':_0x66202['phone'],'ListId':_0x66202[_0x80b7('0x41')],'scheduledat':_0x66202['scheduledAt'],'callbackUniqueid':this[_0x80b7('0xc')][_0x80b7('0x30')],'tags':_0x80b7('0x42'),'description':_0x80b7('0x43')+_0x66202[_0x80b7('0x44')][_0x80b7('0x45')](),'priority':_0x66202[_0x80b7('0x46')]})[_0x80b7('0x10')](function(_0x43ea4f){_0xbc9686(null,_0x43ea4f);})[_0x80b7('0x12')](function(_0x1c408c){_0xbc9686(_0x1c408c);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x47')]=function(_0x10aebd,_0x5215f1){this[_0x80b7('0xd')][_0x80b7('0x48')](_0x10aebd)[_0x80b7('0x10')](function(_0x41c23c){_0x5215f1(null,_0x41c23c?_0x41c23c[_0x80b7('0x11')]:![]);})[_0x80b7('0x12')](function(_0x197c00){_0x5215f1(_0x197c00);});};AGIVertices['prototype'][_0x80b7('0x49')]=function(_0x23f06f,_0xc4b38,_0x251b87){var _0x48c39f={'role':_0x80b7('0x4a')};_0x48c39f[_0x23f06f]=this[_0x80b7('0xc')]['callerid'];this[_0x80b7('0xd')][_0x80b7('0x49')](_0x48c39f,_0xc4b38,this['channel'][_0x80b7('0x30')])[_0x80b7('0x10')](function(_0x56fd5e){_0x251b87(null,_['isNil'](_0x56fd5e)?![]:!![]);})[_0x80b7('0x12')](function(_0x5e256b){logger[_0x80b7('0x29')](_0x5e256b);_0x251b87(null,![]);});};AGIVertices[_0x80b7('0xe')]['agentUnpause']=function(_0x1ec5ee,_0x151939){var _0x4e3851={'role':_0x80b7('0x4a')};_0x4e3851[_0x1ec5ee]=this[_0x80b7('0xc')][_0x80b7('0x34')];this[_0x80b7('0xd')][_0x80b7('0x4b')](_0x4e3851)[_0x80b7('0x10')](function(_0x222466){_0x151939(null,_[_0x80b7('0x3d')](_0x222466)?![]:!![]);})[_0x80b7('0x12')](function(_0x5f255e){logger['error'](_0x5f255e);_0x151939(null,![]);});};AGIVertices[_0x80b7('0xe')]['agentLogout']=function(_0x24f889,_0x21d013){var _0x25fc84={'role':'agent'};_0x25fc84[_0x24f889]=this[_0x80b7('0xc')][_0x80b7('0x34')];this['rpc'][_0x80b7('0x4c')](_0x25fc84)[_0x80b7('0x10')](function(_0x4370b8){_0x21d013(null,_[_0x80b7('0x3d')](_0x4370b8)?![]:!![]);})['catch'](function(_0x5818f2){logger[_0x80b7('0x29')](_0x5818f2);_0x21d013(null,![]);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x4d')]=function(_0x54ec05,_0x502757){var _0x38867e={'role':_0x80b7('0x4a')};_0x38867e[_0x54ec05]=this[_0x80b7('0xc')]['callerid'];var _0x33b76f=_0x54ec05!=_0x80b7('0x4e')?util[_0x80b7('0x4f')](_0x80b7('0x50'),'LOCAL',this['channel'][_0x80b7('0x34')]):undefined;this[_0x80b7('0xd')]['agentLogin'](_0x38867e,_0x33b76f)['then'](function(_0x50a69b){_0x502757(null,_['isNil'](_0x50a69b)?![]:!![]);})[_0x80b7('0x12')](function(_0x500401){logger['error'](_0x500401);_0x502757(null,![]);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x51')]=function(_0x2ace46,_0x1fe9e6){sh[_0x80b7('0x52')](_[_0x80b7('0x53')](_0x2ace46),function(_0x328854,_0x28647a){var _0x3e5149=_0x28647a['replace'](/(\r\n|\n|\r)/gm,'');_0x1fe9e6(null,_0x3e5149);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x3fe3c3,_0x2dd01c){scripts[_0x80b7('0x54')](_0x3fe3c3[_0x80b7('0x55')],_0x3fe3c3['google_cloud_tts_text_type']||_0x80b7('0x56'),_0x3fe3c3[_0x80b7('0x56')],_0x3fe3c3['languageCode']||'en-US',_0x3fe3c3['ssmlGender']||_0x80b7('0x57'),_0x3fe3c3[_0x80b7('0x58')]||'MP3')[_0x80b7('0x10')](function(_0x4bf950){_0x2dd01c(null,_0x4bf950);})['catch'](function(_0x4d378a){_0x2dd01c(_0x4d378a);});};AGIVertices['prototype']['googleTTS']=function(_0x4b5e01,_0x5e8526){scripts[_0x80b7('0x59')](_0x4b5e01['text'],_0x4b5e01[_0x80b7('0x5a')]||'en',0x1)['then'](function(_0x2fd411){_0x5e8526(null,_0x2fd411);})[_0x80b7('0x12')](function(_0x2a6c1b){_0x5e8526(_0x2a6c1b);});};AGIVertices['prototype'][_0x80b7('0x5b')]=function(_0x37e1c8,_0x482cfc){var _0x190c5a={'uri':_0x37e1c8[_0x80b7('0x5c')],'method':_0x37e1c8['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37e1c8[_0x80b7('0x5d')])===_0x80b7('0x5e')&&parseInt(_0x37e1c8[_0x80b7('0x5d')])>=0x1?parseInt(_0x37e1c8['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x80b7('0x5f')](['POST','PUT'],_0x190c5a['method'][_0x80b7('0x60')]())){try{_0x190c5a['body']=_0x37e1c8['rawBody']?JSON[_0x80b7('0x61')](_0x37e1c8[_0x80b7('0x62')]):{};}catch(_0x104afb){logger[_0x80b7('0x29')](_0x80b7('0x63'),_0x104afb);}}try{_0x190c5a[_0x80b7('0x64')]=_0x37e1c8[_0x80b7('0x8')]?JSON[_0x80b7('0x61')](_0x37e1c8[_0x80b7('0x8')]):{};}catch(_0x23df14){logger[_0x80b7('0x29')](_0x80b7('0x65'),_0x23df14);}if(_0x37e1c8['computedVariables']){try{var _0x270ea6=require(_0x37e1c8[_0x80b7('0x66')])[_0x80b7('0x67')](this,_0x190c5a);_0x190c5a['uri']=Mustache[_0x80b7('0x68')](_0x37e1c8[_0x80b7('0x5c')],_0x270ea6,{},['$$','$$']);if(_0x190c5a[_0x80b7('0x64')]){_0x190c5a[_0x80b7('0x64')]=JSON[_0x80b7('0x61')](Mustache[_0x80b7('0x68')](JSON[_0x80b7('0x69')](_0x190c5a[_0x80b7('0x64')]),_0x270ea6,{},['$$','$$']));}if(_0x190c5a['body']){_0x190c5a[_0x80b7('0x6a')]=JSON[_0x80b7('0x61')](Mustache[_0x80b7('0x68')](JSON['stringify'](_0x190c5a['body']),_0x270ea6,{},['$$','$$']));}}catch(_0xb22b8b){logger[_0x80b7('0x29')](_0x80b7('0x6b'),_0xb22b8b);}}rp(_0x190c5a)[_0x80b7('0x10')](function(_0x56d823){var _0x400bd0={'statusCode':_0x56d823[_0x80b7('0x6c')]||0xc8,'statusMessage':_0x56d823[_0x80b7('0x6d')]||'OK','headers':_0x56d823[_0x80b7('0x64')]||{},'body':_0x56d823['body']||{}};_0x482cfc(null,_0x400bd0);})[_0x80b7('0x12')](function(_0xa4a6e){var _0x55d727={'statusCode':_0xa4a6e['statusCode']||0x1f4,'statusMessage':_0xa4a6e[_0x80b7('0x6e')]||_0x80b7('0x6f'),'headers':_0xa4a6e[_0x80b7('0x70')][_0x80b7('0x64')]||{},'body':_0xa4a6e[_0x80b7('0x70')][_0x80b7('0x6a')]||{}};_0x482cfc(null,_0x55d727);});};AGIVertices['prototype'][_0x80b7('0x71')]=function(_0x13524c,_0x29aade){scripts['googleDialogflow'](this[_0x80b7('0xc')][_0x80b7('0x30')],_0x13524c[_0x80b7('0x72')],_0x13524c[_0x80b7('0x56')],_0x13524c[_0x80b7('0x73')]||'en')['then'](function(_0x133ce6){_0x29aade(null,_0x133ce6);})[_0x80b7('0x12')](function(_0x50b229){_0x29aade(_0x50b229);});};AGIVertices[_0x80b7('0xe')]['googleDialogflowV2']=function(_0x2fc6e8,_0x58d164){scripts[_0x80b7('0x74')](this[_0x80b7('0xc')]['uniqueid'],_0x2fc6e8[_0x80b7('0x75')],_0x2fc6e8[_0x80b7('0x76')],_0x2fc6e8[_0x80b7('0x77')],_0x2fc6e8[_0x80b7('0x56')],_0x2fc6e8[_0x80b7('0x78')]||'en')['then'](function(_0x57965f){_0x58d164(null,_0x57965f);})['catch'](function(_0x13bb33){_0x58d164(_0x13bb33);});};AGIVertices[_0x80b7('0xe')]['sestekNDA']=function(_0x5de47f,_0x186d10){scripts[_0x80b7('0x79')](this[_0x80b7('0xc')],_0x5de47f)[_0x80b7('0x10')](function(_0x176471){_0x186d10(null,_0x176471);})[_0x80b7('0x12')](function(_0x3216f9){_0x186d10(_0x3216f9);});};AGIVertices['prototype'][_0x80b7('0x7a')]=function(_0x2840d5,_0x355253){scripts[_0x80b7('0x7a')](_0x2840d5[_0x80b7('0x72')],_0x2840d5[_0x80b7('0x56')],_0x2840d5[_0x80b7('0x7b')]||_0x80b7('0x7c'),_0x2840d5[_0x80b7('0x7d')])['then'](function(_0x45e613){_0x355253(null,_0x45e613);})[_0x80b7('0x12')](function(_0x27ee8d){_0x355253(_0x27ee8d);});};AGIVertices[_0x80b7('0xe')]['ispeechASR']=function(_0x100942,_0x30603d,_0x4e7950){scripts[_0x80b7('0x7e')](_0x30603d,_0x100942[_0x80b7('0x72')],_0x100942[_0x80b7('0x7f')]||_0x80b7('0x7c'),this['isConfigured'](_0x100942[_0x80b7('0x80')])?_0x100942[_0x80b7('0x80')]:undefined)[_0x80b7('0x10')](function(_0x3f912a){_0x4e7950(null,_0x3f912a);})['catch'](function(_0x3ba543){_0x4e7950(_0x3ba543);});};AGIVertices['prototype'][_0x80b7('0x81')]=function(_0xaa27df,_0x4a1553){scripts[_0x80b7('0x81')](_0xaa27df[_0x80b7('0x82')],_0xaa27df['aws_secret_access_key'],_0xaa27df[_0x80b7('0x83')],_0xaa27df[_0x80b7('0x84')]||'Amy',_0xaa27df[_0x80b7('0x56')],_0xaa27df[_0x80b7('0x85')]||_0x80b7('0x56'))['then'](function(_0xeb7511){_0x4a1553(null,_0xeb7511);})[_0x80b7('0x12')](function(_0x17b8fd){_0x4a1553(_0x17b8fd);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x86')]=function(_0x3f1252,_0x1e0dd8){scripts[_0x80b7('0x86')](this[_0x80b7('0xc')][_0x80b7('0x30')],_0x3f1252['aws_access_key_id'],_0x3f1252['aws_secret_access_key'],_0x3f1252[_0x80b7('0x87')],_0x3f1252[_0x80b7('0x56')],_0x3f1252[_0x80b7('0x88')])[_0x80b7('0x10')](function(_0x22511a){_0x1e0dd8(null,_0x22511a);})['catch'](function(_0x3cd455){_0x1e0dd8(_0x3cd455);});};AGIVertices[_0x80b7('0xe')][_0x80b7('0x89')]=function(_0x6023a4,_0x5770d6,_0x48274e){scripts['googleASR'](_0x5770d6,_0x6023a4[_0x80b7('0x72')],_0x6023a4['google_asr_language']||_0x80b7('0x7c'))[_0x80b7('0x10')](function(_0x410182){_0x48274e(null,_0x410182);})[_0x80b7('0x12')](function(_0x35cc6e){_0x48274e(_0x35cc6e);});};AGIVertices[_0x80b7('0xe')]['tildeASR']=function(_0x339a21,_0x34e00,_0x395507){scripts[_0x80b7('0x8a')](_0x34e00,_0x339a21[_0x80b7('0x8b')],_0x339a21[_0x80b7('0x8c')],_0x339a21['uri'])[_0x80b7('0x10')](function(_0xa826cc){_0x395507(null,_0xa826cc);})[_0x80b7('0x12')](function(_0x21fb22){_0x395507(_0x21fb22);});};AGIVertices[_0x80b7('0xe')]['clear']=function(_0xd90591){var _0x13d090=_['includes'](verticesWithRetry,_0xd90591[_0x80b7('0x32')])?_0xd90591:_[_0x80b7('0x8d')](_0xd90591);for(var _0x59e878 in _0x13d090){if(_0x13d090[_0x80b7('0x8e')](_0x59e878)){if(_0x13d090[_0x59e878]&&_[_0x80b7('0x8f')](_0x13d090[_0x59e878])){if(_[_0x80b7('0x5f')](recursiveMapAttributes,_0x59e878)){_0x13d090[_0x59e878]=this[_0x80b7('0x90')](_0x13d090[_0x59e878]);}else{_0x13d090[_0x59e878]=this[_0x80b7('0x91')](_0x13d090[_0x59e878]);}}}}return _0x13d090;};AGIVertices[_0x80b7('0xe')]['recursiveNodeIndex']=function(_0x4dbdc4){for(var _0x1f2349 in _0x4dbdc4){if(_0x4dbdc4['hasOwnProperty'](_0x1f2349)){if(_[_0x80b7('0x92')](_0x4dbdc4[_0x1f2349])){this[_0x80b7('0x93')](_0x4dbdc4[_0x1f2349]);}else if(_[_0x80b7('0x94')](_0x4dbdc4[_0x1f2349])){for(var _0x520218=0x0;_0x520218<_0x4dbdc4[_0x1f2349][_0x80b7('0x95')];_0x520218++){this[_0x80b7('0x93')](_0x4dbdc4[_0x1f2349][_0x520218]);}}else if(_[_0x80b7('0x8f')](_0x4dbdc4[_0x1f2349])){_0x4dbdc4[_0x1f2349]=this[_0x80b7('0x91')](_0x4dbdc4[_0x1f2349]);}}}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x96')]=function(_0x3e9fb4,_0x4b4a8a){for(var _0x3900cc in _0x3e9fb4){if(_0x3e9fb4[_0x80b7('0x8e')](_0x3900cc)){if(_[_0x80b7('0x92')](_0x3e9fb4[_0x3900cc])){if(!_['isEmpty'](_0x3e9fb4[_0x3900cc])){this[_0x80b7('0x96')](_0x3e9fb4[_0x3900cc],util['format'](_0x80b7('0x97'),_0x4b4a8a,_0x3900cc));}}else if(_['isArray'](_0x3e9fb4[_0x3900cc])){for(var _0x59266f=0x0;_0x59266f<_0x3e9fb4[_0x3900cc][_0x80b7('0x95')];_0x59266f++){this[_0x80b7('0x96')](_0x3e9fb4[_0x3900cc][_0x59266f],util[_0x80b7('0x4f')](_0x80b7('0x97'),_0x4b4a8a,_0x3900cc+'['+_0x59266f+']'));}}else{if(!_[_0x80b7('0x3d')](_0x3e9fb4[_0x3900cc])){this[_0x80b7('0xc')]['setVariable'](util[_0x80b7('0x4f')](_0x80b7('0x97'),_0x4b4a8a,_0x3900cc),_0x3e9fb4[_0x3900cc]);}}}}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x90')]=function(_0x549e2e){try{var _0x39e9b9=JSON[_0x80b7('0x61')](_0x549e2e);this[_0x80b7('0x93')](_0x39e9b9);return JSON[_0x80b7('0x69')](_0x39e9b9);}catch(_0x4e69a2){return this[_0x80b7('0x91')](_0x549e2e);}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x91')]=function(_0x367165){var _0x5c938d=_0x367165[_0x80b7('0x98')]('{');for(var _0x49d0cb=0x1;_0x49d0cb<_0x5c938d[_0x80b7('0x95')];_0x49d0cb+=0x1){var _0x1d94de=_0x5c938d[_0x49d0cb][_0x80b7('0x98')]('}');if(_0x1d94de['length']>0x1){_0x367165=_0x367165[_0x80b7('0x99')]('{'+_0x1d94de[0x0]+'}',this['channel']['getVariable'](_0x1d94de[0x0])[_0x80b7('0x9a')]||_0x1d94de[0x0]);}}if(_0x5c938d[_0x80b7('0x95')]===0x1){return _0x367165['toString']();}return this[_0x80b7('0x91')](_0x367165);};AGIVertices[_0x80b7('0xe')]['getAndSetVariable']=function(_0x10f143,_0x2470f6){var _0x429354=this[_0x80b7('0xc')][_0x80b7('0x9b')](_0x10f143);if(_0x429354[_0x80b7('0x9c')]===-0x1){return _0x429354;}logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x9d'),_0x2470f6,_0x429354['extra']));return this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x2470f6,_0x429354['extra']);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x9f')]=function(_0x2329c4){return _0x2329c4&&_0x2329c4!=='0'&&_0x2329c4!=='-1'&&_0x2329c4!=='';};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa0')]=function(_0x38c935){this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x38c935,'-');_0x38c935[_0x80b7('0xa1')]=_0x38c935['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa2')]=function(_0x2b5303){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2b5303[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x2b5303['text'])){return this[_0x80b7('0xc')]['noop']('no\x20text\x20configured');}var _0x420aad='\x22'+_0x2b5303[_0x80b7('0x56')]+'\x22';if(this[_0x80b7('0x9f')](_0x2b5303[_0x80b7('0x70')])){_0x420aad+=','+_0x2b5303['options'];}var _0x902b77=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xa3'),_0x420aad);if(_0x902b77['result']===-0x1){return _0x902b77;}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x420aad));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa4')]=function(_0x2e3a5a){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xa5'),_0x2e3a5a[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x2e3a5a[_0x80b7('0xa6')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xa8'));}var _0xbc9cd2=_0x2e3a5a[_0x80b7('0xa6')];if(this[_0x80b7('0x9f')](_0x2e3a5a[_0x80b7('0x70')])){_0xbc9cd2+=','+_0x2e3a5a[_0x80b7('0x70')];}var _0x11cee6=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xa9'),_0xbc9cd2);if(_0x11cee6[_0x80b7('0x9c')]===-0x1){return _0x11cee6;}var _0x3fe56b=this[_0x80b7('0xaa')](_0x80b7('0xab'),'MRCP_RECOG_CONFIDENCE');if(_0x3fe56b[_0x80b7('0x9c')]===-0x1){return _0x3fe56b;}var _0x104c91=this[_0x80b7('0xaa')](_0x80b7('0xac'),'MRCP_RECOG_TRANSCRIPT');if(_0x104c91[_0x80b7('0x9c')]===-0x1){return _0x104c91;}var _0x5eb4d6=this[_0x80b7('0xaa')](_0x80b7('0xad'),_0x80b7('0xae'));if(_0x5eb4d6['result']===-0x1){return _0x5eb4d6;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Executed\x20command\x20MRCPRecog\x20%s',_0xbc9cd2));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x6')]=function(_0x1be785){logger['info'](util['format'](_0x80b7('0xaf'),_0x1be785[_0x80b7('0x31')]));return this[_0x80b7('0xc')][_0x80b7('0x6')]([_0x1be785['command'],_0x1be785[_0x80b7('0xb0')]]);};AGIVertices['prototype']['answer']=function(_0xbc54d1){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xb1'),_0xbc54d1[_0x80b7('0x31')]));if(this['isConfigured'](_0xbc54d1['timeout'])){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xbc54d1[_0x80b7('0x5d')]));var _0x5181a7=this[_0x80b7('0xc')][_0x80b7('0xb2')](_0xbc54d1[_0x80b7('0x5d')]);if(_0x5181a7[_0x80b7('0x9c')]===-0x1){return _0x5181a7;}}return this['channel']['answer']();};AGIVertices[_0x80b7('0xe')]['callback']=function(_0x55fbfa){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xb3'),_0x55fbfa[_0x80b7('0x31')]));if(!this['isConfigured'](_0x55fbfa['list_id'])){return this['channel'][_0x80b7('0x29')](_0x55fbfa,_0x80b7('0xb4'));}_0x55fbfa[_0x80b7('0x44')]=moment();if(this['isConfigured'](_0x55fbfa[_0x80b7('0xb5')])){_0x55fbfa[_0x80b7('0x44')]=moment()[_0x80b7('0xb6')](_0x55fbfa[_0x80b7('0xb5')],_0x80b7('0xb7'));}if(!this[_0x80b7('0x9f')](_0x55fbfa[_0x80b7('0x46')])){_0x55fbfa[_0x80b7('0x46')]=0x2;}this[_0x80b7('0x3b')]['sync'](this,_0x55fbfa);return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xb8'),_0x55fbfa[_0x80b7('0xb9')],_0x55fbfa[_0x80b7('0x41')],_0x55fbfa['scheduledAt']));};AGIVertices[_0x80b7('0xe')]['custom_app']=function(_0x18b139){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xba'),_0x18b139[_0x80b7('0x31')]));var _0x3d5e8e=this['channel'][_0x80b7('0x52')](_0x18b139[_0x80b7('0xbb')],_0x18b139[_0x80b7('0x70')]);if(_0x3d5e8e[_0x80b7('0x9c')]===-0x1){return _0x3d5e8e;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x18b139['application'],_0x18b139[_0x80b7('0x70')]));};AGIVertices['prototype'][_0x80b7('0xbd')]=function(_0x163062){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xbe'),_0x163062[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x163062['text'])){return this['channel']['noop'](_0x80b7('0xbf'));}var _0x36073d='\x22'+_0x163062[_0x80b7('0x56')]+'\x22';if(this[_0x80b7('0x9f')](_0x163062[_0x80b7('0x70')])){_0x36073d+=','+_0x163062[_0x80b7('0x70')];}var _0x55078a=this['channel']['exec'](_0x80b7('0xa3'),_0x36073d);if(_0x55078a['result']===-0x1){return _0x55078a;}return this['channel'][_0x80b7('0xa7')](util['format'](_0x80b7('0xc0'),_0x36073d));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xc1')]=function(_0x51d571){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xc2'),_0x51d571[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x51d571[_0x80b7('0x56')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}var _0x1e5e08='\x22'+_0x51d571[_0x80b7('0x56')]+'\x22';if(this['isConfigured'](_0x51d571[_0x80b7('0x70')])){_0x1e5e08+=','+_0x51d571[_0x80b7('0x70')];}var _0x38b026=this['channel'][_0x80b7('0x52')]('MRCPSynth',_0x1e5e08);if(_0x38b026['result']===-0x1){return _0x38b026;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xc0'),_0x1e5e08));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xc3')]=function(_0x592a08){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x592a08[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x592a08[_0x80b7('0xa6')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')]('no\x20grammar\x20configured');}var _0x5213d7=_0x592a08[_0x80b7('0xa6')];if(this[_0x80b7('0x9f')](_0x592a08[_0x80b7('0x70')])){_0x5213d7+=','+_0x592a08[_0x80b7('0x70')];}var _0xe7706b=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xa9'),_0x5213d7);if(_0xe7706b[_0x80b7('0x9c')]===-0x1){return _0xe7706b;}var _0x523724=this[_0x80b7('0xaa')](_0x80b7('0xab'),'LUMENVOX_ASR_CONFIDENCE');if(_0x523724['result']===-0x1){return _0x523724;}var _0x4da2b8=this['getAndSetVariable'](_0x80b7('0xac'),_0x80b7('0xc4'));if(_0x4da2b8[_0x80b7('0x9c')]===-0x1){return _0x4da2b8;}var _0x30056e=this[_0x80b7('0xaa')](_0x80b7('0xad'),_0x80b7('0xc5'));if(_0x30056e[_0x80b7('0x9c')]===-0x1){return _0x30056e;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xc6'),_0x5213d7));};AGIVertices['prototype'][_0x80b7('0xc7')]=function(_0x41e760){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xc8'),_0x41e760[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x41e760[_0x80b7('0xa6')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xa8'));}var _0x19ede8=_0x41e760[_0x80b7('0xa6')];if(this[_0x80b7('0x9f')](_0x41e760[_0x80b7('0x70')])){_0x19ede8+=','+_0x41e760[_0x80b7('0x70')];}var _0x4f4512=this['channel'][_0x80b7('0x52')](_0x80b7('0xa9'),_0x19ede8);if(_0x4f4512[_0x80b7('0x9c')]===-0x1){return _0x4f4512;}var _0x53d159=this[_0x80b7('0xaa')](_0x80b7('0xab'),_0x80b7('0xc9'));if(_0x53d159[_0x80b7('0x9c')]===-0x1){return _0x53d159;}var _0xd4ce5=this[_0x80b7('0xaa')](_0x80b7('0xac'),'SESTEK_ASR_TRANSCRIPT');if(_0xd4ce5[_0x80b7('0x9c')]===-0x1){return _0xd4ce5;}var _0x32956e=this[_0x80b7('0xaa')](_0x80b7('0xad'),_0x80b7('0xca'));if(_0x32956e[_0x80b7('0x9c')]===-0x1){return _0x32956e;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xc6'),_0x19ede8));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xcb')]=function(_0x4fa041){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xcc'),_0x4fa041[_0x80b7('0x31')]));if(!this['isConfigured'](_0x4fa041[_0x80b7('0xcd')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4fa041,_0x80b7('0xce'));}var _0x54b481=this[_0x80b7('0x16')][_0x80b7('0x67')](this,_0x4fa041['odbc_id']);if(!_0x54b481){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4fa041,_0x80b7('0xcf'));}if(!this[_0x80b7('0x9f')](_0x4fa041['query'])){return this[_0x80b7('0xc')]['error'](_0x4fa041,_0x80b7('0xd0'));}var _0x3bbc8b=_0x4fa041[_0x80b7('0x2c')][_0x80b7('0xd1')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xd2'),_0x3bbc8b));var _0x44c28c=this[_0x80b7('0x27')]['sync'](this,_0x54b481,_0x3bbc8b);this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x4fa041,_0x3bbc8b);if(!this[_0x80b7('0x9f')](_0x4fa041[_0x80b7('0xd3')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xd4'));}var _0x239e23=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x4fa041[_0x80b7('0xd3')]);if(!_0x239e23){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4fa041,_0x80b7('0xd5'));}var _0x1f7579=this;_0x44c28c[_0x80b7('0xd6')](function(_0x361562,_0x1336d0){Object[_0x80b7('0xd7')](_0x361562)['forEach'](function(_0x23b3ae){_0x1f7579[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xd8'),_0x239e23,_0x1336d0,_0x23b3ae),_0x361562[_0x23b3ae]);});});this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xd9'),_0x239e23),_0x44c28c[_0x80b7('0x95')]);return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0xda'),_0x239e23));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xdb')]=function(_0x21b492){logger['debug'](util[_0x80b7('0x4f')](_0x80b7('0xdc'),_0x21b492[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x21b492[_0x80b7('0xdd')])){return this['channel']['error'](_0x21b492,_0x80b7('0xde'));}var _0x375358=this[_0x80b7('0x18')]['sync'](this,_0x21b492['sip_id']);if(!_0x375358){return this['channel'][_0x80b7('0x29')](_0x21b492,_0x80b7('0xdf'));}var _0x4699ea=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xe0'),[util[_0x80b7('0x4f')](_0x80b7('0xe1'),_0x375358),_0x21b492[_0x80b7('0x5d')],_0x21b492[_0x80b7('0xe2')],_0x21b492[_0x80b7('0x5c')]]);if(_0x4699ea[_0x80b7('0x9c')]===-0x1){return _0x4699ea;}return this['channel']['noop'](util['format'](_0x80b7('0xe3'),_0x80b7('0xe0')));};AGIVertices['prototype'][_0x80b7('0xe4')]=function(_0x14d022){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0xe5'),_0x14d022[_0x80b7('0x31')]));if(!this['isConfigured'](_0x14d022[_0x80b7('0x72')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xe6'));}if(!this[_0x80b7('0x9f')](_0x14d022[_0x80b7('0x56')])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xbf'));}this['channel'][_0x80b7('0xe7')]=!![];this[_0x80b7('0x2f')](_0x14d022);this[_0x80b7('0x3a')](_0x14d022['text'],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Trying\x20Dialogflow:\x20%s',_0x14d022[_0x80b7('0x56')]));var _0x448666=this[_0x80b7('0x71')][_0x80b7('0x67')](this,_0x14d022);if(_0x448666){for(var _0x3f58fc in _0x448666){if(_0x448666[_0x80b7('0x8e')](_0x3f58fc)){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xe8'),_0x3f58fc[_0x80b7('0x60')]()),_0x448666[_0x3f58fc]);}}this[_0x80b7('0x3a')](_0x448666['speech'],_0x80b7('0xe9'),_0x80b7('0xe4'),'');return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xea'),_0x448666[_0x80b7('0xeb')]));}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x14d022,_0x80b7('0xec'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xed')]=function(_0x4470d4){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0xee'),_0x4470d4['label']));if(!this['isConfigured'](_0x4470d4[_0x80b7('0x75')])){return this[_0x80b7('0xc')]['noop']('no\x20project_id\x20configured');}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x76')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')]('no\x20client_email\x20configured');}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x77')])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xef'));}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x78')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xf0'));}if(!this[_0x80b7('0x9f')](_0x4470d4[_0x80b7('0x56')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xe7')]=!![];this['createSquareDetailsReport'](_0x4470d4);this[_0x80b7('0x3a')](_0x4470d4['text'],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xf1'),_0x4470d4[_0x80b7('0x56')]));var _0x29e46f=this[_0x80b7('0x74')][_0x80b7('0x67')](this,_0x4470d4);if(_0x29e46f){for(var _0x4004c6 in _0x29e46f){if(_0x29e46f['hasOwnProperty'](_0x4004c6)){if(_0x4004c6!==_0x80b7('0xf2')){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xe8'),_0x4004c6[_0x80b7('0x60')]()),_0x29e46f[_0x4004c6]);}}}this[_0x80b7('0x3a')](_0x29e46f[_0x80b7('0xeb')],_0x80b7('0xe9'),_0x80b7('0xed'),_0x29e46f[_0x80b7('0xf2')]);return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('DialogflowV2\x20Result\x20%s',_0x29e46f['speech']));}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x4470d4,_0x80b7('0xf3'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0xf4')]=function(_0x5e6b0b){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0xf5'),_0x5e6b0b[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x5e6b0b[_0x80b7('0xf6')])){return this['channel'][_0x80b7('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x80b7('0x9f')](_0x5e6b0b[_0x80b7('0xf7')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xf8'));}if(!this[_0x80b7('0x9f')](_0x5e6b0b['password'])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xf9'));}if(!this[_0x80b7('0x9f')](_0x5e6b0b[_0x80b7('0xfa')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xe7')]=!![];this[_0x80b7('0x2f')](_0x5e6b0b);this['createSquareMessage'](_0x5e6b0b[_0x80b7('0x56')],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xfb'),_0x5e6b0b['text']));var _0x420411=this[_0x80b7('0x79')][_0x80b7('0x67')](this,_0x5e6b0b);if(_0x420411){for(var _0x223128 in _0x420411){if(_0x420411[_0x80b7('0x8e')](_0x223128)){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0xfc'),_0x223128[_0x80b7('0x60')]()),_0x420411[_0x223128]);}}this[_0x80b7('0x3a')](_0x420411[_0x80b7('0xeb')],'out',_0x80b7('0xf4'),'');if(_0x420411[_0x80b7('0xfd')]){this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x420411['audiofile']));var _0x2d947d=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x420411[_0x80b7('0xfd')]);try{fs[_0x80b7('0xff')](_0x420411[_0x80b7('0xfd')]+'.wav');}catch(_0x398550){logger[_0x80b7('0x29')](_0x398550);}return _0x2d947d;}else{return this[_0x80b7('0xc')]['noop'](util['format'](_0x80b7('0x100'),_0x420411[_0x80b7('0xeb')]));}}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5e6b0b,_0x80b7('0x101'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x102')]=function(_0x5417e9){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x103'),_0x5417e9[_0x80b7('0x31')]));return this['channel'][_0x80b7('0xa7')](_0x80b7('0x102'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x104')]=function(_0x2cbdad){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x105'),_0x2cbdad[_0x80b7('0x31')]));var _0x5b2922='';if(_0x2cbdad[_0x80b7('0x106')]){if(!this['isConfigured'](_0x2cbdad[_0x80b7('0x106')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2cbdad,'no\x20trunk\x20selected');}else{var _0x4ca29d=parseInt(_0x2cbdad[_0x80b7('0x106')],0xa);if(isNaN(_0x4ca29d)){_0x5b2922=_0x2cbdad['trunk_id'];}else{_0x5b2922=this['getTrunk']['sync'](this,_0x2cbdad['trunk_id']);if(!_0x5b2922){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2cbdad,_0x80b7('0x107'));}}}}else if(_0x2cbdad[_0x80b7('0x108')]){_0x5b2922=_0x2cbdad['trunk_name'];}else{return this['channel']['error'](_0x2cbdad,_0x80b7('0x109'));}var _0x3df464=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0xe0'),[util[_0x80b7('0x4f')]('SIP/%s/%s',_0x5b2922,_0x2cbdad[_0x80b7('0xb9')]),_0x2cbdad[_0x80b7('0x5d')],_0x2cbdad[_0x80b7('0xe2')],_0x2cbdad[_0x80b7('0x5c')]]);if(_0x3df464['result']===-0x1){return _0x3df464;}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0xe3'),'DIAL'));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x10a')]=function(_0x40b910){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x10b'),_0x40b910[_0x80b7('0x31')]));return this[_0x80b7('0xc')][_0x80b7('0xa7')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x5268bb){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x10c'),_0x5268bb[_0x80b7('0x31')]));if(_0x5268bb['retry']===0x0){return this[_0x80b7('0xa0')](_0x5268bb);}_0x5268bb['retry']-=0x1;if(!this[_0x80b7('0x9f')](_0x5268bb[_0x80b7('0x10d')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5268bb,_0x80b7('0x10e'));}var _0x5252e5=this[_0x80b7('0x1b')][_0x80b7('0x67')](this,_0x5268bb[_0x80b7('0x10d')]);if(!_0x5252e5){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5268bb,_0x80b7('0x10f'));}if(!this[_0x80b7('0x9f')](_0x5268bb['variable_id'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x80b7('0xd4'));}var _0x4d774c=this[_0x80b7('0xc')][_0x80b7('0x110')](_0x5252e5,_0x5268bb['response'],_0x5268bb[_0x80b7('0x111')]);var _0x54ed34=_0x4d774c[_0x80b7('0x9c')]?_0x4d774c[_0x80b7('0x9c')][_0x80b7('0x45')]():'';logger[_0x80b7('0x2a')]('test',JSON[_0x80b7('0x69')](_0x4d774c));if(_0x4d774c['result']===-0x1){this['createSquareDetailsReport'][_0x80b7('0x67')](this,_0x5268bb,_0x54ed34);return _0x4d774c;}else if(_0x4d774c[_0x80b7('0x9a')]==='timeout'){_0x4d774c[_0x80b7('0x9c')]=_0x54ed34[_0x80b7('0x95')]>=parseInt(_0x5268bb['mindigit'])?'x':'i';}else{_0x4d774c['result']=_0x54ed34[_0x80b7('0x95')]>=parseInt(_0x5268bb[_0x80b7('0x112')])&&_0x54ed34['length']<=parseInt(_0x5268bb[_0x80b7('0x111')])?'x':'i';}var _0x59cbaf=this[_0x80b7('0x9b')]['sync'](this,_0x5268bb['variable_id']);if(!_0x59cbaf){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5268bb,_0x80b7('0xd5'));}this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x59cbaf,_0x54ed34);if(this[_0x80b7('0x9f')](_0x5268bb[_0x80b7('0x113')])){var _0x367518=parseInt(_0x5268bb['hiddendigitsnum'],0xa);var _0x39ee29=rs[_0x80b7('0x114')]({'charset':'*','length':_0x367518});var _0x3e940d=_0x54ed34['length'];if(_0x3e940d>0x0){if(_0x3e940d>_0x367518){this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,_0x5268bb[_0x80b7('0x115')]===_0x80b7('0x116')?_0x39ee29+_0x54ed34[_0x80b7('0x117')](_0x367518):_0x54ed34['substr'](0x0,_0x3e940d-_0x367518)+_0x39ee29);}else{this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,rs[_0x80b7('0x114')]({'charset':'*','length':_0x3e940d}));}}else{this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,'');}}else{this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x5268bb,_0x54ed34);}return _0x4d774c;};AGIVertices[_0x80b7('0xe')][_0x80b7('0xb')]=function(_0x21b802){logger[_0x80b7('0x2a')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x21b802['label']));return this[_0x80b7('0xa')](_0x21b802);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x118')]=function(_0x4456e4){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x119'),_0x4456e4[_0x80b7('0x31')]));this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x4456e4,_0x4456e4[_0x80b7('0x11a')]);return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('GOAL\x20%s',_0x4456e4['goalname']));};AGIVertices[_0x80b7('0xe')]['awspolly']=function(_0x53db6e){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x11b'),_0x53db6e[_0x80b7('0x31')]));if(!this['isConfigured'](_0x53db6e['aws_access_key_id'])||!this['isConfigured'](_0x53db6e[_0x80b7('0x11c')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x80b7('0x9f')](_0x53db6e[_0x80b7('0x56')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x11d'),_0x53db6e[_0x80b7('0x56')]));var _0x219cfa=this[_0x80b7('0x81')][_0x80b7('0x67')](this,_0x53db6e);if(_0x219cfa){this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x219cfa));var _0x2fdf2e=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x219cfa);try{fs['unlink'](_0x219cfa+_0x80b7('0x11e'));}catch(_0xfab59c){logger[_0x80b7('0x29')](_0xfab59c);}return _0x2fdf2e;}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x53db6e,_0x80b7('0x11f'));};AGIVertices[_0x80b7('0xe')]['awslex']=function(_0x3794c0){logger['info'](util['format'](_0x80b7('0x120'),_0x3794c0[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x82')])||!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x11c')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x121'));}if(!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x88')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x122'));}if(!this[_0x80b7('0x9f')](_0x3794c0[_0x80b7('0x56')])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xe7')]=!![];this['createSquareDetailsReport'](_0x3794c0);this['createSquareMessage'](_0x3794c0[_0x80b7('0x56')],'in','','');this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x3794c0[_0x80b7('0x56')]));var _0x164931=this[_0x80b7('0x86')][_0x80b7('0x67')](this,_0x3794c0);if(_0x164931){for(var _0x590ff8 in _0x164931){if(_0x164931[_0x80b7('0x8e')](_0x590ff8)&&_['isString'](_0x164931[_0x590ff8])){this['channel'][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0x123'),_0x590ff8['toUpperCase']()),_0x164931[_0x590ff8]);}}if(_['isNil'](_0x164931['message'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x124'));}else{this['createSquareMessage'](_0x164931[_0x80b7('0x6e')],_0x80b7('0xe9'),_0x80b7('0x125'),'');return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')]('Amazon\x20Lex\x20Result\x20%s',_0x164931[_0x80b7('0x6e')]));}}return this['channel'][_0x80b7('0x29')](_0x3794c0,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x80b7('0xe')]['googleasr']=function(_0x163ef1){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x126'),_0x163ef1['label'],_0x163ef1[_0x80b7('0x5d')]));if(!this['isConfigured'](_0x163ef1['key'])){return this[_0x80b7('0xc')]['noop']('no\x20key\x20configured');}var _0x4fa8ac='wav';var _0xcb0f2a=util[_0x80b7('0x4f')](_0x80b7('0x127'),FILES_PATH,rs[_0x80b7('0x114')](0x4));var _0x2e9c60=util[_0x80b7('0x4f')]('%s.%s',_0xcb0f2a,_0x4fa8ac);var _0x2f8f78=!![];if(_0x163ef1[_0x80b7('0x128')]===_0x80b7('0x129')){_0x2f8f78=![];}var _0xfce8c2=this[_0x80b7('0xc')][_0x80b7('0x12a')](_0xcb0f2a,_0x4fa8ac,_0x163ef1[_0x80b7('0x12b')],_0x163ef1[_0x80b7('0x5d')],undefined,_0x2f8f78);if(_0xfce8c2[_0x80b7('0x9c')]!==-0x1){this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x12c'),_0x2e9c60));var _0x2dfd2e=this[_0x80b7('0x89')][_0x80b7('0x67')](this,_0x163ef1,_0x2e9c60);if(_0x2dfd2e){for(var _0x4451b9 in _0x2dfd2e){if(_0x2dfd2e[_0x80b7('0x8e')](_0x4451b9)){this[_0x80b7('0xc')]['setVariable'](util[_0x80b7('0x4f')](_0x80b7('0x12d'),_0x4451b9[_0x80b7('0x60')]()),_0x2dfd2e[_0x4451b9]);}}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0x12e'),JSON[_0x80b7('0x69')](_0x2dfd2e)));}}return _0xfce8c2;};AGIVertices[_0x80b7('0xe')][_0x80b7('0x12f')]=function(_0x1b0034){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x130'),_0x1b0034[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x1b0034[_0x80b7('0x8b')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x131'));}if(!this['isConfigured'](_0x1b0034[_0x80b7('0x8c')])){return this['channel']['noop'](_0x80b7('0x132'));}var _0x472d44=_0x80b7('0x133');var _0x4142a6=util[_0x80b7('0x4f')]('%s/recordings/%s',FILES_PATH,rs[_0x80b7('0x114')](0x4));var _0x31eaf8=util[_0x80b7('0x4f')](_0x80b7('0x97'),_0x4142a6,_0x472d44);var _0x2a52a9=!![];if(_0x1b0034[_0x80b7('0x128')]===_0x80b7('0x129')){_0x2a52a9=![];}var _0x3dfbf5=this[_0x80b7('0xc')][_0x80b7('0x12a')](_0x4142a6,_0x472d44,_0x1b0034[_0x80b7('0x12b')],_0x1b0034['timeout'],undefined,_0x2a52a9);if(_0x3dfbf5['result']!==-0x1){this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x134'),_0x31eaf8));var _0x1f8148=this[_0x80b7('0x8a')][_0x80b7('0x67')](this,_0x1b0034,_0x31eaf8);if(_0x1f8148){for(var _0x2c4e89 in _0x1f8148){if(_0x1f8148['hasOwnProperty'](_0x2c4e89)){this['channel']['setVariable'](util[_0x80b7('0x4f')](_0x80b7('0x135'),_0x2c4e89[_0x80b7('0x60')]()),_0x1f8148[_0x2c4e89]);}}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0x136'),JSON[_0x80b7('0x69')](_0x1f8148)));}}return _0x3dfbf5;};AGIVertices[_0x80b7('0xe')][_0x80b7('0x137')]=function(_0x286571){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x138'),_0x286571[_0x80b7('0x31')]));return this['channel'][_0x80b7('0x139')](_0x286571[_0x80b7('0x36')],_0x286571[_0x80b7('0x37')],_0x286571[_0x80b7('0x13a')]);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x13b')]=function(_0x7f988d){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x13c'),_0x7f988d['label']));if(!this[_0x80b7('0x9f')](_0x7f988d[_0x80b7('0x13d')])){return this[_0x80b7('0xc')]['error'](_0x7f988d,_0x80b7('0x13e'));}try{var _0x3f0a53=eval(_0x7f988d['condition'])?_0x80b7('0x13f'):_0x80b7('0x140');this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('EVAL\x20CONDITION\x20%s\x20%s',_0x7f988d[_0x80b7('0x13d')],_0x3f0a53));return{'code':0xc8,'result':_0x3f0a53};}catch(_0x35818f){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x141')]=function(_0x18b0c9){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x142'),_0x18b0c9['label']));if(!this['isConfigured'](_0x18b0c9['interval_id'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x18b0c9,'no\x20interval\x20configured');}var _0x516917=this[_0x80b7('0x23')][_0x80b7('0x67')](this,_0x18b0c9[_0x80b7('0x143')]);if(!_0x516917){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x18b0c9,_0x80b7('0x144'));}for(var _0x4be985=0x0;_0x4be985<_0x516917['length'];_0x4be985+=0x1){var _0x17f308=this[_0x80b7('0xc')]['getVariable'](util[_0x80b7('0x4f')](_0x80b7('0x145'),_0x516917[_0x4be985]));if(_0x17f308[_0x80b7('0x9c')]===-0x1){return _0x17f308;}logger[_0x80b7('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x516917[_0x4be985],_0x17f308['extra']));if(_0x17f308[_0x80b7('0x9a')]===_0x80b7('0x13f')){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x146'),_0x516917[_0x4be985],_0x80b7('0x13f')));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('IFTIME\x20%s\x20%s',_0x516917[_0x4be985],_0x80b7('0x13f')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x146'),_0x516917[_0x4be985],_0x80b7('0x140')));this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x146'),_0x516917[_0x4be985],_0x80b7('0x140')));}}return{'code':0xc8,'result':_0x80b7('0x140')};};AGIVertices['prototype']['hangup']=function(_0x25e883){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x147'),_0x25e883[_0x80b7('0x31')]));return this['channel']['hangup']();};AGIVertices[_0x80b7('0xe')][_0x80b7('0x148')]=function(_0x300b06){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x149'),_0x300b06[_0x80b7('0x31')]));if(!this['isConfigured'](_0x300b06['key'])){return this['channel'][_0x80b7('0xa7')](_0x80b7('0xe6'));}var _0x5bb6c6=_0x80b7('0x133');var _0x119eb8=util['format'](_0x80b7('0x127'),FILES_PATH,rs['generate'](0x4));var _0x4f7c70=util['format'](_0x80b7('0x97'),_0x119eb8,_0x5bb6c6);var _0xffb3cf=!![];if(_0x300b06['beep']===_0x80b7('0x129')){_0xffb3cf=![];}var _0x5d58a6=this['channel'][_0x80b7('0x12a')](_0x119eb8,_0x5bb6c6,_0x300b06[_0x80b7('0x12b')],_0x300b06[_0x80b7('0x5d')],undefined,_0xffb3cf);if(_0x5d58a6[_0x80b7('0x9c')]!==-0x1){this[_0x80b7('0xc')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x4f7c70));var _0x3e6c55=this[_0x80b7('0x7e')]['sync'](this,_0x300b06,_0x4f7c70);if(_0x3e6c55){for(var _0x460bed in _0x3e6c55){if(_0x3e6c55[_0x80b7('0x8e')](_0x460bed)){this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0x14a'),_0x460bed[_0x80b7('0x60')]()),_0x3e6c55[_0x460bed]);}}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x14b'),JSON[_0x80b7('0x69')](_0x3e6c55)));}}return _0x5d58a6;};AGIVertices[_0x80b7('0xe')][_0x80b7('0x14c')]=function(_0xb69052){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x14d'),_0xb69052[_0x80b7('0x31')]));if(!this['isConfigured'](_0xb69052[_0x80b7('0x72')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')]('no\x20key\x20configured');}if(!this[_0x80b7('0x9f')](_0xb69052['text'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Trying\x20ispeech\x20TTS\x20%s',_0xb69052['text']));var _0x5ab30f=this[_0x80b7('0x7a')][_0x80b7('0x67')](this,_0xb69052);if(_0x5ab30f){this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x14e'),_0x5ab30f));var _0x501217=this['channel']['streamFile'](_0x5ab30f,_0xb69052[_0x80b7('0x12b')]);try{fs[_0x80b7('0xff')](_0x5ab30f+'.wav');}catch(_0x15cbbe){logger[_0x80b7('0x29')](_0x15cbbe);}return _0x501217;}return this[_0x80b7('0xc')]['error'](_0xb69052,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x80b7('0xe')]['login']=function(_0x5b94fd){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x14f'),_0x5b94fd[_0x80b7('0x31')]));if(!this['isConfigured'](_0x5b94fd['findBy'])){return this['channel']['error'](_0x5b94fd,_0x80b7('0x150'));}logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x151'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x5b94fd[_0x80b7('0x152')]));var _0x482380=this['agentLogin'][_0x80b7('0x67')](this,_0x5b94fd[_0x80b7('0x152')]);if(_0x482380){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this['channel'][_0x80b7('0x34')],_0x5b94fd['findBy']));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x80b7('0xc')][_0x80b7('0x34')],_0x5b94fd['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x154'),this['channel']['callerid'],_0x5b94fd['findBy']));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x5b94fd[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x155')};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x156')]=function(_0x390857){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x157'),_0x390857[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x390857[_0x80b7('0x152')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x390857,_0x80b7('0x150'));}logger['info'](util[_0x80b7('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x390857[_0x80b7('0x152')]));var _0x5c0258=this[_0x80b7('0x4c')]['sync'](this,_0x390857[_0x80b7('0x152')]);if(_0x5c0258){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x390857['findBy']));this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x390857[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x158')};}else{logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this['channel'][_0x80b7('0x34')],_0x390857[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x154'),this['channel'][_0x80b7('0x34')],_0x390857[_0x80b7('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x159')]=function(_0x572b5e){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x15a'),_0x572b5e[_0x80b7('0x31')]));if(!this['isConfigured'](_0x572b5e[_0x80b7('0x15b')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x572b5e,'no\x20operation\x20configured');}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x15c'),_0x572b5e[_0x80b7('0x15b')]));var _0x42c715=eval(_0x572b5e[_0x80b7('0x15b')]);if(!this[_0x80b7('0x9f')](_0x572b5e[_0x80b7('0xd3')])){return this[_0x80b7('0xc')]['noop'](_0x80b7('0xd4'));}var _0x54fb5a=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x572b5e[_0x80b7('0xd3')]);if(!_0x54fb5a){return this[_0x80b7('0xc')]['error'](_0x572b5e,'no\x20variable\x20found');}if(_['isArray'](_0x42c715)){var _0x37f013=this;_0x42c715[_0x80b7('0xd6')](function(_0x17da26,_0x12e445){_0x37f013['channel'][_0x80b7('0x9e')](util[_0x80b7('0x4f')](_0x80b7('0x15d'),_0x54fb5a,_0x12e445),_0x17da26);});return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('variable\x20%s[key]\x20set',_0x54fb5a));}else{return this[_0x80b7('0xc')]['setVariable'](_0x54fb5a,_0x42c715);}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x9')]=function(_0x2832a3){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x15e'),_0x2832a3[_0x80b7('0x31')]));if(_0x2832a3[_0x80b7('0xa1')]===0x0){return this[_0x80b7('0xa0')](_0x2832a3);}_0x2832a3[_0x80b7('0xa1')]-=0x1;if(!this[_0x80b7('0x9f')](_0x2832a3[_0x80b7('0x10d')])){return this['channel'][_0x80b7('0x29')](_0x2832a3,_0x80b7('0x10e'));}var _0x1f01a6=this['getSound'][_0x80b7('0x67')](this,_0x2832a3[_0x80b7('0x10d')]);if(!_0x1f01a6){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2832a3,_0x80b7('0x10f'));}var _0x44521d=this[_0x80b7('0xc')][_0x80b7('0x110')](_0x1f01a6,_0x2832a3[_0x80b7('0x15f')],_0x2832a3[_0x80b7('0x160')]);var _0x1db058=_0x44521d[_0x80b7('0x9c')];if(_0x44521d[_0x80b7('0x9c')]===-0x1){this['createSquareDetailsReport'][_0x80b7('0x67')](this,_0x2832a3,'-1');return _0x44521d;}else if(_0x44521d[_0x80b7('0x9a')]===_0x80b7('0x5d')){_0x44521d[_0x80b7('0x9c')]=_0x44521d['result']['length']>0x0?_0x44521d[_0x80b7('0x9c')]:'t';}else if(_['isEmpty'](_0x44521d[_0x80b7('0x9c')])){_0x44521d[_0x80b7('0x9c')]='#';_0x1db058='#';}if(!this[_0x80b7('0x9f')](_0x2832a3[_0x80b7('0xd3')])){this['channel'][_0x80b7('0xa7')](_0x80b7('0xd4'));}else{var _0x17d326=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x2832a3[_0x80b7('0xd3')]);if(!_0x17d326){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x2832a3,_0x80b7('0xd5'));}this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x17d326,_0x1db058);}this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x2832a3,_0x1db058);return _0x44521d;};AGIVertices[_0x80b7('0xe')][_0x80b7('0xa7')]=function(_0x486748){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x161'),_0x486748[_0x80b7('0x31')]));return this[_0x80b7('0xc')]['noop'](_0x486748[_0x80b7('0x162')]||_0x486748['label']);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x163')]=function(_0x26f20a){logger['info'](util[_0x80b7('0x4f')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x26f20a[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x26f20a['findBy'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x26f20a,_0x80b7('0x150'));}logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x151'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x26f20a[_0x80b7('0x152')]));var _0x123f3e=this['getPause'][_0x80b7('0x67')](this,_0x26f20a[_0x80b7('0x164')]);var _0x1bdd93=this[_0x80b7('0x49')][_0x80b7('0x67')](this,_0x26f20a[_0x80b7('0x152')],_0x123f3e);if(_0x1bdd93){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x153'),this['channel'][_0x80b7('0x34')],_0x26f20a[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')]['callerid'],_0x26f20a[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x158')};}else{logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x80b7('0xc')]['callerid'],_0x26f20a[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x153'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x26f20a[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x155')};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x165')]=function(_0x3cb9ee){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x166'),_0x3cb9ee[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x3cb9ee[_0x80b7('0x10d')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x3cb9ee,_0x80b7('0x10e'));}var _0x4a2400=this['getSound'][_0x80b7('0x67')](this,_0x3cb9ee[_0x80b7('0x10d')]);if(!_0x4a2400){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x3cb9ee,_0x80b7('0x10f'));}var _0x5daf71=this[_0x80b7('0xc')]['exec'](_0x80b7('0x167'),[_0x4a2400,_0x3cb9ee['opts']]);if(_0x5daf71[_0x80b7('0x9c')]===-0x1){return _0x5daf71;}return this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x80b7('0x167'),_0x4a2400));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x168')]=function(_0x33e359){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x169'),_0x33e359[_0x80b7('0x31')]));if(!this['isConfigured'](_0x33e359[_0x80b7('0x16a')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x33e359,_0x80b7('0x16b'));}var _0x41a5b4='';var _0x54e209=parseInt(_0x33e359[_0x80b7('0x16a')],0xa);if(isNaN(_0x54e209)){_0x41a5b4=_0x33e359[_0x80b7('0x16a')];}else{_0x41a5b4=this['getVoiceQueue'][_0x80b7('0x67')](this,_0x33e359['queue_id']);if(!_0x41a5b4){return this['channel'][_0x80b7('0x29')](_0x33e359,_0x80b7('0x16c'));}}var _0x3dfcb1='';if(this[_0x80b7('0x9f')](_0x33e359['file_id'])){var _0x3c42df=this[_0x80b7('0x1b')][_0x80b7('0x67')](this,_0x33e359['file_id']);if(_0x3c42df){_0x3dfcb1=_0x3c42df;}}this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x33e359,_0x41a5b4);if(_0x33e359['opts']['indexOf']('x')<0x0){_0x33e359['opts']+='x';}if(_0x33e359[_0x80b7('0xe2')][_0x80b7('0x16d')]('X')<0x0){_0x33e359[_0x80b7('0xe2')]+='X';}this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x80b7('0x16e'),_0x41a5b4?_0x41a5b4['toLowerCase']():'');var _0x3d391f=this[_0x80b7('0xc')][_0x80b7('0x52')]('QUEUE',[_0x41a5b4,_0x33e359[_0x80b7('0xe2')],_0x33e359['url'],_0x3dfcb1,_0x33e359[_0x80b7('0x5d')],_0x33e359[_0x80b7('0x6')],_0x33e359[_0x80b7('0x16f')],_0x33e359[_0x80b7('0x170')],'',_0x33e359['position']]);if(_0x3d391f[_0x80b7('0x9c')]===-0x1){return _0x3d391f;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x80b7('0x171'),_0x41a5b4));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x172')]=function(_0x266b10){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x173'),_0x266b10[_0x80b7('0x31')]));var _0x32c46c=_0x266b10[_0x80b7('0x174')]||'wav';var _0x160065=util[_0x80b7('0x4f')](_0x80b7('0x175'),this['channel'][_0x80b7('0x30')],rs[_0x80b7('0x114')](0x5));var _0x43a18c=util[_0x80b7('0x4f')](_0x80b7('0x176'),FILES_PATH,_0x160065,_0x32c46c);var _0x525d90=util[_0x80b7('0x4f')]('%s/recordings/%s',FILES_PATH,_0x160065);this[_0x80b7('0x177')][_0x80b7('0x67')](this,_0x266b10,_0x160065,_0x43a18c);this[_0x80b7('0xc')][_0x80b7('0x9e')](_0x80b7('0x178'),_0x160065);logger[_0x80b7('0x2a')](_0x80b7('0x179'),_0x525d90,_0x32c46c,_0x266b10[_0x80b7('0x17a')],_0x266b10['timeout']);return this[_0x80b7('0xc')][_0x80b7('0x12a')](_0x525d90,_0x32c46c,_0x266b10[_0x80b7('0x17a')],_0x266b10[_0x80b7('0x5d')],undefined,!![]);};AGIVertices['prototype'][_0x80b7('0x17b')]=function(_0x14803d){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x17c'),_0x14803d[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x14803d['url'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x17d'));}var _0x1f19d3=this['restAPI'][_0x80b7('0x67')](this,_0x14803d);logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x17e'),util[_0x80b7('0x17f')](_0x1f19d3,{'showHidden':![],'depth':null})));if(!this[_0x80b7('0x9f')](_0x14803d['variable_id'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x180'));}var _0x298550=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x14803d['variable_id']);if(!_0x298550){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x14803d,_0x80b7('0xd5'));}this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')]('%s_STATUS_CODE',_0x298550),_0x1f19d3['statusCode']?_0x1f19d3[_0x80b7('0x6c')]:_0x80b7('0x181'));this[_0x80b7('0xc')][_0x80b7('0x9e')](util[_0x80b7('0x4f')]('%s_STATUS_MESSAGE',_0x298550),_0x1f19d3[_0x80b7('0x6d')]?_0x1f19d3[_0x80b7('0x6d')]:'OK');if(_0x1f19d3[_0x80b7('0x6a')]){try{this[_0x80b7('0x96')](_0x1f19d3[_0x80b7('0x6a')],_0x298550);}catch(_0x3c0edd){logger['error'](util[_0x80b7('0x4f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x298550));}}return this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('variable\x20%s\x20set',_0x298550));};AGIVertices['prototype'][_0x80b7('0x182')]=function(_0x264b57){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x183'),_0x264b57[_0x80b7('0x31')]));return this['channel'][_0x80b7('0x184')](_0x264b57[_0x80b7('0x185')][_0x80b7('0xd1')](/\s+/g,''),_0x264b57[_0x80b7('0x17a')]);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x186')]=function(_0x4af667){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x187'),_0x4af667[_0x80b7('0x31')]));return this['channel'][_0x80b7('0x188')](_0x4af667[_0x80b7('0x5e')][_0x80b7('0xd1')](/\s+/g,''),_0x4af667[_0x80b7('0x17a')]);};AGIVertices[_0x80b7('0xe')]['sayphonetic']=function(_0x5bee1b){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x189'),_0x5bee1b[_0x80b7('0x31')]));return this[_0x80b7('0xc')][_0x80b7('0x18a')](_0x5bee1b[_0x80b7('0x56')],_0x5bee1b['escape_digits']);};AGIVertices[_0x80b7('0xe')][_0x80b7('0x18b')]=function(_0x50cd27){logger['info'](util['format'](_0x80b7('0x18c'),_0x50cd27[_0x80b7('0x31')]));if(!this['isConfigured'](_0x50cd27[_0x80b7('0x18d')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x18e'));}var _0x18ea16=this[_0x80b7('0x1f')][_0x80b7('0x67')](this,_0x50cd27[_0x80b7('0x18d')]);if(!_0x18ea16||!_0x18ea16['Smtp']){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x50cd27,_0x80b7('0x18f'));}var _0x4068cb={'from':util[_0x80b7('0x4f')]('\x22%s\x22\x20<%s>',_0x18ea16['name'],_0x18ea16['email']||_0x18ea16[_0x80b7('0x190')][_0x80b7('0x191')]),'to':_0x50cd27['to']||'','cc':_0x50cd27['cc']||'','bcc':_0x50cd27[_0x80b7('0x192')]||'','subject':_0x50cd27[_0x80b7('0x193')],'html':_0x50cd27[_0x80b7('0x56')],'text':_0x50cd27['text']};if(this[_0x80b7('0x9f')](_0x50cd27[_0x80b7('0x194')])){}logger[_0x80b7('0x195')]('sendMail\x20message',JSON[_0x80b7('0x69')](_0x4068cb));this['createSquareDetailsReport'][_0x80b7('0x67')](this,_0x50cd27,_0x50cd27[_0x80b7('0x18d')]);this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x18ea16['name']));this[_0x80b7('0x21')][_0x80b7('0x67')](this,_0x18ea16[_0x80b7('0x196')],_0x4068cb);return this[_0x80b7('0xc')][_0x80b7('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x80b7('0xe')][_0x80b7('0x197')]=function(_0x15a0ff){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x15a0ff[_0x80b7('0x31')]));return this[_0x80b7('0xc')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x80b7('0x198')]=function(_0x42f87a){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x42f87a[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x42f87a[_0x80b7('0x199')])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x19a'));}var _0xd857bd=this[_0x80b7('0x19b')]['sync'](this,_0x42f87a[_0x80b7('0x199')]);if(!_0xd857bd){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x42f87a,'no\x20sms\x20account\x20found');}var _0x5405c4={'body':_0x42f87a[_0x80b7('0x19c')],'phone':_0x42f87a['to']||'','SmsAccountId':_0xd857bd['id']};logger[_0x80b7('0x195')](_0x80b7('0x19d'),JSON[_0x80b7('0x69')](_0x5405c4));this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x42f87a,_0x42f87a[_0x80b7('0x199')]);this['channel']['noop'](util['format'](_0x80b7('0x19e'),_0xd857bd[_0x80b7('0x11')]));this[_0x80b7('0x2e')][_0x80b7('0x67')](this,_0x5405c4);return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x19f'));};AGIVertices['prototype'][_0x80b7('0x1a0')]=function(_0x321abc){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1a1'),_0x321abc[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x321abc[_0x80b7('0xd3')])){return this['channel'][_0x80b7('0x29')](_0x321abc,_0x80b7('0x1a2'));}var _0x16a24e=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x321abc[_0x80b7('0xd3')]);if(!_0x16a24e){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x321abc,_0x80b7('0xd5'));}return this[_0x80b7('0xc')]['setVariable'](_0x16a24e,_0x321abc[_0x80b7('0x1a3')]);};AGIVertices['prototype'][_0x80b7('0x1a4')]=function(_0x1fc9ab){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x1a5'),_0x1fc9ab[_0x80b7('0x31')]));this[_0x80b7('0xc')]['noop']('START\x20CALLY\x20SQUARE');var _0x1f3ba1=this[_0x80b7('0xc')]['getVariable'](_0x80b7('0x1a6'));if(!_['isEmpty'](_0x1f3ba1[_0x80b7('0x9a')])){this['channel'][_0x80b7('0x30')]=_0x1f3ba1[_0x80b7('0x9a')];}if(_0x1fc9ab[_0x80b7('0x1a7')]===_0x80b7('0x1a8')){this[_0x80b7('0xc')]['noop'](_0x80b7('0x1a9'));return this[_0x80b7('0xc')]['answer']();}return this[_0x80b7('0xc')]['noop'](_0x80b7('0x1aa'));};AGIVertices[_0x80b7('0xe')]['subproject']=function(_0xd81157){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1ab'),_0xd81157[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0xd81157[_0x80b7('0x1ac')])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0xd81157,'no\x20subproject\x20selected');}var _0x118f43=this[_0x80b7('0x14')][_0x80b7('0x67')](this,_0xd81157[_0x80b7('0x1ac')]);if(!this[_0x80b7('0x9f')](_0x118f43)){return this[_0x80b7('0xc')]['error'](_0xd81157,util[_0x80b7('0x4f')](_0x80b7('0x1ad'),_0xd81157[_0x80b7('0x1ac')]));}if(_0x118f43===this[_0x80b7('0xc')]['arg_1']){return this['channel'][_0x80b7('0x29')](_0xd81157,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x80b7('0x2f')]['sync'](this,_0xd81157,_0x118f43);var _0x1ed9ab=this['channel'][_0x80b7('0x52')](_0x80b7('0x1ae'),util[_0x80b7('0x4f')](_0x80b7('0x1af'),config[_0x80b7('0x6')]['host']||_0x80b7('0x1b0'),_0x118f43,this[_0x80b7('0xc')]['arg_1']));if(_0x1ed9ab[_0x80b7('0x9c')]===-0x1){return _0x1ed9ab;}return this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x80b7('0x1ae'),_0x118f43));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1b1')]=function(_0x14e2fb){logger[_0x80b7('0x2a')](util['format'](_0x80b7('0x1b2'),_0x14e2fb['label']));var _0x2438e1=this[_0x80b7('0x51')][_0x80b7('0x67')](this,_0x14e2fb['command']);this[_0x80b7('0x2f')][_0x80b7('0x67')](this,_0x14e2fb,_0x14e2fb[_0x80b7('0x1b3')]);if(this[_0x80b7('0x9f')](_0x14e2fb[_0x80b7('0xd3')])){var _0x3b4e77=this['getVariable'][_0x80b7('0x67')](this,_0x14e2fb[_0x80b7('0xd3')]);if(_0x3b4e77){this[_0x80b7('0xc')]['setVariable'](_0x3b4e77,_0x2438e1);return this['channel'][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x1b4'),_0x14e2fb['command'],_0x3b4e77));}}return this['channel']['noop'](util[_0x80b7('0x4f')](_0x80b7('0x1b5'),_0x14e2fb['command']));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1b6')]=function(_0x5e8289){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1b7'),_0x5e8289[_0x80b7('0x31')]));_0x5e8289[_0x80b7('0x56')]=_0x5e8289['text'][_0x80b7('0xd1')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5e8289['apiKey'])){return this[_0x80b7('0xc')][_0x80b7('0xa7')](_0x80b7('0x1b8'));}if(!this['isConfigured'](_0x5e8289[_0x80b7('0x56')])){return this[_0x80b7('0xc')]['noop'](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x1b9'),_0x5e8289[_0x80b7('0x56')]));var _0x2a3f83=this[_0x80b7('0x54')][_0x80b7('0x67')](this,_0x5e8289);if(_0x2a3f83){this[_0x80b7('0xc')]['noop'](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2a3f83));var _0x47d67a=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x2a3f83);try{fs[_0x80b7('0xff')](_0x2a3f83+_0x80b7('0x11e'));}catch(_0x1fc9d0){logger[_0x80b7('0x29')](_0x1fc9d0);}return _0x47d67a;}return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x5e8289,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1ba')]=function(_0x553aa4){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1bb'),_0x553aa4[_0x80b7('0x31')]));_0x553aa4[_0x80b7('0x56')]=_0x553aa4[_0x80b7('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x80b7('0x9f')](_0x553aa4[_0x80b7('0x56')])){return this['channel']['noop'](_0x80b7('0xbf'));}this[_0x80b7('0xc')][_0x80b7('0xa7')](util['format'](_0x80b7('0x1bc'),_0x553aa4[_0x80b7('0x56')]));var _0x94197f=this[_0x80b7('0x59')]['sync'](this,_0x553aa4);if(_0x94197f){this[_0x80b7('0xc')]['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x94197f));var _0x138d59=this[_0x80b7('0xc')][_0x80b7('0xfe')](_0x94197f);try{fs[_0x80b7('0xff')](_0x94197f+_0x80b7('0x11e'));}catch(_0x1b0954){logger['error'](_0x1b0954);}return _0x138d59;}return this[_0x80b7('0xc')]['error'](_0x553aa4,_0x80b7('0x1bd'));};AGIVertices[_0x80b7('0xe')]['unpause']=function(_0x248c15){logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x1be'),_0x248c15['label']));if(!this[_0x80b7('0x9f')](_0x248c15['findBy'])){return this[_0x80b7('0xc')][_0x80b7('0x29')](_0x248c15,_0x80b7('0x150'));}logger['info'](util[_0x80b7('0x4f')](_0x80b7('0x151'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x248c15[_0x80b7('0x152')]));var _0x1ebf9e=this[_0x80b7('0x4b')][_0x80b7('0x67')](this,_0x248c15[_0x80b7('0x152')]);if(_0x1ebf9e){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x80b7('0xc')]['callerid'],_0x248c15[_0x80b7('0x152')]));this[_0x80b7('0xc')]['noop'](util[_0x80b7('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x80b7('0xc')]['callerid'],_0x248c15[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x158')};}else{logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this[_0x80b7('0xc')]['callerid'],_0x248c15[_0x80b7('0x152')]));this[_0x80b7('0xc')][_0x80b7('0xa7')](util[_0x80b7('0x4f')](_0x80b7('0x154'),this[_0x80b7('0xc')][_0x80b7('0x34')],_0x248c15[_0x80b7('0x152')]));return{'code':0xc8,'result':_0x80b7('0x155')};}};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1bf')]=function(_0x3955f9){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1c0'),_0x3955f9[_0x80b7('0x31')]));var _0x2d5d65=this[_0x80b7('0xc')][_0x80b7('0x52')](_0x80b7('0x1c1'),[_0x3955f9[_0x80b7('0x1c2')],_0x3955f9[_0x80b7('0x70')]]);if(_0x2d5d65[_0x80b7('0x9c')]===-0x1){return _0x2d5d65;}return this['channel']['noop'](util[_0x80b7('0x4f')](_0x80b7('0xbc'),_0x80b7('0x1c1'),_0x3955f9[_0x80b7('0x1c2')]));};AGIVertices[_0x80b7('0xe')][_0x80b7('0x1c3')]=function(_0x6d2070){logger[_0x80b7('0x2a')](util[_0x80b7('0x4f')](_0x80b7('0x1c4'),_0x6d2070[_0x80b7('0x31')]));if(!this[_0x80b7('0x9f')](_0x6d2070[_0x80b7('0xd3')])){return this['channel'][_0x80b7('0x29')](_0x6d2070,_0x80b7('0x1a2'));}var _0x4579c4=this[_0x80b7('0x9b')][_0x80b7('0x67')](this,_0x6d2070[_0x80b7('0xd3')]);if(!_0x4579c4){return this[_0x80b7('0xc')]['error'](_0x6d2070,_0x80b7('0xd5'));}var _0x16a607=this[_0x80b7('0xc')][_0x80b7('0x9b')](_0x4579c4);return{'code':0xc8,'result':_0x16a607[_0x80b7('0x9a')]?_0x16a607[_0x80b7('0x9a')]:'-'};};String[_0x80b7('0xe')][_0x80b7('0x99')]=function(_0x557eb6,_0x12dfb4){return this[_0x80b7('0x98')](_0x557eb6)[_0x80b7('0x1c5')](_0x12dfb4);};module[_0x80b7('0x1c6')]=AGIVertices; \ No newline at end of file +var _0xab86=['google_asr_language','appid','appsecret','includes','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','options','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','sip_id','getUser','no\x20user\x20found','opts','Executed\x20command\x20%s','DIAL','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','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','XMCS-UNIQUEID','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','arg_1','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','lodash','shelljs','moment','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','rpc','then','catch','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','googleTTS','google_tts_language','url','timeout','method','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','headers','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xab86,0x13e));var _0x6ab8=function(_0xc43047,_0x5a8843){_0xc43047=_0xc43047-0x0;var _0x391ffb=_0xab86[_0xc43047];return _0x391ffb;};'use strict';var fs=require('fs');var util=require(_0x6ab8('0x0'));var _=require(_0x6ab8('0x1'));var sh=require(_0x6ab8('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x6ab8('0x3'));var Mustache=require('mustache');var rp=require(_0x6ab8('0x4'));var logger=require('../../config/logger')(_0x6ab8('0x5'));var config=require(_0x6ab8('0x6'));var scripts=require(_0x6ab8('0x7'));var FILES_PATH=_0x6ab8('0x8');var recursiveMapAttributes=[_0x6ab8('0x9'),_0x6ab8('0xa')];var verticesWithRetry=[_0x6ab8('0xb'),_0x6ab8('0xc'),_0x6ab8('0xd')];var AGIVertices=function(_0x42c273,_0x2b429d,_0x20f27b){this[_0x6ab8('0xe')]=_0x42c273;this['rpc']=_0x2b429d;this['mailRpc']=_0x20f27b;};AGIVertices[_0x6ab8('0xf')]['getVariable']=function(_0x18d3a3,_0x3f35ea){this[_0x6ab8('0x10')]['getVariableById'](_0x18d3a3)[_0x6ab8('0x11')](function(_0x3f1c55){_0x3f35ea(null,_0x3f1c55?_0x3f1c55['name']:![]);})[_0x6ab8('0x12')](function(_0x1b9b34){_0x3f35ea(_0x1b9b34);});};AGIVertices[_0x6ab8('0xf')]['getVoiceQueue']=function(_0x36b082,_0x42b74e){this[_0x6ab8('0x10')][_0x6ab8('0x13')](_0x36b082)[_0x6ab8('0x11')](function(_0x1f560c){_0x42b74e(null,_0x1f560c?_0x1f560c[_0x6ab8('0x14')]:![]);})[_0x6ab8('0x12')](function(_0x293389){_0x42b74e(_0x293389);});};AGIVertices['prototype'][_0x6ab8('0x15')]=function(_0xcad413,_0x16309f){this['rpc'][_0x6ab8('0x16')](_0xcad413)[_0x6ab8('0x11')](function(_0x50cd9f){_0x16309f(null,_0x50cd9f?_0x50cd9f['name']:![]);})[_0x6ab8('0x12')](function(_0x57cd18){_0x16309f(_0x57cd18);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x17')]=function(_0x901115,_0x4e0fbd){this[_0x6ab8('0x10')][_0x6ab8('0x18')](_0x901115)[_0x6ab8('0x11')](function(_0x312183){_0x4e0fbd(null,_0x312183?_0x312183['dsn']:![]);})[_0x6ab8('0x12')](function(_0x18334d){_0x4e0fbd(_0x18334d);});};AGIVertices['prototype']['getUser']=function(_0x5284aa,_0x190af2){this[_0x6ab8('0x10')][_0x6ab8('0x19')](_0x5284aa)['then'](function(_0x1faca4){_0x190af2(null,_0x1faca4?_0x1faca4[_0x6ab8('0x14')]:![]);})['catch'](function(_0x503f94){_0x190af2(_0x503f94);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1a')]=function(_0x5694d0,_0x2f4c03){this[_0x6ab8('0x10')][_0x6ab8('0x1b')](_0x5694d0)[_0x6ab8('0x11')](function(_0x3ddaeb){_0x2f4c03(null,_0x3ddaeb?_0x3ddaeb[_0x6ab8('0x14')]:![]);})[_0x6ab8('0x12')](function(_0x1e26ed){_0x2f4c03(_0x1e26ed);});};AGIVertices['prototype']['getSound']=function(_0x334e21,_0x4aab83){var _0x3b69ab=this;this[_0x6ab8('0x10')][_0x6ab8('0x1c')](_0x334e21)['then'](function(_0x525687){_0x4aab83(null,_0x525687?_0x3b69ab['getSoundPath'](_0x525687[_0x6ab8('0x1d')]):![]);})[_0x6ab8('0x12')](function(_0x3723a7){_0x4aab83(_0x3723a7);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1e')]=function(_0x2bb926,_0x2f1266){this[_0x6ab8('0x10')][_0x6ab8('0x1f')](_0x2bb926)[_0x6ab8('0x11')](function(_0x211fb6){_0x2f1266(null,_0x211fb6?_0x211fb6:![]);})[_0x6ab8('0x12')](function(_0x10aed3){_0x2f1266(_0x10aed3);});};AGIVertices['prototype']['sendMailMessage']=function(_0x2454ab,_0x48f185,_0x4ece7e){this[_0x6ab8('0x20')][_0x6ab8('0x21')](_0x2454ab,_0x48f185)['then'](function(){_0x4ece7e(null);})[_0x6ab8('0x12')](function(_0x47e060){_0x4ece7e(_0x47e060);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x22')]=function(_0x562fa9,_0x4ef3d4){this[_0x6ab8('0x10')][_0x6ab8('0x23')](_0x562fa9)[_0x6ab8('0x11')](function(_0x447675){if(_0x447675){if(_0x447675[_0x6ab8('0x24')]){_0x4ef3d4(null,[_0x447675[_0x6ab8('0x25')]]);}else{_0x4ef3d4(null,_[_0x6ab8('0x26')](_0x447675[_0x6ab8('0x27')],'interval'));}}else{_0x4ef3d4(null,![]);}})[_0x6ab8('0x12')](function(_0x3ca7cc){_0x4ef3d4(_0x3ca7cc);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x28')]=function(_0x145e76){return util[_0x6ab8('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x145e76);};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x2a')]=function(_0x29321d,_0x587cc5,_0x51111d){odbc[_0x6ab8('0x2b')](_0x29321d,function(_0xff0b15){if(_0xff0b15){logger[_0x6ab8('0x2c')](_0x6ab8('0x2d'),_0xff0b15);_0x51111d(_0xff0b15);}else{logger[_0x6ab8('0x2e')]('ODBC\x20connection\x20successfully');odbc['query'](_0x587cc5,function(_0x2dc113,_0x5537f6){if(_0x2dc113){logger[_0x6ab8('0x2e')](_0x6ab8('0x2f'),_0x587cc5);_0x51111d(_0x2dc113);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x587cc5);odbc[_0x6ab8('0x30')](function(_0x27a353){if(_0x27a353){logger[_0x6ab8('0x2c')](_0x6ab8('0x31'),_0x27a353);}_0x51111d(null,_0x5537f6);});}});}});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x32')]=function(_0xef0ce5,_0x5aa6e5){this['rpc'][_0x6ab8('0x33')](_0xef0ce5)[_0x6ab8('0x11')](function(_0x146f43){_0x5aa6e5(null,_0x146f43?_0x146f43:![]);})[_0x6ab8('0x12')](function(_0x5ba971){_0x5aa6e5(_0x5ba971);});};AGIVertices[_0x6ab8('0xf')]['createSmsMessage']=function(_0x508cf4,_0x398313){this[_0x6ab8('0x10')][_0x6ab8('0x34')](_0x508cf4)[_0x6ab8('0x11')](function(_0x42400f){_0x398313(null,_0x42400f);})[_0x6ab8('0x12')](function(_0x355d72){_0x398313(_0x355d72);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x35')]=function(_0x45c70d,_0xc32c6e,_0x34bd98){this['rpc'][_0x6ab8('0x35')]({'uniqueid':this[_0x6ab8('0xe')][_0x6ab8('0x36')],'node':_0x45c70d[_0x6ab8('0x37')],'application':_0x45c70d['agicommand'],'data':_0xc32c6e||null,'project_name':this[_0x6ab8('0xe')]['arg_1'],'callerid':this[_0x6ab8('0xe')][_0x6ab8('0x38')]})['then'](function(_0x37e917){if(_0x34bd98){_0x34bd98(null,_0x37e917);}})[_0x6ab8('0x12')](function(_0x4b6593){if(_0x34bd98){_0x34bd98(_0x4b6593);}});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x39')]=function(_0x366cfb,_0x222e21,_0xaa443c,_0x541735){this['rpc']['createSquareRecording']({'uniqueid':this[_0x6ab8('0xe')][_0x6ab8('0x36')],'callerid':this['channel'][_0x6ab8('0x38')],'calleridname':this[_0x6ab8('0xe')][_0x6ab8('0x3a')],'context':this[_0x6ab8('0xe')][_0x6ab8('0x3b')],'extension':this[_0x6ab8('0xe')]['extension'],'priority':this[_0x6ab8('0xe')][_0x6ab8('0x3c')],'accountcode':this['channel'][_0x6ab8('0x3d')],'dnid':this[_0x6ab8('0xe')][_0x6ab8('0x3e')],'projectName':this['channel']['arg_1'],'saveName':_0x222e21,'filename':_0x366cfb[_0x6ab8('0x3f')]||_0x222e21,'savePath':_0xaa443c})['then'](function(_0x31965e){_0x541735(null,_0x31965e);})['catch'](function(_0x214b8e){_0x541735(_0x214b8e);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x40')]=function(_0x1d8817,_0x9a3d6e,_0x2347a8,_0x4a9295,_0x5e63ec){this['rpc'][_0x6ab8('0x40')]({'uniqueid':this['channel'][_0x6ab8('0x36')],'body':_0x1d8817,'direction':_0x9a3d6e,'providerName':_0x2347a8,'providerResponse':_0x4a9295})[_0x6ab8('0x11')](function(_0xeac0e3){if(_0x5e63ec){_0x5e63ec(null,_0xeac0e3);}})[_0x6ab8('0x12')](function(_0x428157){if(_0x5e63ec){_0x5e63ec(_0x428157);}});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x41')]=function(_0x173845,_0x4d4e88){this[_0x6ab8('0x10')][_0x6ab8('0x41')]({'firstName':_[_0x6ab8('0x42')](_0x173845[_0x6ab8('0x14')])||_['isNil'](_0x173845[_0x6ab8('0x14')])?_0x6ab8('0x43')+Math[_0x6ab8('0x44')]():_0x173845[_0x6ab8('0x14')],'lastName':_[_0x6ab8('0x42')](_0x173845[_0x6ab8('0x45')])||_[_0x6ab8('0x46')](_0x173845[_0x6ab8('0x45')])?null:_0x173845['lastName'],'phone':_0x173845[_0x6ab8('0x47')],'ListId':_0x173845[_0x6ab8('0x48')],'scheduledat':_0x173845['scheduledAt'],'callbackUniqueid':this[_0x6ab8('0xe')][_0x6ab8('0x36')],'tags':_0x6ab8('0x49'),'description':_0x6ab8('0x4a')+_0x173845[_0x6ab8('0x4b')][_0x6ab8('0x4c')](),'priority':_0x173845[_0x6ab8('0x4d')]})[_0x6ab8('0x11')](function(_0x302ae2){_0x4d4e88(null,_0x302ae2);})['catch'](function(_0x3f6c1f){_0x4d4e88(_0x3f6c1f);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x4e')]=function(_0x3b394c,_0x5a5ebb){this['rpc'][_0x6ab8('0x4f')](_0x3b394c)[_0x6ab8('0x11')](function(_0x39ff58){_0x5a5ebb(null,_0x39ff58?_0x39ff58[_0x6ab8('0x14')]:![]);})[_0x6ab8('0x12')](function(_0x1a232f){_0x5a5ebb(_0x1a232f);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x50')]=function(_0x210c83,_0x8b4be3,_0x597497){var _0x48962d={'role':'agent'};_0x48962d[_0x210c83]=this[_0x6ab8('0xe')][_0x6ab8('0x38')];this[_0x6ab8('0x10')]['agentPause'](_0x48962d,_0x8b4be3,this[_0x6ab8('0xe')][_0x6ab8('0x36')])[_0x6ab8('0x11')](function(_0x43d7d5){_0x597497(null,_[_0x6ab8('0x46')](_0x43d7d5)?![]:!![]);})['catch'](function(_0x30dc4f){logger['error'](_0x30dc4f);_0x597497(null,![]);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x51')]=function(_0x2ea704,_0x5ab635){var _0x21ee31={'role':_0x6ab8('0x52')};_0x21ee31[_0x2ea704]=this[_0x6ab8('0xe')][_0x6ab8('0x38')];this['rpc'][_0x6ab8('0x51')](_0x21ee31)[_0x6ab8('0x11')](function(_0x24451e){_0x5ab635(null,_[_0x6ab8('0x46')](_0x24451e)?![]:!![]);})['catch'](function(_0x3f4bd9){logger[_0x6ab8('0x2c')](_0x3f4bd9);_0x5ab635(null,![]);});};AGIVertices['prototype'][_0x6ab8('0x53')]=function(_0x57f4ef,_0x5cbed2){var _0x35da58={'role':_0x6ab8('0x52')};_0x35da58[_0x57f4ef]=this[_0x6ab8('0xe')][_0x6ab8('0x38')];this['rpc'][_0x6ab8('0x53')](_0x35da58)['then'](function(_0x23f09a){_0x5cbed2(null,_[_0x6ab8('0x46')](_0x23f09a)?![]:!![]);})[_0x6ab8('0x12')](function(_0x1e761e){logger[_0x6ab8('0x2c')](_0x1e761e);_0x5cbed2(null,![]);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x54')]=function(_0x5c710a,_0x35ac45){var _0x59c0c4={'role':_0x6ab8('0x52')};_0x59c0c4[_0x5c710a]=this[_0x6ab8('0xe')][_0x6ab8('0x38')];var _0x4003=_0x5c710a!=_0x6ab8('0x55')?util['format'](_0x6ab8('0x56'),'LOCAL',this[_0x6ab8('0xe')][_0x6ab8('0x38')]):undefined;this['rpc']['agentLogin'](_0x59c0c4,_0x4003)['then'](function(_0x4e8854){_0x35ac45(null,_[_0x6ab8('0x46')](_0x4e8854)?![]:!![]);})[_0x6ab8('0x12')](function(_0x485e20){logger['error'](_0x485e20);_0x35ac45(null,![]);});};AGIVertices[_0x6ab8('0xf')]['shellCommand']=function(_0x4a39e4,_0x3bc0be){sh[_0x6ab8('0x57')](_[_0x6ab8('0x58')](_0x4a39e4),function(_0x467df7,_0x50590c){var _0x36f922=_0x50590c[_0x6ab8('0x59')](/(\r\n|\n|\r)/gm,'');_0x3bc0be(null,_0x36f922);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x5a')]=function(_0x49bc0d,_0x297377){scripts['googleCloudTTS'](_0x49bc0d[_0x6ab8('0x5b')],_0x49bc0d[_0x6ab8('0x5c')]||_0x6ab8('0x5d'),_0x49bc0d[_0x6ab8('0x5d')],_0x49bc0d[_0x6ab8('0x5e')]||'en-US',_0x49bc0d[_0x6ab8('0x5f')]||_0x6ab8('0x60'),_0x49bc0d['audioEncoding']||'MP3')[_0x6ab8('0x11')](function(_0x100d3f){_0x297377(null,_0x100d3f);})[_0x6ab8('0x12')](function(_0x51eb24){_0x297377(_0x51eb24);});};AGIVertices[_0x6ab8('0xf')]['googleTTS']=function(_0x54e22d,_0x50be41){scripts[_0x6ab8('0x61')](_0x54e22d[_0x6ab8('0x5d')],_0x54e22d[_0x6ab8('0x62')]||'en',0x1)['then'](function(_0x2dc7a8){_0x50be41(null,_0x2dc7a8);})[_0x6ab8('0x12')](function(_0x398ca9){_0x50be41(_0x398ca9);});};AGIVertices[_0x6ab8('0xf')]['restAPI']=function(_0x47ad06,_0x2c4aab){var _0x17fde9={'uri':_0x47ad06[_0x6ab8('0x63')],'method':_0x47ad06['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x47ad06[_0x6ab8('0x64')])==='number'&&parseInt(_0x47ad06[_0x6ab8('0x64')])>=0x1?parseInt(_0x47ad06['timeout'])*0x3e8:0x5*0x3e8};if(_['includes'](['POST','PUT'],_0x17fde9[_0x6ab8('0x65')][_0x6ab8('0x66')]())){try{_0x17fde9['body']=_0x47ad06['rawBody']?JSON[_0x6ab8('0x67')](_0x47ad06['rawBody']):{};}catch(_0x13fc48){logger[_0x6ab8('0x2c')](_0x6ab8('0x68'),_0x13fc48);}}try{_0x17fde9['headers']=_0x47ad06[_0x6ab8('0x9')]?JSON[_0x6ab8('0x67')](_0x47ad06[_0x6ab8('0x9')]):{};}catch(_0x7f1ee4){logger[_0x6ab8('0x2c')](_0x6ab8('0x69'),_0x7f1ee4);}if(_0x47ad06[_0x6ab8('0x6a')]){try{var _0x2bde26=require(_0x47ad06[_0x6ab8('0x6a')])['sync'](this,_0x17fde9);_0x17fde9[_0x6ab8('0x6b')]=Mustache[_0x6ab8('0x6c')](_0x47ad06[_0x6ab8('0x63')],_0x2bde26,{},['$$','$$']);if(_0x17fde9[_0x6ab8('0x6d')]){_0x17fde9[_0x6ab8('0x6d')]=JSON[_0x6ab8('0x67')](Mustache[_0x6ab8('0x6c')](JSON[_0x6ab8('0x6e')](_0x17fde9[_0x6ab8('0x6d')]),_0x2bde26,{},['$$','$$']));}if(_0x17fde9['body']){_0x17fde9[_0x6ab8('0x6f')]=JSON[_0x6ab8('0x67')](Mustache[_0x6ab8('0x6c')](JSON[_0x6ab8('0x6e')](_0x17fde9['body']),_0x2bde26,{},['$$','$$']));}}catch(_0x4f53c2){logger['error'](_0x6ab8('0x70'),_0x4f53c2);}}rp(_0x17fde9)[_0x6ab8('0x11')](function(_0x37c76e){var _0x3602b7={'statusCode':_0x37c76e[_0x6ab8('0x71')]||0xc8,'statusMessage':_0x37c76e[_0x6ab8('0x72')]||'OK','headers':_0x37c76e[_0x6ab8('0x6d')]||{},'body':_0x37c76e[_0x6ab8('0x6f')]||{}};_0x2c4aab(null,_0x3602b7);})[_0x6ab8('0x12')](function(_0x80d732){var _0x3ee017={'statusCode':_0x80d732[_0x6ab8('0x71')]||0x1f4,'statusMessage':_0x80d732['message']||_0x6ab8('0x73'),'headers':_0x80d732['options']['headers']||{},'body':_0x80d732['options'][_0x6ab8('0x6f')]||{}};_0x2c4aab(null,_0x3ee017);});};AGIVertices['prototype'][_0x6ab8('0x74')]=function(_0x40276f,_0x5e30d0){scripts[_0x6ab8('0x74')](this[_0x6ab8('0xe')][_0x6ab8('0x36')],_0x40276f[_0x6ab8('0x75')],_0x40276f[_0x6ab8('0x5d')],_0x40276f[_0x6ab8('0x76')]||'en')[_0x6ab8('0x11')](function(_0x417b6b){_0x5e30d0(null,_0x417b6b);})[_0x6ab8('0x12')](function(_0x32452a){_0x5e30d0(_0x32452a);});};AGIVertices['prototype'][_0x6ab8('0x77')]=function(_0x58ba1b,_0x2b07af){scripts[_0x6ab8('0x77')](this['channel'][_0x6ab8('0x36')],_0x58ba1b[_0x6ab8('0x78')],_0x58ba1b[_0x6ab8('0x79')],_0x58ba1b[_0x6ab8('0x7a')],_0x58ba1b[_0x6ab8('0x5d')],_0x58ba1b['dialogflowV2_language']||'en')['then'](function(_0x787b8e){_0x2b07af(null,_0x787b8e);})['catch'](function(_0x205194){_0x2b07af(_0x205194);});};AGIVertices['prototype'][_0x6ab8('0x7b')]=function(_0x38696c,_0x63039a){scripts[_0x6ab8('0x7b')](this[_0x6ab8('0xe')],_0x38696c)[_0x6ab8('0x11')](function(_0x2d6214){_0x63039a(null,_0x2d6214);})[_0x6ab8('0x12')](function(_0x4ee150){_0x63039a(_0x4ee150);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x7c')]=function(_0x421551,_0x1196c8){scripts[_0x6ab8('0x7c')](_0x421551[_0x6ab8('0x75')],_0x421551[_0x6ab8('0x5d')],_0x421551[_0x6ab8('0x7d')]||_0x6ab8('0x7e'),_0x421551[_0x6ab8('0x7f')])[_0x6ab8('0x11')](function(_0x5c21ba){_0x1196c8(null,_0x5c21ba);})['catch'](function(_0x3931d8){_0x1196c8(_0x3931d8);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x80')]=function(_0x53b81e,_0x1e2f08,_0x49109a){scripts[_0x6ab8('0x80')](_0x1e2f08,_0x53b81e['key'],_0x53b81e[_0x6ab8('0x81')]||'en-US',this[_0x6ab8('0x82')](_0x53b81e[_0x6ab8('0x83')])?_0x53b81e[_0x6ab8('0x83')]:undefined)[_0x6ab8('0x11')](function(_0xbd33ae){_0x49109a(null,_0xbd33ae);})[_0x6ab8('0x12')](function(_0x99aabe){_0x49109a(_0x99aabe);});};AGIVertices['prototype']['awsPolly']=function(_0x261dfc,_0x9502ea){scripts['awsPolly'](_0x261dfc[_0x6ab8('0x84')],_0x261dfc[_0x6ab8('0x85')],_0x261dfc['aws_polly_region'],_0x261dfc[_0x6ab8('0x86')]||_0x6ab8('0x87'),_0x261dfc[_0x6ab8('0x5d')],_0x261dfc[_0x6ab8('0x88')]||_0x6ab8('0x5d'))[_0x6ab8('0x11')](function(_0x2b1aea){_0x9502ea(null,_0x2b1aea);})[_0x6ab8('0x12')](function(_0x1a7f92){_0x9502ea(_0x1a7f92);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x89')]=function(_0x1f76a0,_0x529083){scripts[_0x6ab8('0x89')](this['channel'][_0x6ab8('0x36')],_0x1f76a0[_0x6ab8('0x84')],_0x1f76a0[_0x6ab8('0x85')],_0x1f76a0['aws_lex_region'],_0x1f76a0[_0x6ab8('0x5d')],_0x1f76a0[_0x6ab8('0x8a')])[_0x6ab8('0x11')](function(_0xce6205){_0x529083(null,_0xce6205);})[_0x6ab8('0x12')](function(_0x3385ca){_0x529083(_0x3385ca);});};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x8b')]=function(_0x5e04a0,_0x355316,_0x1028c1){scripts[_0x6ab8('0x8b')](_0x355316,_0x5e04a0['key'],_0x5e04a0[_0x6ab8('0x8c')]||_0x6ab8('0x7e'))['then'](function(_0x4beffc){_0x1028c1(null,_0x4beffc);})[_0x6ab8('0x12')](function(_0x20b113){_0x1028c1(_0x20b113);});};AGIVertices[_0x6ab8('0xf')]['tildeASR']=function(_0xb3c087,_0x371c1b,_0x1ab6a9){scripts['tildeASR'](_0x371c1b,_0xb3c087[_0x6ab8('0x8d')],_0xb3c087[_0x6ab8('0x8e')],_0xb3c087[_0x6ab8('0x6b')])[_0x6ab8('0x11')](function(_0xe2935b){_0x1ab6a9(null,_0xe2935b);})[_0x6ab8('0x12')](function(_0x15201e){_0x1ab6a9(_0x15201e);});};AGIVertices[_0x6ab8('0xf')]['clear']=function(_0x25fa56){var _0x341981=_[_0x6ab8('0x8f')](verticesWithRetry,_0x25fa56['agicommand'])?_0x25fa56:_[_0x6ab8('0x90')](_0x25fa56);for(var _0xb43d87 in _0x341981){if(_0x341981['hasOwnProperty'](_0xb43d87)){if(_0x341981[_0xb43d87]&&_[_0x6ab8('0x91')](_0x341981[_0xb43d87])){if(_['includes'](recursiveMapAttributes,_0xb43d87)){_0x341981[_0xb43d87]=this[_0x6ab8('0x92')](_0x341981[_0xb43d87]);}else{_0x341981[_0xb43d87]=this['replaceAllVariables'](_0x341981[_0xb43d87]);}}}}return _0x341981;};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x93')]=function(_0x1c59b3){for(var _0x225541 in _0x1c59b3){if(_0x1c59b3[_0x6ab8('0x94')](_0x225541)){if(_[_0x6ab8('0x95')](_0x1c59b3[_0x225541])){this[_0x6ab8('0x93')](_0x1c59b3[_0x225541]);}else if(_[_0x6ab8('0x96')](_0x1c59b3[_0x225541])){for(var _0xf0190d=0x0;_0xf0190d<_0x1c59b3[_0x225541][_0x6ab8('0x97')];_0xf0190d++){this[_0x6ab8('0x93')](_0x1c59b3[_0x225541][_0xf0190d]);}}else if(_[_0x6ab8('0x91')](_0x1c59b3[_0x225541])){_0x1c59b3[_0x225541]=this[_0x6ab8('0x98')](_0x1c59b3[_0x225541]);}}}};AGIVertices['prototype'][_0x6ab8('0x99')]=function(_0x5c9d5d,_0x107cad){for(var _0x191637 in _0x5c9d5d){if(_0x5c9d5d[_0x6ab8('0x94')](_0x191637)){if(_[_0x6ab8('0x95')](_0x5c9d5d[_0x191637])){if(!_[_0x6ab8('0x42')](_0x5c9d5d[_0x191637])){this['saveRestApiResult'](_0x5c9d5d[_0x191637],util['format'](_0x6ab8('0x9a'),_0x107cad,_0x191637));}}else if(_[_0x6ab8('0x96')](_0x5c9d5d[_0x191637])){for(var _0x13c3f3=0x0;_0x13c3f3<_0x5c9d5d[_0x191637][_0x6ab8('0x97')];_0x13c3f3++){this[_0x6ab8('0x99')](_0x5c9d5d[_0x191637][_0x13c3f3],util[_0x6ab8('0x29')](_0x6ab8('0x9a'),_0x107cad,_0x191637+'['+_0x13c3f3+']'));}}else{if(!_[_0x6ab8('0x46')](_0x5c9d5d[_0x191637])){this['channel'][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x9a'),_0x107cad,_0x191637),_0x5c9d5d[_0x191637]);}}}}};AGIVertices[_0x6ab8('0xf')]['replaceObjectAllVariables']=function(_0x26bbae){try{var _0x675c04=JSON[_0x6ab8('0x67')](_0x26bbae);this[_0x6ab8('0x93')](_0x675c04);return JSON[_0x6ab8('0x6e')](_0x675c04);}catch(_0xd8c3d1){return this['replaceAllVariables'](_0x26bbae);}};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x98')]=function(_0x552fa8){var _0xe67557=_0x552fa8[_0x6ab8('0x9c')]('{');for(var _0x3d281a=0x1;_0x3d281a<_0xe67557[_0x6ab8('0x97')];_0x3d281a+=0x1){var _0x5c6226=_0xe67557[_0x3d281a][_0x6ab8('0x9c')]('}');if(_0x5c6226[_0x6ab8('0x97')]>0x1){_0x552fa8=_0x552fa8[_0x6ab8('0x9d')]('{'+_0x5c6226[0x0]+'}',this[_0x6ab8('0xe')][_0x6ab8('0x9e')](_0x5c6226[0x0])[_0x6ab8('0x9f')]||_0x5c6226[0x0]);}}if(_0xe67557[_0x6ab8('0x97')]===0x1){return _0x552fa8[_0x6ab8('0x4c')]();}return this[_0x6ab8('0x98')](_0x552fa8);};AGIVertices['prototype'][_0x6ab8('0xa0')]=function(_0x3e8d22,_0x51c44c){var _0x166a52=this['channel'][_0x6ab8('0x9e')](_0x3e8d22);if(_0x166a52[_0x6ab8('0xa1')]===-0x1){return _0x166a52;}logger['info'](util[_0x6ab8('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x51c44c,_0x166a52['extra']));return this['channel']['setVariable'](_0x51c44c,_0x166a52[_0x6ab8('0x9f')]);};AGIVertices['prototype']['isConfigured']=function(_0x1a1cf6){return _0x1a1cf6&&_0x1a1cf6!=='0'&&_0x1a1cf6!=='-1'&&_0x1a1cf6!=='';};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xa2')]=function(_0x339e10){this['createSquareDetailsReport']['sync'](this,_0x339e10,'-');_0x339e10[_0x6ab8('0xa3')]=_0x339e10[_0x6ab8('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x6ab8('0xf')]['mrcpsynth']=function(_0x2c7ca2){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0xa4'),_0x2c7ca2[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x2c7ca2[_0x6ab8('0x5d')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}var _0x19991f='\x22'+_0x2c7ca2[_0x6ab8('0x5d')]+'\x22';if(this[_0x6ab8('0x82')](_0x2c7ca2['options'])){_0x19991f+=','+_0x2c7ca2[_0x6ab8('0xa7')];}var _0x263510=this['channel']['exec'](_0x6ab8('0xa8'),_0x19991f);if(_0x263510[_0x6ab8('0xa1')]===-0x1){return _0x263510;}return this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')](_0x6ab8('0xa9'),_0x19991f));};AGIVertices['prototype']['mrcprecog']=function(_0x36125e){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0xaa'),_0x36125e['label']));if(!this[_0x6ab8('0x82')](_0x36125e['grammar'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xab'));}var _0x42eb6f=_0x36125e[_0x6ab8('0xac')];if(this[_0x6ab8('0x82')](_0x36125e[_0x6ab8('0xa7')])){_0x42eb6f+=','+_0x36125e[_0x6ab8('0xa7')];}var _0x2f7d7c=this[_0x6ab8('0xe')][_0x6ab8('0x57')](_0x6ab8('0xad'),_0x42eb6f);if(_0x2f7d7c[_0x6ab8('0xa1')]===-0x1){return _0x2f7d7c;}var _0x413631=this[_0x6ab8('0xa0')](_0x6ab8('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x413631[_0x6ab8('0xa1')]===-0x1){return _0x413631;}var _0x38c2d7=this[_0x6ab8('0xa0')](_0x6ab8('0xaf'),_0x6ab8('0xb0'));if(_0x38c2d7[_0x6ab8('0xa1')]===-0x1){return _0x38c2d7;}var _0x52cd36=this[_0x6ab8('0xa0')](_0x6ab8('0xb1'),_0x6ab8('0xb2'));if(_0x52cd36[_0x6ab8('0xa1')]===-0x1){return _0x52cd36;}return this['channel']['noop'](util[_0x6ab8('0x29')](_0x6ab8('0xb3'),_0x42eb6f));};AGIVertices['prototype'][_0x6ab8('0x5')]=function(_0x42d885){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0xb4'),_0x42d885['label']));return this[_0x6ab8('0xe')][_0x6ab8('0x5')]([_0x42d885[_0x6ab8('0xb5')],_0x42d885[_0x6ab8('0xb6')]]);};AGIVertices['prototype'][_0x6ab8('0xb7')]=function(_0x3d16e6){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0xb8'),_0x3d16e6[_0x6ab8('0x37')]));if(this[_0x6ab8('0x82')](_0x3d16e6[_0x6ab8('0x64')])){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0xb9'),_0x3d16e6[_0x6ab8('0x64')]));var _0x39b172=this[_0x6ab8('0xe')][_0x6ab8('0xba')](_0x3d16e6['timeout']);if(_0x39b172[_0x6ab8('0xa1')]===-0x1){return _0x39b172;}}return this[_0x6ab8('0xe')][_0x6ab8('0xb7')]();};AGIVertices['prototype'][_0x6ab8('0x49')]=function(_0x202441){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0xbb'),_0x202441['label']));if(!this[_0x6ab8('0x82')](_0x202441[_0x6ab8('0x48')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x202441,_0x6ab8('0xbc'));}_0x202441['scheduledAt']=moment();if(this['isConfigured'](_0x202441[_0x6ab8('0xbd')])){_0x202441[_0x6ab8('0x4b')]=moment()[_0x6ab8('0xbe')](_0x202441['delay'],_0x6ab8('0xbf'));}if(!this[_0x6ab8('0x82')](_0x202441[_0x6ab8('0x4d')])){_0x202441[_0x6ab8('0x4d')]=0x2;}this['createCmContact'][_0x6ab8('0xc0')](this,_0x202441);return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xc1'),_0x202441[_0x6ab8('0x47')],_0x202441['list_id'],_0x202441[_0x6ab8('0x4b')]));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xc2')]=function(_0x3b90b6){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3b90b6[_0x6ab8('0x37')]));var _0x334414=this[_0x6ab8('0xe')]['exec'](_0x3b90b6['application'],_0x3b90b6[_0x6ab8('0xa7')]);if(_0x334414[_0x6ab8('0xa1')]===-0x1){return _0x334414;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xc3'),_0x3b90b6[_0x6ab8('0xc4')],_0x3b90b6['options']));};AGIVertices[_0x6ab8('0xf')]['lumenvoxtts']=function(_0x5ed5ae){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0xc5'),_0x5ed5ae[_0x6ab8('0x37')]));if(!this['isConfigured'](_0x5ed5ae[_0x6ab8('0x5d')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}var _0x2688f3='\x22'+_0x5ed5ae[_0x6ab8('0x5d')]+'\x22';if(this[_0x6ab8('0x82')](_0x5ed5ae[_0x6ab8('0xa7')])){_0x2688f3+=','+_0x5ed5ae['options'];}var _0x19df65=this[_0x6ab8('0xe')][_0x6ab8('0x57')](_0x6ab8('0xa8'),_0x2688f3);if(_0x19df65['result']===-0x1){return _0x19df65;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0xa9'),_0x2688f3));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xc6')]=function(_0x456b19){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x456b19[_0x6ab8('0x37')]));if(!this['isConfigured'](_0x456b19[_0x6ab8('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x1f1043='\x22'+_0x456b19[_0x6ab8('0x5d')]+'\x22';if(this[_0x6ab8('0x82')](_0x456b19['options'])){_0x1f1043+=','+_0x456b19[_0x6ab8('0xa7')];}var _0x7d3b0d=this[_0x6ab8('0xe')][_0x6ab8('0x57')]('MRCPSynth',_0x1f1043);if(_0x7d3b0d[_0x6ab8('0xa1')]===-0x1){return _0x7d3b0d;}return this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xa9'),_0x1f1043));};AGIVertices[_0x6ab8('0xf')]['lumenvoxasr']=function(_0x43a0be){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0xc7'),_0x43a0be[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x43a0be[_0x6ab8('0xac')])){return this[_0x6ab8('0xe')]['noop']('no\x20grammar\x20configured');}var _0x2dab2f=_0x43a0be['grammar'];if(this[_0x6ab8('0x82')](_0x43a0be[_0x6ab8('0xa7')])){_0x2dab2f+=','+_0x43a0be['options'];}var _0x181e03=this['channel'][_0x6ab8('0x57')]('MRCPRecog',_0x2dab2f);if(_0x181e03[_0x6ab8('0xa1')]===-0x1){return _0x181e03;}var _0x213288=this[_0x6ab8('0xa0')](_0x6ab8('0xae'),_0x6ab8('0xc8'));if(_0x213288[_0x6ab8('0xa1')]===-0x1){return _0x213288;}var _0xcbed19=this['getAndSetVariable'](_0x6ab8('0xaf'),_0x6ab8('0xc9'));if(_0xcbed19[_0x6ab8('0xa1')]===-0x1){return _0xcbed19;}var _0x3ec074=this[_0x6ab8('0xa0')](_0x6ab8('0xb1'),'LUMENVOX_ASR_INSTANCE');if(_0x3ec074[_0x6ab8('0xa1')]===-0x1){return _0x3ec074;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0xb3'),_0x2dab2f));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xca')]=function(_0x364ea4){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0xcb'),_0x364ea4[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x364ea4['grammar'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xab'));}var _0x377e3a=_0x364ea4[_0x6ab8('0xac')];if(this[_0x6ab8('0x82')](_0x364ea4[_0x6ab8('0xa7')])){_0x377e3a+=','+_0x364ea4[_0x6ab8('0xa7')];}var _0x1c5654=this[_0x6ab8('0xe')]['exec'](_0x6ab8('0xad'),_0x377e3a);if(_0x1c5654[_0x6ab8('0xa1')]===-0x1){return _0x1c5654;}var _0x506655=this[_0x6ab8('0xa0')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x506655[_0x6ab8('0xa1')]===-0x1){return _0x506655;}var _0x544092=this[_0x6ab8('0xa0')](_0x6ab8('0xaf'),_0x6ab8('0xcc'));if(_0x544092['result']===-0x1){return _0x544092;}var _0x5a448d=this['getAndSetVariable'](_0x6ab8('0xb1'),_0x6ab8('0xcd'));if(_0x5a448d[_0x6ab8('0xa1')]===-0x1){return _0x5a448d;}return this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x377e3a));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xce')]=function(_0x19378e){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x19378e['label']));if(!this[_0x6ab8('0x82')](_0x19378e[_0x6ab8('0xcf')])){return this[_0x6ab8('0xe')]['error'](_0x19378e,_0x6ab8('0xd0'));}var _0x43648e=this[_0x6ab8('0x17')][_0x6ab8('0xc0')](this,_0x19378e['odbc_id']);if(!_0x43648e){return this['channel'][_0x6ab8('0x2c')](_0x19378e,_0x6ab8('0xd1'));}if(!this[_0x6ab8('0x82')](_0x19378e['query'])){return this[_0x6ab8('0xe')]['error'](_0x19378e,_0x6ab8('0xd2'));}var _0x1ed40a=_0x19378e[_0x6ab8('0xd3')][_0x6ab8('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0xd4'),_0x1ed40a));var _0x49a264=this['getQueryOdbc'][_0x6ab8('0xc0')](this,_0x43648e,_0x1ed40a);this['createSquareDetailsReport'][_0x6ab8('0xc0')](this,_0x19378e,_0x1ed40a);if(!this['isConfigured'](_0x19378e[_0x6ab8('0xd5')])){return this[_0x6ab8('0xe')]['noop'](_0x6ab8('0xd6'));}var _0x4b31f8=this[_0x6ab8('0x9e')][_0x6ab8('0xc0')](this,_0x19378e['variable_id']);if(!_0x4b31f8){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x19378e,_0x6ab8('0xd7'));}var _0x45cef0=this;_0x49a264[_0x6ab8('0xd8')](function(_0x43040c,_0x1ea191){Object[_0x6ab8('0xd9')](_0x43040c)[_0x6ab8('0xd8')](function(_0x5d5be9){_0x45cef0[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0xda'),_0x4b31f8,_0x1ea191,_0x5d5be9),_0x43040c[_0x5d5be9]);});});this[_0x6ab8('0xe')]['setVariable'](util['format']('%s_ROWS_COUNT',_0x4b31f8),_0x49a264[_0x6ab8('0x97')]);return this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xdb'),_0x4b31f8));};AGIVertices[_0x6ab8('0xf')]['dial']=function(_0x3b39ee){logger['debug'](util[_0x6ab8('0x29')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3b39ee['label']));if(!this[_0x6ab8('0x82')](_0x3b39ee[_0x6ab8('0xdc')])){return this['channel'][_0x6ab8('0x2c')](_0x3b39ee,'no\x20user\x20selected');}var _0xd3e46e=this[_0x6ab8('0xdd')][_0x6ab8('0xc0')](this,_0x3b39ee['sip_id']);if(!_0xd3e46e){return this[_0x6ab8('0xe')]['error'](_0x3b39ee,_0x6ab8('0xde'));}var _0x335f86=this['channel']['exec']('DIAL',[util['format']('SIP/%s',_0xd3e46e),_0x3b39ee['timeout'],_0x3b39ee[_0x6ab8('0xdf')],_0x3b39ee['url']]);if(_0x335f86[_0x6ab8('0xa1')]===-0x1){return _0x335f86;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xe0'),_0x6ab8('0xe1')));};AGIVertices[_0x6ab8('0xf')]['dialogflow']=function(_0xa35de3){logger[_0x6ab8('0x2e')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0xa35de3[_0x6ab8('0x37')]));if(!this['isConfigured'](_0xa35de3['key'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xe2'));}if(!this[_0x6ab8('0x82')](_0xa35de3['text'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}this[_0x6ab8('0xe')][_0x6ab8('0xe3')]=!![];this[_0x6ab8('0x35')](_0xa35de3);this[_0x6ab8('0x40')](_0xa35de3[_0x6ab8('0x5d')],'in','','');this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0xe4'),_0xa35de3['text']));var _0x95d8a7=this[_0x6ab8('0x74')][_0x6ab8('0xc0')](this,_0xa35de3);if(_0x95d8a7){for(var _0x5abddf in _0x95d8a7){if(_0x95d8a7[_0x6ab8('0x94')](_0x5abddf)){this[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0xe5'),_0x5abddf[_0x6ab8('0x66')]()),_0x95d8a7[_0x5abddf]);}}this[_0x6ab8('0x40')](_0x95d8a7[_0x6ab8('0xe6')],_0x6ab8('0xe7'),_0x6ab8('0xe8'),'');return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0xe9'),_0x95d8a7[_0x6ab8('0xe6')]));}return this['channel'][_0x6ab8('0x2c')](_0xa35de3,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x1811e9){logger['info'](util['format'](_0x6ab8('0xea'),_0x1811e9[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x1811e9[_0x6ab8('0x78')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xeb'));}if(!this[_0x6ab8('0x82')](_0x1811e9[_0x6ab8('0x79')])){return this['channel']['noop']('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x1811e9[_0x6ab8('0x7a')])){return this['channel']['noop'](_0x6ab8('0xec'));}if(!this[_0x6ab8('0x82')](_0x1811e9['dialogflowV2_language'])){return this['channel']['noop'](_0x6ab8('0xed'));}if(!this[_0x6ab8('0x82')](_0x1811e9['text'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')]('no\x20text\x20configured');}this[_0x6ab8('0xe')]['bot']=!![];this[_0x6ab8('0x35')](_0x1811e9);this['createSquareMessage'](_0x1811e9[_0x6ab8('0x5d')],'in','','');this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xee'),_0x1811e9[_0x6ab8('0x5d')]));var _0x5e9723=this['googleDialogflowV2'][_0x6ab8('0xc0')](this,_0x1811e9);if(_0x5e9723){for(var _0x40a5ea in _0x5e9723){if(_0x5e9723[_0x6ab8('0x94')](_0x40a5ea)){if(_0x40a5ea!==_0x6ab8('0xef')){this[_0x6ab8('0xe')]['setVariable'](util[_0x6ab8('0x29')](_0x6ab8('0xe5'),_0x40a5ea[_0x6ab8('0x66')]()),_0x5e9723[_0x40a5ea]);}}}this['createSquareMessage'](_0x5e9723['speech'],_0x6ab8('0xe7'),_0x6ab8('0xf0'),_0x5e9723[_0x6ab8('0xef')]);return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('DialogflowV2\x20Result\x20%s',_0x5e9723[_0x6ab8('0xe6')]));}return this['channel'][_0x6ab8('0x2c')](_0x1811e9,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xf1')]=function(_0x30fc7a){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0xf2'),_0x30fc7a['label']));if(!this[_0x6ab8('0x82')](_0x30fc7a[_0x6ab8('0xf3')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xf4'));}if(!this['isConfigured'](_0x30fc7a[_0x6ab8('0xf5')])){return this['channel'][_0x6ab8('0xa5')](_0x6ab8('0xf6'));}if(!this[_0x6ab8('0x82')](_0x30fc7a[_0x6ab8('0xf7')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x30fc7a['ndassistant_url'])){return this['channel']['noop'](_0x6ab8('0xa6'));}this[_0x6ab8('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x30fc7a);this[_0x6ab8('0x40')](_0x30fc7a[_0x6ab8('0x5d')],'in','','');this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0xf8'),_0x30fc7a[_0x6ab8('0x5d')]));var _0x2d14ae=this[_0x6ab8('0x7b')][_0x6ab8('0xc0')](this,_0x30fc7a);if(_0x2d14ae){for(var _0x3e1763 in _0x2d14ae){if(_0x2d14ae['hasOwnProperty'](_0x3e1763)){this[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0xf9'),_0x3e1763[_0x6ab8('0x66')]()),_0x2d14ae[_0x3e1763]);}}this[_0x6ab8('0x40')](_0x2d14ae[_0x6ab8('0xe6')],_0x6ab8('0xe7'),_0x6ab8('0xf1'),'');if(_0x2d14ae[_0x6ab8('0xfa')]){this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x2d14ae[_0x6ab8('0xfa')]));var _0x4b9a40=this['channel'][_0x6ab8('0xfb')](_0x2d14ae[_0x6ab8('0xfa')]);try{fs[_0x6ab8('0xfc')](_0x2d14ae['audiofile']+_0x6ab8('0xfd'));}catch(_0x1e149c){logger[_0x6ab8('0x2c')](_0x1e149c);}return _0x4b9a40;}else{return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xfe'),_0x2d14ae[_0x6ab8('0xe6')]));}}return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x30fc7a,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xff')]=function(_0x406cf3){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x100'),_0x406cf3['label']));return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xff'));};AGIVertices['prototype'][_0x6ab8('0x101')]=function(_0x11fb1a){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x102'),_0x11fb1a[_0x6ab8('0x37')]));var _0x2c20bf='';if(_0x11fb1a[_0x6ab8('0x103')]){if(!this[_0x6ab8('0x82')](_0x11fb1a[_0x6ab8('0x103')])){return this[_0x6ab8('0xe')]['error'](_0x11fb1a,_0x6ab8('0x104'));}else{var _0x294b36=parseInt(_0x11fb1a['trunk_id'],0xa);if(isNaN(_0x294b36)){_0x2c20bf=_0x11fb1a['trunk_id'];}else{_0x2c20bf=this['getTrunk']['sync'](this,_0x11fb1a[_0x6ab8('0x103')]);if(!_0x2c20bf){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x11fb1a,_0x6ab8('0x105'));}}}}else if(_0x11fb1a['trunk_name']){_0x2c20bf=_0x11fb1a[_0x6ab8('0x106')];}else{return this['channel'][_0x6ab8('0x2c')](_0x11fb1a,'no\x20trunk\x20selected');}var _0x18ed94=this['channel'][_0x6ab8('0x57')](_0x6ab8('0xe1'),[util[_0x6ab8('0x29')]('SIP/%s/%s',_0x2c20bf,_0x11fb1a[_0x6ab8('0x47')]),_0x11fb1a[_0x6ab8('0x64')],_0x11fb1a[_0x6ab8('0xdf')],_0x11fb1a[_0x6ab8('0x63')]]);if(_0x18ed94[_0x6ab8('0xa1')]===-0x1){return _0x18ed94;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x107')]=function(_0x18108b){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x108'),_0x18108b[_0x6ab8('0x37')]));return this['channel']['noop'](_0x6ab8('0x107'));};AGIVertices[_0x6ab8('0xf')]['getdigits']=function(_0x38b523){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0x109'),_0x38b523[_0x6ab8('0x37')]));if(_0x38b523[_0x6ab8('0xa3')]===0x0){return this[_0x6ab8('0xa2')](_0x38b523);}_0x38b523[_0x6ab8('0xa3')]-=0x1;if(!this[_0x6ab8('0x82')](_0x38b523[_0x6ab8('0x10a')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x38b523,'no\x20file\x20audio\x20selected');}var _0x82a5c3=this[_0x6ab8('0x10b')]['sync'](this,_0x38b523[_0x6ab8('0x10a')]);if(!_0x82a5c3){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x38b523,'no\x20file\x20audio\x20found');}if(!this[_0x6ab8('0x82')](_0x38b523[_0x6ab8('0xd5')])){return this['channel'][_0x6ab8('0x2c')](_0x6ab8('0xd6'));}var _0x44a9d4=this[_0x6ab8('0xe')][_0x6ab8('0x10c')](_0x82a5c3,_0x38b523[_0x6ab8('0x10d')],_0x38b523[_0x6ab8('0x10e')]);var _0x2e2560=_0x44a9d4[_0x6ab8('0xa1')]?_0x44a9d4[_0x6ab8('0xa1')][_0x6ab8('0x4c')]():'';logger[_0x6ab8('0x2e')](_0x6ab8('0x10f'),JSON[_0x6ab8('0x6e')](_0x44a9d4));if(_0x44a9d4[_0x6ab8('0xa1')]===-0x1){this[_0x6ab8('0x35')][_0x6ab8('0xc0')](this,_0x38b523,_0x2e2560);return _0x44a9d4;}else if(_0x44a9d4['extra']===_0x6ab8('0x64')){_0x44a9d4[_0x6ab8('0xa1')]=_0x2e2560[_0x6ab8('0x97')]>=parseInt(_0x38b523[_0x6ab8('0x110')])?'x':'i';}else{_0x44a9d4['result']=_0x2e2560[_0x6ab8('0x97')]>=parseInt(_0x38b523[_0x6ab8('0x110')])&&_0x2e2560[_0x6ab8('0x97')]<=parseInt(_0x38b523['maxdigit'])?'x':'i';}var _0x138d3d=this[_0x6ab8('0x9e')][_0x6ab8('0xc0')](this,_0x38b523[_0x6ab8('0xd5')]);if(!_0x138d3d){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x38b523,_0x6ab8('0xd7'));}this['channel'][_0x6ab8('0x9b')](_0x138d3d,_0x2e2560);if(this[_0x6ab8('0x82')](_0x38b523[_0x6ab8('0x111')])){var _0x3095b8=parseInt(_0x38b523[_0x6ab8('0x111')],0xa);var _0x36f858=rs[_0x6ab8('0x112')]({'charset':'*','length':_0x3095b8});var _0x44e92c=_0x2e2560[_0x6ab8('0x97')];if(_0x44e92c>0x0){if(_0x44e92c>_0x3095b8){this[_0x6ab8('0x35')][_0x6ab8('0xc0')](this,_0x38b523,_0x38b523['hiddendigitspos']===_0x6ab8('0x113')?_0x36f858+_0x2e2560[_0x6ab8('0x114')](_0x3095b8):_0x2e2560['substr'](0x0,_0x44e92c-_0x3095b8)+_0x36f858);}else{this['createSquareDetailsReport'][_0x6ab8('0xc0')](this,_0x38b523,rs[_0x6ab8('0x112')]({'charset':'*','length':_0x44e92c}));}}else{this[_0x6ab8('0x35')]['sync'](this,_0x38b523,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x38b523,_0x2e2560);}return _0x44a9d4;};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xd')]=function(_0xbdc65d){logger['info'](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0xbdc65d['label']));return this[_0x6ab8('0xc')](_0xbdc65d);};AGIVertices[_0x6ab8('0xf')]['goal']=function(_0x283641){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x115'),_0x283641[_0x6ab8('0x37')]));this[_0x6ab8('0x35')]['sync'](this,_0x283641,_0x283641[_0x6ab8('0x116')]);return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x117'),_0x283641[_0x6ab8('0x116')]));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x118')]=function(_0x12fc20){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x119'),_0x12fc20[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x12fc20[_0x6ab8('0x84')])||!this[_0x6ab8('0x82')](_0x12fc20[_0x6ab8('0x85')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x11a'));}if(!this['isConfigured'](_0x12fc20[_0x6ab8('0x5d')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')]('Trying\x20aws\x20Polly\x20%s',_0x12fc20['text']));var _0x14005f=this['awsPolly']['sync'](this,_0x12fc20);if(_0x14005f){this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')](_0x6ab8('0x11b'),_0x14005f));var _0x3806cc=this['channel'][_0x6ab8('0xfb')](_0x14005f);try{fs[_0x6ab8('0xfc')](_0x14005f+_0x6ab8('0xfd'));}catch(_0x4b15eb){logger[_0x6ab8('0x2c')](_0x4b15eb);}return _0x3806cc;}return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x12fc20,_0x6ab8('0x11c'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x11d')]=function(_0x2dd9f2){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x11e'),_0x2dd9f2[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x2dd9f2[_0x6ab8('0x84')])||!this[_0x6ab8('0x82')](_0x2dd9f2[_0x6ab8('0x85')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x11a'));}if(!this[_0x6ab8('0x82')](_0x2dd9f2['aws_bot_name'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x11f'));}if(!this['isConfigured'](_0x2dd9f2[_0x6ab8('0x5d')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}this[_0x6ab8('0xe')][_0x6ab8('0xe3')]=!![];this[_0x6ab8('0x35')](_0x2dd9f2);this[_0x6ab8('0x40')](_0x2dd9f2['text'],'in','','');this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x2dd9f2[_0x6ab8('0x5d')]));var _0x4b2147=this[_0x6ab8('0x89')]['sync'](this,_0x2dd9f2);if(_0x4b2147){for(var _0x44ffe1 in _0x4b2147){if(_0x4b2147[_0x6ab8('0x94')](_0x44ffe1)&&_[_0x6ab8('0x91')](_0x4b2147[_0x44ffe1])){this['channel'][_0x6ab8('0x9b')](util[_0x6ab8('0x29')]('AWS_LEX_%s',_0x44ffe1[_0x6ab8('0x66')]()),_0x4b2147[_0x44ffe1]);}}if(_[_0x6ab8('0x46')](_0x4b2147[_0x6ab8('0x120')])){return this[_0x6ab8('0xe')]['noop'](_0x6ab8('0x121'));}else{this['createSquareMessage'](_0x4b2147[_0x6ab8('0x120')],_0x6ab8('0xe7'),'amazonlex','');return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0x122'),_0x4b2147[_0x6ab8('0x120')]));}}return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x2dd9f2,_0x6ab8('0x123'));};AGIVertices['prototype'][_0x6ab8('0x124')]=function(_0x17dfde){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x125'),_0x17dfde['label'],_0x17dfde[_0x6ab8('0x64')]));if(!this[_0x6ab8('0x82')](_0x17dfde['key'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')]('no\x20key\x20configured');}var _0x57dc26='wav';var _0x2ac132=util[_0x6ab8('0x29')](_0x6ab8('0x126'),FILES_PATH,rs[_0x6ab8('0x112')](0x4));var _0x351218=util['format']('%s.%s',_0x2ac132,_0x57dc26);var _0x5e8a45=!![];if(_0x17dfde[_0x6ab8('0x127')]===_0x6ab8('0x128')){_0x5e8a45=![];}var _0x1ff8d2=this[_0x6ab8('0xe')][_0x6ab8('0x129')](_0x2ac132,_0x57dc26,_0x17dfde['intKey'],_0x17dfde['timeout'],undefined,_0x5e8a45);if(_0x1ff8d2[_0x6ab8('0xa1')]!==-0x1){this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('google\x20%s\x20file\x20created',_0x351218));var _0x24e2a7=this['googleASR'][_0x6ab8('0xc0')](this,_0x17dfde,_0x351218);if(_0x24e2a7){for(var _0x563a90 in _0x24e2a7){if(_0x24e2a7[_0x6ab8('0x94')](_0x563a90)){this[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x12a'),_0x563a90[_0x6ab8('0x66')]()),_0x24e2a7[_0x563a90]);}}return this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')]('GoogleASR\x20Result\x20%s',JSON[_0x6ab8('0x6e')](_0x24e2a7)));}}return _0x1ff8d2;};AGIVertices['prototype'][_0x6ab8('0x12b')]=function(_0x59e018){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x12c'),_0x59e018[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x59e018[_0x6ab8('0x8d')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x12d'));}if(!this[_0x6ab8('0x82')](_0x59e018[_0x6ab8('0x8e')])){return this['channel'][_0x6ab8('0xa5')](_0x6ab8('0x12e'));}var _0x49cfbe=_0x6ab8('0x12f');var _0xe0c003=util[_0x6ab8('0x29')](_0x6ab8('0x126'),FILES_PATH,rs[_0x6ab8('0x112')](0x4));var _0x492c42=util[_0x6ab8('0x29')](_0x6ab8('0x9a'),_0xe0c003,_0x49cfbe);var _0x5cb117=!![];if(_0x59e018[_0x6ab8('0x127')]===_0x6ab8('0x128')){_0x5cb117=![];}var _0x5f29ac=this[_0x6ab8('0xe')]['recordFile'](_0xe0c003,_0x49cfbe,_0x59e018['intKey'],_0x59e018[_0x6ab8('0x64')],undefined,_0x5cb117);if(_0x5f29ac[_0x6ab8('0xa1')]!==-0x1){this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0x130'),_0x492c42));var _0x35e42b=this[_0x6ab8('0x131')][_0x6ab8('0xc0')](this,_0x59e018,_0x492c42);if(_0x35e42b){for(var _0x31b61d in _0x35e42b){if(_0x35e42b[_0x6ab8('0x94')](_0x31b61d)){this[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x132'),_0x31b61d[_0x6ab8('0x66')]()),_0x35e42b[_0x31b61d]);}}return this['channel']['noop'](util[_0x6ab8('0x29')](_0x6ab8('0x133'),JSON['stringify'](_0x35e42b)));}}return _0x5f29ac;};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x134')]=function(_0x5e8f3d){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0x135'),_0x5e8f3d['label']));return this[_0x6ab8('0xe')][_0x6ab8('0x136')](_0x5e8f3d[_0x6ab8('0x3b')],_0x5e8f3d[_0x6ab8('0x137')],_0x5e8f3d[_0x6ab8('0x3c')]);};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x138')]=function(_0x4cd7c4){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0x139'),_0x4cd7c4[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x4cd7c4[_0x6ab8('0x13a')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x4cd7c4,_0x6ab8('0x13b'));}try{var _0x540dcf=eval(_0x4cd7c4[_0x6ab8('0x13a')])?_0x6ab8('0x13c'):_0x6ab8('0x13d');this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x13e'),_0x4cd7c4[_0x6ab8('0x13a')],_0x540dcf));return{'code':0xc8,'result':_0x540dcf};}catch(_0x2e2aa7){return{'code':0xc8,'result':_0x6ab8('0x13d')};}};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x13f')]=function(_0x586a4c){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x140'),_0x586a4c[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x586a4c[_0x6ab8('0x141')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x586a4c,_0x6ab8('0x142'));}var _0x35fd64=this[_0x6ab8('0x22')]['sync'](this,_0x586a4c[_0x6ab8('0x141')]);if(!_0x35fd64){return this[_0x6ab8('0xe')]['error'](_0x586a4c,'no\x20intervals\x20found');}for(var _0x57a80c=0x0;_0x57a80c<_0x35fd64[_0x6ab8('0x97')];_0x57a80c+=0x1){var _0x2769ec=this['channel']['getVariable'](util['format'](_0x6ab8('0x143'),_0x35fd64[_0x57a80c]));if(_0x2769ec[_0x6ab8('0xa1')]===-0x1){return _0x2769ec;}logger['info'](util['format'](_0x6ab8('0x144'),_0x35fd64[_0x57a80c],_0x2769ec[_0x6ab8('0x9f')]));if(_0x2769ec[_0x6ab8('0x9f')]==='true'){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x144'),_0x35fd64[_0x57a80c],_0x6ab8('0x13c')));this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0x144'),_0x35fd64[_0x57a80c],'true'));return{'code':0xc8,'result':_0x6ab8('0x13c')};}else{logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x144'),_0x35fd64[_0x57a80c],_0x6ab8('0x13d')));this['channel'][_0x6ab8('0xa5')](util['format']('IFTIME\x20%s\x20%s',_0x35fd64[_0x57a80c],_0x6ab8('0x13d')));}}return{'code':0xc8,'result':_0x6ab8('0x13d')};};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x145')]=function(_0x449746){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x146'),_0x449746[_0x6ab8('0x37')]));return this['channel'][_0x6ab8('0x145')]();};AGIVertices[_0x6ab8('0xf')]['ispeechasr']=function(_0x5a3249){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x147'),_0x5a3249[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x5a3249[_0x6ab8('0x75')])){return this['channel'][_0x6ab8('0xa5')](_0x6ab8('0xe2'));}var _0x11b58e=_0x6ab8('0x12f');var _0x18d6f3=util['format'](_0x6ab8('0x126'),FILES_PATH,rs['generate'](0x4));var _0x8f4482=util[_0x6ab8('0x29')](_0x6ab8('0x9a'),_0x18d6f3,_0x11b58e);var _0x60260=!![];if(_0x5a3249['beep']===_0x6ab8('0x128')){_0x60260=![];}var _0x349cf4=this[_0x6ab8('0xe')][_0x6ab8('0x129')](_0x18d6f3,_0x11b58e,_0x5a3249[_0x6ab8('0x148')],_0x5a3249[_0x6ab8('0x64')],undefined,_0x60260);if(_0x349cf4['result']!==-0x1){this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x149'),_0x8f4482));var _0x57079d=this['ispeechASR']['sync'](this,_0x5a3249,_0x8f4482);if(_0x57079d){for(var _0x144761 in _0x57079d){if(_0x57079d[_0x6ab8('0x94')](_0x144761)){this[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x14a'),_0x144761[_0x6ab8('0x66')]()),_0x57079d[_0x144761]);}}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util['format'](_0x6ab8('0x14b'),JSON[_0x6ab8('0x6e')](_0x57079d)));}}return _0x349cf4;};AGIVertices[_0x6ab8('0xf')]['ispeechtts']=function(_0x1440e2){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x14c'),_0x1440e2[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x1440e2[_0x6ab8('0x75')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')]('no\x20key\x20configured');}if(!this[_0x6ab8('0x82')](_0x1440e2[_0x6ab8('0x5d')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('Trying\x20ispeech\x20TTS\x20%s',_0x1440e2['text']));var _0x2402d2=this[_0x6ab8('0x7c')][_0x6ab8('0xc0')](this,_0x1440e2);if(_0x2402d2){this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x149'),_0x2402d2));var _0x3b45ab=this['channel'][_0x6ab8('0xfb')](_0x2402d2,_0x1440e2[_0x6ab8('0x148')]);try{fs['unlink'](_0x2402d2+'.wav');}catch(_0x781dde){logger[_0x6ab8('0x2c')](_0x781dde);}return _0x3b45ab;}return this[_0x6ab8('0xe')]['error'](_0x1440e2,_0x6ab8('0x14d'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x14e')]=function(_0xc97b9f){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x14f'),_0xc97b9f[_0x6ab8('0x37')]));if(!this['isConfigured'](_0xc97b9f[_0x6ab8('0x150')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0xc97b9f,_0x6ab8('0x151'));}logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x152'),this[_0x6ab8('0xe')]['callerid'],_0xc97b9f[_0x6ab8('0x150')]));var _0x5882df=this[_0x6ab8('0x54')][_0x6ab8('0xc0')](this,_0xc97b9f['findBy']);if(_0x5882df){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x153'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0xc97b9f[_0x6ab8('0x150')]));this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0xc97b9f['findBy']));return{'code':0xc8,'result':_0x6ab8('0x154')};}else{logger['info'](util['format'](_0x6ab8('0x155'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0xc97b9f[_0x6ab8('0x150')]));this['channel']['noop'](util[_0x6ab8('0x29')](_0x6ab8('0x155'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0xc97b9f[_0x6ab8('0x150')]));return{'code':0xc8,'result':_0x6ab8('0x156')};}};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x157')]=function(_0x145c06){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x158'),_0x145c06[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x145c06[_0x6ab8('0x150')])){return this[_0x6ab8('0xe')]['error'](_0x145c06,'no\x20find\x20by\x20configured');}logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x152'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x145c06[_0x6ab8('0x150')]));var _0x52c8e3=this[_0x6ab8('0x53')][_0x6ab8('0xc0')](this,_0x145c06[_0x6ab8('0x150')]);if(_0x52c8e3){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x153'),this[_0x6ab8('0xe')]['callerid'],_0x145c06['findBy']));this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x145c06[_0x6ab8('0x150')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x145c06[_0x6ab8('0x150')]));this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x145c06[_0x6ab8('0x150')]));return{'code':0xc8,'result':_0x6ab8('0x156')};}};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x159')]=function(_0x2fcde9){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x15a'),_0x2fcde9[_0x6ab8('0x37')]));if(!this['isConfigured'](_0x2fcde9[_0x6ab8('0x15b')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x2fcde9,_0x6ab8('0x15c'));}this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x15d'),_0x2fcde9[_0x6ab8('0x15b')]));var _0x36358a=eval(_0x2fcde9[_0x6ab8('0x15b')]);if(!this[_0x6ab8('0x82')](_0x2fcde9['variable_id'])){return this['channel'][_0x6ab8('0xa5')](_0x6ab8('0xd6'));}var _0x38fab6=this[_0x6ab8('0x9e')][_0x6ab8('0xc0')](this,_0x2fcde9[_0x6ab8('0xd5')]);if(!_0x38fab6){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x2fcde9,'no\x20variable\x20found');}if(_['isArray'](_0x36358a)){var _0x4ba33f=this;_0x36358a[_0x6ab8('0xd8')](function(_0x496d88,_0x205204){_0x4ba33f['channel'][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x15e'),_0x38fab6,_0x205204),_0x496d88);});return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x15f'),_0x38fab6));}else{return this[_0x6ab8('0xe')][_0x6ab8('0x9b')](_0x38fab6,_0x36358a);}};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xb')]=function(_0x3fca87){logger['info'](util['format'](_0x6ab8('0x160'),_0x3fca87[_0x6ab8('0x37')]));if(_0x3fca87[_0x6ab8('0xa3')]===0x0){return this['maxRetry'](_0x3fca87);}_0x3fca87['retry']-=0x1;if(!this[_0x6ab8('0x82')](_0x3fca87[_0x6ab8('0x10a')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x3fca87,_0x6ab8('0x161'));}var _0xbdfb15=this[_0x6ab8('0x10b')][_0x6ab8('0xc0')](this,_0x3fca87[_0x6ab8('0x10a')]);if(!_0xbdfb15){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x3fca87,_0x6ab8('0x162'));}var _0x11f190=this[_0x6ab8('0xe')]['getData'](_0xbdfb15,_0x3fca87[_0x6ab8('0x10d')],_0x3fca87[_0x6ab8('0x163')]);var _0x9fab25=_0x11f190[_0x6ab8('0xa1')];if(_0x11f190[_0x6ab8('0xa1')]===-0x1){this[_0x6ab8('0x35')][_0x6ab8('0xc0')](this,_0x3fca87,'-1');return _0x11f190;}else if(_0x11f190['extra']===_0x6ab8('0x64')){_0x11f190[_0x6ab8('0xa1')]=_0x11f190[_0x6ab8('0xa1')][_0x6ab8('0x97')]>0x0?_0x11f190[_0x6ab8('0xa1')]:'t';}else if(_[_0x6ab8('0x42')](_0x11f190['result'])){_0x11f190['result']='#';_0x9fab25='#';}if(!this[_0x6ab8('0x82')](_0x3fca87[_0x6ab8('0xd5')])){this[_0x6ab8('0xe')]['noop'](_0x6ab8('0xd6'));}else{var _0x2210d9=this['getVariable'][_0x6ab8('0xc0')](this,_0x3fca87['variable_id']);if(!_0x2210d9){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x3fca87,_0x6ab8('0xd7'));}this[_0x6ab8('0xe')]['setVariable'](_0x2210d9,_0x9fab25);}this[_0x6ab8('0x35')][_0x6ab8('0xc0')](this,_0x3fca87,_0x9fab25);return _0x11f190;};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0xa5')]=function(_0x2aa32a){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0x164'),_0x2aa32a[_0x6ab8('0x37')]));return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x2aa32a[_0x6ab8('0x165')]||_0x2aa32a[_0x6ab8('0x37')]);};AGIVertices['prototype'][_0x6ab8('0x166')]=function(_0x2d65c7){logger[_0x6ab8('0x2e')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x2d65c7[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x2d65c7[_0x6ab8('0x150')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x2d65c7,_0x6ab8('0x151'));}logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x152'),this['channel'][_0x6ab8('0x38')],_0x2d65c7['findBy']));var _0x137ad7=this[_0x6ab8('0x4e')][_0x6ab8('0xc0')](this,_0x2d65c7[_0x6ab8('0x167')]);var _0x3f6099=this[_0x6ab8('0x50')]['sync'](this,_0x2d65c7[_0x6ab8('0x150')],_0x137ad7);if(_0x3f6099){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x153'),this['channel'][_0x6ab8('0x38')],_0x2d65c7[_0x6ab8('0x150')]));this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x2d65c7[_0x6ab8('0x150')]));return{'code':0xc8,'result':_0x6ab8('0x154')};}else{logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x155'),this[_0x6ab8('0xe')]['callerid'],_0x2d65c7['findBy']));this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')](_0x6ab8('0x153'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x2d65c7[_0x6ab8('0x150')]));return{'code':0xc8,'result':_0x6ab8('0x156')};}};AGIVertices['prototype'][_0x6ab8('0x168')]=function(_0x482172){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x169'),_0x482172[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x482172[_0x6ab8('0x10a')])){return this[_0x6ab8('0xe')]['error'](_0x482172,_0x6ab8('0x161'));}var _0xc8d50d=this[_0x6ab8('0x10b')][_0x6ab8('0xc0')](this,_0x482172[_0x6ab8('0x10a')]);if(!_0xc8d50d){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x482172,'no\x20file\x20audio\x20found');}var _0x199726=this[_0x6ab8('0xe')]['exec'](_0x6ab8('0x16a'),[_0xc8d50d,_0x482172[_0x6ab8('0xdf')]]);if(_0x199726[_0x6ab8('0xa1')]===-0x1){return _0x199726;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xc3'),_0x6ab8('0x16a'),_0xc8d50d));};AGIVertices['prototype'][_0x6ab8('0x16b')]=function(_0x4187a7){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x16c'),_0x4187a7[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x4187a7[_0x6ab8('0x16d')])){return this[_0x6ab8('0xe')]['error'](_0x4187a7,_0x6ab8('0x16e'));}var _0x2425aa='';var _0x1d2977=parseInt(_0x4187a7[_0x6ab8('0x16d')],0xa);if(isNaN(_0x1d2977)){_0x2425aa=_0x4187a7['queue_id'];}else{_0x2425aa=this[_0x6ab8('0x16f')]['sync'](this,_0x4187a7[_0x6ab8('0x16d')]);if(!_0x2425aa){return this['channel']['error'](_0x4187a7,_0x6ab8('0x170'));}}var _0x10ad33='';if(this['isConfigured'](_0x4187a7[_0x6ab8('0x10a')])){var _0x242f35=this['getSound']['sync'](this,_0x4187a7[_0x6ab8('0x10a')]);if(_0x242f35){_0x10ad33=_0x242f35;}}this[_0x6ab8('0x35')][_0x6ab8('0xc0')](this,_0x4187a7,_0x2425aa);if(_0x4187a7[_0x6ab8('0xdf')]['indexOf']('x')<0x0){_0x4187a7[_0x6ab8('0xdf')]+='x';}if(_0x4187a7[_0x6ab8('0xdf')][_0x6ab8('0x171')]('X')<0x0){_0x4187a7[_0x6ab8('0xdf')]+='X';}this[_0x6ab8('0xe')][_0x6ab8('0x9b')](_0x6ab8('0x172'),_0x2425aa?_0x2425aa[_0x6ab8('0x173')]():'');var _0x289746=this['channel'][_0x6ab8('0x57')](_0x6ab8('0x174'),[_0x2425aa,_0x4187a7[_0x6ab8('0xdf')],_0x4187a7['url'],_0x10ad33,_0x4187a7[_0x6ab8('0x64')],_0x4187a7[_0x6ab8('0x5')],_0x4187a7[_0x6ab8('0x175')],_0x4187a7['gosub'],'',_0x4187a7[_0x6ab8('0x176')]]);if(_0x289746[_0x6ab8('0xa1')]===-0x1){return _0x289746;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xc3'),_0x6ab8('0x174'),_0x2425aa));};AGIVertices['prototype'][_0x6ab8('0x177')]=function(_0x29a857){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x178'),_0x29a857[_0x6ab8('0x37')]));var _0x39d29e=_0x29a857['recordingFormat']||_0x6ab8('0x12f');var _0x5da804=util[_0x6ab8('0x29')]('%s_%s',this[_0x6ab8('0xe')][_0x6ab8('0x36')],rs[_0x6ab8('0x112')](0x5));var _0x3341c8=util[_0x6ab8('0x29')](_0x6ab8('0x179'),FILES_PATH,_0x5da804,_0x39d29e);var _0x27efb8=util[_0x6ab8('0x29')](_0x6ab8('0x126'),FILES_PATH,_0x5da804);this[_0x6ab8('0x39')]['sync'](this,_0x29a857,_0x5da804,_0x3341c8);this[_0x6ab8('0xe')]['setVariable'](_0x6ab8('0x17a'),_0x5da804);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x27efb8,_0x39d29e,_0x29a857[_0x6ab8('0x17b')],_0x29a857[_0x6ab8('0x64')]);return this[_0x6ab8('0xe')][_0x6ab8('0x129')](_0x27efb8,_0x39d29e,_0x29a857[_0x6ab8('0x17b')],_0x29a857['timeout'],undefined,!![]);};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x17c')]=function(_0x5c7522){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x17d'),_0x5c7522[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x5c7522['url'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x17e'));}var _0x20d979=this[_0x6ab8('0x17f')][_0x6ab8('0xc0')](this,_0x5c7522);logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x180'),util[_0x6ab8('0x181')](_0x20d979,{'showHidden':![],'depth':null})));if(!this[_0x6ab8('0x82')](_0x5c7522[_0x6ab8('0xd5')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x36759c=this['getVariable']['sync'](this,_0x5c7522[_0x6ab8('0xd5')]);if(!_0x36759c){return this[_0x6ab8('0xe')]['error'](_0x5c7522,_0x6ab8('0xd7'));}this['channel'][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x182'),_0x36759c),_0x20d979[_0x6ab8('0x71')]?_0x20d979[_0x6ab8('0x71')]:_0x6ab8('0x183'));this[_0x6ab8('0xe')][_0x6ab8('0x9b')](util[_0x6ab8('0x29')](_0x6ab8('0x184'),_0x36759c),_0x20d979['statusMessage']?_0x20d979[_0x6ab8('0x72')]:'OK');if(_0x20d979[_0x6ab8('0x6f')]){try{this[_0x6ab8('0x99')](_0x20d979[_0x6ab8('0x6f')],_0x36759c);}catch(_0x174474){logger[_0x6ab8('0x2c')](util[_0x6ab8('0x29')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x36759c));}}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0xdb'),_0x36759c));};AGIVertices[_0x6ab8('0xf')]['saydigits']=function(_0x46b005){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x185'),_0x46b005['label']));return this['channel'][_0x6ab8('0x186')](_0x46b005[_0x6ab8('0x187')][_0x6ab8('0x59')](/\s+/g,''),_0x46b005[_0x6ab8('0x17b')]);};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x188')]=function(_0x3e7f49){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x189'),_0x3e7f49[_0x6ab8('0x37')]));return this[_0x6ab8('0xe')][_0x6ab8('0x18a')](_0x3e7f49['number'][_0x6ab8('0x59')](/\s+/g,''),_0x3e7f49['escape_digits']);};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x18b')]=function(_0x5e1b2e){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x18c'),_0x5e1b2e[_0x6ab8('0x37')]));return this['channel'][_0x6ab8('0x18d')](_0x5e1b2e['text'],_0x5e1b2e[_0x6ab8('0x17b')]);};AGIVertices['prototype'][_0x6ab8('0x18e')]=function(_0x481134){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x18f'),_0x481134[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x481134[_0x6ab8('0x190')])){return this['channel']['noop']('no\x20mail\x20account\x20configured');}var _0x592f37=this['getMailAccount'][_0x6ab8('0xc0')](this,_0x481134[_0x6ab8('0x190')]);if(!_0x592f37||!_0x592f37[_0x6ab8('0x191')]){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x481134,_0x6ab8('0x192'));}var _0x2d010d={'from':util['format']('\x22%s\x22\x20<%s>',_0x592f37[_0x6ab8('0x14')],_0x592f37[_0x6ab8('0x193')]||_0x592f37[_0x6ab8('0x191')][_0x6ab8('0x194')]),'to':_0x481134['to']||'','cc':_0x481134['cc']||'','bcc':_0x481134[_0x6ab8('0x195')]||'','subject':_0x481134[_0x6ab8('0x196')],'html':_0x481134[_0x6ab8('0x5d')],'text':_0x481134[_0x6ab8('0x5d')]};if(this[_0x6ab8('0x82')](_0x481134['template_id'])){}logger[_0x6ab8('0x197')](_0x6ab8('0x198'),JSON[_0x6ab8('0x6e')](_0x2d010d));this['createSquareDetailsReport'][_0x6ab8('0xc0')](this,_0x481134,_0x481134[_0x6ab8('0x190')]);this['channel'][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x592f37[_0x6ab8('0x14')]));this['sendMailMessage']['sync'](this,_0x592f37['smtpOptions'],_0x2d010d);return this[_0x6ab8('0xe')]['noop'](_0x6ab8('0x199'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x19a')]=function(_0x52a71f){logger['info'](util[_0x6ab8('0x29')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x52a71f[_0x6ab8('0x37')]));return this['channel'][_0x6ab8('0xa5')](_0x6ab8('0x19b'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x19c')]=function(_0x3e8ae8){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x19d'),_0x3e8ae8['label']));if(!this[_0x6ab8('0x82')](_0x3e8ae8[_0x6ab8('0x19e')])){return this['channel']['noop']('no\x20sms\x20account\x20configured');}var _0x302463=this[_0x6ab8('0x32')]['sync'](this,_0x3e8ae8[_0x6ab8('0x19e')]);if(!_0x302463){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x3e8ae8,_0x6ab8('0x19f'));}var _0x377cf6={'body':_0x3e8ae8['sms_text'],'phone':_0x3e8ae8['to']||'','SmsAccountId':_0x302463['id']};logger[_0x6ab8('0x197')]('sendSMS\x20message',JSON[_0x6ab8('0x6e')](_0x377cf6));this[_0x6ab8('0x35')][_0x6ab8('0xc0')](this,_0x3e8ae8,_0x3e8ae8['sms_account_id']);this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x1a0'),_0x302463[_0x6ab8('0x14')]));this[_0x6ab8('0x34')][_0x6ab8('0xc0')](this,_0x377cf6);return this['channel'][_0x6ab8('0xa5')](_0x6ab8('0x1a1'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1a2')]=function(_0x4ffb64){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x4ffb64[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x4ffb64[_0x6ab8('0xd5')])){return this[_0x6ab8('0xe')]['error'](_0x4ffb64,_0x6ab8('0x1a3'));}var _0x1cbccf=this[_0x6ab8('0x9e')]['sync'](this,_0x4ffb64[_0x6ab8('0xd5')]);if(!_0x1cbccf){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x4ffb64,_0x6ab8('0xd7'));}return this[_0x6ab8('0xe')]['setVariable'](_0x1cbccf,_0x4ffb64[_0x6ab8('0x1a4')]);};AGIVertices['prototype'][_0x6ab8('0x1a5')]=function(_0x1c68dd){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0x1a6'),_0x1c68dd[_0x6ab8('0x37')]));this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x1a7'));var _0x456e54=this[_0x6ab8('0xe')][_0x6ab8('0x9e')](_0x6ab8('0x1a8'));if(!_[_0x6ab8('0x42')](_0x456e54['extra'])){this[_0x6ab8('0xe')][_0x6ab8('0x36')]=_0x456e54['extra'];}if(_0x1c68dd['answer']==='yes'){this[_0x6ab8('0xe')][_0x6ab8('0xa5')]('Answer');return this[_0x6ab8('0xe')][_0x6ab8('0xb7')]();}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x1a9'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1aa')]=function(_0x45fa6f){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x1ab'),_0x45fa6f['label']));if(!this[_0x6ab8('0x82')](_0x45fa6f[_0x6ab8('0x1ac')])){return this['channel'][_0x6ab8('0x2c')](_0x45fa6f,_0x6ab8('0x1ad'));}var _0x4aca03=this[_0x6ab8('0x15')][_0x6ab8('0xc0')](this,_0x45fa6f[_0x6ab8('0x1ac')]);if(!this[_0x6ab8('0x82')](_0x4aca03)){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x45fa6f,util[_0x6ab8('0x29')](_0x6ab8('0x1ae'),_0x45fa6f[_0x6ab8('0x1ac')]));}if(_0x4aca03===this[_0x6ab8('0xe')]['arg_1']){return this['channel']['error'](_0x45fa6f,_0x6ab8('0x1af'));}this['createSquareDetailsReport'][_0x6ab8('0xc0')](this,_0x45fa6f,_0x4aca03);var _0x1ff186=this['channel'][_0x6ab8('0x57')](_0x6ab8('0x1b0'),util[_0x6ab8('0x29')](_0x6ab8('0x1b1'),config[_0x6ab8('0x5')]['host']||_0x6ab8('0x1b2'),_0x4aca03,this[_0x6ab8('0xe')][_0x6ab8('0x1b3')]));if(_0x1ff186[_0x6ab8('0xa1')]===-0x1){return _0x1ff186;}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')]('Executed\x20command\x20%s\x20%s',_0x6ab8('0x1b0'),_0x4aca03));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1b4')]=function(_0x5ed5c1){logger[_0x6ab8('0x2e')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5ed5c1[_0x6ab8('0x37')]));var _0x52864e=this[_0x6ab8('0x1b5')][_0x6ab8('0xc0')](this,_0x5ed5c1[_0x6ab8('0xb5')]);this['createSquareDetailsReport'][_0x6ab8('0xc0')](this,_0x5ed5c1,_0x5ed5c1[_0x6ab8('0xb5')]);if(this[_0x6ab8('0x82')](_0x5ed5c1[_0x6ab8('0xd5')])){var _0xe63f9e=this['getVariable'][_0x6ab8('0xc0')](this,_0x5ed5c1['variable_id']);if(_0xe63f9e){this[_0x6ab8('0xe')][_0x6ab8('0x9b')](_0xe63f9e,_0x52864e);return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x1b6'),_0x5ed5c1[_0x6ab8('0xb5')],_0xe63f9e));}}return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x1b7'),_0x5ed5c1[_0x6ab8('0xb5')]));};AGIVertices['prototype'][_0x6ab8('0x1b8')]=function(_0x50aced){logger['info'](util[_0x6ab8('0x29')](_0x6ab8('0x1b9'),_0x50aced[_0x6ab8('0x37')]));_0x50aced[_0x6ab8('0x5d')]=_0x50aced[_0x6ab8('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6ab8('0x82')](_0x50aced[_0x6ab8('0x5b')])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0x1ba'));}if(!this[_0x6ab8('0x82')](_0x50aced['text'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}this['channel']['noop'](util[_0x6ab8('0x29')](_0x6ab8('0x1bb'),_0x50aced[_0x6ab8('0x5d')]));var _0x4f140c=this[_0x6ab8('0x5a')][_0x6ab8('0xc0')](this,_0x50aced);if(_0x4f140c){this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')](_0x6ab8('0x1bc'),_0x4f140c));var _0xe5ce5d=this['channel'][_0x6ab8('0xfb')](_0x4f140c);try{fs[_0x6ab8('0xfc')](_0x4f140c+_0x6ab8('0xfd'));}catch(_0x812c8){logger[_0x6ab8('0x2c')](_0x812c8);}return _0xe5ce5d;}return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x50aced,_0x6ab8('0x1bd'));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1be')]=function(_0x441b9c){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x1bf'),_0x441b9c[_0x6ab8('0x37')]));_0x441b9c[_0x6ab8('0x5d')]=_0x441b9c[_0x6ab8('0x5d')][_0x6ab8('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6ab8('0x82')](_0x441b9c['text'])){return this[_0x6ab8('0xe')][_0x6ab8('0xa5')](_0x6ab8('0xa6'));}this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x1c0'),_0x441b9c[_0x6ab8('0x5d')]));var _0x133e0e=this[_0x6ab8('0x61')][_0x6ab8('0xc0')](this,_0x441b9c);if(_0x133e0e){this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x1c1'),_0x133e0e));var _0x1c44bf=this[_0x6ab8('0xe')][_0x6ab8('0xfb')](_0x133e0e);try{fs['unlink'](_0x133e0e+_0x6ab8('0xfd'));}catch(_0x1ed9af){logger[_0x6ab8('0x2c')](_0x1ed9af);}return _0x1c44bf;}return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x441b9c,_0x6ab8('0x1c2'));};AGIVertices[_0x6ab8('0xf')]['unpause']=function(_0x2b1bbf){logger[_0x6ab8('0x2e')](util['format'](_0x6ab8('0x1c3'),_0x2b1bbf[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x2b1bbf[_0x6ab8('0x150')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x2b1bbf,_0x6ab8('0x151'));}logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x152'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x2b1bbf[_0x6ab8('0x150')]));var _0x29eada=this[_0x6ab8('0x51')][_0x6ab8('0xc0')](this,_0x2b1bbf[_0x6ab8('0x150')]);if(_0x29eada){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x153'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x2b1bbf['findBy']));this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x153'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x2b1bbf[_0x6ab8('0x150')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x6ab8('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x2b1bbf[_0x6ab8('0x150')]));this[_0x6ab8('0xe')][_0x6ab8('0xa5')](util[_0x6ab8('0x29')](_0x6ab8('0x155'),this[_0x6ab8('0xe')][_0x6ab8('0x38')],_0x2b1bbf[_0x6ab8('0x150')]));return{'code':0xc8,'result':_0x6ab8('0x156')};}};AGIVertices[_0x6ab8('0xf')]['voicemail']=function(_0x229a68){logger[_0x6ab8('0x2e')](util[_0x6ab8('0x29')](_0x6ab8('0x1c4'),_0x229a68[_0x6ab8('0x37')]));var _0x2d999e=this[_0x6ab8('0xe')][_0x6ab8('0x57')](_0x6ab8('0x1c5'),[_0x229a68[_0x6ab8('0x1c6')],_0x229a68[_0x6ab8('0xa7')]]);if(_0x2d999e[_0x6ab8('0xa1')]===-0x1){return _0x2d999e;}return this[_0x6ab8('0xe')]['noop'](util[_0x6ab8('0x29')](_0x6ab8('0xc3'),_0x6ab8('0x1c5'),_0x229a68[_0x6ab8('0x1c6')]));};AGIVertices[_0x6ab8('0xf')][_0x6ab8('0x1c7')]=function(_0x25a5b4){logger['info'](util[_0x6ab8('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x25a5b4[_0x6ab8('0x37')]));if(!this[_0x6ab8('0x82')](_0x25a5b4[_0x6ab8('0xd5')])){return this[_0x6ab8('0xe')][_0x6ab8('0x2c')](_0x25a5b4,_0x6ab8('0x1a3'));}var _0x5bc16b=this['getVariable'][_0x6ab8('0xc0')](this,_0x25a5b4[_0x6ab8('0xd5')]);if(!_0x5bc16b){return this['channel'][_0x6ab8('0x2c')](_0x25a5b4,_0x6ab8('0xd7'));}var _0x2b2825=this[_0x6ab8('0xe')]['getVariable'](_0x5bc16b);return{'code':0xc8,'result':_0x2b2825[_0x6ab8('0x9f')]?_0x2b2825[_0x6ab8('0x9f')]:'-'};};String[_0x6ab8('0xf')][_0x6ab8('0x9d')]=function(_0x59e270,_0x485df9){return this[_0x6ab8('0x9c')](_0x59e270)[_0x6ab8('0x1c8')](_0x485df9);};module[_0x6ab8('0x1c9')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 8059fd7..0bd70d2 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 _0x5fab=['stopAcw','format','error','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','startAcw','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout'];(function(_0x295e7f,_0x1a4d59){var _0xdb8b56=function(_0x41e909){while(--_0x41e909){_0x295e7f['push'](_0x295e7f['shift']());}};_0xdb8b56(++_0x1a4d59);}(_0x5fab,0x177));var _0xb5fa=function(_0xc66af2,_0x14f6d8){_0xc66af2=_0xc66af2-0x0;var _0x38d439=_0x5fab[_0xc66af2];return _0x38d439;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var ami=require('../ami');var logger=require(_0xb5fa('0x2'))(_0xb5fa('0x3'));var RpcUser=require(_0xb5fa('0x4'));var RpcVoiceAgentReport=require(_0xb5fa('0x5'));function Acw(_0x67e8e8){this[_0xb5fa('0x6')]=_0x67e8e8[_0xb5fa('0x6')];this[_0xb5fa('0x7')]=_0x67e8e8[_0xb5fa('0x7')];this[_0xb5fa('0x8')]=_0x67e8e8['timers'];this['channels']={};ami['on'](_0xb5fa('0x9'),this[_0xb5fa('0xa')][_0xb5fa('0xb')](this));ami['on']('hanguprequest',this[_0xb5fa('0xc')][_0xb5fa('0xb')](this));ami['on'](_0xb5fa('0xd'),this['syncHangup']['bind'](this));ami['on'](_0xb5fa('0xe'),this[_0xb5fa('0xf')][_0xb5fa('0xb')](this));ami['on'](_0xb5fa('0x10'),this[_0xb5fa('0x11')][_0xb5fa('0xb')](this));ami['on'](_0xb5fa('0x12'),this[_0xb5fa('0x13')][_0xb5fa('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0xb5fa('0x14')][_0xb5fa('0xb')](this));}function getDiff(_0x56e8b0){var _0x116849=moment()['milliseconds'](0x0);var _0x265992=moment(_0x56e8b0)[_0xb5fa('0x15')](0x0);return _0x116849[_0xb5fa('0x16')](_0x265992,_0xb5fa('0x17'));}Acw[_0xb5fa('0x18')]['updateAcw']=function(_0x567f31,_0x38e964){var _0x587043=this;var _0x31f252=getDiff(_0x587043[_0xb5fa('0x8')][_0x567f31]['lastPauseAt']);clearTimeout(_0x587043['timers'][_0x567f31][_0xb5fa('0x19')]);_0x587043[_0xb5fa('0x8')][_0x567f31][_0xb5fa('0x19')]=![];return RpcVoiceAgentReport[_0xb5fa('0x1a')]({'acwtime':_0x31f252},_0x587043[_0xb5fa('0x8')][_0x567f31][_0xb5fa('0x1b')],_0x567f31)[_0xb5fa('0x1c')](function(_0x21f4f4){logger[_0xb5fa('0x1d')](_0xb5fa('0x1e'),_0x38e964,_0x31f252,_0x21f4f4);})[_0xb5fa('0x1f')](function(_0x1f5064){logger['error'](_0xb5fa('0x20'),_0x38e964,_0x1f5064);})['finally'](function(){delete _0x587043[_0xb5fa('0x8')][_0x567f31];});};Acw['prototype'][_0xb5fa('0x21')]=function(_0x43c09f){try{var _0x4e05c0=this;var _0x40dfdf=this[_0xb5fa('0x22')][_0x43c09f][_0xb5fa('0x23')];var _0x47f71a=this[_0xb5fa('0x22')][_0x43c09f][_0xb5fa('0x24')];var _0x444237=this['voiceQueues'][_0x47f71a];var _0x224ec8=![];var _0x5d55f7=_0xb5fa('0x25');if(_0x444237[_0xb5fa('0x26')]&&_0x444237[_0xb5fa('0x27')][_0xb5fa('0x28')]){_0x224ec8=!![];_0x5d55f7=_0x444237[_0xb5fa('0x27')][_0xb5fa('0x28')];}if(!_0x4e05c0[_0xb5fa('0x7')][_0x40dfdf]){return Promise[_0xb5fa('0x29')]();}return RpcUser['getAgent'](_0x4e05c0['agents'][_0x40dfdf]['id'])['then'](function(_0x5a1c39){if(!_0x5a1c39||_0x5a1c39[_0xb5fa('0x2a')]){logger[_0xb5fa('0x1d')](_0xb5fa('0x2b'),_0x43c09f,_0x40dfdf,_0x47f71a);return;}logger[_0xb5fa('0x1d')](_0xb5fa('0x2c'),_0x43c09f,_0x40dfdf,_0x47f71a);var _0x3506a4=_0x4e05c0[_0xb5fa('0x22')][_0x43c09f][_0xb5fa('0x2d')]&&_0x4e05c0[_0xb5fa('0x22')][_0x43c09f][_0xb5fa('0x2e')]?_0x4e05c0[_0xb5fa('0x22')][_0x43c09f][_0xb5fa('0x2e')]:_0x43c09f;return RpcUser[_0xb5fa('0x2f')](_0x4e05c0[_0xb5fa('0x7')][_0x40dfdf],_0x5d55f7,_0x3506a4);})[_0xb5fa('0x1c')](function(_0x116773){if(_0x224ec8||!_0x116773){return;}_0x4e05c0[_0xb5fa('0x8')][_0x40dfdf]={};logger[_0xb5fa('0x1d')](_0xb5fa('0x30'),_0x43c09f,_0x4e05c0[_0xb5fa('0x6')][_0x47f71a][_0xb5fa('0x31')],_0x40dfdf,_0x47f71a);_0x4e05c0[_0xb5fa('0x8')][_0x40dfdf][_0xb5fa('0x19')]=setTimeout(_0x4e05c0[_0xb5fa('0x32')]['bind'](_0x4e05c0,_0x40dfdf),_0x4e05c0[_0xb5fa('0x6')][_0x47f71a]['acwTimeout']*0x3e8);_0x4e05c0['timers'][_0x40dfdf]['lastPauseAt']=moment()[_0xb5fa('0x33')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e05c0[_0xb5fa('0x8')][_0x40dfdf]['uniqueid']=_0x43c09f;_0x4e05c0['timers'][_0x40dfdf][_0xb5fa('0x24')]=_0x47f71a;_0x4e05c0[_0xb5fa('0x8')][_0x40dfdf]['updateAcw']=_0x4e05c0['updateAcw'][_0xb5fa('0xb')](_0x4e05c0,_0x40dfdf,_0x43c09f);})[_0xb5fa('0x1f')](function(){logger[_0xb5fa('0x34')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x43c09f,_0x4e05c0[_0xb5fa('0x6')][_0x47f71a][_0xb5fa('0x31')],_0x40dfdf,_0x47f71a);})['finally'](function(){delete _0x4e05c0[_0xb5fa('0x22')][_0x43c09f];});}catch(_0x2056de){logger[_0xb5fa('0x34')]('[ACW][START]\x20%s',_0x2056de[_0xb5fa('0x35')]);}};Acw[_0xb5fa('0x18')][_0xb5fa('0x32')]=function(_0x55bdb7){try{var _0x117694=this;if(_0x117694[_0xb5fa('0x8')][_0x55bdb7]){_0x117694[_0xb5fa('0x8')][_0x55bdb7][_0xb5fa('0x19')]=![];var _0x5e7770=_0x117694['timers'][_0x55bdb7]['uniqueid'];var _0x49e786=_0x117694['timers'][_0x55bdb7]['queue'];var _0x908bc8=_0x117694['voiceQueues'][_0x49e786][_0xb5fa('0x31')];logger[_0xb5fa('0x1d')](_0xb5fa('0x36'),_0x5e7770,_0x55bdb7);RpcUser[_0xb5fa('0x37')](this[_0xb5fa('0x7')][_0x55bdb7]);RpcVoiceAgentReport[_0xb5fa('0x1a')]({'acwtime':_0x908bc8,'agentacw':!![]},_0x5e7770,_0x55bdb7)['then'](function(_0x57efb3){logger['info'](_0xb5fa('0x1e'),_0x5e7770,_0x908bc8,_0x57efb3);})['catch'](function(_0x73d425){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x5e7770,_0x73d425);});}else{logger[_0xb5fa('0x34')](_0xb5fa('0x38'),_0x55bdb7);if(_0x117694[_0xb5fa('0x8')]){logger[_0xb5fa('0x1d')](_0xb5fa('0x39'),JSON[_0xb5fa('0x3a')](_0x117694[_0xb5fa('0x8')]));}}}catch(_0x83df0b){logger[_0xb5fa('0x34')](_0xb5fa('0x3b'),_0x83df0b['message']);}};Acw[_0xb5fa('0x18')]['syncAgentConnect']=function(_0x233f90){try{if(this[_0xb5fa('0x6')][_0x233f90[_0xb5fa('0x24')]]&&(this[_0xb5fa('0x6')][_0x233f90[_0xb5fa('0x24')]][_0xb5fa('0x3')]||this[_0xb5fa('0x6')][_0x233f90[_0xb5fa('0x24')]]['mandatoryDisposition'])){if(this[_0xb5fa('0x7')][_0x233f90[_0xb5fa('0x23')]]){this['channels'][_0x233f90[_0xb5fa('0x1b')]]={'queue':_0x233f90['queue'],'interface':_0x233f90[_0xb5fa('0x23')],'destlinkedid':_0x233f90[_0xb5fa('0x2e')]};}}}catch(_0x50ae83){logger['error'](_0xb5fa('0x3c'),_0x50ae83[_0xb5fa('0x35')]);}};Acw[_0xb5fa('0x18')][_0xb5fa('0x14')]=function(_0x430f46){try{if(this[_0xb5fa('0x6')][_0x430f46[_0xb5fa('0x24')]]&&(this[_0xb5fa('0x6')][_0x430f46['queue']][_0xb5fa('0x3')]||this[_0xb5fa('0x6')][_0x430f46['queue']][_0xb5fa('0x26')])){if(this[_0xb5fa('0x7')][_0x430f46[_0xb5fa('0x23')]]){this[_0xb5fa('0x22')][_0x430f46[_0xb5fa('0x1b')]]={'queue':_0x430f46[_0xb5fa('0x24')],'interface':_0x430f46[_0xb5fa('0x23')]};}}}catch(_0x33eb2c){logger[_0xb5fa('0x34')](_0xb5fa('0x3d'),_0x33eb2c[_0xb5fa('0x35')]);}};Acw[_0xb5fa('0x18')][_0xb5fa('0xc')]=function(_0x23be4c){try{if(this[_0xb5fa('0x22')][_0x23be4c[_0xb5fa('0x1b')]]&&_['isUndefined'](this['channels'][_0x23be4c[_0xb5fa('0x1b')]]['attended'])){logger[_0xb5fa('0x1d')](_0xb5fa('0x3e'),_0x23be4c['uniqueid']);this[_0xb5fa('0x21')](_0x23be4c[_0xb5fa('0x1b')]);}else if(this[_0xb5fa('0x22')][_0x23be4c[_0xb5fa('0x3f')]]&&_[_0xb5fa('0x40')](this[_0xb5fa('0x22')][_0x23be4c['linkedid']][_0xb5fa('0x2d')])){logger['info'](_0xb5fa('0x41'),_0x23be4c[_0xb5fa('0x3f')]);this[_0xb5fa('0x21')](_0x23be4c['linkedid']);}}catch(_0x27409a){logger[_0xb5fa('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x27409a['message']);}};Acw[_0xb5fa('0x18')][_0xb5fa('0x42')]=function(_0x320745){try{if(this[_0xb5fa('0x22')][_0x320745[_0xb5fa('0x1b')]]&&this[_0xb5fa('0x22')][_0x320745[_0xb5fa('0x1b')]][_0xb5fa('0x2d')]){logger[_0xb5fa('0x1d')](_0xb5fa('0x43'),_0x320745[_0xb5fa('0x1b')]);this[_0xb5fa('0x21')](_0x320745[_0xb5fa('0x1b')]);}else if(this[_0xb5fa('0x22')][_0x320745[_0xb5fa('0x3f')]]&&this[_0xb5fa('0x22')][_0x320745[_0xb5fa('0x3f')]][_0xb5fa('0x2d')]){logger['info'](_0xb5fa('0x44'),_0x320745[_0xb5fa('0x3f')]);this[_0xb5fa('0x21')](_0x320745[_0xb5fa('0x3f')]);}}catch(_0x10c68e){logger[_0xb5fa('0x34')](_0xb5fa('0x45'),_0x10c68e[_0xb5fa('0x35')]);}};Acw[_0xb5fa('0x18')][_0xb5fa('0x11')]=function(_0x4ea97d){try{if(!_['isNil'](this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x46')]])){this[_0xb5fa('0x21')](_0x4ea97d['transfereeuniqueid']);if(this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x47')]]){this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x47')]][_0xb5fa('0x2d')]=!![];this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x48')]]=this['channels'][_0x4ea97d[_0xb5fa('0x47')]];delete this[_0xb5fa('0x22')][_0x4ea97d['secondtransfereruniqueid']];}}else if(!_[_0xb5fa('0x49')](this[_0xb5fa('0x22')][_0x4ea97d['transfertargetuniqueid']])){this[_0xb5fa('0x21')](_0x4ea97d[_0xb5fa('0x48')]);if(this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x4a')]]){this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x4a')]][_0xb5fa('0x2d')]=!![];this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x46')]]=this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x4a')]];delete this[_0xb5fa('0x22')][_0x4ea97d[_0xb5fa('0x4a')]];}}}catch(_0x29ffb7){logger[_0xb5fa('0x34')](_0xb5fa('0x4b'),_0x29ffb7[_0xb5fa('0x35')]);}};Acw[_0xb5fa('0x18')][_0xb5fa('0x13')]=function(_0x16b382){try{if(this[_0xb5fa('0x22')][_0x16b382[_0xb5fa('0x4c')]]){logger['info'](_0xb5fa('0x4d'),JSON[_0xb5fa('0x3a')](_0x16b382[_0xb5fa('0x4c')]));this['startAcw'](_0x16b382[_0xb5fa('0x4c')]);}else if(this[_0xb5fa('0x22')][_0x16b382['transfererlinkedid']]){logger[_0xb5fa('0x1d')](_0xb5fa('0x4e'),JSON[_0xb5fa('0x3a')](_0x16b382['transfererlinkedid']));this['startAcw'](_0x16b382[_0xb5fa('0x4f')]);}}catch(_0x2b518d){logger[_0xb5fa('0x34')]('[ACW][syncBlindTransfer]\x20%s',_0x2b518d[_0xb5fa('0x35')]);}};Acw[_0xb5fa('0x18')][_0xb5fa('0xf')]=function(_0x12b0a2){try{if(this['voiceQueues'][_0x12b0a2['queue']]&&this['voiceQueues'][_0x12b0a2[_0xb5fa('0x24')]][_0xb5fa('0x50')]===_0xb5fa('0x51')){if(this['agents'][_0x12b0a2[_0xb5fa('0x23')]]){logger[_0xb5fa('0x1d')](_0xb5fa('0x52'),_0x12b0a2[_0xb5fa('0x1b')],_0x12b0a2[_0xb5fa('0x23')],_0x12b0a2[_0xb5fa('0x24')]);return RpcUser[_0xb5fa('0x2f')](this[_0xb5fa('0x7')][_0x12b0a2[_0xb5fa('0x23')]],_0xb5fa('0x53'),_0x12b0a2[_0xb5fa('0x1b')]);}}}catch(_0x1dc42e){logger[_0xb5fa('0x34')](_0xb5fa('0x54'),_0x1dc42e[_0xb5fa('0x35')]);}};module['exports']=Acw; \ No newline at end of file +var _0xdfa0=['[ACW][syncAgentConnectPreview]\x20%s','isUndefined','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','savePause','Auto-Pause','exports','lodash','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','catch','finally','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','then','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xdfa0,0x69));var _0x0dfa=function(_0x226313,_0x521c09){_0x226313=_0x226313-0x0;var _0xa310ca=_0xdfa0[_0x226313];return _0xa310ca;};'use strict';var _=require(_0x0dfa('0x0'));var moment=require('moment');var ami=require(_0x0dfa('0x1'));var logger=require(_0x0dfa('0x2'))('acw');var RpcUser=require(_0x0dfa('0x3'));var RpcVoiceAgentReport=require(_0x0dfa('0x4'));function Acw(_0x3691a7){this['voiceQueues']=_0x3691a7[_0x0dfa('0x5')];this['agents']=_0x3691a7[_0x0dfa('0x6')];this[_0x0dfa('0x7')]=_0x3691a7['timers'];this[_0x0dfa('0x8')]={};ami['on'](_0x0dfa('0x9'),this[_0x0dfa('0xa')][_0x0dfa('0xb')](this));ami['on'](_0x0dfa('0xc'),this['syncHangupRequest'][_0x0dfa('0xb')](this));ami['on'](_0x0dfa('0xd'),this[_0x0dfa('0xe')]['bind'](this));ami['on'](_0x0dfa('0xf'),this['syncAgentRingNoAnswer'][_0x0dfa('0xb')](this));ami['on'](_0x0dfa('0x10'),this[_0x0dfa('0x11')]['bind'](this));ami['on'](_0x0dfa('0x12'),this[_0x0dfa('0x13')]['bind'](this));ami['on'](_0x0dfa('0x14'),this[_0x0dfa('0x15')]['bind'](this));}function getDiff(_0x4162e1){var _0x1e5532=moment()[_0x0dfa('0x16')](0x0);var _0x3b0f4a=moment(_0x4162e1)[_0x0dfa('0x16')](0x0);return _0x1e5532[_0x0dfa('0x17')](_0x3b0f4a,'seconds');}Acw[_0x0dfa('0x18')][_0x0dfa('0x19')]=function(_0x2d8a69,_0x14e818){var _0x334ae2=this;var _0x30cb88=getDiff(_0x334ae2[_0x0dfa('0x7')][_0x2d8a69][_0x0dfa('0x1a')]);clearTimeout(_0x334ae2[_0x0dfa('0x7')][_0x2d8a69][_0x0dfa('0x1b')]);_0x334ae2[_0x0dfa('0x7')][_0x2d8a69][_0x0dfa('0x1b')]=![];return RpcVoiceAgentReport[_0x0dfa('0x1c')]({'acwtime':_0x30cb88},_0x334ae2[_0x0dfa('0x7')][_0x2d8a69][_0x0dfa('0x1d')],_0x2d8a69)['then'](function(_0xd21935){logger[_0x0dfa('0x1e')](_0x0dfa('0x1f'),_0x14e818,_0x30cb88,_0xd21935);})[_0x0dfa('0x20')](function(_0x16a23d){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x14e818,_0x16a23d);})[_0x0dfa('0x21')](function(){delete _0x334ae2[_0x0dfa('0x7')][_0x2d8a69];});};Acw[_0x0dfa('0x18')]['startAcw']=function(_0x32d87a){try{var _0x53b8f0=this;var _0x363788=this['channels'][_0x32d87a][_0x0dfa('0x22')];var _0x3be08c=this[_0x0dfa('0x8')][_0x32d87a]['queue'];var _0x2e1566=this[_0x0dfa('0x5')][_0x3be08c];var _0x269686=![];var _0x2b4da2=_0x0dfa('0x23');if(_0x2e1566[_0x0dfa('0x24')]&&_0x2e1566[_0x0dfa('0x25')][_0x0dfa('0x26')]){_0x269686=!![];_0x2b4da2=_0x2e1566[_0x0dfa('0x25')][_0x0dfa('0x26')];}if(!_0x53b8f0['agents'][_0x363788]){return Promise['resolve']();}return RpcUser[_0x0dfa('0x27')](_0x53b8f0[_0x0dfa('0x6')][_0x363788]['id'])['then'](function(_0x14ae2f){if(!_0x14ae2f||_0x14ae2f[_0x0dfa('0x28')]){logger[_0x0dfa('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x32d87a,_0x363788,_0x3be08c);return;}logger[_0x0dfa('0x1e')](_0x0dfa('0x29'),_0x32d87a,_0x363788,_0x3be08c);var _0xfb53=_0x53b8f0[_0x0dfa('0x8')][_0x32d87a][_0x0dfa('0x2a')]&&_0x53b8f0[_0x0dfa('0x8')][_0x32d87a]['destlinkedid']?_0x53b8f0[_0x0dfa('0x8')][_0x32d87a][_0x0dfa('0x2b')]:_0x32d87a;return RpcUser['savePause'](_0x53b8f0[_0x0dfa('0x6')][_0x363788],_0x2b4da2,_0xfb53);})[_0x0dfa('0x2c')](function(_0x239230){if(_0x269686||!_0x239230){return;}_0x53b8f0[_0x0dfa('0x7')][_0x363788]={};logger['info'](_0x0dfa('0x2d'),_0x32d87a,_0x53b8f0[_0x0dfa('0x5')][_0x3be08c][_0x0dfa('0x2e')],_0x363788,_0x3be08c);_0x53b8f0['timers'][_0x363788]['timer']=setTimeout(_0x53b8f0[_0x0dfa('0x2f')][_0x0dfa('0xb')](_0x53b8f0,_0x363788),_0x53b8f0['voiceQueues'][_0x3be08c]['acwTimeout']*0x3e8);_0x53b8f0['timers'][_0x363788][_0x0dfa('0x1a')]=moment()[_0x0dfa('0x30')](_0x0dfa('0x31'));_0x53b8f0[_0x0dfa('0x7')][_0x363788]['uniqueid']=_0x32d87a;_0x53b8f0[_0x0dfa('0x7')][_0x363788][_0x0dfa('0x32')]=_0x3be08c;_0x53b8f0[_0x0dfa('0x7')][_0x363788][_0x0dfa('0x19')]=_0x53b8f0[_0x0dfa('0x19')][_0x0dfa('0xb')](_0x53b8f0,_0x363788,_0x32d87a);})[_0x0dfa('0x20')](function(){logger[_0x0dfa('0x33')](_0x0dfa('0x2d'),_0x32d87a,_0x53b8f0[_0x0dfa('0x5')][_0x3be08c]['acwTimeout'],_0x363788,_0x3be08c);})['finally'](function(){delete _0x53b8f0[_0x0dfa('0x8')][_0x32d87a];});}catch(_0x17fe0d){logger[_0x0dfa('0x33')](_0x0dfa('0x34'),_0x17fe0d[_0x0dfa('0x35')]);}};Acw['prototype'][_0x0dfa('0x2f')]=function(_0x503689){try{var _0x26aad2=this;if(_0x26aad2[_0x0dfa('0x7')][_0x503689]){_0x26aad2[_0x0dfa('0x7')][_0x503689]['timer']=![];var _0x526ec0=_0x26aad2[_0x0dfa('0x7')][_0x503689][_0x0dfa('0x1d')];var _0x1ac128=_0x26aad2['timers'][_0x503689][_0x0dfa('0x32')];var _0x540be2=_0x26aad2[_0x0dfa('0x5')][_0x1ac128][_0x0dfa('0x2e')];logger['info'](_0x0dfa('0x36'),_0x526ec0,_0x503689);RpcUser[_0x0dfa('0x37')](this[_0x0dfa('0x6')][_0x503689]);RpcVoiceAgentReport[_0x0dfa('0x1c')]({'acwtime':_0x540be2,'agentacw':!![]},_0x526ec0,_0x503689)[_0x0dfa('0x2c')](function(_0x45b094){logger['info'](_0x0dfa('0x1f'),_0x526ec0,_0x540be2,_0x45b094);})[_0x0dfa('0x20')](function(_0x2715e8){logger[_0x0dfa('0x33')](_0x0dfa('0x38'),_0x526ec0,_0x2715e8);});}else{logger[_0x0dfa('0x33')](_0x0dfa('0x39'),_0x503689);if(_0x26aad2[_0x0dfa('0x7')]){logger[_0x0dfa('0x1e')](_0x0dfa('0x3a'),JSON[_0x0dfa('0x3b')](_0x26aad2['timers']));}}}catch(_0x479a4a){logger[_0x0dfa('0x33')](_0x0dfa('0x3c'),_0x479a4a['message']);}};Acw['prototype']['syncAgentConnect']=function(_0x28f867){try{if(this['voiceQueues'][_0x28f867[_0x0dfa('0x32')]]&&(this[_0x0dfa('0x5')][_0x28f867[_0x0dfa('0x32')]][_0x0dfa('0x3d')]||this[_0x0dfa('0x5')][_0x28f867[_0x0dfa('0x32')]][_0x0dfa('0x24')])){if(this[_0x0dfa('0x6')][_0x28f867['interface']]){this[_0x0dfa('0x8')][_0x28f867[_0x0dfa('0x1d')]]={'queue':_0x28f867['queue'],'interface':_0x28f867[_0x0dfa('0x22')],'destlinkedid':_0x28f867[_0x0dfa('0x2b')]};}}}catch(_0x493035){logger[_0x0dfa('0x33')](_0x0dfa('0x3e'),_0x493035[_0x0dfa('0x35')]);}};Acw[_0x0dfa('0x18')]['syncAgentConnectPreview']=function(_0x126c31){try{if(this[_0x0dfa('0x5')][_0x126c31['queue']]&&(this[_0x0dfa('0x5')][_0x126c31[_0x0dfa('0x32')]][_0x0dfa('0x3d')]||this[_0x0dfa('0x5')][_0x126c31[_0x0dfa('0x32')]][_0x0dfa('0x24')])){if(this[_0x0dfa('0x6')][_0x126c31[_0x0dfa('0x22')]]){this[_0x0dfa('0x8')][_0x126c31['uniqueid']]={'queue':_0x126c31[_0x0dfa('0x32')],'interface':_0x126c31[_0x0dfa('0x22')]};}}}catch(_0x48de6c){logger[_0x0dfa('0x33')](_0x0dfa('0x3f'),_0x48de6c[_0x0dfa('0x35')]);}};Acw[_0x0dfa('0x18')]['syncHangupRequest']=function(_0x5df0e8){try{if(this['channels'][_0x5df0e8[_0x0dfa('0x1d')]]&&_[_0x0dfa('0x40')](this[_0x0dfa('0x8')][_0x5df0e8[_0x0dfa('0x1d')]][_0x0dfa('0x2a')])){logger[_0x0dfa('0x1e')]('[%s][HANGUP:UNIQUEID]',_0x5df0e8['uniqueid']);this[_0x0dfa('0x41')](_0x5df0e8[_0x0dfa('0x1d')]);}else if(this[_0x0dfa('0x8')][_0x5df0e8[_0x0dfa('0x42')]]&&_['isUndefined'](this['channels'][_0x5df0e8['linkedid']][_0x0dfa('0x2a')])){logger[_0x0dfa('0x1e')](_0x0dfa('0x43'),_0x5df0e8[_0x0dfa('0x42')]);this[_0x0dfa('0x41')](_0x5df0e8[_0x0dfa('0x42')]);}}catch(_0x19625f){logger[_0x0dfa('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x19625f['message']);}};Acw['prototype'][_0x0dfa('0xe')]=function(_0x52cc2b){try{if(this[_0x0dfa('0x8')][_0x52cc2b[_0x0dfa('0x1d')]]&&this[_0x0dfa('0x8')][_0x52cc2b[_0x0dfa('0x1d')]][_0x0dfa('0x2a')]){logger[_0x0dfa('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x52cc2b['uniqueid']);this[_0x0dfa('0x41')](_0x52cc2b[_0x0dfa('0x1d')]);}else if(this[_0x0dfa('0x8')][_0x52cc2b['linkedid']]&&this[_0x0dfa('0x8')][_0x52cc2b[_0x0dfa('0x42')]][_0x0dfa('0x2a')]){logger[_0x0dfa('0x1e')](_0x0dfa('0x44'),_0x52cc2b[_0x0dfa('0x42')]);this[_0x0dfa('0x41')](_0x52cc2b[_0x0dfa('0x42')]);}}catch(_0x5f4920){logger[_0x0dfa('0x33')](_0x0dfa('0x45'),_0x5f4920[_0x0dfa('0x35')]);}};Acw[_0x0dfa('0x18')][_0x0dfa('0x11')]=function(_0x4bddde){try{if(!_['isNil'](this[_0x0dfa('0x8')][_0x4bddde['transfereeuniqueid']])){this[_0x0dfa('0x41')](_0x4bddde[_0x0dfa('0x46')]);if(this[_0x0dfa('0x8')][_0x4bddde['secondtransfereruniqueid']]){this[_0x0dfa('0x8')][_0x4bddde[_0x0dfa('0x47')]][_0x0dfa('0x2a')]=!![];this[_0x0dfa('0x8')][_0x4bddde[_0x0dfa('0x48')]]=this['channels'][_0x4bddde['secondtransfereruniqueid']];delete this['channels'][_0x4bddde[_0x0dfa('0x47')]];}}else if(!_[_0x0dfa('0x49')](this[_0x0dfa('0x8')][_0x4bddde[_0x0dfa('0x48')]])){this[_0x0dfa('0x41')](_0x4bddde[_0x0dfa('0x48')]);if(this['channels'][_0x4bddde[_0x0dfa('0x4a')]]){this[_0x0dfa('0x8')][_0x4bddde[_0x0dfa('0x4a')]][_0x0dfa('0x2a')]=!![];this[_0x0dfa('0x8')][_0x4bddde[_0x0dfa('0x46')]]=this['channels'][_0x4bddde[_0x0dfa('0x4a')]];delete this[_0x0dfa('0x8')][_0x4bddde[_0x0dfa('0x4a')]];}}}catch(_0x5498c8){logger[_0x0dfa('0x33')](_0x0dfa('0x4b'),_0x5498c8[_0x0dfa('0x35')]);}};Acw[_0x0dfa('0x18')][_0x0dfa('0x13')]=function(_0x211423){try{if(this[_0x0dfa('0x8')][_0x211423[_0x0dfa('0x4c')]]){logger['info'](_0x0dfa('0x4d'),JSON['stringify'](_0x211423['transfereruniqueid']));this[_0x0dfa('0x41')](_0x211423['transfereruniqueid']);}else if(this[_0x0dfa('0x8')][_0x211423[_0x0dfa('0x4e')]]){logger[_0x0dfa('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x0dfa('0x3b')](_0x211423[_0x0dfa('0x4e')]));this['startAcw'](_0x211423[_0x0dfa('0x4e')]);}}catch(_0x1f41aa){logger[_0x0dfa('0x33')](_0x0dfa('0x4f'),_0x1f41aa[_0x0dfa('0x35')]);}};Acw[_0x0dfa('0x18')][_0x0dfa('0x50')]=function(_0x522b36){try{if(this[_0x0dfa('0x5')][_0x522b36['queue']]&&this[_0x0dfa('0x5')][_0x522b36[_0x0dfa('0x32')]]['autopause']==='all'){if(this['agents'][_0x522b36[_0x0dfa('0x22')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x522b36[_0x0dfa('0x1d')],_0x522b36[_0x0dfa('0x22')],_0x522b36[_0x0dfa('0x32')]);return RpcUser[_0x0dfa('0x51')](this[_0x0dfa('0x6')][_0x522b36[_0x0dfa('0x22')]],_0x0dfa('0x52'),_0x522b36[_0x0dfa('0x1d')]);}}}catch(_0x253c36){logger[_0x0dfa('0x33')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x253c36[_0x0dfa('0x35')]);}};module[_0x0dfa('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c6e88ca..36115f8 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 _0x0321=['ami','../../config/environment','port','asterisk','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','format','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','bluebird','util'];(function(_0x53bbc6,_0x48261b){var _0xc5bbd3=function(_0xb1aa57){while(--_0xb1aa57){_0x53bbc6['push'](_0x53bbc6['shift']());}};_0xc5bbd3(++_0x48261b);}(_0x0321,0x174));var _0x1032=function(_0x39185c,_0x519fad){_0x39185c=_0x39185c-0x0;var _0x11ea25=_0x0321[_0x39185c];return _0x11ea25;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x1032('0x0'));var util=require(_0x1032('0x1'));var logger=require('../../config/logger')(_0x1032('0x2'));var config=require(_0x1032('0x3'));var ami=new Manager(config['asterisk'][_0x1032('0x4')],config[_0x1032('0x5')]['ip'],config[_0x1032('0x5')]['username'],config[_0x1032('0x5')][_0x1032('0x6')],!![]);ami[_0x1032('0x7')]();ami[_0x1032('0x8')]=BPromise[_0x1032('0x9')](ami[_0x1032('0xa')]);function error(_0x14d4a2){logger[_0x1032('0xb')](util['format'](_0x1032('0xc'),config[_0x1032('0x5')][_0x1032('0xd')],config[_0x1032('0x5')]['ip'],config[_0x1032('0x5')][_0x1032('0x4')],util[_0x1032('0xe')](_0x14d4a2,![],null)));}function close(){logger[_0x1032('0xb')](util[_0x1032('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x1032('0xd')],config['asterisk']['ip'],config[_0x1032('0x5')][_0x1032('0x4')]));}ami[_0x1032('0x10')]=function(){return function(){return ami[_0x1032('0x8')]({'action':_0x1032('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x1032('0x8')]({'action':_0x1032('0x12')});};};ami[_0x1032('0x13')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0x1032('0x14')]=function(){return function(){return ami[_0x1032('0x8')]({'action':'queuesummary'});};};ami[_0x1032('0x15')]=function(){return function(){return ami[_0x1032('0x8')]({'action':_0x1032('0x16')});};};function connect(){logger[_0x1032('0x17')](util['format'](_0x1032('0x18'),config[_0x1032('0x5')][_0x1032('0xd')],config[_0x1032('0x5')]['ip'],config['asterisk'][_0x1032('0x4')]));ami[_0x1032('0x19')](_0x1032('0xb'),error);ami[_0x1032('0x19')](_0x1032('0x1a'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x269013){logger['info'](util[_0x1032('0xf')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1032('0x5')]['username'],config[_0x1032('0x5')]['ip'],config[_0x1032('0x5')][_0x1032('0x4')],util[_0x1032('0xe')](_0x269013,![],null)));});ami['on'](_0x1032('0x1b'),function(){logger[_0x1032('0x17')](util[_0x1032('0xf')](_0x1032('0x1c'),config[_0x1032('0x5')][_0x1032('0xd')],config[_0x1032('0x5')]['ip'],config[_0x1032('0x5')][_0x1032('0x4')]));return Promise['resolve']()[_0x1032('0x1d')](ami[_0x1032('0x10')]())[_0x1032('0x1d')](ami[_0x1032('0x1e')]())[_0x1032('0x1d')](ami[_0x1032('0x13')]())[_0x1032('0x1d')](ami[_0x1032('0x14')]())['then'](ami[_0x1032('0x15')]())[_0x1032('0x1f')](function(_0x5d046d){logger['error'](_0x1032('0x20'),util[_0x1032('0xe')](_0x5d046d,{'showHidden':![],'depth':null}));});});ami[_0x1032('0x19')](_0x1032('0xb'),error);ami['once'](_0x1032('0x1a'),close);module[_0x1032('0x21')]=ami; \ No newline at end of file +var _0xa3c7=['actionSipPeerStatus','sippeerstatus','actionQueueSummary','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','resolve','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist'];(function(_0x129821,_0x36cfd5){var _0x519238=function(_0xeb4be1){while(--_0xeb4be1){_0x129821['push'](_0x129821['shift']());}};_0x519238(++_0x36cfd5);}(_0xa3c7,0xa0));var _0x7a3c=function(_0x5365d5,_0x51aa66){_0x5365d5=_0x5365d5-0x0;var _0x1d3d0e=_0xa3c7[_0x5365d5];return _0x1d3d0e;};'use strict';var Manager=require(_0x7a3c('0x0'));var BPromise=require(_0x7a3c('0x1'));var util=require('util');var logger=require(_0x7a3c('0x2'))(_0x7a3c('0x3'));var config=require(_0x7a3c('0x4'));var ami=new Manager(config[_0x7a3c('0x5')]['port'],config[_0x7a3c('0x5')]['ip'],config['asterisk'][_0x7a3c('0x6')],config['asterisk'][_0x7a3c('0x7')],!![]);ami['keepConnected']();ami[_0x7a3c('0x8')]=BPromise[_0x7a3c('0x9')](ami[_0x7a3c('0xa')]);function error(_0x1341c8){logger[_0x7a3c('0xb')](util[_0x7a3c('0xc')](_0x7a3c('0xd'),config[_0x7a3c('0x5')][_0x7a3c('0x6')],config[_0x7a3c('0x5')]['ip'],config[_0x7a3c('0x5')][_0x7a3c('0xe')],util[_0x7a3c('0xf')](_0x1341c8,![],null)));}function close(){logger['error'](util[_0x7a3c('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x7a3c('0x6')],config[_0x7a3c('0x5')]['ip'],config[_0x7a3c('0x5')][_0x7a3c('0xe')]));}ami[_0x7a3c('0x10')]=function(){return function(){return ami[_0x7a3c('0x8')]({'action':_0x7a3c('0x11')});};};ami[_0x7a3c('0x12')]=function(){return function(){return ami[_0x7a3c('0x8')]({'action':_0x7a3c('0x13')});};};ami[_0x7a3c('0x14')]=function(){return function(){return ami['Action']({'action':_0x7a3c('0x15')});};};ami[_0x7a3c('0x16')]=function(){return function(){return ami[_0x7a3c('0x8')]({'action':'queuesummary'});};};ami[_0x7a3c('0x17')]=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(){logger[_0x7a3c('0x18')](util[_0x7a3c('0xc')](_0x7a3c('0x19'),config[_0x7a3c('0x5')][_0x7a3c('0x6')],config[_0x7a3c('0x5')]['ip'],config[_0x7a3c('0x5')][_0x7a3c('0xe')]));ami[_0x7a3c('0x1a')](_0x7a3c('0xb'),error);ami[_0x7a3c('0x1a')](_0x7a3c('0x1b'),close);}ami['on'](_0x7a3c('0x1c'),connect);ami['on']('shutdown',function(_0x1b4bbb){logger['info'](util[_0x7a3c('0xc')](_0x7a3c('0x1d'),config[_0x7a3c('0x5')][_0x7a3c('0x6')],config[_0x7a3c('0x5')]['ip'],config[_0x7a3c('0x5')]['port'],util['inspect'](_0x1b4bbb,![],null)));});ami['on'](_0x7a3c('0x1e'),function(){logger['info'](util[_0x7a3c('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x7a3c('0x5')][_0x7a3c('0x6')],config[_0x7a3c('0x5')]['ip'],config[_0x7a3c('0x5')][_0x7a3c('0xe')]));return Promise[_0x7a3c('0x1f')]()['then'](ami[_0x7a3c('0x10')]())[_0x7a3c('0x20')](ami[_0x7a3c('0x12')]())[_0x7a3c('0x20')](ami[_0x7a3c('0x14')]())[_0x7a3c('0x20')](ami[_0x7a3c('0x16')]())[_0x7a3c('0x20')](ami['actionCoreShowChannels']())[_0x7a3c('0x21')](function(_0x384456){logger[_0x7a3c('0xb')](_0x7a3c('0x22'),util[_0x7a3c('0xf')](_0x384456,{'showHidden':![],'depth':null}));});});ami[_0x7a3c('0x1a')](_0x7a3c('0xb'),error);ami[_0x7a3c('0x1a')]('close',close);module[_0x7a3c('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8291553..64376a9 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 _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x70e0,0x17b));var _0x070e=function(_0x57ea5d,_0x586da1){_0x57ea5d=_0x57ea5d-0x0;var _0x48a2ce=_0x70e0[_0x57ea5d];return _0x48a2ce;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x1f4086,_0x52510c){var _0xb6ced5=function(_0x4abb8d){while(--_0x4abb8d){_0x1f4086['push'](_0x1f4086['shift']());}};_0xb6ced5(++_0x52510c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x44774d,_0x27fe98){_0x44774d=_0x44774d-0x0;var _0x282b23=_0xbdb7[_0x44774d];return _0x282b23;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 10ec829..6c9a2a6 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 _0x7cd1=['dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','queuesSummary','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','pTalking','ACTIVE','checkDialMethod','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','predictiveIntervalHitRate','[CatchErlangB]','busyFactor','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','getContactDialer','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','erlangb','exports','util','lodash','ioredis','./utils','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/setting','./models/action','./models/history','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue: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','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','content','true','catch','Action','indexOf','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','undefined','resolve','dialTimezone','checkIfTimeIntervals','launchHandleIvr','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','intervalIftime','OVERTIME_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','reason','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','countglobal','countabandonedretry','dialAbandonedRetryFrequency','CampaignId','Abandoned','swapAdditionalPhones','actions','channel','syncQueueMember','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','membername','[syncHangupInAMDIvr]','countnosuchnumberretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x7cd1,0xf7));var _0x17cd=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x7cd1[_0x15cbce];return _0x257f29;};'use strict';var util=require(_0x17cd('0x0'));var _=require(_0x17cd('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x17cd('0x2'));var utils=require(_0x17cd('0x3'));var hopperUtils=require('./utils/hopper');var ut=require(_0x17cd('0x4'));var config=require('../../../config/environment/');var logger=require(_0x17cd('0x5'))(_0x17cd('0x6'));var loggerBooked=require(_0x17cd('0x5'))(_0x17cd('0x7'));var loggerPredictive=require(_0x17cd('0x5'))(_0x17cd('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x17cd('0x9'));var loggerSyncQueueSummary=require(_0x17cd('0x5'))(_0x17cd('0xa'));var ami=require(_0x17cd('0xb'));config[_0x17cd('0xc')]=_[_0x17cd('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x17cd('0xe'))(new Redis(config[_0x17cd('0xc')]));var cmHopper=require(_0x17cd('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x17cd('0x10'));var Interval=require('../rpc/interval');var Action=require(_0x17cd('0x11'));var History=require(_0x17cd('0x12'));var Final=require('./models/final');var AgentComplete=require(_0x17cd('0x13'));var QueueCallerAbandon=require(_0x17cd('0x14'));var Hangup=require(_0x17cd('0x15'));var ipAgi=process['env'][_0x17cd('0x16')]||_0x17cd('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x17cd('0x18')]['enqueue']=function(_0x52e84c){this[_0x17cd('0x19')]=this[_0x17cd('0x19')]?this['tail'][_0x17cd('0x1a')](_0x52e84c):_0x52e84c();};function Dialer(_0xa69ad7,_0x5cb314){this[_0x17cd('0x1b')]=new Sequence();this[_0x17cd('0x1c')]=_0x5cb314;this[_0x17cd('0x1d')]=_0xa69ad7[_0x17cd('0x1d')];this[_0x17cd('0x1e')]=_0xa69ad7['campaigns'];this[_0x17cd('0x1f')]=_0xa69ad7[_0x17cd('0x1f')];this[_0x17cd('0x20')]=_0xa69ad7[_0x17cd('0x20')];this[_0x17cd('0x21')]=config[_0x17cd('0x21')]||0x2;this['channels']={};this['actions']={};this[_0x17cd('0x22')]={};this[_0x17cd('0x23')]={};this[_0x17cd('0x24')]={};this[_0x17cd('0x25')]={};this[_0x17cd('0x26')]={};this['ivrOriginated']={};this[_0x17cd('0x27')]={};this[_0x17cd('0x28')]={};this['queuesSummary']={};ami['on'](_0x17cd('0x29'),this[_0x17cd('0x2a')]['bind'](this));ami['on'](_0x17cd('0x2b'),this['syncQueueCallerAbandon'][_0x17cd('0x2c')](this));ami['on'](_0x17cd('0x2d'),this[_0x17cd('0x2e')][_0x17cd('0x2c')](this));ami['on'](_0x17cd('0x2f'),this['syncAgentComplete'][_0x17cd('0x2c')](this));ami['on'](_0x17cd('0x30'),this[_0x17cd('0xa')][_0x17cd('0x2c')](this));ami['on']('custom:queuesummarycomplete',this[_0x17cd('0x31')][_0x17cd('0x2c')](this));ami['on']('hangup',this[_0x17cd('0x32')]['bind'](this));ami['on'](_0x17cd('0x33'),this[_0x17cd('0x34')][_0x17cd('0x2c')](this));ami['on'](_0x17cd('0x35'),this[_0x17cd('0x36')][_0x17cd('0x2c')](this));ami['on'](_0x17cd('0x37'),this['syncQueueMember'][_0x17cd('0x2c')](this));ami['on'](_0x17cd('0x38'),this[_0x17cd('0x39')][_0x17cd('0x2c')](this));this[_0x17cd('0x3a')]();this['loopClearZombieChannels']();RpcSetting[_0x17cd('0x3b')]()[_0x17cd('0x3c')](function(_0x413833){previewRecallmeReminderInterval=_0x413833[_0x17cd('0x3d')];});}function isNotNull(_0x4376ae){return _0x4376ae!==null&&!_[_0x17cd('0x3e')](_0x4376ae);}function msgResponse(_0x19d585,_0x328d05,_0x1b06fb){return{'action':_0x19d585,'response':_0x328d05,'message':_0x1b06fb,'stack':_0x1b06fb};}function emit(_0x169573,_0x31a18a,_0x4a7c21){io['to'](_0x169573)[_0x17cd('0x3f')](_0x31a18a,_0x4a7c21);}function emitOutboundVoiceQueueSummary(_0x179f1b){if(_0x179f1b[_0x17cd('0x40')]===_0x17cd('0x41')){logger[_0x17cd('0x42')](_0x17cd('0x43'),util[_0x17cd('0x44')](_0x179f1b,{'showHidden':![],'depth':null}));emit(util[_0x17cd('0x45')](_0x17cd('0x46'),_0x179f1b[_0x17cd('0x47')]),_0x17cd('0x48'),_0x179f1b);}}function checkGetDataPredictive(_0x18d138){if(isNotNull(_0x18d138)&&!_['isEmpty'](_0x18d138)){loggerPredictive[_0x17cd('0x49')](_0x17cd('0x4a'));loggerPredictive['info'](_0x17cd('0x4b'),_0x18d138['predictiveIntervalTotalCalls']);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x4c'),_0x18d138[_0x17cd('0x4d')]);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x4e'),_0x18d138[_0x17cd('0x4f')]);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x50'),_0x18d138[_0x17cd('0x51')]);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x52'),_0x18d138[_0x17cd('0x53')]);loggerPredictive['info'](_0x17cd('0x54'),_0x18d138[_0x17cd('0x55')]);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x56'));if(_0x18d138[_0x17cd('0x57')]>0x0){if(!_[_0x17cd('0x3e')](_0x18d138[_0x17cd('0x55')])&&_0x18d138['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0x17cd('0x58'));if(!_[_0x17cd('0x3e')](_0x18d138[_0x17cd('0x53')])&&_0x18d138[_0x17cd('0x53')]>0x0){return!![];}loggerPredictive['info'](_0x17cd('0x59'));}else{loggerPredictive[_0x17cd('0x49')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x17cd('0x49')](_0x17cd('0x5a'));}return![];}function mergeDataErlangB(_0x1090b6){return function(_0x4362c2){loggerPredictive[_0x17cd('0x49')](_0x17cd('0x5b'));loggerPredictive['info'](_0x17cd('0x5c'),_0x4362c2[_0x17cd('0x5d')]);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x5e'),_0x4362c2[_0x17cd('0x5f')]);loggerPredictive['info'](_0x17cd('0x60'),_0x4362c2['erlangAbandonmentRate']);loggerPredictive['info'](_0x17cd('0x61'),_0x4362c2[_0x17cd('0x62')]);loggerPredictive['info'](_0x17cd('0x60'),_0x4362c2['erlangAbandonmentRate']);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x56'));_[_0x17cd('0x63')](_0x1090b6,_0x4362c2);};}function ifInterval(_0xf606d8,_0x3f6fe5){if(_[_0x17cd('0x3e')](_0x3f6fe5)){return![];}return utils[_0x17cd('0x64')](undefined,_0x3f6fe5)<_0xf606d8*0x3c;}function clearPredictiveAttributes(_0x19f12e){if(_0x19f12e['startProgressive']){_0x19f12e[_0x17cd('0x26')]=undefined;loggerPredictive[_0x17cd('0x42')](_0x19f12e['name'],'startProgressive\x20value\x20cleared');}if(_0x19f12e[_0x17cd('0x25')]){_0x19f12e[_0x17cd('0x25')]=undefined;loggerPredictive[_0x17cd('0x42')](_0x19f12e[_0x17cd('0x47')],_0x17cd('0x65'));}if(_0x19f12e[_0x17cd('0x66')]){clearInterval(_0x19f12e[_0x17cd('0x66')]);_0x19f12e[_0x17cd('0x66')]=undefined;loggerPredictive['debug'](_0x19f12e[_0x17cd('0x47')],_0x17cd('0x67'));}}function loggerCatchPredictive(_0x31cea6,_0x2850a9){return function(_0x27391d){loggerPredictive['error'](_0x2850a9[_0x17cd('0x47')],_0x31cea6);loggerPredictive[_0x17cd('0x68')](_0x27391d[_0x17cd('0x69')]);clearPredictiveAttributes(_0x2850a9);};}function loggerCatch(_0x5d6fca){return function(_0x4156e8){logger['error'](_0x5d6fca,util[_0x17cd('0x44')](_0x4156e8,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x338542,_0x5983e9,_0x1e92b5){return function(_0x1aa546){utils[_0x17cd('0x6a')](_0x5983e9,_0x1e92b5,0x0);_0x5983e9[_0x17cd('0x6b')]=0x0;logger[_0x17cd('0x68')](_0x338542,util[_0x17cd('0x44')](_0x1aa546,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x488f71){return function(_0x4441ce){if(isNotNull(_0x4441ce)&&isNotNull(_0x4441ce[0x0])){if(_0x4441ce[0x0]['contactsRescheduled']>0x0){_0x488f71[_0x17cd('0x6c')]=utils[_0x17cd('0x6d')][_0x17cd('0x6e')];logger[_0x17cd('0x49')](_0x17cd('0x6f')+_0x488f71[_0x17cd('0x47')],_0x4441ce[0x0][_0x17cd('0x70')],'contacts');}else{_0x488f71[_0x17cd('0x6c')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x17cd('0x49')](_0x17cd('0x71')+_0x488f71[_0x17cd('0x47')]);}}};}function createObjHistory(_0x82d337,_0x35b96a,_0x5a8212,_0x25d1c4,_0x4f6f4d){_0x82d337['message']=_0x5a8212;var _0x3567c9=new Action(_0x82d337,_0x35b96a);var _0x471605=new History(_0x3567c9);_0x471605['state']=_0x25d1c4;_0x471605[_0x17cd('0x72')]=_0x4f6f4d;_0x471605[_0x17cd('0x73')]=_0x3567c9[_0x17cd('0x74')];return _0x471605;}function unlockQueueStatus(_0x3ee103,_0x592036){setTimeout(function(){if(_[_0x17cd('0x3e')](_0x3ee103[_0x17cd('0x75')])){loggerBooked[_0x17cd('0x68')](_0x17cd('0x76'),_0x592036);}_0x3ee103['queueStatusComplete']=!![];loggerBooked[_0x17cd('0x49')](_0x17cd('0x77'),_0x592036,JSON[_0x17cd('0x78')](_[_0x17cd('0x79')](_0x3ee103,['name',_0x17cd('0x75')])));},0x1f3);}function checkInterval(_0x4aa80a){return function(){if(!isNotNull(_0x4aa80a[_0x17cd('0x7a')])){_0x4aa80a[_0x17cd('0x6c')]=utils[_0x17cd('0x6d')][_0x17cd('0x7b')];throw _0x4aa80a['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4aa80a[_0x17cd('0x7a')][_0x17cd('0x7c')])){_0x4aa80a['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x4aa80a[_0x17cd('0x47')]+_0x17cd('0x7d');}if(!isNotNull(_[_0x17cd('0x7e')](_0x4aa80a['Interval'][_0x17cd('0x7c')]))){_0x4aa80a[_0x17cd('0x6c')]=utils[_0x17cd('0x6d')][_0x17cd('0x7b')];throw _0x4aa80a['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x4a92dc){return function(){if(!utils[_0x17cd('0x7f')](_0x4a92dc)){_0x4a92dc['message']=utils[_0x17cd('0x6d')][_0x17cd('0x80')];throw _0x4a92dc[_0x17cd('0x47')]+_0x17cd('0x81');}};}function emitCampaignSummary(_0x277343){if(utils[_0x17cd('0x82')](_0x277343)){emit(util['format'](_0x17cd('0x83'),_0x277343[_0x17cd('0x47')]),_0x17cd('0x84'),_0x277343);}}function loggerCatchQueueSummary(_0x34bc77,_0x290b19){return function(_0x39f86f){clearPredictiveAttributes(_0x290b19);emitCampaignSummary(_0x290b19);loggerSyncQueueSummary[_0x17cd('0x42')](_0x34bc77,util[_0x17cd('0x44')](_0x39f86f,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xfed04a){if(_0xfed04a[_0x17cd('0x85')]){if(_0xfed04a[_0x17cd('0x86')]===0x0){_0xfed04a[_0x17cd('0x85')]=![];_0xfed04a['message']=utils[_0x17cd('0x6d')]['INACTIVE'];loggerSyncQueueSummary[_0x17cd('0x42')](_0x17cd('0x87'),_0xfed04a[_0x17cd('0x47')],'is\x20not\x20active');}else{_0xfed04a[_0x17cd('0x6c')]=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x17cd('0x42')](_0x17cd('0x87'),_0xfed04a[_0x17cd('0x47')],_0x17cd('0x88'));}emitCampaignSummary(_0xfed04a);}}function myreject(_0x510ab5){return function(_0x56ed77){return _0x510ab5(msgResponse(_0x17cd('0x89'),_0x17cd('0x8a'),JSON[_0x17cd('0x78')](_0x56ed77)));};}Dialer[_0x17cd('0x18')][_0x17cd('0x8b')]=function(_0x58f568){return!_[_0x17cd('0x3e')](_0x58f568)&&_0x58f568&&!_[_0x17cd('0x3e')](_0x58f568[_0x17cd('0x47')])&&!_[_0x17cd('0x3e')](_0x58f568['active'])&&_0x58f568['active']&&(this['trunks'][util[_0x17cd('0x45')](_0x17cd('0x8c'),_0x58f568['name'])]['status']===_0x17cd('0x8d')||this[_0x17cd('0x20')][util[_0x17cd('0x45')]('SIP/%s',_0x58f568[_0x17cd('0x47')])][_0x17cd('0x8e')]===_0x17cd('0x8f'));};Dialer[_0x17cd('0x18')][_0x17cd('0x90')]=function(_0x45a8d8){var _0x77ed4c=this;return function(){if(!_0x77ed4c[_0x17cd('0x8b')](_0x45a8d8['Trunk'])){if(!_0x77ed4c[_0x17cd('0x8b')](_0x45a8d8[_0x17cd('0x91')])){_0x45a8d8[_0x17cd('0x6c')]=utils[_0x17cd('0x6d')][_0x17cd('0x92')];throw _0x45a8d8[_0x17cd('0x47')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype']['checkIfTime']=function(_0x4b4de7,_0x115049,_0x4e26df,_0x413a41){var _0x3a7392=this;return function(){var _0x562966=!![];return _0x3a7392['ifTimeIvr'](_0x4b4de7,_0x115049,_0x4e26df,_0x413a41,_0x562966);};};Dialer[_0x17cd('0x18')]['checkIfTimeIntervals']=function(_0x2acbda,_0x1c1ee8,_0x5dbc02,_0x48bfb1){var _0x102df2=this;return function(){var _0x291277=![];return _0x102df2[_0x17cd('0x93')](_0x2acbda[_0x17cd('0x7c')],_0x1c1ee8,_0x5dbc02,_0x48bfb1,_0x291277);};};Dialer[_0x17cd('0x18')][_0x17cd('0x93')]=function(_0x3b1345,_0x4ab538,_0x218571,_0x100fe5,_0x18a72d){var _0x37fad2=[];return new Promise(function(_0x259ca2,_0x35f07c){if(!isNotNull(_0x3b1345)){_0x100fe5[_0x17cd('0x6c')]=utils[_0x17cd('0x6d')][_0x17cd('0x7b')];return _0x35f07c(msgResponse('ifTime',_0x17cd('0x94'),_0x218571+_0x17cd('0x95')));}if(_[_0x17cd('0x7e')](_0x3b1345)){_0x100fe5[_0x17cd('0x6c')]=utils[_0x17cd('0x6d')][_0x17cd('0x96')];return _0x35f07c(msgResponse(_0x17cd('0x97'),'Failure',_0x218571+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4ab538&&_[_0x17cd('0x3e')](config[_0x17cd('0x98')][_0x4ab538])){_0x100fe5[_0x17cd('0x6c')]=utils['CAMPAIGN_STATUS'][_0x17cd('0x99')];return _0x35f07c(msgResponse(_0x17cd('0x97'),_0x17cd('0x94'),_0x218571+_0x17cd('0x9a')+_0x4ab538));}if(_[_0x17cd('0x9b')](_0x3b1345)){for(var _0x5eb6c8=0x0;_0x5eb6c8<_0x3b1345['length'];_0x5eb6c8+=0x1){_0x37fad2[_0x17cd('0x9c')](ami['Action']({'action':_0x17cd('0x9d'),'command':util[_0x17cd('0x45')](_0x17cd('0x9e'),_0x3b1345[_0x5eb6c8]['interval'],!_['isUndefined'](config[_0x17cd('0x98')][_0x4ab538])?_0x4ab538:'')})['then'](function(_0x2c2403){return _0x2c2403[_0x17cd('0x9f')]['indexOf'](_0x17cd('0xa0'))>=0x0;})[_0x17cd('0xa1')](myreject(_0x35f07c)));}}else{_0x37fad2[_0x17cd('0x9c')](ami[_0x17cd('0xa2')]({'action':_0x17cd('0x9d'),'command':util['format'](_0x17cd('0x9e'),_0x3b1345,!_['isUndefined'](config['timezones'][_0x4ab538])?_0x4ab538:'')})[_0x17cd('0x3c')](function(_0x1db264){return _0x1db264[_0x17cd('0x9f')][_0x17cd('0xa3')](_0x17cd('0xa0'))>=0x0;})[_0x17cd('0xa1')](myreject(_0x35f07c)));}Promise[_0x17cd('0xa4')](_0x37fad2)[_0x17cd('0x3c')](function(_0x43e102){var _0x2f3d52=_[_0x17cd('0xa5')](_0x43e102);if(_0x2f3d52){return _0x259ca2(_0x2f3d52);}else{_0x100fe5[_0x17cd('0x6c')]=_0x18a72d?utils[_0x17cd('0x6d')][_0x17cd('0xa6')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x35f07c(msgResponse(_0x17cd('0xa7'),'Failure',_0x17cd('0xa8')+_0x18a72d+'\x20'+_0x218571+_0x17cd('0xa9')+util[_0x17cd('0x44')](_0x3b1345,{'showHidden':![],'depth':null})+_0x17cd('0xaa')+_0x4ab538));}})['catch'](function(_0x2c6440){return _0x35f07c(msgResponse(_0x17cd('0x97'),_0x17cd('0x94'),JSON[_0x17cd('0x78')](_0x2c6440)));});});};Dialer[_0x17cd('0x18')][_0x17cd('0x3a')]=function(){var _0x17259b=this;return cmHopper[_0x17cd('0xab')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x17259b['syncCampaigns']();},0x3e8);});};Dialer['prototype']['syncCampaigns']=function(){var _0x50a6c2=this;var _0x44f969;for(var _0x2a3ca6 in this[_0x17cd('0x1e')]){if(typeof this[_0x17cd('0x1e')][_0x2a3ca6]!==_0x17cd('0xac')){_0x44f969=this[_0x17cd('0x1e')][_0x2a3ca6];if(utils['isIVRCampaign'](_0x44f969)&&utils[_0x17cd('0x7f')](_0x44f969)){_0x44f969[_0x17cd('0x85')]=!![];Promise[_0x17cd('0xad')]()[_0x17cd('0x3c')](checkIsIVRCampaignActive(_0x44f969))['then'](checkInterval(_0x44f969))['then'](_0x50a6c2[_0x17cd('0x90')](_0x44f969))[_0x17cd('0x3c')](_0x50a6c2['checkIfTime'](_0x44f969['dialGlobalInterval'],_0x44f969[_0x17cd('0xae')],_0x44f969[_0x17cd('0x47')],_0x44f969))[_0x17cd('0x3c')](_0x50a6c2[_0x17cd('0xaf')](_0x44f969[_0x17cd('0x7a')],_0x44f969['dialTimezone'],_0x44f969[_0x17cd('0x47')],_0x44f969))[_0x17cd('0x3c')](_0x50a6c2[_0x17cd('0xb0')](_0x44f969))[_0x17cd('0xa1')](loggerCatchQueueSummary('[syncCampaigns]',_0x44f969));}else{notSendMessagesCampaign(_0x44f969);}}}};Dialer[_0x17cd('0x18')]['checkDialMethod']=function(_0x45c57a){if(_0x45c57a[_0x17cd('0xb1')]!==_0x17cd('0x8')){clearPredictiveAttributes(_0x45c57a);}switch(_0x45c57a[_0x17cd('0xb1')]){case _0x17cd('0xb2'):this[_0x17cd('0xb3')](_0x45c57a,0x1);break;case _0x17cd('0xb4'):this[_0x17cd('0xb3')](_0x45c57a,_0x45c57a[_0x17cd('0xb5')]);break;case'predictive':this[_0x17cd('0x8')](_0x45c57a);break;case _0x17cd('0x7'):this[_0x17cd('0xb3')](_0x45c57a,0x1);break;default:logger[_0x17cd('0x68')](_0x17cd('0xb6'),_0x45c57a[_0x17cd('0x47')],_0x17cd('0xb7'));}};Dialer[_0x17cd('0x18')][_0x17cd('0x97')]=function(_0x566c0a,_0x57f810){var _0xd7f19=_0x566c0a[_0x17cd('0xae')];var _0x1382db=_0x57f810?_0x566c0a[_0x17cd('0xb8')]:_0x566c0a['Interval']['Intervals'];logger[_0x17cd('0xb9')](_0x17cd('0xba'),_0x1382db,_0xd7f19,_0x566c0a[_0x17cd('0x47')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x566c0a[_0x17cd('0x47')],_0x566c0a['id']));var _0x199919=null;return Interval[_0x17cd('0xbb')](_0x1382db,_0xd7f19)['then'](function(_0x39bd81){if(_0x39bd81===!![]){return _0x39bd81;}else{_0x566c0a[_0x17cd('0x6c')]=_0x57f810?utils[_0x17cd('0x6d')][_0x17cd('0xa6')]:utils[_0x17cd('0x6d')][_0x17cd('0xbc')];_0x199919=msgResponse('[ifTime][promiseAll]',_0x17cd('0x94'),_0x17cd('0xa8')+_0x57f810+'\x20'+_0x566c0a[_0x17cd('0x47')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x17cd('0x44')](_0x1382db,{'showHidden':![],'depth':null})+_0x17cd('0xaa')+_0xd7f19);}if(_0x199919!==null){logger[_0x17cd('0xb9')](_0x17cd('0xbd'),_0x199919);_0x199919[_0x17cd('0xbe')]=_0x57f810;throw _0x199919;}})['catch'](function(_0x8b922e){logger['error'](_0x17cd('0xbf'),_0x8b922e);throw msgResponse(_0x17cd('0x89'),_0x17cd('0x8a'),util[_0x17cd('0x44')](_0x8b922e,{'showHidden':![],'depth':null}));});};Dialer[_0x17cd('0x18')]['syncAgentConnect']=function(_0x5f520c){if(this[_0x17cd('0x1d')][_0x5f520c[_0x17cd('0xc0')]]){if(this[_0x17cd('0x23')][_0x5f520c[_0x17cd('0xc1')]]&&this[_0x17cd('0x23')][_0x5f520c[_0x17cd('0xc1')]][_0x17cd('0x40')]!==_0x17cd('0xc2')){this[_0x17cd('0xc3')](this[_0x17cd('0x1d')][_0x5f520c[_0x17cd('0xc0')]]);this[_0x17cd('0x23')][_0x5f520c[_0x17cd('0xc1')]][_0x17cd('0xc4')]=moment()[_0x17cd('0x45')](_0x17cd('0xc5'));}}};Dialer[_0x17cd('0x18')][_0x17cd('0xc6')]=function(_0x5568b5){var _0x3a931a=this[_0x17cd('0x23')][_0x5568b5[_0x17cd('0xc1')]];if(this[_0x17cd('0x1d')][_0x5568b5[_0x17cd('0xc0')]]){if(_0x3a931a&&_0x3a931a[_0x17cd('0x40')]!==_0x17cd('0xc2')){delete this[_0x17cd('0x23')][_0x5568b5['uniqueid']];this[_0x17cd('0x1d')][_0x5568b5[_0x17cd('0xc0')]][_0x17cd('0xc7')]+=0x1;var _0x315083=new AgentComplete(_0x3a931a,_0x5568b5);if(_0x5568b5[_0x17cd('0xc8')]==='agent'){_0x315083['agiafterat']=this[_0x17cd('0x1d')][_0x5568b5[_0x17cd('0xc0')]][_0x17cd('0xc9')]&&this[_0x17cd('0x1d')][_0x5568b5[_0x17cd('0xc0')]]['dialAgiAfterHangupAgent']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x17cd('0xca')](_0x315083)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0xcb')));hopperUtils[_0x17cd('0xcc')](_0x315083)['catch'](loggerCatch(_0x17cd('0xcd')));}}};Dialer[_0x17cd('0x18')][_0x17cd('0xce')]=function(_0x120bbe){var _0x1e2834=this[_0x17cd('0x23')][_0x120bbe[_0x17cd('0xc1')]];var _0x1b635a=this;var _0x47d95f=![];var _0x3dcd86;var _0xb058e0;if(this[_0x17cd('0x1d')][_0x120bbe['queue']]){if(_0x1e2834&&_0x1e2834[_0x17cd('0x40')]!==_0x17cd('0xc2')){delete this[_0x17cd('0x23')][_0x120bbe[_0x17cd('0xc1')]];this['updateOriginated'](this['voiceQueues'][_0x120bbe[_0x17cd('0xc0')]]);_0x1e2834[_0x17cd('0xcf')]=moment()['format'](_0x17cd('0xc5'));var _0x3ed8bf=new QueueCallerAbandon(_0x1e2834,_0x120bbe);if(utils[_0x17cd('0x64')](_0x1e2834[_0x17cd('0xcf')],_0x1e2834['responsetime'])>=_0x1e2834[_0x17cd('0xd0')]){this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x17cd('0x1d')][_0x120bbe['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0xd1')]+=0x1;_0x3ed8bf[_0x17cd('0xd2')]=0xa;_0x3ed8bf['statedesc']=_0x17cd('0xd3');_0x3ed8bf[_0x17cd('0xd4')]=_0x17cd('0xd5');_0x3ed8bf[_0x17cd('0xd6')]=this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0xc9')]?moment()[_0x17cd('0x45')](_0x17cd('0xc5')):undefined;_0x3ed8bf[_0x17cd('0xd7')]+=0x1;_0x3ed8bf['countglobal']+=0x1;_0x3dcd86=this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]]['dialDropRetryFrequency'];_0xb058e0=this[_0x17cd('0x1d')][_0x120bbe['queue']][_0x17cd('0xd8')];hopperUtils[_0x17cd('0xd9')](_0x3ed8bf,_0x3ed8bf[_0x17cd('0xd2')],_0x1e2834[_0x17cd('0xda')])[_0x17cd('0x3c')](function(_0xd80b0b){_0x47d95f=_0xd80b0b[_0x17cd('0xdb')]==0x1;if(_0x3ed8bf[_0x17cd('0xd7')]>=_0x1b635a[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0xdc')]){_0x1b635a[_0x17cd('0xdd')](_0x3ed8bf,_0xd80b0b[_0x17cd('0xdb')]);}else{hopperUtils[_0x17cd('0xde')]({'active':![],'countdropretry':_0x3ed8bf[_0x17cd('0xd7')],'scheduledat':moment()[_0x17cd('0xdf')](_0x1b635a[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0xe0')],_0x17cd('0xe1'))['format'](_0x17cd('0xc5')),'ContactId':_0x1e2834[_0x17cd('0xe2')],'ListId':_0x1e2834[_0x17cd('0xe3')],'VoiceQueueId':_0x1e2834[_0x17cd('0xe4')]||undefined,'CampaignId':_0x1e2834['CampaignId']||undefined})['catch'](loggerCatch(_0x17cd('0xe5')));var _0x4099dc=new History(_0x3ed8bf);_0x4099dc['state']=0xa;_0x4099dc[_0x17cd('0x72')]='Drop';_0x4099dc[_0x17cd('0x74')]=moment()[_0x17cd('0x45')](_0x17cd('0xc5'));_0x4099dc[_0x17cd('0x73')]=_0x4099dc[_0x17cd('0x74')];_0x4099dc['calleridname']=_0x3ed8bf[_0x17cd('0xe6')];_0x4099dc[_0x17cd('0xe7')]=_0x3ed8bf[_0x17cd('0xe7')];hopperUtils[_0x17cd('0xca')](_0x4099dc)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0xe8')));}})[_0x17cd('0x3c')](function(){if(_0x47d95f)hopperUtils['swapAdditionalPhones'](_0x3ed8bf,_0x3dcd86,_0xb058e0)[_0x17cd('0x3c')](function(){return 0x1;});});}else{this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0x51')]+=0x1;this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0xe9')]+=0x1;_0x3ed8bf['state']=0xb;_0x3ed8bf['statedesc']='Abandoned';_0x3ed8bf['dropreason']=_0x17cd('0xea');_0x3ed8bf['countabandonedretry']+=0x1;_0x3ed8bf[_0x17cd('0xeb')]+=0x1;_0x3dcd86=this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]]['dialAbandonedRetryFrequency'];_0xb058e0=this[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]][_0x17cd('0xd8')];hopperUtils['verifyAdditionalPhones'](_0x3ed8bf,_0x3ed8bf[_0x17cd('0xd2')],_0x1e2834[_0x17cd('0xda')])[_0x17cd('0x3c')](function(_0x622d52){if(_0x3ed8bf[_0x17cd('0xec')]>=_0x1b635a[_0x17cd('0x1d')][_0x120bbe[_0x17cd('0xc0')]]['dialAbandonedMaxRetry']){_0x1b635a['queueCallerAbandonCreateState'](_0x3ed8bf,_0x622d52[_0x17cd('0xdb')]);}else{hopperUtils[_0x17cd('0xde')]({'active':![],'countabandonedretry':_0x3ed8bf[_0x17cd('0xec')],'scheduledat':moment()[_0x17cd('0xdf')](_0x1b635a[_0x17cd('0x1d')][_0x120bbe['queue']][_0x17cd('0xed')],_0x17cd('0xe1'))[_0x17cd('0x45')](_0x17cd('0xc5')),'ContactId':_0x1e2834[_0x17cd('0xe2')],'ListId':_0x1e2834[_0x17cd('0xe3')],'VoiceQueueId':_0x1e2834[_0x17cd('0xe4')]||undefined,'CampaignId':_0x1e2834[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x190134=new History(_0x3ed8bf);_0x190134[_0x17cd('0xd2')]=0xb;_0x190134['statedesc']=_0x17cd('0xef');_0x190134[_0x17cd('0x74')]=moment()[_0x17cd('0x45')](_0x17cd('0xc5'));_0x190134['endtime']=_0x190134[_0x17cd('0x74')];_0x190134[_0x17cd('0xe6')]=_0x3ed8bf[_0x17cd('0xe6')];_0x190134[_0x17cd('0xe7')]=_0x3ed8bf[_0x17cd('0xe7')];hopperUtils[_0x17cd('0xca')](_0x190134)[_0x17cd('0xa1')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x17cd('0x3c')](function(){if(_0x47d95f)hopperUtils[_0x17cd('0xf0')](_0x3ed8bf,_0x3dcd86,_0xb058e0)[_0x17cd('0x3c')](function(){return 0x1;});});}}}};Dialer[_0x17cd('0x18')][_0x17cd('0x34')]=function(_0x7cfe69){if(this['actions'][_0x7cfe69[_0x17cd('0xc1')]]){this[_0x17cd('0xf1')][_0x7cfe69['uniqueid']]['channel']=_0x7cfe69[_0x17cd('0xf2')];}if(this['uniqueId'][_0x7cfe69[_0x17cd('0xc1')]]){this[_0x17cd('0x23')][_0x7cfe69[_0x17cd('0xc1')]][_0x17cd('0xf2')]=_0x7cfe69[_0x17cd('0xf2')];}};Dialer[_0x17cd('0x18')][_0x17cd('0xf3')]=function(_0x2a47a2){if(!this[_0x17cd('0xf1')][_0x2a47a2['actionid']]){return;}var _0x562652=this[_0x17cd('0x1d')][this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]][_0x17cd('0xc0')]][_0x17cd('0xf5')]||_0x17cd('0xf6');if(_0x562652===_0x17cd('0xf7')){if(this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]]&&_[_0x17cd('0xf8')](this['actions'][_0x2a47a2[_0x17cd('0xf4')]][_0x17cd('0xf9')])&&_0x2a47a2[_0x17cd('0x8e')]==='1'&&_0x2a47a2[_0x17cd('0xfa')]==='0'){if(this[_0x17cd('0x1f')][_0x2a47a2[_0x17cd('0xfb')]]){if(!this[_0x17cd('0x1f')][_0x2a47a2[_0x17cd('0xfb')]]['locked']){this['agents'][_0x2a47a2['stateinterface']]['locked']=!![];this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]][_0x17cd('0xf9')]=!![];this['actions'][_0x2a47a2[_0x17cd('0xf4')]]['stateinterface']=_0x2a47a2[_0x17cd('0xfb')];}}}}else if(_0x562652==='rrmemory'){if(this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]]){if(this[_0x17cd('0x1f')][_0x2a47a2[_0x17cd('0xfb')]]){this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]][_0x17cd('0xfb')]=_0x2a47a2[_0x17cd('0xfb')];if(_[_0x17cd('0xf8')](this[_0x17cd('0x27')][this['actions'][_0x2a47a2[_0x17cd('0xf4')]][_0x17cd('0xc0')]])){this[_0x17cd('0x27')][this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]]['queue']]=[];}this[_0x17cd('0x27')][this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]][_0x17cd('0xc0')]][_0x17cd('0x9c')](_['merge'](_['pick'](this[_0x17cd('0xf1')][_0x2a47a2[_0x17cd('0xf4')]],[_0x17cd('0xfc'),_0x17cd('0xfb')]),{'status':_0x2a47a2[_0x17cd('0x8e')],'paused':_0x2a47a2[_0x17cd('0xfa')]}));}}}};Dialer[_0x17cd('0x18')]['syncQueueStatusComplete']=function(_0x1a0948){if(!this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]){return;}var _0x230801=this;var _0xe423db=this[_0x17cd('0x1d')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]];var _0x4ee97e=_0xe423db['strategy']||_0x17cd('0xf6');if(_0x4ee97e===_0x17cd('0xf7')){if(this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]&&this[_0x17cd('0xf1')][_0x1a0948['actionid']][_0x17cd('0xfb')]){this[_0x17cd('0x1c')][_0x17cd('0xfd')](this[_0x17cd('0xf1')][_0x1a0948['actionid']][_0x17cd('0xfc')],this[_0x17cd('0xf1')][_0x1a0948['actionid']][_0x17cd('0xfb')])[_0x17cd('0xa1')](function(_0x17e9c9){logger['error'](_0x17cd('0xfe'),util[_0x17cd('0x44')](_0x17e9c9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x230801['updateOriginated'](_0x230801[_0x17cd('0x1d')][_0x230801[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]['queue']]);_0x230801[_0x17cd('0x1f')][_0x230801[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]['stateinterface']][_0x17cd('0xf9')]=![];delete _0x230801[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]];unlockQueueStatus(_0xe423db);});}else{this['updateOriginated'](this[_0x17cd('0x1d')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]]);hopperUtils[_0x17cd('0xde')]({'active':![],'ContactId':this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xe2')],'ListId':this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xe3')],'VoiceQueueId':this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xe4')]||undefined,'CampaignId':this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]['CampaignId']||undefined})[_0x17cd('0xa1')](loggerCatch(_0x17cd('0xff')));delete this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]];unlockQueueStatus(_0xe423db);}}else if(_0x4ee97e===_0x17cd('0xf6')){var _0x2890ca;if(this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]&&!_['isEmpty'](this[_0x17cd('0x27')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]])){if(this[_0x17cd('0x28')][_0x230801[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]]){this[_0x17cd('0x28')][_0x230801['actions'][_0x1a0948['actionid']][_0x17cd('0xc0')]]=this[_0x17cd('0x28')][this[_0x17cd('0xf1')][_0x1a0948['actionid']][_0x17cd('0xc0')]]?this[_0x17cd('0x28')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]]:this[_0x17cd('0x27')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]]?this[_0x17cd('0x27')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]][_0x17cd('0x100')]||0x0:0x0;}this['queueBooked'][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]]['queue']][_0x17cd('0x100')]=this[_0x17cd('0x28')][this[_0x17cd('0xf1')][_0x1a0948[_0x17cd('0xf4')]][_0x17cd('0xc0')]];for(var _0x50b8a6=0x0;_0x50b8a6=_0x2fc672[_0x17cd('0x125')]){_0x4e9040[_0x17cd('0x126')](_0x45637d,_0x4b8bac,_0x22b621,_0x17cd('0x127'));}else{if(_0x45637d[_0x17cd('0x120')]>=_0x2fc672[_0x17cd('0x128')]){_0x4e9040[_0x17cd('0x129')](_0x45637d,_0x4b8bac,_0x22b621,'reason\x2019\x20machine....');}else{hopperUtils[_0x17cd('0xde')]({'active':![],'countmachineretry':_0x45637d['countmachineretry'],'scheduledat':moment()[_0x17cd('0xdf')](_0x2fc672[_0x17cd('0x12a')],_0x17cd('0xe1'))['format'](_0x17cd('0xc5')),'ContactId':_0x45637d[_0x17cd('0xe2')],'ListId':_0x45637d[_0x17cd('0xe3')],'VoiceQueueId':_0x45637d[_0x17cd('0xe4')]||undefined,'CampaignId':_0x45637d[_0x17cd('0xee')]||undefined})['catch'](loggerCatch(_0x17cd('0x12b')));_0x4b8bac({'reschedule':0x1});}}});}if(_0x2b6b1e[_0x17cd('0x40')]==='ivr'&&this['campaigns'][_0x2b6b1e['queue']]['dialAMDActive']&&_0xb28aa1[_0x17cd('0x115')]===_0x17cd('0x116')){delete this[_0x17cd('0x23')][_0xb28aa1[_0x17cd('0xc1')]];this['updateOriginated'](this['campaigns'][_0x2b6b1e[_0x17cd('0xc0')]]);_0x25ffe4=new Hangup(_0x2b6b1e,_0xb28aa1);_0x25ffe4[_0x17cd('0xd2')]=0x12;_0x25ffe4[_0x17cd('0x72')]=_0x17cd('0x12c');_0x25ffe4[_0x17cd('0x12d')]=_0x17cd('0x11f');ami['emit'](_0x17cd('0x118'),ut['buildObj'](_0x25ffe4,_0x17cd('0x11a')));this[_0x17cd('0x11b')](_0x25ffe4,'[syncHangupInAMDIvr][createHistory]',_0x17cd('0x12e'));}if(_0x2b6b1e[_0x17cd('0x40')]==='ivr'&&this[_0x17cd('0x1e')][_0x2b6b1e[_0x17cd('0xc0')]]['dialAMDActive']&&_0xb28aa1['value']===_0x17cd('0x11d')){return new Promise(function(_0x15ea70,_0x32d92d){delete _0x4e9040[_0x17cd('0x23')][_0xb28aa1['uniqueid']];_0x4e9040[_0x17cd('0xc3')](_0x4e9040[_0x17cd('0x1e')][_0x2b6b1e[_0x17cd('0xc0')]]);_0x4e9040[_0x17cd('0x1e')][_0x2b6b1e[_0x17cd('0xc0')]][_0x17cd('0xc7')]+=0x1;_0x4e9040[_0x17cd('0x1e')][_0x2b6b1e['queue']][_0x17cd('0x117')]+=0x1;var _0x1112b1=_0x4e9040[_0x17cd('0x1e')][_0x2b6b1e[_0x17cd('0xc0')]];var _0x1487d9=new Hangup(_0x2b6b1e,_0xb28aa1);_0x1487d9[_0x17cd('0xd2')]=0x13;_0x1487d9['statedesc']=_0x17cd('0x11e');_0x1487d9[_0x17cd('0x12d')]=_0x17cd('0x11f');_0x1487d9[_0x17cd('0x120')]+=0x1;_0x1487d9['countglobal']+=0x1;_0x1487d9[_0x17cd('0x11a')]=!![];ami[_0x17cd('0x3f')](_0x17cd('0x118'),ut[_0x17cd('0x119')](_0x1487d9,_0x17cd('0x11a')));hopperUtils[_0x17cd('0xca')](_0x1487d9)[_0x17cd('0xa1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1487d9[_0x17cd('0x121')]+_0x1487d9[_0x17cd('0x122')]+_0x1487d9[_0x17cd('0x123')]+_0x1487d9[_0x17cd('0x12f')]+_0x1487d9['countdropretry']+_0x1487d9[_0x17cd('0xec')]+_0x1487d9[_0x17cd('0x120')]+_0x1487d9[_0x17cd('0x124')]>=_0x1112b1[_0x17cd('0x125')]){_0x4e9040[_0x17cd('0x126')](_0x1487d9,_0x15ea70,_0x32d92d,_0x17cd('0x127'));}else{if(_0x1487d9['countmachineretry']>=_0x1112b1['dialMachineMaxRetry']){_0x4e9040[_0x17cd('0x129')](_0x1487d9,_0x15ea70,_0x32d92d,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1487d9['countmachineretry'],'scheduledat':moment()[_0x17cd('0xdf')](_0x1112b1[_0x17cd('0x12a')],_0x17cd('0xe1'))[_0x17cd('0x45')](_0x17cd('0xc5')),'ContactId':_0x1487d9['ContactId'],'ListId':_0x1487d9[_0x17cd('0xe3')],'VoiceQueueId':_0x1487d9['VoiceQueueId']||undefined,'CampaignId':_0x1487d9['CampaignId']||undefined})['catch'](loggerCatch(_0x17cd('0x12b')));_0x15ea70({'reschedule':0x1});}}});}}};Dialer[_0x17cd('0x18')][_0x17cd('0x32')]=function(_0x5213ab){var _0x21ad8c=this['uniqueId'][_0x5213ab[_0x17cd('0xc1')]];var _0x590384;if(_0x21ad8c&&_0x21ad8c['type']==='ivr'){delete this[_0x17cd('0x23')][_0x5213ab[_0x17cd('0xc1')]];this[_0x17cd('0xc3')](this[_0x17cd('0x1e')][_0x21ad8c['queue']]);this[_0x17cd('0x1e')][_0x21ad8c[_0x17cd('0xc0')]][_0x17cd('0x130')]+=0x1;_0x590384=new Hangup(_0x21ad8c,_0x5213ab);hopperUtils[_0x17cd('0xca')](_0x590384)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x131')));hopperUtils[_0x17cd('0xcc')](_0x590384)[_0x17cd('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x21ad8c&&_0x21ad8c[_0x17cd('0x40')]!==_0x17cd('0xc2')&&isNotNull(this[_0x17cd('0x1d')][_0x21ad8c[_0x17cd('0xc0')]][_0x17cd('0x132')])){delete this[_0x17cd('0x23')][_0x5213ab[_0x17cd('0xc1')]];this[_0x17cd('0xc3')](this[_0x17cd('0x1d')][_0x21ad8c['queue']]);this[_0x17cd('0x1d')][_0x21ad8c['queue']][_0x17cd('0xc7')]+=0x1;this[_0x17cd('0x1d')][_0x21ad8c[_0x17cd('0xc0')]][_0x17cd('0x117')]+=0x1;_0x590384=new Hangup(_0x21ad8c,_0x5213ab);_0x590384['state']=0x10;_0x590384[_0x17cd('0x72')]='AnswerAGI';_0x590384['membername']=_0x17cd('0x133');hopperUtils[_0x17cd('0xca')](_0x590384)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x131')));hopperUtils[_0x17cd('0xcc')](_0x590384)[_0x17cd('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x21ad8c&&_0x21ad8c['type']!==_0x17cd('0xc2')&&!isNotNull(this[_0x17cd('0x1d')][_0x21ad8c[_0x17cd('0xc0')]][_0x17cd('0x132')])){delete this[_0x17cd('0x23')][_0x5213ab[_0x17cd('0xc1')]];this[_0x17cd('0xc3')](this[_0x17cd('0x1d')][_0x21ad8c['queue']]);this[_0x17cd('0x1d')][_0x21ad8c[_0x17cd('0xc0')]][_0x17cd('0x134')]+=0x1;_0x590384=new Hangup(_0x21ad8c,_0x5213ab);_0x590384[_0x17cd('0xd2')]=0xc;_0x590384[_0x17cd('0x72')]=_0x5213ab[_0x17cd('0x135')];_0x590384[_0x17cd('0x12d')]='Unknow';hopperUtils[_0x17cd('0xca')](_0x590384)[_0x17cd('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x17cd('0xcc')](_0x590384)[_0x17cd('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x17cd('0x18')][_0x17cd('0xa')]=function(_0x43872b){var _0x398267=this;if(!_0x398267[_0x17cd('0x136')][_0x43872b[_0x17cd('0x47')]]){_0x398267['queuesSummary'][_0x43872b[_0x17cd('0x47')]]={'running':![]};}else if(_0x398267[_0x17cd('0x136')][_0x43872b['name']][_0x17cd('0x137')]===!![]){return;}else if(_0x398267[_0x17cd('0x136')][_0x43872b[_0x17cd('0x47')]][_0x17cd('0x137')]===![]){_0x398267[_0x17cd('0x136')][_0x43872b[_0x17cd('0x47')]][_0x17cd('0x137')]=!![];}var _0x3e3e83=_0x398267['voiceQueues'][_0x43872b[_0x17cd('0x47')]];var _0xd9d24b=_0x3e3e83[_0x17cd('0x6c')]!==utils[_0x17cd('0x6d')]['INACTIVE'];var _0x59a88e=utils[_0x17cd('0x138')](_0x3e3e83);_0x3e3e83['statusMessage']=utils[_0x17cd('0x139')](_0x3e3e83,_0x398267[_0x17cd('0x20')]);Promise[_0x17cd('0xad')]()[_0x17cd('0x3c')](function(){if(_0x3e3e83[_0x17cd('0x13a')]===utils[_0x17cd('0x6d')]['INACTIVE']){if(_0xd9d24b){clearPredictiveAttributes(_0x3e3e83);_0x43872b['startPredictive']=undefined;_0x43872b[_0x17cd('0x26')]=undefined;}if(_0x3e3e83[_0x17cd('0x13a')]===utils[_0x17cd('0x6d')]['INACTIVE']){_0x43872b[_0x17cd('0x13b')]=0x0;_0x43872b[_0x17cd('0xfa')]=0x0;_0x43872b[_0x17cd('0x13c')]=0x0;_0x43872b[_0x17cd('0x13d')]=0x0;_0x43872b[_0x17cd('0x13e')]=0x0;}}else if(_0x3e3e83['statusMessage']===utils[_0x17cd('0x6d')][_0x17cd('0x13f')]&&!_0x59a88e){return _0x398267[_0x17cd('0x97')](_0x3e3e83,!![])[_0x17cd('0x3c')](function(){return _0x398267['ifTime'](_0x3e3e83,![]);})['then'](function(){return _0x398267[_0x17cd('0x140')](_0x3e3e83);})[_0x17cd('0xa1')](function(_0x5de291){loggerSyncQueueSummary[_0x17cd('0x42')]('[syncQueueSummary]',util[_0x17cd('0x44')](_0x5de291,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3e3e83);});}else{clearPredictiveAttributes(_0x3e3e83);}})[_0x17cd('0x3c')](function(){var _0x130746=_0x43872b['compareToOutboundQueue'](_0x3e3e83);if(_0x130746||_0x3e3e83['queueSummaryCountersUpdated']){_0x3e3e83[_0x17cd('0x141')]=![];_0x43872b[_0x17cd('0x142')](_0x3e3e83);Object[_0x17cd('0x143')](_0x3e3e83,_0x43872b);emitOutboundVoiceQueueSummary(_0x43872b);}_0x398267[_0x17cd('0x136')][_0x3e3e83[_0x17cd('0x47')]][_0x17cd('0x137')]=![];})[_0x17cd('0xa1')](function(_0x220aa0){logger[_0x17cd('0x68')](_0x17cd('0x144'),util[_0x17cd('0x44')](_0x220aa0,{'showHidden':![],'depth':null}));_0x398267['queuesSummary'][_0x3e3e83[_0x17cd('0x47')]][_0x17cd('0x137')]=![];});};Dialer[_0x17cd('0x18')][_0x17cd('0x31')]=_['throttle'](function(){var _0x22c163=_[_0x17cd('0x145')](this[_0x17cd('0x1d')],function(_0x429016){return _0x429016[_0x17cd('0x146')];});var _0x4da941=_[_0x17cd('0x145')](this[_0x17cd('0x1f')],function(_0x4228ff){return _0x4228ff[_0x17cd('0x147')]&&_0x4228ff[_0x17cd('0x8e')]==='reachable';});if(_0x22c163[_0x17cd('0x101')]>0x0&&_0x4da941['length']>0x0){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x17cd('0x148')](_0x22c163,'id'),previewRecallmeReminderInterval,_[_0x17cd('0x148')](_0x4da941,'id')))['then'](function(_0x126f26){for(var _0x505b70=0x0;_0x505b70<_0x126f26['length'];_0x505b70++){var _0x28de24=_0x126f26[_0x505b70][_0x17cd('0x149')][_0x17cd('0x47')];if(_0x28de24)io['to'](util['format'](_0x17cd('0x14a'),_0x28de24))['emit'](_0x17cd('0x14b'),{'hopper':_0x126f26[_0x505b70]});}})[_0x17cd('0xa1')](function(_0x5c64ea){logger[_0x17cd('0x68')]('checkPreviewRecallReminder',_0x5c64ea);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x17cd('0x18')][_0x17cd('0x14c')]=function(){var _0x363d32=this;setInterval(function(){_0x363d32[_0x17cd('0x14d')](_0x363d32['uniqueId'],'[uniqueid]');_0x363d32['clearZombieChannels'](_0x363d32[_0x17cd('0xf1')],_0x17cd('0x14e'));},0x32c8);};Dialer['prototype'][_0x17cd('0x14d')]=function(_0x30d2bc,_0x38f620){var _0x45e428=this;for(var _0xa2cff2 in _0x30d2bc){if(typeof _0x30d2bc[_0xa2cff2]!==_0x17cd('0xac')){this[_0x17cd('0x1b')]['enqueue'](function(){if(!_['isNil'](_0x30d2bc[_0xa2cff2])){return ami[_0x17cd('0xa2')]({'action':_0x17cd('0x8e'),'channel':_0x30d2bc[_0xa2cff2][_0x17cd('0xf2')]})['catch'](function(_0xfe8cbe){if(_0xfe8cbe[_0x17cd('0x6c')]===_0x17cd('0x14f')){setTimeout(function(){if(_0x30d2bc[_0xa2cff2]&&_0x30d2bc[_0xa2cff2][_0x17cd('0x40')]!==_0x17cd('0xc2')){_0x45e428[_0x17cd('0xc3')](_0x45e428[_0x17cd('0x1d')][_0x30d2bc[_0xa2cff2][_0x17cd('0xc0')]]);logger[_0x17cd('0x68')](_0x17cd('0x150'),_0x38f620,_0xa2cff2,_0x30d2bc[_0xa2cff2]['queue']);delete _0x30d2bc[_0xa2cff2];}if(_0x30d2bc[_0xa2cff2]&&_0x30d2bc[_0xa2cff2][_0x17cd('0x40')]===_0x17cd('0xc2')){_0x45e428[_0x17cd('0xc3')](_0x45e428[_0x17cd('0x1e')][_0x30d2bc[_0xa2cff2][_0x17cd('0xc0')]]);logger[_0x17cd('0x68')](_0x17cd('0x151'),_0x38f620,_0xa2cff2,_0x30d2bc[_0xa2cff2][_0x17cd('0xc0')]);delete _0x30d2bc[_0xa2cff2];}},0x2328);}});}});}}};Dialer[_0x17cd('0x18')][_0x17cd('0x152')]=function(_0x32c77a){return Promise[_0x17cd('0xad')]()[_0x17cd('0x3c')](voiceQueueRt['getVoiceQueueRtPauses'](_0x32c77a))[_0x17cd('0xa1')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x277549){if(!_['isUndefined'](_0x277549)&&_0x277549!==null){if(typeof _0x277549[_0x17cd('0x86')]!==_0x17cd('0xac')){if(_0x277549[_0x17cd('0x86')]>0x0){_0x277549['originated']-=0x1;}else{logger[_0x17cd('0x68')](_0x17cd('0x153'));}}}else{logger[_0x17cd('0x68')](_0x17cd('0x154'));}};Dialer[_0x17cd('0x18')][_0x17cd('0x155')]=function(_0x45d647,_0x2a2cf8){var _0x566840=this;return function(_0x17e43f){_0x566840['updateOriginated'](_0x2a2cf8);logger[_0x17cd('0x68')](_0x45d647,util[_0x17cd('0x44')](_0x17e43f,{'showHidden':![],'depth':null}));};};Dialer[_0x17cd('0x18')]['emptyContact']=function(_0x146985,_0xd83c77,_0x3de553){var _0x25af2c={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0xd83c77);this[_0x17cd('0x11b')](_[_0x17cd('0x63')](_0x25af2c,_['pick'](_0x3de553,[_0x17cd('0xe2'),_0x17cd('0xe3'),_0x17cd('0x156'),_0x17cd('0xe4'),_0x17cd('0xee')])),_0x17cd('0x157'),_0x17cd('0x158'));logger['error'](_0x146985);};Dialer[_0x17cd('0x18')][_0x17cd('0x11b')]=function(_0x3acad6,_0x2d6d8b,_0x5d2cc9){hopperUtils[_0x17cd('0xca')](_0x3acad6)[_0x17cd('0xa1')](loggerCatch(_0x2d6d8b));hopperUtils[_0x17cd('0xcc')](_0x3acad6)[_0x17cd('0xa1')](loggerCatch(_0x5d2cc9));};Dialer[_0x17cd('0x18')][_0x17cd('0xdd')]=function(_0x40015e,_0x1867d6){hopperUtils[_0x17cd('0xca')](_0x40015e)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0xcb')));if(_0x1867d6==0x0){hopperUtils[_0x17cd('0xcc')](_0x40015e)['catch'](loggerCatch(_0x17cd('0x159')));}};Dialer[_0x17cd('0x18')]['checkPreviewRecallReminder']=function(_0x5cc704){return Promise['resolve']()[_0x17cd('0x3c')](cmHopper[_0x17cd('0x15a')](_0x5cc704['id'],previewRecallmeReminderInterval))[_0x17cd('0x3c')](function(_0x3457b8){for(var _0x4e56ca=0x0;_0x4e56ca<_0x3457b8['length'];_0x4e56ca++){var _0x4d3b27=_0x3457b8[_0x4e56ca]['Agent'][_0x17cd('0x47')];if(_0x4d3b27)io['to'](util['format']('user:%s',_0x4d3b27))[_0x17cd('0x3f')]('user:dialPreviewRecallReminder',{'hopper':_0x3457b8[_0x4e56ca]});}})[_0x17cd('0xa1')](function(){});};Dialer[_0x17cd('0x18')][_0x17cd('0xb0')]=function(_0x33baa9){var _0x134d04=this;return function(){_0x134d04[_0x17cd('0x15b')](_0x33baa9);};};Dialer[_0x17cd('0x18')]['actionOriginate']=function(_0x4404ea,_0x1df507){var _0x59aefb=this;var _0x440d06=uuid['v4']();this[_0x17cd('0xf1')][_0x440d06]=new Action(_0x4404ea,_0x1df507,_0x440d06);return new Promise(function(_0x2a0f4b,_0x538084){if(_[_0x17cd('0x3e')](_0x4404ea)&&typeof _0x4404ea!==_0x17cd('0x15c')){return _0x538084(msgResponse(_0x17cd('0x15d'),'Failure',_0x17cd('0x15e')));}if(_[_0x17cd('0x3e')](_0x1df507[_0x17cd('0x15f')])||_0x1df507[_0x17cd('0x15f')]===null){return _0x538084(msgResponse(_0x17cd('0x15d'),_0x17cd('0x94'),'contact\x20is\x20undefine'));}var _0x214cf2={'XMD-CALLERID':_0x59aefb['actions'][_0x440d06][_0x17cd('0x160')](),'XMD-AGI':_0x4404ea[_0x17cd('0x132')]?util[_0x17cd('0x45')](_0x17cd('0x161'),ipAgi,_0x4404ea[_0x17cd('0x132')]):_0x17cd('0x162'),'XMD-AGIAFTER':_0x4404ea[_0x17cd('0xc9')]?util[_0x17cd('0x45')](_0x17cd('0x161'),ipAgi,_0x4404ea['dialQueueProject2']):_0x17cd('0x162'),'XMD-QUEUE':utils[_0x17cd('0x163')](_0x4404ea)?util[_0x17cd('0x45')](_0x17cd('0x164'),_0x4404ea[_0x17cd('0x47')],_0x4404ea[_0x17cd('0x165')]||'',_0x4404ea[_0x17cd('0x166')]?'c':'',_0x4404ea[_0x17cd('0xd0')]||0x3):'NONE','XMD-CONTACTID':_0x1df507[_0x17cd('0xe2')],'XMD-CDRTYPE':_0x17cd('0x6'),'CALLERID(all)':_0x59aefb[_0x17cd('0xf1')][_0x440d06][_0x17cd('0x160')](),'XMD-AMD':_0x4404ea[_0x17cd('0x114')]?_0x17cd('0x13f'):_0x17cd('0x162'),'XMD-DESTINATION':_0x17cd('0x113')};if(_0x4404ea['dialAMDActive']){_0x214cf2['XMD-AMDINITIALSILENCE']=_0x4404ea[_0x17cd('0x167')]||0x9c4;_0x214cf2[_0x17cd('0x168')]=_0x4404ea[_0x17cd('0x169')]||0x5dc;_0x214cf2[_0x17cd('0x16a')]=_0x4404ea[_0x17cd('0x16b')]||0x320;_0x214cf2[_0x17cd('0x16c')]=_0x4404ea[_0x17cd('0x16d')]||0x1388;_0x214cf2['XMD-AMDMINWORDLENGTH']=_0x4404ea[_0x17cd('0x16e')]||0x64;_0x214cf2[_0x17cd('0x16f')]=_0x4404ea[_0x17cd('0x170')]||0x32;_0x214cf2[_0x17cd('0x171')]=_0x4404ea[_0x17cd('0x172')]||0x3;_0x214cf2[_0x17cd('0x173')]=_0x4404ea[_0x17cd('0x174')]||0x100;_0x214cf2[_0x17cd('0x175')]=_0x4404ea[_0x17cd('0x176')]||0x1388;}if(utils[_0x17cd('0x163')](_0x4404ea)){_0x214cf2[_0x17cd('0x177')]=_0x1df507[_0x17cd('0xe4')];}else{_0x214cf2[_0x17cd('0x178')]=_0x1df507[_0x17cd('0xee')];}var _0x8b599a=utils['setXMDContactVariables'](_0x1df507[_0x17cd('0x179')]);Object['assign'](_0x214cf2,_0x8b599a);var _0x46f50f=_0x59aefb['isTrunkReachable'](_0x4404ea[_0x17cd('0x17a')])?utils[_0x17cd('0x17b')](_0x4404ea['Trunk'][_0x17cd('0x17c')],_0x4404ea[_0x17cd('0x17d')],_0x4404ea[_0x17cd('0x17e')]>0x0?utils[_0x17cd('0x17f')](_0x4404ea[_0x17cd('0x180')],_0x4404ea[_0x17cd('0x17e')]):_0x4404ea[_0x17cd('0x180')]):utils['getCallerId'](_[_0x17cd('0xf8')](_0x4404ea[_0x17cd('0x91')])?_0x4404ea[_0x17cd('0x17a')]['callerid']:_0x4404ea[_0x17cd('0x91')][_0x17cd('0x17c')],_0x4404ea['dialOriginateCallerIdName'],_0x4404ea[_0x17cd('0x17e')]>0x0?utils[_0x17cd('0x17f')](_0x4404ea[_0x17cd('0x180')],_0x4404ea[_0x17cd('0x17e')]):_0x4404ea[_0x17cd('0x180')]);if(_0x46f50f){_0x214cf2[_0x17cd('0x181')]=_0x59aefb[_0x17cd('0xf1')][_0x440d06][_0x17cd('0x182')]=utils[_0x17cd('0x183')](_0x46f50f);_0x214cf2[_0x17cd('0x184')]=_0x1df507[_0x17cd('0x15f')];}_0x4404ea[_0x17cd('0x185')]=_0x214cf2;return ami[_0x17cd('0xa2')]({'actionid':_0x440d06,'action':_0x17cd('0x15d'),'channel':_0x59aefb[_0x17cd('0x8b')](_0x4404ea[_0x17cd('0x17a')])?util[_0x17cd('0x45')](_0x17cd('0x186'),_0x4404ea[_0x17cd('0x17a')][_0x17cd('0x47')],isNotNull(_0x4404ea['dialPrefix'])?_0x4404ea[_0x17cd('0x187')][_0x17cd('0x188')]()||'':'',_0x4404ea[_0x17cd('0x189')]>0x0?_0x1df507[_0x17cd('0x15f')][_0x17cd('0x18a')](_0x4404ea[_0x17cd('0x189')]):_0x1df507[_0x17cd('0x15f')]):util[_0x17cd('0x45')](_0x17cd('0x186'),_[_0x17cd('0xf8')](_0x4404ea[_0x17cd('0x91')])?_0x4404ea[_0x17cd('0x17a')][_0x17cd('0x47')]:_0x4404ea[_0x17cd('0x91')][_0x17cd('0x47')],isNotNull(_0x4404ea[_0x17cd('0x187')])?_0x4404ea['dialPrefix'][_0x17cd('0x188')]()||'':'',_0x4404ea[_0x17cd('0x189')]>0x0?_0x1df507[_0x17cd('0x15f')][_0x17cd('0x18a')](_0x4404ea[_0x17cd('0x189')]):_0x1df507[_0x17cd('0x15f')]),'callerid':_0x46f50f,'Exten':_0x17cd('0x113'),'Context':_0x17cd('0x18b'),'Priority':'1','variable':_0x214cf2,'timeout':(_0x4404ea[_0x17cd('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x440d06})[_0x17cd('0x3c')](function(_0x3314ae){return _0x2a0f4b(_0x3314ae);})[_0x17cd('0xa1')](function(_0x4ffc36){_0x4404ea[_0x17cd('0x18d')]+=0x1;var _0x20a2f4=new History(_0x59aefb[_0x17cd('0xf1')][_0x440d06]);logger[_0x17cd('0x68')](util[_0x17cd('0x45')](_0x17cd('0x18e'),JSON[_0x17cd('0x78')](_0x4ffc36)));_0x20a2f4[_0x17cd('0xd2')]=0xe;_0x20a2f4[_0x17cd('0x72')]='OriginateError';_0x20a2f4['starttime']=moment()[_0x17cd('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x20a2f4[_0x17cd('0x73')]=_0x20a2f4[_0x17cd('0x74')];hopperUtils[_0x17cd('0xca')](_0x20a2f4)[_0x17cd('0xa1')](loggerCatch('[originate][error]'));_0x59aefb[_0x17cd('0xcc')](_0x20a2f4)[_0x17cd('0xa1')](loggerCatch('[originate][error]'))[_0x17cd('0x1a')](function(){delete _0x59aefb[_0x17cd('0xf1')][_0x440d06];return _0x538084(msgResponse(_0x17cd('0x15d'),'Error',_0x17cd('0x18f')));});});});};Dialer[_0x17cd('0x18')][_0x17cd('0x190')]=function(_0xd095fe,_0x1831df,_0x4abaf7){var _0x3ad3aa=new History(_0x1831df);if(_0x3ad3aa[_0x17cd('0x121')]+_0x3ad3aa['countcongestionretry']+_0x3ad3aa['countnoanswerretry']+_0x3ad3aa['countnosuchnumberretry']+_0x3ad3aa[_0x17cd('0xd7')]+_0x3ad3aa[_0x17cd('0xec')]+_0x3ad3aa[_0x17cd('0x120')]+_0x3ad3aa['countagentrejectretry']>=_0x4abaf7[_0x17cd('0x125')]-0x1){return!![];}switch(_0xd095fe){case 0x3:if(_0x3ad3aa[_0x17cd('0x123')]>=_0x4abaf7['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x17cd('0xde')]({'active':![],'countnoanswerretry':_0x3ad3aa[_0x17cd('0x123')]+=0x1,'scheduledat':moment()[_0x17cd('0xdf')](_0x4abaf7[_0x17cd('0x191')],_0x17cd('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ad3aa['ContactId'],'ListId':_0x3ad3aa[_0x17cd('0xe3')],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3ad3aa['countbusyretry']>=_0x4abaf7['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x17cd('0xde')]({'active':![],'countbusyretry':_0x3ad3aa['countbusyretry']+=0x1,'scheduledat':moment()[_0x17cd('0xdf')](_0x4abaf7[_0x17cd('0x192')],_0x17cd('0xe1'))[_0x17cd('0x45')](_0x17cd('0xc5')),'ContactId':_0x3ad3aa[_0x17cd('0xe2')],'ListId':_0x3ad3aa[_0x17cd('0xe3')],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa['CampaignId']||undefined})[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x193')));break;case 0x8:if(_0x3ad3aa['countcongestionretry']>=_0x4abaf7['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x17cd('0xde')]({'active':![],'countcongestionretry':_0x3ad3aa[_0x17cd('0x122')]+=0x1,'scheduledat':moment()[_0x17cd('0xdf')](_0x4abaf7[_0x17cd('0x194')],_0x17cd('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ad3aa['ContactId'],'ListId':_0x3ad3aa[_0x17cd('0xe3')],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3ad3aa[_0x17cd('0x12f')]>=_0x4abaf7[_0x17cd('0x195')]-0x1){return!![];}else{hopperUtils[_0x17cd('0xde')]({'active':![],'countnosuchnumberretry':_0x3ad3aa['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x4abaf7[_0x17cd('0x196')],_0x17cd('0xe1'))[_0x17cd('0x45')](_0x17cd('0xc5')),'ContactId':_0x3ad3aa['ContactId'],'ListId':_0x3ad3aa['ListId'],'VoiceQueueId':_0x3ad3aa['VoiceQueueId']||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x197')));}break;case 0xa:if(_0x3ad3aa[_0x17cd('0xd7')]>=_0x4abaf7[_0x17cd('0xdc')]-0x1){return!![];}hopperUtils[_0x17cd('0xde')]({'active':![],'countdropretry':_0x3ad3aa[_0x17cd('0xd7')]+=0x1,'scheduledat':moment()[_0x17cd('0xdf')](_0x4abaf7['dialDropRetryFrequency'],_0x17cd('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ad3aa[_0x17cd('0xe2')],'ListId':_0x3ad3aa[_0x17cd('0xe3')],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch(_0x17cd('0xe5')));break;case 0xb:if(_0x3ad3aa[_0x17cd('0xec')]>=_0x4abaf7['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x17cd('0xde')]({'active':![],'countabandonedretry':_0x3ad3aa[_0x17cd('0xec')]+=0x1,'scheduledat':moment()['add'](_0x4abaf7[_0x17cd('0xed')],_0x17cd('0xe1'))['format'](_0x17cd('0xc5')),'ContactId':_0x3ad3aa['ContactId'],'ListId':_0x3ad3aa['ListId'],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})['catch'](loggerCatch(_0x17cd('0x198')));break;case 0x13:if(_0x3ad3aa['countmachineretry']>=_0x4abaf7[_0x17cd('0x128')]-0x1){return!![];}hopperUtils[_0x17cd('0xde')]({'active':![],'countmachineretry':_0x3ad3aa[_0x17cd('0x120')]+=0x1,'scheduledat':moment()['add'](_0x4abaf7[_0x17cd('0x12a')],'minutes')['format'](_0x17cd('0xc5')),'ContactId':_0x3ad3aa['ContactId'],'ListId':_0x3ad3aa[_0x17cd('0xe3')],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x3ad3aa[_0x17cd('0x124')]>=_0x4abaf7[_0x17cd('0x199')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x3ad3aa[_0x17cd('0x124')]+=0x1,'scheduledat':moment()[_0x17cd('0xdf')](_0x4abaf7[_0x17cd('0x19a')],_0x17cd('0xe1'))[_0x17cd('0x45')](_0x17cd('0xc5')),'ContactId':_0x3ad3aa[_0x17cd('0xe2')],'ListId':_0x3ad3aa[_0x17cd('0xe3')],'VoiceQueueId':_0x3ad3aa[_0x17cd('0xe4')]||undefined,'CampaignId':_0x3ad3aa[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x19b')));break;default:return!![];}};Dialer[_0x17cd('0x18')][_0x17cd('0x19c')]=function(_0x56b91f,_0x1e81e3,_0x5666ec){var _0x5dc9d5=this;var _0x4474e2=new History(_0x56b91f);var _0x10a842=![];var _0x226794;var _0x3df011;return new Promise(function(_0x143f40,_0x30a659){if(_[_0x17cd('0x3e')](_0x1e81e3)&&typeof _0x1e81e3!==_0x17cd('0x15c')){return _0x30a659(msgResponse(_0x17cd('0x19d'),_0x17cd('0x94'),'entity\x20is\x20undefine'));}if(_[_0x17cd('0x3e')](_0x5666ec)&&typeof _0x5666ec!==_0x17cd('0x15c')){return _0x30a659(msgResponse('[callProgressDetecting]',_0x17cd('0x94'),_0x17cd('0x19e')));}hopperUtils[_0x17cd('0xd9')](_0x4474e2,_0x5666ec['reason'],_0x1e81e3)[_0x17cd('0x3c')](function(_0x24f5ae){if(_0x24f5ae[_0x17cd('0xdb')]==0x1)_0x10a842=!![];switch(_0x5666ec[_0x17cd('0xc8')]){case'0':_0x1e81e3[_0x17cd('0x19f')]+=0x1;_0x4474e2[_0x17cd('0xd2')]=0x0;_0x4474e2[_0x17cd('0x72')]=_0x17cd('0x1a0');_0x4474e2['countnosuchnumberretry']+=0x1;_0x4474e2['countglobal']+=0x1;ami[_0x17cd('0x3f')](_0x17cd('0x1a1'),ut[_0x17cd('0x119')](_0x56b91f,_0x17cd('0x1a2')));_0x226794=_0x1e81e3[_0x17cd('0x196')];_0x3df011=_0x1e81e3['callAdditionalPhoneAfterMin'];hopperUtils[_0x17cd('0xca')](_0x4474e2)['catch'](loggerCatch(_0x17cd('0x1a3')));if(_0x5dc9d5[_0x17cd('0x190')](0x0,_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2[_0x17cd('0x12f')]>=_0x1e81e3['dialNoSuchNumberMaxRetry']){_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1a4'));}else{_0x5dc9d5[_0x17cd('0x126')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1a4'));}}break;case'3':_0x1e81e3[_0x17cd('0x1a5')]+=0x1;_0x4474e2[_0x17cd('0xd2')]=0x3;_0x4474e2[_0x17cd('0x72')]=_0x17cd('0x1a6');_0x4474e2[_0x17cd('0x123')]+=0x1;_0x4474e2[_0x17cd('0xeb')]+=0x1;var _0x21587a=ut[_0x17cd('0x1a7')](_0x56b91f,_0x1e81e3);ami['emit']('custom:agentnoanswer',_0x21587a);_0x226794=_0x1e81e3[_0x17cd('0x191')];_0x3df011=_0x1e81e3[_0x17cd('0xd8')];hopperUtils[_0x17cd('0xca')](_0x4474e2)['catch'](loggerCatch(_0x17cd('0x1a8')));if(_0x5dc9d5['checkRetriveMax'](0x3,_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2[_0x17cd('0x123')]>=_0x1e81e3[_0x17cd('0x1a9')]){_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1aa'));}else{_0x5dc9d5[_0x17cd('0x126')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1aa'));}}break;case'5':_0x1e81e3[_0x17cd('0x1ab')]+=0x1;_0x4474e2['state']=0x5;_0x4474e2[_0x17cd('0x72')]='Busy';_0x4474e2['countbusyretry']+=0x1;_0x4474e2[_0x17cd('0xeb')]+=0x1;ami[_0x17cd('0x3f')](_0x17cd('0x1ac'),ut[_0x17cd('0x119')](_0x56b91f,_0x17cd('0x1ad')));_0x226794=_0x1e81e3[_0x17cd('0x192')];_0x3df011=_0x1e81e3[_0x17cd('0xd8')];hopperUtils['createHistory'](_0x4474e2)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x1ae')));if(_0x5dc9d5[_0x17cd('0x190')](0x5,_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2['countbusyretry']>=_0x1e81e3['dialBusyMaxRetry']){_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,'reason\x205\x20busy');}else{_0x5dc9d5[_0x17cd('0x126')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1af'));}}break;case'8':_0x1e81e3[_0x17cd('0x1b0')]+=0x1;_0x4474e2[_0x17cd('0xd2')]=0x8;_0x4474e2[_0x17cd('0x72')]=_0x17cd('0x1b1');_0x4474e2[_0x17cd('0x122')]+=0x1;_0x4474e2[_0x17cd('0xeb')]+=0x1;_0x226794=_0x1e81e3[_0x17cd('0x194')];_0x3df011=_0x1e81e3[_0x17cd('0xd8')];ami[_0x17cd('0x3f')]('custom:agentcongestion',ut['buildObj'](_0x56b91f,_0x17cd('0x1b2')));hopperUtils['createHistory'](_0x4474e2)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x1b3')));if(_0x5dc9d5[_0x17cd('0x190')](0x8,_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2['countcongestionretry']>=_0x1e81e3[_0x17cd('0x1b4')]){_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1b5'));}else{_0x5dc9d5[_0x17cd('0x126')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1b5'));}}break;case'11':_0x1e81e3[_0x17cd('0x1b6')]+=0x1;_0x4474e2[_0x17cd('0xd2')]=0xb;_0x4474e2[_0x17cd('0x72')]=_0x17cd('0xef');_0x4474e2['countabandonedretry']+=0x1;_0x4474e2['countglobal']+=0x1;_0x226794=_0x1e81e3[_0x17cd('0xed')];_0x3df011=_0x1e81e3['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x4474e2)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x1b7')));if(_0x5dc9d5[_0x17cd('0x190')](0xb,_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2[_0x17cd('0xec')]>=_0x1e81e3[_0x17cd('0x1b8')]){_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1b9'));}else{_0x5dc9d5[_0x17cd('0x126')](_0x4474e2,_0x143f40,_0x30a659,_0x17cd('0x1b9'));}}break;case'20':_0x1e81e3[_0x17cd('0x1ba')]+=0x1;_0x4474e2[_0x17cd('0xd2')]=0x14;_0x4474e2['statedesc']=_0x17cd('0x1bb');_0x4474e2[_0x17cd('0x124')]+=0x1;_0x4474e2['countglobal']+=0x1;_0x226794=_0x1e81e3[_0x17cd('0x19a')];_0x3df011=_0x1e81e3[_0x17cd('0xd8')];ami[_0x17cd('0x3f')](_0x17cd('0x1bc'),ut['buildObj'](_0x56b91f,_0x17cd('0x1bd')));hopperUtils['createHistory'](_0x4474e2)[_0x17cd('0xa1')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5dc9d5[_0x17cd('0x190')](0x14,_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2['countagentrejectretry']>=_0x1e81e3[_0x17cd('0x199')]){_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,'reason\x2020\x20agentreject');}else{_0x5dc9d5['stateGlobal'](_0x4474e2,_0x143f40,_0x30a659,'reason\x2020\x20agentreject');}}break;default:_0x1e81e3['outboundUnknownCallsDay']+=0x1;_0x4474e2[_0x17cd('0xd2')]=0xc;_0x4474e2[_0x17cd('0x72')]=_0x5666ec[_0x17cd('0xc8')];_0x226794=_0x1e81e3[_0x17cd('0x19a')];_0x3df011=_0x1e81e3[_0x17cd('0xd8')];hopperUtils['createHistory'](_0x4474e2)[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x1be')));if(_0x5dc9d5[_0x17cd('0x190')](_0x5666ec['reason'],_0x56b91f,_0x1e81e3)&&!_0x10a842){if(_0x4474e2[_0x17cd('0x121')]+_0x4474e2['countcongestionretry']+_0x4474e2[_0x17cd('0x123')]+_0x4474e2['countnosuchnumberretry']+_0x4474e2[_0x17cd('0xd7')]+_0x4474e2[_0x17cd('0xec')]+_0x4474e2[_0x17cd('0x120')]+_0x4474e2[_0x17cd('0x124')]>=_0x1e81e3[_0x17cd('0x125')]){_0x5dc9d5[_0x17cd('0x126')](_0x4474e2,_0x143f40,_0x30a659,_0x5666ec[_0x17cd('0xc8')]);}else{_0x5dc9d5[_0x17cd('0x129')](_0x4474e2,_0x143f40,_0x30a659,_0x5666ec[_0x17cd('0xc8')]);}}}})[_0x17cd('0x3c')](function(){if(_0x10a842){hopperUtils[_0x17cd('0xf0')](_0x4474e2,_0x226794,_0x3df011)[_0x17cd('0x3c')](function(){return _0x143f40(0x1);});}});});};Dialer[_0x17cd('0x18')][_0x17cd('0x126')]=function(_0x5873e1,_0x4f35ce,_0x405db2,_0x3c4d9a){var _0x59d2a7=new Final(_0x5873e1);_0x59d2a7['state']=0xf;_0x59d2a7[_0x17cd('0x72')]=_0x17cd('0x1bf');this['createStateFinal'](_0x59d2a7,_0x4f35ce,_0x405db2,_0x3c4d9a);};Dialer[_0x17cd('0x18')][_0x17cd('0x129')]=function(_0x2cca56,_0x5552b3,_0x2a8971,_0x52463c){hopperUtils['moveContactManagedDialer'](_0x2cca56)[_0x17cd('0x3c')](function(){return _0x5552b3(msgResponse(_0x17cd('0x19d'),_0x17cd('0x10e'),_0x52463c));})[_0x17cd('0xa1')](function(){return _0x2a8971(msgResponse(_0x17cd('0x1c0'),_0x17cd('0x94'),_0x17cd('0x1c1')));});};Dialer['prototype'][_0x17cd('0x8')]=function(_0xbef26b){var _0x1830d7=_0xbef26b[_0x17cd('0x1c2')]/0x64;var _0x5f09c6=_0xbef26b[_0x17cd('0x1c3')]/(_0xbef26b[_0x17cd('0x1c3')]+_0xbef26b['outboundAnswerCallsDay']);var _0x585239=Math[_0x17cd('0x1c4')](_0xbef26b['predictiveIntervalAvailable']*(_0xbef26b[_0x17cd('0x1c5')]/0x64));var _0x59990b=Math[_0x17cd('0x1c4')](_0xbef26b[_0x17cd('0x1c6')]*(_0xbef26b[_0x17cd('0x1c7')]/0x64));var _0x277438=_0xbef26b[_0x17cd('0x13b')]+_0xbef26b[_0x17cd('0x13d')];var _0xf115ad=Math[_0x17cd('0x1c8')](_0xbef26b[_0x17cd('0x5d')]*_0xbef26b['erlangAbandonmentRate']*_0xbef26b['predictiveIntervalHitRate']*_0xbef26b['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0xbef26b[_0x17cd('0x26')])){if(!_[_0x17cd('0x3e')](_0xbef26b['startPredictive'])){_0xbef26b[_0x17cd('0x25')]=undefined;loggerPredictive[_0x17cd('0x68')](_0x17cd('0x1c9'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x17cd('0x3e')](_0xbef26b[_0x17cd('0x66')])){loggerPredictive['error'](_0x17cd('0x1c9'),_0x17cd('0x1ca'));clearInterval(_0xbef26b[_0x17cd('0x66')]);_0xbef26b[_0x17cd('0x66')]=undefined;}_0xbef26b[_0x17cd('0x26')]=moment()[_0x17cd('0x45')](_0x17cd('0xc5'));loggerPredictive[_0x17cd('0x49')](_0xbef26b[_0x17cd('0x47')],_0x17cd('0x1cb'),_0xbef26b[_0x17cd('0x26')]);this[_0x17cd('0xb3')](_0xbef26b,0x1);}else if(ifInterval(_0xbef26b[_0x17cd('0x1cc')],_0xbef26b[_0x17cd('0x26')])){this[_0x17cd('0xb3')](_0xbef26b,0x1);loggerPredictiveCalls['info'](_0x17cd('0x1cd'),_0xbef26b[_0x17cd('0x26')],_0xbef26b[_0x17cd('0x47')]);_0xbef26b['erlangCalls']=0x0;_0xbef26b[_0x17cd('0xd1')]=0x0;}else if(_0x1830d7<_0x5f09c6&&_0xbef26b[_0x17cd('0x1ce')]===_0x17cd('0x1cf')){clearPredictiveAttributes(_0xbef26b);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x1d0'),_0x17cd('0x1d1'),_0x5f09c6,_0x17cd('0x26'),_0xbef26b[_0x17cd('0x47')]);}else if(_0xf115ad<_0xbef26b[_0x17cd('0xd1')]&&_0xbef26b[_0x17cd('0x1ce')]===_0x17cd('0x1cf')){clearPredictiveAttributes(_0xbef26b);loggerPredictive['info'](_0x17cd('0x1d2'),_0x17cd('0x1d3'),_0xf115ad,_0x17cd('0x1d4'),_0xbef26b[_0x17cd('0xd1')],_0x17cd('0x26'),_0xbef26b['name']);}else if(!ifInterval(_0xbef26b[_0x17cd('0x1cc')],_0xbef26b['startProgressive'])&&_[_0x17cd('0x3e')](_0xbef26b[_0x17cd('0x25')])&&!_[_0x17cd('0x3e')](_0xbef26b[_0x17cd('0x26')])){_0xbef26b[_0x17cd('0x25')]=moment()[_0x17cd('0x45')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x17cd('0x49')](_0xbef26b[_0x17cd('0x47')],'started\x20in\x20predictive\x20at',_0xbef26b['startPredictive']);hopperUtils['avgHandleTime'](_0xbef26b[_0x17cd('0x1cc')])[_0x17cd('0x3c')](this[_0x17cd('0x1d5')](_0xbef26b))[_0x17cd('0x3c')](mergeDataErlangB(_0xbef26b))[_0x17cd('0x3c')](this[_0x17cd('0x1d6')](_0xbef26b))[_0x17cd('0xa1')](loggerCatchPredictive(_0x17cd('0x1d7'),_0xbef26b));}else if(!ifInterval(_0xbef26b['dialPredictiveInterval'],_0xbef26b['startPredictive'])){_0xbef26b[_0x17cd('0xd1')]=0x0;_0xbef26b[_0x17cd('0x25')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x17cd('0x49')](_0xbef26b[_0x17cd('0x47')],_0x17cd('0x1d8'),_0xbef26b['startPredictive']);clearInterval(_0xbef26b['handlePredictive']);_0xbef26b['handlePredictive']=undefined;hopperUtils[_0x17cd('0x1d9')](_0xbef26b[_0x17cd('0x1cc')])['then'](this[_0x17cd('0x1d5')](_0xbef26b))[_0x17cd('0x3c')](mergeDataErlangB(_0xbef26b))[_0x17cd('0x3c')](this[_0x17cd('0x1d6')](_0xbef26b))['catch'](loggerCatchPredictive(_0x17cd('0x1da'),_0xbef26b));}else if(_0xbef26b['predictiveIntervalAvailable']&&_0x277438<_0xbef26b['predictiveIntervalAvailable']-_0x59990b){clearPredictiveAttributes(_0xbef26b);loggerPredictive[_0x17cd('0x49')](_0xbef26b['name'],_0x17cd('0x1db'),_0x277438,_0x17cd('0x1dc'),_0xbef26b[_0x17cd('0x1c6')],'-',_0x59990b,'=',_0xbef26b[_0x17cd('0x1c6')]-_0x59990b,')');}else if(_0xbef26b['predictiveIntervalAvailable']&&_0x277438>_0xbef26b[_0x17cd('0x1c6')]+_0x585239){clearPredictiveAttributes(_0xbef26b);loggerPredictive[_0x17cd('0x49')](_0xbef26b[_0x17cd('0x47')],_0x17cd('0x1db'),_0x277438,_0x17cd('0x1dd'),_0xbef26b['predictiveIntervalAvailable'],'+',_0x585239,'=',_0xbef26b[_0x17cd('0x1c6')]+_0x585239,')');}};Dialer[_0x17cd('0x18')]['getDataPredictive']=function(_0x16e6e4){var _0x45fb50=this;return function(_0x438911){return new Promise(function(_0x6be8f4,_0x36a2e0){_[_0x17cd('0x63')](_0x16e6e4,_0x438911[0x0]);if(checkGetDataPredictive(_0x438911[0x0])){var _0x2952db=_0x16e6e4[_0x17cd('0x1c6')]=_0x16e6e4[_0x17cd('0x13d')]+_0x16e6e4[_0x17cd('0x13b')];var _0x1b9ede=_0x16e6e4['dialPredictiveInterval']*0x3c;var _0x472bcd=_0x438911[0x0][_0x17cd('0x55')]+_0x438911[0x0][_0x17cd('0x53')];var _0xaaa059=(_0x438911[0x0][_0x17cd('0x4d')]+_0x438911[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x438911[0x0][_0x17cd('0x51')])/_0x438911[0x0][_0x17cd('0x57')];_0x16e6e4['predictiveIntervalHitRate']=_0xaaa059>0x0?_0xaaa059:0x1;switch(_0x16e6e4['dialPredictiveOptimization']){case _0x17cd('0x1cf'):var _0x38e4c7=_0x16e6e4[_0x17cd('0x1c2')]/0x64;return _0x45fb50[_0x17cd('0x1de')](_0x2952db,_0x1b9ede,_0x472bcd,_0xaaa059,_0x38e4c7)['then'](function(_0x370c10){return _0x6be8f4(_0x370c10);});case _0x17cd('0x1df'):var _0x540798=_0x16e6e4[_0x17cd('0x1c2')]/0x64;return _0x45fb50['busyFactor'](_0x2952db,_0x1b9ede,_0x472bcd,_0xaaa059,_0x540798)[_0x17cd('0x3c')](function(_0x11a80b){return _0x6be8f4(_0x11a80b);});default:return _0x36a2e0(msgResponse(_0x17cd('0x1e0'),'Failure',_0x17cd('0x1e1')));}}else{return _0x36a2e0(msgResponse(_0x17cd('0x1e0'),_0x17cd('0x94'),'check\x20failure'));}});};};Dialer[_0x17cd('0x18')][_0x17cd('0x1e2')]=function(_0x3b64fe){var _0x7416b1=this;return function(_0xe059d8){return new Promise(function(_0x143379,_0xf5cf5f){_[_0x17cd('0x63')](_0x3b64fe,_0xe059d8[0x0]);if(checkGetDataPredictive(_0xe059d8[0x0])){loggerPredictive['info'](JSON[_0x17cd('0x78')](_0xe059d8[0x0]));if(_0x3b64fe[_0x17cd('0x1ce')]==='dropRate'){return _0x7416b1[_0x17cd('0x152')](_0x3b64fe['id'])[_0x17cd('0x3c')](function(_0x3d6c4d){var _0x5714b6=_0x3b64fe[_0x17cd('0x1e3')]-_0x3d6c4d[0x0]['outboundQueuePauses'];var _0x5b767e=_0x3b64fe['dialPredictiveInterval']*0x3c;var _0x5ac30e=_0xe059d8[0x0]['predictiveIntervalAvgTalktime']+_0xe059d8[0x0][_0x17cd('0x53')];var _0x198bb4=(_0xe059d8[0x0][_0x17cd('0x4d')]+_0xe059d8[0x0][_0x17cd('0x4f')]+_0xe059d8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xe059d8[0x0][_0x17cd('0x57')];var _0x5edaa8=_0x3b64fe[_0x17cd('0x1c2')]/0x64;_0x3b64fe[_0x17cd('0x1e4')]=_0x3d6c4d[0x0][_0x17cd('0x1e5')]||0x0;_0x3b64fe[_0x17cd('0x1e6')]=_0x198bb4>0x0?_0x198bb4:0x1;return _0x7416b1[_0x17cd('0x1de')](_0x5714b6,_0x5b767e,_0x5ac30e,_0x198bb4,_0x5edaa8);})['then'](function(_0x25d77f){return _0x143379(_0x25d77f);})[_0x17cd('0xa1')](function(_0x4b66a2){return _0xf5cf5f(msgResponse(_0x17cd('0x1e7'),_0x17cd('0x94'),JSON[_0x17cd('0x78')](_0x4b66a2)));});}if(_0x3b64fe[_0x17cd('0x1ce')]===_0x17cd('0x1df')){return _0x7416b1[_0x17cd('0x152')](_0x3b64fe['id'])[_0x17cd('0x3c')](function(_0x4353d5){var _0x59f5c0=_0x3b64fe[_0x17cd('0x1e3')]-_0x4353d5[0x0]['outboundQueuePauses'];var _0x28090d=_0x3b64fe[_0x17cd('0x1cc')]*0x3c;var _0x2dd68f=_0xe059d8[0x0][_0x17cd('0x55')]+_0xe059d8[0x0][_0x17cd('0x53')];var _0x260678=(_0xe059d8[0x0][_0x17cd('0x4d')]+_0xe059d8[0x0][_0x17cd('0x4f')]+_0xe059d8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xe059d8[0x0][_0x17cd('0x57')];var _0x39e1cb=_0x3b64fe[_0x17cd('0x1c2')]/0x64;_0x3b64fe[_0x17cd('0x1e4')]=_0x4353d5[0x0][_0x17cd('0x1e5')]||0x0;_0x3b64fe[_0x17cd('0x1e6')]=_0x260678>0x0?_0x260678:0x1;return _0x7416b1[_0x17cd('0x1e8')](_0x59f5c0,_0x28090d,_0x2dd68f,_0x260678,_0x39e1cb);})[_0x17cd('0x3c')](function(_0x3f424e){return _0x143379(_0x3f424e);})[_0x17cd('0xa1')](function(_0x269aab){return _0xf5cf5f(msgResponse('[CatchErlangB]',_0x17cd('0x94'),JSON[_0x17cd('0x78')](_0x269aab)));});}}else{return _0xf5cf5f(msgResponse(_0x17cd('0x1e0'),_0x17cd('0x94'),_0x17cd('0x1e9')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x32e469){var _0x173226=this;return function(){var _0x18d4b3=0x0;var _0x78f0dd=Math[_0x17cd('0x1c8')](_0x32e469[_0x17cd('0x5f')]*0x3e8);if(_0x78f0dd>0x0){_0x78f0dd=_0x78f0dd<0x64?0x64:_0x78f0dd;loggerPredictive[_0x17cd('0x49')](_0x32e469[_0x17cd('0x47')],_0x17cd('0x1ea'),_0x78f0dd,_0x17cd('0x1eb'));_0x32e469['handlePredictive']=setInterval(function(){_0x173226[_0x17cd('0x66')](_0x32e469);loggerPredictiveCalls[_0x17cd('0x49')](_0x17cd('0x1ec'),_0x18d4b3+=0x1);},_0x78f0dd);}else{loggerPredictive[_0x17cd('0x49')](_0x32e469['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x17cd('0x1ed')]=function(_0x25544f,_0xe5547a){var _0x2e8988=this;return function(_0x11cf46){if(_[_0x17cd('0x7e')](_0x11cf46)){if(_['isNil'](_0xe5547a['UserId'])||!_0xe5547a[_0x17cd('0x1ee')]){if(_0x25544f[_0x17cd('0xb1')]===_0x17cd('0x7')){_0x25544f[_0x17cd('0x75')]=_['isUndefined'](_0x25544f['queueStatusComplete'])?!![]:_0x25544f[_0x17cd('0x75')];var _0x22012d=uuid['v4']();_0x2e8988[_0x17cd('0xf1')][_0x22012d]=new Action(_0x25544f,_0xe5547a,_0x22012d);loggerBooked[_0x17cd('0x49')](_0x17cd('0x1ef'),_0x22012d,_0x17cd('0x1f0'),JSON['stringify'](_0x25544f[_0x17cd('0x75')]),_0x17cd('0x1f1'),_0x25544f['name']);if(_0x25544f[_0x17cd('0x75')]){_0x25544f[_0x17cd('0x75')]=![];_0x2e8988[_0x17cd('0x27')][_0x2e8988[_0x17cd('0xf1')][_0x22012d]['queue']]=[];ami[_0x17cd('0xa2')]({'actionid':_0x22012d,'action':'queuestatus','queue':_0x25544f['name']})[_0x17cd('0xa1')](function(){_0x2e8988[_0x17cd('0xc3')](_0x25544f);hopperUtils[_0x17cd('0xde')]({'active':![],'ContactId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xe2')],'ListId':_0x2e8988['actions'][_0x22012d][_0x17cd('0xe3')],'VoiceQueueId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xe4')]||undefined,'CampaignId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xee')]||undefined})['catch'](loggerCatch(_0x17cd('0x1f2')));delete _0x2e8988[_0x17cd('0xf1')][_0x22012d];});}else{loggerBooked[_0x17cd('0x49')](_0x17cd('0x1f3'),JSON[_0x17cd('0x78')](_0x25544f['queueStatusComplete']),_0x17cd('0x1f1'),_0x25544f[_0x17cd('0x47')]);_0x2e8988[_0x17cd('0xc3')](_0x25544f);hopperUtils[_0x17cd('0xde')]({'active':![],'ContactId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xe2')],'ListId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xe3')],'VoiceQueueId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xe4')]||undefined,'CampaignId':_0x2e8988[_0x17cd('0xf1')][_0x22012d][_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2e8988[_0x17cd('0xf1')][_0x22012d];}}else{return _0x2e8988[_0x17cd('0x1f4')](_0x25544f,_0xe5547a);}}else{if(utils[_0x17cd('0x64')](undefined,_0xe5547a[_0x17cd('0x1f5')])<_0x25544f[_0x17cd('0x1f6')]*0x3c){if(_0xe5547a['Agent']&&!_0xe5547a[_0x17cd('0x149')][_0x17cd('0x1f7')]){_0x2e8988['preview'][_0x17cd('0xfd')](_0xe5547a['id'])[_0x17cd('0x1a')](function(){_0x2e8988[_0x17cd('0xc3')](_0x25544f);});}else{hopperUtils[_0x17cd('0x1f8')]({'active':![]},_0xe5547a['id'],0x1)['finally'](function(){_0x2e8988['updateOriginated'](_0x25544f);});}}else{_0x25544f[_0x17cd('0x1f9')]+=0x1;_0x2e8988[_0x17cd('0xc3')](_0x25544f);if(_0x25544f[_0x17cd('0x1fa')]){hopperUtils[_0x17cd('0xde')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe5547a['ContactId'],'ListId':_0xe5547a[_0x17cd('0xe3')],'VoiceQueueId':_0xe5547a[_0x17cd('0xe4')]||undefined,'CampaignId':_0xe5547a[_0x17cd('0xee')]||undefined})[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x1fb')));hopperUtils['createHistory'](createObjHistory(_0x25544f,_0xe5547a,utils[_0x17cd('0x6d')]['QUEUE_RECALL'],0x17,_0x17cd('0x1fc')))[_0x17cd('0xa1')](loggerCatch(_0x17cd('0x1fd')));}else{_0x2e8988[_0x17cd('0x11b')](createObjHistory(_0x25544f,_0xe5547a,utils[_0x17cd('0x6d')][_0x17cd('0x1fe')],0x16,'RecallFailedTimeout'),_0x17cd('0x1ff'),'[Originate][HistoryRecallClose]');}}}}else{_0x25544f[_0x17cd('0x200')]+=0x1;_0x2e8988[_0x17cd('0x11b')](createObjHistory(_0x25544f,_0xe5547a,utils['CAMPAIGN_STATUS'][_0x17cd('0x201')],0xd,_0x17cd('0x202')),_0x17cd('0x203'),'[Originate][MoveBlacklist]');throw _0x17cd('0x204');}};};Dialer[_0x17cd('0x18')][_0x17cd('0x15b')]=function(_0x3b56f5){var _0x5051e2=this;var _0x5079e0=_0x3b56f5['limitCalls']-_0x3b56f5[_0x17cd('0x86')];emitCampaignSummary(_0x3b56f5);if(_0x5079e0>0x0&&_0x3b56f5[_0x17cd('0x6b')]==0x0){if(_0x5079e0>this['maxNumberOriginate']){_0x5079e0=this[_0x17cd('0x21')];}_0x3b56f5[_0x17cd('0x6b')]=0x1;hopperUtils[_0x17cd('0x205')](_0x3b56f5,_0x5079e0)[_0x17cd('0x3c')](function(_0x21ec5e){_0x3b56f5[_0x17cd('0x6b')]=0x0;if(_0x21ec5e){if(!utils[_0x17cd('0x206')](_0x21ec5e)){_0x3b56f5[_0x17cd('0x6c')]=utils['CAMPAIGN_STATUS'][_0x17cd('0x207')];logger[_0x17cd('0x49')](_0x17cd('0x208')+_0x3b56f5[_0x17cd('0x47')]);}else{_0x3b56f5[_0x17cd('0x86')]+=_0x21ec5e[_0x17cd('0x101')];_0x3b56f5[_0x17cd('0x6c')]=utils['CAMPAIGN_STATUS'][_0x17cd('0x209')];for(var _0x27170e=0x0;_0x27170e<_0x21ec5e[_0x17cd('0x101')];_0x27170e+=0x1){_0x3b56f5[_0x17cd('0x20a')]+=0x1;if(_['isNil'](_0x21ec5e[_0x27170e])||_[_0x17cd('0xf8')](_0x21ec5e[_0x27170e][_0x17cd('0x179')])||_[_0x17cd('0xf8')](_0x21ec5e[_0x27170e][_0x17cd('0x15f')])){_0x5051e2[_0x17cd('0x20b')]('[actionOriginate]\x20',_0x3b56f5,_0x21ec5e[_0x27170e]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x17cd('0x79')](_0x21ec5e[_0x27170e],[_0x17cd('0xee'),'phone']))[_0x17cd('0x3c')](_0x5051e2[_0x17cd('0x1ed')](_0x3b56f5,_0x21ec5e[_0x27170e]))['catch'](_0x5051e2[_0x17cd('0x155')](_0x17cd('0x20c'),_0x3b56f5));}}}}})['catch'](loggerGetContactDialer(_0x17cd('0x20d'),_0x3b56f5,_0x5079e0));}};Dialer[_0x17cd('0x18')]['handlePower']=function(_0x42b6fd,_0x27c475){var _0x4182d8=this;var _0x1fc86a=[];if(_0x27c475<0x1||_0x42b6fd[_0x17cd('0xb1')]===_0x17cd('0x7')){_0x27c475=0x1;}var _0x33fd3a=Math[_0x17cd('0x1c8')](_0x42b6fd[_0x17cd('0x13b')]*_0x27c475)-_0x42b6fd[_0x17cd('0x86')];if(_0x42b6fd['dialLimitQueue']>0x0){var _0x1a9d73=_0x42b6fd['dialLimitQueue']-_0x42b6fd[_0x17cd('0x86')]-_0x42b6fd[_0x17cd('0x13d')]-_0x42b6fd[_0x17cd('0x13e')];if(_0x33fd3a>_0x1a9d73){_0x33fd3a=_0x1a9d73;}}if(_0x33fd3a>0x0&&_0x42b6fd['temp']==0x0){if(_0x42b6fd[_0x17cd('0xb1')]==='booked'){_0x33fd3a=0x1;}if(_0x33fd3a>this[_0x17cd('0x21')]){_0x33fd3a=this[_0x17cd('0x21')];}for(var _0x12a533 in this[_0x17cd('0x1f')]){if(typeof this[_0x17cd('0x1f')][_0x12a533]!==_0x17cd('0xac')){if(this[_0x17cd('0x1f')][_0x12a533]['state']===_0x17cd('0x20e')&&this[_0x17cd('0x1f')][_0x12a533][_0x17cd('0x8e')]===_0x17cd('0x8d')){_0x1fc86a[_0x17cd('0x9c')](this[_0x17cd('0x1f')][_0x12a533]['id']);}}}_0x42b6fd[_0x17cd('0x6b')]=0x1;hopperUtils[_0x17cd('0x20f')](_0x42b6fd,_0x1fc86a,_0x33fd3a)[_0x17cd('0x3c')](function(_0x2aef27){_0x42b6fd['temp']=0x0;if(_0x2aef27){if(!utils[_0x17cd('0x206')](_0x2aef27)){hopperUtils['countReScheduled'](_0x42b6fd)[_0x17cd('0x3c')](sendMessageReschedule(_0x42b6fd))[_0x17cd('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x42b6fd[_0x17cd('0x86')]+=_0x2aef27[_0x17cd('0x101')];_0x42b6fd[_0x17cd('0x6c')]=_0x42b6fd[_0x17cd('0xb1')]===_0x17cd('0x7')?utils[_0x17cd('0x6d')][_0x17cd('0x13f')]:utils[_0x17cd('0x6d')][_0x17cd('0x209')];for(var _0x443cd9=0x0;_0x443cd9<_0x2aef27[_0x17cd('0x101')];_0x443cd9+=0x1){if(_[_0x17cd('0xf8')](_0x2aef27[_0x443cd9])||_['isNil'](_0x2aef27[_0x443cd9]['Contact'])||_['isNil'](_0x2aef27[_0x443cd9][_0x17cd('0x15f')])){_0x4182d8[_0x17cd('0x20b')]('[actionOriginate]\x20',_0x42b6fd,_0x2aef27[_0x443cd9]);}else{hopperUtils[_0x17cd('0x210')](_[_0x17cd('0x79')](_0x2aef27[_0x443cd9],[_0x17cd('0xe4'),_0x17cd('0x15f')]))['then'](_0x4182d8[_0x17cd('0x1ed')](_0x42b6fd,_0x2aef27[_0x443cd9]))[_0x17cd('0xa1')](_0x4182d8['loggerHandler'](_0x17cd('0x211'),_0x42b6fd));}}}}})['catch'](loggerGetContactDialer(_0x17cd('0x212'),_0x42b6fd,_0x33fd3a));}};Dialer['prototype'][_0x17cd('0x66')]=function(_0x10d89a){if(_0x10d89a[_0x17cd('0x213')]>0x0){var _0x69abd=_0x10d89a['dialLimitQueue']-_0x10d89a[_0x17cd('0x86')]-_0x10d89a[_0x17cd('0x13d')];if(_0x69abd>0x0&&_0x10d89a['temp']==0x0){this[_0x17cd('0x214')](_0x10d89a);}else{loggerPredictiveCalls[_0x17cd('0x49')](_0x17cd('0x215'));}}else{this['tryOriginatePredictive'](_0x10d89a);}};Dialer[_0x17cd('0x18')][_0x17cd('0x214')]=function(_0x2c5b6a){var _0xe62900=this;var _0x142abb=[];_0x2c5b6a['originated']+=0x1;for(var _0x1ab91a in this[_0x17cd('0x1f')]){if(typeof this['agents'][_0x1ab91a]!==_0x17cd('0xac')){if(this[_0x17cd('0x1f')][_0x1ab91a]['state']===_0x17cd('0x20e')&&this[_0x17cd('0x1f')][_0x1ab91a][_0x17cd('0x8e')]===_0x17cd('0x8d')){_0x142abb[_0x17cd('0x9c')](this[_0x17cd('0x1f')][_0x1ab91a]['id']);}}}_0x2c5b6a['temp']=0x1;return this[_0x17cd('0x20f')](_0x2c5b6a['id'],_0x142abb,0x1,_0x2c5b6a[_0x17cd('0x216')],_0x2c5b6a)[_0x17cd('0x3c')](function(_0x3fe487){_0x2c5b6a[_0x17cd('0x6b')]=0x1;if(_0x3fe487){if(!utils[_0x17cd('0x206')](_0x3fe487)){utils[_0x17cd('0x6a')](_0x2c5b6a,0x1,0x0);return hopperUtils[_0x17cd('0x217')](_0x2c5b6a)[_0x17cd('0x3c')](sendMessageReschedule(_0x2c5b6a))[_0x17cd('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x2c5b6a['message']=utils[_0x17cd('0x6d')][_0x17cd('0x209')];if(_['isNil'](_0x3fe487[0x0])||_['isNil'](_0x3fe487[0x0]['Contact'])||_[_0x17cd('0xf8')](_0x3fe487[0x0][_0x17cd('0x15f')])){_0xe62900['emptyContact']('[actionOriginate]\x20',_0x2c5b6a,_0x3fe487[0x0]);}else{return hopperUtils[_0x17cd('0x210')](_[_0x17cd('0x79')](_0x3fe487[0x0],[_0x17cd('0xe4'),'phone']))['then'](_0xe62900['checkContactBlack'](_0x2c5b6a,_0x3fe487[0x0]))[_0x17cd('0xa1')](_0xe62900['loggerHandler'](_0x17cd('0x218'),_0x2c5b6a));}}}})[_0x17cd('0xa1')](loggerGetContactDialer(_0x17cd('0x219'),_0x2c5b6a,0x1));};Dialer[_0x17cd('0x18')][_0x17cd('0x1de')]=function(_0x5124df,_0x58c0fc,_0x528d95,_0x1c799e,_0x1887e5,_0x22e03a){loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21a'));loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21b'),_0x5124df);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21c'),_0x58c0fc);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21d'),_0x528d95);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21e'),_0x1c799e);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21f'),_0x1887e5);loggerPredictive['info'](_0x17cd('0x56'));return new Promise(function(_0xe2ea0e,_0x56cae3){if(_0x5124df<=0x0||isNaN(_0x5124df)){return _0x56cae3(msgResponse(_0x17cd('0x220'),_0x17cd('0x8a'),_0x17cd('0x221')+_0x5124df));}if(_0x528d95<=0x0||isNaN(_0x528d95)){return _0x56cae3(msgResponse('[abandonmentRate]',_0x17cd('0x8a'),_0x17cd('0x222')+_0x528d95));}if(_0x1c799e<=0x0||isNaN(_0x1c799e)){return _0x56cae3(msgResponse(_0x17cd('0x220'),_0x17cd('0x8a'),_0x17cd('0x223')+_0x1c799e));}if(_0x58c0fc<=0x0||isNaN(_0x58c0fc)){return _0x56cae3(msgResponse(_0x17cd('0x220'),'Error',_0x17cd('0x224')+_0x58c0fc));}if(_0x1887e5<=0x0||isNaN(_0x1887e5)){return _0x56cae3(msgResponse(_0x17cd('0x220'),_0x17cd('0x8a'),'Amax\x20=\x20'+_0x1887e5));}_0x22e03a=_0x22e03a||0x0;var _0x763041=0x1/_0x528d95;var _0x4c49d3=0x0;var _0x594c7b=0x0;var _0x343dd9=0x0;var _0x18e4b0=0x0;for(var _0x95f73f=0x0;_0x343dd9<_0x1887e5;_0x95f73f+=0x1){_0x594c7b=_0x95f73f/_0x58c0fc;_0x4c49d3=(_0x1c799e*_0x594c7b+_0x22e03a)/_0x763041;_0x343dd9=utils['erlangb'](_0x4c49d3,_0x5124df);_0x18e4b0=_0x4c49d3/_0x5124df*(0x1-utils['erlangb'](_0x4c49d3,_0x5124df));}return _0xe2ea0e({'erlangCalls':_0x95f73f,'erlangCallToSecond':_0x58c0fc/_0x95f73f,'erlangAbandonmentRate':_0x343dd9,'erlangBusyFactor':_0x18e4b0});});};Dialer[_0x17cd('0x18')][_0x17cd('0x1e8')]=function(_0x427071,_0x3f14b0,_0x50ad02,_0x357d98,_0x490395,_0x1578aa){loggerPredictive[_0x17cd('0x49')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21b'),_0x427071);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21c'),_0x3f14b0);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21d'),_0x50ad02);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x21e'),_0x357d98);loggerPredictive[_0x17cd('0x49')](_0x17cd('0x225'),_0x490395);loggerPredictive[_0x17cd('0x49')]('---------------------------');return new Promise(function(_0x506b34,_0x327b26){if(_0x427071<=0x0||isNaN(_0x427071)){return _0x327b26(msgResponse(_0x17cd('0x226'),_0x17cd('0x8a'),_0x17cd('0x221')+_0x427071));}if(_0x50ad02<=0x0||isNaN(_0x50ad02)){return _0x327b26(msgResponse('[busyFactor]',_0x17cd('0x8a'),_0x17cd('0x222')+_0x50ad02));}if(_0x357d98<=0x0||isNaN(_0x357d98)){return _0x327b26(msgResponse(_0x17cd('0x226'),_0x17cd('0x8a'),'p\x20=\x20'+_0x357d98));}if(_0x3f14b0<=0x0||isNaN(_0x3f14b0)){return _0x327b26(msgResponse(_0x17cd('0x226'),'Error',_0x17cd('0x224')+_0x3f14b0));}if(_0x490395<=0x0||isNaN(_0x490395)){return _0x327b26(msgResponse('[busyFactor]',_0x17cd('0x8a'),'Umin\x20=\x20'+_0x490395));}_0x1578aa=_0x1578aa||0x0;var _0x435225=0x1/_0x50ad02;var _0x453cf7=0x0;var _0x2af270=0x0;var _0x3cb90e=0x0;var _0xba6d7b=0x0;for(var _0x20b170=0x0;_0xba6d7b<_0x490395;_0x20b170+=0x1){_0x2af270=_0x20b170/_0x3f14b0;_0x453cf7=(_0x357d98*_0x2af270+_0x1578aa)/_0x435225;_0x3cb90e=utils[_0x17cd('0x227')](_0x453cf7,_0x427071);_0xba6d7b=_0x453cf7/_0x427071*(0x1-utils[_0x17cd('0x227')](_0x453cf7,_0x427071));}return _0x506b34({'erlangCalls':_0x20b170,'erlangCallToSecond':_0x3f14b0/_0x20b170,'erlangAbandonmentRate':_0x3cb90e,'erlangBusyFactor':_0xba6d7b});});};module[_0x17cd('0x228')]=Dialer; \ No newline at end of file +var _0x38ef=['dialAgentRejectMaxRetry','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangAbandonmentRate','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','busyFactor','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','[actionOriginate]\x20','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','[handlePredictive][limitChannel]','tryOriginatePredictive','getContactDialer','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\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','interval\x20=\x20','erlangb','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','lodash','moment','ioredis','./utils','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','localhost','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','isTrunkReachable','SIP/%s','status','reachable','unmonitored','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','isArray','length','push','Action','iftime\x20%s,%s','interval','content','indexOf','true','catch','command','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','power','dialPowerLevel','handlePower','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','Error','queue','uniqueid','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialQueueProject2','countdropretry','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','CampaignId','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','Abandoned','countabandonedretry','countglobal','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','rescheduleContact','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','syncNewExten','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','syncQueueStatusComplete','strategy','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','callProgressDetecting','variable','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','membername','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','HangupInAMD','AMD','saveInDb','[syncHangupInAMDIvr]','countnoanswerretry','stateGlobal','dialMachineMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','moveContactManagedDialer','outboundUnknownCallsDay','cause-txt','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','[uniqueid]','[actions]','sequence','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialGlobalMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]'];(function(_0x629f7,_0x3ed53b){var _0x4e4fdc=function(_0x39f614){while(--_0x39f614){_0x629f7['push'](_0x629f7['shift']());}};_0x4e4fdc(++_0x3ed53b);}(_0x38ef,0x80));var _0xf38e=function(_0x4ee8eb,_0x50c675){_0x4ee8eb=_0x4ee8eb-0x0;var _0xc026f5=_0x38ef[_0x4ee8eb];return _0xc026f5;};'use strict';var util=require('util');var _=require(_0xf38e('0x0'));var uuid=require('uuid');var moment=require(_0xf38e('0x1'));var rr=require('rr');var Redis=require(_0xf38e('0x2'));var utils=require(_0xf38e('0x3'));var hopperUtils=require('./utils/hopper');var ut=require('../preview/util/util');var config=require(_0xf38e('0x4'));var logger=require(_0xf38e('0x5'))(_0xf38e('0x6'));var loggerBooked=require('../../../config/logger')(_0xf38e('0x7'));var loggerPredictive=require(_0xf38e('0x5'))(_0xf38e('0x8'));var loggerPredictiveCalls=require(_0xf38e('0x5'))(_0xf38e('0x9'));var loggerSyncQueueSummary=require(_0xf38e('0x5'))(_0xf38e('0xa'));var ami=require('../ami');config[_0xf38e('0xb')]=_['defaults'](config[_0xf38e('0xb')],{'host':_0xf38e('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf38e('0xb')]));var cmHopper=require(_0xf38e('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xf38e('0xe'));var Interval=require(_0xf38e('0xf'));var Action=require(_0xf38e('0x10'));var History=require('./models/history');var Final=require(_0xf38e('0x11'));var AgentComplete=require(_0xf38e('0x12'));var QueueCallerAbandon=require(_0xf38e('0x13'));var Hangup=require(_0xf38e('0x14'));var ipAgi=process[_0xf38e('0x15')][_0xf38e('0x16')]||_0xf38e('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xf38e('0x18')][_0xf38e('0x19')]=function(_0x575f5d){this['tail']=this[_0xf38e('0x1a')]?this[_0xf38e('0x1a')]['finally'](_0x575f5d):_0x575f5d();};function Dialer(_0x39eb49,_0x2b505f){this['sequence']=new Sequence();this[_0xf38e('0x1b')]=_0x2b505f;this['voiceQueues']=_0x39eb49[_0xf38e('0x1c')];this['campaigns']=_0x39eb49[_0xf38e('0x1d')];this['agents']=_0x39eb49[_0xf38e('0x1e')];this[_0xf38e('0x1f')]=_0x39eb49[_0xf38e('0x1f')];this[_0xf38e('0x20')]=config[_0xf38e('0x20')]||0x2;this[_0xf38e('0x21')]={};this[_0xf38e('0x22')]={};this[_0xf38e('0x23')]={};this[_0xf38e('0x24')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xf38e('0x25')]={};this[_0xf38e('0x26')]={};this[_0xf38e('0x27')]={};this[_0xf38e('0x28')]={};this[_0xf38e('0x29')]={};ami['on'](_0xf38e('0x2a'),this[_0xf38e('0x2b')][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x2d'),this[_0xf38e('0x2e')][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x2f'),this['syncOriginateResponse'][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x30'),this[_0xf38e('0x31')]['bind'](this));ami['on'](_0xf38e('0x32'),this[_0xf38e('0xa')][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x33'),this[_0xf38e('0x34')][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x35'),this[_0xf38e('0x36')][_0xf38e('0x2c')](this));ami['on']('newexten',this['syncNewExten'][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x37'),this[_0xf38e('0x38')][_0xf38e('0x2c')](this));ami['on'](_0xf38e('0x39'),this[_0xf38e('0x3a')]['bind'](this));ami['on'](_0xf38e('0x3b'),this['syncQueueStatusComplete'][_0xf38e('0x2c')](this));this[_0xf38e('0x3c')]();this['loopClearZombieChannels']();RpcSetting[_0xf38e('0x3d')]()[_0xf38e('0x3e')](function(_0x335322){previewRecallmeReminderInterval=_0x335322[_0xf38e('0x3f')];});}function isNotNull(_0x4e809e){return _0x4e809e!==null&&!_['isUndefined'](_0x4e809e);}function msgResponse(_0x1fefac,_0x122b5f,_0x50fe81){return{'action':_0x1fefac,'response':_0x122b5f,'message':_0x50fe81,'stack':_0x50fe81};}function emit(_0x1a3f30,_0x3ce7ff,_0x411cfc){io['to'](_0x1a3f30)[_0xf38e('0x40')](_0x3ce7ff,_0x411cfc);}function emitOutboundVoiceQueueSummary(_0x479fe8){if(_0x479fe8[_0xf38e('0x41')]===_0xf38e('0x42')){logger[_0xf38e('0x43')](_0xf38e('0x44'),util[_0xf38e('0x45')](_0x479fe8,{'showHidden':![],'depth':null}));emit(util[_0xf38e('0x46')](_0xf38e('0x47'),_0x479fe8[_0xf38e('0x48')]),_0xf38e('0x49'),_0x479fe8);}}function checkGetDataPredictive(_0x407d22){if(isNotNull(_0x407d22)&&!_[_0xf38e('0x4a')](_0x407d22)){loggerPredictive[_0xf38e('0x4b')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x4c'),_0x407d22[_0xf38e('0x4d')]);loggerPredictive[_0xf38e('0x4b')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x407d22[_0xf38e('0x4e')]);loggerPredictive[_0xf38e('0x4b')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x407d22[_0xf38e('0x4f')]);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x50'),_0x407d22[_0xf38e('0x51')]);loggerPredictive[_0xf38e('0x4b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x407d22[_0xf38e('0x52')]);loggerPredictive['info'](_0xf38e('0x53'),_0x407d22[_0xf38e('0x54')]);loggerPredictive[_0xf38e('0x4b')]('---------------------------');if(_0x407d22[_0xf38e('0x4d')]>0x0){if(!_['isUndefined'](_0x407d22['predictiveIntervalAvgTalktime'])&&_0x407d22[_0xf38e('0x54')]>0x0){return!![];}loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x55'));if(!_[_0xf38e('0x56')](_0x407d22[_0xf38e('0x52')])&&_0x407d22[_0xf38e('0x52')]>0x0){return!![];}loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x57'));}else{loggerPredictive['info'](_0xf38e('0x58'));}}else{loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x59'));}return![];}function mergeDataErlangB(_0x5c29b5){return function(_0x4ad012){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x5a'),_0x4ad012[_0xf38e('0x5b')]);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x5c'),_0x4ad012[_0xf38e('0x5d')]);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x5e'),_0x4ad012['erlangAbandonmentRate']);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x5f'),_0x4ad012[_0xf38e('0x60')]);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x5e'),_0x4ad012['erlangAbandonmentRate']);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x61'));_[_0xf38e('0x62')](_0x5c29b5,_0x4ad012);};}function ifInterval(_0x438ab9,_0x3550b2){if(_[_0xf38e('0x56')](_0x3550b2)){return![];}return utils[_0xf38e('0x63')](undefined,_0x3550b2)<_0x438ab9*0x3c;}function clearPredictiveAttributes(_0x43bc76){if(_0x43bc76[_0xf38e('0x25')]){_0x43bc76[_0xf38e('0x25')]=undefined;loggerPredictive[_0xf38e('0x43')](_0x43bc76[_0xf38e('0x48')],_0xf38e('0x64'));}if(_0x43bc76[_0xf38e('0x65')]){_0x43bc76[_0xf38e('0x65')]=undefined;loggerPredictive['debug'](_0x43bc76[_0xf38e('0x48')],_0xf38e('0x66'));}if(_0x43bc76[_0xf38e('0x67')]){clearInterval(_0x43bc76[_0xf38e('0x67')]);_0x43bc76[_0xf38e('0x67')]=undefined;loggerPredictive['debug'](_0x43bc76[_0xf38e('0x48')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x515eea,_0x26d1b5){return function(_0x5167f5){loggerPredictive[_0xf38e('0x68')](_0x26d1b5[_0xf38e('0x48')],_0x515eea);loggerPredictive[_0xf38e('0x68')](_0x5167f5[_0xf38e('0x69')]);clearPredictiveAttributes(_0x26d1b5);};}function loggerCatch(_0x2e59b2){return function(_0x3d46fd){logger[_0xf38e('0x68')](_0x2e59b2,util[_0xf38e('0x45')](_0x3d46fd,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4a536e,_0x2b70ef,_0x5796c8){return function(_0x24cca2){utils[_0xf38e('0x6a')](_0x2b70ef,_0x5796c8,0x0);_0x2b70ef[_0xf38e('0x6b')]=0x0;logger[_0xf38e('0x68')](_0x4a536e,util[_0xf38e('0x45')](_0x24cca2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x38b512){return function(_0x232a77){if(isNotNull(_0x232a77)&&isNotNull(_0x232a77[0x0])){if(_0x232a77[0x0][_0xf38e('0x6c')]>0x0){_0x38b512['message']=utils[_0xf38e('0x6d')][_0xf38e('0x6e')];logger[_0xf38e('0x4b')](_0xf38e('0x6f')+_0x38b512[_0xf38e('0x48')],_0x232a77[0x0][_0xf38e('0x6c')],'contacts');}else{_0x38b512[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x71')];logger[_0xf38e('0x4b')](_0xf38e('0x72')+_0x38b512[_0xf38e('0x48')]);}}};}function createObjHistory(_0x4b744a,_0x15ffd0,_0x14a87b,_0xfab1f4,_0x3ac341){_0x4b744a[_0xf38e('0x70')]=_0x14a87b;var _0xf7e792=new Action(_0x4b744a,_0x15ffd0);var _0x1c74c3=new History(_0xf7e792);_0x1c74c3[_0xf38e('0x73')]=_0xfab1f4;_0x1c74c3[_0xf38e('0x74')]=_0x3ac341;_0x1c74c3[_0xf38e('0x75')]=_0xf7e792[_0xf38e('0x76')];return _0x1c74c3;}function unlockQueueStatus(_0x4447eb,_0x54de8a){setTimeout(function(){if(_[_0xf38e('0x56')](_0x4447eb['queueStatusComplete'])){loggerBooked[_0xf38e('0x68')](_0xf38e('0x77'),_0x54de8a);}_0x4447eb[_0xf38e('0x78')]=!![];loggerBooked[_0xf38e('0x4b')](_0xf38e('0x79'),_0x54de8a,JSON[_0xf38e('0x7a')](_[_0xf38e('0x7b')](_0x4447eb,[_0xf38e('0x48'),_0xf38e('0x78')])));},0x1f3);}function checkInterval(_0x3d8267){return function(){if(!isNotNull(_0x3d8267[_0xf38e('0x7c')])){_0x3d8267['message']=utils['CAMPAIGN_STATUS'][_0xf38e('0x7d')];throw _0x3d8267[_0xf38e('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3d8267[_0xf38e('0x7c')][_0xf38e('0x7e')])){_0x3d8267[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x7d')];throw _0x3d8267['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xf38e('0x4a')](_0x3d8267[_0xf38e('0x7c')]['Intervals']))){_0x3d8267[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x7d')];throw _0x3d8267[_0xf38e('0x48')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x48c54a){return function(){if(!utils[_0xf38e('0x7f')](_0x48c54a)){_0x48c54a['message']=utils[_0xf38e('0x6d')][_0xf38e('0x80')];throw _0x48c54a[_0xf38e('0x48')]+_0xf38e('0x81');}};}function emitCampaignSummary(_0x1c89a7){if(utils[_0xf38e('0x82')](_0x1c89a7)){emit(util[_0xf38e('0x46')](_0xf38e('0x83'),_0x1c89a7['name']),_0xf38e('0x84'),_0x1c89a7);}}function loggerCatchQueueSummary(_0x326533,_0x74a7a4){return function(_0x60db8a){clearPredictiveAttributes(_0x74a7a4);emitCampaignSummary(_0x74a7a4);loggerSyncQueueSummary['debug'](_0x326533,util[_0xf38e('0x45')](_0x60db8a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x33589c){if(_0x33589c[_0xf38e('0x85')]){if(_0x33589c['originated']===0x0){_0x33589c['sendMessageOneNotActive']=![];_0x33589c[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x80')];loggerSyncQueueSummary[_0xf38e('0x43')](_0xf38e('0x86'),_0x33589c['name'],'is\x20not\x20active');}else{_0x33589c[_0xf38e('0x70')]=utils['CAMPAIGN_STATUS'][_0xf38e('0x87')];loggerSyncQueueSummary[_0xf38e('0x43')](_0xf38e('0x86'),_0x33589c[_0xf38e('0x48')],_0xf38e('0x88'));}emitCampaignSummary(_0x33589c);}}function myreject(_0x3a6148){return function(_0x251662){return _0x3a6148(msgResponse(_0xf38e('0x89'),'Error',JSON[_0xf38e('0x7a')](_0x251662)));};}Dialer['prototype'][_0xf38e('0x8a')]=function(_0xacfa03){return!_[_0xf38e('0x56')](_0xacfa03)&&_0xacfa03&&!_['isUndefined'](_0xacfa03['name'])&&!_[_0xf38e('0x56')](_0xacfa03['active'])&&_0xacfa03['active']&&(this['trunks'][util['format'](_0xf38e('0x8b'),_0xacfa03[_0xf38e('0x48')])][_0xf38e('0x8c')]===_0xf38e('0x8d')||this[_0xf38e('0x1f')][util[_0xf38e('0x46')]('SIP/%s',_0xacfa03[_0xf38e('0x48')])]['status']===_0xf38e('0x8e'));};Dialer[_0xf38e('0x18')]['checkIsTrunkReachable']=function(_0x47defc){var _0x2e1be7=this;return function(){if(!_0x2e1be7['isTrunkReachable'](_0x47defc['Trunk'])){if(!_0x2e1be7['isTrunkReachable'](_0x47defc[_0xf38e('0x8f')])){_0x47defc[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x90')];throw _0x47defc[_0xf38e('0x48')]+_0xf38e('0x91');}}};};Dialer[_0xf38e('0x18')][_0xf38e('0x92')]=function(_0x38a2c7,_0x289c42,_0x95a6f2,_0xbded74){var _0x4a30e1=this;return function(){var _0x26c4b9=!![];return _0x4a30e1[_0xf38e('0x93')](_0x38a2c7,_0x289c42,_0x95a6f2,_0xbded74,_0x26c4b9);};};Dialer[_0xf38e('0x18')][_0xf38e('0x94')]=function(_0x4f0306,_0x2b1ddd,_0x36e7cb,_0x449cb3){var _0x2f8b53=this;return function(){var _0x1542e4=![];return _0x2f8b53[_0xf38e('0x93')](_0x4f0306[_0xf38e('0x7e')],_0x2b1ddd,_0x36e7cb,_0x449cb3,_0x1542e4);};};Dialer[_0xf38e('0x18')]['ifTimeIvr']=function(_0x1a31c9,_0x160b48,_0x367c9b,_0x317486,_0x216cb6){var _0x2ac440=[];return new Promise(function(_0x11d7a5,_0x292926){if(!isNotNull(_0x1a31c9)){_0x317486['message']=utils[_0xf38e('0x6d')][_0xf38e('0x7d')];return _0x292926(msgResponse(_0xf38e('0x95'),_0xf38e('0x96'),_0x367c9b+_0xf38e('0x97')));}if(_['isEmpty'](_0x1a31c9)){_0x317486[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x98')];return _0x292926(msgResponse('ifTime',_0xf38e('0x96'),_0x367c9b+_0xf38e('0x99')));}if(_0x160b48&&_[_0xf38e('0x56')](config[_0xf38e('0x9a')][_0x160b48])){_0x317486[_0xf38e('0x70')]=utils[_0xf38e('0x6d')]['UNKNOWN_TIMEZONE'];return _0x292926(msgResponse(_0xf38e('0x95'),_0xf38e('0x96'),_0x367c9b+'\x20Timezone\x20unknow\x20'+_0x160b48));}if(_[_0xf38e('0x9b')](_0x1a31c9)){for(var _0x1aa234=0x0;_0x1aa234<_0x1a31c9[_0xf38e('0x9c')];_0x1aa234+=0x1){_0x2ac440[_0xf38e('0x9d')](ami[_0xf38e('0x9e')]({'action':'command','command':util[_0xf38e('0x46')](_0xf38e('0x9f'),_0x1a31c9[_0x1aa234][_0xf38e('0xa0')],!_[_0xf38e('0x56')](config['timezones'][_0x160b48])?_0x160b48:'')})[_0xf38e('0x3e')](function(_0xecc50c){return _0xecc50c[_0xf38e('0xa1')][_0xf38e('0xa2')](_0xf38e('0xa3'))>=0x0;})[_0xf38e('0xa4')](myreject(_0x292926)));}}else{_0x2ac440[_0xf38e('0x9d')](ami['Action']({'action':_0xf38e('0xa5'),'command':util[_0xf38e('0x46')](_0xf38e('0x9f'),_0x1a31c9,!_[_0xf38e('0x56')](config[_0xf38e('0x9a')][_0x160b48])?_0x160b48:'')})[_0xf38e('0x3e')](function(_0x1d2dd8){return _0x1d2dd8[_0xf38e('0xa1')][_0xf38e('0xa2')]('true')>=0x0;})['catch'](myreject(_0x292926)));}Promise[_0xf38e('0xa6')](_0x2ac440)[_0xf38e('0x3e')](function(_0x2bcfc4){var _0x542de6=_[_0xf38e('0xa7')](_0x2bcfc4);if(_0x542de6){return _0x11d7a5(_0x542de6);}else{_0x317486[_0xf38e('0x70')]=_0x216cb6?utils['CAMPAIGN_STATUS'][_0xf38e('0xa8')]:utils['CAMPAIGN_STATUS'][_0xf38e('0xa9')];return _0x292926(msgResponse(_0xf38e('0xaa'),_0xf38e('0x96'),_0xf38e('0xab')+_0x216cb6+'\x20'+_0x367c9b+_0xf38e('0xac')+util['inspect'](_0x1a31c9,{'showHidden':![],'depth':null})+_0xf38e('0xad')+_0x160b48));}})['catch'](function(_0x191950){return _0x292926(msgResponse(_0xf38e('0x95'),_0xf38e('0x96'),JSON['stringify'](_0x191950)));});});};Dialer[_0xf38e('0x18')]['loopCampaigns']=function(){var _0x23c36e=this;return cmHopper[_0xf38e('0xae')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x23c36e[_0xf38e('0xaf')]();},0x3e8);});};Dialer[_0xf38e('0x18')][_0xf38e('0xaf')]=function(){var _0x27c8f0=this;var _0x3a7905;for(var _0x157d35 in this[_0xf38e('0x1d')]){if(typeof this['campaigns'][_0x157d35]!==_0xf38e('0xb0')){_0x3a7905=this[_0xf38e('0x1d')][_0x157d35];if(utils[_0xf38e('0x82')](_0x3a7905)&&utils[_0xf38e('0x7f')](_0x3a7905)){_0x3a7905['sendMessageOneNotActive']=!![];Promise[_0xf38e('0xb1')]()[_0xf38e('0x3e')](checkIsIVRCampaignActive(_0x3a7905))[_0xf38e('0x3e')](checkInterval(_0x3a7905))['then'](_0x27c8f0[_0xf38e('0xb2')](_0x3a7905))[_0xf38e('0x3e')](_0x27c8f0['checkIfTime'](_0x3a7905[_0xf38e('0xb3')],_0x3a7905['dialTimezone'],_0x3a7905[_0xf38e('0x48')],_0x3a7905))[_0xf38e('0x3e')](_0x27c8f0[_0xf38e('0x94')](_0x3a7905[_0xf38e('0x7c')],_0x3a7905[_0xf38e('0xb4')],_0x3a7905['name'],_0x3a7905))['then'](_0x27c8f0[_0xf38e('0xb5')](_0x3a7905))[_0xf38e('0xa4')](loggerCatchQueueSummary(_0xf38e('0xb6'),_0x3a7905));}else{notSendMessagesCampaign(_0x3a7905);}}}};Dialer[_0xf38e('0x18')]['checkDialMethod']=function(_0x579cb8){if(_0x579cb8[_0xf38e('0xb7')]!==_0xf38e('0x8')){clearPredictiveAttributes(_0x579cb8);}switch(_0x579cb8[_0xf38e('0xb7')]){case'progressive':this['handlePower'](_0x579cb8,0x1);break;case _0xf38e('0xb8'):this['handlePower'](_0x579cb8,_0x579cb8[_0xf38e('0xb9')]);break;case'predictive':this[_0xf38e('0x8')](_0x579cb8);break;case _0xf38e('0x7'):this[_0xf38e('0xba')](_0x579cb8,0x1);break;default:logger[_0xf38e('0x68')](_0xf38e('0xbb'),_0x579cb8['name'],_0xf38e('0xbc'));}};Dialer[_0xf38e('0x18')]['ifTime']=function(_0x2075f0,_0x5d4c5b){var _0x4884e9=_0x2075f0['dialTimezone'];var _0x212824=_0x5d4c5b?_0x2075f0[_0xf38e('0xb3')]:_0x2075f0['Interval']['Intervals'];logger['silly'](_0xf38e('0xbd'),_0x212824,_0x4884e9,_0x2075f0[_0xf38e('0x48')],util[_0xf38e('0x46')](_0xf38e('0xbe'),_0x2075f0[_0xf38e('0x48')],_0x2075f0['id']));var _0x5ac65e=null;return Interval[_0xf38e('0xbf')](_0x212824,_0x4884e9)[_0xf38e('0x3e')](function(_0x57bad6){if(_0x57bad6===!![]){return _0x57bad6;}else{_0x2075f0['message']=_0x5d4c5b?utils[_0xf38e('0x6d')][_0xf38e('0xa8')]:utils[_0xf38e('0x6d')][_0xf38e('0xa9')];_0x5ac65e=msgResponse(_0xf38e('0xaa'),'Failure',_0xf38e('0xab')+_0x5d4c5b+'\x20'+_0x2075f0[_0xf38e('0x48')]+_0xf38e('0xac')+util[_0xf38e('0x45')](_0x212824,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4884e9);}if(_0x5ac65e!==null){logger[_0xf38e('0xc0')](_0xf38e('0xc1'),_0x5ac65e);_0x5ac65e[_0xf38e('0xc2')]=_0x5d4c5b;throw _0x5ac65e;}})[_0xf38e('0xa4')](function(_0x264735){logger[_0xf38e('0x68')]('AMI\x20IfTime',_0x264735);throw msgResponse(_0xf38e('0x89'),_0xf38e('0xc3'),util[_0xf38e('0x45')](_0x264735,{'showHidden':![],'depth':null}));});};Dialer[_0xf38e('0x18')][_0xf38e('0x2b')]=function(_0x34c193){if(this[_0xf38e('0x1c')][_0x34c193[_0xf38e('0xc4')]]){if(this[_0xf38e('0x24')][_0x34c193[_0xf38e('0xc5')]]&&this[_0xf38e('0x24')][_0x34c193['uniqueid']][_0xf38e('0x41')]!=='ivr'){this[_0xf38e('0xc6')](this['voiceQueues'][_0x34c193[_0xf38e('0xc4')]]);this['uniqueId'][_0x34c193[_0xf38e('0xc5')]][_0xf38e('0xc7')]=moment()[_0xf38e('0x46')](_0xf38e('0xc8'));}}};Dialer['prototype'][_0xf38e('0x31')]=function(_0x53173b){var _0x4a602c=this[_0xf38e('0x24')][_0x53173b[_0xf38e('0xc5')]];if(this['voiceQueues'][_0x53173b[_0xf38e('0xc4')]]){if(_0x4a602c&&_0x4a602c['type']!==_0xf38e('0xc9')){delete this[_0xf38e('0x24')][_0x53173b[_0xf38e('0xc5')]];this['voiceQueues'][_0x53173b[_0xf38e('0xc4')]][_0xf38e('0xca')]+=0x1;var _0x248c1b=new AgentComplete(_0x4a602c,_0x53173b);if(_0x53173b[_0xf38e('0xcb')]==='agent'){_0x248c1b[_0xf38e('0xcc')]=this[_0xf38e('0x1c')][_0x53173b[_0xf38e('0xc4')]]['dialQueueProject2']&&this[_0xf38e('0x1c')][_0x53173b[_0xf38e('0xc4')]][_0xf38e('0xcd')]?moment()[_0xf38e('0x46')](_0xf38e('0xc8')):undefined;}hopperUtils['createHistory'](_0x248c1b)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0xce')));hopperUtils['moveContactManagedDialer'](_0x248c1b)[_0xf38e('0xa4')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xf38e('0x2e')]=function(_0xe7ad07){var _0x270d8d=this[_0xf38e('0x24')][_0xe7ad07['uniqueid']];var _0x30d34d=this;var _0x159644=![];var _0x2eb71d;var _0x4b689e;if(this['voiceQueues'][_0xe7ad07[_0xf38e('0xc4')]]){if(_0x270d8d&&_0x270d8d[_0xf38e('0x41')]!==_0xf38e('0xc9')){delete this[_0xf38e('0x24')][_0xe7ad07[_0xf38e('0xc5')]];this[_0xf38e('0xc6')](this[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]]);_0x270d8d['droptime']=moment()[_0xf38e('0x46')](_0xf38e('0xc8'));var _0x484a90=new QueueCallerAbandon(_0x270d8d,_0xe7ad07);if(utils[_0xf38e('0x63')](_0x270d8d[_0xf38e('0xcf')],_0x270d8d[_0xf38e('0xd0')])>=_0x270d8d[_0xf38e('0xd1')]){this[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0xe7ad07['queue']][_0xf38e('0xd2')]+=0x1;this['voiceQueues'][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xd3')]+=0x1;_0x484a90[_0xf38e('0x73')]=0xa;_0x484a90['statedesc']=_0xf38e('0xd4');_0x484a90[_0xf38e('0xd5')]='TIMEOUT';_0x484a90[_0xf38e('0xcc')]=this['voiceQueues'][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xd6')]?moment()['format'](_0xf38e('0xc8')):undefined;_0x484a90[_0xf38e('0xd7')]+=0x1;_0x484a90['countglobal']+=0x1;_0x2eb71d=this['voiceQueues'][_0xe7ad07['queue']]['dialDropRetryFrequency'];_0x4b689e=this[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xd8')];hopperUtils[_0xf38e('0xd9')](_0x484a90,_0x484a90[_0xf38e('0x73')],_0x270d8d[_0xf38e('0xda')])['then'](function(_0x4953e9){_0x159644=_0x4953e9[_0xf38e('0xdb')]==0x1;if(_0x484a90[_0xf38e('0xd7')]>=_0x30d34d['voiceQueues'][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xdc')]){_0x30d34d[_0xf38e('0xdd')](_0x484a90,_0x4953e9[_0xf38e('0xdb')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x484a90[_0xf38e('0xd7')],'scheduledat':moment()[_0xf38e('0xde')](_0x30d34d['voiceQueues'][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xdf')],_0xf38e('0xe0'))[_0xf38e('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x270d8d[_0xf38e('0xe1')],'ListId':_0x270d8d[_0xf38e('0xe2')],'VoiceQueueId':_0x270d8d[_0xf38e('0xe3')]||undefined,'CampaignId':_0x270d8d[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch('[rescheduleContact][Drop]'));var _0x2cb44d=new History(_0x484a90);_0x2cb44d[_0xf38e('0x73')]=0xa;_0x2cb44d[_0xf38e('0x74')]='Drop';_0x2cb44d[_0xf38e('0x76')]=moment()[_0xf38e('0x46')](_0xf38e('0xc8'));_0x2cb44d[_0xf38e('0x75')]=_0x2cb44d[_0xf38e('0x76')];_0x2cb44d[_0xf38e('0xe5')]=_0x484a90[_0xf38e('0xe5')];_0x2cb44d[_0xf38e('0xe6')]=_0x484a90[_0xf38e('0xe6')];hopperUtils[_0xf38e('0xe7')](_0x2cb44d)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0xe8')));}})[_0xf38e('0x3e')](function(){if(_0x159644)hopperUtils['swapAdditionalPhones'](_0x484a90,_0x2eb71d,_0x4b689e)['then'](function(){return 0x1;});});}else{this[_0xf38e('0x1c')][_0xe7ad07['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]]['outboundDropCallsDayCallersExit']+=0x1;_0x484a90[_0xf38e('0x73')]=0xb;_0x484a90[_0xf38e('0x74')]=_0xf38e('0xe9');_0x484a90[_0xf38e('0xd5')]='CALLEREXIT';_0x484a90[_0xf38e('0xea')]+=0x1;_0x484a90[_0xf38e('0xeb')]+=0x1;_0x2eb71d=this[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xec')];_0x4b689e=this[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x484a90,_0x484a90[_0xf38e('0x73')],_0x270d8d['voiceQueue'])[_0xf38e('0x3e')](function(_0x2603c5){if(_0x484a90[_0xf38e('0xea')]>=_0x30d34d[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]][_0xf38e('0xed')]){_0x30d34d['queueCallerAbandonCreateState'](_0x484a90,_0x2603c5[_0xf38e('0xdb')]);}else{hopperUtils[_0xf38e('0xee')]({'active':![],'countabandonedretry':_0x484a90[_0xf38e('0xea')],'scheduledat':moment()['add'](_0x30d34d[_0xf38e('0x1c')][_0xe7ad07[_0xf38e('0xc4')]]['dialAbandonedRetryFrequency'],_0xf38e('0xe0'))['format'](_0xf38e('0xc8')),'ContactId':_0x270d8d['ContactId'],'ListId':_0x270d8d['ListId'],'VoiceQueueId':_0x270d8d['VoiceQueueId']||undefined,'CampaignId':_0x270d8d['CampaignId']||undefined})[_0xf38e('0xa4')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x46954e=new History(_0x484a90);_0x46954e[_0xf38e('0x73')]=0xb;_0x46954e['statedesc']=_0xf38e('0xe9');_0x46954e[_0xf38e('0x76')]=moment()[_0xf38e('0x46')](_0xf38e('0xc8'));_0x46954e[_0xf38e('0x75')]=_0x46954e[_0xf38e('0x76')];_0x46954e['calleridname']=_0x484a90[_0xf38e('0xe5')];_0x46954e[_0xf38e('0xe6')]=_0x484a90[_0xf38e('0xe6')];hopperUtils[_0xf38e('0xe7')](_0x46954e)['catch'](loggerCatch(_0xf38e('0xef')));}})[_0xf38e('0x3e')](function(){if(_0x159644)hopperUtils[_0xf38e('0xf0')](_0x484a90,_0x2eb71d,_0x4b689e)[_0xf38e('0x3e')](function(){return 0x1;});});}}}};Dialer[_0xf38e('0x18')][_0xf38e('0xf1')]=function(_0x8e465f){if(this[_0xf38e('0x22')][_0x8e465f[_0xf38e('0xc5')]]){this['actions'][_0x8e465f[_0xf38e('0xc5')]][_0xf38e('0xf2')]=_0x8e465f[_0xf38e('0xf2')];}if(this[_0xf38e('0x24')][_0x8e465f[_0xf38e('0xc5')]]){this[_0xf38e('0x24')][_0x8e465f[_0xf38e('0xc5')]][_0xf38e('0xf2')]=_0x8e465f[_0xf38e('0xf2')];}};Dialer[_0xf38e('0x18')][_0xf38e('0x3a')]=function(_0x19273a){if(!this[_0xf38e('0x22')][_0x19273a[_0xf38e('0xf3')]]){return;}var _0x28e1ae=this[_0xf38e('0x1c')][this['actions'][_0x19273a[_0xf38e('0xf3')]][_0xf38e('0xc4')]]['strategy']||_0xf38e('0xf4');if(_0x28e1ae===_0xf38e('0xf5')){if(this['actions'][_0x19273a['actionid']]&&_[_0xf38e('0xf6')](this['actions'][_0x19273a[_0xf38e('0xf3')]][_0xf38e('0xf7')])&&_0x19273a[_0xf38e('0x8c')]==='1'&&_0x19273a[_0xf38e('0xf8')]==='0'){if(this[_0xf38e('0x1e')][_0x19273a['stateinterface']]){if(!this[_0xf38e('0x1e')][_0x19273a[_0xf38e('0xf9')]][_0xf38e('0xf7')]){this[_0xf38e('0x1e')][_0x19273a[_0xf38e('0xf9')]][_0xf38e('0xf7')]=!![];this[_0xf38e('0x22')][_0x19273a[_0xf38e('0xf3')]]['locked']=!![];this['actions'][_0x19273a['actionid']][_0xf38e('0xf9')]=_0x19273a[_0xf38e('0xf9')];}}}}else if(_0x28e1ae===_0xf38e('0xf4')){if(this[_0xf38e('0x22')][_0x19273a['actionid']]){if(this['agents'][_0x19273a[_0xf38e('0xf9')]]){this[_0xf38e('0x22')][_0x19273a[_0xf38e('0xf3')]][_0xf38e('0xf9')]=_0x19273a[_0xf38e('0xf9')];if(_[_0xf38e('0xf6')](this['queueBooked'][this[_0xf38e('0x22')][_0x19273a[_0xf38e('0xf3')]][_0xf38e('0xc4')]])){this[_0xf38e('0x27')][this['actions'][_0x19273a[_0xf38e('0xf3')]][_0xf38e('0xc4')]]=[];}this[_0xf38e('0x27')][this[_0xf38e('0x22')][_0x19273a[_0xf38e('0xf3')]][_0xf38e('0xc4')]][_0xf38e('0x9d')](_[_0xf38e('0x62')](_[_0xf38e('0x7b')](this[_0xf38e('0x22')][_0x19273a[_0xf38e('0xf3')]],['idHopper','stateinterface']),{'status':_0x19273a[_0xf38e('0x8c')],'paused':_0x19273a['paused']}));}}}};Dialer['prototype'][_0xf38e('0xfa')]=function(_0x523aed){if(!this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]]){return;}var _0x431cfa=this;var _0x5294c1=this['voiceQueues'][this[_0xf38e('0x22')][_0x523aed['actionid']][_0xf38e('0xc4')]];var _0x3302f1=_0x5294c1[_0xf38e('0xfb')]||'rrmemory';if(_0x3302f1===_0xf38e('0xf5')){if(this[_0xf38e('0x22')][_0x523aed['actionid']]&&this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]]['stateinterface']){this[_0xf38e('0x1b')][_0xf38e('0xfc')](this['actions'][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xfd')],this['actions'][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xf9')])[_0xf38e('0xa4')](function(_0x2dd94f){logger[_0xf38e('0x68')](_0xf38e('0xfe'),util[_0xf38e('0x45')](_0x2dd94f,{'showHidden':![],'depth':null}));})[_0xf38e('0xff')](function(){_0x431cfa['updateOriginated'](_0x431cfa[_0xf38e('0x1c')][_0x431cfa[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]]);_0x431cfa['agents'][_0x431cfa[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xf9')]][_0xf38e('0xf7')]=![];delete _0x431cfa[_0xf38e('0x22')][_0x523aed['actionid']];unlockQueueStatus(_0x5294c1);});}else{this[_0xf38e('0xc6')](this[_0xf38e('0x1c')][this['actions'][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]]);hopperUtils[_0xf38e('0xee')]({'active':![],'ContactId':this['actions'][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xe1')],'ListId':this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xe2')],'VoiceQueueId':this[_0xf38e('0x22')][_0x523aed['actionid']][_0xf38e('0xe3')]||undefined,'CampaignId':this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]];unlockQueueStatus(_0x5294c1);}}else if(_0x3302f1==='rrmemory'){var _0x5111b2;if(this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]]&&!_[_0xf38e('0x4a')](this[_0xf38e('0x27')][this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]])){if(this[_0xf38e('0x28')][_0x431cfa[_0xf38e('0x22')][_0x523aed['actionid']][_0xf38e('0xc4')]]){this['queueBookedRR'][_0x431cfa[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]]=this[_0xf38e('0x28')][this[_0xf38e('0x22')][_0x523aed['actionid']]['queue']]?this[_0xf38e('0x28')][this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]]['queue']]:this[_0xf38e('0x27')][this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]]?this[_0xf38e('0x27')][this['actions'][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]][_0xf38e('0x100')]||0x0:0x0;}this[_0xf38e('0x27')][this[_0xf38e('0x22')][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]][_0xf38e('0x100')]=this[_0xf38e('0x28')][this['actions'][_0x523aed[_0xf38e('0xf3')]][_0xf38e('0xc4')]];for(var _0x1a1163=0x0;_0x1a1163=_0x5ccb91['dialGlobalMaxRetry']){_0x51cfd9['stateGlobal'](_0x237144,_0x167b8e,_0x2f0627,_0xf38e('0x121'));}else{if(_0x237144[_0xf38e('0x11b')]>=_0x5ccb91['dialMachineMaxRetry']){_0x51cfd9[_0xf38e('0x122')](_0x237144,_0x167b8e,_0x2f0627,_0xf38e('0x123'));}else{hopperUtils[_0xf38e('0xee')]({'active':![],'countmachineretry':_0x237144[_0xf38e('0x11b')],'scheduledat':moment()[_0xf38e('0xde')](_0x5ccb91['dialMachineRetryFrequency'],'minutes')[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x237144[_0xf38e('0xe1')],'ListId':_0x237144[_0xf38e('0xe2')],'VoiceQueueId':_0x237144[_0xf38e('0xe3')]||undefined,'CampaignId':_0x237144['CampaignId']||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x124')));_0x167b8e({'reschedule':0x1});}}});}if(_0x2eaaff[_0xf38e('0x41')]==='ivr'&&this['campaigns'][_0x2eaaff[_0xf38e('0xc4')]]['dialAMDActive']&&_0x376b2c[_0xf38e('0x118')]==='HANGUP'){delete this['uniqueId'][_0x376b2c['uniqueid']];this[_0xf38e('0xc6')](this['campaigns'][_0x2eaaff['queue']]);_0x535e91=new Hangup(_0x2eaaff,_0x376b2c);_0x535e91[_0xf38e('0x73')]=0x12;_0x535e91['statedesc']=_0xf38e('0x125');_0x535e91[_0xf38e('0x112')]=_0xf38e('0x126');ami[_0xf38e('0x40')](_0xf38e('0x113'),ut[_0xf38e('0x114')](_0x535e91,_0xf38e('0x115')));this[_0xf38e('0x127')](_0x535e91,'[syncHangupInAMDIvr][createHistory]',_0xf38e('0x128'));}if(_0x2eaaff['type']==='ivr'&&this[_0xf38e('0x1d')][_0x2eaaff['queue']][_0xf38e('0x10f')]&&_0x376b2c[_0xf38e('0x118')]===_0xf38e('0x119')){return new Promise(function(_0x4010b4,_0x35e3d7){delete _0x51cfd9['uniqueId'][_0x376b2c[_0xf38e('0xc5')]];_0x51cfd9['updateOriginated'](_0x51cfd9[_0xf38e('0x1d')][_0x2eaaff[_0xf38e('0xc4')]]);_0x51cfd9[_0xf38e('0x1d')][_0x2eaaff[_0xf38e('0xc4')]][_0xf38e('0xca')]+=0x1;_0x51cfd9[_0xf38e('0x1d')][_0x2eaaff[_0xf38e('0xc4')]][_0xf38e('0x111')]+=0x1;var _0x350559=_0x51cfd9[_0xf38e('0x1d')][_0x2eaaff[_0xf38e('0xc4')]];var _0x350b9a=new Hangup(_0x2eaaff,_0x376b2c);_0x350b9a[_0xf38e('0x73')]=0x13;_0x350b9a['statedesc']=_0xf38e('0x11a');_0x350b9a[_0xf38e('0x112')]=_0xf38e('0x126');_0x350b9a['countmachineretry']+=0x1;_0x350b9a[_0xf38e('0xeb')]+=0x1;_0x350b9a['amd']=!![];ami['emit'](_0xf38e('0x113'),ut[_0xf38e('0x114')](_0x350b9a,'amd'));hopperUtils[_0xf38e('0xe7')](_0x350b9a)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x11c')));if(_0x350b9a[_0xf38e('0x11d')]+_0x350b9a[_0xf38e('0x11e')]+_0x350b9a[_0xf38e('0x129')]+_0x350b9a[_0xf38e('0x11f')]+_0x350b9a[_0xf38e('0xd7')]+_0x350b9a['countabandonedretry']+_0x350b9a[_0xf38e('0x11b')]+_0x350b9a['countagentrejectretry']>=_0x350559['dialGlobalMaxRetry']){_0x51cfd9[_0xf38e('0x12a')](_0x350b9a,_0x4010b4,_0x35e3d7,'reason19\x20machine....');}else{if(_0x350b9a[_0xf38e('0x11b')]>=_0x350559[_0xf38e('0x12b')]){_0x51cfd9[_0xf38e('0x122')](_0x350b9a,_0x4010b4,_0x35e3d7,'reason\x2019\x20machine....');}else{hopperUtils[_0xf38e('0xee')]({'active':![],'countmachineretry':_0x350b9a[_0xf38e('0x11b')],'scheduledat':moment()[_0xf38e('0xde')](_0x350559[_0xf38e('0x12c')],_0xf38e('0xe0'))[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x350b9a[_0xf38e('0xe1')],'ListId':_0x350b9a[_0xf38e('0xe2')],'VoiceQueueId':_0x350b9a[_0xf38e('0xe3')]||undefined,'CampaignId':_0x350b9a[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x124')));_0x4010b4({'reschedule':0x1});}}});}}};Dialer[_0xf38e('0x18')][_0xf38e('0x36')]=function(_0x261543){var _0x1e4ea6=this['uniqueId'][_0x261543[_0xf38e('0xc5')]];var _0x30235a;if(_0x1e4ea6&&_0x1e4ea6[_0xf38e('0x41')]===_0xf38e('0xc9')){delete this[_0xf38e('0x24')][_0x261543[_0xf38e('0xc5')]];this[_0xf38e('0xc6')](this[_0xf38e('0x1d')][_0x1e4ea6[_0xf38e('0xc4')]]);this[_0xf38e('0x1d')][_0x1e4ea6[_0xf38e('0xc4')]][_0xf38e('0x12d')]+=0x1;_0x30235a=new Hangup(_0x1e4ea6,_0x261543);hopperUtils['createHistory'](_0x30235a)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x12e')));hopperUtils['moveContactManagedDialer'](_0x30235a)['catch'](loggerCatch(_0xf38e('0x12f')));}if(_0x1e4ea6&&_0x1e4ea6[_0xf38e('0x41')]!==_0xf38e('0xc9')&&isNotNull(this['voiceQueues'][_0x1e4ea6['queue']][_0xf38e('0x130')])){delete this[_0xf38e('0x24')][_0x261543[_0xf38e('0xc5')]];this[_0xf38e('0xc6')](this[_0xf38e('0x1c')][_0x1e4ea6[_0xf38e('0xc4')]]);this['voiceQueues'][_0x1e4ea6[_0xf38e('0xc4')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x1e4ea6[_0xf38e('0xc4')]][_0xf38e('0x111')]+=0x1;_0x30235a=new Hangup(_0x1e4ea6,_0x261543);_0x30235a[_0xf38e('0x73')]=0x10;_0x30235a['statedesc']='AnswerAGI';_0x30235a[_0xf38e('0x112')]=_0xf38e('0x131');hopperUtils[_0xf38e('0xe7')](_0x30235a)['catch'](loggerCatch(_0xf38e('0x12e')));hopperUtils[_0xf38e('0x132')](_0x30235a)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x12f')));}if(_0x1e4ea6&&_0x1e4ea6[_0xf38e('0x41')]!=='ivr'&&!isNotNull(this[_0xf38e('0x1c')][_0x1e4ea6[_0xf38e('0xc4')]][_0xf38e('0x130')])){delete this[_0xf38e('0x24')][_0x261543[_0xf38e('0xc5')]];this[_0xf38e('0xc6')](this[_0xf38e('0x1c')][_0x1e4ea6[_0xf38e('0xc4')]]);this[_0xf38e('0x1c')][_0x1e4ea6['queue']][_0xf38e('0x133')]+=0x1;_0x30235a=new Hangup(_0x1e4ea6,_0x261543);_0x30235a['state']=0xc;_0x30235a[_0xf38e('0x74')]=_0x261543[_0xf38e('0x134')];_0x30235a[_0xf38e('0x112')]='Unknow';hopperUtils[_0xf38e('0xe7')](_0x30235a)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x12e')));hopperUtils[_0xf38e('0x132')](_0x30235a)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x12f')));}};Dialer['prototype']['syncQueueSummary']=function(_0x3b2d21){var _0xd49d08=this;if(!_0xd49d08[_0xf38e('0x29')][_0x3b2d21[_0xf38e('0x48')]]){_0xd49d08['queuesSummary'][_0x3b2d21[_0xf38e('0x48')]]={'running':![]};}else if(_0xd49d08['queuesSummary'][_0x3b2d21[_0xf38e('0x48')]][_0xf38e('0x135')]===!![]){return;}else if(_0xd49d08[_0xf38e('0x29')][_0x3b2d21[_0xf38e('0x48')]][_0xf38e('0x135')]===![]){_0xd49d08[_0xf38e('0x29')][_0x3b2d21['name']][_0xf38e('0x135')]=!![];}var _0xd0f4a0=_0xd49d08[_0xf38e('0x1c')][_0x3b2d21['name']];var _0x1fb4ea=_0xd0f4a0[_0xf38e('0x70')]!==utils[_0xf38e('0x6d')][_0xf38e('0x80')];var _0x398676=utils[_0xf38e('0x136')](_0xd0f4a0);_0xd0f4a0[_0xf38e('0x137')]=utils[_0xf38e('0x138')](_0xd0f4a0,_0xd49d08[_0xf38e('0x1f')]);Promise['resolve']()[_0xf38e('0x3e')](function(){if(_0xd0f4a0[_0xf38e('0x137')]===utils[_0xf38e('0x6d')]['INACTIVE']){if(_0x1fb4ea){clearPredictiveAttributes(_0xd0f4a0);_0x3b2d21[_0xf38e('0x65')]=undefined;_0x3b2d21['startProgressive']=undefined;}if(_0xd0f4a0[_0xf38e('0x137')]===utils[_0xf38e('0x6d')][_0xf38e('0x80')]){_0x3b2d21[_0xf38e('0x139')]=0x0;_0x3b2d21[_0xf38e('0xf8')]=0x0;_0x3b2d21[_0xf38e('0x13a')]=0x0;_0x3b2d21[_0xf38e('0x13b')]=0x0;_0x3b2d21[_0xf38e('0x13c')]=0x0;}}else if(_0xd0f4a0['statusMessage']===utils['CAMPAIGN_STATUS'][_0xf38e('0x13d')]&&!_0x398676){return _0xd49d08[_0xf38e('0x95')](_0xd0f4a0,!![])['then'](function(){return _0xd49d08['ifTime'](_0xd0f4a0,![]);})[_0xf38e('0x3e')](function(){return _0xd49d08[_0xf38e('0x13e')](_0xd0f4a0);})[_0xf38e('0xa4')](function(_0x46aa53){loggerSyncQueueSummary[_0xf38e('0x43')](_0xf38e('0x13f'),util[_0xf38e('0x45')](_0x46aa53,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xd0f4a0);});}else{clearPredictiveAttributes(_0xd0f4a0);}})[_0xf38e('0x3e')](function(){var _0xcf2554=_0x3b2d21[_0xf38e('0x140')](_0xd0f4a0);if(_0xcf2554||_0xd0f4a0[_0xf38e('0x141')]){_0xd0f4a0['queueSummaryCountersUpdated']=![];_0x3b2d21[_0xf38e('0x142')](_0xd0f4a0);Object[_0xf38e('0x143')](_0xd0f4a0,_0x3b2d21);emitOutboundVoiceQueueSummary(_0x3b2d21);}_0xd49d08[_0xf38e('0x29')][_0xd0f4a0[_0xf38e('0x48')]]['running']=![];})[_0xf38e('0xa4')](function(_0x34f93b){logger['error'](_0xf38e('0x13f'),util[_0xf38e('0x45')](_0x34f93b,{'showHidden':![],'depth':null}));_0xd49d08[_0xf38e('0x29')][_0xd0f4a0[_0xf38e('0x48')]][_0xf38e('0x135')]=![];});};Dialer[_0xf38e('0x18')][_0xf38e('0x34')]=_[_0xf38e('0x144')](function(){var _0x1a24c9=_[_0xf38e('0x145')](this[_0xf38e('0x1c')],function(_0x3eac7b){return _0x3eac7b[_0xf38e('0x146')];});var _0x34c24d=_[_0xf38e('0x145')](this[_0xf38e('0x1e')],function(_0x1a95dc){return _0x1a95dc[_0xf38e('0x147')]&&_0x1a95dc[_0xf38e('0x8c')]===_0xf38e('0x8d');});if(_0x1a24c9[_0xf38e('0x9c')]>0x0&&_0x34c24d[_0xf38e('0x9c')]>0x0){return Promise[_0xf38e('0xb1')]()[_0xf38e('0x3e')](cmHopper[_0xf38e('0x148')](_[_0xf38e('0x149')](_0x1a24c9,'id'),previewRecallmeReminderInterval,_[_0xf38e('0x149')](_0x34c24d,'id')))['then'](function(_0x21bae0){for(var _0x27e3d8=0x0;_0x27e3d8<_0x21bae0[_0xf38e('0x9c')];_0x27e3d8++){var _0xb34629=_0x21bae0[_0x27e3d8][_0xf38e('0x14a')][_0xf38e('0x48')];if(_0xb34629)io['to'](util['format'](_0xf38e('0x14b'),_0xb34629))[_0xf38e('0x40')](_0xf38e('0x14c'),{'hopper':_0x21bae0[_0x27e3d8]});}})[_0xf38e('0xa4')](function(_0x461178){logger[_0xf38e('0x68')]('checkPreviewRecallReminder',_0x461178);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xf38e('0x18')]['loopClearZombieChannels']=function(){var _0x2aef1b=this;setInterval(function(){_0x2aef1b['clearZombieChannels'](_0x2aef1b[_0xf38e('0x24')],_0xf38e('0x14d'));_0x2aef1b['clearZombieChannels'](_0x2aef1b[_0xf38e('0x22')],_0xf38e('0x14e'));},0x32c8);};Dialer[_0xf38e('0x18')]['clearZombieChannels']=function(_0x13489e,_0x497508){var _0x3b0794=this;for(var _0x881b58 in _0x13489e){if(typeof _0x13489e[_0x881b58]!=='undefined'){this[_0xf38e('0x14f')][_0xf38e('0x19')](function(){if(!_[_0xf38e('0xf6')](_0x13489e[_0x881b58])){return ami['Action']({'action':_0xf38e('0x8c'),'channel':_0x13489e[_0x881b58][_0xf38e('0xf2')]})['catch'](function(_0x411617){if(_0x411617[_0xf38e('0x70')]===_0xf38e('0x150')){setTimeout(function(){if(_0x13489e[_0x881b58]&&_0x13489e[_0x881b58][_0xf38e('0x41')]!==_0xf38e('0xc9')){_0x3b0794[_0xf38e('0xc6')](_0x3b0794['voiceQueues'][_0x13489e[_0x881b58][_0xf38e('0xc4')]]);logger[_0xf38e('0x68')](_0xf38e('0x151'),_0x497508,_0x881b58,_0x13489e[_0x881b58][_0xf38e('0xc4')]);delete _0x13489e[_0x881b58];}if(_0x13489e[_0x881b58]&&_0x13489e[_0x881b58][_0xf38e('0x41')]===_0xf38e('0xc9')){_0x3b0794[_0xf38e('0xc6')](_0x3b0794[_0xf38e('0x1d')][_0x13489e[_0x881b58][_0xf38e('0xc4')]]);logger[_0xf38e('0x68')](_0xf38e('0x152'),_0x497508,_0x881b58,_0x13489e[_0x881b58]['queue']);delete _0x13489e[_0x881b58];}},0x2328);}});}});}}};Dialer[_0xf38e('0x18')][_0xf38e('0x153')]=function(_0x24ecaf){return Promise[_0xf38e('0xb1')]()[_0xf38e('0x3e')](voiceQueueRt[_0xf38e('0x153')](_0x24ecaf))[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x154')));};Dialer['prototype']['updateOriginated']=function(_0x2f8811){if(!_[_0xf38e('0x56')](_0x2f8811)&&_0x2f8811!==null){if(typeof _0x2f8811[_0xf38e('0x155')]!==_0xf38e('0xb0')){if(_0x2f8811[_0xf38e('0x155')]>0x0){_0x2f8811[_0xf38e('0x155')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf38e('0x68')](_0xf38e('0x156'));}};Dialer[_0xf38e('0x18')][_0xf38e('0x157')]=function(_0x3f39a7,_0x17b5af){var _0x35c58e=this;return function(_0x415065){_0x35c58e[_0xf38e('0xc6')](_0x17b5af);logger[_0xf38e('0x68')](_0x3f39a7,util['inspect'](_0x415065,{'showHidden':![],'depth':null}));};};Dialer[_0xf38e('0x18')][_0xf38e('0x158')]=function(_0x1ab07d,_0x14be51,_0x41e9c0){var _0x5804ba={'state':0x19,'statedesc':_0xf38e('0x159')};this[_0xf38e('0xc6')](_0x14be51);this[_0xf38e('0x127')](_[_0xf38e('0x62')](_0x5804ba,_[_0xf38e('0x7b')](_0x41e9c0,[_0xf38e('0xe1'),_0xf38e('0xe2'),_0xf38e('0x15a'),_0xf38e('0xe3'),_0xf38e('0xe4')])),_0xf38e('0x15b'),'[emptyContact]');logger[_0xf38e('0x68')](_0x1ab07d);};Dialer[_0xf38e('0x18')]['saveInDb']=function(_0x32a106,_0x2429c0,_0x2814e1){hopperUtils[_0xf38e('0xe7')](_0x32a106)[_0xf38e('0xa4')](loggerCatch(_0x2429c0));hopperUtils['moveContactManagedDialer'](_0x32a106)[_0xf38e('0xa4')](loggerCatch(_0x2814e1));};Dialer[_0xf38e('0x18')]['queueCallerAbandonCreateState']=function(_0x2daf00,_0xc8ec1){hopperUtils[_0xf38e('0xe7')](_0x2daf00)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0xce')));if(_0xc8ec1==0x0){hopperUtils['moveContactManagedDialer'](_0x2daf00)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x15c')));}};Dialer['prototype'][_0xf38e('0x15d')]=function(_0x17c8ef){return Promise['resolve']()[_0xf38e('0x3e')](cmHopper['handlePreviewRecallNotifications'](_0x17c8ef['id'],previewRecallmeReminderInterval))[_0xf38e('0x3e')](function(_0xf12136){for(var _0x2348f7=0x0;_0x2348f7<_0xf12136[_0xf38e('0x9c')];_0x2348f7++){var _0x297a53=_0xf12136[_0x2348f7][_0xf38e('0x14a')][_0xf38e('0x48')];if(_0x297a53)io['to'](util[_0xf38e('0x46')](_0xf38e('0x14b'),_0x297a53))['emit']('user:dialPreviewRecallReminder',{'hopper':_0xf12136[_0x2348f7]});}})[_0xf38e('0xa4')](function(){});};Dialer[_0xf38e('0x18')][_0xf38e('0xb5')]=function(_0x5d1bfe){var _0x36a90d=this;return function(){_0x36a90d['handleIvr'](_0x5d1bfe);};};Dialer[_0xf38e('0x18')][_0xf38e('0x15e')]=function(_0x11edbe,_0x520115){var _0x589cf3=this;var _0x451ac9=uuid['v4']();this['actions'][_0x451ac9]=new Action(_0x11edbe,_0x520115,_0x451ac9);return new Promise(function(_0x1e37c3,_0x3fd0d1){if(_[_0xf38e('0x56')](_0x11edbe)&&typeof _0x11edbe!==_0xf38e('0x15f')){return _0x3fd0d1(msgResponse(_0xf38e('0x160'),_0xf38e('0x96'),_0xf38e('0x161')));}if(_[_0xf38e('0x56')](_0x520115[_0xf38e('0x162')])||_0x520115[_0xf38e('0x162')]===null){return _0x3fd0d1(msgResponse('originate',_0xf38e('0x96'),'contact\x20is\x20undefine'));}var _0xab0ca5={'XMD-CALLERID':_0x589cf3[_0xf38e('0x22')][_0x451ac9][_0xf38e('0x163')](),'XMD-AGI':_0x11edbe[_0xf38e('0x130')]?util[_0xf38e('0x46')](_0xf38e('0x164'),ipAgi,_0x11edbe[_0xf38e('0x130')]):_0xf38e('0x165'),'XMD-AGIAFTER':_0x11edbe['dialQueueProject2']?util[_0xf38e('0x46')](_0xf38e('0x164'),ipAgi,_0x11edbe[_0xf38e('0xd6')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x11edbe)?util['format'](_0xf38e('0x166'),_0x11edbe[_0xf38e('0x48')],_0x11edbe[_0xf38e('0x167')]||'',_0x11edbe[_0xf38e('0xcd')]?'c':'',_0x11edbe[_0xf38e('0xd1')]||0x3):_0xf38e('0x165'),'XMD-CONTACTID':_0x520115[_0xf38e('0xe1')],'XMD-CDRTYPE':_0xf38e('0x6'),'CALLERID(all)':_0x589cf3[_0xf38e('0x22')][_0x451ac9][_0xf38e('0x163')](),'XMD-AMD':_0x11edbe[_0xf38e('0x10f')]?'ACTIVE':_0xf38e('0x165'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x11edbe[_0xf38e('0x10f')]){_0xab0ca5[_0xf38e('0x168')]=_0x11edbe[_0xf38e('0x169')]||0x9c4;_0xab0ca5[_0xf38e('0x16a')]=_0x11edbe['dialAMDGreeting']||0x5dc;_0xab0ca5[_0xf38e('0x16b')]=_0x11edbe['dialAMDAfterGreetingSilence']||0x320;_0xab0ca5[_0xf38e('0x16c')]=_0x11edbe[_0xf38e('0x16d')]||0x1388;_0xab0ca5[_0xf38e('0x16e')]=_0x11edbe[_0xf38e('0x16f')]||0x64;_0xab0ca5[_0xf38e('0x170')]=_0x11edbe[_0xf38e('0x171')]||0x32;_0xab0ca5[_0xf38e('0x172')]=_0x11edbe[_0xf38e('0x173')]||0x3;_0xab0ca5[_0xf38e('0x174')]=_0x11edbe[_0xf38e('0x175')]||0x100;_0xab0ca5[_0xf38e('0x176')]=_0x11edbe[_0xf38e('0x177')]||0x1388;}if(utils[_0xf38e('0x178')](_0x11edbe)){_0xab0ca5[_0xf38e('0x179')]=_0x520115[_0xf38e('0xe3')];}else{_0xab0ca5[_0xf38e('0x17a')]=_0x520115[_0xf38e('0xe4')];}var _0x57048a=utils[_0xf38e('0x17b')](_0x520115[_0xf38e('0x17c')]);Object[_0xf38e('0x143')](_0xab0ca5,_0x57048a);var _0x563e09=_0x589cf3[_0xf38e('0x8a')](_0x11edbe[_0xf38e('0x17d')])?utils[_0xf38e('0x17e')](_0x11edbe['Trunk'][_0xf38e('0x17f')],_0x11edbe[_0xf38e('0x180')],_0x11edbe[_0xf38e('0x181')]>0x0?utils['getCallerIdRandom'](_0x11edbe['dialOriginateCallerIdNumber'],_0x11edbe[_0xf38e('0x181')]):_0x11edbe[_0xf38e('0x182')]):utils[_0xf38e('0x17e')](_[_0xf38e('0xf6')](_0x11edbe['TrunkBackup'])?_0x11edbe[_0xf38e('0x17d')]['callerid']:_0x11edbe[_0xf38e('0x8f')]['callerid'],_0x11edbe[_0xf38e('0x180')],_0x11edbe[_0xf38e('0x181')]>0x0?utils['getCallerIdRandom'](_0x11edbe[_0xf38e('0x182')],_0x11edbe[_0xf38e('0x181')]):_0x11edbe['dialOriginateCallerIdNumber']);if(_0x563e09){_0xab0ca5[_0xf38e('0x183')]=_0x589cf3[_0xf38e('0x22')][_0x451ac9][_0xf38e('0x184')]=utils[_0xf38e('0x185')](_0x563e09);_0xab0ca5[_0xf38e('0x186')]=_0x520115[_0xf38e('0x162')];}_0x11edbe['variables']=_0xab0ca5;return ami[_0xf38e('0x9e')]({'actionid':_0x451ac9,'action':_0xf38e('0x160'),'channel':_0x589cf3[_0xf38e('0x8a')](_0x11edbe[_0xf38e('0x17d')])?util['format'](_0xf38e('0x187'),_0x11edbe[_0xf38e('0x17d')][_0xf38e('0x48')],isNotNull(_0x11edbe[_0xf38e('0x188')])?_0x11edbe[_0xf38e('0x188')][_0xf38e('0x189')]()||'':'',_0x11edbe[_0xf38e('0x18a')]>0x0?_0x520115['phone'][_0xf38e('0x18b')](_0x11edbe['dialCutDigit']):_0x520115['phone']):util[_0xf38e('0x46')]('SIP/%s/%s%s',_[_0xf38e('0xf6')](_0x11edbe[_0xf38e('0x8f')])?_0x11edbe[_0xf38e('0x17d')][_0xf38e('0x48')]:_0x11edbe[_0xf38e('0x8f')][_0xf38e('0x48')],isNotNull(_0x11edbe['dialPrefix'])?_0x11edbe[_0xf38e('0x188')][_0xf38e('0x189')]()||'':'',_0x11edbe[_0xf38e('0x18a')]>0x0?_0x520115[_0xf38e('0x162')][_0xf38e('0x18b')](_0x11edbe[_0xf38e('0x18a')]):_0x520115['phone']),'callerid':_0x563e09,'Exten':_0xf38e('0x10e'),'Context':_0xf38e('0x18c'),'Priority':'1','variable':_0xab0ca5,'timeout':(_0x11edbe['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x451ac9})[_0xf38e('0x3e')](function(_0x484703){return _0x1e37c3(_0x484703);})[_0xf38e('0xa4')](function(_0x347d93){_0x11edbe['outboundOriginateFailureCallsDay']+=0x1;var _0x558bdb=new History(_0x589cf3[_0xf38e('0x22')][_0x451ac9]);logger[_0xf38e('0x68')](util[_0xf38e('0x46')]('[originateError]:\x20%s',JSON[_0xf38e('0x7a')](_0x347d93)));_0x558bdb[_0xf38e('0x73')]=0xe;_0x558bdb[_0xf38e('0x74')]=_0xf38e('0x18d');_0x558bdb[_0xf38e('0x76')]=moment()['format'](_0xf38e('0xc8'));_0x558bdb[_0xf38e('0x75')]=_0x558bdb[_0xf38e('0x76')];hopperUtils[_0xf38e('0xe7')](_0x558bdb)['catch'](loggerCatch('[originate][error]'));_0x589cf3[_0xf38e('0x132')](_0x558bdb)['catch'](loggerCatch(_0xf38e('0x18e')))[_0xf38e('0xff')](function(){delete _0x589cf3[_0xf38e('0x22')][_0x451ac9];return _0x3fd0d1(msgResponse(_0xf38e('0x160'),_0xf38e('0xc3'),_0xf38e('0x18f')));});});});};Dialer[_0xf38e('0x18')][_0xf38e('0x190')]=function(_0x3ee7d2,_0x26e5d1,_0x534943){var _0x27c099=new History(_0x26e5d1);if(_0x27c099[_0xf38e('0x11d')]+_0x27c099[_0xf38e('0x11e')]+_0x27c099[_0xf38e('0x129')]+_0x27c099[_0xf38e('0x11f')]+_0x27c099['countdropretry']+_0x27c099['countabandonedretry']+_0x27c099[_0xf38e('0x11b')]+_0x27c099[_0xf38e('0x120')]>=_0x534943[_0xf38e('0x191')]-0x1){return!![];}switch(_0x3ee7d2){case 0x3:if(_0x27c099[_0xf38e('0x129')]>=_0x534943['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xf38e('0xee')]({'active':![],'countnoanswerretry':_0x27c099[_0xf38e('0x129')]+=0x1,'scheduledat':moment()[_0xf38e('0xde')](_0x534943['dialNoAnswerRetryFrequency'],_0xf38e('0xe0'))['format'](_0xf38e('0xc8')),'ContactId':_0x27c099[_0xf38e('0xe1')],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099[_0xf38e('0xe3')]||undefined,'CampaignId':_0x27c099['CampaignId']||undefined})['catch'](loggerCatch(_0xf38e('0x192')));break;case 0x5:if(_0x27c099[_0xf38e('0x11d')]>=_0x534943[_0xf38e('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x27c099[_0xf38e('0x11d')]+=0x1,'scheduledat':moment()['add'](_0x534943['dialBusyRetryFrequency'],_0xf38e('0xe0'))['format'](_0xf38e('0xc8')),'ContactId':_0x27c099[_0xf38e('0xe1')],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099[_0xf38e('0xe3')]||undefined,'CampaignId':_0x27c099['CampaignId']||undefined})['catch'](loggerCatch(_0xf38e('0x194')));break;case 0x8:if(_0x27c099['countcongestionretry']>=_0x534943['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xf38e('0xee')]({'active':![],'countcongestionretry':_0x27c099[_0xf38e('0x11e')]+=0x1,'scheduledat':moment()[_0xf38e('0xde')](_0x534943[_0xf38e('0x195')],'minutes')[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x27c099[_0xf38e('0xe1')],'ListId':_0x27c099['ListId'],'VoiceQueueId':_0x27c099[_0xf38e('0xe3')]||undefined,'CampaignId':_0x27c099[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x196')));break;case 0x0:if(_0x27c099[_0xf38e('0x11f')]>=_0x534943[_0xf38e('0x197')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x27c099[_0xf38e('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x534943[_0xf38e('0x198')],_0xf38e('0xe0'))[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x27c099['ContactId'],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099['VoiceQueueId']||undefined,'CampaignId':_0x27c099[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x199')));}break;case 0xa:if(_0x27c099[_0xf38e('0xd7')]>=_0x534943[_0xf38e('0xdc')]-0x1){return!![];}hopperUtils[_0xf38e('0xee')]({'active':![],'countdropretry':_0x27c099['countdropretry']+=0x1,'scheduledat':moment()[_0xf38e('0xde')](_0x534943['dialDropRetryFrequency'],'minutes')['format'](_0xf38e('0xc8')),'ContactId':_0x27c099[_0xf38e('0xe1')],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099[_0xf38e('0xe3')]||undefined,'CampaignId':_0x27c099[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x19a')));break;case 0xb:if(_0x27c099[_0xf38e('0xea')]>=_0x534943[_0xf38e('0xed')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x27c099[_0xf38e('0xea')]+=0x1,'scheduledat':moment()[_0xf38e('0xde')](_0x534943[_0xf38e('0xec')],_0xf38e('0xe0'))[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x27c099[_0xf38e('0xe1')],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099['VoiceQueueId']||undefined,'CampaignId':_0x27c099['CampaignId']||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x19b')));break;case 0x13:if(_0x27c099[_0xf38e('0x11b')]>=_0x534943[_0xf38e('0x12b')]-0x1){return!![];}hopperUtils[_0xf38e('0xee')]({'active':![],'countmachineretry':_0x27c099[_0xf38e('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x534943[_0xf38e('0x12c')],_0xf38e('0xe0'))[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x27c099[_0xf38e('0xe1')],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099['VoiceQueueId']||undefined,'CampaignId':_0x27c099[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x124')));break;case 0x14:if(_0x27c099[_0xf38e('0x120')]>=_0x534943[_0xf38e('0x19c')]-0x1){return!![];}hopperUtils[_0xf38e('0xee')]({'active':![],'countagentrejectretry':_0x27c099['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xf38e('0xde')](_0x534943['dialAgentRejectRetryFrequency'],_0xf38e('0xe0'))[_0xf38e('0x46')](_0xf38e('0xc8')),'ContactId':_0x27c099['ContactId'],'ListId':_0x27c099[_0xf38e('0xe2')],'VoiceQueueId':_0x27c099['VoiceQueueId']||undefined,'CampaignId':_0x27c099[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xf38e('0x18')][_0xf38e('0x10c')]=function(_0x298ba2,_0x246e2c,_0x4200ae){var _0x57b55a=this;var _0x496195=new History(_0x298ba2);var _0x361fc8=![];var _0x498a96;var _0x377e74;return new Promise(function(_0x1a0028,_0x5c3c05){if(_[_0xf38e('0x56')](_0x246e2c)&&typeof _0x246e2c!==_0xf38e('0x15f')){return _0x5c3c05(msgResponse(_0xf38e('0x19d'),_0xf38e('0x96'),'entity\x20is\x20undefine'));}if(_[_0xf38e('0x56')](_0x4200ae)&&typeof _0x4200ae!==_0xf38e('0x15f')){return _0x5c3c05(msgResponse(_0xf38e('0x19d'),'Failure',_0xf38e('0x19e')));}hopperUtils[_0xf38e('0xd9')](_0x496195,_0x4200ae['reason'],_0x246e2c)['then'](function(_0x461ac8){if(_0x461ac8[_0xf38e('0xdb')]==0x1)_0x361fc8=!![];switch(_0x4200ae['reason']){case'0':_0x246e2c[_0xf38e('0x19f')]+=0x1;_0x496195['state']=0x0;_0x496195[_0xf38e('0x74')]=_0xf38e('0x1a0');_0x496195[_0xf38e('0x11f')]+=0x1;_0x496195[_0xf38e('0xeb')]+=0x1;ami[_0xf38e('0x40')](_0xf38e('0x1a1'),ut[_0xf38e('0x114')](_0x298ba2,_0xf38e('0x1a2')));_0x498a96=_0x246e2c[_0xf38e('0x198')];_0x377e74=_0x246e2c['callAdditionalPhoneAfterMin'];hopperUtils[_0xf38e('0xe7')](_0x496195)['catch'](loggerCatch(_0xf38e('0x11c')));if(_0x57b55a[_0xf38e('0x190')](0x0,_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0x11f')]>=_0x246e2c['dialNoSuchNumberMaxRetry']){_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1a3'));}else{_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x246e2c[_0xf38e('0x1a4')]+=0x1;_0x496195[_0xf38e('0x73')]=0x3;_0x496195['statedesc']=_0xf38e('0x1a5');_0x496195['countnoanswerretry']+=0x1;_0x496195[_0xf38e('0xeb')]+=0x1;var _0x56beea=ut[_0xf38e('0x1a6')](_0x298ba2,_0x246e2c);ami['emit'](_0xf38e('0x1a7'),_0x56beea);_0x498a96=_0x246e2c[_0xf38e('0x1a8')];_0x377e74=_0x246e2c[_0xf38e('0xd8')];hopperUtils[_0xf38e('0xe7')](_0x496195)['catch'](loggerCatch(_0xf38e('0x1a9')));if(_0x57b55a[_0xf38e('0x190')](0x3,_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0x129')]>=_0x246e2c[_0xf38e('0x1aa')]){_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1ab'));}else{_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x246e2c[_0xf38e('0x1ac')]+=0x1;_0x496195[_0xf38e('0x73')]=0x5;_0x496195['statedesc']=_0xf38e('0x1ad');_0x496195[_0xf38e('0x11d')]+=0x1;_0x496195[_0xf38e('0xeb')]+=0x1;ami[_0xf38e('0x40')](_0xf38e('0x1ae'),ut['buildObj'](_0x298ba2,_0xf38e('0x1af')));_0x498a96=_0x246e2c['dialBusyRetryFrequency'];_0x377e74=_0x246e2c['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x496195)[_0xf38e('0xa4')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x57b55a[_0xf38e('0x190')](0x5,_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0x11d')]>=_0x246e2c['dialBusyMaxRetry']){_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1b0'));}else{_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1b0'));}}break;case'8':_0x246e2c['outboundCongestionCallsDay']+=0x1;_0x496195['state']=0x8;_0x496195[_0xf38e('0x74')]='Congestion';_0x496195[_0xf38e('0x11e')]+=0x1;_0x496195[_0xf38e('0xeb')]+=0x1;_0x498a96=_0x246e2c[_0xf38e('0x195')];_0x377e74=_0x246e2c[_0xf38e('0xd8')];ami['emit'](_0xf38e('0x1b1'),ut[_0xf38e('0x114')](_0x298ba2,'congestion'));hopperUtils['createHistory'](_0x496195)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x1b2')));if(_0x57b55a['checkRetriveMax'](0x8,_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0x11e')]>=_0x246e2c['dialCongestionMaxRetry']){_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1b3'));}else{_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1b3'));}}break;case'11':_0x246e2c['outboundAbandonedCallsDay']+=0x1;_0x496195[_0xf38e('0x73')]=0xb;_0x496195[_0xf38e('0x74')]=_0xf38e('0xe9');_0x496195[_0xf38e('0xea')]+=0x1;_0x496195[_0xf38e('0xeb')]+=0x1;_0x498a96=_0x246e2c['dialAbandonedRetryFrequency'];_0x377e74=_0x246e2c[_0xf38e('0xd8')];hopperUtils[_0xf38e('0xe7')](_0x496195)['catch'](loggerCatch(_0xf38e('0xef')));if(_0x57b55a['checkRetriveMax'](0xb,_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0xea')]>=_0x246e2c[_0xf38e('0xed')]){_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,_0xf38e('0x1b4'));}else{_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,'reason\x2011\x20abandoned');}}break;case'20':_0x246e2c[_0xf38e('0x1b5')]+=0x1;_0x496195[_0xf38e('0x73')]=0x14;_0x496195[_0xf38e('0x74')]=_0xf38e('0x1b6');_0x496195[_0xf38e('0x120')]+=0x1;_0x496195[_0xf38e('0xeb')]+=0x1;_0x498a96=_0x246e2c[_0xf38e('0x1b7')];_0x377e74=_0x246e2c[_0xf38e('0xd8')];ami[_0xf38e('0x40')](_0xf38e('0x1b8'),ut['buildObj'](_0x298ba2,_0xf38e('0x1b9')));hopperUtils['createHistory'](_0x496195)[_0xf38e('0xa4')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x57b55a['checkRetriveMax'](0x14,_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0x120')]>=_0x246e2c[_0xf38e('0x19c')]){_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,'reason\x2020\x20agentreject');}else{_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,'reason\x2020\x20agentreject');}}break;default:_0x246e2c[_0xf38e('0x133')]+=0x1;_0x496195[_0xf38e('0x73')]=0xc;_0x496195['statedesc']=_0x4200ae[_0xf38e('0xcb')];_0x498a96=_0x246e2c['dialAgentRejectRetryFrequency'];_0x377e74=_0x246e2c[_0xf38e('0xd8')];hopperUtils[_0xf38e('0xe7')](_0x496195)[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x1ba')));if(_0x57b55a[_0xf38e('0x190')](_0x4200ae[_0xf38e('0xcb')],_0x298ba2,_0x246e2c)&&!_0x361fc8){if(_0x496195[_0xf38e('0x11d')]+_0x496195[_0xf38e('0x11e')]+_0x496195['countnoanswerretry']+_0x496195[_0xf38e('0x11f')]+_0x496195['countdropretry']+_0x496195[_0xf38e('0xea')]+_0x496195[_0xf38e('0x11b')]+_0x496195['countagentrejectretry']>=_0x246e2c[_0xf38e('0x191')]){_0x57b55a[_0xf38e('0x12a')](_0x496195,_0x1a0028,_0x5c3c05,_0x4200ae[_0xf38e('0xcb')]);}else{_0x57b55a[_0xf38e('0x122')](_0x496195,_0x1a0028,_0x5c3c05,_0x4200ae[_0xf38e('0xcb')]);}}}})[_0xf38e('0x3e')](function(){if(_0x361fc8){hopperUtils[_0xf38e('0xf0')](_0x496195,_0x498a96,_0x377e74)['then'](function(){return _0x1a0028(0x1);});}});});};Dialer['prototype'][_0xf38e('0x12a')]=function(_0x2a3b8b,_0xf0a817,_0x28f280,_0x313ad3){var _0x18c2a2=new Final(_0x2a3b8b);_0x18c2a2[_0xf38e('0x73')]=0xf;_0x18c2a2[_0xf38e('0x74')]=_0xf38e('0x1bb');this['createStateFinal'](_0x18c2a2,_0xf0a817,_0x28f280,_0x313ad3);};Dialer['prototype'][_0xf38e('0x122')]=function(_0x2e9ebf,_0x2a5962,_0x306786,_0x5ee894){hopperUtils['moveContactManagedDialer'](_0x2e9ebf)[_0xf38e('0x3e')](function(){return _0x2a5962(msgResponse('[callProgressDetecting]',_0xf38e('0x1bc'),_0x5ee894));})[_0xf38e('0xa4')](function(){return _0x306786(msgResponse(_0xf38e('0x1bd'),_0xf38e('0x96'),'contact\x20not\x20moved'));});};Dialer[_0xf38e('0x18')][_0xf38e('0x8')]=function(_0x49307e){var _0x2992f7=_0x49307e[_0xf38e('0x1be')]/0x64;var _0x855cad=_0x49307e[_0xf38e('0xd2')]/(_0x49307e[_0xf38e('0xd2')]+_0x49307e['outboundAnswerCallsDay']);var _0x277053=Math[_0xf38e('0x1bf')](_0x49307e[_0xf38e('0x1c0')]*(_0x49307e[_0xf38e('0x1c1')]/0x64));var _0x2faa17=Math[_0xf38e('0x1bf')](_0x49307e[_0xf38e('0x1c0')]*(_0x49307e[_0xf38e('0x1c2')]/0x64));var _0x335625=_0x49307e[_0xf38e('0x139')]+_0x49307e[_0xf38e('0x13b')];var _0x220a1d=Math[_0xf38e('0x1c3')](_0x49307e[_0xf38e('0x5b')]*_0x49307e[_0xf38e('0x1c4')]*_0x49307e[_0xf38e('0x1c5')]*_0x49307e[_0xf38e('0x1c6')]);if(_[_0xf38e('0x56')](_0x49307e[_0xf38e('0x25')])){if(!_[_0xf38e('0x56')](_0x49307e[_0xf38e('0x65')])){_0x49307e[_0xf38e('0x65')]=undefined;loggerPredictive[_0xf38e('0x68')](_0xf38e('0x1c7'),_0xf38e('0x1c8'));}if(!_[_0xf38e('0x56')](_0x49307e[_0xf38e('0x67')])){loggerPredictive[_0xf38e('0x68')](_0xf38e('0x1c7'),_0xf38e('0x1c9'));clearInterval(_0x49307e['handlePredictive']);_0x49307e[_0xf38e('0x67')]=undefined;}_0x49307e[_0xf38e('0x25')]=moment()[_0xf38e('0x46')](_0xf38e('0xc8'));loggerPredictive[_0xf38e('0x4b')](_0x49307e[_0xf38e('0x48')],'collection\x20data\x20in\x20progressive\x20at',_0x49307e[_0xf38e('0x25')]);this[_0xf38e('0xba')](_0x49307e,0x1);}else if(ifInterval(_0x49307e[_0xf38e('0x1ca')],_0x49307e[_0xf38e('0x25')])){this[_0xf38e('0xba')](_0x49307e,0x1);loggerPredictiveCalls[_0xf38e('0x4b')]('[startMethodPredictive][StartProgressive][Loop]',_0x49307e[_0xf38e('0x25')],_0x49307e[_0xf38e('0x48')]);_0x49307e[_0xf38e('0x5b')]=0x0;_0x49307e[_0xf38e('0xd3')]=0x0;}else if(_0x2992f7<_0x855cad&&_0x49307e[_0xf38e('0x1cb')]==='dropRate'){clearPredictiveAttributes(_0x49307e);loggerPredictive[_0xf38e('0x4b')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xf38e('0x1cc'),_0x855cad,'startProgressive',_0x49307e[_0xf38e('0x48')]);}else if(_0x220a1d<_0x49307e[_0xf38e('0xd3')]&&_0x49307e[_0xf38e('0x1cb')]==='dropRate'){clearPredictiveAttributes(_0x49307e);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x1cd'),_0xf38e('0x1ce'),_0x220a1d,_0xf38e('0x1cf'),_0x49307e[_0xf38e('0xd3')],'startProgressive',_0x49307e[_0xf38e('0x48')]);}else if(!ifInterval(_0x49307e['dialPredictiveInterval'],_0x49307e['startProgressive'])&&_[_0xf38e('0x56')](_0x49307e[_0xf38e('0x65')])&&!_['isUndefined'](_0x49307e[_0xf38e('0x25')])){_0x49307e['startPredictive']=moment()['format'](_0xf38e('0xc8'));loggerPredictive['info'](_0x49307e['name'],_0xf38e('0x1d0'),_0x49307e[_0xf38e('0x65')]);hopperUtils[_0xf38e('0x1d1')](_0x49307e[_0xf38e('0x1ca')])[_0xf38e('0x3e')](this[_0xf38e('0x1d2')](_0x49307e))['then'](mergeDataErlangB(_0x49307e))[_0xf38e('0x3e')](this[_0xf38e('0x1d3')](_0x49307e))[_0xf38e('0xa4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x49307e));}else if(!ifInterval(_0x49307e['dialPredictiveInterval'],_0x49307e['startPredictive'])){_0x49307e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x49307e[_0xf38e('0x65')]=moment()[_0xf38e('0x46')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x49307e[_0xf38e('0x48')],_0xf38e('0x1d4'),_0x49307e[_0xf38e('0x65')]);clearInterval(_0x49307e[_0xf38e('0x67')]);_0x49307e[_0xf38e('0x67')]=undefined;hopperUtils['avgHandleTime'](_0x49307e[_0xf38e('0x1ca')])[_0xf38e('0x3e')](this[_0xf38e('0x1d2')](_0x49307e))[_0xf38e('0x3e')](mergeDataErlangB(_0x49307e))[_0xf38e('0x3e')](this[_0xf38e('0x1d3')](_0x49307e))[_0xf38e('0xa4')](loggerCatchPredictive(_0xf38e('0x1d5'),_0x49307e));}else if(_0x49307e[_0xf38e('0x1c0')]&&_0x335625<_0x49307e[_0xf38e('0x1c0')]-_0x2faa17){clearPredictiveAttributes(_0x49307e);loggerPredictive[_0xf38e('0x4b')](_0x49307e['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x335625,_0xf38e('0x1d6'),_0x49307e[_0xf38e('0x1c0')],'-',_0x2faa17,'=',_0x49307e[_0xf38e('0x1c0')]-_0x2faa17,')');}else if(_0x49307e['predictiveIntervalAvailable']&&_0x335625>_0x49307e['predictiveIntervalAvailable']+_0x277053){clearPredictiveAttributes(_0x49307e);loggerPredictive[_0xf38e('0x4b')](_0x49307e[_0xf38e('0x48')],_0xf38e('0x1d7'),_0x335625,_0xf38e('0x1d8'),_0x49307e[_0xf38e('0x1c0')],'+',_0x277053,'=',_0x49307e[_0xf38e('0x1c0')]+_0x277053,')');}};Dialer[_0xf38e('0x18')][_0xf38e('0x1d2')]=function(_0x44fbea){var _0x2bc634=this;return function(_0x525a99){return new Promise(function(_0xf438e4,_0x16c1f){_[_0xf38e('0x62')](_0x44fbea,_0x525a99[0x0]);if(checkGetDataPredictive(_0x525a99[0x0])){var _0x20b5b8=_0x44fbea[_0xf38e('0x1c0')]=_0x44fbea['talking']+_0x44fbea[_0xf38e('0x139')];var _0x349b7d=_0x44fbea['dialPredictiveInterval']*0x3c;var _0x49a48e=_0x525a99[0x0][_0xf38e('0x54')]+_0x525a99[0x0]['predictiveIntervalAvgHoldtime'];var _0x591f66=(_0x525a99[0x0]['predictiveIntervalAnsweredCalls']+_0x525a99[0x0][_0xf38e('0x4f')]+_0x525a99[0x0][_0xf38e('0x51')])/_0x525a99[0x0][_0xf38e('0x4d')];_0x44fbea[_0xf38e('0x1c5')]=_0x591f66>0x0?_0x591f66:0x1;switch(_0x44fbea[_0xf38e('0x1cb')]){case _0xf38e('0x1d9'):var _0x229d76=_0x44fbea[_0xf38e('0x1be')]/0x64;return _0x2bc634['abandonmentRate'](_0x20b5b8,_0x349b7d,_0x49a48e,_0x591f66,_0x229d76)[_0xf38e('0x3e')](function(_0x447535){return _0xf438e4(_0x447535);});case'agentBusyFactor':var _0x437cba=_0x44fbea[_0xf38e('0x1be')]/0x64;return _0x2bc634[_0xf38e('0x1da')](_0x20b5b8,_0x349b7d,_0x49a48e,_0x591f66,_0x437cba)[_0xf38e('0x3e')](function(_0x3bbf2a){return _0xf438e4(_0x3bbf2a);});default:return _0x16c1f(msgResponse('[getDataPredictive]',_0xf38e('0x96'),'Unknown\x20Predictive'));}}else{return _0x16c1f(msgResponse('[getDataPredictive]','Failure',_0xf38e('0x1db')));}});};};Dialer[_0xf38e('0x18')]['getDataPredictiveOld']=function(_0x4ba4e0){var _0x48f3d6=this;return function(_0x409b15){return new Promise(function(_0x57fc2c,_0xcf2883){_['merge'](_0x4ba4e0,_0x409b15[0x0]);if(checkGetDataPredictive(_0x409b15[0x0])){loggerPredictive[_0xf38e('0x4b')](JSON[_0xf38e('0x7a')](_0x409b15[0x0]));if(_0x4ba4e0[_0xf38e('0x1cb')]===_0xf38e('0x1d9')){return _0x48f3d6[_0xf38e('0x153')](_0x4ba4e0['id'])['then'](function(_0xa8ef16){var _0x8d8d10=_0x4ba4e0[_0xf38e('0x1dc')]-_0xa8ef16[0x0][_0xf38e('0x1dd')];var _0x5e4178=_0x4ba4e0[_0xf38e('0x1ca')]*0x3c;var _0x1ec89a=_0x409b15[0x0][_0xf38e('0x54')]+_0x409b15[0x0]['predictiveIntervalAvgHoldtime'];var _0x5ed9fe=(_0x409b15[0x0][_0xf38e('0x4e')]+_0x409b15[0x0][_0xf38e('0x4f')]+_0x409b15[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x409b15[0x0][_0xf38e('0x4d')];var _0x3f8684=_0x4ba4e0[_0xf38e('0x1be')]/0x64;_0x4ba4e0[_0xf38e('0x1de')]=_0xa8ef16[0x0]['outboundQueuePauses']||0x0;_0x4ba4e0[_0xf38e('0x1c5')]=_0x5ed9fe>0x0?_0x5ed9fe:0x1;return _0x48f3d6['abandonmentRate'](_0x8d8d10,_0x5e4178,_0x1ec89a,_0x5ed9fe,_0x3f8684);})[_0xf38e('0x3e')](function(_0x3e8440){return _0x57fc2c(_0x3e8440);})[_0xf38e('0xa4')](function(_0x337675){return _0xcf2883(msgResponse(_0xf38e('0x1df'),'Failure',JSON[_0xf38e('0x7a')](_0x337675)));});}if(_0x4ba4e0['dialPredictiveOptimization']===_0xf38e('0x1e0')){return _0x48f3d6[_0xf38e('0x153')](_0x4ba4e0['id'])[_0xf38e('0x3e')](function(_0x3bd596){var _0x3e323c=_0x4ba4e0['loggedIn']-_0x3bd596[0x0]['outboundQueuePauses'];var _0x327b80=_0x4ba4e0[_0xf38e('0x1ca')]*0x3c;var _0x366a54=_0x409b15[0x0]['predictiveIntervalAvgTalktime']+_0x409b15[0x0][_0xf38e('0x52')];var _0x21e794=(_0x409b15[0x0][_0xf38e('0x4e')]+_0x409b15[0x0][_0xf38e('0x4f')]+_0x409b15[0x0][_0xf38e('0x51')])/_0x409b15[0x0][_0xf38e('0x4d')];var _0x14d098=_0x4ba4e0[_0xf38e('0x1be')]/0x64;_0x4ba4e0['predictiveIntervalPauses']=_0x3bd596[0x0][_0xf38e('0x1dd')]||0x0;_0x4ba4e0[_0xf38e('0x1c5')]=_0x21e794>0x0?_0x21e794:0x1;return _0x48f3d6[_0xf38e('0x1da')](_0x3e323c,_0x327b80,_0x366a54,_0x21e794,_0x14d098);})['then'](function(_0x5bd78c){return _0x57fc2c(_0x5bd78c);})[_0xf38e('0xa4')](function(_0x2a4062){return _0xcf2883(msgResponse(_0xf38e('0x1df'),_0xf38e('0x96'),JSON[_0xf38e('0x7a')](_0x2a4062)));});}}else{return _0xcf2883(msgResponse('[getDataPredictive]',_0xf38e('0x96'),'check\x20failure'));}});};};Dialer[_0xf38e('0x18')][_0xf38e('0x1d3')]=function(_0x446904){var _0x2193fe=this;return function(){var _0x13b9b8=0x0;var _0x40b453=Math[_0xf38e('0x1c3')](_0x446904['erlangCallToSecond']*0x3e8);if(_0x40b453>0x0){_0x40b453=_0x40b453<0x64?0x64:_0x40b453;loggerPredictive[_0xf38e('0x4b')](_0x446904[_0xf38e('0x48')],_0xf38e('0x1e1'),_0x40b453,_0xf38e('0x1e2'));_0x446904[_0xf38e('0x67')]=setInterval(function(){_0x2193fe[_0xf38e('0x67')](_0x446904);loggerPredictiveCalls[_0xf38e('0x4b')](_0xf38e('0x1e3'),_0x13b9b8+=0x1);},_0x40b453);}else{loggerPredictive[_0xf38e('0x4b')](_0x446904['name'],_0xf38e('0x1e4'));}};};Dialer[_0xf38e('0x18')][_0xf38e('0x1e5')]=function(_0x46a6dd,_0x2bfa18){var _0x42e91d=this;return function(_0x1c1a76){if(_[_0xf38e('0x4a')](_0x1c1a76)){if(_[_0xf38e('0xf6')](_0x2bfa18['UserId'])||!_0x2bfa18['recallme']){if(_0x46a6dd[_0xf38e('0xb7')]===_0xf38e('0x7')){_0x46a6dd['queueStatusComplete']=_['isUndefined'](_0x46a6dd[_0xf38e('0x78')])?!![]:_0x46a6dd[_0xf38e('0x78')];var _0xb6b93d=uuid['v4']();_0x42e91d[_0xf38e('0x22')][_0xb6b93d]=new Action(_0x46a6dd,_0x2bfa18,_0xb6b93d);loggerBooked[_0xf38e('0x4b')]('[booked][checkContactBlack]',_0xb6b93d,_0xf38e('0x1e6'),JSON[_0xf38e('0x7a')](_0x46a6dd[_0xf38e('0x78')]),_0xf38e('0x1e7'),_0x46a6dd[_0xf38e('0x48')]);if(_0x46a6dd[_0xf38e('0x78')]){_0x46a6dd[_0xf38e('0x78')]=![];_0x42e91d['queueBooked'][_0x42e91d[_0xf38e('0x22')][_0xb6b93d][_0xf38e('0xc4')]]=[];ami['Action']({'actionid':_0xb6b93d,'action':_0xf38e('0x1e8'),'queue':_0x46a6dd['name']})[_0xf38e('0xa4')](function(){_0x42e91d['updateOriginated'](_0x46a6dd);hopperUtils[_0xf38e('0xee')]({'active':![],'ContactId':_0x42e91d[_0xf38e('0x22')][_0xb6b93d][_0xf38e('0xe1')],'ListId':_0x42e91d[_0xf38e('0x22')][_0xb6b93d][_0xf38e('0xe2')],'VoiceQueueId':_0x42e91d['actions'][_0xb6b93d]['VoiceQueueId']||undefined,'CampaignId':_0x42e91d[_0xf38e('0x22')][_0xb6b93d]['CampaignId']||undefined})['catch'](loggerCatch(_0xf38e('0x1e9')));delete _0x42e91d[_0xf38e('0x22')][_0xb6b93d];});}else{loggerBooked[_0xf38e('0x4b')](_0xf38e('0x1ea'),JSON[_0xf38e('0x7a')](_0x46a6dd['queueStatusComplete']),_0xf38e('0x1e7'),_0x46a6dd[_0xf38e('0x48')]);_0x42e91d[_0xf38e('0xc6')](_0x46a6dd);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x42e91d['actions'][_0xb6b93d][_0xf38e('0xe1')],'ListId':_0x42e91d[_0xf38e('0x22')][_0xb6b93d][_0xf38e('0xe2')],'VoiceQueueId':_0x42e91d[_0xf38e('0x22')][_0xb6b93d][_0xf38e('0xe3')]||undefined,'CampaignId':_0x42e91d['actions'][_0xb6b93d]['CampaignId']||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x1e9')));delete _0x42e91d['actions'][_0xb6b93d];}}else{return _0x42e91d[_0xf38e('0x15e')](_0x46a6dd,_0x2bfa18);}}else{if(utils[_0xf38e('0x63')](undefined,_0x2bfa18[_0xf38e('0x1eb')])<_0x46a6dd['dialRecallMeTimeout']*0x3c){if(_0x2bfa18['Agent']&&!_0x2bfa18['Agent'][_0xf38e('0x1ec')]){_0x42e91d[_0xf38e('0x1b')][_0xf38e('0xfc')](_0x2bfa18['id'])[_0xf38e('0xff')](function(){_0x42e91d[_0xf38e('0xc6')](_0x46a6dd);});}else{hopperUtils[_0xf38e('0x1ed')]({'active':![]},_0x2bfa18['id'],0x1)[_0xf38e('0xff')](function(){_0x42e91d[_0xf38e('0xc6')](_0x46a6dd);});}}else{_0x46a6dd[_0xf38e('0x1ee')]+=0x1;_0x42e91d['updateOriginated'](_0x46a6dd);if(_0x46a6dd[_0xf38e('0x1ef')]){hopperUtils[_0xf38e('0xee')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2bfa18[_0xf38e('0xe1')],'ListId':_0x2bfa18['ListId'],'VoiceQueueId':_0x2bfa18[_0xf38e('0xe3')]||undefined,'CampaignId':_0x2bfa18[_0xf38e('0xe4')]||undefined})[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x1f0')));hopperUtils[_0xf38e('0xe7')](createObjHistory(_0x46a6dd,_0x2bfa18,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0xf38e('0x1f1')))[_0xf38e('0xa4')](loggerCatch(_0xf38e('0x1f2')));}else{_0x42e91d[_0xf38e('0x127')](createObjHistory(_0x46a6dd,_0x2bfa18,utils['CAMPAIGN_STATUS'][_0xf38e('0x1f3')],0x16,_0xf38e('0x1f4')),_0xf38e('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x46a6dd['outboundBlacklistCallsDay']+=0x1;_0x42e91d[_0xf38e('0x127')](createObjHistory(_0x46a6dd,_0x2bfa18,utils[_0xf38e('0x6d')][_0xf38e('0x1f6')],0xd,'Blacklist'),_0xf38e('0x1f7'),_0xf38e('0x1f8'));throw'inBlackList';}};};Dialer[_0xf38e('0x18')][_0xf38e('0x1f9')]=function(_0x13bab6){var _0x18d0cc=this;var _0x561677=_0x13bab6[_0xf38e('0x1fa')]-_0x13bab6[_0xf38e('0x155')];emitCampaignSummary(_0x13bab6);if(_0x561677>0x0&&_0x13bab6[_0xf38e('0x6b')]==0x0){if(_0x561677>this[_0xf38e('0x20')]){_0x561677=this[_0xf38e('0x20')];}_0x13bab6[_0xf38e('0x6b')]=0x1;hopperUtils[_0xf38e('0x1fb')](_0x13bab6,_0x561677)[_0xf38e('0x3e')](function(_0x3c088b){_0x13bab6[_0xf38e('0x6b')]=0x0;if(_0x3c088b){if(!utils[_0xf38e('0x1fc')](_0x3c088b)){_0x13bab6['message']=utils[_0xf38e('0x6d')]['NO_AVAILABLE_CONTACTS'];logger['info'](_0xf38e('0x1fd')+_0x13bab6[_0xf38e('0x48')]);}else{_0x13bab6[_0xf38e('0x155')]+=_0x3c088b['length'];_0x13bab6[_0xf38e('0x70')]=utils[_0xf38e('0x6d')]['RUNNING'];for(var _0x25f3bc=0x0;_0x25f3bc<_0x3c088b[_0xf38e('0x9c')];_0x25f3bc+=0x1){_0x13bab6['ivrTotalCallsDays']+=0x1;if(_[_0xf38e('0xf6')](_0x3c088b[_0x25f3bc])||_[_0xf38e('0xf6')](_0x3c088b[_0x25f3bc][_0xf38e('0x17c')])||_['isNil'](_0x3c088b[_0x25f3bc][_0xf38e('0x162')])){_0x18d0cc['emptyContact'](_0xf38e('0x1fe'),_0x13bab6,_0x3c088b[_0x25f3bc]);}else{hopperUtils['checkIsBlackListIvr'](_[_0xf38e('0x7b')](_0x3c088b[_0x25f3bc],[_0xf38e('0xe4'),'phone']))[_0xf38e('0x3e')](_0x18d0cc[_0xf38e('0x1e5')](_0x13bab6,_0x3c088b[_0x25f3bc]))['catch'](_0x18d0cc[_0xf38e('0x157')](_0xf38e('0x1ff'),_0x13bab6));}}}}})[_0xf38e('0xa4')](loggerGetContactDialer('[getContactCampaign2]',_0x13bab6,_0x561677));}};Dialer[_0xf38e('0x18')][_0xf38e('0xba')]=function(_0x577538,_0x3ea541){var _0x169a08=this;var _0x54d097=[];if(_0x3ea541<0x1||_0x577538[_0xf38e('0xb7')]===_0xf38e('0x7')){_0x3ea541=0x1;}var _0x12c51d=Math[_0xf38e('0x1c3')](_0x577538['available']*_0x3ea541)-_0x577538['originated'];if(_0x577538[_0xf38e('0x200')]>0x0){var _0x151419=_0x577538[_0xf38e('0x200')]-_0x577538[_0xf38e('0x155')]-_0x577538[_0xf38e('0x13b')]-_0x577538[_0xf38e('0x13c')];if(_0x12c51d>_0x151419){_0x12c51d=_0x151419;}}if(_0x12c51d>0x0&&_0x577538[_0xf38e('0x6b')]==0x0){if(_0x577538[_0xf38e('0xb7')]==='booked'){_0x12c51d=0x1;}if(_0x12c51d>this['maxNumberOriginate']){_0x12c51d=this[_0xf38e('0x20')];}for(var _0x48b6f1 in this['agents']){if(typeof this['agents'][_0x48b6f1]!==_0xf38e('0xb0')){if(this[_0xf38e('0x1e')][_0x48b6f1][_0xf38e('0x73')]===_0xf38e('0x201')&&this[_0xf38e('0x1e')][_0x48b6f1][_0xf38e('0x8c')]===_0xf38e('0x8d')){_0x54d097['push'](this[_0xf38e('0x1e')][_0x48b6f1]['id']);}}}_0x577538[_0xf38e('0x6b')]=0x1;hopperUtils['getContactDialer'](_0x577538,_0x54d097,_0x12c51d)[_0xf38e('0x3e')](function(_0x13ec7c){_0x577538[_0xf38e('0x6b')]=0x0;if(_0x13ec7c){if(!utils[_0xf38e('0x1fc')](_0x13ec7c)){hopperUtils[_0xf38e('0x202')](_0x577538)[_0xf38e('0x3e')](sendMessageReschedule(_0x577538))['catch'](loggerCatch(_0xf38e('0x203')));}else{_0x577538[_0xf38e('0x155')]+=_0x13ec7c[_0xf38e('0x9c')];_0x577538['message']=_0x577538[_0xf38e('0xb7')]==='booked'?utils[_0xf38e('0x6d')]['ACTIVE']:utils[_0xf38e('0x6d')][_0xf38e('0x204')];for(var _0x3667fb=0x0;_0x3667fb<_0x13ec7c[_0xf38e('0x9c')];_0x3667fb+=0x1){if(_[_0xf38e('0xf6')](_0x13ec7c[_0x3667fb])||_[_0xf38e('0xf6')](_0x13ec7c[_0x3667fb][_0xf38e('0x17c')])||_['isNil'](_0x13ec7c[_0x3667fb][_0xf38e('0x162')])){_0x169a08['emptyContact']('[actionOriginate]\x20',_0x577538,_0x13ec7c[_0x3667fb]);}else{hopperUtils[_0xf38e('0x205')](_[_0xf38e('0x7b')](_0x13ec7c[_0x3667fb],[_0xf38e('0xe3'),'phone']))[_0xf38e('0x3e')](_0x169a08[_0xf38e('0x1e5')](_0x577538,_0x13ec7c[_0x3667fb]))[_0xf38e('0xa4')](_0x169a08[_0xf38e('0x157')](_0xf38e('0x1fe'),_0x577538));}}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x577538,_0x12c51d));}};Dialer[_0xf38e('0x18')][_0xf38e('0x67')]=function(_0x1bb113){if(_0x1bb113[_0xf38e('0x200')]>0x0){var _0xd88eb8=_0x1bb113['dialLimitQueue']-_0x1bb113[_0xf38e('0x155')]-_0x1bb113[_0xf38e('0x13b')];if(_0xd88eb8>0x0&&_0x1bb113[_0xf38e('0x6b')]==0x0){this['tryOriginatePredictive'](_0x1bb113);}else{loggerPredictiveCalls['info'](_0xf38e('0x206'));}}else{this['tryOriginatePredictive'](_0x1bb113);}};Dialer[_0xf38e('0x18')][_0xf38e('0x207')]=function(_0x8fa9df){var _0x38ca0d=this;var _0xcea3a1=[];_0x8fa9df['originated']+=0x1;for(var _0x57bf77 in this[_0xf38e('0x1e')]){if(typeof this[_0xf38e('0x1e')][_0x57bf77]!==_0xf38e('0xb0')){if(this[_0xf38e('0x1e')][_0x57bf77][_0xf38e('0x73')]===_0xf38e('0x201')&&this['agents'][_0x57bf77]['status']===_0xf38e('0x8d')){_0xcea3a1['push'](this['agents'][_0x57bf77]['id']);}}}_0x8fa9df[_0xf38e('0x6b')]=0x1;return this[_0xf38e('0x208')](_0x8fa9df['id'],_0xcea3a1,0x1,_0x8fa9df[_0xf38e('0x209')],_0x8fa9df)['then'](function(_0x3c38e2){_0x8fa9df[_0xf38e('0x6b')]=0x1;if(_0x3c38e2){if(!utils[_0xf38e('0x1fc')](_0x3c38e2)){utils[_0xf38e('0x6a')](_0x8fa9df,0x1,0x0);return hopperUtils[_0xf38e('0x202')](_0x8fa9df)['then'](sendMessageReschedule(_0x8fa9df))[_0xf38e('0xa4')](loggerCatch('[countReScheduled]\x20'));}else{_0x8fa9df[_0xf38e('0x70')]=utils[_0xf38e('0x6d')][_0xf38e('0x204')];if(_[_0xf38e('0xf6')](_0x3c38e2[0x0])||_['isNil'](_0x3c38e2[0x0][_0xf38e('0x17c')])||_[_0xf38e('0xf6')](_0x3c38e2[0x0][_0xf38e('0x162')])){_0x38ca0d[_0xf38e('0x158')](_0xf38e('0x1fe'),_0x8fa9df,_0x3c38e2[0x0]);}else{return hopperUtils[_0xf38e('0x205')](_[_0xf38e('0x7b')](_0x3c38e2[0x0],[_0xf38e('0xe3'),'phone']))[_0xf38e('0x3e')](_0x38ca0d[_0xf38e('0x1e5')](_0x8fa9df,_0x3c38e2[0x0]))[_0xf38e('0xa4')](_0x38ca0d[_0xf38e('0x157')](_0xf38e('0x20a'),_0x8fa9df));}}}})['catch'](loggerGetContactDialer(_0xf38e('0x20b'),_0x8fa9df,0x1));};Dialer['prototype'][_0xf38e('0x20c')]=function(_0x334011,_0xaba345,_0x5b6061,_0x14de91,_0x8f4529,_0x9850ea){loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x20d'));loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x20e'),_0x334011);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x20f'),_0xaba345);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x210'),_0x5b6061);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x211'),_0x14de91);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x212'),_0x8f4529);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x61'));return new Promise(function(_0x3a0279,_0xb17c07){if(_0x334011<=0x0||isNaN(_0x334011)){return _0xb17c07(msgResponse(_0xf38e('0x213'),_0xf38e('0xc3'),_0xf38e('0x214')+_0x334011));}if(_0x5b6061<=0x0||isNaN(_0x5b6061)){return _0xb17c07(msgResponse(_0xf38e('0x213'),'Error',_0xf38e('0x215')+_0x5b6061));}if(_0x14de91<=0x0||isNaN(_0x14de91)){return _0xb17c07(msgResponse('[abandonmentRate]',_0xf38e('0xc3'),_0xf38e('0x216')+_0x14de91));}if(_0xaba345<=0x0||isNaN(_0xaba345)){return _0xb17c07(msgResponse(_0xf38e('0x213'),'Error',_0xf38e('0x217')+_0xaba345));}if(_0x8f4529<=0x0||isNaN(_0x8f4529)){return _0xb17c07(msgResponse(_0xf38e('0x213'),_0xf38e('0xc3'),'Amax\x20=\x20'+_0x8f4529));}_0x9850ea=_0x9850ea||0x0;var _0x125b80=0x1/_0x5b6061;var _0x428e26=0x0;var _0x2dc0aa=0x0;var _0x17ca35=0x0;var _0x30f8bd=0x0;for(var _0x79c4d5=0x0;_0x17ca35<_0x8f4529;_0x79c4d5+=0x1){_0x2dc0aa=_0x79c4d5/_0xaba345;_0x428e26=(_0x14de91*_0x2dc0aa+_0x9850ea)/_0x125b80;_0x17ca35=utils[_0xf38e('0x218')](_0x428e26,_0x334011);_0x30f8bd=_0x428e26/_0x334011*(0x1-utils[_0xf38e('0x218')](_0x428e26,_0x334011));}return _0x3a0279({'erlangCalls':_0x79c4d5,'erlangCallToSecond':_0xaba345/_0x79c4d5,'erlangAbandonmentRate':_0x17ca35,'erlangBusyFactor':_0x30f8bd});});};Dialer['prototype'][_0xf38e('0x1da')]=function(_0x239fbf,_0x1289bc,_0x515218,_0x47e46c,_0x55d38f,_0x22c1e2){loggerPredictive[_0xf38e('0x4b')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info']('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',_0x239fbf);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1289bc);loggerPredictive[_0xf38e('0x4b')](_0xf38e('0x210'),_0x515218);loggerPredictive[_0xf38e('0x4b')]('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',_0x47e46c);loggerPredictive['info'](_0xf38e('0x219'),_0x55d38f);loggerPredictive['info'](_0xf38e('0x61'));return new Promise(function(_0x4bdff8,_0x194e14){if(_0x239fbf<=0x0||isNaN(_0x239fbf)){return _0x194e14(msgResponse(_0xf38e('0x21a'),_0xf38e('0xc3'),_0xf38e('0x214')+_0x239fbf));}if(_0x515218<=0x0||isNaN(_0x515218)){return _0x194e14(msgResponse(_0xf38e('0x21a'),_0xf38e('0xc3'),_0xf38e('0x215')+_0x515218));}if(_0x47e46c<=0x0||isNaN(_0x47e46c)){return _0x194e14(msgResponse(_0xf38e('0x21a'),_0xf38e('0xc3'),'p\x20=\x20'+_0x47e46c));}if(_0x1289bc<=0x0||isNaN(_0x1289bc)){return _0x194e14(msgResponse(_0xf38e('0x21a'),_0xf38e('0xc3'),'interval\x20=\x20'+_0x1289bc));}if(_0x55d38f<=0x0||isNaN(_0x55d38f)){return _0x194e14(msgResponse(_0xf38e('0x21a'),'Error',_0xf38e('0x21b')+_0x55d38f));}_0x22c1e2=_0x22c1e2||0x0;var _0x58d5cc=0x1/_0x515218;var _0x3b8570=0x0;var _0x4e051b=0x0;var _0xc7717b=0x0;var _0x1e1efe=0x0;for(var _0x5d9efc=0x0;_0x1e1efe<_0x55d38f;_0x5d9efc+=0x1){_0x4e051b=_0x5d9efc/_0x1289bc;_0x3b8570=(_0x47e46c*_0x4e051b+_0x22c1e2)/_0x58d5cc;_0xc7717b=utils[_0xf38e('0x218')](_0x3b8570,_0x239fbf);_0x1e1efe=_0x3b8570/_0x239fbf*(0x1-utils[_0xf38e('0x218')](_0x3b8570,_0x239fbf));}return _0x4bdff8({'erlangCalls':_0x5d9efc,'erlangCallToSecond':_0x1289bc/_0x5d9efc,'erlangAbandonmentRate':_0xc7717b,'erlangBusyFactor':_0x1e1efe});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 6843b32..e1618c4 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92be=['name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','dialCutDigit','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x92be,0xd0));var _0xe92b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x92be[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xe92b('0x0'));var _=require(_0xe92b('0x1'));var moment=require(_0xe92b('0x2'));function checkNameSurname(_0x19a5a7,_0x14fd99,_0x572729){var _0x38b3a8='';if(!_[_0xe92b('0x3')](_0x14fd99)&&_0xe92b('0x4')===typeof _0x14fd99){_0x38b3a8+=_0x14fd99;}if(!_[_0xe92b('0x3')](_0x572729)&&'string'===typeof _0x572729){_0x38b3a8+='\x20'+_0x572729;}if(_0x38b3a8!==''){return _0x38b3a8;}return _0x19a5a7;}function Action(_0x42c4fb,_0x485175,_0x35ecf9){this[_0xe92b('0x5')]=_0x42c4fb;this[_0xe92b('0x6')]=_0x35ecf9||undefined;this[_0xe92b('0x7')]=checkNameSurname(_0x485175[_0xe92b('0x8')]['phone'],_0x485175['Contact'][_0xe92b('0x9')],_0x485175['Contact'][_0xe92b('0xa')]);this[_0xe92b('0xb')]=_0x485175[_0xe92b('0xc')];this[_0xe92b('0xd')]=_0x42c4fb[_0xe92b('0x7')];this[_0xe92b('0xe')]=_0x485175[_0xe92b('0xe')]||![];this['type']=_0x42c4fb[_0xe92b('0xf')];this[_0xe92b('0x10')]=_0x42c4fb[_0xe92b('0x10')]||0x3;this[_0xe92b('0x11')]=_0x485175[_0xe92b('0x11')];this[_0xe92b('0x12')]=_0x485175['countbusyretry'];this[_0xe92b('0x13')]=_0x485175[_0xe92b('0x13')];this[_0xe92b('0x14')]=_0x485175[_0xe92b('0x14')];this[_0xe92b('0x15')]=_0x485175[_0xe92b('0x15')];this[_0xe92b('0x16')]=_0x485175[_0xe92b('0x16')];this[_0xe92b('0x17')]=_0x485175[_0xe92b('0x17')];this['countmachineretry']=_0x485175['countmachineretry'];this['countagentrejectretry']=_0x485175[_0xe92b('0x18')];this[_0xe92b('0x19')]=_0x485175[_0xe92b('0x19')];this[_0xe92b('0x1a')]=_0x485175[_0xe92b('0x1a')];this[_0xe92b('0x1b')]=_0x485175[_0xe92b('0x1b')];this['VoiceQueueId']=_0x485175[_0xe92b('0x1c')];this[_0xe92b('0x1d')]=_0x485175[_0xe92b('0x1d')];this['idHopper']=_0x485175['id'];this[_0xe92b('0x1e')]=_0x485175[_0xe92b('0x8')][_0xe92b('0x9')]||'';this['starttime']=moment()['format'](_0xe92b('0x1f'));this[_0xe92b('0x20')]=_0x485175[_0xe92b('0x20')];this[_0xe92b('0x21')]=_0x485175[_0xe92b('0x21')];this[_0xe92b('0x22')]=_0x485175[_0xe92b('0x22')];this['recallme']=_0x485175[_0xe92b('0x23')];this[_0xe92b('0x24')]='';this[_0xe92b('0x25')]='';}Action[_0xe92b('0x26')]['getCaller']=function(){return util[_0xe92b('0x27')](_0xe92b('0x28'),this[_0xe92b('0x7')],this['voiceQueue'][_0xe92b('0x29')]>0x0?this['number']['substring'](this[_0xe92b('0x5')]['dialCutDigit']):this[_0xe92b('0xb')]);};Action[_0xe92b('0x26')]['getQueue']=function(){return this[_0xe92b('0xd')];};module[_0xe92b('0x2a')]=Action; \ No newline at end of file +var _0xccc6=['number','substring','prototype','getQueue','queue','exports','util','lodash','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xccc6,0x1b4));var _0x6ccc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xccc6[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x6ccc('0x0'));var _=require(_0x6ccc('0x1'));var moment=require('moment');function checkNameSurname(_0x49a0a4,_0xd718a9,_0x4b0f36){var _0x2a892d='';if(!_[_0x6ccc('0x2')](_0xd718a9)&&'string'===typeof _0xd718a9){_0x2a892d+=_0xd718a9;}if(!_[_0x6ccc('0x2')](_0x4b0f36)&&_0x6ccc('0x3')===typeof _0x4b0f36){_0x2a892d+='\x20'+_0x4b0f36;}if(_0x2a892d!==''){return _0x2a892d;}return _0x49a0a4;}function Action(_0x2e48f6,_0x2d4574,_0x3a31ae){this[_0x6ccc('0x4')]=_0x2e48f6;this['uniqueid']=_0x3a31ae||undefined;this[_0x6ccc('0x5')]=checkNameSurname(_0x2d4574[_0x6ccc('0x6')][_0x6ccc('0x7')],_0x2d4574[_0x6ccc('0x6')][_0x6ccc('0x8')],_0x2d4574[_0x6ccc('0x6')][_0x6ccc('0x9')]);this['number']=_0x2d4574[_0x6ccc('0x7')];this['queue']=_0x2e48f6['name'];this[_0x6ccc('0xa')]=_0x2d4574[_0x6ccc('0xa')]||![];this['type']=_0x2e48f6[_0x6ccc('0xb')];this['dialQueueTimeout']=_0x2e48f6['dialQueueTimeout']||0x3;this[_0x6ccc('0xc')]=_0x2d4574['scheduledat'];this[_0x6ccc('0xd')]=_0x2d4574[_0x6ccc('0xd')];this[_0x6ccc('0xe')]=_0x2d4574[_0x6ccc('0xe')];this[_0x6ccc('0xf')]=_0x2d4574[_0x6ccc('0xf')];this['countnosuchnumberretry']=_0x2d4574['countnosuchnumberretry'];this[_0x6ccc('0x10')]=_0x2d4574['countdropretry'];this[_0x6ccc('0x11')]=_0x2d4574[_0x6ccc('0x11')];this[_0x6ccc('0x12')]=_0x2d4574[_0x6ccc('0x12')];this[_0x6ccc('0x13')]=_0x2d4574[_0x6ccc('0x13')];this['ContactId']=_0x2d4574[_0x6ccc('0x14')];this[_0x6ccc('0x15')]=_0x2d4574[_0x6ccc('0x15')];this['UserId']=_0x2d4574['UserId'];this[_0x6ccc('0x16')]=_0x2d4574[_0x6ccc('0x16')];this[_0x6ccc('0x17')]=_0x2d4574[_0x6ccc('0x17')];this[_0x6ccc('0x18')]=_0x2d4574['id'];this['ContactFirstName']=_0x2d4574['Contact'][_0x6ccc('0x8')]||'';this[_0x6ccc('0x19')]=moment()[_0x6ccc('0x1a')](_0x6ccc('0x1b'));this[_0x6ccc('0x1c')]=_0x2d4574[_0x6ccc('0x1c')];this['callbackuniqueid']=_0x2d4574[_0x6ccc('0x1d')];this[_0x6ccc('0x1e')]=_0x2d4574['callbackat'];this[_0x6ccc('0x1f')]=_0x2d4574['recallme'];this[_0x6ccc('0x20')]='';this[_0x6ccc('0x21')]='';}Action['prototype'][_0x6ccc('0x22')]=function(){return util[_0x6ccc('0x1a')](_0x6ccc('0x23'),this[_0x6ccc('0x5')],this[_0x6ccc('0x4')][_0x6ccc('0x24')]>0x0?this[_0x6ccc('0x25')][_0x6ccc('0x26')](this['voiceQueue']['dialCutDigit']):this[_0x6ccc('0x25')]);};Action[_0x6ccc('0x27')][_0x6ccc('0x28')]=function(){return this[_0x6ccc('0x29')];};module[_0x6ccc('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index e5511f6..a34a847 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f7e=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x68a262,_0x14927d){var _0x9ff2f9=function(_0x400ee3){while(--_0x400ee3){_0x68a262['push'](_0x68a262['shift']());}};_0x9ff2f9(++_0x14927d);}(_0x7f7e,0x16c));var _0xe7f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f7e[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xe7f7('0x0'));var utils=require(_0xe7f7('0x1'));function AgentComplete(_0x577085,_0x59ab6b){this[_0xe7f7('0x2')]=0x4;this[_0xe7f7('0x3')]=_0xe7f7('0x4');this['scheduledat']=_0x577085['scheduledat'];this[_0xe7f7('0x5')]=_0x577085['type'];this[_0xe7f7('0x6')]=_0x577085[_0xe7f7('0x5')]===_0xe7f7('0x7')?_0xe7f7('0x8'):_0x577085[_0xe7f7('0x5')];this[_0xe7f7('0x9')]=_0x577085[_0xe7f7('0x9')];this['countcongestionretry']=_0x577085[_0xe7f7('0xa')];this[_0xe7f7('0xb')]=_0x577085['countnoanswerretry'];this[_0xe7f7('0xc')]=_0x577085['countbusyretry']+_0x577085[_0xe7f7('0xa')]+_0x577085[_0xe7f7('0xb')]+_0x577085[_0xe7f7('0xd')]+_0x577085[_0xe7f7('0xe')]+_0x577085[_0xe7f7('0xf')]+_0x577085[_0xe7f7('0x10')]+_0x577085[_0xe7f7('0x11')];this['countnosuchnumberretry']=_0x577085[_0xe7f7('0xd')];this['countdropretry']=_0x577085['countdropretry'];this[_0xe7f7('0xf')]=_0x577085[_0xe7f7('0xf')];this['countmachineretry']=_0x577085['countmachineretry'];this[_0xe7f7('0x11')]=_0x577085[_0xe7f7('0x11')];this[_0xe7f7('0x12')]=_0x59ab6b[_0xe7f7('0x12')];this[_0xe7f7('0x13')]=_0x577085['name'];this[_0xe7f7('0x14')]=_0x577085[_0xe7f7('0x15')];this[_0xe7f7('0x16')]=_0x577085[_0xe7f7('0x16')];this[_0xe7f7('0x17')]=_0x577085[_0xe7f7('0x17')];this[_0xe7f7('0x18')]=_0x577085[_0xe7f7('0x18')];this['endtime']=moment()[_0xe7f7('0x19')](_0xe7f7('0x1a'));this[_0xe7f7('0x1b')]=utils[_0xe7f7('0x1c')](_0x577085[_0xe7f7('0x17')],_0x577085[_0xe7f7('0x16')]);this['holdtime']=utils[_0xe7f7('0x1c')](_0x577085[_0xe7f7('0x18')],_0x577085[_0xe7f7('0x17')]);this[_0xe7f7('0x1d')]=utils[_0xe7f7('0x1c')](this[_0xe7f7('0x1e')],_0x577085[_0xe7f7('0x18')]);this[_0xe7f7('0x8')]=_0x59ab6b['queue'];this[_0xe7f7('0x1f')]=_0x59ab6b[_0xe7f7('0x1f')];this[_0xe7f7('0x20')]=_0x59ab6b['reason'];this[_0xe7f7('0x21')]=_0x577085['callback'];this['callbackuniqueid']=_0x577085[_0xe7f7('0x22')];this[_0xe7f7('0x23')]=_0x577085[_0xe7f7('0x23')];this[_0xe7f7('0x24')]=_0x577085[_0xe7f7('0x24')];this['ContactId']=_0x577085[_0xe7f7('0x25')];this[_0xe7f7('0x26')]=_0x577085['ListId'];this[_0xe7f7('0x27')]=_0x577085[_0xe7f7('0x27')];this[_0xe7f7('0x28')]=_0x577085['VoiceQueueId'];this[_0xe7f7('0x29')]=_0x577085[_0xe7f7('0x29')];this[_0xe7f7('0x2a')]=_0x577085['originatecalleridnum']||'';this[_0xe7f7('0x2b')]=_0x577085['originatecalleridname']||'';this['agiafterat']=_0x577085[_0xe7f7('0x2c')];}module['exports']=AgentComplete; \ No newline at end of file +var _0xd24e=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','calleridname','name','number'];(function(_0x55dff9,_0x4af92e){var _0x1829ea=function(_0x2475ca){while(--_0x2475ca){_0x55dff9['push'](_0x55dff9['shift']());}};_0x1829ea(++_0x4af92e);}(_0xd24e,0x113));var _0xed24=function(_0x2be23c,_0x3d83f0){_0x2be23c=_0x2be23c-0x0;var _0x28bf07=_0xd24e[_0x2be23c];return _0x28bf07;};'use strict';var moment=require(_0xed24('0x0'));var utils=require(_0xed24('0x1'));function AgentComplete(_0xbca92e,_0x51d761){this[_0xed24('0x2')]=0x4;this[_0xed24('0x3')]='Answer';this[_0xed24('0x4')]=_0xbca92e[_0xed24('0x4')];this[_0xed24('0x5')]=_0xbca92e[_0xed24('0x5')];this['campaigntype']=_0xbca92e[_0xed24('0x5')]===_0xed24('0x6')?_0xed24('0x7'):_0xbca92e[_0xed24('0x5')];this['countbusyretry']=_0xbca92e[_0xed24('0x8')];this[_0xed24('0x9')]=_0xbca92e[_0xed24('0x9')];this[_0xed24('0xa')]=_0xbca92e[_0xed24('0xa')];this['countglobal']=_0xbca92e['countbusyretry']+_0xbca92e[_0xed24('0x9')]+_0xbca92e['countnoanswerretry']+_0xbca92e['countnosuchnumberretry']+_0xbca92e['countdropretry']+_0xbca92e['countabandonedretry']+_0xbca92e[_0xed24('0xb')]+_0xbca92e[_0xed24('0xc')];this[_0xed24('0xd')]=_0xbca92e[_0xed24('0xd')];this[_0xed24('0xe')]=_0xbca92e[_0xed24('0xe')];this[_0xed24('0xf')]=_0xbca92e[_0xed24('0xf')];this[_0xed24('0xb')]=_0xbca92e[_0xed24('0xb')];this[_0xed24('0xc')]=_0xbca92e[_0xed24('0xc')];this['uniqueid']=_0x51d761['uniqueid'];this[_0xed24('0x10')]=_0xbca92e[_0xed24('0x11')];this['calleridnum']=_0xbca92e[_0xed24('0x12')];this['starttime']=_0xbca92e[_0xed24('0x13')];this[_0xed24('0x14')]=_0xbca92e[_0xed24('0x14')];this[_0xed24('0x15')]=_0xbca92e[_0xed24('0x15')];this[_0xed24('0x16')]=moment()[_0xed24('0x17')](_0xed24('0x18'));this[_0xed24('0x19')]=utils[_0xed24('0x1a')](_0xbca92e[_0xed24('0x14')],_0xbca92e[_0xed24('0x13')]);this[_0xed24('0x1b')]=utils[_0xed24('0x1a')](_0xbca92e['answertime'],_0xbca92e[_0xed24('0x14')]);this['talktime']=utils['getSeconds'](this[_0xed24('0x16')],_0xbca92e[_0xed24('0x15')]);this[_0xed24('0x7')]=_0x51d761['queue'];this[_0xed24('0x1c')]=_0x51d761['membername'];this[_0xed24('0x1d')]=_0x51d761[_0xed24('0x1d')];this[_0xed24('0x1e')]=_0xbca92e[_0xed24('0x1e')];this[_0xed24('0x1f')]=_0xbca92e[_0xed24('0x1f')];this[_0xed24('0x20')]=_0xbca92e[_0xed24('0x20')];this[_0xed24('0x21')]=_0xbca92e[_0xed24('0x21')];this[_0xed24('0x22')]=_0xbca92e['ContactId'];this[_0xed24('0x23')]=_0xbca92e['ListId'];this['UserId']=_0xbca92e[_0xed24('0x24')];this[_0xed24('0x25')]=_0xbca92e[_0xed24('0x25')];this[_0xed24('0x26')]=_0xbca92e[_0xed24('0x26')];this['originatecalleridnum']=_0xbca92e['originatecalleridnum']||'';this[_0xed24('0x27')]=_0xbca92e[_0xed24('0x27')]||'';this[_0xed24('0x28')]=_0xbca92e[_0xed24('0x28')];}module[_0xed24('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index d62bb18..ffb781c 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd4c=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry'];(function(_0x5e0774,_0x4a9a98){var _0x448826=function(_0x397b81){while(--_0x397b81){_0x5e0774['push'](_0x5e0774['shift']());}};_0x448826(++_0x4a9a98);}(_0xcd4c,0x66));var _0xccd4=function(_0x152a72,_0x11fdd9){_0x152a72=_0x152a72-0x0;var _0x187c88=_0xcd4c[_0x152a72];return _0x187c88;};'use strict';function Final(_0x2b01b7){this[_0xccd4('0x0')]=_0x2b01b7[_0xccd4('0x0')];this[_0xccd4('0x1')]=_0x2b01b7['scheduledat'];this[_0xccd4('0x2')]=_0x2b01b7[_0xccd4('0x2')];this[_0xccd4('0x3')]=_0x2b01b7[_0xccd4('0x2')]===_0xccd4('0x4')?'queue':_0x2b01b7[_0xccd4('0x2')];this[_0xccd4('0x5')]=_0x2b01b7[_0xccd4('0x5')];this[_0xccd4('0x6')]=_0x2b01b7[_0xccd4('0x6')];this[_0xccd4('0x7')]=_0x2b01b7[_0xccd4('0x7')];this[_0xccd4('0x8')]=_0x2b01b7[_0xccd4('0x5')]+_0x2b01b7[_0xccd4('0x6')]+_0x2b01b7['countnoanswerretry']+_0x2b01b7[_0xccd4('0x9')]+_0x2b01b7['countdropretry']+_0x2b01b7[_0xccd4('0xa')]+_0x2b01b7['countmachineretry']+_0x2b01b7[_0xccd4('0xb')];this[_0xccd4('0x9')]=_0x2b01b7[_0xccd4('0x9')];this[_0xccd4('0xc')]=_0x2b01b7[_0xccd4('0xc')];this[_0xccd4('0xa')]=_0x2b01b7[_0xccd4('0xa')];this[_0xccd4('0xd')]=_0x2b01b7[_0xccd4('0xd')];this[_0xccd4('0xb')]=_0x2b01b7[_0xccd4('0xb')];this[_0xccd4('0xe')]=_0x2b01b7[_0xccd4('0xe')];this[_0xccd4('0xf')]=_0x2b01b7[_0xccd4('0xf')];this[_0xccd4('0x10')]=_0x2b01b7[_0xccd4('0x10')];this['starttime']=_0x2b01b7[_0xccd4('0x11')];this[_0xccd4('0x12')]=_0x2b01b7['responsetime'];this[_0xccd4('0x13')]=_0x2b01b7['responsetime'];this[_0xccd4('0x14')]=_0x2b01b7['ringtime']||0x0;this[_0xccd4('0x15')]=_0x2b01b7[_0xccd4('0x15')]||0x0;this[_0xccd4('0x16')]=_0x2b01b7[_0xccd4('0x16')]||0x0;this[_0xccd4('0x17')]=_0x2b01b7[_0xccd4('0x17')];this['callbackuniqueid']=_0x2b01b7[_0xccd4('0x18')];this[_0xccd4('0x19')]=_0x2b01b7['callbackat'];this['recallme']=_0x2b01b7['recallme'];this[_0xccd4('0x1a')]=_0x2b01b7[_0xccd4('0x1a')];this[_0xccd4('0x1b')]=_0x2b01b7[_0xccd4('0x1b')];this[_0xccd4('0x1c')]=_0x2b01b7['UserId'];this[_0xccd4('0x1d')]=_0x2b01b7['VoiceQueueId'];this[_0xccd4('0x1e')]=_0x2b01b7[_0xccd4('0x1e')];this[_0xccd4('0x1f')]=_0x2b01b7['originatecalleridnum']||'';this[_0xccd4('0x20')]=_0x2b01b7['originatecalleridname']||'';this[_0xccd4('0x21')]=_0x2b01b7[_0xccd4('0x21')];this['statedesc']=_0x2b01b7[_0xccd4('0x22')];}module[_0xccd4('0x23')]=Final; \ No newline at end of file +var _0xc2ab=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xc2ab,0x17b));var _0xbc2a=function(_0x35aeb5,_0x4e8855){_0x35aeb5=_0x35aeb5-0x0;var _0x18fcec=_0xc2ab[_0x35aeb5];return _0x18fcec;};'use strict';function Final(_0x38aae6){this[_0xbc2a('0x0')]=_0x38aae6[_0xbc2a('0x0')];this[_0xbc2a('0x1')]=_0x38aae6['scheduledat'];this[_0xbc2a('0x2')]=_0x38aae6[_0xbc2a('0x2')];this[_0xbc2a('0x3')]=_0x38aae6['type']===_0xbc2a('0x4')?'queue':_0x38aae6['type'];this[_0xbc2a('0x5')]=_0x38aae6[_0xbc2a('0x5')];this['countcongestionretry']=_0x38aae6[_0xbc2a('0x6')];this['countnoanswerretry']=_0x38aae6[_0xbc2a('0x7')];this[_0xbc2a('0x8')]=_0x38aae6['countbusyretry']+_0x38aae6['countcongestionretry']+_0x38aae6[_0xbc2a('0x7')]+_0x38aae6['countnosuchnumberretry']+_0x38aae6[_0xbc2a('0x9')]+_0x38aae6[_0xbc2a('0xa')]+_0x38aae6['countmachineretry']+_0x38aae6[_0xbc2a('0xb')];this[_0xbc2a('0xc')]=_0x38aae6[_0xbc2a('0xc')];this[_0xbc2a('0x9')]=_0x38aae6[_0xbc2a('0x9')];this[_0xbc2a('0xa')]=_0x38aae6[_0xbc2a('0xa')];this['countmachineretry']=_0x38aae6[_0xbc2a('0xd')];this[_0xbc2a('0xb')]=_0x38aae6[_0xbc2a('0xb')];this[_0xbc2a('0xe')]=_0x38aae6[_0xbc2a('0xe')];this[_0xbc2a('0xf')]=_0x38aae6[_0xbc2a('0xf')];this[_0xbc2a('0x10')]=_0x38aae6['calleridnum'];this['starttime']=_0x38aae6[_0xbc2a('0x11')];this[_0xbc2a('0x12')]=_0x38aae6[_0xbc2a('0x12')];this['endtime']=_0x38aae6[_0xbc2a('0x12')];this[_0xbc2a('0x13')]=_0x38aae6[_0xbc2a('0x13')]||0x0;this[_0xbc2a('0x14')]=_0x38aae6[_0xbc2a('0x14')]||0x0;this['talktime']=_0x38aae6[_0xbc2a('0x15')]||0x0;this['callback']=_0x38aae6[_0xbc2a('0x16')];this[_0xbc2a('0x17')]=_0x38aae6[_0xbc2a('0x17')];this[_0xbc2a('0x18')]=_0x38aae6['callbackat'];this[_0xbc2a('0x19')]=_0x38aae6[_0xbc2a('0x19')];this[_0xbc2a('0x1a')]=_0x38aae6[_0xbc2a('0x1a')];this['ListId']=_0x38aae6[_0xbc2a('0x1b')];this[_0xbc2a('0x1c')]=_0x38aae6[_0xbc2a('0x1c')];this[_0xbc2a('0x1d')]=_0x38aae6['VoiceQueueId'];this['CampaignId']=_0x38aae6[_0xbc2a('0x1e')];this[_0xbc2a('0x1f')]=_0x38aae6[_0xbc2a('0x1f')]||'';this[_0xbc2a('0x20')]=_0x38aae6[_0xbc2a('0x20')]||'';this[_0xbc2a('0x21')]=_0x38aae6[_0xbc2a('0x21')];this[_0xbc2a('0x22')]=_0x38aae6[_0xbc2a('0x22')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 52eca82..b309e25 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c96=['talktime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime'];(function(_0x7f72bf,_0x3f7ecc){var _0x9d482=function(_0x3a21a1){while(--_0x3a21a1){_0x7f72bf['push'](_0x7f72bf['shift']());}};_0x9d482(++_0x3f7ecc);}(_0x4c96,0x1dd));var _0x64c9=function(_0x446d1a,_0x4f80bb){_0x446d1a=_0x446d1a-0x0;var _0x325257=_0x4c96[_0x446d1a];return _0x325257;};'use strict';var moment=require(_0x64c9('0x0'));var utils=require('../utils');function Hangup(_0xd69294,_0x1818c7){this[_0x64c9('0x1')]=0x4;this[_0x64c9('0x2')]=_0x64c9('0x3');this['scheduledat']=_0xd69294['scheduledat'];this[_0x64c9('0x4')]=_0xd69294[_0x64c9('0x4')];this[_0x64c9('0x5')]=_0xd69294[_0x64c9('0x4')]==='outbound'?_0x64c9('0x6'):_0xd69294['type'];this[_0x64c9('0x7')]=_0xd69294[_0x64c9('0x7')]||![];this[_0x64c9('0x8')]=_0xd69294[_0x64c9('0x8')];this[_0x64c9('0x9')]=_0xd69294['countcongestionretry'];this[_0x64c9('0xa')]=_0xd69294[_0x64c9('0xa')];this[_0x64c9('0xb')]=_0xd69294[_0x64c9('0x8')]+_0xd69294['countcongestionretry']+_0xd69294[_0x64c9('0xa')]+_0xd69294[_0x64c9('0xc')]+_0xd69294[_0x64c9('0xd')]+_0xd69294[_0x64c9('0xe')]+_0xd69294[_0x64c9('0xf')]+_0xd69294[_0x64c9('0x10')];this[_0x64c9('0xc')]=_0xd69294[_0x64c9('0xc')];this[_0x64c9('0xd')]=_0xd69294[_0x64c9('0xd')];this['countabandonedretry']=_0xd69294[_0x64c9('0xe')];this[_0x64c9('0xf')]=_0xd69294[_0x64c9('0xf')];this['countagentrejectretry']=_0xd69294[_0x64c9('0x10')];this['uniqueid']=_0x1818c7[_0x64c9('0x11')];this[_0x64c9('0x12')]=_0xd69294['name'];this['calleridnum']=_0xd69294[_0x64c9('0x13')];this[_0x64c9('0x14')]=_0xd69294[_0x64c9('0x14')];this['responsetime']=_0xd69294[_0x64c9('0x15')];this['endtime']=moment()[_0x64c9('0x16')](_0x64c9('0x17'));this[_0x64c9('0x18')]=utils[_0x64c9('0x19')](_0xd69294[_0x64c9('0x15')],_0xd69294[_0x64c9('0x14')]);this[_0x64c9('0x1a')]=0x0;this[_0x64c9('0x1b')]=utils[_0x64c9('0x19')](this[_0x64c9('0x1c')],_0xd69294[_0x64c9('0x15')]);this[_0x64c9('0x6')]=_0xd69294[_0x64c9('0x6')];this[_0x64c9('0x1d')]=_0x64c9('0x1e');this[_0x64c9('0x1f')]=_0x1818c7['cause-txt'];this[_0x64c9('0x20')]=_0xd69294[_0x64c9('0x20')];this[_0x64c9('0x21')]=_0xd69294[_0x64c9('0x21')];this[_0x64c9('0x22')]=_0xd69294[_0x64c9('0x22')];this[_0x64c9('0x23')]=_0xd69294['recallme'];this[_0x64c9('0x24')]=_0xd69294[_0x64c9('0x24')];this[_0x64c9('0x25')]=_0xd69294[_0x64c9('0x25')];this['UserId']=_0xd69294[_0x64c9('0x26')];this[_0x64c9('0x27')]=_0xd69294[_0x64c9('0x27')];this[_0x64c9('0x28')]=_0xd69294[_0x64c9('0x28')];}module[_0x64c9('0x29')]=Hangup; \ No newline at end of file +var _0xe818=['YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime'];(function(_0x55fc0a,_0x2eeef8){var _0x54136d=function(_0x1e17f1){while(--_0x1e17f1){_0x55fc0a['push'](_0x55fc0a['shift']());}};_0x54136d(++_0x2eeef8);}(_0xe818,0x1d6));var _0x8e81=function(_0x312783,_0x125623){_0x312783=_0x312783-0x0;var _0x526165=_0xe818[_0x312783];return _0x526165;};'use strict';var moment=require(_0x8e81('0x0'));var utils=require('../utils');function Hangup(_0x55c107,_0x5b7ff6){this[_0x8e81('0x1')]=0x4;this[_0x8e81('0x2')]=_0x8e81('0x3');this[_0x8e81('0x4')]=_0x55c107['scheduledat'];this[_0x8e81('0x5')]=_0x55c107[_0x8e81('0x5')];this[_0x8e81('0x6')]=_0x55c107[_0x8e81('0x5')]==='outbound'?_0x8e81('0x7'):_0x55c107[_0x8e81('0x5')];this[_0x8e81('0x8')]=_0x55c107['amd']||![];this[_0x8e81('0x9')]=_0x55c107[_0x8e81('0x9')];this['countcongestionretry']=_0x55c107['countcongestionretry'];this[_0x8e81('0xa')]=_0x55c107['countnoanswerretry'];this['countglobal']=_0x55c107[_0x8e81('0x9')]+_0x55c107[_0x8e81('0xb')]+_0x55c107[_0x8e81('0xa')]+_0x55c107[_0x8e81('0xc')]+_0x55c107['countdropretry']+_0x55c107[_0x8e81('0xd')]+_0x55c107[_0x8e81('0xe')]+_0x55c107[_0x8e81('0xf')];this[_0x8e81('0xc')]=_0x55c107[_0x8e81('0xc')];this[_0x8e81('0x10')]=_0x55c107['countdropretry'];this[_0x8e81('0xd')]=_0x55c107[_0x8e81('0xd')];this[_0x8e81('0xe')]=_0x55c107['countmachineretry'];this['countagentrejectretry']=_0x55c107[_0x8e81('0xf')];this[_0x8e81('0x11')]=_0x5b7ff6[_0x8e81('0x11')];this[_0x8e81('0x12')]=_0x55c107[_0x8e81('0x13')];this['calleridnum']=_0x55c107[_0x8e81('0x14')];this[_0x8e81('0x15')]=_0x55c107[_0x8e81('0x15')];this[_0x8e81('0x16')]=_0x55c107[_0x8e81('0x16')];this[_0x8e81('0x17')]=moment()['format'](_0x8e81('0x18'));this['ringtime']=utils['getSeconds'](_0x55c107[_0x8e81('0x16')],_0x55c107[_0x8e81('0x15')]);this[_0x8e81('0x19')]=0x0;this[_0x8e81('0x1a')]=utils['getSeconds'](this[_0x8e81('0x17')],_0x55c107['responsetime']);this[_0x8e81('0x7')]=_0x55c107['queue'];this[_0x8e81('0x1b')]=_0x8e81('0x1c');this[_0x8e81('0x1d')]=_0x5b7ff6[_0x8e81('0x1e')];this[_0x8e81('0x1f')]=_0x55c107[_0x8e81('0x1f')];this[_0x8e81('0x20')]=_0x55c107[_0x8e81('0x20')];this['callbackat']=_0x55c107['callbackat'];this[_0x8e81('0x21')]=_0x55c107['recallme'];this[_0x8e81('0x22')]=_0x55c107[_0x8e81('0x22')];this[_0x8e81('0x23')]=_0x55c107[_0x8e81('0x23')];this['UserId']=_0x55c107['UserId'];this['VoiceQueueId']=_0x55c107['VoiceQueueId'];this['CampaignId']=_0x55c107[_0x8e81('0x24')];}module[_0x8e81('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 87e05e7..146020d 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe24a=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','scheduledat','type','outbound','queue'];(function(_0x2d7827,_0x5afb3d){var _0x2ef080=function(_0x27fd0f){while(--_0x27fd0f){_0x2d7827['push'](_0x2d7827['shift']());}};_0x2ef080(++_0x5afb3d);}(_0xe24a,0x137));var _0xae24=function(_0x3300d0,_0x45afb1){_0x3300d0=_0x3300d0-0x0;var _0x2762dd=_0xe24a[_0x3300d0];return _0x2762dd;};'use strict';var utils=require('../utils');function History(_0x4711a3){this['uniqueid']=_0x4711a3['uniqueid'];this[_0xae24('0x0')]=_0x4711a3[_0xae24('0x0')]||undefined;this[_0xae24('0x1')]=_0x4711a3[_0xae24('0x1')];this['campaigntype']=_0x4711a3[_0xae24('0x1')]===_0xae24('0x2')?_0xae24('0x3'):_0x4711a3['type'];this[_0xae24('0x4')]=_0x4711a3[_0xae24('0x4')];this[_0xae24('0x5')]=_0x4711a3[_0xae24('0x5')];this[_0xae24('0x6')]=_0x4711a3[_0xae24('0x6')];this['countglobal']=_0x4711a3[_0xae24('0x4')]+_0x4711a3[_0xae24('0x5')]+_0x4711a3[_0xae24('0x6')]+_0x4711a3[_0xae24('0x7')]+_0x4711a3[_0xae24('0x8')]+_0x4711a3['countabandonedretry']+_0x4711a3[_0xae24('0x9')]+_0x4711a3[_0xae24('0xa')];this[_0xae24('0x7')]=_0x4711a3['countnosuchnumberretry'];this['countdropretry']=_0x4711a3[_0xae24('0x8')];this[_0xae24('0xb')]=_0x4711a3[_0xae24('0xb')];this['countmachineretry']=_0x4711a3[_0xae24('0x9')];this[_0xae24('0xa')]=_0x4711a3['countagentrejectretry'];this[_0xae24('0x3')]=_0x4711a3[_0xae24('0x3')];this[_0xae24('0xc')]=_0x4711a3['name'];this[_0xae24('0xd')]=_0x4711a3[_0xae24('0xe')];this[_0xae24('0xf')]=_0x4711a3[_0xae24('0xf')];this[_0xae24('0x10')]=_0x4711a3[_0xae24('0x10')];this[_0xae24('0x11')]=_0x4711a3['responsetime'];this[_0xae24('0x12')]=utils['getSeconds'](_0x4711a3['responsetime'],_0x4711a3[_0xae24('0xf')]);this[_0xae24('0x13')]=0x0;this[_0xae24('0x14')]=0x0;this[_0xae24('0x15')]=_0x4711a3[_0xae24('0x15')];this[_0xae24('0x16')]=_0x4711a3['callbackuniqueid'];this[_0xae24('0x17')]=_0x4711a3[_0xae24('0x17')];this[_0xae24('0x18')]=_0x4711a3[_0xae24('0x18')];this['ContactId']=_0x4711a3[_0xae24('0x19')];this[_0xae24('0x1a')]=_0x4711a3[_0xae24('0x1a')];this[_0xae24('0x1b')]=_0x4711a3[_0xae24('0x1b')];this['VoiceQueueId']=_0x4711a3[_0xae24('0x1c')];this[_0xae24('0x1d')]=_0x4711a3[_0xae24('0x1d')];this[_0xae24('0x1e')]=_0x4711a3[_0xae24('0x1e')]||'';this[_0xae24('0x1f')]=_0x4711a3[_0xae24('0x1f')]||'';this['state']=_0x4711a3[_0xae24('0x20')];this[_0xae24('0x21')]=_0x4711a3[_0xae24('0x21')];}module[_0xae24('0x22')]=History; \ No newline at end of file +var _0x9655=['campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type'];(function(_0x3d1c06,_0x30f2e0){var _0x10c6e6=function(_0x42ee29){while(--_0x42ee29){_0x3d1c06['push'](_0x3d1c06['shift']());}};_0x10c6e6(++_0x30f2e0);}(_0x9655,0x13c));var _0x5965=function(_0x3f065d,_0x2f1113){_0x3f065d=_0x3f065d-0x0;var _0xb2c43e=_0x9655[_0x3f065d];return _0xb2c43e;};'use strict';var utils=require(_0x5965('0x0'));function History(_0x13c53f){this[_0x5965('0x1')]=_0x13c53f[_0x5965('0x1')];this['scheduledat']=_0x13c53f[_0x5965('0x2')]||undefined;this['type']=_0x13c53f[_0x5965('0x3')];this[_0x5965('0x4')]=_0x13c53f[_0x5965('0x3')]===_0x5965('0x5')?'queue':_0x13c53f[_0x5965('0x3')];this[_0x5965('0x6')]=_0x13c53f['countbusyretry'];this[_0x5965('0x7')]=_0x13c53f[_0x5965('0x7')];this[_0x5965('0x8')]=_0x13c53f['countnoanswerretry'];this[_0x5965('0x9')]=_0x13c53f[_0x5965('0x6')]+_0x13c53f[_0x5965('0x7')]+_0x13c53f['countnoanswerretry']+_0x13c53f['countnosuchnumberretry']+_0x13c53f[_0x5965('0xa')]+_0x13c53f[_0x5965('0xb')]+_0x13c53f[_0x5965('0xc')]+_0x13c53f[_0x5965('0xd')];this[_0x5965('0xe')]=_0x13c53f[_0x5965('0xe')];this[_0x5965('0xa')]=_0x13c53f['countdropretry'];this[_0x5965('0xb')]=_0x13c53f[_0x5965('0xb')];this['countmachineretry']=_0x13c53f[_0x5965('0xc')];this['countagentrejectretry']=_0x13c53f['countagentrejectretry'];this[_0x5965('0xf')]=_0x13c53f[_0x5965('0xf')];this[_0x5965('0x10')]=_0x13c53f['name'];this[_0x5965('0x11')]=_0x13c53f[_0x5965('0x12')];this[_0x5965('0x13')]=_0x13c53f[_0x5965('0x13')];this[_0x5965('0x14')]=_0x13c53f[_0x5965('0x14')];this[_0x5965('0x15')]=_0x13c53f['responsetime'];this[_0x5965('0x16')]=utils[_0x5965('0x17')](_0x13c53f[_0x5965('0x14')],_0x13c53f[_0x5965('0x13')]);this[_0x5965('0x18')]=0x0;this[_0x5965('0x19')]=0x0;this[_0x5965('0x1a')]=_0x13c53f[_0x5965('0x1a')];this['callbackuniqueid']=_0x13c53f[_0x5965('0x1b')];this[_0x5965('0x1c')]=_0x13c53f[_0x5965('0x1c')];this[_0x5965('0x1d')]=_0x13c53f['recallme'];this[_0x5965('0x1e')]=_0x13c53f[_0x5965('0x1e')];this[_0x5965('0x1f')]=_0x13c53f[_0x5965('0x1f')];this[_0x5965('0x20')]=_0x13c53f[_0x5965('0x20')];this[_0x5965('0x21')]=_0x13c53f['VoiceQueueId'];this[_0x5965('0x22')]=_0x13c53f[_0x5965('0x22')];this[_0x5965('0x23')]=_0x13c53f['originatecalleridnum']||'';this[_0x5965('0x24')]=_0x13c53f[_0x5965('0x24')]||'';this[_0x5965('0x25')]=_0x13c53f[_0x5965('0x25')];this['statedesc']=_0x13c53f[_0x5965('0x26')];}module[_0x5965('0x27')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 3cd1780..06cbda7 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe818=['originatecalleridnum','originatecalleridname','agiafterat','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','number','starttime','responsetime','droptime','dropreason','holdtime','getSeconds','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x28157b,_0x1e6283){var _0x2805e0=function(_0xd207d6){while(--_0xd207d6){_0x28157b['push'](_0x28157b['shift']());}};_0x2805e0(++_0x1e6283);}(_0xe818,0x11d));var _0x8e81=function(_0x1a6dfc,_0x5797cf){_0x1a6dfc=_0x1a6dfc-0x0;var _0x466342=_0xe818[_0x1a6dfc];return _0x466342;};'use strict';var utils=require(_0x8e81('0x0'));function QueueCallerAbandon(_0x802922,_0x384448){this[_0x8e81('0x1')]=_0x802922[_0x8e81('0x1')];this[_0x8e81('0x2')]=_0x802922[_0x8e81('0x2')];this[_0x8e81('0x3')]=_0x802922[_0x8e81('0x2')]===_0x8e81('0x4')?_0x8e81('0x5'):_0x802922['type'];this[_0x8e81('0x6')]=_0x802922['countbusyretry'];this[_0x8e81('0x7')]=_0x802922['countcongestionretry'];this[_0x8e81('0x8')]=_0x802922[_0x8e81('0x8')];this[_0x8e81('0x9')]=_0x802922[_0x8e81('0x6')]+_0x802922[_0x8e81('0x7')]+_0x802922[_0x8e81('0x8')]+_0x802922['countnosuchnumberretry']+_0x802922[_0x8e81('0xa')]+_0x802922[_0x8e81('0xb')]+_0x802922[_0x8e81('0xc')]+_0x802922[_0x8e81('0xd')];this[_0x8e81('0xe')]=_0x802922['countnosuchnumberretry'];this[_0x8e81('0xa')]=_0x802922[_0x8e81('0xa')];this[_0x8e81('0xb')]=_0x802922['countabandonedretry'];this[_0x8e81('0xc')]=_0x802922[_0x8e81('0xc')];this[_0x8e81('0xd')]=_0x802922['countagentrejectretry'];this[_0x8e81('0xf')]=_0x384448['uniqueid'];this['calleridname']=_0x802922[_0x8e81('0x10')];this['calleridnum']=_0x802922[_0x8e81('0x11')];this[_0x8e81('0x12')]=_0x802922[_0x8e81('0x12')];this[_0x8e81('0x13')]=_0x802922['responsetime'];this[_0x8e81('0x14')]=_0x802922[_0x8e81('0x14')];this[_0x8e81('0x15')]=_0x802922[_0x8e81('0x15')];this['endtime']=this['droptime'];this['ringtime']=utils['getSeconds'](_0x802922['responsetime'],_0x802922[_0x8e81('0x12')]);this[_0x8e81('0x16')]=utils[_0x8e81('0x17')](this['droptime'],_0x802922[_0x8e81('0x13')]);this[_0x8e81('0x18')]=0x0;this[_0x8e81('0x5')]=_0x384448['queue'];this['membername']=_0x384448[_0x8e81('0x19')];this[_0x8e81('0x1a')]=_0x384448[_0x8e81('0x1a')];this['callback']=_0x802922[_0x8e81('0x1b')];this[_0x8e81('0x1c')]=_0x802922[_0x8e81('0x1c')];this[_0x8e81('0x1d')]=_0x802922[_0x8e81('0x1d')];this['recallme']=_0x802922['recallme'];this[_0x8e81('0x1e')]=_0x802922[_0x8e81('0x1e')];this[_0x8e81('0x1f')]=_0x802922['ListId'];this[_0x8e81('0x20')]=_0x802922[_0x8e81('0x20')];this['VoiceQueueId']=_0x802922[_0x8e81('0x21')];this['CampaignId']=_0x802922[_0x8e81('0x22')];this['originatecalleridnum']=_0x802922[_0x8e81('0x23')]||'';this['originatecalleridname']=_0x802922[_0x8e81('0x24')]||'';this['agiafterat']=_0x802922[_0x8e81('0x25')];this['state']=_0x802922['state'];this[_0x8e81('0x26')]=_0x802922[_0x8e81('0x26')];}module[_0x8e81('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0x7582=['calleridname','name','calleridnum','starttime','responsetime','dropreason','endtime','droptime','getSeconds','holdtime','talktime','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','statedesc','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7582,0x18b));var _0x2758=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x7582[_0x2e914];return _0x936e45;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x21859c,_0xac89fa){this[_0x2758('0x0')]=_0x21859c[_0x2758('0x0')];this[_0x2758('0x1')]=_0x21859c[_0x2758('0x1')];this['campaigntype']=_0x21859c[_0x2758('0x1')]===_0x2758('0x2')?_0x2758('0x3'):_0x21859c[_0x2758('0x1')];this['countbusyretry']=_0x21859c['countbusyretry'];this['countcongestionretry']=_0x21859c[_0x2758('0x4')];this[_0x2758('0x5')]=_0x21859c[_0x2758('0x5')];this['countglobal']=_0x21859c[_0x2758('0x6')]+_0x21859c['countcongestionretry']+_0x21859c[_0x2758('0x5')]+_0x21859c['countnosuchnumberretry']+_0x21859c[_0x2758('0x7')]+_0x21859c[_0x2758('0x8')]+_0x21859c['countmachineretry']+_0x21859c['countagentrejectretry'];this['countnosuchnumberretry']=_0x21859c['countnosuchnumberretry'];this[_0x2758('0x7')]=_0x21859c[_0x2758('0x7')];this[_0x2758('0x8')]=_0x21859c[_0x2758('0x8')];this[_0x2758('0x9')]=_0x21859c[_0x2758('0x9')];this[_0x2758('0xa')]=_0x21859c[_0x2758('0xa')];this[_0x2758('0xb')]=_0xac89fa[_0x2758('0xb')];this[_0x2758('0xc')]=_0x21859c[_0x2758('0xd')];this[_0x2758('0xe')]=_0x21859c['number'];this[_0x2758('0xf')]=_0x21859c['starttime'];this[_0x2758('0x10')]=_0x21859c[_0x2758('0x10')];this['droptime']=_0x21859c['droptime'];this[_0x2758('0x11')]=_0x21859c[_0x2758('0x11')];this[_0x2758('0x12')]=this[_0x2758('0x13')];this['ringtime']=utils[_0x2758('0x14')](_0x21859c['responsetime'],_0x21859c[_0x2758('0xf')]);this[_0x2758('0x15')]=utils[_0x2758('0x14')](this[_0x2758('0x13')],_0x21859c[_0x2758('0x10')]);this[_0x2758('0x16')]=0x0;this[_0x2758('0x3')]=_0xac89fa[_0x2758('0x3')];this['membername']=_0xac89fa[_0x2758('0x17')];this[_0x2758('0x18')]=_0xac89fa[_0x2758('0x18')];this[_0x2758('0x19')]=_0x21859c[_0x2758('0x19')];this['callbackuniqueid']=_0x21859c['callbackuniqueid'];this['callbackat']=_0x21859c[_0x2758('0x1a')];this[_0x2758('0x1b')]=_0x21859c['recallme'];this[_0x2758('0x1c')]=_0x21859c[_0x2758('0x1c')];this[_0x2758('0x1d')]=_0x21859c[_0x2758('0x1d')];this[_0x2758('0x1e')]=_0x21859c[_0x2758('0x1e')];this['VoiceQueueId']=_0x21859c[_0x2758('0x1f')];this['CampaignId']=_0x21859c[_0x2758('0x20')];this[_0x2758('0x21')]=_0x21859c[_0x2758('0x21')]||'';this[_0x2758('0x22')]=_0x21859c['originatecalleridname']||'';this[_0x2758('0x23')]=_0x21859c[_0x2758('0x23')];this['state']=_0x21859c['state'];this[_0x2758('0x24')]=_0x21859c[_0x2758('0x24')];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index c1d5259..c67f6ca 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]'];(function(_0x3be533,_0x11b27b){var _0x4d51ba=function(_0x1c3137){while(--_0x1c3137){_0x3be533['push'](_0x3be533['shift']());}};_0x4d51ba(++_0x11b27b);}(_0xadb5,0xad));var _0x5adb=function(_0x151a60,_0x2c19e6){_0x151a60=_0x151a60-0x0;var _0x737ce3=_0xadb5[_0x151a60];return _0x737ce3;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('dialer');var cmHopper=require(_0x5adb('0x1'));var cmHopperAdditionalPhone=require(_0x5adb('0x2'));var cmHopperBlack=require(_0x5adb('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x248dc6){return util[_0x5adb('0x4')](_0x248dc6,{'showHidden':![],'depth':null});}function getContactDialer(_0x2e3ef4,_0x4cb1d1,_0x35a5d3){return cmHopper[_0x5adb('0x5')](_0x2e3ef4['id'],_0x4cb1d1,_0x35a5d3,_0x2e3ef4[_0x5adb('0x6')])[_0x5adb('0x7')](function(_0xdf3776){_0x2e3ef4[_0x5adb('0x8')]=0x0;logger[_0x5adb('0x9')](_0x5adb('0xa'),inspectError(_0xdf3776));});}exports[_0x5adb('0x5')]=getContactDialer;function getContactDialerIvr(_0x7293ab,_0x34f59d){return cmHopper[_0x5adb('0xb')](_0x7293ab['id'],_0x34f59d,_0x7293ab[_0x5adb('0x6')])[_0x5adb('0x7')](function(_0x563d86){_0x7293ab['temp']=0x0;logger[_0x5adb('0x9')](_0x5adb('0xc'),inspectError(_0x563d86));});}exports[_0x5adb('0xb')]=getContactDialerIvr;function countReScheduled(_0x53b772){return cmHopper[_0x5adb('0xd')](_0x53b772)['catch'](function(_0x2a0b70){logger['error'](_0x5adb('0xe'),inspectError(_0x2a0b70));});}exports[_0x5adb('0xd')]=countReScheduled;function rescheduleContact(_0x44abe3){return cmHopper['rescheduleContact'](_0x44abe3)[_0x5adb('0x7')](function(_0x34af2c){logger[_0x5adb('0x9')]('[rescheduleContact]',inspectError(_0x34af2c));});}exports[_0x5adb('0xf')]=rescheduleContact;function unlockContact(_0x518823,_0x367d82,_0x42a482){return cmHopper[_0x5adb('0x10')](_0x518823,_0x367d82,_0x42a482)[_0x5adb('0x7')](function(_0x1c0f97){logger[_0x5adb('0x9')](_0x5adb('0x11'),inspectError(_0x1c0f97));});}exports[_0x5adb('0x10')]=unlockContact;function moveContactManagedDialer(_0xb953a6){return cmHopper['moveContactManagedDialer'](_0xb953a6)[_0x5adb('0x7')](function(_0x5de028){logger[_0x5adb('0x9')]('[moveContactManagedDialer]',inspectError(_0x5de028));});}exports[_0x5adb('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x50e84f){return cmHopperBlack['checkIsBlackList'](_0x50e84f)[_0x5adb('0x7')](function(_0x1bed20){logger[_0x5adb('0x9')](_0x5adb('0x13'),inspectError(_0x1bed20));});}exports[_0x5adb('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x5af69d){return cmHopperBlack[_0x5adb('0x15')](_0x5af69d)['catch'](function(_0x4e9f16){logger[_0x5adb('0x9')](_0x5adb('0x16'),inspectError(_0x4e9f16));});}exports[_0x5adb('0x15')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1a8014,_0x1e9ccf,_0x413911){return cmHopperAdditionalPhone[_0x5adb('0x17')](_0x1a8014,_0x1e9ccf,_0x413911)['catch'](function(_0x4b1957){logger[_0x5adb('0x9')](_0x5adb('0x18'),inspectError(_0x4b1957));});}exports[_0x5adb('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0xeb556c,_0x49f203,_0x2fee18){return cmHopperAdditionalPhone[_0x5adb('0x19')](_0xeb556c,_0x49f203,_0x2fee18)['catch'](function(_0x1feecf){logger[_0x5adb('0x9')](_0x5adb('0x1a'),inspectError(_0x1feecf));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x13ad1d){return cmHopperHistory[_0x5adb('0x1b')](_0x13ad1d)[_0x5adb('0x7')](function(_0x2c64a3){logger[_0x5adb('0x9')](_0x5adb('0x1c'),inspectError(_0x2c64a3));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x49992e){return cmHopperHistory['createHistory'](_0x49992e)[_0x5adb('0x7')](function(_0x1eac55){logger[_0x5adb('0x9')](_0x5adb('0x1d'),inspectError(_0x1eac55));});}exports[_0x5adb('0x1e')]=createHistory; \ No newline at end of file +var _0xbff5=['moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3ad31c,_0x487226){var _0x53e36d=function(_0x3d0b1d){while(--_0x3d0b1d){_0x3ad31c['push'](_0x3ad31c['shift']());}};_0x53e36d(++_0x487226);}(_0xbff5,0x1bc));var _0x5bff=function(_0x47ec7a,_0x2b51f0){_0x47ec7a=_0x47ec7a-0x0;var _0x3a0056=_0xbff5[_0x47ec7a];return _0x3a0056;};'use strict';var util=require(_0x5bff('0x0'));var logger=require(_0x5bff('0x1'))(_0x5bff('0x2'));var cmHopper=require(_0x5bff('0x3'));var cmHopperAdditionalPhone=require(_0x5bff('0x4'));var cmHopperBlack=require(_0x5bff('0x5'));var cmHopperHistory=require(_0x5bff('0x6'));function inspectError(_0x4dccf3){return util[_0x5bff('0x7')](_0x4dccf3,{'showHidden':![],'depth':null});}function getContactDialer(_0x486083,_0x4c567d,_0x16ed7b){return cmHopper[_0x5bff('0x8')](_0x486083['id'],_0x4c567d,_0x16ed7b,_0x486083[_0x5bff('0x9')])[_0x5bff('0xa')](function(_0x43605a){_0x486083[_0x5bff('0xb')]=0x0;logger[_0x5bff('0xc')](_0x5bff('0xd'),inspectError(_0x43605a));});}exports[_0x5bff('0x8')]=getContactDialer;function getContactDialerIvr(_0x4a1be2,_0x20e26f){return cmHopper['getContactDialerIvr'](_0x4a1be2['id'],_0x20e26f,_0x4a1be2[_0x5bff('0x9')])[_0x5bff('0xa')](function(_0x4fc146){_0x4a1be2[_0x5bff('0xb')]=0x0;logger['error'](_0x5bff('0xe'),inspectError(_0x4fc146));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x207835){return cmHopper[_0x5bff('0xf')](_0x207835)['catch'](function(_0x132dc9){logger['error'](_0x5bff('0x10'),inspectError(_0x132dc9));});}exports[_0x5bff('0xf')]=countReScheduled;function rescheduleContact(_0x548128){return cmHopper[_0x5bff('0x11')](_0x548128)[_0x5bff('0xa')](function(_0x5b0d2d){logger['error'](_0x5bff('0x12'),inspectError(_0x5b0d2d));});}exports[_0x5bff('0x11')]=rescheduleContact;function unlockContact(_0x3a507c,_0x4d883e,_0x2d22ab){return cmHopper[_0x5bff('0x13')](_0x3a507c,_0x4d883e,_0x2d22ab)[_0x5bff('0xa')](function(_0x56c7b2){logger[_0x5bff('0xc')](_0x5bff('0x14'),inspectError(_0x56c7b2));});}exports[_0x5bff('0x13')]=unlockContact;function moveContactManagedDialer(_0x546351){return cmHopper[_0x5bff('0x15')](_0x546351)[_0x5bff('0xa')](function(_0x36653b){logger[_0x5bff('0xc')]('[moveContactManagedDialer]',inspectError(_0x36653b));});}exports[_0x5bff('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x5357d4){return cmHopperBlack[_0x5bff('0x16')](_0x5357d4)['catch'](function(_0x1fc4cf){logger[_0x5bff('0xc')](_0x5bff('0x17'),inspectError(_0x1fc4cf));});}exports[_0x5bff('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x12d018){return cmHopperBlack[_0x5bff('0x18')](_0x12d018)[_0x5bff('0xa')](function(_0x13ee8f){logger[_0x5bff('0xc')]('[checkIsBlackListIvr]',inspectError(_0x13ee8f));});}exports[_0x5bff('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x263cf5,_0x4369b0,_0x1e7f8a){return cmHopperAdditionalPhone[_0x5bff('0x19')](_0x263cf5,_0x4369b0,_0x1e7f8a)[_0x5bff('0xa')](function(_0x3913fd){logger[_0x5bff('0xc')]('[verifyAdditionalPhone]',inspectError(_0x3913fd));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x9a69de,_0x53bd97,_0x220c8f){return cmHopperAdditionalPhone[_0x5bff('0x1a')](_0x9a69de,_0x53bd97,_0x220c8f)[_0x5bff('0xa')](function(_0x6f18f1){logger[_0x5bff('0xc')](_0x5bff('0x1b'),inspectError(_0x6f18f1));});}exports[_0x5bff('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0xedba9d){return cmHopperHistory['avgHandleTime'](_0xedba9d)['catch'](function(_0x20d750){logger[_0x5bff('0xc')]('[avgHandleTime]',inspectError(_0x20d750));});}exports[_0x5bff('0x1c')]=avgHandleTime;function createHistory(_0x588078){return cmHopperHistory['createHistory'](_0x588078)[_0x5bff('0xa')](function(_0x5cf207){logger[_0x5bff('0xc')](_0x5bff('0x1d'),inspectError(_0x5cf207));});}exports[_0x5bff('0x1e')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index d9797ec..ab40e55 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf488=['BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','type','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','createdAt','tags','updatedAt','undefined','%s%s','XMD-','setXMDContactVariables','lodash','moment','util','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE'];(function(_0x2d12f5,_0x5f0bc3){var _0x2c053b=function(_0x2a2d17){while(--_0x2a2d17){_0x2d12f5['push'](_0x2d12f5['shift']());}};_0x2c053b(++_0x5f0bc3);}(_0xf488,0x189));var _0x8f48=function(_0x5a148f,_0x114dfa){_0x5a148f=_0x5a148f-0x0;var _0x5af2d4=_0xf488[_0x5a148f];return _0x5af2d4;};'use strict';var _=require(_0x8f48('0x0'));var moment=require(_0x8f48('0x1'));var util=require(_0x8f48('0x2'));var logger=require(_0x8f48('0x3'))('dialer');var timezones=require(_0x8f48('0x4'))[_0x8f48('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x8f48('0x6'),'BLACKLIST':_0x8f48('0x7'),'CONTACTS_RESCHEDULED':_0x8f48('0x8'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x8f48('0x9'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x8f48('0xa'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x8f48('0xb'),'OVERTIME_GLOBAL_INTERVAL':_0x8f48('0xc'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x8f48('0xd'),'RUNNING':_0x8f48('0xe'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x8f48('0xf')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x60694c){return _0x60694c[_0x8f48('0x10')]===_0x8f48('0x11');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x5335b5){return _0x5335b5[_0x8f48('0x12')]==='ivr';}exports[_0x8f48('0x13')]=isIVRCampaign;function isOutboundQueue(_0x20e106){return _0x20e106[_0x8f48('0x12')]==='outbound';}exports[_0x8f48('0x14')]=isOutboundQueue;function isQueueCampaignActive(_0x59ebaa){return _0x59ebaa[_0x8f48('0x15')];}exports[_0x8f48('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x520fdf){return _0x520fdf[_0x8f48('0x17')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x2081c2,_0x42da7c){var _0x3e1a55=moment(_0x2081c2)[_0x8f48('0x18')](0x0);var _0x157b24=moment(_0x42da7c)['milliseconds'](0x0);return _0x3e1a55[_0x8f48('0x19')](_0x157b24,_0x8f48('0x1a'));}exports[_0x8f48('0x1b')]=getSeconds;function hasQueueCampaignDataChanged(_0x56e489,_0x1092a2){var _0x1925db=![];var _0x3cacb9=_0x56e489[_0x8f48('0x10')]!==_0x1092a2[_0x8f48('0x10')]||_0x56e489[_0x8f48('0x15')]!==_0x1092a2[_0x8f48('0x15')]||_0x56e489[_0x8f48('0x1c')]!==_0x1092a2[_0x8f48('0x1c')];var _0x4a2b2a=_0x56e489['available']!==_0x1092a2[_0x8f48('0x1d')]||_0x56e489[_0x8f48('0x1e')]!==_0x1092a2[_0x8f48('0x1e')]||_0x56e489[_0x8f48('0x1f')]!==_0x1092a2[_0x8f48('0x1f')]||_0x56e489[_0x8f48('0x20')]!==_0x1092a2['paused']||_0x56e489[_0x8f48('0x21')]!==_0x1092a2[_0x8f48('0x21')]||_0x56e489['pTalking']!==_0x1092a2[_0x8f48('0x22')]||_0x56e489[_0x8f48('0x23')]!==_0x1092a2['waiting']||_0x56e489[_0x8f48('0x24')]!==_0x1092a2[_0x8f48('0x24')]||_0x56e489[_0x8f48('0x25')]!==_0x1092a2[_0x8f48('0x25')];if(_0x56e489[_0x8f48('0x26')]&&_0x1092a2[_0x8f48('0x26')]){_0x1925db=_0x56e489['Trunk'][_0x8f48('0x27')]!==_0x1092a2[_0x8f48('0x26')][_0x8f48('0x27')]||_0x56e489[_0x8f48('0x26')][_0x8f48('0x17')]!==_0x1092a2[_0x8f48('0x26')][_0x8f48('0x17')];}return _0x3cacb9||_0x4a2b2a||_0x1925db;}exports[_0x8f48('0x28')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4542e5){var _0x53e932=null;var _0x4e2144=_0x4542e5[_0x8f48('0x29')];if(_['isNil'](_0x4542e5[_0x8f48('0x2a')])||_[_0x8f48('0x2b')](_0x4542e5[_0x8f48('0x2c')])||_[_0x8f48('0x2b')](_0x4542e5[_0x8f48('0x2c')][_0x8f48('0x2d')])){_0x53e932=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x8f48('0x2e')](_0x4542e5[_0x8f48('0x2a')])||_[_0x8f48('0x2e')](_0x4542e5[_0x8f48('0x2c')][_0x8f48('0x2d')])){_0x53e932=CAMPAIGN_STATUS[_0x8f48('0x2f')];}else if(_0x4e2144&&!timezones[_0x4e2144]){_0x53e932=CAMPAIGN_STATUS[_0x8f48('0x30')];}return _0x53e932;}function checkAnyValidTrunk(_0x188538,_0x218406){var _0x167536=null;var _0x1274f1='SIP/';var _0x26d20b=['reachable',_0x8f48('0x31')];var _0x34efcd=!![];if(_0x188538[_0x8f48('0x26')]&&_0x188538[_0x8f48('0x26')][_0x8f48('0x17')]){_0x1274f1+=_0x188538['Trunk'][_0x8f48('0x27')];_0x167536=_0x218406[_0x1274f1];_0x34efcd=_0x26d20b[_0x8f48('0x32')](_0x167536[_0x8f48('0x33')]);}else if(_0x188538[_0x8f48('0x34')]&&_0x188538[_0x8f48('0x34')]['active']){_0x1274f1+=_0x188538[_0x8f48('0x34')][_0x8f48('0x27')];_0x167536=_0x218406[_0x1274f1];_0x34efcd=_0x26d20b['includes'](_0x167536['status']);}return _0x34efcd;}function getQueueCampaignStatusMessage(_0x3be452,_0x332cde){var _0x468f3e=CAMPAIGN_STATUS[_0x8f48('0x6')];var _0x13eae=isPreviewCampaign(_0x3be452);if(!isQueueCampaignActive(_0x3be452)){if(_0x13eae){_0x468f3e=CAMPAIGN_STATUS[_0x8f48('0x35')];}else{if(_0x3be452[_0x8f48('0x25')]===0x0&&_0x3be452[_0x8f48('0x21')]===0x0&&_0x3be452['waiting']===0x0&&(_0x3be452['pTalking']||0x0)===0x0){_0x468f3e=CAMPAIGN_STATUS['INACTIVE'];}else{_0x468f3e=CAMPAIGN_STATUS[_0x8f48('0x36')];}}}else if(_0x3be452['loggedIn']===0x0){_0x468f3e=CAMPAIGN_STATUS[_0x8f48('0x37')];}else if(!checkAnyValidTrunk(_0x3be452,_0x332cde)){_0x468f3e=CAMPAIGN_STATUS[_0x8f48('0x38')];}else if(!isPreviewCampaign(_0x3be452)){var _0x105317=checkAnyValidQueueCampaignInterval(_0x3be452);if(_0x105317){_0x468f3e=_0x105317;}}return _0x468f3e;}exports[_0x8f48('0x39')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3e5409){var _0x2ffc09=CAMPAIGN_STATUS[_0x8f48('0x36')];if(_0x3e5409[_0x8f48('0x25')]===0x0&&_0x3e5409[_0x8f48('0x21')]===0x0&&_0x3e5409[_0x8f48('0x23')]===0x0&&(_0x3e5409[_0x8f48('0x22')]||0x0)===0x0){_0x2ffc09=CAMPAIGN_STATUS[_0x8f48('0x35')];}return _0x2ffc09;}exports[_0x8f48('0x3a')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x486f4e){var _0x585523=_0x486f4e[_0x8f48('0x3b')](/"(.*?)"/);return _0x585523?_0x585523[0x1]:_0x486f4e;}exports[_0x8f48('0x3c')]=extractCalleridName;function getCallerId(_0x282bcf,_0x4f93dd,_0x5075aa){if(!_[_0x8f48('0x3d')](_0x5075aa)&&typeof _0x5075aa==='string'&&!_[_0x8f48('0x2e')](_0x5075aa)){if(!_['isUndefined'](_0x4f93dd)&&typeof _0x4f93dd===_0x8f48('0x3e')&&!_[_0x8f48('0x2e')](_0x4f93dd)){return util[_0x8f48('0x3f')](_0x8f48('0x40'),_0x4f93dd,_0x5075aa);}return util[_0x8f48('0x3f')](_0x8f48('0x40'),_0x5075aa,_0x5075aa);}if(!_['isUndefined'](_0x282bcf)&&typeof _0x282bcf===_0x8f48('0x3e')&&!_['isEmpty'](_0x282bcf)){return _0x282bcf;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x5402d3,_0x2fac09){var _0xdc2272;var _0x35e4e4;var _0xe4e3ed;if(_0x2fac09<=0x0){_0x2fac09=0x1;}_0xdc2272=new RegExp(_0x8f48('0x41')+_0x2fac09+'}$');_0x35e4e4=Math['pow'](0xa,_0x2fac09-0x1);_0xe4e3ed=Math[_0x8f48('0x42')](0xa,_0x2fac09)-0x1;return util[_0x8f48('0x3f')]('%s',_['replace'](_0x5402d3,_0xdc2272,_[_0x8f48('0x43')](_0x35e4e4,_0xe4e3ed)[_0x8f48('0x44')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x117d08){if(_0x117d08[_0x8f48('0x25')]&&_0x117d08[_0x8f48('0x25')]>0x0){_0x117d08[_0x8f48('0x25')]-=0x1;}else{logger[_0x8f48('0x45')](_0x8f48('0x46'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x4170f8){return _0x4170f8&&_0x4170f8[_0x8f48('0x47')]>0x0;}exports[_0x8f48('0x48')]=checkContactEmpty;function erlangb(_0xcc6f90,_0x434f15){if(_0x434f15===0x0){return 0x0;}var _0xa0138e=0x1;for(var _0x1d3fcd=0x1;_0x1d3fcd<=_0x434f15;_0x1d3fcd+=0x1){_0xa0138e=0x1+_0xa0138e*_0x1d3fcd/_0xcc6f90;}return 0x1/_0xa0138e;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x396963,_0x29095e,_0x13f7ae){if(_0x29095e>_0x13f7ae){for(var _0x576630=0x0;_0x576630<_0x29095e-_0x13f7ae;_0x576630+=0x1){decrementOriginate(_0x396963);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x5ef7d4){var _0x353ea4={};var _0x421781=['id',_0x8f48('0x49'),'description',_0x8f48('0x4a'),_0x8f48('0x4b')];if(_0x5ef7d4){for(var _0x481ba9 in _0x5ef7d4){if(typeof _0x5ef7d4[_0x481ba9]!==_0x8f48('0x4c')){if(!_[_0x8f48('0x2b')](_0x5ef7d4[_0x481ba9])&&!_0x421781[_0x8f48('0x32')](_0x481ba9)){_0x353ea4[util[_0x8f48('0x3f')](_0x8f48('0x4d'),_0x8f48('0x4e'),_0x481ba9['toUpperCase']())]=_0x5ef7d4[_0x481ba9];}}}}return _0x353ea4;}exports[_0x8f48('0x4f')]=setXMDContactVariables; \ No newline at end of file +var _0x0d1b=['UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','name','includes','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','active','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','isEmpty','Intervals','EMPTY_INTERVAL'];(function(_0x479988,_0x17b763){var _0x17610c=function(_0x1dc420){while(--_0x1dc420){_0x479988['push'](_0x479988['shift']());}};_0x17610c(++_0x17b763);}(_0x0d1b,0x13e));var _0xb0d1=function(_0x7d5376,_0x49a12c){_0x7d5376=_0x7d5376-0x0;var _0x40340c=_0x0d1b[_0x7d5376];return _0x40340c;};'use strict';var _=require(_0xb0d1('0x0'));var moment=require(_0xb0d1('0x1'));var util=require(_0xb0d1('0x2'));var logger=require(_0xb0d1('0x3'))(_0xb0d1('0x4'));var timezones=require(_0xb0d1('0x5'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xb0d1('0x6'),'BLACKLIST':_0xb0d1('0x7'),'CONTACTS_RESCHEDULED':_0xb0d1('0x8'),'DEACTIVATED':_0xb0d1('0x9'),'DISACTIVED':_0xb0d1('0xa'),'EMPTY_INTERVAL':_0xb0d1('0xb'),'INACTIVE':_0xb0d1('0xc'),'NO_AGENTS_LOGGED':_0xb0d1('0xd'),'NO_AVAILABLE_CONTACTS':_0xb0d1('0xe'),'NULL_INTERVAL':_0xb0d1('0xf'),'OVERTIME_INTERVAL':_0xb0d1('0x10'),'OVERTIME_GLOBAL_INTERVAL':_0xb0d1('0x11'),'QUEUE_RECALL':_0xb0d1('0x12'),'RECALL_TIMEOUT':_0xb0d1('0x13'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xb0d1('0x14'),'UNREACHABLE_TRUNK':_0xb0d1('0x15')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3659b7){return _0x3659b7[_0xb0d1('0x16')]==='preview';}exports[_0xb0d1('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x26257a){return _0x26257a[_0xb0d1('0x18')]===_0xb0d1('0x19');}exports[_0xb0d1('0x1a')]=isIVRCampaign;function isOutboundQueue(_0x4d54e5){return _0x4d54e5[_0xb0d1('0x18')]===_0xb0d1('0x1b');}exports[_0xb0d1('0x1c')]=isOutboundQueue;function isQueueCampaignActive(_0x145dca){return _0x145dca[_0xb0d1('0x1d')];}exports[_0xb0d1('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0xb12a44){return _0xb12a44['active'];}exports[_0xb0d1('0x1f')]=isIVRCampaignActive;function getSeconds(_0x249afd,_0x1ecb31){var _0x44daeb=moment(_0x249afd)[_0xb0d1('0x20')](0x0);var _0x2ba8cf=moment(_0x1ecb31)[_0xb0d1('0x20')](0x0);return _0x44daeb[_0xb0d1('0x21')](_0x2ba8cf,_0xb0d1('0x22'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x165a3f,_0x44d5f0){var _0x509034=![];var _0x30c591=_0x165a3f[_0xb0d1('0x16')]!==_0x44d5f0[_0xb0d1('0x16')]||_0x165a3f[_0xb0d1('0x1d')]!==_0x44d5f0[_0xb0d1('0x1d')]||_0x165a3f[_0xb0d1('0x23')]!==_0x44d5f0['message'];var _0x3913fe=_0x165a3f[_0xb0d1('0x24')]!==_0x44d5f0['available']||_0x165a3f[_0xb0d1('0x25')]!==_0x44d5f0[_0xb0d1('0x25')]||_0x165a3f[_0xb0d1('0x26')]!==_0x44d5f0[_0xb0d1('0x26')]||_0x165a3f[_0xb0d1('0x27')]!==_0x44d5f0[_0xb0d1('0x27')]||_0x165a3f['talking']!==_0x44d5f0[_0xb0d1('0x28')]||_0x165a3f[_0xb0d1('0x29')]!==_0x44d5f0[_0xb0d1('0x29')]||_0x165a3f[_0xb0d1('0x2a')]!==_0x44d5f0[_0xb0d1('0x2a')]||_0x165a3f[_0xb0d1('0x2b')]!==_0x44d5f0[_0xb0d1('0x2b')]||_0x165a3f[_0xb0d1('0x2c')]!==_0x44d5f0[_0xb0d1('0x2c')];if(_0x165a3f[_0xb0d1('0x2d')]&&_0x44d5f0[_0xb0d1('0x2d')]){_0x509034=_0x165a3f[_0xb0d1('0x2d')]['name']!==_0x44d5f0[_0xb0d1('0x2d')]['name']||_0x165a3f[_0xb0d1('0x2d')]['active']!==_0x44d5f0['Trunk'][_0xb0d1('0x2e')];}return _0x30c591||_0x3913fe||_0x509034;}exports[_0xb0d1('0x2f')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xdc5e85){var _0x29bb22=null;var _0x2c5493=_0xdc5e85['dialTimezone'];if(_[_0xb0d1('0x30')](_0xdc5e85[_0xb0d1('0x31')])||_[_0xb0d1('0x30')](_0xdc5e85[_0xb0d1('0x32')])||_['isNil'](_0xdc5e85[_0xb0d1('0x32')]['Intervals'])){_0x29bb22=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xb0d1('0x33')](_0xdc5e85['dialGlobalInterval'])||_[_0xb0d1('0x33')](_0xdc5e85[_0xb0d1('0x32')][_0xb0d1('0x34')])){_0x29bb22=CAMPAIGN_STATUS[_0xb0d1('0x35')];}else if(_0x2c5493&&!timezones[_0x2c5493]){_0x29bb22=CAMPAIGN_STATUS[_0xb0d1('0x36')];}return _0x29bb22;}function checkAnyValidTrunk(_0x31c144,_0x40acfa){var _0x593873=null;var _0x752c51=_0xb0d1('0x37');var _0xac1ae3=[_0xb0d1('0x38'),_0xb0d1('0x39')];var _0x1e890e=!![];if(_0x31c144['Trunk']&&_0x31c144['Trunk']['active']){_0x752c51+=_0x31c144[_0xb0d1('0x2d')]['name'];_0x593873=_0x40acfa[_0x752c51];_0x1e890e=_0xac1ae3['includes'](_0x593873[_0xb0d1('0x3a')]);}else if(_0x31c144[_0xb0d1('0x3b')]&&_0x31c144[_0xb0d1('0x3b')]['active']){_0x752c51+=_0x31c144[_0xb0d1('0x3b')][_0xb0d1('0x3c')];_0x593873=_0x40acfa[_0x752c51];_0x1e890e=_0xac1ae3[_0xb0d1('0x3d')](_0x593873['status']);}return _0x1e890e;}function getQueueCampaignStatusMessage(_0x55e639,_0x2e250f){var _0x3693d7=CAMPAIGN_STATUS[_0xb0d1('0x6')];var _0x1c627a=isPreviewCampaign(_0x55e639);if(!isQueueCampaignActive(_0x55e639)){if(_0x1c627a){_0x3693d7=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x55e639[_0xb0d1('0x2c')]===0x0&&_0x55e639['talking']===0x0&&_0x55e639[_0xb0d1('0x2a')]===0x0&&(_0x55e639[_0xb0d1('0x29')]||0x0)===0x0){_0x3693d7=CAMPAIGN_STATUS[_0xb0d1('0x3e')];}else{_0x3693d7=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x55e639[_0xb0d1('0x25')]===0x0){_0x3693d7=CAMPAIGN_STATUS[_0xb0d1('0x3f')];}else if(!checkAnyValidTrunk(_0x55e639,_0x2e250f)){_0x3693d7=CAMPAIGN_STATUS[_0xb0d1('0x40')];}else if(!isPreviewCampaign(_0x55e639)){var _0x1899e4=checkAnyValidQueueCampaignInterval(_0x55e639);if(_0x1899e4){_0x3693d7=_0x1899e4;}}return _0x3693d7;}exports[_0xb0d1('0x41')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x141075){var _0x575376=CAMPAIGN_STATUS['DISACTIVED'];if(_0x141075[_0xb0d1('0x2c')]===0x0&&_0x141075[_0xb0d1('0x28')]===0x0&&_0x141075['waiting']===0x0&&(_0x141075['pTalking']||0x0)===0x0){_0x575376=CAMPAIGN_STATUS[_0xb0d1('0x3e')];}return _0x575376;}exports[_0xb0d1('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xc5bf5a){var _0xbabfad=_0xc5bf5a[_0xb0d1('0x43')](/"(.*?)"/);return _0xbabfad?_0xbabfad[0x1]:_0xc5bf5a;}exports[_0xb0d1('0x44')]=extractCalleridName;function getCallerId(_0x32bf8d,_0x3e461a,_0x30f995){if(!_[_0xb0d1('0x45')](_0x30f995)&&typeof _0x30f995==='string'&&!_[_0xb0d1('0x33')](_0x30f995)){if(!_['isUndefined'](_0x3e461a)&&typeof _0x3e461a===_0xb0d1('0x46')&&!_[_0xb0d1('0x33')](_0x3e461a)){return util[_0xb0d1('0x47')](_0xb0d1('0x48'),_0x3e461a,_0x30f995);}return util[_0xb0d1('0x47')](_0xb0d1('0x48'),_0x30f995,_0x30f995);}if(!_[_0xb0d1('0x45')](_0x32bf8d)&&typeof _0x32bf8d===_0xb0d1('0x46')&&!_[_0xb0d1('0x33')](_0x32bf8d)){return _0x32bf8d;}return'\x22\x22\x20<>';}exports[_0xb0d1('0x49')]=getCallerId;function getCallerIdRandom(_0x2b90bc,_0x3d4fb4){var _0x2adf84;var _0xe36593;var _0x4c03e6;if(_0x3d4fb4<=0x0){_0x3d4fb4=0x1;}_0x2adf84=new RegExp(_0xb0d1('0x4a')+_0x3d4fb4+'}$');_0xe36593=Math['pow'](0xa,_0x3d4fb4-0x1);_0x4c03e6=Math[_0xb0d1('0x4b')](0xa,_0x3d4fb4)-0x1;return util[_0xb0d1('0x47')]('%s',_['replace'](_0x2b90bc,_0x2adf84,_[_0xb0d1('0x4c')](_0xe36593,_0x4c03e6)[_0xb0d1('0x4d')]()));}exports[_0xb0d1('0x4e')]=getCallerIdRandom;function decrementOriginate(_0x9f1c1){if(_0x9f1c1[_0xb0d1('0x2c')]&&_0x9f1c1['originated']>0x0){_0x9f1c1[_0xb0d1('0x2c')]-=0x1;}else{logger[_0xb0d1('0x4f')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xb0d1('0x50')]=decrementOriginate;function checkContactEmpty(_0x264c36){return _0x264c36&&_0x264c36[_0xb0d1('0x51')]>0x0;}exports[_0xb0d1('0x52')]=checkContactEmpty;function erlangb(_0x1aa709,_0x406e63){if(_0x406e63===0x0){return 0x0;}var _0x3d9e6e=0x1;for(var _0x17dc8d=0x1;_0x17dc8d<=_0x406e63;_0x17dc8d+=0x1){_0x3d9e6e=0x1+_0x3d9e6e*_0x17dc8d/_0x1aa709;}return 0x1/_0x3d9e6e;}exports[_0xb0d1('0x53')]=erlangb;function checkContactLowerLimitOriginate(_0x1040dc,_0x1d3876,_0x4a838e){if(_0x1d3876>_0x4a838e){for(var _0x3caff7=0x0;_0x3caff7<_0x1d3876-_0x4a838e;_0x3caff7+=0x1){decrementOriginate(_0x1040dc);}}}exports[_0xb0d1('0x54')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x49d405){var _0x41772a={};var _0x3652d0=['id',_0xb0d1('0x55'),_0xb0d1('0x56'),'tags',_0xb0d1('0x57')];if(_0x49d405){for(var _0x4963b1 in _0x49d405){if(typeof _0x49d405[_0x4963b1]!==_0xb0d1('0x58')){if(!_[_0xb0d1('0x30')](_0x49d405[_0x4963b1])&&!_0x3652d0[_0xb0d1('0x3d')](_0x4963b1)){_0x41772a[util[_0xb0d1('0x47')](_0xb0d1('0x59'),_0xb0d1('0x5a'),_0x4963b1[_0xb0d1('0x5b')]())]=_0x49d405[_0x4963b1];}}}}return _0x41772a;}exports[_0xb0d1('0x5c')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index fa31587..9bbfa59 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(_0x2e2f66,_0x14092c){var _0xae38f7=function(_0x4febd9){while(--_0x4febd9){_0x2e2f66['push'](_0x2e2f66['shift']());}};_0xae38f7(++_0x14092c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0xe955dc,_0x578602){var _0x53790c=function(_0x388dfd){while(--_0x388dfd){_0xe955dc['push'](_0xe955dc['shift']());}};_0x53790c(++_0x578602);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 62f5d68..2640cec 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 _0x2833=['./util/util','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','update','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','then','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','status','reachable','unmonitored','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','./channel'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x2833,0x6b));var _0x3283=function(_0x10df6f,_0x26792f){_0x10df6f=_0x10df6f-0x0;var _0x26b354=_0x2833[_0x10df6f];return _0x26b354;};'use strict';var util=require(_0x3283('0x0'));var _=require(_0x3283('0x1'));var BPromise=require(_0x3283('0x2'));var uuid=require(_0x3283('0x3'));var moment=require(_0x3283('0x4'));var path=require(_0x3283('0x5'));var tiff2pdf=require(_0x3283('0x6'));var gs=require(_0x3283('0x7'));var logger=require(_0x3283('0x8'))('fax');var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x3283('0x9'));var ut=require(_0x3283('0xa'));var Action=require('./action');var faxAccount=require(_0x3283('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x3283('0xc'));function Fax(_0x50fe68){this['channels']={};this[_0x3283('0xd')]=_0x50fe68[_0x3283('0xd')];this[_0x3283('0xe')]=_0x50fe68[_0x3283('0xe')];this[_0x3283('0xf')]={};ami['on'](_0x3283('0x10'),this[_0x3283('0x11')][_0x3283('0x12')](this));ami['on'](_0x3283('0x13'),this[_0x3283('0x14')][_0x3283('0x12')](this));ami['on'](_0x3283('0x15'),this['syncNewState'][_0x3283('0x12')](this));ami['on'](_0x3283('0x16'),this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0x3283('0x17')][_0x3283('0x12')](this));ami['on'](_0x3283('0x18'),this[_0x3283('0x19')][_0x3283('0x12')](this));ami['on'](_0x3283('0x1a'),this[_0x3283('0x1b')][_0x3283('0x12')](this));ami['on'](_0x3283('0x1c'),this[_0x3283('0x1d')]['bind'](this));}Fax[_0x3283('0x1e')]['syncNewchannel']=function(_0x274c66){if(_0x274c66[_0x3283('0x1f')]==='from-voip-provider'){for(var _0x3a370c in this[_0x3283('0xd')]){if(this[_0x3283('0xd')][_0x3283('0x20')](_0x3a370c)){if(_0x274c66[_0x3283('0x21')]===this[_0x3283('0xd')][_0x3a370c][_0x3283('0x22')]){this[_0x3283('0x23')][_0x274c66[_0x3283('0x24')]]={};this['channels'][_0x274c66['uniqueid']][_0x3283('0x25')]=_0x274c66[_0x3283('0x25')];this[_0x3283('0x23')][_0x274c66[_0x3283('0x24')]]['id']=this[_0x3283('0xd')][_0x3a370c]['id'];this[_0x3283('0x23')][_0x274c66[_0x3283('0x24')]][_0x3283('0x26')]=this['faxAccounts'][_0x3a370c][_0x3283('0x26')];logger['info'](_0x274c66[_0x3283('0x24')],_0x3283('0x27'));}}}}if(this[_0x3283('0xf')][_0x274c66[_0x3283('0x24')]]){this[_0x3283('0x23')][_0x274c66[_0x3283('0x24')]]={};this[_0x3283('0x23')][_0x274c66['uniqueid']][_0x3283('0x25')]=_0x274c66[_0x3283('0x25')];logger[_0x3283('0x28')](_0x274c66[_0x3283('0x24')],_0x3283('0x27'));}};Fax[_0x3283('0x1e')][_0x3283('0x14')]=function(_0x36d5b4){if(this['channels'][_0x36d5b4[_0x3283('0x24')]]){for(var _0x3f0b87 in _0x36d5b4[_0x3283('0x29')]){if(_0x36d5b4[_0x3283('0x29')][_0x3283('0x20')](_0x3f0b87)){this[_0x3283('0x23')][_0x36d5b4['uniqueid']][_0x3f0b87]=_0x36d5b4[_0x3283('0x2a')];}}}};Fax[_0x3283('0x1e')][_0x3283('0x2b')]=function(_0x5e234d){if(this[_0x3283('0x23')][_0x5e234d[_0x3283('0x24')]]){this[_0x3283('0x23')][_0x5e234d['uniqueid']][_0x3283('0x2c')]=_0x5e234d['channelstate'];this[_0x3283('0x23')][_0x5e234d[_0x3283('0x24')]][_0x3283('0x2d')]=_0x5e234d[_0x3283('0x2d')];}};Fax[_0x3283('0x1e')][_0x3283('0x2e')]=function(_0x1d4011){if(this[_0x3283('0x23')][_0x1d4011['uniqueid']]){for(var _0x7c676f in _0x1d4011[_0x3283('0x29')]){if(_0x1d4011[_0x3283('0x29')][_0x3283('0x20')](_0x7c676f)){this[_0x3283('0x23')][_0x1d4011[_0x3283('0x24')]][_0x7c676f]=_0x1d4011[_0x3283('0x2a')];}}}};Fax['prototype'][_0x3283('0x17')]=function(_0xe3c168){if(this['channels'][_0xe3c168['uniqueid']]){this[_0x3283('0x23')][_0xe3c168['uniqueid']][_0x3283('0x2f')]=_0xe3c168['operation'];this[_0x3283('0x23')][_0xe3c168[_0x3283('0x24')]]['status']=_0xe3c168['status'];this[_0x3283('0x23')][_0xe3c168[_0x3283('0x24')]][_0x3283('0x22')]=_0xe3c168[_0x3283('0x22')];this[_0x3283('0x23')][_0xe3c168['uniqueid']]['filename']=_0xe3c168[_0x3283('0x30')];logger[_0x3283('0x28')](_0xe3c168[_0x3283('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x3283('0x1e')][_0x3283('0x19')]=function(_0x58924b){var _0xfd7856=this;if(this[_0x3283('0x23')][_0x58924b[_0x3283('0x24')]]){var _0x57760a=this[_0x3283('0x23')][_0x58924b[_0x3283('0x24')]]['id'];this[_0x3283('0x23')][_0x58924b[_0x3283('0x24')]]['remotestationid']=_0x58924b[_0x3283('0x31')];this[_0x3283('0x23')][_0x58924b[_0x3283('0x24')]]['pagestransferred']=_0x58924b[_0x3283('0x32')];this['channels'][_0x58924b[_0x3283('0x24')]][_0x3283('0x22')]=_0x58924b['localstationid'];this[_0x3283('0x23')][_0x58924b['uniqueid']][_0x3283('0x33')]=_0x58924b[_0x3283('0x33')];this[_0x3283('0x23')][_0x58924b[_0x3283('0x24')]]['transferrate']=_0x58924b[_0x3283('0x34')];this['channels'][_0x58924b['uniqueid']][_0x3283('0x30')]=_0x58924b[_0x3283('0x30')];this[_0x3283('0x23')][_0x58924b[_0x3283('0x24')]][_0x3283('0x35')]=_0x58924b[_0x3283('0x35')];if(this[_0x3283('0x23')][_0x58924b['uniqueid']][_0x3283('0x32')]>0x0){tiff2pdf(_0x58924b[_0x3283('0x30')],_0x3283('0x36'),function(_0x53a817){logger['info'](_0x58924b[_0x3283('0x24')],_0x3283('0x37'),_0x53a817[_0x3283('0x38')]);attachment[_0x3283('0x39')]({'name':path[_0x3283('0x3a')](_0x58924b[_0x3283('0x30')])[_0x3283('0x26')],'basename':path[_0x3283('0x3a')](_0x58924b['filename'])[_0x3283('0x26')]+_0x3283('0x3b'),'type':'application/pdf'})['then'](function(_0x62902e){faxAccount[_0x3283('0x3c')](_0x57760a,{'from':_0x58924b[_0x3283('0x35')],'mapKey':_0x3283('0x3d'),'body':path[_0x3283('0x3a')](_0x58924b[_0x3283('0x30')])['name']+_0x3283('0x3b'),'AttachmentId':_0x62902e['id']})[_0x3283('0x3e')](function(_0x23f9ff){logger[_0x3283('0x3f')](_0x58924b[_0x3283('0x24')],_0x3283('0x40'),JSON[_0x3283('0x41')](_0x23f9ff));});})[_0x3283('0x3e')](function(_0x496820){logger[_0x3283('0x3f')](_0x58924b['uniqueid'],'\x20receiveFax\x20',JSON[_0x3283('0x41')](_0x496820));});});}logger['info'](_0x58924b[_0x3283('0x24')],_0x3283('0x42'));}};Fax[_0x3283('0x1e')]['syncOriginateResponse']=function(_0x31f03a){if(this[_0x3283('0xf')][_0x31f03a[_0x3283('0x24')]]){_[_0x3283('0x43')](this['channels'][_0x31f03a[_0x3283('0x24')]],_[_0x3283('0x44')](_0x31f03a,[_0x3283('0x45'),_0x3283('0x46')]));}};function updateStatus(_0x562db0){if(_0x562db0[_0x3283('0x47')]){faxMessage['update'](_0x562db0['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x3fad6a){ut[_0x3283('0x48')](_0x3283('0x49'),_0x3fad6a);})['catch'](function(_0x4ba124){ut[_0x3283('0x48')](_0x3283('0x4a'),_0x4ba124);});}else{ut[_0x3283('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x3283('0x1e')]['updateStatus']=function(_0x1a2c0a,_0x9d7b96,_0x48ec5c){var _0x2bac44=this;var _0x4f06a7={};if(_0x9d7b96){_0x4f06a7={'read':_0x9d7b96};}else{_0x4f06a7={'failMessage':_0x48ec5c};}if(this[_0x3283('0xf')][_0x1a2c0a][_0x3283('0x47')]){faxMessage[_0x3283('0x4b')](this['actions'][_0x1a2c0a]['AttachmentId'],_0x4f06a7)['then'](function(_0x40fa9a){ut[_0x3283('0x48')]('[Fax][Message][Updated]',_0x40fa9a);})[_0x3283('0x3e')](function(_0x29bd11){ut[_0x3283('0x48')]('[Fax][Message][NoUpdate1]',_0x29bd11);})[_0x3283('0x4c')](function(){delete _0x2bac44[_0x3283('0x23')][_0x1a2c0a];delete _0x2bac44[_0x3283('0xf')][_0x1a2c0a];});}else{ut[_0x3283('0x48')](_0x3283('0x4d'));delete this[_0x3283('0x23')][_0x1a2c0a];delete this[_0x3283('0xf')][_0x1a2c0a];}};Fax[_0x3283('0x1e')][_0x3283('0x1b')]=function(_0x53abec){var _0x108c90=this;if(this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]]){if(this[_0x3283('0xf')][_0x53abec[_0x3283('0x24')]]){this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]]['id']=this['actions'][_0x53abec['uniqueid']]['id'];this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]][_0x3283('0x26')]=this[_0x3283('0xf')][_0x53abec[_0x3283('0x24')]][_0x3283('0x26')];}logger['info'](_0x53abec['uniqueid'],this['actions'][_0x53abec[_0x3283('0x24')]]?'\x20hangup\x20sendFile\x20':_0x3283('0x4e'),JSON[_0x3283('0x41')](this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]]));if(this[_0x3283('0xf')][_0x53abec[_0x3283('0x24')]]){if(this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]][_0x3283('0x4f')]>0x0&&this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]][_0x3283('0x50')]===_0x3283('0x51')){this[_0x3283('0x52')](_0x53abec[_0x3283('0x24')],!![]);}else{this[_0x3283('0x52')](_0x53abec['uniqueid'],![],this[_0x3283('0x23')][_0x53abec['uniqueid']][_0x3283('0x53')]?_0x3283('0x54')+this[_0x3283('0x23')][_0x53abec[_0x3283('0x24')]][_0x3283('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x3283('0x1e')][_0x3283('0x55')]=function(_0x31165a){var _0x1d5e7d=this;return new BPromise(function(_0x41b0cb,_0x5f4844){_0x1d5e7d[_0x3283('0x56')](_0x31165a,_0x1d5e7d['faxAccounts'][_0x31165a[_0x3283('0x57')]])[_0x3283('0x58')](function(_0x27da79){ut[_0x3283('0x48')](_0x3283('0x59'),_0x27da79);_0x41b0cb(ut['message'](_0x3283('0x5a')));})['catch'](function(_0x47dd46){ut[_0x3283('0x48')](_0x3283('0x5b'),_0x47dd46);updateStatus(_0x31165a);_0x5f4844(ut['message'](_0x3283('0x5c')));});});};Fax[_0x3283('0x1e')][_0x3283('0x5d')]=function(_0x2ac712){var _0x4b6838=this;return new BPromise(function(_0x118bd1,_0xcd56e0){var _0x2a56dc=_0x4b6838[_0x3283('0x5e')](_0x4b6838['faxAccounts'][_0x2ac712['FaxAccountId']][_0x3283('0x5f')],_0x2ac712);if(_0x2a56dc['isValid']){_0x118bd1(ut[_0x3283('0x38')]('Trunk\x20Reachable'));}else{_0xcd56e0(ut[_0x3283('0x38')](_0x2a56dc[_0x3283('0x38')]));}});};function originate(_0xa8f3be,_0x34dbf3,_0x40af93){return new BPromise(function(_0x285221,_0x5cecf5){if(_0x40af93){var _0x155919=util[_0x3283('0x60')](_0x3283('0x61'),path[_0x3283('0x3a')](_0xa8f3be[_0x3283('0x5')])[_0x3283('0x26')],_0xa8f3be[_0x3283('0x5')]);gs['execute'](_0x155919)[_0x3283('0x58')](function(){_0xa8f3be[_0x3283('0x5')]=util[_0x3283('0x60')](_0x3283('0x62'),path['parse'](_0xa8f3be[_0x3283('0x5')])[_0x3283('0x63')],path[_0x3283('0x3a')](_0xa8f3be['path'])[_0x3283('0x26')]);_0x34dbf3[_0x3283('0x64')]=_0xa8f3be[_0x3283('0x5')];ut[_0x3283('0x48')](_0x3283('0x65'),'');ami[_0x3283('0x66')](ut[_0x3283('0x67')](_0xa8f3be,_0x34dbf3))['then'](function(_0x1423b7){_0x285221(_0x1423b7);})['catch'](function(_0x501f51){_0x5cecf5(_0x501f51);});})[_0x3283('0x3e')](function(_0x35e54a){_0x5cecf5(_0x35e54a);});}else{ami['Action'](ut[_0x3283('0x67')](_0xa8f3be,_0x34dbf3))[_0x3283('0x58')](function(_0x45a79a){_0x285221(_0x45a79a);})[_0x3283('0x3e')](function(_0x58df1e){_0x5cecf5(_0x58df1e);});}});}Fax[_0x3283('0x1e')][_0x3283('0x56')]=function(_0x43788e,_0x35c072){var _0x183c8a=this;return new BPromise(function(_0x5a197d,_0x428435){var _0xdac5b0=uuid['v4']();var _0x1d5606=ut['addVariables'](_0x43788e,_0x35c072);_0x183c8a[_0x3283('0xf')][_0xdac5b0]=new Action(_0xdac5b0,_0x35c072,_0x43788e);var _0x56b4a7=_0x183c8a['actions'][_0xdac5b0];if(path[_0x3283('0x3a')](_0x43788e[_0x3283('0x5')])[_0x3283('0x68')]===_0x3283('0x3b')){originate(_0x56b4a7,_0x1d5606,!![])[_0x3283('0x58')](function(_0xb3c552){_0x5a197d(_0xb3c552);})[_0x3283('0x3e')](function(_0x140d27){_0x428435(_0x140d27);});}else{originate(_0x56b4a7,_0x1d5606,![])[_0x3283('0x58')](function(_0x3212bd){_0x5a197d(_0x3212bd);})[_0x3283('0x3e')](function(_0x102bd3){_0x428435(_0x102bd3);});}});};Fax[_0x3283('0x1e')][_0x3283('0x69')]=function(_0x1da73b){return!_[_0x3283('0x6a')](_0x1da73b)&&!_[_0x3283('0x6a')](_0x1da73b[_0x3283('0x26')])&&!_[_0x3283('0x6a')](_0x1da73b['active'])&&_0x1da73b[_0x3283('0x6b')]&&!_[_0x3283('0x6a')](this[_0x3283('0xe')][util[_0x3283('0x60')](_0x3283('0x6c'),_0x1da73b[_0x3283('0x26')])])&&!_[_0x3283('0x6a')](this[_0x3283('0xe')][util[_0x3283('0x60')](_0x3283('0x6c'),_0x1da73b[_0x3283('0x26')])][_0x3283('0x6d')])&&(this['trunks'][util[_0x3283('0x60')]('SIP/%s',_0x1da73b[_0x3283('0x26')])][_0x3283('0x6d')]===_0x3283('0x6e')||this[_0x3283('0xe')][util[_0x3283('0x60')](_0x3283('0x6c'),_0x1da73b[_0x3283('0x26')])][_0x3283('0x6d')]===_0x3283('0x6f'));};Fax[_0x3283('0x1e')]['checkTrunk']=function(_0x15d1aa,_0x29db32){if(!this[_0x3283('0x69')](_0x15d1aa)){ut[_0x3283('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x3283('0x6a')](_0x15d1aa)?'':_0x15d1aa[_0x3283('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3283('0x70')};}if(_['isNil'](_0x29db32[_0x3283('0x3d')])){ut[_0x3283('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x3283('0x41')](_0x29db32));return{'isValid':![],'message':_0x3283('0x71')};}if(_[_0x3283('0x6a')](_0x29db32[_0x3283('0x5')])){ut[_0x3283('0x48')](_0x3283('0x72'),JSON[_0x3283('0x41')](_0x29db32));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x3283('0x73')};};module[_0x3283('0x74')]=Fax; \ No newline at end of file +var _0x41d8=['bluebird','uuid','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','prototype','from-voip-provider','hasOwnProperty','exten','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','localstationid','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','then','fax','error','stringify','catch','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','checkTrunk','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x41d8,0xed));var _0x841d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x41d8[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x841d('0x0'));var _=require('lodash');var BPromise=require(_0x841d('0x1'));var uuid=require(_0x841d('0x2'));var moment=require(_0x841d('0x3'));var path=require(_0x841d('0x4'));var tiff2pdf=require(_0x841d('0x5'));var gs=require(_0x841d('0x6'));var logger=require('../../../config/logger')('fax');var ami=require(_0x841d('0x7'));var rpcDb=require(_0x841d('0x8'));var Channel=require('./channel');var ut=require(_0x841d('0x9'));var Action=require(_0x841d('0xa'));var faxAccount=require(_0x841d('0xb'));var attachment=require(_0x841d('0xc'));var faxMessage=require(_0x841d('0xd'));function Fax(_0x19eeb6){this['channels']={};this[_0x841d('0xe')]=_0x19eeb6['faxAccounts'];this[_0x841d('0xf')]=_0x19eeb6[_0x841d('0xf')];this[_0x841d('0x10')]={};ami['on']('newchannel',this['syncNewchannel'][_0x841d('0x11')](this));ami['on'](_0x841d('0x12'),this['syncVarSet'][_0x841d('0x11')](this));ami['on'](_0x841d('0x13'),this[_0x841d('0x14')]['bind'](this));ami['on'](_0x841d('0x15'),this[_0x841d('0x16')][_0x841d('0x11')](this));ami['on'](_0x841d('0x17'),this[_0x841d('0x18')]['bind'](this));ami['on'](_0x841d('0x19'),this[_0x841d('0x1a')][_0x841d('0x11')](this));ami['on']('hangup',this[_0x841d('0x1b')][_0x841d('0x11')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x841d('0x11')](this));}Fax[_0x841d('0x1c')]['syncNewchannel']=function(_0x3221ec){if(_0x3221ec['context']===_0x841d('0x1d')){for(var _0x2298e1 in this[_0x841d('0xe')]){if(this[_0x841d('0xe')][_0x841d('0x1e')](_0x2298e1)){if(_0x3221ec[_0x841d('0x1f')]===this[_0x841d('0xe')][_0x2298e1]['localstationid']){this['channels'][_0x3221ec[_0x841d('0x20')]]={};this[_0x841d('0x21')][_0x3221ec[_0x841d('0x20')]][_0x841d('0x22')]=_0x3221ec[_0x841d('0x22')];this[_0x841d('0x21')][_0x3221ec[_0x841d('0x20')]]['id']=this['faxAccounts'][_0x2298e1]['id'];this[_0x841d('0x21')][_0x3221ec['uniqueid']][_0x841d('0x23')]=this[_0x841d('0xe')][_0x2298e1][_0x841d('0x23')];logger[_0x841d('0x24')](_0x3221ec[_0x841d('0x20')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x3221ec[_0x841d('0x20')]]){this[_0x841d('0x21')][_0x3221ec[_0x841d('0x20')]]={};this[_0x841d('0x21')][_0x3221ec[_0x841d('0x20')]]['channel']=_0x3221ec[_0x841d('0x22')];logger[_0x841d('0x24')](_0x3221ec[_0x841d('0x20')],_0x841d('0x25'));}};Fax[_0x841d('0x1c')][_0x841d('0x26')]=function(_0x566f43){if(this['channels'][_0x566f43[_0x841d('0x20')]]){for(var _0x464043 in _0x566f43['variable']){if(_0x566f43[_0x841d('0x27')][_0x841d('0x1e')](_0x464043)){this[_0x841d('0x21')][_0x566f43[_0x841d('0x20')]][_0x464043]=_0x566f43[_0x841d('0x28')];}}}};Fax['prototype'][_0x841d('0x14')]=function(_0x28abb4){if(this['channels'][_0x28abb4[_0x841d('0x20')]]){this['channels'][_0x28abb4['uniqueid']]['channelstate']=_0x28abb4[_0x841d('0x29')];this[_0x841d('0x21')][_0x28abb4['uniqueid']][_0x841d('0x2a')]=_0x28abb4[_0x841d('0x2a')];}};Fax[_0x841d('0x1c')]['syncNewExten']=function(_0x7b8fab){if(this[_0x841d('0x21')][_0x7b8fab[_0x841d('0x20')]]){for(var _0x4dabc9 in _0x7b8fab[_0x841d('0x27')]){if(_0x7b8fab[_0x841d('0x27')]['hasOwnProperty'](_0x4dabc9)){this['channels'][_0x7b8fab[_0x841d('0x20')]][_0x4dabc9]=_0x7b8fab[_0x841d('0x28')];}}}};Fax[_0x841d('0x1c')][_0x841d('0x18')]=function(_0x2f2150){if(this['channels'][_0x2f2150[_0x841d('0x20')]]){this[_0x841d('0x21')][_0x2f2150['uniqueid']][_0x841d('0x2b')]=_0x2f2150[_0x841d('0x2b')];this['channels'][_0x2f2150[_0x841d('0x20')]][_0x841d('0x2c')]=_0x2f2150[_0x841d('0x2c')];this[_0x841d('0x21')][_0x2f2150['uniqueid']]['localstationid']=_0x2f2150['localstationid'];this['channels'][_0x2f2150['uniqueid']][_0x841d('0x2d')]=_0x2f2150[_0x841d('0x2d')];logger[_0x841d('0x24')](_0x2f2150['uniqueid'],_0x841d('0x2e'));}};Fax[_0x841d('0x1c')][_0x841d('0x1a')]=function(_0x9517e5){var _0x27b0f8=this;if(this[_0x841d('0x21')][_0x9517e5[_0x841d('0x20')]]){var _0x33ea5a=this['channels'][_0x9517e5[_0x841d('0x20')]]['id'];this[_0x841d('0x21')][_0x9517e5[_0x841d('0x20')]][_0x841d('0x2f')]=_0x9517e5['remotestationid'];this[_0x841d('0x21')][_0x9517e5['uniqueid']][_0x841d('0x30')]=_0x9517e5[_0x841d('0x30')];this[_0x841d('0x21')][_0x9517e5['uniqueid']][_0x841d('0x31')]=_0x9517e5['localstationid'];this[_0x841d('0x21')][_0x9517e5[_0x841d('0x20')]][_0x841d('0x32')]=_0x9517e5[_0x841d('0x32')];this[_0x841d('0x21')][_0x9517e5[_0x841d('0x20')]][_0x841d('0x33')]=_0x9517e5['transferrate'];this[_0x841d('0x21')][_0x9517e5['uniqueid']][_0x841d('0x2d')]=_0x9517e5['filename'];this[_0x841d('0x21')][_0x9517e5[_0x841d('0x20')]][_0x841d('0x34')]=_0x9517e5[_0x841d('0x34')];if(this[_0x841d('0x21')][_0x9517e5[_0x841d('0x20')]]['pagestransferred']>0x0){tiff2pdf(_0x9517e5['filename'],_0x841d('0x35'),function(_0x5cec2d){logger[_0x841d('0x24')](_0x9517e5[_0x841d('0x20')],_0x841d('0x36'),_0x5cec2d['message']);attachment[_0x841d('0x37')]({'name':path['parse'](_0x9517e5[_0x841d('0x2d')])[_0x841d('0x23')],'basename':path[_0x841d('0x38')](_0x9517e5['filename'])['name']+_0x841d('0x39'),'type':'application/pdf'})[_0x841d('0x3a')](function(_0x53c51c){faxAccount['notify'](_0x33ea5a,{'from':_0x9517e5['calleridnum'],'mapKey':_0x841d('0x3b'),'body':path['parse'](_0x9517e5['filename'])['name']+_0x841d('0x39'),'AttachmentId':_0x53c51c['id']})['catch'](function(_0x2007e4){logger[_0x841d('0x3c')](_0x9517e5[_0x841d('0x20')],'\x20notify\x20',JSON[_0x841d('0x3d')](_0x2007e4));});})[_0x841d('0x3e')](function(_0x332a24){logger[_0x841d('0x3c')](_0x9517e5[_0x841d('0x20')],_0x841d('0x3f'),JSON[_0x841d('0x3d')](_0x332a24));});});}logger[_0x841d('0x24')](_0x9517e5['uniqueid'],_0x841d('0x3f'));}};Fax[_0x841d('0x1c')][_0x841d('0x40')]=function(_0x4ef8f3){if(this[_0x841d('0x10')][_0x4ef8f3[_0x841d('0x20')]]){_[_0x841d('0x41')](this['channels'][_0x4ef8f3[_0x841d('0x20')]],_[_0x841d('0x42')](_0x4ef8f3,[_0x841d('0x43'),'reason']));}};function updateStatus(_0x32db53){if(_0x32db53[_0x841d('0x44')]){faxMessage[_0x841d('0x45')](_0x32db53[_0x841d('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x841d('0x3a')](function(_0x3b59e4){ut[_0x841d('0x46')](_0x841d('0x47'),_0x3b59e4);})[_0x841d('0x3e')](function(_0x537341){ut[_0x841d('0x46')](_0x841d('0x48'),_0x537341);});}else{ut[_0x841d('0x46')](_0x841d('0x49'));}}Fax[_0x841d('0x1c')][_0x841d('0x4a')]=function(_0x48cc87,_0x146525,_0x4e8069){var _0x10f6b8=this;var _0x549d3c={};if(_0x146525){_0x549d3c={'read':_0x146525};}else{_0x549d3c={'failMessage':_0x4e8069};}if(this[_0x841d('0x10')][_0x48cc87][_0x841d('0x44')]){faxMessage['update'](this['actions'][_0x48cc87][_0x841d('0x44')],_0x549d3c)[_0x841d('0x3a')](function(_0x52bb80){ut[_0x841d('0x46')]('[Fax][Message][Updated]',_0x52bb80);})[_0x841d('0x3e')](function(_0x18ba5e){ut[_0x841d('0x46')](_0x841d('0x4b'),_0x18ba5e);})[_0x841d('0x4c')](function(){delete _0x10f6b8[_0x841d('0x21')][_0x48cc87];delete _0x10f6b8['actions'][_0x48cc87];});}else{ut['logger'](_0x841d('0x4d'));delete this['channels'][_0x48cc87];delete this[_0x841d('0x10')][_0x48cc87];}};Fax[_0x841d('0x1c')]['syncHangup']=function(_0x4c05fb){var _0xb9119c=this;if(this[_0x841d('0x21')][_0x4c05fb['uniqueid']]){if(this[_0x841d('0x10')][_0x4c05fb[_0x841d('0x20')]]){this[_0x841d('0x21')][_0x4c05fb[_0x841d('0x20')]]['id']=this['actions'][_0x4c05fb[_0x841d('0x20')]]['id'];this[_0x841d('0x21')][_0x4c05fb[_0x841d('0x20')]][_0x841d('0x23')]=this['actions'][_0x4c05fb[_0x841d('0x20')]][_0x841d('0x23')];}logger[_0x841d('0x24')](_0x4c05fb[_0x841d('0x20')],this[_0x841d('0x10')][_0x4c05fb[_0x841d('0x20')]]?_0x841d('0x4e'):_0x841d('0x4f'),JSON[_0x841d('0x3d')](this['channels'][_0x4c05fb['uniqueid']]));if(this['actions'][_0x4c05fb['uniqueid']]){if(this[_0x841d('0x21')][_0x4c05fb['uniqueid']][_0x841d('0x50')]>0x0&&this[_0x841d('0x21')][_0x4c05fb[_0x841d('0x20')]][_0x841d('0x17')]===_0x841d('0x51')){this[_0x841d('0x4a')](_0x4c05fb[_0x841d('0x20')],!![]);}else{this[_0x841d('0x4a')](_0x4c05fb[_0x841d('0x20')],![],this['channels'][_0x4c05fb['uniqueid']][_0x841d('0x52')]?_0x841d('0x53')+this[_0x841d('0x21')][_0x4c05fb[_0x841d('0x20')]]['faxstatusstring']:_0x841d('0x54'));}}}};Fax[_0x841d('0x1c')][_0x841d('0x55')]=function(_0x291a46){var _0x14a206=this;return new BPromise(function(_0x504f5f,_0x5b4432){_0x14a206[_0x841d('0x56')](_0x291a46,_0x14a206['faxAccounts'][_0x291a46['FaxAccountId']])[_0x841d('0x3a')](function(_0x2d1a6f){ut[_0x841d('0x46')](_0x841d('0x57'),_0x2d1a6f);_0x504f5f(ut[_0x841d('0x58')](_0x841d('0x59')));})[_0x841d('0x3e')](function(_0x129b76){ut[_0x841d('0x46')](_0x841d('0x5a'),_0x129b76);updateStatus(_0x291a46);_0x5b4432(ut[_0x841d('0x58')]('Fax\x20failed'));});});};Fax['prototype'][_0x841d('0x5b')]=function(_0x23ea23){var _0x5d4d9e=this;return new BPromise(function(_0x26730c,_0x2bbac8){var _0x6d6f27=_0x5d4d9e['checkTrunk'](_0x5d4d9e[_0x841d('0xe')][_0x23ea23['FaxAccountId']][_0x841d('0x5c')],_0x23ea23);if(_0x6d6f27[_0x841d('0x5d')]){_0x26730c(ut[_0x841d('0x58')](_0x841d('0x5e')));}else{_0x2bbac8(ut[_0x841d('0x58')](_0x6d6f27['message']));}});};function originate(_0x3dcce0,_0x147c79,_0xc11ce9){return new BPromise(function(_0xc0d3ac,_0x37ebe2){if(_0xc11ce9){var _0x232488=util[_0x841d('0x5f')](_0x841d('0x60'),path[_0x841d('0x38')](_0x3dcce0[_0x841d('0x4')])[_0x841d('0x23')],_0x3dcce0['path']);gs[_0x841d('0x61')](_0x232488)['then'](function(){_0x3dcce0[_0x841d('0x4')]=util['format'](_0x841d('0x62'),path['parse'](_0x3dcce0[_0x841d('0x4')])[_0x841d('0x63')],path['parse'](_0x3dcce0[_0x841d('0x4')])[_0x841d('0x23')]);_0x147c79['XMF-PATH']=_0x3dcce0[_0x841d('0x4')];ut[_0x841d('0x46')](_0x841d('0x64'),'');ami['Action'](ut['variablesAction'](_0x3dcce0,_0x147c79))[_0x841d('0x3a')](function(_0x11b2f2){_0xc0d3ac(_0x11b2f2);})[_0x841d('0x3e')](function(_0x1b2c92){_0x37ebe2(_0x1b2c92);});})[_0x841d('0x3e')](function(_0x4564df){_0x37ebe2(_0x4564df);});}else{ami[_0x841d('0x65')](ut[_0x841d('0x66')](_0x3dcce0,_0x147c79))['then'](function(_0x2a8ee6){_0xc0d3ac(_0x2a8ee6);})['catch'](function(_0x544213){_0x37ebe2(_0x544213);});}});}Fax[_0x841d('0x1c')][_0x841d('0x56')]=function(_0xd83e7d,_0x5fdb6a){var _0x4b90d3=this;return new BPromise(function(_0x59add1,_0x34c972){var _0x39e661=uuid['v4']();var _0x2691ed=ut[_0x841d('0x67')](_0xd83e7d,_0x5fdb6a);_0x4b90d3[_0x841d('0x10')][_0x39e661]=new Action(_0x39e661,_0x5fdb6a,_0xd83e7d);var _0x547bc2=_0x4b90d3[_0x841d('0x10')][_0x39e661];if(path[_0x841d('0x38')](_0xd83e7d[_0x841d('0x4')])[_0x841d('0x68')]===_0x841d('0x39')){originate(_0x547bc2,_0x2691ed,!![])[_0x841d('0x3a')](function(_0x51a802){_0x59add1(_0x51a802);})[_0x841d('0x3e')](function(_0x430d59){_0x34c972(_0x430d59);});}else{originate(_0x547bc2,_0x2691ed,![])[_0x841d('0x3a')](function(_0xfb8c2d){_0x59add1(_0xfb8c2d);})[_0x841d('0x3e')](function(_0xa39c44){_0x34c972(_0xa39c44);});}});};Fax['prototype']['isTrunkReachable']=function(_0xc118f7){return!_[_0x841d('0x69')](_0xc118f7)&&!_[_0x841d('0x69')](_0xc118f7[_0x841d('0x23')])&&!_[_0x841d('0x69')](_0xc118f7[_0x841d('0x6a')])&&_0xc118f7[_0x841d('0x6a')]&&!_['isNil'](this[_0x841d('0xf')][util[_0x841d('0x5f')](_0x841d('0x6b'),_0xc118f7['name'])])&&!_[_0x841d('0x69')](this[_0x841d('0xf')][util[_0x841d('0x5f')](_0x841d('0x6b'),_0xc118f7[_0x841d('0x23')])][_0x841d('0x2c')])&&(this['trunks'][util[_0x841d('0x5f')](_0x841d('0x6b'),_0xc118f7[_0x841d('0x23')])][_0x841d('0x2c')]===_0x841d('0x6c')||this['trunks'][util[_0x841d('0x5f')]('SIP/%s',_0xc118f7['name'])][_0x841d('0x2c')]==='unmonitored');};Fax[_0x841d('0x1c')][_0x841d('0x6d')]=function(_0xac5948,_0x2e1206){if(!this[_0x841d('0x6e')](_0xac5948)){ut[_0x841d('0x46')](_0x841d('0x6f'),_[_0x841d('0x69')](_0xac5948)?'':_0xac5948['name']+_0x841d('0x70'));return{'isValid':![],'message':_0x841d('0x71')};}if(_['isNil'](_0x2e1206[_0x841d('0x3b')])){ut[_0x841d('0x46')](_0x841d('0x72'),JSON['stringify'](_0x2e1206));return{'isValid':![],'message':_0x841d('0x73')};}if(_['isNil'](_0x2e1206[_0x841d('0x4')])){ut[_0x841d('0x46')](_0x841d('0x74'),JSON['stringify'](_0x2e1206));return{'isValid':![],'message':_0x841d('0x75')};}return{'isValid':!![],'message':_0x841d('0x76')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index d33f307..788217c 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 _0xd98d=['preview','lodash','../rpc/faxAccount','notify','resolve','then','catch','util','bluebird','../../../config/logger'];(function(_0x4ac219,_0x344242){var _0x41bd72=function(_0x47765e){while(--_0x47765e){_0x4ac219['push'](_0x4ac219['shift']());}};_0x41bd72(++_0x344242);}(_0xd98d,0x1a1));var _0xdd98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd98d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xdd98('0x0'));var BPromise=require(_0xdd98('0x1'));var logger=require(_0xdd98('0x2'))(_0xdd98('0x3'));var _=require(_0xdd98('0x4'));var faxAccount=require(_0xdd98('0x5'));function loggerCatch(_0x509fb3){return function(_0x734cb8){logger['error'](_0x509fb3,util['inspect'](_0x734cb8,{'showHidden':![],'depth':null}));};}exports[_0xdd98('0x6')]=function(_0x1b6589,_0x4c60cb){return BPromise[_0xdd98('0x7')]()[_0xdd98('0x8')](faxAccount[_0xdd98('0x6')](_0x1b6589,_0x4c60cb))[_0xdd98('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x8916=['bluebird','../../../config/logger','lodash','../rpc/faxAccount','inspect','notify','resolve','then','[Notify]\x20','util'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0x8916,0x167));var _0x6891=function(_0x5ea1f7,_0x23a8fb){_0x5ea1f7=_0x5ea1f7-0x0;var _0x24ad8b=_0x8916[_0x5ea1f7];return _0x24ad8b;};'use strict';var util=require(_0x6891('0x0'));var BPromise=require(_0x6891('0x1'));var logger=require(_0x6891('0x2'))('preview');var _=require(_0x6891('0x3'));var faxAccount=require(_0x6891('0x4'));function loggerCatch(_0x4301f6){return function(_0x32b2e3){logger['error'](_0x4301f6,util[_0x6891('0x5')](_0x32b2e3,{'showHidden':![],'depth':null}));};}exports[_0x6891('0x6')]=function(_0x56ad72,_0x294b61){return BPromise[_0x6891('0x7')]()[_0x6891('0x8')](faxAccount[_0x6891('0x6')](_0x56ad72,_0x294b61))['catch'](loggerCatch(_0x6891('0x9')));}; \ 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 241bb06..fc7d777 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 _0xb86f=['inspect','util','../../../../config/logger','fax','execute','info','Exec\x20gs'];(function(_0x1bf5d3,_0x5bbbca){var _0x48f748=function(_0xa72932){while(--_0xa72932){_0x1bf5d3['push'](_0x1bf5d3['shift']());}};_0x48f748(++_0x5bbbca);}(_0xb86f,0x14a));var _0xfb86=function(_0x2c61c3,_0x31be3c){_0x2c61c3=_0x2c61c3-0x0;var _0x1f979f=_0xb86f[_0x2c61c3];return _0x1f979f;};'use strict';var util=require(_0xfb86('0x0'));var logger=require(_0xfb86('0x1'))(_0xfb86('0x2'));var BPromise=require('bluebird');var exec=require('child_process')['exec'];exports[_0xfb86('0x3')]=function(_0x1fe98e){return new BPromise(function(_0x5ec4c9,_0x37e46c){exec(_0x1fe98e,function(_0x3c8493,_0x5e8ebc,_0x4d93e3){logger[_0xfb86('0x4')](_0xfb86('0x5'),_0x5e8ebc);if(_0x3c8493){logger[_0xfb86('0x4')](_0xfb86('0x5'),'\x20Error\x20:',util[_0xfb86('0x6')](_0x3c8493,{'showHidden':![],'depth':null}),_0x5e8ebc,_0x4d93e3);_0x37e46c(_0x3c8493);}_0x5ec4c9(_0x5e8ebc);});});}; \ No newline at end of file +var _0xddc2=['inspect','util','bluebird','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:'];(function(_0x3c4952,_0x23022c){var _0x3920ae=function(_0x31afb8){while(--_0x31afb8){_0x3c4952['push'](_0x3c4952['shift']());}};_0x3920ae(++_0x23022c);}(_0xddc2,0x7f));var _0x2ddc=function(_0x4a48aa,_0x2b5f64){_0x4a48aa=_0x4a48aa-0x0;var _0x37ad33=_0xddc2[_0x4a48aa];return _0x37ad33;};'use strict';var util=require(_0x2ddc('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x2ddc('0x1'));var exec=require(_0x2ddc('0x2'))[_0x2ddc('0x3')];exports[_0x2ddc('0x4')]=function(_0x53526a){return new BPromise(function(_0x3cc28b,_0x8facc6){exec(_0x53526a,function(_0x5ee493,_0x3620ea,_0x49b2bc){logger['info'](_0x2ddc('0x5'),_0x3620ea);if(_0x5ee493){logger[_0x2ddc('0x6')](_0x2ddc('0x5'),_0x2ddc('0x7'),util[_0x2ddc('0x8')](_0x5ee493,{'showHidden':![],'depth':null}),_0x3620ea,_0x49b2bc);_0x8facc6(_0x5ee493);}_0x3cc28b(_0x3620ea);});});}; \ 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 44fc1eb..b2f88bd 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 _0xc457=['originate','channel','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','variablesAction','uniqueid'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xc457,0x190));var _0x7c45=function(_0x4e90b0,_0x1adc41){_0x4e90b0=_0x4e90b0-0x0;var _0x28e574=_0xc457[_0x4e90b0];return _0x28e574;};'use strict';var util=require(_0x7c45('0x0'));var _=require(_0x7c45('0x1'));var moment=require(_0x7c45('0x2'));var logger=require(_0x7c45('0x3'))('fax');exports[_0x7c45('0x4')]=function(_0xc16221){return{'message':_0xc16221};};exports[_0x7c45('0x5')]=function(_0x1b86e0,_0x24354a){logger[_0x7c45('0x6')](_0x1b86e0,util[_0x7c45('0x7')](_0x24354a,{'showHidden':![],'depth':null}));};exports[_0x7c45('0x8')]=function(_0x6f5f01,_0x59b528){var _0x5ec59d={'XMF-ECM':_0x59b528[_0x7c45('0x9')],'XMF-HEADERINFO':_0x59b528['headerinfo'],'XMF-MINRATE':_0x59b528[_0x7c45('0xa')],'XMF-MAXRATE':_0x59b528[_0x7c45('0xb')],'XMF-MODEM':util['format'](_0x7c45('0xc'),_0x59b528[_0x7c45('0xd')]),'XMF-GATEWAY':_0x59b528[_0x7c45('0xe')],'XMF-FAXDETECT':_0x59b528[_0x7c45('0xf')],'XMF-T38TIMEOUT':_0x59b528['t38timeout'],'XMF-LOCALSTATIONID':_0x59b528['localstationid'],'XMF-PATH':_0x6f5f01['path']};return _0x5ec59d;};exports[_0x7c45('0x10')]=function(_0x52760d,_0x247968){return{'actionid':_0x52760d[_0x7c45('0x11')],'action':_0x7c45('0x12'),'channel':_0x52760d[_0x7c45('0x13')],'Exten':'xcally-motion-fax','Context':_0x7c45('0x14'),'Priority':'1','callerid':util['format'](_0x7c45('0x15'),_0x52760d['headerinfo']?_0x52760d['headerinfo']:'',_0x52760d['localstationid']),'variable':_0x247968,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x52760d[_0x7c45('0x11')]};}; \ No newline at end of file +var _0xae84=['t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x3ab91e,_0x5e8dc4){var _0x59d8a5=function(_0x1c5349){while(--_0x1c5349){_0x3ab91e['push'](_0x3ab91e['shift']());}};_0x59d8a5(++_0x5e8dc4);}(_0xae84,0x91));var _0x4ae8=function(_0x5eed18,_0x26ffaa){_0x5eed18=_0x5eed18-0x0;var _0x590684=_0xae84[_0x5eed18];return _0x590684;};'use strict';var util=require(_0x4ae8('0x0'));var _=require(_0x4ae8('0x1'));var moment=require(_0x4ae8('0x2'));var logger=require(_0x4ae8('0x3'))(_0x4ae8('0x4'));exports['message']=function(_0x33975b){return{'message':_0x33975b};};exports[_0x4ae8('0x5')]=function(_0x49fa4a,_0x3e9c0a){logger[_0x4ae8('0x6')](_0x49fa4a,util[_0x4ae8('0x7')](_0x3e9c0a,{'showHidden':![],'depth':null}));};exports[_0x4ae8('0x8')]=function(_0x47f0b1,_0x544725){var _0x4da340={'XMF-ECM':_0x544725[_0x4ae8('0x9')],'XMF-HEADERINFO':_0x544725[_0x4ae8('0xa')],'XMF-MINRATE':_0x544725[_0x4ae8('0xb')],'XMF-MAXRATE':_0x544725['maxrate'],'XMF-MODEM':util[_0x4ae8('0xc')](_0x4ae8('0xd'),_0x544725[_0x4ae8('0xe')]),'XMF-GATEWAY':_0x544725[_0x4ae8('0xf')],'XMF-FAXDETECT':_0x544725[_0x4ae8('0x10')],'XMF-T38TIMEOUT':_0x544725[_0x4ae8('0x11')],'XMF-LOCALSTATIONID':_0x544725[_0x4ae8('0x12')],'XMF-PATH':_0x47f0b1[_0x4ae8('0x13')]};return _0x4da340;};exports[_0x4ae8('0x14')]=function(_0x557b61,_0x380b6f){return{'actionid':_0x557b61[_0x4ae8('0x15')],'action':_0x4ae8('0x16'),'channel':_0x557b61[_0x4ae8('0x17')],'Exten':_0x4ae8('0x18'),'Context':_0x4ae8('0x19'),'Priority':'1','callerid':util[_0x4ae8('0xc')](_0x4ae8('0x1a'),_0x557b61[_0x4ae8('0xa')]?_0x557b61[_0x4ae8('0xa')]:'',_0x557b61['localstationid']),'variable':_0x380b6f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x557b61[_0x4ae8('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6a8710c..309e5cc 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 _0xf452=['initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','moment','./server','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initSalesforceAccounts','getSugarcrmAccounts'];(function(_0x50abb9,_0x14638a){var _0x40b514=function(_0x55fb00){while(--_0x55fb00){_0x50abb9['push'](_0x50abb9['shift']());}};_0x40b514(++_0x14638a);}(_0xf452,0x12f));var _0x2f45=function(_0x9ba9a6,_0x5014c6){_0x9ba9a6=_0x9ba9a6-0x0;var _0x4124f2=_0xf452[_0x9ba9a6];return _0x4124f2;};'use strict';var util=require('util');var moment=require(_0x2f45('0x0'));var server=require(_0x2f45('0x1'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x2f45('0x2'));var Trigger=require(_0x2f45('0x3'));var Dialer=require(_0x2f45('0x4'));var Preview=require(_0x2f45('0x5'));var Fax=require(_0x2f45('0x6'));var user=require(_0x2f45('0x7'));var voiceQueue=require(_0x2f45('0x8'));var voiceQueueReport=require(_0x2f45('0x9'));var voiceCallReport=require(_0x2f45('0xa'));var trunk=require(_0x2f45('0xb'));var trigger=require(_0x2f45('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0x2f45('0xd'));var campaign=require(_0x2f45('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x2f45('0xf'));var salesforce=require(_0x2f45('0x10'));var sugarcrm=require(_0x2f45('0x11'));var freshdesk=require(_0x2f45('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x2f45('0x13'));var freshsales=require(_0x2f45('0x14'));var servicenow=require(_0x2f45('0x15'));var dynamics365=require(_0x2f45('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x2f45('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2f45('0x18')](_0x2f45('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2f45('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x2f45('0x1a')]()['then'](user[_0x2f45('0x1b')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x1d')]())[_0x2f45('0x1c')](user[_0x2f45('0x1e')]())['then'](realtime[_0x2f45('0x1f')]())[_0x2f45('0x1c')](trunk[_0x2f45('0x20')]())['then'](realtime[_0x2f45('0x21')]())[_0x2f45('0x1c')](voiceQueue[_0x2f45('0x22')]())['then'](realtime[_0x2f45('0x23')]())[_0x2f45('0x1c')](trigger[_0x2f45('0x24')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x25')]())['then'](template[_0x2f45('0x26')]())['then'](realtime[_0x2f45('0x27')]())['then'](zendesk['getZendeskAccounts']())[_0x2f45('0x1c')](realtime['initZendeskAccounts']())[_0x2f45('0x1c')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x2f45('0x28')]())[_0x2f45('0x1c')](sugarcrm[_0x2f45('0x29')]())['then'](realtime[_0x2f45('0x2a')]())['then'](freshdesk[_0x2f45('0x2b')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x2c')]())[_0x2f45('0x1c')](desk[_0x2f45('0x2d')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x2e')]())[_0x2f45('0x1c')](zoho[_0x2f45('0x2f')]())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0x2f45('0x30')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x31')]())[_0x2f45('0x1c')](freshsales['getFreshsalesAccounts']())[_0x2f45('0x1c')](realtime[_0x2f45('0x32')]())[_0x2f45('0x1c')](servicenow[_0x2f45('0x33')]())['then'](realtime['initServicenowAccounts']())[_0x2f45('0x1c')](dynamics365[_0x2f45('0x34')]())['then'](realtime['initDynamics365Accounts']())[_0x2f45('0x1c')](campaign[_0x2f45('0x35')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x36')]())[_0x2f45('0x1c')](voiceExtension['getVoiceExtensions']())[_0x2f45('0x1c')](realtime[_0x2f45('0x37')]())[_0x2f45('0x1c')](faxAccount['getFaxAccounts']())['then'](realtime['initFaxAccounts']())[_0x2f45('0x1c')](function(){return realtime;});}function initParams(){return Promise[_0x2f45('0x1a')]()[_0x2f45('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0x2f45('0x1c')](realtime[_0x2f45('0x38')]())[_0x2f45('0x1c')](cmHopperHistory[_0x2f45('0x39')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x3a')]())[_0x2f45('0x1c')](cmHopperHistory[_0x2f45('0x3b')]())[_0x2f45('0x1c')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x2f45('0x3c')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x3d')]())[_0x2f45('0x3e')](function(_0x345659){logger[_0x2f45('0x3f')](_0x2f45('0x40'),util[_0x2f45('0x41')](_0x345659,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2f45('0x42')](realtime,preview,fax)[_0x2f45('0x1c')](function(){return initRealtime();})[_0x2f45('0x1c')](function(){return initParams();})['then'](function(){report[_0x2f45('0x43')]();setInterval(initRealtime,0x1388);})[_0x2f45('0x3e')](function(_0x3a78b4){logger[_0x2f45('0x3f')](_0x2f45('0x44'),util[_0x2f45('0x41')](_0x3a78b4,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x2544=['./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','hour','get','resolve','getAgents','initAgents','then','getTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','[index.js][initParams]','inspect','catch','error','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk'];(function(_0xea71f6,_0x165c16){var _0x166276=function(_0x199522){while(--_0x199522){_0xea71f6['push'](_0xea71f6['shift']());}};_0x166276(++_0x165c16);}(_0x2544,0x75));var _0x4254=function(_0x4918ac,_0x1be8e7){_0x4918ac=_0x4918ac-0x0;var _0x623c46=_0x2544[_0x4918ac];return _0x623c46;};'use strict';var util=require(_0x4254('0x0'));var moment=require(_0x4254('0x1'));var server=require(_0x4254('0x2'));var Realtime=require('./realtime');var Report=require(_0x4254('0x3'));var Acw=require(_0x4254('0x4'));var Trigger=require(_0x4254('0x5'));var Dialer=require(_0x4254('0x6'));var Preview=require(_0x4254('0x7'));var Fax=require(_0x4254('0x8'));var user=require(_0x4254('0x9'));var voiceQueue=require(_0x4254('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x4254('0xb'));var trunk=require(_0x4254('0xc'));var trigger=require(_0x4254('0xd'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x4254('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x4254('0xf'));var zendesk=require(_0x4254('0x10'));var salesforce=require(_0x4254('0x11'));var sugarcrm=require(_0x4254('0x12'));var freshdesk=require(_0x4254('0x13'));var desk=require(_0x4254('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4254('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x4254('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x4254('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x4254('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4254('0x19')](_0x4254('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x4254('0x1a')]()['then'](user[_0x4254('0x1b')]())['then'](realtime[_0x4254('0x1c')]())[_0x4254('0x1d')](user[_0x4254('0x1e')]())[_0x4254('0x1d')](realtime['initTelephones']())[_0x4254('0x1d')](trunk[_0x4254('0x1f')]())[_0x4254('0x1d')](realtime[_0x4254('0x20')]())[_0x4254('0x1d')](voiceQueue['getVoiceQueues']())[_0x4254('0x1d')](realtime[_0x4254('0x21')]())['then'](trigger[_0x4254('0x22')]())[_0x4254('0x1d')](realtime[_0x4254('0x23')]())['then'](template['getTemplates']())[_0x4254('0x1d')](realtime['initTemplates']())['then'](zendesk[_0x4254('0x24')]())[_0x4254('0x1d')](realtime[_0x4254('0x25')]())[_0x4254('0x1d')](salesforce[_0x4254('0x26')]())[_0x4254('0x1d')](realtime[_0x4254('0x27')]())[_0x4254('0x1d')](sugarcrm[_0x4254('0x28')]())[_0x4254('0x1d')](realtime[_0x4254('0x29')]())[_0x4254('0x1d')](freshdesk[_0x4254('0x2a')]())[_0x4254('0x1d')](realtime[_0x4254('0x2b')]())[_0x4254('0x1d')](desk[_0x4254('0x2c')]())[_0x4254('0x1d')](realtime[_0x4254('0x2d')]())[_0x4254('0x1d')](zoho[_0x4254('0x2e')]())['then'](realtime['initZohoAccounts']())[_0x4254('0x1d')](vtiger[_0x4254('0x2f')]())['then'](realtime['initVtigerAccounts']())['then'](freshsales[_0x4254('0x30')]())[_0x4254('0x1d')](realtime['initFreshsalesAccounts']())[_0x4254('0x1d')](servicenow[_0x4254('0x31')]())[_0x4254('0x1d')](realtime[_0x4254('0x32')]())[_0x4254('0x1d')](dynamics365[_0x4254('0x33')]())[_0x4254('0x1d')](realtime[_0x4254('0x34')]())[_0x4254('0x1d')](campaign[_0x4254('0x35')]())['then'](realtime[_0x4254('0x36')]())['then'](voiceExtension[_0x4254('0x37')]())['then'](realtime[_0x4254('0x38')]())['then'](faxAccount[_0x4254('0x39')]())['then'](realtime['initFaxAccounts']())[_0x4254('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0x4254('0x1a')]()[_0x4254('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x4254('0x1d')](realtime['initVoiceQueueReports']())[_0x4254('0x1d')](cmHopperHistory[_0x4254('0x3a')]())[_0x4254('0x1d')](realtime[_0x4254('0x3b')]())[_0x4254('0x1d')](cmHopperHistory['getCampaignHopperHistory']())[_0x4254('0x1d')](realtime[_0x4254('0x3c')]())[_0x4254('0x1d')](voiceCallReport[_0x4254('0x3d')]())[_0x4254('0x1d')](realtime['initVoiceCallReports']())['catch'](function(_0xbbfc6e){logger['error'](_0x4254('0x3e'),util[_0x4254('0x3f')](_0xbbfc6e,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x4254('0x1d')](function(){return initRealtime();})[_0x4254('0x1d')](function(){return initParams();})[_0x4254('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x4254('0x40')](function(_0x228e23){logger[_0x4254('0x41')](_0x4254('0x42'),util[_0x4254('0x3f')](_0x228e23,{'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 73bf311..f198bf8 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 _0xfd41=['user:ami:update','user:presence','lodash','util','moment','md5','ioredis','redis','localhost','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','inuse','statePause','toNumber','onhold','stringify','format','user:%s','emit'];(function(_0x1702c8,_0x23860d){var _0x338c8d=function(_0x4393f3){while(--_0x4393f3){_0x1702c8['push'](_0x1702c8['shift']());}};_0x338c8d(++_0x23860d);}(_0xfd41,0xb6));var _0x1fd4=function(_0x16d6a2,_0x266958){_0x16d6a2=_0x16d6a2-0x0;var _0x681283=_0xfd41[_0x16d6a2];return _0x681283;};'use strict';var _=require(_0x1fd4('0x0'));var util=require(_0x1fd4('0x1'));var moment=require(_0x1fd4('0x2'));var md5=require(_0x1fd4('0x3'));var Redis=require(_0x1fd4('0x4'));var config=require('../../../config/environment');config[_0x1fd4('0x5')]=_['defaults'](config[_0x1fd4('0x5')],{'host':_0x1fd4('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1fd4('0x5')]));function Agent(_0x2dda6b){this['id']=_0x2dda6b['id']||0x0;this[_0x1fd4('0x7')]=_0x2dda6b[_0x1fd4('0x7')]||'';this[_0x1fd4('0x8')]=_0x2dda6b[_0x1fd4('0x8')]||'';this[_0x1fd4('0x9')]=_0x2dda6b[_0x1fd4('0x9')]||'';this[_0x1fd4('0xa')]=_0x2dda6b[_0x1fd4('0xa')]||'';this[_0x1fd4('0xb')]=_0x1fd4('0xc');this[_0x1fd4('0xd')]=0x0;this['status']=_0x1fd4('0xc');this[_0x1fd4('0xe')]='';this[_0x1fd4('0xf')]='';this['mobile']='';this[_0x1fd4('0x10')]='';this[_0x1fd4('0x11')]=_0x2dda6b[_0x1fd4('0x11')]||![];this[_0x1fd4('0x12')]=_0x1fd4('0xc');this[_0x1fd4('0x13')]=0x0;this[_0x1fd4('0x14')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x1fd4('0x15')]=![];this[_0x1fd4('0x3')]='';}Agent[_0x1fd4('0x16')][_0x1fd4('0x17')]=function(_0x2a4055){var _0x59bfb1;if(_0x2a4055&&_0x2a4055[_0x1fd4('0xb')]){_0x59bfb1=_0x2a4055[_0x1fd4('0xb')][_0x1fd4('0x18')]();switch(_0x59bfb1){case _0x1fd4('0x19'):_0x59bfb1='idle';break;case _0x1fd4('0x1a'):_0x59bfb1='talking';break;}}if(_0x59bfb1&&this['voiceStatus']!==_0x59bfb1||_0x2a4055[_0x1fd4('0x1b')]){this[_0x1fd4('0x13')]=_[_0x1fd4('0x1c')](moment()['format']('x'));}if(_0x59bfb1){this[_0x1fd4('0x12')]=_0x59bfb1;}var _0x4a5fd0={'id':this['id'],'name':this['name'],'email':this[_0x1fd4('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x1fd4('0xa')],'state':this[_0x1fd4('0xb')],'stateTime':this[_0x1fd4('0xd')],'status':this['status'],'address':this['address'],'online':this[_0x1fd4('0x11')],'voiceStatus':this[_0x1fd4('0x12')],'voiceStatusTime':this[_0x1fd4('0x13')],'voiceStatusCallerIdNumber':this[_0x1fd4('0x14')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x1fd4('0x10')],'onhold':this[_0x1fd4('0x1d')]};var _0x2dbc9e=md5(JSON[_0x1fd4('0x1e')](_0x4a5fd0));if(this[_0x1fd4('0x3')]!==_0x2dbc9e){this[_0x1fd4('0x3')]=_0x2dbc9e;io['to'](util[_0x1fd4('0x1f')](_0x1fd4('0x20'),_0x4a5fd0['name']))[_0x1fd4('0x21')](_0x1fd4('0x22'),_['omit'](_0x4a5fd0,[_0x1fd4('0x11')]));io[_0x1fd4('0x21')](_0x1fd4('0x23'),_0x4a5fd0);}};module['exports']=Agent; \ No newline at end of file +var _0x7c53=['onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','idle','talking','statePause','toNumber','format','name','stateTime','status','stringify','user:%s','emit','user:ami:update','omit','exports','util','moment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7c53,0x1e8));var _0x37c5=function(_0x269be5,_0x53a9fe){_0x269be5=_0x269be5-0x0;var _0x5a3b4e=_0x7c53[_0x269be5];return _0x5a3b4e;};'use strict';var _=require('lodash');var util=require(_0x37c5('0x0'));var moment=require(_0x37c5('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x37c5('0x2')]=_[_0x37c5('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x37c5('0x4'))(new Redis(config[_0x37c5('0x2')]));function Agent(_0x4405bf){this['id']=_0x4405bf['id']||0x0;this['name']=_0x4405bf['name']||'';this[_0x37c5('0x5')]=_0x4405bf[_0x37c5('0x5')]||'';this[_0x37c5('0x6')]=_0x4405bf[_0x37c5('0x6')]||'';this[_0x37c5('0x7')]=_0x4405bf['fullname']||'';this[_0x37c5('0x8')]=_0x37c5('0x9');this['stateTime']=0x0;this['status']=_0x37c5('0x9');this[_0x37c5('0xa')]='';this[_0x37c5('0xb')]='';this[_0x37c5('0xc')]='';this[_0x37c5('0xd')]='';this['online']=_0x4405bf[_0x37c5('0xe')]||![];this[_0x37c5('0xf')]=_0x37c5('0x9');this[_0x37c5('0x10')]=0x0;this[_0x37c5('0x11')]='';this[_0x37c5('0x12')]='';this[_0x37c5('0x13')]=![];this[_0x37c5('0x14')]=![];this[_0x37c5('0x15')]='';}Agent[_0x37c5('0x16')][_0x37c5('0x17')]=function(_0x546e4a){var _0x3d3681;if(_0x546e4a&&_0x546e4a[_0x37c5('0x8')]){_0x3d3681=_0x546e4a[_0x37c5('0x8')][_0x37c5('0x18')]();switch(_0x3d3681){case'not_inuse':_0x3d3681=_0x37c5('0x19');break;case'inuse':_0x3d3681=_0x37c5('0x1a');break;}}if(_0x3d3681&&this['voiceStatus']!==_0x3d3681||_0x546e4a[_0x37c5('0x1b')]){this[_0x37c5('0x10')]=_[_0x37c5('0x1c')](moment()[_0x37c5('0x1d')]('x'));}if(_0x3d3681){this[_0x37c5('0xf')]=_0x3d3681;}var _0x58ad09={'id':this['id'],'name':this[_0x37c5('0x1e')],'email':this['email'],'accountcode':this[_0x37c5('0x6')],'fullname':this['fullname'],'state':this[_0x37c5('0x8')],'stateTime':this[_0x37c5('0x1f')],'status':this[_0x37c5('0x20')],'address':this[_0x37c5('0xa')],'online':this[_0x37c5('0xe')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x37c5('0x10')],'voiceStatusCallerIdNumber':this[_0x37c5('0x11')],'voiceStatusQueue':this[_0x37c5('0x12')],'interface':this[_0x37c5('0xd')],'onhold':this[_0x37c5('0x13')]};var _0x86228b=md5(JSON[_0x37c5('0x21')](_0x58ad09));if(this[_0x37c5('0x15')]!==_0x86228b){this[_0x37c5('0x15')]=_0x86228b;io['to'](util[_0x37c5('0x1d')](_0x37c5('0x22'),_0x58ad09[_0x37c5('0x1e')]))[_0x37c5('0x23')](_0x37c5('0x24'),_[_0x37c5('0x25')](_0x58ad09,[_0x37c5('0xe')]));io['emit']('user:presence',_0x58ad09);}};module[_0x37c5('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 1bd589c..32d5b69 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 _0x2932=['dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone'];(function(_0x2876b5,_0x1a2156){var _0x17e5ff=function(_0x1c8505){while(--_0x1c8505){_0x2876b5['push'](_0x2876b5['shift']());}};_0x17e5ff(++_0x1a2156);}(_0x2932,0x153));var _0x2293=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0x2932[_0x6dfbaa];return _0xfbe02;};'use strict';function Campaign(_0x51d794){this['id']=_0x51d794['id']||0x0;this[_0x2293('0x0')]=_0x51d794[_0x2293('0x0')]||'';this[_0x2293('0x1')]=_0x51d794[_0x2293('0x1')]||_0x2293('0x2');this['originated']=0x0;this[_0x2293('0x3')]=0x0;this[_0x2293('0x4')]=0x0;this[_0x2293('0x5')]=0x0;this[_0x2293('0x6')]='';this[_0x2293('0x7')]=!![];this['active']=_0x51d794[_0x2293('0x8')];this[_0x2293('0x9')]=_0x51d794[_0x2293('0x9')];this[_0x2293('0xa')]=_0x51d794['dialTimezone']||null;this['dialGlobalInterval']=_0x51d794[_0x2293('0xb')]?_0x51d794[_0x2293('0xb')]:null;this[_0x2293('0xc')]=_0x51d794[_0x2293('0xc')];this['dialOriginateCallerIdNumber']=_0x51d794['dialOriginateCallerIdNumber'];this[_0x2293('0xd')]=_0x51d794['dialOriginateTimeout']||0x1e;this[_0x2293('0xe')]=_0x51d794[_0x2293('0xe')];this[_0x2293('0xf')]=_0x51d794[_0x2293('0xf')];this[_0x2293('0x10')]=_0x51d794[_0x2293('0x10')];this[_0x2293('0x11')]=_0x51d794[_0x2293('0x11')];this[_0x2293('0x12')]=_0x51d794[_0x2293('0x12')];this['dialNoAnswerRetryFrequency']=_0x51d794[_0x2293('0x13')];this[_0x2293('0x14')]=_0x51d794['dialGlobalMaxRetry'];this[_0x2293('0x15')]=_0x51d794[_0x2293('0x15')]||0x3;this[_0x2293('0x16')]=_0x51d794[_0x2293('0x16')]||0x96;this[_0x2293('0x17')]=_0x51d794[_0x2293('0x17')]||0x3;this[_0x2293('0x18')]=_0x51d794[_0x2293('0x18')]||0x96;this[_0x2293('0x19')]=_0x51d794[_0x2293('0x19')]||0x3;this[_0x2293('0x1a')]=_0x51d794['dialAbandonedRetryFrequency']||0x96;this[_0x2293('0x1b')]=_0x51d794[_0x2293('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x51d794['dialMachineRetryFrequency']||0x96;this[_0x2293('0x1c')]=_0x51d794[_0x2293('0x1c')]||0x3;this[_0x2293('0x1d')]=_0x51d794['dialAgentRejectRetryFrequency']||0x96;this[_0x2293('0x1e')]=_0x51d794['dialOrderByScheduledAt']||'DESC';this[_0x2293('0x1f')]=_0x51d794[_0x2293('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x51d794[_0x2293('0x20')]||undefined;this['dialCutDigit']=_0x51d794[_0x2293('0x21')]||undefined;this['TrunkBackup']=_0x51d794[_0x2293('0x22')]?_0x51d794[_0x2293('0x22')]:undefined;this['Trunk']=_0x51d794[_0x2293('0x23')]?_0x51d794[_0x2293('0x23')]:undefined;this[_0x2293('0x24')]=_0x51d794[_0x2293('0x24')]?_0x51d794[_0x2293('0x24')]:undefined;this['SquareProject']=_0x51d794['SquareProject']?_0x51d794[_0x2293('0x25')]:undefined;this[_0x2293('0x26')]=_0x51d794[_0x2293('0x25')]?_0x51d794[_0x2293('0x25')][_0x2293('0x0')]:undefined;this['dialAMDActive']=_0x51d794[_0x2293('0x27')]||![];this[_0x2293('0x28')]=_0x51d794[_0x2293('0x28')];this['dialAMDGreeting']=_0x51d794[_0x2293('0x29')];this[_0x2293('0x2a')]=_0x51d794['dialAMDAfterGreetingSilence'];this[_0x2293('0x2b')]=_0x51d794[_0x2293('0x2b')];this[_0x2293('0x2c')]=_0x51d794['dialAMDMinWordLength'];this[_0x2293('0x2d')]=_0x51d794[_0x2293('0x2d')];this[_0x2293('0x2e')]=_0x51d794[_0x2293('0x2e')];this['dialAMDSilenceThreshold']=_0x51d794[_0x2293('0x2f')];this[_0x2293('0x30')]=_0x51d794['dialAMDMaximumWordLength'];}module[_0x2293('0x31')]=Campaign; \ No newline at end of file +var _0x973b=['ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0x973b,0x1f0));var _0xb973=function(_0x42da26,_0xd761ca){_0x42da26=_0x42da26-0x0;var _0x16de09=_0x973b[_0x42da26];return _0x16de09;};'use strict';function Campaign(_0x3281ee){this['id']=_0x3281ee['id']||0x0;this[_0xb973('0x0')]=_0x3281ee[_0xb973('0x0')]||'';this['type']=_0x3281ee[_0xb973('0x1')]||_0xb973('0x2');this[_0xb973('0x3')]=0x0;this['temp']=0x0;this[_0xb973('0x4')]=0x0;this[_0xb973('0x5')]=0x0;this[_0xb973('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xb973('0x7')]=_0x3281ee[_0xb973('0x7')];this[_0xb973('0x8')]=_0x3281ee['limitCalls'];this[_0xb973('0x9')]=_0x3281ee[_0xb973('0x9')]||null;this[_0xb973('0xa')]=_0x3281ee[_0xb973('0xa')]?_0x3281ee['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x3281ee[_0xb973('0xb')];this[_0xb973('0xc')]=_0x3281ee[_0xb973('0xc')];this['dialOriginateTimeout']=_0x3281ee[_0xb973('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x3281ee['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x3281ee[_0xb973('0xe')];this[_0xb973('0xf')]=_0x3281ee['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x3281ee[_0xb973('0x10')];this[_0xb973('0x11')]=_0x3281ee[_0xb973('0x11')];this[_0xb973('0x12')]=_0x3281ee[_0xb973('0x12')];this[_0xb973('0x13')]=_0x3281ee[_0xb973('0x13')];this[_0xb973('0x14')]=_0x3281ee[_0xb973('0x14')]||0x3;this[_0xb973('0x15')]=_0x3281ee[_0xb973('0x15')]||0x96;this[_0xb973('0x16')]=_0x3281ee['dialDropMaxRetry']||0x3;this[_0xb973('0x17')]=_0x3281ee[_0xb973('0x17')]||0x96;this[_0xb973('0x18')]=_0x3281ee['dialAbandonedMaxRetry']||0x3;this[_0xb973('0x19')]=_0x3281ee[_0xb973('0x19')]||0x96;this['dialMachineMaxRetry']=_0x3281ee[_0xb973('0x1a')]||0x3;this[_0xb973('0x1b')]=_0x3281ee['dialMachineRetryFrequency']||0x96;this[_0xb973('0x1c')]=_0x3281ee[_0xb973('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3281ee[_0xb973('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x3281ee[_0xb973('0x1e')]||'DESC';this[_0xb973('0x1f')]=_0x3281ee[_0xb973('0x1f')]||undefined;this[_0xb973('0x20')]=_0x3281ee[_0xb973('0x20')]||undefined;this[_0xb973('0x21')]=_0x3281ee[_0xb973('0x21')]||undefined;this['TrunkBackup']=_0x3281ee['TrunkBackup']?_0x3281ee[_0xb973('0x22')]:undefined;this['Trunk']=_0x3281ee[_0xb973('0x23')]?_0x3281ee['Trunk']:undefined;this[_0xb973('0x24')]=_0x3281ee[_0xb973('0x24')]?_0x3281ee[_0xb973('0x24')]:undefined;this[_0xb973('0x25')]=_0x3281ee[_0xb973('0x25')]?_0x3281ee[_0xb973('0x25')]:undefined;this[_0xb973('0x26')]=_0x3281ee[_0xb973('0x25')]?_0x3281ee[_0xb973('0x25')][_0xb973('0x0')]:undefined;this[_0xb973('0x27')]=_0x3281ee['dialAMDActive']||![];this[_0xb973('0x28')]=_0x3281ee['dialAMDInitialSilence'];this[_0xb973('0x29')]=_0x3281ee[_0xb973('0x29')];this[_0xb973('0x2a')]=_0x3281ee['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x3281ee[_0xb973('0x2b')];this[_0xb973('0x2c')]=_0x3281ee['dialAMDMinWordLength'];this[_0xb973('0x2d')]=_0x3281ee['dialAMDBetweenWordsSilence'];this[_0xb973('0x2e')]=_0x3281ee[_0xb973('0x2e')];this['dialAMDSilenceThreshold']=_0x3281ee[_0xb973('0x2f')];this[_0xb973('0x30')]=_0x3281ee['dialAMDMaximumWordLength'];}module[_0xb973('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 049da93..883d11b 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 _0xe126=['disposition','monitorFilename','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','tag'];(function(_0xa1c205,_0x2533b0){var _0x43aaf3=function(_0xb5ffbc){while(--_0xb5ffbc){_0xa1c205['push'](_0xa1c205['shift']());}};_0x43aaf3(++_0x2533b0);}(_0xe126,0xeb));var _0x6e12=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe126[_0x59ee6f];return _0x4c0979;};'use strict';function Channel(){this[_0x6e12('0x0')]=null;this[_0x6e12('0x1')]='';this['destinationchannel']='';this[_0x6e12('0x2')]=0x0;this[_0x6e12('0x3')]='';this[_0x6e12('0x4')]=undefined;this[_0x6e12('0x5')]=undefined;this[_0x6e12('0x6')]=0x0;this['context']='';this[_0x6e12('0x7')]=0x0;this['linkedid']=0x0;this[_0x6e12('0x8')]=0x0;this[_0x6e12('0x9')]=![];this['answertime']=null;this[_0x6e12('0xa')]=null;this[_0x6e12('0xb')]=![];this[_0x6e12('0xc')]=![];this[_0x6e12('0xd')]='';this[_0x6e12('0xe')]='';this[_0x6e12('0xf')]=0x0;this[_0x6e12('0x10')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x6e12('0x11')]=null;this[_0x6e12('0x12')]=null;this['monitor']=![];this[_0x6e12('0x13')]=null;this['queue']=null;this['monitors']=[];this[_0x6e12('0x14')]=undefined;this[_0x6e12('0x15')]=undefined;this['transferType']=undefined;this[_0x6e12('0x16')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x4f9b=['exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime'];(function(_0x12a440,_0x40680e){var _0x6b8f59=function(_0x5938ac){while(--_0x5938ac){_0x12a440['push'](_0x12a440['shift']());}};_0x6b8f59(++_0x40680e);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x91343,_0xcd7a5c){_0x91343=_0x91343-0x0;var _0x161252=_0x4f9b[_0x91343];return _0x161252;};'use strict';function Channel(){this[_0xb4f9('0x0')]=null;this[_0xb4f9('0x1')]='';this[_0xb4f9('0x2')]='';this[_0xb4f9('0x3')]=0x0;this[_0xb4f9('0x4')]='';this[_0xb4f9('0x5')]=undefined;this[_0xb4f9('0x6')]=undefined;this[_0xb4f9('0x7')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xb4f9('0x8')]=0x0;this[_0xb4f9('0x9')]=![];this[_0xb4f9('0xa')]=null;this[_0xb4f9('0xb')]=null;this[_0xb4f9('0xc')]=![];this[_0xb4f9('0xd')]=![];this['lastapplication']='';this[_0xb4f9('0xe')]='';this[_0xb4f9('0xf')]=0x0;this[_0xb4f9('0x10')]=0x0;this['holdtime']=0x0;this[_0xb4f9('0x11')]=null;this['tag']=null;this[_0xb4f9('0x12')]=null;this[_0xb4f9('0x13')]=![];this[_0xb4f9('0x14')]=null;this[_0xb4f9('0x15')]=null;this[_0xb4f9('0x16')]=[];this[_0xb4f9('0x17')]=undefined;this[_0xb4f9('0x18')]=undefined;this['transferType']=undefined;this[_0xb4f9('0x19')]=0x0;}module[_0xb4f9('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 7e2d280..3a4a9d2 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 _0x6f0c=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','token','tokenSecret','type'];(function(_0x5b50df,_0x400cd4){var _0x288f39=function(_0xeffe8b){while(--_0xeffe8b){_0x5b50df['push'](_0x5b50df['shift']());}};_0x288f39(++_0x400cd4);}(_0x6f0c,0x93));var _0xc6f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f0c[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x799a6d){this['id']=_0x799a6d['id']||0x0;this[_0xc6f0('0x0')]=_0x799a6d[_0xc6f0('0x0')]||'';this[_0xc6f0('0x1')]=_0x799a6d[_0xc6f0('0x1')]||'';this[_0xc6f0('0x2')]=_0x799a6d[_0xc6f0('0x2')]||'';this[_0xc6f0('0x3')]=_0x799a6d[_0xc6f0('0x3')]||'';this[_0xc6f0('0x4')]=_0x799a6d[_0xc6f0('0x4')]||'';this[_0xc6f0('0x5')]=_0x799a6d[_0xc6f0('0x5')]||'';this['consumerSecret']=_0x799a6d['consumerSecret']||'';this[_0xc6f0('0x6')]=_0x799a6d[_0xc6f0('0x6')]||'';this[_0xc6f0('0x7')]=_0x799a6d[_0xc6f0('0x7')]||'';this[_0xc6f0('0x8')]=_0x799a6d[_0xc6f0('0x8')]||'';this[_0xc6f0('0x9')]=_0x799a6d[_0xc6f0('0x9')]||'';this[_0xc6f0('0xa')]=_0x799a6d[_0xc6f0('0xa')]||{};}module[_0xc6f0('0xb')]=DeskAccount; \ No newline at end of file +var _0xc8b0=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc8b0,0x7f));var _0x0c8b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc8b0[_0x397e5f];return _0x5302b8;};'use strict';function DeskAccount(_0x2265b4){this['id']=_0x2265b4['id']||0x0;this['name']=_0x2265b4[_0x0c8b('0x0')]||'';this['username']=_0x2265b4[_0x0c8b('0x1')]||'';this[_0x0c8b('0x2')]=_0x2265b4[_0x0c8b('0x2')]||'';this['authType']=_0x2265b4[_0x0c8b('0x3')]||'';this[_0x0c8b('0x4')]=_0x2265b4['password']||'';this[_0x0c8b('0x5')]=_0x2265b4[_0x0c8b('0x5')]||'';this[_0x0c8b('0x6')]=_0x2265b4[_0x0c8b('0x6')]||'';this[_0x0c8b('0x7')]=_0x2265b4[_0x0c8b('0x7')]||'';this[_0x0c8b('0x8')]=_0x2265b4[_0x0c8b('0x8')]||'';this[_0x0c8b('0x9')]=_0x2265b4[_0x0c8b('0x9')]||'';this['serverUrl']=_0x2265b4[_0x0c8b('0xa')]||'';this[_0x0c8b('0xb')]=_0x2265b4[_0x0c8b('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c7ec59f..cf8b85d 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 _0x9c60=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x1fb6d6,_0x3e8b9d){var _0x1a0034=function(_0x20b5ea){while(--_0x20b5ea){_0x1fb6d6['push'](_0x1fb6d6['shift']());}};_0x1a0034(++_0x3e8b9d);}(_0x9c60,0xd9));var _0x09c6=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9c60[_0x1ac595];return _0x455fff;};'use strict';function Dynamics365Account(_0x5933c3){this['id']=_0x5933c3['id']||0x0;this[_0x09c6('0x0')]=_0x5933c3['name']||'';this[_0x09c6('0x1')]=_0x5933c3[_0x09c6('0x1')]||'';this[_0x09c6('0x2')]=_0x5933c3[_0x09c6('0x2')]||'';this[_0x09c6('0x3')]=_0x5933c3[_0x09c6('0x3')]||'';this['tenantId']=_0x5933c3[_0x09c6('0x4')]||'';this[_0x09c6('0x5')]=_0x5933c3[_0x09c6('0x5')]||'';this['clientSecret']=_0x5933c3[_0x09c6('0x6')]||{};this[_0x09c6('0x7')]=_0x5933c3['serverUrl']||'';this[_0x09c6('0x8')]=_0x5933c3['modernAuthentication']||![];this[_0x09c6('0x9')]=_0x5933c3['Configurations']||{};this[_0x09c6('0xa')]=_0x5933c3[_0x09c6('0xa')]||{};}module[_0x09c6('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x6266=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0x6266,0x18d));var _0x6626=function(_0x3a1a7d,_0x2ac7ca){_0x3a1a7d=_0x3a1a7d-0x0;var _0x209955=_0x6266[_0x3a1a7d];return _0x209955;};'use strict';function Dynamics365Account(_0x281cf4){this['id']=_0x281cf4['id']||0x0;this[_0x6626('0x0')]=_0x281cf4[_0x6626('0x0')]||'';this['username']=_0x281cf4[_0x6626('0x1')]||'';this[_0x6626('0x2')]=_0x281cf4[_0x6626('0x2')]||'';this[_0x6626('0x3')]=_0x281cf4[_0x6626('0x3')]||'';this[_0x6626('0x4')]=_0x281cf4[_0x6626('0x4')]||'';this[_0x6626('0x5')]=_0x281cf4[_0x6626('0x5')]||'';this['clientSecret']=_0x281cf4[_0x6626('0x6')]||{};this['serverUrl']=_0x281cf4[_0x6626('0x7')]||'';this['modernAuthentication']=_0x281cf4[_0x6626('0x8')]||![];this[_0x6626('0x9')]=_0x281cf4[_0x6626('0x9')]||{};this['CloudProvider']=_0x281cf4[_0x6626('0xa')]||{};}module[_0x6626('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 55c400a..734ea17 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 _0x0668=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x5a8bbc,_0x144190){var _0x565c34=function(_0x2b441d){while(--_0x2b441d){_0x5a8bbc['push'](_0x5a8bbc['shift']());}};_0x565c34(++_0x144190);}(_0x0668,0x6f));var _0x8066=function(_0x116e6f,_0x3c33cb){_0x116e6f=_0x116e6f-0x0;var _0x2ed403=_0x0668[_0x116e6f];return _0x2ed403;};'use strict';function FaxAccount(_0x3cd642){this['id']=_0x3cd642['id']||0x0;this['name']=_0x3cd642[_0x8066('0x0')]||'';this[_0x8066('0x1')]=_0x3cd642[_0x8066('0x1')];this[_0x8066('0x2')]=_0x3cd642[_0x8066('0x2')];this['headerinfo']=_0x3cd642[_0x8066('0x3')];this['localstationid']=_0x3cd642[_0x8066('0x4')];this[_0x8066('0x5')]=_0x3cd642[_0x8066('0x5')]||0x960;this[_0x8066('0x6')]=_0x3cd642[_0x8066('0x6')]||0x3840;this['modem']=_0x3cd642[_0x8066('0x7')]||_0x8066('0x8');this[_0x8066('0x9')]=_0x3cd642[_0x8066('0x9')]||'no';this[_0x8066('0xa')]=_0x3cd642[_0x8066('0xa')]||'no';this[_0x8066('0xb')]=_0x3cd642[_0x8066('0xb')]||0x1388;this[_0x8066('0xc')]=_0x3cd642[_0x8066('0xc')]||_0x8066('0xd');this[_0x8066('0xe')]=_0x3cd642[_0x8066('0xe')]?_0x3cd642[_0x8066('0xe')]:undefined;this[_0x8066('0xf')]=_0x3cd642[_0x8066('0xf')];this[_0x8066('0x10')]=_0x3cd642[_0x8066('0x10')];}module[_0x8066('0x11')]=FaxAccount; \ No newline at end of file +var _0x576a=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect'];(function(_0x27a20a,_0x59320a){var _0x4c29dc=function(_0x1f2f00){while(--_0x1f2f00){_0x27a20a['push'](_0x27a20a['shift']());}};_0x4c29dc(++_0x59320a);}(_0x576a,0x8f));var _0xa576=function(_0x4774b8,_0x4199c2){_0x4774b8=_0x4774b8-0x0;var _0x428765=_0x576a[_0x4774b8];return _0x428765;};'use strict';function FaxAccount(_0x51a7c6){this['id']=_0x51a7c6['id']||0x0;this[_0xa576('0x0')]=_0x51a7c6[_0xa576('0x0')]||'';this[_0xa576('0x1')]=_0x51a7c6[_0xa576('0x1')];this[_0xa576('0x2')]=_0x51a7c6[_0xa576('0x2')];this[_0xa576('0x3')]=_0x51a7c6[_0xa576('0x3')];this[_0xa576('0x4')]=_0x51a7c6[_0xa576('0x4')];this[_0xa576('0x5')]=_0x51a7c6[_0xa576('0x5')]||0x960;this[_0xa576('0x6')]=_0x51a7c6[_0xa576('0x6')]||0x3840;this[_0xa576('0x7')]=_0x51a7c6[_0xa576('0x7')]||'v17,v27,v29';this[_0xa576('0x8')]=_0x51a7c6[_0xa576('0x8')]||'no';this['faxdetect']=_0x51a7c6[_0xa576('0x9')]||'no';this['t38timeout']=_0x51a7c6[_0xa576('0xa')]||0x1388;this[_0xa576('0xb')]=_0x51a7c6[_0xa576('0xb')]||_0xa576('0xc');this[_0xa576('0xd')]=_0x51a7c6[_0xa576('0xd')]?_0x51a7c6['Trunk']:undefined;this['ListId']=_0x51a7c6[_0xa576('0xe')];this[_0xa576('0xf')]=_0x51a7c6[_0xa576('0xf')];}module[_0xa576('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 24e0556..1b5f0ad 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 _0x4de4=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x526614,_0x1a3c35){var _0x1cdf0f=function(_0x4b1060){while(--_0x4b1060){_0x526614['push'](_0x526614['shift']());}};_0x1cdf0f(++_0x1a3c35);}(_0x4de4,0x1e1));var _0x44de=function(_0x1f04dd,_0x395bed){_0x1f04dd=_0x1f04dd-0x0;var _0x599af2=_0x4de4[_0x1f04dd];return _0x599af2;};'use strict';function FreshdeskAccount(_0x29e5dd){this['id']=_0x29e5dd['id']||0x0;this['name']=_0x29e5dd[_0x44de('0x0')]||'';this['username']=_0x29e5dd[_0x44de('0x1')]||'';this[_0x44de('0x2')]=_0x29e5dd[_0x44de('0x3')]||'';this['remoteUri']=_0x29e5dd[_0x44de('0x4')]||'';this[_0x44de('0x5')]=_0x29e5dd[_0x44de('0x5')]||'';this['Configurations']=_0x29e5dd[_0x44de('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x7686=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x12ff9c,_0x3a12f6){var _0x333e90=function(_0x3bfcac){while(--_0x3bfcac){_0x12ff9c['push'](_0x12ff9c['shift']());}};_0x333e90(++_0x3a12f6);}(_0x7686,0x162));var _0x6768=function(_0x2070f5,_0x53733e){_0x2070f5=_0x2070f5-0x0;var _0x37e82c=_0x7686[_0x2070f5];return _0x37e82c;};'use strict';function FreshdeskAccount(_0x23f6e4){this['id']=_0x23f6e4['id']||0x0;this[_0x6768('0x0')]=_0x23f6e4['name']||'';this[_0x6768('0x1')]=_0x23f6e4[_0x6768('0x1')]||'';this['apiKey']=_0x23f6e4['token']||'';this['remoteUri']=_0x23f6e4[_0x6768('0x2')]||'';this[_0x6768('0x3')]=_0x23f6e4['serverUrl']||'';this['Configurations']=_0x23f6e4[_0x6768('0x4')]||{};}module[_0x6768('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 03874cf..485243f 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 _0x10af=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x246f92,_0xcf7bd4){var _0x2b8e7d=function(_0x9e8650){while(--_0x9e8650){_0x246f92['push'](_0x246f92['shift']());}};_0x2b8e7d(++_0xcf7bd4);}(_0x10af,0xfc));var _0xf10a=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x10af[_0x468b0f];return _0x3e74d9;};'use strict';function FreshsalesAccount(_0x278c56){this['id']=_0x278c56['id']||0x0;this['name']=_0x278c56[_0xf10a('0x0')]||'';this[_0xf10a('0x1')]=_0x278c56[_0xf10a('0x1')]||'';this[_0xf10a('0x2')]=_0x278c56[_0xf10a('0x3')]||'';this[_0xf10a('0x4')]=_0x278c56[_0xf10a('0x4')]||'';this[_0xf10a('0x5')]=_0x278c56['serverUrl']||'';this[_0xf10a('0x6')]=_0x278c56[_0xf10a('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x56a4=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x387e2d,_0x334629){var _0x40a526=function(_0xa77edb){while(--_0xa77edb){_0x387e2d['push'](_0x387e2d['shift']());}};_0x40a526(++_0x334629);}(_0x56a4,0x11b));var _0x456a=function(_0x3f4450,_0xfaf1a8){_0x3f4450=_0x3f4450-0x0;var _0x492655=_0x56a4[_0x3f4450];return _0x492655;};'use strict';function FreshsalesAccount(_0x9e7c6e){this['id']=_0x9e7c6e['id']||0x0;this[_0x456a('0x0')]=_0x9e7c6e['name']||'';this[_0x456a('0x1')]=_0x9e7c6e[_0x456a('0x1')]||'';this['apiKey']=_0x9e7c6e['token']||'';this[_0x456a('0x2')]=_0x9e7c6e[_0x456a('0x2')]||'';this[_0x456a('0x3')]=_0x9e7c6e[_0x456a('0x3')]||'';this[_0x456a('0x4')]=_0x9e7c6e['Configurations']||{};}module[_0x456a('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 47cd7da..69b7046 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 _0x3bf0=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename','accountcode','exten','holdtime','assigned','lastAssignedTo','voice','routealias','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','position','count','queuecallerabandonAt'];(function(_0x4fce34,_0x18ca51){var _0x45c0b6=function(_0x5b3288){while(--_0x5b3288){_0x4fce34['push'](_0x4fce34['shift']());}};_0x45c0b6(++_0x18ca51);}(_0x3bf0,0xde));var _0x03bf=function(_0x26e85a,_0x4c8d35){_0x26e85a=_0x26e85a-0x0;var _0x33c593=_0x3bf0[_0x26e85a];return _0x33c593;};'use strict';function QueueReport(){this[_0x03bf('0x0')]=_0x03bf('0x1');this[_0x03bf('0x2')]='';this[_0x03bf('0x3')]='';this[_0x03bf('0x4')]='';this['queue']='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x03bf('0x5')]=0x1;this[_0x03bf('0x6')]=0x1;this['queuecallerabandon']=![];this[_0x03bf('0x7')]=null;this[_0x03bf('0x8')]=![];this[_0x03bf('0x9')]=null;this[_0x03bf('0xa')]=![];this[_0x03bf('0xb')]=null;this['originalposition']=0x1;this[_0x03bf('0xc')]='';this['connectedlinenum']='';this[_0x03bf('0xd')]='';this[_0x03bf('0xe')]='';this['context']='';this[_0x03bf('0xf')]='';this['priority']='';this[_0x03bf('0x10')]=0x0;this[_0x03bf('0x11')]=![];this[_0x03bf('0x12')]='';this['motionChannel']=_0x03bf('0x13');this[_0x03bf('0x14')]=null;this['mohtime']=0x0;this[_0x03bf('0x15')]={};}module[_0x03bf('0x16')]=QueueReport; \ No newline at end of file +var _0x7775=['holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0xcf2e31,_0x1fd7ab){var _0xf5803=function(_0x47eca1){while(--_0x47eca1){_0xcf2e31['push'](_0xcf2e31['shift']());}};_0xf5803(++_0x1fd7ab);}(_0x7775,0x1ca));var _0x5777=function(_0x2e0c0e,_0x3245a9){_0x2e0c0e=_0x2e0c0e-0x0;var _0xa598a9=_0x7775[_0x2e0c0e];return _0xa598a9;};'use strict';function QueueReport(){this['type']=_0x5777('0x0');this[_0x5777('0x1')]='';this[_0x5777('0x2')]='';this[_0x5777('0x3')]='';this[_0x5777('0x4')]='';this[_0x5777('0x5')]=null;this[_0x5777('0x6')]=null;this[_0x5777('0x7')]=0x1;this[_0x5777('0x8')]=0x1;this[_0x5777('0x9')]=![];this[_0x5777('0xa')]=null;this[_0x5777('0xb')]=![];this[_0x5777('0xc')]=null;this[_0x5777('0xd')]=![];this['queuecallerexitAt']=null;this[_0x5777('0xe')]=0x1;this[_0x5777('0xf')]='';this[_0x5777('0x10')]='';this[_0x5777('0x11')]='';this[_0x5777('0x12')]='';this[_0x5777('0x13')]='';this[_0x5777('0x14')]='';this[_0x5777('0x15')]='';this[_0x5777('0x16')]=0x0;this[_0x5777('0x17')]=![];this[_0x5777('0x18')]='';this[_0x5777('0x19')]='voice';this[_0x5777('0x1a')]=null;this[_0x5777('0x1b')]=0x0;this[_0x5777('0x1c')]={};}module[_0x5777('0x1d')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 6f8b993..f56dab6 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 _0x4123=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x2ce27b,_0x5bdd24){var _0x44c9a5=function(_0x3b3b91){while(--_0x3b3b91){_0x2ce27b['push'](_0x2ce27b['shift']());}};_0x44c9a5(++_0x5bdd24);}(_0x4123,0x87));var _0x3412=function(_0x1cc1e3,_0x4598a4){_0x1cc1e3=_0x1cc1e3-0x0;var _0x2843cc=_0x4123[_0x1cc1e3];return _0x2843cc;};'use strict';function SalesforceAccount(_0x2ecebd){this['id']=_0x2ecebd['id']||0x0;this[_0x3412('0x0')]=_0x2ecebd[_0x3412('0x0')]||'';this[_0x3412('0x1')]=_0x2ecebd[_0x3412('0x1')]||'';this[_0x3412('0x2')]=_0x2ecebd[_0x3412('0x2')]||'';this[_0x3412('0x3')]=_0x2ecebd['password']||'';this['clientId']=_0x2ecebd[_0x3412('0x4')]||'';this[_0x3412('0x5')]=_0x2ecebd['clientSecret']||'';this[_0x3412('0x6')]=_0x2ecebd[_0x3412('0x6')]||'';this[_0x3412('0x7')]=_0x2ecebd[_0x3412('0x7')]||_0x3412('0x8');this[_0x3412('0x9')]=_0x2ecebd['serverUrl']||'';this[_0x3412('0xa')]=_0x2ecebd[_0x3412('0xa')]||{};}module[_0x3412('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x3b68=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x3b68,0x1bd));var _0x83b6=function(_0x31f234,_0x2f731f){_0x31f234=_0x31f234-0x0;var _0x2f7673=_0x3b68[_0x31f234];return _0x2f7673;};'use strict';function SalesforceAccount(_0xdfdc1a){this['id']=_0xdfdc1a['id']||0x0;this[_0x83b6('0x0')]=_0xdfdc1a[_0x83b6('0x0')]||'';this[_0x83b6('0x1')]=_0xdfdc1a[_0x83b6('0x1')]||'';this[_0x83b6('0x2')]=_0xdfdc1a[_0x83b6('0x2')]||'';this[_0x83b6('0x3')]=_0xdfdc1a[_0x83b6('0x3')]||'';this[_0x83b6('0x4')]=_0xdfdc1a['clientId']||'';this[_0x83b6('0x5')]=_0xdfdc1a[_0x83b6('0x5')]||'';this[_0x83b6('0x6')]=_0xdfdc1a['securityToken']||'';this[_0x83b6('0x7')]=_0xdfdc1a[_0x83b6('0x7')]||_0x83b6('0x8');this['serverUrl']=_0xdfdc1a[_0x83b6('0x9')]||'';this['Configurations']=_0xdfdc1a[_0x83b6('0xa')]||{};}module[_0x83b6('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 af9bcd2..d2869d9 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 _0x6462=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2b5b7e,_0x81e8c){var _0x20c7a3=function(_0x44c388){while(--_0x44c388){_0x2b5b7e['push'](_0x2b5b7e['shift']());}};_0x20c7a3(++_0x81e8c);}(_0x6462,0x65));var _0x2646=function(_0x309d92,_0x1aa059){_0x309d92=_0x309d92-0x0;var _0x1e578b=_0x6462[_0x309d92];return _0x1e578b;};'use strict';function ServicenowAccount(_0x30f270){this['id']=_0x30f270['id']||0x0;this[_0x2646('0x0')]=_0x30f270[_0x2646('0x0')]||'';this['username']=_0x30f270['username']||'';this[_0x2646('0x1')]=_0x30f270[_0x2646('0x1')]||'';this[_0x2646('0x2')]=_0x30f270[_0x2646('0x2')]||'';this[_0x2646('0x3')]=_0x30f270[_0x2646('0x3')]||'';this[_0x2646('0x4')]=_0x30f270['Configurations']||{};}module[_0x2646('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xbbbd=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4289ed,_0x2c7b8f){var _0x2f5317=function(_0x2f6a2f){while(--_0x2f6a2f){_0x4289ed['push'](_0x4289ed['shift']());}};_0x2f5317(++_0x2c7b8f);}(_0xbbbd,0x79));var _0xdbbb=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xbbbd[_0x20589d];return _0x422de9;};'use strict';function ServicenowAccount(_0x4ebfe1){this['id']=_0x4ebfe1['id']||0x0;this[_0xdbbb('0x0')]=_0x4ebfe1[_0xdbbb('0x0')]||'';this[_0xdbbb('0x1')]=_0x4ebfe1[_0xdbbb('0x1')]||'';this['password']=_0x4ebfe1[_0xdbbb('0x2')]||'';this['remoteUri']=_0x4ebfe1[_0xdbbb('0x3')]||'';this['serverUrl']=_0x4ebfe1[_0xdbbb('0x4')]||'';this[_0xdbbb('0x5')]=_0x4ebfe1[_0xdbbb('0x5')]||{};}module[_0xdbbb('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 17e7336..43fe81d 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 _0x8669=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1139dd,_0x2251a3){var _0x4d831d=function(_0x2c2a26){while(--_0x2c2a26){_0x1139dd['push'](_0x1139dd['shift']());}};_0x4d831d(++_0x2251a3);}(_0x8669,0x8a));var _0x9866=function(_0x427641,_0x28d080){_0x427641=_0x427641-0x0;var _0x1512ad=_0x8669[_0x427641];return _0x1512ad;};'use strict';function SugarcrmAccount(_0x47ab15){this['id']=_0x47ab15['id']||0x0;this[_0x9866('0x0')]=_0x47ab15['name']||'';this['username']=_0x47ab15[_0x9866('0x1')]||'';this[_0x9866('0x2')]=_0x47ab15[_0x9866('0x2')]||'';this[_0x9866('0x3')]=_0x47ab15[_0x9866('0x3')]||'';this[_0x9866('0x4')]=_0x47ab15['serverUrl']||'';this[_0x9866('0x5')]=_0x47ab15['Configurations']||{};}module[_0x9866('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x6a6c=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x2d27c9,_0x242203){var _0x5c4f3a=function(_0x43b11c){while(--_0x43b11c){_0x2d27c9['push'](_0x2d27c9['shift']());}};_0x5c4f3a(++_0x242203);}(_0x6a6c,0x118));var _0xc6a6=function(_0x54bd2e,_0x1c41a6){_0x54bd2e=_0x54bd2e-0x0;var _0x4cc406=_0x6a6c[_0x54bd2e];return _0x4cc406;};'use strict';function SugarcrmAccount(_0x11ced4){this['id']=_0x11ced4['id']||0x0;this['name']=_0x11ced4[_0xc6a6('0x0')]||'';this[_0xc6a6('0x1')]=_0x11ced4['username']||'';this['password']=_0x11ced4[_0xc6a6('0x2')]||'';this[_0xc6a6('0x3')]=_0x11ced4[_0xc6a6('0x3')]||'';this[_0xc6a6('0x4')]=_0x11ced4['serverUrl']||'';this[_0xc6a6('0x5')]=_0x11ced4['Configurations']||{};}module[_0xc6a6('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 32e1021..34c45d2 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 _0x8583=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x8583,0x183));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';function Telephone(_0x22dc24){this['id']=_0x22dc24['id']||0x0;this[_0x3858('0x0')]=_0x22dc24[_0x3858('0x0')]||'';this['accountcode']=_0x22dc24[_0x3858('0x1')]||'';this[_0x3858('0x2')]=_0x3858('0x3');this[_0x3858('0x4')]=0x0;this[_0x3858('0x5')]=_0x3858('0x3');this[_0x3858('0x6')]='';}module[_0x3858('0x7')]=Telephone; \ No newline at end of file +var _0x7497=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x3b5d1c,_0x193ffb){var _0x577538=function(_0x351fd6){while(--_0x351fd6){_0x3b5d1c['push'](_0x3b5d1c['shift']());}};_0x577538(++_0x193ffb);}(_0x7497,0x13c));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x578cbd){this['id']=_0x578cbd['id']||0x0;this[_0x7749('0x0')]=_0x578cbd[_0x7749('0x0')]||'';this[_0x7749('0x1')]=_0x578cbd[_0x7749('0x1')]||'';this[_0x7749('0x2')]=_0x7749('0x3');this[_0x7749('0x4')]=0x0;this[_0x7749('0x5')]=_0x7749('0x3');this[_0x7749('0x6')]='';}module[_0x7749('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index da68503..3824b59 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x4fa158,_0x2d01b8){var _0x5d3348=function(_0x16bf0a){while(--_0x16bf0a){_0x4fa158['push'](_0x4fa158['shift']());}};_0x5d3348(++_0x2d01b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x52e251,_0x3b6303){_0x52e251=_0x52e251-0x0;var _0x5eee63=_0xb10b[_0x52e251];return _0x5eee63;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x3acce1,_0x523428){var _0x5f537f=function(_0x448a7c){while(--_0x448a7c){_0x3acce1['push'](_0x3acce1['shift']());}};_0x5f537f(++_0x523428);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 263cee2..8a15e6e 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 _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x5f592d,_0xe1ceda){var _0xf8ddda=function(_0x1ed8da){while(--_0x1ed8da){_0x5f592d['push'](_0x5f592d['shift']());}};_0xf8ddda(++_0xe1ceda);}(_0xda3f,0xec));var _0xfda3=function(_0x433d54,_0x3af052){_0x433d54=_0x433d54-0x0;var _0x3245d6=_0xda3f[_0x433d54];return _0x3245d6;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x5206c4,_0x63f6c7){var _0x3c24d6=function(_0x918637){while(--_0x918637){_0x5206c4['push'](_0x5206c4['shift']());}};_0x3c24d6(++_0x63f6c7);}(_0x14a0,0x8e));var _0x014a=function(_0x49478a,_0x36d711){_0x49478a=_0x49478a-0x0;var _0x51ed84=_0x14a0[_0x49478a];return _0x51ed84;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 58ba080..12a5b12 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 _0x7461=['state','unknown','stateTime','registry','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7461,0x196));var _0x1746=function(_0x210b93,_0x133e6d){_0x210b93=_0x210b93-0x0;var _0x2b020f=_0x7461[_0x210b93];return _0x2b020f;};'use strict';function Trunk(_0x3a38d2){this['id']=_0x3a38d2['id']||0x0;this[_0x1746('0x0')]=_0x3a38d2['active']||![];this[_0x1746('0x1')]=_0x3a38d2[_0x1746('0x1')]||'';this[_0x1746('0x2')]=_0x1746('0x3');this[_0x1746('0x4')]=0x0;this['status']='unknown';this[_0x1746('0x5')]=_0x3a38d2[_0x1746('0x5')]&&_0x3a38d2[_0x1746('0x5')]['indexOf'](':')?_0x3a38d2[_0x1746('0x5')][_0x1746('0x6')](':')[0x0]:'';this[_0x1746('0x7')]='';this[_0x1746('0x8')]='';this[_0x1746('0x9')]='';this[_0x1746('0xa')]='';this[_0x1746('0xb')]='';this[_0x1746('0xc')]='unknown';this[_0x1746('0xd')]='';this[_0x1746('0xe')]='';this[_0x1746('0xf')]=_0x3a38d2[_0x1746('0xf')]||'';}module[_0x1746('0x10')]=Trunk; \ No newline at end of file +var _0xb36a=['name','state','unknown','status','registry','indexOf','split','port','domain','refresh','defaultuser','exports','active'];(function(_0x2e1047,_0x234b8f){var _0x2ab529=function(_0x5ea741){while(--_0x5ea741){_0x2e1047['push'](_0x2e1047['shift']());}};_0x2ab529(++_0x234b8f);}(_0xb36a,0x144));var _0xab36=function(_0x3aede2,_0x3108a8){_0x3aede2=_0x3aede2-0x0;var _0x1e639d=_0xb36a[_0x3aede2];return _0x1e639d;};'use strict';function Trunk(_0x8e9b02){this['id']=_0x8e9b02['id']||0x0;this[_0xab36('0x0')]=_0x8e9b02[_0xab36('0x0')]||![];this[_0xab36('0x1')]=_0x8e9b02[_0xab36('0x1')]||'';this[_0xab36('0x2')]=_0xab36('0x3');this['stateTime']=0x0;this[_0xab36('0x4')]=_0xab36('0x3');this[_0xab36('0x5')]=_0x8e9b02[_0xab36('0x5')]&&_0x8e9b02['registry'][_0xab36('0x6')](':')?_0x8e9b02[_0xab36('0x5')][_0xab36('0x7')](':')[0x0]:'';this['host']='';this[_0xab36('0x8')]='';this[_0xab36('0x9')]='';this['domainport']='';this[_0xab36('0xa')]='';this['stateRegistry']='unknown';this['registrationtime']='';this['address']='';this[_0xab36('0xb')]=_0x8e9b02[_0xab36('0xb')]||'';}module[_0xab36('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 5e9690d..45247ba 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 _0xf578=['mandatoryDisposition','recordingFormat'];(function(_0x32b5da,_0x45d994){var _0x1304ab=function(_0x30b6e6){while(--_0x30b6e6){_0x32b5da['push'](_0x32b5da['shift']());}};_0x1304ab(++_0x45d994);}(_0xf578,0x109));var _0x8f57=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xf578[_0xf2f332];return _0x56cce3;};'use strict';function voiceExtension(_0x384427){this['id']=_0x384427['id']||0x0;this['exten']=_0x384427['exten']||'';this[_0x8f57('0x0')]=_0x384427[_0x8f57('0x0')]||'none';this[_0x8f57('0x1')]=_0x384427[_0x8f57('0x1')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x2722=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x5d59cf,_0xeb652a){var _0x38f514=function(_0x1dc15c){while(--_0x1dc15c){_0x5d59cf['push'](_0x5d59cf['shift']());}};_0x38f514(++_0xeb652a);}(_0x2722,0x185));var _0x2272=function(_0x15fd29,_0x20b906){_0x15fd29=_0x15fd29-0x0;var _0x1a80c9=_0x2722[_0x15fd29];return _0x1a80c9;};'use strict';function voiceExtension(_0x26ef3e){this['id']=_0x26ef3e['id']||0x0;this[_0x2272('0x0')]=_0x26ef3e['exten']||'';this[_0x2272('0x1')]=_0x26ef3e[_0x2272('0x1')]||_0x2272('0x2');this[_0x2272('0x3')]=_0x26ef3e[_0x2272('0x3')]||![];}module[_0x2272('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8b881af..39cf834 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 _0x5d59=['sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','leastrecent','linear','random','roundrobin','wrandom','name','monitor_format','type','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','invalid','onHold','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d59,0x15f));var _0x95d5=function(_0x5a401e,_0x2de782){_0x5a401e=_0x5a401e-0x0;var _0x2aa2cc=_0x5d59[_0x5a401e];return _0x2aa2cc;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x95d5('0x0'),'gsm':_0x95d5('0x1')};var strategy={'fewestcalls':_0x95d5('0x2'),'leastrecent':_0x95d5('0x3'),'linear':_0x95d5('0x4'),'random':_0x95d5('0x5'),'ringall':'ringall','rr':_0x95d5('0x6'),'rrmemory':'rrmemory','rrordered':'rrordered','wrandom':_0x95d5('0x7')};function VoiceQueue(_0x4a733e){this['id']=_0x4a733e['id']||0x0;this['name']=_0x4a733e[_0x95d5('0x8')]||'';this[_0x95d5('0x9')]=_0x4a733e[_0x95d5('0x9')]||'';this['type']=_0x4a733e[_0x95d5('0xa')]||'inbound';this[_0x95d5('0xb')]=0x0;this['total']=0x0;this[_0x95d5('0xc')]=0x0;this[_0x95d5('0xd')]=0x0;this[_0x95d5('0xe')]=0x0;this[_0x95d5('0xf')]=0x0;this[_0x95d5('0x10')]=0x0;this[_0x95d5('0x11')]=0x0;this[_0x95d5('0x12')]=0x0;this[_0x95d5('0x13')]=0x0;this['inUse']=0x0;this[_0x95d5('0x14')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x95d5('0x15')]=0x0;this[_0x95d5('0x16')]=0x0;this[_0x95d5('0x17')]=0x0;this[_0x95d5('0x18')]=0x0;this['talking']=0x0;this[_0x95d5('0x19')]=0x0;this[_0x95d5('0x1a')]=0x0;this[_0x95d5('0x1b')]=_0x4a733e[_0x95d5('0x1b')]||![];this[_0x95d5('0x1c')]=_0x4a733e[_0x95d5('0x1c')]||0xa;this[_0x95d5('0x1d')]=_0x4a733e[_0x95d5('0x1d')]||'no';this[_0x95d5('0x1e')]=!![];this['message']='';this['statusMessage']='';this[_0x95d5('0x1f')]=0x0;this['temp']=0x0;this[_0x95d5('0x20')]=_0x4a733e[_0x95d5('0x20')]||null;this['dialGlobalInterval']=_0x4a733e[_0x95d5('0x21')]?_0x4a733e[_0x95d5('0x21')]:null;this[_0x95d5('0x22')]=_0x4a733e[_0x95d5('0x22')];this[_0x95d5('0x23')]=_0x4a733e[_0x95d5('0x23')]||'progressive';this[_0x95d5('0x24')]=_0x4a733e[_0x95d5('0x24')]||0x0;this[_0x95d5('0x25')]=_0x4a733e['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4a733e[_0x95d5('0x26')]||0x1;this[_0x95d5('0x27')]=_0x4a733e['dialPredictiveOptimization']||_0x95d5('0x28');this[_0x95d5('0x29')]=_0x4a733e[_0x95d5('0x29')]||0.03;this['dialPredictiveInterval']=_0x4a733e[_0x95d5('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x4a733e['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x4a733e['dialOriginateCallerIdNumber']||'anonymous';this[_0x95d5('0x2b')]=_0x4a733e[_0x95d5('0x2b')]||0x1e;this[_0x95d5('0x2c')]=_0x4a733e[_0x95d5('0x2c')]||'tTxX';this[_0x95d5('0x2d')]=_0x4a733e[_0x95d5('0x2d')]||0x3;this[_0x95d5('0x2e')]=_0x4a733e[_0x95d5('0x2e')]||undefined;this[_0x95d5('0x2f')]=_0x4a733e[_0x95d5('0x2f')]||0x3;this[_0x95d5('0x30')]=_0x4a733e[_0x95d5('0x30')]||0x96;this[_0x95d5('0x31')]=_0x4a733e[_0x95d5('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x4a733e['dialBusyRetryFrequency']||0x96;this[_0x95d5('0x32')]=_0x4a733e[_0x95d5('0x32')]||0x3;this[_0x95d5('0x33')]=_0x4a733e['dialNoAnswerRetryFrequency']||0x96;this[_0x95d5('0x34')]=_0x4a733e['dialNoSuchNumberMaxRetry']||0x3;this[_0x95d5('0x35')]=_0x4a733e['dialNoSuchNumberRetryFrequency']||0x96;this[_0x95d5('0x36')]=_0x4a733e[_0x95d5('0x36')]||0x3;this[_0x95d5('0x37')]=_0x4a733e[_0x95d5('0x37')]||0x96;this[_0x95d5('0x38')]=_0x4a733e[_0x95d5('0x38')]||0x3;this[_0x95d5('0x39')]=_0x4a733e[_0x95d5('0x39')]||0x96;this['dialMachineMaxRetry']=_0x4a733e['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4a733e[_0x95d5('0x3a')]||0x96;this[_0x95d5('0x3b')]=_0x4a733e[_0x95d5('0x3b')]||0x3;this[_0x95d5('0x3c')]=_0x4a733e[_0x95d5('0x3c')]||0x96;this[_0x95d5('0x3d')]=_0x4a733e['callAdditionalPhoneAfterMin']||0x3;this[_0x95d5('0x3e')]=_0x4a733e[_0x95d5('0x3e')]||0x4;this[_0x95d5('0x3f')]=_0x4a733e[_0x95d5('0x3f')]?_0x4a733e[_0x95d5('0x3f')]:undefined;this[_0x95d5('0x40')]=_0x4a733e[_0x95d5('0x40')]?_0x4a733e[_0x95d5('0x40')]:undefined;this[_0x95d5('0x41')]=_0x4a733e['dialPrefix']||undefined;this['Interval']=_0x4a733e[_0x95d5('0x42')]?_0x4a733e[_0x95d5('0x42')]:undefined;this[_0x95d5('0x43')]=_0x4a733e[_0x95d5('0x43')]||'DESC';this[_0x95d5('0x44')]=_0x4a733e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x95d5('0x45')]=_0x4a733e[_0x95d5('0x45')]||undefined;this[_0x95d5('0x46')]=strategy[_0x4a733e['strategy']];this[_0x95d5('0x47')]=!![];this[_0x95d5('0x48')]=_0x4a733e[_0x95d5('0x48')]||![];this[_0x95d5('0x49')]=_0x4a733e[_0x95d5('0x49')];this[_0x95d5('0x4a')]=_0x4a733e['dialAMDGreeting'];this[_0x95d5('0x4b')]=_0x4a733e[_0x95d5('0x4b')];this[_0x95d5('0x4c')]=_0x4a733e[_0x95d5('0x4c')];this[_0x95d5('0x4d')]=_0x4a733e[_0x95d5('0x4d')];this[_0x95d5('0x4e')]=_0x4a733e[_0x95d5('0x4e')];this[_0x95d5('0x4f')]=_0x4a733e[_0x95d5('0x4f')];this['dialAMDSilenceThreshold']=_0x4a733e['dialAMDSilenceThreshold'];this[_0x95d5('0x50')]=_0x4a733e[_0x95d5('0x50')];this[_0x95d5('0x51')]=0x0;this[_0x95d5('0x52')]=0x0;this[_0x95d5('0x53')]=_0x4a733e['timeout'];this[_0x95d5('0x54')]=0x0;this[_0x95d5('0x55')]=0x0;this[_0x95d5('0x56')]=0x0;this[_0x95d5('0x57')]=0x0;this[_0x95d5('0x58')]=0x0;this[_0x95d5('0x59')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x95d5('0x5a')]=0x0;this[_0x95d5('0x5b')]=0x0;this[_0x95d5('0x5c')]=0x0;this[_0x95d5('0x5d')]=0x0;this[_0x95d5('0x5e')]=0x0;this[_0x95d5('0x5f')]=0x0;this[_0x95d5('0x60')]=0x0;this[_0x95d5('0x61')]=undefined;this[_0x95d5('0x62')]=undefined;this['handlePredictive']=undefined;this[_0x95d5('0x63')]=1.05;this[_0x95d5('0x64')]=0x0;this[_0x95d5('0x65')]=0x0;this[_0x95d5('0x66')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x95d5('0x67')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x95d5('0x68')]=0x0;this[_0x95d5('0x69')]=0x0;this[_0x95d5('0x6a')]=_0x4a733e[_0x95d5('0x6b')]||0x14;this[_0x95d5('0x6c')]=_0x4a733e['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x95d5('0x6d')]=0x0;this[_0x95d5('0x6e')]=0x0;this[_0x95d5('0x6f')]=0x1;this[_0x95d5('0x70')]=0x0;this[_0x95d5('0x71')]=0x0;this[_0x95d5('0x72')]=0x0;this[_0x95d5('0x73')]=0x0;this[_0x95d5('0x74')]=_0x4a733e['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x4a733e[_0x95d5('0x75')]||![];this[_0x95d5('0x76')]=!!_0x4a733e[_0x95d5('0x76')]||![];this['dialPreviewRecallmeReminder']=!!_0x4a733e[_0x95d5('0x77')]||![];this[_0x95d5('0x78')]=_0x4a733e['dialQueueProject2']||undefined;this[_0x95d5('0x79')]=_0x4a733e['dialAgiAfterHangupClient']||![];this[_0x95d5('0x7a')]=_0x4a733e[_0x95d5('0x7a')]||![];this[_0x95d5('0x9')]=monitorFormat[_0x4a733e[_0x95d5('0x9')]]?monitorFormat[_0x4a733e[_0x95d5('0x9')]]:undefined;this[_0x95d5('0x7b')]=_0x4a733e[_0x95d5('0x7b')]||![];this[_0x95d5('0x7c')]=_0x4a733e['mandatoryDispositionPause']?_0x4a733e['mandatoryDispositionPause']:undefined;this[_0x95d5('0x7d')]=![];}module[_0x95d5('0x7e')]=VoiceQueue; \ No newline at end of file +var _0xef56=['dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','fewestcalls','linear','random','ringall','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','sumDuration','sumBillable','unmanaged','available','busy','invalid','notInUse','onHold','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','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','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor'];(function(_0x4fc927,_0x63b878){var _0x28f387=function(_0x136af1){while(--_0x136af1){_0x4fc927['push'](_0x4fc927['shift']());}};_0x28f387(++_0x63b878);}(_0xef56,0x103));var _0x6ef5=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xef56[_0x1db251];return _0x56685a;};'use strict';var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0x6ef5('0x0'),'leastrecent':'leastrecent','linear':_0x6ef5('0x1'),'random':_0x6ef5('0x2'),'ringall':_0x6ef5('0x3'),'rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0x6ef5('0x4'),'wrandom':_0x6ef5('0x5')};function VoiceQueue(_0x347ab8){this['id']=_0x347ab8['id']||0x0;this['name']=_0x347ab8[_0x6ef5('0x6')]||'';this[_0x6ef5('0x7')]=_0x347ab8[_0x6ef5('0x7')]||'';this['type']=_0x347ab8[_0x6ef5('0x8')]||_0x6ef5('0x9');this[_0x6ef5('0xa')]=0x0;this[_0x6ef5('0xb')]=0x0;this['answered']=0x0;this[_0x6ef5('0xc')]=0x0;this['sumHoldTime']=0x0;this[_0x6ef5('0xd')]=0x0;this[_0x6ef5('0xe')]=0x0;this['abandoned']=0x0;this[_0x6ef5('0xf')]=0x0;this[_0x6ef5('0x10')]=0x0;this['inUse']=0x0;this[_0x6ef5('0x11')]=0x0;this['loggedIn']=0x0;this[_0x6ef5('0x12')]=0x0;this[_0x6ef5('0x13')]=0x0;this['paused']=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x6ef5('0x14')]=0x0;this[_0x6ef5('0x15')]=0x0;this[_0x6ef5('0x16')]=0x0;this[_0x6ef5('0x17')]=_0x347ab8['acw']||![];this[_0x6ef5('0x18')]=_0x347ab8['acwTimeout']||0xa;this[_0x6ef5('0x19')]=_0x347ab8[_0x6ef5('0x19')]||'no';this[_0x6ef5('0x1a')]=!![];this[_0x6ef5('0x1b')]='';this['statusMessage']='';this[_0x6ef5('0x1c')]=0x0;this[_0x6ef5('0x1d')]=0x0;this[_0x6ef5('0x1e')]=_0x347ab8[_0x6ef5('0x1e')]||null;this[_0x6ef5('0x1f')]=_0x347ab8[_0x6ef5('0x1f')]?_0x347ab8[_0x6ef5('0x1f')]:null;this[_0x6ef5('0x20')]=_0x347ab8[_0x6ef5('0x20')];this[_0x6ef5('0x21')]=_0x347ab8['dialMethod']||_0x6ef5('0x22');this['dialLimitChannel']=_0x347ab8[_0x6ef5('0x23')]||0x0;this['dialLimitQueue']=_0x347ab8[_0x6ef5('0x24')]||0x0;this[_0x6ef5('0x25')]=_0x347ab8[_0x6ef5('0x25')]||0x1;this[_0x6ef5('0x26')]=_0x347ab8[_0x6ef5('0x26')]||_0x6ef5('0x27');this['dialPredictiveOptimizationPercentage']=_0x347ab8[_0x6ef5('0x28')]||0.03;this[_0x6ef5('0x29')]=_0x347ab8[_0x6ef5('0x29')]||0x258;this[_0x6ef5('0x2a')]=_0x347ab8[_0x6ef5('0x2a')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x347ab8[_0x6ef5('0x2b')]||_0x6ef5('0x2c');this[_0x6ef5('0x2d')]=_0x347ab8[_0x6ef5('0x2d')]||0x1e;this['dialQueueOptions']=_0x347ab8[_0x6ef5('0x2e')]||_0x6ef5('0x2f');this[_0x6ef5('0x30')]=_0x347ab8[_0x6ef5('0x30')]||0x3;this[_0x6ef5('0x31')]=_0x347ab8[_0x6ef5('0x31')]||undefined;this[_0x6ef5('0x32')]=_0x347ab8[_0x6ef5('0x32')]||0x3;this[_0x6ef5('0x33')]=_0x347ab8['dialCongestionRetryFrequency']||0x96;this[_0x6ef5('0x34')]=_0x347ab8[_0x6ef5('0x34')]||0x3;this[_0x6ef5('0x35')]=_0x347ab8[_0x6ef5('0x35')]||0x96;this[_0x6ef5('0x36')]=_0x347ab8[_0x6ef5('0x36')]||0x3;this[_0x6ef5('0x37')]=_0x347ab8[_0x6ef5('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x347ab8[_0x6ef5('0x38')]||0x3;this[_0x6ef5('0x39')]=_0x347ab8[_0x6ef5('0x39')]||0x96;this[_0x6ef5('0x3a')]=_0x347ab8['dialDropMaxRetry']||0x3;this[_0x6ef5('0x3b')]=_0x347ab8[_0x6ef5('0x3b')]||0x96;this[_0x6ef5('0x3c')]=_0x347ab8['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x347ab8[_0x6ef5('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x347ab8[_0x6ef5('0x3e')]||0x3;this[_0x6ef5('0x3f')]=_0x347ab8[_0x6ef5('0x3f')]||0x96;this[_0x6ef5('0x40')]=_0x347ab8[_0x6ef5('0x40')]||0x3;this[_0x6ef5('0x41')]=_0x347ab8['dialAgentRejectRetryFrequency']||0x96;this[_0x6ef5('0x42')]=_0x347ab8[_0x6ef5('0x42')]||0x3;this['dialGlobalMaxRetry']=_0x347ab8[_0x6ef5('0x43')]||0x4;this['Trunk']=_0x347ab8[_0x6ef5('0x44')]?_0x347ab8[_0x6ef5('0x44')]:undefined;this[_0x6ef5('0x45')]=_0x347ab8[_0x6ef5('0x45')]?_0x347ab8[_0x6ef5('0x45')]:undefined;this[_0x6ef5('0x46')]=_0x347ab8[_0x6ef5('0x46')]||undefined;this[_0x6ef5('0x47')]=_0x347ab8[_0x6ef5('0x47')]?_0x347ab8[_0x6ef5('0x47')]:undefined;this[_0x6ef5('0x48')]=_0x347ab8[_0x6ef5('0x48')]||_0x6ef5('0x49');this[_0x6ef5('0x4a')]=_0x347ab8[_0x6ef5('0x4a')]||undefined;this['dialCutDigit']=_0x347ab8['dialCutDigit']||undefined;this[_0x6ef5('0x4b')]=strategy[_0x347ab8[_0x6ef5('0x4b')]];this[_0x6ef5('0x4c')]=!![];this['dialAMDActive']=_0x347ab8[_0x6ef5('0x4d')]||![];this[_0x6ef5('0x4e')]=_0x347ab8[_0x6ef5('0x4e')];this[_0x6ef5('0x4f')]=_0x347ab8['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x347ab8['dialAMDAfterGreetingSilence'];this[_0x6ef5('0x50')]=_0x347ab8['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x347ab8[_0x6ef5('0x51')];this[_0x6ef5('0x52')]=_0x347ab8['dialAMDBetweenWordsSilence'];this[_0x6ef5('0x53')]=_0x347ab8['dialAMDMaximumNumberOfWords'];this[_0x6ef5('0x54')]=_0x347ab8[_0x6ef5('0x54')];this[_0x6ef5('0x55')]=_0x347ab8[_0x6ef5('0x55')];this[_0x6ef5('0x56')]=0x0;this['pTalking']=0x0;this[_0x6ef5('0x57')]=_0x347ab8['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x6ef5('0x58')]=0x0;this[_0x6ef5('0x59')]=0x0;this[_0x6ef5('0x5a')]=0x0;this[_0x6ef5('0x5b')]=0x0;this[_0x6ef5('0x5c')]=0x0;this[_0x6ef5('0x5d')]=0x0;this[_0x6ef5('0x5e')]=0x0;this[_0x6ef5('0x5f')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x6ef5('0x60')]=0x0;this[_0x6ef5('0x61')]=0x0;this[_0x6ef5('0x62')]=0x0;this[_0x6ef5('0x63')]=0x0;this[_0x6ef5('0x64')]=undefined;this[_0x6ef5('0x65')]=undefined;this[_0x6ef5('0x66')]=undefined;this[_0x6ef5('0x67')]=1.05;this[_0x6ef5('0x68')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x6ef5('0x69')]=0x0;this[_0x6ef5('0x6a')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x347ab8[_0x6ef5('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x347ab8['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x6ef5('0x6c')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x6ef5('0x6d')]=0x1;this[_0x6ef5('0x6e')]=0x0;this[_0x6ef5('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x6ef5('0x70')]=0x0;this[_0x6ef5('0x71')]=_0x347ab8[_0x6ef5('0x71')]||0x1e;this[_0x6ef5('0x72')]=_0x347ab8[_0x6ef5('0x72')]||![];this[_0x6ef5('0x73')]=!!_0x347ab8[_0x6ef5('0x73')]||![];this[_0x6ef5('0x74')]=!!_0x347ab8[_0x6ef5('0x74')]||![];this[_0x6ef5('0x75')]=_0x347ab8['dialQueueProject2']||undefined;this[_0x6ef5('0x76')]=_0x347ab8[_0x6ef5('0x76')]||![];this[_0x6ef5('0x77')]=_0x347ab8[_0x6ef5('0x77')]||![];this[_0x6ef5('0x7')]=monitorFormat[_0x347ab8[_0x6ef5('0x7')]]?monitorFormat[_0x347ab8[_0x6ef5('0x7')]]:undefined;this[_0x6ef5('0x78')]=_0x347ab8[_0x6ef5('0x78')]||![];this[_0x6ef5('0x79')]=_0x347ab8[_0x6ef5('0x79')]?_0x347ab8['mandatoryDispositionPause']:undefined;this[_0x6ef5('0x7a')]=![];}module[_0x6ef5('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 6f1ab83..24407b8 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00e0=['temp','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','name','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','status','booked','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','updateReportFromOutboundQueue','outboundAbandonedCallsDay','outboundNoAnswerCallsDay','preview','available','loggedIn','loggedInDb','ringing','waiting','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','talking','sumBillable','sumDuration','strategy','abandoned','answered','busy','inUse','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix'];(function(_0x4c0f24,_0x16bd21){var _0xe3188d=function(_0x30e5f1){while(--_0x30e5f1){_0x4c0f24['push'](_0x4c0f24['shift']());}};_0xe3188d(++_0x16bd21);}(_0x00e0,0x1e3));var _0x000e=function(_0xaca437,_0x5cd251){_0xaca437=_0xaca437-0x0;var _0x3f8509=_0x00e0[_0xaca437];return _0x3f8509;};'use strict';var INBOUND_COUNTERS=[_0x000e('0x0'),_0x000e('0x1'),_0x000e('0x2'),'paused',_0x000e('0x3'),'talking',_0x000e('0x4')];var OUTBOUND_COUNTERS=['available','answered','inUse','loggedIn',_0x000e('0x2'),_0x000e('0x5'),'outboundAbandonedCallsDay',_0x000e('0x6'),_0x000e('0x7'),_0x000e('0x8'),_0x000e('0x9'),'outboundNoAnswerCallsDay',_0x000e('0xa'),'outboundReCallsDay',_0x000e('0xb'),_0x000e('0xc'),_0x000e('0xd'),_0x000e('0xe'),_0x000e('0xf'),_0x000e('0x10'),_0x000e('0x11'),'total','waiting'];function VoiceQueueSummary(_0x56c5ed){this['id']=_0x56c5ed['id'];this['name']=_0x56c5ed['name'];this[_0x000e('0x12')]=_0x56c5ed[_0x000e('0x12')];this[_0x000e('0x13')]=_0x56c5ed[_0x000e('0x13')]||0x0;this[_0x000e('0x14')]=_0x56c5ed[_0x000e('0x14')]||0x0;this[_0x000e('0x0')]=_0x56c5ed[_0x000e('0x0')]||0x0;this[_0x000e('0x15')]=_0x56c5ed[_0x000e('0x15')]||0x0;this[_0x000e('0x16')]=_0x56c5ed[_0x000e('0x16')]||0x0;this[_0x000e('0x17')]=_0x56c5ed[_0x000e('0x17')]||0x0;this[_0x000e('0x1')]=_0x56c5ed[_0x000e('0x1')]||0x0;this[_0x000e('0x2')]=_0x56c5ed[_0x000e('0x2')]||0x0;this['onHold']=_0x56c5ed[_0x000e('0x18')]||0x0;this[_0x000e('0x19')]=_0x56c5ed[_0x000e('0x19')]||0x0;this['paused']=_0x56c5ed['paused']||0x0;this[_0x000e('0x3')]=_0x56c5ed[_0x000e('0x3')]||0x0;this[_0x000e('0x1a')]=_0x56c5ed['ringInUse'];this['sumBillable']=_0x56c5ed['sumBillable'];this[_0x000e('0x11')]=_0x56c5ed[_0x000e('0x11')];this[_0x000e('0x1b')]=_0x56c5ed[_0x000e('0x1b')]||0x0;this['talking']=_0x56c5ed['talking']||0x0;this['total']=_0x56c5ed[_0x000e('0x1c')]||0x0;this[_0x000e('0x1d')]=_0x56c5ed[_0x000e('0x1d')];this['unavailable']=_0x56c5ed['unavailable']||0x0;this['unknown']=_0x56c5ed[_0x000e('0x1e')]||0x0;this['unmanaged']=_0x56c5ed[_0x000e('0x1f')]||0x0;this[_0x000e('0x4')]=_0x56c5ed[_0x000e('0x4')]||0x0;if(_0x56c5ed['type']===_0x000e('0x20')){this[_0x000e('0xe')]=_0x56c5ed['pTalking']||0x0;this[_0x000e('0x21')]=_0x56c5ed['dialActive'];this['dialMethod']=_0x56c5ed[_0x000e('0x22')];this[_0x000e('0x23')]=_0x56c5ed['dialOriginateCallerIdName'];this[_0x000e('0x24')]=_0x56c5ed[_0x000e('0x24')];this[_0x000e('0x25')]=_0x56c5ed[_0x000e('0x25')];this[_0x000e('0x26')]=_0x56c5ed[_0x000e('0x26')];this[_0x000e('0x27')]=_0x56c5ed['temp'];this['outboundAnswerAgiCallsDay']=_0x56c5ed['outboundAnswerAgiCallsDay'];this[_0x000e('0x6')]=_0x56c5ed[_0x000e('0x6')];this[_0x000e('0x7')]=_0x56c5ed[_0x000e('0x7')];this[_0x000e('0x8')]=_0x56c5ed['outboundBusyCallsDay'];this[_0x000e('0x9')]=_0x56c5ed[_0x000e('0x9')];this[_0x000e('0x28')]=_0x56c5ed[_0x000e('0x28')];this[_0x000e('0x29')]=_0x56c5ed[_0x000e('0x29')];this[_0x000e('0x2a')]=_0x56c5ed[_0x000e('0x2a')];this['outboundNoAnswerCallsDay']=_0x56c5ed['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x56c5ed['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x56c5ed[_0x000e('0x2b')];this['outboundReCallsDay']=_0x56c5ed[_0x000e('0x2c')];this[_0x000e('0xb')]=_0x56c5ed['outboundRejectCallsDay'];this[_0x000e('0xc')]=_0x56c5ed[_0x000e('0xc')];this[_0x000e('0x2d')]=_0x56c5ed['predictiveIntervalAnsweredCalls'];this[_0x000e('0x2e')]=_0x56c5ed[_0x000e('0x2e')];this['predictiveIntervalAvgTalktime']=_0x56c5ed['predictiveIntervalAvgTalktime'];this['predictiveIntervalDroppedCallsCallersExit']=_0x56c5ed[_0x000e('0x2f')];this[_0x000e('0x30')]=_0x56c5ed['predictiveIntervalDroppedCallsTimeout'];this[_0x000e('0x31')]=_0x56c5ed[_0x000e('0x31')];this[_0x000e('0x32')]=_0x56c5ed[_0x000e('0x32')];this[_0x000e('0x33')]=_0x56c5ed['predictiveIntervalHitRate'];this[_0x000e('0x34')]=_0x56c5ed[_0x000e('0x34')];this['predictiveIntervalPauses']=_0x56c5ed[_0x000e('0x35')];this[_0x000e('0x36')]=_0x56c5ed[_0x000e('0x36')];this[_0x000e('0x37')]=_0x56c5ed[_0x000e('0x37')];this[_0x000e('0x5')]=_0x56c5ed[_0x000e('0x5')];this['erlangCalls']=_0x56c5ed[_0x000e('0x38')];this[_0x000e('0x39')]=_0x56c5ed[_0x000e('0x39')];this[_0x000e('0x3a')]=_0x56c5ed[_0x000e('0x3a')];this[_0x000e('0x3b')]=_0x56c5ed['erlangBusyFactor'];this[_0x000e('0x3c')]=_0x56c5ed[_0x000e('0x3c')];this[_0x000e('0x3d')]=_0x56c5ed[_0x000e('0x3d')];this[_0x000e('0x3e')]=_0x56c5ed['message'];this[_0x000e('0x3f')]=_0x56c5ed['statusMessage'];}if(_0x56c5ed[_0x000e('0x40')]){this[_0x000e('0x40')]={'id':_0x56c5ed[_0x000e('0x40')]['id'],'name':_0x56c5ed[_0x000e('0x40')][_0x000e('0x41')],'active':_0x56c5ed['Trunk'][_0x000e('0x42')],'callerid':_0x56c5ed[_0x000e('0x40')][_0x000e('0x43')]};}}VoiceQueueSummary[_0x000e('0x44')][_0x000e('0x45')]=function(_0x375012,_0x4deddb,_0x4f2105,_0x5ed5ee){this[_0x000e('0x2')]=0x0;this[_0x000e('0xf')]=0x0;this[_0x000e('0xd')]=0x0;this[_0x000e('0x1e')]=0x0;this[_0x000e('0x19')]=0x0;this[_0x000e('0x16')]=0x0;this[_0x000e('0x15')]=0x0;this[_0x000e('0x17')]=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0x000e('0x1a')]=0x0;this[_0x000e('0x18')]=0x0;if(_0x4f2105){if(_0x4f2105['available']){this[_0x000e('0x0')]=Number(_0x4f2105['available']);}if(_0x4f2105[_0x000e('0x46')]){this[_0x000e('0x1')]=Number(_0x4f2105['loggedin']);}if(_0x4f2105[_0x000e('0x47')]){this[_0x000e('0x4')]=Number(_0x4f2105['callers']);}}for(var _0x15c14b=0x0;_0x15c14b<_0x375012[_0x000e('0x48')];_0x15c14b++){var _0x1f36fb=_0x4deddb[_0x000e('0x49')+_0x375012[_0x15c14b][_0x000e('0x41')]];if(_0x1f36fb&&_0x1f36fb[_0x000e('0x4a')]){this['loggedInDb']+=0x1;}if(_0x375012[_0x15c14b]['incall']==='1'){this[_0x000e('0xf')]+=0x1;}if(_0x375012[_0x15c14b][_0x000e('0xd')]==='1'&&!['2','7','8']['includes'](_0x375012[_0x15c14b]['status'])){this[_0x000e('0xd')]+=0x1;}switch(_0x375012[_0x15c14b][_0x000e('0x4b')]){case'0':this[_0x000e('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x000e('0x16')]+=0x1;break;case'3':this[_0x000e('0x15')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x000e('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x000e('0x22')]===_0x000e('0x4c')){var _0x553eb5=Object[_0x000e('0x4d')](_0x5ed5ee);for(var _0x1134b7=0x0;_0x1134b7<_0x553eb5[_0x000e('0x48')];_0x1134b7++){var _0x3de1f0=_0x553eb5[_0x1134b7];var _0x56613c=_0x5ed5ee[_0x3de1f0];if(_0x56613c['queue']===this[_0x000e('0x41')]&&_0x56613c[_0x000e('0x1d')]===_0x000e('0x4e')&&_0x56613c[_0x000e('0x4f')]===_0x000e('0x50')){this[_0x000e('0xf')]+=0x1;}}if(this[_0x000e('0xf')]>this[_0x000e('0x16')]){this[_0x000e('0xf')]=this[_0x000e('0x16')];}this[_0x000e('0xe')]=0x0;}return this;};VoiceQueueSummary[_0x000e('0x44')][_0x000e('0x51')]=function(_0x384dc1){var _0xa6eb83=![];if(_0x384dc1){_0xa6eb83=INBOUND_COUNTERS[_0x000e('0x52')](function(_0x25716b){return this[_0x25716b]!==_0x384dc1[_0x25716b];},this);}return _0xa6eb83;};VoiceQueueSummary[_0x000e('0x44')]['compareToOutboundQueue']=function(_0x2faaf2){var _0x5de988=![];var _0x3023ba=![];var _0x1fb3e7=![];if(_0x2faaf2){_0x5de988=this[_0x000e('0x22')]!==_0x2faaf2[_0x000e('0x22')]||this['dialActive']!==_0x2faaf2[_0x000e('0x21')]||this[_0x000e('0x3e')]!==_0x2faaf2[_0x000e('0x3e')]||this[_0x000e('0x3f')]!==_0x2faaf2[_0x000e('0x3f')];_0x3023ba=OUTBOUND_COUNTERS[_0x000e('0x52')](function(_0x4b26cf){return this[_0x4b26cf]!==_0x2faaf2[_0x4b26cf];},this);if(this[_0x000e('0x40')]&&_0x2faaf2[_0x000e('0x40')]){_0x1fb3e7=this['Trunk'][_0x000e('0x41')]!==_0x2faaf2['Trunk'][_0x000e('0x41')]||this[_0x000e('0x40')][_0x000e('0x42')]!==_0x2faaf2[_0x000e('0x40')]['active'];}}return _0x5de988||_0x3023ba||_0x1fb3e7;};VoiceQueueSummary['prototype'][_0x000e('0x53')]=function(_0x47a873){this[_0x000e('0x14')]=_0x47a873[_0x000e('0x14')];this['message']=_0x47a873[_0x000e('0x3e')];this[_0x000e('0x3f')]=_0x47a873[_0x000e('0x3f')];this[_0x000e('0x5')]=_0x47a873['originated'];this[_0x000e('0x54')]=_0x47a873[_0x000e('0x54')];this['outboundAnswerCallsDay']=_0x47a873[_0x000e('0x6')];this[_0x000e('0x7')]=_0x47a873[_0x000e('0x7')];this[_0x000e('0x8')]=_0x47a873['outboundBusyCallsDay'];this[_0x000e('0x9')]=_0x47a873[_0x000e('0x9')];this[_0x000e('0x55')]=_0x47a873[_0x000e('0x55')];this[_0x000e('0xa')]=_0x47a873['outboundNoSuchCallsDay'];this[_0x000e('0x2c')]=_0x47a873[_0x000e('0x2c')];this[_0x000e('0xb')]=_0x47a873[_0x000e('0xb')];this['outboundUnknownCallsDay']=_0x47a873[_0x000e('0xc')];this['sumBillable']=_0x47a873[_0x000e('0x10')];this[_0x000e('0x11')]=_0x47a873[_0x000e('0x11')];this[_0x000e('0x1c')]=_0x47a873[_0x000e('0x1c')];if(this[_0x000e('0x22')]===_0x000e('0x56')){this[_0x000e('0xe')]=_0x47a873['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x8c79=['available','ringing','waiting','inUse','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','loggedIn','loggedInDb','onHold','notInUse','paused','ringInUse','sumHoldTime','talking','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','statusMessage','Trunk','active','callerid','loggedin','callers','online','incall','includes','status','keys','length','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','prototype','message','updateReportFromOutboundQueue','exports'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x8c79,0xa8));var _0x98c7=function(_0x3be379,_0x3b33cf){_0x3be379=_0x3be379-0x0;var _0xf389d=_0x8c79[_0x3be379];return _0xf389d;};'use strict';var INBOUND_COUNTERS=[_0x98c7('0x0'),'loggedIn','loggedInDb','paused',_0x98c7('0x1'),'talking',_0x98c7('0x2')];var OUTBOUND_COUNTERS=[_0x98c7('0x0'),'answered',_0x98c7('0x3'),'loggedIn','loggedInDb','originated',_0x98c7('0x4'),'outboundAnswerCallsDay',_0x98c7('0x5'),_0x98c7('0x6'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay',_0x98c7('0x7'),_0x98c7('0x8'),_0x98c7('0x9'),'paused',_0x98c7('0xa'),'talking',_0x98c7('0xb'),_0x98c7('0xc'),_0x98c7('0xd'),_0x98c7('0x2')];function VoiceQueueSummary(_0x1bc5e3){this['id']=_0x1bc5e3['id'];this[_0x98c7('0xe')]=_0x1bc5e3[_0x98c7('0xe')];this[_0x98c7('0xf')]=_0x1bc5e3[_0x98c7('0xf')];this[_0x98c7('0x10')]=_0x1bc5e3[_0x98c7('0x10')]||0x0;this[_0x98c7('0x11')]=_0x1bc5e3[_0x98c7('0x11')]||0x0;this[_0x98c7('0x0')]=_0x1bc5e3[_0x98c7('0x0')]||0x0;this[_0x98c7('0x12')]=_0x1bc5e3['busy']||0x0;this['inUse']=_0x1bc5e3[_0x98c7('0x3')]||0x0;this[_0x98c7('0x13')]=_0x1bc5e3[_0x98c7('0x13')]||0x0;this[_0x98c7('0x14')]=_0x1bc5e3['loggedIn']||0x0;this['loggedInDb']=_0x1bc5e3[_0x98c7('0x15')]||0x0;this['onHold']=_0x1bc5e3[_0x98c7('0x16')]||0x0;this[_0x98c7('0x17')]=_0x1bc5e3[_0x98c7('0x17')]||0x0;this[_0x98c7('0x18')]=_0x1bc5e3['paused']||0x0;this[_0x98c7('0x1')]=_0x1bc5e3[_0x98c7('0x1')]||0x0;this[_0x98c7('0x19')]=_0x1bc5e3[_0x98c7('0x19')];this[_0x98c7('0xb')]=_0x1bc5e3[_0x98c7('0xb')];this[_0x98c7('0xc')]=_0x1bc5e3['sumDuration'];this[_0x98c7('0x1a')]=_0x1bc5e3[_0x98c7('0x1a')]||0x0;this['talking']=_0x1bc5e3[_0x98c7('0x1b')]||0x0;this[_0x98c7('0xd')]=_0x1bc5e3[_0x98c7('0xd')]||0x0;this[_0x98c7('0x1c')]=_0x1bc5e3[_0x98c7('0x1c')];this[_0x98c7('0x1d')]=_0x1bc5e3[_0x98c7('0x1d')]||0x0;this[_0x98c7('0x1e')]=_0x1bc5e3[_0x98c7('0x1e')]||0x0;this[_0x98c7('0x1f')]=_0x1bc5e3[_0x98c7('0x1f')]||0x0;this[_0x98c7('0x2')]=_0x1bc5e3['waiting']||0x0;if(_0x1bc5e3[_0x98c7('0x1c')]===_0x98c7('0x20')){this[_0x98c7('0xa')]=_0x1bc5e3[_0x98c7('0xa')]||0x0;this[_0x98c7('0x21')]=_0x1bc5e3[_0x98c7('0x21')];this['dialMethod']=_0x1bc5e3[_0x98c7('0x22')];this[_0x98c7('0x23')]=_0x1bc5e3[_0x98c7('0x23')];this[_0x98c7('0x24')]=_0x1bc5e3[_0x98c7('0x24')];this[_0x98c7('0x25')]=_0x1bc5e3[_0x98c7('0x25')];this[_0x98c7('0x26')]=_0x1bc5e3[_0x98c7('0x26')];this[_0x98c7('0x27')]=_0x1bc5e3[_0x98c7('0x27')];this[_0x98c7('0x28')]=_0x1bc5e3[_0x98c7('0x28')];this[_0x98c7('0x29')]=_0x1bc5e3[_0x98c7('0x29')];this[_0x98c7('0x5')]=_0x1bc5e3[_0x98c7('0x5')];this[_0x98c7('0x6')]=_0x1bc5e3['outboundBusyCallsDay'];this[_0x98c7('0x2a')]=_0x1bc5e3[_0x98c7('0x2a')];this[_0x98c7('0x2b')]=_0x1bc5e3['outboundDropCallsDayACS'];this[_0x98c7('0x2c')]=_0x1bc5e3[_0x98c7('0x2c')];this['outboundDropCallsDayTimeout']=_0x1bc5e3[_0x98c7('0x2d')];this[_0x98c7('0x2e')]=_0x1bc5e3['outboundNoAnswerCallsDay'];this[_0x98c7('0x2f')]=_0x1bc5e3[_0x98c7('0x2f')];this[_0x98c7('0x30')]=_0x1bc5e3[_0x98c7('0x30')];this['outboundReCallsDay']=_0x1bc5e3['outboundReCallsDay'];this[_0x98c7('0x8')]=_0x1bc5e3[_0x98c7('0x8')];this[_0x98c7('0x9')]=_0x1bc5e3['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x1bc5e3['predictiveIntervalAnsweredCalls'];this[_0x98c7('0x31')]=_0x1bc5e3['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x1bc5e3[_0x98c7('0x32')];this['predictiveIntervalDroppedCallsCallersExit']=_0x1bc5e3['predictiveIntervalDroppedCallsCallersExit'];this[_0x98c7('0x33')]=_0x1bc5e3['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x1bc5e3['predictiveIntervalErlangCalls'];this[_0x98c7('0x34')]=_0x1bc5e3[_0x98c7('0x34')];this[_0x98c7('0x35')]=_0x1bc5e3['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x1bc5e3[_0x98c7('0x36')];this['predictiveIntervalPauses']=_0x1bc5e3['predictiveIntervalPauses'];this[_0x98c7('0x37')]=_0x1bc5e3['predictiveIntervalAvailable'];this[_0x98c7('0x38')]=_0x1bc5e3[_0x98c7('0x38')];this['originated']=_0x1bc5e3[_0x98c7('0x39')];this[_0x98c7('0x3a')]=_0x1bc5e3['erlangCalls'];this[_0x98c7('0x3b')]=_0x1bc5e3['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x1bc5e3['erlangAbandonmentRate'];this['erlangBusyFactor']=_0x1bc5e3['erlangBusyFactor'];this[_0x98c7('0x3c')]=_0x1bc5e3[_0x98c7('0x3c')];this[_0x98c7('0x3d')]=_0x1bc5e3[_0x98c7('0x3d')];this['message']=_0x1bc5e3['message'];this[_0x98c7('0x3e')]=_0x1bc5e3['statusMessage'];}if(_0x1bc5e3['Trunk']){this[_0x98c7('0x3f')]={'id':_0x1bc5e3[_0x98c7('0x3f')]['id'],'name':_0x1bc5e3[_0x98c7('0x3f')][_0x98c7('0xe')],'active':_0x1bc5e3['Trunk'][_0x98c7('0x40')],'callerid':_0x1bc5e3[_0x98c7('0x3f')][_0x98c7('0x41')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x32df26,_0x3388d8,_0x25108b,_0x67932f){this['loggedInDb']=0x0;this['talking']=0x0;this[_0x98c7('0x18')]=0x0;this[_0x98c7('0x1e')]=0x0;this['notInUse']=0x0;this[_0x98c7('0x3')]=0x0;this[_0x98c7('0x12')]=0x0;this['invalid']=0x0;this[_0x98c7('0x1d')]=0x0;this[_0x98c7('0x1')]=0x0;this['ringInUse']=0x0;this[_0x98c7('0x16')]=0x0;if(_0x25108b){if(_0x25108b[_0x98c7('0x0')]){this[_0x98c7('0x0')]=Number(_0x25108b['available']);}if(_0x25108b[_0x98c7('0x42')]){this[_0x98c7('0x14')]=Number(_0x25108b[_0x98c7('0x42')]);}if(_0x25108b[_0x98c7('0x43')]){this['waiting']=Number(_0x25108b['callers']);}}for(var _0x3f8c89=0x0;_0x3f8c89<_0x32df26['length'];_0x3f8c89++){var _0x3b0dd7=_0x3388d8['SIP/'+_0x32df26[_0x3f8c89][_0x98c7('0xe')]];if(_0x3b0dd7&&_0x3b0dd7[_0x98c7('0x44')]){this[_0x98c7('0x15')]+=0x1;}if(_0x32df26[_0x3f8c89][_0x98c7('0x45')]==='1'){this['talking']+=0x1;}if(_0x32df26[_0x3f8c89]['paused']==='1'&&!['2','7','8'][_0x98c7('0x46')](_0x32df26[_0x3f8c89]['status'])){this[_0x98c7('0x18')]+=0x1;}switch(_0x32df26[_0x3f8c89][_0x98c7('0x47')]){case'0':this[_0x98c7('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x98c7('0x3')]+=0x1;break;case'3':this[_0x98c7('0x12')]+=0x1;break;case'4':this[_0x98c7('0x13')]+=0x1;break;case'5':this[_0x98c7('0x1d')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x98c7('0x16')]+=0x1;break;}}if(this[_0x98c7('0x22')]==='booked'){var _0x569beb=Object[_0x98c7('0x48')](_0x67932f);for(var _0x281a5f=0x0;_0x281a5f<_0x569beb[_0x98c7('0x49')];_0x281a5f++){var _0x2e483f=_0x569beb[_0x281a5f];var _0x1dd4bf=_0x67932f[_0x2e483f];if(_0x1dd4bf[_0x98c7('0x4a')]===this[_0x98c7('0xe')]&&_0x1dd4bf[_0x98c7('0x1c')]===_0x98c7('0x4b')&&_0x1dd4bf[_0x98c7('0x4c')]===_0x98c7('0x4d')){this['talking']+=0x1;}}if(this[_0x98c7('0x1b')]>this[_0x98c7('0x3')]){this[_0x98c7('0x1b')]=this['inUse'];}this[_0x98c7('0xa')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0x98c7('0x4e')]=function(_0x51e591){var _0x3bee5b=![];if(_0x51e591){_0x3bee5b=INBOUND_COUNTERS[_0x98c7('0x4f')](function(_0x439260){return this[_0x439260]!==_0x51e591[_0x439260];},this);}return _0x3bee5b;};VoiceQueueSummary[_0x98c7('0x50')]['compareToOutboundQueue']=function(_0x1c9dcf){var _0x5a2627=![];var _0x336c37=![];var _0x1927b1=![];if(_0x1c9dcf){_0x5a2627=this[_0x98c7('0x22')]!==_0x1c9dcf[_0x98c7('0x22')]||this[_0x98c7('0x21')]!==_0x1c9dcf[_0x98c7('0x21')]||this['message']!==_0x1c9dcf[_0x98c7('0x51')]||this[_0x98c7('0x3e')]!==_0x1c9dcf['statusMessage'];_0x336c37=OUTBOUND_COUNTERS[_0x98c7('0x4f')](function(_0x258cb6){return this[_0x258cb6]!==_0x1c9dcf[_0x258cb6];},this);if(this[_0x98c7('0x3f')]&&_0x1c9dcf[_0x98c7('0x3f')]){_0x1927b1=this[_0x98c7('0x3f')]['name']!==_0x1c9dcf['Trunk'][_0x98c7('0xe')]||this[_0x98c7('0x3f')]['active']!==_0x1c9dcf[_0x98c7('0x3f')][_0x98c7('0x40')];}}return _0x5a2627||_0x336c37||_0x1927b1;};VoiceQueueSummary[_0x98c7('0x50')][_0x98c7('0x52')]=function(_0x2699fb){this[_0x98c7('0x11')]=_0x2699fb[_0x98c7('0x11')];this[_0x98c7('0x51')]=_0x2699fb[_0x98c7('0x51')];this[_0x98c7('0x3e')]=_0x2699fb[_0x98c7('0x3e')];this['originated']=_0x2699fb[_0x98c7('0x39')];this['outboundAbandonedCallsDay']=_0x2699fb['outboundAbandonedCallsDay'];this['outboundAnswerCallsDay']=_0x2699fb[_0x98c7('0x29')];this['outboundBlacklistCallsDay']=_0x2699fb[_0x98c7('0x5')];this[_0x98c7('0x6')]=_0x2699fb['outboundBusyCallsDay'];this[_0x98c7('0x2a')]=_0x2699fb[_0x98c7('0x2a')];this[_0x98c7('0x2e')]=_0x2699fb['outboundNoAnswerCallsDay'];this[_0x98c7('0x2f')]=_0x2699fb['outboundNoSuchCallsDay'];this[_0x98c7('0x7')]=_0x2699fb['outboundReCallsDay'];this[_0x98c7('0x8')]=_0x2699fb['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x2699fb[_0x98c7('0x9')];this['sumBillable']=_0x2699fb[_0x98c7('0xb')];this[_0x98c7('0xc')]=_0x2699fb[_0x98c7('0xc')];this[_0x98c7('0xd')]=_0x2699fb[_0x98c7('0xd')];if(this['dialMethod']==='preview'){this[_0x98c7('0xa')]=_0x2699fb[_0x98c7('0xa')];}};module[_0x98c7('0x53')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 73d2088..3040d50 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 _0x6e86=['remoteUri','Configurations','exports','name','username','accessKey'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x6e86,0x153));var _0x66e8=function(_0xf67a90,_0x2eb2f3){_0xf67a90=_0xf67a90-0x0;var _0x648b2=_0x6e86[_0xf67a90];return _0x648b2;};'use strict';function VtigerAccount(_0x409336){this['id']=_0x409336['id']||0x0;this[_0x66e8('0x0')]=_0x409336[_0x66e8('0x0')]||'';this[_0x66e8('0x1')]=_0x409336['username']||'';this['accessKey']=_0x409336[_0x66e8('0x2')]||'';this[_0x66e8('0x3')]=_0x409336[_0x66e8('0x3')]||'';this['serverUrl']=_0x409336['serverUrl']||'';this[_0x66e8('0x4')]=_0x409336[_0x66e8('0x4')]||{};}module[_0x66e8('0x5')]=VtigerAccount; \ No newline at end of file +var _0x5b16=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5b16,0x6a));var _0x65b1=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x5b16[_0x49d41c];return _0xb64c5f;};'use strict';function VtigerAccount(_0xc2bd4d){this['id']=_0xc2bd4d['id']||0x0;this[_0x65b1('0x0')]=_0xc2bd4d['name']||'';this[_0x65b1('0x1')]=_0xc2bd4d[_0x65b1('0x1')]||'';this['accessKey']=_0xc2bd4d[_0x65b1('0x2')]||'';this[_0x65b1('0x3')]=_0xc2bd4d[_0x65b1('0x3')]||'';this[_0x65b1('0x4')]=_0xc2bd4d[_0x65b1('0x4')]||'';this['Configurations']=_0xc2bd4d[_0x65b1('0x5')]||{};}module[_0x65b1('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 9d9417e..eb4d296 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 _0x8fb1=['username','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x93f8f8,_0x44fb1b){var _0xee28f5=function(_0x502552){while(--_0x502552){_0x93f8f8['push'](_0x93f8f8['shift']());}};_0xee28f5(++_0x44fb1b);}(_0x8fb1,0x153));var _0x18fb=function(_0x4d6720,_0x5d5655){_0x4d6720=_0x4d6720-0x0;var _0x870c1b=_0x8fb1[_0x4d6720];return _0x870c1b;};'use strict';function ZendeskAccount(_0x3160bf){this['id']=_0x3160bf['id']||0x0;this[_0x18fb('0x0')]=_0x3160bf[_0x18fb('0x0')]||'';this['username']=_0x3160bf[_0x18fb('0x1')]||'';this['password']=_0x3160bf['password']||'';this[_0x18fb('0x2')]=_0x3160bf[_0x18fb('0x2')]||'';this[_0x18fb('0x3')]=_0x3160bf[_0x18fb('0x3')]||'';this[_0x18fb('0x4')]=_0x3160bf[_0x18fb('0x4')]||'';this['type']=_0x3160bf[_0x18fb('0x5')]||_0x18fb('0x6');this[_0x18fb('0x7')]=_0x3160bf[_0x18fb('0x7')]||'';this[_0x18fb('0x8')]=_0x3160bf[_0x18fb('0x8')]||{};}module[_0x18fb('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x894a=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','username','password','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x894a,0x1e7));var _0xa894=function(_0xa2e1a,_0x2ada87){_0xa2e1a=_0xa2e1a-0x0;var _0x3db23f=_0x894a[_0xa2e1a];return _0x3db23f;};'use strict';function ZendeskAccount(_0x58b8e7){this['id']=_0x58b8e7['id']||0x0;this['name']=_0x58b8e7['name']||'';this['username']=_0x58b8e7[_0xa894('0x0')]||'';this[_0xa894('0x1')]=_0x58b8e7['password']||'';this[_0xa894('0x2')]=_0x58b8e7['token']||'';this[_0xa894('0x3')]=_0x58b8e7[_0xa894('0x3')]||'';this[_0xa894('0x4')]=_0x58b8e7[_0xa894('0x4')]||'';this[_0xa894('0x5')]=_0x58b8e7['type']||_0xa894('0x6');this[_0xa894('0x7')]=_0x58b8e7[_0xa894('0x7')]||'';this[_0xa894('0x8')]=_0x58b8e7[_0xa894('0x8')]||{};}module[_0xa894('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index ba8f93c..8a283f9 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 _0xd6a9=['serverUrl','code','refreshToken','Configurations','name','description','zone','clientId','clientSecret'];(function(_0x307777,_0x131c2e){var _0x3c13c6=function(_0x17bdfb){while(--_0x17bdfb){_0x307777['push'](_0x307777['shift']());}};_0x3c13c6(++_0x131c2e);}(_0xd6a9,0x94));var _0x9d6a=function(_0x3f3125,_0x3f49d2){_0x3f3125=_0x3f3125-0x0;var _0x28bf12=_0xd6a9[_0x3f3125];return _0x28bf12;};'use strict';function ZohoAccount(_0x2a8cee){this['id']=_0x2a8cee['id']||0x0;this[_0x9d6a('0x0')]=_0x2a8cee[_0x9d6a('0x0')]||'';this['description']=_0x2a8cee[_0x9d6a('0x1')]||'';this['host']=_0x2a8cee['host']||'';this[_0x9d6a('0x2')]=_0x2a8cee['zone']||'';this[_0x9d6a('0x3')]=_0x2a8cee[_0x9d6a('0x3')]||'';this[_0x9d6a('0x4')]=_0x2a8cee[_0x9d6a('0x4')]||'';this[_0x9d6a('0x5')]=_0x2a8cee[_0x9d6a('0x5')]||'';this[_0x9d6a('0x6')]=_0x2a8cee[_0x9d6a('0x6')]||'';this['refreshToken']=_0x2a8cee[_0x9d6a('0x7')]||'';this[_0x9d6a('0x8')]=_0x2a8cee[_0x9d6a('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xeb99=['description','host','zone','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x4d5dd5,_0x1ce093){var _0x3cf809=function(_0x3d709f){while(--_0x3d709f){_0x4d5dd5['push'](_0x4d5dd5['shift']());}};_0x3cf809(++_0x1ce093);}(_0xeb99,0x77));var _0x9eb9=function(_0x5b8df6,_0x3afca6){_0x5b8df6=_0x5b8df6-0x0;var _0x234e78=_0xeb99[_0x5b8df6];return _0x234e78;};'use strict';function ZohoAccount(_0x358734){this['id']=_0x358734['id']||0x0;this[_0x9eb9('0x0')]=_0x358734[_0x9eb9('0x0')]||'';this[_0x9eb9('0x1')]=_0x358734[_0x9eb9('0x1')]||'';this[_0x9eb9('0x2')]=_0x358734['host']||'';this[_0x9eb9('0x3')]=_0x358734['zone']||'';this['clientId']=_0x358734['clientId']||'';this['clientSecret']=_0x358734[_0x9eb9('0x4')]||'';this['serverUrl']=_0x358734[_0x9eb9('0x5')]||'';this['code']=_0x358734[_0x9eb9('0x6')]||'';this[_0x9eb9('0x7')]=_0x358734[_0x9eb9('0x7')]||'';this['Configurations']=_0x358734[_0x9eb9('0x8')]||{};}module[_0x9eb9('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 51efef6..231401f 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 _0x1893=['type','queue','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','idContact','name'];(function(_0x1c2b01,_0x52ab77){var _0x336f64=function(_0x4100d9){while(--_0x4100d9){_0x1c2b01['push'](_0x1c2b01['shift']());}};_0x336f64(++_0x52ab77);}(_0x1893,0xa2));var _0x3189=function(_0x594e9d,_0x883433){_0x594e9d=_0x594e9d-0x0;var _0x2f4839=_0x1893[_0x594e9d];return _0x2f4839;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3189('0x0'));function checkNameSurname(_0x3aec2b,_0x1b12ad,_0x106df4){var _0x10c189='';if(!_[_0x3189('0x1')](_0x1b12ad)&&_0x3189('0x2')===typeof _0x1b12ad){_0x10c189+=_0x1b12ad;}if(!_['isNil'](_0x106df4)&&_0x3189('0x2')===typeof _0x106df4){_0x10c189+='\x20'+_0x106df4;}if(_0x10c189!==''){return _0x10c189;}return _0x3aec2b;}function Action(_0x4faebf,_0x2333e6,_0x4080a9,_0x77c566,_0x118970){this[_0x3189('0x3')]=_0x4080a9||undefined;this[_0x3189('0x4')]=_0x4faebf['id'];this['queue']=_0x2333e6[_0x3189('0x5')];this['type']=_0x2333e6[_0x3189('0x6')];this['campaigntype']=_0x3189('0x7');this[_0x3189('0x8')]=![];this[_0x3189('0x9')]=_[_0x3189('0x1')](_0x4faebf['Agent'])?undefined:_0x4faebf[_0x3189('0xa')][_0x3189('0x5')];this[_0x3189('0xb')]=this[_0x3189('0x9')]?util[_0x3189('0xc')]('SIP/%s',this[_0x3189('0x9')]):_0x77c566||undefined;this[_0x3189('0xd')]=checkNameSurname(_0x4faebf[_0x3189('0xe')][_0x3189('0xf')],_0x4faebf[_0x3189('0xe')][_0x3189('0x10')],_0x4faebf[_0x3189('0xe')][_0x3189('0x11')]);this['active']=_0x4faebf[_0x3189('0x12')]||![];this[_0x3189('0x13')]=_0x4faebf[_0x3189('0xf')];this[_0x3189('0x14')]=_0x4faebf['scheduledat'];this[_0x3189('0x15')]=_0x4faebf['countbusyretry']||0x0;this['countcongestionretry']=_0x4faebf[_0x3189('0x16')]||0x0;this['countnoanswerretry']=_0x4faebf[_0x3189('0x17')]||0x0;this[_0x3189('0x18')]=(_0x4faebf[_0x3189('0x15')]||0x0)+(_0x4faebf[_0x3189('0x16')]||0x0)+(_0x4faebf['countnoanswerretry']||0x0)+(_0x4faebf[_0x3189('0x19')]||0x0)+(_0x4faebf[_0x3189('0x1a')]||0x0)+(_0x4faebf[_0x3189('0x1b')]||0x0)+(_0x4faebf['countmachineretry']||0x0)+(_0x4faebf[_0x3189('0x1c')]||0x0);this[_0x3189('0x19')]=_0x4faebf[_0x3189('0x19')]||0x0;this[_0x3189('0x1a')]=_0x4faebf[_0x3189('0x1a')]||0x0;this['countabandonedretry']=_0x4faebf[_0x3189('0x1b')]||0x0;this[_0x3189('0x1d')]=_0x4faebf[_0x3189('0x1d')]||0x0;this['countagentrejectretry']=_0x4faebf[_0x3189('0x1c')]||0x0;this['callback']=_0x4faebf[_0x3189('0x1e')];this[_0x3189('0x1f')]=_0x4faebf[_0x3189('0x1f')];this[_0x3189('0x20')]=_0x4faebf[_0x3189('0x20')];this[_0x3189('0x21')]=_0x4faebf['recallme'];this['ContactId']=_0x4faebf[_0x3189('0x22')];this[_0x3189('0x23')]=_0x4faebf[_0x3189('0x23')];this[_0x3189('0x24')]=_[_0x3189('0x1')](_0x4faebf[_0x3189('0xa')])?_0x4faebf[_0x3189('0x24')]:_0x4faebf[_0x3189('0xa')]['id'];this[_0x3189('0x25')]=_0x4faebf[_0x3189('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0x3189('0x26')]=function(){return util[_0x3189('0xc')](_0x3189('0x27'),this[_0x3189('0xd')],this[_0x3189('0x28')]);};module[_0x3189('0x29')]=Action; \ No newline at end of file +var _0xe511=['name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','number','util','lodash','string','isNil','idContact','queue','type','campaigntype','dialAnswer','membername','Agent'];(function(_0x5d4281,_0x44a37d){var _0x256a0a=function(_0x2c3b2c){while(--_0x2c3b2c){_0x5d4281['push'](_0x5d4281['shift']());}};_0x256a0a(++_0x44a37d);}(_0xe511,0x16f));var _0x1e51=function(_0x3ba527,_0x446a5e){_0x3ba527=_0x3ba527-0x0;var _0x5ee6ad=_0xe511[_0x3ba527];return _0x5ee6ad;};'use strict';var util=require(_0x1e51('0x0'));var _=require(_0x1e51('0x1'));var moment=require('moment');function checkNameSurname(_0x2a5905,_0x5b9e45,_0x253e96){var _0xb75a96='';if(!_['isNil'](_0x5b9e45)&&_0x1e51('0x2')===typeof _0x5b9e45){_0xb75a96+=_0x5b9e45;}if(!_[_0x1e51('0x3')](_0x253e96)&&_0x1e51('0x2')===typeof _0x253e96){_0xb75a96+='\x20'+_0x253e96;}if(_0xb75a96!==''){return _0xb75a96;}return _0x2a5905;}function Action(_0x16ec99,_0x480cca,_0x26b22c,_0x21ed6b,_0x5c4590){this['uniqueid']=_0x26b22c||undefined;this[_0x1e51('0x4')]=_0x16ec99['id'];this[_0x1e51('0x5')]=_0x480cca['name'];this['type']=_0x480cca[_0x1e51('0x6')];this[_0x1e51('0x7')]=_0x1e51('0x5');this[_0x1e51('0x8')]=![];this[_0x1e51('0x9')]=_[_0x1e51('0x3')](_0x16ec99['Agent'])?undefined:_0x16ec99[_0x1e51('0xa')][_0x1e51('0xb')];this[_0x1e51('0xc')]=this[_0x1e51('0x9')]?util[_0x1e51('0xd')](_0x1e51('0xe'),this['membername']):_0x21ed6b||undefined;this[_0x1e51('0xf')]=checkNameSurname(_0x16ec99[_0x1e51('0x10')][_0x1e51('0x11')],_0x16ec99[_0x1e51('0x10')][_0x1e51('0x12')],_0x16ec99[_0x1e51('0x10')][_0x1e51('0x13')]);this[_0x1e51('0x14')]=_0x16ec99[_0x1e51('0x14')]||![];this[_0x1e51('0x15')]=_0x16ec99['phone'];this[_0x1e51('0x16')]=_0x16ec99[_0x1e51('0x16')];this[_0x1e51('0x17')]=_0x16ec99['countbusyretry']||0x0;this[_0x1e51('0x18')]=_0x16ec99['countcongestionretry']||0x0;this['countnoanswerretry']=_0x16ec99[_0x1e51('0x19')]||0x0;this[_0x1e51('0x1a')]=(_0x16ec99[_0x1e51('0x17')]||0x0)+(_0x16ec99[_0x1e51('0x18')]||0x0)+(_0x16ec99[_0x1e51('0x19')]||0x0)+(_0x16ec99[_0x1e51('0x1b')]||0x0)+(_0x16ec99['countdropretry']||0x0)+(_0x16ec99[_0x1e51('0x1c')]||0x0)+(_0x16ec99['countmachineretry']||0x0)+(_0x16ec99[_0x1e51('0x1d')]||0x0);this[_0x1e51('0x1b')]=_0x16ec99[_0x1e51('0x1b')]||0x0;this[_0x1e51('0x1e')]=_0x16ec99['countdropretry']||0x0;this['countabandonedretry']=_0x16ec99['countabandonedretry']||0x0;this['countmachineretry']=_0x16ec99[_0x1e51('0x1f')]||0x0;this['countagentrejectretry']=_0x16ec99[_0x1e51('0x1d')]||0x0;this[_0x1e51('0x20')]=_0x16ec99[_0x1e51('0x20')];this[_0x1e51('0x21')]=_0x16ec99[_0x1e51('0x21')];this[_0x1e51('0x22')]=_0x16ec99[_0x1e51('0x22')];this[_0x1e51('0x23')]=_0x16ec99['recallme'];this['ContactId']=_0x16ec99[_0x1e51('0x24')];this[_0x1e51('0x25')]=_0x16ec99[_0x1e51('0x25')];this[_0x1e51('0x26')]=_['isNil'](_0x16ec99['Agent'])?_0x16ec99['UserId']:_0x16ec99[_0x1e51('0xa')]['id'];this[_0x1e51('0x27')]=_0x16ec99[_0x1e51('0x27')];this['originatecalleridnum']='';this[_0x1e51('0x28')]='';}Action['prototype']['getCaller']=function(){return util[_0x1e51('0xd')]('\x22%s\x22\x20<%s>',this[_0x1e51('0xf')],this[_0x1e51('0x29')]);};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 def23e5..48fc91e 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 _0x20ef=['[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','lookAgent','isEmpty','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','disableContact','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Is\x20Valid','Trunk','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','assign','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','syncVarSet','filterKey','keys','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','originated','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','name','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','dialMethod','preview','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','stringify','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','catch','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','hasOwnProperty','getContactRecallMe','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','NO_AGENTS_LOGGED','isActive','isTrunkReachable','TrunkBackup','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','pTalking','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','[callProgressDetectingCustomer][logBusyGlobal]','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated'];(function(_0x440e51,_0x4fc63a){var _0x9be905=function(_0x3e685e){while(--_0x3e685e){_0x440e51['push'](_0x440e51['shift']());}};_0x9be905(++_0x4fc63a);}(_0x20ef,0x189));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf20e('0x0'));var _=require(_0xf20e('0x1'));var uuid=require(_0xf20e('0x2'));var moment=require(_0xf20e('0x3'));var Redis=require('ioredis');var config=require(_0xf20e('0x4'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xf20e('0x5'))(_0xf20e('0x6'));var ami=require('../ami');var rpcDb=require(_0xf20e('0x7'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require('./util/util');var utils=require('../dialer/utils');config['redis']=_[_0xf20e('0x8')](config[_0xf20e('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf20e('0xa'))(new Redis(config[_0xf20e('0x9')]));var Sequence=function(){};Sequence[_0xf20e('0xb')][_0xf20e('0xc')]=function(_0x58be70){this[_0xf20e('0xd')]=this[_0xf20e('0xd')]?this[_0xf20e('0xd')][_0xf20e('0xe')](_0x58be70):_0x58be70();};function Preview(_0x29945d){this[_0xf20e('0xf')]=new Sequence();this[_0xf20e('0x10')]=_0x29945d['voiceQueues'];this[_0xf20e('0x11')]=_0x29945d['trunks'];this[_0xf20e('0x12')]={};this[_0xf20e('0x13')]=_0x29945d['agents'];this[_0xf20e('0x14')]=0x0;ami['on'](_0xf20e('0x15'),this[_0xf20e('0x16')][_0xf20e('0x17')](this));ami['on']('hangup',this['syncHangup'][_0xf20e('0x17')](this));ami['on'](_0xf20e('0x18'),this[_0xf20e('0x19')]['bind'](this));ami['on']('dialend',this[_0xf20e('0x1a')][_0xf20e('0x17')](this));ami['on'](_0xf20e('0x1b'),this[_0xf20e('0x1c')][_0xf20e('0x17')](this));ami['on'](_0xf20e('0x1d'),this['syncVarSet'][_0xf20e('0x17')](this));ami['on'](_0xf20e('0x1e'),this[_0xf20e('0x1f')][_0xf20e('0x17')](this));ami['on'](_0xf20e('0x20'),this[_0xf20e('0x21')][_0xf20e('0x17')](this));this['loopCampaigns'](this[_0xf20e('0x10')]);}function emit(_0x5e2a8e,_0x3867ac,_0x3fd055){io['to'](_0x5e2a8e)[_0xf20e('0x22')](_0x3867ac,_0x3fd055);}function emitVoiceQueueChannelRemove(_0x1e2d04){logger[_0xf20e('0x23')](_0xf20e('0x24'),JSON['stringify'](_0x1e2d04));emit(util['format'](_0xf20e('0x25'),_0x1e2d04['name']),_0xf20e('0x26'),_0x1e2d04);io[_0xf20e('0x22')]('voice_queue_presence:remove',_0x1e2d04);}function notSendMessagesQueue(_0x37b3de){if(_0x37b3de[_0xf20e('0x27')]){if(_0x37b3de[_0xf20e('0x28')]===0x0&&_0x37b3de['pTalking']===0x0){_0x37b3de[_0xf20e('0x27')]=![];_0x37b3de['available']=0x0;_0x37b3de[_0xf20e('0x29')]=0x0;_0x37b3de[_0xf20e('0x2a')]=utils[_0xf20e('0x2b')][_0xf20e('0x2c')];ut[_0xf20e('0x2d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x37b3de[_0xf20e('0x2e')]+'\x20is\x20not\x20active');}else{_0x37b3de[_0xf20e('0x2a')]=utils[_0xf20e('0x2b')][_0xf20e('0x2f')];ut['logger'](_0xf20e('0x30'),_0x37b3de[_0xf20e('0x2e')]+'\x20is\x20deactivated');}}}Preview[_0xf20e('0xb')][_0xf20e('0x31')]=function(){var _0x498978=this;setInterval(function(){_0x498978['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0xf1d140=this[_0xf20e('0x10')];this[_0xf20e('0x14')]+=0x1;for(var _0x207fc4 in _0xf1d140){if(_0xf1d140['hasOwnProperty'](_0x207fc4)&&(_0xf1d140[_0x207fc4][_0xf20e('0x32')]===_0xf20e('0x33')||_0xf1d140[_0x207fc4][_0xf20e('0x32')]==='booked')&&_0xf1d140[_0x207fc4][_0xf20e('0x34')]===_0xf20e('0x35')){if(this['clockClearZombieChannels']>0x7){this[_0xf20e('0x14')]=0x0;this[_0xf20e('0x36')]();}}if(_0xf1d140['hasOwnProperty'](_0x207fc4)&&_0xf1d140[_0x207fc4]['dialMethod']===_0xf20e('0x33')&&_0xf1d140[_0x207fc4][_0xf20e('0x34')]==='outbound'){if(_0xf1d140[_0x207fc4][_0xf20e('0x37')]){this[_0xf20e('0x38')](_0xf1d140[_0x207fc4]);if(_0xf1d140[_0x207fc4][_0xf20e('0x39')])this[_0xf20e('0x3a')](_0xf1d140[_0x207fc4]);}else{notSendMessagesQueue(_0xf1d140[_0x207fc4]);}}}};Preview[_0xf20e('0xb')][_0xf20e('0x3b')]=function(_0x2c064c){var _0x462d4b=this;this['sequence'][_0xf20e('0xc')](function(){if(!_[_0xf20e('0x3c')](_0x462d4b[_0xf20e('0x12')][_0x2c064c])){loggerAction[_0xf20e('0x23')]('[clearZombieChannels][talking]',_0x2c064c,_0xf20e('0x3d'),_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x3e')],_0xf20e('0x3f'),JSON['stringify'](_0x462d4b['campaignsPreview'][_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x3e')]][_0xf20e('0x28')]),_0xf20e('0x40'),JSON['stringify'](_0x462d4b[_0xf20e('0x10')][_0x462d4b['actions'][_0x2c064c]['queue']]['pTalking']),JSON[_0xf20e('0x41')](_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x42')]),JSON[_0xf20e('0x41')](_[_0xf20e('0x43')](_0x462d4b[_0xf20e('0x12')][_0x2c064c],[_0xf20e('0x44'),_0xf20e('0x45'),_0xf20e('0x46'),'ListId'])));return ami[_0xf20e('0x47')]({'action':_0xf20e('0x48'),'channel':_0x462d4b['actions'][_0x2c064c]['channel']})[_0xf20e('0x49')](function(_0x3366f8){if(_0x3366f8[_0xf20e('0x2a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x462d4b[_0xf20e('0x12')][_0x2c064c]){ut['updateOriginated'](_0x462d4b['campaignsPreview'][_0x462d4b['actions'][_0x2c064c][_0xf20e('0x3e')]],_0xf20e('0x4a'));if(_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x42')]===!![]){ut[_0xf20e('0x4b')](_0x462d4b[_0xf20e('0x10')][_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x3e')]],'[clearZombieChannel]');ut[_0xf20e('0x4c')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2c064c,_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x3e')]);}ut['loggerError'](_0xf20e('0x4d')+_0x2c064c,_0x462d4b[_0xf20e('0x12')][_0x2c064c][_0xf20e('0x3e')]);delete _0x462d4b['actions'][_0x2c064c];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x4422f6=this;loggerAction[_0xf20e('0x23')]('[action]',_['size'](this['actions']));for(var _0x589a88 in this[_0xf20e('0x12')]){if(_0x4422f6[_0xf20e('0x12')][_0xf20e('0x4e')](_0x589a88)){_0x4422f6[_0xf20e('0x3b')](_0x589a88);}}};Preview[_0xf20e('0xb')][_0xf20e('0x3a')]=function(_0x234d13){var _0x4d1d59=this;rpcDb[_0xf20e('0x4f')](_0x234d13['id'],ut['agentReadyId'](this[_0xf20e('0x13')]))[_0xf20e('0x50')](function(_0x1da862){if(!_[_0xf20e('0x3c')](_0x1da862)){for(var _0x470091=0x0;_0x470091<_0x1da862['length'];_0x470091+=0x1){if(ut['getDiff'](_0x1da862[_0x470091][_0xf20e('0x51')])<_0x234d13[_0xf20e('0x52')]*0x3c){if(_0x1da862[_0x470091][_0xf20e('0x53')]&&!_0x1da862[_0x470091]['Agent'][_0xf20e('0x54')]){_0x4d1d59[_0xf20e('0x55')](_0x1da862[_0x470091]['id'])[_0xf20e('0x50')](ut[_0xf20e('0x56')](_0xf20e('0x57')))[_0xf20e('0x49')](ut[_0xf20e('0x56')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x1da862[_0x470091]['id']);}}else{var _0x585db6=new Action(_0x1da862[_0x470091],_0x234d13);_0x585db6['starttime']=moment()[_0xf20e('0x58')](_0xf20e('0x59'));_0x234d13[_0xf20e('0x5a')]+=0x1;ut[_0xf20e('0x5b')](_0x585db6,0x17,_0xf20e('0x5c'));if(_0x234d13['dialRecallInQueue']){rpcDb[_0xf20e('0x5d')](ut[_0xf20e('0x5e')](_0x1da862[_0x470091]));rpcDb[_0xf20e('0x5f')](_0x585db6,_0xf20e('0x60'));}else{ut[_0xf20e('0x5b')](_0x585db6,0x16,_0xf20e('0x61'));rpcDb[_0xf20e('0x5f')](_0x585db6,_0xf20e('0x62'));rpcDb['createCustomerFinal'](_0x585db6,_0xf20e('0x62'));}}}}})[_0xf20e('0x49')](ut[_0xf20e('0x56')](_0xf20e('0x63')));};Preview[_0xf20e('0xb')][_0xf20e('0x38')]=function(_0xe6ad42){_0xe6ad42['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0xe6ad42['loggedIn'])){_0xe6ad42[_0xf20e('0x2a')]=utils[_0xf20e('0x2b')][_0xf20e('0x64')];}else if(!ut[_0xf20e('0x65')](_0xe6ad42[_0xf20e('0x37')])){_0xe6ad42['message']=utils[_0xf20e('0x2b')]['INACTIVE'];}else if(!this[_0xf20e('0x66')](_0xe6ad42['Trunk'])){if(!this[_0xf20e('0x66')](_0xe6ad42[_0xf20e('0x67')])){_0xe6ad42[_0xf20e('0x2a')]=utils['CAMPAIGN_STATUS']['UNREACHABLE_TRUNK'];}else{_0xe6ad42[_0xf20e('0x2a')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0xe6ad42[_0xf20e('0x2a')]=utils[_0xf20e('0x2b')]['ACTIVE'];}};Preview[_0xf20e('0xb')][_0xf20e('0x68')]=function(_0x4f59fb,_0x5975af,_0x3829cf){var _0xcc546e=this;var _0x14fd6a=this['actions'][_0x5975af];var _0x1a1ee5=this['campaignsPreview'][_0x14fd6a['queue']];var _0x48dce8;var _0x3f2d7b=![];var _0x52d93d=0x2;var _0x618b74=0x3;if(_0x1a1ee5){switch(_0x3829cf){case'1':_0x1a1ee5['outboundNoSuchCallsDay']+=0x1;_0x14fd6a[_0xf20e('0x69')]+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x0,_0xf20e('0x6c'));ami[_0xf20e('0x22')]('custom:agentnosuchnumber',ut[_0xf20e('0x6d')](_0x14fd6a,_0xf20e('0x6e')));rpcDb[_0xf20e('0x5f')](_0x14fd6a,'[callProgressDetectingCustomer][logNoSuch]');_0xcc546e[_0xf20e('0x6f')](_0x14fd6a,'0',_0x1a1ee5)[_0xf20e('0x50')](function(_0x49d13d){_0x3f2d7b=_0x49d13d['additional']==0x1;_0x52d93d=_0x1a1ee5[_0xf20e('0x70')];_0x618b74=_0x1a1ee5['callAdditionalPhoneAfterMin'];if(!_0x3f2d7b){if(ut['totalGlobal'](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut[_0xf20e('0x72')](_0x14fd6a,0xf,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x14fd6a[_0xf20e('0x69')]>=_0x1a1ee5['dialNoSuchNumberMaxRetry']){rpcDb[_0xf20e('0x74')](_0x14fd6a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xf20e('0x75')](ut[_0xf20e('0x76')](_0x14fd6a,_0xf20e('0x69'),_0x1a1ee5[_0xf20e('0x70')]),_0x14fd6a[_0xf20e('0x77')],_0x14fd6a[_0xf20e('0x78')]);}}delete this['actions'][_0x4f59fb[_0xf20e('0x79')]];}else{_0x14fd6a['countnosuchnumberretry']++;logger['info'](_0xf20e('0x7a'),_0x14fd6a[_0xf20e('0x69')]);logger['info']('id',_0x14fd6a[_0xf20e('0x7b')]);_0xcc546e[_0xf20e('0x7c')]({'id':_0x14fd6a[_0xf20e('0x7b')],'field':{'countnosuchnumberretry':_0x14fd6a['countnosuchnumberretry']}})[_0xf20e('0x50')](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)[_0xf20e('0x50')](function(){});});}});break;case _0xf20e('0x7e'):var _0x2c7de3=moment()[_0xf20e('0x58')](_0xf20e('0x59'));_0x14fd6a[_0xf20e('0x7f')]=_0x2c7de3;_0x14fd6a[_0xf20e('0x80')]=_0x2c7de3;_0x14fd6a[_0xf20e('0x42')]=!![];_0x1a1ee5[_0xf20e('0x81')]+=0x1;logger[_0xf20e('0x23')]('[syncHangup][talking][increment]',_0x14fd6a[_0xf20e('0x82')],_0xf20e('0x83'),_0x1a1ee5['name'],'pTalking:\x20',_0x1a1ee5['pTalking']);ami[_0xf20e('0x22')](_0xf20e('0x84'),ut[_0xf20e('0x6d')](_0x14fd6a,_0xf20e('0x85'),this[_0xf20e('0x10')][_0x14fd6a[_0xf20e('0x3e')]]));if(_0x1a1ee5[_0xf20e('0x86')]){ami['emit'](_0xf20e('0x87'),ut[_0xf20e('0x88')](_0x14fd6a));}break;case'16':ami[_0xf20e('0x22')](_0xf20e('0x89'),ut[_0xf20e('0x6d')](_0x14fd6a,_0xf20e('0x8a'),this[_0xf20e('0x10')][_0x14fd6a['queue']]));emitVoiceQueueChannelRemove(ut[_0xf20e('0x6d')](_0x14fd6a,_0xf20e('0x8a')));_0x1a1ee5[_0xf20e('0x8b')]+=0x1;_0x1a1ee5['total']+=0x1;_0x1a1ee5[_0xf20e('0x8c')]+=0x1;ut['decrementTalkink'](_0x1a1ee5,_0xf20e('0x8d'));_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x4,_0xf20e('0x8e'));rpcDb['createCustomerHistory'](_0x14fd6a,_0xf20e('0x8f'));rpcDb['createCustomerFinal'](_0x14fd6a,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf20e('0x90')](_0x14fd6a);_0x1a1ee5[_0xf20e('0x91')]+=_0x14fd6a[_0xf20e('0x92')];_0x1a1ee5[_0xf20e('0x93')]+=_0x14fd6a[_0xf20e('0x92')];logger[_0xf20e('0x23')](_0xf20e('0x94'),_0x14fd6a[_0xf20e('0x82')],_0xf20e('0x83'),_0x1a1ee5[_0xf20e('0x2e')],'pTalking:\x20',_0x1a1ee5['pTalking']);delete this[_0xf20e('0x12')][_0x4f59fb[_0xf20e('0x79')]];break;case'BUSY':_0x1a1ee5['outboundBusyCallsDay']+=0x1;_0x14fd6a[_0xf20e('0x95')]+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x5,_0xf20e('0x96'));_0x52d93d=_0x1a1ee5[_0xf20e('0x97')];_0x618b74=_0x1a1ee5[_0xf20e('0x98')];ami[_0xf20e('0x22')](_0xf20e('0x99'),ut['buildObj'](_0x14fd6a,_0xf20e('0x9a')));rpcDb[_0xf20e('0x5f')](_0x14fd6a,_0xf20e('0x9b'));_0xcc546e[_0xf20e('0x6f')](_0x14fd6a,'5',_0x1a1ee5)[_0xf20e('0x50')](function(_0x2d0165){_0x3f2d7b=_0x2d0165[_0xf20e('0x9c')]==0x1;if(!_0x3f2d7b){if(ut['totalGlobal'](_0x14fd6a)>=_0x1a1ee5['dialGlobalMaxRetry']){_0x48dce8=ut['cloneAction'](_0x14fd6a,0xf,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,_0xf20e('0x9d'));}else{if(_0x14fd6a['countbusyretry']>=_0x1a1ee5['dialBusyMaxRetry']){rpcDb[_0xf20e('0x74')](_0x14fd6a,_0xf20e('0x9b'));}else{rpcDb[_0xf20e('0x75')](ut[_0xf20e('0x76')](_0x14fd6a,'countbusyretry',_0x1a1ee5[_0xf20e('0x97')]),_0x14fd6a[_0xf20e('0x77')],_0x14fd6a[_0xf20e('0x78')]);}}}else{_0x14fd6a[_0xf20e('0x95')]++;_0xcc546e[_0xf20e('0x7c')]({'id':_0x14fd6a['idContact'],'field':{'countbusyretry':_0x14fd6a[_0xf20e('0x95')]}})['then'](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)[_0xf20e('0x50')](function(){});});}});break;case _0xf20e('0x9e'):_0x1a1ee5[_0xf20e('0x9f')]+=0x1;_0x14fd6a[_0xf20e('0xa0')]+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x3,_0xf20e('0xa1'));_0x52d93d=_0x1a1ee5[_0xf20e('0xa2')];_0x618b74=_0x1a1ee5[_0xf20e('0x98')];var _0x45b7a7=ut[_0xf20e('0xa3')](_0x14fd6a,_0x1a1ee5);ami[_0xf20e('0x22')](_0xf20e('0xa4'),_0x45b7a7);rpcDb[_0xf20e('0x5f')](_0x14fd6a,_0xf20e('0xa5'));_0xcc546e['verifyAdditionalPhones'](_0x14fd6a,'3',_0x1a1ee5)[_0xf20e('0x50')](function(_0x4bc967){_0x3f2d7b=_0x4bc967[_0xf20e('0x9c')]==0x1;if(!_0x3f2d7b){if(ut[_0xf20e('0x6b')](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut[_0xf20e('0x72')](_0x14fd6a,0xf,'Global');rpcDb[_0xf20e('0x74')](_0x48dce8,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x14fd6a['countnoanswerretry']>=_0x1a1ee5['dialNoAnswerMaxRetry']){rpcDb[_0xf20e('0x74')](_0x14fd6a,_0xf20e('0xa5'));}else{rpcDb['rescheduleContact'](ut[_0xf20e('0x76')](_0x14fd6a,_0xf20e('0xa0'),_0x1a1ee5[_0xf20e('0xa2')]),_0x14fd6a[_0xf20e('0x77')],_0x14fd6a[_0xf20e('0x78')]);}}}else{_0x14fd6a['countnoanswerretry']++;_0xcc546e[_0xf20e('0x7c')]({'id':_0x14fd6a[_0xf20e('0x7b')],'field':{'countnoanswerretry':_0x14fd6a[_0xf20e('0xa0')]}})[_0xf20e('0x50')](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)['then'](function(){});});}});break;case _0xf20e('0xa6'):_0x1a1ee5[_0xf20e('0xa7')]+=0x1;_0x14fd6a['countcongestionretry']+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut['totalGlobal'](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x8,_0xf20e('0xa8'));_0x52d93d=_0x1a1ee5[_0xf20e('0xa9')];_0x618b74=_0x1a1ee5['callAdditionalPhoneAfterMin'];ami[_0xf20e('0x22')](_0xf20e('0xaa'),ut[_0xf20e('0x6d')](_0x14fd6a,_0xf20e('0xab')));rpcDb[_0xf20e('0x5f')](_0x14fd6a,'[callProgressDetectingCustomer][logCongestion]');_0xcc546e[_0xf20e('0x6f')](_0x14fd6a,'8',_0x1a1ee5)[_0xf20e('0x50')](function(_0x1c2097){_0x3f2d7b=_0x1c2097['additional']==0x1;if(!_0x3f2d7b){if(ut['totalGlobal'](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut['cloneAction'](_0x14fd6a,0xf,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,_0xf20e('0xac'));}else{if(_0x14fd6a[_0xf20e('0xad')]>=_0x1a1ee5[_0xf20e('0xae')]){rpcDb[_0xf20e('0x74')](_0x14fd6a,_0xf20e('0xaf'));}else{rpcDb[_0xf20e('0x75')](ut[_0xf20e('0x76')](_0x14fd6a,_0xf20e('0xad'),_0x1a1ee5[_0xf20e('0x97')]),_0x14fd6a[_0xf20e('0x77')],_0x14fd6a['activeContact']);}}}else{_0x14fd6a[_0xf20e('0xad')]++;_0xcc546e[_0xf20e('0x7c')]({'id':_0x14fd6a[_0xf20e('0x7b')],'field':{'countcongestionretry':_0x14fd6a[_0xf20e('0xad')]}})[_0xf20e('0x50')](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)['then'](function(){});});}});break;case'CANCEL':_0x1a1ee5[_0xf20e('0xb0')]+=0x1;_0x14fd6a[_0xf20e('0xb1')]+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut['totalGlobal'](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x14,'AgentReject');_0x52d93d=_0x1a1ee5[_0xf20e('0xb2')];_0x618b74=_0x1a1ee5['callAdditionalPhoneAfterMin'];ami[_0xf20e('0x22')](_0xf20e('0xb3'),ut['buildObj'](_0x14fd6a,'agentreject'));rpcDb[_0xf20e('0x5f')](_0x14fd6a,'[syncHangupRequest][logAgentReject]');_0xcc546e['verifyAdditionalPhones'](_0x14fd6a,'20',_0x1a1ee5)[_0xf20e('0x50')](function(_0x561850){_0x3f2d7b=_0x561850[_0xf20e('0x9c')]==0x1;if(!_0x3f2d7b){if(ut['totalGlobal'](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut[_0xf20e('0x72')](_0x14fd6a,0x14,_0xf20e('0xb4'));rpcDb['createCustomerFinal'](_0x48dce8,_0xf20e('0xb5'));}else{if(_0x14fd6a['countagentrejectretry']>=_0x1a1ee5['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x14fd6a,_0xf20e('0xb5'));}else{rpcDb[_0xf20e('0x75')](ut[_0xf20e('0x76')](_0x14fd6a,_0xf20e('0xb1'),_0x1a1ee5[_0xf20e('0xb2')]),_0x14fd6a['unlockAgent'],_0x14fd6a[_0xf20e('0x78')]);}}}else{_0x14fd6a[_0xf20e('0xa0')]++;_0xcc546e['incrementPreviewCounters']({'id':_0x14fd6a['idContact'],'field':{'countnoanswerretry':_0x14fd6a[_0xf20e('0xa0')]}})['then'](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)[_0xf20e('0x50')](function(){});});}});break;case _0xf20e('0xb6'):_0x1a1ee5['outboundAbandonedCallsDay']+=0x1;_0x14fd6a['countabandonedretry']+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut['totalGlobal'](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0xb,'Abandoned');rpcDb[_0xf20e('0x5f')](_0x14fd6a,_0xf20e('0xb7'));_0xcc546e[_0xf20e('0x6f')](_0x14fd6a,'11',_0x1a1ee5)['then'](function(_0x24625f){_0x3f2d7b=_0x24625f[_0xf20e('0x9c')]==0x1;if(!_0x3f2d7b){if(ut[_0xf20e('0x6b')](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut[_0xf20e('0x72')](_0x14fd6a,0xf,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x14fd6a[_0xf20e('0xb8')]>=_0x1a1ee5['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x14fd6a,_0xf20e('0xb7'));}else{rpcDb[_0xf20e('0x75')](ut[_0xf20e('0x76')](_0x14fd6a,_0xf20e('0xb9'),_0x1a1ee5[_0xf20e('0xba')]),_0x14fd6a['unlockAgent'],_0x14fd6a['activeContact']);}}}else{_0x14fd6a['countnoanswerretry']++;_0xcc546e[_0xf20e('0x7c')]({'id':_0x14fd6a[_0xf20e('0x7b')],'field':{'countnoanswerretry':_0x14fd6a[_0xf20e('0xa0')]}})[_0xf20e('0x50')](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)[_0xf20e('0x50')](function(){});});}});break;case'18':_0x1a1ee5['outboundUnknownCallsDay']+=0x1;_0x14fd6a[_0xf20e('0xbb')]+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x12,_0x4f59fb[_0xf20e('0xbc')]||_0x4f59fb[_0xf20e('0xbd')]);ami[_0xf20e('0x22')]('custom:amd',ut[_0xf20e('0x6d')](_0x14fd6a,_0xf20e('0xbe')));rpcDb['createCustomerHistory'](_0x14fd6a,'[callProgressDetectingCustomer][hangupInAMD]');_0xcc546e['verifyAdditionalPhones'](_0x14fd6a,'18',_0x1a1ee5)['then'](function(_0x51775e){_0x3f2d7b=_0x51775e[_0xf20e('0x9c')]==0x1;if(!_0x3f2d7b){if(ut[_0xf20e('0x6b')](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut[_0xf20e('0x72')](_0x14fd6a,0x12,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xf20e('0x74')](_0x14fd6a,_0xf20e('0xbf'));}}else{_0x14fd6a[_0xf20e('0xa0')]++;_0xcc546e[_0xf20e('0x7c')]({'id':_0x14fd6a['idContact'],'field':{'countnoanswerretry':_0x14fd6a['countnoanswerretry']}})['then'](function(){_0xcc546e['swapAdditionalPhones'](_0x14fd6a,_0x52d93d,_0x618b74)[_0xf20e('0x50')](function(){});});}});delete this[_0xf20e('0x12')][_0x4f59fb['linkedid']];break;case'19':_0x1a1ee5[_0xf20e('0xc0')]+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0x13,_0x4f59fb[_0xf20e('0xbc')]||_0x4f59fb[_0xf20e('0xbd')]);ami[_0xf20e('0x22')](_0xf20e('0xc1'),ut[_0xf20e('0x6d')](_0x14fd6a,'amd'));rpcDb[_0xf20e('0x5f')](_0x14fd6a,_0xf20e('0xc2'));_0xcc546e[_0xf20e('0x6f')](_0x14fd6a,'18',_0x1a1ee5)[_0xf20e('0x50')](function(_0x367cf7){_0x3f2d7b=_0x367cf7['additional']==0x1;if(!_0x3f2d7b){if(ut[_0xf20e('0x6b')](_0x14fd6a)>=_0x1a1ee5['dialGlobalMaxRetry']){_0x48dce8=ut['cloneAction'](_0x14fd6a,0xf,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,_0xf20e('0xc2'));}else{rpcDb[_0xf20e('0x74')](_0x14fd6a,_0xf20e('0xc2'));}}else{_0x14fd6a['countnoanswerretry']++;_0xcc546e['incrementPreviewCounters']({'id':_0x14fd6a[_0xf20e('0x7b')],'field':{'countnoanswerretry':_0x14fd6a[_0xf20e('0xa0')]}})['then'](function(){_0xcc546e[_0xf20e('0x7d')](_0x14fd6a,_0x52d93d,_0x618b74)[_0xf20e('0x50')](function(){});});}});delete this[_0xf20e('0x12')][_0x4f59fb['linkedid']];break;default:if(_0x14fd6a['dialAnswer']){ut[_0xf20e('0x4b')](_0x1a1ee5,_0xf20e('0xc3'));ut[_0xf20e('0x4c')](_0xf20e('0xc4')+_0x1a1ee5['name'],_0x4f59fb);}_0x1a1ee5['outboundUnknownCallsDay']+=0x1;_0x14fd6a[_0xf20e('0x6a')]=ut[_0xf20e('0x6b')](_0x14fd6a);ut[_0xf20e('0x5b')](_0x14fd6a,0xc,_0x4f59fb[_0xf20e('0xbc')]||_0x4f59fb[_0xf20e('0xbd')]);_0x52d93d=_0x1a1ee5[_0xf20e('0xb2')];_0x618b74=_0x1a1ee5['callAdditionalPhoneAfterMin'];rpcDb[_0xf20e('0x5f')](_0x14fd6a,_0xf20e('0xc5'));_0xcc546e[_0xf20e('0x6f')](_0x14fd6a,'20',_0x1a1ee5)[_0xf20e('0x50')](function(_0x356a47){_0x3f2d7b=_0x356a47['additional']==0x1;if(!_0x3f2d7b){if(ut[_0xf20e('0x6b')](_0x14fd6a)>=_0x1a1ee5[_0xf20e('0x71')]){_0x48dce8=ut[_0xf20e('0x72')](_0x14fd6a,0xf,_0xf20e('0x73'));rpcDb[_0xf20e('0x74')](_0x48dce8,_0xf20e('0xc6'));}else{rpcDb[_0xf20e('0x74')](_0x14fd6a,_0xf20e('0xc6'));}delete this[_0xf20e('0x12')][_0x4f59fb[_0xf20e('0x79')]];}else{_0xcc546e['swapAdditionalPhones'](_0x14fd6a,_0x52d93d,_0x618b74)['then'](function(){});}});}if(!(_0x14fd6a['dialAnswer']&&_0x3829cf==='16')){ut['updateOriginated'](_0x1a1ee5,'[callProgressDetectingCustomer]');logger[_0xf20e('0x23')](_0xf20e('0xc7'),_0x14fd6a[_0xf20e('0x82')],_0xf20e('0x83'),_0x1a1ee5[_0xf20e('0x2e')],_0xf20e('0x3f'),_0x1a1ee5[_0xf20e('0x28')]);}if(_0x3829cf!==_0xf20e('0x7e')){delete this[_0xf20e('0x12')][_0x4f59fb[_0xf20e('0x79')]];delete this[_0xf20e('0x12')][_0x4f59fb['destlinkedid']];}_0x1a1ee5[_0xf20e('0xc8')]=!![];}};Preview[_0xf20e('0xb')][_0xf20e('0xc9')]=function(_0x54bb58,_0x473ce3,_0x55d878){if(_[_0xf20e('0xca')](_0x473ce3)&&_0xf20e('0xcb')!==typeof _0x473ce3){return;}if(_[_0xf20e('0xca')](_0x55d878)&&_0xf20e('0xcb')!==typeof _0x55d878){return;}switch(_0x55d878[_0xf20e('0xcc')]){case'0':ut[_0xf20e('0xcd')](_0x54bb58,0x0,_0xf20e('0x6c'));rpcDb['createAgentHistory'](_0x54bb58,_0xf20e('0xce'));break;case'3':ut[_0xf20e('0xcd')](_0x54bb58,0x3,_0xf20e('0xa1'));rpcDb[_0xf20e('0xcf')](_0x54bb58,_0xf20e('0xd0'));break;case'5':ut['logAgent'](_0x54bb58,0x5,'Busy');rpcDb['createAgentHistory'](_0x54bb58,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xf20e('0xcd')](_0x54bb58,0x8,_0xf20e('0xa8'));rpcDb[_0xf20e('0xcf')](_0x54bb58,_0xf20e('0xd1'));break;case'22':ut[_0xf20e('0xcd')](_0x54bb58,0x16,_0xf20e('0xd2'));rpcDb[_0xf20e('0xcf')](_0x54bb58,_0xf20e('0xd3'));break;default:ut['logAgent'](_0x54bb58,0xc,_0x55d878[_0xf20e('0xcc')]);rpcDb[_0xf20e('0xcf')](_0x54bb58,_0xf20e('0xd1'));}ut[_0xf20e('0xd4')](_0x473ce3,_0xf20e('0xd5'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x54bb58['uniqueid'],'\x20Queue',_0x473ce3[_0xf20e('0x2e')],_0xf20e('0x3f'),_0x473ce3[_0xf20e('0x28')]);delete this[_0xf20e('0x12')][_0x54bb58[_0xf20e('0x82')]];};Preview[_0xf20e('0xb')][_0xf20e('0x6f')]=function(_0x5f2a2e,_0x5174aa,_0x539e6f){return cmHopperAdditionalPhone[_0xf20e('0x6f')](_0x5f2a2e,_0x5174aa,_0x539e6f)['catch'](logger[_0xf20e('0x23')](_0xf20e('0xd6')));};Preview[_0xf20e('0xb')][_0xf20e('0x7d')]=function(_0x29faad,_0x130cfd,_0x43de76){return cmHopperAdditionalPhone[_0xf20e('0x7d')](_0x29faad,_0x130cfd,_0x43de76)[_0xf20e('0x49')](logger[_0xf20e('0x23')](_0xf20e('0xd7')));};Preview[_0xf20e('0xb')][_0xf20e('0x7c')]=function(_0x51be36){return Promise[_0xf20e('0xd8')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x51be36))[_0xf20e('0x49')](logger[_0xf20e('0x23')](_0xf20e('0xd9')));};Preview[_0xf20e('0xb')][_0xf20e('0xda')]=function(_0x2bf579,_0x57048c,_0x5b0f87,_0x33c144,_0x4d8791){var _0x2fe59d=this;return new Promise(function(_0x31350e,_0x158ab6){if(_[_0xf20e('0x3c')](_0x57048c)||_[_0xf20e('0x3c')](_0x57048c[_0xf20e('0xdb')])||_['isNil'](_0x57048c[_0xf20e('0xdc')])||_[_0xf20e('0x3c')](_0x57048c['VoiceQueueId'])){_0x158ab6(ut[_0xf20e('0x2a')]('Contact\x20is\x20undefined',_0x33c144,_0x4d8791));return;}var _0x162998=uuid['v4']();var _0x3a9409=_0x2fe59d[_0xf20e('0x10')][_0x57048c[_0xf20e('0x3d')]['name']];var _0x2d3fff=_0x5b0f87?_0x2fe59d[_0xf20e('0x13')][_0x5b0f87]['id']:undefined;_0x2fe59d['actions'][_0x162998]=new Action(_0x57048c,_0x3a9409,_0x162998,_0x5b0f87,_0x2d3fff);var _0x1c0fed=_0x2fe59d[_0xf20e('0x12')][_0x162998];_0x1c0fed['unlockAgent']=_0x33c144;_0x1c0fed[_0xf20e('0x78')]=_0x4d8791;_0x1c0fed[_0xf20e('0xdd')]=_0x5b0f87;if(_[_0xf20e('0xde')](_0x2bf579)){_0x2fe59d['execCall'](_0x1c0fed,_0x3a9409,_0x57048c,_0x5b0f87)[_0xf20e('0x50')](function(_0x4f584d){logger['info']('[Preview][execCall][success]',_0xf20e('0xdf')+_0x1c0fed[_0xf20e('0x3e')]+_0xf20e('0xe0')+_0x1c0fed[_0xf20e('0x7b')],JSON[_0xf20e('0x41')](_0x4f584d));ami[_0xf20e('0x22')](_0xf20e('0xe1'),ut[_0xf20e('0x6d')](_0x1c0fed,_0xf20e('0xe2'),_0x2fe59d[_0xf20e('0x10')][_0x1c0fed[_0xf20e('0x3e')]]));_0x31350e(ut[_0xf20e('0x2a')](_0xf20e('0xe3')));})['catch'](function(_0x25537e){ut[_0xf20e('0x2d')](_0xf20e('0xe4'),_0x25537e);_0x158ab6(ut[_0xf20e('0x2a')]('Call\x20failed',_0x33c144,_0x4d8791));});}else{_0x3a9409[_0xf20e('0xe5')]+=0x1;ut['logBlacklist'](_0x1c0fed);rpcDb['createHistory'](_0x1c0fed,'[Blacklist][error]');delete _0x2fe59d[_0xf20e('0x12')][_0x162998];_0x158ab6(ut[_0xf20e('0x2a')](_0xf20e('0xe6'),_0x33c144,_0x4d8791));}});};Preview[_0xf20e('0xb')][_0xf20e('0x66')]=function(_0x1116c9){return!_[_0xf20e('0x3c')](_0x1116c9)&&!_[_0xf20e('0x3c')](_0x1116c9[_0xf20e('0x2e')])&&!_[_0xf20e('0x3c')](_0x1116c9[_0xf20e('0xe7')])&&_0x1116c9[_0xf20e('0xe7')]&&!_[_0xf20e('0x3c')](this[_0xf20e('0x11')][util[_0xf20e('0x58')](_0xf20e('0xe8'),_0x1116c9['name'])])&&!_[_0xf20e('0x3c')](this[_0xf20e('0x11')][util[_0xf20e('0x58')](_0xf20e('0xe8'),_0x1116c9[_0xf20e('0x2e')])]['status'])&&(this[_0xf20e('0x11')][util[_0xf20e('0x58')](_0xf20e('0xe8'),_0x1116c9['name'])][_0xf20e('0x48')]===_0xf20e('0xe9')||this[_0xf20e('0x11')][util['format'](_0xf20e('0xe8'),_0x1116c9[_0xf20e('0x2e')])]['status']==='unmonitored');};Preview[_0xf20e('0xb')]['run']=function(_0x3e7038,_0x32a5f8){return this[_0xf20e('0xea')](_0x3e7038,_0x32a5f8)[_0xf20e('0x50')](function(_0x162a8e){return _[_0xf20e('0x43')](_0x162a8e,['message']);})['catch'](function(_0x94cf5a){if(_0x94cf5a[_0xf20e('0xeb')]){rpcDb['unlockContact'](_0x3e7038);}if(_0x94cf5a[_0xf20e('0xe7')]){rpcDb[_0xf20e('0xec')](_0x3e7038);}throw _[_0xf20e('0x43')](_0x94cf5a,[_0xf20e('0x2a')]);});};Preview[_0xf20e('0xb')][_0xf20e('0xea')]=function(_0x443090,_0x128534){var _0x6ccd30=this;var _0x20d436,_0x3ca40f;return rpcDb['getContactPreview'](_0x443090)[_0xf20e('0x50')](function(_0x470938){if(!_[_0xf20e('0x3c')](_0x470938[0x0])){_0x3ca40f=_0x470938[0x0][_0xf20e('0xed')]?![]:!![];_0x20d436=_0x470938[0x0][_0xf20e('0xed')]?!![]:![];_0x20d436=_0x128534?!![]:_0x20d436;}var _0x9362=_0x6ccd30[_0xf20e('0xee')](_0x470938);if(_0x9362[_0xf20e('0xef')]){rpcDb[_0xf20e('0xf0')](_['pick'](_0x470938[0x0],[_0xf20e('0x46'),_0xf20e('0xdc')]))[_0xf20e('0x50')](function(_0x34041a){_0x6ccd30['checkInBlack'](_0x34041a,_0x470938[0x0],_0x128534,_0x3ca40f,_0x20d436)[_0xf20e('0x50')](function(_0xdbcdf8){return _0xdbcdf8;})['catch'](function(_0x352cde){throw _0x352cde;});})[_0xf20e('0x49')](function(_0x5a502e){ut[_0xf20e('0x2d')]('[Preview][checkIsBlackList]',_0x5a502e);throw ut[_0xf20e('0x2a')](_0xf20e('0xf1'),_0x3ca40f,_0x20d436);});}else{throw ut[_0xf20e('0x2a')](_0x9362[_0xf20e('0x2a')],_0x3ca40f,_0x20d436);}})[_0xf20e('0x49')](function(_0x47ffd6){ut['logger'](_0xf20e('0xf2'),_0x47ffd6);throw ut[_0xf20e('0x2a')](_0xf20e('0xf1'),![],!![]);});};Preview[_0xf20e('0xb')][_0xf20e('0xee')]=function(_0xd3d8bc){if(_[_0xf20e('0x3c')](_0xd3d8bc)||_['isEmpty'](_0xd3d8bc)||!_[_0xf20e('0x3c')](_0xd3d8bc[0x0][_0xf20e('0x53')])&&_['isNil'](_0xd3d8bc[0x0][_0xf20e('0x53')][_0xf20e('0x2e')])){ut['logger'](_0xf20e('0xf3'),_0xd3d8bc);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x26c423=this[_0xf20e('0x10')][_0xd3d8bc[0x0][_0xf20e('0x3d')][_0xf20e('0x2e')]];_0x26c423[_0xf20e('0x2a')]=utils['CAMPAIGN_STATUS'][_0xf20e('0xf4')];if(_[_0xf20e('0x3c')](_0x26c423)){ut[_0xf20e('0x2d')](_0xf20e('0xf5'),_0x26c423);return{'isValid':![],'message':_0xf20e('0xf6')};}if(!this[_0xf20e('0x66')](_0x26c423['Trunk'])){ut['logger'](_0xf20e('0xf7'),_0xf20e('0xf8')+_0x26c423[_0xf20e('0x2e')]+_0xf20e('0xf9'));if(!this[_0xf20e('0x66')](_0x26c423[_0xf20e('0x67')])){ut[_0xf20e('0x2d')](_0xf20e('0xf7'),_0x26c423[_0xf20e('0x2e')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xf20e('0xfa')};}}if(!ut[_0xf20e('0x65')](_0x26c423[_0xf20e('0x37')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x26c423[_0xf20e('0x2e')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xf20e('0xf8')+_0x26c423[_0xf20e('0x2e')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf20e('0xfb')};};Preview['prototype']['execCall']=function(_0x594da8,_0xd4e040,_0x40d830,_0x1d6a59){var _0x9899d=this;return new Promise(function(_0x39af51,_0x1d565b){var _0x1685b2=_0x594da8[_0xf20e('0x82')];var _0x2240f6=_0x9899d[_0xf20e('0x66')](_0xd4e040[_0xf20e('0xfc')])?util['format'](_0xf20e('0xfd'),_0xd4e040[_0xf20e('0xfc')][_0xf20e('0x2e')],_['isNil'](_0xd4e040[_0xf20e('0xfe')])?'':_0xd4e040['dialPrefix'][_0xf20e('0xff')]()||'',_0xd4e040[_0xf20e('0x100')]>0x0?_0x40d830['phone'][_0xf20e('0x101')](_0xd4e040['dialCutDigit']):_0x40d830[_0xf20e('0xdc')]):util[_0xf20e('0x58')]('SIP/%s/%s%s',_['isNil'](_0xd4e040['TrunkBackup'])?_0xd4e040['Trunk']['name']:_0xd4e040[_0xf20e('0x67')][_0xf20e('0x2e')],_[_0xf20e('0x3c')](_0xd4e040[_0xf20e('0xfe')])?'':_0xd4e040[_0xf20e('0xfe')][_0xf20e('0xff')]()||'',_0xd4e040[_0xf20e('0x100')]>0x0?_0x40d830['phone'][_0xf20e('0x101')](_0xd4e040['dialCutDigit']):_0x40d830[_0xf20e('0xdc')]);var _0x36d25b=_0x9899d[_0xf20e('0x66')](_0xd4e040[_0xf20e('0xfc')])?ut[_0xf20e('0x102')](_0xd4e040[_0xf20e('0xfc')][_0xf20e('0x103')],_0xd4e040[_0xf20e('0x104')],_0xd4e040[_0xf20e('0x105')]>0x0?ut[_0xf20e('0x106')](_0xd4e040[_0xf20e('0x107')],_0xd4e040['dialRandomLastDigitCallerIdNumber']):_0xd4e040[_0xf20e('0x107')]):ut[_0xf20e('0x102')](_[_0xf20e('0x3c')](_0xd4e040[_0xf20e('0x67')])?_0xd4e040[_0xf20e('0xfc')]['callerid']:_0xd4e040[_0xf20e('0x67')][_0xf20e('0x103')],_0xd4e040[_0xf20e('0x104')],_0xd4e040['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0xd4e040[_0xf20e('0x107')],_0xd4e040['dialRandomLastDigitCallerIdNumber']):_0xd4e040[_0xf20e('0x107')]);if(_0x36d25b){_0x594da8['originatecalleridname']=ut['extractCalleridName'](_0x36d25b);_0x594da8[_0xf20e('0x108')]=ut[_0xf20e('0x109')](_0x36d25b);}var _0x46b8ca=ut[_0xf20e('0x10a')](_0xd4e040,_0x40d830,_0x2240f6,_0x36d25b,_0x1685b2,_0x594da8);var _0x31f9cd=utils[_0xf20e('0x10b')](_0x40d830[_0xf20e('0xdb')]);Object[_0xf20e('0x10c')](_0x46b8ca,_0x31f9cd);_['merge'](_0x594da8,ut[_0xf20e('0x10d')](_0x46b8ca));_0x594da8[_0xf20e('0x10e')]=moment()[_0xf20e('0x58')](_0xf20e('0x59'));_0xd4e040[_0xf20e('0x10f')]=_0x46b8ca;var _0x2f1d21=ut[_0xf20e('0x110')](_0x594da8,_0xd4e040,_0x46b8ca,_0x594da8[_0xf20e('0x78')],_0x1d6a59);return ami[_0xf20e('0x47')](_0x2f1d21)[_0xf20e('0x50')](function(_0x29ca65){_0xd4e040['originated']+=0x1;logger['info'](_0xf20e('0x111'),_0x1685b2,'\x20Queue',_0xd4e040[_0xf20e('0x2e')],_0xf20e('0x3f'),_0xd4e040[_0xf20e('0x28')]);_0x39af51(_0x29ca65);})[_0xf20e('0x49')](function(_0x1bb59e){ut[_0xf20e('0xcd')](_0x594da8,0xe,_0xf20e('0x112'));rpcDb[_0xf20e('0xcf')](_0x594da8,_0xf20e('0x113'));_0x1d565b(_0x1bb59e);});});};Preview[_0xf20e('0xb')]['syncNewExten']=function(_0x1fd4f0){if(this[_0xf20e('0x12')][_0x1fd4f0[_0xf20e('0x79')]]){this[_0xf20e('0x12')][_0x1fd4f0[_0xf20e('0x79')]]['channel']=_0x1fd4f0[_0xf20e('0x114')];}};Preview[_0xf20e('0xb')]['syncOriginateResponse']=function(_0x13bab5){var _0x2eeae9=this;var _0x48106b=this[_0xf20e('0x12')][_0x13bab5[_0xf20e('0x115')]];if(_0x48106b){if(_0x48106b[_0xf20e('0xdd')]&&this[_0xf20e('0x13')][_0x48106b[_0xf20e('0xdd')]]){ut['logLookAgent'](_0x48106b,this[_0xf20e('0x13')][_0x48106b[_0xf20e('0xdd')]][_0xf20e('0x2e')],this[_0xf20e('0x13')][_0x48106b[_0xf20e('0xdd')]]['id']);}var _0xaa57aa=_['clone'](_0x48106b);_0xaa57aa[_0xf20e('0x7f')]=moment()[_0xf20e('0x58')](_0xf20e('0x59'));var _0x547124=_0x2eeae9[_0xf20e('0x10')][_0x48106b['queue']];if(ut['isFailure'](_0x13bab5[_0xf20e('0x116')])){if(_0x48106b[_0xf20e('0x77')]){rpcDb[_0xf20e('0x117')](_0x48106b[_0xf20e('0x7b')]);}if(_0x48106b['activeContact']){rpcDb['disableContact'](_0x48106b[_0xf20e('0x7b')]);}ami[_0xf20e('0x22')](_0xf20e('0x118'),ut['buildObj'](_0x48106b,_0xf20e('0x119'),this[_0xf20e('0x10')][_0x48106b[_0xf20e('0x3e')]]));this[_0xf20e('0xc9')](_0xaa57aa,_0x547124,_0x13bab5);}else{_0x48106b['starttime']=moment()['format'](_0xf20e('0x59'));ut['logAgent'](_0xaa57aa,0x4,_0xf20e('0x8e'));rpcDb[_0xf20e('0xcf')](_0xaa57aa,_0xf20e('0x11a'));}}};Preview[_0xf20e('0xb')][_0xf20e('0x11b')]=function(_0x31519a){var _0x43aa9a=this['actions'][_0x31519a['linkedid']];var _0x2bc427;if(_0x43aa9a){_0x2bc427=this[_0xf20e('0x10')][_0x43aa9a[_0xf20e('0x3e')]];logger[_0xf20e('0x23')](_0xf20e('0x11c'),_0x31519a['linkedid'],'\x20Queue',_0x2bc427[_0xf20e('0x2e')],_0xf20e('0x40'),_0x2bc427['pTalking']);}if(this[_0xf20e('0x12')][_0x31519a[_0xf20e('0x79')]]&&_0x31519a['linkedid']!==_0x31519a[_0xf20e('0x82')]){if(_0x31519a[_0xf20e('0x11d')]==='16'&&this[_0xf20e('0x12')][_0x31519a[_0xf20e('0x79')]][_0xf20e('0x42')]){this[_0xf20e('0x68')](_0x31519a,_0x31519a[_0xf20e('0x79')],_0x31519a[_0xf20e('0x11d')]);}else if(this[_0xf20e('0x12')][_0x31519a[_0xf20e('0x79')]][_0xf20e('0x42')]){logger[_0xf20e('0x23')]('[syncHangup][talking][cause]',_0x31519a[_0xf20e('0x79')],_0x31519a[_0xf20e('0x11d')],_0xf20e('0x83'),_0x2bc427['name'],_0xf20e('0x40'),_0x2bc427['pTalking']);this['callProgressDetectingCustomer'](_0x31519a,_0x31519a[_0xf20e('0x79')],_0x31519a[_0xf20e('0x11d')]);}}else if(_0x43aa9a&&_[_0xf20e('0x3c')](_0x43aa9a[_0xf20e('0x11e')])&&_0x2bc427['dialQueueProject']&&_0x31519a[_0xf20e('0x79')]===_0x31519a[_0xf20e('0x82')]&&_['isNil'](_0x31519a[_0xf20e('0xcc')])&&_0x31519a['cause']==='16'&&_0x31519a[_0xf20e('0x11f')]==='6'&&_['isUndefined'](_0x43aa9a[_0xf20e('0x120')])){if(_0x43aa9a[_0xf20e('0x77')]){rpcDb[_0xf20e('0x117')](_0x43aa9a[_0xf20e('0x7b')]);}if(_0x43aa9a[_0xf20e('0x78')]){rpcDb[_0xf20e('0xec')](_0x43aa9a[_0xf20e('0x7b')]);}_0x31519a['reason']='22';this[_0xf20e('0xc9')](_0x43aa9a,_0x2bc427,_0x31519a);}else if(_0x43aa9a&&_0x43aa9a[_0xf20e('0x120')]){if(_0x31519a['cause']==='16'&&this[_0xf20e('0x12')][_0x31519a[_0xf20e('0x79')]][_0xf20e('0x42')]){logger[_0xf20e('0x23')](_0xf20e('0x121'),_0x31519a['linkedid'],_0x31519a[_0xf20e('0x11d')],'\x20Queue',_0x2bc427['name'],_0xf20e('0x40'),_0x2bc427[_0xf20e('0x81')]);this[_0xf20e('0x68')](_0x31519a,_0x31519a[_0xf20e('0x79')],_0x31519a[_0xf20e('0x11d')]);}else if(this[_0xf20e('0x12')][_0x31519a[_0xf20e('0x79')]][_0xf20e('0x42')]){logger[_0xf20e('0x23')](_0xf20e('0x122'),_0x31519a[_0xf20e('0x79')],_0x31519a[_0xf20e('0x11d')],_0xf20e('0x83'),_0x2bc427[_0xf20e('0x2e')],_0xf20e('0x40'),_0x2bc427[_0xf20e('0x81')]);this[_0xf20e('0x68')](_0x31519a,_0x31519a['linkedid'],_0x31519a[_0xf20e('0x11d')]);}}};Preview['prototype'][_0xf20e('0x1a')]=function(_0x370f86){if(this[_0xf20e('0x12')][_0x370f86[_0xf20e('0x123')]]&&_0x370f86['destlinkedid']!==_0x370f86[_0xf20e('0x124')]){this['callProgressDetectingCustomer'](_0x370f86,_0x370f86[_0xf20e('0x123')],_0x370f86['dialstatus']);}};Preview['prototype'][_0xf20e('0x19')]=function(_0x357918){if(this[_0xf20e('0x12')][_0x357918[_0xf20e('0x79')]]&&_0x357918[_0xf20e('0x79')]!==_0x357918[_0xf20e('0x82')]&&!this[_0xf20e('0x12')][_0x357918[_0xf20e('0x79')]][_0xf20e('0x42')]){if(_0x357918['cause']==='1'){this[_0xf20e('0x68')](_0x357918,_0x357918[_0xf20e('0x79')],_0x357918[_0xf20e('0x11d')]);}}};Preview[_0xf20e('0xb')][_0xf20e('0x125')]=function(_0x580052,_0x1c6721,_0x17d837){if(this['actions'][_0x580052]){if(_[_0xf20e('0x3c')](this[_0xf20e('0x12')][_0x580052]['variables'])){this[_0xf20e('0x12')][_0x580052]['variables']={};}this['actions'][_0x580052]['variables'][_0x1c6721]=_0x17d837;}};Preview[_0xf20e('0xb')][_0xf20e('0x126')]=function(_0x32ce9e){try{if(!_[_0xf20e('0x3c')](_0x32ce9e)){if(ut[_0xf20e('0x127')](_[_0xf20e('0x128')](_0x32ce9e['variable'])[0x0])){this[_0xf20e('0x125')](_0x32ce9e[_0xf20e('0x82')],_[_0xf20e('0x128')](_0x32ce9e['variable'])[0x0],_0x32ce9e[_0xf20e('0x129')]);}}}catch(_0x33b370){logger['error'](_0xf20e('0x12a'),util[_0xf20e('0x12b')](_0x33b370,{'showHidden':![],'depth':null}));}};Preview[_0xf20e('0xb')][_0xf20e('0x1f')]=function(_0x3f095d){if(_0x3f095d){if(this[_0xf20e('0x12')][_0x3f095d[_0xf20e('0x12c')]]){this[_0xf20e('0x12')][_0x3f095d[_0xf20e('0x12c')]][_0xf20e('0x120')]=!![];}}};Preview['prototype'][_0xf20e('0x21')]=function(_0x389cff){if(_0x389cff){if(this['actions'][_0x389cff['transfererlinkedid']]){this[_0xf20e('0x12')][_0x389cff[_0xf20e('0x12d')]][_0xf20e('0x120')]=!![];}}};module[_0xf20e('0x12e')]=Preview; \ No newline at end of file +var _0x549b=['destuniqueid','destlinkedid','dialstatus','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','uuid','moment','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','../dialer/utils','defaults','localhost','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','trunks','actions','agents','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','loopCampaigns','voice:queue:%s','name','voice_queue_channel:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','type','clearZombieChannels','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','stringify','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','status','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getDiff','scheduledat','Agent','run','then','logger2','[RecallMe]','catch','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','dialActive','INACTIVE','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','countnosuchnumberretry','unlockAgent','activeContact','idContact','incrementPreviewCounters','ANSWER','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','total','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','outboundBusyCallsDay','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','amd','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Queue','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','toLowerVariables','variables','Action','[originated][increment]','OriginateError','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x549b,0x152));var _0xb549=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0x549b[_0x296e0e];return _0x101c03;};'use strict';var util=require('util');var _=require('lodash');var uuid=require(_0xb549('0x0'));var moment=require(_0xb549('0x1'));var Redis=require('ioredis');var config=require(_0xb549('0x2'));var logger=require(_0xb549('0x3'))(_0xb549('0x4'));var loggerAction=require(_0xb549('0x3'))('actionPreview');var ami=require(_0xb549('0x5'));var rpcDb=require(_0xb549('0x6'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xb549('0x7'));var ut=require('./util/util');var utils=require(_0xb549('0x8'));config['redis']=_[_0xb549('0x9')](config['redis'],{'host':_0xb549('0xa'),'port':0x18eb});var io=require(_0xb549('0xb'))(new Redis(config[_0xb549('0xc')]));var Sequence=function(){};Sequence[_0xb549('0xd')][_0xb549('0xe')]=function(_0x252462){this['tail']=this['tail']?this[_0xb549('0xf')]['finally'](_0x252462):_0x252462();};function Preview(_0x5620f3){this[_0xb549('0x10')]=new Sequence();this[_0xb549('0x11')]=_0x5620f3['voiceQueues'];this[_0xb549('0x12')]=_0x5620f3[_0xb549('0x12')];this[_0xb549('0x13')]={};this[_0xb549('0x14')]=_0x5620f3[_0xb549('0x14')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0xb549('0x15'),this[_0xb549('0x16')][_0xb549('0x17')](this));ami['on'](_0xb549('0x18'),this[_0xb549('0x19')][_0xb549('0x17')](this));ami['on']('dialend',this[_0xb549('0x1a')]['bind'](this));ami['on'](_0xb549('0x1b'),this[_0xb549('0x1c')][_0xb549('0x17')](this));ami['on'](_0xb549('0x1d'),this['syncVarSet'][_0xb549('0x17')](this));ami['on'](_0xb549('0x1e'),this['syncAttendedTransfer'][_0xb549('0x17')](this));ami['on'](_0xb549('0x1f'),this['syncBlindTransfer'][_0xb549('0x17')](this));this[_0xb549('0x20')](this[_0xb549('0x11')]);}function emit(_0x4658ee,_0x2e428c,_0x381f6e){io['to'](_0x4658ee)['emit'](_0x2e428c,_0x381f6e);}function emitVoiceQueueChannelRemove(_0x563f05){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x563f05));emit(util['format'](_0xb549('0x21'),_0x563f05[_0xb549('0x22')]),_0xb549('0x23'),_0x563f05);io['emit']('voice_queue_presence:remove',_0x563f05);}function notSendMessagesQueue(_0x2a8b12){if(_0x2a8b12[_0xb549('0x24')]){if(_0x2a8b12[_0xb549('0x25')]===0x0&&_0x2a8b12[_0xb549('0x26')]===0x0){_0x2a8b12[_0xb549('0x24')]=![];_0x2a8b12[_0xb549('0x27')]=0x0;_0x2a8b12[_0xb549('0x28')]=0x0;_0x2a8b12[_0xb549('0x29')]=utils[_0xb549('0x2a')]['INACTIVE'];ut[_0xb549('0x2b')](_0xb549('0x2c'),_0x2a8b12['name']+'\x20is\x20not\x20active');}else{_0x2a8b12[_0xb549('0x29')]=utils[_0xb549('0x2a')][_0xb549('0x2d')];ut[_0xb549('0x2b')](_0xb549('0x2c'),_0x2a8b12[_0xb549('0x22')]+_0xb549('0x2e'));}}}Preview[_0xb549('0xd')][_0xb549('0x20')]=function(){var _0x308a05=this;setInterval(function(){_0x308a05['syncCampaigns']();},0x7cf);};Preview[_0xb549('0xd')][_0xb549('0x2f')]=function(){var _0x20c91b=this['campaignsPreview'];this[_0xb549('0x30')]+=0x1;for(var _0x11822c in _0x20c91b){if(_0x20c91b[_0xb549('0x31')](_0x11822c)&&(_0x20c91b[_0x11822c][_0xb549('0x32')]===_0xb549('0x4')||_0x20c91b[_0x11822c][_0xb549('0x32')]===_0xb549('0x33'))&&_0x20c91b[_0x11822c][_0xb549('0x34')]==='outbound'){if(this[_0xb549('0x30')]>0x7){this[_0xb549('0x30')]=0x0;this[_0xb549('0x35')]();}}if(_0x20c91b[_0xb549('0x31')](_0x11822c)&&_0x20c91b[_0x11822c][_0xb549('0x32')]==='preview'&&_0x20c91b[_0x11822c][_0xb549('0x34')]===_0xb549('0x36')){if(_0x20c91b[_0x11822c]['dialActive']){this[_0xb549('0x37')](_0x20c91b[_0x11822c]);if(_0x20c91b[_0x11822c][_0xb549('0x38')])this[_0xb549('0x39')](_0x20c91b[_0x11822c]);}else{notSendMessagesQueue(_0x20c91b[_0x11822c]);}}}};Preview[_0xb549('0xd')][_0xb549('0x3a')]=function(_0x5658c3){var _0x3c9cd2=this;this['sequence'][_0xb549('0xe')](function(){if(!_[_0xb549('0x3b')](_0x3c9cd2[_0xb549('0x13')][_0x5658c3])){loggerAction[_0xb549('0x3c')](_0xb549('0x3d'),_0x5658c3,'Queue',_0x3c9cd2[_0xb549('0x13')][_0x5658c3]['queue'],'originated:\x20',JSON[_0xb549('0x3e')](_0x3c9cd2['campaignsPreview'][_0x3c9cd2[_0xb549('0x13')][_0x5658c3][_0xb549('0x3f')]][_0xb549('0x25')]),_0xb549('0x40'),JSON['stringify'](_0x3c9cd2[_0xb549('0x11')][_0x3c9cd2[_0xb549('0x13')][_0x5658c3][_0xb549('0x3f')]][_0xb549('0x26')]),JSON[_0xb549('0x3e')](_0x3c9cd2[_0xb549('0x13')][_0x5658c3][_0xb549('0x41')]),JSON[_0xb549('0x3e')](_[_0xb549('0x42')](_0x3c9cd2[_0xb549('0x13')][_0x5658c3],[_0xb549('0x43'),_0xb549('0x44'),'VoiceQueueId',_0xb549('0x45')])));return ami['Action']({'action':_0xb549('0x46'),'channel':_0x3c9cd2[_0xb549('0x13')][_0x5658c3][_0xb549('0x47')]})['catch'](function(_0x763a57){if(_0x763a57[_0xb549('0x29')]===_0xb549('0x48')){setTimeout(function(){if(_0x3c9cd2['actions'][_0x5658c3]){ut[_0xb549('0x49')](_0x3c9cd2['campaignsPreview'][_0x3c9cd2['actions'][_0x5658c3][_0xb549('0x3f')]],'[clearZombieChannel]');if(_0x3c9cd2[_0xb549('0x13')][_0x5658c3][_0xb549('0x41')]===!![]){ut[_0xb549('0x4a')](_0x3c9cd2[_0xb549('0x11')][_0x3c9cd2[_0xb549('0x13')][_0x5658c3]['queue']],_0xb549('0x4b'));ut['loggerError'](_0xb549('0x4c')+_0x5658c3,_0x3c9cd2[_0xb549('0x13')][_0x5658c3][_0xb549('0x3f')]);}ut['loggerError'](_0xb549('0x4d')+_0x5658c3,_0x3c9cd2['actions'][_0x5658c3][_0xb549('0x3f')]);delete _0x3c9cd2[_0xb549('0x13')][_0x5658c3];}},0x2328);}});}});};Preview['prototype'][_0xb549('0x35')]=function(){var _0x57ae62=this;loggerAction[_0xb549('0x3c')]('[action]',_[_0xb549('0x4e')](this[_0xb549('0x13')]));for(var _0x4a926b in this[_0xb549('0x13')]){if(_0x57ae62['actions'][_0xb549('0x31')](_0x4a926b)){_0x57ae62[_0xb549('0x3a')](_0x4a926b);}}};Preview[_0xb549('0xd')]['recallMe']=function(_0x3ca12a){var _0x573550=this;rpcDb['getContactRecallMe'](_0x3ca12a['id'],ut['agentReadyId'](this[_0xb549('0x14')]))['then'](function(_0x1bb3fc){if(!_[_0xb549('0x3b')](_0x1bb3fc)){for(var _0x42d7ee=0x0;_0x42d7ee<_0x1bb3fc['length'];_0x42d7ee+=0x1){if(ut[_0xb549('0x4f')](_0x1bb3fc[_0x42d7ee][_0xb549('0x50')])<_0x3ca12a['dialRecallMeTimeout']*0x3c){if(_0x1bb3fc[_0x42d7ee][_0xb549('0x51')]&&!_0x1bb3fc[_0x42d7ee][_0xb549('0x51')]['voicePause']){_0x573550[_0xb549('0x52')](_0x1bb3fc[_0x42d7ee]['id'])[_0xb549('0x53')](ut[_0xb549('0x54')](_0xb549('0x55')))[_0xb549('0x56')](ut[_0xb549('0x54')](_0xb549('0x55')));}else{rpcDb[_0xb549('0x57')](_0x1bb3fc[_0x42d7ee]['id']);}}else{var _0x39f5e7=new Action(_0x1bb3fc[_0x42d7ee],_0x3ca12a);_0x39f5e7[_0xb549('0x58')]=moment()[_0xb549('0x59')](_0xb549('0x5a'));_0x3ca12a['outboundReCallsDay']+=0x1;ut[_0xb549('0x5b')](_0x39f5e7,0x17,_0xb549('0x5c'));if(_0x3ca12a[_0xb549('0x5d')]){rpcDb[_0xb549('0x5e')](ut[_0xb549('0x5f')](_0x1bb3fc[_0x42d7ee]));rpcDb[_0xb549('0x60')](_0x39f5e7,_0xb549('0x61'));}else{ut[_0xb549('0x5b')](_0x39f5e7,0x16,_0xb549('0x62'));rpcDb[_0xb549('0x60')](_0x39f5e7,'[HistoryRecallClose]');rpcDb[_0xb549('0x63')](_0x39f5e7,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xb549('0x54')](_0xb549('0x64')));};Preview[_0xb549('0xd')]['setMessage']=function(_0x50d885){_0x50d885[_0xb549('0x24')]=!![];if(ut[_0xb549('0x65')](_0x50d885['loggedIn'])){_0x50d885[_0xb549('0x29')]=utils[_0xb549('0x2a')][_0xb549('0x66')];}else if(!ut[_0xb549('0x67')](_0x50d885[_0xb549('0x68')])){_0x50d885[_0xb549('0x29')]=utils[_0xb549('0x2a')][_0xb549('0x69')];}else if(!this[_0xb549('0x6a')](_0x50d885[_0xb549('0x6b')])){if(!this[_0xb549('0x6a')](_0x50d885[_0xb549('0x6c')])){_0x50d885['message']=utils[_0xb549('0x2a')][_0xb549('0x6d')];}else{_0x50d885[_0xb549('0x29')]=utils[_0xb549('0x2a')][_0xb549('0x6e')];}}else{_0x50d885[_0xb549('0x29')]=utils[_0xb549('0x2a')]['ACTIVE'];}};Preview[_0xb549('0xd')][_0xb549('0x6f')]=function(_0x43cee9,_0x595ad0,_0x47804f){var _0x470477=this;var _0x38f8ad=this[_0xb549('0x13')][_0x595ad0];var _0x9c81de=this['campaignsPreview'][_0x38f8ad[_0xb549('0x3f')]];var _0x5d06af;var _0x57a3e6=![];var _0x46cd31=0x2;var _0x4123ad=0x3;if(_0x9c81de){switch(_0x47804f){case'1':_0x9c81de['outboundNoSuchCallsDay']+=0x1;_0x38f8ad['countnosuchnumberretry']+=0x1;_0x38f8ad['countglobal']=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0x0,_0xb549('0x71'));ami[_0xb549('0x72')](_0xb549('0x73'),ut[_0xb549('0x74')](_0x38f8ad,_0xb549('0x75')));rpcDb[_0xb549('0x60')](_0x38f8ad,'[callProgressDetectingCustomer][logNoSuch]');_0x470477[_0xb549('0x76')](_0x38f8ad,'0',_0x9c81de)['then'](function(_0xf7c093){_0x57a3e6=_0xf7c093[_0xb549('0x77')]==0x1;_0x46cd31=_0x9c81de[_0xb549('0x78')];_0x4123ad=_0x9c81de[_0xb549('0x79')];if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de[_0xb549('0x7a')]){_0x5d06af=ut[_0xb549('0x7b')](_0x38f8ad,0xf,'Global');rpcDb['createCustomerFinal'](_0x5d06af,_0xb549('0x7c'));}else{if(_0x38f8ad['countnosuchnumberretry']>=_0x9c81de[_0xb549('0x7d')]){rpcDb[_0xb549('0x63')](_0x38f8ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xb549('0x7e')](ut[_0xb549('0x7f')](_0x38f8ad,_0xb549('0x80'),_0x9c81de[_0xb549('0x78')]),_0x38f8ad[_0xb549('0x81')],_0x38f8ad[_0xb549('0x82')]);}}delete this[_0xb549('0x13')][_0x43cee9['linkedid']];}else{_0x38f8ad[_0xb549('0x80')]++;logger[_0xb549('0x3c')]('actioncountonusuch',_0x38f8ad[_0xb549('0x80')]);logger[_0xb549('0x3c')]('id',_0x38f8ad[_0xb549('0x83')]);_0x470477[_0xb549('0x84')]({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countnosuchnumberretry':_0x38f8ad[_0xb549('0x80')]}})[_0xb549('0x53')](function(){_0x470477['swapAdditionalPhones'](_0x38f8ad,_0x46cd31,_0x4123ad)['then'](function(){});});}});break;case _0xb549('0x85'):var _0x45e690=moment()[_0xb549('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x38f8ad['responsetime']=_0x45e690;_0x38f8ad['answertime']=_0x45e690;_0x38f8ad[_0xb549('0x41')]=!![];_0x9c81de['pTalking']+=0x1;logger['info'](_0xb549('0x86'),_0x38f8ad['uniqueid'],_0xb549('0x87'),_0x9c81de['name'],_0xb549('0x40'),_0x9c81de[_0xb549('0x26')]);ami['emit'](_0xb549('0x88'),ut['buildObj'](_0x38f8ad,_0xb549('0x89'),this[_0xb549('0x11')][_0x38f8ad[_0xb549('0x3f')]]));if(_0x9c81de[_0xb549('0x8a')]){ami['emit'](_0xb549('0x8b'),ut[_0xb549('0x8c')](_0x38f8ad));}break;case'16':ami[_0xb549('0x72')]('custom:agentcomplete',ut[_0xb549('0x74')](_0x38f8ad,_0xb549('0x8d'),this[_0xb549('0x11')][_0x38f8ad[_0xb549('0x3f')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x38f8ad,_0xb549('0x8d')));_0x9c81de[_0xb549('0x8e')]+=0x1;_0x9c81de[_0xb549('0x8f')]+=0x1;_0x9c81de[_0xb549('0x90')]+=0x1;ut['decrementTalkink'](_0x9c81de,_0xb549('0x91'));_0x38f8ad[_0xb549('0x92')]=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0x4,_0xb549('0x93'));rpcDb[_0xb549('0x60')](_0x38f8ad,_0xb549('0x94'));rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0x95'));rpcDb[_0xb549('0x96')](_0x38f8ad);_0x9c81de[_0xb549('0x97')]+=_0x38f8ad['talktime'];_0x9c81de[_0xb549('0x98')]+=_0x38f8ad[_0xb549('0x99')];logger[_0xb549('0x3c')](_0xb549('0x9a'),_0x38f8ad[_0xb549('0x9b')],_0xb549('0x87'),_0x9c81de[_0xb549('0x22')],_0xb549('0x40'),_0x9c81de[_0xb549('0x26')]);delete this[_0xb549('0x13')][_0x43cee9[_0xb549('0x9c')]];break;case'BUSY':_0x9c81de[_0xb549('0x9d')]+=0x1;_0x38f8ad[_0xb549('0x9e')]+=0x1;_0x38f8ad[_0xb549('0x92')]=ut['totalGlobal'](_0x38f8ad);ut['logCustomer'](_0x38f8ad,0x5,'Busy');_0x46cd31=_0x9c81de['dialBusyRetryFrequency'];_0x4123ad=_0x9c81de[_0xb549('0x79')];ami[_0xb549('0x72')](_0xb549('0x9f'),ut['buildObj'](_0x38f8ad,_0xb549('0xa0')));rpcDb[_0xb549('0x60')](_0x38f8ad,_0xb549('0xa1'));_0x470477['verifyAdditionalPhones'](_0x38f8ad,'5',_0x9c81de)[_0xb549('0x53')](function(_0x1688e3){_0x57a3e6=_0x1688e3[_0xb549('0x77')]==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de[_0xb549('0x7a')]){_0x5d06af=ut[_0xb549('0x7b')](_0x38f8ad,0xf,_0xb549('0xa2'));rpcDb[_0xb549('0x63')](_0x5d06af,_0xb549('0xa3'));}else{if(_0x38f8ad[_0xb549('0x9e')]>=_0x9c81de[_0xb549('0xa4')]){rpcDb['createCustomerFinal'](_0x38f8ad,_0xb549('0xa1'));}else{rpcDb['rescheduleContact'](ut[_0xb549('0x7f')](_0x38f8ad,_0xb549('0x9e'),_0x9c81de['dialBusyRetryFrequency']),_0x38f8ad[_0xb549('0x81')],_0x38f8ad[_0xb549('0x82')]);}}}else{_0x38f8ad[_0xb549('0x9e')]++;_0x470477[_0xb549('0x84')]({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countbusyretry':_0x38f8ad[_0xb549('0x9e')]}})['then'](function(){_0x470477[_0xb549('0xa5')](_0x38f8ad,_0x46cd31,_0x4123ad)['then'](function(){});});}});break;case _0xb549('0xa6'):_0x9c81de[_0xb549('0xa7')]+=0x1;_0x38f8ad[_0xb549('0xa8')]+=0x1;_0x38f8ad['countglobal']=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0x3,_0xb549('0xa9'));_0x46cd31=_0x9c81de[_0xb549('0xaa')];_0x4123ad=_0x9c81de[_0xb549('0x79')];var _0x354111=ut[_0xb549('0xab')](_0x38f8ad,_0x9c81de);ami[_0xb549('0x72')](_0xb549('0xac'),_0x354111);rpcDb['createCustomerHistory'](_0x38f8ad,_0xb549('0xad'));_0x470477[_0xb549('0x76')](_0x38f8ad,'3',_0x9c81de)[_0xb549('0x53')](function(_0x5a849d){_0x57a3e6=_0x5a849d[_0xb549('0x77')]==0x1;if(!_0x57a3e6){if(ut['totalGlobal'](_0x38f8ad)>=_0x9c81de['dialGlobalMaxRetry']){_0x5d06af=ut[_0xb549('0x7b')](_0x38f8ad,0xf,'Global');rpcDb[_0xb549('0x63')](_0x5d06af,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x38f8ad[_0xb549('0xa8')]>=_0x9c81de[_0xb549('0xae')]){rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0xad'));}else{rpcDb['rescheduleContact'](ut[_0xb549('0x7f')](_0x38f8ad,_0xb549('0xa8'),_0x9c81de[_0xb549('0xaa')]),_0x38f8ad[_0xb549('0x81')],_0x38f8ad[_0xb549('0x82')]);}}}else{_0x38f8ad[_0xb549('0xa8')]++;_0x470477[_0xb549('0x84')]({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countnoanswerretry':_0x38f8ad[_0xb549('0xa8')]}})[_0xb549('0x53')](function(){_0x470477[_0xb549('0xa5')](_0x38f8ad,_0x46cd31,_0x4123ad)[_0xb549('0x53')](function(){});});}});break;case _0xb549('0xaf'):_0x9c81de[_0xb549('0xb0')]+=0x1;_0x38f8ad['countcongestionretry']+=0x1;_0x38f8ad[_0xb549('0x92')]=ut[_0xb549('0x70')](_0x38f8ad);ut['logCustomer'](_0x38f8ad,0x8,_0xb549('0xb1'));_0x46cd31=_0x9c81de[_0xb549('0xb2')];_0x4123ad=_0x9c81de[_0xb549('0x79')];ami['emit'](_0xb549('0xb3'),ut[_0xb549('0x74')](_0x38f8ad,_0xb549('0xb4')));rpcDb[_0xb549('0x60')](_0x38f8ad,_0xb549('0xb5'));_0x470477[_0xb549('0x76')](_0x38f8ad,'8',_0x9c81de)[_0xb549('0x53')](function(_0x166d0d){_0x57a3e6=_0x166d0d[_0xb549('0x77')]==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de[_0xb549('0x7a')]){_0x5d06af=ut['cloneAction'](_0x38f8ad,0xf,_0xb549('0xa2'));rpcDb[_0xb549('0x63')](_0x5d06af,_0xb549('0xb6'));}else{if(_0x38f8ad[_0xb549('0xb7')]>=_0x9c81de['dialCongestionMaxRetry']){rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0xb5'));}else{rpcDb[_0xb549('0x7e')](ut['scheduledAt'](_0x38f8ad,_0xb549('0xb7'),_0x9c81de[_0xb549('0xb8')]),_0x38f8ad[_0xb549('0x81')],_0x38f8ad[_0xb549('0x82')]);}}}else{_0x38f8ad[_0xb549('0xb7')]++;_0x470477[_0xb549('0x84')]({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countcongestionretry':_0x38f8ad['countcongestionretry']}})[_0xb549('0x53')](function(){_0x470477[_0xb549('0xa5')](_0x38f8ad,_0x46cd31,_0x4123ad)['then'](function(){});});}});break;case _0xb549('0xb9'):_0x9c81de[_0xb549('0xba')]+=0x1;_0x38f8ad[_0xb549('0xbb')]+=0x1;_0x38f8ad[_0xb549('0x92')]=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0x14,'AgentReject');_0x46cd31=_0x9c81de[_0xb549('0xbc')];_0x4123ad=_0x9c81de[_0xb549('0x79')];ami[_0xb549('0x72')](_0xb549('0xbd'),ut['buildObj'](_0x38f8ad,_0xb549('0xbe')));rpcDb[_0xb549('0x60')](_0x38f8ad,_0xb549('0xbf'));_0x470477[_0xb549('0x76')](_0x38f8ad,'20',_0x9c81de)['then'](function(_0xd340d1){_0x57a3e6=_0xd340d1[_0xb549('0x77')]==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de[_0xb549('0x7a')]){_0x5d06af=ut[_0xb549('0x7b')](_0x38f8ad,0x14,_0xb549('0xc0'));rpcDb[_0xb549('0x63')](_0x5d06af,_0xb549('0xc1'));}else{if(_0x38f8ad[_0xb549('0xbb')]>=_0x9c81de[_0xb549('0xc2')]){rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0xc1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x38f8ad,_0xb549('0xbb'),_0x9c81de[_0xb549('0xbc')]),_0x38f8ad[_0xb549('0x81')],_0x38f8ad[_0xb549('0x82')]);}}}else{_0x38f8ad[_0xb549('0xa8')]++;_0x470477[_0xb549('0x84')]({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countnoanswerretry':_0x38f8ad['countnoanswerretry']}})[_0xb549('0x53')](function(){_0x470477[_0xb549('0xa5')](_0x38f8ad,_0x46cd31,_0x4123ad)[_0xb549('0x53')](function(){});});}});break;case _0xb549('0xc3'):_0x9c81de[_0xb549('0xc4')]+=0x1;_0x38f8ad[_0xb549('0xc5')]+=0x1;_0x38f8ad[_0xb549('0x92')]=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0xb,_0xb549('0xc6'));rpcDb['createCustomerHistory'](_0x38f8ad,_0xb549('0xc7'));_0x470477[_0xb549('0x76')](_0x38f8ad,'11',_0x9c81de)['then'](function(_0x31f45){_0x57a3e6=_0x31f45['additional']==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de['dialGlobalMaxRetry']){_0x5d06af=ut[_0xb549('0x7b')](_0x38f8ad,0xf,'Global');rpcDb[_0xb549('0x63')](_0x5d06af,_0xb549('0xc7'));}else{if(_0x38f8ad[_0xb549('0xc8')]>=_0x9c81de[_0xb549('0xc9')]){rpcDb[_0xb549('0x63')](_0x38f8ad,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb549('0x7e')](ut[_0xb549('0x7f')](_0x38f8ad,_0xb549('0xc5'),_0x9c81de[_0xb549('0xca')]),_0x38f8ad['unlockAgent'],_0x38f8ad[_0xb549('0x82')]);}}}else{_0x38f8ad[_0xb549('0xa8')]++;_0x470477['incrementPreviewCounters']({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countnoanswerretry':_0x38f8ad[_0xb549('0xa8')]}})[_0xb549('0x53')](function(){_0x470477['swapAdditionalPhones'](_0x38f8ad,_0x46cd31,_0x4123ad)[_0xb549('0x53')](function(){});});}});break;case'18':_0x9c81de['outboundUnknownCallsDay']+=0x1;_0x38f8ad[_0xb549('0xcb')]+=0x1;_0x38f8ad[_0xb549('0x92')]=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0x12,_0x43cee9['cause-txt']||_0x43cee9['dialstatus']);ami['emit'](_0xb549('0xcc'),ut[_0xb549('0x74')](_0x38f8ad,'amd'));rpcDb['createCustomerHistory'](_0x38f8ad,_0xb549('0xcd'));_0x470477[_0xb549('0x76')](_0x38f8ad,'18',_0x9c81de)[_0xb549('0x53')](function(_0x75be1d){_0x57a3e6=_0x75be1d['additional']==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de[_0xb549('0x7a')]){_0x5d06af=ut[_0xb549('0x7b')](_0x38f8ad,0x12,_0xb549('0xa2'));rpcDb[_0xb549('0x63')](_0x5d06af,_0xb549('0xcd'));}else{rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0xcd'));}}else{_0x38f8ad[_0xb549('0xa8')]++;_0x470477[_0xb549('0x84')]({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countnoanswerretry':_0x38f8ad[_0xb549('0xa8')]}})[_0xb549('0x53')](function(){_0x470477[_0xb549('0xa5')](_0x38f8ad,_0x46cd31,_0x4123ad)['then'](function(){});});}});delete this[_0xb549('0x13')][_0x43cee9[_0xb549('0x9c')]];break;case'19':_0x9c81de['outboundUnknownCallsDay']+=0x1;_0x38f8ad[_0xb549('0x92')]=ut[_0xb549('0x70')](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0x13,_0x43cee9[_0xb549('0xce')]||_0x43cee9['dialstatus']);ami[_0xb549('0x72')](_0xb549('0xcc'),ut[_0xb549('0x74')](_0x38f8ad,_0xb549('0xcf')));rpcDb[_0xb549('0x60')](_0x38f8ad,_0xb549('0xd0'));_0x470477[_0xb549('0x76')](_0x38f8ad,'18',_0x9c81de)[_0xb549('0x53')](function(_0x1b9f7c){_0x57a3e6=_0x1b9f7c[_0xb549('0x77')]==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de['dialGlobalMaxRetry']){_0x5d06af=ut['cloneAction'](_0x38f8ad,0xf,_0xb549('0xa2'));rpcDb['createCustomerFinal'](_0x5d06af,_0xb549('0xd0'));}else{rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0xd0'));}}else{_0x38f8ad[_0xb549('0xa8')]++;_0x470477['incrementPreviewCounters']({'id':_0x38f8ad[_0xb549('0x83')],'field':{'countnoanswerretry':_0x38f8ad[_0xb549('0xa8')]}})[_0xb549('0x53')](function(){_0x470477['swapAdditionalPhones'](_0x38f8ad,_0x46cd31,_0x4123ad)[_0xb549('0x53')](function(){});});}});delete this[_0xb549('0x13')][_0x43cee9[_0xb549('0x9c')]];break;default:if(_0x38f8ad['dialAnswer']){ut['decrementTalkink'](_0x9c81de,_0xb549('0xd1'));ut[_0xb549('0xd2')](_0xb549('0xd3')+_0x9c81de[_0xb549('0x22')],_0x43cee9);}_0x9c81de[_0xb549('0xd4')]+=0x1;_0x38f8ad[_0xb549('0x92')]=ut['totalGlobal'](_0x38f8ad);ut[_0xb549('0x5b')](_0x38f8ad,0xc,_0x43cee9[_0xb549('0xce')]||_0x43cee9['dialstatus']);_0x46cd31=_0x9c81de['dialAgentRejectRetryFrequency'];_0x4123ad=_0x9c81de[_0xb549('0x79')];rpcDb['createCustomerHistory'](_0x38f8ad,_0xb549('0xd5'));_0x470477[_0xb549('0x76')](_0x38f8ad,'20',_0x9c81de)['then'](function(_0x50daf6){_0x57a3e6=_0x50daf6[_0xb549('0x77')]==0x1;if(!_0x57a3e6){if(ut[_0xb549('0x70')](_0x38f8ad)>=_0x9c81de[_0xb549('0x7a')]){_0x5d06af=ut['cloneAction'](_0x38f8ad,0xf,_0xb549('0xa2'));rpcDb[_0xb549('0x63')](_0x5d06af,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xb549('0x63')](_0x38f8ad,_0xb549('0xd6'));}delete this[_0xb549('0x13')][_0x43cee9[_0xb549('0x9c')]];}else{_0x470477[_0xb549('0xa5')](_0x38f8ad,_0x46cd31,_0x4123ad)[_0xb549('0x53')](function(){});}});}if(!(_0x38f8ad[_0xb549('0x41')]&&_0x47804f==='16')){ut[_0xb549('0x49')](_0x9c81de,'[callProgressDetectingCustomer]');logger['info'](_0xb549('0xd7'),_0x38f8ad[_0xb549('0x9b')],'\x20Queue',_0x9c81de[_0xb549('0x22')],'originated:\x20',_0x9c81de[_0xb549('0x25')]);}if(_0x47804f!==_0xb549('0x85')){delete this[_0xb549('0x13')][_0x43cee9[_0xb549('0x9c')]];delete this[_0xb549('0x13')][_0x43cee9['destlinkedid']];}_0x9c81de['queueSummaryCountersUpdated']=!![];}};Preview[_0xb549('0xd')][_0xb549('0xd8')]=function(_0x2f4e30,_0x2ca2e9,_0x436424){if(_[_0xb549('0xd9')](_0x2ca2e9)&&_0xb549('0xda')!==typeof _0x2ca2e9){return;}if(_[_0xb549('0xd9')](_0x436424)&&_0xb549('0xda')!==typeof _0x436424){return;}switch(_0x436424[_0xb549('0xdb')]){case'0':ut[_0xb549('0xdc')](_0x2f4e30,0x0,_0xb549('0x71'));rpcDb[_0xb549('0xdd')](_0x2f4e30,_0xb549('0xde'));break;case'3':ut[_0xb549('0xdc')](_0x2f4e30,0x3,'NoAnswer');rpcDb[_0xb549('0xdd')](_0x2f4e30,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb549('0xdc')](_0x2f4e30,0x5,'Busy');rpcDb['createAgentHistory'](_0x2f4e30,_0xb549('0xdf'));break;case'8':ut[_0xb549('0xdc')](_0x2f4e30,0x8,_0xb549('0xb1'));rpcDb[_0xb549('0xdd')](_0x2f4e30,_0xb549('0xe0'));break;case'22':ut['logAgent'](_0x2f4e30,0x16,_0xb549('0xe1'));rpcDb[_0xb549('0xdd')](_0x2f4e30,_0xb549('0xe2'));break;default:ut['logAgent'](_0x2f4e30,0xc,_0x436424['reason']);rpcDb[_0xb549('0xdd')](_0x2f4e30,_0xb549('0xe0'));}ut[_0xb549('0x49')](_0x2ca2e9,'[callProgressDetectingAgent]');logger[_0xb549('0x3c')](_0xb549('0xe3'),_0x2f4e30[_0xb549('0x9b')],_0xb549('0x87'),_0x2ca2e9[_0xb549('0x22')],_0xb549('0xe4'),_0x2ca2e9[_0xb549('0x25')]);delete this[_0xb549('0x13')][_0x2f4e30['uniqueid']];};Preview[_0xb549('0xd')][_0xb549('0x76')]=function(_0x4c76cc,_0x314512,_0x29cb1a){return cmHopperAdditionalPhone[_0xb549('0x76')](_0x4c76cc,_0x314512,_0x29cb1a)['catch'](logger[_0xb549('0x3c')](_0xb549('0xe5')));};Preview[_0xb549('0xd')][_0xb549('0xa5')]=function(_0x34be7d,_0x502122,_0x178a36){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x34be7d,_0x502122,_0x178a36)[_0xb549('0x56')](logger[_0xb549('0x3c')](_0xb549('0xe6')));};Preview[_0xb549('0xd')][_0xb549('0x84')]=function(_0x5a0676){return Promise[_0xb549('0xe7')]()['then'](cmHopperAdditionalPhone[_0xb549('0x84')](_0x5a0676))[_0xb549('0x56')](logger[_0xb549('0x3c')](_0xb549('0xe8')));};Preview['prototype'][_0xb549('0xe9')]=function(_0x5e2b03,_0x4701b1,_0x516f87,_0x2e0da4,_0x44c574){var _0x13e75d=this;return new Promise(function(_0x250e29,_0x40938d){if(_['isNil'](_0x4701b1)||_[_0xb549('0x3b')](_0x4701b1[_0xb549('0xea')])||_[_0xb549('0x3b')](_0x4701b1[_0xb549('0xeb')])||_[_0xb549('0x3b')](_0x4701b1[_0xb549('0xec')])){_0x40938d(ut['message']('Contact\x20is\x20undefined',_0x2e0da4,_0x44c574));return;}var _0x8f6fc4=uuid['v4']();var _0x2ac188=_0x13e75d[_0xb549('0x11')][_0x4701b1[_0xb549('0xed')][_0xb549('0x22')]];var _0x5369b1=_0x516f87?_0x13e75d[_0xb549('0x14')][_0x516f87]['id']:undefined;_0x13e75d[_0xb549('0x13')][_0x8f6fc4]=new Action(_0x4701b1,_0x2ac188,_0x8f6fc4,_0x516f87,_0x5369b1);var _0x5d916b=_0x13e75d['actions'][_0x8f6fc4];_0x5d916b['unlockAgent']=_0x2e0da4;_0x5d916b[_0xb549('0x82')]=_0x44c574;_0x5d916b[_0xb549('0xee')]=_0x516f87;if(_[_0xb549('0xef')](_0x5e2b03)){_0x13e75d[_0xb549('0xf0')](_0x5d916b,_0x2ac188,_0x4701b1,_0x516f87)[_0xb549('0x53')](function(_0x2a3241){logger[_0xb549('0x3c')]('[Preview][execCall][success]','Queue:\x20'+_0x5d916b[_0xb549('0x3f')]+_0xb549('0xf1')+_0x5d916b[_0xb549('0x83')],JSON[_0xb549('0x3e')](_0x2a3241));ami['emit'](_0xb549('0xf2'),ut['buildObj'](_0x5d916b,'called',_0x13e75d['campaignsPreview'][_0x5d916b[_0xb549('0x3f')]]));_0x250e29(ut['message'](_0xb549('0xf3')));})[_0xb549('0x56')](function(_0xd21278){ut['logger'](_0xb549('0xf4'),_0xd21278);_0x40938d(ut['message'](_0xb549('0xf5'),_0x2e0da4,_0x44c574));});}else{_0x2ac188[_0xb549('0xf6')]+=0x1;ut[_0xb549('0xf7')](_0x5d916b);rpcDb[_0xb549('0xf8')](_0x5d916b,_0xb549('0xf9'));delete _0x13e75d[_0xb549('0x13')][_0x8f6fc4];_0x40938d(ut['message'](_0xb549('0xfa'),_0x2e0da4,_0x44c574));}});};Preview['prototype'][_0xb549('0x6a')]=function(_0x4b6e14){return!_[_0xb549('0x3b')](_0x4b6e14)&&!_['isNil'](_0x4b6e14[_0xb549('0x22')])&&!_[_0xb549('0x3b')](_0x4b6e14[_0xb549('0xfb')])&&_0x4b6e14['active']&&!_[_0xb549('0x3b')](this['trunks'][util[_0xb549('0x59')]('SIP/%s',_0x4b6e14[_0xb549('0x22')])])&&!_[_0xb549('0x3b')](this['trunks'][util[_0xb549('0x59')](_0xb549('0xfc'),_0x4b6e14['name'])]['status'])&&(this[_0xb549('0x12')][util[_0xb549('0x59')]('SIP/%s',_0x4b6e14['name'])][_0xb549('0x46')]===_0xb549('0xfd')||this[_0xb549('0x12')][util[_0xb549('0x59')](_0xb549('0xfc'),_0x4b6e14['name'])][_0xb549('0x46')]===_0xb549('0xfe'));};Preview[_0xb549('0xd')][_0xb549('0x52')]=function(_0x3833de,_0x431694){return this[_0xb549('0xff')](_0x3833de,_0x431694)[_0xb549('0x53')](function(_0x2fe986){return _['pick'](_0x2fe986,[_0xb549('0x29')]);})['catch'](function(_0x34d59b){if(_0x34d59b[_0xb549('0x100')]){rpcDb[_0xb549('0x101')](_0x3833de);}if(_0x34d59b['active']){rpcDb['disableContact'](_0x3833de);}throw _['pick'](_0x34d59b,['message']);});};Preview[_0xb549('0xd')]['execRun']=function(_0x569846,_0x10c537){var _0x2b8f29=this;var _0x28f739,_0x216ce5;return rpcDb[_0xb549('0x102')](_0x569846)[_0xb549('0x53')](function(_0x4c5336){if(!_[_0xb549('0x3b')](_0x4c5336[0x0])){_0x216ce5=_0x4c5336[0x0][_0xb549('0x103')]?![]:!![];_0x28f739=_0x4c5336[0x0][_0xb549('0x103')]?!![]:![];_0x28f739=_0x10c537?!![]:_0x28f739;}var _0x46e79b=_0x2b8f29[_0xb549('0x104')](_0x4c5336);if(_0x46e79b[_0xb549('0x105')]){rpcDb[_0xb549('0x106')](_[_0xb549('0x42')](_0x4c5336[0x0],['VoiceQueueId','phone']))['then'](function(_0x22c216){_0x2b8f29[_0xb549('0xe9')](_0x22c216,_0x4c5336[0x0],_0x10c537,_0x216ce5,_0x28f739)['then'](function(_0x2768b7){return _0x2768b7;})['catch'](function(_0x1beaeb){throw _0x1beaeb;});})['catch'](function(_0x12ec81){ut['logger']('[Preview][checkIsBlackList]',_0x12ec81);throw ut['message'](_0xb549('0x107'),_0x216ce5,_0x28f739);});}else{throw ut[_0xb549('0x29')](_0x46e79b[_0xb549('0x29')],_0x216ce5,_0x28f739);}})[_0xb549('0x56')](function(_0x1e9227){ut[_0xb549('0x2b')]('[Preview][getContactPreview]',_0x1e9227);throw ut[_0xb549('0x29')](_0xb549('0x107'),![],!![]);});};Preview['prototype']['validateContact']=function(_0x5cb02d){if(_['isNil'](_0x5cb02d)||_[_0xb549('0xef')](_0x5cb02d)||!_[_0xb549('0x3b')](_0x5cb02d[0x0][_0xb549('0x51')])&&_['isNil'](_0x5cb02d[0x0][_0xb549('0x51')]['name'])){ut[_0xb549('0x2b')](_0xb549('0x108'),_0x5cb02d);return{'isValid':![],'message':_0xb549('0x109')};}var _0x5374c2=this[_0xb549('0x11')][_0x5cb02d[0x0][_0xb549('0xed')][_0xb549('0x22')]];_0x5374c2[_0xb549('0x29')]=utils[_0xb549('0x2a')]['ACTIVE'];if(_['isNil'](_0x5374c2)){ut[_0xb549('0x2b')](_0xb549('0x10a'),_0x5374c2);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xb549('0x6a')](_0x5374c2[_0xb549('0x6b')])){ut['logger'](_0xb549('0x10b'),'campaign\x20Name:\x20'+_0x5374c2[_0xb549('0x22')]+_0xb549('0x10c'));if(!this[_0xb549('0x6a')](_0x5374c2[_0xb549('0x6c')])){ut['logger'](_0xb549('0x10b'),_0x5374c2[_0xb549('0x22')]+_0xb549('0x10d'));return{'isValid':![],'message':_0xb549('0x10e')};}}if(!ut['isActive'](_0x5374c2[_0xb549('0x68')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x5374c2[_0xb549('0x22')]+_0xb549('0x10f'));return{'isValid':![],'message':_0xb549('0x110')+_0x5374c2[_0xb549('0x22')]+_0xb549('0x10f')};}return{'isValid':!![],'message':_0xb549('0x111')};};Preview[_0xb549('0xd')]['execCall']=function(_0x4a7a66,_0x51d4de,_0x401ae8,_0x12b8ca){var _0x543aa6=this;return new Promise(function(_0x88dbff,_0x181e98){var _0x5f00aa=_0x4a7a66[_0xb549('0x9b')];var _0x31b1eb=_0x543aa6[_0xb549('0x6a')](_0x51d4de[_0xb549('0x6b')])?util[_0xb549('0x59')](_0xb549('0x112'),_0x51d4de[_0xb549('0x6b')][_0xb549('0x22')],_['isNil'](_0x51d4de[_0xb549('0x113')])?'':_0x51d4de[_0xb549('0x113')][_0xb549('0x114')]()||'',_0x51d4de[_0xb549('0x115')]>0x0?_0x401ae8[_0xb549('0xeb')]['substring'](_0x51d4de[_0xb549('0x115')]):_0x401ae8[_0xb549('0xeb')]):util[_0xb549('0x59')](_0xb549('0x112'),_[_0xb549('0x3b')](_0x51d4de[_0xb549('0x6c')])?_0x51d4de['Trunk']['name']:_0x51d4de[_0xb549('0x6c')][_0xb549('0x22')],_[_0xb549('0x3b')](_0x51d4de[_0xb549('0x113')])?'':_0x51d4de['dialPrefix'][_0xb549('0x114')]()||'',_0x51d4de['dialCutDigit']>0x0?_0x401ae8[_0xb549('0xeb')]['substring'](_0x51d4de['dialCutDigit']):_0x401ae8[_0xb549('0xeb')]);var _0x4c2200=_0x543aa6[_0xb549('0x6a')](_0x51d4de['Trunk'])?ut[_0xb549('0x116')](_0x51d4de['Trunk'][_0xb549('0x117')],_0x51d4de[_0xb549('0x118')],_0x51d4de[_0xb549('0x119')]>0x0?ut[_0xb549('0x11a')](_0x51d4de[_0xb549('0x11b')],_0x51d4de[_0xb549('0x119')]):_0x51d4de[_0xb549('0x11b')]):ut[_0xb549('0x116')](_[_0xb549('0x3b')](_0x51d4de['TrunkBackup'])?_0x51d4de[_0xb549('0x6b')]['callerid']:_0x51d4de[_0xb549('0x6c')][_0xb549('0x117')],_0x51d4de[_0xb549('0x118')],_0x51d4de['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x51d4de[_0xb549('0x11b')],_0x51d4de[_0xb549('0x119')]):_0x51d4de['dialOriginateCallerIdNumber']);if(_0x4c2200){_0x4a7a66[_0xb549('0x11c')]=ut[_0xb549('0x11d')](_0x4c2200);_0x4a7a66[_0xb549('0x11e')]=ut[_0xb549('0x11f')](_0x4c2200);}var _0xef47e9=ut['addVariables'](_0x51d4de,_0x401ae8,_0x31b1eb,_0x4c2200,_0x5f00aa,_0x4a7a66);var _0x392c71=utils['setXMDContactVariables'](_0x401ae8['Contact']);Object['assign'](_0xef47e9,_0x392c71);_['merge'](_0x4a7a66,ut[_0xb549('0x120')](_0xef47e9));_0x4a7a66['starttime']=moment()['format'](_0xb549('0x5a'));_0x51d4de[_0xb549('0x121')]=_0xef47e9;var _0x41479e=ut['variablesAction'](_0x4a7a66,_0x51d4de,_0xef47e9,_0x4a7a66[_0xb549('0x82')],_0x12b8ca);return ami[_0xb549('0x122')](_0x41479e)[_0xb549('0x53')](function(_0x5b9a1a){_0x51d4de['originated']+=0x1;logger[_0xb549('0x3c')](_0xb549('0x123'),_0x5f00aa,_0xb549('0x87'),_0x51d4de[_0xb549('0x22')],'originated:\x20',_0x51d4de[_0xb549('0x25')]);_0x88dbff(_0x5b9a1a);})[_0xb549('0x56')](function(_0x59fa3f){ut[_0xb549('0xdc')](_0x4a7a66,0xe,_0xb549('0x124'));rpcDb[_0xb549('0xdd')](_0x4a7a66,'[originateFailure][logOriginateFailure]');_0x181e98(_0x59fa3f);});});};Preview['prototype'][_0xb549('0x1c')]=function(_0x243fcc){if(this[_0xb549('0x13')][_0x243fcc['linkedid']]){this['actions'][_0x243fcc[_0xb549('0x9c')]][_0xb549('0x47')]=_0x243fcc[_0xb549('0x47')];}};Preview[_0xb549('0xd')]['syncOriginateResponse']=function(_0x3808e9){var _0x253519=this;var _0x1c87cc=this[_0xb549('0x13')][_0x3808e9[_0xb549('0x125')]];if(_0x1c87cc){if(_0x1c87cc[_0xb549('0xee')]&&this[_0xb549('0x14')][_0x1c87cc['lookAgent']]){ut[_0xb549('0x126')](_0x1c87cc,this[_0xb549('0x14')][_0x1c87cc[_0xb549('0xee')]][_0xb549('0x22')],this[_0xb549('0x14')][_0x1c87cc[_0xb549('0xee')]]['id']);}var _0x20a963=_[_0xb549('0x127')](_0x1c87cc);_0x20a963[_0xb549('0x128')]=moment()['format'](_0xb549('0x5a'));var _0x2dc726=_0x253519[_0xb549('0x11')][_0x1c87cc[_0xb549('0x3f')]];if(ut[_0xb549('0x129')](_0x3808e9[_0xb549('0x12a')])){if(_0x1c87cc[_0xb549('0x81')]){rpcDb[_0xb549('0x101')](_0x1c87cc[_0xb549('0x83')]);}if(_0x1c87cc[_0xb549('0x82')]){rpcDb[_0xb549('0x57')](_0x1c87cc[_0xb549('0x83')]);}ami['emit'](_0xb549('0x12b'),ut[_0xb549('0x74')](_0x1c87cc,'rejected',this[_0xb549('0x11')][_0x1c87cc[_0xb549('0x3f')]]));this[_0xb549('0xd8')](_0x20a963,_0x2dc726,_0x3808e9);}else{_0x1c87cc[_0xb549('0x58')]=moment()[_0xb549('0x59')](_0xb549('0x5a'));ut[_0xb549('0xdc')](_0x20a963,0x4,_0xb549('0x93'));rpcDb[_0xb549('0xdd')](_0x20a963,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0xb549('0x16')]=function(_0x433d51){var _0x3cc97e=this['actions'][_0x433d51[_0xb549('0x9c')]];var _0x2a99e4;if(_0x3cc97e){_0x2a99e4=this[_0xb549('0x11')][_0x3cc97e[_0xb549('0x3f')]];logger[_0xb549('0x3c')](_0xb549('0x12c'),_0x433d51[_0xb549('0x9c')],_0xb549('0x87'),_0x2a99e4['name'],'pTalking:\x20',_0x2a99e4[_0xb549('0x26')]);}if(this[_0xb549('0x13')][_0x433d51[_0xb549('0x9c')]]&&_0x433d51['linkedid']!==_0x433d51['uniqueid']){if(_0x433d51[_0xb549('0x12d')]==='16'&&this[_0xb549('0x13')][_0x433d51[_0xb549('0x9c')]]['dialAnswer']){this[_0xb549('0x6f')](_0x433d51,_0x433d51[_0xb549('0x9c')],_0x433d51[_0xb549('0x12d')]);}else if(this['actions'][_0x433d51[_0xb549('0x9c')]]['dialAnswer']){logger['info'](_0xb549('0x12e'),_0x433d51[_0xb549('0x9c')],_0x433d51[_0xb549('0x12d')],_0xb549('0x87'),_0x2a99e4[_0xb549('0x22')],_0xb549('0x40'),_0x2a99e4[_0xb549('0x26')]);this[_0xb549('0x6f')](_0x433d51,_0x433d51[_0xb549('0x9c')],_0x433d51[_0xb549('0x12d')]);}}else if(_0x3cc97e&&_[_0xb549('0x3b')](_0x3cc97e[_0xb549('0x12f')])&&_0x2a99e4[_0xb549('0x130')]&&_0x433d51[_0xb549('0x9c')]===_0x433d51['uniqueid']&&_['isNil'](_0x433d51[_0xb549('0xdb')])&&_0x433d51[_0xb549('0x12d')]==='16'&&_0x433d51[_0xb549('0x131')]==='6'&&_[_0xb549('0xd9')](_0x3cc97e[_0xb549('0x132')])){if(_0x3cc97e[_0xb549('0x81')]){rpcDb[_0xb549('0x101')](_0x3cc97e[_0xb549('0x83')]);}if(_0x3cc97e[_0xb549('0x82')]){rpcDb[_0xb549('0x57')](_0x3cc97e['idContact']);}_0x433d51[_0xb549('0xdb')]='22';this[_0xb549('0xd8')](_0x3cc97e,_0x2a99e4,_0x433d51);}else if(_0x3cc97e&&_0x3cc97e[_0xb549('0x132')]){if(_0x433d51[_0xb549('0x12d')]==='16'&&this[_0xb549('0x13')][_0x433d51[_0xb549('0x9c')]][_0xb549('0x41')]){logger[_0xb549('0x3c')](_0xb549('0x133'),_0x433d51[_0xb549('0x9c')],_0x433d51['cause'],'\x20Queue',_0x2a99e4['name'],_0xb549('0x40'),_0x2a99e4['pTalking']);this[_0xb549('0x6f')](_0x433d51,_0x433d51[_0xb549('0x9c')],_0x433d51[_0xb549('0x12d')]);}else if(this['actions'][_0x433d51[_0xb549('0x9c')]][_0xb549('0x41')]){logger[_0xb549('0x3c')](_0xb549('0x12e'),_0x433d51[_0xb549('0x9c')],_0x433d51['cause'],_0xb549('0x87'),_0x2a99e4['name'],_0xb549('0x40'),_0x2a99e4['pTalking']);this[_0xb549('0x6f')](_0x433d51,_0x433d51[_0xb549('0x9c')],_0x433d51['cause']);}}};Preview[_0xb549('0xd')][_0xb549('0x1a')]=function(_0x5442c3){if(this['actions'][_0x5442c3['destlinkedid']]&&_0x5442c3['destlinkedid']!==_0x5442c3[_0xb549('0x134')]){this[_0xb549('0x6f')](_0x5442c3,_0x5442c3[_0xb549('0x135')],_0x5442c3[_0xb549('0x136')]);}};Preview['prototype'][_0xb549('0x19')]=function(_0x49352b){if(this[_0xb549('0x13')][_0x49352b[_0xb549('0x9c')]]&&_0x49352b[_0xb549('0x9c')]!==_0x49352b[_0xb549('0x9b')]&&!this[_0xb549('0x13')][_0x49352b['linkedid']][_0xb549('0x41')]){if(_0x49352b[_0xb549('0x12d')]==='1'){this[_0xb549('0x6f')](_0x49352b,_0x49352b[_0xb549('0x9c')],_0x49352b[_0xb549('0x12d')]);}}};Preview['prototype']['addVariable']=function(_0x409adf,_0x5c99e2,_0xcbdf4d){if(this['actions'][_0x409adf]){if(_[_0xb549('0x3b')](this[_0xb549('0x13')][_0x409adf][_0xb549('0x121')])){this[_0xb549('0x13')][_0x409adf][_0xb549('0x121')]={};}this[_0xb549('0x13')][_0x409adf][_0xb549('0x121')][_0x5c99e2]=_0xcbdf4d;}};Preview[_0xb549('0xd')][_0xb549('0x137')]=function(_0x2d9e23){try{if(!_[_0xb549('0x3b')](_0x2d9e23)){if(ut[_0xb549('0x138')](_[_0xb549('0x139')](_0x2d9e23[_0xb549('0x13a')])[0x0])){this['addVariable'](_0x2d9e23[_0xb549('0x9b')],_[_0xb549('0x139')](_0x2d9e23[_0xb549('0x13a')])[0x0],_0x2d9e23[_0xb549('0x13b')]);}}}catch(_0x357c1f){logger[_0xb549('0x13c')](_0xb549('0x13d'),util['inspect'](_0x357c1f,{'showHidden':![],'depth':null}));}};Preview[_0xb549('0xd')][_0xb549('0x13e')]=function(_0x1656a4){if(_0x1656a4){if(this[_0xb549('0x13')][_0x1656a4[_0xb549('0x13f')]]){this[_0xb549('0x13')][_0x1656a4[_0xb549('0x13f')]][_0xb549('0x132')]=!![];}}};Preview[_0xb549('0xd')][_0xb549('0x140')]=function(_0x3c71e6){if(_0x3c71e6){if(this['actions'][_0x3c71e6['transfererlinkedid']]){this['actions'][_0x3c71e6[_0xb549('0x141')]][_0xb549('0x132')]=!![];}}};module[_0xb549('0x142')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 52f2930..e6f2dbd 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 _0x5223=['getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','catch','[createHistory]\x20','then','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20'];(function(_0x2f135e,_0x13e230){var _0x535810=function(_0x185868){while(--_0x185868){_0x2f135e['push'](_0x2f135e['shift']());}};_0x535810(++_0x13e230);}(_0x5223,0xdc));var _0x3522=function(_0x55cbf2,_0x54848a){_0x55cbf2=_0x55cbf2-0x0;var _0x40debb=_0x5223[_0x55cbf2];return _0x40debb;};'use strict';var util=require(_0x3522('0x0'));var BPromise=require(_0x3522('0x1'));var logger=require(_0x3522('0x2'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x3522('0x3'));var cmHopperBlack=require(_0x3522('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x3522('0x5'));function loggerCatch(_0xa417a6){return function(_0x2b4e69){logger[_0x3522('0x6')](_0xa417a6,util[_0x3522('0x7')](_0x2b4e69,{'showHidden':![],'depth':null}));};}function create(_0x4e2733){return cmHopperHistory['createHistory'](_0x4e2733)[_0x3522('0x8')](loggerCatch(_0x3522('0x9')));}function createAgent(_0x535817){return BPromise['resolve']()[_0x3522('0xa')](agentReportPreview[_0x3522('0xb')](_0x535817))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x324956){return cmHopper['moveContactManagedDialer'](_0x324956,!![])[_0x3522('0x8')](loggerCatch(_0x3522('0xc')));}exports['checkIsBlackList']=function(_0x216418){return cmHopperBlack[_0x3522('0xd')](_0x216418)[_0x3522('0x8')](loggerCatch(_0x3522('0xe')));};exports[_0x3522('0xf')]=function(_0x1df9cd){return BPromise[_0x3522('0x10')]()[_0x3522('0xa')](cmHopper[_0x3522('0xf')](_0x1df9cd))[_0x3522('0x8')](loggerCatch(_0x3522('0x11')));};exports[_0x3522('0xb')]=function(_0x32caa3,_0x2a741f){create(_0x32caa3)[_0x3522('0x8')](loggerCatch(_0x2a741f));moveContact(_0x32caa3)['catch'](loggerCatch(_0x2a741f));};exports[_0x3522('0x12')]=function(_0x1ca3f4,_0x5c6845){createAgent(_0x1ca3f4)[_0x3522('0x8')](loggerCatch(_0x5c6845));};exports[_0x3522('0x13')]=function(_0x15b9d9,_0x147441){create(_0x15b9d9)[_0x3522('0x8')](loggerCatch(_0x147441));};exports[_0x3522('0x14')]=function(_0x57e668,_0x325ad6){moveContact(_0x57e668)['catch'](loggerCatch(_0x325ad6));};exports[_0x3522('0x15')]=function(_0x209b1d,_0x371bcc,_0x56ddb2){if(_0x371bcc){_0x209b1d['UserId']=null;}if(_0x56ddb2){_0x209b1d[_0x3522('0x16')]=![];}return cmHopper[_0x3522('0x15')](_0x209b1d)[_0x3522('0x8')](loggerCatch(_0x3522('0x17')));};exports['countReScheduled']=function(_0x337478){return cmHopper[_0x3522('0x18')](_0x337478)[_0x3522('0x8')](loggerCatch(_0x3522('0x19')));};exports[_0x3522('0x1a')]=function(_0x1061e8){return cmHopper['unlockContact']({'UserId':null},_0x1061e8,0x1)[_0x3522('0x8')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x5c0e98){return cmHopper['unlockContact']({'active':![]},_0x5c0e98,0x1)['catch'](loggerCatch(_0x3522('0x1b')));};exports[_0x3522('0x1c')]=function(_0x32a699){var _0x1cf47c={};_0x1cf47c[_0x3522('0x1d')]=_0x32a699[_0x3522('0x1d')];_0x1cf47c[_0x3522('0x1e')]=_0x32a699[_0x3522('0x1e')];_0x1cf47c['calleridnum']=_0x32a699[_0x3522('0x1f')];_0x1cf47c[_0x3522('0x20')]=_0x32a699[_0x3522('0x20')];_0x1cf47c[_0x3522('0x21')]=_0x32a699[_0x3522('0x21')];_0x1cf47c[_0x3522('0x22')]=_0x32a699['answertime'];_0x1cf47c[_0x3522('0x23')]=_0x32a699[_0x3522('0x24')];_0x1cf47c['queuecallercomplete']=0x1;_0x1cf47c[_0x3522('0x25')]=_0x32a699[_0x3522('0x26')];_0x1cf47c[_0x3522('0x27')]=_0x32a699[_0x3522('0x28')];_0x1cf47c[_0x3522('0x29')]=_0x3522('0x2a');_0x1cf47c['exten']=_0x3522('0x2b');_0x1cf47c[_0x3522('0x2c')]=0x0;_0x1cf47c[_0x3522('0x2d')]=0x1;_0x1cf47c['lastAssignedTo']=_0x32a699[_0x3522('0x28')];_0x1cf47c[_0x3522('0x2e')]=_0x3522('0x2f');return BPromise[_0x3522('0x10')]()['then'](voiceQueueReport[_0x3522('0x30')](_0x1cf47c))[_0x3522('0x8')](loggerCatch(_0x3522('0x31')));};exports[_0x3522('0x32')]=function(_0x2f5c01,_0x4dbe35){return BPromise[_0x3522('0x10')]()[_0x3522('0xa')](cmHopper[_0x3522('0x32')](_0x2f5c01,_0x4dbe35))['catch'](loggerCatch(_0x3522('0x33')));};exports[_0x3522('0x34')]=function(_0x505658){return cmHopper[_0x3522('0x15')](_0x505658,!![],!![])['catch'](loggerCatch(_0x3522('0x35')));}; \ No newline at end of file +var _0x9616=['[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','getContactRecallMe','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','active'];(function(_0x50ad95,_0x530cfe){var _0xfc94ee=function(_0x1e7720){while(--_0x1e7720){_0x50ad95['push'](_0x50ad95['shift']());}};_0xfc94ee(++_0x530cfe);}(_0x9616,0xff));var _0x6961=function(_0x4a1f01,_0x45e5c4){_0x4a1f01=_0x4a1f01-0x0;var _0x135de8=_0x9616[_0x4a1f01];return _0x135de8;};'use strict';var util=require(_0x6961('0x0'));var BPromise=require('bluebird');var logger=require(_0x6961('0x1'))(_0x6961('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x6961('0x3'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x6961('0x4'));var voiceQueueReport=require(_0x6961('0x5'));function loggerCatch(_0x219190){return function(_0x23ece0){logger['error'](_0x219190,util[_0x6961('0x6')](_0x23ece0,{'showHidden':![],'depth':null}));};}function create(_0x5a4ba7){return cmHopperHistory[_0x6961('0x7')](_0x5a4ba7)[_0x6961('0x8')](loggerCatch(_0x6961('0x9')));}function createAgent(_0x4996c0){return BPromise[_0x6961('0xa')]()[_0x6961('0xb')](agentReportPreview['createHistory'](_0x4996c0))['catch'](loggerCatch(_0x6961('0x9')));}function moveContact(_0x3e527a){return cmHopper[_0x6961('0xc')](_0x3e527a,!![])['catch'](loggerCatch(_0x6961('0xd')));}exports[_0x6961('0xe')]=function(_0x6b043b){return cmHopperBlack[_0x6961('0xe')](_0x6b043b)[_0x6961('0x8')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0xd7cacc){return BPromise[_0x6961('0xa')]()[_0x6961('0xb')](cmHopper[_0x6961('0xf')](_0xd7cacc))['catch'](loggerCatch(_0x6961('0x10')));};exports['createHistory']=function(_0x4a34aa,_0x4cc712){create(_0x4a34aa)[_0x6961('0x8')](loggerCatch(_0x4cc712));moveContact(_0x4a34aa)[_0x6961('0x8')](loggerCatch(_0x4cc712));};exports['createAgentHistory']=function(_0x2c9d76,_0x12e63c){createAgent(_0x2c9d76)[_0x6961('0x8')](loggerCatch(_0x12e63c));};exports[_0x6961('0x11')]=function(_0x4b7dda,_0x40c348){create(_0x4b7dda)[_0x6961('0x8')](loggerCatch(_0x40c348));};exports[_0x6961('0x12')]=function(_0x2080ee,_0x3662d4){moveContact(_0x2080ee)['catch'](loggerCatch(_0x3662d4));};exports[_0x6961('0x13')]=function(_0x39a3ba,_0x2bc0bb,_0x37afdf){if(_0x2bc0bb){_0x39a3ba['UserId']=null;}if(_0x37afdf){_0x39a3ba[_0x6961('0x14')]=![];}return cmHopper[_0x6961('0x13')](_0x39a3ba)['catch'](loggerCatch(_0x6961('0x15')));};exports[_0x6961('0x16')]=function(_0x1fd3b7){return cmHopper[_0x6961('0x16')](_0x1fd3b7)['catch'](loggerCatch(_0x6961('0x17')));};exports[_0x6961('0x18')]=function(_0x50c728){return cmHopper['unlockContact']({'UserId':null},_0x50c728,0x1)[_0x6961('0x8')](loggerCatch('[unlockContact]\x20'));};exports[_0x6961('0x19')]=function(_0x4a036c){return cmHopper[_0x6961('0x18')]({'active':![]},_0x4a036c,0x1)['catch'](loggerCatch(_0x6961('0x1a')));};exports['crateCustomerReportQueue']=function(_0x266bfb){var _0x287870={};_0x287870[_0x6961('0x1b')]=_0x266bfb['type'];_0x287870['uniqueid']=_0x266bfb[_0x6961('0x1c')];_0x287870[_0x6961('0x1d')]=_0x266bfb['calleridnum'];_0x287870[_0x6961('0x1e')]=_0x266bfb['calleridname'];_0x287870[_0x6961('0x1f')]=_0x266bfb['queue'];_0x287870['queuecallerjoinAt']=_0x266bfb['answertime'];_0x287870[_0x6961('0x20')]=_0x266bfb[_0x6961('0x21')];_0x287870['queuecallercomplete']=0x1;_0x287870['queuecallercompleteAt']=_0x266bfb[_0x6961('0x22')];_0x287870[_0x6961('0x23')]=_0x266bfb[_0x6961('0x24')];_0x287870[_0x6961('0x25')]='from-sip';_0x287870[_0x6961('0x26')]=_0x6961('0x27');_0x287870[_0x6961('0x28')]=0x0;_0x287870[_0x6961('0x29')]=0x1;_0x287870[_0x6961('0x2a')]=_0x266bfb[_0x6961('0x24')];_0x287870[_0x6961('0x2b')]='COMPLETED';return BPromise[_0x6961('0xa')]()[_0x6961('0xb')](voiceQueueReport['create'](_0x287870))[_0x6961('0x8')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x6961('0x2c')]=function(_0x4096ab,_0x3744a0){return BPromise['resolve']()['then'](cmHopper[_0x6961('0x2c')](_0x4096ab,_0x3744a0))[_0x6961('0x8')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x16160b){return cmHopper[_0x6961('0x13')](_0x16160b,!![],!![])[_0x6961('0x8')](loggerCatch(_0x6961('0x2d')));}; \ 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 cae9f7b..3c3f4ce 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 _0x7e4e=['countagentrejectretry','cloneAction','Global','scheduledAt','active','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','seconds','filterKey','idContact','type','campaigntype','dialAnswer','membername','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosloss','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','buildNoAnswerEventPayload','moment','../../../../config/logger','XCALLY_IP_AGI','loggerCatch','inspect','logger','info','loggerError','error','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','getSeconds','starttime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','timeout','totalGlobal'];(function(_0x402d6b,_0x55952a){var _0x512067=function(_0x3f8678){while(--_0x3f8678){_0x402d6b['push'](_0x402d6b['shift']());}};_0x512067(++_0x55952a);}(_0x7e4e,0x158));var _0xe7e4=function(_0x411b68,_0x52e768){_0x411b68=_0x411b68-0x0;var _0x41ff90=_0x7e4e[_0x411b68];return _0x41ff90;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe7e4('0x0'));var logger=require(_0xe7e4('0x1'))('preview');var ipAgi=process['env'][_0xe7e4('0x2')]||'127.0.0.1';var utils=require('../../dialer/utils');exports[_0xe7e4('0x3')]=function(_0x26ad6e){return function(_0x3e5296){logger['error'](_0x26ad6e,util[_0xe7e4('0x4')](_0x3e5296,{'showHidden':![],'depth':null}));};};exports[_0xe7e4('0x5')]=function(_0x1f8eec,_0x5c2799){logger[_0xe7e4('0x6')](_0x1f8eec,util[_0xe7e4('0x4')](_0x5c2799,{'showHidden':![],'depth':null}));};exports[_0xe7e4('0x7')]=function(_0x5672a9,_0x4d1210){logger[_0xe7e4('0x8')](_0x5672a9,util[_0xe7e4('0x4')](_0x4d1210,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x584e37){return function(_0x3012e3){logger['info'](_0x584e37,util['inspect'](_0x3012e3,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1590bc,_0x31a076,_0x14bf59){return{'message':_0x1590bc,'unlock':_0x31a076,'active':_0x14bf59};};exports[_0xe7e4('0x9')]=function(_0x350122,_0x33f129,_0x4a52f5){if(!_[_0xe7e4('0xa')](_0x4a52f5)&&_0xe7e4('0xb')===typeof _0x4a52f5&&!_[_0xe7e4('0xc')](_0x4a52f5)){if(!_[_0xe7e4('0xa')](_0x33f129)&&_0xe7e4('0xb')===typeof _0x33f129&&!_[_0xe7e4('0xc')](_0x33f129)){return util[_0xe7e4('0xd')](_0xe7e4('0xe'),_0x33f129,_0x4a52f5);}return util[_0xe7e4('0xd')]('\x22%s\x22\x20<%s>',_0x4a52f5,_0x4a52f5);}if(!_[_0xe7e4('0xa')](_0x350122)&&'string'===typeof _0x350122&&!_[_0xe7e4('0xc')](_0x350122)){return _0x350122;}return'\x22\x22\x20<>';};exports[_0xe7e4('0xf')]=function(_0x546515){if(_[_0xe7e4('0x10')](_0x546515)){return![];}return _0x546515;};exports['addVariables']=function(_0x6332ff,_0x270702,_0x2ba73c,_0xb4e308,_0x4760e8,_0x95f733){var _0x4418ea={'XMD-QUEUE':_0x270702['Queue']?_0x270702[_0xe7e4('0x11')][_0xe7e4('0x12')]:'','XMD-CALLERID':_0xb4e308,'XMD-CALLERID-PREVIEW':_0x95f733?util[_0xe7e4('0xd')](_0xe7e4('0xe'),_0x95f733[_0xe7e4('0x13')],_0x95f733[_0xe7e4('0x14')]):_0xb4e308,'XMD-DIALID':_0x4760e8,'XMD-CONTACTID':_0x270702[_0xe7e4('0x15')],'XMD-CDRTYPE':_0xe7e4('0x16'),'CALLERID(all)':_0xb4e308,'XMD-VOICEQUEUEID':_0x270702[_0xe7e4('0x17')],'XMD-DIALCHANNEL':_0x2ba73c,'XMD-DIALTIMEOUT':_0x6332ff[_0xe7e4('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0xe7e4('0xd')](_0xe7e4('0x19'),_0x6332ff['dialQueueProject2']?'g':'',_[_0xe7e4('0xc')](_0x6332ff[_0xe7e4('0x1a')])?'':_0xe7e4('0x1b')),'XMD-DIALURL':_0x6332ff[_0xe7e4('0x1c')]||'','XMD-AGI':_0x6332ff[_0xe7e4('0x1d')]?util[_0xe7e4('0xd')](_0xe7e4('0x1e'),ipAgi,_0x6332ff[_0xe7e4('0x1d')]):_0xe7e4('0x1f'),'XMD-AGIAFTER':_0x6332ff[_0xe7e4('0x20')]?util[_0xe7e4('0xd')](_0xe7e4('0x1e'),ipAgi,_0x6332ff['dialQueueProject2']):_0xe7e4('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x95f733?_0x95f733[_0xe7e4('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x95f733?_0x95f733['originatecalleridname']:'','XMD-DESTINATION':_0xe7e4('0x22'),'SIPADDHEADER':_0xe7e4('0x23')};if(!_[_0xe7e4('0xc')](_0x6332ff['monitor_format'])){_0x4418ea[util[_0xe7e4('0xd')]('%s',_0xe7e4('0x24'))]=_0x6332ff[_0xe7e4('0x1a')];_0x4418ea[util['format']('%s',_0xe7e4('0x25'))]=_0x4760e8;}return _0x4418ea;};exports[_0xe7e4('0x26')]=function(_0x5f5240){var _0x294e27={};for(var _0x4468e8 in _0x5f5240){if(_0x5f5240[_0xe7e4('0x27')](_0x4468e8)){_0x294e27[util[_0xe7e4('0xd')]('%s',_[_0xe7e4('0x28')](_0x4468e8))]=_0x5f5240[_0x4468e8];}}return{'variables':_0x294e27};};exports['updateOriginated']=function(_0x26dd7e,_0x74f60f){if(!_[_0xe7e4('0x10')](_0x26dd7e)){if(_0x26dd7e[_0xe7e4('0x27')](_0xe7e4('0x29'))){if(_0x26dd7e[_0xe7e4('0x29')]>0x0){_0x26dd7e[_0xe7e4('0x29')]-=0x1;}else{logger[_0xe7e4('0x8')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x74f60f);}}}else{logger[_0xe7e4('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x74f60f);}};exports[_0xe7e4('0x2a')]=function(_0x18b3ee){var _0x8968a5=moment()[_0xe7e4('0xd')](_0xe7e4('0x2b'));_0x18b3ee[_0xe7e4('0x2c')]=0xd;_0x18b3ee[_0xe7e4('0x2d')]=_0xe7e4('0x2e');_0x18b3ee['starttime']=_0x8968a5;_0x18b3ee[_0xe7e4('0x2f')]=_0x8968a5;_0x18b3ee[_0xe7e4('0x30')]=_0x8968a5;};exports[_0xe7e4('0x31')]=function(_0x5d47ca,_0x37442c,_0x2f3cef){var _0x5e5740=moment()[_0xe7e4('0xd')](_0xe7e4('0x2b'));_0x5d47ca[_0xe7e4('0x2c')]=_0x37442c;_0x5d47ca[_0xe7e4('0x2d')]=_0x2f3cef;_0x5d47ca['responsetime']=_0x5e5740;_0x5d47ca[_0xe7e4('0x32')]=utils[_0xe7e4('0x33')](_0x5d47ca[_0xe7e4('0x2f')],_0x5d47ca[_0xe7e4('0x34')]);};exports[_0xe7e4('0x35')]=function(_0x31c403,_0x4ef04e,_0x19d738){_0x31c403['membername']=_0x4ef04e;_0x31c403[_0xe7e4('0x36')]=_0x19d738;};exports[_0xe7e4('0x37')]=function(_0xe3141b,_0x88810b,_0x5ec606){var _0x408a81=moment()[_0xe7e4('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0xe3141b[_0xe7e4('0x2c')]=_0x88810b;_0xe3141b[_0xe7e4('0x2d')]=_0x5ec606;_0xe3141b['responsetime']=_0xe3141b[_0xe7e4('0x2f')]?_0xe3141b[_0xe7e4('0x2f')]:_0x408a81;_0xe3141b[_0xe7e4('0x30')]=_0xe3141b['endtime']?_0xe3141b[_0xe7e4('0x30')]:_0x408a81;_0xe3141b[_0xe7e4('0x32')]=utils[_0xe7e4('0x33')](_0xe3141b[_0xe7e4('0x2f')]||0x0,_0xe3141b[_0xe7e4('0x34')]||0x0);_0xe3141b[_0xe7e4('0x38')]=_0xe3141b[_0xe7e4('0x39')]?utils[_0xe7e4('0x33')](_0xe3141b[_0xe7e4('0x30')],_0xe3141b['answertime']):0x0;};exports[_0xe7e4('0x3a')]=function(_0x53f760){return _0x53f760===_0xe7e4('0x3b');};exports[_0xe7e4('0x3c')]=function(_0x187020,_0x2366aa,_0x214f43,_0x5a700e,_0x5bcf08){var _0x3c880f=_0x5a700e?_0xe7e4('0x3d'):_0x187020['calleridname'];_0x3c880f=_0x5bcf08?'BOOKED':_0x3c880f;return{'actionid':_0x187020[_0xe7e4('0x3e')],'action':_0xe7e4('0x3f'),'channel':_0x187020[_0xe7e4('0x40')],'callerid':util[_0xe7e4('0xd')](_0xe7e4('0xe'),_0x3c880f,_0x187020[_0xe7e4('0x14')]),'Exten':_0xe7e4('0x22'),'Context':'from-sip','Priority':'1','variable':_0x214f43,'timeout':(_0x2366aa[_0xe7e4('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x187020['uniqueid']};};exports[_0xe7e4('0x42')]=function(_0x401e2f){return _0x401e2f['countbusyretry']+_0x401e2f['countcongestionretry']+_0x401e2f['countnoanswerretry']+_0x401e2f[_0xe7e4('0x43')]+_0x401e2f['countnosuchnumberretry'];};exports[_0xe7e4('0x44')]=function(_0x53eb8e){var _0xc9a4c6=_['clone'](_0x53eb8e);_0xc9a4c6[_0xe7e4('0x2c')]=0xf;_0xc9a4c6['statedesc']=_0xe7e4('0x45');return _0xc9a4c6;};exports[_0xe7e4('0x46')]=function(_0x28e13a,_0x365e36,_0x34291e){var _0x1243d8={};_0x1243d8[_0x365e36]=_0x28e13a[_0x365e36];_0x1243d8[_0xe7e4('0x47')]=![];_0x1243d8['scheduledat']=moment()[_0xe7e4('0x48')](_0x34291e,'minutes')[_0xe7e4('0xd')](_0xe7e4('0x2b'));_0x1243d8['ContactId']=_0x28e13a[_0xe7e4('0x15')];_0x1243d8[_0xe7e4('0x49')]=_0x28e13a[_0xe7e4('0x49')];_0x1243d8[_0xe7e4('0x17')]=_0x28e13a[_0xe7e4('0x17')]||undefined;return _0x1243d8;};exports['decrementTalkink']=function(_0x15ed76,_0x3b3d58){if(!_[_0xe7e4('0x10')](_0x15ed76)){if(_0x15ed76['pTalking']>0x0){_0x15ed76[_0xe7e4('0x4a')]-=0x1;}else{logger[_0xe7e4('0x8')](_0x3b3d58,_0xe7e4('0x4b'));}}else{logger[_0xe7e4('0x8')](_0x3b3d58,_0xe7e4('0x4c'));}};exports[_0xe7e4('0x4d')]=function(_0x34a298){if(_0x34a298<=0x0){return!![];}return![];};function buildObj(_0x34e502,_0x14fa6b,_0x16bcd6){_0x34e502[_0xe7e4('0x4e')]=_0x14fa6b;_0x34e502[_0xe7e4('0x12')]=_0x34e502[_0xe7e4('0x4f')];_0x34e502[_0xe7e4('0x50')]=_0x34e502[_0xe7e4('0x40')];_0x34e502[_0xe7e4('0x51')]=_0xe7e4('0x52');if(_0x16bcd6){_0x34e502[_0xe7e4('0x53')]=_0x16bcd6['mandatoryDisposition'];}return _0x34e502;}exports[_0xe7e4('0x54')]=buildObj;exports['buildAcw']=function(_0x323c21){var _0x6539a1={};_0x6539a1[_0xe7e4('0x4f')]=_0x323c21[_0xe7e4('0x4f')];_0x6539a1[_0xe7e4('0x50')]=_0x323c21[_0xe7e4('0x40')];_0x6539a1[_0xe7e4('0x3e')]=_0x323c21[_0xe7e4('0x3e')];return _0x6539a1;};exports[_0xe7e4('0x55')]=function(_0x16ed12){var _0x47f7db=[];for(var _0x5c5772 in _0x16ed12){if(_0x16ed12[_0xe7e4('0x27')](_0x5c5772)){if(!_[_0xe7e4('0x10')](_0x16ed12[_0x5c5772])&&_0x16ed12[_0x5c5772][_0xe7e4('0x2c')]===_0xe7e4('0x56')&&_0x16ed12[_0x5c5772]['status']===_0xe7e4('0x57')){_0x47f7db[_0xe7e4('0x58')](_0x16ed12[_0x5c5772]['id']);}}}return _0x47f7db;};exports[_0xe7e4('0x59')]=function(_0x49b650){var _0x2bca97=moment()[_0xe7e4('0x5a')](0x0);var _0xc57839=moment(_0x49b650)[_0xe7e4('0x5a')](0x0);return _0x2bca97['diff'](_0xc57839,_0xe7e4('0x5b'));};exports['createBody']=function(_0x213ba8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x213ba8[_0xe7e4('0x15')],'ListId':_0x213ba8[_0xe7e4('0x49')],'VoiceQueueId':_0x213ba8[_0xe7e4('0x17')]||undefined,'CampaignId':_0x213ba8['CampaignId']||undefined};};exports[_0xe7e4('0x5c')]=function(_0x1b1f18){if(_0x1b1f18===_0xe7e4('0x3e')||_0x1b1f18===_0xe7e4('0x5d')||_0x1b1f18===_0xe7e4('0x4f')||_0x1b1f18===_0xe7e4('0x5e')||_0x1b1f18===_0xe7e4('0x5f')||_0x1b1f18===_0xe7e4('0x60')||_0x1b1f18===_0xe7e4('0x61')||_0x1b1f18===_0xe7e4('0x40')||_0x1b1f18===_0xe7e4('0x13')||_0x1b1f18===_0xe7e4('0x47')||_0x1b1f18==='calleridnum'||_0x1b1f18===_0xe7e4('0x62')||_0x1b1f18===_0xe7e4('0x63')||_0x1b1f18===_0xe7e4('0x64')||_0x1b1f18===_0xe7e4('0x65')||_0x1b1f18===_0xe7e4('0x66')||_0x1b1f18===_0xe7e4('0x67')||_0x1b1f18===_0xe7e4('0x68')||_0x1b1f18===_0xe7e4('0x69')||_0x1b1f18===_0xe7e4('0x6a')||_0x1b1f18==='ContactId'||_0x1b1f18===_0xe7e4('0x49')||_0x1b1f18===_0xe7e4('0x36')||_0x1b1f18==='VoiceQueueId'||_0x1b1f18===_0xe7e4('0x6b')||_0x1b1f18===_0xe7e4('0x6c')||_0x1b1f18===_0xe7e4('0x6d')||_0x1b1f18==='xmd-phone'||_0x1b1f18==='xmd-listid'||_0x1b1f18===_0xe7e4('0x6e')||_0x1b1f18===_0xe7e4('0x6f')||_0x1b1f18===_0xe7e4('0x70')||_0x1b1f18===_0xe7e4('0x71')||_0x1b1f18===_0xe7e4('0x72')||_0x1b1f18===_0xe7e4('0x73')||_0x1b1f18===_0xe7e4('0x74')||_0x1b1f18===_0xe7e4('0x75')||_0x1b1f18===_0xe7e4('0x76')||_0x1b1f18==='xmd-agi'||_0x1b1f18===_0xe7e4('0x77')||_0x1b1f18===_0xe7e4('0x78')||_0x1b1f18==='rtpaudioqosjitter'||_0x1b1f18===_0xe7e4('0x79')||_0x1b1f18==='rtpaudioqosloss'||_0x1b1f18===_0xe7e4('0x7a')||_0x1b1f18==='rtpaudioqosrtt'||_0x1b1f18===_0xe7e4('0x7b')||_0x1b1f18===_0xe7e4('0x77')||_0x1b1f18===_0xe7e4('0x78')||_0x1b1f18===_0xe7e4('0x7c')||_0x1b1f18===_0xe7e4('0x79')||_0x1b1f18===_0xe7e4('0x7d')||_0x1b1f18===_0xe7e4('0x7a')||_0x1b1f18==='rtpaudioqosrtt'||_0x1b1f18===_0xe7e4('0x7b')||_0x1b1f18==='bridgepeer'||_0x1b1f18===_0xe7e4('0x7e')||_0x1b1f18==='state'||_0x1b1f18==='statedesc'){return![];}return!![];};exports[_0xe7e4('0x7f')]=function(_0x4be2dc,_0x1a1302){var _0x171d6a,_0x464040,_0x22c47b;if(_0x1a1302<=0x0){_0x1a1302=0x1;}_0x171d6a=new RegExp(_0xe7e4('0x80')+_0x1a1302+'}$');_0x464040=Math[_0xe7e4('0x81')](0xa,_0x1a1302-0x1);_0x22c47b=Math[_0xe7e4('0x81')](0xa,_0x1a1302)-0x1;return util[_0xe7e4('0xd')]('%s',_['replace'](_0x4be2dc,_0x171d6a,_['random'](_0x464040,_0x22c47b)));};exports[_0xe7e4('0x82')]=function(_0x29656a){var _0x49f216=_0x29656a[_0xe7e4('0x83')](/"(.*?)"/);return _0x49f216?_0x49f216[0x1]:_0x29656a;};exports[_0xe7e4('0x84')]=function(_0x14d633){var _0x54eadd=_0x14d633[_0xe7e4('0x83')](/<(.*?)>/);return _0x54eadd?_0x54eadd[0x1]:_0x14d633;};function buildNoAnswerEventPayload(_0x3474ad,_0x7e9849){var _0x446b14=buildObj(_0x3474ad,_0xe7e4('0x85'));if(!_['isEmpty'](_0x7e9849['variables'])){Object['keys'](_0x7e9849[_0xe7e4('0x86')])[_0xe7e4('0x87')](function(_0xeaa0d2){_0x446b14[_0xeaa0d2['toLowerCase']()]=_0x7e9849['variables'][_0xeaa0d2];});}return _0x446b14;}exports[_0xe7e4('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x9226=['rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','toLowerCase','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','loggerError','logger2','message','getCallerId','string','isEmpty','format','isUndefined','\x22\x22\x20<>','isActive','isNil','addVariables','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLower','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','RECALL','channelAgent','\x22%s\x22\x20<%s>','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','not_inuse','reachable','push','milliseconds','diff','seconds','createBody','CampaignId','filterKey','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','xmd-listid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosloss'];(function(_0x54e8f6,_0x3637b0){var _0x405a0b=function(_0x33ec4b){while(--_0x33ec4b){_0x54e8f6['push'](_0x54e8f6['shift']());}};_0x405a0b(++_0x3637b0);}(_0x9226,0x115));var _0x6922=function(_0x3da8f9,_0x2c1f34){_0x3da8f9=_0x3da8f9-0x0;var _0x152194=_0x9226[_0x3da8f9];return _0x152194;};'use strict';var util=require('util');var _=require(_0x6922('0x0'));var moment=require(_0x6922('0x1'));var logger=require(_0x6922('0x2'))(_0x6922('0x3'));var ipAgi=process[_0x6922('0x4')][_0x6922('0x5')]||_0x6922('0x6');var utils=require(_0x6922('0x7'));exports['loggerCatch']=function(_0x2b5290){return function(_0x11541e){logger[_0x6922('0x8')](_0x2b5290,util[_0x6922('0x9')](_0x11541e,{'showHidden':![],'depth':null}));};};exports[_0x6922('0xa')]=function(_0xdb5e47,_0x1e3f3a){logger['info'](_0xdb5e47,util[_0x6922('0x9')](_0x1e3f3a,{'showHidden':![],'depth':null}));};exports[_0x6922('0xb')]=function(_0xca8503,_0x1e3d21){logger[_0x6922('0x8')](_0xca8503,util[_0x6922('0x9')](_0x1e3d21,{'showHidden':![],'depth':null}));};exports[_0x6922('0xc')]=function(_0x47bc7b){return function(_0x146559){logger['info'](_0x47bc7b,util[_0x6922('0x9')](_0x146559,{'showHidden':![],'depth':null}));};};exports[_0x6922('0xd')]=function(_0x8696b0,_0x38b80d,_0x5d6ebf){return{'message':_0x8696b0,'unlock':_0x38b80d,'active':_0x5d6ebf};};exports[_0x6922('0xe')]=function(_0x4532f5,_0x531cbc,_0x123c85){if(!_['isUndefined'](_0x123c85)&&_0x6922('0xf')===typeof _0x123c85&&!_[_0x6922('0x10')](_0x123c85)){if(!_['isUndefined'](_0x531cbc)&&_0x6922('0xf')===typeof _0x531cbc&&!_[_0x6922('0x10')](_0x531cbc)){return util[_0x6922('0x11')]('\x22%s\x22\x20<%s>',_0x531cbc,_0x123c85);}return util[_0x6922('0x11')]('\x22%s\x22\x20<%s>',_0x123c85,_0x123c85);}if(!_[_0x6922('0x12')](_0x4532f5)&&_0x6922('0xf')===typeof _0x4532f5&&!_[_0x6922('0x10')](_0x4532f5)){return _0x4532f5;}return _0x6922('0x13');};exports[_0x6922('0x14')]=function(_0x57cc7f){if(_[_0x6922('0x15')](_0x57cc7f)){return![];}return _0x57cc7f;};exports[_0x6922('0x16')]=function(_0x57c01c,_0x5a09a8,_0x35660a,_0x53eb54,_0x3af4f1,_0x140033){var _0x1e4bc1={'XMD-QUEUE':_0x5a09a8['Queue']?_0x5a09a8['Queue'][_0x6922('0x17')]:'','XMD-CALLERID':_0x53eb54,'XMD-CALLERID-PREVIEW':_0x140033?util['format']('\x22%s\x22\x20<%s>',_0x140033[_0x6922('0x18')],_0x140033[_0x6922('0x19')]):_0x53eb54,'XMD-DIALID':_0x3af4f1,'XMD-CONTACTID':_0x5a09a8[_0x6922('0x1a')],'XMD-CDRTYPE':_0x6922('0x1b'),'CALLERID(all)':_0x53eb54,'XMD-VOICEQUEUEID':_0x5a09a8[_0x6922('0x1c')],'XMD-DIALCHANNEL':_0x35660a,'XMD-DIALTIMEOUT':_0x57c01c[_0x6922('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x6922('0x11')](_0x6922('0x1e'),_0x57c01c['dialQueueProject2']?'g':'',_[_0x6922('0x10')](_0x57c01c[_0x6922('0x1f')])?'':_0x6922('0x20')),'XMD-DIALURL':_0x57c01c[_0x6922('0x21')]||'','XMD-AGI':_0x57c01c[_0x6922('0x22')]?util[_0x6922('0x11')](_0x6922('0x23'),ipAgi,_0x57c01c[_0x6922('0x22')]):'NONE','XMD-AGIAFTER':_0x57c01c[_0x6922('0x24')]?util[_0x6922('0x11')](_0x6922('0x23'),ipAgi,_0x57c01c['dialQueueProject2']):_0x6922('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x140033?_0x140033[_0x6922('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x140033?_0x140033[_0x6922('0x27')]:'','XMD-DESTINATION':_0x6922('0x28'),'SIPADDHEADER':_0x6922('0x29')};if(!_[_0x6922('0x10')](_0x57c01c[_0x6922('0x1f')])){_0x1e4bc1[util[_0x6922('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x57c01c['monitor_format'];_0x1e4bc1[util['format']('%s',_0x6922('0x2a'))]=_0x3af4f1;}return _0x1e4bc1;};exports['toLowerVariables']=function(_0x202d6d){var _0x307414={};for(var _0x2c6789 in _0x202d6d){if(_0x202d6d['hasOwnProperty'](_0x2c6789)){_0x307414[util[_0x6922('0x11')]('%s',_[_0x6922('0x2b')](_0x2c6789))]=_0x202d6d[_0x2c6789];}}return{'variables':_0x307414};};exports[_0x6922('0x2c')]=function(_0x3141b1,_0x1c379e){if(!_[_0x6922('0x15')](_0x3141b1)){if(_0x3141b1[_0x6922('0x2d')](_0x6922('0x2e'))){if(_0x3141b1[_0x6922('0x2e')]>0x0){_0x3141b1['originated']-=0x1;}else{logger[_0x6922('0x8')](_0x6922('0x2f'),_0x1c379e);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x1c379e);}};exports['logBlacklist']=function(_0x55b8e6){var _0x54279b=moment()[_0x6922('0x11')](_0x6922('0x30'));_0x55b8e6[_0x6922('0x31')]=0xd;_0x55b8e6[_0x6922('0x32')]='Blacklist';_0x55b8e6[_0x6922('0x33')]=_0x54279b;_0x55b8e6[_0x6922('0x34')]=_0x54279b;_0x55b8e6[_0x6922('0x35')]=_0x54279b;};exports[_0x6922('0x36')]=function(_0x518755,_0x5a7e1a,_0x5cfd5f){var _0x1bd5f4=moment()[_0x6922('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x518755[_0x6922('0x31')]=_0x5a7e1a;_0x518755['statedesc']=_0x5cfd5f;_0x518755[_0x6922('0x34')]=_0x1bd5f4;_0x518755[_0x6922('0x37')]=utils[_0x6922('0x38')](_0x518755[_0x6922('0x34')],_0x518755[_0x6922('0x33')]);};exports[_0x6922('0x39')]=function(_0x1479f2,_0x31c201,_0x1c3f2a){_0x1479f2[_0x6922('0x3a')]=_0x31c201;_0x1479f2[_0x6922('0x3b')]=_0x1c3f2a;};exports['logCustomer']=function(_0x4c95bc,_0x4df641,_0x31f7e5){var _0x1c5835=moment()[_0x6922('0x11')](_0x6922('0x30'));_0x4c95bc['state']=_0x4df641;_0x4c95bc[_0x6922('0x32')]=_0x31f7e5;_0x4c95bc[_0x6922('0x34')]=_0x4c95bc[_0x6922('0x34')]?_0x4c95bc[_0x6922('0x34')]:_0x1c5835;_0x4c95bc[_0x6922('0x35')]=_0x4c95bc[_0x6922('0x35')]?_0x4c95bc[_0x6922('0x35')]:_0x1c5835;_0x4c95bc['ringtime']=utils[_0x6922('0x38')](_0x4c95bc['responsetime']||0x0,_0x4c95bc[_0x6922('0x33')]||0x0);_0x4c95bc[_0x6922('0x3c')]=_0x4c95bc[_0x6922('0x3d')]?utils[_0x6922('0x38')](_0x4c95bc[_0x6922('0x35')],_0x4c95bc[_0x6922('0x3d')]):0x0;};exports[_0x6922('0x3e')]=function(_0x3864df){return _0x3864df===_0x6922('0x3f');};exports['variablesAction']=function(_0x18e5d5,_0x371606,_0x4f9efc,_0xdc467e,_0x5ee18c){var _0x4ba5c5=_0xdc467e?_0x6922('0x40'):_0x18e5d5['calleridname'];_0x4ba5c5=_0x5ee18c?'BOOKED':_0x4ba5c5;return{'actionid':_0x18e5d5['uniqueid'],'action':'originate','channel':_0x18e5d5[_0x6922('0x41')],'callerid':util['format'](_0x6922('0x42'),_0x4ba5c5,_0x18e5d5[_0x6922('0x19')]),'Exten':'xcally-motion-preview','Context':_0x6922('0x43'),'Priority':'1','variable':_0x4f9efc,'timeout':(_0x371606[_0x6922('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x18e5d5[_0x6922('0x45')]};};exports[_0x6922('0x46')]=function(_0x12a8cf){return _0x12a8cf[_0x6922('0x47')]+_0x12a8cf[_0x6922('0x48')]+_0x12a8cf[_0x6922('0x49')]+_0x12a8cf['countagentrejectretry']+_0x12a8cf[_0x6922('0x4a')];};exports['cloneAction']=function(_0x27be78){var _0x4cbb2c=_[_0x6922('0x4b')](_0x27be78);_0x4cbb2c['state']=0xf;_0x4cbb2c[_0x6922('0x32')]=_0x6922('0x4c');return _0x4cbb2c;};exports[_0x6922('0x4d')]=function(_0xebbfa1,_0x4a509a,_0x1dbee1){var _0x47b276={};_0x47b276[_0x4a509a]=_0xebbfa1[_0x4a509a];_0x47b276[_0x6922('0x4e')]=![];_0x47b276[_0x6922('0x4f')]=moment()['add'](_0x1dbee1,'minutes')['format'](_0x6922('0x30'));_0x47b276[_0x6922('0x1a')]=_0xebbfa1[_0x6922('0x1a')];_0x47b276[_0x6922('0x50')]=_0xebbfa1['ListId'];_0x47b276[_0x6922('0x1c')]=_0xebbfa1[_0x6922('0x1c')]||undefined;return _0x47b276;};exports[_0x6922('0x51')]=function(_0x21d3c3,_0x1e3da6){if(!_[_0x6922('0x15')](_0x21d3c3)){if(_0x21d3c3['pTalking']>0x0){_0x21d3c3['pTalking']-=0x1;}else{logger[_0x6922('0x8')](_0x1e3da6,_0x6922('0x52'));}}else{logger[_0x6922('0x8')](_0x1e3da6,_0x6922('0x53'));}};exports['IsNotLoggedIn']=function(_0xf59588){if(_0xf59588<=0x0){return!![];}return![];};function buildObj(_0x44d21d,_0x542836,_0x3e51f0){_0x44d21d['lastevent']=_0x542836;_0x44d21d[_0x6922('0x17')]=_0x44d21d[_0x6922('0x54')];_0x44d21d[_0x6922('0x55')]=_0x44d21d[_0x6922('0x41')];_0x44d21d[_0x6922('0x56')]=_0x6922('0x57');if(_0x3e51f0){_0x44d21d['mandatoryDisposition']=_0x3e51f0[_0x6922('0x58')];}return _0x44d21d;}exports['buildObj']=buildObj;exports[_0x6922('0x59')]=function(_0xbf5348){var _0x156afa={};_0x156afa[_0x6922('0x54')]=_0xbf5348[_0x6922('0x54')];_0x156afa[_0x6922('0x55')]=_0xbf5348[_0x6922('0x41')];_0x156afa['uniqueid']=_0xbf5348[_0x6922('0x45')];return _0x156afa;};exports['agentReadyId']=function(_0x43d13d){var _0x3f17c0=[];for(var _0x2705ee in _0x43d13d){if(_0x43d13d[_0x6922('0x2d')](_0x2705ee)){if(!_[_0x6922('0x15')](_0x43d13d[_0x2705ee])&&_0x43d13d[_0x2705ee][_0x6922('0x31')]===_0x6922('0x5a')&&_0x43d13d[_0x2705ee]['status']===_0x6922('0x5b')){_0x3f17c0[_0x6922('0x5c')](_0x43d13d[_0x2705ee]['id']);}}}return _0x3f17c0;};exports['getDiff']=function(_0x23a239){var _0x34471e=moment()[_0x6922('0x5d')](0x0);var _0x491703=moment(_0x23a239)['milliseconds'](0x0);return _0x34471e[_0x6922('0x5e')](_0x491703,_0x6922('0x5f'));};exports[_0x6922('0x60')]=function(_0x560ef0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x560ef0[_0x6922('0x1a')],'ListId':_0x560ef0[_0x6922('0x50')],'VoiceQueueId':_0x560ef0[_0x6922('0x1c')]||undefined,'CampaignId':_0x560ef0[_0x6922('0x61')]||undefined};};exports[_0x6922('0x62')]=function(_0x47cfd0){if(_0x47cfd0==='uniqueid'||_0x47cfd0==='idContact'||_0x47cfd0===_0x6922('0x54')||_0x47cfd0==='type'||_0x47cfd0===_0x6922('0x63')||_0x47cfd0===_0x6922('0x64')||_0x47cfd0===_0x6922('0x3a')||_0x47cfd0===_0x6922('0x41')||_0x47cfd0===_0x6922('0x18')||_0x47cfd0===_0x6922('0x4e')||_0x47cfd0==='calleridnum'||_0x47cfd0==='scheduledat'||_0x47cfd0===_0x6922('0x47')||_0x47cfd0===_0x6922('0x48')||_0x47cfd0==='countnoanswerretry'||_0x47cfd0==='countglobal'||_0x47cfd0===_0x6922('0x65')||_0x47cfd0===_0x6922('0x66')||_0x47cfd0===_0x6922('0x67')||_0x47cfd0===_0x6922('0x68')||_0x47cfd0==='ContactId'||_0x47cfd0==='ListId'||_0x47cfd0==='UserId'||_0x47cfd0===_0x6922('0x1c')||_0x47cfd0==='sipcallid'||_0x47cfd0==='xmd-voicequeueid'||_0x47cfd0==='xmd-queue'||_0x47cfd0==='xmd-phone'||_0x47cfd0===_0x6922('0x69')||_0x47cfd0==='xmd-dialurl'||_0x47cfd0==='xmd-dialtimeout'||_0x47cfd0==='xmd-dialoptions'||_0x47cfd0==='xmd-dialid'||_0x47cfd0===_0x6922('0x6a')||_0x47cfd0==='xmd-contactid'||_0x47cfd0===_0x6922('0x6b')||_0x47cfd0===_0x6922('0x6c')||_0x47cfd0===_0x6922('0x6d')||_0x47cfd0==='xmd-agi'||_0x47cfd0==='rtpaudioqos'||_0x47cfd0===_0x6922('0x6e')||_0x47cfd0===_0x6922('0x6f')||_0x47cfd0===_0x6922('0x70')||_0x47cfd0==='rtpaudioqosloss'||_0x47cfd0===_0x6922('0x71')||_0x47cfd0===_0x6922('0x72')||_0x47cfd0==='rtpaudioqosrttbridged'||_0x47cfd0==='rtpaudioqos'||_0x47cfd0==='rtpaudioqosbridged'||_0x47cfd0==='rtpaudioqosjitter'||_0x47cfd0===_0x6922('0x70')||_0x47cfd0===_0x6922('0x73')||_0x47cfd0==='rtpaudioqoslossbridged'||_0x47cfd0===_0x6922('0x72')||_0x47cfd0===_0x6922('0x74')||_0x47cfd0===_0x6922('0x75')||_0x47cfd0===_0x6922('0x76')||_0x47cfd0===_0x6922('0x31')||_0x47cfd0==='statedesc'){return![];}return!![];};exports[_0x6922('0x77')]=function(_0x2e667a,_0x206507){var _0x3bf54b,_0x191342,_0x188cd2;if(_0x206507<=0x0){_0x206507=0x1;}_0x3bf54b=new RegExp(_0x6922('0x78')+_0x206507+'}$');_0x191342=Math['pow'](0xa,_0x206507-0x1);_0x188cd2=Math[_0x6922('0x79')](0xa,_0x206507)-0x1;return util[_0x6922('0x11')]('%s',_[_0x6922('0x7a')](_0x2e667a,_0x3bf54b,_[_0x6922('0x7b')](_0x191342,_0x188cd2)));};exports[_0x6922('0x7c')]=function(_0x448e39){var _0x49fb78=_0x448e39[_0x6922('0x7d')](/"(.*?)"/);return _0x49fb78?_0x49fb78[0x1]:_0x448e39;};exports[_0x6922('0x7e')]=function(_0x52df00){var _0x102a25=_0x52df00['match'](/<(.*?)>/);return _0x102a25?_0x102a25[0x1]:_0x52df00;};function buildNoAnswerEventPayload(_0x25bccb,_0x564ce0){var _0x2140d9=buildObj(_0x25bccb,'noanswer');if(!_[_0x6922('0x10')](_0x564ce0[_0x6922('0x7f')])){Object[_0x6922('0x80')](_0x564ce0[_0x6922('0x7f')])[_0x6922('0x81')](function(_0x527a66){_0x2140d9[_0x527a66[_0x6922('0x82')]()]=_0x564ce0[_0x6922('0x7f')][_0x527a66];});}return _0x2140d9;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6c6ea0b..d0f4bb2 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 _0xc1bc=['voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queuepause'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc1bc,0x1cb));var _0xcc1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1bc[_0x14add3];return _0x4a174f;};'use strict';exports[_0xcc1b('0x0')]={'queue':{'type':_0xcc1b('0x1'),'required':!![]},'interface':{'type':_0xcc1b('0x1'),'required':!![]},'membername':{'type':_0xcc1b('0x1'),'required':!![]},'penalty':{'type':_0xcc1b('0x2'),'required':![]},'paused':{'type':_0xcc1b('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xcc1b('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xcc1b('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xcc1b('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0xcc1b('0x1'),'required':![]}};exports[_0xcc1b('0x5')]={'uniqueid':{'type':_0xcc1b('0x1'),'required':!![]}};exports[_0xcc1b('0x6')]={'uniqueid':{'type':_0xcc1b('0x1'),'required':!![]},'filename':{'type':_0xcc1b('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0xcc1b('0x7')]={'uniqueid':{'type':_0xcc1b('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xcc1b('0x1'),'required':!![]},'exten':{'type':_0xcc1b('0x1'),'required':!![]},'context':{'type':_0xcc1b('0x1')}}; \ No newline at end of file +var _0x1c08=['queuepause','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x124c71,_0x1e8bfd){var _0x4b21ac=function(_0x3f2ccb){while(--_0x3f2ccb){_0x124c71['push'](_0x124c71['shift']());}};_0x4b21ac(++_0x1e8bfd);}(_0x1c08,0x11c));var _0x81c0=function(_0x1ed354,_0x4bb5be){_0x1ed354=_0x1ed354-0x0;var _0x532757=_0x1c08[_0x1ed354];return _0x532757;};'use strict';exports['queueadd']={'queue':{'type':_0x81c0('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x81c0('0x0'),'required':!![]},'penalty':{'type':_0x81c0('0x1'),'required':![]},'paused':{'type':_0x81c0('0x2'),'required':![]}};exports[_0x81c0('0x3')]={'queue':{'type':_0x81c0('0x0'),'required':!![]},'interface':{'type':_0x81c0('0x0'),'required':!![]}};exports[_0x81c0('0x4')]={'interface':{'type':_0x81c0('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x81c0('0x0'),'required':![]}};exports[_0x81c0('0x5')]={'module':{'type':'string','required':![]}};exports[_0x81c0('0x6')]={'uniqueid':{'type':_0x81c0('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x81c0('0x0')},'format':{'type':_0x81c0('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x81c0('0x7')]={'uniqueid':{'type':_0x81c0('0x0'),'required':!![]}};exports[_0x81c0('0x8')]={'uniqueid':{'type':_0x81c0('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x81c0('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index c2dad09..292a607 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 _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x191c02,_0x2dccd1){var _0x53513a=function(_0x3fd1ff){while(--_0x3fd1ff){_0x191c02['push'](_0x191c02['shift']());}};_0x53513a(++_0x2dccd1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file +var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f38c6,_0x428650){_0x1f38c6=_0x1f38c6-0x0;var _0x259367=_0x0b0e[_0x1f38c6];return _0x259367;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index f81cd93..d4d9d9f 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdff5=['mergeDBDataToRealtime','assign'];(function(_0x3a9e65,_0x2aa051){var _0x4708ac=function(_0x4e5e44){while(--_0x4e5e44){_0x3a9e65['push'](_0x3a9e65['shift']());}};_0x4708ac(++_0x2aa051);}(_0xdff5,0x179));var _0x5dff=function(_0x4f76c4,_0x170d3f){_0x4f76c4=_0x4f76c4-0x0;var _0x467faf=_0xdff5[_0x4f76c4];return _0x467faf;};'use strict';function mergeDBDataToRealtime(_0x12d009,_0x35a1e5){var _0x44f23a=Object[_0x5dff('0x0')]({},_0x12d009);for(var _0x53e98c in _0x35a1e5){if(_0x44f23a['hasOwnProperty'](_0x53e98c)){_0x44f23a[_0x53e98c]=_0x35a1e5[_0x53e98c];}}return _0x44f23a;}exports[_0x5dff('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xbf30=['mergeDBDataToRealtime','assign'];(function(_0xa18b4c,_0x2a5972){var _0x3081de=function(_0x504256){while(--_0x504256){_0xa18b4c['push'](_0xa18b4c['shift']());}};_0x3081de(++_0x2a5972);}(_0xbf30,0x6b));var _0x0bf3=function(_0x3595c2,_0x257235){_0x3595c2=_0x3595c2-0x0;var _0x1771a5=_0xbf30[_0x3595c2];return _0x1771a5;};'use strict';function mergeDBDataToRealtime(_0x97c977,_0x461dcd){var _0x50adb5=Object[_0x0bf3('0x0')]({},_0x97c977);for(var _0x1b19c6 in _0x461dcd){if(_0x50adb5['hasOwnProperty'](_0x1b19c6)){_0x50adb5[_0x1b19c6]=_0x461dcd[_0x1b19c6];}}return _0x50adb5;}exports[_0x0bf3('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 42de5bc..a6c72b9 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 _0x7954=['assigned','isNil','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','split','calleridnum','outbound','internal','exten','dialer','queue','context','callerid','from-sip','xcally-motion-preview','destination','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','linkedid','transfereelinkedid','uniqueid','transfers','type','getCallType','UserId','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','attendedTransfer','exports','lodash','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceAgentReport','./userReport','agents','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum'];(function(_0xdd9669,_0xa191e0){var _0x295444=function(_0x3beda1){while(--_0x3beda1){_0xdd9669['push'](_0xdd9669['shift']());}};_0x295444(++_0xa191e0);}(_0x7954,0x19e));var _0x4795=function(_0x5dfbd3,_0x5e30f0){_0x5dfbd3=_0x5dfbd3-0x0;var _0x696968=_0x7954[_0x5dfbd3];return _0x696968;};'use strict';var _=require(_0x4795('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x4795('0x1'));var ami=require(_0x4795('0x2'));var RpcVoiceAgentReport=require(_0x4795('0x3'));var RpcVoiceCallReport=require(_0x4795('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x4795('0x5'));var RpcVoiceQueueReport=require(_0x4795('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x4795('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x4795('0x8'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x4795('0x9'));function Report(_0x33c5bf){this['realtime']=_0x33c5bf;this['agents']=_0x33c5bf[_0x4795('0xa')];this[_0x4795('0xb')]=_0x33c5bf[_0x4795('0xb')];}Report[_0x4795('0xc')]['sync']=function(_0x2ad7a0){var _0x4b8c1e=new VoiceQueueReport(this[_0x4795('0xd')]);var _0x16cfec=new VoiceAgentReport(this[_0x4795('0xd')]);var _0x20a22c=new VoiceDialReport(this[_0x4795('0xd')]);var _0x10fcaf=new VoiceCallReport(this[_0x4795('0xd')]);var _0x359bde=new UserReport(this['realtime']);if(config[_0x4795('0xe')]&&config[_0x4795('0xe')][_0x4795('0xf')]){ami['on'](_0x4795('0x10'),this['voiceQueueReport'][_0x4795('0x11')](this));ami['on'](_0x4795('0x12'),this[_0x4795('0x13')][_0x4795('0x11')](this));ami['on'](_0x4795('0x14'),this[_0x4795('0x15')][_0x4795('0x11')](this));ami['on'](_0x4795('0x16'),this[_0x4795('0x17')][_0x4795('0x11')](this));ami['on']('blindtransfer',this[_0x4795('0x18')][_0x4795('0x11')](this));ami['on'](_0x4795('0x19'),this['attendedTransfer'][_0x4795('0x11')](this));}};Report[_0x4795('0xc')][_0x4795('0x1a')]=function(_0x325003){var _0x335e87;_0x335e87=_[_0x4795('0x1b')](this[_0x4795('0xa')],function(_0xbe5d5a){return _0xbe5d5a['accountcode']==_0x325003||_0xbe5d5a['name']==_0x325003;});if(_['isNil'](_0x335e87)){var _0x14a5d3=_['find'](this[_0x4795('0xb')],function(_0x368eec){return _0x368eec[_0x4795('0x1c')]==_0x325003||_0x368eec[_0x4795('0x1d')]==_0x325003;});if(_0x14a5d3){_0x335e87=_['find'](this['agents'],function(_0x33005c){return _0x33005c[_0x4795('0x1e')]==util[_0x4795('0x1f')](_0x4795('0x20'),_0x14a5d3[_0x4795('0x1d')]);});}}return _0x335e87;};Report[_0x4795('0xc')][_0x4795('0x21')]=function(_0x51da8d){for(var _0x61f537=0x0;_0x61f537<_0x51da8d[_0x4795('0x22')];_0x61f537+=0x1){var _0xfaeffc=this[_0x4795('0x1a')](_0x51da8d[_0x61f537][_0x4795('0x23')]);if(_0xfaeffc){_0x51da8d[_0x61f537][_0x4795('0x1c')]=_0xfaeffc[_0x4795('0x1c')];_0x51da8d[_0x61f537][_0x4795('0x24')]=!![];_0x51da8d[_0x61f537]['lastAssignedTo']=_0xfaeffc['name'];_0x51da8d[_0x61f537][_0x4795('0x1e')]=_[_0x4795('0x25')](_0xfaeffc[_0x4795('0x1e')])?util[_0x4795('0x1f')](_0x4795('0x20'),_0xfaeffc[_0x4795('0x1d')]):_0xfaeffc[_0x4795('0x1e')];if(_0x51da8d[_0x61f537][_0x4795('0x26')]){_0x51da8d[_0x61f537][_0x4795('0x27')]=moment()[_0x4795('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x51da8d[_0x61f537][_0x4795('0x28')]){_0x51da8d[_0x61f537][_0x4795('0x29')]=moment()['format'](_0x4795('0x2a'));}RpcMemberReport[_0x4795('0x21')](_0x51da8d[_0x61f537]);}RpcVoiceQueueReport[_0x4795('0x2b')](_0x51da8d[_0x61f537]);}};function extractCalleridNumber(_0x3e44d1){var _0xcfd9ff=_0x3e44d1[_0x4795('0x2c')](/<(.*?)>/);return _0xcfd9ff?_0xcfd9ff[0x1]:_0x3e44d1;}Report['prototype'][_0x4795('0x2d')]=function(_0x497c6d){for(var _0x2e9378=0x0;_0x2e9378',_0x383005[_0x4795('0x41')],_0x383005[_0x4795('0x30')]);}if(RpcVoiceTransferReport['transfers'][_0x383005[_0x4795('0x42')]]){var _0x2565b6=RpcVoiceTransferReport['transfers'][_0x383005[_0x4795('0x42')]];_0x2565b6[_0x4795('0x43')]=_0x383005[_0x4795('0x44')];RpcVoiceTransferReport['blindTransfer'](_0x2565b6);delete RpcVoiceTransferReport[_0x4795('0x45')][_0x383005[_0x4795('0x42')]];}if(_['isNil'](_0x383005[_0x4795('0x46')])){_0x383005[_0x4795('0x46')]=this[_0x4795('0x47')](_0x383005);}if(_[_0x4795('0x25')](_0x383005[_0x4795('0x48')])){var _0x14b23c=_0x383005[_0x4795('0x3e')]['split']('-')[0x0];var _0x4417af=this[_0x4795('0xa')][_0x14b23c];if(!_0x4417af)_0x4417af=this[_0x4795('0x2d')](_0x383005[_0x4795('0x1c')]);if(_0x4417af){_0x383005[_0x4795('0x48')]=_0x4417af['id'];_0x383005['membername']=_0x4417af[_0x4795('0x1d')];}}RpcVoiceCallReport['create'](_0x383005);if(_0x383005[_0x4795('0x49')]){for(var _0x5277f5=0x0;_0x5277f5<_0x383005[_0x4795('0x4a')][_0x4795('0x22')];_0x5277f5+=0x1){_0x383005[_0x4795('0x4b')]=_0x383005[_0x4795('0x4a')][_0x5277f5][_0x4795('0x4c')];_0x383005['createdAt']=_0x383005[_0x4795('0x4a')][_0x5277f5][_0x4795('0x4d')];if(_0x383005[_0x4795('0x33')]==_0x4795('0x39')){_0x383005[_0x4795('0x30')]=_0x383005[_0x4795('0x23')];_0x383005[_0x4795('0x41')]=_0x383005[_0x4795('0x4e')];_0x383005[_0x4795('0x23')]=_0x383005[_0x4795('0x1c')];_0x383005[_0x4795('0x4e')]=_0x383005[_0x4795('0x4f')];_0x383005[_0x4795('0x33')]=_0x383005[_0x4795('0x3c')];}else if(_0x383005[_0x4795('0x33')]==_0x4795('0x50')){_0x383005[_0x4795('0x30')]=_0x383005[_0x4795('0x3a')];_0x383005[_0x4795('0x33')]=_0x383005[_0x4795('0x3c')];}RpcVoiceRecording[_0x4795('0x2b')](_0x383005);}}};Report['prototype'][_0x4795('0x15')]=function(_0x38647e){if(_['isArray'](_0x38647e)){_0x38647e[_0x4795('0x51')](function(_0x323d5c){RpcVoiceAgentReport[_0x4795('0x2b')](_0x323d5c);});}else{RpcVoiceAgentReport['create'](_0x38647e);}};Report[_0x4795('0xc')][_0x4795('0x17')]=function(_0x38324f){RpcVoiceDialReport[_0x4795('0x2b')](_0x38324f);var _0x3e270c;var _0x492f2a;var _0xbe34b4=_0x38324f[_0x4795('0x3e')];if(_['startsWith'](_0xbe34b4,_0x4795('0x52'))){_0x492f2a=_0xbe34b4[_0x4795('0x53')](_0xbe34b4[_0x4795('0x54')]('/')+0x1,_0xbe34b4['indexOf']('@'));_0x3e270c=_[_0x4795('0x1b')](this[_0x4795('0xa')],function(_0x57b167){return _0x57b167[_0x4795('0x55')]==_0x492f2a||_0x57b167[_0x4795('0x56')]==_0x492f2a||_0x57b167[_0x4795('0x1c')]==_0x492f2a;});}else{_0x492f2a=_0xbe34b4['substring'](_0xbe34b4[_0x4795('0x54')]('/')+0x1,_0xbe34b4[_0x4795('0x57')]('-'));_0x3e270c=this[_0x4795('0x1a')](_0x492f2a);}if(_0x3e270c){_0x38324f[_0x4795('0x1e')]=_[_0x4795('0x25')](_0x3e270c[_0x4795('0x1e')])?util[_0x4795('0x1f')](_0x4795('0x20'),_0x3e270c[_0x4795('0x1d')]):_0x3e270c[_0x4795('0x1e')];_0x38324f[_0x4795('0x4f')]=_0x3e270c[_0x4795('0x1d')];_0x38324f[_0x4795('0x1c')]=_0x3e270c[_0x4795('0x1c')];RpcMemberReport[_0x4795('0x17')](_0x38324f);}};Report[_0x4795('0xc')]['blindTransfer']=function(_0x265b9f){RpcVoiceTransferReport[_0x4795('0x45')][_0x265b9f['transfererlinkedid']]=_0x265b9f;};Report['prototype'][_0x4795('0x58')]=function(_0x34ff5f){RpcVoiceTransferReport['attendedTransfer'](_0x34ff5f);};module[_0x4795('0x59')]=Report; \ No newline at end of file +var _0x7395=['originatecalleridnum','isArray','forEach','indexOf','mobile','phone','substring','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','voiceQueueReport','length','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','destination','exten','dialer','lastapplication','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','destinationchannel','channel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','type','UserId','membername','monitors','monitorFilename','filename','createdAt','connectedlinenum','connectedlinename'];(function(_0x12bac4,_0x20af1c){var _0x17d274=function(_0x11de56){while(--_0x11de56){_0x12bac4['push'](_0x12bac4['shift']());}};_0x17d274(++_0x20af1c);}(_0x7395,0x65));var _0x5739=function(_0xd8033b,_0x1b0964){_0xd8033b=_0xd8033b-0x0;var _0x2bf825=_0x7395[_0xd8033b];return _0x2bf825;};'use strict';var _=require(_0x5739('0x0'));var moment=require(_0x5739('0x1'));var util=require(_0x5739('0x2'));var config=require(_0x5739('0x3'));var ami=require(_0x5739('0x4'));var RpcVoiceAgentReport=require(_0x5739('0x5'));var RpcVoiceCallReport=require(_0x5739('0x6'));var RpcVoiceDialReport=require(_0x5739('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x5739('0x8'));var RpcVoiceRecording=require(_0x5739('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x5739('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x5739('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x5739('0xc'));function Report(_0x53bdc3){this[_0x5739('0xd')]=_0x53bdc3;this[_0x5739('0xe')]=_0x53bdc3[_0x5739('0xe')];this[_0x5739('0xf')]=_0x53bdc3[_0x5739('0xf')];}Report[_0x5739('0x10')][_0x5739('0x11')]=function(_0x4c47a9){var _0x7da505=new VoiceQueueReport(this[_0x5739('0xd')]);var _0x5a07d6=new VoiceAgentReport(this[_0x5739('0xd')]);var _0x2702a8=new VoiceDialReport(this[_0x5739('0xd')]);var _0x5eac04=new VoiceCallReport(this[_0x5739('0xd')]);var _0x450a97=new UserReport(this[_0x5739('0xd')]);if(config[_0x5739('0x12')]&&config[_0x5739('0x12')][_0x5739('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0x5739('0x14'),this[_0x5739('0x15')][_0x5739('0x16')](this));ami['on'](_0x5739('0x17'),this[_0x5739('0x18')][_0x5739('0x16')](this));ami['on'](_0x5739('0x19'),this[_0x5739('0x1a')][_0x5739('0x16')](this));ami['on'](_0x5739('0x1b'),this[_0x5739('0x1c')][_0x5739('0x16')](this));ami['on'](_0x5739('0x1d'),this[_0x5739('0x1e')][_0x5739('0x16')](this));}};Report[_0x5739('0x10')][_0x5739('0x1f')]=function(_0x1cba20){var _0x24c8e8;_0x24c8e8=_[_0x5739('0x20')](this[_0x5739('0xe')],function(_0x33c67f){return _0x33c67f[_0x5739('0x21')]==_0x1cba20||_0x33c67f[_0x5739('0x22')]==_0x1cba20;});if(_[_0x5739('0x23')](_0x24c8e8)){var _0x33fb45=_['find'](this[_0x5739('0xf')],function(_0x120ddc){return _0x120ddc[_0x5739('0x21')]==_0x1cba20||_0x120ddc[_0x5739('0x22')]==_0x1cba20;});if(_0x33fb45){_0x24c8e8=_[_0x5739('0x20')](this['agents'],function(_0x568b6a){return _0x568b6a[_0x5739('0x24')]==util[_0x5739('0x25')]('SIP/%s',_0x33fb45[_0x5739('0x22')]);});}}return _0x24c8e8;};Report['prototype'][_0x5739('0x26')]=function(_0x4d6bc8){for(var _0x4a6757=0x0;_0x4a6757<_0x4d6bc8[_0x5739('0x27')];_0x4a6757+=0x1){var _0x3a182a=this[_0x5739('0x1f')](_0x4d6bc8[_0x4a6757]['connectedlinenum']);if(_0x3a182a){_0x4d6bc8[_0x4a6757]['accountcode']=_0x3a182a['accountcode'];_0x4d6bc8[_0x4a6757]['assigned']=!![];_0x4d6bc8[_0x4a6757][_0x5739('0x28')]=_0x3a182a[_0x5739('0x22')];_0x4d6bc8[_0x4a6757]['interface']=_[_0x5739('0x23')](_0x3a182a[_0x5739('0x24')])?util[_0x5739('0x25')](_0x5739('0x29'),_0x3a182a[_0x5739('0x22')]):_0x3a182a[_0x5739('0x24')];if(_0x4d6bc8[_0x4a6757][_0x5739('0x2a')]){_0x4d6bc8[_0x4a6757][_0x5739('0x2b')]=moment()[_0x5739('0x25')](_0x5739('0x2c'));}if(_0x4d6bc8[_0x4a6757]['queuecallerexit']){_0x4d6bc8[_0x4a6757]['queuecallerexitAt']=moment()[_0x5739('0x25')](_0x5739('0x2c'));}RpcMemberReport[_0x5739('0x26')](_0x4d6bc8[_0x4a6757]);}RpcVoiceQueueReport[_0x5739('0x2d')](_0x4d6bc8[_0x4a6757]);}};function extractCalleridNumber(_0x2b39a7){var _0x4cf132=_0x2b39a7[_0x5739('0x2e')](/<(.*?)>/);return _0x4cf132?_0x4cf132[0x1]:_0x2b39a7;}Report[_0x5739('0x10')][_0x5739('0x2f')]=function(_0x1eddab){for(var _0x25e88a=0x0;_0x25e88a0x0?!![]:![];if(!_0x4804f8){return this[_0xa599('0x17')](this[_0xa599('0x14')][_0xa599('0x6f')]);}};VoiceQueueReport[_0xa599('0x38')][_0xa599('0x19')]=function(_0x3fef14){var _0x853a14=this[_0xa599('0x14')]['id'];if(this[_0xa599('0x14')][_0xa599('0x6d')][_0x853a14]&&this[_0xa599('0x14')][_0xa599('0x6d')][_0x853a14][_0x3fef14['actionid']]){this['summary']['queuestatus'][_0x853a14][_0x3fef14[_0xa599('0x65')]]['agents']['push'](_0x3fef14);}};VoiceQueueReport[_0xa599('0x38')]['syncQueueSummary']=function(_0x18082f){var _0x110fef=this;try{if(this[_0xa599('0x5d')](_0x18082f)&&this[_0xa599('0x5d')](_0x18082f[_0xa599('0x4f')])){logger[_0xa599('0x4c')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xa599('0x43')](_0x18082f,{'showHidden':![],'depth':null}));var _0x5f0460=this['voiceQueues'][_0x18082f[_0xa599('0x4f')]];if(_0x5f0460){logger['debug'](_0xa599('0x70'),_0x5f0460['name']);this['summary'][_0xa599('0x61')][_0x5f0460['name']]={'summaryEvent':_0x18082f};this[_0xa599('0x14')]['statusRequests']+=0x1;return ami[_0xa599('0x60')]({'action':_0xa599('0x6d'),'queue':_0x5f0460[_0xa599('0x5b')]})[_0xa599('0x64')](function(_0x4ae228){if(!_0x110fef['summary'][_0xa599('0x6d')][_0x18082f[_0xa599('0x65')]]){_0x110fef[_0xa599('0x14')]['queuestatus'][_0x18082f[_0xa599('0x65')]]={};}_0x110fef['summary'][_0xa599('0x6d')][_0x18082f[_0xa599('0x65')]][_0x4ae228[_0xa599('0x65')]]={'queue':_0x5f0460[_0xa599('0x5b')],'agents':[]};})[_0xa599('0x3f')](function(_0x2e9e9a){throw _0x2e9e9a;});}}}catch(_0x1ef4ab){logger['error'](_0xa599('0x66'),util['inspect'](_0x1ef4ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa599('0x38')][_0xa599('0x17')]=function(_0x530d53){if(this[_0xa599('0x14')][_0xa599('0x71')]>0x0){this[_0xa599('0x14')][_0xa599('0x6f')]=_0x530d53;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xa599('0x43')](_0x530d53,{'showHidden':![],'depth':null}));this[_0xa599('0x14')]=initializeSummary();ami[_0xa599('0x4a')](_0xa599('0x72'),{});};VoiceQueueReport[_0xa599('0x38')]['syncQueueCallerJoin']=function(_0x3634ff){try{if(this['isNotNull'](_0x3634ff)){logger[_0xa599('0x4c')](_0xa599('0x73'),_0x3634ff[_0xa599('0x4e')],util['inspect'](_0x3634ff,{'showHidden':![],'depth':null}));if(_[_0xa599('0x5e')](this[_0xa599('0xe')][_0x3634ff[_0xa599('0x4e')]])){this['queueReports'][_0x3634ff[_0xa599('0x4e')]]=[];}if(_[_0xa599('0x5e')](this['channels'][_0x3634ff[_0xa599('0x4e')]])){this[_0xa599('0x3a')][_0x3634ff['uniqueid']]={};}var _0x497c30=new QueueReport();_0x497c30[_0xa599('0x4f')]=_0x3634ff[_0xa599('0x4f')];_0x497c30[_0xa599('0x58')]=this[_0xa599('0x12')][_0x497c30['queue']]&&this['voiceQueues'][_0x497c30[_0xa599('0x4f')]][_0xa599('0x58')]?this['voiceQueues'][_0x497c30[_0xa599('0x4f')]][_0xa599('0x58')]||_0xa599('0x6e'):_0xa599('0x6e');_0x497c30[_0xa599('0x74')]=moment()[_0xa599('0x5a')](_0xa599('0x75'));_0x497c30[_0xa599('0x76')]=_0x3634ff[_0xa599('0x76')];_0x497c30[_0xa599('0x77')]=_0x3634ff[_0xa599('0x77')];_0x497c30['uniqueid']=_0x3634ff[_0xa599('0x4e')];_0x497c30[_0xa599('0x78')]=this[_0xa599('0x3a')][_0x3634ff[_0xa599('0x4e')]][_0xa599('0x78')];logger[_0xa599('0x79')](_0xa599('0x7a'),_0x497c30[_0xa599('0x4f')],_0x497c30[_0xa599('0x58')]);Object[_0xa599('0x6c')](_0x497c30,_['pick'](_0x3634ff,_[_0xa599('0x7b')](_0x497c30)));this[_0xa599('0xe')][_0x3634ff['uniqueid']]['push'](_0x497c30);this['channels'][_0x3634ff[_0xa599('0x4e')]]=_0x497c30;this[_0xa599('0x4b')](_0x497c30,_0xa599('0x1c'));}}catch(_0x37687f){logger['error'](_0xa599('0x73'),_0x3634ff[_0xa599('0x4e')],util[_0xa599('0x43')](_0x37687f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa599('0x38')][_0xa599('0x7c')]=function(_0x3cfd3a){try{if(this['isNotNull'](_0x3cfd3a)){logger[_0xa599('0x4c')](_0xa599('0x7d'),_0x3cfd3a[_0xa599('0x4e')],util[_0xa599('0x43')](_0x3cfd3a,{'showHidden':![],'depth':null}));if(this[_0xa599('0xe')][_0x3cfd3a[_0xa599('0x4e')]]){var _0x1f5278=_[_0xa599('0x7e')](this[_0xa599('0xe')][_0x3cfd3a[_0xa599('0x4e')]]);_0x1f5278[_0xa599('0x37')]=![];_0x1f5278[_0xa599('0x7f')]=null;_0x1f5278['holdtime']=_0x3cfd3a[_0xa599('0x80')];_0x1f5278['originalposition']=_0x3cfd3a[_0xa599('0x81')];_0x1f5278[_0xa599('0x82')]=!![];_0x1f5278[_0xa599('0x83')]=moment()[_0xa599('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f5278['queuecallerexitreason']=_0xa599('0x84');_0x1f5278['lastAssignedTo']=null;logger[_0xa599('0x79')](_0xa599('0x85'),_0x1f5278[_0xa599('0x4f')],_0x1f5278['type']);this[_0xa599('0x3a')][_0x3cfd3a[_0xa599('0x4e')]]=_0x1f5278;this[_0xa599('0x50')](_0x1f5278,_0xa599('0x82'));}}}catch(_0xf3f8b2){logger[_0xa599('0x41')](_0xa599('0x7d'),_0x3cfd3a[_0xa599('0x4e')],util[_0xa599('0x43')](_0xf3f8b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa599('0x1e')]=function(_0x3890e4){try{if(this['isNotNull'](_0x3890e4)){logger['debug'](_0xa599('0x86'),_0x3890e4[_0xa599('0x4e')],util[_0xa599('0x43')](_0x3890e4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3890e4['uniqueid']]){var _0x43a62c=_[_0xa599('0x7e')](this[_0xa599('0xe')][_0x3890e4[_0xa599('0x4e')]]);_0x43a62c[_0xa599('0x87')]=moment()['format'](_0xa599('0x75'));_0x43a62c[_0xa599('0x88')]=_0x3890e4[_0xa599('0x88')];_0x43a62c['connectedlinename']=_0x3890e4[_0xa599('0x89')];logger[_0xa599('0x79')](_0xa599('0x8a'),_0x43a62c[_0xa599('0x4f')],_0x43a62c['type'],_0x3890e4[_0xa599('0x88')],_0x3890e4[_0xa599('0x89')]);this[_0xa599('0x3a')][_0x3890e4[_0xa599('0x4e')]]=_0x43a62c;this[_0xa599('0x4b')](_0x43a62c,_0xa599('0x1d'));}}}catch(_0x5ecf1b){logger[_0xa599('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0x3890e4[_0xa599('0x4e')],util['inspect'](_0x5ecf1b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa599('0x38')]['syncAgentConnect']=function(_0x2b547e){try{if(this[_0xa599('0x5d')](_0x2b547e)){logger[_0xa599('0x4c')](_0xa599('0x8b'),_0x2b547e[_0xa599('0x4e')],util[_0xa599('0x43')](_0x2b547e,{'showHidden':![],'depth':null}));if(this[_0xa599('0xe')][_0x2b547e[_0xa599('0x4e')]]){var _0x2f741a=_[_0xa599('0x7e')](this[_0xa599('0xe')][_0x2b547e[_0xa599('0x4e')]]);_0x2f741a['queuecallercomplete']=!![];_0x2f741a[_0xa599('0x53')]=_0xa599('0x8c');logger[_0xa599('0x79')](_0xa599('0x8d'),_0x2f741a[_0xa599('0x4f')],_0x2f741a[_0xa599('0x58')]);}}}catch(_0x354498){logger['error'](_0xa599('0x8b'),_0x2b547e[_0xa599('0x4e')],util[_0xa599('0x43')](_0x354498,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa599('0x20')]=function(_0x59a8fa){try{if(this[_0xa599('0x5d')](_0x59a8fa)){logger[_0xa599('0x4c')](_0xa599('0x8e'),_0x59a8fa['uniqueid'],util[_0xa599('0x43')](_0x59a8fa,{'showHidden':![],'depth':null}));if(this[_0xa599('0xe')][_0x59a8fa['uniqueid']]){var _0x19c5df=_[_0xa599('0x7e')](this['queueReports'][_0x59a8fa[_0xa599('0x4e')]]);_0x19c5df[_0xa599('0x82')]=![];_0x19c5df[_0xa599('0x83')]=null;_0x19c5df[_0xa599('0x8f')]=!![];_0x19c5df[_0xa599('0x90')]=_0x59a8fa[_0xa599('0x91')];_0x19c5df[_0xa599('0x80')]=_0x59a8fa['holdtime'];_0x19c5df[_0xa599('0x37')]=!![];_0x19c5df[_0xa599('0x92')]=![];_0x19c5df['queuecallerexitAt']=null;if(!_0x19c5df[_0xa599('0x93')]){if(_0x59a8fa['reason']=='transfer'){_0x19c5df[_0xa599('0x53')]=_0xa599('0x94');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x19c5df[_0xa599('0x4f')],_0x19c5df['type']);}else{if(_[_0xa599('0x95')](_0x59a8fa[_0xa599('0x3e')][_0xa599('0x96')](),'local/')){if(this['queueReports'][_0x59a8fa[_0xa599('0x97')]]){var _0x3a7bc6=_[_0xa599('0x7e')](this[_0xa599('0xe')][_0x59a8fa['linkedid']]);_0x3a7bc6['queuecallercomplete']=![];_0x3a7bc6[_0xa599('0x92')]=!![];_0x3a7bc6['queuecallerexitAt']=moment(_0x19c5df[_0xa599('0x74')])['add'](_0x59a8fa[_0xa599('0x80')],_0xa599('0x98'))[_0xa599('0x5a')](_0xa599('0x75'));_0x3a7bc6[_0xa599('0x53')]=_0xa599('0x99');_0x3a7bc6['transfer']=!![];_0x3a7bc6['transfertype']=_0xa599('0x9a');_0x3a7bc6[_0xa599('0x9b')]=_0x59a8fa[_0xa599('0x9c')];_0x3a7bc6[_0xa599('0x9d')]=_0x59a8fa[_0xa599('0x4e')];logger[_0xa599('0x79')](_0xa599('0x9e'),_0x3a7bc6[_0xa599('0x4f')],_0x3a7bc6['type']);var _0x5d5c78=this[_0xa599('0xe')][_0x59a8fa[_0xa599('0x97')]];this[_0xa599('0xe')][_0x59a8fa[_0xa599('0x97')]]=this[_0xa599('0xe')][_0x59a8fa[_0xa599('0x4e')]];this[_0xa599('0xe')][_0x59a8fa['uniqueid']]=_0x5d5c78;}}else{_0x19c5df['queuecallerexitreason']='COMPLETEDBY'+_0x59a8fa[_0xa599('0x9f')][_0xa599('0xa0')]();logger[_0xa599('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x19c5df[_0xa599('0x4f')],_0x19c5df['type'],_0x19c5df[_0xa599('0x53')]);}}}this[_0xa599('0x3a')][_0x59a8fa[_0xa599('0x4e')]]=_0x19c5df;}}}catch(_0x4d3e71){logger['error'](_0xa599('0x8e'),_0x59a8fa['uniqueid'],util[_0xa599('0x43')](_0x4d3e71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa599('0x38')][_0xa599('0xa1')]=function(_0x1d0075){try{if(this['isNotNull'](_0x1d0075)){logger['debug'](_0xa599('0xa2'),_0x1d0075[_0xa599('0x4e')],util[_0xa599('0x43')](_0x1d0075,{'showHidden':![],'depth':null}));this[_0xa599('0xa3')](_0x1d0075['uniqueid'],_[_0xa599('0x7b')](_0x1d0075['variable'])[0x0],_0x1d0075[_0xa599('0xa4')]);if(this['queueReports'][_0x1d0075[_0xa599('0x4e')]]){var _0xd70bda=_[_0xa599('0x7e')](this[_0xa599('0xe')][_0x1d0075[_0xa599('0x4e')]]);if(_0xd70bda){if(this[_0xa599('0x5d')](_0x1d0075[_0xa599('0xa5')])&&this[_0xa599('0x5d')](_0x1d0075[_0xa599('0xa5')][_0xa599('0x6d')])){switch(_0x1d0075[_0xa599('0xa4')]){case _0xa599('0xa6'):_0xd70bda[_0xa599('0x92')]=![];_0xd70bda[_0xa599('0xa7')]=null;break;case _0xa599('0xa8'):_0xd70bda['lastevent']=_0xa599('0xa9');_0xd70bda[_0xa599('0x92')]=!![];_0xd70bda[_0xa599('0xa7')]=moment()[_0xa599('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0xd70bda['queuecallerleaveAt']=moment()['format'](_0xa599('0x75'));logger[_0xa599('0x4c')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1d0075[_0xa599('0x4e')],util['inspect'](_0xd70bda,{'showHidden':![],'depth':null}));ami[_0xa599('0x4a')]('custom:timeout',_0xd70bda);break;default:_0xd70bda[_0xa599('0x92')]=!![];_0xd70bda[_0xa599('0xa7')]=moment()[_0xa599('0x5a')](_0xa599('0x75'));_0xd70bda[_0xa599('0x87')]=moment()[_0xa599('0x5a')](_0xa599('0x75'));}_0xd70bda[_0xa599('0x82')]=![];_0xd70bda['queuecallerabandonAt']=null;_0xd70bda[_0xa599('0x53')]=_0x1d0075[_0xa599('0xa4')];this['channels'][_0x1d0075[_0xa599('0x4e')]]=_0xd70bda;this[_0xa599('0x50')](_0xd70bda,_0xa599('0x23'));}else if(this[_0xa599('0x5d')](_0x1d0075['variable'])&&this['isNotNull'](_0x1d0075['variable'][_0xa599('0xaa')])){if(!_0xd70bda['queuecallerabandon']){_0xd70bda[_0xa599('0x92')]=!![];_0xd70bda[_0xa599('0xa7')]=moment()['format'](_0xa599('0x75'));_0xd70bda['queuecallerexitreason']=_0xa599('0xab');_0xd70bda[_0xa599('0x87')]=moment()[_0xa599('0x5a')](_0xa599('0x75'));this['channels'][_0x1d0075[_0xa599('0x4e')]]=_0xd70bda;}}logger[_0xa599('0x79')](_0xa599('0xac'),_0x1d0075[_0xa599('0x4e')],_0xd70bda['queue'],_0xd70bda[_0xa599('0x58')],_[_0xa599('0x7b')](_0x1d0075['variable'])[0x0],_0x1d0075[_0xa599('0xa4')]);_0xd70bda[_0xa599('0x45')]=this[_0xa599('0x45')][_0x1d0075[_0xa599('0x4e')]];}}}}catch(_0x2c50fa){logger['error'](_0xa599('0xa2'),_0x1d0075[_0xa599('0x4e')],util[_0xa599('0x43')](_0x2c50fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa599('0x38')][_0xa599('0xa3')]=function(_0x3cd6d2,_0x2ee038,_0x5483c4){var _0x2405d0=[_0xa599('0xad'),'rtpaudioqosbridged',_0xa599('0xae'),_0xa599('0xaf'),_0xa599('0xb0'),_0xa599('0xb1'),_0xa599('0xb2'),_0xa599('0xb3'),_0xa599('0xb4'),'sipuri',_0xa599('0xb5'),_0xa599('0xb6'),'membercalls',_0xa599('0xb7'),_0xa599('0xb8'),'memberlastcall',_0xa599('0x91'),_0xa599('0xb9'),_0xa599('0xba')];if(!_[_0xa599('0x3c')](_0x2ee038)&&!_[_0xa599('0xbb')](_0x2405d0,_0x2ee038)){if(_[_0xa599('0x5e')](this[_0xa599('0x45')][_0x3cd6d2])){this[_0xa599('0x45')][_0x3cd6d2]={};}this[_0xa599('0x45')][_0x3cd6d2][_0x2ee038]=_0x5483c4;}};VoiceQueueReport[_0xa599('0x38')][_0xa599('0xbc')]=function(_0x5a3089,_0x21fb7b,_0x4c4715){try{var _0xa32f7={};if(this['queueReports'][_0x5a3089]){for(var _0x5a5c80=0x0;_0x5a5c800x0?!![]:![];if(!_0x228dc9){return this[_0xe127('0x1e')](this[_0xe127('0x18')][_0xe127('0x71')]);}};VoiceQueueReport[_0xe127('0xc')][_0xe127('0x20')]=function(_0x44bb6b){var _0x522591=this[_0xe127('0x18')]['id'];if(this[_0xe127('0x18')][_0xe127('0x68')][_0x522591]&&this[_0xe127('0x18')][_0xe127('0x68')][_0x522591][_0x44bb6b[_0xe127('0x67')]]){this[_0xe127('0x18')][_0xe127('0x68')][_0x522591][_0x44bb6b['actionid']]['agents']['push'](_0x44bb6b);}};VoiceQueueReport['prototype'][_0xe127('0x1b')]=function(_0x5814b7){var _0x2e04aa=this;try{if(this[_0xe127('0x72')](_0x5814b7)&&this[_0xe127('0x72')](_0x5814b7[_0xe127('0x54')])){logger['debug'](_0xe127('0x73'),util[_0xe127('0x47')](_0x5814b7,{'showHidden':![],'depth':null}));var _0x49d8c9=this[_0xe127('0x16')][_0x5814b7['queue']];if(_0x49d8c9){logger[_0xe127('0x4f')](_0xe127('0x74'),_0x49d8c9[_0xe127('0x60')]);this[_0xe127('0x18')][_0xe127('0x62')][_0x49d8c9['name']]={'summaryEvent':_0x5814b7};this[_0xe127('0x18')][_0xe127('0x70')]+=0x1;return ami[_0xe127('0x40')]({'action':_0xe127('0x68'),'queue':_0x49d8c9[_0xe127('0x60')]})['then'](function(_0x2ffc72){if(!_0x2e04aa[_0xe127('0x18')][_0xe127('0x68')][_0x5814b7[_0xe127('0x67')]]){_0x2e04aa[_0xe127('0x18')]['queuestatus'][_0x5814b7[_0xe127('0x67')]]={};}_0x2e04aa['summary']['queuestatus'][_0x5814b7[_0xe127('0x67')]][_0x2ffc72[_0xe127('0x67')]]={'queue':_0x49d8c9[_0xe127('0x60')],'agents':[]};})[_0xe127('0x43')](function(_0x175ac6){throw _0x175ac6;});}}}catch(_0x375608){logger['error'](_0xe127('0x69'),util[_0xe127('0x47')](_0x375608,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe127('0xc')][_0xe127('0x1e')]=function(_0x3729ce){if(this['summary'][_0xe127('0x70')]>0x0){this[_0xe127('0x18')][_0xe127('0x71')]=_0x3729ce;return;}logger[_0xe127('0x4f')](_0xe127('0x75'),util[_0xe127('0x47')](_0x3729ce,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0xe127('0x4e')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xe127('0xc')][_0xe127('0x24')]=function(_0x2e5d20){try{if(this[_0xe127('0x72')](_0x2e5d20)){logger[_0xe127('0x4f')](_0xe127('0x76'),_0x2e5d20[_0xe127('0x57')],util[_0xe127('0x47')](_0x2e5d20,{'showHidden':![],'depth':null}));if(_[_0xe127('0x61')](this['queueReports'][_0x2e5d20['uniqueid']])){this['queueReports'][_0x2e5d20[_0xe127('0x57')]]=[];}if(_[_0xe127('0x61')](this['channels'][_0x2e5d20[_0xe127('0x57')]])){this[_0xe127('0x14')][_0x2e5d20['uniqueid']]={};}var _0x4b1029=new QueueReport();_0x4b1029[_0xe127('0x54')]=_0x2e5d20[_0xe127('0x54')];_0x4b1029[_0xe127('0x5d')]=this[_0xe127('0x16')][_0x4b1029['queue']]&&this[_0xe127('0x16')][_0x4b1029[_0xe127('0x54')]][_0xe127('0x5d')]?this[_0xe127('0x16')][_0x4b1029['queue']][_0xe127('0x5d')]||_0xe127('0x5e'):_0xe127('0x5e');_0x4b1029[_0xe127('0x77')]=moment()[_0xe127('0x52')](_0xe127('0x78'));_0x4b1029[_0xe127('0x79')]=_0x2e5d20[_0xe127('0x79')];_0x4b1029[_0xe127('0x7a')]=_0x2e5d20[_0xe127('0x7a')];_0x4b1029[_0xe127('0x57')]=_0x2e5d20['uniqueid'];_0x4b1029[_0xe127('0x7b')]=this[_0xe127('0x14')][_0x2e5d20[_0xe127('0x57')]][_0xe127('0x7b')];logger[_0xe127('0x7c')](_0xe127('0x7d'),_0x4b1029['queue'],_0x4b1029[_0xe127('0x5d')]);Object[_0xe127('0x7e')](_0x4b1029,_[_0xe127('0x7f')](_0x2e5d20,_[_0xe127('0x80')](_0x4b1029)));this[_0xe127('0x11')][_0x2e5d20['uniqueid']][_0xe127('0x81')](_0x4b1029);this[_0xe127('0x14')][_0x2e5d20[_0xe127('0x57')]]=_0x4b1029;this[_0xe127('0x82')](_0x4b1029,'queuecallerjoin');}}catch(_0x2a9f1b){logger['error'](_0xe127('0x76'),_0x2e5d20['uniqueid'],util[_0xe127('0x47')](_0x2a9f1b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe127('0xc')]['syncQueueCallerAbandon']=function(_0x35369d){try{if(this[_0xe127('0x72')](_0x35369d)){logger[_0xe127('0x4f')](_0xe127('0x83'),_0x35369d[_0xe127('0x57')],util[_0xe127('0x47')](_0x35369d,{'showHidden':![],'depth':null}));if(this[_0xe127('0x11')][_0x35369d[_0xe127('0x57')]]){var _0x537ac9=_[_0xe127('0x84')](this[_0xe127('0x11')][_0x35369d[_0xe127('0x57')]]);_0x537ac9[_0xe127('0x85')]=![];_0x537ac9[_0xe127('0x86')]=null;_0x537ac9[_0xe127('0x87')]=_0x35369d['holdtime'];_0x537ac9[_0xe127('0x88')]=_0x35369d['originalposition'];_0x537ac9[_0xe127('0x25')]=!![];_0x537ac9[_0xe127('0x89')]=moment()[_0xe127('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x537ac9[_0xe127('0x58')]=_0xe127('0x8a');_0x537ac9[_0xe127('0x8b')]=null;logger[_0xe127('0x7c')](_0xe127('0x8c'),_0x537ac9[_0xe127('0x54')],_0x537ac9[_0xe127('0x5d')]);this[_0xe127('0x14')][_0x35369d['uniqueid']]=_0x537ac9;this['emitVoiceQueueChannelRemove'](_0x537ac9,_0xe127('0x25'));}}}catch(_0x5193e6){logger[_0xe127('0x45')](_0xe127('0x83'),_0x35369d[_0xe127('0x57')],util[_0xe127('0x47')](_0x5193e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe127('0xc')][_0xe127('0x8d')]=function(_0x21649e){try{if(this[_0xe127('0x72')](_0x21649e)){logger[_0xe127('0x4f')](_0xe127('0x8e'),_0x21649e[_0xe127('0x57')],util[_0xe127('0x47')](_0x21649e,{'showHidden':![],'depth':null}));if(this[_0xe127('0x11')][_0x21649e['uniqueid']]){var _0x10e24c=_['last'](this[_0xe127('0x11')][_0x21649e[_0xe127('0x57')]]);_0x10e24c[_0xe127('0x8f')]=moment()[_0xe127('0x52')](_0xe127('0x78'));_0x10e24c['connectedlinenum']=_0x21649e[_0xe127('0x90')];_0x10e24c['connectedlinename']=_0x21649e[_0xe127('0x91')];logger['info'](_0xe127('0x92'),_0x10e24c[_0xe127('0x54')],_0x10e24c[_0xe127('0x5d')],_0x21649e[_0xe127('0x90')],_0x21649e[_0xe127('0x91')]);this[_0xe127('0x14')][_0x21649e[_0xe127('0x57')]]=_0x10e24c;this[_0xe127('0x82')](_0x10e24c,'queuecallerleave');}}}catch(_0x2df9a0){logger[_0xe127('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x21649e[_0xe127('0x57')],util[_0xe127('0x47')](_0x2df9a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe127('0xc')][_0xe127('0x29')]=function(_0x1e166f){try{if(this[_0xe127('0x72')](_0x1e166f)){logger[_0xe127('0x4f')](_0xe127('0x93'),_0x1e166f['uniqueid'],util['inspect'](_0x1e166f,{'showHidden':![],'depth':null}));if(this[_0xe127('0x11')][_0x1e166f[_0xe127('0x57')]]){var _0xd198a0=_[_0xe127('0x84')](this['queueReports'][_0x1e166f[_0xe127('0x57')]]);_0xd198a0[_0xe127('0x85')]=!![];_0xd198a0['queuecallerexitreason']=_0xe127('0x94');logger['info'](_0xe127('0x95'),_0xd198a0[_0xe127('0x54')],_0xd198a0[_0xe127('0x5d')]);}}}catch(_0x48bac5){logger[_0xe127('0x45')](_0xe127('0x93'),_0x1e166f[_0xe127('0x57')],util[_0xe127('0x47')](_0x48bac5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe127('0xc')][_0xe127('0x28')]=function(_0x4132cd){try{if(this[_0xe127('0x72')](_0x4132cd)){logger[_0xe127('0x4f')]('[%s][voiceQueueReport][agentcomplete]',_0x4132cd[_0xe127('0x57')],util[_0xe127('0x47')](_0x4132cd,{'showHidden':![],'depth':null}));if(this[_0xe127('0x11')][_0x4132cd['uniqueid']]){var _0x5997d1=_['last'](this['queueReports'][_0x4132cd[_0xe127('0x57')]]);_0x5997d1['queuecallerabandon']=![];_0x5997d1[_0xe127('0x89')]=null;_0x5997d1[_0xe127('0x96')]=!![];_0x5997d1[_0xe127('0x8b')]=_0x4132cd[_0xe127('0x97')];_0x5997d1['holdtime']=_0x4132cd[_0xe127('0x87')];_0x5997d1[_0xe127('0x85')]=!![];_0x5997d1[_0xe127('0x3c')]=![];_0x5997d1[_0xe127('0x98')]=null;if(!_0x5997d1['transfer']){if(_0x4132cd['reason']==_0xe127('0x99')){_0x5997d1[_0xe127('0x58')]=_0xe127('0x9a');logger[_0xe127('0x7c')](_0xe127('0x9b'),_0x5997d1[_0xe127('0x54')],_0x5997d1[_0xe127('0x5d')]);}else{if(_[_0xe127('0x9c')](_0x4132cd[_0xe127('0x42')]['toLowerCase'](),_0xe127('0x9d'))){if(this[_0xe127('0x11')][_0x4132cd[_0xe127('0x9e')]]){var _0x55907a=_[_0xe127('0x84')](this[_0xe127('0x11')][_0x4132cd[_0xe127('0x9e')]]);_0x55907a[_0xe127('0x85')]=![];_0x55907a[_0xe127('0x3c')]=!![];_0x55907a[_0xe127('0x98')]=moment(_0x5997d1['queuecallerjoinAt'])[_0xe127('0x9f')](_0x4132cd[_0xe127('0x87')],_0xe127('0xa0'))[_0xe127('0x52')](_0xe127('0x78'));_0x55907a[_0xe127('0x58')]='FORWARDTRANSFER';_0x55907a[_0xe127('0x99')]=!![];_0x55907a['transfertype']=_0xe127('0xa1');_0x55907a[_0xe127('0xa2')]=_0x4132cd[_0xe127('0xa3')];_0x55907a['transferuniqueid']=_0x4132cd[_0xe127('0x57')];logger[_0xe127('0x7c')](_0xe127('0xa4'),_0x55907a[_0xe127('0x54')],_0x55907a[_0xe127('0x5d')]);var _0x535b90=this[_0xe127('0x11')][_0x4132cd[_0xe127('0x9e')]];this[_0xe127('0x11')][_0x4132cd[_0xe127('0x9e')]]=this['queueReports'][_0x4132cd['uniqueid']];this['queueReports'][_0x4132cd['uniqueid']]=_0x535b90;}}else{_0x5997d1[_0xe127('0x58')]=_0xe127('0xa5')+_0x4132cd[_0xe127('0xa6')][_0xe127('0xa7')]();logger[_0xe127('0x7c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5997d1['queue'],_0x5997d1[_0xe127('0x5d')],_0x5997d1[_0xe127('0x58')]);}}}this[_0xe127('0x14')][_0x4132cd[_0xe127('0x57')]]=_0x5997d1;}}}catch(_0x4a5362){logger['error'](_0xe127('0xa8'),_0x4132cd[_0xe127('0x57')],util[_0xe127('0x47')](_0x4a5362,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe127('0xa9')]=function(_0x30b640){try{if(this['isNotNull'](_0x30b640)){logger[_0xe127('0x4f')](_0xe127('0xaa'),_0x30b640[_0xe127('0x57')],util[_0xe127('0x47')](_0x30b640,{'showHidden':![],'depth':null}));this['addVariable'](_0x30b640[_0xe127('0x57')],_[_0xe127('0x80')](_0x30b640[_0xe127('0xab')])[0x0],_0x30b640['value']);if(this[_0xe127('0x11')][_0x30b640['uniqueid']]){var _0x251d90=_[_0xe127('0x84')](this['queueReports'][_0x30b640[_0xe127('0x57')]]);if(_0x251d90){if(this[_0xe127('0x72')](_0x30b640[_0xe127('0xab')])&&this[_0xe127('0x72')](_0x30b640[_0xe127('0xab')][_0xe127('0x68')])){switch(_0x30b640['value']){case _0xe127('0xac'):_0x251d90['queuecallerexit']=![];_0x251d90[_0xe127('0x98')]=null;break;case _0xe127('0xad'):_0x251d90['lastevent']=_0xe127('0xae');_0x251d90[_0xe127('0x3c')]=!![];_0x251d90['queuecallerexitAt']=moment()[_0xe127('0x52')](_0xe127('0x78'));_0x251d90[_0xe127('0x8f')]=moment()[_0xe127('0x52')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xe127('0x4f')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x30b640['uniqueid'],util['inspect'](_0x251d90,{'showHidden':![],'depth':null}));ami[_0xe127('0x4e')](_0xe127('0xaf'),_0x251d90);break;default:_0x251d90[_0xe127('0x3c')]=!![];_0x251d90[_0xe127('0x98')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x251d90[_0xe127('0x8f')]=moment()[_0xe127('0x52')](_0xe127('0x78'));}_0x251d90['queuecallerabandon']=![];_0x251d90[_0xe127('0x89')]=null;_0x251d90['queuecallerexitreason']=_0x30b640[_0xe127('0xb0')];this[_0xe127('0x14')][_0x30b640['uniqueid']]=_0x251d90;this['emitVoiceQueueChannelRemove'](_0x251d90,_0xe127('0x2a'));}else if(this[_0xe127('0x72')](_0x30b640[_0xe127('0xab')])&&this['isNotNull'](_0x30b640[_0xe127('0xab')]['queueposition'])){if(!_0x251d90[_0xe127('0x25')]){_0x251d90[_0xe127('0x3c')]=!![];_0x251d90['queuecallerexitAt']=moment()[_0xe127('0x52')](_0xe127('0x78'));_0x251d90[_0xe127('0x58')]=_0xe127('0xb1');_0x251d90['queuecallerleaveAt']=moment()[_0xe127('0x52')](_0xe127('0x78'));this[_0xe127('0x14')][_0x30b640[_0xe127('0x57')]]=_0x251d90;}}logger['info'](_0xe127('0xb2'),_0x30b640[_0xe127('0x57')],_0x251d90[_0xe127('0x54')],_0x251d90[_0xe127('0x5d')],_[_0xe127('0x80')](_0x30b640[_0xe127('0xab')])[0x0],_0x30b640[_0xe127('0xb0')]);_0x251d90[_0xe127('0x19')]=this[_0xe127('0x19')][_0x30b640[_0xe127('0x57')]];}}}}catch(_0x51269e){logger[_0xe127('0x45')](_0xe127('0xaa'),_0x30b640[_0xe127('0x57')],util['inspect'](_0x51269e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe127('0xb3')]=function(_0xd38c7a,_0x69b496,_0x536d40){var _0x3f9dcc=['rtpaudioqos',_0xe127('0xb4'),_0xe127('0xb5'),_0xe127('0xb6'),_0xe127('0xb7'),_0xe127('0xb8'),_0xe127('0xb9'),_0xe127('0xba'),_0xe127('0xbb'),'sipuri',_0xe127('0xbc'),_0xe127('0xbd'),_0xe127('0xbe'),'memberdynamic',_0xe127('0xbf'),_0xe127('0xc0'),_0xe127('0x97'),_0xe127('0xc1'),_0xe127('0xc2')];if(!_[_0xe127('0x3f')](_0x69b496)&&!_[_0xe127('0xc3')](_0x3f9dcc,_0x69b496)){if(_['isUndefined'](this['variables'][_0xd38c7a])){this['variables'][_0xd38c7a]={};}this[_0xe127('0x19')][_0xd38c7a][_0x69b496]=_0x536d40;}};VoiceQueueReport['prototype'][_0xe127('0xc4')]=function(_0x47fef0,_0x1c983e,_0x2507da){try{var _0x2f3eab={};if(this[_0xe127('0x11')][_0x47fef0]){for(var _0x4b08d1=0x0;_0x4b08d1=0x0?moment(_0x29f93c[_0xd2bc('0x15')])[_0xd2bc('0x16')](_0x29f93c['starttime'],_0xd2bc('0xd')):null,'data1':'outbound','data2':_0x29f93c[_0xd2bc('0x12')],'data3':_0x29f93c[_0xd2bc('0xf')],'data4':_0x29f93c[_0xd2bc('0x18')]||null,'role':_0xd2bc('0x19'),'internal':_0x29f93c[_0xd2bc('0x12')]?_['toNumber'](_0x29f93c[_0xd2bc('0x12')]):undefined,'uniqueid':_0x29f93c['uniqueid']},'log':_0xd2bc('0x14')});}; \ No newline at end of file +var _0xd1fb=['agent','accountcode','toNumber','starttime','endtime','seconds','uniqueid','moment','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','inbound','exten','queue'];(function(_0x39a1ee,_0x5a47f9){var _0x8bcf88=function(_0x405087){while(--_0x405087){_0x39a1ee['push'](_0x39a1ee['shift']());}};_0x8bcf88(++_0x5a47f9);}(_0xd1fb,0xe8));var _0xbd1f=function(_0x30b634,_0x56b051){_0x30b634=_0x30b634-0x0;var _0x39ee3a=_0xd1fb[_0x30b634];return _0x39ee3a;};'use strict';var moment=require(_0xbd1f('0x0'));var _=require('lodash');var util=require(_0xbd1f('0x1'));var client=require(_0xbd1f('0x2'));exports[_0xbd1f('0x3')]=function(_0x2d4545){var _0x1b03ca=_0x2d4545['queuecallercompleteAt']||_0x2d4545[_0xbd1f('0x4')];return client[_0xbd1f('0x5')](_0xbd1f('0x6'),{'body':{'channel':_0xbd1f('0x7'),'membername':_0x2d4545[_0xbd1f('0x8')],'interface':_[_0xbd1f('0x9')](_0x2d4545['interface'])?util['format'](_0xbd1f('0xa'),_0x2d4545[_0xbd1f('0x8')]):_0x2d4545[_0xbd1f('0xb')],'type':_0xbd1f('0xc'),'enterAt':_0x2d4545[_0xbd1f('0xd')],'exitAt':_0x1b03ca,'duration':moment(_0x1b03ca)[_0xbd1f('0xe')](_0x2d4545[_0xbd1f('0xd')],'seconds'),'data1':_0xbd1f('0xf'),'data2':_0x2d4545['calleridnum'],'data3':_0x2d4545[_0xbd1f('0x10')],'data4':null,'data5':_0x2d4545[_0xbd1f('0x11')],'role':_0xbd1f('0x12'),'internal':_0x2d4545[_0xbd1f('0x13')]?_[_0xbd1f('0x14')](_0x2d4545['accountcode']):undefined,'uniqueid':_0x2d4545['uniqueid']},'log':_0xbd1f('0x6')});};exports['voiceDialReport']=function(_0x142e44){return client['Request'](_0xbd1f('0x6'),{'body':{'channel':_0xbd1f('0x7'),'membername':_0x142e44['membername'],'interface':_0x142e44['interface'],'type':_0xbd1f('0xc'),'enterAt':_0x142e44[_0xbd1f('0x15')],'exitAt':_0x142e44[_0xbd1f('0x16')],'duration':moment(_0x142e44['endtime'])[_0xbd1f('0xe')](_0x142e44[_0xbd1f('0x15')],_0xbd1f('0x17'))>=0x0?moment(_0x142e44[_0xbd1f('0x16')])[_0xbd1f('0xe')](_0x142e44[_0xbd1f('0x15')],_0xbd1f('0x17')):null,'data1':'outbound','data2':_0x142e44[_0xbd1f('0x13')],'data3':_0x142e44[_0xbd1f('0x10')],'data4':_0x142e44['dialstring']||null,'role':_0xbd1f('0x12'),'internal':_0x142e44[_0xbd1f('0x13')]?_[_0xbd1f('0x14')](_0x142e44[_0xbd1f('0x13')]):undefined,'uniqueid':_0x142e44[_0xbd1f('0x18')]},'log':_0xbd1f('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 2ce6975..d85fdd1 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 _0xd668=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0x3c10a9,_0x5c98b1){var _0x3d3f77=function(_0xbf5038){while(--_0xbf5038){_0x3c10a9['push'](_0x3c10a9['shift']());}};_0x3d3f77(++_0x5c98b1);}(_0xd668,0x108));var _0x8d66=function(_0x3e05d2,_0x5e874f){_0x3e05d2=_0x3e05d2-0x0;var _0x54dd4f=_0xd668[_0x3e05d2];return _0x54dd4f;};'use strict';var client=require(_0x8d66('0x0'));exports[_0x8d66('0x1')]=function(){return client[_0x8d66('0x2')](_0x8d66('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8d66('0x4'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0xe809=['GetSettings','../client','Request','ShowSetting','previewRecallmeReminderInterval'];(function(_0x3aa889,_0x45a1f7){var _0x4ea2d8=function(_0x16a3de){while(--_0x16a3de){_0x3aa889['push'](_0x3aa889['shift']());}};_0x4ea2d8(++_0x45a1f7);}(_0xe809,0xa1));var _0x9e80=function(_0x36655f,_0x292482){_0x36655f=_0x36655f-0x0;var _0x26e84b=_0xe809[_0x36655f];return _0x26e84b;};'use strict';var client=require(_0x9e80('0x0'));exports['getSettings']=function(){return client[_0x9e80('0x1')](_0x9e80('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x9e80('0x3')]},'log':_0x9e80('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 9957cb4..eee03c7 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 _0x0592=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0592,0xf3));var _0x2059=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0592[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x2059('0x0'));exports[_0x2059('0x1')]=function(_0x1362e7){return function(_0x35d280){return client[_0x2059('0x2')](_0x2059('0x3'),{'options':{'raw':!![],'attributes':['id',_0x2059('0x4'),'html']},'log':_0x2059('0x3')});};}; \ No newline at end of file +var _0xd1f2=['GetTemplate','name','html'];(function(_0x160ff3,_0x3dc783){var _0xbd1439=function(_0x23a181){while(--_0x23a181){_0x160ff3['push'](_0x160ff3['shift']());}};_0xbd1439(++_0x3dc783);}(_0xd1f2,0xed));var _0x2d1f=function(_0x11caec,_0x494c3c){_0x11caec=_0x11caec-0x0;var _0x5d715e=_0xd1f2[_0x11caec];return _0x5d715e;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x239555){return function(_0x7675ff){return client['Request'](_0x2d1f('0x0'),{'options':{'raw':!![],'attributes':['id',_0x2d1f('0x1'),_0x2d1f('0x2')]},'log':_0x2d1f('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 72ac91c..ba0109d 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 _0x8ef3=['AnyConditions','operator','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','Request','GetTrigger','name','Condition','AllConditions','field','value'];(function(_0x42f2f6,_0x198959){var _0x6be204=function(_0x4e3773){while(--_0x4e3773){_0x42f2f6['push'](_0x42f2f6['shift']());}};_0x6be204(++_0x198959);}(_0x8ef3,0xfc));var _0x38ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8ef3[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x38ef('0x0'));exports['getTriggers']=function(_0x708bd1){return function(_0x50e14f){return client[_0x38ef('0x1')](_0x38ef('0x2'),{'options':{'raw':![],'attributes':['id',_0x38ef('0x3'),'channel','status'],'include':[{'model':_0x38ef('0x4'),'as':_0x38ef('0x5'),'attributes':['id',_0x38ef('0x6'),'operator',_0x38ef('0x7')]},{'model':_0x38ef('0x4'),'as':_0x38ef('0x8'),'attributes':['id',_0x38ef('0x6'),_0x38ef('0x9'),'value']},{'model':_0x38ef('0xa'),'as':_0x38ef('0xb'),'attributes':['id',_0x38ef('0xc'),_0x38ef('0xd'),_0x38ef('0xe'),_0x38ef('0xf'),_0x38ef('0x10'),_0x38ef('0x11'),_0x38ef('0x12'),_0x38ef('0x13')]}]},'log':_0x38ef('0x2')});};}; \ No newline at end of file +var _0x0645=['AllConditions','field','value','AnyConditions','Action','data1','data2','data5','data6','getTriggers','Request','GetTrigger','name','channel','status','Condition'];(function(_0x42dd7c,_0xa0c574){var _0x478c95=function(_0x15ac85){while(--_0x15ac85){_0x42dd7c['push'](_0x42dd7c['shift']());}};_0x478c95(++_0xa0c574);}(_0x0645,0xb9));var _0x5064=function(_0x3d6538,_0x55e4fa){_0x3d6538=_0x3d6538-0x0;var _0x414abb=_0x0645[_0x3d6538];return _0x414abb;};'use strict';var client=require('../client');exports[_0x5064('0x0')]=function(_0x39eddb){return function(_0x2e54cd){return client[_0x5064('0x1')](_0x5064('0x2'),{'options':{'raw':![],'attributes':['id',_0x5064('0x3'),_0x5064('0x4'),_0x5064('0x5')],'include':[{'model':_0x5064('0x6'),'as':_0x5064('0x7'),'attributes':['id',_0x5064('0x8'),'operator',_0x5064('0x9')]},{'model':'Condition','as':_0x5064('0xa'),'attributes':['id',_0x5064('0x8'),'operator',_0x5064('0x9')]},{'model':_0x5064('0xb'),'as':'Actions','attributes':['id','action',_0x5064('0xc'),_0x5064('0xd'),'data3','data4',_0x5064('0xe'),_0x5064('0xf'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9fa8f0c..69a6c03 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 _0xff33=['registry','defaultuser','getTrunks','Request','GetTrunk'];(function(_0x5d6ad9,_0x19e770){var _0x24a957=function(_0x235b96){while(--_0x235b96){_0x5d6ad9['push'](_0x5d6ad9['shift']());}};_0x24a957(++_0x19e770);}(_0xff33,0x70));var _0x3ff3=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xff33[_0x3902c1];return _0x1266cc;};'use strict';var client=require('../client');exports[_0x3ff3('0x0')]=function(_0x546027){return function(_0x27dda2){return client[_0x3ff3('0x1')](_0x3ff3('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x3ff3('0x3'),_0x3ff3('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x425d=['getTrunks','Request','name','registry','defaultuser','../client'];(function(_0x420958,_0x1b542c){var _0x41b6f6=function(_0x25b2f0){while(--_0x25b2f0){_0x420958['push'](_0x420958['shift']());}};_0x41b6f6(++_0x1b542c);}(_0x425d,0x179));var _0xd425=function(_0x37df6f,_0x51d002){_0x37df6f=_0x37df6f-0x0;var _0x87e89b=_0x425d[_0x37df6f];return _0x87e89b;};'use strict';var client=require(_0xd425('0x0'));exports[_0xd425('0x1')]=function(_0x1be11f){return function(_0x514bf2){return client[_0xd425('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd425('0x3'),_0xd425('0x4'),_0xd425('0x5')]},'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 8921868..7805d1f 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x183fa3,_0x264aab){var _0x5c35dd=function(_0x3babc0){while(--_0x3babc0){_0x183fa3['push'](_0x183fa3['shift']());}};_0x5c35dd(++_0x264aab);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xcb91[_0x836465];return _0x2150ea;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x281ef7,_0x43d475){var _0x590d1e=function(_0x54718c){while(--_0x54718c){_0x281ef7['push'](_0x281ef7['shift']());}};_0x590d1e(++_0x43d475);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0xcb91[_0x59710f];return _0xaae66a;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 67ef7fa..538ba6e 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 _0x8863=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x3289f7,_0x7274dc){var _0x3fa34b=function(_0x3e8b22){while(--_0x3e8b22){_0x3289f7['push'](_0x3289f7['shift']());}};_0x3fa34b(++_0x7274dc);}(_0x8863,0x1d0));var _0x3886=function(_0x2378ef,_0x1b182e){_0x2378ef=_0x2378ef-0x0;var _0x9dc6fb=_0x8863[_0x2378ef];return _0x9dc6fb;};'use strict';var client=require(_0x3886('0x0'));exports[_0x3886('0x1')]=function(_0x3fe4c3){return client[_0x3886('0x2')](_0x3886('0x3'),{'body':_0x3fe4c3,'log':_0x3886('0x3')});};exports[_0x3886('0x4')]=function(_0x424f0f,_0x44dbdf,_0x41894b){return client[_0x3886('0x2')]('UpdateVoiceAgentReport',{'body':_0x424f0f,'options':{'where':{'uniqueid':_0x44dbdf,'interface':_0x41894b,'agentcomplete':!![]}},'log':_0x3886('0x5')});}; \ No newline at end of file +var _0x3204=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x4bee99,_0xc0ce42){var _0x131576=function(_0x43a824){while(--_0x43a824){_0x4bee99['push'](_0x4bee99['shift']());}};_0x131576(++_0xc0ce42);}(_0x3204,0x19b));var _0x4320=function(_0x153daa,_0x8c24bb){_0x153daa=_0x153daa-0x0;var _0x6fef4c=_0x3204[_0x153daa];return _0x6fef4c;};'use strict';var client=require(_0x4320('0x0'));exports[_0x4320('0x1')]=function(_0x388906){return client[_0x4320('0x2')](_0x4320('0x3'),{'body':_0x388906,'log':_0x4320('0x3')});};exports['update']=function(_0x3c5161,_0x30c573,_0x2a55ac){return client[_0x4320('0x2')](_0x4320('0x4'),{'body':_0x3c5161,'options':{'where':{'uniqueid':_0x30c573,'interface':_0x2a55ac,'agentcomplete':!![]}},'log':_0x4320('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 345e837..e2e4685 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 _0xc3de=['lodash','../client','create','Request','merge','calleridnum','context','callerid','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','day','type','disposition','billableseconds','moment'];(function(_0x30f09d,_0x583cb9){var _0x1d153a=function(_0x2aa4a6){while(--_0x2aa4a6){_0x30f09d['push'](_0x30f09d['shift']());}};_0x1d153a(++_0x583cb9);}(_0xc3de,0x175));var _0xec3d=function(_0x15992b,_0x435dbb){_0x15992b=_0x15992b-0x0;var _0xd2c099=_0xc3de[_0x15992b];return _0xd2c099;};'use strict';var moment=require(_0xec3d('0x0'));var util=require('util');var _=require(_0xec3d('0x1'));var client=require(_0xec3d('0x2'));exports[_0xec3d('0x3')]=function(_0x579cf6){return client[_0xec3d('0x4')]('CreateVoiceCallReport',{'body':_[_0xec3d('0x5')](_0x579cf6,{'source':_0x579cf6[_0xec3d('0x6')],'destinationcontext':_0x579cf6[_0xec3d('0x7')],'callerid':_0x579cf6[_0xec3d('0x8')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0xec3d('0x4')](_0xec3d('0x9'),{'options':{'where':{'type':[_0xec3d('0xa')],'createdAt':{'$between':[moment()['startOf']('day')[_0xec3d('0xb')](_0xec3d('0xc')),moment()['endOf'](_0xec3d('0xd'))[_0xec3d('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xec3d('0xe'),_0xec3d('0xf'),'duration',_0xec3d('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x0db3=['GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0x18ee6a,_0xe57b02){var _0x20758a=function(_0x2382f1){while(--_0x2382f1){_0x18ee6a['push'](_0x18ee6a['shift']());}};_0x20758a(++_0xe57b02);}(_0x0db3,0x15b));var _0x30db=function(_0x54dd6c,_0x765a2){_0x54dd6c=_0x54dd6c-0x0;var _0x1206cc=_0x0db3[_0x54dd6c];return _0x1206cc;};'use strict';var moment=require(_0x30db('0x0'));var util=require('util');var _=require(_0x30db('0x1'));var client=require('../client');exports['create']=function(_0x5eef3d){return client[_0x30db('0x2')](_0x30db('0x3'),{'body':_[_0x30db('0x4')](_0x5eef3d,{'source':_0x5eef3d[_0x30db('0x5')],'destinationcontext':_0x5eef3d[_0x30db('0x6')],'callerid':_0x5eef3d[_0x30db('0x7')],'amaflags':_0x30db('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x30db('0x9')]=function(){return function(){return client[_0x30db('0x2')](_0x30db('0xa'),{'options':{'where':{'type':[_0x30db('0xb')],'createdAt':{'$between':[moment()[_0x30db('0xc')](_0x30db('0xd'))[_0x30db('0xe')](_0x30db('0xf')),moment()[_0x30db('0x10')](_0x30db('0xd'))[_0x30db('0xe')](_0x30db('0xf'))]}},'attributes':[_0x30db('0x11'),_0x30db('0x12'),_0x30db('0x13'),'billableseconds']},'log':_0x30db('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 81286fe..9e41ace 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 _0x6a39=['../client','Request','CreateVoiceDialReport'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x6a39,0x75));var _0x96a3=function(_0x11c3a7,_0x4fc46b){_0x11c3a7=_0x11c3a7-0x0;var _0x249aa0=_0x6a39[_0x11c3a7];return _0x249aa0;};'use strict';var client=require(_0x96a3('0x0'));exports['create']=function(_0x246ea8){return client[_0x96a3('0x1')](_0x96a3('0x2'),{'body':_0x246ea8,'log':_0x96a3('0x2')});}; \ No newline at end of file +var _0x5377=['create','Request','CreateVoiceDialReport','../client'];(function(_0x36f154,_0x48c16f){var _0x4be176=function(_0x4c0639){while(--_0x4c0639){_0x36f154['push'](_0x36f154['shift']());}};_0x4be176(++_0x48c16f);}(_0x5377,0xaf));var _0x7537=function(_0x1545c4,_0x49d0d9){_0x1545c4=_0x1545c4-0x0;var _0x28094a=_0x5377[_0x1545c4];return _0x28094a;};'use strict';var client=require(_0x7537('0x0'));exports[_0x7537('0x1')]=function(_0x4db10e){return client[_0x7537('0x2')](_0x7537('0x3'),{'body':_0x4db10e,'log':_0x7537('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2efd0ae..29811bc 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 _0xc91b=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x439db7,_0x5311f9){var _0x52afc5=function(_0x4b5bf4){while(--_0x4b5bf4){_0x439db7['push'](_0x439db7['shift']());}};_0x52afc5(++_0x5311f9);}(_0xc91b,0x16f));var _0xbc91=function(_0x22e45e,_0x2722cc){_0x22e45e=_0x22e45e-0x0;var _0x40aaa9=_0xc91b[_0x22e45e];return _0x40aaa9;};'use strict';var client=require(_0xbc91('0x0'));exports[_0xbc91('0x1')]=function(){return function(){return client[_0xbc91('0x2')](_0xbc91('0x3'),{'options':{'raw':!![],'attributes':['id',_0xbc91('0x4'),_0xbc91('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xbc91('0x1')});};}; \ No newline at end of file +var _0xbc9d=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x304975,_0x1fa1df){_0x304975=_0x304975-0x0;var _0x2dce52=_0xbc9d[_0x304975];return _0x2dce52;};'use strict';var client=require(_0xdbc9('0x0'));exports[_0xdbc9('0x1')]=function(){return function(){return client[_0xdbc9('0x2')](_0xdbc9('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdbc9('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8037bf6..f8bb4ed 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 _0xda2c=['dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xda2c,0x71));var _0xcda2=function(_0x158d1a,_0x3569ed){_0x158d1a=_0x158d1a-0x0;var _0x3fb15f=_0xda2c[_0x158d1a];return _0x3fb15f;};'use strict';var client=require(_0xcda2('0x0'));exports[_0xcda2('0x1')]=function(){return function(){return client['Request'](_0xcda2('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xcda2('0x3'),'acwTimeout','autopause',_0xcda2('0x4'),_0xcda2('0x5'),_0xcda2('0x6'),_0xcda2('0x7'),_0xcda2('0x8'),_0xcda2('0x9'),_0xcda2('0xa'),_0xcda2('0xb'),'dialPredictiveOptimizationPercentage',_0xcda2('0xc'),'dialOriginateCallerIdName',_0xcda2('0xd'),_0xcda2('0xe'),_0xcda2('0xf'),_0xcda2('0x10'),_0xcda2('0x11'),'dialCongestionMaxRetry',_0xcda2('0x12'),'dialBusyMaxRetry',_0xcda2('0x13'),_0xcda2('0x14'),'dialNoAnswerRetryFrequency',_0xcda2('0x15'),_0xcda2('0x16'),_0xcda2('0x17'),_0xcda2('0x18'),'dialCheckDuplicateType',_0xcda2('0x19'),_0xcda2('0x1a'),_0xcda2('0x1b'),_0xcda2('0x1c'),_0xcda2('0x1d'),_0xcda2('0x1e'),_0xcda2('0x1f'),_0xcda2('0x20'),_0xcda2('0x21'),'dialAMDMaximumWordLength',_0xcda2('0x22'),_0xcda2('0x23'),_0xcda2('0x24'),_0xcda2('0x25'),_0xcda2('0x26'),_0xcda2('0x27'),_0xcda2('0x28'),_0xcda2('0x4'),_0xcda2('0x29'),_0xcda2('0x2a'),'dialCutDigit',_0xcda2('0x2b'),_0xcda2('0x2c'),_0xcda2('0x2d'),_0xcda2('0x2e'),_0xcda2('0x2f'),_0xcda2('0x30'),'dialMachineMaxRetry',_0xcda2('0x31'),_0xcda2('0x32'),_0xcda2('0x33'),_0xcda2('0x34'),_0xcda2('0x35'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe',_0xcda2('0x36')],'include':[{'model':'Trunk','as':_0xcda2('0x37'),'attributes':['id',_0xcda2('0x38'),_0xcda2('0x39'),_0xcda2('0x3a')]},{'model':_0xcda2('0x3b'),'as':_0xcda2('0x3c'),'attributes':['id',_0xcda2('0x38')]},{'model':'Trunk','as':_0xcda2('0x3d'),'attributes':['id','name','callerid',_0xcda2('0x3a')]},{'model':'Interval','as':_0xcda2('0x3e'),'attributes':['id',_0xcda2('0x38')],'include':[{'model':_0xcda2('0x3e'),'as':_0xcda2('0x3f'),'attributes':['id',_0xcda2('0x38'),_0xcda2('0x40')]}]}]},'log':_0xcda2('0x1')});};}; \ No newline at end of file +var _0x56fa=['dialAMDMaximumNumberOfWords','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x460144,_0x4de972){var _0x4a3a30=function(_0x5ad106){while(--_0x5ad106){_0x460144['push'](_0x460144['shift']());}};_0x4a3a30(++_0x4de972);}(_0x56fa,0xbb));var _0xa56f=function(_0x5d8565,_0x4f9b24){_0x5d8565=_0x5d8565-0x0;var _0x364282=_0x56fa[_0x5d8565];return _0x364282;};'use strict';var client=require(_0xa56f('0x0'));exports[_0xa56f('0x1')]=function(){return function(){return client['Request'](_0xa56f('0x2'),{'options':{'raw':![],'attributes':['id',_0xa56f('0x3'),'acw','acwTimeout',_0xa56f('0x4'),_0xa56f('0x5'),_0xa56f('0x6'),_0xa56f('0x7'),_0xa56f('0x8'),_0xa56f('0x9'),'dialLimitQueue',_0xa56f('0xa'),_0xa56f('0xb'),_0xa56f('0xc'),'dialPredictiveInterval',_0xa56f('0xd'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0xa56f('0xe'),_0xa56f('0xf'),'dialQueueProject',_0xa56f('0x10'),_0xa56f('0x11'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xa56f('0x12'),_0xa56f('0x13'),_0xa56f('0x14'),_0xa56f('0x15'),'dialGlobalInterval',_0xa56f('0x16'),_0xa56f('0x17'),'dialAMDActive',_0xa56f('0x18'),_0xa56f('0x19'),_0xa56f('0x1a'),'dialAMDTotalAnalysisTime',_0xa56f('0x1b'),_0xa56f('0x1c'),_0xa56f('0x1d'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0xa56f('0x1e'),'dialRecallMeTimeout',_0xa56f('0x1f'),_0xa56f('0x20'),_0xa56f('0x21'),_0xa56f('0x22'),_0xa56f('0x23'),'monitor_format',_0xa56f('0x24'),_0xa56f('0x25'),_0xa56f('0x26'),_0xa56f('0x27'),_0xa56f('0x28'),'dialDropMaxRetry',_0xa56f('0x29'),'dialAbandonedMaxRetry',_0xa56f('0x2a'),_0xa56f('0x2b'),_0xa56f('0x2c'),'dialAgentRejectMaxRetry',_0xa56f('0x2d'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0xa56f('0x2e'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'],'include':[{'model':_0xa56f('0x2f'),'as':_0xa56f('0x2f'),'attributes':['id',_0xa56f('0x3'),'callerid',_0xa56f('0x30')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xa56f('0x3')]},{'model':_0xa56f('0x2f'),'as':_0xa56f('0x31'),'attributes':['id',_0xa56f('0x3'),_0xa56f('0x32'),_0xa56f('0x30')]},{'model':_0xa56f('0x33'),'as':_0xa56f('0x33'),'attributes':['id',_0xa56f('0x3')],'include':[{'model':_0xa56f('0x33'),'as':_0xa56f('0x34'),'attributes':['id','name',_0xa56f('0x35')]}]}]},'log':_0xa56f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 063ba55..9e286ed 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(_0x3fab10,_0x75e2af){var _0x30ef04=function(_0xc29024){while(--_0xc29024){_0x3fab10['push'](_0x3fab10['shift']());}};_0x30ef04(++_0x75e2af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x384597,_0x8a10b){var _0x12d792=function(_0xe48e47){while(--_0xe48e47){_0x384597['push'](_0x384597['shift']());}};_0x12d792(++_0x8a10b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 85735b6..8c6b29f 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 _0x3644=['getVoiceQueueRtPauses','Request','../client'];(function(_0x38e228,_0x433aa9){var _0x512315=function(_0x1ba025){while(--_0x1ba025){_0x38e228['push'](_0x38e228['shift']());}};_0x512315(++_0x433aa9);}(_0x3644,0x7a));var _0x4364=function(_0x15a6fa,_0x5eaeaa){_0x15a6fa=_0x15a6fa-0x0;var _0x50ed0b=_0x3644[_0x15a6fa];return _0x50ed0b;};'use strict';var client=require(_0x4364('0x0'));exports[_0x4364('0x1')]=function(_0x59d6c2){return function(){return client[_0x4364('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x59d6c2,'paused':!![]},'raw':!![]},'log':_0x4364('0x1')});};}; \ No newline at end of file +var _0x8881=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x8881,0x1ee));var _0x1888=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x8881[_0x45ee03];return _0x13d535;};'use strict';var client=require('../client');exports[_0x1888('0x0')]=function(_0x244b19){return function(){return client[_0x1888('0x1')](_0x1888('0x2'),{'options':{'where':{'VoiceQueueId':_0x244b19,'paused':!![]},'raw':!![]},'log':_0x1888('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index b72b2bb..cd78cd6 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x19b4c8,_0x188e21){var _0x54ec2f=function(_0x2ec231){while(--_0x2ec231){_0x19b4c8['push'](_0x19b4c8['shift']());}};_0x54ec2f(++_0x188e21);}(_0x7a54,0x106));var _0x47a5=function(_0x4dffe2,_0x11575d){_0x4dffe2=_0x4dffe2-0x0;var _0x1b010d=_0x7a54[_0x4dffe2];return _0x1b010d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4efcfc,_0x36948c){var _0x435046=function(_0x732e72){while(--_0x732e72){_0x4efcfc['push'](_0x4efcfc['shift']());}};_0x435046(++_0x36948c);}(_0x7a54,0x106));var _0x47a5=function(_0x5f4f25,_0x54c16b){_0x5f4f25=_0x5f4f25-0x0;var _0x328703=_0x7a54[_0x5f4f25];return _0x328703;};'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 d39af29..35a4bb5 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 _0x6db6=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','result','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x6db6,0x81));var _0x66db=function(_0x357820,_0x2f9f36){_0x357820=_0x357820-0x0;var _0x81c21d=_0x6db6[_0x357820];return _0x81c21d;};'use strict';var client=require(_0x66db('0x0'));exports[_0x66db('0x1')]={};exports[_0x66db('0x2')]=function(_0x14c5a6){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x14c5a6[_0x66db('0x3')],'transfererchannel':_0x14c5a6['transfererchannel'],'transferercalleridnum':_0x14c5a6[_0x66db('0x4')],'transferercalleridname':_0x14c5a6[_0x66db('0x5')],'transfererconnectedlinenum':_0x14c5a6['transfererconnectedlinenum'],'transfererconnectedlinename':_0x14c5a6['transfererconnectedlinename'],'transfereraccountcode':_0x14c5a6[_0x66db('0x6')],'transferercontext':_0x14c5a6[_0x66db('0x7')],'transfererexten':_0x14c5a6[_0x66db('0x8')],'transfererlinkedid':_0x14c5a6[_0x66db('0x9')],'transfereechannel':_0x14c5a6[_0x66db('0xa')],'transfereecalleridnum':_0x14c5a6[_0x66db('0xb')],'transfereecalleridname':_0x14c5a6[_0x66db('0xc')],'transfereeconnectedlinenum':_0x14c5a6[_0x66db('0xd')],'transfereeconnectedlinename':_0x14c5a6[_0x66db('0xe')],'transfereeaccountcode':_0x14c5a6[_0x66db('0xf')],'transfereecontext':_0x14c5a6[_0x66db('0x10')],'transfereeexten':_0x14c5a6['transfereeexten'],'transfereelinkedid':_0x14c5a6[_0x66db('0x11')],'isexternal':_0x14c5a6[_0x66db('0x12')],'context':_0x14c5a6[_0x66db('0x13')],'extension':_0x14c5a6[_0x66db('0x14')],'type':_0x66db('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x386029){return client['Request'](_0x66db('0x16'),{'body':{'result':_0x386029['result'],'transfererchannel':_0x386029[_0x66db('0x17')],'transferercalleridnum':_0x386029[_0x66db('0x18')],'transferercalleridname':_0x386029[_0x66db('0x19')],'transfererconnectedlinenum':_0x386029[_0x66db('0x1a')],'transfererconnectedlinename':_0x386029[_0x66db('0x1b')],'transfereraccountcode':_0x386029[_0x66db('0x1c')],'transferercontext':_0x386029[_0x66db('0x1d')],'transfererexten':_0x386029['secondtransfererexten'],'transfererlinkedid':_0x386029[_0x66db('0x1e')],'transfereechannel':_0x386029[_0x66db('0x1f')],'transfereecalleridnum':_0x386029[_0x66db('0x20')],'transfereecalleridname':_0x386029[_0x66db('0x21')],'transfereeconnectedlinenum':_0x386029['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x386029['transfertargetconnectedlinename'],'transfereeaccountcode':_0x386029[_0x66db('0x22')],'transfereecontext':_0x386029[_0x66db('0x23')],'transfereeexten':_0x386029[_0x66db('0x24')],'transfereelinkedid':_0x386029[_0x66db('0x25')],'isexternal':_0x386029[_0x66db('0x12')],'context':_0x386029[_0x66db('0x26')],'extension':_0x386029[_0x66db('0x27')],'type':_0x66db('0x28')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x984b=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','isexternal','context','extension','blind','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x15ed4a,_0x20a7af){var _0xc3e6d7=function(_0x21c0bc){while(--_0x21c0bc){_0x15ed4a['push'](_0x15ed4a['shift']());}};_0xc3e6d7(++_0x20a7af);}(_0x984b,0x92));var _0xb984=function(_0x3681d1,_0x2f392a){_0x3681d1=_0x3681d1-0x0;var _0x24b288=_0x984b[_0x3681d1];return _0x24b288;};'use strict';var client=require(_0xb984('0x0'));exports[_0xb984('0x1')]={};exports[_0xb984('0x2')]=function(_0x43cc6e){return client[_0xb984('0x3')](_0xb984('0x4'),{'body':{'result':_0x43cc6e['result'],'transfererchannel':_0x43cc6e['transfererchannel'],'transferercalleridnum':_0x43cc6e[_0xb984('0x5')],'transferercalleridname':_0x43cc6e[_0xb984('0x6')],'transfererconnectedlinenum':_0x43cc6e[_0xb984('0x7')],'transfererconnectedlinename':_0x43cc6e['transfererconnectedlinename'],'transfereraccountcode':_0x43cc6e[_0xb984('0x8')],'transferercontext':_0x43cc6e[_0xb984('0x9')],'transfererexten':_0x43cc6e[_0xb984('0xa')],'transfererlinkedid':_0x43cc6e[_0xb984('0xb')],'transfereechannel':_0x43cc6e[_0xb984('0xc')],'transfereecalleridnum':_0x43cc6e[_0xb984('0xd')],'transfereecalleridname':_0x43cc6e[_0xb984('0xe')],'transfereeconnectedlinenum':_0x43cc6e['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x43cc6e[_0xb984('0xf')],'transfereeaccountcode':_0x43cc6e['transfereeaccountcode'],'transfereecontext':_0x43cc6e[_0xb984('0x10')],'transfereeexten':_0x43cc6e['transfereeexten'],'transfereelinkedid':_0x43cc6e['transfereelinkedid'],'isexternal':_0x43cc6e[_0xb984('0x11')],'context':_0x43cc6e[_0xb984('0x12')],'extension':_0x43cc6e[_0xb984('0x13')],'type':_0xb984('0x14')},'log':_0xb984('0x4')});};exports['attendedTransfer']=function(_0x3df975){return client[_0xb984('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x3df975['result'],'transfererchannel':_0x3df975[_0xb984('0x15')],'transferercalleridnum':_0x3df975[_0xb984('0x16')],'transferercalleridname':_0x3df975['origtransferercalleridname'],'transfererconnectedlinenum':_0x3df975[_0xb984('0x17')],'transfererconnectedlinename':_0x3df975['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3df975[_0xb984('0x18')],'transferercontext':_0x3df975[_0xb984('0x19')],'transfererexten':_0x3df975[_0xb984('0x1a')],'transfererlinkedid':_0x3df975['origtransfererlinkedid'],'transfereechannel':_0x3df975['transfertargetchannel'],'transfereecalleridnum':_0x3df975[_0xb984('0x1b')],'transfereecalleridname':_0x3df975[_0xb984('0x1c')],'transfereeconnectedlinenum':_0x3df975[_0xb984('0x1d')],'transfereeconnectedlinename':_0x3df975[_0xb984('0x1e')],'transfereeaccountcode':_0x3df975['transfertargetaccountcode'],'transfereecontext':_0x3df975[_0xb984('0x1f')],'transfereeexten':_0x3df975['transfertargetexten'],'transfereelinkedid':_0x3df975[_0xb984('0x20')],'isexternal':_0x3df975[_0xb984('0x11')],'context':_0x3df975['origtransferercontext'],'extension':_0x3df975[_0xb984('0x21')],'type':_0xb984('0x22')},'log':_0xb984('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 529324d..99f80b5 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 _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x283938,_0x41c985){var _0x5a169b=function(_0x2339b8){while(--_0x2339b8){_0x283938['push'](_0x283938['shift']());}};_0x5a169b(++_0x41c985);}(_0xb10b,0x12a));var _0xbb10=function(_0x4cde9e,_0x57150a){_0x4cde9e=_0x4cde9e-0x0;var _0x38df0c=_0xb10b[_0x4cde9e];return _0x38df0c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x4f5bc9,_0x1bc75f){var _0x30fd0d=function(_0x541416){while(--_0x541416){_0x4f5bc9['push'](_0x4f5bc9['shift']());}};_0x30fd0d(++_0x1bc75f);}(_0xb10b,0x12a));var _0xbb10=function(_0x430e15,_0x4ae0f2){_0x430e15=_0x430e15-0x0;var _0x16c170=_0xb10b[_0x430e15];return _0x16c170;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+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 4f93035..9f5d3c6 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 _0xb82e=['localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','name','trigger:%s','action','merge','lodash','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb82e,0x14e));var _0xeb82=function(_0x573a10,_0x1885e4){_0x573a10=_0x573a10-0x0;var _0x492f40=_0xb82e[_0x573a10];return _0x492f40;};'use strict';var _=require(_0xeb82('0x0'));var BPromise=require('bluebird');var Redis=require(_0xeb82('0x1'));var util=require(_0xeb82('0x2'));var config=require('../../../../config/environment');var logger=require(_0xeb82('0x3'))(_0xeb82('0x4'));var cmContactRpc=require(_0xeb82('0x5'));config[_0xeb82('0x6')]=_[_0xeb82('0x7')](config['redis'],{'host':_0xeb82('0x8'),'port':0x18eb});var io=require(_0xeb82('0x9'))(new Redis(config[_0xeb82('0x6')]));function emit(_0xe273be,_0x438b44,_0x41bba7,_0x5deb28,_0x4ab938){logger[_0xeb82('0xa')](_0xeb82('0xb'),_0xe273be,_0x438b44['id'],_0x41bba7,_0x5deb28,JSON[_0xeb82('0xc')](_0x4ab938));io['to'](_0x41bba7)[_0xeb82('0xd')](_0x5deb28,_0x4ab938);}exports[_0xeb82('0xe')]=function(_0x134dad,_0x32fc95,_0x47de2a,_0x387e49){var _0x14aacc,_0x34c169;var _0x321c0b={};var _0x5751ed;var _0x509e08=Number(_0x47de2a[_0xeb82('0xf')]);var _0x5cb613=_0x47de2a[_0xeb82('0x10')]?Boolean(Number(_0x47de2a[_0xeb82('0x10')])):![];var _0x3ddaa1;var _0x353d54=![];if(!_['isNil'](_0x47de2a[_0xeb82('0x11')])){if(_0x47de2a[_0xeb82('0x11')]=='1')_0x353d54=!![];}if(!_0x353d54){if(_0x387e49[_0xeb82('0x12')]){_0x321c0b['id']=_0x387e49[_0xeb82('0x12')];}}if(!_0x321c0b['id']){_0x321c0b[_0xeb82('0x13')]=_0x509e08;_0x3ddaa1=_0x47de2a[_0xeb82('0x14')]&&_0x47de2a[_0xeb82('0x14')]!=='0'?_0x47de2a[_0xeb82('0x14')][_0xeb82('0x15')](','):[_0xeb82('0x16')];_0x321c0b['$or']=_[_0xeb82('0x17')](_0x3ddaa1,function(_0x4fc514){var _0x3af87e={};_0x3af87e[_0x4fc514]=_0x387e49[_0xeb82('0x18')]?_0x387e49[_0xeb82('0x19')]:_0x387e49['calleridnum'];return _0x3af87e;});_0x5751ed=_0x387e49[_0xeb82('0x18')]?_0x387e49[_0xeb82('0x19')]:_0x387e49[_0xeb82('0x1a')];}var _0x284058=['id',_0xeb82('0x1b'),_0xeb82('0x1c'),_0xeb82('0x16'),_0xeb82('0x1d'),_0xeb82('0x1e'),'ListId',_0xeb82('0x1f'),_0xeb82('0x20'),'updatedAt'];var _0x2fda66=_[_0xeb82('0x21')](_0x284058,_0x3ddaa1);BPromise[_0xeb82('0x22')]()[_0xeb82('0x23')](cmContactRpc['getContacts']({'attributes':_0x2fda66,'where':_0x321c0b,'phone':_0x5751ed}))[_0xeb82('0x23')](function(_0x54eb58){_0x34c169=_0x54eb58;if(!_['isEmpty'](_0x34c169)){if(_0x34c169[_0xeb82('0x24')]===0x1){_0x14aacc=_0x34c169[0x0];logger[_0xeb82('0xa')](_0xeb82('0x25'),_0x387e49[_0xeb82('0x26')],_0x32fc95['id'],_0x14aacc['id']);}else{logger[_0xeb82('0xa')](_0xeb82('0x27'),_0x387e49['uniqueid'],_0x32fc95['id'],_['map'](_0x34c169,'id')[_0xeb82('0x28')](','));}return;}else{logger[_0xeb82('0xa')](_0xeb82('0x29'),_0x387e49[_0xeb82('0x26')],_0x32fc95['id']);var _0x30a03a={'ListId':_0x509e08};var _0x1b54c1=_0x47de2a[_0xeb82('0x2a')]&&_0x47de2a['data4']!=='0'?_0x47de2a[_0xeb82('0x2a')]:'phone';if(_0x5cb613){logger[_0xeb82('0xa')](_0xeb82('0x2b'),_0x387e49[_0xeb82('0x26')],_0x32fc95['id']);_0x30a03a[_0x1b54c1]=_[_0xeb82('0x2c')](_0x387e49['routeId'])?_0x387e49[_0xeb82('0x1a')]:_0x387e49[_0xeb82('0x19')];if(_[_0xeb82('0x2c')](_0x387e49['routeId'])){_0x30a03a[_0xeb82('0x1b')]=_0x387e49[_0xeb82('0x2d')]&&_0x387e49[_0xeb82('0x2d')]!==_0xeb82('0x2e')?_0x387e49['calleridname']:_0xeb82('0x2f');}else{_0x30a03a[_0xeb82('0x1b')]=_0x387e49[_0xeb82('0x30')]&&_0x387e49[_0xeb82('0x30')]!==_0xeb82('0x2e')?_0x387e49[_0xeb82('0x30')]:_0xeb82('0x2f');}return BPromise[_0xeb82('0x22')]()[_0xeb82('0x23')](cmContactRpc['createContact'](_0x30a03a))[_0xeb82('0x23')](function(_0x176c4c){_0x14aacc=_0x176c4c;_0x34c169['push'](_0x176c4c);if(_0x14aacc){logger['info'](_0xeb82('0x31'),_0x387e49[_0xeb82('0x26')],_0x32fc95['id'],_0x14aacc['id']);}return;});}else{logger['info'](_0xeb82('0x32'),_0x387e49[_0xeb82('0x26')],_0x32fc95['id']);_0x30a03a[_0x1b54c1]=_[_0xeb82('0x2c')](_0x387e49[_0xeb82('0x18')])?_0x387e49['calleridnum']:_0x387e49[_0xeb82('0x19')];if(_['isNil'](_0x387e49[_0xeb82('0x18')])){_0x30a03a[_0xeb82('0x1b')]=_0x387e49[_0xeb82('0x2d')]&&_0x387e49[_0xeb82('0x2d')]!==''?_0x387e49[_0xeb82('0x2d')]:'Unknown';}else{_0x30a03a[_0xeb82('0x1b')]=_0x387e49[_0xeb82('0x30')]&&_0x387e49['destcalleridname']!==_0xeb82('0x2e')?_0x387e49[_0xeb82('0x30')]:_0xeb82('0x2f');}_0x14aacc=_0x30a03a;_0x34c169[_0xeb82('0x33')](_0x30a03a);return;}}})[_0xeb82('0x23')](function(){if(_0x134dad){emit(_0x387e49[_0xeb82('0x26')],_0x32fc95,util[_0xeb82('0x34')]('user:%s',_0x134dad[_0xeb82('0x35')]),util[_0xeb82('0x34')](_0xeb82('0x36'),_0x47de2a[_0xeb82('0x37')]['toLowerCase']()),{'evt':_[_0xeb82('0x38')](_0x387e49,{'autoCreate':_0x5cb613}),'contact':_0x14aacc===undefined?{}:_0x14aacc,'contacts':_0x34c169['length']===0x0?undefined:_0x34c169});}});}; \ No newline at end of file +var _0x7b1a=['calleridname','Unknown','destcalleridname','','resolve','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','updatedAt','union','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled'];(function(_0xf67a90,_0x2eb2f3){var _0x648b2=function(_0x298232){while(--_0x298232){_0xf67a90['push'](_0xf67a90['shift']());}};_0x648b2(++_0x2eb2f3);}(_0x7b1a,0x166));var _0xa7b1=function(_0xe21bc1,_0x1d5ed1){_0xe21bc1=_0xe21bc1-0x0;var _0x3a2b2d=_0x7b1a[_0xe21bc1];return _0x3a2b2d;};'use strict';var _=require('lodash');var BPromise=require(_0xa7b1('0x0'));var Redis=require(_0xa7b1('0x1'));var util=require('util');var config=require(_0xa7b1('0x2'));var logger=require(_0xa7b1('0x3'))(_0xa7b1('0x4'));var cmContactRpc=require(_0xa7b1('0x5'));config['redis']=_[_0xa7b1('0x6')](config[_0xa7b1('0x7')],{'host':_0xa7b1('0x8'),'port':0x18eb});var io=require(_0xa7b1('0x9'))(new Redis(config[_0xa7b1('0x7')]));function emit(_0x5da210,_0x4dc81e,_0x327988,_0x3f7f7d,_0x3a48a5){logger[_0xa7b1('0xa')]('[CM][%s][%s]',_0x5da210,_0x4dc81e['id'],_0x327988,_0x3f7f7d,JSON[_0xa7b1('0xb')](_0x3a48a5));io['to'](_0x327988)[_0xa7b1('0xc')](_0x3f7f7d,_0x3a48a5);}exports[_0xa7b1('0xd')]=function(_0x13dd93,_0xbaf74a,_0x5a88dc,_0x141b2e){var _0x426805,_0x5ed81c;var _0x44e1ef={};var _0x58eb56;var _0x59c4c3=Number(_0x5a88dc[_0xa7b1('0xe')]);var _0x61cc98=_0x5a88dc[_0xa7b1('0xf')]?Boolean(Number(_0x5a88dc[_0xa7b1('0xf')])):![];var _0x684b3e;var _0x58f650=![];if(!_[_0xa7b1('0x10')](_0x5a88dc[_0xa7b1('0x11')])){if(_0x5a88dc['data5']=='1')_0x58f650=!![];}if(!_0x58f650){if(_0x141b2e[_0xa7b1('0x12')]){_0x44e1ef['id']=_0x141b2e[_0xa7b1('0x12')];}}if(!_0x44e1ef['id']){_0x44e1ef[_0xa7b1('0x13')]=_0x59c4c3;_0x684b3e=_0x5a88dc['data3']&&_0x5a88dc[_0xa7b1('0x14')]!=='0'?_0x5a88dc[_0xa7b1('0x14')][_0xa7b1('0x15')](','):[_0xa7b1('0x16')];_0x44e1ef[_0xa7b1('0x17')]=_[_0xa7b1('0x18')](_0x684b3e,function(_0x1f3f24){var _0x1aae82={};_0x1aae82[_0x1f3f24]=_0x141b2e[_0xa7b1('0x19')]?_0x141b2e[_0xa7b1('0x1a')]:_0x141b2e[_0xa7b1('0x1b')];return _0x1aae82;});_0x58eb56=_0x141b2e[_0xa7b1('0x19')]?_0x141b2e[_0xa7b1('0x1a')]:_0x141b2e['calleridnum'];}var _0x53405a=['id',_0xa7b1('0x1c'),_0xa7b1('0x1d'),_0xa7b1('0x16'),_0xa7b1('0x1e'),'fax',_0xa7b1('0x13'),'createdAt','scheduledAt',_0xa7b1('0x1f')];var _0x321535=_[_0xa7b1('0x20')](_0x53405a,_0x684b3e);BPromise['resolve']()[_0xa7b1('0x21')](cmContactRpc[_0xa7b1('0x22')]({'attributes':_0x321535,'where':_0x44e1ef,'phone':_0x58eb56}))['then'](function(_0x1e533d){_0x5ed81c=_0x1e533d;if(!_[_0xa7b1('0x23')](_0x5ed81c)){if(_0x5ed81c['length']===0x1){_0x426805=_0x5ed81c[0x0];logger[_0xa7b1('0xa')](_0xa7b1('0x24'),_0x141b2e['uniqueid'],_0xbaf74a['id'],_0x426805['id']);}else{logger['info'](_0xa7b1('0x25'),_0x141b2e[_0xa7b1('0x26')],_0xbaf74a['id'],_[_0xa7b1('0x18')](_0x5ed81c,'id')['join'](','));}return;}else{logger[_0xa7b1('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x141b2e[_0xa7b1('0x26')],_0xbaf74a['id']);var _0xce3750={'ListId':_0x59c4c3};var _0x336a85=_0x5a88dc[_0xa7b1('0x27')]&&_0x5a88dc[_0xa7b1('0x27')]!=='0'?_0x5a88dc[_0xa7b1('0x27')]:'phone';if(_0x61cc98){logger['info'](_0xa7b1('0x28'),_0x141b2e[_0xa7b1('0x26')],_0xbaf74a['id']);_0xce3750[_0x336a85]=_[_0xa7b1('0x10')](_0x141b2e[_0xa7b1('0x19')])?_0x141b2e['calleridnum']:_0x141b2e[_0xa7b1('0x1a')];if(_[_0xa7b1('0x10')](_0x141b2e['routeId'])){_0xce3750[_0xa7b1('0x1c')]=_0x141b2e[_0xa7b1('0x29')]&&_0x141b2e[_0xa7b1('0x29')]!==''?_0x141b2e[_0xa7b1('0x29')]:_0xa7b1('0x2a');}else{_0xce3750[_0xa7b1('0x1c')]=_0x141b2e[_0xa7b1('0x2b')]&&_0x141b2e['destcalleridname']!==_0xa7b1('0x2c')?_0x141b2e[_0xa7b1('0x2b')]:'Unknown';}return BPromise[_0xa7b1('0x2d')]()[_0xa7b1('0x21')](cmContactRpc['createContact'](_0xce3750))[_0xa7b1('0x21')](function(_0xbf2223){_0x426805=_0xbf2223;_0x5ed81c[_0xa7b1('0x2e')](_0xbf2223);if(_0x426805){logger[_0xa7b1('0xa')](_0xa7b1('0x2f'),_0x141b2e[_0xa7b1('0x26')],_0xbaf74a['id'],_0x426805['id']);}return;});}else{logger[_0xa7b1('0xa')](_0xa7b1('0x30'),_0x141b2e[_0xa7b1('0x26')],_0xbaf74a['id']);_0xce3750[_0x336a85]=_['isNil'](_0x141b2e[_0xa7b1('0x19')])?_0x141b2e[_0xa7b1('0x1b')]:_0x141b2e[_0xa7b1('0x1a')];if(_[_0xa7b1('0x10')](_0x141b2e[_0xa7b1('0x19')])){_0xce3750[_0xa7b1('0x1c')]=_0x141b2e['calleridname']&&_0x141b2e[_0xa7b1('0x29')]!==_0xa7b1('0x2c')?_0x141b2e[_0xa7b1('0x29')]:_0xa7b1('0x2a');}else{_0xce3750[_0xa7b1('0x1c')]=_0x141b2e[_0xa7b1('0x2b')]&&_0x141b2e['destcalleridname']!==_0xa7b1('0x2c')?_0x141b2e[_0xa7b1('0x2b')]:_0xa7b1('0x2a');}_0x426805=_0xce3750;_0x5ed81c[_0xa7b1('0x2e')](_0xce3750);return;}}})[_0xa7b1('0x21')](function(){if(_0x13dd93){emit(_0x141b2e[_0xa7b1('0x26')],_0xbaf74a,util[_0xa7b1('0x31')](_0xa7b1('0x32'),_0x13dd93[_0xa7b1('0x33')]),util[_0xa7b1('0x31')](_0xa7b1('0x34'),_0x5a88dc[_0xa7b1('0x35')][_0xa7b1('0x36')]()),{'evt':_[_0xa7b1('0x37')](_0x141b2e,{'autoCreate':_0x61cc98}),'contact':_0x426805===undefined?{}:_0x426805,'contacts':_0x5ed81c[_0xa7b1('0x38')]===0x0?undefined:_0x5ed81c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 460c321..da55a72 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 _0x0497=['custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','debug','checkTriggers','hasOwnProperty','status','merge','variables','Actions','interface','action','toLowerCase','browser','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','location','data5','800','windowHeight','data6','600','winApplication','winArguments','format','trigger:%s:%s','data1','jscripty','user:%s','name','trigger:%s','contactmanager','exec','queue','routeId','urlforward','buildUri','parse','query','replace','checkTrigger','AllConditions','length','every','checkConditions','channel','AnyConditions','some','checkTrigger:\x20trigger','inspect','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','created','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend'];(function(_0x125351,_0x21802a){var _0x17b04c=function(_0x4cd887){while(--_0x4cd887){_0x125351['push'](_0x125351['shift']());}};_0x17b04c(++_0x21802a);}(_0x0497,0xe1));var _0x7049=function(_0x28e714,_0x1ca825){_0x28e714=_0x28e714-0x0;var _0x2c3bf2=_0x0497[_0x28e714];return _0x2c3bf2;};'use strict';var util=require(_0x7049('0x0'));var _=require(_0x7049('0x1'));var url=require('url');var Mustache=require(_0x7049('0x2'));var Redis=require(_0x7049('0x3'));var urlforward=require(_0x7049('0x4'));var integration=require(_0x7049('0x5'));var cmContact=require(_0x7049('0x6'));var script=require(_0x7049('0x7'));var config=require(_0x7049('0x8'));var logger=require(_0x7049('0x9'))(_0x7049('0xa'));var ami=require(_0x7049('0xb'));config[_0x7049('0xc')]=_[_0x7049('0xd')](config['redis'],{'host':_0x7049('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7049('0xc')]));var operators={'equals':function(_0x1a70f8,_0xecf759){return _0x1a70f8==_0xecf759;},'not_equals':function(_0x23cc09,_0x4c0026){return _0x23cc09!=_0x4c0026;}};var barAndWebActions=[_0x7049('0xf'),_0x7049('0x10'),_0x7049('0x11')];function Trigger(_0x229a26){this[_0x7049('0x12')]=_0x229a26['triggers'];this[_0x7049('0x13')]=_0x229a26['agents'];this[_0x7049('0x14')]=_0x229a26[_0x7049('0x14')];this[_0x7049('0x15')]=_0x229a26[_0x7049('0x15')];this[_0x7049('0x16')]=_0x229a26[_0x7049('0x16')];this[_0x7049('0x17')]=_0x229a26[_0x7049('0x17')];this[_0x7049('0x18')]=_0x229a26[_0x7049('0x18')];this['salesforceAccounts']=_0x229a26[_0x7049('0x19')];this['sugarcrmAccounts']=_0x229a26[_0x7049('0x1a')];this[_0x7049('0x1b')]=_0x229a26[_0x7049('0x1b')];this[_0x7049('0x1c')]=_0x229a26[_0x7049('0x1c')];this[_0x7049('0x1d')]=_0x229a26[_0x7049('0x1d')];this[_0x7049('0x1e')]=_0x229a26[_0x7049('0x1e')];this['dynamics365Accounts']=_0x229a26[_0x7049('0x1f')];this[_0x7049('0x20')]=_0x229a26[_0x7049('0x20')];this[_0x7049('0x21')]={'zendesk':this[_0x7049('0x17')],'salesforce':this[_0x7049('0x19')],'freshdesk':this[_0x7049('0x18')],'sugarcrm':this[_0x7049('0x1a')],'zoho':this[_0x7049('0x1b')],'desk':this['deskAccounts'],'vtiger':this[_0x7049('0x1d')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x7049('0x20')],'servicenow':this[_0x7049('0x1e')]};ami['on'](_0x7049('0x22'),this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x25'),this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x26'),this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x27'),this[_0x7049('0x23')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x28'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this[_0x7049('0x23')]['bind'](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0x7049('0x24')](this));ami['on']('custom:agentreject',this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x29'),this[_0x7049('0x23')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x7049('0x23')]['bind'](this));ami['on'](_0x7049('0x2a'),this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x2b'),this[_0x7049('0x2c')]['bind'](this));ami['on'](_0x7049('0x2d'),this[_0x7049('0x2c')]['bind'](this));ami['on'](_0x7049('0x2e'),this['syncAgentDial']['bind'](this));ami['on'](_0x7049('0x2f'),this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x30'),this[_0x7049('0x23')]['bind'](this));ami['on'](_0x7049('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7049('0x32'),this[_0x7049('0x23')]['bind'](this));ami['on'](_0x7049('0x33'),this[_0x7049('0x23')][_0x7049('0x24')](this));ami['on'](_0x7049('0x34'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7049('0x35'),this['syncCustomEvent'][_0x7049('0x24')](this));ami['on'](_0x7049('0x36'),this['syncCustomEvent']['bind'](this));}Trigger[_0x7049('0x37')][_0x7049('0x38')]=function(_0x2438b0,_0x213094,_0x3b76a3){logger['info'](_0x2438b0,_0x213094,JSON[_0x7049('0x39')](_0x3b76a3));io['to'](_0x2438b0)[_0x7049('0x38')](_0x213094,_0x3b76a3);};Trigger['prototype'][_0x7049('0x23')]=function(_0x3f31f5){var _0xdb79c5=_[_0x7049('0x3a')](_0x3f31f5);if(typeof _0xdb79c5[_0x7049('0x3b')]===_0x7049('0x3c')){_0xdb79c5['motionChannel']=_0x7049('0x3d');}logger[_0x7049('0x3e')]('syncCustomEvent',util['inspect'](_0xdb79c5,{'showHidden':!![],'depth':null}));this[_0x7049('0x3f')](_0xdb79c5);};Trigger[_0x7049('0x37')][_0x7049('0x2c')]=function(_0x5774d3){if(this[_0x7049('0x13')][_0x5774d3['interface']]){this['syncCustomEvent'](_0x5774d3);}};Trigger['prototype'][_0x7049('0x3f')]=function(_0x505210){var _0x2c4a49;for(var _0x3ec3c5 in this[_0x7049('0x12')]){if(this['triggers'][_0x7049('0x40')](_0x3ec3c5)){if(this[_0x7049('0x12')][_0x3ec3c5][_0x7049('0x41')]){_0x2c4a49=this['checkTrigger'](this[_0x7049('0x12')][_0x3ec3c5],_0x505210);if(_0x2c4a49){_[_0x7049('0x42')](_0x505210,_0x505210[_0x7049('0x43')]);for(var _0x444ce0=0x0,_0x30d2c5,_0x3aeb09,_0x56748b;_0x444ce00x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x5fc3[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index f43498b..d0cf89b 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 _0x0423=['customField','idField','substring','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','serverUrl','%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','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','clientId','username','password','clientSecret','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','calleridnum','POST','/systemusers(','body','headers','odata-entityid','lastIndexOf','outbound','telephone1','&$filter=','\x20eq\x20\x27','replace','%2b','4.0','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x0423,0x1d8));var _0x3042=function(_0xaedba1,_0x50e106){_0xaedba1=_0xaedba1-0x0;var _0x4db4ae=_0x0423[_0xaedba1];return _0x4db4ae;};'use strict';var _=require(_0x3042('0x0'));var rp=require('request-promise');var util=require(_0x3042('0x1'));var intUtil=require(_0x3042('0x2'));var md5=require(_0x3042('0x3'));var Redis=require(_0x3042('0x4'));var logger=require(_0x3042('0x5'))('dynamics365');var config=require(_0x3042('0x6'));config[_0x3042('0x7')]=_[_0x3042('0x8')](config[_0x3042('0x7')],{'host':_0x3042('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3042('0x7')]));function getAuthToken(_0x38de7a,_0x3eb693,_0x294ae0){if(_0x38de7a[_0x3042('0xa')]){_0x38de7a[_0x3042('0xb')]=_0x38de7a[_0x3042('0xc')][_0x3042('0xd')];_0x38de7a[_0x3042('0xe')]=_0x38de7a['CloudProvider'][_0x3042('0xf')];return Promise[_0x3042('0x10')](_0x38de7a[_0x3042('0xc')][_0x3042('0x11')]);}var _0x232403={'method':'POST','uri':_0x3eb693,'form':{'client_id':_0x38de7a[_0x3042('0x12')],'resource':_0x38de7a[_0x3042('0xb')],'username':_0x38de7a[_0x3042('0x13')],'password':_0x38de7a['password'],'grant_type':_0x3042('0x14'),'client_secret':_0x38de7a[_0x3042('0x15')]},'json':!![]};return rp(_0x232403)['then'](function(_0x54f454){return _0x54f454['access_token'];})[_0x3042('0x16')](function(_0x43743a){logger[_0x3042('0x17')]('['+[_0x294ae0[_0x3042('0x18')]()]+_0x3042('0x19'));return _0x43743a[_0x3042('0x1a')];});}function getUser(_0x45d004,_0x583f6a,_0xab285f,_0x242aa5,_0x579f1f,_0x3b10c3){return new Promise(function(_0x900eee,_0x1dc639){return getAuthToken(_0x583f6a,_0x242aa5,_0x3b10c3)[_0x3042('0x1b')](function(_0x2c3d11){var _0x4806b6={'method':_0x3042('0x1c'),'uri':_0x579f1f+_0x3042('0x1d'),'headers':{'Authorization':_0x3042('0x1e')+_0x2c3d11,'OData-Version':'4.0'},'json':!![]};return rp(_0x4806b6);})[_0x3042('0x1b')](function(_0x265a72){var _0x1c6b52=_0x265a72[_0x3042('0x1f')];var _0x1cc6b3=![];var _0x5a4009=null;if(!_['isNil'](_0xab285f)){if(intUtil[_0x3042('0x20')](_0xab285f[_0x3042('0x21')])){_0x45d004[_0x3042('0x22')]=_0xab285f[_0x3042('0x21')];for(_0x5a4009=0x0;_0x5a4009<_0x1c6b52[_0x3042('0x23')];_0x5a4009++){if(_0x1c6b52[_0x5a4009][_0x3042('0x24')]===_0xab285f[_0x3042('0x21')]&&!_0x1c6b52[_0x5a4009][_0x3042('0x25')]){_0x1cc6b3=!![];logger[_0x3042('0x26')]('['+[_0x3b10c3['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1c6b52[_0x5a4009][_0x3042('0x27')]+'!');_0x45d004[_0x3042('0x28')]=_0x1c6b52[_0x5a4009][_0x3042('0x27')];}}}}if(!_0x1cc6b3){logger[_0x3042('0x26')]('['+[_0x3b10c3[_0x3042('0x18')]()]+_0x3042('0x29'));_0x45d004[_0x3042('0x22')]=_0x583f6a[_0x3042('0x13')];for(_0x5a4009=0x0;_0x5a4009<_0x1c6b52[_0x3042('0x23')];_0x5a4009++){if(_0x1c6b52[_0x5a4009][_0x3042('0x24')]===_0x583f6a['username']){_0x45d004[_0x3042('0x28')]=_0x1c6b52[_0x5a4009][_0x3042('0x27')];}}}_0x900eee(_0x45d004);})['catch'](function(_0x498e8a){_0x1dc639(_0x498e8a['message']);});});}function createEndUser(_0x51eb26,_0x542b3b,_0x26cd67,_0x32f85f,_0x42fe6d,_0x1dd9eb,_0x314eb1){return new Promise(function(_0x2e7ee7,_0x32aeb2){return getAuthToken(_0x542b3b,_0x26cd67,_0x1dd9eb)[_0x3042('0x1b')](function(_0x43bdf0){var _0x396334=_0x1dd9eb[_0x3042('0x2a')]()==='outbound'?_0x42fe6d['destcalleridnum']:_0x42fe6d[_0x3042('0x2b')];var _0x21c856={'method':_0x3042('0x2c'),'uri':_0x32f85f+'contacts','body':{'fullname':_0x396334,'firstname':_0x396334,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3042('0x2d')+_0x51eb26[_0x3042('0x28')]+')'},'headers':{'Authorization':_0x3042('0x1e')+_0x43bdf0,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x21c856[_0x3042('0x2e')][_0x314eb1]=_0x396334;return rp(_0x21c856);})[_0x3042('0x1b')](function(_0x147c90){var _0x488920=_0x147c90[_0x3042('0x2f')][_0x3042('0x30')];var _0x41c6cd=_0x488920['substring'](_0x488920[_0x3042('0x31')]('(')+0x1,_0x488920[_0x3042('0x31')](')'));_0x51eb26['enduserId']=_0x41c6cd;_0x2e7ee7(_0x51eb26);})[_0x3042('0x16')](function(_0x377e99){_0x32aeb2(_0x377e99['message']);});});}function getEndUser(_0x1c69e3,_0xabbbfa,_0x33a2ed,_0x530214,_0x2f5bf9,_0x465844,_0x452013,_0x2c5063){var _0x23a9f7=_0x465844[_0x3042('0x2a')]()===_0x3042('0x32')?_0x2f5bf9['destcalleridnum']:_0x2f5bf9[_0x3042('0x2b')];return getAuthToken(_0xabbbfa,_0x33a2ed,_0x465844)['then'](function(_0x1d224b){_0x2c5063=_0x2c5063?_0x2c5063:_0x3042('0x33');var _0x26f300={'method':_0x3042('0x1c'),'uri':_0x530214+'contacts?$select='+_0x2c5063+_0x3042('0x34')+_0x2c5063+_0x3042('0x35')+_0x23a9f7[_0x3042('0x36')]('+',_0x3042('0x37'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1d224b,'If-None-Match':null,'OData-Version':_0x3042('0x38')},'json':!![]};return rp(_0x26f300);})[_0x3042('0x1b')](function(_0x5d40c4){var _0x390e81=![];if(!_0x5d40c4)return _0x390e81;var _0x91181=_0x5d40c4[_0x3042('0x1f')];for(var _0x3cd02b=0x0;_0x3cd02b<_0x91181[_0x3042('0x23')];_0x3cd02b++){if(_0x91181[_0x3cd02b][_0x2c5063]===_0x23a9f7){_0x390e81=!![];_0x1c69e3[_0x3042('0x39')]=_0x91181[_0x3cd02b][_0x3042('0x3a')];}}return _0x390e81;})[_0x3042('0x1b')](function(_0x512e9b){if(_0x512e9b)return _0x1c69e3;if(_0x452013===_0x3042('0x3b')){logger[_0x3042('0x26')]('['+[_0x465844[_0x3042('0x18')]()]+_0x3042('0x3c'));return _0x1c69e3;}return createEndUser(_0x1c69e3,_0xabbbfa,_0x33a2ed,_0x530214,_0x2f5bf9,_0x465844,_0x2c5063)[_0x3042('0x1b')](function(_0xf5a120){logger['info']('['+[_0x465844[_0x3042('0x18')]()]+_0x3042('0x3d'),_0xf5a120[_0x3042('0x39')]);return _0xf5a120;});});}function getCustomFields(_0x21a3db,_0x3d665f,_0x48a6d4){var _0x2c777a={};if(_0x21a3db[_0x3042('0x23')]>0x0){_[_0x3042('0x3e')](_0x21a3db,function(_0x24c2e5){if(_[_0x3042('0x3f')]([_0x3042('0x40'),_0x3042('0x41')],_0x24c2e5[_0x3042('0x42')])&&_0x24c2e5[_0x3042('0x43')]&&!_0x24c2e5[_0x3042('0x44')]){var _0x3d7a3b=_0x24c2e5[_0x3042('0x45')][_0x3042('0x2a')]();var _0x4bc601=_0x3d7a3b[_0x3042('0x46')](0x0,_0x3d7a3b['indexOf']('_'));var _0x3e641e=_0x3d7a3b[_0x3042('0x46')](_0x3d7a3b['indexOf']('_')+0x1);if(_0x4bc601===_0x48a6d4){_0x2c777a[_0x3e641e]=_0x24c2e5[_0x3042('0x47')];}}});}return _0x2c777a;}function getTicket(_0x177c8f,_0x1c2ce2,_0x206da7,_0xce5066,_0x4e2ddd,_0x4bfceb,_0x27e607){return new Promise(function(_0x30cd9e,_0x2e91d1){var _0x59b1b8;return getAuthToken(_0x1c2ce2,_0x206da7,_0x27e607)[_0x3042('0x1b')](function(_0x25be26){if(_0x4bfceb[_0x3042('0x48')]===_0x3042('0x49')){_0x59b1b8={'method':'POST','uri':_0xce5066+_0x3042('0x4a'),'body':Object[_0x3042('0x4b')]({},{'title':intUtil[_0x3042('0x4c')](_0x4bfceb[_0x3042('0x4d')],_0x4e2ddd,'\x20'),'description':intUtil['getString'](_0x4bfceb[_0x3042('0x4e')],_0x4e2ddd,'\x0a'),'customerid_contact@odata.bind':_0x177c8f[_0x3042('0x39')]?_0x3042('0x4f')+_0x177c8f[_0x3042('0x39')]+')':undefined,'ownerid@odata.bind':_0x3042('0x2d')+_0x177c8f['userId']+')','caseorigincode':'1'},getCustomFields(_0x4bfceb[_0x3042('0x50')],_0x4e2ddd,_0x4bfceb['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x25be26,'OData-Version':_0x3042('0x38')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4bfceb['ticketType']==='phonecall'){var _0x1e72e2=_0x177c8f['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x177c8f['userId']+')','participationtypemask':_0x177c8f[_0x3042('0x51')]===_0x3042('0x52')?0x2:0x1},{'partyid_contact@odata.bind':_0x3042('0x4f')+_0x177c8f['enduserId']+')','participationtypemask':_0x177c8f[_0x3042('0x51')]===_0x3042('0x52')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x177c8f['userId']+')','participationtypemask':_0x177c8f['callDirection']==='queue'?0x2:0x1}];_0x59b1b8={'method':_0x3042('0x2c'),'uri':_0xce5066+'phonecalls','body':Object[_0x3042('0x4b')]({},{'subject':intUtil[_0x3042('0x4c')](_0x4bfceb[_0x3042('0x4d')],_0x4e2ddd,'\x20'),'phonenumber':String(_0x4e2ddd[_0x3042('0x2b')]),'description':intUtil[_0x3042('0x4c')](_0x4bfceb[_0x3042('0x4e')],_0x4e2ddd,'\x0a'),'regardingobjectid_contact@odata.bind':_0x177c8f[_0x3042('0x39')]?_0x3042('0x4f')+_0x177c8f[_0x3042('0x39')]+')':undefined,'ownerid@odata.bind':_0x3042('0x2d')+_0x177c8f['userId']+')','directioncode':_0x177c8f[_0x3042('0x51')]===_0x3042('0x52')?![]:!![],'phonecall_activity_parties':_0x1e72e2},getCustomFields(_0x4bfceb[_0x3042('0x50')],_0x4e2ddd,_0x4bfceb['ticketType'])),'headers':{'Authorization':_0x3042('0x1e')+_0x25be26,'OData-Version':_0x3042('0x38')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x59b1b8);})['then'](function(_0x39863d){var _0x3424a3=_0x39863d['headers'][_0x3042('0x30')];var _0x27b762=_0x3424a3['substring'](_0x3424a3[_0x3042('0x31')]('(')+0x1,_0x3424a3[_0x3042('0x31')](')'));_0x177c8f[_0x3042('0x53')]=_0x27b762;_0x30cd9e(_0x177c8f);})['catch'](function(_0x593b8e){_0x2e91d1(_0x593b8e[_0x3042('0x1a')]);});});}function emit(_0x45258c,_0x23e65f,_0x635f29,_0x1a0f9d){var _0x371c14={'uri':util[_0x3042('0x54')](_0x3042('0x55'),_0x45258c,_0x635f29,_0x1a0f9d)};io['to'](util[_0x3042('0x54')]('user:%s',_0x23e65f))['emit'](_0x3042('0x56'),_0x371c14);}exports['cs']=function(_0x50ead2,_0xd16c8d,_0x2c3923,_0x216940,_0x581883,_0x466e18,_0x12c444,_0x2044da){var _0x2dcbe3={};_0x466e18[_0x3042('0xb')]=_0x466e18[_0x3042('0xa')]?intUtil[_0x3042('0x57')](_0x466e18[_0x3042('0xc')]['data7']):intUtil['stripTrailingSlash'](_0x466e18['remoteUri']);_0x466e18[_0x3042('0x58')]=intUtil['stripTrailingSlash'](_0x466e18[_0x3042('0x58')]);_0x2dcbe3[_0x3042('0x51')]=_0x2044da==='queue'||_0x2044da==='unmanaged'?_0x3042('0x52'):_0x3042('0x32');var _0x3f83b8=_0x466e18['modernAuthentication']?util['format'](_0x3042('0x59'),_0x466e18[_0x3042('0xc')]['data7']):util[_0x3042('0x54')](_0x3042('0x59'),_0x466e18['remoteUri']);var _0x508646=util[_0x3042('0x54')](_0x3042('0x5a'),_0x466e18[_0x3042('0xe')]);var _0x4c352f=util[_0x3042('0x54')](_0x3042('0x5b'),_0x466e18[_0x3042('0x58')],_0xd16c8d['uniqueid'],md5(_0xd16c8d[_0x3042('0x5c')]));if(_0x581883&&_0x581883[_0x3042('0x5d')]){logger[_0x3042('0x26')]('[QUEUE]',_0x3042('0x5e'));_0xd16c8d[_0x3042('0x5f')]=_0x4c352f;}else if(_0x12c444&&_0x12c444[_0x3042('0x60')]&&_0x12c444[_0x3042('0x60')]!=='none'){logger[_0x3042('0x26')](_0x3042('0x61'),_0x3042('0x5e'));_0xd16c8d['recordingURL']=_0x4c352f;}else{_0xd16c8d[_0x3042('0x5f')]='';}return getUser(_0x2dcbe3,_0x466e18,_0x216940,_0x508646,_0x3f83b8,_0x2044da)[_0x3042('0x1b')](function(_0x14263e){logger[_0x3042('0x26')]('['+_0x2044da[_0x3042('0x18')]()+_0x3042('0x62'),_0x14263e[_0x3042('0x28')]);logger['info']('['+_0x2044da[_0x3042('0x18')]()+_0x3042('0x63'),_0x14263e['userEmail']);return getEndUser(_0x14263e,_0x466e18,_0x508646,_0x3f83b8,_0xd16c8d,_0x2044da,_0x2c3923['moduleCreate'],_0x2c3923[_0x3042('0x64')]);})['then'](function(_0x33e2fd){logger['info']('['+_0x2044da[_0x3042('0x18')]()+_0x3042('0x65'),_0x33e2fd[_0x3042('0x39')]);logger['info']('['+_0x2044da[_0x3042('0x18')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xd16c8d['calleridnum']);return getTicket(_0x33e2fd,_0x466e18,_0x508646,_0x3f83b8,_0xd16c8d,_0x2c3923,_0x2044da);})['then'](function(_0x42644a){logger[_0x3042('0x26')](util[_0x3042('0x54')]('['+_0x2044da[_0x3042('0x18')]()+_0x3042('0x66'),_0x2c3923['ticketType'],_0x42644a[_0x3042('0x53')]));logger[_0x3042('0x26')](util['format']('['+_0x2044da['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x2044da));if(_0x2044da!==_0x3042('0x67')&&_0x2c3923[_0x3042('0x68')]){logger[_0x3042('0x26')]('['+_0x2044da[_0x3042('0x18')]()+']',_0x3042('0x69'));emit(_0x466e18[_0x3042('0xb')],_0x216940['name'],_0x2c3923[_0x3042('0x48')],_0x42644a['ticketId']);}})[_0x3042('0x16')](function(_0x52f69e){logger[_0x3042('0x17')]('['+_0x2044da['toUpperCase']()+_0x3042('0x6a'),_0x52f69e[_0x3042('0x1a')]);console[_0x3042('0x17')](_0x3042('0x6b'),_0x52f69e);});}; \ No newline at end of file +var _0xe6ce=['catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','assign','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','phonecalls','getString','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','data7','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','data5','clientId','username','password','clientSecret','access_token'];(function(_0x91ec40,_0xa1ec3b){var _0x428c7a=function(_0x196f25){while(--_0x196f25){_0x91ec40['push'](_0x91ec40['shift']());}};_0x428c7a(++_0xa1ec3b);}(_0xe6ce,0x131));var _0xee6c=function(_0x16074b,_0x18eb80){_0x16074b=_0x16074b-0x0;var _0x58166c=_0xe6ce[_0x16074b];return _0x58166c;};'use strict';var _=require(_0xee6c('0x0'));var rp=require(_0xee6c('0x1'));var util=require(_0xee6c('0x2'));var intUtil=require(_0xee6c('0x3'));var md5=require('md5');var Redis=require(_0xee6c('0x4'));var logger=require(_0xee6c('0x5'))('dynamics365');var config=require(_0xee6c('0x6'));config[_0xee6c('0x7')]=_[_0xee6c('0x8')](config[_0xee6c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xee6c('0x9'))(new Redis(config[_0xee6c('0x7')]));function getAuthToken(_0x2e16ce,_0x5531f0,_0x375675){if(_0x2e16ce[_0xee6c('0xa')]){_0x2e16ce[_0xee6c('0xb')]=_0x2e16ce[_0xee6c('0xc')]['data7'];_0x2e16ce[_0xee6c('0xd')]=_0x2e16ce[_0xee6c('0xc')][_0xee6c('0xe')];return Promise[_0xee6c('0xf')](_0x2e16ce['CloudProvider'][_0xee6c('0x10')]);}var _0x16cc9c={'method':'POST','uri':_0x5531f0,'form':{'client_id':_0x2e16ce[_0xee6c('0x11')],'resource':_0x2e16ce[_0xee6c('0xb')],'username':_0x2e16ce[_0xee6c('0x12')],'password':_0x2e16ce[_0xee6c('0x13')],'grant_type':'password','client_secret':_0x2e16ce[_0xee6c('0x14')]},'json':!![]};return rp(_0x16cc9c)['then'](function(_0x1d163a){return _0x1d163a[_0xee6c('0x15')];})[_0xee6c('0x16')](function(_0xcc37be){logger[_0xee6c('0x17')]('['+[_0x375675[_0xee6c('0x18')]()]+_0xee6c('0x19'));return _0xcc37be[_0xee6c('0x1a')];});}function getUser(_0x161796,_0x1c2558,_0x39c18d,_0x3ff37a,_0x55e9a1,_0x143575){return new Promise(function(_0x317901,_0x555fb6){return getAuthToken(_0x1c2558,_0x3ff37a,_0x143575)[_0xee6c('0x1b')](function(_0x10b475){var _0x5d4583={'method':'GET','uri':_0x55e9a1+_0xee6c('0x1c'),'headers':{'Authorization':_0xee6c('0x1d')+_0x10b475,'OData-Version':_0xee6c('0x1e')},'json':!![]};return rp(_0x5d4583);})['then'](function(_0x5aa815){var _0x2159a3=_0x5aa815[_0xee6c('0x1f')];var _0x31daf1=![];var _0x2f0388=null;if(!_[_0xee6c('0x20')](_0x39c18d)){if(intUtil['validateEmail'](_0x39c18d[_0xee6c('0x21')])){_0x161796[_0xee6c('0x22')]=_0x39c18d[_0xee6c('0x21')];for(_0x2f0388=0x0;_0x2f0388<_0x2159a3[_0xee6c('0x23')];_0x2f0388++){if(_0x2159a3[_0x2f0388]['internalemailaddress']===_0x39c18d[_0xee6c('0x21')]&&!_0x2159a3[_0x2f0388][_0xee6c('0x24')]){_0x31daf1=!![];logger[_0xee6c('0x25')]('['+[_0x143575['toUpperCase']()]+_0xee6c('0x26')+_0x2159a3[_0x2f0388][_0xee6c('0x27')]+'!');_0x161796[_0xee6c('0x28')]=_0x2159a3[_0x2f0388][_0xee6c('0x27')];}}}}if(!_0x31daf1){logger[_0xee6c('0x25')]('['+[_0x143575[_0xee6c('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x161796[_0xee6c('0x22')]=_0x1c2558[_0xee6c('0x12')];for(_0x2f0388=0x0;_0x2f0388<_0x2159a3[_0xee6c('0x23')];_0x2f0388++){if(_0x2159a3[_0x2f0388][_0xee6c('0x29')]===_0x1c2558['username']){_0x161796[_0xee6c('0x28')]=_0x2159a3[_0x2f0388][_0xee6c('0x27')];}}}_0x317901(_0x161796);})['catch'](function(_0x1fabf8){_0x555fb6(_0x1fabf8[_0xee6c('0x1a')]);});});}function createEndUser(_0x207c0d,_0x2d98a2,_0x4c6955,_0x3add11,_0x419bda,_0x4b34b1,_0xd28d5e){return new Promise(function(_0x47e9eb,_0x4e77bf){return getAuthToken(_0x2d98a2,_0x4c6955,_0x4b34b1)[_0xee6c('0x1b')](function(_0x4d0661){var _0x3ed4c6=_0x4b34b1[_0xee6c('0x2a')]()===_0xee6c('0x2b')?_0x419bda[_0xee6c('0x2c')]:_0x419bda[_0xee6c('0x2d')];var _0x4934c0={'method':_0xee6c('0x2e'),'uri':_0x3add11+_0xee6c('0x2f'),'body':{'fullname':_0x3ed4c6,'firstname':_0x3ed4c6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xee6c('0x30')+_0x207c0d[_0xee6c('0x28')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4d0661,'OData-Version':_0xee6c('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x4934c0[_0xee6c('0x31')][_0xd28d5e]=_0x3ed4c6;return rp(_0x4934c0);})[_0xee6c('0x1b')](function(_0x40b60a){var _0x444132=_0x40b60a[_0xee6c('0x32')][_0xee6c('0x33')];var _0x5559f3=_0x444132[_0xee6c('0x34')](_0x444132[_0xee6c('0x35')]('(')+0x1,_0x444132[_0xee6c('0x35')](')'));_0x207c0d[_0xee6c('0x36')]=_0x5559f3;_0x47e9eb(_0x207c0d);})[_0xee6c('0x16')](function(_0x397c97){_0x4e77bf(_0x397c97[_0xee6c('0x1a')]);});});}function getEndUser(_0x48169a,_0x4f8de4,_0x709b21,_0x4bfe69,_0x59e48d,_0x28daae,_0x5377b1,_0x3d8715){var _0x52c42d=_0x28daae[_0xee6c('0x2a')]()===_0xee6c('0x2b')?_0x59e48d['destcalleridnum']:_0x59e48d['calleridnum'];return getAuthToken(_0x4f8de4,_0x709b21,_0x28daae)[_0xee6c('0x1b')](function(_0x2981ec){_0x3d8715=_0x3d8715?_0x3d8715:_0xee6c('0x37');var _0x3ee5da={'method':_0xee6c('0x38'),'uri':_0x4bfe69+_0xee6c('0x39')+_0x3d8715+_0xee6c('0x3a')+_0x3d8715+_0xee6c('0x3b')+_0x52c42d[_0xee6c('0x3c')]('+',_0xee6c('0x3d'))+'\x27','headers':{'Authorization':_0xee6c('0x1d')+_0x2981ec,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3ee5da);})[_0xee6c('0x1b')](function(_0x4523bd){var _0x6a1384=![];if(!_0x4523bd)return _0x6a1384;var _0x4b2df9=_0x4523bd[_0xee6c('0x1f')];for(var _0xecc95c=0x0;_0xecc95c<_0x4b2df9[_0xee6c('0x23')];_0xecc95c++){if(_0x4b2df9[_0xecc95c][_0x3d8715]===_0x52c42d){_0x6a1384=!![];_0x48169a[_0xee6c('0x36')]=_0x4b2df9[_0xecc95c][_0xee6c('0x3e')];}}return _0x6a1384;})[_0xee6c('0x1b')](function(_0x842022){if(_0x842022)return _0x48169a;if(_0x5377b1===_0xee6c('0x3f')){logger['info']('['+[_0x28daae[_0xee6c('0x18')]()]+_0xee6c('0x40'));return _0x48169a;}return createEndUser(_0x48169a,_0x4f8de4,_0x709b21,_0x4bfe69,_0x59e48d,_0x28daae,_0x3d8715)[_0xee6c('0x1b')](function(_0x13ac7b){logger[_0xee6c('0x25')]('['+[_0x28daae['toUpperCase']()]+']\x20Enduser\x20created!',_0x13ac7b[_0xee6c('0x36')]);return _0x13ac7b;});});}function getCustomFields(_0xccc009,_0x1012ba,_0x56a9f9){var _0x2d9cab={};if(_0xccc009[_0xee6c('0x23')]>0x0){_['forEach'](_0xccc009,function(_0x40e0bf){if(_[_0xee6c('0x41')]([_0xee6c('0x42'),'picklist'],_0x40e0bf[_0xee6c('0x43')])&&_0x40e0bf[_0xee6c('0x44')]&&!_0x40e0bf[_0xee6c('0x45')]){var _0x578bf4=_0x40e0bf[_0xee6c('0x46')][_0xee6c('0x2a')]();var _0x2a71ed=_0x578bf4[_0xee6c('0x34')](0x0,_0x578bf4[_0xee6c('0x47')]('_'));var _0x4a5526=_0x578bf4[_0xee6c('0x34')](_0x578bf4[_0xee6c('0x47')]('_')+0x1);if(_0x2a71ed===_0x56a9f9){_0x2d9cab[_0x4a5526]=_0x40e0bf[_0xee6c('0x48')];}}});}return _0x2d9cab;}function getTicket(_0x29f933,_0x302cb4,_0xf8fd3b,_0x27d2e2,_0x1a6500,_0x58efed,_0x2e9281){return new Promise(function(_0x5efb19,_0x1a3bf2){var _0x5f07fb;return getAuthToken(_0x302cb4,_0xf8fd3b,_0x2e9281)[_0xee6c('0x1b')](function(_0xb9be47){if(_0x58efed[_0xee6c('0x49')]==='incident'){_0x5f07fb={'method':_0xee6c('0x2e'),'uri':_0x27d2e2+'incidents','body':Object[_0xee6c('0x4a')]({},{'title':intUtil['getString'](_0x58efed[_0xee6c('0x4b')],_0x1a6500,'\x20'),'description':intUtil['getString'](_0x58efed[_0xee6c('0x4c')],_0x1a6500,'\x0a'),'customerid_contact@odata.bind':_0x29f933[_0xee6c('0x36')]?_0xee6c('0x4d')+_0x29f933['enduserId']+')':undefined,'ownerid@odata.bind':_0xee6c('0x30')+_0x29f933[_0xee6c('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x58efed[_0xee6c('0x4e')],_0x1a6500,_0x58efed[_0xee6c('0x49')])),'headers':{'Authorization':'Bearer\x20'+_0xb9be47,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x58efed[_0xee6c('0x49')]==='phonecall'){var _0x594e85=_0x29f933[_0xee6c('0x36')]?[{'partyid_systemuser@odata.bind':_0xee6c('0x30')+_0x29f933[_0xee6c('0x28')]+')','participationtypemask':_0x29f933['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xee6c('0x4d')+_0x29f933[_0xee6c('0x36')]+')','participationtypemask':_0x29f933[_0xee6c('0x4f')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xee6c('0x30')+_0x29f933[_0xee6c('0x28')]+')','participationtypemask':_0x29f933[_0xee6c('0x4f')]===_0xee6c('0x50')?0x2:0x1}];_0x5f07fb={'method':'POST','uri':_0x27d2e2+_0xee6c('0x51'),'body':Object[_0xee6c('0x4a')]({},{'subject':intUtil[_0xee6c('0x52')](_0x58efed[_0xee6c('0x4b')],_0x1a6500,'\x20'),'phonenumber':String(_0x1a6500['calleridnum']),'description':intUtil[_0xee6c('0x52')](_0x58efed[_0xee6c('0x4c')],_0x1a6500,'\x0a'),'regardingobjectid_contact@odata.bind':_0x29f933[_0xee6c('0x36')]?_0xee6c('0x4d')+_0x29f933['enduserId']+')':undefined,'ownerid@odata.bind':_0xee6c('0x30')+_0x29f933[_0xee6c('0x28')]+')','directioncode':_0x29f933[_0xee6c('0x4f')]===_0xee6c('0x50')?![]:!![],'phonecall_activity_parties':_0x594e85},getCustomFields(_0x58efed['Fields'],_0x1a6500,_0x58efed['ticketType'])),'headers':{'Authorization':_0xee6c('0x1d')+_0xb9be47,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5f07fb);})[_0xee6c('0x1b')](function(_0x36dc93){var _0x341443=_0x36dc93['headers']['odata-entityid'];var _0x46d616=_0x341443[_0xee6c('0x34')](_0x341443[_0xee6c('0x35')]('(')+0x1,_0x341443[_0xee6c('0x35')](')'));_0x29f933[_0xee6c('0x53')]=_0x46d616;_0x5efb19(_0x29f933);})[_0xee6c('0x16')](function(_0x3b0d7f){_0x1a3bf2(_0x3b0d7f[_0xee6c('0x1a')]);});});}function emit(_0x54404b,_0x31017d,_0x117ef3,_0x9b8165){var _0x49c7b0={'uri':util[_0xee6c('0x54')](_0xee6c('0x55'),_0x54404b,_0x117ef3,_0x9b8165)};io['to'](util['format'](_0xee6c('0x56'),_0x31017d))['emit']('trigger:browser:url',_0x49c7b0);}exports['cs']=function(_0x3291b0,_0x665ca0,_0x3be948,_0x435c93,_0x4e2ae5,_0x2ab6ca,_0x433f89,_0x29bbad){var _0x21319c={};_0x2ab6ca['remoteUri']=_0x2ab6ca[_0xee6c('0xa')]?intUtil['stripTrailingSlash'](_0x2ab6ca[_0xee6c('0xc')][_0xee6c('0x57')]):intUtil['stripTrailingSlash'](_0x2ab6ca['remoteUri']);_0x2ab6ca['serverUrl']=intUtil[_0xee6c('0x58')](_0x2ab6ca[_0xee6c('0x59')]);_0x21319c[_0xee6c('0x4f')]=_0x29bbad===_0xee6c('0x50')||_0x29bbad==='unmanaged'?'queue':_0xee6c('0x2b');var _0x37c1cd=_0x2ab6ca[_0xee6c('0xa')]?util['format']('%s/api/data/v9.0/',_0x2ab6ca[_0xee6c('0xc')][_0xee6c('0x57')]):util['format'](_0xee6c('0x5a'),_0x2ab6ca[_0xee6c('0xb')]);var _0x3bf8f8=util[_0xee6c('0x54')](_0xee6c('0x5b'),_0x2ab6ca['tenantId']);var _0x15860b=util[_0xee6c('0x54')](_0xee6c('0x5c'),_0x2ab6ca[_0xee6c('0x59')],_0x665ca0['uniqueid'],md5(_0x665ca0['uniqueid']));if(_0x4e2ae5&&_0x4e2ae5['monitor_format']){logger[_0xee6c('0x25')](_0xee6c('0x5d'),_0xee6c('0x5e'));_0x665ca0[_0xee6c('0x5f')]=_0x15860b;}else if(_0x433f89&&_0x433f89['recordingFormat']&&_0x433f89[_0xee6c('0x60')]!==_0xee6c('0x61')){logger[_0xee6c('0x25')]('[OUTBOUND]',_0xee6c('0x5e'));_0x665ca0[_0xee6c('0x5f')]=_0x15860b;}else{_0x665ca0[_0xee6c('0x5f')]='';}return getUser(_0x21319c,_0x2ab6ca,_0x435c93,_0x3bf8f8,_0x37c1cd,_0x29bbad)['then'](function(_0x4df364){logger[_0xee6c('0x25')]('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x62'),_0x4df364[_0xee6c('0x28')]);logger[_0xee6c('0x25')]('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x63'),_0x4df364['userEmail']);return getEndUser(_0x4df364,_0x2ab6ca,_0x3bf8f8,_0x37c1cd,_0x665ca0,_0x29bbad,_0x3be948[_0xee6c('0x64')],_0x3be948[_0xee6c('0x65')]);})[_0xee6c('0x1b')](function(_0x1b75af){logger['info']('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x66'),_0x1b75af[_0xee6c('0x36')]);logger['info']('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x67'),_0x665ca0[_0xee6c('0x2d')]);return getTicket(_0x1b75af,_0x2ab6ca,_0x3bf8f8,_0x37c1cd,_0x665ca0,_0x3be948,_0x29bbad);})['then'](function(_0x1109c6){logger['info'](util['format']('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x68'),_0x3be948[_0xee6c('0x49')],_0x1109c6[_0xee6c('0x53')]));logger[_0xee6c('0x25')](util[_0xee6c('0x54')]('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x69'),_0x29bbad));if(_0x29bbad!==_0xee6c('0x6a')&&_0x3be948['openNewTab']){logger['info']('['+_0x29bbad[_0xee6c('0x18')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2ab6ca[_0xee6c('0xb')],_0x435c93[_0xee6c('0x6b')],_0x3be948['ticketType'],_0x1109c6[_0xee6c('0x53')]);}})['catch'](function(_0xa52580){logger[_0xee6c('0x17')]('['+_0x29bbad[_0xee6c('0x18')]()+_0xee6c('0x6c'),_0xa52580['message']);console[_0xee6c('0x17')]('Error\x20running\x20Dynamics365\x20integration',_0xa52580);});}; \ 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 21babfc..039cf2d 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 _0x1211=['queue','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','stringify','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','destcalleridname','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Descriptions','Tags','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','GET','forEach','includes','string','type','nameField','toLowerCase','content','picklist','idField','push','variable','variableName','customField','Variable','name'];(function(_0x3186d3,_0x1cede4){var _0x33298e=function(_0x14e070){while(--_0x14e070){_0x3186d3['push'](_0x3186d3['shift']());}};_0x33298e(++_0x1cede4);}(_0x1211,0x76));var _0x1121=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1211[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1121('0x0'));var rp=require(_0x1121('0x1'));var md5=require(_0x1121('0x2'));var util=require(_0x1121('0x3'));var Redis=require(_0x1121('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x1121('0x5'))(_0x1121('0x6'));config[_0x1121('0x7')]=_[_0x1121('0x8')](config[_0x1121('0x7')],{'host':_0x1121('0x9'),'port':0x18eb});var io=require(_0x1121('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0x1121('0xb'),'Accept':_0x1121('0xb')};function emit(_0x4efceb,_0x3f070c,_0x2ab065){io['to'](_0x4efceb)['emit'](_0x3f070c,_0x2ab065);}function getTicket(_0x3233fb,_0x5978f3,_0x5584cc,_0x3df047,_0x38536a){logger[_0x1121('0xc')](_0x1121('0xd'));var _0xbbb25a=_[_0x1121('0xe')]({'responder_id':_0x5978f3['id'],'requester_id':_0x5584cc['id'],'name':util[_0x1121('0xf')](_0x1121('0x10'),_0x38536a[_0x1121('0x11')]),'phone':_0x38536a[_0x1121('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3df047['Subjects'],_0x38536a,'\x20'),'description':intUtil['getString'](_0x3df047[_0x1121('0x13')],_0x38536a,'
'),'tags':getTags(_0x3df047[_0x1121('0x14')],'name')},getCustomFields(_0x3df047[_0x1121('0x15')],_0x38536a));_0xbbb25a['custom_fields']=_['mapValues'](_[_0x1121('0x16')](_0xbbb25a[_0x1121('0x17')],'id'),_0x1121('0x18'));return request({'uri':util[_0x1121('0xf')](_0x1121('0x19'),_0x3233fb[_0x1121('0x1a')]),'method':'POST','body':_0xbbb25a})[_0x1121('0x1b')](function(_0x4dc046){logger['info'](_0x1121('0x1c'));return _0x4dc046;});}function getUser(_0x23fae6,_0x59997c){if(intUtil[_0x1121('0x1d')](_0x59997c)){return request({'uri':util[_0x1121('0xf')](_0x1121('0x1e'),_0x23fae6['remoteUri']),'qs':{'email':_0x59997c}})[_0x1121('0x1b')](function(_0x4ea126){if(_0x4ea126[_0x1121('0x1f')]){logger[_0x1121('0xc')](_0x1121('0x20'));return _[_0x1121('0x21')](_0x4ea126,function(_0xd91c2){return _0xd91c2[_0x1121('0x22')][_0x1121('0x23')]===_0x59997c;});}else{logger['info'](_0x1121('0x24'));return request({'uri':util['format'](_0x1121('0x25'),_0x23fae6[_0x1121('0x1a')])})[_0x1121('0x1b')](function(_0x2e0b79){logger['info'](_0x1121('0x26'));return _0x2e0b79;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x23fae6['remoteUri'])})[_0x1121('0x1b')](function(_0x268233){logger[_0x1121('0xc')](_0x1121('0x26'));return _0x268233;});}}function getEndUser(_0x95b577,_0x249877,_0x3ba5c1){logger[_0x1121('0xc')](_0x1121('0x27'),_0x3ba5c1);return request({'uri':util['format']('%s/api/v2/contacts',_0x95b577['remoteUri']),'qs':{'phone':_0x3ba5c1}})[_0x1121('0x1b')](function(_0x49b669){if(_0x49b669[_0x1121('0x1f')]){logger[_0x1121('0xc')](_0x1121('0x28'));return _['find'](_0x49b669,{'phone':_0x3ba5c1});}else{logger[_0x1121('0xc')](_0x1121('0x29'));return request({'uri':util['format'](_0x1121('0x2a'),_0x95b577['remoteUri']),'method':_0x1121('0x2b'),'body':{'name':_0x249877,'phone':_0x3ba5c1}})[_0x1121('0x1b')](function(_0x3e4b9e){logger[_0x1121('0xc')](_0x1121('0x2c'));return _0x3e4b9e;});}});}function getAuth(_0x11901c){return util[_0x1121('0xf')](_0x1121('0x2d'),new Buffer(_0x11901c['apiKey']+':X')[_0x1121('0x2e')](_0x1121('0x2f')));}function request(_0x4508e2){logger[_0x1121('0x30')](_0x1121('0x31'),JSON['stringify'](_0x4508e2));return rp(_['defaults'](_0x4508e2,{'method':_0x1121('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x1c6257,_0x2d4ebe){var _0x29e0da=[];if(_0x1c6257&&_0x1c6257[_0x1121('0x1f')]>0x0){_0x29e0da=_['map'](_0x1c6257,_0x2d4ebe);}return _0x29e0da;}function getCustomFields(_0x147aee,_0x51a3e9){var _0x248f24=[];var _0x35ec34={'custom_fields':[]};if(_0x147aee[_0x1121('0x1f')]>0x0){_[_0x1121('0x33')](_0x147aee,function(_0x1125e8){if(_[_0x1121('0x34')]([_0x1121('0x35'),'picklist'],_0x1125e8[_0x1121('0x36')])&&_0x1125e8[_0x1121('0x37')]&&!_0x1125e8['customField']){_0x35ec34[_0x1125e8[_0x1121('0x37')][_0x1121('0x38')]()]=_0x1125e8[_0x1121('0x39')][_0x1121('0x2e')]();}else if(_[_0x1121('0x34')]([_0x1121('0x35'),_0x1121('0x3a')],_0x1125e8[_0x1121('0x36')])&&_0x1125e8[_0x1121('0x3b')]&&_0x1125e8['customField']){_0x35ec34[_0x1121('0x17')][_0x1121('0x3c')]({'id':_0x1125e8[_0x1121('0x3b')],'value':_0x1125e8[_0x1121('0x39')][_0x1121('0x2e')]()});}else if(_0x1125e8[_0x1121('0x36')]===_0x1121('0x3d')&&_0x1125e8[_0x1121('0x3e')]&&_0x1125e8['idField']&&_0x1125e8[_0x1121('0x3f')]){_0x51a3e9[_0x1125e8[_0x1121('0x3e')]]&&_0x35ec34[_0x1121('0x17')][_0x1121('0x3c')]({'id':_0x1125e8[_0x1121('0x3b')],'value':_0x51a3e9[_0x1125e8[_0x1121('0x3e')]][_0x1121('0x2e')]()});}else if(_0x1125e8[_0x1121('0x36')]==='customVariable'&&_0x1125e8[_0x1121('0x40')]&&_0x1125e8[_0x1121('0x40')][_0x1121('0x41')]&&_0x1125e8['idField']&&_0x1125e8['customField']){_0x51a3e9[_0x1125e8['Variable'][_0x1121('0x41')]['toLowerCase']()]&&_0x35ec34['custom_fields'][_0x1121('0x3c')]({'id':_0x1125e8[_0x1121('0x3b')],'value':_0x51a3e9[_0x1125e8[_0x1121('0x40')][_0x1121('0x41')]['toLowerCase']()][_0x1121('0x2e')]()});}});}return _0x35ec34;}exports[_0x1121('0x42')]=function(_0x163d74,_0x1b36e7,_0x18752b,_0x5209dc,_0x37ffae,_0xd6e6b9){var _0x56aac0,_0x10aee2;_0xd6e6b9['remoteUri']=intUtil[_0x1121('0x43')](_0xd6e6b9['remoteUri']);_0xd6e6b9['serverUrl']=intUtil['stripTrailingSlash'](_0xd6e6b9['serverUrl']);if(_0x37ffae&&_0x37ffae[_0x1121('0x44')]){logger[_0x1121('0xc')](_0x1121('0x45'),'Recording\x20is\x20enabled!');_0x1b36e7['recordingURL']=util[_0x1121('0xf')](_0x1121('0x46'),_0xd6e6b9['serverUrl'],_0x1b36e7['uniqueid'],md5(_0x1b36e7['uniqueid']));}else{_0x1b36e7[_0x1121('0x47')]='';}headers[_0x1121('0x48')]=getAuth(_0xd6e6b9);return getUser(_0xd6e6b9,_0x5209dc[_0x1121('0x23')])['then'](function(_0x1292e7){_0x56aac0=_0x1292e7;logger['info'](_0x1121('0x49'),_0x56aac0['id']);return getEndUser(_0xd6e6b9,_0x1b36e7['calleridname'],_0x1b36e7[_0x1121('0x12')]);})[_0x1121('0x1b')](function(_0x35ac58){_0x10aee2=_0x35ac58;logger[_0x1121('0xc')](_0x1121('0x4a'),_0x10aee2['id']);return getTicket(_0xd6e6b9,_0x56aac0,_0x10aee2,_0x18752b,_0x1b36e7);})['then'](function(_0x424e9c){if(_0x424e9c&&_0x424e9c['id']){logger[_0x1121('0xc')]('Ticket\x20created!');logger[_0x1121('0xc')](_0x1121('0x4b'),_0x424e9c['id']);logger['info'](_0x1121('0x45'),_0x1121('0x4c'));emit(util[_0x1121('0xf')](_0x1121('0x4d'),_0x5209dc[_0x1121('0x41')]),_0x1121('0x4e'),{'uri':util[_0x1121('0xf')](_0x1121('0x4f'),_0xd6e6b9['remoteUri'],_0x424e9c['id'])});}})[_0x1121('0x50')](function(_0x47f42a){logger[_0x1121('0x51')](_0x1121('0x45'),JSON[_0x1121('0x52')](_0x47f42a));});};exports['outbound']=function(_0x21717f,_0x8f3e72,_0xb4c15f,_0x31bebf,_0x4bd4e4,_0x5abd63,_0x4aa06b){var _0x1a5556,_0x65994;_0x5abd63[_0x1121('0x1a')]=intUtil[_0x1121('0x43')](_0x5abd63[_0x1121('0x1a')]);_0x5abd63[_0x1121('0x53')]=intUtil[_0x1121('0x43')](_0x5abd63[_0x1121('0x53')]);if(_0x4aa06b&&_0x4aa06b[_0x1121('0x54')]&&_0x4aa06b[_0x1121('0x54')]!=='none'){logger[_0x1121('0xc')](_0x1121('0x55'),_0x1121('0x56'));_0x8f3e72[_0x1121('0x47')]=util[_0x1121('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5abd63['serverUrl'],_0x8f3e72['uniqueid'],md5(_0x8f3e72[_0x1121('0x57')]));}headers[_0x1121('0x48')]=getAuth(_0x5abd63);return getUser(_0x5abd63,_0x31bebf[_0x1121('0x23')])[_0x1121('0x1b')](function(_0x2c2409){_0x1a5556=_0x2c2409;logger[_0x1121('0xc')](_0x1121('0x49'),_0x1a5556['id']);return getEndUser(_0x5abd63,_0x8f3e72[_0x1121('0x58')],_0x8f3e72['destcalleridnum']);})[_0x1121('0x1b')](function(_0xad3b87){_0x65994=_0xad3b87;logger['info'](_0x1121('0x4a'),_0x65994['id']);return getTicket(_0x5abd63,_0x1a5556,_0x65994,_0xb4c15f,_0x8f3e72);})['then'](function(_0x119880){if(_0x119880&&_0x119880['id']){logger[_0x1121('0xc')](_0x1121('0x1c'));logger[_0x1121('0xc')](_0x1121('0x4b'),_0x119880['id']);logger[_0x1121('0xc')]('[OUTBOUND]',_0x1121('0x4c'));emit(util['format'](_0x1121('0x4d'),_0x31bebf[_0x1121('0x41')]),'trigger:browser:url',{'uri':util[_0x1121('0xf')](_0x1121('0x4f'),_0x5abd63[_0x1121('0x1a')],_0x119880['id'])});}})[_0x1121('0x50')](function(_0x13d1ed){logger['error'](_0x1121('0x55'),JSON['stringify'](_0x13d1ed));});};exports[_0x1121('0x59')]=function(_0x5befa7,_0x45c672,_0x1bb6a4,_0x2601d6,_0xf75950,_0x23e196){var _0x35c59b,_0x222ee6;_0x23e196[_0x1121('0x1a')]=intUtil[_0x1121('0x43')](_0x23e196[_0x1121('0x1a')]);_0x23e196[_0x1121('0x53')]=intUtil['stripTrailingSlash'](_0x23e196['serverUrl']);if(_0xf75950&&_0xf75950['monitor_format']){logger['info']('['+_0x45c672[_0x1121('0x5a')][_0x1121('0x5b')]()+']','Recording\x20is\x20enabled!');_0x45c672[_0x1121('0x47')]=util['format'](_0x1121('0x46'),_0x23e196['serverUrl'],_0x45c672[_0x1121('0x57')],md5(_0x45c672[_0x1121('0x57')]));}else{_0x45c672[_0x1121('0x47')]='';}headers[_0x1121('0x48')]=getAuth(_0x23e196);return getUser(_0x23e196,'')[_0x1121('0x1b')](function(_0x477a39){_0x35c59b=_0x477a39;logger[_0x1121('0xc')](_0x1121('0x49'),_0x35c59b['id']);return getEndUser(_0x23e196,_0x45c672[_0x1121('0x11')],_0x45c672['calleridnum']);})[_0x1121('0x1b')](function(_0xf4a72a){_0x222ee6=_0xf4a72a;logger[_0x1121('0xc')](_0x1121('0x4a'),_0x222ee6['id']);return getTicket(_0x23e196,_0x35c59b,_0x222ee6,_0x1bb6a4,_0x45c672);})['then'](function(_0x404bbb){if(_0x404bbb){logger[_0x1121('0xc')](_0x1121('0x1c'));logger[_0x1121('0xc')](_0x1121('0x4b'),_0x404bbb['id']);}})[_0x1121('0x50')](function(_0x4fc5b2){logger[_0x1121('0x51')]('['+_0x45c672['lastevent'][_0x1121('0x5b')]()+']',JSON['stringify'](_0x4fc5b2));});}; \ No newline at end of file +var _0x9749=['none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','error','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','then','validateEmail','format','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','POST','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','push','variable','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','recordingFormat'];(function(_0x32e57a,_0x3d5c3d){var _0x493891=function(_0x502743){while(--_0x502743){_0x32e57a['push'](_0x32e57a['shift']());}};_0x493891(++_0x3d5c3d);}(_0x9749,0x1d9));var _0x9974=function(_0x57a118,_0x3f6b46){_0x57a118=_0x57a118-0x0;var _0x2f4f37=_0x9749[_0x57a118];return _0x2f4f37;};'use strict';var _=require(_0x9974('0x0'));var rp=require(_0x9974('0x1'));var md5=require('md5');var util=require(_0x9974('0x2'));var Redis=require(_0x9974('0x3'));var intUtil=require(_0x9974('0x4'));var config=require(_0x9974('0x5'));var logger=require(_0x9974('0x6'))('freshdesk');config[_0x9974('0x7')]=_[_0x9974('0x8')](config[_0x9974('0x7')],{'host':_0x9974('0x9'),'port':0x18eb});var io=require(_0x9974('0xa'))(new Redis(config[_0x9974('0x7')]));var headers={'Content-Type':_0x9974('0xb'),'Accept':_0x9974('0xb')};function emit(_0x318f82,_0x49f459,_0x3f68f7){io['to'](_0x318f82)[_0x9974('0xc')](_0x49f459,_0x3f68f7);}function getTicket(_0x3be4bc,_0x5e13ba,_0x3680d2,_0x366923,_0x2ca1c0){logger[_0x9974('0xd')]('Creating\x20new\x20ticket...');var _0x5e8d3a=_[_0x9974('0xe')]({'responder_id':_0x5e13ba['id'],'requester_id':_0x3680d2['id'],'name':util['format'](_0x9974('0xf'),_0x2ca1c0['calleridname']),'phone':_0x2ca1c0[_0x9974('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9974('0x11')](_0x366923[_0x9974('0x12')],_0x2ca1c0,'\x20'),'description':intUtil[_0x9974('0x11')](_0x366923[_0x9974('0x13')],_0x2ca1c0,_0x9974('0x14')),'tags':getTags(_0x366923[_0x9974('0x15')],_0x9974('0x16'))},getCustomFields(_0x366923[_0x9974('0x17')],_0x2ca1c0));_0x5e8d3a[_0x9974('0x18')]=_[_0x9974('0x19')](_[_0x9974('0x1a')](_0x5e8d3a['custom_fields'],'id'),_0x9974('0x1b'));return request({'uri':util['format'](_0x9974('0x1c'),_0x3be4bc['remoteUri']),'method':'POST','body':_0x5e8d3a})[_0x9974('0x1d')](function(_0x1450af){logger[_0x9974('0xd')]('Ticket\x20created!');return _0x1450af;});}function getUser(_0x22a6c8,_0x371f1){if(intUtil[_0x9974('0x1e')](_0x371f1)){return request({'uri':util[_0x9974('0x1f')]('%s/api/v2/agents',_0x22a6c8['remoteUri']),'qs':{'email':_0x371f1}})['then'](function(_0x1d071d){if(_0x1d071d['length']){logger['info']('Agent\x20found!');return _[_0x9974('0x20')](_0x1d071d,function(_0x357515){return _0x357515[_0x9974('0x21')][_0x9974('0x22')]===_0x371f1;});}else{logger[_0x9974('0xd')](_0x9974('0x23'));return request({'uri':util['format'](_0x9974('0x24'),_0x22a6c8[_0x9974('0x25')])})[_0x9974('0x1d')](function(_0x4f319c){logger[_0x9974('0xd')](_0x9974('0x26'));return _0x4f319c;});}});}else{logger[_0x9974('0xd')](_0x9974('0x27'));return request({'uri':util[_0x9974('0x1f')]('%s/api/v2/agents/me',_0x22a6c8[_0x9974('0x25')])})[_0x9974('0x1d')](function(_0x4ce797){logger[_0x9974('0xd')](_0x9974('0x26'));return _0x4ce797;});}}function getEndUser(_0x37fc2c,_0x230f8c,_0x3a5556){logger[_0x9974('0xd')](_0x9974('0x28'),_0x3a5556);return request({'uri':util[_0x9974('0x1f')]('%s/api/v2/contacts',_0x37fc2c[_0x9974('0x25')]),'qs':{'phone':_0x3a5556}})[_0x9974('0x1d')](function(_0x1e8d79){if(_0x1e8d79[_0x9974('0x29')]){logger[_0x9974('0xd')](_0x9974('0x2a'));return _['find'](_0x1e8d79,{'phone':_0x3a5556});}else{logger[_0x9974('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x9974('0x1f')]('%s/api/v2/contacts',_0x37fc2c['remoteUri']),'method':_0x9974('0x2b'),'body':{'name':_0x230f8c,'phone':_0x3a5556}})[_0x9974('0x1d')](function(_0xea5711){logger[_0x9974('0xd')]('Enduser\x20created.');return _0xea5711;});}});}function getAuth(_0x30d56f){return util['format']('Basic\x20%s',new Buffer(_0x30d56f[_0x9974('0x2c')]+':X')[_0x9974('0x2d')]('base64'));}function request(_0x2c3df7){logger[_0x9974('0x2e')](_0x9974('0x2f'),JSON[_0x9974('0x30')](_0x2c3df7));return rp(_[_0x9974('0x8')](_0x2c3df7,{'method':_0x9974('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x2a8943,_0x4a90cf){var _0x522a0b=[];if(_0x2a8943&&_0x2a8943[_0x9974('0x29')]>0x0){_0x522a0b=_[_0x9974('0x32')](_0x2a8943,_0x4a90cf);}return _0x522a0b;}function getCustomFields(_0x8f25cf,_0x564dd9){var _0x197cf4=[];var _0x387b8e={'custom_fields':[]};if(_0x8f25cf['length']>0x0){_[_0x9974('0x33')](_0x8f25cf,function(_0x58fb92){if(_['includes']([_0x9974('0x34'),_0x9974('0x35')],_0x58fb92[_0x9974('0x36')])&&_0x58fb92[_0x9974('0x37')]&&!_0x58fb92[_0x9974('0x38')]){_0x387b8e[_0x58fb92[_0x9974('0x37')][_0x9974('0x39')]()]=_0x58fb92[_0x9974('0x3a')][_0x9974('0x2d')]();}else if(_[_0x9974('0x3b')](['string','picklist'],_0x58fb92[_0x9974('0x36')])&&_0x58fb92[_0x9974('0x3c')]&&_0x58fb92['customField']){_0x387b8e[_0x9974('0x18')][_0x9974('0x3d')]({'id':_0x58fb92[_0x9974('0x3c')],'value':_0x58fb92[_0x9974('0x3a')][_0x9974('0x2d')]()});}else if(_0x58fb92['type']===_0x9974('0x3e')&&_0x58fb92['variableName']&&_0x58fb92[_0x9974('0x3c')]&&_0x58fb92[_0x9974('0x38')]){_0x564dd9[_0x58fb92['variableName']]&&_0x387b8e[_0x9974('0x18')][_0x9974('0x3d')]({'id':_0x58fb92[_0x9974('0x3c')],'value':_0x564dd9[_0x58fb92['variableName']][_0x9974('0x2d')]()});}else if(_0x58fb92[_0x9974('0x36')]===_0x9974('0x3f')&&_0x58fb92['Variable']&&_0x58fb92['Variable'][_0x9974('0x16')]&&_0x58fb92[_0x9974('0x3c')]&&_0x58fb92[_0x9974('0x38')]){_0x564dd9[_0x58fb92[_0x9974('0x40')]['name'][_0x9974('0x39')]()]&&_0x387b8e[_0x9974('0x18')][_0x9974('0x3d')]({'id':_0x58fb92[_0x9974('0x3c')],'value':_0x564dd9[_0x58fb92[_0x9974('0x40')][_0x9974('0x16')]['toLowerCase']()][_0x9974('0x2d')]()});}});}return _0x387b8e;}exports[_0x9974('0x41')]=function(_0x5b0f2a,_0x219d78,_0x221378,_0x12a881,_0x138c13,_0x57e184){var _0x574854,_0x29e7d1;_0x57e184[_0x9974('0x25')]=intUtil[_0x9974('0x42')](_0x57e184[_0x9974('0x25')]);_0x57e184[_0x9974('0x43')]=intUtil[_0x9974('0x42')](_0x57e184[_0x9974('0x43')]);if(_0x138c13&&_0x138c13[_0x9974('0x44')]){logger[_0x9974('0xd')](_0x9974('0x45'),_0x9974('0x46'));_0x219d78[_0x9974('0x47')]=util[_0x9974('0x1f')](_0x9974('0x48'),_0x57e184[_0x9974('0x43')],_0x219d78[_0x9974('0x49')],md5(_0x219d78[_0x9974('0x49')]));}else{_0x219d78['recordingURL']='';}headers['Authorization']=getAuth(_0x57e184);return getUser(_0x57e184,_0x12a881['email'])[_0x9974('0x1d')](function(_0x52b1d0){_0x574854=_0x52b1d0;logger[_0x9974('0xd')](_0x9974('0x4a'),_0x574854['id']);return getEndUser(_0x57e184,_0x219d78[_0x9974('0x4b')],_0x219d78['calleridnum']);})[_0x9974('0x1d')](function(_0x11f2f8){_0x29e7d1=_0x11f2f8;logger[_0x9974('0xd')](_0x9974('0x4c'),_0x29e7d1['id']);return getTicket(_0x57e184,_0x574854,_0x29e7d1,_0x221378,_0x219d78);})['then'](function(_0x2dc9e8){if(_0x2dc9e8&&_0x2dc9e8['id']){logger[_0x9974('0xd')](_0x9974('0x4d'));logger[_0x9974('0xd')](_0x9974('0x4e'),_0x2dc9e8['id']);logger[_0x9974('0xd')]('[QUEUE]',_0x9974('0x4f'));emit(util['format'](_0x9974('0x50'),_0x12a881['name']),_0x9974('0x51'),{'uri':util[_0x9974('0x1f')](_0x9974('0x52'),_0x57e184[_0x9974('0x25')],_0x2dc9e8['id'])});}})[_0x9974('0x53')](function(_0x83a51a){logger['error'](_0x9974('0x45'),JSON[_0x9974('0x30')](_0x83a51a));});};exports['outbound']=function(_0x18e84f,_0x1b29d3,_0x3b13af,_0x2fe845,_0x54ea41,_0x5dc902,_0x56d260){var _0x1a1dd7,_0x2b5486;_0x5dc902[_0x9974('0x25')]=intUtil[_0x9974('0x42')](_0x5dc902[_0x9974('0x25')]);_0x5dc902[_0x9974('0x43')]=intUtil[_0x9974('0x42')](_0x5dc902['serverUrl']);if(_0x56d260&&_0x56d260[_0x9974('0x54')]&&_0x56d260[_0x9974('0x54')]!==_0x9974('0x55')){logger['info'](_0x9974('0x56'),_0x9974('0x46'));_0x1b29d3['recordingURL']=util[_0x9974('0x1f')](_0x9974('0x48'),_0x5dc902[_0x9974('0x43')],_0x1b29d3[_0x9974('0x49')],md5(_0x1b29d3[_0x9974('0x49')]));}headers[_0x9974('0x57')]=getAuth(_0x5dc902);return getUser(_0x5dc902,_0x2fe845[_0x9974('0x22')])[_0x9974('0x1d')](function(_0x384021){_0x1a1dd7=_0x384021;logger[_0x9974('0xd')](_0x9974('0x4a'),_0x1a1dd7['id']);return getEndUser(_0x5dc902,_0x1b29d3[_0x9974('0x58')],_0x1b29d3[_0x9974('0x59')]);})[_0x9974('0x1d')](function(_0x40bc4e){_0x2b5486=_0x40bc4e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2b5486['id']);return getTicket(_0x5dc902,_0x1a1dd7,_0x2b5486,_0x3b13af,_0x1b29d3);})['then'](function(_0x106c57){if(_0x106c57&&_0x106c57['id']){logger[_0x9974('0xd')]('Ticket\x20created!');logger[_0x9974('0xd')](_0x9974('0x4e'),_0x106c57['id']);logger[_0x9974('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9974('0x1f')](_0x9974('0x50'),_0x2fe845[_0x9974('0x16')]),_0x9974('0x51'),{'uri':util['format'](_0x9974('0x52'),_0x5dc902[_0x9974('0x25')],_0x106c57['id'])});}})['catch'](function(_0x33528f){logger[_0x9974('0x5a')]('[OUTBOUND]',JSON[_0x9974('0x30')](_0x33528f));});};exports['unmanaged']=function(_0x3b0402,_0x5108ac,_0x354a1f,_0x1677f9,_0x9d5cf3,_0x2f06e8){var _0x43edce,_0x1ad3de;_0x2f06e8['remoteUri']=intUtil['stripTrailingSlash'](_0x2f06e8[_0x9974('0x25')]);_0x2f06e8[_0x9974('0x43')]=intUtil[_0x9974('0x42')](_0x2f06e8[_0x9974('0x43')]);if(_0x9d5cf3&&_0x9d5cf3[_0x9974('0x44')]){logger[_0x9974('0xd')]('['+_0x5108ac[_0x9974('0x5b')][_0x9974('0x5c')]()+']','Recording\x20is\x20enabled!');_0x5108ac['recordingURL']=util[_0x9974('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f06e8['serverUrl'],_0x5108ac['uniqueid'],md5(_0x5108ac[_0x9974('0x49')]));}else{_0x5108ac[_0x9974('0x47')]='';}headers[_0x9974('0x57')]=getAuth(_0x2f06e8);return getUser(_0x2f06e8,'')['then'](function(_0x4ba366){_0x43edce=_0x4ba366;logger['info'](_0x9974('0x4a'),_0x43edce['id']);return getEndUser(_0x2f06e8,_0x5108ac[_0x9974('0x4b')],_0x5108ac['calleridnum']);})[_0x9974('0x1d')](function(_0x35549c){_0x1ad3de=_0x35549c;logger[_0x9974('0xd')](_0x9974('0x4c'),_0x1ad3de['id']);return getTicket(_0x2f06e8,_0x43edce,_0x1ad3de,_0x354a1f,_0x5108ac);})[_0x9974('0x1d')](function(_0xc4b180){if(_0xc4b180){logger[_0x9974('0xd')]('Ticket\x20created!');logger[_0x9974('0xd')](_0x9974('0x4e'),_0xc4b180['id']);}})[_0x9974('0x53')](function(_0x3944d4){logger['error']('['+_0x5108ac[_0x9974('0x5b')][_0x9974('0x5c')]()+']',JSON[_0x9974('0x30')](_0x3944d4));});}; \ 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 5cee64a..b806210 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 _0x9b12=['then','users','length','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','&f=','&entities=contact','find','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','getString','Subjects','Descriptions','Contact','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','moment','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','headers','Getting\x20admin\x20information'];(function(_0x1fd17f,_0x2aef33){var _0x50b04f=function(_0x39e7ad){while(--_0x39e7ad){_0x1fd17f['push'](_0x1fd17f['shift']());}};_0x50b04f(++_0x2aef33);}(_0x9b12,0xe6));var _0x29b1=function(_0x29fd12,_0x53d9e3){_0x29fd12=_0x29fd12-0x0;var _0x10720d=_0x9b12[_0x29fd12];return _0x10720d;};'use strict';var _=require(_0x29b1('0x0'));var rp=require('request-promise');var md5=require(_0x29b1('0x1'));var util=require('util');var moment=require(_0x29b1('0x2'));var Promise=require('bluebird');var Redis=require(_0x29b1('0x3'));var intUtil=require('./util');var config=require(_0x29b1('0x4'));var logger=require(_0x29b1('0x5'))(_0x29b1('0x6'));config[_0x29b1('0x7')]=_[_0x29b1('0x8')](config['redis'],{'host':_0x29b1('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x29b1('0x7')]));function getAdminId(_0x29eeef,_0x41b5a0,_0x1e167e,_0x9aaccd){return new Promise(function(_0x1b8650,_0x6a4aef){var _0x3b55d3=![];var _0x51b313={'method':_0x29b1('0xa'),'uri':_0x9aaccd+'/api/selector/owners','json':!![]};_0x51b313[_0x29b1('0xb')]=_0x1e167e;logger['info'](_0x29b1('0xc'));return rp(_0x51b313)[_0x29b1('0xd')](function(_0x39aab3){if(_0x39aab3){var _0x38836a=_0x39aab3[_0x29b1('0xe')];var _0x3351ad=null;for(_0x3351ad=0x0;_0x3351ad<_0x38836a[_0x29b1('0xf')];_0x3351ad++){if(_0x38836a[_0x3351ad][_0x29b1('0x10')]===_0x29eeef['adminEmail']){_0x29eeef[_0x29b1('0x11')]=_0x38836a[_0x3351ad]['id'];_0x3b55d3=!![];}}if(_0x3b55d3){logger[_0x29b1('0x12')](_0x29b1('0x13'),_0x29eeef['adminId']);_0x1b8650(_0x29eeef);}else{_0x6a4aef({'statusCode':0x194,'message':_0x29b1('0x14')});}}else{_0x6a4aef({'statusCode':0x194,'message':_0x29b1('0x14')});}})[_0x29b1('0x15')](function(_0x9969c0){logger[_0x29b1('0x16')]('['+[_0x41b5a0[_0x29b1('0x17')]()]+']',_0x9969c0[_0x29b1('0x18')]);_0x6a4aef(_0x9969c0);});});}function getUser(_0x5a4701,_0x250995,_0x451ccd){return function(_0x4eb0e0){return new Promise(function(_0x19e8d8,_0x29196e){var _0x7060b2={'method':'GET','uri':_0x451ccd+_0x29b1('0x19'),'json':!![]};_0x7060b2[_0x29b1('0xb')]=_0x250995;logger[_0x29b1('0x12')](_0x29b1('0x1a'));return rp(_0x7060b2)[_0x29b1('0xd')](function(_0x3803bc){if(_0x3803bc){var _0x2b7b68=_0x3803bc[_0x29b1('0xe')];var _0x3977bf=![];var _0x1513d8=null;if(_0x4eb0e0[_0x29b1('0x1b')]!==null){logger['info'](_0x29b1('0x1c'),_0x4eb0e0['agentEmail']);_0x4eb0e0[_0x29b1('0x1d')]=_0x4eb0e0[_0x29b1('0x1b')];for(_0x1513d8=0x0;_0x1513d8<_0x2b7b68[_0x29b1('0xf')];_0x1513d8++){if(_0x2b7b68[_0x1513d8][_0x29b1('0x10')]===_0x4eb0e0[_0x29b1('0x1b')]){_0x3977bf=!![];_0x4eb0e0[_0x29b1('0x1e')]=_0x2b7b68[_0x1513d8]['id'];logger['info'](_0x29b1('0x1f'),_0x4eb0e0[_0x29b1('0x1e')]);}}}if(!_0x3977bf){logger[_0x29b1('0x12')](_0x29b1('0x20'));_0x4eb0e0[_0x29b1('0x1d')]=_0x4eb0e0[_0x29b1('0x21')];_0x4eb0e0[_0x29b1('0x1e')]=_0x4eb0e0[_0x29b1('0x11')];_0x3977bf=!![];}if(_0x3977bf){_0x19e8d8(_0x4eb0e0);}else{_0x29196e({'statusCode':0x194,'message':_0x29b1('0x14')});}}else{_0x29196e({'statusCode':0x194,'message':_0x29b1('0x14')});}})['catch'](function(_0x57d19c){logger[_0x29b1('0x16')]('['+[_0x5a4701['toUpperCase']()]+']',_0x57d19c[_0x29b1('0x18')]);_0x29196e(_0x57d19c);});});};}function searchContact(_0x1009f7,_0x245430,_0x3f1a55,_0x2704ab){return new Promise(function(_0xda2535,_0x1ff8bd){var _0x48fdff={'method':_0x29b1('0xa'),'headers':_0x245430,'uri':_0x1009f7+'/api/lookup?q='+_0x2704ab+_0x29b1('0x22')+_0x3f1a55+_0x29b1('0x23'),'json':!![]};rp(_0x48fdff)[_0x29b1('0xd')](function(_0x5a9661){var _0x1fc44d=_[_0x29b1('0x24')](_0x5a9661['contacts']['contacts'],[_0x3f1a55,_0x2704ab]);_0xda2535(_0x1fc44d);})[_0x29b1('0x15')](function(_0x328eff){_0x1ff8bd(_0x328eff);});});}function getEndUser(_0x419012,_0x4a5a95,_0x462624){return function(_0x4d3514){return new Promise(function(_0x460a82,_0x5dc2e2){logger[_0x29b1('0x12')](util['format'](_0x29b1('0x25'),_0x4d3514['contactNumber']));searchContact(_0x462624,_0x4a5a95,_0x29b1('0x26'),_0x4d3514[_0x29b1('0x27')])[_0x29b1('0xd')](function(_0x4c546b){if(_0x4c546b){_0x4d3514[_0x29b1('0x28')]=_0x4c546b['id'];logger[_0x29b1('0x12')](_0x29b1('0x29'),_0x4d3514['endUserId']);return _0x460a82(_0x4d3514);}searchContact(_0x462624,_0x4a5a95,_0x29b1('0x2a'),_0x4d3514['contactNumber'])[_0x29b1('0xd')](function(_0x39fbdf){if(_0x39fbdf){_0x4d3514[_0x29b1('0x28')]=_0x39fbdf['id'];logger[_0x29b1('0x12')](_0x29b1('0x2b'),_0x4d3514[_0x29b1('0x28')]);return _0x460a82(_0x4d3514);}createEndUser(_0x4d3514,_0x419012,_0x4a5a95,_0x462624)['then'](function(_0x117f0d){logger[_0x29b1('0x12')](_0x29b1('0x2c'),_0x117f0d[_0x29b1('0x28')]);return _0x460a82(_0x117f0d);});});})[_0x29b1('0x15')](function(_0x2599b2){_0x5dc2e2(_0x2599b2);});});};}function createEndUser(_0x14ede3,_0x66416c,_0x3c827a,_0x26b18c){return new Promise(function(_0x5478a4,_0x3b65cd){var _0x13a1ef=moment();var _0x2a6660={'method':'POST','uri':_0x26b18c+_0x29b1('0x2d'),'body':{'contact':{'last_name':_0x14ede3[_0x29b1('0x27')],'work_number':_0x14ede3['contactNumber'],'mobile_number':_0x14ede3['contactNumber'],'owner_id':_0x14ede3[_0x29b1('0x1e')],'created_at':_0x13a1ef[_0x29b1('0x2e')](_0x29b1('0x2f'))}},'json':!![]};_0x2a6660['headers']=_0x3c827a;logger[_0x29b1('0x12')](_0x29b1('0x30'));return rp(_0x2a6660)[_0x29b1('0xd')](function(_0x3ab430){_0x14ede3[_0x29b1('0x28')]=_0x3ab430[_0x29b1('0x31')]['id'];_0x5478a4(_0x14ede3);})[_0x29b1('0x15')](function(_0x4fcd09){logger[_0x29b1('0x16')]('['+[_0x66416c[_0x29b1('0x17')]()]+']',_0x4fcd09[_0x29b1('0x18')]);_0x3b65cd(_0x4fcd09[_0x29b1('0x18')]);});});}function getTicket(_0x246da8,_0x132d0f,_0x3198a7,_0x4eb48d,_0x1cb30d){return function(_0x29c275){logger[_0x29b1('0x12')]('Creating\x20new\x20task');return new Promise(function(_0x403ae7,_0x41e250){var _0x11f99e=moment();var _0x3c10e1={'method':_0x29b1('0x32'),'uri':_0x3198a7+'/api/tasks','body':{'title':intUtil[_0x29b1('0x33')](_0x4eb48d[_0x29b1('0x34')],_0x1cb30d,'\x20'),'description':intUtil[_0x29b1('0x33')](_0x4eb48d[_0x29b1('0x35')],_0x1cb30d,'\x0a'),'owner_id':_0x29c275[_0x29b1('0x1e')],'creater_id':_0x29c275[_0x29b1('0x11')],'targetable_id':_0x29c275[_0x29b1('0x28')],'targetable_type':_0x29b1('0x36'),'created_at':_0x11f99e[_0x29b1('0x2e')](_0x29b1('0x2f')),'due_date':_0x11f99e['add'](0x1e,'m')['format'](_0x29b1('0x2f'))},'json':!![]};_0x3c10e1[_0x29b1('0xb')]=_0x132d0f;return rp(_0x3c10e1)['then'](function(_0x3f7583){_0x29c275[_0x29b1('0x37')]=_0x3f7583['task']['id'];logger['info'](_0x29b1('0x38'),_0x29c275[_0x29b1('0x37')]);_0x403ae7(_0x29c275);})['catch'](function(_0x49c71a){logger[_0x29b1('0x16')]('['+[_0x246da8[_0x29b1('0x17')]()]+']',_0x49c71a[_0x29b1('0x18')]);_0x41e250(_0x49c71a['message']);});});};}function emit(_0x53c109,_0x3d14bd,_0x79826d){var _0x36bfe3={'uri':_0x53c109+_0x29b1('0x39')+_0x79826d};io['to'](util['format'](_0x29b1('0x3a'),_0x3d14bd))['emit'](_0x29b1('0x3b'),_0x36bfe3);}exports['cs']=function(_0x4fe930,_0x2415a8,_0x277371,_0x55a0bc,_0x548817,_0x96891,_0x2f1a09,_0x586112){var _0x482ecc={};var _0x3ef81d={'Authorization':_0x29b1('0x3c')+_0x96891[_0x29b1('0x3d')]};_0x96891['remoteUri']=intUtil['stripTrailingSlash'](_0x96891[_0x29b1('0x3e')]);_0x96891['serverUrl']=intUtil[_0x29b1('0x3f')](_0x96891[_0x29b1('0x40')]);var _0x138062=_0x96891[_0x29b1('0x3e')];_0x482ecc[_0x29b1('0x21')]=_0x96891[_0x29b1('0x41')];_0x482ecc[_0x29b1('0x27')]=_0x586112[_0x29b1('0x42')]()==='outbound'?_0x2415a8[_0x29b1('0x43')]:_0x2415a8['calleridnum'];_0x482ecc['callDirection']=_0x586112===_0x29b1('0x44')||_0x586112===_0x29b1('0x45')?_0x29b1('0x44'):_0x29b1('0x46');if(_0x55a0bc){_0x482ecc['agentEmail']=_0x55a0bc[_0x29b1('0x10')];}var _0x3d549f=util[_0x29b1('0x2e')](_0x29b1('0x47'),_0x96891[_0x29b1('0x40')],_0x2415a8[_0x29b1('0x48')],md5(_0x2415a8[_0x29b1('0x48')]));if(_0x548817&&_0x548817[_0x29b1('0x49')]){logger['info'](_0x29b1('0x4a'),'Recording\x20is\x20enabled!');_0x2415a8[_0x29b1('0x4b')]=_0x3d549f;}else if(_0x2f1a09&&_0x2f1a09['recordingFormat']&&_0x2f1a09[_0x29b1('0x4c')]!=='none'){logger[_0x29b1('0x12')](_0x29b1('0x4d'),'Recording\x20is\x20enabled!');_0x2415a8[_0x29b1('0x4b')]=_0x3d549f;}else{_0x2415a8[_0x29b1('0x4b')]='';}return getAdminId(_0x482ecc,_0x586112,_0x3ef81d,_0x138062)['then'](getUser(_0x586112,_0x3ef81d,_0x138062))[_0x29b1('0xd')](getEndUser(_0x586112,_0x3ef81d,_0x138062))[_0x29b1('0xd')](getTicket(_0x586112,_0x3ef81d,_0x138062,_0x277371,_0x2415a8))[_0x29b1('0xd')](function(_0x41162a){logger[_0x29b1('0x12')](util['format'](_0x29b1('0x4e'),_0x41162a[_0x29b1('0x37')]));if(_0x586112!==_0x29b1('0x45')){logger[_0x29b1('0x12')]('['+[_0x586112['toUpperCase']()]+']',_0x29b1('0x4f'));emit(_0x138062,_0x55a0bc['name'],_0x41162a[_0x29b1('0x28')]);}})[_0x29b1('0x15')](function(_0x27b9ff){logger[_0x29b1('0x16')]('['+[_0x586112['toUpperCase']()]+_0x29b1('0x50'),util['inspect'](_0x27b9ff,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x806e=['Task\x20created:','error','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','length','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','email','User\x20found:','userId','Admin\x20selected','adminEmail','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Descriptions','format','ticketId'];(function(_0x3c1642,_0xf94198){var _0x1f02d0=function(_0x35a1d1){while(--_0x35a1d1){_0x3c1642['push'](_0x3c1642['shift']());}};_0x1f02d0(++_0xf94198);}(_0x806e,0x6b));var _0xe806=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x806e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe806('0x0'));var rp=require(_0xe806('0x1'));var md5=require('md5');var util=require(_0xe806('0x2'));var moment=require(_0xe806('0x3'));var Promise=require(_0xe806('0x4'));var Redis=require('ioredis');var intUtil=require(_0xe806('0x5'));var config=require(_0xe806('0x6'));var logger=require(_0xe806('0x7'))('freshsales');config[_0xe806('0x8')]=_[_0xe806('0x9')](config[_0xe806('0x8')],{'host':_0xe806('0xa'),'port':0x18eb});var io=require(_0xe806('0xb'))(new Redis(config['redis']));function getAdminId(_0x273158,_0x4a3d40,_0x1290c5,_0x175e3f){return new Promise(function(_0x5790bc,_0x238b64){var _0x56ec06=![];var _0x1eeb72={'method':_0xe806('0xc'),'uri':_0x175e3f+_0xe806('0xd'),'json':!![]};_0x1eeb72[_0xe806('0xe')]=_0x1290c5;logger[_0xe806('0xf')]('Getting\x20admin\x20information');return rp(_0x1eeb72)[_0xe806('0x10')](function(_0x5b2b12){if(_0x5b2b12){var _0x3739a2=_0x5b2b12['users'];var _0x7a4c8b=null;for(_0x7a4c8b=0x0;_0x7a4c8b<_0x3739a2[_0xe806('0x11')];_0x7a4c8b++){if(_0x3739a2[_0x7a4c8b]['email']===_0x273158['adminEmail']){_0x273158[_0xe806('0x12')]=_0x3739a2[_0x7a4c8b]['id'];_0x56ec06=!![];}}if(_0x56ec06){logger[_0xe806('0xf')]('Admin\x20found:',_0x273158[_0xe806('0x12')]);_0x5790bc(_0x273158);}else{_0x238b64({'statusCode':0x194,'message':_0xe806('0x13')});}}else{_0x238b64({'statusCode':0x194,'message':_0xe806('0x13')});}})[_0xe806('0x14')](function(_0x5940c6){logger['error']('['+[_0x4a3d40[_0xe806('0x15')]()]+']',_0x5940c6[_0xe806('0x16')]);_0x238b64(_0x5940c6);});});}function getUser(_0x1085d7,_0x376427,_0xff421c){return function(_0x453e8f){return new Promise(function(_0x5aa66e,_0x208919){var _0x57184d={'method':_0xe806('0xc'),'uri':_0xff421c+_0xe806('0xd'),'json':!![]};_0x57184d[_0xe806('0xe')]=_0x376427;logger[_0xe806('0xf')](_0xe806('0x17'));return rp(_0x57184d)[_0xe806('0x10')](function(_0x4d6e9f){if(_0x4d6e9f){var _0x25927a=_0x4d6e9f[_0xe806('0x18')];var _0x4e56b0=![];var _0x3968a9=null;if(_0x453e8f['agentEmail']!==null){logger[_0xe806('0xf')](_0xe806('0x19'),_0x453e8f[_0xe806('0x1a')]);_0x453e8f[_0xe806('0x1b')]=_0x453e8f[_0xe806('0x1a')];for(_0x3968a9=0x0;_0x3968a9<_0x25927a[_0xe806('0x11')];_0x3968a9++){if(_0x25927a[_0x3968a9][_0xe806('0x1c')]===_0x453e8f[_0xe806('0x1a')]){_0x4e56b0=!![];_0x453e8f['userId']=_0x25927a[_0x3968a9]['id'];logger[_0xe806('0xf')](_0xe806('0x1d'),_0x453e8f[_0xe806('0x1e')]);}}}if(!_0x4e56b0){logger['info'](_0xe806('0x1f'));_0x453e8f['userEmail']=_0x453e8f[_0xe806('0x20')];_0x453e8f['userId']=_0x453e8f[_0xe806('0x12')];_0x4e56b0=!![];}if(_0x4e56b0){_0x5aa66e(_0x453e8f);}else{_0x208919({'statusCode':0x194,'message':_0xe806('0x13')});}}else{_0x208919({'statusCode':0x194,'message':_0xe806('0x13')});}})[_0xe806('0x14')](function(_0x32f980){logger['error']('['+[_0x1085d7['toUpperCase']()]+']',_0x32f980[_0xe806('0x16')]);_0x208919(_0x32f980);});});};}function searchContact(_0x3fa0dc,_0x5e1bac,_0x581367,_0x43e6a2){return new Promise(function(_0x1cfd12,_0x58a986){var _0x349d4a={'method':_0xe806('0xc'),'headers':_0x5e1bac,'uri':_0x3fa0dc+'/api/lookup?q='+_0x43e6a2+_0xe806('0x21')+_0x581367+_0xe806('0x22'),'json':!![]};rp(_0x349d4a)['then'](function(_0x4d1244){var _0x393c36=_[_0xe806('0x23')](_0x4d1244[_0xe806('0x24')][_0xe806('0x24')],[_0x581367,_0x43e6a2]);_0x1cfd12(_0x393c36);})['catch'](function(_0x2f2c86){_0x58a986(_0x2f2c86);});});}function getEndUser(_0x1481c4,_0x183796,_0x203273){return function(_0x347fed){return new Promise(function(_0x56329a,_0x1cf91b){logger[_0xe806('0xf')](util['format'](_0xe806('0x25'),_0x347fed['contactNumber']));searchContact(_0x203273,_0x183796,'mobile_number',_0x347fed[_0xe806('0x26')])['then'](function(_0x34a39e){if(_0x34a39e){_0x347fed[_0xe806('0x27')]=_0x34a39e['id'];logger[_0xe806('0xf')]('Contact\x20found\x20mobile_number:',_0x347fed[_0xe806('0x27')]);return _0x56329a(_0x347fed);}searchContact(_0x203273,_0x183796,_0xe806('0x28'),_0x347fed[_0xe806('0x26')])[_0xe806('0x10')](function(_0x1d81ee){if(_0x1d81ee){_0x347fed['endUserId']=_0x1d81ee['id'];logger['info'](_0xe806('0x29'),_0x347fed[_0xe806('0x27')]);return _0x56329a(_0x347fed);}createEndUser(_0x347fed,_0x1481c4,_0x183796,_0x203273)[_0xe806('0x10')](function(_0x5c5f6e){logger[_0xe806('0xf')]('Contact\x20created:',_0x5c5f6e['endUserId']);return _0x56329a(_0x5c5f6e);});});})[_0xe806('0x14')](function(_0x14cd01){_0x1cf91b(_0x14cd01);});});};}function createEndUser(_0xfd9b34,_0x57ccdc,_0x3de54b,_0x5b13a3){return new Promise(function(_0x325239,_0xd03d1e){var _0x13e38f=moment();var _0x4ba6d9={'method':_0xe806('0x2a'),'uri':_0x5b13a3+_0xe806('0x2b'),'body':{'contact':{'last_name':_0xfd9b34['contactNumber'],'work_number':_0xfd9b34['contactNumber'],'mobile_number':_0xfd9b34[_0xe806('0x26')],'owner_id':_0xfd9b34['userId'],'created_at':_0x13e38f['format'](_0xe806('0x2c'))}},'json':!![]};_0x4ba6d9[_0xe806('0xe')]=_0x3de54b;logger['info'](_0xe806('0x2d'));return rp(_0x4ba6d9)[_0xe806('0x10')](function(_0x2e0867){_0xfd9b34['endUserId']=_0x2e0867['contact']['id'];_0x325239(_0xfd9b34);})[_0xe806('0x14')](function(_0x22837b){logger['error']('['+[_0x57ccdc['toUpperCase']()]+']',_0x22837b['message']);_0xd03d1e(_0x22837b[_0xe806('0x16')]);});});}function getTicket(_0x45ce65,_0x30b6fc,_0x1af8a2,_0x3efe8a,_0x418914){return function(_0x183b8a){logger[_0xe806('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x218543,_0x5736fc){var _0x124110=moment();var _0x57dab3={'method':_0xe806('0x2a'),'uri':_0x1af8a2+_0xe806('0x2e'),'body':{'title':intUtil[_0xe806('0x2f')](_0x3efe8a['Subjects'],_0x418914,'\x20'),'description':intUtil['getString'](_0x3efe8a[_0xe806('0x30')],_0x418914,'\x0a'),'owner_id':_0x183b8a[_0xe806('0x1e')],'creater_id':_0x183b8a[_0xe806('0x12')],'targetable_id':_0x183b8a[_0xe806('0x27')],'targetable_type':'Contact','created_at':_0x124110['format'](_0xe806('0x2c')),'due_date':_0x124110['add'](0x1e,'m')[_0xe806('0x31')](_0xe806('0x2c'))},'json':!![]};_0x57dab3[_0xe806('0xe')]=_0x30b6fc;return rp(_0x57dab3)['then'](function(_0x4c167f){_0x183b8a[_0xe806('0x32')]=_0x4c167f['task']['id'];logger['info'](_0xe806('0x33'),_0x183b8a[_0xe806('0x32')]);_0x218543(_0x183b8a);})[_0xe806('0x14')](function(_0x153dbe){logger[_0xe806('0x34')]('['+[_0x45ce65['toUpperCase']()]+']',_0x153dbe[_0xe806('0x16')]);_0x5736fc(_0x153dbe[_0xe806('0x16')]);});});};}function emit(_0x333431,_0x3f1446,_0x48fa27){var _0x1acc85={'uri':_0x333431+_0xe806('0x35')+_0x48fa27};io['to'](util[_0xe806('0x31')](_0xe806('0x36'),_0x3f1446))[_0xe806('0x37')](_0xe806('0x38'),_0x1acc85);}exports['cs']=function(_0x2b09c0,_0x1f8e1d,_0x6f23a5,_0x508ec7,_0x35c6a6,_0x16a24b,_0x13d90,_0x281822){var _0x13d4e4={};var _0x675ffb={'Authorization':_0xe806('0x39')+_0x16a24b[_0xe806('0x3a')]};_0x16a24b[_0xe806('0x3b')]=intUtil[_0xe806('0x3c')](_0x16a24b['remoteUri']);_0x16a24b['serverUrl']=intUtil[_0xe806('0x3c')](_0x16a24b['serverUrl']);var _0x569804=_0x16a24b[_0xe806('0x3b')];_0x13d4e4[_0xe806('0x20')]=_0x16a24b[_0xe806('0x3d')];_0x13d4e4[_0xe806('0x26')]=_0x281822[_0xe806('0x3e')]()===_0xe806('0x3f')?_0x1f8e1d[_0xe806('0x40')]:_0x1f8e1d['calleridnum'];_0x13d4e4['callDirection']=_0x281822===_0xe806('0x41')||_0x281822===_0xe806('0x42')?_0xe806('0x41'):_0xe806('0x3f');if(_0x508ec7){_0x13d4e4['agentEmail']=_0x508ec7['email'];}var _0x53bb45=util[_0xe806('0x31')](_0xe806('0x43'),_0x16a24b[_0xe806('0x44')],_0x1f8e1d[_0xe806('0x45')],md5(_0x1f8e1d[_0xe806('0x45')]));if(_0x35c6a6&&_0x35c6a6[_0xe806('0x46')]){logger[_0xe806('0xf')](_0xe806('0x47'),'Recording\x20is\x20enabled!');_0x1f8e1d[_0xe806('0x48')]=_0x53bb45;}else if(_0x13d90&&_0x13d90[_0xe806('0x49')]&&_0x13d90[_0xe806('0x49')]!==_0xe806('0x4a')){logger[_0xe806('0xf')](_0xe806('0x4b'),'Recording\x20is\x20enabled!');_0x1f8e1d[_0xe806('0x48')]=_0x53bb45;}else{_0x1f8e1d[_0xe806('0x48')]='';}return getAdminId(_0x13d4e4,_0x281822,_0x675ffb,_0x569804)[_0xe806('0x10')](getUser(_0x281822,_0x675ffb,_0x569804))[_0xe806('0x10')](getEndUser(_0x281822,_0x675ffb,_0x569804))[_0xe806('0x10')](getTicket(_0x281822,_0x675ffb,_0x569804,_0x6f23a5,_0x1f8e1d))[_0xe806('0x10')](function(_0xa7c84a){logger[_0xe806('0xf')](util['format'](_0xe806('0x4c'),_0xa7c84a['ticketId']));if(_0x281822!=='unmanaged'){logger[_0xe806('0xf')]('['+[_0x281822[_0xe806('0x15')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x569804,_0x508ec7[_0xe806('0x4d')],_0xa7c84a[_0xe806('0x27')]);}})[_0xe806('0x14')](function(_0x220d0d){logger[_0xe806('0x34')]('['+[_0x281822[_0xe806('0x15')]()]+_0xe806('0x4e'),util['inspect'](_0x220d0d,{'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 f536ca2..65c6481 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 _0xa476=['lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./dynamics365','zendesk','salesforce','sugarcrm','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','queue','outbound','log','EVENT\x20UNKNOWN','desk','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3'];(function(_0x28cd49,_0x41aea7){var _0x471f60=function(_0x159e45){while(--_0x159e45){_0x28cd49['push'](_0x28cd49['shift']());}};_0x471f60(++_0x41aea7);}(_0xa476,0x80));var _0x6a47=function(_0x3776b2,_0x5e045c){_0x3776b2=_0x3776b2-0x0;var _0x1ee790=_0xa476[_0x3776b2];return _0x1ee790;};'use strict';var _=require(_0x6a47('0x0'));var util=require(_0x6a47('0x1'));var zendesk=require(_0x6a47('0x2'));var salesforce=require(_0x6a47('0x3'));var sugarcrm=require(_0x6a47('0x4'));var freshdesk=require(_0x6a47('0x5'));var zoho=require(_0x6a47('0x6'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x6a47('0x7'));var freshsales=require('./freshsales');var integrations=[_0x6a47('0x8'),_0x6a47('0x9'),_0x6a47('0xa'),'freshdesk',_0x6a47('0xb'),'desk',_0x6a47('0xc'),_0x6a47('0xd'),_0x6a47('0xe'),_0x6a47('0xf')];exports[_0x6a47('0x10')]=function(_0x4ef498,_0x4b4214,_0x48f4f1,_0x2214bb,_0x598ac8,_0x187b91){if(_0x48f4f1){if(_[_0x6a47('0x11')](integrations,_0x4ef498[_0x6a47('0x12')][_0x6a47('0x13')]())){try{var _0x2b0f81=null;var _0x4d8d0b='';var _0xe7ec0=_0x48f4f1[_0x4ef498[_0x6a47('0x12')][_0x6a47('0x13')]()];if(_0xe7ec0){var _0x4c4433=_0xe7ec0[_0x4ef498['data2']];if(_0x4c4433){var _0x3f4f33=_[_0x6a47('0x14')](_0x4c4433['Configurations'],{'id':parseInt(_0x4ef498['data3'],0xa)});if(_0x3f4f33){if(_0x2214bb){if(_0x598ac8&&_0x4b4214[_0x6a47('0x15')]){_0x4d8d0b='queue';}else if(_0x4b4214['routeId']){_0x4d8d0b=_0x6a47('0x16');}else{console[_0x6a47('0x17')](_0x6a47('0x18'),_0x4b4214);}}else{_0x4d8d0b='unmanaged';}switch(_0x4ef498[_0x6a47('0x12')][_0x6a47('0x13')]()){case _0x6a47('0x8'):zendesk[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case _0x6a47('0x9'):salesforce[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case _0x6a47('0xa'):sugarcrm[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case'freshdesk':freshdesk[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case _0x6a47('0xb'):zoho[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case _0x6a47('0x19'):desk[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case _0x6a47('0xc'):vtiger[_0x4d8d0b](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91);break;case _0x6a47('0xe'):freshsales['cs'](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91,_0x4d8d0b);break;case _0x6a47('0xf'):servicenow['cs'](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91,_0x4d8d0b);break;case'dynamics365':dynamics365['cs'](_0x4ef498,_0x4b4214,_0x3f4f33,_0x2214bb,_0x598ac8,_0x4c4433,_0x187b91,_0x4d8d0b);break;default:console[_0x6a47('0x17')]('unknown\x20integration');}}else{_0x2b0f81=require(_0x6a47('0x1a'))(_0x4ef498[_0x6a47('0x12')][_0x6a47('0x13')]());_0x2b0f81[_0x6a47('0x1b')](_0x6a47('0x1c'),util[_0x6a47('0x1d')](_0x6a47('0x1e'),_0x4ef498[_0x6a47('0x12')]['toLowerCase'](),_0x4ef498[_0x6a47('0x1f')]));}}else{_0x2b0f81=require(_0x6a47('0x1a'))(_0x4ef498['data1'][_0x6a47('0x13')]());_0x2b0f81[_0x6a47('0x1b')](_0x6a47('0x1c'),util[_0x6a47('0x1d')]('%s\x20account\x20#%s\x20not\x20found',_0x4ef498[_0x6a47('0x12')]['toLowerCase'](),_0x4ef498['data2']));}}else{}}catch(_0x5ac4d3){console[_0x6a47('0x1b')](_0x5ac4d3);}}}}; \ No newline at end of file +var _0x2589=['./freshsales','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','servicenow','includes','toLowerCase','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','data1','zendesk','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365'];(function(_0x10026a,_0x468292){var _0x2987cb=function(_0x31cf17){while(--_0x31cf17){_0x10026a['push'](_0x10026a['shift']());}};_0x2987cb(++_0x468292);}(_0x2589,0xec));var _0x9258=function(_0x2822da,_0x32c66f){_0x2822da=_0x2822da-0x0;var _0x190956=_0x2589[_0x2822da];return _0x190956;};'use strict';var _=require(_0x9258('0x0'));var util=require(_0x9258('0x1'));var zendesk=require(_0x9258('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x9258('0x3'));var freshdesk=require(_0x9258('0x4'));var zoho=require(_0x9258('0x5'));var desk=require('./desk');var vtiger=require(_0x9258('0x6'));var servicenow=require(_0x9258('0x7'));var dynamics365=require(_0x9258('0x8'));var freshsales=require(_0x9258('0x9'));var integrations=['zendesk',_0x9258('0xa'),_0x9258('0xb'),_0x9258('0xc'),'zoho',_0x9258('0xd'),_0x9258('0xe'),_0x9258('0xf'),'freshsales',_0x9258('0x10')];exports['exec']=function(_0xebbf8f,_0x2aca2b,_0x8e3de2,_0x1faf4d,_0x1d6094,_0xfa01ab){if(_0x8e3de2){if(_[_0x9258('0x11')](integrations,_0xebbf8f['data1'][_0x9258('0x12')]())){try{var _0x2aab46=null;var _0x3894a3='';var _0x4e0033=_0x8e3de2[_0xebbf8f['data1'][_0x9258('0x12')]()];if(_0x4e0033){var _0xf17509=_0x4e0033[_0xebbf8f['data2']];if(_0xf17509){var _0xe416c=_['find'](_0xf17509['Configurations'],{'id':parseInt(_0xebbf8f[_0x9258('0x13')],0xa)});if(_0xe416c){if(_0x1faf4d){if(_0x1d6094&&_0x2aca2b[_0x9258('0x14')]){_0x3894a3='queue';}else if(_0x2aca2b[_0x9258('0x15')]){_0x3894a3='outbound';}else{console[_0x9258('0x16')](_0x9258('0x17'),_0x2aca2b);}}else{_0x3894a3=_0x9258('0x18');}switch(_0xebbf8f[_0x9258('0x19')][_0x9258('0x12')]()){case _0x9258('0x1a'):zendesk[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case _0x9258('0xa'):salesforce[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case _0x9258('0xb'):sugarcrm[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case'freshdesk':freshdesk[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case'zoho':zoho[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case _0x9258('0xd'):desk[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case _0x9258('0xe'):vtiger[_0x3894a3](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab);break;case _0x9258('0x1b'):freshsales['cs'](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab,_0x3894a3);break;case'servicenow':servicenow['cs'](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab,_0x3894a3);break;case'dynamics365':dynamics365['cs'](_0xebbf8f,_0x2aca2b,_0xe416c,_0x1faf4d,_0x1d6094,_0xf17509,_0xfa01ab,_0x3894a3);break;default:console[_0x9258('0x16')](_0x9258('0x1c'));}}else{_0x2aab46=require(_0x9258('0x1d'))(_0xebbf8f[_0x9258('0x19')][_0x9258('0x12')]());_0x2aab46[_0x9258('0x1e')](_0x9258('0x1f'),util[_0x9258('0x20')](_0x9258('0x21'),_0xebbf8f[_0x9258('0x19')][_0x9258('0x12')](),_0xebbf8f[_0x9258('0x13')]));}}else{_0x2aab46=require(_0x9258('0x1d'))(_0xebbf8f[_0x9258('0x19')]['toLowerCase']());_0x2aab46['error'](_0x9258('0x1f'),util[_0x9258('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0xebbf8f[_0x9258('0x19')][_0x9258('0x12')](),_0xebbf8f[_0x9258('0x22')]));}}else{}}catch(_0x2a4fa0){console[_0x9258('0x1e')](_0x2a4fa0);}}}}; \ 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 751a8ff..bc977bc 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 _0x487c=['Caller\x20-\x20%s','Company','format','upperFirst','forEach','includes','idField','content','variableName','toString','customVariable','Variable','name','password','securityToken','Connection','remoteUri','clientId','clientSecret','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[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','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','none','destcalleridname','destcalleridnum','%s/%s/e','[OUTBOUND]','catch','lastevent','toUpperCase','Fields',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','sobject','Contact','additionalSearchLead','$or','Lead','account_contact_lead','Account','additionalSearchAccount','first','Phone','attributes','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName',''];(function(_0x788c48,_0x5c0e5e){var _0x299c14=function(_0x6be4c){while(--_0x6be4c){_0x788c48['push'](_0x788c48['shift']());}};_0x299c14(++_0x5c0e5e);}(_0x487c,0x1a1));var _0xc487=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x487c[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var rp=require(_0xc487('0x0'));var moment=require(_0xc487('0x1'));var BPromise=require(_0xc487('0x2'));var md5=require('md5');var jsforce=require(_0xc487('0x3'));var util=require(_0xc487('0x4'));var Redis=require(_0xc487('0x5'));var intUtil=require(_0xc487('0x6'));var config=require(_0xc487('0x7'));var logger=require(_0xc487('0x8'))(_0xc487('0x9'));config['redis']=_[_0xc487('0xa')](config[_0xc487('0xb')],{'host':_0xc487('0xc'),'port':0x18eb});var io=require(_0xc487('0xd'))(new Redis(config['redis']));function emit(_0x44bf92,_0x366c1a,_0x3a8040){io['to'](_0x44bf92)[_0xc487('0xe')](_0x366c1a,_0x3a8040);}function getTicket(_0x1a5a14,_0x3ee86a,_0x5bf1b0,_0x177172,_0x2cfa81,_0x5e56c3,_0x24a20d,_0x4b33bc){var _0x2b2f03=Object[_0xc487('0xf')]({},{'OwnerId':_0x3ee86a['id'],'Subject':intUtil['getString'](_0x177172[_0xc487('0x10')],_0x2cfa81,'\x20'),'Description':intUtil['getString'](_0x177172[_0xc487('0x11')],_0x2cfa81,'\x0a')},getCustomFields(_0x5e56c3,_0x2cfa81));if(_0x5bf1b0){if(_0x177172[_0xc487('0x12')]==='Task'){_0x2b2f03[_0xc487('0x13')]=moment[_0xc487('0x14')]();_0x2b2f03[_0xc487('0x15')]=![];_0x2b2f03[_0xc487('0x16')]=![];if(_0x5bf1b0[_0xc487('0x17')]===_0xc487('0x18')||_0x5bf1b0[_0xc487('0x17')]===_0xc487('0x19')){_0x2b2f03['WhoId']=_0x5bf1b0['id'];}else if(_0x5bf1b0[_0xc487('0x17')]===_0xc487('0x1a')){_0x2b2f03[_0xc487('0x1b')]=_0x5bf1b0['id'];}}else if(_0x177172[_0xc487('0x12')]==='Case'){if(_0x5bf1b0[_0xc487('0x17')]===_0xc487('0x18')){_0x2b2f03[_0xc487('0x1c')]=_0x5bf1b0['id'];}else if(_0x5bf1b0[_0xc487('0x17')]===_0xc487('0x1a')){_0x2b2f03[_0xc487('0x1d')]=_0x5bf1b0['id'];}else if(_0x5bf1b0[_0xc487('0x17')]===_0xc487('0x19')&&_0x177172[_0xc487('0x1e')]){_0x2b2f03[_0x177172[_0xc487('0x1e')]]=_0x5bf1b0['id'];}else{logger[_0xc487('0x1f')](_0xc487('0x20'));}}}return _0x24a20d['sobject'](_0x177172[_0xc487('0x12')])[_0xc487('0x21')](_0x2b2f03);}function getUser(_0x27e28d,_0x46fb03,_0x27dc53){if(!_[_0xc487('0x22')](_0x46fb03)&&intUtil['validateEmail'](_0x46fb03)){var _0x3c1c45={'Email':_0x46fb03};var _0x16f709={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x27dc53['sobject']('User')[_0xc487('0x23')](_0x3c1c45,_0x16f709)[_0xc487('0x24')]()[_0xc487('0x25')](function(_0xc6cc4a){if(_0xc6cc4a[_0xc487('0x26')]){var _0xa89391=_[_0xc487('0x23')](_0xc6cc4a,function(_0x2902a1){return _0x2902a1[_0xc487('0x27')]===_0x46fb03;});if(_0xa89391){logger['info']('Agent\x20%s\x20found.',_0x46fb03);return BPromise[_0xc487('0x28')]({'id':_0xa89391['Id'],'name':_0xa89391[_0xc487('0x29')]});}}else{logger['info'](_0xc487('0x2a'),_0x46fb03);return _0x27dc53['identity']()[_0xc487('0x25')](function(_0x52112b){return BPromise[_0xc487('0x28')]({'id':_0x52112b[_0xc487('0x2b')],'name':_0x52112b['display_name']});});}});}else{logger[_0xc487('0x1f')](_0xc487('0x2a'),_0x46fb03);return _0x27dc53[_0xc487('0x2c')]()[_0xc487('0x25')](function(_0x4c0808){return BPromise[_0xc487('0x28')]({'id':_0x4c0808['user_id'],'name':_0x4c0808['display_name']});});}}function getEndUser(_0x1e14d6,_0x4badaf,_0x11b06c,_0x18b9b4,_0x442273){var _0x395ee9={'$or':{'Phone':_0x18b9b4}};var _0xa3ac58={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc487('0x28')]()['then'](function(){logger[_0xc487('0x1f')](_0xc487('0x2d'),_0x18b9b4,_0x4badaf[_0xc487('0x2e')]);switch(_0x4badaf['moduleSearch']){case'contact_lead':var _0x242f3b=_[_0xc487('0x2f')](_0x395ee9);if(_0x4badaf[_0xc487('0x30')]){var _0x460977={};_0x460977[_0x4badaf[_0xc487('0x30')]]=_0x18b9b4;_[_0xc487('0x31')](_0x242f3b['$or'],_0x460977);}return _0x442273[_0xc487('0x32')](_0xc487('0x33'))[_0xc487('0x23')](_0x242f3b,_0xa3ac58)[_0xc487('0x24')]()['then'](function(_0x3ceeee){if(_0x3ceeee&&_0x3ceeee[_0xc487('0x26')]){return _0x3ceeee;}else{var _0x2e42b5=_[_0xc487('0x2f')](_0x395ee9);if(_0x4badaf[_0xc487('0x34')]){var _0x5cd9d6={};_0x5cd9d6[_0x4badaf[_0xc487('0x34')]]=_0x18b9b4;_[_0xc487('0x31')](_0x2e42b5[_0xc487('0x35')],_0x5cd9d6);}return _0x442273[_0xc487('0x32')](_0xc487('0x36'))[_0xc487('0x23')](_0x2e42b5,_0xa3ac58);}});case _0xc487('0x37'):var _0x49f2cf=_['cloneDeep'](_0x395ee9);if(_0x4badaf['additionalSearchAccount']){var _0x460977={};_0x460977[_0x4badaf['additionalSearchAccount']]=_0x18b9b4;_['merge'](_0x49f2cf[_0xc487('0x35')],_0x460977);}return _0x442273['sobject'](_0xc487('0x38'))[_0xc487('0x23')](_0x49f2cf,_0xa3ac58)[_0xc487('0x24')]()[_0xc487('0x25')](function(_0x5dd76b){if(_0x5dd76b&&_0x5dd76b['length']){return _0x5dd76b;}else{var _0xf7c507=_[_0xc487('0x2f')](_0x395ee9);if(_0x4badaf[_0xc487('0x30')]){var _0x3db101={};_0x3db101[_0x4badaf[_0xc487('0x30')]]=_0x18b9b4;_[_0xc487('0x31')](_0xf7c507[_0xc487('0x35')],_0x3db101);}return _0x442273[_0xc487('0x32')](_0xc487('0x33'))[_0xc487('0x23')](_0xf7c507,_0xa3ac58)[_0xc487('0x25')](function(_0x20d597){if(_0x20d597&&_0x20d597[_0xc487('0x26')]){return _0x20d597;}else{var _0x499dab=_['cloneDeep'](_0x395ee9);if(_0x4badaf[_0xc487('0x34')]){var _0x4b45c1={};_0x4b45c1[_0x4badaf[_0xc487('0x34')]]=_0x18b9b4;_[_0xc487('0x31')](_0x499dab['$or'],_0x4b45c1);}return _0x442273[_0xc487('0x32')](_0xc487('0x36'))[_0xc487('0x23')](_0x499dab,_0xa3ac58);}});}});case _0xc487('0x18'):var _0x242f3b=_[_0xc487('0x2f')](_0x395ee9);if(_0x4badaf[_0xc487('0x30')]){var _0x460977={};_0x460977[_0x4badaf[_0xc487('0x30')]]=_0x18b9b4;_['merge'](_0x242f3b[_0xc487('0x35')],_0x460977);}return _0x442273[_0xc487('0x32')]('Contact')['find'](_0x242f3b,_0xa3ac58)[_0xc487('0x24')]();case _0xc487('0x19'):var _0x59a02b=_[_0xc487('0x2f')](_0x395ee9);if(_0x4badaf[_0xc487('0x34')]){var _0x460977={};_0x460977[_0x4badaf[_0xc487('0x34')]]=_0x18b9b4;_[_0xc487('0x31')](_0x59a02b[_0xc487('0x35')],_0x460977);}return _0x442273[_0xc487('0x32')]('Lead')[_0xc487('0x23')](_0x59a02b,_0xa3ac58);case _0xc487('0x1a'):var _0x49f2cf=_['cloneDeep'](_0x395ee9);if(_0x4badaf[_0xc487('0x39')]){var _0x460977={};_0x460977[_0x4badaf[_0xc487('0x39')]]=_0x18b9b4;_[_0xc487('0x31')](_0x49f2cf['$or'],_0x460977);}return _0x442273[_0xc487('0x32')](_0xc487('0x38'))[_0xc487('0x23')](_0x49f2cf,_0xa3ac58);default:return null;}})[_0xc487('0x25')](function(_0x8103fe){if(_0x8103fe&&_0x8103fe[_0xc487('0x26')]){var _0x338005=_[_0xc487('0x3a')](_0x8103fe);if(_0x338005){return BPromise[_0xc487('0x28')]({'id':_0x338005['Id'],'name':_0x338005[_0xc487('0x29')],'phone':_0x338005[_0xc487('0x3b')],'endUserType':_0x338005[_0xc487('0x3c')][_0xc487('0x3d')][_0xc487('0x3e')]()});}}})[_0xc487('0x25')](function(_0x53db90){if(_0x53db90){logger[_0xc487('0x1f')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x53db90[_0xc487('0x17')],_0x18b9b4);return BPromise['resolve'](_0x53db90);}else{logger[_0xc487('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x18b9b4);var _0x4317e8={'Phone':_0x18b9b4};if(_0x4badaf[_0xc487('0x3f')]){if(_0x4badaf[_0xc487('0x3f')]==='contact'){logger[_0xc487('0x1f')](_0xc487('0x40'),_0x18b9b4,_0x4badaf[_0xc487('0x3f')]);_0x4317e8[_0xc487('0x41')]=_0x11b06c!==_0xc487('0x42')?_0x11b06c:util['format'](_0xc487('0x43'),_0x18b9b4);}else if(_0x4badaf['moduleCreate']==='lead'){logger[_0xc487('0x1f')](_0xc487('0x40'),_0x18b9b4,_0x4badaf[_0xc487('0x3f')]);_0x4317e8[_0xc487('0x41')]=_0x11b06c!==_0xc487('0x42')?_0x11b06c:util['format'](_0xc487('0x43'),_0x18b9b4);_0x4317e8[_0xc487('0x44')]='No\x20Company';}else if(_0x4badaf['moduleCreate']==='account'){logger[_0xc487('0x1f')](_0xc487('0x40'),_0x18b9b4,_0x4badaf[_0xc487('0x3f')]);_0x4317e8[_0xc487('0x29')]=_0x11b06c!==_0xc487('0x42')?_0x11b06c:util[_0xc487('0x45')](_0xc487('0x43'),_0x18b9b4);}else{return null;}}return _0x442273['sobject'](_[_0xc487('0x46')](_0x4badaf[_0xc487('0x3f')]))['create'](_0x4317e8)[_0xc487('0x25')](function(_0x28d593){return BPromise[_0xc487('0x28')]({'id':_0x28d593['id'],'endUserType':_0x4badaf['moduleCreate']});});}});}function getCustomFields(_0x2826d5,_0x3ca063){var _0x24a0e6={};if(_0x2826d5[_0xc487('0x26')]>0x0){_[_0xc487('0x47')](_0x2826d5,function(_0x503b52){if(_[_0xc487('0x48')](['string','picklist'],_0x503b52[_0xc487('0x3d')])&&_0x503b52['idField']){_0x24a0e6[_0x503b52[_0xc487('0x49')]]=_0x503b52[_0xc487('0x4a')]['toString']();}else if(_0x503b52[_0xc487('0x3d')]==='variable'&&_0x503b52[_0xc487('0x4b')]&&_0x503b52[_0xc487('0x49')]){_0x3ca063[_0x503b52[_0xc487('0x4b')]]&&(_0x24a0e6[_0x503b52[_0xc487('0x49')]]=_0x3ca063[_0x503b52[_0xc487('0x4b')]][_0xc487('0x4c')]());}else if(_0x503b52[_0xc487('0x3d')]===_0xc487('0x4d')&&_0x503b52[_0xc487('0x4e')]&&_0x503b52[_0xc487('0x4e')]['name']&&_0x503b52['idField']){_0x3ca063[_0x503b52[_0xc487('0x4e')][_0xc487('0x4f')][_0xc487('0x3e')]()]&&(_0x24a0e6[_0x503b52['idField']]=_0x3ca063[_0x503b52['Variable']['name'][_0xc487('0x3e')]()]['toString']());}});}return _0x24a0e6;}function getConnection(_0x11145a){var _0x36f752=_0x11145a[_0xc487('0x50')]['concat'](_0x11145a[_0xc487('0x51')]);var _0x5c28fd=new jsforce[(_0xc487('0x52'))]({'oauth2':{'loginUrl':_0x11145a[_0xc487('0x53')]||'https://login.salesforce.com','clientId':_0x11145a[_0xc487('0x54')],'clientSecret':_0x11145a[_0xc487('0x55')]}});return _0x5c28fd['login'](_0x11145a[_0xc487('0x56')],_0x36f752)[_0xc487('0x25')](function(){logger[_0xc487('0x1f')]('Connection\x20established.');return _0x5c28fd;});}exports[_0xc487('0x57')]=function(_0x51e9ad,_0x186787,_0x198a6d,_0x16e1a4,_0x2619a6,_0xa7e510){var _0x3f33fd,_0x13a309,_0x559b23,_0x6306c;_0xa7e510[_0xc487('0x58')]=intUtil[_0xc487('0x59')](_0xa7e510[_0xc487('0x58')]);_0xa7e510[_0xc487('0x53')]=intUtil[_0xc487('0x59')](_0xa7e510[_0xc487('0x53')]);if(_0x2619a6&&_0x2619a6[_0xc487('0x5a')]){logger['info']('[QUEUE]',_0xc487('0x5b'));_0x186787[_0xc487('0x5c')]=util['format'](_0xc487('0x5d'),_0xa7e510[_0xc487('0x58')],_0x186787[_0xc487('0x5e')],md5(_0x186787[_0xc487('0x5e')]));}else{_0x186787[_0xc487('0x5c')]='';}return getConnection(_0xa7e510)[_0xc487('0x25')](function(_0x5b450b){_0x6306c=_0x5b450b;return getUser(_0xa7e510,_0x16e1a4[_0xc487('0x5f')],_0x6306c);})['then'](function(_0xf43733){_0x3f33fd=_0xf43733;return getEndUser(_0xa7e510,_0x198a6d,_0x186787[_0xc487('0x60')],_0x186787[_0xc487('0x61')],_0x6306c);})[_0xc487('0x25')](function(_0xf3d1a5){_0x13a309=_0xf3d1a5;return getTicket(_0xa7e510,_0x3f33fd,_0x13a309,_0x198a6d,_0x186787,_0x198a6d['Fields'],_0x6306c,_0xc487('0x57'));})[_0xc487('0x25')](function(_0x5a2f5a){_0x559b23=_0x5a2f5a;logger[_0xc487('0x1f')](_0xc487('0x62'),_0x559b23['id']);logger['info'](_0xc487('0x63'),_0x559b23['id'],_0x16e1a4['name'],_0xa7e510[_0xc487('0x3d')]);switch(_0xa7e510[_0xc487('0x3d')]){case _0xc487('0x64'):emit(util[_0xc487('0x45')](_0xc487('0x65'),_0x16e1a4['name']),_0xc487('0x66'),{'recordId':_0x559b23['id']});break;case _0xc487('0x67'):emit(util[_0xc487('0x45')](_0xc487('0x65'),_0x16e1a4['name']),_0xc487('0x68'),{'uri':util[_0xc487('0x45')]('%s/%s/e',_0x6306c[_0xc487('0x69')],_0x559b23['id'])});break;default:logger[_0xc487('0x6a')](_0xc487('0x6b'));}})['catch'](function(_0x96713b){logger[_0xc487('0x6a')](_0xc487('0x6c'),_0x96713b);});};exports[_0xc487('0x6d')]=function(_0x422393,_0x1c5e39,_0x4bf194,_0x13fc89,_0x15f5aa,_0x9a1345,_0x546108){var _0x14f38b,_0x1ebc27,_0x338af8,_0x2b324a;_0x9a1345['serverUrl']=intUtil[_0xc487('0x59')](_0x9a1345['serverUrl']);_0x9a1345[_0xc487('0x53')]=intUtil['stripTrailingSlash'](_0x9a1345[_0xc487('0x53')]);if(_0x546108&&_0x546108['recordingFormat']&&_0x546108['recordingFormat']!==_0xc487('0x6e')){logger[_0xc487('0x1f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1c5e39['recordingURL']=util[_0xc487('0x45')](_0xc487('0x5d'),_0x9a1345[_0xc487('0x58')],_0x1c5e39[_0xc487('0x5e')],md5(_0x1c5e39[_0xc487('0x5e')]));}return getConnection(_0x9a1345)[_0xc487('0x25')](function(_0x288f6f){_0x2b324a=_0x288f6f;return getUser(_0x9a1345,_0x13fc89['email'],_0x2b324a);})['then'](function(_0x1697b){_0x14f38b=_0x1697b;return getEndUser(_0x9a1345,_0x4bf194,_0x1c5e39[_0xc487('0x6f')],_0x1c5e39[_0xc487('0x70')],_0x2b324a);})['then'](function(_0xa4d678){_0x1ebc27=_0xa4d678;return getTicket(_0x9a1345,_0x14f38b,_0x1ebc27,_0x4bf194,_0x1c5e39,_0x4bf194['Fields'],_0x2b324a,_0xc487('0x6d'));})[_0xc487('0x25')](function(_0x4bab87){_0x338af8=_0x4bab87;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x338af8['id']);logger[_0xc487('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x338af8['id'],_0x13fc89[_0xc487('0x4f')],_0x9a1345[_0xc487('0x3d')]);switch(_0x9a1345[_0xc487('0x3d')]){case'integrationTab':emit(util['format']('user:%s',_0x13fc89['name']),_0xc487('0x66'),{'recordId':_0x338af8['id']});break;case _0xc487('0x67'):emit(util[_0xc487('0x45')]('user:%s',_0x13fc89[_0xc487('0x4f')]),_0xc487('0x68'),{'uri':util[_0xc487('0x45')](_0xc487('0x71'),_0x2b324a[_0xc487('0x69')],_0x338af8['id'])});break;default:logger['error'](_0xc487('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xc487('0x73')](function(_0x4b943b){logger[_0xc487('0x6a')](_0xc487('0x72'),_0x4b943b);});};exports['unmanaged']=function(_0x5b9e61,_0x454259,_0x1614c7,_0xe64d94,_0x4ea688,_0x379815){var _0x5009cd,_0x33537f,_0x17bf1f,_0x7a7df4;_0x379815[_0xc487('0x58')]=intUtil[_0xc487('0x59')](_0x379815[_0xc487('0x58')]);_0x379815['remoteUri']=intUtil['stripTrailingSlash'](_0x379815[_0xc487('0x53')]);if(_0x4ea688&&_0x4ea688[_0xc487('0x5a')]){logger[_0xc487('0x1f')]('['+_0x454259[_0xc487('0x74')][_0xc487('0x75')]()+']',_0xc487('0x5b'));_0x454259[_0xc487('0x5c')]=util[_0xc487('0x45')](_0xc487('0x5d'),_0x379815[_0xc487('0x58')],_0x454259['uniqueid'],md5(_0x454259[_0xc487('0x5e')]));}else{_0x454259[_0xc487('0x5c')]='';}return getConnection(_0x379815)[_0xc487('0x25')](function(_0x2f0da9){_0x7a7df4=_0x2f0da9;if(!_[_0xc487('0x22')](_0xe64d94)){return getUser(_0x379815,_0xe64d94[_0xc487('0x4f')],_0x7a7df4);}else{return getUser(_0x379815,null,_0x7a7df4);}})[_0xc487('0x25')](function(_0x10606b){_0x5009cd=_0x10606b;return getEndUser(_0x379815,_0x1614c7,_0x454259[_0xc487('0x60')],_0x454259[_0xc487('0x61')],_0x7a7df4);})[_0xc487('0x25')](function(_0x56c25c){_0x33537f=_0x56c25c;return getTicket(_0x379815,_0x5009cd,_0x33537f,_0x1614c7,_0x454259,_0x1614c7[_0xc487('0x76')],_0x7a7df4);})['then'](function(_0x3d8fa8){_0x17bf1f=_0x3d8fa8;logger[_0xc487('0x1f')]('['+_0x454259[_0xc487('0x74')][_0xc487('0x75')]()+_0xc487('0x77'),_0x17bf1f['id']);logger['info']('['+_0x454259[_0xc487('0x74')]['toUpperCase']()+_0xc487('0x78'),_0x379815[_0xc487('0x3d')]);})[_0xc487('0x73')](function(_0x4f260c){logger[_0xc487('0x6a')]('['+_0x454259[_0xc487('0x74')]['toUpperCase']()+']',_0x4f260c);});}; \ No newline at end of file +var _0xc031=['leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','contact','first','Phone','attributes','type','toLowerCase','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','forEach','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','concat','securityToken','Connection','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','%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.','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','md5','util','ioredis','./util','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','getString','Descriptions','Task','utc','endUserType','lead','WhoId','WhatId','ticketType','Case','ContactId','account'];(function(_0x53fc27,_0x20780f){var _0x26de9f=function(_0x40e3a3){while(--_0x40e3a3){_0x53fc27['push'](_0x53fc27['shift']());}};_0x26de9f(++_0x20780f);}(_0xc031,0xe2));var _0x1c03=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0xc031[_0x262323];return _0xa963c3;};'use strict';var _=require(_0x1c03('0x0'));var rp=require('request-promise');var moment=require(_0x1c03('0x1'));var BPromise=require('bluebird');var md5=require(_0x1c03('0x2'));var jsforce=require('jsforce');var util=require(_0x1c03('0x3'));var Redis=require(_0x1c03('0x4'));var intUtil=require(_0x1c03('0x5'));var config=require(_0x1c03('0x6'));var logger=require('../../../../config/logger')(_0x1c03('0x7'));config[_0x1c03('0x8')]=_['defaults'](config[_0x1c03('0x8')],{'host':_0x1c03('0x9'),'port':0x18eb});var io=require(_0x1c03('0xa'))(new Redis(config[_0x1c03('0x8')]));function emit(_0x227e79,_0x2dfe34,_0xe73d17){io['to'](_0x227e79)[_0x1c03('0xb')](_0x2dfe34,_0xe73d17);}function getTicket(_0x37573d,_0x2c0f3d,_0x25e0c2,_0x2541a6,_0x308b5f,_0x88bde8,_0x501e5a,_0x41b135){var _0x44f5fd=Object['assign']({},{'OwnerId':_0x2c0f3d['id'],'Subject':intUtil['getString'](_0x2541a6['Subjects'],_0x308b5f,'\x20'),'Description':intUtil[_0x1c03('0xc')](_0x2541a6[_0x1c03('0xd')],_0x308b5f,'\x0a')},getCustomFields(_0x88bde8,_0x308b5f));if(_0x25e0c2){if(_0x2541a6['ticketType']===_0x1c03('0xe')){_0x44f5fd['ActivityDate']=moment[_0x1c03('0xf')]();_0x44f5fd['IsReminderSet']=![];_0x44f5fd['IsRecurrence']=![];if(_0x25e0c2[_0x1c03('0x10')]==='contact'||_0x25e0c2[_0x1c03('0x10')]===_0x1c03('0x11')){_0x44f5fd[_0x1c03('0x12')]=_0x25e0c2['id'];}else if(_0x25e0c2[_0x1c03('0x10')]==='account'){_0x44f5fd[_0x1c03('0x13')]=_0x25e0c2['id'];}}else if(_0x2541a6[_0x1c03('0x14')]===_0x1c03('0x15')){if(_0x25e0c2[_0x1c03('0x10')]==='contact'){_0x44f5fd[_0x1c03('0x16')]=_0x25e0c2['id'];}else if(_0x25e0c2[_0x1c03('0x10')]===_0x1c03('0x17')){_0x44f5fd['AccountId']=_0x25e0c2['id'];}else if(_0x25e0c2[_0x1c03('0x10')]===_0x1c03('0x11')&&_0x2541a6[_0x1c03('0x18')]){_0x44f5fd[_0x2541a6[_0x1c03('0x18')]]=_0x25e0c2['id'];}else{logger['info'](_0x1c03('0x19'));}}}return _0x501e5a[_0x1c03('0x1a')](_0x2541a6['ticketType'])[_0x1c03('0x1b')](_0x44f5fd);}function getUser(_0x436b1a,_0x5a8046,_0x1eb1e4){if(!_[_0x1c03('0x1c')](_0x5a8046)&&intUtil[_0x1c03('0x1d')](_0x5a8046)){var _0x197745={'Email':_0x5a8046};var _0x36bb3e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1eb1e4['sobject'](_0x1c03('0x1e'))[_0x1c03('0x1f')](_0x197745,_0x36bb3e)[_0x1c03('0x20')]()[_0x1c03('0x21')](function(_0x32942d){if(_0x32942d[_0x1c03('0x22')]){var _0x48aa3e=_[_0x1c03('0x1f')](_0x32942d,function(_0x543668){return _0x543668[_0x1c03('0x23')]===_0x5a8046;});if(_0x48aa3e){logger[_0x1c03('0x24')](_0x1c03('0x25'),_0x5a8046);return BPromise[_0x1c03('0x26')]({'id':_0x48aa3e['Id'],'name':_0x48aa3e[_0x1c03('0x27')]});}}else{logger[_0x1c03('0x24')](_0x1c03('0x28'),_0x5a8046);return _0x1eb1e4['identity']()[_0x1c03('0x21')](function(_0x536827){return BPromise['resolve']({'id':_0x536827[_0x1c03('0x29')],'name':_0x536827['display_name']});});}});}else{logger[_0x1c03('0x24')](_0x1c03('0x28'),_0x5a8046);return _0x1eb1e4[_0x1c03('0x2a')]()['then'](function(_0x27b779){return BPromise[_0x1c03('0x26')]({'id':_0x27b779[_0x1c03('0x29')],'name':_0x27b779[_0x1c03('0x2b')]});});}}function getEndUser(_0xe3e183,_0x32b94b,_0x27cf75,_0x59fae8,_0x49aed0){var _0x2c4cbe={'$or':{'Phone':_0x59fae8}};var _0x4b9774={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1c03('0x26')]()[_0x1c03('0x21')](function(){logger[_0x1c03('0x24')](_0x1c03('0x2c'),_0x59fae8,_0x32b94b['moduleSearch']);switch(_0x32b94b[_0x1c03('0x2d')]){case _0x1c03('0x2e'):var _0x5d2c78=_[_0x1c03('0x2f')](_0x2c4cbe);if(_0x32b94b['additionalSearchContact']){var _0x55ace8={};_0x55ace8[_0x32b94b[_0x1c03('0x30')]]=_0x59fae8;_[_0x1c03('0x31')](_0x5d2c78[_0x1c03('0x32')],_0x55ace8);}return _0x49aed0['sobject']('Contact')[_0x1c03('0x1f')](_0x5d2c78,_0x4b9774)[_0x1c03('0x20')]()[_0x1c03('0x21')](function(_0x1261bc){if(_0x1261bc&&_0x1261bc[_0x1c03('0x22')]){return _0x1261bc;}else{var _0x48e677=_[_0x1c03('0x2f')](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x33')]){var _0x11ed75={};_0x11ed75[_0x32b94b[_0x1c03('0x33')]]=_0x59fae8;_['merge'](_0x48e677[_0x1c03('0x32')],_0x11ed75);}return _0x49aed0[_0x1c03('0x1a')](_0x1c03('0x34'))[_0x1c03('0x1f')](_0x48e677,_0x4b9774);}});case _0x1c03('0x35'):var _0x4259e2=_['cloneDeep'](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x36')]){var _0x55ace8={};_0x55ace8[_0x32b94b['additionalSearchAccount']]=_0x59fae8;_['merge'](_0x4259e2[_0x1c03('0x32')],_0x55ace8);}return _0x49aed0[_0x1c03('0x1a')](_0x1c03('0x37'))[_0x1c03('0x1f')](_0x4259e2,_0x4b9774)['execute']()[_0x1c03('0x21')](function(_0x1beac2){if(_0x1beac2&&_0x1beac2[_0x1c03('0x22')]){return _0x1beac2;}else{var _0x18dcd0=_[_0x1c03('0x2f')](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x30')]){var _0x2f7669={};_0x2f7669[_0x32b94b[_0x1c03('0x30')]]=_0x59fae8;_['merge'](_0x18dcd0['$or'],_0x2f7669);}return _0x49aed0[_0x1c03('0x1a')](_0x1c03('0x38'))[_0x1c03('0x1f')](_0x18dcd0,_0x4b9774)['then'](function(_0x491113){if(_0x491113&&_0x491113[_0x1c03('0x22')]){return _0x491113;}else{var _0x2612e2=_[_0x1c03('0x2f')](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x33')]){var _0x29bd73={};_0x29bd73[_0x32b94b['additionalSearchLead']]=_0x59fae8;_['merge'](_0x2612e2['$or'],_0x29bd73);}return _0x49aed0[_0x1c03('0x1a')](_0x1c03('0x34'))['find'](_0x2612e2,_0x4b9774);}});}});case _0x1c03('0x39'):var _0x5d2c78=_[_0x1c03('0x2f')](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x30')]){var _0x55ace8={};_0x55ace8[_0x32b94b['additionalSearchContact']]=_0x59fae8;_[_0x1c03('0x31')](_0x5d2c78[_0x1c03('0x32')],_0x55ace8);}return _0x49aed0[_0x1c03('0x1a')]('Contact')[_0x1c03('0x1f')](_0x5d2c78,_0x4b9774)[_0x1c03('0x20')]();case'lead':var _0x3458e0=_['cloneDeep'](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x33')]){var _0x55ace8={};_0x55ace8[_0x32b94b[_0x1c03('0x33')]]=_0x59fae8;_[_0x1c03('0x31')](_0x3458e0[_0x1c03('0x32')],_0x55ace8);}return _0x49aed0['sobject'](_0x1c03('0x34'))['find'](_0x3458e0,_0x4b9774);case _0x1c03('0x17'):var _0x4259e2=_[_0x1c03('0x2f')](_0x2c4cbe);if(_0x32b94b[_0x1c03('0x36')]){var _0x55ace8={};_0x55ace8[_0x32b94b[_0x1c03('0x36')]]=_0x59fae8;_[_0x1c03('0x31')](_0x4259e2['$or'],_0x55ace8);}return _0x49aed0['sobject']('Account')[_0x1c03('0x1f')](_0x4259e2,_0x4b9774);default:return null;}})[_0x1c03('0x21')](function(_0xff6cb1){if(_0xff6cb1&&_0xff6cb1['length']){var _0x3edcd2=_[_0x1c03('0x3a')](_0xff6cb1);if(_0x3edcd2){return BPromise[_0x1c03('0x26')]({'id':_0x3edcd2['Id'],'name':_0x3edcd2[_0x1c03('0x27')],'phone':_0x3edcd2[_0x1c03('0x3b')],'endUserType':_0x3edcd2[_0x1c03('0x3c')][_0x1c03('0x3d')][_0x1c03('0x3e')]()});}}})[_0x1c03('0x21')](function(_0x226b01){if(_0x226b01){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x226b01[_0x1c03('0x10')],_0x59fae8);return BPromise[_0x1c03('0x26')](_0x226b01);}else{logger['info'](_0x1c03('0x3f'),_0x59fae8);var _0x1fb2ab={'Phone':_0x59fae8};if(_0x32b94b[_0x1c03('0x40')]){if(_0x32b94b['moduleCreate']===_0x1c03('0x39')){logger[_0x1c03('0x24')](_0x1c03('0x41'),_0x59fae8,_0x32b94b[_0x1c03('0x40')]);_0x1fb2ab[_0x1c03('0x42')]=_0x27cf75!==_0x1c03('0x43')?_0x27cf75:util[_0x1c03('0x44')](_0x1c03('0x45'),_0x59fae8);}else if(_0x32b94b[_0x1c03('0x40')]===_0x1c03('0x11')){logger[_0x1c03('0x24')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x59fae8,_0x32b94b[_0x1c03('0x40')]);_0x1fb2ab[_0x1c03('0x42')]=_0x27cf75!==_0x1c03('0x43')?_0x27cf75:util[_0x1c03('0x44')]('Caller\x20-\x20%s',_0x59fae8);_0x1fb2ab[_0x1c03('0x46')]='No\x20Company';}else if(_0x32b94b['moduleCreate']===_0x1c03('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x59fae8,_0x32b94b[_0x1c03('0x40')]);_0x1fb2ab['Name']=_0x27cf75!==_0x1c03('0x43')?_0x27cf75:util[_0x1c03('0x44')](_0x1c03('0x45'),_0x59fae8);}else{return null;}}return _0x49aed0[_0x1c03('0x1a')](_['upperFirst'](_0x32b94b[_0x1c03('0x40')]))['create'](_0x1fb2ab)[_0x1c03('0x21')](function(_0x36618b){return BPromise[_0x1c03('0x26')]({'id':_0x36618b['id'],'endUserType':_0x32b94b[_0x1c03('0x40')]});});}});}function getCustomFields(_0x5bb770,_0x38ecfb){var _0x1b0594={};if(_0x5bb770['length']>0x0){_[_0x1c03('0x47')](_0x5bb770,function(_0x13c922){if(_[_0x1c03('0x48')]([_0x1c03('0x49'),_0x1c03('0x4a')],_0x13c922[_0x1c03('0x3d')])&&_0x13c922['idField']){_0x1b0594[_0x13c922[_0x1c03('0x4b')]]=_0x13c922[_0x1c03('0x4c')][_0x1c03('0x4d')]();}else if(_0x13c922['type']===_0x1c03('0x4e')&&_0x13c922['variableName']&&_0x13c922[_0x1c03('0x4b')]){_0x38ecfb[_0x13c922[_0x1c03('0x4f')]]&&(_0x1b0594[_0x13c922[_0x1c03('0x4b')]]=_0x38ecfb[_0x13c922['variableName']][_0x1c03('0x4d')]());}else if(_0x13c922[_0x1c03('0x3d')]==='customVariable'&&_0x13c922[_0x1c03('0x50')]&&_0x13c922['Variable']['name']&&_0x13c922[_0x1c03('0x4b')]){_0x38ecfb[_0x13c922['Variable'][_0x1c03('0x51')]['toLowerCase']()]&&(_0x1b0594[_0x13c922['idField']]=_0x38ecfb[_0x13c922['Variable']['name'][_0x1c03('0x3e')]()][_0x1c03('0x4d')]());}});}return _0x1b0594;}function getConnection(_0x198de3){var _0x438d85=_0x198de3['password'][_0x1c03('0x52')](_0x198de3[_0x1c03('0x53')]);var _0x10294e=new jsforce[(_0x1c03('0x54'))]({'oauth2':{'loginUrl':_0x198de3['remoteUri']||'https://login.salesforce.com','clientId':_0x198de3[_0x1c03('0x55')],'clientSecret':_0x198de3['clientSecret']}});return _0x10294e[_0x1c03('0x56')](_0x198de3[_0x1c03('0x57')],_0x438d85)[_0x1c03('0x21')](function(){logger[_0x1c03('0x24')](_0x1c03('0x58'));return _0x10294e;});}exports[_0x1c03('0x59')]=function(_0x375249,_0x5280b9,_0xb5148,_0xff1c01,_0x8bfd6b,_0x5a4e39){var _0x1a86d6,_0xf94e94,_0x31d88d,_0x47af6a;_0x5a4e39[_0x1c03('0x5a')]=intUtil[_0x1c03('0x5b')](_0x5a4e39[_0x1c03('0x5a')]);_0x5a4e39[_0x1c03('0x5c')]=intUtil[_0x1c03('0x5b')](_0x5a4e39[_0x1c03('0x5c')]);if(_0x8bfd6b&&_0x8bfd6b[_0x1c03('0x5d')]){logger[_0x1c03('0x24')](_0x1c03('0x5e'),'Recording\x20is\x20enabled!');_0x5280b9[_0x1c03('0x5f')]=util[_0x1c03('0x44')](_0x1c03('0x60'),_0x5a4e39[_0x1c03('0x5a')],_0x5280b9[_0x1c03('0x61')],md5(_0x5280b9['uniqueid']));}else{_0x5280b9['recordingURL']='';}return getConnection(_0x5a4e39)[_0x1c03('0x21')](function(_0x40f7f6){_0x47af6a=_0x40f7f6;return getUser(_0x5a4e39,_0xff1c01[_0x1c03('0x62')],_0x47af6a);})[_0x1c03('0x21')](function(_0x104b02){_0x1a86d6=_0x104b02;return getEndUser(_0x5a4e39,_0xb5148,_0x5280b9[_0x1c03('0x63')],_0x5280b9[_0x1c03('0x64')],_0x47af6a);})[_0x1c03('0x21')](function(_0x996d07){_0xf94e94=_0x996d07;return getTicket(_0x5a4e39,_0x1a86d6,_0xf94e94,_0xb5148,_0x5280b9,_0xb5148[_0x1c03('0x65')],_0x47af6a,_0x1c03('0x59'));})[_0x1c03('0x21')](function(_0x5ab655){_0x31d88d=_0x5ab655;logger[_0x1c03('0x24')](_0x1c03('0x66'),_0x31d88d['id']);logger[_0x1c03('0x24')](_0x1c03('0x67'),_0x31d88d['id'],_0xff1c01['name'],_0x5a4e39['type']);switch(_0x5a4e39[_0x1c03('0x3d')]){case'integrationTab':emit(util[_0x1c03('0x44')](_0x1c03('0x68'),_0xff1c01[_0x1c03('0x51')]),_0x1c03('0x69'),{'recordId':_0x31d88d['id']});break;case'newTab':emit(util[_0x1c03('0x44')](_0x1c03('0x68'),_0xff1c01['name']),_0x1c03('0x6a'),{'uri':util[_0x1c03('0x44')](_0x1c03('0x6b'),_0x47af6a[_0x1c03('0x6c')],_0x31d88d['id'])});break;default:logger[_0x1c03('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x1c03('0x6e')](function(_0x4710e){logger['error'](_0x1c03('0x5e'),_0x4710e);});};exports[_0x1c03('0x6f')]=function(_0x3ad40d,_0x508d0b,_0x51a38c,_0x3a25c3,_0x4690dc,_0x31948a,_0x4de202){var _0x582249,_0x25a8fe,_0x4ff9a9,_0x311c32;_0x31948a[_0x1c03('0x5a')]=intUtil[_0x1c03('0x5b')](_0x31948a[_0x1c03('0x5a')]);_0x31948a[_0x1c03('0x5c')]=intUtil['stripTrailingSlash'](_0x31948a[_0x1c03('0x5c')]);if(_0x4de202&&_0x4de202[_0x1c03('0x70')]&&_0x4de202[_0x1c03('0x70')]!==_0x1c03('0x71')){logger[_0x1c03('0x24')](_0x1c03('0x72'),'Recording\x20is\x20enabled!');_0x508d0b['recordingURL']=util['format'](_0x1c03('0x60'),_0x31948a['serverUrl'],_0x508d0b['uniqueid'],md5(_0x508d0b[_0x1c03('0x61')]));}return getConnection(_0x31948a)['then'](function(_0x5a20fa){_0x311c32=_0x5a20fa;return getUser(_0x31948a,_0x3a25c3[_0x1c03('0x62')],_0x311c32);})[_0x1c03('0x21')](function(_0x264b3a){_0x582249=_0x264b3a;return getEndUser(_0x31948a,_0x51a38c,_0x508d0b[_0x1c03('0x73')],_0x508d0b['destcalleridnum'],_0x311c32);})['then'](function(_0x58252c){_0x25a8fe=_0x58252c;return getTicket(_0x31948a,_0x582249,_0x25a8fe,_0x51a38c,_0x508d0b,_0x51a38c[_0x1c03('0x65')],_0x311c32,_0x1c03('0x6f'));})['then'](function(_0x4addb0){_0x4ff9a9=_0x4addb0;logger[_0x1c03('0x24')](_0x1c03('0x74'),_0x4ff9a9['id']);logger[_0x1c03('0x24')](_0x1c03('0x75'),_0x4ff9a9['id'],_0x3a25c3[_0x1c03('0x51')],_0x31948a[_0x1c03('0x3d')]);switch(_0x31948a[_0x1c03('0x3d')]){case _0x1c03('0x76'):emit(util['format'](_0x1c03('0x68'),_0x3a25c3[_0x1c03('0x51')]),_0x1c03('0x69'),{'recordId':_0x4ff9a9['id']});break;case _0x1c03('0x77'):emit(util[_0x1c03('0x44')](_0x1c03('0x68'),_0x3a25c3['name']),'trigger:browser:url',{'uri':util[_0x1c03('0x44')](_0x1c03('0x6b'),_0x311c32[_0x1c03('0x6c')],_0x4ff9a9['id'])});break;default:logger['error'](_0x1c03('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x1c03('0x6e')](function(_0x28df55){logger[_0x1c03('0x6d')]('[OUTBOUND]',_0x28df55);});};exports[_0x1c03('0x78')]=function(_0x56e772,_0x1f76be,_0x3b7c47,_0x2492c6,_0x3aa9ab,_0x394225){var _0x23425d,_0x24f3b2,_0x2ba340,_0x27680a;_0x394225[_0x1c03('0x5a')]=intUtil[_0x1c03('0x5b')](_0x394225[_0x1c03('0x5a')]);_0x394225[_0x1c03('0x5c')]=intUtil['stripTrailingSlash'](_0x394225[_0x1c03('0x5c')]);if(_0x3aa9ab&&_0x3aa9ab[_0x1c03('0x5d')]){logger[_0x1c03('0x24')]('['+_0x1f76be[_0x1c03('0x79')][_0x1c03('0x7a')]()+']',_0x1c03('0x7b'));_0x1f76be[_0x1c03('0x5f')]=util[_0x1c03('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x394225[_0x1c03('0x5a')],_0x1f76be['uniqueid'],md5(_0x1f76be[_0x1c03('0x61')]));}else{_0x1f76be['recordingURL']='';}return getConnection(_0x394225)['then'](function(_0xb22c23){_0x27680a=_0xb22c23;if(!_[_0x1c03('0x1c')](_0x2492c6)){return getUser(_0x394225,_0x2492c6[_0x1c03('0x51')],_0x27680a);}else{return getUser(_0x394225,null,_0x27680a);}})[_0x1c03('0x21')](function(_0x244a89){_0x23425d=_0x244a89;return getEndUser(_0x394225,_0x3b7c47,_0x1f76be[_0x1c03('0x63')],_0x1f76be[_0x1c03('0x64')],_0x27680a);})['then'](function(_0x4331ba){_0x24f3b2=_0x4331ba;return getTicket(_0x394225,_0x23425d,_0x24f3b2,_0x3b7c47,_0x1f76be,_0x3b7c47[_0x1c03('0x65')],_0x27680a);})[_0x1c03('0x21')](function(_0x59d2c3){_0x2ba340=_0x59d2c3;logger[_0x1c03('0x24')]('['+_0x1f76be[_0x1c03('0x79')][_0x1c03('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x2ba340['id']);logger[_0x1c03('0x24')]('['+_0x1f76be[_0x1c03('0x79')][_0x1c03('0x7a')]()+_0x1c03('0x7c'),_0x394225[_0x1c03('0x3d')]);})['catch'](function(_0xd3c113){logger[_0x1c03('0x6d')]('['+_0x1f76be[_0x1c03('0x79')][_0x1c03('0x7a')]()+']',_0xd3c113);});}; \ 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 49a2477..eb0be1d 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 _0xb38f=['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','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','request-promise','util','ioredis','../../../../config/environment','redis','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','info','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','GET','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','active','userId','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','toString','picklist','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident\x20-\x20','ticketNumber','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/'];(function(_0x510b99,_0x201464){var _0x48feae=function(_0x42f51f){while(--_0x42f51f){_0x510b99['push'](_0x510b99['shift']());}};_0x48feae(++_0x201464);}(_0xb38f,0x15b));var _0xfb38=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0xb38f[_0x214a25];return _0x405988;};'use strict';var _=require('lodash');var Promise=require(_0xfb38('0x0'));var rp=require(_0xfb38('0x1'));var util=require(_0xfb38('0x2'));var md5=require('md5');var Redis=require(_0xfb38('0x3'));var intUtil=require('./util');var config=require(_0xfb38('0x4'));var logger=require('../../../../config/logger')('servicenow');config[_0xfb38('0x5')]=_['defaults'](config[_0xfb38('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xfb38('0x6'))(new Redis(config[_0xfb38('0x5')]));function getAdminUser(_0x223e75,_0x1d1b8f,_0x29f16c,_0x5cdad2,_0x11634f,_0x412a68){return new Promise(function(_0x4537e6,_0x27ede7){var _0x13399c={'method':'GET','uri':_0x5cdad2+_0xfb38('0x7')+'&'+_0x11634f+'&'+_0x412a68,'auth':_0x1d1b8f,'json':!![]};return rp(_0x13399c)[_0xfb38('0x8')](function(_0x2490f8){if(_0x2490f8['result'][_0xfb38('0x9')]>0x0){_0x29f16c[_0xfb38('0xa')]=_0x2490f8['result'][0x0][_0xfb38('0xb')];}logger[_0xfb38('0xc')]('['+[_0x223e75[_0xfb38('0xd')]()]+'],\x20getAdminUser\x20crm',_0x29f16c);_0x4537e6(_0x29f16c);})['catch'](function(_0x40e9c6){logger['error']('['+[_0x223e75[_0xfb38('0xd')]()]+']',_0x40e9c6[_0xfb38('0xe')]);_0x27ede7(_0x40e9c6[_0xfb38('0xe')]);});});}function getUser(_0x435da7,_0x495f0c,_0x13436b,_0x2a8f32,_0x287929){return function(_0x2f53b1){logger[_0xfb38('0xc')]('['+[_0x435da7[_0xfb38('0xd')]()]+_0xfb38('0xf'),_0x2f53b1);return new Promise(function(_0xb4c3a9,_0x47d9c8){if(intUtil[_0xfb38('0x10')](_0x2f53b1['userEmail'])){var _0x2f13bc={'method':_0xfb38('0x11'),'uri':_0x13436b+_0xfb38('0x12')+_0x2f53b1[_0xfb38('0x13')]+'&'+_0x2a8f32+'&'+_0x287929,'auth':_0x495f0c,'json':!![]};logger[_0xfb38('0xc')]('['+[_0x435da7[_0xfb38('0xd')]()]+_0xfb38('0x14'),_0x2f13bc);return rp(_0x2f13bc)[_0xfb38('0x8')](function(_0x5de495){logger[_0xfb38('0xc')]('['+[_0x435da7[_0xfb38('0xd')]()]+_0xfb38('0x15'),_0x5de495);if(_0x5de495['result'][_0xfb38('0x9')]>0x0&&String(_0x5de495[_0xfb38('0x16')][0x0][_0xfb38('0x17')])==='true'){_0x2f53b1[_0xfb38('0x18')]=_0x5de495[_0xfb38('0x16')][0x0][_0xfb38('0xb')];}else{_0x2f53b1[_0xfb38('0x18')]=_0x2f53b1['adminId'];_0x2f53b1[_0xfb38('0x13')]=_0x2f53b1['adminEmail'];}logger[_0xfb38('0xc')]('['+[_0x435da7[_0xfb38('0xd')]()]+_0xfb38('0x19'),_0x2f53b1);_0xb4c3a9(_0x2f53b1);})[_0xfb38('0x1a')](function(_0x38ba0b){logger[_0xfb38('0x1b')]('['+[_0x435da7[_0xfb38('0xd')]()]+']',_0x38ba0b[_0xfb38('0xe')]);_0x47d9c8(_0x38ba0b[_0xfb38('0xe')]);});}else{logger['info']('['+[_0x435da7[_0xfb38('0xd')]()]+_0xfb38('0x1c'));_0x2f53b1[_0xfb38('0x18')]=_0x2f53b1['adminId'];_0x2f53b1[_0xfb38('0x13')]=_0x2f53b1[_0xfb38('0x1d')];_0xb4c3a9(_0x2f53b1);}});};}function createEndUser(_0x1613ba,_0x37a8ab,_0x5234f5,_0x54e375,_0x760173){logger[_0xfb38('0xc')]('['+[_0x1613ba[_0xfb38('0xd')]()]+_0xfb38('0x1e'),_0x5234f5);return new Promise(function(_0x2c24c0,_0xba8282){var _0x429a22={'method':_0xfb38('0x1f'),'uri':_0x54e375+_0xfb38('0x20')+_0x760173,'body':{'user_name':_0x5234f5['endUserNumber'],'roles':_0xfb38('0x21'),'first_name':_0x5234f5[_0xfb38('0x22')],'active':'true','date_format':_0xfb38('0x23'),'phone':_0x5234f5[_0xfb38('0x22')]},'auth':_0x37a8ab,'json':!![]};return rp(_0x429a22)['then'](function(_0x4be79c){logger[_0xfb38('0xc')]('['+[_0x1613ba[_0xfb38('0xd')]()]+_0xfb38('0x24'),_0x4be79c[_0xfb38('0x16')]);_0x5234f5[_0xfb38('0x25')]=_0x4be79c[_0xfb38('0x16')][_0xfb38('0xb')];_0x2c24c0(_0x5234f5);})[_0xfb38('0x1a')](function(_0x375832){logger[_0xfb38('0x1b')]('['+[_0x1613ba['toUpperCase']()]+']',_0x375832[_0xfb38('0xe')]);_0xba8282(_0x375832[_0xfb38('0xe')]);});});}function getEndUser(_0x4e32b4,_0x48c947,_0x17817c,_0xb8599d,_0x6f84be){return function(_0x23dff6){logger[_0xfb38('0xc')]('['+[_0x4e32b4[_0xfb38('0xd')]()]+_0xfb38('0x26'),_0x23dff6);return new Promise(function(_0x34fdaf,_0x3c51b0){var _0x318da3={'method':_0xfb38('0x11'),'uri':_0x17817c+_0xfb38('0x27')+_0x23dff6['endUserNumber']+'&'+_0xb8599d+'&'+_0x6f84be,'auth':_0x48c947,'json':!![]};return rp(_0x318da3)[_0xfb38('0x8')](function(_0x251e6a){if(_0x251e6a[_0xfb38('0x16')][_0xfb38('0x9')]>0x0){_0x23dff6[_0xfb38('0x25')]=_0x251e6a['result'][0x0][_0xfb38('0xb')];logger[_0xfb38('0xc')]('['+[_0x4e32b4[_0xfb38('0xd')]()]+'],\x20getEndUser\x20crm',_0x23dff6);_0x34fdaf(_0x23dff6);}else{return createEndUser(_0x4e32b4,_0x48c947,_0x23dff6,_0x17817c,_0xb8599d)[_0xfb38('0x8')](function(_0x4d631f){logger[_0xfb38('0xc')]('['+[_0x4e32b4[_0xfb38('0xd')]()]+_0xfb38('0x28'),_0x4d631f);_0x34fdaf(_0x4d631f);});}})[_0xfb38('0x1a')](function(_0x44a636){logger[_0xfb38('0x1b')]('['+[_0x4e32b4[_0xfb38('0xd')]()]+']',_0x44a636['message']);_0x3c51b0(_0x44a636['message']);});});};}function getCustomFields(_0x3a78e2,_0x3fc7ce){var _0x47faf9={};if(_0x3a78e2['length']>0x0){_[_0xfb38('0x29')](_0x3a78e2,function(_0x52bbac){if(_[_0xfb38('0x2a')]([_0xfb38('0x2b'),'picklist'],_0x52bbac[_0xfb38('0x2c')])&&_0x52bbac[_0xfb38('0x2d')]&&!_0x52bbac[_0xfb38('0x2e')]){_0x47faf9[_0x52bbac['nameField'][_0xfb38('0x2f')]()]=_0x52bbac['content'][_0xfb38('0x30')]();}else if(_[_0xfb38('0x2a')](['string',_0xfb38('0x31')],_0x52bbac[_0xfb38('0x2c')])&&_0x52bbac['idField']&&_0x52bbac[_0xfb38('0x2e')]){_0x47faf9[_0x52bbac[_0xfb38('0x32')][_0xfb38('0x2f')]()]=_0x52bbac[_0xfb38('0x33')][_0xfb38('0x30')]();}else if(_0x52bbac[_0xfb38('0x2c')]===_0xfb38('0x34')&&_0x52bbac[_0xfb38('0x35')]&&_0x52bbac[_0xfb38('0x32')]&&_0x52bbac[_0xfb38('0x2e')]){_0x47faf9[_0x52bbac[_0xfb38('0x32')]['toLowerCase']()]=_0x3fc7ce[_0x52bbac[_0xfb38('0x35')]]['toString']();}else if(_0x52bbac[_0xfb38('0x2c')]===_0xfb38('0x36')&&_0x52bbac[_0xfb38('0x37')]&&_0x52bbac[_0xfb38('0x37')][_0xfb38('0x38')]&&_0x52bbac[_0xfb38('0x32')]&&_0x52bbac[_0xfb38('0x2e')]){_0x47faf9[_0x52bbac[_0xfb38('0x32')][_0xfb38('0x2f')]()]=_0x3fc7ce[_0x52bbac[_0xfb38('0x37')][_0xfb38('0x38')]['toLowerCase']()]['toString']();}});}return _0x47faf9;}function getTicket(_0x586e8f,_0x476193,_0x1977e2,_0xca4492,_0x413d00,_0x4f121b){return function(_0x4a75af){logger['info']('['+[_0x586e8f[_0xfb38('0xd')]()]+_0xfb38('0x39'),_0x4a75af);return new Promise(function(_0x103e77,_0x30533f){var _0x8d455=_0x586e8f['toLowerCase']()===_0xfb38('0x3a')?_0x4a75af[_0xfb38('0x18')]:_0x4a75af[_0xfb38('0x25')];var _0x285be2={'method':_0xfb38('0x1f'),'uri':_0x1977e2+'incident'+'?'+_0x4f121b,'body':Object['assign']({},{'active':'true','caller_id':_0x8d455,'assigned_to':_0x4a75af[_0xfb38('0x18')],'short_description':intUtil['getString'](_0xca4492['Subjects'],_0x413d00,'\x20'),'description':intUtil[_0xfb38('0x3b')](_0xca4492[_0xfb38('0x3c')],_0x413d00,'\x0a')},getCustomFields(_0xca4492['Fields'],_0x413d00)),'auth':_0x476193,'json':!![]};return rp(_0x285be2)[_0xfb38('0x8')](function(_0x370bcb){logger[_0xfb38('0xc')]('['+[_0x586e8f[_0xfb38('0xd')]()]+_0xfb38('0x3d'),_0x370bcb[_0xfb38('0x16')]);_0x4a75af[_0xfb38('0x3e')]=_0x370bcb[_0xfb38('0x16')][_0xfb38('0xb')];_0x4a75af['ticketNumber']=_0x370bcb[_0xfb38('0x16')][_0xfb38('0x3f')];logger[_0xfb38('0xc')]('['+[_0x586e8f[_0xfb38('0xd')]()]+_0xfb38('0x40'),_0x4a75af);_0x103e77(_0x4a75af);})[_0xfb38('0x1a')](function(_0x1be0a8){logger[_0xfb38('0x1b')]('['+[_0x586e8f[_0xfb38('0xd')]()]+']',_0x1be0a8[_0xfb38('0xe')]);_0x30533f(_0x1be0a8[_0xfb38('0xe')]);});});};}function createRemoteTag(_0x10a102,_0x5cb29b,_0x93f00e,_0x13f288){return new Promise(function(_0x20a5ad,_0x3a3826){var _0x3ad6bb={'method':'POST','uri':_0x93f00e+_0xfb38('0x41')+'?'+_0x13f288,'body':{'short_description':_0x10a102,'global':!![],'active':!![],'name':_0x10a102},'auth':_0x5cb29b,'json':!![]};return rp(_0x3ad6bb)['then'](function(_0x551231){var _0x41b0b6=_0x551231[_0xfb38('0x16')][_0xfb38('0xb')];_0x20a5ad(_0x41b0b6);});});}function getRemoteTag(_0x788c40,_0x405b63,_0x10988b,_0x1a6418,_0x2f4ef8){return new Promise(function(_0x4d6140,_0x3c45d2){var _0x497a28={'method':'GET','uri':_0x10988b+_0xfb38('0x41')+_0xfb38('0x42')+_0x788c40+'&'+_0x1a6418,'auth':_0x405b63,'json':!![]};return rp(_0x497a28)[_0xfb38('0x8')](function(_0x7614dc){if(_0x7614dc[_0xfb38('0x16')][_0xfb38('0x9')]>0x0){var _0x13171c=_0x7614dc[_0xfb38('0x16')][0x0][_0xfb38('0xb')];_0x4d6140(_0x13171c);}else{return createRemoteTag(_0x788c40,_0x405b63,_0x10988b,_0x1a6418)[_0xfb38('0x8')](function(_0x4d8f84){_0x4d6140(_0x4d8f84);});}});});}function assignTagToIncident(_0x3d8a40,_0x1e4238,_0x7f0a9f,_0x385e60,_0x2eb580){return new Promise(function(_0x5ceb62,_0xfc2ac5){var _0x2c83b9={'method':_0xfb38('0x1f'),'uri':_0x7f0a9f+'label_entry'+'?'+_0x2eb580,'body':{'label':_0x3d8a40,'table':_0xfb38('0x43'),'id_type':'Incident','table_key':_0x385e60[_0xfb38('0x3e')],'title':_0xfb38('0x44')+_0x385e60[_0xfb38('0x45')],'id_display':_0x385e60[_0xfb38('0x45')]},'auth':_0x1e4238,'json':!![]};return rp(_0x2c83b9)[_0xfb38('0x8')](function(_0x4a7c9d){_0x5ceb62();})['catch'](function(){_0x5ceb62();});});}function manageTags(_0x45a0fc,_0x118f90,_0x1861be,_0x5085d0,_0x42f147,_0x543c3f,_0x2df9ca){return new Promise(function(_0x408f38,_0x326538){var _0x3f2f28=[];_0x118f90['forEach'](function(_0x59a18f){_0x3f2f28[_0xfb38('0x46')](getRemoteTag(_0x59a18f,_0x1861be,_0x5085d0,_0x543c3f,_0x2df9ca));});return Promise[_0xfb38('0x47')](_0x3f2f28)[_0xfb38('0x8')](function(_0x5a11ab){if(_0x5a11ab[_0xfb38('0x9')]){logger[_0xfb38('0xc')]('['+[_0x45a0fc[_0xfb38('0xd')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5a11ab);var _0x2121e5=[];_0x5a11ab[_0xfb38('0x29')](function(_0x452e78){_0x2121e5['push'](assignTagToIncident(_0x452e78,_0x1861be,_0x5085d0,_0x42f147,_0x543c3f));});return Promise[_0xfb38('0x47')](_0x2121e5)[_0xfb38('0x8')](function(){_0x408f38();})['catch'](function(){_0x408f38();});}else{_0x408f38();}});});}function getTags(_0x39e8bb,_0x22e61b,_0x91529b,_0x5b9004,_0x5762c2,_0x54151c){return function(_0xdf6ae8){return new Promise(function(_0x1e04ac,_0x460ded){var _0x1b23dd=[];var _0x27fb3d=_0x5b9004[_0xfb38('0x48')];if(_0x27fb3d&&_0x27fb3d[_0xfb38('0x9')]>0x0){_0x1b23dd=_[_0xfb38('0x49')](_0x27fb3d,'name');}if(_0x1b23dd['length']>0x0){return manageTags(_0x39e8bb,_0x1b23dd,_0x22e61b,_0x91529b,_0xdf6ae8,_0x5762c2,_0x54151c)[_0xfb38('0x8')](function(){_0x1e04ac(_0xdf6ae8);});}else{_0x1e04ac(_0xdf6ae8);}});};}function emit(_0x40be2d,_0x300351,_0x35403e){var _0x10398c=_0xfb38('0x4a')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xfb38('0x4b')+_0xfb38('0x4c');var _0x398001={'uri':_0x40be2d+_0xfb38('0x4d')+_0x35403e+_0x10398c};io['to'](util[_0xfb38('0x4e')]('user:%s',_0x300351))[_0xfb38('0x4f')](_0xfb38('0x50'),_0x398001);}exports['cs']=function(_0x283c81,_0x2194bc,_0x1e0169,_0x3f13de,_0x318021,_0x43e662,_0x6cd14b,_0xb0cdd6){var _0x28fe56={};var _0x523eff={'user':_0x43e662[_0xfb38('0x51')],'pass':_0x43e662[_0xfb38('0x52')]};var _0x5d4f6b=_0xfb38('0x53');var _0x22b204=_0xfb38('0x54');_0x43e662['remoteUri']=intUtil[_0xfb38('0x55')](_0x43e662[_0xfb38('0x56')]);_0x43e662['serverUrl']=intUtil[_0xfb38('0x55')](_0x43e662[_0xfb38('0x57')]);var _0x598ed3=util[_0xfb38('0x4e')](_0xfb38('0x58'),_0x43e662[_0xfb38('0x56')]);_0x28fe56[_0xfb38('0x13')]=!_[_0xfb38('0x59')](_0x3f13de)?_0x3f13de[_0xfb38('0x5a')]:null;_0x28fe56[_0xfb38('0x1d')]=_0x43e662['email'];_0x28fe56[_0xfb38('0x22')]=_0xb0cdd6[_0xfb38('0x2f')]()===_0xfb38('0x3a')?_0x2194bc[_0xfb38('0x5b')]:_0x2194bc[_0xfb38('0x5c')];_0x28fe56[_0xfb38('0x5d')]=_0xb0cdd6===_0xfb38('0x5e')||_0xb0cdd6===_0xfb38('0x5f')?_0xfb38('0x5e'):'outbound';var _0x810ec7=util[_0xfb38('0x4e')](_0xfb38('0x60'),_0x43e662[_0xfb38('0x57')],_0x2194bc['uniqueid'],md5(_0x2194bc[_0xfb38('0x61')]));if(_0x318021&&_0x318021[_0xfb38('0x62')]){logger[_0xfb38('0xc')](_0xfb38('0x63'),_0xfb38('0x64'));_0x2194bc[_0xfb38('0x65')]=_0x810ec7;}else if(_0x6cd14b&&_0x6cd14b[_0xfb38('0x66')]&&_0x6cd14b[_0xfb38('0x66')]!==_0xfb38('0x67')){logger['info'](_0xfb38('0x68'),_0xfb38('0x64'));_0x2194bc['recordingURL']=_0x810ec7;}else{_0x2194bc[_0xfb38('0x65')]='';}return getAdminUser(_0xb0cdd6,_0x523eff,_0x28fe56,_0x598ed3,_0x22b204,_0x5d4f6b)[_0xfb38('0x8')](getUser(_0xb0cdd6,_0x523eff,_0x598ed3,_0x22b204,_0x5d4f6b))[_0xfb38('0x8')](getEndUser(_0xb0cdd6,_0x523eff,_0x598ed3,_0x22b204,_0x5d4f6b))[_0xfb38('0x8')](getTicket(_0xb0cdd6,_0x523eff,_0x598ed3,_0x1e0169,_0x2194bc,_0x22b204))[_0xfb38('0x8')](function(_0x31f628){logger[_0xfb38('0xc')](util['format'](_0xfb38('0x69'),_0x31f628['ticketId']));logger['info'](util[_0xfb38('0x4e')](_0xfb38('0x6a'),_0xb0cdd6));if(_0xb0cdd6!==_0xfb38('0x5f')){logger[_0xfb38('0xc')]('['+[_0xb0cdd6[_0xfb38('0xd')]()]+']',_0xfb38('0x6b'));emit(_0x43e662['remoteUri'],_0x3f13de[_0xfb38('0x38')],_0x31f628[_0xfb38('0x3e')]);}})['catch'](function(_0x404f0b){logger[_0xfb38('0x1b')]('['+[_0xb0cdd6['toUpperCase']()]+_0xfb38('0x6c'),util['inspect'](_0x404f0b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7e2b=['info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','content','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','getString','Fields','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','result','sys_id'];(function(_0x244033,_0x1b9df3){var _0x3c035c=function(_0x469acb){while(--_0x469acb){_0x244033['push'](_0x244033['shift']());}};_0x3c035c(++_0x1b9df3);}(_0x7e2b,0x1a5));var _0xb7e2=function(_0x488f83,_0x4ac4e5){_0x488f83=_0x488f83-0x0;var _0x188d2d=_0x7e2b[_0x488f83];return _0x188d2d;};'use strict';var _=require(_0xb7e2('0x0'));var Promise=require(_0xb7e2('0x1'));var rp=require(_0xb7e2('0x2'));var util=require(_0xb7e2('0x3'));var md5=require(_0xb7e2('0x4'));var Redis=require(_0xb7e2('0x5'));var intUtil=require(_0xb7e2('0x6'));var config=require(_0xb7e2('0x7'));var logger=require(_0xb7e2('0x8'))('servicenow');config[_0xb7e2('0x9')]=_[_0xb7e2('0xa')](config['redis'],{'host':_0xb7e2('0xb'),'port':0x18eb});var io=require(_0xb7e2('0xc'))(new Redis(config[_0xb7e2('0x9')]));function getAdminUser(_0x5e4b49,_0xfee04d,_0x5e62b9,_0x55cdd1,_0x514744,_0x582bbb){return new Promise(function(_0x3f6d2a,_0x5e3b55){var _0x46fa74={'method':_0xb7e2('0xd'),'uri':_0x55cdd1+_0xb7e2('0xe')+'&'+_0x514744+'&'+_0x582bbb,'auth':_0xfee04d,'json':!![]};return rp(_0x46fa74)[_0xb7e2('0xf')](function(_0x492482){if(_0x492482['result'][_0xb7e2('0x10')]>0x0){_0x5e62b9['adminId']=_0x492482[_0xb7e2('0x11')][0x0][_0xb7e2('0x12')];}logger[_0xb7e2('0x13')]('['+[_0x5e4b49[_0xb7e2('0x14')]()]+_0xb7e2('0x15'),_0x5e62b9);_0x3f6d2a(_0x5e62b9);})[_0xb7e2('0x16')](function(_0x9ae4d2){logger[_0xb7e2('0x17')]('['+[_0x5e4b49[_0xb7e2('0x14')]()]+']',_0x9ae4d2[_0xb7e2('0x18')]);_0x5e3b55(_0x9ae4d2[_0xb7e2('0x18')]);});});}function getUser(_0x5c6ca0,_0x10e2da,_0x1a9234,_0x5789b3,_0xb8032e){return function(_0x404e5e){logger[_0xb7e2('0x13')]('['+[_0x5c6ca0[_0xb7e2('0x14')]()]+_0xb7e2('0x19'),_0x404e5e);return new Promise(function(_0x1c4f6a,_0x4c4b46){if(intUtil[_0xb7e2('0x1a')](_0x404e5e[_0xb7e2('0x1b')])){var _0x5bf8bc={'method':_0xb7e2('0xd'),'uri':_0x1a9234+_0xb7e2('0x1c')+_0x404e5e[_0xb7e2('0x1b')]+'&'+_0x5789b3+'&'+_0xb8032e,'auth':_0x10e2da,'json':!![]};logger[_0xb7e2('0x13')]('['+[_0x5c6ca0[_0xb7e2('0x14')]()]+_0xb7e2('0x1d'),_0x5bf8bc);return rp(_0x5bf8bc)[_0xb7e2('0xf')](function(_0x1d924e){logger['info']('['+[_0x5c6ca0[_0xb7e2('0x14')]()]+_0xb7e2('0x1e'),_0x1d924e);if(_0x1d924e['result']['length']>0x0&&String(_0x1d924e[_0xb7e2('0x11')][0x0][_0xb7e2('0x1f')])===_0xb7e2('0x20')){_0x404e5e[_0xb7e2('0x21')]=_0x1d924e[_0xb7e2('0x11')][0x0][_0xb7e2('0x12')];}else{_0x404e5e['userId']=_0x404e5e[_0xb7e2('0x22')];_0x404e5e[_0xb7e2('0x1b')]=_0x404e5e[_0xb7e2('0x23')];}logger[_0xb7e2('0x13')]('['+[_0x5c6ca0[_0xb7e2('0x14')]()]+'],\x20getUser\x20crm',_0x404e5e);_0x1c4f6a(_0x404e5e);})[_0xb7e2('0x16')](function(_0xeb918b){logger[_0xb7e2('0x17')]('['+[_0x5c6ca0[_0xb7e2('0x14')]()]+']',_0xeb918b[_0xb7e2('0x18')]);_0x4c4b46(_0xeb918b['message']);});}else{logger[_0xb7e2('0x13')]('['+[_0x5c6ca0[_0xb7e2('0x14')]()]+']\x20using\x20admin\x20profile');_0x404e5e[_0xb7e2('0x21')]=_0x404e5e[_0xb7e2('0x22')];_0x404e5e[_0xb7e2('0x1b')]=_0x404e5e[_0xb7e2('0x23')];_0x1c4f6a(_0x404e5e);}});};}function createEndUser(_0x56e991,_0x5356ef,_0x111267,_0x19d806,_0x1e45b0){logger[_0xb7e2('0x13')]('['+[_0x56e991['toUpperCase']()]+_0xb7e2('0x24'),_0x111267);return new Promise(function(_0xbb52fd,_0x57c1ce){var _0x24dd53={'method':_0xb7e2('0x25'),'uri':_0x19d806+_0xb7e2('0x26')+_0x1e45b0,'body':{'user_name':_0x111267[_0xb7e2('0x27')],'roles':_0xb7e2('0x28'),'first_name':_0x111267['endUserNumber'],'active':'true','date_format':_0xb7e2('0x29'),'phone':_0x111267[_0xb7e2('0x27')]},'auth':_0x5356ef,'json':!![]};return rp(_0x24dd53)['then'](function(_0x582f93){logger[_0xb7e2('0x13')]('['+[_0x56e991[_0xb7e2('0x14')]()]+_0xb7e2('0x2a'),_0x582f93[_0xb7e2('0x11')]);_0x111267[_0xb7e2('0x2b')]=_0x582f93['result'][_0xb7e2('0x12')];_0xbb52fd(_0x111267);})[_0xb7e2('0x16')](function(_0x185e09){logger[_0xb7e2('0x17')]('['+[_0x56e991[_0xb7e2('0x14')]()]+']',_0x185e09[_0xb7e2('0x18')]);_0x57c1ce(_0x185e09[_0xb7e2('0x18')]);});});}function getEndUser(_0x55819e,_0x5527fd,_0x5c469d,_0x2b3848,_0x5ee764){return function(_0x1029e2){logger[_0xb7e2('0x13')]('['+[_0x55819e[_0xb7e2('0x14')]()]+_0xb7e2('0x2c'),_0x1029e2);return new Promise(function(_0x4dd674,_0x2a2792){var _0x53b6bf={'method':_0xb7e2('0xd'),'uri':_0x5c469d+_0xb7e2('0x2d')+_0x1029e2[_0xb7e2('0x27')]+'&'+_0x2b3848+'&'+_0x5ee764,'auth':_0x5527fd,'json':!![]};return rp(_0x53b6bf)[_0xb7e2('0xf')](function(_0x5e211b){if(_0x5e211b['result'][_0xb7e2('0x10')]>0x0){_0x1029e2[_0xb7e2('0x2b')]=_0x5e211b['result'][0x0][_0xb7e2('0x12')];logger[_0xb7e2('0x13')]('['+[_0x55819e[_0xb7e2('0x14')]()]+_0xb7e2('0x2e'),_0x1029e2);_0x4dd674(_0x1029e2);}else{return createEndUser(_0x55819e,_0x5527fd,_0x1029e2,_0x5c469d,_0x2b3848)['then'](function(_0xd29fe2){logger['info']('['+[_0x55819e['toUpperCase']()]+_0xb7e2('0x2f'),_0xd29fe2);_0x4dd674(_0xd29fe2);});}})[_0xb7e2('0x16')](function(_0x233386){logger['error']('['+[_0x55819e[_0xb7e2('0x14')]()]+']',_0x233386['message']);_0x2a2792(_0x233386[_0xb7e2('0x18')]);});});};}function getCustomFields(_0x2b3800,_0x1203b3){var _0xf561c={};if(_0x2b3800[_0xb7e2('0x10')]>0x0){_[_0xb7e2('0x30')](_0x2b3800,function(_0x335ffd){if(_[_0xb7e2('0x31')]([_0xb7e2('0x32'),_0xb7e2('0x33')],_0x335ffd[_0xb7e2('0x34')])&&_0x335ffd[_0xb7e2('0x35')]&&!_0x335ffd[_0xb7e2('0x36')]){_0xf561c[_0x335ffd['nameField'][_0xb7e2('0x37')]()]=_0x335ffd['content']['toString']();}else if(_['includes']([_0xb7e2('0x32'),'picklist'],_0x335ffd[_0xb7e2('0x34')])&&_0x335ffd[_0xb7e2('0x38')]&&_0x335ffd[_0xb7e2('0x36')]){_0xf561c[_0x335ffd[_0xb7e2('0x38')][_0xb7e2('0x37')]()]=_0x335ffd[_0xb7e2('0x39')]['toString']();}else if(_0x335ffd[_0xb7e2('0x34')]==='variable'&&_0x335ffd[_0xb7e2('0x3a')]&&_0x335ffd[_0xb7e2('0x38')]&&_0x335ffd[_0xb7e2('0x36')]){_0xf561c[_0x335ffd['idField']['toLowerCase']()]=_0x1203b3[_0x335ffd['variableName']][_0xb7e2('0x3b')]();}else if(_0x335ffd[_0xb7e2('0x34')]===_0xb7e2('0x3c')&&_0x335ffd[_0xb7e2('0x3d')]&&_0x335ffd[_0xb7e2('0x3d')]['name']&&_0x335ffd['idField']&&_0x335ffd['customField']){_0xf561c[_0x335ffd[_0xb7e2('0x38')]['toLowerCase']()]=_0x1203b3[_0x335ffd[_0xb7e2('0x3d')][_0xb7e2('0x3e')][_0xb7e2('0x37')]()][_0xb7e2('0x3b')]();}});}return _0xf561c;}function getTicket(_0x187d76,_0x152424,_0x22c854,_0x26b647,_0x2a331a,_0x19693c){return function(_0x224f7c){logger[_0xb7e2('0x13')]('['+[_0x187d76['toUpperCase']()]+_0xb7e2('0x3f'),_0x224f7c);return new Promise(function(_0x50f157,_0x55bcd1){var _0x2d3b07=_0x187d76[_0xb7e2('0x37')]()==='outbound'?_0x224f7c[_0xb7e2('0x21')]:_0x224f7c[_0xb7e2('0x2b')];var _0x33166f={'method':'POST','uri':_0x22c854+_0xb7e2('0x40')+'?'+_0x19693c,'body':Object['assign']({},{'active':'true','caller_id':_0x2d3b07,'assigned_to':_0x224f7c[_0xb7e2('0x21')],'short_description':intUtil['getString'](_0x26b647['Subjects'],_0x2a331a,'\x20'),'description':intUtil[_0xb7e2('0x41')](_0x26b647['Descriptions'],_0x2a331a,'\x0a')},getCustomFields(_0x26b647[_0xb7e2('0x42')],_0x2a331a)),'auth':_0x152424,'json':!![]};return rp(_0x33166f)[_0xb7e2('0xf')](function(_0x36caaf){logger['info']('['+[_0x187d76['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x36caaf['result']);_0x224f7c['ticketId']=_0x36caaf[_0xb7e2('0x11')][_0xb7e2('0x12')];_0x224f7c['ticketNumber']=_0x36caaf[_0xb7e2('0x11')]['number'];logger['info']('['+[_0x187d76['toUpperCase']()]+']\x20getTicket\x20crm',_0x224f7c);_0x50f157(_0x224f7c);})['catch'](function(_0x1b9a8a){logger[_0xb7e2('0x17')]('['+[_0x187d76[_0xb7e2('0x14')]()]+']',_0x1b9a8a['message']);_0x55bcd1(_0x1b9a8a['message']);});});};}function createRemoteTag(_0x586928,_0x35e1c2,_0x464e53,_0x13f67a){return new Promise(function(_0x3c08ab,_0x53df3b){var _0x1a87ae={'method':'POST','uri':_0x464e53+_0xb7e2('0x43')+'?'+_0x13f67a,'body':{'short_description':_0x586928,'global':!![],'active':!![],'name':_0x586928},'auth':_0x35e1c2,'json':!![]};return rp(_0x1a87ae)[_0xb7e2('0xf')](function(_0x3914f8){var _0x1e6891=_0x3914f8[_0xb7e2('0x11')][_0xb7e2('0x12')];_0x3c08ab(_0x1e6891);});});}function getRemoteTag(_0x4e5fa1,_0x49f06e,_0x5cafcf,_0x3e8e91,_0x4d1dbd){return new Promise(function(_0x1950ce,_0x1d1319){var _0x7d88db={'method':_0xb7e2('0xd'),'uri':_0x5cafcf+_0xb7e2('0x43')+_0xb7e2('0x44')+_0x4e5fa1+'&'+_0x3e8e91,'auth':_0x49f06e,'json':!![]};return rp(_0x7d88db)[_0xb7e2('0xf')](function(_0x2f0cea){if(_0x2f0cea[_0xb7e2('0x11')][_0xb7e2('0x10')]>0x0){var _0x16f62d=_0x2f0cea[_0xb7e2('0x11')][0x0][_0xb7e2('0x12')];_0x1950ce(_0x16f62d);}else{return createRemoteTag(_0x4e5fa1,_0x49f06e,_0x5cafcf,_0x3e8e91)['then'](function(_0xa76331){_0x1950ce(_0xa76331);});}});});}function assignTagToIncident(_0x3f0a09,_0x52d6bd,_0x1a3284,_0x3bbf40,_0x38f34f){return new Promise(function(_0x4c821f,_0x4193df){var _0x4cb00c={'method':_0xb7e2('0x25'),'uri':_0x1a3284+_0xb7e2('0x45')+'?'+_0x38f34f,'body':{'label':_0x3f0a09,'table':_0xb7e2('0x40'),'id_type':_0xb7e2('0x46'),'table_key':_0x3bbf40[_0xb7e2('0x47')],'title':_0xb7e2('0x48')+_0x3bbf40[_0xb7e2('0x49')],'id_display':_0x3bbf40[_0xb7e2('0x49')]},'auth':_0x52d6bd,'json':!![]};return rp(_0x4cb00c)[_0xb7e2('0xf')](function(_0x35f3b3){_0x4c821f();})[_0xb7e2('0x16')](function(){_0x4c821f();});});}function manageTags(_0xb91885,_0x301fe7,_0x29d3a6,_0x3928a9,_0x4ae857,_0x29a8c7,_0x8044a1){return new Promise(function(_0x20cc01,_0x326d4b){var _0x289b09=[];_0x301fe7[_0xb7e2('0x30')](function(_0x2c6935){_0x289b09[_0xb7e2('0x4a')](getRemoteTag(_0x2c6935,_0x29d3a6,_0x3928a9,_0x29a8c7,_0x8044a1));});return Promise[_0xb7e2('0x4b')](_0x289b09)['then'](function(_0x4c34b5){if(_0x4c34b5[_0xb7e2('0x10')]){logger[_0xb7e2('0x13')]('['+[_0xb91885[_0xb7e2('0x14')]()]+_0xb7e2('0x4c'),_0x4c34b5);var _0x1b6cb4=[];_0x4c34b5[_0xb7e2('0x30')](function(_0x576cf0){_0x1b6cb4[_0xb7e2('0x4a')](assignTagToIncident(_0x576cf0,_0x29d3a6,_0x3928a9,_0x4ae857,_0x29a8c7));});return Promise[_0xb7e2('0x4b')](_0x1b6cb4)['then'](function(){_0x20cc01();})[_0xb7e2('0x16')](function(){_0x20cc01();});}else{_0x20cc01();}});});}function getTags(_0x590684,_0x4a9e04,_0x495c94,_0x10ad8f,_0x59c48b,_0x5ee88b){return function(_0x5e3b47){return new Promise(function(_0x4a9e08,_0x1a7c1d){var _0x4ad619=[];var _0x5ad84b=_0x10ad8f['Tags'];if(_0x5ad84b&&_0x5ad84b[_0xb7e2('0x10')]>0x0){_0x4ad619=_[_0xb7e2('0x4d')](_0x5ad84b,'name');}if(_0x4ad619[_0xb7e2('0x10')]>0x0){return manageTags(_0x590684,_0x4ad619,_0x4a9e04,_0x495c94,_0x5e3b47,_0x59c48b,_0x5ee88b)[_0xb7e2('0xf')](function(){_0x4a9e08(_0x5e3b47);});}else{_0x4a9e08(_0x5e3b47);}});};}function emit(_0x2612b3,_0xe974ba,_0x9e41da){var _0x36d2da='%26sysparm_record_target%3Dincident'+_0xb7e2('0x4e')+_0xb7e2('0x4f')+'%255EORDERBYDESCnumber';var _0x4c815a={'uri':_0x2612b3+_0xb7e2('0x50')+_0x9e41da+_0x36d2da};io['to'](util[_0xb7e2('0x51')](_0xb7e2('0x52'),_0xe974ba))[_0xb7e2('0x53')](_0xb7e2('0x54'),_0x4c815a);}exports['cs']=function(_0x6093da,_0x46b076,_0x3d3080,_0x349155,_0xa1e380,_0xbde50d,_0x194736,_0x4fb333){var _0x2df195={};var _0x50b40a={'user':_0xbde50d[_0xb7e2('0x55')],'pass':_0xbde50d['password']};var _0x2b6cc1='sysparm_limit=1';var _0x3c7142='sysparm_display_value=true';_0xbde50d[_0xb7e2('0x56')]=intUtil[_0xb7e2('0x57')](_0xbde50d[_0xb7e2('0x56')]);_0xbde50d[_0xb7e2('0x58')]=intUtil[_0xb7e2('0x57')](_0xbde50d[_0xb7e2('0x58')]);var _0x48de76=util[_0xb7e2('0x51')](_0xb7e2('0x59'),_0xbde50d['remoteUri']);_0x2df195[_0xb7e2('0x1b')]=!_[_0xb7e2('0x5a')](_0x349155)?_0x349155['email']:null;_0x2df195[_0xb7e2('0x23')]=_0xbde50d[_0xb7e2('0x5b')];_0x2df195[_0xb7e2('0x27')]=_0x4fb333['toLowerCase']()===_0xb7e2('0x5c')?_0x46b076[_0xb7e2('0x5d')]:_0x46b076[_0xb7e2('0x5e')];_0x2df195[_0xb7e2('0x5f')]=_0x4fb333===_0xb7e2('0x60')||_0x4fb333===_0xb7e2('0x61')?_0xb7e2('0x60'):_0xb7e2('0x5c');var _0x1b555e=util[_0xb7e2('0x51')](_0xb7e2('0x62'),_0xbde50d[_0xb7e2('0x58')],_0x46b076[_0xb7e2('0x63')],md5(_0x46b076[_0xb7e2('0x63')]));if(_0xa1e380&&_0xa1e380['monitor_format']){logger[_0xb7e2('0x13')](_0xb7e2('0x64'),_0xb7e2('0x65'));_0x46b076[_0xb7e2('0x66')]=_0x1b555e;}else if(_0x194736&&_0x194736[_0xb7e2('0x67')]&&_0x194736[_0xb7e2('0x67')]!==_0xb7e2('0x68')){logger['info'](_0xb7e2('0x69'),_0xb7e2('0x65'));_0x46b076['recordingURL']=_0x1b555e;}else{_0x46b076[_0xb7e2('0x66')]='';}return getAdminUser(_0x4fb333,_0x50b40a,_0x2df195,_0x48de76,_0x3c7142,_0x2b6cc1)[_0xb7e2('0xf')](getUser(_0x4fb333,_0x50b40a,_0x48de76,_0x3c7142,_0x2b6cc1))[_0xb7e2('0xf')](getEndUser(_0x4fb333,_0x50b40a,_0x48de76,_0x3c7142,_0x2b6cc1))['then'](getTicket(_0x4fb333,_0x50b40a,_0x48de76,_0x3d3080,_0x46b076,_0x3c7142))[_0xb7e2('0xf')](function(_0x1be5d5){logger[_0xb7e2('0x13')](util[_0xb7e2('0x51')](_0xb7e2('0x6a'),_0x1be5d5[_0xb7e2('0x47')]));logger[_0xb7e2('0x13')](util[_0xb7e2('0x51')](_0xb7e2('0x6b'),_0x4fb333));if(_0x4fb333!==_0xb7e2('0x61')){logger[_0xb7e2('0x13')]('['+[_0x4fb333['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xbde50d[_0xb7e2('0x56')],_0x349155[_0xb7e2('0x3e')],_0x1be5d5['ticketId']);}})[_0xb7e2('0x16')](function(_0x31d1b8){logger[_0xb7e2('0x17')]('['+[_0x4fb333[_0xb7e2('0x14')]()]+_0xb7e2('0x6c'),util[_0xb7e2('0x6d')](_0x31d1b8,{'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 581eb6e..5b00678 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 _0x2c94=['value','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Contacts','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','nameField','content','custom_fields','variable','Variable','toLowerCase','login','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','toString','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list'];(function(_0x1a2ef5,_0x3d643f){var _0x266a1e=function(_0x1b9b5d){while(--_0x1b9b5d){_0x1a2ef5['push'](_0x1a2ef5['shift']());}};_0x266a1e(++_0x3d643f);}(_0x2c94,0x1b0));var _0x42c9=function(_0x1fef34,_0x457d7f){_0x1fef34=_0x1fef34-0x0;var _0x11063b=_0x2c94[_0x1fef34];return _0x11063b;};'use strict';var _=require(_0x42c9('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x42c9('0x1'));var util=require(_0x42c9('0x2'));var Redis=require(_0x42c9('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0x42c9('0x4')]=_[_0x42c9('0x5')](config['redis'],{'host':_0x42c9('0x6'),'port':0x18eb});var io=require(_0x42c9('0x7'))(new Redis(config[_0x42c9('0x4')]));var def={'method':_0x42c9('0x8'),'json':!![]};function emit(_0x38d694,_0x111844,_0x273f2d){io['to'](_0x38d694)[_0x42c9('0x9')](_0x111844,_0x273f2d);}function getTicket(_0x2e24e6,_0x3009ca,_0x5dc4b3,_0x31a3f5,_0xc8d4ea,_0x23c2ba,_0x19836b,_0x55bd5e){logger['info'](_0x42c9('0xa'));var _0x36d3c0=new Date();var _0x326b75=[{'name':'name','value':intUtil[_0x42c9('0xb')](_0x31a3f5[_0x42c9('0xc')],_0xc8d4ea,'\x20')},{'name':_0x42c9('0xd'),'value':_0x3009ca['id']},{'name':_0x42c9('0xe'),'value':_0x3009ca['id']},{'name':_0x42c9('0xf'),'value':intUtil[_0x42c9('0xb')](_0x31a3f5[_0x42c9('0x10')],_0xc8d4ea,'\x0a')},{'name':'date_start','value':_0x36d3c0['toISOString']()[_0x42c9('0x11')](0x0,0x13)[_0x42c9('0x12')]('T','\x20')},{'name':_0x42c9('0x13'),'value':'0'},{'name':_0x42c9('0x14'),'value':'15'},{'name':_0x42c9('0x15'),'value':_0x5dc4b3['id']},{'name':_0x42c9('0x16'),'value':'Contacts'},{'name':_0x42c9('0x17'),'value':_0x5dc4b3[_0x42c9('0x18')]},{'name':_0x42c9('0x19'),'value':_0x55bd5e}];if(_0x23c2ba[_0x42c9('0x1a')]){_[_0x42c9('0x1b')](_0x23c2ba,function(_0x509dbc){if(_0xc8d4ea[_0x509dbc[_0x42c9('0x1c')]]){_0x326b75[_0x42c9('0x1d')]({'name':_0x509dbc[_0x42c9('0x1e')],'value':_0xc8d4ea[_0x509dbc[_0x42c9('0x1c')]]});}});}return request({'form':{'method':_0x42c9('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x42c9('0x20')]({'session':_0x19836b['id'],'module_name':_0x42c9('0x21'),'name_value_list':_0x326b75})}});}function getAuth(_0x19a783){return util[_0x42c9('0x22')](_0x42c9('0x23'),new Buffer(_0x19a783['apiKey']+':X')[_0x42c9('0x24')]('base64'));}function getServerInfo(_0x3478ed){return request({'form':{'method':_0x42c9('0x25'),'input_type':_0x42c9('0x26'),'response_type':_0x42c9('0x26'),'rest_data':JSON[_0x42c9('0x20')]({'session':_0x3478ed['id']})}});}function getUser(_0x37b39e,_0x159cb0,_0x5b36e4){if(!_[_0x42c9('0x27')](_0x159cb0)){logger['info'](_0x42c9('0x28'),_0x159cb0);return request({'form':{'method':_0x42c9('0x29'),'input_type':_0x42c9('0x26'),'response_type':_0x42c9('0x26'),'rest_data':JSON[_0x42c9('0x20')]({'session':_0x5b36e4['id'],'module_name':_0x42c9('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x159cb0),'order_by':'','offset':'0','select_fields':['id',_0x42c9('0x18'),_0x42c9('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x42c9('0x2c')](function(_0x5bebb5){if(_0x5bebb5[_0x42c9('0x2d')]['length']){var _0x1333ab=_[_0x42c9('0x2e')](_0x5bebb5['entry_list'],function(_0x3536c9){return _0x3536c9[_0x42c9('0x2f')]['user_name']['value']===_0x159cb0;});if(_0x1333ab){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x1333ab['name_value_list']['id'][_0x42c9('0x30')],'name':_0x1333ab[_0x42c9('0x2f')]['name'][_0x42c9('0x30')]});}}logger[_0x42c9('0x31')](_0x42c9('0x32'));return BPromise['resolve']({'id':_0x5b36e4['name_value_list'][_0x42c9('0x33')][_0x42c9('0x30')],'name':_0x5b36e4['name_value_list'][_0x42c9('0x2b')]['value']});});}else{logger[_0x42c9('0x31')](_0x42c9('0x34'));return BPromise[_0x42c9('0x35')]({'id':_0x5b36e4['name_value_list']['user_id']['value'],'name':_0x5b36e4[_0x42c9('0x2f')][_0x42c9('0x2b')][_0x42c9('0x30')]});}}function getEndUser(_0x57be53,_0x48fd36,_0x2d16b9,_0x217573){logger[_0x42c9('0x31')]('Searching\x20enduser\x20with\x20phone',_0x2d16b9);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x42c9('0x26'),'rest_data':JSON[_0x42c9('0x20')]({'session':_0x217573['id'],'module_name':'Contacts','query':util[_0x42c9('0x22')](_0x42c9('0x36'),_0x2d16b9),'order_by':'','offset':'0','select_fields':['id',_0x42c9('0x18'),_0x42c9('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x42c9('0x2c')](function(_0x1ac0b5){if(_0x1ac0b5[_0x42c9('0x2d')][_0x42c9('0x1a')]){var _0x5e8f3d=_[_0x42c9('0x2e')](_0x1ac0b5[_0x42c9('0x2d')],function(_0x87f951){return _0x87f951[_0x42c9('0x2f')][_0x42c9('0x37')][_0x42c9('0x30')]===_0x2d16b9;});if(_0x5e8f3d){logger[_0x42c9('0x31')](_0x42c9('0x38'));return BPromise['resolve']({'id':_0x5e8f3d[_0x42c9('0x2f')]['id'][_0x42c9('0x30')],'name':_0x5e8f3d[_0x42c9('0x2f')]['name'][_0x42c9('0x30')],'phone':_0x5e8f3d[_0x42c9('0x2f')][_0x42c9('0x37')]['value']});}}else{logger[_0x42c9('0x31')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x42c9('0x1f'),'input_type':_0x42c9('0x26'),'response_type':_0x42c9('0x26'),'rest_data':JSON['stringify']({'session':_0x217573['id'],'module_name':_0x42c9('0x39'),'name_value_list':[{'name':_0x42c9('0x3a'),'value':_0x48fd36!==_0x42c9('0x3b')?_0x48fd36:util['format'](_0x42c9('0x3c'),_0x2d16b9)},{'name':_0x42c9('0x37'),'value':_0x2d16b9}]})}})[_0x42c9('0x2c')](function(_0x5c7a4f){logger['info'](_0x42c9('0x3d'));return BPromise['resolve']({'id':_0x5c7a4f['id'],'name':_0x5c7a4f[_0x42c9('0x2d')][_0x42c9('0x3a')][_0x42c9('0x30')],'phone':_0x5c7a4f[_0x42c9('0x2d')][_0x42c9('0x37')][_0x42c9('0x30')]});});}});}function request(_0x2b984d){logger[_0x42c9('0x3e')](_0x42c9('0x3f'),JSON[_0x42c9('0x20')](_0x2b984d));return rp(_[_0x42c9('0x40')](def,_0x2b984d));}function getTags(_0x277bd9,_0x100187){var _0x114f98=[];if(_0x277bd9&&_0x277bd9[_0x42c9('0x1a')]>0x0){_0x114f98=_[_0x42c9('0x41')](_0x277bd9,_0x100187);}return _0x114f98;}function getCustomFields(_0x17159c,_0x309dbb){var _0x8b1415=[];var _0x55cdbb={'custom_fields':[]};if(_0x17159c[_0x42c9('0x1a')]>0x0){_[_0x42c9('0x1b')](_0x17159c,function(_0x27987a){if(_0x27987a[_0x42c9('0x42')]===_0x42c9('0x43')&&_0x27987a['nameField']&&!_0x27987a[_0x42c9('0x44')]){_0x55cdbb[_0x27987a[_0x42c9('0x45')]['toLowerCase']()]=_0x27987a[_0x42c9('0x46')][_0x42c9('0x24')]();}else if(_0x27987a[_0x42c9('0x42')]===_0x42c9('0x43')&&_0x27987a[_0x42c9('0x1e')]&&_0x27987a[_0x42c9('0x44')]){_0x55cdbb[_0x42c9('0x47')][_0x42c9('0x1d')]({'id':_0x27987a['idField'],'value':_0x27987a['content']['toString']()});}else if(_0x27987a[_0x42c9('0x42')]===_0x42c9('0x48')&&_0x27987a[_0x42c9('0x1c')]&&_0x27987a[_0x42c9('0x1e')]&&_0x27987a[_0x42c9('0x44')]){_0x309dbb[_0x27987a[_0x42c9('0x1c')]]&&_0x55cdbb['custom_fields']['push']({'id':_0x27987a[_0x42c9('0x1e')],'value':_0x309dbb[_0x27987a[_0x42c9('0x1c')]][_0x42c9('0x24')]()});}else if(_0x27987a[_0x42c9('0x42')]==='customVariable'&&_0x27987a[_0x42c9('0x49')]&&_0x27987a[_0x42c9('0x49')][_0x42c9('0x18')]&&_0x27987a['idField']&&_0x27987a[_0x42c9('0x44')]){_0x309dbb[_0x27987a['Variable'][_0x42c9('0x18')]['toLowerCase']()]&&_0x55cdbb[_0x42c9('0x47')][_0x42c9('0x1d')]({'id':_0x27987a['idField'],'value':_0x309dbb[_0x27987a['Variable'][_0x42c9('0x18')][_0x42c9('0x4a')]()]['toString']()});}});}return _0x55cdbb;}function getConnection(_0x4cc7d6){return request({'method':_0x42c9('0x8'),'form':{'method':_0x42c9('0x4b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x42c9('0x20')]({'user_auth':{'user_name':_0x4cc7d6[_0x42c9('0x4c')],'password':_0x4cc7d6['password'],'encryption':_0x42c9('0x4d')},'application':_0x42c9('0x4e')})}})[_0x42c9('0x2c')](function(_0x24f4a2){var _0x405b0f=_0x24f4a2;if(_0x405b0f['id']){def['sessionID']=_0x405b0f['id'];return BPromise[_0x42c9('0x35')](_0x405b0f);}else{throw new Error(util['format'](_0x42c9('0x4f'),_0x4cc7d6['id']));}});}function setRelationship(_0x4c2ed7,_0x13172c,_0x132ada,_0x29a2ae){return request({'form':{'method':_0x42c9('0x50'),'input_type':_0x42c9('0x26'),'response_type':_0x42c9('0x26'),'rest_data':JSON[_0x42c9('0x20')]({'session':_0x4c2ed7['id'],'module_name':'Calls','module_id':_0x132ada['id'],'link_field_name':_0x29a2ae,'related_ids':[_0x13172c['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x57540c,_0x213bee,_0x359a07,_0x1936bd,_0x9a2a4c,_0x4ba97d){var _0x4b18f8,_0x30c970,_0x4531a1,_0x1cf4db;_0x4ba97d[_0x42c9('0x51')]=intUtil['stripTrailingSlash'](_0x4ba97d['remoteUri']);_0x4ba97d[_0x42c9('0x52')]=intUtil[_0x42c9('0x53')](_0x4ba97d[_0x42c9('0x52')]);def['uri']=util[_0x42c9('0x22')](_0x42c9('0x54'),_0x4ba97d['remoteUri']);if(_0x9a2a4c&&_0x9a2a4c['monitor_format']){logger[_0x42c9('0x31')](_0x42c9('0x55'),_0x42c9('0x56'));_0x213bee[_0x42c9('0x57')]=util['format'](_0x42c9('0x58'),_0x4ba97d[_0x42c9('0x52')],_0x213bee[_0x42c9('0x59')],md5(_0x213bee[_0x42c9('0x59')]));}else{_0x213bee[_0x42c9('0x57')]='';}return getConnection(_0x4ba97d)[_0x42c9('0x2c')](function(_0x2233a9){_0x1cf4db=_0x2233a9;return getUser(_0x4ba97d,_0x1936bd[_0x42c9('0x18')],_0x1cf4db);})['then'](function(_0x1bfa58){_0x4b18f8=_0x1bfa58;logger[_0x42c9('0x31')](_0x42c9('0x5a'),_0x4b18f8['id']);return getEndUser(_0x4ba97d,_0x213bee['calleridname'],_0x213bee[_0x42c9('0x5b')],_0x1cf4db);})['then'](function(_0x244c79){_0x30c970=_0x244c79;logger['info'](_0x42c9('0x5c'),_0x30c970['id']);return getTicket(_0x4ba97d,_0x4b18f8,_0x30c970,_0x359a07,_0x213bee,_0x359a07[_0x42c9('0x5d')],_0x1cf4db,_0x42c9('0x5e'));})[_0x42c9('0x2c')](function(_0x750085){_0x4531a1=_0x750085;logger[_0x42c9('0x31')]('Ticket\x20created!');logger[_0x42c9('0x31')]('The\x20Ticket\x20ID\x20is:',_0x4531a1['id']);return setRelationship(_0x1cf4db,_0x4b18f8,_0x4531a1,_0x42c9('0x5f'));})[_0x42c9('0x2c')](function(){return setRelationship(_0x1cf4db,_0x30c970,_0x4531a1,_0x42c9('0x60'));})[_0x42c9('0x2c')](function(){return getServerInfo(_0x1cf4db);})[_0x42c9('0x2c')](function(_0x420a71){var _0x38dd28=parseInt(_0x420a71[_0x42c9('0x61')][_0x42c9('0x62')](0x0));var _0x5b804c=util[_0x42c9('0x22')](_0x42c9('0x63'),_0x4ba97d['remoteUri'],_0x4531a1['id']);if(_0x38dd28>0x6){_0x5b804c=util[_0x42c9('0x22')](_0x42c9('0x64'),_0x4ba97d[_0x42c9('0x51')],_0x4531a1['id']);}logger[_0x42c9('0x31')]('[QUEUE]',_0x42c9('0x65'));emit(util[_0x42c9('0x22')]('user:%s',_0x1936bd[_0x42c9('0x18')]),_0x42c9('0x66'),{'uri':_0x5b804c});})['catch'](function(_0x325863){logger[_0x42c9('0x67')](_0x42c9('0x55'),JSON[_0x42c9('0x20')](_0x325863));});};exports[_0x42c9('0x68')]=function(_0x15c028,_0x301314,_0x1decd9,_0x5c6c9b,_0x2d2a0f,_0x5f568f,_0x120577){var _0x34137f,_0xfd2695,_0x56ee55,_0x1fd723;_0x5f568f['remoteUri']=intUtil['stripTrailingSlash'](_0x5f568f[_0x42c9('0x51')]);_0x5f568f[_0x42c9('0x52')]=intUtil[_0x42c9('0x53')](_0x5f568f['serverUrl']);def[_0x42c9('0x69')]=util[_0x42c9('0x22')]('%s/service/v4_1/rest.php',_0x5f568f[_0x42c9('0x51')]);if(_0x120577&&_0x120577['recordingFormat']&&_0x120577[_0x42c9('0x6a')]!==_0x42c9('0x6b')){logger[_0x42c9('0x31')](_0x42c9('0x6c'),_0x42c9('0x56'));_0x301314[_0x42c9('0x57')]=util['format'](_0x42c9('0x58'),_0x5f568f['serverUrl'],_0x301314[_0x42c9('0x59')],md5(_0x301314[_0x42c9('0x59')]));}return getConnection(_0x5f568f)[_0x42c9('0x2c')](function(_0x52ad0f){_0x1fd723=_0x52ad0f;return getUser(_0x5f568f,_0x5c6c9b[_0x42c9('0x18')],_0x1fd723);})['then'](function(_0xea69a7){_0x34137f=_0xea69a7;logger[_0x42c9('0x31')](_0x42c9('0x5a'),_0x34137f['id']);return getEndUser(_0x5f568f,_0x301314[_0x42c9('0x6d')],_0x301314[_0x42c9('0x6e')],_0x1fd723);})[_0x42c9('0x2c')](function(_0x3a45c3){_0xfd2695=_0x3a45c3;logger[_0x42c9('0x31')]('The\x20Enduser\x20ID\x20is:',_0xfd2695['id']);return getTicket(_0x5f568f,_0x34137f,_0xfd2695,_0x1decd9,_0x301314,_0x1decd9[_0x42c9('0x5d')],_0x1fd723,'Outbound');})[_0x42c9('0x2c')](function(_0x1b8469){_0x56ee55=_0x1b8469;logger[_0x42c9('0x31')](_0x42c9('0x6f'));logger[_0x42c9('0x31')](_0x42c9('0x70'),_0x56ee55['id']);return setRelationship(_0x1fd723,_0x34137f,_0x56ee55,_0x42c9('0x5f'));})[_0x42c9('0x2c')](function(){return setRelationship(_0x1fd723,_0xfd2695,_0x56ee55,_0x42c9('0x60'));})['then'](function(){return getServerInfo(_0x1fd723);})[_0x42c9('0x2c')](function(_0x420980){var _0x11d617=parseInt(_0x420980[_0x42c9('0x61')][_0x42c9('0x62')](0x0));var _0x325f4e=util[_0x42c9('0x22')](_0x42c9('0x63'),_0x5f568f[_0x42c9('0x51')],_0x56ee55['id']);if(_0x11d617>0x6){_0x325f4e=util[_0x42c9('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5f568f['remoteUri'],_0x56ee55['id']);}logger[_0x42c9('0x31')](_0x42c9('0x6c'),_0x42c9('0x65'));emit(util[_0x42c9('0x22')](_0x42c9('0x71'),_0x5c6c9b[_0x42c9('0x18')]),'trigger:browser:url',{'uri':_0x325f4e});})[_0x42c9('0x72')](function(_0x5209e5){logger[_0x42c9('0x67')]('[OUTBOUND]',JSON[_0x42c9('0x20')](_0x5209e5));});};exports[_0x42c9('0x73')]=function(_0x59186b,_0x33983f,_0x2dec64,_0x44eab9,_0x514da7,_0x62b05f){var _0x1f4427,_0x7a5462,_0x350676,_0x113041;_0x62b05f['remoteUri']=intUtil[_0x42c9('0x53')](_0x62b05f[_0x42c9('0x51')]);_0x62b05f[_0x42c9('0x52')]=intUtil['stripTrailingSlash'](_0x62b05f[_0x42c9('0x52')]);def[_0x42c9('0x69')]=util['format']('%s/service/v4_1/rest.php',_0x62b05f[_0x42c9('0x51')]);if(_0x514da7&&_0x514da7[_0x42c9('0x74')]){logger[_0x42c9('0x31')]('['+_0x33983f[_0x42c9('0x75')][_0x42c9('0x76')]()+']',_0x42c9('0x56'));_0x33983f[_0x42c9('0x57')]=util[_0x42c9('0x22')](_0x42c9('0x58'),_0x62b05f[_0x42c9('0x52')],_0x33983f[_0x42c9('0x59')],md5(_0x33983f[_0x42c9('0x59')]));}else{_0x33983f[_0x42c9('0x57')]='';}return getConnection(_0x62b05f)['then'](function(_0x263824){_0x113041=_0x263824;if(!_[_0x42c9('0x27')](_0x44eab9)){return getUser(_0x62b05f,_0x44eab9[_0x42c9('0x18')],_0x113041);}else{return getUser(_0x62b05f,null,_0x113041);}})[_0x42c9('0x2c')](function(_0x5a68ee){_0x1f4427=_0x5a68ee;logger[_0x42c9('0x31')](_0x42c9('0x5a'),_0x1f4427['id']);return getEndUser(_0x62b05f,_0x33983f[_0x42c9('0x77')],_0x33983f[_0x42c9('0x5b')],_0x113041);})['then'](function(_0x4fff87){_0x7a5462=_0x4fff87;logger[_0x42c9('0x31')](_0x42c9('0x5c'),_0x7a5462['id']);return getTicket(_0x62b05f,_0x1f4427,_0x7a5462,_0x2dec64,_0x33983f,_0x2dec64[_0x42c9('0x5d')],_0x113041,_0x42c9('0x5e'));})[_0x42c9('0x2c')](function(_0x1ec25b){_0x350676=_0x1ec25b;logger[_0x42c9('0x31')]('Ticket\x20created!');logger[_0x42c9('0x31')](_0x42c9('0x70'),_0x350676['id']);return setRelationship(_0x113041,_0x1f4427,_0x350676,_0x42c9('0x5f'));})['then'](function(){return setRelationship(_0x113041,_0x7a5462,_0x350676,_0x42c9('0x60'));})[_0x42c9('0x2c')](function(){return getServerInfo(_0x113041);})[_0x42c9('0x72')](function(_0x12380f){logger[_0x42c9('0x67')]('['+_0x33983f[_0x42c9('0x75')][_0x42c9('0x76')]()+']',JSON[_0x42c9('0x20')](_0x12380f));});}; \ No newline at end of file +var _0x407e=['Ticket\x20created!','bluebird','md5','util','ioredis','./util','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_minutes','parent_type','Contacts','parent_name','length','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','Agent\x20found!','resolve','value','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','forEach','type','string','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','users','uri','lastevent','toUpperCase','calleridname'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x407e,0x78));var _0xe407=function(_0x4fa4fd,_0x4c656b){_0x4fa4fd=_0x4fa4fd-0x0;var _0x3c50d0=_0x407e[_0x4fa4fd];return _0x3c50d0;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xe407('0x0'));var md5=require(_0xe407('0x1'));var util=require(_0xe407('0x2'));var Redis=require(_0xe407('0x3'));var intUtil=require(_0xe407('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0xe407('0x5')]=_[_0xe407('0x6')](config[_0xe407('0x5')],{'host':_0xe407('0x7'),'port':0x18eb});var io=require(_0xe407('0x8'))(new Redis(config[_0xe407('0x5')]));var def={'method':_0xe407('0x9'),'json':!![]};function emit(_0x25e6f2,_0x176687,_0x5187ff){io['to'](_0x25e6f2)['emit'](_0x176687,_0x5187ff);}function getTicket(_0x249ba7,_0xc18567,_0x13ecf1,_0x159af2,_0x2460f8,_0x24941c,_0x58d1b1,_0x3f472e){logger[_0xe407('0xa')](_0xe407('0xb'));var _0x1d57a3=new Date();var _0x4b41b2=[{'name':_0xe407('0xc'),'value':intUtil[_0xe407('0xd')](_0x159af2[_0xe407('0xe')],_0x2460f8,'\x20')},{'name':_0xe407('0xf'),'value':_0xc18567['id']},{'name':_0xe407('0x10'),'value':_0xc18567['id']},{'name':_0xe407('0x11'),'value':intUtil[_0xe407('0xd')](_0x159af2['Descriptions'],_0x2460f8,'\x0a')},{'name':_0xe407('0x12'),'value':_0x1d57a3[_0xe407('0x13')]()[_0xe407('0x14')](0x0,0x13)[_0xe407('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe407('0x16'),'value':'15'},{'name':'parent_id','value':_0x13ecf1['id']},{'name':_0xe407('0x17'),'value':_0xe407('0x18')},{'name':_0xe407('0x19'),'value':_0x13ecf1[_0xe407('0xc')]},{'name':'direction','value':_0x3f472e}];if(_0x24941c[_0xe407('0x1a')]){_['forEach'](_0x24941c,function(_0x538988){if(_0x2460f8[_0x538988[_0xe407('0x1b')]]){_0x4b41b2[_0xe407('0x1c')]({'name':_0x538988[_0xe407('0x1d')],'value':_0x2460f8[_0x538988[_0xe407('0x1b')]]});}});}return request({'form':{'method':_0xe407('0x1e'),'input_type':_0xe407('0x1f'),'response_type':_0xe407('0x1f'),'rest_data':JSON['stringify']({'session':_0x58d1b1['id'],'module_name':_0xe407('0x20'),'name_value_list':_0x4b41b2})}});}function getAuth(_0x260ca5){return util[_0xe407('0x21')](_0xe407('0x22'),new Buffer(_0x260ca5[_0xe407('0x23')]+':X')[_0xe407('0x24')](_0xe407('0x25')));}function getServerInfo(_0x30dd49){return request({'form':{'method':_0xe407('0x26'),'input_type':_0xe407('0x1f'),'response_type':_0xe407('0x1f'),'rest_data':JSON[_0xe407('0x27')]({'session':_0x30dd49['id']})}});}function getUser(_0x4bb4fd,_0x273b41,_0x207d58){if(!_[_0xe407('0x28')](_0x273b41)){logger[_0xe407('0xa')](_0xe407('0x29'),_0x273b41);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xe407('0x1f'),'rest_data':JSON[_0xe407('0x27')]({'session':_0x207d58['id'],'module_name':'Employees','query':util[_0xe407('0x21')](_0xe407('0x2a'),_0x273b41),'order_by':'','offset':'0','select_fields':['id',_0xe407('0xc'),_0xe407('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe407('0x2c')](function(_0x77ce91){if(_0x77ce91[_0xe407('0x2d')][_0xe407('0x1a')]){var _0x5a1ff3=_[_0xe407('0x2e')](_0x77ce91[_0xe407('0x2d')],function(_0x206907){return _0x206907['name_value_list'][_0xe407('0x2b')]['value']===_0x273b41;});if(_0x5a1ff3){logger[_0xe407('0xa')](_0xe407('0x2f'));return BPromise[_0xe407('0x30')]({'id':_0x5a1ff3['name_value_list']['id'][_0xe407('0x31')],'name':_0x5a1ff3[_0xe407('0x32')][_0xe407('0xc')][_0xe407('0x31')]});}}logger[_0xe407('0xa')](_0xe407('0x33'));return BPromise[_0xe407('0x30')]({'id':_0x207d58['name_value_list'][_0xe407('0x34')]['value'],'name':_0x207d58['name_value_list']['user_name'][_0xe407('0x31')]});});}else{logger[_0xe407('0xa')](_0xe407('0x35'));return BPromise['resolve']({'id':_0x207d58[_0xe407('0x32')][_0xe407('0x34')]['value'],'name':_0x207d58['name_value_list']['user_name']['value']});}}function getEndUser(_0x2eef35,_0x5d1603,_0x35529c,_0x2df93f){logger[_0xe407('0xa')]('Searching\x20enduser\x20with\x20phone',_0x35529c);return request({'form':{'method':_0xe407('0x36'),'input_type':_0xe407('0x1f'),'response_type':_0xe407('0x1f'),'rest_data':JSON['stringify']({'session':_0x2df93f['id'],'module_name':'Contacts','query':util[_0xe407('0x21')](_0xe407('0x37'),_0x35529c),'order_by':'','offset':'0','select_fields':['id',_0xe407('0xc'),_0xe407('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3a5cbf){if(_0x3a5cbf[_0xe407('0x2d')][_0xe407('0x1a')]){var _0x1642d3=_[_0xe407('0x2e')](_0x3a5cbf['entry_list'],function(_0x1ee05f){return _0x1ee05f[_0xe407('0x32')]['phone_home'][_0xe407('0x31')]===_0x35529c;});if(_0x1642d3){logger['info'](_0xe407('0x39'));return BPromise[_0xe407('0x30')]({'id':_0x1642d3[_0xe407('0x32')]['id'][_0xe407('0x31')],'name':_0x1642d3[_0xe407('0x32')]['name'][_0xe407('0x31')],'phone':_0x1642d3[_0xe407('0x32')][_0xe407('0x38')][_0xe407('0x31')]});}}else{logger[_0xe407('0xa')](_0xe407('0x3a'));return request({'form':{'method':_0xe407('0x1e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2df93f['id'],'module_name':'Contacts','name_value_list':[{'name':_0xe407('0x3b'),'value':_0x5d1603!==_0xe407('0x3c')?_0x5d1603:util['format'](_0xe407('0x3d'),_0x35529c)},{'name':'phone_home','value':_0x35529c}]})}})[_0xe407('0x2c')](function(_0x4ddcb7){logger[_0xe407('0xa')](_0xe407('0x3e'));return BPromise[_0xe407('0x30')]({'id':_0x4ddcb7['id'],'name':_0x4ddcb7[_0xe407('0x2d')][_0xe407('0x3b')][_0xe407('0x31')],'phone':_0x4ddcb7[_0xe407('0x2d')][_0xe407('0x38')]['value']});});}});}function request(_0x28edc8){logger[_0xe407('0x3f')]('[HTTP]',JSON[_0xe407('0x27')](_0x28edc8));return rp(_[_0xe407('0x40')](def,_0x28edc8));}function getTags(_0x137e8c,_0x7d7679){var _0x26ff11=[];if(_0x137e8c&&_0x137e8c[_0xe407('0x1a')]>0x0){_0x26ff11=_['map'](_0x137e8c,_0x7d7679);}return _0x26ff11;}function getCustomFields(_0xbe5c58,_0x2b36e8){var _0x4a37e4=[];var _0x5699da={'custom_fields':[]};if(_0xbe5c58[_0xe407('0x1a')]>0x0){_[_0xe407('0x41')](_0xbe5c58,function(_0x327d56){if(_0x327d56[_0xe407('0x42')]===_0xe407('0x43')&&_0x327d56['nameField']&&!_0x327d56[_0xe407('0x44')]){_0x5699da[_0x327d56['nameField'][_0xe407('0x45')]()]=_0x327d56[_0xe407('0x46')][_0xe407('0x24')]();}else if(_0x327d56['type']===_0xe407('0x43')&&_0x327d56['idField']&&_0x327d56['customField']){_0x5699da[_0xe407('0x47')][_0xe407('0x1c')]({'id':_0x327d56[_0xe407('0x1d')],'value':_0x327d56[_0xe407('0x46')][_0xe407('0x24')]()});}else if(_0x327d56['type']===_0xe407('0x48')&&_0x327d56[_0xe407('0x1b')]&&_0x327d56[_0xe407('0x1d')]&&_0x327d56[_0xe407('0x44')]){_0x2b36e8[_0x327d56[_0xe407('0x1b')]]&&_0x5699da[_0xe407('0x47')]['push']({'id':_0x327d56[_0xe407('0x1d')],'value':_0x2b36e8[_0x327d56[_0xe407('0x1b')]]['toString']()});}else if(_0x327d56['type']===_0xe407('0x49')&&_0x327d56[_0xe407('0x4a')]&&_0x327d56[_0xe407('0x4a')][_0xe407('0xc')]&&_0x327d56['idField']&&_0x327d56[_0xe407('0x44')]){_0x2b36e8[_0x327d56['Variable']['name'][_0xe407('0x45')]()]&&_0x5699da[_0xe407('0x47')][_0xe407('0x1c')]({'id':_0x327d56[_0xe407('0x1d')],'value':_0x2b36e8[_0x327d56[_0xe407('0x4a')]['name'][_0xe407('0x45')]()][_0xe407('0x24')]()});}});}return _0x5699da;}function getConnection(_0x1480d0){return request({'method':'POST','form':{'method':_0xe407('0x4b'),'input_type':_0xe407('0x1f'),'response_type':_0xe407('0x1f'),'rest_data':JSON[_0xe407('0x27')]({'user_auth':{'user_name':_0x1480d0[_0xe407('0x4c')],'password':_0x1480d0[_0xe407('0x4d')],'encryption':_0xe407('0x4e')},'application':_0xe407('0x4f')})}})[_0xe407('0x2c')](function(_0x516f59){var _0x4c67ee=_0x516f59;if(_0x4c67ee['id']){def[_0xe407('0x50')]=_0x4c67ee['id'];return BPromise[_0xe407('0x30')](_0x4c67ee);}else{throw new Error(util[_0xe407('0x21')](_0xe407('0x51'),_0x1480d0['id']));}});}function setRelationship(_0x2c8cbb,_0x4ecd9c,_0x5e6fd9,_0x599583){return request({'form':{'method':_0xe407('0x52'),'input_type':_0xe407('0x1f'),'response_type':_0xe407('0x1f'),'rest_data':JSON['stringify']({'session':_0x2c8cbb['id'],'module_name':_0xe407('0x20'),'module_id':_0x5e6fd9['id'],'link_field_name':_0x599583,'related_ids':[_0x4ecd9c['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x47b73c,_0x4a3768,_0x1d08b1,_0x41ae63,_0x38b8fd,_0xc8066f){var _0x410d53,_0x1d5b7e,_0xa9f9de,_0x331748;_0xc8066f[_0xe407('0x53')]=intUtil[_0xe407('0x54')](_0xc8066f[_0xe407('0x53')]);_0xc8066f[_0xe407('0x55')]=intUtil[_0xe407('0x54')](_0xc8066f[_0xe407('0x55')]);def['uri']=util[_0xe407('0x21')]('%s/service/v4_1/rest.php',_0xc8066f['remoteUri']);if(_0x38b8fd&&_0x38b8fd[_0xe407('0x56')]){logger[_0xe407('0xa')](_0xe407('0x57'),_0xe407('0x58'));_0x4a3768[_0xe407('0x59')]=util[_0xe407('0x21')](_0xe407('0x5a'),_0xc8066f[_0xe407('0x55')],_0x4a3768[_0xe407('0x5b')],md5(_0x4a3768['uniqueid']));}else{_0x4a3768[_0xe407('0x59')]='';}return getConnection(_0xc8066f)['then'](function(_0x436ae7){_0x331748=_0x436ae7;return getUser(_0xc8066f,_0x41ae63[_0xe407('0xc')],_0x331748);})[_0xe407('0x2c')](function(_0x452507){_0x410d53=_0x452507;logger[_0xe407('0xa')](_0xe407('0x5c'),_0x410d53['id']);return getEndUser(_0xc8066f,_0x4a3768['calleridname'],_0x4a3768['calleridnum'],_0x331748);})['then'](function(_0x4004a9){_0x1d5b7e=_0x4004a9;logger[_0xe407('0xa')](_0xe407('0x5d'),_0x1d5b7e['id']);return getTicket(_0xc8066f,_0x410d53,_0x1d5b7e,_0x1d08b1,_0x4a3768,_0x1d08b1[_0xe407('0x5e')],_0x331748,_0xe407('0x5f'));})[_0xe407('0x2c')](function(_0x152c00){_0xa9f9de=_0x152c00;logger[_0xe407('0xa')]('Ticket\x20created!');logger[_0xe407('0xa')]('The\x20Ticket\x20ID\x20is:',_0xa9f9de['id']);return setRelationship(_0x331748,_0x410d53,_0xa9f9de,'users');})['then'](function(){return setRelationship(_0x331748,_0x1d5b7e,_0xa9f9de,_0xe407('0x60'));})[_0xe407('0x2c')](function(){return getServerInfo(_0x331748);})[_0xe407('0x2c')](function(_0x1666bb){var _0x50873=parseInt(_0x1666bb[_0xe407('0x61')][_0xe407('0x62')](0x0));var _0x30213f=util[_0xe407('0x21')](_0xe407('0x63'),_0xc8066f['remoteUri'],_0xa9f9de['id']);if(_0x50873>0x6){_0x30213f=util[_0xe407('0x21')](_0xe407('0x64'),_0xc8066f[_0xe407('0x53')],_0xa9f9de['id']);}logger[_0xe407('0xa')](_0xe407('0x57'),_0xe407('0x65'));emit(util[_0xe407('0x21')](_0xe407('0x66'),_0x41ae63['name']),_0xe407('0x67'),{'uri':_0x30213f});})[_0xe407('0x68')](function(_0x9917a4){logger[_0xe407('0x69')](_0xe407('0x57'),JSON['stringify'](_0x9917a4));});};exports[_0xe407('0x6a')]=function(_0x30f15a,_0x34b020,_0x5a3e0d,_0x42dffb,_0x377e40,_0x44b9ed,_0x5c56a2){var _0x1f6282,_0x357dee,_0x54572f,_0x409dad;_0x44b9ed[_0xe407('0x53')]=intUtil[_0xe407('0x54')](_0x44b9ed[_0xe407('0x53')]);_0x44b9ed[_0xe407('0x55')]=intUtil[_0xe407('0x54')](_0x44b9ed[_0xe407('0x55')]);def['uri']=util[_0xe407('0x21')](_0xe407('0x6b'),_0x44b9ed['remoteUri']);if(_0x5c56a2&&_0x5c56a2[_0xe407('0x6c')]&&_0x5c56a2[_0xe407('0x6c')]!==_0xe407('0x6d')){logger['info'](_0xe407('0x6e'),_0xe407('0x58'));_0x34b020[_0xe407('0x59')]=util[_0xe407('0x21')](_0xe407('0x5a'),_0x44b9ed['serverUrl'],_0x34b020['uniqueid'],md5(_0x34b020[_0xe407('0x5b')]));}return getConnection(_0x44b9ed)[_0xe407('0x2c')](function(_0x1e1af6){_0x409dad=_0x1e1af6;return getUser(_0x44b9ed,_0x42dffb[_0xe407('0xc')],_0x409dad);})[_0xe407('0x2c')](function(_0x56d0a2){_0x1f6282=_0x56d0a2;logger['info'](_0xe407('0x5c'),_0x1f6282['id']);return getEndUser(_0x44b9ed,_0x34b020[_0xe407('0x6f')],_0x34b020['destcalleridnum'],_0x409dad);})[_0xe407('0x2c')](function(_0x44394d){_0x357dee=_0x44394d;logger[_0xe407('0xa')](_0xe407('0x5d'),_0x357dee['id']);return getTicket(_0x44b9ed,_0x1f6282,_0x357dee,_0x5a3e0d,_0x34b020,_0x5a3e0d[_0xe407('0x5e')],_0x409dad,'Outbound');})[_0xe407('0x2c')](function(_0x2b9e18){_0x54572f=_0x2b9e18;logger[_0xe407('0xa')]('Ticket\x20created!');logger[_0xe407('0xa')](_0xe407('0x70'),_0x54572f['id']);return setRelationship(_0x409dad,_0x1f6282,_0x54572f,_0xe407('0x71'));})[_0xe407('0x2c')](function(){return setRelationship(_0x409dad,_0x357dee,_0x54572f,_0xe407('0x60'));})[_0xe407('0x2c')](function(){return getServerInfo(_0x409dad);})[_0xe407('0x2c')](function(_0x14d6ad){var _0x17d8e8=parseInt(_0x14d6ad['version'][_0xe407('0x62')](0x0));var _0x9e67bf=util[_0xe407('0x21')](_0xe407('0x63'),_0x44b9ed['remoteUri'],_0x54572f['id']);if(_0x17d8e8>0x6){_0x9e67bf=util[_0xe407('0x21')](_0xe407('0x64'),_0x44b9ed[_0xe407('0x53')],_0x54572f['id']);}logger[_0xe407('0xa')](_0xe407('0x6e'),_0xe407('0x65'));emit(util['format'](_0xe407('0x66'),_0x42dffb[_0xe407('0xc')]),_0xe407('0x67'),{'uri':_0x9e67bf});})[_0xe407('0x68')](function(_0x2b19a2){logger[_0xe407('0x69')](_0xe407('0x6e'),JSON[_0xe407('0x27')](_0x2b19a2));});};exports['unmanaged']=function(_0x43f026,_0x4fef26,_0x457051,_0x4a1344,_0x34d563,_0x5c022c){var _0x1e5abb,_0x37e12d,_0x23c922,_0x3069a1;_0x5c022c[_0xe407('0x53')]=intUtil[_0xe407('0x54')](_0x5c022c[_0xe407('0x53')]);_0x5c022c[_0xe407('0x55')]=intUtil[_0xe407('0x54')](_0x5c022c['serverUrl']);def[_0xe407('0x72')]=util['format'](_0xe407('0x6b'),_0x5c022c[_0xe407('0x53')]);if(_0x34d563&&_0x34d563[_0xe407('0x56')]){logger[_0xe407('0xa')]('['+_0x4fef26[_0xe407('0x73')][_0xe407('0x74')]()+']','Recording\x20is\x20enabled!');_0x4fef26['recordingURL']=util['format'](_0xe407('0x5a'),_0x5c022c[_0xe407('0x55')],_0x4fef26[_0xe407('0x5b')],md5(_0x4fef26[_0xe407('0x5b')]));}else{_0x4fef26['recordingURL']='';}return getConnection(_0x5c022c)[_0xe407('0x2c')](function(_0x54d562){_0x3069a1=_0x54d562;if(!_[_0xe407('0x28')](_0x4a1344)){return getUser(_0x5c022c,_0x4a1344[_0xe407('0xc')],_0x3069a1);}else{return getUser(_0x5c022c,null,_0x3069a1);}})[_0xe407('0x2c')](function(_0x5ddfee){_0x1e5abb=_0x5ddfee;logger['info'](_0xe407('0x5c'),_0x1e5abb['id']);return getEndUser(_0x5c022c,_0x4fef26[_0xe407('0x75')],_0x4fef26['calleridnum'],_0x3069a1);})[_0xe407('0x2c')](function(_0x4b1107){_0x37e12d=_0x4b1107;logger[_0xe407('0xa')](_0xe407('0x5d'),_0x37e12d['id']);return getTicket(_0x5c022c,_0x1e5abb,_0x37e12d,_0x457051,_0x4fef26,_0x457051[_0xe407('0x5e')],_0x3069a1,_0xe407('0x5f'));})[_0xe407('0x2c')](function(_0x5a87d9){_0x23c922=_0x5a87d9;logger[_0xe407('0xa')](_0xe407('0x76'));logger[_0xe407('0xa')](_0xe407('0x70'),_0x23c922['id']);return setRelationship(_0x3069a1,_0x1e5abb,_0x23c922,_0xe407('0x71'));})['then'](function(){return setRelationship(_0x3069a1,_0x37e12d,_0x23c922,_0xe407('0x60'));})[_0xe407('0x2c')](function(){return getServerInfo(_0x3069a1);})[_0xe407('0x68')](function(_0x2db2ed){logger[_0xe407('0x69')]('['+_0x4fef26['lastevent'][_0xe407('0x74')]()+']',JSON[_0xe407('0x27')](_0x2db2ed));});}; \ 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 0ce76dc..120447d 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 _0xa39a=['type','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','string','push','content'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa39a,0x1b9));var _0xaa39=function(_0x340a9e,_0x9a9fbd){_0x340a9e=_0x340a9e-0x0;var _0x1de27b=_0xa39a[_0x340a9e];return _0x1de27b;};'use strict';var _=require(_0xaa39('0x0'));var util=require(_0xaa39('0x1'));exports['getString']=function(_0x10872d,_0x1391d0,_0x1f921f){var _0x5371d8=[];if(_0x10872d[_0xaa39('0x2')]>0x0){var _0x3cad09=_[_0xaa39('0x3')](_0x10872d,['id']);for(var _0x2a2f24=0x0;_0x2a2f24<_0x3cad09[_0xaa39('0x2')];_0x2a2f24++){var _0x3298f8=_0x3cad09[_0x2a2f24];if(_0x3298f8['type']===_0xaa39('0x4')){_0x5371d8[_0xaa39('0x5')](_0x3298f8[_0xaa39('0x6')]);}else if(_0x3298f8[_0xaa39('0x7')]==='variable'&&_0x3298f8['variableName']){_0x1391d0[_0x3298f8[_0xaa39('0x8')]]&&_0x5371d8[_0xaa39('0x5')](_0x1391d0[_0x3298f8[_0xaa39('0x8')]]['toString']());}else if(_0x3298f8[_0xaa39('0x7')]===_0xaa39('0x9')&&_0x3298f8[_0xaa39('0xa')]&&_0x3298f8['Variable'][_0xaa39('0xb')]){_0x1391d0[_0x3298f8[_0xaa39('0xa')][_0xaa39('0xb')][_0xaa39('0xc')]()]&&_0x5371d8[_0xaa39('0x5')](_0x1391d0[_0x3298f8[_0xaa39('0xa')][_0xaa39('0xb')]['toLowerCase']()][_0xaa39('0xd')]());}else if(_0x3298f8['type']===_0xaa39('0xe')){if(_0x3298f8[_0xaa39('0xf')]===_0xaa39('0x4')&&_0x3298f8[_0xaa39('0x10')]){_0x5371d8['push'](util[_0xaa39('0x11')](_0xaa39('0x12'),_0x3298f8[_0xaa39('0x10')],_0x3298f8[_0xaa39('0x13')]));}else if(_0x3298f8[_0xaa39('0xf')]===_0xaa39('0x14')&&_0x3298f8[_0xaa39('0x8')]&&_0x3298f8[_0xaa39('0x10')]){_0x1391d0[_0x3298f8[_0xaa39('0x8')]]&&_0x5371d8['push'](util[_0xaa39('0x11')]('%s:\x20%s',_0x3298f8[_0xaa39('0x10')],_0x1391d0[_0x3298f8[_0xaa39('0x8')]]));}else if(_0x3298f8[_0xaa39('0xf')]==='customVariable'&&_0x3298f8['Variable']&&_0x3298f8[_0xaa39('0xa')]['name']&&_0x3298f8[_0xaa39('0x10')]){_0x1391d0[_0x3298f8['Variable']['name'][_0xaa39('0xc')]()]&&_0x5371d8[_0xaa39('0x5')](util['format'](_0xaa39('0x12'),_0x3298f8[_0xaa39('0x10')],_0x1391d0[_0x3298f8[_0xaa39('0xa')][_0xaa39('0xb')][_0xaa39('0xc')]()]));}}}}return _0x5371d8[_0xaa39('0x15')](_0x1f921f);};exports['stripTrailingSlash']=function(_0x3ab3a4){var _0x30c6ad=_0x3ab3a4[_0xaa39('0x16')](-0x1);if(_0x30c6ad==='/'){_0x3ab3a4=_0x3ab3a4[_0xaa39('0x17')](0x0,_0x3ab3a4[_0xaa39('0x18')](_0x30c6ad));}return _0x3ab3a4;};exports[_0xaa39('0x19')]=function(_0x4b095d){if(!_[_0xaa39('0x1a')](_0x4b095d)&&_0x4b095d!==''){var _0x479459=/^(([^<>()\[\]\\.,;:\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 _0x479459[_0xaa39('0x1b')](String(_0x4b095d)[_0xaa39('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x503f=['push','content','variable','variableName','customVariable','Variable','name','toString','keyValue','key','%s:\x20%s','keyContent','keyType','toLowerCase','format','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','sortBy','length','type','string'];(function(_0x5b7fc7,_0x60f01e){var _0x3d0bd2=function(_0x138ce3){while(--_0x138ce3){_0x5b7fc7['push'](_0x5b7fc7['shift']());}};_0x3d0bd2(++_0x60f01e);}(_0x503f,0x182));var _0xf503=function(_0x352926,_0x378c02){_0x352926=_0x352926-0x0;var _0x17530d=_0x503f[_0x352926];return _0x17530d;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x59ae91,_0x2757f2,_0x9c8054){var _0x43826b=[];if(_0x59ae91['length']>0x0){var _0x35b9ae=_[_0xf503('0x0')](_0x59ae91,['id']);for(var _0x6ed122=0x0;_0x6ed122<_0x35b9ae[_0xf503('0x1')];_0x6ed122++){var _0x4900ec=_0x35b9ae[_0x6ed122];if(_0x4900ec[_0xf503('0x2')]===_0xf503('0x3')){_0x43826b[_0xf503('0x4')](_0x4900ec[_0xf503('0x5')]);}else if(_0x4900ec[_0xf503('0x2')]===_0xf503('0x6')&&_0x4900ec[_0xf503('0x7')]){_0x2757f2[_0x4900ec['variableName']]&&_0x43826b[_0xf503('0x4')](_0x2757f2[_0x4900ec[_0xf503('0x7')]]['toString']());}else if(_0x4900ec[_0xf503('0x2')]===_0xf503('0x8')&&_0x4900ec['Variable']&&_0x4900ec[_0xf503('0x9')][_0xf503('0xa')]){_0x2757f2[_0x4900ec['Variable'][_0xf503('0xa')]['toLowerCase']()]&&_0x43826b['push'](_0x2757f2[_0x4900ec[_0xf503('0x9')][_0xf503('0xa')]['toLowerCase']()][_0xf503('0xb')]());}else if(_0x4900ec[_0xf503('0x2')]===_0xf503('0xc')){if(_0x4900ec['keyType']===_0xf503('0x3')&&_0x4900ec[_0xf503('0xd')]){_0x43826b[_0xf503('0x4')](util['format'](_0xf503('0xe'),_0x4900ec['key'],_0x4900ec[_0xf503('0xf')]));}else if(_0x4900ec[_0xf503('0x10')]===_0xf503('0x6')&&_0x4900ec[_0xf503('0x7')]&&_0x4900ec[_0xf503('0xd')]){_0x2757f2[_0x4900ec[_0xf503('0x7')]]&&_0x43826b[_0xf503('0x4')](util['format'](_0xf503('0xe'),_0x4900ec[_0xf503('0xd')],_0x2757f2[_0x4900ec['variableName']]));}else if(_0x4900ec['keyType']==='customVariable'&&_0x4900ec[_0xf503('0x9')]&&_0x4900ec[_0xf503('0x9')][_0xf503('0xa')]&&_0x4900ec[_0xf503('0xd')]){_0x2757f2[_0x4900ec['Variable'][_0xf503('0xa')][_0xf503('0x11')]()]&&_0x43826b['push'](util[_0xf503('0x12')](_0xf503('0xe'),_0x4900ec[_0xf503('0xd')],_0x2757f2[_0x4900ec[_0xf503('0x9')][_0xf503('0xa')]['toLowerCase']()]));}}}}return _0x43826b[_0xf503('0x13')](_0x9c8054);};exports[_0xf503('0x14')]=function(_0x294126){var _0x34d3e9=_0x294126[_0xf503('0x15')](-0x1);if(_0x34d3e9==='/'){_0x294126=_0x294126[_0xf503('0x16')](0x0,_0x294126[_0xf503('0x17')](_0x34d3e9));}return _0x294126;};exports['validateEmail']=function(_0x267cbd){if(!_[_0xf503('0x18')](_0x267cbd)&&_0x267cbd!==''){var _0x3b25c3=/^(([^<>()\[\]\\.,;:\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 _0x3b25c3[_0xf503('0x19')](String(_0x267cbd)[_0xf503('0x11')]());}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 4e0565a..15779f6 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(_0x517681,_0x342a5e){var _0x24dac7=function(_0xd139dd){while(--_0xd139dd){_0x517681['push'](_0x517681['shift']());}};_0x24dac7(++_0x342a5e);}(_0xe706,0xa3));var _0x6e70=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xe706[_0x4c7935];return _0x30651d;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0xf9d02a,_0x331396){var _0x15f24e=function(_0xc5f14b){while(--_0xc5f14b){_0xf9d02a['push'](_0xf9d02a['shift']());}};_0x15f24e(++_0x331396);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index e127211..4444f05 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 _0x0b2a=['%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','emit','application/json','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','info','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','results','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','includes','string','picklist','type','nameField','customField','toLowerCase','push','idField','variableName','custom_fields','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...'];(function(_0x936f18,_0x110725){var _0x36b3b7=function(_0x5cd86b){while(--_0x5cd86b){_0x936f18['push'](_0x936f18['shift']());}};_0x36b3b7(++_0x110725);}(_0x0b2a,0xfa));var _0xa0b2=function(_0x1cdbc7,_0x564cd9){_0x1cdbc7=_0x1cdbc7-0x0;var _0x2d080f=_0x0b2a[_0x1cdbc7];return _0x2d080f;};'use strict';var _=require(_0xa0b2('0x0'));var rp=require(_0xa0b2('0x1'));var md5=require('md5');var util=require(_0xa0b2('0x2'));var Redis=require(_0xa0b2('0x3'));var intUtil=require(_0xa0b2('0x4'));var config=require(_0xa0b2('0x5'));var logger=require(_0xa0b2('0x6'))(_0xa0b2('0x7'));config[_0xa0b2('0x8')]=_['defaults'](config[_0xa0b2('0x8')],{'host':_0xa0b2('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5f4527,_0x24eef9,_0x1d8f6c){io['to'](_0x5f4527)[_0xa0b2('0xa')](_0x24eef9,_0x1d8f6c);}var headers={'Content-Type':'application/json','Accept':_0xa0b2('0xb')};function getTicket(_0x33d2bc,_0x507ae9,_0x2f0cdd,_0xdb0ab5,_0x593291){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xa0b2('0xc')](_0xa0b2('0xd'),_0x33d2bc[_0xa0b2('0xe')]),'method':_0xa0b2('0xf'),'body':{'ticket':_[_0xa0b2('0x10')]({'requester_id':_0x2f0cdd['id'],'submitter_id':_0x507ae9?_0x507ae9['id']:undefined,'assignee_id':_0x507ae9?_0x507ae9['id']:undefined,'tags':getTags(_0xdb0ab5[_0xa0b2('0x11')],_0xa0b2('0x12')),'subject':intUtil[_0xa0b2('0x13')](_0xdb0ab5[_0xa0b2('0x14')],_0x593291,'\x20'),'description':intUtil[_0xa0b2('0x13')](_0xdb0ab5['Descriptions'],_0x593291,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa0b2('0x13')](_0xdb0ab5['Descriptions'],_0x593291,'\x0a')}},getCustomFields(_0xdb0ab5[_0xa0b2('0x15')],_0x593291))}})[_0xa0b2('0x16')](function(_0x4ea0eb){logger['info'](_0xa0b2('0x17'));return _0x4ea0eb[_0xa0b2('0x18')];});}function getUser(_0x261aef,_0x17262f){if(intUtil[_0xa0b2('0x19')](_0x17262f)){logger['info'](_0xa0b2('0x1a'),_0x17262f);return request({'uri':util[_0xa0b2('0xc')]('%s/search.json',_0x261aef[_0xa0b2('0xe')]),'qs':{'query':util['format'](_0xa0b2('0x1b'),_0x17262f)}})[_0xa0b2('0x16')](function(_0xd85f86){if(_0xd85f86[_0xa0b2('0x1c')]){logger[_0xa0b2('0x1d')](_0xa0b2('0x1e'));return _[_0xa0b2('0x1f')](_0xd85f86['results'],{'email':_0x17262f,'role':_0xa0b2('0x20')});}else{logger[_0xa0b2('0x1d')](_0xa0b2('0x21'));return request({'uri':util[_0xa0b2('0xc')](_0xa0b2('0x22'),_0x261aef[_0xa0b2('0xe')])})[_0xa0b2('0x16')](function(_0x11b7cb){logger[_0xa0b2('0x1d')](_0xa0b2('0x23'));return _0x11b7cb[_0xa0b2('0x24')];});}});}else{logger[_0xa0b2('0x1d')](_0xa0b2('0x21'));return request({'uri':util[_0xa0b2('0xc')](_0xa0b2('0x22'),_0x261aef[_0xa0b2('0xe')])})[_0xa0b2('0x16')](function(_0x821727){logger[_0xa0b2('0x1d')](_0xa0b2('0x23'));return _0x821727[_0xa0b2('0x24')];});}}function getEndUser(_0xa4a4fe,_0x4cd8ea,_0x1671b8){logger[_0xa0b2('0x1d')](_0xa0b2('0x25'),_0x1671b8);return request({'uri':util['format'](_0xa0b2('0x26'),_0xa4a4fe[_0xa0b2('0xe')]),'qs':{'query':util[_0xa0b2('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x1671b8)}})['then'](function(_0x46cb3f){var _0x36b9f9;if(_0x46cb3f[_0xa0b2('0x27')][_0xa0b2('0x28')]){_0x46cb3f[_0xa0b2('0x27')]=_[_0xa0b2('0x29')](_0x46cb3f[_0xa0b2('0x27')],{'suspended':![],'role':_0xa0b2('0x2a')});if(_0x46cb3f[_0xa0b2('0x27')][_0xa0b2('0x28')]){_0x36b9f9=_['first'](_0x46cb3f[_0xa0b2('0x27')]);}}if(_0x36b9f9){logger[_0xa0b2('0x1d')]('Enduser\x20found!');return _0x36b9f9;}else{logger[_0xa0b2('0x1d')](_0xa0b2('0x2b'));return request({'uri':util[_0xa0b2('0xc')](_0xa0b2('0x2c'),_0xa4a4fe[_0xa0b2('0xe')]),'method':_0xa0b2('0xf'),'body':{'user':{'role':_0xa0b2('0x2a'),'name':util[_0xa0b2('0xc')](_0xa0b2('0x2d'),_0x4cd8ea||_0x1671b8),'phone':_0x1671b8}}})[_0xa0b2('0x16')](function(_0x3277b0){logger[_0xa0b2('0x1d')](_0xa0b2('0x2e'));return _0x3277b0[_0xa0b2('0x24')];});}});}function getAuth(_0x5217d6){var _0x4dfaad;if(_0x5217d6[_0xa0b2('0x2f')]===_0xa0b2('0x30')){_0x4dfaad=util[_0xa0b2('0xc')](_0xa0b2('0x31'),_0x5217d6[_0xa0b2('0x32')],_0x5217d6[_0xa0b2('0x30')]);}else if(_0x5217d6[_0xa0b2('0x2f')]===_0xa0b2('0x33')){_0x4dfaad=util['format'](_0xa0b2('0x34'),_0x5217d6[_0xa0b2('0x32')],_0x5217d6['token']);}return util['format'](_0xa0b2('0x35'),new Buffer(_0x4dfaad)[_0xa0b2('0x36')](_0xa0b2('0x37')));}function request(_0xf946b9){logger[_0xa0b2('0x38')](_0xa0b2('0x39'),JSON[_0xa0b2('0x3a')](_0xf946b9));return rp(_['defaults'](_0xf946b9,{'method':_0xa0b2('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x14a15e,_0x33a2a8){var _0x5b8daa=[];if(_0x14a15e&&_0x14a15e[_0xa0b2('0x28')]>0x0){_0x5b8daa=_['map'](_0x14a15e,_0x33a2a8);}return _0x5b8daa;}function getCustomFields(_0x139327,_0x59d77b){var _0x25a566=[];var _0x62a038={'custom_fields':[]};if(_0x139327[_0xa0b2('0x28')]>0x0){_['forEach'](_0x139327,function(_0x489ace){if(_[_0xa0b2('0x3c')]([_0xa0b2('0x3d'),_0xa0b2('0x3e')],_0x489ace[_0xa0b2('0x3f')])&&_0x489ace[_0xa0b2('0x40')]&&!_0x489ace[_0xa0b2('0x41')]){_0x62a038[_0x489ace['nameField'][_0xa0b2('0x42')]()]=_0x489ace['content'][_0xa0b2('0x36')]();}else if(_['includes']([_0xa0b2('0x3d'),'picklist'],_0x489ace[_0xa0b2('0x3f')])&&_0x489ace['idField']&&_0x489ace[_0xa0b2('0x41')]){_0x62a038['custom_fields'][_0xa0b2('0x43')]({'id':_0x489ace['idField'],'value':_0x489ace['content'][_0xa0b2('0x36')]()});}else if(_0x489ace[_0xa0b2('0x3f')]==='variable'&&_0x489ace['variableName']&&_0x489ace[_0xa0b2('0x44')]&&_0x489ace[_0xa0b2('0x41')]){_0x59d77b[_0x489ace[_0xa0b2('0x45')]]&&_0x62a038[_0xa0b2('0x46')][_0xa0b2('0x43')]({'id':_0x489ace[_0xa0b2('0x44')],'value':_0x59d77b[_0x489ace['variableName']][_0xa0b2('0x36')]()});}else if(_0x489ace[_0xa0b2('0x3f')]==='customVariable'&&_0x489ace['Variable']&&_0x489ace[_0xa0b2('0x47')]['name']&&_0x489ace['idField']&&_0x489ace[_0xa0b2('0x41')]){_0x59d77b[_0x489ace[_0xa0b2('0x47')][_0xa0b2('0x12')][_0xa0b2('0x42')]()]&&_0x62a038[_0xa0b2('0x46')]['push']({'id':_0x489ace[_0xa0b2('0x44')],'value':_0x59d77b[_0x489ace[_0xa0b2('0x47')][_0xa0b2('0x12')][_0xa0b2('0x42')]()][_0xa0b2('0x36')]()});}});}return _0x62a038;}exports[_0xa0b2('0x48')]=function(_0x479fe6,_0x240e81,_0x4d549d,_0x3744ab,_0x357b42,_0x5078f0){var _0x54f739,_0x4adccc;_0x5078f0[_0xa0b2('0xe')]=intUtil[_0xa0b2('0x49')](_0x5078f0[_0xa0b2('0xe')]);_0x5078f0[_0xa0b2('0x4a')]=intUtil[_0xa0b2('0x49')](_0x5078f0[_0xa0b2('0x4a')]);if(_0x357b42&&_0x357b42[_0xa0b2('0x4b')]){logger['info'](_0xa0b2('0x4c'),_0xa0b2('0x4d'));_0x240e81[_0xa0b2('0x4e')]=util[_0xa0b2('0xc')](_0xa0b2('0x4f'),_0x5078f0[_0xa0b2('0x4a')],_0x240e81[_0xa0b2('0x50')],md5(_0x240e81[_0xa0b2('0x50')]));}else{_0x240e81[_0xa0b2('0x4e')]='';}headers[_0xa0b2('0x51')]=getAuth(_0x5078f0);return getUser(_0x5078f0,_0x3744ab[_0xa0b2('0x52')])[_0xa0b2('0x16')](function(_0x46a372){_0x54f739=_0x46a372;logger['info'](_0xa0b2('0x53'),_0x54f739['id']);return getEndUser(_0x5078f0,_0x240e81[_0xa0b2('0x54')],_0x240e81['calleridnum']);})[_0xa0b2('0x16')](function(_0x257c1b){_0x4adccc=_0x257c1b;logger[_0xa0b2('0x1d')](_0xa0b2('0x55'),_0x4adccc['id']);return getTicket(_0x5078f0,_0x54f739,_0x4adccc,_0x4d549d,_0x240e81);})[_0xa0b2('0x16')](function(_0x2ef996){if(_0x2ef996){logger[_0xa0b2('0x1d')](_0xa0b2('0x56'),_0x2ef996['id']);switch(_0x5078f0['type']){case _0xa0b2('0x57'):logger[_0xa0b2('0x1d')](_0xa0b2('0x4c'),_0xa0b2('0x58'));return request({'uri':util['format'](_0xa0b2('0x59'),_0x5078f0[_0xa0b2('0xe')],_0x54f739['id'],_0x2ef996['id']),'method':'POST'});case'newTab':logger[_0xa0b2('0x1d')](_0xa0b2('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa0b2('0xc')](_0xa0b2('0x5a'),_0x3744ab['name']),'trigger:browser:url',{'uri':util[_0xa0b2('0xc')](_0xa0b2('0x5b'),_0x5078f0['remoteUri']['replace']('/api/v2',''),_0x2ef996['id'])});break;default:logger[_0xa0b2('0x5c')](_0xa0b2('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xa0b2('0x5d')](function(_0x12a1cc){logger[_0xa0b2('0x5c')](_0xa0b2('0x5e'),util[_0xa0b2('0x5f')](_0x12a1cc,{'showHidden':!![],'depth':null}));});};exports[_0xa0b2('0x60')]=function(_0x37dee1,_0x248d24,_0x3b7ab3,_0x13ede7,_0x9359bc,_0x1e6693,_0x5647d7){var _0x54848e,_0x1d5135;_0x1e6693[_0xa0b2('0xe')]=intUtil['stripTrailingSlash'](_0x1e6693[_0xa0b2('0xe')]);_0x1e6693[_0xa0b2('0x4a')]=intUtil['stripTrailingSlash'](_0x1e6693[_0xa0b2('0x4a')]);if(_0x5647d7&&_0x5647d7[_0xa0b2('0x61')]&&_0x5647d7['recordingFormat']!==_0xa0b2('0x62')){logger['info'](_0xa0b2('0x63'),_0xa0b2('0x4d'));_0x248d24[_0xa0b2('0x4e')]=util[_0xa0b2('0xc')](_0xa0b2('0x4f'),_0x1e6693[_0xa0b2('0x4a')],_0x248d24[_0xa0b2('0x50')],md5(_0x248d24[_0xa0b2('0x50')]));}headers[_0xa0b2('0x51')]=getAuth(_0x1e6693);return getUser(_0x1e6693,_0x13ede7[_0xa0b2('0x52')])[_0xa0b2('0x16')](function(_0x55e0e6){_0x54848e=_0x55e0e6;logger[_0xa0b2('0x1d')](_0xa0b2('0x53'),_0x54848e['id']);return getEndUser(_0x1e6693,_0x248d24['destcalleridname'],_0x248d24[_0xa0b2('0x64')]);})['then'](function(_0x5e9fbf){_0x1d5135=_0x5e9fbf;logger[_0xa0b2('0x1d')](_0xa0b2('0x55'),_0x1d5135['id']);return getTicket(_0x1e6693,_0x54848e,_0x1d5135,_0x3b7ab3,_0x248d24);})[_0xa0b2('0x16')](function(_0x5e1535){if(_0x5e1535){logger[_0xa0b2('0x1d')](_0xa0b2('0x56'),_0x5e1535['id']);switch(_0x1e6693[_0xa0b2('0x3f')]){case'integrationTab':logger[_0xa0b2('0x1d')](_0xa0b2('0x63'),_0xa0b2('0x58'));return request({'uri':util[_0xa0b2('0xc')](_0xa0b2('0x59'),_0x1e6693['remoteUri'],_0x54848e['id'],_0x5e1535['id']),'method':_0xa0b2('0xf')});case _0xa0b2('0x65'):logger[_0xa0b2('0x1d')]('[OUTBOUND]',_0xa0b2('0x66'));emit(util[_0xa0b2('0xc')](_0xa0b2('0x5a'),_0x13ede7[_0xa0b2('0x12')]),_0xa0b2('0x67'),{'uri':util[_0xa0b2('0xc')](_0xa0b2('0x5b'),_0x1e6693[_0xa0b2('0xe')][_0xa0b2('0x68')](_0xa0b2('0x69'),''),_0x5e1535['id'])});break;default:logger['error'](_0xa0b2('0x63'),_0xa0b2('0x6a'));}}})[_0xa0b2('0x5d')](function(_0x33a6f9){logger['error'](_0xa0b2('0x6b'),util[_0xa0b2('0x5f')](_0x33a6f9,{'showHidden':!![],'depth':null}));});};exports[_0xa0b2('0x6c')]=function(_0x142112,_0x4359f9,_0x237a3b,_0x4499cb,_0x47036f,_0x7e515e){var _0x5db733,_0x534146;_0x7e515e[_0xa0b2('0xe')]=intUtil[_0xa0b2('0x49')](_0x7e515e[_0xa0b2('0xe')]);_0x7e515e[_0xa0b2('0x4a')]=intUtil['stripTrailingSlash'](_0x7e515e[_0xa0b2('0x4a')]);if(_0x47036f&&_0x47036f['monitor_format']){logger[_0xa0b2('0x1d')]('['+_0x4359f9[_0xa0b2('0x6d')][_0xa0b2('0x6e')]()+']',_0xa0b2('0x4d'));_0x4359f9[_0xa0b2('0x4e')]=util[_0xa0b2('0xc')](_0xa0b2('0x4f'),_0x7e515e[_0xa0b2('0x4a')],_0x4359f9['uniqueid'],md5(_0x4359f9[_0xa0b2('0x50')]));}else{_0x4359f9['recordingURL']='';}headers[_0xa0b2('0x51')]=getAuth(_0x7e515e);return getUser(_0x7e515e)[_0xa0b2('0x16')](function(_0xd4397e){_0x5db733=_0xd4397e;logger[_0xa0b2('0x1d')]('The\x20User\x20ID\x20is:',_0x5db733['id']);return getEndUser(_0x7e515e,_0x4359f9[_0xa0b2('0x54')],_0x4359f9[_0xa0b2('0x6f')]);})[_0xa0b2('0x16')](function(_0x3cf9f6){_0x534146=_0x3cf9f6;logger[_0xa0b2('0x1d')](_0xa0b2('0x55'),_0x534146['id']);return getTicket(_0x7e515e,_0x5db733,_0x534146,_0x237a3b,_0x4359f9);})['then'](function(_0x129504){if(_0x129504){logger[_0xa0b2('0x1d')](_0xa0b2('0x56'),_0x129504['id']);}})['catch'](function(_0x5bb960){logger[_0xa0b2('0x5c')]('['+_0x4359f9[_0xa0b2('0x6d')][_0xa0b2('0x6e')]()+']'+_0xa0b2('0x70'),util[_0xa0b2('0x5f')](_0x5bb960,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb9f1=['info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','stringify','GET','map','forEach','includes','customField','nameField','toLowerCase','content','string','picklist','type','idField','custom_fields','push','variable','variableName','toString','Variable','name','queue','stripTrailingSlash','serverUrl','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','error','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json'];(function(_0x1865ce,_0x5cecda){var _0x29103c=function(_0x25bf9e){while(--_0x25bf9e){_0x1865ce['push'](_0x1865ce['shift']());}};_0x29103c(++_0x5cecda);}(_0xb9f1,0x64));var _0x1b9f=function(_0x4b845d,_0x44d388){_0x4b845d=_0x4b845d-0x0;var _0x1a4a70=_0xb9f1[_0x4b845d];return _0x1a4a70;};'use strict';var _=require('lodash');var rp=require(_0x1b9f('0x0'));var md5=require('md5');var util=require(_0x1b9f('0x1'));var Redis=require(_0x1b9f('0x2'));var intUtil=require(_0x1b9f('0x3'));var config=require(_0x1b9f('0x4'));var logger=require(_0x1b9f('0x5'))(_0x1b9f('0x6'));config[_0x1b9f('0x7')]=_[_0x1b9f('0x8')](config[_0x1b9f('0x7')],{'host':_0x1b9f('0x9'),'port':0x18eb});var io=require(_0x1b9f('0xa'))(new Redis(config['redis']));function emit(_0x1a996e,_0x3d1d43,_0x3ca063){io['to'](_0x1a996e)[_0x1b9f('0xb')](_0x3d1d43,_0x3ca063);}var headers={'Content-Type':_0x1b9f('0xc'),'Accept':_0x1b9f('0xc')};function getTicket(_0x2d60f7,_0x34fa97,_0x2f3cb6,_0x55cbca,_0x4a9075){logger[_0x1b9f('0xd')](_0x1b9f('0xe'));return request({'uri':util[_0x1b9f('0xf')](_0x1b9f('0x10'),_0x2d60f7[_0x1b9f('0x11')]),'method':_0x1b9f('0x12'),'body':{'ticket':_[_0x1b9f('0x13')]({'requester_id':_0x2f3cb6['id'],'submitter_id':_0x34fa97?_0x34fa97['id']:undefined,'assignee_id':_0x34fa97?_0x34fa97['id']:undefined,'tags':getTags(_0x55cbca[_0x1b9f('0x14')],'name'),'subject':intUtil[_0x1b9f('0x15')](_0x55cbca['Subjects'],_0x4a9075,'\x20'),'description':intUtil['getString'](_0x55cbca['Descriptions'],_0x4a9075,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1b9f('0x15')](_0x55cbca[_0x1b9f('0x16')],_0x4a9075,'\x0a')}},getCustomFields(_0x55cbca[_0x1b9f('0x17')],_0x4a9075))}})[_0x1b9f('0x18')](function(_0x147e92){logger[_0x1b9f('0xd')](_0x1b9f('0x19'));return _0x147e92[_0x1b9f('0x1a')];});}function getUser(_0xd5c021,_0x400b49){if(intUtil[_0x1b9f('0x1b')](_0x400b49)){logger[_0x1b9f('0xd')](_0x1b9f('0x1c'),_0x400b49);return request({'uri':util['format'](_0x1b9f('0x1d'),_0xd5c021[_0x1b9f('0x11')]),'qs':{'query':util[_0x1b9f('0xf')]('type:user\x20role:agent\x20email:%s',_0x400b49)}})[_0x1b9f('0x18')](function(_0x3f963d){if(_0x3f963d[_0x1b9f('0x1e')]){logger[_0x1b9f('0xd')](_0x1b9f('0x1f'));return _['find'](_0x3f963d[_0x1b9f('0x20')],{'email':_0x400b49,'role':_0x1b9f('0x21')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x1b9f('0x22'),_0xd5c021[_0x1b9f('0x11')])})[_0x1b9f('0x18')](function(_0x430b9a){logger['info'](_0x1b9f('0x23'));return _0x430b9a[_0x1b9f('0x24')];});}});}else{logger['info'](_0x1b9f('0x25'));return request({'uri':util['format']('%s/users/me.json',_0xd5c021[_0x1b9f('0x11')])})[_0x1b9f('0x18')](function(_0x3c2d23){logger[_0x1b9f('0xd')]('Admin\x20account\x20selected.');return _0x3c2d23[_0x1b9f('0x24')];});}}function getEndUser(_0x1c85be,_0x4afb85,_0x101b3c){logger[_0x1b9f('0xd')]('Searching\x20enduser\x20with\x20phone',_0x101b3c);return request({'uri':util[_0x1b9f('0xf')](_0x1b9f('0x1d'),_0x1c85be[_0x1b9f('0x11')]),'qs':{'query':util[_0x1b9f('0xf')](_0x1b9f('0x26'),_0x101b3c)}})[_0x1b9f('0x18')](function(_0x529d68){var _0x4945a3;if(_0x529d68[_0x1b9f('0x20')][_0x1b9f('0x27')]){_0x529d68[_0x1b9f('0x20')]=_[_0x1b9f('0x28')](_0x529d68[_0x1b9f('0x20')],{'suspended':![],'role':_0x1b9f('0x29')});if(_0x529d68[_0x1b9f('0x20')][_0x1b9f('0x27')]){_0x4945a3=_[_0x1b9f('0x2a')](_0x529d68['results']);}}if(_0x4945a3){logger[_0x1b9f('0xd')](_0x1b9f('0x2b'));return _0x4945a3;}else{logger[_0x1b9f('0xd')](_0x1b9f('0x2c'));return request({'uri':util[_0x1b9f('0xf')]('%s/users.json',_0x1c85be[_0x1b9f('0x11')]),'method':_0x1b9f('0x12'),'body':{'user':{'role':_0x1b9f('0x29'),'name':util[_0x1b9f('0xf')](_0x1b9f('0x2d'),_0x4afb85||_0x101b3c),'phone':_0x101b3c}}})[_0x1b9f('0x18')](function(_0xf22378){logger[_0x1b9f('0xd')]('Enduser\x20created.');return _0xf22378[_0x1b9f('0x24')];});}});}function getAuth(_0x27542d){var _0x5d3536;if(_0x27542d[_0x1b9f('0x2e')]===_0x1b9f('0x2f')){_0x5d3536=util[_0x1b9f('0xf')](_0x1b9f('0x30'),_0x27542d[_0x1b9f('0x31')],_0x27542d[_0x1b9f('0x2f')]);}else if(_0x27542d[_0x1b9f('0x2e')]===_0x1b9f('0x32')){_0x5d3536=util[_0x1b9f('0xf')]('%s/token:%s',_0x27542d['username'],_0x27542d['token']);}return util[_0x1b9f('0xf')](_0x1b9f('0x33'),new Buffer(_0x5d3536)['toString'](_0x1b9f('0x34')));}function request(_0x36b6c3){logger[_0x1b9f('0x35')]('[HTTP]',JSON[_0x1b9f('0x36')](_0x36b6c3));return rp(_[_0x1b9f('0x8')](_0x36b6c3,{'method':_0x1b9f('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x250800,_0x3defdd){var _0x5bca49=[];if(_0x250800&&_0x250800[_0x1b9f('0x27')]>0x0){_0x5bca49=_[_0x1b9f('0x38')](_0x250800,_0x3defdd);}return _0x5bca49;}function getCustomFields(_0x5dfef7,_0xcbdd24){var _0x2957bc=[];var _0xd4a07={'custom_fields':[]};if(_0x5dfef7[_0x1b9f('0x27')]>0x0){_[_0x1b9f('0x39')](_0x5dfef7,function(_0x4c6c1f){if(_[_0x1b9f('0x3a')](['string','picklist'],_0x4c6c1f['type'])&&_0x4c6c1f['nameField']&&!_0x4c6c1f[_0x1b9f('0x3b')]){_0xd4a07[_0x4c6c1f[_0x1b9f('0x3c')][_0x1b9f('0x3d')]()]=_0x4c6c1f[_0x1b9f('0x3e')]['toString']();}else if(_[_0x1b9f('0x3a')]([_0x1b9f('0x3f'),_0x1b9f('0x40')],_0x4c6c1f[_0x1b9f('0x41')])&&_0x4c6c1f[_0x1b9f('0x42')]&&_0x4c6c1f[_0x1b9f('0x3b')]){_0xd4a07[_0x1b9f('0x43')][_0x1b9f('0x44')]({'id':_0x4c6c1f[_0x1b9f('0x42')],'value':_0x4c6c1f['content']['toString']()});}else if(_0x4c6c1f['type']===_0x1b9f('0x45')&&_0x4c6c1f[_0x1b9f('0x46')]&&_0x4c6c1f[_0x1b9f('0x42')]&&_0x4c6c1f[_0x1b9f('0x3b')]){_0xcbdd24[_0x4c6c1f[_0x1b9f('0x46')]]&&_0xd4a07[_0x1b9f('0x43')][_0x1b9f('0x44')]({'id':_0x4c6c1f[_0x1b9f('0x42')],'value':_0xcbdd24[_0x4c6c1f[_0x1b9f('0x46')]][_0x1b9f('0x47')]()});}else if(_0x4c6c1f[_0x1b9f('0x41')]==='customVariable'&&_0x4c6c1f[_0x1b9f('0x48')]&&_0x4c6c1f[_0x1b9f('0x48')][_0x1b9f('0x49')]&&_0x4c6c1f['idField']&&_0x4c6c1f['customField']){_0xcbdd24[_0x4c6c1f['Variable'][_0x1b9f('0x49')][_0x1b9f('0x3d')]()]&&_0xd4a07[_0x1b9f('0x43')]['push']({'id':_0x4c6c1f['idField'],'value':_0xcbdd24[_0x4c6c1f['Variable'][_0x1b9f('0x49')][_0x1b9f('0x3d')]()][_0x1b9f('0x47')]()});}});}return _0xd4a07;}exports[_0x1b9f('0x4a')]=function(_0x457215,_0x28c789,_0x385aa6,_0x21b82a,_0xe19d37,_0x23c97f){var _0x528417,_0x2706a3;_0x23c97f['remoteUri']=intUtil[_0x1b9f('0x4b')](_0x23c97f['remoteUri']);_0x23c97f['serverUrl']=intUtil[_0x1b9f('0x4b')](_0x23c97f[_0x1b9f('0x4c')]);if(_0xe19d37&&_0xe19d37['monitor_format']){logger[_0x1b9f('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x28c789[_0x1b9f('0x4d')]=util[_0x1b9f('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23c97f[_0x1b9f('0x4c')],_0x28c789[_0x1b9f('0x4e')],md5(_0x28c789['uniqueid']));}else{_0x28c789[_0x1b9f('0x4d')]='';}headers[_0x1b9f('0x4f')]=getAuth(_0x23c97f);return getUser(_0x23c97f,_0x21b82a['email'])[_0x1b9f('0x18')](function(_0x148d74){_0x528417=_0x148d74;logger[_0x1b9f('0xd')](_0x1b9f('0x50'),_0x528417['id']);return getEndUser(_0x23c97f,_0x28c789['calleridname'],_0x28c789[_0x1b9f('0x51')]);})['then'](function(_0x43c51e){_0x2706a3=_0x43c51e;logger[_0x1b9f('0xd')](_0x1b9f('0x52'),_0x2706a3['id']);return getTicket(_0x23c97f,_0x528417,_0x2706a3,_0x385aa6,_0x28c789);})['then'](function(_0x36f78f){if(_0x36f78f){logger[_0x1b9f('0xd')]('The\x20Ticket\x20ID\x20is:',_0x36f78f['id']);switch(_0x23c97f[_0x1b9f('0x41')]){case _0x1b9f('0x53'):logger[_0x1b9f('0xd')](_0x1b9f('0x54'),_0x1b9f('0x55'));return request({'uri':util[_0x1b9f('0xf')](_0x1b9f('0x56'),_0x23c97f['remoteUri'],_0x528417['id'],_0x36f78f['id']),'method':_0x1b9f('0x12')});case _0x1b9f('0x57'):logger['info'](_0x1b9f('0x54'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x21b82a[_0x1b9f('0x49')]),_0x1b9f('0x58'),{'uri':util[_0x1b9f('0xf')]('%s/agent/tickets/%s',_0x23c97f[_0x1b9f('0x11')]['replace'](_0x1b9f('0x59'),''),_0x36f78f['id'])});break;default:logger['error'](_0x1b9f('0x54'),_0x1b9f('0x5a'));}}})[_0x1b9f('0x5b')](function(_0x514cfb){logger['error'](_0x1b9f('0x5c'),util[_0x1b9f('0x5d')](_0x514cfb,{'showHidden':!![],'depth':null}));});};exports[_0x1b9f('0x5e')]=function(_0x43009b,_0x55a282,_0x276658,_0x401f76,_0x5088c0,_0x47c6c9,_0x416c75){var _0x51e5d3,_0x4e6dee;_0x47c6c9[_0x1b9f('0x11')]=intUtil[_0x1b9f('0x4b')](_0x47c6c9[_0x1b9f('0x11')]);_0x47c6c9[_0x1b9f('0x4c')]=intUtil[_0x1b9f('0x4b')](_0x47c6c9[_0x1b9f('0x4c')]);if(_0x416c75&&_0x416c75[_0x1b9f('0x5f')]&&_0x416c75[_0x1b9f('0x5f')]!==_0x1b9f('0x60')){logger[_0x1b9f('0xd')](_0x1b9f('0x61'),_0x1b9f('0x62'));_0x55a282[_0x1b9f('0x4d')]=util[_0x1b9f('0xf')](_0x1b9f('0x63'),_0x47c6c9[_0x1b9f('0x4c')],_0x55a282[_0x1b9f('0x4e')],md5(_0x55a282[_0x1b9f('0x4e')]));}headers['Authorization']=getAuth(_0x47c6c9);return getUser(_0x47c6c9,_0x401f76[_0x1b9f('0x64')])[_0x1b9f('0x18')](function(_0x5b0c64){_0x51e5d3=_0x5b0c64;logger[_0x1b9f('0xd')]('The\x20User\x20ID\x20is:',_0x51e5d3['id']);return getEndUser(_0x47c6c9,_0x55a282[_0x1b9f('0x65')],_0x55a282[_0x1b9f('0x66')]);})[_0x1b9f('0x18')](function(_0x19d36a){_0x4e6dee=_0x19d36a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4e6dee['id']);return getTicket(_0x47c6c9,_0x51e5d3,_0x4e6dee,_0x276658,_0x55a282);})[_0x1b9f('0x18')](function(_0x56a9f2){if(_0x56a9f2){logger[_0x1b9f('0xd')](_0x1b9f('0x67'),_0x56a9f2['id']);switch(_0x47c6c9['type']){case'integrationTab':logger[_0x1b9f('0xd')](_0x1b9f('0x61'),_0x1b9f('0x55'));return request({'uri':util[_0x1b9f('0xf')](_0x1b9f('0x56'),_0x47c6c9[_0x1b9f('0x11')],_0x51e5d3['id'],_0x56a9f2['id']),'method':_0x1b9f('0x12')});case _0x1b9f('0x57'):logger[_0x1b9f('0xd')](_0x1b9f('0x61'),_0x1b9f('0x68'));emit(util['format'](_0x1b9f('0x69'),_0x401f76[_0x1b9f('0x49')]),_0x1b9f('0x58'),{'uri':util[_0x1b9f('0xf')](_0x1b9f('0x6a'),_0x47c6c9[_0x1b9f('0x11')][_0x1b9f('0x6b')]('/api/v2',''),_0x56a9f2['id'])});break;default:logger['error'](_0x1b9f('0x61'),_0x1b9f('0x5a'));}}})[_0x1b9f('0x5b')](function(_0x22d3e6){logger[_0x1b9f('0x6c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x22d3e6,{'showHidden':!![],'depth':null}));});};exports[_0x1b9f('0x6d')]=function(_0x3ffd26,_0x27101a,_0x109eb5,_0x5a31b5,_0x46dbae,_0x290d82){var _0x1b8973,_0x18f045;_0x290d82[_0x1b9f('0x11')]=intUtil[_0x1b9f('0x4b')](_0x290d82[_0x1b9f('0x11')]);_0x290d82[_0x1b9f('0x4c')]=intUtil[_0x1b9f('0x4b')](_0x290d82[_0x1b9f('0x4c')]);if(_0x46dbae&&_0x46dbae['monitor_format']){logger[_0x1b9f('0xd')]('['+_0x27101a[_0x1b9f('0x6e')][_0x1b9f('0x6f')]()+']',_0x1b9f('0x62'));_0x27101a[_0x1b9f('0x4d')]=util[_0x1b9f('0xf')](_0x1b9f('0x63'),_0x290d82[_0x1b9f('0x4c')],_0x27101a[_0x1b9f('0x4e')],md5(_0x27101a[_0x1b9f('0x4e')]));}else{_0x27101a[_0x1b9f('0x4d')]='';}headers[_0x1b9f('0x4f')]=getAuth(_0x290d82);return getUser(_0x290d82)['then'](function(_0x5098d6){_0x1b8973=_0x5098d6;logger['info']('The\x20User\x20ID\x20is:',_0x1b8973['id']);return getEndUser(_0x290d82,_0x27101a['calleridname'],_0x27101a[_0x1b9f('0x51')]);})[_0x1b9f('0x18')](function(_0x5952d8){_0x18f045=_0x5952d8;logger[_0x1b9f('0xd')](_0x1b9f('0x52'),_0x18f045['id']);return getTicket(_0x290d82,_0x1b8973,_0x18f045,_0x109eb5,_0x27101a);})[_0x1b9f('0x18')](function(_0x5aca6d){if(_0x5aca6d){logger[_0x1b9f('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5aca6d['id']);}})[_0x1b9f('0x5b')](function(_0x11e50b){logger[_0x1b9f('0x6c')]('['+_0x27101a['lastevent'][_0x1b9f('0x6f')]()+']'+_0x1b9f('0x70'),util[_0x1b9f('0x5d')](_0x11e50b,{'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 450131b..fce64cc 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 _0xd46e=['stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','first_name','last_name','code','details','moduleCreate','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','role','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','https://crm.','unmanaged','monitor_format','toUpperCase','lodash','./util','moment','ioredis','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','then','expires_in','catch','error','Failing\x20creating\x20the\x20access_token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd46e,0x1a3));var _0xed46=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd46e[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xed46('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require(_0xed46('0x1'));var moment=require(_0xed46('0x2'));var Redis=require(_0xed46('0x3'));var BPromise=require('bluebird');var config=require(_0xed46('0x4'));var logger=require('../../../../config/logger')(_0xed46('0x5'));config[_0xed46('0x6')]=_[_0xed46('0x7')](config['redis'],{'host':_0xed46('0x8'),'port':0x18eb});var io=require(_0xed46('0x9'))(new Redis(config[_0xed46('0x6')]));function emit(_0x2eb303,_0x3781ca,_0x54323a){io['to'](_0x2eb303)[_0xed46('0xa')](_0x3781ca,_0x54323a);}function request(_0x1a9d7d){logger[_0xed46('0xb')](_0xed46('0xc'),JSON[_0xed46('0xd')](_0x1a9d7d));return rp(_0x1a9d7d);}function getCustomFields(_0xad012,_0x172718){var _0x1db2a7={};if(_0xad012['length']>0x0){_['forEach'](_0xad012,function(_0xe6915a){if(_['includes'](['string',_0xed46('0xe')],_0xe6915a[_0xed46('0xf')])&&_0xe6915a[_0xed46('0x10')]){_0x1db2a7[_0xe6915a['idField']]=_0xe6915a[_0xed46('0x11')][_0xed46('0x12')]();}else if(_0xe6915a[_0xed46('0xf')]===_0xed46('0x13')&&_0xe6915a[_0xed46('0x14')]&&_0xe6915a[_0xed46('0x10')]&&_0x172718[_0xe6915a[_0xed46('0x14')]]){_0x1db2a7[_0xe6915a[_0xed46('0x10')]]=_0x172718[_0xe6915a[_0xed46('0x14')]]['toString']();}else if(_0xe6915a['type']===_0xed46('0x15')&&_0xe6915a[_0xed46('0x16')]&&_0xe6915a['Variable'][_0xed46('0x17')]&&_0xe6915a[_0xed46('0x10')]&&_0x172718[_0xe6915a[_0xed46('0x16')][_0xed46('0x17')][_0xed46('0x18')]()]){_0x1db2a7[_0xe6915a[_0xed46('0x10')]]=_0x172718[_0xe6915a[_0xed46('0x16')][_0xed46('0x17')][_0xed46('0x18')]()]['toString']();}});}return _0x1db2a7;}function getName(_0x42f1e2){if(_0x42f1e2[_0xed46('0x19')]('\x20')>0x0){var _0x21bb76=_0x42f1e2[_0xed46('0x1a')](/ (.+)/);if(_0x21bb76[0x1]){return _0x21bb76;}}return[_0x42f1e2,_0x42f1e2];}var accountsTokens={};function getAccessToken(_0x3f6c9a){return new Promise(function(_0x3d349a,_0x102028){if(!_[_0xed46('0x1b')](accountsTokens[_0x3f6c9a['id']])&&!_[_0xed46('0x1b')](accountsTokens[_0x3f6c9a['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x3f6c9a['id']]['expires_in'])){_0x3d349a(accountsTokens[_0x3f6c9a['id']][_0xed46('0x1c')]);}}var _0x4f8efc;switch(_0x3f6c9a['zone']){case'US':_0x4f8efc=_0xed46('0x1d');break;case'AU':_0x4f8efc=_0xed46('0x1e');break;case'EU':_0x4f8efc=_0xed46('0x1f');break;case'IN':_0x4f8efc=_0xed46('0x20');break;case'CN':_0x4f8efc=_0xed46('0x21');break;default:_0x4f8efc=_0xed46('0x1f');break;}var _0x47849a={'method':_0xed46('0x22'),'uri':_0x4f8efc+_0xed46('0x23'),'qs':{'refresh_token':_0x3f6c9a[_0xed46('0x24')],'client_id':_0x3f6c9a['clientId'],'client_secret':_0x3f6c9a['clientSecret'],'grant_type':_0xed46('0x25')},'json':!![]};return rp(_0x47849a)[_0xed46('0x26')](function(_0x4f8566){accountsTokens[_0x3f6c9a['id']]={'access_token':_0x4f8566[_0xed46('0x1c')],'expires_in':moment()['add'](_0x4f8566[_0xed46('0x27')],'seconds')};_0x3d349a(_0x4f8566[_0xed46('0x1c')]);})[_0xed46('0x28')](function(_0x2290e5){logger[_0xed46('0x29')](_0xed46('0x2a'),_0x2290e5[_0xed46('0x2b')]);_0x102028(_0x2290e5);});});}function getUser(_0x534d09,_0x459033,_0x2587b2,_0x3d3767){logger[_0xed46('0x2c')](_0xed46('0x2d'));return request({'method':_0xed46('0x2e'),'uri':util[_0xed46('0x2f')](_0xed46('0x30'),_0x459033),'qs':{'type':_0xed46('0x31')},'headers':{'Authorization':_0xed46('0x32')+_0x534d09},'json':!![]})['then'](function(_0x25abf0){if(_0x25abf0['users']){var _0x1244e1=-0x1;if(_[_0xed46('0x33')](_0x25abf0['users'])){if(!_[_0xed46('0x1b')](_0x3d3767)){_0x1244e1=_[_0xed46('0x34')](_0x25abf0[_0xed46('0x35')],function(_0x4b7631){return _0x4b7631[_0xed46('0x36')]===_0x3d3767;});}if(_0x1244e1>=0x0){logger[_0xed46('0x2c')](_0xed46('0x37'));}else{logger[_0xed46('0x2c')](_0xed46('0x38'));_0x1244e1=_[_0xed46('0x34')](_0x25abf0['users'],function(_0x2e0278){return _0x2e0278[_0xed46('0x39')][_0xed46('0x17')]==='Administrator';});}return _0x25abf0[_0xed46('0x35')][_0x1244e1];}else{if(_0x25abf0[_0xed46('0x3a')][_0xed46('0x39')][_0xed46('0x17')]===_0xed46('0x3b')){logger[_0xed46('0x2c')](_0xed46('0x38'));user=_0x25abf0[_0xed46('0x3a')];return user;}else{logger[_0xed46('0x29')](_0xed46('0x3c'),JSON[_0xed46('0xd')](_0x25abf0));throw new Error(_0xed46('0x3d')+JSON[_0xed46('0xd')](_0x25abf0));}}}else{logger[_0xed46('0x29')](_0xed46('0x3c'),JSON[_0xed46('0xd')](_0x25abf0));throw new Error(_0xed46('0x3d')+JSON[_0xed46('0xd')](_0x25abf0));}})[_0xed46('0x28')](function(_0xc25679){console[_0xed46('0x29')](_0xc25679);});}function getZohoUser(_0x2d4737,_0x37a7a5){return new BPromise(function(_0x2e442f,_0x27fc8d){request(_0x2d4737)[_0xed46('0x26')](function(_0x3b9873){var _0x2e06f7=null;if(_0x3b9873){_0x2e06f7=_0x3b9873[_0xed46('0x3e')][0x0];_0x2e06f7[_0xed46('0x3f')]=_0x37a7a5;}_0x2e442f(_0x2e06f7);})[_0xed46('0x28')](function(_0x50505d){_0x27fc8d(_0x50505d);});});}function createEndUser(_0xbfbae9,_0x45048e,_0xa856ce,_0xb0ff62,_0x41c3cf,_0x2f5eeb){var _0xa856ce=getName(_0xa856ce);return request({'method':_0xed46('0x22'),'uri':_0xed46('0x40')+_0x45048e+'/crm/v2/'+_[_0xed46('0x41')](_0x2f5eeb['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xa856ce[0x1],'First_Name':_0xa856ce[0x0],'Phone':_0xb0ff62,'Owner':{'name':!_['isNil'](_0x41c3cf['role'][_0xed46('0x17')])?_0x41c3cf['role'][_0xed46('0x17')]:!_[_0xed46('0x1b')](_0x41c3cf[_0xed46('0x42')])?_0x41c3cf[_0xed46('0x42')]+'\x20'+_0x41c3cf[_0xed46('0x43')]:_0x41c3cf['last_name'],'id':_0x41c3cf['id']}}]},'headers':{'Authorization':_0xed46('0x32')+_0xbfbae9},'json':!![]})[_0xed46('0x26')](function(_0x57b9c3){if(_0x57b9c3&&_0x57b9c3[_0xed46('0x3e')][0x0][_0xed46('0x44')]==='SUCCESS'){var _0x4f3613=_0x57b9c3[_0xed46('0x3e')][0x0][_0xed46('0x45')];_0x4f3613[_0xed46('0x3f')]=_[_0xed46('0x41')](_0x2f5eeb[_0xed46('0x46')])+'s';return _0x4f3613;}logger[_0xed46('0x29')]('The\x20failing\x20result\x20is',JSON[_0xed46('0xd')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xed46('0x28')](function(_0x1f7165){console[_0xed46('0x47')](_0xed46('0x48'),_0x1f7165);});}function getEndUser(_0x25ce85,_0x4748cd,_0x19875e,_0x428f51,_0xf8da60,_0x45d5aa,_0x3aa689){var _0x37c524={'method':'GET','uri':'','headers':{'Authorization':_0xed46('0x32')+_0x25ce85},'json':!![]};switch(_0x3aa689[_0xed46('0x49')]){case _0xed46('0x4a'):_0x37c524[_0xed46('0x4b')]=_0xed46('0x40')+_0x4748cd+_0xed46('0x4c')+_0xf8da60+'))';return getZohoUser(_0x37c524,_0xed46('0x4d'))[_0xed46('0x26')](function(_0x3f35a3){if(_0x3f35a3)return _0x3f35a3;_0x37c524[_0xed46('0x4b')]=_0xed46('0x40')+_0x4748cd+_0xed46('0x4e')+_0xf8da60+'))';return getZohoUser(_0x37c524,_0xed46('0x4f'))[_0xed46('0x26')](function(_0x5be7f4){if(_0x5be7f4)return _0x5be7f4;if(_0x3aa689[_0xed46('0x46')]!=_0xed46('0x50')){return createEndUser(_0x25ce85,_0x4748cd,_0x428f51,_0xf8da60,_0x45d5aa,_0x3aa689);}else{return{};}});});break;case _0xed46('0x51'):_0x37c524[_0xed46('0x4b')]='https://www.zohoapis.'+_0x4748cd+_0xed46('0x4c')+_0xf8da60+'))';return getZohoUser(_0x37c524,'Contacts')[_0xed46('0x26')](function(_0x22bda4){if(_0x22bda4)return _0x22bda4;if(_0x3aa689['moduleCreate']!='nothing'){return createEndUser(_0x25ce85,_0x4748cd,_0x428f51,_0xf8da60,_0x45d5aa,_0x3aa689);}else{return{};}});break;case _0xed46('0x52'):_0x37c524[_0xed46('0x4b')]=_0xed46('0x40')+_0x4748cd+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xf8da60+'))';return getZohoUser(_0x37c524,_0xed46('0x4f'))['then'](function(_0x1d5c6f){if(_0x1d5c6f)return _0x1d5c6f;if(_0x3aa689[_0xed46('0x46')]!='nothing'){return createEndUser(_0x25ce85,_0x4748cd,_0x428f51,_0xf8da60,_0x45d5aa,_0x3aa689);}else{return{};}});break;}}function getCall(_0x326258,_0x40b1ca,_0x221bf3,_0xfe38f6,_0x2e90be,_0x44eb5b,_0x5d9232,_0x393fb0){logger[_0xed46('0x2c')](_0xed46('0x53'));var _0x169622={};_0x169622[_0xed46('0x54')]={'name':!_['isNil'](_0xfe38f6[_0xed46('0x55')][_0xed46('0x17')])&&!_[_0xed46('0x1b')](_0xfe38f6[_0xed46('0x39')][_0xed46('0x17')])&&_0xfe38f6[_0xed46('0x39')]['name']===_0xed46('0x56')?_0xfe38f6['role'][_0xed46('0x17')]:!_[_0xed46('0x1b')](_0xfe38f6[_0xed46('0x42')])?_0xfe38f6[_0xed46('0x42')]+'\x20'+_0xfe38f6['last_name']:_0xfe38f6[_0xed46('0x43')],'id':_0xfe38f6['id']};_0x169622[_0xed46('0x57')]=intUtil[_0xed46('0x58')](_0x44eb5b[_0xed46('0x59')],_0x5d9232,'\x20');_0x169622[_0xed46('0x5a')]=intUtil[_0xed46('0x58')](_0x44eb5b[_0xed46('0x5b')],_0x5d9232,'\x0a');if(_0x2e90be[_0xed46('0x3f')]===_0xed46('0x4d')){_0x169622['Who_Id']={'name':!_['isNil'](_0x2e90be[_0xed46('0x5c')])?_0x2e90be[_0xed46('0x5c')]:!_['isNil'](_0x2e90be[_0xed46('0x5d')])?_0x2e90be[_0xed46('0x5d')]+'\x20'+_0x2e90be[_0xed46('0x5e')]:_0x2e90be[_0xed46('0x5e')],'id':_0x2e90be['id']};}if(_0x2e90be['enduserType']==='Leads'){_0x169622[_0xed46('0x5f')]={'name':!_[_0xed46('0x1b')](_0x2e90be[_0xed46('0x5c')])?_0x2e90be[_0xed46('0x5c')]:!_[_0xed46('0x1b')](_0x2e90be['First_Name'])?_0x2e90be[_0xed46('0x5d')]+'\x20'+_0x2e90be[_0xed46('0x5e')]:_0x2e90be[_0xed46('0x5e')],'id':_0x2e90be['id']};_0x169622[_0xed46('0x60')]=_['startCase'](_0x2e90be[_0xed46('0x3f')]);}if(_0x5d9232[_0xed46('0x61')]){_0x169622[_0xed46('0x62')]=moment[_0xed46('0x63')](parseInt(_0x5d9232[_0xed46('0x61')])*0x3e8)[_0xed46('0x2f')](_0xed46('0x64'));}else if(_0x5d9232[_0xed46('0x65')]&&_0x5d9232['endtime']){_0x169622[_0xed46('0x62')]=moment[_0xed46('0x63')](moment(_0x5d9232[_0xed46('0x66')],_0xed46('0x67'))[_0xed46('0x68')](moment(_0x5d9232[_0xed46('0x69')],'YYYY-MM-DDTHH:mm:ss')))[_0xed46('0x2f')]('mm:ss');}switch(_0x5d9232[_0xed46('0x6a')]){case'called':_0x169622[_0xed46('0x6b')]=_0xed46('0x6c');break;case _0xed46('0x6d'):case _0xed46('0x6e'):_0x169622[_0xed46('0x6b')]=_0xed46('0x6f');break;case'rejected':_0x169622[_0xed46('0x6b')]='Rejected';break;case _0xed46('0x70'):_0x169622['Call_Result']=_0xed46('0x71');break;case _0xed46('0x72'):_0x169622[_0xed46('0x6b')]=_0xed46('0x73');default:}_0x169622[_0xed46('0x74')]=(_0x393fb0===_0xed46('0x75')?moment(_0x5d9232['starttime'])[_0xed46('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5d9232[_0xed46('0x76')])[_0xed46('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xed46('0x2f')](_0xed46('0x67'));_0x169622[_0xed46('0x77')]=_0x393fb0||_0xed46('0x78');_0x169622=_[_0xed46('0x79')](_0x169622,getCustomFields(_0x44eb5b['Fields'],_0x5d9232));return request({'method':'POST','uri':_0xed46('0x40')+_0x40b1ca+_0xed46('0x7a'),'headers':{'Authorization':_0xed46('0x32')+_0x326258},'body':{'data':[_0x169622]},'json':!![]})[_0xed46('0x26')](function(_0x3991b1){if(_0x3991b1&&_0x3991b1['data'][0x0][_0xed46('0x44')]===_0xed46('0x7b')){logger[_0xed46('0x2c')](_0xed46('0x7c'));return{'id':_0x3991b1['data'][0x0][_0xed46('0x45')]['id']};}})[_0xed46('0x28')](function(_0x1f7639){logger[_0xed46('0x2c')](_0xed46('0x7d'),_0x1f7639[_0xed46('0x2b')]);console[_0xed46('0x47')](_0xed46('0x7d'),_0x1f7639);});}exports[_0xed46('0x7e')]=function(_0x13ab94,_0x468429,_0x25d7c1,_0x513b03,_0x2f38d9,_0x3a1b7f){var _0x3ccdc7,_0x542697,_0x30097d;_0x3a1b7f[_0xed46('0x7f')]=intUtil[_0xed46('0x80')](_0x3a1b7f['host']);_0x3a1b7f[_0xed46('0x81')]=intUtil[_0xed46('0x80')](_0x3a1b7f[_0xed46('0x81')]);if(_0x2f38d9&&_0x2f38d9['monitor_format']){logger[_0xed46('0x2c')](_0xed46('0x82'),_0xed46('0x83'));_0x468429['recordingURL']=_0x3a1b7f[_0xed46('0x81')]+_0xed46('0x84')+_0x468429[_0xed46('0x85')]+_0xed46('0x86')+md5(_0x468429[_0xed46('0x85')]);}else{_0x468429[_0xed46('0x87')]='';}var _0x4845da=_0x3a1b7f[_0xed46('0x7f')]===_0xed46('0x88')?'eu':_0xed46('0x89');return getAccessToken(_0x3a1b7f)['then'](function(_0x2d6cc1){_0x30097d=_0x2d6cc1;return getUser(_0x30097d,_0x4845da,_0x3a1b7f,_0x513b03[_0xed46('0x36')]);})[_0xed46('0x26')](function(_0x33f75b){_0x3ccdc7=_0x33f75b;logger[_0xed46('0x2c')](_0xed46('0x8a'),_0x3ccdc7['id']);return getEndUser(_0x30097d,_0x4845da,_0x3a1b7f,_0x468429[_0xed46('0x8b')],_0x468429['calleridnum'],_0x3ccdc7,_0x25d7c1);})['then'](function(_0x4d9918){_0x542697=_0x4d9918;return getCall(_0x30097d,_0x4845da,_0x3a1b7f,_0x3ccdc7,_0x542697,_0x25d7c1,_0x468429,'Inbound');})['then'](function(_0x235299){if(_0x235299){logger[_0xed46('0x2c')]('The\x20Call\x20ID\x20is:',_0x235299['id']);logger[_0xed46('0x2c')](_0xed46('0x82'),_0xed46('0x8c'));emit(util[_0xed46('0x2f')](_0xed46('0x8d'),_0x513b03[_0xed46('0x17')]),_0xed46('0x8e'),{'uri':'https://crm.'+_0x3a1b7f[_0xed46('0x7f')]+_0xed46('0x8f')+_0x235299['id']});}})[_0xed46('0x28')](function(_0x1954a8){logger[_0xed46('0x29')](_0xed46('0x82'),JSON[_0xed46('0xd')](_0x1954a8));});};exports[_0xed46('0x75')]=function(_0x31185a,_0x310641,_0x30bd06,_0x44826c,_0x4cda63,_0x154197,_0x1f62b3){var _0x4a6472,_0x500925,_0x4774e9;_0x154197[_0xed46('0x7f')]=intUtil[_0xed46('0x80')](_0x154197[_0xed46('0x7f')]);_0x154197[_0xed46('0x81')]=intUtil[_0xed46('0x80')](_0x154197[_0xed46('0x81')]);if(_0x1f62b3&&_0x1f62b3[_0xed46('0x90')]&&_0x1f62b3[_0xed46('0x90')]!=='none'){logger['info']('[OUTBOUND]',_0xed46('0x83'));_0x310641[_0xed46('0x87')]=_0x154197[_0xed46('0x81')]+_0xed46('0x84')+_0x310641[_0xed46('0x85')]+'/downloads?type=uniqueid&token='+md5(_0x310641[_0xed46('0x85')]);}var _0x2d5d63=_0x154197['host']===_0xed46('0x88')?'eu':_0xed46('0x89');return getAccessToken(_0x154197)[_0xed46('0x26')](function(_0x195bcd){_0x4774e9=_0x195bcd;return getUser(_0x4774e9,_0x2d5d63,_0x154197,_0x44826c[_0xed46('0x36')]);})['then'](function(_0x2bafe1){_0x4a6472=_0x2bafe1;logger['info'](_0xed46('0x8a'),_0x4a6472['id']);return getEndUser(_0x4774e9,_0x2d5d63,_0x154197,_0x310641[_0xed46('0x91')],_0x310641[_0xed46('0x92')],_0x4a6472,_0x30bd06);})['then'](function(_0x1d9aef){_0x500925=_0x1d9aef;return getCall(_0x4774e9,_0x2d5d63,_0x154197,_0x4a6472,_0x500925,_0x30bd06,_0x310641,_0xed46('0x93'));})[_0xed46('0x26')](function(_0x46f195){if(_0x46f195){logger[_0xed46('0x2c')](_0xed46('0x94'),_0x46f195['id']);logger['info'](_0xed46('0x95'),_0xed46('0x8c'));emit(util[_0xed46('0x2f')](_0xed46('0x8d'),_0x44826c[_0xed46('0x17')]),'trigger:browser:url',{'uri':_0xed46('0x96')+_0x154197[_0xed46('0x7f')]+_0xed46('0x8f')+_0x46f195['id']});}})[_0xed46('0x28')](function(_0x475712){logger[_0xed46('0x29')]('[OUTBOUND]',JSON['stringify'](_0x475712));});};exports[_0xed46('0x97')]=function(_0xddc5ce,_0x5c1b32,_0x88cc06,_0x34807b,_0x407105,_0x23ae47){var _0x582435,_0x5073f4,_0x2600ff;_0x23ae47[_0xed46('0x7f')]=intUtil[_0xed46('0x80')](_0x23ae47[_0xed46('0x7f')]);_0x23ae47[_0xed46('0x81')]=intUtil[_0xed46('0x80')](_0x23ae47[_0xed46('0x81')]);if(_0x407105&&_0x407105[_0xed46('0x98')]){logger['info']('['+_0x5c1b32[_0xed46('0x6a')][_0xed46('0x99')]()+']',_0xed46('0x83'));_0x5c1b32['recordingURL']=_0x23ae47[_0xed46('0x81')]+_0xed46('0x84')+_0x5c1b32['uniqueid']+_0xed46('0x86')+md5(_0x5c1b32['uniqueid']);}else{_0x5c1b32[_0xed46('0x87')]='';}var _0x2f25b0=_0x23ae47[_0xed46('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x23ae47)[_0xed46('0x26')](function(_0x47ad21){_0x2600ff=_0x47ad21;return getUser(_0x2600ff,_0x2f25b0,_0x23ae47);})['then'](function(_0x45e317){_0x582435=_0x45e317;logger[_0xed46('0x2c')](_0xed46('0x8a'),_0x582435['id']);return getEndUser(_0x2600ff,_0x2f25b0,_0x23ae47,_0x5c1b32[_0xed46('0x8b')],_0x5c1b32['calleridnum'],_0x582435,_0x88cc06);})[_0xed46('0x26')](function(_0x2c0aca){_0x5073f4=_0x2c0aca;return getCall(_0x2600ff,_0x2f25b0,_0x23ae47,_0x582435,_0x5073f4,_0x88cc06,_0x5c1b32,_0xed46('0x78'));})[_0xed46('0x26')](function(_0x47a6c3){if(_0x47a6c3){logger[_0xed46('0x2c')](_0xed46('0x94'),_0x47a6c3['id']);}})[_0xed46('0x28')](function(_0x39ca70){logger[_0xed46('0x29')]('['+_0x5c1b32['lastevent'][_0xed46('0x99')]()+']',JSON[_0xed46('0xd')](_0x39ca70));});}; \ No newline at end of file +var _0xa7c1=['moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','Creating\x20new\x20call...','Owner','Subject','Subjects','Description','getString','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','Answered','rejected','Rejected','Abandoned','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','user:%s','https://crm.','unmanaged','toUpperCase','lodash','request-promise','md5','./util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','name','toLowerCase','Variable','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details'];(function(_0x535386,_0x2b775c){var _0x277985=function(_0x3315a9){while(--_0x3315a9){_0x535386['push'](_0x535386['shift']());}};_0x277985(++_0x2b775c);}(_0xa7c1,0xe6));var _0x1a7c=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xa7c1[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x1a7c('0x0'));var rp=require(_0x1a7c('0x1'));var md5=require(_0x1a7c('0x2'));var util=require('util');var intUtil=require(_0x1a7c('0x3'));var moment=require('moment');var Redis=require(_0x1a7c('0x4'));var BPromise=require(_0x1a7c('0x5'));var config=require(_0x1a7c('0x6'));var logger=require('../../../../config/logger')(_0x1a7c('0x7'));config[_0x1a7c('0x8')]=_[_0x1a7c('0x9')](config[_0x1a7c('0x8')],{'host':_0x1a7c('0xa'),'port':0x18eb});var io=require(_0x1a7c('0xb'))(new Redis(config[_0x1a7c('0x8')]));function emit(_0x29c6e8,_0x47724f,_0x2888da){io['to'](_0x29c6e8)[_0x1a7c('0xc')](_0x47724f,_0x2888da);}function request(_0x317a56){logger['debug'](_0x1a7c('0xd'),JSON[_0x1a7c('0xe')](_0x317a56));return rp(_0x317a56);}function getCustomFields(_0x2dc455,_0x15aede){var _0x2bc1cf={};if(_0x2dc455[_0x1a7c('0xf')]>0x0){_[_0x1a7c('0x10')](_0x2dc455,function(_0xaef23d){if(_['includes']([_0x1a7c('0x11'),_0x1a7c('0x12')],_0xaef23d[_0x1a7c('0x13')])&&_0xaef23d[_0x1a7c('0x14')]){_0x2bc1cf[_0xaef23d[_0x1a7c('0x14')]]=_0xaef23d[_0x1a7c('0x15')][_0x1a7c('0x16')]();}else if(_0xaef23d['type']===_0x1a7c('0x17')&&_0xaef23d['variableName']&&_0xaef23d[_0x1a7c('0x14')]&&_0x15aede[_0xaef23d[_0x1a7c('0x18')]]){_0x2bc1cf[_0xaef23d[_0x1a7c('0x14')]]=_0x15aede[_0xaef23d[_0x1a7c('0x18')]][_0x1a7c('0x16')]();}else if(_0xaef23d[_0x1a7c('0x13')]===_0x1a7c('0x19')&&_0xaef23d['Variable']&&_0xaef23d['Variable'][_0x1a7c('0x1a')]&&_0xaef23d[_0x1a7c('0x14')]&&_0x15aede[_0xaef23d['Variable']['name'][_0x1a7c('0x1b')]()]){_0x2bc1cf[_0xaef23d['idField']]=_0x15aede[_0xaef23d[_0x1a7c('0x1c')][_0x1a7c('0x1a')][_0x1a7c('0x1b')]()][_0x1a7c('0x16')]();}});}return _0x2bc1cf;}function getName(_0x5b517c){if(_0x5b517c[_0x1a7c('0x1d')]('\x20')>0x0){var _0x4db6c0=_0x5b517c['split'](/ (.+)/);if(_0x4db6c0[0x1]){return _0x4db6c0;}}return[_0x5b517c,_0x5b517c];}var accountsTokens={};function getAccessToken(_0x992d7a){return new Promise(function(_0xc45616,_0x5e003f){if(!_['isNil'](accountsTokens[_0x992d7a['id']])&&!_[_0x1a7c('0x1e')](accountsTokens[_0x992d7a['id']][_0x1a7c('0x1f')])){if(moment()[_0x1a7c('0x20')](accountsTokens[_0x992d7a['id']][_0x1a7c('0x21')])){_0xc45616(accountsTokens[_0x992d7a['id']][_0x1a7c('0x1f')]);}}var _0x4aa2fd;switch(_0x992d7a['zone']){case'US':_0x4aa2fd='https://accounts.zoho.com';break;case'AU':_0x4aa2fd=_0x1a7c('0x22');break;case'EU':_0x4aa2fd=_0x1a7c('0x23');break;case'IN':_0x4aa2fd=_0x1a7c('0x24');break;case'CN':_0x4aa2fd='https://accounts.zoho.com.cn';break;default:_0x4aa2fd=_0x1a7c('0x23');break;}var _0x23e5d9={'method':_0x1a7c('0x25'),'uri':_0x4aa2fd+_0x1a7c('0x26'),'qs':{'refresh_token':_0x992d7a[_0x1a7c('0x27')],'client_id':_0x992d7a['clientId'],'client_secret':_0x992d7a[_0x1a7c('0x28')],'grant_type':_0x1a7c('0x29')},'json':!![]};return rp(_0x23e5d9)[_0x1a7c('0x2a')](function(_0x1aa955){accountsTokens[_0x992d7a['id']]={'access_token':_0x1aa955['access_token'],'expires_in':moment()[_0x1a7c('0x2b')](_0x1aa955[_0x1a7c('0x21')],_0x1a7c('0x2c'))};_0xc45616(_0x1aa955['access_token']);})['catch'](function(_0x1f7b08){logger[_0x1a7c('0x2d')](_0x1a7c('0x2e'),_0x1f7b08[_0x1a7c('0x2f')]);_0x5e003f(_0x1f7b08);});});}function getUser(_0x4933f6,_0xdaf4d5,_0x367636,_0x556b71){logger[_0x1a7c('0x30')]('Search\x20user');return request({'method':_0x1a7c('0x31'),'uri':util[_0x1a7c('0x32')](_0x1a7c('0x33'),_0xdaf4d5),'qs':{'type':_0x1a7c('0x34')},'headers':{'Authorization':_0x1a7c('0x35')+_0x4933f6},'json':!![]})[_0x1a7c('0x2a')](function(_0x4bcb1f){if(_0x4bcb1f[_0x1a7c('0x36')]){var _0x538f64=-0x1;if(_[_0x1a7c('0x37')](_0x4bcb1f[_0x1a7c('0x36')])){if(!_[_0x1a7c('0x1e')](_0x556b71)){_0x538f64=_['findIndex'](_0x4bcb1f[_0x1a7c('0x36')],function(_0x323f48){return _0x323f48[_0x1a7c('0x38')]===_0x556b71;});}if(_0x538f64>=0x0){logger[_0x1a7c('0x30')]('Agent\x20found!');}else{logger['info'](_0x1a7c('0x39'));_0x538f64=_[_0x1a7c('0x3a')](_0x4bcb1f[_0x1a7c('0x36')],function(_0x3cbb4a){return _0x3cbb4a['profile'][_0x1a7c('0x1a')]===_0x1a7c('0x3b');});}return _0x4bcb1f[_0x1a7c('0x36')][_0x538f64];}else{if(_0x4bcb1f[_0x1a7c('0x3c')][_0x1a7c('0x3d')][_0x1a7c('0x1a')]===_0x1a7c('0x3b')){logger[_0x1a7c('0x30')](_0x1a7c('0x39'));user=_0x4bcb1f[_0x1a7c('0x3c')];return user;}else{logger[_0x1a7c('0x2d')](_0x1a7c('0x3e'),JSON[_0x1a7c('0xe')](_0x4bcb1f));throw new Error(_0x1a7c('0x3f')+JSON['stringify'](_0x4bcb1f));}}}else{logger[_0x1a7c('0x2d')](_0x1a7c('0x3e'),JSON[_0x1a7c('0xe')](_0x4bcb1f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x1a7c('0xe')](_0x4bcb1f));}})[_0x1a7c('0x40')](function(_0x3ff5bf){console[_0x1a7c('0x2d')](_0x3ff5bf);});}function getZohoUser(_0x227ab5,_0x3ed384){return new BPromise(function(_0x21c7fb,_0x29425c){request(_0x227ab5)[_0x1a7c('0x2a')](function(_0x56b54b){var _0x5df5bc=null;if(_0x56b54b){_0x5df5bc=_0x56b54b[_0x1a7c('0x41')][0x0];_0x5df5bc[_0x1a7c('0x42')]=_0x3ed384;}_0x21c7fb(_0x5df5bc);})['catch'](function(_0x56928a){_0x29425c(_0x56928a);});});}function createEndUser(_0xcba2f9,_0x988313,_0x3b9b8b,_0x24e373,_0x57a8f4,_0x4dc9a0){var _0x3b9b8b=getName(_0x3b9b8b);return request({'method':_0x1a7c('0x25'),'uri':_0x1a7c('0x43')+_0x988313+_0x1a7c('0x44')+_[_0x1a7c('0x45')](_0x4dc9a0['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3b9b8b[0x1],'First_Name':_0x3b9b8b[0x0],'Phone':_0x24e373,'Owner':{'name':!_[_0x1a7c('0x1e')](_0x57a8f4[_0x1a7c('0x46')][_0x1a7c('0x1a')])?_0x57a8f4[_0x1a7c('0x46')][_0x1a7c('0x1a')]:!_[_0x1a7c('0x1e')](_0x57a8f4['first_name'])?_0x57a8f4[_0x1a7c('0x47')]+'\x20'+_0x57a8f4[_0x1a7c('0x48')]:_0x57a8f4[_0x1a7c('0x48')],'id':_0x57a8f4['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xcba2f9},'json':!![]})[_0x1a7c('0x2a')](function(_0x55c749){if(_0x55c749&&_0x55c749['data'][0x0][_0x1a7c('0x49')]===_0x1a7c('0x4a')){var _0x164c80=_0x55c749['data'][0x0][_0x1a7c('0x4b')];_0x164c80['enduserType']=_[_0x1a7c('0x45')](_0x4dc9a0[_0x1a7c('0x4c')])+'s';return _0x164c80;}logger[_0x1a7c('0x2d')]('The\x20failing\x20result\x20is',JSON[_0x1a7c('0xe')](data));throw new Error(_0x1a7c('0x4d')+JSON[_0x1a7c('0xe')](data));})[_0x1a7c('0x40')](function(_0x5d886e){console[_0x1a7c('0x4e')](_0x1a7c('0x4f'),_0x5d886e);});}function getEndUser(_0x3e6618,_0x432c7b,_0x1825df,_0x466785,_0x56fe64,_0x3dc19e,_0x1d657c){var _0x345155={'method':_0x1a7c('0x31'),'uri':'','headers':{'Authorization':_0x1a7c('0x35')+_0x3e6618},'json':!![]};switch(_0x1d657c[_0x1a7c('0x50')]){case _0x1a7c('0x51'):_0x345155['uri']=_0x1a7c('0x43')+_0x432c7b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x56fe64+'))';return getZohoUser(_0x345155,'Contacts')[_0x1a7c('0x2a')](function(_0x249a68){if(_0x249a68)return _0x249a68;_0x345155[_0x1a7c('0x52')]=_0x1a7c('0x43')+_0x432c7b+_0x1a7c('0x53')+_0x56fe64+'))';return getZohoUser(_0x345155,'Leads')[_0x1a7c('0x2a')](function(_0xcfd703){if(_0xcfd703)return _0xcfd703;if(_0x1d657c['moduleCreate']!=_0x1a7c('0x54')){return createEndUser(_0x3e6618,_0x432c7b,_0x466785,_0x56fe64,_0x3dc19e,_0x1d657c);}else{return{};}});});break;case'contact':_0x345155[_0x1a7c('0x52')]=_0x1a7c('0x43')+_0x432c7b+_0x1a7c('0x55')+_0x56fe64+'))';return getZohoUser(_0x345155,_0x1a7c('0x56'))[_0x1a7c('0x2a')](function(_0x23ddb4){if(_0x23ddb4)return _0x23ddb4;if(_0x1d657c[_0x1a7c('0x4c')]!=_0x1a7c('0x54')){return createEndUser(_0x3e6618,_0x432c7b,_0x466785,_0x56fe64,_0x3dc19e,_0x1d657c);}else{return{};}});break;case'lead':_0x345155[_0x1a7c('0x52')]=_0x1a7c('0x43')+_0x432c7b+_0x1a7c('0x53')+_0x56fe64+'))';return getZohoUser(_0x345155,_0x1a7c('0x57'))[_0x1a7c('0x2a')](function(_0xdfdf18){if(_0xdfdf18)return _0xdfdf18;if(_0x1d657c[_0x1a7c('0x4c')]!='nothing'){return createEndUser(_0x3e6618,_0x432c7b,_0x466785,_0x56fe64,_0x3dc19e,_0x1d657c);}else{return{};}});break;}}function getCall(_0x252037,_0xe52bd0,_0x33eede,_0x432898,_0x2fe7de,_0x39d733,_0x106268,_0x27337c){logger[_0x1a7c('0x30')](_0x1a7c('0x58'));var _0x2d0a4e={};_0x2d0a4e[_0x1a7c('0x59')]={'name':!_['isNil'](_0x432898['role']['name'])&&!_['isNil'](_0x432898[_0x1a7c('0x3d')][_0x1a7c('0x1a')])&&_0x432898[_0x1a7c('0x3d')][_0x1a7c('0x1a')]==='administrator'?_0x432898[_0x1a7c('0x46')]['name']:!_[_0x1a7c('0x1e')](_0x432898[_0x1a7c('0x47')])?_0x432898[_0x1a7c('0x47')]+'\x20'+_0x432898[_0x1a7c('0x48')]:_0x432898[_0x1a7c('0x48')],'id':_0x432898['id']};_0x2d0a4e[_0x1a7c('0x5a')]=intUtil['getString'](_0x39d733[_0x1a7c('0x5b')],_0x106268,'\x20');_0x2d0a4e[_0x1a7c('0x5c')]=intUtil[_0x1a7c('0x5d')](_0x39d733['Descriptions'],_0x106268,'\x0a');if(_0x2fe7de[_0x1a7c('0x42')]===_0x1a7c('0x56')){_0x2d0a4e['Who_Id']={'name':!_[_0x1a7c('0x1e')](_0x2fe7de[_0x1a7c('0x5e')])?_0x2fe7de['Full_Name']:!_[_0x1a7c('0x1e')](_0x2fe7de[_0x1a7c('0x5f')])?_0x2fe7de[_0x1a7c('0x5f')]+'\x20'+_0x2fe7de[_0x1a7c('0x60')]:_0x2fe7de[_0x1a7c('0x60')],'id':_0x2fe7de['id']};}if(_0x2fe7de[_0x1a7c('0x42')]===_0x1a7c('0x57')){_0x2d0a4e[_0x1a7c('0x61')]={'name':!_[_0x1a7c('0x1e')](_0x2fe7de[_0x1a7c('0x5e')])?_0x2fe7de['Full_Name']:!_[_0x1a7c('0x1e')](_0x2fe7de[_0x1a7c('0x5f')])?_0x2fe7de[_0x1a7c('0x5f')]+'\x20'+_0x2fe7de[_0x1a7c('0x60')]:_0x2fe7de['Last_Name'],'id':_0x2fe7de['id']};_0x2d0a4e[_0x1a7c('0x62')]=_[_0x1a7c('0x45')](_0x2fe7de[_0x1a7c('0x42')]);}if(_0x106268[_0x1a7c('0x63')]){_0x2d0a4e['Call_Duration']=moment[_0x1a7c('0x64')](parseInt(_0x106268[_0x1a7c('0x63')])*0x3e8)[_0x1a7c('0x32')](_0x1a7c('0x65'));}else if(_0x106268['answertime']&&_0x106268[_0x1a7c('0x66')]){_0x2d0a4e['Call_Duration']=moment[_0x1a7c('0x64')](moment(_0x106268[_0x1a7c('0x66')],_0x1a7c('0x67'))[_0x1a7c('0x68')](moment(_0x106268[_0x1a7c('0x69')],_0x1a7c('0x67'))))['format']('mm:ss');}switch(_0x106268[_0x1a7c('0x6a')]){case _0x1a7c('0x6b'):_0x2d0a4e[_0x1a7c('0x6c')]=_0x1a7c('0x6d');break;case'complete':case'connect':_0x2d0a4e[_0x1a7c('0x6c')]=_0x1a7c('0x6e');break;case _0x1a7c('0x6f'):_0x2d0a4e[_0x1a7c('0x6c')]=_0x1a7c('0x70');break;case'abandoned':_0x2d0a4e[_0x1a7c('0x6c')]=_0x1a7c('0x71');break;case'timeout':_0x2d0a4e[_0x1a7c('0x6c')]='Timeout';default:}_0x2d0a4e['Call_Start_Time']=(_0x27337c==='outbound'?moment(_0x106268[_0x1a7c('0x69')])[_0x1a7c('0x32')](_0x1a7c('0x67')):moment(_0x106268[_0x1a7c('0x72')])[_0x1a7c('0x32')](_0x1a7c('0x67')))||moment()[_0x1a7c('0x32')](_0x1a7c('0x67'));_0x2d0a4e[_0x1a7c('0x73')]=_0x27337c||_0x1a7c('0x74');_0x2d0a4e=_[_0x1a7c('0x75')](_0x2d0a4e,getCustomFields(_0x39d733[_0x1a7c('0x76')],_0x106268));return request({'method':_0x1a7c('0x25'),'uri':_0x1a7c('0x43')+_0xe52bd0+_0x1a7c('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x252037},'body':{'data':[_0x2d0a4e]},'json':!![]})[_0x1a7c('0x2a')](function(_0x46efe6){if(_0x46efe6&&_0x46efe6[_0x1a7c('0x41')][0x0][_0x1a7c('0x49')]===_0x1a7c('0x4a')){logger[_0x1a7c('0x30')](_0x1a7c('0x78'));return{'id':_0x46efe6['data'][0x0][_0x1a7c('0x4b')]['id']};}})[_0x1a7c('0x40')](function(_0x54ad6d){logger[_0x1a7c('0x30')](_0x1a7c('0x79'),_0x54ad6d['stack']);console[_0x1a7c('0x4e')]('err',_0x54ad6d);});}exports[_0x1a7c('0x7a')]=function(_0x290a8f,_0x5d15d0,_0x3da4c8,_0x2b8c19,_0x23bc33,_0x5a081c){var _0x526259,_0x5a2afc,_0x2d26e3;_0x5a081c[_0x1a7c('0x7b')]=intUtil[_0x1a7c('0x7c')](_0x5a081c[_0x1a7c('0x7b')]);_0x5a081c['serverUrl']=intUtil[_0x1a7c('0x7c')](_0x5a081c[_0x1a7c('0x7d')]);if(_0x23bc33&&_0x23bc33[_0x1a7c('0x7e')]){logger['info'](_0x1a7c('0x7f'),_0x1a7c('0x80'));_0x5d15d0[_0x1a7c('0x81')]=_0x5a081c['serverUrl']+_0x1a7c('0x82')+_0x5d15d0[_0x1a7c('0x83')]+_0x1a7c('0x84')+md5(_0x5d15d0[_0x1a7c('0x83')]);}else{_0x5d15d0[_0x1a7c('0x81')]='';}var _0x125ad0=_0x5a081c[_0x1a7c('0x7b')]===_0x1a7c('0x85')?'eu':_0x1a7c('0x86');return getAccessToken(_0x5a081c)[_0x1a7c('0x2a')](function(_0x3108aa){_0x2d26e3=_0x3108aa;return getUser(_0x2d26e3,_0x125ad0,_0x5a081c,_0x2b8c19[_0x1a7c('0x38')]);})['then'](function(_0x46f293){_0x526259=_0x46f293;logger[_0x1a7c('0x30')]('The\x20User\x20ID\x20is:',_0x526259['id']);return getEndUser(_0x2d26e3,_0x125ad0,_0x5a081c,_0x5d15d0[_0x1a7c('0x87')],_0x5d15d0[_0x1a7c('0x88')],_0x526259,_0x3da4c8);})[_0x1a7c('0x2a')](function(_0x464d33){_0x5a2afc=_0x464d33;return getCall(_0x2d26e3,_0x125ad0,_0x5a081c,_0x526259,_0x5a2afc,_0x3da4c8,_0x5d15d0,'Inbound');})[_0x1a7c('0x2a')](function(_0x84237b){if(_0x84237b){logger[_0x1a7c('0x30')](_0x1a7c('0x89'),_0x84237b['id']);logger[_0x1a7c('0x30')](_0x1a7c('0x7f'),_0x1a7c('0x8a'));emit(util[_0x1a7c('0x32')]('user:%s',_0x2b8c19[_0x1a7c('0x1a')]),_0x1a7c('0x8b'),{'uri':'https://crm.'+_0x5a081c[_0x1a7c('0x7b')]+_0x1a7c('0x8c')+_0x84237b['id']});}})[_0x1a7c('0x40')](function(_0x543feb){logger['error'](_0x1a7c('0x7f'),JSON[_0x1a7c('0xe')](_0x543feb));});};exports[_0x1a7c('0x8d')]=function(_0x5e4e3f,_0x27e17b,_0x1c6c22,_0x641f99,_0x1038f7,_0x19713e,_0x243128){var _0x319a2a,_0x2b1c66,_0xbbf5ca;_0x19713e[_0x1a7c('0x7b')]=intUtil['stripTrailingSlash'](_0x19713e['host']);_0x19713e[_0x1a7c('0x7d')]=intUtil[_0x1a7c('0x7c')](_0x19713e[_0x1a7c('0x7d')]);if(_0x243128&&_0x243128[_0x1a7c('0x8e')]&&_0x243128['recordingFormat']!==_0x1a7c('0x8f')){logger[_0x1a7c('0x30')](_0x1a7c('0x90'),_0x1a7c('0x80'));_0x27e17b['recordingURL']=_0x19713e['serverUrl']+_0x1a7c('0x82')+_0x27e17b[_0x1a7c('0x83')]+_0x1a7c('0x84')+md5(_0x27e17b[_0x1a7c('0x83')]);}var _0x418f27=_0x19713e['host']===_0x1a7c('0x85')?'eu':_0x1a7c('0x86');return getAccessToken(_0x19713e)[_0x1a7c('0x2a')](function(_0x239494){_0xbbf5ca=_0x239494;return getUser(_0xbbf5ca,_0x418f27,_0x19713e,_0x641f99[_0x1a7c('0x38')]);})[_0x1a7c('0x2a')](function(_0x519679){_0x319a2a=_0x519679;logger[_0x1a7c('0x30')](_0x1a7c('0x91'),_0x319a2a['id']);return getEndUser(_0xbbf5ca,_0x418f27,_0x19713e,_0x27e17b[_0x1a7c('0x92')],_0x27e17b[_0x1a7c('0x93')],_0x319a2a,_0x1c6c22);})['then'](function(_0x1b2de1){_0x2b1c66=_0x1b2de1;return getCall(_0xbbf5ca,_0x418f27,_0x19713e,_0x319a2a,_0x2b1c66,_0x1c6c22,_0x27e17b,_0x1a7c('0x94'));})[_0x1a7c('0x2a')](function(_0xe0923f){if(_0xe0923f){logger[_0x1a7c('0x30')](_0x1a7c('0x89'),_0xe0923f['id']);logger[_0x1a7c('0x30')](_0x1a7c('0x90'),_0x1a7c('0x8a'));emit(util['format'](_0x1a7c('0x95'),_0x641f99[_0x1a7c('0x1a')]),_0x1a7c('0x8b'),{'uri':_0x1a7c('0x96')+_0x19713e[_0x1a7c('0x7b')]+_0x1a7c('0x8c')+_0xe0923f['id']});}})[_0x1a7c('0x40')](function(_0x298fb3){logger[_0x1a7c('0x2d')](_0x1a7c('0x90'),JSON[_0x1a7c('0xe')](_0x298fb3));});};exports[_0x1a7c('0x97')]=function(_0x2a9eff,_0x5f1bd7,_0xaf2b63,_0x2a24f5,_0x502300,_0x17e8d2){var _0x21cddd,_0x1d1efc,_0x2283e6;_0x17e8d2['host']=intUtil[_0x1a7c('0x7c')](_0x17e8d2[_0x1a7c('0x7b')]);_0x17e8d2['serverUrl']=intUtil[_0x1a7c('0x7c')](_0x17e8d2[_0x1a7c('0x7d')]);if(_0x502300&&_0x502300[_0x1a7c('0x7e')]){logger[_0x1a7c('0x30')]('['+_0x5f1bd7[_0x1a7c('0x6a')][_0x1a7c('0x98')]()+']',_0x1a7c('0x80'));_0x5f1bd7[_0x1a7c('0x81')]=_0x17e8d2['serverUrl']+_0x1a7c('0x82')+_0x5f1bd7[_0x1a7c('0x83')]+_0x1a7c('0x84')+md5(_0x5f1bd7['uniqueid']);}else{_0x5f1bd7['recordingURL']='';}var _0x6f54c8=_0x17e8d2[_0x1a7c('0x7b')]===_0x1a7c('0x85')?'eu':_0x1a7c('0x86');return getAccessToken(_0x17e8d2)[_0x1a7c('0x2a')](function(_0x59d416){_0x2283e6=_0x59d416;return getUser(_0x2283e6,_0x6f54c8,_0x17e8d2);})[_0x1a7c('0x2a')](function(_0x10aff){_0x21cddd=_0x10aff;logger[_0x1a7c('0x30')](_0x1a7c('0x91'),_0x21cddd['id']);return getEndUser(_0x2283e6,_0x6f54c8,_0x17e8d2,_0x5f1bd7[_0x1a7c('0x87')],_0x5f1bd7['calleridnum'],_0x21cddd,_0xaf2b63);})[_0x1a7c('0x2a')](function(_0x34334b){_0x1d1efc=_0x34334b;return getCall(_0x2283e6,_0x6f54c8,_0x17e8d2,_0x21cddd,_0x1d1efc,_0xaf2b63,_0x5f1bd7,_0x1a7c('0x74'));})[_0x1a7c('0x2a')](function(_0x52756e){if(_0x52756e){logger['info'](_0x1a7c('0x89'),_0x52756e['id']);}})[_0x1a7c('0x40')](function(_0x5637ab){logger[_0x1a7c('0x2d')]('['+_0x5f1bd7['lastevent']['toUpperCase']()+']',JSON[_0x1a7c('0xe')](_0x5637ab));});}; \ 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 6966253..0708404 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 _0x7a44=['exec','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0x7a44,0xe2));var _0x47a4=function(_0x44f382,_0x70e0c){_0x44f382=_0x44f382-0x0;var _0x1dc653=_0x7a44[_0x44f382];return _0x1dc653;};'use strict';var util=require('util');var sh=require(_0x47a4('0x0'));var Mustache=require(_0x47a4('0x1'));var logger=require(_0x47a4('0x2'))(_0x47a4('0x3'));exports[_0x47a4('0x4')]=function(_0xff10c5,_0x1de4c5){var _0x12ad92=_0xff10c5['data2']?_0xff10c5['data2']:_0x47a4('0x5');var _0x20e6f2=_0xff10c5[_0x47a4('0x6')]?Mustache[_0x47a4('0x7')](_0xff10c5['data3'],_0x1de4c5):_0x1de4c5;sh['exec'](_0x20e6f2,function(_0x223f13,_0x48b9b8,_0x68f77f){if(_0x223f13!==0x0){logger['error'](util['format'](_0x47a4('0x8'),_0x12ad92,_0x20e6f2,_0x223f13,_0x68f77f));}else{logger[_0x47a4('0x9')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x12ad92,_0x20e6f2,_0x48b9b8));}});}; \ No newline at end of file +var _0x84e1=['exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','trigger','data2','Script','data3','render'];(function(_0xf79162,_0x4cb2b9){var _0x3a304d=function(_0x24ae5e){while(--_0x24ae5e){_0xf79162['push'](_0xf79162['shift']());}};_0x3a304d(++_0x4cb2b9);}(_0x84e1,0x117));var _0x184e=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x84e1[_0x5d2803];return _0xdcad2c;};'use strict';var util=require('util');var sh=require(_0x184e('0x0'));var Mustache=require(_0x184e('0x1'));var logger=require('../../../../config/logger')(_0x184e('0x2'));exports['exec']=function(_0x5409bc,_0x89a4e8){var _0x4b1fbd=_0x5409bc['data2']?_0x5409bc[_0x184e('0x3')]:_0x184e('0x4');var _0x558f61=_0x5409bc[_0x184e('0x5')]?Mustache[_0x184e('0x6')](_0x5409bc[_0x184e('0x5')],_0x89a4e8):_0x89a4e8;sh[_0x184e('0x7')](_0x558f61,function(_0x186fca,_0x1f4375,_0x667669){if(_0x186fca!==0x0){logger[_0x184e('0x8')](util[_0x184e('0x9')](_0x184e('0xa'),_0x4b1fbd,_0x558f61,_0x186fca,_0x667669));}else{logger[_0x184e('0xb')](util['format'](_0x184e('0xc'),_0x4b1fbd,_0x558f61,_0x1f4375));}});}; \ 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 ffcd52d..3784e6d 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 _0x287d=['util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','error','stack','GET','DELETE','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','stringify','format','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise'];(function(_0x40f1f9,_0xe2af65){var _0x148631=function(_0x23e749){while(--_0x23e749){_0x40f1f9['push'](_0x40f1f9['shift']());}};_0x148631(++_0xe2af65);}(_0x287d,0xb9));var _0xd287=function(_0x4d830b,_0x27f78d){_0x4d830b=_0x4d830b-0x0;var _0x238c89=_0x287d[_0x4d830b];return _0x238c89;};'use strict';var rp=require(_0xd287('0x0'));var util=require(_0xd287('0x1'));var _=require('lodash');var Mustache=require(_0xd287('0x2'));var logger=require(_0xd287('0x3'))(_0xd287('0x4'));exports[_0xd287('0x5')]=function(_0x7622e4,_0x13ba6a){var _0x39a532,_0x122c85;var _0x4fa4f0={'method':_0x7622e4[_0xd287('0x6')][_0xd287('0x7')](),'uri':Mustache[_0xd287('0x8')](_0x7622e4[_0xd287('0x9')],_0x13ba6a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x7622e4[_0xd287('0xa')])===_0xd287('0xb')&&parseInt(_0x7622e4['data5'])>=0x1&&parseInt(_0x7622e4[_0xd287('0xa')])<=0xa?parseInt(_0x7622e4[_0xd287('0xa')])*0x3e8:0x5*0x3e8};try{_0x4fa4f0[_0xd287('0xc')]=_0x7622e4['data6']?JSON[_0xd287('0xd')](Mustache[_0xd287('0x8')](_0x7622e4[_0xd287('0xe')],_0x13ba6a)):{};}catch(_0x243c44){logger[_0xd287('0xf')](_0x243c44[_0xd287('0x10')]);}switch(_0x7622e4['data1'][_0xd287('0x7')]()){case _0xd287('0x11'):case _0xd287('0x12'):_0x39a532=null;_0x4fa4f0['qs']=_0x13ba6a;break;case'POST':case'PUT':if(_0x7622e4['data7']){try{_0x39a532=JSON[_0xd287('0xd')](Mustache[_0xd287('0x8')](_0x7622e4['data7'],_0x13ba6a));_0x4fa4f0[_0xd287('0x13')]=_0x39a532;}catch(_0x167390){logger[_0xd287('0xf')](_0x167390[_0xd287('0x10')]);logger['error'](_0xd287('0x14'));}}else{_0x39a532=_0x13ba6a;_0x4fa4f0[_0xd287('0x13')]=_0x39a532;}break;}logger[_0xd287('0x15')](util['format'](_0xd287('0x16'),_0x7622e4[_0xd287('0x6')],_0x7622e4['data2'],JSON['stringify'](_0x4fa4f0)));rp(_0x4fa4f0)[_0xd287('0x17')](function(_0x1a8dce){_0x39a532=!_['isNil'](_0x39a532)?_0xd287('0x18')+_0x39a532:'';_0x122c85=typeof _0x1a8dce[_0xd287('0x13')]==='object'?JSON[_0xd287('0x19')](_0x1a8dce[_0xd287('0x13')]):_0x1a8dce['body'];logger[_0xd287('0x15')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x7622e4[_0xd287('0x6')],_0x7622e4[_0xd287('0x9')],_0x1a8dce['statusCode'],_0x122c85));})['catch'](function(_0x4e06f0){logger[_0xd287('0xf')](util[_0xd287('0x1a')](_0xd287('0x1b'),_0x7622e4['data1'],_0x7622e4[_0xd287('0x9')],_0x4e06f0[_0xd287('0x1c')],_0x4e06f0[_0xd287('0x1d')],_0x4e06f0[_0xd287('0x1e')]));});}; \ No newline at end of file +var _0x989d=['util','lodash','../../../../config/logger','render','data2','data5','headers','data6','parse','toUpperCase','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','format','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','data1','name','message','request-promise'];(function(_0x4b0f01,_0x5c4c8b){var _0x473186=function(_0x4d1f81){while(--_0x4d1f81){_0x4b0f01['push'](_0x4b0f01['shift']());}};_0x473186(++_0x5c4c8b);}(_0x989d,0x13f));var _0xd989=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x989d[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0xd989('0x0'));var util=require(_0xd989('0x1'));var _=require(_0xd989('0x2'));var Mustache=require('mustache');var logger=require(_0xd989('0x3'))('trigger');exports['exec']=function(_0x5bcb1e,_0x23e78d){var _0x4a08b6,_0xd07ecb;var _0x5a7f03={'method':_0x5bcb1e['data1']['toUpperCase'](),'uri':Mustache[_0xd989('0x4')](_0x5bcb1e[_0xd989('0x5')],_0x23e78d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5bcb1e[_0xd989('0x6')])==='number'&&parseInt(_0x5bcb1e['data5'])>=0x1&&parseInt(_0x5bcb1e[_0xd989('0x6')])<=0xa?parseInt(_0x5bcb1e[_0xd989('0x6')])*0x3e8:0x5*0x3e8};try{_0x5a7f03[_0xd989('0x7')]=_0x5bcb1e[_0xd989('0x8')]?JSON[_0xd989('0x9')](Mustache[_0xd989('0x4')](_0x5bcb1e[_0xd989('0x8')],_0x23e78d)):{};}catch(_0x4b439d){logger['error'](_0x4b439d['stack']);}switch(_0x5bcb1e['data1'][_0xd989('0xa')]()){case'GET':case'DELETE':_0x4a08b6=null;_0x5a7f03['qs']=_0x23e78d;break;case _0xd989('0xb'):case _0xd989('0xc'):if(_0x5bcb1e[_0xd989('0xd')]){try{_0x4a08b6=JSON[_0xd989('0x9')](Mustache[_0xd989('0x4')](_0x5bcb1e[_0xd989('0xd')],_0x23e78d));_0x5a7f03[_0xd989('0xe')]=_0x4a08b6;}catch(_0x2a536a){logger[_0xd989('0xf')](_0x2a536a['stack']);logger['error'](_0xd989('0x10'));}}else{_0x4a08b6=_0x23e78d;_0x5a7f03[_0xd989('0xe')]=_0x4a08b6;}break;}logger[_0xd989('0x11')](util['format'](_0xd989('0x12'),_0x5bcb1e['data1'],_0x5bcb1e[_0xd989('0x5')],JSON[_0xd989('0x13')](_0x5a7f03)));rp(_0x5a7f03)[_0xd989('0x14')](function(_0x3883ef){_0x4a08b6=!_[_0xd989('0x15')](_0x4a08b6)?_0xd989('0x16')+_0x4a08b6:'';_0xd07ecb=typeof _0x3883ef[_0xd989('0xe')]===_0xd989('0x17')?JSON['stringify'](_0x3883ef[_0xd989('0xe')]):_0x3883ef[_0xd989('0xe')];logger['info'](util['format'](_0xd989('0x18'),_0x5bcb1e['data1'],_0x5bcb1e[_0xd989('0x5')],_0x3883ef[_0xd989('0x19')],_0xd07ecb));})[_0xd989('0x1a')](function(_0x16965c){logger[_0xd989('0xf')](util[_0xd989('0x1b')](_0xd989('0x1c'),_0x5bcb1e[_0xd989('0x1d')],_0x5bcb1e['data2'],_0x16965c[_0xd989('0x19')],_0x16965c[_0xd989('0x1e')],_0x16965c[_0xd989('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index e72b543..3f6e252 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 _0x9043=['exports','../../config/logger','routing','client','http','Request','debug','rpc','error','message','result'];(function(_0xfd183f,_0x21bbde){var _0x40b42e=function(_0x5dfbf3){while(--_0x5dfbf3){_0xfd183f['push'](_0xfd183f['shift']());}};_0x40b42e(++_0x21bbde);}(_0x9043,0x156));var _0x3904=function(_0x1e3091,_0x1824dd){_0x1e3091=_0x1e3091-0x0;var _0x1f7e45=_0x9043[_0x1e3091];return _0x1f7e45;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3904('0x0'))(_0x3904('0x1'));var client=jayson[_0x3904('0x2')][_0x3904('0x3')]({'port':0x2329});client[_0x3904('0x4')]=function(_0x421be3,_0x52ee58){return new BPromise(function(_0xd73d2f,_0x340cdd){return client['request'](_0x421be3,_0x52ee58)['then'](function(_0x3e38b9){logger[_0x3904('0x5')](_0x3904('0x6'),_0x3904('0x1'),_0x421be3,_0x52ee58,_0x3e38b9);if(_0x3e38b9[_0x3904('0x7')]){logger[_0x3904('0x7')](_0x3904('0x6'),_0x3904('0x1'),_0x421be3,_0x3e38b9[_0x3904('0x7')][_0x3904('0x8')],_0x52ee58);return _0x340cdd(_0x3e38b9[_0x3904('0x7')][_0x3904('0x8')]);}else{return _0xd73d2f(_0x3e38b9[_0x3904('0x9')]);}})['catch'](function(_0x1a0211){logger[_0x3904('0x7')](_0x3904('0x6'),_0x3904('0x1'),_0x421be3,_0x1a0211,_0x52ee58);return _0x340cdd(_0x1a0211);});});};module[_0x3904('0xa')]=client; \ No newline at end of file +var _0x4639=['result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','then','rpc','error','message'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x4639,0x189));var _0x9463=function(_0x3ba9ec,_0x49c244){_0x3ba9ec=_0x3ba9ec-0x0;var _0x39f681=_0x4639[_0x3ba9ec];return _0x39f681;};'use strict';var jayson=require(_0x9463('0x0'));var BPromise=require('bluebird');var logger=require(_0x9463('0x1'))(_0x9463('0x2'));var client=jayson[_0x9463('0x3')][_0x9463('0x4')]({'port':0x2329});client[_0x9463('0x5')]=function(_0x532492,_0x409dec){return new BPromise(function(_0x5a103a,_0x164060){return client['request'](_0x532492,_0x409dec)[_0x9463('0x6')](function(_0x3b14e9){logger['debug'](_0x9463('0x7'),_0x9463('0x2'),_0x532492,_0x409dec,_0x3b14e9);if(_0x3b14e9[_0x9463('0x8')]){logger[_0x9463('0x8')]('rpc',_0x9463('0x2'),_0x532492,_0x3b14e9[_0x9463('0x8')][_0x9463('0x9')],_0x409dec);return _0x164060(_0x3b14e9[_0x9463('0x8')][_0x9463('0x9')]);}else{return _0x5a103a(_0x3b14e9[_0x9463('0xa')]);}})[_0x9463('0xb')](function(_0x2a7a65){logger[_0x9463('0x8')](_0x9463('0x7'),'routing',_0x532492,_0x2a7a65,_0x409dec);return _0x164060(_0x2a7a65);});});};module[_0x9463('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 6bcc89e..44156c1 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 _0x57f2=['./rpc/mailAccount','../../config/logger','email','resolve','then','initMailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime','./lib/email'];(function(_0x13c854,_0x565889){var _0x268136=function(_0x570186){while(--_0x570186){_0x13c854['push'](_0x13c854['shift']());}};_0x268136(++_0x565889);}(_0x57f2,0x1be));var _0x257f=function(_0xc2a0f8,_0x5c2e95){_0xc2a0f8=_0xc2a0f8-0x0;var _0x2f9ce5=_0x57f2[_0xc2a0f8];return _0x2f9ce5;};'use strict';var server=require('./server');var Realtime=require(_0x257f('0x0'));var EmailChannel=require(_0x257f('0x1'));var mailAccount=require(_0x257f('0x2'));var setting=require('./rpc/setting');var logger=require(_0x257f('0x3'))(_0x257f('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x257f('0x5')]()[_0x257f('0x6')](mailAccount['getMailAccounts']())[_0x257f('0x6')](realtime[_0x257f('0x7')]())[_0x257f('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x257f('0x8')](realtime,email)[_0x257f('0x6')](function(){return initRealtime();})[_0x257f('0x6')](function(){return setting[_0x257f('0x9')]();})['then'](function(_0x4a7632){return setInterval(initRealtime,_0x4a7632[_0x257f('0xa')]*0x3e8);})[_0x257f('0xb')](function(_0x20a3b6){logger[_0x257f('0xc')](_0x257f('0xd'),_0x20a3b6);});}main(); \ No newline at end of file +var _0x3a6a=['then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','catch','Email\x20service\x20initialization','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email'];(function(_0x33faad,_0x5a759c){var _0x599e73=function(_0x118729){while(--_0x118729){_0x33faad['push'](_0x33faad['shift']());}};_0x599e73(++_0x5a759c);}(_0x3a6a,0x119));var _0xa3a6=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x3a6a[_0x44268d];return _0x4be92d;};'use strict';var server=require('./server');var Realtime=require(_0xa3a6('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xa3a6('0x1'));var setting=require(_0xa3a6('0x2'));var logger=require(_0xa3a6('0x3'))(_0xa3a6('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xa3a6('0x5')](mailAccount[_0xa3a6('0x6')]())[_0xa3a6('0x5')](realtime[_0xa3a6('0x7')]())[_0xa3a6('0x5')](function(){email[_0xa3a6('0x8')](realtime[_0xa3a6('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xa3a6('0x5')](function(){return initRealtime();})[_0xa3a6('0x5')](function(){return setting[_0xa3a6('0xa')]();})['then'](function(_0x441afa){return setInterval(initRealtime,_0x441afa['loginMailFrequency']*0x3e8);})[_0xa3a6('0xb')](function(_0x14c220){logger['error'](_0xa3a6('0xc'),_0x14c220);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 45f7764..56b9d14 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 _0x4394=['./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','key','status','messageStatus','Imap','total','isNil','stringify','mailAccount:update','refresh','active','provider','custom','hasOwnProperty','box','bind','end','handleImapEnd','handleImapError','disabled','emit','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','catch','error','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','localhost'];(function(_0x156b96,_0x5bd2ac){var _0x581370=function(_0x8e4d4b){while(--_0x8e4d4b){_0x156b96['push'](_0x156b96['shift']());}};_0x581370(++_0x5bd2ac);}(_0x4394,0x18d));var _0x4439=function(_0x32bce8,_0x54f965){_0x32bce8=_0x32bce8-0x0;var _0x38badc=_0x4394[_0x32bce8];return _0x38badc;};'use strict';var _=require(_0x4439('0x0'));var moment=require(_0x4439('0x1'));var BPromise=require(_0x4439('0x2'));var md5=require(_0x4439('0x3'));var Redis=require(_0x4439('0x4'));var config=require(_0x4439('0x5'));var logger=require('../../../config/logger')(_0x4439('0x6'));config[_0x4439('0x7')]=_['defaults'](config['redis'],{'host':_0x4439('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x4439('0x9'));var EmailSmtp=require(_0x4439('0xa'));var mailAccount=require(_0x4439('0xb'));var md5Accounts={};function EmailChannel(_0x2c4bc4){logger[_0x4439('0xc')](_0x4439('0xd'));this[_0x4439('0xe')]=_0x2c4bc4[_0x4439('0xe')];this[_0x4439('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x4439('0x10')]['emit']=function(_0x5d7b67){var _0x313e82=this[_0x4439('0xe')][_0x5d7b67];var _0x3e13bd={'id':_0x313e82['id'],'name':_0x313e82['name'],'key':_0x313e82[_0x4439('0x11')],'active':_0x313e82['active'],'Imap':{'status':_0x313e82['Imap'][_0x4439('0x12')],'messageStatus':_0x313e82['Imap'][_0x4439('0x13')],'total':_0x313e82[_0x4439('0x14')][_0x4439('0x15')]}};if(_[_0x4439('0x16')](md5Accounts[_0x5d7b67])){md5Accounts[_0x5d7b67]={};}var _0x45a9b9=md5(JSON[_0x4439('0x17')](_0x3e13bd));if(md5Accounts[_0x5d7b67][_0x4439('0x3')]!==_0x45a9b9){md5Accounts[_0x5d7b67][_0x4439('0x3')]=_0x45a9b9;io['emit'](_0x4439('0x18'),_0x3e13bd);}};EmailChannel[_0x4439('0x10')][_0x4439('0x19')]=function(_0x1ae8c5){for(var _0x3bb76f in _0x1ae8c5){if(_0x1ae8c5['hasOwnProperty'](_0x3bb76f)){if(_0x1ae8c5[_0x3bb76f][_0x4439('0x14')]&&_0x1ae8c5[_0x3bb76f][_0x4439('0x1a')]){var _0x5a8f9a=_0x1ae8c5[_0x3bb76f][_0x4439('0x14')];if(!_0x5a8f9a['service']&&_0x1ae8c5[_0x3bb76f][_0x4439('0x1b')]!==_0x4439('0x1c'))_0x5a8f9a['service']=_0x1ae8c5[_0x3bb76f][_0x4439('0x1b')];if(!this['imapAccounts'][_0x4439('0x1d')](_0x5a8f9a['id'])){this[_0x4439('0xf')][_0x5a8f9a['id']]=new EmailImap(_0x5a8f9a,_0x1ae8c5[_0x3bb76f][_0x4439('0x6')]);this[_0x4439('0xf')][_0x5a8f9a['id']]['on'](_0x4439('0x1e'),this['handleImapBox'][_0x4439('0x1f')](this,_0x3bb76f));this[_0x4439('0xf')][_0x5a8f9a['id']]['on']('email',this['handleImapEmail'][_0x4439('0x1f')](this,_0x3bb76f));this[_0x4439('0xf')][_0x5a8f9a['id']]['on'](_0x4439('0x20'),this[_0x4439('0x21')][_0x4439('0x1f')](this,_0x3bb76f));this['imapAccounts'][_0x5a8f9a['id']]['on']('error',this[_0x4439('0x22')][_0x4439('0x1f')](this,_0x3bb76f));}}else{if(_['isNil'](this[_0x4439('0xe')][_0x3bb76f][_0x4439('0x14')])){this[_0x4439('0xe')][_0x3bb76f][_0x4439('0x14')]={};}this['mailAccounts'][_0x3bb76f]['Imap'][_0x4439('0x12')]=_0x4439('0x23');this['mailAccounts'][_0x3bb76f][_0x4439('0x14')][_0x4439('0x13')]='';this[_0x4439('0x24')](_0x3bb76f);}}}};EmailChannel[_0x4439('0x10')]['handleImapBox']=function(_0x15e6d8,_0x3b7c40){if(this['mailAccounts'][_0x15e6d8]){this[_0x4439('0xe')][_0x15e6d8][_0x4439('0x14')]['status']=_0x4439('0x25');this[_0x4439('0xe')][_0x15e6d8][_0x4439('0x14')][_0x4439('0x13')]=_0x3b7c40[_0x4439('0x26')];if(_0x3b7c40['messages']){this[_0x4439('0xe')][_0x15e6d8][_0x4439('0x14')][_0x4439('0x15')]=_0x3b7c40[_0x4439('0x27')][_0x4439('0x15')];}return this[_0x4439('0x24')](_0x15e6d8);}};EmailChannel[_0x4439('0x10')]['handleImapEmail']=function(_0x14f59e,_0x510f98){logger[_0x4439('0xc')](_0x4439('0x28'),_0x510f98[_0x4439('0x29')],_0x510f98[_0x4439('0x2a')],_0x510f98[_0x4439('0x2b')],_0x14f59e);if(this[_0x4439('0xe')][_0x14f59e]){return mailAccount[_0x4439('0x2c')](_0x14f59e,_0x510f98)[_0x4439('0x2d')](function(_0x2d9807){if(_0x2d9807){logger[_0x4439('0xc')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x375900){logger['error'](_0x4439('0x2e'),JSON['stringify'](_0x375900));});}};EmailChannel['prototype'][_0x4439('0x21')]=function(_0x51a5e8){if(this['mailAccounts'][_0x51a5e8]&&this[_0x4439('0xe')][_0x51a5e8][_0x4439('0x14')]){if(this[_0x4439('0xf')][this[_0x4439('0xe')][_0x51a5e8][_0x4439('0x14')]['id']]){delete this[_0x4439('0xf')][this['mailAccounts'][_0x51a5e8][_0x4439('0x14')]['id']];}this[_0x4439('0xe')][_0x51a5e8][_0x4439('0x14')][_0x4439('0x2f')]=moment();this['emit'](_0x51a5e8);}};EmailChannel[_0x4439('0x10')][_0x4439('0x22')]=function(_0x22a37c,_0x465bec){if(this['mailAccounts'][_0x22a37c]){this[_0x4439('0xe')][_0x22a37c][_0x4439('0x14')]['status']='error';this[_0x4439('0xe')][_0x22a37c][_0x4439('0x14')][_0x4439('0x13')]=_0x465bec;return this['emit'](_0x22a37c);}};EmailChannel[_0x4439('0x10')][_0x4439('0x30')]=function(_0x4a06bb,_0x3ba10d){return this[_0x4439('0x31')][_0x4439('0x32')](_0x4a06bb,_0x3ba10d);};EmailChannel[_0x4439('0x10')][_0x4439('0x33')]=function(_0x3b12c4){var _0x5a30ee=this;if(this[_0x4439('0xe')][_0x3b12c4['id']]){if(_[_0x4439('0x16')](this[_0x4439('0xe')][_0x3b12c4['id']][_0x4439('0x34')])){this[_0x4439('0xe')][_0x3b12c4['id']][_0x4439('0x34')]={};}this[_0x4439('0xe')][_0x3b12c4['id']][_0x4439('0x34')][_0x4439('0x2f')]=moment();return new BPromise(function(_0x1485c0,_0x398760){return _0x5a30ee['smtp'][_0x4439('0x35')](_0x3b12c4)[_0x4439('0x2d')](function(_0x51600b){_0x5a30ee[_0x4439('0xe')][_0x3b12c4['id']][_0x4439('0x34')][_0x4439('0x12')]=_0x4439('0x36');_0x5a30ee[_0x4439('0xe')][_0x3b12c4['id']]['Smtp'][_0x4439('0x13')]='';_0x5a30ee[_0x4439('0x24')](_0x3b12c4['id']);_0x1485c0(_0x51600b);})[_0x4439('0x37')](function(_0x3a1dfe){_0x5a30ee[_0x4439('0xe')][_0x3b12c4['id']][_0x4439('0x34')][_0x4439('0x12')]=_0x4439('0x38');_0x5a30ee[_0x4439('0xe')][_0x3b12c4['id']]['Smtp'][_0x4439('0x13')]=_0x3a1dfe;_0x5a30ee[_0x4439('0x24')](_0x3b12c4['id']);_0x398760(_0x3a1dfe);});});}return this[_0x4439('0x31')][_0x4439('0x35')](_0x3b12c4);};module[_0x4439('0x39')]=EmailChannel; \ No newline at end of file +var _0x2ebc=['active','Imap','status','messageStatus','stringify','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','bind','email','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','handleImapBox','name','total','messages','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','send','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2ebc,0x1d3));var _0xc2eb=function(_0x115327,_0x1c0333){_0x115327=_0x115327-0x0;var _0x31c545=_0x2ebc[_0x115327];return _0x31c545;};'use strict';var _=require(_0xc2eb('0x0'));var moment=require('moment');var BPromise=require(_0xc2eb('0x1'));var md5=require(_0xc2eb('0x2'));var Redis=require(_0xc2eb('0x3'));var config=require(_0xc2eb('0x4'));var logger=require(_0xc2eb('0x5'))('email');config[_0xc2eb('0x6')]=_[_0xc2eb('0x7')](config[_0xc2eb('0x6')],{'host':_0xc2eb('0x8'),'port':0x18eb});var io=require(_0xc2eb('0x9'))(new Redis(config[_0xc2eb('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xc2eb('0xa'));var mailAccount=require(_0xc2eb('0xb'));var md5Accounts={};function EmailChannel(_0x347668){logger[_0xc2eb('0xc')](_0xc2eb('0xd'));this[_0xc2eb('0xe')]=_0x347668['mailAccounts'];this[_0xc2eb('0xf')]={};this[_0xc2eb('0x10')]=new EmailSmtp();}EmailChannel[_0xc2eb('0x11')][_0xc2eb('0x12')]=function(_0x399dac){var _0x29101e=this[_0xc2eb('0xe')][_0x399dac];var _0x65735c={'id':_0x29101e['id'],'name':_0x29101e['name'],'key':_0x29101e['key'],'active':_0x29101e[_0xc2eb('0x13')],'Imap':{'status':_0x29101e[_0xc2eb('0x14')][_0xc2eb('0x15')],'messageStatus':_0x29101e[_0xc2eb('0x14')][_0xc2eb('0x16')],'total':_0x29101e[_0xc2eb('0x14')]['total']}};if(_['isNil'](md5Accounts[_0x399dac])){md5Accounts[_0x399dac]={};}var _0x28f9f1=md5(JSON[_0xc2eb('0x17')](_0x65735c));if(md5Accounts[_0x399dac][_0xc2eb('0x2')]!==_0x28f9f1){md5Accounts[_0x399dac][_0xc2eb('0x2')]=_0x28f9f1;io[_0xc2eb('0x12')](_0xc2eb('0x18'),_0x65735c);}};EmailChannel[_0xc2eb('0x11')][_0xc2eb('0x19')]=function(_0x3ccb08){for(var _0x55de05 in _0x3ccb08){if(_0x3ccb08['hasOwnProperty'](_0x55de05)){if(_0x3ccb08[_0x55de05][_0xc2eb('0x14')]&&_0x3ccb08[_0x55de05][_0xc2eb('0x13')]){var _0x3e930b=_0x3ccb08[_0x55de05][_0xc2eb('0x14')];if(!_0x3e930b[_0xc2eb('0x1a')]&&_0x3ccb08[_0x55de05][_0xc2eb('0x1b')]!==_0xc2eb('0x1c'))_0x3e930b['service']=_0x3ccb08[_0x55de05][_0xc2eb('0x1b')];if(!this[_0xc2eb('0xf')][_0xc2eb('0x1d')](_0x3e930b['id'])){this[_0xc2eb('0xf')][_0x3e930b['id']]=new EmailImap(_0x3e930b,_0x3ccb08[_0x55de05]['email']);this[_0xc2eb('0xf')][_0x3e930b['id']]['on']('box',this['handleImapBox'][_0xc2eb('0x1e')](this,_0x55de05));this['imapAccounts'][_0x3e930b['id']]['on'](_0xc2eb('0x1f'),this[_0xc2eb('0x20')][_0xc2eb('0x1e')](this,_0x55de05));this[_0xc2eb('0xf')][_0x3e930b['id']]['on'](_0xc2eb('0x21'),this[_0xc2eb('0x22')]['bind'](this,_0x55de05));this[_0xc2eb('0xf')][_0x3e930b['id']]['on'](_0xc2eb('0x23'),this[_0xc2eb('0x24')][_0xc2eb('0x1e')](this,_0x55de05));}}else{if(_[_0xc2eb('0x25')](this[_0xc2eb('0xe')][_0x55de05][_0xc2eb('0x14')])){this[_0xc2eb('0xe')][_0x55de05][_0xc2eb('0x14')]={};}this['mailAccounts'][_0x55de05]['Imap'][_0xc2eb('0x15')]='disabled';this[_0xc2eb('0xe')][_0x55de05]['Imap'][_0xc2eb('0x16')]='';this['emit'](_0x55de05);}}}};EmailChannel['prototype'][_0xc2eb('0x26')]=function(_0x361f9f,_0x3c75ea){if(this[_0xc2eb('0xe')][_0x361f9f]){this['mailAccounts'][_0x361f9f][_0xc2eb('0x14')]['status']='connected';this['mailAccounts'][_0x361f9f]['Imap'][_0xc2eb('0x16')]=_0x3c75ea[_0xc2eb('0x27')];if(_0x3c75ea['messages']){this[_0xc2eb('0xe')][_0x361f9f]['Imap'][_0xc2eb('0x28')]=_0x3c75ea[_0xc2eb('0x29')]['total'];}return this[_0xc2eb('0x12')](_0x361f9f);}};EmailChannel['prototype'][_0xc2eb('0x20')]=function(_0x5a6127,_0x3d4651){logger[_0xc2eb('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3d4651[_0xc2eb('0x2a')],_0x3d4651[_0xc2eb('0x2b')],_0x3d4651['from'],_0x5a6127);if(this[_0xc2eb('0xe')][_0x5a6127]){return mailAccount[_0xc2eb('0x2c')](_0x5a6127,_0x3d4651)[_0xc2eb('0x2d')](function(_0x4e34a1){if(_0x4e34a1){logger[_0xc2eb('0xc')](_0xc2eb('0x2e'));}})[_0xc2eb('0x2f')](function(_0x47af97){logger[_0xc2eb('0x23')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xc2eb('0x17')](_0x47af97));});}};EmailChannel['prototype']['handleImapEnd']=function(_0xaf12e3){if(this['mailAccounts'][_0xaf12e3]&&this['mailAccounts'][_0xaf12e3][_0xc2eb('0x14')]){if(this[_0xc2eb('0xf')][this[_0xc2eb('0xe')][_0xaf12e3][_0xc2eb('0x14')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0xaf12e3][_0xc2eb('0x14')]['id']];}this['mailAccounts'][_0xaf12e3]['Imap'][_0xc2eb('0x30')]=moment();this[_0xc2eb('0x12')](_0xaf12e3);}};EmailChannel[_0xc2eb('0x11')][_0xc2eb('0x24')]=function(_0x3fa8de,_0x53d578){if(this['mailAccounts'][_0x3fa8de]){this[_0xc2eb('0xe')][_0x3fa8de][_0xc2eb('0x14')][_0xc2eb('0x15')]=_0xc2eb('0x23');this[_0xc2eb('0xe')][_0x3fa8de][_0xc2eb('0x14')][_0xc2eb('0x16')]=_0x53d578;return this['emit'](_0x3fa8de);}};EmailChannel[_0xc2eb('0x11')]['sendMail']=function(_0x6b9d28,_0x1dd086){return this[_0xc2eb('0x10')][_0xc2eb('0x31')](_0x6b9d28,_0x1dd086);};EmailChannel[_0xc2eb('0x11')][_0xc2eb('0x32')]=function(_0x28e595){var _0x57211b=this;if(this[_0xc2eb('0xe')][_0x28e595['id']]){if(_[_0xc2eb('0x25')](this['mailAccounts'][_0x28e595['id']][_0xc2eb('0x33')])){this[_0xc2eb('0xe')][_0x28e595['id']]['Smtp']={};}this[_0xc2eb('0xe')][_0x28e595['id']][_0xc2eb('0x33')][_0xc2eb('0x30')]=moment();return new BPromise(function(_0xa9d9c8,_0x5f11fa){return _0x57211b['smtp'][_0xc2eb('0x34')](_0x28e595)['then'](function(_0x959bff){_0x57211b[_0xc2eb('0xe')][_0x28e595['id']][_0xc2eb('0x33')][_0xc2eb('0x15')]=_0xc2eb('0x35');_0x57211b[_0xc2eb('0xe')][_0x28e595['id']]['Smtp']['messageStatus']='';_0x57211b[_0xc2eb('0x12')](_0x28e595['id']);_0xa9d9c8(_0x959bff);})[_0xc2eb('0x2f')](function(_0x78ae26){_0x57211b[_0xc2eb('0xe')][_0x28e595['id']]['Smtp'][_0xc2eb('0x15')]=_0xc2eb('0x23');_0x57211b['mailAccounts'][_0x28e595['id']][_0xc2eb('0x33')]['messageStatus']=_0x78ae26;_0x57211b['emit'](_0x28e595['id']);_0x5f11fa(_0x78ae26);});});}return this[_0xc2eb('0x10')][_0xc2eb('0x34')](_0x28e595);};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 44e42b5..06e740a 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 _0x3d28=['tls','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','once','end','handleEnd','bind','error','handleError','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','host','port'];(function(_0x38c589,_0x507adc){var _0x1a9db3=function(_0x248cee){while(--_0x248cee){_0x38c589['push'](_0x38c589['shift']());}};_0x1a9db3(++_0x507adc);}(_0x3d28,0x150));var _0x83d2=function(_0x1598fd,_0xce1832){_0x1598fd=_0x1598fd-0x0;var _0x8d5e0d=_0x3d28[_0x1598fd];return _0x8d5e0d;};'use strict';var _=require(_0x83d2('0x0'));var util=require(_0x83d2('0x1'));var Imap=require(_0x83d2('0x2'));var simpleParser=require(_0x83d2('0x3'))[_0x83d2('0x4')];var Iconv=require(_0x83d2('0x5'))[_0x83d2('0x6')];var EventEmitter=require(_0x83d2('0x7'))[_0x83d2('0x8')];var utils=require(_0x83d2('0x9'));var logger=require(_0x83d2('0xa'))(_0x83d2('0xb'));function EmailImap(_0x1a9502,_0xfb8aee){this[_0x83d2('0xc')]=_0x1a9502[_0x83d2('0xc')];this[_0x83d2('0xd')]=this[_0x83d2('0xe')](_0x1a9502,_0xfb8aee);this[_0x83d2('0x2')]=new Imap(this[_0x83d2('0xd')]);this[_0x83d2('0x2')]['once'](_0x83d2('0xf'),this[_0x83d2('0x10')]['bind'](this));this[_0x83d2('0x2')][_0x83d2('0x11')](_0x83d2('0x12'),this[_0x83d2('0x13')][_0x83d2('0x14')](this));this[_0x83d2('0x2')]['on'](_0x83d2('0x15'),this[_0x83d2('0x16')][_0x83d2('0x14')](this));this[_0x83d2('0x2')]['connect']();}util[_0x83d2('0x17')](EmailImap,EventEmitter);EmailImap[_0x83d2('0x18')]['getAccount']=function(_0xe99774,_0x2241d0){var _0x1c244d={'connTimeout':_0xe99774[_0x83d2('0x19')]?_0xe99774[_0x83d2('0x19')]*0x3e8:0x2710,'authTimeout':_0xe99774['authTimeout']?_0xe99774[_0x83d2('0x1a')]*0x3e8:0x1388};if(_0xe99774['service']){_0x1c244d[_0x83d2('0x1b')]=_0xe99774[_0x83d2('0x1b')];if(_0xe99774[_0x83d2('0x1c')]){_0x1c244d[_0x83d2('0x1d')]=utils[_0x83d2('0x1e')](_0xe99774[_0x83d2('0x1f')]['data5'],_0xe99774['user']);}else{_0x1c244d[_0x83d2('0x20')]=_0xe99774[_0x83d2('0x20')];}}else{if(_0xe99774[_0x83d2('0x21')]){_0x1c244d[_0x83d2('0x1b')]=_0xe99774[_0x83d2('0x1b')];_0x1c244d[_0x83d2('0x20')]=_0xe99774['password'];}}_0x1c244d[_0x83d2('0xb')]=_0x2241d0||_0xe99774[_0x83d2('0x1b')]||'anonymous@xcally.com';_0x1c244d[_0x83d2('0x22')]=_0xe99774[_0x83d2('0x22')];_0x1c244d['port']=_0xe99774[_0x83d2('0x23')]||0x3e1;if(_0xe99774[_0x83d2('0x24')]){_0x1c244d[_0x83d2('0x24')]=!![];}else{_0x1c244d[_0x83d2('0x24')]=![];_0x1c244d['autotls']='required';}return _0x1c244d;};EmailImap[_0x83d2('0x18')][_0x83d2('0x10')]=function(){this[_0x83d2('0x2')][_0x83d2('0x25')](this[_0x83d2('0xc')],![],this[_0x83d2('0x26')][_0x83d2('0x14')](this));};EmailImap[_0x83d2('0x18')][_0x83d2('0x26')]=function(_0xc4d7a0,_0x572073){if(_0xc4d7a0){this[_0x83d2('0x16')](_0xc4d7a0,!![]);}else{this[_0x83d2('0x27')](_0x83d2('0x28'),_0x572073);this[_0x83d2('0x29')]();}};EmailImap[_0x83d2('0x18')][_0x83d2('0x2a')]=function(_0x579fb2){if(_0x579fb2){this[_0x83d2('0x16')](_0x579fb2,!![]);}else{this['imap'][_0x83d2('0x12')]();}};EmailImap[_0x83d2('0x18')][_0x83d2('0x29')]=function(){this[_0x83d2('0x2')][_0x83d2('0x2b')]([_0x83d2('0x2c')],this[_0x83d2('0x2d')][_0x83d2('0x14')](this));};EmailImap[_0x83d2('0x18')][_0x83d2('0x2d')]=function(_0x2e3c33,_0x7fe313){if(_0x2e3c33){this['handleError'](_0x2e3c33,!![]);}else{if(_0x7fe313[_0x83d2('0x2e')]){try{var _0x3d4799=this[_0x83d2('0x2')]['fetch'](_0x7fe313,{'bodies':'','markSeen':!![]});_0x3d4799['on'](_0x83d2('0x2f'),this[_0x83d2('0x30')][_0x83d2('0x14')](this));_0x3d4799['once'](_0x83d2('0x15'),this[_0x83d2('0x31')][_0x83d2('0x14')](this));_0x3d4799[_0x83d2('0x11')](_0x83d2('0x12'),this[_0x83d2('0x32')][_0x83d2('0x14')](this));}catch(_0x1add93){logger[_0x83d2('0x15')](_0x1add93);}}else{this[_0x83d2('0x2')]['closeBox'](!![],this[_0x83d2('0x2a')]['bind'](this));}}};EmailImap['prototype'][_0x83d2('0x30')]=function(_0x27811a){_0x27811a['on'](_0x83d2('0x33'),this[_0x83d2('0x34')][_0x83d2('0x14')](this));_0x27811a['once']('attributes',this[_0x83d2('0x35')][_0x83d2('0x14')](this));_0x27811a[_0x83d2('0x11')]('end',this[_0x83d2('0x36')][_0x83d2('0x14')](this));};EmailImap[_0x83d2('0x18')][_0x83d2('0x34')]=function(_0x1bb091){simpleParser(_0x1bb091,{'Iconv':Iconv},this[_0x83d2('0x37')][_0x83d2('0x14')](this));};EmailImap[_0x83d2('0x18')]['handleMessageAttributes']=function(){};EmailImap[_0x83d2('0x18')][_0x83d2('0x36')]=function(){};EmailImap[_0x83d2('0x18')][_0x83d2('0x37')]=function(_0x407679,_0x561ee3){if(_0x407679){logger[_0x83d2('0x15')](_0x407679);}else{var _0x207746=this;utils['parser'](this['account'],_0x561ee3,function(_0x29c8ce){_0x207746[_0x83d2('0x27')](_0x83d2('0xb'),_0x29c8ce);});}};EmailImap['prototype'][_0x83d2('0x32')]=function(){this[_0x83d2('0x2')][_0x83d2('0x38')](!![],this[_0x83d2('0x2a')][_0x83d2('0x14')](this));};EmailImap[_0x83d2('0x18')][_0x83d2('0x31')]=function(_0x45cbab){this[_0x83d2('0x16')](_0x45cbab);this[_0x83d2('0x2')][_0x83d2('0x38')](!![],this[_0x83d2('0x2a')][_0x83d2('0x14')](this));};EmailImap[_0x83d2('0x18')]['handleEnd']=function(){this['emit'](_0x83d2('0x12'));};EmailImap[_0x83d2('0x18')][_0x83d2('0x16')]=function(_0x16b7af,_0x2f5230){logger['error']('handleError',this[_0x83d2('0xd')][_0x83d2('0xb')],JSON[_0x83d2('0x39')](_0x16b7af));var _0x5c5f5a='';if(_0x16b7af){if(_0x16b7af['textCode']){_0x5c5f5a=_0x16b7af[_0x83d2('0x3a')];}else{for(var _0x4a6f6e in _0x16b7af){if(_0x16b7af[_0x83d2('0x3b')](_0x4a6f6e)){_0x5c5f5a+=_[_0x83d2('0x3c')](_0x4a6f6e)+':\x20'+_0x16b7af[_0x4a6f6e]+'\x0a';}}}}if(_0x2f5230){this[_0x83d2('0x2')]['end']();}else{this[_0x83d2('0x27')](_0x83d2('0x15'),_0x5c5f5a);this[_0x83d2('0x27')](_0x83d2('0x12'));}};module[_0x83d2('0x3d')]=EmailImap; \ No newline at end of file +var _0x7dcc=['parser','handleFetchEnd','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','util','mailparser','simpleParser','Iconv','EventEmitter','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','connTimeout','authTimeout','service','user','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','closeBox','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser'];(function(_0x2d05fc,_0x307479){var _0x2176f8=function(_0x46356b){while(--_0x46356b){_0x2d05fc['push'](_0x2d05fc['shift']());}};_0x2176f8(++_0x307479);}(_0x7dcc,0xfc));var _0xc7dc=function(_0x18a71e,_0x1887ec){_0x18a71e=_0x18a71e-0x0;var _0x6a2ef7=_0x7dcc[_0x18a71e];return _0x6a2ef7;};'use strict';var _=require('lodash');var util=require(_0xc7dc('0x0'));var Imap=require('imap');var simpleParser=require(_0xc7dc('0x1'))[_0xc7dc('0x2')];var Iconv=require('iconv')[_0xc7dc('0x3')];var EventEmitter=require('events')[_0xc7dc('0x4')];var utils=require('./utils');var logger=require(_0xc7dc('0x5'))(_0xc7dc('0x6'));function EmailImap(_0x145872,_0x407e3d){this[_0xc7dc('0x7')]=_0x145872[_0xc7dc('0x7')];this[_0xc7dc('0x8')]=this[_0xc7dc('0x9')](_0x145872,_0x407e3d);this[_0xc7dc('0xa')]=new Imap(this[_0xc7dc('0x8')]);this[_0xc7dc('0xa')][_0xc7dc('0xb')](_0xc7dc('0xc'),this[_0xc7dc('0xd')][_0xc7dc('0xe')](this));this[_0xc7dc('0xa')]['once'](_0xc7dc('0xf'),this[_0xc7dc('0x10')][_0xc7dc('0xe')](this));this[_0xc7dc('0xa')]['on'](_0xc7dc('0x11'),this[_0xc7dc('0x12')][_0xc7dc('0xe')](this));this['imap'][_0xc7dc('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xc7dc('0x9')]=function(_0x4e91b9,_0x39ab8b){var _0x5e6b9c={'connTimeout':_0x4e91b9['connTimeout']?_0x4e91b9[_0xc7dc('0x14')]*0x3e8:0x2710,'authTimeout':_0x4e91b9[_0xc7dc('0x15')]?_0x4e91b9[_0xc7dc('0x15')]*0x3e8:0x1388};if(_0x4e91b9[_0xc7dc('0x16')]){_0x5e6b9c[_0xc7dc('0x17')]=_0x4e91b9[_0xc7dc('0x17')];if(_0x4e91b9['modernAuthentication']){_0x5e6b9c['xoauth2']=utils[_0xc7dc('0x18')](_0x4e91b9[_0xc7dc('0x19')][_0xc7dc('0x1a')],_0x4e91b9['user']);}else{_0x5e6b9c[_0xc7dc('0x1b')]=_0x4e91b9[_0xc7dc('0x1b')];}}else{if(_0x4e91b9[_0xc7dc('0x1c')]){_0x5e6b9c['user']=_0x4e91b9[_0xc7dc('0x17')];_0x5e6b9c['password']=_0x4e91b9[_0xc7dc('0x1b')];}}_0x5e6b9c['email']=_0x39ab8b||_0x4e91b9[_0xc7dc('0x17')]||_0xc7dc('0x1d');_0x5e6b9c['host']=_0x4e91b9[_0xc7dc('0x1e')];_0x5e6b9c[_0xc7dc('0x1f')]=_0x4e91b9[_0xc7dc('0x1f')]||0x3e1;if(_0x4e91b9[_0xc7dc('0x20')]){_0x5e6b9c[_0xc7dc('0x20')]=!![];}else{_0x5e6b9c[_0xc7dc('0x20')]=![];_0x5e6b9c[_0xc7dc('0x21')]=_0xc7dc('0x22');}return _0x5e6b9c;};EmailImap[_0xc7dc('0x23')]['handleReady']=function(){this[_0xc7dc('0xa')][_0xc7dc('0x24')](this[_0xc7dc('0x7')],![],this[_0xc7dc('0x25')][_0xc7dc('0xe')](this));};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x25')]=function(_0x32afcc,_0x243e7d){if(_0x32afcc){this[_0xc7dc('0x12')](_0x32afcc,!![]);}else{this[_0xc7dc('0x26')]('box',_0x243e7d);this[_0xc7dc('0x27')]();}};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x28')]=function(_0x2dbc14){if(_0x2dbc14){this[_0xc7dc('0x12')](_0x2dbc14,!![]);}else{this[_0xc7dc('0xa')][_0xc7dc('0xf')]();}};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x27')]=function(){this[_0xc7dc('0xa')][_0xc7dc('0x29')]([_0xc7dc('0x2a')],this[_0xc7dc('0x2b')]['bind'](this));};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x2b')]=function(_0x3164b5,_0x1c334a){if(_0x3164b5){this[_0xc7dc('0x12')](_0x3164b5,!![]);}else{if(_0x1c334a[_0xc7dc('0x2c')]){try{var _0x436676=this[_0xc7dc('0xa')][_0xc7dc('0x2d')](_0x1c334a,{'bodies':'','markSeen':!![]});_0x436676['on']('message',this['handleFetchMessage'][_0xc7dc('0xe')](this));_0x436676[_0xc7dc('0xb')](_0xc7dc('0x11'),this['handleFetchError'][_0xc7dc('0xe')](this));_0x436676[_0xc7dc('0xb')](_0xc7dc('0xf'),this['handleFetchEnd'][_0xc7dc('0xe')](this));}catch(_0xb3be41){logger[_0xc7dc('0x11')](_0xb3be41);}}else{this[_0xc7dc('0xa')][_0xc7dc('0x2e')](!![],this[_0xc7dc('0x28')]['bind'](this));}}};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x2f')]=function(_0x110ee0){_0x110ee0['on'](_0xc7dc('0x30'),this[_0xc7dc('0x31')]['bind'](this));_0x110ee0[_0xc7dc('0xb')]('attributes',this[_0xc7dc('0x32')]['bind'](this));_0x110ee0[_0xc7dc('0xb')](_0xc7dc('0xf'),this[_0xc7dc('0x33')][_0xc7dc('0xe')](this));};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x31')]=function(_0x93809e){simpleParser(_0x93809e,{'Iconv':Iconv},this[_0xc7dc('0x34')][_0xc7dc('0xe')](this));};EmailImap['prototype'][_0xc7dc('0x32')]=function(){};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x33')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x55999b,_0x32a53b){if(_0x55999b){logger[_0xc7dc('0x11')](_0x55999b);}else{var _0xf2fc88=this;utils[_0xc7dc('0x35')](this[_0xc7dc('0x8')],_0x32a53b,function(_0x36f022){_0xf2fc88[_0xc7dc('0x26')](_0xc7dc('0x6'),_0x36f022);});}};EmailImap[_0xc7dc('0x23')][_0xc7dc('0x36')]=function(){this[_0xc7dc('0xa')][_0xc7dc('0x2e')](!![],this['handleCloseBox'][_0xc7dc('0xe')](this));};EmailImap['prototype'][_0xc7dc('0x37')]=function(_0x2f1e6f){this[_0xc7dc('0x12')](_0x2f1e6f);this[_0xc7dc('0xa')][_0xc7dc('0x2e')](!![],this['handleCloseBox'][_0xc7dc('0xe')](this));};EmailImap['prototype'][_0xc7dc('0x10')]=function(){this[_0xc7dc('0x26')](_0xc7dc('0xf'));};EmailImap['prototype'][_0xc7dc('0x12')]=function(_0x1eb6c1,_0x2f6505){logger[_0xc7dc('0x11')]('handleError',this[_0xc7dc('0x8')]['email'],JSON[_0xc7dc('0x38')](_0x1eb6c1));var _0x146b95='';if(_0x1eb6c1){if(_0x1eb6c1[_0xc7dc('0x39')]){_0x146b95=_0x1eb6c1['textCode'];}else{for(var _0xb63a8c in _0x1eb6c1){if(_0x1eb6c1[_0xc7dc('0x3a')](_0xb63a8c)){_0x146b95+=_[_0xc7dc('0x3b')](_0xb63a8c)+':\x20'+_0x1eb6c1[_0xb63a8c]+'\x0a';}}}}if(_0x2f6505){this[_0xc7dc('0xa')][_0xc7dc('0xf')]();}else{this[_0xc7dc('0x26')](_0xc7dc('0x11'),_0x146b95);this[_0xc7dc('0x26')](_0xc7dc('0xf'));}};module[_0xc7dc('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 93be68b..1d2976d 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 _0x7f52=['use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x7f52,0x9c));var _0x27f5=function(_0x3bc158,_0x436e3a){_0x3bc158=_0x3bc158-0x0;var _0x977671=_0x7f52[_0x3bc158];return _0x977671;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x27f5('0x0'));function EmailSmtp(){}EmailSmtp[_0x27f5('0x1')][_0x27f5('0x2')]=function(_0x1d50d6,_0x2921a3){return new Promise(function(_0x1e8944,_0x386fdb){var _0x5a92ea=nodemailer[_0x27f5('0x3')](_0x1d50d6);_0x5a92ea[_0x27f5('0x4')]('compile',inlineBase64());_0x5a92ea[_0x27f5('0x5')](_0x2921a3,function(_0x138a60,_0xcbeae1){if(_0x138a60){_0x386fdb(_0x138a60[_0x27f5('0x6')]());}else{_0x1e8944(_0xcbeae1);}});});};EmailSmtp[_0x27f5('0x1')][_0x27f5('0x7')]=function(_0x2525e4){return new Promise(function(_0xe9ccdf,_0x413cfb){var _0x7acc14=nodemailer[_0x27f5('0x3')](_0x2525e4);_0x7acc14['verify'](function(_0x1a2326,_0x2ffa83){if(_0x1a2326){_0x413cfb(_0x1a2326['toString']());}else{if(_0x2ffa83){_0xe9ccdf(_0x2ffa83);}else{_0x413cfb(_0x27f5('0x8'));}}});});};module[_0x27f5('0x9')]=EmailSmtp; \ No newline at end of file +var _0xdfb9=['compile','sendMail','toString','verify','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdfb9,0x144));var _0x9dfb=function(_0x1b8177,_0x54e643){_0x1b8177=_0x1b8177-0x0;var _0x56e30c=_0xdfb9[_0x1b8177];return _0x56e30c;};'use strict';var nodemailer=require(_0x9dfb('0x0'));var inlineBase64=require(_0x9dfb('0x1'));function EmailSmtp(){}EmailSmtp[_0x9dfb('0x2')][_0x9dfb('0x3')]=function(_0x4ac86b,_0x108703){return new Promise(function(_0x228297,_0x8f84da){var _0x596287=nodemailer[_0x9dfb('0x4')](_0x4ac86b);_0x596287[_0x9dfb('0x5')](_0x9dfb('0x6'),inlineBase64());_0x596287[_0x9dfb('0x7')](_0x108703,function(_0x3fb044,_0x1392ee){if(_0x3fb044){_0x8f84da(_0x3fb044[_0x9dfb('0x8')]());}else{_0x228297(_0x1392ee);}});});};EmailSmtp[_0x9dfb('0x2')][_0x9dfb('0x9')]=function(_0x336ea5){return new Promise(function(_0x19a42f,_0x3f84bc){var _0x214b45=nodemailer[_0x9dfb('0x4')](_0x336ea5);_0x214b45['verify'](function(_0x3acec5,_0x3e6cb0){if(_0x3acec5){_0x3f84bc(_0x3acec5['toString']());}else{if(_0x3e6cb0){_0x19a42f(_0x3e6cb0);}else{_0x3f84bc('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 09c6159..4651041 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 _0x1826=['headerLines','line','isAutoreply','from','subject','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','Attachments','

Empty\x20message

','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x275c57[_0x6182('0x13')](0x0,-0x1)[_0x6182('0x14')]('\x20'):_0x2571d8[_0x6182('0xe')];}return _0x6182('0x15');}function getLastName(_0x3dcecc){var _0x30fedc=_[_0x6182('0x8')](_0x3dcecc[_0x6182('0x9')]);if(_0x30fedc&&_0x30fedc['name']){var _0x32ebee=_0x30fedc[_0x6182('0xe')][_0x6182('0x11')](/\s+/);return _0x32ebee[_0x6182('0x12')]>0x1?_0x32ebee[_0x6182('0x16')]():'';}return'';}function getMails(_0x5e7859,_0x5ad03a){var _0x479532='';for(var _0x3d45fd=0x0;_0x3d45fd<_0x5ad03a[_0x6182('0x9')][_0x6182('0x12')];_0x3d45fd+=0x1){if(_0x5ad03a[_0x6182('0x9')][_0x3d45fd][_0x6182('0xa')]!==_0x5e7859){if(!_[_0x6182('0x17')](_0x479532)){_0x479532+=',';}_0x479532+=_0x5ad03a[_0x6182('0x9')][_0x3d45fd][_0x6182('0xe')]||_0x5ad03a['value'][_0x3d45fd]['address']||'';_0x479532+='\x20<';_0x479532+=_0x5ad03a['value'][_0x3d45fd][_0x6182('0xa')]?_0x5ad03a[_0x6182('0x9')][_0x3d45fd][_0x6182('0xa')]:_0x6182('0xb')+random[_0x6182('0xc')](0x6)+'@xcally.com';_0x479532+='>';}}return _0x479532;}function parseEmail(_0x2278c1,_0x510b00,_0x34c4ba){if(_0x510b00['html']){var _0x20dbf6=/)<[^<]*)*<\/script>/gi;while(_0x20dbf6['test'](_0x510b00[_0x6182('0x18')])){_0x510b00['html']=_0x510b00[_0x6182('0x18')]['replace'](_0x20dbf6,'');}if(_0x510b00[_0x6182('0x18')]['includes'](_0x6182('0x19'))){var _0xd34ed8=[];_0x510b00[_0x6182('0x1a')][_0x6182('0x1b')](_0x5d3280=>{_0xd34ed8[_0x6182('0x1c')](_0x5d3280[_0x6182('0x1d')]);});var _0x2d1301=/]+>/g;var _0x45b046=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1ad73a=_0x510b00['html']['replace'](_0x45b046,_0x6182('0x1e'));var _0x15e4e2=_0x1ad73a[_0x6182('0x1f')](_0x2d1301,_0x6182('0x20'));for(let _0x6fa081=0x0;_0x6fa081<_0xd34ed8[_0x6182('0x12')];_0x6fa081++){var _0x54bedc=_0x15e4e2['replace']('_IMG',_0x6182('0x21')+_0xd34ed8[_0x6fa081]+_0x6182('0x22'));_0x15e4e2=_0x54bedc;}_0x510b00[_0x6182('0x18')]=_0x15e4e2;}_0x34c4ba[_0x6182('0x23')]=_0x510b00['html'];}else{_0x34c4ba[_0x6182('0x23')]=_0x510b00[_0x6182('0x24')];}if(_0x34c4ba[_0x6182('0x23')]){_0x34c4ba[_0x6182('0x23')]=_0x34c4ba[_0x6182('0x23')][_0x6182('0x1f')](/0x0){var _0x24f900=[_0x6182('0x36'),_0x6182('0x37'),'Precedence:\x20auto_reply'];for(var _0x7d1d74=0x0;_0x7d1d74<_0x510b00[_0x6182('0x38')]['length'];_0x7d1d74++){var _0x2e5df3=_['indexOf'](_0x24f900,_0x510b00['headerLines'][_0x7d1d74][_0x6182('0x39')]);if(_0x2e5df3>=0x0){_0x34c4ba[_0x6182('0x3a')]=!![];}}}return _0x34c4ba;}exports['parser']=function(_0x2e36f1,_0x1243c1,_0x3fc59e){var _0x4358b5={'from':getAddress(_0x1243c1[_0x6182('0x3b')]),'firstName':getFirstName(_0x1243c1['from']),'lastName':getLastName(_0x1243c1['from']),'mapKey':_0x6182('0x7'),'message':{'from':getMails(_0x2e36f1[_0x6182('0x7')],_0x1243c1[_0x6182('0x3b')]),'to':_0x2e36f1[_0x6182('0x7')],'cc':'','subject':_0x1243c1[_0x6182('0x3c')]||'','messageId':_0x1243c1['messageId'],'inReplyTo':_0x1243c1[_0x6182('0x3d')],'sentAt':moment(_0x1243c1['date'])[_0x6182('0x2f')](_0x6182('0x3e')),'attach':![],'attachments':[]}};if(!_0x1243c1[_0x6182('0x18')]&&!_0x1243c1[_0x6182('0x24')]){var _0x1587c1=_[_0x6182('0x3f')](_0x1243c1[_0x6182('0x1a')],{'contentType':_0x6182('0x40')});if(_0x1587c1['length']){logger[_0x6182('0x41')](util[_0x6182('0x2f')](_0x6182('0x42'),_0x1243c1[_0x6182('0x43')]));tnef[_0x6182('0x44')](_[_0x6182('0x45')](_0x1587c1)[_0x6182('0x34')],function(_0x322bf1,_0x4d369d){if(_0x4d369d){_0x1243c1[_0x6182('0x18')]=_0x4d369d['BodyHTML']||'

Empty\x20message

';if(_0x4d369d[_0x6182('0x46')]){for(var _0x185da8=0x0;_0x185da8<_0x4d369d[_0x6182('0x46')][_0x6182('0x12')];_0x185da8++){var _0x9075d=_0x4d369d['Attachments'][_0x185da8];_0x4358b5[_0x6182('0x26')][_0x6182('0x1a')][_0x6182('0x1c')]({'filename':_0x9075d['Title'],'content':Buffer[_0x6182('0x3b')](_0x9075d['Data'])});}}}_0x3fc59e(parseEmail(_0x2e36f1,_0x1243c1,_0x4358b5));});}else{_0x1243c1['html']=_0x6182('0x47');_0x3fc59e(parseEmail(_0x2e36f1,_0x1243c1,_0x4358b5));}}else{_0x3fc59e(parseEmail(_0x2e36f1,_0x1243c1,_0x4358b5));}};exports[_0x6182('0x48')]=function(_0x193179,_0x35988a){var _0xe97f1a=[_0x6182('0x49')+(_0x35988a||''),_0x6182('0x4a')+_0x193179,'',''];return Buffer[_0x6182('0x3b')](_0xe97f1a[_0x6182('0x14')](''),_0x6182('0x4b'))[_0x6182('0x4c')](_0x6182('0x4d'));}; \ No newline at end of file +var _0xdd35=['Attachments','Title','user=','utf-8','base64','lodash','moment','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','generate','html','replace','','body','textAsHtml','Empty\x20message

'];(function(_0x240170,_0x2ac572){var _0x5f465d=function(_0xa156c5){while(--_0xa156c5){_0x240170['push'](_0x240170['shift']());}};_0x5f465d(++_0x2ac572);}(_0xdd35,0x89));var _0x5dd3=function(_0x34b4a3,_0x4a0d8a){_0x34b4a3=_0x34b4a3-0x0;var _0x132a88=_0xdd35[_0x34b4a3];return _0x132a88;};'use strict';var _=require(_0x5dd3('0x0'));var moment=require(_0x5dd3('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x5dd3('0x2'));var tnef=require(_0x5dd3('0x3'));var logger=require(_0x5dd3('0x4'))(_0x5dd3('0x5'));var config=require('../../../config/environment');function getAddress(_0x10708e){var _0x22ccd4=_[_0x5dd3('0x6')](_0x10708e[_0x5dd3('0x7')]);return _0x22ccd4&&_0x22ccd4[_0x5dd3('0x8')]?_0x22ccd4[_0x5dd3('0x8')]:_0x5dd3('0x9')+random['generate'](0x6)+_0x5dd3('0xa');}function getFirstName(_0x3906fd){var _0x563965=_[_0x5dd3('0x6')](_0x3906fd[_0x5dd3('0x7')]);if(_0x563965&&_0x563965[_0x5dd3('0xb')]){if(_0x563965[_0x5dd3('0xb')]==_0x563965[_0x5dd3('0x8')]){return _0x563965[_0x5dd3('0xb')][_0x5dd3('0xc')](0x0,_0x563965[_0x5dd3('0xb')][_0x5dd3('0xd')]('@'));}var _0x4d808f=_0x563965['name'][_0x5dd3('0xe')](/\s+/);return _0x4d808f[_0x5dd3('0xf')]>0x1?_0x4d808f[_0x5dd3('0x10')](0x0,-0x1)[_0x5dd3('0x11')]('\x20'):_0x563965[_0x5dd3('0xb')];}return _0x5dd3('0x12');}function getLastName(_0x4b6edb){var _0x3b662e=_[_0x5dd3('0x6')](_0x4b6edb['value']);if(_0x3b662e&&_0x3b662e[_0x5dd3('0xb')]){var _0x2507f4=_0x3b662e['name'][_0x5dd3('0xe')](/\s+/);return _0x2507f4[_0x5dd3('0xf')]>0x1?_0x2507f4['pop']():'';}return'';}function getMails(_0x35af0c,_0x339cef){var _0x50cee0='';for(var _0x50cf03=0x0;_0x50cf03<_0x339cef['value']['length'];_0x50cf03+=0x1){if(_0x339cef['value'][_0x50cf03][_0x5dd3('0x8')]!==_0x35af0c){if(!_['isEmpty'](_0x50cee0)){_0x50cee0+=',';}_0x50cee0+=_0x339cef[_0x5dd3('0x7')][_0x50cf03][_0x5dd3('0xb')]||_0x339cef[_0x5dd3('0x7')][_0x50cf03][_0x5dd3('0x8')]||'';_0x50cee0+='\x20<';_0x50cee0+=_0x339cef['value'][_0x50cf03][_0x5dd3('0x8')]?_0x339cef[_0x5dd3('0x7')][_0x50cf03][_0x5dd3('0x8')]:_0x5dd3('0x9')+random[_0x5dd3('0x13')](0x6)+_0x5dd3('0xa');_0x50cee0+='>';}}return _0x50cee0;}function parseEmail(_0x329660,_0xa44de9,_0x4fb6fc){if(_0xa44de9[_0x5dd3('0x14')]){var _0x4b985f=/)<[^<]*)*<\/script>/gi;while(_0x4b985f['test'](_0xa44de9[_0x5dd3('0x14')])){_0xa44de9[_0x5dd3('0x14')]=_0xa44de9['html'][_0x5dd3('0x15')](_0x4b985f,'');}if(_0xa44de9[_0x5dd3('0x14')]['includes'](_0x5dd3('0x16'))){var _0x57bc61=[];_0xa44de9[_0x5dd3('0x17')][_0x5dd3('0x18')](_0xbf5e28=>{_0x57bc61[_0x5dd3('0x19')](_0xbf5e28[_0x5dd3('0x1a')]);});var _0x37d76b=/]+>/g;var _0x54f931=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1a442c=_0xa44de9[_0x5dd3('0x14')][_0x5dd3('0x15')](_0x54f931,_0x5dd3('0x1b'));var _0x17aac8=_0x1a442c[_0x5dd3('0x15')](_0x37d76b,'_IMG');for(let _0x1edb1d=0x0;_0x1edb1d<_0x57bc61[_0x5dd3('0xf')];_0x1edb1d++){var _0x32b4bc=_0x17aac8['replace'](_0x5dd3('0x1c'),'\x20[Attachment:\x20'+_0x57bc61[_0x1edb1d]+_0x5dd3('0x1d'));_0x17aac8=_0x32b4bc;}_0xa44de9[_0x5dd3('0x14')]=_0x17aac8;}_0x4fb6fc['body']=_0xa44de9[_0x5dd3('0x14')];}else{_0x4fb6fc[_0x5dd3('0x1e')]=_0xa44de9[_0x5dd3('0x1f')];}if(_0x4fb6fc['body']){_0x4fb6fc[_0x5dd3('0x1e')]=_0x4fb6fc[_0x5dd3('0x1e')][_0x5dd3('0x15')](/0x0){var _0x23ba03=['Auto-Submitted:\x20auto-replied',_0x5dd3('0x32'),'Precedence:\x20auto_reply'];for(var _0x22fece=0x0;_0x22fece<_0xa44de9[_0x5dd3('0x31')][_0x5dd3('0xf')];_0x22fece++){var _0xc5ba0c=_['indexOf'](_0x23ba03,_0xa44de9[_0x5dd3('0x31')][_0x22fece]['line']);if(_0xc5ba0c>=0x0){_0x4fb6fc['isAutoreply']=!![];}}}return _0x4fb6fc;}exports['parser']=function(_0x39d215,_0xf06a9c,_0x2f42ea){var _0x57e4e8={'from':getAddress(_0xf06a9c[_0x5dd3('0x33')]),'firstName':getFirstName(_0xf06a9c[_0x5dd3('0x33')]),'lastName':getLastName(_0xf06a9c['from']),'mapKey':'email','message':{'from':getMails(_0x39d215[_0x5dd3('0x5')],_0xf06a9c[_0x5dd3('0x33')]),'to':_0x39d215[_0x5dd3('0x5')],'cc':'','subject':_0xf06a9c[_0x5dd3('0x34')]||'','messageId':_0xf06a9c['messageId'],'inReplyTo':_0xf06a9c['inReplyTo'],'sentAt':moment(_0xf06a9c[_0x5dd3('0x35')])[_0x5dd3('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0xf06a9c[_0x5dd3('0x14')]&&!_0xf06a9c[_0x5dd3('0x1f')]){var _0x235078=_[_0x5dd3('0x36')](_0xf06a9c[_0x5dd3('0x17')],{'contentType':'application/ms-tnef'});if(_0x235078[_0x5dd3('0xf')]){logger['info'](util[_0x5dd3('0x2b')](_0x5dd3('0x37'),_0xf06a9c[_0x5dd3('0x38')]));tnef[_0x5dd3('0x39')](_[_0x5dd3('0x3a')](_0x235078)[_0x5dd3('0x2f')],function(_0x2b040c,_0x1323c8){if(_0x1323c8){_0xf06a9c[_0x5dd3('0x14')]=_0x1323c8[_0x5dd3('0x3b')]||_0x5dd3('0x3c');if(_0x1323c8[_0x5dd3('0x3d')]){for(var _0x25a6d2=0x0;_0x25a6d2<_0x1323c8['Attachments']['length'];_0x25a6d2++){var _0x180529=_0x1323c8[_0x5dd3('0x3d')][_0x25a6d2];_0x57e4e8[_0x5dd3('0x21')][_0x5dd3('0x17')][_0x5dd3('0x19')]({'filename':_0x180529[_0x5dd3('0x3e')],'content':Buffer[_0x5dd3('0x33')](_0x180529['Data'])});}}}_0x2f42ea(parseEmail(_0x39d215,_0xf06a9c,_0x57e4e8));});}else{_0xf06a9c[_0x5dd3('0x14')]='

Empty\x20message

';_0x2f42ea(parseEmail(_0x39d215,_0xf06a9c,_0x57e4e8));}}else{_0x2f42ea(parseEmail(_0x39d215,_0xf06a9c,_0x57e4e8));}};exports['generateXOAuth2Token']=function(_0x15fcba,_0x16cd28){var _0x39b05e=[_0x5dd3('0x3f')+(_0x16cd28||''),'auth=Bearer\x20'+_0x15fcba,'',''];return Buffer[_0x5dd3('0x33')](_0x39b05e[_0x5dd3('0x11')](''),_0x5dd3('0x40'))['toString'](_0x5dd3('0x41'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c8d594b..1d84557 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 _0xe076=['key','active','Imap','Smtp','exports','name','Service'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe076,0x1a9));var _0x6e07=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xe076[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');function MailAccount(_0x59d9d8){this['id']=_0x59d9d8['id']||0x0;this[_0x6e07('0x0')]=_0x59d9d8[_0x6e07('0x0')]||_0x6e07('0x1');this[_0x6e07('0x2')]=_0x59d9d8[_0x6e07('0x2')]||'SERV';this[_0x6e07('0x3')]=_0x59d9d8[_0x6e07('0x3')]||![];this['Imap']=_0x59d9d8[_0x6e07('0x4')]||[];this['Smtp']=_0x59d9d8[_0x6e07('0x5')]||[];}module[_0x6e07('0x6')]=MailAccount; \ No newline at end of file +var _0xd0b1=['active','Smtp','name','Service','key','SERV'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xd0b1,0x6e));var _0x1d0b=function(_0x172003,_0x27f07e){_0x172003=_0x172003-0x0;var _0xfefba9=_0xd0b1[_0x172003];return _0xfefba9;};'use strict';var _=require('lodash');function MailAccount(_0x62abeb){this['id']=_0x62abeb['id']||0x0;this['name']=_0x62abeb[_0x1d0b('0x0')]||_0x1d0b('0x1');this['key']=_0x62abeb[_0x1d0b('0x2')]||_0x1d0b('0x3');this[_0x1d0b('0x4')]=_0x62abeb[_0x1d0b('0x4')]||![];this['Imap']=_0x62abeb['Imap']||[];this[_0x1d0b('0x5')]=_0x62abeb[_0x1d0b('0x5')]||[];}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 b421d10..ef877f3 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 _0x68bf=['initMailAccounts','mailAccounts','isUndefined','merge','exports','mapKeys','hasOwnProperty','mergeFromDatabase','prototype'];(function(_0x176f3b,_0x2cf23b){var _0x492555=function(_0x458d33){while(--_0x458d33){_0x176f3b['push'](_0x176f3b['shift']());}};_0x492555(++_0x2cf23b);}(_0x68bf,0x71));var _0xf68b=function(_0x1a18f9,_0x489be8){_0x1a18f9=_0x1a18f9-0x0;var _0x19db37=_0x68bf[_0x1a18f9];return _0x19db37;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5a1468,_0xf9abdf,_0x573698){var _0xb26ac9=_[_0xf68b('0x0')](_0x5a1468,function(_0xc154f7,_0x94e321){return _0xc154f7[_0x573698];});for(var _0x2c8897 in _0xf9abdf){if(_0xf9abdf[_0xf68b('0x1')](_0x2c8897)){if(!_0xb26ac9[_0x2c8897]){delete _0xf9abdf[_0x2c8897];}}}}Realtime['prototype'][_0xf68b('0x2')]=function(_0x417067,_0x5f1d1e){for(var _0x14dc9a in _0x5f1d1e){if(_0x417067[_0xf68b('0x1')](_0x14dc9a)){_0x417067[_0x14dc9a]=_0x5f1d1e[_0x14dc9a];}}};Realtime[_0xf68b('0x3')][_0xf68b('0x4')]=function(){var _0x22ad47=this;return function(_0x413d9f){if(_0x413d9f){freeIsNotKey(_0x413d9f,_0x22ad47[_0xf68b('0x5')],'id');for(var _0xdd387c=0x0,_0x2124f3={},_0x1664a9={};_0xdd387c<_0x413d9f['length'];_0xdd387c+=0x1){_0x2124f3=_0x413d9f[_0xdd387c];if(_[_0xf68b('0x6')](_0x22ad47[_0xf68b('0x5')][_0x2124f3['id']])){_0x22ad47[_0xf68b('0x5')][_0x2124f3['id']]=new MailAccount(_0x2124f3);}else{_[_0xf68b('0x7')](_0x22ad47['mailAccounts'][_0x2124f3['id']],_0x2124f3);}}}return _0x22ad47['mailAccounts'];};};module[_0xf68b('0x8')]=Realtime; \ No newline at end of file +var _0x3029=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','merge'];(function(_0x7d0270,_0x55ec4f){var _0x524de8=function(_0x3c2404){while(--_0x3c2404){_0x7d0270['push'](_0x7d0270['shift']());}};_0x524de8(++_0x55ec4f);}(_0x3029,0x79));var _0x9302=function(_0xc8069a,_0x2968fc){_0xc8069a=_0xc8069a-0x0;var _0x16bc69=_0x3029[_0xc8069a];return _0x16bc69;};'use strict';var _=require(_0x9302('0x0'));var MailAccount=require(_0x9302('0x1'));var Realtime=function(){this[_0x9302('0x2')]={};};function freeIsNotKey(_0x2a39ad,_0xf553e2,_0x53fe46){var _0x325cd4=_[_0x9302('0x3')](_0x2a39ad,function(_0x46e793,_0x4aae10){return _0x46e793[_0x53fe46];});for(var _0x343eec in _0xf553e2){if(_0xf553e2[_0x9302('0x4')](_0x343eec)){if(!_0x325cd4[_0x343eec]){delete _0xf553e2[_0x343eec];}}}}Realtime[_0x9302('0x5')]['mergeFromDatabase']=function(_0x2808d8,_0x36494d){for(var _0x117c48 in _0x36494d){if(_0x2808d8[_0x9302('0x4')](_0x117c48)){_0x2808d8[_0x117c48]=_0x36494d[_0x117c48];}}};Realtime[_0x9302('0x5')][_0x9302('0x6')]=function(){var _0x21b0df=this;return function(_0x240027){if(_0x240027){freeIsNotKey(_0x240027,_0x21b0df[_0x9302('0x2')],'id');for(var _0x422d74=0x0,_0x455553={},_0x44fe78={};_0x422d74<_0x240027[_0x9302('0x7')];_0x422d74+=0x1){_0x455553=_0x240027[_0x422d74];if(_['isUndefined'](_0x21b0df[_0x9302('0x2')][_0x455553['id']])){_0x21b0df[_0x9302('0x2')][_0x455553['id']]=new MailAccount(_0x455553);}else{_[_0x9302('0x8')](_0x21b0df[_0x9302('0x2')][_0x455553['id']],_0x455553);}}}return _0x21b0df[_0x9302('0x2')];};};module[_0x9302('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index e856da9..c5b9ba2 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 _0x2d06=['getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x2d06,0x157));var _0x62d0=function(_0x4c4a1c,_0x163b9c){_0x4c4a1c=_0x4c4a1c-0x0;var _0x454c09=_0x2d06[_0x4c4a1c];return _0x454c09;};'use strict';var client=require('../client');exports[_0x62d0('0x0')]=function(){return function(){return client[_0x62d0('0x1')](_0x62d0('0x2'),{'options':{'attributes':['id',_0x62d0('0x3'),'provider',_0x62d0('0x4'),_0x62d0('0x5'),_0x62d0('0x6'),_0x62d0('0x7'),'ListId',_0x62d0('0x8')],'raw':![],'include':[{'model':_0x62d0('0x9'),'as':'Imap','include':[{'model':_0x62d0('0xa'),'attributes':['id',_0x62d0('0x3'),'service',_0x62d0('0xb'),_0x62d0('0xc')],'as':_0x62d0('0xa')}]},{'model':_0x62d0('0xd'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x62d0('0x3'),_0x62d0('0x4'),_0x62d0('0xb'),_0x62d0('0xc')],'as':_0x62d0('0xa')}]}]},'log':_0x62d0('0xe')});};};exports[_0x62d0('0xf')]=function(_0x1fc939,_0x3d8ffa){return client[_0x62d0('0x1')](_0x62d0('0x10'),{'account':{'id':_0x1fc939},'body':_0x3d8ffa,'log':_0x62d0('0x10')});}; \ No newline at end of file +var _0x2d2c=['TemplateId','MailServerIn','Imap','service','type','data5','CloudProvider','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','key','ListId'];(function(_0x3db8d4,_0x340d1c){var _0x2d1fe2=function(_0xe12114){while(--_0xe12114){_0x3db8d4['push'](_0x3db8d4['shift']());}};_0x2d1fe2(++_0x340d1c);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x40bc01,_0x22a9a9){_0x40bc01=_0x40bc01-0x0;var _0x42365b=_0x2d2c[_0x40bc01];return _0x42365b;};'use strict';var client=require(_0xc2d2('0x0'));exports[_0xc2d2('0x1')]=function(){return function(){return client[_0xc2d2('0x2')](_0xc2d2('0x3'),{'options':{'attributes':['id',_0xc2d2('0x4'),_0xc2d2('0x5'),'service',_0xc2d2('0x6'),'active',_0xc2d2('0x7'),_0xc2d2('0x8'),_0xc2d2('0x9')],'raw':![],'include':[{'model':_0xc2d2('0xa'),'as':_0xc2d2('0xb'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xc2d2('0xc'),_0xc2d2('0xd'),_0xc2d2('0xe')],'as':_0xc2d2('0xf')}]},{'model':_0xc2d2('0x10'),'as':_0xc2d2('0x11'),'include':[{'model':_0xc2d2('0xf'),'attributes':['id',_0xc2d2('0x4'),_0xc2d2('0xc'),_0xc2d2('0xd'),_0xc2d2('0xe')],'as':_0xc2d2('0xf')}]}]},'log':'getMailAccount'});};};exports[_0xc2d2('0x12')]=function(_0x13a247,_0x1e0cbc){return client['Request'](_0xc2d2('0x13'),{'account':{'id':_0x13a247},'body':_0x1e0cbc,'log':_0xc2d2('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 2357ee4..1d39f05 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 _0xb8b2=['loginMailFrequency','GetSettings','../client','getSettings','ShowSetting'];(function(_0x4442e2,_0x296062){var _0x3b32a4=function(_0x2acc14){while(--_0x2acc14){_0x4442e2['push'](_0x4442e2['shift']());}};_0x3b32a4(++_0x296062);}(_0xb8b2,0xcf));var _0x2b8b=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xb8b2[_0x424501];return _0xb719af;};'use strict';var client=require(_0x2b8b('0x0'));exports[_0x2b8b('0x1')]=function(){return client['Request'](_0x2b8b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2b8b('0x3')]},'log':_0x2b8b('0x4')});}; \ No newline at end of file +var _0x078e=['loginMailFrequency','../client','getSettings','Request','ShowSetting'];(function(_0x39fce3,_0x2e0f29){var _0x5f43dc=function(_0xb23298){while(--_0xb23298){_0x39fce3['push'](_0x39fce3['shift']());}};_0x5f43dc(++_0x2e0f29);}(_0x078e,0x15a));var _0xe078=function(_0x50a9a7,_0x2092b1){_0x50a9a7=_0x50a9a7-0x0;var _0xfd794a=_0x078e[_0x50a9a7];return _0xfd794a;};'use strict';var client=require(_0xe078('0x0'));exports[_0xe078('0x1')]=function(){return client[_0xe078('0x2')](_0xe078('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe078('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 1ffbaad..b9d5101 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 ec5b333..297147d 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 _0xa571=['timeout','port','socket.io','websocket','redis','defaults','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','createServer'];(function(_0x4f2e4b,_0x2d084c){var _0x3afdbb=function(_0x14b574){while(--_0x14b574){_0x4f2e4b['push'](_0x4f2e4b['shift']());}};_0x3afdbb(++_0x2d084c);}(_0xa571,0xcd));var _0x1a57=function(_0x2246e5,_0x4bbc60){_0x2246e5=_0x2246e5-0x0;var _0x3f1162=_0xa571[_0x2246e5];return _0x3f1162;};'use strict';var _=require(_0x1a57('0x0'));var http=require('http');var express=require(_0x1a57('0x1'));var sticky=require(_0x1a57('0x2'));var Redis=require(_0x1a57('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x1a57('0x4')](app);server[_0x1a57('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x1a57('0x6')])){var socketio=require(_0x1a57('0x7'))(server,{'transports':[_0x1a57('0x8'),'polling']});config[_0x1a57('0x9')]=_[_0x1a57('0xa')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0x1a57('0xb'))({'pubClient':new Redis(config[_0x1a57('0x9')]),'subClient':new Redis(config[_0x1a57('0x9')])}));require(_0x1a57('0xc'))[_0x1a57('0xd')]();require(_0x1a57('0xe'))[_0x1a57('0xd')](socketio);require(_0x1a57('0xf'))[_0x1a57('0xd')](app);require(_0x1a57('0x10'))[_0x1a57('0xd')](app);}else{server[_0x1a57('0x11')](_0x1a57('0x12'),function(){console['log'](_0x1a57('0x13'),config[_0x1a57('0x6')]);});}exports=module[_0x1a57('0x14')]=app; \ No newline at end of file +var _0x50fd=['../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','createServer','listen','port','socket.io','websocket','redis','defaults'];(function(_0x4fe1c4,_0x3257a0){var _0x1dae4a=function(_0xfd1957){while(--_0xfd1957){_0x4fe1c4['push'](_0x4fe1c4['shift']());}};_0x1dae4a(++_0x3257a0);}(_0x50fd,0x1c1));var _0xd50f=function(_0x1bb52c,_0x150996){_0x1bb52c=_0x1bb52c-0x0;var _0x367822=_0x50fd[_0x1bb52c];return _0x367822;};'use strict';var _=require(_0xd50f('0x0'));var http=require(_0xd50f('0x1'));var express=require(_0xd50f('0x2'));var sticky=require(_0xd50f('0x3'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0xd50f('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xd50f('0x5')](server,config[_0xd50f('0x6')])){var socketio=require(_0xd50f('0x7'))(server,{'transports':[_0xd50f('0x8'),'polling']});config[_0xd50f('0x9')]=_[_0xd50f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xd50f('0x9')]),'subClient':new Redis(config[_0xd50f('0x9')])}));require(_0xd50f('0xb'))[_0xd50f('0xc')]();require(_0xd50f('0xd'))[_0xd50f('0xc')](socketio);require(_0xd50f('0xe'))[_0xd50f('0xc')](app);require(_0xd50f('0xf'))[_0xd50f('0xc')](app);}else{server[_0xd50f('0x10')](_0xd50f('0x11'),function(){console[_0xd50f('0x12')](_0xd50f('0x13'),config['port']);});}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 ffc4701..9960c09 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 _0x7bf8=['bluebird','../../config/logger','client','error','rpc','routing','message','catch','exports','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7bf8,0x1a3));var _0x87bf=function(_0x2d5f57,_0x387714){_0x2d5f57=_0x2d5f57-0x0;var _0xc55ba9=_0x7bf8[_0x2d5f57];return _0xc55ba9;};'use strict';var jayson=require(_0x87bf('0x0'));var BPromise=require(_0x87bf('0x1'));var logger=require(_0x87bf('0x2'))('routing');var client=jayson[_0x87bf('0x3')]['http']({'port':0x2329});client['Request']=function(_0x4e84c4,_0x1d8f80){return new BPromise(function(_0x1d32fc,_0x3d62fa){return client['request'](_0x4e84c4,_0x1d8f80)['then'](function(_0x284ee5){logger['debug']('rpc','routing',_0x4e84c4,_0x1d8f80,_0x284ee5);if(_0x284ee5[_0x87bf('0x4')]){logger['error'](_0x87bf('0x5'),_0x87bf('0x6'),_0x4e84c4,_0x284ee5[_0x87bf('0x4')][_0x87bf('0x7')],_0x1d8f80);return _0x3d62fa(_0x284ee5[_0x87bf('0x4')][_0x87bf('0x7')]);}else{return _0x1d32fc(_0x284ee5['result']);}})[_0x87bf('0x8')](function(_0x574de6){logger[_0x87bf('0x4')]('rpc',_0x87bf('0x6'),_0x4e84c4,_0x574de6,_0x1d8f80);return _0x3d62fa(_0x574de6);});});};module[_0x87bf('0x9')]=client; \ No newline at end of file +var _0xc7c3=['jayson/promise','bluebird','../../config/logger','routing','client','request','debug','rpc','error','message','result','catch'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xc7c3,0xa8));var _0x3c7c=function(_0xd53e55,_0x3268cc){_0xd53e55=_0xd53e55-0x0;var _0x4b538c=_0xc7c3[_0xd53e55];return _0x4b538c;};'use strict';var jayson=require(_0x3c7c('0x0'));var BPromise=require(_0x3c7c('0x1'));var logger=require(_0x3c7c('0x2'))(_0x3c7c('0x3'));var client=jayson[_0x3c7c('0x4')]['http']({'port':0x2329});client['Request']=function(_0x5f4dc5,_0x14e387){return new BPromise(function(_0x27c06b,_0x3c6e1b){return client[_0x3c7c('0x5')](_0x5f4dc5,_0x14e387)['then'](function(_0x27f09d){logger[_0x3c7c('0x6')](_0x3c7c('0x7'),_0x3c7c('0x3'),_0x5f4dc5,_0x14e387,_0x27f09d);if(_0x27f09d['error']){logger[_0x3c7c('0x8')](_0x3c7c('0x7'),_0x3c7c('0x3'),_0x5f4dc5,_0x27f09d['error'][_0x3c7c('0x9')],_0x14e387);return _0x3c6e1b(_0x27f09d['error'][_0x3c7c('0x9')]);}else{return _0x27c06b(_0x27f09d[_0x3c7c('0xa')]);}})[_0x3c7c('0xb')](function(_0x10ec69){logger[_0x3c7c('0x8')](_0x3c7c('0x7'),_0x3c7c('0x3'),_0x5f4dc5,_0x10ec69,_0x14e387);return _0x3c6e1b(_0x10ec69);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index ec91893..4d510f1 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 _0x7b6e=['initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues'];(function(_0x75ea32,_0x3ec6eb){var _0x4d9b63=function(_0x229467){while(--_0x229467){_0x75ea32['push'](_0x75ea32['shift']());}};_0x4d9b63(++_0x3ec6eb);}(_0x7b6e,0xff));var _0xe7b6=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x7b6e[_0x4aa4e6];return _0x322588;};'use strict';var BPromise=require(_0xe7b6('0x0'));var server=require(_0xe7b6('0x1'));var Realtime=require(_0xe7b6('0x2'));var user=require(_0xe7b6('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xe7b6('0x4'));var chatQueue=require(_0xe7b6('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xe7b6('0x6'));var faxQueue=require(_0xe7b6('0x7'));var whatsappQueue=require(_0xe7b6('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe7b6('0x9')]()[_0xe7b6('0xa')](user[_0xe7b6('0xb')]())[_0xe7b6('0xa')](realtime[_0xe7b6('0xc')]())[_0xe7b6('0xa')](interval['getIntervals']())[_0xe7b6('0xa')](realtime[_0xe7b6('0xd')]())[_0xe7b6('0xa')](openchannelQueue[_0xe7b6('0xe')]())[_0xe7b6('0xa')](realtime[_0xe7b6('0xf')]())[_0xe7b6('0xa')](chatQueue[_0xe7b6('0x10')]())[_0xe7b6('0xa')](realtime[_0xe7b6('0x11')]())[_0xe7b6('0xa')](smsQueue['getSmsQueues']())[_0xe7b6('0xa')](realtime[_0xe7b6('0x12')]())[_0xe7b6('0xa')](mailQueue[_0xe7b6('0x13')]())['then'](realtime['initMailQueues']())[_0xe7b6('0xa')](faxQueue[_0xe7b6('0x14')]())[_0xe7b6('0xa')](realtime[_0xe7b6('0x15')]())[_0xe7b6('0xa')](whatsappQueue[_0xe7b6('0x16')]())[_0xe7b6('0xa')](realtime[_0xe7b6('0x17')]())[_0xe7b6('0xa')](function(){return realtime;});}function main(){return server[_0xe7b6('0x18')](realtime)[_0xe7b6('0xa')](function(_0x2eddf9){return initRealtime();})[_0xe7b6('0xa')](function(_0x473bae){return setInterval(initRealtime,0x1388);})[_0xe7b6('0x19')](function(_0x44a37c){console[_0xe7b6('0x1a')](_0x44a37c);});}main(); \ No newline at end of file +var _0x854c=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues'];(function(_0x3f56bc,_0x1277ad){var _0x3ee7db=function(_0x3d4d7f){while(--_0x3d4d7f){_0x3f56bc['push'](_0x3f56bc['shift']());}};_0x3ee7db(++_0x1277ad);}(_0x854c,0x19f));var _0xc854=function(_0x30732c,_0x48c9bb){_0x30732c=_0x30732c-0x0;var _0x324151=_0x854c[_0x30732c];return _0x324151;};'use strict';var BPromise=require(_0xc854('0x0'));var server=require(_0xc854('0x1'));var Realtime=require(_0xc854('0x2'));var user=require('./rpc/user');var interval=require(_0xc854('0x3'));var openchannelQueue=require(_0xc854('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xc854('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xc854('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc854('0x7')]()[_0xc854('0x8')](user[_0xc854('0x9')]())[_0xc854('0x8')](realtime[_0xc854('0xa')]())[_0xc854('0x8')](interval[_0xc854('0xb')]())[_0xc854('0x8')](realtime[_0xc854('0xc')]())[_0xc854('0x8')](openchannelQueue[_0xc854('0xd')]())['then'](realtime['initOpenchannelQueues']())[_0xc854('0x8')](chatQueue[_0xc854('0xe')]())['then'](realtime[_0xc854('0xf')]())[_0xc854('0x8')](smsQueue[_0xc854('0x10')]())[_0xc854('0x8')](realtime[_0xc854('0x11')]())[_0xc854('0x8')](mailQueue[_0xc854('0x12')]())['then'](realtime[_0xc854('0x13')]())[_0xc854('0x8')](faxQueue[_0xc854('0x14')]())[_0xc854('0x8')](realtime['initFaxQueues']())[_0xc854('0x8')](whatsappQueue[_0xc854('0x15')]())[_0xc854('0x8')](realtime[_0xc854('0x16')]())[_0xc854('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xc854('0x8')](function(_0xe66dbd){return initRealtime();})[_0xc854('0x8')](function(_0x291934){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1c26d8){console[_0xc854('0x17')](_0x1c26d8);});}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 da6fa71..429d374 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 _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(_0x541f4e,_0x1aaa66){var _0x48ad45=function(_0x4ae2c4){while(--_0x4ae2c4){_0x541f4e['push'](_0x541f4e['shift']());}};_0x48ad45(++_0x1aaa66);}(_0x326f,0xd1));var _0xf326=function(_0x5f3a4a,_0x569b7d){_0x5f3a4a=_0x5f3a4a-0x0;var _0x24131a=_0x326f[_0x5f3a4a];return _0x24131a;};'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 +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x5557c2,_0x37de81){var _0x2c1eff=function(_0xdda650){while(--_0xdda650){_0x5557c2['push'](_0x5557c2['shift']());}};_0x2c1eff(++_0x37de81);}(_0x5fc3,0xa8));var _0x35fc=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x5fc3[_0x44216d];return _0xeca523;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 6e1c458..4058318 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 _0xd666=['client','http','request','then','error','message','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x2753f7,_0x1c8651){var _0x74ffc2=function(_0x2496de){while(--_0x2496de){_0x2753f7['push'](_0x2753f7['shift']());}};_0x74ffc2(++_0x1c8651);}(_0xd666,0x13e));var _0x6d66=function(_0x4d50a1,_0x188247){_0x4d50a1=_0x4d50a1-0x0;var _0x2d733f=_0xd666[_0x4d50a1];return _0x2d733f;};'use strict';var BPromise=require(_0x6d66('0x0'));var jayson=require(_0x6d66('0x1'));var client=jayson[_0x6d66('0x2')][_0x6d66('0x3')]({'port':0x232b});function request(_0x257bd7,_0x257171){return new BPromise(function(_0xc22454,_0x3f4824){return client[_0x6d66('0x4')](_0x257bd7,_0x257171)[_0x6d66('0x5')](function(_0x2d7f8b){if(_0x2d7f8b[_0x6d66('0x6')]){return _0x3f4824(_0x2d7f8b[_0x6d66('0x6')][_0x6d66('0x7')]);}else{return _0xc22454(_0x2d7f8b['result']);}})[_0x6d66('0x8')](function(_0x2ccf98){return _0x3f4824(_0x2ccf98);});});}exports[_0x6d66('0x9')]=function(_0x3ae2e0,_0x2b37c5){return request('SendMail',{'account':_0x3ae2e0,'message':_0x2b37c5});}; \ No newline at end of file +var _0x5caa=['result','catch','sendMailMessage','jayson/promise','client','http','request','then','error'];(function(_0x20bad1,_0xac2743){var _0x3eeed2=function(_0x23e109){while(--_0x23e109){_0x20bad1['push'](_0x20bad1['shift']());}};_0x3eeed2(++_0xac2743);}(_0x5caa,0x17d));var _0xa5ca=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x5caa[_0x32f9ca];return _0x52e083;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa5ca('0x0'));var client=jayson[_0xa5ca('0x1')][_0xa5ca('0x2')]({'port':0x232b});function request(_0x31760e,_0x44a77c){return new BPromise(function(_0x40cf0c,_0x592b0c){return client[_0xa5ca('0x3')](_0x31760e,_0x44a77c)[_0xa5ca('0x4')](function(_0x3d98a8){if(_0x3d98a8[_0xa5ca('0x5')]){return _0x592b0c(_0x3d98a8[_0xa5ca('0x5')]['message']);}else{return _0x40cf0c(_0x3d98a8[_0xa5ca('0x6')]);}})[_0xa5ca('0x7')](function(_0x17c92f){return _0x592b0c(_0x17c92f);});});}exports[_0xa5ca('0x8')]=function(_0x15b441,_0x28e1e6){return request('SendMail',{'account':_0x15b441,'message':_0x28e1e6});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 0bdbcf5..2250784 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 _0x3d04=['chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','online','faxPause','mailStatus','faxStatusTime','smsStatusTime','stringify','emit','omit','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime'];(function(_0x4dbf27,_0x5263c8){var _0x317ac6=function(_0x2128ea){while(--_0x2128ea){_0x4dbf27['push'](_0x4dbf27['shift']());}};_0x317ac6(++_0x5263c8);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x43d0('0x0'));var md5=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var Redis=require(_0x43d0('0x3'));var config=require(_0x43d0('0x4'));config[_0x43d0('0x5')]=_[_0x43d0('0x6')](config[_0x43d0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x43d0('0x7'))(new Redis(config[_0x43d0('0x5')]));function Agent(_0x746f5e){this['id']=_0x746f5e['id']||0x0;this[_0x43d0('0x8')]=_0x746f5e['name']||'';this['online']=_0x746f5e['online']||!![];this['voicePause']=_0x746f5e[_0x43d0('0x9')]||![];this[_0x43d0('0xa')]=_0x746f5e[_0x43d0('0xa')]||![];this[_0x43d0('0xb')]=_0x746f5e[_0x43d0('0xb')]||![];this['faxPause']=_0x746f5e['faxPause']||![];this[_0x43d0('0xc')]=_0x746f5e['smsPause']||![];this['openchannelPause']=_0x746f5e[_0x43d0('0xd')]||![];this[_0x43d0('0xe')]=_0x43d0('0xf');this[_0x43d0('0x10')]=0x0;this['chatCapacity']=_0x746f5e[_0x43d0('0x11')]||0x0;this[_0x43d0('0x12')]=0x0;this['mailStatus']=_0x43d0('0xf');this[_0x43d0('0x13')]=0x0;this[_0x43d0('0x14')]=_0x746f5e['mailCapacity']||0x0;this[_0x43d0('0x15')]=0x0;this[_0x43d0('0x16')]=_0x43d0('0xf');this['faxStatusTime']=0x0;this[_0x43d0('0x17')]=_0x746f5e[_0x43d0('0x17')]||0x0;this[_0x43d0('0x18')]=0x0;this[_0x43d0('0x19')]=_0x43d0('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=0x0;this[_0x43d0('0x1c')]='unknown';this[_0x43d0('0x1d')]=0x0;this['whatsappCapacity']=_0x746f5e[_0x43d0('0x1e')]||0x0;this[_0x43d0('0x1f')]=0x0;this[_0x43d0('0x20')]='unknown';this[_0x43d0('0x21')]=0x0;this[_0x43d0('0x22')]=_0x746f5e['openchannelCapacity']||0x0;this[_0x43d0('0x23')]=0x0;this[_0x43d0('0x24')]=![];this[_0x43d0('0x25')]=undefined;this[_0x43d0('0x1')]='';this[_0x43d0('0x26')]={};this[_0x43d0('0x27')]={};this[_0x43d0('0x28')]={};this[_0x43d0('0x29')]={};this[_0x43d0('0x2a')]={};this[_0x43d0('0x2b')]={};this[_0x43d0('0x2c')]();}Agent[_0x43d0('0x2d')][_0x43d0('0x2e')]=function(_0xbc72e6){if(this[_0xbc72e6+_0x43d0('0x2f')]>0x0){if(this[_0xbc72e6+'Capacity']>0x0&&this[_0xbc72e6+_0x43d0('0x2f')]>=this[_0xbc72e6+_0x43d0('0x30')]){return'maxcapacity';}else{return _0x43d0('0x31');}}else{return'idle';}};Agent[_0x43d0('0x2d')][_0x43d0('0x2c')]=function(){var _0x5dd310=[_0x43d0('0x32'),_0x43d0('0x33'),'openchannel',_0x43d0('0x34'),_0x43d0('0x35'),_0x43d0('0x36')];for(var _0x5f16ac=0x0;_0x5f16ac<_0x5dd310[_0x43d0('0x37')];_0x5f16ac+=0x1){var _0x38e89e=this[_0x43d0('0x2e')](_0x5dd310[_0x5f16ac]);if(this[_0x5dd310[_0x5f16ac]+_0x43d0('0x38')]!==_0x38e89e){this[_0x5dd310[_0x5f16ac]+_0x43d0('0x39')]=_[_0x43d0('0x3a')](moment()[_0x43d0('0x3b')]('x'));}this[_0x5dd310[_0x5f16ac]+'Status']=_0x38e89e;}var _0x2b0784={'id':this['id'],'name':this[_0x43d0('0x8')],'online':this[_0x43d0('0x3c')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x43d0('0xc')],'faxPause':this[_0x43d0('0x3d')],'openchannelPause':this[_0x43d0('0xd')],'chatStatus':this[_0x43d0('0xe')],'chatStatusTime':this[_0x43d0('0x10')],'chatCapacity':this[_0x43d0('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x43d0('0x3e')],'mailStatusTime':this[_0x43d0('0x13')],'mailCapacity':this[_0x43d0('0x14')],'mailCurrentCapacity':this[_0x43d0('0x15')],'faxStatus':this[_0x43d0('0x16')],'faxStatusTime':this[_0x43d0('0x3f')],'faxCapacity':this[_0x43d0('0x17')],'faxCurrentCapacity':this[_0x43d0('0x18')],'smsStatus':this[_0x43d0('0x19')],'smsStatusTime':this[_0x43d0('0x40')],'smsCapacity':this[_0x43d0('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x43d0('0x1c')],'whatsappStatusTime':this[_0x43d0('0x1d')],'whatsappCapacity':this[_0x43d0('0x1e')],'whatsappCurrentCapacity':this[_0x43d0('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x43d0('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x43d0('0x23')],'busy':this[_0x43d0('0x24')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x43d0('0x26')],'faxWaitingInteractions':this[_0x43d0('0x27')],'mailWaitingInteractions':this[_0x43d0('0x28')],'openchannelWaitingInteractions':this[_0x43d0('0x29')],'smsWaitingInteractions':this[_0x43d0('0x2a')],'whatsappWaitingInteractions':this[_0x43d0('0x2b')]};var _0x35a375=md5(JSON[_0x43d0('0x41')](_0x2b0784));if(this[_0x43d0('0x1')]!==_0x35a375){this[_0x43d0('0x1')]=_0x35a375;io[_0x43d0('0x42')]('user:routing:update',_[_0x43d0('0x43')](_0x2b0784,[_0x43d0('0x3c')]));}};module[_0x43d0('0x44')]=Agent; \ No newline at end of file +var _0x8952=['ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','whatsapp','StatusTime','format','Status','online','openchannelPause','mailCapacity','openchannelCapacity','whatsappWaitingInteractions','emit','user:routing:update','omit','exports','md5','moment'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8952,0x17e));var _0x2895=function(_0x2e8020,_0x5337d6){_0x2e8020=_0x2e8020-0x0;var _0x13e8e2=_0x8952[_0x2e8020];return _0x13e8e2;};'use strict';var _=require('lodash');var md5=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var Redis=require(_0x2895('0x2'));var config=require(_0x2895('0x3'));config[_0x2895('0x4')]=_['defaults'](config[_0x2895('0x4')],{'host':_0x2895('0x5'),'port':0x18eb});var io=require(_0x2895('0x6'))(new Redis(config['redis']));function Agent(_0x32429c){this['id']=_0x32429c['id']||0x0;this[_0x2895('0x7')]=_0x32429c[_0x2895('0x7')]||'';this['online']=_0x32429c['online']||!![];this[_0x2895('0x8')]=_0x32429c[_0x2895('0x8')]||![];this[_0x2895('0x9')]=_0x32429c[_0x2895('0x9')]||![];this[_0x2895('0xa')]=_0x32429c['mailPause']||![];this[_0x2895('0xb')]=_0x32429c['faxPause']||![];this[_0x2895('0xc')]=_0x32429c['smsPause']||![];this['openchannelPause']=_0x32429c['openchannelPause']||![];this[_0x2895('0xd')]=_0x2895('0xe');this[_0x2895('0xf')]=0x0;this['chatCapacity']=_0x32429c[_0x2895('0x10')]||0x0;this[_0x2895('0x11')]=0x0;this['mailStatus']=_0x2895('0xe');this[_0x2895('0x12')]=0x0;this['mailCapacity']=_0x32429c['mailCapacity']||0x0;this[_0x2895('0x13')]=0x0;this[_0x2895('0x14')]='unknown';this[_0x2895('0x15')]=0x0;this[_0x2895('0x16')]=_0x32429c[_0x2895('0x16')]||0x0;this[_0x2895('0x17')]=0x0;this[_0x2895('0x18')]=_0x2895('0xe');this[_0x2895('0x19')]=0x0;this[_0x2895('0x1a')]=_0x32429c[_0x2895('0x1a')]||0x0;this[_0x2895('0x1b')]=0x0;this[_0x2895('0x1c')]=_0x2895('0xe');this[_0x2895('0x1d')]=0x0;this[_0x2895('0x1e')]=_0x32429c[_0x2895('0x1e')]||0x0;this[_0x2895('0x1f')]=0x0;this[_0x2895('0x20')]=_0x2895('0xe');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x32429c['openchannelCapacity']||0x0;this[_0x2895('0x21')]=0x0;this[_0x2895('0x22')]=![];this[_0x2895('0x23')]=undefined;this['md5']='';this[_0x2895('0x24')]={};this[_0x2895('0x25')]={};this[_0x2895('0x26')]={};this[_0x2895('0x27')]={};this[_0x2895('0x28')]={};this['whatsappWaitingInteractions']={};this[_0x2895('0x29')]();}Agent[_0x2895('0x2a')]['getChannelStatus']=function(_0x142e58){if(this[_0x142e58+_0x2895('0x2b')]>0x0){if(this[_0x142e58+_0x2895('0x2c')]>0x0&&this[_0x142e58+'CurrentCapacity']>=this[_0x142e58+'Capacity']){return _0x2895('0x2d');}else{return _0x2895('0x2e');}}else{return _0x2895('0x2f');}};Agent['prototype'][_0x2895('0x29')]=function(){var _0x3690ce=['mail',_0x2895('0x30'),_0x2895('0x31'),_0x2895('0x32'),'sms',_0x2895('0x33')];for(var _0x30f491=0x0;_0x30f491<_0x3690ce['length'];_0x30f491+=0x1){var _0x21f549=this['getChannelStatus'](_0x3690ce[_0x30f491]);if(this[_0x3690ce[_0x30f491]+'Status']!==_0x21f549){this[_0x3690ce[_0x30f491]+_0x2895('0x34')]=_['toNumber'](moment()[_0x2895('0x35')]('x'));}this[_0x3690ce[_0x30f491]+_0x2895('0x36')]=_0x21f549;}var _0x4fdd94={'id':this['id'],'name':this['name'],'online':this[_0x2895('0x37')],'voicePause':this[_0x2895('0x8')],'chatPause':this[_0x2895('0x9')],'mailPause':this[_0x2895('0xa')],'smsPause':this[_0x2895('0xc')],'faxPause':this[_0x2895('0xb')],'openchannelPause':this[_0x2895('0x38')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x2895('0xf')],'chatCapacity':this[_0x2895('0x10')],'chatCurrentCapacity':this[_0x2895('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x2895('0x12')],'mailCapacity':this[_0x2895('0x39')],'mailCurrentCapacity':this[_0x2895('0x13')],'faxStatus':this[_0x2895('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x2895('0x16')],'faxCurrentCapacity':this[_0x2895('0x17')],'smsStatus':this[_0x2895('0x18')],'smsStatusTime':this[_0x2895('0x19')],'smsCapacity':this[_0x2895('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x2895('0x1d')],'whatsappCapacity':this[_0x2895('0x1e')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x2895('0x20')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x2895('0x3a')],'openchannelCurrentCapacity':this[_0x2895('0x21')],'busy':this['busy'],'busyQueue':this[_0x2895('0x23')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x2895('0x25')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x2895('0x28')],'whatsappWaitingInteractions':this[_0x2895('0x3b')]};var _0x30594f=md5(JSON['stringify'](_0x4fdd94));if(this[_0x2895('0x0')]!==_0x30594f){this[_0x2895('0x0')]=_0x30594f;io[_0x2895('0x3c')](_0x2895('0x3d'),_[_0x2895('0x3e')](_0x4fdd94,[_0x2895('0x37')]));}};module[_0x2895('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 5c0b34c..0d663cc 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 _0xa1d4=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','chat_queue:save','lodash','md5'];(function(_0x50fc34,_0x4b5ba4){var _0x4570f2=function(_0xfc191a){while(--_0xfc191a){_0x50fc34['push'](_0x50fc34['shift']());}};_0x4570f2(++_0x4b5ba4);}(_0xa1d4,0x14e));var _0x4a1d=function(_0x30e599,_0x106e85){_0x30e599=_0x30e599-0x0;var _0x447aeb=_0xa1d4[_0x30e599];return _0x447aeb;};'use strict';var _=require(_0x4a1d('0x0'));var md5=require(_0x4a1d('0x1'));var util=require(_0x4a1d('0x2'));var Redis=require(_0x4a1d('0x3'));var config=require('../../../config/environment');config[_0x4a1d('0x4')]=_[_0x4a1d('0x5')](config[_0x4a1d('0x4')],{'host':_0x4a1d('0x6'),'port':0x18eb});var io=require(_0x4a1d('0x7'))(new Redis(config['redis']));function ChatQueue(_0x1de6ae){this['id']=_0x1de6ae['id']||0x0;this[_0x4a1d('0x8')]=_0x1de6ae[_0x4a1d('0x8')]||'';this[_0x4a1d('0x9')]=_0x1de6ae[_0x4a1d('0x9')]||0xa;this[_0x4a1d('0xa')]=_0x1de6ae[_0x4a1d('0xa')]||_0x4a1d('0xb');this[_0x4a1d('0xc')]=_0x1de6ae['Agents'];this[_0x4a1d('0xd')]={};this[_0x4a1d('0xe')]=0x0;this['md5']='';this[_0x4a1d('0xf')]();this[_0x4a1d('0x10')]();}ChatQueue['prototype'][_0x4a1d('0xf')]=function(){var _0x276a4d=this[_0x4a1d('0xd')][_0x4a1d('0x11')];this[_0x4a1d('0xd')]=_[_0x4a1d('0x12')](this[_0x4a1d('0xc')],'id');this[_0x4a1d('0xd')][_0x4a1d('0x11')]=_0x276a4d;};ChatQueue[_0x4a1d('0x13')][_0x4a1d('0x10')]=function(){this[_0x4a1d('0x14')]=0x0;this[_0x4a1d('0x15')]=0x0;for(var _0x328da5=0x0;_0x328da5=0x0?this[_0x4a1d('0x19')]:0x0;var _0x32fc56={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x4a1d('0x8')],'paused':this[_0x4a1d('0x15')],'waiting':this['waiting']};var _0xb4f724=md5(JSON['stringify'](_0x32fc56));if(this[_0x4a1d('0x1')]!==_0xb4f724){this['md5']=_0xb4f724;io['to'](util[_0x4a1d('0x1a')]('chat:queue:%s',_0x32fc56[_0x4a1d('0x8')]))['emit'](_0x4a1d('0x1b'),_0x32fc56);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xef6d=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','online','chatPause','paused','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5'];(function(_0x18f3bf,_0x2f81f0){var _0x88488a=function(_0x501968){while(--_0x501968){_0x18f3bf['push'](_0x18f3bf['shift']());}};_0x88488a(++_0x2f81f0);}(_0xef6d,0x1b2));var _0xdef6=function(_0x448a91,_0x5c4a6e){_0x448a91=_0x448a91-0x0;var _0x104c5b=_0xef6d[_0x448a91];return _0x104c5b;};'use strict';var _=require('lodash');var md5=require(_0xdef6('0x0'));var util=require(_0xdef6('0x1'));var Redis=require(_0xdef6('0x2'));var config=require(_0xdef6('0x3'));config[_0xdef6('0x4')]=_['defaults'](config['redis'],{'host':_0xdef6('0x5'),'port':0x18eb});var io=require(_0xdef6('0x6'))(new Redis(config[_0xdef6('0x4')]));function ChatQueue(_0x3594a1){this['id']=_0x3594a1['id']||0x0;this[_0xdef6('0x7')]=_0x3594a1[_0xdef6('0x7')]||'';this[_0xdef6('0x8')]=_0x3594a1['timeout']||0xa;this['strategy']=_0x3594a1['strategy']||_0xdef6('0x9');this[_0xdef6('0xa')]=_0x3594a1[_0xdef6('0xa')];this[_0xdef6('0xb')]={};this['waiting']=0x0;this[_0xdef6('0x0')]='';this['updateRouting']();this[_0xdef6('0xc')]();}ChatQueue[_0xdef6('0xd')][_0xdef6('0xe')]=function(){var _0x51e604=this['mapAgentsId']['_rr'];this[_0xdef6('0xb')]=_[_0xdef6('0xf')](this[_0xdef6('0xa')],'id');this[_0xdef6('0xb')][_0xdef6('0x10')]=_0x51e604;};ChatQueue[_0xdef6('0xd')][_0xdef6('0xc')]=function(){this[_0xdef6('0x11')]=0x0;this['paused']=0x0;for(var _0x572624=0x0;_0x572624=0x0?this[_0xdef6('0x15')]:0x0;var _0x3ea55e={'id':this['id'],'available':this[_0xdef6('0x15')],'loggedIn':this[_0xdef6('0x11')],'name':this[_0xdef6('0x7')],'paused':this['paused'],'waiting':this[_0xdef6('0x16')]};var _0x2edd93=md5(JSON[_0xdef6('0x17')](_0x3ea55e));if(this[_0xdef6('0x0')]!==_0x2edd93){this[_0xdef6('0x0')]=_0x2edd93;io['to'](util[_0xdef6('0x18')](_0xdef6('0x19'),_0x3ea55e[_0xdef6('0x7')]))[_0xdef6('0x1a')](_0xdef6('0x1b'),_0x3ea55e);}};module[_0xdef6('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 88924b8..0f7e1bc 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 _0x239c=['length','online','faxPause','paused','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','util','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn'];(function(_0x3394a6,_0x7b1ede){var _0x4a7909=function(_0x20451f){while(--_0x20451f){_0x3394a6['push'](_0x3394a6['shift']());}};_0x4a7909(++_0x7b1ede);}(_0x239c,0x1a0));var _0xc239=function(_0x5ab717,_0x2aa7dc){_0x5ab717=_0x5ab717-0x0;var _0x3deaab=_0x239c[_0x5ab717];return _0x3deaab;};'use strict';var _=require(_0xc239('0x0'));var md5=require('md5');var util=require(_0xc239('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xc239('0x2')]=_[_0xc239('0x3')](config[_0xc239('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xc239('0x4'))(new Redis(config[_0xc239('0x2')]));function FaxQueue(_0x1dbf89){this['id']=_0x1dbf89['id']||0x0;this[_0xc239('0x5')]=_0x1dbf89[_0xc239('0x5')]||'';this[_0xc239('0x6')]=_0x1dbf89[_0xc239('0x6')]||0xa;this[_0xc239('0x7')]=_0x1dbf89[_0xc239('0x7')]||_0xc239('0x8');this[_0xc239('0x9')]=_0x1dbf89['Agents'];this['mapAgentsId']={};this[_0xc239('0xa')]=0x0;this[_0xc239('0xb')]='';this[_0xc239('0xc')]();this[_0xc239('0xd')]();}FaxQueue[_0xc239('0xe')][_0xc239('0xc')]=function(){var _0x5e4eea=this[_0xc239('0xf')][_0xc239('0x10')];this[_0xc239('0xf')]=_[_0xc239('0x11')](this['Agents'],'id');this[_0xc239('0xf')][_0xc239('0x10')]=_0x5e4eea;};FaxQueue[_0xc239('0xe')][_0xc239('0xd')]=function(){this[_0xc239('0x12')]=0x0;this['paused']=0x0;for(var _0x568bdb=0x0;_0x568bdb=0x0?this['available']:0x0;var _0x3ab728={'id':this['id'],'available':this[_0xc239('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xc239('0x5')],'paused':this['paused'],'waiting':this[_0xc239('0xa')]};var _0x285723=md5(JSON[_0xc239('0x18')](_0x3ab728));if(this[_0xc239('0xb')]!==_0x285723){this[_0xc239('0xb')]=_0x285723;io['to'](util[_0xc239('0x19')](_0xc239('0x1a'),_0x3ab728['name']))['emit'](_0xc239('0x1b'),_0x3ab728);}};module[_0xc239('0x1c')]=FaxQueue; \ No newline at end of file +var _0xc827=['online','available','stringify','format','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','paused'];(function(_0x4c283f,_0x55d026){var _0x598216=function(_0x3dec95){while(--_0x3dec95){_0x4c283f['push'](_0x4c283f['shift']());}};_0x598216(++_0x55d026);}(_0xc827,0x1d1));var _0x7c82=function(_0x52c61e,_0x1b9d81){_0x52c61e=_0x52c61e-0x0;var _0x5643f5=_0xc827[_0x52c61e];return _0x5643f5;};'use strict';var _=require(_0x7c82('0x0'));var md5=require(_0x7c82('0x1'));var util=require(_0x7c82('0x2'));var Redis=require(_0x7c82('0x3'));var config=require(_0x7c82('0x4'));config[_0x7c82('0x5')]=_['defaults'](config[_0x7c82('0x5')],{'host':_0x7c82('0x6'),'port':0x18eb});var io=require(_0x7c82('0x7'))(new Redis(config[_0x7c82('0x5')]));function FaxQueue(_0x25e7da){this['id']=_0x25e7da['id']||0x0;this[_0x7c82('0x8')]=_0x25e7da['name']||'';this[_0x7c82('0x9')]=_0x25e7da[_0x7c82('0x9')]||0xa;this['strategy']=_0x25e7da[_0x7c82('0xa')]||_0x7c82('0xb');this[_0x7c82('0xc')]=_0x25e7da['Agents'];this['mapAgentsId']={};this[_0x7c82('0xd')]=0x0;this[_0x7c82('0x1')]='';this[_0x7c82('0xe')]();this[_0x7c82('0xf')]();}FaxQueue[_0x7c82('0x10')]['updateRouting']=function(){var _0x5a4df2=this[_0x7c82('0x11')]['_rr'];this[_0x7c82('0x11')]=_[_0x7c82('0x12')](this[_0x7c82('0xc')],'id');this['mapAgentsId']['_rr']=_0x5a4df2;};FaxQueue[_0x7c82('0x10')][_0x7c82('0xf')]=function(){this[_0x7c82('0x13')]=0x0;this[_0x7c82('0x14')]=0x0;for(var _0x557087=0x0;_0x557087=0x0?this[_0x7c82('0x16')]:0x0;var _0x5afd75={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7c82('0x13')],'name':this[_0x7c82('0x8')],'paused':this[_0x7c82('0x14')],'waiting':this[_0x7c82('0xd')]};var _0x536af3=md5(JSON[_0x7c82('0x17')](_0x5afd75));if(this['md5']!==_0x536af3){this[_0x7c82('0x1')]=_0x536af3;io['to'](util[_0x7c82('0x18')]('fax:queue:%s',_0x5afd75[_0x7c82('0x8')]))[_0x7c82('0x19')](_0x7c82('0x1a'),_0x5afd75);}};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 7955141..bbc668c 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 _0xb45d=['name'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xb45d,0xee));var _0xdb45=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0xb45d[_0x57f8c0];return _0x117f08;};'use strict';function Interval(_0xf2ff2b){this['id']=_0xf2ff2b['id']||0x0;this['name']=_0xf2ff2b[_0xdb45('0x0')]||'';this['Intervals']=_0xf2ff2b['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0x9aeb=['exports','name','Intervals'];(function(_0x267210,_0x2e390f){var _0x5d0893=function(_0x4dedb1){while(--_0x4dedb1){_0x267210['push'](_0x267210['shift']());}};_0x5d0893(++_0x2e390f);}(_0x9aeb,0x6d));var _0xb9ae=function(_0x8d71e5,_0x139ed7){_0x8d71e5=_0x8d71e5-0x0;var _0x5ef0d3=_0x9aeb[_0x8d71e5];return _0x5ef0d3;};'use strict';function Interval(_0x291924){this['id']=_0x291924['id']||0x0;this[_0xb9ae('0x0')]=_0x291924[_0xb9ae('0x0')]||'';this['Intervals']=_0x291924[_0xb9ae('0x1')]||{};}module[_0xb9ae('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 a9d8c57..00e44a8 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 _0x7350=['waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x7c53af,_0x120fa5){var _0x54074b=function(_0x4476a4){while(--_0x4476a4){_0x7c53af['push'](_0x7c53af['shift']());}};_0x54074b(++_0x120fa5);}(_0x7350,0x6c));var _0x0735=function(_0x149102,_0xee7023){_0x149102=_0x149102-0x0;var _0x12052c=_0x7350[_0x149102];return _0x12052c;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x0735('0x0'));var Redis=require('ioredis');var config=require(_0x0735('0x1'));config[_0x0735('0x2')]=_[_0x0735('0x3')](config[_0x0735('0x2')],{'host':_0x0735('0x4'),'port':0x18eb});var io=require(_0x0735('0x5'))(new Redis(config[_0x0735('0x2')]));function MailQueue(_0x490f54){this['id']=_0x490f54['id']||0x0;this[_0x0735('0x6')]=_0x490f54[_0x0735('0x6')]||'';this[_0x0735('0x7')]=_0x490f54[_0x0735('0x7')]||0xa;this[_0x0735('0x8')]=_0x490f54[_0x0735('0x8')]||_0x0735('0x9');this[_0x0735('0xa')]=_0x490f54[_0x0735('0xa')];this[_0x0735('0xb')]={};this[_0x0735('0xc')]=0x0;this[_0x0735('0xd')]='';this[_0x0735('0xe')]();this[_0x0735('0xf')]();}MailQueue[_0x0735('0x10')]['updateRouting']=function(){var _0x30f214=this['mapAgentsId'][_0x0735('0x11')];this[_0x0735('0xb')]=_[_0x0735('0x12')](this['Agents'],'id');this[_0x0735('0xb')][_0x0735('0x11')]=_0x30f214;};MailQueue['prototype'][_0x0735('0xf')]=function(){this['loggedIn']=0x0;this[_0x0735('0x13')]=0x0;for(var _0x92ce5d=0x0;_0x92ce5d=0x0?this[_0x0735('0x17')]:0x0;var _0x3a6293={'id':this['id'],'available':this[_0x0735('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x0735('0x13')],'waiting':this[_0x0735('0xc')]};var _0x1f86f8=md5(JSON[_0x0735('0x18')](_0x3a6293));if(this[_0x0735('0xd')]!==_0x1f86f8){this['md5']=_0x1f86f8;io['to'](util[_0x0735('0x19')](_0x0735('0x1a'),_0x3a6293[_0x0735('0x6')]))[_0x0735('0x1b')](_0x0735('0x1c'),_0x3a6293);}};module[_0x0735('0x1d')]=MailQueue; \ No newline at end of file +var _0xeb42=['emit','mail_queue:save','exports','lodash','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','paused','length','online','loggedIn','mailPause','available','stringify','format','mail:queue:%s'];(function(_0x362e4a,_0x286b7f){var _0x2946b5=function(_0x192223){while(--_0x192223){_0x362e4a['push'](_0x362e4a['shift']());}};_0x2946b5(++_0x286b7f);}(_0xeb42,0x9e));var _0x2eb4=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xeb42[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0x2eb4('0x0'));var md5=require('md5');var util=require(_0x2eb4('0x1'));var Redis=require('ioredis');var config=require(_0x2eb4('0x2'));config['redis']=_[_0x2eb4('0x3')](config[_0x2eb4('0x4')],{'host':_0x2eb4('0x5'),'port':0x18eb});var io=require(_0x2eb4('0x6'))(new Redis(config[_0x2eb4('0x4')]));function MailQueue(_0x56e4e2){this['id']=_0x56e4e2['id']||0x0;this[_0x2eb4('0x7')]=_0x56e4e2[_0x2eb4('0x7')]||'';this[_0x2eb4('0x8')]=_0x56e4e2[_0x2eb4('0x8')]||0xa;this['strategy']=_0x56e4e2[_0x2eb4('0x9')]||_0x2eb4('0xa');this[_0x2eb4('0xb')]=_0x56e4e2[_0x2eb4('0xb')];this[_0x2eb4('0xc')]={};this[_0x2eb4('0xd')]=0x0;this[_0x2eb4('0xe')]='';this['updateRouting']();this[_0x2eb4('0xf')]();}MailQueue[_0x2eb4('0x10')][_0x2eb4('0x11')]=function(){var _0x59c7ae=this[_0x2eb4('0xc')][_0x2eb4('0x12')];this['mapAgentsId']=_['map'](this[_0x2eb4('0xb')],'id');this[_0x2eb4('0xc')]['_rr']=_0x59c7ae;};MailQueue[_0x2eb4('0x10')][_0x2eb4('0xf')]=function(){this['loggedIn']=0x0;this[_0x2eb4('0x13')]=0x0;for(var _0x1efebb=0x0;_0x1efebb=0x0?this[_0x2eb4('0x18')]:0x0;var _0x1e52ce={'id':this['id'],'available':this[_0x2eb4('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x2eb4('0x7')],'paused':this[_0x2eb4('0x13')],'waiting':this[_0x2eb4('0xd')]};var _0x1018fd=md5(JSON[_0x2eb4('0x19')](_0x1e52ce));if(this[_0x2eb4('0xe')]!==_0x1018fd){this['md5']=_0x1018fd;io['to'](util[_0x2eb4('0x1a')](_0x2eb4('0x1b'),_0x1e52ce[_0x2eb4('0x7')]))[_0x2eb4('0x1c')](_0x2eb4('0x1d'),_0x1e52ce);}};module[_0x2eb4('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index b376229..5261afc 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'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 _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(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 017985f..75e751d 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 _0xb90d=['sms_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','length','loggedIn','available','paused','stringify','format','sms:queue:%s','emit'];(function(_0x27bdd3,_0x52ebae){var _0x17b770=function(_0x160efb){while(--_0x160efb){_0x27bdd3['push'](_0x27bdd3['shift']());}};_0x17b770(++_0x52ebae);}(_0xb90d,0x17a));var _0xdb90=function(_0x473d1e,_0x4df799){_0x473d1e=_0x473d1e-0x0;var _0x503be9=_0xb90d[_0x473d1e];return _0x503be9;};'use strict';var _=require('lodash');var md5=require(_0xdb90('0x0'));var util=require(_0xdb90('0x1'));var Redis=require(_0xdb90('0x2'));var config=require(_0xdb90('0x3'));config[_0xdb90('0x4')]=_[_0xdb90('0x5')](config['redis'],{'host':_0xdb90('0x6'),'port':0x18eb});var io=require(_0xdb90('0x7'))(new Redis(config[_0xdb90('0x4')]));function SmsQueue(_0x532dbc){this['id']=_0x532dbc['id']||0x0;this['name']=_0x532dbc[_0xdb90('0x8')]||'';this[_0xdb90('0x9')]=_0x532dbc[_0xdb90('0x9')]||0xa;this[_0xdb90('0xa')]=_0x532dbc['strategy']||_0xdb90('0xb');this[_0xdb90('0xc')]=_0x532dbc[_0xdb90('0xc')];this['mapAgentsId']={};this[_0xdb90('0xd')]=0x0;this[_0xdb90('0x0')]='';this[_0xdb90('0xe')]();this[_0xdb90('0xf')]();}SmsQueue[_0xdb90('0x10')]['updateRouting']=function(){var _0x597572=this['mapAgentsId'][_0xdb90('0x11')];this[_0xdb90('0x12')]=_[_0xdb90('0x13')](this[_0xdb90('0xc')],'id');this[_0xdb90('0x12')][_0xdb90('0x11')]=_0x597572;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x569d40=0x0;_0x569d40=0x0?this[_0xdb90('0x16')]:0x0;var _0xd50abd={'id':this['id'],'available':this[_0xdb90('0x16')],'loggedIn':this[_0xdb90('0x15')],'name':this[_0xdb90('0x8')],'paused':this[_0xdb90('0x17')],'waiting':this[_0xdb90('0xd')]};var _0x19e1bf=md5(JSON[_0xdb90('0x18')](_0xd50abd));if(this['md5']!==_0x19e1bf){this['md5']=_0x19e1bf;io['to'](util[_0xdb90('0x19')](_0xdb90('0x1a'),_0xd50abd[_0xdb90('0x8')]))[_0xdb90('0x1b')](_0xdb90('0x1c'),_0xd50abd);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x9f62=['sms:queue:%s','emit','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','waiting','prototype','updateRouting','mapAgentsId','_rr','updateRealtime','loggedIn','paused','Agents','length','online','smsPause','available','stringify','format'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x9f62,0x154));var _0x29f6=function(_0x198acf,_0x36468b){_0x198acf=_0x198acf-0x0;var _0x2b89a8=_0x9f62[_0x198acf];return _0x2b89a8;};'use strict';var _=require('lodash');var md5=require(_0x29f6('0x0'));var util=require('util');var Redis=require(_0x29f6('0x1'));var config=require(_0x29f6('0x2'));config[_0x29f6('0x3')]=_['defaults'](config['redis'],{'host':_0x29f6('0x4'),'port':0x18eb});var io=require(_0x29f6('0x5'))(new Redis(config[_0x29f6('0x3')]));function SmsQueue(_0x1e71ac){this['id']=_0x1e71ac['id']||0x0;this['name']=_0x1e71ac[_0x29f6('0x6')]||'';this[_0x29f6('0x7')]=_0x1e71ac[_0x29f6('0x7')]||0xa;this[_0x29f6('0x8')]=_0x1e71ac[_0x29f6('0x8')]||'beepall';this['Agents']=_0x1e71ac['Agents'];this['mapAgentsId']={};this[_0x29f6('0x9')]=0x0;this[_0x29f6('0x0')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x29f6('0xa')][_0x29f6('0xb')]=function(){var _0x4909e0=this[_0x29f6('0xc')][_0x29f6('0xd')];this['mapAgentsId']=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x29f6('0xd')]=_0x4909e0;};SmsQueue[_0x29f6('0xa')][_0x29f6('0xe')]=function(){this[_0x29f6('0xf')]=0x0;this[_0x29f6('0x10')]=0x0;for(var _0x156c96=0x0;_0x156c96=0x0?this[_0x29f6('0x15')]:0x0;var _0x3af478={'id':this['id'],'available':this[_0x29f6('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x29f6('0x6')],'paused':this[_0x29f6('0x10')],'waiting':this['waiting']};var _0x159227=md5(JSON[_0x29f6('0x16')](_0x3af478));if(this[_0x29f6('0x0')]!==_0x159227){this[_0x29f6('0x0')]=_0x159227;io['to'](util[_0x29f6('0x17')](_0x29f6('0x18'),_0x3af478['name']))[_0x29f6('0x19')]('sms_queue:save',_0x3af478);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 3966604..3e78d8b 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 _0x3185=['mapAgentsId','waiting','prototype','updateRouting','_rr','updateRealtime','paused','length','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents'];(function(_0x473f09,_0x1b53b1){var _0x3b5cd2=function(_0x239d6c){while(--_0x239d6c){_0x473f09['push'](_0x473f09['shift']());}};_0x3b5cd2(++_0x1b53b1);}(_0x3185,0x198));var _0x5318=function(_0x55926a,_0x4de3aa){_0x55926a=_0x55926a-0x0;var _0x3b8cf4=_0x3185[_0x55926a];return _0x3b8cf4;};'use strict';var _=require(_0x5318('0x0'));var md5=require(_0x5318('0x1'));var util=require(_0x5318('0x2'));var Redis=require(_0x5318('0x3'));var config=require(_0x5318('0x4'));config[_0x5318('0x5')]=_[_0x5318('0x6')](config[_0x5318('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5318('0x5')]));function WhatsappQueue(_0x52fee3){this['id']=_0x52fee3['id']||0x0;this[_0x5318('0x7')]=_0x52fee3[_0x5318('0x7')]||'';this[_0x5318('0x8')]=_0x52fee3[_0x5318('0x8')]||0xa;this[_0x5318('0x9')]=_0x52fee3[_0x5318('0x9')]||_0x5318('0xa');this['Agents']=_0x52fee3[_0x5318('0xb')];this[_0x5318('0xc')]={};this[_0x5318('0xd')]=0x0;this[_0x5318('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x5318('0xe')][_0x5318('0xf')]=function(){var _0x3cc3ed=this['mapAgentsId'][_0x5318('0x10')];this[_0x5318('0xc')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5318('0x10')]=_0x3cc3ed;};WhatsappQueue[_0x5318('0xe')][_0x5318('0x11')]=function(){this['loggedIn']=0x0;this[_0x5318('0x12')]=0x0;for(var _0x5ee2e6=0x0;_0x5ee2e6=0x0?this[_0x5318('0x17')]:0x0;var _0x1d31a2={'id':this['id'],'available':this[_0x5318('0x17')],'loggedIn':this[_0x5318('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x5318('0xd')]};var _0xcd1caa=md5(JSON[_0x5318('0x18')](_0x1d31a2));if(this[_0x5318('0x1')]!==_0xcd1caa){this[_0x5318('0x1')]=_0xcd1caa;io['to'](util[_0x5318('0x19')](_0x5318('0x1a'),_0x1d31a2['name']))['emit']('whatsapp_queue:save',_0x1d31a2);}};module[_0x5318('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0xdf48=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','md5','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x326d12,_0x57f475){var _0x4b7603=function(_0x202ca7){while(--_0x202ca7){_0x326d12['push'](_0x326d12['shift']());}};_0x4b7603(++_0x57f475);}(_0xdf48,0x17f));var _0x8df4=function(_0xb41194,_0x583c98){_0xb41194=_0xb41194-0x0;var _0x3c8304=_0xdf48[_0xb41194];return _0x3c8304;};'use strict';var _=require('lodash');var md5=require(_0x8df4('0x0'));var util=require('util');var Redis=require(_0x8df4('0x1'));var config=require('../../../config/environment');config[_0x8df4('0x2')]=_[_0x8df4('0x3')](config[_0x8df4('0x2')],{'host':_0x8df4('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8df4('0x2')]));function WhatsappQueue(_0x22991f){this['id']=_0x22991f['id']||0x0;this[_0x8df4('0x5')]=_0x22991f[_0x8df4('0x5')]||'';this[_0x8df4('0x6')]=_0x22991f[_0x8df4('0x6')]||0xa;this[_0x8df4('0x7')]=_0x22991f['strategy']||_0x8df4('0x8');this['Agents']=_0x22991f[_0x8df4('0x9')];this[_0x8df4('0xa')]={};this[_0x8df4('0xb')]=0x0;this[_0x8df4('0x0')]='';this[_0x8df4('0xc')]();this[_0x8df4('0xd')]();}WhatsappQueue[_0x8df4('0xe')][_0x8df4('0xc')]=function(){var _0x121b0f=this[_0x8df4('0xa')][_0x8df4('0xf')];this[_0x8df4('0xa')]=_[_0x8df4('0x10')](this[_0x8df4('0x9')],'id');this[_0x8df4('0xa')]['_rr']=_0x121b0f;};WhatsappQueue['prototype'][_0x8df4('0xd')]=function(){this[_0x8df4('0x11')]=0x0;this[_0x8df4('0x12')]=0x0;for(var _0x3f216e=0x0;_0x3f216e=0x0?this[_0x8df4('0x16')]:0x0;var _0x1bcb94={'id':this['id'],'available':this[_0x8df4('0x16')],'loggedIn':this[_0x8df4('0x11')],'name':this[_0x8df4('0x5')],'paused':this[_0x8df4('0x12')],'waiting':this[_0x8df4('0xb')]};var _0x5ba57b=md5(JSON[_0x8df4('0x17')](_0x1bcb94));if(this[_0x8df4('0x0')]!==_0x5ba57b){this['md5']=_0x5ba57b;io['to'](util[_0x8df4('0x18')](_0x8df4('0x19'),_0x1bcb94[_0x8df4('0x5')]))[_0x8df4('0x1a')](_0x8df4('0x1b'),_0x1bcb94);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 3b21d91..4131c35 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x223ef8,_0x22bc54){var _0x2ae870=function(_0x3cc557){while(--_0x3cc557){_0x223ef8['push'](_0x223ef8['shift']());}};_0x2ae870(++_0x22bc54);}(_0xb10b,0x12a));var _0xbb10=function(_0x41bee3,_0x2315fb){_0x41bee3=_0x41bee3-0x0;var _0x2596ac=_0xb10b[_0x41bee3];return _0x2596ac;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2fff5a,_0x45c3e5){var _0x46cbb7=function(_0x8ee576){while(--_0x8ee576){_0x2fff5a['push'](_0x2fff5a['shift']());}};_0x46cbb7(++_0x45c3e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xb10b[_0x3ed054];return _0x16dd95;};'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 e2761f9..761b61f 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 _0xc2de=['UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2de,0x1de));var _0xec2d=function(_0x4f65bb,_0x1e751b){_0x4f65bb=_0x4f65bb-0x0;var _0x3ca7c1=_0xc2de[_0x4f65bb];return _0x3ca7c1;};'use strict';var client=require('../client');exports[_0xec2d('0x0')]=function(_0xa37303,_0x2eef5d){return client[_0xec2d('0x1')](_0xec2d('0x2'),{'body':_0x2eef5d,'options':{'where':{'id':_0xa37303}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x24a876,_0x590c5c){return client[_0xec2d('0x1')](_0xec2d('0x3'),{'body':_0x590c5c,'options':{'where':{'id':_0x24a876}},'log':_0xec2d('0x4')});}; \ No newline at end of file +var _0x6d55=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0xd6fcb5,_0x526523){var _0x278ac7=function(_0x3a9512){while(--_0x3a9512){_0xd6fcb5['push'](_0xd6fcb5['shift']());}};_0x278ac7(++_0x526523);}(_0x6d55,0xa4));var _0x56d5=function(_0x43cc69,_0x401eea){_0x43cc69=_0x43cc69-0x0;var _0xde43ae=_0x6d55[_0x43cc69];return _0xde43ae;};'use strict';var client=require(_0x56d5('0x0'));exports[_0x56d5('0x1')]=function(_0x46d792,_0x492040){return client[_0x56d5('0x2')](_0x56d5('0x3'),{'body':_0x492040,'options':{'where':{'id':_0x46d792}},'log':_0x56d5('0x4')});};exports[_0x56d5('0x5')]=function(_0xecad4,_0xe89a1a){return client[_0x56d5('0x2')](_0x56d5('0x6'),{'body':_0xe89a1a,'options':{'where':{'id':_0xecad4}},'log':_0x56d5('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c3ca84c..a37aca9 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 _0x8cb1=['createChatMessage','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cb1,0x15a));var _0x18cb=function(_0xb55cf2,_0x1ae4e1){_0xb55cf2=_0xb55cf2-0x0;var _0x3ccb24=_0x8cb1[_0xb55cf2];return _0x3ccb24;};'use strict';var client=require(_0x18cb('0x0'));exports['create']=function(_0x427145){return client[_0x18cb('0x1')]('CreateChatMessage',{'body':_0x427145,'log':_0x18cb('0x2')});}; \ No newline at end of file +var _0xe417=['create','../client'];(function(_0x2fc63a,_0x38c495){var _0x9332ac=function(_0x29d857){while(--_0x29d857){_0x2fc63a['push'](_0x2fc63a['shift']());}};_0x9332ac(++_0x38c495);}(_0xe417,0x179));var _0x7e41=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0xe417[_0x5ef161];return _0x1c6e9e;};'use strict';var client=require(_0x7e41('0x0'));exports[_0x7e41('0x1')]=function(_0x4306e2){return client['Request']('CreateChatMessage',{'body':_0x4306e2,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 8fdf800..2e1b226 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 _0x46ed=['../client','getChatQueues','GetChatQueue','name','timeout','User','Agents','online','chatPause'];(function(_0x8e74c4,_0x4c3b72){var _0x50e53f=function(_0x2a4eef){while(--_0x2a4eef){_0x8e74c4['push'](_0x8e74c4['shift']());}};_0x50e53f(++_0x4c3b72);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0xd46e('0x0'));exports[_0xd46e('0x1')]=function(){return function(){return client['Request'](_0xd46e('0x2'),{'options':{'raw':![],'attributes':['id',_0xd46e('0x3'),_0xd46e('0x4'),'strategy'],'include':[{'model':_0xd46e('0x5'),'as':_0xd46e('0x6'),'attributes':['id','name',_0xd46e('0x7'),_0xd46e('0x8')]}]},'log':_0xd46e('0x1')});};}; \ No newline at end of file +var _0x2cd0=['name','User','Agents','online','chatPause','../client','getChatQueues'];(function(_0x430bd3,_0x1835ce){var _0x5acb21=function(_0x5a1fcd){while(--_0x5a1fcd){_0x430bd3['push'](_0x430bd3['shift']());}};_0x5acb21(++_0x1835ce);}(_0x2cd0,0x8a));var _0x02cd=function(_0x3aa640,_0x430b73){_0x3aa640=_0x3aa640-0x0;var _0x1cabbc=_0x2cd0[_0x3aa640];return _0x1cabbc;};'use strict';var client=require(_0x02cd('0x0'));exports[_0x02cd('0x1')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x02cd('0x2'),'timeout','strategy'],'include':[{'model':_0x02cd('0x3'),'as':_0x02cd('0x4'),'attributes':['id',_0x02cd('0x2'),_0x02cd('0x5'),_0x02cd('0x6')]}]},'log':_0x02cd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a7b0e4f..31512cb 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 _0x50a6=['create','CreateChatQueueReport','update','UpdateChatQueueReport','../client'];(function(_0x5d12a8,_0x593aa1){var _0x35194f=function(_0x4a4edc){while(--_0x4a4edc){_0x5d12a8['push'](_0x5d12a8['shift']());}};_0x35194f(++_0x593aa1);}(_0x50a6,0xa4));var _0x650a=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x50a6[_0x5fa520];return _0x1bf6c4;};'use strict';var client=require(_0x650a('0x0'));exports[_0x650a('0x1')]=function(_0x47b929){return client['Request'](_0x650a('0x2'),{'body':_0x47b929,'log':'CreateChatQueueReport'});};exports[_0x650a('0x3')]=function(_0x15dd02,_0x2c71ba){return client['Request'](_0x650a('0x4'),{'body':_0x2c71ba,'options':{'where':{'uniqueid':_0x15dd02},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x98d5=['UpdateChatQueueReport','../client','Request','CreateChatQueueReport','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x98d5,0xfb));var _0x598d=function(_0x4d124c,_0x4f5c8b){_0x4d124c=_0x4d124c-0x0;var _0x22e042=_0x98d5[_0x4d124c];return _0x22e042;};'use strict';var client=require(_0x598d('0x0'));exports['create']=function(_0x491dcb){return client[_0x598d('0x1')](_0x598d('0x2'),{'body':_0x491dcb,'log':_0x598d('0x2')});};exports[_0x598d('0x3')]=function(_0x418321,_0x3890f3){return client[_0x598d('0x1')](_0x598d('0x4'),{'body':_0x3890f3,'options':{'where':{'uniqueid':_0x418321},'order':[['id','DESC']],'limit':0x1},'log':_0x598d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 9a58d88..7585712 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x7a54,0x106));var _0x47a5=function(_0x5d5a02,_0x430dde){_0x5d5a02=_0x5d5a02-0x0;var _0x4a0d17=_0x7a54[_0x5d5a02];return _0x4a0d17;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x7a54,0x106));var _0x47a5=function(_0x4f11b4,_0x5dcfb4){_0x4f11b4=_0x4f11b4-0x0;var _0x20f883=_0x7a54[_0x4f11b4];return _0x20f883;};'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 5e2ff93..f8f29d0 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 _0x1b40=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x550611,_0xdf2c14){var _0x314c23=function(_0x2647cb){while(--_0x2647cb){_0x550611['push'](_0x550611['shift']());}};_0x314c23(++_0xdf2c14);}(_0x1b40,0x1b3));var _0x01b4=function(_0x2183ca,_0x3778a9){_0x2183ca=_0x2183ca-0x0;var _0x21d00e=_0x1b40[_0x2183ca];return _0x21d00e;};'use strict';var client=require(_0x01b4('0x0'));exports[_0x01b4('0x1')]=function(_0x4eec92){return client[_0x01b4('0x2')](_0x01b4('0x3'),{'body':_0x4eec92,'log':_0x01b4('0x4')});}; \ No newline at end of file +var _0xaf1d=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x5e45fa,_0x24a7b4){var _0x244b80=function(_0xc46e29){while(--_0xc46e29){_0x5e45fa['push'](_0x5e45fa['shift']());}};_0x244b80(++_0x24a7b4);}(_0xaf1d,0x1af));var _0xdaf1=function(_0x57ed94,_0x4832b8){_0x57ed94=_0x57ed94-0x0;var _0x4c089a=_0xaf1d[_0x57ed94];return _0x4c089a;};'use strict';var client=require('../client');exports[_0xdaf1('0x0')]=function(_0x29cd22){return client[_0xdaf1('0x1')](_0xdaf1('0x2'),{'body':_0x29cd22,'log':_0xdaf1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ac00091..56785d2 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 _0xa78e=['GetFaxQueue','name','timeout','strategy','online','faxPause','../client','getFaxQueues'];(function(_0x5885c8,_0x20f2e8){var _0x52f2e4=function(_0x52efd9){while(--_0x52efd9){_0x5885c8['push'](_0x5885c8['shift']());}};_0x52f2e4(++_0x20f2e8);}(_0xa78e,0xd6));var _0xea78=function(_0x51c37b,_0x39cf19){_0x51c37b=_0x51c37b-0x0;var _0x232c27=_0xa78e[_0x51c37b];return _0x232c27;};'use strict';var client=require(_0xea78('0x0'));exports[_0xea78('0x1')]=function(){return function(){return client['Request'](_0xea78('0x2'),{'options':{'raw':![],'attributes':['id',_0xea78('0x3'),_0xea78('0x4'),_0xea78('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xea78('0x3'),_0xea78('0x6'),_0xea78('0x7')]}]},'log':_0xea78('0x1')});};}; \ No newline at end of file +var _0x368e=['getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause'];(function(_0x490e9a,_0x4262eb){var _0x434a7b=function(_0x39a137){while(--_0x39a137){_0x490e9a['push'](_0x490e9a['shift']());}};_0x434a7b(++_0x4262eb);}(_0x368e,0x1a7));var _0xe368=function(_0xc5544f,_0x183e91){_0xc5544f=_0xc5544f-0x0;var _0x1bd946=_0x368e[_0xc5544f];return _0x1bd946;};'use strict';var client=require('../client');exports[_0xe368('0x0')]=function(){return function(){return client[_0xe368('0x1')](_0xe368('0x2'),{'options':{'raw':![],'attributes':['id',_0xe368('0x3'),'timeout',_0xe368('0x4')],'include':[{'model':_0xe368('0x5'),'as':_0xe368('0x6'),'attributes':['id',_0xe368('0x3'),_0xe368('0x7'),_0xe368('0x8')]}]},'log':_0xe368('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 0f2b834..fad051f 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 _0xa355=['../client','create','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport'];(function(_0x1edb18,_0x401dbe){var _0x57872a=function(_0x214d02){while(--_0x214d02){_0x1edb18['push'](_0x1edb18['shift']());}};_0x57872a(++_0x401dbe);}(_0xa355,0x1ec));var _0x5a35=function(_0x3ccd36,_0x5d7e26){_0x3ccd36=_0x3ccd36-0x0;var _0x1f41d1=_0xa355[_0x3ccd36];return _0x1f41d1;};'use strict';var client=require(_0x5a35('0x0'));exports[_0x5a35('0x1')]=function(_0x47e45d){return client['Request']('CreateFaxQueueReport',{'body':_0x47e45d,'log':_0x5a35('0x2')});};exports[_0x5a35('0x3')]=function(_0x1be1ed,_0x4a4503){return client['Request']('UpdateFaxQueueReport',{'body':_0x4a4503,'options':{'where':{'uniqueid':_0x1be1ed},'order':[['id',_0x5a35('0x4')]],'limit':0x1},'log':_0x5a35('0x5')});}; \ No newline at end of file +var _0x201d=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x106ad1,_0x53253b){var _0x24ca40=function(_0x2bca94){while(--_0x2bca94){_0x106ad1['push'](_0x106ad1['shift']());}};_0x24ca40(++_0x53253b);}(_0x201d,0xa1));var _0xd201=function(_0x340d72,_0x14f789){_0x340d72=_0x340d72-0x0;var _0x5e8885=_0x201d[_0x340d72];return _0x5e8885;};'use strict';var client=require(_0xd201('0x0'));exports['create']=function(_0x11fb0e){return client[_0xd201('0x1')](_0xd201('0x2'),{'body':_0x11fb0e,'log':_0xd201('0x2')});};exports[_0xd201('0x3')]=function(_0x5ec1b2,_0x3bff01){return client[_0xd201('0x1')](_0xd201('0x4'),{'body':_0x3bff01,'options':{'where':{'uniqueid':_0x5ec1b2},'order':[['id',_0xd201('0x5')]],'limit':0x1},'log':_0xd201('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 94cdeba..a6ef0bc 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 _0x2ee5=['name','Interval','interval','../client','getIntervals','Request'];(function(_0x27c9c8,_0x31b81c){var _0x5889fd=function(_0xa5ae43){while(--_0xa5ae43){_0x27c9c8['push'](_0x27c9c8['shift']());}};_0x5889fd(++_0x31b81c);}(_0x2ee5,0x12f));var _0x52ee=function(_0x54bd1d,_0x325536){_0x54bd1d=_0x54bd1d-0x0;var _0x1e19ae=_0x2ee5[_0x54bd1d];return _0x1e19ae;};'use strict';var client=require(_0x52ee('0x0'));exports[_0x52ee('0x1')]=function(){return function(){return client[_0x52ee('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x52ee('0x3')],'include':[{'model':_0x52ee('0x4'),'as':'Intervals','attributes':['id',_0x52ee('0x3'),_0x52ee('0x5')]}]},'log':_0x52ee('0x1')});};}; \ No newline at end of file +var _0xb830=['../client','getIntervals','GetInterval','name','interval'];(function(_0x175793,_0x475390){var _0x35ac18=function(_0x5c67e3){while(--_0x5c67e3){_0x175793['push'](_0x175793['shift']());}};_0x35ac18(++_0x475390);}(_0xb830,0xfa));var _0x0b83=function(_0x46572f,_0x27c856){_0x46572f=_0x46572f-0x0;var _0x40827f=_0xb830[_0x46572f];return _0x40827f;};'use strict';var client=require(_0x0b83('0x0'));exports[_0x0b83('0x1')]=function(){return function(){return client['Request'](_0x0b83('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0b83('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x0b83('0x3'),_0x0b83('0x4')]}]},'log':_0x0b83('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 3e31291..79839ce 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 _0x4cf8=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update'];(function(_0xd8bae9,_0x50c977){var _0x115306=function(_0x159c40){while(--_0x159c40){_0xd8bae9['push'](_0xd8bae9['shift']());}};_0x115306(++_0x50c977);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x4cf8[_0x845505];return _0x2513b9;};'use strict';var client=require(_0x84cf('0x0'));exports[_0x84cf('0x1')]=function(_0x287eb2,_0x2125ed){return client[_0x84cf('0x2')](_0x84cf('0x3'),{'body':_0x2125ed,'options':{'where':{'id':_0x287eb2}},'log':_0x84cf('0x4')});};exports[_0x84cf('0x5')]=function(_0x3bbbc3,_0x2d38c0){return client[_0x84cf('0x2')](_0x84cf('0x6'),{'body':_0x2d38c0,'options':{'where':{'id':_0x3bbbc3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xbbbc=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x2c07fb,_0x5ccb42){_0x2c07fb=_0x2c07fb-0x0;var _0x384859=_0xbbbc[_0x2c07fb];return _0x384859;};'use strict';var client=require(_0xcbbb('0x0'));exports[_0xcbbb('0x1')]=function(_0x4314a8,_0x4538f9){return client[_0xcbbb('0x2')](_0xcbbb('0x3'),{'body':_0x4538f9,'options':{'where':{'id':_0x4314a8}},'log':_0xcbbb('0x4')});};exports['addTags']=function(_0xb1ad23,_0x938376){return client[_0xcbbb('0x2')](_0xcbbb('0x5'),{'body':_0x938376,'options':{'where':{'id':_0xb1ad23}},'log':_0xcbbb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 67d4e82..94d2faf 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 _0x976b=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x2e9c68,_0x1ed508){var _0x2afa5a=function(_0x9910a4){while(--_0x9910a4){_0x2e9c68['push'](_0x2e9c68['shift']());}};_0x2afa5a(++_0x1ed508);}(_0x976b,0x12b));var _0xb976=function(_0xd292f5,_0x254058){_0xd292f5=_0xd292f5-0x0;var _0x5c2bdc=_0x976b[_0xd292f5];return _0x5c2bdc;};'use strict';var client=require(_0xb976('0x0'));exports[_0xb976('0x1')]=function(_0x1f1541){return client[_0xb976('0x2')](_0xb976('0x3'),{'body':_0x1f1541,'log':_0xb976('0x4')});}; \ No newline at end of file +var _0xb8ea=['Request','createMailMessage'];(function(_0x590987,_0x442b5c){var _0x3b904c=function(_0xc041f9){while(--_0xc041f9){_0x590987['push'](_0x590987['shift']());}};_0x3b904c(++_0x442b5c);}(_0xb8ea,0x124));var _0xab8e=function(_0x484895,_0x42fbd5){_0x484895=_0x484895-0x0;var _0x2445fc=_0xb8ea[_0x484895];return _0x2445fc;};'use strict';var client=require('../client');exports['create']=function(_0x50f58b){return client[_0xab8e('0x0')]('CreateMailMessage',{'body':_0x50f58b,'log':_0xab8e('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 34d6a62..ddea527 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 _0xcdd5=['mailPause','../client','getMailQueues','Request','timeout','strategy','online'];(function(_0x4d3a03,_0x30cf59){var _0x5d4c3d=function(_0x57f784){while(--_0x57f784){_0x4d3a03['push'](_0x4d3a03['shift']());}};_0x5d4c3d(++_0x30cf59);}(_0xcdd5,0x174));var _0x5cdd=function(_0x1bb45d,_0xc82252){_0x1bb45d=_0x1bb45d-0x0;var _0x7d8175=_0xcdd5[_0x1bb45d];return _0x7d8175;};'use strict';var client=require(_0x5cdd('0x0'));exports[_0x5cdd('0x1')]=function(){return function(){return client[_0x5cdd('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x5cdd('0x3'),_0x5cdd('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x5cdd('0x5'),_0x5cdd('0x6')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x31af=['Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy','User'];(function(_0x2da83f,_0x805fa9){var _0x2cbb7a=function(_0x3b4ccf){while(--_0x3b4ccf){_0x2da83f['push'](_0x2da83f['shift']());}};_0x2cbb7a(++_0x805fa9);}(_0x31af,0x17f));var _0xf31a=function(_0x2c11a8,_0x28b7be){_0x2c11a8=_0x2c11a8-0x0;var _0x519540=_0x31af[_0x2c11a8];return _0x519540;};'use strict';var client=require(_0xf31a('0x0'));exports[_0xf31a('0x1')]=function(){return function(){return client[_0xf31a('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xf31a('0x3'),_0xf31a('0x4'),_0xf31a('0x5')],'include':[{'model':_0xf31a('0x6'),'as':_0xf31a('0x7'),'attributes':['id',_0xf31a('0x3'),_0xf31a('0x8'),_0xf31a('0x9')]}]},'log':_0xf31a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 35bfef3..7e4640c 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 _0x3f0c=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x29f134,_0x44ce01){var _0x263165=function(_0x147a89){while(--_0x147a89){_0x29f134['push'](_0x29f134['shift']());}};_0x263165(++_0x44ce01);}(_0x3f0c,0x1cc));var _0xc3f0=function(_0x26bddd,_0x150143){_0x26bddd=_0x26bddd-0x0;var _0x179b2d=_0x3f0c[_0x26bddd];return _0x179b2d;};'use strict';var client=require(_0xc3f0('0x0'));exports[_0xc3f0('0x1')]=function(_0x1b1950){return client[_0xc3f0('0x2')](_0xc3f0('0x3'),{'body':_0x1b1950,'log':_0xc3f0('0x3')});};exports[_0xc3f0('0x4')]=function(_0x29f718,_0x4c89c2){return client[_0xc3f0('0x2')](_0xc3f0('0x5'),{'body':_0x4c89c2,'options':{'where':{'uniqueid':_0x29f718},'order':[['id',_0xc3f0('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x07e8=['CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client','create'];(function(_0x7d272c,_0x302b37){var _0x381078=function(_0xea04c0){while(--_0xea04c0){_0x7d272c['push'](_0x7d272c['shift']());}};_0x381078(++_0x302b37);}(_0x07e8,0x10f));var _0x807e=function(_0x584aa2,_0x326ac6){_0x584aa2=_0x584aa2-0x0;var _0x380c6b=_0x07e8[_0x584aa2];return _0x380c6b;};'use strict';var client=require(_0x807e('0x0'));exports[_0x807e('0x1')]=function(_0x25e72e){return client['Request'](_0x807e('0x2'),{'body':_0x25e72e,'log':'CreateMailQueueReport'});};exports[_0x807e('0x3')]=function(_0x51e9d4,_0x47d154){return client[_0x807e('0x4')](_0x807e('0x5'),{'body':_0x47d154,'options':{'where':{'uniqueid':_0x51e9d4},'order':[['id',_0x807e('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 31ddaae..10104a8 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 _0xd427=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd427,0x1bb));var _0x7d42=function(_0x29094b,_0x27d9d2){_0x29094b=_0x29094b-0x0;var _0x5aaf79=_0xd427[_0x29094b];return _0x5aaf79;};'use strict';var client=require(_0x7d42('0x0'));exports[_0x7d42('0x1')]=function(_0x19603f,_0x538266){return client[_0x7d42('0x2')](_0x7d42('0x3'),{'body':_0x538266,'options':{'where':{'id':_0x19603f}},'log':_0x7d42('0x4')});};exports[_0x7d42('0x5')]=function(_0x16903e,_0x562e6d){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x562e6d,'options':{'where':{'id':_0x16903e}},'log':_0x7d42('0x6')});}; \ No newline at end of file +var _0xca94=['addTagsToChatInteraction','update','Request','addTags','AddTagsToOpenchannelInteraction'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xca94,0xd3));var _0x4ca9=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0xca94[_0x335271];return _0xa9fff8;};'use strict';var client=require('../client');exports[_0x4ca9('0x0')]=function(_0x2d2cb8,_0xf3a5b2){return client[_0x4ca9('0x1')]('UpdateOpenchannelInteraction',{'body':_0xf3a5b2,'options':{'where':{'id':_0x2d2cb8}},'log':'updateOpenchannelInteraction'});};exports[_0x4ca9('0x2')]=function(_0xfafa52,_0x9c84c1){return client['Request'](_0x4ca9('0x3'),{'body':_0x9c84c1,'options':{'where':{'id':_0xfafa52}},'log':_0x4ca9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index a5bb57e..1e936a2 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 _0x2a65=['createOpenchannelMessage','../client','Request'];(function(_0x4551b9,_0x2d6896){var _0x30e11a=function(_0x366192){while(--_0x366192){_0x4551b9['push'](_0x4551b9['shift']());}};_0x30e11a(++_0x2d6896);}(_0x2a65,0xfa));var _0x52a6=function(_0x29f9af,_0x4f3d10){_0x29f9af=_0x29f9af-0x0;var _0x56e4a8=_0x2a65[_0x29f9af];return _0x56e4a8;};'use strict';var client=require(_0x52a6('0x0'));exports['create']=function(_0x5eb723){return client[_0x52a6('0x1')]('CreateOpenchannelMessage',{'body':_0x5eb723,'log':_0x52a6('0x2')});}; \ No newline at end of file +var _0x1334=['create','Request','createOpenchannelMessage','../client'];(function(_0x587790,_0x3ef501){var _0x7f27f7=function(_0xb9e82d){while(--_0xb9e82d){_0x587790['push'](_0x587790['shift']());}};_0x7f27f7(++_0x3ef501);}(_0x1334,0x93));var _0x4133=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0x1334[_0x2272b5];return _0x110156;};'use strict';var client=require(_0x4133('0x0'));exports[_0x4133('0x1')]=function(_0x76476b){return client[_0x4133('0x2')]('CreateOpenchannelMessage',{'body':_0x76476b,'log':_0x4133('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index babdc51..571a35a 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 _0xfa2f=['Request','name','timeout','strategy','Agents','online','openchannelPause','getOpenchannelQueues'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfa2f,0xe8));var _0xffa2=function(_0x1dd28a,_0x3235b2){_0x1dd28a=_0x1dd28a-0x0;var _0x356267=_0xfa2f[_0x1dd28a];return _0x356267;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0xffa2('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xffa2('0x1'),_0xffa2('0x2'),_0xffa2('0x3')],'include':[{'model':'User','as':_0xffa2('0x4'),'attributes':['id',_0xffa2('0x1'),_0xffa2('0x5'),_0xffa2('0x6')]}]},'log':_0xffa2('0x7')});};}; \ No newline at end of file +var _0x136c=['online','openchannelPause','getOpenchannelQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x136c,0x65));var _0xc136=function(_0x347649,_0x635b73){_0x347649=_0x347649-0x0;var _0x2eebec=_0x136c[_0x347649];return _0x2eebec;};'use strict';var client=require('../client');exports[_0xc136('0x0')]=function(){return function(){return client[_0xc136('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xc136('0x2'),_0xc136('0x3'),_0xc136('0x4')],'include':[{'model':_0xc136('0x5'),'as':_0xc136('0x6'),'attributes':['id',_0xc136('0x2'),_0xc136('0x7'),_0xc136('0x8')]}]},'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 211cc98..ca3388d 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 _0x4d95=['DESC','UpdateOpenchannelQueueReport','Request','CreateOpenchannelQueueReport','update'];(function(_0x581960,_0x1232ff){var _0x4ee892=function(_0x2a920d){while(--_0x2a920d){_0x581960['push'](_0x581960['shift']());}};_0x4ee892(++_0x1232ff);}(_0x4d95,0xa7));var _0x54d9=function(_0x158b83,_0x567c88){_0x158b83=_0x158b83-0x0;var _0x254726=_0x4d95[_0x158b83];return _0x254726;};'use strict';var client=require('../client');exports['create']=function(_0x26d379){return client[_0x54d9('0x0')](_0x54d9('0x1'),{'body':_0x26d379,'log':_0x54d9('0x1')});};exports[_0x54d9('0x2')]=function(_0xc38251,_0x515598){return client[_0x54d9('0x0')]('UpdateOpenchannelQueueReport',{'body':_0x515598,'options':{'where':{'uniqueid':_0xc38251},'order':[['id',_0x54d9('0x3')]],'limit':0x1},'log':_0x54d9('0x4')});}; \ No newline at end of file +var _0xd0a9=['update','UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport'];(function(_0x5dc5ba,_0x5d7fe6){var _0x572791=function(_0x2d40a5){while(--_0x2d40a5){_0x5dc5ba['push'](_0x5dc5ba['shift']());}};_0x572791(++_0x5d7fe6);}(_0xd0a9,0x10b));var _0x9d0a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xd0a9[_0x5f1391];return _0x50ebe3;};'use strict';var client=require('../client');exports[_0x9d0a('0x0')]=function(_0xee52c3){return client[_0x9d0a('0x1')](_0x9d0a('0x2'),{'body':_0xee52c3,'log':_0x9d0a('0x2')});};exports[_0x9d0a('0x3')]=function(_0x49662b,_0x54fcce){return client[_0x9d0a('0x1')](_0x9d0a('0x4'),{'body':_0x54fcce,'options':{'where':{'uniqueid':_0x49662b},'order':[['id',_0x9d0a('0x5')]],'limit':0x1},'log':_0x9d0a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index a36b503..9f1d99f 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 _0xc43c=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x2d3134,_0x477c10){var _0x2dd03e=function(_0x434841){while(--_0x434841){_0x2d3134['push'](_0x2d3134['shift']());}};_0x2dd03e(++_0x477c10);}(_0xc43c,0x152));var _0xcc43=function(_0x3da6b6,_0x586cb9){_0x3da6b6=_0x3da6b6-0x0;var _0x550ff6=_0xc43c[_0x3da6b6];return _0x550ff6;};'use strict';var client=require(_0xcc43('0x0'));exports[_0xcc43('0x1')]=function(_0x41a7fe,_0x3d90f5){return client[_0xcc43('0x2')](_0xcc43('0x3'),{'body':_0x3d90f5,'options':{'where':{'id':_0x41a7fe}},'log':'updateSmsInteraction'});};exports[_0xcc43('0x4')]=function(_0x258c7e,_0x5c21a3){return client[_0xcc43('0x2')](_0xcc43('0x5'),{'body':_0x5c21a3,'options':{'where':{'id':_0x258c7e}},'log':_0xcc43('0x6')});}; \ No newline at end of file +var _0x9221=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x1717a5,_0x4ce9e0){var _0x53db4a=function(_0x574969){while(--_0x574969){_0x1717a5['push'](_0x1717a5['shift']());}};_0x53db4a(++_0x4ce9e0);}(_0x9221,0x64));var _0x1922=function(_0x45bcb1,_0x46cad0){_0x45bcb1=_0x45bcb1-0x0;var _0x4bd6a3=_0x9221[_0x45bcb1];return _0x4bd6a3;};'use strict';var client=require('../client');exports[_0x1922('0x0')]=function(_0x31937b,_0x5484df){return client[_0x1922('0x1')](_0x1922('0x2'),{'body':_0x5484df,'options':{'where':{'id':_0x31937b}},'log':'updateSmsInteraction'});};exports[_0x1922('0x3')]=function(_0x43c8a3,_0x459eee){return client[_0x1922('0x1')](_0x1922('0x4'),{'body':_0x459eee,'options':{'where':{'id':_0x43c8a3}},'log':_0x1922('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4f0ac3a..6eab8cd 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 _0x85ce=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x2beb64,_0x497ccd){var _0x4a7129=function(_0x379a3b){while(--_0x379a3b){_0x2beb64['push'](_0x2beb64['shift']());}};_0x4a7129(++_0x497ccd);}(_0x85ce,0x19a));var _0xe85c=function(_0x1e1af0,_0x5abc3c){_0x1e1af0=_0x1e1af0-0x0;var _0x3d161d=_0x85ce[_0x1e1af0];return _0x3d161d;};'use strict';var client=require(_0xe85c('0x0'));exports[_0xe85c('0x1')]=function(_0x144108){return client[_0xe85c('0x2')](_0xe85c('0x3'),{'body':_0x144108,'log':_0xe85c('0x4')});}; \ No newline at end of file +var _0x1a09=['Request','CreateSmsMessage','../client','create'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x1a09,0x16e));var _0x91a0=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x1a09[_0x481bf7];return _0x461787;};'use strict';var client=require(_0x91a0('0x0'));exports[_0x91a0('0x1')]=function(_0x28f6c2){return client[_0x91a0('0x2')](_0x91a0('0x3'),{'body':_0x28f6c2,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4126035..8fdae90 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x461d3b,_0x572c17){var _0x1c847d=function(_0x5a459c){while(--_0x5a459c){_0x461d3b['push'](_0x461d3b['shift']());}};_0x1c847d(++_0x572c17);}(_0x70e0,0x17b));var _0x070e=function(_0x102bc6,_0x3d14a9){_0x102bc6=_0x102bc6-0x0;var _0x17baac=_0x70e0[_0x102bc6];return _0x17baac;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x2dad23,_0x5183a8){var _0x3bde6e=function(_0x158c1e){while(--_0x158c1e){_0x2dad23['push'](_0x2dad23['shift']());}};_0x3bde6e(++_0x5183a8);}(_0x70e0,0x17b));var _0x070e=function(_0x56d9a3,_0x2c6881){_0x56d9a3=_0x56d9a3-0x0;var _0x3b20e3=_0x70e0[_0x56d9a3];return _0x3b20e3;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 94e4b8c..cd160f0 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1f93f5,_0x4979d0){var _0x1cf938=function(_0x552363){while(--_0x552363){_0x1f93f5['push'](_0x1f93f5['shift']());}};_0x1cf938(++_0x4979d0);}(_0x34e8,0x12c));var _0x834e=function(_0x5bb7ff,_0x433839){_0x5bb7ff=_0x5bb7ff-0x0;var _0x3968b2=_0x34e8[_0x5bb7ff];return _0x3968b2;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x4ae8b8,_0x2578f2){var _0x519900=function(_0x19073f){while(--_0x19073f){_0x4ae8b8['push'](_0x4ae8b8['shift']());}};_0x519900(++_0x2578f2);}(_0x3e74,0x175));var _0x43e7=function(_0x584065,_0xd54a76){_0x584065=_0x584065-0x0;var _0x543f13=_0x3e74[_0x584065];return _0x543f13;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 24b2344..de93ab9 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(_0x92a2e6,_0x15d216){var _0x1cf15b=function(_0x5886af){while(--_0x5886af){_0x92a2e6['push'](_0x92a2e6['shift']());}};_0x1cf15b(++_0x15d216);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x53ad39,_0x864257){var _0x5441b3=function(_0x5bcc5f){while(--_0x5bcc5f){_0x53ad39['push'](_0x53ad39['shift']());}};_0x5441b3(++_0x864257);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 9beadeb..1b27ac0 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 _0xbd0a=['Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','updateWhatsappInteraction','addTags'];(function(_0x476f6f,_0x3123e7){var _0x5bef8b=function(_0x2b6cf2){while(--_0x2b6cf2){_0x476f6f['push'](_0x476f6f['shift']());}};_0x5bef8b(++_0x3123e7);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x1c5e85,_0x838934){_0x1c5e85=_0x1c5e85-0x0;var _0x32ba6e=_0xbd0a[_0x1c5e85];return _0x32ba6e;};'use strict';var client=require(_0xabd0('0x0'));exports['update']=function(_0x3b0fc0,_0x48c569){return client['Request']('UpdateWhatsappInteraction',{'body':_0x48c569,'options':{'where':{'id':_0x3b0fc0}},'log':_0xabd0('0x1')});};exports[_0xabd0('0x2')]=function(_0x41e52b,_0x3d1138){return client[_0xabd0('0x3')](_0xabd0('0x4'),{'body':_0x3d1138,'options':{'where':{'id':_0x41e52b}},'log':_0xabd0('0x5')});}; \ No newline at end of file +var _0x71ab=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x71ab,0x64));var _0xb71a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x71ab[_0x3947c9];return _0x2e7871;};'use strict';var client=require('../client');exports[_0xb71a('0x0')]=function(_0x4d5607,_0x122bc5){return client['Request'](_0xb71a('0x1'),{'body':_0x122bc5,'options':{'where':{'id':_0x4d5607}},'log':_0xb71a('0x2')});};exports[_0xb71a('0x3')]=function(_0x4094b2,_0x37ce74){return client[_0xb71a('0x4')](_0xb71a('0x5'),{'body':_0x37ce74,'options':{'where':{'id':_0x4094b2}},'log':_0xb71a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f185c4c..cd8a1cf 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 _0xdfb5=['../client','Request','CreateWhatsappMessage'];(function(_0x2c9587,_0x3a9893){var _0x83bca0=function(_0x419b5f){while(--_0x419b5f){_0x2c9587['push'](_0x2c9587['shift']());}};_0x83bca0(++_0x3a9893);}(_0xdfb5,0x78));var _0x5dfb=function(_0x542eac,_0x260bd7){_0x542eac=_0x542eac-0x0;var _0x1961f2=_0xdfb5[_0x542eac];return _0x1961f2;};'use strict';var client=require(_0x5dfb('0x0'));exports['create']=function(_0x12a2c8){return client[_0x5dfb('0x1')](_0x5dfb('0x2'),{'body':_0x12a2c8,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x47fd=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x3091c6,_0x220e5b){var _0x5b3831=function(_0x38906c){while(--_0x38906c){_0x3091c6['push'](_0x3091c6['shift']());}};_0x5b3831(++_0x220e5b);}(_0x47fd,0xe1));var _0xd47f=function(_0x27332e,_0x247ad6){_0x27332e=_0x27332e-0x0;var _0x5882fc=_0x47fd[_0x27332e];return _0x5882fc;};'use strict';var client=require(_0xd47f('0x0'));exports[_0xd47f('0x1')]=function(_0x35c640){return client[_0xd47f('0x2')](_0xd47f('0x3'),{'body':_0x35c640,'log':_0xd47f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b2e32da..ea39cc1 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 _0xb88e=['strategy','User','Agents','online','getWhatsappQueues','../client','Request','GetWhatsappQueue','name','timeout'];(function(_0x101211,_0x1a6260){var _0x5694ba=function(_0x2ada08){while(--_0x2ada08){_0x101211['push'](_0x101211['shift']());}};_0x5694ba(++_0x1a6260);}(_0xb88e,0x7d));var _0xeb88=function(_0x2b5e2c,_0x54ad58){_0x2b5e2c=_0x2b5e2c-0x0;var _0x5d6117=_0xb88e[_0x2b5e2c];return _0x5d6117;};'use strict';var client=require(_0xeb88('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xeb88('0x1')](_0xeb88('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb88('0x3'),_0xeb88('0x4'),_0xeb88('0x5')],'include':[{'model':_0xeb88('0x6'),'as':_0xeb88('0x7'),'attributes':['id',_0xeb88('0x3'),_0xeb88('0x8'),'whatsappPause']}]},'log':_0xeb88('0x9')});};}; \ No newline at end of file +var _0xb44f=['Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xb44f,0xf0));var _0xfb44=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xb44f[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0xfb44('0x0'));exports[_0xfb44('0x1')]=function(){return function(){return client[_0xfb44('0x2')](_0xfb44('0x3'),{'options':{'raw':![],'attributes':['id',_0xfb44('0x4'),_0xfb44('0x5'),_0xfb44('0x6')],'include':[{'model':_0xfb44('0x7'),'as':_0xfb44('0x8'),'attributes':['id',_0xfb44('0x4'),_0xfb44('0x9'),_0xfb44('0xa')]}]},'log':_0xfb44('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 5a17f4a..18b4d2c 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 _0xec4f=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x2801e0,_0x4556cb){var _0x3cd783=function(_0x27045d){while(--_0x27045d){_0x2801e0['push'](_0x2801e0['shift']());}};_0x3cd783(++_0x4556cb);}(_0xec4f,0x97));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xfec4('0x0'));exports[_0xfec4('0x1')]=function(_0x25db3a){return client[_0xfec4('0x2')](_0xfec4('0x3'),{'body':_0x25db3a,'log':_0xfec4('0x3')});};exports[_0xfec4('0x4')]=function(_0x7399f1,_0x349e78){return client['Request'](_0xfec4('0x5'),{'body':_0x349e78,'options':{'where':{'uniqueid':_0x7399f1},'order':[['id',_0xfec4('0x6')]],'limit':0x1},'log':_0xfec4('0x5')});}; \ No newline at end of file +var _0xd849=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd849,0xf3));var _0x9d84=function(_0x2d283c,_0x1702d3){_0x2d283c=_0x2d283c-0x0;var _0xa8fbc0=_0xd849[_0x2d283c];return _0xa8fbc0;};'use strict';var client=require(_0x9d84('0x0'));exports['create']=function(_0x124197){return client[_0x9d84('0x1')](_0x9d84('0x2'),{'body':_0x124197,'log':_0x9d84('0x2')});};exports['update']=function(_0x193b32,_0x7350){return client[_0x9d84('0x1')](_0x9d84('0x3'),{'body':_0x7350,'options':{'where':{'uniqueid':_0x193b32},'order':[['id',_0x9d84('0x4')]],'limit':0x1},'log':_0x9d84('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 045b6e2..6973581 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 _0x5180=['START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','./strategy','string','info','format','name','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5180,0x113));var _0x0518=function(_0x2b8233,_0x58ef8a){_0x2b8233=_0x2b8233-0x0;var _0x51c9a5=_0x5180[_0x2b8233];return _0x51c9a5;};'use strict';var schema=require('validate');var _=require(_0x0518('0x0'));var util=require('util');var seqqueue=require(_0x0518('0x1'));var logger=require(_0x0518('0x2'))('routing');var strategy=require(_0x0518('0x3'));var queue=schema({'name':{'type':_0x0518('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x39aaac,_0x2d44c9,_0x114c88){return logger[_0x0518('0x5')](util[_0x0518('0x6')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x39aaac,_0x2d44c9[_0x0518('0x7')],_0x114c88));}function handleFindAgent(_0xa31720){return function(_0x1f0562){return _0x1f0562[_0x0518('0x7')][_0x0518('0x8')]()===_0xa31720['toLowerCase']();};}exports['consequence']=function(_0x4da7e8,_0x532738,_0x4f125a,_0xa5d839){return function(_0x1dbb0c){try{var _0xdf73f8={'name':_0x532738[0x0],'timeout':_0x532738[0x1]};var _0x1296aa=queue[_0x0518('0x9')](_0xdf73f8,{'typecast':!![]});if(_0x1296aa[_0x0518('0xa')]){logger[_0x0518('0xb')](_0x0518('0xc'),_0x4da7e8,_[_0x0518('0xd')](_0x1296aa,_0x0518('0xe'))[_0x0518('0xf')](',\x20'));_0x1dbb0c[_0x0518('0x10')]();}else{var _0x4e80ec=_[_0x0518('0x11')](_0x4f125a[_0x0518('0x12')],handleFindAgent(_0xdf73f8[_0x0518('0x7')]));if(_0x4e80ec){var _0x344f12=(_0xdf73f8[_0x0518('0x13')]||0xa)*0x3e8;var _0x9b8c50,_0x29c479;var _0x5e3010=seqqueue[_0x0518('0x14')](_0x344f12);_0x5e3010['id']=_0x4da7e8;_0x5e3010['atimeout']=_0x344f12;_0x5e3010[_0x0518('0x15')]=_0xa5d839[_0x0518('0x15')];writeLog(_0x4da7e8,_0x4e80ec,util[_0x0518('0x6')](_0x0518('0x16'),_0x344f12));_0x4f125a[_0x0518('0x17')][_0x4da7e8]['on'](_0x0518('0x18'),function(){logger[_0x0518('0x5')](_0x0518('0x19'),_0x4da7e8);clearTimeout(_0x29c479);_0x29c479=undefined;_0x5e3010[_0x0518('0x1a')]();if(_0x4f125a[_0x0518('0x17')][_0x4da7e8]){delete _0x4f125a[_0x0518('0x17')][_0x4da7e8];}_0x1dbb0c[_0x0518('0x10')]();});_0x4f125a[_0x0518('0x17')][_0x4da7e8]['on'](_0x0518('0x1b'),function(){if(_0x4f125a[_0x0518('0x17')][_0x4da7e8]){delete _0x4f125a[_0x0518('0x17')][_0x4da7e8];}});_0x29c479=setTimeout(function(){logger[_0x0518('0x5')]('[%s][AGENT]\x20ROUTING\x20END',_0x4da7e8);clearTimeout(_0x29c479);_0x5e3010[_0x0518('0x1a')]();_0x1dbb0c[_0x0518('0x1c')]();},_0x344f12);strategy[_0x0518('0x1d')](_0x5e3010,_0x4e80ec,_0x4f125a,_0xa5d839);}else{logger['error'](_0x0518('0x1e'),_0x4da7e8,_0xdf73f8['name']);_0x1dbb0c[_0x0518('0x10')]();}}}catch(_0x15ac39){console['log'](_0x15ac39);logger['error'](_0x0518('0x1f'),_0x4da7e8,_0x15ac39[_0x0518('0x20')]);_0x1dbb0c[_0x0518('0x10')]();}};}; \ No newline at end of file +var _0x9258=['[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','log','stack','lodash','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','atimeout','channel','START:%s','rules'];(function(_0x245d86,_0x341d4f){var _0x1511d6=function(_0x2574f4){while(--_0x2574f4){_0x245d86['push'](_0x245d86['shift']());}};_0x1511d6(++_0x341d4f);}(_0x9258,0x13d));var _0x8925=function(_0x4e5684,_0xf4a32c){_0x4e5684=_0x4e5684-0x0;var _0x3f7652=_0x9258[_0x4e5684];return _0x3f7652;};'use strict';var schema=require('validate');var _=require(_0x8925('0x0'));var util=require('util');var seqqueue=require(_0x8925('0x1'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x8925('0x2'));var queue=schema({'name':{'type':_0x8925('0x3'),'required':!![],'message':_0x8925('0x4')},'timeout':{'type':'number','message':_0x8925('0x5')}});function writeLog(_0x25c2b2,_0x5c72e2,_0x189d39){return logger[_0x8925('0x6')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x25c2b2,_0x5c72e2[_0x8925('0x7')],_0x189d39));}function handleFindAgent(_0x19859f){return function(_0x5f35e3){return _0x5f35e3[_0x8925('0x7')][_0x8925('0x8')]()===_0x19859f[_0x8925('0x8')]();};}exports[_0x8925('0x9')]=function(_0x47808b,_0x26ef86,_0x233c44,_0xbbbc6){return function(_0xf3d74){try{var _0x1b2f3f={'name':_0x26ef86[0x0],'timeout':_0x26ef86[0x1]};var _0xeece8c=queue[_0x8925('0xa')](_0x1b2f3f,{'typecast':!![]});if(_0xeece8c[_0x8925('0xb')]){logger[_0x8925('0xc')](_0x8925('0xd'),_0x47808b,_[_0x8925('0xe')](_0xeece8c,'message')[_0x8925('0xf')](',\x20'));_0xf3d74[_0x8925('0x10')]();}else{var _0x44dbcf=_[_0x8925('0x11')](_0x233c44[_0x8925('0x12')],handleFindAgent(_0x1b2f3f[_0x8925('0x7')]));if(_0x44dbcf){var _0x4a7236=(_0x1b2f3f[_0x8925('0x13')]||0xa)*0x3e8;var _0x10e7b2,_0x2f7a0e;var _0x1435f2=seqqueue['createQueue'](_0x4a7236);_0x1435f2['id']=_0x47808b;_0x1435f2[_0x8925('0x14')]=_0x4a7236;_0x1435f2[_0x8925('0x15')]=_0xbbbc6[_0x8925('0x15')];writeLog(_0x47808b,_0x44dbcf,util['format'](_0x8925('0x16'),_0x4a7236));_0x233c44[_0x8925('0x17')][_0x47808b]['on']('end',function(){logger['info'](_0x8925('0x18'),_0x47808b);clearTimeout(_0x2f7a0e);_0x2f7a0e=undefined;_0x1435f2[_0x8925('0x19')]();if(_0x233c44['rules'][_0x47808b]){delete _0x233c44['rules'][_0x47808b];}_0xf3d74[_0x8925('0x10')]();});_0x233c44['rules'][_0x47808b]['on'](_0x8925('0x1a'),function(){if(_0x233c44[_0x8925('0x17')][_0x47808b]){delete _0x233c44['rules'][_0x47808b];}});_0x2f7a0e=setTimeout(function(){logger[_0x8925('0x6')](_0x8925('0x1b'),_0x47808b);clearTimeout(_0x2f7a0e);_0x1435f2['close']();_0xf3d74[_0x8925('0x1c')]();},_0x4a7236);strategy['agent'](_0x1435f2,_0x44dbcf,_0x233c44,_0xbbbc6);}else{logger[_0x8925('0xc')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x47808b,_0x1b2f3f[_0x8925('0x7')]);_0xf3d74[_0x8925('0x10')]();}}}catch(_0x5a39fc){console[_0x8925('0x1d')](_0x5a39fc);logger[_0x8925('0xc')]('[%s][QUEUE]\x20%s',_0x47808b,_0x5a39fc[_0x8925('0x1e')]);_0xf3d74[_0x8925('0x10')]();}};}; \ 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 efdc357..32c8991 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 _0xaada=['postText','error','amazonlex','providerName','providerResponse','dialogState','Failed','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','Message','create','then','body','catch','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','message','toString'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0xaada,0x9d));var _0xaaad=function(_0x1e568e,_0x372f08){_0x1e568e=_0x1e568e-0x0;var _0x49e0f6=_0xaada[_0x1e568e];return _0x49e0f6;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xaaad('0x0'));var logger=require('../../../../config/logger')(_0xaaad('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xaaad('0x2')),'mailMessage':require(_0xaaad('0x3')),'smsMessage':require(_0xaaad('0x4')),'faxMessage':require(_0xaaad('0x5')),'whatsappMessage':require(_0xaaad('0x6'))};exports[_0xaaad('0x7')]=function(_0x2f2364,_0xa3af89){return function(_0x4abc39){try{if(!_[_0xaaad('0x8')](this[_0xaaad('0x9')][_0xaaad('0xa')])){logger[_0xaaad('0xb')](_0xaaad('0xc'),_0x2f2364,_0xaaad('0xd'));return _0x4abc39[_0xaaad('0xe')]();}var _0x1187f1={'ContactId':this[_0xaaad('0xf')]['id'],'sentAt':moment()['format'](_0xaaad('0x10')),'direction':_0xaaad('0x11')};if(this['channel']===_0xaaad('0x12')||this['channel']===_0xaaad('0x13')){_0x1187f1[_0xaaad('0x14')]=this[_0xaaad('0x9')][_0xaaad('0x14')];}var _0x59a819=this[_0xaaad('0x15')];if(_0x59a819===_0xaaad('0x16')){_0x1187f1['ChatWebsiteId']=this[_0xaaad('0x17')]['id'];}else{_0x1187f1[_[_0xaaad('0x18')](_0x59a819)+_0xaaad('0x19')]=this[_0xaaad('0x17')]['id'];}_0x1187f1[_[_0xaaad('0x18')](_0x59a819)+_0xaaad('0x1a')]=this[_0xaaad('0x9')]['id'];if(this[_0xaaad('0x9')][_0xaaad('0x1b')]){var _0x9a0a2a=_0xa3af89[0x4];if(!_['isEmpty'](_0x9a0a2a)){_0x1187f1['body']=utils[_0xaaad('0x1c')](_0x9a0a2a,this);return rpc[_0x59a819+_0xaaad('0x1d')][_0xaaad('0x1e')](_0x1187f1)[_0xaaad('0x1f')](function(_0x5119cb){logger[_0xaaad('0xb')](_0xaaad('0xc'),_0x2f2364,_0x1187f1[_0xaaad('0x20')]);})[_0xaaad('0x21')](function(_0x1f8fd2){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2f2364,JSON[_0xaaad('0x22')](_0x1f8fd2));})[_0xaaad('0x23')](function(){logger[_0xaaad('0xb')](_0xaaad('0x24'),_0x2f2364);_0x4abc39[_0xaaad('0x25')]();});}else{logger['info'](_0xaaad('0x26'),_0x2f2364);_0x4abc39['stop']();}}else{var _0x4da501=this;var _0x139512=new AWS[(_0xaaad('0x27'))]({'accessKeyId':_0xa3af89[0x0],'secretAccessKey':_0xa3af89[0x1],'region':_0xa3af89[0x2]});var _0x469fdf={'botAlias':_0xaaad('0x28'),'botName':_0xa3af89[0x3],'inputText':this[_0xaaad('0x29')][_0xaaad('0x20')],'userId':this[_0xaaad('0x15')]+':'+this[_0xaaad('0x9')]['id'][_0xaaad('0x2a')]()};_0x139512[_0xaaad('0x2b')](_0x469fdf,function(_0x1f17d8,_0x472fae){if(_0x1f17d8){logger[_0xaaad('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x2f2364,_0x1f17d8['message']);_0x4abc39[_0xaaad('0xe')]();}else if(_0x472fae&&_0x472fae[_0xaaad('0x29')]){_0x4da501[_0xaaad('0x20')][_0xaaad('0x2d')]=_0x472fae;_0x1187f1[_0xaaad('0x20')]=_0x472fae[_0xaaad('0x29')];_0x1187f1[_0xaaad('0x2e')]=_0xaaad('0x2d');_0x1187f1[_0xaaad('0x2f')]=JSON[_0xaaad('0x22')](_0x472fae);return rpc[_0x59a819+_0xaaad('0x1d')]['create'](_0x1187f1)[_0xaaad('0x1f')](function(_0x4d7572){logger['info'](_0xaaad('0xc'),_0x2f2364,_0x1187f1[_0xaaad('0x20')]);if(_0x472fae[_0xaaad('0x30')]==_0xaaad('0x31')){_0x4abc39[_0xaaad('0xe')]();}else{_0x4abc39[_0xaaad('0x25')]();}})[_0xaaad('0x21')](function(_0x3598fb){logger['error'](_0xaaad('0xc'),_0x2f2364,JSON[_0xaaad('0x22')](_0x3598fb));_0x4abc39[_0xaaad('0xe')]();});}else{_0x4abc39[_0xaaad('0xe')]();}});}}catch(_0x2dec51){logger[_0xaaad('0x2c')](_0xaaad('0xc'),_0x2f2364,JSON[_0xaaad('0x22')](_0x2dec51));_0x4abc39[_0xaaad('0x25')]();}};}; \ No newline at end of file +var _0xd665=['created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','info','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId'];(function(_0x109f36,_0x13962){var _0x2c1fdb=function(_0x5d3262){while(--_0x5d3262){_0x109f36['push'](_0x109f36['shift']());}};_0x2c1fdb(++_0x13962);}(_0xd665,0x15f));var _0x5d66=function(_0x5d44b5,_0x2b37b9){_0x5d44b5=_0x5d44b5-0x0;var _0x27b784=_0xd665[_0x5d44b5];return _0x27b784;};'use strict';var _=require(_0x5d66('0x0'));var moment=require(_0x5d66('0x1'));var AWS=require(_0x5d66('0x2'));var utils=require('./utils');var logger=require(_0x5d66('0x3'))(_0x5d66('0x4'));var rpc={'chatMessage':require(_0x5d66('0x5')),'openchannelMessage':require(_0x5d66('0x6')),'mailMessage':require(_0x5d66('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5d66('0x8'))};exports[_0x5d66('0x9')]=function(_0x1ce45d,_0x4f5fb4){return function(_0x36691d){try{if(!_[_0x5d66('0xa')](this['interaction'][_0x5d66('0xb')])){logger['info'](_0x5d66('0xc'),_0x1ce45d,_0x5d66('0xd'));return _0x36691d[_0x5d66('0xe')]();}var _0x343d07={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5d66('0xf')](_0x5d66('0x10')),'direction':_0x5d66('0x11')};if(this[_0x5d66('0x12')]==='sms'||this[_0x5d66('0x12')]==='whatsapp'){_0x343d07[_0x5d66('0x13')]=this[_0x5d66('0x14')]['phone'];}var _0x16e689=this['channel'];if(_0x16e689===_0x5d66('0x15')){_0x343d07[_0x5d66('0x16')]=this['account']['id'];}else{_0x343d07[_[_0x5d66('0x17')](_0x16e689)+_0x5d66('0x18')]=this['account']['id'];}_0x343d07[_['upperFirst'](_0x16e689)+'InteractionId']=this[_0x5d66('0x14')]['id'];if(this['interaction'][_0x5d66('0x19')]){var _0x26a691=_0x4f5fb4[0x4];if(!_[_0x5d66('0x1a')](_0x26a691)){_0x343d07['body']=utils[_0x5d66('0x1b')](_0x26a691,this);return rpc[_0x16e689+_0x5d66('0x1c')][_0x5d66('0x1d')](_0x343d07)[_0x5d66('0x1e')](function(_0x2d003a){logger['info'](_0x5d66('0xc'),_0x1ce45d,_0x343d07[_0x5d66('0x1f')]);})[_0x5d66('0x20')](function(_0x2f098e){logger[_0x5d66('0x21')](_0x5d66('0xc'),_0x1ce45d,JSON[_0x5d66('0x22')](_0x2f098e));})[_0x5d66('0x23')](function(){logger[_0x5d66('0x24')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1ce45d);_0x36691d[_0x5d66('0x25')]();});}else{logger[_0x5d66('0x24')](_0x5d66('0x26'),_0x1ce45d);_0x36691d[_0x5d66('0x25')]();}}else{var _0x3b5ea6=this;var _0x40a09b=new AWS['LexRuntime']({'accessKeyId':_0x4f5fb4[0x0],'secretAccessKey':_0x4f5fb4[0x1],'region':_0x4f5fb4[0x2]});var _0x43ad30={'botAlias':'$LATEST','botName':_0x4f5fb4[0x3],'inputText':this[_0x5d66('0x27')]['body'],'userId':this[_0x5d66('0x12')]+':'+this[_0x5d66('0x14')]['id'][_0x5d66('0x28')]()};_0x40a09b[_0x5d66('0x29')](_0x43ad30,function(_0x1290cf,_0x1eaf3c){if(_0x1290cf){logger[_0x5d66('0x21')](_0x5d66('0xc'),_0x1ce45d,_0x1290cf[_0x5d66('0x27')]);_0x36691d[_0x5d66('0xe')]();}else if(_0x1eaf3c&&_0x1eaf3c['message']){_0x3b5ea6[_0x5d66('0x1f')][_0x5d66('0x2a')]=_0x1eaf3c;_0x343d07[_0x5d66('0x1f')]=_0x1eaf3c['message'];_0x343d07[_0x5d66('0x2b')]='amazonlex';_0x343d07[_0x5d66('0x2c')]=JSON[_0x5d66('0x22')](_0x1eaf3c);return rpc[_0x16e689+_0x5d66('0x1c')][_0x5d66('0x1d')](_0x343d07)['then'](function(_0x49fd33){logger[_0x5d66('0x24')](_0x5d66('0xc'),_0x1ce45d,_0x343d07[_0x5d66('0x1f')]);if(_0x1eaf3c[_0x5d66('0x2d')]==_0x5d66('0x2e')){_0x36691d[_0x5d66('0xe')]();}else{_0x36691d['stop']();}})[_0x5d66('0x20')](function(_0x4a1188){logger['error'](_0x5d66('0xc'),_0x1ce45d,JSON['stringify'](_0x4a1188));_0x36691d[_0x5d66('0xe')]();});}else{_0x36691d[_0x5d66('0xe')]();}});}}catch(_0x1d66ca){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1ce45d,JSON[_0x5d66('0x22')](_0x1d66ca));_0x36691d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 4abb061..753ab44 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 _0x5609=['html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','inReplyTo'];(function(_0x27a016,_0x1ed804){var _0x1478f8=function(_0x13f2e6){while(--_0x13f2e6){_0x27a016['push'](_0x27a016['shift']());}};_0x1478f8(++_0x1ed804);}(_0x5609,0xa8));var _0x9560=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5609[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x9560('0x0'));var moment=require(_0x9560('0x1'));var utils=require(_0x9560('0x2'));var logger=require(_0x9560('0x3'))(_0x9560('0x4'));var rpc={'chatMessage':require(_0x9560('0x5')),'openchannelMessage':require(_0x9560('0x6')),'mailMessage':require(_0x9560('0x7')),'smsMessage':require(_0x9560('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x9560('0x9')),'chatInteraction':require(_0x9560('0xa')),'openchannelInteraction':require(_0x9560('0xb')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x9560('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9560('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x9560('0xe')]=function(_0x1f6074,_0x2433d5,_0x48a587,_0x3db10e){return function(_0x3f001a){try{var _0x53a36c=this['channel'];if(_0x53a36c===_0x9560('0xf')&&_0x3db10e[_0x9560('0x10')]['isAutoreply']){logger[_0x9560('0x11')](_0x9560('0x12'),_0x1f6074,_0x9560('0x13'));return _0x3f001a[_0x9560('0x14')]();}if(_0x2433d5[0x0]==='1'&&(_[_0x9560('0x15')](this[_0x9560('0x16')][_0x9560('0x17')])||!this[_0x9560('0x16')]['created'])){logger[_0x9560('0x11')](_0x9560('0x12'),_0x1f6074,_0x9560('0x18'));return _0x3f001a[_0x9560('0x14')]();}if(_0x2433d5[0x0]==='2'&&this[_0x9560('0x16')][_0x9560('0x19')]){logger[_0x9560('0x11')](_0x9560('0x1a'),_0x1f6074,_0x9560('0x1b'));return _0x3f001a[_0x9560('0x14')]();}var _0xd7bb4e={'ContactId':this[_0x9560('0x1c')]['id'],'sentAt':moment()[_0x9560('0x1d')](_0x9560('0x1e')),'direction':_0x9560('0x1f')};if(this[_0x9560('0x20')]===_0x9560('0xf')){_0xd7bb4e[_0x9560('0x10')]=utils[_0x9560('0x21')](_0x2433d5[0x2],this);}else{_0xd7bb4e[_0x9560('0x10')]=utils[_0x9560('0x21')](_0x2433d5[0x1],this);}if(this[_0x9560('0x22')]){_0xd7bb4e['to']=this['message'][_0x9560('0x23')]||'';if(this[_0x9560('0x20')]==='mail'&&_0x2433d5[0x1]==='1'){_0xd7bb4e['cc']=this[_0x9560('0x22')]['cc']||'';}_0xd7bb4e[_0x9560('0x23')]=this[_0x9560('0x22')]['to']||'';_0xd7bb4e[_0x9560('0x24')]=this['message'][_0x9560('0x24')]||'';_0xd7bb4e['read']=!![];if(this[_0x9560('0x22')][_0x9560('0x25')]){_0xd7bb4e[_0x9560('0x25')]='';_0xd7bb4e[_0x9560('0x25')]+=_[_0x9560('0x26')](this[_0x9560('0x22')]['subject'],_0x9560('0x27'))?'':'Re:\x20';_0xd7bb4e['subject']+=this[_0x9560('0x22')][_0x9560('0x25')];}}if(this['channel']===_0x9560('0x28')){_0xd7bb4e[_0x9560('0x29')]=this[_0x9560('0x2a')]['id'];}else{_0xd7bb4e[_[_0x9560('0x2b')](this['channel'])+'AccountId']=this[_0x9560('0x2a')]['id'];}_0xd7bb4e[_[_0x9560('0x2b')](this[_0x9560('0x20')])+'InteractionId']=this[_0x9560('0x16')]['id'];var _0x1c4be9=this[_0x9560('0x16')];if(rpc[this[_0x9560('0x20')]+'Message']){if(this[_0x9560('0x20')]===_0x9560('0xf')){_0xd7bb4e[_0x9560('0x2c')]=this[_0x9560('0x22')]['messageId'];_0xd7bb4e[_0x9560('0x2d')]=_0x9560('0x2e')+_[_0x9560('0x2f')](_0xd7bb4e[_0x9560('0x10')],_0x9560('0x30'),_0x9560('0x31'))+_0x9560('0x32');_0xd7bb4e[_0x9560('0x33')]={'Auto-Submitted':_0x9560('0x34'),'X-Auto-Response-Suppress':_0x9560('0x35'),'Precedence':_0x9560('0x36')};return mailRpc[_0x9560('0x37')](this[_0x9560('0x2a')]['smtpOptions'],_0xd7bb4e)[_0x9560('0x38')](function(_0x427fbe){logger[_0x9560('0x11')](_0x9560('0x39'),_0x1f6074);_0xd7bb4e[_0x9560('0x3a')]=_0x427fbe[_0x9560('0x22')][_0x9560('0x3a')];return rpc[_0x53a36c+_0x9560('0x3b')][_0x9560('0x3c')](_0xd7bb4e);})['then'](function(_0x20e065){logger[_0x9560('0x11')]('[%s][AUTOREPLY]\x20%s',_0x1f6074,JSON[_0x9560('0x3d')](_0x20e065));})[_0x9560('0x3e')](function(_0xd9aa7a){logger['error'](_0x9560('0x3f'),_0x1f6074,JSON['stringify'](_0xd9aa7a));})[_0x9560('0x40')](function(){Promise[_0x9560('0x41')]()[_0x9560('0x38')](function(){if(_0x2433d5[0x0]!=='2'||_0x1c4be9['autoreplyExecuted'])return;return rpc[_0x53a36c+'Interaction'][_0x9560('0x42')](_0x1c4be9['id'],{'autoreplyExecuted':!![]})[_0x9560('0x38')](function(_0x398dd9){logger[_0x9560('0x11')](_0x9560('0x1a'),_0x1f6074,JSON[_0x9560('0x3d')](_0x398dd9));})['catch'](function(_0xfdc18c){logger[_0x9560('0x43')](_0x9560('0x44'),_0x1f6074,JSON[_0x9560('0x3d')](_0xfdc18c));});})['then'](function(){_0x3f001a[_0x9560('0x14')]();});});}else{return rpc[this[_0x9560('0x20')]+_0x9560('0x3b')][_0x9560('0x3c')](_0xd7bb4e)['then'](function(){logger[_0x9560('0x11')]('[%s][AUTOREPLY]\x20%s',_0x1f6074,_0xd7bb4e[_0x9560('0x10')]);})[_0x9560('0x3e')](function(_0x5ded53){logger[_0x9560('0x43')](_0x9560('0x12'),_0x1f6074,JSON[_0x9560('0x3d')](_0x5ded53));})['finally'](function(){Promise['resolve']()[_0x9560('0x38')](function(){if(_0x2433d5[0x0]!=='2'||_0x1c4be9[_0x9560('0x19')])return;return rpc[_0x53a36c+_0x9560('0x45')][_0x9560('0x42')](_0x1c4be9['id'],{'autoreplyExecuted':!![]})[_0x9560('0x38')](function(_0x1d6753){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1f6074,JSON['stringify'](_0x1d6753));})[_0x9560('0x3e')](function(_0x192ff5){logger[_0x9560('0x43')](_0x9560('0x44'),_0x1f6074,JSON[_0x9560('0x3d')](_0x192ff5));});})[_0x9560('0x38')](function(){_0x3f001a['next']();});});}}}catch(_0x3162f4){logger['error'](_0x9560('0x12'),_0x1f6074,JSON['stringify'](_0x3162f4));_0x3f001a[_0x9560('0x46')]();}};}; \ No newline at end of file +var _0x6c9b=['then','create','catch','error','stringify','finally','resolve','autoreplyExecuted','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','messageId','html','','replace','';_0x16f2a3[_0xb6c9('0x34')]={'Auto-Submitted':_0xb6c9('0x35'),'X-Auto-Response-Suppress':'All','Precedence':_0xb6c9('0x36')};return mailRpc[_0xb6c9('0x37')](this[_0xb6c9('0x2c')][_0xb6c9('0x38')],_0x16f2a3)[_0xb6c9('0x39')](function(_0x462026){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3b4c79);_0x16f2a3[_0xb6c9('0x2f')]=_0x462026['message'][_0xb6c9('0x2f')];return rpc[_0x1e0271+_0xb6c9('0x2e')][_0xb6c9('0x3a')](_0x16f2a3);})['then'](function(_0x15ad54){logger[_0xb6c9('0x12')](_0xb6c9('0x13'),_0x3b4c79,JSON['stringify'](_0x15ad54));})[_0xb6c9('0x3b')](function(_0x3495d7){logger[_0xb6c9('0x3c')]('[RPC][%s][AUTOREPLY]\x20%s',_0x3b4c79,JSON[_0xb6c9('0x3d')](_0x3495d7));})[_0xb6c9('0x3e')](function(){Promise[_0xb6c9('0x3f')]()[_0xb6c9('0x39')](function(){if(_0x43080d[0x0]!=='2'||_0xa80084[_0xb6c9('0x40')])return;return rpc[_0x1e0271+_0xb6c9('0x41')]['update'](_0xa80084['id'],{'autoreplyExecuted':!![]})[_0xb6c9('0x39')](function(_0x27eb23){logger[_0xb6c9('0x12')](_0xb6c9('0x1a'),_0x3b4c79,JSON[_0xb6c9('0x3d')](_0x27eb23));})['catch'](function(_0x4a52f4){logger[_0xb6c9('0x3c')](_0xb6c9('0x42'),_0x3b4c79,JSON[_0xb6c9('0x3d')](_0x4a52f4));});})[_0xb6c9('0x39')](function(){_0x5db345[_0xb6c9('0x19')]();});});}else{return rpc[this['channel']+_0xb6c9('0x2e')][_0xb6c9('0x3a')](_0x16f2a3)[_0xb6c9('0x39')](function(){logger[_0xb6c9('0x12')](_0xb6c9('0x13'),_0x3b4c79,_0x16f2a3[_0xb6c9('0x10')]);})[_0xb6c9('0x3b')](function(_0x3a12a9){logger[_0xb6c9('0x3c')](_0xb6c9('0x13'),_0x3b4c79,JSON['stringify'](_0x3a12a9));})[_0xb6c9('0x3e')](function(){Promise[_0xb6c9('0x3f')]()[_0xb6c9('0x39')](function(){if(_0x43080d[0x0]!=='2'||_0xa80084['autoreplyExecuted'])return;return rpc[_0x1e0271+_0xb6c9('0x41')][_0xb6c9('0x43')](_0xa80084['id'],{'autoreplyExecuted':!![]})[_0xb6c9('0x39')](function(_0x551319){logger['info'](_0xb6c9('0x1a'),_0x3b4c79,JSON[_0xb6c9('0x3d')](_0x551319));})[_0xb6c9('0x3b')](function(_0x3cc6b0){logger[_0xb6c9('0x3c')](_0xb6c9('0x42'),_0x3b4c79,JSON[_0xb6c9('0x3d')](_0x3cc6b0));});})[_0xb6c9('0x39')](function(){_0x5db345[_0xb6c9('0x19')]();});});}}}catch(_0x3cecf6){logger[_0xb6c9('0x3c')](_0xb6c9('0x13'),_0x3b4c79,JSON['stringify'](_0x3cecf6));_0x5db345['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 558ed84..26485f6 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x173e=['[%s][CLOSE]\x20%s','stringify','stop','error','moment','routing','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0x173e,0x82));var _0xe173=function(_0x524439,_0x38acb4){_0x524439=_0x524439-0x0;var _0x4baa6d=_0x173e[_0x524439];return _0x4baa6d;};'use strict';var moment=require(_0xe173('0x0'));var logger=require('../../../../config/logger')(_0xe173('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xe173('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xe173('0x3'))};exports[_0xe173('0x4')]=function(_0x5f3386,_0x21b1c7,_0x10512b,_0x141c7f){return function(_0x1fe08b){try{logger['info'](_0xe173('0x5'),_0x5f3386,_0x21b1c7[0x0]);var _0x23a984={'closed':0x1,'closedAt':moment()[_0xe173('0x6')](_0xe173('0x7')),'closeReason':_0xe173('0x8'),'disposition':_0x21b1c7[0x0]};if(rpc[_0x141c7f[_0xe173('0x9')]+_0xe173('0xa')]){rpc[_0x141c7f['channel']+_0xe173('0xa')][_0xe173('0xb')](_0x141c7f[_0xe173('0xc')]['id'],_0x23a984)[_0xe173('0xd')](function(_0x2309ca){logger[_0xe173('0xe')](_0xe173('0xf'),_0x5f3386,_0x141c7f['interaction']['id']);})[_0xe173('0x10')](function(_0x58eab6){logger['error'](_0xe173('0x11'),_0x5f3386,JSON[_0xe173('0x12')](_0x58eab6));})['finally'](function(){_0x1fe08b[_0xe173('0x13')]();});}}catch(_0xf4530c){logger[_0xe173('0x14')](_0xe173('0x11'),_0x5f3386,JSON['stringify'](_0xf4530c));_0x1fe08b['stop']();}};}; \ No newline at end of file +var _0x4183=['catch','error','stringify','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then'];(function(_0x5ffbb6,_0x25896a){var _0x7a842d=function(_0x18eeb5){while(--_0x18eeb5){_0x5ffbb6['push'](_0x5ffbb6['shift']());}};_0x7a842d(++_0x25896a);}(_0x4183,0x1ba));var _0x3418=function(_0xd9f49c,_0x286ce6){_0xd9f49c=_0xd9f49c-0x0;var _0x2daa60=_0x4183[_0xd9f49c];return _0x2daa60;};'use strict';var moment=require(_0x3418('0x0'));var logger=require(_0x3418('0x1'))(_0x3418('0x2'));var rpc={'chatInteraction':require(_0x3418('0x3')),'openchannelInteraction':require(_0x3418('0x4')),'smsInteraction':require(_0x3418('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x3418('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x3418('0x7')]=function(_0xe27752,_0x38f3cc,_0x4c3ba3,_0x144de0){return function(_0x48fbbc){try{logger[_0x3418('0x8')](_0x3418('0x9'),_0xe27752,_0x38f3cc[0x0]);var _0x1bc774={'closed':0x1,'closedAt':moment()[_0x3418('0xa')](_0x3418('0xb')),'closeReason':_0x3418('0xc'),'disposition':_0x38f3cc[0x0]};if(rpc[_0x144de0[_0x3418('0xd')]+_0x3418('0xe')]){rpc[_0x144de0['channel']+_0x3418('0xe')][_0x3418('0xf')](_0x144de0[_0x3418('0x10')]['id'],_0x1bc774)[_0x3418('0x11')](function(_0xfeec8f){logger[_0x3418('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xe27752,_0x144de0[_0x3418('0x10')]['id']);})[_0x3418('0x12')](function(_0x4c2ac9){logger[_0x3418('0x13')]('[%s][CLOSE]\x20%s',_0xe27752,JSON[_0x3418('0x14')](_0x4c2ac9));})['finally'](function(){_0x48fbbc[_0x3418('0x15')]();});}}catch(_0x5b62ee){logger[_0x3418('0x13')](_0x3418('0x16'),_0xe27752,JSON[_0x3418('0x14')](_0x5b62ee));_0x48fbbc['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 9cbe5b4..5aabfe2 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9e7=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','endConversation','catch','error','lodash','moment','apiai-promise','./utils'];(function(_0xe25f69,_0x189354){var _0x4d4507=function(_0x55b1c3){while(--_0x55b1c3){_0xe25f69['push'](_0xe25f69['shift']());}};_0x4d4507(++_0x189354);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x2e801e,_0x8e304d){_0x2e801e=_0x2e801e-0x0;var _0x15d0d9=_0xe9e7[_0x2e801e];return _0x15d0d9;};'use strict';var _=require(_0x7e9e('0x0'));var moment=require(_0x7e9e('0x1'));var apiai=require(_0x7e9e('0x2'));var md5=require('md5');var utils=require(_0x7e9e('0x3'));var logger=require(_0x7e9e('0x4'))(_0x7e9e('0x5'));var rpc={'chatMessage':require(_0x7e9e('0x6')),'openchannelMessage':require(_0x7e9e('0x7')),'mailMessage':require(_0x7e9e('0x8')),'smsMessage':require(_0x7e9e('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x7e9e('0xa'))};exports[_0x7e9e('0xb')]=function(_0xba25,_0x508a97){return function(_0x366350){try{if(!_['isNil'](this[_0x7e9e('0xc')][_0x7e9e('0xd')])){logger[_0x7e9e('0xe')](_0x7e9e('0xf'),_0xba25,_0x7e9e('0x10'));return _0x366350[_0x7e9e('0x11')]();}var _0x7a18bd={'ContactId':this[_0x7e9e('0x12')]['id'],'sentAt':moment()[_0x7e9e('0x13')](_0x7e9e('0x14')),'direction':_0x7e9e('0x15')};if(this[_0x7e9e('0x16')]==='sms'||this['channel']==='whatsapp'){_0x7a18bd[_0x7e9e('0x17')]=this[_0x7e9e('0xc')][_0x7e9e('0x17')];}var _0x32b012=this['channel'];if(_0x32b012==='chat'){_0x7a18bd[_0x7e9e('0x18')]=this[_0x7e9e('0x19')]['id'];}else{_0x7a18bd[_[_0x7e9e('0x1a')](_0x32b012)+_0x7e9e('0x1b')]=this[_0x7e9e('0x19')]['id'];}_0x7a18bd[_[_0x7e9e('0x1a')](_0x32b012)+_0x7e9e('0x1c')]=this['interaction']['id'];if(this[_0x7e9e('0xc')]['created']){var _0x3a1a89=_0x508a97[0x2];if(!_[_0x7e9e('0x1d')](_0x3a1a89)){_0x7a18bd[_0x7e9e('0x1e')]=utils[_0x7e9e('0x1f')](_0x3a1a89,this);return rpc[_0x32b012+_0x7e9e('0x20')][_0x7e9e('0x21')](_0x7a18bd)[_0x7e9e('0x22')](function(_0x5a2a77){logger[_0x7e9e('0xe')](_0x7e9e('0xf'),_0xba25,_0x7a18bd['body']);})['catch'](function(_0x4ea3f){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xba25,JSON[_0x7e9e('0x23')](_0x4ea3f));})[_0x7e9e('0x24')](function(){logger[_0x7e9e('0xe')](_0x7e9e('0x25'),_0xba25);_0x366350[_0x7e9e('0x26')]();});}else{logger[_0x7e9e('0xe')](_0x7e9e('0x27'),_0xba25);_0x366350[_0x7e9e('0x26')]();}}else{var _0x18c975=this;var _0x5206df=apiai(_0x508a97[0x0],{'language':_0x508a97[0x1]||'en'});return _0x5206df[_0x7e9e('0x28')](this[_0x7e9e('0x29')][_0x7e9e('0x1e')],{'sessionId':md5(this[_0x7e9e('0xc')]['id'])})['then'](function(_0x15bb40){_0x18c975[_0x7e9e('0x1e')][_0x7e9e('0x2a')]=_0x15bb40;_0x7a18bd[_0x7e9e('0x1e')]=_0x15bb40[_0x7e9e('0x2b')][_0x7e9e('0x2c')][_0x7e9e('0x2d')];_0x7a18bd['providerName']=_0x7e9e('0x2a');_0x7a18bd[_0x7e9e('0x2e')]=JSON[_0x7e9e('0x23')](_0x15bb40);return rpc[_0x32b012+_0x7e9e('0x20')]['create'](_0x7a18bd)[_0x7e9e('0x22')](function(_0x3f6655){logger[_0x7e9e('0xe')](_0x7e9e('0xf'),_0xba25,_0x7a18bd['body']);if(_0x15bb40[_0x7e9e('0x2b')]['metadata'][_0x7e9e('0x2f')]){_0x366350[_0x7e9e('0x11')]();}else{_0x366350[_0x7e9e('0x26')]();}})[_0x7e9e('0x30')](function(_0x12de96){logger[_0x7e9e('0x31')](_0x7e9e('0xf'),_0xba25,JSON[_0x7e9e('0x23')](_0x12de96));_0x366350['next']();});})['catch'](function(_0x2d9c81){logger['error'](_0x7e9e('0xf'),_0xba25,_0x2d9c81[_0x7e9e('0x29')]);_0x366350['next']();});}}catch(_0x4a53ac){logger[_0x7e9e('0x31')](_0x7e9e('0xf'),_0xba25,JSON['stringify'](_0x4a53ac));_0x366350['stop']();}};}; \ No newline at end of file +var _0x9ab0=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','providerResponse','Message','endConversation','next','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','create','then','[%s][DIALOGFLOW]\x20%s','error','stringify','finally'];(function(_0x2f0bf1,_0x183ef1){var _0xf1df38=function(_0x56982a){while(--_0x56982a){_0x2f0bf1['push'](_0x2f0bf1['shift']());}};_0xf1df38(++_0x183ef1);}(_0x9ab0,0x195));var _0x09ab=function(_0x459417,_0x127c10){_0x459417=_0x459417-0x0;var _0x5dacb3=_0x9ab0[_0x459417];return _0x5dacb3;};'use strict';var _=require(_0x09ab('0x0'));var moment=require(_0x09ab('0x1'));var apiai=require(_0x09ab('0x2'));var md5=require(_0x09ab('0x3'));var utils=require(_0x09ab('0x4'));var logger=require(_0x09ab('0x5'))(_0x09ab('0x6'));var rpc={'chatMessage':require(_0x09ab('0x7')),'openchannelMessage':require(_0x09ab('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x09ab('0x9'))};exports[_0x09ab('0xa')]=function(_0x241bd1,_0x233f2a){return function(_0x610663){try{if(!_[_0x09ab('0xb')](this[_0x09ab('0xc')][_0x09ab('0xd')])){logger[_0x09ab('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x241bd1,_0x09ab('0xf'));return _0x610663['next']();}var _0x10fc51={'ContactId':this[_0x09ab('0x10')]['id'],'sentAt':moment()[_0x09ab('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x09ab('0x12')]===_0x09ab('0x13')||this['channel']==='whatsapp'){_0x10fc51[_0x09ab('0x14')]=this[_0x09ab('0xc')][_0x09ab('0x14')];}var _0x4705df=this[_0x09ab('0x12')];if(_0x4705df===_0x09ab('0x15')){_0x10fc51[_0x09ab('0x16')]=this[_0x09ab('0x17')]['id'];}else{_0x10fc51[_[_0x09ab('0x18')](_0x4705df)+_0x09ab('0x19')]=this[_0x09ab('0x17')]['id'];}_0x10fc51[_[_0x09ab('0x18')](_0x4705df)+'InteractionId']=this[_0x09ab('0xc')]['id'];if(this[_0x09ab('0xc')][_0x09ab('0x1a')]){var _0x4a165b=_0x233f2a[0x2];if(!_[_0x09ab('0x1b')](_0x4a165b)){_0x10fc51[_0x09ab('0x1c')]=utils[_0x09ab('0x1d')](_0x4a165b,this);return rpc[_0x4705df+'Message'][_0x09ab('0x1e')](_0x10fc51)[_0x09ab('0x1f')](function(_0x88f781){logger[_0x09ab('0xe')](_0x09ab('0x20'),_0x241bd1,_0x10fc51[_0x09ab('0x1c')]);})['catch'](function(_0x35d86d){logger[_0x09ab('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x241bd1,JSON[_0x09ab('0x22')](_0x35d86d));})[_0x09ab('0x23')](function(){logger[_0x09ab('0xe')](_0x09ab('0x24'),_0x241bd1);_0x610663[_0x09ab('0x25')]();});}else{logger[_0x09ab('0xe')](_0x09ab('0x26'),_0x241bd1);_0x610663[_0x09ab('0x25')]();}}else{var _0x48d46c=this;var _0x30304f=apiai(_0x233f2a[0x0],{'language':_0x233f2a[0x1]||'en'});return _0x30304f[_0x09ab('0x27')](this[_0x09ab('0x28')][_0x09ab('0x1c')],{'sessionId':md5(this[_0x09ab('0xc')]['id'])})[_0x09ab('0x1f')](function(_0x597beb){_0x48d46c[_0x09ab('0x1c')][_0x09ab('0x29')]=_0x597beb;_0x10fc51[_0x09ab('0x1c')]=_0x597beb[_0x09ab('0x2a')][_0x09ab('0x2b')]['speech'];_0x10fc51['providerName']=_0x09ab('0x29');_0x10fc51[_0x09ab('0x2c')]=JSON['stringify'](_0x597beb);return rpc[_0x4705df+_0x09ab('0x2d')][_0x09ab('0x1e')](_0x10fc51)[_0x09ab('0x1f')](function(_0x1e6303){logger[_0x09ab('0xe')](_0x09ab('0x20'),_0x241bd1,_0x10fc51[_0x09ab('0x1c')]);if(_0x597beb[_0x09ab('0x2a')]['metadata'][_0x09ab('0x2e')]){_0x610663[_0x09ab('0x2f')]();}else{_0x610663[_0x09ab('0x25')]();}})[_0x09ab('0x30')](function(_0x177069){logger[_0x09ab('0x21')](_0x09ab('0x20'),_0x241bd1,JSON[_0x09ab('0x22')](_0x177069));_0x610663[_0x09ab('0x2f')]();});})[_0x09ab('0x30')](function(_0x12f4f2){logger[_0x09ab('0x21')](_0x09ab('0x20'),_0x241bd1,_0x12f4f2['message']);_0x610663[_0x09ab('0x2f')]();});}}catch(_0x4763ce){logger[_0x09ab('0x21')](_0x09ab('0x20'),_0x241bd1,JSON[_0x09ab('0x22')](_0x4763ce));_0x610663[_0x09ab('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 54c1954..8d07166 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09a2=['channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','then','length','diagnosticInfo','queryResult','fields','end_conversation','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','dialogflowV2','providerResponse','fulfillmentText','all','next','stop','stack','md5','moment','bluebird','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','interaction','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x09a2,0x71));var _0x209a=function(_0x19555b,_0x7d44cd){_0x19555b=_0x19555b-0x0;var _0x1ddc49=_0x09a2[_0x19555b];return _0x1ddc49;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x209a('0x0'));var moment=require(_0x209a('0x1'));var Promise=require(_0x209a('0x2'));var logger=require('../../../../config/logger')(_0x209a('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x209a('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x209a('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x209a('0x6')),'whatsappMessage':require(_0x209a('0x7'))};function createMessage(_0xf1ee92,_0x15105d,_0x1e17f9,_0xf92e9a){return new Promise(function(_0x5f4787,_0x1ca6cb){var _0x11cd9b=_['clone'](_0x1e17f9);_0x11cd9b[_0x209a('0x8')]=_0xf92e9a;return rpc[_0x15105d+_0x209a('0x9')][_0x209a('0xa')](_0x11cd9b)['then'](function(){logger[_0x209a('0xb')](_0x209a('0xc'),_0xf1ee92,_0x11cd9b[_0x209a('0x8')]);_0x5f4787();})['catch'](function(_0x315382){logger[_0x209a('0xd')](_0x209a('0xc'),_0xf1ee92,JSON[_0x209a('0xe')](_0x315382));_0x1ca6cb(_0x315382);});});}exports[_0x209a('0xf')]=function(_0x441981,_0x3854aa){return function(_0x4b3c90){try{if(!_['isNil'](this[_0x209a('0x10')]['UserId'])){logger[_0x209a('0xb')](_0x209a('0xc'),_0x441981,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4b3c90['next']();}var _0xd24b4f={'ContactId':this[_0x209a('0x11')]['id'],'sentAt':moment()[_0x209a('0x12')](_0x209a('0x13')),'direction':_0x209a('0x14')};if(this[_0x209a('0x15')]==='sms'||this['channel']===_0x209a('0x16')){_0xd24b4f[_0x209a('0x17')]=this['interaction'][_0x209a('0x17')];}var _0x201684=this['channel'];if(_0x201684==='chat'){_0xd24b4f[_0x209a('0x18')]=this['account']['id'];}else{_0xd24b4f[_[_0x209a('0x19')](_0x201684)+_0x209a('0x1a')]=this[_0x209a('0x1b')]['id'];}_0xd24b4f[_[_0x209a('0x19')](_0x201684)+_0x209a('0x1c')]=this[_0x209a('0x10')]['id'];if(this[_0x209a('0x10')]['created']){var _0x208b02=_0x3854aa[0x4];if(!_[_0x209a('0x1d')](_0x208b02)){_0xd24b4f[_0x209a('0x8')]=utils[_0x209a('0x1e')](_0x208b02,this);return rpc[_0x201684+'Message']['create'](_0xd24b4f)['then'](function(_0x5701f6){logger[_0x209a('0xb')](_0x209a('0xc'),_0x441981,_0xd24b4f[_0x209a('0x8')]);})[_0x209a('0x1f')](function(_0x53aa7a){logger[_0x209a('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x441981,JSON[_0x209a('0xe')](_0x53aa7a));})[_0x209a('0x20')](function(){logger[_0x209a('0xb')](_0x209a('0x21'),_0x441981);_0x4b3c90['stop']();});}else{logger['info'](_0x209a('0x22'),_0x441981);_0x4b3c90['stop']();}}else{var _0x339aa3=this;var _0x550663=_0x3854aa[0x2][_0x209a('0x23')](/\\n/g,'\x0a');var _0x29271d={'credentials':{'private_key':_0x550663,'client_email':_0x3854aa[0x1]}};var _0x15a841=new dialogflow[(_0x209a('0x24'))](_0x29271d);var _0x6f5fd=_0x15a841[_0x209a('0x25')](_0x3854aa[0x0],md5(_0x339aa3['interaction']['id']));var _0x2ff5f6={'session':_0x6f5fd,'queryInput':{'text':{'text':_0x339aa3[_0x209a('0x26')][_0x209a('0x8')],'languageCode':_0x3854aa[0x3]||'en'}}};return _0x15a841[_0x209a('0x27')](_0x2ff5f6)[_0x209a('0x28')](function(_0x80eb52){if(_0x80eb52&&_0x80eb52[_0x209a('0x29')]){_0x339aa3[_0x209a('0x8')]['dialogflowV2']=_0x80eb52;var _0x433e8b=_0x80eb52[0x0];var _0x4f14f5=_0x433e8b['queryResult'][_0x209a('0x2a')]&&_0x433e8b[_0x209a('0x2b')][_0x209a('0x2a')][_0x209a('0x2c')]?_0x433e8b['queryResult']['diagnosticInfo'][_0x209a('0x2c')][_0x209a('0x2d')][_0x209a('0x2e')]:![];_0x339aa3['body']['DIALOGFLOWV2_ACTION']=_0x433e8b[_0x209a('0x2b')][_0x209a('0x2f')];_0x339aa3[_0x209a('0x8')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x433e8b[_0x209a('0x2b')][_0x209a('0x30')];_0x339aa3[_0x209a('0x8')][_0x209a('0x31')]=_0x433e8b[_0x209a('0x2b')][_0x209a('0x2a')]&&_0x433e8b[_0x209a('0x2b')][_0x209a('0x2a')][_0x209a('0x2c')]?_0x433e8b[_0x209a('0x2b')]['diagnosticInfo'][_0x209a('0x2c')][_0x209a('0x2d')][_0x209a('0x2e')]:![];_0x339aa3[_0x209a('0x8')][_0x209a('0x32')]=_0x433e8b[_0x209a('0x2b')][_0x209a('0x33')][_0x209a('0x34')];_0x339aa3[_0x209a('0x8')][_0x209a('0x35')]=_0x433e8b[_0x209a('0x2b')][_0x209a('0x33')][_0x209a('0x36')];_0x339aa3[_0x209a('0x8')][_0x209a('0x37')]=_0x433e8b['queryResult'][_0x209a('0x33')]['isFallback'];_0x339aa3[_0x209a('0x8')][_0x209a('0x38')]=_0x433e8b['queryResult'][_0x209a('0x39')];_0x339aa3['body'][_0x209a('0x3a')]=_0x433e8b['queryResult']['queryText'];_0x339aa3[_0x209a('0x8')]['DIALOGFLOWV2_SCORE']=_0x433e8b[_0x209a('0x2b')][_0x209a('0x3b')];_0xd24b4f['providerName']=_0x209a('0x3c');_0xd24b4f[_0x209a('0x3d')]=JSON[_0x209a('0xe')](_0x80eb52);var _0x272db3=[];for(var _0x529f38=0x0;_0x529f38<_0x80eb52[_0x209a('0x29')];_0x529f38++){var _0xe8ae5d=_0x80eb52[_0x529f38];if(_0xe8ae5d&&_0xe8ae5d[_0x209a('0x2b')]&&_0xe8ae5d[_0x209a('0x2b')]['fulfillmentText']){_0x272db3['push'](createMessage(_0x441981,_0x201684,_0xd24b4f,_0xe8ae5d[_0x209a('0x2b')][_0x209a('0x3e')]));}}return Promise[_0x209a('0x3f')](_0x272db3)[_0x209a('0x28')](function(){if(_0x4f14f5){_0x4b3c90[_0x209a('0x40')]();}else{_0x4b3c90[_0x209a('0x41')]();}})[_0x209a('0x1f')](function(_0x3e69ad){logger[_0x209a('0xd')](_0x209a('0xc'),_0x441981,JSON[_0x209a('0xe')](_0x3e69ad));_0x4b3c90['next']();});}})[_0x209a('0x1f')](function(_0x487115){logger[_0x209a('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x441981,_0x487115[_0x209a('0x26')],_0x487115[_0x209a('0x42')]);_0x4b3c90['next']();});}}catch(_0x340501){logger[_0x209a('0xd')](_0x209a('0xc'),_0x441981,JSON[_0x209a('0xe')](_0x340501));_0x4b3c90[_0x209a('0x41')]();}};}; \ No newline at end of file +var _0x1bf0=['channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','catch','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','dialogflow','moment','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x3485da,_0x39aeb5){var _0x59c067=function(_0x1bd759){while(--_0x1bd759){_0x3485da['push'](_0x3485da['shift']());}};_0x59c067(++_0x39aeb5);}(_0x1bf0,0xeb));var _0x01bf=function(_0x23ce5a,_0x366455){_0x23ce5a=_0x23ce5a-0x0;var _0x268494=_0x1bf0[_0x23ce5a];return _0x268494;};'use strict';var _=require('lodash');var dialogflow=require(_0x01bf('0x0'));var md5=require('md5');var moment=require(_0x01bf('0x1'));var Promise=require('bluebird');var logger=require('../../../../config/logger')('routing');var utils=require(_0x01bf('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x01bf('0x3')),'mailMessage':require(_0x01bf('0x4')),'smsMessage':require(_0x01bf('0x5')),'faxMessage':require(_0x01bf('0x6')),'whatsappMessage':require(_0x01bf('0x7'))};function createMessage(_0x35da26,_0x1a353a,_0x2b3a20,_0x3d5fe9){return new Promise(function(_0x5d16c0,_0x4d7258){var _0x59b59f=_[_0x01bf('0x8')](_0x2b3a20);_0x59b59f[_0x01bf('0x9')]=_0x3d5fe9;return rpc[_0x1a353a+_0x01bf('0xa')][_0x01bf('0xb')](_0x59b59f)[_0x01bf('0xc')](function(){logger[_0x01bf('0xd')](_0x01bf('0xe'),_0x35da26,_0x59b59f['body']);_0x5d16c0();})['catch'](function(_0x2e69a3){logger[_0x01bf('0xf')](_0x01bf('0xe'),_0x35da26,JSON[_0x01bf('0x10')](_0x2e69a3));_0x4d7258(_0x2e69a3);});});}exports[_0x01bf('0x11')]=function(_0x264a7f,_0x3e1bb0){return function(_0x1d2ac8){try{if(!_[_0x01bf('0x12')](this['interaction'][_0x01bf('0x13')])){logger['info'](_0x01bf('0xe'),_0x264a7f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1d2ac8[_0x01bf('0x14')]();}var _0x4ab982={'ContactId':this[_0x01bf('0x15')]['id'],'sentAt':moment()[_0x01bf('0x16')](_0x01bf('0x17')),'direction':_0x01bf('0x18')};if(this[_0x01bf('0x19')]==='sms'||this[_0x01bf('0x19')]===_0x01bf('0x1a')){_0x4ab982[_0x01bf('0x1b')]=this[_0x01bf('0x1c')][_0x01bf('0x1b')];}var _0x45b39e=this[_0x01bf('0x19')];if(_0x45b39e===_0x01bf('0x1d')){_0x4ab982[_0x01bf('0x1e')]=this[_0x01bf('0x1f')]['id'];}else{_0x4ab982[_[_0x01bf('0x20')](_0x45b39e)+'AccountId']=this[_0x01bf('0x1f')]['id'];}_0x4ab982[_[_0x01bf('0x20')](_0x45b39e)+'InteractionId']=this['interaction']['id'];if(this[_0x01bf('0x1c')][_0x01bf('0x21')]){var _0x2fb506=_0x3e1bb0[0x4];if(!_[_0x01bf('0x22')](_0x2fb506)){_0x4ab982[_0x01bf('0x9')]=utils['getMustacheRender'](_0x2fb506,this);return rpc[_0x45b39e+_0x01bf('0xa')][_0x01bf('0xb')](_0x4ab982)[_0x01bf('0xc')](function(_0x503e56){logger['info'](_0x01bf('0xe'),_0x264a7f,_0x4ab982[_0x01bf('0x9')]);})[_0x01bf('0x23')](function(_0xef5253){logger['error'](_0x01bf('0xe'),_0x264a7f,JSON[_0x01bf('0x10')](_0xef5253));})['finally'](function(){logger[_0x01bf('0xd')](_0x01bf('0x24'),_0x264a7f);_0x1d2ac8[_0x01bf('0x25')]();});}else{logger['info'](_0x01bf('0x26'),_0x264a7f);_0x1d2ac8[_0x01bf('0x25')]();}}else{var _0x1f8b4b=this;var _0x46eae6=_0x3e1bb0[0x2]['replace'](/\\n/g,'\x0a');var _0x2debc1={'credentials':{'private_key':_0x46eae6,'client_email':_0x3e1bb0[0x1]}};var _0x344755=new dialogflow['SessionsClient'](_0x2debc1);var _0x4d1948=_0x344755[_0x01bf('0x27')](_0x3e1bb0[0x0],md5(_0x1f8b4b[_0x01bf('0x1c')]['id']));var _0x1ce19a={'session':_0x4d1948,'queryInput':{'text':{'text':_0x1f8b4b[_0x01bf('0x28')]['body'],'languageCode':_0x3e1bb0[0x3]||'en'}}};return _0x344755[_0x01bf('0x29')](_0x1ce19a)[_0x01bf('0xc')](function(_0x46a06f){if(_0x46a06f&&_0x46a06f[_0x01bf('0x2a')]){_0x1f8b4b[_0x01bf('0x9')][_0x01bf('0x2b')]=_0x46a06f;var _0x4d8fd1=_0x46a06f[0x0];var _0x410713=_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x2d')]&&_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x2d')][_0x01bf('0x2e')]?_0x4d8fd1[_0x01bf('0x2c')]['diagnosticInfo'][_0x01bf('0x2e')]['end_conversation'][_0x01bf('0x2f')]:![];_0x1f8b4b[_0x01bf('0x9')]['DIALOGFLOWV2_ACTION']=_0x4d8fd1['queryResult']['action'];_0x1f8b4b[_0x01bf('0x9')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x30')];_0x1f8b4b[_0x01bf('0x9')][_0x01bf('0x31')]=_0x4d8fd1['queryResult'][_0x01bf('0x2d')]&&_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x2d')][_0x01bf('0x2e')]?_0x4d8fd1['queryResult']['diagnosticInfo']['fields'][_0x01bf('0x32')][_0x01bf('0x2f')]:![];_0x1f8b4b[_0x01bf('0x9')][_0x01bf('0x33')]=_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x34')][_0x01bf('0x35')];_0x1f8b4b[_0x01bf('0x9')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x4d8fd1[_0x01bf('0x2c')]['intent'][_0x01bf('0x36')];_0x1f8b4b[_0x01bf('0x9')][_0x01bf('0x37')]=_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x34')][_0x01bf('0x38')];_0x1f8b4b[_0x01bf('0x9')][_0x01bf('0x39')]=_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x3a')];_0x1f8b4b['body']['DIALOGFLOWV2_QUERYTEXT']=_0x4d8fd1['queryResult']['queryText'];_0x1f8b4b[_0x01bf('0x9')]['DIALOGFLOWV2_SCORE']=_0x4d8fd1[_0x01bf('0x2c')][_0x01bf('0x3b')];_0x4ab982[_0x01bf('0x3c')]=_0x01bf('0x2b');_0x4ab982[_0x01bf('0x3d')]=JSON[_0x01bf('0x10')](_0x46a06f);var _0x577953=[];for(var _0x4efbb7=0x0;_0x4efbb7<_0x46a06f['length'];_0x4efbb7++){var _0x5677dd=_0x46a06f[_0x4efbb7];if(_0x5677dd&&_0x5677dd[_0x01bf('0x2c')]&&_0x5677dd[_0x01bf('0x2c')][_0x01bf('0x3e')]){_0x577953[_0x01bf('0x3f')](createMessage(_0x264a7f,_0x45b39e,_0x4ab982,_0x5677dd[_0x01bf('0x2c')]['fulfillmentText']));}}return Promise[_0x01bf('0x40')](_0x577953)['then'](function(){if(_0x410713){_0x1d2ac8['next']();}else{_0x1d2ac8[_0x01bf('0x25')]();}})[_0x01bf('0x23')](function(_0x5ac27c){logger[_0x01bf('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x264a7f,JSON[_0x01bf('0x10')](_0x5ac27c));_0x1d2ac8[_0x01bf('0x14')]();});}})[_0x01bf('0x23')](function(_0x1e4a33){logger[_0x01bf('0xf')](_0x01bf('0xe'),_0x264a7f,_0x1e4a33['message'],_0x1e4a33['stack']);_0x1d2ac8[_0x01bf('0x14')]();});}}catch(_0x331904){logger[_0x01bf('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x264a7f,JSON['stringify'](_0x331904));_0x1d2ac8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index a22076b..eddf0b6 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38bf=['stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x38bf,0x1dd));var _0xf38b=function(_0x31ad66,_0x1ef78d){_0x31ad66=_0x31ad66-0x0;var _0x2a65b3=_0x38bf[_0x31ad66];return _0x2a65b3;};'use strict';var schema=require(_0xf38b('0x0'));var _=require(_0xf38b('0x1'));var htmlToText=require(_0xf38b('0x2'));var utils=require(_0xf38b('0x3'));var logger=require(_0xf38b('0x4'))(_0xf38b('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xf38b('0x6')},'priorityTrue':{'type':_0xf38b('0x7'),'message':_0xf38b('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xf38b('0x9')]=function(_0x760547,_0x1ab563){return function(_0x157b7f){try{var _0x3931ad={'condition':htmlToText[_0xf38b('0xa')](utils['getMustacheRender'](_0x1ab563[0x0],this),{'wordwrap':![]})[_0xf38b('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ab563[0x1],'priorityFalse':_0x1ab563[0x2]};var _0x1227d6=gotoif['validate'](_0x3931ad,{'typecast':!![]});if(_0x1227d6['length']){logger[_0xf38b('0xc')](_0xf38b('0xd'),_0x760547,_['map'](_0x1227d6,_0xf38b('0xe'))[_0xf38b('0xf')](',\x20'));_0x157b7f['stop']();}else{try{var _0x2027cc=eval('('+_0x3931ad[_0xf38b('0x10')]+')');var _0x55573c=_0x2027cc?_0x3931ad[_0xf38b('0x11')]:_0x3931ad[_0xf38b('0x12')];logger[_0xf38b('0x13')](_0xf38b('0x14'),_0x760547,_0x3931ad[_0xf38b('0x10')],_0x2027cc,_0x55573c||_0xf38b('0x15'));if(_0x55573c){var _0xcf9d53=_[_0xf38b('0x16')](_0x157b7f[_0xf38b('0x17')](),{'p':_0x55573c});if(_0xcf9d53>=0x0){logger[_0xf38b('0x13')](_0xf38b('0x18'),_0x760547,_0x55573c||_0xf38b('0x15'),_0xcf9d53);_0x157b7f['next'](_0xcf9d53);}else{logger[_0xf38b('0x13')](_0xf38b('0x19'),_0x760547,_0x55573c||'next');_0x157b7f[_0xf38b('0x1a')]();}}else{_0x157b7f[_0xf38b('0x15')]();}}catch(_0x16de9f){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x760547,_0x16de9f['message']);_0x157b7f[_0xf38b('0x1a')]();}}}catch(_0x295b29){logger[_0xf38b('0xc')]('[%s][GOTOIF]\x20%s',_0x760547,JSON[_0xf38b('0x1b')](_0x295b29));_0x157b7f[_0xf38b('0x1a')]();}};}; \ No newline at end of file +var _0x654d=['priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x38f730,_0x2c7523){var _0x233bf4=function(_0x4e43ea){while(--_0x4e43ea){_0x38f730['push'](_0x38f730['shift']());}};_0x233bf4(++_0x2c7523);}(_0x654d,0x6d));var _0xd654=function(_0x4cfe8c,_0x5c1668){_0x4cfe8c=_0x4cfe8c-0x0;var _0x3fb6e9=_0x654d[_0x4cfe8c];return _0x3fb6e9;};'use strict';var schema=require(_0xd654('0x0'));var _=require(_0xd654('0x1'));var htmlToText=require(_0xd654('0x2'));var utils=require(_0xd654('0x3'));var logger=require('../../../../config/logger')(_0xd654('0x4'));var gotoif=schema({'condition':{'type':_0xd654('0x5'),'required':!![],'message':_0xd654('0x6')},'priorityTrue':{'type':'number','message':_0xd654('0x7')},'priorityFalse':{'type':_0xd654('0x8'),'message':_0xd654('0x9')}});exports[_0xd654('0xa')]=function(_0x1921d9,_0xc55cd7){return function(_0x501846){try{var _0x148a91={'condition':htmlToText[_0xd654('0xb')](utils[_0xd654('0xc')](_0xc55cd7[0x0],this),{'wordwrap':![]})[_0xd654('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xc55cd7[0x1],'priorityFalse':_0xc55cd7[0x2]};var _0x3eea69=gotoif['validate'](_0x148a91,{'typecast':!![]});if(_0x3eea69['length']){logger['error'](_0xd654('0xe'),_0x1921d9,_[_0xd654('0xf')](_0x3eea69,_0xd654('0x10'))[_0xd654('0x11')](',\x20'));_0x501846[_0xd654('0x12')]();}else{try{var _0x509df1=eval('('+_0x148a91['condition']+')');var _0x1aee85=_0x509df1?_0x148a91['priorityTrue']:_0x148a91[_0xd654('0x13')];logger[_0xd654('0x14')](_0xd654('0x15'),_0x1921d9,_0x148a91[_0xd654('0x16')],_0x509df1,_0x1aee85||_0xd654('0x17'));if(_0x1aee85){var _0xc51fe=_['findIndex'](_0x501846[_0xd654('0x18')](),{'p':_0x1aee85});if(_0xc51fe>=0x0){logger[_0xd654('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1921d9,_0x1aee85||_0xd654('0x17'),_0xc51fe);_0x501846[_0xd654('0x17')](_0xc51fe);}else{logger[_0xd654('0x14')](_0xd654('0x19'),_0x1921d9,_0x1aee85||_0xd654('0x17'));_0x501846[_0xd654('0x12')]();}}else{_0x501846['next']();}}catch(_0x548dcc){logger[_0xd654('0x1a')](_0xd654('0x1b'),_0x1921d9,_0x548dcc[_0xd654('0x10')]);_0x501846[_0xd654('0x12')]();}}}catch(_0x127ecd){logger[_0xd654('0x1a')](_0xd654('0xe'),_0x1921d9,JSON[_0xd654('0x1c')](_0x127ecd));_0x501846[_0xd654('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index da8b987..a57fe9d 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 _0xf371=['priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','validate','lodash','../../../../config/logger','number','consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop'];(function(_0x2b87d7,_0x2ed263){var _0x11feb1=function(_0x334baa){while(--_0x334baa){_0x2b87d7['push'](_0x2b87d7['shift']());}};_0x11feb1(++_0x2ed263);}(_0xf371,0x181));var _0x1f37=function(_0x1a4fcf,_0x24e716){_0x1a4fcf=_0x1a4fcf-0x0;var _0x6ea62f=_0xf371[_0x1a4fcf];return _0x6ea62f;};'use strict';var schema=require(_0x1f37('0x0'));var _=require(_0x1f37('0x1'));var logger=require(_0x1f37('0x2'))('routing');var gotop=schema({'priority':{'type':_0x1f37('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x1f37('0x4')]=function(_0xec122d,_0x2c5171){return function(_0x4814ae){try{var _0x2482f4={'priority':_0x2c5171[0x0]};var _0x3c5161=gotop[_0x1f37('0x0')](_0x2482f4,{'typecast':!![]});if(_0x3c5161[_0x1f37('0x5')]){logger['error'](_0x1f37('0x6'),_0xec122d,_[_0x1f37('0x7')](_0x3c5161,_0x1f37('0x8'))[_0x1f37('0x9')](',\x20'));_0x4814ae[_0x1f37('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0xec122d,_0x2482f4[_0x1f37('0xb')]);if(_0x2482f4[_0x1f37('0xb')]){var _0x311b54=_[_0x1f37('0xc')](_0x4814ae[_0x1f37('0xd')](),{'p':_0x2482f4[_0x1f37('0xb')]});if(_0x311b54>=0x0){logger[_0x1f37('0xe')](_0x1f37('0xf'),_0xec122d,_0x2482f4[_0x1f37('0xb')]||_0x1f37('0x10'),_0x311b54);_0x4814ae[_0x1f37('0x10')](_0x311b54);}else{logger[_0x1f37('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0xec122d,_0x2482f4[_0x1f37('0xb')]||'next');_0x4814ae[_0x1f37('0xa')]();}}else{_0x4814ae[_0x1f37('0x10')]();}}}catch(_0x1ec884){logger[_0x1f37('0x11')](_0x1f37('0x6'),_0xec122d,JSON['stringify'](_0x1ec884));_0x4814ae[_0x1f37('0xa')]();}};}; \ No newline at end of file +var _0x584a=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20%s','validate','../../../../config/logger','routing','number','consequence','length','error','map','message','join'];(function(_0x19c676,_0x3c2f8a){var _0x3c58b2=function(_0x43edf8){while(--_0x43edf8){_0x19c676['push'](_0x19c676['shift']());}};_0x3c58b2(++_0x3c2f8a);}(_0x584a,0x1a6));var _0xa584=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0x584a[_0x4828b1];return _0x1fec1b;};'use strict';var schema=require(_0xa584('0x0'));var _=require('lodash');var logger=require(_0xa584('0x1'))(_0xa584('0x2'));var gotop=schema({'priority':{'type':_0xa584('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xa584('0x4')]=function(_0x1fe912,_0x341cbc){return function(_0x2d1c00){try{var _0x18931d={'priority':_0x341cbc[0x0]};var _0x2ba85c=gotop[_0xa584('0x0')](_0x18931d,{'typecast':!![]});if(_0x2ba85c[_0xa584('0x5')]){logger[_0xa584('0x6')]('[%s][GOTOP]\x20%s',_0x1fe912,_[_0xa584('0x7')](_0x2ba85c,_0xa584('0x8'))[_0xa584('0x9')](',\x20'));_0x2d1c00[_0xa584('0xa')]();}else{logger[_0xa584('0xb')](_0xa584('0xc'),_0x1fe912,_0x18931d[_0xa584('0xd')]);if(_0x18931d['priority']){var _0x7056f3=_[_0xa584('0xe')](_0x2d1c00[_0xa584('0xf')](),{'p':_0x18931d[_0xa584('0xd')]});if(_0x7056f3>=0x0){logger[_0xa584('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1fe912,_0x18931d['priority']||'next',_0x7056f3);_0x2d1c00['next'](_0x7056f3);}else{logger[_0xa584('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1fe912,_0x18931d[_0xa584('0xd')]||_0xa584('0x10'));_0x2d1c00[_0xa584('0xa')]();}}else{_0x2d1c00[_0xa584('0x10')]();}}}catch(_0x5567bb){logger[_0xa584('0x6')](_0xa584('0x11'),_0x1fe912,JSON['stringify'](_0x5567bb));_0x2d1c00['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 3d7cadb..8377fe6 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 _0x1e7b=['error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','body','next','catch'];(function(_0x247794,_0x1a9571){var _0x42c966=function(_0x48b7c0){while(--_0x48b7c0){_0x247794['push'](_0x247794['shift']());}};_0x42c966(++_0x1a9571);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x4b3c7e,_0x58aef9){_0x4b3c7e=_0x4b3c7e-0x0;var _0x3015af=_0x1e7b[_0x4b3c7e];return _0x3015af;};'use strict';var _=require(_0xb1e7('0x0'));var utils=require(_0xb1e7('0x1'));var logger=require('../../../../config/logger')(_0xb1e7('0x2'));var rpc={'chatMessage':require(_0xb1e7('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb1e7('0x4')),'smsMessage':require(_0xb1e7('0x5')),'faxMessage':require(_0xb1e7('0x6')),'whatsappMessage':require(_0xb1e7('0x7'))};exports['consequence']=function(_0x1b473f,_0x2f733c){return function(_0x3bc43b){try{var _0x35c43c={'body':utils[_0xb1e7('0x8')](_0x2f733c[0x0],this),'ContactId':this['contact']['id']};if(this[_0xb1e7('0x9')]===_0xb1e7('0xa')){_0x35c43c[_0xb1e7('0xb')]=this[_0xb1e7('0xc')]['id'];}else{_0x35c43c[_[_0xb1e7('0xd')](this[_0xb1e7('0x9')])+_0xb1e7('0xe')]=this[_0xb1e7('0xc')]['id'];}_0x35c43c[_[_0xb1e7('0xd')](this[_0xb1e7('0x9')])+_0xb1e7('0xf')]=this[_0xb1e7('0x10')]['id'];if(rpc[this[_0xb1e7('0x9')]+_0xb1e7('0x11')]){return rpc[this[_0xb1e7('0x9')]+'Message']['create'](_0x35c43c)[_0xb1e7('0x12')](function(_0x1e943d){logger[_0xb1e7('0x13')]('[%s][MESSAGE]\x20%s',_0x1b473f,_0x35c43c[_0xb1e7('0x14')]);_0x3bc43b[_0xb1e7('0x15')]();})[_0xb1e7('0x16')](function(_0x4e1343){logger[_0xb1e7('0x17')](_0xb1e7('0x18'),_0x1b473f,JSON[_0xb1e7('0x19')](_0x4e1343));_0x3bc43b['stop']();});}}catch(_0x409fcd){logger[_0xb1e7('0x17')](_0xb1e7('0x18'),_0x1b473f,JSON[_0xb1e7('0x19')](_0x409fcd));_0x3bc43b[_0xb1e7('0x1a')]();}};}; \ No newline at end of file +var _0xe975=['ChatWebsiteId','upperFirst','channel','AccountId','account','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','catch','error','stringify','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat'];(function(_0x4e6dae,_0x589035){var _0x501a5b=function(_0x310538){while(--_0x310538){_0x4e6dae['push'](_0x4e6dae['shift']());}};_0x501a5b(++_0x589035);}(_0xe975,0x1da));var _0x5e97=function(_0x41fee1,_0xf7847d){_0x41fee1=_0x41fee1-0x0;var _0x5f1554=_0xe975[_0x41fee1];return _0x5f1554;};'use strict';var _=require('lodash');var utils=require(_0x5e97('0x0'));var logger=require(_0x5e97('0x1'))(_0x5e97('0x2'));var rpc={'chatMessage':require(_0x5e97('0x3')),'openchannelMessage':require(_0x5e97('0x4')),'mailMessage':require(_0x5e97('0x5')),'smsMessage':require(_0x5e97('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5e97('0x7'))};exports[_0x5e97('0x8')]=function(_0x1e3b45,_0x1014a2){return function(_0x55c508){try{var _0x1f40a7={'body':utils[_0x5e97('0x9')](_0x1014a2[0x0],this),'ContactId':this[_0x5e97('0xa')]['id']};if(this['channel']===_0x5e97('0xb')){_0x1f40a7[_0x5e97('0xc')]=this['account']['id'];}else{_0x1f40a7[_[_0x5e97('0xd')](this[_0x5e97('0xe')])+_0x5e97('0xf')]=this[_0x5e97('0x10')]['id'];}_0x1f40a7[_['upperFirst'](this[_0x5e97('0xe')])+_0x5e97('0x11')]=this[_0x5e97('0x12')]['id'];if(rpc[this['channel']+_0x5e97('0x13')]){return rpc[this[_0x5e97('0xe')]+'Message'][_0x5e97('0x14')](_0x1f40a7)[_0x5e97('0x15')](function(_0x144581){logger['info'](_0x5e97('0x16'),_0x1e3b45,_0x1f40a7['body']);_0x55c508[_0x5e97('0x17')]();})[_0x5e97('0x18')](function(_0x3f6b8d){logger[_0x5e97('0x19')]('[%s][MESSAGE]\x20%s',_0x1e3b45,JSON[_0x5e97('0x1a')](_0x3f6b8d));_0x55c508['stop']();});}}catch(_0x33d32e){logger[_0x5e97('0x19')](_0x5e97('0x16'),_0x1e3b45,JSON[_0x5e97('0x1a')](_0x33d32e));_0x55c508['stop']();}};}; \ 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 391169c..d9b8a65 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 _0x90c3=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','consequence'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90c3,0x192));var _0x390c=function(_0x3ee09a,_0x56df93){_0x3ee09a=_0x3ee09a-0x0;var _0x21fad6=_0x90c3[_0x3ee09a];return _0x21fad6;};'use strict';var utils=require(_0x390c('0x0'));var logger=require(_0x390c('0x1'))('routing');exports[_0x390c('0x2')]=function(_0x16cc80,_0x253c2c){return function(_0x22a56c){try{logger[_0x390c('0x3')](_0x390c('0x4'),_0x16cc80,utils['getMustacheRender'](_0x253c2c[0x0],this));_0x22a56c[_0x390c('0x5')]();}catch(_0x125060){logger[_0x390c('0x6')]('[%s][NOOP]\x20%s',_0x16cc80,JSON[_0x390c('0x7')](_0x125060));_0x22a56c[_0x390c('0x8')]();}};}; \ No newline at end of file +var _0xc7e0=['info','[%s][NOOP]\x20%s','next','stringify','stop','consequence'];(function(_0x4b2c01,_0xae220a){var _0x341374=function(_0x53b525){while(--_0x53b525){_0x4b2c01['push'](_0x4b2c01['shift']());}};_0x341374(++_0xae220a);}(_0xc7e0,0x155));var _0x0c7e=function(_0xc274eb,_0x361358){_0xc274eb=_0xc274eb-0x0;var _0x202f30=_0xc7e0[_0xc274eb];return _0x202f30;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')('routing');exports[_0x0c7e('0x0')]=function(_0x5a38d6,_0x23576b){return function(_0x539977){try{logger[_0x0c7e('0x1')](_0x0c7e('0x2'),_0x5a38d6,utils['getMustacheRender'](_0x23576b[0x0],this));_0x539977[_0x0c7e('0x3')]();}catch(_0x46cf81){logger['error'](_0x0c7e('0x2'),_0x5a38d6,JSON[_0x0c7e('0x4')](_0x46cf81));_0x539977[_0x0c7e('0x5')]();}};}; \ 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 e9c2afa..628719d 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 _0xf99d=['Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','seq-queue','moment','../../../../config/environment','routing','./strategy','redis','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','interaction','message','upperFirst','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','find'];(function(_0x118748,_0x4c1552){var _0x10b5ec=function(_0x14a40e){while(--_0x14a40e){_0x118748['push'](_0x118748['shift']());}};_0x10b5ec(++_0x4c1552);}(_0xf99d,0x186));var _0xdf99=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xf99d[_0x273c39];return _0x46d6b5;};'use strict';var schema=require(_0xdf99('0x0'));var _=require(_0xdf99('0x1'));var util=require('util');var seqqueue=require(_0xdf99('0x2'));var moment=require(_0xdf99('0x3'));var Redis=require('ioredis');var config=require(_0xdf99('0x4'));var logger=require('../../../../config/logger')(_0xdf99('0x5'));var strategy=require(_0xdf99('0x6'));config['redis']=_['defaults'](config[_0xdf99('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xdf99('0x8'))(new Redis(config[_0xdf99('0x7')]));var attributes=['id',_0xdf99('0x9'),_0xdf99('0xa'),_0xdf99('0xb'),'from',_0xdf99('0xc')];function emit(_0x4fc10d,_0x195d86,_0x336cce){io['to'](_0x4fc10d)[_0xdf99('0xd')](_0x195d86,_0x336cce);}function emitChannelQueueInteraction(_0x480f78,_0x143b6f,_0x3054aa,_0x2decc9,_0x2fa523,_0x5dd850,_0x4b0bdc,_0x5e50d5){var _0x3d8b8f=_[_0xdf99('0xe')](_0x3054aa);_0x3d8b8f['queue_id']=_0x5e50d5;_0x3d8b8f[_0xdf99('0xb')]=_0x143b6f;_0x3d8b8f['account']=_0x2decc9;_0x3d8b8f['id']=_0x2fa523;if(_0x5dd850){attributes['push'](_['capitalize'](_0x480f78)+_0xdf99('0xf'));_0x4b0bdc[util['format'](_0xdf99('0x10'),_0x480f78)][_0x2fa523]=_[_0xdf99('0x11')](_0x3d8b8f,attributes);}else{delete _0x4b0bdc[util[_0xdf99('0x12')](_0xdf99('0x10'),_0x480f78)][_0x2fa523];}emit(util[_0xdf99('0x12')](_0xdf99('0x13'),_0x480f78,_0x143b6f),util[_0xdf99('0x12')]('%s_queue_waiting_interaction:%s',_0x480f78,_0x5dd850?'save':'remove'),_[_0xdf99('0x11')](_0x3d8b8f,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xdf99('0x14')),'chatQueueReport':require(_0xdf99('0x15')),'smsQueueReport':require(_0xdf99('0x16')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xdf99('0x17')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xdf99('0x18')),'mailInteraction':require(_0xdf99('0x19')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xdf99('0x1a')),'whatsappInteraction':require(_0xdf99('0x1b'))};var queue=schema({'name':{'type':_0xdf99('0x1c'),'required':!![],'message':_0xdf99('0x1d')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x407b5e,_0x24d7c3,_0x3659c5,_0x60d025){if(_0x407b5e&&_0x24d7c3&&_0x3659c5){_0x24d7c3[_0xdf99('0x1e')]+=0x1;var _0x28b4df={'uniqueid':_0x407b5e,'from':_0x3659c5[_0xdf99('0x1f')]?_0x3659c5[_0xdf99('0x1f')][_0xdf99('0x20')]:'','joinAt':moment()[_0xdf99('0x12')](_0xdf99('0x21')),'ContactId':_0x3659c5[_0xdf99('0x22')]?_0x3659c5['contact']['id']:null,'ListId':_0x3659c5[_0xdf99('0x23')]?_0x3659c5[_0xdf99('0x23')]['id']:null};_0x28b4df[_['upperFirst'](_0x3659c5[_0xdf99('0x24')])+_0xdf99('0x25')]=_0x24d7c3['id']||null;_0x28b4df[_['upperFirst'](_0x3659c5[_0xdf99('0x24')])+_0xdf99('0xf')]=_0x3659c5[_0xdf99('0x26')]?_0x3659c5[_0xdf99('0x26')]['id']:null;_0x28b4df[_['upperFirst'](_0x3659c5['channel'])+'MessageId']=_0x3659c5[_0xdf99('0x27')]?_0x3659c5[_0xdf99('0x27')]['id']:null;_0x28b4df[_[_0xdf99('0x28')](_0x3659c5[_0xdf99('0x24')])+(_0x3659c5[_0xdf99('0x24')]!=='chat'?_0xdf99('0x29'):_0xdf99('0x2a'))]=_0x3659c5[_0xdf99('0xa')]?_0x3659c5['account']['id']:null;logger[_0xdf99('0x2b')](util['format'](_0xdf99('0x2c'),_0x407b5e,_0x24d7c3[_0xdf99('0x2d')]));emitChannelQueueInteraction(_0x3659c5[_0xdf99('0x24')],_0x24d7c3[_0xdf99('0x2d')],_0x28b4df,_0x3659c5['account'][_0xdf99('0x2d')],_0x3659c5['message']['id'],!![],_0x60d025,_0x24d7c3['id']);if(rpc[_0x3659c5[_0xdf99('0x24')]+_0xdf99('0x2e')]){return rpc[_0x3659c5['channel']+_0xdf99('0x2e')][_0xdf99('0x2f')](_0x28b4df)[_0xdf99('0x30')](function(_0x52a3bb){logger[_0xdf99('0x31')](_0xdf99('0x32'),_0x52a3bb);});}}}function stopRouting(_0x10cf75,_0x31fc0b,_0x380152,_0x9320d8){if(_0x10cf75&&_0x31fc0b){_0x31fc0b[_0xdf99('0x1e')]-=0x1;var _0xedd7ff={'leaveAt':moment()[_0xdf99('0x12')](_0xdf99('0x21')),'acceptAt':moment()[_0xdf99('0x12')](_0xdf99('0x21')),'reason':_0xdf99('0x33')};logger[_0xdf99('0x2b')](util[_0xdf99('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x10cf75,_0x31fc0b['name']));emitChannelQueueInteraction(_0x380152['channel'],_0x31fc0b[_0xdf99('0x2d')],_0x380152[_0xdf99('0x1f')],_0x380152[_0xdf99('0xa')][_0xdf99('0x2d')],_0x380152['message']['id'],![],_0x9320d8,_0x31fc0b['id']);return rpc[_0x380152[_0xdf99('0x24')]+'Interaction'][_0xdf99('0x34')](_0x380152[_0xdf99('0x26')]['id'],{'queueId':_0x31fc0b['id']})['then'](function(){if(rpc[_0x380152[_0xdf99('0x24')]+_0xdf99('0x2e')]){return rpc[_0x380152[_0xdf99('0x24')]+_0xdf99('0x2e')][_0xdf99('0x34')](_0x10cf75,_0xedd7ff)['catch'](function(_0xb847a5){logger[_0xdf99('0x31')](_0xdf99('0x35'),_0xb847a5);});}});}}function endRouting(_0x12f02d,_0x1da479,_0x4dccc4,_0x53e4db){if(_0x12f02d&&_0x1da479){_0x1da479[_0xdf99('0x1e')]-=0x1;var _0x48a752={'leaveAt':moment()['format'](_0xdf99('0x21')),'exitAt':moment()[_0xdf99('0x12')](_0xdf99('0x21')),'reason':'timeout'};logger[_0xdf99('0x2b')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x12f02d,_0x1da479[_0xdf99('0x2d')]));emitChannelQueueInteraction(_0x4dccc4['channel'],_0x1da479[_0xdf99('0x2d')],_0x4dccc4[_0xdf99('0x1f')],_0x4dccc4[_0xdf99('0xa')][_0xdf99('0x2d')],_0x4dccc4[_0xdf99('0x27')]['id'],![],_0x53e4db);if(rpc[_0x4dccc4['channel']+_0xdf99('0x2e')]){return rpc[_0x4dccc4['channel']+_0xdf99('0x2e')][_0xdf99('0x34')](_0x12f02d,_0x48a752)['catch'](function(_0x1f83bf){logger['error'](_0xdf99('0x35'),_0x1f83bf);});}}}function handleFindQueue(_0x18b762){return function(_0x4bf9ad){return _0x4bf9ad['name'][_0xdf99('0x36')]()===_0x18b762[_0xdf99('0x36')]();};}exports[_0xdf99('0x37')]=function(_0x472c2d,_0x592f6c,_0x2708be,_0x289dd0){return function(_0xe8a07d){try{var _0x525f9c={'name':_0x592f6c[0x0],'timeout':_0x592f6c[0x1]};var _0xb39231=queue['validate'](_0x525f9c,{'typecast':!![]});if(_0xb39231['length']){logger[_0xdf99('0x31')](_0xdf99('0x38'),_0x472c2d,_[_0xdf99('0x39')](_0xb39231,_0xdf99('0x27'))[_0xdf99('0x3a')](',\x20'));_0xe8a07d['stop']();}else{var _0x3ae8ce=_[_0xdf99('0x3b')](_0x2708be[_0x289dd0[_0xdf99('0x24')]+_0xdf99('0x3c')],handleFindQueue(_0x525f9c[_0xdf99('0x2d')]));if(_0x3ae8ce){startRouting(_0x472c2d,_0x3ae8ce,_0x289dd0,_0x2708be);var _0x46c8eb=(_0x3ae8ce[_0xdf99('0x3d')]||0xa)*0x3e8;var _0x29f43f=(_0x525f9c['timeout']||0x14)*0x3e8;var _0x51145a;if(_0x46c8eb>_0x29f43f){_0x29f43f=_0x46c8eb;}var _0x3651fb=seqqueue[_0xdf99('0x3e')](_0x46c8eb);_0x3651fb['id']=_0x472c2d;_0x3651fb[_0xdf99('0x3f')]=_0x46c8eb;_0x3651fb[_0xdf99('0x40')]=_0x29f43f;_0x3651fb['channel']=_0x289dd0[_0xdf99('0x24')];_0x2708be[_0xdf99('0x41')][_0x472c2d]['on'](_0xdf99('0x42'),function(){logger['info'](_0xdf99('0x43'),_0x472c2d);stopRouting(_0x472c2d,_0x3ae8ce,_0x289dd0,_0x2708be);clearTimeout(_0x51145a);_0x51145a=undefined;_0x3651fb[_0xdf99('0x44')](!![]);if(_0x2708be[_0xdf99('0x41')][_0x472c2d]){delete _0x2708be[_0xdf99('0x41')][_0x472c2d];}_0xe8a07d[_0xdf99('0x45')]();});_0x2708be[_0xdf99('0x41')][_0x472c2d]['on'](_0xdf99('0x46'),function(){if(_0x2708be[_0xdf99('0x41')][_0x472c2d]){delete _0x2708be[_0xdf99('0x41')][_0x472c2d];}});_0x51145a=setTimeout(function(){logger['info'](_0xdf99('0x47'),_0x472c2d);endRouting(_0x472c2d,_0x3ae8ce,_0x289dd0,_0x2708be);clearTimeout(_0x51145a);_0x3651fb['close'](!![]);_0xe8a07d['next']();},_0x29f43f);switch(_0x3ae8ce['strategy']){case _0xdf99('0x48'):strategy[_0xdf99('0x48')](_0x3651fb,_0x3ae8ce,_0x2708be,_0x289dd0);break;default:strategy[_0xdf99('0x49')](_0x3651fb,_0x3ae8ce,_0x2708be,_0x289dd0);}}else{logger[_0xdf99('0x31')](_0xdf99('0x4a'),_0x472c2d,_0x525f9c[_0xdf99('0x2d')]);_0xe8a07d['stop']();}}}catch(_0x457ada){logger[_0xdf99('0x31')](_0xdf99('0x38'),_0x472c2d,_0x457ada['stack']);_0xe8a07d[_0xdf99('0x45')]();}};}; \ No newline at end of file +var _0xb033=['%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','Interaction','then','update','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','strategy','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','capitalize'];(function(_0x202e3c,_0x541c11){var _0x357b4f=function(_0xa0a141){while(--_0xa0a141){_0x202e3c['push'](_0x202e3c['shift']());}};_0x357b4f(++_0x541c11);}(_0xb033,0x130));var _0x3b03=function(_0x3b00a7,_0x7e2c4d){_0x3b00a7=_0x3b00a7-0x0;var _0x482a52=_0xb033[_0x3b00a7];return _0x482a52;};'use strict';var schema=require(_0x3b03('0x0'));var _=require(_0x3b03('0x1'));var util=require(_0x3b03('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x3b03('0x3'));var Redis=require(_0x3b03('0x4'));var config=require(_0x3b03('0x5'));var logger=require(_0x3b03('0x6'))(_0x3b03('0x7'));var strategy=require('./strategy');config['redis']=_[_0x3b03('0x8')](config[_0x3b03('0x9')],{'host':_0x3b03('0xa'),'port':0x18eb});var io=require(_0x3b03('0xb'))(new Redis(config[_0x3b03('0x9')]));var attributes=['id',_0x3b03('0xc'),'account',_0x3b03('0xd'),_0x3b03('0xe'),_0x3b03('0xf')];function emit(_0x1e67c7,_0x2abc1c,_0x31716d){io['to'](_0x1e67c7)[_0x3b03('0x10')](_0x2abc1c,_0x31716d);}function emitChannelQueueInteraction(_0xddcd97,_0x1c6876,_0x4d11a4,_0x41b580,_0x727a6e,_0x54768c,_0x428dd9,_0x31c5cc){var _0x483cae=_[_0x3b03('0x11')](_0x4d11a4);_0x483cae[_0x3b03('0xc')]=_0x31c5cc;_0x483cae['queue']=_0x1c6876;_0x483cae[_0x3b03('0x12')]=_0x41b580;_0x483cae['id']=_0x727a6e;if(_0x54768c){attributes['push'](_[_0x3b03('0x13')](_0xddcd97)+'InteractionId');_0x428dd9[util['format'](_0x3b03('0x14'),_0xddcd97)][_0x727a6e]=_[_0x3b03('0x15')](_0x483cae,attributes);}else{delete _0x428dd9[util[_0x3b03('0x16')](_0x3b03('0x14'),_0xddcd97)][_0x727a6e];}emit(util[_0x3b03('0x16')]('%s:queue:%s',_0xddcd97,_0x1c6876),util[_0x3b03('0x16')](_0x3b03('0x17'),_0xddcd97,_0x54768c?_0x3b03('0x18'):'remove'),_[_0x3b03('0x15')](_0x483cae,attributes));}var rpc={'openchannelQueueReport':require(_0x3b03('0x19')),'mailQueueReport':require(_0x3b03('0x1a')),'chatQueueReport':require(_0x3b03('0x1b')),'smsQueueReport':require(_0x3b03('0x1c')),'faxQueueReport':require(_0x3b03('0x1d')),'whatsappQueueReport':require(_0x3b03('0x1e')),'chatInteraction':require(_0x3b03('0x1f')),'faxInteraction':require(_0x3b03('0x20')),'mailInteraction':require(_0x3b03('0x21')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x3b03('0x22')),'whatsappInteraction':require(_0x3b03('0x23'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x3b03('0x24')},'timeout':{'type':_0x3b03('0x25'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x37f0de,_0x479ae6,_0x3b4c74,_0x3076d5){if(_0x37f0de&&_0x479ae6&&_0x3b4c74){_0x479ae6[_0x3b03('0x26')]+=0x1;var _0x563c3e={'uniqueid':_0x37f0de,'from':_0x3b4c74[_0x3b03('0x27')]?_0x3b4c74[_0x3b03('0x27')][_0x3b03('0xe')]:'','joinAt':moment()[_0x3b03('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3b4c74[_0x3b03('0x28')]?_0x3b4c74[_0x3b03('0x28')]['id']:null,'ListId':_0x3b4c74[_0x3b03('0x29')]?_0x3b4c74[_0x3b03('0x29')]['id']:null};_0x563c3e[_[_0x3b03('0x2a')](_0x3b4c74['channel'])+_0x3b03('0x2b')]=_0x479ae6['id']||null;_0x563c3e[_[_0x3b03('0x2a')](_0x3b4c74[_0x3b03('0x2c')])+_0x3b03('0x2d')]=_0x3b4c74[_0x3b03('0x2e')]?_0x3b4c74[_0x3b03('0x2e')]['id']:null;_0x563c3e[_[_0x3b03('0x2a')](_0x3b4c74[_0x3b03('0x2c')])+_0x3b03('0x2f')]=_0x3b4c74[_0x3b03('0x30')]?_0x3b4c74[_0x3b03('0x30')]['id']:null;_0x563c3e[_[_0x3b03('0x2a')](_0x3b4c74[_0x3b03('0x2c')])+(_0x3b4c74[_0x3b03('0x2c')]!==_0x3b03('0x31')?'AccountId':_0x3b03('0x32'))]=_0x3b4c74['account']?_0x3b4c74['account']['id']:null;logger[_0x3b03('0x33')](util[_0x3b03('0x16')](_0x3b03('0x34'),_0x37f0de,_0x479ae6[_0x3b03('0x35')]));emitChannelQueueInteraction(_0x3b4c74[_0x3b03('0x2c')],_0x479ae6[_0x3b03('0x35')],_0x563c3e,_0x3b4c74['account'][_0x3b03('0x35')],_0x3b4c74[_0x3b03('0x30')]['id'],!![],_0x3076d5,_0x479ae6['id']);if(rpc[_0x3b4c74['channel']+'QueueReport']){return rpc[_0x3b4c74[_0x3b03('0x2c')]+_0x3b03('0x36')][_0x3b03('0x37')](_0x563c3e)[_0x3b03('0x38')](function(_0x36e5be){logger[_0x3b03('0x39')](_0x3b03('0x3a'),_0x36e5be);});}}}function stopRouting(_0x5cfcc5,_0x308213,_0x20e24e,_0x29a5d7){if(_0x5cfcc5&&_0x308213){_0x308213[_0x3b03('0x26')]-=0x1;var _0x3eeedd={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x3b03('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x3b03('0x33')](util[_0x3b03('0x16')]('[%s][STOP:QUEUE][NAME:%s]',_0x5cfcc5,_0x308213[_0x3b03('0x35')]));emitChannelQueueInteraction(_0x20e24e['channel'],_0x308213[_0x3b03('0x35')],_0x20e24e[_0x3b03('0x27')],_0x20e24e['account'][_0x3b03('0x35')],_0x20e24e[_0x3b03('0x30')]['id'],![],_0x29a5d7,_0x308213['id']);return rpc[_0x20e24e[_0x3b03('0x2c')]+_0x3b03('0x3b')]['update'](_0x20e24e['interaction']['id'],{'queueId':_0x308213['id']})[_0x3b03('0x3c')](function(){if(rpc[_0x20e24e[_0x3b03('0x2c')]+_0x3b03('0x36')]){return rpc[_0x20e24e[_0x3b03('0x2c')]+_0x3b03('0x36')][_0x3b03('0x3d')](_0x5cfcc5,_0x3eeedd)[_0x3b03('0x38')](function(_0x108f45){logger[_0x3b03('0x39')]('update\x20queue\x20report',_0x108f45);});}});}}function endRouting(_0x46030e,_0x4f51aa,_0x34b00a,_0x473fd4){if(_0x46030e&&_0x4f51aa){_0x4f51aa[_0x3b03('0x26')]-=0x1;var _0x2a0e2b={'leaveAt':moment()[_0x3b03('0x16')](_0x3b03('0x3e')),'exitAt':moment()[_0x3b03('0x16')](_0x3b03('0x3e')),'reason':_0x3b03('0x3f')};logger['info'](util[_0x3b03('0x16')](_0x3b03('0x40'),_0x46030e,_0x4f51aa['name']));emitChannelQueueInteraction(_0x34b00a[_0x3b03('0x2c')],_0x4f51aa[_0x3b03('0x35')],_0x34b00a[_0x3b03('0x27')],_0x34b00a[_0x3b03('0x12')][_0x3b03('0x35')],_0x34b00a[_0x3b03('0x30')]['id'],![],_0x473fd4);if(rpc[_0x34b00a[_0x3b03('0x2c')]+_0x3b03('0x36')]){return rpc[_0x34b00a['channel']+_0x3b03('0x36')][_0x3b03('0x3d')](_0x46030e,_0x2a0e2b)[_0x3b03('0x38')](function(_0x582fb8){logger[_0x3b03('0x39')]('update\x20queue\x20report',_0x582fb8);});}}}function handleFindQueue(_0x4e9153){return function(_0x12bd89){return _0x12bd89[_0x3b03('0x35')][_0x3b03('0x41')]()===_0x4e9153[_0x3b03('0x41')]();};}exports[_0x3b03('0x42')]=function(_0x503bf4,_0x4e757f,_0x2fa06a,_0x3cd42d){return function(_0x344fd0){try{var _0x3aa571={'name':_0x4e757f[0x0],'timeout':_0x4e757f[0x1]};var _0x53de09=queue[_0x3b03('0x0')](_0x3aa571,{'typecast':!![]});if(_0x53de09[_0x3b03('0x43')]){logger[_0x3b03('0x39')](_0x3b03('0x44'),_0x503bf4,_[_0x3b03('0x45')](_0x53de09,'message')['join'](',\x20'));_0x344fd0[_0x3b03('0x46')]();}else{var _0x41128c=_[_0x3b03('0x47')](_0x2fa06a[_0x3cd42d[_0x3b03('0x2c')]+_0x3b03('0x48')],handleFindQueue(_0x3aa571['name']));if(_0x41128c){startRouting(_0x503bf4,_0x41128c,_0x3cd42d,_0x2fa06a);var _0xbb4483=(_0x41128c[_0x3b03('0x3f')]||0xa)*0x3e8;var _0x124716=(_0x3aa571[_0x3b03('0x3f')]||0x14)*0x3e8;var _0x5d67a8;if(_0xbb4483>_0x124716){_0x124716=_0xbb4483;}var _0x2e60f9=seqqueue['createQueue'](_0xbb4483);_0x2e60f9['id']=_0x503bf4;_0x2e60f9[_0x3b03('0x49')]=_0xbb4483;_0x2e60f9[_0x3b03('0x4a')]=_0x124716;_0x2e60f9[_0x3b03('0x2c')]=_0x3cd42d[_0x3b03('0x2c')];_0x2fa06a[_0x3b03('0x4b')][_0x503bf4]['on']('end',function(){logger['info'](_0x3b03('0x4c'),_0x503bf4);stopRouting(_0x503bf4,_0x41128c,_0x3cd42d,_0x2fa06a);clearTimeout(_0x5d67a8);_0x5d67a8=undefined;_0x2e60f9[_0x3b03('0x4d')](!![]);if(_0x2fa06a[_0x3b03('0x4b')][_0x503bf4]){delete _0x2fa06a[_0x3b03('0x4b')][_0x503bf4];}_0x344fd0[_0x3b03('0x46')]();});_0x2fa06a['rules'][_0x503bf4]['on'](_0x3b03('0x4e'),function(){if(_0x2fa06a[_0x3b03('0x4b')][_0x503bf4]){delete _0x2fa06a[_0x3b03('0x4b')][_0x503bf4];}});_0x5d67a8=setTimeout(function(){logger[_0x3b03('0x33')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x503bf4);endRouting(_0x503bf4,_0x41128c,_0x3cd42d,_0x2fa06a);clearTimeout(_0x5d67a8);_0x2e60f9['close'](!![]);_0x344fd0['next']();},_0x124716);switch(_0x41128c[_0x3b03('0x4f')]){case'rrmemory':strategy['rrmemory'](_0x2e60f9,_0x41128c,_0x2fa06a,_0x3cd42d);break;default:strategy['beepall'](_0x2e60f9,_0x41128c,_0x2fa06a,_0x3cd42d);}}else{logger[_0x3b03('0x39')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x503bf4,_0x3aa571[_0x3b03('0x35')]);_0x344fd0[_0x3b03('0x46')]();}}}catch(_0x504e0f){logger[_0x3b03('0x39')](_0x3b03('0x44'),_0x503bf4,_0x504e0f[_0x3b03('0x50')]);_0x344fd0[_0x3b03('0x46')]();}};}; \ 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 5fa8f77..6c988ed 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 _0x5636=['routing','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','channel','saveWaitingNotification','showNotification','RINGING','forcedOwnership','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','removeWaitingNotification','writeLog','STOP','exports','lodash','uuid','notificationId','squeue','agent','realtime'];(function(_0xbf4e0,_0x2a78d9){var _0x5b1a4d=function(_0x11649a){while(--_0x11649a){_0xbf4e0['push'](_0xbf4e0['shift']());}};_0x5b1a4d(++_0x2a78d9);}(_0x5636,0x102));var _0x6563=function(_0x26ac6d,_0x4d0026){_0x26ac6d=_0x26ac6d-0x0;var _0x12fc06=_0x5636[_0x26ac6d];return _0x12fc06;};'use strict';var _=require(_0x6563('0x0'));var uuid=require(_0x6563('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x44872c,_0x3a95f7,_0x115cc1,_0x4ac653){this[_0x6563('0x2')]=uuid['v4']();this[_0x6563('0x3')]=_0x44872c;this[_0x6563('0x4')]=_0x3a95f7;this[_0x6563('0x5')]=_0x115cc1;this[_0x6563('0x6')]=_0x4ac653;this[_0x6563('0x3')][_0x6563('0x7')](this[_0x6563('0x8')][_0x6563('0x9')](this),this[_0x6563('0xa')][_0x6563('0x9')](this));this[_0x6563('0x3')]['on'](_0x6563('0xb'),this['handleTimeout']['bind'](this));this[_0x6563('0x3')]['on'](_0x6563('0xc'),this['handleDrained']['bind'](this));};Agent['prototype'][_0x6563('0x7')]=function(){this[_0x6563('0x3')][_0x6563('0x7')](this[_0x6563('0x8')][_0x6563('0x9')](this),this[_0x6563('0xa')][_0x6563('0x9')](this));};Agent[_0x6563('0xd')][_0x6563('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0x6563('0xd')]['handleRun']=function(){logger[_0x6563('0xf')](_0x6563('0x10'),this[_0x6563('0x3')]['id'],this[_0x6563('0x4')]['id']);if(_['isNil'](this[_0x6563('0x5')][_0x6563('0x11')][this[_0x6563('0x4')]['id']])){logger[_0x6563('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x6563('0x3')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x6563('0x6')]['forcedOwnership']||util['isAgentAvailable'](this[_0x6563('0x3')]['id'],this[_0x6563('0x5')][_0x6563('0x11')][this[_0x6563('0x4')]['id']],this[_0x6563('0x3')][_0x6563('0x12')],![])){this[_0x6563('0x5')][_0x6563('0x11')][this[_0x6563('0x4')]['id']]['busy']=!![];this[_0x6563('0x5')][_0x6563('0x11')][this[_0x6563('0x4')]['id']]['busyQueue']=undefined;util[_0x6563('0x13')](this['realtime'],this[_0x6563('0x6')],this[_0x6563('0x4')],this['squeue']['channel']);util[_0x6563('0x14')](this['notificationId'],this[_0x6563('0x3')]['id'],this[_0x6563('0x5')][_0x6563('0x11')][this['agent']['id']],null,this[_0x6563('0x6')]);util['writeLog'](this[_0x6563('0x3')]['id'],this[_0x6563('0x5')]['agents'][this[_0x6563('0x4')]['id']],_0x6563('0x15')+(this['routing'][_0x6563('0x16')]?':FORCED':''));}else{logger[_0x6563('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x6563('0x4')]['id']);setTimeout(this[_0x6563('0x7')][_0x6563('0x9')](this),0x3e8);}}};Agent[_0x6563('0xd')][_0x6563('0xa')]=function(_0x4b4d3b){if(_[_0x6563('0x17')](this['realtime']['agents'][this[_0x6563('0x4')]['id']])){return logger[_0x6563('0xf')](_0x6563('0x18'),this[_0x6563('0x3')]['id'],this[_0x6563('0x4')]['id']);}else{logger[_0x6563('0xf')](_0x6563('0x19'),this[_0x6563('0x3')]['id'],this[_0x6563('0x4')]['id']);util[_0x6563('0x1a')](this['notificationId'],this[_0x6563('0x3')]['id'],this[_0x6563('0x5')][_0x6563('0x11')][this[_0x6563('0x4')]['id']],null,this[_0x6563('0x6')]);this[_0x6563('0x5')][_0x6563('0x11')][this['agent']['id']][_0x6563('0x1b')]=![];this[_0x6563('0x5')][_0x6563('0x11')][this[_0x6563('0x4')]['id']][_0x6563('0x1c')]=undefined;util[_0x6563('0x1d')](this['realtime'],this[_0x6563('0x6')],this[_0x6563('0x4')],this[_0x6563('0x3')][_0x6563('0x12')]);util[_0x6563('0x1e')](this[_0x6563('0x3')]['id'],this[_0x6563('0x5')]['agents'][this[_0x6563('0x4')]['id']],_0x4b4d3b?_0x6563('0x1f'):'TIMEOUT');}if(!_0x4b4d3b){setTimeout(this[_0x6563('0x7')][_0x6563('0x9')](this),0x3e8);}};function agent(_0x5b0c9f,_0x582650,_0x38fef5,_0x5ca0ab){return new Agent(_0x5b0c9f,_0x582650,_0x38fef5,_0x5ca0ab);}module[_0x6563('0x20')]=agent; \ No newline at end of file +var _0xfd28=['routing','squeue','agent','realtime','bind','handleTimeout','timeout','drained','push','handleRun','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','uuid','./util'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0xfd28,0x148));var _0x8fd2=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0xfd28[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require('lodash');var uuid=require(_0x8fd2('0x0'));var util=require(_0x8fd2('0x1'));var logger=require('../../../../../config/logger')(_0x8fd2('0x2'));var Agent=function(_0x4e5c5e,_0x37baf5,_0xf7417d,_0x4e2108){this['notificationId']=uuid['v4']();this[_0x8fd2('0x3')]=_0x4e5c5e;this[_0x8fd2('0x4')]=_0x37baf5;this[_0x8fd2('0x5')]=_0xf7417d;this[_0x8fd2('0x2')]=_0x4e2108;this[_0x8fd2('0x3')]['push'](this['handleRun'][_0x8fd2('0x6')](this),this[_0x8fd2('0x7')][_0x8fd2('0x6')](this));this['squeue']['on'](_0x8fd2('0x8'),this['handleTimeout'][_0x8fd2('0x6')](this));this['squeue']['on'](_0x8fd2('0x9'),this['handleDrained'][_0x8fd2('0x6')](this));};Agent['prototype'][_0x8fd2('0xa')]=function(){this['squeue'][_0x8fd2('0xa')](this[_0x8fd2('0xb')][_0x8fd2('0x6')](this),this[_0x8fd2('0x7')][_0x8fd2('0x6')](this));};Agent[_0x8fd2('0xc')][_0x8fd2('0xd')]=function(){this[_0x8fd2('0x7')](!![]);};Agent[_0x8fd2('0xc')][_0x8fd2('0xb')]=function(){logger[_0x8fd2('0xe')](_0x8fd2('0xf'),this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x4')]['id']);if(_[_0x8fd2('0x10')](this['realtime'][_0x8fd2('0x11')][this['agent']['id']])){logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x4')]['id']);setTimeout(this[_0x8fd2('0xa')][_0x8fd2('0x6')](this),0x3e8);}else{if(this['routing'][_0x8fd2('0x12')]||util[_0x8fd2('0x13')](this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x5')][_0x8fd2('0x11')][this['agent']['id']],this['squeue'][_0x8fd2('0x14')],![])){this['realtime'][_0x8fd2('0x11')][this['agent']['id']][_0x8fd2('0x15')]=!![];this[_0x8fd2('0x5')]['agents'][this[_0x8fd2('0x4')]['id']]['busyQueue']=undefined;util[_0x8fd2('0x16')](this[_0x8fd2('0x5')],this['routing'],this[_0x8fd2('0x4')],this[_0x8fd2('0x3')][_0x8fd2('0x14')]);util['showNotification'](this[_0x8fd2('0x17')],this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x5')][_0x8fd2('0x11')][this[_0x8fd2('0x4')]['id']],null,this[_0x8fd2('0x2')]);util[_0x8fd2('0x18')](this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x5')][_0x8fd2('0x11')][this[_0x8fd2('0x4')]['id']],_0x8fd2('0x19')+(this[_0x8fd2('0x2')]['forcedOwnership']?':FORCED':''));}else{logger[_0x8fd2('0xe')](_0x8fd2('0x1a'),this[_0x8fd2('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x8fd2('0xa')][_0x8fd2('0x6')](this),0x3e8);}}};Agent[_0x8fd2('0xc')][_0x8fd2('0x7')]=function(_0x119439){if(_[_0x8fd2('0x10')](this[_0x8fd2('0x5')]['agents'][this[_0x8fd2('0x4')]['id']])){return logger[_0x8fd2('0xe')](_0x8fd2('0x1b'),this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x4')]['id']);}else{logger[_0x8fd2('0xe')](_0x8fd2('0x1c'),this['squeue']['id'],this['agent']['id']);util['hideNotification'](this[_0x8fd2('0x17')],this[_0x8fd2('0x3')]['id'],this[_0x8fd2('0x5')][_0x8fd2('0x11')][this['agent']['id']],null,this['routing']);this[_0x8fd2('0x5')][_0x8fd2('0x11')][this[_0x8fd2('0x4')]['id']][_0x8fd2('0x15')]=![];this[_0x8fd2('0x5')]['agents'][this[_0x8fd2('0x4')]['id']]['busyQueue']=undefined;util[_0x8fd2('0x1d')](this['realtime'],this[_0x8fd2('0x2')],this['agent'],this[_0x8fd2('0x3')][_0x8fd2('0x14')]);util[_0x8fd2('0x18')](this['squeue']['id'],this[_0x8fd2('0x5')]['agents'][this[_0x8fd2('0x4')]['id']],_0x119439?_0x8fd2('0x1e'):_0x8fd2('0x1f'));}if(!_0x119439){setTimeout(this['push'][_0x8fd2('0x6')](this),0x3e8);}};function agent(_0x199a85,_0x21adc6,_0x58ce31,_0x11ef3b){return new Agent(_0x199a85,_0x21adc6,_0x58ce31,_0x11ef3b);}module[_0x8fd2('0x20')]=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 59688de..de41cc4 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 _0x8218=['routing','notificationId','queue','realtime','squeue','push','handleRun','bind','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','debug','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','handleTimeout','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger'];(function(_0x469fcf,_0x549706){var _0x5a6f61=function(_0x363879){while(--_0x363879){_0x469fcf['push'](_0x469fcf['shift']());}};_0x5a6f61(++_0x549706);}(_0x8218,0x152));var _0x8821=function(_0x62b693,_0x220aa0){_0x62b693=_0x62b693-0x0;var _0x405fe3=_0x8218[_0x62b693];return _0x405fe3;};'use strict';var _=require(_0x8821('0x0'));var uuid=require(_0x8821('0x1'));var util=require(_0x8821('0x2'));var logger=require(_0x8821('0x3'))(_0x8821('0x4'));var Beepall=function(_0x2e304e,_0x20df4f,_0x1d8a4c,_0x1f5608){this[_0x8821('0x5')]=uuid['v4']();this['squeue']=_0x2e304e;this[_0x8821('0x6')]=_0x20df4f;this[_0x8821('0x7')]=_0x1d8a4c;this[_0x8821('0x4')]=_0x1f5608;this[_0x8821('0x8')][_0x8821('0x9')](this[_0x8821('0xa')][_0x8821('0xb')](this),this['handleTimeout'][_0x8821('0xb')](this));this[_0x8821('0x8')]['on'](_0x8821('0xc'),this['handleTimeout'][_0x8821('0xb')](this));this['squeue']['on'](_0x8821('0xd'),this[_0x8821('0xe')][_0x8821('0xb')](this));};Beepall[_0x8821('0xf')]['push']=function(){this[_0x8821('0x8')][_0x8821('0x9')](this[_0x8821('0xa')][_0x8821('0xb')](this),this['handleTimeout']['bind'](this));};Beepall[_0x8821('0xf')][_0x8821('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0x8821('0xf')][_0x8821('0xa')]=function(){var _0x18fd36=!![];if(!_[_0x8821('0x10')](this[_0x8821('0x6')])&&!_[_0x8821('0x10')](this[_0x8821('0x6')][_0x8821('0x11')])&&this[_0x8821('0x6')]['Agents'][_0x8821('0x12')]>0x0){for(var _0x1faffc=0x0,_0x50fe9d;_0x1faffc0x0){for(var _0x52ab76=0x0,_0x13b9c6;_0x52ab760x0&&_0x5c3c14[_0x47c571+_0xf105('0x1d')]>=_0x5c3c14[_0x47c571+_0xf105('0x1e')]){writeLog(_0x403ab7,_0x5c3c14,_0x47c571[_0xf105('0x1f')]()+_0xf105('0x20'));return![];}}return!![];};exports[_0xf105('0x21')]=function(_0x479fec,_0x313ab0,_0x57a199,_0x369f14,_0x54f8ab){return sendNotification(!![],_0x479fec,_0x313ab0,_0x57a199,_0x369f14,_0x54f8ab);};exports[_0xf105('0x22')]=function(_0x1a56ea,_0x70667c,_0x2b8f4e,_0x31528e,_0x1c8ff9){return sendNotification(![],_0x1a56ea,_0x70667c,_0x2b8f4e,_0x31528e,_0x1c8ff9);};exports['checkWaitingNotifications']=function(_0x38c2cc,_0x4c429d,_0x312cb9){var _0x360fe4=_0x4c429d[_0xf105('0x23')][_0xf105('0x24')];if(!_0x360fe4&&_0x312cb9){_0x360fe4=_0x312cb9['id'];}var _0x1da465=_[_0xf105('0x25')](_0x38c2cc[_0x4c429d[_0xf105('0x26')]+_0xf105('0x27')],function(_0x18c2e8){var _0x8b77d0=_['capitalize'](_0x4c429d['channel'])+_0xf105('0x28');return _0x18c2e8[_0x8b77d0]===_0x4c429d[_0xf105('0x23')]['id'];});if(!_0x1da465&&_0x360fe4&&_0x38c2cc['agents'][_0x360fe4]){_0x1da465=_['some'](_0x38c2cc[_0xf105('0x29')][_0x360fe4][_0x4c429d[_0xf105('0x26')]+_0xf105('0x2a')],function(_0x53bbfb){return _0x53bbfb['id']===_0x4c429d[_0xf105('0x23')]['id'];});}return _0x1da465;};exports[_0xf105('0x2b')]=function(_0x31f120,_0xd48fbb,_0x41a945,_0x2d8b5f){if(_0x41a945&&_0x41a945['id']&&_0x31f120[_0xf105('0x29')]&&_0x31f120['agents'][_0x41a945['id']]){_0x31f120[_0xf105('0x29')][_0x41a945['id']][_0x2d8b5f+'WaitingInteractions'][_0xd48fbb[_0xf105('0xf')]['id']]={'id':_0xd48fbb['interaction']['id']};}};exports[_0xf105('0x2c')]=function(_0x47ade5,_0x3240df,_0x3eebb4,_0x205a70){if(_0x3eebb4&&_0x3eebb4['id']&&_0x47ade5[_0xf105('0x29')]&&_0x47ade5['agents'][_0x3eebb4['id']]){delete _0x47ade5[_0xf105('0x29')][_0x3eebb4['id']][_0x205a70+'WaitingInteractions'][_0x3240df[_0xf105('0xf')]['id']];}};exports['writeLog']=writeLog; \ No newline at end of file +var _0x1ae4=['lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','\x20interaction','account','body','queue','msg','getMustacheRender','notificationTemplate','format','user:%s','name','emit','notification:%s','save','remove','debug','BUSY','OFFLINE','Pause','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','message','writeLog'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x1ae4,0x114));var _0x41ae=function(_0x993782,_0x5c44f1){_0x993782=_0x993782-0x0;var _0x2820f1=_0x1ae4[_0x993782];return _0x2820f1;};'use strict';var _=require(_0x41ae('0x0'));var util=require(_0x41ae('0x1'));var utils=require(_0x41ae('0x2'));var Redis=require('ioredis');var config=require(_0x41ae('0x3'));var logger=require(_0x41ae('0x4'))(_0x41ae('0x5'));config[_0x41ae('0x6')]=_[_0x41ae('0x7')](config[_0x41ae('0x6')],{'host':_0x41ae('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x41ae('0x6')]));function sendNotification(_0x1c060f,_0x41ae40,_0x2973bc,_0x533a15,_0x12a66c,_0x4ff3d6){var _0x19f63d=_0x4ff3d6||{};var _0x7422d4=_0x2973bc['split']('.');var _0x5c5cd8={'uniqueid':_0x41ae40,'channel':_0x7422d4[0x0],'id':_0x7422d4[0x1],'title':_0x7422d4[0x0]+_0x41ae('0x9'),'interactionId':_0x7422d4[0x2],'queue':_0x12a66c?_0x12a66c['name']:null,'sound':_0x19f63d[_0x41ae('0xa')]['notificationSound'],'shake':_0x19f63d[_0x41ae('0xa')]['notificationShake']};try{if(!_0x19f63d[_0x41ae('0xb')]){_0x19f63d[_0x41ae('0xb')]={};}if(_0x12a66c){_0x19f63d['body'][_0x41ae('0xc')]=_0x12a66c;}else if(_0x19f63d['body'][_0x41ae('0xc')]){delete _0x19f63d[_0x41ae('0xb')][_0x41ae('0xc')];}_0x5c5cd8[_0x41ae('0xd')]=utils[_0x41ae('0xe')](_0x19f63d['account'][_0x41ae('0xf')],_0x19f63d);}catch(_0x35cb28){_0x5c5cd8[_0x41ae('0xd')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util['format']('[%s][QUEUE]\x20%s',_0x41ae40,_0x35cb28['message']));}io['to'](util[_0x41ae('0x10')](_0x41ae('0x11'),_0x533a15[_0x41ae('0x12')]))[_0x41ae('0x13')](util[_0x41ae('0x10')](_0x41ae('0x14'),_0x1c060f?_0x41ae('0x15'):_0x41ae('0x16')),_0x5c5cd8);}function writeLog(_0x27b23c,_0x22cf1a,_0x24f11c){return logger[_0x41ae('0x17')](util[_0x41ae('0x10')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x27b23c,_0x22cf1a[_0x41ae('0x12')],_0x24f11c));}exports['isAgentAvailable']=function(_0x2b07ec,_0x1c6cf2,_0x5ea546,_0x2df8a6){if(_0x1c6cf2['busy']){writeLog(_0x2b07ec,_0x1c6cf2,_0x41ae('0x18'));return![];}if(!_0x1c6cf2['online']){writeLog(_0x2b07ec,_0x1c6cf2,_0x41ae('0x19'));return![];}if(_0x1c6cf2[_0x5ea546+_0x41ae('0x1a')]){writeLog(_0x2b07ec,_0x1c6cf2,'PAUSE');return![];}if(_0x2df8a6&&_0x1c6cf2[_0x41ae('0x1b')](_0x5ea546+'Capacity')&&_0x1c6cf2[_0x41ae('0x1b')](_0x5ea546+_0x41ae('0x1c'))){if(_0x1c6cf2[_0x5ea546+_0x41ae('0x1d')]>0x0&&_0x1c6cf2[_0x5ea546+_0x41ae('0x1c')]>=_0x1c6cf2[_0x5ea546+_0x41ae('0x1d')]){writeLog(_0x2b07ec,_0x1c6cf2,_0x5ea546[_0x41ae('0x1e')]()+_0x41ae('0x1f'));return![];}}return!![];};exports[_0x41ae('0x20')]=function(_0xdeec00,_0x4b13a0,_0x21a4e8,_0x2352cf,_0x5011c3){return sendNotification(!![],_0xdeec00,_0x4b13a0,_0x21a4e8,_0x2352cf,_0x5011c3);};exports[_0x41ae('0x21')]=function(_0x24371d,_0x47019a,_0xbc9a65,_0x4f2734,_0x362453){return sendNotification(![],_0x24371d,_0x47019a,_0xbc9a65,_0x4f2734,_0x362453);};exports[_0x41ae('0x22')]=function(_0x17344e,_0x22b712,_0x113fde){var _0x17f796=_0x22b712[_0x41ae('0x23')][_0x41ae('0x24')];if(!_0x17f796&&_0x113fde){_0x17f796=_0x113fde['id'];}var _0x48f878=_[_0x41ae('0x25')](_0x17344e[_0x22b712[_0x41ae('0x26')]+_0x41ae('0x27')],function(_0x4e7d91){var _0x383501=_[_0x41ae('0x28')](_0x22b712[_0x41ae('0x26')])+_0x41ae('0x29');return _0x4e7d91[_0x383501]===_0x22b712[_0x41ae('0x23')]['id'];});if(!_0x48f878&&_0x17f796&&_0x17344e[_0x41ae('0x2a')][_0x17f796]){_0x48f878=_[_0x41ae('0x25')](_0x17344e[_0x41ae('0x2a')][_0x17f796][_0x22b712[_0x41ae('0x26')]+'WaitingInteractions'],function(_0x1b1406){return _0x1b1406['id']===_0x22b712['interaction']['id'];});}return _0x48f878;};exports['saveWaitingNotification']=function(_0x7c5f8f,_0x43f2fc,_0x41fa22,_0x1e4fe5){if(_0x41fa22&&_0x41fa22['id']&&_0x7c5f8f[_0x41ae('0x2a')]&&_0x7c5f8f[_0x41ae('0x2a')][_0x41fa22['id']]){_0x7c5f8f[_0x41ae('0x2a')][_0x41fa22['id']][_0x1e4fe5+_0x41ae('0x2b')][_0x43f2fc[_0x41ae('0x2c')]['id']]={'id':_0x43f2fc['interaction']['id']};}};exports['removeWaitingNotification']=function(_0x263f84,_0x460ed3,_0x4f88a4,_0x5b5b1a){if(_0x4f88a4&&_0x4f88a4['id']&&_0x263f84[_0x41ae('0x2a')]&&_0x263f84[_0x41ae('0x2a')][_0x4f88a4['id']]){delete _0x263f84[_0x41ae('0x2a')][_0x4f88a4['id']][_0x5b5b1a+_0x41ae('0x2b')][_0x460ed3[_0x41ae('0x2c')]['id']];}};exports[_0x41ae('0x2d')]=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 2c6466b..9051591 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 _0x02c8=['lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','stringify','validate','shelljs'];(function(_0x42c037,_0x577d1a){var _0x37db36=function(_0x49d45c){while(--_0x49d45c){_0x42c037['push'](_0x42c037['shift']());}};_0x37db36(++_0x577d1a);}(_0x02c8,0x80));var _0x802c=function(_0xe3579d,_0x498caa){_0xe3579d=_0xe3579d-0x0;var _0xbf766e=_0x02c8[_0xe3579d];return _0xbf766e;};'use strict';var schema=require(_0x802c('0x0'));var sh=require(_0x802c('0x1'));var _=require(_0x802c('0x2'));var utils=require(_0x802c('0x3'));var logger=require(_0x802c('0x4'))(_0x802c('0x5'));var system=schema({'command':{'type':_0x802c('0x6'),'required':!![],'message':_0x802c('0x7')}});exports[_0x802c('0x8')]=function(_0x2d1838,_0x1d5fb9){return function(_0xfa281c){try{var _0x24267c={'command':_0x1d5fb9[0x0]};var _0x1625bd=system[_0x802c('0x0')](_0x24267c,{'typecast':!![]});if(_0x1625bd[_0x802c('0x9')]){logger[_0x802c('0xa')](_0x802c('0xb'),_0x2d1838,_[_0x802c('0xc')](_0x1625bd,_0x802c('0xd'))[_0x802c('0xe')](',\x20'));logger[_0x802c('0xf')](_0x802c('0x10'),_0x2d1838);_0xfa281c[_0x802c('0x11')]();}else{var _0x53d90a=this;var _0x4e5b1a=utils[_0x802c('0x12')](_0x1d5fb9[0x0],this);logger[_0x802c('0xf')](_0x802c('0x13'),_0x2d1838,_0x4e5b1a);sh[_0x802c('0x14')](_['trim'](_0x4e5b1a),function(_0x5012c7,_0x2e5d3c){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2d1838,_0x5012c7);if(_0x5012c7==0x0){var _0x4ed3ce=_0x2e5d3c[_0x802c('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0x802c('0x16')](_0x1d5fb9[0x1])||_['isEmpty'](_0x1d5fb9[0x1])){logger['info'](_0x802c('0x17'),_0x2d1838);_0x53d90a[_0x802c('0x18')][_0x1d5fb9[0x1]]=_0x4ed3ce;}else{logger[_0x802c('0xf')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2d1838,_0x1d5fb9[0x1],_0x4ed3ce);_0x53d90a[_0x802c('0x18')][_0x1d5fb9[0x1]]=_0x4ed3ce;}}_0xfa281c[_0x802c('0x11')]();});}}catch(_0x21b109){logger['error'](_0x802c('0xb'),_0x2d1838,_['isObject'](_0x21b109)?JSON[_0x802c('0x19')](_0x21b109):_0x21b109);logger[_0x802c('0xf')](_0x802c('0x10'),_0x2d1838);_0xfa281c[_0x802c('0x11')]();}};}; \ No newline at end of file +var _0x78c2=['./utils','../../../../config/logger','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','replace','isEmpty','body','next','isObject','stringify','validate','shelljs','lodash'];(function(_0x40bec8,_0x2c50e3){var _0x4b73a6=function(_0x4bedc9){while(--_0x4bedc9){_0x40bec8['push'](_0x40bec8['shift']());}};_0x4b73a6(++_0x2c50e3);}(_0x78c2,0xad));var _0x278c=function(_0x4e9173,_0x5e6bd0){_0x4e9173=_0x4e9173-0x0;var _0x5813c5=_0x78c2[_0x4e9173];return _0x5813c5;};'use strict';var schema=require(_0x278c('0x0'));var sh=require(_0x278c('0x1'));var _=require(_0x278c('0x2'));var utils=require(_0x278c('0x3'));var logger=require(_0x278c('0x4'))('routing');var system=schema({'command':{'type':_0x278c('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x278c('0x6')]=function(_0x6256d1,_0x24da4d){return function(_0x20aef5){try{var _0x518ee7={'command':_0x24da4d[0x0]};var _0x4b3bff=system['validate'](_0x518ee7,{'typecast':!![]});if(_0x4b3bff[_0x278c('0x7')]){logger[_0x278c('0x8')](_0x278c('0x9'),_0x6256d1,_[_0x278c('0xa')](_0x4b3bff,_0x278c('0xb'))[_0x278c('0xc')](',\x20'));logger[_0x278c('0xd')](_0x278c('0xe'),_0x6256d1);_0x20aef5['next']();}else{var _0x13f208=this;var _0x368ac1=utils['getMustacheRender'](_0x24da4d[0x0],this);logger[_0x278c('0xd')](_0x278c('0xf'),_0x6256d1,_0x368ac1);sh['exec'](_['trim'](_0x368ac1),function(_0x5c9fe3,_0x2499b2){logger[_0x278c('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x6256d1,_0x5c9fe3);if(_0x5c9fe3==0x0){var _0x343553=_0x2499b2[_0x278c('0x10')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x24da4d[0x1])||_[_0x278c('0x11')](_0x24da4d[0x1])){logger[_0x278c('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x6256d1);_0x13f208[_0x278c('0x12')][_0x24da4d[0x1]]=_0x343553;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x6256d1,_0x24da4d[0x1],_0x343553);_0x13f208[_0x278c('0x12')][_0x24da4d[0x1]]=_0x343553;}}_0x20aef5[_0x278c('0x13')]();});}}catch(_0x4fd1fe){logger[_0x278c('0x8')]('[%s][SYSTEM]\x20%s',_0x6256d1,_[_0x278c('0x14')](_0x4fd1fe)?JSON[_0x278c('0x15')](_0x4fd1fe):_0x4fd1fe);logger[_0x278c('0xd')](_0x278c('0xe'),_0x6256d1);_0x20aef5[_0x278c('0x13')]();}};}; \ 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 6b56c71..26b1fb4 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 _0xb006=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][TAG]\x20%s','message','info','next','channel','Interaction','addTags','interaction'];(function(_0xe517c5,_0x42fbe6){var _0x2b154a=function(_0x16f50d){while(--_0x16f50d){_0xe517c5['push'](_0xe517c5['shift']());}};_0x2b154a(++_0x42fbe6);}(_0xb006,0x94));var _0x6b00=function(_0x29551f,_0x7326d6){_0x29551f=_0x29551f-0x0;var _0x2f2a22=_0xb006[_0x29551f];return _0x2f2a22;};'use strict';var schema=require('validate');var _=require(_0x6b00('0x0'));var rpc={'chatInteraction':require(_0x6b00('0x1')),'openchannelInteraction':require(_0x6b00('0x2')),'smsInteraction':require(_0x6b00('0x3')),'mailInteraction':require(_0x6b00('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x6b00('0x5'))};var logger=require('../../../../config/logger')(_0x6b00('0x6'));var tag=schema({'tag':{'type':_0x6b00('0x7'),'required':!![],'message':_0x6b00('0x8')}});exports[_0x6b00('0x9')]=function(_0x82d579,_0x9d111f,_0x451daf,_0xc903da){return function(_0x1fb2b6){try{var _0x4ee0d2={'tag':_0x9d111f[0x0]};var _0x15d49f=tag[_0x6b00('0xa')](_0x4ee0d2,{'typecast':!![]});if(_0x15d49f['length']){logger[_0x6b00('0xb')](_0x6b00('0xc'),_0x82d579,_['map'](_0x15d49f,_0x6b00('0xd'))['join'](',\x20'));logger[_0x6b00('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x82d579);_0x1fb2b6[_0x6b00('0xf')]();}else{var _0x1c09ad={'ids':[_0x9d111f[0x0]]};if(rpc[_0xc903da[_0x6b00('0x10')]+_0x6b00('0x11')]){rpc[_0xc903da[_0x6b00('0x10')]+_0x6b00('0x11')][_0x6b00('0x12')](_0xc903da[_0x6b00('0x13')]['id'],_0x1c09ad)['then'](function(_0x4d19ae){logger[_0x6b00('0xe')](_0x6b00('0x14'),_0x82d579,_0x9d111f[0x1],_0xc903da[_0x6b00('0x10')],_0xc903da[_0x6b00('0x13')]['id']);})['catch'](function(_0xa7e922){logger[_0x6b00('0xb')]('[%s][TAG]\x20%s',_0x82d579,JSON['stringify'](_0xa7e922));logger[_0x6b00('0xe')](_0x6b00('0x15'),_0x82d579);})['finally'](function(){_0x1fb2b6[_0x6b00('0xf')]();});}}}catch(_0x2e9064){logger[_0x6b00('0xb')](_0x6b00('0xc'),_0x82d579,_[_0x6b00('0x16')](_0x2e9064)?JSON[_0x6b00('0x17')](_0x2e9064):_0x2e9064);logger[_0x6b00('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x82d579);_0x1fb2b6[_0x6b00('0xf')]();}};}; \ No newline at end of file +var _0xd4fa=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','consequence','error','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','interaction','[%s][TAG]\x20%s','isObject','stringify','validate','lodash','../../rpc/chatInteraction'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0xd4fa,0x14d));var _0xad4f=function(_0x39714b,_0x5e0b0e){_0x39714b=_0x39714b-0x0;var _0x45ed60=_0xd4fa[_0x39714b];return _0x45ed60;};'use strict';var schema=require(_0xad4f('0x0'));var _=require(_0xad4f('0x1'));var rpc={'chatInteraction':require(_0xad4f('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xad4f('0x3')),'mailInteraction':require(_0xad4f('0x4')),'faxInteraction':require(_0xad4f('0x5')),'whatsappInteraction':require(_0xad4f('0x6'))};var logger=require(_0xad4f('0x7'))(_0xad4f('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xad4f('0x9')]=function(_0x195846,_0x4b1988,_0x54ddd3,_0x242946){return function(_0x7c63a8){try{var _0x34612f={'tag':_0x4b1988[0x0]};var _0x7cfb0e=tag[_0xad4f('0x0')](_0x34612f,{'typecast':!![]});if(_0x7cfb0e['length']){logger[_0xad4f('0xa')]('[%s][TAG]\x20%s',_0x195846,_['map'](_0x7cfb0e,_0xad4f('0xb'))[_0xad4f('0xc')](',\x20'));logger[_0xad4f('0xd')](_0xad4f('0xe'),_0x195846);_0x7c63a8[_0xad4f('0xf')]();}else{var _0x63cd33={'ids':[_0x4b1988[0x0]]};if(rpc[_0x242946[_0xad4f('0x10')]+'Interaction']){rpc[_0x242946[_0xad4f('0x10')]+_0xad4f('0x11')][_0xad4f('0x12')](_0x242946['interaction']['id'],_0x63cd33)[_0xad4f('0x13')](function(_0x24bb4c){logger[_0xad4f('0xd')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x195846,_0x4b1988[0x1],_0x242946[_0xad4f('0x10')],_0x242946[_0xad4f('0x14')]['id']);})['catch'](function(_0x1afc49){logger[_0xad4f('0xa')](_0xad4f('0x15'),_0x195846,JSON['stringify'](_0x1afc49));logger[_0xad4f('0xd')](_0xad4f('0xe'),_0x195846);})['finally'](function(){_0x7c63a8[_0xad4f('0xf')]();});}}}catch(_0x200d80){logger[_0xad4f('0xa')](_0xad4f('0x15'),_0x195846,_[_0xad4f('0x16')](_0x200d80)?JSON[_0xad4f('0x17')](_0x200d80):_0x200d80);logger[_0xad4f('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x195846);_0x7c63a8[_0xad4f('0xf')]();}};}; \ 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 96e1a4e..9cb55fd 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 _0xeaef=['2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','result','logged','channelId=','&sessionId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','includes','push','?params=','urlOnRing','jsonrpc'];(function(_0xc5daf4,_0x19c020){var _0xd18d19=function(_0xd69ba3){while(--_0xd69ba3){_0xc5daf4['push'](_0xc5daf4['shift']());}};_0xd18d19(++_0x19c020);}(_0xeaef,0xdc));var _0xfeae=function(_0x13ea66,_0x4d9dce){_0x13ea66=_0x13ea66-0x0;var _0x4e9c60=_0xeaef[_0x13ea66];return _0x4e9c60;};'use strict';var rp=require(_0xfeae('0x0'));var logger=require(_0xfeae('0x1'))(_0xfeae('0x2'));var _=require(_0xfeae('0x3'));var arr=[];exports[_0xfeae('0x4')]=function(_0x5c31d9,_0xd87cd3){return function(_0x512d1f){var _0x24603b=_0xd87cd3[0xa];var _0x1ad03b=_0xd87cd3[0xb];var _0xae437b=_0xd87cd3[0xc];var _0x19df84=_0xd87cd3[0xd];var _0x4e78c4=_0xd87cd3[0xe];var _0x59b180=_0xd87cd3[0xf]['replace'](/\n/g,_0xfeae('0x5'));var _0x1ecc04=_0xd87cd3[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xfeae('0x6')](_0x1ad03b)){arr[_0xfeae('0x7')](_0x1ad03b);var _0x153b48=_0xd87cd3[0x3];var _0x812bab=_0xd87cd3[0x4];var _0xc4e007=_0xd87cd3[0x1];var _0x3c07fa=_0xd87cd3[0x0];var _0x2f99d6={};_0x2f99d6['urlOnAnswer']=_0xd87cd3[0x8]+_0xfeae('0x8')+_0xae437b+'|'+_0x24603b+'|'+_0x19df84+'|'+_0x1ad03b+'|'+_0x4e78c4;_0x2f99d6[_0xfeae('0x9')]=_0xd87cd3[0x7]+_0xfeae('0x8')+_0xae437b+'|'+_0x24603b+'|'+_0x19df84+'|'+_0x1ad03b+'|'+_0x4e78c4+'|'+_0x59b180+'|'+_0x1ecc04;_0x2f99d6['title']=_0xd87cd3[0x9];var _0x3cb357={};_0x3cb357[_0xfeae('0xa')]=_0xfeae('0xb');_0x3cb357[_0xfeae('0xc')]=_0xfeae('0xd');var _0x4fee1f=[];_0x4fee1f[_0xfeae('0x7')](_0xd87cd3[0x2]);_0x4fee1f['push'](_0xd87cd3[0x5]);_0x4fee1f['push'](_0xd87cd3[0x6]);_0x3cb357[_0xfeae('0xe')]=_0x4fee1f;_0x3cb357['id']=0x1;var _0x30991a=JSON[_0xfeae('0xf')](_0x3cb357);var _0x22925d={'encoding':_0xfeae('0x10'),'method':_0xfeae('0x11'),'timeout':0x2710,'url':_0x153b48,'headers':{'Content-Type':_0xfeae('0x12')},'body':_0x30991a};return rp(_0x22925d)[_0xfeae('0x13')](function(_0x594b71){const _0x5af9ca=JSON['parse'](_0x594b71);if(!_0x5af9ca[_0xfeae('0x14')][_0xfeae('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x35aaae=_0x1ad03b;var _0x52bcff=_0xfeae('0x16')+_0xc4e007+'&serviceId='+_0x3c07fa+_0xfeae('0x17')+_0x35aaae+_0xfeae('0x18')+JSON[_0xfeae('0xf')](_0x2f99d6);var _0xc12ccd=_0x812bab+'?'+_0x52bcff;return rp(_0xc12ccd);})[_0xfeae('0x13')](function(_0xf398b1){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5c31d9,_0xf398b1);_0x512d1f[_0xfeae('0x19')]();})[_0xfeae('0x1a')](function(_0x5454d3){logger[_0xfeae('0x1b')](_0xfeae('0x1c'),_0x5c31d9,_[_0xfeae('0x1d')](_0x5454d3)?JSON[_0xfeae('0xf')](_0x5454d3):_0x5454d3);_0x512d1f[_0xfeae('0x19')]();});}else{logger[_0xfeae('0x1e')](_0xfeae('0x1f'),_0x5c31d9);_0x512d1f[_0xfeae('0x20')]();}};}; \ No newline at end of file +var _0xa505=['isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','consequence','includes','urlOnAnswer','?params=','urlOnRing','title','2.0','push','params','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s'];(function(_0xf3945c,_0x5a76bd){var _0x1ea8f3=function(_0x4c86e7){while(--_0x4c86e7){_0xf3945c['push'](_0xf3945c['shift']());}};_0x1ea8f3(++_0x5a76bd);}(_0xa505,0x17d));var _0x5a50=function(_0x30f19a,_0x4b84ee){_0x30f19a=_0x30f19a-0x0;var _0x50e062=_0xa505[_0x30f19a];return _0x50e062;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')('routing');var _=require('lodash');var arr=[];exports[_0x5a50('0x0')]=function(_0x50353e,_0x1ad4ee){return function(_0x4b7973){var _0x255291=_0x1ad4ee[0xa];var _0x580eb6=_0x1ad4ee[0xb];var _0x2a0654=_0x1ad4ee[0xc];var _0x2b894c=_0x1ad4ee[0xd];var _0x46e699=_0x1ad4ee[0xe];var _0x3cc847=_0x1ad4ee[0xf]['replace'](/\n/g,'\x20-\x20');var _0x1aa537=_0x1ad4ee[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x5a50('0x1')](_0x580eb6)){arr['push'](_0x580eb6);var _0x3317be=_0x1ad4ee[0x3];var _0x31a745=_0x1ad4ee[0x4];var _0x4344d6=_0x1ad4ee[0x1];var _0x5acb31=_0x1ad4ee[0x0];var _0x21e77c={};_0x21e77c[_0x5a50('0x2')]=_0x1ad4ee[0x8]+_0x5a50('0x3')+_0x2a0654+'|'+_0x255291+'|'+_0x2b894c+'|'+_0x580eb6+'|'+_0x46e699;_0x21e77c[_0x5a50('0x4')]=_0x1ad4ee[0x7]+_0x5a50('0x3')+_0x2a0654+'|'+_0x255291+'|'+_0x2b894c+'|'+_0x580eb6+'|'+_0x46e699+'|'+_0x3cc847+'|'+_0x1aa537;_0x21e77c[_0x5a50('0x5')]=_0x1ad4ee[0x9];var _0x512e86={};_0x512e86['jsonrpc']=_0x5a50('0x6');_0x512e86['method']='login';var _0x19d6ca=[];_0x19d6ca[_0x5a50('0x7')](_0x1ad4ee[0x2]);_0x19d6ca[_0x5a50('0x7')](_0x1ad4ee[0x5]);_0x19d6ca[_0x5a50('0x7')](_0x1ad4ee[0x6]);_0x512e86[_0x5a50('0x8')]=_0x19d6ca;_0x512e86['id']=0x1;var _0x2311af=JSON[_0x5a50('0x9')](_0x512e86);var _0x40d371={'encoding':_0x5a50('0xa'),'method':'POST','timeout':0x2710,'url':_0x3317be,'headers':{'Content-Type':_0x5a50('0xb')},'body':_0x2311af};return rp(_0x40d371)[_0x5a50('0xc')](function(_0x3b249e){const _0x948cc7=JSON[_0x5a50('0xd')](_0x3b249e);if(!_0x948cc7[_0x5a50('0xe')][_0x5a50('0xf')]){throw new Error(_0x5a50('0x10'));}var _0x3a9dfc=_0x580eb6;var _0x2d1d74='channelId='+_0x4344d6+_0x5a50('0x11')+_0x5acb31+'&sessionId='+_0x3a9dfc+'&data='+JSON[_0x5a50('0x9')](_0x21e77c);var _0x133a5f=_0x31a745+'?'+_0x2d1d74;return rp(_0x133a5f);})[_0x5a50('0xc')](function(_0x4d2ca7){logger[_0x5a50('0x12')](_0x5a50('0x13'),_0x50353e,_0x4d2ca7);_0x4b7973[_0x5a50('0x14')]();})[_0x5a50('0x15')](function(_0x3dbb6b){logger[_0x5a50('0x16')](_0x5a50('0x17'),_0x50353e,_[_0x5a50('0x18')](_0x3dbb6b)?JSON[_0x5a50('0x9')](_0x3dbb6b):_0x3dbb6b);_0x4b7973[_0x5a50('0x14')]();});}else{logger[_0x5a50('0x12')](_0x5a50('0x19'),_0x50353e);_0x4b7973[_0x5a50('0x1a')]();}};}; \ 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 ba37b3a..2117b67 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x195eb5,_0xac3379){var _0x1a190d=function(_0x3958ab){while(--_0x3958ab){_0x195eb5['push'](_0x195eb5['shift']());}};_0x1a190d(++_0xac3379);}(_0xe706,0xa3));var _0x6e70=function(_0x22c169,_0x3298a6){_0x22c169=_0x22c169-0x0;var _0x30cc6f=_0xe706[_0x22c169];return _0x30cc6f;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0xc33554,_0x32d3a5){var _0x4680f7=function(_0x1f700a){while(--_0x1f700a){_0xc33554['push'](_0xc33554['shift']());}};_0x4680f7(++_0x32d3a5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index e305d3a..c3b0fe0 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 _0x3a20=['updateRealtime','agent\x20not\x20found','values','chatQueues','available','paused','waiting','mailQueues','loggedIn','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','./applications/utils','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','transfer','applications','length','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ContactId','%s:%s:%s','intervals','./applications/','consequence','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agents','agent','busy','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','channel','hasOwnProperty','capacity','CurrentCapacity'];(function(_0x68ab87,_0x433ba3){var _0x41c05b=function(_0x4163cb){while(--_0x4163cb){_0x68ab87['push'](_0x68ab87['shift']());}};_0x41c05b(++_0x433ba3);}(_0x3a20,0xd0));var _0x03a2=function(_0x6daf3f,_0xab57c5){_0x6daf3f=_0x6daf3f-0x0;var _0x375108=_0x3a20[_0x6daf3f];return _0x375108;};'use strict';var _=require('lodash');var util=require(_0x03a2('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x03a2('0x1'));var BPromise=require('bluebird');var utils=require(_0x03a2('0x2'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x03a2('0x3')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x03a2('0x4')),'smsQueueReport':require(_0x03a2('0x5')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x03a2('0x6'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x1e43c1,_0x1e1a86,_0x28a6fe){return util[_0x03a2('0x7')](_0x03a2('0x8'),_0x1e43c1,_0x1e1a86||0x0,_0x28a6fe||0x0);}function getIntervals(_0x242786,_0x27a2e8){var _0x23d23a=[];if(!_[_0x03a2('0x9')](_0x27a2e8[_0x03a2('0xa')])&&!_[_0x03a2('0x9')](_0x242786[_0x27a2e8[_0x03a2('0xa')]])&&!_[_0x03a2('0x9')](_0x242786[_0x27a2e8['IntervalId']][_0x03a2('0xb')])){_0x23d23a=_[_0x03a2('0xc')](_0x242786[_0x27a2e8[_0x03a2('0xa')]]['Intervals'],_0x03a2('0xd'));}else if(!_[_0x03a2('0x9')](_0x27a2e8[_0x03a2('0xd')])){_0x23d23a=[_0x27a2e8[_0x03a2('0xd')]];}return _0x23d23a;}exports[_0x03a2('0xe')]=function(_0x196ddc){_0x196ddc[_0x03a2('0xf')]={};return new BPromise(function(_0x2cefa9,_0x19fb1f){var _0x5a8e39={'Start':function(_0x2e9bb9){var _0x5c1a70=this;return new Promise(function(_0x5ad109,_0x388272){if(_0x2e9bb9){try{var _0x4dff43=[];var _0x5e137b=getId(_0x2e9bb9['channel'],_0x2e9bb9['message']?_0x2e9bb9[_0x03a2('0x10')]['id']:0x0,_0x2e9bb9[_0x03a2('0x11')]?_0x2e9bb9['interaction']['id']:0x0);var _0x291791=sUtils['checkWaitingNotifications'](_0x196ddc,_0x2e9bb9);if(_0x2e9bb9[_0x03a2('0x12')]||!_0x291791&&_0x2e9bb9[_0x03a2('0x13')]&&_['isArray'](_0x2e9bb9[_0x03a2('0x13')])&&_0x2e9bb9['applications'][_0x03a2('0x14')]){for(var _0x2c9f84=0x0;_0x2c9f84<_0x2e9bb9[_0x03a2('0x13')][_0x03a2('0x14')];_0x2c9f84+=0x1){var _0x3bf194=_0x2e9bb9['applications'][_0x2c9f84];if(fs['existsSync'](path[_0x03a2('0x15')](__dirname,_0x03a2('0x13'),_0x3bf194['app']+'.js'))){var _0x53263e=[];switch(_0x3bf194[_0x03a2('0x16')][_0x03a2('0x17')]()){case _0x03a2('0x18'):var _0x395935=_0x3bf194[_0x03a2('0x19')][_0x03a2('0x1a')](',');if(_0x2e9bb9['channel']===_0x03a2('0x1b')){_0x53263e[_0x03a2('0x1c')](_0x395935[0x0]);_0x53263e['push'](_0x395935[0x1]);_0x53263e[_0x03a2('0x1c')](_0x395935[_0x03a2('0x1d')](0x2,_0x395935[_0x03a2('0x14')])[_0x03a2('0x15')](','));}else{_0x53263e[_0x03a2('0x1c')](_0x395935[0x0]);_0x53263e[_0x03a2('0x1c')](_0x395935[_0x03a2('0x1d')](0x1,_0x395935[_0x03a2('0x14')])[_0x03a2('0x15')](','));}break;case _0x03a2('0x1e'):var _0x5dd1b8=_0x3bf194[_0x03a2('0x19')]['split'](',');_0x53263e['push'](_0x5dd1b8[0x0]);_0x53263e[_0x03a2('0x1c')](_0x5dd1b8[0x1]);_0x53263e['push'](_0x5dd1b8[_0x03a2('0x1d')](0x2,_0x5dd1b8[_0x03a2('0x14')])['join'](','));break;case _0x03a2('0x1f'):var _0x98325=_0x3bf194[_0x03a2('0x19')]['split'](',');_0x53263e[_0x03a2('0x1c')](_0x98325[0x0]);_0x53263e[_0x03a2('0x1c')](_0x98325[0x1]);_0x53263e['push'](_0x98325[0x2]);_0x53263e[_0x03a2('0x1c')](_0x98325[0x3]);_0x53263e[_0x03a2('0x1c')](_0x98325[_0x03a2('0x1d')](0x4,_0x98325[_0x03a2('0x14')])[_0x03a2('0x15')](','));break;case _0x03a2('0x20'):var _0x5d7653=_0x3bf194[_0x03a2('0x19')][_0x03a2('0x1a')](',');_0x53263e['push'](_0x5d7653[0x0]);_0x53263e[_0x03a2('0x1c')](_0x5d7653[0x1]);_0x53263e[_0x03a2('0x1c')](_0x5d7653[0x2]);_0x53263e[_0x03a2('0x1c')](_0x5d7653[0x3]);_0x53263e[_0x03a2('0x1c')](_0x5d7653[_0x03a2('0x1d')](0x4,_0x5d7653[_0x03a2('0x14')])['join'](','));break;case _0x03a2('0x10'):_0x53263e[_0x03a2('0x1c')](_0x3bf194['appdata']);break;case _0x03a2('0x21'):_0x53263e[_0x03a2('0x1c')](_0x3bf194[_0x03a2('0x22')]);_0x53263e[_0x03a2('0x1c')](_0x3bf194[_0x03a2('0x19')]);break;case _0x03a2('0x23'):var _0x4305c3=utils['getMustacheRender'](_0x2e9bb9[_0x03a2('0x24')][_0x03a2('0x25')],_0x2e9bb9);var _0x14e0dc=_0x3bf194['appdata'][_0x03a2('0x1a')](',');_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x0]);_0x53263e['push'](_0x14e0dc[0x1]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x2]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x3]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x4]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x5]);_0x53263e['push'](_0x14e0dc[0x6]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x7]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x8]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0x9]);_0x53263e[_0x03a2('0x1c')](_0x14e0dc[0xa]);_0x53263e[_0x03a2('0x1c')](_0x2e9bb9[_0x03a2('0x11')]['id']);_0x53263e[_0x03a2('0x1c')](_0x2e9bb9[_0x03a2('0x10')]['id']);_0x53263e['push'](_0x3bf194['ChatWebsiteId']);_0x53263e[_0x03a2('0x1c')](_0x2e9bb9[_0x03a2('0x11')][_0x03a2('0x26')]);_0x53263e[_0x03a2('0x1c')](_0x2e9bb9['body']['body']);_0x53263e['push'](_0x4305c3);break;default:_0x53263e=_['isNil'](_0x3bf194['appdata'])?[]:_0x3bf194[_0x03a2('0x19')][_0x03a2('0x1a')](',');}var _0x302427={'id':util['format'](_0x03a2('0x27'),_0x5e137b,_0x3bf194['id'],_0x3bf194[_0x03a2('0x16')]),'condition':require('./interval')['condition'](_0x5e137b,getIntervals(_0x196ddc[_0x03a2('0x28')],_0x3bf194),_0x196ddc),'consequence':require(_0x03a2('0x29')+_0x3bf194['app'])[_0x03a2('0x2a')](_0x5e137b,_0x53263e,_0x196ddc,_0x2e9bb9),'p':_0x3bf194['priority']||0x0};logger[_0x03a2('0x2b')]('Push\x20new\x20rule',_0x302427['id'],_0x03a2('0x2c'),getIntervals(_0x196ddc[_0x03a2('0x28')],_0x3bf194)[_0x03a2('0x15')](_0x03a2('0x2d')));_0x4dff43['push'](_0x302427);}else{logger[_0x03a2('0x2e')](_0x03a2('0x2f'),path[_0x03a2('0x15')](__dirname,'applications',_0x3bf194[_0x03a2('0x16')]+_0x03a2('0x30')));}}_0x196ddc['rules'][_0x5e137b]=new RuleEngine(_0x4dff43);_0x196ddc[_0x03a2('0xf')][_0x5e137b]['execute'](_0x2e9bb9,function(_0x70a786){logger[_0x03a2('0x2b')](_0x03a2('0x31'),JSON[_0x03a2('0x32')](_0x70a786[_0x03a2('0x33')]));if(_0x196ddc[_0x03a2('0xf')][_0x5e137b]){_0x196ddc[_0x03a2('0xf')][_0x5e137b]['emit'](_0x03a2('0x34'));}});return _0x5ad109({'code':0xc8,'message':_0x2e9bb9});}else{if(_0x291791){logger[_0x03a2('0x2b')](util[_0x03a2('0x7')]('Skipped\x20routing\x20for\x20%s',_0x5e137b));}else{logger['info'](_0x03a2('0x35'));}return _0x5ad109({'code':0xc8,'message':_0x2e9bb9});}}catch(_0x189cec){logger[_0x03a2('0x2e')](_0x189cec[_0x03a2('0x36')]);return _0x388272(_0x5c1a70[_0x03a2('0x2e')](0x1f4,_0x189cec));}}return _0x388272(_0x03a2('0x37'));});},'AcceptMessage':function(_0x247de1){var _0x599fe4=this;return new Promise(function(_0x538524,_0x390ca8){if(_0x247de1['agent']&&_0x247de1['agent']['id']){if(_0x196ddc[_0x03a2('0x38')][_0x247de1['agent']['id']]){_0x196ddc[_0x03a2('0x38')][_0x247de1[_0x03a2('0x39')]['id']][_0x03a2('0x3a')]=![];_0x196ddc[_0x03a2('0x38')][_0x247de1[_0x03a2('0x39')]['id']]['busyQueue']=undefined;}}if(_0x247de1[_0x03a2('0x10')]&&_0x247de1[_0x03a2('0x10')]['id']){try{var _0x29f9cc=getId(_0x247de1['channel'],_0x247de1[_0x03a2('0x10')]?_0x247de1[_0x03a2('0x10')]['id']:0x0,_0x247de1[_0x03a2('0x11')]?_0x247de1[_0x03a2('0x11')]['id']:0x0);if(_0x196ddc[_0x03a2('0xf')][_0x29f9cc]){_0x196ddc[_0x03a2('0xf')][_0x29f9cc][_0x03a2('0x3b')](_0x03a2('0x3c'));if(rpc[_0x247de1['channel']+_0x03a2('0x3d')]){rpc[_0x247de1['channel']+_0x03a2('0x3d')][_0x03a2('0x3e')](_0x29f9cc,{'UserId':_0x247de1[_0x03a2('0x10')][_0x03a2('0x3f')]})[_0x03a2('0x40')](function(){logger['error'](_0x03a2('0x41'));});}}return _0x538524({'code':0xc8,'message':_0x247de1});}catch(_0x2113c6){logger[_0x03a2('0x2e')](_0x2113c6[_0x03a2('0x36')]);return _0x390ca8(_0x599fe4[_0x03a2('0x2e')](0x1f4,_0x2113c6));}}logger[_0x03a2('0x2e')]('message\x20is\x20empty');return _0x390ca8(_0x599fe4[_0x03a2('0x2e')](0x1f4,_0x03a2('0x42')));});},'RejectMessage':function(_0x10dc3d){var _0x213e64=this;return new Promise(function(_0xa2952c,_0x465b54){if(_0x10dc3d['agent']&&_0x10dc3d[_0x03a2('0x39')]['id']){try{if(_0x196ddc[_0x03a2('0x38')][_0x10dc3d[_0x03a2('0x39')]['id']]){_0x196ddc[_0x03a2('0x38')][_0x10dc3d[_0x03a2('0x39')]['id']][_0x03a2('0x3a')]=![];_0x196ddc[_0x03a2('0x38')][_0x10dc3d[_0x03a2('0x39')]['id']]['busyQueue']=undefined;}return _0xa2952c({'code':0xc8,'message':_0x10dc3d});}catch(_0x2ad3e7){logger[_0x03a2('0x2e')](_0x2ad3e7['stack']);return _0x465b54(_0x213e64[_0x03a2('0x2e')](0x1f4,_0x2ad3e7));}}logger[_0x03a2('0x2e')](_0x03a2('0x42'));return _0x465b54(_0x213e64['error'](0x1f4,_0x03a2('0x42')));});},'AbandonInteraction':function(_0x497cdd){var _0x3f0d84=this;return new Promise(function(_0x30e62a,_0x1d517f){if(_0x497cdd[_0x03a2('0x43')]&&_0x497cdd[_0x03a2('0x11')]&&_0x497cdd[_0x03a2('0x11')]['id']){try{var _0x253d00=getId(_0x497cdd[_0x03a2('0x43')],_0x497cdd[_0x03a2('0x10')]?_0x497cdd[_0x03a2('0x10')]['id']:0x0,_0x497cdd[_0x03a2('0x11')]?_0x497cdd[_0x03a2('0x11')]['id']:0x0);if(_0x196ddc['rules'][_0x253d00]){_0x196ddc[_0x03a2('0xf')][_0x253d00]['emit'](_0x03a2('0x3c'));}return _0x30e62a({'code':0xc8,'message':_0x497cdd});}catch(_0x4965ab){logger['error'](_0x4965ab['stack']);return _0x1d517f(_0x3f0d84[_0x03a2('0x2e')](0x1f4,_0x4965ab));}}logger['error'](_0x03a2('0x42'));return _0x1d517f(_0x3f0d84[_0x03a2('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x32b644){var _0x4d18c5=this;return new Promise(function(_0x1642e9,_0x5678b1){if(_0x196ddc[_0x03a2('0x38')][_0x03a2('0x44')](_0x32b644['id'])){for(var _0x5dc072 in _0x32b644[_0x03a2('0x45')]){if(_0x32b644[_0x03a2('0x45')][_0x03a2('0x44')](_0x5dc072)){if(_0x196ddc[_0x03a2('0x38')][_0x32b644['id']][_0x03a2('0x44')](_0x5dc072+_0x03a2('0x46'))){_0x196ddc[_0x03a2('0x38')][_0x32b644['id']][_0x5dc072+_0x03a2('0x46')]=parseInt(_0x32b644[_0x03a2('0x45')][_0x5dc072],0xa);}}}_0x196ddc['agents'][_0x32b644['id']][_0x03a2('0x47')]();return _0x1642e9({'code':0xc8,'message':_0x196ddc[_0x03a2('0x38')][_0x32b644['id']]});}else{return _0x5678b1(_0x4d18c5[_0x03a2('0x2e')](0x1f4,_0x03a2('0x48')));}});},'Agents':function(_0x97759){return new Promise(function(_0x477863){var _0x57404f=_[_0x03a2('0x49')](_0x196ddc[_0x03a2('0x38')]);if(_0x97759&&_0x97759['id']){var _0x586615=_['find'](_0x57404f,function(_0x3297e5){return _0x3297e5['id']===_0x97759['id'];});_0x477863(_0x586615);}else{_0x477863({'count':_0x57404f[_0x03a2('0x14')],'rows':_0x57404f});}});},'ChatQueues':function(){return new Promise(function(_0x1c4a04){var _0x36c2dd=[];for(var _0x53549f in _0x196ddc[_0x03a2('0x4a')]){if(_0x196ddc[_0x03a2('0x4a')]['hasOwnProperty'](_0x53549f)){var _0x4135c2=_0x196ddc[_0x03a2('0x4a')][_0x53549f];var _0x1f1579={'id':_0x4135c2['id'],'available':_0x4135c2[_0x03a2('0x4b')],'loggedIn':_0x4135c2['loggedIn'],'name':_0x4135c2['name'],'paused':_0x4135c2[_0x03a2('0x4c')],'waiting':_0x4135c2[_0x03a2('0x4d')]};_0x36c2dd[_0x03a2('0x1c')](_0x1f1579);}}_0x1c4a04({'count':_0x36c2dd[_0x03a2('0x14')],'rows':_0x36c2dd});});},'MailQueues':function(){return new Promise(function(_0x7cb902){var _0x567a80=[];for(var _0x46a901 in _0x196ddc[_0x03a2('0x4e')]){if(_0x196ddc[_0x03a2('0x4e')][_0x03a2('0x44')](_0x46a901)){var _0xf30242=_0x196ddc['mailQueues'][_0x46a901];var _0x5e4985={'id':_0xf30242['id'],'available':_0xf30242[_0x03a2('0x4b')],'loggedIn':_0xf30242[_0x03a2('0x4f')],'name':_0xf30242[_0x03a2('0x50')],'paused':_0xf30242[_0x03a2('0x4c')],'waiting':_0xf30242['waiting']};_0x567a80[_0x03a2('0x1c')](_0x5e4985);}}_0x7cb902({'count':_0x567a80[_0x03a2('0x14')],'rows':_0x567a80});});},'OpenchannelQueues':function(){return new Promise(function(_0x16ccbe){var _0x21d555=[];for(var _0x467c4e in _0x196ddc['openchannelQueues']){if(_0x196ddc[_0x03a2('0x51')][_0x03a2('0x44')](_0x467c4e)){var _0x83d90b=_0x196ddc[_0x03a2('0x51')][_0x467c4e];var _0xd52f49={'id':_0x83d90b['id'],'available':_0x83d90b[_0x03a2('0x4b')],'loggedIn':_0x83d90b[_0x03a2('0x4f')],'name':_0x83d90b[_0x03a2('0x50')],'paused':_0x83d90b[_0x03a2('0x4c')],'waiting':_0x83d90b[_0x03a2('0x4d')]};_0x21d555[_0x03a2('0x1c')](_0xd52f49);}}_0x16ccbe({'count':_0x21d555[_0x03a2('0x14')],'rows':_0x21d555});});},'SmsQueues':function(){return new Promise(function(_0x3538f4){var _0xafd67f=[];for(var _0x4494b0 in _0x196ddc[_0x03a2('0x52')]){if(_0x196ddc[_0x03a2('0x52')]['hasOwnProperty'](_0x4494b0)){var _0xef1077=_0x196ddc['smsQueues'][_0x4494b0];var _0x4a038a={'id':_0xef1077['id'],'available':_0xef1077[_0x03a2('0x4b')],'loggedIn':_0xef1077['loggedIn'],'name':_0xef1077[_0x03a2('0x50')],'paused':_0xef1077[_0x03a2('0x4c')],'waiting':_0xef1077[_0x03a2('0x4d')]};_0xafd67f[_0x03a2('0x1c')](_0x4a038a);}}_0x3538f4({'count':_0xafd67f[_0x03a2('0x14')],'rows':_0xafd67f});});},'FaxQueues':function(){return new Promise(function(_0x1d6ad9){var _0x117c33=[];for(var _0x23742a in _0x196ddc[_0x03a2('0x53')]){if(_0x196ddc[_0x03a2('0x53')][_0x03a2('0x44')](_0x23742a)){var _0x47eb01=_0x196ddc[_0x03a2('0x53')][_0x23742a];var _0x400388={'id':_0x47eb01['id'],'available':_0x47eb01[_0x03a2('0x4b')],'loggedIn':_0x47eb01[_0x03a2('0x4f')],'name':_0x47eb01[_0x03a2('0x50')],'paused':_0x47eb01[_0x03a2('0x4c')],'waiting':_0x47eb01[_0x03a2('0x4d')]};_0x117c33[_0x03a2('0x1c')](_0x400388);}}_0x1d6ad9({'count':_0x117c33['length'],'rows':_0x117c33});});},'WhatsappQueues':function(){return new Promise(function(_0x4aa033){var _0x4d632f=[];for(var _0x1a2593 in _0x196ddc['whatsappQueues']){if(_0x196ddc[_0x03a2('0x54')][_0x03a2('0x44')](_0x1a2593)){var _0x1199dd=_0x196ddc[_0x03a2('0x54')][_0x1a2593];var _0x37b0d7={'id':_0x1199dd['id'],'available':_0x1199dd[_0x03a2('0x4b')],'loggedIn':_0x1199dd[_0x03a2('0x4f')],'name':_0x1199dd['name'],'paused':_0x1199dd[_0x03a2('0x4c')],'waiting':_0x1199dd[_0x03a2('0x4d')]};_0x4d632f['push'](_0x37b0d7);}}_0x4aa033({'count':_0x4d632f[_0x03a2('0x14')],'rows':_0x4d632f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5c964d){var _0x4ca944=_[_0x03a2('0x49')](_0x196ddc[_0x03a2('0x55')]);_0x5c964d({'count':_0x4ca944[_0x03a2('0x14')],'rows':_0x4ca944});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x38ea48){var _0x453d9a=_[_0x03a2('0x49')](_0x196ddc['mailQueuesWaitingInteractions']);_0x38ea48({'count':_0x453d9a[_0x03a2('0x14')],'rows':_0x453d9a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x369e73){var _0x2391f0=_[_0x03a2('0x49')](_0x196ddc['openchannelQueuesWaitingInteractions']);_0x369e73({'count':_0x2391f0[_0x03a2('0x14')],'rows':_0x2391f0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x586f52){var _0x5d9660=_[_0x03a2('0x49')](_0x196ddc[_0x03a2('0x56')]);_0x586f52({'count':_0x5d9660[_0x03a2('0x14')],'rows':_0x5d9660});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2617d0){var _0x580573=_[_0x03a2('0x49')](_0x196ddc[_0x03a2('0x57')]);_0x2617d0({'count':_0x580573[_0x03a2('0x14')],'rows':_0x580573});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1f143d){var _0x47b26c=_[_0x03a2('0x49')](_0x196ddc[_0x03a2('0x58')]);_0x1f143d({'count':_0x47b26c[_0x03a2('0x14')],'rows':_0x47b26c});});}};var _0x50b7aa=jayson[_0x03a2('0x59')](_0x5a8e39)[_0x03a2('0x5a')]();_0x50b7aa['on'](_0x03a2('0x2e'),function(_0x1fc8cb){logger[_0x03a2('0x2e')](JSON[_0x03a2('0x32')](_0x1fc8cb));return _0x19fb1f(_0x1fc8cb);});_0x50b7aa[_0x03a2('0xe')](0x232c,'127.0.0.1',function(){console[_0x03a2('0x5b')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2cefa9(_0x03a2('0x5c')+0x232c);});});}; \ No newline at end of file +var _0xed83=['ChatWebsiteId','body','format','%s:%s:%s','./interval','condition','intervals','./applications/','info','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agents','agent','busy','end','QueueReport','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','name','waiting','mailQueues','loggedIn','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','IntervalId','isNil','map','Intervals','interval','listen','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','channel','push','slice','dialogflow','appdata','amazonlex','tag','getMustacheRender'];(function(_0x195d70,_0xed56eb){var _0x50fc01=function(_0x273291){while(--_0x273291){_0x195d70['push'](_0x195d70['shift']());}};_0x50fc01(++_0xed56eb);}(_0xed83,0x160));var _0x3ed8=function(_0x258647,_0x441dab){_0x258647=_0x258647-0x0;var _0x2046ab=_0xed83[_0x258647];return _0x2046ab;};'use strict';var _=require('lodash');var util=require(_0x3ed8('0x0'));var path=require(_0x3ed8('0x1'));var fs=require('fs');var jayson=require(_0x3ed8('0x2'));var BPromise=require(_0x3ed8('0x3'));var utils=require(_0x3ed8('0x4'));var sUtils=require(_0x3ed8('0x5'));var logger=require(_0x3ed8('0x6'))(_0x3ed8('0x7'));var rpc={'openchannelQueueReport':require(_0x3ed8('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x3ed8('0x9')),'faxQueueReport':require(_0x3ed8('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x3ed8('0xb'));function getId(_0xf91a57,_0x40f21c,_0x3b87d9){return util['format']('%s.%s.%s',_0xf91a57,_0x40f21c||0x0,_0x3b87d9||0x0);}function getIntervals(_0x3939a9,_0x4c8c43){var _0x310698=[];if(!_['isNil'](_0x4c8c43[_0x3ed8('0xc')])&&!_['isNil'](_0x3939a9[_0x4c8c43[_0x3ed8('0xc')]])&&!_[_0x3ed8('0xd')](_0x3939a9[_0x4c8c43[_0x3ed8('0xc')]]['Intervals'])){_0x310698=_[_0x3ed8('0xe')](_0x3939a9[_0x4c8c43[_0x3ed8('0xc')]][_0x3ed8('0xf')],_0x3ed8('0x10'));}else if(!_['isNil'](_0x4c8c43[_0x3ed8('0x10')])){_0x310698=[_0x4c8c43['interval']];}return _0x310698;}exports[_0x3ed8('0x11')]=function(_0x579fdd){_0x579fdd['rules']={};return new BPromise(function(_0x41c024,_0x17b363){var _0x3039c8={'Start':function(_0x18b79a){var _0x405344=this;return new Promise(function(_0x211045,_0x9861b2){if(_0x18b79a){try{var _0x1aad6f=[];var _0xec3388=getId(_0x18b79a['channel'],_0x18b79a[_0x3ed8('0x12')]?_0x18b79a[_0x3ed8('0x12')]['id']:0x0,_0x18b79a[_0x3ed8('0x13')]?_0x18b79a[_0x3ed8('0x13')]['id']:0x0);var _0x3474ef=sUtils[_0x3ed8('0x14')](_0x579fdd,_0x18b79a);if(_0x18b79a[_0x3ed8('0x15')]||!_0x3474ef&&_0x18b79a[_0x3ed8('0x16')]&&_[_0x3ed8('0x17')](_0x18b79a['applications'])&&_0x18b79a[_0x3ed8('0x16')][_0x3ed8('0x18')]){for(var _0x2a106c=0x0;_0x2a106c<_0x18b79a['applications'][_0x3ed8('0x18')];_0x2a106c+=0x1){var _0x3d6344=_0x18b79a['applications'][_0x2a106c];if(fs[_0x3ed8('0x19')](path[_0x3ed8('0x1a')](__dirname,_0x3ed8('0x16'),_0x3d6344[_0x3ed8('0x1b')]+_0x3ed8('0x1c')))){var _0x54bc87=[];switch(_0x3d6344[_0x3ed8('0x1b')][_0x3ed8('0x1d')]()){case _0x3ed8('0x1e'):var _0x5e3262=_0x3d6344['appdata'][_0x3ed8('0x1f')](',');if(_0x18b79a[_0x3ed8('0x20')]==='mail'){_0x54bc87[_0x3ed8('0x21')](_0x5e3262[0x0]);_0x54bc87['push'](_0x5e3262[0x1]);_0x54bc87[_0x3ed8('0x21')](_0x5e3262[_0x3ed8('0x22')](0x2,_0x5e3262['length'])['join'](','));}else{_0x54bc87[_0x3ed8('0x21')](_0x5e3262[0x0]);_0x54bc87['push'](_0x5e3262[_0x3ed8('0x22')](0x1,_0x5e3262[_0x3ed8('0x18')])[_0x3ed8('0x1a')](','));}break;case _0x3ed8('0x23'):var _0x2b0a6f=_0x3d6344[_0x3ed8('0x24')]['split'](',');_0x54bc87[_0x3ed8('0x21')](_0x2b0a6f[0x0]);_0x54bc87[_0x3ed8('0x21')](_0x2b0a6f[0x1]);_0x54bc87[_0x3ed8('0x21')](_0x2b0a6f[_0x3ed8('0x22')](0x2,_0x2b0a6f['length'])[_0x3ed8('0x1a')](','));break;case'dialogflowv2':var _0x4d9906=_0x3d6344[_0x3ed8('0x24')][_0x3ed8('0x1f')](',');_0x54bc87[_0x3ed8('0x21')](_0x4d9906[0x0]);_0x54bc87[_0x3ed8('0x21')](_0x4d9906[0x1]);_0x54bc87[_0x3ed8('0x21')](_0x4d9906[0x2]);_0x54bc87[_0x3ed8('0x21')](_0x4d9906[0x3]);_0x54bc87[_0x3ed8('0x21')](_0x4d9906[_0x3ed8('0x22')](0x4,_0x4d9906['length'])['join'](','));break;case _0x3ed8('0x25'):var _0x1de4fa=_0x3d6344[_0x3ed8('0x24')]['split'](',');_0x54bc87[_0x3ed8('0x21')](_0x1de4fa[0x0]);_0x54bc87['push'](_0x1de4fa[0x1]);_0x54bc87[_0x3ed8('0x21')](_0x1de4fa[0x2]);_0x54bc87[_0x3ed8('0x21')](_0x1de4fa[0x3]);_0x54bc87['push'](_0x1de4fa[_0x3ed8('0x22')](0x4,_0x1de4fa['length'])[_0x3ed8('0x1a')](','));break;case _0x3ed8('0x12'):_0x54bc87[_0x3ed8('0x21')](_0x3d6344[_0x3ed8('0x24')]);break;case _0x3ed8('0x26'):_0x54bc87['push'](_0x3d6344['TagId']);_0x54bc87[_0x3ed8('0x21')](_0x3d6344['appdata']);break;case'tvox':var _0x5b6935=utils[_0x3ed8('0x27')](_0x18b79a['account']['notificationTemplate'],_0x18b79a);var _0x58dbe9=_0x3d6344[_0x3ed8('0x24')][_0x3ed8('0x1f')](',');_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0x0]);_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0x1]);_0x54bc87['push'](_0x58dbe9[0x2]);_0x54bc87['push'](_0x58dbe9[0x3]);_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0x4]);_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0x5]);_0x54bc87['push'](_0x58dbe9[0x6]);_0x54bc87['push'](_0x58dbe9[0x7]);_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0x8]);_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0x9]);_0x54bc87[_0x3ed8('0x21')](_0x58dbe9[0xa]);_0x54bc87[_0x3ed8('0x21')](_0x18b79a[_0x3ed8('0x13')]['id']);_0x54bc87[_0x3ed8('0x21')](_0x18b79a[_0x3ed8('0x12')]['id']);_0x54bc87[_0x3ed8('0x21')](_0x3d6344[_0x3ed8('0x28')]);_0x54bc87[_0x3ed8('0x21')](_0x18b79a[_0x3ed8('0x13')]['ContactId']);_0x54bc87['push'](_0x18b79a[_0x3ed8('0x29')][_0x3ed8('0x29')]);_0x54bc87['push'](_0x5b6935);break;default:_0x54bc87=_[_0x3ed8('0xd')](_0x3d6344[_0x3ed8('0x24')])?[]:_0x3d6344[_0x3ed8('0x24')]['split'](',');}var _0x4b6e43={'id':util[_0x3ed8('0x2a')](_0x3ed8('0x2b'),_0xec3388,_0x3d6344['id'],_0x3d6344['app']),'condition':require(_0x3ed8('0x2c'))[_0x3ed8('0x2d')](_0xec3388,getIntervals(_0x579fdd[_0x3ed8('0x2e')],_0x3d6344),_0x579fdd),'consequence':require(_0x3ed8('0x2f')+_0x3d6344['app'])['consequence'](_0xec3388,_0x54bc87,_0x579fdd,_0x18b79a),'p':_0x3d6344['priority']||0x0};logger[_0x3ed8('0x30')](_0x3ed8('0x31'),_0x4b6e43['id'],'on\x20interval',getIntervals(_0x579fdd[_0x3ed8('0x2e')],_0x3d6344)['join'](_0x3ed8('0x32')));_0x1aad6f[_0x3ed8('0x21')](_0x4b6e43);}else{logger['error'](_0x3ed8('0x33'),path['join'](__dirname,'applications',_0x3d6344[_0x3ed8('0x1b')]+'.js'));}}_0x579fdd['rules'][_0xec3388]=new RuleEngine(_0x1aad6f);_0x579fdd[_0x3ed8('0x34')][_0xec3388][_0x3ed8('0x35')](_0x18b79a,function(_0x10752e){logger[_0x3ed8('0x30')]('Applications\x20executed',JSON['stringify'](_0x10752e[_0x3ed8('0x36')]));if(_0x579fdd[_0x3ed8('0x34')][_0xec3388]){_0x579fdd[_0x3ed8('0x34')][_0xec3388][_0x3ed8('0x37')](_0x3ed8('0x38'));}});return _0x211045({'code':0xc8,'message':_0x18b79a});}else{if(_0x3474ef){logger['info'](util['format'](_0x3ed8('0x39'),_0xec3388));}else{logger[_0x3ed8('0x30')](_0x3ed8('0x3a'));}return _0x211045({'code':0xc8,'message':_0x18b79a});}}catch(_0x525644){logger['error'](_0x525644['stack']);return _0x9861b2(_0x405344[_0x3ed8('0x3b')](0x1f4,_0x525644));}}return _0x9861b2(_0x3ed8('0x3c'));});},'AcceptMessage':function(_0x47d534){var _0x4c9654=this;return new Promise(function(_0x110fa4,_0x329429){if(_0x47d534['agent']&&_0x47d534['agent']['id']){if(_0x579fdd[_0x3ed8('0x3d')][_0x47d534['agent']['id']]){_0x579fdd[_0x3ed8('0x3d')][_0x47d534[_0x3ed8('0x3e')]['id']][_0x3ed8('0x3f')]=![];_0x579fdd[_0x3ed8('0x3d')][_0x47d534[_0x3ed8('0x3e')]['id']]['busyQueue']=undefined;}}if(_0x47d534[_0x3ed8('0x12')]&&_0x47d534[_0x3ed8('0x12')]['id']){try{var _0x5988f9=getId(_0x47d534[_0x3ed8('0x20')],_0x47d534[_0x3ed8('0x12')]?_0x47d534[_0x3ed8('0x12')]['id']:0x0,_0x47d534[_0x3ed8('0x13')]?_0x47d534['interaction']['id']:0x0);if(_0x579fdd[_0x3ed8('0x34')][_0x5988f9]){_0x579fdd[_0x3ed8('0x34')][_0x5988f9][_0x3ed8('0x37')](_0x3ed8('0x40'));if(rpc[_0x47d534[_0x3ed8('0x20')]+_0x3ed8('0x41')]){rpc[_0x47d534[_0x3ed8('0x20')]+_0x3ed8('0x41')]['update'](_0x5988f9,{'UserId':_0x47d534[_0x3ed8('0x12')]['UserId']})[_0x3ed8('0x42')](function(){logger['error'](_0x3ed8('0x43'));});}}return _0x110fa4({'code':0xc8,'message':_0x47d534});}catch(_0xdfb0bd){logger[_0x3ed8('0x3b')](_0xdfb0bd[_0x3ed8('0x44')]);return _0x329429(_0x4c9654[_0x3ed8('0x3b')](0x1f4,_0xdfb0bd));}}logger[_0x3ed8('0x3b')](_0x3ed8('0x45'));return _0x329429(_0x4c9654[_0x3ed8('0x3b')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4d6283){var _0x5b93d8=this;return new Promise(function(_0x188bac,_0x364e14){if(_0x4d6283[_0x3ed8('0x3e')]&&_0x4d6283[_0x3ed8('0x3e')]['id']){try{if(_0x579fdd['agents'][_0x4d6283[_0x3ed8('0x3e')]['id']]){_0x579fdd[_0x3ed8('0x3d')][_0x4d6283[_0x3ed8('0x3e')]['id']][_0x3ed8('0x3f')]=![];_0x579fdd[_0x3ed8('0x3d')][_0x4d6283[_0x3ed8('0x3e')]['id']][_0x3ed8('0x46')]=undefined;}return _0x188bac({'code':0xc8,'message':_0x4d6283});}catch(_0x4984ac){logger[_0x3ed8('0x3b')](_0x4984ac['stack']);return _0x364e14(_0x5b93d8[_0x3ed8('0x3b')](0x1f4,_0x4984ac));}}logger['error'](_0x3ed8('0x45'));return _0x364e14(_0x5b93d8[_0x3ed8('0x3b')](0x1f4,_0x3ed8('0x45')));});},'AbandonInteraction':function(_0xc2e92a){var _0x4bf8a3=this;return new Promise(function(_0x144642,_0xceae2){if(_0xc2e92a[_0x3ed8('0x20')]&&_0xc2e92a['interaction']&&_0xc2e92a[_0x3ed8('0x13')]['id']){try{var _0x43ccf0=getId(_0xc2e92a[_0x3ed8('0x20')],_0xc2e92a[_0x3ed8('0x12')]?_0xc2e92a['message']['id']:0x0,_0xc2e92a[_0x3ed8('0x13')]?_0xc2e92a[_0x3ed8('0x13')]['id']:0x0);if(_0x579fdd[_0x3ed8('0x34')][_0x43ccf0]){_0x579fdd['rules'][_0x43ccf0][_0x3ed8('0x37')](_0x3ed8('0x40'));}return _0x144642({'code':0xc8,'message':_0xc2e92a});}catch(_0x186694){logger['error'](_0x186694[_0x3ed8('0x44')]);return _0xceae2(_0x4bf8a3['error'](0x1f4,_0x186694));}}logger[_0x3ed8('0x3b')](_0x3ed8('0x45'));return _0xceae2(_0x4bf8a3[_0x3ed8('0x3b')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4c44ad){var _0x49d70a=this;return new Promise(function(_0x3c8763,_0x514864){if(_0x579fdd['agents']['hasOwnProperty'](_0x4c44ad['id'])){for(var _0x59a635 in _0x4c44ad['capacity']){if(_0x4c44ad[_0x3ed8('0x47')][_0x3ed8('0x48')](_0x59a635)){if(_0x579fdd['agents'][_0x4c44ad['id']][_0x3ed8('0x48')](_0x59a635+_0x3ed8('0x49'))){_0x579fdd[_0x3ed8('0x3d')][_0x4c44ad['id']][_0x59a635+_0x3ed8('0x49')]=parseInt(_0x4c44ad[_0x3ed8('0x47')][_0x59a635],0xa);}}}_0x579fdd[_0x3ed8('0x3d')][_0x4c44ad['id']][_0x3ed8('0x4a')]();return _0x3c8763({'code':0xc8,'message':_0x579fdd[_0x3ed8('0x3d')][_0x4c44ad['id']]});}else{return _0x514864(_0x49d70a['error'](0x1f4,_0x3ed8('0x4b')));}});},'Agents':function(_0x4ecc76){return new Promise(function(_0x3019e3){var _0x463b33=_['values'](_0x579fdd[_0x3ed8('0x3d')]);if(_0x4ecc76&&_0x4ecc76['id']){var _0x597f45=_[_0x3ed8('0x4c')](_0x463b33,function(_0x261bf7){return _0x261bf7['id']===_0x4ecc76['id'];});_0x3019e3(_0x597f45);}else{_0x3019e3({'count':_0x463b33[_0x3ed8('0x18')],'rows':_0x463b33});}});},'ChatQueues':function(){return new Promise(function(_0x5534da){var _0x52ca3a=[];for(var _0x969d2c in _0x579fdd['chatQueues']){if(_0x579fdd[_0x3ed8('0x4d')][_0x3ed8('0x48')](_0x969d2c)){var _0x5d08fd=_0x579fdd[_0x3ed8('0x4d')][_0x969d2c];var _0x39e110={'id':_0x5d08fd['id'],'available':_0x5d08fd[_0x3ed8('0x4e')],'loggedIn':_0x5d08fd['loggedIn'],'name':_0x5d08fd[_0x3ed8('0x4f')],'paused':_0x5d08fd['paused'],'waiting':_0x5d08fd[_0x3ed8('0x50')]};_0x52ca3a[_0x3ed8('0x21')](_0x39e110);}}_0x5534da({'count':_0x52ca3a[_0x3ed8('0x18')],'rows':_0x52ca3a});});},'MailQueues':function(){return new Promise(function(_0x1dc555){var _0x2733f0=[];for(var _0x4201f1 in _0x579fdd[_0x3ed8('0x51')]){if(_0x579fdd[_0x3ed8('0x51')]['hasOwnProperty'](_0x4201f1)){var _0x4a04f7=_0x579fdd['mailQueues'][_0x4201f1];var _0x5667b5={'id':_0x4a04f7['id'],'available':_0x4a04f7[_0x3ed8('0x4e')],'loggedIn':_0x4a04f7[_0x3ed8('0x52')],'name':_0x4a04f7[_0x3ed8('0x4f')],'paused':_0x4a04f7['paused'],'waiting':_0x4a04f7[_0x3ed8('0x50')]};_0x2733f0['push'](_0x5667b5);}}_0x1dc555({'count':_0x2733f0[_0x3ed8('0x18')],'rows':_0x2733f0});});},'OpenchannelQueues':function(){return new Promise(function(_0x3c2ea1){var _0x5c914b=[];for(var _0x269ac3 in _0x579fdd[_0x3ed8('0x53')]){if(_0x579fdd[_0x3ed8('0x53')]['hasOwnProperty'](_0x269ac3)){var _0x1575f8=_0x579fdd[_0x3ed8('0x53')][_0x269ac3];var _0x45dbbd={'id':_0x1575f8['id'],'available':_0x1575f8[_0x3ed8('0x4e')],'loggedIn':_0x1575f8[_0x3ed8('0x52')],'name':_0x1575f8[_0x3ed8('0x4f')],'paused':_0x1575f8[_0x3ed8('0x54')],'waiting':_0x1575f8[_0x3ed8('0x50')]};_0x5c914b['push'](_0x45dbbd);}}_0x3c2ea1({'count':_0x5c914b[_0x3ed8('0x18')],'rows':_0x5c914b});});},'SmsQueues':function(){return new Promise(function(_0x45d7b5){var _0x3d9665=[];for(var _0x5817e0 in _0x579fdd[_0x3ed8('0x55')]){if(_0x579fdd[_0x3ed8('0x55')][_0x3ed8('0x48')](_0x5817e0)){var _0x511d1f=_0x579fdd[_0x3ed8('0x55')][_0x5817e0];var _0x33c273={'id':_0x511d1f['id'],'available':_0x511d1f[_0x3ed8('0x4e')],'loggedIn':_0x511d1f['loggedIn'],'name':_0x511d1f[_0x3ed8('0x4f')],'paused':_0x511d1f['paused'],'waiting':_0x511d1f[_0x3ed8('0x50')]};_0x3d9665[_0x3ed8('0x21')](_0x33c273);}}_0x45d7b5({'count':_0x3d9665[_0x3ed8('0x18')],'rows':_0x3d9665});});},'FaxQueues':function(){return new Promise(function(_0x25b651){var _0x173504=[];for(var _0x42fea5 in _0x579fdd[_0x3ed8('0x56')]){if(_0x579fdd['faxQueues'][_0x3ed8('0x48')](_0x42fea5)){var _0x505946=_0x579fdd[_0x3ed8('0x56')][_0x42fea5];var _0x28f323={'id':_0x505946['id'],'available':_0x505946[_0x3ed8('0x4e')],'loggedIn':_0x505946['loggedIn'],'name':_0x505946[_0x3ed8('0x4f')],'paused':_0x505946[_0x3ed8('0x54')],'waiting':_0x505946[_0x3ed8('0x50')]};_0x173504[_0x3ed8('0x21')](_0x28f323);}}_0x25b651({'count':_0x173504[_0x3ed8('0x18')],'rows':_0x173504});});},'WhatsappQueues':function(){return new Promise(function(_0xf6d285){var _0x2416b8=[];for(var _0x5b8afd in _0x579fdd[_0x3ed8('0x57')]){if(_0x579fdd[_0x3ed8('0x57')][_0x3ed8('0x48')](_0x5b8afd)){var _0x44359f=_0x579fdd['whatsappQueues'][_0x5b8afd];var _0x2d74f0={'id':_0x44359f['id'],'available':_0x44359f[_0x3ed8('0x4e')],'loggedIn':_0x44359f[_0x3ed8('0x52')],'name':_0x44359f[_0x3ed8('0x4f')],'paused':_0x44359f[_0x3ed8('0x54')],'waiting':_0x44359f[_0x3ed8('0x50')]};_0x2416b8[_0x3ed8('0x21')](_0x2d74f0);}}_0xf6d285({'count':_0x2416b8[_0x3ed8('0x18')],'rows':_0x2416b8});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x10d601){var _0xb3697c=_[_0x3ed8('0x58')](_0x579fdd['chatQueuesWaitingInteractions']);_0x10d601({'count':_0xb3697c[_0x3ed8('0x18')],'rows':_0xb3697c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x59fe8d){var _0x2e04f0=_[_0x3ed8('0x58')](_0x579fdd[_0x3ed8('0x59')]);_0x59fe8d({'count':_0x2e04f0[_0x3ed8('0x18')],'rows':_0x2e04f0});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4a6b2d){var _0x290ebc=_[_0x3ed8('0x58')](_0x579fdd[_0x3ed8('0x5a')]);_0x4a6b2d({'count':_0x290ebc[_0x3ed8('0x18')],'rows':_0x290ebc});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5cd01e){var _0x232ce3=_[_0x3ed8('0x58')](_0x579fdd['smsQueuesWaitingInteractions']);_0x5cd01e({'count':_0x232ce3[_0x3ed8('0x18')],'rows':_0x232ce3});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4549bd){var _0x2e9a7a=_[_0x3ed8('0x58')](_0x579fdd[_0x3ed8('0x5b')]);_0x4549bd({'count':_0x2e9a7a[_0x3ed8('0x18')],'rows':_0x2e9a7a});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5630c8){var _0x547c01=_[_0x3ed8('0x58')](_0x579fdd['whatsappQueuesWaitingInteractions']);_0x5630c8({'count':_0x547c01[_0x3ed8('0x18')],'rows':_0x547c01});});}};var _0x5d8fcc=jayson[_0x3ed8('0x5c')](_0x3039c8)[_0x3ed8('0x5d')]();_0x5d8fcc['on'](_0x3ed8('0x3b'),function(_0x42fbc6){logger['error'](JSON[_0x3ed8('0x5e')](_0x42fbc6));return _0x17b363(_0x42fbc6);});_0x5d8fcc[_0x3ed8('0x11')](0x232c,_0x3ed8('0x5f'),function(){console['log'](_0x3ed8('0x60'),0x232c);return _0x41c024(_0x3ed8('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 2de73ac..b1141f9 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 _0x4077=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','lodash','../../../utils/iftime','iftime','../../../config/logger','routing'];(function(_0x1d1918,_0x9b060b){var _0x40242b=function(_0x357e6d){while(--_0x357e6d){_0x1d1918['push'](_0x1d1918['shift']());}};_0x40242b(++_0x9b060b);}(_0x4077,0x11b));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7407('0x0'));var iftime=require(_0x7407('0x1'))[_0x7407('0x2')];var logger=require(_0x7407('0x3'))(_0x7407('0x4'));exports[_0x7407('0x5')]=function(_0x3c8226,_0x2c48a4,_0x215e4e){return function(_0x35dea5){if(_0x215e4e['rules']&&!_0x215e4e[_0x7407('0x6')][_0x3c8226]){logger[_0x7407('0x7')](_0x7407('0x8'),_0x3c8226);return _0x35dea5[_0x7407('0x9')]();}var _0x1b1ad9=_0x2c48a4[_0x7407('0xa')](function(_0x310608){return iftime(_0x310608);});var _0x43c465=_[_0x7407('0xb')](_0x1b1ad9);if(_0x43c465){logger[_0x7407('0x7')](_0x7407('0xc'),_0x3c8226,_0x2c48a4[_0x7407('0xd')](_0x7407('0xe')),_0x43c465);_0x35dea5[_0x7407('0xf')](_0x43c465);}else{logger[_0x7407('0x7')]('[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s',_0x3c8226,_0x2c48a4[_0x7407('0xd')](_0x7407('0xe')));_0x35dea5[_0x7407('0x9')]();}};}; \ No newline at end of file +var _0xea55=['map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x392890,_0xb8d3dd){var _0x2b2e30=function(_0x4b355f){while(--_0x4b355f){_0x392890['push'](_0x392890['shift']());}};_0x2b2e30(++_0xb8d3dd);}(_0xea55,0x7e));var _0x5ea5=function(_0x1eb05b,_0x3294fb){_0x1eb05b=_0x1eb05b-0x0;var _0x5617cd=_0xea55[_0x1eb05b];return _0x5617cd;};'use strict';var _=require(_0x5ea5('0x0'));var iftime=require(_0x5ea5('0x1'))[_0x5ea5('0x2')];var logger=require(_0x5ea5('0x3'))(_0x5ea5('0x4'));exports[_0x5ea5('0x5')]=function(_0x499109,_0x679335,_0x4eb7a5){return function(_0xda9f8){if(_0x4eb7a5[_0x5ea5('0x6')]&&!_0x4eb7a5[_0x5ea5('0x6')][_0x499109]){logger[_0x5ea5('0x7')](_0x5ea5('0x8'),_0x499109);return _0xda9f8[_0x5ea5('0x9')]();}var _0x27dc8a=_0x679335[_0x5ea5('0xa')](function(_0x4ab73e){return iftime(_0x4ab73e);});var _0x311f3a=_[_0x5ea5('0xb')](_0x27dc8a);if(_0x311f3a){logger[_0x5ea5('0x7')](_0x5ea5('0xc'),_0x499109,_0x679335[_0x5ea5('0xd')](_0x5ea5('0xe')),_0x311f3a);_0xda9f8[_0x5ea5('0xf')](_0x311f3a);}else{logger['info'](_0x5ea5('0x10'),_0x499109,_0x679335['join'](_0x5ea5('0xe')));_0xda9f8[_0x5ea5('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 03dd00e..a3cc8df 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 _0xd4f4=['holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transfertype','transferexten','origtransfererexten','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','isNil','ATTENDED','transfertargetuniqueid','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','error','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','membername','agentringnoanswer','agentringnoanswerAt','reason','timeout'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x315956,_0x4fab00){_0x315956=_0x315956-0x0;var _0x190c2a=_0xd4f4[_0x315956];return _0x190c2a;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var utils=require(_0x4d4f('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3c9311,_0x2fc384){utils[_0x4d4f('0x3')](util[_0x4d4f('0x4')](_0x4d4f('0x5'),_0x3c9311[_0x4d4f('0x6')],_0x3c9311[_0x4d4f('0x7')],_0x3c9311[_0x4d4f('0x8')],_0x3c9311['membername'],_0x3c9311['interface'],_0x3c9311['calleridnum'],_0x3c9311[_0x4d4f('0x9')],_0x3c9311[_0x4d4f('0xa')]));if(_0x3c9311[_0x4d4f('0x8')]){utils[_0x4d4f('0xb')](_0x3c9311[_0x4d4f('0x8')])[_0x4d4f('0xc')](function(_0x1bd887){if(_0x1bd887){_0x3c9311[_0x4d4f('0xd')]=_0x1bd887[_0x4d4f('0xd')];_0x3c9311[_0x4d4f('0xe')]=_0x3c9311[_0x4d4f('0xf')]?_0x1bd887[_0x4d4f('0x10')]:![];_0x3c9311[_0x4d4f('0x11')]=_0x3c9311[_0x4d4f('0xe')]?_0x1bd887[_0x4d4f('0x12')]:0x0;}utils[_0x4d4f('0x13')](_0x4d4f('0x14'),_0x3c9311);});}else{utils[_0x4d4f('0x13')]('CreateVoiceAgentReport',_0x3c9311);}if(_0x2fc384){delete transfers[_0x3c9311['uniqueid']];}else{delete agents[_0x3c9311['destuniqueid']];}}exports[_0x4d4f('0x15')]=function(_0xe9b7a6){try{utils['debug'](util[_0x4d4f('0x4')](_0x4d4f('0x16'),_0xe9b7a6[_0x4d4f('0x6')]),_0xe9b7a6);agents[_0xe9b7a6['destuniqueid']]=_0xe9b7a6;agents[_0xe9b7a6[_0x4d4f('0x17')]][_0x4d4f('0x18')]=utils[_0x4d4f('0x19')]();agents[_0xe9b7a6['destuniqueid']][_0x4d4f('0xa')]='called';agents[_0xe9b7a6[_0x4d4f('0x17')]][_0x4d4f('0x9')]=null;agents[_0xe9b7a6[_0x4d4f('0x17')]]['connectedlinename']=null;utils[_0x4d4f('0x3')](util[_0x4d4f('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0xe9b7a6['uniqueid'],agents[_0xe9b7a6['destuniqueid']]['membername'],_0xe9b7a6['destuniqueid']));}catch(_0x34429e){utils[_0x4d4f('0x1a')](util[_0x4d4f('0x4')](_0x4d4f('0x16'),_0xe9b7a6['uniqueid']),_0x34429e);}};exports['agentringnoanswer']=function(_0x1e1ae2){try{if(!_['isNil'](agents[_0x1e1ae2[_0x4d4f('0x17')]])){utils[_0x4d4f('0x1b')](util[_0x4d4f('0x4')](_0x4d4f('0x1c'),_0x1e1ae2[_0x4d4f('0x6')]),_0x1e1ae2);utils['info'](util['format'](_0x4d4f('0x1d'),_0x1e1ae2['uniqueid'],agents[_0x1e1ae2[_0x4d4f('0x17')]][_0x4d4f('0x1e')],_0x1e1ae2[_0x4d4f('0x17')]));agents[_0x1e1ae2[_0x4d4f('0x17')]][_0x4d4f('0x1f')]=!![];agents[_0x1e1ae2['destuniqueid']][_0x4d4f('0x20')]=utils[_0x4d4f('0x19')]();agents[_0x1e1ae2[_0x4d4f('0x17')]][_0x4d4f('0xa')]='timeout';agents[_0x1e1ae2['destuniqueid']][_0x4d4f('0x21')]=_0x4d4f('0x22');agents[_0x1e1ae2[_0x4d4f('0x17')]][_0x4d4f('0x23')]=_0x1e1ae2['ringtime']?parseInt(_0x1e1ae2[_0x4d4f('0x24')])/0x3e8:0x0;agents[_0x1e1ae2[_0x4d4f('0x17')]][_0x4d4f('0x25')]=0x0;unanswered[_0x4d4f('0x26')](_0x1e1ae2['destuniqueid']);}}catch(_0x338ba2){utils['error'](util[_0x4d4f('0x4')](_0x4d4f('0x1c'),_0x1e1ae2['uniqueid']),_0x338ba2);}};exports[_0x4d4f('0x27')]=function(_0x123383){try{_[_0x4d4f('0x28')](agents,function(_0x3d7f14,_0x19a502){if(_0x3d7f14[_0x4d4f('0x6')]==_0x123383['uniqueid']&&!_[_0x4d4f('0x29')](unanswered,_0x3d7f14[_0x4d4f('0x17')])){utils[_0x4d4f('0x1b')](util[_0x4d4f('0x4')](_0x4d4f('0x2a'),_0x123383['uniqueid']),_0x123383);utils[_0x4d4f('0x3')](util['format'](_0x4d4f('0x2b'),_0x123383['uniqueid'],_0x3d7f14['membername'],_0x3d7f14['destuniqueid']));_0x3d7f14[_0x4d4f('0x1f')]=!![];_0x3d7f14['agentringnoanswerAt']=utils[_0x4d4f('0x19')]();_0x3d7f14[_0x4d4f('0xa')]=_0x4d4f('0x2c');_0x3d7f14['reason']=_0x4d4f('0x2c');_0x3d7f14[_0x4d4f('0x23')]=_0x123383[_0x4d4f('0x23')];_0x3d7f14['talktime']=0x0;writeDB(_0x3d7f14);}});}catch(_0x6a30c4){utils['error'](util[_0x4d4f('0x4')](_0x4d4f('0x2a'),_0x123383[_0x4d4f('0x6')]),_0x6a30c4);}};exports[_0x4d4f('0x2d')]=function(_0x2448f3){try{if(agents[_0x2448f3[_0x4d4f('0x17')]]){utils[_0x4d4f('0x1b')](util[_0x4d4f('0x4')]('[%s][agents][agentconnect]',_0x2448f3['uniqueid']),_0x2448f3);utils[_0x4d4f('0x3')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2448f3[_0x4d4f('0x6')],agents[_0x2448f3[_0x4d4f('0x17')]][_0x4d4f('0x1e')],_0x2448f3[_0x4d4f('0x17')]));agents[_0x2448f3[_0x4d4f('0x17')]]['agentconnectAt']=utils[_0x4d4f('0x19')]();agents[_0x2448f3[_0x4d4f('0x17')]]['connectedlinenum']=_0x2448f3[_0x4d4f('0x9')];agents[_0x2448f3[_0x4d4f('0x17')]][_0x4d4f('0x2e')]=_0x2448f3[_0x4d4f('0x2e')];agents[_0x2448f3[_0x4d4f('0x17')]][_0x4d4f('0x23')]=_0x2448f3[_0x4d4f('0x24')];agents[_0x2448f3[_0x4d4f('0x17')]][_0x4d4f('0xa')]='connect';_['forIn'](agents,function(_0x1cb919,_0x324a3c){if(_0x1cb919[_0x4d4f('0x17')]!=_0x2448f3[_0x4d4f('0x17')]&&_0x1cb919['uniqueid']==_0x2448f3['uniqueid']){_0x1cb919[_0x4d4f('0x25')]=0x0;_0x1cb919[_0x4d4f('0x23')]=_0x2448f3['ringtime'];_0x1cb919['agentringnoanswer']=!![];_0x1cb919[_0x4d4f('0x20')]=utils[_0x4d4f('0x19')]();_0x1cb919['lastevent']=_0x4d4f('0x2f');_0x1cb919[_0x4d4f('0x21')]=_0x4d4f('0x2f');_0x1cb919[_0x4d4f('0x30')]=_0x2448f3[_0x4d4f('0x17')];_0x1cb919['answeredelsewheremembername']=_0x2448f3[_0x4d4f('0x1e')];writeDB(_0x1cb919);}});}}catch(_0x4c7c24){utils[_0x4d4f('0x1a')](util[_0x4d4f('0x4')]('[%s][agents][agentconnect]',_0x2448f3[_0x4d4f('0x6')]),_0x4c7c24);}};exports[_0x4d4f('0xf')]=function(_0x1f7169){try{if(!_['isNil'](agents[_0x1f7169[_0x4d4f('0x17')]])){utils['debug'](util[_0x4d4f('0x4')]('[%s][agents][agentcomplete]',_0x1f7169[_0x4d4f('0x6')]),_0x1f7169);utils[_0x4d4f('0x3')](util[_0x4d4f('0x4')](_0x4d4f('0x31'),_0x1f7169[_0x4d4f('0x6')],agents[_0x1f7169['destuniqueid']]['membername'],_0x1f7169[_0x4d4f('0x17')]));agents[_0x1f7169[_0x4d4f('0x17')]][_0x4d4f('0xf')]=!![];agents[_0x1f7169[_0x4d4f('0x17')]]['agentcompleteAt']=utils['now']();agents[_0x1f7169['destuniqueid']][_0x4d4f('0x25')]=utils[_0x4d4f('0x32')](agents[_0x1f7169[_0x4d4f('0x17')]][_0x4d4f('0x33')],agents[_0x1f7169[_0x4d4f('0x17')]][_0x4d4f('0x34')]);agents[_0x1f7169[_0x4d4f('0x17')]][_0x4d4f('0x21')]=_0x1f7169[_0x4d4f('0x21')];agents[_0x1f7169[_0x4d4f('0x17')]][_0x4d4f('0xa')]=_0x4d4f('0x35');writeDB(agents[_0x1f7169['destuniqueid']]);}}catch(_0xb0937d){utils[_0x4d4f('0x1a')](util['format'](_0x4d4f('0x36'),_0x1f7169['uniqueid']),_0xb0937d);}};exports[_0x4d4f('0x37')]=function(_0x401466){try{if(!_['isNil'](agents[_0x401466[_0x4d4f('0x38')]])){utils[_0x4d4f('0x1b')](util[_0x4d4f('0x4')](_0x4d4f('0x39'),_0x401466[_0x4d4f('0x6')]),_0x401466);utils[_0x4d4f('0x3')](util[_0x4d4f('0x4')](_0x4d4f('0x3a'),_0x401466[_0x4d4f('0x6')],agents[_0x401466[_0x4d4f('0x38')]][_0x4d4f('0x1e')],agents[_0x401466[_0x4d4f('0x38')]]['uniqueid']));agents[_0x401466[_0x4d4f('0x38')]]['transfer']=!![];agents[_0x401466['transfereruniqueid']]['transfertype']=_0x4d4f('0x3b');agents[_0x401466[_0x4d4f('0x38')]]['transferexten']=_0x401466['extension'];agents[_0x401466[_0x4d4f('0x38')]][_0x4d4f('0x3c')]=agents[_0x401466['transfereruniqueid']][_0x4d4f('0x6')];}}catch(_0x528573){utils[_0x4d4f('0x1a')](util[_0x4d4f('0x4')](_0x4d4f('0x39'),_0x401466[_0x4d4f('0x6')]),_0x528573);}};exports['attendedtransfer']=function(_0x224b83){try{utils[_0x4d4f('0x1b')](util[_0x4d4f('0x4')](_0x4d4f('0x3d'),_0x224b83[_0x4d4f('0x3e')]),_0x224b83);if(_0x224b83['origtransfereruniqueid']==_0x224b83[_0x4d4f('0x3f')]){if(!_['isNil'](agents[_0x224b83[_0x4d4f('0x40')]])){utils['info'](util[_0x4d4f('0x4')](_0x4d4f('0x41'),_0x224b83['origtransfereruniqueid'],agents[_0x224b83[_0x4d4f('0x40')]][_0x4d4f('0x1e')]));agents[_0x224b83['secondtransfereruniqueid']][_0x4d4f('0x42')]=!![];agents[_0x224b83['secondtransfereruniqueid']][_0x4d4f('0x43')]='ATTENDED';agents[_0x224b83['secondtransfereruniqueid']][_0x4d4f('0x44')]=_0x224b83[_0x4d4f('0x45')];agents[_0x224b83[_0x4d4f('0x40')]][_0x4d4f('0x3c')]=_0x224b83[_0x4d4f('0x3e')];}if(_0x224b83['transfereeuniqueid']&&agents[_0x224b83['transfereeuniqueid']]){agents[_0x224b83[_0x4d4f('0x46')]]['agententerreason']=0x1;transfers[_0x224b83[_0x4d4f('0x46')]]=_[_0x4d4f('0x47')](agents[_0x224b83[_0x4d4f('0x46')]]);transfers[_0x224b83[_0x4d4f('0x46')]][_0x4d4f('0x48')]=agents[_0x224b83[_0x4d4f('0x40')]]['calleridnum'];transfers[_0x224b83[_0x4d4f('0x46')]][_0x4d4f('0x49')]=agents[_0x224b83[_0x4d4f('0x40')]]['calleridname'];transfers[_0x224b83[_0x4d4f('0x46')]][_0x4d4f('0x18')]=utils[_0x4d4f('0x19')]();transfers[_0x224b83['transfereeuniqueid']][_0x4d4f('0x34')]=utils['now']();transfers[_0x224b83[_0x4d4f('0x46')]][_0x4d4f('0x23')]=0x0;transfers[_0x224b83[_0x4d4f('0x46')]][_0x4d4f('0x4a')]=0x2;}}else if(_0x224b83[_0x4d4f('0x40')]==_0x224b83[_0x4d4f('0x4b')]){if(!_[_0x4d4f('0x4c')](agents[_0x224b83[_0x4d4f('0x3e')]])){utils[_0x4d4f('0x3')](util['format'](_0x4d4f('0x41'),_0x224b83[_0x4d4f('0x3e')],agents[_0x224b83['origtransfereruniqueid']][_0x4d4f('0x1e')]));agents[_0x224b83[_0x4d4f('0x3e')]][_0x4d4f('0x42')]=!![];agents[_0x224b83[_0x4d4f('0x3e')]]['transfertype']=_0x4d4f('0x4d');agents[_0x224b83[_0x4d4f('0x3e')]]['transferexten']=_0x224b83['secondtransfererexten'];agents[_0x224b83[_0x4d4f('0x3e')]][_0x4d4f('0x3c')]=_0x224b83['secondtransfereruniqueid'];}if(_0x224b83['transfertargetuniqueid']&&agents[_0x224b83['transfertargetuniqueid']]){agents[_0x224b83[_0x4d4f('0x4e')]][_0x4d4f('0x4a')]=0x1;transfers[_0x224b83['transfertargetuniqueid']]=_[_0x4d4f('0x47')](agents[_0x224b83[_0x4d4f('0x4e')]]);transfers[_0x224b83[_0x4d4f('0x4e')]][_0x4d4f('0x48')]=agents[_0x224b83[_0x4d4f('0x3e')]][_0x4d4f('0x48')];transfers[_0x224b83[_0x4d4f('0x4e')]][_0x4d4f('0x49')]=agents[_0x224b83['origtransfereruniqueid']][_0x4d4f('0x49')];transfers[_0x224b83['transfertargetuniqueid']][_0x4d4f('0x18')]=utils[_0x4d4f('0x19')]();transfers[_0x224b83[_0x4d4f('0x4e')]]['agentconnectAt']=utils[_0x4d4f('0x19')]();transfers[_0x224b83[_0x4d4f('0x4e')]][_0x4d4f('0x23')]=0x0;transfers[_0x224b83[_0x4d4f('0x4e')]]['agententerreason']=0x2;}}}catch(_0x4184fa){utils['error'](util[_0x4d4f('0x4')]('[%s][agents][attendedtransfer]',_0x224b83['origtransfereruniqueid']),_0x4184fa);}};exports[_0x4d4f('0x4f')]=function(_0x2d99e4){try{utils['debug'](util[_0x4d4f('0x4')]('[%s][agents][hangup]',_0x2d99e4[_0x4d4f('0x6')]),_0x2d99e4);if(agents[_0x2d99e4[_0x4d4f('0x6')]]&&agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x21')]==='timeout'){if(_0x2d99e4[_0x4d4f('0x50')]==='21'){agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x21')]='rejected';agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0xa')]=_0x4d4f('0x51');}utils[_0x4d4f('0x3')](util[_0x4d4f('0x4')](_0x4d4f('0x52'),_0x2d99e4['uniqueid'],agents[_0x2d99e4['uniqueid']][_0x4d4f('0x1e')],agents[_0x2d99e4[_0x4d4f('0x6')]]['reason'],agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0xa')]));writeDB(agents[_0x2d99e4[_0x4d4f('0x6')]]);var _0x133fc5=unanswered[_0x4d4f('0x53')](_0x2d99e4[_0x4d4f('0x6')]);if(_0x133fc5>-0x1){unanswered[_0x4d4f('0x54')](_0x133fc5,0x1);}}if(transfers[_0x2d99e4[_0x4d4f('0x6')]]){transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0xf')]=!![];transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x33')]=utils[_0x4d4f('0x19')]();transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x25')]=utils['diffTime'](transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x33')],transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x34')]);transfers[_0x2d99e4['uniqueid']]['reason']=_0x4d4f('0x55');transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0xa')]=_0x4d4f('0x35');utils[_0x4d4f('0x3')](util[_0x4d4f('0x4')](_0x4d4f('0x52'),_0x2d99e4[_0x4d4f('0x6')],transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x1e')],transfers[_0x2d99e4['uniqueid']][_0x4d4f('0x21')],transfers[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0xa')]));writeDB(transfers[_0x2d99e4[_0x4d4f('0x6')]],!![]);}if(agents[_0x2d99e4['uniqueid']]&&agents[_0x2d99e4['uniqueid']]['agentconnectAt']){agents[_0x2d99e4[_0x4d4f('0x6')]]['agentcomplete']=!![];agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x33')]=utils[_0x4d4f('0x19')]();agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x25')]=utils[_0x4d4f('0x32')](agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x33')],agents[_0x2d99e4['uniqueid']]['agentconnectAt']);agents[_0x2d99e4[_0x4d4f('0x6')]]['reason']=agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x42')]?_0x4d4f('0x42'):'agent';agents[_0x2d99e4['uniqueid']]['lastevent']=_0x4d4f('0x35');utils['info'](util[_0x4d4f('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2d99e4[_0x4d4f('0x6')],agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x1e')],agents[_0x2d99e4[_0x4d4f('0x6')]][_0x4d4f('0x21')],agents[_0x2d99e4[_0x4d4f('0x6')]]['lastevent']));writeDB(agents[_0x2d99e4[_0x4d4f('0x6')]]);}}catch(_0x3beacf){utils[_0x4d4f('0x1a')](util[_0x4d4f('0x4')](_0x4d4f('0x56'),_0x2d99e4['uniqueid']),_0x3beacf);}}; \ No newline at end of file +var _0x4ded=['agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','diffTime'];(function(_0xf524e5,_0x58ab3a){var _0x410f21=function(_0x48f537){while(--_0x48f537){_0xf524e5['push'](_0xf524e5['shift']());}};_0x410f21(++_0x58ab3a);}(_0x4ded,0x116));var _0xd4de=function(_0x21f037,_0x5dacaf){_0x21f037=_0x21f037-0x0;var _0xf35169=_0x4ded[_0x21f037];return _0xf35169;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var utils=require(_0xd4de('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fa334,_0x2349f5){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x5'),_0x1fa334[_0xd4de('0x6')],_0x1fa334[_0xd4de('0x7')],_0x1fa334[_0xd4de('0x8')],_0x1fa334[_0xd4de('0x9')],_0x1fa334['interface'],_0x1fa334[_0xd4de('0xa')],_0x1fa334[_0xd4de('0xb')],_0x1fa334[_0xd4de('0xc')]));if(_0x1fa334[_0xd4de('0x8')]){utils[_0xd4de('0xd')](_0x1fa334[_0xd4de('0x8')])['then'](function(_0xb7e8cf){if(_0xb7e8cf){_0x1fa334['type']=_0xb7e8cf['type'];_0x1fa334['agentacw']=_0x1fa334[_0xd4de('0xe')]?_0xb7e8cf[_0xd4de('0xf')]:![];_0x1fa334['acwtime']=_0x1fa334['agentacw']?_0xb7e8cf['acwTimeout']:0x0;}utils[_0xd4de('0x10')]('CreateVoiceAgentReport',_0x1fa334);});}else{utils[_0xd4de('0x10')](_0xd4de('0x11'),_0x1fa334);}if(_0x2349f5){delete transfers[_0x1fa334[_0xd4de('0x6')]];}else{delete agents[_0x1fa334[_0xd4de('0x12')]];}}exports[_0xd4de('0x13')]=function(_0x3af6e0){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x15'),_0x3af6e0[_0xd4de('0x6')]),_0x3af6e0);agents[_0x3af6e0[_0xd4de('0x12')]]=_0x3af6e0;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x16')]=utils[_0xd4de('0x17')]();agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x18');agents[_0x3af6e0['destuniqueid']]['connectedlinenum']=null;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x19')]=null;utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3af6e0['uniqueid'],agents[_0x3af6e0[_0xd4de('0x12')]]['membername'],_0x3af6e0[_0xd4de('0x12')]));}catch(_0x29c028){utils['error'](util[_0xd4de('0x4')]('[%s][agents][agentcalled]',_0x3af6e0[_0xd4de('0x6')]),_0x29c028);}};exports[_0xd4de('0x1a')]=function(_0x2bad14){try{if(!_[_0xd4de('0x1b')](agents[_0x2bad14['destuniqueid']])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x2bad14);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x1d'),_0x2bad14[_0xd4de('0x6')],agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x9')],_0x2bad14['destuniqueid']));agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1a')]=!![];agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1e')]=utils[_0xd4de('0x17')]();agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x20')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]]['holdtime']=_0x2bad14[_0xd4de('0x21')]?parseInt(_0x2bad14[_0xd4de('0x21')])/0x3e8:0x0;agents[_0x2bad14['destuniqueid']][_0xd4de('0x22')]=0x0;unanswered['push'](_0x2bad14[_0xd4de('0x12')]);}}catch(_0x32e407){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x32e407);}};exports[_0xd4de('0x24')]=function(_0x50cb73){try{_[_0xd4de('0x25')](agents,function(_0x1804c7,_0x55f9f9){if(_0x1804c7['uniqueid']==_0x50cb73['uniqueid']&&!_[_0xd4de('0x26')](unanswered,_0x1804c7['destuniqueid'])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x50cb73);utils['info'](util[_0xd4de('0x4')](_0xd4de('0x28'),_0x50cb73['uniqueid'],_0x1804c7[_0xd4de('0x9')],_0x1804c7[_0xd4de('0x12')]));_0x1804c7['agentringnoanswer']=!![];_0x1804c7['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x1804c7[_0xd4de('0xc')]=_0xd4de('0x29');_0x1804c7[_0xd4de('0x20')]='abandoned';_0x1804c7[_0xd4de('0x2a')]=_0x50cb73[_0xd4de('0x2a')];_0x1804c7['talktime']=0x0;writeDB(_0x1804c7);}});}catch(_0x329d49){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x329d49);}};exports[_0xd4de('0x2b')]=function(_0x53441c){try{if(agents[_0x53441c['destuniqueid']]){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c['uniqueid']),_0x53441c);utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x53441c[_0xd4de('0x6')],agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x9')],_0x53441c[_0xd4de('0x12')]));agents[_0x53441c['destuniqueid']]['agentconnectAt']=utils[_0xd4de('0x17')]();agents[_0x53441c['destuniqueid']][_0xd4de('0xb')]=_0x53441c['connectedlinenum'];agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x19')]=_0x53441c[_0xd4de('0x19')];agents[_0x53441c[_0xd4de('0x12')]]['holdtime']=_0x53441c[_0xd4de('0x21')];agents[_0x53441c['destuniqueid']][_0xd4de('0xc')]=_0xd4de('0x2d');_[_0xd4de('0x25')](agents,function(_0x4517a6,_0x349c5f){if(_0x4517a6[_0xd4de('0x12')]!=_0x53441c[_0xd4de('0x12')]&&_0x4517a6['uniqueid']==_0x53441c[_0xd4de('0x6')]){_0x4517a6[_0xd4de('0x22')]=0x0;_0x4517a6[_0xd4de('0x2a')]=_0x53441c[_0xd4de('0x21')];_0x4517a6[_0xd4de('0x1a')]=!![];_0x4517a6['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x4517a6[_0xd4de('0xc')]=_0xd4de('0x2e');_0x4517a6['reason']=_0xd4de('0x2e');_0x4517a6[_0xd4de('0x2f')]=_0x53441c[_0xd4de('0x12')];_0x4517a6['answeredelsewheremembername']=_0x53441c[_0xd4de('0x9')];writeDB(_0x4517a6);}});}}catch(_0x10a42c){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c[_0xd4de('0x6')]),_0x10a42c);}};exports[_0xd4de('0xe')]=function(_0x5ecbbd){try{if(!_[_0xd4de('0x1b')](agents[_0x5ecbbd[_0xd4de('0x12')]])){utils[_0xd4de('0x14')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0x5ecbbd);utils[_0xd4de('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5ecbbd[_0xd4de('0x6')],agents[_0x5ecbbd[_0xd4de('0x12')]]['membername'],_0x5ecbbd[_0xd4de('0x12')]));agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xe')]=!![];agents[_0x5ecbbd[_0xd4de('0x12')]]['agentcompleteAt']=utils[_0xd4de('0x17')]();agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x32')],agents[_0x5ecbbd['destuniqueid']][_0xd4de('0x33')]);agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x20')]=_0x5ecbbd[_0xd4de('0x20')];agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x34');writeDB(agents[_0x5ecbbd[_0xd4de('0x12')]]);}}catch(_0xaf442c){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0xaf442c);}};exports[_0xd4de('0x35')]=function(_0x518bfe){try{if(!_[_0xd4de('0x1b')](agents[_0x518bfe[_0xd4de('0x36')]])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x518bfe);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x38'),_0x518bfe[_0xd4de('0x6')],agents[_0x518bfe['transfereruniqueid']][_0xd4de('0x9')],agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')]));agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x39')]=!![];agents[_0x518bfe['transfereruniqueid']]['transfertype']=_0xd4de('0x3a');agents[_0x518bfe[_0xd4de('0x36')]]['transferexten']=_0x518bfe['extension'];agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x3b')]=agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')];}}catch(_0x34d772){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x34d772);}};exports[_0xd4de('0x3c')]=function(_0x3be8c2){try{utils[_0xd4de('0x14')](util['format'](_0xd4de('0x3d'),_0x3be8c2[_0xd4de('0x3e')]),_0x3be8c2);if(_0x3be8c2[_0xd4de('0x3e')]==_0x3be8c2[_0xd4de('0x3f')]){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x40')]])){utils['info'](util[_0xd4de('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3be8c2['origtransfereruniqueid'],agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x9')]));agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x39')]=!![];agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x44')];agents[_0x3be8c2['secondtransfereruniqueid']]['transferuniqueid']=_0x3be8c2['origtransfereruniqueid'];}if(_0x3be8c2[_0xd4de('0x45')]&&agents[_0x3be8c2[_0xd4de('0x45')]]){agents[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2['transfereeuniqueid']]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x45')]]);transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0xa')]=agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x40')]]['calleridname'];transfers[_0x3be8c2['transfereeuniqueid']]['agentcalledAt']=utils[_0xd4de('0x17')]();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x33')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x45')]]['agententerreason']=0x2;}}else if(_0x3be8c2[_0xd4de('0x40')]==_0x3be8c2['secondtransfererlinkedid']){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x3e')]])){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x49'),_0x3be8c2[_0xd4de('0x3e')],agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x9')]));agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x39')]=!![];agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x4a')];agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x3b')]=_0x3be8c2[_0xd4de('0x40')];}if(_0x3be8c2[_0xd4de('0x4b')]&&agents[_0x3be8c2[_0xd4de('0x4b')]]){agents[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2[_0xd4de('0x4b')]]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x4b')]]);transfers[_0x3be8c2[_0xd4de('0x4b')]]['calleridnum']=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x48')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x16')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x3be8c2['transfertargetuniqueid']][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x4b')]]['agententerreason']=0x2;}}}catch(_0x4a06b2){utils['error'](util['format'](_0xd4de('0x3d'),_0x3be8c2['origtransfereruniqueid']),_0x4a06b2);}};exports[_0xd4de('0x4c')]=function(_0x5ddba5){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5['uniqueid']),_0x5ddba5);if(agents[_0x5ddba5['uniqueid']]&&agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')]===_0xd4de('0x1f')){if(_0x5ddba5[_0xd4de('0x4d')]==='21'){agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=_0xd4de('0x4e');agents[_0x5ddba5['uniqueid']]['lastevent']='rejected';}utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x9')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]]['lastevent']));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);var _0x5a4882=unanswered[_0xd4de('0x4f')](_0x5ddba5[_0xd4de('0x6')]);if(_0x5a4882>-0x1){unanswered[_0xd4de('0x50')](_0x5a4882,0x1);}}if(transfers[_0x5ddba5[_0xd4de('0x6')]]){transfers[_0x5ddba5['uniqueid']][_0xd4de('0xe')]=!![];transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')]=utils[_0xd4de('0x17')]();transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]='agent';transfers[_0x5ddba5[_0xd4de('0x6')]]['lastevent']='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],transfers[_0x5ddba5[_0xd4de('0x6')]]['reason'],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(transfers[_0x5ddba5[_0xd4de('0x6')]],!![]);}if(agents[_0x5ddba5[_0xd4de('0x6')]]&&agents[_0x5ddba5[_0xd4de('0x6')]]['agentconnectAt']){agents[_0x5ddba5['uniqueid']]['agentcomplete']=!![];agents[_0x5ddba5['uniqueid']][_0xd4de('0x32')]=utils['now']();agents[_0x5ddba5[_0xd4de('0x6')]]['talktime']=utils[_0xd4de('0x31')](agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=agents[_0x5ddba5[_0xd4de('0x6')]]['transfer']?_0xd4de('0x39'):_0xd4de('0x51');agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);}}catch(_0x27fd09){utils[_0xd4de('0x23')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5[_0xd4de('0x6')]),_0x27fd09);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 6bbac3e..9f7f707 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 _0x5dc0=['[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','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','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','lastIndexOf','includes','hangup','noop','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate'];(function(_0x1dcada,_0x32741a){var _0x18eda4=function(_0x466c19){while(--_0x466c19){_0x1dcada['push'](_0x1dcada['shift']());}};_0x18eda4(++_0x32741a);}(_0x5dc0,0x11f));var _0x05dc=function(_0x2a7737,_0x5f289e){_0x2a7737=_0x2a7737-0x0;var _0x861978=_0x5dc0[_0x2a7737];return _0x861978;};'use strict';var _=require(_0x05dc('0x0'));var util=require(_0x05dc('0x1'));var utils=require(_0x05dc('0x2'));var dispositions=[_0x05dc('0x3'),_0x05dc('0x4'),_0x05dc('0x4'),_0x05dc('0x3'),_0x05dc('0x3'),'NO\x20ANSWER',_0x05dc('0x5'),_0x05dc('0x6'),_0x05dc('0x4'),_0x05dc('0x4'),_0x05dc('0x4')];var channels={};function writeDB(_0x42411f){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x9'),_0x42411f['uniqueid'],_0x42411f[_0x05dc('0xa')],_0x42411f[_0x05dc('0xb')],_0x42411f[_0x05dc('0xc')],_0x42411f[_0x05dc('0xd')],_0x42411f[_0x05dc('0xe')],_0x42411f['connectedlinenum'],_0x42411f[_0x05dc('0xf')]));if(_0x42411f[_0x05dc('0x10')]){utils[_0x05dc('0x11')](_0x42411f['accountcode'])[_0x05dc('0x12')](function(_0x1f62d2){if(_0x1f62d2){_0x42411f[_0x05dc('0x13')]=_0x1f62d2['id'];}utils[_0x05dc('0x14')](_0x05dc('0x15'),_0x42411f);});}else{utils[_0x05dc('0x14')](_0x05dc('0x15'),_0x42411f);}if(channels[_0x42411f[_0x05dc('0x16')]]){delete channels[_0x42411f[_0x05dc('0x16')]];}}exports[_0x05dc('0x17')]=function(_0x2038ef){try{utils[_0x05dc('0x18')](util[_0x05dc('0x8')](_0x05dc('0x19'),_0x2038ef['uniqueid']),_0x2038ef);if(_0x2038ef[_0x05dc('0x16')]==_0x2038ef[_0x05dc('0x1a')]&&_0x2038ef[_0x05dc('0xa')]!=_0x05dc('0x1b')){utils['info'](util['format'](_0x05dc('0x1c'),_0x2038ef['uniqueid'],_0x2038ef[_0x05dc('0x1d')],_0x2038ef[_0x05dc('0x1e')]));channels[_0x2038ef[_0x05dc('0x16')]]={'uniqueid':_0x2038ef[_0x05dc('0x16')],'accountcode':_0x2038ef['accountcode'],'source':_0x2038ef[_0x05dc('0xe')],'destination':_0x2038ef[_0x05dc('0x1e')],'destinationcontext':_0x2038ef['context'],'channel':_0x2038ef['channel'],'starttime':utils[_0x05dc('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x05dc('0x3'),'amaflags':_0x05dc('0x20')};}}catch(_0x589700){utils['error'](util[_0x05dc('0x8')](_0x05dc('0x19'),_0x2038ef['uniqueid']),_0x589700);}};exports[_0x05dc('0x21')]=function(_0x10b819){try{utils[_0x05dc('0x18')](util[_0x05dc('0x8')](_0x05dc('0x22'),_0x10b819[_0x05dc('0x16')]),_0x10b819);if(!_[_0x05dc('0x23')](channels[_0x10b819[_0x05dc('0x16')]])&&_0x10b819[_0x05dc('0x24')]==0x6){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x25'),_0x10b819[_0x05dc('0x16')],_0x10b819['context'],_0x10b819[_0x05dc('0xa')]));if(_[_0x05dc('0x23')](channels[_0x10b819['uniqueid']]['systemanswertime'])){channels[_0x10b819['uniqueid']][_0x05dc('0x26')]=utils['now']();}}else if(!_[_0x05dc('0x23')](channels[_0x10b819['linkedid']])&&_0x10b819[_0x05dc('0x24')]==0x6&&_0x10b819[_0x05dc('0x1d')]!=_0x05dc('0x27')){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x28'),_0x10b819['uniqueid'],_0x10b819['linkedid'],_0x10b819[_0x05dc('0x1d')],_0x10b819['channel']));channels[_0x10b819[_0x05dc('0x1a')]][_0x05dc('0x10')]=_0x10b819[_0x05dc('0x10')];channels[_0x10b819[_0x05dc('0x1a')]]['destinationchannel']=_0x10b819[_0x05dc('0xa')];if(_['isNil'](channels[_0x10b819[_0x05dc('0x1a')]][_0x05dc('0x29')])){channels[_0x10b819[_0x05dc('0x1a')]][_0x05dc('0x29')]=utils[_0x05dc('0x1f')]();}channels[_0x10b819[_0x05dc('0x1a')]][_0x05dc('0x2a')]=dispositions[_[_0x05dc('0x2b')](_0x10b819[_0x05dc('0x24')])]||_0x05dc('0x5');}}catch(_0x2616c5){utils[_0x05dc('0x2c')](util[_0x05dc('0x8')](_0x05dc('0x22'),_0x10b819[_0x05dc('0x16')]),_0x2616c5);}};exports['hangup']=function(_0x1b1c96){try{if(!_[_0x05dc('0x23')](channels[_0x1b1c96[_0x05dc('0x16')]])){utils[_0x05dc('0x18')](util[_0x05dc('0x8')](_0x05dc('0x2d'),_0x1b1c96[_0x05dc('0x16')]),_0x1b1c96);if(_[_0x05dc('0x23')](channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x2e')])){channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x2e')]=_0x1b1c96[_0x05dc('0x2f')]+'\x20<'+_0x1b1c96[_0x05dc('0xe')]+'>';}utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x30'),_0x1b1c96[_0x05dc('0x16')],channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x2e')],_0x1b1c96[_0x05dc('0x31')]));channels[_0x1b1c96['uniqueid']][_0x05dc('0x32')]=utils[_0x05dc('0x1f')]();channels[_0x1b1c96[_0x05dc('0x16')]]['duration']=utils['diffTime'](channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x32')],channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x33')]);channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x34')]=channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x29')]?utils[_0x05dc('0x35')](channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x32')],channels[_0x1b1c96[_0x05dc('0x16')]][_0x05dc('0x29')]):0x0;writeDB(channels[_0x1b1c96[_0x05dc('0x16')]]);}}catch(_0x5ba32d){utils[_0x05dc('0x2c')](util['format'](_0x05dc('0x2d'),_0x1b1c96[_0x05dc('0x16')]),_0x5ba32d);}};exports[_0x05dc('0x36')]=function(_0x2432eb){try{if(!_[_0x05dc('0x23')](channels[_0x2432eb[_0x05dc('0x37')]])){utils[_0x05dc('0x18')](util[_0x05dc('0x8')](_0x05dc('0x38'),_0x2432eb['origtransfereruniqueid']),_0x2432eb);if(channels[_0x2432eb[_0x05dc('0x37')]][_0x05dc('0xa')]==_0x2432eb[_0x05dc('0x39')]){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x3a'),_0x2432eb['origtransfereruniqueid'],_0x2432eb[_0x05dc('0x37')],_0x2432eb[_0x05dc('0x3b')]));channels[_0x2432eb[_0x05dc('0x37')]][_0x05dc('0x3c')]=_0x2432eb[_0x05dc('0x3b')];channels[_0x2432eb[_0x05dc('0x37')]][_0x05dc('0x3d')]=_0x05dc('0x3e');}else if(channels[_0x2432eb[_0x05dc('0x37')]][_0x05dc('0xa')]=_0x2432eb['transfertargetchannel']){utils['info'](util[_0x05dc('0x8')](_0x05dc('0x3a'),_0x2432eb['origtransfereruniqueid'],_0x2432eb['localtwolinkedid'],_0x2432eb[_0x05dc('0x3f')]));channels[_0x2432eb[_0x05dc('0x37')]][_0x05dc('0x3c')]=_0x2432eb[_0x05dc('0x3f')];channels[_0x2432eb[_0x05dc('0x37')]]['userfield']=_0x05dc('0x3e');}}}catch(_0x17057d){utils[_0x05dc('0x2c')](util['format']('[%s][calls][attendedtransfer]',_0x2432eb['origtransfereruniqueid']),_0x17057d);}};exports[_0x05dc('0x40')]=function(_0x436a7e){try{if(!_[_0x05dc('0x23')](channels[_0x436a7e['uniqueid']])){utils[_0x05dc('0x18')](util[_0x05dc('0x8')](_0x05dc('0x41'),_0x436a7e[_0x05dc('0x16')]),_0x436a7e);channels[_0x436a7e['uniqueid']][_0x05dc('0x42')]=utils[_0x05dc('0x1f')]();utils['info'](util[_0x05dc('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x436a7e[_0x05dc('0x16')],channels[_0x436a7e['uniqueid']]['musiconholdstartAt']));}}catch(_0x3d4d78){utils[_0x05dc('0x2c')](util[_0x05dc('0x8')](_0x05dc('0x41'),_0x436a7e['uniqueid']),_0x3d4d78);}};exports['musiconholdstop']=function(_0x200017){try{if(!_[_0x05dc('0x23')](channels[_0x200017[_0x05dc('0x16')]])){utils[_0x05dc('0x18')](util['format']('[%s][calls][musiconholdstop]',_0x200017['uniqueid']),_0x200017);if(!_[_0x05dc('0x23')](channels[_0x200017[_0x05dc('0x16')]][_0x05dc('0x42')])){channels[_0x200017[_0x05dc('0x16')]][_0x05dc('0x43')]+=utils['diffTime'](utils[_0x05dc('0x1f')](),channels[_0x200017[_0x05dc('0x16')]][_0x05dc('0x42')]);utils[_0x05dc('0x7')](util['format'](_0x05dc('0x44'),_0x200017[_0x05dc('0x16')],channels[_0x200017[_0x05dc('0x16')]]['mohtime']));delete channels[_0x200017[_0x05dc('0x16')]][_0x05dc('0x42')];}}}catch(_0x508a1d){utils[_0x05dc('0x2c')](util[_0x05dc('0x8')](_0x05dc('0x45'),_0x200017[_0x05dc('0x16')]),_0x508a1d);}};exports[_0x05dc('0x46')]=function(_0x4819c3){try{if(!_[_0x05dc('0x23')](channels[_0x4819c3[_0x05dc('0x16')]])){utils['debug'](util['format'](_0x05dc('0x47'),_0x4819c3[_0x05dc('0x16')]),_0x4819c3);if(!_[_0x05dc('0x23')](_0x4819c3['variable'][_0x05dc('0x48')])){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x49'),_0x4819c3['uniqueid'],_0x4819c3[_0x05dc('0x4a')]));channels[_0x4819c3['uniqueid']]['source']=_0x4819c3['value'];}if(!_['isNil'](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x4c')])){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x4d'),_0x4819c3[_0x05dc('0x16')],_0x4819c3[_0x05dc('0x4a')]));channels[_0x4819c3[_0x05dc('0x16')]][_0x05dc('0x4e')]=_0x4819c3[_0x05dc('0x4a')];channels[_0x4819c3[_0x05dc('0x16')]][_0x05dc('0x2e')]='\x22'+_0x4819c3[_0x05dc('0x4a')]+_0x05dc('0x4f')+_0x4819c3[_0x05dc('0x4a')]+'>';}if(!_['isNil'](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x50')])||!_[_0x05dc('0x23')](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x51')])){utils[_0x05dc('0x7')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4819c3[_0x05dc('0x16')],!_['isNil'](_0x4819c3['variable'][_0x05dc('0x50')])?_0x05dc('0x50'):'xmd-callerid',_0x4819c3['value']));channels[_0x4819c3[_0x05dc('0x16')]][_0x05dc('0x2e')]=_0x4819c3[_0x05dc('0x4a')];}if(!_[_0x05dc('0x23')](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x52')])||!_[_0x05dc('0x23')](_0x4819c3[_0x05dc('0x4b')]['xmcs-queue'])){utils[_0x05dc('0x7')](util['format'](_0x05dc('0x53'),_0x4819c3[_0x05dc('0x16')],!_[_0x05dc('0x23')](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x52')])?_0x05dc('0x52'):_0x05dc('0x54'),_0x4819c3['value']));channels[_0x4819c3[_0x05dc('0x16')]]['lastapplication']=_0x05dc('0x55');channels[_0x4819c3['uniqueid']][_0x05dc('0x56')]=_0x4819c3[_0x05dc('0x4a')];channels[_0x4819c3['uniqueid']][_0x05dc('0xb')]=!![];}if(!_['isNil'](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x57')])){utils['info'](util[_0x05dc('0x8')](_0x05dc('0x58'),_0x4819c3[_0x05dc('0x16')],_0x4819c3[_0x05dc('0x4a')]));channels[_0x4819c3['uniqueid']][_0x05dc('0x59')]=_0x4819c3[_0x05dc('0x4a')];}if(!_[_0x05dc('0x23')](_0x4819c3[_0x05dc('0x4b')]['xmd-cdrtype'])){utils[_0x05dc('0x7')](util[_0x05dc('0x8')](_0x05dc('0x5a'),_0x4819c3['uniqueid'],_0x4819c3['value']));channels[_0x4819c3[_0x05dc('0x16')]][_0x05dc('0x5b')]=_0x4819c3[_0x05dc('0x4a')];}if(!_[_0x05dc('0x23')](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x5c')])){utils[_0x05dc('0x7')](util['format'](_0x05dc('0x5d'),_0x4819c3[_0x05dc('0x16')],_0x4819c3['value']));channels[_0x4819c3['uniqueid']][_0x05dc('0x5e')]=_0x4819c3[_0x05dc('0x4a')];}if(!_['isNil'](_0x4819c3[_0x05dc('0x4b')][_0x05dc('0x5f')])){utils[_0x05dc('0x7')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4819c3[_0x05dc('0x16')],_0x4819c3[_0x05dc('0x4a')]));channels[_0x4819c3['uniqueid']][_0x05dc('0x5f')]=_0x4819c3['value'];}}}catch(_0x3cc7ac){utils[_0x05dc('0x2c')](util['format'](_0x05dc('0x47'),_0x4819c3[_0x05dc('0x16')]),_0x3cc7ac);}};exports[_0x05dc('0x60')]=function(_0x5b2e41){try{if(!_[_0x05dc('0x23')](channels[_0x5b2e41['uniqueid']])){utils['debug'](util[_0x05dc('0x8')]('[%s][calls][newexten]',_0x5b2e41[_0x05dc('0x16')]),_0x5b2e41);utils[_0x05dc('0x7')](util['format'](_0x05dc('0x61'),_0x5b2e41[_0x05dc('0x16')],_0x5b2e41[_0x05dc('0x62')],_0x5b2e41['appdata']));if(_0x5b2e41[_0x05dc('0x62')][_0x05dc('0x63')]()==_0x05dc('0x64')&&_[_0x05dc('0x65')](_0x5b2e41[_0x05dc('0x66')]['toLowerCase'](),_0x05dc('0x67'))){var _0x50eb13=_0x5b2e41[_0x05dc('0x66')]['split']('=');var _0x1f1809=_0x50eb13[0x0]['substring'](_0x50eb13[0x0][_0x05dc('0x68')]('(')+0x1,_0x50eb13[0x0][_0x05dc('0x68')](')'));var _0x2921fd=_0x50eb13[0x1];channels[_0x5b2e41[_0x05dc('0x16')]][_0x1f1809]=_0x2921fd;}if(!_[_0x05dc('0x69')]([_0x05dc('0x6a'),_0x05dc('0x6b'),'execif',_0x05dc('0x64'),'gotoif'],_0x5b2e41[_0x05dc('0x62')][_0x05dc('0x63')]())){channels[_0x5b2e41['uniqueid']]['lastapplication']=_0x5b2e41[_0x05dc('0x62')];channels[_0x5b2e41[_0x05dc('0x16')]][_0x05dc('0x56')]=_0x5b2e41[_0x05dc('0x66')];}}}catch(_0x47cbdc){utils[_0x05dc('0x2c')](util['format']('[%s][calls][newexten]',_0x5b2e41['uniqueid']),_0x47cbdc);}}; \ No newline at end of file +var _0x427b=['cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','localtwolinkedid','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','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]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','execif','[%s][calls][newexten]','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','now','DOCUMENTATION','error','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid'];(function(_0x52f6f3,_0x2680ac){var _0x1e0b07=function(_0x3ac4b9){while(--_0x3ac4b9){_0x52f6f3['push'](_0x52f6f3['shift']());}};_0x1e0b07(++_0x2680ac);}(_0x427b,0x18f));var _0xb427=function(_0x268f82,_0x5944f2){_0x268f82=_0x268f82-0x0;var _0x4e01f0=_0x427b[_0x268f82];return _0x4e01f0;};'use strict';var _=require('lodash');var util=require(_0xb427('0x0'));var utils=require(_0xb427('0x1'));var dispositions=[_0xb427('0x2'),_0xb427('0x3'),'FAILED','NO\x20ANSWER',_0xb427('0x2'),_0xb427('0x2'),_0xb427('0x4'),_0xb427('0x5'),_0xb427('0x3'),_0xb427('0x3'),_0xb427('0x3')];var channels={};function writeDB(_0xf8f183){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x8'),_0xf8f183[_0xb427('0x9')],_0xf8f183[_0xb427('0xa')],_0xf8f183['queue'],_0xf8f183[_0xb427('0xb')],_0xf8f183[_0xb427('0xc')],_0xf8f183['calleridnum'],_0xf8f183['connectedlinenum'],_0xf8f183[_0xb427('0xd')]));if(_0xf8f183[_0xb427('0xe')]){utils[_0xb427('0xf')](_0xf8f183[_0xb427('0xe')])[_0xb427('0x10')](function(_0x181f29){if(_0x181f29){_0xf8f183[_0xb427('0x11')]=_0x181f29['id'];}utils[_0xb427('0x12')](_0xb427('0x13'),_0xf8f183);});}else{utils[_0xb427('0x12')]('CreateVoiceCallReport',_0xf8f183);}if(channels[_0xf8f183['uniqueid']]){delete channels[_0xf8f183['uniqueid']];}}exports[_0xb427('0x14')]=function(_0x1a6f75){try{utils[_0xb427('0x15')](util[_0xb427('0x7')](_0xb427('0x16'),_0x1a6f75[_0xb427('0x9')]),_0x1a6f75);if(_0x1a6f75[_0xb427('0x9')]==_0x1a6f75['linkedid']&&_0x1a6f75[_0xb427('0xa')]!=_0xb427('0x17')){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x18'),_0x1a6f75[_0xb427('0x9')],_0x1a6f75[_0xb427('0x19')],_0x1a6f75['exten']));channels[_0x1a6f75[_0xb427('0x9')]]={'uniqueid':_0x1a6f75[_0xb427('0x9')],'accountcode':_0x1a6f75[_0xb427('0xe')],'source':_0x1a6f75[_0xb427('0x1a')],'destination':_0x1a6f75[_0xb427('0x1b')],'destinationcontext':_0x1a6f75['context'],'channel':_0x1a6f75[_0xb427('0xa')],'starttime':utils[_0xb427('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb427('0x2'),'amaflags':_0xb427('0x1d')};}}catch(_0x5da8cf){utils[_0xb427('0x1e')](util[_0xb427('0x7')]('[%s][calls][newchannel]',_0x1a6f75['uniqueid']),_0x5da8cf);}};exports['newstate']=function(_0x3bb291){try{utils[_0xb427('0x15')](util['format']('[%s][calls][newstate]',_0x3bb291[_0xb427('0x9')]),_0x3bb291);if(!_[_0xb427('0x1f')](channels[_0x3bb291[_0xb427('0x9')]])&&_0x3bb291[_0xb427('0x20')]==0x6){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x21'),_0x3bb291[_0xb427('0x9')],_0x3bb291[_0xb427('0x19')],_0x3bb291[_0xb427('0xa')]));if(_[_0xb427('0x1f')](channels[_0x3bb291[_0xb427('0x9')]]['systemanswertime'])){channels[_0x3bb291[_0xb427('0x9')]][_0xb427('0x22')]=utils[_0xb427('0x1c')]();}}else if(!_[_0xb427('0x1f')](channels[_0x3bb291[_0xb427('0x23')]])&&_0x3bb291[_0xb427('0x20')]==0x6&&_0x3bb291[_0xb427('0x19')]!=_0xb427('0x24')){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x25'),_0x3bb291[_0xb427('0x9')],_0x3bb291[_0xb427('0x23')],_0x3bb291[_0xb427('0x19')],_0x3bb291['channel']));channels[_0x3bb291[_0xb427('0x23')]][_0xb427('0xe')]=_0x3bb291[_0xb427('0xe')];channels[_0x3bb291[_0xb427('0x23')]][_0xb427('0x26')]=_0x3bb291['channel'];if(_[_0xb427('0x1f')](channels[_0x3bb291[_0xb427('0x23')]][_0xb427('0x27')])){channels[_0x3bb291[_0xb427('0x23')]][_0xb427('0x27')]=utils['now']();}channels[_0x3bb291[_0xb427('0x23')]][_0xb427('0x28')]=dispositions[_['toNumber'](_0x3bb291[_0xb427('0x20')])]||_0xb427('0x4');}}catch(_0x1f5a3f){utils[_0xb427('0x1e')](util[_0xb427('0x7')](_0xb427('0x29'),_0x3bb291['uniqueid']),_0x1f5a3f);}};exports[_0xb427('0x2a')]=function(_0x1cd91f){try{if(!_[_0xb427('0x1f')](channels[_0x1cd91f[_0xb427('0x9')]])){utils['debug'](util[_0xb427('0x7')](_0xb427('0x2b'),_0x1cd91f[_0xb427('0x9')]),_0x1cd91f);if(_[_0xb427('0x1f')](channels[_0x1cd91f['uniqueid']][_0xb427('0x2c')])){channels[_0x1cd91f[_0xb427('0x9')]][_0xb427('0x2c')]=_0x1cd91f['calleridname']+'\x20<'+_0x1cd91f[_0xb427('0x1a')]+'>';}utils[_0xb427('0x6')](util[_0xb427('0x7')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x1cd91f[_0xb427('0x9')],channels[_0x1cd91f['uniqueid']][_0xb427('0x2c')],_0x1cd91f[_0xb427('0x2d')]));channels[_0x1cd91f[_0xb427('0x9')]][_0xb427('0x2e')]=utils['now']();channels[_0x1cd91f[_0xb427('0x9')]][_0xb427('0x2f')]=utils['diffTime'](channels[_0x1cd91f['uniqueid']][_0xb427('0x2e')],channels[_0x1cd91f['uniqueid']][_0xb427('0x30')]);channels[_0x1cd91f[_0xb427('0x9')]][_0xb427('0x31')]=channels[_0x1cd91f[_0xb427('0x9')]][_0xb427('0x27')]?utils[_0xb427('0x32')](channels[_0x1cd91f[_0xb427('0x9')]][_0xb427('0x2e')],channels[_0x1cd91f['uniqueid']][_0xb427('0x27')]):0x0;writeDB(channels[_0x1cd91f['uniqueid']]);}}catch(_0x5c3f5b){utils[_0xb427('0x1e')](util[_0xb427('0x7')]('[%s][calls][hangup]',_0x1cd91f[_0xb427('0x9')]),_0x5c3f5b);}};exports[_0xb427('0x33')]=function(_0x4c0a56){try{if(!_[_0xb427('0x1f')](channels[_0x4c0a56['localtwolinkedid']])){utils[_0xb427('0x15')](util[_0xb427('0x7')](_0xb427('0x34'),_0x4c0a56[_0xb427('0x35')]),_0x4c0a56);if(channels[_0x4c0a56['localtwolinkedid']][_0xb427('0xa')]==_0x4c0a56[_0xb427('0x36')]){utils['info'](util['format'](_0xb427('0x37'),_0x4c0a56[_0xb427('0x35')],_0x4c0a56['localtwolinkedid'],_0x4c0a56[_0xb427('0x38')]));channels[_0x4c0a56['localtwolinkedid']][_0xb427('0x26')]=_0x4c0a56[_0xb427('0x38')];channels[_0x4c0a56[_0xb427('0x39')]][_0xb427('0x3a')]=_0xb427('0x3b');}else if(channels[_0x4c0a56['localtwolinkedid']]['channel']=_0x4c0a56[_0xb427('0x3c')]){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x37'),_0x4c0a56[_0xb427('0x35')],_0x4c0a56[_0xb427('0x39')],_0x4c0a56[_0xb427('0x3d')]));channels[_0x4c0a56['localtwolinkedid']]['destinationchannel']=_0x4c0a56[_0xb427('0x3d')];channels[_0x4c0a56[_0xb427('0x39')]][_0xb427('0x3a')]=_0xb427('0x3b');}}}catch(_0xb015c2){utils[_0xb427('0x1e')](util['format'](_0xb427('0x34'),_0x4c0a56[_0xb427('0x35')]),_0xb015c2);}};exports['musiconholdstart']=function(_0x10872f){try{if(!_[_0xb427('0x1f')](channels[_0x10872f[_0xb427('0x9')]])){utils[_0xb427('0x15')](util[_0xb427('0x7')](_0xb427('0x3e'),_0x10872f[_0xb427('0x9')]),_0x10872f);channels[_0x10872f[_0xb427('0x9')]][_0xb427('0x3f')]=utils['now']();utils['info'](util['format'](_0xb427('0x40'),_0x10872f[_0xb427('0x9')],channels[_0x10872f[_0xb427('0x9')]][_0xb427('0x3f')]));}}catch(_0x20d15b){utils[_0xb427('0x1e')](util[_0xb427('0x7')](_0xb427('0x3e'),_0x10872f[_0xb427('0x9')]),_0x20d15b);}};exports[_0xb427('0x41')]=function(_0x1f888e){try{if(!_[_0xb427('0x1f')](channels[_0x1f888e[_0xb427('0x9')]])){utils['debug'](util[_0xb427('0x7')](_0xb427('0x42'),_0x1f888e[_0xb427('0x9')]),_0x1f888e);if(!_['isNil'](channels[_0x1f888e[_0xb427('0x9')]][_0xb427('0x3f')])){channels[_0x1f888e[_0xb427('0x9')]][_0xb427('0x43')]+=utils[_0xb427('0x32')](utils[_0xb427('0x1c')](),channels[_0x1f888e[_0xb427('0x9')]][_0xb427('0x3f')]);utils[_0xb427('0x6')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x1f888e[_0xb427('0x9')],channels[_0x1f888e[_0xb427('0x9')]][_0xb427('0x43')]));delete channels[_0x1f888e[_0xb427('0x9')]][_0xb427('0x3f')];}}}catch(_0x2b1f83){utils[_0xb427('0x1e')](util[_0xb427('0x7')](_0xb427('0x42'),_0x1f888e[_0xb427('0x9')]),_0x2b1f83);}};exports[_0xb427('0x44')]=function(_0x486616){try{if(!_[_0xb427('0x1f')](channels[_0x486616[_0xb427('0x9')]])){utils['debug'](util['format'](_0xb427('0x45'),_0x486616[_0xb427('0x9')]),_0x486616);if(!_[_0xb427('0x1f')](_0x486616[_0xb427('0x46')][_0xb427('0x47')])){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x48'),_0x486616[_0xb427('0x9')],_0x486616[_0xb427('0x49')]));channels[_0x486616['uniqueid']][_0xb427('0x4a')]=_0x486616[_0xb427('0x49')];}if(!_['isNil'](_0x486616['variable'][_0xb427('0x4b')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x486616['uniqueid'],_0x486616['value']));channels[_0x486616['uniqueid']][_0xb427('0x4c')]=_0x486616[_0xb427('0x49')];channels[_0x486616[_0xb427('0x9')]][_0xb427('0x2c')]='\x22'+_0x486616[_0xb427('0x49')]+_0xb427('0x4d')+_0x486616[_0xb427('0x49')]+'>';}if(!_[_0xb427('0x1f')](_0x486616['variable'][_0xb427('0x4e')])||!_[_0xb427('0x1f')](_0x486616[_0xb427('0x46')][_0xb427('0x4f')])){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x50'),_0x486616['uniqueid'],!_[_0xb427('0x1f')](_0x486616[_0xb427('0x46')][_0xb427('0x4e')])?_0xb427('0x4e'):_0xb427('0x4f'),_0x486616[_0xb427('0x49')]));channels[_0x486616['uniqueid']][_0xb427('0x2c')]=_0x486616[_0xb427('0x49')];}if(!_['isNil'](_0x486616[_0xb427('0x46')][_0xb427('0x51')])||!_[_0xb427('0x1f')](_0x486616[_0xb427('0x46')][_0xb427('0x52')])){utils['info'](util[_0xb427('0x7')](_0xb427('0x50'),_0x486616[_0xb427('0x9')],!_[_0xb427('0x1f')](_0x486616[_0xb427('0x46')][_0xb427('0x51')])?'xmd-queue':_0xb427('0x52'),_0x486616['value']));channels[_0x486616[_0xb427('0x9')]][_0xb427('0x53')]='Queue';channels[_0x486616[_0xb427('0x9')]][_0xb427('0x54')]=_0x486616['value'];channels[_0x486616[_0xb427('0x9')]][_0xb427('0x55')]=!![];}if(!_[_0xb427('0x1f')](_0x486616['variable'][_0xb427('0x56')])){utils[_0xb427('0x6')](util['format'](_0xb427('0x57'),_0x486616['uniqueid'],_0x486616[_0xb427('0x49')]));channels[_0x486616['uniqueid']][_0xb427('0x58')]=_0x486616[_0xb427('0x49')];}if(!_[_0xb427('0x1f')](_0x486616['variable'][_0xb427('0x59')])){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x5a'),_0x486616[_0xb427('0x9')],_0x486616[_0xb427('0x49')]));channels[_0x486616[_0xb427('0x9')]][_0xb427('0x5b')]=_0x486616[_0xb427('0x49')];}if(!_[_0xb427('0x1f')](_0x486616['variable'][_0xb427('0x5c')])){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x5d'),_0x486616[_0xb427('0x9')],_0x486616[_0xb427('0x49')]));channels[_0x486616[_0xb427('0x9')]][_0xb427('0x5e')]=_0x486616['value'];}if(!_[_0xb427('0x1f')](_0x486616['variable'][_0xb427('0x5f')])){utils[_0xb427('0x6')](util[_0xb427('0x7')](_0xb427('0x60'),_0x486616['uniqueid'],_0x486616[_0xb427('0x49')]));channels[_0x486616[_0xb427('0x9')]]['sipcallid']=_0x486616[_0xb427('0x49')];}}}catch(_0x5ebae4){utils[_0xb427('0x1e')](util[_0xb427('0x7')](_0xb427('0x45'),_0x486616[_0xb427('0x9')]),_0x5ebae4);}};exports[_0xb427('0x61')]=function(_0x339d27){try{if(!_[_0xb427('0x1f')](channels[_0x339d27[_0xb427('0x9')]])){utils[_0xb427('0x15')](util[_0xb427('0x7')]('[%s][calls][newexten]',_0x339d27[_0xb427('0x9')]),_0x339d27);utils[_0xb427('0x6')](util['format'](_0xb427('0x62'),_0x339d27[_0xb427('0x9')],_0x339d27[_0xb427('0x63')],_0x339d27[_0xb427('0x64')]));if(_0x339d27[_0xb427('0x63')][_0xb427('0x65')]()==_0xb427('0x66')&&_[_0xb427('0x67')](_0x339d27[_0xb427('0x64')]['toLowerCase'](),_0xb427('0x68'))){var _0x2acf97=_0x339d27[_0xb427('0x64')][_0xb427('0x69')]('=');var _0x310d97=_0x2acf97[0x0][_0xb427('0x6a')](_0x2acf97[0x0]['lastIndexOf']('(')+0x1,_0x2acf97[0x0][_0xb427('0x6b')](')'));var _0x1fbbf3=_0x2acf97[0x1];channels[_0x339d27[_0xb427('0x9')]][_0x310d97]=_0x1fbbf3;}if(!_[_0xb427('0x6c')]([_0xb427('0x2a'),'noop',_0xb427('0x6d'),_0xb427('0x66'),'gotoif'],_0x339d27[_0xb427('0x63')]['toLowerCase']())){channels[_0x339d27[_0xb427('0x9')]][_0xb427('0x53')]=_0x339d27[_0xb427('0x63')];channels[_0x339d27[_0xb427('0x9')]]['lastdata']=_0x339d27[_0xb427('0x64')];}}}catch(_0x44ab2e){utils['error'](util['format'](_0xb427('0x6e'),_0x339d27['uniqueid']),_0x44ab2e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 4b45864..1565feb 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 _0xb2cb=['[core]\x20fullybooted','error','close','./utils','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted'];(function(_0x22f61c,_0x4cbc5d){var _0x125347=function(_0x14df97){while(--_0x14df97){_0x22f61c['push'](_0x22f61c['shift']());}};_0x125347(++_0x4cbc5d);}(_0xb2cb,0x8a));var _0xbb2c=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0xb2cb[_0x2085f3];return _0x384e3c;};'use strict';var utils=require(_0xbb2c('0x0'));exports[_0xbb2c('0x1')]=function(){utils[_0xbb2c('0x2')](_0xbb2c('0x3'));};exports['shutdown']=function(){utils[_0xbb2c('0x2')](_0xbb2c('0x4'));};exports[_0xbb2c('0x5')]=function(){utils['info'](_0xbb2c('0x6'));};exports[_0xbb2c('0x7')]=function(_0x2b076b){utils[_0xbb2c('0x7')]('[core]\x20error',_0x2b076b);};exports[_0xbb2c('0x8')]=function(){utils[_0xbb2c('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x313e25){}; \ No newline at end of file +var _0xded6=['[core]\x20connected','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x307f7c,_0xc75f61){var _0x14a9df=function(_0x1f2243){while(--_0x1f2243){_0x307f7c['push'](_0x307f7c['shift']());}};_0x14a9df(++_0xc75f61);}(_0xded6,0x1aa));var _0x6ded=function(_0x5be253,_0x470b74){_0x5be253=_0x5be253-0x0;var _0x3fee0e=_0xded6[_0x5be253];return _0x3fee0e;};'use strict';var utils=require(_0x6ded('0x0'));exports[_0x6ded('0x1')]=function(){utils[_0x6ded('0x2')](_0x6ded('0x3'));};exports['shutdown']=function(){utils[_0x6ded('0x2')](_0x6ded('0x4'));};exports['fullybooted']=function(){utils[_0x6ded('0x2')](_0x6ded('0x5'));};exports[_0x6ded('0x6')]=function(_0x484d0a){utils[_0x6ded('0x6')](_0x6ded('0x7'),_0x484d0a);};exports[_0x6ded('0x8')]=function(){utils[_0x6ded('0x2')](_0x6ded('0x9'));};exports[_0x6ded('0xa')]=function(_0x2e3eb0){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d5875d9..b9a5338 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 _0x4e61=['appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','calleridname','cause-txt','complete','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x146185,_0xfd92a5){var _0x470940=function(_0x4072ad){while(--_0x4072ad){_0x146185['push'](_0x146185['shift']());}};_0x470940(++_0xfd92a5);}(_0x4e61,0x1d4));var _0x14e6=function(_0x260859,_0x3cfcff){_0x260859=_0x260859-0x0;var _0x4b77f8=_0x4e61[_0x260859];return _0x4b77f8;};'use strict';var _=require(_0x14e6('0x0'));var util=require(_0x14e6('0x1'));var utils=require(_0x14e6('0x2'));var dials={};function writeDB(_0x452f3a){utils[_0x14e6('0x3')](util[_0x14e6('0x4')](_0x14e6('0x5'),_0x452f3a[_0x14e6('0x6')],_0x452f3a[_0x14e6('0x7')],_0x452f3a['dialstring'],_0x452f3a[_0x14e6('0x8')],_0x452f3a[_0x14e6('0x9')],_0x452f3a[_0x14e6('0xa')]));utils[_0x14e6('0xb')](_0x14e6('0xc'),_0x452f3a);delete dials[_0x452f3a[_0x14e6('0x6')]];}exports[_0x14e6('0xd')]=function(_0x5e056e){try{utils[_0x14e6('0xe')](util[_0x14e6('0x4')](_0x14e6('0xf'),_0x5e056e[_0x14e6('0x6')]),_0x5e056e);utils['info'](util[_0x14e6('0x4')](_0x14e6('0x10'),_0x5e056e[_0x14e6('0x6')],_0x5e056e[_0x14e6('0x11')],_0x5e056e[_0x14e6('0x12')]));if(_0x5e056e[_0x14e6('0x11')][_0x14e6('0x13')]()==_0x14e6('0x14')&&_[_0x14e6('0x15')](_0x5e056e[_0x14e6('0x12')]['toLowerCase'](),_0x14e6('0x16'))){var _0x3a568c=_0x5e056e[_0x14e6('0x12')][_0x14e6('0x17')]('=');dials[_0x5e056e[_0x14e6('0x6')]]={'routeId':_0x3a568c[0x1]};}}catch(_0x2f255c){utils[_0x14e6('0x18')](util[_0x14e6('0x4')](_0x14e6('0xf'),_0x5e056e[_0x14e6('0x6')]),_0x2f255c);}};exports[_0x14e6('0x19')]=function(_0x17ad1a){try{utils[_0x14e6('0xe')](util[_0x14e6('0x4')](_0x14e6('0x1a'),_0x17ad1a[_0x14e6('0x6')]),_0x17ad1a);if(!_[_0x14e6('0x1b')](_0x17ad1a[_0x14e6('0x1c')][_0x14e6('0x1d')])){utils[_0x14e6('0x3')](util[_0x14e6('0x4')](_0x14e6('0x1e'),_0x17ad1a['uniqueid'],_0x17ad1a[_0x14e6('0x1f')]));dials[_0x17ad1a[_0x14e6('0x6')]]={'routeId':_0x17ad1a['value']};}}catch(_0x45644c){utils[_0x14e6('0x18')](util['format']('[%s][dials][varset]',_0x17ad1a[_0x14e6('0x6')]),_0x45644c);}};exports[_0x14e6('0x20')]=function(_0x1ce08e){try{if(!_[_0x14e6('0x1b')](dials[_0x1ce08e['uniqueid']])){utils[_0x14e6('0xe')](util['format'](_0x14e6('0x21'),_0x1ce08e[_0x14e6('0x6')]),_0x1ce08e);dials[_0x1ce08e[_0x14e6('0x6')]]=_['assign'](dials[_0x1ce08e['uniqueid']],_0x1ce08e);dials[_0x1ce08e[_0x14e6('0x6')]]['starttime']=utils[_0x14e6('0x22')]();dials[_0x1ce08e['uniqueid']][_0x14e6('0x23')]=_0x14e6('0x24');utils[_0x14e6('0x3')](util[_0x14e6('0x4')](_0x14e6('0x25'),_0x1ce08e[_0x14e6('0x6')],dials[_0x1ce08e[_0x14e6('0x6')]][_0x14e6('0x26')]));}}catch(_0xa2947d){utils[_0x14e6('0x18')](util[_0x14e6('0x4')](_0x14e6('0x21'),_0x1ce08e[_0x14e6('0x6')]),_0xa2947d);}};exports[_0x14e6('0x27')]=function(_0xaf8c){try{if(!_[_0x14e6('0x1b')](dials[_0xaf8c[_0x14e6('0x6')]])){utils[_0x14e6('0xe')](util[_0x14e6('0x4')](_0x14e6('0x28'),_0xaf8c[_0x14e6('0x6')]),_0xaf8c);dials[_0xaf8c[_0x14e6('0x6')]][_0x14e6('0xa')]=_0xaf8c[_0x14e6('0xa')];if(_0xaf8c[_0x14e6('0xa')]==_0x14e6('0x29')){dials[_0xaf8c[_0x14e6('0x6')]]=_[_0x14e6('0x2a')](dials[_0xaf8c[_0x14e6('0x6')]],_0xaf8c);dials[_0xaf8c['uniqueid']][_0x14e6('0x2b')]=utils[_0x14e6('0x22')]();dials[_0xaf8c[_0x14e6('0x6')]][_0x14e6('0x23')]='connect';utils['info'](util['format'](_0x14e6('0x2c'),_0xaf8c[_0x14e6('0x6')],_0xaf8c[_0x14e6('0xa')],dials[_0xaf8c[_0x14e6('0x6')]][_0x14e6('0x2b')]));}else{utils['info'](util['format'](_0x14e6('0x2d'),_0xaf8c[_0x14e6('0x6')],_0xaf8c[_0x14e6('0xa')]));}}}catch(_0x230b82){utils[_0x14e6('0x18')](util[_0x14e6('0x4')](_0x14e6('0x28'),_0xaf8c[_0x14e6('0x6')]),_0x230b82);}};exports['hangup']=function(_0x5678d5){try{if(!_[_0x14e6('0x1b')](dials[_0x5678d5[_0x14e6('0x6')]])){utils['debug'](util[_0x14e6('0x4')](_0x14e6('0x2e'),_0x5678d5[_0x14e6('0x6')]),_0x5678d5);utils[_0x14e6('0x3')](util[_0x14e6('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x5678d5[_0x14e6('0x6')],_0x5678d5['calleridnum'],_0x5678d5[_0x14e6('0x2f')],_0x5678d5[_0x14e6('0x30')]));dials[_0x5678d5[_0x14e6('0x6')]]=_['assign'](dials[_0x5678d5[_0x14e6('0x6')]],{'endtime':utils[_0x14e6('0x22')](),'lastevent':_0x14e6('0x31')});dials[_0x5678d5['uniqueid']]['duration']=utils[_0x14e6('0x32')](dials[_0x5678d5[_0x14e6('0x6')]]['endtime'],dials[_0x5678d5[_0x14e6('0x6')]][_0x14e6('0x26')]);dials[_0x5678d5[_0x14e6('0x6')]][_0x14e6('0x33')]=utils['diffTime'](dials[_0x5678d5[_0x14e6('0x6')]][_0x14e6('0x2b')]||dials[_0x5678d5[_0x14e6('0x6')]][_0x14e6('0x34')],dials[_0x5678d5[_0x14e6('0x6')]]['starttime']);dials[_0x5678d5['uniqueid']][_0x14e6('0x35')]=dials[_0x5678d5[_0x14e6('0x6')]]['answertime']?utils['diffTime'](dials[_0x5678d5[_0x14e6('0x6')]][_0x14e6('0x34')],dials[_0x5678d5[_0x14e6('0x6')]]['answertime']):0x0;writeDB(dials[_0x5678d5['uniqueid']]);}}catch(_0x5bde2a){utils['error'](util['format'](_0x14e6('0x2e'),_0x5678d5[_0x14e6('0x6')]),_0x5bde2a);}}; \ No newline at end of file +var _0xbea0=['calleridnum','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','starttime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','connectedlinenum','dialstatus','CreateVoiceDialReport','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','answertime','connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xbea0,0x68));var _0x0bea=function(_0x245dd6,_0x1c106f){_0x245dd6=_0x245dd6-0x0;var _0xe8eb42=_0xbea0[_0x245dd6];return _0xe8eb42;};'use strict';var _=require(_0x0bea('0x0'));var util=require('util');var utils=require(_0x0bea('0x1'));var dials={};function writeDB(_0x2aff35){utils[_0x0bea('0x2')](util[_0x0bea('0x3')](_0x0bea('0x4'),_0x2aff35[_0x0bea('0x5')],_0x2aff35[_0x0bea('0x6')],_0x2aff35['dialstring'],_0x2aff35['calleridnum'],_0x2aff35[_0x0bea('0x7')],_0x2aff35[_0x0bea('0x8')]));utils['request'](_0x0bea('0x9'),_0x2aff35);delete dials[_0x2aff35['uniqueid']];}exports['newexten']=function(_0x4fd102){try{utils['debug'](util[_0x0bea('0x3')](_0x0bea('0xa'),_0x4fd102[_0x0bea('0x5')]),_0x4fd102);utils[_0x0bea('0x2')](util[_0x0bea('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4fd102['uniqueid'],_0x4fd102[_0x0bea('0xb')],_0x4fd102[_0x0bea('0xc')]));if(_0x4fd102[_0x0bea('0xb')][_0x0bea('0xd')]()==_0x0bea('0xe')&&_[_0x0bea('0xf')](_0x4fd102[_0x0bea('0xc')][_0x0bea('0xd')](),_0x0bea('0x10'))){var _0xe352e2=_0x4fd102[_0x0bea('0xc')]['split']('=');dials[_0x4fd102['uniqueid']]={'routeId':_0xe352e2[0x1]};}}catch(_0x365367){utils['error'](util[_0x0bea('0x3')]('[%s][dials][newexten]',_0x4fd102['uniqueid']),_0x365367);}};exports['varset']=function(_0x3af49d){try{utils[_0x0bea('0x11')](util[_0x0bea('0x3')](_0x0bea('0x12'),_0x3af49d[_0x0bea('0x5')]),_0x3af49d);if(!_[_0x0bea('0x13')](_0x3af49d[_0x0bea('0x14')][_0x0bea('0x15')])){utils['info'](util[_0x0bea('0x3')](_0x0bea('0x16'),_0x3af49d[_0x0bea('0x5')],_0x3af49d[_0x0bea('0x17')]));dials[_0x3af49d['uniqueid']]={'routeId':_0x3af49d[_0x0bea('0x17')]};}}catch(_0x116351){utils[_0x0bea('0x18')](util[_0x0bea('0x3')]('[%s][dials][varset]',_0x3af49d[_0x0bea('0x5')]),_0x116351);}};exports['dialbegin']=function(_0x4b5366){try{if(!_[_0x0bea('0x13')](dials[_0x4b5366[_0x0bea('0x5')]])){utils['debug'](util[_0x0bea('0x3')](_0x0bea('0x19'),_0x4b5366[_0x0bea('0x5')]),_0x4b5366);dials[_0x4b5366[_0x0bea('0x5')]]=_[_0x0bea('0x1a')](dials[_0x4b5366[_0x0bea('0x5')]],_0x4b5366);dials[_0x4b5366[_0x0bea('0x5')]]['starttime']=utils[_0x0bea('0x1b')]();dials[_0x4b5366[_0x0bea('0x5')]][_0x0bea('0x1c')]=_0x0bea('0x1d');utils[_0x0bea('0x2')](util[_0x0bea('0x3')](_0x0bea('0x1e'),_0x4b5366[_0x0bea('0x5')],dials[_0x4b5366['uniqueid']]['starttime']));}}catch(_0x387627){utils[_0x0bea('0x18')](util[_0x0bea('0x3')](_0x0bea('0x19'),_0x4b5366[_0x0bea('0x5')]),_0x387627);}};exports['dialend']=function(_0x1c5153){try{if(!_[_0x0bea('0x13')](dials[_0x1c5153[_0x0bea('0x5')]])){utils[_0x0bea('0x11')](util[_0x0bea('0x3')](_0x0bea('0x1f'),_0x1c5153[_0x0bea('0x5')]),_0x1c5153);dials[_0x1c5153[_0x0bea('0x5')]]['dialstatus']=_0x1c5153['dialstatus'];if(_0x1c5153['dialstatus']=='ANSWER'){dials[_0x1c5153[_0x0bea('0x5')]]=_[_0x0bea('0x1a')](dials[_0x1c5153[_0x0bea('0x5')]],_0x1c5153);dials[_0x1c5153[_0x0bea('0x5')]][_0x0bea('0x20')]=utils[_0x0bea('0x1b')]();dials[_0x1c5153[_0x0bea('0x5')]][_0x0bea('0x1c')]=_0x0bea('0x21');utils[_0x0bea('0x2')](util[_0x0bea('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1c5153[_0x0bea('0x5')],_0x1c5153[_0x0bea('0x8')],dials[_0x1c5153[_0x0bea('0x5')]][_0x0bea('0x20')]));}else{utils[_0x0bea('0x2')](util[_0x0bea('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x1c5153[_0x0bea('0x5')],_0x1c5153[_0x0bea('0x8')]));}}}catch(_0x53eae1){utils[_0x0bea('0x18')](util[_0x0bea('0x3')](_0x0bea('0x1f'),_0x1c5153['uniqueid']),_0x53eae1);}};exports[_0x0bea('0x22')]=function(_0x488fbe){try{if(!_[_0x0bea('0x13')](dials[_0x488fbe[_0x0bea('0x5')]])){utils[_0x0bea('0x11')](util[_0x0bea('0x3')](_0x0bea('0x23'),_0x488fbe['uniqueid']),_0x488fbe);utils[_0x0bea('0x2')](util[_0x0bea('0x3')](_0x0bea('0x24'),_0x488fbe[_0x0bea('0x5')],_0x488fbe[_0x0bea('0x25')],_0x488fbe[_0x0bea('0x26')],_0x488fbe[_0x0bea('0x27')]));dials[_0x488fbe['uniqueid']]=_[_0x0bea('0x1a')](dials[_0x488fbe[_0x0bea('0x5')]],{'endtime':utils[_0x0bea('0x1b')](),'lastevent':_0x0bea('0x28')});dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x29')]=utils[_0x0bea('0x2a')](dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x2b')],dials[_0x488fbe['uniqueid']]['starttime']);dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x2c')]=utils['diffTime'](dials[_0x488fbe['uniqueid']][_0x0bea('0x20')]||dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x2b')],dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x2d')]);dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x2e')]=dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x20')]?utils[_0x0bea('0x2a')](dials[_0x488fbe['uniqueid']][_0x0bea('0x2b')],dials[_0x488fbe[_0x0bea('0x5')]][_0x0bea('0x20')]):0x0;writeDB(dials[_0x488fbe[_0x0bea('0x5')]]);}}catch(_0x28f099){utils['error'](util[_0x0bea('0x3')](_0x0bea('0x23'),_0x488fbe['uniqueid']),_0x28f099);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 2efb8ae..b063840 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 _0x1838=['util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','dialend','asterisk-manager','../../config/environment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x1838,0x1d3));var _0x8183=function(_0xbb696b,_0x28bf60){_0xbb696b=_0xbb696b-0x0;var _0x499935=_0x1838[_0xbb696b];return _0x499935;};var AsteriskManager=require(_0x8183('0x0'));var config=require(_0x8183('0x1'));var utils=require('./utils');var util=require(_0x8183('0x2'));var isXDREnabled=config['xdr']&&config[_0x8183('0x3')][_0x8183('0x4')]?!config[_0x8183('0x3')][_0x8183('0x4')]:!![];var isProduction=config['env']===_0x8183('0x5')||![];var isLocalAsterisk=config[_0x8183('0x3')]&&config[_0x8183('0x3')][_0x8183('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x8183('0x7')][_0x8183('0x8')],config[_0x8183('0x7')]['ip'],config[_0x8183('0x7')][_0x8183('0x9')],config[_0x8183('0x7')][_0x8183('0xa')],!![]);ami[_0x8183('0xb')]();if(!isXDREnabled){utils[_0x8183('0xc')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x8183('0xc')](_0x8183('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0x8183('0xe'));var queues=require(_0x8183('0xf'));var recordings=require(_0x8183('0x10'));var members=require(_0x8183('0x11'));var dials=require(_0x8183('0x12'));var transfers=require(_0x8183('0x13'));var core=require(_0x8183('0x14'));ami['on'](_0x8183('0x15'),core[_0x8183('0x15')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x8183('0x16'),core['fullybooted']);ami['on'](_0x8183('0x17'),core[_0x8183('0x17')]);ami['on'](_0x8183('0x18'),core['close']);ami['on'](_0x8183('0x19'),core[_0x8183('0x19')]);ami['on'](_0x8183('0x1a'),function(_0x30107b){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x1d'),_0x30107b['device']),_0x30107b);members[_0x8183('0x1a')](_0x30107b);}catch(_0x1f645e){utils[_0x8183('0x17')](util[_0x8183('0x1c')](_0x8183('0x1d'),_0x30107b['device']),_0x1f645e);}});ami['on'](_0x8183('0x1e'),function(_0x112592){try{utils['debug'](util[_0x8183('0x1c')](_0x8183('0x1f'),_0x112592['uniqueid']),_0x112592);agents[_0x8183('0x1e')](_0x112592);}catch(_0xdaa0e7){utils[_0x8183('0x17')](util[_0x8183('0x1c')]('[%s][index][agentcalled]',_0x112592[_0x8183('0x20')]),_0xdaa0e7);}});ami['on'](_0x8183('0x21'),function(_0x285978){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x22'),_0x285978[_0x8183('0x20')]),_0x285978);agents['agentringnoanswer'](_0x285978);}catch(_0x964277){utils[_0x8183('0x17')](util['format'](_0x8183('0x22'),_0x285978['uniqueid']),_0x964277);}});ami['on'](_0x8183('0x23'),function(_0x2fa95f){try{utils['debug'](util[_0x8183('0x1c')](_0x8183('0x24'),_0x2fa95f[_0x8183('0x20')]),_0x2fa95f);agents[_0x8183('0x23')](_0x2fa95f);queues[_0x8183('0x23')](_0x2fa95f);}catch(_0x8332de){utils[_0x8183('0x17')](util[_0x8183('0x1c')]('[%s][index][agentconnect]',_0x2fa95f[_0x8183('0x20')]),_0x8332de);}});ami['on'](_0x8183('0x25'),function(_0xd974e2){try{utils['debug'](util[_0x8183('0x1c')](_0x8183('0x26'),_0xd974e2[_0x8183('0x20')]),_0xd974e2);agents[_0x8183('0x25')](_0xd974e2);queues[_0x8183('0x25')](_0xd974e2);members['agentcomplete'](_0xd974e2);}catch(_0xd5030e){utils[_0x8183('0x17')](util[_0x8183('0x1c')]('[%s][index][agentcomplete]',_0xd974e2['uniqueid']),_0xd5030e);}});ami['on'](_0x8183('0x27'),function(_0x14ffde){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x28'),_0x14ffde[_0x8183('0x20')]),_0x14ffde);agents[_0x8183('0x27')](_0x14ffde);queues[_0x8183('0x27')](_0x14ffde);}catch(_0x5ca01e){utils['error'](util['format'](_0x8183('0x28'),_0x14ffde['uniqueid']),_0x5ca01e);}});ami['on'](_0x8183('0x29'),function(_0x1ef429){try{utils[_0x8183('0x1b')](util['format'](_0x8183('0x2a'),_0x1ef429[_0x8183('0x20')]),_0x1ef429);queues[_0x8183('0x29')](_0x1ef429);recordings[_0x8183('0x29')](_0x1ef429);}catch(_0xb52f1f){utils['error'](util[_0x8183('0x1c')](_0x8183('0x2a'),_0x1ef429['uniqueid']),_0xb52f1f);}});ami['on'](_0x8183('0x2b'),function(_0x926fc7){try{utils[_0x8183('0x1b')](util['format'](_0x8183('0x2c'),_0x926fc7[_0x8183('0x20')]),_0x926fc7);queues[_0x8183('0x2b')](_0x926fc7);}catch(_0x504c59){utils[_0x8183('0x17')](util['format']('[%s][index][queuecallerleave]',_0x926fc7[_0x8183('0x20')]),_0x504c59);}});ami['on'](_0x8183('0x2d'),function(_0x2efa75){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][musiconholdstart]',_0x2efa75[_0x8183('0x20')]),_0x2efa75);queues[_0x8183('0x2d')](_0x2efa75);calls[_0x8183('0x2d')](_0x2efa75);}catch(_0x694249){utils[_0x8183('0x17')](util['format'](_0x8183('0x2e'),_0x2efa75[_0x8183('0x20')]),_0x694249);}});ami['on'](_0x8183('0x2f'),function(_0x3fab48){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][musiconholdstop]',_0x3fab48[_0x8183('0x20')]),_0x3fab48);queues[_0x8183('0x2f')](_0x3fab48);calls[_0x8183('0x2f')](_0x3fab48);}catch(_0x120840){utils[_0x8183('0x17')](util['format'](_0x8183('0x30'),_0x3fab48[_0x8183('0x20')]),_0x120840);}});ami['on'](_0x8183('0x31'),function(_0x859445){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][newstate]',_0x859445[_0x8183('0x20')]),_0x859445);calls[_0x8183('0x31')](_0x859445);recordings['newstate'](_0x859445);}catch(_0x3629bf){utils[_0x8183('0x17')](util[_0x8183('0x1c')]('[%s][index][newstate]',_0x859445[_0x8183('0x20')]),_0x3629bf);}});ami['on']('hangup',function(_0xddb4fb){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x32'),_0xddb4fb['uniqueid']),_0xddb4fb);calls[_0x8183('0x33')](_0xddb4fb);recordings[_0x8183('0x33')](_0xddb4fb);dials[_0x8183('0x33')](_0xddb4fb);agents[_0x8183('0x33')](_0xddb4fb);queues[_0x8183('0x33')](_0xddb4fb);}catch(_0x11b7b8){utils[_0x8183('0x17')](util[_0x8183('0x1c')](_0x8183('0x32'),_0xddb4fb[_0x8183('0x20')]),_0x11b7b8);}});ami['on'](_0x8183('0x34'),function(_0x583417){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x35'),_0x583417[_0x8183('0x20')]),_0x583417);members[_0x8183('0x34')](_0x583417);}catch(_0x5ca0e0){utils[_0x8183('0x17')](util[_0x8183('0x1c')](_0x8183('0x35'),_0x583417['uniqueid']),_0x5ca0e0);}});ami['on']('blindtransfer',function(_0x2b8509){try{utils['debug'](util[_0x8183('0x1c')](_0x8183('0x36'),_0x2b8509[_0x8183('0x20')]),_0x2b8509);queues['blindtransfer'](_0x2b8509);agents[_0x8183('0x37')](_0x2b8509);transfers[_0x8183('0x37')](_0x2b8509);}catch(_0x12421d){utils['error'](util[_0x8183('0x1c')]('[%s][index][blindtransfer]',_0x2b8509[_0x8183('0x20')]),_0x12421d);}});ami['on'](_0x8183('0x38'),function(_0x183e50){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][attendedtransfer]',_0x183e50[_0x8183('0x39')]),_0x183e50);queues[_0x8183('0x38')](_0x183e50);transfers['attendedtransfer'](_0x183e50);agents['attendedtransfer'](_0x183e50);calls[_0x8183('0x38')](_0x183e50);}catch(_0x4bc9c3){utils[_0x8183('0x17')](util['format'](_0x8183('0x3a'),_0x183e50['origtransfereruniqueid']),_0x4bc9c3);}});ami['on'](_0x8183('0x3b'),function(_0x1b18b1){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][varset]',_0x1b18b1[_0x8183('0x20')]),_0x1b18b1);queues[_0x8183('0x3b')](_0x1b18b1);recordings[_0x8183('0x3b')](_0x1b18b1);calls[_0x8183('0x3b')](_0x1b18b1);dials[_0x8183('0x3b')](_0x1b18b1);}catch(_0x3dc842){utils[_0x8183('0x17')](util[_0x8183('0x1c')](_0x8183('0x3c'),_0x1b18b1['uniqueid']),_0x3dc842);}});ami['on'](_0x8183('0x3d'),function(_0x500c9f){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x3e'),_0x500c9f[_0x8183('0x20')]),_0x500c9f);calls[_0x8183('0x3d')](_0x500c9f);recordings[_0x8183('0x3d')](_0x500c9f);dials[_0x8183('0x3d')](_0x500c9f);}catch(_0x8fa441){utils[_0x8183('0x17')](util[_0x8183('0x1c')](_0x8183('0x3e'),_0x500c9f[_0x8183('0x20')]),_0x8fa441);}});ami['on'](_0x8183('0x3f'),function(_0x5742df){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')](_0x8183('0x40'),_0x5742df[_0x8183('0x20')]),_0x5742df);calls[_0x8183('0x3f')](_0x5742df);recordings[_0x8183('0x3f')](_0x5742df);}catch(_0x4771d4){utils['error'](util['format'](_0x8183('0x40'),_0x5742df['uniqueid']),_0x4771d4);}});ami['on'](_0x8183('0x41'),function(_0x4171f7){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][dialbegin]',_0x4171f7[_0x8183('0x20')]),_0x4171f7);dials[_0x8183('0x41')](_0x4171f7);}catch(_0x120c7c){utils[_0x8183('0x17')](util[_0x8183('0x1c')]('[%s]dialbegin',_0x4171f7[_0x8183('0x20')]),_0x120c7c);}});ami['on'](_0x8183('0x42'),function(_0x368369){try{utils[_0x8183('0x1b')](util[_0x8183('0x1c')]('[%s][index][dialend]',_0x368369[_0x8183('0x20')]),_0x368369);dials[_0x8183('0x42')](_0x368369);}catch(_0x281e4f){utils[_0x8183('0x17')](util[_0x8183('0x1c')]('[%s][index][dialend]',_0x368369['uniqueid']),_0x281e4f);}});} \ No newline at end of file +var _0x5f22=['fullybooted','error','close','managerevent','devicestatechange','format','device','[%s][index][devicestatechange]','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./dials.controller','connect','shutdown'];(function(_0x4dcfdb,_0x566698){var _0x386a20=function(_0x57068a){while(--_0x57068a){_0x4dcfdb['push'](_0x4dcfdb['shift']());}};_0x386a20(++_0x566698);}(_0x5f22,0xae));var _0x25f2=function(_0x2c602e,_0x1d26f5){_0x2c602e=_0x2c602e-0x0;var _0x1a2650=_0x5f22[_0x2c602e];return _0x1a2650;};var AsteriskManager=require(_0x25f2('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require('util');var isXDREnabled=config['xdr']&&config[_0x25f2('0x1')][_0x25f2('0x2')]?!config[_0x25f2('0x1')][_0x25f2('0x2')]:!![];var isProduction=config['env']===_0x25f2('0x3')||![];var isLocalAsterisk=config[_0x25f2('0x1')]&&config['xdr'][_0x25f2('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0x25f2('0x5')][_0x25f2('0x6')],config[_0x25f2('0x5')]['ip'],config['asterisk'][_0x25f2('0x7')],config[_0x25f2('0x5')][_0x25f2('0x8')],!![]);ami[_0x25f2('0x9')]();if(!isXDREnabled){utils[_0x25f2('0xa')](_0x25f2('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x25f2('0xc'));var calls=require(_0x25f2('0xd'));var queues=require('./queues.controller');var recordings=require(_0x25f2('0xe'));var members=require('./members.controller');var dials=require(_0x25f2('0xf'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x25f2('0x10'),core['connect']);ami['on']('shutdown',core[_0x25f2('0x11')]);ami['on'](_0x25f2('0x12'),core[_0x25f2('0x12')]);ami['on'](_0x25f2('0x13'),core['error']);ami['on']('close',core[_0x25f2('0x14')]);ami['on'](_0x25f2('0x15'),core['managerevent']);ami['on'](_0x25f2('0x16'),function(_0x15c78a){try{utils['debug'](util[_0x25f2('0x17')]('[%s][index][devicestatechange]',_0x15c78a[_0x25f2('0x18')]),_0x15c78a);members[_0x25f2('0x16')](_0x15c78a);}catch(_0x320e71){utils['error'](util[_0x25f2('0x17')](_0x25f2('0x19'),_0x15c78a['device']),_0x320e71);}});ami['on'](_0x25f2('0x1a'),function(_0x577bcd){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x1c'),_0x577bcd[_0x25f2('0x1d')]),_0x577bcd);agents[_0x25f2('0x1a')](_0x577bcd);}catch(_0x242bf3){utils['error'](util['format'](_0x25f2('0x1c'),_0x577bcd['uniqueid']),_0x242bf3);}});ami['on'](_0x25f2('0x1e'),function(_0x2cd31e){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x1f'),_0x2cd31e['uniqueid']),_0x2cd31e);agents[_0x25f2('0x1e')](_0x2cd31e);}catch(_0x56a0fd){utils[_0x25f2('0x13')](util['format'](_0x25f2('0x1f'),_0x2cd31e[_0x25f2('0x1d')]),_0x56a0fd);}});ami['on'](_0x25f2('0x20'),function(_0x5ab740){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x21'),_0x5ab740[_0x25f2('0x1d')]),_0x5ab740);agents[_0x25f2('0x20')](_0x5ab740);queues[_0x25f2('0x20')](_0x5ab740);}catch(_0x399465){utils[_0x25f2('0x13')](util[_0x25f2('0x17')](_0x25f2('0x21'),_0x5ab740[_0x25f2('0x1d')]),_0x399465);}});ami['on'](_0x25f2('0x22'),function(_0x59206b){try{utils[_0x25f2('0x1b')](util['format']('[%s][index][agentcomplete]',_0x59206b[_0x25f2('0x1d')]),_0x59206b);agents['agentcomplete'](_0x59206b);queues['agentcomplete'](_0x59206b);members['agentcomplete'](_0x59206b);}catch(_0x43964b){utils[_0x25f2('0x13')](util['format']('[%s][index][agentcomplete]',_0x59206b['uniqueid']),_0x43964b);}});ami['on'](_0x25f2('0x23'),function(_0x2b0cdc){try{utils[_0x25f2('0x1b')](util['format'](_0x25f2('0x24'),_0x2b0cdc[_0x25f2('0x1d')]),_0x2b0cdc);agents[_0x25f2('0x23')](_0x2b0cdc);queues[_0x25f2('0x23')](_0x2b0cdc);}catch(_0x1aeeec){utils[_0x25f2('0x13')](util['format'](_0x25f2('0x24'),_0x2b0cdc[_0x25f2('0x1d')]),_0x1aeeec);}});ami['on'](_0x25f2('0x25'),function(_0x25ff44){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x26'),_0x25ff44[_0x25f2('0x1d')]),_0x25ff44);queues[_0x25f2('0x25')](_0x25ff44);recordings['queuecallerjoin'](_0x25ff44);}catch(_0x454b8f){utils[_0x25f2('0x13')](util['format'](_0x25f2('0x26'),_0x25ff44[_0x25f2('0x1d')]),_0x454b8f);}});ami['on']('queuecallerleave',function(_0x161c94){try{utils['debug'](util[_0x25f2('0x17')]('[%s][index][queuecallerleave]',_0x161c94[_0x25f2('0x1d')]),_0x161c94);queues[_0x25f2('0x27')](_0x161c94);}catch(_0x5c45c0){utils[_0x25f2('0x13')](util[_0x25f2('0x17')](_0x25f2('0x28'),_0x161c94[_0x25f2('0x1d')]),_0x5c45c0);}});ami['on'](_0x25f2('0x29'),function(_0x1b8ac2){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x2a'),_0x1b8ac2[_0x25f2('0x1d')]),_0x1b8ac2);queues[_0x25f2('0x29')](_0x1b8ac2);calls['musiconholdstart'](_0x1b8ac2);}catch(_0xec1027){utils[_0x25f2('0x13')](util['format'](_0x25f2('0x2a'),_0x1b8ac2[_0x25f2('0x1d')]),_0xec1027);}});ami['on']('musiconholdstop',function(_0x14dba2){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')]('[%s][index][musiconholdstop]',_0x14dba2[_0x25f2('0x1d')]),_0x14dba2);queues[_0x25f2('0x2b')](_0x14dba2);calls[_0x25f2('0x2b')](_0x14dba2);}catch(_0x11e8b5){utils[_0x25f2('0x13')](util['format']('[%s][index][musiconholdstop]',_0x14dba2[_0x25f2('0x1d')]),_0x11e8b5);}});ami['on'](_0x25f2('0x2c'),function(_0x5d1137){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')]('[%s][index][newstate]',_0x5d1137[_0x25f2('0x1d')]),_0x5d1137);calls[_0x25f2('0x2c')](_0x5d1137);recordings[_0x25f2('0x2c')](_0x5d1137);}catch(_0x210388){utils[_0x25f2('0x13')](util['format']('[%s][index][newstate]',_0x5d1137['uniqueid']),_0x210388);}});ami['on'](_0x25f2('0x2d'),function(_0x3ffa83){try{utils[_0x25f2('0x1b')](util['format'](_0x25f2('0x2e'),_0x3ffa83[_0x25f2('0x1d')]),_0x3ffa83);calls[_0x25f2('0x2d')](_0x3ffa83);recordings[_0x25f2('0x2d')](_0x3ffa83);dials[_0x25f2('0x2d')](_0x3ffa83);agents['hangup'](_0x3ffa83);queues[_0x25f2('0x2d')](_0x3ffa83);}catch(_0x39590c){utils['error'](util[_0x25f2('0x17')](_0x25f2('0x2e'),_0x3ffa83['uniqueid']),_0x39590c);}});ami['on'](_0x25f2('0x2f'),function(_0x37a77b){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x30'),_0x37a77b[_0x25f2('0x1d')]),_0x37a77b);members[_0x25f2('0x2f')](_0x37a77b);}catch(_0x8d9f23){utils['error'](util['format'](_0x25f2('0x30'),_0x37a77b[_0x25f2('0x1d')]),_0x8d9f23);}});ami['on'](_0x25f2('0x31'),function(_0x5e232b){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')]('[%s][index][blindtransfer]',_0x5e232b[_0x25f2('0x1d')]),_0x5e232b);queues[_0x25f2('0x31')](_0x5e232b);agents[_0x25f2('0x31')](_0x5e232b);transfers[_0x25f2('0x31')](_0x5e232b);}catch(_0x50274b){utils[_0x25f2('0x13')](util[_0x25f2('0x17')](_0x25f2('0x32'),_0x5e232b['uniqueid']),_0x50274b);}});ami['on']('attendedtransfer',function(_0x3e14cf){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x33'),_0x3e14cf[_0x25f2('0x34')]),_0x3e14cf);queues[_0x25f2('0x35')](_0x3e14cf);transfers['attendedtransfer'](_0x3e14cf);agents['attendedtransfer'](_0x3e14cf);calls[_0x25f2('0x35')](_0x3e14cf);}catch(_0x3226aa){utils[_0x25f2('0x13')](util[_0x25f2('0x17')](_0x25f2('0x33'),_0x3e14cf['origtransfereruniqueid']),_0x3226aa);}});ami['on'](_0x25f2('0x36'),function(_0x5d5d8e){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')]('[%s][index][varset]',_0x5d5d8e[_0x25f2('0x1d')]),_0x5d5d8e);queues['varset'](_0x5d5d8e);recordings[_0x25f2('0x36')](_0x5d5d8e);calls[_0x25f2('0x36')](_0x5d5d8e);dials[_0x25f2('0x36')](_0x5d5d8e);}catch(_0x599603){utils[_0x25f2('0x13')](util[_0x25f2('0x17')]('[%s][index][varset]',_0x5d5d8e[_0x25f2('0x1d')]),_0x599603);}});ami['on'](_0x25f2('0x37'),function(_0x231b7d){try{utils['debug'](util['format'](_0x25f2('0x38'),_0x231b7d[_0x25f2('0x1d')]),_0x231b7d);calls[_0x25f2('0x37')](_0x231b7d);recordings[_0x25f2('0x37')](_0x231b7d);dials[_0x25f2('0x37')](_0x231b7d);}catch(_0x485a9d){utils[_0x25f2('0x13')](util[_0x25f2('0x17')]('[%s][index][newexten]',_0x231b7d[_0x25f2('0x1d')]),_0x485a9d);}});ami['on'](_0x25f2('0x39'),function(_0x177091){try{utils['debug'](util[_0x25f2('0x17')](_0x25f2('0x3a'),_0x177091[_0x25f2('0x1d')]),_0x177091);calls[_0x25f2('0x39')](_0x177091);recordings['newchannel'](_0x177091);}catch(_0x4e5764){utils[_0x25f2('0x13')](util[_0x25f2('0x17')](_0x25f2('0x3a'),_0x177091[_0x25f2('0x1d')]),_0x4e5764);}});ami['on'](_0x25f2('0x3b'),function(_0x290819){try{utils['debug'](util[_0x25f2('0x17')](_0x25f2('0x3c'),_0x290819[_0x25f2('0x1d')]),_0x290819);dials[_0x25f2('0x3b')](_0x290819);}catch(_0xb15a6){utils['error'](util[_0x25f2('0x17')](_0x25f2('0x3d'),_0x290819[_0x25f2('0x1d')]),_0xb15a6);}});ami['on'](_0x25f2('0x3e'),function(_0x1ccf8a){try{utils[_0x25f2('0x1b')](util[_0x25f2('0x17')](_0x25f2('0x3f'),_0x1ccf8a['uniqueid']),_0x1ccf8a);dials['dialend'](_0x1ccf8a);}catch(_0x23c56b){utils['error'](util['format'](_0x25f2('0x3f'),_0x1ccf8a[_0x25f2('0x1d')]),_0x23c56b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e1fae2b..bc4ec22 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 _0x9901=['request','CreateMemberReport','getUserByName','split','then','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','error','[%s][members][devicestatechange]','[%s][members][agentcomplete]','assign','queue','cdr','[%s][members][cdr]','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal'];(function(_0x33cb97,_0x2be8e8){var _0xe85595=function(_0x664fa2){while(--_0x664fa2){_0x33cb97['push'](_0x33cb97['shift']());}};_0xe85595(++_0x2be8e8);}(_0x9901,0x15e));var _0x1990=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0x9901[_0x3396cd];return _0x2d6b4a;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var utils=require('./utils');var members={};var exclude=[_0x1990('0x1'),_0x1990('0x2')];function writeDB(_0x178b7d){utils['info'](util[_0x1990('0x3')](_0x1990('0x4'),_0x178b7d[_0x1990('0x5')],_0x178b7d[_0x1990('0x6')],_0x178b7d[_0x1990('0x7')],_0x178b7d[_0x1990('0x8')],_0x178b7d[_0x1990('0x9')],_0x178b7d[_0x1990('0xa')]));if(_0x178b7d[_0x1990('0x6')]){utils[_0x1990('0xb')](_0x178b7d[_0x1990('0x6')])['then'](function(_0x829ffa){if(_0x829ffa){_0x178b7d[_0x1990('0x9')]=_0x829ffa[_0x1990('0xc')];_0x178b7d[_0x1990('0xd')]=_0x829ffa[_0x1990('0xd')];utils[_0x1990('0xe')](_0x1990('0xf'),_0x178b7d);}else{utils[_0x1990('0x10')](_0x178b7d[_0x1990('0x6')][_0x1990('0x11')]('/')[0x1])[_0x1990('0x12')](function(_0x1d4ace){if(_0x1d4ace){_0x178b7d['membername']=_0x1d4ace[_0x1990('0xc')];_0x178b7d['internal']=_0x1d4ace['internal'];utils[_0x1990('0xe')]('CreateMemberReport',_0x178b7d);}});}})[_0x1990('0x13')](function(_0x163507){utils['error'](util['format'](_0x1990('0x14'),_0x178b7d[_0x1990('0x5')]),_0x163507);});}delete members[_0x178b7d[_0x1990('0x6')]];}function startsWith(_0x290f3b,_0x4c89c0){return _[_0x1990('0x15')](_0x290f3b,function(_0x3699d9){return _[_0x1990('0x16')](_0x4c89c0,_0x3699d9);});}exports[_0x1990('0x17')]=function(_0x3b09ad){try{utils[_0x1990('0x18')](util[_0x1990('0x3')]('[%s][members][devicestatechange]',members[_0x3b09ad['device']]?members[_0x3b09ad[_0x1990('0x19')]][_0x1990('0x5')]:_0x3b09ad[_0x1990('0x19')]),_0x3b09ad);utils[_0x1990('0x1a')](util[_0x1990('0x3')](_0x1990('0x1b'),members[_0x3b09ad['device']]?members[_0x3b09ad[_0x1990('0x19')]]['uniqueid']:_0x3b09ad[_0x1990('0x19')],_0x3b09ad['state'],_0x3b09ad[_0x1990('0x19')]));switch(_0x3b09ad[_0x1990('0x1c')]){case'INUSE':case _0x1990('0x1d'):if(!startsWith(exclude,_0x3b09ad[_0x1990('0x19')])){members[_0x3b09ad['device']]={'channel':_0x1990('0x1e'),'interface':_0x3b09ad[_0x1990('0x19')],'type':_0x1990('0x1f'),'enterAt':utils[_0x1990('0x20')](),'role':_0x1990('0x21')};}break;case _0x1990('0x22'):if(!_[_0x1990('0x23')](members[_0x3b09ad['device']])){members[_0x3b09ad[_0x1990('0x19')]][_0x1990('0x24')]=utils[_0x1990('0x20')]();members[_0x3b09ad[_0x1990('0x19')]][_0x1990('0x25')]=utils[_0x1990('0x26')](members[_0x3b09ad[_0x1990('0x19')]][_0x1990('0x24')],members[_0x3b09ad[_0x1990('0x19')]]['enterAt']);if(members[_0x3b09ad[_0x1990('0x19')]]['uniqueid']){writeDB(members[_0x3b09ad[_0x1990('0x19')]]);}}break;default:break;}}catch(_0xfe9a37){utils[_0x1990('0x27')](util[_0x1990('0x3')](_0x1990('0x28'),members[_0x3b09ad[_0x1990('0x19')]]?members[_0x3b09ad[_0x1990('0x19')]][_0x1990('0x5')]:_0x3b09ad['device']),_0xfe9a37);}};exports['agentcomplete']=function(_0x3d1303){try{if(!_[_0x1990('0x23')](members[_0x3d1303[_0x1990('0x6')]])){utils[_0x1990('0x18')](util[_0x1990('0x3')](_0x1990('0x29'),_0x3d1303[_0x1990('0x5')]),_0x3d1303);utils[_0x1990('0x1a')](util[_0x1990('0x3')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3d1303[_0x1990('0x5')],_0x3d1303['interface'],_0x3d1303['queue']));members[_0x3d1303[_0x1990('0x6')]]=_[_0x1990('0x2a')](members[_0x3d1303[_0x1990('0x6')]],{'data4':_0x3d1303[_0x1990('0x2b')],'uniqueid':_0x3d1303[_0x1990('0x5')]});}}catch(_0x41ce36){utils[_0x1990('0x27')](util['format'](_0x1990('0x29'),_0x3d1303[_0x1990('0x5')]),_0x41ce36);}};exports[_0x1990('0x2c')]=function(_0x2859fc){try{utils[_0x1990('0x18')](util[_0x1990('0x3')](_0x1990('0x2d'),_0x2859fc['uniqueid']),_0x2859fc);if(_0x2859fc[_0x1990('0x7')]){var _0x300a2a=_0x2859fc[_0x1990('0x7')]['split']('-')[0x0];if(!_[_0x1990('0x23')](members[_0x300a2a])){members[_0x300a2a]=_[_0x1990('0x2a')](members[_0x300a2a],{'data1':members[_0x300a2a]['data1']||_0x2859fc[_0x1990('0xa')],'data2':members[_0x300a2a][_0x1990('0x8')]||_0x2859fc[_0x1990('0x2e')],'data3':members[_0x300a2a][_0x1990('0x2f')]||_0x2859fc[_0x1990('0x30')],'uniqueid':members[_0x300a2a]['uniqueid']||_0x2859fc[_0x1990('0x5')]});utils[_0x1990('0x1a')](util[_0x1990('0x3')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2859fc[_0x1990('0x5')],members[_0x300a2a][_0x1990('0x31')],members[_0x300a2a][_0x1990('0x8')],members[_0x300a2a][_0x1990('0x2f')]));if(members[_0x300a2a][_0x1990('0x24')]){writeDB(members[_0x300a2a]);}}}if(_0x2859fc[_0x1990('0x32')]){var _0x142400=_0x2859fc['destinationchannel'][_0x1990('0x11')]('-')[0x0];if(!_[_0x1990('0x23')](members[_0x142400])){members[_0x142400]=_['assign'](members[_0x142400],{'data1':members[_0x142400][_0x1990('0x31')]||_0x2859fc[_0x1990('0xa')],'data2':members[_0x142400][_0x1990('0x8')]||_0x2859fc['source'],'data3':members[_0x142400]['data3']||_0x2859fc['destination'],'uniqueid':members[_0x142400]['uniqueid']||_0x2859fc['uniqueid']});utils[_0x1990('0x1a')](util[_0x1990('0x3')](_0x1990('0x33'),_0x2859fc['uniqueid'],members[_0x142400][_0x1990('0x31')],members[_0x142400]['data2'],members[_0x142400]['data3']));if(members[_0x142400][_0x1990('0x24')]){writeDB(members[_0x142400]);}}}}catch(_0x305fd1){utils[_0x1990('0x27')](util[_0x1990('0x3')](_0x1990('0x2d'),_0x2859fc[_0x1990('0x5')]),_0x305fd1);}}; \ No newline at end of file +var _0xf72b=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','name','internal','request','getUserByName','split','membername','CreateMemberReport','catch','error','some','startsWith','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','./utils','Queue:','format'];(function(_0x503237,_0x5ee8cc){var _0x5dfa8f=function(_0x1c8260){while(--_0x1c8260){_0x503237['push'](_0x503237['shift']());}};_0x5dfa8f(++_0x5ee8cc);}(_0xf72b,0x1d9));var _0xbf72=function(_0x47ede9,_0x3c6d11){_0x47ede9=_0x47ede9-0x0;var _0x30caee=_0xf72b[_0x47ede9];return _0x30caee;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var utils=require(_0xbf72('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xbf72('0x2')];function writeDB(_0x1880d0){utils['info'](util[_0xbf72('0x3')](_0xbf72('0x4'),_0x1880d0[_0xbf72('0x5')],_0x1880d0[_0xbf72('0x6')],_0x1880d0[_0xbf72('0x7')],_0x1880d0[_0xbf72('0x8')],_0x1880d0['membername'],_0x1880d0[_0xbf72('0x9')]));if(_0x1880d0[_0xbf72('0x6')]){utils[_0xbf72('0xa')](_0x1880d0[_0xbf72('0x6')])[_0xbf72('0xb')](function(_0x1b6d38){if(_0x1b6d38){_0x1880d0['membername']=_0x1b6d38[_0xbf72('0xc')];_0x1880d0['internal']=_0x1b6d38[_0xbf72('0xd')];utils[_0xbf72('0xe')]('CreateMemberReport',_0x1880d0);}else{utils[_0xbf72('0xf')](_0x1880d0[_0xbf72('0x6')][_0xbf72('0x10')]('/')[0x1])[_0xbf72('0xb')](function(_0x2957c5){if(_0x2957c5){_0x1880d0[_0xbf72('0x11')]=_0x2957c5[_0xbf72('0xc')];_0x1880d0[_0xbf72('0xd')]=_0x2957c5['internal'];utils[_0xbf72('0xe')](_0xbf72('0x12'),_0x1880d0);}});}})[_0xbf72('0x13')](function(_0x5d8c85){utils[_0xbf72('0x14')](util['format']('[%s][members][writeDB]',_0x1880d0['uniqueid']),_0x5d8c85);});}delete members[_0x1880d0[_0xbf72('0x6')]];}function startsWith(_0xb96906,_0x3af48d){return _[_0xbf72('0x15')](_0xb96906,function(_0x39d0cd){return _[_0xbf72('0x16')](_0x3af48d,_0x39d0cd);});}exports['devicestatechange']=function(_0x266ce2){try{utils[_0xbf72('0x17')](util[_0xbf72('0x3')](_0xbf72('0x18'),members[_0x266ce2[_0xbf72('0x19')]]?members[_0x266ce2['device']]['uniqueid']:_0x266ce2[_0xbf72('0x19')]),_0x266ce2);utils[_0xbf72('0x1a')](util[_0xbf72('0x3')](_0xbf72('0x1b'),members[_0x266ce2[_0xbf72('0x19')]]?members[_0x266ce2[_0xbf72('0x19')]][_0xbf72('0x5')]:_0x266ce2['device'],_0x266ce2[_0xbf72('0x1c')],_0x266ce2[_0xbf72('0x19')]));switch(_0x266ce2[_0xbf72('0x1c')]){case _0xbf72('0x1d'):case _0xbf72('0x1e'):if(!startsWith(exclude,_0x266ce2['device'])){members[_0x266ce2[_0xbf72('0x19')]]={'channel':_0xbf72('0x1f'),'interface':_0x266ce2['device'],'type':_0xbf72('0x20'),'enterAt':utils[_0xbf72('0x21')](),'role':_0xbf72('0x22')};}break;case'NOT_INUSE':if(!_[_0xbf72('0x23')](members[_0x266ce2[_0xbf72('0x19')]])){members[_0x266ce2[_0xbf72('0x19')]][_0xbf72('0x24')]=utils['now']();members[_0x266ce2[_0xbf72('0x19')]][_0xbf72('0x25')]=utils[_0xbf72('0x26')](members[_0x266ce2['device']][_0xbf72('0x24')],members[_0x266ce2[_0xbf72('0x19')]][_0xbf72('0x27')]);if(members[_0x266ce2[_0xbf72('0x19')]][_0xbf72('0x5')]){writeDB(members[_0x266ce2[_0xbf72('0x19')]]);}}break;default:break;}}catch(_0x182154){utils[_0xbf72('0x14')](util[_0xbf72('0x3')](_0xbf72('0x18'),members[_0x266ce2[_0xbf72('0x19')]]?members[_0x266ce2[_0xbf72('0x19')]][_0xbf72('0x5')]:_0x266ce2[_0xbf72('0x19')]),_0x182154);}};exports[_0xbf72('0x28')]=function(_0x51f481){try{if(!_[_0xbf72('0x23')](members[_0x51f481[_0xbf72('0x6')]])){utils[_0xbf72('0x17')](util[_0xbf72('0x3')](_0xbf72('0x29'),_0x51f481[_0xbf72('0x5')]),_0x51f481);utils[_0xbf72('0x1a')](util[_0xbf72('0x3')](_0xbf72('0x2a'),_0x51f481[_0xbf72('0x5')],_0x51f481[_0xbf72('0x6')],_0x51f481[_0xbf72('0x2b')]));members[_0x51f481[_0xbf72('0x6')]]=_[_0xbf72('0x2c')](members[_0x51f481['interface']],{'data4':_0x51f481[_0xbf72('0x2b')],'uniqueid':_0x51f481[_0xbf72('0x5')]});}}catch(_0x3f47e6){utils['error'](util['format']('[%s][members][agentcomplete]',_0x51f481[_0xbf72('0x5')]),_0x3f47e6);}};exports[_0xbf72('0x2d')]=function(_0x2bf209){try{utils['debug'](util[_0xbf72('0x3')](_0xbf72('0x2e'),_0x2bf209['uniqueid']),_0x2bf209);if(_0x2bf209[_0xbf72('0x7')]){var _0x500fee=_0x2bf209[_0xbf72('0x7')][_0xbf72('0x10')]('-')[0x0];if(!_['isNil'](members[_0x500fee])){members[_0x500fee]=_['assign'](members[_0x500fee],{'data1':members[_0x500fee][_0xbf72('0x2f')]||_0x2bf209[_0xbf72('0x9')],'data2':members[_0x500fee][_0xbf72('0x8')]||_0x2bf209[_0xbf72('0x30')],'data3':members[_0x500fee][_0xbf72('0x31')]||_0x2bf209[_0xbf72('0x32')],'uniqueid':members[_0x500fee][_0xbf72('0x5')]||_0x2bf209[_0xbf72('0x5')]});utils[_0xbf72('0x1a')](util['format'](_0xbf72('0x33'),_0x2bf209[_0xbf72('0x5')],members[_0x500fee][_0xbf72('0x2f')],members[_0x500fee][_0xbf72('0x8')],members[_0x500fee]['data3']));if(members[_0x500fee][_0xbf72('0x24')]){writeDB(members[_0x500fee]);}}}if(_0x2bf209[_0xbf72('0x34')]){var _0x4d2ef3=_0x2bf209[_0xbf72('0x34')]['split']('-')[0x0];if(!_['isNil'](members[_0x4d2ef3])){members[_0x4d2ef3]=_['assign'](members[_0x4d2ef3],{'data1':members[_0x4d2ef3]['data1']||_0x2bf209[_0xbf72('0x9')],'data2':members[_0x4d2ef3]['data2']||_0x2bf209['source'],'data3':members[_0x4d2ef3][_0xbf72('0x31')]||_0x2bf209['destination'],'uniqueid':members[_0x4d2ef3][_0xbf72('0x5')]||_0x2bf209[_0xbf72('0x5')]});utils['info'](util[_0xbf72('0x3')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2bf209['uniqueid'],members[_0x4d2ef3][_0xbf72('0x2f')],members[_0x4d2ef3][_0xbf72('0x8')],members[_0x4d2ef3][_0xbf72('0x31')]));if(members[_0x4d2ef3][_0xbf72('0x24')]){writeDB(members[_0x4d2ef3]);}}}}catch(_0xffb333){utils[_0xbf72('0x14')](util[_0xbf72('0x3')](_0xbf72('0x2e'),_0x2bf209['uniqueid']),_0xffb333);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 04065d8..713c787 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 _0x3aed=['calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','variable','value','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','origtransfererlinkedid','secondtransfereruniqueid','secondtransfererexten','transferuniqueid','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo'];(function(_0x175f6f,_0x1a4a05){var _0x1aa501=function(_0x2e4488){while(--_0x2e4488){_0x175f6f['push'](_0x175f6f['shift']());}};_0x1aa501(++_0x1a4a05);}(_0x3aed,0x125));var _0xd3ae=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x3aed[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0xd3ae('0x0'));var util=require(_0xd3ae('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x333918){utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x4'),_0x333918[_0xd3ae('0x5')],_0x333918['channel'],_0x333918['queue'],_0x333918[_0xd3ae('0x6')],_0x333918[_0xd3ae('0x7')],_0x333918['accountcode'],_0x333918[_0xd3ae('0x8')]));if(_0x333918[_0xd3ae('0x9')]){utils[_0xd3ae('0xa')](_0x333918[_0xd3ae('0x9')])[_0xd3ae('0xb')](function(_0xcf113e){if(_0xcf113e){_0x333918[_0xd3ae('0xc')]=_0xcf113e[_0xd3ae('0xc')];}utils[_0xd3ae('0xd')]('CreateVoiceQueueReport',_0x333918);});}else{utils[_0xd3ae('0xd')]('CreateVoiceQueueReport',_0x333918);}if(_0x333918[_0xd3ae('0xe')]){delete queues[_0x333918[_0xd3ae('0xe')]];}else{delete queues[_0x333918[_0xd3ae('0x5')]];}}exports[_0xd3ae('0xf')]=function(_0x3387d0){try{utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x11'),_0x3387d0[_0xd3ae('0x5')]),_0x3387d0);utils[_0xd3ae('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x3387d0[_0xd3ae('0x5')],_0x3387d0[_0xd3ae('0x9')],_0x3387d0[_0xd3ae('0x12')]));queues[_0x3387d0[_0xd3ae('0x5')]]=_['assign'](_0x3387d0,{'originalposition':_0x3387d0[_0xd3ae('0x12')],'queuecallerjoinAt':utils[_0xd3ae('0x13')](),'mohtime':0x0});}catch(_0x4bcedf){utils['error'](util[_0xd3ae('0x3')]('[%s][queues][queuecallerjoin]',_0x3387d0['uniqueid']),_0x4bcedf);}};exports[_0xd3ae('0x14')]=function(_0x2ce8f2){try{if(!_[_0xd3ae('0x15')](queues[_0x2ce8f2[_0xd3ae('0x5')]])){utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x16'),_0x2ce8f2['uniqueid']),_0x2ce8f2);if(queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0x17')]){if(!queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0x18')]&&!queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0x19')]){queues[_0x2ce8f2['uniqueid']][_0xd3ae('0x1a')]=!![];queues[_0x2ce8f2['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x2ce8f2['uniqueid']][_0xd3ae('0x8')]='COMPLETEDBYAGENT';}utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x1b'),_0x2ce8f2[_0xd3ae('0x5')],queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0x1c')],queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0x8')]));writeDB(queues[_0x2ce8f2[_0xd3ae('0x5')]]);}else if(queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0xe')]){utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x1d'),_0x2ce8f2[_0xd3ae('0x5')],queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0x1c')],queues[_0x2ce8f2['uniqueid']][_0xd3ae('0xe')]));queues[queues[_0x2ce8f2[_0xd3ae('0x5')]][_0xd3ae('0xe')]]=queues[_0x2ce8f2[_0xd3ae('0x5')]];queues[queues[_0x2ce8f2['uniqueid']]['transfereduniqueid']][_0xd3ae('0x1e')]=0x2;delete queues[_0x2ce8f2[_0xd3ae('0x5')]];}}}catch(_0x475e98){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')](_0xd3ae('0x16'),_0x2ce8f2[_0xd3ae('0x5')]),_0x475e98);}};exports[_0xd3ae('0x20')]=function(_0x1bc256){try{utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')]('[%s][queues][varset]',_0x1bc256[_0xd3ae('0x5')]),_0x1bc256);if(!_[_0xd3ae('0x15')](_0x1bc256[_0xd3ae('0x21')]['queuestatus'])&&_0x1bc256[_0xd3ae('0x22')]['toUpperCase']()!==_0xd3ae('0x23')){if(!_[_0xd3ae('0x15')](queues[_0x1bc256[_0xd3ae('0x5')]])){queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x18')]=![];queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x24')]=null;queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x19')]=!![];queues[_0x1bc256[_0xd3ae('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x8')]=_0x1bc256[_0xd3ae('0x22')]['toUpperCase']();utils['info'](util[_0xd3ae('0x3')](_0xd3ae('0x25'),_0x1bc256[_0xd3ae('0x5')],queues[_0x1bc256['uniqueid']][_0xd3ae('0x1c')],_0x1bc256[_0xd3ae('0x22')],queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x8')]));writeDB(queues[_0x1bc256[_0xd3ae('0x5')]]);}}else if(!_[_0xd3ae('0x15')](_0x1bc256['variable'][_0xd3ae('0x26')])){if(!_[_0xd3ae('0x15')](queues[_0x1bc256[_0xd3ae('0x5')]])&&!queues[_0x1bc256['uniqueid']][_0xd3ae('0x18')]){queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x18')]=![];queues[_0x1bc256[_0xd3ae('0x5')]]['queuecallerabandonAt']=null;queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x19')]=!![];queues[_0x1bc256[_0xd3ae('0x5')]]['queuecallerexitAt']=utils[_0xd3ae('0x13')]();queues[_0x1bc256[_0xd3ae('0x5')]][_0xd3ae('0x8')]=_0xd3ae('0x27');utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1bc256[_0xd3ae('0x5')],queues[_0x1bc256['uniqueid']][_0xd3ae('0x1c')],_0x1bc256[_0xd3ae('0x22')],queues[_0x1bc256[_0xd3ae('0x5')]]['queuecallerexitreason']));}}}catch(_0x55cd7e){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')]('[%s][queues][varset]',_0x1bc256['uniqueid']),_0x55cd7e);}};exports['queuecallerabandon']=function(_0x190a06){try{if(!_[_0xd3ae('0x15')](queues[_0x190a06['uniqueid']])){utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')]('[%s][queues][queuecallerabandon]',_0x190a06[_0xd3ae('0x5')]),_0x190a06);queues[_0x190a06[_0xd3ae('0x5')]][_0xd3ae('0x19')]=![];queues[_0x190a06[_0xd3ae('0x5')]][_0xd3ae('0x28')]=null;queues[_0x190a06[_0xd3ae('0x5')]][_0xd3ae('0x18')]=!![];queues[_0x190a06['uniqueid']][_0xd3ae('0x24')]=utils[_0xd3ae('0x13')]();queues[_0x190a06['uniqueid']][_0xd3ae('0x8')]=_0xd3ae('0x29');utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x2a'),_0x190a06[_0xd3ae('0x5')],queues[_0x190a06[_0xd3ae('0x5')]][_0xd3ae('0x1c')],queues[_0x190a06[_0xd3ae('0x5')]][_0xd3ae('0x8')]));}}catch(_0x1e200b){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')](_0xd3ae('0x2b'),_0x190a06[_0xd3ae('0x5')]),_0x1e200b);}};exports[_0xd3ae('0x2c')]=function(_0x1c2a7c){try{if(!_['isNil'](queues[_0x1c2a7c['uniqueid']])){utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x2d'),_0x1c2a7c['uniqueid']),_0x1c2a7c);utils[_0xd3ae('0x2')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1c2a7c[_0xd3ae('0x5')],queues[_0x1c2a7c['uniqueid']][_0xd3ae('0x1c')],_0x1c2a7c[_0xd3ae('0x2e')],_0x1c2a7c[_0xd3ae('0x2f')]));queues[_0x1c2a7c['uniqueid']]['queuecallerleave']=!![];queues[_0x1c2a7c[_0xd3ae('0x5')]][_0xd3ae('0x17')]=utils['now']();queues[_0x1c2a7c[_0xd3ae('0x5')]][_0xd3ae('0x30')]=utils[_0xd3ae('0x31')](queues[_0x1c2a7c[_0xd3ae('0x5')]]['queuecallerleaveAt'],queues[_0x1c2a7c[_0xd3ae('0x5')]][_0xd3ae('0x32')]);queues[_0x1c2a7c[_0xd3ae('0x5')]]['position']=_0x1c2a7c[_0xd3ae('0x12')];queues[_0x1c2a7c[_0xd3ae('0x5')]][_0xd3ae('0x33')]=_0x1c2a7c['count'];queues[_0x1c2a7c['uniqueid']]['connectedlinenum']=_0x1c2a7c[_0xd3ae('0x2e')];queues[_0x1c2a7c['uniqueid']][_0xd3ae('0x2f')]=_0x1c2a7c[_0xd3ae('0x2f')];}}catch(_0x8cb2d4){utils['error'](util[_0xd3ae('0x3')](_0xd3ae('0x2d'),_0x1c2a7c['uniqueid']),_0x8cb2d4);}};exports['agentconnect']=function(_0x10db86){try{if(!_[_0xd3ae('0x15')](queues[_0x10db86[_0xd3ae('0x5')]])){utils['debug'](util[_0xd3ae('0x3')](_0xd3ae('0x34'),_0x10db86[_0xd3ae('0x5')]),_0x10db86);utils['info'](util[_0xd3ae('0x3')](_0xd3ae('0x35'),_0x10db86[_0xd3ae('0x5')],queues[_0x10db86[_0xd3ae('0x5')]][_0xd3ae('0x1c')],_0x10db86[_0xd3ae('0x36')],_0x10db86['destaccountcode']));queues[_0x10db86[_0xd3ae('0x5')]]['queuecallerabandon']=![];queues[_0x10db86[_0xd3ae('0x5')]][_0xd3ae('0x18')]=![];queues[_0x10db86[_0xd3ae('0x5')]][_0xd3ae('0x24')]=null;queues[_0x10db86['uniqueid']]['queuecallerexit']=![];queues[_0x10db86[_0xd3ae('0x5')]]['queuecallerexitreason']=null;queues[_0x10db86['uniqueid']][_0xd3ae('0x28')]=null;queues[_0x10db86[_0xd3ae('0x5')]][_0xd3ae('0x37')]=!![];queues[_0x10db86[_0xd3ae('0x5')]][_0xd3ae('0x38')]=_0x10db86[_0xd3ae('0x39')];queues[_0x10db86['uniqueid']][_0xd3ae('0x6')]=_0x10db86[_0xd3ae('0x36')];}}catch(_0x5c2512){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')]('[%s][queues][agentconnect]',_0x10db86[_0xd3ae('0x5')]),_0x5c2512);}};exports[_0xd3ae('0x3a')]=function(_0x550ff8){try{if(!_[_0xd3ae('0x15')](queues[_0x550ff8[_0xd3ae('0x5')]])){if(queues[_0x550ff8[_0xd3ae('0x5')]][_0xd3ae('0x17')]){utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x3b'),_0x550ff8[_0xd3ae('0x5')]),_0x550ff8);queues[_0x550ff8['uniqueid']]['queuecallerabandon']=![];queues[_0x550ff8[_0xd3ae('0x5')]][_0xd3ae('0x18')]=![];queues[_0x550ff8[_0xd3ae('0x5')]][_0xd3ae('0x24')]=null;queues[_0x550ff8['uniqueid']][_0xd3ae('0x19')]=![];queues[_0x550ff8[_0xd3ae('0x5')]]['queuecallerexitAt']=null;queues[_0x550ff8[_0xd3ae('0x5')]]['assigned']=!![];queues[_0x550ff8[_0xd3ae('0x5')]]['lastAssignedTo']=_0x550ff8[_0xd3ae('0x36')];queues[_0x550ff8['uniqueid']][_0xd3ae('0x1a')]=!![];queues[_0x550ff8['uniqueid']][_0xd3ae('0x3c')]=utils[_0xd3ae('0x13')]();if(_0x550ff8[_0xd3ae('0x3d')]==_0xd3ae('0x3e')){if(!queues[_0x550ff8[_0xd3ae('0x5')]][_0xd3ae('0x3e')]){queues[_0x550ff8[_0xd3ae('0x5')]][_0xd3ae('0x8')]=_0xd3ae('0x3f');}}else{queues[_0x550ff8[_0xd3ae('0x5')]]['queuecallerexitreason']=_0xd3ae('0x40')+_0x550ff8[_0xd3ae('0x3d')]['toUpperCase']();}utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x41'),_0x550ff8[_0xd3ae('0x5')],queues[_0x550ff8[_0xd3ae('0x5')]][_0xd3ae('0x1c')],_0x550ff8[_0xd3ae('0x36')],queues[_0x550ff8['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x550ff8[_0xd3ae('0x5')]]);}}}catch(_0x1a6732){utils[_0xd3ae('0x1f')](util['format'](_0xd3ae('0x3b'),_0x550ff8['uniqueid']),_0x1a6732);}};exports[_0xd3ae('0x42')]=function(_0x4283bf){try{if(!_[_0xd3ae('0x15')](queues[_0x4283bf[_0xd3ae('0x43')]])){utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x44'),_0x4283bf[_0xd3ae('0x5')]),_0x4283bf);queues[_0x4283bf[_0xd3ae('0x43')]][_0xd3ae('0x3e')]=!![];queues[_0x4283bf[_0xd3ae('0x43')]][_0xd3ae('0x45')]=_0xd3ae('0x46');queues[_0x4283bf[_0xd3ae('0x43')]][_0xd3ae('0x47')]=_0x4283bf[_0xd3ae('0x48')];queues[_0x4283bf[_0xd3ae('0x43')]]['transferuniqueid']=_0x4283bf['transfereeuniqueid'];queues[_0x4283bf[_0xd3ae('0x43')]][_0xd3ae('0x8')]=_0xd3ae('0x49');utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x4a'),_0x4283bf[_0xd3ae('0x5')],queues[_0x4283bf[_0xd3ae('0x43')]][_0xd3ae('0x1c')],_0x4283bf['transfereeuniqueid'],_0x4283bf[_0xd3ae('0x48')]));}}catch(_0x4579b5){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')](_0xd3ae('0x44'),_0x4283bf[_0xd3ae('0x5')]),_0x4579b5);}};exports[_0xd3ae('0x4b')]=function(_0x2d4fa1){try{utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x4c'),_0x2d4fa1['origtransfereruniqueid']),_0x2d4fa1);if(_0x2d4fa1[_0xd3ae('0x4d')]==_0x2d4fa1['origtransfererlinkedid']){if(!_['isNil'](queues[_0x2d4fa1[_0xd3ae('0x4e')]])){utils['info'](util[_0xd3ae('0x3')](_0xd3ae('0x4f'),_0x2d4fa1[_0xd3ae('0x4d')],queues[_0x2d4fa1[_0xd3ae('0x4e')]][_0xd3ae('0x1c')],_0x2d4fa1[_0xd3ae('0x50')]));queues[_0x2d4fa1['secondtransfererlinkedid']][_0xd3ae('0x3e')]=!![];queues[_0x2d4fa1[_0xd3ae('0x4e')]][_0xd3ae('0x45')]=_0xd3ae('0x51');queues[_0x2d4fa1[_0xd3ae('0x4e')]][_0xd3ae('0x47')]=_0x2d4fa1[_0xd3ae('0x50')];queues[_0x2d4fa1[_0xd3ae('0x4e')]]['transferuniqueid']=_0x2d4fa1['origtransfereruniqueid'];queues[_0x2d4fa1[_0xd3ae('0x4e')]]['queuecallerexitreason']=_0xd3ae('0x52');}if(!_['isNil'](queues[_0x2d4fa1['origtransfererlinkedid']])){if(_0x2d4fa1['transfereelinkedid']&&queues[_0x2d4fa1[_0xd3ae('0x53')]]){queues[_0x2d4fa1[_0xd3ae('0x53')]][_0xd3ae('0x1e')]=0x1;queues[_0x2d4fa1['transfereeuniqueid']]=_['clone'](queues[_0x2d4fa1[_0xd3ae('0x53')]]);queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0xe')]=_0x2d4fa1[_0xd3ae('0x54')];queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x1e')]=0x2;queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x7')]=queues[_0x2d4fa1[_0xd3ae('0x4e')]][_0xd3ae('0x7')];queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x55')]=queues[_0x2d4fa1[_0xd3ae('0x4e')]][_0xd3ae('0x55')];queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x32')]=utils[_0xd3ae('0x13')]();queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x17')]=utils[_0xd3ae('0x13')]();queues[_0x2d4fa1[_0xd3ae('0x43')]]['holdtime']=0x0;queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x56')]=0x0;utils['info'](util[_0xd3ae('0x3')](_0xd3ae('0x57'),_0x2d4fa1[_0xd3ae('0x4d')],queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x1c')],queues[_0x2d4fa1['transfereeuniqueid']][_0xd3ae('0x7')],queues[_0x2d4fa1[_0xd3ae('0x43')]][_0xd3ae('0x55')]));}else{utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2d4fa1['origtransfereruniqueid'],queues[_0x2d4fa1[_0xd3ae('0x58')]][_0xd3ae('0x1c')],_0x2d4fa1[_0xd3ae('0x4e')]));queues[_0x2d4fa1[_0xd3ae('0x58')]][_0xd3ae('0xe')]=_0x2d4fa1[_0xd3ae('0x4e')];}}}else if(_0x2d4fa1['secondtransfereruniqueid']==_0x2d4fa1[_0xd3ae('0x4e')]){if(!_[_0xd3ae('0x15')](queues[_0x2d4fa1['origtransfererlinkedid']])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2d4fa1[_0xd3ae('0x4d')],queues[_0x2d4fa1[_0xd3ae('0x58')]][_0xd3ae('0x1c')],_0x2d4fa1[_0xd3ae('0x59')],_0x2d4fa1[_0xd3ae('0x5a')]));queues[_0x2d4fa1[_0xd3ae('0x58')]][_0xd3ae('0x3e')]=!![];queues[_0x2d4fa1[_0xd3ae('0x58')]]['transfertype']=_0xd3ae('0x51');queues[_0x2d4fa1[_0xd3ae('0x58')]]['transferexten']=_0x2d4fa1[_0xd3ae('0x5a')];queues[_0x2d4fa1['origtransfererlinkedid']][_0xd3ae('0x5b')]=_0x2d4fa1[_0xd3ae('0x59')];queues[_0x2d4fa1[_0xd3ae('0x58')]][_0xd3ae('0x8')]=_0xd3ae('0x52');}if(!_[_0xd3ae('0x15')](queues[_0x2d4fa1[_0xd3ae('0x4e')]])){if(_0x2d4fa1[_0xd3ae('0x5c')]&&queues[_0x2d4fa1[_0xd3ae('0x5c')]]){queues[_0x2d4fa1[_0xd3ae('0x5c')]][_0xd3ae('0x1e')]=0x1;queues[_0x2d4fa1[_0xd3ae('0x54')]]=_[_0xd3ae('0x5d')](queues[_0x2d4fa1[_0xd3ae('0x5c')]]);queues[_0x2d4fa1[_0xd3ae('0x54')]]['transfereduniqueid']=_0x2d4fa1['transfertargetuniqueid'];queues[_0x2d4fa1['transfertargetuniqueid']][_0xd3ae('0x1e')]=0x2;queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0x7')]=queues[_0x2d4fa1[_0xd3ae('0x58')]]['calleridnum'];queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0x55')]=queues[_0x2d4fa1[_0xd3ae('0x58')]][_0xd3ae('0x55')];queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0x32')]=utils[_0xd3ae('0x13')]();queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0x17')]=utils[_0xd3ae('0x13')]();queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0x30')]=0x0;queues[_0x2d4fa1[_0xd3ae('0x54')]]['mohtime']=0x0;utils[_0xd3ae('0x2')](util['format'](_0xd3ae('0x5e'),_0x2d4fa1['origtransfereruniqueid'],queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0x1c')],queues[_0x2d4fa1[_0xd3ae('0x54')]][_0xd3ae('0xe')],queues[_0x2d4fa1[_0xd3ae('0x54')]]['calleridnum'],queues[_0x2d4fa1[_0xd3ae('0x54')]]['calleridname']));}else{utils[_0xd3ae('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2d4fa1[_0xd3ae('0x4d')],queues[_0x2d4fa1[_0xd3ae('0x4e')]][_0xd3ae('0x1c')],_0x2d4fa1[_0xd3ae('0x58')]));queues[_0x2d4fa1[_0xd3ae('0x4e')]]['transfereduniqueid']=_0x2d4fa1['origtransfererlinkedid'];}}}}catch(_0x3cc099){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')](_0xd3ae('0x4c'),_0x2d4fa1[_0xd3ae('0x4d')]),_0x3cc099);}};exports[_0xd3ae('0x5f')]=function(_0x4a82fc){try{if(!_[_0xd3ae('0x15')](queues[_0x4a82fc[_0xd3ae('0x5')]])){utils[_0xd3ae('0x10')](util[_0xd3ae('0x3')](_0xd3ae('0x60'),_0x4a82fc[_0xd3ae('0x5')]),_0x4a82fc);queues[_0x4a82fc[_0xd3ae('0x5')]]['musiconholdstartAt']=utils[_0xd3ae('0x13')]();utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x61'),_0x4a82fc[_0xd3ae('0x5')],queues[_0x4a82fc[_0xd3ae('0x5')]]['name'],queues[_0x4a82fc[_0xd3ae('0x5')]]['musiconholdstartAt']));}}catch(_0x48f4ba){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')](_0xd3ae('0x60'),_0x4a82fc[_0xd3ae('0x5')]),_0x48f4ba);}};exports['musiconholdstop']=function(_0x4f9cef){try{if(!_[_0xd3ae('0x15')](queues[_0x4f9cef[_0xd3ae('0x5')]])){if(!_['isNil'](queues[_0x4f9cef[_0xd3ae('0x5')]]['musiconholdstartAt'])){utils['debug'](util['format'](_0xd3ae('0x62'),_0x4f9cef[_0xd3ae('0x5')]),_0x4f9cef);queues[_0x4f9cef[_0xd3ae('0x5')]]['mohtime']+=utils[_0xd3ae('0x31')](utils[_0xd3ae('0x13')](),queues[_0x4f9cef[_0xd3ae('0x5')]]['musiconholdstartAt']);utils[_0xd3ae('0x2')](util[_0xd3ae('0x3')](_0xd3ae('0x63'),_0x4f9cef[_0xd3ae('0x5')],queues[_0x4f9cef[_0xd3ae('0x5')]][_0xd3ae('0x1c')],queues[_0x4f9cef['uniqueid']][_0xd3ae('0x56')]));delete queues[_0x4f9cef[_0xd3ae('0x5')]]['musiconholdstartAt'];}}}catch(_0x29f1f4){utils[_0xd3ae('0x1f')](util[_0xd3ae('0x3')]('[%s][queues][musiconholdstop]',_0x4f9cef['uniqueid']),_0x29f1f4);}}; \ No newline at end of file +var _0x962b=['[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','transferuniqueid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x962b,0xbb));var _0xb962=function(_0x3eb325,_0x2a194d){_0x3eb325=_0x3eb325-0x0;var _0x454d31=_0x962b[_0x3eb325];return _0x454d31;};'use strict';var _=require(_0xb962('0x0'));var util=require(_0xb962('0x1'));var utils=require(_0xb962('0x2'));var queues={};function writeDB(_0x144436){utils[_0xb962('0x3')](util[_0xb962('0x4')](_0xb962('0x5'),_0x144436[_0xb962('0x6')],_0x144436[_0xb962('0x7')],_0x144436[_0xb962('0x8')],_0x144436[_0xb962('0x9')],_0x144436[_0xb962('0xa')],_0x144436[_0xb962('0xb')],_0x144436[_0xb962('0xc')]));if(_0x144436[_0xb962('0x8')]){utils[_0xb962('0xd')](_0x144436[_0xb962('0x8')])[_0xb962('0xe')](function(_0xd0e084){if(_0xd0e084){_0x144436[_0xb962('0xf')]=_0xd0e084[_0xb962('0xf')];}utils[_0xb962('0x10')](_0xb962('0x11'),_0x144436);});}else{utils['request'](_0xb962('0x11'),_0x144436);}if(_0x144436[_0xb962('0x12')]){delete queues[_0x144436['transfereduniqueid']];}else{delete queues[_0x144436[_0xb962('0x6')]];}}exports['queuecallerjoin']=function(_0x5e1652){try{utils[_0xb962('0x13')](util[_0xb962('0x4')](_0xb962('0x14'),_0x5e1652['uniqueid']),_0x5e1652);utils[_0xb962('0x3')](util[_0xb962('0x4')](_0xb962('0x15'),_0x5e1652[_0xb962('0x6')],_0x5e1652[_0xb962('0x8')],_0x5e1652[_0xb962('0x16')]));queues[_0x5e1652[_0xb962('0x6')]]=_[_0xb962('0x17')](_0x5e1652,{'originalposition':_0x5e1652[_0xb962('0x16')],'queuecallerjoinAt':utils[_0xb962('0x18')](),'mohtime':0x0});}catch(_0x217598){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x14'),_0x5e1652[_0xb962('0x6')]),_0x217598);}};exports[_0xb962('0x1a')]=function(_0x2e8268){try{if(!_['isNil'](queues[_0x2e8268['uniqueid']])){utils[_0xb962('0x13')](util[_0xb962('0x4')](_0xb962('0x1b'),_0x2e8268['uniqueid']),_0x2e8268);if(queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x1c')]){if(!queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x1d')]&&!queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x1e')]){queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x1f')]=!![];queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x20')]=utils['now']();queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0xc')]='COMPLETEDBYAGENT';}utils[_0xb962('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x2e8268[_0xb962('0x6')],queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x21')],queues[_0x2e8268[_0xb962('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x2e8268[_0xb962('0x6')]]);}else if(queues[_0x2e8268['uniqueid']][_0xb962('0x12')]){utils[_0xb962('0x3')](util['format'](_0xb962('0x22'),_0x2e8268[_0xb962('0x6')],queues[_0x2e8268['uniqueid']][_0xb962('0x21')],queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x12')]));queues[queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x12')]]=queues[_0x2e8268[_0xb962('0x6')]];queues[queues[_0x2e8268[_0xb962('0x6')]][_0xb962('0x12')]][_0xb962('0x23')]=0x2;delete queues[_0x2e8268[_0xb962('0x6')]];}}}catch(_0x56b6a0){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x1b'),_0x2e8268['uniqueid']),_0x56b6a0);}};exports[_0xb962('0x24')]=function(_0x1e33e){try{utils['debug'](util[_0xb962('0x4')](_0xb962('0x25'),_0x1e33e[_0xb962('0x6')]),_0x1e33e);if(!_[_0xb962('0x26')](_0x1e33e[_0xb962('0x27')][_0xb962('0x28')])&&_0x1e33e[_0xb962('0x29')][_0xb962('0x2a')]()!=='CONTINUE'){if(!_[_0xb962('0x26')](queues[_0x1e33e['uniqueid']])){queues[_0x1e33e['uniqueid']][_0xb962('0x1d')]=![];queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x2b')]=null;queues[_0x1e33e[_0xb962('0x6')]]['queuecallerexit']=!![];queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x2c')]=utils[_0xb962('0x18')]();queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0xc')]=_0x1e33e[_0xb962('0x29')]['toUpperCase']();utils[_0xb962('0x3')](util['format'](_0xb962('0x2d'),_0x1e33e['uniqueid'],queues[_0x1e33e['uniqueid']][_0xb962('0x21')],_0x1e33e[_0xb962('0x29')],queues[_0x1e33e['uniqueid']][_0xb962('0xc')]));writeDB(queues[_0x1e33e[_0xb962('0x6')]]);}}else if(!_[_0xb962('0x26')](_0x1e33e[_0xb962('0x27')][_0xb962('0x2e')])){if(!_[_0xb962('0x26')](queues[_0x1e33e[_0xb962('0x6')]])&&!queues[_0x1e33e['uniqueid']][_0xb962('0x1d')]){queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x1d')]=![];queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x2b')]=null;queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x1e')]=!![];queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x2c')]=utils[_0xb962('0x18')]();queues[_0x1e33e[_0xb962('0x6')]]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util['format'](_0xb962('0x2f'),_0x1e33e[_0xb962('0x6')],queues[_0x1e33e[_0xb962('0x6')]][_0xb962('0x21')],_0x1e33e[_0xb962('0x29')],queues[_0x1e33e[_0xb962('0x6')]]['queuecallerexitreason']));}}}catch(_0x5f4db3){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x25'),_0x1e33e[_0xb962('0x6')]),_0x5f4db3);}};exports[_0xb962('0x1d')]=function(_0x197e20){try{if(!_[_0xb962('0x26')](queues[_0x197e20[_0xb962('0x6')]])){utils['debug'](util[_0xb962('0x4')](_0xb962('0x30'),_0x197e20[_0xb962('0x6')]),_0x197e20);queues[_0x197e20[_0xb962('0x6')]]['queuecallerexit']=![];queues[_0x197e20[_0xb962('0x6')]]['queuecallerexitAt']=null;queues[_0x197e20[_0xb962('0x6')]][_0xb962('0x1d')]=!![];queues[_0x197e20[_0xb962('0x6')]]['queuecallerabandonAt']=utils['now']();queues[_0x197e20[_0xb962('0x6')]][_0xb962('0xc')]=_0xb962('0x31');utils[_0xb962('0x3')](util[_0xb962('0x4')](_0xb962('0x32'),_0x197e20['uniqueid'],queues[_0x197e20[_0xb962('0x6')]][_0xb962('0x21')],queues[_0x197e20['uniqueid']]['queuecallerexitreason']));}}catch(_0x550397){utils['error'](util[_0xb962('0x4')](_0xb962('0x30'),_0x197e20[_0xb962('0x6')]),_0x550397);}};exports[_0xb962('0x33')]=function(_0x2be590){try{if(!_[_0xb962('0x26')](queues[_0x2be590['uniqueid']])){utils['debug'](util['format'](_0xb962('0x34'),_0x2be590[_0xb962('0x6')]),_0x2be590);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2be590['uniqueid'],queues[_0x2be590[_0xb962('0x6')]]['name'],_0x2be590[_0xb962('0x35')],_0x2be590[_0xb962('0x36')]));queues[_0x2be590['uniqueid']]['queuecallerleave']=!![];queues[_0x2be590[_0xb962('0x6')]][_0xb962('0x1c')]=utils[_0xb962('0x18')]();queues[_0x2be590[_0xb962('0x6')]][_0xb962('0x37')]=utils[_0xb962('0x38')](queues[_0x2be590[_0xb962('0x6')]][_0xb962('0x1c')],queues[_0x2be590[_0xb962('0x6')]]['queuecallerjoinAt']);queues[_0x2be590['uniqueid']]['position']=_0x2be590[_0xb962('0x16')];queues[_0x2be590[_0xb962('0x6')]][_0xb962('0x39')]=_0x2be590[_0xb962('0x39')];queues[_0x2be590[_0xb962('0x6')]][_0xb962('0x35')]=_0x2be590['connectedlinenum'];queues[_0x2be590[_0xb962('0x6')]][_0xb962('0x36')]=_0x2be590[_0xb962('0x36')];}}catch(_0x544c5f){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x34'),_0x2be590[_0xb962('0x6')]),_0x544c5f);}};exports[_0xb962('0x3a')]=function(_0x2ca81d){try{if(!_['isNil'](queues[_0x2ca81d[_0xb962('0x6')]])){utils['debug'](util[_0xb962('0x4')](_0xb962('0x3b'),_0x2ca81d[_0xb962('0x6')]),_0x2ca81d);utils['info'](util[_0xb962('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2ca81d[_0xb962('0x6')],queues[_0x2ca81d[_0xb962('0x6')]][_0xb962('0x21')],_0x2ca81d[_0xb962('0x3c')],_0x2ca81d[_0xb962('0x3d')]));queues[_0x2ca81d[_0xb962('0x6')]][_0xb962('0x1d')]=![];queues[_0x2ca81d['uniqueid']]['queuecallerabandon']=![];queues[_0x2ca81d[_0xb962('0x6')]]['queuecallerabandonAt']=null;queues[_0x2ca81d[_0xb962('0x6')]][_0xb962('0x1e')]=![];queues[_0x2ca81d[_0xb962('0x6')]]['queuecallerexitreason']=null;queues[_0x2ca81d[_0xb962('0x6')]][_0xb962('0x2c')]=null;queues[_0x2ca81d['uniqueid']][_0xb962('0x3e')]=!![];queues[_0x2ca81d[_0xb962('0x6')]][_0xb962('0xb')]=_0x2ca81d[_0xb962('0x3d')];queues[_0x2ca81d[_0xb962('0x6')]][_0xb962('0x9')]=_0x2ca81d['membername'];}}catch(_0x504781){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x3b'),_0x2ca81d[_0xb962('0x6')]),_0x504781);}};exports[_0xb962('0x3f')]=function(_0x17f9ba){try{if(!_[_0xb962('0x26')](queues[_0x17f9ba['uniqueid']])){if(queues[_0x17f9ba[_0xb962('0x6')]]['queuecallerleaveAt']){utils[_0xb962('0x13')](util[_0xb962('0x4')]('[%s][queues][agentcomplete]',_0x17f9ba[_0xb962('0x6')]),_0x17f9ba);queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0x1d')]=![];queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0x1d')]=![];queues[_0x17f9ba['uniqueid']]['queuecallerabandonAt']=null;queues[_0x17f9ba['uniqueid']][_0xb962('0x1e')]=![];queues[_0x17f9ba[_0xb962('0x6')]]['queuecallerexitAt']=null;queues[_0x17f9ba[_0xb962('0x6')]]['assigned']=!![];queues[_0x17f9ba[_0xb962('0x6')]]['lastAssignedTo']=_0x17f9ba['membername'];queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0x1f')]=!![];queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0x20')]=utils[_0xb962('0x18')]();if(_0x17f9ba['reason']==_0xb962('0x40')){if(!queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0x40')]){queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0xc')]='TRANSFER';}}else{queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0xc')]=_0xb962('0x41')+_0x17f9ba[_0xb962('0x42')][_0xb962('0x2a')]();}utils[_0xb962('0x3')](util['format'](_0xb962('0x43'),_0x17f9ba['uniqueid'],queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0x21')],_0x17f9ba[_0xb962('0x3c')],queues[_0x17f9ba[_0xb962('0x6')]][_0xb962('0xc')]));writeDB(queues[_0x17f9ba[_0xb962('0x6')]]);}}}catch(_0x5011c9){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x44'),_0x17f9ba[_0xb962('0x6')]),_0x5011c9);}};exports['blindtransfer']=function(_0x3e8c9b){try{if(!_[_0xb962('0x26')](queues[_0x3e8c9b[_0xb962('0x45')]])){utils['debug'](util[_0xb962('0x4')]('[%s][queues][blindtransfer]',_0x3e8c9b[_0xb962('0x6')]),_0x3e8c9b);queues[_0x3e8c9b['transfereeuniqueid']][_0xb962('0x40')]=!![];queues[_0x3e8c9b[_0xb962('0x45')]]['transfertype']=_0xb962('0x46');queues[_0x3e8c9b[_0xb962('0x45')]][_0xb962('0x47')]=_0x3e8c9b[_0xb962('0x48')];queues[_0x3e8c9b['transfereeuniqueid']]['transferuniqueid']=_0x3e8c9b[_0xb962('0x45')];queues[_0x3e8c9b[_0xb962('0x45')]]['queuecallerexitreason']=_0xb962('0x49');utils[_0xb962('0x3')](util[_0xb962('0x4')](_0xb962('0x4a'),_0x3e8c9b[_0xb962('0x6')],queues[_0x3e8c9b[_0xb962('0x45')]][_0xb962('0x21')],_0x3e8c9b[_0xb962('0x45')],_0x3e8c9b['extension']));}}catch(_0x136bfe){utils[_0xb962('0x19')](util['format']('[%s][queues][blindtransfer]',_0x3e8c9b[_0xb962('0x6')]),_0x136bfe);}};exports[_0xb962('0x4b')]=function(_0x319faa){try{utils[_0xb962('0x13')](util[_0xb962('0x4')](_0xb962('0x4c'),_0x319faa[_0xb962('0x4d')]),_0x319faa);if(_0x319faa['origtransfereruniqueid']==_0x319faa[_0xb962('0x4e')]){if(!_[_0xb962('0x26')](queues[_0x319faa[_0xb962('0x4f')]])){utils[_0xb962('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x319faa[_0xb962('0x4d')],queues[_0x319faa[_0xb962('0x4f')]]['name'],_0x319faa['origtransfererexten']));queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0x40')]=!![];queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0x50')]=_0xb962('0x51');queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0x47')]=_0x319faa[_0xb962('0x52')];queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0x53')]=_0x319faa[_0xb962('0x4d')];queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0xc')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x319faa[_0xb962('0x4e')]])){if(_0x319faa[_0xb962('0x54')]&&queues[_0x319faa['transfereelinkedid']]){queues[_0x319faa[_0xb962('0x54')]]['queuecallerenterreason']=0x1;queues[_0x319faa['transfereeuniqueid']]=_[_0xb962('0x55')](queues[_0x319faa[_0xb962('0x54')]]);queues[_0x319faa['transfereeuniqueid']][_0xb962('0x12')]=_0x319faa[_0xb962('0x56')];queues[_0x319faa[_0xb962('0x45')]][_0xb962('0x23')]=0x2;queues[_0x319faa[_0xb962('0x45')]][_0xb962('0xa')]=queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0xa')];queues[_0x319faa[_0xb962('0x45')]][_0xb962('0x57')]=queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0x57')];queues[_0x319faa[_0xb962('0x45')]][_0xb962('0x58')]=utils[_0xb962('0x18')]();queues[_0x319faa[_0xb962('0x45')]][_0xb962('0x1c')]=utils[_0xb962('0x18')]();queues[_0x319faa[_0xb962('0x45')]]['holdtime']=0x0;queues[_0x319faa[_0xb962('0x45')]]['mohtime']=0x0;utils[_0xb962('0x3')](util['format'](_0xb962('0x59'),_0x319faa['origtransfereruniqueid'],queues[_0x319faa[_0xb962('0x45')]]['name'],queues[_0x319faa[_0xb962('0x45')]]['calleridnum'],queues[_0x319faa[_0xb962('0x45')]][_0xb962('0x57')]));}else{utils['info'](util[_0xb962('0x4')](_0xb962('0x5a'),_0x319faa['origtransfereruniqueid'],queues[_0x319faa[_0xb962('0x4e')]][_0xb962('0x21')],_0x319faa[_0xb962('0x4f')]));queues[_0x319faa[_0xb962('0x4e')]]['transfereduniqueid']=_0x319faa['secondtransfererlinkedid'];}}}else if(_0x319faa[_0xb962('0x5b')]==_0x319faa[_0xb962('0x4f')]){if(!_['isNil'](queues[_0x319faa[_0xb962('0x4e')]])){utils[_0xb962('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x319faa[_0xb962('0x4d')],queues[_0x319faa['origtransfererlinkedid']][_0xb962('0x21')],_0x319faa[_0xb962('0x5b')],_0x319faa[_0xb962('0x5c')]));queues[_0x319faa['origtransfererlinkedid']][_0xb962('0x40')]=!![];queues[_0x319faa['origtransfererlinkedid']][_0xb962('0x50')]=_0xb962('0x51');queues[_0x319faa[_0xb962('0x4e')]][_0xb962('0x47')]=_0x319faa[_0xb962('0x5c')];queues[_0x319faa[_0xb962('0x4e')]]['transferuniqueid']=_0x319faa['secondtransfereruniqueid'];queues[_0x319faa[_0xb962('0x4e')]][_0xb962('0xc')]=_0xb962('0x5d');}if(!_[_0xb962('0x26')](queues[_0x319faa['secondtransfererlinkedid']])){if(_0x319faa[_0xb962('0x5e')]&&queues[_0x319faa[_0xb962('0x5e')]]){queues[_0x319faa[_0xb962('0x5e')]][_0xb962('0x23')]=0x1;queues[_0x319faa['transfertargetuniqueid']]=_[_0xb962('0x55')](queues[_0x319faa[_0xb962('0x5e')]]);queues[_0x319faa[_0xb962('0x56')]]['transfereduniqueid']=_0x319faa[_0xb962('0x56')];queues[_0x319faa[_0xb962('0x56')]][_0xb962('0x23')]=0x2;queues[_0x319faa[_0xb962('0x56')]][_0xb962('0xa')]=queues[_0x319faa[_0xb962('0x4e')]][_0xb962('0xa')];queues[_0x319faa[_0xb962('0x56')]][_0xb962('0x57')]=queues[_0x319faa[_0xb962('0x4e')]]['calleridname'];queues[_0x319faa[_0xb962('0x56')]][_0xb962('0x58')]=utils[_0xb962('0x18')]();queues[_0x319faa[_0xb962('0x56')]][_0xb962('0x1c')]=utils[_0xb962('0x18')]();queues[_0x319faa['transfertargetuniqueid']][_0xb962('0x37')]=0x0;queues[_0x319faa[_0xb962('0x56')]][_0xb962('0x5f')]=0x0;utils[_0xb962('0x3')](util[_0xb962('0x4')](_0xb962('0x60'),_0x319faa[_0xb962('0x4d')],queues[_0x319faa['transfertargetuniqueid']][_0xb962('0x21')],queues[_0x319faa[_0xb962('0x56')]][_0xb962('0x12')],queues[_0x319faa[_0xb962('0x56')]][_0xb962('0xa')],queues[_0x319faa['transfertargetuniqueid']]['calleridname']));}else{utils[_0xb962('0x3')](util['format'](_0xb962('0x5a'),_0x319faa['origtransfereruniqueid'],queues[_0x319faa[_0xb962('0x4f')]]['name'],_0x319faa[_0xb962('0x4e')]));queues[_0x319faa[_0xb962('0x4f')]][_0xb962('0x12')]=_0x319faa[_0xb962('0x4e')];}}}}catch(_0x58dcc4){utils[_0xb962('0x19')](util[_0xb962('0x4')](_0xb962('0x4c'),_0x319faa[_0xb962('0x4d')]),_0x58dcc4);}};exports[_0xb962('0x61')]=function(_0x3cb947){try{if(!_['isNil'](queues[_0x3cb947['uniqueid']])){utils['debug'](util[_0xb962('0x4')](_0xb962('0x62'),_0x3cb947[_0xb962('0x6')]),_0x3cb947);queues[_0x3cb947[_0xb962('0x6')]][_0xb962('0x63')]=utils['now']();utils['info'](util[_0xb962('0x4')](_0xb962('0x64'),_0x3cb947[_0xb962('0x6')],queues[_0x3cb947[_0xb962('0x6')]]['name'],queues[_0x3cb947['uniqueid']][_0xb962('0x63')]));}}catch(_0x346ef3){utils['error'](util[_0xb962('0x4')](_0xb962('0x62'),_0x3cb947[_0xb962('0x6')]),_0x346ef3);}};exports[_0xb962('0x65')]=function(_0x38ccc3){try{if(!_[_0xb962('0x26')](queues[_0x38ccc3[_0xb962('0x6')]])){if(!_[_0xb962('0x26')](queues[_0x38ccc3[_0xb962('0x6')]][_0xb962('0x63')])){utils[_0xb962('0x13')](util[_0xb962('0x4')](_0xb962('0x66'),_0x38ccc3[_0xb962('0x6')]),_0x38ccc3);queues[_0x38ccc3[_0xb962('0x6')]][_0xb962('0x5f')]+=utils['diffTime'](utils[_0xb962('0x18')](),queues[_0x38ccc3['uniqueid']][_0xb962('0x63')]);utils[_0xb962('0x3')](util[_0xb962('0x4')](_0xb962('0x67'),_0x38ccc3[_0xb962('0x6')],queues[_0x38ccc3[_0xb962('0x6')]][_0xb962('0x21')],queues[_0x38ccc3[_0xb962('0x6')]][_0xb962('0x5f')]));delete queues[_0x38ccc3[_0xb962('0x6')]][_0xb962('0x63')];}}}catch(_0x47d9c2){utils[_0xb962('0x19')](util['format'](_0xb962('0x66'),_0x38ccc3[_0xb962('0x6')]),_0x47d9c2);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 31c54f9..10be67e 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 _0x5097=['set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','accountcode','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','error','varset','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase'];(function(_0x1fba53,_0x6095cc){var _0x4fff9b=function(_0x5c5205){while(--_0x5c5205){_0x1fba53['push'](_0x1fba53['shift']());}};_0x4fff9b(++_0x6095cc);}(_0x5097,0x1bb));var _0x7509=function(_0x49f765,_0x15d520){_0x49f765=_0x49f765-0x0;var _0x2cceb7=_0x5097[_0x49f765];return _0x2cceb7;};'use strict';var _=require(_0x7509('0x0'));var util=require('util');var utils=require(_0x7509('0x1'));var recordings={};function writeDB(_0x4e1e5f){utils[_0x7509('0x2')](util[_0x7509('0x3')](_0x7509('0x4'),_0x4e1e5f[_0x7509('0x5')]));if(_0x4e1e5f['accountcode']){utils[_0x7509('0x6')](_0x4e1e5f['accountcode'])['then'](function(_0x3bedb6){if(_0x3bedb6){_0x4e1e5f[_0x7509('0x7')]=_0x3bedb6['name'];_0x4e1e5f[_0x7509('0x8')]=_0x3bedb6['id'];}utils[_0x7509('0x9')]('CreateVoiceRecording',_0x4e1e5f);});}else{utils['request'](_0x7509('0xa'),_0x4e1e5f);}}exports[_0x7509('0xb')]=function(_0x40f450){try{utils[_0x7509('0xc')](util['format'](_0x7509('0xd'),_0x40f450['uniqueid']),_0x40f450);if(_0x40f450[_0x7509('0x5')]==_0x40f450[_0x7509('0xe')]){utils[_0x7509('0x2')](util[_0x7509('0x3')](_0x7509('0xf'),_0x40f450[_0x7509('0x5')],_0x40f450[_0x7509('0x10')],_0x40f450[_0x7509('0x11')]));recordings[_0x40f450[_0x7509('0x5')]]={'uniqueid':_0x40f450[_0x7509('0x5')],'accountcode':_0x40f450[_0x7509('0x12')],'exten':_0x40f450[_0x7509('0x11')],'context':_0x40f450[_0x7509('0x10')],'channel':_0x40f450[_0x7509('0x13')],'monitors':[]};}}catch(_0x18ab33){utils['error'](util['format']('[%s][recordings][newchannel]',_0x40f450['uniqueid']),_0x18ab33);}};exports[_0x7509('0x14')]=function(_0x17b137){try{utils['debug'](util[_0x7509('0x3')](_0x7509('0x15'),_0x17b137[_0x7509('0x5')]),_0x17b137);if(!_[_0x7509('0x16')](recordings[_0x17b137[_0x7509('0x5')]])&&_0x17b137['channelstate']==0x6){utils[_0x7509('0x2')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x17b137['uniqueid'],_0x17b137['context'],_0x17b137[_0x7509('0x13')]));}else if(!_[_0x7509('0x16')](recordings[_0x17b137[_0x7509('0xe')]])&&_0x17b137[_0x7509('0x17')]==0x6&&_0x17b137[_0x7509('0x10')]!=_0x7509('0x18')){utils['info'](util[_0x7509('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x17b137[_0x7509('0x5')],_0x17b137[_0x7509('0xe')],_0x17b137[_0x7509('0x10')],_0x17b137[_0x7509('0x13')]));recordings[_0x17b137['linkedid']][_0x7509('0x12')]=_0x17b137[_0x7509('0x12')];}}catch(_0x52daa5){utils[_0x7509('0x19')](util[_0x7509('0x3')](_0x7509('0x15'),_0x17b137['uniqueid']),_0x52daa5);}};exports[_0x7509('0x1a')]=function(_0x244c4a){try{if(!_['isNil'](_0x244c4a['variable'])&&!_['isNil'](_0x244c4a['variable']['mixmonitor_filename'])){utils[_0x7509('0xc')](util[_0x7509('0x3')](_0x7509('0x1b'),_0x244c4a[_0x7509('0x5')]),_0x244c4a);utils['info'](util[_0x7509('0x3')](_0x7509('0x1c'),_0x244c4a[_0x7509('0x5')],_0x244c4a[_0x7509('0x1d')],_0x244c4a[_0x7509('0x1e')]));if(_[_0x7509('0x1f')](_0x244c4a[_0x7509('0x1e')],_0x7509('0x20'))){_0x244c4a[_0x7509('0x1e')]=_0x244c4a[_0x7509('0x1e')][_0x7509('0x21')](_0x7509('0x20'),_0x7509('0x22'));}if(recordings[_0x244c4a[_0x7509('0xe')]]){var _0x700cab=_[_0x7509('0x23')](recordings[_0x244c4a[_0x7509('0xe')]][_0x7509('0x24')],{'value':_0x244c4a[_0x7509('0x1e')]});if(_[_0x7509('0x16')](_0x700cab)){recordings[_0x244c4a[_0x7509('0xe')]][_0x7509('0x24')][_0x7509('0x25')]({'value':_0x244c4a[_0x7509('0x1e')]});}}}}catch(_0x3d4df1){utils['error'](util['format'](_0x7509('0x1b'),_0x244c4a[_0x7509('0x5')]),_0x3d4df1);}};exports[_0x7509('0x26')]=function(_0x3afd70){try{if(!_[_0x7509('0x16')](recordings[_0x3afd70[_0x7509('0x5')]])){utils[_0x7509('0xc')](util[_0x7509('0x3')](_0x7509('0x27'),_0x3afd70[_0x7509('0x5')]),_0x3afd70);utils[_0x7509('0x2')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3afd70[_0x7509('0x5')],_0x3afd70['calleridnum'],_0x3afd70[_0x7509('0x28')],_0x3afd70[_0x7509('0x29')]));recordings[_0x3afd70[_0x7509('0x5')]][_0x7509('0x2a')]=_0x3afd70['calleridnum'];recordings[_0x3afd70[_0x7509('0x5')]][_0x7509('0x28')]=_0x3afd70[_0x7509('0x28')];recordings[_0x3afd70[_0x7509('0x5')]][_0x7509('0x2b')]=_0x3afd70[_0x7509('0x2b')];recordings[_0x3afd70['uniqueid']][_0x7509('0x2c')]=_0x3afd70[_0x7509('0x2c')];if(recordings[_0x3afd70['uniqueid']][_0x7509('0x2d')]==_0x7509('0x2e')&&recordings[_0x3afd70['uniqueid']][_0x7509('0x12')]){recordings[_0x3afd70[_0x7509('0x5')]][_0x7509('0x2b')]=recordings[_0x3afd70[_0x7509('0x5')]]['accountcode'];recordings[_0x3afd70[_0x7509('0x5')]][_0x7509('0x2c')]='';}recordings[_0x3afd70['uniqueid']]['monitors'][_0x7509('0x2f')](function(_0x1e8421){var _0x39d36b=_['clone'](recordings[_0x3afd70[_0x7509('0x5')]]);_0x39d36b['value']=_0x1e8421['value'];writeDB(_0x39d36b);});delete recordings[_0x3afd70[_0x7509('0x5')]];}}catch(_0x54a1eb){utils['error'](util[_0x7509('0x3')](_0x7509('0x27'),_0x3afd70[_0x7509('0x5')]),_0x54a1eb);}};exports[_0x7509('0x30')]=function(_0x31d6e3){try{if(!_[_0x7509('0x16')](recordings[_0x31d6e3[_0x7509('0x5')]])){utils['debug'](util[_0x7509('0x3')]('[%s][recordings][newexten]',_0x31d6e3[_0x7509('0x5')]),_0x31d6e3);utils[_0x7509('0x2')](util[_0x7509('0x3')](_0x7509('0x31'),_0x31d6e3[_0x7509('0x5')],_0x31d6e3['application'],_0x31d6e3[_0x7509('0x32')]));if(_0x31d6e3[_0x7509('0x33')][_0x7509('0x34')]()==_0x7509('0x35')&&_[_0x7509('0x36')](_0x31d6e3[_0x7509('0x32')][_0x7509('0x34')](),_0x7509('0x37'))){var _0x43f259=_0x31d6e3[_0x7509('0x32')][_0x7509('0x38')]('=');var _0x3f279e=_0x43f259[0x0]['substring'](_0x43f259[0x0][_0x7509('0x39')]('(')+0x1,_0x43f259[0x0]['lastIndexOf'](')'));var _0x36fab5=_0x43f259[0x1];recordings[_0x31d6e3[_0x7509('0x5')]][_0x3f279e]=_0x36fab5;}}}catch(_0x1b24d9){utils['error'](util[_0x7509('0x3')]('[%s][recordings][newexten]',_0x31d6e3['uniqueid']),_0x1b24d9);}};exports[_0x7509('0x3a')]=function(_0x3337c5){try{if(!_[_0x7509('0x16')](recordings[_0x3337c5['uniqueid']])){utils[_0x7509('0xc')](util[_0x7509('0x3')]('[%s][recordings][queuecallerjoin]',_0x3337c5[_0x7509('0x5')]),_0x3337c5);utils['info'](util['format'](_0x7509('0x3b'),_0x3337c5[_0x7509('0x5')],_0x3337c5[_0x7509('0x3c')]));recordings[_0x3337c5[_0x7509('0x5')]][_0x7509('0x3c')]=_0x3337c5[_0x7509('0x3c')];}}catch(_0x587cd7){utils['error'](util[_0x7509('0x3')](_0x7509('0x3d'),_0x3337c5[_0x7509('0x5')]),_0x587cd7);}}; \ No newline at end of file +var _0xd421=['calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','then','membername','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','uniqueid','info','format','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','accountcode','varset','variable','[%s][recordings][varset]','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridname','cause-txt'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xd421,0x90));var _0x1d42=function(_0x5e36ad,_0x3dc0bc){_0x5e36ad=_0x5e36ad-0x0;var _0x2f5508=_0xd421[_0x5e36ad];return _0x2f5508;};'use strict';var _=require(_0x1d42('0x0'));var util=require(_0x1d42('0x1'));var utils=require(_0x1d42('0x2'));var recordings={};function writeDB(_0x3c9da7){utils['info'](util['format']('[%s][recordings][writeDB]',_0x3c9da7['uniqueid']));if(_0x3c9da7['accountcode']){utils['getUserByInternal'](_0x3c9da7['accountcode'])[_0x1d42('0x3')](function(_0x49ea1c){if(_0x49ea1c){_0x3c9da7[_0x1d42('0x4')]=_0x49ea1c['name'];_0x3c9da7['UserId']=_0x49ea1c['id'];}utils['request'](_0x1d42('0x5'),_0x3c9da7);});}else{utils[_0x1d42('0x6')](_0x1d42('0x5'),_0x3c9da7);}}exports[_0x1d42('0x7')]=function(_0x3a33b3){try{utils[_0x1d42('0x8')](util['format'](_0x1d42('0x9'),_0x3a33b3['uniqueid']),_0x3a33b3);if(_0x3a33b3[_0x1d42('0xa')]==_0x3a33b3['linkedid']){utils[_0x1d42('0xb')](util[_0x1d42('0xc')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3a33b3[_0x1d42('0xa')],_0x3a33b3['context'],_0x3a33b3['exten']));recordings[_0x3a33b3[_0x1d42('0xa')]]={'uniqueid':_0x3a33b3[_0x1d42('0xa')],'accountcode':_0x3a33b3['accountcode'],'exten':_0x3a33b3['exten'],'context':_0x3a33b3[_0x1d42('0xd')],'channel':_0x3a33b3[_0x1d42('0xe')],'monitors':[]};}}catch(_0x40170e){utils[_0x1d42('0xf')](util['format'](_0x1d42('0x9'),_0x3a33b3[_0x1d42('0xa')]),_0x40170e);}};exports[_0x1d42('0x10')]=function(_0x53880d){try{utils[_0x1d42('0x8')](util[_0x1d42('0xc')](_0x1d42('0x11'),_0x53880d[_0x1d42('0xa')]),_0x53880d);if(!_[_0x1d42('0x12')](recordings[_0x53880d[_0x1d42('0xa')]])&&_0x53880d[_0x1d42('0x13')]==0x6){utils['info'](util[_0x1d42('0xc')](_0x1d42('0x14'),_0x53880d[_0x1d42('0xa')],_0x53880d[_0x1d42('0xd')],_0x53880d[_0x1d42('0xe')]));}else if(!_['isNil'](recordings[_0x53880d[_0x1d42('0x15')]])&&_0x53880d[_0x1d42('0x13')]==0x6&&_0x53880d[_0x1d42('0xd')]!=_0x1d42('0x16')){utils[_0x1d42('0xb')](util[_0x1d42('0xc')](_0x1d42('0x17'),_0x53880d['uniqueid'],_0x53880d['linkedid'],_0x53880d[_0x1d42('0xd')],_0x53880d[_0x1d42('0xe')]));recordings[_0x53880d[_0x1d42('0x15')]]['accountcode']=_0x53880d[_0x1d42('0x18')];}}catch(_0x449feb){utils[_0x1d42('0xf')](util[_0x1d42('0xc')](_0x1d42('0x11'),_0x53880d['uniqueid']),_0x449feb);}};exports[_0x1d42('0x19')]=function(_0x49cb44){try{if(!_['isNil'](_0x49cb44[_0x1d42('0x1a')])&&!_[_0x1d42('0x12')](_0x49cb44[_0x1d42('0x1a')]['mixmonitor_filename'])){utils['debug'](util[_0x1d42('0xc')](_0x1d42('0x1b'),_0x49cb44[_0x1d42('0xa')]),_0x49cb44);utils[_0x1d42('0xb')](util[_0x1d42('0xc')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x49cb44[_0x1d42('0xa')],_0x49cb44[_0x1d42('0x1a')],_0x49cb44[_0x1d42('0x1c')]));if(_['endsWith'](_0x49cb44[_0x1d42('0x1c')],_0x1d42('0x1d'))){_0x49cb44[_0x1d42('0x1c')]=_0x49cb44[_0x1d42('0x1c')][_0x1d42('0x1e')](_0x1d42('0x1d'),_0x1d42('0x1f'));}if(recordings[_0x49cb44[_0x1d42('0x15')]]){var _0xa9fbdd=_[_0x1d42('0x20')](recordings[_0x49cb44[_0x1d42('0x15')]][_0x1d42('0x21')],{'value':_0x49cb44['value']});if(_[_0x1d42('0x12')](_0xa9fbdd)){recordings[_0x49cb44[_0x1d42('0x15')]][_0x1d42('0x21')][_0x1d42('0x22')]({'value':_0x49cb44[_0x1d42('0x1c')]});}}}}catch(_0x3df984){utils[_0x1d42('0xf')](util[_0x1d42('0xc')](_0x1d42('0x1b'),_0x49cb44[_0x1d42('0xa')]),_0x3df984);}};exports[_0x1d42('0x23')]=function(_0x52ff08){try{if(!_[_0x1d42('0x12')](recordings[_0x52ff08[_0x1d42('0xa')]])){utils[_0x1d42('0x8')](util[_0x1d42('0xc')](_0x1d42('0x24'),_0x52ff08[_0x1d42('0xa')]),_0x52ff08);utils[_0x1d42('0xb')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x52ff08[_0x1d42('0xa')],_0x52ff08['calleridnum'],_0x52ff08[_0x1d42('0x25')],_0x52ff08[_0x1d42('0x26')]));recordings[_0x52ff08[_0x1d42('0xa')]][_0x1d42('0x27')]=_0x52ff08[_0x1d42('0x27')];recordings[_0x52ff08[_0x1d42('0xa')]]['calleridname']=_0x52ff08['calleridname'];recordings[_0x52ff08[_0x1d42('0xa')]][_0x1d42('0x28')]=_0x52ff08['connectedlinenum'];recordings[_0x52ff08[_0x1d42('0xa')]]['connectedlinename']=_0x52ff08[_0x1d42('0x29')];if(recordings[_0x52ff08[_0x1d42('0xa')]][_0x1d42('0x2a')]==_0x1d42('0x2b')&&recordings[_0x52ff08[_0x1d42('0xa')]][_0x1d42('0x18')]){recordings[_0x52ff08[_0x1d42('0xa')]]['connectedlinenum']=recordings[_0x52ff08[_0x1d42('0xa')]][_0x1d42('0x18')];recordings[_0x52ff08['uniqueid']][_0x1d42('0x29')]='';}recordings[_0x52ff08[_0x1d42('0xa')]][_0x1d42('0x21')][_0x1d42('0x2c')](function(_0x2adf89){var _0x187b35=_[_0x1d42('0x2d')](recordings[_0x52ff08[_0x1d42('0xa')]]);_0x187b35[_0x1d42('0x1c')]=_0x2adf89[_0x1d42('0x1c')];writeDB(_0x187b35);});delete recordings[_0x52ff08[_0x1d42('0xa')]];}}catch(_0xd515c4){utils[_0x1d42('0xf')](util[_0x1d42('0xc')](_0x1d42('0x24'),_0x52ff08[_0x1d42('0xa')]),_0xd515c4);}};exports[_0x1d42('0x2e')]=function(_0x3487b9){try{if(!_[_0x1d42('0x12')](recordings[_0x3487b9[_0x1d42('0xa')]])){utils[_0x1d42('0x8')](util['format'](_0x1d42('0x2f'),_0x3487b9[_0x1d42('0xa')]),_0x3487b9);utils[_0x1d42('0xb')](util[_0x1d42('0xc')](_0x1d42('0x30'),_0x3487b9[_0x1d42('0xa')],_0x3487b9[_0x1d42('0x31')],_0x3487b9[_0x1d42('0x32')]));if(_0x3487b9[_0x1d42('0x31')][_0x1d42('0x33')]()==_0x1d42('0x34')&&_[_0x1d42('0x35')](_0x3487b9[_0x1d42('0x32')][_0x1d42('0x33')](),'cdr')){var _0x438e0b=_0x3487b9['appdata'][_0x1d42('0x36')]('=');var _0x3c67ab=_0x438e0b[0x0][_0x1d42('0x37')](_0x438e0b[0x0][_0x1d42('0x38')]('(')+0x1,_0x438e0b[0x0][_0x1d42('0x38')](')'));var _0x1685ac=_0x438e0b[0x1];recordings[_0x3487b9['uniqueid']][_0x3c67ab]=_0x1685ac;}}}catch(_0x2972c6){utils[_0x1d42('0xf')](util[_0x1d42('0xc')](_0x1d42('0x2f'),_0x3487b9[_0x1d42('0xa')]),_0x2972c6);}};exports[_0x1d42('0x39')]=function(_0x3468d1){try{if(!_[_0x1d42('0x12')](recordings[_0x3468d1[_0x1d42('0xa')]])){utils[_0x1d42('0x8')](util[_0x1d42('0xc')]('[%s][recordings][queuecallerjoin]',_0x3468d1[_0x1d42('0xa')]),_0x3468d1);utils['info'](util[_0x1d42('0xc')](_0x1d42('0x3a'),_0x3468d1[_0x1d42('0xa')],_0x3468d1[_0x1d42('0x3b')]));recordings[_0x3468d1[_0x1d42('0xa')]]['queue']=_0x3468d1[_0x1d42('0x3b')];}}catch(_0x1c9f79){utils['error'](util[_0x1d42('0xc')](_0x1d42('0x3c'),_0x3468d1[_0x1d42('0xa')]),_0x1c9f79);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index cf92a04..91803ec 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 _0x5c09=['type','CreateVoiceTransferReport','debug','format','[%s][transfers][blindtransfer]','uniqueid','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetlinkedid','./utils','info','attended','origtransfereruniqueid'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x5c09,0x7c));var _0x95c0=function(_0x4a73c0,_0x1072e3){_0x4a73c0=_0x4a73c0-0x0;var _0x3b4fa3=_0x5c09[_0x4a73c0];return _0x3b4fa3;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x95c0('0x0'));function writeDB(_0x45a470){utils[_0x95c0('0x1')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x45a470['type']===_0x95c0('0x2')?_0x45a470[_0x95c0('0x3')]:_0x45a470['uniqueid'],_0x45a470[_0x95c0('0x4')]));utils['request'](_0x95c0('0x5'),_0x45a470);}exports['blindtransfer']=function(_0x314e19){try{utils[_0x95c0('0x6')](util[_0x95c0('0x7')](_0x95c0('0x8'),_0x314e19[_0x95c0('0x9')]),_0x314e19);utils[_0x95c0('0x1')](util[_0x95c0('0x7')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x314e19[_0x95c0('0x9')],_0x314e19['transferercalleridnum'],_0x314e19[_0x95c0('0xa')],_0x314e19[_0x95c0('0xb')],_0x314e19[_0x95c0('0xc')]));_0x314e19[_0x95c0('0x4')]=_0x95c0('0xd');writeDB(_0x314e19);}catch(_0x979f1e){utils[_0x95c0('0xe')](util[_0x95c0('0x7')](_0x95c0('0x8'),_0x314e19['uniqueid']),_0x979f1e);}};exports[_0x95c0('0xf')]=function(_0x28e2e9){try{utils[_0x95c0('0x6')](util[_0x95c0('0x7')](_0x95c0('0x10'),_0x28e2e9['origtransfereruniqueid']),_0x28e2e9);utils[_0x95c0('0x1')](util['format'](_0x95c0('0x11'),_0x28e2e9['origtransfereruniqueid'],_0x28e2e9[_0x95c0('0x12')],_0x28e2e9[_0x95c0('0x13')],_0x28e2e9[_0x95c0('0x14')],_0x28e2e9[_0x95c0('0x15')]));_0x28e2e9=_['assign'](_0x28e2e9,{'transfererchannel':_0x28e2e9[_0x95c0('0x16')],'transferercalleridnum':_0x28e2e9[_0x95c0('0x12')],'transferercalleridname':_0x28e2e9['origtransferercalleridname'],'transfererconnectedlinenum':_0x28e2e9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x28e2e9[_0x95c0('0x17')],'transfereraccountcode':_0x28e2e9['origtransfereraccountcode'],'transferercontext':_0x28e2e9['secondtransferercontext'],'transfererexten':_0x28e2e9[_0x95c0('0x18')],'transfererlinkedid':_0x28e2e9['origtransfererlinkedid'],'context':_0x28e2e9[_0x95c0('0x19')],'extension':_0x28e2e9[_0x95c0('0x1a')],'type':_0x95c0('0x2')});if(_[_0x95c0('0x1b')](_0x28e2e9[_0x95c0('0x1c')])){_0x28e2e9=_['assign'](_0x28e2e9,{'transfereechannel':_0x28e2e9[_0x95c0('0x1d')],'transfereecalleridnum':_0x28e2e9[_0x95c0('0x14')],'transfereecalleridname':_0x28e2e9[_0x95c0('0x15')],'transfereeconnectedlinenum':_0x28e2e9['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x28e2e9[_0x95c0('0x1e')],'transfereeaccountcode':_0x28e2e9['transfertargetaccountcode'],'transfereecontext':_0x28e2e9['transfertargetcontext'],'transfereeexten':_0x28e2e9['transfertargetexten'],'transfereelinkedid':_0x28e2e9[_0x95c0('0x1f')]});}writeDB(_0x28e2e9);}catch(_0x34da02){utils['error'](util['format'](_0x95c0('0x10'),_0x28e2e9[_0x95c0('0x3')]),_0x34da02);}}; \ No newline at end of file +var _0x37c2=['util','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','format','transferercalleridnum','transfereecalleridnum','transfereecalleridname','error','[%s][transfers][blindtransfer]','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererexten','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0x37c2,0x180));var _0x237c=function(_0x354d7c,_0x3d7071){_0x354d7c=_0x354d7c-0x0;var _0x4ef775=_0x37c2[_0x354d7c];return _0x4ef775;};'use strict';var _=require('lodash');var util=require(_0x237c('0x0'));var utils=require('./utils');function writeDB(_0xd04de6){utils[_0x237c('0x1')](util['format'](_0x237c('0x2'),_0xd04de6[_0x237c('0x3')]===_0x237c('0x4')?_0xd04de6[_0x237c('0x5')]:_0xd04de6[_0x237c('0x6')],_0xd04de6[_0x237c('0x3')]));utils[_0x237c('0x7')](_0x237c('0x8'),_0xd04de6);}exports[_0x237c('0x9')]=function(_0x1ebd0b){try{utils['debug'](util[_0x237c('0xa')]('[%s][transfers][blindtransfer]',_0x1ebd0b[_0x237c('0x6')]),_0x1ebd0b);utils[_0x237c('0x1')](util[_0x237c('0xa')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1ebd0b[_0x237c('0x6')],_0x1ebd0b[_0x237c('0xb')],_0x1ebd0b['transferercalleridname'],_0x1ebd0b[_0x237c('0xc')],_0x1ebd0b[_0x237c('0xd')]));_0x1ebd0b[_0x237c('0x3')]='blind';writeDB(_0x1ebd0b);}catch(_0x2c6761){utils[_0x237c('0xe')](util['format'](_0x237c('0xf'),_0x1ebd0b[_0x237c('0x6')]),_0x2c6761);}};exports['attendedtransfer']=function(_0x1fd76f){try{utils[_0x237c('0x10')](util['format'](_0x237c('0x11'),_0x1fd76f['origtransfereruniqueid']),_0x1fd76f);utils[_0x237c('0x1')](util['format'](_0x237c('0x12'),_0x1fd76f[_0x237c('0x5')],_0x1fd76f[_0x237c('0x13')],_0x1fd76f[_0x237c('0x14')],_0x1fd76f[_0x237c('0x15')],_0x1fd76f[_0x237c('0x16')]));_0x1fd76f=_[_0x237c('0x17')](_0x1fd76f,{'transfererchannel':_0x1fd76f[_0x237c('0x18')],'transferercalleridnum':_0x1fd76f[_0x237c('0x13')],'transferercalleridname':_0x1fd76f[_0x237c('0x14')],'transfererconnectedlinenum':_0x1fd76f[_0x237c('0x19')],'transfererconnectedlinename':_0x1fd76f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1fd76f['origtransfereraccountcode'],'transferercontext':_0x1fd76f['secondtransferercontext'],'transfererexten':_0x1fd76f[_0x237c('0x1a')],'transfererlinkedid':_0x1fd76f['origtransfererlinkedid'],'context':_0x1fd76f['origtransferercontext'],'extension':_0x1fd76f[_0x237c('0x1b')],'type':_0x237c('0x4')});if(_[_0x237c('0x1c')](_0x1fd76f[_0x237c('0x1d')])){_0x1fd76f=_['assign'](_0x1fd76f,{'transfereechannel':_0x1fd76f['transfertargetchannel'],'transfereecalleridnum':_0x1fd76f[_0x237c('0x15')],'transfereecalleridname':_0x1fd76f['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1fd76f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1fd76f[_0x237c('0x1e')],'transfereeaccountcode':_0x1fd76f[_0x237c('0x1f')],'transfereecontext':_0x1fd76f['transfertargetcontext'],'transfereeexten':_0x1fd76f['transfertargetexten'],'transfereelinkedid':_0x1fd76f['transfertargetlinkedid']});}writeDB(_0x1fd76f);}catch(_0x578b10){utils[_0x237c('0xe')](util[_0x237c('0xa')](_0x237c('0x11'),_0x1fd76f[_0x237c('0x5')]),_0x578b10);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 54bf1e6..9a094c4 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 _0x75d2=['add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]'];(function(_0xa0c9a4,_0x2299cd){var _0x4d6c9e=function(_0x1cbcce){while(--_0x1cbcce){_0xa0c9a4['push'](_0xa0c9a4['shift']());}};_0x4d6c9e(++_0x2299cd);}(_0x75d2,0x152));var _0x275d=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x75d2[_0x413b4d];return _0x8b810a;};'use strict';var BPromise=require(_0x275d('0x0'));var jayson=require(_0x275d('0x1'));var moment=require(_0x275d('0x2'));var util=require(_0x275d('0x3'));var client=jayson[_0x275d('0x4')][_0x275d('0x5')]({'port':0x2329});var logger=require(_0x275d('0x6'))('xdr');exports[_0x275d('0x7')]=function(_0x5ac92c,_0x33719c){logger[_0x275d('0x7')](_0x5ac92c,_0x33719c?util[_0x275d('0x8')](_0x33719c,{'showHidden':![],'depth':null}):'');};exports[_0x275d('0x9')]=function(_0x2025e5,_0x23af36){logger['debug'](_0x2025e5,_0x23af36?util[_0x275d('0x8')](_0x23af36,{'showHidden':![],'depth':null}):'');};exports[_0x275d('0xa')]=function(_0xcbe115,_0x13d5ed){logger['error'](_0xcbe115,_0x13d5ed?util[_0x275d('0x8')](_0x13d5ed,{'showHidden':![],'depth':null}):'');};exports[_0x275d('0xb')]=function(_0x112220,_0x2a87f1){return client[_0x275d('0xb')](_0x112220,{'body':_0x2a87f1})[_0x275d('0xc')](function(_0x2d966e){logger[_0x275d('0x9')](_0x275d('0xd'),_0x112220,_0x2d966e?util[_0x275d('0x8')](_0x2d966e,{'showHidden':![],'depth':null}):'');})[_0x275d('0xe')](function(_0xab607c){logger[_0x275d('0xa')](_0x275d('0xd'),_0x112220,_0xab607c?util[_0x275d('0x8')](_0xab607c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x59dfcc){return client[_0x275d('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x275d('0xf'),_0x275d('0x10'),_0x275d('0x11')],'where':_0x59dfcc,'limit':0x1}})[_0x275d('0xc')](function(_0x214b3d){logger[_0x275d('0x9')](_0x275d('0x12'),JSON[_0x275d('0x13')](_0x59dfcc),_0x214b3d?util[_0x275d('0x8')](_0x214b3d,{'showHidden':![],'depth':null}):'');return _0x214b3d['result']['length']?_0x214b3d[_0x275d('0x14')][0x0]:null;});}exports[_0x275d('0x15')]=function(_0x396b89){return new BPromise(function(_0x498c6a,_0x5e9fd7){if(_0x396b89){return getUser({'internal':_0x396b89})['then'](function(_0x3706b8){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x396b89,_0x3706b8?_0x275d('0x16'):'notfound');return _0x498c6a(_0x3706b8);})[_0x275d('0xe')](function(_0x3670fd){logger['error'](_0x275d('0x17'),_0x3670fd?util[_0x275d('0x8')](_0x3670fd,{'showHidden':![],'depth':null}):'');return _0x498c6a(null);});}return _0x498c6a(null);});};exports[_0x275d('0x18')]=function(_0x13fd44){return new BPromise(function(_0x22f7b1,_0x2f13ba){if(_0x13fd44){return getUser({'interface':_0x13fd44})[_0x275d('0xc')](function(_0x2c4aa9){logger[_0x275d('0x7')](_0x275d('0x19'),_0x13fd44,_0x2c4aa9?_0x275d('0x16'):_0x275d('0x1a'));return _0x22f7b1(_0x2c4aa9);})[_0x275d('0xe')](function(_0x18a45e){logger['error'](_0x275d('0x1b'),_0x18a45e?util[_0x275d('0x8')](_0x18a45e,{'showHidden':![],'depth':null}):'');return _0x22f7b1(null);});}return _0x22f7b1(null);});};exports[_0x275d('0x1c')]=function(_0x1ca467){return new BPromise(function(_0x54a257,_0x579615){if(_0x1ca467){return getUser({'name':_0x1ca467})[_0x275d('0xc')](function(_0x4f8f9e){logger[_0x275d('0x7')](_0x275d('0x1d'),_0x1ca467,_0x4f8f9e?_0x275d('0x16'):'notfound');return _0x54a257(_0x4f8f9e);})[_0x275d('0xe')](function(_0x4122b0){logger[_0x275d('0xa')]('[utils][getUserByName]',_0x4122b0?util['inspect'](_0x4122b0,{'showHidden':![],'depth':null}):'');return _0x54a257(null);});}return _0x54a257(null);});};exports[_0x275d('0x1e')]=function(_0x2fb9b9){return new BPromise(function(_0x2ea21f,_0x3b89d2){if(_0x2fb9b9){return client[_0x275d('0xb')](_0x275d('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x275d('0x10'),_0x275d('0x20'),_0x275d('0x21'),_0x275d('0x22')],'where':{'name':_0x2fb9b9},'limit':0x1}})[_0x275d('0xc')](function(_0x14cf8c){logger[_0x275d('0x9')](_0x275d('0x23'),_0x2fb9b9,_0x14cf8c?util['inspect'](_0x14cf8c,{'showHidden':![],'depth':null}):'');logger[_0x275d('0x7')](_0x275d('0x24'),_0x2fb9b9,_0x14cf8c?_0x275d('0x16'):_0x275d('0x1a'));return _0x2ea21f(_0x14cf8c[_0x275d('0x14')]['length']?_0x14cf8c[_0x275d('0x14')][0x0]:null);})[_0x275d('0xe')](function(_0x381f3a){logger[_0x275d('0xa')](_0x275d('0x25'),_0x381f3a?util[_0x275d('0x8')](_0x381f3a,{'showHidden':![],'depth':null}):'');return _0x2ea21f(null);});}return _0x2ea21f(null);});};exports['addTime']=function(_0x5ef15,_0x593c03){return moment(_0x5ef15)[_0x275d('0x26')](_0x593c03,'seconds')[_0x275d('0x27')](_0x275d('0x28'));};exports[_0x275d('0x29')]=function(_0x172e22,_0x53dc16){return moment(_0x172e22)['subtract'](_0x53dc16,_0x275d('0x2a'))[_0x275d('0x27')](_0x275d('0x28'));};exports[_0x275d('0x2b')]=function(_0x47bac0,_0x3fcd26){return moment(_0x47bac0)['diff'](moment(_0x3fcd26),_0x275d('0x2a'));};exports[_0x275d('0x2c')]=function(_0x31779d,_0x317810){return parseInt(_0x31779d,0xa)+parseInt(_0x317810,0xa);};exports['now']=function(){return moment()[_0x275d('0x27')](_0x275d('0x28'));};exports[_0x275d('0x2d')]=function(_0x2283ff,_0x230f04){if(_0x230f04){return moment(_0x2283ff)['isAfter'](_0x230f04);}return!![];};exports[_0x275d('0x2e')]=function(_0x413514,_0x1d2e84){if(_0x1d2e84){return moment(_0x413514)[_0x275d('0x2e')](_0x1d2e84);}else if(_0x413514){return!![];}return![];}; \ No newline at end of file +var _0x85c5=['jayson/promise','moment','http','../../config/logger','xdr','info','debug','inspect','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','error','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[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','seconds','subtract','format','diff','sumTime','now','isAfter','bluebird'];(function(_0xe1063b,_0x49f6a5){var _0x3f79b1=function(_0x1c0f8e){while(--_0x1c0f8e){_0xe1063b['push'](_0xe1063b['shift']());}};_0x3f79b1(++_0x49f6a5);}(_0x85c5,0xe0));var _0x585c=function(_0x3896c0,_0x191e19){_0x3896c0=_0x3896c0-0x0;var _0x379a9e=_0x85c5[_0x3896c0];return _0x379a9e;};'use strict';var BPromise=require(_0x585c('0x0'));var jayson=require(_0x585c('0x1'));var moment=require(_0x585c('0x2'));var util=require('util');var client=jayson['client'][_0x585c('0x3')]({'port':0x2329});var logger=require(_0x585c('0x4'))(_0x585c('0x5'));exports[_0x585c('0x6')]=function(_0x185be7,_0x2997d7){logger['info'](_0x185be7,_0x2997d7?util['inspect'](_0x2997d7,{'showHidden':![],'depth':null}):'');};exports[_0x585c('0x7')]=function(_0x5d7beb,_0x12228d){logger[_0x585c('0x7')](_0x5d7beb,_0x12228d?util[_0x585c('0x8')](_0x12228d,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x196c54,_0xee98df){logger['error'](_0x196c54,_0xee98df?util['inspect'](_0xee98df,{'showHidden':![],'depth':null}):'');};exports[_0x585c('0x9')]=function(_0x607f52,_0x2ed98c){return client[_0x585c('0x9')](_0x607f52,{'body':_0x2ed98c})[_0x585c('0xa')](function(_0x1ccf35){logger[_0x585c('0x7')](_0x585c('0xb'),_0x607f52,_0x1ccf35?util[_0x585c('0x8')](_0x1ccf35,{'showHidden':![],'depth':null}):'');})[_0x585c('0xc')](function(_0x2a7bde){logger['error'](_0x585c('0xb'),_0x607f52,_0x2a7bde?util['inspect'](_0x2a7bde,{'showHidden':![],'depth':null}):'');});};function getUser(_0x257d4f){return client[_0x585c('0x9')](_0x585c('0xd'),{'options':{'raw':!![],'attributes':['id',_0x585c('0xe'),_0x585c('0xf'),'interface'],'where':_0x257d4f,'limit':0x1}})[_0x585c('0xa')](function(_0x366c62){logger['debug'](_0x585c('0x10'),JSON[_0x585c('0x11')](_0x257d4f),_0x366c62?util[_0x585c('0x8')](_0x366c62,{'showHidden':![],'depth':null}):'');return _0x366c62[_0x585c('0x12')][_0x585c('0x13')]?_0x366c62[_0x585c('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x41c8fc){return new BPromise(function(_0x5df7de,_0x5708aa){if(_0x41c8fc){return getUser({'internal':_0x41c8fc})[_0x585c('0xa')](function(_0x3fcade){logger['info'](_0x585c('0x14'),_0x41c8fc,_0x3fcade?_0x585c('0x15'):_0x585c('0x16'));return _0x5df7de(_0x3fcade);})[_0x585c('0xc')](function(_0x19075){logger[_0x585c('0x17')](_0x585c('0x18'),_0x19075?util[_0x585c('0x8')](_0x19075,{'showHidden':![],'depth':null}):'');return _0x5df7de(null);});}return _0x5df7de(null);});};exports['getUserByInterface']=function(_0x5e2d9e){return new BPromise(function(_0x1fdbf2,_0x42b99b){if(_0x5e2d9e){return getUser({'interface':_0x5e2d9e})[_0x585c('0xa')](function(_0x5d608e){logger[_0x585c('0x6')](_0x585c('0x19'),_0x5e2d9e,_0x5d608e?_0x585c('0x15'):_0x585c('0x16'));return _0x1fdbf2(_0x5d608e);})[_0x585c('0xc')](function(_0x1446c1){logger[_0x585c('0x17')](_0x585c('0x1a'),_0x1446c1?util['inspect'](_0x1446c1,{'showHidden':![],'depth':null}):'');return _0x1fdbf2(null);});}return _0x1fdbf2(null);});};exports[_0x585c('0x1b')]=function(_0x330a34){return new BPromise(function(_0x3a2145,_0x11d23f){if(_0x330a34){return getUser({'name':_0x330a34})[_0x585c('0xa')](function(_0x50a86b){logger[_0x585c('0x6')](_0x585c('0x1c'),_0x330a34,_0x50a86b?_0x585c('0x15'):_0x585c('0x16'));return _0x3a2145(_0x50a86b);})[_0x585c('0xc')](function(_0x554e15){logger[_0x585c('0x17')](_0x585c('0x1d'),_0x554e15?util[_0x585c('0x8')](_0x554e15,{'showHidden':![],'depth':null}):'');return _0x3a2145(null);});}return _0x3a2145(null);});};exports[_0x585c('0x1e')]=function(_0xb481ee){return new BPromise(function(_0x507448,_0x41920f){if(_0xb481ee){return client[_0x585c('0x9')](_0x585c('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x585c('0xf'),_0x585c('0x20'),_0x585c('0x21'),'acwTimeout'],'where':{'name':_0xb481ee},'limit':0x1}})[_0x585c('0xa')](function(_0x4e3353){logger[_0x585c('0x7')](_0x585c('0x22'),_0xb481ee,_0x4e3353?util[_0x585c('0x8')](_0x4e3353,{'showHidden':![],'depth':null}):'');logger[_0x585c('0x6')](_0x585c('0x23'),_0xb481ee,_0x4e3353?_0x585c('0x15'):_0x585c('0x16'));return _0x507448(_0x4e3353[_0x585c('0x12')][_0x585c('0x13')]?_0x4e3353['result'][0x0]:null);})[_0x585c('0xc')](function(_0x4d96c0){logger['error'](_0x585c('0x24'),_0x4d96c0?util[_0x585c('0x8')](_0x4d96c0,{'showHidden':![],'depth':null}):'');return _0x507448(null);});}return _0x507448(null);});};exports['addTime']=function(_0x4019cb,_0x293da3){return moment(_0x4019cb)[_0x585c('0x25')](_0x293da3,_0x585c('0x26'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x57887b,_0x3ae074){return moment(_0x57887b)[_0x585c('0x27')](_0x3ae074,'seconds')[_0x585c('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x55da5c,_0x5eceeb){return moment(_0x55da5c)[_0x585c('0x29')](moment(_0x5eceeb),_0x585c('0x26'));};exports[_0x585c('0x2a')]=function(_0x15db55,_0x2fe9d7){return parseInt(_0x15db55,0xa)+parseInt(_0x2fe9d7,0xa);};exports[_0x585c('0x2b')]=function(){return moment()[_0x585c('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x585c('0x2c')]=function(_0x1fe4c7,_0x4f4d7e){if(_0x4f4d7e){return moment(_0x1fe4c7)[_0x585c('0x2c')](_0x4f4d7e);}return!![];};exports['isBefore']=function(_0x5eadbd,_0x1a0f9f){if(_0x1a0f9f){return moment(_0x5eadbd)['isBefore'](_0x1a0f9f);}else if(_0x5eadbd){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 cdd60c3..9e3e3dc 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 _0x7e80=['data','timestamp','error','api','auth','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','body','device','method','role','other','agent_id','agent_name','test','setupLoggers','lodash','path','util','./loggers','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','then','catch','user','no-user'];(function(_0x5a0bab,_0x168def){var _0x32b15a=function(_0x52f391){while(--_0x52f391){_0x5a0bab['push'](_0x5a0bab['shift']());}};_0x32b15a(++_0x168def);}(_0x7e80,0x157));var _0x07e8=function(_0x26f81c,_0x54d3ba){_0x26f81c=_0x26f81c-0x0;var _0x120abd=_0x7e80[_0x26f81c];return _0x120abd;};var fs=require('fs-extra');var _=require(_0x07e8('0x0'));var ewinston=require('express-winston');var path=require(_0x07e8('0x1'));var util=require(_0x07e8('0x2'));var fileLogger=require(_0x07e8('0x3'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x07e8('0x4')];var maskSensitiveData=require(_0x07e8('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x42ccdd(_0x3afb67){var _0x51d951=path[_0x07e8('0x6')](_0x07e8('0x7'),_0x07e8('0x8'),_0x07e8('0x9'));var _0x2e53a4=path[_0x07e8('0x6')](_0x07e8('0xa'),_0x3afb67['role']+'-'+_0x3afb67[_0x07e8('0xb')]);return fs[_0x07e8('0xc')](path[_0x07e8('0x6')](_0x51d951,_0x2e53a4))[_0x07e8('0xd')](function(){var _0x4c27f1=fileLogger(_0x07e8('0xa'),path[_0x07e8('0x6')](_0x51d951,_0x2e53a4));return _0x4c27f1;})[_0x07e8('0xe')](function(_0x5401b8){throw _0x5401b8;});}this[_0x07e8('0x8')]=function(_0x3c6ce3,_0x239e06,_0x5f328a,_0x393db7){return _0x42ccdd(_0x3c6ce3[_0x07e8('0xf')])[_0x07e8('0xd')](function(_0x5115dc){var _0x278797=_0x5115dc[_0x239e06];return _0x278797;})[_0x07e8('0xd')](function(_0x127deb){var _0x50d781=_0x3c6ce3[_0x07e8('0xf')]?_0x3c6ce3[_0x07e8('0xf')]['id']:_0x07e8('0x10');var _0x28f93b=_0x393db7[_0x07e8('0x11')];var _0x4e55af=_0x393db7[_0x07e8('0x12')];var _0x4227b7=new Date(Number(_0x4e55af));return _0x127deb(_0x50d781,_0x4227b7,_0x5f328a,_0x28f93b);})['catch'](function(_0x213ecd){fileLogger(_0x07e8('0xa'))[_0x07e8('0x13')](_0x213ecd);});};}function setupLoggers(_0xde17d5){return new Promise(function(_0x3d30b5){var _0x24c342=new ClientSideLogger();var _0x3e596e=fileLogger(_0x07e8('0x14'));var _0x3703d9=fileLogger(_0x07e8('0x15'));_0xde17d5[_0x07e8('0x16')](_0x07e8('0x17'),_0x24c342);_0xde17d5['use'](ewinston[_0x07e8('0x18')]({'winstonInstance':_0x3e596e,'meta':![],'statusLevels':!![],'msg':function(_0x504ffa,_0x2255d2){var _0x395c63=_0x07e8('0x19');if(!_[_0x07e8('0x1a')](_0x504ffa['body'])){_0x395c63+='\x20body=%s';var _0x3151c1=_0x504ffa['body'];maskSensitiveData(_0x3151c1);}return safeTemplate(util[_0x07e8('0x1b')](_0x395c63,_0x504ffa['method'],_0x504ffa['headers']['x-forwarded-for']?_0x504ffa[_0x07e8('0x1c')][_0x07e8('0x1d')]:_0x504ffa[_0x07e8('0x1e')][_0x07e8('0x1f')]||_0x504ffa['ip'],_0x504ffa[_0x07e8('0x20')],_0x2255d2[_0x07e8('0x21')],_0x2255d2[_0x07e8('0x22')],_0x504ffa[_0x07e8('0xf')]?_0x504ffa[_0x07e8('0xf')]['id']:null,_0x504ffa[_0x07e8('0xf')]?_0x504ffa['user']['name']:null,_0x504ffa['user']?_0x504ffa[_0x07e8('0xf')]['role']:null,_0x3151c1?util[_0x07e8('0x23')](_0x3151c1,![],null):''));}}));_0xde17d5['use'](ewinston[_0x07e8('0x18')]({'winstonInstance':_0x3703d9,'meta':![],'statusLevels':!![],'msg':function(_0xeb0a48,_0x56e6d7){var _0xf4f32f='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xeb0a48[_0x07e8('0x24')]&&_0xeb0a48[_0x07e8('0x24')][_0x07e8('0x25')]&&_0xeb0a48['body']['agent_id']){_0xf4f32f='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x07e8('0x1b')](_0xf4f32f,_0xeb0a48[_0x07e8('0x26')],_0xeb0a48[_0x07e8('0x1c')][_0x07e8('0x1d')]?_0xeb0a48[_0x07e8('0x1c')][_0x07e8('0x1d')]:_0xeb0a48['connection'][_0x07e8('0x1f')]||_0xeb0a48['ip'],_0xeb0a48[_0x07e8('0x20')],_0x56e6d7['statusCode'],_0x56e6d7['responseTime'],_0xeb0a48[_0x07e8('0xf')]?_0xeb0a48[_0x07e8('0xf')]['id']:null,_0xeb0a48[_0x07e8('0xf')]?_0xeb0a48[_0x07e8('0xf')][_0x07e8('0xb')]:null,_0xeb0a48['user']?_0xeb0a48[_0x07e8('0xf')][_0x07e8('0x27')]:null,_0xeb0a48[_0x07e8('0x24')]&&_0xeb0a48[_0x07e8('0x24')]['device']?_0xeb0a48[_0x07e8('0x24')][_0x07e8('0x25')]:_0x07e8('0x28'),_0xeb0a48['body']&&_0xeb0a48[_0x07e8('0x24')][_0x07e8('0x29')]?_0xeb0a48['body'][_0x07e8('0x29')]:'',_0xeb0a48['body']&&_0xeb0a48[_0x07e8('0x24')][_0x07e8('0x2a')]?_0xeb0a48['body'][_0x07e8('0x2a')]:'');},'ignoreRoute':function(_0x28e301){var _0x248ddb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x248ddb[_0x07e8('0x2b')](_0x28e301['url']);}}));return _0x3d30b5();});}exports[_0x07e8('0x2c')]=setupLoggers; \ No newline at end of file +var _0xd097=['fs-extra','lodash','express-winston','util','./loggers','./mask-sensitive-data','join','/var','xcally','client','role','name','ensureDir','catch','log','user','then','no-user','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','responseTime','other'];(function(_0x45693a,_0x4ddc9e){var _0x1771f0=function(_0x161c88){while(--_0x161c88){_0x45693a['push'](_0x45693a['shift']());}};_0x1771f0(++_0x4ddc9e);}(_0xd097,0xfc));var _0x7d09=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xd097[_0x1928c9];return _0x51b5fb;};var fs=require(_0x7d09('0x0'));var _=require(_0x7d09('0x1'));var ewinston=require(_0x7d09('0x2'));var path=require('path');var util=require(_0x7d09('0x3'));var fileLogger=require(_0x7d09('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x7d09('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x3a403b(_0x1dcb4d){var _0x42f961=path[_0x7d09('0x6')](_0x7d09('0x7'),'log',_0x7d09('0x8'));var _0xc89ae8=path[_0x7d09('0x6')](_0x7d09('0x9'),_0x1dcb4d[_0x7d09('0xa')]+'-'+_0x1dcb4d[_0x7d09('0xb')]);return fs[_0x7d09('0xc')](path[_0x7d09('0x6')](_0x42f961,_0xc89ae8))['then'](function(){var _0x408f3a=fileLogger('client',path[_0x7d09('0x6')](_0x42f961,_0xc89ae8));return _0x408f3a;})[_0x7d09('0xd')](function(_0x341037){throw _0x341037;});}this[_0x7d09('0xe')]=function(_0x890378,_0x46f21c,_0xc1c5a4,_0x3fc6bd){return _0x3a403b(_0x890378[_0x7d09('0xf')])[_0x7d09('0x10')](function(_0x1d458c){var _0x56fb48=_0x1d458c[_0x46f21c];return _0x56fb48;})['then'](function(_0x493364){var _0x515a9a=_0x890378[_0x7d09('0xf')]?_0x890378[_0x7d09('0xf')]['id']:_0x7d09('0x11');var _0x44c856=_0x3fc6bd['data'];var _0x875dca=_0x3fc6bd['timestamp'];var _0x3f4377=new Date(Number(_0x875dca));return _0x493364(_0x515a9a,_0x3f4377,_0xc1c5a4,_0x44c856);})[_0x7d09('0xd')](function(_0x39eb90){fileLogger(_0x7d09('0x9'))[_0x7d09('0x12')](_0x39eb90);});};}function setupLoggers(_0x330ea9){return new Promise(function(_0x40fc04){var _0x59ffd5=new ClientSideLogger();var _0x5f570e=fileLogger(_0x7d09('0x13'));var _0x375977=fileLogger(_0x7d09('0x14'));_0x330ea9['set'](_0x7d09('0x15'),_0x59ffd5);_0x330ea9[_0x7d09('0x16')](ewinston[_0x7d09('0x17')]({'winstonInstance':_0x5f570e,'meta':![],'statusLevels':!![],'msg':function(_0x59d525,_0x54fa02){var _0x18a424=_0x7d09('0x18');if(!_['isEmpty'](_0x59d525[_0x7d09('0x19')])){_0x18a424+=_0x7d09('0x1a');var _0x4aa556=_0x59d525[_0x7d09('0x19')];maskSensitiveData(_0x4aa556);}return safeTemplate(util[_0x7d09('0x1b')](_0x18a424,_0x59d525[_0x7d09('0x1c')],_0x59d525[_0x7d09('0x1d')][_0x7d09('0x1e')]?_0x59d525[_0x7d09('0x1d')][_0x7d09('0x1e')]:_0x59d525[_0x7d09('0x1f')][_0x7d09('0x20')]||_0x59d525['ip'],_0x59d525['url'],_0x54fa02[_0x7d09('0x21')],_0x54fa02['responseTime'],_0x59d525[_0x7d09('0xf')]?_0x59d525[_0x7d09('0xf')]['id']:null,_0x59d525[_0x7d09('0xf')]?_0x59d525[_0x7d09('0xf')][_0x7d09('0xb')]:null,_0x59d525[_0x7d09('0xf')]?_0x59d525[_0x7d09('0xf')][_0x7d09('0xa')]:null,_0x4aa556?util[_0x7d09('0x22')](_0x4aa556,![],null):''));}}));_0x330ea9['use'](ewinston[_0x7d09('0x17')]({'winstonInstance':_0x375977,'meta':![],'statusLevels':!![],'msg':function(_0x39b2f5,_0x3662ef){var _0x33357d=_0x7d09('0x23');if(_0x39b2f5[_0x7d09('0x19')]&&_0x39b2f5['body'][_0x7d09('0x24')]&&_0x39b2f5[_0x7d09('0x19')][_0x7d09('0x25')]){_0x33357d=_0x7d09('0x26');}return util[_0x7d09('0x1b')](_0x33357d,_0x39b2f5[_0x7d09('0x1c')],_0x39b2f5[_0x7d09('0x1d')][_0x7d09('0x1e')]?_0x39b2f5[_0x7d09('0x1d')][_0x7d09('0x1e')]:_0x39b2f5['connection'][_0x7d09('0x20')]||_0x39b2f5['ip'],_0x39b2f5[_0x7d09('0x27')],_0x3662ef[_0x7d09('0x21')],_0x3662ef[_0x7d09('0x28')],_0x39b2f5[_0x7d09('0xf')]?_0x39b2f5[_0x7d09('0xf')]['id']:null,_0x39b2f5[_0x7d09('0xf')]?_0x39b2f5[_0x7d09('0xf')][_0x7d09('0xb')]:null,_0x39b2f5[_0x7d09('0xf')]?_0x39b2f5['user'][_0x7d09('0xa')]:null,_0x39b2f5[_0x7d09('0x19')]&&_0x39b2f5[_0x7d09('0x19')]['device']?_0x39b2f5[_0x7d09('0x19')]['device']:_0x7d09('0x29'),_0x39b2f5[_0x7d09('0x19')]&&_0x39b2f5[_0x7d09('0x19')][_0x7d09('0x25')]?_0x39b2f5[_0x7d09('0x19')][_0x7d09('0x25')]:'',_0x39b2f5[_0x7d09('0x19')]&&_0x39b2f5[_0x7d09('0x19')]['agent_name']?_0x39b2f5[_0x7d09('0x19')]['agent_name']:'');},'ignoreRoute':function(_0x1b9d7a){var _0x5ad14d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5ad14d['test'](_0x1b9d7a[_0x7d09('0x27')]);}}));return _0x40fc04();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 1881634..308e49a 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec6d=['iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','isValid','split','locale','weekdaysShort','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','toLowerCase','circularMonthInterval','minutes','clone','hours','isBefore','day','isBetween','timeCompare','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','format','MMM','monthCompare','guess','test','isMoment','padStart','length'];(function(_0x4b422d,_0x3cb824){var _0x2838d0=function(_0x5e1d93){while(--_0x5e1d93){_0x4b422d['push'](_0x4b422d['shift']());}};_0x2838d0(++_0x3cb824);}(_0xec6d,0x151));var _0xdec6=function(_0x33adb2,_0x20e65d){_0x33adb2=_0x33adb2-0x0;var _0x51e880=_0xec6d[_0x33adb2];return _0x51e880;};var _=require(_0xdec6('0x0'));var moment=require(_0xdec6('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xdec6('0x2')](function(_0x2d1bd1){return _0x2d1bd1[_0xdec6('0x3')];})[_0xdec6('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xdec6('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x55c2cd){if(!_0x55c2cd[_0xdec6('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x17618e){var _0x2d6f4e=_0x17618e[_0xdec6('0x7')](':')[_0xdec6('0x2')](function(_0x39a990){return parseInt(_0x39a990,0xa);});var _0x269cd1=_0x2d6f4e[0x0];var _0x2c7b25=_0x2d6f4e[0x1];if(_0x269cd1<0x0||_0x269cd1>0x17||_0x2c7b25<0x0||_0x2c7b25>0x3b){throw new Error(EINVALID_DATE);}return[_0x269cd1,_0x2c7b25];}function circularDoWInterval(_0x334e1f,_0x4bf564){if(_0x334e1f===_0x4bf564){return[_0x334e1f];}else{var _0x2c71d9=moment[_0xdec6('0x8')]();moment['locale']('en');var _0x22b063=moment[_0xdec6('0x9')]()['map'](function(_0x301ef2){return _0x301ef2['toLowerCase']();});moment['locale'](_0x2c71d9);var _0x23ea85=_0x22b063[_0xdec6('0xa')](_0x334e1f);var _0x105f0b=_0x22b063[_0xdec6('0xa')](_0x4bf564);if(_0x105f0b>_0x23ea85){return _0x22b063[_0xdec6('0xb')](_0x23ea85,_0x105f0b+0x1);}else{var _0x2f7d71=_0x22b063['slice'](0x0,_0x105f0b+0x1);var _0x5b5156=_0x22b063[_0xdec6('0xb')](_0x23ea85);return _0x5b5156[_0xdec6('0xc')](_0x2f7d71);}}}module[_0xdec6('0xd')][_0xdec6('0xe')]=circularDoWInterval;function circularMonthInterval(_0x2ee39a,_0x38773e){if(_0x2ee39a===_0x38773e){return[_0x2ee39a];}else{var _0x20b81e=moment['locale']();moment['locale']('en');var _0xfd8332=moment[_0xdec6('0xf')]()[_0xdec6('0x2')](function(_0x4b836e){return _0x4b836e[_0xdec6('0x10')]();});moment[_0xdec6('0x8')](_0x20b81e);var _0x5a880c=_0xfd8332[_0xdec6('0xa')](_0x2ee39a);var _0x5682ed=_0xfd8332[_0xdec6('0xa')](_0x38773e);if(_0x5682ed>_0x5a880c){return _0xfd8332[_0xdec6('0xb')](_0x5a880c,_0x5682ed+0x1);}else{var _0x427c97=_0xfd8332[_0xdec6('0xb')](0x0,_0x5682ed+0x1);var _0x392a3a=_0xfd8332[_0xdec6('0xb')](_0x5a880c);return _0x392a3a[_0xdec6('0xc')](_0x427c97);}}}module[_0xdec6('0xd')][_0xdec6('0x11')]=circularMonthInterval;function parseDom(_0x26c7a4){var _0x101fce=parseInt(_0x26c7a4,0xa);if(_0x101fce<0x1||_0x101fce>0x1f){throw new Error(EINVALID_DATE);}return _0x101fce;}function timeCompare(_0x4dace5,_0x5c1da7,_0x2f7b2a){var _0x3729f=_0x4dace5['clone']();var _0x1cf2c7=extractTime(_0x5c1da7);var _0x194b89=_0x1cf2c7[0x0];var _0x2b441d=_0x1cf2c7[0x1];var _0x20da77=_0x4dace5['clone']()['hours'](_0x194b89)[_0xdec6('0x12')](_0x2b441d);throwIfDateNotValid(_0x20da77);var _0xc4ad93=extractTime(_0x2f7b2a);var _0x208f4b=_0xc4ad93[0x0];var _0xe287e8=_0xc4ad93[0x1];var _0x2824c3=_0x4dace5[_0xdec6('0x13')]()[_0xdec6('0x14')](_0x208f4b)[_0xdec6('0x12')](_0xe287e8);throwIfDateNotValid(_0x2824c3);if(_0x2824c3[_0xdec6('0x15')](_0x20da77)){var _0x7e0366=_0x3729f[_0xdec6('0x13')]()['startOf'](_0xdec6('0x16'));var _0x353f2c=_0x3729f['clone']()['endOf'](_0xdec6('0x16'));return _0x3729f['isBetween'](_0x20da77,_0x353f2c,undefined,'[]')||_0x3729f['isBetween'](_0x7e0366,_0x2824c3,undefined,'[]');}else{return _0x3729f[_0xdec6('0x17')](_0x20da77,_0x2824c3,undefined,'[]');}}module[_0xdec6('0xd')][_0xdec6('0x18')]=timeCompare;function dowCompare(_0x3f42cc,_0x228e8a,_0x150128){var _0x322912=_0x3f42cc[_0xdec6('0x8')]('en')['format'](_0xdec6('0x19'))[_0xdec6('0x10')]();return circularDoWInterval(_0x228e8a,_0x150128)[_0xdec6('0x1a')](_0x322912);}module[_0xdec6('0xd')][_0xdec6('0x1b')]=dowCompare;function domCompare(_0x11f9e1,_0x49b3f9,_0xd9c719){var _0x293bc8=_0x11f9e1[_0xdec6('0x1c')]();if(_0x49b3f9===_0xd9c719){return _0x293bc8===_0x49b3f9;}else{var _0x38834e=_0x11f9e1[_0xdec6('0x1d')]();var _0x1ac56e=_0x49b3f9<_0xd9c719;let _0x26af05=![];var _0x12fce4=0x0;var _0x1f05cd=0x0;if(_0x1ac56e){_0x12fce4=Math[_0xdec6('0x1e')](0x1,_0x49b3f9);_0x1f05cd=Math[_0xdec6('0x1f')](_0xd9c719,_0x38834e);_0x26af05=_0x293bc8>=_0x12fce4&&_0x293bc8<=_0x1f05cd;}else{_0x12fce4=Math[_0xdec6('0x1f')](_0x49b3f9,_0x38834e);_0x1f05cd=Math[_0xdec6('0x1e')](0x1,_0xd9c719);_0x26af05=_0x293bc8>=_0x12fce4||_0x293bc8<=_0x1f05cd;}return _0x26af05;}}module[_0xdec6('0xd')][_0xdec6('0x20')]=domCompare;function monthCompare(_0x5ac687,_0x5a0fee,_0x86fb37){var _0xda814a=_0x5ac687[_0xdec6('0x8')]('en')[_0xdec6('0x21')](_0xdec6('0x22'))[_0xdec6('0x10')]();return circularMonthInterval(_0x5a0fee,_0x86fb37)[_0xdec6('0x1a')](_0xda814a);}module['exports'][_0xdec6('0x23')]=monthCompare;function iftime(_0x641e00,_0x395d60=moment['tz'][_0xdec6('0x24')](),_0x37f369=moment()){if(!validateRx[_0xdec6('0x25')](_0x641e00)){throw new Error(EINVALID_STRING);}else{var _0x2cabf7=(moment[_0xdec6('0x26')](_0x37f369)?_0x37f369[_0xdec6('0x13')]():moment(_0x37f369))['tz'](_0x395d60)[_0xdec6('0x8')]('en');throwIfDateNotValid(_0x2cabf7);var _0x7545b2=_0x641e00[_0xdec6('0x7')](',');var _0x4d021d=_0x7545b2[0x0];var _0x53c32c=_0x7545b2[0x1];var _0x57a514=_0x7545b2[0x2];var _0x240f18=_0x7545b2[0x3];let _0x5ee964=!![];if(_0x4d021d!=='*'){var _0x4fcb74=_0x4d021d[_0xdec6('0x7')]('-');var _0x22159d=_[_0xdec6('0x27')](_0x4fcb74[0x0],0x5,'0');var _0x4c8d6f=_0x4fcb74[_0xdec6('0x28')]===0x2?_[_0xdec6('0x27')](_0x4fcb74[0x1],0x5,'0'):_0x22159d;_0x5ee964=timeCompare(_0x2cabf7,_0x22159d,_0x4c8d6f);}let _0x4d94ce=!![];if(_0x53c32c!=='*'){var _0x45f8d4=_0x53c32c[_0xdec6('0x7')]('-');var _0x3f4f52=_0x45f8d4[0x0];var _0x1fcadc=_0x45f8d4[_0xdec6('0x28')]===0x2?_0x45f8d4[0x1]:_0x3f4f52;_0x4d94ce=dowCompare(_0x2cabf7,_0x3f4f52,_0x1fcadc);}let _0x467d39=!![];if(_0x57a514!=='*'){var _0x41f1dd=_0x57a514[_0xdec6('0x7')]('-');var _0x21f415=parseDom(_0x41f1dd[0x0]);var _0x1ab2ae=_0x41f1dd[_0xdec6('0x28')]===0x2?parseDom(_0x41f1dd[0x1]):_0x21f415;_0x467d39=domCompare(_0x2cabf7,_0x21f415,_0x1ab2ae);}let _0xf58338=!![];if(_0x240f18!=='*'){var _0x47492c=_0x240f18[_0xdec6('0x7')]('-');var _0x59675d=_0x47492c[0x0];var _0x185806=_0x47492c['length']===0x2?_0x47492c[0x1]:_0x47492c[0x0];_0xf58338=monthCompare(_0x2cabf7,_0x59675d,_0x185806);}return _0x5ee964&&_0x4d94ce&&_0x467d39&&_0xf58338;}}module[_0xdec6('0xd')][_0xdec6('0x29')]=iftime; \ No newline at end of file +var _0x47f0=['minutes','hours','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','monthCompare','guess','test','padStart','length','iftime','lodash','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','circularDoWInterval','exports','clone'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x47f0,0x1d1));var _0x047f=function(_0x62acd5,_0x4ddb49){_0x62acd5=_0x62acd5-0x0;var _0x227ab4=_0x47f0[_0x62acd5];return _0x227ab4;};var _=require(_0x047f('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x16d753){return _0x16d753[_0x047f('0x1')];})[_0x047f('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x047f('0x3');var EINVALID_DATE=_0x047f('0x4');function throwIfDateNotValid(_0x15f16f){if(!_0x15f16f[_0x047f('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x553582){var _0x142010=_0x553582[_0x047f('0x6')](':')[_0x047f('0x7')](function(_0x152268){return parseInt(_0x152268,0xa);});var _0x3e01c9=_0x142010[0x0];var _0x24a32b=_0x142010[0x1];if(_0x3e01c9<0x0||_0x3e01c9>0x17||_0x24a32b<0x0||_0x24a32b>0x3b){throw new Error(EINVALID_DATE);}return[_0x3e01c9,_0x24a32b];}function circularDoWInterval(_0x531a79,_0x5c5956){if(_0x531a79===_0x5c5956){return[_0x531a79];}else{var _0xce2640=moment[_0x047f('0x8')]();moment[_0x047f('0x8')]('en');var _0x5002e0=moment[_0x047f('0x9')]()[_0x047f('0x7')](function(_0x2fd5c5){return _0x2fd5c5[_0x047f('0xa')]();});moment[_0x047f('0x8')](_0xce2640);var _0x170f75=_0x5002e0[_0x047f('0xb')](_0x531a79);var _0x41fd4f=_0x5002e0[_0x047f('0xb')](_0x5c5956);if(_0x41fd4f>_0x170f75){return _0x5002e0[_0x047f('0xc')](_0x170f75,_0x41fd4f+0x1);}else{var _0x45762d=_0x5002e0[_0x047f('0xc')](0x0,_0x41fd4f+0x1);var _0x597ef0=_0x5002e0[_0x047f('0xc')](_0x170f75);return _0x597ef0['concat'](_0x45762d);}}}module['exports'][_0x047f('0xd')]=circularDoWInterval;function circularMonthInterval(_0x363ad6,_0x1e445f){if(_0x363ad6===_0x1e445f){return[_0x363ad6];}else{var _0xff820c=moment['locale']();moment[_0x047f('0x8')]('en');var _0x55b537=moment['monthsShort']()[_0x047f('0x7')](function(_0x252621){return _0x252621[_0x047f('0xa')]();});moment[_0x047f('0x8')](_0xff820c);var _0x275831=_0x55b537[_0x047f('0xb')](_0x363ad6);var _0x219f7a=_0x55b537['indexOf'](_0x1e445f);if(_0x219f7a>_0x275831){return _0x55b537['slice'](_0x275831,_0x219f7a+0x1);}else{var _0x53e576=_0x55b537[_0x047f('0xc')](0x0,_0x219f7a+0x1);var _0x1dd57f=_0x55b537[_0x047f('0xc')](_0x275831);return _0x1dd57f['concat'](_0x53e576);}}}module[_0x047f('0xe')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x5c98d9){var _0x429133=parseInt(_0x5c98d9,0xa);if(_0x429133<0x1||_0x429133>0x1f){throw new Error(EINVALID_DATE);}return _0x429133;}function timeCompare(_0x32779b,_0x483fb9,_0x1c5163){var _0xc4ec9c=_0x32779b[_0x047f('0xf')]();var _0x4b979c=extractTime(_0x483fb9);var _0x40d629=_0x4b979c[0x0];var _0x19e4a2=_0x4b979c[0x1];var _0x5ce259=_0x32779b[_0x047f('0xf')]()['hours'](_0x40d629)[_0x047f('0x10')](_0x19e4a2);throwIfDateNotValid(_0x5ce259);var _0xf5d3e8=extractTime(_0x1c5163);var _0x1e9407=_0xf5d3e8[0x0];var _0x26ac76=_0xf5d3e8[0x1];var _0x158d43=_0x32779b[_0x047f('0xf')]()[_0x047f('0x11')](_0x1e9407)[_0x047f('0x10')](_0x26ac76);throwIfDateNotValid(_0x158d43);if(_0x158d43['isBefore'](_0x5ce259)){var _0x35ccaa=_0xc4ec9c['clone']()[_0x047f('0x12')](_0x047f('0x13'));var _0x3e8aef=_0xc4ec9c[_0x047f('0xf')]()[_0x047f('0x14')](_0x047f('0x13'));return _0xc4ec9c[_0x047f('0x15')](_0x5ce259,_0x3e8aef,undefined,'[]')||_0xc4ec9c[_0x047f('0x15')](_0x35ccaa,_0x158d43,undefined,'[]');}else{return _0xc4ec9c[_0x047f('0x15')](_0x5ce259,_0x158d43,undefined,'[]');}}module['exports'][_0x047f('0x16')]=timeCompare;function dowCompare(_0x102c05,_0x196d9d,_0x1f9051){var _0x19ca63=_0x102c05[_0x047f('0x8')]('en')[_0x047f('0x17')](_0x047f('0x18'))['toLowerCase']();return circularDoWInterval(_0x196d9d,_0x1f9051)[_0x047f('0x19')](_0x19ca63);}module[_0x047f('0xe')][_0x047f('0x1a')]=dowCompare;function domCompare(_0x1e2110,_0x2d2e16,_0x385d90){var _0x15c4aa=_0x1e2110[_0x047f('0x1b')]();if(_0x2d2e16===_0x385d90){return _0x15c4aa===_0x2d2e16;}else{var _0x51a941=_0x1e2110[_0x047f('0x1c')]();var _0x17b5a4=_0x2d2e16<_0x385d90;let _0x9b0f2=![];var _0x3f7d94=0x0;var _0x135bdb=0x0;if(_0x17b5a4){_0x3f7d94=Math[_0x047f('0x1d')](0x1,_0x2d2e16);_0x135bdb=Math[_0x047f('0x1e')](_0x385d90,_0x51a941);_0x9b0f2=_0x15c4aa>=_0x3f7d94&&_0x15c4aa<=_0x135bdb;}else{_0x3f7d94=Math[_0x047f('0x1e')](_0x2d2e16,_0x51a941);_0x135bdb=Math[_0x047f('0x1d')](0x1,_0x385d90);_0x9b0f2=_0x15c4aa>=_0x3f7d94||_0x15c4aa<=_0x135bdb;}return _0x9b0f2;}}module[_0x047f('0xe')]['domCompare']=domCompare;function monthCompare(_0x315e0a,_0xeffdd1,_0x489bb6){var _0x3082b1=_0x315e0a[_0x047f('0x8')]('en')[_0x047f('0x17')]('MMM')[_0x047f('0xa')]();return circularMonthInterval(_0xeffdd1,_0x489bb6)[_0x047f('0x19')](_0x3082b1);}module[_0x047f('0xe')][_0x047f('0x1f')]=monthCompare;function iftime(_0x1e6265,_0x3d65b0=moment['tz'][_0x047f('0x20')](),_0x3f0379=moment()){if(!validateRx[_0x047f('0x21')](_0x1e6265)){throw new Error(EINVALID_STRING);}else{var _0x19dab9=(moment['isMoment'](_0x3f0379)?_0x3f0379[_0x047f('0xf')]():moment(_0x3f0379))['tz'](_0x3d65b0)[_0x047f('0x8')]('en');throwIfDateNotValid(_0x19dab9);var _0x4f8186=_0x1e6265[_0x047f('0x6')](',');var _0x125ff9=_0x4f8186[0x0];var _0x26c0ee=_0x4f8186[0x1];var _0x1c4600=_0x4f8186[0x2];var _0x278ec8=_0x4f8186[0x3];let _0xd035bf=!![];if(_0x125ff9!=='*'){var _0x300dad=_0x125ff9[_0x047f('0x6')]('-');var _0x3c18f8=_[_0x047f('0x22')](_0x300dad[0x0],0x5,'0');var _0x43e080=_0x300dad[_0x047f('0x23')]===0x2?_['padStart'](_0x300dad[0x1],0x5,'0'):_0x3c18f8;_0xd035bf=timeCompare(_0x19dab9,_0x3c18f8,_0x43e080);}let _0x262d3e=!![];if(_0x26c0ee!=='*'){var _0x1d304c=_0x26c0ee[_0x047f('0x6')]('-');var _0x272477=_0x1d304c[0x0];var _0x2f62c5=_0x1d304c['length']===0x2?_0x1d304c[0x1]:_0x272477;_0x262d3e=dowCompare(_0x19dab9,_0x272477,_0x2f62c5);}let _0x17f199=!![];if(_0x1c4600!=='*'){var _0x1895a1=_0x1c4600[_0x047f('0x6')]('-');var _0x752e68=parseDom(_0x1895a1[0x0]);var _0x540891=_0x1895a1['length']===0x2?parseDom(_0x1895a1[0x1]):_0x752e68;_0x17f199=domCompare(_0x19dab9,_0x752e68,_0x540891);}let _0x2ab6f0=!![];if(_0x278ec8!=='*'){var _0x2f4ad5=_0x278ec8[_0x047f('0x6')]('-');var _0x31b064=_0x2f4ad5[0x0];var _0x4c937a=_0x2f4ad5['length']===0x2?_0x2f4ad5[0x1]:_0x2f4ad5[0x0];_0x2ab6f0=monthCompare(_0x19dab9,_0x31b064,_0x4c937a);}return _0xd035bf&&_0x262d3e&&_0x17f199&&_0x2ab6f0;}}module[_0x047f('0xe')][_0x047f('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 8e01eeb..743fe1a 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d94=['/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','path','util','moment','debugLevel','info','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x9d94,0xc6));var _0x49d9=function(_0x131391,_0x1631c7){_0x131391=_0x131391-0x0;var _0xa5433=_0x9d94[_0x131391];return _0xa5433;};'use strict';var path=require(_0x49d9('0x0'));var util=require(_0x49d9('0x1'));var moment=require(_0x49d9('0x2'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config[_0x49d9('0x3')]?config[_0x49d9('0x3')]['toLowerCase']():_0x49d9('0x4');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':'red','warn':_0x49d9('0x5'),'info':_0x49d9('0x6'),'print':_0x49d9('0x7'),'success':'bold\x20green','http':_0x49d9('0x8'),'verbose':_0x49d9('0x9'),'debug':_0x49d9('0xa'),'silly':_0x49d9('0xb')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x13da8f,_0x44fb73,_0x48f345){var _0x210295=_0x13da8f||_0x49d9('0xc');return path[_0x49d9('0xd')](_0x210295,util[_0x49d9('0xe')](_0x49d9('0xf'),_0x44fb73,_0x48f345));}function formatter(_0x2d5fcb,_0x3287c1){_0x3287c1[_0x49d9('0x10')]=_0x3287c1[_0x49d9('0x10')][_0x49d9('0x11')](/@@{/g,_0x49d9('0x12'))[_0x49d9('0x11')](/}@@/g,_0x49d9('0x13'))[_0x49d9('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x49d9('0xe')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x49d9('0xe')](_0x49d9('0x14')),_0x3287c1[_0x49d9('0x15')][_0x49d9('0x16')](),_0x2d5fcb,_0x3287c1['message']);}function fileFormat(_0x5114a8,_0x251a69){_0x251a69[_0x49d9('0x10')]=_0x251a69[_0x49d9('0x10')][_0x49d9('0x11')](/@@{/g,_0x49d9('0x12'))[_0x49d9('0x11')](/}@@/g,_0x49d9('0x13'))['replace'](/@{/g,'{{')[_0x49d9('0x11')](/}@/g,'}}');var _0x4a03e7=_0x251a69[_0x49d9('0x17')]&&Object[_0x49d9('0x18')](_0x251a69['meta'])[_0x49d9('0x19')]?'\x0a\x09'+JSON[_0x49d9('0x1a')](_0x251a69['meta']):'';return util['format'](_0x49d9('0x1b'),moment()[_0x49d9('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),_0x251a69[_0x49d9('0x15')][_0x49d9('0x16')](),_0x5114a8,_0x251a69[_0x49d9('0x10')],_0x4a03e7);}function consoleLogger(){var _0x3bae6e=new winston[(_0x49d9('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x49d9('0x1d'))][(_0x49d9('0x1e'))]({'level':_0x49d9('0x1f'),'json':![],'formatter':function(_0x625ad4){return formatter('',_0x625ad4);}})]});return _0x3bae6e;}function fileLogger(_0x3b23cd,_0x473266){var _0x38f701=new winston[(_0x49d9('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x49d9('0x1d'))][(_0x49d9('0x20'))]({'name':util['format'](_0x49d9('0x21'),_0x3b23cd,_0x49d9('0x22')),'filename':getLogFileName(_0x473266,_0x3b23cd,_0x49d9('0x22')),'level':_0x49d9('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5bda23){return fileFormat(_0x3b23cd,_0x5bda23);}}),new winston['transports'][(_0x49d9('0x20'))]({'name':util[_0x49d9('0xe')](_0x49d9('0x21'),_0x3b23cd,debugLevel),'filename':getLogFileName(_0x473266,_0x3b23cd,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbd1c6e){return fileFormat(_0x3b23cd,_0xbd1c6e);}}),new winston[(_0x49d9('0x1d'))][(_0x49d9('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x27dee6){return fileFormat(_0x3b23cd,_0x27dee6);}})]});return _0x38f701;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x2a3b=['format','%s-%s.log','message','{{{','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join'];(function(_0x5e7b1b,_0x1f4c21){var _0x11a115=function(_0x4d5d05){while(--_0x4d5d05){_0x5e7b1b['push'](_0x5e7b1b['shift']());}};_0x11a115(++_0x1f4c21);}(_0x2a3b,0x107));var _0xb2a3=function(_0x5961b2,_0x3904e7){_0x5961b2=_0x5961b2-0x0;var _0x949e4d=_0x2a3b[_0x5961b2];return _0x949e4d;};'use strict';var path=require('path');var util=require(_0xb2a3('0x0'));var moment=require(_0xb2a3('0x1'));var winston=require(_0xb2a3('0x2'));var config=require(_0xb2a3('0x3'));var debugLevel=config[_0xb2a3('0x4')]?config['debugLevel'][_0xb2a3('0x5')]():_0xb2a3('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xb2a3('0x7'),'warn':_0xb2a3('0x8'),'info':_0xb2a3('0x9'),'print':_0xb2a3('0xa'),'success':'bold\x20green','http':_0xb2a3('0xb'),'verbose':_0xb2a3('0xc'),'debug':_0xb2a3('0xd'),'silly':'bold\x20cyan'};winston[_0xb2a3('0xe')](XC_LOG_COLORS);function getLogFileName(_0x1e95f6,_0x4e880e,_0x22e08a){var _0x42481a=_0x1e95f6||_0xb2a3('0xf');return path[_0xb2a3('0x10')](_0x42481a,util[_0xb2a3('0x11')](_0xb2a3('0x12'),_0x4e880e,_0x22e08a));}function formatter(_0x12e26d,_0x94aca9){_0x94aca9[_0xb2a3('0x13')]=_0x94aca9['message']['replace'](/@@{/g,_0xb2a3('0x14'))[_0xb2a3('0x15')](/}@@/g,_0xb2a3('0x16'))[_0xb2a3('0x15')](/@{/g,'{{')[_0xb2a3('0x15')](/}@/g,'}}');return util[_0xb2a3('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xb2a3('0x11')](_0xb2a3('0x17')),_0x94aca9[_0xb2a3('0x18')][_0xb2a3('0x19')](),_0x12e26d,_0x94aca9[_0xb2a3('0x13')]);}function fileFormat(_0x17647d,_0x5b653f){_0x5b653f[_0xb2a3('0x13')]=_0x5b653f['message'][_0xb2a3('0x15')](/@@{/g,_0xb2a3('0x14'))[_0xb2a3('0x15')](/}@@/g,_0xb2a3('0x16'))[_0xb2a3('0x15')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x4256ef=_0x5b653f[_0xb2a3('0x1a')]&&Object[_0xb2a3('0x1b')](_0x5b653f['meta'])[_0xb2a3('0x1c')]?'\x0a\x09'+JSON[_0xb2a3('0x1d')](_0x5b653f[_0xb2a3('0x1a')]):'';return util[_0xb2a3('0x11')](_0xb2a3('0x1e'),moment()[_0xb2a3('0x11')](_0xb2a3('0x17')),_0x5b653f[_0xb2a3('0x18')][_0xb2a3('0x19')](),_0x17647d,_0x5b653f[_0xb2a3('0x13')],_0x4256ef);}function consoleLogger(){var _0x359ae1=new winston[(_0xb2a3('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb2a3('0x20'))][(_0xb2a3('0x21'))]({'level':_0xb2a3('0x22'),'json':![],'formatter':function(_0x154e68){return formatter('',_0x154e68);}})]});return _0x359ae1;}function fileLogger(_0x2ab856,_0x550a4b){var _0x38beea=new winston[(_0xb2a3('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb2a3('0x20'))]['File']({'name':util[_0xb2a3('0x11')](_0xb2a3('0x23'),_0x2ab856,'error'),'filename':getLogFileName(_0x550a4b,_0x2ab856,_0xb2a3('0x24')),'level':_0xb2a3('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x585448){return fileFormat(_0x2ab856,_0x585448);}}),new winston[(_0xb2a3('0x20'))][(_0xb2a3('0x25'))]({'name':util[_0xb2a3('0x11')](_0xb2a3('0x23'),_0x2ab856,debugLevel),'filename':getLogFileName(_0x550a4b,_0x2ab856,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5e1e59){return fileFormat(_0x2ab856,_0x5e1e59);}}),new winston['transports']['Console']({'level':_0xb2a3('0x22'),'json':![],'formatter':function(_0x35c2e9){return fileFormat(_0x2ab856,_0x35c2e9);}})]});return _0x38beea;}exports[_0xb2a3('0x26')]=consoleLogger;exports[_0xb2a3('0x27')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index bd1560a..eab92e3 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 _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x4975,0x86));var _0x5497=function(_0x40f5bc,_0x3f9592){_0x40f5bc=_0x40f5bc-0x0;var _0x3d562c=_0x4975[_0x40f5bc];return _0x3d562c;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file +var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x1091cb,_0x3efe0e){var _0x3ad5b5=function(_0x128901){while(--_0x128901){_0x1091cb['push'](_0x1091cb['shift']());}};_0x3ad5b5(++_0x3efe0e);}(_0x2ef3,0xba));var _0x32ef=function(_0x1264ab,_0x53bd6a){_0x1264ab=_0x1264ab-0x0;var _0x1e65fb=_0x2ef3[_0x1264ab];return _0x1e65fb;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7137781..e7025f7 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 _0xf7b4=['replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','lodash','\x20}\x20}'];(function(_0x18b8bd,_0x3db3f8){var _0x3c6614=function(_0x13225c){while(--_0x13225c){_0x18b8bd['push'](_0x18b8bd['shift']());}};_0x3c6614(++_0x3db3f8);}(_0xf7b4,0x152));var _0x4f7b=function(_0xbd3248,_0x3168e0){_0xbd3248=_0xbd3248-0x0;var _0x32db8e=_0xf7b4[_0xbd3248];return _0x32db8e;};var _=require(_0x4f7b('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5579ed){return _0x5579ed==='{{'?'{\x20{\x20':_0x4f7b('0x1');}function safeTemplate(_0x103165){var _0x50ea23=_0x103165;if(typeof _0x103165==='string'){_0x50ea23=_0x103165[_0x4f7b('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x4f7b('0x3')](_0x103165)){_0x50ea23=_0x103165[_0x4f7b('0x4')](function(_0x44f991){return safeTemplate(_0x44f991);});}else if(_[_0x4f7b('0x5')](_0x103165)){_0x50ea23=Object[_0x4f7b('0x6')](_0x103165)[_0x4f7b('0x7')](function(_0x3ad135,_0x173784){_0x3ad135[_0x173784]=safeTemplate(_0x103165[_0x173784]);return _0x3ad135;},{});}return _0x50ea23;}module[_0x4f7b('0x8')][_0x4f7b('0x9')]=safeTemplate; \ No newline at end of file +var _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x4a96af,_0x4f88f6){var _0x522bec=function(_0x358c19){while(--_0x358c19){_0x4a96af['push'](_0x4a96af['shift']());}};_0x522bec(++_0x4f88f6);}(_0xea28,0x13a));var _0x8ea2=function(_0x58a332,_0x79e648){_0x58a332=_0x58a332-0x0;var _0x435c69=_0xea28[_0x58a332];return _0x435c69;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index a1f88df..960986b 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa086=['findIndex','motion2','NODE_PATH','env','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','apps'];(function(_0x3f8653,_0x36310d){var _0x5f08f2=function(_0xd55b7a){while(--_0xd55b7a){_0x3f8653['push'](_0x3f8653['shift']());}};_0x5f08f2(++_0x36310d);}(_0xa086,0x91));var _0x6a08=function(_0x46e7c1,_0x478823){_0x46e7c1=_0x46e7c1-0x0;var _0x1e667d=_0xa086[_0x46e7c1];return _0x1e667d;};var fs=require(_0x6a08('0x0'));var path=require(_0x6a08('0x1'));var config=require(_0x6a08('0x2'));var root=config[_0x6a08('0x3')];var APP_JSON_PATH=path[_0x6a08('0x4')](root,_0x6a08('0x5'));var NODEPATH=path['resolve'](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x2ce856){let _0x535fbb=![];if(Array['isArray'](_0x2ce856[_0x6a08('0x6')])){var _0x2129f2=_0x2ce856[_0x6a08('0x6')][_0x6a08('0x7')](function(_0x3cae0f){return _0x3cae0f['name']===_0x6a08('0x8');});if(_0x2129f2>-0x1){var _0x46b753=_0x2ce856[_0x6a08('0x6')][_0x2129f2];if(typeof _0x46b753['env'][_0x6a08('0x9')]!=='string'){_0x46b753[_0x6a08('0xa')]['NODE_PATH']=NODEPATH;_0x535fbb=!![];}}return{'appConfig':_0x2ce856,'updated':_0x535fbb};}}function updateAppConfig(_0x5e37bb){return fs[_0x6a08('0xb')](APP_JSON_PATH)[_0x6a08('0xc')](function(_0xd64948){if(_0xd64948){return fs[_0x6a08('0xd')](APP_JSON_PATH)['then'](function(_0x486268){var _0x133426=setLegacyLibsNodeEnvPath(_0x486268);if(_0x133426[_0x6a08('0xe')]){_0x5e37bb[_0x6a08('0xf')](_0x6a08('0x10'));return fs[_0x6a08('0x11')](APP_JSON_PATH,_0x486268,{'spaces':0x2});}else{return Promise[_0x6a08('0x4')]();}});}else{return Promise[_0x6a08('0x4')]();}});}module[_0x6a08('0x12')]=updateAppConfig; \ No newline at end of file +var _0x05ab=['motion2','string','NODE_PATH','pathExists','readJSON','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','legacy-libs','isArray','apps','findIndex'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x05ab,0xcf));var _0xb05a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x05ab[_0xa148b7];return _0x51efd3;};var fs=require(_0xb05a('0x0'));var path=require(_0xb05a('0x1'));var config=require(_0xb05a('0x2'));var root=config[_0xb05a('0x3')];var APP_JSON_PATH=path[_0xb05a('0x4')](root,'server/app.json');var NODEPATH=path['resolve'](root,_0xb05a('0x5'));function setLegacyLibsNodeEnvPath(_0x46913f){let _0x407e16=![];if(Array[_0xb05a('0x6')](_0x46913f[_0xb05a('0x7')])){var _0x119181=_0x46913f[_0xb05a('0x7')][_0xb05a('0x8')](function(_0x128679){return _0x128679['name']===_0xb05a('0x9');});if(_0x119181>-0x1){var _0x372e9a=_0x46913f[_0xb05a('0x7')][_0x119181];if(typeof _0x372e9a['env']['NODE_PATH']!==_0xb05a('0xa')){_0x372e9a['env'][_0xb05a('0xb')]=NODEPATH;_0x407e16=!![];}}return{'appConfig':_0x46913f,'updated':_0x407e16};}}function updateAppConfig(_0x11cd8d){return fs[_0xb05a('0xc')](APP_JSON_PATH)['then'](function(_0x419c1d){if(_0x419c1d){return fs[_0xb05a('0xd')](APP_JSON_PATH)['then'](function(_0xd0eae7){var _0x47d070=setLegacyLibsNodeEnvPath(_0xd0eae7);if(_0x47d070['updated']){_0x11cd8d[_0xb05a('0xe')](_0xb05a('0xf'));return fs[_0xb05a('0x10')](APP_JSON_PATH,_0xd0eae7,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xb05a('0x4')]();}});}module[_0xb05a('0x11')]=updateAppConfig; \ No newline at end of file diff --git a/snippet/3.7.0/assets/images/00fe515d7113c2841e5d.svg b/snippet/3.5.0/assets/images/00fe515d7113c2841e5d.svg similarity index 100% rename from snippet/3.7.0/assets/images/00fe515d7113c2841e5d.svg rename to snippet/3.5.0/assets/images/00fe515d7113c2841e5d.svg diff --git a/snippet/3.7.0/assets/images/3b24a6b94b2631f4d565.svg b/snippet/3.5.0/assets/images/3b24a6b94b2631f4d565.svg similarity index 100% rename from snippet/3.7.0/assets/images/3b24a6b94b2631f4d565.svg rename to snippet/3.5.0/assets/images/3b24a6b94b2631f4d565.svg diff --git a/snippet/3.7.0/assets/images/c9f502ad417b1b987198.svg b/snippet/3.5.0/assets/images/c9f502ad417b1b987198.svg similarity index 100% rename from snippet/3.7.0/assets/images/c9f502ad417b1b987198.svg rename to snippet/3.5.0/assets/images/c9f502ad417b1b987198.svg diff --git a/snippet/3.5.0/index.html b/snippet/3.5.0/index.html new file mode 100644 index 0000000..c06e349 --- /dev/null +++ b/snippet/3.5.0/index.html @@ -0,0 +1,29 @@ +xCally Motion Chat
{{ actualTitle }}
diff --git a/snippet/3.5.0/scripts/app.js b/snippet/3.5.0/scripts/app.js new file mode 100644 index 0000000..210848b --- /dev/null +++ b/snippet/3.5.0/scripts/app.js @@ -0,0 +1,2 @@ +/*! For license information please see app.js.LICENSE.txt */ +"use strict";(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["app"],{"./src/styles/app.scss":()=>{}},e=>{e.O(0,["vendor","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","chat"],(()=>("./src/styles/app.scss",e(e.s="./src/styles/app.scss")))),e.O()}]); \ No newline at end of file diff --git a/snippet/3.5.0/scripts/app.js.LICENSE.txt b/snippet/3.5.0/scripts/app.js.LICENSE.txt new file mode 100644 index 0000000..15c6a44 --- /dev/null +++ b/snippet/3.5.0/scripts/app.js.LICENSE.txt @@ -0,0 +1,19 @@ +/*! + * ************************************************************************* + * * * + * * xCALLY Motion - The Omnichannel Contact Center * + * * Copyright (c) Xenialab s.r.l. All Rights Reserved * + * * * + * ************************************************************************* + * * * + * * Email: info@xcally.com * + * * Website: https://www.xcally.com * + * * * + * ************************************************************************* + * * * + * * The SOFTWARE PRODUCT is protected by copyright laws and international * + * * copyright treaties, as well as other intellectual property laws and * + * * treaties. The SOFTWARE PRODUCT is licensed, not sold. * + * * * + * ************************************************************************* + */ diff --git a/snippet/3.5.0/scripts/chat.js b/snippet/3.5.0/scripts/chat.js new file mode 100644 index 0000000..49ad0c7 --- /dev/null +++ b/snippet/3.5.0/scripts/chat.js @@ -0,0 +1,3 @@ +/*! For license information please see chat.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y;function L(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function g(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function Y(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function k(e){return function(t){h.errors[e]=t.data,g()}}function j(e){u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),g()})).catch(k("chatMessageError"))}function w(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:L();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function D(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&j(v()({body:n},t.visitor))}function H(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?L():(w(),p=r(H,2e3),M=r(w,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){D(t)},ready:function(){this.setFocus()}}})},h.reply=D,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(j(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void Y();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},j(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):k("sendAttachment")}),k("sendAttachment"))},h.handleSizeError=Y,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+r.referer+"

"),i.document.write("

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

"),i.document.write("

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

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/dc49a9ba939f8c099868.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/9962474df74f9405ac72.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/caf0e553108b226443aa.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); +//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.5.0/scripts/chat.js.LICENSE.txt b/snippet/3.5.0/scripts/chat.js.LICENSE.txt new file mode 100644 index 0000000..0c56e30 --- /dev/null +++ b/snippet/3.5.0/scripts/chat.js.LICENSE.txt @@ -0,0 +1,7 @@ +/** + * @license AngularJS v1.8.2 + * (c) 2010-2020 Google LLC. http://angularjs.org + * License: MIT + */ + +//! moment.js locale configuration diff --git a/snippet/3.5.0/scripts/chat.js.map b/snippet/3.5.0/scripts/chat.js.map new file mode 100644 index 0000000..1f082e3 --- /dev/null +++ b/snippet/3.5.0/scripts/chat.js.map @@ -0,0 +1 @@ +{"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,sWC9ZlDwJ,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,oZCJ3BO,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,6cC/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,qKCzDS5sC,EAAK,CAEZkJ,KAAM,SAAUjM,GAAO,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAAU,OAAO1nC,EAAQ3I,OAEtFqwC,OAAQ,SAAUrwC,GACd,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAClCA,EAAOrwC,OAIfiI,MAAO,WACH,IAAIqoC,EAAW,GAKf,OAJAA,EAAS7wC,QAAU,IAAI2wC,SAAQ,SAAUznC,EAAS0nC,GAC9CC,EAAS3nC,QAAUA,EACnB2nC,EAASD,OAASA,KAEfC,GAGX74B,IAAK,SAAUF,GACX,IAAI,QAAQA,GACR,OAAO64B,QAAQ34B,IAAIF,GAEvB,IAAI,QAASA,GAAW,CAGpB,IAAI0gB,EAAQ1oB,OAAOC,KAAK+H,GAAU5M,KAAI,SAAU9I,GAAO,OAAO0V,EAAS1V,GAAKkF,MAAK,SAAU/G,GAAO,MAAO,CAAG6B,IAAKA,EAAK7B,IAAKA,SAE3H,OAAO+C,EAAG0U,IAAIwgB,GAAOlxB,MAAK,SAAUiW,GAChC,OAAOA,EAAOpS,QAAO,SAAUsL,EAAKzG,GAEhC,OADAyG,EAAIzG,EAAM5N,KAAO4N,EAAMzP,IAChBkW,IACR,yMC/CRq6B,EAAmB,SAAUC,EAAOnpB,GAC3C,IAAIxlB,EAAMwlB,EAAG,GAAIrnB,EAAMqnB,EAAG,GAU1B,OATKmpB,EAAM9xC,eAAemD,IAGjB,QAAQ2uC,EAAM3uC,IACnB2uC,EAAM3uC,GAAKpF,KAAKuD,GAGhBwwC,EAAM3uC,GAAO,CAAC2uC,EAAM3uC,GAAM7B,GAN1BwwC,EAAM3uC,GAAO7B,EAQVwwC,GAEAC,EAAY,SAAUC,GAC7B,OAAOA,EAAY5xB,MAAM,KAAKxZ,OAAO,MAAUqF,IAAI,MAAYC,OAAO2lC,EAAkB,KAErF,SAASra,EAASzoB,GACrB,IAAIkjC,EAAgB,SAAUrlC,GAAK,OAAOA,GAAK,IAC3C+b,GAAK,QAAU5Z,GAAK9C,IAAIgmC,GAAgBC,EAAavpB,EAAG,GAAIyG,EAAOzG,EAAG,GACtEC,GAAK,QAAWspB,GAAYjmC,IAAIgmC,GACpC,MAAO,CAAExsC,KADkDmjB,EAAG,GACzC6jB,OADsD7jB,EAAG,GACzCwG,KAAMA,EAAMrgB,IAAKA,GAEnD,IAAIojC,EAAW,SAAUC,GAC5B,IAAI3sC,EAAO2sC,EAAI3sC,OACX4sC,EAAeD,EAAI3F,SACnBrd,EAAOgjB,EAAIhjB,OACXqd,EAAS57B,OAAOC,KAAKuhC,GACpBpmC,KAAI,SAAU9I,GACf,IAAImJ,EAAQ+lC,EAAalvC,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,SAASkjB,EAAsBxvC,EAAM0oC,EAAS+G,EAAcC,GAC/D,OAAO,SAAU98B,GACb,IAAIX,EAAWW,EAAShB,gBAAkB,IAAI69B,EAAa78B,GACvD+8B,EAAiB/8B,EAASf,eAAiB,IAAI69B,EAAmB98B,EAAU81B,GAKhF,MAAO,CAAE1oC,KAAMA,EAAMiS,QAASA,EAAS09B,cAAeA,EAAejgC,QAJrE,SAAiBR,GACbA,EAAOQ,QAAQuC,GACf/C,EAAOQ,QAAQigC,kaCvBvBr6B,EAA6B,WAE7B,SAASA,EAA6BpG,GAClC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKo1C,SAAW,GAChBp1C,KAAKq1C,aAAe,GACpBr1C,KAAKs1C,qBAAuB,GAC5Bt1C,KAAKgyC,WAAa,GAEnChyC,KAAKgK,WAAa,CACdC,iBAAkBjK,KAAKiK,iBAAiB3G,KAAKtD,MAC7CgX,mBAAoBhX,KAAKgX,mBAAmB1T,KAAKtD,MACjDu1C,kBAAmB,SAAUlqC,GAAM,OAAO,QAAK8E,EAAMilC,UAAU,SAAUt7B,GAAQ,OAAO3J,EAAMuE,OAAOyG,IAAM,IAAMrB,EAAKzO,KAAOA,MAC7HmqC,mBAAoB,WAAc,OAAOrlC,EAAMilC,UAC/CK,mBAAoB,WAAc,OAAOtlC,EAAMklC,cAC/CK,QAAS,SAAUvX,GAEf,OADAhuB,EAAM6hC,WAAWvxC,KAAK09B,GACf,WAAc,OAAO,QAAWhuB,EAAM6hC,WAAY7T,MAwPrE,OAzOArjB,EAAY66B,sBAAwB,SAAU9kC,EAAS+kC,QAC/B,IAAhBA,IAA0BA,EAAc,IAI5C,IAAIC,EAAgBD,EAAY9yB,MAAM,KAClC9H,EAAa66B,EAAc,IAAM,WACjC36B,GAAsB,QAAS26B,EAAc,IAAMA,EAAc,GAAK,IAGtEC,EAAwB,wBAAwBrsC,KAAKuR,GAYzD,GAXI86B,IAEA56B,EAAsB46B,EAAsB,GAC5C96B,EAAa86B,EAAsB,IAEV,MAAzB96B,EAAWvV,OAAO,KAClBuV,EAAaA,EAAW+L,OAAO,GAC/B7L,EAAsB,IAGN,kBACFzR,KAAKyR,GAAsB,CACzC,IAAI66B,EAAc76B,EAAoB4H,MAAM,KAAKlU,QAAO,SAAUonC,EAAQ1mC,GAAK,OAAO0mC,EAAO57B,SAAWvJ,GACxGqK,EAAsB66B,EAAYvwC,SAEL,MAAxB0V,IACLA,EAAsBrK,EAAQrL,MAElC,MAAO,CAAEwV,WAAYA,EAAYE,oBAAqBA,IAG1DJ,EAAYjZ,UAAUoI,iBAAmB,SAAU4G,GAC/C,OAAQ7Q,KAAKi2C,aAAeplC,GAAW7Q,KAAKi2C,cAGhDn7B,EAAYjZ,UAAUmV,mBAAqB,SAAUk/B,EAAUh2C,GAC3DF,KAAKs1C,qBAAqBY,GAAYh2C,GAE1C4a,EAAYjZ,UAAU2yB,iBAAmB,SAAUrsB,EAAMozB,GACrD,IAAI4a,EAAan2C,KAAKs1C,qBAAqB/Z,EAAKnwB,OAChD,IAAK+qC,EACD,MAAM,IAAI1jC,MAAM,2DAA6D8oB,EAAKnwB,OACtF,IAAIgrC,EAAOD,EAAWhuC,EAAMozB,GAC5B,OAAO,QAAQ6a,GAAQA,EAAO,CAACA,IAUnCt7B,EAAYjZ,UAAUumC,qBAAuB,SAAU19B,GACnD,2BAA4B,cAAeA,IAC3C,QAAW1K,KAAKq1C,aAAc3qC,IAElCoQ,EAAYjZ,UAAUwmC,mBAAqB,SAAU39B,GACjD,2BAA4B,iBAAkBA,GAC9C1K,KAAKq1C,aAAa50C,KAAKiK,IAE3BoQ,EAAYjZ,UAAU+qB,KAAO,WACzB,IAAIzc,EAAQnQ,KACRq2C,EAAer2C,KAAKo1C,SAASzmC,KAAI,SAAU4c,GAAO,MAAO,CAACA,EAAIjgB,IAAKigB,MAAS3c,OAAO,KAAY,IASnG,SAAS0nC,EAAgB/qC,GAErB,IADA,IAAIsF,EAAUtF,EAAOxD,SAASgC,SAAUG,EAAQ,IACvCA,GAAS2G,EAAQuJ,QACtBvJ,EAAUA,EAAQuJ,OACtB,OAAOlQ,EAGX,IAAIqsC,GAAe,SAAM,SAAUC,EAASC,EAAQ1lB,EAAMC,GAAS,OAAOylB,GAAUD,EAAQzlB,GAAQylB,EAAQxlB,OAkBxG0lB,EAAe12C,KAAKo1C,SAAS5pB,KAAK+qB,GA9BtC,SAAqB9vC,GACjB,IAAIkwC,EAAa,SAAU9lC,GAAW,OAAQA,GAAWA,EAAQuJ,OAASu8B,EAAW9lC,EAAQuJ,QAAU,EAAI,GAC3G,OAAsC,IAA/B3T,EAAO6E,IAAIwX,MAAM,KAAK1T,OAAiBunC,EAAWlwC,EAAOkiB,mBA4BJ,IAAIha,KAjB3C,SAAUlI,GAC/B,IAAImwC,EAAkBzmC,EAAMklC,aAAa/rC,OAAOwR,EAAYoI,QAAQmzB,EAAc5vC,IAOlF,OANImwC,EAAgBxnC,OAAS,GAIzBwnC,EAAgBprB,KAAK+qB,EAAaD,GAAkB,IAEjD,CAAE7vC,OAAQA,EAAQiE,WAAYksC,EAAgB,OAUrDC,EAAqBH,EAAa/nC,KAAI,SAAU8E,GAAS,OAAOA,EAAM/I,cACtEosC,EAAwB92C,KAAKq1C,aAC5B/rC,QAAO,SAAUiC,GAAU,QAAQ,QAAQsrC,EAAoBtrC,MAC/DoD,KAAI,SAAUjE,GAAc,MAAO,CAAGjE,YAAQ0N,EAAWzJ,WAAYA,MAC1EgsC,EAAa31C,SAZS,SAAU0S,IAGkB,IAA1CtD,EAAMilC,SAASlnC,QAAQuF,EAAMhN,SAC7BgN,EAAMhN,OAAO+E,cAAciI,EAAM/I,eASzC,IAAIqsC,EAAYL,EAAat0C,OAAO00C,GACpC92C,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGisC,MAClD,mBAAoBA,IAiBxBj8B,EAAYjZ,UAAUgK,eAAiB,SAAUpF,GAC7C,iCAAkC,iBAAkBA,GACpD,IAAIuwC,EAAUh3C,KAAKo1C,SAMnB,OAJI4B,EAAQ1tC,QADY,SAAUiiB,GAAO,OAAOA,EAAIjgB,MAAQ7E,EAAO6E,KAAOigB,EAAIngB,QAAU3E,EAAO2E,SACzDgE,QAClC,iCAAkC,+BAAgC3I,GACtEuwC,EAAQv2C,KAAKgG,GACbzG,KAAK4sB,OACE,YAEU,IADHoqB,EAAQ9oC,QAAQzH,IAK1B,iCAAkC,mBAAoBA,IACtD,QAAWuwC,EAAX,CAAoBvwC,IAJhB,iCAAkC,uCAAwCA,KAYtFqU,EAAYjZ,UAAUo1C,UAAY,WAC9B,OAAOj3C,KAAKo1C,SAASzmC,KAAI,QAAK,SAOlCmM,EAAYjZ,UAAUq1C,OAAS,WAC3B,OAAOl3C,KAAKo1C,SAAS9rC,QAAO,QAAK,YAAYqF,KAAI,QAAK,UA2D1DmM,EAAYoI,QAAU,SAAUmzB,EAAc5vC,GAAU,OAAO,SAAUiE,GAErE,GAAIjE,EAAO2E,QAAUV,EAAW3C,SAASqD,MACrC,OAAO,EAEX,IAAI+8B,EAAKz9B,EAAW3C,SAChBovC,EAAahP,EAAGptB,YAAY+H,MAAM,KAClCs0B,EAAc3wC,EAAO6E,IAAIwX,MAAM,KAGnC,KAAK,QAAOq0B,EAAYC,EAAYt1C,MAAM,EAAIq1C,EAAW/nC,SACrD,OAAO,EAGX,IAAIioC,EAAY,EAAIF,EAAW/nC,aAAU+E,EACrCmjC,EAAoBF,EAAYt1C,MAAM,EAAGu1C,GAAWpkC,KAAK,KACzDskC,EAAgBlB,EAAaiB,GAAmB3uB,gBACpD,OAAOwf,EAAGltB,wBAA0Bs8B,GAAiBA,EAAc/xC,QAEhEsV,EA1QqB,wDCfhC,SAAUyL,EAAQ1mB,GAAU,aAyD5B,IAAI23C,EAAoB,gBAEpBC,EAAe53C,EAAQC,OAAO,SAAU,CAAC,OACrB43C,KAAK,CAAEC,eAAgB,UACvB53C,SAAS,SAkCjC,WACE,IAAIwL,EAAS,CACXqsC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,kBAAkB,GAgCpB,SAASC,EAAUzlC,EAAU0lC,EAAUC,EAAqBC,GAC1D,OAAO,SAAS31C,EAAOoe,EAAMpO,GAC3B,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAIkB,EAAgB5lC,EAAKkd,WAAWuoB,IAChChtC,EAAOmtC,IAAmBC,EAAYz3B,EAAMs3B,IAAyB1lC,EAAK4lC,IAC5E51C,EAAMyB,OAAOuO,EAAKD,IAAW,SAAS+lC,GAEpCA,EAAUH,GAAUG,IAAYA,EAChC13B,EAAKpO,KAAKylC,EAAUK,QAb5B54C,KAAKuL,OAAS,SAASstC,GACrBttC,EAAS1L,EAAQiB,OAAOyK,EAAQstC,IAkElC74C,KAAKU,KAAO,WACV,MAAO,CACL6K,OAAQ,SAAS1F,GACf,OAAO0F,EAAO1F,IAEhBizC,YAAaR,OA5IfE,EAAsB,CAAC,SAAU,IAAK,QAAS,WAAY,SAAU,UAAW,WAEhFG,EAAc,SAASz3B,EAAM63B,GAC/B,IAAiD,IAA7CA,EAAc7qC,QAAQgT,EAAK,GAAG83B,UAChC,OAAO,GA8IXvB,EAAa50C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GAClD,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GACtC,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GACvC,OAAOA,EAAMH,YAAY,UAAW,eAAgBN,GAAqB,MAE1E31C,UAAU,YAAa,CAAC,QAAS,SAASo2C,GACzC,OAAOA,EAAMH,YAAY,YAAa,eAAgBN,GAAqB,MAE5E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GAEvC,SAASC,EAAiBpmC,EAAMqmC,EAAgBj4B,EAAMk4B,GACpD,OAAOH,EAAM1tC,OAAO4tC,KACjBj4B,EAAKpO,KAAKA,KACVsmC,IAAsBT,EAAYz3B,EAAMs3B,MAClB,WAAtBt3B,EAAKpO,KAAK,SAA6C,UAArBoO,EAAK,GAAG83B,UAG/C,SAASK,EAAiBC,EAAMp4B,GAI9B,OAAQA,EAAKpO,KAAK,SAAYoO,EAAKpO,KAAK,UAAYwmC,IAAUX,EAAYz3B,EAAMs3B,GAYlF,MAAO,CACLrxC,SAAU,IACVxB,QAAS,UACTyB,SAAU,IACVC,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI+B,EAhBR,SAAkBzmC,EAAMoO,GACtB,IAAIhS,EAAO4D,EAAK5D,KACZoqC,EAAOxmC,EAAKwmC,KAEhB,MAA2B,cAAlBpqC,GAAQoqC,IAAiC,qBAATA,EAA+B,WAC7C,WAAlBpqC,GAAQoqC,IAAiC,kBAATA,EAA4B,QACpD,UAATpqC,GAA0C,gBAAToqC,GAAmC,WAATA,EAAqB,QAAU,GAUpFE,CAAS1mC,GAErB,MAAO,CACL2mC,KAAM,SAAS32C,EAAOoe,EAAMpO,EAAM4mC,GAChC,IAAIC,EAAgBT,EAAiB,WAAY,WAAYh4B,GAAM,GAEnE,SAAS04B,IACP,OAAOF,EAAQG,YAcjB,OAAQN,GACN,IAAK,QACL,IAAK,WACCF,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQymC,GAEhBL,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,OAAOq1C,EAAiC,UAAVL,EAlB1C,SAA0BO,GAGxB,IAAIlB,EAAW9lC,EAAKtO,OAASk1C,EAAQK,WACrC74B,EAAKpO,KAAK,eAAgB8lC,IAG5B,WACE13B,EAAKpO,KAAK,gBAAiB4mC,EAAQM,SAASN,EAAQK,eAa9CJ,GACFz4B,EAAKpO,KAAK,WAAY,GAExB,MACF,IAAK,QAIH,GAHIumC,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQ,UAEhBmmC,EAAM1tC,OAAO,aAAc,CAC7B,IAAI0uC,GAAqB/4B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDw3C,GAAqBh5B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDy3C,GAAqBj5B,EAAKpO,KAAK,iBAE/BmnC,GACFnnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BI,GACFpnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BK,GACFr3C,EAAMyB,OAAOq1C,GAAuB,SAAgCE,GAClE54B,EAAKpO,KAAK,gBAAiBgnC,MAI7BH,GACFz4B,EAAKpO,KAAK,WAAY,IAKvBA,EAAKpQ,eAAe,eAAiBg3C,EAAQW,YAAYC,UACzDpB,EAAiB,gBAAiB,eAAgBh4B,GAAM,IAE3DpO,EAAKsnC,SAAS,YAAY,WACxBl5B,EAAKpO,KAAK,kBAAmBA,EAAe,aAI5ComC,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,QAAO,WACX,OAAOm1C,EAAQa,YACd,SAA+BT,GAChC54B,EAAKpO,KAAK,iBAAkBgnC,cAQzCj3C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,cAAc,WACvB,MAAO,CACLsE,SAAU,IACVxB,QAAS,cACT4C,KAAM,SAASzF,EAAOoe,EAAMpO,EAAM0nC,GAC5B1nC,EAAKpQ,eAAe80C,IAEnBt2B,EAAKpO,KAAK,cACboO,EAAKpO,KAAK,YAAa,kBAK9BjQ,UAAU,UAAU,CAAC,QAAS,SAAU,SAASo2C,EAAO93C,GACvD,MAAO,CACLgG,SAAU,IACVE,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI72C,EAAKQ,EAAO2R,EAAK2nC,SACrB,OAAO,SAAS33C,EAAOoe,EAAMpO,GAEtB6lC,EAAYz3B,EAAMs3B,KAEjBS,EAAM1tC,OAAO,sBAAwB2V,EAAKpO,KAAK,SACjDoO,EAAKpO,KAAK,OAAQ,UAGhBmmC,EAAM1tC,OAAO,cAAgB2V,EAAKpO,KAAK,aACzCoO,EAAKpO,KAAK,WAAY,IAGpBmmC,EAAM1tC,OAAO,gBAAmBuH,EAAK4nC,WAAc5nC,EAAK6nC,YAAe7nC,EAAK8nC,SAC9E15B,EAAK5gB,GAAG,WAAW,SAASC,GAC1B,IAAIs6C,EAAUt6C,EAAMu6C,OAASv6C,EAAMs6C,QAEnB,KAAZA,GAA8B,KAAZA,KAEwC,IAAxDrC,EAAoBtqC,QAAQ3N,EAAM8F,OAAO2yC,WAAqBz4C,EAAM8F,OAAO00C,mBAG7Ex6C,EAAMgD,iBAERT,EAAMmB,QAGR,WACEtD,EAAGmC,EAAO,CAAEk4C,OAAQz6C,mBASnCsC,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAO,SAASn2C,EAAOoe,EAAMpO,GACvBA,EAAKpQ,eAAe80C,KAEpByB,EAAM1tC,OAAO,aAAgB2V,EAAKpO,KAAK,aAAgB6lC,EAAYz3B,EAAMs3B,IAC3Et3B,EAAKpO,KAAK,WAAY,OA9Z5B,CAoaGyT,OAAQA,OAAO1mB,iECzalBA,QAAQC,OAAO,WAAY,CAAC,OAC3B+C,UAAU,WAAY,CAAC,KAAM,SAAUkE,GACvC,aAgCA,MAAO,CACNjE,MAAM,CACL42C,QAAe,IACf73B,IAAe,QACfiF,IAAe,QACfgD,KAAe,SACfmxB,SAAe,aACfC,SAAe,aACfC,UAAe,cACfC,UAAe,cACfC,WAAe,eACfC,WAAe,eACfC,aAAe,iBACfC,MAAe,UACfC,MAAe,UACfC,YAAe,gBACfC,YAAe,iBAEhBvqC,YAAa,2BACPzL,QAAS,UACToP,SAAS,EACTxM,KAlDI,SAAUtH,EAAQyG,EAAUxG,GAElCA,EAAO+5C,WACVh6C,EAAOg6C,SAAW,WAAW,OAAO,IAGjC/5C,EAAOi6C,YACVl6C,EAAOk6C,UAAY,WAAW,OAAO,IAGlCj6C,EAAOw6C,cACVz6C,EAAOy6C,YAAc,WAAW,IAAIviB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOs6C,QACVv6C,EAAOu6C,MAAQ,cAGZt6C,EAAOy6C,cACV16C,EAAO06C,YAAc,WAAW,IAAIxiB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOu6C,QACVx6C,EAAOw6C,MAAQ,eA4BVz6C,WAAY,yBAInBA,WAAW,qBAAsB,CAAC,SAAU,WAAY,SAAWC,EAAQuC,GAC3E,aAEAvC,EAAO26C,UAAar1B,OAAO7jB,eAAe,iBAAmB6jB,OAAOs1B,UAAUC,iBAAmB,EACjG76C,EAAO86C,SAAWl8C,QAAQoiB,KAAKhhB,EAAOy4C,SAEtCz4C,EAAO4gB,IAAM5gB,EAAO4gB,KAAO,EAC3B5gB,EAAO6lB,IAAM7lB,EAAO6lB,KAAO,EAC3B7lB,EAAO6oB,KAAO7oB,EAAO6oB,MAAQ,GAE7B7oB,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,QAE7Cz4C,EAAOm6C,UAAYn6C,EAAOm6C,WAAa,GACvCn6C,EAAO+6C,cAAgB/6C,EAAOm6C,UAAYn6C,EAAO6oB,KACjD7oB,EAAOo6C,WAAap6C,EAAOo6C,YAAc,GACzCp6C,EAAOq6C,WAAar6C,EAAOq6C,YAAcr6C,EAAOm6C,UAChDn6C,EAAOs6C,aAAet6C,EAAOs6C,cAAgBt6C,EAAOo6C,WAEpD,IAAI1nB,EAAO1yB,EAAO6lB,IAAM7lB,EAAO4gB,IAC/Bo6B,EAAQtoB,EAAO1yB,EAAO6oB,KACtBoyB,EAAUj7C,EAAOsD,OAAO,WAAW,WAClCtD,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,WAG9CyC,EAAW,SAAUC,GACpB,OAAQA,EAAM,GAAKH,EAAQtoB,GAG5B1yB,EAAOo7C,cAAgB,WACtB,OAAO,IAAIz6C,MAAMq6C,IAGlBh7C,EAAOq7C,cAAgB,SAAUF,GAChC,IAAIG,EAAQ,EAAEt7C,EAAO6oB,KAErB,OADW7oB,EAAOm6C,UAAUmB,GAAQH,EAAMG,IAI3Ct7C,EAAOu7C,WAAa,SAAUJ,GAC7B,OAAOD,EAASC,IAAUn7C,EAAOy4C,QAAQz4C,EAAO4gB,KAGjD5gB,EAAOw7C,aAAe,WACjBx7C,EAAOk6C,cAAgBl6C,EAAOg6C,YACjCh6C,EAAO06C,YAAY,CAACe,OAAOz7C,EAAOy4C,UAAU3uC,MAAK,WAChD9J,EAAOy4C,QAAUz4C,EAAO4gB,IACxB5gB,EAAOw6C,MAAM,CAACiB,OAAOz7C,EAAOy4C,cAK/Bz4C,EAAO07C,SAAW,SAAUP,GAC3B,IAAKn7C,EAAOg6C,WAAY,CACvB,IAAI2B,EAAW/8C,QAAQoiB,KAAKhhB,EAAO4gB,IAAMs6B,EAASC,IAElDn7C,EAAOy6C,YAAY,CAACgB,OAAOE,IAAW7xC,MAAK,WAC1C9J,EAAOy4C,QAAUkD,EACjBp5C,GAAS,WACRvC,EAAOu6C,MAAM,CAACkB,OAAOz7C,EAAOy4C,kBAMhCz4C,EAAOsB,IAAI,YAAY,WACtB25C,UAID3jC,IAAI,CAAC,iBAAkB,SAAUjI,GACjC,aAEAA,EAAeusC,IAAI,2BAElB,0iDCtHF,SAASC,EACP7mC,EACAL,EACA6C,EACAskC,EACAh2C,EACAi2C,EACAC,EACAC,EACAC,EACA35C,GAEA,MAAM45C,EAAKp9C,KA4CX,SAASq9C,EAAOC,GAEdN,EAAqBO,cAAcL,EAAgB,CAAEI,GAAAA,IAClDvyC,MAAMvG,IAhBX,IAAqBg5C,EAiBfvnC,EAAWwnC,OAASj5C,EAjBLg5C,GAkBI,IAAPF,EAAc,OAAS,OAjBvC1nC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,GAEF,KAcEh6C,GAAS,KACPyS,EAAWhS,eAGdoe,MAAM26B,EAAqBW,gBA6MhCP,EAAG/vC,QArGH,WACEmZ,QAAQo3B,MAAM,oCAAqC3nC,EAAW4nC,SAC9D5nC,EAAW6nC,OAAS,OAEpB,MAAMC,EAAY9nC,EAAW+nC,SAASC,MAChCC,EAAajoC,EAAW+nC,SAASG,UACjCC,EACJnoC,EAAW+nC,SAASK,iBAAmBpoC,EAAW+nC,SAASG,UACvDG,EAAeroC,EAAW+nC,SAASO,aACnCC,EAAmBvoC,EAAW+nC,SAASS,gBACvCC,EAAgB58B,KAAKgF,IACzBT,SAASs4B,gBAAgBC,aACzBr4B,OAAOs4B,aAAe,GAElBC,EAAez4B,SAASs4B,gBAAgBI,YAG9C14B,SAASs4B,gBAAgBK,MAAMC,YAAY,oBAAqBlB,GAChE13B,SAASs4B,gBAAgBK,MAAMC,YAAY,qBAAsBf,GACjE73B,SAASs4B,gBAAgBK,MAAMC,YAC7B,4BACAb,GAEF/3B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAX,GAEFj4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,2BACAT,GAEFn4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,wBACAP,GAEFr4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAH,GAGF,IAAII,GAAK,EAET,MAAMC,EAA8B36C,GAChB,OAAVA,GAAkBA,EAAMyR,EAAWJ,WAAc,GAGrDupC,EAAwBpC,EAAqBqC,QACjDlC,GACApyC,KAAKo0C,GACDG,EAAuBtC,EAAqBqC,QAChDnC,GACAnyC,KAAKo0C,GACPp4C,EAAG0U,IAAI,CAAC2jC,EAAuBE,IAC5Bv0C,MAAK,IAAiC,IAA/Bw0C,EAAcC,GAAiB,EACrCvpC,EAAW4nC,QAAU0B,EACrBtpC,EAAWwnC,OAAS+B,EAEhBvpC,EAAW4nC,QAAQ4B,aAAexpC,EAAWwnC,OAAOH,GACtD4B,GAAK,EAELjpC,EAAWwnC,OAAOH,IAAK,EAGa,iBAAlCrnC,EAAW+nC,SAAS0B,WACtBrC,EAAO6B,GAxMbzmC,EAAOi5B,GAjBT,WAAoB,QAClB,MAAMiO,EAAS1pC,EAAW+nC,SAAS2B,OAC7B9B,IAAU5nC,MAAAA,GAAA,UAAAA,EAAY4nC,eAAZ,mBAAqB4B,mBAArB,UAAkCp0C,IAE5Cu0C,EACJrQ,OAAOt5B,EAAW+nC,SAAS6B,kBAC3BtQ,OAAOt5B,EAAW+nC,SAAS8B,qBACzBvQ,OAAOt5B,EAAW+nC,SAAS6B,iBAE/B,SAAMhC,IAAa+B,GAAYD,GAQrBI,GAAa,aAAe,cAAe,KAAM,CACzDlqC,SAAU,YA6MR,IAAI2nC,EAAM,GAKRA,EAHAvnC,EAAW+nC,SAAS2B,SACnB1pC,EAAW+nC,SAASgC,gBAEf,OAEA,UAGRpqC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,EACAO,UAAAA,EACAG,WAAAA,EACAQ,cAAAA,EACAI,aAAAA,GAEF,KAGF,MAAME,EAAQ34B,SAAS45B,cAAc,SACrC55B,SAASpB,KAAKi7B,YAAYlB,GAC1BA,EAAMmB,MAAMC,WACV,2BAA6BnqC,EAAW+nC,SAASC,MAAQ,kBAG5D57B,MAAM26B,EAAqBW,iBAKhCP,EAAGiD,MA3MH,WACE,MAAMZ,EAAcxpC,EAAW4nC,QAAQ4B,YAEvC,GAAIA,GAAeA,EAAYp0C,GAAI,CAEjC,MAAMi1C,EAAUvD,EACbuD,UACAlmC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,eAC9CC,qBAAoB,GACpBrN,MACCl9B,EAAW+nC,SAASyC,iBAClB,yCAEHC,GAAG,MACHv8C,OAAO,UAEV44C,EACG4D,KAAKL,GACLv1C,MAAK,WACJ,OAAOkyC,EAAI2D,gBAAgBC,aAAa,CACtCx1C,GAAIo0C,EAAYp0C,GAChBy1C,QAAQ,EACRC,YAAa,YAEZC,YAEJj2C,MAAK,WACJ0N,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAGbwM,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM,YAAa6nB,QA4KnCkwB,EAAGC,OAASA,EACZD,EAAG6D,SAxKH,WACE,MAAM3M,EAAWvtC,EAAGkF,QACdwzC,EAAcxpC,EAAW4nC,QAAQ4B,YA2DvC,OAzDIA,GAAeA,EAAYp0C,IAC7B4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAO1B,EAAYp0C,GACnB+1C,YAAY,IAEbJ,SAASj2C,MAAK,SAAUpD,GACvB2sC,EAAS3nC,QACP00C,GAAAA,CAAK15C,EAAK25C,KAAKx/C,MAAM,IAAI,SAAUy/C,GACjC,IAAIC,EASJ,GAPsB,OAAlBD,EAAIE,YACND,EACEvrC,EAAW+nC,SAAS0D,eACpBzrC,EAAW4nC,QAAQ3uB,MACnB,UAAYqyB,EAAII,WAGE,QAAlBJ,EAAIE,UACN,OAAQxrC,EAAW+nC,SAAS4D,iBAC1B,IAAK,gBACHJ,EAASD,EAAIM,OACT5rC,EAAW+nC,SAAS8D,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,OACT5rC,EAAW+nC,SAAS8D,WAAaP,EAAIM,OACrC,SAKV,MAAO,CACLL,OAAQA,EACR1d,QAASyd,EAAIW,KACbC,UAAWC,GAAAA,CAAOb,EAAIY,WAAWv6B,OAAO,+BAK/CvF,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAIbonB,EAAS7wC,SA4GlB25C,EAAGiF,eA5OH,WACE,MAA4C,YAArCpsC,EAAW+nC,SAASsE,aAA6B,OAAS,OA4OnE,MAAMC,EAAgB,CACpB5C,OAAQ,CAAC,SAAU,OAAQ,UAAW,UAAW,aACjD6C,QAAS,CAAC,YAKZjvC,OAAO+6B,eAAer4B,EAAY,cAAe,CAC/CvF,MACE,IAAIpK,EAAS2P,EAAW+nC,SAASyE,aAMjC,OALIF,EAAc5C,OAAOrmC,SAASrD,EAAW6nC,QAC3Cx3C,EAAS2P,EAAW+nC,SAAS0E,cACpBH,EAAcC,QAAQlpC,SAASrD,EAAW6nC,UACnDx3C,EAAS2P,EAAW+nC,SAAS2E,gBAExBr8C,KAIXigB,OAAOq8B,iBACL,WACA,SAAU1sC,GACa,SAAjBA,EAAIvO,KAAKuO,IACXmnC,GAAO,GACmB,SAAjBnnC,EAAIvO,KAAKuO,KAClBmnC,GAAO,MAGX,2eCtTJ,SAASwF,EAAS5sC,EAAYF,GAE5B,MAAM3H,EAAS2H,EAAUo5B,SAGzBl5B,EAAW+nC,SAAW,CACpB8E,OAAQ,UACRC,MAAM,GAGRC,GAAAA,CAAO50C,GAAQ,SAAU5J,EAAOqB,GAChB,KAAVrB,GAAiBy+C,GAAAA,CAAOz+C,KACZ,SAAVA,IACFA,GAAQ,GAGI,UAAVA,IACFA,GAAQ,GAGVyR,EAAW+nC,SAASn4C,GAAOrB,MAI/ByR,EAAWJ,SAAWI,EAAW+nC,SAASnoC,SAC1CI,EAAWwnC,OAAS,CAAEH,IAAI,GAC1BrnC,EAAW4nC,QAAU,GAWvB,SAASqF,EACPC,EACA9uC,EACA+uC,EACAC,EACAC,GAEAjvC,EAAkBgB,WAAU,GAGvB+tC,EAAcnjD,SAAS0R,QAAQjB,MAClC0yC,EAAcnjD,SAAS0R,QAAQjB,IAAM,IAIvC0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI,qBACjC,gCAEF0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI,iBAAmB,WACtD0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI6yC,OAAS,WAG5CF,EAA4BG,UAAUF,GAGtCH,EACG11C,MAAM,MAAO,CACZkxB,UAAU,IAEXlxB,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAaqyC,EACbziD,WAAY,4BAEbyM,MAAM,aAAc,CACnBgE,IAAK,UACLL,YAAasyC,EACb1iD,WAAY,2BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAauyC,EACb3iD,WAAY,4BAEbyM,MAAM,WAAY,CACjBgE,IAAK,QACLL,YAAawyC,EACb5iD,WAAY,yBAEbyM,MAAM,gBAAiB,CACtBgE,IAAK,aACLL,YAAayyC,EACb7iD,WAAY,8BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAa0yC,EACb9iD,WAAY,0OC3FlB,SAAS+iD,EACP9tC,EACAwC,EACAurC,EACA/G,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAIX,SAASmmC,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMu8C,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXC,SAAS,OAEZP,EAASrD,KAAKuD,IAIlB,SAASM,IACPvuC,EAAWwuC,SAAU,EAkBvB,SAASC,IACHzuC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,uBAEL/uC,EAAW4nC,QAAQ4B,YAE1BxpC,EAAWgvC,gBAAiB,EAiD9B7H,EAAG/vC,QAjFH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWwuC,SAAU,KAsEtCrH,EAAG+H,OA1CH,WACElvC,EAAWwuC,SAAU,EAEjBxuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDP,MACC+E,GAAAA,CACE,CACE/5C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnCg6C,WAAYpvC,EAAW+nC,SAASqH,WAChCC,SACErvC,EAAW+nC,SAAS0D,eAAiBzrC,EAAW4nC,QAAQ3uB,MAE5DkuB,EAAGuH,OAGN3D,SAASj2C,MAAK,kBACNqyC,EAAG6G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,MAEfn5C,KAAK0wC,GACL1wC,KAAK25C,GACLriC,MAAM8jB,EAAY,WAClBqf,QAAQhB,IAEXA,IACAre,EAAY,YAOhBiX,EAAGqI,KAhDH,WACEhK,IACAiJ,KAgDFtH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GCjId,SAASyB,EAAWzvC,EAAY0vC,GAC9B,MAAMC,EAAgB,CACpBv6C,GAAI,MACJkW,MAAOtL,EAAW+nC,SAASz8B,OAGvB07B,EAAM,GAyEZ,OAvEAA,EAAI4I,QAAU5vC,EAAW+nC,SAAS8H,OAAS,QAE3C7I,EAAI8I,YAAcJ,EAChB1I,EAAI4I,QAAU,oBACdD,EACA,CACE3c,OAAQ,CACN+c,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,4BAErBrD,QAAS,CACPwD,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,6BAErBI,UAAW,CACTD,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,8BAKzB5I,EAAI2D,gBAAkB+E,EACpB1I,EAAI4I,QAAU,wBACdD,EACA,CACExpC,OAAQ,CACN4pC,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,yBAErBhF,aAAc,CACZmF,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,uCAErBxF,MAAO,CACL2F,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,+BAErB3E,YAAa,CACX8E,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,wCAErBK,iBAAkB,CAChBF,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,0CACnBl0C,QAAS,CACP,oBAAgBwC,GAElBgyC,iBAAkBtmD,QAAQ6c,UAE5B0pC,mBAAoB,CAClBJ,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,6CAErBQ,QAAS,CACPL,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,mCAKzB5I,EAAIqJ,YAAcX,EAChB1I,EAAI4I,QAAU,oBACdD,EACA,CACExpC,OAAQ,CACN4pC,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,uBAKlB5I,mTChET,SAASsJ,EACPtlD,EACAgV,EACAzS,EACAgjD,EACAC,EACAhuC,EACApI,EACA2zC,EACA/G,EACAD,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KACX,IAAI0mD,EACAC,EACAC,EACAC,EA4BJ,SAASC,IAEP//C,EAAAA,GAAAA,IAAO,CACLi2C,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,KAhBJkL,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,eAoB/C,SAASkxC,IACPvjD,GAAS,WACP,MAAMT,EAAU0jD,EAAU,GAAGO,uBAAuB,iBAAiB,GAEjEjkD,IACFA,EAAQkkD,UAAYlkD,EAAQmkD,iBAKlC,SAASC,IACP/J,EAAG6G,OAAS,GACZhuC,EAAWzJ,MAAM,QAEjB,MAAM03C,EAAQF,EACXG,SACAC,YACC,8CAEDE,WAAW,yBAA2BruC,EAAW+nC,SAASsE,cAC1DloC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GAIhB,SAAS/d,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtBo/C,KAIJ,SAASK,EAAYtjB,GACnBmZ,EAAI8I,YACD9c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,GACvBy1C,EAAG6G,OAAS,GACZ,IAAIoD,GAAkB,EAClBpE,GAAAA,CAAOhtC,EAAW4nC,QAAQ4B,eAC5BxpC,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAEvBg8C,GAAkB,GAEfpxC,EAAW4nC,QAAQyJ,qBACtBrxC,EAAW4nC,QAAQyJ,oBAAqB,EACxCD,GAAkB,GAGhBA,GACFrK,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEhC+I,EAAU,GAAGa,aAAaC,QAAQ,IAElCT,OAED1kC,MAAM8jB,EAAY,qBA0EvB,SAASshB,IAELxxC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,IAE/B4xC,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG6G,OAAOwD,eAGb9/C,EAAKm5C,SACP7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEL,cAArBh2C,EAAK+/C,YACPjvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAE7C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,gBAIhDwM,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACHixC,IACA,MACF,KAAK,IACHruC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAQ1B,SAASy6B,EAAM3M,GACb,MAAMkH,EAAOwE,EAAU,GAAGa,aAAaK,UAEnC5M,GAA6B,KAAnBA,EAAOH,SAAkBG,EAAO6M,UAK1C7M,GAA6B,KAAnBA,EAAOH,SAKR,KAATqH,GAKJkF,EACEhC,GAAAA,CACE,CACElD,KAAMA,GAERjsC,EAAW4nC,UAqCjB,SAASqD,IAAc,QACjBjrC,MAAAA,GAAJ,UAAIA,EAAY4nC,eAAhB,iBAAI,EAAqB4B,mBAAzB,OAAI,EAAkCp0C,IACpC4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,GACtCy8C,cAAc,EACdz8C,GAAIw7C,QAAiB1yC,IAEtB6sC,SAASj2C,MAAK,SAAUpD,GAIvB,UAHOy1C,EAAG6G,OAAOxE,YAGb93C,EAAKuC,MAAO,CACd,IAAI69C,GAAQ,EACR1qC,EAAI,EACR,IAAKA,EAAI,EAAG0qC,GAAQ,EAAO1qC,EAAI1V,EAAK25C,KAAKlyC,OAAQiO,IAAK,CACpD,MAAMrI,EAAIgzC,GAAAA,CAAM/xC,EAAWgyC,SAAU,CACnC58C,GAAI1D,EAAK25C,KAAKjkC,GAAGhS,KAEd2J,EAGMrN,EAAK25C,KAAKjkC,GAAGywB,OACtB94B,EAAE84B,MAAO,IAHTia,GAAQ,EACR9xC,EAAWgyC,SAASxnD,KAAKkH,EAAK25C,KAAKjkC,KAMN,QAA3B1V,EAAK25C,KAAKjkC,GAAGokC,WAAwB95C,EAAK25C,KAAKjkC,GAAGywB,OAtC3CziC,EAuCK1D,EAAK25C,KAAKjkC,GAAGhS,GAtChC4xC,EAAIqJ,YACRlqC,OAAO,CACN/Q,GAAIA,EACJyiC,MAAM,IAEPkT,SAAS3+B,OAAM,SAAU6K,GACxB1G,QAAQnhB,MAAM6nB,OAoCN66B,GAEFhB,IAGEp/C,EAAK25C,KAAKjkC,EAAI,GAAGywB,OACnB+Y,EAAgBl/C,EAAK25C,KAAKjkC,EAAI,GAAGhS,IAG/Bw7C,IAAkB5wC,EAAW4nC,QAAQyJ,oBACvCtK,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACdyJ,oBAAoB,IACnBv8C,MAAMvG,IACPyR,EAAW4nC,QAAUr5C,KAzDnC,IAAuB6G,KA8DhBgX,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA7V1BkwB,EAAG6G,OAAS,GACZhuC,EAAWgyC,SAAW,GACtB7K,EAAG8K,aAAe,CAChBC,gBAAgB,EAChBC,YAAY,EACZC,OAAO,EACP9/C,MAAM,EACN+/C,WAAY,UAGdlL,EAAGmL,cAAgB,CACjBC,uBAAuB,GA6XzBpL,EAAG/vC,QArCH,WACEmZ,QAAQo3B,MAAM,mCAAoC3nC,EAAW4nC,SAC7D5nC,EAAW6nC,OAAS,OACpB7nC,EAAWwuC,SAAU,EACrBxuC,EAAW+nC,SAASyK,UAAW,EAE/BrL,EAAGsL,aAAe,GAGhBzyC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYqB,OAG/BgG,KAGAW,IAGAd,EAAsBH,EAAUtF,EAAa,KAC7C0F,EAAyBJ,EAAUiB,EAAgB,MAGrDf,EAAYiC,EAAE,iBAAiBpB,aAAa,CAC1CqB,YAAa3yC,EAAW+nC,SAAS6K,oBAAsB,iBACvDxoD,OAAQ,CACNyoD,MAAO,SAAUC,EAAQ/N,GACvB2M,EAAM3M,IAERgO,MAAO,WACLhpD,KAAKipD,gBAQb7L,EAAGuK,MAAQA,EACXvK,EAAG8L,aAzIH,WACE,MAAMhH,EAAOwE,EAAU,GAAGa,aAAaK,UAG1B,KAAT1F,IAKJkF,EACEhC,GAAAA,CACE,CACElD,KAAMA,GAERjsC,EAAW4nC,UAIf6I,EAAU,GAAGa,aAAa0B,aAwH5B7L,EAAGx4C,UAjSH,SAAmB+C,GACjB,GAAIA,EAAKie,KA9GSujC,SAgHhB,YADAhC,IAIF,MAAMiC,EAAK,IAAIC,SAEfD,EAAG/uB,OAAO,OAAQ1yB,EAAK7B,MAEvBuK,EACGopC,KACCxjC,EAAW+nC,SAAS8H,OAClB,0BACA7vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,4BACA4K,EAAW+nC,SAASz8B,MACtB6nC,EACA,CACEjD,iBAAkBtmD,QAAQ6c,SAC1B/K,QAAS,CACP,oBAAgBwC,KAIrBpJ,MAAK,SAAUpD,IACdA,EAAOA,EAAKA,MAEH0D,IACP+xC,EAAG6G,OAAS,GAEZmD,EACEhC,GAAAA,CACE,CACElD,KACE,YACAjsC,EAAW+nC,SAAS8H,OACpB,0BACA7vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,iCACA1D,EAAK0D,GACL,UACA4K,EAAW+nC,SAASz8B,MACpB,qBACA5Z,EAAKnC,KACL,OACF8jD,aAAc3hD,EAAK0D,IAErB4K,EAAW4nC,WAIf1X,EAAY,oBAEbA,EAAY,oBA4OnBiX,EAAG+J,gBAAkBA,EAGrBlmD,EAAOsB,IAAI,YA5OX,WACEikD,EAAUriD,OAAOwiD,GACjBH,EAAUriD,OAAOyiD,GAEjBD,EAAsB,KACtBC,EAAyB,QAwO3B3wC,EAAW1T,IAAI,aArOf,SAAoBoF,EAAMnH,GACpBA,GACFA,EAAS+oD,GAAAA,CAAQtzC,EAAWgyC,sWCvMlC,SAASuB,EACPvoD,EACAgV,EACAwzC,EACAxM,EACA+G,EACAt8C,EACA2I,GAEA,MAAM+sC,EAAKp9C,KACX,IAAI0pD,EAAU,KACVC,EAAgB,KACpB1zC,EAAW2zC,UAAY,GAEvB,MAAMC,EAAkB,CACtBC,sBAAsB,EACtBC,mBAAmB,EACnB3+B,QAAS,SAAU5mB,GACjB,MAAqB,kBAAVA,GACDA,EAAQ,IAAM,IAEjBA,IA6GX,SAASwlD,WACA5M,EAAG6G,OAAOkB,OACjBlvC,EAAWzJ,MAAM,QAGjB4wC,EAAG6M,OAASC,GAAAA,CAAWP,GAEvBvM,EAAGuH,KAAO,GACVvH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ,MAAMd,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GA7HhB9G,EAAG+M,YAAc,SAAU5kD,GACzB,OAAOkkD,EAAKU,YAAY5kD,IA+Q1B63C,EAAGgN,iBArDH,SAA0BhO,GAExB,MAAMiO,EAAWjN,EAAG6M,OAAO7N,GACrBkO,EAAa5iD,EAASoZ,KAAK,gBACjC,GAAIwpC,EAAWl7C,OAAQ,CACrB,MAAMm7C,EAAS1qD,QAAQkD,QACrBunD,EAAW,GAAG/J,cAAc,mBAExB3tC,EAAQ/S,QAAQkD,QACpBunD,EAAW,GAAG/J,cAAc,qBAExBiK,EAAQD,EAAOzpC,KAAK,SAEtB0pC,EAAMp7C,QACRo7C,EAAMC,IAAI,UAAW,QAGvBF,EAAOjqD,GAAG,SAAS,KACjBkqD,EAAMC,IAAI,UAAW,QACI,mBAAlB73C,EAAM83C,QACT93C,EAAM83C,QAAQ,SACd93C,EAAM,GAAG+3C,WAGf/3C,EAAMtS,GAAG,UAAWgiB,IAClBrhB,EAAOgD,QAAO,WACwB,iBAAzBomD,EAASO,MAAMvlD,QACxBglD,EAASO,MAAMvlD,MAAQ,MAKzB,MAAMmB,EAAQ5E,MAAMstB,KAAK5M,EAAEjc,OAAOG,OAE5BqkD,EAjSL,QAiSiBR,EAAS9+C,OAAOqa,KACdpf,EAAMskD,MAAMhlD,GAASA,EAAK8f,MAAQilC,KAKpDR,EAASlqD,QAAU,GACnBkqD,EAASO,MAAMvlD,MAAQglD,EAAS9+C,OAAOw/C,gBAEvCV,EAASlqD,QAAUqG,EAAMmI,KAAK7I,IAC5B,MAAM,KAAEN,EAAF,KAAQogB,EAAR,KAAc1W,GAASpJ,EAC7B,MAAO,CAAEN,KAAAA,EAAMogB,KAAAA,EAAM1W,KAAAA,EAAMpJ,KAAAA,MAG/Bs3C,EAAGuH,KAAK0F,EAASO,MAAMzX,OAASkX,EAASlqD,gBAkBjDi9C,EAAG4N,eANH,SAAwBX,EAAUjO,GAGhCiO,EAASlqD,QAAQqf,OAAO48B,EAAO,GAC/BgB,EAAGuH,KAAK0F,EAASO,MAAMzX,OAASkX,EAASlqD,SAuB3Ci9C,EAAG6N,eAfH,SAAwBZ,GACtB7jC,QAAQN,IAAI,kBAAmBmkC,GAC/B,MAAMC,EAAa5iD,EAASoZ,KAAK,gBAC3BlO,EAAQ/S,QAAQkD,QACpBunD,EAAW,GAAG/J,cAAc,sBAExB,eAAE2K,EAAF,OAAkBrqC,GAAWwpC,EAAS9+C,OACxC2/C,GACFt4C,EAAME,KAAK,WAAY,YAErB+N,GACFjO,EAAM,GAAGu4C,aAAa,SAAUtqC,IAapCu8B,EAAGgO,uBAPH,WACE,MAAMC,EAAWzpD,MAAMstB,KAAKxnB,EAASoZ,KAAK,oBACpCwqC,EAAUD,EAASA,EAASj8C,OAAS,GACvCk8C,GAAWA,EAAQpuC,gBACrBouC,EAAQpuC,kBAMZkgC,EAAG/vC,QAjTH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpBV,EAAGS,QAAU,CACXxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBkgD,cAAe,YACfr8B,KAhBK,YAAcs8B,GAAAA,CAAQ,EAAG,MAmBhCv1C,EAAW+nC,SAASyK,UAAW,EAC/BxyC,EAAWwuC,SAAU,EAErBxH,EAAI8I,YACDE,UAAU,CACT56C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACPw/C,EAAU/hD,EAAK+hD,QACfC,EAAgBO,GAAAA,CAAWviD,EAAK25C,MAChClE,EAAG6M,OAASC,GAAAA,CAAWP,OAG1B5+C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GAExB,GADApH,EAAW2zC,WAAa6B,EAAMv8C,UACH,IAAhBu8C,EAAMb,OACXa,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAASxiD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAGwO,UAAUvuC,GAAKsuC,EAAOF,EAAMb,MAAMc,eAK5CrpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OA2QpBkwB,EAAG+H,OA5LH,WAEElvC,EAAWwuC,SAAU,EAErB,MAAM98C,EAAO,IAAKy1C,EAAGuH,MAErB,IAAK,IAAItnC,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GACpBouC,EAAMb,YAA4C,IAA5BjjD,EAAK8jD,EAAMb,MAAMzX,SAEpC8P,GAAAA,CAAOwI,EAAMI,WAChBzO,EAAGS,QAAQ4N,EAAMI,SAAWjqD,MAAMoQ,QAAQrK,EAAK8jD,EAAMb,MAAMzX,QACvDxrC,EAAK8jD,EAAMb,MAAMzX,OAAOlgC,OACxBtL,EAAK8jD,EAAMb,MAAMzX,QAGnB91B,IAAMqsC,IACHzG,GAAAA,CAAOhtC,EAAW+nC,SAASuN,iBAC9BnO,EAAGS,QAAQ0N,cAAgBt1C,EAAW+nC,SAASuN,cAC/CnO,EAAGS,QAAQ3uB,KAAOttB,MAAMoQ,QAAQrK,EAAK8jD,EAAMb,MAAMzX,QAC7CxrC,EAAK8jD,EAAMb,MAAMzX,OAAOlgC,OACxBtL,EAAK8jD,EAAMb,MAAMzX,SAIN,WAAfsY,EAAMv8C,OACRvH,EAAK8jD,EAAMb,MAAMzX,OAASxrC,EAAK8jD,EAAMb,MAAMzX,OAAOxkC,KAC/C+U,GAASA,EAAK5d,SAMvB,MAAMgmD,EAAelqD,MAAMoQ,QAAQorC,EAAG6M,QAClC7M,EAAG6M,OAAO3gD,QAAQmiD,GAAyB,WAAfA,EAAMv8C,OAClC,GAEE68C,EAAU3G,GAAAA,CACd,CACElD,KAAMv6C,GAERy1C,EAAGS,SAGCmO,EAA4B,MAARrkD,GAAgBmkD,EAAa18C,OAAS,EAC1D68C,EAAyB,OAATtkD,GAA0C,OAAzBqW,KAAKE,UAAUvW,GAnFxD,IAAgBukD,EApCK1mD,GAwHGwmD,GApFRE,EAqFHH,EApFJ17C,EAAM,CACXoB,IAAM,GAAEwrC,EAAI4I,wBAAwBqG,EAAQ7gD,aAC5CsG,QAAS,CAAE,oBAAgBwC,GAC3BxM,KAAMwkD,GAAAA,CAAeD,EAAS,IACzBrC,EACHuC,gBAAiB,IAAI/C,WAEvBrD,OAAQ,UA8ENiG,EACAhP,EAAI8I,YAAYvD,QAAQuJ,GAAS/K,SACjC5M,QAAQC,OAAO,iBAGhBtpC,KAAKi/C,GACL3nC,OAhIgB7c,EAgIE,SAjHZ,SAAU0nB,GACf,MAAMg3B,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GAEd9G,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,QAsGvB69C,SAAQ,KACFpI,EAAGuH,KAAKtgB,UACX+Y,EAAGuH,KAAO,IAlLhB1uC,EAAWwuC,SAAU,MAsTvBrH,EAAGC,OA9HH,SAAgB73C,EAAM2a,GACfi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGuH,KAAKn/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGuH,KAAKn/C,GAAM/E,KAAK0f,IAsHvBi9B,EAAGhd,OAlHH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGX43C,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,IAAS,GA8GxCi9B,EAAGwO,UAAY,GAEfxO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GCnWhB,SAASuH,EACPp2C,EACAwC,EACAgxC,EACAxM,EACAD,EACAG,GAEA,MAAMC,EAAKp9C,KACX,IAAI0pD,EAAU,KAmJd,SAAS4C,IASP,OARAr2C,EAAW4nC,QAAU,CACnBxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBkhD,OAAQ,YACRr9B,KAhCK,YAAcs8B,GAAAA,CAAQ,EAAG,MAmChCv1C,EAAW+nC,SAASyK,UAAW,EAExBzL,EAAqBO,cAC1BJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACdy4C,EAAI8I,YACRE,UAAU,CACT56C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACPw/C,EAAU/hD,EAAK+hD,QACftM,EAAG6M,OAAStiD,EAAK25C,SAGpBv2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GACxB,GAAIouC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAASxiD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAGwO,UAAUvuC,GAAKsuC,EAAOF,EAAMb,MAAMc,eAI1CrpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,SAGnB7K,MAAM26B,EAAqBW,gBAzLhCP,EAAGwO,UAAY,GAGfxO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GACd1H,EAAGoP,aAAc,EAEjBpP,EAAG+M,YAAc,SAAU5kD,GACzB,OAAOkkD,EAAKU,YAAY5kD,IAmO1B63C,EAAG/vC,QAhDH,WAKE,GAJAmZ,QAAQo3B,MAAM,qCAAsC3nC,EAAW4nC,SAE/D5nC,EAAW6nC,OAAS,SAEhB7nC,EAAW4nC,SAAW5nC,EAAW4nC,QAAQ4B,YAC3C,GAAIxpC,EAAW4nC,QAAQ4B,YAAYp0C,GACjC,IAA8C,IAA1C4K,EAAW4nC,QAAQyJ,mBAErB7uC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,gBAEP,SACL,MAAM42C,EAAoBx2C,EAAW4nC,QAAQ4B,YAAYp0C,GACnDqhD,EAAYz2C,MAAAA,GAAH,UAAGA,EAAY4nC,eAAf,iBAAG,EAAqB/Z,eAAxB,aAAG,EAA8Bz4B,GAChD,GAAIqhD,EAAW,CACb,MAAM/kD,EAAO,CACX0D,GAAIohD,EACJE,QAAS,OACTlN,YAAa,CACXp0C,GAAIohD,GAEN3oB,QAAS,CACPz4B,GAAIqhD,GAENhF,YAAa,YACb5G,QAAQ,EACRC,YAAa,WAIf9D,EAAI2D,gBAAgByF,QAAQ1+C,GAAMq5C,SAASwE,SAAQ,IAC1C8G,YAMb7zC,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,iBAIdy2C,KAMJlP,EAAG+H,OA5KH,WACE,IAAIjD,EAAO,sBAEX,IAAK,IAAI7kC,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GAEpBouC,EAAMb,YAA+C,IAA/BxN,EAAGuH,KAAK8G,EAAMb,MAAMzX,SAEvC8P,GAAAA,CAAOwI,EAAMmB,YAChB32C,EAAW4nC,QAAQ4N,EAAMmB,UAAYhrD,MAAMoQ,QACzCorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAElBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAGrB8P,GAAAA,CAAOwI,EAAMI,WAChB51C,EAAW4nC,QAAQ4N,EAAMI,SAAWjqD,MAAMoQ,QACxCorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAElBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAGtB91B,IAAMqsC,IACHzG,GAAAA,CAAOhtC,EAAW+nC,SAASuO,UAC9Bt2C,EAAW4nC,QAAQ0O,OAASt2C,EAAW+nC,SAASuO,OAChDt2C,EAAW4nC,QAAQ3uB,KAAOttB,MAAMoQ,QAAQorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QACxDiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,SAIxBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,SACtB+O,GAAQuJ,EAAMb,MAAMzX,MAAQ,KAAOiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAS,OAvExE,IAAqBrP,EAAAA,EA8EjBshB,GAAAA,CACE,CACElD,KAAMA,EACN2K,QAAS52C,EAAW+nC,SAAS6O,QAC7BC,WAAY72C,EAAW+nC,SAAS8O,YAElC72C,EAAW4nC,SAnFfT,EAAGoP,aAAc,EAEjBvP,EAAI8I,YACD9c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG6G,OAAO8I,iBAEjB92C,EAAW4nC,QAAQ/Z,QAAU,CAC3Bz4B,GAAI1D,EAAKm8B,QAAQz4B,IAGnB4K,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAIvB2xC,EAAqBO,cAAcJ,EAAiBlnC,EAAW4nC,SAC5D9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAG9BP,EAAGoP,aAAc,EArChBv2C,EAAW+nC,SAASgP,sBAOvBv0C,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,YANZ4C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAuCXwM,OAAM,SAAU6K,GAEfkwB,EAAGoP,aAAc,EAEjBhmC,QAAQnhB,MAAM6nB,OAiLpBkwB,EAAGC,OArHH,SAAgB73C,EAAM2a,GACfi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGuH,KAAKn/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGuH,KAAKn/C,GAAM/E,KAAK0f,IA6GvBi9B,EAAGhd,OAzGH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGX43C,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,IAAS,GCxJ1C,SAAS8sC,EACPh3C,EACAwC,EACAurC,EACA/G,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAQX,SAAS0kD,IACHzuC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ/uC,EAAW4nC,QAAU,GAErB5nC,EAAWgvC,gBAAiB,EAC5BhvC,EAAWzJ,MAAM,QAQnB,SAAS25B,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMu8C,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,IAIlB,SAASM,IACPvuC,EAAWwuC,SAAU,EAjDvBrH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GAoGZ7G,EAAG/vC,QAhBH,WACEmZ,QAAQo3B,MAAM,wCAAyC3nC,EAAW4nC,SAClE5nC,EAAW6nC,OAAS,YAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWwuC,SAAU,KAKtCrH,EAAG+H,OAlDH,WACElvC,EAAWwuC,SAAU,EAEjBxuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDC,aAAa,CACZx1C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnC6hD,KAAM9P,EAAGuH,KAAKuI,OAEflM,SAASj2C,MAAK,kBACNqyC,EAAG6G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,MAEfn5C,KAAK0wC,GACL1wC,KAAK25C,GACLriC,MAAM8jB,EAAY,WAClBqf,QAAQhB,IAEXA,IACAre,EAAY,YAsBhBiX,EAAGqI,KA7EH,WACEhK,IACAiJ,KCxCJ,SAASyI,EACPl3C,EACAhV,EACAulD,EACA/tC,EACAwkC,EACAD,EACAG,GAGA,IAAIiQ,EAA+B,KAGnC,SAAS3F,IACP,IAAIhI,EAAc,GACd4N,GAAO,EAEXpQ,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,GAGvB,OAFA83C,EAAc93C,EAEPs1C,EAAI2D,gBAAgBM,YAAY,CACrCC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,KACrC21C,YAEJj2C,MAAK,SAAUpD,GACd0lD,EAAO1lD,EAAK25C,KAAKlyC,OAAS,EAEtBqwC,EAAYqB,QACd7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACW,cAA5Bi7C,EAAYiI,aACdjvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,eAGhDwM,MAAM26B,EAAqBW,kBACrB8B,EAAYoC,QAAUwL,KAE3B5N,EAAYoC,SACd5rC,EAAW4nC,QAAQ4B,YAAYoC,OAASpC,EAAYoC,QAEtD7E,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACdyJ,oBAAoB,IAEnBv8C,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACrBiU,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,eAEzCwM,MAAM26B,EAAqBW,oBAKjCt7B,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA9DbltB,KAqFRqN,QAdH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGlB7nC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,KAG/B+hD,EAA+B5G,EAAUiB,EAAgB,OAQ7DxmD,EAAOsB,IAAI,YAtBX,WACEikD,EAAUriD,OAAOipD,iqBCzFrB,MAAMpQ,EAOJ54B,YAAYxO,EAASK,EAAYlP,GAAI,oBACnC/G,KAAKstD,cAAgB,IAAIC,IAAIt3C,EAAW+nC,SAASwP,SAASC,OAC1DztD,KAAK6V,SAAWI,EAAW+nC,SAASnoC,SACpC7V,KAAK+G,GAAKA,EACV/G,KAAK4V,QAAUA,EA4CjB83C,QAAQ7nD,EAAKrB,GACX,MAAMmpD,EAAS,UACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAClB,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,EAAKrB,MAAAA,GACfxE,KAAKstD,kBASXjO,QAAQx5C,GACN,MAAM8nD,EAAS,UACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,CAAC2X,EAAG2C,KACvCxT,EAAQwT,MAEVngB,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,GAAO7F,KAAKstD,kBAQ1DpI,WAAWr/C,GACT,MAAM8nD,EAAS,aACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,GAAO7F,KAAKstD,kBAuB1D/P,cAAc13C,EAAK8B,GAAsB,IAAhBkF,EAAgB,wDAEvC,OAAO7M,KAAKq/C,QAAQx5C,GAAKkF,MAAMoV,IAC7B,MAAMytC,EAAU,EAAA5tD,KAAA,UAAAA,KAAgBmgB,IAAS,GAMzC,OALItT,SACK+gD,EAAQ5tD,KAAK6V,UAEpB+3C,EAAQ5tD,KAAK6V,UAAYlO,EAEpB3H,KAAK0tD,QAAQ7nD,EAAK+nD,GAAS7iD,MAAK,IAAM6iD,EAAQ5tD,KAAK6V,eAQ9D8nC,eAAezwB,GACb1G,QAAQnhB,MAAM,gBAAiB6nB,eAnHdygC,EAAQ9nD,EAAKrF,GAE9B,MAAM29B,EAAY7b,IAChB,MAAMurC,EAAkB,GAAEF,UAC1B,GACErrC,EAAEmrC,SAAWztD,KAAKstD,eAClBznD,IAAQyc,EAAE3a,KAAK9B,KACfgoD,IAAmBvrC,EAAE3a,KAAKgmD,OAC1B,CACA,MAAM,OAAEA,EAAF,KAAUxtC,GAASmC,EAAE3a,KAE3B,OADA6e,QAAQo3B,MAAO,UAAS/3C,cAAgB8nD,uBAA6BrrC,GAC7DqrC,GACN,IAAK,gBACHntD,EAASqF,GACT,MACF,IAAK,gBACHrF,EAASqF,EAAKsa,GACd,MACF,IAAK,mBACH3f,EAASqF,GACT,MACF,QACE2gB,QAAQo3B,MAAM,qBAAsB+P,GAIxC3tD,KAAK4V,QAAQk4C,oBAAoB,UAAW3vB,GAAU,KAG1Dn+B,KAAK4V,QAAQgtC,iBAAiB,UAAWzkB,GAAU,cAiD1C4vB,GACT,IAAI/zB,EAAS+zB,EACb,GAAsB,iBAAX/zB,EACT,IACEA,EAAShc,KAAK/W,MAAM8mD,GACpB,MAAO1oD,GACPmhB,QAAQwnC,KAAM,oBAAmBD,KAAe1oD,GAChD20B,EAAS+zB,EAGb,OAAO/zB,EC3EX,SAASi0B,EAAgBxE,GACvB,OAAO,SAAUjlD,GACf,OAAOilD,EAAKU,YAAY3lD,+DAqI5B3E,QACGC,OAFiB,cAEG,CACnB,YACA,SACA,aACA,aACA,aACA,aACA,QACA,UACA,YACA,qBACA,WACA,SAEDwJ,OAAO,YAAa2kD,GACpBC,SAAS,iBAAkB,eAC3BA,SAAS,kBAAmB,WAC5BA,SAAS,iBAAkB,UAC3Bz2C,QAAQ,uBAAwBulC,GAChCn6C,UAAU,WAnCb,WACE,OAAO,SAAUC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,oBAAoB,SAAU/C,GACrB,KAAhBA,EAAMu6C,QACRh4C,EAAMmB,QAAO,WACXnB,EAAMzB,MAAM2B,EAAMmrD,YAEpB5tD,EAAMgD,yBA6BXV,UAAU,WArJb,WA0GE,MAAO,CACL0F,KAVF,SAAczF,EAAOC,GACnBA,EAAQzC,GAAG,SAAS,WACE+lB,SAAS+nC,eAAe,iBAlGhD,SAAsBltC,EAAMpe,GAE1B,MAAMurD,EAAMhoC,SAAS45B,cAAc,OAC7BpC,EAAU/6C,EAAM+6C,QAChBG,EAAWl7C,EAAMk7C,SACvB,IAAIsQ,EAEJ,IAAK,IAAIjxC,EAAI,EAAGA,EAAIva,EAAMmlD,SAAS74C,OAAQiO,IAAK,CAC9C,MAAMymB,EAAUhhC,EAAMmlD,SAAS5qC,GAC/B,IAAImkC,EAAS,WACb,MAAMU,EAAO,YAAcpe,EAAQoe,KAC7BqM,EACJ,YAAcnM,GAAAA,CAAOte,EAAQqe,WAAWv6B,OAAO,uBAEjD,GAAU,IAANvK,EAAJ,CAKA,OAAQva,EAAMk7C,SAAS4D,iBACrB,IAAK,gBACHJ,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN7D,EAAS8D,WAAahe,EAAQ+d,OAC9B,SACF7D,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,IAAK,cACHH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN/d,EAAQie,KAAKC,OAASle,EAAQie,KAAKE,SACnC,SACFjE,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,IAAK,iBACHH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN/d,EAAQie,KAAKE,SACb,SACFjE,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,QACEH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,QACL7D,EAAS8D,YAAc,SAAWhe,EAAQ+d,OAC3C,SACF7D,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAG9B0M,EAAInO,YAAY75B,SAASmoC,eAAehN,IACxC6M,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAASmoC,eAAetM,IACxCmM,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAASmoC,eAAeD,IACxCF,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAAS45B,cAAc,YAvDrCqO,EAAYxqB,EAAQqe,UA0DxB,MAAMsM,EAAWloC,OAAO8mC,OAExBoB,EAASpoC,SAASqoC,MAAM,sBAAwBroC,SAAS8sB,MAAQ,YACjEsb,EAASpoC,SAASqoC,MAAM,kBACxBD,EAASpoC,SAASqoC,MAAM,iBAAmB1Q,EAAS6O,QAAU,SAC9D4B,EAASpoC,SAASqoC,MAChB,oBACEtM,GAAAA,CAAOkM,GAAW1mC,OAAO,uBACzB,SAEJ6mC,EAASpoC,SAASqoC,MAChB,oBAAsBtM,GAAAA,GAASx6B,OAAO,uBAAyB,SAEjE6mC,EAASpoC,SAASqoC,MAAML,EAAIM,WAC5BF,EAASpoC,SAASqoC,MAAM,kBAExBD,EAASpoC,SAASg6B,QAClBoO,EAASG,QAETH,EAASI,QACTJ,EAASpO,QAOLyO,CAAaC,EAAajsD,OAO9BqE,SAAU,QA2CXnG,WAAW,iBAAkBulD,GAE7BvlD,WAAW,oBAAqB+iD,GAEhCx4C,OA3BH,sBA2BU,SAAUyjD,GAChBA,EAAmBC,qBAEpBjuD,WAAW,kBAAmB87C,GAE9B58C,QAAQ,MAAOwlD,GAEfn6C,OAAO23C,GACP3qC,IAAIsqC,GAEJ7hD,WAAW,oBAAqBwoD,GAEhCj+C,OAvCH,sBAuCU,SAAUyjD,GAChBA,EAAmBC,qBAEpBjuD,WAAW,mBAAoBqrD,GAE/BrrD,WAAW,sBAAuBisD,GAElCjsD,WAAW,oBAAqBmsD,wFCjNnCrtD,EAAOovD,QAAU,WACf,GAA0B,iBAAfC,WACT,OAAOA,WAGT,IAAItxC,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,EAAKuuC,eAWjB,WAWJ,SAASn6C,EAAQhO,GAEb,MAAmC,mBAA5B,GAAK8Q,SAAS/S,KAAKiC,GAG9B,SAASorD,EAAaprD,GAElB,QAAQgO,EAAQhO,IAAuB,iBAARA,IAAsBA,GAASA,aAAeqrD,MAAWrrD,aAAeuuB,MAQ3G,SAAS+8B,IAEL,MAA2B,mBAAbjG,SAGlB,SAASkG,IAEL,GAAID,IACA,OAAO,IAAIjG,SAkCnB,SAASmG,EAAmBC,EAAYtvD,EAASuvD,EAAUC,GAEvD,IAAIvT,EAAQ,EAEZ,IAAK,IAAIv2C,KAAO4pD,EAAY,CAExB,GAAIA,EAAW/sD,eAAemD,GAAM,CAEhC,IAAI+pD,EAAWD,GAAa9pD,EACxBrB,EAAQrE,EAAQirB,QAAQqkC,EAAW5pD,IAevC,GAbI8pD,GAAaP,EAAaK,KAC1BG,EAAWD,EAAY,IAAM9pD,EAAM,KAGnC8pD,GAAa39C,EAAQy9C,KAGjBG,EADA59C,EAAQxN,IAAUrE,EAAQ2pD,qBACf6F,EAAY,IAAMvT,EAAQ,IAE1BuT,EAAY,MAI3B39C,EAAQxN,IAAU4qD,EAAa5qD,GAE/BgrD,EAAmBhrD,EAAOrE,EAASuvD,EAAUE,QAE1C,GAAIprD,aAAiBqrD,SAExB,IAAK,IAAInyC,EAAI,EAAGA,EAAIlZ,EAAM4K,OAAQsO,IAC9BgyC,EAASr1B,OAAOu1B,EAAW,IAAMlyC,EAAI,IAAKlZ,EAAM2b,KAAKzC,SAElDlZ,aAAiB6qD,KAExBK,EAASr1B,OAAOu1B,EAAUprD,EAAOA,EAAMgB,MAEhChB,aAAiB+tB,KAExBm9B,EAASr1B,OAAOu1B,EAAUprD,EAAMsrD,gBAEb,OAAVtrD,GAAkBrE,EAAQ4pD,mBAAgC,OAAVvlD,SAA6B2P,IAAV3P,GAE5EkrD,EAASr1B,OAAOu1B,EAAUprD,GAGlC43C,IAEJ,OAAOsT,EAEX,OAhFA,SAAiBD,EAAYtvD,GAEzB,GAAIA,GAAWA,EAAQisD,iBAEnB,GAnB8B,mBAmBDjsD,EAAQisD,gBAnBlB/xB,OAqBf,KAAM,qDAEP,IAAKi1B,IAER,KAAM,8FA3Bd,IA0CQS,EA5DG,CAgDc,CACjB3D,gBAAiBmD,IACjBzF,sBAAsB,EACtBC,mBAAmB,EACnB3+B,QAAS,SAAS5mB,GACd,MAAqB,kBAAVA,GACCA,EAAQ,IAAK,IAElBA,IAIkCrE,GAAW,IA5DlCyO,QAAO,SAAUohD,EAAOC,GAI9C,OAHA18C,OAAOC,KAAKy8C,GAAelvD,SAAQ,SAAUmvD,GACzCF,EAAME,GAAaD,EAAcC,MAE9BF,IACR,IAyDH,OAAOR,EAAmBC,EAAYM,EAAeA,EAAc3D,kBA5EjClsD,IACjC,QAFM,OAEN,oECDD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8FAA8FttC,MAClG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C2tC,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExB+9C,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,YACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,SACHi5B,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,KArEyB5yD,CAAQ,EAAQ,8FCOlD,SAAWkiD,GAAU,aAIzB,IAAI2Q,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,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,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,OACA,SACA,MACA,SACA,SACA,SACA,UAGGhO,EAAO+N,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,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,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBQ,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtJyB5yD,CAAQ,EAAQ,8FCDlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,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,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MApDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPX,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,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,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGGhO,EAAO+N,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,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,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzKyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,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,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGFxR,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,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,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,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,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,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,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGChO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,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,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzLyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIyR,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,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+EAA+EttC,MACnF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,qEAAqExtC,MAC3E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,WACN30C,EAAG,kBACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,SACHC,GAAI,SAER/B,cAAe,0BACfC,KAAM,SAAU99C,GACZ,MAAO,mBAAmBuQ,KAAKvQ,IAEnC+9C,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,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GASnD,MAAY,MAARA,EACOstD,EAAgB,UAAY,UACpB,MAARttD,EACAstD,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,kBAOgC3sD,GArBvBid,MAAM,KAChBixC,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,EAyBC5R,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,uGAAuG9E,MAC3G,KAEJmxC,WAAY,qGAAqGnxC,MAC7G,MAGRutC,YAAa,0DAA0DvtC,MACnE,KAEJwtC,SAAU,CACN1oC,OAAQ,0DAA0D9E,MAC9D,KAEJmxC,WAAY,0DAA0DnxC,MAClE,KAEJoxC,SAAU,+CAEd3D,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,OAAQ3xD,KAAKm0D,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,UACN30C,EAAG,kBACHpI,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG4B,EACH3B,GAAI2B,EACJ36B,EAAG,QACHi5B,GAAI0B,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,yBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,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,KAzIyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,OAAQ3xD,KAAKm0D,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,WACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,SACHi9C,GAAI,YACJC,EAAG,MACHC,GAAI,UACJh5B,EAAG,MACHi5B,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,KArFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IttC,MAClJ,KAEJutC,YAAa,iDAAiDvtC,MAAM,KACpEwtC,SAAU,+CAA+CxtC,MAAM,KAC/DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,aACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,aACHC,GAAI,UACJC,EAAG,YACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGFxR,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,uCAAuCztC,MAAM,KAC5D0tC,YAAa,kCAAkC1tC,MAAM,KACrDiuC,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,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAIzBy0C,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,KA9HyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,uCAAuCztC,MAAM,KAC5D0tC,YAAa,kCAAkC1tC,MAAM,KACrDiuC,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,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,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,KApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qJAAqJttC,MACzJ,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ4xC,iBAAkB,gBAClBC,kBAAkB,EAClBrE,SAAU,gFAAgFxtC,MACtF,KAEJytC,cAAe,oDAAoDztC,MAC/D,KAEJ0tC,YAAa,6BAA6B1tC,MAAM,KAChDiuC,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,WACN30C,EAAG,QACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,WACJC,EAAG,cACHC,GAAI,YACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,YACHC,GAAI,UACJC,EAAG,UACHC,GAAI,SAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,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,KAxHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASwS,EAAyBjC,EAAQQ,EAAettD,GAMrD,OAAO8sD,EAAS,IAoBpB,SAAkB/vC,EAAM+vC,GACpB,OAAe,IAAXA,EAKR,SAAsB/vC,GAClB,IAAIiyC,EAAgB,CAChB7/C,EAAG,IACH4J,EAAG,IACHua,EAAG,KAEP,YAAsChlB,IAAlC0gD,EAAcjyC,EAAKnd,OAAO,IACnBmd,EAEJiyC,EAAcjyC,EAAKnd,OAAO,IAAMmd,EAAKqX,UAAU,GAb3C66B,CAAalyC,GAEjBA,EAxBemyC,CALT,CACT9C,GAAI,WACJK,GAAI,MACJF,GAAI,UAE8BvsD,GAAM8sD,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,QAGC/S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFttC,MACpF,KAEJutC,YAAa,mDAAmDvtC,MAAM,KACtEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CsyC,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,SACN30C,EAAG,wBACH40C,GAAI,YACJh9C,EAAG,cACHi9C,GAAI2C,EACJ1C,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,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,SAAUnvC,GACZ,MAAiB,SAAVA,GAEXovC,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAOyC,EAAO,GAAK,OAAS,UAnKErzD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXqsD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIrsD,GADW,IAAXqsD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,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,OAAQ3xD,KAAKm0D,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,WACN30C,EAAG,cACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,MACHi5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAlJyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJ6D,WAAY,oFAAoFnxC,MAC5F,KAEJ8E,OAAQ,qHAAqH9E,MACzH,KAEJoxC,SAAU,mBAEd7D,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,IAAjBvxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9DY,QAAS,WACL,MAAO,YAA+B,IAAjBxxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9Da,SAAU,WACN,MAAO,YAA+B,IAAjBzxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9Dc,QAAS,WACL,MAAO,YAA+B,IAAjB1xD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9De,SAAU,WACN,MACI,wBACkB,IAAjB3xD,KAAK4wD,QAAgB,MAAQ,MAC9B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN30C,EAAG,aACH40C,GAAI,YACJh9C,EAAG,WACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,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/FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,oFAAoFttC,MACzF,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,yBACA,4BACA,QACA,QACA,QACA,QACA,SAIJC,EAAc,wJAElB,SAASc,EAAOz1C,GACZ,OAAOA,EAAI,GAAKA,EAAI,GAAoB,MAAZA,EAAI,IAEpC,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAEvCrsD,EAAS,YAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,MAAQ,OAEnCrsD,EAAS,MAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,QAAU,UACjD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,UAEtCrsD,EAAS,SAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,OAAS,OAEpCrsD,EAAS,QAKvB87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACb6E,YAAaA,EACbR,iBAAkBQ,EAGlBK,kBAAmB,uKACnBC,uBAAwB,sDACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,mDAAmDxtC,MAAM,KACnEytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,yBACN5+B,EAAG,cAEP6+B,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,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,OAAQ3xD,KAAKm0D,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,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gEAAgEttC,MACpE,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,oEAAoExtC,MAC1E,KAEJytC,cAAe,6BAA6BztC,MAAM,KAClD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,UAAUtsD,KAAKssD,GACrB,MACA,QAAQtsD,KAAKssD,GACb,MACA,QAGVhE,KAAM,YACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,cACxBC,QAAS,SACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,qDAAqDvtC,MAC9D,KAEJwtC,SAAU,+EAA+ExtC,MACrF,KAEJytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,UACHi5B,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,KA9FyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,WACN30C,EAAG,cACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,aACJC,EAAG,QACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,8FCMlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,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,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cu8C,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,8FCAlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,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,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cu8C,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,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,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG/Cu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,WACA,aACA,SACA,WACA,KACA,OACA,SACA,WACA,eACA,aACA,aACA,cAEJE,EAAW,CACP,WACA,OACA,WACA,OACA,aACA,SACA,YAGClO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUA,EACVC,cAAeD,EACfE,YAAa,qCAAqC1tC,MAAM,KACxDiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,WACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,QACfC,KAAM,SAAU99C,GACZ,MAAO,OAASA,GAEpB+9C,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,YACN30C,EAAG,iBACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,cACJh5B,EAAG,WACHi5B,GAAI,YACJC,EAAG,SACHC,GAAI,UACJC,EAAG,WACHC,GAAI,aAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAxFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAWhBA,EAAO+N,aAAa,KAAM,CAC/B+F,mBAAoB,qHAAqHpzC,MACrI,KAEJqzC,iBAAkB,qHAAqHrzC,MACnI,KAEJstC,OAAQ,SAAUgG,EAAgBxuC,GAC9B,OAAKwuC,EAGiB,iBAAXxuC,GACP,IAAIzE,KAAKyE,EAAOqS,UAAU,EAAGrS,EAAO1Z,QAAQ,UAGrClO,KAAKq2D,kBAAkBD,EAAeE,SAEtCt2D,KAAKu2D,oBAAoBH,EAAeE,SARxCt2D,KAAKu2D,qBAWpBlG,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C6tC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCJ,KAAM,SAAU99C,GACZ,MAAyC,OAAjCA,EAAQ,IAAIsU,cAAc,IAEtCupC,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,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,gCACX,QACI,MAAO,mCAGnBvC,SAAU,KAEdN,SAAU,SAAUzrD,EAAK4wD,GACrB,IApEY7jD,EAoERmjD,EAAS/1D,KAAK02D,YAAY7wD,GAC1B+qD,EAAQ6F,GAAOA,EAAI7F,QAIvB,OAzEYh+C,EAsEGmjD,GApEM,oBAAbrvC,UAA4B9T,aAAiB8T,UACX,sBAA1CnT,OAAO1R,UAAUiT,SAAS/S,KAAK6Q,MAoE3BmjD,EAASA,EAAO5zD,MAAMs0D,IAEnBV,EAAOhhD,QAAQ,KAAM67C,EAAQ,IAAO,EAAI,MAAQ,SAE3DiB,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,oBACH40C,GAAI,kBACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,WACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,2FCMlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,4BACJC,IAAK,kCACLC,KAAM,2CACNyE,KAAM,uCAEVrF,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3BypC,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,WACN30C,EAAG,kBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA/DyB5yD,CAAQ,EAAQ,8FCDlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,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,mBAzGqB12D,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAET9S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,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,mBAzGqB12D,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,eAAgB,cAAe,iBACnC40C,GAAI,CAACW,EAAS,UAAWA,EAAS,YAClC39C,EAAG,CAAC,aAAc,aAClBi9C,GAAI,CAACU,EAAS,UAAWA,EAAS,YAClCT,EAAG,CAAC,YAAa,YAAa,YAC9BC,GAAI,CAACQ,EAAS,SAAUA,EAAS,UACjCx5B,EAAG,CAAC,YAAa,YACjBk5B,EAAG,CAAC,UAAW,WAAY,WAC3BC,GAAI,CAACK,EAAS,OAAQA,EAAS,SAC/BJ,EAAG,CAAC,YAAa,QAAS,aAC1BC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAIQ,EACOvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAElDutD,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG1Cu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,iEAAiExtC,MACvE,KAEJytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,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,YACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI,WACJC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+FAA+FttC,MACnG,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sEAAsExtC,MAC5E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,gCACLC,KAAM,sCACN5+B,EAAG,WACHmjC,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,WACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,eACHC,GAAI,cACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,qDAAoExtC,MAC1E,KAEJytC,cAAe,qDAAoEztC,MAC/E,KAEJ0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,aAAauQ,KAAKvQ,IAE7B+9C,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,SACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,UAAU,SAAUiH,GACzB,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB09C,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,MA5GyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyU,EAAc,wEAAwE/zC,MAClF,KAEJg0C,EAAgB,CACZ,QACA,QACA,SACA,SACA,SACA,SACA,SACAD,EAAY,GACZA,EAAY,GACZA,EAAY,IAEpB,SAASlB,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAAS,GACb,OAAQT,GACJ,IAAK,IACD,OAAOutD,EAAW,oBAAsB,kBAC5C,IAAK,KACD9sD,EAAS8sD,EAAW,WAAa,WACjC,MACJ,IAAK,IACD,OAAOA,EAAW,WAAa,WACnC,IAAK,KACD9sD,EAAS8sD,EAAW,WAAa,YACjC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,YAAc,WACpC,IAAK,KACD9sD,EAAS8sD,EAAW,YAAc,YAClC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAIvC,OAEJ,SAAsBT,EAAQS,GAC1B,OAAOT,EAAS,GACVS,EACI0D,EAAcnE,GACdkE,EAAYlE,GAChBA,EARGoE,CAAapE,EAAQS,GAAY,IAAM9sD,EAW3C87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2GAA2GttC,MAC/G,KAEJutC,YAAa,uEAAuEvtC,MAChF,KAEJwtC,SAAU,qEAAqExtC,MAC3E,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,mBACJC,IAAK,gCACLC,KAAM,sCACN5+B,EAAG,WACHmjC,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,YACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,4FCIlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,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,mBACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4EAA4ExtC,MAClF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,YACN30C,EAAG,YACH40C,GAAI,cACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,cACHC,GAAI,aACJC,EAAG,UACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,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,SAlEjBzyD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,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,KAvEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAEI8S,EAAc,yKACdD,EAAc,CACV,SACA,SACA,SACA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,SAGC7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJoyC,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA3BoB,2FA4BpBC,uBA3ByB,oFA4BzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,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,KAtGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAGCs/B,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,iGAAiGttC,MACrG,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAOfrC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,SACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,UACHi5B,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,KA3EyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aA4ChBA,EAAO+N,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,YACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,UACHi9C,GAAI,aACJC,EAAG,iBACHC,GAAI,oBACJh5B,EAAG,KACHi5B,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,KA7FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aA4ChBA,EAAO+N,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,gBACN30C,EAAG,gBACH40C,GAAI,YACJh9C,EAAG,UACHi9C,GAAI,gBACJC,EAAG,OACHC,GAAI,aACJh5B,EAAG,QACHi5B,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,KA7FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,mDAAmDxtC,MAAM,KACnEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,UAA6B,IAAjBvxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1DY,QAAS,WACL,MAAO,UAA6B,IAAjBxxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1Da,SAAU,WACN,MAAO,UAA6B,IAAjBzxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1Dc,QAAS,WACL,MAAO,UAA6B,IAAjB1xD,KAAK4wD,QAAgB,IAAM,KAAO,QAEzDe,SAAU,WACN,MACI,qBAAwC,IAAjB3xD,KAAK4wD,QAAgB,KAAO,KAAO,QAGlEgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU9gD,GACd,OAA0B,IAAtBA,EAAI9C,QAAQ,MACL,IAAM8C,EAEV,MAAQA,GAEnB+gD,KAAM,SACN30C,EAAG,eACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxEyB5yD,CAAQ,EAAQ,iGCGlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,cACvB40C,GAAI,CAACW,EAAS,aAAcA,EAAS,UACrC39C,EAAG,CAAC,aAAc,YAClBi9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,WAAY,SAChBC,GAAI,CAACQ,EAAS,UAAWA,EAAS,SAClCx5B,EAAG,CAAC,YAAa,UACjBi5B,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,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCu8C,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,wFAAwFnxC,MAChG,KAEJ8E,OAAQ,mJAAmJ9E,MACvJ,KAEJoxC,SAAU,mBAEd7D,YAAa,4EAA4EvtC,MACrF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,4CAA4CztC,MAAM,KACjE0tC,YAAa,wBAAwB1tC,MAAM,KAC3CwwC,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,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,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,UAzHmBrzD,CAAQ,EAAQ,iGCGlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,qBAAsB,iBAC1B40C,GAAI,CAACW,EAAS,cAAeA,EAAS,WACtC39C,EAAG,CAAC,aAAc,YAClBi9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,YAAa,UACjBC,GAAI,CAACQ,EAAS,WAAYA,EAAS,UACnCx5B,EAAG,CAAC,YAAa,UACjBi5B,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,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCu8C,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,4EAA4EnxC,MACpF,KAEJ8E,OAAQ,wIAAwI9E,MAC5I,KAEJoxC,SAAU,mBAEd7D,YAAa,4DAA4DvtC,MACrE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,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,UAzHmBrzD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,mCAAmCztC,MAAM,KACxD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,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,WACN30C,EAAG,WACH40C,GAAI,WACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,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,KAvHyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0EAA0EttC,MAC9E,KAEJutC,YAAa,4DAA4DvtC,MACrE,KAEJwtC,SAAU,uCAAuCxtC,MAAM,KACvDytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,6BACN5+B,EAAG,WACHmjC,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,UACN30C,EAAG,aACH40C,GAAI,WACJh9C,EAAG,MACHi9C,GAAI,UACJC,EAAG,MACHC,GAAI,SAAUQ,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBx5B,EAAG,MACHi5B,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,SAAU99C,GACZ,MAAO,8BAA8BuQ,KAAKvQ,IAE9C+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,aACAA,EAAO,GACP,QACAA,EAAO,GACPzC,EAAU,SAAW,eACrByC,EAAO,GACPzC,EAAU,QAAU,eAEpB,UAzFmB5wD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,cAiBC7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,8EAA8E9E,MAClF,KAEJmxC,WAAY,0EAA0EnxC,MAClF,MAGRutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,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,UACN30C,EAAG,cACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,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,KAlKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXqsD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIrsD,GADW,IAAXqsD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oGAAoG9E,MACxG,KAEJmxC,WAAY,gGAAgGnxC,MACxG,MAGRutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,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,OAAQ3xD,KAAKm0D,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,WACN30C,EAAG,cACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,MACHi5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxJyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAI8U,EAAc,gEAAgEp0C,MAC9E,KAEJ,SAAS6yC,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAIW,EAAMpB,EACV,OAAQ9sD,GACJ,IAAK,IACD,OAAOutD,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,EAAYl3D,KAAKm0D,OACjB,aAIC/R,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVZ,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3BypC,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,EAAK7wD,KAAK/B,MAAM,IAE3B0xD,QAAS,oBACTC,SAAU,WACN,OAAOiB,EAAK7wD,KAAK/B,MAAM,IAE3B4xD,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,KACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,CACJxoC,OAAQ,4GAA4G9E,MAChH,KAEJmxC,WAAY,gGAAgGnxC,MACxG,MAGRutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,gEAAgExtC,MACtE,KAEJytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,+BAA+B1tC,MAAM,KAClDiuC,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,UACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,OACHi9C,GAAI,UACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,KACHi5B,GAAI,QACJC,EAAG,OACHC,GAAI,UACJC,EAAG,OACHC,GAAI,WAER/B,cAAe,oCACfC,KAAM,SAAU99C,GACZ,MAAO,uBAAuBuQ,KAAKvQ,IAEvC+9C,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,KA1FyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,eACN30C,EAAG,iBACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,SAAS4T,EAAOz1C,GACZ,OAAIA,EAAI,KAAQ,IAELA,EAAI,IAAO,EAK1B,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAClB,mBACA,mBACV,IAAK,KACD,OAAI4C,EAAOrD,GAEHrsD,GACC6sD,GAAiBC,EAAW,WAAa,YAG3C9sD,EAAS,UACpB,IAAK,IACD,OAAO6sD,EAAgB,SAAW,SACtC,IAAK,KACD,OAAI6C,EAAOrD,GAEHrsD,GAAU6sD,GAAiBC,EAAW,UAAY,WAE/CD,EACA7sD,EAAS,SAEbA,EAAS,SACpB,IAAK,KACD,OAAI0vD,EAAOrD,GAEHrsD,GACC6sD,GAAiBC,EACZ,gBACA,iBAGP9sD,EAAS,cACpB,IAAK,IACD,OAAI6sD,EACO,QAEJC,EAAW,MAAQ,OAC9B,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO7sD,EAAS,QAEbA,GAAU8sD,EAAW,OAAS,SAC9BD,EACA7sD,EAAS,QAEbA,GAAU8sD,EAAW,MAAQ,QACxC,IAAK,IACD,OAAID,EACO,UAEJC,EAAW,QAAU,SAChC,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO7sD,EAAS,UAEbA,GAAU8sD,EAAW,SAAW,WAChCD,EACA7sD,EAAS,UAEbA,GAAU8sD,EAAW,QAAU,UAC1C,IAAK,IACD,OAAOD,GAAiBC,EAAW,KAAO,MAC9C,IAAK,KACD,OAAI4C,EAAOrD,GACArsD,GAAU6sD,GAAiBC,EAAW,KAAO,QAEjD9sD,GAAU6sD,GAAiBC,EAAW,KAAO,QAIvDhR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,mFAAmFxtC,MACzF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,iBACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAG,cACHC,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,gGAAgGttC,MACpG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,QACI,MAAO,+BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU10C,GACd,OAAQ,YAAY+F,KAAK/F,GAAK,MAAQ,MAAQ,IAAMA,GAExD20C,KAAM,QACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAI,YACJC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA9DyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gGAAgGttC,MACpG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,WACL,MACI,WACCvxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRY,QAAS,WACL,MACI,aACCxxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRa,SAAU,WACN,MACI,WACCzxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRc,QAAS,WACL,MACI,WACC1xD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRe,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MACI,uBACCn0D,KAAK4wD,QAAU,EACV,OACiB,IAAjB5wD,KAAK4wD,QACL,IACA,OACN,MAER,QACI,MACI,uBACC5wD,KAAK4wD,QAAU,EACV,OACiB,IAAjB5wD,KAAK4wD,QACL,IACA,OACN,QAIhBgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAI,YACJiC,EAAG,gBACHC,GAAI,eACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BgH,KAAM,CACF,CACIC,MAAO,aACPC,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,KACRC,KAAM,MAEV,CACIH,MAAO,aACPI,OAAO,IACPH,OAAQ,EACR7xD,KAAM,MACN8xD,OAAQ,KACRC,KAAM,OAGdE,oBAAqB,WACrBC,oBAAqB,SAAU9kD,EAAOoJ,GAClC,MAAoB,MAAbA,EAAM,GAAa,EAAIqN,SAASrN,EAAM,IAAMpJ,EAAO,KAE9Dw9C,OAAQ,yCAAyCttC,MAAM,KACvDutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBACN5+B,EAAG,aACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,wBAEVrF,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW5yD,KAAK4yD,OACb,cAEA,WAGflB,QAAS,UACTC,SAAU,SAAUgG,GAChB,OAAI33D,KAAK4yD,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,MACN30C,EAAG,KACH40C,GAAI,MACJh9C,EAAG,KACHi9C,GAAI,MACJC,EAAG,MACHC,GAAI,OACJh5B,EAAG,KACHi5B,GAAI,MACJC,EAAG,MACHC,GAAI,OACJC,EAAG,KACHC,GAAI,SAlJ0BtyD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,+CAA+CxtC,MAAM,KAC/DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,uBACN30C,EAAG,kBACH40C,GAAI,WACJh9C,EAAG,kBACHi9C,GAAI,WACJC,EAAG,gBACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,YACJC,EAAG,UACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGttC,MACzG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,CACN2D,WAAY,gEAAgEnxC,MACxE,KAEJ8E,OAAQ,iEAAiE9E,MACrE,KAEJoxC,SAAU,iBAEd3D,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SAAU10C,GACd,OAAOA,EAAErI,QAAQ,iCAAiC,SAC9C6iD,EACA3wC,EACA4wC,GAEA,MAAc,MAAPA,EAAa5wC,EAAK,KAAOA,EAAK4wC,EAAK,SAGlD9F,KAAM,SAAU30C,GACZ,MAAI,4BAA4B+F,KAAK/F,GAC1BA,EAAErI,QAAQ,SAAU,UAE3B,OAAOoO,KAAK/F,GACLA,EAAErI,QAAQ,QAAS,YAEvBqI,GAEXA,EAAG,iBACH40C,GAAI,UACJh9C,EAAG,OACHi9C,GAAI,UACJC,EAAG,QACHC,GAAI,WACJh5B,EAAG,MACHi5B,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,KA1FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,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,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,0DAA0DxtC,MAChE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,WACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,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,KAhFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJwtC,SAAU,iDAAiDxtC,MAAM,KACjEytC,cAAe,oBAAoBztC,MAAM,KACzC0tC,YAAa,oBAAoB1tC,MAAM,KACvCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAiB,UAAVA,GAEX+9C,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,QACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,UACJC,EAAG,QACHC,GAAI,QACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,OACTiB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzB42C,KAAM,CACFC,IAAK,EACLC,IAAK,KApGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,2EAA2EvtC,MACpF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,0DAA0DxtC,MAChE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,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,WACN30C,EAAG,gBACH40C,GAAI,gBACJh9C,EAAG,aACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,SACJC,EAAG,cACHC,GAAI,YACJC,EAAG,YACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,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,KAzHyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yCAAyCttC,MAAM,KACvDutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,uBACLC,KAAM,4BACN5+B,EAAG,cACHmjC,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,OACN30C,EAAG,MACH40C,GAAI,MACJh9C,EAAG,KACHi9C,GAAI,MACJC,EAAG,OACHC,GAAI,OACJh5B,EAAG,KACHi5B,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,SAAUnvC,GACZ,MAAiB,OAAVA,GAEXovC,SAAU,SAAU4C,EAAMC,EAAQsE,GAC9B,OAAOvE,EAAO,GAAK,KAAO,QAxEIrzD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,gBAGChO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,0EAA0ExtC,MAChF,KAEJytC,cAAe,2DAA2DztC,MACtE,KAEJ0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,kBACfC,KAAM,SAAU99C,GACZ,MAAO,UAAUuQ,KAAKvQ,IAE1B+9C,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,KACN30C,EAAG,kBACH40C,GAAI,WACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,eACHC,GAAI,aACJh5B,EAAG,WACHi5B,GAAI,SACJC,EAAG,YACHC,GAAI,UACJC,EAAG,WACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,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,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,kFAAkFttC,MACtF,KAEJutC,YAAa,qDAAqDvtC,MAC9D,KAEJwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,WACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,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,KAlFyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,aAAc,gBAClBk9C,EAAG,CAAC,YAAa,eACjB/4B,EAAG,CAAC,UAAW,aACfk5B,EAAG,CAAC,WAAY,eAChBE,EAAG,CAAC,UAAW,eAEnB,OAAOY,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAuBxD,SAASkyD,EAA4BpF,GAEjC,GADAA,EAAStpC,SAASspC,EAAQ,IACtBrpC,MAAMqpC,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,KAKjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,mEAAmExtC,MACzE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,0BACX,QACI,MAAO,4BAIvBtC,aAAc,CACVC,OAhGR,SAA2BvsD,GAEvB,OAAIwyD,EADSxyD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,KAAO3I,EAEX,MAAQA,GA4FXwsD,KA1FR,SAAyBxsD,GAErB,OAAIwyD,EADSxyD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,QAAU3I,EAEd,SAAWA,GAsFd6X,EAAG,kBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,cACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI,UACJC,EAAG4D,EACH3D,GAAI,WACJC,EAAG0D,EACHzD,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApIyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJwtC,SAAU,sCAAsCxtC,MAAM,KACtDytC,cAAe,oCAAoCztC,MAAM,KACzD0tC,YAAa,mBAAmB1tC,MAAM,KACtCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,6BAEVZ,cAAe,kBACfC,KAAM,SAAU99C,GACZ,MAAiB,WAAVA,GAEX+9C,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,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,SACHi9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,SACJC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,SAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,MAAO,MAAQA,KA/DezyD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4V,EAAQ,CACRhG,GAAI,6BACJh9C,EAAG,wBACHi9C,GAAI,0BACJC,EAAG,2BACHC,GAAI,4BACJh5B,EAAG,qBACHi5B,GAAI,sBACJC,EAAG,uBACHC,GAAI,4BACJC,EAAG,mBACHC,GAAI,oBASR,SAASyF,EAAkBtF,EAAQQ,EAAettD,EAAKutD,GACnD,OAAOD,EACDa,EAAMnuD,GAAK,GACXutD,EACAY,EAAMnuD,GAAK,GACXmuD,EAAMnuD,GAAK,GAErB,SAASqyD,EAAQvF,GACb,OAAOA,EAAS,IAAO,GAAMA,EAAS,IAAMA,EAAS,GAEzD,SAASqB,EAAMnuD,GACX,OAAOmyD,EAAMnyD,GAAKid,MAAM,KAE5B,SAAS6yC,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAe,IAAXA,EAEIrsD,EAAS2xD,EAAkBtF,EAAQQ,EAAettD,EAAI,GAAIutD,GAEvDD,EACA7sD,GAAU4xD,EAAQvF,GAAUqB,EAAMnuD,GAAK,GAAKmuD,EAAMnuD,GAAK,IAE1DutD,EACO9sD,EAAS0tD,EAAMnuD,GAAK,GAEpBS,GAAU4xD,EAAQvF,GAAUqB,EAAMnuD,GAAK,GAAKmuD,EAAMnuD,GAAK,IAIjEu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oGAAoG9E,MACxG,KAEJmxC,WAAY,kGAAkGnxC,MAC1G,KAEJoxC,SAAU,+DAEd7D,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,CACN1oC,OAAQ,oFAAoF9E,MACxF,KAEJmxC,WAAY,2FAA2FnxC,MACnG,KAEJoxC,SAAU,cAEd3D,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,iBAAiB1tC,MAAM,KACpCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CACN5+B,EAAG,aACHmjC,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,WACN30C,EAlFR,SAA0Bu1C,EAAQQ,EAAettD,EAAKutD,GAClD,OAAID,EACO,kBAEAC,EAAW,kBAAoB,mBA+EtCpB,GAAI2D,EACJ3gD,EAAGijD,EACHhG,GAAI0D,EACJzD,EAAG+F,EACH9F,GAAIwD,EACJx8B,EAAG8+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,KAzHyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAI4V,EAAQ,CACRhG,GAAI,qCAAqClvC,MAAM,KAC/C9N,EAAG,iCAAiC8N,MAAM,KAC1CmvC,GAAI,iCAAiCnvC,MAAM,KAC3CovC,EAAG,iCAAiCpvC,MAAM,KAC1CqvC,GAAI,iCAAiCrvC,MAAM,KAC3CqW,EAAG,6BAA6BrW,MAAM,KACtCsvC,GAAI,6BAA6BtvC,MAAM,KACvCuvC,EAAG,iCAAiCvvC,MAAM,KAC1CwvC,GAAI,iCAAiCxvC,MAAM,KAC3CyvC,EAAG,wBAAwBzvC,MAAM,KACjC0vC,GAAI,wBAAwB1vC,MAAM,MAKtC,SAAS8E,EAAOosC,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,EAAettD,GACnD,OAAO8sD,EAAS,IAAM/qC,EAAOowC,EAAMnyD,GAAM8sD,EAAQQ,GAErD,SAASgF,EAAyBxF,EAAQQ,EAAettD,GACrD,OAAO+hB,EAAOowC,EAAMnyD,GAAM8sD,EAAQQ,GAM7B/Q,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uGAAuGttC,MAC3G,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,0EAA0ExtC,MAChF,KAEJytC,cAAe,kBAAkBztC,MAAM,KACvC0tC,YAAa,kBAAkB1tC,MAAM,KACrCwwC,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,WACN30C,EAlCR,SAAyBu1C,EAAQQ,GAC7B,OAAOA,EAAgB,iBAAmB,kBAkCtCnB,GAAI8B,EACJ9+C,EAAGmjD,EACHlG,GAAI6B,EACJ5B,EAAGiG,EACHhG,GAAI2B,EACJ36B,EAAGg/B,EACH/F,GAAI0B,EACJzB,EAAG8F,EACH7F,GAAIwB,EACJvB,EAAG4F,EACH3F,GAAIsB,GAERrB,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,SAAU,UAAW,WAC1Bh9C,EAAG,CAAC,cAAe,iBACnBi9C,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,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDnW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBAETC,SAAU,WACN,OAAQzxD,KAAKm0D,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,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,SACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IttC,MAClJ,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJoyC,YAAa,yCACbK,kBAAmB,yCACnBb,iBAAkB,yCAClBc,uBAAwB,yCACxBlF,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,wBAAwBztC,MAAM,KAC7C0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,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,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,QACJC,EAAG,YACHC,GAAI,YACJC,EAAG,SACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,OAAQ3xD,KAAKm0D,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,UACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,WACHi5B,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,KAnFyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wEAAwExtC,MAC9E,KAEJytC,cAAe,2CAA2CztC,MAAM,KAChE0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,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,WACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,eACHC,GAAI,cACJh5B,EAAG,YACHi5B,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,YA7EmBrzD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,OAAQvtD,GACJ,IAAK,IACD,OAAOstD,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,GAIVvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+LAA+LttC,MACnM,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,iCAEVZ,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAEX+9C,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,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,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,MAhGezyD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,EAAe5tD,EAAQ6tD,GACnD,IAAI2C,EAAS,GACb,GAAI5C,EACA,OAAQ5tD,GACJ,IAAK,IACDwwD,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,OAAQxwD,GACJ,IAAK,IACDwwD,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,EAAOhhD,QAAQ,MAAO49C,GAGxBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,gFAAgFvtC,MACzF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,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,WACN30C,EAAGo7C,EACHxG,GAAIwG,EACJxjD,EAAGwjD,EACHvG,GAAIuG,EACJtG,EAAGsG,EACHrG,GAAIqG,EACJr/B,EAAGq/B,EACHpG,GAAIoG,EACJnG,EAAGmG,EACHlG,GAAIkG,EACJjG,EAAGiG,EACHhG,GAAIgG,GAER7E,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,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,KAvMyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,gBACN30C,EAAG,gBACH40C,GAAI,UACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,gBACN30C,EAAG,gBACH40C,GAAI,UACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iEAAiExtC,MACvE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,SACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,aACJh5B,EAAG,UACHi5B,GAAI,YACJC,EAAG,QACHC,GAAI,UACJC,EAAG,OACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,mDAAmDvtC,MAAM,KACtEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,2BAA2BztC,MAAM,KAChD0tC,YAAa,2BAA2B1tC,MAAM,KAE9CiuC,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,kBACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,OACHC,GAAI,OACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzB42C,KAAM,CACFC,IAAK,EACLC,IAAK,KAvFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,WACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,WACJiC,EAAG,SACHC,GAAI,UACJjC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,uEAAuEvtC,MAChF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,0CAA0CztC,MAAM,KAC/D0tC,YAAa,4BAA4B1tC,MAAM,KAC/CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVsC,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,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,WACN30C,EAAG,YACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAtHyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAEJmyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,aACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,UACHi5B,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,KAnGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAEJmyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAET9S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,aACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,UACHi5B,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,KArGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,WACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,UACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,+FCElD,SAAWkiD,GAAU,aAIbA,EAAO+N,aAAa,SAAU,CACtCC,OAAQ,CACJ6D,WAAY,qFAAqFnxC,MAC7F,KAEJ8E,OAAQ,sHAAsH9E,MAC1H,KAEJoxC,SAAU,mBAEd7D,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,QACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,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,KAjFyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGFxR,EAAO+N,aAAa,QAAS,CAEpCC,OAAQ,sEAAsEttC,MAC1E,KAEJutC,YAAa,sEAAsEvtC,MAC/E,KAEJwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,iCAAiCztC,MAAM,KACtD0tC,YAAa,iCAAiC1tC,MAAM,KACpDiuC,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,WACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,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,KAvHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIqW,EAAmB,mGAAmG31C,MAClH,KAEJ41C,EAAmB,qGAAqG51C,MACpH,KAEJmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAER,SAASe,EAAOz1C,GACZ,OAAOA,EAAI,GAAK,GAAKA,EAAI,GAAK,MAAQA,EAAI,IAAM,IAAO,EAE3D,SAASo1C,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KACD,OAAOS,GAAU0vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,IACD,OAAOQ,EAAgB,SAAW,SACtC,IAAK,KACD,OAAO7sD,GAAU0vD,EAAOrD,GAAU,SAAW,SACjD,IAAK,IACD,OAAOQ,EAAgB,UAAY,UACvC,IAAK,KACD,OAAO7sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,WAAa,WACnD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,WAAa,YACnD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,OAAS,QAI9CvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,SAAUgG,EAAgBxuC,GAC9B,OAAKwuC,EAEM,SAASjzC,KAAKyE,GACd8wC,EAAiBtC,EAAeE,SAEhCmC,EAAiBrC,EAAeE,SAJhCmC,GAOfpI,YAAa,kDAAkDvtC,MAAM,KACrEmyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,2BAA2BztC,MAAM,KAChD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,qBAEX,KAAK,EACD,MAAO,mBAEX,KAAK,EACD,MAAO,iBAEX,KAAK,EACD,MAAO,kBAEX,QACI,MAAO,oBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,yBACX,QACI,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,eACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,UACHi5B,GAAI,SACJiC,EAAG,UACHC,GAAIqB,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,MACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iFAAiFxtC,MACvF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,IAAf3xD,KAAKm0D,OAA8B,IAAfn0D,KAAKm0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,kBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTkE,YAAa,kBAxDqB12D,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iFAAiFxtC,MACvF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,IAAf3xD,KAAKm0D,OAA8B,IAAfn0D,KAAKm0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,WACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GACnD,IASI8yD,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,OAMuB3sD,GAG9Bu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,aACN30C,EAAG,iBACH40C,GAAI8B,EACJ9+C,EAAG,WACHi9C,GAAI6B,EACJ5B,EAAG,QACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJO,EAAG,cACHC,GAAIR,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,QACHC,GAAIsB,GAERlB,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GAUnD,MAAY,MAARA,EACOstD,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,gBAKgC3sD,GApBvBid,MAAM,KAChBixC,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,SAMK7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oFAAoF9E,MACxF,KAEJmxC,WAAY,kFAAkFnxC,MAC1F,MAGRutC,YAAa,CAETzoC,OAAQ,gEAAgE9E,MACpE,KAEJmxC,WAAY,gEAAgEnxC,MACxE,MAGRwtC,SAAU,CACN2D,WAAY,gEAAgEnxC,MACxE,KAEJ8E,OAAQ,gEAAgE9E,MACpE,KAEJoxC,SAAU,iDAEd3D,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CmyC,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,SAAW5yD,KAAK4yD,OAcpB,OAAmB,IAAf5yD,KAAKm0D,MACE,oBAEA,mBAhBX,OAAQn0D,KAAKm0D,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,SAAW5yD,KAAK4yD,OAcpB,OAAmB,IAAf5yD,KAAKm0D,MACE,oBAEA,mBAhBX,OAAQn0D,KAAKm0D,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,WACN30C,EAAG,mBACH40C,GAAI8B,EACJ9+C,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG,MACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJO,EAAG,SACHC,GAAIR,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,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,KA1MyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,QACA,UACA,OACA,QACA,MACA,MACA,SACA,OACA,UACA,SACA,QACA,SAEJwI,EAAO,CAAC,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAO,QAElDxW,EAAO+N,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,SAAU99C,GACZ,MAAO,QAAUA,GAErB+9C,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,QACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,SACHi9C,GAAI,SACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,WACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mJAAmJttC,MACvJ,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,6EAA6ExtC,MACnF,KAEJytC,cAAe,mCAAmCztC,MAAM,KACxD0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,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,WACN30C,EAAG,mBACH40C,GAAI,eACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,cACHC,GAAI,aACJh5B,EAAG,cACHi5B,GAAI,cACJC,EAAG,aACHC,GAAI,WACJC,EAAG,aACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAKhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,kGAAkGttC,MACtG,KAEJutC,YAAa,wDAAwDvtC,MACjE,KAEJwtC,SAAU,gEAAgExtC,MACtE,KAEJytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,qBAAqB1tC,MAAM,KACxCwwC,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,WACN30C,EAAG,eACH40C,GAAI,WACJh9C,EAAG,YACHi9C,GAAI,cACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,OACHi5B,GAAI,SACJC,EAAG,OACHC,GAAI,SACJC,EAAG,MACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,SAEpBlC,cAAe,4BACfC,KAAM,SAAU99C,GACZ,MAAiB,SAAVA,GAA8B,YAAVA,GAE/B+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,OAAS,UAEnBA,EAAU,QAAU,aAjED5wD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,oFAAoFttC,MACzF,KAEJutC,EAAc,kDAAkDvtC,MAAM,KAC1E,SAASkzC,EAAOz1C,GACZ,OAAOA,EAAI,GAAKA,EAAI,EAExB,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAEvCrsD,EAAS,YAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,MAAQ,OAEnCrsD,EAAS,QAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,SAAW,WAClD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,YAEvCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,OAAS,SAEpCrsD,EAAS,SAKvB87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACbC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,WACN,OAAQzxD,KAAKm0D,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,OAAQ3xD,KAAKm0D,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,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7IyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAClB,eACA,kBACV,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,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,OARI7sD,GADW,IAAXqsD,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,OARI7sD,GADW,IAAXqsD,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,OANI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,MAAQ,OAC5B,IAAXT,EACGQ,GAAiBC,EAAW,MAAQ,UAEpCD,GAAiBC,EAAW,MAAQ,SAGtD,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,eACpD,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,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,OARI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,OAAS,QAC7B,IAAXT,EACGQ,GAAiBC,EAAW,OAAS,SACxCT,EAAS,EACNQ,GAAiBC,EAAW,OAAS,OAErCD,GAAiBC,EAAW,MAAQ,SAMrDhR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,eACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBAETC,SAAU,WACN,OAAQzxD,KAAKm0D,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,OAAQ3xD,KAAKm0D,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,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxKyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFttC,MACpF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,mBAAmB1tC,MAAM,KACtCwwC,oBAAoB,EACpB7C,cAAe,QACfC,KAAM,SAAU99C,GACZ,MAA2B,MAApBA,EAAMnN,OAAO,IAExBkrD,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,aACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB5yD,CAAQ,EAAQ,gGCElD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bh9C,EAAG,CAAC,cAAe,gBACnBi9C,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,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAM7CnW,EAAO+N,aAAa,UAAW,CACxCC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,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,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bh9C,EAAG,CAAC,cAAe,gBACnBi9C,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,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDnW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,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,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mHAAmHttC,MACvH,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,sEAAsExtC,MAC5E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,iBACN30C,EAAG,qBACH40C,GAAI,cACJh9C,EAAG,SACHi9C,GAAI,aACJC,EAAG,SACHC,GAAI,aACJh5B,EAAG,UACHi5B,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,KAjFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,oDAAoDxtC,MAAM,KACpEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,eACN30C,EAAG,iBACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,YACJh5B,EAAG,SACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,GAEM,IAANA,EADA,KAIA,OAIlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,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,WACN30C,EAAG,aACH40C,GAAI,aACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,WACJh5B,EAAG,YACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,cACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,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,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,0FAA0FvtC,MACnG,KAEJwtC,SAAU,8FAA8FxtC,MACpG,KAEJytC,cAAe,mDAAmDztC,MAC9D,KAEJ0tC,YAAa,sBAAsB1tC,MAAM,KACzCiuC,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,UACN30C,EAAG,oBACH40C,GAAI,eACJh9C,EAAG,cACHi9C,GAAI,gBACJC,EAAG,gBACHC,GAAI,eACJh5B,EAAG,WACHi5B,GAAI,aACJC,EAAG,YACHC,GAAI,cACJC,EAAG,aACHC,GAAI,eAERC,uBAAwB,aACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBgB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAIzBy0C,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/HyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,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,YACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,cACJC,EAAG,SACHC,GAAI,WACJh5B,EAAG,UACHi5B,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,KApFyB5yD,CAAQ,EAAQ,4FCKlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,iCAAiCztC,MAAM,KACtD0tC,YAAa,yBAAyB1tC,MAAM,KAC5CiuC,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,WACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,WACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIyR,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,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,qFAAqF9E,MACzF,KAEJmxC,WAAY,yEAAyEnxC,MACjF,MAGRutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,SACN30C,EAAG,eACHpI,EAAG,YACHi9C,GAAI,YACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,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,KAlHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,iDAAiDxtC,MAAM,KACjEytC,cAAe,8CAA8CztC,MAAM,KACnE0tC,YAAa,yBAAyB1tC,MAAM,KAC5CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,oCAEVZ,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAiB,eAAVA,GAEX+9C,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,YACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,SACHi9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,SACJiC,EAAG,YACHC,GAAI,aACJjC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,WA9D0BtyD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,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,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+EAA+EttC,MACnF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,QACN30C,EAAG,iBACHpI,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,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,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzFyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,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,mBACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyW,EAAe,iDAAiD/1C,MAAM,KA4B1E,SAAS6yC,EAAUhD,EAAQQ,EAAe5tD,EAAQ6tD,GAC9C,IAAI0F,EAiBR,SAAsBnG,GAClB,IAAIoG,EAAUj3C,KAAKk3C,MAAOrG,EAAS,IAAQ,KACvCsG,EAAMn3C,KAAKk3C,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,OAAQptD,GACJ,IAAK,KACD,OAAOuzD,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,QAqBtB1W,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,kMAAkMttC,MACtM,KAEJutC,YAAa,0HAA0HvtC,MACnI,KAEJ6xC,kBAAkB,EAClBrE,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,2DAA2DztC,MACtE,KAEJ0tC,YAAa,2DAA2D1tC,MACpE,KAEJiuC,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,EAAO7nD,QAAQ,OACTmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,MACpBu3D,EAAO,QAuFbtH,KAnFR,SAAuBgE,GACnB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO7nD,QAAQ,OACTmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,MACpBu3D,EAAO,QA2Ebj8C,EAAG,UACH40C,GAAI2D,EACJ3gD,EAAG,UACHi9C,GAAI0D,EACJzD,EAAG,UACHC,GAAIwD,EACJx8B,EAAG,UACHi5B,GAAIuD,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,UACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3HyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIyR,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,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C6tC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCL,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAA4B,OAAVA,GAE7Bm+C,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,UACN30C,EAAG,gBACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,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,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAiEzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,mBACvB40C,GAAI,CAACW,EAAS,WAAiBA,EAAS,YACxC39C,EAAG,CAAC,UAAW,cACfi9C,GAAI,CAACU,EAAS,SAAeA,EAAS,UACtCT,EAAG,CAAC,UAAW,eACfC,GAAI,CAACQ,EAAS,SAAeA,EAAS,UACtCx5B,EAAG,CAAC,UAAW,eACfi5B,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,EADAvrC,EAAO/hB,GAAK,GAGZ+hB,EAAO/hB,GAAK,GA9EZu8C,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,0CAEVZ,cAAe,aACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,EAAMsU,eAE3BypC,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,OACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB5yD,CAAQ,EAAQ,iGCElD,SAAWkiD,GAAU,aAIXA,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,wFAAwFvtC,MACjG,KAEJwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,kDAAkDztC,MAAM,KACvE0tC,YAAa,kDAAkD1tC,MAAM,KACrEiuC,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,SACN30C,EAAG,OACH40C,GAAI,UACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJh5B,EAAG,MACHi5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,kFAAkFttC,MACtF,KAEJutC,YAAa,kFAAkFvtC,MAC3F,KAEJwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,kDAAkDztC,MAAM,KACvE0tC,YAAa,kDAAkD1tC,MAAM,KACrEiuC,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,SACN30C,EAAG,OACH40C,GAAI,UACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJh5B,EAAG,MACHi5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,sFAAsFvtC,MAC/F,KAEJwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,WACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,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,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CAEFC,IAAK,EACLC,IAAK,KA5GyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GASnD,MAAY,MAARA,EACOstD,EAAgB,UAAY,UACpB,MAARttD,EACAstD,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,kBAOgC3sD,GArBvBid,MAAM,KAChBixC,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,EAAqBvoD,GAC1B,OAAO,WACH,OAAOA,EAAM,KAAwB,KAAjBhR,KAAK4wD,QAAiB,IAAM,IAAM,QAIrDxO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,yFAAyF9E,MAC7F,KAEJmxC,WAAY,iGAAiGnxC,MACzG,MAGRutC,YAAa,yDAAyDvtC,MAClE,KAEJwtC,SAhDJ,SAA6Bt7C,EAAG4S,GAC5B,IAAI0oC,EAAW,CACPkJ,WAAY,0DAA0D12C,MAClE,KAEJ22C,WAAY,0DAA0D32C,MAClE,KAEJ42C,SAAU,4DAA4D52C,MAClE,MAKZ,OAAU,IAAN9N,EACOs7C,EAAqB,WACvBxuD,MAAM,EAAG,GACTM,OAAOkuD,EAAqB,WAAExuD,MAAM,EAAG,IAE3CkT,EASEs7C,EALI,qBAAqBntC,KAAKyE,GAC/B,aACA,sCAAsCzE,KAAKyE,GAC3C,WACA,cACoB5S,EAAEm/C,OARjB7D,EAAqB,YA6BhCC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOoF,EAAqB,oBAAoBx3D,KAAK/B,MACzD,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOu5D,EAAqB,qBAAqBx3D,KAAK/B,QAGlE4xD,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,kBACH40C,GAAI8B,EACJ9+C,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG,SACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAGRrD,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,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,KAhKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,MACA,SACA,OACA,QACA,SACA,QACA,SAEJwI,EAAO,CAAC,QAAS,MAAO,OAAQ,MAAO,SAAU,OAAQ,QAEpDxW,EAAO+N,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,SAAU99C,GACZ,MAAO,QAAUA,GAErB+9C,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,SACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,SACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,QACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB5yD,CAAQ,EAAQ,gGCElD,SAAWkiD,GAAU,aAIZA,EAAO+N,aAAa,UAAW,CACxCC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,+DAA+DxtC,MACrE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,yBAAyB1tC,MAAM,KAC5CiuC,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,qBACN30C,EAAG,SACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,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,oBACN30C,EAAG,SACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGttC,MACzG,KAEJutC,YAAa,sFAAsFvtC,MAC/F,KAEJ6xC,kBAAkB,EAClBrE,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpB7C,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExB+9C,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,gCACN5+B,EAAG,YACHmjC,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,WACN30C,EAAG,WACH40C,GAAI,UACJh9C,EAAG,WACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,WACHi5B,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,KA5EyB5yD,CAAQ,EAAQ,iGCElD,SAAWkiD,GAAU,aAIXA,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,6GAA6GttC,MACjH,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,yEAAyExtC,MAC/E,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,4BAA4B1tC,MAAM,KAC/CwwC,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,UACN30C,EAAG,mBACH40C,GAAI,eACJh9C,EAAG,aACHi9C,GAAI,eACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,SACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,cACJC,EAAG,UACHC,GAAI,aAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,gEAAgEvtC,MAAM,KACnFwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,sCAAsCztC,MAAM,KAC3D0tC,YAAa,2BAA2B1tC,MAAM,KAC9CiuC,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,WACN30C,EAAG,oBACH40C,GAAI,WACJh9C,EAAG,cACHi9C,GAAI,aACJC,EAAG,cACHC,GAAI,aACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,gBACxBC,QAAS,UACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,8FCKlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,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,SAAW5yD,KAAK4yD,OACb,WAEA,YAGflB,QAAS,SACTC,SAAU,SAAUgG,GAChB,OAAI33D,KAAK4yD,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,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJiC,EAAG,MACHC,GAAI,OACJjC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,QAERI,KAAM,CAEFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,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,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,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,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,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,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,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,SAASgrD,EAAeC,GACvB,IAAIvuD,EAAKwuD,EAAsBD,GAC/B,OAAOE,EAAoBzuD,GAE5B,SAASwuD,EAAsBD,GAC9B,IAAIE,EAAoBl1C,EAAEjW,EAAKirD,GAAM,CACpC,IAAIt3C,EAAI,IAAI7P,MAAM,uBAAyBmnD,EAAM,KAEjD,MADAt3C,EAAEy3C,KAAO,mBACHz3C,EAEP,OAAO3T,EAAIirD,GAEZD,EAAenmD,KAAO,WACrB,OAAOD,OAAOC,KAAK7E,IAEpBgrD,EAAehtD,QAAUktD,EACzB/5D,EAAOovD,QAAUyK,EACjBA,EAAetuD,GAAK,8GClSnB,IAASoS,EAAAA,EAAqiI8I,OAAOF,SAAziIxmB,QAAQC,OAAO,eAAe,IAAI0E,MAAM,eAAe,CAACo5C,OAAM,IAAKryC,OAAO,CAAC,mBAAmB,SAASkS,GAAG5d,QAAQ+M,UAAU6Q,EAAEu8C,0BAA0Bv8C,EAAEu8C,yBAAyB,sCAAsCv8C,EAAEw8C,2BAA2B,yCAAyCp6D,QAAQC,OAAO,mBAAmB,CAAC,mBAAmBD,QAAQC,OAAO,iBAAiB,IAAID,QAAQC,OAAO,QAAQ,CAAC,eAAe,iBAAiB,mBAAmB,eAAwEA,EAAOovD,UAAUA,IAAUpvD,EAAOovD,QAAQ,SAASrvD,QAAQC,OAAO,kBAAkB2X,QAAQ,MAAM,CAAC,KAAK,SAASgG,GAAG,IAAImB,EAAE,OAAaua,EAAE,CAAC,MAAM,KAAI,MAAM,KAAK,MAAM,KAAI,MAAM,KAAK,MAAM,MAAMn5B,KAAKk6D,eAAe,SAASz8C,EAAEmB,GAAG,MAAM,WAAWA,EAAEu7C,YAAYn6D,KAAKo6D,QAAQ38C,GAAGA,EAAE48C,iBAAiB,MAAMz7C,EAAEu7C,YAAYn6D,KAAKo6D,QAAQ38C,GAAGA,EAAE3I,WAAWC,QAAQ,IAAI6J,EAAEu7C,YAAY,iBAAiB18C,GAAGA,EAAEA,EAAE1I,QAAQ,KAAK,OAAO6J,EAAE07C,cAAc78C,EAAEvP,QAAQ,MAAM,GAAGuP,EAAEvP,QAAQ,OAAO,GAAGuP,EAAEvP,QAAQ,OAAO,KAAKuP,EAAEmB,EAAE27C,SAAS98C,EAAEmB,EAAE27C,UAAU98C,GAAG,kBAAkBA,EAAEA,EAAE,OAAO,QAAQA,GAAGzd,KAAKo6D,QAAQ,SAAS38C,GAAG,OAAOA,IAAIA,KAAK+8C,SAAS/8C,IAAIwU,QAAQxU,EAAE,KAAKzd,KAAKke,UAAU,SAASib,EAAE7W,GAAG,IAAI+wC,EAAE51C,EAAExR,QAAQ4R,EAAE7d,KAAKkyD,EAAE,GAAG70C,EAAE,GAAGK,EAAED,EAAExN,KAAKkpB,GAAGpuB,MAAK,SAAS0S,GAA6C,IAAI0b,EAAEzb,EAA7C7d,QAAQ+M,UAAU0V,EAAEm4C,SAASn4C,EAAEm4C,SAAgBthC,EAAE,GAAGt5B,QAAQkB,QAAQuhB,EAAEm4C,QAAO,SAASh9C,GAAGzd,KAAKS,KAAKod,EAAEq8C,eAAez8C,EAAE6E,MAAK6W,GAAGzb,EAAEyb,EAAElmB,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGK,EAAEkB,GAAE,IAAsI6T,EAAEzd,EAApIwI,EAAE,GAAM3d,QAAQmS,QAAQyL,GAAGD,EAAEC,EAAE5d,QAAQuN,WAAWqQ,KAAKD,EAAEC,KAAK5d,QAAQ+M,UAAU0V,EAAEkoC,QAAQloC,EAAEkoC,OAAO,kBAAkBloC,EAAEkoC,QAAe/3B,EAAE,GAAG5yB,QAAQkB,QAAQyc,EAAE,IAAG,SAASC,EAAEmB,GAAG5e,KAAKS,KAAKod,EAAEq8C,eAAet7C,EAAE0D,MAAKmQ,GAAGzd,EAAEyd,EAAExf,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGrI,EAAE4J,GAAE/e,QAAQkB,QAAQyc,GAAE,SAASC,EAAEk9C,GAAG,IAAIxhC,EAAEk6B,EAAEnB,EAAEryD,QAAQoiB,KAAKzE,EAAEm9C,IAAItH,EAAE,GAAG,IAAI31C,EAAE4E,EAAEs4C,YAAYt4C,EAAEs4C,YAAY1I,EAAEryD,QAAQkB,QAAQ2c,GAAE,SAASD,GAAG,IAAImB,EAAE0D,EAAEs4C,YAAY1I,EAAEz0C,GAAGA,EAAEzd,KAAKS,KAAKod,EAAEq8C,eAAet7C,EAAE0D,MAAK+wC,GAAGl6B,EAAEk6B,EAAEpgD,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGs9C,EAAEn9C,EAAEpO,OAAO+pB,EAAEva,EAAEua,KAAI7W,EAAEu4C,qBAAqB3I,GAA9wC,UAAoxCA,GAAG70C,EAAEg2C,EAAE1mD,QAAQulD,MAAK,MAAM,mBAAmBx0C,EAAS,OAAGA,EAAS,OAAE,SAASD,GAAG41C,EAAEhf,OAAO52B,MAAK41C,EAAE5vD,SAASzD,KAAK86D,cAAc,SAASr9C,GAAG,YAAO,IAAS0b,EAAE1b,IAAIzd,KAAK+6D,eAAe,SAASt9C,GAAG,OAAO0b,EAAE1b,OAAO5d,QAAQC,OAAO,oBAAoB+C,UAAU,QAAQ,CAAC,SAAS,KAAK,MAAM,YAAY,WAAW,SAAS+b,EAAE+7C,EAAExhC,EAAE7W,EAAE+wC,GAAG,MAAM,CAAClsD,SAAS,KAAKrE,MAAM,CAAC6E,KAAK,SAASqzD,SAAS,YAAYP,OAAO,aAAaG,YAAY,kBAAkBL,SAAS,iBAAiBJ,WAAW,oBAAoBG,aAAa,gBAAgBI,SAAS,kBAAkBtuC,SAAS,YAAYyuC,mBAAmB,UAAUpgB,QAAQ,IAAIwgB,QAAQ,WAAWzQ,MAAM,aAAaxpD,WAAW,CAAC,SAAS,WAAW,SAAS,cAAc,SAASyc,EAAEmB,EAAE0D,GAAwe7E,EAAEy9C,IAAI,GAAGr7D,QAAQ+M,UAAU6Q,EAAE2O,WAAW,QAAQ3O,EAAE2O,UAAUvsB,QAAQmS,QAAQyL,EAAE9V,OAAO8V,EAAElZ,OAAO,QAAO,WAAWkZ,EAAE09C,cAAY,GAAI19C,EAAE29C,YAAY,WAAW,OAAO39C,EAAEu9C,UAAU,gBAAgBv9C,EAAE09C,SAAS,WAAW,IAAIt9C,EAAE88C,EAAE1uD,QAAQ,OAAO2S,EAAEy8C,SAAS/4C,EAAEg5C,mBAAmB,kBAAkBniC,EAAEjb,UAAUT,EAAE9V,OAAhxB,WAAa,IAAIiX,EAAE,CAAC27C,SAAS98C,EAAE88C,SAAS98C,EAAE88C,SAAS,IAAIJ,WAAW18C,EAAE08C,WAAW18C,EAAE08C,WAAW,IAAIG,aAAa78C,EAAE68C,aAAaO,mBAAmBp9C,EAAEo9C,oBAAoB,OAAOh7D,QAAQ+M,UAAU0V,EAAEi5C,aAAa38C,EAAE67C,OAAOh9C,EAAEpc,MAAMoc,EAAEg9C,SAAS56D,QAAQ+M,UAAU0V,EAAEk5C,kBAAkB58C,EAAEg8C,YAAYn9C,EAAEpc,MAAMoc,EAAEm9C,cAAc/6D,QAAQ+M,UAAU0V,EAAEm5C,YAAY78C,EAAE4rC,MAAM/sC,EAAEpc,MAAMoc,EAAE+sC,QAAQ5rC,EAAE87C,SAASj9C,EAAEi9C,SAASj9C,EAAEi9C,SAAS,IAAI97C,EAAE87C,SAASvhC,EAAE2hC,cAAcl8C,EAAE87C,UAAUvhC,EAAE4hC,eAAen8C,EAAE87C,UAAU97C,EAAE87C,SAAS97C,EAAoTy0C,IAAKtoD,MAAK,SAAS4vD,GAAGl9C,EAAEy9C,IAAIP,EAAE/7C,EAAE88C,YAAYp5C,EAAEg5C,mBAAmB,kBAAkBz9C,EAAElR,QAAQguD,MAAKl9C,EAAExZ,SAAS4Z,EAAEpa,WAAW8E,KAAK,SAASqW,EAAE+7C,GAA8bA,EAAEr3D,KAAK,SAAQ,WAAWsb,EAAEu8C,WAAWpwD,MAAK,YAAve,WAAa,IAAI4vD,EAAE/7C,EAAEq8C,SAAS,QAAQ9hC,EAAE,IAAIk2B,KAAK,CAACzwC,EAAEs8C,KAAK,CAAChsD,KAAK,oBAAoByrD,EAAE,MAAM,GAAGl9C,EAAEo+B,UAAU8f,iBAAiB9f,UAAU+f,WAAWziC,EAAEva,EAAEw8C,mBAAmB,CAAC,IAAIv9C,EAAEhe,QAAQkD,QAAQ,+CAA+CmvD,EAAEryD,QAAQkD,QAAQ8a,EAAEjV,WAAW,IAAIspD,EAAEp/C,KAAK,OAAO2K,EAAE8vC,IAAIsO,gBAAgB1iC,IAAI+4B,EAAEp/C,KAAK,WAAW8L,EAAEw8C,eAAelJ,EAAEp/C,KAAK,SAAS,UAAUwP,EAAExB,KAAK,QAAQuZ,OAAOxc,GAAGw1C,GAAE,WAAWnB,EAAE,GAAGvH,QAAQuH,EAAErlD,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/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/vito/Development/MOTION_V3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.5.0/scripts/mobile.js b/snippet/3.5.0/scripts/mobile.js new file mode 100644 index 0000000..9ad64b1 --- /dev/null +++ b/snippet/3.5.0/scripts/mobile.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["mobile"],{"./src/styles/mobile.scss":()=>{}},s=>{s(s.s="./src/styles/mobile.scss")}]); \ No newline at end of file diff --git a/snippet/3.5.0/scripts/runtime.js b/snippet/3.5.0/scripts/runtime.js new file mode 100644 index 0000000..2867731 --- /dev/null +++ b/snippet/3.5.0/scripts/runtime.js @@ -0,0 +1,2 @@ +(()=>{"use strict";var r,e={},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=e,r=[],o.O=(e,t,n,i)=>{if(!t){var a=1/0;for(p=0;p=i)&&Object.keys(o.O).every((r=>o.O[r](t[l])))?t.splice(l--,1):(c=!1,i0&&r[p-1][2]>i;p--)r[p]=r[p-1];r[p]=[t,n,i]},o.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return o.d(e,{a:e}),e},o.d=(r,e)=>{for(var t in e)o.o(e,t)&&!o.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(r){if("object"==typeof window)return window}}(),o.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),o.nmd=r=>(r.paths=[],r.children||(r.children=[]),r),(()=>{var r;o.g.importScripts&&(r=o.g.location+"");var e=o.g.document;if(!r&&e&&(e.currentScript&&(r=e.currentScript.src),!r)){var t=e.getElementsByTagName("script");t.length&&(r=t[t.length-1].src)}if(!r)throw new Error("Automatic publicPath is not supported in this browser");r=r.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=r+"../"})(),(()=>{var r={runtime:0,vendor:0};o.O.j=e=>0===r[e];var e=(e,t)=>{var n,i,[a,c,l]=t,s=0;if(a.some((e=>0!==r[e]))){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);if(l)var p=l(o)}for(e&&e(t);s{n.d(a,{ng:()=>s});var u=n("./node_modules/angular/index-exposed.js"),o=angular,s=u&&u.module?u:o}}]); +//# sourceMappingURL=vendor-angular-58d021f3.js.map \ No newline at end of file diff --git a/snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map b/snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map new file mode 100644 index 0000000..2ee3511 --- /dev/null +++ b/snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/vendor-angular-58d021f3.js","mappings":"uPAEmBA,EAAiBC,QACVC,EAAK,GAAkB,SAAwB,EAAiBF","sources":["webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/angular.js"],"names":["ng_from_global","angular","ng"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js b/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js new file mode 100644 index 0000000..ce751db --- /dev/null +++ b/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js @@ -0,0 +1,3 @@ +/*! For license information please see vendor-angular-76f2ed34.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["vendor-angular-76f2ed34"],{"./node_modules/angular/angular.js":(t,e,n)=>{var r=n("./node_modules/jquery/dist/jquery.js");!function(t){"use strict";var e={objectMaxDepth:5,urlErrorParamsEnabled:!0};function n(t){if(!L(t))return e;D(t.objectMaxDepth)&&(e.objectMaxDepth=i(t.objectMaxDepth)?t.objectMaxDepth:NaN),D(t.urlErrorParamsEnabled)&&Y(t.urlErrorParamsEnabled)&&(e.urlErrorParamsEnabled=t.urlErrorParamsEnabled)}function i(t){return H(t)&&t>0}function o(t,n){n=n||Error;var r="https://errors.angularjs.org/1.8.2/",i=r.replace(".","\\.")+"[\\s\\S]*",o=new RegExp(i,"g");return function(){var i,a,s=arguments[0],u=arguments[1],c="["+(t?t+":":"")+s+"] ",l=ht(arguments,2).map((function(t){return Ht(t,e.objectMaxDepth)}));if(c+=u.replace(/\{\d+\}/g,(function(t){var e=+t.slice(1,-1);return e=0&&e-1 in t||"function"==typeof t.item)}function C(t,e,n){var r,i;if(t)if(G(t))for(r in t)"prototype"!==r&&"length"!==r&&"name"!==r&&t.hasOwnProperty(r)&&e.call(n,t[r],r,t);else if(z(t)||x(t)){var o="object"!=typeof t;for(r=0,i=t.length;r=0&&t.splice(n,1),n}function at(t,e,n){var r,o,a=[],s=[];if(n=i(n)?n:NaN,e){if((o=e)&&H(o.length)&&Q.test(m.call(o))||(r=e,"[object ArrayBuffer]"===m.call(r)))throw y("cpta","Can't copy! TypedArray destination cannot be mutated.");if(t===e)throw y("cpi","Can't copy! Source and destination are identical.");return z(e)?e.length=0:C(e,(function(t,n){"$$hashKey"!==n&&delete e[n]})),a.push(t),s.push(e),u(t,e,n)}return c(t,n);function u(t,e,n){if(--n<0)return"...";var r,i=e.$$hashKey;if(z(t))for(var o=0,a=t.length;o2?ht(arguments,2):[];return!G(e)||e instanceof RegExp?e:n.length?function(){return arguments.length?e.apply(t,ft(n,arguments,0)):e.apply(t,n)}:function(){return arguments.length?e.apply(t,arguments):e.call(t)}}function dt(e,n){var r=n;return"string"==typeof e&&"$"===e.charAt(0)&&"$"===e.charAt(1)?r=void 0:J(n)?r="$WINDOW":n&&t.document===n?r="$DOCUMENT":Z(n)&&(r="$SCOPE"),r}function $t(t,e){if(!_(t))return H(e)||(e=e?2:null),JSON.stringify(t,dt,e)}function vt(t){return F(t)?JSON.parse(t):t}var mt=/:/g;function gt(t,e){t=t.replace(mt,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return N(n)?e:n}function yt(t,e){return(t=new Date(t.getTime())).setMinutes(t.getMinutes()+e),t}function bt(t,e,n){n=n?-1:1;var r=t.getTimezoneOffset();return yt(t,n*(gt(e,r)-r))}function wt(t){t=s(t).clone().empty();var e=s("
").append(t).html();try{return t[0].nodeType===qt?h(e):e.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,(function(t,e){return"<"+h(e)}))}catch(t){return h(e)}}function xt(t){try{return decodeURIComponent(t)}catch(t){}}function Ct(t){var e={};return C((t||"").split("&"),(function(t){var n,r,i;t&&(r=t=t.replace(/\+/g,"%20"),-1!==(n=t.indexOf("="))&&(r=t.substring(0,n),i=t.substring(n+1)),D(r=xt(r))&&(i=!D(i)||xt(i),f.call(e,r)?z(e[r])?e[r].push(i):e[r]=[e[r],i]:e[r]=i))})),e}function Et(t){return St(t,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function St(t,e){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,e?"%20":"+")}var kt=["ng-","data-ng-","ng:","x-ng-"],At=function(e){var n=e.currentScript;if(!n)return!0;if(!(n instanceof t.HTMLScriptElement||n instanceof t.SVGScriptElement))return!1;var r=n.attributes;return[r.getNamedItem("src"),r.getNamedItem("href"),r.getNamedItem("xlink:href")].every((function(t){if(!t)return!0;if(!t.value)return!1;var n=e.createElement("a");if(n.href=t.value,e.location.origin===n.origin)return!0;switch(n.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}}))}(t.document);function Ot(e,n,r){L(r)||(r={}),r=M({strictDi:!1},r);var i=function(){if((e=s(e)).injector()){var i=e[0]===t.document?"document":wt(e);throw y("btstrpd","App already bootstrapped with this element '{0}'",i.replace(//,">"))}(n=n||[]).unshift(["$provide",function(t){t.value("$rootElement",e)}]),r.debugInfoEnabled&&n.push(["$compileProvider",function(t){t.debugInfoEnabled(!0)}]),n.unshift("ng");var o=Ye(n,r.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(t,e,n,r){t.$apply((function(){e.data("$injector",r),n(e)(t)}))}]),o},o=/^NG_ENABLE_DEBUG_INFO!/,a=/^NG_DEFER_BOOTSTRAP!/;if(t&&o.test(t.name)&&(r.debugInfoEnabled=!0,t.name=t.name.replace(o,"")),t&&!a.test(t.name))return i();t.name=t.name.replace(a,""),b.resumeBootstrap=function(t){return C(t,(function(t){n.push(t)})),i()},G(b.resumeDeferredBootstrap)&&b.resumeDeferredBootstrap()}function Mt(){t.name="NG_ENABLE_DEBUG_INFO!"+t.name,t.location.reload()}function Tt(t){var e=b.element(t).injector();if(!e)throw y("test","no injector found for element argument to getTestability");return e.get("$$testability")}var Vt=/[A-Z]/g;function Nt(t,e){return e=e||"_",t.replace(Vt,(function(t,n){return(n?e:"")+t.toLowerCase()}))}var jt=!1;function It(){he.legacyXHTMLReplacement=!0}function Rt(t,e,n){if(!t)throw y("areq","Argument '{0}' is {1}",e||"?",n||"required");return t}function Pt(t,e,n){return n&&z(t)&&(t=t[t.length-1]),Rt(G(t),e,"not a function, got "+(t&&"object"==typeof t?t.constructor.name||"Object":typeof t)),t}function Ut(t,e){if("hasOwnProperty"===t)throw y("badname","hasOwnProperty is not a valid {0} name",e)}function _t(t){for(var e,n=t[0],r=t[t.length-1],i=1;n!==r&&(n=n.nextSibling);i++)(e||t[i]!==n)&&(e||(e=s(d.call(t,0,i))),e.push(n));return e||t}function Dt(){return Object.create(null)}function Lt(t){if(null==t)return"";switch(typeof t){case"string":break;case"number":t=""+t;break;default:t=!U(t)||z(t)||B(t)?$t(t):t.toString()}return t}var qt=3;function Ft(t,e){if(z(t)){e=e||[];for(var n=0,r=t.length;n=0)return"...";n.push(e)}return e}))}(t,e):t}var Bt={full:"1.8.2",major:1,minor:8,dot:2,codeName:"meteoric-mining"};he.expando="ng339";var zt=he.cache={},Wt=1;he._data=function(t){return this.cache[t[this.expando]]||{}};var Gt=/-([a-z])/g,Kt=/^-ms-/,Jt={mouseleave:"mouseout",mouseenter:"mouseover"},Zt=o("jqLite");function Yt(t,e){return e.toUpperCase()}function Xt(t){return t.replace(Gt,Yt)}var Qt=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,te=/<|&#?\w+;/,ee=/<([\w:-]+)/,ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,re={thead:["table"],col:["colgroup","table"],tr:["tbody","table"],td:["tr","tbody","table"]};re.tbody=re.tfoot=re.colgroup=re.caption=re.thead,re.th=re.td;var ie={option:[1,'"],_default:[0,"",""]};for(var oe in re){var ae=re[oe],se=ae.slice().reverse();ie[oe]=[se.length,"<"+se.join("><")+">",""]}function ue(t){return!te.test(t)}function ce(t){var e=t.nodeType;return 1===e||!e||9===e}function le(e,n){var r,i,o,s,u,c=n.createDocumentFragment(),l=[];if(ue(e))l.push(n.createTextNode(e));else{if(r=c.appendChild(n.createElement("div")),i=(ee.exec(e)||["",""])[1].toLowerCase(),s=he.legacyXHTMLReplacement?e.replace(ne,"<$1>"):e,a<10)for(o=ie[i]||ie._default,r.innerHTML=o[1]+s+o[2],u=o[0];u--;)r=r.firstChild;else{for(u=(o=re[i]||[]).length;--u>-1;)r.appendChild(t.document.createElement(o[u])),r=r.firstChild;r.innerHTML=s}l=ft(l,r.childNodes),(r=c.firstChild).textContent=""}return c.textContent="",c.innerHTML="",C(l,(function(t){c.appendChild(t)})),c}ie.optgroup=ie.option;var fe=t.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))};function he(e){if(e instanceof he)return e;var n,r,i,o;if(F(e)&&(e=tt(e),n=!0),!(this instanceof he)){if(n&&"<"!==e.charAt(0))throw Zt("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new he(e)}n?Ee(this,(r=e,i=i||t.document,(o=Qt.exec(r))?[i.createElement(o[1])]:(o=le(r,i))?o.childNodes:[])):G(e)?Me(e):Ee(this,e)}function pe(t){return t.cloneNode(!0)}function de(t,e){!e&&ce(t)&&s.cleanData([t]),t.querySelectorAll&&s.cleanData(t.querySelectorAll("*"))}function $e(t){var e;for(e in t)return!1;return!0}function ve(t){var e=t.ng339,n=e&&zt[e],r=n&&n.events,i=n&&n.data;i&&!$e(i)||r&&!$e(r)||(delete zt[e],t.ng339=void 0)}function me(t,e,n,r){if(D(r))throw Zt("offargs","jqLite#off() does not support the `selector` argument");var i=ye(t),o=i&&i.events,a=i&&i.handle;if(a){if(e){var s=function(e){var r=o[e];D(n)&&ot(r||[],n),D(n)&&r&&r.length>0||(t.removeEventListener(e,a),delete o[e])};C(e.split(" "),(function(t){s(t),Jt[t]&&s(Jt[t])}))}else for(e in o)"$destroy"!==e&&t.removeEventListener(e,a),delete o[e];ve(t)}}function ge(t,e){var n=t.ng339,r=n&&zt[n];r&&(e?delete r.data[e]:r.data={},ve(t))}function ye(t,e){var n=t.ng339,r=n&&zt[n];return e&&!r&&(t.ng339=n=++Wt,r=zt[n]={events:{},data:{},handle:void 0}),r}function be(t,e,n){if(ce(t)){var r,i=D(n),o=!i&&e&&!L(e),a=!e,s=ye(t,!o),u=s&&s.data;if(i)u[Xt(e)]=n;else{if(a)return u;if(o)return u&&u[Xt(e)];for(r in e)u[Xt(r)]=e[r]}}}function we(t,e){return!!t.getAttribute&&(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+e+" ")>-1}function xe(t,e){if(e&&t.setAttribute){var n=(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),r=n;C(e.split(" "),(function(t){t=tt(t),r=r.replace(" "+t+" "," ")})),r!==n&&t.setAttribute("class",tt(r))}}function Ce(t,e){if(e&&t.setAttribute){var n=(" "+(t.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),r=n;C(e.split(" "),(function(t){t=tt(t),-1===r.indexOf(" "+t+" ")&&(r+=t+" ")})),r!==n&&t.setAttribute("class",tt(r))}}function Ee(t,e){if(e)if(e.nodeType)t[t.length++]=e;else{var n=e.length;if("number"==typeof n&&e.window!==e){if(n)for(var r=0;r=0?this[t]:this[this.length+t])},length:0,push:v,sort:[].sort,splice:[].splice},Ve={};C("multiple,selected,checked,disabled,readOnly,required,open".split(","),(function(t){Ve[h(t)]=t}));var Ne={};C("input,select,option,textarea,button,form,details".split(","),(function(t){Ne[t]=!0}));var je={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};function Ie(t,e){var n=Ve[e.toLowerCase()];return n&&Ne[rt(t)]&&n}function Re(t,e,n){n.call(t,e)}function Pe(t,e,n){var r=e.relatedTarget;r&&(r===t||fe.call(t,r))||n.call(t,e)}function Ue(){this.$get=function(){return M(he,{hasClass:function(t,e){return t.attr&&(t=t[0]),we(t,e)},addClass:function(t,e){return t.attr&&(t=t[0]),Ce(t,e)},removeClass:function(t,e){return t.attr&&(t=t[0]),xe(t,e)}})}}function _e(t,e){var n=t&&t.$$hashKey;if(n)return"function"==typeof n&&(n=t.$$hashKey()),n;var r=typeof t;return"function"===r||"object"===r&&null!==t?t.$$hashKey=r+":"+(e||k)():r+":"+t}C({data:be,removeData:ge,hasData:function(t){for(var e in zt[t.ng339])return!0;return!1},cleanData:function(t){for(var e=0,n=t.length;e1&&(i=Ft(i));for(var u=0;u=0?e.split(" "):[e],u=s.length,c=function(e,r,i){var s=o[e];s||((s=o[e]=[]).specialHandlerWrapper=r,"$destroy"===e||i||t.addEventListener(e,a)),s.push(n)};u--;)e=s[u],Jt[e]?(c(Jt[e],Pe),c(e,void 0,!0)):c(e)}},off:me,one:function(t,e,n){(t=s(t)).on(e,(function r(){t.off(e,n),t.off(e,r)})),t.on(e,n)},replaceWith:function(t,e){var n,r=t.parentNode;de(t),C(new he(e),(function(e){n?r.insertBefore(e,n.nextSibling):r.replaceChild(e,t),n=e}))},children:function(t){var e=[];return C(t.childNodes,(function(t){1===t.nodeType&&e.push(t)})),e},contents:function(t){return t.contentDocument||t.childNodes||[]},append:function(t,e){var n=t.nodeType;if(1===n||11===n)for(var r=0,i=(e=new he(e)).length;r/,Be=/^[^(]*\(\s*([^)]*)\)/m,ze=/,/,We=/^\s*(_?)(\S+?)\1\s*$/,Ge=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Ke=o("$injector");function Je(t){return Function.prototype.toString.call(t)}function Ze(t){var e=Je(t).replace(Ge,"");return e.match(He)||e.match(Be)}function Ye(t,e){e=!0===e;var n={},r="Provider",i=[],o=new qe,s={$provide:{provider:d($),factory:d(m),service:d((function(t,e){return m(t,["$injector",function(t){return t.instantiate(e)}])})),value:d((function(t,e){return m(t,P(e),!1)})),constant:d((function(t,e){Ut(t,"constant"),s[t]=e,l[t]=e})),decorator:function(t,e){var n=u.get(t+r),i=n.$get;n.$get=function(){var t=h.invoke(i,n);return h.invoke(e,null,{$delegate:t})}}}},u=s.$injector=y(s,(function(t,e){throw b.isString(e)&&i.push(e),Ke("unpr","Unknown provider: {0}",i.join(" <- "))})),l={},f=y(l,(function(t,e){var n=u.get(t+r,e);return h.invoke(n.$get,n,void 0,t)})),h=f;s.$injectorProvider={$get:P(f)},h.modules=u.modules=Dt();var p=g(t);return(h=f.get("$injector")).strictDi=e,C(p,(function(t){t&&h.invoke(t)})),h.loadNewModules=function(t){C(g(t),(function(t){t&&h.invoke(t)}))},h;function d(t){return function(e,n){if(!L(e))return t(e,n);C(e,S(t))}}function $(t,e){if(Ut(t,"service"),(G(e)||z(e))&&(e=u.instantiate(e)),!e.$get)throw Ke("pget","Provider '{0}' must define $get factory method.",t);return s[t+r]=e}function v(t,e){return function(){var n=h.invoke(e,this);if(_(n))throw Ke("undef","Provider '{0}' must return a value from $get factory method.",t);return n}}function m(t,e,n){return $(t,{$get:!1!==n?v(t,e):e})}function g(t){Rt(_(t)||z(t),"modulesToLoad","not an array");var e,n=[];return C(t,(function(t){if(!o.get(t)){o.set(t,!0);try{F(t)?(e=c(t),h.modules[t]=e,n=n.concat(g(e.requires)).concat(e._runBlocks),r(e._invokeQueue),r(e._configBlocks)):G(t)||z(t)?n.push(u.invoke(t)):Pt(t,"module")}catch(e){throw z(t)&&(t=t[t.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ke("modulerr","Failed to instantiate module {0} due to:\n{1}",t,e.stack||e.message||e)}}function r(t){var e,n;for(e=0,n=t.length;e1||t((function(){for(var t=0;ts&&this.remove(l.key),e},get:function(t){if(s0&&T.addClass(this.$$element,t)},$removeClass:function(t){t&&t.length>0&&T.removeClass(this.$$element,t)},$updateClass:function(t,e){var n=wn(t,e);n&&n.length&&T.addClass(this.$$element,n);var r=wn(e,t);r&&r.length&&T.removeClass(this.$$element,r)},$set:function(t,e,n,r){var i=Ie(this.$$element[0],t),o=je[t],a=t;i?(this.$$element.prop(t,e),r=i):o&&(this[o]=e,a=o),this[t]=e,r?this.$attr[t]=r:(r=this.$attr[t])||(this.$attr[t]=r=Nt(t,"-")),"img"===rt(this.$$element)&&"srcset"===t&&(this[t]=e=B(e,"$set('srcset', value)")),!1!==n&&(null===e||_(e)?this.$$element.removeAttr(r):N.test(r)?i&&!1===e?this.$$element.removeAttr(r):this.$$element.attr(r,e):function(t,e,n){P.innerHTML="";var r=P.firstChild.attributes,i=r[0];r.removeNamedItem(i.name),i.value=n,t.attributes.setNamedItem(i)}(this.$$element[0],r,e));var s=this.$$observers;s&&C(s[a],(function(t){try{t(e)}catch(t){d(t)}}))},$observe:function(t,e){var n=this,r=n.$$observers||(n.$$observers=Dt()),i=r[t]||(r[t]=[]);return i.push(e),A.$evalAsync((function(){i.$$inter||!n.hasOwnProperty(t)||_(n[t])||e(n[t])})),function(){ot(i,e)}}};var X=n.startSymbol(),Q=n.endSymbol(),et="{{"===X&&"}}"===Q?R:function(t){return t.replace(/\{\{/g,X).replace(/}}/g,Q)},nt=/^ng(Attr|Prop|On)([A-Z].*)$/,it=/^(.+)Start$/;return at.$$addBindingInfo=g?function(t,e){var n=t.data("$binding")||[];z(e)?n=n.concat(e):n.push(e),t.data("$binding",n)}:I,at.$$addBindingClass=g?function(t){J(t,"ng-binding")}:I,at.$$addScopeInfo=g?function(t,e,n,r){var i=n?r?"$isolateScopeNoTemplate":"$isolateScope":"$scope";t.data(i,e)}:I,at.$$addScopeClass=g?function(t,e){J(t,e?"ng-isolate-scope":"ng-scope")}:I,at.$$createComment=function(e,n){var r="";return g&&(r=" "+(e||"")+": ",n&&(r+=n+" ")),t.document.createComment(r)},at;function at(t,e,n,r,i){t instanceof s||(t=s(t));var o=ct(t,e,t,n,r,i);at.$$addScopeClass(t);var a=null;return function(e,n,r){if(!t)throw dn("multilink","This element has already been linked.");Rt(e,"scope"),i&&i.needsNewScope&&(e=e.$parent.$new());var u,c,l,f=(r=r||{}).parentBoundTranscludeFn,h=r.transcludeControllers,p=r.futureParentElement;if(f&&f.$$boundTransclude&&(f=f.$$boundTransclude),a||(c=(u=p)&&u[0],a=c&&"foreignobject"!==rt(c)&&m.call(c).match(/SVG/)?"svg":"html"),l="html"!==a?s(Ot(a,s("
").append(t).html())):n?Te.clone.call(t):t,h)for(var d in h)l.data("$"+d+"Controller",h[d].instance);return at.$$addScopeInfo(l,e),n&&n(l,e),o&&o(e,l,l,f),n||(t=o=null),l}}function ct(t,e,n,r,i,o){for(var u,c,l,f,h,p,d,$=[],v=z(t)||t instanceof s,m=0;m0);else r.push(t);return s(r)}function vt(t,e,n){return function(r,i,o,a,s){return i=$t(i[0],e,n),t(r,i,o,a,s)}}function mt(t,e,n,r,i,o){var a;return t?at(e,n,r,i,o):function(){return a||(a=at(e,n,r,i,o),e=n=o=null),a.apply(this,arguments)}}function gt(e,n,r,i,o,a,u,c,l){l=l||{};for(var f,h,p,$,v,m=-Number.MAX_VALUE,g=l.newScopeDirective,y=l.controllerDirectives,b=l.newIsolateScopeDirective,w=l.templateDirective,x=l.nonTlbTranscludeDirective,E=!1,S=!1,A=l.hasElementTranscludeDirective,O=r.$$element=s(n),T=a,V=i,N=!1,j=!1,I=0,R=e.length;If.priority)break;if((v=f.scope)&&(f.templateUrl||(L(v)?(At("new/isolated scope",b||g,f,O),b=f):At("new/isolated scope",b,f,O)),g=g||f),h=f.name,!N&&(f.replace&&(f.templateUrl||f.template)||f.transclude&&!f.$$tlb)){for(var D,q=I+1;D=e[q++];)if(D.transclude&&!D.$$tlb||D.replace&&(D.templateUrl||D.template)){j=!0;break}N=!0}if(!f.templateUrl&&f.controller&&(y=y||Dt(),At("'"+h+"' controller",y[h],f,O),y[h]=f),v=f.transclude)if(E=!0,f.$$tlb||(At("transclusion",x,f,O),x=f),"element"===v)A=!0,m=f.priority,p=O,O=r.$$element=s(at.$$createComment(h,r[h])),n=O[0],It(o,ht(p),n),V=mt(j,p,i,m,T&&T.name,{nonTlbTranscludeDirective:x});else{var F=Dt();if(L(v)){p=t.document.createDocumentFragment();var H=Dt(),B=Dt();for(var W in C(v,(function(t,e){var n="?"===t.charAt(0);t=n?t.substring(1):t,H[t]=e,F[e]=null,B[e]=n})),C(O.contents(),(function(e){var n=H[bn(rt(e))];n?(B[n]=!0,F[n]=F[n]||t.document.createDocumentFragment(),F[n].appendChild(e)):p.appendChild(e)})),C(B,(function(t,e){if(!t)throw dn("reqslot","Required transclusion slot `{0}` was not filled.",e)})),F)if(F[W]){var J=s(F[W].childNodes);F[W]=mt(j,J,i)}p=s(p.childNodes)}else p=s(pe(n)).contents();O.empty(),(V=mt(j,p,i,void 0,void 0,{needsNewScope:f.$$isolateScope||f.$$newScope})).$$slots=F}if(f.template)if(S=!0,At("template",w,f,O),w=f,v=G(f.template)?f.template(O,r):f.template,v=et(v),f.replace){if(T=f,p=ue(v)?[]:xn(Ot(f.templateNamespace,tt(v))),n=p[0],1!==p.length||1!==n.nodeType)throw dn("tplrt","Template for directive '{0}' must have exactly one root element. {1}",h,"");It(o,O,n);var Y={$attr:{}},X=dt(n,[],Y),Q=e.splice(I+1,e.length-(I+1));(b||g)&&bt(X,b,g),e=e.concat(X).concat(Q),Et(r,Y),R=e.length}else O.html(v);if(f.templateUrl)S=!0,At("template",w,f,O),w=f,f.replace&&(T=f),ot=St(e.splice(I,e.length-I),O,r,o,E&&V,u,c,{controllerDirectives:y,newScopeDirective:g!==f&&g,newIsolateScopeDirective:b,templateDirective:w,nonTlbTranscludeDirective:x}),R=e.length;else if(f.compile)try{$=f.compile(O,r,V);var nt=f.$$originalDirective||f;G($)?it(null,pt(nt,$),P,U):$&&it(pt(nt,$.pre),pt(nt,$.post),P,U)}catch(t){d(t,wt(O))}f.terminal&&(ot.terminal=!0,m=Math.max(m,f.priority))}return ot.scope=g&&!0===g.scope,ot.transcludeOnThisElement=E,ot.templateOnThisElement=S,ot.transclude=V,l.hasElementTranscludeDirective=A,ot;function it(t,e,n,r){t&&(n&&(t=vt(t,n,r)),t.require=f.require,t.directiveName=h,(b===f||f.$$isolateScope)&&(t=Pt(t,{isolateScope:!0})),u.push(t)),e&&(n&&(e=vt(e,n,r)),e.require=f.require,e.directiveName=h,(b===f||f.$$isolateScope)&&(e=Pt(e,{isolateScope:!0})),c.push(e))}function ot(t,e,i,o,a){var l,f,h,p,$,v,m,x,E,S;for(var O in n===i?(E=r,x=r.$$element):E=new K(x=s(i),r),$=e,b?p=e.$new(!0):g&&($=e.$parent),a&&((m=function(t,e,n,r){var i;if(Z(t)||(r=n,n=e,e=t,t=void 0),A&&(i=v),n||(n=A?x.parent():x),!r)return a(t,e,i,n,j);var o=a.$$slots[r];if(o)return o(t,e,i,n,j);if(_(o))throw dn("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',r,wt(x))}).$$boundTransclude=a,m.isSlotFilled=function(t){return!!a.$$slots[t]}),y&&(v=function(t,e,n,r,i,o,a){var s=Dt();for(var u in r){var c=r[u],l={$scope:c===a||c.$$isolateScope?i:o,$element:t,$attrs:e,$transclude:n},f=c.controller;"@"===f&&(f=e[c.name]);var h=k(f,l,!0,c.controllerAs);s[c.name]=h,t.data("$"+c.name+"Controller",h.instance)}return s}(x,E,m,y,p,e,b)),b&&(at.$$addScopeInfo(x,p,!0,!(w&&(w===b||w===b.$$originalDirective))),at.$$addScopeClass(x,!0),p.$$isolateBindings=b.$$isolateBindings,(S=Lt(e,E,p,p.$$isolateBindings,b)).removeWatches&&p.$on("$destroy",S.removeWatches)),v){var T=y[O],V=v[O],N=T.$$bindings.bindToController;V.instance=V(),x.data("$"+T.name+"Controller",V.instance),V.bindingInfo=Lt($,E,V.instance,N,T)}for(C(y,(function(t,e){var n=t.require;t.bindToController&&!z(n)&&L(n)&&M(v[e].instance,yt(e,n,x,v))})),C(v,(function(t){var e=t.instance;if(G(e.$onChanges))try{e.$onChanges(t.bindingInfo.initialChanges)}catch(t){d(t)}if(G(e.$onInit))try{e.$onInit()}catch(t){d(t)}G(e.$doCheck)&&($.$watch((function(){e.$doCheck()})),e.$doCheck()),G(e.$onDestroy)&&$.$on("$destroy",(function(){e.$onDestroy()}))})),l=0,f=u.length;l=0;l--)Ut(h=c[l],h.isolateScope?p:e,x,E,h.require&&yt(h.directiveName,h.require,x,v),m);C(v,(function(t){var e=t.instance;G(e.$postLink)&&e.$postLink()}))}}function yt(t,e,n,r){var i;if(F(e)){var o=e.match(l),a=e.substring(o[0].length),s=o[1]||o[3],u="?"===o[2];if("^^"===s?n=n.parent():i=(i=r&&r[a])&&i.instance,!i){var c="$"+a+"Controller";i="^^"===s&&n[0]&&9===n[0].nodeType?null:s?n.inheritedData(c):n.data(c)}if(!i&&!u)throw dn("ctreq","Controller '{0}', required by directive '{1}', can't be found!",a,t)}else if(z(e)){i=[];for(var f=0,h=e.length;ff.priority)&&-1!==f.restrict.indexOf(o)){if(u&&(f=j(f,{$$start:u,$$end:c})),!f.$$bindings){var $=f.$$bindings=v(f,f.name);L($.isolateScope)&&(f.$$isolateBindings=$.isolateScope)}t.push(f),l=f}return l}function Ct(t){if(r.hasOwnProperty(t))for(var n=e.get(t+i),o=0,a=n.length;o"+n+"",r.childNodes[0].childNodes;default:return n}}function Mt(t){return B(O.valueOf(t),"ng-prop-srcset")}function Tt(t,e,n,r){if(p.test(r))throw dn("nodomevents","Property bindings for HTML DOM event properties are disallowed");var i=rt(t),o=function(t,e){var n=e.toLowerCase();return E[t+"|"+n]||E["*|"+n]}(i,r),a=R;"srcset"!==r||"img"!==i&&"source"!==i?o&&(a=O.getTrusted.bind(O,o)):a=Mt,e.push({priority:100,compile:function(t,e){var i=S(e[n]),o=S(e[n],(function(t){return O.valueOf(t)}));return{pre:function(t,e){function n(){var n=i(t);e[0][r]=a(n)}n(),t.$watch(o,n)}}}})}function Vt(t,e,n){t.push(Io(S,A,d,e,n,!1))}function jt(t,e,r,i,o){var a=rt(t),s=function(t,e){return"srcdoc"===e?O.HTML:"src"===e||"ngSrc"===e?-1===["img","video","audio","source","track"].indexOf(t)?O.RESOURCE_URL:O.MEDIA_URL:"xlinkHref"===e?"image"===t?O.MEDIA_URL:"a"===t?O.URL:O.RESOURCE_URL:"form"===t&&"action"===e||"base"===t&&"href"===e||"link"===t&&"href"===e?O.RESOURCE_URL:"a"!==t||"href"!==e&&"ngHref"!==e?void 0:O.URL}(a,i),u=!o,l=c[i]||o,f=n(r,u,s,l);if(f){if("multiple"===i&&"select"===a)throw dn("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",wt(t));if(p.test(i))throw dn("nodomevents","Interpolations for HTML DOM event attributes are disallowed");e.push({priority:100,compile:function(){return{pre:function(t,e,o){var a=o.$$observers||(o.$$observers=Dt()),u=o[i];u!==r&&(f=u&&n(u,!0,s,l),r=u),f&&(o[i]=f(t),(a[i]||(a[i]=[])).$$inter=!0,(o.$$observers&&o.$$observers[i].$$scope||t).$watch(f,(function(t,e){"class"===i&&t!==e?o.$updateClass(t,e):o.$set(i,t)})))}}}})}}function It(e,n,r){var i,o,a=n[0],u=n.length,c=a.parentNode;if(e)for(i=0,o=e.length;i0?" ":"")+a}return n}function xn(t){var e=(t=s(t)).length;if(e<=1)return t;for(;e--;){var n=t[e];(8===n.nodeType||n.nodeType===qt&&""===n.nodeValue.trim())&&$.call(t,e,1)}return t}var Cn=o("$controller"),En=/^(\S+)(\s+as\s+([\w$]+))?$/;function Sn(t,e){if(e&&F(e))return e;if(F(t)){var n=En.exec(t);if(n)return n[3]}}function kn(){var t={};this.has=function(e){return t.hasOwnProperty(e)},this.register=function(e,n){Ut(e,"controller"),L(e)?M(t,e):t[e]=n},this.$get=["$injector",function(e){return function(r,i,o,a){var s,u,c,l;if(o=!0===o,a&&F(a)&&(l=a),F(r)){if(!(u=r.match(En)))throw Cn("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",r);if(c=u[1],l=l||u[3],!(r=t.hasOwnProperty(c)?t[c]:function(t,e,n){if(!e)return t;for(var r,i=e.split("."),o=i.length,a=0;a0&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}(m,n.paramSerializer(n.params)),v&&(m=function(t,e){var n=t.split("?");if(n.length>2)throw Rn("badjsonp",'Illegal use more than one "?", in url, "{1}"',t);return C(Ct(n[1]),(function(n,r){if("JSON_CALLBACK"===n)throw Rn("badjsonp",'Illegal use of JSON_CALLBACK in url, "{0}"',t);if(r===e)throw Rn("badjsonp",'Illegal use of callback param, "{0}", in url, "{1}"',e,t)})),t+=(-1===t.indexOf("?")?"?":"&")+e+"=JSON_CALLBACK"}(m,n.jsonpCallbackParam)),y.pendingRequests.push(n),f.then(S,S),!n.cache&&!t.cache||!1===n.cache||"GET"!==n.method&&"JSONP"!==n.method||(i=L(n.cache)?n.cache:L(t.cache)?t.cache:$),i&&(D(o=i.get(m))?X(o)?o.then(E,E):z(o)?x(o[1],o[0],Ft(o[2]),o[3],o[4]):x(o,200,{},"OK","complete"):i.put(m,f)),_(o)){var b=g(n.url)?s()[n.xsrfCookieName||t.xsrfCookieName]:void 0;b&&(p[n.xsrfHeaderName||t.xsrfHeaderName]=b),a(n.method,m,r,(function(t,n,r,o,a){function s(){x(n,t,r,o,a)}i&&(Hn(t)?i.put(m,[t,n,Ln(r),o,a]):i.remove(m)),e?c.$applyAsync(s):(s(),c.$$phase||c.$apply())}),p,n.timeout,n.withCredentials,n.responseType,w(n.eventHandlers),w(n.uploadEventHandlers))}return f;function w(t){if(t){var n={};return C(t,(function(t,r){n[r]=function(n){function r(){t(n)}e?c.$applyAsync(r):c.$$phase?r():c.$apply(r)}})),n}}function x(t,e,r,i,o){(Hn(e=e>=-1?e:0)?u.resolve:u.reject)({data:t,status:e,headers:qn(r),config:n,statusText:i,xhrStatus:o})}function E(t){x(t.data,t.status,Ft(t.headers()),t.statusText,t.xhrStatus)}function S(){var t=y.pendingRequests.indexOf(n);-1!==t&&y.pendingRequests.splice(t,1)}}(n,i).then(x,x)})),m)).finally((function(){i.$$completeOutstandingRequest(I,"$http")}));function w(t,e){for(var n=0,r=e.length;n0)var b=n((function(){w("timeout")}),l);else X(l)&&l.then((function(){w(D(l.$$timeoutId)?"timeout":"abort")}));function w(t){y="timeout"===t,m&&m(),g&&g.abort()}function x(t,e,r,i,o,a){D(b)&&n.cancel(b),m=g=null,t(e,r,i,o,a)}}}(t,r,t.defer,e,n[0])}]}var Gn=b.$interpolateMinErr=o("$interpolate");function Kn(){var t="{{",e="}}";this.startSymbol=function(e){return e?(t=e,this):t},this.endSymbol=function(t){return t?(e=t,this):e},this.$get=["$parse","$exceptionHandler","$sce",function(n,r,i){var o=t.length,a=e.length,s=new RegExp(t.replace(/./g,c),"g"),u=new RegExp(e.replace(/./g,c),"g");function c(t){return"\\\\\\"+t}function l(n){return n.replace(s,t).replace(u,e)}function f(t,e,n,r){var i=t.$watch((function(t){return i(),r(t)}),e,n);return i}function h(s,u,c,h){var p=c===i.URL||c===i.MEDIA_URL;if(!s.length||-1===s.indexOf(t)){if(u)return;var d=l(s);p&&(d=i.getTrusted(c,d));var $=P(d);return $.exp=s,$.expressions=[],$.$$watchDelegate=f,$}h=!!h;for(var v,m,g,y,b,w=0,x=[],C=s.length,E=[],S=[];w1&&Gn.throwNoconcat(s),E.join(""))};return M((function(t){var e=0,n=x.length,i=new Array(n);try{for(;e4,f=l?ht(arguments,4):[],h=0,p=D(c)&&!c,d=(p?n:e).defer(),$=d.promise;function v(){l?a.apply(null,f):a(h)}function m(){p?t.defer(v):r.$evalAsync(v),d.notify(h++),u>0&&h>=u&&(d.resolve(h),o($.$$intervalId)),p||r.$apply()}return u=D(u)?u:0,$.$$intervalId=i(m,s,d,p),$}}}]}var Xn=function(){this.$get=function(){var t=b.callbacks,e={};return{createCallback:function(n){var r="_"+(t.$$counter++).toString(36),i="angular.callbacks."+r,o=function(t){var e=function(t){e.data=t,e.called=!0};return e.id=t,e}(r);return e[i]=t[r]=o,i},wasCalled:function(t){return e[t].called},getResponse:function(t){return e[t].data},removeCallback:function(n){var r=e[n];delete t[r.id],delete e[n]}}}},Qn=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,tr={http:80,https:443,ftp:21},er=o("$location");function nr(t,e){var n=ui(t);e.$$protocol=n.protocol,e.$$host=n.hostname,e.$$port=V(n.port)||tr[n.protocol]||null}var rr=/^\s*[\\/]{2,}/;function ir(t,e,n){if(rr.test(t))throw er("badpath",'Invalid url "{0}".',t);var r="/"!==t.charAt(0);r&&(t="/"+t);var i=ui(t),o=r&&"/"===i.pathname.charAt(0)?i.pathname.substring(1):i.pathname;e.$$path=function(t,e){for(var n=t.split("/"),r=n.length;r--;)n[r]=decodeURIComponent(n[r]),e&&(n[r]=n[r].replace(/\//g,"%2F"));return n.join("/")}(o,n),e.$$search=Ct(i.search),e.$$hash=decodeURIComponent(i.hash),e.$$path&&"/"!==e.$$path.charAt(0)&&(e.$$path="/"+e.$$path)}function or(t,e){return t.slice(0,e.length)===e}function ar(t,e){if(or(e,t))return e.substr(t.length)}function sr(t){var e=t.indexOf("#");return-1===e?t:t.substr(0,e)}function ur(t,e,n){this.$$html5=!0,n=n||"",nr(t,this),this.$$parse=function(t){var n=ar(e,t);if(!F(n))throw er("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',t,e);ir(n,this,!0),this.$$path||(this.$$path="/"),this.$$compose()},this.$$normalizeUrl=function(t){return e+t.substr(1)},this.$$parseLinkUrl=function(r,i){return i&&"#"===i[0]?(this.hash(i.slice(1)),!0):(D(o=ar(t,r))?(a=o,s=n&&D(o=ar(n,o))?e+(ar("/",o)||o):t+a):D(o=ar(e,r))?s=e+o:e===r+"/"&&(s=e),s&&this.$$parse(s),!!s);var o,a,s}}function cr(t,e,n){nr(t,this),this.$$parse=function(r){var i,o=ar(t,r)||ar(e,r);_(o)||"#"!==o.charAt(0)?this.$$html5?i=o:(i="",_(o)&&(t=r,this.replace())):_(i=ar(n,o))&&(i=o),ir(i,this,!1),this.$$path=function(t,e,n){var r,i=/^\/[A-Z]:(\/.*)/;return or(e,n)&&(e=e.replace(n,"")),i.exec(e)?t:(r=i.exec(t))?r[1]:t}(this.$$path,i,t),this.$$compose()},this.$$normalizeUrl=function(e){return t+(e?n+e:"")},this.$$parseLinkUrl=function(e,n){return sr(t)===sr(e)&&(this.$$parse(e),!0)}}function lr(t,e,n){this.$$html5=!0,cr.apply(this,arguments),this.$$parseLinkUrl=function(r,i){return i&&"#"===i[0]?(this.hash(i.slice(1)),!0):(t===sr(r)?o=r:(a=ar(e,r))?o=t+n+a:e===r+"/"&&(o=e),o&&this.$$parse(o),!!o);var o,a},this.$$normalizeUrl=function(e){return t+n+e}}var fr={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){var t,e,n,r,i,o;this.$$url=(t=this.$$path,e=this.$$search,n=this.$$hash,r=[],C(e,(function(t,e){z(t)?C(t,(function(t){r.push(St(e,!0)+(!0===t?"":"="+St(t,!0)))})):r.push(St(e,!0)+(!0===t?"":"="+St(t,!0)))})),i=r.length?r.join("&"):"",o=n?"#"+Et(n):"",function(t){for(var e=t.split("/"),n=e.length;n--;)e[n]=Et(e[n].replace(/%2F/g,"/"));return e.join("/")}(t)+(i?"?"+i:"")+o),this.$$absUrl=this.$$normalizeUrl(this.$$url),this.$$urlUpdatedByLocation=!0},absUrl:hr("$$absUrl"),url:function(t){if(_(t))return this.$$url;var e=Qn.exec(t);return(e[1]||""===t)&&this.path(decodeURIComponent(e[1])),(e[2]||e[1]||""===t)&&this.search(e[3]||""),this.hash(e[5]||""),this},protocol:hr("$$protocol"),host:hr("$$host"),port:hr("$$port"),path:pr("$$path",(function(t){return"/"===(t=null!==t?t.toString():"").charAt(0)?t:"/"+t})),search:function(t,e){switch(arguments.length){case 0:return this.$$search;case 1:if(F(t)||H(t))t=t.toString(),this.$$search=Ct(t);else{if(!L(t))throw er("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");C(t=at(t,{}),(function(e,n){null==e&&delete t[n]})),this.$$search=t}break;default:_(e)||null===e?delete this.$$search[t]:this.$$search[t]=e}return this.$$compose(),this},hash:pr("$$hash",(function(t){return null!==t?t.toString():""})),replace:function(){return this.$$replace=!0,this}};function hr(t){return function(){return this[t]}}function pr(t,e){return function(n){return _(n)?this[t]:(this[t]=e(n),this.$$compose(),this)}}function dr(){var t="!",e={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(e){return D(e)?(t=e,this):t},this.html5Mode=function(t){return Y(t)?(e.enabled=t,this):L(t)?(Y(t.enabled)&&(e.enabled=t.enabled),Y(t.requireBase)&&(e.requireBase=t.requireBase),(Y(t.rewriteLinks)||F(t.rewriteLinks))&&(e.rewriteLinks=t.rewriteLinks),this):e},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(n,r,i,o,a){var u,c,l,f,h=r.baseHref(),p=r.url();if(e.enabled){if(!h&&e.requireBase)throw er("nobase","$location in HTML5 mode requires a tag to be present!");l=(f=p).substring(0,f.indexOf("/",f.indexOf("//")+2))+(h||"/"),c=i.history?ur:lr}else l=sr(p),c=cr;var d=function(t){return t.substr(0,sr(t).lastIndexOf("/")+1)}(l);(u=new c(l,d,"#"+t)).$$parseLinkUrl(p,p),u.$$state=r.state();var $=/^\s*(javascript|mailto):/i;function v(t,e,n){var i=u.url(),o=u.$$state;try{r.url(t,e,n),u.$$state=r.state()}catch(t){throw u.url(i),u.$$state=o,t}}o.on("click",(function(t){var i=e.rewriteLinks;if(i&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&2!==t.which&&2!==t.button){for(var a=s(t.target);"a"!==rt(a[0]);)if(a[0]===o[0]||!(a=a.parent())[0])return;if(!F(i)||!_(a.attr(i))){var c=a.prop("href"),l=a.attr("href")||a.attr("xlink:href");L(c)&&"[object SVGAnimatedString]"===c.toString()&&(c=ui(c.animVal).href),$.test(c)||!c||a.attr("target")||t.isDefaultPrevented()||u.$$parseLinkUrl(c,l)&&(t.preventDefault(),u.absUrl()!==r.url()&&n.$apply())}}})),u.absUrl()!==p&&r.url(u.absUrl(),!0);var m=!0;return r.onUrlChange((function(t,e){or(t,d)?(n.$evalAsync((function(){var r,i=u.absUrl(),o=u.$$state;u.$$parse(t),u.$$state=e,r=n.$broadcast("$locationChangeStart",t,i,e,o).defaultPrevented,u.absUrl()===t&&(r?(u.$$parse(i),u.$$state=o,v(i,!1,o)):(m=!1,g(i,o)))})),n.$$phase||n.$digest()):a.location.href=t})),n.$watch((function(){if(m||u.$$urlUpdatedByLocation){u.$$urlUpdatedByLocation=!1;var t=r.url(),e=u.absUrl(),o=r.state(),a=u.$$replace,s=!((c=t)===(l=e)||ui(c).href===ui(l).href)||u.$$html5&&i.history&&o!==u.$$state;(m||s)&&(m=!1,n.$evalAsync((function(){var e=u.absUrl(),r=n.$broadcast("$locationChangeStart",e,t,u.$$state,o).defaultPrevented;u.absUrl()===e&&(r?(u.$$parse(t),u.$$state=o):(s&&v(e,a,o===u.$$state?null:u.$$state),g(t,o)))})))}var c,l;u.$$replace=!1})),u;function g(t,e){n.$broadcast("$locationChangeSuccess",u.absUrl(),t,u.$$state,e)}}]}function $r(){var t=!0,e=this;this.debugEnabled=function(e){return D(e)?(t=e,this):t},this.$get=["$window",function(n){var r,i=a||/\bEdge\//.test(n.navigator&&n.navigator.userAgent);return{log:s("log"),info:s("info"),warn:s("warn"),error:s("error"),debug:(r=s("debug"),function(){t&&r.apply(e,arguments)})};function o(t){return W(t)&&(t.stack&&i?t=t.message&&-1===t.stack.indexOf(t.message)?"Error: "+t.message+"\n"+t.stack:t.stack:t.sourceURL&&(t=t.message+"\n"+t.sourceURL+":"+t.line)),t}function s(t){var e=n.console||{},r=e[t]||e.log||I;return function(){var t=[];return C(arguments,(function(e){t.push(o(e))})),Function.prototype.apply.call(r,e,t)}}}]}C([lr,cr,ur],(function(t){t.prototype=Object.create(fr),t.prototype.state=function(e){if(!arguments.length)return this.$$state;if(t!==ur||!this.$$html5)throw er("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=_(e)?null:e,this.$$urlUpdatedByLocation=!0,this}}));var vr=o("$parse"),mr={}.constructor.prototype.valueOf;function gr(t){return t+""}var yr=Dt();C("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),(function(t){yr[t]=!0}));var br={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},wr=function(t){this.options=t};wr.prototype={constructor:wr,lex:function(t){for(this.text=t,this.index=0,this.tokens=[];this.index=55296&&n<=56319&&r>=56320&&r<=57343?t+e:t},isExpOperator:function(t){return"-"===t||"+"===t||this.isNumber(t)},throwError:function(t,e,n){n=n||this.index;var r=D(e)?"s "+e+"-"+this.index+" ["+this.text.substring(e,n)+"]":" "+n;throw vr("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",t,r,this.text)},readNumber:function(){for(var t="",e=this.index;this.index0&&f(this.$$state),r},catch:function(t){return this.then(null,t)},finally:function(t,e){return this.then((function(e){return g(e,b,t)}),(function(e){return g(e,m,t)}),e)}});var b=y;function w(t){if(!G(t))throw r("norslvr","Expected resolverFn, got '{0}'",t);var e=new c;return t((function(t){h(e,t)}),(function(t){d(e,t)})),e}return w.prototype=c.prototype,w.defer=s,w.reject=m,w.when=y,w.resolve=b,w.all=function(t){var e=new c,n=0,r=z(t)?[]:{};return C(t,(function(t,i){n++,y(t).then((function(t){r[i]=t,--n||h(e,r)}),(function(t){d(e,t)}))})),0===n&&h(e,r),e},w.race=function(t){var e=s();return C(t,(function(t){y(t).then(e.resolve,e.reject)})),e.promise},w}function Ur(t){return!!t.pur}function _r(t){t.pur=!0}function Dr(t){t.$$state&&_r(t.$$state)}function Lr(){this.$get=["$window","$timeout",function(t,e){var n=t.requestAnimationFrame||t.webkitRequestAnimationFrame,r=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.webkitCancelRequestAnimationFrame,i=!!n,o=i?function(t){var e=n(t);return function(){r(e)}}:function(t){var n=e(t,16.66,!1);return function(){e.cancel(n)}};return o.supported=i,o}]}function qr(){var t=10,e=o("$rootScope"),n=null,r=null;this.digestTtl=function(e){return arguments.length&&(t=e),t},this.$get=["$exceptionHandler","$parse","$browser",function(i,o,s){function u(t){t.currentScope.$$destroyed=!0}function c(t){9===a&&(t.$$childHead&&c(t.$$childHead),t.$$nextSibling&&c(t.$$nextSibling)),t.$parent=t.$$nextSibling=t.$$prevSibling=t.$$childHead=t.$$childTail=t.$root=t.$$watchers=null}function l(){this.$id=k(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$suspended=!1,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$$isolateBindings=null}l.prototype={constructor:l,$new:function(t,e){var n;return e=e||this,t?(n=new l).$root=this.$root:(this.$$ChildScope||(this.$$ChildScope=function(t){function e(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=k(),this.$$ChildScope=null,this.$$suspended=!1}return e.prototype=t,e}(this)),n=new this.$$ChildScope),n.$parent=e,n.$$prevSibling=e.$$childTail,e.$$childHead?(e.$$childTail.$$nextSibling=n,e.$$childTail=n):e.$$childHead=e.$$childTail=n,(t||e!==this)&&n.$on("$destroy",u),n},$watch:function(t,e,r,i){var a=o(t),s=G(e)?e:I;if(a.$$watchDelegate)return a.$$watchDelegate(this,s,r,a,t);var u=this,c=u.$$watchers,l={fn:s,last:w,get:a,exp:i||t,eq:!!r};return n=null,c||((c=u.$$watchers=[]).$$digestWatchIndex=-1),c.unshift(l),c.$$digestWatchIndex++,y(this,1),function(){var t=ot(c,l);t>=0&&(y(u,-1),t1,u=0,c=o(t,$),l=[],h={},p=!0,d=0;function $(t){var e,i,o,a;if(!_(n=t)){if(L(n))if(x(n)){r!==l&&(d=(r=l).length=0,u++),e=n.length,d!==e&&(u++,r.length=d=e);for(var s=0;se)for(i in u++,r)f.call(n,i)||(d--,delete r[i])}else r!==n&&(r=n,u++);return u}}return this.$watch(c,(function(){if(p?(p=!1,e(n,n,a)):e(n,i,a),s)if(L(n))if(x(n)){i=new Array(n.length);for(var t=0;t0&&!this.peek("}",")",";","]")&&t.push(this.expressionStatement()),!this.expect(";"))return{type:xr.Program,body:t}},expressionStatement:function(){return{type:xr.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var t=this.expression();this.expect("|");)t=this.filter(t);return t},expression:function(){return this.assignment()},assignment:function(){var t=this.ternary();if(this.expect("=")){if(!Ar(t))throw vr("lval","Trying to assign a value to a non l-value");t={type:xr.AssignmentExpression,left:t,right:this.assignment(),operator:"="}}return t},ternary:function(){var t,e,n=this.logicalOR();return this.expect("?")&&(t=this.expression(),this.consume(":"))?(e=this.expression(),{type:xr.ConditionalExpression,test:n,alternate:t,consequent:e}):n},logicalOR:function(){for(var t=this.logicalAND();this.expect("||");)t={type:xr.LogicalExpression,operator:"||",left:t,right:this.logicalAND()};return t},logicalAND:function(){for(var t=this.equality();this.expect("&&");)t={type:xr.LogicalExpression,operator:"&&",left:t,right:this.equality()};return t},equality:function(){for(var t,e=this.relational();t=this.expect("==","!=","===","!==");)e={type:xr.BinaryExpression,operator:t.text,left:e,right:this.relational()};return e},relational:function(){for(var t,e=this.additive();t=this.expect("<",">","<=",">=");)e={type:xr.BinaryExpression,operator:t.text,left:e,right:this.additive()};return e},additive:function(){for(var t,e=this.multiplicative();t=this.expect("+","-");)e={type:xr.BinaryExpression,operator:t.text,left:e,right:this.multiplicative()};return e},multiplicative:function(){for(var t,e=this.unary();t=this.expect("*","/","%");)e={type:xr.BinaryExpression,operator:t.text,left:e,right:this.unary()};return e},unary:function(){var t;return(t=this.expect("+","-","!"))?{type:xr.UnaryExpression,operator:t.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var t,e;for(this.expect("(")?(t=this.filterChain(),this.consume(")")):this.expect("[")?t=this.arrayDeclaration():this.expect("{")?t=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?t=at(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?t={type:xr.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?t=this.identifier():this.peek().constant?t=this.constant():this.throwError("not a primary expression",this.peek());e=this.expect("(","[",".");)"("===e.text?(t={type:xr.CallExpression,callee:t,arguments:this.parseArguments()},this.consume(")")):"["===e.text?(t={type:xr.MemberExpression,object:t,property:this.expression(),computed:!0},this.consume("]")):"."===e.text?t={type:xr.MemberExpression,object:t,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return t},filter:function(t){for(var e=[t],n={type:xr.CallExpression,callee:this.identifier(),arguments:e,filter:!0};this.expect(":");)e.push(this.expression());return n},parseArguments:function(){var t=[];if(")"!==this.peekToken().text)do{t.push(this.filterChain())}while(this.expect(","));return t},identifier:function(){var t=this.consume();return t.identifier||this.throwError("is not a valid identifier",t),{type:xr.Identifier,name:t.text}},constant:function(){return{type:xr.Literal,value:this.consume().value}},arrayDeclaration:function(){var t=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;t.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:xr.ArrayExpression,elements:t}},object:function(){var t,e=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;t={type:xr.Property,kind:"init"},this.peek().constant?(t.key=this.constant(),t.computed=!1,this.consume(":"),t.value=this.expression()):this.peek().identifier?(t.key=this.identifier(),t.computed=!1,this.peek(":")?(this.consume(":"),t.value=this.expression()):t.value=t.key):this.peek("[")?(this.consume("["),t.key=this.expression(),this.consume("]"),t.computed=!0,this.consume(":"),t.value=this.expression()):this.throwError("invalid key",this.peek()),e.push(t)}while(this.expect(","));return this.consume("}"),{type:xr.ObjectExpression,properties:e}},throwError:function(t,e){throw vr("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",e.text,t,e.index+1,this.text,this.text.substring(e.index))},consume:function(t){if(0===this.tokens.length)throw vr("ueoe","Unexpected end of expression: {0}",this.text);var e=this.expect(t);return e||this.throwError("is unexpected, expecting ["+t+"]",this.peek()),e},peekToken:function(){if(0===this.tokens.length)throw vr("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(t,e,n,r){return this.peekAhead(0,t,e,n,r)},peekAhead:function(t,e,n,r,i){if(this.tokens.length>t){var o=this.tokens[t],a=o.text;if(a===e||a===n||a===r||a===i||!e&&!n&&!r&&!i)return o}return!1},expect:function(t,e,n,r){var i=this.peek(t,e,n,r);return!!i&&(this.tokens.shift(),i)},selfReferential:{this:{type:xr.ThisExpression},$locals:{type:xr.LocalsExpression}}},Mr.prototype={compile:function(t){var e=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},Sr(t,e.$filter);var n,r="";if(this.stage="assign",n=Or(t)){this.state.computing="assign";var i=this.nextId();this.recurse(n,i),this.return_(i),r="fn.assign="+this.generateFunction("assign","s,v,l")}var o=kr(t.body);e.stage="inputs",C(o,(function(t,n){var r="fn"+n;e.state[r]={vars:[],body:[],own:{}},e.state.computing=r;var i=e.nextId();e.recurse(t,i),e.return_(i),e.state.inputs.push({name:r,isPure:t.isPure}),t.watchId=n})),this.state.computing="fn",this.stage="main",this.recurse(t);var a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+r+this.watchFns()+"return fn;",s=new Function("$filter","getStringValue","ifDefined","plus",a)(this.$filter,gr,Cr,Er);return this.state=this.stage=void 0,s},USE:"use",STRICT:"strict",watchFns:function(){var t=[],e=this.state.inputs,n=this;return C(e,(function(e){t.push("var "+e.name+"="+n.generateFunction(e.name,"s")),e.isPure&&t.push(e.name,".isPure="+JSON.stringify(e.isPure)+";")})),e.length&&t.push("fn.inputs=["+e.map((function(t){return t.name})).join(",")+"];"),t.join("")},generateFunction:function(t,e){return"function("+e+"){"+this.varsPrefix(t)+this.body(t)+"};"},filterPrefix:function(){var t=[],e=this;return C(this.state.filters,(function(n,r){t.push(n+"=$filter("+e.escape(r)+")")})),t.length?"var "+t.join(",")+";":""},varsPrefix:function(t){return this.state[t].vars.length?"var "+this.state[t].vars.join(",")+";":""},body:function(t){return this.state[t].body.join("")},recurse:function(t,e,n,r,i,o){var a,s,u,c,l,f=this;if(r=r||I,!o&&D(t.watchId))return e=e||this.nextId(),void this.if_("i",this.lazyAssign(e,this.computedMember("i",t.watchId)),this.lazyRecurse(t,e,n,r,i,!0));switch(t.type){case xr.Program:C(t.body,(function(e,n){f.recurse(e.expression,void 0,void 0,(function(t){s=t})),n!==t.body.length-1?f.current().body.push(s,";"):f.return_(s)}));break;case xr.Literal:c=this.escape(t.value),this.assign(e,c),r(e||c);break;case xr.UnaryExpression:this.recurse(t.argument,void 0,void 0,(function(t){s=t})),c=t.operator+"("+this.ifDefined(s,0)+")",this.assign(e,c),r(c);break;case xr.BinaryExpression:this.recurse(t.left,void 0,void 0,(function(t){a=t})),this.recurse(t.right,void 0,void 0,(function(t){s=t})),c="+"===t.operator?this.plus(a,s):"-"===t.operator?this.ifDefined(a,0)+t.operator+this.ifDefined(s,0):"("+a+")"+t.operator+"("+s+")",this.assign(e,c),r(c);break;case xr.LogicalExpression:e=e||this.nextId(),f.recurse(t.left,e),f.if_("&&"===t.operator?e:f.not(e),f.lazyRecurse(t.right,e)),r(e);break;case xr.ConditionalExpression:e=e||this.nextId(),f.recurse(t.test,e),f.if_(e,f.lazyRecurse(t.alternate,e),f.lazyRecurse(t.consequent,e)),r(e);break;case xr.Identifier:e=e||this.nextId(),n&&(n.context="inputs"===f.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",t.name)+"?l:s"),n.computed=!1,n.name=t.name),f.if_("inputs"===f.stage||f.not(f.getHasOwnProperty("l",t.name)),(function(){f.if_("inputs"===f.stage||"s",(function(){i&&1!==i&&f.if_(f.isNull(f.nonComputedMember("s",t.name)),f.lazyAssign(f.nonComputedMember("s",t.name),"{}")),f.assign(e,f.nonComputedMember("s",t.name))}))}),e&&f.lazyAssign(e,f.nonComputedMember("l",t.name))),r(e);break;case xr.MemberExpression:a=n&&(n.context=this.nextId())||this.nextId(),e=e||this.nextId(),f.recurse(t.object,a,void 0,(function(){f.if_(f.notNull(a),(function(){t.computed?(s=f.nextId(),f.recurse(t.property,s),f.getStringValue(s),i&&1!==i&&f.if_(f.not(f.computedMember(a,s)),f.lazyAssign(f.computedMember(a,s),"{}")),c=f.computedMember(a,s),f.assign(e,c),n&&(n.computed=!0,n.name=s)):(i&&1!==i&&f.if_(f.isNull(f.nonComputedMember(a,t.property.name)),f.lazyAssign(f.nonComputedMember(a,t.property.name),"{}")),c=f.nonComputedMember(a,t.property.name),f.assign(e,c),n&&(n.computed=!1,n.name=t.property.name))}),(function(){f.assign(e,"undefined")})),r(e)}),!!i);break;case xr.CallExpression:e=e||this.nextId(),t.filter?(s=f.filter(t.callee.name),u=[],C(t.arguments,(function(t){var e=f.nextId();f.recurse(t,e),u.push(e)})),c=s+"("+u.join(",")+")",f.assign(e,c),r(e)):(s=f.nextId(),a={},u=[],f.recurse(t.callee,s,a,(function(){f.if_(f.notNull(s),(function(){C(t.arguments,(function(e){f.recurse(e,t.constant?void 0:f.nextId(),void 0,(function(t){u.push(t)}))})),c=a.name?f.member(a.context,a.name,a.computed)+"("+u.join(",")+")":s+"("+u.join(",")+")",f.assign(e,c)}),(function(){f.assign(e,"undefined")})),r(e)})));break;case xr.AssignmentExpression:s=this.nextId(),a={},this.recurse(t.left,void 0,a,(function(){f.if_(f.notNull(a.context),(function(){f.recurse(t.right,s),c=f.member(a.context,a.name,a.computed)+t.operator+s,f.assign(e,c),r(e||c)}))}),1);break;case xr.ArrayExpression:u=[],C(t.elements,(function(e){f.recurse(e,t.constant?void 0:f.nextId(),void 0,(function(t){u.push(t)}))})),c="["+u.join(",")+"]",this.assign(e,c),r(e||c);break;case xr.ObjectExpression:u=[],l=!1,C(t.properties,(function(t){t.computed&&(l=!0)})),l?(e=e||this.nextId(),this.assign(e,"{}"),C(t.properties,(function(t){t.computed?(a=f.nextId(),f.recurse(t.key,a)):a=t.key.type===xr.Identifier?t.key.name:""+t.key.value,s=f.nextId(),f.recurse(t.value,s),f.assign(f.member(e,a,t.computed),s)}))):(C(t.properties,(function(e){f.recurse(e.value,t.constant?void 0:f.nextId(),void 0,(function(t){u.push(f.escape(e.key.type===xr.Identifier?e.key.name:""+e.key.value)+":"+t)}))})),c="{"+u.join(",")+"}",this.assign(e,c)),r(e||c);break;case xr.ThisExpression:this.assign(e,"s"),r(e||"s");break;case xr.LocalsExpression:this.assign(e,"l"),r(e||"l");break;case xr.NGValueParameter:this.assign(e,"v"),r(e||"v")}},getHasOwnProperty:function(t,e){var n=t+"."+e,r=this.current().own;return r.hasOwnProperty(n)||(r[n]=this.nextId(!1,t+"&&("+this.escape(e)+" in "+t+")")),r[n]},assign:function(t,e){if(t)return this.current().body.push(t,"=",e,";"),t},filter:function(t){return this.state.filters.hasOwnProperty(t)||(this.state.filters[t]=this.nextId(!0)),this.state.filters[t]},ifDefined:function(t,e){return"ifDefined("+t+","+this.escape(e)+")"},plus:function(t,e){return"plus("+t+","+e+")"},return_:function(t){this.current().body.push("return ",t,";")},if_:function(t,e,n){if(!0===t)e();else{var r=this.current().body;r.push("if(",t,"){"),e(),r.push("}"),n&&(r.push("else{"),n(),r.push("}"))}},not:function(t){return"!("+t+")"},isNull:function(t){return t+"==null"},notNull:function(t){return t+"!=null"},nonComputedMember:function(t,e){return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?t+"."+e:t+'["'+e.replace(/[^$_a-zA-Z0-9]/g,this.stringEscapeFn)+'"]'},computedMember:function(t,e){return t+"["+e+"]"},member:function(t,e,n){return n?this.computedMember(t,e):this.nonComputedMember(t,e)},getStringValue:function(t){this.assign(t,"getStringValue("+t+")")},lazyRecurse:function(t,e,n,r,i,o){var a=this;return function(){a.recurse(t,e,n,r,i,o)}},lazyAssign:function(t,e){var n=this;return function(){n.assign(t,e)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)},escape:function(t){if(F(t))return"'"+t.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(H(t))return t.toString();if(!0===t)return"true";if(!1===t)return"false";if(null===t)return"null";if(void 0===t)return"undefined";throw vr("esc","IMPOSSIBLE")},nextId:function(t,e){var n="v"+this.state.nextId++;return t||this.current().vars.push(n+(e?"="+e:"")),n},current:function(){return this.state[this.state.computing]}},Tr.prototype={compile:function(t){var e,n,r=this;Sr(t,r.$filter),(e=Or(t))&&(n=this.recurse(e));var i,o=kr(t.body);o&&(i=[],C(o,(function(t,e){var n=r.recurse(t);n.isPure=t.isPure,t.input=n,i.push(n),t.watchId=e})));var a=[];C(t.body,(function(t){a.push(r.recurse(t.expression))}));var s=0===t.body.length?I:1===t.body.length?a[0]:function(t,e){var n;return C(a,(function(r){n=r(t,e)})),n};return n&&(s.assign=function(t,e,r){return n(t,r,e)}),i&&(s.inputs=i),s},recurse:function(t,e,n){var r,i,o,a=this;if(t.input)return this.inputs(t.input,t.watchId);switch(t.type){case xr.Literal:return this.value(t.value,e);case xr.UnaryExpression:return i=this.recurse(t.argument),this["unary"+t.operator](i,e);case xr.BinaryExpression:case xr.LogicalExpression:return r=this.recurse(t.left),i=this.recurse(t.right),this["binary"+t.operator](r,i,e);case xr.ConditionalExpression:return this["ternary?:"](this.recurse(t.test),this.recurse(t.alternate),this.recurse(t.consequent),e);case xr.Identifier:return a.identifier(t.name,e,n);case xr.MemberExpression:return r=this.recurse(t.object,!1,!!n),t.computed||(i=t.property.name),t.computed&&(i=this.recurse(t.property)),t.computed?this.computedMember(r,i,e,n):this.nonComputedMember(r,i,e,n);case xr.CallExpression:return o=[],C(t.arguments,(function(t){o.push(a.recurse(t))})),t.filter&&(i=this.$filter(t.callee.name)),t.filter||(i=this.recurse(t.callee,!0)),t.filter?function(t,n,r,a){for(var s=[],u=0;u":function(t,e,n){return function(r,i,o,a){var s=t(r,i,o,a)>e(r,i,o,a);return n?{value:s}:s}},"binary<=":function(t,e,n){return function(r,i,o,a){var s=t(r,i,o,a)<=e(r,i,o,a);return n?{value:s}:s}},"binary>=":function(t,e,n){return function(r,i,o,a){var s=t(r,i,o,a)>=e(r,i,o,a);return n?{value:s}:s}},"binary&&":function(t,e,n){return function(r,i,o,a){var s=t(r,i,o,a)&&e(r,i,o,a);return n?{value:s}:s}},"binary||":function(t,e,n){return function(r,i,o,a){var s=t(r,i,o,a)||e(r,i,o,a);return n?{value:s}:s}},"ternary?:":function(t,e,n,r){return function(i,o,a,s){var u=t(i,o,a,s)?e(i,o,a,s):n(i,o,a,s);return r?{value:u}:u}},value:function(t,e){return function(){return e?{context:void 0,name:void 0,value:t}:t}},identifier:function(t,e,n){return function(r,i,o,a){var s=i&&t in i?i:r;n&&1!==n&&s&&null==s[t]&&(s[t]={});var u=s?s[t]:void 0;return e?{context:s,name:t,value:u}:u}},computedMember:function(t,e,n,r){return function(i,o,a,s){var u,c,l=t(i,o,a,s);return null!=l&&(u=gr(u=e(i,o,a,s)),r&&1!==r&&l&&!l[u]&&(l[u]={}),c=l[u]),n?{context:l,name:u,value:c}:c}},nonComputedMember:function(t,e,n,r){return function(i,o,a,s){var u=t(i,o,a,s);r&&1!==r&&u&&null==u[e]&&(u[e]={});var c=null!=u?u[e]:void 0;return n?{context:u,name:e,value:c}:c}},inputs:function(t,e){return function(n,r,i,o){return o?o[e]:t(n,r,i)}}},Vr.prototype={constructor:Vr,parse:function(t){var e=this.getAst(t),n=this.astCompiler.compile(e.ast);return n.literal=function(t){return 0===t.body.length||1===t.body.length&&(t.body[0].expression.type===xr.Literal||t.body[0].expression.type===xr.ArrayExpression||t.body[0].expression.type===xr.ObjectExpression)}(e.ast),n.constant=function(t){return t.constant}(e.ast),n.oneTime=e.oneTime,n},getAst:function(t){var e=!1;return":"===(t=t.trim()).charAt(0)&&":"===t.charAt(1)&&(e=!0,t=t.substring(2)),{ast:this.ast.ast(t),oneTime:e}}};var Hr=o("$sce"),Br={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},zr=/_([a-z])/g;function Wr(t){return t.replace(zr,Yt)}function Gr(t){var e=[];return D(t)&&C(t,(function(t){e.push(function(t){if("self"===t)return t;if(F(t)){if(t.indexOf("***")>-1)throw Hr("iwcard","Illegal sequence *** in string matcher. String: {0}",t);return t=et(t).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*"),new RegExp("^"+t+"$")}if(K(t))return new RegExp("^"+t.source+"$");throw Hr("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}(t))})),e}function Kr(){this.SCE_CONTEXTS=Br;var e=["self"],n=[];this.trustedResourceUrlList=function(t){return arguments.length&&(e=Gr(t)),e},Object.defineProperty(this,"resourceUrlWhitelist",{get:function(){return this.trustedResourceUrlList},set:function(t){this.trustedResourceUrlList=t}}),this.bannedResourceUrlList=function(t){return arguments.length&&(n=Gr(t)),n},Object.defineProperty(this,"resourceUrlBlacklist",{get:function(){return this.bannedResourceUrlList},set:function(t){this.bannedResourceUrlList=t}}),this.$get=["$injector","$$sanitizeUri",function(r,i){var o=function(t){throw Hr("unsafe","Attempting to use an unsafe value in a safe context.")};function a(e,n){return"self"===e?ci(n,ai)||ci(n,t.document.baseURI?t.document.baseURI:(ii||((ii=t.document.createElement("a")).href=".",ii=ii.cloneNode(!1)),ii.href)):!!e.exec(n.href)}function s(t){var e=function(t){this.$$unwrapTrustedValue=function(){return t}};return t&&(e.prototype=new t),e.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},e.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},e}r.has("$sanitize")&&(o=r.get("$sanitize"));var u=s(),c={};return c[Br.HTML]=s(u),c[Br.CSS]=s(u),c[Br.MEDIA_URL]=s(u),c[Br.URL]=s(c[Br.MEDIA_URL]),c[Br.JS]=s(u),c[Br.RESOURCE_URL]=s(c[Br.URL]),{trustAs:function(t,e){var n=c.hasOwnProperty(t)?c[t]:null;if(!n)throw Hr("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",t,e);if(null===e||_(e)||""===e)return e;if("string"!=typeof e)throw Hr("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",t);return new n(e)},getTrusted:function(t,r){if(null===r||_(r)||""===r)return r;var s=c.hasOwnProperty(t)?c[t]:null;if(s&&r instanceof s)return r.$$unwrapTrustedValue();if(G(r.$$unwrapTrustedValue)&&(r=r.$$unwrapTrustedValue()),t===Br.MEDIA_URL||t===Br.URL)return i(r.toString(),t===Br.MEDIA_URL);if(t===Br.RESOURCE_URL){if(function(t){var r,i,o=ui(t.toString()),s=!1;for(r=0,i=e.length;r to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var r=Ft(Br);r.isEnabled=function(){return t},r.trustAs=n.trustAs,r.getTrusted=n.getTrusted,r.valueOf=n.valueOf,t||(r.trustAs=r.getTrusted=function(t,e){return e},r.valueOf=R),r.parseAs=function(t,n){var i=e(n);return i.literal&&i.constant?i:e(n,(function(e){return r.getTrusted(t,e)}))};var i=r.parseAs,o=r.getTrusted,s=r.trustAs;return C(Br,(function(t,e){var n=h(e);r[Wr("parse_as_"+n)]=function(e){return i(t,e)},r[Wr("get_trusted_"+n)]=function(e){return o(t,e)},r[Wr("trust_as_"+n)]=function(e){return s(t,e)}})),r}]}function Zr(){this.$get=["$window","$document",function(t,e){var n={},r=!((!t.nw||!t.nw.process)&&t.chrome&&(t.chrome.app&&t.chrome.app.runtime||!t.chrome.app&&t.chrome.runtime&&t.chrome.runtime.id))&&t.history&&t.history.pushState,i=V((/android (\d+)/.exec(h((t.navigator||{}).userAgent))||[])[1]),o=/Boxee/i.test((t.navigator||{}).userAgent),s=e[0]||{},u=s.body&&s.body.style,c=!1,l=!1;return u&&(c=!(!("transition"in u)&&!("webkitTransition"in u)),l=!(!("animation"in u)&&!("webkitAnimation"in u))),{history:!(!r||i<4||o),hasEvent:function(t){if("input"===t&&a)return!1;if(_(n[t])){var e=s.createElement("div");n[t]="on"+t in e}return n[t]},csp:ct(),transitions:c,animations:l,android:i}}]}function Yr(){this.$get=P((function(t){return new Xr(t)}))}function Xr(t){var e=this,n={},r=[],i=e.ALL_TASKS_TYPE="$$all$$",o=e.DEFAULT_TASK_TYPE="$$default$$";function a(){var t=r.pop();return t&&t.cb}function s(t){for(var e=r.length-1;e>=0;--e){var n=r[e];if(n.type===t)return r.splice(e,1),n.cb}}e.completeTask=function(e,r){r=r||o;try{e()}finally{!function(t){n[t=t||o]&&(n[t]--,n[i]--)}(r);var u=n[r],c=n[i];if(!c||!u)for(var l,f=c?s:a;l=f(r);)try{l()}catch(e){t.error(e)}}},e.incTaskCount=function(t){n[t=t||o]=(n[t]||0)+1,n[i]=(n[i]||0)+1},e.notifyWhenNoPendingTasks=function(t,e){n[e=e||i]?r.push({type:e,cb:t}):t()}}var Qr=o("$templateRequest");function ti(){var t;this.httpOptions=function(e){return e?(t=e,this):t},this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(e,n,r,i,o){function a(s,u){a.totalPendingRequests++,F(s)&&!_(n.get(s))||(s=o.getTrustedResourceUrl(s));var c=r.defaults&&r.defaults.transformResponse;return z(c)?c=c.filter((function(t){return t!==Dn})):c===Dn&&(c=null),r.get(s,M({cache:n,transformResponse:c},t)).finally((function(){a.totalPendingRequests--})).then((function(t){return n.put(s,t.data)}),(function(t){return u||(t=Qr("tpload","Failed to load template: {0} (HTTP status: {1} {2})",s,t.status,t.statusText),e(t)),i.reject(t)}))}return a.totalPendingRequests=0,a}]}function ei(){this.$get=["$rootScope","$browser","$location",function(t,e,n){return{findBindings:function(t,e,n){var r=t.getElementsByClassName("ng-binding"),i=[];return C(r,(function(t){var r=b.element(t).data("$binding");r&&C(r,(function(r){n?new RegExp("(^|\\s)"+et(e)+"(\\s|\\||$)").test(r)&&i.push(t):-1!==r.indexOf(e)&&i.push(t)}))})),i},findModels:function(t,e,n){for(var r=["ng-","data-ng-","ng\\:"],i=0;i-1&&(n="["+n+"]"),{href:oi.href,protocol:oi.protocol?oi.protocol.replace(/:$/,""):"",host:oi.host,search:oi.search?oi.search.replace(/^\?/,""):"",hash:oi.hash?oi.hash.replace(/^#/,""):"",hostname:n,port:oi.port,pathname:"/"===oi.pathname.charAt(0)?oi.pathname:"/"+oi.pathname}}function ci(t,e){return t=ui(t),e=ui(e),t.protocol===e.protocol&&t.host===e.host}function li(){this.$get=P(t)}function fi(t){var e=t[0]||{},n={},r="";function i(t){try{return decodeURIComponent(t)}catch(e){return t}}return function(){var t,o,a,s,u,c=function(t){try{return t.cookie||""}catch(t){return""}}(e);if(c!==r)for(t=(r=c).split("; "),n={},a=0;a0&&(u=i(o.substring(0,s)),_(n[u])&&(n[u]=i(o.substring(s+1))));return n}}function hi(){this.$get=fi}function pi(t){var e="Filter";function n(r,i){if(L(r)){var o={};return C(r,(function(t,e){o[e]=n(e,t)})),o}return t.factory(r+e,i)}this.register=n,this.$get=["$injector",function(t){return function(n){return t.get(n+e)}}],n("currency",mi),n("date",Mi),n("filter",di),n("json",Ti),n("limitTo",ji),n("lowercase",Vi),n("number",gi),n("orderBy",Ri),n("uppercase",Ni)}function di(){return function(t,e,n,r){if(!x(t)){if(null==t)return t;throw o("filter")("notarray","Expected array but received: {0}",t)}var i,a;switch(r=r||"$",vi(e)){case"function":i=e;break;case"boolean":case"null":case"number":case"string":a=!0;case"object":i=function(t,e,n,r){var i=L(t)&&n in t;return!0===e?e=ut:G(e)||(e=function(t,e){return!(_(t)||(null===t||null===e?t!==e:L(e)||L(t)&&!U(t)||(t=h(""+t),e=h(""+e),-1===t.indexOf(e))))}),function(o){return i&&!L(o)?$i(o,t[n],e,n,!1):$i(o,t,e,n,r)}}(e,n,r,a);break;default:return t}return Array.prototype.filter.call(t,i)}}function $i(t,e,n,r,i,o){var a=vi(t),s=vi(e);if("string"===s&&"!"===e.charAt(0))return!$i(t,e.substring(1),n,r,i);if(z(t))return t.some((function(t){return $i(t,e,n,r,i)}));switch(a){case"object":var u;if(i){for(u in t)if(u.charAt&&"$"!==u.charAt(0)&&$i(t[u],e,n,r,!0))return!0;return!o&&$i(t,e,n,r,!1)}if("object"===s){for(u in e){var c=e[u];if(!G(c)&&!_(c)){var l=u===r;if(!$i(l?t:t[u],c,n,r,l,l))return!1}}return!0}return n(t,e);case"function":return!1;default:return n(t,e)}}function vi(t){return null===t?"null":typeof t}function mi(t){var e=t.NUMBER_FORMATS;return function(t,n,r){_(n)&&(n=e.CURRENCY_SYM),_(r)&&(r=e.PATTERNS[1].maxFrac);var i=n?/\u00A4/g:/\s*\u00A4\s*/g;return null==t?t:yi(t,e.PATTERNS[1],e.GROUP_SEP,e.DECIMAL_SEP,r).replace(i,n)}}function gi(t){var e=t.NUMBER_FORMATS;return function(t,n){return null==t?t:yi(t,e.PATTERNS[0],e.GROUP_SEP,e.DECIMAL_SEP,n)}}function yi(t,e,n,r,i){if(!F(t)&&!H(t)||isNaN(t))return"";var o,a=!isFinite(t),s=!1,u=Math.abs(t)+"",c="";if(a)c="∞";else{!function(t,e,n,r){var i=t.d,o=i.length-t.i,a=(e=_(e)?Math.min(Math.max(n,o),r):+e)+t.i,s=i[a];if(a>0){i.splice(Math.max(t.i,a));for(var u=a;u=5)if(a-1<0){for(var l=0;l>a;l--)i.unshift(0),t.i++;i.unshift(1),t.i++}else i[a-1]++;for(;o-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;"0"===t.charAt(r);r++);if(r===(o=t.length))e=[0],n=1;else{for(o--;"0"===t.charAt(o);)o--;for(n-=r,e=[],i=0;r<=o;r++,i++)e[i]=+t.charAt(r)}return n>22&&(e=e.splice(0,21),a=n-1,n=1),{d:e,e:a,i:n}}(u),i,e.minFrac,e.maxFrac);var l=o.d,f=o.i,h=o.e,p=[];for(s=l.reduce((function(t,e){return t&&!e}),!0);f<0;)l.unshift(0),f++;f>0?p=l.splice(f,l.length):(p=l,l=[0]);var d=[];for(l.length>=e.lgSize&&d.unshift(l.splice(-e.lgSize,l.length).join(""));l.length>e.gSize;)d.unshift(l.splice(-e.gSize,l.length).join(""));l.length&&d.unshift(l.join("")),c=d.join(n),p.length&&(c+=r+p.join("")),h&&(c+="e+"+h)}return t<0&&!s?e.negPre+c+e.negSuf:e.posPre+c+e.posSuf}function bi(t,e,n,r){var i="";for((t<0||r&&t<=0)&&(r?t=1-t:(t=-t,i="-")),t=""+t;t.length0||a>-n)&&(a+=n),0===a&&-12===n&&(a=12),bi(a,e,r,i)}}function xi(t,e,n){return function(r,i){var o=r["get"+t]();return i[p((n?"STANDALONE":"")+(e?"SHORT":"")+t)][o]}}function Ci(t){var e=new Date(t,0,1).getDay();return new Date(t,0,(e<=4?5:12)-e)}function Ei(t){return function(e){var n,r=Ci(e.getFullYear()),i=(n=e,+new Date(n.getFullYear(),n.getMonth(),n.getDate()+(4-n.getDay()))-+r);return bi(1+Math.round(i/6048e5),t)}}function Si(t,e){return t.getFullYear()<=0?e.ERAS[0]:e.ERAS[1]}fi.$inject=["$document"],pi.$inject=["$provide"],mi.$inject=["$locale"],gi.$inject=["$locale"];var ki={yyyy:wi("FullYear",4,0,!1,!0),yy:wi("FullYear",2,0,!0,!0),y:wi("FullYear",1,0,!1,!0),MMMM:xi("Month"),MMM:xi("Month",!0),MM:wi("Month",2,1),M:wi("Month",1,1),LLLL:xi("Month",!1,!0),dd:wi("Date",2),d:wi("Date",1),HH:wi("Hours",2),H:wi("Hours",1),hh:wi("Hours",2,-12),h:wi("Hours",1,-12),mm:wi("Minutes",2),m:wi("Minutes",1),ss:wi("Seconds",2),s:wi("Seconds",1),sss:wi("Milliseconds",3),EEEE:xi("Day"),EEE:xi("Day",!0),a:function(t,e){return t.getHours()<12?e.AMPMS[0]:e.AMPMS[1]},Z:function(t,e,n){var r=-1*n;return(r>=0?"+":"")+(bi(Math[r>0?"floor":"ceil"](r/60),2)+bi(Math.abs(r%60),2))},ww:Ei(2),w:Ei(1),G:Si,GG:Si,GGG:Si,GGGG:function(t,e){return t.getFullYear()<=0?e.ERANAMES[0]:e.ERANAMES[1]}},Ai=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,Oi=/^-?\d+$/;function Mi(t){var e=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(n,r,i){var o,a,s="",u=[];if(r=r||"mediumDate",r=t.DATETIME_FORMATS[r]||r,F(n)&&(n=Oi.test(n)?V(n):function(t){var n;if(n=t.match(e)){var r=new Date(0),i=0,o=0,a=n[8]?r.setUTCFullYear:r.setFullYear,s=n[8]?r.setUTCHours:r.setHours;n[9]&&(i=V(n[9]+n[10]),o=V(n[9]+n[11])),a.call(r,V(n[1]),V(n[2])-1,V(n[3]));var u=V(n[4]||0)-i,c=V(n[5]||0)-o,l=V(n[6]||0),f=Math.round(1e3*parseFloat("0."+(n[7]||0)));return s.call(r,u,c,l,f),r}return t}(n)),H(n)&&(n=new Date(n)),!B(n)||!isFinite(n.getTime()))return n;for(;r;)(a=Ai.exec(r))?r=(u=ft(u,a,1)).pop():(u.push(r),r=null);var c=n.getTimezoneOffset();return i&&(c=gt(i,c),n=bt(n,i,!0)),C(u,(function(e){s+=(o=ki[e])?o(n,t.DATETIME_FORMATS,c):"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")})),s}}function Ti(){return function(t,e){return _(e)&&(e=2),$t(t,e)}}Mi.$inject=["$locale"];var Vi=P(h),Ni=P(p);function ji(){return function(t,e,n){return e=Math.abs(Number(e))===1/0?Number(e):V(e),N(e)?t:(H(t)&&(t=t.toString()),x(t)?(n=(n=!n||isNaN(n)?0:V(n))<0?Math.max(0,t.length+n):n,e>=0?Ii(t,n,n+e):0===n?Ii(t,e,t.length):Ii(t,Math.max(0,n+e),n)):t)}}function Ii(t,e,n){return F(t)?t.slice(e,n):d.call(t,e,n)}function Ri(t){return function(r,i,a,s){if(null==r)return r;if(!x(r))throw o("orderBy")("notarray","Expected array but received: {0}",r);z(i)||(i=[i]),0===i.length&&(i=["+"]);var u=i.map((function(e){var n=1,r=R;if(G(e))r=e;else if(F(e)&&("+"!==e.charAt(0)&&"-"!==e.charAt(0)||(n="-"===e.charAt(0)?-1:1,e=e.substring(1)),""!==e&&(r=t(e)).constant)){var i=r();r=function(t){return t[i]}}return{get:r,descending:n}})),c=a?-1:1,l=G(s)?s:n,f=Array.prototype.map.call(r,(function(t,n){return{value:t,tieBreaker:{value:n,type:"number",index:n},predicateValues:u.map((function(r){return function(t,n){var r=typeof t;return null===t?r="null":"object"===r&&(t=function(t){return G(t.valueOf)&&e(t=t.valueOf())||U(t)&&e(t=t.toString()),t}(t)),{value:t,type:r,index:n}}(r.get(t),n)}))}}));return f.sort((function(t,e){for(var r=0,i=u.length;r=u},n.$observe("min",(function(t){t!==c&&(u=ho(t),c=t,r.$validate())}))}if(D(n.max)||n.ngMax){var l=n.max||s(n.ngMax)(t),f=ho(l);r.$validators.max=function(t,e){return r.$isEmpty(e)||_(f)||e<=f},n.$observe("max",(function(t){t!==l&&(f=ho(t),l=t,r.$validate())}))}if(D(n.step)||n.ngStep){var h=n.step||s(n.ngStep)(t),p=ho(h);r.$validators.step=function(t,e){return r.$isEmpty(e)||_(p)||vo(e,u||0,p)},n.$observe("step",(function(t){t!==h&&(p=ho(t),h=t,r.$validate())}))}},url:function(t,e,n,r,i,o){so(0,e,n,r,i,o),ao(r),r.$validators.url=function(t,e){var n=t||e;return r.$isEmpty(n)||Zi.test(n)}},email:function(t,e,n,r,i,o){so(0,e,n,r,i,o),ao(r),r.$validators.email=function(t,e){var n=t||e;return r.$isEmpty(n)||Yi.test(n)}},radio:function(t,e,n,r){var i=!n.ngTrim||"false"!==tt(n.ngTrim);_(n.name)&&e.attr("name",k()),e.on("change",(function(t){var o;e[0].checked&&(o=n.value,i&&(o=tt(o)),r.$setViewValue(o,t&&t.type))})),r.$render=function(){var t=n.value;i&&(t=tt(t)),e[0].checked=t===r.$viewValue},n.$observe("value",r.$render)},range:function(t,e,n,r,i,o){lo(0,e,0,r,"range"),fo(r),so(0,e,n,r,i,o);var a=r.$$hasNativeValidators&&"range"===e[0].type,s=a?0:void 0,u=a?100:void 0,c=a?1:void 0,l=e[0].validity,f=D(n.min),h=D(n.max),p=D(n.step),d=r.$render;function $(t,r){e.attr(t,n[t]);var i=n[t];n.$observe(t,(function(t){t!==i&&(i=t,r(t))}))}r.$render=a&&D(l.rangeUnderflow)&&D(l.rangeOverflow)?function(){d(),r.$setViewValue(e.val())}:d,f&&(s=ho(n.min),r.$validators.min=a?function(){return!0}:function(t,e){return r.$isEmpty(e)||_(s)||e>=s},$("min",(function(t){if(s=ho(t),!N(r.$modelValue))if(a){var n=e.val();s>n&&(n=s,e.val(n)),r.$setViewValue(n)}else r.$validate()}))),h&&(u=ho(n.max),r.$validators.max=a?function(){return!0}:function(t,e){return r.$isEmpty(e)||_(u)||e<=u},$("max",(function(t){if(u=ho(t),!N(r.$modelValue))if(a){var n=e.val();u=v},a.$observe("min",(function(t){t!==$&&(v=b(t),$=t,s.$validate())}))}if(D(a.max)||a.ngMax){var m=a.max||f(a.ngMax)(i),g=b(m);s.$validators.max=function(t){return!y(t)||_(g)||n(t)<=g},a.$observe("max",(function(t){t!==m&&(g=b(t),m=t,s.$validate())}))}function y(t){return t&&!(t.getTime&&t.getTime()!=t.getTime())}function b(t){return D(t)&&!B(t)?w(t)||void 0:t}function w(t,e){var r=s.$options.getOption("timezone");p&&p!==r&&(e=yt(e,gt(p)));var i=n(t,e);return!isNaN(i)&&r&&(i=bt(i,r)),i}}}function lo(t,e,n,r,i){var o=e[0];(r.$$hasNativeValidators=L(o.validity))&&r.$parsers.push((function(t){var n=e.prop("validity")||{};if(!n.badInput&&!n.typeMismatch)return t;r.$$parserName=i}))}function fo(t){t.$parsers.push((function(e){return t.$isEmpty(e)?null:Xi.test(e)?parseFloat(e):void(t.$$parserName="number")})),t.$formatters.push((function(e){if(!t.$isEmpty(e)){if(!H(e))throw Ko("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}))}function ho(t){return D(t)&&!H(t)&&(t=parseFloat(t)),N(t)?void 0:t}function po(t){return(0|t)===t}function $o(t){var e=t.toString(),n=e.indexOf(".");if(-1===n){if(-10||f[t])&&(f[t]=(f[t]||0)+e,f[t]===+(e>0)&&n.push(t))})),n.join(" ")}f||(f=Dt(),u.data("$classCounts",f)),"ngClass"!==t&&(n||(n=a("$index",(function(t){return 1&t}))),s.$watch(n,(function(t){var n;t===e?(n=p(i(n=l),1),c.$addClass(n)):function(t){t=p(i(t),-1),c.$removeClass(t)}(l),h=t}))),s.$watch(a(c[t],o),(function(t){h===e&&function(t,e){var n=i(t),o=i(e),a=r(n,o),s=r(o,n),u=p(a,-1),l=p(s,1);c.$addClass(l),c.$removeClass(u)}(l,t),l=t}))}}}];function r(t,e){if(!t||!t.length)return[];if(!e||!e.length)return t;var n=[];t:for(var r=0;r0?this.$$pendingDebounce=this.$$timeout((function(){n.$commitViewValue()}),e):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply((function(){n.$commitViewValue()}))},$overrideModelOptions:function(t){this.$options=this.$options.createChild(t),this.$$setUpdateOnEvents()},$processModelValue:function(){var t=this.$$format();this.$viewValue!==t&&(this.$$updateEmptyClasses(t),this.$viewValue=this.$$lastCommittedViewValue=t,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,I))},$$format:function(){for(var t=this.$formatters,e=t.length,n=this.$modelValue;e--;)n=t[e](n);return n},$$setModelValue:function(t){this.$modelValue=this.$$rawModelValue=t,this.$$parserValid=void 0,this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler),this.$$updateEvents=this.$options.getOption("updateOn"),this.$$updateEvents&&this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(t){this.$$debounceViewValueCommit(t&&t.type)}},Gi({clazz:Jo,set:function(t,e){t[e]=!0},unset:function(t,e){delete t[e]}});var Zo,Yo=["$rootScope",function(t){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Jo,priority:1,compile:function(e){return e.addClass(Fo).addClass(Bo).addClass(Lo),{pre:function(t,e,n,r){var i=r[0],o=r[1]||i.$$parentForm,a=r[2];a&&(i.$options=a.$options),i.$$initGetterSetters(),o.$addControl(i),n.$observe("name",(function(t){i.$name!==t&&i.$$parentForm.$$renameControl(i,t)})),t.$on("$destroy",(function(){i.$$parentForm.$removeControl(i)}))},post:function(e,n,r,i){var o=i[0];function a(){o.$setTouched()}o.$$setUpdateOnEvents(),n.on("blur",(function(){o.$touched||(t.$$phase?e.$evalAsync(a):e.$apply(a))}))}}}}}],Xo=/(\s+|^)default(\s+|$)/;function Qo(t){this.$$options=t}Qo.prototype={getOption:function(t){return this.$$options[t]},createChild:function(t){var e=!1;return C(t=M({},t),(function(n,r){"$inherit"===n?"*"===r?e=!0:(t[r]=this.$$options[r],"updateOn"===r&&(t.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===r&&(t.updateOnDefault=!1,t[r]=tt(n.replace(Xo,(function(){return t.updateOnDefault=!0," "}))))}),this),e&&(delete t["*"],ea(t,this.$$options)),ea(t,Zo.$$options),new Qo(t)}},Zo=new Qo({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var ta=function(){function t(t,e){this.$$attrs=t,this.$$scope=e}return t.$inject=["$attrs","$scope"],t.prototype={$onInit:function(){var t=this.parentCtrl?this.parentCtrl.$options:Zo,e=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=t.createChild(e)}},{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:t}};function ea(t,e){C(e,(function(e,n){D(t[n])||(t[n]=e)}))}var na=Pi({terminal:!0,priority:1e3}),ra=o("ngOptions"),ia=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,oa=["$compile","$document","$parse",function(e,n,r){var i=t.document.createElement("option"),o=t.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(t,e,n,r){r[0].registerOption=I},post:function(t,a,u,c){for(var l=c[0],f=c[1],h=u.multiple,p=0,d=a.children(),$=d.length;p<$;p++)if(""===d[p].value){l.hasEmptyOption=!0,l.emptyOption=d.eq(p);break}a.empty();var v,m=!!l.emptyOption;s(i.cloneNode(!1)).val("?");var g=function(t,e,n){var i=t.match(ia);if(!i)throw ra("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",t,wt(e));var o=i[5]||i[7],a=i[6],s=/ as /.test(i[0])&&i[1],u=i[9],c=r(i[2]?i[1]:o),l=s&&r(s)||c,f=u&&r(u),h=u?function(t,e){return f(n,e)}:function(t){return _e(t)},p=function(t,e){return h(t,y(t,e))},d=r(i[2]||i[1]),$=r(i[3]||""),v=r(i[4]||""),m=r(i[8]),g={},y=a?function(t,e){return g[a]=e,g[o]=t,g}:function(t){return g[o]=t,g};function b(t,e,n,r,i){this.selectValue=t,this.viewValue=e,this.label=n,this.group=r,this.disabled=i}function w(t){var e;if(!a&&x(t))e=t;else for(var n in e=[],t)t.hasOwnProperty(n)&&"$"!==n.charAt(0)&&e.push(n);return e}return{trackBy:u,getTrackByValue:p,getWatchables:r(m,(function(t){for(var e=[],r=w(t=t||[]),o=r.length,a=0;a=0;e--){var n=v.items[e];D(n.group)?Oe(n.element.parentNode):Oe(n.element)}v=g.getOptions();var r={};if(v.items.forEach((function(t){var e;D(t.group)?((e=r[t.group])||(e=o.cloneNode(!1),y.appendChild(e),e.label=null===t.group?"null":t.group,r[t.group]=e),b(t,e)):b(t,y)})),a[0].appendChild(y),f.$render(),!f.$isEmpty(t)){var i=l.readValue();(g.trackBy||h?ut(t,i):t===i)||(f.$setViewValue(i),f.$render())}}))}}}}],aa=["$locale","$interpolate","$log",function(t,e,n){var r=/{}/g,i=/^when(Minus)?(.+)$/;return{link:function(o,a,s){var u,c=s.count,l=s.$attr.when&&a.attr(s.$attr.when),f=s.offset||0,p=o.$eval(l)||{},d={},$=e.startSymbol(),v=e.endSymbol(),m=$+c+"-"+f+v,g=b.noop;function y(t){a.text(t||"")}C(s,(function(t,e){var n=i.exec(e);if(n){var r=(n[1]?"-":"")+h(n[2]);p[r]=a.attr(s.$attr[e])}})),C(p,(function(t,n){d[n]=e(t.replace(r,m))})),o.$watch(c,(function(e){var r=parseFloat(e),i=N(r);if(i||r in p||(r=t.pluralCat(r-f)),!(r===u||i&&N(u))){g();var a=d[r];_(a)?(null!=e&&n.debug("ngPluralize: no rule defined for '"+r+"' in "+l),g=I,y()):g=o.$watch(a,y),u=r}}))}}}],sa=o("ngRef"),ua=["$parse",function(t){return{priority:-1,restrict:"A",compile:function(e,n){var r=bn(rt(e)),i=t(n.ngRef),o=i.assign||function(){throw sa("nonassign",'Expression in ngRef="{0}" is non-assignable!',n.ngRef)};return function(t,e,a){var s;if(a.hasOwnProperty("ngRefRead")){if("$element"===a.ngRefRead)s=e;else if(!(s=e.data("$"+a.ngRefRead+"Controller")))throw sa("noctrl",'The controller for ngRefRead="{0}" could not be found on ngRef="{1}"',a.ngRefRead,n.ngRef)}else s=e.data("$"+r+"Controller");o(t,s=s||e),e.on("$destroy",(function(){i(t)===s&&o(t,null)}))}}}}],ca=["$parse","$animate","$compile",function(t,e,n){var r="$$NG_REMOVED",i=o("ngRepeat"),a=function(t,e,n,r,i,o,a){t[n]=r,i&&(t[i]=o),t.$index=e,t.$first=0===e,t.$last=e===a-1,t.$middle=!(t.$first||t.$last),t.$odd=!(t.$even=0==(1&e))},s=function(t){return t.clone[0]},u=function(t){return t.clone[t.clone.length-1]},c=function(t,e,n){return _e(n)},l=function(t,e){return e};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(o,h){var p=h.ngRepeat,d=n.$$createComment("end ngRepeat",p),$=p.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!$)throw i("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",p);var v=$[1],m=$[2],g=$[3],y=$[4];if(!($=v.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/)))throw i("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",v);var b,w=$[3]||$[1],E=$[2];if(g&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(g)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(g)))throw i("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",g);if(y){var S={$id:_e},k=t(y);b=function(t,e,n,r){return E&&(S[E]=e),S[w]=n,S.$index=r,k(t,S)}}return function(t,n,o,h,$){var v=Dt();t.$watchCollection(m,(function(o){var h,m,y,k,A,O,M,T,V,N,j,I,R=n[0],P=Dt();if(g&&(t[g]=o),x(o))V=o,T=b||c;else for(var U in T=b||l,V=[],o)f.call(o,U)&&"$"!==U.charAt(0)&&V.push(U);for(k=V.length,j=new Array(k),h=0;h=a}}}}}];function Ta(t,e,n){if(t){if(F(t)&&(t=new RegExp("^"+t+"$")),!t.test)throw o("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",e,t,wt(n));return t}}function Va(t){var e=V(t);return N(e)?-1:e}t.angular.bootstrap?t.console&&console.log("WARNING: Tried to load AngularJS more than once."):(function(){var e;if(!jt){var n=lt();(u=_(n)?r:n?t[n]:void 0)&&u.fn.on?(s=u,M(u.fn,{scope:Te.scope,isolateScope:Te.isolateScope,controller:Te.controller,injector:Te.injector,inheritedData:Te.inheritedData})):s=he,e=s.cleanData,s.cleanData=function(t){for(var n,r,i=0;null!=(r=t[i]);i++)(n=(s._data(r)||{}).events)&&n.$destroy&&s(r).triggerHandler("$destroy");e(t)},b.element=s,jt=!0}}(),function(e){M(e,{errorHandlingConfig:n,bootstrap:Ot,copy:at,extend:M,merge:T,equals:ut,element:s,forEach:C,injector:Ye,noop:I,bind:pt,toJson:$t,fromJson:vt,identity:R,isUndefined:_,isDefined:D,isString:F,isFunction:G,isObject:L,isNumber:H,isElement:nt,isArray:z,version:Bt,isDate:B,callbacks:{$$counter:0},getTestability:Tt,reloadWithDebugInfo:Mt,UNSAFE_restoreLegacyJqLiteXHTMLReplacement:It,$$minErr:o,$$csp:ct,$$encodeUriSegment:Et,$$encodeUriQuery:St,$$lowercase:h,$$stringify:Lt,$$uppercase:p}),(c=function(t){var e=o("$injector"),n=o("ng");function r(t,e,n){return t[e]||(t[e]=n())}var i=r(t,"angular",Object);return i.$$minErr=i.$$minErr||o,r(i,"module",(function(){var t={};return function(i,o,a){var s={};return function(t,e){if("hasOwnProperty"===t)throw n("badname","hasOwnProperty is not a valid {0} name","module")}(i),o&&t.hasOwnProperty(i)&&(t[i]=null),r(t,i,(function(){if(!o)throw e("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",i);var t=[],r=[],u=[],c=f("$injector","invoke","push",r),l={_invokeQueue:t,_configBlocks:r,_runBlocks:u,info:function(t){if(D(t)){if(!L(t))throw n("aobj","Argument '{0}' must be an object","value");return s=t,this}return s},requires:o,name:i,provider:h("$provide","provider"),factory:h("$provide","factory"),service:h("$provide","service"),value:f("$provide","value"),constant:f("$provide","constant","unshift"),decorator:h("$provide","decorator",r),animation:h("$animateProvider","register"),filter:h("$filterProvider","register"),controller:h("$controllerProvider","register"),directive:h("$compileProvider","directive"),component:h("$compileProvider","component"),config:c,run:function(t){return u.push(t),this}};return a&&c(a),l;function f(e,n,r,i){return i||(i=t),function(){return i[r||"push"]([e,n,arguments]),l}}function h(e,n,r){return r||(r=t),function(t,o){return o&&G(o)&&(o.$$moduleName=i),r.push([e,n,arguments]),l}}}))}}))}(t))("ng",["ngLocale"],["$provide",function(t){t.provider({$$sanitizeUri:Fr}),t.provider("$compile",vn).directive({a:Ui,input:go,textarea:go,form:Bi,script:ba,select:Ea,option:Sa,ngBind:xo,ngBindHtml:Eo,ngBindTemplate:Co,ngClass:Ao,ngClassEven:Mo,ngClassOdd:Oo,ngCloak:To,ngController:Vo,ngForm:zi,ngHide:pa,ngIf:Ro,ngInclude:Po,ngInit:_o,ngNonBindable:na,ngPluralize:aa,ngRef:ua,ngRepeat:ca,ngShow:ha,ngStyle:da,ngSwitch:$a,ngSwitchWhen:va,ngSwitchDefault:ma,ngOptions:oa,ngTransclude:ya,ngModel:Yo,ngList:Do,ngChange:So,pattern:Aa,ngPattern:Aa,required:ka,ngRequired:ka,minlength:Ma,ngMinlength:Ma,maxlength:Oa,ngMaxlength:Oa,ngValue:wo,ngModelOptions:ta}).directive({ngInclude:Uo,input:yo}).directive(_i).directive(No),t.provider({$anchorScroll:Xe,$animate:an,$animateCss:cn,$$animateJs:rn,$$animateQueue:on,$$AnimateRunner:un,$$animateAsyncRun:sn,$browser:fn,$cacheFactory:hn,$controller:kn,$document:An,$$isDocumentHidden:On,$exceptionHandler:Mn,$filter:pi,$$forceReflow:Tn,$interpolate:Kn,$interval:Zn,$$intervalFactory:Yn,$http:Bn,$httpParamSerializer:Un,$httpParamSerializerJQLike:_n,$httpBackend:Wn,$xhrFactory:zn,$jsonpCallbacks:Xn,$location:dr,$log:$r,$parse:jr,$rootScope:qr,$q:Ir,$$q:Rr,$sce:Jr,$sceDelegate:Kr,$sniffer:Zr,$$taskTrackerFactory:Yr,$templateCache:pn,$templateRequest:ti,$$testability:ei,$timeout:ri,$window:li,$$rAF:Lr,$$jqLite:Ue,$$Map:Fe,$$cookieReader:hi})}]).info({angularVersion:"1.8.2"})}(b),b.module("ngLocale",[],["$provide",function(t){t.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(t,e){var n=0|t,r=function(t,e){var n=e;void 0===n&&(n=Math.min(function(t){var e=(t+="").indexOf(".");return-1==e?0:t.length-e-1}(t),3));var r=Math.pow(10,n);return{v:n,f:(t*r|0)%r}}(t,e);return 1==n&&0==r.v?"one":"other"}})}]),s((function(){!function(e,n){var r,i,o={};if(C(kt,(function(t){var n=t+"app";!r&&e.hasAttribute&&e.hasAttribute(n)&&(r=e,i=e.getAttribute(n))})),C(kt,(function(t){var n,o=t+"app";!r&&(n=e.querySelector("["+o.replace(":","\\:")+"]"))&&(r=n,i=n.getAttribute(o))})),r){if(!At)return void t.console.error("AngularJS: disabling automatic bootstrap. - - - - - - - -
-
- - -
-
- -
- - - {{ actualTitle }} - - - - - - - -
- -
- - - -
- -
- -
-
- - - - - - - -
-
- - - - - - - - - - - - - - - diff --git a/snippet/3.7.0/scripts/app.js b/snippet/3.7.0/scripts/app.js deleted file mode 100644 index 7c3a8af..0000000 --- a/snippet/3.7.0/scripts/app.js +++ /dev/null @@ -1,42 +0,0 @@ -/*! - * ************************************************************************* - * * * - * * xCALLY Motion - The Omnichannel Contact Center * - * * Copyright (c) Xenialab s.r.l. All Rights Reserved * - * * * - * ************************************************************************* - * * * - * * Email: info@xcally.com * - * * Website: https://www.xcally.com * - * * * - * ************************************************************************* - * * * - * * The SOFTWARE PRODUCT is protected by copyright laws and international * - * * copyright treaties, as well as other intellectual property laws and * - * * treaties. The SOFTWARE PRODUCT is licensed, not sold. * - * * * - * ************************************************************************* - */ -"use strict"; -(self["webpackChunkmotion_chat"] = self["webpackChunkmotion_chat"] || []).push([["app"],{ - -/***/ "./src/styles/app.scss": -/*!*****************************!*\ - !*** ./src/styles/app.scss ***! - \*****************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -// extracted by mini-css-extract-plugin - - -/***/ }) - -}, -/******/ __webpack_require__ => { // webpackRuntimeModules -/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) -/******/ __webpack_require__.O(0, ["chat"], () => (__webpack_exec__("./src/styles/app.scss"))); -/******/ var __webpack_exports__ = __webpack_require__.O(); -/******/ } -]); -//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/snippet/3.7.0/scripts/app.js.map b/snippet/3.7.0/scripts/app.js.map deleted file mode 100644 index 9b8ff55..0000000 --- a/snippet/3.7.0/scripts/app.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scripts/app.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA","sources":["webpack://motion-chat/./src/styles/app.scss?077d"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.7.0/scripts/chat.js b/snippet/3.7.0/scripts/chat.js deleted file mode 100644 index 79e2c42..0000000 --- a/snippet/3.7.0/scripts/chat.js +++ /dev/null @@ -1,149338 +0,0 @@ -(self["webpackChunkmotion_chat"] = self["webpackChunkmotion_chat"] || []).push([["chat"],{ - -/***/ "./node_modules/@flowjs/flow.js/src/flow.js": -/*!**************************************************!*\ - !*** ./node_modules/@flowjs/flow.js/src/flow.js ***! - \**************************************************/ -/***/ ((module, exports, __webpack_require__) => { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @license MIT - */ -(function(window, document, undefined) {'use strict'; - if (!window || !document) { - console.warn('Flowjs needs window and document objects to work'); - return; - } - // ie10+ - var ie10plus = window.navigator.msPointerEnabled; - /** - * Flow.js is a library providing multiple simultaneous, stable and - * resumable uploads via the HTML5 File API. - * @param [opts] - * @param {number|Function} [opts.chunkSize] - * @param {bool} [opts.forceChunkSize] - * @param {number} [opts.simultaneousUploads] - * @param {bool} [opts.singleFile] - * @param {string} [opts.fileParameterName] - * @param {number} [opts.progressCallbacksInterval] - * @param {number} [opts.speedSmoothingFactor] - * @param {Object|Function} [opts.query] - * @param {Object|Function} [opts.headers] - * @param {bool} [opts.withCredentials] - * @param {Function} [opts.preprocess] - * @param {string} [opts.method] - * @param {string|Function} [opts.testMethod] - * @param {string|Function} [opts.uploadMethod] - * @param {bool} [opts.prioritizeFirstAndLastChunk] - * @param {bool} [opts.allowDuplicateUploads] - * @param {string|Function} [opts.target] - * @param {number} [opts.maxChunkRetries] - * @param {number} [opts.chunkRetryInterval] - * @param {Array.} [opts.permanentErrors] - * @param {Array.} [opts.successStatuses] - * @param {Function} [opts.initFileFn] - * @param {Function} [opts.readFileFn] - * @param {Function} [opts.generateUniqueIdentifier] - * @constructor - */ - function Flow(opts) { - /** - * Supported by browser? - * @type {boolean} - */ - this.support = ( - typeof File !== 'undefined' && - typeof Blob !== 'undefined' && - typeof FileList !== 'undefined' && - ( - !!Blob.prototype.slice || !!Blob.prototype.webkitSlice || !!Blob.prototype.mozSlice || - false - ) // slicing files support - ); - - if (!this.support) { - return ; - } - - /** - * Check if directory upload is supported - * @type {boolean} - */ - this.supportDirectory = ( - /Chrome/.test(window.navigator.userAgent) || - /Firefox/.test(window.navigator.userAgent) || - /Edge/.test(window.navigator.userAgent) - ); - - /** - * List of FlowFile objects - * @type {Array.} - */ - this.files = []; - - /** - * Default options for flow.js - * @type {Object} - */ - this.defaults = { - chunkSize: 1024 * 1024, - forceChunkSize: false, - simultaneousUploads: 3, - singleFile: false, - fileParameterName: 'file', - progressCallbacksInterval: 500, - speedSmoothingFactor: 0.1, - query: {}, - headers: {}, - withCredentials: false, - preprocess: null, - changeRawDataBeforeSend: null, - method: 'multipart', - testMethod: 'GET', - uploadMethod: 'POST', - prioritizeFirstAndLastChunk: false, - allowDuplicateUploads: false, - target: '/', - testChunks: true, - generateUniqueIdentifier: null, - maxChunkRetries: 0, - chunkRetryInterval: null, - permanentErrors: [404, 413, 415, 500, 501], - successStatuses: [200, 201, 202], - onDropStopPropagation: false, - initFileFn: null, - readFileFn: webAPIFileRead - }; - - /** - * Current options - * @type {Object} - */ - this.opts = {}; - - /** - * List of events: - * key stands for event name - * value array list of callbacks - * @type {} - */ - this.events = {}; - - var $ = this; - - /** - * On drop event - * @function - * @param {MouseEvent} event - */ - this.onDrop = function (event) { - if ($.opts.onDropStopPropagation) { - event.stopPropagation(); - } - event.preventDefault(); - var dataTransfer = event.dataTransfer; - if (dataTransfer.items && dataTransfer.items[0] && - dataTransfer.items[0].webkitGetAsEntry) { - $.webkitReadDataTransfer(event); - } else { - $.addFiles(dataTransfer.files, event); - } - }; - - /** - * Prevent default - * @function - * @param {MouseEvent} event - */ - this.preventEvent = function (event) { - event.preventDefault(); - }; - - - /** - * Current options - * @type {Object} - */ - this.opts = Flow.extend({}, this.defaults, opts || {}); - - } - - Flow.prototype = { - /** - * Set a callback for an event, possible events: - * fileSuccess(file), fileProgress(file), fileAdded(file, event), - * fileRemoved(file), fileRetry(file), fileError(file, message), - * complete(), progress(), error(message, file), pause() - * @function - * @param {string} event - * @param {Function} callback - */ - on: function (event, callback) { - event = event.toLowerCase(); - if (!this.events.hasOwnProperty(event)) { - this.events[event] = []; - } - this.events[event].push(callback); - }, - - /** - * Remove event callback - * @function - * @param {string} [event] removes all events if not specified - * @param {Function} [fn] removes all callbacks of event if not specified - */ - off: function (event, fn) { - if (event !== undefined) { - event = event.toLowerCase(); - if (fn !== undefined) { - if (this.events.hasOwnProperty(event)) { - arrayRemove(this.events[event], fn); - } - } else { - delete this.events[event]; - } - } else { - this.events = {}; - } - }, - - /** - * Fire an event - * @function - * @param {string} event event name - * @param {...} args arguments of a callback - * @return {bool} value is false if at least one of the event handlers which handled this event - * returned false. Otherwise it returns true. - */ - fire: function (event, args) { - // `arguments` is an object, not array, in FF, so: - args = Array.prototype.slice.call(arguments); - event = event.toLowerCase(); - var preventDefault = false; - if (this.events.hasOwnProperty(event)) { - each(this.events[event], function (callback) { - preventDefault = callback.apply(this, args.slice(1)) === false || preventDefault; - }, this); - } - if (event != 'catchall') { - args.unshift('catchAll'); - preventDefault = this.fire.apply(this, args) === false || preventDefault; - } - return !preventDefault; - }, - - /** - * Read webkit dataTransfer object - * @param event - */ - webkitReadDataTransfer: function (event) { - var $ = this; - var queue = event.dataTransfer.items.length; - var files = []; - each(event.dataTransfer.items, function (item) { - var entry = item.webkitGetAsEntry(); - if (!entry) { - decrement(); - return ; - } - if (entry.isFile) { - // due to a bug in Chrome's File System API impl - #149735 - fileReadSuccess(item.getAsFile(), entry.fullPath); - } else { - readDirectory(entry.createReader()); - } - }); - function readDirectory(reader) { - reader.readEntries(function (entries) { - if (entries.length) { - queue += entries.length; - each(entries, function(entry) { - if (entry.isFile) { - var fullPath = entry.fullPath; - entry.file(function (file) { - fileReadSuccess(file, fullPath); - }, readError); - } else if (entry.isDirectory) { - readDirectory(entry.createReader()); - } - }); - readDirectory(reader); - } else { - decrement(); - } - }, readError); - } - function fileReadSuccess(file, fullPath) { - // relative path should not start with "/" - file.relativePath = fullPath.substring(1); - files.push(file); - decrement(); - } - function readError(fileError) { - decrement(); - throw fileError; - } - function decrement() { - if (--queue == 0) { - $.addFiles(files, event); - } - } - }, - - /** - * Generate unique identifier for a file - * @function - * @param {FlowFile} file - * @returns {string} - */ - generateUniqueIdentifier: function (file) { - var custom = this.opts.generateUniqueIdentifier; - if (typeof custom === 'function') { - return custom(file); - } - // Some confusion in different versions of Firefox - var relativePath = file.relativePath || file.webkitRelativePath || file.fileName || file.name; - return file.size + '-' + relativePath.replace(/[^0-9a-zA-Z_-]/img, ''); - }, - - /** - * Upload next chunk from the queue - * @function - * @returns {boolean} - * @private - */ - uploadNextChunk: function (preventEvents) { - // In some cases (such as videos) it's really handy to upload the first - // and last chunk of a file quickly; this let's the server check the file's - // metadata and determine if there's even a point in continuing. - var found = false; - if (this.opts.prioritizeFirstAndLastChunk) { - each(this.files, function (file) { - if (!file.paused && file.chunks.length && - file.chunks[0].status() === 'pending') { - file.chunks[0].send(); - found = true; - return false; - } - if (!file.paused && file.chunks.length > 1 && - file.chunks[file.chunks.length - 1].status() === 'pending') { - file.chunks[file.chunks.length - 1].send(); - found = true; - return false; - } - }); - if (found) { - return found; - } - } - - // Now, simply look for the next, best thing to upload - each(this.files, function (file) { - if (!file.paused) { - each(file.chunks, function (chunk) { - if (chunk.status() === 'pending') { - chunk.send(); - found = true; - return false; - } - }); - } - if (found) { - return false; - } - }); - if (found) { - return true; - } - - // The are no more outstanding chunks to upload, check is everything is done - var outstanding = false; - each(this.files, function (file) { - if (!file.isComplete()) { - outstanding = true; - return false; - } - }); - if (!outstanding && !preventEvents) { - // All chunks have been uploaded, complete - async(function () { - this.fire('complete'); - }, this); - } - return false; - }, - - - /** - * Assign a browse action to one or more DOM nodes. - * @function - * @param {Element|Array.} domNodes - * @param {boolean} isDirectory Pass in true to allow directories to - * @param {boolean} singleFile prevent multi file upload - * @param {Object} attributes set custom attributes: - * http://www.w3.org/TR/html-markup/input.file.html#input.file-attributes - * eg: accept: 'image/*' - * be selected (Chrome only). - */ - assignBrowse: function (domNodes, isDirectory, singleFile, attributes) { - if (domNodes instanceof Element) { - domNodes = [domNodes]; - } - - each(domNodes, function (domNode) { - var input; - if (domNode.tagName === 'INPUT' && domNode.type === 'file') { - input = domNode; - } else { - input = document.createElement('input'); - input.setAttribute('type', 'file'); - // display:none - not working in opera 12 - extend(input.style, { - visibility: 'hidden', - position: 'absolute', - width: '1px', - height: '1px' - }); - // for opera 12 browser, input must be assigned to a document - domNode.appendChild(input); - // https://developer.mozilla.org/en/using_files_from_web_applications) - // event listener is executed two times - // first one - original mouse click event - // second - input.click(), input is inside domNode - domNode.addEventListener('click', function() { - input.click(); - }, false); - } - if (!this.opts.singleFile && !singleFile) { - input.setAttribute('multiple', 'multiple'); - } - if (isDirectory) { - input.setAttribute('webkitdirectory', 'webkitdirectory'); - } - each(attributes, function (value, key) { - input.setAttribute(key, value); - }); - // When new files are added, simply append them to the overall list - var $ = this; - input.addEventListener('change', function (e) { - if (e.target.value) { - $.addFiles(e.target.files, e); - e.target.value = ''; - } - }, false); - }, this); - }, - - /** - * Assign one or more DOM nodes as a drop target. - * @function - * @param {Element|Array.} domNodes - */ - assignDrop: function (domNodes) { - if (typeof domNodes.length === 'undefined') { - domNodes = [domNodes]; - } - each(domNodes, function (domNode) { - domNode.addEventListener('dragover', this.preventEvent, false); - domNode.addEventListener('dragenter', this.preventEvent, false); - domNode.addEventListener('drop', this.onDrop, false); - }, this); - }, - - /** - * Un-assign drop event from DOM nodes - * @function - * @param domNodes - */ - unAssignDrop: function (domNodes) { - if (typeof domNodes.length === 'undefined') { - domNodes = [domNodes]; - } - each(domNodes, function (domNode) { - domNode.removeEventListener('dragover', this.preventEvent); - domNode.removeEventListener('dragenter', this.preventEvent); - domNode.removeEventListener('drop', this.onDrop); - }, this); - }, - - /** - * Returns a boolean indicating whether or not the instance is currently - * uploading anything. - * @function - * @returns {boolean} - */ - isUploading: function () { - var uploading = false; - each(this.files, function (file) { - if (file.isUploading()) { - uploading = true; - return false; - } - }); - return uploading; - }, - - /** - * should upload next chunk - * @function - * @returns {boolean|number} - */ - _shouldUploadNext: function () { - var num = 0; - var should = true; - var simultaneousUploads = this.opts.simultaneousUploads; - each(this.files, function (file) { - each(file.chunks, function(chunk) { - if (chunk.status() === 'uploading') { - num++; - if (num >= simultaneousUploads) { - should = false; - return false; - } - } - }); - }); - // if should is true then return uploading chunks's length - return should && num; - }, - - /** - * Start or resume uploading. - * @function - */ - upload: function () { - // Make sure we don't start too many uploads at once - var ret = this._shouldUploadNext(); - if (ret === false) { - return; - } - // Kick off the queue - this.fire('uploadStart'); - var started = false; - for (var num = 1; num <= this.opts.simultaneousUploads - ret; num++) { - started = this.uploadNextChunk(true) || started; - } - if (!started) { - async(function () { - this.fire('complete'); - }, this); - } - }, - - /** - * Resume uploading. - * @function - */ - resume: function () { - each(this.files, function (file) { - if (!file.isComplete()) { - file.resume(); - } - }); - }, - - /** - * Pause uploading. - * @function - */ - pause: function () { - each(this.files, function (file) { - file.pause(); - }); - }, - - /** - * Cancel upload of all FlowFile objects and remove them from the list. - * @function - */ - cancel: function () { - for (var i = this.files.length - 1; i >= 0; i--) { - this.files[i].cancel(); - } - }, - - /** - * Returns a number between 0 and 1 indicating the current upload progress - * of all files. - * @function - * @returns {number} - */ - progress: function () { - var totalDone = 0; - var totalSize = 0; - // Resume all chunks currently being uploaded - each(this.files, function (file) { - totalDone += file.progress() * file.size; - totalSize += file.size; - }); - return totalSize > 0 ? totalDone / totalSize : 0; - }, - - /** - * Add a HTML5 File object to the list of files. - * @function - * @param {File} file - * @param {Event} [event] event is optional - */ - addFile: function (file, event) { - this.addFiles([file], event); - }, - - /** - * Add a HTML5 File object to the list of files. - * @function - * @param {FileList|Array} fileList - * @param {Event} [event] event is optional - */ - addFiles: function (fileList, event) { - var files = []; - each(fileList, function (file) { - // https://github.com/flowjs/flow.js/issues/55 - if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.'))) { - var uniqueIdentifier = this.generateUniqueIdentifier(file); - if (this.opts.allowDuplicateUploads || !this.getFromUniqueIdentifier(uniqueIdentifier)) { - var f = new FlowFile(this, file, uniqueIdentifier); - if (this.fire('fileAdded', f, event)) { - files.push(f); - } - } - } - }, this); - if (this.fire('filesAdded', files, event)) { - each(files, function (file) { - if (this.opts.singleFile && this.files.length > 0) { - this.removeFile(this.files[0]); - } - this.files.push(file); - }, this); - this.fire('filesSubmitted', files, event); - } - }, - - - /** - * Cancel upload of a specific FlowFile object from the list. - * @function - * @param {FlowFile} file - */ - removeFile: function (file) { - for (var i = this.files.length - 1; i >= 0; i--) { - if (this.files[i] === file) { - this.files.splice(i, 1); - file.abort(); - this.fire('fileRemoved', file); - } - } - }, - - /** - * Look up a FlowFile object by its unique identifier. - * @function - * @param {string} uniqueIdentifier - * @returns {boolean|FlowFile} false if file was not found - */ - getFromUniqueIdentifier: function (uniqueIdentifier) { - var ret = false; - each(this.files, function (file) { - if (file.uniqueIdentifier === uniqueIdentifier) { - ret = file; - } - }); - return ret; - }, - - /** - * Returns the total size of all files in bytes. - * @function - * @returns {number} - */ - getSize: function () { - var totalSize = 0; - each(this.files, function (file) { - totalSize += file.size; - }); - return totalSize; - }, - - /** - * Returns the total size uploaded of all files in bytes. - * @function - * @returns {number} - */ - sizeUploaded: function () { - var size = 0; - each(this.files, function (file) { - size += file.sizeUploaded(); - }); - return size; - }, - - /** - * Returns remaining time to upload all files in seconds. Accuracy is based on average speed. - * If speed is zero, time remaining will be equal to positive infinity `Number.POSITIVE_INFINITY` - * @function - * @returns {number} - */ - timeRemaining: function () { - var sizeDelta = 0; - var averageSpeed = 0; - each(this.files, function (file) { - if (!file.paused && !file.error) { - sizeDelta += file.size - file.sizeUploaded(); - averageSpeed += file.averageSpeed; - } - }); - if (sizeDelta && !averageSpeed) { - return Number.POSITIVE_INFINITY; - } - if (!sizeDelta && !averageSpeed) { - return 0; - } - return Math.floor(sizeDelta / averageSpeed); - } - }; - - - - - - - /** - * FlowFile class - * @name FlowFile - * @param {Flow} flowObj - * @param {File} file - * @param {string} uniqueIdentifier - * @constructor - */ - function FlowFile(flowObj, file, uniqueIdentifier) { - - /** - * Reference to parent Flow instance - * @type {Flow} - */ - this.flowObj = flowObj; - - /** - * Used to store the bytes read - * @type {Blob|string} - */ - this.bytes = null; - - /** - * Reference to file - * @type {File} - */ - this.file = file; - - /** - * File name. Some confusion in different versions of Firefox - * @type {string} - */ - this.name = file.fileName || file.name; - - /** - * File size - * @type {number} - */ - this.size = file.size; - - /** - * Relative file path - * @type {string} - */ - this.relativePath = file.relativePath || file.webkitRelativePath || this.name; - - /** - * File unique identifier - * @type {string} - */ - this.uniqueIdentifier = (uniqueIdentifier === undefined ? flowObj.generateUniqueIdentifier(file) : uniqueIdentifier); - - /** - * Size of Each Chunk - * @type {number} - */ - this.chunkSize = 0; - - /** - * List of chunks - * @type {Array.} - */ - this.chunks = []; - - /** - * Indicated if file is paused - * @type {boolean} - */ - this.paused = false; - - /** - * Indicated if file has encountered an error - * @type {boolean} - */ - this.error = false; - - /** - * Average upload speed - * @type {number} - */ - this.averageSpeed = 0; - - /** - * Current upload speed - * @type {number} - */ - this.currentSpeed = 0; - - /** - * Date then progress was called last time - * @type {number} - * @private - */ - this._lastProgressCallback = Date.now(); - - /** - * Previously uploaded file size - * @type {number} - * @private - */ - this._prevUploadedSize = 0; - - /** - * Holds previous progress - * @type {number} - * @private - */ - this._prevProgress = 0; - - this.bootstrap(); - } - - FlowFile.prototype = { - /** - * Update speed parameters - * @link http://stackoverflow.com/questions/2779600/how-to-estimate-download-time-remaining-accurately - * @function - */ - measureSpeed: function () { - var timeSpan = Date.now() - this._lastProgressCallback; - if (!timeSpan) { - return ; - } - var smoothingFactor = this.flowObj.opts.speedSmoothingFactor; - var uploaded = this.sizeUploaded(); - // Prevent negative upload speed after file upload resume - this.currentSpeed = Math.max((uploaded - this._prevUploadedSize) / timeSpan * 1000, 0); - this.averageSpeed = smoothingFactor * this.currentSpeed + (1 - smoothingFactor) * this.averageSpeed; - this._prevUploadedSize = uploaded; - }, - - /** - * For internal usage only. - * Callback when something happens within the chunk. - * @function - * @param {FlowChunk} chunk - * @param {string} event can be 'progress', 'success', 'error' or 'retry' - * @param {string} [message] - */ - chunkEvent: function (chunk, event, message) { - switch (event) { - case 'progress': - if (Date.now() - this._lastProgressCallback < - this.flowObj.opts.progressCallbacksInterval) { - break; - } - this.measureSpeed(); - this.flowObj.fire('fileProgress', this, chunk); - this.flowObj.fire('progress'); - this._lastProgressCallback = Date.now(); - break; - case 'error': - this.error = true; - this.abort(true); - this.flowObj.fire('fileError', this, message, chunk); - this.flowObj.fire('error', message, this, chunk); - break; - case 'success': - if (this.error) { - return; - } - this.measureSpeed(); - this.flowObj.fire('fileProgress', this, chunk); - this.flowObj.fire('progress'); - this._lastProgressCallback = Date.now(); - if (this.isComplete()) { - this.currentSpeed = 0; - this.averageSpeed = 0; - this.flowObj.fire('fileSuccess', this, message, chunk); - } - break; - case 'retry': - this.flowObj.fire('fileRetry', this, chunk); - break; - } - }, - - /** - * Pause file upload - * @function - */ - pause: function() { - this.paused = true; - this.abort(); - }, - - /** - * Resume file upload - * @function - */ - resume: function() { - this.paused = false; - this.flowObj.upload(); - }, - - /** - * Abort current upload - * @function - */ - abort: function (reset) { - this.currentSpeed = 0; - this.averageSpeed = 0; - var chunks = this.chunks; - if (reset) { - this.chunks = []; - } - each(chunks, function (c) { - if (c.status() === 'uploading') { - c.abort(); - this.flowObj.uploadNextChunk(); - } - }, this); - }, - - /** - * Cancel current upload and remove from a list - * @function - */ - cancel: function () { - this.flowObj.removeFile(this); - }, - - /** - * Retry aborted file upload - * @function - */ - retry: function () { - this.bootstrap(); - this.flowObj.upload(); - }, - - /** - * Clear current chunks and slice file again - * @function - */ - bootstrap: function () { - if (typeof this.flowObj.opts.initFileFn === "function") { - this.flowObj.opts.initFileFn(this); - } - - this.abort(true); - this.error = false; - // Rebuild stack of chunks from file - this._prevProgress = 0; - var round = this.flowObj.opts.forceChunkSize ? Math.ceil : Math.floor; - this.chunkSize = evalOpts(this.flowObj.opts.chunkSize, this); - var chunks = Math.max( - round(this.size / this.chunkSize), 1 - ); - for (var offset = 0; offset < chunks; offset++) { - this.chunks.push( - new FlowChunk(this.flowObj, this, offset) - ); - } - }, - - /** - * Get current upload progress status - * @function - * @returns {number} from 0 to 1 - */ - progress: function () { - if (this.error) { - return 1; - } - if (this.chunks.length === 1) { - this._prevProgress = Math.max(this._prevProgress, this.chunks[0].progress()); - return this._prevProgress; - } - // Sum up progress across everything - var bytesLoaded = 0; - each(this.chunks, function (c) { - // get chunk progress relative to entire file - bytesLoaded += c.progress() * (c.endByte - c.startByte); - }); - var percent = bytesLoaded / this.size; - // We don't want to lose percentages when an upload is paused - this._prevProgress = Math.max(this._prevProgress, percent > 0.9999 ? 1 : percent); - return this._prevProgress; - }, - - /** - * Indicates if file is being uploaded at the moment - * @function - * @returns {boolean} - */ - isUploading: function () { - var uploading = false; - each(this.chunks, function (chunk) { - if (chunk.status() === 'uploading') { - uploading = true; - return false; - } - }); - return uploading; - }, - - /** - * Indicates if file is has finished uploading and received a response - * @function - * @returns {boolean} - */ - isComplete: function () { - var outstanding = false; - each(this.chunks, function (chunk) { - var status = chunk.status(); - if (status === 'pending' || status === 'uploading' || status === 'reading' || chunk.preprocessState === 1 || chunk.readState === 1) { - outstanding = true; - return false; - } - }); - return !outstanding; - }, - - /** - * Count total size uploaded - * @function - * @returns {number} - */ - sizeUploaded: function () { - var size = 0; - each(this.chunks, function (chunk) { - size += chunk.sizeUploaded(); - }); - return size; - }, - - /** - * Returns remaining time to finish upload file in seconds. Accuracy is based on average speed. - * If speed is zero, time remaining will be equal to positive infinity `Number.POSITIVE_INFINITY` - * @function - * @returns {number} - */ - timeRemaining: function () { - if (this.paused || this.error) { - return 0; - } - var delta = this.size - this.sizeUploaded(); - if (delta && !this.averageSpeed) { - return Number.POSITIVE_INFINITY; - } - if (!delta && !this.averageSpeed) { - return 0; - } - return Math.floor(delta / this.averageSpeed); - }, - - /** - * Get file type - * @function - * @returns {string} - */ - getType: function () { - return this.file.type && this.file.type.split('/')[1]; - }, - - /** - * Get file extension - * @function - * @returns {string} - */ - getExtension: function () { - return this.name.substr((~-this.name.lastIndexOf(".") >>> 0) + 2).toLowerCase(); - } - }; - - /** - * Default read function using the webAPI - * - * @function webAPIFileRead(fileObj, startByte, endByte, fileType, chunk) - * - */ - function webAPIFileRead(fileObj, startByte, endByte, fileType, chunk) { - var function_name = 'slice'; - - if (fileObj.file.slice) - function_name = 'slice'; - else if (fileObj.file.mozSlice) - function_name = 'mozSlice'; - else if (fileObj.file.webkitSlice) - function_name = 'webkitSlice'; - - chunk.readFinished(fileObj.file[function_name](startByte, endByte, fileType)); - } - - - /** - * Class for storing a single chunk - * @name FlowChunk - * @param {Flow} flowObj - * @param {FlowFile} fileObj - * @param {number} offset - * @constructor - */ - function FlowChunk(flowObj, fileObj, offset) { - - /** - * Reference to parent flow object - * @type {Flow} - */ - this.flowObj = flowObj; - - /** - * Reference to parent FlowFile object - * @type {FlowFile} - */ - this.fileObj = fileObj; - - /** - * File offset - * @type {number} - */ - this.offset = offset; - - /** - * Indicates if chunk existence was checked on the server - * @type {boolean} - */ - this.tested = false; - - /** - * Number of retries performed - * @type {number} - */ - this.retries = 0; - - /** - * Pending retry - * @type {boolean} - */ - this.pendingRetry = false; - - /** - * Preprocess state - * @type {number} 0 = unprocessed, 1 = processing, 2 = finished - */ - this.preprocessState = 0; - - /** - * Read state - * @type {number} 0 = not read, 1 = reading, 2 = finished - */ - this.readState = 0; - - - /** - * Bytes transferred from total request size - * @type {number} - */ - this.loaded = 0; - - /** - * Total request size - * @type {number} - */ - this.total = 0; - - /** - * Size of a chunk - * @type {number} - */ - this.chunkSize = this.fileObj.chunkSize; - - /** - * Chunk start byte in a file - * @type {number} - */ - this.startByte = this.offset * this.chunkSize; - - /** - * A specific filename for this chunk which otherwise default to the main name - * @type {string} - */ - this.filename = null; - - /** - * Compute the endbyte in a file - * - */ - this.computeEndByte = function() { - var endByte = Math.min(this.fileObj.size, (this.offset + 1) * this.chunkSize); - if (this.fileObj.size - endByte < this.chunkSize && !this.flowObj.opts.forceChunkSize) { - // The last chunk will be bigger than the chunk size, - // but less than 2 * this.chunkSize - endByte = this.fileObj.size; - } - return endByte; - } - - /** - * Chunk end byte in a file - * @type {number} - */ - this.endByte = this.computeEndByte(); - - /** - * XMLHttpRequest - * @type {XMLHttpRequest} - */ - this.xhr = null; - - var $ = this; - - /** - * Send chunk event - * @param event - * @param {...} args arguments of a callback - */ - this.event = function (event, args) { - args = Array.prototype.slice.call(arguments); - args.unshift($); - $.fileObj.chunkEvent.apply($.fileObj, args); - }; - /** - * Catch progress event - * @param {ProgressEvent} event - */ - this.progressHandler = function(event) { - if (event.lengthComputable) { - $.loaded = event.loaded ; - $.total = event.total; - } - $.event('progress', event); - }; - - /** - * Catch test event - * @param {Event} event - */ - this.testHandler = function(event) { - var status = $.status(true); - if (status === 'error') { - $.event(status, $.message()); - $.flowObj.uploadNextChunk(); - } else if (status === 'success') { - $.tested = true; - $.event(status, $.message()); - $.flowObj.uploadNextChunk(); - } else if (!$.fileObj.paused) { - // Error might be caused by file pause method - // Chunks does not exist on the server side - $.tested = true; - $.send(); - } - }; - - /** - * Upload has stopped - * @param {Event} event - */ - this.doneHandler = function(event) { - var status = $.status(); - if (status === 'success' || status === 'error') { - delete this.data; - $.event(status, $.message()); - $.flowObj.uploadNextChunk(); - } else if (!$.fileObj.paused) { - $.event('retry', $.message()); - $.pendingRetry = true; - $.abort(); - $.retries++; - var retryInterval = $.flowObj.opts.chunkRetryInterval; - if (retryInterval !== null) { - setTimeout(function () { - $.send(); - }, retryInterval); - } else { - $.send(); - } - } - }; - } - - FlowChunk.prototype = { - /** - * Get params for a request - * @function - */ - getParams: function () { - return { - flowChunkNumber: this.offset + 1, - flowChunkSize: this.chunkSize, - flowCurrentChunkSize: this.endByte - this.startByte, - flowTotalSize: this.fileObj.size, - flowIdentifier: this.fileObj.uniqueIdentifier, - flowFilename: this.fileObj.name, - flowRelativePath: this.fileObj.relativePath, - flowTotalChunks: this.fileObj.chunks.length - }; - }, - - /** - * Get target option with query params - * @function - * @param params - * @returns {string} - */ - getTarget: function(target, params){ - if (params.length == 0) { - return target; - } - - if(target.indexOf('?') < 0) { - target += '?'; - } else { - target += '&'; - } - return target + params.join('&'); - }, - - /** - * Makes a GET request without any data to see if the chunk has already - * been uploaded in a previous session - * @function - */ - test: function () { - // Set up request and listen for event - this.xhr = new XMLHttpRequest(); - this.xhr.addEventListener("load", this.testHandler, false); - this.xhr.addEventListener("error", this.testHandler, false); - var testMethod = evalOpts(this.flowObj.opts.testMethod, this.fileObj, this); - var data = this.prepareXhrRequest(testMethod, true); - this.xhr.send(data); - }, - - /** - * Finish preprocess state - * @function - */ - preprocessFinished: function () { - // Re-compute the endByte after the preprocess function to allow an - // implementer of preprocess to set the fileObj size - this.endByte = this.computeEndByte(); - - this.preprocessState = 2; - this.send(); - }, - - /** - * Finish read state - * @function - */ - readFinished: function (bytes) { - this.readState = 2; - this.bytes = bytes; - this.send(); - }, - - - /** - * Uploads the actual data in a POST call - * @function - */ - send: function () { - var preprocess = this.flowObj.opts.preprocess; - var read = this.flowObj.opts.readFileFn; - if (typeof preprocess === 'function') { - switch (this.preprocessState) { - case 0: - this.preprocessState = 1; - preprocess(this); - return; - case 1: - return; - } - } - switch (this.readState) { - case 0: - this.readState = 1; - read(this.fileObj, this.startByte, this.endByte, this.fileObj.file.type, this); - return; - case 1: - return; - } - if (this.flowObj.opts.testChunks && !this.tested) { - this.test(); - return; - } - - this.loaded = 0; - this.total = 0; - this.pendingRetry = false; - - // Set up request and listen for event - this.xhr = new XMLHttpRequest(); - this.xhr.upload.addEventListener('progress', this.progressHandler, false); - this.xhr.addEventListener("load", this.doneHandler, false); - this.xhr.addEventListener("error", this.doneHandler, false); - - var uploadMethod = evalOpts(this.flowObj.opts.uploadMethod, this.fileObj, this); - var data = this.prepareXhrRequest(uploadMethod, false, this.flowObj.opts.method, this.bytes); - var changeRawDataBeforeSend = this.flowObj.opts.changeRawDataBeforeSend; - if (typeof changeRawDataBeforeSend === 'function') { - data = changeRawDataBeforeSend(this, data); - } - this.xhr.send(data); - }, - - /** - * Abort current xhr request - * @function - */ - abort: function () { - // Abort and reset - var xhr = this.xhr; - this.xhr = null; - if (xhr) { - xhr.abort(); - } - }, - - /** - * Retrieve current chunk upload status - * @function - * @returns {string} 'pending', 'uploading', 'success', 'error' - */ - status: function (isTest) { - if (this.readState === 1) { - return 'reading'; - } else if (this.pendingRetry || this.preprocessState === 1) { - // if pending retry then that's effectively the same as actively uploading, - // there might just be a slight delay before the retry starts - return 'uploading'; - } else if (!this.xhr) { - return 'pending'; - } else if (this.xhr.readyState < 4) { - // Status is really 'OPENED', 'HEADERS_RECEIVED' - // or 'LOADING' - meaning that stuff is happening - return 'uploading'; - } else { - if (this.flowObj.opts.successStatuses.indexOf(this.xhr.status) > -1) { - // HTTP 200, perfect - // HTTP 202 Accepted - The request has been accepted for processing, but the processing has not been completed. - return 'success'; - } else if (this.flowObj.opts.permanentErrors.indexOf(this.xhr.status) > -1 || - !isTest && this.retries >= this.flowObj.opts.maxChunkRetries) { - // HTTP 413/415/500/501, permanent error - return 'error'; - } else { - // this should never happen, but we'll reset and queue a retry - // a likely case for this would be 503 service unavailable - this.abort(); - return 'pending'; - } - } - }, - - /** - * Get response from xhr request - * @function - * @returns {String} - */ - message: function () { - return this.xhr ? this.xhr.responseText : ''; - }, - - /** - * Get upload progress - * @function - * @returns {number} - */ - progress: function () { - if (this.pendingRetry) { - return 0; - } - var s = this.status(); - if (s === 'success' || s === 'error') { - return 1; - } else if (s === 'pending') { - return 0; - } else { - return this.total > 0 ? this.loaded / this.total : 0; - } - }, - - /** - * Count total size uploaded - * @function - * @returns {number} - */ - sizeUploaded: function () { - var size = this.endByte - this.startByte; - // can't return only chunk.loaded value, because it is bigger than chunk size - if (this.status() !== 'success') { - size = this.progress() * size; - } - return size; - }, - - /** - * Prepare Xhr request. Set query, headers and data - * @param {string} method GET or POST - * @param {bool} isTest is this a test request - * @param {string} [paramsMethod] octet or form - * @param {Blob} [blob] to send - * @returns {FormData|Blob|Null} data to send - */ - prepareXhrRequest: function(method, isTest, paramsMethod, blob) { - // Add data from the query options - var query = evalOpts(this.flowObj.opts.query, this.fileObj, this, isTest); - query = extend(query || {}, this.getParams()); - - var target = evalOpts(this.flowObj.opts.target, this.fileObj, this, isTest); - var data = null; - if (method === 'GET' || paramsMethod === 'octet') { - // Add data from the query options - var params = []; - each(query, function (v, k) { - params.push([encodeURIComponent(k), encodeURIComponent(v)].join('=')); - }); - target = this.getTarget(target, params); - data = blob || null; - } else { - // Add data from the query options - data = new FormData(); - each(query, function (v, k) { - data.append(k, v); - }); - if (typeof blob !== "undefined") { - data.append(this.flowObj.opts.fileParameterName, blob, this.filename || this.fileObj.file.name); - } - } - - this.xhr.open(method, target, true); - this.xhr.withCredentials = this.flowObj.opts.withCredentials; - - // Add data from header options - each(evalOpts(this.flowObj.opts.headers, this.fileObj, this, isTest), function (v, k) { - this.xhr.setRequestHeader(k, v); - }, this); - - return data; - } - }; - - /** - * Remove value from array - * @param array - * @param value - */ - function arrayRemove(array, value) { - var index = array.indexOf(value); - if (index > -1) { - array.splice(index, 1); - } - } - - /** - * If option is a function, evaluate it with given params - * @param {*} data - * @param {...} args arguments of a callback - * @returns {*} - */ - function evalOpts(data, args) { - if (typeof data === "function") { - // `arguments` is an object, not array, in FF, so: - args = Array.prototype.slice.call(arguments); - data = data.apply(null, args.slice(1)); - } - return data; - } - Flow.evalOpts = evalOpts; - - /** - * Execute function asynchronously - * @param fn - * @param context - */ - function async(fn, context) { - setTimeout(fn.bind(context), 0); - } - - /** - * Extends the destination object `dst` by copying all of the properties from - * the `src` object(s) to `dst`. You can specify multiple `src` objects. - * @function - * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). - * @returns {Object} Reference to `dst`. - */ - function extend(dst, src) { - each(arguments, function(obj) { - if (obj !== dst) { - each(obj, function(value, key){ - dst[key] = value; - }); - } - }); - return dst; - } - Flow.extend = extend; - - /** - * Iterate each element of an object - * @function - * @param {Array|Object} obj object or an array to iterate - * @param {Function} callback first argument is a value and second is a key. - * @param {Object=} context Object to become context (`this`) for the iterator function. - */ - function each(obj, callback, context) { - if (!obj) { - return ; - } - var key; - // Is Array? - // Array.isArray won't work, not only arrays can be iterated by index https://github.com/flowjs/ng-flow/issues/236# - if (typeof(obj.length) !== 'undefined') { - for (key = 0; key < obj.length; key++) { - if (callback.call(context, obj[key], key) === false) { - return ; - } - } - } else { - for (key in obj) { - if (obj.hasOwnProperty(key) && callback.call(context, obj[key], key) === false) { - return ; - } - } - } - } - Flow.each = each; - - /** - * FlowFile constructor - * @type {FlowFile} - */ - Flow.FlowFile = FlowFile; - - /** - * FlowFile constructor - * @type {FlowChunk} - */ - Flow.FlowChunk = FlowChunk; - - /** - * Library version - * @type {string} - */ - Flow.version = '<%= version %>'; - - if ( true && module && typeof module.exports === "object" ) { - // Expose Flow as module.exports in loaders that implement the Node - // module pattern (including browserify). Do not create the global, since - // the user will be storing it themselves locally, and globals are frowned - // upon in the Node module world. - module.exports = Flow; - } else { - // Otherwise expose Flow to the global object as usual - window.Flow = Flow; - - // Register as a named AMD module, since Flow can be concatenated with other - // files that may use define, but not via a proper concatenation script that - // understands anonymous AMD modules. A named AMD is safest and most robust - // way to register. Lowercase flow is used because AMD module names are - // derived from file names, and Flow is normally delivered in a lowercase - // file name. Do this after creating the global so that if an AMD module wants - // to call noConflict to hide this version of Flow, it will work. - if ( true ) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return Flow; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } - } -})(typeof window !== 'undefined' && window, typeof document !== 'undefined' && document); - - -/***/ }), - -/***/ "./node_modules/@flowjs/ng-flow/dist/ng-flow.js": -/*!******************************************************!*\ - !*** ./node_modules/@flowjs/ng-flow/dist/ng-flow.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -/* provided dependency */ var Flow = __webpack_require__(/*! @flowjs/flow.js */ "./node_modules/@flowjs/flow.js/src/flow.js"); -/** - * @description - * var app = angular.module('App', ['flow.provider'], function(flowFactoryProvider){ - * flowFactoryProvider.defaults = {target: '/'}; - * }); - * @name flowFactoryProvider - */ -angular.module('flow.provider', []) -.provider('flowFactory', function() { - 'use strict'; - /** - * Define the default properties for flow.js - * @name flowFactoryProvider.defaults - * @type {Object} - */ - this.defaults = {}; - - /** - * Flow, MaybeFlow or NotFlow - * @name flowFactoryProvider.factory - * @type {function} - * @return {Flow} - */ - this.factory = function (options) { - return new Flow(options); - }; - - /** - * Define the default events - * @name flowFactoryProvider.events - * @type {Array} - * @private - */ - this.events = []; - - /** - * Add default events - * @name flowFactoryProvider.on - * @function - * @param {string} event - * @param {Function} callback - */ - this.on = function (event, callback) { - this.events.push([event, callback]); - }; - - this.$get = function() { - var fn = this.factory; - var defaults = this.defaults; - var events = this.events; - return { - 'create': function(opts) { - // combine default options with global options and options - var flow = fn(angular.extend({}, defaults, opts)); - angular.forEach(events, function (event) { - flow.on(event[0], event[1]); - }); - return flow; - } - }; - }; -}); -angular.module('flow.init', ['flow.provider']) - .controller('flowCtrl', ['$scope', '$attrs', '$parse', 'flowFactory', - function ($scope, $attrs, $parse, flowFactory) { - - var options = angular.extend({}, $scope.$eval($attrs.flowInit)); - - // use existing flow object or create a new one - var flow = $scope.$eval($attrs.flowObject) || flowFactory.create(options); - - var catchAllHandler = function(eventName){ - var args = Array.prototype.slice.call(arguments); - args.shift(); - var event = $scope.$broadcast.apply($scope, ['flow::' + eventName, flow].concat(args)); - if ({ - 'progress':1, 'filesSubmitted':1, 'fileSuccess': 1, 'fileError': 1, 'complete': 1 - }[eventName]) { - $scope.$applyAsync(); - } - if (event.defaultPrevented) { - return false; - } - }; - - flow.on('catchAll', catchAllHandler); - $scope.$on('$destroy', function(){ - flow.off('catchAll', catchAllHandler); - }); - - $scope.$flow = flow; - - if ($attrs.hasOwnProperty('flowName')) { - $parse($attrs.flowName).assign($scope, flow); - $scope.$on('$destroy', function () { - $parse($attrs.flowName).assign($scope); - }); - } - }]) - .directive('flowInit', [function() { - return { - scope: true, - controller: 'flowCtrl' - }; - }]); -angular.module('flow.btn', ['flow.init']) -.directive('flowBtn', [function() { - return { - 'restrict': 'EA', - 'scope': false, - 'require': '^flowInit', - 'link': function(scope, element, attrs) { - var isDirectory = attrs.hasOwnProperty('flowDirectory'); - var isSingleFile = attrs.hasOwnProperty('flowSingleFile'); - var inputAttrs = attrs.hasOwnProperty('flowAttrs') && scope.$eval(attrs.flowAttrs); - scope.$flow.assignBrowse(element, isDirectory, isSingleFile, inputAttrs); - } - }; -}]); -angular.module('flow.dragEvents', ['flow.init']) -/** - * @name flowPreventDrop - * Prevent loading files then dropped on element - */ - .directive('flowPreventDrop', function() { - return { - 'scope': false, - 'link': function(scope, element, attrs) { - element.bind('drop dragover', function (event) { - event.preventDefault(); - }); - } - }; - }) -/** - * @name flowDragEnter - * executes `flowDragEnter` and `flowDragLeave` events - */ - .directive('flowDragEnter', ['$timeout', function($timeout) { - return { - 'scope': false, - 'link': function(scope, element, attrs) { - var promise; - var enter = false; - element.bind('dragover', function (event) { - if (!isFileDrag(event)) { - return ; - } - if (!enter) { - scope.$apply(attrs.flowDragEnter); - enter = true; - } - $timeout.cancel(promise); - event.preventDefault(); - }); - element.bind('dragleave drop', function (event) { - $timeout.cancel(promise); - promise = $timeout(function () { - scope.$eval(attrs.flowDragLeave); - promise = null; - enter = false; - }, 100); - }); - function isFileDrag(dragEvent) { - var fileDrag = false; - var dataTransfer = dragEvent.dataTransfer || dragEvent.originalEvent.dataTransfer; - angular.forEach(dataTransfer && dataTransfer.types, function(val) { - if (val === 'Files') { - fileDrag = true; - } - }); - return fileDrag; - } - } - }; - }]); - -angular.module('flow.drop', ['flow.init']) -.directive('flowDrop', function() { - return { - 'scope': false, - 'require': '^flowInit', - 'link': function(scope, element, attrs) { - if (attrs.flowDropEnabled) { - scope.$watch(attrs.flowDropEnabled, function (value) { - if (value) { - assignDrop(); - } else { - unAssignDrop(); - } - }); - } else { - assignDrop(); - } - function assignDrop() { - scope.$flow.assignDrop(element); - } - function unAssignDrop() { - scope.$flow.unAssignDrop(element); - } - } - }; -}); - -!function (angular) {'use strict'; - var module = angular.module('flow.events', ['flow.init']); - var events = { - 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'] - }; - - angular.forEach(events, function (eventArgs, eventName) { - var name = 'flow' + capitaliseFirstLetter(eventName); - if (name == 'flowUploadStart') { - name = 'flowUploadStarted';// event alias - } - module.directive(name, [function() { - return { - require: '^flowInit', - controller: ['$scope', '$attrs', function ($scope, $attrs) { - $scope.$on('flow::' + eventName, function () { - var funcArgs = Array.prototype.slice.call(arguments); - var event = funcArgs.shift();// remove angular event - // remove flow object and ignore event if it is from parent directive - if ($scope.$flow !== funcArgs.shift()) { - return ; - } - var args = {}; - angular.forEach(eventArgs, function(value, key) { - args[value] = funcArgs[key]; - }); - if ($scope.$eval($attrs[name], args) === false) { - event.preventDefault(); - } - }); - }] - }; - }]); - }); - - function capitaliseFirstLetter(string) { - return string.charAt(0).toUpperCase() + string.slice(1); - } -}(angular); - -angular.module('flow.img', ['flow.init']) -.directive('flowImg', [function() { - return { - 'scope': false, - 'require': '^flowInit', - 'link': function(scope, element, attrs) { - var file = attrs.flowImg; - scope.$watch(file, function (file) { - if (!file) { - return ; - } - var fileReader = new FileReader(); - fileReader.readAsDataURL(file.file); - fileReader.onload = function (event) { - scope.$apply(function () { - attrs.$set('src', event.target.result); - }); - }; - }); - } - }; -}]); -angular.module('flow.transfers', ['flow.init']) -.directive('flowTransfers', [function() { - return { - 'scope': true, - 'require': '^flowInit', - 'link': function(scope) { - scope.transfers = scope.$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/angular.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/angular.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ng": () => (/* binding */ ng) -/* harmony export */ }); -/* harmony import */ var angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! angular */ "./node_modules/angular/index-exposed.js"); -/* harmony import */ var angular__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(angular__WEBPACK_IMPORTED_MODULE_0__); -/** @publicapi @module ng1 */ /** */ - -/** @hidden */ var ng_from_global = angular; -/** @hidden */ var ng = angular__WEBPACK_IMPORTED_MODULE_0__ && angular__WEBPACK_IMPORTED_MODULE_0__.module ? angular__WEBPACK_IMPORTED_MODULE_0__ : ng_from_global; -//# sourceMappingURL=angular.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js": -/*!********************************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js ***! - \********************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../angular */ "./node_modules/@uirouter/angularjs/lib-esm/angular.js"); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/* eslint-disable @typescript-eslint/no-empty-interface */ -/* eslint-disable prefer-const */ -/** - * # Angular 1 Directives - * - * These are the directives included in UI-Router for Angular 1. - * These directives are used in templates to create viewports and link/navigate to states. - * - * @preferred @publicapi @module directives - */ /** */ - - -/** @hidden */ -function parseStateRef(ref) { - var paramsOnly = ref.match(/^\s*({[^}]*})\s*$/); - if (paramsOnly) - ref = '(' + paramsOnly[1] + ')'; - var parsed = ref.replace(/\n/g, ' ').match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/); - if (!parsed || parsed.length !== 4) - throw new Error("Invalid state ref '" + ref + "'"); - return { state: parsed[1] || null, paramExpr: parsed[3] || null }; -} -/** @hidden */ -function stateContext(el) { - var $uiView = el.parent().inheritedData('$uiView'); - var path = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.parse)('$cfg.path')($uiView); - return path ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.tail)(path).state.name : undefined; -} -/** @hidden */ -function processedDef($state, $element, def) { - var uiState = def.uiState || $state.current.name; - var uiStateOpts = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)(defaultOpts($element, $state), def.uiStateOpts || {}); - var href = $state.href(uiState, def.uiStateParams, uiStateOpts); - return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href }; -} -/** @hidden */ -function getTypeInfo(el) { - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]'; - var isForm = el[0].nodeName === 'FORM'; - return { - attr: isForm ? 'action' : isSvg ? 'xlink:href' : 'href', - isAnchor: el.prop('tagName').toUpperCase() === 'A', - clickable: !isForm, - }; -} -/** @hidden */ -function clickHook(el, $state, $timeout, type, getDef) { - return function (e) { - var button = e.which || e.button, target = getDef(); - if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || el.attr('target'))) { - // HACK: This is to allow ng-clicks to be processed before the transition is initiated: - var transition_1 = $timeout(function () { - if (!el.attr('disabled')) { - $state.go(target.uiState, target.uiStateParams, target.uiStateOpts); - } - }); - e.preventDefault(); - // if the state has no URL, ignore one preventDefault from the directive. - var ignorePreventDefaultCount_1 = type.isAnchor && !target.href ? 1 : 0; - e.preventDefault = function () { - if (ignorePreventDefaultCount_1-- <= 0) - $timeout.cancel(transition_1); - }; - } - }; -} -/** @hidden */ -function defaultOpts(el, $state) { - return { - relative: stateContext(el) || $state.$current, - inherit: true, - source: 'sref', - }; -} -/** @hidden */ -function bindEvents(element, scope, hookFn, uiStateOpts) { - var events; - if (uiStateOpts) { - events = uiStateOpts.events; - } - if (!(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(events)) { - events = ['click']; - } - var on = element.on ? 'on' : 'bind'; - for (var _i = 0, events_1 = events; _i < events_1.length; _i++) { - var event_1 = events_1[_i]; - element[on](event_1, hookFn); - } - scope.$on('$destroy', function () { - var off = element.off ? 'off' : 'unbind'; - for (var _i = 0, events_2 = events; _i < events_2.length; _i++) { - var event_2 = events_2[_i]; - element[off](event_2, hookFn); - } - }); -} -/** - * `ui-sref`: A directive for linking to a state - * - * A directive which links to a state (and optionally, parameters). - * When clicked, this directive activates the linked state with the supplied parameter values. - * - * ### Linked State - * The attribute value of the `ui-sref` is the name of the state to link to. - * - * #### Example: - * This will activate the `home` state when the link is clicked. - * ```html - * Home - * ``` - * - * ### Relative Links - * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]). - * You just need to be aware that the path is relative to the state that *created* the link. - * This allows a state to create a relative `ui-sref` which always targets the same destination. - * - * #### Example: - * Both these links are relative to the parent state, even when a child state is currently active. - * ```html - * child 1 state - * child 2 state - * ``` - * - * This link activates the parent state. - * ```html - * Return - * ``` - * - * ### hrefs - * If the linked state has a URL, the directive will automatically generate and - * update the `href` attribute (using the [[StateService.href]] method). - * - * #### Example: - * Assuming the `users` state has a url of `/users/` - * ```html - * Users - * ``` - * - * ### Parameter Values - * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state. - * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses. - * The content inside the parentheses is an expression, evaluated to the parameter values. - * - * #### Example: - * This example renders a list of links to users. - * The state's `userId` parameter value comes from each user's `user.id` property. - * ```html - *
  • - * {{ user.displayName }} - *
  • - * ``` - * - * Note: - * The parameter values expression is `$watch`ed for updates. - * - * ### Transition Options - * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute. - * Options are restricted to `location`, `inherit`, and `reload`. - * - * #### Example: - * ```html - * Home - * ``` - * - * ### Other DOM Events - * - * You can also customize which DOM events to respond to (instead of `click`) by - * providing an `events` array in the `ui-sref-opts` attribute. - * - * #### Example: - * ```html - * - * ``` - * - * ### Highlighting the active link - * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link. - * - * ### Examples - * If you have the following template: - * - * ```html - * Home - * About - * Next page - * - * - * ``` - * - * Then (assuming the current state is `contacts`) the rendered html including hrefs would be: - * - * ```html - * Home - * About - * Next page - * - *
      - *
    • - * Joe - *
    • - *
    • - * Alice - *
    • - *
    • - * Bob - *
    • - *
    - * - * Home - * ``` - * - * ### Notes - * - * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses. - * #### Example: - * Sets the `lang` parameter to `en` and remains on the same state. - * - * ```html - * English - * ``` - * - * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example. - * - * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons). - * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive. - */ -var uiSrefDirective; -uiSrefDirective = [ - '$uiRouter', - '$timeout', - function $StateRefDirective($uiRouter, $timeout) { - var $state = $uiRouter.stateService; - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function (scope, element, attrs, uiSrefActive) { - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var unlinkInfoFn = null; - var rawDef = {}; - var getDef = function () { return processedDef($state, element, rawDef); }; - var ref = parseStateRef(attrs.uiSref); - rawDef.uiState = ref.state; - rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {}; - function update() { - var def = getDef(); - if (unlinkInfoFn) - unlinkInfoFn(); - if (active) - unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams); - if (def.href != null) - attrs.$set(type.attr, def.href); - } - if (ref.paramExpr) { - scope.$watch(ref.paramExpr, function (val) { - rawDef.uiStateParams = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)({}, val); - update(); - }, true); - rawDef.uiStateParams = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)({}, scope.$eval(ref.paramExpr)); - } - update(); - scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update)); - scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update)); - if (!type.clickable) - return; - var hookFn = clickHook(element, $state, $timeout, type, getDef); - bindEvents(element, scope, hookFn, rawDef.uiStateOpts); - }, - }; - }, -]; -/** - * `ui-state`: A fully dynamic directive for linking to a state - * - * A directive which links to a state (and optionally, parameters). - * When clicked, this directive activates the linked state with the supplied parameter values. - * - * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.** - * - * A directive which links to a state (and optionally, parameters). - * When clicked, this directive activates the linked state with the supplied parameter values. - * - * ### Linked State - * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to. - * **This is in contrast with `ui-sref`, which takes a state name as a string literal.** - * - * #### Example: - * Create a list of links. - * ```html - *
  • - * {{ link.displayName }} - *
  • - * ``` - * - * ### Relative Links - * If the expression evaluates to a relative path, it is processed like [[uiSref]]. - * You just need to be aware that the path is relative to the state that *created* the link. - * This allows a state to create relative `ui-state` which always targets the same destination. - * - * ### hrefs - * If the linked state has a URL, the directive will automatically generate and - * update the `href` attribute (using the [[StateService.href]] method). - * - * ### Parameter Values - * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state. - * Param values should be provided using the `ui-state-params` attribute. - * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression. - * - * #### Example: - * This example renders a list of links with param values. - * The state's `userId` parameter value comes from each user's `user.id` property. - * ```html - *
  • - * {{ link.displayName }} - *
  • - * ``` - * - * ### Transition Options - * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute. - * Options are restricted to `location`, `inherit`, and `reload`. - * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression. - * - * #### Example: - * ```html - * Home - * ``` - * - * ### Other DOM Events - * - * You can also customize which DOM events to respond to (instead of `click`) by - * providing an `events` array in the `ui-state-opts` attribute. - * - * #### Example: - * ```html - * - * ``` - * - * ### Highlighting the active link - * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link. - * - * ### Notes - * - * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`. - * However, it might be simpler to use [[uiSref]] parameter-only links. - * - * #### Example: - * Sets the `lang` parameter to `en` and remains on the same state. - * - * ```html - * English - * ``` - * - * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example. - * ``` - */ -var uiStateDirective; -uiStateDirective = [ - '$uiRouter', - '$timeout', - function $StateRefDynamicDirective($uiRouter, $timeout) { - var $state = $uiRouter.stateService; - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function (scope, element, attrs, uiSrefActive) { - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var unlinkInfoFn = null; - var hookFn; - var rawDef = {}; - var getDef = function () { return processedDef($state, element, rawDef); }; - var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts']; - var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return ((acc[attr] = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.noop), acc); }, {}); - function update() { - var def = getDef(); - if (unlinkInfoFn) - unlinkInfoFn(); - if (active) - unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams); - if (def.href != null) - attrs.$set(type.attr, def.href); - } - inputAttrs.forEach(function (field) { - rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null; - attrs.$observe(field, function (expr) { - watchDeregFns[field](); - watchDeregFns[field] = scope.$watch(expr, function (newval) { - rawDef[field] = newval; - update(); - }, true); - }); - }); - update(); - scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update)); - scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update)); - if (!type.clickable) - return; - hookFn = clickHook(element, $state, $timeout, type, getDef); - bindEvents(element, scope, hookFn, rawDef.uiStateOpts); - }, - }; - }, -]; -/** - * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active - * - * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the - * related directive's state is active (and remove them when it is inactive). - * - * The primary use-case is to highlight the active link in navigation menus, - * distinguishing it from the inactive menu items. - * - * ### Linking to a `ui-sref` or `ui-state` - * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element. - * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**. - * - * ### Matching - * - * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**. - * This is a "fuzzy match" which uses [[StateService.includes]]. - * - * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active). - * This is an "exact match" which uses [[StateService.is]]. - * - * ### Parameter values - * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted. - * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted. - * - * #### Example: - * ```html - *
  • - * {{ user.lastName }} - *
  • - * ``` - * - * ### Examples - * - * Given the following template: - * #### Example: - * ```html - * - * ``` - * - * When the app state is `app.user` (or any child state), - * and contains the state parameter "user" with value "bilbobaggins", - * the resulting HTML will appear as (note the 'active' class): - * - * ```html - * - * ``` - * - * ### Glob mode - * - * It is possible to pass `ui-sref-active` an expression that evaluates to an object. - * The objects keys represent active class names and values represent the respective state names/globs. - * `ui-sref-active` will match if the current active state **includes** any of - * the specified state names/globs, even the abstract ones. - * - * #### Example: - * Given the following template, with "admin" being an abstract state: - * ```html - *
    - * Roles - *
    - * ``` - * - * Arrays are also supported as values in the `ngClass`-like interface. - * This allows multiple states to add `active` class. - * - * #### Example: - * Given the following template, with "admin.roles" being the current state, the class will be added too: - * ```html - *
    - * Roles - *
    - * ``` - * - * When the current state is "admin.roles" the "active" class will be applied to both the `
    ` and `` elements. - * It is important to note that the state names/globs passed to `ui-sref-active` override any state provided by a linked `ui-sref`. - * - * ### Notes: - * - * - The class name is interpolated **once** during the directives link time (any further changes to the - * interpolated value are ignored). - * - * - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'` - */ -var uiSrefActiveDirective; -uiSrefActiveDirective = [ - '$state', - '$stateParams', - '$interpolate', - '$uiRouter', - function $StateRefActiveDirective($state, $stateParams, $interpolate, $uiRouter) { - return { - restrict: 'A', - controller: [ - '$scope', - '$element', - '$attrs', - function ($scope, $element, $attrs) { - var states = []; - var activeEqClass; - var uiSrefActive; - // There probably isn't much point in $observing this - // uiSrefActive and uiSrefActiveEq share the same directive object with some - // slight difference in logic routing - activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope); - try { - uiSrefActive = $scope.$eval($attrs.uiSrefActive); - } - catch (e) { - // Do nothing. uiSrefActive is not a valid expression. - // Fall back to using $interpolate below - } - uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope); - setStatesFromDefinitionObject(uiSrefActive); - // Allow uiSref to communicate with uiSrefActive[Equals] - this.$$addStateInfo = function (newState, newParams) { - // we already got an explicit state provided by ui-sref-active, so we - // shadow the one that comes from ui-sref - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isObject)(uiSrefActive) && states.length > 0) { - return; - } - var deregister = addState(newState, newParams, uiSrefActive); - update(); - return deregister; - }; - function updateAfterTransition(trans) { - trans.promise.then(update, _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.noop); - } - $scope.$on('$destroy', setupEventListeners()); - if ($uiRouter.globals.transition) { - updateAfterTransition($uiRouter.globals.transition); - } - function setupEventListeners() { - var deregisterStatesChangedListener = $uiRouter.stateRegistry.onStatesChanged(handleStatesChanged); - var deregisterOnStartListener = $uiRouter.transitionService.onStart({}, updateAfterTransition); - var deregisterStateChangeSuccessListener = $scope.$on('$stateChangeSuccess', update); - return function cleanUp() { - deregisterStatesChangedListener(); - deregisterOnStartListener(); - deregisterStateChangeSuccessListener(); - }; - } - function handleStatesChanged() { - setStatesFromDefinitionObject(uiSrefActive); - } - function setStatesFromDefinitionObject(statesDefinition) { - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isObject)(statesDefinition)) { - states = []; - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.forEach)(statesDefinition, function (stateOrName, activeClass) { - // Helper function to abstract adding state. - var addStateForClass = function (stateOrName, activeClass) { - var ref = parseStateRef(stateOrName); - addState(ref.state, $scope.$eval(ref.paramExpr), activeClass); - }; - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isString)(stateOrName)) { - // If state is string, just add it. - addStateForClass(stateOrName, activeClass); - } - else if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(stateOrName)) { - // If state is an array, iterate over it and add each array item individually. - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.forEach)(stateOrName, function (stateOrName) { - addStateForClass(stateOrName, activeClass); - }); - } - }); - } - } - function addState(stateName, stateParams, activeClass) { - var state = $state.get(stateName, stateContext($element)); - var stateInfo = { - state: state || { name: stateName }, - params: stateParams, - activeClass: activeClass, - }; - states.push(stateInfo); - return function removeState() { - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.removeFrom)(states)(stateInfo); - }; - } - // Update route state - function update() { - var splitClasses = function (str) { return str.split(/\s/).filter(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.identity); }; - var getClasses = function (stateList) { - return stateList - .map(function (x) { return x.activeClass; }) - .map(splitClasses) - .reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.unnestR, []); - }; - var allClasses = getClasses(states).concat(splitClasses(activeEqClass)).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.uniqR, []); - var fuzzyClasses = getClasses(states.filter(function (x) { return $state.includes(x.state.name, x.params); })); - var exactlyMatchesAny = !!states.filter(function (x) { return $state.is(x.state.name, x.params); }).length; - var exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : []; - var addClasses = fuzzyClasses.concat(exactClasses).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.uniqR, []); - var removeClasses = allClasses.filter(function (cls) { return !(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.inArray)(addClasses, cls); }); - $scope.$evalAsync(function () { - addClasses.forEach(function (className) { return $element.addClass(className); }); - removeClasses.forEach(function (className) { return $element.removeClass(className); }); - }); - } - update(); - }, - ], - }; - }, -]; -_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state') - .directive('uiSref', uiSrefDirective) - .directive('uiSrefActive', uiSrefActiveDirective) - .directive('uiSrefActiveEq', uiSrefActiveDirective) - .directive('uiState', uiStateDirective); -//# sourceMappingURL=stateDirectives.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js ***! - \******************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "uiView": () => (/* binding */ uiView) -/* harmony export */ }); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../angular */ "./node_modules/@uirouter/angularjs/lib-esm/angular.js"); -/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services */ "./node_modules/@uirouter/angularjs/lib-esm/services.js"); -/* harmony import */ var _statebuilders_views__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../statebuilders/views */ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"); -/** @publicapi @module directives */ /** */ - - - - -/** - * `ui-view`: A viewport directive which is filled in by a view from the active state. - * - * ### Attributes - * - * - `name`: (Optional) A view name. - * The name should be unique amongst the other views in the same state. - * You can have views of the same name that live in different states. - * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]). - * - * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated. - * Uses [[$uiViewScroll]] to do the scrolling. - * - * - `onload`: Expression to evaluate whenever the view updates. - * - * #### Example: - * A view can be unnamed or named. - * ```html - * - *
    - * - * - *
    - * - * - * - * ``` - * - * You can only have one unnamed view within any template (or root html). If you are only using a - * single view and it is unnamed then you can populate it like so: - * - * ```html - *
    - * $stateProvider.state("home", { - * template: "

    HELLO!

    " - * }) - * ``` - * - * The above is a convenient shortcut equivalent to specifying your view explicitly with the - * [[Ng1StateDeclaration.views]] config property, by name, in this case an empty name: - * - * ```js - * $stateProvider.state("home", { - * views: { - * "": { - * template: "

    HELLO!

    " - * } - * } - * }) - * ``` - * - * But typically you'll only use the views property if you name your view or have more than one view - * in the same template. There's not really a compelling reason to name a view if its the only one, - * but you could if you wanted, like so: - * - * ```html - *
    - * ``` - * - * ```js - * $stateProvider.state("home", { - * views: { - * "main": { - * template: "

    HELLO!

    " - * } - * } - * }) - * ``` - * - * Really though, you'll use views to set up multiple views: - * - * ```html - *
    - *
    - *
    - * ``` - * - * ```js - * $stateProvider.state("home", { - * views: { - * "": { - * template: "

    HELLO!

    " - * }, - * "chart": { - * template: "" - * }, - * "data": { - * template: "" - * } - * } - * }) - * ``` - * - * #### Examples for `autoscroll`: - * ```html - * - * - * - * - * - * - * - * ``` - * - * Resolve data: - * - * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this - * can be customized using [[Ng1ViewDeclaration.resolveAs]]). This can be then accessed from the template. - * - * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the - * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which - * depends on `$resolve` data. - * - * #### Example: - * ```js - * $stateProvider.state('home', { - * template: '', - * resolve: { - * user: function(UserService) { return UserService.fetchUser(); } - * } - * }); - * ``` - */ -var uiView; -// eslint-disable-next-line prefer-const -uiView = [ - '$view', - '$animate', - '$uiViewScroll', - '$interpolate', - '$q', - function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q) { - function getRenderer() { - return { - enter: function (element, target, cb) { - if (_angular__WEBPACK_IMPORTED_MODULE_1__.ng.version.minor > 2) { - $animate.enter(element, null, target).then(cb); - } - else { - $animate.enter(element, null, target, cb); - } - }, - leave: function (element, cb) { - if (_angular__WEBPACK_IMPORTED_MODULE_1__.ng.version.minor > 2) { - $animate.leave(element).then(cb); - } - else { - $animate.leave(element, cb); - } - }, - }; - } - function configsEqual(config1, config2) { - return config1 === config2; - } - var rootData = { - $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } }, - $uiView: {}, - }; - var directive = { - count: 0, - restrict: 'ECA', - terminal: true, - priority: 400, - transclude: 'element', - compile: function (tElement, tAttrs, $transclude) { - return function (scope, $element, attrs) { - var onloadExp = attrs['onload'] || '', autoScrollExp = attrs['autoscroll'], renderer = getRenderer(), inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default'; - var previousEl, currentEl, currentScope, viewConfig; - var activeUIView = { - $type: 'ng1', - id: directive.count++, - name: name, - fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name, - config: null, - configUpdated: configUpdatedCallback, - get creationContext() { - // The context in which this ui-view "tag" was created - var fromParentTagConfig = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('$cfg.viewDecl.$context')(inherited); - // Allow - // See https://github.com/angular-ui/ui-router/issues/3355 - var fromParentTag = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('$uiView.creationContext')(inherited); - return fromParentTagConfig || fromParentTag; - }, - }; - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Linking', activeUIView); - function configUpdatedCallback(config) { - if (config && !(config instanceof _statebuilders_views__WEBPACK_IMPORTED_MODULE_3__.Ng1ViewConfig)) - return; - if (configsEqual(viewConfig, config)) - return; - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context); - viewConfig = config; - updateView(config); - } - $element.data('$uiView', { $uiView: activeUIView }); - updateView(); - var unregister = $view.registerUIView(activeUIView); - scope.$on('$destroy', function () { - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Destroying/Unregistering', activeUIView); - unregister(); - }); - function cleanupLastView() { - if (previousEl) { - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView')); - previousEl.remove(); - previousEl = null; - } - if (currentScope) { - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Destroying scope', activeUIView); - currentScope.$destroy(); - currentScope = null; - } - if (currentEl) { - var _viewData_1 = currentEl.data('$uiViewAnim'); - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Animate out', _viewData_1); - renderer.leave(currentEl, function () { - _viewData_1.$$animLeave.resolve(); - previousEl = null; - }); - previousEl = currentEl; - currentEl = null; - } - } - function updateView(config) { - var newScope = scope.$new(); - var animEnter = $q.defer(), animLeave = $q.defer(); - var $uiViewData = { - $cfg: config, - $uiView: activeUIView, - }; - var $uiViewAnim = { - $animEnter: animEnter.promise, - $animLeave: animLeave.promise, - $$animLeave: animLeave, - }; - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoading - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description - * - * Fired once the view **begins loading**, *before* the DOM is rendered. - * - * @param {Object} event Event object. - * @param {string} viewName Name of the view. - */ - newScope.$emit('$viewContentLoading', name); - var cloned = $transclude(newScope, function (clone) { - clone.data('$uiViewAnim', $uiViewAnim); - clone.data('$uiView', $uiViewData); - renderer.enter(clone, $element, function onUIViewEnter() { - animEnter.resolve(); - if (currentScope) - currentScope.$emit('$viewContentAnimationEnded'); - if (((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(autoScrollExp) && !autoScrollExp) || scope.$eval(autoScrollExp)) { - $uiViewScroll(clone); - } - }); - cleanupLastView(); - }); - currentEl = cloned; - currentScope = newScope; - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoaded - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description * - * Fired once the view is **loaded**, *after* the DOM is rendered. - * - * @param {Object} event Event object. - */ - currentScope.$emit('$viewContentLoaded', config || viewConfig); - currentScope.$eval(onloadExp); - } - }; - }, - }; - return directive; - }, -]; -$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q']; -/** @hidden */ -function $ViewDirectiveFill($compile, $controller, $transitions, $view, $q) { - var getControllerAs = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('viewDecl.controllerAs'); - var getResolveAs = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('viewDecl.resolveAs'); - return { - restrict: 'ECA', - priority: -400, - compile: function (tElement) { - var initial = tElement.html(); - tElement.empty(); - return function (scope, $element) { - var data = $element.data('$uiView'); - if (!data) { - $element.html(initial); - $compile($element.contents())(scope); - return; - } - var cfg = data.$cfg || { viewDecl: {}, getTemplate: _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.noop }; - var resolveCtx = cfg.path && new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(cfg.path); - $element.html(cfg.getTemplate($element, resolveCtx) || initial); - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewFill(data.$uiView, $element.html()); - var link = $compile($element.contents()); - var controller = cfg.controller; - var controllerAs = getControllerAs(cfg); - var resolveAs = getResolveAs(cfg); - var locals = resolveCtx && (0,_services__WEBPACK_IMPORTED_MODULE_2__.getLocals)(resolveCtx); - scope[resolveAs] = locals; - if (controller) { - var controllerInstance = ($controller(controller, (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)({}, locals, { $scope: scope, $element: $element }))); - if (controllerAs) { - scope[controllerAs] = controllerInstance; - scope[controllerAs][resolveAs] = locals; - } - // TODO: Use $view service as a central point for registering component-level hooks - // Then, when a component is created, tell the $view service, so it can invoke hooks - // $view.componentLoaded(controllerInstance, { $scope: scope, $element: $element }); - // scope.$on('$destroy', () => $view.componentUnloaded(controllerInstance, { $scope: scope, $element: $element })); - $element.data('$ngControllerController', controllerInstance); - $element.children().data('$ngControllerController', controllerInstance); - registerControllerCallbacks($q, $transitions, controllerInstance, scope, cfg); - } - // Wait for the component to appear in the DOM - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isString)(cfg.component)) { - var kebobName = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.kebobString)(cfg.component); - var tagRegexp_1 = new RegExp("^(x-|data-)?" + kebobName + "$", 'i'); - var getComponentController = function () { - var directiveEl = [].slice - .call($element[0].children) - .filter(function (el) { return el && el.tagName && tagRegexp_1.exec(el.tagName); }); - return directiveEl && _angular__WEBPACK_IMPORTED_MODULE_1__.ng.element(directiveEl).data("$" + cfg.component + "Controller"); - }; - var deregisterWatch_1 = scope.$watch(getComponentController, function (ctrlInstance) { - if (!ctrlInstance) - return; - registerControllerCallbacks($q, $transitions, ctrlInstance, scope, cfg); - deregisterWatch_1(); - }); - } - link(scope); - }; - }, - }; -} -/** @hidden */ -var hasComponentImpl = typeof _angular__WEBPACK_IMPORTED_MODULE_1__.ng.module('ui.router')['component'] === 'function'; -/** @hidden incrementing id */ -var _uiCanExitId = 0; -/** @hidden TODO: move these callbacks to $view and/or `/hooks/components.ts` or something */ -function registerControllerCallbacks($q, $transitions, controllerInstance, $scope, cfg) { - // Call $onInit() ASAP - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(controllerInstance.$onInit) && - !((cfg.viewDecl.component || cfg.viewDecl.componentProvider) && hasComponentImpl)) { - controllerInstance.$onInit(); - } - var viewState = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.tail)(cfg.path).state.self; - var hookOptions = { bind: controllerInstance }; - // Add component-level hook for onUiParamsChanged - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(controllerInstance.uiOnParamsChanged)) { - var resolveContext = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(cfg.path); - var viewCreationTrans_1 = resolveContext.getResolvable('$transition$').data; - // Fire callback on any successful transition - var paramsUpdated = function ($transition$) { - // Exit early if the $transition$ is the same as the view was created within. - // Exit early if the $transition$ will exit the state the view is for. - if ($transition$ === viewCreationTrans_1 || $transition$.exiting().indexOf(viewState) !== -1) - return; - var toParams = $transition$.params('to'); - var fromParams = $transition$.params('from'); - var getNodeSchema = function (node) { return node.paramSchema; }; - var toSchema = $transition$.treeChanges('to').map(getNodeSchema).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.unnestR, []); - var fromSchema = $transition$.treeChanges('from').map(getNodeSchema).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.unnestR, []); - // Find the to params that have different values than the from params - var changedToParams = toSchema.filter(function (param) { - var idx = fromSchema.indexOf(param); - return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]); - }); - // Only trigger callback if a to param has changed or is new - if (changedToParams.length) { - var changedKeys_1 = changedToParams.map(function (x) { return x.id; }); - // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params. - var newValues = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.filter)(toParams, function (val, key) { return changedKeys_1.indexOf(key) !== -1; }); - controllerInstance.uiOnParamsChanged(newValues, $transition$); - } - }; - $scope.$on('$destroy', $transitions.onSuccess({}, paramsUpdated, hookOptions)); - } - // Add component-level hook for uiCanExit - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(controllerInstance.uiCanExit)) { - var id_1 = _uiCanExitId++; - var cacheProp_1 = '_uiCanExitIds'; - // Returns true if a redirect transition already answered truthy - var prevTruthyAnswer_1 = function (trans) { - return !!trans && ((trans[cacheProp_1] && trans[cacheProp_1][id_1] === true) || prevTruthyAnswer_1(trans.redirectedFrom())); - }; - // If a user answered yes, but the transition was later redirected, don't also ask for the new redirect transition - var wrappedHook = function (trans) { - var promise; - var ids = (trans[cacheProp_1] = trans[cacheProp_1] || {}); - if (!prevTruthyAnswer_1(trans)) { - promise = $q.when(controllerInstance.uiCanExit(trans)); - promise.then(function (val) { return (ids[id_1] = val !== false); }); - } - return promise; - }; - var criteria = { exiting: viewState.name }; - $scope.$on('$destroy', $transitions.onBefore(criteria, wrappedHook, hookOptions)); - } -} -_angular__WEBPACK_IMPORTED_MODULE_1__.ng.module('ui.router.state').directive('uiView', uiView); -_angular__WEBPACK_IMPORTED_MODULE_1__.ng.module('ui.router.state').directive('uiView', $ViewDirectiveFill); -//# sourceMappingURL=viewDirective.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/index.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getLocals": () => (/* reexport safe */ _services__WEBPACK_IMPORTED_MODULE_1__.getLocals), -/* harmony export */ "watchDigests": () => (/* reexport safe */ _services__WEBPACK_IMPORTED_MODULE_1__.watchDigests), -/* harmony export */ "Ng1ViewConfig": () => (/* reexport safe */ _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.Ng1ViewConfig), -/* harmony export */ "getNg1ViewConfigFactory": () => (/* reexport safe */ _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.getNg1ViewConfigFactory), -/* harmony export */ "ng1ViewsBuilder": () => (/* reexport safe */ _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.ng1ViewsBuilder), -/* harmony export */ "StateProvider": () => (/* reexport safe */ _stateProvider__WEBPACK_IMPORTED_MODULE_3__.StateProvider), -/* harmony export */ "UrlRouterProvider": () => (/* reexport safe */ _urlRouterProvider__WEBPACK_IMPORTED_MODULE_4__.UrlRouterProvider), -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ "core": () => (/* reexport module object */ _uirouter_core__WEBPACK_IMPORTED_MODULE_10__) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/angularjs/lib-esm/interface.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(["default","core"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services */ "./node_modules/@uirouter/angularjs/lib-esm/services.js"); -/* harmony import */ var _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./statebuilders/views */ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"); -/* harmony import */ var _stateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateProvider */ "./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"); -/* harmony import */ var _urlRouterProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./urlRouterProvider */ "./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js"); -/* harmony import */ var _injectables__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./injectables */ "./node_modules/@uirouter/angularjs/lib-esm/injectables.js"); -/* harmony import */ var _injectables__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_injectables__WEBPACK_IMPORTED_MODULE_5__); -/* harmony import */ var _directives_stateDirectives__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./directives/stateDirectives */ "./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js"); -/* harmony import */ var _stateFilters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stateFilters */ "./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js"); -/* harmony import */ var _directives_viewDirective__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./directives/viewDirective */ "./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js"); -/* harmony import */ var _viewScroll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./viewScroll */ "./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js"); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _uirouter_core__WEBPACK_IMPORTED_MODULE_10__) if(["default","core","getLocals","watchDigests","Ng1ViewConfig","getNg1ViewConfigFactory","ng1ViewsBuilder","StateProvider","UrlRouterProvider"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _uirouter_core__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/** - * Main entry point for angular 1.x build - * @publicapi @module ng1 - */ /** */ - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ('ui.router'); - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/injectables.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/injectables.js ***! - \*****************************************************************/ -/***/ (() => { - -/** - * The current (or pending) State Parameters - * - * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition. - * - * The values are not updated until *after* a `Transition` successfully completes. - * - * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running. - * - * ### Deprecation warning: - * - * The value injected for `$stateParams` is different depending on where it is injected. - * - * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`. - * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`. - * - * Because of these confusing details, this service is deprecated. - * - * ### Instead of using the global `$stateParams` service object, - * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]] - * - * ```js - * MyService.$inject = ['$uiRouterGlobals']; - * function MyService($uiRouterGlobals) { - * return { - * paramValues: function () { - * return $uiRouterGlobals.params; - * } - * } - * } - * ``` - * - * ### Instead of using the per-transition `$stateParams` object, - * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]] - * - * ```js - * MyController.$inject = ['$transition$']; - * function MyController($transition$) { - * var username = $transition$.params().username; - * // .. do something with username - * } - * ``` - * - * --- - * - * This object can be injected into other services. - * - * #### Deprecated Example: - * ```js - * SomeService.$inject = ['$http', '$stateParams']; - * function SomeService($http, $stateParams) { - * return { - * getUser: function() { - * return $http.get('/api/users/' + $stateParams.username); - * } - * } - * }; - * angular.service('SomeService', SomeService); - * ``` - * @deprecated - */ -var $stateParams; -/** - * Global UI-Router variables - * - * The router global state as a **Service Object** (injectable during runtime). - * - * This object contains globals such as the current state and current parameter values. - */ -var $uiRouterGlobals; -/** - * The UI-Router instance - * - * The [[UIRouter]] singleton (the router instance) as a **Service Object** (injectable during runtime). - * - * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap. - * It has references to the other UI-Router services - * - * #### Note: This object is also exposed as [[$uiRouterProvider]] for injection during angular config time. - */ -var $uiRouter; -/** - * The UI-Router instance - * - * The [[UIRouter]] singleton (the router instance) as a **Provider Object** (injectable during config phase). - * - * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap. - * It has references to the other UI-Router services - * - * #### Note: This object is also exposed as [[$uiRouter]] for injection during runtime. - */ -var $uiRouterProvider; -/** - * Transition debug/tracing - * - * The [[Trace]] singleton as a **Service Object** (injectable during runtime). - * - * Enables or disables Transition tracing which can help to debug issues. - */ -var $trace; -/** - * The Transition Service - * - * The [[TransitionService]] singleton as a **Service Object** (injectable during runtime). - * - * This angular service exposes the [[TransitionService]] singleton, which is primarily - * used to register global transition hooks. - * - * #### Note: This object is also exposed as [[$transitionsProvider]] for injection during the config phase. - */ -var $transitions; -/** - * The Transition Service - * - * The [[TransitionService]] singleton as a **Provider Object** (injectable during config phase) - * - * This angular service exposes the [[TransitionService]] singleton, which is primarily - * used to register global transition hooks. - * - * #### Note: This object is also exposed as [[$transitions]] for injection during runtime. - */ -var $transitionsProvider; -/** - * The current [[Transition]] object - * - * The current [[Transition]] object as a **Per-Transition Object** (injectable into Resolve, Hooks, Controllers) - * - * This object returns information about the current transition, including: - * - * - To/from states - * - To/from parameters - * - Transition options - * - States being entered, exited, and retained - * - Resolve data - * - A Promise for the transition - * - Any transition failure information - * - An injector for both Service and Per-Transition Objects - */ -var $transition$; -/** - * The State Service - * - * The [[StateService]] singleton as a **Service Object** (injectable during runtime). - * - * This service used to manage and query information on registered states. - * It exposes state related APIs including: - * - * - Start a [[Transition]] - * - Imperatively lazy load states - * - Check if a state is currently active - * - Look up states by name - * - Build URLs for a state+parameters - * - Configure the global Transition error handler - * - * This angular service exposes the [[StateService]] singleton. - */ -var $state; -/** - * The State Registry - * - * The [[StateRegistry]] singleton as a **Service Object** (injectable during runtime). - * - * This service is used to register/deregister states. - * It has state registration related APIs including: - * - * - Register/deregister states - * - Listen for state registration/deregistration - * - Get states by name - * - Add state decorators (to customize the state creation process) - * - * #### Note: This object is also exposed as [[$stateRegistryProvider]] for injection during the config phase. - */ -var $stateRegistry; -/** - * The State Registry - * - * The [[StateRegistry]] singleton as a **Provider Object** (injectable during config time). - * - * This service is used to register/deregister states. - * It has state registration related APIs including: - * - * - Register/deregister states - * - Listen for state registration/deregistration - * - Get states by name - * - Add state decorators (to customize the state creation process) - * - * #### Note: This object is also exposed as [[$stateRegistry]] for injection during runtime. - */ -var $stateRegistryProvider; -/** - * The View Scroll provider - * - * The [[UIViewScrollProvider]] as a **Provider Object** (injectable during config time). - * - * This angular service exposes the [[UIViewScrollProvider]] singleton and is - * used to disable UI-Router's scroll behavior. - */ -var $uiViewScrollProvider; -/** - * The View Scroll function - * - * The View Scroll function as a **Service Object** (injectable during runtime). - * - * This is a function that scrolls an element into view. - * The element is scrolled after a `$timeout` so the DOM has time to refresh. - * - * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor, - * this can be enabled by calling [[UIViewScrollProvider.useAnchorScroll]]. - * - * Note: this function is used by the [[directives.uiView]] when the `autoscroll` expression evaluates to true. - */ -var $uiViewScroll; -/** - * The StateProvider - * - * An angular1-only [[StateProvider]] as a **Provider Object** (injectable during config time). - * - * This angular service exposes the [[StateProvider]] singleton. - * - * The `StateProvider` is primarily used to register states or add custom state decorators. - * - * ##### Note: This provider is a ng1 vestige. - * It is a passthrough to [[$stateRegistry]] and [[$state]]. - */ -var $stateProvider; -/** - * The URL Service Provider - * - * The [[UrlService]] singleton as a **Provider Object** (injectable during the angular config phase). - * - * A service used to configure and interact with the URL. - * It has URL related APIs including: - * - * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]]) - * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]]) - * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]]) - * - delay initial URL synchronization [[UrlService.deferIntercept]]. - * - get or set the current url: [[UrlService.url]] - * - * ##### Note: This service can also be injected during runtime as [[$urlService]]. - */ -var $urlServiceProvider; -/** - * The URL Service - * - * The [[UrlService]] singleton as a **Service Object** (injectable during runtime). - * - * Note: This service can also be injected during the config phase as [[$urlServiceProvider]]. - * - * Used to configure the URL. - * It has URL related APIs including: - * - * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]]) - * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]]) - * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]]) - * - delay initial URL synchronization [[UrlService.deferIntercept]]. - * - get or set the current url: [[UrlService.url]] - * - * ##### Note: This service can also be injected during the config phase as [[$urlServiceProvider]]. - */ -var $urlService; -/** - * The URL Router Provider - * - * ### Deprecation warning: This object is now considered internal. Use [[$urlServiceProvider]] instead. - * - * The [[UrlRouter]] singleton as a **Provider Object** (injectable during config time). - * - * #### Note: This object is also exposed as [[$urlRouter]] for injection during runtime. - * - * @deprecated - */ -var $urlRouterProvider; -/** - * The Url Router - * - * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead. - * - * The [[UrlRouter]] singleton as a **Service Object** (injectable during runtime). - * - * #### Note: This object is also exposed as [[$urlRouterProvider]] for injection during angular config time. - * - * @deprecated - */ -var $urlRouter; -/** - * The URL Matcher Factory - * - * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead. - * - * The [[UrlMatcherFactory]] singleton as a **Service Object** (injectable during runtime). - * - * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects. - * - * #### Note: This object is also exposed as [[$urlMatcherFactoryProvider]] for injection during angular config time. - * - * @deprecated - */ -var $urlMatcherFactory; -/** - * The URL Matcher Factory - * - * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead. - * - * The [[UrlMatcherFactory]] singleton as a **Provider Object** (injectable during config time). - * - * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects. - * - * #### Note: This object is also exposed as [[$urlMatcherFactory]] for injection during runtime. - * - * @deprecated - */ -var $urlMatcherFactoryProvider; -//# sourceMappingURL=injectables.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/interface.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/interface.js ***! - \***************************************************************/ -/***/ (() => { - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/locationServices.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/locationServices.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Ng1LocationServices": () => (/* binding */ Ng1LocationServices) -/* harmony export */ }); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/** @publicapi @module ng1 */ /** */ - - -/** - * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service - * @internalapi - */ -var Ng1LocationServices = /** @class */ (function () { - function Ng1LocationServices($locationProvider) { - // .onChange() registry - this._urlListeners = []; - this.$locationProvider = $locationProvider; - var _lp = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)($locationProvider); - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)(_lp, this, _lp, ['hashPrefix']); - } - /** - * Applys ng1-specific path parameter encoding - * - * The Angular 1 `$location` service is a bit weird. - * It doesn't allow slashes to be encoded/decoded bi-directionally. - * - * See the writeup at https://github.com/angular-ui/ui-router/issues/2598 - * - * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F - * - * @param router - */ - Ng1LocationServices.monkeyPatchPathParameterType = function (router) { - var pathType = router.urlMatcherFactory.type('path'); - pathType.encode = function (x) { - return x != null ? x.toString().replace(/(~|\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : x; - }; - pathType.decode = function (x) { - return x != null ? x.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : x; - }; - }; - // eslint-disable-next-line @typescript-eslint/no-empty-function - Ng1LocationServices.prototype.dispose = function () { }; - Ng1LocationServices.prototype.onChange = function (callback) { - var _this = this; - this._urlListeners.push(callback); - return function () { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(_this._urlListeners)(callback); }; - }; - Ng1LocationServices.prototype.html5Mode = function () { - var html5Mode = this.$locationProvider.html5Mode(); - html5Mode = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isObject)(html5Mode) ? html5Mode.enabled : html5Mode; - return html5Mode && this.$sniffer.history; - }; - Ng1LocationServices.prototype.baseHref = function () { - return this._baseHref || (this._baseHref = this.$browser.baseHref() || this.$window.location.pathname); - }; - Ng1LocationServices.prototype.url = function (newUrl, replace, state) { - if (replace === void 0) { replace = false; } - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(newUrl)) - this.$location.url(newUrl); - if (replace) - this.$location.replace(); - if (state) - this.$location.state(state); - return this.$location.url(); - }; - Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser, $window) { - var _this = this; - this.$location = $location; - this.$sniffer = $sniffer; - this.$browser = $browser; - this.$window = $window; - // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange - $rootScope.$on('$locationChangeSuccess', function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); }); - var _loc = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)($location); - // Bind these LocationService functions to $location - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)(_loc, this, _loc, ['replace', 'path', 'search', 'hash']); - // Bind these LocationConfig functions to $location - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)(_loc, this, _loc, ['port', 'protocol', 'host']); - }; - return Ng1LocationServices; -}()); - -//# sourceMappingURL=locationServices.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/services.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/services.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "watchDigests": () => (/* binding */ watchDigests), -/* harmony export */ "getLocals": () => (/* binding */ getLocals) -/* harmony export */ }); -/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ "./node_modules/@uirouter/angularjs/lib-esm/angular.js"); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/* harmony import */ var _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./statebuilders/views */ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"); -/* harmony import */ var _templateFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templateFactory */ "./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js"); -/* harmony import */ var _stateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateProvider */ "./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"); -/* harmony import */ var _statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./statebuilders/onEnterExitRetain */ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js"); -/* harmony import */ var _locationServices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./locationServices */ "./node_modules/@uirouter/angularjs/lib-esm/locationServices.js"); -/* harmony import */ var _urlRouterProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./urlRouterProvider */ "./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js"); -/* eslint-disable @typescript-eslint/no-empty-function */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/** - * # Angular 1 types - * - * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc. - * The customizations to the core types for Angular UI-Router are documented here. - * - * The optional [[$resolve]] service is also documented here. - * - * @preferred @publicapi @module ng1 - */ /** */ - - - - - - - - -_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.angular1', []); -var mod_init = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.init', ['ng']); -var mod_util = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.util', ['ui.router.init']); -var mod_rtr = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.router', ['ui.router.util']); -var mod_state = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']); -var mod_main = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']); -var mod_cmpt = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.compat', ['ui.router']); -var router = null; -$uiRouterProvider.$inject = ['$locationProvider']; -/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */ -function $uiRouterProvider($locationProvider) { - // Create a new instance of the Router when the $uiRouterProvider is initialized - router = this.router = new _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.UIRouter(); - router.stateProvider = new _stateProvider__WEBPACK_IMPORTED_MODULE_4__.StateProvider(router.stateRegistry, router.stateService); - // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties - router.stateRegistry.decorator('views', _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.ng1ViewsBuilder); - router.stateRegistry.decorator('onExit', (0,_statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.getStateHookBuilder)('onExit')); - router.stateRegistry.decorator('onRetain', (0,_statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.getStateHookBuilder)('onRetain')); - router.stateRegistry.decorator('onEnter', (0,_statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.getStateHookBuilder)('onEnter')); - router.viewService._pluginapi._viewConfigFactory('ng1', (0,_statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.getNg1ViewConfigFactory)()); - // Disable decoding of params by UrlMatcherFactory because $location already handles this - router.urlService.config._decodeParams = false; - var ng1LocationService = (router.locationService = router.locationConfig = new _locationServices__WEBPACK_IMPORTED_MODULE_6__.Ng1LocationServices($locationProvider)); - _locationServices__WEBPACK_IMPORTED_MODULE_6__.Ng1LocationServices.monkeyPatchPathParameterType(router); - // backwards compat: also expose router instance as $uiRouterProvider.router - router['router'] = router; - router['$get'] = $get; - $get.$inject = ['$location', '$browser', '$window', '$sniffer', '$rootScope', '$http', '$templateCache']; - function $get($location, $browser, $window, $sniffer, $rootScope, $http, $templateCache) { - ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser, $window); - delete router['router']; - delete router['$get']; - return router; - } - return router; -} -var getProviderFor = function (serviceName) { return [ - '$uiRouterProvider', - function ($urp) { - var service = $urp.router[serviceName]; - service['$get'] = function () { return service; }; - return service; - }, -]; }; -// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime) -runBlock.$inject = ['$injector', '$q', '$uiRouter']; -function runBlock($injector, $q, $uiRouter) { - _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector = $injector; - _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$q = $q; - // https://github.com/angular-ui/ui-router/issues/3678 - if (!Object.prototype.hasOwnProperty.call($injector, 'strictDi')) { - try { - $injector.invoke(function (checkStrictDi) { }); - } - catch (error) { - $injector.strictDi = !!/strict mode/.exec(error && error.toString()); - } - } - // The $injector is now available. - // Find any resolvables that had dependency annotation deferred - $uiRouter.stateRegistry - .get() - .map(function (x) { return x.$$state().resolvables; }) - .reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.unnestR, []) - .filter(function (x) { return x.deps === 'deferred'; }) - .forEach(function (resolvable) { return (resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi)); }); -} -// $urlRouter service and $urlRouterProvider -var getUrlRouterProvider = function (uiRouter) { return (uiRouter.urlRouterProvider = new _urlRouterProvider__WEBPACK_IMPORTED_MODULE_7__.UrlRouterProvider(uiRouter)); }; -// $state service and $stateProvider -// $urlRouter service and $urlRouterProvider -var getStateProvider = function () { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)(router.stateProvider, { $get: function () { return router.stateService; } }); }; -watchDigests.$inject = ['$rootScope']; -function watchDigests($rootScope) { - $rootScope.$watch(function () { - _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.trace.approximateDigests++; - }); -} -mod_init.provider('$uiRouter', $uiRouterProvider); -mod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]); -mod_util.provider('$urlService', getProviderFor('urlService')); -mod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]); -mod_util.provider('$templateFactory', function () { return new _templateFactory__WEBPACK_IMPORTED_MODULE_3__.TemplateFactory(); }); -mod_state.provider('$stateRegistry', getProviderFor('stateRegistry')); -mod_state.provider('$uiRouterGlobals', getProviderFor('globals')); -mod_state.provider('$transitions', getProviderFor('transitionService')); -mod_state.provider('$state', ['$uiRouterProvider', getStateProvider]); -mod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]); -mod_main.factory('$view', function () { return router.viewService; }); -mod_main.service('$trace', function () { return _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.trace; }); -mod_main.run(watchDigests); -mod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]); -mod_state.run(['$state', function ($state) { }]); -mod_rtr.run(['$urlRouter', function ($urlRouter) { }]); -mod_init.run(runBlock); -/** @hidden TODO: find a place to move this */ -var getLocals = function (ctx) { - var tokens = ctx.getTokens().filter(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isString); - var tuples = tokens.map(function (key) { - var resolvable = ctx.getResolvable(key); - var waitPolicy = ctx.getPolicy(resolvable).async; - return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data]; - }); - return tuples.reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.applyPairs, {}); -}; -//# sourceMappingURL=services.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "$IsStateFilter": () => (/* binding */ $IsStateFilter), -/* harmony export */ "$IncludedByStateFilter": () => (/* binding */ $IncludedByStateFilter) -/* harmony export */ }); -/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ "./node_modules/@uirouter/angularjs/lib-esm/angular.js"); -/** @publicapi @module ng1 */ /** */ - -/** - * `isState` Filter: truthy if the current state is the parameter - * - * Translates to [[StateService.is]] `$state.is("stateName")`. - * - * #### Example: - * ```html - *
    show if state is 'stateName'
    - * ``` - */ -$IsStateFilter.$inject = ['$state']; -function $IsStateFilter($state) { - var isFilter = function (state, params, options) { - return $state.is(state, params, options); - }; - isFilter.$stateful = true; - return isFilter; -} -/** - * `includedByState` Filter: truthy if the current state includes the parameter - * - * Translates to [[StateService.includes]]` $state.is("fullOrPartialStateName")`. - * - * #### Example: - * ```html - *
    show if state includes 'fullOrPartialStateName'
    - * ``` - */ -$IncludedByStateFilter.$inject = ['$state']; -function $IncludedByStateFilter($state) { - var includesFilter = function (state, params, options) { - return $state.includes(state, params, options); - }; - includesFilter.$stateful = true; - return includesFilter; -} -_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state').filter('isState', $IsStateFilter).filter('includedByState', $IncludedByStateFilter); - -//# sourceMappingURL=stateFilters.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateProvider": () => (/* binding */ StateProvider) -/* harmony export */ }); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/** @publicapi @module ng1 */ /** */ - -/** - * The Angular 1 `StateProvider` - * - * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely - * on state. - * - * A state corresponds to a "place" in the application in terms of the overall UI and - * navigation. A state describes (via the controller / template / view properties) what - * the UI looks like and does at that place. - * - * States often have things in common, and the primary way of factoring out these - * commonalities in this model is via the state hierarchy, i.e. parent/child states aka - * nested states. - * - * The `$stateProvider` provides interfaces to declare these states for your app. - */ -var StateProvider = /** @class */ (function () { - function StateProvider(stateRegistry, stateService) { - this.stateRegistry = stateRegistry; - this.stateService = stateService; - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)(StateProvider.prototype), this, (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)(this)); - } - /** - * Decorates states when they are registered - * - * Allows you to extend (carefully) or override (at your own peril) the - * `stateBuilder` object used internally by [[StateRegistry]]. - * This can be used to add custom functionality to ui-router, - * for example inferring templateUrl based on the state name. - * - * When passing only a name, it returns the current (original or decorated) builder - * function that matches `name`. - * - * The builder functions that can be decorated are listed below. Though not all - * necessarily have a good use case for decoration, that is up to you to decide. - * - * In addition, users can attach custom decorators, which will generate new - * properties within the state's internal definition. There is currently no clear - * use-case for this beyond accessing internal states (i.e. $state.$current), - * however, expect this to become increasingly relevant as we introduce additional - * meta-programming features. - * - * **Warning**: Decorators should not be interdependent because the order of - * execution of the builder functions in non-deterministic. Builder functions - * should only be dependent on the state definition object and super function. - * - * - * Existing builder functions and current return values: - * - * - **parent** `{object}` - returns the parent state object. - * - **data** `{object}` - returns state data, including any inherited data that is not - * overridden by own values (if any). - * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher} - * or `null`. - * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is - * navigable). - * - **params** `{object}` - returns an array of state params that are ensured to - * be a super-set of parent's params. - * - **views** `{object}` - returns a views object where each key is an absolute view - * name (i.e. "viewName@stateName") and each value is the config object - * (template, controller) for the view. Even when you don't use the views object - * explicitly on a state config, one is still created for you internally. - * So by decorating this builder function you have access to decorating template - * and controller properties. - * - **ownParams** `{object}` - returns an array of params that belong to the state, - * not including any params defined by ancestor states. - * - **path** `{string}` - returns the full path from the root down to this state. - * Needed for state activation. - * - **includes** `{object}` - returns an object that includes every state that - * would pass a `$state.includes()` test. - * - * #### Example: - * Override the internal 'views' builder with a function that takes the state - * definition, and a reference to the internal function being overridden: - * ```js - * $stateProvider.decorator('views', function (state, parent) { - * let result = {}, - * views = parent(state); - * - * angular.forEach(views, function (config, name) { - * let autoName = (state.name + '.' + name).replace('.', '/'); - * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html'; - * result[name] = config; - * }); - * return result; - * }); - * - * $stateProvider.state('home', { - * views: { - * 'contact.list': { controller: 'ListController' }, - * 'contact.item': { controller: 'ItemController' } - * } - * }); - * ``` - * - * - * ```js - * // Auto-populates list and item views with /partials/home/contact/list.html, - * // and /partials/home/contact/item.html, respectively. - * $state.go('home'); - * ``` - * - * @param {string} name The name of the builder function to decorate. - * @param {object} func A function that is responsible for decorating the original - * builder function. The function receives two parameters: - * - * - `{object}` - state - The state config object. - * - `{object}` - super - The original builder function. - * - * @return {object} $stateProvider - $stateProvider instance - */ - StateProvider.prototype.decorator = function (name, func) { - return this.stateRegistry.decorator(name, func) || this; - }; - StateProvider.prototype.state = function (name, definition) { - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isObject)(name)) { - definition = name; - } - else { - definition.name = name; - } - this.stateRegistry.register(definition); - return this; - }; - /** - * Registers an invalid state handler - * - * This is a passthrough to [[StateService.onInvalid]] for ng1. - */ - StateProvider.prototype.onInvalid = function (callback) { - return this.stateService.onInvalid(callback); - }; - return StateProvider; -}()); - -//# sourceMappingURL=stateProvider.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js ***! - \*************************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getStateHookBuilder": () => (/* binding */ getStateHookBuilder) -/* harmony export */ }); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services */ "./node_modules/@uirouter/angularjs/lib-esm/services.js"); -/** @publicapi @module ng1 */ /** */ - - -/** - * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`, - * `onRetain` callback hooks on a [[Ng1StateDeclaration]]. - * - * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder - * ensures that those hooks are injectable for @uirouter/angularjs (ng1). - * - * @internalapi - */ -var getStateHookBuilder = function (hookName) { - return function stateHookBuilder(stateObject) { - var hook = stateObject[hookName]; - var pathname = hookName === 'onExit' ? 'from' : 'to'; - function decoratedNg1Hook(trans, state) { - var resolveContext = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(trans.treeChanges(pathname)); - var subContext = resolveContext.subContext(state.$$state()); - var locals = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)((0,_services__WEBPACK_IMPORTED_MODULE_1__.getLocals)(subContext), { $state$: state, $transition$: trans }); - return _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.invoke(hook, this, locals); - } - return hook ? decoratedNg1Hook : undefined; - }; -}; -//# sourceMappingURL=onEnterExitRetain.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getNg1ViewConfigFactory": () => (/* binding */ getNg1ViewConfigFactory), -/* harmony export */ "ng1ViewsBuilder": () => (/* binding */ ng1ViewsBuilder), -/* harmony export */ "Ng1ViewConfig": () => (/* binding */ Ng1ViewConfig) -/* harmony export */ }); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/** @publicapi @module ng1 */ /** */ - -/** @internalapi */ -function getNg1ViewConfigFactory() { - var templateFactory = null; - return function (path, view) { - templateFactory = templateFactory || _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.get('$templateFactory'); - return [new Ng1ViewConfig(path, view, templateFactory)]; - }; -} -/** @internalapi */ -var hasAnyKey = function (keys, obj) { return keys.reduce(function (acc, key) { return acc || (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(obj[key]); }, false); }; -/** - * This is a [[StateBuilder.builder]] function for angular1 `views`. - * - * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder - * handles the `views` property with logic specific to @uirouter/angularjs (ng1). - * - * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object - * and applies the state-level configuration to a view named `$default`. - * - * @internalapi - */ -function ng1ViewsBuilder(state) { - // Do not process root state - if (!state.parent) - return {}; - var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys); - // Do not allow a state to have both state-level props and also a `views: {}` property. - // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state. - // However, the `$default` approach should not be mixed with a separate `views: ` block. - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(state.views) && hasAnyKey(allViewKeys, state)) { - throw new Error("State '" + state.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): " + - (" " + allViewKeys.filter(function (key) { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(state[key]); }).join(', '))); - } - var views = {}, viewsObject = state.views || { $default: (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.pick)(state, allViewKeys) }; - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.forEach)(viewsObject, function (config, name) { - // Account for views: { "": { template... } } - name = name || '$default'; - // Account for views: { header: "headerComponent" } - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isString)(config)) - config = { component: config }; - // Make a shallow copy of the config object - config = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)({}, config); - // Do not allow a view to mix props for component-style view with props for template/controller-style view - if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) { - throw new Error("Cannot combine: " + compKeys.join('|') + " with: " + nonCompKeys.join('|') + " in stateview: '" + name + "@" + state.name + "'"); - } - config.resolveAs = config.resolveAs || '$resolve'; - config.$type = 'ng1'; - config.$context = state; - config.$name = name; - var normalized = _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ViewService.normalizeUIViewTarget(config.$context, config.$name); - config.$uiViewName = normalized.uiViewName; - config.$uiViewContextAnchor = normalized.uiViewContextAnchor; - views[name] = config; - }); - return views; -} -/** @hidden */ -var id = 0; -/** @internalapi */ -var Ng1ViewConfig = /** @class */ (function () { - function Ng1ViewConfig(path, viewDecl, factory) { - var _this = this; - this.path = path; - this.viewDecl = viewDecl; - this.factory = factory; - this.$id = id++; - this.loaded = false; - this.getTemplate = function (uiView, context) { - return _this.component - ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) - : _this.template; - }; - } - Ng1ViewConfig.prototype.load = function () { - var _this = this; - var $q = _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$q; - var context = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(this.path); - var params = this.path.reduce(function (acc, node) { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)(acc, node.paramValues); }, {}); - var promises = { - template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)), - controller: $q.when(this.getController(context)), - }; - return $q.all(promises).then(function (results) { - _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceViewServiceEvent('Loaded', _this); - _this.controller = results.controller; - (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)(_this, results.template); // Either { template: "tpl" } or { component: "cmpName" } - return _this; - }); - }; - /** - * Gets the controller for a view configuration. - * - * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller. - */ - Ng1ViewConfig.prototype.getController = function (context) { - var provider = this.viewDecl.controllerProvider; - if (!(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isInjectable)(provider)) - return this.viewDecl.controller; - var deps = _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.annotate(provider); - var providerFn = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isArray)(provider) ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.tail)(provider) : provider; - var resolvable = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.Resolvable('', providerFn, deps); - return resolvable.get(context); - }; - return Ng1ViewConfig; -}()); - -//# sourceMappingURL=views.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TemplateFactory": () => (/* binding */ TemplateFactory) -/* harmony export */ }); -/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ "./node_modules/@uirouter/angularjs/lib-esm/angular.js"); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/** @publicapi @module view */ /** */ - - -/** - * Service which manages loading of templates from a ViewConfig. - */ -var TemplateFactory = /** @class */ (function () { - function TemplateFactory() { - var _this = this; - /** @hidden */ this._useHttp = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.version.minor < 3; - /** @hidden */ this.$get = [ - '$http', - '$templateCache', - '$injector', - function ($http, $templateCache, $injector) { - _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest'); - _this.$http = $http; - _this.$templateCache = $templateCache; - return _this; - }, - ]; - } - /** @hidden */ - TemplateFactory.prototype.useHttpService = function (value) { - this._useHttp = value; - }; - /** - * Creates a template from a configuration object. - * - * @param config Configuration object for which to load a template. - * The following properties are search in the specified order, and the first one - * that is defined is used to create the template: - * - * @param params Parameters to pass to the template function. - * @param context The resolve context associated with the template's view - * - * @return {string|object} The template html as a string, or a promise for - * that string,or `null` if no template is configured. - */ - TemplateFactory.prototype.fromConfig = function (config, params, context) { - var defaultTemplate = ''; - var asTemplate = function (result) { return _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(result).then(function (str) { return ({ template: str }); }); }; - var asComponent = function (result) { return _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(result).then(function (str) { return ({ component: str }); }); }; - return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.template) - ? asTemplate(this.fromString(config.template, params)) - : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.templateUrl) - ? asTemplate(this.fromUrl(config.templateUrl, params)) - : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.templateProvider) - ? asTemplate(this.fromProvider(config.templateProvider, params, context)) - : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.component) - ? asComponent(config.component) - : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.componentProvider) - ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) - : asTemplate(defaultTemplate); - }; - /** - * Creates a template from a string or a function returning a string. - * - * @param template html template as a string or function that returns an html template as a string. - * @param params Parameters to pass to the template function. - * - * @return {string|object} The template html as a string, or a promise for that - * string. - */ - TemplateFactory.prototype.fromString = function (template, params) { - return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isFunction)(template) ? template(params) : template; - }; - /** - * Loads a template from the a URL via `$http` and `$templateCache`. - * - * @param {string|Function} url url of the template to load, or a function - * that returns a url. - * @param {Object} params Parameters to pass to the url function. - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - TemplateFactory.prototype.fromUrl = function (url, params) { - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isFunction)(url)) - url = url(params); - if (url == null) - return null; - if (this._useHttp) { - return this.$http - .get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } }) - .then(function (response) { - return response.data; - }); - } - return this.$templateRequest(url); - }; - /** - * Creates a template by invoking an injectable provider function. - * - * @param provider Function to invoke via `locals` - * @param {Function} injectFn a function used to invoke the template provider - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - TemplateFactory.prototype.fromProvider = function (provider, params, context) { - var deps = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.annotate(provider); - var providerFn = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(provider) ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.tail)(provider) : provider; - var resolvable = new _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.Resolvable('', providerFn, deps); - return resolvable.get(context); - }; - /** - * Creates a component's template by invoking an injectable provider function. - * - * @param provider Function to invoke via `locals` - * @param {Function} injectFn a function used to invoke the template provider - * @return {string} The template html as a string: "". - */ - TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) { - var deps = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.annotate(provider); - var providerFn = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(provider) ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.tail)(provider) : provider; - var resolvable = new _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.Resolvable('', providerFn, deps); - return resolvable.get(context); - }; - /** - * Creates a template from a component's name - * - * This implements route-to-component. - * It works by retrieving the component (directive) metadata from the injector. - * It analyses the component's bindings, then constructs a template that instantiates the component. - * The template wires input and output bindings to resolves or from the parent component. - * - * @param uiView {object} The parent ui-view (for binding outputs to callbacks) - * @param context The ResolveContext (for binding outputs to callbacks returned from resolves) - * @param component {string} Component's name in camel case. - * @param bindings An object defining the component's bindings: {foo: '<'} - * @return {string} The template as a string: "". - */ - TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) { - bindings = bindings || {}; - // Bind once prefix - var prefix = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.version.minor >= 3 ? '::' : ''; - // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-` - var kebob = function (camelCase) { - var kebobed = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.kebobString)(camelCase); - return /^(x|data)-/.exec(kebobed) ? "x-" + kebobed : kebobed; - }; - var attributeTpl = function (input) { - var name = input.name, type = input.type; - var attrName = kebob(name); - // If the ui-view has an attribute which matches a binding on the routed component - // then pass that attribute through to the routed component template. - // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:` - if (uiView.attr(attrName) && !bindings[name]) - return attrName + "='" + uiView.attr(attrName) + "'"; - var resolveName = bindings[name] || name; - // Pre-evaluate the expression for "@" bindings by enclosing in {{ }} - // some-attr="{{ ::$resolve.someResolveName }}" - if (type === '@') - return attrName + "='{{" + prefix + "$resolve." + resolveName + "}}'"; - // Wire "&" callbacks to resolves that return a callback function - // Get the result of the resolve (should be a function) and annotate it to get its arguments. - // some-attr="$resolve.someResolveResultName(foo, bar)" - if (type === '&') { - var res = context.getResolvable(resolveName); - var fn = res && res.data; - var args = (fn && _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.annotate(fn)) || []; - // account for array style injection, i.e., ['foo', function(foo) {}] - var arrayIdxStr = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn) ? "[" + (fn.length - 1) + "]" : ''; - return attrName + "='$resolve." + resolveName + arrayIdxStr + "(" + args.join(',') + ")'"; - } - // some-attr="::$resolve.someResolveName" - return attrName + "='" + prefix + "$resolve." + resolveName + "'"; - }; - var attrs = getComponentBindings(component).map(attributeTpl).join(' '); - var kebobName = kebob(component); - return "<" + kebobName + " " + attrs + ">"; - }; - return TemplateFactory; -}()); - -// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&') -function getComponentBindings(name) { - var cmpDefs = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.get(name + 'Directive'); // could be multiple - if (!cmpDefs || !cmpDefs.length) - throw new Error("Unable to find component named '" + name + "'"); - return cmpDefs.map(getBindings).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.unnestR, []); -} -// Given a directive definition, find its object input attributes -// Use different properties, depending on the type of directive (component, bindToController, normal) -var getBindings = function (def) { - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isObject)(def.bindToController)) - return scopeBindings(def.bindToController); - return scopeBindings(def.scope); -}; -// for ng 1.2 style, process the scope: { input: "=foo" } -// for ng 1.3 through ng 1.5, process the component's bindToController: { input: "=foo" } object -var scopeBindings = function (bindingsObj) { - return Object.keys(bindingsObj || {}) - // [ 'input', [ '=foo', '=', 'foo' ] ] - .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; }) - // skip malformed values - .filter(function (tuple) { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(tuple) && (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(tuple[1]); }) - // { name: ('foo' || 'input'), type: '=' } - .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); }); -}; -//# sourceMappingURL=templateFactory.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlRouterProvider": () => (/* binding */ UrlRouterProvider) -/* harmony export */ }); -/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ "./node_modules/@uirouter/core/lib-esm/index.js"); -/** @publicapi @module url */ /** */ - - -/** - * Manages rules for client-side URL - * - * ### Deprecation warning: - * This class is now considered to be an internal API - * Use the [[UrlService]] instead. - * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]]. - * - * This class manages the router rules for what to do when the URL changes. - * - * This provider remains for backwards compatibility. - * - * @internalapi - * @deprecated - */ -var UrlRouterProvider = /** @class */ (function () { - /** @hidden */ - function UrlRouterProvider(/** @hidden */ router) { - this.router = router; - } - UrlRouterProvider.injectableHandler = function (router, handler) { - return function (match) { return _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params }); }; - }; - /** @hidden */ - UrlRouterProvider.prototype.$get = function () { - var urlService = this.router.urlService; - this.router.urlRouter.update(true); - if (!urlService.interceptDeferred) - urlService.listen(); - return this.router.urlRouter; - }; - /** - * Registers a url handler function. - * - * Registers a low level url handler (a `rule`). - * A rule detects specific URL patterns and returns a redirect, or performs some action. - * - * If a rule returns a string, the URL is replaced with the string, and all rules are fired again. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router.router']); - * - * app.config(function ($urlRouterProvider) { - * // Here's an example of how you might allow case insensitive urls - * $urlRouterProvider.rule(function ($injector, $location) { - * var path = $location.path(), - * normalized = path.toLowerCase(); - * - * if (path !== normalized) { - * return normalized; - * } - * }); - * }); - * ``` - * - * @param ruleFn - * Handler function that takes `$injector` and `$location` services as arguments. - * You can use them to detect a url and return a different url as a string. - * - * @return [[UrlRouterProvider]] (`this`) - */ - UrlRouterProvider.prototype.rule = function (ruleFn) { - var _this = this; - if (!(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(ruleFn)) - throw new Error("'rule' must be a function"); - var match = function () { return ruleFn(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector, _this.router.locationService); }; - var rule = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.BaseUrlRule(match, _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.identity); - this.router.urlService.rules.rule(rule); - return this; - }; - /** - * Defines the path or behavior to use when no url can be matched. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router.router']); - * - * app.config(function ($urlRouterProvider) { - * // if the path doesn't match any of the urls you configured - * // otherwise will take care of routing the user to the - * // specified url - * $urlRouterProvider.otherwise('/index'); - * - * // Example of using function rule as param - * $urlRouterProvider.otherwise(function ($injector, $location) { - * return '/a/valid/url'; - * }); - * }); - * ``` - * - * @param rule - * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`. - * The function version is passed two params: `$injector` and `$location` services, and should return a url string. - * - * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance - */ - UrlRouterProvider.prototype.otherwise = function (rule) { - var _this = this; - var urlRules = this.router.urlService.rules; - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isString)(rule)) { - urlRules.otherwise(rule); - } - else if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(rule)) { - urlRules.otherwise(function () { return rule(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector, _this.router.locationService); }); - } - else { - throw new Error("'rule' must be a string or function"); - } - return this; - }; - /** - * Registers a handler for a given url matching. - * - * If the handler is a string, it is - * treated as a redirect, and is interpolated according to the syntax of match - * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). - * - * If the handler is a function, it is injectable. - * It gets invoked if `$location` matches. - * You have the option of inject the match object as `$match`. - * - * The handler can return - * - * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` - * will continue trying to find another one that matches. - * - **string** which is treated as a redirect and passed to `$location.url()` - * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router.router']); - * - * app.config(function ($urlRouterProvider) { - * $urlRouterProvider.when($state.url, function ($match, $stateParams) { - * if ($state.$current.navigable !== state || - * !equalForKeys($match, $stateParams) { - * $state.transitionTo(state, $match, false); - * } - * }); - * }); - * ``` - * - * @param what A pattern string to match, compiled as a [[UrlMatcher]]. - * @param handler The path (or function that returns a path) that you want to redirect your user to. - * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]] - * - * Note: the handler may also invoke arbitrary code, such as `$state.go()` - */ - UrlRouterProvider.prototype.when = function (what, handler) { - if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isArray)(handler) || (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handler)) { - handler = UrlRouterProvider.injectableHandler(this.router, handler); - } - this.router.urlService.rules.when(what, handler); - return this; - }; - /** - * Disables monitoring of the URL. - * - * Call this method before UI-Router has bootstrapped. - * It will stop UI-Router from performing the initial url sync. - * - * This can be useful to perform some asynchronous initialization before the router starts. - * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router']); - * - * app.config(function ($urlRouterProvider) { - * // Prevent $urlRouter from automatically intercepting URL changes; - * $urlRouterProvider.deferIntercept(); - * }) - * - * app.run(function (MyService, $urlRouter, $http) { - * $http.get("/stuff").then(function(resp) { - * MyService.doStuff(resp.data); - * $urlRouter.listen(); - * $urlRouter.sync(); - * }); - * }); - * ``` - * - * @param defer Indicates whether to defer location change interception. - * Passing no parameter is equivalent to `true`. - */ - UrlRouterProvider.prototype.deferIntercept = function (defer) { - this.router.urlService.deferIntercept(defer); - }; - return UrlRouterProvider; -}()); - -//# sourceMappingURL=urlRouterProvider.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js": -/*!****************************************************************!*\ - !*** ./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ "./node_modules/@uirouter/angularjs/lib-esm/angular.js"); -/** @publicapi @module ng1 */ /** */ - -/** @hidden */ -function $ViewScrollProvider() { - var useAnchorScroll = false; - this.useAnchorScroll = function () { - useAnchorScroll = true; - }; - this.$get = [ - '$anchorScroll', - '$timeout', - function ($anchorScroll, $timeout) { - if (useAnchorScroll) { - return $anchorScroll; - } - return function ($element) { - return $timeout(function () { - $element[0].scrollIntoView(); - }, 0, false); - }; - }, - ]; -} -_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); -//# sourceMappingURL=viewScroll.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/common.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/common.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "root": () => (/* binding */ root), -/* harmony export */ "fromJson": () => (/* binding */ fromJson), -/* harmony export */ "toJson": () => (/* binding */ toJson), -/* harmony export */ "forEach": () => (/* binding */ forEach), -/* harmony export */ "extend": () => (/* binding */ extend), -/* harmony export */ "equals": () => (/* binding */ equals), -/* harmony export */ "identity": () => (/* binding */ identity), -/* harmony export */ "noop": () => (/* binding */ noop), -/* harmony export */ "createProxyFunctions": () => (/* binding */ createProxyFunctions), -/* harmony export */ "inherit": () => (/* binding */ inherit), -/* harmony export */ "inArray": () => (/* binding */ inArray), -/* harmony export */ "_inArray": () => (/* binding */ _inArray), -/* harmony export */ "removeFrom": () => (/* binding */ removeFrom), -/* harmony export */ "_removeFrom": () => (/* binding */ _removeFrom), -/* harmony export */ "pushTo": () => (/* binding */ pushTo), -/* harmony export */ "_pushTo": () => (/* binding */ _pushTo), -/* harmony export */ "deregAll": () => (/* binding */ deregAll), -/* harmony export */ "defaults": () => (/* binding */ defaults), -/* harmony export */ "mergeR": () => (/* binding */ mergeR), -/* harmony export */ "ancestors": () => (/* binding */ ancestors), -/* harmony export */ "pick": () => (/* binding */ pick), -/* harmony export */ "omit": () => (/* binding */ omit), -/* harmony export */ "pluck": () => (/* binding */ pluck), -/* harmony export */ "filter": () => (/* binding */ filter), -/* harmony export */ "find": () => (/* binding */ find), -/* harmony export */ "mapObj": () => (/* binding */ mapObj), -/* harmony export */ "map": () => (/* binding */ map), -/* harmony export */ "values": () => (/* binding */ values), -/* harmony export */ "allTrueR": () => (/* binding */ allTrueR), -/* harmony export */ "anyTrueR": () => (/* binding */ anyTrueR), -/* harmony export */ "unnestR": () => (/* binding */ unnestR), -/* harmony export */ "flattenR": () => (/* binding */ flattenR), -/* harmony export */ "pushR": () => (/* binding */ pushR), -/* harmony export */ "uniqR": () => (/* binding */ uniqR), -/* harmony export */ "unnest": () => (/* binding */ unnest), -/* harmony export */ "flatten": () => (/* binding */ flatten), -/* harmony export */ "assertPredicate": () => (/* binding */ assertPredicate), -/* harmony export */ "assertMap": () => (/* binding */ assertMap), -/* harmony export */ "assertFn": () => (/* binding */ assertFn), -/* harmony export */ "pairs": () => (/* binding */ pairs), -/* harmony export */ "arrayTuples": () => (/* binding */ arrayTuples), -/* harmony export */ "applyPairs": () => (/* binding */ applyPairs), -/* harmony export */ "tail": () => (/* binding */ tail), -/* harmony export */ "copy": () => (/* binding */ copy), -/* harmony export */ "_extend": () => (/* binding */ _extend), -/* harmony export */ "silenceUncaughtInPromise": () => (/* binding */ silenceUncaughtInPromise), -/* harmony export */ "silentRejection": () => (/* binding */ silentRejection) -/* harmony export */ }); -/* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _coreservices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; -/** - * Random utility functions used in the UI-Router code - * - * These functions are exported, but are subject to change without notice. - * - * @packageDocumentation - * @preferred - */ - - - -var root = (typeof self === 'object' && self.self === self && self) || - (typeof __webpack_require__.g === 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g) || - undefined; -var angular = root.angular || {}; -var fromJson = angular.fromJson || JSON.parse.bind(JSON); -var toJson = angular.toJson || JSON.stringify.bind(JSON); -var forEach = angular.forEach || _forEach; -var extend = Object.assign || _extend; -var equals = angular.equals || _equals; -function identity(x) { - return x; -} -function noop() { } -/** - * Builds proxy functions on the `to` object which pass through to the `from` object. - * - * For each key in `fnNames`, creates a proxy function on the `to` object. - * The proxy function calls the real function on the `from` object. - * - * - * #### Example: - * This example creates an new class instance whose functions are prebound to the new'd object. - * ```js - * class Foo { - * constructor(data) { - * // Binds all functions from Foo.prototype to 'this', - * // then copies them to 'this' - * bindFunctions(Foo.prototype, this, this); - * this.data = data; - * } - * - * log() { - * console.log(this.data); - * } - * } - * - * let myFoo = new Foo([1,2,3]); - * var logit = myFoo.log; - * logit(); // logs [1, 2, 3] from the myFoo 'this' instance - * ``` - * - * #### Example: - * This example creates a bound version of a service function, and copies it to another object - * ``` - * - * var SomeService = { - * this.data = [3, 4, 5]; - * this.log = function() { - * console.log(this.data); - * } - * } - * - * // Constructor fn - * function OtherThing() { - * // Binds all functions from SomeService to SomeService, - * // then copies them to 'this' - * bindFunctions(SomeService, this, SomeService); - * } - * - * let myOtherThing = new OtherThing(); - * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this' - * ``` - * - * @param source A function that returns the source object which contains the original functions to be bound - * @param target A function that returns the target object which will receive the bound functions - * @param bind A function that returns the object which the functions will be bound to - * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object) - * @param latebind If true, the binding of the function is delayed until the first time it's invoked - */ -function createProxyFunctions(source, target, bind, fnNames, latebind) { - if (latebind === void 0) { latebind = false; } - var bindFunction = function (fnName) { return source()[fnName].bind(bind()); }; - var makeLateRebindFn = function (fnName) { - return function lateRebindFunction() { - target[fnName] = bindFunction(fnName); - return target[fnName].apply(null, arguments); - }; - }; - fnNames = fnNames || Object.keys(source()); - return fnNames.reduce(function (acc, name) { - acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name); - return acc; - }, target); -} -/** - * prototypal inheritance helper. - * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it - */ -var inherit = function (parent, extra) { return extend(Object.create(parent), extra); }; -/** Given an array, returns true if the object is found in the array, (using indexOf) */ -var inArray = (0,_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(_inArray); -function _inArray(array, obj) { - return array.indexOf(obj) !== -1; -} -/** - * Given an array, and an item, if the item is found in the array, it removes it (in-place). - * The same array is returned - */ -var removeFrom = (0,_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(_removeFrom); -function _removeFrom(array, obj) { - var idx = array.indexOf(obj); - if (idx >= 0) - array.splice(idx, 1); - return array; -} -/** pushes a values to an array and returns the value */ -var pushTo = (0,_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(_pushTo); -function _pushTo(arr, val) { - return arr.push(val), val; -} -/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */ -var deregAll = function (functions) { - return functions.slice().forEach(function (fn) { - typeof fn === 'function' && fn(); - removeFrom(functions, fn); - }); -}; -/** - * Applies a set of defaults to an options object. The options object is filtered - * to only those properties of the objects in the defaultsList. - * Earlier objects in the defaultsList take precedence when applying defaults. - */ -function defaults(opts) { - var defaultsList = []; - for (var _i = 1; _i < arguments.length; _i++) { - defaultsList[_i - 1] = arguments[_i]; - } - var defaultVals = extend.apply(void 0, __spreadArrays([{}], defaultsList.reverse())); - return extend(defaultVals, pick(opts || {}, Object.keys(defaultVals))); -} -/** Reduce function that merges each element of the list into a single object, using extend */ -var mergeR = function (memo, item) { return extend(memo, item); }; -/** - * Finds the common ancestor path between two states. - * - * @param {Object} first The first state. - * @param {Object} second The second state. - * @return {Array} Returns an array of state names in descending order, not including the root. - */ -function ancestors(first, second) { - var path = []; - // tslint:disable-next-line:forin - for (var n in first.path) { - if (first.path[n] !== second.path[n]) - break; - path.push(first.path[n]); - } - return path; -} -/** - * Return a copy of the object only containing the whitelisted properties. - * - * #### Example: - * ``` - * var foo = { a: 1, b: 2, c: 3 }; - * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 } - * ``` - * @param obj the source object - * @param propNames an Array of strings, which are the whitelisted property names - */ -function pick(obj, propNames) { - var objCopy = {}; - for (var _prop in obj) { - if (propNames.indexOf(_prop) !== -1) { - objCopy[_prop] = obj[_prop]; - } - } - return objCopy; -} -/** - * Return a copy of the object omitting the blacklisted properties. - * - * @example - * ``` - * - * var foo = { a: 1, b: 2, c: 3 }; - * var ab = omit(foo, ['a', 'b']); // { c: 3 } - * ``` - * @param obj the source object - * @param propNames an Array of strings, which are the blacklisted property names - */ -function omit(obj, propNames) { - return Object.keys(obj) - .filter((0,_hof__WEBPACK_IMPORTED_MODULE_1__.not)(inArray(propNames))) - .reduce(function (acc, key) { return ((acc[key] = obj[key]), acc); }, {}); -} -/** - * Maps an array, or object to a property (by name) - */ -function pluck(collection, propName) { - return map(collection, (0,_hof__WEBPACK_IMPORTED_MODULE_1__.prop)(propName)); -} -/** Filters an Array or an Object's properties based on a predicate */ -function filter(collection, callback) { - var arr = (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(collection), result = arr ? [] : {}; - var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return (result[key] = x); }; - forEach(collection, function (item, i) { - if (callback(item, i)) - accept(item, i); - }); - return result; -} -/** Finds an object from an array, or a property of an object, that matches a predicate */ -function find(collection, callback) { - var result; - forEach(collection, function (item, i) { - if (result) - return; - if (callback(item, i)) - result = item; - }); - return result; -} -/** Given an object, returns a new object, where each property is transformed by the callback function */ -var mapObj = map; -/** Maps an array or object properties using a callback function */ -function map(collection, callback, target) { - target = target || ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(collection) ? [] : {}); - forEach(collection, function (item, i) { return (target[i] = callback(item, i)); }); - return target; -} -/** - * Given an object, return its enumerable property values - * - * @example - * ``` - * - * let foo = { a: 1, b: 2, c: 3 } - * let vals = values(foo); // [ 1, 2, 3 ] - * ``` - */ -var values = function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); }; -/** - * Reduce function that returns true if all of the values are truthy. - * - * @example - * ``` - * - * let vals = [ 1, true, {}, "hello world"]; - * vals.reduce(allTrueR, true); // true - * - * vals.push(0); - * vals.reduce(allTrueR, true); // false - * ``` - */ -var allTrueR = function (memo, elem) { return memo && elem; }; -/** - * Reduce function that returns true if any of the values are truthy. - * - * * @example - * ``` - * - * let vals = [ 0, null, undefined ]; - * vals.reduce(anyTrueR, true); // false - * - * vals.push("hello world"); - * vals.reduce(anyTrueR, true); // true - * ``` - */ -var anyTrueR = function (memo, elem) { return memo || elem; }; -/** - * Reduce function which un-nests a single level of arrays - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * input.reduce(unnestR, []) // [ "a", "b", "c", "d", [ "double, "nested" ] ] - * ``` - */ -var unnestR = function (memo, elem) { return memo.concat(elem); }; -/** - * Reduce function which recursively un-nests all arrays - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * input.reduce(unnestR, []) // [ "a", "b", "c", "d", "double, "nested" ] - * ``` - */ -var flattenR = function (memo, elem) { - return (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem); -}; -/** - * Reduce function that pushes an object to an array, then returns the array. - * Mostly just for [[flattenR]] and [[uniqR]] - */ -function pushR(arr, obj) { - arr.push(obj); - return arr; -} -/** Reduce function that filters out duplicates */ -var uniqR = function (acc, token) { return (inArray(acc, token) ? acc : pushR(acc, token)); }; -/** - * Return a new array with a single level of arrays unnested. - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * unnest(input) // [ "a", "b", "c", "d", [ "double, "nested" ] ] - * ``` - */ -var unnest = function (arr) { return arr.reduce(unnestR, []); }; -/** - * Return a completely flattened version of an array. - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * flatten(input) // [ "a", "b", "c", "d", "double, "nested" ] - * ``` - */ -var flatten = function (arr) { return arr.reduce(flattenR, []); }; -/** - * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass. - * @example - * ``` - * - * let isNumber = (obj) => typeof(obj) === 'number'; - * let allNumbers = [ 1, 2, 3, 4, 5 ]; - * allNumbers.filter(assertPredicate(isNumber)); //OK - * - * let oneString = [ 1, 2, 3, 4, "5" ]; - * oneString.filter(assertPredicate(isNumber, "Not all numbers")); // throws Error(""Not all numbers""); - * ``` - */ -var assertPredicate = assertFn; -/** - * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test. - * @example - * ``` - * - * var data = { foo: 1, bar: 2 }; - * - * let keys = [ 'foo', 'bar' ] - * let values = keys.map(assertMap(key => data[key], "Key not found")); - * // values is [1, 2] - * - * let keys = [ 'foo', 'bar', 'baz' ] - * let values = keys.map(assertMap(key => data[key], "Key not found")); - * // throws Error("Key not found") - * ``` - */ -var assertMap = assertFn; -function assertFn(predicateOrMap, errMsg) { - if (errMsg === void 0) { errMsg = 'assert failure'; } - return function (obj) { - var result = predicateOrMap(obj); - if (!result) { - throw new Error((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(errMsg) ? errMsg(obj) : errMsg); - } - return result; - }; -} -/** - * Like _.pairs: Given an object, returns an array of key/value pairs - * - * @example - * ``` - * - * pairs({ foo: "FOO", bar: "BAR }) // [ [ "foo", "FOO" ], [ "bar": "BAR" ] ] - * ``` - */ -var pairs = function (obj) { return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); }; -/** - * Given two or more parallel arrays, returns an array of tuples where - * each tuple is composed of [ a[i], b[i], ... z[i] ] - * - * @example - * ``` - * - * let foo = [ 0, 2, 4, 6 ]; - * let bar = [ 1, 3, 5, 7 ]; - * let baz = [ 10, 30, 50, 70 ]; - * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ] - * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ] - * ``` - */ -function arrayTuples() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (args.length === 0) - return []; - var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER - var result = []; - var _loop_1 = function (i) { - // This is a hot function - // Unroll when there are 1-4 arguments - switch (args.length) { - case 1: - result.push([args[0][i]]); - break; - case 2: - result.push([args[0][i], args[1][i]]); - break; - case 3: - result.push([args[0][i], args[1][i], args[2][i]]); - break; - case 4: - result.push([args[0][i], args[1][i], args[2][i], args[3][i]]); - break; - default: - result.push(args.map(function (array) { return array[i]; })); - break; - } - }; - for (var i = 0; i < maxArrayLen; i++) { - _loop_1(i); - } - return result; -} -/** - * Reduce function which builds an object from an array of [key, value] pairs. - * - * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration. - * - * Each keyValueTuple should be an array with values [ key: string, value: any ] - * - * @example - * ``` - * - * var pairs = [ ["fookey", "fooval"], ["barkey", "barval"] ] - * - * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {}) - * // pairsToObj == { fookey: "fooval", barkey: "barval" } - * - * // Or, more simply: - * var pairsToObj = pairs.reduce(applyPairs, {}) - * // pairsToObj == { fookey: "fooval", barkey: "barval" } - * ``` - */ -function applyPairs(memo, keyValTuple) { - var key, value; - if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(keyValTuple)) - key = keyValTuple[0], value = keyValTuple[1]; - if (!(0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(key)) - throw new Error('invalid parameters to applyPairs'); - memo[key] = value; - return memo; -} -/** Get the last element of an array */ -function tail(arr) { - return (arr.length && arr[arr.length - 1]) || undefined; -} -/** - * shallow copy from src to dest - */ -function copy(src, dest) { - if (dest) - Object.keys(dest).forEach(function (key) { return delete dest[key]; }); - if (!dest) - dest = {}; - return extend(dest, src); -} -/** Naive forEach implementation works with Objects or Arrays */ -function _forEach(obj, cb, _this) { - if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(obj)) - return obj.forEach(cb, _this); - Object.keys(obj).forEach(function (key) { return cb(obj[key], key); }); -} -function _extend(toObj) { - for (var i = 1; i < arguments.length; i++) { - var obj = arguments[i]; - if (!obj) - continue; - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; j++) { - toObj[keys[j]] = obj[keys[j]]; - } - } - return toObj; -} -function _equals(o1, o2) { - if (o1 === o2) - return true; - if (o1 === null || o2 === null) - return false; - if (o1 !== o1 && o2 !== o2) - return true; // NaN === NaN - var t1 = typeof o1, t2 = typeof o2; - if (t1 !== t2 || t1 !== 'object') - return false; - var tup = [o1, o2]; - if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(tup)) - return _arraysEq(o1, o2); - if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isDate)(tup)) - return o1.getTime() === o2.getTime(); - if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isRegExp)(tup)) - return o1.toString() === o2.toString(); - if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(tup)) - return true; // meh - var predicates = [_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction, _predicates__WEBPACK_IMPORTED_MODULE_0__.isArray, _predicates__WEBPACK_IMPORTED_MODULE_0__.isDate, _predicates__WEBPACK_IMPORTED_MODULE_0__.isRegExp]; - if (predicates.map(_hof__WEBPACK_IMPORTED_MODULE_1__.any).reduce(function (b, fn) { return b || !!fn(tup); }, false)) - return false; - var keys = {}; - // tslint:disable-next-line:forin - for (var key in o1) { - if (!_equals(o1[key], o2[key])) - return false; - keys[key] = true; - } - for (var key in o2) { - if (!keys[key]) - return false; - } - return true; -} -function _arraysEq(a1, a2) { - if (a1.length !== a2.length) - return false; - return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true); -} -// issue #2676 -var silenceUncaughtInPromise = function (promise) { return promise.catch(function (e) { return 0; }) && promise; }; -var silentRejection = function (error) { return silenceUncaughtInPromise(_coreservices__WEBPACK_IMPORTED_MODULE_2__.services.$q.reject(error)); }; -//# sourceMappingURL=common.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js": -/*!********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/coreservices.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "makeStub": () => (/* binding */ makeStub), -/* harmony export */ "services": () => (/* binding */ services) -/* harmony export */ }); -var noImpl = function (fnname) { return function () { - throw new Error("No implementation for " + fnname + ". The framework specific code did not implement this method."); -}; }; -var makeStub = function (service, methods) { - return methods.reduce(function (acc, key) { return ((acc[key] = noImpl(service + "." + key + "()")), acc); }, {}); -}; -var services = { - $q: undefined, - $injector: undefined, -}; - -//# sourceMappingURL=coreservices.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/glob.js": -/*!************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/glob.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Glob": () => (/* binding */ Glob) -/* harmony export */ }); -/** - * Matches state names using glob-like pattern strings. - * - * Globs can be used in specific APIs including: - * - * - [[StateService.is]] - * - [[StateService.includes]] - * - The first argument to Hook Registration functions like [[TransitionService.onStart]] - * - [[HookMatchCriteria]] and [[HookMatchCriterion]] - * - * A `Glob` string is a pattern which matches state names. - * Nested state names are split into segments (separated by a dot) when processing. - * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz'] - * - * Globs work according to the following rules: - * - * ### Exact match: - * - * The glob `'A.B'` matches the state named exactly `'A.B'`. - * - * | Glob |Matches states named|Does not match state named| - * |:------------|:--------------------|:---------------------| - * | `'A'` | `'A'` | `'B'` , `'A.C'` | - * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` | - * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`| - * - * ### Single star (`*`) - * - * A single star (`*`) is a wildcard that matches exactly one segment. - * - * | Glob |Matches states named |Does not match state named | - * |:------------|:---------------------|:--------------------------| - * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` | - * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` | - * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`| - * - * ### Double star (`**`) - * - * A double star (`'**'`) is a wildcard that matches *zero or more segments* - * - * | Glob |Matches states named |Does not match state named | - * |:------------|:----------------------------------------------|:----------------------------------| - * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) | - * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` | - * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` | - * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` | - * - * @packageDocumentation - */ -var Glob = /** @class */ (function () { - function Glob(text) { - this.text = text; - this.glob = text.split('.'); - var regexpString = this.text - .split('.') - .map(function (seg) { - if (seg === '**') - return '(?:|(?:\\.[^.]*)*)'; - if (seg === '*') - return '\\.[^.]*'; - return '\\.' + seg; - }) - .join(''); - this.regexp = new RegExp('^' + regexpString + '$'); - } - /** Returns true if the string has glob-like characters in it */ - Glob.is = function (text) { - return !!/[!,*]+/.exec(text); - }; - /** Returns a glob from the string, or null if the string isn't Glob-like */ - Glob.fromString = function (text) { - return Glob.is(text) ? new Glob(text) : null; - }; - Glob.prototype.matches = function (name) { - return this.regexp.test('.' + name); - }; - return Glob; -}()); - -//# sourceMappingURL=glob.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/hof.js": -/*!***********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/hof.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "curry": () => (/* binding */ curry), -/* harmony export */ "compose": () => (/* binding */ compose), -/* harmony export */ "pipe": () => (/* binding */ pipe), -/* harmony export */ "prop": () => (/* binding */ prop), -/* harmony export */ "propEq": () => (/* binding */ propEq), -/* harmony export */ "parse": () => (/* binding */ parse), -/* harmony export */ "not": () => (/* binding */ not), -/* harmony export */ "and": () => (/* binding */ and), -/* harmony export */ "or": () => (/* binding */ or), -/* harmony export */ "all": () => (/* binding */ all), -/* harmony export */ "any": () => (/* binding */ any), -/* harmony export */ "is": () => (/* binding */ is), -/* harmony export */ "eq": () => (/* binding */ eq), -/* harmony export */ "val": () => (/* binding */ val), -/* harmony export */ "invoke": () => (/* binding */ invoke), -/* harmony export */ "pattern": () => (/* binding */ pattern) -/* harmony export */ }); -/** - * Higher order functions - * - * These utility functions are exported, but are subject to change without notice. - * - * @packageDocumentation - */ -var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; -/** - * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function. - * - * Given a function with N parameters, returns a new function that supports partial application. - * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters, - * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to - * accept more parameters until all N parameters have been supplied. - * - * - * This contrived example uses a partially applied function as an predicate, which returns true - * if an object is found in both arrays. - * @example - * ``` - * // returns true if an object is in both of the two arrays - * function inBoth(array1, array2, object) { - * return array1.indexOf(object) !== -1 && - * array2.indexOf(object) !== 1; - * } - * let obj1, obj2, obj3, obj4, obj5, obj6, obj7 - * let foos = [obj1, obj3] - * let bars = [obj3, obj4, obj5] - * - * // A curried "copy" of inBoth - * let curriedInBoth = curry(inBoth); - * // Partially apply both the array1 and array2 - * let inFoosAndBars = curriedInBoth(foos, bars); - * - * // Supply the final argument; since all arguments are - * // supplied, the original inBoth function is then called. - * let obj1InBoth = inFoosAndBars(obj1); // false - * - * // Use the inFoosAndBars as a predicate. - * // Filter, on each iteration, supplies the final argument - * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ]; - * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ] - * - * ``` - * - * @param fn - * @returns {*|function(): (*|any)} - */ -function curry(fn) { - return function curried() { - if (arguments.length >= fn.length) { - return fn.apply(this, arguments); - } - var args = Array.prototype.slice.call(arguments); - return curried.bind.apply(curried, __spreadArrays([this], args)); - }; -} -/** - * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left - * given: f(x), g(x), h(x) - * let composed = compose(f,g,h) - * then, composed is: f(g(h(x))) - */ -function compose() { - var args = arguments; - var start = args.length - 1; - return function () { - var i = start, result = args[start].apply(this, arguments); - while (i--) - result = args[i].call(this, result); - return result; - }; -} -/** - * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right - * given: f(x), g(x), h(x) - * let piped = pipe(f,g,h); - * then, piped is: h(g(f(x))) - */ -function pipe() { - var funcs = []; - for (var _i = 0; _i < arguments.length; _i++) { - funcs[_i] = arguments[_i]; - } - return compose.apply(null, [].slice.call(arguments).reverse()); -} -/** - * Given a property name, returns a function that returns that property from an object - * let obj = { foo: 1, name: "blarg" }; - * let getName = prop("name"); - * getName(obj) === "blarg" - */ -var prop = function (name) { return function (obj) { return obj && obj[name]; }; }; -/** - * Given a property name and a value, returns a function that returns a boolean based on whether - * the passed object has a property that matches the value - * let obj = { foo: 1, name: "blarg" }; - * let getName = propEq("name", "blarg"); - * getName(obj) === true - */ -var propEq = curry(function (name, _val, obj) { return obj && obj[name] === _val; }); -/** - * Given a dotted property name, returns a function that returns a nested property from an object, or undefined - * let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, }; - * let getName = prop("nestedObj.name"); - * getName(obj) === "blarg" - * let propNotFound = prop("this.property.doesnt.exist"); - * propNotFound(obj) === undefined - */ -var parse = function (name) { return pipe.apply(null, name.split('.').map(prop)); }; -/** - * Given a function that returns a truthy or falsey value, returns a - * function that returns the opposite (falsey or truthy) value given the same inputs - */ -var not = function (fn) { return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return !fn.apply(null, args); -}; }; -/** - * Given two functions that return truthy or falsey values, returns a function that returns truthy - * if both functions return truthy for the given arguments - */ -function and(fn1, fn2) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fn1.apply(null, args) && fn2.apply(null, args); - }; -} -/** - * Given two functions that return truthy or falsey values, returns a function that returns truthy - * if at least one of the functions returns truthy for the given arguments - */ -function or(fn1, fn2) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fn1.apply(null, args) || fn2.apply(null, args); - }; -} -/** - * Check if all the elements of an array match a predicate function - * - * @param fn1 a predicate function `fn1` - * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array - */ -var all = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); }; }; -// tslint:disable-next-line:variable-name -var any = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); }; }; -/** Given a class, returns a Predicate function that returns true if the object is of that class */ -var is = function (ctor) { return function (obj) { - return (obj != null && obj.constructor === ctor) || obj instanceof ctor; -}; }; -/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */ -var eq = function (value) { return function (other) { return value === other; }; }; -/** Given a value, returns a function which returns the value */ -var val = function (v) { return function () { return v; }; }; -function invoke(fnName, args) { - return function (obj) { return obj[fnName].apply(obj, args); }; -} -/** - * Sorta like Pattern Matching (a functional programming conditional construct) - * - * See http://c2.com/cgi/wiki?PatternMatching - * - * This is a conditional construct which allows a series of predicates and output functions - * to be checked and then applied. Each predicate receives the input. If the predicate - * returns truthy, then its matching output function (mapping function) is provided with - * the input and, then the result is returned. - * - * Each combination (2-tuple) of predicate + output function should be placed in an array - * of size 2: [ predicate, mapFn ] - * - * These 2-tuples should be put in an outer array. - * - * @example - * ``` - * - * // Here's a 2-tuple where the first element is the isString predicate - * // and the second element is a function that returns a description of the input - * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ]; - * - * // Second tuple: predicate "isNumber", mapfn returns a description - * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ]; - * - * let third = [ (input) => input === null, (input) => `Oh, null...` ]; - * - * let fourth = [ (input) => input === undefined, (input) => `notdefined` ]; - * - * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]); - * - * console.log(descriptionOf(undefined)); // 'notdefined' - * console.log(descriptionOf(55)); // '(55) That's a number!' - * console.log(descriptionOf("foo")); // 'Here's your string foo' - * ``` - * - * @param struct A 2D array. Each element of the array should be an array, a 2-tuple, - * with a Predicate and a mapping/output function - * @returns {function(any): *} - */ -function pattern(struct) { - return function (x) { - for (var i = 0; i < struct.length; i++) { - if (struct[i][0](x)) - return struct[i][1](x); - } - }; -} -//# sourceMappingURL=hof.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/index.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "_extend": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._extend), -/* harmony export */ "_inArray": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._inArray), -/* harmony export */ "_pushTo": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._pushTo), -/* harmony export */ "_removeFrom": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._removeFrom), -/* harmony export */ "allTrueR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.allTrueR), -/* harmony export */ "ancestors": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.ancestors), -/* harmony export */ "anyTrueR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.anyTrueR), -/* harmony export */ "applyPairs": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.applyPairs), -/* harmony export */ "arrayTuples": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples), -/* harmony export */ "assertFn": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.assertFn), -/* harmony export */ "assertMap": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.assertMap), -/* harmony export */ "assertPredicate": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.assertPredicate), -/* harmony export */ "copy": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.copy), -/* harmony export */ "createProxyFunctions": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions), -/* harmony export */ "defaults": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.defaults), -/* harmony export */ "deregAll": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.deregAll), -/* harmony export */ "equals": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.equals), -/* harmony export */ "extend": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.extend), -/* harmony export */ "filter": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.filter), -/* harmony export */ "find": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.find), -/* harmony export */ "flatten": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.flatten), -/* harmony export */ "flattenR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.flattenR), -/* harmony export */ "forEach": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.forEach), -/* harmony export */ "fromJson": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.fromJson), -/* harmony export */ "identity": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.identity), -/* harmony export */ "inArray": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.inArray), -/* harmony export */ "inherit": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.inherit), -/* harmony export */ "map": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.map), -/* harmony export */ "mapObj": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.mapObj), -/* harmony export */ "mergeR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.mergeR), -/* harmony export */ "noop": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.noop), -/* harmony export */ "omit": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.omit), -/* harmony export */ "pairs": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pairs), -/* harmony export */ "pick": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pick), -/* harmony export */ "pluck": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pluck), -/* harmony export */ "pushR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pushR), -/* harmony export */ "pushTo": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pushTo), -/* harmony export */ "removeFrom": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.removeFrom), -/* harmony export */ "root": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.root), -/* harmony export */ "silenceUncaughtInPromise": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.silenceUncaughtInPromise), -/* harmony export */ "silentRejection": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.silentRejection), -/* harmony export */ "tail": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.tail), -/* harmony export */ "toJson": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.toJson), -/* harmony export */ "uniqR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.uniqR), -/* harmony export */ "unnest": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.unnest), -/* harmony export */ "unnestR": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.unnestR), -/* harmony export */ "values": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.values), -/* harmony export */ "makeStub": () => (/* reexport safe */ _coreservices__WEBPACK_IMPORTED_MODULE_1__.makeStub), -/* harmony export */ "services": () => (/* reexport safe */ _coreservices__WEBPACK_IMPORTED_MODULE_1__.services), -/* harmony export */ "Glob": () => (/* reexport safe */ _glob__WEBPACK_IMPORTED_MODULE_2__.Glob), -/* harmony export */ "all": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.all), -/* harmony export */ "and": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.and), -/* harmony export */ "any": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.any), -/* harmony export */ "compose": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.compose), -/* harmony export */ "curry": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.curry), -/* harmony export */ "eq": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.eq), -/* harmony export */ "invoke": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.invoke), -/* harmony export */ "is": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.is), -/* harmony export */ "not": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.not), -/* harmony export */ "or": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.or), -/* harmony export */ "parse": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.parse), -/* harmony export */ "pattern": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.pattern), -/* harmony export */ "pipe": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.pipe), -/* harmony export */ "prop": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.prop), -/* harmony export */ "propEq": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.propEq), -/* harmony export */ "val": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.val), -/* harmony export */ "isArray": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isArray), -/* harmony export */ "isDate": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isDate), -/* harmony export */ "isDefined": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isDefined), -/* harmony export */ "isFunction": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction), -/* harmony export */ "isInjectable": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isInjectable), -/* harmony export */ "isNull": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isNull), -/* harmony export */ "isNullOrUndefined": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isNullOrUndefined), -/* harmony export */ "isNumber": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isNumber), -/* harmony export */ "isObject": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isObject), -/* harmony export */ "isPromise": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isPromise), -/* harmony export */ "isRegExp": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isRegExp), -/* harmony export */ "isString": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isString), -/* harmony export */ "isUndefined": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isUndefined), -/* harmony export */ "Queue": () => (/* reexport safe */ _queue__WEBPACK_IMPORTED_MODULE_5__.Queue), -/* harmony export */ "beforeAfterSubstr": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.beforeAfterSubstr), -/* harmony export */ "fnToString": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.fnToString), -/* harmony export */ "functionToString": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.functionToString), -/* harmony export */ "hostRegex": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.hostRegex), -/* harmony export */ "joinNeighborsR": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.joinNeighborsR), -/* harmony export */ "kebobString": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.kebobString), -/* harmony export */ "maxLength": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.maxLength), -/* harmony export */ "padString": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.padString), -/* harmony export */ "splitEqual": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitEqual), -/* harmony export */ "splitHash": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitHash), -/* harmony export */ "splitOnDelim": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitOnDelim), -/* harmony export */ "splitQuery": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitQuery), -/* harmony export */ "stringify": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.stringify), -/* harmony export */ "stripLastPathElement": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.stripLastPathElement), -/* harmony export */ "trimHashVal": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.trimHashVal), -/* harmony export */ "Category": () => (/* reexport safe */ _trace__WEBPACK_IMPORTED_MODULE_7__.Category), -/* harmony export */ "Trace": () => (/* reexport safe */ _trace__WEBPACK_IMPORTED_MODULE_7__.Trace), -/* harmony export */ "trace": () => (/* reexport safe */ _trace__WEBPACK_IMPORTED_MODULE_7__.trace) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _glob__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glob */ "./node_modules/@uirouter/core/lib-esm/common/glob.js"); -/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _queue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./queue */ "./node_modules/@uirouter/core/lib-esm/common/queue.js"); -/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _trace__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); - - - - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/predicates.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/predicates.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "isUndefined": () => (/* binding */ isUndefined), -/* harmony export */ "isDefined": () => (/* binding */ isDefined), -/* harmony export */ "isNull": () => (/* binding */ isNull), -/* harmony export */ "isNullOrUndefined": () => (/* binding */ isNullOrUndefined), -/* harmony export */ "isFunction": () => (/* binding */ isFunction), -/* harmony export */ "isNumber": () => (/* binding */ isNumber), -/* harmony export */ "isString": () => (/* binding */ isString), -/* harmony export */ "isObject": () => (/* binding */ isObject), -/* harmony export */ "isArray": () => (/* binding */ isArray), -/* harmony export */ "isDate": () => (/* binding */ isDate), -/* harmony export */ "isRegExp": () => (/* binding */ isRegExp), -/* harmony export */ "isInjectable": () => (/* binding */ isInjectable), -/* harmony export */ "isPromise": () => (/* binding */ isPromise) -/* harmony export */ }); -/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/** - * Predicates - * - * These predicates return true/false based on the input. - * Although these functions are exported, they are subject to change without notice. - * - * @packageDocumentation - */ - -var toStr = Object.prototype.toString; -var tis = function (t) { return function (x) { return typeof x === t; }; }; -var isUndefined = tis('undefined'); -var isDefined = (0,_hof__WEBPACK_IMPORTED_MODULE_0__.not)(isUndefined); -var isNull = function (o) { return o === null; }; -var isNullOrUndefined = (0,_hof__WEBPACK_IMPORTED_MODULE_0__.or)(isNull, isUndefined); -var isFunction = tis('function'); -var isNumber = tis('number'); -var isString = tis('string'); -var isObject = function (x) { return x !== null && typeof x === 'object'; }; -var isArray = Array.isArray; -var isDate = (function (x) { return toStr.call(x) === '[object Date]'; }); -var isRegExp = (function (x) { return toStr.call(x) === '[object RegExp]'; }); -/** - * Predicate which checks if a value is injectable - * - * A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array - * where all the elements in the array are Strings, except the last one, which is a Function - */ -function isInjectable(val) { - if (isArray(val) && val.length) { - var head = val.slice(0, -1), tail = val.slice(-1); - return !(head.filter((0,_hof__WEBPACK_IMPORTED_MODULE_0__.not)(isString)).length || tail.filter((0,_hof__WEBPACK_IMPORTED_MODULE_0__.not)(isFunction)).length); - } - return isFunction(val); -} -/** - * Predicate which checks if a value looks like a Promise - * - * It is probably a Promise if it's an object, and it has a `then` property which is a Function - */ -var isPromise = (0,_hof__WEBPACK_IMPORTED_MODULE_0__.and)(isObject, (0,_hof__WEBPACK_IMPORTED_MODULE_0__.pipe)((0,_hof__WEBPACK_IMPORTED_MODULE_0__.prop)('then'), isFunction)); -//# sourceMappingURL=predicates.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/queue.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/queue.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Queue": () => (/* binding */ Queue) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); - -var Queue = /** @class */ (function () { - function Queue(_items, _limit) { - if (_items === void 0) { _items = []; } - if (_limit === void 0) { _limit = null; } - this._items = _items; - this._limit = _limit; - this._evictListeners = []; - this.onEvict = (0,_common__WEBPACK_IMPORTED_MODULE_0__.pushTo)(this._evictListeners); - } - Queue.prototype.enqueue = function (item) { - var items = this._items; - items.push(item); - if (this._limit && items.length > this._limit) - this.evict(); - return item; - }; - Queue.prototype.evict = function () { - var item = this._items.shift(); - this._evictListeners.forEach(function (fn) { return fn(item); }); - return item; - }; - Queue.prototype.dequeue = function () { - if (this.size()) - return this._items.splice(0, 1)[0]; - }; - Queue.prototype.clear = function () { - var current = this._items; - this._items = []; - return current; - }; - Queue.prototype.size = function () { - return this._items.length; - }; - Queue.prototype.remove = function (item) { - var idx = this._items.indexOf(item); - return idx > -1 && this._items.splice(idx, 1)[0]; - }; - Queue.prototype.peekTail = function () { - return this._items[this._items.length - 1]; - }; - Queue.prototype.peekHead = function () { - if (this.size()) - return this._items[0]; - }; - return Queue; -}()); - -//# sourceMappingURL=queue.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/safeConsole.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/safeConsole.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "safeConsole": () => (/* binding */ safeConsole) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/** - * workaround for missing console object in IE9 when dev tools haven't been opened o_O - * @packageDocumentation - */ -/* tslint:disable:no-console */ - -var noopConsoleStub = { log: _common__WEBPACK_IMPORTED_MODULE_0__.noop, error: _common__WEBPACK_IMPORTED_MODULE_0__.noop, table: _common__WEBPACK_IMPORTED_MODULE_0__.noop }; -function ie9Console(console) { - var bound = function (fn) { return Function.prototype.bind.call(fn, console); }; - return { - log: bound(console.log), - error: bound(console.log), - table: bound(console.log), - }; -} -function fallbackConsole(console) { - var log = console.log.bind(console); - var error = console.error ? console.error.bind(console) : log; - var table = console.table ? console.table.bind(console) : log; - return { log: log, error: error, table: table }; -} -function getSafeConsole() { - // @ts-ignore - var isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9; - if (isIE9) { - return window && window.console ? ie9Console(window.console) : noopConsoleStub; - } - else if (!console.table || !console.error) { - return fallbackConsole(console); - } - else { - return console; - } -} -var safeConsole = getSafeConsole(); -//# sourceMappingURL=safeConsole.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/strings.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/strings.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "maxLength": () => (/* binding */ maxLength), -/* harmony export */ "padString": () => (/* binding */ padString), -/* harmony export */ "kebobString": () => (/* binding */ kebobString), -/* harmony export */ "functionToString": () => (/* binding */ functionToString), -/* harmony export */ "fnToString": () => (/* binding */ fnToString), -/* harmony export */ "stringify": () => (/* binding */ stringify), -/* harmony export */ "beforeAfterSubstr": () => (/* binding */ beforeAfterSubstr), -/* harmony export */ "hostRegex": () => (/* binding */ hostRegex), -/* harmony export */ "stripLastPathElement": () => (/* binding */ stripLastPathElement), -/* harmony export */ "splitHash": () => (/* binding */ splitHash), -/* harmony export */ "splitQuery": () => (/* binding */ splitQuery), -/* harmony export */ "splitEqual": () => (/* binding */ splitEqual), -/* harmony export */ "trimHashVal": () => (/* binding */ trimHashVal), -/* harmony export */ "splitOnDelim": () => (/* binding */ splitOnDelim), -/* harmony export */ "joinNeighborsR": () => (/* binding */ joinNeighborsR) -/* harmony export */ }); -/* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transition/rejectFactory */ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/** - * Functions that manipulate strings - * - * Although these functions are exported, they are subject to change without notice. - * - * @packageDocumentation - */ - - - - -/** - * Returns a string shortened to a maximum length - * - * If the string is already less than the `max` length, return the string. - * Else return the string, shortened to `max - 3` and append three dots ("..."). - * - * @param max the maximum length of the string to return - * @param str the input string - */ -function maxLength(max, str) { - if (str.length <= max) - return str; - return str.substr(0, max - 3) + '...'; -} -/** - * Returns a string, with spaces added to the end, up to a desired str length - * - * If the string is already longer than the desired length, return the string. - * Else returns the string, with extra spaces on the end, such that it reaches `length` characters. - * - * @param length the desired length of the string to return - * @param str the input string - */ -function padString(length, str) { - while (str.length < length) - str += ' '; - return str; -} -function kebobString(camelCase) { - return camelCase - .replace(/^([A-Z])/, function ($1) { return $1.toLowerCase(); }) // replace first char - .replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); }); // replace rest -} -function functionToString(fn) { - var fnStr = fnToString(fn); - var namedFunctionMatch = fnStr.match(/^(function [^ ]+\([^)]*\))/); - var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr; - var fnName = fn['name'] || ''; - if (fnName && toStr.match(/function \(/)) { - return 'function ' + fnName + toStr.substr(9); - } - return toStr; -} -function fnToString(fn) { - var _fn = (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(fn) ? fn.slice(-1)[0] : fn; - return (_fn && _fn.toString()) || 'undefined'; -} -var isRejection = _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__.Rejection.isRejectionPromise; -var hasToString = function (obj) { - return (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isObject)(obj) && !(0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(obj) && obj.constructor !== Object && (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(obj.toString); -}; -var stringifyPattern = (0,_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([ - [_predicates__WEBPACK_IMPORTED_MODULE_0__.isUndefined, (0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)('undefined')], - [_predicates__WEBPACK_IMPORTED_MODULE_0__.isNull, (0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)('null')], - [_predicates__WEBPACK_IMPORTED_MODULE_0__.isPromise, (0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)('[Promise]')], - [isRejection, function (x) { return x._transitionRejection.toString(); }], - [hasToString, function (x) { return x.toString(); }], - [_predicates__WEBPACK_IMPORTED_MODULE_0__.isInjectable, functionToString], - [(0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)(true), _common__WEBPACK_IMPORTED_MODULE_2__.identity], -]); -function stringify(o) { - var seen = []; - function format(value) { - if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isObject)(value)) { - if (seen.indexOf(value) !== -1) - return '[circular ref]'; - seen.push(value); - } - return stringifyPattern(value); - } - if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(o)) { - // Workaround for IE & Edge Spec incompatibility where replacer function would not be called when JSON.stringify - // is given `undefined` as value. To work around that, we simply detect `undefined` and bail out early by - // manually stringifying it. - return format(o); - } - return JSON.stringify(o, function (key, value) { return format(value); }).replace(/\\"/g, '"'); -} -/** Returns a function that splits a string on a character or substring */ -var beforeAfterSubstr = function (char) { return function (str) { - if (!str) - return ['', '']; - var idx = str.indexOf(char); - if (idx === -1) - return [str, '']; - return [str.substr(0, idx), str.substr(idx + 1)]; -}; }; -var hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/'); -var stripLastPathElement = function (str) { return str.replace(/\/[^/]*$/, ''); }; -var splitHash = beforeAfterSubstr('#'); -var splitQuery = beforeAfterSubstr('?'); -var splitEqual = beforeAfterSubstr('='); -var trimHashVal = function (str) { return (str ? str.replace(/^#/, '') : ''); }; -/** - * Splits on a delimiter, but returns the delimiters in the array - * - * #### Example: - * ```js - * var splitOnSlashes = splitOnDelim('/'); - * splitOnSlashes("/foo"); // ["/", "foo"] - * splitOnSlashes("/foo/"); // ["/", "foo", "/"] - * ``` - */ -function splitOnDelim(delim) { - var re = new RegExp('(' + delim + ')', 'g'); - return function (str) { return str.split(re).filter(_common__WEBPACK_IMPORTED_MODULE_2__.identity); }; -} -/** - * Reduce fn that joins neighboring strings - * - * Given an array of strings, returns a new array - * where all neighboring strings have been joined. - * - * #### Example: - * ```js - * let arr = ["foo", "bar", 1, "baz", "", "qux" ]; - * arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ] - * ``` - */ -function joinNeighborsR(acc, x) { - if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)((0,_common__WEBPACK_IMPORTED_MODULE_2__.tail)(acc)) && (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(x)) - return acc.slice(0, -1).concat((0,_common__WEBPACK_IMPORTED_MODULE_2__.tail)(acc) + x); - return (0,_common__WEBPACK_IMPORTED_MODULE_2__.pushR)(acc, x); -} -//# sourceMappingURL=strings.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/common/trace.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/common/trace.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Category": () => (/* binding */ Category), -/* harmony export */ "Trace": () => (/* binding */ Trace), -/* harmony export */ "trace": () => (/* binding */ trace) -/* harmony export */ }); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _safeConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./safeConsole */ "./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"); -/** - * # Transition tracing (debug) - * - * Enable transition tracing to print transition information to the console, - * in order to help debug your application. - * Tracing logs detailed information about each Transition to your console. - * - * To enable tracing, import the [[Trace]] singleton and enable one or more categories. - * - * ### ES6 - * ```js - * import {trace} from "@uirouter/core"; - * trace.enable(1, 5); // TRANSITION and VIEWCONFIG - * ``` - * - * ### CJS - * ```js - * let trace = require("@uirouter/core").trace; - * trace.enable("TRANSITION", "VIEWCONFIG"); - * ``` - * - * ### Globals - * ```js - * let trace = window["@uirouter/core"].trace; - * trace.enable(); // Trace everything (very verbose) - * ``` - * - * ### Angular 1: - * ```js - * app.run($trace => $trace.enable()); - * ``` - * - * @packageDocumentation - */ - - - - -function uiViewString(uiview) { - if (!uiview) - return 'ui-view (defunct)'; - var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)'; - return "[ui-view#" + uiview.id + " " + uiview.$type + ":" + uiview.fqn + " (" + uiview.name + "@" + state + ")]"; -} -var viewConfigString = function (viewConfig) { - var view = viewConfig.viewDecl; - var state = view.$context.name || '(root)'; - return "[View#" + viewConfig.$id + " from '" + state + "' state]: target ui-view: '" + view.$uiViewName + "@" + view.$uiViewContextAnchor + "'"; -}; -function normalizedCat(input) { - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isNumber)(input) ? Category[input] : Category[Category[input]]; -} -/** - * Trace categories Enum - * - * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]] - * - * `trace.enable(Category.TRANSITION)` - * - * These can also be provided using a matching string, or position ordinal - * - * `trace.enable("TRANSITION")` - * - * `trace.enable(1)` - */ -var Category; -(function (Category) { - Category[Category["RESOLVE"] = 0] = "RESOLVE"; - Category[Category["TRANSITION"] = 1] = "TRANSITION"; - Category[Category["HOOK"] = 2] = "HOOK"; - Category[Category["UIVIEW"] = 3] = "UIVIEW"; - Category[Category["VIEWCONFIG"] = 4] = "VIEWCONFIG"; -})(Category || (Category = {})); - -var _tid = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('$id'); -var _rid = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('router.$id'); -var transLbl = function (trans) { return "Transition #" + _tid(trans) + "-" + _rid(trans); }; -/** - * Prints UI-Router Transition trace information to the console. - */ -var Trace = /** @class */ (function () { - /** @internal */ - function Trace() { - /** @internal */ - this._enabled = {}; - this.approximateDigests = 0; - } - /** @internal */ - Trace.prototype._set = function (enabled, categories) { - var _this = this; - if (!categories.length) { - categories = Object.keys(Category) - .map(function (k) { return parseInt(k, 10); }) - .filter(function (k) { return !isNaN(k); }) - .map(function (key) { return Category[key]; }); - } - categories.map(normalizedCat).forEach(function (category) { return (_this._enabled[category] = enabled); }); - }; - Trace.prototype.enable = function () { - var categories = []; - for (var _i = 0; _i < arguments.length; _i++) { - categories[_i] = arguments[_i]; - } - this._set(true, categories); - }; - Trace.prototype.disable = function () { - var categories = []; - for (var _i = 0; _i < arguments.length; _i++) { - categories[_i] = arguments[_i]; - } - this._set(false, categories); - }; - /** - * Retrieves the enabled stateus of a [[Category]] - * - * ```js - * trace.enabled("VIEWCONFIG"); // true or false - * ``` - * - * @returns boolean true if the category is enabled - */ - Trace.prototype.enabled = function (category) { - return !!this._enabled[normalizedCat(category)]; - }; - /** @internal called by ui-router code */ - Trace.prototype.traceTransitionStart = function (trans) { - if (!this.enabled(Category.TRANSITION)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": Started -> " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans)); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceTransitionIgnored = function (trans) { - if (!this.enabled(Category.TRANSITION)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": Ignored <> " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans)); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceHookInvocation = function (step, trans, options) { - if (!this.enabled(Category.HOOK)) - return; - var event = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('traceData.hookType')(options) || 'internal', context = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('traceData.context.state.name')(options) || (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('traceData.context')(options) || 'unknown', name = (0,_strings__WEBPACK_IMPORTED_MODULE_2__.functionToString)(step.registeredHook.callback); - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": Hook -> " + event + " context: " + context + ", " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, name)); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) { - if (!this.enabled(Category.HOOK)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": <- Hook returned: " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(hookResult))); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceResolvePath = function (path, when, trans) { - if (!this.enabled(Category.RESOLVE)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": Resolving " + path + " (" + when + ")"); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceResolvableResolved = function (resolvable, trans) { - if (!this.enabled(Category.RESOLVE)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": <- Resolved " + resolvable + " to: " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(resolvable.data))); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceError = function (reason, trans) { - if (!this.enabled(Category.TRANSITION)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": <- Rejected " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans) + ", reason: " + reason); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceSuccess = function (finalState, trans) { - if (!this.enabled(Category.TRANSITION)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + ": <- Success " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans) + ", final state: " + finalState.name); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceUIViewEvent = function (event, viewData, extra) { - if (extra === void 0) { extra = ''; } - if (!this.enabled(Category.UIVIEW)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log("ui-view: " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.padString)(30, event) + " " + uiViewString(viewData) + extra); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) { - if (!this.enabled(Category.UIVIEW)) - return; - this.traceUIViewEvent('Updating', viewData, " with ViewConfig from context='" + context + "'"); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceUIViewFill = function (viewData, html) { - if (!this.enabled(Category.UIVIEW)) - return; - this.traceUIViewEvent('Fill', viewData, " with: " + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, html)); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceViewSync = function (pairs) { - if (!this.enabled(Category.VIEWCONFIG)) - return; - var uivheader = 'uiview component fqn'; - var cfgheader = 'view config state (view name)'; - var mapping = pairs - .map(function (_a) { - var _b; - var uiView = _a.uiView, viewConfig = _a.viewConfig; - var uiv = uiView && uiView.fqn; - var cfg = viewConfig && viewConfig.viewDecl.$context.name + ": (" + viewConfig.viewDecl.$name + ")"; - return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b; - }) - .sort(function (a, b) { return (a[uivheader] || '').localeCompare(b[uivheader] || ''); }); - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.table(mapping); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceViewServiceEvent = function (event, viewConfig) { - if (!this.enabled(Category.VIEWCONFIG)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log("VIEWCONFIG: " + event + " " + viewConfigString(viewConfig)); - }; - /** @internal called by ui-router code */ - Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) { - if (!this.enabled(Category.VIEWCONFIG)) - return; - _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log("VIEWCONFIG: " + event + " " + uiViewString(viewData)); - }; - return Trace; -}()); - -/** - * The [[Trace]] singleton - * - * #### Example: - * ```js - * import {trace} from "@uirouter/core"; - * trace.enable(1, 5); - * ``` - */ -var trace = new Trace(); - -//# sourceMappingURL=trace.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/globals.js": -/*!********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/globals.js ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UIRouterGlobals": () => (/* binding */ UIRouterGlobals) -/* harmony export */ }); -/* harmony import */ var _params_stateParams__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./params/stateParams */ "./node_modules/@uirouter/core/lib-esm/params/stateParams.js"); -/* harmony import */ var _common_queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/queue */ "./node_modules/@uirouter/core/lib-esm/common/queue.js"); - - -/** - * Global router state - * - * This is where we hold the global mutable state such as current state, current - * params, current transition, etc. - */ -var UIRouterGlobals = /** @class */ (function () { - function UIRouterGlobals() { - /** - * Current parameter values - * - * The parameter values from the latest successful transition - */ - this.params = new _params_stateParams__WEBPACK_IMPORTED_MODULE_0__.StateParams(); - /** @internal */ - this.lastStartedTransitionId = -1; - /** @internal */ - this.transitionHistory = new _common_queue__WEBPACK_IMPORTED_MODULE_1__.Queue([], 1); - /** @internal */ - this.successfulTransitions = new _common_queue__WEBPACK_IMPORTED_MODULE_1__.Queue([], 1); - } - UIRouterGlobals.prototype.dispose = function () { - this.transitionHistory.clear(); - this.successfulTransitions.clear(); - this.transition = null; - }; - return UIRouterGlobals; -}()); - -//# sourceMappingURL=globals.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerAddCoreResolvables": () => (/* binding */ registerAddCoreResolvables), -/* harmony export */ "treeChangesCleanup": () => (/* binding */ treeChangesCleanup) -/* harmony export */ }); -/* harmony import */ var _transition_transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transition/transition */ "./node_modules/@uirouter/core/lib-esm/transition/transition.js"); -/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../router */ "./node_modules/@uirouter/core/lib-esm/router.js"); -/* harmony import */ var _resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../resolve */ "./node_modules/@uirouter/core/lib-esm/resolve/index.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - - - -function addCoreResolvables(trans) { - trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData(_router__WEBPACK_IMPORTED_MODULE_1__.UIRouter, trans.router), ''); - trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData(_transition_transition__WEBPACK_IMPORTED_MODULE_0__.Transition, trans), ''); - trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData('$transition$', trans), ''); - trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData('$stateParams', trans.params()), ''); - trans.entering().forEach(function (state) { - trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData('$state$', state), state); - }); -} -var registerAddCoreResolvables = function (transitionService) { - return transitionService.onCreate({}, addCoreResolvables); -}; -var TRANSITION_TOKENS = ['$transition$', _transition_transition__WEBPACK_IMPORTED_MODULE_0__.Transition]; -var isTransition = (0,_common__WEBPACK_IMPORTED_MODULE_3__.inArray)(TRANSITION_TOKENS); -// References to Transition in the treeChanges pathnodes makes all -// previous Transitions reachable in memory, causing a memory leak -// This function removes resolves for '$transition$' and `Transition` from the treeChanges. -// Do not use this on current transitions, only on old ones. -var treeChangesCleanup = function (trans) { - var nodes = (0,_common__WEBPACK_IMPORTED_MODULE_3__.values)(trans.treeChanges()).reduce(_common__WEBPACK_IMPORTED_MODULE_3__.unnestR, []).reduce(_common__WEBPACK_IMPORTED_MODULE_3__.uniqR, []); - // If the resolvable is a Transition, return a new resolvable with null data - var replaceTransitionWithNull = function (r) { - return isTransition(r.token) ? _resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData(r.token, null) : r; - }; - nodes.forEach(function (node) { - node.resolvables = node.resolvables.map(replaceTransitionWithNull); - }); -}; -//# sourceMappingURL=coreResolvables.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js": -/*!************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerIgnoredTransitionHook": () => (/* binding */ registerIgnoredTransitionHook) -/* harmony export */ }); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); -/* harmony import */ var _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transition/rejectFactory */ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"); - - -/** - * A [[TransitionHookFn]] that skips a transition if it should be ignored - * - * This hook is invoked at the end of the onBefore phase. - * - * If the transition should be ignored (because no parameter or states changed) - * then the transition is ignored and not processed. - */ -function ignoredHook(trans) { - var ignoredReason = trans._ignoredReason(); - if (!ignoredReason) - return; - _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceTransitionIgnored(trans); - var pending = trans.router.globals.transition; - // The user clicked a link going back to the *current state* ('A') - // However, there is also a pending transition in flight (to 'B') - // Abort the transition to 'B' because the user now wants to be back at 'A'. - if (ignoredReason === 'SameAsCurrent' && pending) { - pending.abort(); - } - return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__.Rejection.ignored().toPromise(); -} -var registerIgnoredTransitionHook = function (transitionService) { - return transitionService.onBefore({}, ignoredHook, { priority: -9999 }); -}; -//# sourceMappingURL=ignoredTransition.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js": -/*!************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerInvalidTransitionHook": () => (/* binding */ registerInvalidTransitionHook) -/* harmony export */ }); -/** - * A [[TransitionHookFn]] that rejects the Transition if it is invalid - * - * This hook is invoked at the end of the onBefore phase. - * If the transition is invalid (for example, param values do not validate) - * then the transition is rejected. - */ -function invalidTransitionHook(trans) { - if (!trans.valid()) { - throw new Error(trans.error().toString()); - } -} -var registerInvalidTransitionHook = function (transitionService) { - return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 }); -}; -//# sourceMappingURL=invalidTransition.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerLazyLoadHook": () => (/* binding */ registerLazyLoadHook), -/* harmony export */ "lazyLoadState": () => (/* binding */ lazyLoadState) -/* harmony export */ }); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); - -/** - * A [[TransitionHookFn]] that performs lazy loading - * - * When entering a state "abc" which has a `lazyLoad` function defined: - * - Invoke the `lazyLoad` function (unless it is already in process) - * - Flag the hook function as "in process" - * - The function should return a promise (that resolves when lazy loading is complete) - * - Wait for the promise to settle - * - If the promise resolves to a [[LazyLoadResult]], then register those states - * - Flag the hook function as "not in process" - * - If the hook was successful - * - Remove the `lazyLoad` function from the state declaration - * - If all the hooks were successful - * - Retry the transition (by returning a TargetState) - * - * ``` - * .state('abc', { - * component: 'fooComponent', - * lazyLoad: () => import('./fooComponent') - * }); - * ``` - * - * See [[StateDeclaration.lazyLoad]] - */ -var lazyLoadHook = function (transition) { - var router = transition.router; - function retryTransition() { - if (transition.originalTransition().options().source !== 'url') { - // The original transition was not triggered via url sync - // The lazy state should be loaded now, so re-try the original transition - var orig = transition.targetState(); - return router.stateService.target(orig.identifier(), orig.params(), orig.options()); - } - // The original transition was triggered via url sync - // Run the URL rules and find the best match - var $url = router.urlService; - var result = $url.match($url.parts()); - var rule = result && result.rule; - // If the best match is a state, redirect the transition (instead - // of calling sync() which supersedes the current transition) - if (rule && rule.type === 'STATE') { - var state = rule.state; - var params = result.match; - return router.stateService.target(state, params, transition.options()); - } - // No matching state found, so let .sync() choose the best non-state match/otherwise - router.urlService.sync(); - } - var promises = transition - .entering() - .filter(function (state) { return !!state.$$state().lazyLoad; }) - .map(function (state) { return lazyLoadState(transition, state); }); - return _common_coreservices__WEBPACK_IMPORTED_MODULE_0__.services.$q.all(promises).then(retryTransition); -}; -var registerLazyLoadHook = function (transitionService) { - return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook); -}; -/** - * Invokes a state's lazy load function - * - * @param transition a Transition context - * @param state the state to lazy load - * @returns A promise for the lazy load result - */ -function lazyLoadState(transition, state) { - var lazyLoadFn = state.$$state().lazyLoad; - // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked - var promise = lazyLoadFn['_promise']; - if (!promise) { - var success = function (result) { - delete state.lazyLoad; - delete state.$$state().lazyLoad; - delete lazyLoadFn['_promise']; - return result; - }; - var error = function (err) { - delete lazyLoadFn['_promise']; - return _common_coreservices__WEBPACK_IMPORTED_MODULE_0__.services.$q.reject(err); - }; - promise = lazyLoadFn['_promise'] = _common_coreservices__WEBPACK_IMPORTED_MODULE_0__.services.$q.when(lazyLoadFn(transition, state)) - .then(updateStateRegistry) - .then(success, error); - } - /** Register any lazy loaded state definitions */ - function updateStateRegistry(result) { - if (result && Array.isArray(result.states)) { - result.states.forEach(function (_state) { return transition.router.stateRegistry.register(_state); }); - } - return result; - } - return promise; -} -//# sourceMappingURL=lazyLoad.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js": -/*!************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerOnExitHook": () => (/* binding */ registerOnExitHook), -/* harmony export */ "registerOnRetainHook": () => (/* binding */ registerOnRetainHook), -/* harmony export */ "registerOnEnterHook": () => (/* binding */ registerOnEnterHook) -/* harmony export */ }); -/** - * A factory which creates an onEnter, onExit or onRetain transition hook function - * - * The returned function invokes the (for instance) state.onEnter hook when the - * state is being entered. - */ -function makeEnterExitRetainHook(hookName) { - return function (transition, state) { - var _state = state.$$state(); - var hookFn = _state[hookName]; - return hookFn(transition, state); - }; -} -/** - * The [[TransitionStateHookFn]] for onExit - * - * When the state is being exited, the state's .onExit function is invoked. - * - * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);` - * - * See: [[IHookRegistry.onExit]] - */ -var onExitHook = makeEnterExitRetainHook('onExit'); -var registerOnExitHook = function (transitionService) { - return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook); -}; -/** - * The [[TransitionStateHookFn]] for onRetain - * - * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked. - * - * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);` - * - * See: [[IHookRegistry.onRetain]] - */ -var onRetainHook = makeEnterExitRetainHook('onRetain'); -var registerOnRetainHook = function (transitionService) { - return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook); -}; -/** - * The [[TransitionStateHookFn]] for onEnter - * - * When the state is being entered, the state's .onEnter function is invoked. - * - * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);` - * - * See: [[IHookRegistry.onEnter]] - */ -var onEnterHook = makeEnterExitRetainHook('onEnter'); -var registerOnEnterHook = function (transitionService) { - return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook); -}; -//# sourceMappingURL=onEnterExitRetain.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerRedirectToHook": () => (/* binding */ registerRedirectToHook) -/* harmony export */ }); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _state_targetState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../state/targetState */ "./node_modules/@uirouter/core/lib-esm/state/targetState.js"); - - - -/** - * A [[TransitionHookFn]] that redirects to a different state or params - * - * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);` - * - * See [[StateDeclaration.redirectTo]] - */ -var redirectToHook = function (trans) { - var redirect = trans.to().redirectTo; - if (!redirect) - return; - var $state = trans.router.stateService; - function handleResult(result) { - if (!result) - return; - if (result instanceof _state_targetState__WEBPACK_IMPORTED_MODULE_2__.TargetState) - return result; - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(result)) - return $state.target(result, trans.params(), trans.options()); - if (result['state'] || result['params']) - return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options()); - } - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(redirect)) { - return _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(redirect(trans)).then(handleResult); - } - return handleResult(redirect); -}; -var registerRedirectToHook = function (transitionService) { - return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook); -}; -//# sourceMappingURL=redirectTo.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/resolve.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/resolve.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "RESOLVE_HOOK_PRIORITY": () => (/* binding */ RESOLVE_HOOK_PRIORITY), -/* harmony export */ "registerEagerResolvePath": () => (/* binding */ registerEagerResolvePath), -/* harmony export */ "registerLazyResolveState": () => (/* binding */ registerLazyResolveState), -/* harmony export */ "registerResolveRemaining": () => (/* binding */ registerResolveRemaining) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../resolve/resolveContext */ "./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); - - - -var RESOLVE_HOOK_PRIORITY = 1000; -/** - * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path - * - * Registered using `transitionService.onStart({}, eagerResolvePath, { priority: 1000 });` - * - * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for. - * - * See [[StateDeclaration.resolve]] - */ -var eagerResolvePath = function (trans) { - return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__.ResolveContext(trans.treeChanges().to).resolvePath('EAGER', trans).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop); -}; -var registerEagerResolvePath = function (transitionService) { - return transitionService.onStart({}, eagerResolvePath, { priority: RESOLVE_HOOK_PRIORITY }); -}; -/** - * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path - * - * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState, { priority: 1000 });` - * - * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for. - * - * See [[StateDeclaration.resolve]] - */ -var lazyResolveState = function (trans, state) { - return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__.ResolveContext(trans.treeChanges().to).subContext(state.$$state()).resolvePath('LAZY', trans).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop); -}; -var registerLazyResolveState = function (transitionService) { - return transitionService.onEnter({ entering: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.val)(true) }, lazyResolveState, { priority: RESOLVE_HOOK_PRIORITY }); -}; -/** - * A [[TransitionHookFn]] which resolves any dynamically added (LAZY or EAGER) Resolvables. - * - * Registered using `transitionService.onFinish({}, eagerResolvePath, { priority: 1000 });` - * - * After all entering states have been entered, this hook resolves any remaining Resolvables. - * These are typically dynamic resolves which were added by some Transition Hook using [[Transition.addResolvable]]. - * - * See [[StateDeclaration.resolve]] - */ -var resolveRemaining = function (trans) { - return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__.ResolveContext(trans.treeChanges().to).resolvePath('LAZY', trans).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop); -}; -var registerResolveRemaining = function (transitionService) { - return transitionService.onFinish({}, resolveRemaining, { priority: RESOLVE_HOOK_PRIORITY }); -}; -//# sourceMappingURL=resolve.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js": -/*!********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerUpdateGlobalState": () => (/* binding */ registerUpdateGlobalState) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); - -/** - * A [[TransitionHookFn]] which updates global UI-Router state - * - * Registered using `transitionService.onBefore({}, updateGlobalState);` - * - * Before a [[Transition]] starts, updates the global value of "the current transition" ([[Globals.transition]]). - * After a successful [[Transition]], updates the global values of "the current state" - * ([[Globals.current]] and [[Globals.$current]]) and "the current param values" ([[Globals.params]]). - * - * See also the deprecated properties: - * [[StateService.transition]], [[StateService.current]], [[StateService.params]] - */ -var updateGlobalState = function (trans) { - var globals = trans.router.globals; - var transitionSuccessful = function () { - globals.successfulTransitions.enqueue(trans); - globals.$current = trans.$to(); - globals.current = globals.$current.self; - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.copy)(trans.params(), globals.params); - }; - var clearCurrentTransition = function () { - // Do not clear globals.transition if a different transition has started in the meantime - if (globals.transition === trans) - globals.transition = null; - }; - trans.onSuccess({}, transitionSuccessful, { priority: 10000 }); - trans.promise.then(clearCurrentTransition, clearCurrentTransition); -}; -var registerUpdateGlobalState = function (transitionService) { - return transitionService.onCreate({}, updateGlobalState); -}; -//# sourceMappingURL=updateGlobals.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/url.js": -/*!**********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/url.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerUpdateUrl": () => (/* binding */ registerUpdateUrl) -/* harmony export */ }); -/** - * A [[TransitionHookFn]] which updates the URL after a successful transition - * - * Registered using `transitionService.onSuccess({}, updateUrl);` - */ -var updateUrl = function (transition) { - var options = transition.options(); - var $state = transition.router.stateService; - var $urlRouter = transition.router.urlRouter; - // Dont update the url in these situations: - // The transition was triggered by a URL sync (options.source === 'url') - // The user doesn't want the url to update (options.location === false) - // The destination state, and all parents have no navigable url - if (options.source !== 'url' && options.location && $state.$current.navigable) { - var urlOptions = { replace: options.location === 'replace' }; - $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions); - } - $urlRouter.update(true); -}; -var registerUpdateUrl = function (transitionService) { - return transitionService.onSuccess({}, updateUrl, { priority: 9999 }); -}; -//# sourceMappingURL=url.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/hooks/views.js": -/*!************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/hooks/views.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "registerLoadEnteringViews": () => (/* binding */ registerLoadEnteringViews), -/* harmony export */ "registerActivateViews": () => (/* binding */ registerActivateViews) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); - - -/** - * A [[TransitionHookFn]] which waits for the views to load - * - * Registered using `transitionService.onStart({}, loadEnteringViews);` - * - * Allows the views to do async work in [[ViewConfig.load]] before the transition continues. - * In angular 1, this includes loading the templates. - */ -var loadEnteringViews = function (transition) { - var $q = _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q; - var enteringViews = transition.views('entering'); - if (!enteringViews.length) - return; - return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop); -}; -var registerLoadEnteringViews = function (transitionService) { - return transitionService.onFinish({}, loadEnteringViews); -}; -/** - * A [[TransitionHookFn]] which activates the new views when a transition is successful. - * - * Registered using `transitionService.onSuccess({}, activateViews);` - * - * After a transition is complete, this hook deactivates the old views from the previous state, - * and activates the new views from the destination state. - * - * See [[ViewService]] - */ -var activateViews = function (transition) { - var enteringViews = transition.views('entering'); - var exitingViews = transition.views('exiting'); - if (!enteringViews.length && !exitingViews.length) - return; - var $view = transition.router.viewService; - exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); }); - enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); }); - $view.sync(); -}; -var registerActivateViews = function (transitionService) { - return transitionService.onSuccess({}, activateViews); -}; -//# sourceMappingURL=views.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/index.js": -/*!******************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/index.js ***! - \******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Category": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Category), -/* harmony export */ "Glob": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Glob), -/* harmony export */ "Queue": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Queue), -/* harmony export */ "Trace": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Trace), -/* harmony export */ "_extend": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._extend), -/* harmony export */ "_inArray": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._inArray), -/* harmony export */ "_pushTo": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._pushTo), -/* harmony export */ "_removeFrom": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._removeFrom), -/* harmony export */ "all": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.all), -/* harmony export */ "allTrueR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.allTrueR), -/* harmony export */ "ancestors": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.ancestors), -/* harmony export */ "and": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.and), -/* harmony export */ "any": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.any), -/* harmony export */ "anyTrueR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.anyTrueR), -/* harmony export */ "applyPairs": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.applyPairs), -/* harmony export */ "arrayTuples": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.arrayTuples), -/* harmony export */ "assertFn": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.assertFn), -/* harmony export */ "assertMap": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.assertMap), -/* harmony export */ "assertPredicate": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.assertPredicate), -/* harmony export */ "beforeAfterSubstr": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.beforeAfterSubstr), -/* harmony export */ "compose": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.compose), -/* harmony export */ "copy": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.copy), -/* harmony export */ "createProxyFunctions": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions), -/* harmony export */ "curry": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.curry), -/* harmony export */ "defaults": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.defaults), -/* harmony export */ "deregAll": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.deregAll), -/* harmony export */ "eq": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.eq), -/* harmony export */ "equals": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.equals), -/* harmony export */ "extend": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.extend), -/* harmony export */ "filter": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.filter), -/* harmony export */ "find": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.find), -/* harmony export */ "flatten": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.flatten), -/* harmony export */ "flattenR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.flattenR), -/* harmony export */ "fnToString": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.fnToString), -/* harmony export */ "forEach": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.forEach), -/* harmony export */ "fromJson": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.fromJson), -/* harmony export */ "functionToString": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.functionToString), -/* harmony export */ "hostRegex": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.hostRegex), -/* harmony export */ "identity": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.identity), -/* harmony export */ "inArray": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.inArray), -/* harmony export */ "inherit": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.inherit), -/* harmony export */ "invoke": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.invoke), -/* harmony export */ "is": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.is), -/* harmony export */ "isArray": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isArray), -/* harmony export */ "isDate": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isDate), -/* harmony export */ "isDefined": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isDefined), -/* harmony export */ "isFunction": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isFunction), -/* harmony export */ "isInjectable": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isInjectable), -/* harmony export */ "isNull": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isNull), -/* harmony export */ "isNullOrUndefined": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isNullOrUndefined), -/* harmony export */ "isNumber": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isNumber), -/* harmony export */ "isObject": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isObject), -/* harmony export */ "isPromise": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isPromise), -/* harmony export */ "isRegExp": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isRegExp), -/* harmony export */ "isString": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isString), -/* harmony export */ "isUndefined": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isUndefined), -/* harmony export */ "joinNeighborsR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.joinNeighborsR), -/* harmony export */ "kebobString": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.kebobString), -/* harmony export */ "makeStub": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.makeStub), -/* harmony export */ "map": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.map), -/* harmony export */ "mapObj": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.mapObj), -/* harmony export */ "maxLength": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.maxLength), -/* harmony export */ "mergeR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.mergeR), -/* harmony export */ "noop": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.noop), -/* harmony export */ "not": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.not), -/* harmony export */ "omit": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.omit), -/* harmony export */ "or": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.or), -/* harmony export */ "padString": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.padString), -/* harmony export */ "pairs": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pairs), -/* harmony export */ "parse": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.parse), -/* harmony export */ "pattern": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pattern), -/* harmony export */ "pick": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pick), -/* harmony export */ "pipe": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pipe), -/* harmony export */ "pluck": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pluck), -/* harmony export */ "prop": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.prop), -/* harmony export */ "propEq": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.propEq), -/* harmony export */ "pushR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pushR), -/* harmony export */ "pushTo": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pushTo), -/* harmony export */ "removeFrom": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.removeFrom), -/* harmony export */ "root": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.root), -/* harmony export */ "services": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.services), -/* harmony export */ "silenceUncaughtInPromise": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.silenceUncaughtInPromise), -/* harmony export */ "silentRejection": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.silentRejection), -/* harmony export */ "splitEqual": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitEqual), -/* harmony export */ "splitHash": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitHash), -/* harmony export */ "splitOnDelim": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitOnDelim), -/* harmony export */ "splitQuery": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitQuery), -/* harmony export */ "stringify": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.stringify), -/* harmony export */ "stripLastPathElement": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.stripLastPathElement), -/* harmony export */ "tail": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.tail), -/* harmony export */ "toJson": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.toJson), -/* harmony export */ "trace": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.trace), -/* harmony export */ "trimHashVal": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.trimHashVal), -/* harmony export */ "uniqR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.uniqR), -/* harmony export */ "unnest": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.unnest), -/* harmony export */ "unnestR": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.unnestR), -/* harmony export */ "val": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.val), -/* harmony export */ "values": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.values), -/* harmony export */ "PathNode": () => (/* reexport safe */ _path_index__WEBPACK_IMPORTED_MODULE_2__.PathNode), -/* harmony export */ "PathUtils": () => (/* reexport safe */ _path_index__WEBPACK_IMPORTED_MODULE_2__.PathUtils), -/* harmony export */ "NATIVE_INJECTOR_TOKEN": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.NATIVE_INJECTOR_TOKEN), -/* harmony export */ "Resolvable": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.Resolvable), -/* harmony export */ "ResolveContext": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.ResolveContext), -/* harmony export */ "defaultResolvePolicy": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.defaultResolvePolicy), -/* harmony export */ "resolvePolicies": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.resolvePolicies), -/* harmony export */ "HookBuilder": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.HookBuilder), -/* harmony export */ "RegisteredHook": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.RegisteredHook), -/* harmony export */ "RejectType": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.RejectType), -/* harmony export */ "Rejection": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.Rejection), -/* harmony export */ "Transition": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.Transition), -/* harmony export */ "TransitionEventType": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionEventType), -/* harmony export */ "TransitionHook": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionHook), -/* harmony export */ "TransitionHookPhase": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionHookPhase), -/* harmony export */ "TransitionHookScope": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionHookScope), -/* harmony export */ "TransitionService": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionService), -/* harmony export */ "defaultTransOpts": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.defaultTransOpts), -/* harmony export */ "makeEvent": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.makeEvent), -/* harmony export */ "matchState": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.matchState), -/* harmony export */ "UIRouterGlobals": () => (/* reexport safe */ _globals__WEBPACK_IMPORTED_MODULE_8__.UIRouterGlobals), -/* harmony export */ "UIRouter": () => (/* reexport safe */ _router__WEBPACK_IMPORTED_MODULE_9__.UIRouter), -/* harmony export */ "UIRouterPluginBase": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_11__.UIRouterPluginBase) -/* harmony export */ }); -/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/index */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _params_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./params/index */ "./node_modules/@uirouter/core/lib-esm/params/index.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _params_index__WEBPACK_IMPORTED_MODULE_1__) if(["default","Category","Glob","Queue","Trace","_extend","_inArray","_pushTo","_removeFrom","all","allTrueR","ancestors","and","any","anyTrueR","applyPairs","arrayTuples","assertFn","assertMap","assertPredicate","beforeAfterSubstr","compose","copy","createProxyFunctions","curry","defaults","deregAll","eq","equals","extend","filter","find","flatten","flattenR","fnToString","forEach","fromJson","functionToString","hostRegex","identity","inArray","inherit","invoke","is","isArray","isDate","isDefined","isFunction","isInjectable","isNull","isNullOrUndefined","isNumber","isObject","isPromise","isRegExp","isString","isUndefined","joinNeighborsR","kebobString","makeStub","map","mapObj","maxLength","mergeR","noop","not","omit","or","padString","pairs","parse","pattern","pick","pipe","pluck","prop","propEq","pushR","pushTo","removeFrom","root","services","silenceUncaughtInPromise","silentRejection","splitEqual","splitHash","splitOnDelim","splitQuery","stringify","stripLastPathElement","tail","toJson","trace","trimHashVal","uniqR","unnest","unnestR","val","values"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _params_index__WEBPACK_IMPORTED_MODULE_1__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _path_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path/index */ "./node_modules/@uirouter/core/lib-esm/path/index.js"); -/* harmony import */ var _resolve_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./resolve/index */ "./node_modules/@uirouter/core/lib-esm/resolve/index.js"); -/* harmony import */ var _state_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state/index */ "./node_modules/@uirouter/core/lib-esm/state/index.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _state_index__WEBPACK_IMPORTED_MODULE_4__) if(["default","Category","Glob","Queue","Trace","_extend","_inArray","_pushTo","_removeFrom","all","allTrueR","ancestors","and","any","anyTrueR","applyPairs","arrayTuples","assertFn","assertMap","assertPredicate","beforeAfterSubstr","compose","copy","createProxyFunctions","curry","defaults","deregAll","eq","equals","extend","filter","find","flatten","flattenR","fnToString","forEach","fromJson","functionToString","hostRegex","identity","inArray","inherit","invoke","is","isArray","isDate","isDefined","isFunction","isInjectable","isNull","isNullOrUndefined","isNumber","isObject","isPromise","isRegExp","isString","isUndefined","joinNeighborsR","kebobString","makeStub","map","mapObj","maxLength","mergeR","noop","not","omit","or","padString","pairs","parse","pattern","pick","pipe","pluck","prop","propEq","pushR","pushTo","removeFrom","root","services","silenceUncaughtInPromise","silentRejection","splitEqual","splitHash","splitOnDelim","splitQuery","stringify","stripLastPathElement","tail","toJson","trace","trimHashVal","uniqR","unnest","unnestR","val","values","DefType","Param","ParamType","ParamTypes","StateParams","PathNode","PathUtils","NATIVE_INJECTOR_TOKEN","Resolvable","ResolveContext","defaultResolvePolicy","resolvePolicies"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _state_index__WEBPACK_IMPORTED_MODULE_4__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _transition_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transition/index */ "./node_modules/@uirouter/core/lib-esm/transition/index.js"); -/* harmony import */ var _url_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./url/index */ "./node_modules/@uirouter/core/lib-esm/url/index.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _url_index__WEBPACK_IMPORTED_MODULE_6__) if(["default","Category","Glob","Queue","Trace","_extend","_inArray","_pushTo","_removeFrom","all","allTrueR","ancestors","and","any","anyTrueR","applyPairs","arrayTuples","assertFn","assertMap","assertPredicate","beforeAfterSubstr","compose","copy","createProxyFunctions","curry","defaults","deregAll","eq","equals","extend","filter","find","flatten","flattenR","fnToString","forEach","fromJson","functionToString","hostRegex","identity","inArray","inherit","invoke","is","isArray","isDate","isDefined","isFunction","isInjectable","isNull","isNullOrUndefined","isNumber","isObject","isPromise","isRegExp","isString","isUndefined","joinNeighborsR","kebobString","makeStub","map","mapObj","maxLength","mergeR","noop","not","omit","or","padString","pairs","parse","pattern","pick","pipe","pluck","prop","propEq","pushR","pushTo","removeFrom","root","services","silenceUncaughtInPromise","silentRejection","splitEqual","splitHash","splitOnDelim","splitQuery","stringify","stripLastPathElement","tail","toJson","trace","trimHashVal","uniqR","unnest","unnestR","val","values","DefType","Param","ParamType","ParamTypes","StateParams","PathNode","PathUtils","NATIVE_INJECTOR_TOKEN","Resolvable","ResolveContext","defaultResolvePolicy","resolvePolicies","StateBuilder","StateMatcher","StateObject","StateQueueManager","StateRegistry","StateService","TargetState","resolvablesBuilder","HookBuilder","RegisteredHook","RejectType","Rejection","Transition","TransitionEventType","TransitionHook","TransitionHookPhase","TransitionHookScope","TransitionService","defaultTransOpts","makeEvent","matchState"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _url_index__WEBPACK_IMPORTED_MODULE_6__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _view_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./view/index */ "./node_modules/@uirouter/core/lib-esm/view/index.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _view_index__WEBPACK_IMPORTED_MODULE_7__) if(["default","Category","Glob","Queue","Trace","_extend","_inArray","_pushTo","_removeFrom","all","allTrueR","ancestors","and","any","anyTrueR","applyPairs","arrayTuples","assertFn","assertMap","assertPredicate","beforeAfterSubstr","compose","copy","createProxyFunctions","curry","defaults","deregAll","eq","equals","extend","filter","find","flatten","flattenR","fnToString","forEach","fromJson","functionToString","hostRegex","identity","inArray","inherit","invoke","is","isArray","isDate","isDefined","isFunction","isInjectable","isNull","isNullOrUndefined","isNumber","isObject","isPromise","isRegExp","isString","isUndefined","joinNeighborsR","kebobString","makeStub","map","mapObj","maxLength","mergeR","noop","not","omit","or","padString","pairs","parse","pattern","pick","pipe","pluck","prop","propEq","pushR","pushTo","removeFrom","root","services","silenceUncaughtInPromise","silentRejection","splitEqual","splitHash","splitOnDelim","splitQuery","stringify","stripLastPathElement","tail","toJson","trace","trimHashVal","uniqR","unnest","unnestR","val","values","DefType","Param","ParamType","ParamTypes","StateParams","PathNode","PathUtils","NATIVE_INJECTOR_TOKEN","Resolvable","ResolveContext","defaultResolvePolicy","resolvePolicies","StateBuilder","StateMatcher","StateObject","StateQueueManager","StateRegistry","StateService","TargetState","resolvablesBuilder","HookBuilder","RegisteredHook","RejectType","Rejection","Transition","TransitionEventType","TransitionHook","TransitionHookPhase","TransitionHookScope","TransitionService","defaultTransOpts","makeEvent","matchState","BaseUrlRule","ParamFactory","UrlConfig","UrlMatcher","UrlMatcherFactory","UrlRouter","UrlRuleFactory","UrlRules","UrlService"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _view_index__WEBPACK_IMPORTED_MODULE_7__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./globals */ "./node_modules/@uirouter/core/lib-esm/globals.js"); -/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./router */ "./node_modules/@uirouter/core/lib-esm/router.js"); -/* harmony import */ var _vanilla__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./vanilla */ "./node_modules/@uirouter/core/lib-esm/vanilla.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vanilla__WEBPACK_IMPORTED_MODULE_10__) if(["default","Category","Glob","Queue","Trace","_extend","_inArray","_pushTo","_removeFrom","all","allTrueR","ancestors","and","any","anyTrueR","applyPairs","arrayTuples","assertFn","assertMap","assertPredicate","beforeAfterSubstr","compose","copy","createProxyFunctions","curry","defaults","deregAll","eq","equals","extend","filter","find","flatten","flattenR","fnToString","forEach","fromJson","functionToString","hostRegex","identity","inArray","inherit","invoke","is","isArray","isDate","isDefined","isFunction","isInjectable","isNull","isNullOrUndefined","isNumber","isObject","isPromise","isRegExp","isString","isUndefined","joinNeighborsR","kebobString","makeStub","map","mapObj","maxLength","mergeR","noop","not","omit","or","padString","pairs","parse","pattern","pick","pipe","pluck","prop","propEq","pushR","pushTo","removeFrom","root","services","silenceUncaughtInPromise","silentRejection","splitEqual","splitHash","splitOnDelim","splitQuery","stringify","stripLastPathElement","tail","toJson","trace","trimHashVal","uniqR","unnest","unnestR","val","values","DefType","Param","ParamType","ParamTypes","StateParams","PathNode","PathUtils","NATIVE_INJECTOR_TOKEN","Resolvable","ResolveContext","defaultResolvePolicy","resolvePolicies","StateBuilder","StateMatcher","StateObject","StateQueueManager","StateRegistry","StateService","TargetState","resolvablesBuilder","HookBuilder","RegisteredHook","RejectType","Rejection","Transition","TransitionEventType","TransitionHook","TransitionHookPhase","TransitionHookScope","TransitionService","defaultTransOpts","makeEvent","matchState","BaseUrlRule","ParamFactory","UrlConfig","UrlMatcher","UrlMatcherFactory","UrlRouter","UrlRuleFactory","UrlRules","UrlService","ViewService","UIRouterGlobals","UIRouter"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vanilla__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/interface.js"); - - - - - - - - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/interface.js": -/*!**********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/interface.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UIRouterPluginBase": () => (/* binding */ UIRouterPluginBase) -/* harmony export */ }); -var UIRouterPluginBase = /** @class */ (function () { - function UIRouterPluginBase() { - } - UIRouterPluginBase.prototype.dispose = function (router) { }; - return UIRouterPluginBase; -}()); - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/params/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/params/index.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "DefType": () => (/* reexport safe */ _param__WEBPACK_IMPORTED_MODULE_1__.DefType), -/* harmony export */ "Param": () => (/* reexport safe */ _param__WEBPACK_IMPORTED_MODULE_1__.Param), -/* harmony export */ "ParamTypes": () => (/* reexport safe */ _paramTypes__WEBPACK_IMPORTED_MODULE_2__.ParamTypes), -/* harmony export */ "StateParams": () => (/* reexport safe */ _stateParams__WEBPACK_IMPORTED_MODULE_3__.StateParams), -/* harmony export */ "ParamType": () => (/* reexport safe */ _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/params/interface.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _param__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./param */ "./node_modules/@uirouter/core/lib-esm/params/param.js"); -/* harmony import */ var _paramTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./paramTypes */ "./node_modules/@uirouter/core/lib-esm/params/paramTypes.js"); -/* harmony import */ var _stateParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateParams */ "./node_modules/@uirouter/core/lib-esm/params/stateParams.js"); -/* harmony import */ var _paramType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./paramType */ "./node_modules/@uirouter/core/lib-esm/params/paramType.js"); -/** - * This module contains code for State Parameters. - * - * See [[ParamDeclaration]] - * - * @packageDocumentation @preferred - */ - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/params/interface.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/params/interface.js ***! - \*****************************************************************/ -/***/ (() => { - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/params/param.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/params/param.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "DefType": () => (/* binding */ DefType), -/* harmony export */ "Param": () => (/* binding */ Param) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _paramType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./paramType */ "./node_modules/@uirouter/core/lib-esm/params/paramType.js"); - - - - - -var hasOwn = Object.prototype.hasOwnProperty; -var isShorthand = function (cfg) { - return ['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0; -}; -var DefType; -(function (DefType) { - DefType[DefType["PATH"] = 0] = "PATH"; - DefType[DefType["SEARCH"] = 1] = "SEARCH"; - DefType[DefType["CONFIG"] = 2] = "CONFIG"; -})(DefType || (DefType = {})); - -function getParamDeclaration(paramName, location, state) { - var noReloadOnSearch = (state.reloadOnSearch === false && location === DefType.SEARCH) || undefined; - var dynamic = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)([state.dynamic, noReloadOnSearch], _common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined); - var defaultConfig = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(dynamic) ? { dynamic: dynamic } : {}; - var paramConfig = unwrapShorthand(state && state.params && state.params[paramName]); - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(defaultConfig, paramConfig); -} -function unwrapShorthand(cfg) { - cfg = isShorthand(cfg) ? { value: cfg } : cfg; - getStaticDefaultValue['__cacheable'] = true; - function getStaticDefaultValue() { - return cfg.value; - } - var $$fn = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isInjectable)(cfg.value) ? cfg.value : getStaticDefaultValue; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(cfg, { $$fn: $$fn }); -} -function getType(cfg, urlType, location, id, paramTypes) { - if (cfg.type && urlType && urlType.name !== 'string') - throw new Error("Param '" + id + "' has two type configurations."); - if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type)) - return paramTypes.type(cfg.type); - if (urlType) - return urlType; - if (!cfg.type) { - var type = location === DefType.CONFIG - ? 'any' - : location === DefType.PATH - ? 'path' - : location === DefType.SEARCH - ? 'query' - : 'string'; - return paramTypes.type(type); - } - return cfg.type instanceof _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType ? cfg.type : paramTypes.type(cfg.type); -} -/** returns false, true, or the squash value to indicate the "default parameter url squash policy". */ -function getSquashPolicy(config, isOptional, defaultPolicy) { - var squash = config.squash; - if (!isOptional || squash === false) - return false; - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(squash) || squash == null) - return defaultPolicy; - if (squash === true || (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(squash)) - return squash; - throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); -} -function getReplace(config, arrayMode, isOptional, squash) { - var defaultPolicy = [ - { from: '', to: isOptional || arrayMode ? undefined : '' }, - { from: null, to: isOptional || arrayMode ? undefined : '' }, - ]; - var replace = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(config.replace) ? config.replace : []; - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(squash)) - replace.push({ from: squash, to: undefined }); - var configuredKeys = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(replace, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('from')); - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.filter)(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace); -} -var Param = /** @class */ (function () { - function Param(id, type, location, urlConfig, state) { - var config = getParamDeclaration(id, location, state); - type = getType(config, type, location, id, urlConfig.paramTypes); - var arrayMode = getArrayMode(); - type = arrayMode ? type.$asArray(arrayMode, location === DefType.SEARCH) : type; - var isOptional = config.value !== undefined || location === DefType.SEARCH; - var dynamic = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(config.dynamic) ? !!config.dynamic : !!type.dynamic; - var raw = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(config.raw) ? !!config.raw : !!type.raw; - var squash = getSquashPolicy(config, isOptional, urlConfig.defaultSquashPolicy()); - var replace = getReplace(config, arrayMode, isOptional, squash); - var inherit = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(config.inherit) ? !!config.inherit : !!type.inherit; - // array config: param name (param[]) overrides default settings. explicit config overrides param name. - function getArrayMode() { - var arrayDefaults = { array: location === DefType.SEARCH ? 'auto' : false }; - var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(arrayDefaults, arrayParamNomenclature, config).array; - } - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit, array: arrayMode, config: config }); - } - Param.values = function (params, values) { - if (values === void 0) { values = {}; } - var paramValues = {}; - for (var _i = 0, params_1 = params; _i < params_1.length; _i++) { - var param = params_1[_i]; - paramValues[param.id] = param.value(values[param.id]); - } - return paramValues; - }; - /** - * Finds [[Param]] objects which have different param values - * - * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects - * - * @param params: The list of Param objects to filter - * @param values1: The first set of parameter values - * @param values2: the second set of parameter values - * - * @returns any Param objects whose values were different between values1 and values2 - */ - Param.changed = function (params, values1, values2) { - if (values1 === void 0) { values1 = {}; } - if (values2 === void 0) { values2 = {}; } - return params.filter(function (param) { return !param.type.equals(values1[param.id], values2[param.id]); }); - }; - /** - * Checks if two param value objects are equal (for a set of [[Param]] objects) - * - * @param params The list of [[Param]] objects to check - * @param values1 The first set of param values - * @param values2 The second set of param values - * - * @returns true if the param values in values1 and values2 are equal - */ - Param.equals = function (params, values1, values2) { - if (values1 === void 0) { values1 = {}; } - if (values2 === void 0) { values2 = {}; } - return Param.changed(params, values1, values2).length === 0; - }; - /** Returns true if a the parameter values are valid, according to the Param definitions */ - Param.validates = function (params, values) { - if (values === void 0) { values = {}; } - return params.map(function (param) { return param.validates(values[param.id]); }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.allTrueR, true); - }; - Param.prototype.isDefaultValue = function (value) { - return this.isOptional && this.type.equals(this.value(), value); - }; - /** - * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the - * default value, which may be the result of an injectable function. - */ - Param.prototype.value = function (value) { - var _this = this; - /** - * [Internal] Get the default value of a parameter, which may be an injectable function. - */ - var getDefaultValue = function () { - if (_this._defaultValueCache) - return _this._defaultValueCache.defaultValue; - if (!_common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector) - throw new Error('Injectable functions cannot be called at configuration time'); - var defaultValue = _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector.invoke(_this.config.$$fn); - if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue)) - throw new Error("Default value (" + defaultValue + ") for parameter '" + _this.id + "' is not an instance of ParamType (" + _this.type.name + ")"); - if (_this.config.$$fn['__cacheable']) { - _this._defaultValueCache = { defaultValue: defaultValue }; - } - return defaultValue; - }; - var replaceSpecialValues = function (val) { - for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) { - var tuple = _a[_i]; - if (tuple.from === val) - return tuple.to; - } - return val; - }; - value = replaceSpecialValues(value); - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isUndefined)(value) ? getDefaultValue() : this.type.$normalize(value); - }; - Param.prototype.isSearch = function () { - return this.location === DefType.SEARCH; - }; - Param.prototype.validates = function (value) { - // There was no parameter value, but the param is optional - if (((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isUndefined)(value) || value === null) && this.isOptional) - return true; - // The value was not of the correct ParamType, and could not be decoded to the correct ParamType - var normalized = this.type.$normalize(value); - if (!this.type.is(normalized)) - return false; - // The value was of the correct type, but when encoded, did not match the ParamType's regexp - var encoded = this.type.encode(normalized); - return !((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(encoded) && !this.type.pattern.exec(encoded)); - }; - Param.prototype.toString = function () { - return "{Param:" + this.id + " " + this.type + " squash: '" + this.squash + "' optional: " + this.isOptional + "}"; - }; - return Param; -}()); - -//# sourceMappingURL=param.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/params/paramType.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/params/paramType.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ParamType": () => (/* binding */ ParamType) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); - - -/** - * An internal class which implements [[ParamTypeDefinition]]. - * - * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types. - * When a param type definition is registered, an instance of this class is created internally. - * - * This class has naive implementations for all the [[ParamTypeDefinition]] methods. - * - * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values. - * - * #### Example: - * ```js - * var paramTypeDef = { - * decode: function(val) { return parseInt(val, 10); }, - * encode: function(val) { return val && val.toString(); }, - * equals: function(a, b) { return this.is(a) && a === b; }, - * is: function(val) { return angular.isNumber(val) && isFinite(val) && val % 1 === 0; }, - * pattern: /\d+/ - * } - * - * var paramType = new ParamType(paramTypeDef); - * ``` - */ -var ParamType = /** @class */ (function () { - /** - * @param def A configuration object which contains the custom type definition. The object's - * properties will override the default methods and/or pattern in `ParamType`'s public interface. - * @returns a new ParamType object - */ - function ParamType(def) { - /** @inheritdoc */ - this.pattern = /.*/; - /** @inheritdoc */ - this.inherit = true; - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, def); - } - // consider these four methods to be "abstract methods" that should be overridden - /** @inheritdoc */ - ParamType.prototype.is = function (val, key) { - return true; - }; - /** @inheritdoc */ - ParamType.prototype.encode = function (val, key) { - return val; - }; - /** @inheritdoc */ - ParamType.prototype.decode = function (val, key) { - return val; - }; - /** @inheritdoc */ - ParamType.prototype.equals = function (a, b) { - // tslint:disable-next-line:triple-equals - return a == b; - }; - ParamType.prototype.$subPattern = function () { - var sub = this.pattern.toString(); - return sub.substr(1, sub.length - 2); - }; - ParamType.prototype.toString = function () { - return "{ParamType:" + this.name + "}"; - }; - /** Given an encoded string, or a decoded object, returns a decoded object */ - ParamType.prototype.$normalize = function (val) { - return this.is(val) ? val : this.decode(val); - }; - /** - * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'. - * e.g.: - * - urlmatcher pattern "/path?{queryParam[]:int}" - * - url: "/path?queryParam=1&queryParam=2 - * - $stateParams.queryParam will be [1, 2] - * if `mode` is "auto", then - * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1 - * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2] - */ - ParamType.prototype.$asArray = function (mode, isSearch) { - if (!mode) - return this; - if (mode === 'auto' && !isSearch) - throw new Error("'auto' array mode is for query parameters only"); - return new ArrayType(this, mode); - }; - return ParamType; -}()); - -/** Wraps up a `ParamType` object to handle array values. */ -function ArrayType(type, mode) { - var _this = this; - // Wrap non-array value as array - function arrayWrap(val) { - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(val) ? val : (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(val) ? [val] : []; - } - // Unwrap array value for "auto" mode. Return undefined for empty array. - function arrayUnwrap(val) { - switch (val.length) { - case 0: - return undefined; - case 1: - return mode === 'auto' ? val[0] : val; - default: - return val; - } - } - // Wraps type (.is/.encode/.decode) functions to operate on each value of an array - function arrayHandler(callback, allTruthyMode) { - return function handleArray(val) { - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(val) && val.length === 0) - return val; - var arr = arrayWrap(val); - var result = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(arr, callback); - return allTruthyMode === true ? (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.filter)(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result); - }; - } - // Wraps type (.equals) functions to operate on each value of an array - function arrayEqualsHandler(callback) { - return function handleArray(val1, val2) { - var left = arrayWrap(val1), right = arrayWrap(val2); - if (left.length !== right.length) - return false; - for (var i = 0; i < left.length; i++) { - if (!callback(left[i], right[i])) - return false; - } - return true; - }; - } - ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) { - var paramTypeFn = type[name].bind(type); - var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler; - _this[name] = wrapperFn(paramTypeFn); - }); - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, { - dynamic: type.dynamic, - name: type.name, - pattern: type.pattern, - inherit: type.inherit, - raw: type.raw, - is: arrayHandler(type.is.bind(type), true), - $arrayMode: mode, - }); -} -//# sourceMappingURL=paramType.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/params/paramTypes.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/params/paramTypes.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ParamTypes": () => (/* binding */ ParamTypes) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _paramType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./paramType */ "./node_modules/@uirouter/core/lib-esm/params/paramType.js"); - - - - - -/** - * A registry for parameter types. - * - * This registry manages the built-in (and custom) parameter types. - * - * The built-in parameter types are: - * - * - [[string]] - * - [[path]] - * - [[query]] - * - [[hash]] - * - [[int]] - * - [[bool]] - * - [[date]] - * - [[json]] - * - [[any]] - * - * To register custom parameter types, use [[UrlConfig.type]], i.e., - * - * ```js - * router.urlService.config.type(customType) - * ``` - */ -var ParamTypes = /** @class */ (function () { - function ParamTypes() { - this.enqueue = true; - this.typeQueue = []; - this.defaultTypes = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.pick)(ParamTypes.prototype, [ - 'hash', - 'string', - 'query', - 'path', - 'int', - 'bool', - 'date', - 'json', - 'any', - ]); - // Register default types. Store them in the prototype of this.types. - var makeType = function (definition, name) { return new _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ name: name }, definition)); }; - this.types = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(this.defaultTypes, makeType), {}); - } - ParamTypes.prototype.dispose = function () { - this.types = {}; - }; - /** - * Registers a parameter type - * - * End users should call [[UrlMatcherFactory.type]], which delegates to this method. - */ - ParamTypes.prototype.type = function (name, definition, definitionFn) { - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(definition)) - return this.types[name]; - if (this.types.hasOwnProperty(name)) - throw new Error("A type named '" + name + "' has already been defined."); - this.types[name] = new _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ name: name }, definition)); - if (definitionFn) { - this.typeQueue.push({ name: name, def: definitionFn }); - if (!this.enqueue) - this._flushTypeQueue(); - } - return this; - }; - ParamTypes.prototype._flushTypeQueue = function () { - while (this.typeQueue.length) { - var type = this.typeQueue.shift(); - if (type.pattern) - throw new Error("You cannot override a type's .pattern at runtime."); - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this.types[type.name], _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector.invoke(type.def)); - } - }; - return ParamTypes; -}()); - -function initDefaultTypes() { - var makeDefaultType = function (def) { - var valToString = function (val) { return (val != null ? val.toString() : val); }; - var defaultTypeBase = { - encode: valToString, - decode: valToString, - is: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(String), - pattern: /.*/, - // tslint:disable-next-line:triple-equals - equals: function (a, b) { return a == b; }, - }; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, defaultTypeBase, def); - }; - // Default Parameter Type Definitions - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(ParamTypes.prototype, { - string: makeDefaultType({}), - path: makeDefaultType({ - pattern: /[^/]*/, - }), - query: makeDefaultType({}), - hash: makeDefaultType({ - inherit: false, - }), - int: makeDefaultType({ - decode: function (val) { return parseInt(val, 10); }, - is: function (val) { - return !(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isNullOrUndefined)(val) && this.decode(val.toString()) === val; - }, - pattern: /-?\d+/, - }), - bool: makeDefaultType({ - encode: function (val) { return (val && 1) || 0; }, - decode: function (val) { return parseInt(val, 10) !== 0; }, - is: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Boolean), - pattern: /0|1/, - }), - date: makeDefaultType({ - encode: function (val) { - return !this.is(val) - ? undefined - : [val.getFullYear(), ('0' + (val.getMonth() + 1)).slice(-2), ('0' + val.getDate()).slice(-2)].join('-'); - }, - decode: function (val) { - if (this.is(val)) - return val; - var match = this.capture.exec(val); - return match ? new Date(match[1], match[2] - 1, match[3]) : undefined; - }, - is: function (val) { return val instanceof Date && !isNaN(val.valueOf()); }, - equals: function (l, r) { - return ['getFullYear', 'getMonth', 'getDate'].reduce(function (acc, fn) { return acc && l[fn]() === r[fn](); }, true); - }, - 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: makeDefaultType({ - encode: _common_common__WEBPACK_IMPORTED_MODULE_0__.toJson, - decode: _common_common__WEBPACK_IMPORTED_MODULE_0__.fromJson, - is: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Object), - equals: _common_common__WEBPACK_IMPORTED_MODULE_0__.equals, - pattern: /[^/]*/, - }), - // does not encode/decode - any: makeDefaultType({ - encode: _common_common__WEBPACK_IMPORTED_MODULE_0__.identity, - decode: _common_common__WEBPACK_IMPORTED_MODULE_0__.identity, - is: function () { return true; }, - equals: _common_common__WEBPACK_IMPORTED_MODULE_0__.equals, - }), - }); -} -initDefaultTypes(); -//# sourceMappingURL=paramTypes.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/params/stateParams.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/params/stateParams.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateParams": () => (/* binding */ StateParams) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); - -var StateParams = /** @class */ (function () { - function StateParams(params) { - if (params === void 0) { params = {}; } - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, params); - } - /** - * Merges a set of parameters with all parameters inherited between the common parents of the - * current state and a given destination state. - * - * @param {Object} newParams The set of parameters which will be composited with inherited params. - * @param {Object} $current Internal definition of object representing the current state. - * @param {Object} $to Internal definition of object representing state to transition to. - */ - StateParams.prototype.$inherit = function (newParams, $current, $to) { - var parentParams; - var parents = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.ancestors)($current, $to), inherited = {}, inheritList = []; - for (var i in parents) { - if (!parents[i] || !parents[i].params) - continue; - parentParams = Object.keys(parents[i].params); - if (!parentParams.length) - continue; - for (var j in parentParams) { - if (inheritList.indexOf(parentParams[j]) >= 0) - continue; - inheritList.push(parentParams[j]); - inherited[parentParams[j]] = this[parentParams[j]]; - } - } - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, inherited, newParams); - }; - return StateParams; -}()); - -//# sourceMappingURL=stateParams.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/path/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/path/index.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PathNode": () => (/* reexport safe */ _pathNode__WEBPACK_IMPORTED_MODULE_0__.PathNode), -/* harmony export */ "PathUtils": () => (/* reexport safe */ _pathUtils__WEBPACK_IMPORTED_MODULE_1__.PathUtils) -/* harmony export */ }); -/* harmony import */ var _pathNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pathNode */ "./node_modules/@uirouter/core/lib-esm/path/pathNode.js"); -/* harmony import */ var _pathUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pathUtils */ "./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"); - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/path/pathNode.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/path/pathNode.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PathNode": () => (/* binding */ PathNode) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../params/param */ "./node_modules/@uirouter/core/lib-esm/params/param.js"); - - - -/** - * A node in a [[TreeChanges]] path - * - * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path. - * Each PathNode corresponds to a state being entered, exited, or retained. - * The stateful information includes parameter values and resolve data. - */ -var PathNode = /** @class */ (function () { - function PathNode(stateOrNode) { - if (stateOrNode instanceof PathNode) { - var node = stateOrNode; - this.state = node.state; - this.paramSchema = node.paramSchema.slice(); - this.paramValues = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, node.paramValues); - this.resolvables = node.resolvables.slice(); - this.views = node.views && node.views.slice(); - } - else { - var state = stateOrNode; - this.state = state; - this.paramSchema = state.parameters({ inherit: false }); - this.paramValues = {}; - this.resolvables = state.resolvables.map(function (res) { return res.clone(); }); - } - } - PathNode.prototype.clone = function () { - return new PathNode(this); - }; - /** Sets [[paramValues]] for the node, from the values of an object hash */ - PathNode.prototype.applyRawParams = function (params) { - var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; }; - this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.applyPairs)(memo, getParamVal(pDef)); }, {}); - return this; - }; - /** Gets a specific [[Param]] metadata that belongs to the node */ - PathNode.prototype.parameter = function (name) { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(this.paramSchema, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('id', name)); - }; - /** - * @returns true if the state and parameter values for another PathNode are - * equal to the state and param values for this PathNode - */ - PathNode.prototype.equals = function (node, paramsFn) { - var diff = this.diff(node, paramsFn); - return diff && diff.length === 0; - }; - /** - * Finds Params with different parameter values on another PathNode. - * - * Given another node (of the same state), finds the parameter values which differ. - * Returns the [[Param]] (schema objects) whose parameter values differ. - * - * Given another node for a different state, returns `false` - * - * @param node The node to compare to - * @param paramsFn A function that returns which parameters should be compared. - * @returns The [[Param]]s which differ, or null if the two nodes are for different states - */ - PathNode.prototype.diff = function (node, paramsFn) { - if (this.state !== node.state) - return false; - var params = paramsFn ? paramsFn(this) : this.paramSchema; - return _params_param__WEBPACK_IMPORTED_MODULE_2__.Param.changed(params, this.paramValues, node.paramValues); - }; - /** - * Returns a clone of the PathNode - * @deprecated use instance method `node.clone()` - */ - PathNode.clone = function (node) { return node.clone(); }; - return PathNode; -}()); - -//# sourceMappingURL=pathNode.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/path/pathUtils.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/path/pathUtils.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PathUtils": () => (/* binding */ PathUtils) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _state_targetState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../state/targetState */ "./node_modules/@uirouter/core/lib-esm/state/targetState.js"); -/* harmony import */ var _pathNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pathNode */ "./node_modules/@uirouter/core/lib-esm/path/pathNode.js"); - - - - -/** - * This class contains functions which convert TargetStates, Nodes and paths from one type to another. - */ -var PathUtils = /** @class */ (function () { - function PathUtils() { - } - /** Given a PathNode[], create an TargetState */ - PathUtils.makeTargetState = function (registry, path) { - var state = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(path).state; - return new _state_targetState__WEBPACK_IMPORTED_MODULE_2__.TargetState(registry, state, path.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('paramValues')).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.mergeR, {}), {}); - }; - PathUtils.buildPath = function (targetState) { - var toParams = targetState.params(); - return targetState.$state().path.map(function (state) { return new _pathNode__WEBPACK_IMPORTED_MODULE_3__.PathNode(state).applyRawParams(toParams); }); - }; - /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */ - PathUtils.buildToPath = function (fromPath, targetState) { - var toPath = PathUtils.buildPath(targetState); - if (targetState.options().inherit) { - return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params())); - } - return toPath; - }; - /** - * Creates ViewConfig objects and adds to nodes. - * - * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state - */ - PathUtils.applyViewConfigs = function ($view, path, states) { - // Only apply the viewConfigs to the nodes for the given states - path - .filter(function (node) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(states, node.state); }) - .forEach(function (node) { - var viewDecls = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)(node.state.views || {}); - var subPath = PathUtils.subPath(path, function (n) { return n === node; }); - var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); }); - node.views = viewConfigs.reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []); - }); - }; - /** - * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath - * - * For a parameter in a node to be inherited from the from path: - * - The toPath's node must have a matching node in the fromPath (by state). - * - The parameter name must not be found in the toKeys parameter array. - * - * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some - * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams, - * it is not inherited from the fromPath. - */ - PathUtils.inheritParams = function (fromPath, toPath, toKeys) { - if (toKeys === void 0) { toKeys = []; } - function nodeParamVals(path, state) { - var node = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(path, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('state', state)); - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, node && node.paramValues); - } - var noInherit = fromPath - .map(function (node) { return node.paramSchema; }) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .filter(function (param) { return !param.inherit; }) - .map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('id')); - /** - * Given an [[PathNode]] "toNode", return a new [[PathNode]] with param values inherited from the - * matching node in fromPath. Only inherit keys that aren't found in "toKeys" from the node in "fromPath"" - */ - function makeInheritedParamsNode(toNode) { - // All param values for the node (may include default key/vals, when key was not found in toParams) - var toParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, toNode && toNode.paramValues); - // limited to only those keys found in toParams - var incomingParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.pick)(toParamVals, toKeys); - toParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.omit)(toParamVals, toKeys); - var fromParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.omit)(nodeParamVals(fromPath, toNode.state) || {}, noInherit); - // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals - var ownParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(toParamVals, fromParamVals, incomingParamVals); - return new _pathNode__WEBPACK_IMPORTED_MODULE_3__.PathNode(toNode.state).applyRawParams(ownParamVals); - } - // The param keys specified by the incoming toParams - return toPath.map(makeInheritedParamsNode); - }; - /** - * Computes the tree changes (entering, exiting) between a fromPath and toPath. - */ - PathUtils.treeChanges = function (fromPath, toPath, reloadState) { - var max = Math.min(fromPath.length, toPath.length); - var keep = 0; - var nodesMatch = function (node1, node2) { return node1.equals(node2, PathUtils.nonDynamicParams); }; - while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) { - keep++; - } - /** Given a retained node, return a new node which uses the to node's param values */ - function applyToParams(retainedNode, idx) { - var cloned = retainedNode.clone(); - cloned.paramValues = toPath[idx].paramValues; - return cloned; - } - var from, retained, exiting, entering, to; - from = fromPath; - retained = from.slice(0, keep); - exiting = from.slice(keep); - // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped - var retainedWithToParams = retained.map(applyToParams); - entering = toPath.slice(keep); - to = retainedWithToParams.concat(entering); - return { from: from, to: to, retained: retained, retainedWithToParams: retainedWithToParams, exiting: exiting, entering: entering }; - }; - /** - * Returns a new path which is: the subpath of the first path which matches the second path. - * - * The new path starts from root and contains any nodes that match the nodes in the second path. - * It stops before the first non-matching node. - * - * Nodes are compared using their state property and their parameter values. - * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes. - * - * @param pathA the first path - * @param pathB the second path - * @param paramsFn a function which returns the parameters to consider when comparing - * - * @returns an array of PathNodes from the first path which match the nodes in the second path - */ - PathUtils.matching = function (pathA, pathB, paramsFn) { - var done = false; - var tuples = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples)(pathA, pathB); - return tuples.reduce(function (matching, _a) { - var nodeA = _a[0], nodeB = _a[1]; - done = done || !nodeA.equals(nodeB, paramsFn); - return done ? matching : matching.concat(nodeA); - }, []); - }; - /** - * Returns true if two paths are identical. - * - * @param pathA - * @param pathB - * @param paramsFn a function which returns the parameters to consider when comparing - * @returns true if the the states and parameter values for both paths are identical - */ - PathUtils.equals = function (pathA, pathB, paramsFn) { - return pathA.length === pathB.length && PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length; - }; - /** - * Return a subpath of a path, which stops at the first matching node - * - * Given an array of nodes, returns a subset of the array starting from the first node, - * stopping when the first node matches the predicate. - * - * @param path a path of [[PathNode]]s - * @param predicate a [[Predicate]] fn that matches [[PathNode]]s - * @returns a subpath up to the matching node, or undefined if no match is found - */ - PathUtils.subPath = function (path, predicate) { - var node = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(path, predicate); - var elementIdx = path.indexOf(node); - return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1); - }; - PathUtils.nonDynamicParams = function (node) { - return node.state.parameters({ inherit: false }).filter(function (param) { return !param.dynamic; }); - }; - /** Gets the raw parameter values from a path */ - PathUtils.paramValues = function (path) { return path.reduce(function (acc, node) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(acc, node.paramValues); }, {}); }; - return PathUtils; -}()); - -//# sourceMappingURL=pathUtils.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/resolve/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/resolve/index.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "resolvePolicies": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_0__.resolvePolicies), -/* harmony export */ "Resolvable": () => (/* reexport safe */ _resolvable__WEBPACK_IMPORTED_MODULE_1__.Resolvable), -/* harmony export */ "defaultResolvePolicy": () => (/* reexport safe */ _resolvable__WEBPACK_IMPORTED_MODULE_1__.defaultResolvePolicy), -/* harmony export */ "NATIVE_INJECTOR_TOKEN": () => (/* reexport safe */ _resolveContext__WEBPACK_IMPORTED_MODULE_2__.NATIVE_INJECTOR_TOKEN), -/* harmony export */ "ResolveContext": () => (/* reexport safe */ _resolveContext__WEBPACK_IMPORTED_MODULE_2__.ResolveContext) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/resolve/interface.js"); -/* harmony import */ var _resolvable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resolvable */ "./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"); -/* harmony import */ var _resolveContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resolveContext */ "./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"); - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/resolve/interface.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/resolve/interface.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "resolvePolicies": () => (/* binding */ resolvePolicies) -/* harmony export */ }); -var resolvePolicies = { - when: { - LAZY: 'LAZY', - EAGER: 'EAGER', - }, - async: { - WAIT: 'WAIT', - NOWAIT: 'NOWAIT', - }, -}; -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "defaultResolvePolicy": () => (/* binding */ defaultResolvePolicy), -/* harmony export */ "Resolvable": () => (/* binding */ Resolvable) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); - - - - - - -// TODO: explicitly make this user configurable -var defaultResolvePolicy = { - when: 'LAZY', - async: 'WAIT', -}; -/** - * The basic building block for the resolve system. - * - * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise), - * and the unwrapped-when-complete (.data) result of the resolveFn. - * - * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the - * resolveFn) and returns the resulting promise. - * - * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first - * parameter to those fns. - */ -var Resolvable = /** @class */ (function () { - function Resolvable(arg1, resolveFn, deps, policy, data) { - this.resolved = false; - this.promise = undefined; - if (arg1 instanceof Resolvable) { - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, arg1); - } - else if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction)(resolveFn)) { - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isNullOrUndefined)(arg1)) - throw new Error('new Resolvable(): token argument is required'); - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction)(resolveFn)) - throw new Error('new Resolvable(): resolveFn argument must be a function'); - this.token = arg1; - this.policy = policy; - this.resolveFn = resolveFn; - this.deps = deps || []; - this.data = data; - this.resolved = data !== undefined; - this.promise = this.resolved ? _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(this.data) : undefined; - } - else if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isObject)(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) { - var literal = arg1; - return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data); - } - } - Resolvable.prototype.getPolicy = function (state) { - var thisPolicy = this.policy || {}; - var statePolicy = (state && state.resolvePolicy) || {}; - return { - when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when, - async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async, - }; - }; - /** - * Asynchronously resolve this Resolvable's data - * - * Given a ResolveContext that this Resolvable is found in: - * Wait for this Resolvable's dependencies, then invoke this Resolvable's function - * and update the Resolvable's state - */ - Resolvable.prototype.resolve = function (resolveContext, trans) { - var _this = this; - var $q = _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q; - // Gets all dependencies from ResolveContext and wait for them to be resolved - var getResolvableDependencies = function () { - return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) { return resolvable.get(resolveContext, trans); })); - }; - // Invokes the resolve function passing the resolved dependencies as arguments - var invokeResolveFn = function (resolvedDeps) { return _this.resolveFn.apply(null, resolvedDeps); }; - var node = resolveContext.findNode(this); - var state = node && node.state; - var asyncPolicy = this.getPolicy(state).async; - var customAsyncPolicy = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction)(asyncPolicy) ? asyncPolicy : _common_common__WEBPACK_IMPORTED_MODULE_0__.identity; - // After the final value has been resolved, update the state of the Resolvable - var applyResolvedValue = function (resolvedValue) { - _this.data = resolvedValue; - _this.resolved = true; - _this.resolveFn = null; - _common_trace__WEBPACK_IMPORTED_MODULE_2__.trace.traceResolvableResolved(_this, trans); - return _this.data; - }; - // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick. - return (this.promise = $q - .when() - .then(getResolvableDependencies) - .then(invokeResolveFn) - .then(customAsyncPolicy) - .then(applyResolvedValue)); - }; - /** - * Gets a promise for this Resolvable's data. - * - * Fetches the data and returns a promise. - * Returns the existing promise if it has already been fetched once. - */ - Resolvable.prototype.get = function (resolveContext, trans) { - return this.promise || this.resolve(resolveContext, trans); - }; - Resolvable.prototype.toString = function () { - return "Resolvable(token: " + (0,_common_strings__WEBPACK_IMPORTED_MODULE_3__.stringify)(this.token) + ", requires: [" + this.deps.map(_common_strings__WEBPACK_IMPORTED_MODULE_3__.stringify) + "])"; - }; - Resolvable.prototype.clone = function () { - return new Resolvable(this); - }; - Resolvable.fromData = function (token, data) { return new Resolvable(token, function () { return data; }, null, null, data); }; - return Resolvable; -}()); - -//# sourceMappingURL=resolvable.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "NATIVE_INJECTOR_TOKEN": () => (/* binding */ NATIVE_INJECTOR_TOKEN), -/* harmony export */ "ResolveContext": () => (/* binding */ ResolveContext) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/resolve/interface.js"); -/* harmony import */ var _resolvable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resolvable */ "./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"); -/* harmony import */ var _path_pathUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../path/pathUtils */ "./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - - - - - - - - -var whens = _interface__WEBPACK_IMPORTED_MODULE_4__.resolvePolicies.when; -var ALL_WHENS = [whens.EAGER, whens.LAZY]; -var EAGER_WHENS = [whens.EAGER]; -// tslint:disable-next-line:no-inferrable-types -var NATIVE_INJECTOR_TOKEN = 'Native Injector'; -/** - * Encapsulates Dependency Injection for a path of nodes - * - * UI-Router states are organized as a tree. - * A nested state has a path of ancestors to the root of the tree. - * When a state is being activated, each element in the path is wrapped as a [[PathNode]]. - * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated. - * - * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path. - */ -var ResolveContext = /** @class */ (function () { - function ResolveContext(_path) { - this._path = _path; - } - /** Gets all the tokens found in the resolve context, de-duplicated */ - ResolveContext.prototype.getTokens = function () { - return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.uniqR, []); - }; - /** - * Gets the Resolvable that matches the token - * - * Gets the last Resolvable that matches the token in this context, or undefined. - * Throws an error if it doesn't exist in the ResolveContext - */ - ResolveContext.prototype.getResolvable = function (token) { - var matching = this._path - .map(function (node) { return node.resolvables; }) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .filter(function (r) { return r.token === token; }); - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(matching); - }; - /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */ - ResolveContext.prototype.getPolicy = function (resolvable) { - var node = this.findNode(resolvable); - return resolvable.getPolicy(node.state); - }; - /** - * Returns a ResolveContext that includes a portion of this one - * - * Given a state, this method creates a new ResolveContext from this one. - * The new context starts at the first node (root) and stops at the node for the `state` parameter. - * - * #### Why - * - * When a transition is created, the nodes in the "To Path" are injected from a ResolveContext. - * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables. - * The "To State" can inject values from its own resolvables, as well as those from all its ancestor state's (node's). - * This method is used to create a narrower context when injecting ancestor nodes. - * - * @example - * `let ABCD = new ResolveContext([A, B, C, D]);` - * - * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`: - * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`. - * However, `B` should only be able to access resolvables from `A`, `B`. - * - * When resolving for the `B` node, first take the full "To Path" Context `[A,B,C,D]` and limit to the subpath `[A,B]`. - * `let AB = ABCD.subcontext(a)` - */ - ResolveContext.prototype.subContext = function (state) { - return new ResolveContext(_path_pathUtils__WEBPACK_IMPORTED_MODULE_6__.PathUtils.subPath(this._path, function (node) { return node.state === state; })); - }; - /** - * Adds Resolvables to the node that matches the state - * - * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block). - * The resolvable is added to the node matching the `state` parameter. - * - * These new resolvables are not automatically fetched. - * The calling code should either fetch them, fetch something that depends on them, - * or rely on [[resolvePath]] being called when some state is being entered. - * - * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default. - * - * @param newResolvables the new Resolvables - * @param state Used to find the node to put the resolvable on - */ - ResolveContext.prototype.addResolvables = function (newResolvables, state) { - var node = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(this._path, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('state', state)); - var keys = newResolvables.map(function (r) { return r.token; }); - node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables); - }; - /** - * Returns a promise for an array of resolved path Element promises - * - * @param when - * @param trans - * @returns {Promise|any} - */ - ResolveContext.prototype.resolvePath = function (when, trans) { - var _this = this; - if (when === void 0) { when = 'LAZY'; } - // This option determines which 'when' policy Resolvables we are about to fetch. - var whenOption = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(ALL_WHENS, when) ? when : 'LAZY'; - // If the caller specified EAGER, only the EAGER Resolvables are fetched. - // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.` - var matchedWhens = whenOption === _interface__WEBPACK_IMPORTED_MODULE_4__.resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS; - // get the subpath to the state argument, if provided - _common_trace__WEBPACK_IMPORTED_MODULE_2__.trace.traceResolvePath(this._path, when, trans); - var matchesPolicy = function (acceptedVals, whenOrAsync) { return function (resolvable) { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]); - }; }; - // Trigger all the (matching) Resolvables in the path - // Reduce all the "WAIT" Resolvables into an array - var promises = this._path.reduce(function (acc, node) { - var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when')); - var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async')); - var wait = nodeResolvables.filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.not)(matchesPolicy(['NOWAIT'], 'async'))); - // For the matching Resolvables, start their async fetch process. - var subContext = _this.subContext(node.state); - var getResult = function (r) { - return r - .get(subContext, trans) - // Return a tuple that includes the Resolvable's token - .then(function (value) { return ({ token: r.token, value: value }); }); - }; - nowait.forEach(getResult); - return acc.concat(wait.map(getResult)); - }, []); - // Wait for all the "WAIT" resolvables - return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.all(promises); - }; - ResolveContext.prototype.injector = function () { - return this._injector || (this._injector = new UIInjectorImpl(this)); - }; - ResolveContext.prototype.findNode = function (resolvable) { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(this._path, function (node) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(node.resolvables, resolvable); }); - }; - /** - * Gets the async dependencies of a Resolvable - * - * Given a Resolvable, returns its dependencies as a Resolvable[] - */ - ResolveContext.prototype.getDependencies = function (resolvable) { - var _this = this; - var node = this.findNode(resolvable); - // Find which other resolvables are "visible" to the `resolvable` argument - // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path) - var subPath = _path_pathUtils__WEBPACK_IMPORTED_MODULE_6__.PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path; - var availableResolvables = subPath - .reduce(function (acc, _node) { return acc.concat(_node.resolvables); }, []) // all of subpath's resolvables - .filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument - var getDependency = function (token) { - var matching = availableResolvables.filter(function (r) { return r.token === token; }); - if (matching.length) - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(matching); - var fromInjector = _this.injector().getNative(token); - if ((0,_common__WEBPACK_IMPORTED_MODULE_8__.isUndefined)(fromInjector)) { - throw new Error('Could not find Dependency Injection token: ' + (0,_common_strings__WEBPACK_IMPORTED_MODULE_7__.stringify)(token)); - } - return new _resolvable__WEBPACK_IMPORTED_MODULE_5__.Resolvable(token, function () { return fromInjector; }, [], fromInjector); - }; - return resolvable.deps.map(getDependency); - }; - return ResolveContext; -}()); - -/** @internal */ -var UIInjectorImpl = /** @class */ (function () { - function UIInjectorImpl(context) { - this.context = context; - this.native = this.get(NATIVE_INJECTOR_TOKEN) || _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector; - } - UIInjectorImpl.prototype.get = function (token) { - var resolvable = this.context.getResolvable(token); - if (resolvable) { - if (this.context.getPolicy(resolvable).async === 'NOWAIT') { - return resolvable.get(this.context); - } - if (!resolvable.resolved) { - throw new Error('Resolvable async .get() not complete:' + (0,_common_strings__WEBPACK_IMPORTED_MODULE_7__.stringify)(resolvable.token)); - } - return resolvable.data; - } - return this.getNative(token); - }; - UIInjectorImpl.prototype.getAsync = function (token) { - var resolvable = this.context.getResolvable(token); - if (resolvable) - return resolvable.get(this.context); - return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.when(this.native.get(token)); - }; - UIInjectorImpl.prototype.getNative = function (token) { - return this.native && this.native.get(token); - }; - return UIInjectorImpl; -}()); -//# sourceMappingURL=resolveContext.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/router.js": -/*!*******************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/router.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UIRouter": () => (/* binding */ UIRouter) -/* harmony export */ }); -/* harmony import */ var _url_urlMatcherFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./url/urlMatcherFactory */ "./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"); -/* harmony import */ var _url_urlRouter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./url/urlRouter */ "./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"); -/* harmony import */ var _transition_transitionService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transition/transitionService */ "./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"); -/* harmony import */ var _view_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view/view */ "./node_modules/@uirouter/core/lib-esm/view/view.js"); -/* harmony import */ var _state_stateRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state/stateRegistry */ "./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"); -/* harmony import */ var _state_stateService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./state/stateService */ "./node_modules/@uirouter/core/lib-esm/state/stateService.js"); -/* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./globals */ "./node_modules/@uirouter/core/lib-esm/globals.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _url_urlService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./url/urlService */ "./node_modules/@uirouter/core/lib-esm/url/urlService.js"); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - - - - - - - - - - - -/** @internal */ -var _routerInstance = 0; -/** @internal */ -var locSvcFns = ['url', 'path', 'search', 'hash', 'onChange']; -/** @internal */ -var locCfgFns = ['port', 'protocol', 'host', 'baseHref', 'html5Mode', 'hashPrefix']; -/** @internal */ -var locationServiceStub = (0,_common__WEBPACK_IMPORTED_MODULE_11__.makeStub)('LocationServices', locSvcFns); -/** @internal */ -var locationConfigStub = (0,_common__WEBPACK_IMPORTED_MODULE_11__.makeStub)('LocationConfig', locCfgFns); -/** - * An instance of UI-Router. - * - * This object contains references to service APIs which define your application's routing behavior. - */ -var UIRouter = /** @class */ (function () { - /** - * Creates a new `UIRouter` object - * - * @param locationService a [[LocationServices]] implementation - * @param locationConfig a [[LocationConfig]] implementation - * @internal - */ - function UIRouter(locationService, locationConfig) { - if (locationService === void 0) { locationService = locationServiceStub; } - if (locationConfig === void 0) { locationConfig = locationConfigStub; } - this.locationService = locationService; - this.locationConfig = locationConfig; - /** @internal */ this.$id = _routerInstance++; - /** @internal */ this._disposed = false; - /** @internal */ this._disposables = []; - /** Enable/disable tracing to the javascript console */ - this.trace = _common_trace__WEBPACK_IMPORTED_MODULE_10__.trace; - /** Provides services related to ui-view synchronization */ - this.viewService = new _view_view__WEBPACK_IMPORTED_MODULE_3__.ViewService(this); - /** An object that contains global router state, such as the current state and params */ - this.globals = new _globals__WEBPACK_IMPORTED_MODULE_6__.UIRouterGlobals(); - /** A service that exposes global Transition Hooks */ - this.transitionService = new _transition_transitionService__WEBPACK_IMPORTED_MODULE_2__.TransitionService(this); - /** - * Deprecated for public use. Use [[urlService]] instead. - * @deprecated Use [[urlService]] instead - */ - this.urlMatcherFactory = new _url_urlMatcherFactory__WEBPACK_IMPORTED_MODULE_0__.UrlMatcherFactory(this); - /** - * Deprecated for public use. Use [[urlService]] instead. - * @deprecated Use [[urlService]] instead - */ - this.urlRouter = new _url_urlRouter__WEBPACK_IMPORTED_MODULE_1__.UrlRouter(this); - /** Provides services related to the URL */ - this.urlService = new _url_urlService__WEBPACK_IMPORTED_MODULE_9__.UrlService(this); - /** Provides a registry for states, and related registration services */ - this.stateRegistry = new _state_stateRegistry__WEBPACK_IMPORTED_MODULE_4__.StateRegistry(this); - /** Provides services related to states */ - this.stateService = new _state_stateService__WEBPACK_IMPORTED_MODULE_5__.StateService(this); - /** @internal plugin instances are registered here */ - 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(locationService); - this.disposable(locationConfig); - } - /** Registers an object to be notified when the router is disposed */ - UIRouter.prototype.disposable = function (disposable) { - this._disposables.push(disposable); - }; - /** - * Disposes this router instance - * - * When called, clears resources retained by the router by calling `dispose(this)` on all - * registered [[disposable]] objects. - * - * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only. - * - * @internal - * @param disposable (optional) the disposable to dispose - */ - UIRouter.prototype.dispose = function (disposable) { - var _this = this; - if (disposable && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_8__.isFunction)(disposable.dispose)) { - disposable.dispose(this); - return undefined; - } - this._disposed = true; - this._disposables.slice().forEach(function (d) { - try { - typeof d.dispose === 'function' && d.dispose(_this); - (0,_common_common__WEBPACK_IMPORTED_MODULE_7__.removeFrom)(_this._disposables, d); - } - catch (ignored) { } - }); - }; - /** - * Adds a plugin to UI-Router - * - * This method adds a UI-Router Plugin. - * A plugin can enhance or change UI-Router behavior using any public API. - * - * #### Example: - * ```js - * import { MyCoolPlugin } from "ui-router-cool-plugin"; - * - * var plugin = router.addPlugin(MyCoolPlugin); - * ``` - * - * ### Plugin authoring - * - * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object. - * - * The plugin can implement its functionality using any of the public APIs of [[UIRouter]]. - * For example, it may configure router options or add a Transition Hook. - * - * The plugin can then be published as a separate module. - * - * #### Example: - * ```js - * export class MyAuthPlugin implements UIRouterPlugin { - * constructor(router: UIRouter, options: any) { - * this.name = "MyAuthPlugin"; - * let $transitions = router.transitionService; - * let $state = router.stateService; - * - * let authCriteria = { - * to: (state) => state.data && state.data.requiresAuth - * }; - * - * function authHook(transition: Transition) { - * let authService = transition.injector().get('AuthService'); - * if (!authService.isAuthenticated()) { - * return $state.target('login'); - * } - * } - * - * $transitions.onStart(authCriteria, authHook); - * } - * } - * ``` - * - * @param plugin one of: - * - a plugin class which implements [[UIRouterPlugin]] - * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance - * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance - * @param options options to pass to the plugin class/factory - * @returns the registered plugin instance - */ - UIRouter.prototype.plugin = function (plugin, options) { - if (options === void 0) { options = {}; } - var pluginInstance = new plugin(this, options); - if (!pluginInstance.name) - throw new Error('Required property `name` missing on plugin: ' + pluginInstance); - this._disposables.push(pluginInstance); - return (this._plugins[pluginInstance.name] = pluginInstance); - }; - UIRouter.prototype.getPlugin = function (pluginName) { - return pluginName ? this._plugins[pluginName] : (0,_common_common__WEBPACK_IMPORTED_MODULE_7__.values)(this._plugins); - }; - return UIRouter; -}()); - -//# sourceMappingURL=router.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/index.js": -/*!************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/index.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateBuilder": () => (/* reexport safe */ _stateBuilder__WEBPACK_IMPORTED_MODULE_1__.StateBuilder), -/* harmony export */ "resolvablesBuilder": () => (/* reexport safe */ _stateBuilder__WEBPACK_IMPORTED_MODULE_1__.resolvablesBuilder), -/* harmony export */ "StateObject": () => (/* reexport safe */ _stateObject__WEBPACK_IMPORTED_MODULE_2__.StateObject), -/* harmony export */ "StateMatcher": () => (/* reexport safe */ _stateMatcher__WEBPACK_IMPORTED_MODULE_3__.StateMatcher), -/* harmony export */ "StateQueueManager": () => (/* reexport safe */ _stateQueueManager__WEBPACK_IMPORTED_MODULE_4__.StateQueueManager), -/* harmony export */ "StateRegistry": () => (/* reexport safe */ _stateRegistry__WEBPACK_IMPORTED_MODULE_5__.StateRegistry), -/* harmony export */ "StateService": () => (/* reexport safe */ _stateService__WEBPACK_IMPORTED_MODULE_6__.StateService), -/* harmony export */ "TargetState": () => (/* reexport safe */ _targetState__WEBPACK_IMPORTED_MODULE_7__.TargetState) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/state/interface.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _stateBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stateBuilder */ "./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"); -/* harmony import */ var _stateObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateObject */ "./node_modules/@uirouter/core/lib-esm/state/stateObject.js"); -/* harmony import */ var _stateMatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateMatcher */ "./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"); -/* harmony import */ var _stateQueueManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateQueueManager */ "./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"); -/* harmony import */ var _stateRegistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./stateRegistry */ "./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"); -/* harmony import */ var _stateService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stateService */ "./node_modules/@uirouter/core/lib-esm/state/stateService.js"); -/* harmony import */ var _targetState__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./targetState */ "./node_modules/@uirouter/core/lib-esm/state/targetState.js"); -/** - * # The state subsystem - * - * This subsystem implements the ui-router state tree - * - * - The [[StateService]] has state-related service methods such as: - * - [[StateService.get]]: Get a registered [[StateDeclaration]] object - * - [[StateService.go]]: Transition from the current state to a new state - * - [[StateService.reload]]: Reload the current state - * - [[StateService.target]]: Get a [[TargetState]] (useful when redirecting from a Transition Hook) - * - [[StateService.onInvalid]]: Register a callback for when a transition to an invalid state is started - * - [[StateService.defaultErrorHandler]]: Register a global callback for when a transition errors - * - The [[StateDeclaration]] interface defines the shape of a state declaration - * - The [[StateRegistry]] contains all the registered states - * - States can be added/removed using the [[StateRegistry.register]] and [[StateRegistry.deregister]] - * - Note: Bootstrap state registration differs by front-end framework. - * - Get notified of state registration/deregistration using [[StateRegistry.onStatesChanged]]. - * - * @packageDocumentation - */ - - - - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/interface.js": -/*!****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/interface.js ***! - \****************************************************************/ -/***/ (() => { - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "resolvablesBuilder": () => (/* binding */ resolvablesBuilder), -/* harmony export */ "StateBuilder": () => (/* binding */ StateBuilder) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../resolve/resolvable */ "./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); - - - - - - -var parseUrl = function (url) { - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(url)) - return false; - var root = url.charAt(0) === '^'; - return { val: root ? url.substring(1) : url, root: root }; -}; -function nameBuilder(state) { - return state.name; -} -function selfBuilder(state) { - state.self.$$state = function () { return state; }; - return state.self; -} -function dataBuilder(state) { - if (state.parent && state.parent.data) { - state.data = state.self.data = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)(state.parent.data, state.data); - } - return state.data; -} -var getUrlBuilder = function ($urlMatcherFactoryProvider, root) { - return function urlBuilder(stateObject) { - var stateDec = stateObject.self; - // For future states, i.e., states whose name ends with `.**`, - // match anything that starts with the url prefix - if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\.\*\*$/)) { - var newStateDec = {}; - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.copy)(stateDec, newStateDec); - newStateDec.url += '{remainder:any}'; // match any path (.*) - stateDec = newStateDec; - } - var parent = stateObject.parent; - var parsed = parseUrl(stateDec.url); - var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, { state: stateDec }); - if (!url) - return null; - if (!$urlMatcherFactoryProvider.isMatcher(url)) - throw new Error("Invalid url '" + url + "' in state '" + stateObject + "'"); - return parsed && parsed.root ? url : ((parent && parent.navigable) || root()).url.append(url); - }; -}; -var getNavigableBuilder = function (isRoot) { - return function navigableBuilder(state) { - return !isRoot(state) && state.url ? state : state.parent ? state.parent.navigable : null; - }; -}; -var getParamsBuilder = function (paramFactory) { - return function paramsBuilder(state) { - var makeConfigParam = function (config, id) { return paramFactory.fromConfig(id, null, state.self); }; - var urlParams = (state.url && state.url.parameters({ inherit: false })) || []; - var nonUrlParams = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.mapObj)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.omit)(state.params || {}, urlParams.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('id'))), makeConfigParam)); - return urlParams - .concat(nonUrlParams) - .map(function (p) { return [p.id, p]; }) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.applyPairs, {}); - }; -}; -function pathBuilder(state) { - return state.parent ? state.parent.path.concat(state) : /*root*/ [state]; -} -function includesBuilder(state) { - var includes = state.parent ? (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, state.parent.includes) : {}; - includes[state.name] = true; - return includes; -} -/** - * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]]. - * - * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder - * validates the `resolve` property and converts it to a [[Resolvable]] array. - * - * resolve: input value can be: - * - * { - * // analyzed but not injected - * myFooResolve: function() { return "myFooData"; }, - * - * // function.toString() parsed, "DependencyName" dep as string (not min-safe) - * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() }, - * - * // Array split; "DependencyName" dep as string - * myBazResolve: [ "DependencyName", function(dep) { return dep.fetchSomethingAsPromise() }, - * - * // Array split; DependencyType dep as token (compared using ===) - * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() }, - * - * // val.$inject used as deps - * // where: - * // corgeResolve.$inject = ["DependencyName"]; - * // function corgeResolve(dep) { dep.fetchSometingAsPromise() } - * // then "DependencyName" dep as string - * myCorgeResolve: corgeResolve, - * - * // inject service by name - * // When a string is found, desugar creating a resolve that injects the named service - * myGraultResolve: "SomeService" - * } - * - * or: - * - * [ - * new Resolvable("myFooResolve", function() { return "myFooData" }), - * new Resolvable("myBarResolve", function(dep) { return dep.fetchSomethingAsPromise() }, [ "DependencyName" ]), - * { provide: "myBazResolve", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ "DependencyName" ] } - * ] - */ -function resolvablesBuilder(state) { - /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */ - var objects2Tuples = function (resolveObj, resolvePolicies) { - return Object.keys(resolveObj || {}).map(function (token) { return ({ - token: token, - val: resolveObj[token], - deps: undefined, - policy: resolvePolicies[token], - }); }); - }; - /** fetch DI annotations from a function or ng1-style array */ - var annotate = function (fn) { - var $injector = _common_coreservices__WEBPACK_IMPORTED_MODULE_5__.services.$injector; - // ng1 doesn't have an $injector until runtime. - // If the $injector doesn't exist, use "deferred" literal as a - // marker indicating they should be annotated when runtime starts - return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || 'deferred'; - }; - /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */ - var isResolveLiteral = function (obj) { return !!(obj.token && obj.resolveFn); }; - /** true if the object looks like a provide literal, or a ng2 Provider */ - var isLikeNg2Provider = function (obj) { - return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass)); - }; - /** true if the object looks like a tuple from obj2Tuples */ - var isTupleFromObj = function (obj) { - return !!(obj && obj.val && ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(obj.val) || (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(obj.val) || (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction)(obj.val))); - }; - /** extracts the token from a Provider or provide literal */ - var getToken = function (p) { return p.provide || p.token; }; - // prettier-ignore: Given a literal resolve or provider object, returns a Resolvable - var literal2Resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([ - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('resolveFn'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), p.resolveFn, p.deps, p.policy); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useFactory'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useClass'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), function () { return new p.useClass(); }, [], p.policy); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useValue'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), function () { return p.useValue; }, [], p.policy, p.useValue); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useExisting'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), _common_common__WEBPACK_IMPORTED_MODULE_0__.identity, [p.useExisting], p.policy); }], - ]); - // prettier-ignore - var tuple2Resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([ - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pipe)((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('val'), _common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString), function (tuple) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(tuple.token, _common_common__WEBPACK_IMPORTED_MODULE_0__.identity, [tuple.val], tuple.policy); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pipe)((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('val'), _common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray), function (tuple) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(tuple.token, (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(tuple.val), tuple.val.slice(0, -1), tuple.policy); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pipe)((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('val'), _common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction), function (tuple) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }], - ]); - // prettier-ignore - var item2Resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([ - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(_resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable), function (r) { return r; }], - [isResolveLiteral, literal2Resolvable], - [isLikeNg2Provider, literal2Resolvable], - [isTupleFromObj, tuple2Resolvable], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.val)(true), function (obj) { throw new Error('Invalid resolve value: ' + (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(obj)); },], - ]); - // If resolveBlock is already an array, use it as-is. - // Otherwise, assume it's an object and convert to an Array of tuples - var decl = state.resolve; - var items = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {}); - return items.map(item2Resolvable); -} -/** - * A internal global service - * - * StateBuilder is a factory for the internal [[StateObject]] objects. - * - * When you register a state with the [[StateRegistry]], you register a plain old javascript object which - * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding - * [[StateObject]] object, which has an API and is used internally. - * - * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function - * using the [[builder]] method. - */ -var StateBuilder = /** @class */ (function () { - function StateBuilder(matcher, urlMatcherFactory) { - this.matcher = matcher; - var self = this; - var root = function () { return matcher.find(''); }; - var isRoot = function (state) { return state.name === ''; }; - function parentBuilder(state) { - if (isRoot(state)) - return null; - return matcher.find(self.parentName(state)) || root(); - } - this.builders = { - name: [nameBuilder], - self: [selfBuilder], - parent: [parentBuilder], - data: [dataBuilder], - // Build a URLMatcher if necessary, either via a relative or absolute URL - url: [getUrlBuilder(urlMatcherFactory, root)], - // Keep track of the closest ancestor state that has a URL (i.e. is navigable) - navigable: [getNavigableBuilder(isRoot)], - params: [getParamsBuilder(urlMatcherFactory.paramFactory)], - // Each framework-specific ui-router implementation should define its own `views` builder - // e.g., src/ng1/statebuilders/views.ts - views: [], - // Keep a full path from the root down to this state as this is needed for state activation. - path: [pathBuilder], - // Speed up $state.includes() as it's used a lot - includes: [includesBuilder], - resolvables: [resolvablesBuilder], - }; - } - StateBuilder.prototype.builder = function (name, fn) { - var builders = this.builders; - var array = builders[name] || []; - // Backwards compat: if only one builder exists, return it, else return whole arary. - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(name) && !(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(fn)) - return array.length > 1 ? array : array[0]; - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(name) || !(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction)(fn)) - return; - builders[name] = array; - builders[name].push(fn); - return function () { return builders[name].splice(builders[name].indexOf(fn, 1)) && null; }; - }; - /** - * Builds all of the properties on an essentially blank State object, returning a State object which has all its - * properties and API built. - * - * @param state an uninitialized State object - * @returns the built State object - */ - StateBuilder.prototype.build = function (state) { - var _a = this, matcher = _a.matcher, builders = _a.builders; - var parent = this.parentName(state); - if (parent && !matcher.find(parent, undefined, false)) { - return null; - } - for (var key in builders) { - if (!builders.hasOwnProperty(key)) - continue; - var chain = builders[key].reduce(function (parentFn, step) { return function (_state) { return step(_state, parentFn); }; }, _common_common__WEBPACK_IMPORTED_MODULE_0__.noop); - state[key] = chain(state); - } - return state; - }; - StateBuilder.prototype.parentName = function (state) { - // name = 'foo.bar.baz.**' - var name = state.name || ''; - // segments = ['foo', 'bar', 'baz', '.**'] - var segments = name.split('.'); - // segments = ['foo', 'bar', 'baz'] - var lastSegment = segments.pop(); - // segments = ['foo', 'bar'] (ignore .** segment for future states) - if (lastSegment === '**') - segments.pop(); - if (segments.length) { - if (state.parent) { - throw new Error("States that specify the 'parent:' property should not have a '.' in their name (" + name + ")"); - } - // 'foo.bar' - return segments.join('.'); - } - if (!state.parent) - return ''; - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(state.parent) ? state.parent : state.parent.name; - }; - StateBuilder.prototype.name = function (state) { - var name = state.name; - if (name.indexOf('.') !== -1 || !state.parent) - return name; - var parentName = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(state.parent) ? state.parent : state.parent.name; - return parentName ? parentName + '.' + name : name; - }; - return StateBuilder; -}()); - -//# sourceMappingURL=stateBuilder.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateMatcher": () => (/* binding */ StateMatcher) -/* harmony export */ }); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_safeConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/safeConsole */ "./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"); - - - -var StateMatcher = /** @class */ (function () { - function StateMatcher(_states) { - this._states = _states; - } - StateMatcher.prototype.isRelative = function (stateName) { - stateName = stateName || ''; - return stateName.indexOf('.') === 0 || stateName.indexOf('^') === 0; - }; - StateMatcher.prototype.find = function (stateOrName, base, matchGlob) { - if (matchGlob === void 0) { matchGlob = true; } - if (!stateOrName && stateOrName !== '') - return undefined; - var isStr = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(stateOrName); - var name = isStr ? stateOrName : stateOrName.name; - if (this.isRelative(name)) - name = this.resolvePath(name, base); - var state = this._states[name]; - if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) { - return state; - } - else if (isStr && matchGlob) { - var _states = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.values)(this._states); - var matches = _states.filter(function (_state) { return _state.__stateObjectCache.nameGlob && _state.__stateObjectCache.nameGlob.matches(name); }); - if (matches.length > 1) { - _common_safeConsole__WEBPACK_IMPORTED_MODULE_2__.safeConsole.error("stateMatcher.find: Found multiple matches for " + name + " using glob: ", matches.map(function (match) { return match.name; })); - } - return matches[0]; - } - return undefined; - }; - StateMatcher.prototype.resolvePath = function (name, base) { - if (!base) - throw new Error("No reference point given for path '" + name + "'"); - var baseState = this.find(base); - var splitName = name.split('.'); - var pathLength = splitName.length; - var i = 0, current = baseState; - for (; i < pathLength; i++) { - if (splitName[i] === '' && i === 0) { - current = baseState; - continue; - } - if (splitName[i] === '^') { - if (!current.parent) - throw new Error("Path '" + name + "' not valid for state '" + baseState.name + "'"); - current = current.parent; - continue; - } - break; - } - var relName = splitName.slice(i).join('.'); - return current.name + (current.name && relName ? '.' : '') + relName; - }; - return StateMatcher; -}()); - -//# sourceMappingURL=stateMatcher.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/stateObject.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/stateObject.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateObject": () => (/* binding */ StateObject) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_glob__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/glob */ "./node_modules/@uirouter/core/lib-esm/common/glob.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); - - - - -/** - * Internal representation of a UI-Router state. - * - * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]]. - * - * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object. - * - * This class prototypally inherits from the corresponding [[StateDeclaration]]. - * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]]. - */ -var StateObject = /** @class */ (function () { - /** @deprecated use State.create() */ - function StateObject(config) { - return StateObject.create(config || {}); - } - /** - * Create a state object to put the private/internal implementation details onto. - * The object's prototype chain looks like: - * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...) - * - * @param stateDecl the user-supplied State Declaration - * @returns {StateObject} an internal State object - */ - StateObject.create = function (stateDecl) { - stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl; - var state = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)(stateDecl, StateObject.prototype)); - stateDecl.$$state = function () { return state; }; - state.self = stateDecl; - state.__stateObjectCache = { - nameGlob: _common_glob__WEBPACK_IMPORTED_MODULE_2__.Glob.fromString(state.name), - }; - return state; - }; - /** - * Returns true if the provided parameter is the same state. - * - * Compares the identity of the state against the passed value, which is either an object - * reference to the actual `State` instance, the original definition object passed to - * `$stateProvider.state()`, or the fully-qualified name. - * - * @param ref Can be one of (a) a `State` instance, (b) an object that was passed - * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string. - * @returns Returns `true` if `ref` matches the current `State` instance. - */ - StateObject.prototype.is = function (ref) { - return this === ref || this.self === ref || this.fqn() === ref; - }; - /** - * @deprecated this does not properly handle dot notation - * @returns Returns a dot-separated name of the state. - */ - StateObject.prototype.fqn = function () { - if (!this.parent || !(this.parent instanceof this.constructor)) - return this.name; - var name = this.parent.fqn(); - return name ? name + '.' + this.name : this.name; - }; - /** - * Returns the root node of this state's tree. - * - * @returns The root of this state's tree. - */ - StateObject.prototype.root = function () { - return (this.parent && this.parent.root()) || this; - }; - /** - * Gets the state's `Param` objects - * - * Gets the list of [[Param]] objects owned by the state. - * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects. - * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object - * - * @param opts options - */ - StateObject.prototype.parameters = function (opts) { - opts = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(opts, { inherit: true, matchingKeys: null }); - var inherited = (opts.inherit && this.parent && this.parent.parameters()) || []; - return inherited - .concat((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)(this.params)) - .filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); }); - }; - /** - * Returns a single [[Param]] that is owned by the state - * - * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s. - * @param id the name of the [[Param]] to return - * @param opts options - */ - StateObject.prototype.parameter = function (id, opts) { - if (opts === void 0) { opts = {}; } - return ((this.url && this.url.parameter(id, opts)) || - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)(this.params), (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('id', id)) || - (opts.inherit && this.parent && this.parent.parameter(id))); - }; - StateObject.prototype.toString = function () { - return this.fqn(); - }; - /** Predicate which returns true if the object is an class with @State() decorator */ - StateObject.isStateClass = function (stateDecl) { - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isFunction)(stateDecl) && stateDecl['__uiRouterState'] === true; - }; - /** Predicate which returns true if the object is a [[StateDeclaration]] object */ - StateObject.isStateDeclaration = function (obj) { return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isFunction)(obj['$$state']); }; - /** Predicate which returns true if the object is an internal [[StateObject]] object */ - StateObject.isState = function (obj) { return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isObject)(obj['__stateObjectCache']); }; - return StateObject; -}()); - -//# sourceMappingURL=stateObject.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js": -/*!************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateQueueManager": () => (/* binding */ StateQueueManager) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _stateObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stateObject */ "./node_modules/@uirouter/core/lib-esm/state/stateObject.js"); - - -var StateQueueManager = /** @class */ (function () { - function StateQueueManager(router, states, builder, listeners) { - this.router = router; - this.states = states; - this.builder = builder; - this.listeners = listeners; - this.queue = []; - } - StateQueueManager.prototype.dispose = function () { - this.queue = []; - }; - StateQueueManager.prototype.register = function (stateDecl) { - var queue = this.queue; - var state = _stateObject__WEBPACK_IMPORTED_MODULE_1__.StateObject.create(stateDecl); - var name = state.name; - if (!(0,_common__WEBPACK_IMPORTED_MODULE_0__.isString)(name)) - throw new Error('State must have a valid name'); - if (this.states.hasOwnProperty(name) || (0,_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(queue.map((0,_common__WEBPACK_IMPORTED_MODULE_0__.prop)('name')), name)) - throw new Error("State '" + name + "' is already defined"); - queue.push(state); - this.flush(); - return state; - }; - StateQueueManager.prototype.flush = function () { - var _this = this; - var _a = this, queue = _a.queue, states = _a.states, builder = _a.builder; - var registered = [], // states that got registered - orphans = [], // states that don't yet have a parent registered - previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered - var getState = function (name) { return _this.states.hasOwnProperty(name) && _this.states[name]; }; - var notifyListeners = function () { - if (registered.length) { - _this.listeners.forEach(function (listener) { - return listener('registered', registered.map(function (s) { return s.self; })); - }); - } - }; - while (queue.length > 0) { - var state = queue.shift(); - var name_1 = state.name; - var result = builder.build(state); - var orphanIdx = orphans.indexOf(state); - if (result) { - var existingState = getState(name_1); - if (existingState && existingState.name === name_1) { - throw new Error("State '" + name_1 + "' is already defined"); - } - var existingFutureState = getState(name_1 + '.**'); - if (existingFutureState) { - // Remove future state of the same name - this.router.stateRegistry.deregister(existingFutureState); - } - states[name_1] = state; - this.attachRoute(state); - if (orphanIdx >= 0) - orphans.splice(orphanIdx, 1); - registered.push(state); - continue; - } - var prev = previousQueueLength[name_1]; - previousQueueLength[name_1] = queue.length; - if (orphanIdx >= 0 && prev === queue.length) { - // Wait until two consecutive iterations where no additional states were dequeued successfully. - // throw new Error(`Cannot register orphaned state '${name}'`); - queue.push(state); - notifyListeners(); - return states; - } - else if (orphanIdx < 0) { - orphans.push(state); - } - queue.push(state); - } - notifyListeners(); - return states; - }; - StateQueueManager.prototype.attachRoute = function (state) { - if (state.abstract || !state.url) - return; - var rulesApi = this.router.urlService.rules; - rulesApi.rule(rulesApi.urlRuleFactory.create(state)); - }; - return StateQueueManager; -}()); - -//# sourceMappingURL=stateQueueManager.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js": -/*!********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js ***! - \********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateRegistry": () => (/* binding */ StateRegistry) -/* harmony export */ }); -/* harmony import */ var _stateMatcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./stateMatcher */ "./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"); -/* harmony import */ var _stateBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stateBuilder */ "./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"); -/* harmony import */ var _stateQueueManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateQueueManager */ "./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); - - - - - -/** - * A registry for all of the application's [[StateDeclaration]]s - * - * This API is found at `router.stateRegistry` ([[UIRouter.stateRegistry]]) - */ -var StateRegistry = /** @class */ (function () { - /** @internal */ - function StateRegistry(router) { - this.router = router; - this.states = {}; - /** @internal */ - this.listeners = []; - this.matcher = new _stateMatcher__WEBPACK_IMPORTED_MODULE_0__.StateMatcher(this.states); - this.builder = new _stateBuilder__WEBPACK_IMPORTED_MODULE_1__.StateBuilder(this.matcher, router.urlMatcherFactory); - this.stateQueue = new _stateQueueManager__WEBPACK_IMPORTED_MODULE_2__.StateQueueManager(router, this.states, this.builder, this.listeners); - this._registerRoot(); - } - /** @internal */ - StateRegistry.prototype._registerRoot = function () { - var rootStateDef = { - name: '', - url: '^', - views: null, - params: { - '#': { value: null, type: 'hash', dynamic: true }, - }, - abstract: true, - }; - var _root = (this._root = this.stateQueue.register(rootStateDef)); - _root.navigable = null; - }; - /** @internal */ - StateRegistry.prototype.dispose = function () { - var _this = this; - this.stateQueue.dispose(); - this.listeners = []; - this.get().forEach(function (state) { return _this.get(state) && _this.deregister(state); }); - }; - /** - * Listen for a State Registry events - * - * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry. - * - * #### Example: - * ```js - * let allStates = registry.get(); - * - * // Later, invoke deregisterFn() to remove the listener - * let deregisterFn = registry.onStatesChanged((event, states) => { - * switch(event) { - * case: 'registered': - * states.forEach(state => allStates.push(state)); - * break; - * case: 'deregistered': - * states.forEach(state => { - * let idx = allStates.indexOf(state); - * if (idx !== -1) allStates.splice(idx, 1); - * }); - * break; - * } - * }); - * ``` - * - * @param listener a callback function invoked when the registered states changes. - * The function receives two parameters, `event` and `state`. - * See [[StateRegistryListener]] - * @return a function that deregisters the listener - */ - StateRegistry.prototype.onStatesChanged = function (listener) { - this.listeners.push(listener); - return function deregisterListener() { - (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.removeFrom)(this.listeners)(listener); - }.bind(this); - }; - /** - * Gets the implicit root state - * - * Gets the root of the state tree. - * The root state is implicitly created by UI-Router. - * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]] - * - * @return the root [[StateObject]] - */ - StateRegistry.prototype.root = function () { - return this._root; - }; - /** - * Adds a state to the registry - * - * Registers a [[StateDeclaration]] or queues it for registration. - * - * Note: a state will be queued if the state's parent isn't yet registered. - * - * @param stateDefinition the definition of the state to register. - * @returns the internal [[StateObject]] object. - * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]). - * If the state was only queued, then the object is not fully built. - */ - StateRegistry.prototype.register = function (stateDefinition) { - return this.stateQueue.register(stateDefinition); - }; - /** @internal */ - StateRegistry.prototype._deregisterTree = function (state) { - var _this = this; - var all = this.get().map(function (s) { return s.$$state(); }); - var getChildren = function (states) { - var _children = all.filter(function (s) { return states.indexOf(s.parent) !== -1; }); - return _children.length === 0 ? _children : _children.concat(getChildren(_children)); - }; - var children = getChildren([state]); - var deregistered = [state].concat(children).reverse(); - deregistered.forEach(function (_state) { - var rulesApi = _this.router.urlService.rules; - // Remove URL rule - rulesApi - .rules() - .filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.propEq)('state', _state)) - .forEach(function (rule) { return rulesApi.removeRule(rule); }); - // Remove state from registry - delete _this.states[_state.name]; - }); - return deregistered; - }; - /** - * Removes a state from the registry - * - * This removes a state from the registry. - * If the state has children, they are are also removed from the registry. - * - * @param stateOrName the state's name or object representation - * @returns {StateObject[]} a list of removed states - */ - StateRegistry.prototype.deregister = function (stateOrName) { - var _state = this.get(stateOrName); - if (!_state) - throw new Error("Can't deregister state; not found: " + stateOrName); - var deregisteredStates = this._deregisterTree(_state.$$state()); - this.listeners.forEach(function (listener) { - return listener('deregistered', deregisteredStates.map(function (s) { return s.self; })); - }); - return deregisteredStates; - }; - StateRegistry.prototype.get = function (stateOrName, base) { - var _this = this; - if (arguments.length === 0) - return Object.keys(this.states).map(function (name) { return _this.states[name].self; }); - var found = this.matcher.find(stateOrName, base); - return (found && found.self) || null; - }; - /** - * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`). - * More than one BuilderFunction can be registered for a given property. - * - * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects. - * - * @param property The name of the State property being registered for. - * @param builderFunction The BuilderFunction which will be used to build the State property - * @returns a function which deregisters the BuilderFunction - */ - StateRegistry.prototype.decorator = function (property, builderFunction) { - return this.builder.builder(property, builderFunction); - }; - return StateRegistry; -}()); - -//# sourceMappingURL=stateRegistry.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/stateService.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/stateService.js ***! - \*******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "StateService": () => (/* binding */ StateService) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/queue */ "./node_modules/@uirouter/core/lib-esm/common/queue.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _path_pathUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../path/pathUtils */ "./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"); -/* harmony import */ var _path_pathNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../path/pathNode */ "./node_modules/@uirouter/core/lib-esm/path/pathNode.js"); -/* harmony import */ var _transition_transitionService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../transition/transitionService */ "./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"); -/* harmony import */ var _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../transition/rejectFactory */ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"); -/* harmony import */ var _targetState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./targetState */ "./node_modules/@uirouter/core/lib-esm/state/targetState.js"); -/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../params/param */ "./node_modules/@uirouter/core/lib-esm/params/param.js"); -/* harmony import */ var _common_glob__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/glob */ "./node_modules/@uirouter/core/lib-esm/common/glob.js"); -/* harmony import */ var _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../resolve/resolveContext */ "./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"); -/* harmony import */ var _hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../hooks/lazyLoad */ "./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); - - - - - - - - - - - - - - -/** - * Provides services related to ui-router states. - * - * This API is located at `router.stateService` ([[UIRouter.stateService]]) - */ -var StateService = /** @class */ (function () { - /** @internal */ - function StateService(/** @internal */ router) { - this.router = router; - /** @internal */ - this.invalidCallbacks = []; - /** @internal */ - this._defaultErrorHandler = function $defaultErrorHandler($error$) { - if ($error$ instanceof Error && $error$.stack) { - console.error($error$); - console.error($error$.stack); - } - else if ($error$ instanceof _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection) { - console.error($error$.toString()); - if ($error$.detail && $error$.detail.stack) - console.error($error$.detail.stack); - } - else { - console.error($error$); - } - }; - var getters = ['current', '$current', 'params', 'transition']; - var boundFns = Object.keys(StateService.prototype).filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_13__.not)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(getters))); - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)((0,_common_hof__WEBPACK_IMPORTED_MODULE_13__.val)(StateService.prototype), this, (0,_common_hof__WEBPACK_IMPORTED_MODULE_13__.val)(this), boundFns); - } - Object.defineProperty(StateService.prototype, "transition", { - /** - * The [[Transition]] currently in progress (or null) - * - * @deprecated This is a passthrough through to [[UIRouterGlobals.transition]] - */ - get: function () { - return this.router.globals.transition; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(StateService.prototype, "params", { - /** - * The latest successful state parameters - * - * @deprecated This is a passthrough through to [[UIRouterGlobals.params]] - */ - get: function () { - return this.router.globals.params; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(StateService.prototype, "current", { - /** - * The current [[StateDeclaration]] - * - * @deprecated This is a passthrough through to [[UIRouterGlobals.current]] - */ - get: function () { - return this.router.globals.current; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(StateService.prototype, "$current", { - /** - * The current [[StateObject]] (an internal API) - * - * @deprecated This is a passthrough through to [[UIRouterGlobals.$current]] - */ - get: function () { - return this.router.globals.$current; - }, - enumerable: false, - configurable: true - }); - /** @internal */ - StateService.prototype.dispose = function () { - this.defaultErrorHandler(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop); - this.invalidCallbacks = []; - }; - /** - * Handler for when [[transitionTo]] is called with an invalid state. - * - * Invokes the [[onInvalid]] callbacks, in natural order. - * Each callback's return value is checked in sequence until one of them returns an instance of TargetState. - * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises. - * - * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned. - * - * @internal - */ - StateService.prototype._handleInvalidTargetState = function (fromPath, toState) { - var _this = this; - var fromState = _path_pathUtils__WEBPACK_IMPORTED_MODULE_4__.PathUtils.makeTargetState(this.router.stateRegistry, fromPath); - var globals = this.router.globals; - var latestThing = function () { return globals.transitionHistory.peekTail(); }; - var latest = latestThing(); - var callbackQueue = new _common_queue__WEBPACK_IMPORTED_MODULE_2__.Queue(this.invalidCallbacks.slice()); - var injector = new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_11__.ResolveContext(fromPath).injector(); - var checkForRedirect = function (result) { - if (!(result instanceof _targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState)) { - return; - } - var target = result; - // Recreate the TargetState, in case the state is now defined. - target = _this.target(target.identifier(), target.params(), target.options()); - if (!target.valid()) { - return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.invalid(target.error()).toPromise(); - } - if (latestThing() !== latest) { - return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.superseded().toPromise(); - } - return _this.transitionTo(target.identifier(), target.params(), target.options()); - }; - function invokeNextCallback() { - var nextCallback = callbackQueue.dequeue(); - if (nextCallback === undefined) - return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.invalid(toState.error()).toPromise(); - var callbackResult = _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.when(nextCallback(toState, fromState, injector)); - return callbackResult.then(checkForRedirect).then(function (result) { return result || invokeNextCallback(); }); - } - return invokeNextCallback(); - }; - /** - * Registers an Invalid State handler - * - * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]] - * has been called with an invalid state reference parameter - * - * Example: - * ```js - * stateService.onInvalid(function(to, from, injector) { - * if (to.name() === 'foo') { - * let lazyLoader = injector.get('LazyLoadService'); - * return lazyLoader.load('foo') - * .then(() => stateService.target('foo')); - * } - * }); - * ``` - * - * @param {function} callback invoked when the toState is invalid - * This function receives the (invalid) toState, the fromState, and an injector. - * The function may optionally return a [[TargetState]] or a Promise for a TargetState. - * If one is returned, it is treated as a redirect. - * - * @returns a function which deregisters the callback - */ - StateService.prototype.onInvalid = function (callback) { - this.invalidCallbacks.push(callback); - return function deregisterListener() { - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(this.invalidCallbacks)(callback); - }.bind(this); - }; - /** - * Reloads the current state - * - * A method that force reloads the current state, or a partial state hierarchy. - * All resolves are re-resolved, and components reinstantiated. - * - * #### Example: - * ```js - * let app angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.reload = function(){ - * $state.reload(); - * } - * }); - * ``` - * - * Note: `reload()` is just an alias for: - * - * ```js - * $state.transitionTo($state.current, $state.params, { - * reload: true, inherit: false - * }); - * ``` - * - * @param reloadState A state name or a state object. - * If present, this state and all its children will be reloaded, but ancestors will not reload. - * - * #### Example: - * ```js - * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' - * //and current state is 'contacts.detail.item' - * let app angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.reload = function(){ - * //will reload 'contact.detail' and nested 'contact.detail.item' states - * $state.reload('contact.detail'); - * } - * }); - * ``` - * - * @returns A promise representing the state of the new transition. See [[StateService.go]] - */ - StateService.prototype.reload = function (reloadState) { - return this.transitionTo(this.current, this.params, { - reload: (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(reloadState) ? reloadState : true, - inherit: false, - notify: false, - }); - }; - /** - * Transition to a different state and/or parameters - * - * Convenience method for transitioning to a new state. - * - * `$state.go` calls `$state.transitionTo` internally but automatically sets options to - * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`. - * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`). - * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters - * inherit from the current parameter values (because of `inherit: true`). - * - * #### Example: - * ```js - * let app = angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.changeState = function () { - * $state.go('contact.detail'); - * }; - * }); - * ``` - * - * @param to Absolute state name, state object, or relative state path (relative to current state). - * - * Some examples: - * - * - `$state.go('contact.detail')` - will go to the `contact.detail` state - * - `$state.go('^')` - will go to the parent state - * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state - * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state - * - * @param params A map of the parameters that will be sent to the state, will populate $stateParams. - * - * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`). - * This allows, for example, going to a sibling state that shares parameters defined by a parent state. - * - * @param options Transition options - * - * @returns {promise} A promise representing the state of the new transition. - */ - StateService.prototype.go = function (to, params, options) { - var defautGoOpts = { relative: this.$current, inherit: true }; - var transOpts = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, defautGoOpts, _transition_transitionService__WEBPACK_IMPORTED_MODULE_6__.defaultTransOpts); - return this.transitionTo(to, params, transOpts); - }; - /** - * Creates a [[TargetState]] - * - * This is a factory method for creating a TargetState - * - * This may be returned from a Transition Hook to redirect a transition, for example. - */ - StateService.prototype.target = function (identifier, params, options) { - if (options === void 0) { options = {}; } - // If we're reloading, find the state object to reload from - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isObject)(options.reload) && !options.reload.name) - throw new Error('Invalid reload state object'); - var reg = this.router.stateRegistry; - options.reloadState = - options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative); - if (options.reload && !options.reloadState) - throw new Error("No such reload state '" + ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(options.reload) ? options.reload : options.reload.name) + "'"); - return new _targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState(this.router.stateRegistry, identifier, params, options); - }; - /** @internal */ - StateService.prototype.getCurrentPath = function () { - var _this = this; - var globals = this.router.globals; - var latestSuccess = globals.successfulTransitions.peekTail(); - var rootPath = function () { return [new _path_pathNode__WEBPACK_IMPORTED_MODULE_5__.PathNode(_this.router.stateRegistry.root())]; }; - return latestSuccess ? latestSuccess.treeChanges().to : rootPath(); - }; - /** - * Low-level method for transitioning to a new state. - * - * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations. - * - * #### Example: - * ```js - * let app = angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.changeState = function () { - * $state.transitionTo('contact.detail'); - * }; - * }); - * ``` - * - * @param to State name or state object. - * @param toParams A map of the parameters that will be sent to the state, - * will populate $stateParams. - * @param options Transition options - * - * @returns A promise representing the state of the new transition. See [[go]] - */ - StateService.prototype.transitionTo = function (to, toParams, options) { - var _this = this; - if (toParams === void 0) { toParams = {}; } - if (options === void 0) { options = {}; } - var router = this.router; - var globals = router.globals; - options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, _transition_transitionService__WEBPACK_IMPORTED_MODULE_6__.defaultTransOpts); - var getCurrent = function () { return globals.transition; }; - options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(options, { current: getCurrent }); - var ref = this.target(to, toParams, options); - var currentPath = this.getCurrentPath(); - if (!ref.exists()) - return this._handleInvalidTargetState(currentPath, ref); - if (!ref.valid()) - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.silentRejection)(ref.error()); - if (options.supercede === false && getCurrent()) { - return (_transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.ignored('Another transition is in progress and supercede has been set to false in TransitionOptions for the transition. So the transition was ignored in favour of the existing one in progress.').toPromise()); - } - /** - * Special handling for Ignored, Aborted, and Redirected transitions - * - * The semantics for the transition.run() promise and the StateService.transitionTo() - * promise differ. For instance, the run() promise may be rejected because it was - * IGNORED, but the transitionTo() promise is resolved because from the user perspective - * no error occurred. Likewise, the transition.run() promise may be rejected because of - * a Redirect, but the transitionTo() promise is chained to the new Transition's promise. - */ - var rejectedTransitionHandler = function (trans) { return function (error) { - if (error instanceof _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection) { - var isLatest = router.globals.lastStartedTransitionId <= trans.$id; - if (error.type === _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.RejectType.IGNORED) { - isLatest && router.urlRouter.update(); - // Consider ignored `Transition.run()` as a successful `transitionTo` - return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.when(globals.current); - } - var detail = error.detail; - if (error.type === _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.RejectType.SUPERSEDED && error.redirected && detail instanceof _targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState) { - // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully - // by returning the promise for the new (redirect) `Transition.run()`. - var redirect = trans.redirect(detail); - return redirect.run().catch(rejectedTransitionHandler(redirect)); - } - if (error.type === _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.RejectType.ABORTED) { - isLatest && router.urlRouter.update(); - return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.reject(error); - } - } - var errorHandler = _this.defaultErrorHandler(); - errorHandler(error); - return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.reject(error); - }; }; - var transition = this.router.transitionService.create(currentPath, ref); - var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition)); - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.silenceUncaughtInPromise)(transitionToPromise); // issue #2676 - // Return a promise for the transition, which also has the transition object on it. - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(transitionToPromise, { transition: transition }); - }; - /** - * Checks if the current state *is* the provided state - * - * Similar to [[includes]] but only checks for the full state name. - * If params is supplied then it will be tested for strict equality against the current - * active params object, so all params must match with none missing and no extras. - * - * #### Example: - * ```js - * $state.$current.name = 'contacts.details.item'; - * - * // absolute name - * $state.is('contact.details.item'); // returns true - * $state.is(contactDetailItemStateObject); // returns true - * ``` - * - * // relative name (. and ^), typically from a template - * // E.g. from the 'contacts.details' template - * ```html - *
    Item
    - * ``` - * - * @param stateOrName The state name (absolute or relative) or state object you'd like to check. - * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like - * to test against the current active state. - * @param options An options object. The options are: - * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will - * test relative to `options.relative` state (or name). - * - * @returns Returns true if it is the state. - */ - StateService.prototype.is = function (stateOrName, params, options) { - options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { relative: this.$current }); - var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative); - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(state)) - return undefined; - if (this.$current !== state) - return false; - if (!params) - return true; - var schema = state.parameters({ inherit: true, matchingKeys: params }); - return _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.equals(schema, _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.values(schema, params), this.params); - }; - /** - * Checks if the current state *includes* the provided state - * - * A method to determine if the current active state is equal to or is the child of the - * state stateName. If any params are passed then they will be tested for a match as well. - * Not all the parameters need to be passed, just the ones you'd like to test for equality. - * - * #### Example when `$state.$current.name === 'contacts.details.item'` - * ```js - * // Using partial names - * $state.includes("contacts"); // returns true - * $state.includes("contacts.details"); // returns true - * $state.includes("contacts.details.item"); // returns true - * $state.includes("contacts.list"); // returns false - * $state.includes("about"); // returns false - * ``` - * - * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`: - * ```js - * $state.includes("*.details.*.*"); // returns true - * $state.includes("*.details.**"); // returns true - * $state.includes("**.item.**"); // returns true - * $state.includes("*.details.item.url"); // returns true - * $state.includes("*.details.*.url"); // returns true - * $state.includes("*.details.*"); // returns false - * $state.includes("item.**"); // returns false - * ``` - * - * @param stateOrName A partial name, relative name, glob pattern, - * or state object to be searched for within the current state name. - * @param params A param object, e.g. `{sectionId: section.id}`, - * that you'd like to test against the current active state. - * @param options An options object. The options are: - * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will - * test relative to `options.relative` state (or name). - * - * @returns {boolean} Returns true if it does include the state - */ - StateService.prototype.includes = function (stateOrName, params, options) { - options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { relative: this.$current }); - var glob = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(stateOrName) && _common_glob__WEBPACK_IMPORTED_MODULE_10__.Glob.fromString(stateOrName); - if (glob) { - if (!glob.matches(this.$current.name)) - return false; - stateOrName = this.$current.name; - } - var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes; - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(state)) - return undefined; - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(include[state.name])) - return false; - if (!params) - return true; - var schema = state.parameters({ inherit: true, matchingKeys: params }); - return _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.equals(schema, _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.values(schema, params), this.params); - }; - /** - * Generates a URL for a state and parameters - * - * Returns the url for the given state populated with the given params. - * - * #### Example: - * ```js - * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob"); - * ``` - * - * @param stateOrName The state name or state object you'd like to generate a url from. - * @param params An object of parameter values to fill the state's required parameters. - * @param options Options object. The options are: - * - * @returns {string} compiled state url - */ - StateService.prototype.href = function (stateOrName, params, options) { - var defaultHrefOpts = { - lossy: true, - inherit: true, - absolute: false, - relative: this.$current, - }; - options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, defaultHrefOpts); - params = params || {}; - var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative); - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(state)) - return null; - if (options.inherit) - params = this.params.$inherit(params, this.$current, state); - var nav = state && options.lossy ? state.navigable : state; - if (!nav || nav.url === undefined || nav.url === null) { - return null; - } - return this.router.urlRouter.href(nav.url, params, { absolute: options.absolute }); - }; - /** - * Sets or gets the default [[transitionTo]] error handler. - * - * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition. - * This includes errors caused by resolves and transition hooks. - * - * Note: - * This handler does not receive certain Transition rejections. - * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]]. - * - * The built-in default error handler logs the error to the console. - * - * You can provide your own custom handler. - * - * #### Example: - * ```js - * stateService.defaultErrorHandler(function() { - * // Do not log transitionTo errors - * }); - * ``` - * - * @param handler a global error handler function - * @returns the current global error handler - */ - StateService.prototype.defaultErrorHandler = function (handler) { - return (this._defaultErrorHandler = handler || this._defaultErrorHandler); - }; - StateService.prototype.get = function (stateOrName, base) { - var reg = this.router.stateRegistry; - if (arguments.length === 0) - return reg.get(); - return reg.get(stateOrName, base || this.$current); - }; - /** - * Lazy loads a state - * - * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function. - * - * @param stateOrName the state that should be lazy loaded - * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc) - * Note: If no transition is provided, a noop transition is created using the from the current state to the current state. - * This noop transition is not actually run. - * - * @returns a promise to lazy load - */ - StateService.prototype.lazyLoad = function (stateOrName, transition) { - var state = this.get(stateOrName); - if (!state || !state.lazyLoad) - throw new Error('Can not lazy load ' + stateOrName); - var currentPath = this.getCurrentPath(); - var target = _path_pathUtils__WEBPACK_IMPORTED_MODULE_4__.PathUtils.makeTargetState(this.router.stateRegistry, currentPath); - transition = transition || this.router.transitionService.create(currentPath, target); - return (0,_hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_12__.lazyLoadState)(transition, state); - }; - return StateService; -}()); - -//# sourceMappingURL=stateService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/state/targetState.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/state/targetState.js ***! - \******************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TargetState": () => (/* binding */ TargetState) -/* harmony export */ }); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - - -/** - * Encapsulate the target (destination) state/params/options of a [[Transition]]. - * - * This class is frequently used to redirect a transition to a new destination. - * - * See: - * - * - [[HookResult]] - * - [[TransitionHookFn]] - * - [[TransitionService.onStart]] - * - * To create a `TargetState`, use [[StateService.target]]. - * - * --- - * - * This class wraps: - * - * 1) an identifier for a state - * 2) a set of parameters - * 3) and transition options - * 4) the registered state object (the [[StateDeclaration]]) - * - * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can - * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string). - * The `TargetState` class normalizes those options. - * - * A `TargetState` may be valid (the state being targeted exists in the registry) - * or invalid (the state being targeted is not registered). - */ -var TargetState = /** @class */ (function () { - /** - * The TargetState constructor - * - * Note: Do not construct a `TargetState` manually. - * To create a `TargetState`, use the [[StateService.target]] factory method. - * - * @param _stateRegistry The StateRegistry to use to look up the _definition - * @param _identifier An identifier for a state. - * Either a fully-qualified state name, or the object used to define the state. - * @param _params Parameters for the target state - * @param _options Transition options. - * - * @internal - */ - function TargetState(_stateRegistry, _identifier, _params, _options) { - this._stateRegistry = _stateRegistry; - this._identifier = _identifier; - this._identifier = _identifier; - this._params = (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, _params || {}); - this._options = (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, _options || {}); - this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative); - } - /** The name of the state this object targets */ - TargetState.prototype.name = function () { - return (this._definition && this._definition.name) || this._identifier; - }; - /** The identifier used when creating this TargetState */ - TargetState.prototype.identifier = function () { - return this._identifier; - }; - /** The target parameter values */ - TargetState.prototype.params = function () { - return this._params; - }; - /** The internal state object (if it was found) */ - TargetState.prototype.$state = function () { - return this._definition; - }; - /** The internal state declaration (if it was found) */ - TargetState.prototype.state = function () { - return this._definition && this._definition.self; - }; - /** The target options */ - TargetState.prototype.options = function () { - return this._options; - }; - /** True if the target state was found */ - TargetState.prototype.exists = function () { - return !!(this._definition && this._definition.self); - }; - /** True if the object is valid */ - TargetState.prototype.valid = function () { - return !this.error(); - }; - /** If the object is invalid, returns the reason why */ - TargetState.prototype.error = function () { - var base = this.options().relative; - if (!this._definition && !!base) { - var stateName = base.name ? base.name : base; - return "Could not resolve '" + this.name() + "' from state '" + stateName + "'"; - } - if (!this._definition) - return "No such state '" + this.name() + "'"; - if (!this._definition.self) - return "State '" + this.name() + "' has an invalid definition"; - }; - TargetState.prototype.toString = function () { - return "'" + this.name() + "'" + (0,_common_strings__WEBPACK_IMPORTED_MODULE_1__.stringify)(this.params()); - }; - /** - * Returns a copy of this TargetState which targets a different state. - * The new TargetState has the same parameter values and transition options. - * - * @param state The new state that should be targeted - */ - TargetState.prototype.withState = function (state) { - return new TargetState(this._stateRegistry, state, this._params, this._options); - }; - /** - * Returns a copy of this TargetState, using the specified parameter values. - * - * @param params the new parameter values to use - * @param replace When false (default) the new parameter values will be merged with the current values. - * When true the parameter values will be used instead of the current values. - */ - TargetState.prototype.withParams = function (params, replace) { - if (replace === void 0) { replace = false; } - var newParams = replace ? params : (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, this._params, params); - return new TargetState(this._stateRegistry, this._identifier, newParams, this._options); - }; - /** - * Returns a copy of this TargetState, using the specified Transition Options. - * - * @param options the new options to use - * @param replace When false (default) the new options will be merged with the current options. - * When true the options will be used instead of the current options. - */ - TargetState.prototype.withOptions = function (options, replace) { - if (replace === void 0) { replace = false; } - var newOpts = replace ? options : (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, this._options, options); - return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts); - }; - /** Returns true if the object has a state property that might be a state or state name */ - TargetState.isDef = function (obj) { - return obj && obj.state && ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(obj.state) || ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isObject)(obj.state) && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(obj.state.name))); - }; - return TargetState; -}()); - -//# sourceMappingURL=targetState.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js ***! - \***********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "HookBuilder": () => (/* binding */ HookBuilder) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/transition/interface.js"); -/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transitionHook */ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"); - - - - -/** - * This class returns applicable TransitionHooks for a specific Transition instance. - * - * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g. - * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is - * determined by the type of hook) - * - * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition. - * - * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder - * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private - * in the Transition class, so we must also provide the Transition's _treeChanges) - */ -var HookBuilder = /** @class */ (function () { - function HookBuilder(transition) { - this.transition = transition; - } - HookBuilder.prototype.buildHooksForPhase = function (phase) { - var _this = this; - var $transitions = this.transition.router.transitionService; - return $transitions._pluginapi - ._getEvents(phase) - .map(function (type) { return _this.buildHooks(type); }) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .filter(_common_common__WEBPACK_IMPORTED_MODULE_0__.identity); - }; - /** - * Returns an array of newly built TransitionHook objects. - * - * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]]. - * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s) - * - For each of the [[PathNode]]s, creates a TransitionHook - * - * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'. - */ - HookBuilder.prototype.buildHooks = function (hookType) { - var transition = this.transition; - var treeChanges = transition.treeChanges(); - // Find all the matching registered hooks for a given hook type - var matchingHooks = this.getMatchingHooks(hookType, treeChanges, transition); - if (!matchingHooks) - return []; - var baseHookOptions = { - transition: transition, - current: transition.options().current, - }; - var makeTransitionHooks = function (hook) { - // Fetch the Nodes that caused this hook to match. - var matches = hook.matches(treeChanges, transition); - // Select the PathNode[] that will be used as TransitionHook context objects - var matchingNodes = matches[hookType.criteriaMatchPath.name]; - // Return an array of HookTuples - return matchingNodes.map(function (node) { - var _options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ - bind: hook.bind, - traceData: { hookType: hookType.name, context: node }, - }, baseHookOptions); - var state = hookType.criteriaMatchPath.scope === _interface__WEBPACK_IMPORTED_MODULE_2__.TransitionHookScope.STATE ? node.state.self : null; - var transitionHook = new _transitionHook__WEBPACK_IMPORTED_MODULE_3__.TransitionHook(transition, state, hook, _options); - return { hook: hook, node: node, transitionHook: transitionHook }; - }); - }; - return matchingHooks - .map(makeTransitionHooks) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .sort(tupleSort(hookType.reverseSort)) - .map(function (tuple) { return tuple.transitionHook; }); - }; - /** - * Finds all RegisteredHooks from: - * - The Transition object instance hook registry - * - The TransitionService ($transitions) global hook registry - * - * which matched: - * - the eventType - * - the matchCriteria (to, from, exiting, retained, entering) - * - * @returns an array of matched [[RegisteredHook]]s - */ - HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges, transition) { - var isCreate = hookType.hookPhase === _interface__WEBPACK_IMPORTED_MODULE_2__.TransitionHookPhase.CREATE; - // Instance and Global hook registries - var $transitions = this.transition.router.transitionService; - var registries = isCreate ? [$transitions] : [this.transition, $transitions]; - return registries - .map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries - .filter((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.assertPredicate)(_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray, "broken event named: " + hookType.name)) // Sanity check - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array - .filter(function (hook) { return hook.matches(treeChanges, transition); }); // Only those satisfying matchCriteria - }; - return HookBuilder; -}()); - -/** - * A factory for a sort function for HookTuples. - * - * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares - * the EventHook priority. - * - * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth - * @returns a tuple sort function - */ -function tupleSort(reverseDepthSort) { - if (reverseDepthSort === void 0) { reverseDepthSort = false; } - return function nodeDepthThenPriority(l, r) { - var factor = reverseDepthSort ? -1 : 1; - var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor; - return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority; - }; -} -//# sourceMappingURL=hookBuilder.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js": -/*!************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js ***! - \************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "matchState": () => (/* binding */ matchState), -/* harmony export */ "RegisteredHook": () => (/* binding */ RegisteredHook), -/* harmony export */ "makeEvent": () => (/* binding */ makeEvent) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/transition/interface.js"); - - -/** - * Determines if the given state matches the matchCriteria - * - * @internal - * - * @param state a State Object to test against - * @param criterion - * - If a string, matchState uses the string as a glob-matcher against the state name - * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name - * and returns a positive match if any of the globs match. - * - If a function, matchState calls the function with the state and returns true if the function's result is truthy. - * @returns {boolean} - */ -function matchState(state, criterion, transition) { - var toMatch = (0,_common__WEBPACK_IMPORTED_MODULE_0__.isString)(criterion) ? [criterion] : criterion; - function matchGlobs(_state) { - var globStrings = toMatch; - for (var i = 0; i < globStrings.length; i++) { - var glob = new _common__WEBPACK_IMPORTED_MODULE_0__.Glob(globStrings[i]); - if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) { - return true; - } - } - return false; - } - var matchFn = ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isFunction)(toMatch) ? toMatch : matchGlobs); - return !!matchFn(state, transition); -} -/** - * The registration data for a registered transition hook - */ -var RegisteredHook = /** @class */ (function () { - function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) { - if (options === void 0) { options = {}; } - this.tranSvc = tranSvc; - this.eventType = eventType; - this.callback = callback; - this.matchCriteria = matchCriteria; - this.removeHookFromRegistry = removeHookFromRegistry; - this.invokeCount = 0; - this._deregistered = false; - this.priority = options.priority || 0; - this.bind = options.bind || null; - this.invokeLimit = options.invokeLimit; - } - /** - * Gets the matching [[PathNode]]s - * - * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing - * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes. - * - * Returning `null` is significant to distinguish between the default - * "match-all criterion value" of `true` compared to a `() => true` function, - * when the nodes is an empty array. - * - * This is useful to allow a transition match criteria of `entering: true` - * to still match a transition, even when `entering === []`. Contrast that - * with `entering: (state) => true` which only matches when a state is actually - * being entered. - */ - RegisteredHook.prototype._matchingNodes = function (nodes, criterion, transition) { - if (criterion === true) - return nodes; - var matching = nodes.filter(function (node) { return matchState(node.state, criterion, transition); }); - return matching.length ? matching : null; - }; - /** - * Gets the default match criteria (all `true`) - * - * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.: - * - * ```js - * { - * to: true, - * from: true, - * entering: true, - * exiting: true, - * retained: true, - * } - */ - RegisteredHook.prototype._getDefaultMatchCriteria = function () { - return (0,_common__WEBPACK_IMPORTED_MODULE_0__.mapObj)(this.tranSvc._pluginapi._getPathTypes(), function () { return true; }); - }; - /** - * Gets matching nodes as [[IMatchingNodes]] - * - * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to: - * - * ```js - * let matches: IMatchingNodes = { - * to: _matchingNodes([tail(treeChanges.to)], mc.to), - * from: _matchingNodes([tail(treeChanges.from)], mc.from), - * exiting: _matchingNodes(treeChanges.exiting, mc.exiting), - * retained: _matchingNodes(treeChanges.retained, mc.retained), - * entering: _matchingNodes(treeChanges.entering, mc.entering), - * }; - * ``` - */ - RegisteredHook.prototype._getMatchingNodes = function (treeChanges, transition) { - var _this = this; - var criteria = (0,_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this._getDefaultMatchCriteria(), this.matchCriteria); - var paths = (0,_common__WEBPACK_IMPORTED_MODULE_0__.values)(this.tranSvc._pluginapi._getPathTypes()); - return paths.reduce(function (mn, pathtype) { - // STATE scope criteria matches against every node in the path. - // TRANSITION scope criteria matches against only the last node in the path - var isStateHook = pathtype.scope === _interface__WEBPACK_IMPORTED_MODULE_1__.TransitionHookScope.STATE; - var path = treeChanges[pathtype.name] || []; - var nodes = isStateHook ? path : [(0,_common__WEBPACK_IMPORTED_MODULE_0__.tail)(path)]; - mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name], transition); - return mn; - }, {}); - }; - /** - * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]] - * - * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values - * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering) - */ - RegisteredHook.prototype.matches = function (treeChanges, transition) { - var matches = this._getMatchingNodes(treeChanges, transition); - // Check if all the criteria matched the TreeChanges object - var allMatched = (0,_common__WEBPACK_IMPORTED_MODULE_0__.values)(matches).every(_common__WEBPACK_IMPORTED_MODULE_0__.identity); - return allMatched ? matches : null; - }; - RegisteredHook.prototype.deregister = function () { - this.removeHookFromRegistry(this); - this._deregistered = true; - }; - return RegisteredHook; -}()); - -/** Return a registration function of the requested type. */ -function makeEvent(registry, transitionService, eventType) { - // Create the object which holds the registered transition hooks. - var _registeredHooks = (registry._registeredHooks = registry._registeredHooks || {}); - var hooks = (_registeredHooks[eventType.name] = []); - var removeHookFn = (0,_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(hooks); - // Create hook registration function on the IHookRegistry for the event - registry[eventType.name] = hookRegistrationFn; - function hookRegistrationFn(matchObject, callback, options) { - if (options === void 0) { options = {}; } - var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, removeHookFn, options); - hooks.push(registeredHook); - return registeredHook.deregister.bind(registeredHook); - } - return hookRegistrationFn; -} -//# sourceMappingURL=hookRegistry.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/index.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TransitionHookPhase": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookPhase), -/* harmony export */ "TransitionHookScope": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookScope), -/* harmony export */ "HookBuilder": () => (/* reexport safe */ _hookBuilder__WEBPACK_IMPORTED_MODULE_1__.HookBuilder), -/* harmony export */ "RegisteredHook": () => (/* reexport safe */ _hookRegistry__WEBPACK_IMPORTED_MODULE_2__.RegisteredHook), -/* harmony export */ "makeEvent": () => (/* reexport safe */ _hookRegistry__WEBPACK_IMPORTED_MODULE_2__.makeEvent), -/* harmony export */ "matchState": () => (/* reexport safe */ _hookRegistry__WEBPACK_IMPORTED_MODULE_2__.matchState), -/* harmony export */ "RejectType": () => (/* reexport safe */ _rejectFactory__WEBPACK_IMPORTED_MODULE_3__.RejectType), -/* harmony export */ "Rejection": () => (/* reexport safe */ _rejectFactory__WEBPACK_IMPORTED_MODULE_3__.Rejection), -/* harmony export */ "Transition": () => (/* reexport safe */ _transition__WEBPACK_IMPORTED_MODULE_4__.Transition), -/* harmony export */ "TransitionHook": () => (/* reexport safe */ _transitionHook__WEBPACK_IMPORTED_MODULE_5__.TransitionHook), -/* harmony export */ "TransitionEventType": () => (/* reexport safe */ _transitionEventType__WEBPACK_IMPORTED_MODULE_6__.TransitionEventType), -/* harmony export */ "TransitionService": () => (/* reexport safe */ _transitionService__WEBPACK_IMPORTED_MODULE_7__.TransitionService), -/* harmony export */ "defaultTransOpts": () => (/* reexport safe */ _transitionService__WEBPACK_IMPORTED_MODULE_7__.defaultTransOpts) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/transition/interface.js"); -/* harmony import */ var _hookBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hookBuilder */ "./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js"); -/* harmony import */ var _hookRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hookRegistry */ "./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"); -/* harmony import */ var _rejectFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rejectFactory */ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"); -/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./transition */ "./node_modules/@uirouter/core/lib-esm/transition/transition.js"); -/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transitionHook */ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"); -/* harmony import */ var _transitionEventType__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transitionEventType */ "./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"); -/* harmony import */ var _transitionService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./transitionService */ "./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"); -/** - * # Transition subsystem - * - * This module contains APIs related to a Transition. - * - * See: - * - [[TransitionService]] - * - [[Transition]] - * - [[HookFn]], [[TransitionHookFn]], [[TransitionStateHookFn]], [[HookMatchCriteria]], [[HookResult]] - * - * @packageDocumentation @preferred - */ - - - - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/interface.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/interface.js ***! - \*********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TransitionHookPhase": () => (/* binding */ TransitionHookPhase), -/* harmony export */ "TransitionHookScope": () => (/* binding */ TransitionHookScope) -/* harmony export */ }); -var TransitionHookPhase; -(function (TransitionHookPhase) { - TransitionHookPhase[TransitionHookPhase["CREATE"] = 0] = "CREATE"; - TransitionHookPhase[TransitionHookPhase["BEFORE"] = 1] = "BEFORE"; - TransitionHookPhase[TransitionHookPhase["RUN"] = 2] = "RUN"; - TransitionHookPhase[TransitionHookPhase["SUCCESS"] = 3] = "SUCCESS"; - TransitionHookPhase[TransitionHookPhase["ERROR"] = 4] = "ERROR"; -})(TransitionHookPhase || (TransitionHookPhase = {})); -var TransitionHookScope; -(function (TransitionHookScope) { - TransitionHookScope[TransitionHookScope["TRANSITION"] = 0] = "TRANSITION"; - TransitionHookScope[TransitionHookScope["STATE"] = 1] = "STATE"; -})(TransitionHookScope || (TransitionHookScope = {})); - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js ***! - \*************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "RejectType": () => (/* binding */ RejectType), -/* harmony export */ "Rejection": () => (/* binding */ Rejection) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); - - - - -/** An enum for Transition Rejection reasons */ -var RejectType; -(function (RejectType) { - /** - * A new transition superseded this one. - * - * While this transition was running, a new transition started. - * This transition is cancelled because it was superseded by new transition. - */ - RejectType[RejectType["SUPERSEDED"] = 2] = "SUPERSEDED"; - /** - * The transition was aborted - * - * The transition was aborted by a hook which returned `false` - */ - RejectType[RejectType["ABORTED"] = 3] = "ABORTED"; - /** - * The transition was invalid - * - * The transition was never started because it was invalid - */ - RejectType[RejectType["INVALID"] = 4] = "INVALID"; - /** - * The transition was ignored - * - * The transition was ignored because it would have no effect. - * - * Either: - * - * - The transition is targeting the current state and parameter values - * - The transition is targeting the same state and parameter values as the currently running transition. - */ - RejectType[RejectType["IGNORED"] = 5] = "IGNORED"; - /** - * The transition errored. - * - * This generally means a hook threw an error or returned a rejected promise - */ - RejectType[RejectType["ERROR"] = 6] = "ERROR"; -})(RejectType || (RejectType = {})); - -/** @internal */ -var id = 0; -var Rejection = /** @class */ (function () { - function Rejection(type, message, detail) { - /** @internal */ - this.$id = id++; - this.type = type; - this.message = message; - this.detail = detail; - } - /** Returns true if the obj is a rejected promise created from the `asPromise` factory */ - Rejection.isRejectionPromise = function (obj) { - return obj && typeof obj.then === 'function' && (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Rejection)(obj._transitionRejection); - }; - /** Returns a Rejection due to transition superseded */ - Rejection.superseded = function (detail, options) { - var message = 'The transition has been superseded by a different transition'; - var rejection = new Rejection(RejectType.SUPERSEDED, message, detail); - if (options && options.redirected) { - rejection.redirected = true; - } - return rejection; - }; - /** Returns a Rejection due to redirected transition */ - Rejection.redirected = function (detail) { - return Rejection.superseded(detail, { redirected: true }); - }; - /** Returns a Rejection due to invalid transition */ - Rejection.invalid = function (detail) { - var message = 'This transition is invalid'; - return new Rejection(RejectType.INVALID, message, detail); - }; - /** Returns a Rejection due to ignored transition */ - Rejection.ignored = function (detail) { - var message = 'The transition was ignored'; - return new Rejection(RejectType.IGNORED, message, detail); - }; - /** Returns a Rejection due to aborted transition */ - Rejection.aborted = function (detail) { - var message = 'The transition has been aborted'; - return new Rejection(RejectType.ABORTED, message, detail); - }; - /** Returns a Rejection due to aborted transition */ - Rejection.errored = function (detail) { - var message = 'The transition errored'; - return new Rejection(RejectType.ERROR, message, detail); - }; - /** - * Returns a Rejection - * - * Normalizes a value as a Rejection. - * If the value is already a Rejection, returns it. - * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR). - * - * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection. - */ - Rejection.normalize = function (detail) { - return (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Rejection)(detail) ? detail : Rejection.errored(detail); - }; - Rejection.prototype.toString = function () { - var detailString = function (d) { return (d && d.toString !== Object.prototype.toString ? d.toString() : (0,_common_strings__WEBPACK_IMPORTED_MODULE_1__.stringify)(d)); }; - var detail = detailString(this.detail); - var _a = this, $id = _a.$id, type = _a.type, message = _a.message; - return "Transition Rejection($id: " + $id + " type: " + type + ", message: " + message + ", detail: " + detail + ")"; - }; - Rejection.prototype.toPromise = function () { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.silentRejection)(this), { _transitionRejection: this }); - }; - return Rejection; -}()); - -//# sourceMappingURL=rejectFactory.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/transition.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/transition.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "Transition": () => (/* binding */ Transition) -/* harmony export */ }); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/transition/interface.js"); -/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./transitionHook */ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"); -/* harmony import */ var _hookRegistry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hookRegistry */ "./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"); -/* harmony import */ var _hookBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./hookBuilder */ "./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js"); -/* harmony import */ var _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../path/pathUtils */ "./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"); -/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../params/param */ "./node_modules/@uirouter/core/lib-esm/params/param.js"); -/* harmony import */ var _resolve_resolvable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../resolve/resolvable */ "./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"); -/* harmony import */ var _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../resolve/resolveContext */ "./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"); -/* harmony import */ var _rejectFactory__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rejectFactory */ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - - - - - - // has or is using - - - - - - - - - -/** @internal */ -var stateSelf = (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('self'); -/** - * Represents a transition between two states. - * - * When navigating to a state, we are transitioning **from** the current state **to** the new state. - * - * This object contains all contextual information about the to/from states, parameters, resolves. - * It has information about all states being entered and exited as a result of the transition. - */ -var Transition = /** @class */ (function () { - /** - * Creates a new Transition object. - * - * If the target state is not valid, an error is thrown. - * - * @internal - * - * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath` - * encapsulates the "from state". - * @param targetState The target state and parameters being transitioned to (also, the transition options) - * @param router The [[UIRouter]] instance - * @internal - */ - function Transition(fromPath, targetState, router) { - var _this = this; - /** @internal */ - this._deferred = _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.defer(); - /** - * This promise is resolved or rejected based on the outcome of the Transition. - * - * When the transition is successful, the promise is resolved - * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error - */ - this.promise = this._deferred.promise; - /** @internal Holds the hook registration functions such as those passed to Transition.onStart() */ - this._registeredHooks = {}; - /** @internal */ - this._hookBuilder = new _hookBuilder__WEBPACK_IMPORTED_MODULE_9__.HookBuilder(this); - /** Checks if this transition is currently active/running. */ - this.isActive = function () { return _this.router.globals.transition === _this; }; - this.router = router; - this._targetState = targetState; - if (!targetState.valid()) { - throw new Error(targetState.error()); - } - // current() is assumed to come from targetState.options, but provide a naive implementation otherwise. - this._options = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.extend)({ current: (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.val)(this) }, targetState.options()); - this.$id = router.transitionService._transitionCount++; - var toPath = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.buildToPath(fromPath, targetState); - this._treeChanges = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.treeChanges(fromPath, toPath, this._options.reloadState); - this.createTransitionHookRegFns(); - var onCreateHooks = this._hookBuilder.buildHooksForPhase(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.CREATE); - _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.invokeHooks(onCreateHooks, function () { return null; }); - this.applyViewConfigs(router); - } - /** @internal */ - Transition.prototype.onBefore = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onStart = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onExit = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onRetain = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onEnter = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onFinish = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onSuccess = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - Transition.prototype.onError = function (criteria, callback, options) { - return; - }; - /** @internal - * Creates the transition-level hook registration functions - * (which can then be used to register hooks) - */ - Transition.prototype.createTransitionHookRegFns = function () { - var _this = this; - this.router.transitionService._pluginapi - ._getEvents() - .filter(function (type) { return type.hookPhase !== _interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.CREATE; }) - .forEach(function (type) { return (0,_hookRegistry__WEBPACK_IMPORTED_MODULE_8__.makeEvent)(_this, _this.router.transitionService, type); }); - }; - /** @internal */ - Transition.prototype.getHooks = function (hookName) { - return this._registeredHooks[hookName]; - }; - Transition.prototype.applyViewConfigs = function (router) { - var enteringStates = this._treeChanges.entering.map(function (node) { return node.state; }); - _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates); - }; - /** - * @internal - * @returns the internal from [State] object - */ - Transition.prototype.$from = function () { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.tail)(this._treeChanges.from).state; - }; - /** - * @internal - * @returns the internal to [State] object - */ - Transition.prototype.$to = function () { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.tail)(this._treeChanges.to).state; - }; - /** - * Returns the "from state" - * - * Returns the state that the transition is coming *from*. - * - * @returns The state declaration object for the Transition's ("from state"). - */ - Transition.prototype.from = function () { - return this.$from().self; - }; - /** - * Returns the "to state" - * - * Returns the state that the transition is going *to*. - * - * @returns The state declaration object for the Transition's target state ("to state"). - */ - Transition.prototype.to = function () { - return this.$to().self; - }; - /** - * Gets the Target State - * - * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object. - * - * @returns the [[TargetState]] of this Transition - */ - Transition.prototype.targetState = function () { - return this._targetState; - }; - /** - * Determines whether two transitions are equivalent. - * @deprecated - */ - Transition.prototype.is = function (compare) { - if (compare instanceof Transition) { - // TODO: Also compare parameters - return this.is({ to: compare.$to().name, from: compare.$from().name }); - } - return !((compare.to && !(0,_hookRegistry__WEBPACK_IMPORTED_MODULE_8__.matchState)(this.$to(), compare.to, this)) || - (compare.from && !(0,_hookRegistry__WEBPACK_IMPORTED_MODULE_8__.matchState)(this.$from(), compare.from, this))); - }; - Transition.prototype.params = function (pathname) { - if (pathname === void 0) { pathname = 'to'; } - return Object.freeze(this._treeChanges[pathname].map((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('paramValues')).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.mergeR, {})); - }; - Transition.prototype.paramsChanged = function () { - var fromParams = this.params('from'); - var toParams = this.params('to'); - // All the parameters declared on both the "to" and "from" paths - var allParamDescriptors = [] - .concat(this._treeChanges.to) - .concat(this._treeChanges.from) - .map(function (pathNode) { return pathNode.paramSchema; }) - .reduce(_common__WEBPACK_IMPORTED_MODULE_15__.flattenR, []) - .reduce(_common__WEBPACK_IMPORTED_MODULE_15__.uniqR, []); - var changedParamDescriptors = _params_param__WEBPACK_IMPORTED_MODULE_11__.Param.changed(allParamDescriptors, fromParams, toParams); - return changedParamDescriptors.reduce(function (changedValues, descriptor) { - changedValues[descriptor.id] = toParams[descriptor.id]; - return changedValues; - }, {}); - }; - /** - * Creates a [[UIInjector]] Dependency Injector - * - * Returns a Dependency Injector for the Transition's target state (to state). - * The injector provides resolve values which the target state has access to. - * - * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2). - * - * #### Example: - * ```js - * .onEnter({ entering: 'myState' }, trans => { - * var myResolveValue = trans.injector().get('myResolve'); - * // Inject a global service from the global/native injector (if it exists) - * var MyService = trans.injector().get('MyService'); - * }) - * ``` - * - * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched. - * You can use [[UIInjector.getAsync]] to get a promise for the data. - * #### Example: - * ```js - * .onBefore({}, trans => { - * return trans.injector().getAsync('myResolve').then(myResolveValue => - * return myResolveValue !== 'ABORT'; - * }); - * }); - * ``` - * - * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to. - * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`. - * #### Example: - * ```js - * .onEnter({ to: 'foo.bar' }, trans => { - * // returns result of `foo` state's `myResolve` resolve - * // even though `foo.bar` also has a `myResolve` resolve - * var fooData = trans.injector('foo').get('myResolve'); - * }); - * ``` - * - * If you need resolve data from the exiting states, pass `'from'` as `pathName`. - * The resolve data from the `from` path will be returned. - * #### Example: - * ```js - * .onExit({ exiting: 'foo.bar' }, trans => { - * // Gets the resolve value of `myResolve` from the state being exited - * var fooData = trans.injector(null, 'from').get('myResolve'); - * }); - * ``` - * - * - * @param state Limits the resolves provided to only the resolves the provided state has access to. - * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states. - * - * @returns a [[UIInjector]] - */ - Transition.prototype.injector = function (state, pathName) { - if (pathName === void 0) { pathName = 'to'; } - var path = this._treeChanges[pathName]; - if (state) - path = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.subPath(path, function (node) { return node.state === state || node.state.name === state; }); - return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__.ResolveContext(path).injector(); - }; - /** - * Gets all available resolve tokens (keys) - * - * This method can be used in conjunction with [[injector]] to inspect the resolve values - * available to the Transition. - * - * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states - * in the Transition's [[TreeChanges.to]] path. - * - * #### Example: - * This example logs all resolve values - * ```js - * let tokens = trans.getResolveTokens(); - * tokens.forEach(token => console.log(token + " = " + trans.injector().get(token))); - * ``` - * - * #### Example: - * This example creates promises for each resolve value. - * This triggers fetches of resolves (if any have not yet been fetched). - * When all promises have all settled, it logs the resolve values. - * ```js - * let tokens = trans.getResolveTokens(); - * let promise = tokens.map(token => trans.injector().getAsync(token)); - * Promise.all(promises).then(values => console.log("Resolved values: " + values)); - * ``` - * - * Note: Angular 1 users whould use `$q.all()` - * - * @param pathname resolve context's path name (e.g., `to` or `from`) - * - * @returns an array of resolve tokens (keys) - */ - Transition.prototype.getResolveTokens = function (pathname) { - if (pathname === void 0) { pathname = 'to'; } - return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__.ResolveContext(this._treeChanges[pathname]).getTokens(); - }; - /** - * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition. - * - * Allows a transition hook to dynamically add a Resolvable to this Transition. - * - * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]). - * - * If a `state` argument is provided, the Resolvable is processed when that state is being entered. - * If no `state` is provided then the root state is used. - * If the given `state` has already been entered, the Resolvable is processed when any child state is entered. - * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition. - * - * The `state` argument also scopes the resolved data. - * The resolved data is available from the injector for that `state` and any children states. - * - * #### Example: - * ```js - * transitionService.onBefore({}, transition => { - * transition.addResolvable({ - * token: 'myResolve', - * deps: ['MyService'], - * resolveFn: myService => myService.getData() - * }); - * }); - * ``` - * - * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]]) - * @param state the state in the "to path" which should receive the new resolve (otherwise, the root state) - */ - Transition.prototype.addResolvable = function (resolvable, state) { - if (state === void 0) { state = ''; } - resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.is)(_resolve_resolvable__WEBPACK_IMPORTED_MODULE_12__.Resolvable)(resolvable) ? resolvable : new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_12__.Resolvable(resolvable); - var stateName = typeof state === 'string' ? state : state.name; - var topath = this._treeChanges.to; - var targetNode = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.find)(topath, function (node) { return node.state.name === stateName; }); - var resolveContext = new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__.ResolveContext(topath); - resolveContext.addResolvables([resolvable], targetNode.state); - }; - /** - * Gets the transition from which this transition was redirected. - * - * If the current transition is a redirect, this method returns the transition that was redirected. - * - * #### Example: - * ```js - * let transitionA = $state.go('A').transition - * transitionA.onStart({}, () => $state.target('B')); - * $transitions.onSuccess({ to: 'B' }, (trans) => { - * trans.to().name === 'B'; // true - * trans.redirectedFrom() === transitionA; // true - * }); - * ``` - * - * @returns The previous Transition, or null if this Transition is not the result of a redirection - */ - Transition.prototype.redirectedFrom = function () { - return this._options.redirectedFrom || null; - }; - /** - * Gets the original transition in a redirect chain - * - * A transition might belong to a long chain of multiple redirects. - * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain. - * - * #### Example: - * ```js - * // states - * registry.register({ name: 'A', redirectTo: 'B' }); - * registry.register({ name: 'B', redirectTo: 'C' }); - * registry.register({ name: 'C', redirectTo: 'D' }); - * registry.register({ name: 'D' }); - * - * let transitionA = $state.go('A').transition - * - * $transitions.onSuccess({ to: 'D' }, (trans) => { - * trans.to().name === 'D'; // true - * trans.redirectedFrom().to().name === 'C'; // true - * trans.originalTransition() === transitionA; // true - * trans.originalTransition().to().name === 'A'; // true - * }); - * ``` - * - * @returns The original Transition that started a redirect chain - */ - Transition.prototype.originalTransition = function () { - var rf = this.redirectedFrom(); - return (rf && rf.originalTransition()) || this; - }; - /** - * Get the transition options - * - * @returns the options for this Transition. - */ - Transition.prototype.options = function () { - return this._options; - }; - /** - * Gets the states being entered. - * - * @returns an array of states that will be entered during this transition. - */ - Transition.prototype.entering = function () { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.map)(this._treeChanges.entering, (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('state')).map(stateSelf); - }; - /** - * Gets the states being exited. - * - * @returns an array of states that will be exited during this transition. - */ - Transition.prototype.exiting = function () { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.map)(this._treeChanges.exiting, (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('state')).map(stateSelf).reverse(); - }; - /** - * Gets the states being retained. - * - * @returns an array of states that are already entered from a previous Transition, that will not be - * exited during this Transition - */ - Transition.prototype.retained = function () { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.map)(this._treeChanges.retained, (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('state')).map(stateSelf); - }; - /** - * Get the [[ViewConfig]]s associated with this Transition - * - * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects. - * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., "to" or "entering"). - * - * @param pathname the name of the path to fetch views for: - * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`) - * @param state If provided, only returns the `ViewConfig`s for a single state in the path - * - * @returns a list of ViewConfig objects for the given path. - */ - Transition.prototype.views = function (pathname, state) { - if (pathname === void 0) { pathname = 'entering'; } - var path = this._treeChanges[pathname]; - path = !state ? path : path.filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.propEq)('state', state)); - return path.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('views')).filter(_common_common__WEBPACK_IMPORTED_MODULE_3__.identity).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.unnestR, []); - }; - Transition.prototype.treeChanges = function (pathname) { - return pathname ? this._treeChanges[pathname] : this._treeChanges; - }; - /** - * Creates a new transition that is a redirection of the current one. - * - * This transition can be returned from a [[TransitionService]] hook to - * redirect a transition to a new state and/or set of parameters. - * - * @internal - * - * @returns Returns a new [[Transition]] instance. - */ - Transition.prototype.redirect = function (targetState) { - var redirects = 1, trans = this; - // tslint:disable-next-line:no-conditional-assignment - while ((trans = trans.redirectedFrom()) != null) { - if (++redirects > 20) - throw new Error("Too many consecutive Transition redirects (20+)"); - } - var redirectOpts = { redirectedFrom: this, source: 'redirect' }; - // If the original transition was caused by URL sync, then use { location: 'replace' } - // on the new transition (unless the target state explicitly specifies location: false). - // This causes the original url to be replaced with the url for the redirect target - // so the original url disappears from the browser history. - if (this.options().source === 'url' && targetState.options().location !== false) { - redirectOpts.location = 'replace'; - } - var newOptions = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.extend)({}, this.options(), targetState.options(), redirectOpts); - targetState = targetState.withOptions(newOptions, true); - var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState); - var originalEnteringNodes = this._treeChanges.entering; - var redirectEnteringNodes = newTransition._treeChanges.entering; - // --- Re-use resolve data from original transition --- - // When redirecting from a parent state to a child state where the parent parameter values haven't changed - // (because of the redirect), the resolves fetched by the original transition are still valid in the - // redirected transition. - // - // This allows you to define a redirect on a parent state which depends on an async resolve value. - // You can wait for the resolve, then redirect to a child state based on the result. - // The redirected transition does not have to re-fetch the resolve. - // --------------------------------------------------------- - var nodeIsReloading = function (reloadState) { return function (node) { - return reloadState && node.state.includes[reloadState.name]; - }; }; - // Find any "entering" nodes in the redirect path that match the original path and aren't being reloaded - var matchingEnteringNodes = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.nonDynamicParams).filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.not)(nodeIsReloading(targetState.options().reloadState))); - // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes. - matchingEnteringNodes.forEach(function (node, idx) { - node.resolvables = originalEnteringNodes[idx].resolvables; - }); - return newTransition; - }; - /** @internal If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */ - Transition.prototype._changedParams = function () { - var tc = this._treeChanges; - /** Return undefined if it's not a "dynamic" transition, for the following reasons */ - // If user explicitly wants a reload - if (this._options.reload) - return undefined; - // If any states are exiting or entering - if (tc.exiting.length || tc.entering.length) - return undefined; - // If to/from path lengths differ - if (tc.to.length !== tc.from.length) - return undefined; - // If the to/from paths are different - var pathsDiffer = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.arrayTuples)(tc.to, tc.from) - .map(function (tuple) { return tuple[0].state !== tuple[1].state; }) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.anyTrueR, false); - if (pathsDiffer) - return undefined; - // Find any parameter values that differ - var nodeSchemas = tc.to.map(function (node) { return node.paramSchema; }); - var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1]; - var tuples = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.arrayTuples)(nodeSchemas, toValues, fromValues); - return tuples.map(function (_a) { - var schema = _a[0], toVals = _a[1], fromVals = _a[2]; - return _params_param__WEBPACK_IMPORTED_MODULE_11__.Param.changed(schema, toVals, fromVals); - }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.unnestR, []); - }; - /** - * Returns true if the transition is dynamic. - * - * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed. - * - * @returns true if the Transition is dynamic - */ - Transition.prototype.dynamic = function () { - var changes = this._changedParams(); - return !changes ? false : changes.map(function (x) { return x.dynamic; }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.anyTrueR, false); - }; - /** - * Returns true if the transition is ignored. - * - * A transition is ignored if no states are entered nor exited, and no parameter values have changed. - * - * @returns true if the Transition is ignored. - */ - Transition.prototype.ignored = function () { - return !!this._ignoredReason(); - }; - /** @internal */ - Transition.prototype._ignoredReason = function () { - var pending = this.router.globals.transition; - var reloadState = this._options.reloadState; - var same = function (pathA, pathB) { - if (pathA.length !== pathB.length) - return false; - var matching = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.matching(pathA, pathB); - return pathA.length === matching.filter(function (node) { return !reloadState || !node.state.includes[reloadState.name]; }).length; - }; - var newTC = this.treeChanges(); - var pendTC = pending && pending.treeChanges(); - if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting)) - return 'SameAsPending'; - if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to)) - return 'SameAsCurrent'; - }; - /** - * Runs the transition - * - * This method is generally called from the [[StateService.transitionTo]] - * - * @internal - * - * @returns a promise for a successful transition. - */ - Transition.prototype.run = function () { - var _this = this; - var runAllHooks = _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.runAllHooks; - // Gets transition hooks array for the given phase - var getHooksFor = function (phase) { return _this._hookBuilder.buildHooksForPhase(phase); }; - // When the chain is complete, then resolve or reject the deferred - var transitionSuccess = function () { - _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceSuccess(_this.$to(), _this); - _this.success = true; - _this._deferred.resolve(_this.to()); - runAllHooks(getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.SUCCESS)); - }; - var transitionError = function (reason) { - _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceError(reason, _this); - _this.success = false; - _this._deferred.reject(reason); - _this._error = reason; - runAllHooks(getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.ERROR)); - }; - var runTransition = function () { - // Wait to build the RUN hook chain until the BEFORE hooks are done - // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object. - var allRunHooks = getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.RUN); - var done = function () { return _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(undefined); }; - return _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.invokeHooks(allRunHooks, done); - }; - var startTransition = function () { - var globals = _this.router.globals; - globals.lastStartedTransitionId = _this.$id; - globals.transition = _this; - globals.transitionHistory.enqueue(_this); - _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceTransitionStart(_this); - return _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(undefined); - }; - var allBeforeHooks = getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.BEFORE); - _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.invokeHooks(allBeforeHooks, startTransition) - .then(runTransition) - .then(transitionSuccess, transitionError); - return this.promise; - }; - /** - * Checks if the Transition is valid - * - * @returns true if the Transition is valid - */ - Transition.prototype.valid = function () { - return !this.error() || this.success !== undefined; - }; - /** - * Aborts this transition - * - * Imperative API to abort a Transition. - * This only applies to Transitions that are not yet complete. - */ - Transition.prototype.abort = function () { - // Do not set flag if the transition is already complete - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isUndefined)(this.success)) { - this._aborted = true; - } - }; - /** - * The Transition error reason. - * - * If the transition is invalid (and could not be run), returns the reason the transition is invalid. - * If the transition was valid and ran, but was not successful, returns the reason the transition failed. - * - * @returns a transition rejection explaining why the transition is invalid, or the reason the transition failed. - */ - Transition.prototype.error = function () { - var state = this.$to(); - if (state.self.abstract) { - return _rejectFactory__WEBPACK_IMPORTED_MODULE_14__.Rejection.invalid("Cannot transition to abstract state '" + state.name + "'"); - } - var paramDefs = state.parameters(); - var values = this.params(); - var invalidParams = paramDefs.filter(function (param) { return !param.validates(values[param.id]); }); - if (invalidParams.length) { - var invalidValues = invalidParams.map(function (param) { return "[" + param.id + ":" + (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(values[param.id]) + "]"; }).join(', '); - var detail = "The following parameter values are not valid for state '" + state.name + "': " + invalidValues; - return _rejectFactory__WEBPACK_IMPORTED_MODULE_14__.Rejection.invalid(detail); - } - if (this.success === false) - return this._error; - }; - /** - * A string representation of the Transition - * - * @returns A string representation of the Transition - */ - Transition.prototype.toString = function () { - var fromStateOrName = this.from(); - var toStateOrName = this.to(); - var avoidEmptyHash = function (params) { - return params['#'] !== null && params['#'] !== undefined ? params : (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.omit)(params, ['#']); - }; - // (X) means the to state is invalid. - var id = this.$id, from = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isObject)(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(avoidEmptyHash(this._treeChanges.from.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('paramValues')).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isObject)(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(avoidEmptyHash(this.params())); - return "Transition#" + id + "( '" + from + "'" + fromParams + " -> " + toValid + "'" + to + "'" + toParams + " )"; - }; - /** @internal */ - Transition.diToken = Transition; - return Transition; -}()); - -//# sourceMappingURL=transition.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js ***! - \*******************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TransitionEventType": () => (/* binding */ TransitionEventType) -/* harmony export */ }); -/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transitionHook */ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"); - -/** - * This class defines a type of hook, such as `onBefore` or `onEnter`. - * Plugins can define custom hook types, such as sticky states does for `onInactive`. - */ -var TransitionEventType = /** @class */ (function () { - /* tslint:disable:no-inferrable-types */ - function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) { - if (reverseSort === void 0) { reverseSort = false; } - if (getResultHandler === void 0) { getResultHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_0__.TransitionHook.HANDLE_RESULT; } - if (getErrorHandler === void 0) { getErrorHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_0__.TransitionHook.REJECT_ERROR; } - if (synchronous === void 0) { synchronous = false; } - this.name = name; - this.hookPhase = hookPhase; - this.hookOrder = hookOrder; - this.criteriaMatchPath = criteriaMatchPath; - this.reverseSort = reverseSort; - this.getResultHandler = getResultHandler; - this.getErrorHandler = getErrorHandler; - this.synchronous = synchronous; - } - return TransitionEventType; -}()); - -//# sourceMappingURL=transitionEventType.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "TransitionHook": () => (/* binding */ TransitionHook) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/transition/interface.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); -/* harmony import */ var _rejectFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rejectFactory */ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"); -/* harmony import */ var _state_targetState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../state/targetState */ "./node_modules/@uirouter/core/lib-esm/state/targetState.js"); - - - - - - - - - -var defaultOptions = { - current: _common_common__WEBPACK_IMPORTED_MODULE_1__.noop, - transition: null, - traceData: {}, - bind: null, -}; -var TransitionHook = /** @class */ (function () { - function TransitionHook(transition, stateContext, registeredHook, options) { - var _this = this; - this.transition = transition; - this.stateContext = stateContext; - this.registeredHook = registeredHook; - this.options = options; - this.isSuperseded = function () { return _this.type.hookPhase === _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookPhase.RUN && !_this.options.transition.isActive(); }; - this.options = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.defaults)(options, defaultOptions); - this.type = registeredHook.eventType; - } - /** - * Chains together an array of TransitionHooks. - * - * Given a list of [[TransitionHook]] objects, chains them together. - * Each hook is invoked after the previous one completes. - * - * #### Example: - * ```js - * var hooks: TransitionHook[] = getHooks(); - * let promise: Promise = TransitionHook.chain(hooks); - * - * promise.then(handleSuccess, handleError); - * ``` - * - * @param hooks the list of hooks to chain together - * @param waitFor if provided, the chain is `.then()`'ed off this promise - * @returns a `Promise` for sequentially invoking the hooks (in order) - */ - TransitionHook.chain = function (hooks, waitFor) { - // Chain the next hook off the previous - var createHookChainR = function (prev, nextHook) { return prev.then(function () { return nextHook.invokeHook(); }); }; - return hooks.reduce(createHookChainR, waitFor || _common_coreservices__WEBPACK_IMPORTED_MODULE_6__.services.$q.when()); - }; - /** - * Invokes all the provided TransitionHooks, in order. - * Each hook's return value is checked. - * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned. - * If no hook returns a promise, then all hooks are processed synchronously. - * - * @param hooks the list of TransitionHooks to invoke - * @param doneCallback a callback that is invoked after all the hooks have successfully completed - * - * @returns a promise for the async result, or the result of the callback - */ - TransitionHook.invokeHooks = function (hooks, doneCallback) { - for (var idx = 0; idx < hooks.length; idx++) { - var hookResult = hooks[idx].invokeHook(); - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(hookResult)) { - var remainingHooks = hooks.slice(idx + 1); - return TransitionHook.chain(remainingHooks, hookResult).then(doneCallback); - } - } - return doneCallback(); - }; - /** - * Run all TransitionHooks, ignoring their return value. - */ - TransitionHook.runAllHooks = function (hooks) { - hooks.forEach(function (hook) { return hook.invokeHook(); }); - }; - TransitionHook.prototype.logError = function (err) { - this.transition.router.stateService.defaultErrorHandler()(err); - }; - TransitionHook.prototype.invokeHook = function () { - var _this = this; - var hook = this.registeredHook; - if (hook._deregistered) - return; - var notCurrent = this.getNotCurrentRejection(); - if (notCurrent) - return notCurrent; - var options = this.options; - _common_trace__WEBPACK_IMPORTED_MODULE_5__.trace.traceHookInvocation(this, this.transition, options); - var invokeCallback = function () { return hook.callback.call(options.bind, _this.transition, _this.stateContext); }; - var normalizeErr = function (err) { return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.normalize(err).toPromise(); }; - var handleError = function (err) { return hook.eventType.getErrorHandler(_this)(err); }; - var handleResult = function (result) { return hook.eventType.getResultHandler(_this)(result); }; - try { - var result = invokeCallback(); - if (!this.type.synchronous && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - return result.catch(normalizeErr).then(handleResult, handleError); - } - else { - return handleResult(result); - } - } - catch (err) { - // If callback throws (synchronously) - return handleError(_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.normalize(err)); - } - finally { - if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) { - hook.deregister(); - } - } - }; - /** - * This method handles the return value of a Transition Hook. - * - * A hook can return false (cancel), a TargetState (redirect), - * or a promise (which may later resolve to false or a redirect) - * - * This also handles "transition superseded" -- when a new transition - * was started while the hook was still running - */ - TransitionHook.prototype.handleHookResult = function (result) { - var _this = this; - var notCurrent = this.getNotCurrentRejection(); - if (notCurrent) - return notCurrent; - // Hook returned a promise - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) { - // Wait for the promise, then reprocess with the resulting value - return result.then(function (val) { return _this.handleHookResult(val); }); - } - _common_trace__WEBPACK_IMPORTED_MODULE_5__.trace.traceHookResult(result, this.transition, this.options); - // Hook returned false - if (result === false) { - // Abort this Transition - return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.aborted('Hook aborted transition').toPromise(); - } - var isTargetState = (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.is)(_state_targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState); - // hook returned a TargetState - if (isTargetState(result)) { - // Halt the current Transition and redirect (a new Transition) to the TargetState. - return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.redirected(result).toPromise(); - } - }; - /** - * Return a Rejection promise if the transition is no longer current due - * to a stopped router (disposed), or a new transition has started and superseded this one. - */ - TransitionHook.prototype.getNotCurrentRejection = function () { - var router = this.transition.router; - // The router is stopped - if (router._disposed) { - return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.aborted("UIRouter instance #" + router.$id + " has been stopped (disposed)").toPromise(); - } - if (this.transition._aborted) { - return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.aborted().toPromise(); - } - // This transition is no longer current. - // Another transition started while this hook was still running. - if (this.isSuperseded()) { - // Abort this transition - return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.superseded(this.options.current()).toPromise(); - } - }; - TransitionHook.prototype.toString = function () { - var _a = this, options = _a.options, registeredHook = _a.registeredHook; - var event = (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.parse)('traceData.hookType')(options) || 'internal', context = (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.parse)('traceData.context.state.name')(options) || (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.parse)('traceData.context')(options) || 'unknown', name = (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.fnToString)(registeredHook.callback); - return event + " context: " + context + ", " + (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, name); - }; - /** - * These GetResultHandler(s) are used by [[invokeHook]] below - * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]]) - */ - TransitionHook.HANDLE_RESULT = function (hook) { return function (result) { - return hook.handleHookResult(result); - }; }; - /** - * If the result is a promise rejection, log it. - * Otherwise, ignore the result. - */ - TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) { - (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result) && result.catch(function (err) { return hook.logError(_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.normalize(err)); }); - return undefined; - }; }; - /** - * These GetErrorHandler(s) are used by [[invokeHook]] below - * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]]) - */ - TransitionHook.LOG_ERROR = function (hook) { return function (error) { return hook.logError(error); }; }; - TransitionHook.REJECT_ERROR = function (hook) { return function (error) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.silentRejection)(error); }; }; - TransitionHook.THROW_ERROR = function (hook) { return function (error) { - throw error; - }; }; - return TransitionHook; -}()); - -//# sourceMappingURL=transitionHook.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/transition/transitionService.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/transition/transitionService.js ***! - \*****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "defaultTransOpts": () => (/* binding */ defaultTransOpts), -/* harmony export */ "TransitionService": () => (/* binding */ TransitionService) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/transition/interface.js"); -/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition */ "./node_modules/@uirouter/core/lib-esm/transition/transition.js"); -/* harmony import */ var _hookRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hookRegistry */ "./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"); -/* harmony import */ var _hooks_coreResolvables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/coreResolvables */ "./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js"); -/* harmony import */ var _hooks_redirectTo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/redirectTo */ "./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js"); -/* harmony import */ var _hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../hooks/onEnterExitRetain */ "./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js"); -/* harmony import */ var _hooks_resolve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../hooks/resolve */ "./node_modules/@uirouter/core/lib-esm/hooks/resolve.js"); -/* harmony import */ var _hooks_views__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../hooks/views */ "./node_modules/@uirouter/core/lib-esm/hooks/views.js"); -/* harmony import */ var _hooks_updateGlobals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../hooks/updateGlobals */ "./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js"); -/* harmony import */ var _hooks_url__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../hooks/url */ "./node_modules/@uirouter/core/lib-esm/hooks/url.js"); -/* harmony import */ var _hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../hooks/lazyLoad */ "./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"); -/* harmony import */ var _transitionEventType__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./transitionEventType */ "./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"); -/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transitionHook */ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _hooks_ignoredTransition__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../hooks/ignoredTransition */ "./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js"); -/* harmony import */ var _hooks_invalidTransition__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../hooks/invalidTransition */ "./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js"); - - - - - - - - - - - - - - - - - - -/** - * The default [[Transition]] options. - * - * Include this object when applying custom defaults: - * let reloadOpts = { reload: true, notify: true } - * let options = defaults(theirOpts, customDefaults, defaultOptions); - */ -var defaultTransOpts = { - location: true, - relative: null, - inherit: false, - notify: true, - reload: false, - supercede: true, - custom: {}, - current: function () { return null; }, - source: 'unknown', -}; -/** - * This class provides services related to Transitions. - * - * - Most importantly, it allows global Transition Hooks to be registered. - * - It allows the default transition error handler to be set. - * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]). - * - * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class. - * - * This API is located at `router.transitionService` ([[UIRouter.transitionService]]) - */ -var TransitionService = /** @class */ (function () { - /** @internal */ - function TransitionService(_router) { - /** @internal */ - this._transitionCount = 0; - /** The transition hook types, such as `onEnter`, `onStart`, etc */ - this._eventTypes = []; - /** @internal The registered transition hooks */ - this._registeredHooks = {}; - /** The paths on a criteria object */ - this._criteriaPaths = {}; - this._router = _router; - this.$view = _router.viewService; - this._deregisterHookFns = {}; - this._pluginapi = ((0,_common_common__WEBPACK_IMPORTED_MODULE_14__.createProxyFunctions)((0,_common_hof__WEBPACK_IMPORTED_MODULE_15__.val)(this), {}, (0,_common_hof__WEBPACK_IMPORTED_MODULE_15__.val)(this), [ - '_definePathType', - '_defineEvent', - '_getPathTypes', - '_getEvents', - 'getHooks', - ])); - this._defineCorePaths(); - this._defineCoreEvents(); - this._registerCoreTransitionHooks(); - _router.globals.successfulTransitions.onEvict(_hooks_coreResolvables__WEBPACK_IMPORTED_MODULE_3__.treeChangesCleanup); - } - /** - * Registers a [[TransitionHookFn]], called *while a transition is being constructed*. - * - * Registers a transition lifecycle hook, which is invoked during transition construction. - * - * This low level hook should only be used by plugins. - * This can be a useful time for plugins to add resolves or mutate the transition as needed. - * The Sticky States plugin uses this hook to modify the treechanges. - * - * ### Lifecycle - * - * `onCreate` hooks are invoked *while a transition is being constructed*. - * - * ### Return value - * - * The hook's return value is ignored - * - * @internal - * @param criteria defines which Transitions the Hook should be invoked for. - * @param callback the hook function which will be invoked. - * @param options the registration options - * @returns a function which deregisters the hook. - */ - TransitionService.prototype.onCreate = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onBefore = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onStart = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onExit = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onRetain = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onEnter = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onFinish = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onSuccess = function (criteria, callback, options) { - return; - }; - /** @inheritdoc */ - TransitionService.prototype.onError = function (criteria, callback, options) { - return; - }; - /** - * dispose - * @internal - */ - TransitionService.prototype.dispose = function (router) { - (0,_common_common__WEBPACK_IMPORTED_MODULE_14__.values)(this._registeredHooks).forEach(function (hooksArray) { - return hooksArray.forEach(function (hook) { - hook._deregistered = true; - (0,_common_common__WEBPACK_IMPORTED_MODULE_14__.removeFrom)(hooksArray, hook); - }); - }); - }; - /** - * Creates a new [[Transition]] object - * - * This is a factory function for creating new Transition objects. - * It is used internally by the [[StateService]] and should generally not be called by application code. - * - * @internal - * @param fromPath the path to the current state (the from state) - * @param targetState the target state (destination) - * @returns a Transition - */ - TransitionService.prototype.create = function (fromPath, targetState) { - return new _transition__WEBPACK_IMPORTED_MODULE_1__.Transition(fromPath, targetState, this._router); - }; - /** @internal */ - TransitionService.prototype._defineCoreEvents = function () { - var Phase = _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookPhase; - var TH = _transitionHook__WEBPACK_IMPORTED_MODULE_12__.TransitionHook; - var paths = this._criteriaPaths; - var NORMAL_SORT = false, REVERSE_SORT = true; - var SYNCHRONOUS = true; - this._defineEvent('onCreate', Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS); - this._defineEvent('onBefore', Phase.BEFORE, 0, paths.to); - this._defineEvent('onStart', Phase.RUN, 0, paths.to); - this._defineEvent('onExit', Phase.RUN, 100, paths.exiting, REVERSE_SORT); - this._defineEvent('onRetain', Phase.RUN, 200, paths.retained); - this._defineEvent('onEnter', Phase.RUN, 300, paths.entering); - this._defineEvent('onFinish', Phase.RUN, 400, paths.to); - this._defineEvent('onSuccess', Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS); - this._defineEvent('onError', Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS); - }; - /** @internal */ - TransitionService.prototype._defineCorePaths = function () { - var STATE = _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookScope.STATE, TRANSITION = _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookScope.TRANSITION; - this._definePathType('to', TRANSITION); - this._definePathType('from', TRANSITION); - this._definePathType('exiting', STATE); - this._definePathType('retained', STATE); - this._definePathType('entering', STATE); - }; - /** @internal */ - TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) { - if (reverseSort === void 0) { reverseSort = false; } - if (getResultHandler === void 0) { getResultHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_12__.TransitionHook.HANDLE_RESULT; } - if (getErrorHandler === void 0) { getErrorHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_12__.TransitionHook.REJECT_ERROR; } - if (synchronous === void 0) { synchronous = false; } - var eventType = new _transitionEventType__WEBPACK_IMPORTED_MODULE_11__.TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous); - this._eventTypes.push(eventType); - (0,_hookRegistry__WEBPACK_IMPORTED_MODULE_2__.makeEvent)(this, this, eventType); - }; - /** @internal */ - TransitionService.prototype._getEvents = function (phase) { - var transitionHookTypes = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_13__.isDefined)(phase) - ? this._eventTypes.filter(function (type) { return type.hookPhase === phase; }) - : this._eventTypes.slice(); - return transitionHookTypes.sort(function (l, r) { - var cmpByPhase = l.hookPhase - r.hookPhase; - return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase; - }); - }; - /** - * Adds a Path to be used as a criterion against a TreeChanges path - * - * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path. - * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)` - * Each state in the exiting path is checked against the criteria and returned as part of the match. - * - * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path. - * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)` - * Only the tail of the `to` path is checked against the criteria and returned as part of the match. - * - * @internal - */ - TransitionService.prototype._definePathType = function (name, hookScope) { - this._criteriaPaths[name] = { name: name, scope: hookScope }; - }; - /** @internal */ - // tslint:disable-next-line - TransitionService.prototype._getPathTypes = function () { - return this._criteriaPaths; - }; - /** @internal */ - TransitionService.prototype.getHooks = function (hookName) { - return this._registeredHooks[hookName]; - }; - /** @internal */ - TransitionService.prototype._registerCoreTransitionHooks = function () { - var fns = this._deregisterHookFns; - fns.addCoreResolves = (0,_hooks_coreResolvables__WEBPACK_IMPORTED_MODULE_3__.registerAddCoreResolvables)(this); - fns.ignored = (0,_hooks_ignoredTransition__WEBPACK_IMPORTED_MODULE_16__.registerIgnoredTransitionHook)(this); - fns.invalid = (0,_hooks_invalidTransition__WEBPACK_IMPORTED_MODULE_17__.registerInvalidTransitionHook)(this); - // Wire up redirectTo hook - fns.redirectTo = (0,_hooks_redirectTo__WEBPACK_IMPORTED_MODULE_4__.registerRedirectToHook)(this); - // Wire up onExit/Retain/Enter state hooks - fns.onExit = (0,_hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.registerOnExitHook)(this); - fns.onRetain = (0,_hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.registerOnRetainHook)(this); - fns.onEnter = (0,_hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.registerOnEnterHook)(this); - // Wire up Resolve hooks - fns.eagerResolve = (0,_hooks_resolve__WEBPACK_IMPORTED_MODULE_6__.registerEagerResolvePath)(this); - fns.lazyResolve = (0,_hooks_resolve__WEBPACK_IMPORTED_MODULE_6__.registerLazyResolveState)(this); - fns.resolveAll = (0,_hooks_resolve__WEBPACK_IMPORTED_MODULE_6__.registerResolveRemaining)(this); - // Wire up the View management hooks - fns.loadViews = (0,_hooks_views__WEBPACK_IMPORTED_MODULE_7__.registerLoadEnteringViews)(this); - fns.activateViews = (0,_hooks_views__WEBPACK_IMPORTED_MODULE_7__.registerActivateViews)(this); - // Updates global state after a transition - fns.updateGlobals = (0,_hooks_updateGlobals__WEBPACK_IMPORTED_MODULE_8__.registerUpdateGlobalState)(this); - // After globals.current is updated at priority: 10000 - fns.updateUrl = (0,_hooks_url__WEBPACK_IMPORTED_MODULE_9__.registerUpdateUrl)(this); - // Lazy load state trees - fns.lazyLoad = (0,_hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_10__.registerLazyLoadHook)(this); - }; - return TransitionService; -}()); - -//# sourceMappingURL=transitionService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/index.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlMatcher": () => (/* reexport safe */ _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher), -/* harmony export */ "ParamFactory": () => (/* reexport safe */ _urlMatcherFactory__WEBPACK_IMPORTED_MODULE_2__.ParamFactory), -/* harmony export */ "UrlMatcherFactory": () => (/* reexport safe */ _urlMatcherFactory__WEBPACK_IMPORTED_MODULE_2__.UrlMatcherFactory), -/* harmony export */ "UrlRouter": () => (/* reexport safe */ _urlRouter__WEBPACK_IMPORTED_MODULE_3__.UrlRouter), -/* harmony export */ "BaseUrlRule": () => (/* reexport safe */ _urlRule__WEBPACK_IMPORTED_MODULE_4__.BaseUrlRule), -/* harmony export */ "UrlRuleFactory": () => (/* reexport safe */ _urlRule__WEBPACK_IMPORTED_MODULE_4__.UrlRuleFactory), -/* harmony export */ "UrlService": () => (/* reexport safe */ _urlService__WEBPACK_IMPORTED_MODULE_5__.UrlService), -/* harmony export */ "UrlRules": () => (/* reexport safe */ _urlRules__WEBPACK_IMPORTED_MODULE_6__.UrlRules), -/* harmony export */ "UrlConfig": () => (/* reexport safe */ _urlConfig__WEBPACK_IMPORTED_MODULE_7__.UrlConfig) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/url/interface.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(["default","UrlRules","UrlConfig"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlMatcher */ "./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"); -/* harmony import */ var _urlMatcherFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./urlMatcherFactory */ "./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"); -/* harmony import */ var _urlRouter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./urlRouter */ "./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"); -/* harmony import */ var _urlRule__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./urlRule */ "./node_modules/@uirouter/core/lib-esm/url/urlRule.js"); -/* harmony import */ var _urlService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./urlService */ "./node_modules/@uirouter/core/lib-esm/url/urlService.js"); -/* harmony import */ var _urlRules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./urlRules */ "./node_modules/@uirouter/core/lib-esm/url/urlRules.js"); -/* harmony import */ var _urlConfig__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./urlConfig */ "./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"); - - - - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/interface.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/interface.js ***! - \**************************************************************/ -/***/ (() => { - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlConfig.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlConfig.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlConfig": () => (/* binding */ UrlConfig) -/* harmony export */ }); -/* harmony import */ var _params__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../params */ "./node_modules/@uirouter/core/lib-esm/params/index.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - -/** - * An API to customize the URL behavior and retrieve URL configuration - * - * This API is used to customize the behavior of the URL. - * This includes optional trailing slashes ([[strictMode]]), case sensitivity ([[caseInsensitive]]), - * and custom parameter encoding (custom [[type]]). - * - * It also has information about the location (url) configuration such as [[port]] and [[baseHref]]. - * This information can be used to build absolute URLs, such as - * `https://example.com:443/basepath/state/substate?param1=a#hashvalue`; - * - * This API is found at `router.urlService.config` (see: [[UIRouter.urlService]], [[URLService.config]]) - */ -var UrlConfig = /** @class */ (function () { - /** @internal */ function UrlConfig(/** @internal */ router) { - var _this = this; - this.router = router; - /** @internal */ this.paramTypes = new _params__WEBPACK_IMPORTED_MODULE_0__.ParamTypes(); - /** @internal */ this._decodeParams = true; - /** @internal */ this._isCaseInsensitive = false; - /** @internal */ this._isStrictMode = true; - /** @internal */ this._defaultSquashPolicy = false; - /** @internal */ this.dispose = function () { return _this.paramTypes.dispose(); }; - // Delegate these calls to the current LocationConfig implementation - /** - * Gets the base Href, e.g., `http://localhost/approot/` - * - * @return the application's base href - */ - this.baseHref = function () { return _this.router.locationConfig.baseHref(); }; - /** - * Gets or sets the hashPrefix - * - * This only applies when not running in [[html5Mode]] (pushstate mode) - * - * If the current url is `http://localhost/app#!/uirouter/path/#anchor`, it returns `!` which is the prefix for the "hashbang" portion. - * - * @return the hash prefix - */ - this.hashPrefix = function (newprefix) { return _this.router.locationConfig.hashPrefix(newprefix); }; - /** - * Gets the host, e.g., `localhost` - * - * @return the protocol - */ - this.host = function () { return _this.router.locationConfig.host(); }; - /** - * Returns true when running in pushstate mode - * - * @return true when running in html5 mode (pushstate mode). - */ - this.html5Mode = function () { return _this.router.locationConfig.html5Mode(); }; - /** - * Gets the port, e.g., `80` - * - * @return the port number - */ - this.port = function () { return _this.router.locationConfig.port(); }; - /** - * Gets the protocol, e.g., `http` - * - * @return the protocol - */ - this.protocol = function () { return _this.router.locationConfig.protocol(); }; - } - /** - * Defines whether URL matching should be case sensitive (the default behavior), or not. - * - * #### Example: - * ```js - * // Allow case insensitive url matches - * urlService.config.caseInsensitive(true); - * ``` - * - * @param value `false` to match URL in a case sensitive manner; otherwise `true`; - * @returns the current value of caseInsensitive - */ - UrlConfig.prototype.caseInsensitive = function (value) { - return (this._isCaseInsensitive = (0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) ? value : this._isCaseInsensitive); - }; - /** - * Sets the default behavior when generating or matching URLs with default parameter values. - * - * #### Example: - * ```js - * // Remove default parameter values from the url - * urlService.config.defaultSquashPolicy(true); - * ``` - * - * @param value A string that defines the default parameter URL squashing behavior. - * - `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL - * - `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the - * parameter is surrounded by slashes, squash (remove) one slash from the URL - * - any other string, e.g. "~": When generating an href with a default parameter value, squash (remove) - * the parameter value from the URL and replace it with this string. - * @returns the current value of defaultSquashPolicy - */ - UrlConfig.prototype.defaultSquashPolicy = function (value) { - if ((0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) && value !== true && value !== false && !(0,_common__WEBPACK_IMPORTED_MODULE_1__.isString)(value)) - throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); - return (this._defaultSquashPolicy = (0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) ? value : this._defaultSquashPolicy); - }; - /** - * Defines whether URLs should match trailing slashes, or not (the default behavior). - * - * #### Example: - * ```js - * // Allow optional trailing slashes - * urlService.config.strictMode(false); - * ``` - * - * @param value `false` to match trailing slashes in URLs, otherwise `true`. - * @returns the current value of strictMode - */ - UrlConfig.prototype.strictMode = function (value) { - return (this._isStrictMode = (0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) ? value : this._isStrictMode); - }; - /** - * Creates and registers a custom [[ParamType]] object - * - * A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding. - * - * #### Note: Register custom types *before using them* in a state definition. - * - * #### Example: - * ```js - * // Encode object parameter as JSON string - * urlService.config.type('myjson', { - * encode: (obj) => JSON.stringify(obj), - * decode: (str) => JSON.parse(str), - * is: (val) => typeof(val) === 'object', - * pattern: /[^/]+/, - * equals: (a, b) => _.isEqual(a, b), - * }); - * ``` - * - * See [[ParamTypeDefinition]] for more examples - * - * @param name The type name. - * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted. - * @param definitionFn A function that is injected before the app runtime starts. - * The result of this function should be a [[ParamTypeDefinition]]. - * The result is merged into the existing `definition`. - * See [[ParamType]] for information on the values accepted. - * - * @returns if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined - */ - UrlConfig.prototype.type = function (name, definition, definitionFn) { - var type = this.paramTypes.type(name, definition, definitionFn); - return !(0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(definition) ? type : this; - }; - return UrlConfig; -}()); - -//# sourceMappingURL=urlConfig.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlMatcher": () => (/* binding */ UrlMatcher) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../params/param */ "./node_modules/@uirouter/core/lib-esm/params/param.js"); -/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/strings */ "./node_modules/@uirouter/core/lib-esm/common/strings.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - - - - - - -function quoteRegExp(str, param) { - var surroundPattern = ['', ''], result = str.replace(/[\\\[\]\^$*+?.()|{}]/g, '\\$&'); - if (!param) - return result; - switch (param.squash) { - case false: - surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')]; - break; - case true: - result = result.replace(/\/$/, ''); - surroundPattern = ['(?:/(', ')|/)?']; - break; - default: - surroundPattern = ["(" + param.squash + "|", ')?']; - break; - } - return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1]; -} -var memoizeTo = function (obj, _prop, fn) { return (obj[_prop] = obj[_prop] || fn()); }; -var splitOnSlash = (0,_common_strings__WEBPACK_IMPORTED_MODULE_4__.splitOnDelim)('/'); -var defaultConfig = { - state: { params: {} }, - strict: true, - caseInsensitive: true, - decodeParams: true, -}; -/** - * Matches URLs against patterns. - * - * Matches URLs against patterns and extracts named parameters from the path or the search - * part of the URL. - * - * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query) - * parameters. Multiple search parameter names are separated by '&'. Search parameters - * do not influence whether or not a URL is matched, but their values are passed through into - * the matched parameters returned by [[UrlMatcher.exec]]. - * - * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`) - * or colon placeholders (`/somePath/:param`). - * - * - *A parameter RegExp* may be defined for a param after a colon - * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder. - * The regexp must match for the url to be matched. - * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash. - * - * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]]. - * - * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters. - * See [[UrlMatcherFactory.type]] for more information. - * - * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`). - * A catch-all * parameter value will contain the remainder of the URL. - * - * --- - * - * Parameter names may contain only word characters (latin letters, digits, and underscore) and - * must be unique within the pattern (across both path and search parameters). - * A path parameter matches any number of characters other than '/'. For catch-all - * placeholders the path parameter matches any number of characters. - * - * Examples: - * - * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for - * trailing slashes, and patterns have to match the entire path, not just a prefix. - * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or - * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. - * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax. - * * `'/user/{id:[^/]*}'` - Same as the previous example. - * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id - * parameter consists of 1 to 8 hex digits. - * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the - * path into the parameter 'path'. - * * `'/files/*path'` - ditto. - * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined - * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start - * - */ -var UrlMatcher = /** @class */ (function () { - /** - * @param pattern The pattern to compile into a matcher. - * @param paramTypes The [[ParamTypes]] registry - * @param paramFactory A [[ParamFactory]] object - * @param config A [[UrlMatcherCompileConfig]] configuration object - */ - function UrlMatcher(pattern, paramTypes, paramFactory, config) { - var _this = this; - /** @internal */ - this._cache = { path: [this] }; - /** @internal */ - this._children = []; - /** @internal */ - this._params = []; - /** @internal */ - this._segments = []; - /** @internal */ - this._compiled = []; - this.config = config = (0,_common__WEBPACK_IMPORTED_MODULE_5__.defaults)(config, defaultConfig); - this.pattern = pattern; - // Find all placeholders and create a compiled pattern, using either classic or curly syntax: - // '*' name - // ':' name - // '{' name '}' - // '{' name ':' regexp '}' - // The regular expression is somewhat complicated due to the need to allow curly braces - // inside the regular expression. The placeholder regexp breaks down as follows: - // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case) - // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case - // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either - // [^{}\\]+ - anything other than curly braces or backslash - // \\. - a backslash escape - // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms - var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g; - var searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g; - var patterns = []; - var last = 0; - var matchArray; - var checkParamErrors = function (id) { - if (!UrlMatcher.nameValidator.test(id)) - throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); - if ((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(_this._params, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('id', id))) - throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); - }; - // Split into static segments separated by path parameter placeholders. - // The number of segments is always 1 more than the number of parameters. - var matchDetails = function (m, isSearch) { - // IE[78] returns '' for unmatched groups instead of null - var id = m[2] || m[3]; - var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\s\\S]*' : null); - var makeRegexpType = function (str) { - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)(paramTypes.type(isSearch ? 'query' : 'path'), { - pattern: new RegExp(str, _this.config.caseInsensitive ? 'i' : undefined), - }); - }; - return { - id: id, - regexp: regexp, - segment: pattern.substring(last, m.index), - type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp), - }; - }; - var details; - var segment; - // tslint:disable-next-line:no-conditional-assignment - while ((matchArray = placeholder.exec(pattern))) { - details = matchDetails(matchArray, false); - if (details.segment.indexOf('?') >= 0) - break; // we're into the search part - checkParamErrors(details.id); - this._params.push(paramFactory.fromPath(details.id, details.type, config.state)); - this._segments.push(details.segment); - patterns.push([details.segment, (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(this._params)]); - last = placeholder.lastIndex; - } - segment = pattern.substring(last); - // Find any search parameter names and remove them from the last segment - var i = segment.indexOf('?'); - if (i >= 0) { - var search = segment.substring(i); - segment = segment.substring(0, i); - if (search.length > 0) { - last = 0; - // tslint:disable-next-line:no-conditional-assignment - while ((matchArray = searchPlaceholder.exec(search))) { - details = matchDetails(matchArray, true); - checkParamErrors(details.id); - this._params.push(paramFactory.fromSearch(details.id, details.type, config.state)); - last = placeholder.lastIndex; - // check if ?& - } - } - } - this._segments.push(segment); - this._compiled = patterns.map(function (_pattern) { return quoteRegExp.apply(null, _pattern); }).concat(quoteRegExp(segment)); - } - /** @internal */ - UrlMatcher.encodeDashes = function (str) { - // Replace dashes with encoded "\-" - return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%" + c.charCodeAt(0).toString(16).toUpperCase(); }); - }; - /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */ - UrlMatcher.pathSegmentsAndParams = function (matcher) { - var staticSegments = matcher._segments; - var pathParams = matcher._params.filter(function (p) { return p.location === _params_param__WEBPACK_IMPORTED_MODULE_3__.DefType.PATH; }); - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples)(staticSegments, pathParams.concat(undefined)) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .filter(function (x) { return x !== '' && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(x); }); - }; - /** @internal Given a matcher, return an array with the matcher's query params */ - UrlMatcher.queryParams = function (matcher) { - return matcher._params.filter(function (p) { return p.location === _params_param__WEBPACK_IMPORTED_MODULE_3__.DefType.SEARCH; }); - }; - /** - * Compare two UrlMatchers - * - * This comparison function converts a UrlMatcher into static and dynamic path segments. - * Each static path segment is a static string between a path separator (slash character). - * Each dynamic segment is a path parameter. - * - * The comparison function sorts static segments before dynamic ones. - */ - UrlMatcher.compare = function (a, b) { - /** - * Turn a UrlMatcher and all its parent matchers into an array - * of slash literals '/', string literals, and Param objects - * - * This example matcher matches strings like "/foo/:param/tail": - * var matcher = $umf.compile("/foo").append($umf.compile("/:param")).append($umf.compile("/")).append($umf.compile("tail")); - * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ] - * - * Caches the result as `matcher._cache.segments` - */ - var segments = function (matcher) { - return (matcher._cache.segments = - matcher._cache.segments || - matcher._cache.path - .map(UrlMatcher.pathSegmentsAndParams) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .reduce(_common_strings__WEBPACK_IMPORTED_MODULE_4__.joinNeighborsR, []) - .map(function (x) { return ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(x) ? splitOnSlash(x) : x); }) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])); - }; - /** - * Gets the sort weight for each segment of a UrlMatcher - * - * Caches the result as `matcher._cache.weights` - */ - var weights = function (matcher) { - return (matcher._cache.weights = - matcher._cache.weights || - segments(matcher).map(function (segment) { - // Sort slashes first, then static strings, the Params - if (segment === '/') - return 1; - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(segment)) - return 2; - if (segment instanceof _params_param__WEBPACK_IMPORTED_MODULE_3__.Param) - return 3; - })); - }; - /** - * Pads shorter array in-place (mutates) - */ - var padArrays = function (l, r, padVal) { - var len = Math.max(l.length, r.length); - while (l.length < len) - l.push(padVal); - while (r.length < len) - r.push(padVal); - }; - var weightsA = weights(a), weightsB = weights(b); - padArrays(weightsA, weightsB, 0); - var _pairs = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples)(weightsA, weightsB); - var cmp, i; - for (i = 0; i < _pairs.length; i++) { - cmp = _pairs[i][0] - _pairs[i][1]; - if (cmp !== 0) - return cmp; - } - return 0; - }; - /** - * Creates a new concatenated UrlMatcher - * - * Builds a new UrlMatcher by appending another UrlMatcher to this one. - * - * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`. - */ - UrlMatcher.prototype.append = function (url) { - this._children.push(url); - url._cache = { - path: this._cache.path.concat(url), - parent: this, - pattern: null, - }; - return url; - }; - /** @internal */ - UrlMatcher.prototype.isRoot = function () { - return this._cache.path[0] === this; - }; - /** Returns the input pattern string */ - UrlMatcher.prototype.toString = function () { - return this.pattern; - }; - UrlMatcher.prototype._getDecodedParamValue = function (value, param) { - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(value)) { - if (this.config.decodeParams && !param.type.raw) { - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(value)) { - value = value.map(function (paramValue) { return decodeURIComponent(paramValue); }); - } - else { - value = decodeURIComponent(value); - } - } - value = param.type.decode(value); - } - return param.value(value); - }; - /** - * Tests the specified url/path against this matcher. - * - * Tests if the given url matches this matcher's pattern, and returns an object containing the captured - * parameter values. Returns null if the path does not match. - * - * The returned object contains the values - * of any search parameters that are mentioned in the pattern, but their value may be null if - * they are not present in `search`. This means that search parameters are always treated - * as optional. - * - * #### Example: - * ```js - * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', { - * x: '1', q: 'hello' - * }); - * // returns { id: 'bob', q: 'hello', r: null } - * ``` - * - * @param path The URL path to match, e.g. `$location.path()`. - * @param search URL search parameters, e.g. `$location.search()`. - * @param hash URL hash e.g. `$location.hash()`. - * @param options - * - * @returns The captured parameter values. - */ - UrlMatcher.prototype.exec = function (path, search, hash, options) { - var _this = this; - if (search === void 0) { search = {}; } - if (options === void 0) { options = {}; } - var match = memoizeTo(this._cache, 'pattern', function () { - return new RegExp([ - '^', - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.unnest)(_this._cache.path.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('_compiled'))).join(''), - _this.config.strict === false ? '/?' : '', - '$', - ].join(''), _this.config.caseInsensitive ? 'i' : undefined); - }).exec(path); - if (!match) - return null; - // options = defaults(options, { isolate: false }); - var allParams = this.parameters(), pathParams = allParams.filter(function (param) { return !param.isSearch(); }), searchParams = allParams.filter(function (param) { return param.isSearch(); }), nPathSegments = this._cache.path.map(function (urlm) { return urlm._segments.length - 1; }).reduce(function (a, x) { return a + x; }), values = {}; - if (nPathSegments !== match.length - 1) - throw new Error("Unbalanced capture group in route '" + this.pattern + "'"); - function decodePathArray(paramVal) { - var reverseString = function (str) { return str.split('').reverse().join(''); }; - var unquoteDashes = function (str) { return str.replace(/\\-/g, '-'); }; - var split = reverseString(paramVal).split(/-(?!\\)/); - var allReversed = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(split, reverseString); - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(allReversed, unquoteDashes).reverse(); - } - for (var i = 0; i < nPathSegments; i++) { - var param = pathParams[i]; - var value = match[i + 1]; - // if the param value matches a pre-replace pair, replace the value before decoding. - for (var j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === value) - value = param.replace[j].to; - } - if (value && param.array === true) - value = decodePathArray(value); - values[param.id] = this._getDecodedParamValue(value, param); - } - searchParams.forEach(function (param) { - var value = search[param.id]; - for (var j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === value) - value = param.replace[j].to; - } - values[param.id] = _this._getDecodedParamValue(value, param); - }); - if (hash) - values['#'] = hash; - return values; - }; - /** - * @internal - * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance. - * - * @returns {Array.} An array of [[Param]] objects. Must be treated as read-only. If the - * pattern has no parameters, an empty array is returned. - */ - UrlMatcher.prototype.parameters = function (opts) { - if (opts === void 0) { opts = {}; } - if (opts.inherit === false) - return this._params; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.unnest)(this._cache.path.map(function (matcher) { return matcher._params; })); - }; - /** - * @internal - * Returns a single parameter from this UrlMatcher by id - * - * @param id - * @param opts - * @returns {T|Param|any|boolean|UrlMatcher|null} - */ - UrlMatcher.prototype.parameter = function (id, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var findParam = function () { - for (var _i = 0, _a = _this._params; _i < _a.length; _i++) { - var param = _a[_i]; - if (param.id === id) - return param; - } - }; - var parent = this._cache.parent; - return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null; - }; - /** - * Validates the input parameter values against this UrlMatcher - * - * Checks an object hash of parameters to validate their correctness according to the parameter - * types of this `UrlMatcher`. - * - * @param params The object hash of parameters to validate. - * @returns Returns `true` if `params` validates, otherwise `false`. - */ - UrlMatcher.prototype.validates = function (params) { - var validParamVal = function (param, val) { return !param || param.validates(val); }; - params = params || {}; - // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher - var paramSchema = this.parameters().filter(function (paramDef) { return params.hasOwnProperty(paramDef.id); }); - return paramSchema.map(function (paramDef) { return validParamVal(paramDef, params[paramDef.id]); }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.allTrueR, true); - }; - /** - * Given a set of parameter values, creates a URL from this UrlMatcher. - * - * Creates a URL that matches this pattern by substituting the specified values - * for the path and search parameters. - * - * #### Example: - * ```js - * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' }); - * // returns '/user/bob?q=yes' - * ``` - * - * @param values the values to substitute for the parameters in this pattern. - * @returns the formatted URL (path and optionally search part). - */ - UrlMatcher.prototype.format = function (values) { - if (values === void 0) { values = {}; } - // Build the full path of UrlMatchers (including all parent UrlMatchers) - var urlMatchers = this._cache.path; - // Extract all the static segments and Params (processed as ParamDetails) - // into an ordered array - var pathSegmentsAndParams = urlMatchers - .map(UrlMatcher.pathSegmentsAndParams) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .map(function (x) { return ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(x) ? x : getDetails(x)); }); - // Extract the query params into a separate array - var queryParams = urlMatchers - .map(UrlMatcher.queryParams) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .map(getDetails); - var isInvalid = function (param) { return param.isValid === false; }; - if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) { - return null; - } - /** - * Given a Param, applies the parameter value, then returns detailed information about it - */ - function getDetails(param) { - // Normalize to typed value - var value = param.value(values[param.id]); - var isValid = param.validates(value); - var isDefaultValue = param.isDefaultValue(value); - // Check if we're in squash mode for the parameter - var squash = isDefaultValue ? param.squash : false; - // Allow the Parameter's Type to encode the value - var encoded = param.type.encode(value); - return { param: param, value: value, isValid: isValid, isDefaultValue: isDefaultValue, squash: squash, encoded: encoded }; - } - // Build up the path-portion from the list of static segments and parameters - var pathString = pathSegmentsAndParams.reduce(function (acc, x) { - // The element is a static segment (a raw string); just append it - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(x)) - return acc + x; - // Otherwise, it's a ParamDetails. - var squash = x.squash, encoded = x.encoded, param = x.param; - // If squash is === true, try to remove a slash from the path - if (squash === true) - return acc.match(/\/$/) ? acc.slice(0, -1) : acc; - // If squash is a string, use the string for the param value - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(squash)) - return acc + squash; - if (squash !== false) - return acc; // ? - if (encoded == null) - return acc; - // If this parameter value is an array, encode the value using encodeDashes - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(encoded)) - return acc + (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(encoded, UrlMatcher.encodeDashes).join('-'); - // If the parameter type is "raw", then do not encodeURIComponent - if (param.raw) - return acc + encoded; - // Encode the value - return acc + encodeURIComponent(encoded); - }, ''); - // Build the query string by applying parameter values (array or regular) - // then mapping to key=value, then flattening and joining using "&" - var queryString = queryParams - .map(function (paramDetails) { - var param = paramDetails.param, squash = paramDetails.squash, encoded = paramDetails.encoded, isDefaultValue = paramDetails.isDefaultValue; - if (encoded == null || (isDefaultValue && squash !== false)) - return; - if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(encoded)) - encoded = [encoded]; - if (encoded.length === 0) - return; - if (!param.raw) - encoded = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(encoded, encodeURIComponent); - return encoded.map(function (val) { return param.id + "=" + val; }); - }) - .filter(_common_common__WEBPACK_IMPORTED_MODULE_0__.identity) - .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .join('&'); - // Concat the pathstring with the queryString (if exists) and the hashString (if exists) - return pathString + (queryString ? "?" + queryString : '') + (values['#'] ? '#' + values['#'] : ''); - }; - /** @internal */ - UrlMatcher.nameValidator = /^\w+([-.]+\w+)*(?:\[\])?$/; - return UrlMatcher; -}()); - -//# sourceMappingURL=urlMatcher.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js ***! - \**********************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ParamFactory": () => (/* binding */ ParamFactory), -/* harmony export */ "UrlMatcherFactory": () => (/* binding */ UrlMatcherFactory) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlMatcher */ "./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"); -/* harmony import */ var _params__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../params */ "./node_modules/@uirouter/core/lib-esm/params/index.js"); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - - - -var ParamFactory = /** @class */ (function () { - function ParamFactory(router) { - this.router = router; - } - ParamFactory.prototype.fromConfig = function (id, type, state) { - return new _params__WEBPACK_IMPORTED_MODULE_2__.Param(id, type, _params__WEBPACK_IMPORTED_MODULE_2__.DefType.CONFIG, this.router.urlService.config, state); - }; - ParamFactory.prototype.fromPath = function (id, type, state) { - return new _params__WEBPACK_IMPORTED_MODULE_2__.Param(id, type, _params__WEBPACK_IMPORTED_MODULE_2__.DefType.PATH, this.router.urlService.config, state); - }; - ParamFactory.prototype.fromSearch = function (id, type, state) { - return new _params__WEBPACK_IMPORTED_MODULE_2__.Param(id, type, _params__WEBPACK_IMPORTED_MODULE_2__.DefType.SEARCH, this.router.urlService.config, state); - }; - return ParamFactory; -}()); - -/** - * Factory for [[UrlMatcher]] instances. - * - * The factory is available to ng1 services as - * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`. - */ -var UrlMatcherFactory = /** @class */ (function () { - // TODO: move implementations to UrlConfig (urlService.config) - function UrlMatcherFactory(/** @internal */ router) { - var _this = this; - this.router = router; - /** Creates a new [[Param]] for a given location (DefType) */ - this.paramFactory = new ParamFactory(this.router); - // TODO: Check if removal of this will break anything, then remove these - this.UrlMatcher = _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher; - this.Param = _params__WEBPACK_IMPORTED_MODULE_2__.Param; - /** @deprecated use [[UrlConfig.caseInsensitive]] */ - this.caseInsensitive = function (value) { return _this.router.urlService.config.caseInsensitive(value); }; - /** @deprecated use [[UrlConfig.defaultSquashPolicy]] */ - this.defaultSquashPolicy = function (value) { return _this.router.urlService.config.defaultSquashPolicy(value); }; - /** @deprecated use [[UrlConfig.strictMode]] */ - this.strictMode = function (value) { return _this.router.urlService.config.strictMode(value); }; - /** @deprecated use [[UrlConfig.type]] */ - this.type = function (name, definition, definitionFn) { - return _this.router.urlService.config.type(name, definition, definitionFn) || _this; - }; - } - /** - * Creates a [[UrlMatcher]] for the specified pattern. - * - * @param pattern The URL pattern. - * @param config The config object hash. - * @returns The UrlMatcher. - */ - UrlMatcherFactory.prototype.compile = function (pattern, config) { - var urlConfig = this.router.urlService.config; - // backward-compatible support for config.params -> config.state.params - var params = config && !config.state && config.params; - config = params ? __assign({ state: { params: params } }, config) : config; - var globalConfig = { - strict: urlConfig._isStrictMode, - caseInsensitive: urlConfig._isCaseInsensitive, - decodeParams: urlConfig._decodeParams, - }; - return new _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, (0,_common__WEBPACK_IMPORTED_MODULE_0__.extend)(globalConfig, config)); - }; - /** - * Returns true if the specified object is a [[UrlMatcher]], or false otherwise. - * - * @param object The object to perform the type check against. - * @returns `true` if the object matches the `UrlMatcher` interface, by - * implementing all the same methods. - */ - UrlMatcherFactory.prototype.isMatcher = function (object) { - // TODO: typeof? - if (!(0,_common__WEBPACK_IMPORTED_MODULE_0__.isObject)(object)) - return false; - var result = true; - (0,_common__WEBPACK_IMPORTED_MODULE_0__.forEach)(_urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher.prototype, function (val, name) { - if ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isFunction)(val)) - result = result && (0,_common__WEBPACK_IMPORTED_MODULE_0__.isDefined)(object[name]) && (0,_common__WEBPACK_IMPORTED_MODULE_0__.isFunction)(object[name]); - }); - return result; - }; - /** @internal */ - UrlMatcherFactory.prototype.$get = function () { - var urlConfig = this.router.urlService.config; - urlConfig.paramTypes.enqueue = false; - urlConfig.paramTypes._flushTypeQueue(); - return this; - }; - return UrlMatcherFactory; -}()); - -//# sourceMappingURL=urlMatcherFactory.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlRouter.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlRouter.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlRouter": () => (/* binding */ UrlRouter) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _urlRule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlRule */ "./node_modules/@uirouter/core/lib-esm/url/urlRule.js"); - - -function appendBasePath(url, isHtml5, absolute, baseHref) { - if (baseHref === '/') - return url; - if (isHtml5) - return (0,_common__WEBPACK_IMPORTED_MODULE_0__.stripLastPathElement)(baseHref) + url; - if (absolute) - return baseHref.slice(1) + url; - return url; -} -/** - * Updates URL and responds to URL changes - * - * ### Deprecation warning: - * This class is now considered to be an internal API - * Use the [[UrlService]] instead. - * For configuring URL rules, use the [[UrlRules]] which can be found as [[UrlService.rules]]. - */ -var UrlRouter = /** @class */ (function () { - /** @internal */ - function UrlRouter(/** @internal */ router) { - var _this = this; - this.router = router; - // Delegate these calls to [[UrlService]] - /** @deprecated use [[UrlService.sync]]*/ - this.sync = function (evt) { return _this.router.urlService.sync(evt); }; - /** @deprecated use [[UrlService.listen]]*/ - this.listen = function (enabled) { return _this.router.urlService.listen(enabled); }; - /** @deprecated use [[UrlService.deferIntercept]]*/ - this.deferIntercept = function (defer) { return _this.router.urlService.deferIntercept(defer); }; - /** @deprecated use [[UrlService.match]]*/ - this.match = function (urlParts) { return _this.router.urlService.match(urlParts); }; - // Delegate these calls to [[UrlRules]] - /** @deprecated use [[UrlRules.initial]]*/ - this.initial = function (handler) { - return _this.router.urlService.rules.initial(handler); - }; - /** @deprecated use [[UrlRules.otherwise]]*/ - this.otherwise = function (handler) { - return _this.router.urlService.rules.otherwise(handler); - }; - /** @deprecated use [[UrlRules.removeRule]]*/ - this.removeRule = function (rule) { return _this.router.urlService.rules.removeRule(rule); }; - /** @deprecated use [[UrlRules.rule]]*/ - this.rule = function (rule) { return _this.router.urlService.rules.rule(rule); }; - /** @deprecated use [[UrlRules.rules]]*/ - this.rules = function () { return _this.router.urlService.rules.rules(); }; - /** @deprecated use [[UrlRules.sort]]*/ - this.sort = function (compareFn) { return _this.router.urlService.rules.sort(compareFn); }; - /** @deprecated use [[UrlRules.when]]*/ - this.when = function (matcher, handler, options) { return _this.router.urlService.rules.when(matcher, handler, options); }; - this.urlRuleFactory = new _urlRule__WEBPACK_IMPORTED_MODULE_1__.UrlRuleFactory(router); - } - /** Internal API. */ - UrlRouter.prototype.update = function (read) { - var $url = this.router.locationService; - if (read) { - this.location = $url.url(); - return; - } - if ($url.url() === this.location) - return; - $url.url(this.location, true); - }; - /** - * Internal API. - * - * Pushes a new location to the browser history. - * - * @internal - * @param urlMatcher - * @param params - * @param options - */ - UrlRouter.prototype.push = function (urlMatcher, params, options) { - var replace = options && !!options.replace; - this.router.urlService.url(urlMatcher.format(params || {}), replace); - }; - /** - * Builds and returns a URL with interpolated parameters - * - * #### Example: - * ```js - * matcher = $umf.compile("/about/:person"); - * params = { person: "bob" }; - * $bob = $urlRouter.href(matcher, params); - * // $bob == "/about/bob"; - * ``` - * - * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate. - * @param params An object of parameter values to fill the matcher's required parameters. - * @param options Options object. The options are: - * - * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". - * - * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` - */ - UrlRouter.prototype.href = function (urlMatcher, params, options) { - var url = urlMatcher.format(params); - if (url == null) - return null; - options = options || { absolute: false }; - var cfg = this.router.urlService.config; - var isHtml5 = cfg.html5Mode(); - if (!isHtml5 && url !== null) { - url = '#' + cfg.hashPrefix() + url; - } - url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref()); - if (!options.absolute || !url) { - return url; - } - var slash = !isHtml5 && url ? '/' : ''; - var cfgPort = cfg.port(); - var port = (cfgPort === 80 || cfgPort === 443 ? '' : ':' + cfgPort); - return [cfg.protocol(), '://', cfg.host(), port, slash, url].join(''); - }; - Object.defineProperty(UrlRouter.prototype, "interceptDeferred", { - /** @deprecated use [[UrlService.interceptDeferred]]*/ - get: function () { - return this.router.urlService.interceptDeferred; - }, - enumerable: false, - configurable: true - }); - return UrlRouter; -}()); - -//# sourceMappingURL=urlRouter.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlRule.js": -/*!************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlRule.js ***! - \************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlRuleFactory": () => (/* binding */ UrlRuleFactory), -/* harmony export */ "BaseUrlRule": () => (/* binding */ BaseUrlRule) -/* harmony export */ }); -/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./urlMatcher */ "./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _state_stateObject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../state/stateObject */ "./node_modules/@uirouter/core/lib-esm/state/stateObject.js"); - - - - - -/** - * Creates a [[UrlRule]] - * - * Creates a [[UrlRule]] from a: - * - * - `string` - * - [[UrlMatcher]] - * - `RegExp` - * - [[StateObject]] - */ -var UrlRuleFactory = /** @class */ (function () { - function UrlRuleFactory(router) { - this.router = router; - } - UrlRuleFactory.prototype.compile = function (str) { - return this.router.urlMatcherFactory.compile(str); - }; - UrlRuleFactory.prototype.create = function (what, handler) { - var _this = this; - var isState = _state_stateObject__WEBPACK_IMPORTED_MODULE_4__.StateObject.isState, isStateDeclaration = _state_stateObject__WEBPACK_IMPORTED_MODULE_4__.StateObject.isStateDeclaration; - var makeRule = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([ - [_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString, function (_what) { return makeRule(_this.compile(_what)); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(_urlMatcher__WEBPACK_IMPORTED_MODULE_0__.UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.or)(isState, isStateDeclaration), function (_what) { return _this.fromState(_what, _this.router); }], - [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }], - [_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction, function (_what) { return new BaseUrlRule(_what, handler); }], - ]); - var rule = makeRule(what); - if (!rule) - throw new Error("invalid 'what' in when()"); - return rule; - }; - /** - * A UrlRule which matches based on a UrlMatcher - * - * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]] - * - * ## Handler as a function - * - * If `handler` is a function, the function is invoked with: - * - * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]]) - * - url: the current Url ([[UrlParts]]) - * - router: the router object ([[UIRouter]]) - * - * #### Example: - * ```js - * var urlMatcher = $umf.compile("/foo/:fooId/:barId"); - * var rule = factory.fromUrlMatcher(urlMatcher, match => "/home/" + match.fooId + "/" + match.barId); - * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' } - * var result = rule.handler(match); // '/home/123/456' - * ``` - * - * ## Handler as UrlMatcher - * - * If `handler` is a UrlMatcher, the handler matcher is used to create the new url. - * The `handler` UrlMatcher is formatted using the matched param from the first matcher. - * The url is replaced with the result. - * - * #### Example: - * ```js - * var urlMatcher = $umf.compile("/foo/:fooId/:barId"); - * var handler = $umf.compile("/home/:fooId/:barId"); - * var rule = factory.fromUrlMatcher(urlMatcher, handler); - * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' } - * var result = rule.handler(match); // '/home/123/456' - * ``` - */ - UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) { - var _handler = handler; - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(handler)) - handler = this.router.urlMatcherFactory.compile(handler); - if ((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(_urlMatcher__WEBPACK_IMPORTED_MODULE_0__.UrlMatcher)(handler)) - _handler = function (match) { return handler.format(match); }; - function matchUrlParamters(url) { - var params = urlMatcher.exec(url.path, url.search, url.hash); - return urlMatcher.validates(params) && params; - } - // Prioritize URLs, lowest to highest: - // - Some optional URL parameters, but none matched - // - No optional parameters in URL - // - Some optional parameters, some matched - // - Some optional parameters, all matched - function matchPriority(params) { - var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; }); - if (!optional.length) - return 0.000001; - var matched = optional.filter(function (param) { return params[param.id]; }); - return matched.length / optional.length; - } - var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: 'URLMATCHER' }; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.extend)(new BaseUrlRule(matchUrlParamters, _handler), details); - }; - /** - * A UrlRule which matches a state by its url - * - * #### Example: - * ```js - * var rule = factory.fromState($state.get('foo'), router); - * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' } - * var result = rule.handler(match); - * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' } - * ``` - */ - UrlRuleFactory.prototype.fromState = function (stateOrDecl, router) { - var state = _state_stateObject__WEBPACK_IMPORTED_MODULE_4__.StateObject.isStateDeclaration(stateOrDecl) ? stateOrDecl.$$state() : stateOrDecl; - /** - * Handles match by transitioning to matched state - * - * First checks if the router should start a new transition. - * A new transition is not required if the current state's URL - * and the new URL are already identical - */ - var handler = function (match) { - var $state = router.stateService; - var globals = router.globals; - if ($state.href(state, match) !== $state.href(globals.current, globals.params)) { - $state.transitionTo(state, match, { inherit: true, source: 'url' }); - } - }; - var details = { state: state, type: 'STATE' }; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.extend)(this.fromUrlMatcher(state.url, handler), details); - }; - /** - * A UrlRule which matches based on a regular expression - * - * The `handler` may be either a [[UrlRuleHandlerFn]] or a string. - * - * ## Handler as a function - * - * If `handler` is a function, the function is invoked with: - * - * - regexp match array (from `regexp`) - * - url: the current Url ([[UrlParts]]) - * - router: the router object ([[UIRouter]]) - * - * #### Example: - * ```js - * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, match => "/home/" + match[1]) - * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ] - * var result = rule.handler(match); // '/home/bar' - * ``` - * - * ## Handler as string - * - * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked. - * The string is first interpolated using `string.replace()` style pattern. - * - * #### Example: - * ```js - * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, "/home/$1") - * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ] - * var result = rule.handler(match); // '/home/bar' - * ``` - */ - UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) { - if (regexp.global || regexp.sticky) - throw new Error('Rule RegExp must not be global or sticky'); - /** - * If handler is a string, the url will be replaced by the string. - * If the string has any String.replace() style variables in it (like `$2`), - * they will be replaced by the captures from [[match]] - */ - var redirectUrlTo = function (match) { - // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern - return handler.replace(/\$(\$|\d{1,2})/, function (m, what) { return match[what === '$' ? 0 : Number(what)]; }); - }; - var _handler = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(handler) ? redirectUrlTo : handler; - var matchParamsFromRegexp = function (url) { return regexp.exec(url.path); }; - var details = { regexp: regexp, type: 'REGEXP' }; - return (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.extend)(new BaseUrlRule(matchParamsFromRegexp, _handler), details); - }; - UrlRuleFactory.isUrlRule = function (obj) { return obj && ['type', 'match', 'handler'].every(function (key) { return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(obj[key]); }); }; - return UrlRuleFactory; -}()); - -/** - * A base rule which calls `match` - * - * The value from the `match` function is passed through to the `handler`. - * @internal - */ -var BaseUrlRule = /** @class */ (function () { - function BaseUrlRule(match, handler) { - var _this = this; - this.match = match; - this.type = 'RAW'; - this.matchPriority = function (match) { return 0 - _this.$id; }; - this.handler = handler || _common_common__WEBPACK_IMPORTED_MODULE_2__.identity; - } - return BaseUrlRule; -}()); - -//# sourceMappingURL=urlRule.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlRules.js": -/*!*************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlRules.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlRules": () => (/* binding */ UrlRules) -/* harmony export */ }); -/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ "./node_modules/@uirouter/core/lib-esm/state/index.js"); -/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlMatcher */ "./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _urlRule__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./urlRule */ "./node_modules/@uirouter/core/lib-esm/url/urlRule.js"); - - - - -var prioritySort = function (a, b) { return (b.priority || 0) - (a.priority || 0); }; -var typeSort = function (a, b) { - var weights = { STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1 }; - return (weights[a.type] || 0) - (weights[b.type] || 0); -}; -var urlMatcherSort = function (a, b) { - return !a.urlMatcher || !b.urlMatcher ? 0 : _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher.compare(a.urlMatcher, b.urlMatcher); -}; -var idSort = function (a, b) { - // Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL - var useMatchPriority = { STATE: true, URLMATCHER: true }; - var equal = useMatchPriority[a.type] && useMatchPriority[b.type]; - return equal ? 0 : (a.$id || 0) - (b.$id || 0); -}; -/** - * Default rule priority sorting function. - * - * Sorts rules by: - * - * - Explicit priority (set rule priority using [[UrlRules.when]]) - * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1) - * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule. - * - Rule registration order (for rule types other than STATE and URLMATCHER) - * - Equally sorted State and UrlMatcher rules will each match the URL. - * Then, the *best* match is chosen based on how many parameter values were matched. - */ -var defaultRuleSortFn; -defaultRuleSortFn = function (a, b) { - var cmp = prioritySort(a, b); - if (cmp !== 0) - return cmp; - cmp = typeSort(a, b); - if (cmp !== 0) - return cmp; - cmp = urlMatcherSort(a, b); - if (cmp !== 0) - return cmp; - return idSort(a, b); -}; -function getHandlerFn(handler) { - if (!(0,_common__WEBPACK_IMPORTED_MODULE_2__.isFunction)(handler) && !(0,_common__WEBPACK_IMPORTED_MODULE_2__.isString)(handler) && !(0,_common__WEBPACK_IMPORTED_MODULE_2__.is)(_state__WEBPACK_IMPORTED_MODULE_0__.TargetState)(handler) && !_state__WEBPACK_IMPORTED_MODULE_0__.TargetState.isDef(handler)) { - throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property"); - } - return (0,_common__WEBPACK_IMPORTED_MODULE_2__.isFunction)(handler) ? handler : (0,_common__WEBPACK_IMPORTED_MODULE_2__.val)(handler); -} -/** - * API for managing URL rules - * - * This API is used to create and manage URL rules. - * URL rules are a mechanism to respond to specific URL patterns. - * - * The most commonly used methods are [[otherwise]] and [[when]]. - * - * This API is found at `router.urlService.rules` (see: [[UIRouter.urlService]], [[URLService.rules]]) - */ -var UrlRules = /** @class */ (function () { - /** @internal */ - function UrlRules(/** @internal */ router) { - this.router = router; - /** @internal */ this._sortFn = defaultRuleSortFn; - /** @internal */ this._rules = []; - /** @internal */ this._id = 0; - this.urlRuleFactory = new _urlRule__WEBPACK_IMPORTED_MODULE_3__.UrlRuleFactory(router); - } - /** @internal */ - UrlRules.prototype.dispose = function (router) { - this._rules = []; - delete this._otherwiseFn; - }; - /** - * Defines the initial state, path, or behavior to use when the app starts. - * - * This rule defines the initial/starting state for the application. - * - * This rule is triggered the first time the URL is checked (when the app initially loads). - * The rule is triggered only when the url matches either `""` or `"/"`. - * - * Note: The rule is intended to be used when the root of the application is directly linked to. - * When the URL is *not* `""` or `"/"` and doesn't match other rules, the [[otherwise]] rule is triggered. - * This allows 404-like behavior when an unknown URL is deep-linked. - * - * #### Example: - * Start app at `home` state. - * ```js - * .initial({ state: 'home' }); - * ``` - * - * #### Example: - * Start app at `/home` (by url) - * ```js - * .initial('/home'); - * ``` - * - * #### Example: - * When no other url rule matches, go to `home` state - * ```js - * .initial((matchValue, url, router) => { - * console.log('initial state'); - * return { state: 'home' }; - * }) - * ``` - * - * @param handler The initial state or url path, or a function which returns the state or url path (or performs custom logic). - */ - UrlRules.prototype.initial = function (handler) { - var handlerFn = getHandlerFn(handler); - var matchFn = function (urlParts, router) { - return router.globals.transitionHistory.size() === 0 && !!/^\/?$/.exec(urlParts.path); - }; - this.rule(this.urlRuleFactory.create(matchFn, handlerFn)); - }; - /** - * Defines the state, url, or behavior to use when no other rule matches the URL. - * - * This rule is matched when *no other rule* matches. - * It is generally used to handle unknown URLs (similar to "404" behavior, but on the client side). - * - * - If `handler` a string, it is treated as a url redirect - * - * #### Example: - * When no other url rule matches, redirect to `/index` - * ```js - * .otherwise('/index'); - * ``` - * - * - If `handler` is an object with a `state` property, the state is activated. - * - * #### Example: - * When no other url rule matches, redirect to `home` and provide a `dashboard` parameter value. - * ```js - * .otherwise({ state: 'home', params: { dashboard: 'default' } }); - * ``` - * - * - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[UIRouter]] object. - * The function can perform actions, and/or return a value. - * - * #### Example: - * When no other url rule matches, manually trigger a transition to the `home` state - * ```js - * .otherwise((matchValue, urlParts, router) => { - * router.stateService.go('home'); - * }); - * ``` - * - * #### Example: - * When no other url rule matches, go to `home` state - * ```js - * .otherwise((matchValue, urlParts, router) => { - * return { state: 'home' }; - * }); - * ``` - * - * @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic). - */ - UrlRules.prototype.otherwise = function (handler) { - var handlerFn = getHandlerFn(handler); - this._otherwiseFn = this.urlRuleFactory.create((0,_common__WEBPACK_IMPORTED_MODULE_2__.val)(true), handlerFn); - this._sorted = false; - }; - /** - * Remove a rule previously registered - * - * @param rule the matcher rule that was previously registered using [[rule]] - */ - UrlRules.prototype.removeRule = function (rule) { - (0,_common__WEBPACK_IMPORTED_MODULE_2__.removeFrom)(this._rules, rule); - }; - /** - * Manually adds a URL Rule. - * - * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]]. - * This api can be used directly for more control (to register a [[BaseUrlRule]], for example). - * Rules can be created using [[urlRuleFactory]], or created manually as simple objects. - * - * A rule should have a `match` function which returns truthy if the rule matched. - * It should also have a `handler` function which is invoked if the rule is the best match. - * - * @return a function that deregisters the rule - */ - UrlRules.prototype.rule = function (rule) { - var _this = this; - if (!_urlRule__WEBPACK_IMPORTED_MODULE_3__.UrlRuleFactory.isUrlRule(rule)) - throw new Error('invalid rule'); - rule.$id = this._id++; - rule.priority = rule.priority || 0; - this._rules.push(rule); - this._sorted = false; - return function () { return _this.removeRule(rule); }; - }; - /** - * Gets all registered rules - * - * @returns an array of all the registered rules - */ - UrlRules.prototype.rules = function () { - this.ensureSorted(); - return this._rules.concat(this._otherwiseFn ? [this._otherwiseFn] : []); - }; - /** - * Defines URL Rule priorities - * - * More than one rule ([[UrlRule]]) might match a given URL. - * This `compareFn` is used to sort the rules by priority. - * Higher priority rules should sort earlier. - * - * The [[defaultRuleSortFn]] is used by default. - * - * You only need to call this function once. - * The `compareFn` will be used to sort the rules as each is registered. - * - * If called without any parameter, it will re-sort the rules. - * - * --- - * - * Url rules may come from multiple sources: states's urls ([[StateDeclaration.url]]), [[when]], and [[rule]]. - * Each rule has a (user-provided) [[UrlRule.priority]], a [[UrlRule.type]], and a [[UrlRule.$id]] - * The `$id` is is the order in which the rule was registered. - * - * The sort function should use these data, or data found on a specific type - * of [[UrlRule]] (such as [[StateRule.state]]), to order the rules as desired. - * - * #### Example: - * This compare function prioritizes rules by the order in which the rules were registered. - * A rule registered earlier has higher priority. - * - * ```js - * function compareFn(a, b) { - * return a.$id - b.$id; - * } - * ``` - * - * @param compareFn a function that compares to [[UrlRule]] objects. - * The `compareFn` should abide by the `Array.sort` compare function rules. - * Given two rules, `a` and `b`, return a negative number if `a` should be higher priority. - * Return a positive number if `b` should be higher priority. - * Return `0` if the rules are identical. - * - * See the [mozilla reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description) - * for details. - */ - UrlRules.prototype.sort = function (compareFn) { - var sorted = this.stableSort(this._rules, (this._sortFn = compareFn || this._sortFn)); - // precompute _sortGroup values and apply to each rule - var group = 0; - for (var i = 0; i < sorted.length; i++) { - sorted[i]._group = group; - if (i < sorted.length - 1 && this._sortFn(sorted[i], sorted[i + 1]) !== 0) { - group++; - } - } - this._rules = sorted; - this._sorted = true; - }; - /** @internal */ - UrlRules.prototype.ensureSorted = function () { - this._sorted || this.sort(); - }; - /** @internal */ - UrlRules.prototype.stableSort = function (arr, compareFn) { - var arrOfWrapper = arr.map(function (elem, idx) { return ({ elem: elem, idx: idx }); }); - arrOfWrapper.sort(function (wrapperA, wrapperB) { - var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem); - return cmpDiff === 0 ? wrapperA.idx - wrapperB.idx : cmpDiff; - }); - return arrOfWrapper.map(function (wrapper) { return wrapper.elem; }); - }; - /** - * Registers a `matcher` and `handler` for custom URLs handling. - * - * The `matcher` can be: - * - * - a [[UrlMatcher]]: See: [[UrlMatcherFactory.compile]] - * - a `string`: The string is compiled to a [[UrlMatcher]] - * - a `RegExp`: The regexp is used to match the url. - * - * The `handler` can be: - * - * - a string: The url is redirected to the value of the string. - * - a function: The url is redirected to the return value of the function. - * - * --- - * - * When the `handler` is a `string` and the `matcher` is a `UrlMatcher` (or string), the redirect - * string is interpolated with parameter values. - * - * #### Example: - * When the URL is `/foo/123` the rule will redirect to `/bar/123`. - * ```js - * .when("/foo/:param1", "/bar/:param1") - * ``` - * - * --- - * - * When the `handler` is a string and the `matcher` is a `RegExp`, the redirect string is - * interpolated with capture groups from the RegExp. - * - * #### Example: - * When the URL is `/foo/123` the rule will redirect to `/bar/123`. - * ```js - * .when(new RegExp("^/foo/(.*)$"), "/bar/$1"); - * ``` - * - * --- - * - * When the handler is a function, it receives the matched value, the current URL, and the `UIRouter` object (See [[UrlRuleHandlerFn]]). - * The "matched value" differs based on the `matcher`. - * For [[UrlMatcher]]s, it will be the matched state params. - * For `RegExp`, it will be the match array from `regexp.exec()`. - * - * If the handler returns a string, the URL is redirected to the string. - * - * #### Example: - * When the URL is `/foo/123` the rule will redirect to `/bar/123`. - * ```js - * .when(new RegExp("^/foo/(.*)$"), match => "/bar/" + match[1]); - * ``` - * - * Note: the `handler` may also invoke arbitrary code, such as `$state.go()` - * - * @param matcher A pattern `string` to match, compiled as a [[UrlMatcher]], or a `RegExp`. - * @param handler The path to redirect to, or a function that returns the path. - * @param options `{ priority: number }` - * - * @return the registered [[UrlRule]] - */ - UrlRules.prototype.when = function (matcher, handler, options) { - var rule = this.urlRuleFactory.create(matcher, handler); - if ((0,_common__WEBPACK_IMPORTED_MODULE_2__.isDefined)(options && options.priority)) - rule.priority = options.priority; - this.rule(rule); - return rule; - }; - return UrlRules; -}()); - -//# sourceMappingURL=urlRules.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/url/urlService.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/url/urlService.js ***! - \***************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "UrlService": () => (/* binding */ UrlService) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _urlRules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlRules */ "./node_modules/@uirouter/core/lib-esm/url/urlRules.js"); -/* harmony import */ var _urlConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./urlConfig */ "./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"); -/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../state */ "./node_modules/@uirouter/core/lib-esm/state/index.js"); - - - - -/** - * API for URL management - */ -var UrlService = /** @class */ (function () { - /** @internal */ - function UrlService(/** @internal */ router) { - var _this = this; - this.router = router; - /** @internal */ this.interceptDeferred = false; - /** - * The nested [[UrlRules]] API for managing URL rules and rewrites - * - * See: [[UrlRules]] for details - */ - this.rules = new _urlRules__WEBPACK_IMPORTED_MODULE_1__.UrlRules(this.router); - /** - * The nested [[UrlConfig]] API to configure the URL and retrieve URL information - * - * See: [[UrlConfig]] for details - */ - this.config = new _urlConfig__WEBPACK_IMPORTED_MODULE_2__.UrlConfig(this.router); - // Delegate these calls to the current LocationServices implementation - /** - * Gets the current url, or updates the url - * - * ### Getting the current URL - * - * When no arguments are passed, returns the current URL. - * The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values. - * - * For example, the URL may be stored in the hash ([[HashLocationServices]]) or - * have a base HREF prepended ([[PushStateLocationServices]]). - * - * The raw URL in the browser might be: - * - * ``` - * http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor - * ``` - * - * or - * - * ``` - * http://mysite.com/basepath/internal/path/123?param1=foo#anchor - * ``` - * - * then this method returns: - * - * ``` - * /internal/path/123?param1=foo#anchor - * ``` - * - * - * #### Example: - * ```js - * locationServices.url(); // "/some/path?query=value#anchor" - * ``` - * - * ### Updating the URL - * - * When `newurl` arguments is provided, changes the URL to reflect `newurl` - * - * #### Example: - * ```js - * locationServices.url("/some/path?query=value#anchor", true); - * ``` - * - * @param newurl The new value for the URL. - * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values. - * It should not include the protocol, site, port, or base path of an absolute HREF. - * @param replace When true, replaces the current history entry (instead of appending it) with this new url - * @param state The history's state object, i.e., pushState (if the LocationServices implementation supports it) - * - * @return the url (after potentially being processed) - */ - this.url = function (newurl, replace, state) { - return _this.router.locationService.url(newurl, replace, state); - }; - /** - * Gets the path part of the current url - * - * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path` - * - * @return the path portion of the url - */ - this.path = function () { return _this.router.locationService.path(); }; - /** - * Gets the search part of the current url as an object - * - * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }` - * - * @return the search (query) portion of the url, as an object - */ - this.search = function () { return _this.router.locationService.search(); }; - /** - * Gets the hash part of the current url - * - * If the current URL is `/some/path?query=value#anchor`, this returns `anchor` - * - * @return the hash (anchor) portion of the url - */ - this.hash = function () { return _this.router.locationService.hash(); }; - /** - * @internal - * - * Registers a low level url change handler - * - * Note: Because this is a low level handler, it's not recommended for general use. - * - * #### Example: - * ```js - * let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt)); - * ``` - * - * @param callback a function that will be called when the url is changing - * @return a function that de-registers the callback - */ - this.onChange = function (callback) { return _this.router.locationService.onChange(callback); }; - } - /** @internal */ - UrlService.prototype.dispose = function () { - this.listen(false); - this.rules.dispose(); - }; - /** - * Gets the current URL parts - * - * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object. - */ - UrlService.prototype.parts = function () { - return { path: this.path(), search: this.search(), hash: this.hash() }; - }; - /** - * Activates the best rule for the current URL - * - * Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler. - * This method is called internally any time the URL has changed. - * - * This effectively activates the state (or redirect, etc) which matches the current URL. - * - * #### Example: - * ```js - * urlService.deferIntercept(); - * - * fetch('/states.json').then(resp => resp.json()).then(data => { - * data.forEach(state => $stateRegistry.register(state)); - * urlService.listen(); - * // Find the matching URL and invoke the handler. - * urlService.sync(); - * }); - * ``` - */ - UrlService.prototype.sync = function (evt) { - if (evt && evt.defaultPrevented) - return; - var _a = this.router, urlService = _a.urlService, stateService = _a.stateService; - var url = { path: urlService.path(), search: urlService.search(), hash: urlService.hash() }; - var best = this.match(url); - var applyResult = (0,_common__WEBPACK_IMPORTED_MODULE_0__.pattern)([ - [_common__WEBPACK_IMPORTED_MODULE_0__.isString, function (newurl) { return urlService.url(newurl, true); }], - [_state__WEBPACK_IMPORTED_MODULE_3__.TargetState.isDef, function (def) { return stateService.go(def.state, def.params, def.options); }], - [(0,_common__WEBPACK_IMPORTED_MODULE_0__.is)(_state__WEBPACK_IMPORTED_MODULE_3__.TargetState), function (target) { return stateService.go(target.state(), target.params(), target.options()); }], - ]); - applyResult(best && best.rule.handler(best.match, url, this.router)); - }; - /** - * Starts or stops listening for URL changes - * - * Call this sometime after calling [[deferIntercept]] to start monitoring the url. - * This causes UI-Router to start listening for changes to the URL, if it wasn't already listening. - * - * If called with `false`, UI-Router will stop listening (call listen(true) to start listening again). - * - * #### Example: - * ```js - * urlService.deferIntercept(); - * - * fetch('/states.json').then(resp => resp.json()).then(data => { - * data.forEach(state => $stateRegistry.register(state)); - * // Start responding to URL changes - * urlService.listen(); - * urlService.sync(); - * }); - * ``` - * - * @param enabled `true` or `false` to start or stop listening to URL changes - */ - UrlService.prototype.listen = function (enabled) { - var _this = this; - if (enabled === false) { - this._stopListeningFn && this._stopListeningFn(); - delete this._stopListeningFn; - } - else { - return (this._stopListeningFn = - this._stopListeningFn || this.router.urlService.onChange(function (evt) { return _this.sync(evt); })); - } - }; - /** - * Disables monitoring of the URL. - * - * Call this method before UI-Router has bootstrapped. - * It will stop UI-Router from performing the initial url sync. - * - * This can be useful to perform some asynchronous initialization before the router starts. - * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL. - * - * #### Example: - * ```js - * // Prevent UI-Router from automatically intercepting URL changes when it starts; - * urlService.deferIntercept(); - * - * fetch('/states.json').then(resp => resp.json()).then(data => { - * data.forEach(state => $stateRegistry.register(state)); - * urlService.listen(); - * urlService.sync(); - * }); - * ``` - * - * @param defer Indicates whether to defer location change interception. - * Passing no parameter is equivalent to `true`. - */ - UrlService.prototype.deferIntercept = function (defer) { - if (defer === undefined) - defer = true; - this.interceptDeferred = defer; - }; - /** - * Matches a URL - * - * Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule. - * Return the result as a [[MatchResult]]. - */ - UrlService.prototype.match = function (url) { - var _this = this; - url = (0,_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ path: '', search: {}, hash: '' }, url); - var rules = this.rules.rules(); - // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined - var checkRule = function (rule) { - var match = rule.match(url, _this.router); - return match && { match: match, rule: rule, weight: rule.matchPriority(match) }; - }; - // The rules are pre-sorted. - // - Find the first matching rule. - // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`. - // - Choose the rule with the highest match weight. - var best; - for (var i = 0; i < rules.length; i++) { - // Stop when there is a 'best' rule and the next rule sorts differently than it. - if (best && best.rule._group !== rules[i]._group) - break; - var current = checkRule(rules[i]); - // Pick the best MatchResult - best = !best || (current && current.weight > best.weight) ? current : best; - } - return best; - }; - return UrlService; -}()); - -//# sourceMappingURL=urlService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla.js": -/*!********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla.js ***! - \********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _vanilla_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vanilla/index */ "./node_modules/@uirouter/core/lib-esm/vanilla/index.js"); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vanilla_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vanilla_index__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); - -//# sourceMappingURL=vanilla.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "BaseLocationServices": () => (/* binding */ BaseLocationServices) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"); - - -/** A base `LocationServices` */ -var BaseLocationServices = /** @class */ (function () { - function BaseLocationServices(router, fireAfterUpdate) { - var _this = this; - this.fireAfterUpdate = fireAfterUpdate; - this._listeners = []; - this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); }; - this.hash = function () { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(_this._get()).hash; }; - this.path = function () { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(_this._get()).path; }; - this.search = function () { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.getParams)((0,_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(_this._get()).search); }; - this._location = _common__WEBPACK_IMPORTED_MODULE_0__.root.location; - this._history = _common__WEBPACK_IMPORTED_MODULE_0__.root.history; - } - BaseLocationServices.prototype.url = function (url, replace) { - if (replace === void 0) { replace = true; } - if ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isDefined)(url) && url !== this._get()) { - this._set(null, null, url, replace); - if (this.fireAfterUpdate) { - this._listeners.forEach(function (cb) { return cb({ url: url }); }); - } - } - return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.buildUrl)(this); - }; - BaseLocationServices.prototype.onChange = function (cb) { - var _this = this; - this._listeners.push(cb); - return function () { return (0,_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(_this._listeners, cb); }; - }; - BaseLocationServices.prototype.dispose = function (router) { - (0,_common__WEBPACK_IMPORTED_MODULE_0__.deregAll)(this._listeners); - }; - return BaseLocationServices; -}()); - -//# sourceMappingURL=baseLocationService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js ***! - \******************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "BrowserLocationConfig": () => (/* binding */ BrowserLocationConfig) -/* harmony export */ }); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); - -/** A `LocationConfig` that delegates to the browser's `location` object */ -var BrowserLocationConfig = /** @class */ (function () { - function BrowserLocationConfig(router, _isHtml5) { - if (_isHtml5 === void 0) { _isHtml5 = false; } - this._isHtml5 = _isHtml5; - this._baseHref = undefined; - this._hashPrefix = ''; - } - BrowserLocationConfig.prototype.port = function () { - if (location.port) { - return Number(location.port); - } - return this.protocol() === 'https' ? 443 : 80; - }; - BrowserLocationConfig.prototype.protocol = function () { - return location.protocol.replace(/:/g, ''); - }; - BrowserLocationConfig.prototype.host = function () { - return location.hostname; - }; - BrowserLocationConfig.prototype.html5Mode = function () { - return this._isHtml5; - }; - BrowserLocationConfig.prototype.hashPrefix = function (newprefix) { - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isDefined)(newprefix) ? (this._hashPrefix = newprefix) : this._hashPrefix; - }; - BrowserLocationConfig.prototype.baseHref = function (href) { - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isDefined)(href)) - this._baseHref = href; - if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(this._baseHref)) - this._baseHref = this.getBaseHref(); - return this._baseHref; - }; - BrowserLocationConfig.prototype.getBaseHref = function () { - var baseTag = document.getElementsByTagName('base')[0]; - if (baseTag && baseTag.href) { - return baseTag.href.replace(/^([^/:]*:)?\/\/[^/]*/, ''); - } - return this._isHtml5 ? '/' : location.pathname || '/'; - }; - BrowserLocationConfig.prototype.dispose = function () { }; - return BrowserLocationConfig; -}()); - -//# sourceMappingURL=browserLocationConfig.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js ***! - \****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "HashLocationService": () => (/* binding */ HashLocationService) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** A `LocationServices` that uses the browser hash "#" to get/set the current location */ -var HashLocationService = /** @class */ (function (_super) { - __extends(HashLocationService, _super); - function HashLocationService(router) { - var _this = _super.call(this, router, false) || this; - _common__WEBPACK_IMPORTED_MODULE_0__.root.addEventListener('hashchange', _this._listener, false); - return _this; - } - HashLocationService.prototype._get = function () { - return (0,_common__WEBPACK_IMPORTED_MODULE_0__.trimHashVal)(this._location.hash); - }; - HashLocationService.prototype._set = function (state, title, url, replace) { - this._location.hash = url; - }; - HashLocationService.prototype.dispose = function (router) { - _super.prototype.dispose.call(this, router); - _common__WEBPACK_IMPORTED_MODULE_0__.root.removeEventListener('hashchange', this._listener); - }; - return HashLocationService; -}(_baseLocationService__WEBPACK_IMPORTED_MODULE_1__.BaseLocationServices)); - -//# sourceMappingURL=hashLocationService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/index.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "$q": () => (/* reexport safe */ _q__WEBPACK_IMPORTED_MODULE_1__.$q), -/* harmony export */ "$injector": () => (/* reexport safe */ _injector__WEBPACK_IMPORTED_MODULE_2__.$injector), -/* harmony export */ "BaseLocationServices": () => (/* reexport safe */ _baseLocationService__WEBPACK_IMPORTED_MODULE_3__.BaseLocationServices), -/* harmony export */ "HashLocationService": () => (/* reexport safe */ _hashLocationService__WEBPACK_IMPORTED_MODULE_4__.HashLocationService), -/* harmony export */ "MemoryLocationService": () => (/* reexport safe */ _memoryLocationService__WEBPACK_IMPORTED_MODULE_5__.MemoryLocationService), -/* harmony export */ "PushStateLocationService": () => (/* reexport safe */ _pushStateLocationService__WEBPACK_IMPORTED_MODULE_6__.PushStateLocationService), -/* harmony export */ "MemoryLocationConfig": () => (/* reexport safe */ _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_7__.MemoryLocationConfig), -/* harmony export */ "BrowserLocationConfig": () => (/* reexport safe */ _browserLocationConfig__WEBPACK_IMPORTED_MODULE_8__.BrowserLocationConfig), -/* harmony export */ "buildUrl": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.buildUrl), -/* harmony export */ "getParams": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.getParams), -/* harmony export */ "keyValsToObjectR": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.keyValsToObjectR), -/* harmony export */ "locationPluginFactory": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.locationPluginFactory), -/* harmony export */ "parseUrl": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.parseUrl), -/* harmony export */ "hashLocationPlugin": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.hashLocationPlugin), -/* harmony export */ "memoryLocationPlugin": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.memoryLocationPlugin), -/* harmony export */ "pushStateLocationPlugin": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.pushStateLocationPlugin), -/* harmony export */ "servicesPlugin": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.servicesPlugin) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/vanilla/interface.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _q__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./q */ "./node_modules/@uirouter/core/lib-esm/vanilla/q.js"); -/* harmony import */ var _injector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./injector */ "./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"); -/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./baseLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"); -/* harmony import */ var _hashLocationService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hashLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"); -/* harmony import */ var _memoryLocationService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memoryLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"); -/* harmony import */ var _pushStateLocationService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pushStateLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"); -/* harmony import */ var _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./memoryLocationConfig */ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js"); -/* harmony import */ var _browserLocationConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./browserLocationConfig */ "./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils */ "./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"); -/* harmony import */ var _plugins__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./plugins */ "./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js"); -/** - * Naive, pure JS implementation of core ui-router services - * - * @packageDocumentation - */ - - - - - - - - - - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/injector.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/injector.js ***! - \*****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "$injector": () => (/* binding */ $injector) -/* harmony export */ }); -/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/index */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - -// globally available injectables -var globals = {}; -var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; -var ARGUMENT_NAMES = /([^\s,]+)/g; -/** - * A basic angular1-like injector api - * - * This object implements four methods similar to the - * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector) - * - * UI-Router evolved from an angular 1 library to a framework agnostic library. - * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection. - * - * This object provides a naive implementation of a globally scoped dependency injection system. - * It supports the following DI approaches: - * - * ### Function parameter names - * - * A function's `.toString()` is called, and the parameter names are parsed. - * This only works when the parameter names aren't "mangled" by a minifier such as UglifyJS. - * - * ```js - * function injectedFunction(FooService, BarService) { - * // FooService and BarService are injected - * } - * ``` - * - * ### Function annotation - * - * A function may be annotated with an array of dependency names as the `$inject` property. - * - * ```js - * injectedFunction.$inject = [ 'FooService', 'BarService' ]; - * function injectedFunction(fs, bs) { - * // FooService and BarService are injected as fs and bs parameters - * } - * ``` - * - * ### Array notation - * - * An array provides the names of the dependencies to inject (as strings). - * The function is the last element of the array. - * - * ```js - * [ 'FooService', 'BarService', function (fs, bs) { - * // FooService and BarService are injected as fs and bs parameters - * }] - * ``` - * - * @type {$InjectorLike} - */ -var $injector = { - /** Gets an object from DI based on a string token */ - get: function (name) { return globals[name]; }, - /** Returns true if an object named `name` exists in global DI */ - has: function (name) { return $injector.get(name) != null; }, - /** - * Injects a function - * - * @param fn the function to inject - * @param context the function's `this` binding - * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }` - */ - invoke: function (fn, context, locals) { - var all = (0,_common_index__WEBPACK_IMPORTED_MODULE_0__.extend)({}, globals, locals || {}); - var params = $injector.annotate(fn); - var ensureExist = (0,_common_index__WEBPACK_IMPORTED_MODULE_0__.assertPredicate)(function (key) { return all.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '" + key + "'"; }); - var args = params.filter(ensureExist).map(function (x) { return all[x]; }); - if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isFunction)(fn)) - return fn.apply(context, args); - else - return fn.slice(-1)[0].apply(context, args); - }, - /** - * Returns a function's dependencies - * - * Analyzes a function (or array) and returns an array of DI tokens that the function requires. - * @return an array of `string`s - */ - annotate: function (fn) { - if (!(0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isInjectable)(fn)) - throw new Error("Not an injectable function: " + fn); - if (fn && fn.$inject) - return fn.$inject; - if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isArray)(fn)) - return fn.slice(0, -1); - var fnStr = fn.toString().replace(STRIP_COMMENTS, ''); - var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); - return result || []; - }, -}; -//# sourceMappingURL=injector.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/interface.js": -/*!******************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/interface.js ***! - \******************************************************************/ -/***/ (() => { - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js ***! - \*****************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "MemoryLocationConfig": () => (/* binding */ MemoryLocationConfig) -/* harmony export */ }); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); - - -/** A `LocationConfig` mock that gets/sets all config from an in-memory object */ -var MemoryLocationConfig = /** @class */ (function () { - function MemoryLocationConfig() { - var _this = this; - this.dispose = _common_common__WEBPACK_IMPORTED_MODULE_1__.noop; - this._baseHref = ''; - this._port = 80; - this._protocol = 'http'; - this._host = 'localhost'; - this._hashPrefix = ''; - this.port = function () { return _this._port; }; - this.protocol = function () { return _this._protocol; }; - this.host = function () { return _this._host; }; - this.baseHref = function () { return _this._baseHref; }; - this.html5Mode = function () { return false; }; - this.hashPrefix = function (newval) { return ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isDefined)(newval) ? (_this._hashPrefix = newval) : _this._hashPrefix); }; - } - return MemoryLocationConfig; -}()); - -//# sourceMappingURL=memoryLocationConfig.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js ***! - \******************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "MemoryLocationService": () => (/* binding */ MemoryLocationService) -/* harmony export */ }); -/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -/** A `LocationServices` that gets/sets the current location from an in-memory object */ -var MemoryLocationService = /** @class */ (function (_super) { - __extends(MemoryLocationService, _super); - function MemoryLocationService(router) { - return _super.call(this, router, true) || this; - } - MemoryLocationService.prototype._get = function () { - return this._url; - }; - MemoryLocationService.prototype._set = function (state, title, url, replace) { - this._url = url; - }; - return MemoryLocationService; -}(_baseLocationService__WEBPACK_IMPORTED_MODULE_0__.BaseLocationServices)); - -//# sourceMappingURL=memoryLocationService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js": -/*!****************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js ***! - \****************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "servicesPlugin": () => (/* binding */ servicesPlugin), -/* harmony export */ "hashLocationPlugin": () => (/* binding */ hashLocationPlugin), -/* harmony export */ "pushStateLocationPlugin": () => (/* binding */ pushStateLocationPlugin), -/* harmony export */ "memoryLocationPlugin": () => (/* binding */ memoryLocationPlugin) -/* harmony export */ }); -/* harmony import */ var _browserLocationConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browserLocationConfig */ "./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"); -/* harmony import */ var _hashLocationService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hashLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"); -/* harmony import */ var _pushStateLocationService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pushStateLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"); -/* harmony import */ var _memoryLocationService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./memoryLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"); -/* harmony import */ var _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memoryLocationConfig */ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js"); -/* harmony import */ var _injector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./injector */ "./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"); -/* harmony import */ var _q__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./q */ "./node_modules/@uirouter/core/lib-esm/vanilla/q.js"); -/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/coreservices */ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js"); - - - - - - - - - -function servicesPlugin(router) { - _common_coreservices__WEBPACK_IMPORTED_MODULE_8__.services.$injector = _injector__WEBPACK_IMPORTED_MODULE_6__.$injector; - _common_coreservices__WEBPACK_IMPORTED_MODULE_8__.services.$q = _q__WEBPACK_IMPORTED_MODULE_7__.$q; - return { name: 'vanilla.services', $q: _q__WEBPACK_IMPORTED_MODULE_7__.$q, $injector: _injector__WEBPACK_IMPORTED_MODULE_6__.$injector, dispose: function () { return null; } }; -} -/** A `UIRouterPlugin` uses the browser hash to get/set the current location */ -var hashLocationPlugin = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.locationPluginFactory)('vanilla.hashBangLocation', false, _hashLocationService__WEBPACK_IMPORTED_MODULE_1__.HashLocationService, _browserLocationConfig__WEBPACK_IMPORTED_MODULE_0__.BrowserLocationConfig); -/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */ -var pushStateLocationPlugin = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.locationPluginFactory)('vanilla.pushStateLocation', true, _pushStateLocationService__WEBPACK_IMPORTED_MODULE_3__.PushStateLocationService, _browserLocationConfig__WEBPACK_IMPORTED_MODULE_0__.BrowserLocationConfig); -/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */ -var memoryLocationPlugin = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.locationPluginFactory)('vanilla.memoryLocation', false, _memoryLocationService__WEBPACK_IMPORTED_MODULE_4__.MemoryLocationService, _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_5__.MemoryLocationConfig); -//# sourceMappingURL=plugins.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js ***! - \*********************************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "PushStateLocationService": () => (/* binding */ PushStateLocationService) -/* harmony export */ }); -/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseLocationService */ "./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** - * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis - * - * Uses `history.pushState` and `history.replaceState` - */ -var PushStateLocationService = /** @class */ (function (_super) { - __extends(PushStateLocationService, _super); - function PushStateLocationService(router) { - var _this = _super.call(this, router, true) || this; - _this._config = router.urlService.config; - _common__WEBPACK_IMPORTED_MODULE_1__.root.addEventListener('popstate', _this._listener, false); - return _this; - } - /** - * Gets the base prefix without: - * - trailing slash - * - trailing filename - * - protocol and hostname - * - * If , this returns '/base'. - * If , this returns '/foo/base'. - * If , this returns '/base'. - * If , this returns '/base'. - * If , this returns ''. - * If , this returns ''. - * If , this returns ''. - * - * See: https://html.spec.whatwg.org/dev/semantics.html#the-base-element - */ - PushStateLocationService.prototype._getBasePrefix = function () { - return (0,_common__WEBPACK_IMPORTED_MODULE_1__.stripLastPathElement)(this._config.baseHref()); - }; - PushStateLocationService.prototype._get = function () { - var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search; - search = (0,_common__WEBPACK_IMPORTED_MODULE_1__.splitQuery)(search)[1]; // strip ? if found - hash = (0,_common__WEBPACK_IMPORTED_MODULE_1__.splitHash)(hash)[1]; // strip # if found - var basePrefix = this._getBasePrefix(); - var exactBaseHrefMatch = pathname === this._config.baseHref(); - var startsWithBase = pathname.substr(0, basePrefix.length) === basePrefix; - pathname = exactBaseHrefMatch ? '/' : startsWithBase ? pathname.substring(basePrefix.length) : pathname; - return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : ''); - }; - PushStateLocationService.prototype._set = function (state, title, url, replace) { - var basePrefix = this._getBasePrefix(); - var slash = url && url[0] !== '/' ? '/' : ''; - var fullUrl = url === '' || url === '/' ? this._config.baseHref() : basePrefix + slash + url; - if (replace) { - this._history.replaceState(state, title, fullUrl); - } - else { - this._history.pushState(state, title, fullUrl); - } - }; - PushStateLocationService.prototype.dispose = function (router) { - _super.prototype.dispose.call(this, router); - _common__WEBPACK_IMPORTED_MODULE_1__.root.removeEventListener('popstate', this._listener); - }; - return PushStateLocationService; -}(_baseLocationService__WEBPACK_IMPORTED_MODULE_0__.BaseLocationServices)); - -//# sourceMappingURL=pushStateLocationService.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/q.js": -/*!**********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/q.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "$q": () => (/* binding */ $q) -/* harmony export */ }); -/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/index */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - -/** - * An angular1-like promise api - * - * This object implements four methods similar to the - * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q) - * - * UI-Router evolved from an angular 1 library to a framework agnostic library. - * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection. - * - * This API provides native ES6 promise support wrapped as a $q-like API. - * Internally, UI-Router uses this $q object to perform promise operations. - * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular. - * - * $q-like promise api - */ -var $q = { - /** Normalizes a value as a promise */ - when: function (val) { return new Promise(function (resolve, reject) { return resolve(val); }); }, - /** Normalizes a value as a promise rejection */ - reject: function (val) { - return new Promise(function (resolve, reject) { - reject(val); - }); - }, - /** @returns a deferred object, which has `resolve` and `reject` functions */ - defer: function () { - var deferred = {}; - deferred.promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }); - return deferred; - }, - /** Like Promise.all(), but also supports object key/promise notation like $q */ - all: function (promises) { - if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isArray)(promises)) { - return Promise.all(promises); - } - if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isObject)(promises)) { - // Convert promises map to promises array. - // When each promise resolves, map it to a tuple { key: key, val: val } - var chain = Object.keys(promises).map(function (key) { return promises[key].then(function (val) { return ({ key: key, val: val }); }); }); - // Then wait for all promises to resolve, and convert them back to an object - return $q.all(chain).then(function (values) { - return values.reduce(function (acc, tuple) { - acc[tuple.key] = tuple.val; - return acc; - }, {}); - }); - } - }, -}; -//# sourceMappingURL=q.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/vanilla/utils.js": -/*!**************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/vanilla/utils.js ***! - \**************************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "keyValsToObjectR": () => (/* binding */ keyValsToObjectR), -/* harmony export */ "getParams": () => (/* binding */ getParams), -/* harmony export */ "parseUrl": () => (/* binding */ parseUrl), -/* harmony export */ "buildUrl": () => (/* binding */ buildUrl), -/* harmony export */ "locationPluginFactory": () => (/* binding */ locationPluginFactory) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ "./node_modules/@uirouter/core/lib-esm/common/index.js"); - -var keyValsToObjectR = function (accum, _a) { - var key = _a[0], val = _a[1]; - if (!accum.hasOwnProperty(key)) { - accum[key] = val; - } - else if ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isArray)(accum[key])) { - accum[key].push(val); - } - else { - accum[key] = [accum[key], val]; - } - return accum; -}; -var getParams = function (queryString) { - return queryString.split('&').filter(_common__WEBPACK_IMPORTED_MODULE_0__.identity).map(_common__WEBPACK_IMPORTED_MODULE_0__.splitEqual).reduce(keyValsToObjectR, {}); -}; -function parseUrl(url) { - var orEmptyString = function (x) { return x || ''; }; - var _a = (0,_common__WEBPACK_IMPORTED_MODULE_0__.splitHash)(url).map(orEmptyString), beforehash = _a[0], hash = _a[1]; - var _b = (0,_common__WEBPACK_IMPORTED_MODULE_0__.splitQuery)(beforehash).map(orEmptyString), path = _b[0], search = _b[1]; - return { path: path, search: search, hash: hash, url: url }; -} -var buildUrl = function (loc) { - var path = loc.path(); - var searchObject = loc.search(); - var hash = loc.hash(); - var search = Object.keys(searchObject) - .map(function (key) { - var param = searchObject[key]; - var vals = (0,_common__WEBPACK_IMPORTED_MODULE_0__.isArray)(param) ? param : [param]; - return vals.map(function (val) { return key + '=' + val; }); - }) - .reduce(_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) - .join('&'); - return path + (search ? '?' + search : '') + (hash ? '#' + hash : ''); -}; -function locationPluginFactory(name, isHtml5, serviceClass, configurationClass) { - return function (uiRouter) { - var service = (uiRouter.locationService = new serviceClass(uiRouter)); - var configuration = (uiRouter.locationConfig = new configurationClass(uiRouter, isHtml5)); - function dispose(router) { - router.dispose(service); - router.dispose(configuration); - } - return { name: name, service: service, configuration: configuration, dispose: dispose }; - }; -} -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/view/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/view/index.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ViewService": () => (/* reexport safe */ _view__WEBPACK_IMPORTED_MODULE_1__.ViewService) -/* harmony export */ }); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ "./node_modules/@uirouter/core/lib-esm/view/interface.js"); -/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__); -/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; -/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] -/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); -/* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view */ "./node_modules/@uirouter/core/lib-esm/view/view.js"); - - -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/view/interface.js": -/*!***************************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/view/interface.js ***! - \***************************************************************/ -/***/ (() => { - -//# sourceMappingURL=interface.js.map - -/***/ }), - -/***/ "./node_modules/@uirouter/core/lib-esm/view/view.js": -/*!**********************************************************!*\ - !*** ./node_modules/@uirouter/core/lib-esm/view/view.js ***! - \**********************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "ViewService": () => (/* binding */ ViewService) -/* harmony export */ }); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./node_modules/@uirouter/core/lib-esm/common/common.js"); -/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ "./node_modules/@uirouter/core/lib-esm/common/hof.js"); -/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/predicates */ "./node_modules/@uirouter/core/lib-esm/common/predicates.js"); -/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/trace */ "./node_modules/@uirouter/core/lib-esm/common/trace.js"); - - - - -/** - * The View service - * - * This service pairs existing `ui-view` components (which live in the DOM) - * with view configs (from the state declaration objects: [[StateDeclaration.views]]). - * - * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]]. - * The views from exited states are deactivated via [[deactivateViewConfig]]. - * (See: the [[registerActivateViews]] Transition Hook) - * - * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]]. - * - * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]]) - * are configured with the matching [[ViewConfig]](s) - * - */ -var ViewService = /** @class */ (function () { - /** @internal */ - function ViewService(/** @internal */ router) { - var _this = this; - this.router = router; - /** @internal */ this._uiViews = []; - /** @internal */ this._viewConfigs = []; - /** @internal */ this._viewConfigFactories = {}; - /** @internal */ this._listeners = []; - /** @internal */ - this._pluginapi = { - _rootViewContext: this._rootViewContext.bind(this), - _viewConfigFactory: this._viewConfigFactory.bind(this), - _registeredUIView: function (id) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(_this._uiViews, function (view) { return _this.router.$id + "." + view.id === id; }); }, - _registeredUIViews: function () { return _this._uiViews; }, - _activeViewConfigs: function () { return _this._viewConfigs; }, - _onSync: function (listener) { - _this._listeners.push(listener); - return function () { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(_this._listeners, listener); }; - }, - }; - } - /** - * Normalizes a view's name from a state.views configuration block. - * - * This should be used by a framework implementation to calculate the values for - * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]]. - * - * @param context the context object (state declaration) that the view belongs to - * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]] - * - * @returns the normalized uiViewName and uiViewContextAnchor that the view targets - */ - ViewService.normalizeUIViewTarget = function (context, rawViewName) { - if (rawViewName === void 0) { rawViewName = ''; } - // TODO: Validate incoming view name with a regexp to allow: - // ex: "view.name@foo.bar" , "^.^.view.name" , "view.name@^.^" , "" , - // "@" , "$default@^" , "!$default.$default" , "!foo.bar" - var viewAtContext = rawViewName.split('@'); - var uiViewName = viewAtContext[0] || '$default'; // default to unnamed view - var uiViewContextAnchor = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context - // Handle relative view-name sugar syntax. - // Matches rawViewName "^.^.^.foo.bar" into array: ["^.^.^.foo.bar", "^.^.^", "foo.bar"], - var relativeViewNameSugar = /^(\^(?:\.\^)*)\.(.*$)/.exec(uiViewName); - if (relativeViewNameSugar) { - // Clobbers existing contextAnchor (rawViewName validation will fix this) - uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to "^.^.^" - uiViewName = relativeViewNameSugar[2]; // set view-name to "foo.bar" - } - if (uiViewName.charAt(0) === '!') { - uiViewName = uiViewName.substr(1); - uiViewContextAnchor = ''; // target absolutely from root - } - // handle parent relative targeting "^.^.^" - var relativeMatch = /^(\^(?:\.\^)*)$/; - if (relativeMatch.exec(uiViewContextAnchor)) { - var anchorState = uiViewContextAnchor.split('.').reduce(function (anchor, x) { return anchor.parent; }, context); - uiViewContextAnchor = anchorState.name; - } - else if (uiViewContextAnchor === '.') { - uiViewContextAnchor = context.name; - } - return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor }; - }; - /** @internal */ - ViewService.prototype._rootViewContext = function (context) { - return (this._rootContext = context || this._rootContext); - }; - /** @internal */ - ViewService.prototype._viewConfigFactory = function (viewType, factory) { - this._viewConfigFactories[viewType] = factory; - }; - ViewService.prototype.createViewConfig = function (path, decl) { - var cfgFactory = this._viewConfigFactories[decl.$type]; - if (!cfgFactory) - throw new Error('ViewService: No view config factory registered for type ' + decl.$type); - var cfgs = cfgFactory(path, decl); - return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(cfgs) ? cfgs : [cfgs]; - }; - /** - * Deactivates a ViewConfig. - * - * This function deactivates a `ViewConfig`. - * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired. - * - * @param viewConfig The ViewConfig view to deregister. - */ - ViewService.prototype.deactivateViewConfig = function (viewConfig) { - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceEvent('<- Removing', viewConfig); - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(this._viewConfigs, viewConfig); - }; - ViewService.prototype.activateViewConfig = function (viewConfig) { - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceEvent('-> Registering', viewConfig); - this._viewConfigs.push(viewConfig); - }; - ViewService.prototype.sync = function () { - var _this = this; - var uiViewsByFqn = this._uiViews.map(function (uiv) { return [uiv.fqn, uiv]; }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.applyPairs, {}); - // Return a weighted depth value for a uiView. - // The depth is the nesting depth of ui-views (based on FQN; times 10,000) - // plus the depth of the state that is populating the uiView - function uiViewDepth(uiView) { - var stateDepth = function (context) { return (context && context.parent ? stateDepth(context.parent) + 1 : 1); }; - return uiView.fqn.split('.').length * 10000 + stateDepth(uiView.creationContext); - } - // Return the ViewConfig's context's depth in the context tree. - function viewConfigDepth(config) { - var context = config.viewDecl.$context, count = 0; - while (++count && context.parent) - context = context.parent; - return count; - } - // Given a depth function, returns a compare function which can return either ascending or descending order - var depthCompare = (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); }); - var matchingConfigPair = function (uiView) { - var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView)); - if (matchingConfigs.length > 1) { - // This is OK. Child states can target a ui-view that the parent state also targets (the child wins) - // Sort by depth and return the match from the deepest child - // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs); - matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending - } - return { uiView: uiView, viewConfig: matchingConfigs[0] }; - }; - var configureUIView = function (tuple) { - // If a parent ui-view is reconfigured, it could destroy child ui-views. - // Before configuring a child ui-view, make sure it's still in the active uiViews array. - if (_this._uiViews.indexOf(tuple.uiView) !== -1) - tuple.uiView.configUpdated(tuple.viewConfig); - }; - // Sort views by FQN and state depth. Process uiviews nearest the root first. - var uiViewTuples = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair); - var matchedViewConfigs = uiViewTuples.map(function (tuple) { return tuple.viewConfig; }); - var unmatchedConfigTuples = this._viewConfigs - .filter(function (config) { return !(0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(matchedViewConfigs, config); }) - .map(function (viewConfig) { return ({ uiView: undefined, viewConfig: viewConfig }); }); - uiViewTuples.forEach(configureUIView); - var allTuples = uiViewTuples.concat(unmatchedConfigTuples); - this._listeners.forEach(function (cb) { return cb(allTuples); }); - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewSync(allTuples); - }; - /** - * Registers a `ui-view` component - * - * When a `ui-view` component is created, it uses this method to register itself. - * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]]. - * - * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`, - * and what the view's state context is. - * - * Note: There is no corresponding `deregisterUIView`. - * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself. - * - * @param uiView The metadata for a UIView - * @return a de-registration function used when the view is destroyed. - */ - ViewService.prototype.registerUIView = function (uiView) { - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('-> Registering', uiView); - var uiViews = this._uiViews; - var fqnAndTypeMatches = function (uiv) { return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type; }; - if (uiViews.filter(fqnAndTypeMatches).length) - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('!!!! duplicate uiView named:', uiView); - uiViews.push(uiView); - this.sync(); - return function () { - var idx = uiViews.indexOf(uiView); - if (idx === -1) { - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('Tried removing non-registered uiView', uiView); - return; - } - _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('<- Deregistering', uiView); - (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(uiViews)(uiView); - }; - }; - /** - * Returns the list of views currently available on the page, by fully-qualified name. - * - * @return {Array} Returns an array of fully-qualified view names. - */ - ViewService.prototype.available = function () { - return this._uiViews.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('fqn')); - }; - /** - * Returns the list of views on the page containing loaded content. - * - * @return {Array} Returns an array of fully-qualified view names. - */ - ViewService.prototype.active = function () { - return this._uiViews.filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('$config')).map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('name')); - }; - /** - * Given a ui-view and a ViewConfig, determines if they "match". - * - * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in - * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of. - * - * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or - * can be a segmented ui-view path, describing a portion of a ui-view fqn. - * - * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type - * - * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if: - * - the ui-view's name matches the ViewConfig's target name - * - the ui-view's context matches the ViewConfig's anchor - * - * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if: - * - There exists a parent ui-view where: - * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name - * - the parent ui-view's context matches the ViewConfig's anchor - * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn - * - * Example: - * - * DOM: - * - * - * - * - * - * - * - * - * - * uiViews: [ - * { fqn: "$default", creationContext: { name: "" } }, - * { fqn: "$default.foo", creationContext: { name: "A" } }, - * { fqn: "$default.foo.$default", creationContext: { name: "A.B" } } - * { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } } - * ] - * - * These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar": - * - * - ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" } - * - ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" } - * - ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" } - * - ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" } - * - * Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because: - * - The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ] - * - There exists a parent ui-view (which has fqn: "$default.foo") where: - * - the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name - * - the parent ui-view's context "A" matches the ViewConfig's anchor context "A" - * - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match - * the tail of the ui-view's fqn "default.bar" - * - * @internal - */ - ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) { - // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc - if (uiView.$type !== viewConfig.viewDecl.$type) - return false; - // Split names apart from both viewConfig and uiView into segments - var vc = viewConfig.viewDecl; - var vcSegments = vc.$uiViewName.split('.'); - var uivSegments = uiView.fqn.split('.'); - // Check if the tails of the segment arrays match. ex, these arrays' tails match: - // vc: ["foo", "bar"], uiv fqn: ["$default", "foo", "bar"] - if (!(0,_common_common__WEBPACK_IMPORTED_MODULE_0__.equals)(vcSegments, uivSegments.slice(0 - vcSegments.length))) - return false; - // Now check if the fqn ending at the first segment of the viewConfig matches the context: - // ["$default", "foo"].join(".") == "$default.foo", does the ui-view $default.foo context match? - var negOffset = 1 - vcSegments.length || undefined; - var fqnToFirstSegment = uivSegments.slice(0, negOffset).join('.'); - var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext; - return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name); - }; }; - return ViewService; -}()); - -//# sourceMappingURL=view.js.map - -/***/ }), - -/***/ "./node_modules/angular-animate/angular-animate.js": -/*!*********************************************************!*\ - !*** ./node_modules/angular-animate/angular-animate.js ***! - \*********************************************************/ -/***/ (() => { - -/** - * @license AngularJS v1.8.2 - * (c) 2010-2020 Google LLC. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -var ELEMENT_NODE = 1; -var COMMENT_NODE = 8; - -var ADD_CLASS_SUFFIX = '-add'; -var REMOVE_CLASS_SUFFIX = '-remove'; -var EVENT_CLASS_PREFIX = 'ng-'; -var ACTIVE_CLASS_SUFFIX = '-active'; -var PREPARE_CLASS_SUFFIX = '-prepare'; - -var NG_ANIMATE_CLASSNAME = 'ng-animate'; -var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren'; - -// Detect proper transitionend/animationend event names. -var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT; - -// If unprefixed events are not supported but webkit-prefixed are, use the latter. -// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them. -// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend` -// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`. -// Register both events in case `window.onanimationend` is not supported because of that, -// do the same for `transitionend` as Safari is likely to exhibit similar behavior. -// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit -// therefore there is no reason to test anymore for other vendor prefixes: -// http://caniuse.com/#search=transition -if ((window.ontransitionend === undefined) && (window.onwebkittransitionend !== undefined)) { - CSS_PREFIX = '-webkit-'; - TRANSITION_PROP = 'WebkitTransition'; - TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend'; -} else { - TRANSITION_PROP = 'transition'; - TRANSITIONEND_EVENT = 'transitionend'; -} - -if ((window.onanimationend === undefined) && (window.onwebkitanimationend !== undefined)) { - CSS_PREFIX = '-webkit-'; - ANIMATION_PROP = 'WebkitAnimation'; - ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend'; -} else { - ANIMATION_PROP = 'animation'; - ANIMATIONEND_EVENT = 'animationend'; -} - -var DURATION_KEY = 'Duration'; -var PROPERTY_KEY = 'Property'; -var DELAY_KEY = 'Delay'; -var TIMING_KEY = 'TimingFunction'; -var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount'; -var ANIMATION_PLAYSTATE_KEY = 'PlayState'; -var SAFE_FAST_FORWARD_DURATION_VALUE = 9999; - -var ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY; -var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY; -var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY; -var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY; - -var ngMinErr = angular.$$minErr('ng'); -function assertArg(arg, name, reason) { - if (!arg) { - throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required')); - } - return arg; -} - -function mergeClasses(a,b) { - if (!a && !b) return ''; - if (!a) return b; - if (!b) return a; - if (isArray(a)) a = a.join(' '); - if (isArray(b)) b = b.join(' '); - return a + ' ' + b; -} - -function packageStyles(options) { - var styles = {}; - if (options && (options.to || options.from)) { - styles.to = options.to; - styles.from = options.from; - } - return styles; -} - -function pendClasses(classes, fix, isPrefix) { - var className = ''; - classes = isArray(classes) - ? classes - : classes && isString(classes) && classes.length - ? classes.split(/\s+/) - : []; - forEach(classes, function(klass, i) { - if (klass && klass.length > 0) { - className += (i > 0) ? ' ' : ''; - className += isPrefix ? fix + klass - : klass + fix; - } - }); - return className; -} - -function removeFromArray(arr, val) { - var index = arr.indexOf(val); - if (val >= 0) { - arr.splice(index, 1); - } -} - -function stripCommentsFromElement(element) { - if (element instanceof jqLite) { - switch (element.length) { - case 0: - return element; - - case 1: - // there is no point of stripping anything if the element - // is the only element within the jqLite wrapper. - // (it's important that we retain the element instance.) - if (element[0].nodeType === ELEMENT_NODE) { - return element; - } - break; - - default: - return jqLite(extractElementNode(element)); - } - } - - if (element.nodeType === ELEMENT_NODE) { - return jqLite(element); - } -} - -function extractElementNode(element) { - if (!element[0]) return element; - for (var i = 0; i < element.length; i++) { - var elm = element[i]; - if (elm.nodeType === ELEMENT_NODE) { - return elm; - } - } -} - -function $$addClass($$jqLite, element, className) { - forEach(element, function(elm) { - $$jqLite.addClass(elm, className); - }); -} - -function $$removeClass($$jqLite, element, className) { - forEach(element, function(elm) { - $$jqLite.removeClass(elm, className); - }); -} - -function applyAnimationClassesFactory($$jqLite) { - return function(element, options) { - if (options.addClass) { - $$addClass($$jqLite, element, options.addClass); - options.addClass = null; - } - if (options.removeClass) { - $$removeClass($$jqLite, element, options.removeClass); - options.removeClass = null; - } - }; -} - -function prepareAnimationOptions(options) { - options = options || {}; - if (!options.$$prepared) { - var domOperation = options.domOperation || noop; - options.domOperation = function() { - options.$$domOperationFired = true; - domOperation(); - domOperation = noop; - }; - options.$$prepared = true; - } - return options; -} - -function applyAnimationStyles(element, options) { - applyAnimationFromStyles(element, options); - applyAnimationToStyles(element, options); -} - -function applyAnimationFromStyles(element, options) { - if (options.from) { - element.css(options.from); - options.from = null; - } -} - -function applyAnimationToStyles(element, options) { - if (options.to) { - element.css(options.to); - options.to = null; - } -} - -function mergeAnimationDetails(element, oldAnimation, newAnimation) { - var target = oldAnimation.options || {}; - var newOptions = newAnimation.options || {}; - - var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || ''); - var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || ''); - var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove); - - if (newOptions.preparationClasses) { - target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses); - delete newOptions.preparationClasses; - } - - // noop is basically when there is no callback; otherwise something has been set - var realDomOperation = target.domOperation !== noop ? target.domOperation : null; - - extend(target, newOptions); - - // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this. - if (realDomOperation) { - target.domOperation = realDomOperation; - } - - if (classes.addClass) { - target.addClass = classes.addClass; - } else { - target.addClass = null; - } - - if (classes.removeClass) { - target.removeClass = classes.removeClass; - } else { - target.removeClass = null; - } - - oldAnimation.addClass = target.addClass; - oldAnimation.removeClass = target.removeClass; - - return target; -} - -function resolveElementClasses(existing, toAdd, toRemove) { - var ADD_CLASS = 1; - var REMOVE_CLASS = -1; - - var flags = {}; - existing = splitClassesToLookup(existing); - - toAdd = splitClassesToLookup(toAdd); - forEach(toAdd, function(value, key) { - flags[key] = ADD_CLASS; - }); - - toRemove = splitClassesToLookup(toRemove); - forEach(toRemove, function(value, key) { - flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS; - }); - - var classes = { - addClass: '', - removeClass: '' - }; - - forEach(flags, function(val, klass) { - var prop, allow; - if (val === ADD_CLASS) { - prop = 'addClass'; - allow = !existing[klass] || existing[klass + REMOVE_CLASS_SUFFIX]; - } else if (val === REMOVE_CLASS) { - prop = 'removeClass'; - allow = existing[klass] || existing[klass + ADD_CLASS_SUFFIX]; - } - if (allow) { - if (classes[prop].length) { - classes[prop] += ' '; - } - classes[prop] += klass; - } - }); - - function splitClassesToLookup(classes) { - if (isString(classes)) { - classes = classes.split(' '); - } - - var obj = {}; - forEach(classes, function(klass) { - // sometimes the split leaves empty string values - // incase extra spaces were applied to the options - if (klass.length) { - obj[klass] = true; - } - }); - return obj; - } - - return classes; -} - -function getDomNode(element) { - return (element instanceof jqLite) ? element[0] : element; -} - -function applyGeneratedPreparationClasses($$jqLite, element, event, options) { - var classes = ''; - if (event) { - classes = pendClasses(event, EVENT_CLASS_PREFIX, true); - } - if (options.addClass) { - classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX)); - } - if (options.removeClass) { - classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX)); - } - if (classes.length) { - options.preparationClasses = classes; - element.addClass(classes); - } -} - -function clearGeneratedClasses(element, options) { - if (options.preparationClasses) { - element.removeClass(options.preparationClasses); - options.preparationClasses = null; - } - if (options.activeClasses) { - element.removeClass(options.activeClasses); - options.activeClasses = null; - } -} - -function blockKeyframeAnimations(node, applyBlock) { - var value = applyBlock ? 'paused' : ''; - var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY; - applyInlineStyle(node, [key, value]); - return [key, value]; -} - -function applyInlineStyle(node, styleTuple) { - var prop = styleTuple[0]; - var value = styleTuple[1]; - node.style[prop] = value; -} - -function concatWithSpace(a,b) { - if (!a) return b; - if (!b) return a; - return a + ' ' + b; -} - -var helpers = { - blockTransitions: function(node, duration) { - // we use a negative delay value since it performs blocking - // yet it doesn't kill any existing transitions running on the - // same element which makes this safe for class-based animations - var value = duration ? '-' + duration + 's' : ''; - applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]); - return [TRANSITION_DELAY_PROP, value]; - } -}; - -var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) { - var queue, cancelFn; - - function scheduler(tasks) { - // we make a copy since RAFScheduler mutates the state - // of the passed in array variable and this would be difficult - // to track down on the outside code - queue = queue.concat(tasks); - nextTick(); - } - - queue = scheduler.queue = []; - - /* waitUntilQuiet does two things: - * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through - * 2. It will delay the next wave of tasks from running until the quiet `fn` has run. - * - * The motivation here is that animation code can request more time from the scheduler - * before the next wave runs. This allows for certain DOM properties such as classes to - * be resolved in time for the next animation to run. - */ - scheduler.waitUntilQuiet = function(fn) { - if (cancelFn) cancelFn(); - - cancelFn = $$rAF(function() { - cancelFn = null; - fn(); - nextTick(); - }); - }; - - return scheduler; - - function nextTick() { - if (!queue.length) return; - - var items = queue.shift(); - for (var i = 0; i < items.length; i++) { - items[i](); - } - - if (!cancelFn) { - $$rAF(function() { - if (!cancelFn) nextTick(); - }); - } - } -}]; - -/** - * @ngdoc directive - * @name ngAnimateChildren - * @restrict AE - * @element ANY - * - * @description - * - * ngAnimateChildren allows you to specify that children of this element should animate even if any - * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move` - * (structural) animation, child elements that also have an active structural animation are not animated. - * - * Note that even if `ngAnimateChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation). - * - * - * @param {string} ngAnimateChildren If the value is empty, `true` or `on`, - * then child animations are allowed. If the value is `false`, child animations are not allowed. - * - * @example - * - -
    - - -
    -
    -
    - List of items: -
    Item {{item}}
    -
    -
    -
    -
    - - - .container.ng-enter, - .container.ng-leave { - transition: all ease 1.5s; - } - - .container.ng-enter, - .container.ng-leave-active { - opacity: 0; - } - - .container.ng-leave, - .container.ng-enter-active { - opacity: 1; - } - - .item { - background: firebrick; - color: #FFF; - margin-bottom: 10px; - } - - .item.ng-enter, - .item.ng-leave { - transition: transform 1.5s ease; - } - - .item.ng-enter { - transform: translateX(50px); - } - - .item.ng-enter-active { - transform: translateX(0); - } - - - angular.module('ngAnimateChildren', ['ngAnimate']) - .controller('MainController', function MainController() { - this.animateChildren = false; - this.enterElement = false; - }); - -
    - */ -var $$AnimateChildrenDirective = ['$interpolate', function($interpolate) { - return { - link: function(scope, element, attrs) { - var val = attrs.ngAnimateChildren; - if (isString(val) && val.length === 0) { //empty attribute - element.data(NG_ANIMATE_CHILDREN_DATA, true); - } else { - // Interpolate and set the value, so that it is available to - // animations that run right after compilation - setData($interpolate(val)(scope)); - attrs.$observe('ngAnimateChildren', setData); - } - - function setData(value) { - value = value === 'on' || value === 'true'; - element.data(NG_ANIMATE_CHILDREN_DATA, value); - } - } - }; -}]; - -/* exported $AnimateCssProvider */ - -var ANIMATE_TIMER_KEY = '$$animateCss'; - -/** - * @ngdoc service - * @name $animateCss - * @kind object - * - * @description - * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes - * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT - * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or - * directives to create more complex animations that can be purely driven using CSS code. - * - * Note that only browsers that support CSS transitions and/or keyframe animations are capable of - * rendering animations triggered via `$animateCss` (bad news for IE9 and lower). - * - * ## General Use - * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that - * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however, - * any automatic control over cancelling animations and/or preventing animations from being run on - * child elements will not be handled by AngularJS. For this to work as expected, please use `$animate` to - * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger - * the CSS animation. - * - * The example below shows how we can create a folding animation on an element using `ng-if`: - * - * ```html - * - *
    - * This element will go BOOM - *
    - * - * ``` - * - * Now we create the **JavaScript animation** that will trigger the CSS transition: - * - * ```js - * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) { - * return { - * enter: function(element, doneFn) { - * var height = element[0].offsetHeight; - * return $animateCss(element, { - * from: { height:'0px' }, - * to: { height:height + 'px' }, - * duration: 1 // one second - * }); - * } - * } - * }]); - * ``` - * - * ## More Advanced Uses - * - * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks - * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code. - * - * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation, - * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with - * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order - * to provide a working animation that will run in CSS. - * - * The example below showcases a more advanced version of the `.fold-animation` from the example above: - * - * ```js - * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) { - * return { - * enter: function(element, doneFn) { - * var height = element[0].offsetHeight; - * return $animateCss(element, { - * addClass: 'red large-text pulse-twice', - * easing: 'ease-out', - * from: { height:'0px' }, - * to: { height:height + 'px' }, - * duration: 1 // one second - * }); - * } - * } - * }]); - * ``` - * - * Since we're adding/removing CSS classes then the CSS transition will also pick those up: - * - * ```css - * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code, - * the CSS classes below will be transitioned despite them being defined as regular CSS classes */ - * .red { background:red; } - * .large-text { font-size:20px; } - * - * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */ - * .pulse-twice { - * animation: 0.5s pulse linear 2; - * -webkit-animation: 0.5s pulse linear 2; - * } - * - * @keyframes pulse { - * from { transform: scale(0.5); } - * to { transform: scale(1.5); } - * } - * - * @-webkit-keyframes pulse { - * from { -webkit-transform: scale(0.5); } - * to { -webkit-transform: scale(1.5); } - * } - * ``` - * - * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen. - * - * ## How the Options are handled - * - * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation - * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline - * styles using the `from` and `to` properties. - * - * ```js - * var animator = $animateCss(element, { - * from: { background:'red' }, - * to: { background:'blue' } - * }); - * animator.start(); - * ``` - * - * ```css - * .rotating-animation { - * animation:0.5s rotate linear; - * -webkit-animation:0.5s rotate linear; - * } - * - * @keyframes rotate { - * from { transform: rotate(0deg); } - * to { transform: rotate(360deg); } - * } - * - * @-webkit-keyframes rotate { - * from { -webkit-transform: rotate(0deg); } - * to { -webkit-transform: rotate(360deg); } - * } - * ``` - * - * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is - * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition - * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition - * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied - * and spread across the transition and keyframe animation. - * - * ## What is returned - * - * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually - * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are - * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties: - * - * ```js - * var animator = $animateCss(element, { ... }); - * ``` - * - * Now what do the contents of our `animator` variable look like: - * - * ```js - * { - * // starts the animation - * start: Function, - * - * // ends (aborts) the animation - * end: Function - * } - * ``` - * - * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends. - * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been - * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties - * and that changing them will not reconfigure the parameters of the animation. - * - * ### runner.done() vs runner.then() - * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the - * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**. - * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()` - * unless you really need a digest to kick off afterwards. - * - * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss - * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code). - * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works. - * - * @param {DOMElement} element the element that will be animated - * @param {object} options the animation-related options that will be applied during the animation - * - * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied - * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.) - * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and - * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted. - * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both). - * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`). - * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`). - * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation. - * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition. - * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation. - * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation. - * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0` - * is provided then the animation will be skipped entirely. - * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is - * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value - * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same - * CSS delay value. - * * `stagger` - A numeric time value representing the delay between successively animated elements - * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.}) - * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a - * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`) - * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.) - * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once - * the animation is closed. This is useful for when the styles are used purely for the sake of - * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation). - * By default this value is set to `false`. - * - * @return {object} an object with start and end methods and details about the animation. - * - * * `start` - The method to start the animation. This will return a `Promise` when called. - * * `end` - This method will cancel the animation and remove all applied CSS classes and styles. - */ -var ONE_SECOND = 1000; - -var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3; -var CLOSING_TIME_BUFFER = 1.5; - -var DETECT_CSS_PROPERTIES = { - transitionDuration: TRANSITION_DURATION_PROP, - transitionDelay: TRANSITION_DELAY_PROP, - transitionProperty: TRANSITION_PROP + PROPERTY_KEY, - animationDuration: ANIMATION_DURATION_PROP, - animationDelay: ANIMATION_DELAY_PROP, - animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY -}; - -var DETECT_STAGGER_CSS_PROPERTIES = { - transitionDuration: TRANSITION_DURATION_PROP, - transitionDelay: TRANSITION_DELAY_PROP, - animationDuration: ANIMATION_DURATION_PROP, - animationDelay: ANIMATION_DELAY_PROP -}; - -function getCssKeyframeDurationStyle(duration) { - return [ANIMATION_DURATION_PROP, duration + 's']; -} - -function getCssDelayStyle(delay, isKeyframeAnimation) { - var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP; - return [prop, delay + 's']; -} - -function computeCssStyles($window, element, properties) { - var styles = Object.create(null); - var detectedStyles = $window.getComputedStyle(element) || {}; - forEach(properties, function(formalStyleName, actualStyleName) { - var val = detectedStyles[formalStyleName]; - if (val) { - var c = val.charAt(0); - - // only numerical-based values have a negative sign or digit as the first value - if (c === '-' || c === '+' || c >= 0) { - val = parseMaxTime(val); - } - - // by setting this to null in the event that the delay is not set or is set directly as 0 - // then we can still allow for negative values to be used later on and not mistake this - // value for being greater than any other negative value. - if (val === 0) { - val = null; - } - styles[actualStyleName] = val; - } - }); - - return styles; -} - -function parseMaxTime(str) { - var maxValue = 0; - var values = str.split(/\s*,\s*/); - forEach(values, function(value) { - // it's always safe to consider only second values and omit `ms` values since - // getComputedStyle will always handle the conversion for us - if (value.charAt(value.length - 1) === 's') { - value = value.substring(0, value.length - 1); - } - value = parseFloat(value) || 0; - maxValue = maxValue ? Math.max(value, maxValue) : value; - }); - return maxValue; -} - -function truthyTimingValue(val) { - return val === 0 || val != null; -} - -function getCssTransitionDurationStyle(duration, applyOnlyDuration) { - var style = TRANSITION_PROP; - var value = duration + 's'; - if (applyOnlyDuration) { - style += DURATION_KEY; - } else { - value += ' linear all'; - } - return [style, value]; -} - -// we do not reassign an already present style value since -// if we detect the style property value again we may be -// detecting styles that were added via the `from` styles. -// We make use of `isDefined` here since an empty string -// or null value (which is what getPropertyValue will return -// for a non-existing style) will still be marked as a valid -// value for the style (a falsy value implies that the style -// is to be removed at the end of the animation). If we had a simple -// "OR" statement then it would not be enough to catch that. -function registerRestorableStyles(backup, node, properties) { - forEach(properties, function(prop) { - backup[prop] = isDefined(backup[prop]) - ? backup[prop] - : node.style.getPropertyValue(prop); - }); -} - -var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) { - - this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout', '$$animateCache', - '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue', - function($window, $$jqLite, $$AnimateRunner, $timeout, $$animateCache, - $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) { - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - function computeCachedCssStyles(node, className, cacheKey, allowNoDuration, properties) { - var timings = $$animateCache.get(cacheKey); - - if (!timings) { - timings = computeCssStyles($window, node, properties); - if (timings.animationIterationCount === 'infinite') { - timings.animationIterationCount = 1; - } - } - - // if a css animation has no duration we - // should mark that so that repeated addClass/removeClass calls are skipped - var hasDuration = allowNoDuration || (timings.transitionDuration > 0 || timings.animationDuration > 0); - - // we keep putting this in multiple times even though the value and the cacheKey are the same - // because we're keeping an internal tally of how many duplicate animations are detected. - $$animateCache.put(cacheKey, timings, hasDuration); - - return timings; - } - - function computeCachedCssStaggerStyles(node, className, cacheKey, properties) { - var stagger; - var staggerCacheKey = 'stagger-' + cacheKey; - - // if we have one or more existing matches of matching elements - // containing the same parent + CSS styles (which is how cacheKey works) - // then staggering is possible - if ($$animateCache.count(cacheKey) > 0) { - stagger = $$animateCache.get(staggerCacheKey); - - if (!stagger) { - var staggerClassName = pendClasses(className, '-stagger'); - - $$jqLite.addClass(node, staggerClassName); - - stagger = computeCssStyles($window, node, properties); - - // force the conversion of a null value to zero incase not set - stagger.animationDuration = Math.max(stagger.animationDuration, 0); - stagger.transitionDuration = Math.max(stagger.transitionDuration, 0); - - $$jqLite.removeClass(node, staggerClassName); - - $$animateCache.put(staggerCacheKey, stagger, true); - } - } - - return stagger || {}; - } - - var rafWaitQueue = []; - function waitUntilQuiet(callback) { - rafWaitQueue.push(callback); - $$rAFScheduler.waitUntilQuiet(function() { - $$animateCache.flush(); - - // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable. - // PLEASE EXAMINE THE `$$forceReflow` service to understand why. - var pageWidth = $$forceReflow(); - - // we use a for loop to ensure that if the queue is changed - // during this looping then it will consider new requests - for (var i = 0; i < rafWaitQueue.length; i++) { - rafWaitQueue[i](pageWidth); - } - rafWaitQueue.length = 0; - }); - } - - function computeTimings(node, className, cacheKey, allowNoDuration) { - var timings = computeCachedCssStyles(node, className, cacheKey, allowNoDuration, DETECT_CSS_PROPERTIES); - var aD = timings.animationDelay; - var tD = timings.transitionDelay; - timings.maxDelay = aD && tD - ? Math.max(aD, tD) - : (aD || tD); - timings.maxDuration = Math.max( - timings.animationDuration * timings.animationIterationCount, - timings.transitionDuration); - - return timings; - } - - return function init(element, initialOptions) { - // all of the animation functions should create - // a copy of the options data, however, if a - // parent service has already created a copy then - // we should stick to using that - var options = initialOptions || {}; - if (!options.$$prepared) { - options = prepareAnimationOptions(copy(options)); - } - - var restoreStyles = {}; - var node = getDomNode(element); - if (!node - || !node.parentNode - || !$$animateQueue.enabled()) { - return closeAndReturnNoopAnimator(); - } - - var temporaryStyles = []; - var classes = element.attr('class'); - var styles = packageStyles(options); - var animationClosed; - var animationPaused; - var animationCompleted; - var runner; - var runnerHost; - var maxDelay; - var maxDelayTime; - var maxDuration; - var maxDurationTime; - var startTime; - var events = []; - - if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) { - return closeAndReturnNoopAnimator(); - } - - var method = options.event && isArray(options.event) - ? options.event.join(' ') - : options.event; - - var isStructural = method && options.structural; - var structuralClassName = ''; - var addRemoveClassName = ''; - - if (isStructural) { - structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true); - } else if (method) { - structuralClassName = method; - } - - if (options.addClass) { - addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX); - } - - if (options.removeClass) { - if (addRemoveClassName.length) { - addRemoveClassName += ' '; - } - addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX); - } - - // there may be a situation where a structural animation is combined together - // with CSS classes that need to resolve before the animation is computed. - // However this means that there is no explicit CSS code to block the animation - // from happening (by setting 0s none in the class name). If this is the case - // we need to apply the classes before the first rAF so we know to continue if - // there actually is a detected transition or keyframe animation - if (options.applyClassesEarly && addRemoveClassName.length) { - applyAnimationClasses(element, options); - } - - var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim(); - var fullClassName = classes + ' ' + preparationClasses; - var hasToStyles = styles.to && Object.keys(styles.to).length > 0; - var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0; - - // there is no way we can trigger an animation if no styles and - // no classes are being applied which would then trigger a transition, - // unless there a is raw keyframe value that is applied to the element. - if (!containsKeyframeAnimation - && !hasToStyles - && !preparationClasses) { - return closeAndReturnNoopAnimator(); - } - - var stagger, cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass); - if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) { - preparationClasses = null; - return closeAndReturnNoopAnimator(); - } - - if (options.stagger > 0) { - var staggerVal = parseFloat(options.stagger); - stagger = { - transitionDelay: staggerVal, - animationDelay: staggerVal, - transitionDuration: 0, - animationDuration: 0 - }; - } else { - stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES); - } - - if (!options.$$skipPreparationClasses) { - $$jqLite.addClass(element, preparationClasses); - } - - var applyOnlyDuration; - - if (options.transitionStyle) { - var transitionStyle = [TRANSITION_PROP, options.transitionStyle]; - applyInlineStyle(node, transitionStyle); - temporaryStyles.push(transitionStyle); - } - - if (options.duration >= 0) { - applyOnlyDuration = node.style[TRANSITION_PROP].length > 0; - var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration); - - // we set the duration so that it will be picked up by getComputedStyle later - applyInlineStyle(node, durationStyle); - temporaryStyles.push(durationStyle); - } - - if (options.keyframeStyle) { - var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle]; - applyInlineStyle(node, keyframeStyle); - temporaryStyles.push(keyframeStyle); - } - - var itemIndex = stagger - ? options.staggerIndex >= 0 - ? options.staggerIndex - : $$animateCache.count(cacheKey) - : 0; - - var isFirst = itemIndex === 0; - - // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY - // without causing any combination of transitions to kick in. By adding a negative delay value - // it forces the setup class' transition to end immediately. We later then remove the negative - // transition delay to allow for the transition to naturally do it's thing. The beauty here is - // that if there is no transition defined then nothing will happen and this will also allow - // other transitions to be stacked on top of each other without any chopping them out. - if (isFirst && !options.skipBlocking) { - helpers.blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE); - } - - var timings = computeTimings(node, fullClassName, cacheKey, !isStructural); - var relativeDelay = timings.maxDelay; - maxDelay = Math.max(relativeDelay, 0); - maxDuration = timings.maxDuration; - - var flags = {}; - flags.hasTransitions = timings.transitionDuration > 0; - flags.hasAnimations = timings.animationDuration > 0; - flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty === 'all'; - flags.applyTransitionDuration = hasToStyles && ( - (flags.hasTransitions && !flags.hasTransitionAll) - || (flags.hasAnimations && !flags.hasTransitions)); - flags.applyAnimationDuration = options.duration && flags.hasAnimations; - flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions); - flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations; - flags.recalculateTimingStyles = addRemoveClassName.length > 0; - - if (flags.applyTransitionDuration || flags.applyAnimationDuration) { - maxDuration = options.duration ? parseFloat(options.duration) : maxDuration; - - if (flags.applyTransitionDuration) { - flags.hasTransitions = true; - timings.transitionDuration = maxDuration; - applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0; - temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration)); - } - - if (flags.applyAnimationDuration) { - flags.hasAnimations = true; - timings.animationDuration = maxDuration; - temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration)); - } - } - - if (maxDuration === 0 && !flags.recalculateTimingStyles) { - return closeAndReturnNoopAnimator(); - } - - var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX); - - if (options.delay != null) { - var delayStyle; - if (typeof options.delay !== 'boolean') { - delayStyle = parseFloat(options.delay); - // number in options.delay means we have to recalculate the delay for the closing timeout - maxDelay = Math.max(delayStyle, 0); - } - - if (flags.applyTransitionDelay) { - temporaryStyles.push(getCssDelayStyle(delayStyle)); - } - - if (flags.applyAnimationDelay) { - temporaryStyles.push(getCssDelayStyle(delayStyle, true)); - } - } - - // we need to recalculate the delay value since we used a pre-emptive negative - // delay value and the delay value is required for the final event checking. This - // property will ensure that this will happen after the RAF phase has passed. - if (options.duration == null && timings.transitionDuration > 0) { - flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst; - } - - maxDelayTime = maxDelay * ONE_SECOND; - maxDurationTime = maxDuration * ONE_SECOND; - if (!options.skipBlocking) { - flags.blockTransition = timings.transitionDuration > 0; - flags.blockKeyframeAnimation = timings.animationDuration > 0 && - stagger.animationDelay > 0 && - stagger.animationDuration === 0; - } - - if (options.from) { - if (options.cleanupStyles) { - registerRestorableStyles(restoreStyles, node, Object.keys(options.from)); - } - applyAnimationFromStyles(element, options); - } - - if (flags.blockTransition || flags.blockKeyframeAnimation) { - applyBlocking(maxDuration); - } else if (!options.skipBlocking) { - helpers.blockTransitions(node, false); - } - - // TODO(matsko): for 1.5 change this code to have an animator object for better debugging - return { - $$willAnimate: true, - end: endFn, - start: function() { - if (animationClosed) return; - - runnerHost = { - end: endFn, - cancel: cancelFn, - resume: null, //this will be set during the start() phase - pause: null - }; - - runner = new $$AnimateRunner(runnerHost); - - waitUntilQuiet(start); - - // we don't have access to pause/resume the animation - // since it hasn't run yet. AnimateRunner will therefore - // set noop functions for resume and pause and they will - // later be overridden once the animation is triggered - return runner; - } - }; - - function endFn() { - close(); - } - - function cancelFn() { - close(true); - } - - function close(rejected) { - // if the promise has been called already then we shouldn't close - // the animation again - if (animationClosed || (animationCompleted && animationPaused)) return; - animationClosed = true; - animationPaused = false; - - if (preparationClasses && !options.$$skipPreparationClasses) { - $$jqLite.removeClass(element, preparationClasses); - } - - if (activeClasses) { - $$jqLite.removeClass(element, activeClasses); - } - - blockKeyframeAnimations(node, false); - helpers.blockTransitions(node, false); - - forEach(temporaryStyles, function(entry) { - // There is only one way to remove inline style properties entirely from elements. - // By using `removeProperty` this works, but we need to convert camel-cased CSS - // styles down to hyphenated values. - node.style[entry[0]] = ''; - }); - - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - - if (Object.keys(restoreStyles).length) { - forEach(restoreStyles, function(value, prop) { - if (value) { - node.style.setProperty(prop, value); - } else { - node.style.removeProperty(prop); - } - }); - } - - // the reason why we have this option is to allow a synchronous closing callback - // that is fired as SOON as the animation ends (when the CSS is removed) or if - // the animation never takes off at all. A good example is a leave animation since - // the element must be removed just after the animation is over or else the element - // will appear on screen for one animation frame causing an overbearing flicker. - if (options.onDone) { - options.onDone(); - } - - if (events && events.length) { - // Remove the transitionend / animationend listener(s) - element.off(events.join(' '), onAnimationProgress); - } - - //Cancel the fallback closing timeout and remove the timer data - var animationTimerData = element.data(ANIMATE_TIMER_KEY); - if (animationTimerData) { - $timeout.cancel(animationTimerData[0].timer); - element.removeData(ANIMATE_TIMER_KEY); - } - - // if the preparation function fails then the promise is not setup - if (runner) { - runner.complete(!rejected); - } - } - - function applyBlocking(duration) { - if (flags.blockTransition) { - helpers.blockTransitions(node, duration); - } - - if (flags.blockKeyframeAnimation) { - blockKeyframeAnimations(node, !!duration); - } - } - - function closeAndReturnNoopAnimator() { - runner = new $$AnimateRunner({ - end: endFn, - cancel: cancelFn - }); - - // should flush the cache animation - waitUntilQuiet(noop); - close(); - - return { - $$willAnimate: false, - start: function() { - return runner; - }, - end: endFn - }; - } - - function onAnimationProgress(event) { - event.stopPropagation(); - var ev = event.originalEvent || event; - - if (ev.target !== node) { - // Since TransitionEvent / AnimationEvent bubble up, - // we have to ignore events by finished child animations - return; - } - - // we now always use `Date.now()` due to the recent changes with - // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info) - var timeStamp = ev.$manualTimeStamp || Date.now(); - - /* Firefox (or possibly just Gecko) likes to not round values up - * when a ms measurement is used for the animation */ - var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES)); - - /* $manualTimeStamp is a mocked timeStamp value which is set - * within browserTrigger(). This is only here so that tests can - * mock animations properly. Real events fallback to event.timeStamp, - * or, if they don't, then a timeStamp is automatically created for them. - * We're checking to see if the timeStamp surpasses the expected delay, - * but we're using elapsedTime instead of the timeStamp on the 2nd - * pre-condition since animationPauseds sometimes close off early */ - if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) { - // we set this flag to ensure that if the transition is paused then, when resumed, - // the animation will automatically close itself since transitions cannot be paused. - animationCompleted = true; - close(); - } - } - - function start() { - if (animationClosed) return; - if (!node.parentNode) { - close(); - return; - } - - // even though we only pause keyframe animations here the pause flag - // will still happen when transitions are used. Only the transition will - // not be paused since that is not possible. If the animation ends when - // paused then it will not complete until unpaused or cancelled. - var playPause = function(playAnimation) { - if (!animationCompleted) { - animationPaused = !playAnimation; - if (timings.animationDuration) { - var value = blockKeyframeAnimations(node, animationPaused); - if (animationPaused) { - temporaryStyles.push(value); - } else { - removeFromArray(temporaryStyles, value); - } - } - } else if (animationPaused && playAnimation) { - animationPaused = false; - close(); - } - }; - - // checking the stagger duration prevents an accidentally cascade of the CSS delay style - // being inherited from the parent. If the transition duration is zero then we can safely - // rely that the delay value is an intentional stagger delay style. - var maxStagger = itemIndex > 0 - && ((timings.transitionDuration && stagger.transitionDuration === 0) || - (timings.animationDuration && stagger.animationDuration === 0)) - && Math.max(stagger.animationDelay, stagger.transitionDelay); - if (maxStagger) { - $timeout(triggerAnimationStart, - Math.floor(maxStagger * itemIndex * ONE_SECOND), - false); - } else { - triggerAnimationStart(); - } - - // this will decorate the existing promise runner with pause/resume methods - runnerHost.resume = function() { - playPause(true); - }; - - runnerHost.pause = function() { - playPause(false); - }; - - function triggerAnimationStart() { - // just incase a stagger animation kicks in when the animation - // itself was cancelled entirely - if (animationClosed) return; - - applyBlocking(false); - - forEach(temporaryStyles, function(entry) { - var key = entry[0]; - var value = entry[1]; - node.style[key] = value; - }); - - applyAnimationClasses(element, options); - $$jqLite.addClass(element, activeClasses); - - if (flags.recalculateTimingStyles) { - fullClassName = node.getAttribute('class') + ' ' + preparationClasses; - cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass); - - timings = computeTimings(node, fullClassName, cacheKey, false); - relativeDelay = timings.maxDelay; - maxDelay = Math.max(relativeDelay, 0); - maxDuration = timings.maxDuration; - - if (maxDuration === 0) { - close(); - return; - } - - flags.hasTransitions = timings.transitionDuration > 0; - flags.hasAnimations = timings.animationDuration > 0; - } - - if (flags.applyAnimationDelay) { - relativeDelay = typeof options.delay !== 'boolean' && truthyTimingValue(options.delay) - ? parseFloat(options.delay) - : relativeDelay; - - maxDelay = Math.max(relativeDelay, 0); - timings.animationDelay = relativeDelay; - delayStyle = getCssDelayStyle(relativeDelay, true); - temporaryStyles.push(delayStyle); - node.style[delayStyle[0]] = delayStyle[1]; - } - - maxDelayTime = maxDelay * ONE_SECOND; - maxDurationTime = maxDuration * ONE_SECOND; - - if (options.easing) { - var easeProp, easeVal = options.easing; - if (flags.hasTransitions) { - easeProp = TRANSITION_PROP + TIMING_KEY; - temporaryStyles.push([easeProp, easeVal]); - node.style[easeProp] = easeVal; - } - if (flags.hasAnimations) { - easeProp = ANIMATION_PROP + TIMING_KEY; - temporaryStyles.push([easeProp, easeVal]); - node.style[easeProp] = easeVal; - } - } - - if (timings.transitionDuration) { - events.push(TRANSITIONEND_EVENT); - } - - if (timings.animationDuration) { - events.push(ANIMATIONEND_EVENT); - } - - startTime = Date.now(); - var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime; - var endTime = startTime + timerTime; - - var animationsData = element.data(ANIMATE_TIMER_KEY) || []; - var setupFallbackTimer = true; - if (animationsData.length) { - var currentTimerData = animationsData[0]; - setupFallbackTimer = endTime > currentTimerData.expectedEndTime; - if (setupFallbackTimer) { - $timeout.cancel(currentTimerData.timer); - } else { - animationsData.push(close); - } - } - - if (setupFallbackTimer) { - var timer = $timeout(onAnimationExpired, timerTime, false); - animationsData[0] = { - timer: timer, - expectedEndTime: endTime - }; - animationsData.push(close); - element.data(ANIMATE_TIMER_KEY, animationsData); - } - - if (events.length) { - element.on(events.join(' '), onAnimationProgress); - } - - if (options.to) { - if (options.cleanupStyles) { - registerRestorableStyles(restoreStyles, node, Object.keys(options.to)); - } - applyAnimationToStyles(element, options); - } - } - - function onAnimationExpired() { - var animationsData = element.data(ANIMATE_TIMER_KEY); - - // this will be false in the event that the element was - // removed from the DOM (via a leave animation or something - // similar) - if (animationsData) { - for (var i = 1; i < animationsData.length; i++) { - animationsData[i](); - } - element.removeData(ANIMATE_TIMER_KEY); - } - } - } - }; - }]; -}]; - -var $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) { - $$animationProvider.drivers.push('$$animateCssDriver'); - - var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim'; - var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor'; - - var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out'; - var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in'; - - function isDocumentFragment(node) { - return node.parentNode && node.parentNode.nodeType === 11; - } - - this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document', - function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) { - - // only browsers that support these properties can render animations - if (!$sniffer.animations && !$sniffer.transitions) return noop; - - var bodyNode = $document[0].body; - var rootNode = getDomNode($rootElement); - - var rootBodyElement = jqLite( - // this is to avoid using something that exists outside of the body - // we also special case the doc fragment case because our unit test code - // appends the $rootElement to the body after the app has been bootstrapped - isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode - ); - - return function initDriverFn(animationDetails) { - return animationDetails.from && animationDetails.to - ? prepareFromToAnchorAnimation(animationDetails.from, - animationDetails.to, - animationDetails.classes, - animationDetails.anchors) - : prepareRegularAnimation(animationDetails); - }; - - function filterCssClasses(classes) { - //remove all the `ng-` stuff - return classes.replace(/\bng-\S+\b/g, ''); - } - - function getUniqueValues(a, b) { - if (isString(a)) a = a.split(' '); - if (isString(b)) b = b.split(' '); - return a.filter(function(val) { - return b.indexOf(val) === -1; - }).join(' '); - } - - function prepareAnchoredAnimation(classes, outAnchor, inAnchor) { - var clone = jqLite(getDomNode(outAnchor).cloneNode(true)); - var startingClasses = filterCssClasses(getClassVal(clone)); - - outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME); - inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME); - - clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME); - - rootBodyElement.append(clone); - - var animatorIn, animatorOut = prepareOutAnimation(); - - // the user may not end up using the `out` animation and - // only making use of the `in` animation or vice-versa. - // In either case we should allow this and not assume the - // animation is over unless both animations are not used. - if (!animatorOut) { - animatorIn = prepareInAnimation(); - if (!animatorIn) { - return end(); - } - } - - var startingAnimator = animatorOut || animatorIn; - - return { - start: function() { - var runner; - - var currentAnimation = startingAnimator.start(); - currentAnimation.done(function() { - currentAnimation = null; - if (!animatorIn) { - animatorIn = prepareInAnimation(); - if (animatorIn) { - currentAnimation = animatorIn.start(); - currentAnimation.done(function() { - currentAnimation = null; - end(); - runner.complete(); - }); - return currentAnimation; - } - } - // in the event that there is no `in` animation - end(); - runner.complete(); - }); - - runner = new $$AnimateRunner({ - end: endFn, - cancel: endFn - }); - - return runner; - - function endFn() { - if (currentAnimation) { - currentAnimation.end(); - } - } - } - }; - - function calculateAnchorStyles(anchor) { - var styles = {}; - - var coords = getDomNode(anchor).getBoundingClientRect(); - - // we iterate directly since safari messes up and doesn't return - // all the keys for the coords object when iterated - forEach(['width','height','top','left'], function(key) { - var value = coords[key]; - switch (key) { - case 'top': - value += bodyNode.scrollTop; - break; - case 'left': - value += bodyNode.scrollLeft; - break; - } - styles[key] = Math.floor(value) + 'px'; - }); - return styles; - } - - function prepareOutAnimation() { - var animator = $animateCss(clone, { - addClass: NG_OUT_ANCHOR_CLASS_NAME, - delay: true, - from: calculateAnchorStyles(outAnchor) - }); - - // read the comment within `prepareRegularAnimation` to understand - // why this check is necessary - return animator.$$willAnimate ? animator : null; - } - - function getClassVal(element) { - return element.attr('class') || ''; - } - - function prepareInAnimation() { - var endingClasses = filterCssClasses(getClassVal(inAnchor)); - var toAdd = getUniqueValues(endingClasses, startingClasses); - var toRemove = getUniqueValues(startingClasses, endingClasses); - - var animator = $animateCss(clone, { - to: calculateAnchorStyles(inAnchor), - addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd, - removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove, - delay: true - }); - - // read the comment within `prepareRegularAnimation` to understand - // why this check is necessary - return animator.$$willAnimate ? animator : null; - } - - function end() { - clone.remove(); - outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME); - inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME); - } - } - - function prepareFromToAnchorAnimation(from, to, classes, anchors) { - var fromAnimation = prepareRegularAnimation(from, noop); - var toAnimation = prepareRegularAnimation(to, noop); - - var anchorAnimations = []; - forEach(anchors, function(anchor) { - var outElement = anchor['out']; - var inElement = anchor['in']; - var animator = prepareAnchoredAnimation(classes, outElement, inElement); - if (animator) { - anchorAnimations.push(animator); - } - }); - - // no point in doing anything when there are no elements to animate - if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return; - - return { - start: function() { - var animationRunners = []; - - if (fromAnimation) { - animationRunners.push(fromAnimation.start()); - } - - if (toAnimation) { - animationRunners.push(toAnimation.start()); - } - - forEach(anchorAnimations, function(animation) { - animationRunners.push(animation.start()); - }); - - var runner = new $$AnimateRunner({ - end: endFn, - cancel: endFn // CSS-driven animations cannot be cancelled, only ended - }); - - $$AnimateRunner.all(animationRunners, function(status) { - runner.complete(status); - }); - - return runner; - - function endFn() { - forEach(animationRunners, function(runner) { - runner.end(); - }); - } - } - }; - } - - function prepareRegularAnimation(animationDetails) { - var element = animationDetails.element; - var options = animationDetails.options || {}; - - if (animationDetails.structural) { - options.event = animationDetails.event; - options.structural = true; - options.applyClassesEarly = true; - - // we special case the leave animation since we want to ensure that - // the element is removed as soon as the animation is over. Otherwise - // a flicker might appear or the element may not be removed at all - if (animationDetails.event === 'leave') { - options.onDone = options.domOperation; - } - } - - // We assign the preparationClasses as the actual animation event since - // the internals of $animateCss will just suffix the event token values - // with `-active` to trigger the animation. - if (options.preparationClasses) { - options.event = concatWithSpace(options.event, options.preparationClasses); - } - - var animator = $animateCss(element, options); - - // the driver lookup code inside of $$animation attempts to spawn a - // driver one by one until a driver returns a.$$willAnimate animator object. - // $animateCss will always return an object, however, it will pass in - // a flag as a hint as to whether an animation was detected or not - return animator.$$willAnimate ? animator : null; - } - }]; -}]; - -// TODO(matsko): use caching here to speed things up for detection -// TODO(matsko): add documentation -// by the time... - -var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) { - this.$get = ['$injector', '$$AnimateRunner', '$$jqLite', - function($injector, $$AnimateRunner, $$jqLite) { - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - // $animateJs(element, 'enter'); - return function(element, event, classes, options) { - var animationClosed = false; - - // the `classes` argument is optional and if it is not used - // then the classes will be resolved from the element's className - // property as well as options.addClass/options.removeClass. - if (arguments.length === 3 && isObject(classes)) { - options = classes; - classes = null; - } - - options = prepareAnimationOptions(options); - if (!classes) { - classes = element.attr('class') || ''; - if (options.addClass) { - classes += ' ' + options.addClass; - } - if (options.removeClass) { - classes += ' ' + options.removeClass; - } - } - - var classesToAdd = options.addClass; - var classesToRemove = options.removeClass; - - // the lookupAnimations function returns a series of animation objects that are - // matched up with one or more of the CSS classes. These animation objects are - // defined via the module.animation factory function. If nothing is detected then - // we don't return anything which then makes $animation query the next driver. - var animations = lookupAnimations(classes); - var before, after; - if (animations.length) { - var afterFn, beforeFn; - if (event === 'leave') { - beforeFn = 'leave'; - afterFn = 'afterLeave'; // TODO(matsko): get rid of this - } else { - beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1); - afterFn = event; - } - - if (event !== 'enter' && event !== 'move') { - before = packageAnimations(element, event, options, animations, beforeFn); - } - after = packageAnimations(element, event, options, animations, afterFn); - } - - // no matching animations - if (!before && !after) return; - - function applyOptions() { - options.domOperation(); - applyAnimationClasses(element, options); - } - - function close() { - animationClosed = true; - applyOptions(); - applyAnimationStyles(element, options); - } - - var runner; - - return { - $$willAnimate: true, - end: function() { - if (runner) { - runner.end(); - } else { - close(); - runner = new $$AnimateRunner(); - runner.complete(true); - } - return runner; - }, - start: function() { - if (runner) { - return runner; - } - - runner = new $$AnimateRunner(); - var closeActiveAnimations; - var chain = []; - - if (before) { - chain.push(function(fn) { - closeActiveAnimations = before(fn); - }); - } - - if (chain.length) { - chain.push(function(fn) { - applyOptions(); - fn(true); - }); - } else { - applyOptions(); - } - - if (after) { - chain.push(function(fn) { - closeActiveAnimations = after(fn); - }); - } - - runner.setHost({ - end: function() { - endAnimations(); - }, - cancel: function() { - endAnimations(true); - } - }); - - $$AnimateRunner.chain(chain, onComplete); - return runner; - - function onComplete(success) { - close(success); - runner.complete(success); - } - - function endAnimations(cancelled) { - if (!animationClosed) { - (closeActiveAnimations || noop)(cancelled); - onComplete(cancelled); - } - } - } - }; - - function executeAnimationFn(fn, element, event, options, onDone) { - var args; - switch (event) { - case 'animate': - args = [element, options.from, options.to, onDone]; - break; - - case 'setClass': - args = [element, classesToAdd, classesToRemove, onDone]; - break; - - case 'addClass': - args = [element, classesToAdd, onDone]; - break; - - case 'removeClass': - args = [element, classesToRemove, onDone]; - break; - - default: - args = [element, onDone]; - break; - } - - args.push(options); - - var value = fn.apply(fn, args); - if (value) { - if (isFunction(value.start)) { - value = value.start(); - } - - if (value instanceof $$AnimateRunner) { - value.done(onDone); - } else if (isFunction(value)) { - // optional onEnd / onCancel callback - return value; - } - } - - return noop; - } - - function groupEventedAnimations(element, event, options, animations, fnName) { - var operations = []; - forEach(animations, function(ani) { - var animation = ani[fnName]; - if (!animation) return; - - // note that all of these animations will run in parallel - operations.push(function() { - var runner; - var endProgressCb; - - var resolved = false; - var onAnimationComplete = function(rejected) { - if (!resolved) { - resolved = true; - (endProgressCb || noop)(rejected); - runner.complete(!rejected); - } - }; - - runner = new $$AnimateRunner({ - end: function() { - onAnimationComplete(); - }, - cancel: function() { - onAnimationComplete(true); - } - }); - - endProgressCb = executeAnimationFn(animation, element, event, options, function(result) { - var cancelled = result === false; - onAnimationComplete(cancelled); - }); - - return runner; - }); - }); - - return operations; - } - - function packageAnimations(element, event, options, animations, fnName) { - var operations = groupEventedAnimations(element, event, options, animations, fnName); - if (operations.length === 0) { - var a, b; - if (fnName === 'beforeSetClass') { - a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass'); - b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass'); - } else if (fnName === 'setClass') { - a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass'); - b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass'); - } - - if (a) { - operations = operations.concat(a); - } - if (b) { - operations = operations.concat(b); - } - } - - if (operations.length === 0) return; - - // TODO(matsko): add documentation - return function startAnimation(callback) { - var runners = []; - if (operations.length) { - forEach(operations, function(animateFn) { - runners.push(animateFn()); - }); - } - - if (runners.length) { - $$AnimateRunner.all(runners, callback); - } else { - callback(); - } - - return function endFn(reject) { - forEach(runners, function(runner) { - if (reject) { - runner.cancel(); - } else { - runner.end(); - } - }); - }; - }; - } - }; - - function lookupAnimations(classes) { - classes = isArray(classes) ? classes : classes.split(' '); - var matches = [], flagMap = {}; - for (var i = 0; i < classes.length; i++) { - var klass = classes[i], - animationFactory = $animateProvider.$$registeredAnimations[klass]; - if (animationFactory && !flagMap[klass]) { - matches.push($injector.get(animationFactory)); - flagMap[klass] = true; - } - } - return matches; - } - }]; -}]; - -var $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) { - $$animationProvider.drivers.push('$$animateJsDriver'); - this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) { - return function initDriverFn(animationDetails) { - if (animationDetails.from && animationDetails.to) { - var fromAnimation = prepareAnimation(animationDetails.from); - var toAnimation = prepareAnimation(animationDetails.to); - if (!fromAnimation && !toAnimation) return; - - return { - start: function() { - var animationRunners = []; - - if (fromAnimation) { - animationRunners.push(fromAnimation.start()); - } - - if (toAnimation) { - animationRunners.push(toAnimation.start()); - } - - $$AnimateRunner.all(animationRunners, done); - - var runner = new $$AnimateRunner({ - end: endFnFactory(), - cancel: endFnFactory() - }); - - return runner; - - function endFnFactory() { - return function() { - forEach(animationRunners, function(runner) { - // at this point we cannot cancel animations for groups just yet. 1.5+ - runner.end(); - }); - }; - } - - function done(status) { - runner.complete(status); - } - } - }; - } else { - return prepareAnimation(animationDetails); - } - }; - - function prepareAnimation(animationDetails) { - // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations - var element = animationDetails.element; - var event = animationDetails.event; - var options = animationDetails.options; - var classes = animationDetails.classes; - return $$animateJs(element, event, classes, options); - } - }]; -}]; - -var NG_ANIMATE_ATTR_NAME = 'data-ng-animate'; -var NG_ANIMATE_PIN_DATA = '$ngAnimatePin'; -var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) { - var PRE_DIGEST_STATE = 1; - var RUNNING_STATE = 2; - var ONE_SPACE = ' '; - - var rules = this.rules = { - skip: [], - cancel: [], - join: [] - }; - - function getEventData(options) { - return { - addClass: options.addClass, - removeClass: options.removeClass, - from: options.from, - to: options.to - }; - } - - function makeTruthyCssClassMap(classString) { - if (!classString) { - return null; - } - - var keys = classString.split(ONE_SPACE); - var map = Object.create(null); - - forEach(keys, function(key) { - map[key] = true; - }); - return map; - } - - function hasMatchingClasses(newClassString, currentClassString) { - if (newClassString && currentClassString) { - var currentClassMap = makeTruthyCssClassMap(currentClassString); - return newClassString.split(ONE_SPACE).some(function(className) { - return currentClassMap[className]; - }); - } - } - - function isAllowed(ruleType, currentAnimation, previousAnimation) { - return rules[ruleType].some(function(fn) { - return fn(currentAnimation, previousAnimation); - }); - } - - function hasAnimationClasses(animation, and) { - var a = (animation.addClass || '').length > 0; - var b = (animation.removeClass || '').length > 0; - return and ? a && b : a || b; - } - - rules.join.push(function(newAnimation, currentAnimation) { - // if the new animation is class-based then we can just tack that on - return !newAnimation.structural && hasAnimationClasses(newAnimation); - }); - - rules.skip.push(function(newAnimation, currentAnimation) { - // there is no need to animate anything if no classes are being added and - // there is no structural animation that will be triggered - return !newAnimation.structural && !hasAnimationClasses(newAnimation); - }); - - rules.skip.push(function(newAnimation, currentAnimation) { - // why should we trigger a new structural animation if the element will - // be removed from the DOM anyway? - return currentAnimation.event === 'leave' && newAnimation.structural; - }); - - rules.skip.push(function(newAnimation, currentAnimation) { - // if there is an ongoing current animation then don't even bother running the class-based animation - return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural; - }); - - rules.cancel.push(function(newAnimation, currentAnimation) { - // there can never be two structural animations running at the same time - return currentAnimation.structural && newAnimation.structural; - }); - - rules.cancel.push(function(newAnimation, currentAnimation) { - // if the previous animation is already running, but the new animation will - // be triggered, but the new animation is structural - return currentAnimation.state === RUNNING_STATE && newAnimation.structural; - }); - - rules.cancel.push(function(newAnimation, currentAnimation) { - // cancel the animation if classes added / removed in both animation cancel each other out, - // but only if the current animation isn't structural - - if (currentAnimation.structural) return false; - - var nA = newAnimation.addClass; - var nR = newAnimation.removeClass; - var cA = currentAnimation.addClass; - var cR = currentAnimation.removeClass; - - // early detection to save the global CPU shortage :) - if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) { - return false; - } - - return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA); - }); - - this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$Map', - '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow', - '$$isDocumentHidden', - function($$rAF, $rootScope, $rootElement, $document, $$Map, - $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow, - $$isDocumentHidden) { - - var activeAnimationsLookup = new $$Map(); - var disabledElementsLookup = new $$Map(); - var animationsEnabled = null; - - function removeFromDisabledElementsLookup(evt) { - disabledElementsLookup.delete(evt.target); - } - - function postDigestTaskFactory() { - var postDigestCalled = false; - return function(fn) { - // we only issue a call to postDigest before - // it has first passed. This prevents any callbacks - // from not firing once the animation has completed - // since it will be out of the digest cycle. - if (postDigestCalled) { - fn(); - } else { - $rootScope.$$postDigest(function() { - postDigestCalled = true; - fn(); - }); - } - }; - } - - // Wait until all directive and route-related templates are downloaded and - // compiled. The $templateRequest.totalPendingRequests variable keeps track of - // all of the remote templates being currently downloaded. If there are no - // templates currently downloading then the watcher will still fire anyway. - var deregisterWatch = $rootScope.$watch( - function() { return $templateRequest.totalPendingRequests === 0; }, - function(isEmpty) { - if (!isEmpty) return; - deregisterWatch(); - - // Now that all templates have been downloaded, $animate will wait until - // the post digest queue is empty before enabling animations. By having two - // calls to $postDigest calls we can ensure that the flag is enabled at the - // very end of the post digest queue. Since all of the animations in $animate - // use $postDigest, it's important that the code below executes at the end. - // This basically means that the page is fully downloaded and compiled before - // any animations are triggered. - $rootScope.$$postDigest(function() { - $rootScope.$$postDigest(function() { - // we check for null directly in the event that the application already called - // .enabled() with whatever arguments that it provided it with - if (animationsEnabled === null) { - animationsEnabled = true; - } - }); - }); - } - ); - - var callbackRegistry = Object.create(null); - - // remember that the `customFilter`/`classNameFilter` are set during the - // provider/config stage therefore we can optimize here and setup helper functions - var customFilter = $animateProvider.customFilter(); - var classNameFilter = $animateProvider.classNameFilter(); - var returnTrue = function() { return true; }; - - var isAnimatableByFilter = customFilter || returnTrue; - var isAnimatableClassName = !classNameFilter ? returnTrue : function(node, options) { - var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' '); - return classNameFilter.test(className); - }; - - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - function normalizeAnimationDetails(element, animation) { - return mergeAnimationDetails(element, animation, {}); - } - - // IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259. - var contains = window.Node.prototype.contains || /** @this */ function(arg) { - // eslint-disable-next-line no-bitwise - return this === arg || !!(this.compareDocumentPosition(arg) & 16); - }; - - function findCallbacks(targetParentNode, targetNode, event) { - var matches = []; - var entries = callbackRegistry[event]; - if (entries) { - forEach(entries, function(entry) { - if (contains.call(entry.node, targetNode)) { - matches.push(entry.callback); - } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) { - matches.push(entry.callback); - } - }); - } - - return matches; - } - - function filterFromRegistry(list, matchContainer, matchCallback) { - var containerNode = extractElementNode(matchContainer); - return list.filter(function(entry) { - var isMatch = entry.node === containerNode && - (!matchCallback || entry.callback === matchCallback); - return !isMatch; - }); - } - - function cleanupEventListeners(phase, node) { - if (phase === 'close' && !node.parentNode) { - // If the element is not attached to a parentNode, it has been removed by - // the domOperation, and we can safely remove the event callbacks - $animate.off(node); - } - } - - var $animate = { - on: function(event, container, callback) { - var node = extractElementNode(container); - callbackRegistry[event] = callbackRegistry[event] || []; - callbackRegistry[event].push({ - node: node, - callback: callback - }); - - // Remove the callback when the element is removed from the DOM - jqLite(container).on('$destroy', function() { - var animationDetails = activeAnimationsLookup.get(node); - - if (!animationDetails) { - // If there's an animation ongoing, the callback calling code will remove - // the event listeners. If we'd remove here, the callbacks would be removed - // before the animation ends - $animate.off(event, container, callback); - } - }); - }, - - off: function(event, container, callback) { - if (arguments.length === 1 && !isString(arguments[0])) { - container = arguments[0]; - for (var eventType in callbackRegistry) { - callbackRegistry[eventType] = filterFromRegistry(callbackRegistry[eventType], container); - } - - return; - } - - var entries = callbackRegistry[event]; - if (!entries) return; - - callbackRegistry[event] = arguments.length === 1 - ? null - : filterFromRegistry(entries, container, callback); - }, - - pin: function(element, parentElement) { - assertArg(isElement(element), 'element', 'not an element'); - assertArg(isElement(parentElement), 'parentElement', 'not an element'); - element.data(NG_ANIMATE_PIN_DATA, parentElement); - }, - - push: function(element, event, options, domOperation) { - options = options || {}; - options.domOperation = domOperation; - return queueAnimation(element, event, options); - }, - - // this method has four signatures: - // () - global getter - // (bool) - global setter - // (element) - element getter - // (element, bool) - element setter - enabled: function(element, bool) { - var argCount = arguments.length; - - if (argCount === 0) { - // () - Global getter - bool = !!animationsEnabled; - } else { - var hasElement = isElement(element); - - if (!hasElement) { - // (bool) - Global setter - bool = animationsEnabled = !!element; - } else { - var node = getDomNode(element); - - if (argCount === 1) { - // (element) - Element getter - bool = !disabledElementsLookup.get(node); - } else { - // (element, bool) - Element setter - if (!disabledElementsLookup.has(node)) { - // The element is added to the map for the first time. - // Create a listener to remove it on `$destroy` (to avoid memory leak). - jqLite(element).on('$destroy', removeFromDisabledElementsLookup); - } - disabledElementsLookup.set(node, !bool); - } - } - } - - return bool; - } - }; - - return $animate; - - function queueAnimation(originalElement, event, initialOptions) { - // we always make a copy of the options since - // there should never be any side effects on - // the input data when running `$animateCss`. - var options = copy(initialOptions); - - var element = stripCommentsFromElement(originalElement); - var node = getDomNode(element); - var parentNode = node && node.parentNode; - - options = prepareAnimationOptions(options); - - // we create a fake runner with a working promise. - // These methods will become available after the digest has passed - var runner = new $$AnimateRunner(); - - // this is used to trigger callbacks in postDigest mode - var runInNextPostDigestOrNow = postDigestTaskFactory(); - - if (isArray(options.addClass)) { - options.addClass = options.addClass.join(' '); - } - - if (options.addClass && !isString(options.addClass)) { - options.addClass = null; - } - - if (isArray(options.removeClass)) { - options.removeClass = options.removeClass.join(' '); - } - - if (options.removeClass && !isString(options.removeClass)) { - options.removeClass = null; - } - - if (options.from && !isObject(options.from)) { - options.from = null; - } - - if (options.to && !isObject(options.to)) { - options.to = null; - } - - // If animations are hard-disabled for the whole application there is no need to continue. - // There are also situations where a directive issues an animation for a jqLite wrapper that - // contains only comment nodes. In this case, there is no way we can perform an animation. - if (!animationsEnabled || - !node || - !isAnimatableByFilter(node, event, initialOptions) || - !isAnimatableClassName(node, options)) { - close(); - return runner; - } - - var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0; - - var documentHidden = $$isDocumentHidden(); - - // This is a hard disable of all animations the element itself, therefore there is no need to - // continue further past this point if not enabled - // Animations are also disabled if the document is currently hidden (page is not visible - // to the user), because browsers slow down or do not flush calls to requestAnimationFrame - var skipAnimations = documentHidden || disabledElementsLookup.get(node); - var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {}; - var hasExistingAnimation = !!existingAnimation.state; - - // there is no point in traversing the same collection of parent ancestors if a followup - // animation will be run on the same element that already did all that checking work - if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state !== PRE_DIGEST_STATE)) { - skipAnimations = !areAnimationsAllowed(node, parentNode, event); - } - - if (skipAnimations) { - // Callbacks should fire even if the document is hidden (regression fix for issue #14120) - if (documentHidden) notifyProgress(runner, event, 'start', getEventData(options)); - close(); - if (documentHidden) notifyProgress(runner, event, 'close', getEventData(options)); - return runner; - } - - if (isStructural) { - closeChildAnimations(node); - } - - var newAnimation = { - structural: isStructural, - element: element, - event: event, - addClass: options.addClass, - removeClass: options.removeClass, - close: close, - options: options, - runner: runner - }; - - if (hasExistingAnimation) { - var skipAnimationFlag = isAllowed('skip', newAnimation, existingAnimation); - if (skipAnimationFlag) { - if (existingAnimation.state === RUNNING_STATE) { - close(); - return runner; - } else { - mergeAnimationDetails(element, existingAnimation, newAnimation); - return existingAnimation.runner; - } - } - var cancelAnimationFlag = isAllowed('cancel', newAnimation, existingAnimation); - if (cancelAnimationFlag) { - if (existingAnimation.state === RUNNING_STATE) { - // this will end the animation right away and it is safe - // to do so since the animation is already running and the - // runner callback code will run in async - existingAnimation.runner.end(); - } else if (existingAnimation.structural) { - // this means that the animation is queued into a digest, but - // hasn't started yet. Therefore it is safe to run the close - // method which will call the runner methods in async. - existingAnimation.close(); - } else { - // this will merge the new animation options into existing animation options - mergeAnimationDetails(element, existingAnimation, newAnimation); - - return existingAnimation.runner; - } - } else { - // a joined animation means that this animation will take over the existing one - // so an example would involve a leave animation taking over an enter. Then when - // the postDigest kicks in the enter will be ignored. - var joinAnimationFlag = isAllowed('join', newAnimation, existingAnimation); - if (joinAnimationFlag) { - if (existingAnimation.state === RUNNING_STATE) { - normalizeAnimationDetails(element, newAnimation); - } else { - applyGeneratedPreparationClasses($$jqLite, element, isStructural ? event : null, options); - - event = newAnimation.event = existingAnimation.event; - options = mergeAnimationDetails(element, existingAnimation, newAnimation); - - //we return the same runner since only the option values of this animation will - //be fed into the `existingAnimation`. - return existingAnimation.runner; - } - } - } - } else { - // normalization in this case means that it removes redundant CSS classes that - // already exist (addClass) or do not exist (removeClass) on the element - normalizeAnimationDetails(element, newAnimation); - } - - // when the options are merged and cleaned up we may end up not having to do - // an animation at all, therefore we should check this before issuing a post - // digest callback. Structural animations will always run no matter what. - var isValidAnimation = newAnimation.structural; - if (!isValidAnimation) { - // animate (from/to) can be quickly checked first, otherwise we check if any classes are present - isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0) - || hasAnimationClasses(newAnimation); - } - - if (!isValidAnimation) { - close(); - clearElementAnimationState(node); - return runner; - } - - // the counter keeps track of cancelled animations - var counter = (existingAnimation.counter || 0) + 1; - newAnimation.counter = counter; - - markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation); - - $rootScope.$$postDigest(function() { - // It is possible that the DOM nodes inside `originalElement` have been replaced. This can - // happen if the animated element is a transcluded clone and also has a `templateUrl` - // directive on it. Therefore, we must recreate `element` in order to interact with the - // actual DOM nodes. - // Note: We still need to use the old `node` for certain things, such as looking up in - // HashMaps where it was used as the key. - - element = stripCommentsFromElement(originalElement); - - var animationDetails = activeAnimationsLookup.get(node); - var animationCancelled = !animationDetails; - animationDetails = animationDetails || {}; - - // if addClass/removeClass is called before something like enter then the - // registered parent element may not be present. The code below will ensure - // that a final value for parent element is obtained - var parentElement = element.parent() || []; - - // animate/structural/class-based animations all have requirements. Otherwise there - // is no point in performing an animation. The parent node must also be set. - var isValidAnimation = parentElement.length > 0 - && (animationDetails.event === 'animate' - || animationDetails.structural - || hasAnimationClasses(animationDetails)); - - // this means that the previous animation was cancelled - // even if the follow-up animation is the same event - if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) { - // if another animation did not take over then we need - // to make sure that the domOperation and options are - // handled accordingly - if (animationCancelled) { - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - } - - // if the event changed from something like enter to leave then we do - // it, otherwise if it's the same then the end result will be the same too - if (animationCancelled || (isStructural && animationDetails.event !== event)) { - options.domOperation(); - runner.end(); - } - - // in the event that the element animation was not cancelled or a follow-up animation - // isn't allowed to animate from here then we need to clear the state of the element - // so that any future animations won't read the expired animation data. - if (!isValidAnimation) { - clearElementAnimationState(node); - } - - return; - } - - // this combined multiple class to addClass / removeClass into a setClass event - // so long as a structural event did not take over the animation - event = !animationDetails.structural && hasAnimationClasses(animationDetails, true) - ? 'setClass' - : animationDetails.event; - - markElementAnimationState(node, RUNNING_STATE); - var realRunner = $$animation(element, event, animationDetails.options); - - // this will update the runner's flow-control events based on - // the `realRunner` object. - runner.setHost(realRunner); - notifyProgress(runner, event, 'start', getEventData(options)); - - realRunner.done(function(status) { - close(!status); - var animationDetails = activeAnimationsLookup.get(node); - if (animationDetails && animationDetails.counter === counter) { - clearElementAnimationState(node); - } - notifyProgress(runner, event, 'close', getEventData(options)); - }); - }); - - return runner; - - function notifyProgress(runner, event, phase, data) { - runInNextPostDigestOrNow(function() { - var callbacks = findCallbacks(parentNode, node, event); - if (callbacks.length) { - // do not optimize this call here to RAF because - // we don't know how heavy the callback code here will - // be and if this code is buffered then this can - // lead to a performance regression. - $$rAF(function() { - forEach(callbacks, function(callback) { - callback(element, phase, data); - }); - cleanupEventListeners(phase, node); - }); - } else { - cleanupEventListeners(phase, node); - } - }); - runner.progress(event, phase, data); - } - - function close(reject) { - clearGeneratedClasses(element, options); - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - options.domOperation(); - runner.complete(!reject); - } - } - - function closeChildAnimations(node) { - var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']'); - forEach(children, function(child) { - var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10); - var animationDetails = activeAnimationsLookup.get(child); - if (animationDetails) { - switch (state) { - case RUNNING_STATE: - animationDetails.runner.end(); - /* falls through */ - case PRE_DIGEST_STATE: - activeAnimationsLookup.delete(child); - break; - } - } - }); - } - - function clearElementAnimationState(node) { - node.removeAttribute(NG_ANIMATE_ATTR_NAME); - activeAnimationsLookup.delete(node); - } - - /** - * This fn returns false if any of the following is true: - * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed - * b) a parent element has an ongoing structural animation, and animateChildren is false - * c) the element is not a child of the body - * d) the element is not a child of the $rootElement - */ - function areAnimationsAllowed(node, parentNode, event) { - var bodyNode = $document[0].body; - var rootNode = getDomNode($rootElement); - - var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML'; - var rootNodeDetected = (node === rootNode); - var parentAnimationDetected = false; - var elementDisabled = disabledElementsLookup.get(node); - var animateChildren; - - var parentHost = jqLite.data(node, NG_ANIMATE_PIN_DATA); - if (parentHost) { - parentNode = getDomNode(parentHost); - } - - while (parentNode) { - if (!rootNodeDetected) { - // AngularJS doesn't want to attempt to animate elements outside of the application - // therefore we need to ensure that the rootElement is an ancestor of the current element - rootNodeDetected = (parentNode === rootNode); - } - - if (parentNode.nodeType !== ELEMENT_NODE) { - // no point in inspecting the #document element - break; - } - - var details = activeAnimationsLookup.get(parentNode) || {}; - // either an enter, leave or move animation will commence - // therefore we can't allow any animations to take place - // but if a parent animation is class-based then that's ok - if (!parentAnimationDetected) { - var parentNodeDisabled = disabledElementsLookup.get(parentNode); - - if (parentNodeDisabled === true && elementDisabled !== false) { - // disable animations if the user hasn't explicitly enabled animations on the - // current element - elementDisabled = true; - // element is disabled via parent element, no need to check anything else - break; - } else if (parentNodeDisabled === false) { - elementDisabled = false; - } - parentAnimationDetected = details.structural; - } - - if (isUndefined(animateChildren) || animateChildren === true) { - var value = jqLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA); - if (isDefined(value)) { - animateChildren = value; - } - } - - // there is no need to continue traversing at this point - if (parentAnimationDetected && animateChildren === false) break; - - if (!bodyNodeDetected) { - // we also need to ensure that the element is or will be a part of the body element - // otherwise it is pointless to even issue an animation to be rendered - bodyNodeDetected = (parentNode === bodyNode); - } - - if (bodyNodeDetected && rootNodeDetected) { - // If both body and root have been found, any other checks are pointless, - // as no animation data should live outside the application - break; - } - - if (!rootNodeDetected) { - // If `rootNode` is not detected, check if `parentNode` is pinned to another element - parentHost = jqLite.data(parentNode, NG_ANIMATE_PIN_DATA); - if (parentHost) { - // The pin target element becomes the next parent element - parentNode = getDomNode(parentHost); - continue; - } - } - - parentNode = parentNode.parentNode; - } - - var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true; - return allowAnimation && rootNodeDetected && bodyNodeDetected; - } - - function markElementAnimationState(node, state, details) { - details = details || {}; - details.state = state; - - node.setAttribute(NG_ANIMATE_ATTR_NAME, state); - - var oldValue = activeAnimationsLookup.get(node); - var newValue = oldValue - ? extend(oldValue, details) - : details; - activeAnimationsLookup.set(node, newValue); - } - }]; -}]; - -/** @this */ -var $$AnimateCacheProvider = function() { - - var KEY = '$$ngAnimateParentKey'; - var parentCounter = 0; - var cache = Object.create(null); - - this.$get = [function() { - return { - cacheKey: function(node, method, addClass, removeClass) { - var parentNode = node.parentNode; - var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter); - var parts = [parentID, method, node.getAttribute('class')]; - if (addClass) { - parts.push(addClass); - } - if (removeClass) { - parts.push(removeClass); - } - return parts.join(' '); - }, - - containsCachedAnimationWithoutDuration: function(key) { - var entry = cache[key]; - - // nothing cached, so go ahead and animate - // otherwise it should be a valid animation - return (entry && !entry.isValid) || false; - }, - - flush: function() { - cache = Object.create(null); - }, - - count: function(key) { - var entry = cache[key]; - return entry ? entry.total : 0; - }, - - get: function(key) { - var entry = cache[key]; - return entry && entry.value; - }, - - put: function(key, value, isValid) { - if (!cache[key]) { - cache[key] = { total: 1, value: value, isValid: isValid }; - } else { - cache[key].total++; - cache[key].value = value; - } - } - }; - }]; -}; - -/* exported $$AnimationProvider */ - -var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) { - var NG_ANIMATE_REF_ATTR = 'ng-animate-ref'; - - var drivers = this.drivers = []; - - var RUNNER_STORAGE_KEY = '$$animationRunner'; - var PREPARE_CLASSES_KEY = '$$animatePrepareClasses'; - - function setRunner(element, runner) { - element.data(RUNNER_STORAGE_KEY, runner); - } - - function removeRunner(element) { - element.removeData(RUNNER_STORAGE_KEY); - } - - function getRunner(element) { - return element.data(RUNNER_STORAGE_KEY); - } - - this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$Map', '$$rAFScheduler', '$$animateCache', - function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler, $$animateCache) { - - var animationQueue = []; - var applyAnimationClasses = applyAnimationClassesFactory($$jqLite); - - function sortAnimations(animations) { - var tree = { children: [] }; - var i, lookup = new $$Map(); - - // this is done first beforehand so that the map - // is filled with a list of the elements that will be animated - for (i = 0; i < animations.length; i++) { - var animation = animations[i]; - lookup.set(animation.domNode, animations[i] = { - domNode: animation.domNode, - element: animation.element, - fn: animation.fn, - children: [] - }); - } - - for (i = 0; i < animations.length; i++) { - processNode(animations[i]); - } - - return flatten(tree); - - function processNode(entry) { - if (entry.processed) return entry; - entry.processed = true; - - var elementNode = entry.domNode; - var parentNode = elementNode.parentNode; - lookup.set(elementNode, entry); - - var parentEntry; - while (parentNode) { - parentEntry = lookup.get(parentNode); - if (parentEntry) { - if (!parentEntry.processed) { - parentEntry = processNode(parentEntry); - } - break; - } - parentNode = parentNode.parentNode; - } - - (parentEntry || tree).children.push(entry); - return entry; - } - - function flatten(tree) { - var result = []; - var queue = []; - var i; - - for (i = 0; i < tree.children.length; i++) { - queue.push(tree.children[i]); - } - - var remainingLevelEntries = queue.length; - var nextLevelEntries = 0; - var row = []; - - for (i = 0; i < queue.length; i++) { - var entry = queue[i]; - if (remainingLevelEntries <= 0) { - remainingLevelEntries = nextLevelEntries; - nextLevelEntries = 0; - result.push(row); - row = []; - } - row.push(entry); - entry.children.forEach(function(childEntry) { - nextLevelEntries++; - queue.push(childEntry); - }); - remainingLevelEntries--; - } - - if (row.length) { - result.push(row); - } - - return result; - } - } - - // TODO(matsko): document the signature in a better way - return function(element, event, options) { - options = prepareAnimationOptions(options); - var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0; - - // there is no animation at the current moment, however - // these runner methods will get later updated with the - // methods leading into the driver's end/cancel methods - // for now they just stop the animation from starting - var runner = new $$AnimateRunner({ - end: function() { close(); }, - cancel: function() { close(true); } - }); - - if (!drivers.length) { - close(); - return runner; - } - - var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass)); - var tempClasses = options.tempClasses; - if (tempClasses) { - classes += ' ' + tempClasses; - options.tempClasses = null; - } - - if (isStructural) { - element.data(PREPARE_CLASSES_KEY, 'ng-' + event + PREPARE_CLASS_SUFFIX); - } - - setRunner(element, runner); - - animationQueue.push({ - // this data is used by the postDigest code and passed into - // the driver step function - element: element, - classes: classes, - event: event, - structural: isStructural, - options: options, - beforeStart: beforeStart, - close: close - }); - - element.on('$destroy', handleDestroyedElement); - - // we only want there to be one function called within the post digest - // block. This way we can group animations for all the animations that - // were apart of the same postDigest flush call. - if (animationQueue.length > 1) return runner; - - $rootScope.$$postDigest(function() { - var animations = []; - forEach(animationQueue, function(entry) { - // the element was destroyed early on which removed the runner - // form its storage. This means we can't animate this element - // at all and it already has been closed due to destruction. - if (getRunner(entry.element)) { - animations.push(entry); - } else { - entry.close(); - } - }); - - // now any future animations will be in another postDigest - animationQueue.length = 0; - - var groupedAnimations = groupAnimations(animations); - var toBeSortedAnimations = []; - - forEach(groupedAnimations, function(animationEntry) { - var element = animationEntry.from ? animationEntry.from.element : animationEntry.element; - var extraClasses = options.addClass; - - extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME; - var cacheKey = $$animateCache.cacheKey(element[0], animationEntry.event, extraClasses, options.removeClass); - - toBeSortedAnimations.push({ - element: element, - domNode: getDomNode(element), - fn: function triggerAnimationStart() { - var startAnimationFn, closeFn = animationEntry.close; - - // in the event that we've cached the animation status for this element - // and it's in fact an invalid animation (something that has duration = 0) - // then we should skip all the heavy work from here on - if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) { - closeFn(); - return; - } - - // it's important that we apply the `ng-animate` CSS class and the - // temporary classes before we do any driver invoking since these - // CSS classes may be required for proper CSS detection. - animationEntry.beforeStart(); - - // in the event that the element was removed before the digest runs or - // during the RAF sequencing then we should not trigger the animation. - var targetElement = animationEntry.anchors - ? (animationEntry.from.element || animationEntry.to.element) - : animationEntry.element; - - if (getRunner(targetElement)) { - var operation = invokeFirstDriver(animationEntry); - if (operation) { - startAnimationFn = operation.start; - } - } - - if (!startAnimationFn) { - closeFn(); - } else { - var animationRunner = startAnimationFn(); - animationRunner.done(function(status) { - closeFn(!status); - }); - updateAnimationRunners(animationEntry, animationRunner); - } - } - }); - }); - - // we need to sort each of the animations in order of parent to child - // relationships. This ensures that the child classes are applied at the - // right time. - var finalAnimations = sortAnimations(toBeSortedAnimations); - for (var i = 0; i < finalAnimations.length; i++) { - var innerArray = finalAnimations[i]; - for (var j = 0; j < innerArray.length; j++) { - var entry = innerArray[j]; - var element = entry.element; - - // the RAFScheduler code only uses functions - finalAnimations[i][j] = entry.fn; - - // the first row of elements shouldn't have a prepare-class added to them - // since the elements are at the top of the animation hierarchy and they - // will be applied without a RAF having to pass... - if (i === 0) { - element.removeData(PREPARE_CLASSES_KEY); - continue; - } - - var prepareClassName = element.data(PREPARE_CLASSES_KEY); - if (prepareClassName) { - $$jqLite.addClass(element, prepareClassName); - } - } - } - - $$rAFScheduler(finalAnimations); - }); - - return runner; - - // TODO(matsko): change to reference nodes - function getAnchorNodes(node) { - var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']'; - var items = node.hasAttribute(NG_ANIMATE_REF_ATTR) - ? [node] - : node.querySelectorAll(SELECTOR); - var anchors = []; - forEach(items, function(node) { - var attr = node.getAttribute(NG_ANIMATE_REF_ATTR); - if (attr && attr.length) { - anchors.push(node); - } - }); - return anchors; - } - - function groupAnimations(animations) { - var preparedAnimations = []; - var refLookup = {}; - forEach(animations, function(animation, index) { - var element = animation.element; - var node = getDomNode(element); - var event = animation.event; - var enterOrMove = ['enter', 'move'].indexOf(event) >= 0; - var anchorNodes = animation.structural ? getAnchorNodes(node) : []; - - if (anchorNodes.length) { - var direction = enterOrMove ? 'to' : 'from'; - - forEach(anchorNodes, function(anchor) { - var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR); - refLookup[key] = refLookup[key] || {}; - refLookup[key][direction] = { - animationID: index, - element: jqLite(anchor) - }; - }); - } else { - preparedAnimations.push(animation); - } - }); - - var usedIndicesLookup = {}; - var anchorGroups = {}; - forEach(refLookup, function(operations, key) { - var from = operations.from; - var to = operations.to; - - if (!from || !to) { - // only one of these is set therefore we can't have an - // anchor animation since all three pieces are required - var index = from ? from.animationID : to.animationID; - var indexKey = index.toString(); - if (!usedIndicesLookup[indexKey]) { - usedIndicesLookup[indexKey] = true; - preparedAnimations.push(animations[index]); - } - return; - } - - var fromAnimation = animations[from.animationID]; - var toAnimation = animations[to.animationID]; - var lookupKey = from.animationID.toString(); - if (!anchorGroups[lookupKey]) { - var group = anchorGroups[lookupKey] = { - structural: true, - beforeStart: function() { - fromAnimation.beforeStart(); - toAnimation.beforeStart(); - }, - close: function() { - fromAnimation.close(); - toAnimation.close(); - }, - classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes), - from: fromAnimation, - to: toAnimation, - anchors: [] // TODO(matsko): change to reference nodes - }; - - // the anchor animations require that the from and to elements both have at least - // one shared CSS class which effectively marries the two elements together to use - // the same animation driver and to properly sequence the anchor animation. - if (group.classes.length) { - preparedAnimations.push(group); - } else { - preparedAnimations.push(fromAnimation); - preparedAnimations.push(toAnimation); - } - } - - anchorGroups[lookupKey].anchors.push({ - 'out': from.element, 'in': to.element - }); - }); - - return preparedAnimations; - } - - function cssClassesIntersection(a,b) { - a = a.split(' '); - b = b.split(' '); - var matches = []; - - for (var i = 0; i < a.length; i++) { - var aa = a[i]; - if (aa.substring(0,3) === 'ng-') continue; - - for (var j = 0; j < b.length; j++) { - if (aa === b[j]) { - matches.push(aa); - break; - } - } - } - - return matches.join(' '); - } - - function invokeFirstDriver(animationDetails) { - // we loop in reverse order since the more general drivers (like CSS and JS) - // may attempt more elements, but custom drivers are more particular - for (var i = drivers.length - 1; i >= 0; i--) { - var driverName = drivers[i]; - var factory = $injector.get(driverName); - var driver = factory(animationDetails); - if (driver) { - return driver; - } - } - } - - function beforeStart() { - tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME; - $$jqLite.addClass(element, tempClasses); - - var prepareClassName = element.data(PREPARE_CLASSES_KEY); - if (prepareClassName) { - $$jqLite.removeClass(element, prepareClassName); - prepareClassName = null; - } - } - - function updateAnimationRunners(animation, newRunner) { - if (animation.from && animation.to) { - update(animation.from.element); - update(animation.to.element); - } else { - update(animation.element); - } - - function update(element) { - var runner = getRunner(element); - if (runner) runner.setHost(newRunner); - } - } - - function handleDestroyedElement() { - var runner = getRunner(element); - if (runner && (event !== 'leave' || !options.$$domOperationFired)) { - runner.end(); - } - } - - function close(rejected) { - element.off('$destroy', handleDestroyedElement); - removeRunner(element); - - applyAnimationClasses(element, options); - applyAnimationStyles(element, options); - options.domOperation(); - - if (tempClasses) { - $$jqLite.removeClass(element, tempClasses); - } - - runner.complete(!rejected); - } - }; - }]; -}]; - -/** - * @ngdoc directive - * @name ngAnimateSwap - * @restrict A - * @scope - * - * @description - * - * ngAnimateSwap is a animation-oriented directive that allows for the container to - * be removed and entered in whenever the associated expression changes. A - * common usecase for this directive is a rotating banner or slider component which - * contains one image being present at a time. When the active image changes - * then the old image will perform a `leave` animation and the new element - * will be inserted via an `enter` animation. - * - * @animations - * | Animation | Occurs | - * |----------------------------------|--------------------------------------| - * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM | - * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM | - * - * @example - * - * - *
    - *
    - * {{ number }} - *
    - *
    - *
    - * - * angular.module('ngAnimateSwapExample', ['ngAnimate']) - * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) { - * $scope.number = 0; - * $interval(function() { - * $scope.number++; - * }, 1000); - * - * var colors = ['red','blue','green','yellow','orange']; - * $scope.colorClass = function(number) { - * return colors[number % colors.length]; - * }; - * }]); - * - * - * .container { - * height:250px; - * width:250px; - * position:relative; - * overflow:hidden; - * border:2px solid black; - * } - * .container .cell { - * font-size:150px; - * text-align:center; - * line-height:250px; - * position:absolute; - * top:0; - * left:0; - * right:0; - * border-bottom:2px solid black; - * } - * .swap-animation.ng-enter, .swap-animation.ng-leave { - * transition:0.5s linear all; - * } - * .swap-animation.ng-enter { - * top:-250px; - * } - * .swap-animation.ng-enter-active { - * top:0px; - * } - * .swap-animation.ng-leave { - * top:0px; - * } - * .swap-animation.ng-leave-active { - * top:250px; - * } - * .red { background:red; } - * .green { background:green; } - * .blue { background:blue; } - * .yellow { background:yellow; } - * .orange { background:orange; } - * - *
    - */ -var ngAnimateSwapDirective = ['$animate', function($animate) { - return { - restrict: 'A', - transclude: 'element', - terminal: true, - priority: 550, // We use 550 here to ensure that the directive is caught before others, - // but after `ngIf` (at priority 600). - link: function(scope, $element, attrs, ctrl, $transclude) { - var previousElement, previousScope; - scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) { - if (previousElement) { - $animate.leave(previousElement); - } - if (previousScope) { - previousScope.$destroy(); - previousScope = null; - } - if (value || value === 0) { - $transclude(function(clone, childScope) { - previousElement = clone; - previousScope = childScope; - $animate.enter(clone, null, $element); - }); - } - }); - } - }; -}]; - -/** - * @ngdoc module - * @name ngAnimate - * @description - * - * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via - * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an AngularJS app. - * - * ## Usage - * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based - * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For - * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within - * the HTML element that the animation will be triggered on. - * - * ## Directive Support - * The following directives are "animation aware": - * - * | Directive | Supported Animations | - * |-------------------------------------------------------------------------------|---------------------------------------------------------------------------| - * | {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) | - * | {@link ngAnimate.directive:ngAnimateSwap#animations ngAnimateSwap} | enter and leave | - * | {@link ng.directive:ngClass#animations ngClass / {{class}​}} | add and remove | - * | {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove | - * | {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove | - * | {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) | - * | {@link ng.directive:ngIf#animations ngIf} | enter and leave | - * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave | - * | {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave | - * | {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) | - * | {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) | - * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave, and move | - * | {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) | - * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave | - * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave | - * - * (More information can be found by visiting the documentation associated with each directive.) - * - * For a full breakdown of the steps involved during each animation event, refer to the - * {@link ng.$animate `$animate` API docs}. - * - * ## CSS-based Animations - * - * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML - * and CSS code we can create an animation that will be picked up by AngularJS when an underlying directive performs an operation. - * - * The example below shows how an `enter` animation can be made possible on an element using `ng-if`: - * - * ```html - *
    - * Fade me in out - *
    - * - * - * ``` - * - * Notice the CSS class **fade**? We can now create the CSS transition code that references this class: - * - * ```css - * /* The starting CSS styles for the enter animation */ - * .fade.ng-enter { - * transition:0.5s linear all; - * opacity:0; - * } - * - * /* The finishing CSS styles for the enter animation */ - * .fade.ng-enter.ng-enter-active { - * opacity:1; - * } - * ``` - * - * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two - * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition - * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards. - * - * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions: - * - * ```css - * /* now the element will fade out before it is removed from the DOM */ - * .fade.ng-leave { - * transition:0.5s linear all; - * opacity:1; - * } - * .fade.ng-leave.ng-leave-active { - * opacity:0; - * } - * ``` - * - * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class: - * - * ```css - * /* there is no need to define anything inside of the destination - * CSS class since the keyframe will take charge of the animation */ - * .fade.ng-leave { - * animation: my_fade_animation 0.5s linear; - * -webkit-animation: my_fade_animation 0.5s linear; - * } - * - * @keyframes my_fade_animation { - * from { opacity:1; } - * to { opacity:0; } - * } - * - * @-webkit-keyframes my_fade_animation { - * from { opacity:1; } - * to { opacity:0; } - * } - * ``` - * - * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element. - * - * ### CSS Class-based Animations - * - * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different - * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added - * and removed. - * - * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class: - * - * ```html - *
    - * Show and hide me - *
    - * - * - * - * ``` - * - * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since - * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest. - * - * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation - * with CSS styles. - * - * ```html - *
    - * Highlight this box - *
    - * - * - * - * ``` - * - * We can also make use of CSS keyframes by placing them within the CSS classes. - * - * - * ### CSS Staggering Animations - * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a - * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be - * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for - * the animation. The style property expected within the stagger class can either be a **transition-delay** or an - * **animation-delay** property (or both if your animation contains both transitions and keyframe animations). - * - * ```css - * .my-animation.ng-enter { - * /* standard transition code */ - * transition: 1s linear all; - * opacity:0; - * } - * .my-animation.ng-enter-stagger { - * /* this will have a 100ms delay between each successive leave animation */ - * transition-delay: 0.1s; - * - * /* As of 1.4.4, this must always be set: it signals ngAnimate - * to not accidentally inherit a delay property from another CSS class */ - * transition-duration: 0s; - * - * /* if you are using animations instead of transitions you should configure as follows: - * animation-delay: 0.1s; - * animation-duration: 0s; */ - * } - * .my-animation.ng-enter.ng-enter-active { - * /* standard transition styles */ - * opacity:1; - * } - * ``` - * - * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations - * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this - * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation - * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired. - * - * The following code will issue the **ng-leave-stagger** event on the element provided: - * - * ```js - * var kids = parent.children(); - * - * $animate.leave(kids[0]); //stagger index=0 - * $animate.leave(kids[1]); //stagger index=1 - * $animate.leave(kids[2]); //stagger index=2 - * $animate.leave(kids[3]); //stagger index=3 - * $animate.leave(kids[4]); //stagger index=4 - * - * window.requestAnimationFrame(function() { - * //stagger has reset itself - * $animate.leave(kids[5]); //stagger index=0 - * $animate.leave(kids[6]); //stagger index=1 - * - * $scope.$digest(); - * }); - * ``` - * - * Stagger animations are currently only supported within CSS-defined animations. - * - * ### The `ng-animate` CSS class - * - * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation. - * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations). - * - * Therefore, animations can be applied to an element using this temporary class directly via CSS. - * - * ```css - * .zipper.ng-animate { - * transition:0.5s linear all; - * } - * .zipper.ng-enter { - * opacity:0; - * } - * .zipper.ng-enter.ng-enter-active { - * opacity:1; - * } - * .zipper.ng-leave { - * opacity:1; - * } - * .zipper.ng-leave.ng-leave-active { - * opacity:0; - * } - * ``` - * - * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove - * the CSS class once an animation has completed.) - * - * - * ### The `ng-[event]-prepare` class - * - * This is a special class that can be used to prevent unwanted flickering / flash of content before - * the actual animation starts. The class is added as soon as an animation is initialized, but removed - * before the actual animation starts (after waiting for a $digest). - * It is also only added for *structural* animations (`enter`, `move`, and `leave`). - * - * In practice, flickering can appear when nesting elements with structural animations such as `ngIf` - * into elements that have class-based animations such as `ngClass`. - * - * ```html - *
    - *
    - *
    - *
    - *
    - * ``` - * - * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating. - * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts: - * - * ```css - * .message.ng-enter-prepare { - * opacity: 0; - * } - * ``` - * - * ### Animating between value changes - * - * Sometimes you need to animate between different expression states, whose values - * don't necessary need to be known or referenced in CSS styles. - * Unless possible with another {@link ngAnimate#directive-support "animation aware" directive}, - * that specific use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as - * can be seen in {@link ngAnimate.directive:ngAnimateSwap#examples this example}. - * - * Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it - * creates a new instance of the element (including any other/child directives it may have) and - * links it to a new scope every time *swap* happens. In some cases this might not be desirable - * (e.g. for performance reasons, or when you wish to retain internal state on the original - * element instance). - * - * ## JavaScript-based Animations - * - * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared - * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the - * `module.animation()` module function we can register the animation. - * - * Let's see an example of a enter/leave animation using `ngRepeat`: - * - * ```html - *
    - * {{ item }} - *
    - * ``` - * - * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`: - * - * ```js - * myModule.animation('.slide', [function() { - * return { - * // make note that other events (like addClass/removeClass) - * // have different function input parameters - * enter: function(element, doneFn) { - * jQuery(element).fadeIn(1000, doneFn); - * - * // remember to call doneFn so that AngularJS - * // knows that the animation has concluded - * }, - * - * move: function(element, doneFn) { - * jQuery(element).fadeIn(1000, doneFn); - * }, - * - * leave: function(element, doneFn) { - * jQuery(element).fadeOut(1000, doneFn); - * } - * } - * }]); - * ``` - * - * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as - * greensock.js and velocity.js. - * - * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define - * our animations inside of the same registered animation, however, the function input arguments are a bit different: - * - * ```html - *
    - * this box is moody - *
    - * - * - * - * ``` - * - * ```js - * myModule.animation('.colorful', [function() { - * return { - * addClass: function(element, className, doneFn) { - * // do some cool animation and call the doneFn - * }, - * removeClass: function(element, className, doneFn) { - * // do some cool animation and call the doneFn - * }, - * setClass: function(element, addedClass, removedClass, doneFn) { - * // do some cool animation and call the doneFn - * } - * } - * }]); - * ``` - * - * ## CSS + JS Animations Together - * - * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of AngularJS, - * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking - * charge of the animation**: - * - * ```html - *
    - * Slide in and out - *
    - * ``` - * - * ```js - * myModule.animation('.slide', [function() { - * return { - * enter: function(element, doneFn) { - * jQuery(element).slideIn(1000, doneFn); - * } - * } - * }]); - * ``` - * - * ```css - * .slide.ng-enter { - * transition:0.5s linear all; - * transform:translateY(-100px); - * } - * .slide.ng-enter.ng-enter-active { - * transform:translateY(0); - * } - * ``` - * - * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the - * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from - * our own JS-based animation code: - * - * ```js - * myModule.animation('.slide', ['$animateCss', function($animateCss) { - * return { - * enter: function(element) { -* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`. - * return $animateCss(element, { - * event: 'enter', - * structural: true - * }); - * } - * } - * }]); - * ``` - * - * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework. - * - * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or - * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that - * data into `$animateCss` directly: - * - * ```js - * myModule.animation('.slide', ['$animateCss', function($animateCss) { - * return { - * enter: function(element) { - * return $animateCss(element, { - * event: 'enter', - * structural: true, - * addClass: 'maroon-setting', - * from: { height:0 }, - * to: { height: 200 } - * }); - * } - * } - * }]); - * ``` - * - * Now we can fill in the rest via our transition CSS code: - * - * ```css - * /* the transition tells ngAnimate to make the animation happen */ - * .slide.ng-enter { transition:0.5s linear all; } - * - * /* this extra CSS class will be absorbed into the transition - * since the $animateCss code is adding the class */ - * .maroon-setting { background:red; } - * ``` - * - * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over. - * - * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}. - * - * ## Animation Anchoring (via `ng-animate-ref`) - * - * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between - * structural areas of an application (like views) by pairing up elements using an attribute - * called `ng-animate-ref`. - * - * Let's say for example we have two views that are managed by `ng-view` and we want to show - * that there is a relationship between two components situated in within these views. By using the - * `ng-animate-ref` attribute we can identify that the two components are paired together and we - * can then attach an animation, which is triggered when the view changes. - * - * Say for example we have the following template code: - * - * ```html - * - *
    - *
    - * - * - *
    - * - * - * - * - * - * ``` - * - * Now, when the view changes (once the link is clicked), ngAnimate will examine the - * HTML contents to see if there is a match reference between any components in the view - * that is leaving and the view that is entering. It will scan both the view which is being - * removed (leave) and inserted (enter) to see if there are any paired DOM elements that - * contain a matching ref value. - * - * The two images match since they share the same ref value. ngAnimate will now create a - * transport element (which is a clone of the first image element) and it will then attempt - * to animate to the position of the second image element in the next view. For the animation to - * work a special CSS class called `ng-anchor` will be added to the transported element. - * - * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then - * ngAnimate will handle the entire transition for us as well as the addition and removal of - * any changes of CSS classes between the elements: - * - * ```css - * .banner.ng-anchor { - * /* this animation will last for 1 second since there are - * two phases to the animation (an `in` and an `out` phase) */ - * transition:0.5s linear all; - * } - * ``` - * - * We also **must** include animations for the views that are being entered and removed - * (otherwise anchoring wouldn't be possible since the new view would be inserted right away). - * - * ```css - * .view-animation.ng-enter, .view-animation.ng-leave { - * transition:0.5s linear all; - * position:fixed; - * left:0; - * top:0; - * width:100%; - * } - * .view-animation.ng-enter { - * transform:translateX(100%); - * } - * .view-animation.ng-leave, - * .view-animation.ng-enter.ng-enter-active { - * transform:translateX(0%); - * } - * .view-animation.ng-leave.ng-leave-active { - * transform:translateX(-100%); - * } - * ``` - * - * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur: - * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away - * from its origin. Once that animation is over then the `in` stage occurs which animates the - * element to its destination. The reason why there are two animations is to give enough time - * for the enter animation on the new element to be ready. - * - * The example above sets up a transition for both the in and out phases, but we can also target the out or - * in phases directly via `ng-anchor-out` and `ng-anchor-in`. - * - * ```css - * .banner.ng-anchor-out { - * transition: 0.5s linear all; - * - * /* the scale will be applied during the out animation, - * but will be animated away when the in animation runs */ - * transform: scale(1.2); - * } - * - * .banner.ng-anchor-in { - * transition: 1s linear all; - * } - * ``` - * - * - * - * - * ### Anchoring Demo - * - - - Home -
    -
    -
    -
    -
    - - angular.module('anchoringExample', ['ngAnimate', 'ngRoute']) - .config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/', { - templateUrl: 'home.html', - controller: 'HomeController as home' - }); - $routeProvider.when('/profile/:id', { - templateUrl: 'profile.html', - controller: 'ProfileController as profile' - }); - }]) - .run(['$rootScope', function($rootScope) { - $rootScope.records = [ - { id: 1, title: 'Miss Beulah Roob' }, - { id: 2, title: 'Trent Morissette' }, - { id: 3, title: 'Miss Ava Pouros' }, - { id: 4, title: 'Rod Pouros' }, - { id: 5, title: 'Abdul Rice' }, - { id: 6, title: 'Laurie Rutherford Sr.' }, - { id: 7, title: 'Nakia McLaughlin' }, - { id: 8, title: 'Jordon Blanda DVM' }, - { id: 9, title: 'Rhoda Hand' }, - { id: 10, title: 'Alexandrea Sauer' } - ]; - }]) - .controller('HomeController', [function() { - //empty - }]) - .controller('ProfileController', ['$rootScope', '$routeParams', - function ProfileController($rootScope, $routeParams) { - var index = parseInt($routeParams.id, 10); - var record = $rootScope.records[index - 1]; - - this.title = record.title; - this.id = record.id; - }]); - - -

    Welcome to the home page

    -

    Please click on an element

    - - {{ record.title }} - -
    - -
    - {{ profile.title }} -
    -
    - - .record { - display:block; - font-size:20px; - } - .profile { - background:black; - color:white; - font-size:100px; - } - .view-container { - position:relative; - } - .view-container > .view.ng-animate { - position:absolute; - top:0; - left:0; - width:100%; - min-height:500px; - } - .view.ng-enter, .view.ng-leave, - .record.ng-anchor { - transition:0.5s linear all; - } - .view.ng-enter { - transform:translateX(100%); - } - .view.ng-enter.ng-enter-active, .view.ng-leave { - transform:translateX(0%); - } - .view.ng-leave.ng-leave-active { - transform:translateX(-100%); - } - .record.ng-anchor-out { - background:red; - } - -
    - * - * ### How is the element transported? - * - * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting - * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element - * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The - * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match - * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied - * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class - * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element - * will become visible since the shim class will be removed. - * - * ### How is the morphing handled? - * - * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out - * what CSS classes differ between the starting element and the destination element. These different CSS classes - * will be added/removed on the anchor element and a transition will be applied (the transition that is provided - * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will - * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that - * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since - * the cloned element is placed inside of root element which is likely close to the body element). - * - * Note that if the root element is on the `` element then the cloned node will be placed inside of body. - * - * - * ## Using $animate in your directive code - * - * So far we've explored how to feed in animations into an AngularJS application, but how do we trigger animations within our own directives in our application? - * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's - * imagine we have a greeting box that shows and hides itself when the data changes - * - * ```html - * Hi there - * ``` - * - * ```js - * ngModule.directive('greetingBox', ['$animate', function($animate) { - * return function(scope, element, attrs) { - * attrs.$observe('active', function(value) { - * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on'); - * }); - * }); - * }]); - * ``` - * - * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element - * in our HTML code then we can trigger a CSS or JS animation to happen. - * - * ```css - * /* normally we would create a CSS class to reference on the element */ - * greeting-box.on { transition:0.5s linear all; background:green; color:white; } - * ``` - * - * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's - * possible be sure to visit the {@link ng.$animate $animate service API page}. - * - * - * ## Callbacks and Promises - * - * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger - * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has - * ended by chaining onto the returned promise that animation method returns. - * - * ```js - * // somewhere within the depths of the directive - * $animate.enter(element, parent).then(function() { - * //the animation has completed - * }); - * ``` - * - * (Note that earlier versions of AngularJS prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case - * anymore.) - * - * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering - * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view - * routing controller to hook into that: - * - * ```js - * ngModule.controller('HomePageController', ['$animate', function($animate) { - * $animate.on('enter', ngViewElement, function(element) { - * // the animation for this route has completed - * }]); - * }]) - * ``` - * - * (Note that you will need to trigger a digest within the callback to get AngularJS to notice any scope-related changes.) - */ - -var copy; -var extend; -var forEach; -var isArray; -var isDefined; -var isElement; -var isFunction; -var isObject; -var isString; -var isUndefined; -var jqLite; -var noop; - -/** - * @ngdoc service - * @name $animate - * @kind object - * - * @description - * The ngAnimate `$animate` service documentation is the same for the core `$animate` service. - * - * Click here {@link ng.$animate to learn more about animations with `$animate`}. - */ -angular.module('ngAnimate', [], function initAngularHelpers() { - // Access helpers from AngularJS core. - // Do it inside a `config` block to ensure `window.angular` is available. - noop = angular.noop; - copy = angular.copy; - extend = angular.extend; - jqLite = angular.element; - forEach = angular.forEach; - isArray = angular.isArray; - isString = angular.isString; - isObject = angular.isObject; - isUndefined = angular.isUndefined; - isDefined = angular.isDefined; - isFunction = angular.isFunction; - isElement = angular.isElement; -}) - .info({ angularVersion: '1.8.2' }) - .directive('ngAnimateSwap', ngAnimateSwapDirective) - - .directive('ngAnimateChildren', $$AnimateChildrenDirective) - .factory('$$rAFScheduler', $$rAFSchedulerFactory) - - .provider('$$animateQueue', $$AnimateQueueProvider) - .provider('$$animateCache', $$AnimateCacheProvider) - .provider('$$animation', $$AnimationProvider) - - .provider('$animateCss', $AnimateCssProvider) - .provider('$$animateCssDriver', $$AnimateCssDriverProvider) - - .provider('$$animateJs', $$AnimateJsProvider) - .provider('$$animateJsDriver', $$AnimateJsDriverProvider); - - -})(window, window.angular); - - -/***/ }), - -/***/ "./node_modules/angular-animate/index.js": -/*!***********************************************!*\ - !*** ./node_modules/angular-animate/index.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -__webpack_require__(/*! ./angular-animate */ "./node_modules/angular-animate/angular-animate.js"); -module.exports = 'ngAnimate'; - - -/***/ }), - -/***/ "./node_modules/angular-aria/angular-aria.js": -/*!***************************************************!*\ - !*** ./node_modules/angular-aria/angular-aria.js ***! - \***************************************************/ -/***/ (() => { - -/** - * @license AngularJS v1.8.2 - * (c) 2010-2020 Google LLC. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/** - * @ngdoc module - * @name ngAria - * @description - * - * The `ngAria` module provides support for common - * [ARIA](http://www.w3.org/TR/wai-aria/) - * attributes that convey state or semantic information about the application for users - * of assistive technologies, such as screen readers. - * - * ## Usage - * - * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following - * directives are supported: - * `ngModel`, `ngChecked`, `ngReadonly`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`, - * `ngClick`, `ngDblClick`, and `ngMessages`. - * - * Below is a more detailed breakdown of the attributes handled by ngAria: - * - * | Directive | Supported Attributes | - * |---------------------------------------------|-----------------------------------------------------------------------------------------------------| - * | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles | - * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled | - * | {@link ng.directive:ngRequired ngRequired} | aria-required | - * | {@link ng.directive:ngChecked ngChecked} | aria-checked | - * | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly | - * | {@link ng.directive:ngValue ngValue} | aria-checked | - * | {@link ng.directive:ngShow ngShow} | aria-hidden | - * | {@link ng.directive:ngHide ngHide} | aria-hidden | - * | {@link ng.directive:ngDblclick ngDblclick} | tabindex | - * | {@link module:ngMessages ngMessages} | aria-live | - * | {@link ng.directive:ngClick ngClick} | tabindex, keydown event, button role | - * - * Find out more information about each directive by reading the - * {@link guide/accessibility ngAria Developer Guide}. - * - * ## Example - * Using ngDisabled with ngAria: - * ```html - * - * ``` - * Becomes: - * ```html - * - * ``` - * - * ## Disabling Specific Attributes - * It is possible to disable individual attributes added by ngAria with the - * {@link ngAria.$ariaProvider#config config} method. For more details, see the - * {@link guide/accessibility Developer Guide}. - * - * ## Disabling `ngAria` on Specific Elements - * It is possible to make `ngAria` ignore a specific element, by adding the `ng-aria-disable` - * attribute on it. Note that only the element itself (and not its child elements) will be ignored. - */ -var ARIA_DISABLE_ATTR = 'ngAriaDisable'; - -var ngAriaModule = angular.module('ngAria', ['ng']). - info({ angularVersion: '1.8.2' }). - provider('$aria', $AriaProvider); - -/** -* Internal Utilities -*/ -var nativeAriaNodeNames = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY']; - -var isNodeOneOf = function(elem, nodeTypeArray) { - if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) { - return true; - } -}; -/** - * @ngdoc provider - * @name $ariaProvider - * @this - * - * @description - * - * Used for configuring the ARIA attributes injected and managed by ngAria. - * - * ```js - * angular.module('myApp', ['ngAria'], function config($ariaProvider) { - * $ariaProvider.config({ - * ariaValue: true, - * tabindex: false - * }); - * }); - *``` - * - * ## Dependencies - * Requires the {@link ngAria} module to be installed. - * - */ -function $AriaProvider() { - var config = { - ariaHidden: true, - ariaChecked: true, - ariaReadonly: true, - ariaDisabled: true, - ariaRequired: true, - ariaInvalid: true, - ariaValue: true, - tabindex: true, - bindKeydown: true, - bindRoleForClick: true - }; - - /** - * @ngdoc method - * @name $ariaProvider#config - * - * @param {object} config object to enable/disable specific ARIA attributes - * - * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags - * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags - * - **ariaReadonly** – `{boolean}` – Enables/disables aria-readonly tags - * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags - * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags - * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags - * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and - * aria-valuenow tags - * - **tabindex** – `{boolean}` – Enables/disables tabindex tags - * - **bindKeydown** – `{boolean}` – Enables/disables keyboard event binding on non-interactive - * elements (such as `div` or `li`) using ng-click, making them more accessible to users of - * assistive technologies - * - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements (such as - * `div` or `li`) using ng-click, making them more accessible to users of assistive - * technologies - * - * @description - * Enables/disables various ARIA attributes - */ - this.config = function(newConfig) { - config = angular.extend(config, newConfig); - }; - - function watchExpr(attrName, ariaAttr, nativeAriaNodeNames, negate) { - return function(scope, elem, attr) { - if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return; - - var ariaCamelName = attr.$normalize(ariaAttr); - if (config[ariaCamelName] && !isNodeOneOf(elem, nativeAriaNodeNames) && !attr[ariaCamelName]) { - scope.$watch(attr[attrName], function(boolVal) { - // ensure boolean value - boolVal = negate ? !boolVal : !!boolVal; - elem.attr(ariaAttr, boolVal); - }); - } - }; - } - /** - * @ngdoc service - * @name $aria - * - * @description - * - * The $aria service contains helper methods for applying common - * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives. - * - * ngAria injects common accessibility attributes that tell assistive technologies when HTML - * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria, - * let's review a code snippet from ngAria itself: - * - *```js - * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) { - * return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nativeAriaNodeNames, false); - * }]) - *``` - * Shown above, the ngAria module creates a directive with the same signature as the - * traditional `ng-disabled` directive. But this ngAria version is dedicated to - * solely managing accessibility attributes on custom elements. The internal `$aria` service is - * used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the - * developer, `aria-disabled` is injected as an attribute with its value synchronized to the - * value in `ngDisabled`. - * - * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do - * anything to enable this feature. The `aria-disabled` attribute is automatically managed - * simply as a silent side-effect of using `ng-disabled` with the ngAria module. - * - * The full list of directives that interface with ngAria: - * * **ngModel** - * * **ngChecked** - * * **ngReadonly** - * * **ngRequired** - * * **ngDisabled** - * * **ngValue** - * * **ngShow** - * * **ngHide** - * * **ngClick** - * * **ngDblclick** - * * **ngMessages** - * - * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each - * directive. - * - * - * ## Dependencies - * Requires the {@link ngAria} module to be installed. - */ - this.$get = function() { - return { - config: function(key) { - return config[key]; - }, - $$watchExpr: watchExpr - }; - }; -} - - -ngAriaModule.directive('ngShow', ['$aria', function($aria) { - return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true); -}]) -.directive('ngHide', ['$aria', function($aria) { - return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false); -}]) -.directive('ngValue', ['$aria', function($aria) { - return $aria.$$watchExpr('ngValue', 'aria-checked', nativeAriaNodeNames, false); -}]) -.directive('ngChecked', ['$aria', function($aria) { - return $aria.$$watchExpr('ngChecked', 'aria-checked', nativeAriaNodeNames, false); -}]) -.directive('ngReadonly', ['$aria', function($aria) { - return $aria.$$watchExpr('ngReadonly', 'aria-readonly', nativeAriaNodeNames, false); -}]) -.directive('ngRequired', ['$aria', function($aria) { - return $aria.$$watchExpr('ngRequired', 'aria-required', nativeAriaNodeNames, false); -}]) -.directive('ngModel', ['$aria', function($aria) { - - function shouldAttachAttr(attr, normalizedAttr, elem, allowNonAriaNodes) { - return $aria.config(normalizedAttr) && - !elem.attr(attr) && - (allowNonAriaNodes || !isNodeOneOf(elem, nativeAriaNodeNames)) && - (elem.attr('type') !== 'hidden' || elem[0].nodeName !== 'INPUT'); - } - - function shouldAttachRole(role, elem) { - // if element does not have role attribute - // AND element type is equal to role (if custom element has a type equaling shape) <-- remove? - // AND element is not in nativeAriaNodeNames - return !elem.attr('role') && (elem.attr('type') === role) && !isNodeOneOf(elem, nativeAriaNodeNames); - } - - function getShape(attr, elem) { - var type = attr.type, - role = attr.role; - - return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' : - ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' : - (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' : ''; - } - - return { - restrict: 'A', - require: 'ngModel', - priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value - compile: function(elem, attr) { - if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return; - - var shape = getShape(attr, elem); - - return { - post: function(scope, elem, attr, ngModel) { - var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false); - - function ngAriaWatchModelValue() { - return ngModel.$modelValue; - } - - function getRadioReaction(newVal) { - // Strict comparison would cause a BC - // eslint-disable-next-line eqeqeq - var boolVal = (attr.value == ngModel.$viewValue); - elem.attr('aria-checked', boolVal); - } - - function getCheckboxReaction() { - elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue)); - } - - switch (shape) { - case 'radio': - case 'checkbox': - if (shouldAttachRole(shape, elem)) { - elem.attr('role', shape); - } - if (shouldAttachAttr('aria-checked', 'ariaChecked', elem, false)) { - scope.$watch(ngAriaWatchModelValue, shape === 'radio' ? - getRadioReaction : getCheckboxReaction); - } - if (needsTabIndex) { - elem.attr('tabindex', 0); - } - break; - case 'range': - if (shouldAttachRole(shape, elem)) { - elem.attr('role', 'slider'); - } - if ($aria.config('ariaValue')) { - var needsAriaValuemin = !elem.attr('aria-valuemin') && - (attr.hasOwnProperty('min') || attr.hasOwnProperty('ngMin')); - var needsAriaValuemax = !elem.attr('aria-valuemax') && - (attr.hasOwnProperty('max') || attr.hasOwnProperty('ngMax')); - var needsAriaValuenow = !elem.attr('aria-valuenow'); - - if (needsAriaValuemin) { - attr.$observe('min', function ngAriaValueMinReaction(newVal) { - elem.attr('aria-valuemin', newVal); - }); - } - if (needsAriaValuemax) { - attr.$observe('max', function ngAriaValueMinReaction(newVal) { - elem.attr('aria-valuemax', newVal); - }); - } - if (needsAriaValuenow) { - scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) { - elem.attr('aria-valuenow', newVal); - }); - } - } - if (needsTabIndex) { - elem.attr('tabindex', 0); - } - break; - } - - if (!attr.hasOwnProperty('ngRequired') && ngModel.$validators.required - && shouldAttachAttr('aria-required', 'ariaRequired', elem, false)) { - // ngModel.$error.required is undefined on custom controls - attr.$observe('required', function() { - elem.attr('aria-required', !!attr['required']); - }); - } - - if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem, true)) { - scope.$watch(function ngAriaInvalidWatch() { - return ngModel.$invalid; - }, function ngAriaInvalidReaction(newVal) { - elem.attr('aria-invalid', !!newVal); - }); - } - } - }; - } - }; -}]) -.directive('ngDisabled', ['$aria', function($aria) { - return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nativeAriaNodeNames, false); -}]) -.directive('ngMessages', function() { - return { - restrict: 'A', - require: '?ngMessages', - link: function(scope, elem, attr, ngMessages) { - if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return; - - if (!elem.attr('aria-live')) { - elem.attr('aria-live', 'assertive'); - } - } - }; -}) -.directive('ngClick',['$aria', '$parse', function($aria, $parse) { - return { - restrict: 'A', - compile: function(elem, attr) { - if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return; - - var fn = $parse(attr.ngClick); - return function(scope, elem, attr) { - - if (!isNodeOneOf(elem, nativeAriaNodeNames)) { - - if ($aria.config('bindRoleForClick') && !elem.attr('role')) { - elem.attr('role', 'button'); - } - - if ($aria.config('tabindex') && !elem.attr('tabindex')) { - elem.attr('tabindex', 0); - } - - if ($aria.config('bindKeydown') && !attr.ngKeydown && !attr.ngKeypress && !attr.ngKeyup) { - elem.on('keydown', function(event) { - var keyCode = event.which || event.keyCode; - - if (keyCode === 13 || keyCode === 32) { - // If the event is triggered on a non-interactive element ... - if (nativeAriaNodeNames.indexOf(event.target.nodeName) === -1 && !event.target.isContentEditable) { - // ... prevent the default browser behavior (e.g. scrolling when pressing spacebar) - // See https://github.com/angular/angular.js/issues/16664 - event.preventDefault(); - } - scope.$apply(callback); - } - - function callback() { - fn(scope, { $event: event }); - } - }); - } - } - }; - } - }; -}]) -.directive('ngDblclick', ['$aria', function($aria) { - return function(scope, elem, attr) { - if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return; - - if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nativeAriaNodeNames)) { - elem.attr('tabindex', 0); - } - }; -}]); - - -})(window, window.angular); - - -/***/ }), - -/***/ "./node_modules/angular-aria/index.js": -/*!********************************************!*\ - !*** ./node_modules/angular-aria/index.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -__webpack_require__(/*! ./angular-aria */ "./node_modules/angular-aria/angular-aria.js"); -module.exports = 'ngAria'; - - -/***/ }), - -/***/ "./node_modules/angular-local-storage/dist/angular-local-storage.js": -/*!**************************************************************************!*\ - !*** ./node_modules/angular-local-storage/dist/angular-local-storage.js ***! - \**************************************************************************/ -/***/ (() => { - -/** - * An Angular module that gives you access to the browsers local storage - * @version v0.7.1 - 2017-06-21 - * @link https://github.com/grevory/angular-local-storage - * @author grevory - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -(function (window, angular) { -var isDefined = angular.isDefined, - isUndefined = angular.isUndefined, - isNumber = angular.isNumber, - isObject = angular.isObject, - isArray = angular.isArray, - isString = angular.isString, - extend = angular.extend, - toJson = angular.toJson; - -angular - .module('LocalStorageModule', []) - .provider('localStorageService', function() { - // You should set a prefix to avoid overwriting any local storage variables from the rest of your app - // e.g. localStorageServiceProvider.setPrefix('yourAppName'); - // With provider you can use config as this: - // myApp.config(function (localStorageServiceProvider) { - // localStorageServiceProvider.prefix = 'yourAppName'; - // }); - this.prefix = 'ls'; - - // You could change web storage type localstorage or sessionStorage - this.storageType = 'localStorage'; - - // Cookie options (usually in case of fallback) - // expiry = Number of days before cookies expire // 0 = Does not expire - // path = The web path the cookie represents - // secure = Wether the cookies should be secure (i.e only sent on HTTPS requests) - this.cookie = { - expiry: 30, - path: '/', - secure: false - }; - - // Decides wether we should default to cookies if localstorage is not supported. - this.defaultToCookie = true; - - // Send signals for each of the following actions? - this.notify = { - setItem: true, - removeItem: false - }; - - // Setter for the prefix - this.setPrefix = function(prefix) { - this.prefix = prefix; - return this; - }; - - // Setter for the storageType - this.setStorageType = function(storageType) { - this.storageType = storageType; - return this; - }; - // Setter for defaultToCookie value, default is true. - this.setDefaultToCookie = function (shouldDefault) { - this.defaultToCookie = !!shouldDefault; // Double-not to make sure it's a bool value. - return this; - }; - // Setter for cookie config - this.setStorageCookie = function(exp, path, secure) { - this.cookie.expiry = exp; - this.cookie.path = path; - this.cookie.secure = secure; - return this; - }; - - // Setter for cookie domain - this.setStorageCookieDomain = function(domain) { - this.cookie.domain = domain; - return this; - }; - - // Setter for notification config - // itemSet & itemRemove should be booleans - this.setNotify = function(itemSet, itemRemove) { - this.notify = { - setItem: itemSet, - removeItem: itemRemove - }; - return this; - }; - - this.$get = ['$rootScope', '$window', '$document', '$parse','$timeout', function($rootScope, $window, $document, $parse, $timeout) { - var self = this; - var prefix = self.prefix; - var cookie = self.cookie; - var notify = self.notify; - var storageType = self.storageType; - var webStorage; - - // When Angular's $document is not available - if (!$document) { - $document = document; - } else if ($document[0]) { - $document = $document[0]; - } - - // If there is a prefix set in the config lets use that with an appended period for readability - if (prefix.substr(-1) !== '.') { - prefix = !!prefix ? prefix + '.' : ''; - } - var deriveQualifiedKey = function(key) { - return prefix + key; - }; - - // Removes prefix from the key. - var underiveQualifiedKey = function (key) { - return key.replace(new RegExp('^' + prefix, 'g'), ''); - }; - - // Check if the key is within our prefix namespace. - var isKeyPrefixOurs = function (key) { - return key.indexOf(prefix) === 0; - }; - - // Checks the browser to see if local storage is supported - var checkSupport = function () { - try { - var supported = (storageType in $window && $window[storageType] !== null); - - // When Safari (OS X or iOS) is in private browsing mode, it appears as though localStorage - // is available, but trying to call .setItem throws an exception. - // - // "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage - // that exceeded the quota." - var key = deriveQualifiedKey('__' + Math.round(Math.random() * 1e7)); - if (supported) { - webStorage = $window[storageType]; - webStorage.setItem(key, ''); - webStorage.removeItem(key); - } - - return supported; - } catch (e) { - // Only change storageType to cookies if defaulting is enabled. - if (self.defaultToCookie) - storageType = 'cookie'; - $rootScope.$broadcast('LocalStorageModule.notification.error', e.message); - return false; - } - }; - var browserSupportsLocalStorage = checkSupport(); - - // Directly adds a value to local storage - // If local storage is not available in the browser use cookies - // Example use: localStorageService.add('library','angular'); - var addToLocalStorage = function (key, value, type) { - var previousType = getStorageType(); - - try { - setStorageType(type); - - // Let's convert undefined values to null to get the value consistent - if (isUndefined(value)) { - value = null; - } else { - value = toJson(value); - } - - // If this browser does not support local storage use cookies - if (!browserSupportsLocalStorage && self.defaultToCookie || self.storageType === 'cookie') { - if (!browserSupportsLocalStorage) { - $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED'); - } - - if (notify.setItem) { - $rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: 'cookie'}); - } - return addToCookies(key, value); - } - - try { - if (webStorage) { - webStorage.setItem(deriveQualifiedKey(key), value); - } - if (notify.setItem) { - $rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: self.storageType}); - } - } catch (e) { - $rootScope.$broadcast('LocalStorageModule.notification.error', e.message); - return addToCookies(key, value); - } - return true; - } finally { - setStorageType(previousType); - } - }; - - // Directly get a value from local storage - // Example use: localStorageService.get('library'); // returns 'angular' - var getFromLocalStorage = function (key, type) { - var previousType = getStorageType(); - - try { - setStorageType(type); - - if (!browserSupportsLocalStorage && self.defaultToCookie || self.storageType === 'cookie') { - if (!browserSupportsLocalStorage) { - $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED'); - } - - return getFromCookies(key); - } - - var item = webStorage ? webStorage.getItem(deriveQualifiedKey(key)) : null; - // angular.toJson will convert null to 'null', so a proper conversion is needed - // FIXME not a perfect solution, since a valid 'null' string can't be stored - if (!item || item === 'null') { - return null; - } - - try { - return JSON.parse(item); - } catch (e) { - return item; - } - } finally { - setStorageType(previousType); - } - }; - - // Remove an item from local storage - // Example use: localStorageService.remove('library'); // removes the key/value pair of library='angular' - // - // This is var-arg removal, check the last argument to see if it is a storageType - // and set type accordingly before removing. - // - var removeFromLocalStorage = function () { - var previousType = getStorageType(); - - try { - // can't pop on arguments, so we do this - var consumed = 0; - if (arguments.length >= 1 && - (arguments[arguments.length - 1] === 'localStorage' || - arguments[arguments.length - 1] === 'sessionStorage')) { - consumed = 1; - setStorageType(arguments[arguments.length - 1]); - } - - var i, key; - for (i = 0; i < arguments.length - consumed; i++) { - key = arguments[i]; - if (!browserSupportsLocalStorage && self.defaultToCookie || self.storageType === 'cookie') { - if (!browserSupportsLocalStorage) { - $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED'); - } - - if (notify.removeItem) { - $rootScope.$broadcast('LocalStorageModule.notification.removeitem', {key: key, storageType: 'cookie'}); - } - removeFromCookies(key); - } - else { - try { - webStorage.removeItem(deriveQualifiedKey(key)); - if (notify.removeItem) { - $rootScope.$broadcast('LocalStorageModule.notification.removeitem', { - key: key, - storageType: self.storageType - }); - } - } catch (e) { - $rootScope.$broadcast('LocalStorageModule.notification.error', e.message); - removeFromCookies(key); - } - } - } - } finally { - setStorageType(previousType); - } - }; - - // Return array of keys for local storage - // Example use: var keys = localStorageService.keys() - var getKeysForLocalStorage = function (type) { - var previousType = getStorageType(); - - try { - setStorageType(type); - - if (!browserSupportsLocalStorage) { - $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED'); - return []; - } - - var prefixLength = prefix.length; - var keys = []; - for (var key in webStorage) { - // Only return keys that are for this app - if (key.substr(0, prefixLength) === prefix) { - try { - keys.push(key.substr(prefixLength)); - } catch (e) { - $rootScope.$broadcast('LocalStorageModule.notification.error', e.Description); - return []; - } - } - } - - return keys; - } finally { - setStorageType(previousType); - } - }; - - // Remove all data for this app from local storage - // Also optionally takes a regular expression string and removes the matching key-value pairs - // Example use: localStorageService.clearAll(); - // Should be used mostly for development purposes - var clearAllFromLocalStorage = function (regularExpression, type) { - var previousType = getStorageType(); - - try { - setStorageType(type); - - // Setting both regular expressions independently - // Empty strings result in catchall RegExp - var prefixRegex = !!prefix ? new RegExp('^' + prefix) : new RegExp(); - var testRegex = !!regularExpression ? new RegExp(regularExpression) : new RegExp(); - - if (!browserSupportsLocalStorage && self.defaultToCookie || self.storageType === 'cookie') { - if (!browserSupportsLocalStorage) { - $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED'); - } - return clearAllFromCookies(); - } - if (!browserSupportsLocalStorage && !self.defaultToCookie) - return false; - var prefixLength = prefix.length; - - for (var key in webStorage) { - // Only remove items that are for this app and match the regular expression - if (prefixRegex.test(key) && testRegex.test(key.substr(prefixLength))) { - try { - removeFromLocalStorage(key.substr(prefixLength)); - } catch (e) { - $rootScope.$broadcast('LocalStorageModule.notification.error', e.message); - return clearAllFromCookies(); - } - } - } - - return true; - } finally { - setStorageType(previousType); - } - }; - - // Checks the browser to see if cookies are supported - var browserSupportsCookies = (function() { - try { - return $window.navigator.cookieEnabled || - ("cookie" in $document && ($document.cookie.length > 0 || - ($document.cookie = "test").indexOf.call($document.cookie, "test") > -1)); - } catch (e) { - $rootScope.$broadcast('LocalStorageModule.notification.error', e.message); - return false; - } - }()); - - // Directly adds a value to cookies - // Typically used as a fallback if local storage is not available in the browser - // Example use: localStorageService.cookie.add('library','angular'); - var addToCookies = function (key, value, daysToExpiry, secure) { - - if (isUndefined(value)) { - return false; - } else if(isArray(value) || isObject(value)) { - value = toJson(value); - } - - if (!browserSupportsCookies) { - $rootScope.$broadcast('LocalStorageModule.notification.error', 'COOKIES_NOT_SUPPORTED'); - return false; - } - - try { - var expiry = '', - expiryDate = new Date(), - cookieDomain = ''; - - if (value === null) { - // Mark that the cookie has expired one day ago - expiryDate.setTime(expiryDate.getTime() + (-1 * 24 * 60 * 60 * 1000)); - expiry = "; expires=" + expiryDate.toGMTString(); - value = ''; - } else if (isNumber(daysToExpiry) && daysToExpiry !== 0) { - expiryDate.setTime(expiryDate.getTime() + (daysToExpiry * 24 * 60 * 60 * 1000)); - expiry = "; expires=" + expiryDate.toGMTString(); - } else if (cookie.expiry !== 0) { - expiryDate.setTime(expiryDate.getTime() + (cookie.expiry * 24 * 60 * 60 * 1000)); - expiry = "; expires=" + expiryDate.toGMTString(); - } - if (!!key) { - var cookiePath = "; path=" + cookie.path; - if (cookie.domain) { - cookieDomain = "; domain=" + cookie.domain; - } - /* Providing the secure parameter always takes precedence over config - * (allows developer to mix and match secure + non-secure) */ - if (typeof secure === 'boolean') { - if (secure === true) { - /* We've explicitly specified secure, - * add the secure attribute to the cookie (after domain) */ - cookieDomain += "; secure"; - } - // else - secure has been supplied but isn't true - so don't set secure flag, regardless of what config says - } - else if (cookie.secure === true) { - // secure parameter wasn't specified, get default from config - cookieDomain += "; secure"; - } - $document.cookie = deriveQualifiedKey(key) + "=" + encodeURIComponent(value) + expiry + cookiePath + cookieDomain; - } - } catch (e) { - $rootScope.$broadcast('LocalStorageModule.notification.error', e.message); - return false; - } - return true; - }; - - // Directly get a value from a cookie - // Example use: localStorageService.cookie.get('library'); // returns 'angular' - var getFromCookies = function (key) { - if (!browserSupportsCookies) { - $rootScope.$broadcast('LocalStorageModule.notification.error', 'COOKIES_NOT_SUPPORTED'); - return false; - } - - var cookies = $document.cookie && $document.cookie.split(';') || []; - for(var i=0; i < cookies.length; i++) { - var thisCookie = cookies[i]; - while (thisCookie.charAt(0) === ' ') { - thisCookie = thisCookie.substring(1,thisCookie.length); - } - if (thisCookie.indexOf(deriveQualifiedKey(key) + '=') === 0) { - var storedValues = decodeURIComponent(thisCookie.substring(prefix.length + key.length + 1, thisCookie.length)); - try { - var parsedValue = JSON.parse(storedValues); - return typeof(parsedValue) === 'number' ? storedValues : parsedValue; - } catch(e) { - return storedValues; - } - } - } - return null; - }; - - var removeFromCookies = function (key) { - addToCookies(key,null); - }; - - var clearAllFromCookies = function () { - var thisCookie = null; - var prefixLength = prefix.length; - var cookies = $document.cookie.split(';'); - for(var i = 0; i < cookies.length; i++) { - thisCookie = cookies[i]; - - while (thisCookie.charAt(0) === ' ') { - thisCookie = thisCookie.substring(1, thisCookie.length); - } - - var key = thisCookie.substring(prefixLength, thisCookie.indexOf('=')); - removeFromCookies(key); - } - }; - - var getStorageType = function() { - return storageType; - }; - - var setStorageType = function(type) { - if (type && storageType !== type) { - storageType = type; - browserSupportsLocalStorage = checkSupport(); - } - return browserSupportsLocalStorage; - }; - - // Add a listener on scope variable to save its changes to local storage - // Return a function which when called cancels binding - var bindToScope = function(scope, key, def, lsKey, type) { - lsKey = lsKey || key; - var value = getFromLocalStorage(lsKey, type); - - if (value === null && isDefined(def)) { - value = def; - } else if (isObject(value) && isObject(def)) { - value = extend(value, def); - } - - $parse(key).assign(scope, value); - - return scope.$watch(key, function(newVal) { - addToLocalStorage(lsKey, newVal, type); - }, isObject(scope[key])); - }; - - // Add listener to local storage, for update callbacks. - if (browserSupportsLocalStorage) { - if ($window.addEventListener) { - $window.addEventListener("storage", handleStorageChangeCallback, false); - $rootScope.$on('$destroy', function() { - $window.removeEventListener("storage", handleStorageChangeCallback); - }); - } else if($window.attachEvent){ - // attachEvent and detachEvent are proprietary to IE v6-10 - $window.attachEvent("onstorage", handleStorageChangeCallback); - $rootScope.$on('$destroy', function() { - $window.detachEvent("onstorage", handleStorageChangeCallback); - }); - } - } - - // Callback handler for storage changed. - function handleStorageChangeCallback(e) { - if (!e) { e = $window.event; } - if (notify.setItem) { - if (isString(e.key) && isKeyPrefixOurs(e.key)) { - var key = underiveQualifiedKey(e.key); - // Use timeout, to avoid using $rootScope.$apply. - $timeout(function () { - $rootScope.$broadcast('LocalStorageModule.notification.changed', { key: key, newvalue: e.newValue, storageType: self.storageType }); - }); - } - } - } - - // Return localStorageService.length - // ignore keys that not owned - var lengthOfLocalStorage = function(type) { - var previousType = getStorageType(); - - try { - setStorageType(type); - - var count = 0; - var storage = $window[storageType]; - for(var i = 0; i < storage.length; i++) { - if(storage.key(i).indexOf(prefix) === 0 ) { - count++; - } - } - - return count; - } finally { - setStorageType(previousType); - } - }; - - var changePrefix = function(localStoragePrefix) { - prefix = localStoragePrefix; - }; - - return { - isSupported: browserSupportsLocalStorage, - getStorageType: getStorageType, - setStorageType: setStorageType, - setPrefix: changePrefix, - set: addToLocalStorage, - add: addToLocalStorage, //DEPRECATED - get: getFromLocalStorage, - keys: getKeysForLocalStorage, - remove: removeFromLocalStorage, - clearAll: clearAllFromLocalStorage, - bind: bindToScope, - deriveKey: deriveQualifiedKey, - underiveKey: underiveQualifiedKey, - length: lengthOfLocalStorage, - defaultToCookie: this.defaultToCookie, - cookie: { - isSupported: browserSupportsCookies, - set: addToCookies, - add: addToCookies, //DEPRECATED - get: getFromCookies, - remove: removeFromCookies, - clearAll: clearAllFromCookies - } - }; - }]; - }); -})(window, window.angular); - -/***/ }), - -/***/ "./node_modules/angular-local-storage/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/angular-local-storage/index.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -__webpack_require__(/*! ./dist/angular-local-storage.js */ "./node_modules/angular-local-storage/dist/angular-local-storage.js"); -module.exports = 'LocalStorageModule'; - - -/***/ }), - -/***/ "./node_modules/angular-material/angular-material.js": -/*!***********************************************************!*\ - !*** ./node_modules/angular-material/angular-material.js ***! - \***********************************************************/ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -/* provided dependency */ var __webpack_provided_window_dot_jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); -/*! - * AngularJS Material Design - * https://github.com/angular/material - * @license MIT - * v1.2.3 - */ -(function( window, angular, undefined ){ -"use strict"; - -(function(){ -"use strict"; - -angular.module('ngMaterial', ["ng","ngAnimate","ngAria","material.core","material.core.animate","material.core.gestures","material.core.interaction","material.core.layout","material.core.meta","material.core.theming.palette","material.core.theming","material.components.autocomplete","material.components.backdrop","material.components.bottomSheet","material.components.button","material.components.card","material.components.checkbox","material.components.chips","material.components.colors","material.components.content","material.components.datepicker","material.components.dialog","material.components.divider","material.components.fabActions","material.components.fabShared","material.components.fabSpeedDial","material.components.fabToolbar","material.components.gridList","material.components.icon","material.components.input","material.components.list","material.components.menu","material.components.menuBar","material.components.navBar","material.components.panel","material.components.progressCircular","material.components.progressLinear","material.components.radioButton","material.components.select","material.components.showHide","material.components.sidenav","material.components.slider","material.components.sticky","material.components.subheader","material.components.swipe","material.components.switch","material.components.tabs","material.components.toast","material.components.toolbar","material.components.tooltip","material.components.truncate","material.components.virtualRepeat","material.components.whiteframe"]); -})(); -(function(){ -"use strict"; - -/** - * Initialization function that validates environment - * requirements. - */ -DetectNgTouch.$inject = ["$log", "$injector"]; -MdCoreConfigure.$inject = ["$provide", "$mdThemingProvider"]; -rAFDecorator.$inject = ["$delegate"]; -qDecorator.$inject = ["$delegate"]; -angular - .module('material.core', [ - 'ngAnimate', - 'material.core.animate', - 'material.core.layout', - 'material.core.interaction', - 'material.core.gestures', - 'material.core.theming' - ]) - .config(MdCoreConfigure) - .run(DetectNgTouch); - - -/** - * Detect if the ng-Touch module is also being used. - * Warn if detected. - * @ngInject - */ -function DetectNgTouch($log, $injector) { - if ($injector.has('$swipe')) { - var msg = "" + - "You are using the ngTouch module. \n" + - "AngularJS Material already has mobile click, tap, and swipe support... \n" + - "ngTouch is not supported with AngularJS Material!"; - $log.warn(msg); - } -} - -/** - * @ngInject - */ -function MdCoreConfigure($provide, $mdThemingProvider) { - - $provide.decorator('$$rAF', ['$delegate', rAFDecorator]); - $provide.decorator('$q', ['$delegate', qDecorator]); - - $mdThemingProvider.theme('default') - .primaryPalette('indigo') - .accentPalette('pink') - .warnPalette('deep-orange') - .backgroundPalette('grey'); -} - -/** - * @ngInject - */ -function rAFDecorator($delegate) { - /** - * Use this to throttle events that come in often. - * The throttled function will always use the *last* invocation before the - * coming frame. - * - * For example, window resize events that fire many times a second: - * If we set to use an raf-throttled callback on window resize, then - * our callback will only be fired once per frame, with the last resize - * event that happened before that frame. - * - * @param {function} cb function to debounce - */ - $delegate.throttle = function(cb) { - var queuedArgs, alreadyQueued, queueCb, context; - return function debounced() { - queuedArgs = arguments; - context = this; - queueCb = cb; - if (!alreadyQueued) { - alreadyQueued = true; - $delegate(function() { - queueCb.apply(context, Array.prototype.slice.call(queuedArgs)); - alreadyQueued = false; - }); - } - }; - }; - return $delegate; -} - -/** - * @ngInject - */ -function qDecorator($delegate) { - /** - * Adds a shim for $q.resolve for AngularJS version that don't have it, - * so we don't have to think about it. - * - * via https://github.com/angular/angular.js/pull/11987 - */ - - // TODO(crisbeto): this won't be necessary once we drop AngularJS 1.3 - if (!$delegate.resolve) { - $delegate.resolve = $delegate.when; - } - return $delegate; -} - -})(); -(function(){ -"use strict"; - - -MdAutofocusDirective.$inject = ["$parse"];angular.module('material.core') - .directive('mdAutofocus', MdAutofocusDirective); - -/** - * @ngdoc directive - * @name mdAutofocus - * @module material.core.util - * - * @description - * - * `[md-autofocus]` provides an optional way to identify the focused element when a `$mdDialog`, - * `$mdBottomSheet`, `$mdMenu` or `$mdSidenav` opens or upon page load for input-like elements. - * - * When one of these opens, it will find the first nested element with the `[md-autofocus]` - * attribute directive and optional expression. An expression may be specified as the directive - * value to enable conditional activation of the autofocus. - * - * @usage - * - * ### Dialog - * - * - *
    - * - * - * - * - *
    - *
    - *
    - * - * ### Bottomsheet - * - * - * Comment Actions - * - * - * - * - * - * {{ item.name }} - * - * - * - * - * - * - * - * ### Autocomplete - * - * - * {{item.display}} - * - * - * - * ### Sidenav - * - *
    - * - * Left Nav! - * - * - * - * Center Content - * - * Open Left Menu - * - * - * - * - *
    - * - * - * - * - *
    - *
    - *
    - *
    - **/ -function MdAutofocusDirective($parse) { - return { - restrict: 'A', - link: { - pre: preLink - } - }; - - function preLink(scope, element, attr) { - var attrExp = attr.mdAutoFocus || attr.mdAutofocus || attr.mdSidenavFocus; - - // Initially update the expression by manually parsing the expression as per $watch source. - updateExpression($parse(attrExp)(scope)); - - // Only watch the expression if it is not empty. - if (attrExp) { - scope.$watch(attrExp, updateExpression); - } - - /** - * Updates the autofocus class which is used to determine whether the attribute - * expression evaluates to true or false. - * @param {string|boolean} value Attribute Value - */ - function updateExpression(value) { - - // Rather than passing undefined to the jqLite toggle class function we explicitly set the - // value to true. Otherwise the class will be just toggled instead of being forced. - if (angular.isUndefined(value)) { - value = true; - } - - element.toggleClass('md-autofocus', !!value); - } - } - -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.core.colorUtil - * @description - * Color Util - */ -angular - .module('material.core') - .factory('$mdColorUtil', ColorUtilFactory); - -function ColorUtilFactory() { - /** - * Converts hex value to RGBA string - * @param color {string} - * @returns {string} - */ - function hexToRgba (color) { - var hex = color[ 0 ] === '#' ? color.substr(1) : color, - dig = hex.length / 3, - red = hex.substr(0, dig), - green = hex.substr(dig, dig), - blue = hex.substr(dig * 2); - if (dig === 1) { - red += red; - green += green; - blue += blue; - } - return 'rgba(' + parseInt(red, 16) + ',' + parseInt(green, 16) + ',' + parseInt(blue, 16) + ',0.1)'; - } - - /** - * Converts rgba value to hex string - * @param {string} color - * @returns {string} - */ - function rgbaToHex(color) { - color = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i); - - var hex = (color && color.length === 4) ? "#" + - ("0" + parseInt(color[1],10).toString(16)).slice(-2) + - ("0" + parseInt(color[2],10).toString(16)).slice(-2) + - ("0" + parseInt(color[3],10).toString(16)).slice(-2) : ''; - - return hex.toUpperCase(); - } - - /** - * Converts an RGB color to RGBA - * @param {string} color - * @returns {string} - */ - function rgbToRgba (color) { - return color.replace(')', ', 0.1)').replace('(', 'a('); - } - - /** - * Converts an RGBA color to RGB - * @param {string} color - * @returns {string} - */ - function rgbaToRgb (color) { - return color - ? color.replace('rgba', 'rgb').replace(/,[^),]+\)/, ')') - : 'rgb(0,0,0)'; - } - - return { - rgbaToHex: rgbaToHex, - hexToRgba: hexToRgba, - rgbToRgba: rgbToRgba, - rgbaToRgb: rgbaToRgb - }; -} - -})(); -(function(){ -"use strict"; - -angular.module('material.core') -.factory('$mdConstant', MdConstantFactory); - -/** - * Factory function that creates the grab-bag $mdConstant service. - * @ngInject - */ -function MdConstantFactory() { - - var prefixTestEl = document.createElement('div'); - var vendorPrefix = getVendorPrefix(prefixTestEl); - var isWebkit = /webkit/i.test(vendorPrefix); - var SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g; - - /** - * @param {string} name CSS property name - * @return {string} the property name supported by the browser - */ - function vendorProperty(name) { - // Add a dash between the prefix and name, to be able to transform the string into camelcase. - var prefixedName = vendorPrefix + '-' + name; - var ucPrefix = camelCase(prefixedName); - var lcPrefix = ucPrefix.charAt(0).toLowerCase() + ucPrefix.substring(1); - - return hasStyleProperty(prefixTestEl, name) ? name : // The current browser supports the un-prefixed property - hasStyleProperty(prefixTestEl, ucPrefix) ? ucPrefix : // The current browser only supports the prefixed property. - hasStyleProperty(prefixTestEl, lcPrefix) ? lcPrefix : name; // Some browsers are only supporting the prefix in lowercase. - } - - function hasStyleProperty(testElement, property) { - return angular.isDefined(testElement.style[property]); - } - - /** - * @param {!string} input value to convert to camelCase - * @return {string} camelCased version of the input string - */ - function camelCase(input) { - return input.replace(SPECIAL_CHARS_REGEXP, function(matches, separator, letter, offset) { - return offset ? letter.toUpperCase() : letter; - }); - } - - function getVendorPrefix(testElement) { - var prop, match; - var vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/; - - for (prop in testElement.style) { - if (match = vendorRegex.exec(prop)) { - return match[0]; - } - } - } - - var self = { - isInputKey : function(e) { return (e.keyCode >= 31 && e.keyCode <= 90); }, - isNumPadKey : function(e) { return (3 === e.location && e.keyCode >= 97 && e.keyCode <= 105); }, - isMetaKey: function(e) { return (e.keyCode >= 91 && e.keyCode <= 93); }, - isFnLockKey: function(e) { return (e.keyCode >= 112 && e.keyCode <= 145); }, - isNavigationKey : function(e) { - var kc = self.KEY_CODE, NAVIGATION_KEYS = [kc.SPACE, kc.ENTER, kc.UP_ARROW, kc.DOWN_ARROW]; - return (NAVIGATION_KEYS.indexOf(e.keyCode) != -1); - }, - hasModifierKey: function(e) { - return e.ctrlKey || e.metaKey || e.altKey; - }, - - /** - * Maximum size, in pixels, that can be explicitly set to an element. The actual value varies - * between browsers, but IE11 has the very lowest size at a mere 1,533,917px. Ideally we could - * compute this value, but Firefox always reports an element to have a size of zero if it - * goes over the max, meaning that we'd have to binary search for the value. - */ - ELEMENT_MAX_PIXELS: 1533917, - - /** - * Priority for a directive that should run before the directives from ngAria. - */ - BEFORE_NG_ARIA: 210, - - /** - * Common Keyboard actions and their associated keycode. - */ - KEY_CODE: { - COMMA: 188, - SEMICOLON : 186, - ENTER: 13, - ESCAPE: 27, - SPACE: 32, - PAGE_UP: 33, - PAGE_DOWN: 34, - END: 35, - HOME: 36, - LEFT_ARROW : 37, - UP_ARROW : 38, - RIGHT_ARROW : 39, - DOWN_ARROW : 40, - TAB : 9, - BACKSPACE: 8, - DELETE: 46 - }, - - /** - * Vendor prefixed CSS properties to be used to support the given functionality in older browsers - * as well. - */ - CSS: { - /* Constants */ - TRANSITIONEND: 'transitionend' + (isWebkit ? ' webkitTransitionEnd' : ''), - ANIMATIONEND: 'animationend' + (isWebkit ? ' webkitAnimationEnd' : ''), - - TRANSFORM: vendorProperty('transform'), - TRANSFORM_ORIGIN: vendorProperty('transformOrigin'), - TRANSITION: vendorProperty('transition'), - TRANSITION_DURATION: vendorProperty('transitionDuration'), - ANIMATION_PLAY_STATE: vendorProperty('animationPlayState'), - ANIMATION_DURATION: vendorProperty('animationDuration'), - ANIMATION_NAME: vendorProperty('animationName'), - ANIMATION_TIMING: vendorProperty('animationTimingFunction'), - ANIMATION_DIRECTION: vendorProperty('animationDirection') - }, - - /** - * As defined in core/style/_variables.scss - * - * $layout-breakpoint-xs: 600px !default; - * $layout-breakpoint-sm: 960px !default; - * $layout-breakpoint-md: 1280px !default; - * $layout-breakpoint-lg: 1920px !default; - * - */ - MEDIA: { - 'xs' : '(max-width: 599px)' , - 'gt-xs' : '(min-width: 600px)' , - 'sm' : '(min-width: 600px) and (max-width: 959px)' , - 'gt-sm' : '(min-width: 960px)' , - 'md' : '(min-width: 960px) and (max-width: 1279px)' , - 'gt-md' : '(min-width: 1280px)' , - 'lg' : '(min-width: 1280px) and (max-width: 1919px)', - 'gt-lg' : '(min-width: 1920px)' , - 'xl' : '(min-width: 1920px)' , - 'landscape' : '(orientation: landscape)' , - 'portrait' : '(orientation: portrait)' , - 'print' : 'print' - }, - - MEDIA_PRIORITY: [ - 'xl', - 'gt-lg', - 'lg', - 'gt-md', - 'md', - 'gt-sm', - 'sm', - 'gt-xs', - 'xs', - 'landscape', - 'portrait', - 'print' - ] - }; - - return self; -} - -})(); -(function(){ -"use strict"; - - angular - .module('material.core') - .config(["$provide", function($provide){ - $provide.decorator('$mdUtil', ['$delegate', function ($delegate){ - /** - * Inject the iterator facade to easily support iteration and accessors - * @see iterator below - */ - $delegate.iterator = MdIterator; - - return $delegate; - } - ]); - }]); - - /** - * iterator is a list facade to easily support iteration and accessors/ - * - * @param {any[]} items Array list which this iterator will enumerate - * @param {boolean=} reloop enables iterator to consider the list as an endless loop - * @return {{add: add, next: (function()), last: (function(): any|null), previous: (function()), count: (function(): number), hasNext: (function(*=): Array.length|*|number|boolean), inRange: (function(*): boolean), remove: remove, contains: (function(*=): *|boolean), itemAt: (function(*=): any|null), findBy: (function(*, *): *[]), hasPrevious: (function(*=): Array.length|*|number|boolean), items: (function(): *[]), indexOf: (function(*=): number), first: (function(): any|null)}} - * @constructor - */ - function MdIterator(items, reloop) { - var trueFn = function() { return true; }; - - if (items && !angular.isArray(items)) { - items = Array.prototype.slice.call(items); - } - - reloop = !!reloop; - var _items = items || []; - - // Published API - return { - items: getItems, - count: count, - - inRange: inRange, - contains: contains, - indexOf: indexOf, - itemAt: itemAt, - - findBy: findBy, - - add: add, - remove: remove, - - first: first, - last: last, - next: angular.bind(null, findSubsequentItem, false), - previous: angular.bind(null, findSubsequentItem, true), - - hasPrevious: hasPrevious, - hasNext: hasNext - }; - - /** - * Publish copy of the enumerable set - * @returns {Array|*} - */ - function getItems() { - return [].concat(_items); - } - - /** - * Determine length of the list - * @returns {Array.length|*|number} - */ - function count() { - return _items.length; - } - - /** - * Is the index specified valid - * @param index - * @returns {Array.length|*|number|boolean} - */ - function inRange(index) { - return _items.length && (index > -1) && (index < _items.length); - } - - /** - * Can the iterator proceed to the next item in the list; relative to - * the specified item. - * - * @param item - * @returns {Array.length|*|number|boolean} - */ - function hasNext(item) { - return item ? inRange(indexOf(item) + 1) : false; - } - - /** - * Can the iterator proceed to the previous item in the list; relative to - * the specified item. - * - * @param item - * @returns {Array.length|*|number|boolean} - */ - function hasPrevious(item) { - return item ? inRange(indexOf(item) - 1) : false; - } - - /** - * Get item at specified index/position - * @param index - * @returns {*} - */ - function itemAt(index) { - return inRange(index) ? _items[index] : null; - } - - /** - * Find all elements matching the key/value pair - * otherwise return null - * - * @param val - * @param key - * - * @return array - */ - function findBy(key, val) { - return _items.filter(function(item) { - return item[key] === val; - }); - } - - /** - * Add item to list - * @param item - * @param index - * @returns {*} - */ - function add(item, index) { - if (!item) return -1; - - if (!angular.isNumber(index)) { - index = _items.length; - } - - _items.splice(index, 0, item); - - return indexOf(item); - } - - /** - * Remove item from list... - * @param item - */ - function remove(item) { - if (contains(item)){ - _items.splice(indexOf(item), 1); - } - } - - /** - * Get the zero-based index of the target item - * @param item - * @returns {*} - */ - function indexOf(item) { - return _items.indexOf(item); - } - - /** - * Boolean existence check - * @param item - * @returns {boolean} - */ - function contains(item) { - return item && (indexOf(item) > -1); - } - - /** - * Return first item in the list - * @returns {*} - */ - function first() { - return _items.length ? _items[0] : null; - } - - /** - * Return last item in the list... - * @returns {*} - */ - function last() { - return _items.length ? _items[_items.length - 1] : null; - } - - /** - * Find the next item. If reloop is true and at the end of the list, it will go back to the - * first item. If given, the `validate` callback will be used to determine whether the next item - * is valid. If not valid, it will try to find the next item again. - * - * @param {boolean} backwards Specifies the direction of searching (forwards/backwards) - * @param {*} item The item whose subsequent item we are looking for - * @param {Function=} validate The `validate` function - * @param {integer=} limit The recursion limit - * - * @returns {*} The subsequent item or null - */ - function findSubsequentItem(backwards, item, validate, limit) { - validate = validate || trueFn; - - var curIndex = indexOf(item); - while (true) { - if (!inRange(curIndex)) return null; - - var nextIndex = curIndex + (backwards ? -1 : 1); - var foundItem = null; - if (inRange(nextIndex)) { - foundItem = _items[nextIndex]; - } else if (reloop) { - foundItem = backwards ? last() : first(); - nextIndex = indexOf(foundItem); - } - - if ((foundItem === null) || (nextIndex === limit)) return null; - if (validate(foundItem)) return foundItem; - - if (angular.isUndefined(limit)) limit = nextIndex; - - curIndex = nextIndex; - } - } - } - - -})(); -(function(){ -"use strict"; - - -mdMediaFactory.$inject = ["$mdConstant", "$rootScope", "$window"];angular.module('material.core') -.factory('$mdMedia', mdMediaFactory); - -/** - * @ngdoc service - * @name $mdMedia - * @module material.core - * - * @description - * `$mdMedia` is used to evaluate whether a given media query is true or false given the - * current device's screen / window size. The media query will be re-evaluated on resize, allowing - * you to register a watch. - * - * `$mdMedia` also has pre-programmed support for media queries that match the layout breakpoints: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    BreakpointmediaQuery
    xs(max-width: 599px)
    gt-xs(min-width: 600px)
    sm(min-width: 600px) and (max-width: 959px)
    gt-sm(min-width: 960px)
    md(min-width: 960px) and (max-width: 1279px)
    gt-md(min-width: 1280px)
    lg(min-width: 1280px) and (max-width: 1919px)
    gt-lg(min-width: 1920px)
    xl(min-width: 1920px)
    landscapelandscape
    portraitportrait
    printprint
    - * - * See Material Design's Layout - Adaptive UI for more details. - * - * - * - * - * - * @returns {boolean} a boolean representing whether or not the given media query is true or false. - * - * @usage - * - * app.controller('MyController', function($mdMedia, $scope) { - * $scope.$watch(function() { return $mdMedia('lg'); }, function(big) { - * $scope.bigScreen = big; - * }); - * - * $scope.screenIsSmall = $mdMedia('sm'); - * $scope.customQuery = $mdMedia('(min-width: 1234px)'); - * $scope.anotherCustom = $mdMedia('max-width: 300px'); - * }); - * - */ - -/* @ngInject */ -function mdMediaFactory($mdConstant, $rootScope, $window) { - var queries = {}; - var mqls = {}; - var results = {}; - var normalizeCache = {}; - - $mdMedia.getResponsiveAttribute = getResponsiveAttribute; - $mdMedia.getQuery = getQuery; - $mdMedia.watchResponsiveAttributes = watchResponsiveAttributes; - - return $mdMedia; - - function $mdMedia(query) { - var validated = queries[query]; - if (angular.isUndefined(validated)) { - validated = queries[query] = validate(query); - } - - var result = results[validated]; - if (angular.isUndefined(result)) { - result = add(validated); - } - - return result; - } - - function validate(query) { - return $mdConstant.MEDIA[query] || - ((query.charAt(0) !== '(') ? ('(' + query + ')') : query); - } - - function add(query) { - var result = mqls[query]; - if (!result) { - result = mqls[query] = $window.matchMedia(query); - } - - result.addListener(onQueryChange); - return (results[result.media] = !!result.matches); - } - - function onQueryChange(query) { - $rootScope.$evalAsync(function() { - results[query.media] = !!query.matches; - }); - } - - function getQuery(name) { - return mqls[name]; - } - - function getResponsiveAttribute(attrs, attrName) { - for (var i = 0; i < $mdConstant.MEDIA_PRIORITY.length; i++) { - var mediaName = $mdConstant.MEDIA_PRIORITY[i]; - if (!mqls[queries[mediaName]].matches) { - continue; - } - - var normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName); - if (attrs[normalizedName]) { - return attrs[normalizedName]; - } - } - - // fallback on unprefixed - return attrs[getNormalizedName(attrs, attrName)]; - } - - function watchResponsiveAttributes(attrNames, attrs, watchFn) { - var unwatchFns = []; - attrNames.forEach(function(attrName) { - var normalizedName = getNormalizedName(attrs, attrName); - if (angular.isDefined(attrs[normalizedName])) { - unwatchFns.push( - attrs.$observe(normalizedName, angular.bind(void 0, watchFn, null))); - } - - for (var mediaName in $mdConstant.MEDIA) { - normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName); - if (angular.isDefined(attrs[normalizedName])) { - unwatchFns.push( - attrs.$observe(normalizedName, angular.bind(void 0, watchFn, mediaName))); - } - } - }); - - return function unwatch() { - unwatchFns.forEach(function(fn) { fn(); }); - }; - } - - // Improves performance dramatically - function getNormalizedName(attrs, attrName) { - return normalizeCache[attrName] || - (normalizeCache[attrName] = attrs.$normalize(attrName)); - } -} - -})(); -(function(){ -"use strict"; - -angular - .module('material.core') - .config(["$provide", function($provide) { - $provide.decorator('$mdUtil', ['$delegate', function ($delegate) { - - // Inject the prefixer into our original $mdUtil service. - $delegate.prefixer = MdPrefixer; - - return $delegate; - }]); - }]); - -/** - * @param {string|string[]} initialAttributes - * @param {boolean} buildSelector - * @return {string|string[]|{buildSelector: (function(string|string[]): string), - * buildList: (function(string|string[]): string[]), - * hasAttribute: (function(JQLite|Element, string): HTMLElement), - * removeAttribute: (function(JQLite|Element, string): void)}} - * @constructor - */ -function MdPrefixer(initialAttributes, buildSelector) { - var PREFIXES = ['data', 'x']; - - if (initialAttributes) { - // The prefixer also accepts attributes as a parameter, and immediately builds a list or selector for - // the specified attributes. - return buildSelector ? _buildSelector(initialAttributes) : _buildList(initialAttributes); - } - - return { - buildList: _buildList, - buildSelector: _buildSelector, - hasAttribute: _hasAttribute, - removeAttribute: _removeAttribute - }; - - function _buildList(attributes) { - attributes = angular.isArray(attributes) ? attributes : [attributes]; - - attributes.forEach(function(item) { - PREFIXES.forEach(function(prefix) { - attributes.push(prefix + '-' + item); - }); - }); - - return attributes; - } - - function _buildSelector(attributes) { - attributes = angular.isArray(attributes) ? attributes : [attributes]; - - return _buildList(attributes) - .map(function(item) { - return '[' + item + ']'; - }) - .join(','); - } - - function _hasAttribute(element, attribute) { - element = _getNativeElement(element); - - if (!element) { - return false; - } - - var prefixedAttrs = _buildList(attribute); - - for (var i = 0; i < prefixedAttrs.length; i++) { - if (element.hasAttribute(prefixedAttrs[i])) { - return true; - } - } - - return false; - } - - function _removeAttribute(element, attribute) { - element = _getNativeElement(element); - - if (!element) { - return; - } - - _buildList(attribute).forEach(function(prefixedAttribute) { - element.removeAttribute(prefixedAttribute); - }); - } - - /** - * Transforms a jqLite or DOM element into a HTML element. - * This is useful when supporting jqLite elements and DOM elements at - * same time. - * @param element {JQLite|Element} Element to be parsed - * @returns {HTMLElement} Parsed HTMLElement - */ - function _getNativeElement(element) { - element = element[0] || element; - - if (element.nodeType) { - return element; - } - } - -} - -})(); -(function(){ -"use strict"; - -/* - * This var has to be outside the angular factory, otherwise when - * there are multiple material apps on the same page, each app - * will create its own instance of this array and the app's IDs - * will not be unique. - */ -UtilFactory.$inject = ["$document", "$timeout", "$compile", "$rootScope", "$$mdAnimate", "$interpolate", "$log", "$rootElement", "$window", "$$rAF"]; -var nextUniqueId = 0, isIos, isAndroid, isFirefox; - -// Support material-tools builds. -if (window.navigator) { - var userAgent = window.navigator.userAgent || window.navigator.vendor || window.opera; - isIos = userAgent.match(/ipad|iphone|ipod/i); - isAndroid = userAgent.match(/android/i); - isFirefox = userAgent.match(/(firefox|minefield)/i); -} - -/** - * @ngdoc module - * @name material.core.util - * @description - * Util - */ -angular -.module('material.core') -.factory('$mdUtil', UtilFactory); - -/** - * @ngInject - */ -function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $interpolate, $log, - $rootElement, $window, $$rAF) { - // Setup some core variables for the processTemplate method - var startSymbol = $interpolate.startSymbol(), - endSymbol = $interpolate.endSymbol(), - usesStandardSymbols = ((startSymbol === '{{') && (endSymbol === '}}')); - - // Polyfill document.contains for IE11. - document.contains || (document.contains = function (node) { - return document.body.contains(node); - }); - - /** - * Checks if the target element has the requested style by key - * @param {DOMElement|JQLite} target Target element - * @param {string} key Style key - * @param {string=} expectedVal Optional expected value - * @returns {boolean} Whether the target element has the style or not - */ - var hasComputedStyle = function (target, key, expectedVal) { - var hasValue = false; - - if (target && target.length) { - var computedStyles = $window.getComputedStyle(target[0]); - hasValue = angular.isDefined(computedStyles[key]) && - (expectedVal ? computedStyles[key] == expectedVal : true); - } - - return hasValue; - }; - - function validateCssValue(value) { - return !value ? '0' : - hasPx(value) || hasPercent(value) ? value : value + 'px'; - } - - function hasPx(value) { - return String(value).indexOf('px') > -1; - } - - function hasPercent(value) { - return String(value).indexOf('%') > -1; - } - - var $mdUtil = { - dom: {}, - isIos: isIos, - isAndroid: isAndroid, - now: window.performance && window.performance.now ? - angular.bind(window.performance, window.performance.now) : Date.now || function() { - return new Date().getTime(); - }, - - /** - * Cross-version compatibility method to retrieve an option of a ngModel controller, - * which supports the breaking changes in the AngularJS snapshot (SHA 87a2ff76af5d0a9268d8eb84db5755077d27c84c). - * @param {!ngModel.NgModelController} ngModelCtrl - * @param {!string} optionName - * @returns {string|number|boolean|Object|undefined} - */ - getModelOption: function (ngModelCtrl, optionName) { - if (!ngModelCtrl.$options) { - return; - } - - var $options = ngModelCtrl.$options; - - // The newer versions of AngularJS introduced a getOption function and made the option values - // no longer visible on the $options object. - return $options.getOption ? $options.getOption(optionName) : $options[optionName]; - }, - - /** - * Determines the current 'dir'ectional value based on the value of 'dir' - * attribute of the element. If that is not defined, it will try to use - * a 'dir' attribute of the body or html tag. - * - * @param {Object=} attrs a hash object with key-value pairs of normalized - * attribute names and their corresponding attribute values. - * @returns {boolean} true if the element's passed in attributes, - * the document, or the body indicates RTL mode, false otherwise. - */ - isRtl: function(attrs) { - var dir = angular.isDefined(attrs) && attrs.hasOwnProperty('dir') && attrs.dir; - - switch (dir) { - case 'ltr': - return false; - - case 'rtl': - return true; - } - - return ($document[0].dir === 'rtl' || $document[0].body.dir === 'rtl'); - }, - - /** - * Bi-directional accessor/mutator used to easily update an element's - * property based on the current 'dir'ectional value. - */ - bidi: function(element, property, lValue, rValue) { - var ltr = !this.isRtl(); - - // If accessor - if (arguments.length == 0) return ltr ? 'ltr' : 'rtl'; - - // If mutator - var elem = angular.element(element); - - if (ltr && angular.isDefined(lValue)) { - elem.css(property, validateCssValue(lValue)); - } - else if (!ltr && angular.isDefined(rValue)) { - elem.css(property, validateCssValue(rValue)); - } - }, - - bidiProperty: function (element, lProperty, rProperty, value) { - var ltr = !this.isRtl(); - - var elem = angular.element(element); - - if (ltr && angular.isDefined(lProperty)) { - elem.css(lProperty, validateCssValue(value)); - elem.css(rProperty, ''); - } - else if (!ltr && angular.isDefined(rProperty)) { - elem.css(rProperty, validateCssValue(value)); - elem.css(lProperty, ''); - } - }, - - clientRect: function(element, offsetParent, isOffsetRect) { - var node = getNode(element); - offsetParent = getNode(offsetParent || node.offsetParent || document.body); - var nodeRect = node.getBoundingClientRect(); - - // The user can ask for an offsetRect: a rect relative to the offsetParent, - // or a clientRect: a rect relative to the page - var offsetRect = isOffsetRect ? - offsetParent.getBoundingClientRect() : - {left: 0, top: 0, width: 0, height: 0}; - return { - left: nodeRect.left - offsetRect.left, - top: nodeRect.top - offsetRect.top, - width: nodeRect.width, - height: nodeRect.height - }; - }, - offsetRect: function(element, offsetParent) { - return $mdUtil.clientRect(element, offsetParent, true); - }, - - /** - * Annoying method to copy nodes to an array, thanks to IE. - * @param nodes - * @return {Array} - */ - nodesToArray: function(nodes) { - var results = [], i; - nodes = nodes || []; - - for (i = 0; i < nodes.length; ++i) { - results.push(nodes.item(i)); - } - return results; - }, - - /** - * Determines the absolute position of the viewport. - * Useful when making client rectangles absolute. - * @returns {number} - */ - getViewportTop: function() { - // If body scrolling is disabled, then use the cached viewport top value, otherwise get it - // fresh from the $window. - if ($mdUtil.disableScrollAround._count && $mdUtil.disableScrollAround._viewPortTop) { - return $mdUtil.disableScrollAround._viewPortTop; - } else { - return $window.scrollY || $window.pageYOffset || 0; - } - }, - - /** - * Finds the proper focus target by searching the DOM. - * - * @param {!JQLite} containerEl - * @param {string=} attributeVal - * @returns {JQLite|undefined} - */ - findFocusTarget: function(containerEl, attributeVal) { - var AUTO_FOCUS = this.prefixer('md-autofocus', true); - var elToFocus; - - elToFocus = scanForFocusable(containerEl, attributeVal || AUTO_FOCUS); - - // Scan for fallback to 'universal' API - if (!elToFocus) { - elToFocus = scanForFocusable(containerEl, AUTO_FOCUS); - } - - return elToFocus; - - /** - * Can target and nested children for specified Selector (attribute) - * whose value may be an expression that evaluates to True/False. - * @param {!JQLite} target - * @param {!string} selector - * @return {JQLite|undefined} - */ - function scanForFocusable(target, selector) { - var elFound, items = target[0].querySelectorAll(selector); - - // Find the last child element with the focus attribute - if (items && items.length) { - items.length && angular.forEach(items, function(it) { - it = angular.element(it); - - // Check the element for the md-autofocus class to ensure any associated expression - // evaluated to true. - var isFocusable = it.hasClass('md-autofocus'); - if (isFocusable) elFound = it; - }); - } - return elFound; - } - }, - - /** - * Disables scroll around the passed parent element. - * @param {Element|JQLite=} element Origin Element (not used) - * @param {Element|JQLite=} parent Element to disable scrolling within. - * Defaults to body if none supplied. - * @param {Object=} options Object of options to modify functionality - * - disableScrollMask Boolean of whether or not to create a scroll mask element or - * use the passed parent element. - */ - disableScrollAround: function(element, parent, options) { - options = options || {}; - - $mdUtil.disableScrollAround._count = Math.max(0, $mdUtil.disableScrollAround._count || 0); - $mdUtil.disableScrollAround._count++; - - if ($mdUtil.disableScrollAround._restoreScroll) { - return $mdUtil.disableScrollAround._restoreScroll; - } - - var body = $document[0].body; - var restoreBody = disableBodyScroll(); - var restoreElement = disableElementScroll(parent, options); - - return $mdUtil.disableScrollAround._restoreScroll = function() { - if (--$mdUtil.disableScrollAround._count <= 0) { - delete $mdUtil.disableScrollAround._viewPortTop; - restoreBody(); - restoreElement(); - delete $mdUtil.disableScrollAround._restoreScroll; - } - }; - - /** - * Creates a virtual scrolling mask to prevent touchmove, keyboard, scrollbar clicking, - * and wheel events. - * @param {!Element|!JQLite} elementToDisable - * @param {Object=} scrollMaskOptions Object of options to modify functionality - * - disableScrollMask Boolean of whether or not to create a scroll mask element or - * use the passed parent element. - * @returns {Function} - */ - function disableElementScroll(elementToDisable, scrollMaskOptions) { - var scrollMask; - var wrappedElementToDisable = angular.element(elementToDisable || body); - - if (scrollMaskOptions.disableScrollMask) { - scrollMask = wrappedElementToDisable; - } else { - scrollMask = angular.element( - '
    ' + - '
    ' + - '
    '); - wrappedElementToDisable.append(scrollMask); - } - - /** - * @param {Event} $event - */ - function preventDefault($event) { - $event.preventDefault(); - } - - scrollMask.on('wheel touchmove', preventDefault); - - return function restoreElementScroll() { - scrollMask.off('wheel touchmove', preventDefault); - - if (!scrollMaskOptions.disableScrollMask && scrollMask[0].parentNode) { - scrollMask[0].parentNode.removeChild(scrollMask[0]); - } - }; - } - - // Converts the body to a position fixed block and translate it to the proper scroll position - function disableBodyScroll() { - var documentElement = $document[0].documentElement; - - var prevDocumentStyle = documentElement.style.cssText || ''; - var prevBodyStyle = body.style.cssText || ''; - - var viewportTop = $mdUtil.getViewportTop(); - $mdUtil.disableScrollAround._viewPortTop = viewportTop; - var clientWidth = body.clientWidth; - var hasVerticalScrollbar = body.scrollHeight > body.clientHeight + 1; - - // Scroll may be set on element (for example by overflow-y: scroll) - // but Chrome is reporting the scrollTop position always on . - // scrollElement will allow to restore the scrollTop position to proper target. - var scrollElement = documentElement.scrollTop > 0 ? documentElement : body; - - if (hasVerticalScrollbar) { - angular.element(body).css({ - position: 'fixed', - width: '100%', - top: -viewportTop + 'px' - }); - } - - if (body.clientWidth < clientWidth) { - body.style.overflow = 'hidden'; - } - - return function restoreScroll() { - // Reset the inline style CSS to the previous. - body.style.cssText = prevBodyStyle; - documentElement.style.cssText = prevDocumentStyle; - - // The scroll position while being fixed - scrollElement.scrollTop = viewportTop; - }; - } - - }, - - enableScrolling: function() { - var restoreFn = this.disableScrollAround._restoreScroll; - restoreFn && restoreFn(); - }, - - floatingScrollbars: function() { - if (this.floatingScrollbars.cached === undefined) { - var tempNode = angular.element('
    ').css({ - width: '100%', - 'z-index': -1, - position: 'absolute', - height: '35px', - 'overflow-y': 'scroll' - }); - tempNode.children().css('height', '60px'); - - $document[0].body.appendChild(tempNode[0]); - this.floatingScrollbars.cached = - (tempNode[0].offsetWidth === tempNode[0].childNodes[0].offsetWidth); - tempNode.remove(); - } - return this.floatingScrollbars.cached; - }, - - /** - * Mobile safari only allows you to set focus in click event listeners. - * @param {Element|JQLite} element to focus - */ - forceFocus: function(element) { - var node = element[0] || element; - - document.addEventListener('click', function focusOnClick(ev) { - if (ev.target === node && ev.$focus) { - node.focus(); - ev.stopImmediatePropagation(); - ev.preventDefault(); - node.removeEventListener('click', focusOnClick); - } - }, true); - - var newEvent = document.createEvent('MouseEvents'); - newEvent.initMouseEvent('click', false, true, window, {}, 0, 0, 0, 0, - false, false, false, false, 0, null); - newEvent.$material = true; - newEvent.$focus = true; - node.dispatchEvent(newEvent); - }, - - /** - * facade to build md-backdrop element with desired styles - * NOTE: Use $compile to trigger backdrop postLink function - */ - createBackdrop: function(scope, addClass) { - return $compile($mdUtil.supplant('', [addClass]))(scope); - }, - - /** - * supplant() method from Crockford's `Remedial Javascript` - * Equivalent to use of $interpolate; without dependency on - * interpolation symbols and scope. Note: the '{}' can - * be property names, property chains, or array indices. - */ - supplant: function(template, values, pattern) { - pattern = pattern || /\{([^{}]*)\}/g; - return template.replace(pattern, function(a, b) { - var p = b.split('.'), - r = values; - try { - for (var s in p) { - if (p.hasOwnProperty(s)) { - r = r[p[s]]; - } - } - } catch (e) { - r = a; - } - return (typeof r === 'string' || typeof r === 'number') ? r : a; - }); - }, - - fakeNgModel: function() { - return { - $fake: true, - $setTouched: angular.noop, - $setViewValue: function(value) { - this.$viewValue = value; - this.$render(value); - this.$viewChangeListeners.forEach(function(cb) { - cb(); - }); - }, - $isEmpty: function(value) { - return ('' + value).length === 0; - }, - $parsers: [], - $formatters: [], - $viewChangeListeners: [], - $render: angular.noop - }; - }, - - /** - * @param {Function} func original function to be debounced - * @param {number} wait number of milliseconds to delay (since last debounce reset). - * Default value 10 msecs. - * @param {Object} scope in which to apply the function after debouncing ends - * @param {boolean} invokeApply should the $timeout trigger $digest() dirty checking - * @return {Function} A function, that, as long as it continues to be invoked, will not be - * triggered. The function will be called after it stops being called for N milliseconds. - */ - debounce: function(func, wait, scope, invokeApply) { - var timer; - - return function debounced() { - var context = scope, - args = Array.prototype.slice.call(arguments); - - $timeout.cancel(timer); - timer = $timeout(function() { - - timer = undefined; - func.apply(context, args); - - }, wait || 10, invokeApply); - }; - }, - - /** - * The function will not be called unless it has been more than `delay` milliseconds since the - * last call. - * @param {Function} func original function to throttle - * @param {number} delay number of milliseconds to delay - * @return {Function} a function that can only be triggered every `delay` milliseconds. - */ - throttle: function throttle(func, delay) { - var recent; - return function throttled() { - var context = this; - var args = arguments; - var now = $mdUtil.now(); - - if (!recent || (now - recent > delay)) { - func.apply(context, args); - recent = now; - } - }; - }, - - /** - * Measures the number of milliseconds taken to run the provided callback - * function. Uses a high-precision timer if available. - */ - time: function time(cb) { - var start = $mdUtil.now(); - cb(); - return $mdUtil.now() - start; - }, - - /** - * Create an implicit getter that caches its `getter()` - * lookup value - */ - valueOnUse : function (scope, key, getter) { - var value = null, args = Array.prototype.slice.call(arguments); - var params = (args.length > 3) ? args.slice(3) : []; - - Object.defineProperty(scope, key, { - get: function () { - if (value === null) value = getter.apply(scope, params); - return value; - } - }); - }, - - /** - * Get a unique ID. - * - * @returns {string} an unique numeric string - */ - nextUid: function() { - return '' + nextUniqueId++; - }, - - /** - * Stop watchers and events from firing on a scope without destroying it, - * by disconnecting it from its parent and its siblings' linked lists. - * @param {Object} scope to disconnect - */ - disconnectScope: function disconnectScope(scope) { - if (!scope) return; - - // we can't destroy the root scope or a scope that has been already destroyed - if (scope.$root === scope) return; - if (scope.$$destroyed) return; - - var parent = scope.$parent; - scope.$$disconnected = true; - - // See Scope.$destroy - if (parent.$$childHead === scope) parent.$$childHead = scope.$$nextSibling; - if (parent.$$childTail === scope) parent.$$childTail = scope.$$prevSibling; - if (scope.$$prevSibling) scope.$$prevSibling.$$nextSibling = scope.$$nextSibling; - if (scope.$$nextSibling) scope.$$nextSibling.$$prevSibling = scope.$$prevSibling; - - scope.$$nextSibling = scope.$$prevSibling = null; - - }, - - /** - * Undo the effects of disconnectScope(). - * @param {Object} scope to reconnect - */ - reconnectScope: function reconnectScope(scope) { - if (!scope) return; - - // we can't disconnect the root node or scope already disconnected - if (scope.$root === scope) return; - if (!scope.$$disconnected) return; - - var child = scope; - - var parent = child.$parent; - child.$$disconnected = false; - // See Scope.$new for this logic... - child.$$prevSibling = parent.$$childTail; - if (parent.$$childHead) { - parent.$$childTail.$$nextSibling = child; - parent.$$childTail = child; - } else { - parent.$$childHead = parent.$$childTail = child; - } - }, - - /** - * Get an element's siblings matching a given tag name. - * - * @param {JQLite|angular.element|HTMLElement} element Element to start walking the DOM from - * @param {string} tagName HTML tag name to match against - * @returns {Object[]} JQLite - */ - getSiblings: function getSiblings(element, tagName) { - var upperCasedTagName = tagName.toUpperCase(); - if (element instanceof angular.element) { - element = element[0]; - } - var siblings = Array.prototype.filter.call(element.parentNode.children, function(node) { - return element !== node && node.tagName.toUpperCase() === upperCasedTagName; - }); - return siblings.map(function (sibling) { - return angular.element(sibling); - }); - }, - - /** - * getClosest replicates jQuery.closest() to walk up the DOM tree until it finds a matching - * nodeName. - * - * @param {Node} el Element to start walking the DOM from - * @param {string|function} validateWith If a string is passed, it will be evaluated against - * each of the parent nodes' tag name. If a function is passed, the loop will call it with each - * of the parents and will use the return value to determine whether the node is a match. - * @param {boolean=} onlyParent Only start checking from the parent element, not `el`. - * @returns {Node|null} closest matching parent Node or null if not found - */ - getClosest: function getClosest(el, validateWith, onlyParent) { - if (angular.isString(validateWith)) { - var tagName = validateWith.toUpperCase(); - validateWith = function(el) { - return el.nodeName.toUpperCase() === tagName; - }; - } - - if (el instanceof angular.element) el = el[0]; - if (onlyParent) el = el.parentNode; - if (!el) return null; - - do { - if (validateWith(el)) { - return el; - } - } while (el = el.parentNode); - - return null; - }, - - /** - * Build polyfill for the Node.contains feature (if needed) - * @param {Node} node - * @param {Node} child - * @returns {Node} - */ - elementContains: function(node, child) { - var hasContains = (window.Node && window.Node.prototype && Node.prototype.contains); - var findFn = hasContains ? angular.bind(node, node.contains) : angular.bind(node, function(arg) { - // compares the positions of two nodes and returns a bitmask - return (node === child) || !!(this.compareDocumentPosition(arg) & 16); - }); - - return findFn(child); - }, - - /** - * Functional equivalent for $element.filter(‘md-bottom-sheet’) - * useful with interimElements where the element and its container are important... - * - * @param {JQLite} element to scan - * @param {string} nodeName of node to find (e.g. 'md-dialog') - * @param {boolean=} scanDeep optional flag to allow deep scans; defaults to 'false'. - * @param {boolean=} warnNotFound optional flag to enable log warnings; defaults to false - */ - extractElementByName: function(element, nodeName, scanDeep, warnNotFound) { - var found = scanTree(element); - if (!found && !!warnNotFound) { - $log.warn($mdUtil.supplant("Unable to find node '{0}' in element '{1}'.",[nodeName, element[0].outerHTML])); - } - - return angular.element(found || element); - - /** - * Breadth-First tree scan for element with matching `nodeName` - */ - function scanTree(element) { - return scanLevel(element) || (scanDeep ? scanChildren(element) : null); - } - - /** - * Case-insensitive scan of current elements only (do not descend). - */ - function scanLevel(element) { - if (element) { - for (var i = 0, len = element.length; i < len; i++) { - if (element[i].nodeName.toLowerCase() === nodeName) { - return element[i]; - } - } - } - return null; - } - - /** - * Scan children of specified node - */ - function scanChildren(element) { - var found; - if (element) { - for (var i = 0, len = element.length; i < len; i++) { - var target = element[i]; - if (!found) { - for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) { - found = found || scanTree([target.childNodes[j]]); - } - } - } - } - return found; - } - - }, - - /** - * Give optional properties with no value a boolean true if attr provided or false otherwise - */ - initOptionalProperties: function(scope, attr, defaults) { - defaults = defaults || {}; - angular.forEach(scope.$$isolateBindings, function(binding, key) { - if (binding.optional && angular.isUndefined(scope[key])) { - var attrIsDefined = angular.isDefined(attr[binding.attrName]); - scope[key] = angular.isDefined(defaults[key]) ? defaults[key] : attrIsDefined; - } - }); - }, - - /** - * Alternative to $timeout calls with 0 delay. - * nextTick() coalesces all calls within a single frame - * to minimize $digest thrashing - * - * @param {Function} callback function to be called after the tick - * @param {boolean=} digest true to call $rootScope.$digest() after callback - * @param {Object=} scope associated with callback. If the scope is destroyed, the callback will - * be skipped. - * @returns {*} - */ - nextTick: function(callback, digest, scope) { - // grab function reference for storing state details - var nextTick = $mdUtil.nextTick; - var timeout = nextTick.timeout; - var queue = nextTick.queue || []; - - // add callback to the queue - queue.push({scope: scope, callback: callback}); - - // set default value for digest - if (digest == null) digest = true; - - // store updated digest/queue values - nextTick.digest = nextTick.digest || digest; - nextTick.queue = queue; - - // either return existing timeout or create a new one - return timeout || (nextTick.timeout = $timeout(processQueue, 0, false)); - - /** - * Grab a copy of the current queue - * Clear the queue for future use - * Process the existing queue - * Trigger digest if necessary - */ - function processQueue() { - var queue = nextTick.queue; - var digest = nextTick.digest; - - nextTick.queue = []; - nextTick.timeout = null; - nextTick.digest = false; - - queue.forEach(function(queueItem) { - var skip = queueItem.scope && queueItem.scope.$$destroyed; - if (!skip) { - queueItem.callback(); - } - }); - - if (digest) $rootScope.$digest(); - } - }, - - /** - * Processes a template and replaces the start/end symbols if the application has - * overridden them. - * - * @param template The template to process whose start/end tags may be replaced. - * @returns {*} - */ - processTemplate: function(template) { - if (usesStandardSymbols) { - return template; - } else { - if (!template || !angular.isString(template)) return template; - return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol); - } - }, - - /** - * Scan up dom hierarchy for enabled parent; - */ - getParentWithPointerEvents: function (element) { - var parent = element.parent(); - - // jqLite might return a non-null, but still empty, parent; so check for parent and length - while (hasComputedStyle(parent, 'pointer-events', 'none')) { - parent = parent.parent(); - } - - return parent; - }, - - getNearestContentElement: function (element) { - var current = element.parent()[0]; - // Look for the nearest parent md-content, stopping at the rootElement. - while (current && current !== $rootElement[0] && current !== document.body && current.nodeName.toUpperCase() !== 'MD-CONTENT') { - current = current.parentNode; - } - return current; - }, - - /** - * Checks if the current browser is natively supporting the `sticky` position. - * @returns {string} supported sticky property name - */ - checkStickySupport: function() { - var stickyProp; - var testEl = angular.element('
    '); - $document[0].body.appendChild(testEl[0]); - - var stickyProps = ['sticky', '-webkit-sticky']; - for (var i = 0; i < stickyProps.length; ++i) { - testEl.css({ - position: stickyProps[i], - top: 0, - 'z-index': 2 - }); - - if (testEl.css('position') == stickyProps[i]) { - stickyProp = stickyProps[i]; - break; - } - } - - testEl.remove(); - - return stickyProp; - }, - - /** - * Parses an attribute value, mostly a string. - * By default checks for negated values and returns `false´ if present. - * Negated values are: (native falsy) and negative strings like: - * `false` or `0`. - * @param value Attribute value which should be parsed. - * @param negatedCheck When set to false, won't check for negated values. - * @returns {boolean} - */ - parseAttributeBoolean: function(value, negatedCheck) { - return value === '' || !!value && (negatedCheck === false || value !== 'false' && value !== '0'); - }, - - hasComputedStyle: hasComputedStyle, - - /** - * Returns true if the parent form of the element has been submitted. - * @param element An AngularJS or HTML5 element. - * @returns {boolean} - */ - isParentFormSubmitted: function(element) { - var parent = $mdUtil.getClosest(element, 'form'); - var form = parent ? angular.element(parent).controller('form') : null; - - return form ? form.$submitted : false; - }, - - /** - * Animate the requested element's scrollTop to the requested scrollPosition with basic easing. - * @param {!Element} element The element to scroll. - * @param {number} scrollEnd The new/final scroll position. - * @param {number=} duration Duration of the scroll. Default is 1000ms. - */ - animateScrollTo: function(element, scrollEnd, duration) { - var scrollStart = element.scrollTop; - var scrollChange = scrollEnd - scrollStart; - var scrollingDown = scrollStart < scrollEnd; - var startTime = $mdUtil.now(); - - $$rAF(scrollChunk); - - function scrollChunk() { - var newPosition = calculateNewPosition(); - - element.scrollTop = newPosition; - - if (scrollingDown ? newPosition < scrollEnd : newPosition > scrollEnd) { - $$rAF(scrollChunk); - } - } - - function calculateNewPosition() { - var easeDuration = duration || 1000; - var currentTime = $mdUtil.now() - startTime; - - return ease(currentTime, scrollStart, scrollChange, easeDuration); - } - - function ease(currentTime, start, change, duration) { - // If the duration has passed (which can occur if our app loses focus due to $$rAF), jump - // straight to the proper position - if (currentTime > duration) { - return start + change; - } - - var ts = (currentTime /= duration) * currentTime; - var tc = ts * currentTime; - - return start + change * (-2 * tc + 3 * ts); - } - }, - - /** - * Provides an easy mechanism for removing duplicates from an array. - * - * var myArray = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]; - * - * $mdUtil.uniq(myArray) => [1, 2, 3, 4] - * - * @param {Array} array The array whose unique values should be returned. - * @returns {Array|void} A copy of the array containing only unique values. - */ - uniq: function(array) { - if (!array) { return; } - - return array.filter(function(value, index, self) { - return self.indexOf(value) === index; - }); - }, - - /** - * Gets the inner HTML content of the given HTMLElement. - * Only intended for use with SVG or Symbol elements in IE11. - * @param {Element} element - * @returns {string} the inner HTML of the element passed in - */ - getInnerHTML: function(element) { - // For SVG or Symbol elements, innerHTML returns `undefined` in IE. - // Reference: https://stackoverflow.com/q/28129956/633107 - // The XMLSerializer API is supported on IE11 and is the recommended workaround. - var serializer = new XMLSerializer(); - - return Array.prototype.map.call(element.childNodes, function (child) { - return serializer.serializeToString(child); - }).join(''); - }, - - /** - * Gets the outer HTML content of the given HTMLElement. - * Only intended for use with SVG or Symbol elements in IE11. - * @param {Element} element - * @returns {string} the outer HTML of the element passed in - */ - getOuterHTML: function(element) { - // For SVG or Symbol elements, outerHTML returns `undefined` in IE. - // Reference: https://stackoverflow.com/q/29888050/633107 - // The XMLSerializer API is supported on IE11 and is the recommended workaround. - var serializer = new XMLSerializer(); - return serializer.serializeToString(element); - }, - - /** - * Support: IE 9-11 only - * documentMode is an IE-only property - * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx - */ - msie: window.document.documentMode, - - getTouchAction: function() { - var testEl = document.createElement('div'); - var vendorPrefixes = ['', 'webkit', 'Moz', 'MS', 'ms', 'o']; - - for (var i = 0; i < vendorPrefixes.length; i++) { - var prefix = vendorPrefixes[i]; - var property = prefix ? prefix + 'TouchAction' : 'touchAction'; - if (angular.isDefined(testEl.style[property])) { - return property; - } - } - }, - - /** - * @param {Event} event the event to calculate the bubble path for - * @return {EventTarget[]} the set of nodes that this event could bubble up to - */ - getEventPath: function(event) { - var path = []; - var currentTarget = event.target; - while (currentTarget) { - path.push(currentTarget); - currentTarget = currentTarget.parentElement; - } - if (path.indexOf(window) === -1 && path.indexOf(document) === -1) - path.push(document); - if (path.indexOf(window) === -1) - path.push(window); - return path; - }, - - /** - * Gets the string the user has entered and removes Regex identifiers - * @param {string} term - * @returns {string} sanitized string - */ - sanitize: function(term) { - if (!term) return term; - return term.replace(/[\\^$*+?.()|{}[]/g, '\\$&'); - }, - - /********************************************************************************************** - * The following functions were sourced from - * https://github.com/angular/components/blob/3c37e4b1c1cb74a3d0a90d173240fc730d21d9d4/src/cdk/a11y/interactivity-checker/interactivity-checker.ts - **********************************************************************************************/ - - /** - * Gets whether an element is disabled. - * @param {HTMLElement} element Element to be checked. - * @returns {boolean} Whether the element is disabled. - */ - isDisabled: function(element) { - // This does not capture some cases, such as a non-form control with a disabled attribute or - // a form control inside of a disabled form, but should capture the most common cases. - return element.hasAttribute('disabled'); - }, - - /** - * Gets whether an element is visible for the purposes of interactivity. - * - * This will capture states like `display: none` and `visibility: hidden`, but not things like - * being clipped by an `overflow: hidden` parent or being outside the viewport. - * - * @param {HTMLElement} element - * @returns {boolean} Whether the element is visible. - */ - isVisible: function(element) { - return $mdUtil.hasGeometry(element) && getComputedStyle(element).visibility === 'visible'; - }, - - /** - * Gets whether an element can be reached via Tab key. - * Assumes that the element has already been checked with isFocusable. - * @param {HTMLElement} element Element to be checked. - * @returns {boolean} Whether the element is tabbable. - */ - isTabbable: function(element) { - var frameElement = $mdUtil.getFrameElement($mdUtil.getWindow(element)); - - if (frameElement) { - // Frame elements inherit their tabindex onto all child elements. - if ($mdUtil.getTabIndexValue(frameElement) === -1) { - return false; - } - - // Browsers disable tabbing to an element inside of an invisible frame. - if (!$mdUtil.isVisible(frameElement)) { - return false; - } - } - - var nodeName = element.nodeName.toLowerCase(); - var tabIndexValue = $mdUtil.getTabIndexValue(element); - - if (element.hasAttribute('contenteditable')) { - return tabIndexValue !== -1; - } - - if (nodeName === 'iframe' || nodeName === 'object') { - // The frame or object's content may be tabbable depending on the content, but it's - // not possibly to reliably detect the content of the frames. We always consider such - // elements as non-tabbable. - return false; - } - - // In iOS, the browser only considers some specific elements as tabbable. - if (isIos && !$mdUtil.isPotentiallyTabbableIOS(element)) { - return false; - } - - if (nodeName === 'audio') { - // Audio elements without controls enabled are never tabbable, regardless - // of the tabindex attribute explicitly being set. - if (!element.hasAttribute('controls')) { - return false; - } - // Audio elements with controls are by default tabbable unless the - // tabindex attribute is set to `-1` explicitly. - return tabIndexValue !== -1; - } - - if (nodeName === 'video') { - // For all video elements, if the tabindex attribute is set to `-1`, the video - // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex` - // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The - // tabindex attribute is the source of truth here. - if (tabIndexValue === -1) { - return false; - } - // If the tabindex is explicitly set, and not `-1` (as per check before), the - // video element is always tabbable (regardless of whether it has controls or not). - if (tabIndexValue !== null) { - return true; - } - // Otherwise (when no explicit tabindex is set), a video is only tabbable if it - // has controls enabled. Firefox is special as videos are always tabbable regardless - // of whether there are controls or not. - return isFirefox || element.hasAttribute('controls'); - } - - return element.tabIndex >= 0; - }, - - /** - * Gets whether an element can be focused by the user. - * @param {HTMLElement} element Element to be checked. - * @returns {boolean} Whether the element is focusable. - */ - isFocusable: function(element) { - // Perform checks in order of left to most expensive. - // Again, naive approach that does not capture many edge cases and browser quirks. - return $mdUtil.isPotentiallyFocusable(element) && !$mdUtil.isDisabled(element) && - $mdUtil.isVisible(element); - }, - - /** - * Gets whether an element is potentially focusable without taking current visible/disabled - * state into account. - * @param {HTMLElement} element - * @returns {boolean} - */ - isPotentiallyFocusable: function(element) { - // Inputs are potentially focusable *unless* they're type="hidden". - if ($mdUtil.isHiddenInput(element)) { - return false; - } - - return $mdUtil.isNativeFormElement(element) || - $mdUtil.isAnchorWithHref(element) || - element.hasAttribute('contenteditable') || - $mdUtil.hasValidTabIndex(element); - }, - - /** - * Checks whether the specified element is potentially tabbable on iOS. - * @param {HTMLElement} element - * @returns {boolean} - */ - isPotentiallyTabbableIOS: function(element) { - var nodeName = element.nodeName.toLowerCase(); - var inputType = nodeName === 'input' && element.type; - - return inputType === 'text' - || inputType === 'password' - || nodeName === 'select' - || nodeName === 'textarea'; - }, - - /** - * Returns the parsed tabindex from the element attributes instead of returning the - * evaluated tabindex from the browsers defaults. - * @param {HTMLElement} element - * @returns {null|number} - */ - getTabIndexValue: function(element) { - if (!$mdUtil.hasValidTabIndex(element)) { - return null; - } - - // See browser issue in Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054 - var tabIndex = parseInt(element.getAttribute('tabindex') || '', 10); - - return isNaN(tabIndex) ? -1 : tabIndex; - }, - - /** - * Gets whether an element has a valid tabindex. - * @param {HTMLElement} element - * @returns {boolean} - */ - hasValidTabIndex: function(element) { - if (!element.hasAttribute('tabindex') || element.tabIndex === undefined) { - return false; - } - - var tabIndex = element.getAttribute('tabindex'); - - // IE11 parses tabindex="" as the value "-32768" - if (tabIndex == '-32768') { - return false; - } - - return !!(tabIndex && !isNaN(parseInt(tabIndex, 10))); - }, - - /** - * Checks whether the specified element has any geometry / rectangles. - * @param {HTMLElement} element - * @returns {boolean} - */ - hasGeometry: function(element) { - // Use logic from jQuery to check for an invisible element. - // See https://github.com/jquery/jquery/blob/8969732518470a7f8e654d5bc5be0b0076cb0b87/src/css/hiddenVisibleSelectors.js#L9 - return !!(element.offsetWidth || element.offsetHeight || - (typeof element.getClientRects === 'function' && element.getClientRects().length)); - }, - - /** - * Returns the frame element from a window object. Since browsers like MS Edge throw errors if - * the frameElement property is being accessed from a different host address, this property - * should be accessed carefully. - * @param {Window} window - * @returns {null|HTMLElement} - */ - getFrameElement: function(window) { - try { - return window.frameElement; - } catch (error) { - return null; - } - }, - - /** - * Gets the parent window of a DOM node with regards of being inside of an iframe. - * @param {HTMLElement} node - * @returns {Window} - */ - getWindow: function(node) { - // ownerDocument is null if `node` itself *is* a document. - return node.ownerDocument && node.ownerDocument.defaultView || window; - }, - - /** - * Gets whether an element's - * @param {Node} element - * @returns {boolean} - */ - isNativeFormElement: function(element) { - var nodeName = element.nodeName.toLowerCase(); - return nodeName === 'input' || - nodeName === 'select' || - nodeName === 'button' || - nodeName === 'textarea'; - }, - - /** - * Gets whether an element is an ``. - * @param {HTMLElement} element - * @returns {boolean} - */ - isHiddenInput: function(element) { - return $mdUtil.isInputElement(element) && element.type == 'hidden'; - }, - - /** - * Gets whether an element is an anchor that has an href attribute. - * @param {HTMLElement} element - * @returns {boolean} - */ - isAnchorWithHref: function(element) { - return $mdUtil.isAnchorElement(element) && element.hasAttribute('href'); - }, - - /** - * Gets whether an element is an input element. - * @param {HTMLElement} element - * @returns {boolean} - */ - isInputElement: function(element) { - return element.nodeName.toLowerCase() == 'input'; - }, - - /** - * Gets whether an element is an anchor element. - * @param {HTMLElement} element - * @returns {boolean} - */ - isAnchorElement: function(element) { - return element.nodeName.toLowerCase() == 'a'; - }, - - /********************************************************************************************** - * The following two functions were sourced from - * https://github.com/angular/components/blob/3c37e4b1c1cb74a3d0a90d173240fc730d21d9d4/src/cdk/a11y/focus-trap/focus-trap.ts#L268-L311 - **********************************************************************************************/ - - /** - * Get the first tabbable element from a DOM subtree (inclusive). - * @param {HTMLElement} root - * @returns {HTMLElement|null} - */ - getFirstTabbableElement: function(root) { - if ($mdUtil.isFocusable(root) && $mdUtil.isTabbable(root)) { - return root; - } - - // Iterate in DOM order. Note that IE doesn't have `children` for SVG so we fall - // back to `childNodes` which includes text nodes, comments etc. - var children = root.children || root.childNodes; - - for (var i = 0; i < children.length; i++) { - var tabbableChild = children[i].nodeType === $document[0].ELEMENT_NODE ? - $mdUtil.getFirstTabbableElement(children[i]) : null; - - if (tabbableChild) { - return tabbableChild; - } - } - - return null; - }, - - /** - * Get the last tabbable element from a DOM subtree (inclusive). - * @param {HTMLElement} root - * @returns {HTMLElement|null} - */ - getLastTabbableElement: function(root) { - if ($mdUtil.isFocusable(root) && $mdUtil.isTabbable(root)) { - return root; - } - - // Iterate in reverse DOM order. - var children = root.children || root.childNodes; - - for (var i = children.length - 1; i >= 0; i--) { - var tabbableChild = children[i].nodeType === $document[0].ELEMENT_NODE ? - $mdUtil.getLastTabbableElement(children[i]) : null; - - if (tabbableChild) { - return tabbableChild; - } - } - - return null; - } - }; - - // Instantiate other namespace utility methods - - $mdUtil.dom.animator = $$mdAnimate($mdUtil); - - return $mdUtil; - - function getNode(el) { - return el[0] || el; - } -} - -/** - * Since removing jQuery from the demos, some code that uses `element.focus()` is broken. - * We need to add `element.focus()`, because it's testable unlike `element[0].focus`. - */ -angular.element.prototype.focus = angular.element.prototype.focus || function() { - if (this.length) { - this[0].focus(); - } - return this; -}; - -angular.element.prototype.blur = angular.element.prototype.blur || function() { - if (this.length) { - this[0].blur(); - } - return this; -}; - -})(); -(function(){ -"use strict"; - -// Polyfill angular < 1.4 (provide $animateCss) -angular - .module('material.core') - .factory('$$mdAnimate', ["$q", "$timeout", "$mdConstant", "$animateCss", function($q, $timeout, $mdConstant, $animateCss) { - // Since $$mdAnimate is injected into $mdUtil... use a wrapper function - // to subsequently inject $mdUtil as an argument to the AnimateDomUtils - return function($mdUtil) { - return AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss); - }; - }]); - -/** - * Factory function that requires special injections - */ -function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { - var self; - return self = { - translate3d : function(target, from, to, options) { - return $animateCss(target, { - from: from, - to: to, - addClass: options.transitionInClass, - removeClass: options.transitionOutClass, - duration: options.duration - }) - .start() - .then(function() { - // Resolve with reverser function... - return reverseTranslate; - }); - - /** - * Specific reversal of the request translate animation above... - */ - function reverseTranslate (newFrom) { - return $animateCss(target, { - to: newFrom || from, - addClass: options.transitionOutClass, - removeClass: options.transitionInClass, - duration: options.duration - }).start(); - } - }, - - /** - * Listen for transitionEnd event (with optional timeout) - * Announce completion or failure via promise handlers - */ - waitTransitionEnd: function (element, opts) { - var TIMEOUT = 3000; // fallback is 3 secs - - return $q(function(resolve, reject){ - opts = opts || { }; - - // If there is no transition is found, resolve immediately - // - // NOTE: using $mdUtil.nextTick() causes delays/issues - if (noTransitionFound(opts.cachedTransitionStyles)) { - TIMEOUT = 0; - } - - var timer = $timeout(finished, opts.timeout || TIMEOUT); - element.on($mdConstant.CSS.TRANSITIONEND, finished); - - /** - * Upon timeout or transitionEnd, reject or resolve (respectively) this promise. - * NOTE: Make sure this transitionEnd didn't bubble up from a child - */ - function finished(ev) { - if (ev && ev.target !== element[0]) return; - - if (ev) $timeout.cancel(timer); - element.off($mdConstant.CSS.TRANSITIONEND, finished); - - // Never reject since ngAnimate may cause timeouts due missed transitionEnd events - resolve(); - } - - /** - * Checks whether or not there is a transition. - * - * @param styles The cached styles to use for the calculation. If null, getComputedStyle() - * will be used. - * - * @returns {boolean} True if there is no transition/duration; false otherwise. - */ - function noTransitionFound(styles) { - styles = styles || window.getComputedStyle(element[0]); - - return styles.transitionDuration === '0s' || - (!styles.transition && !styles.transitionProperty); - } - }); - }, - - calculateTransformValues: function (element, originator) { - var origin = originator.element; - var bounds = originator.bounds; - - if (origin || bounds) { - var originBnds = origin ? self.clientRect(origin) || currentBounds() : self.copyRect(bounds); - var dialogRect = self.copyRect(element[0].getBoundingClientRect()); - var dialogCenterPt = self.centerPointFor(dialogRect); - var originCenterPt = self.centerPointFor(originBnds); - - return { - centerX: originCenterPt.x - dialogCenterPt.x, - centerY: originCenterPt.y - dialogCenterPt.y, - scaleX: Math.round(100 * Math.min(0.5, originBnds.width / dialogRect.width)) / 100, - scaleY: Math.round(100 * Math.min(0.5, originBnds.height / dialogRect.height)) / 100 - }; - } - return {centerX: 0, centerY: 0, scaleX: 0.5, scaleY: 0.5}; - - /** - * This is a fallback if the origin information is no longer valid, then the - * origin bounds simply becomes the current bounds for the dialogContainer's parent. - * @returns {null|DOMRect} - */ - function currentBounds() { - var container = element ? element.parent() : null; - var parent = container ? container.parent() : null; - - return parent ? self.clientRect(parent) : null; - } - }, - - /** - * Calculate the zoom transform from dialog to origin. - * - * We use this to set the dialog position immediately; - * then the md-transition-in actually translates back to - * `translate3d(0,0,0) scale(1.0)`... - * - * NOTE: all values are rounded to the nearest integer - */ - calculateZoomToOrigin: function (element, originator) { - var zoomTemplate = "translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )"; - var buildZoom = angular.bind(null, $mdUtil.supplant, zoomTemplate); - - return buildZoom(self.calculateTransformValues(element, originator)); - }, - - /** - * Calculate the slide transform from panel to origin. - * NOTE: all values are rounded to the nearest integer - */ - calculateSlideToOrigin: function (element, originator) { - var slideTemplate = "translate3d( {centerX}px, {centerY}px, 0 )"; - var buildSlide = angular.bind(null, $mdUtil.supplant, slideTemplate); - - return buildSlide(self.calculateTransformValues(element, originator)); - }, - - /** - * Enhance raw values to represent valid css stylings... - */ - toCss : function(raw) { - var css = { }; - var lookups = 'left top right bottom width height x y min-width min-height max-width max-height'; - - angular.forEach(raw, function(value,key) { - if (angular.isUndefined(value)) return; - - if (lookups.indexOf(key) >= 0) { - css[key] = value + 'px'; - } else { - switch (key) { - case 'transition': - convertToVendor(key, $mdConstant.CSS.TRANSITION, value); - break; - case 'transform': - convertToVendor(key, $mdConstant.CSS.TRANSFORM, value); - break; - case 'transformOrigin': - convertToVendor(key, $mdConstant.CSS.TRANSFORM_ORIGIN, value); - break; - case 'font-size': - css['font-size'] = value; // font sizes aren't always in px - break; - } - } - }); - - return css; - - function convertToVendor(key, vendor, value) { - angular.forEach(vendor.split(' '), function (key) { - css[key] = value; - }); - } - }, - - /** - * Convert the translate CSS value to key/value pair(s). - * @param {string} transform - * @param {boolean=} addTransition - * @param {string=} transition - * @return {Object} object containing CSS translate key/value pair(s) - */ - toTransformCss: function (transform, addTransition, transition) { - var css = {}; - angular.forEach($mdConstant.CSS.TRANSFORM.split(' '), function (key) { - css[key] = transform; - }); - - if (addTransition) { - transition = transition || "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important"; - css.transition = transition; - } - - return css; - }, - - /** - * Clone the Rect and calculate the height/width if needed. - * @param {DOMRect} source - * @param {DOMRect=} destination - * @returns {null|DOMRect} - */ - copyRect: function (source, destination) { - if (!source) return null; - - destination = destination || {}; - - angular.forEach('left top right bottom width height'.split(' '), function (key) { - destination[key] = Math.round(source[key]); - }); - - destination.width = destination.width || (destination.right - destination.left); - destination.height = destination.height || (destination.bottom - destination.top); - - return destination; - }, - - /** - * Calculate ClientRect of element; return null if hidden or zero size. - * @param {Element|string} element - * @returns {null|DOMRect} - */ - clientRect: function (element) { - var bounds = angular.element(element)[0].getBoundingClientRect(); - var isPositiveSizeClientRect = function (rect) { - return rect && (rect.width > 0) && (rect.height > 0); - }; - - // If the event origin element has zero size, it has probably been hidden. - return isPositiveSizeClientRect(bounds) ? self.copyRect(bounds) : null; - }, - - /** - * Calculate 'rounded' center point of Rect - * @param {DOMRect} targetRect - * @returns {{x: number, y: number}} - */ - centerPointFor: function (targetRect) { - return targetRect ? { - x: Math.round(targetRect.left + (targetRect.width / 2)), - y: Math.round(targetRect.top + (targetRect.height / 2)) - } : { x : 0, y : 0 }; - } - }; -} - - -})(); -(function(){ -"use strict"; - -if (angular.version.minor >= 4) { - angular.module('material.core.animate', []); -} else { -(function() { - "use strict"; - - var forEach = angular.forEach; - - var WEBKIT = angular.isDefined(document.documentElement.style.WebkitAppearance); - var TRANSITION_PROP = WEBKIT ? 'WebkitTransition' : 'transition'; - var ANIMATION_PROP = WEBKIT ? 'WebkitAnimation' : 'animation'; - var PREFIX = WEBKIT ? '-webkit-' : ''; - - var TRANSITION_EVENTS = (WEBKIT ? 'webkitTransitionEnd ' : '') + 'transitionend'; - var ANIMATION_EVENTS = (WEBKIT ? 'webkitAnimationEnd ' : '') + 'animationend'; - - var $$ForceReflowFactory = ['$document', function($document) { - return function() { - return $document[0].body.clientWidth + 1; - }; - }]; - - var $$rAFMutexFactory = ['$$rAF', function($$rAF) { - return function() { - var passed = false; - $$rAF(function() { - passed = true; - }); - return function(fn) { - passed ? fn() : $$rAF(fn); - }; - }; - }]; - - var $$AnimateRunnerFactory = ['$q', '$$rAFMutex', function($q, $$rAFMutex) { - var INITIAL_STATE = 0; - var DONE_PENDING_STATE = 1; - var DONE_COMPLETE_STATE = 2; - - function AnimateRunner(host) { - this.setHost(host); - - this._doneCallbacks = []; - this._runInAnimationFrame = $$rAFMutex(); - this._state = 0; - } - - AnimateRunner.prototype = { - setHost: function(host) { - this.host = host || {}; - }, - - done: function(fn) { - if (this._state === DONE_COMPLETE_STATE) { - fn(); - } else { - this._doneCallbacks.push(fn); - } - }, - - progress: angular.noop, - - getPromise: function() { - if (!this.promise) { - var self = this; - this.promise = $q(function(resolve, reject) { - self.done(function(status) { - status === false ? reject() : resolve(); - }); - }); - } - return this.promise; - }, - - then: function(resolveHandler, rejectHandler) { - return this.getPromise().then(resolveHandler, rejectHandler); - }, - - 'catch': function(handler) { - return this.getPromise()['catch'](handler); - }, - - 'finally': function(handler) { - return this.getPromise()['finally'](handler); - }, - - pause: function() { - if (this.host.pause) { - this.host.pause(); - } - }, - - resume: function() { - if (this.host.resume) { - this.host.resume(); - } - }, - - end: function() { - if (this.host.end) { - this.host.end(); - } - this._resolve(true); - }, - - cancel: function() { - if (this.host.cancel) { - this.host.cancel(); - } - this._resolve(false); - }, - - complete: function(response) { - var self = this; - if (self._state === INITIAL_STATE) { - self._state = DONE_PENDING_STATE; - self._runInAnimationFrame(function() { - self._resolve(response); - }); - } - }, - - _resolve: function(response) { - if (this._state !== DONE_COMPLETE_STATE) { - forEach(this._doneCallbacks, function(fn) { - fn(response); - }); - this._doneCallbacks.length = 0; - this._state = DONE_COMPLETE_STATE; - } - } - }; - - // Polyfill AnimateRunner.all which is used by input animations - AnimateRunner.all = function(runners, callback) { - var count = 0; - var status = true; - forEach(runners, function(runner) { - runner.done(onProgress); - }); - - function onProgress(response) { - status = status && response; - if (++count === runners.length) { - callback(status); - } - } - }; - - return AnimateRunner; - }]; - - angular - .module('material.core.animate', []) - .factory('$$forceReflow', $$ForceReflowFactory) - .factory('$$AnimateRunner', $$AnimateRunnerFactory) - .factory('$$rAFMutex', $$rAFMutexFactory) - .factory('$animateCss', ['$window', '$$rAF', '$$AnimateRunner', '$$forceReflow', '$$jqLite', '$timeout', '$animate', - function($window, $$rAF, $$AnimateRunner, $$forceReflow, $$jqLite, $timeout, $animate) { - - function init(element, options) { - - var temporaryStyles = []; - var node = getDomNode(element); - var areAnimationsAllowed = node && $animate.enabled(); - - var hasCompleteStyles = false; - var hasCompleteClasses = false; - - if (areAnimationsAllowed) { - if (options.transitionStyle) { - temporaryStyles.push([PREFIX + 'transition', options.transitionStyle]); - } - - if (options.keyframeStyle) { - temporaryStyles.push([PREFIX + 'animation', options.keyframeStyle]); - } - - if (options.delay) { - temporaryStyles.push([PREFIX + 'transition-delay', options.delay + 's']); - } - - if (options.duration) { - temporaryStyles.push([PREFIX + 'transition-duration', options.duration + 's']); - } - - hasCompleteStyles = options.keyframeStyle || - (options.to && (options.duration > 0 || options.transitionStyle)); - hasCompleteClasses = !!options.addClass || !!options.removeClass; - - blockTransition(element, true); - } - - var hasCompleteAnimation = areAnimationsAllowed && (hasCompleteStyles || hasCompleteClasses); - - applyAnimationFromStyles(element, options); - - var animationClosed = false; - var events, eventFn; - - return { - close: $window.close, - start: function() { - var runner = new $$AnimateRunner(); - waitUntilQuiet(function() { - blockTransition(element, false); - if (!hasCompleteAnimation) { - return close(); - } - - forEach(temporaryStyles, function(entry) { - var key = entry[0]; - var value = entry[1]; - node.style[camelCase(key)] = value; - }); - - applyClasses(element, options); - - var timings = computeTimings(element); - if (timings.duration === 0) { - return close(); - } - - var moreStyles = []; - - if (options.easing) { - if (timings.transitionDuration) { - moreStyles.push([PREFIX + 'transition-timing-function', options.easing]); - } - if (timings.animationDuration) { - moreStyles.push([PREFIX + 'animation-timing-function', options.easing]); - } - } - - if (options.delay && timings.animationDelay) { - moreStyles.push([PREFIX + 'animation-delay', options.delay + 's']); - } - - if (options.duration && timings.animationDuration) { - moreStyles.push([PREFIX + 'animation-duration', options.duration + 's']); - } - - forEach(moreStyles, function(entry) { - var key = entry[0]; - var value = entry[1]; - node.style[camelCase(key)] = value; - temporaryStyles.push(entry); - }); - - var maxDelay = timings.delay; - var maxDelayTime = maxDelay * 1000; - var maxDuration = timings.duration; - var maxDurationTime = maxDuration * 1000; - var startTime = Date.now(); - - events = []; - if (timings.transitionDuration) { - events.push(TRANSITION_EVENTS); - } - if (timings.animationDuration) { - events.push(ANIMATION_EVENTS); - } - events = events.join(' '); - eventFn = function(event) { - event.stopPropagation(); - var ev = event.originalEvent || event; - var timeStamp = ev.timeStamp || Date.now(); - var elapsedTime = parseFloat(ev.elapsedTime.toFixed(3)); - if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) { - close(); - } - }; - element.on(events, eventFn); - - applyAnimationToStyles(element, options); - - $timeout(close, maxDelayTime + maxDurationTime * 1.5, false); - }); - - return runner; - - function close() { - if (animationClosed) return; - animationClosed = true; - - if (events && eventFn) { - element.off(events, eventFn); - } - applyClasses(element, options); - applyAnimationStyles(element, options); - forEach(temporaryStyles, function(entry) { - node.style[camelCase(entry[0])] = ''; - }); - runner.complete(true); - return runner; - } - } - }; - } - - function applyClasses(element, options) { - if (options.addClass) { - $$jqLite.addClass(element, options.addClass); - options.addClass = null; - } - if (options.removeClass) { - $$jqLite.removeClass(element, options.removeClass); - options.removeClass = null; - } - } - - function computeTimings(element) { - var node = getDomNode(element); - var cs = $window.getComputedStyle(node); - var tdr = parseMaxTime(cs[prop('transitionDuration')]); - var adr = parseMaxTime(cs[prop('animationDuration')]); - var tdy = parseMaxTime(cs[prop('transitionDelay')]); - var ady = parseMaxTime(cs[prop('animationDelay')]); - - adr *= (parseInt(cs[prop('animationIterationCount')], 10) || 1); - var duration = Math.max(adr, tdr); - var delay = Math.max(ady, tdy); - - return { - duration: duration, - delay: delay, - animationDuration: adr, - transitionDuration: tdr, - animationDelay: ady, - transitionDelay: tdy - }; - - function prop(key) { - return WEBKIT ? 'Webkit' + key.charAt(0).toUpperCase() + key.substr(1) - : key; - } - } - - function parseMaxTime(str) { - var maxValue = 0; - var values = (str || "").split(/\s*,\s*/); - forEach(values, function(value) { - // it's always safe to consider only second values and omit `ms` values since - // getComputedStyle will always handle the conversion for us - if (value.charAt(value.length - 1) == 's') { - value = value.substring(0, value.length - 1); - } - value = parseFloat(value) || 0; - maxValue = maxValue ? Math.max(value, maxValue) : value; - }); - return maxValue; - } - - var cancelLastRAFRequest; - var rafWaitQueue = []; - function waitUntilQuiet(callback) { - if (cancelLastRAFRequest) { - cancelLastRAFRequest(); // cancels the request - } - rafWaitQueue.push(callback); - cancelLastRAFRequest = $$rAF(function() { - cancelLastRAFRequest = null; - - // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable. - // PLEASE EXAMINE THE `$$forceReflow` service to understand why. - var pageWidth = $$forceReflow(); - - // we use a for loop to ensure that if the queue is changed - // during this looping then it will consider new requests - for (var i = 0; i < rafWaitQueue.length; i++) { - rafWaitQueue[i](pageWidth); - } - rafWaitQueue.length = 0; - }); - } - - function applyAnimationStyles(element, options) { - applyAnimationFromStyles(element, options); - applyAnimationToStyles(element, options); - } - - function applyAnimationFromStyles(element, options) { - if (options.from) { - element.css(options.from); - options.from = null; - } - } - - function applyAnimationToStyles(element, options) { - if (options.to) { - element.css(options.to); - options.to = null; - } - } - - function getDomNode(element) { - for (var i = 0; i < element.length; i++) { - if (element[i].nodeType === 1) return element[i]; - } - } - - function blockTransition(element, bool) { - var node = getDomNode(element); - var key = camelCase(PREFIX + 'transition-delay'); - node.style[key] = bool ? '-9999s' : ''; - } - - return init; - }]); - - /** - * Older browsers [FF31] expect camelCase - * property keys. - * e.g. - * animation-duration --> animationDuration - */ - function camelCase(str) { - return str.replace(/-[a-z]/g, function(str) { - return str.charAt(1).toUpperCase(); - }); - } - -})(); - -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.core.aria - * @description - * Aria Expectations for AngularJS Material components. - */ -MdAriaService.$inject = ["$$rAF", "$log", "$window", "$interpolate"]; -angular - .module('material.core') - .provider('$mdAria', MdAriaProvider); - -/** - * @ngdoc service - * @name $mdAriaProvider - * @module material.core.aria - * - * @description - * - * Modify options of the `$mdAria` service, which will be used by most of the AngularJS Material - * components. - * - * You are able to disable `$mdAria` warnings, by using the following markup. - * - * - * app.config(function($mdAriaProvider) { - * // Globally disables all ARIA warnings. - * $mdAriaProvider.disableWarnings(); - * }); - * - * - */ -function MdAriaProvider() { - - var config = { - /** Whether we should show ARIA warnings in the console if labels are missing on the element */ - showWarnings: true - }; - - return { - disableWarnings: disableWarnings, - $get: ["$$rAF", "$log", "$window", "$interpolate", function($$rAF, $log, $window, $interpolate) { - return MdAriaService.apply(config, arguments); - }] - }; - - /** - * @ngdoc method - * @name $mdAriaProvider#disableWarnings - * @description Disables all ARIA warnings generated by AngularJS Material. - */ - function disableWarnings() { - config.showWarnings = false; - } -} - -/* - * @ngInject - */ -function MdAriaService($$rAF, $log, $window, $interpolate) { - - // Load the showWarnings option from the current context and store it inside of a scope variable, - // because the context will be probably lost in some function calls. - var showWarnings = this.showWarnings; - - return { - expect: expect, - expectAsync: expectAsync, - expectWithText: expectWithText, - expectWithoutText: expectWithoutText, - getText: getText, - hasAriaLabel: hasAriaLabel, - parentHasAriaLabel: parentHasAriaLabel - }; - - /** - * Check if expected attribute has been specified on the target element or child - * @param {string|JQLite} element - * @param {string} attrName - * @param {string=} defaultValue What to set the attr to if no value is found - */ - function expect(element, attrName, defaultValue) { - - var node = angular.element(element)[0] || element; - - // if node exists and neither it nor its children have the attribute - if (node && - ((!node.hasAttribute(attrName) || - node.getAttribute(attrName).length === 0) && - !childHasAttribute(node, attrName))) { - - defaultValue = angular.isString(defaultValue) ? defaultValue.trim() : ''; - if (defaultValue.length) { - element.attr(attrName, defaultValue); - } else if (showWarnings) { - $log.warn('ARIA: Attribute "', attrName, '", required for accessibility, is missing on node:', node); - } - - } - } - - function expectAsync(element, attrName, defaultValueGetter) { - // Problem: when retrieving the element's contents synchronously to find the label, - // the text may not be defined yet in the case of a binding. - // There is a higher chance that a binding will be defined if we wait one frame. - $$rAF(function() { - expect(element, attrName, defaultValueGetter()); - }); - } - - function expectWithText(element, attrName) { - var content = getText(element) || ""; - var hasBinding = content.indexOf($interpolate.startSymbol()) > -1; - - if (hasBinding) { - expectAsync(element, attrName, function() { - return getText(element); - }); - } else { - expect(element, attrName, content); - } - } - - function expectWithoutText(element, attrName) { - var content = getText(element); - var hasBinding = content.indexOf($interpolate.startSymbol()) > -1; - - if (!hasBinding && !content) { - expect(element, attrName, content); - } - } - - /** - * @param {Element|JQLite} element - * @returns {string} - */ - function getText(element) { - element = element[0] || element; - var walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT, null, false); - var text = ''; - - var node; - while (node = walker.nextNode()) { - if (!isAriaHiddenNode(node)) { - text += node.textContent; - } - } - - return text.trim() || ''; - - /** - * @param {Node} node - * @returns {boolean} - */ - function isAriaHiddenNode(node) { - while (node.parentNode && (node = node.parentNode) !== element) { - if (node.getAttribute && node.getAttribute('aria-hidden') === 'true') { - return true; - } - } - } - } - - function childHasAttribute(node, attrName) { - var hasChildren = node.hasChildNodes(), - hasAttr = false; - - function isHidden(el) { - var style = el.currentStyle ? el.currentStyle : $window.getComputedStyle(el); - return (style.display === 'none'); - } - - if (hasChildren) { - var children = node.childNodes; - for (var i=0; i < children.length; i++) { - var child = children[i]; - if (child.nodeType === 1 && child.hasAttribute(attrName)) { - if (!isHidden(child)) { - hasAttr = true; - } - } - } - } - return hasAttr; - } - - /** - * Check if expected element has aria label attribute - * @param element - */ - function hasAriaLabel(element) { - var node = angular.element(element)[0] || element; - - /* Check if compatible node type (ie: not HTML Document node) */ - if (!node.hasAttribute) { - return false; - } - - /* Check label or description attributes */ - return node.hasAttribute('aria-label') || node.hasAttribute('aria-labelledby') || node.hasAttribute('aria-describedby'); - } - - /** - * Check if expected element's parent has aria label attribute and has valid role and tagName - * @param {string|JQLite|Node & ParentNode} element - * @param {number=} level Number of levels deep search should be performed - */ - function parentHasAriaLabel(element, level) { - level = level || 1; - var node = angular.element(element)[0] || element; - if (!node.parentNode) { - return false; - } - if (performCheck(node.parentNode)) { - return true; - } - level--; - if (level) { - return parentHasAriaLabel(node.parentNode, level); - } - return false; - - function performCheck(parentNode) { - if (!hasAriaLabel(parentNode)) { - return false; - } - /* Perform role block-list check */ - if (parentNode.hasAttribute('role')) { - switch (parentNode.getAttribute('role').toLowerCase()) { - case 'command': - case 'definition': - case 'directory': - case 'grid': - case 'list': - case 'listitem': - case 'log': - case 'marquee': - case 'menu': - case 'menubar': - case 'note': - case 'presentation': - case 'separator': - case 'scrollbar': - case 'status': - case 'tablist': - return false; - } - } - /* Perform tagName block-list check */ - switch (parentNode.tagName.toLowerCase()) { - case 'abbr': - case 'acronym': - case 'address': - case 'applet': - case 'audio': - case 'b': - case 'bdi': - case 'bdo': - case 'big': - case 'blockquote': - case 'br': - case 'canvas': - case 'caption': - case 'center': - case 'cite': - case 'code': - case 'col': - case 'data': - case 'dd': - case 'del': - case 'dfn': - case 'dir': - case 'div': - case 'dl': - case 'em': - case 'embed': - case 'fieldset': - case 'figcaption': - case 'font': - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - case 'hgroup': - case 'html': - case 'i': - case 'ins': - case 'isindex': - case 'kbd': - case 'keygen': - case 'label': - case 'legend': - case 'li': - case 'map': - case 'mark': - case 'menu': - case 'object': - case 'ol': - case 'output': - case 'pre': - case 'presentation': - case 'q': - case 'rt': - case 'ruby': - case 'samp': - case 'small': - case 'source': - case 'span': - case 'status': - case 'strike': - case 'strong': - case 'sub': - case 'sup': - case 'svg': - case 'tbody': - case 'td': - case 'th': - case 'thead': - case 'time': - case 'tr': - case 'track': - case 'tt': - case 'ul': - case 'var': - return false; - } - return true; - } - } -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.core.compiler - * @description - * AngularJS Material template and element compiler. - */ -angular - .module('material.core') - .provider('$mdCompiler', MdCompilerProvider); - -MdCompilerProvider.$inject = ['$compileProvider']; -function MdCompilerProvider() { - - this.$get = ["$q", "$templateRequest", "$injector", "$compile", "$controller", - function($q, $templateRequest, $injector, $compile, $controller) { - return new MdCompilerService($q, $templateRequest, $injector, $compile, $controller); - }]; - - /** - * @ngdoc service - * @name $mdCompiler - * @module material.core.compiler - * @description - * The $mdCompiler service is an abstraction of AngularJS's compiler, that allows developers - * to compile an element with options like in a Directive Definition Object. - * - * > The compiler powers a lot of components inside of AngularJS Material. - * > Like the `$mdPanel` or `$mdDialog` services. - * - * @usage - * - * Basic Usage with a template - * - * - * $mdCompiler.compile({ - * templateUrl: 'modal.html', - * controller: 'ModalCtrl', - * locals: { - * modal: myModalInstance; - * } - * }).then(function (compileData) { - * compileData.element; // Compiled DOM element - * compileData.link(myScope); // Instantiate controller and link element to scope. - * }); - * - * - * Example with a content element - * - * - * - * // Create a virtual element and link it manually. - * // The compiler doesn't need to recompile the element each time. - * var myElement = $compile('Test')(myScope); - * - * $mdCompiler.compile({ - * contentElement: myElement - * }).then(function (compileData) { - * compileData.element // Content Element (same as above) - * compileData.link // This does nothing when using a contentElement. - * }); - * - * - * > Content Element is a significant performance improvement when the developer already knows - * > that the compiled element will be always the same and the scope will not change either. - * - * The `contentElement` option also supports DOM elements which will be temporary removed and - * restored at its old position. - * - * - * var domElement = document.querySelector('#myElement'); - * - * $mdCompiler.compile({ - * contentElement: myElement - * }).then(function (compileData) { - * compileData.element // Content Element (same as above) - * compileData.link // This does nothing when using a contentElement. - * }); - * - * - * The `$mdCompiler` can also query for the element in the DOM itself. - * - * - * $mdCompiler.compile({ - * contentElement: '#myElement' - * }).then(function (compileData) { - * compileData.element // Content Element (same as above) - * compileData.link // This does nothing when using a contentElement. - * }); - * - * - */ - function MdCompilerService($q, $templateRequest, $injector, $compile, $controller) { - - /** - * @private @const - * @type {!IQService} - */ - this.$q = $q; - - /** - * @private @const - * @type {!ITemplateRequestService} - */ - this.$templateRequest = $templateRequest; - - /** - * @private @const - * @type {!IInjectorService} - */ - this.$injector = $injector; - - /** - * @private @const - * @type{!ICompileService} - */ - this.$compile = $compile; - - /** - * @private @const - * @type {!IControllerService} - */ - this.$controller = $controller; - } - - /** - * @ngdoc method - * @name $mdCompiler#compile - * @description - * - * A method to compile a HTML template with the AngularJS compiler. - * The `$mdCompiler` is wrapper around the AngularJS compiler and provides extra functionality - * like controller instantiation or async resolves. - * - * @param {!Object} options An options object, with the following properties: - * - * - `controller` - `{string|function}` Controller fn that should be associated with - * newly created scope or the name of a registered controller if passed as a string. - * - `controllerAs` - `{string=}` A controller alias name. If present the controller will be - * published to scope under the `controllerAs` name. - * - `contentElement` - `{string|Element}`: Instead of using a template, which will be - * compiled each time, you can also use a DOM element.
    - * - `template` - `{string=}` An html template as a string. - * - `templateUrl` - `{string=}` A path to an html template. - * - `transformTemplate` - `{function(template)=}` A function which transforms the template after - * it is loaded. It will be given the template string as a parameter, and should - * return a a new string representing the transformed template. - * - `resolve` - `{Object.=}` - An optional map of dependencies which should - * be injected into the controller. If any of these dependencies are promises, the compiler - * will wait for them all to be resolved, or if one is rejected before the controller is - * instantiated `compile()` will fail.. - * * `key` - `{string}`: a name of a dependency to be injected into the controller. - * * `factory` - `{string|function}`: If `string` then it is an alias for a service. - * Otherwise if function, then it is injected and the return value is treated as the - * dependency. If the result is a promise, it is resolved before its value is - * injected into the controller. - * - * @returns {Q.Promise<{element: JQLite, link: Function, locals: Object, cleanup: any, - * controller: Object=}>} promise A promise, which will be resolved with a `compileData` object. - * `compileData` has the following properties: - * - * - `element` - `{JQLite}`: an uncompiled element matching the provided template. - * - `link` - `{function(scope)}`: A link function, which, when called, will compile - * the element and instantiate the provided controller (if given). - * - `locals` - `{Object}`: The locals which will be passed into the controller once `link` is - * called. If `bindToController` is true, they will be copied to the ctrl instead - */ - MdCompilerService.prototype.compile = function(options) { - if (options.contentElement) { - return this._prepareContentElement(options); - } else { - return this._compileTemplate(options); - } - }; - - /** - * Instead of compiling any template, the compiler just fetches an existing HTML element from the - * DOM and provides a restore function to put the element back it old DOM position. - * @param {!Object} options Options to be used for the compiler. - * @returns {Q.Promise<{element: JQLite, link: Function, locals: Object, cleanup: any}>} - */ - MdCompilerService.prototype._prepareContentElement = function(options) { - - var contentElement = this._fetchContentElement(options); - - return this.$q.resolve({ - element: contentElement.element, - cleanup: contentElement.restore, - locals: {}, - link: function() { - return contentElement.element; - } - }); - - }; - - /** - * Compiles a template by considering all options and waiting for all resolves to be ready. - * @param {!Object} options Compile options - * @returns {!Q.Promise<{element: JQLite, link: Function, locals: Object, cleanup: any}>} Compile - * data with link function. - */ - MdCompilerService.prototype._compileTemplate = function(options) { - - var self = this; - var templateUrl = options.templateUrl; - var template = options.template || ''; - var resolve = angular.extend({}, options.resolve); - var locals = angular.extend({}, options.locals); - var transformTemplate = options.transformTemplate || angular.identity; - - // Take resolve values and invoke them. - // Resolves can either be a string (value: 'MyRegisteredAngularConst'), - // or an invokable 'factory' of sorts: (value: function ValueGetter($dependency) {}) - angular.forEach(resolve, function(value, key) { - if (angular.isString(value)) { - resolve[key] = self.$injector.get(value); - } else { - resolve[key] = self.$injector.invoke(value); - } - }); - - // Add the locals, which are just straight values to inject - // eg locals: { three: 3 }, will inject three into the controller - angular.extend(resolve, locals); - - if (templateUrl) { - resolve.$$ngTemplate = this.$templateRequest(templateUrl); - } else { - resolve.$$ngTemplate = this.$q.when(template); - } - - - // Wait for all the resolves to finish if they are promises - return this.$q.all(resolve).then(function(locals) { - - var template = transformTemplate(locals.$$ngTemplate, options); - var element = options.element || angular.element('
    ').html(template.trim()).contents(); - - return self._compileElement(locals, element, options); - }); - - }; - - /** - * Method to compile an element with the given options. - * @param {!Object} locals Locals to be injected to the controller if present - * @param {!JQLite} element Element to be compiled and linked - * @param {!Object} options Options to be used for linking. - * @returns {!{element: JQLite, link: Function, locals: Object, cleanup: any, controller: Object}} Compile data with link function. - */ - MdCompilerService.prototype._compileElement = function(locals, element, options) { - var self = this; - var ngLinkFn = this.$compile(element); - - var compileData = { - element: element, - cleanup: element.remove.bind(element), - locals: locals, - link: linkFn - }; - - function linkFn(scope) { - locals.$scope = scope; - - // Instantiate controller if the developer provided one. - if (options.controller) { - - var injectLocals = angular.extend({}, locals, { - $element: element - }); - - // Create the specified controller instance. - var ctrl = self._createController(options, injectLocals, locals); - - // Registering extra $destroy listeners should be avoided. - // Only register the listener if the controller implements a $onDestroy hook. - if (angular.isFunction(ctrl.$onDestroy)) { - scope.$on('$destroy', function() { - // Call the $onDestroy hook if it's present on the controller. - angular.isFunction(ctrl.$onDestroy) && ctrl.$onDestroy(); - }); - } - - // Unique identifier for AngularJS Route ngView controllers. - element.data('$ngControllerController', ctrl); - element.children().data('$ngControllerController', ctrl); - - // Expose the instantiated controller to the compile data - compileData.controller = ctrl; - } - - // Invoke the AngularJS $compile link function. - return ngLinkFn(scope); - } - - return compileData; - - }; - - /** - * Creates and instantiates a new controller with the specified options. - * @param {!Object} options Options that include the controller function or string. - * @param {!Object} injectLocals Locals to to be provided in the controller DI. - * @param {!Object} locals Locals to be injected to the controller. - * @returns {!Object} Created controller instance. - */ - MdCompilerService.prototype._createController = function(options, injectLocals, locals) { - var ctrl = this.$controller(options.controller, injectLocals); - - if (options.bindToController) { - angular.extend(ctrl, locals); - } - - if (options.controllerAs) { - injectLocals.$scope[options.controllerAs] = ctrl; - } - - // Call the $onInit hook if it's present on the controller. - angular.isFunction(ctrl.$onInit) && ctrl.$onInit(); - - return ctrl; - }; - - /** - * Fetches an element removing it from the DOM and using it temporary for the compiler. - * Elements which were fetched will be restored after use. - * @param {!Object} options Options to be used for the compilation. - * @returns {{element: !JQLite, restore: !function}} - */ - MdCompilerService.prototype._fetchContentElement = function(options) { - var contentEl = options.contentElement; - var restoreFn; - - if (angular.isString(contentEl)) { - contentEl = document.querySelector(contentEl); - restoreFn = createRestoreFn(contentEl); - } else { - contentEl = contentEl[0] || contentEl; - - // When the element is visible in the DOM, then we restore it at close of the dialog. - // Otherwise it will be removed from the DOM after close. - if (document.contains(contentEl)) { - restoreFn = createRestoreFn(contentEl); - } else { - restoreFn = function() { - if (contentEl.parentNode) { - contentEl.parentNode.removeChild(contentEl); - } - }; - } - } - - return { - element: angular.element(contentEl), - restore: restoreFn - }; - - function createRestoreFn(element) { - var parent = element.parentNode; - var nextSibling = element.nextElementSibling; - - return function() { - if (!nextSibling) { - // When the element didn't had any sibling, then it can be simply appended to the - // parent, because it plays no role, which index it had before. - parent.appendChild(element); - } else { - // When the element had a sibling, which marks the previous position of the element - // in the DOM, we insert it correctly before the sibling, to have the same index as - // before. - parent.insertBefore(element, nextSibling); - } - }; - } - }; -} - - -})(); -(function(){ -"use strict"; - - -MdGesture.$inject = ["$$MdGestureHandler", "$$rAF", "$timeout", "$mdUtil"]; -attachToDocument.$inject = ["$mdGesture", "$$MdGestureHandler", "$mdUtil"];var HANDLERS = {}; - -/** - * The state of the current 'pointer'. The pointer represents the state of the current touch. - * It contains normalized x and y coordinates from DOM events, - * as well as other information abstracted from the DOM. - */ -var pointer, lastPointer, maxClickDistance = 6; -var forceSkipClickHijack = false, disableAllGestures = false; - -/** - * The position of the most recent click if that click was on a label element. - * @type {{x: number, y: number}|null} - */ -var lastLabelClickPos = null; - -/** - * Used to attach event listeners once when multiple ng-apps are running. - * @type {boolean} - */ -var isInitialized = false; - -/** - * @ngdoc module - * @name material.core.gestures - * @description - * AngularJS Material Gesture handling for touch devices. - * This module replaced the usage of the HammerJS library. - */ -angular - .module('material.core.gestures', []) - .provider('$mdGesture', MdGestureProvider) - .factory('$$MdGestureHandler', MdGestureHandler) - .run(attachToDocument); - -/** - * @ngdoc service - * @name $mdGestureProvider - * @module material.core.gestures - * - * @description - * In some scenarios on mobile devices (without jQuery), the click events should NOT be hijacked. - * `$mdGestureProvider` is used to configure the Gesture module to ignore or skip click hijacking - * on mobile devices. - * - * You can also change the max click distance, `6px` by default, if you have issues on some touch - * screens. - * - * - * app.config(function($mdGestureProvider) { - * - * // For mobile devices without jQuery loaded, do not - * // intercept click events during the capture phase. - * $mdGestureProvider.skipClickHijack(); - * - * // If hijacking clicks, you may want to change the default click distance - * $mdGestureProvider.setMaxClickDistance(12); - * }); - * - * - */ -function MdGestureProvider() { } - -MdGestureProvider.prototype = { - - /** - * @ngdoc method - * @name $mdGestureProvider#disableAll - * - * @description - * Disable all gesture detection. This can be beneficial to application performance - * and memory usage. - */ - disableAll: function () { - disableAllGestures = true; - }, - - // Publish access to setter to configure a variable BEFORE the - // $mdGesture service is instantiated... - /** - * @ngdoc method - * @name $mdGestureProvider#skipClickHijack - * - * @description - * Tell the AngularJS Material Gesture module to skip (or ignore) click hijacking on mobile devices. - */ - skipClickHijack: function() { - return forceSkipClickHijack = true; - }, - - /** - * @ngdoc method - * @name $mdGestureProvider#setMaxClickDistance - * @param clickDistance {string} Distance in pixels. I.e. `12px`. - * @description - * Set the max distance from the origin of the touch event to trigger touch handlers. - */ - setMaxClickDistance: function(clickDistance) { - maxClickDistance = parseInt(clickDistance); - }, - - /** - * $get is used to build an instance of $mdGesture - * @ngInject - */ - $get : ["$$MdGestureHandler", "$$rAF", "$timeout", "$mdUtil", function($$MdGestureHandler, $$rAF, $timeout, $mdUtil) { - return new MdGesture($$MdGestureHandler, $$rAF, $timeout, $mdUtil); - }] -}; - - - -/** - * MdGesture factory construction function - * @ngInject - */ -function MdGesture($$MdGestureHandler, $$rAF, $timeout, $mdUtil) { - var touchActionProperty = $mdUtil.getTouchAction(); - var hasJQuery = (typeof __webpack_provided_window_dot_jQuery !== 'undefined') && (angular.element === __webpack_provided_window_dot_jQuery); - - var self = { - handler: addHandler, - register: register, - isAndroid: $mdUtil.isAndroid, - isIos: $mdUtil.isIos, - // On mobile w/out jQuery, we normally intercept clicks. Should we skip that? - isHijackingClicks: ($mdUtil.isIos || $mdUtil.isAndroid) && !hasJQuery && !forceSkipClickHijack - }; - - if (self.isHijackingClicks) { - self.handler('click', { - options: { - maxDistance: maxClickDistance - }, - onEnd: checkDistanceAndEmit('click') - }); - - self.handler('focus', { - options: { - maxDistance: maxClickDistance - }, - onEnd: function(ev, pointer) { - if (pointer.distance < this.state.options.maxDistance && canFocus(ev.target)) { - this.dispatchEvent(ev, 'focus', pointer); - ev.target.focus(); - } - } - }); - - self.handler('mouseup', { - options: { - maxDistance: maxClickDistance - }, - onEnd: checkDistanceAndEmit('mouseup') - }); - - self.handler('mousedown', { - onStart: function(ev) { - this.dispatchEvent(ev, 'mousedown'); - } - }); - } - - function checkDistanceAndEmit(eventName) { - return function(ev, pointer) { - if (pointer.distance < this.state.options.maxDistance) { - this.dispatchEvent(ev, eventName, pointer); - } - }; - } - - /** - * Register an element to listen for a handler. - * This allows an element to override the default options for a handler. - * Additionally, some handlers like drag and hold only dispatch events if - * the domEvent happens inside an element that's registered to listen for these events. - * - * @see GestureHandler for how overriding of default options works. - * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horizontal: false }) - */ - function register(element, handlerName, options) { - var handler = HANDLERS[handlerName.replace(/^\$md./, '')]; - if (!handler) { - throw new Error('Failed to register element with handler ' + handlerName + '. ' + - 'Available handlers: ' + Object.keys(HANDLERS).join(', ')); - } - return handler.registerElement(element, options); - } - - /* - * add a handler to $mdGesture. see below. - */ - function addHandler(name, definition) { - var handler = new $$MdGestureHandler(name); - angular.extend(handler, definition); - HANDLERS[name] = handler; - - return self; - } - - /** - * Register handlers. These listen to touch/start/move events, interpret them, - * and dispatch gesture events depending on options & conditions. These are all - * instances of GestureHandler. - * @see GestureHandler - */ - return self - /* - * The press handler dispatches an event on touchdown/touchend. - * It's a simple abstraction of touch/mouse/pointer start and end. - */ - .handler('press', { - onStart: function (ev, pointer) { - this.dispatchEvent(ev, '$md.pressdown'); - }, - onEnd: function (ev, pointer) { - this.dispatchEvent(ev, '$md.pressup'); - } - }) - - /* - * The hold handler dispatches an event if the user keeps their finger within - * the same area for ms. - * The hold handler will only run if a parent of the touch target is registered - * to listen for hold events through $mdGesture.register() - */ - .handler('hold', { - options: { - maxDistance: 6, - delay: 500 - }, - onCancel: function () { - $timeout.cancel(this.state.timeout); - }, - onStart: function (ev, pointer) { - // For hold, require a parent to be registered with $mdGesture.register() - // Because we prevent scroll events, this is necessary. - if (!this.state.registeredParent) return this.cancel(); - - this.state.pos = {x: pointer.x, y: pointer.y}; - this.state.timeout = $timeout(angular.bind(this, function holdDelayFn() { - this.dispatchEvent(ev, '$md.hold'); - this.cancel(); // we're done! - }), this.state.options.delay, false); - }, - onMove: function (ev, pointer) { - // Don't scroll while waiting for hold. - // If we don't preventDefault touchmove events here, Android will assume we don't - // want to listen to anymore touch events. It will start scrolling and stop sending - // touchmove events. - if (!touchActionProperty && ev.type === 'touchmove') ev.preventDefault(); - - // If the user moves greater than pixels, stop the hold timer - // set in onStart - var dx = this.state.pos.x - pointer.x; - var dy = this.state.pos.y - pointer.y; - if (Math.sqrt(dx * dx + dy * dy) > this.options.maxDistance) { - this.cancel(); - } - }, - onEnd: function () { - this.onCancel(); - } - }) - - /* - * The drag handler dispatches a drag event if the user holds and moves his finger greater than - * px in the x or y direction, depending on options.horizontal. - * The drag will be cancelled if the user moves his finger greater than * in - * the perpendicular direction. Eg if the drag is horizontal and the user moves his finger * - * pixels vertically, this handler won't consider the move part of a drag. - */ - .handler('drag', { - options: { - minDistance: 6, - horizontal: true, - cancelMultiplier: 1.5 - }, - /** - * @param {angular.JQLite} element where touch action styles need to be adjusted - * @param {{horizontal: boolean}=} options object whose horizontal property can specify to - * apply 'pan-y' or 'pan-x' touch actions. - */ - onSetup: function(element, options) { - if (touchActionProperty) { - // We check for horizontal to be false, because otherwise we would overwrite the default opts. - this.oldTouchAction = element[0].style[touchActionProperty]; - element[0].style[touchActionProperty] = options.horizontal ? 'pan-y' : 'pan-x'; - } - }, - /** - * @param {angular.JQLite} element where styles need to be cleaned up - */ - onCleanup: function(element) { - if (this.oldTouchAction) { - element[0].style[touchActionProperty] = this.oldTouchAction; - } else { - element[0].style[touchActionProperty] = null; - } - }, - onStart: function (ev) { - // For drag, require a parent to be registered with $mdGesture.register() - if (!this.state.registeredParent) this.cancel(); - }, - onMove: function (ev, pointer) { - var shouldStartDrag, shouldCancel; - // Don't scroll while deciding if this touchmove qualifies as a drag event. - // If we don't preventDefault touchmove events here, Android will assume we don't - // want to listen to anymore touch events. It will start scrolling and stop sending - // touchmove events. - if (!touchActionProperty && ev.type === 'touchmove') ev.preventDefault(); - - if (!this.state.dragPointer) { - if (this.state.options.horizontal) { - shouldStartDrag = Math.abs(pointer.distanceX) > this.state.options.minDistance; - shouldCancel = Math.abs(pointer.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier; - } else { - shouldStartDrag = Math.abs(pointer.distanceY) > this.state.options.minDistance; - shouldCancel = Math.abs(pointer.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier; - } - - if (shouldStartDrag) { - // Create a new pointer representing this drag, starting at this point where the drag started. - this.state.dragPointer = makeStartPointer(ev); - updatePointerState(ev, this.state.dragPointer); - this.dispatchEvent(ev, '$md.dragstart', this.state.dragPointer); - - } else if (shouldCancel) { - this.cancel(); - } - } else { - this.dispatchDragMove(ev); - } - }, - // Only dispatch dragmove events every frame; any more is unnecessary - dispatchDragMove: $$rAF.throttle(function (ev) { - // Make sure the drag didn't stop while waiting for the next frame - if (this.state.isRunning) { - updatePointerState(ev, this.state.dragPointer); - this.dispatchEvent(ev, '$md.drag', this.state.dragPointer); - } - }), - onEnd: function (ev, pointer) { - if (this.state.dragPointer) { - updatePointerState(ev, this.state.dragPointer); - this.dispatchEvent(ev, '$md.dragend', this.state.dragPointer); - } - } - }) - - /* - * The swipe handler will dispatch a swipe event if, on the end of a touch, - * the velocity and distance were high enough. - */ - .handler('swipe', { - options: { - minVelocity: 0.65, - minDistance: 10 - }, - onEnd: function (ev, pointer) { - var eventType; - - if (Math.abs(pointer.velocityX) > this.state.options.minVelocity && - Math.abs(pointer.distanceX) > this.state.options.minDistance) { - eventType = pointer.directionX == 'left' ? '$md.swipeleft' : '$md.swiperight'; - this.dispatchEvent(ev, eventType); - } - else if (Math.abs(pointer.velocityY) > this.state.options.minVelocity && - Math.abs(pointer.distanceY) > this.state.options.minDistance) { - eventType = pointer.directionY == 'up' ? '$md.swipeup' : '$md.swipedown'; - this.dispatchEvent(ev, eventType); - } - } - }); -} - -/** - * MdGestureHandler - * A GestureHandler is an object which is able to dispatch custom dom events - * based on native dom {touch,pointer,mouse}{start,move,end} events. - * - * A gesture will manage its lifecycle through the start,move,end, and cancel - * functions, which are called by native dom events. - * - * A gesture has the concept of 'options' (eg. a swipe's required velocity), which can be - * overridden by elements registering through $mdGesture.register(). - */ -function GestureHandler (name) { - this.name = name; - this.state = {}; -} - -function MdGestureHandler() { - var hasJQuery = (typeof __webpack_provided_window_dot_jQuery !== 'undefined') && (angular.element === __webpack_provided_window_dot_jQuery); - - GestureHandler.prototype = { - options: {}, - // jQuery listeners don't work with custom DOMEvents, so we have to dispatch events - // differently when jQuery is loaded - dispatchEvent: hasJQuery ? jQueryDispatchEvent : nativeDispatchEvent, - - // These are overridden by the registered handler - onSetup: angular.noop, - onCleanup: angular.noop, - onStart: angular.noop, - onMove: angular.noop, - onEnd: angular.noop, - onCancel: angular.noop, - - // onStart sets up a new state for the handler, which includes options from the - // nearest registered parent element of ev.target. - start: function (ev, pointer) { - if (this.state.isRunning) return; - var parentTarget = this.getNearestParent(ev.target); - // Get the options from the nearest registered parent - var parentTargetOptions = parentTarget && parentTarget.$mdGesture[this.name] || {}; - - this.state = { - isRunning: true, - // Override the default options with the nearest registered parent's options - options: angular.extend({}, this.options, parentTargetOptions), - // Pass in the registered parent node to the state so the onStart listener can use - registeredParent: parentTarget - }; - this.onStart(ev, pointer); - }, - move: function (ev, pointer) { - if (!this.state.isRunning) return; - this.onMove(ev, pointer); - }, - end: function (ev, pointer) { - if (!this.state.isRunning) return; - this.state.isRunning = false; - this.onEnd(ev, pointer); - }, - cancel: function (ev, pointer) { - this.onCancel(ev, pointer); - this.state = {}; - }, - - // Find and return the nearest parent element that has been registered to - // listen for this handler via $mdGesture.register(element, 'handlerName'). - getNearestParent: function (node) { - var current = node; - while (current) { - if ((current.$mdGesture || {})[this.name]) { - return current; - } - current = current.parentNode; - } - return null; - }, - - // Called from $mdGesture.register when an element registers itself with a handler. - // Store the options the user gave on the DOMElement itself. These options will - // be retrieved with getNearestParent when the handler starts. - registerElement: function (element, options) { - var self = this; - element[0].$mdGesture = element[0].$mdGesture || {}; - element[0].$mdGesture[this.name] = options || {}; - element.on('$destroy', onDestroy); - - self.onSetup(element, options || {}); - - return onDestroy; - - function onDestroy() { - delete element[0].$mdGesture[self.name]; - element.off('$destroy', onDestroy); - - self.onCleanup(element, options || {}); - } - } - }; - - return GestureHandler; - - /** - * Dispatch an event with jQuery - * TODO: Make sure this sends bubbling events - * - * @param srcEvent the original DOM touch event that started this. - * @param eventType the name of the custom event to send (eg 'click' or '$md.drag') - * @param eventPointer the pointer object that matches this event. - */ - function jQueryDispatchEvent(srcEvent, eventType, eventPointer) { - eventPointer = eventPointer || pointer; - var eventObj = new angular.element.Event(eventType); - - eventObj.$material = true; - eventObj.pointer = eventPointer; - eventObj.srcEvent = srcEvent; - - angular.extend(eventObj, { - clientX: eventPointer.x, - clientY: eventPointer.y, - screenX: eventPointer.x, - screenY: eventPointer.y, - pageX: eventPointer.x, - pageY: eventPointer.y, - ctrlKey: srcEvent.ctrlKey, - altKey: srcEvent.altKey, - shiftKey: srcEvent.shiftKey, - metaKey: srcEvent.metaKey - }); - angular.element(eventPointer.target).trigger(eventObj); - } - - /** - * NOTE: nativeDispatchEvent is very performance sensitive. - * @param srcEvent the original DOM touch event that started this. - * @param eventType the name of the custom event to send (eg 'click' or '$md.drag') - * @param eventPointer the pointer object that matches this event. - */ - function nativeDispatchEvent(srcEvent, eventType, eventPointer) { - eventPointer = eventPointer || pointer; - var eventObj; - - if (eventType === 'click' || eventType === 'mouseup' || eventType === 'mousedown') { - if (typeof window.MouseEvent === "function") { - eventObj = new MouseEvent(eventType, { - bubbles: true, - cancelable: true, - screenX: Number(srcEvent.screenX), - screenY: Number(srcEvent.screenY), - clientX: Number(eventPointer.x), - clientY: Number(eventPointer.y), - ctrlKey: srcEvent.ctrlKey, - altKey: srcEvent.altKey, - shiftKey: srcEvent.shiftKey, - metaKey: srcEvent.metaKey, - button: srcEvent.button, - buttons: srcEvent.buttons, - relatedTarget: srcEvent.relatedTarget || null - }); - } else { - eventObj = document.createEvent('MouseEvents'); - // This has been deprecated - // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent - eventObj.initMouseEvent( - eventType, true, true, window, srcEvent.detail, - eventPointer.x, eventPointer.y, eventPointer.x, eventPointer.y, - srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey, - srcEvent.button, srcEvent.relatedTarget || null - ); - } - } else { - if (typeof window.CustomEvent === "function") { - eventObj = new CustomEvent(eventType, { - bubbles: true, - cancelable: true, - detail: {} - }); - } else { - // This has been deprecated - // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/initCustomEvent - eventObj = document.createEvent('CustomEvent'); - eventObj.initCustomEvent(eventType, true, true, {}); - } - } - eventObj.$material = true; - eventObj.pointer = eventPointer; - eventObj.srcEvent = srcEvent; - eventPointer.target.dispatchEvent(eventObj); - } -} - -/** - * Attach Gestures: hook document and check shouldHijack clicks - * @ngInject - */ -function attachToDocument($mdGesture, $$MdGestureHandler, $mdUtil) { - if (disableAllGestures) { - return; - } - - if (!isInitialized && $mdGesture.isHijackingClicks) { - /* - * If hijack clicks is true, we preventDefault any click that wasn't - * sent by AngularJS Material. This is because on older Android & iOS, a false, or 'ghost', - * click event will be sent ~400ms after a touchend event happens. - * The only way to know if this click is real is to prevent any normal - * click events, and add a flag to events sent by material so we know not to prevent those. - * - * Two exceptions to click events that should be prevented are: - * - click events sent by the keyboard (eg form submit) - * - events that originate from an Ionic app - */ - document.addEventListener('click' , clickHijacker , true); - document.addEventListener('mouseup' , mouseInputHijacker, true); - document.addEventListener('mousedown', mouseInputHijacker, true); - document.addEventListener('focus' , mouseInputHijacker, true); - - isInitialized = true; - } - - function mouseInputHijacker(ev) { - var isKeyClick = !ev.clientX && !ev.clientY; - - if ( - !isKeyClick && - !ev.$material && - !ev.isIonicTap && - !isInputEventFromLabelClick(ev) && - (ev.type !== 'mousedown' || (!canFocus(ev.target) && !canFocus(document.activeElement))) - ) { - ev.preventDefault(); - ev.stopPropagation(); - } - } - - /** - * Ignore click events that don't come from AngularJS Material, Ionic, Input Label clicks, - * or key presses that generate click events. This helps to ignore the ghost tap events on - * older mobile browsers that get sent after a 300-400ms delay. - * @param ev MouseEvent or modified MouseEvent with $material, pointer, and other fields - */ - function clickHijacker(ev) { - var isKeyClick; - if ($mdUtil.isIos) { - isKeyClick = angular.isDefined(ev.webkitForce) && ev.webkitForce === 0; - } else { - isKeyClick = ev.clientX === 0 && ev.clientY === 0; - } - if (!isKeyClick && !ev.$material && !ev.isIonicTap && !isInputEventFromLabelClick(ev)) { - ev.preventDefault(); - ev.stopPropagation(); - lastLabelClickPos = null; - } else { - lastLabelClickPos = null; - if (ev.target.tagName.toLowerCase() === 'label') { - lastLabelClickPos = {x: ev.x, y: ev.y}; - } - } - } - - - // Listen to all events to cover all platforms. - var START_EVENTS = 'mousedown touchstart pointerdown'; - var MOVE_EVENTS = 'mousemove touchmove pointermove'; - var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel'; - - angular.element(document) - .on(START_EVENTS, gestureStart) - .on(MOVE_EVENTS, gestureMove) - .on(END_EVENTS, gestureEnd) - // For testing - .on('$$mdGestureReset', function gestureClearCache () { - lastPointer = pointer = null; - }); - - /** - * When a DOM event happens, run all registered gesture handlers' lifecycle - * methods which match the DOM event. - * Eg. when a 'touchstart' event happens, runHandlers('start') will call and - * run `handler.cancel()` and `handler.start()` on all registered handlers. - */ - function runHandlers(handlerEvent, event) { - var handler; - for (var name in HANDLERS) { - handler = HANDLERS[name]; - if (handler instanceof $$MdGestureHandler) { - - if (handlerEvent === 'start') { - // Run cancel to reset any handlers' state - handler.cancel(); - } - handler[handlerEvent](event, pointer); - } - } - } - - /* - * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android) - * If it is legitimate, we initiate the pointer state and mark the current pointer's type - * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events - * won't effect it. - */ - function gestureStart(ev) { - // If we're already touched down, abort - if (pointer) return; - - var now = +Date.now(); - - // iOS & old android bug: after a touch event, a click event is sent 350 ms later. - // If <400ms have passed, don't allow an event of a different type than the previous event - if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) { - return; - } - - pointer = makeStartPointer(ev); - - runHandlers('start', ev); - } - - /** - * If a move event happens of the right type, update the pointer and run all the move handlers. - * "of the right type": if a mousemove happens but our pointer started with a touch event, do - * nothing. - */ - function gestureMove(ev) { - if (!pointer || !typesMatch(ev, pointer)) return; - - updatePointerState(ev, pointer); - runHandlers('move', ev); - } - - /** - * If an end event happens of the right type, update the pointer, run endHandlers, and save the - * pointer as 'lastPointer'. - */ - function gestureEnd(ev) { - if (!pointer || !typesMatch(ev, pointer)) return; - - updatePointerState(ev, pointer); - pointer.endTime = +Date.now(); - - if (ev.type !== 'pointercancel') { - runHandlers('end', ev); - } - - lastPointer = pointer; - pointer = null; - } - -} - -// ******************** -// Module Functions -// ******************** - -/* - * Initiate the pointer. x, y, and the pointer's type. - */ -function makeStartPointer(ev) { - var point = getEventPoint(ev); - var startPointer = { - startTime: +Date.now(), - target: ev.target, - // 'p' for pointer events, 'm' for mouse, 't' for touch - type: ev.type.charAt(0) - }; - startPointer.startX = startPointer.x = point.pageX; - startPointer.startY = startPointer.y = point.pageY; - return startPointer; -} - -/* - * return whether the pointer's type matches the event's type. - * Eg if a touch event happens but the pointer has a mouse type, return false. - */ -function typesMatch(ev, pointer) { - return ev && pointer && ev.type.charAt(0) === pointer.type; -} - -/** - * Gets whether the given event is an input event that was caused by clicking on an - * associated label element. - * - * This is necessary because the browser will, upon clicking on a label element, fire an - * *extra* click event on its associated input (if any). mdGesture is able to flag the label - * click as with `$material` correctly, but not the second input click. - * - * In order to determine whether an input event is from a label click, we compare the (x, y) for - * the event to the (x, y) for the most recent label click (which is cleared whenever a non-label - * click occurs). Unfortunately, there are no event properties that tie the input and the label - * together (such as relatedTarget). - * - * @param {MouseEvent} event - * @returns {boolean} - */ -function isInputEventFromLabelClick(event) { - return lastLabelClickPos - && lastLabelClickPos.x === event.x - && lastLabelClickPos.y === event.y; -} - -/* - * Update the given pointer based upon the given DOMEvent. - * Distance, velocity, direction, duration, etc - */ -function updatePointerState(ev, pointer) { - var point = getEventPoint(ev); - var x = pointer.x = point.pageX; - var y = pointer.y = point.pageY; - - pointer.distanceX = x - pointer.startX; - pointer.distanceY = y - pointer.startY; - pointer.distance = Math.sqrt( - pointer.distanceX * pointer.distanceX + pointer.distanceY * pointer.distanceY - ); - - pointer.directionX = pointer.distanceX > 0 ? 'right' : pointer.distanceX < 0 ? 'left' : ''; - pointer.directionY = pointer.distanceY > 0 ? 'down' : pointer.distanceY < 0 ? 'up' : ''; - - pointer.duration = +Date.now() - pointer.startTime; - pointer.velocityX = pointer.distanceX / pointer.duration; - pointer.velocityY = pointer.distanceY / pointer.duration; -} - -/** - * Normalize the point where the DOM event happened whether it's touch or mouse. - * @returns point event obj with pageX and pageY on it. - */ -function getEventPoint(ev) { - ev = ev.originalEvent || ev; // support jQuery events - return (ev.touches && ev.touches[0]) || - (ev.changedTouches && ev.changedTouches[0]) || - ev; -} - -/** Checks whether an element can be focused. */ -function canFocus(element) { - return ( - !!element && - element.getAttribute('tabindex') !== '-1' && - !element.hasAttribute('disabled') && - ( - element.hasAttribute('tabindex') || - element.hasAttribute('href') || - element.isContentEditable || - ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'].indexOf(element.nodeName) !== -1 - ) - ); -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.core.interaction - * @description - * User interaction detection to provide proper accessibility. - */ -MdInteractionService.$inject = ["$timeout", "$mdUtil", "$rootScope"]; -angular - .module('material.core.interaction', []) - .service('$mdInteraction', MdInteractionService); - - -/** - * @ngdoc service - * @name $mdInteraction - * @module material.core.interaction - * - * @description - * - * Service which keeps track of the last interaction type and validates them for several browsers. - * The service hooks into the document's body and listens for touch, mouse and keyboard events. - * - * The most recent interaction type can be retrieved by calling the `getLastInteractionType` method. - * - * Here is an example markup for using the interaction service. - * - * - * var lastType = $mdInteraction.getLastInteractionType(); - * - * if (lastType === 'keyboard') { - * // We only restore the focus for keyboard users. - * restoreFocus(); - * } - * - * - */ -function MdInteractionService($timeout, $mdUtil, $rootScope) { - this.$timeout = $timeout; - this.$mdUtil = $mdUtil; - this.$rootScope = $rootScope; - - // IE browsers can also trigger pointer events, which also leads to an interaction. - this.pointerEvent = 'MSPointerEvent' in window ? 'MSPointerDown' : 'PointerEvent' in window ? 'pointerdown' : null; - this.bodyElement = angular.element(document.body); - this.isBuffering = false; - this.bufferTimeout = null; - this.lastInteractionType = null; - this.lastInteractionTime = null; - this.inputHandler = this.onInputEvent.bind(this); - this.bufferedInputHandler = this.onBufferInputEvent.bind(this); - - // Type Mappings for the different events - // There will be three three interaction types - // `keyboard`, `mouse` and `touch` - // type `pointer` will be evaluated in `pointerMap` for IE Browser events - this.inputEventMap = { - 'keydown': 'keyboard', - 'mousedown': 'mouse', - 'mouseenter': 'mouse', - 'touchstart': 'touch', - 'pointerdown': 'pointer', - 'MSPointerDown': 'pointer' - }; - - // IE PointerDown events will be validated in `touch` or `mouse` - // Index numbers referenced here: https://msdn.microsoft.com/library/windows/apps/hh466130.aspx - this.iePointerMap = { - 2: 'touch', - 3: 'touch', - 4: 'mouse' - }; - - this.initializeEvents(); - this.$rootScope.$on('$destroy', this.deregister.bind(this)); -} - -/** - * Removes all event listeners created by $mdInteration on the - * body element. - */ -MdInteractionService.prototype.deregister = function() { - - this.bodyElement.off('keydown mousedown', this.inputHandler); - - if ('ontouchstart' in document.documentElement) { - this.bodyElement.off('touchstart', this.bufferedInputHandler); - } - - if (this.pointerEvent) { - this.bodyElement.off(this.pointerEvent, this.inputHandler); - } - -}; - -/** - * Initializes the interaction service, by registering all interaction events to the - * body element. - */ -MdInteractionService.prototype.initializeEvents = function() { - - this.bodyElement.on('keydown mousedown', this.inputHandler); - - if ('ontouchstart' in document.documentElement) { - this.bodyElement.on('touchstart', this.bufferedInputHandler); - } - - if (this.pointerEvent) { - this.bodyElement.on(this.pointerEvent, this.inputHandler); - } - -}; - -/** - * Event listener for normal interaction events, which should be tracked. - * @param event {MouseEvent|KeyboardEvent|PointerEvent|TouchEvent} - */ -MdInteractionService.prototype.onInputEvent = function(event) { - if (this.isBuffering) { - return; - } - - var type = this.inputEventMap[event.type]; - - if (type === 'pointer') { - type = this.iePointerMap[event.pointerType] || event.pointerType; - } - - this.lastInteractionType = type; - this.lastInteractionTime = this.$mdUtil.now(); -}; - -/** - * Event listener for interaction events which should be buffered (touch events). - * @param event {TouchEvent} - */ -MdInteractionService.prototype.onBufferInputEvent = function(event) { - this.$timeout.cancel(this.bufferTimeout); - - this.onInputEvent(event); - this.isBuffering = true; - - // The timeout of 650ms is needed to delay the touchstart, because otherwise the touch will call - // the `onInput` function multiple times. - this.bufferTimeout = this.$timeout(function() { - this.isBuffering = false; - }.bind(this), 650, false); - -}; - -/** - * @ngdoc method - * @name $mdInteraction#getLastInteractionType - * @description Retrieves the last interaction type triggered in body. - * @returns {string|null} Last interaction type. - */ -MdInteractionService.prototype.getLastInteractionType = function() { - return this.lastInteractionType; -}; - -/** - * @ngdoc method - * @name $mdInteraction#isUserInvoked - * @description Method to detect whether any interaction happened recently or not. - * @param {number=} checkDelay Time to check for any interaction to have been triggered. - * @returns {boolean} Whether there was any interaction or not. - */ -MdInteractionService.prototype.isUserInvoked = function(checkDelay) { - var delay = angular.isNumber(checkDelay) ? checkDelay : 15; - - // Check for any interaction to be within the specified check time. - return this.lastInteractionTime >= this.$mdUtil.now() - delay; -}; - -})(); -(function(){ -"use strict"; - -angular.module('material.core') - .provider('$$interimElement', InterimElementProvider); - -/** - * @ngdoc service - * @name $$interimElementProvider - * @module material.core.interimElement - * - * @description - * - * Factory that constructs `$$interimElement.$service` services. - * Used internally in material design for elements that appear on screen temporarily. - * The service provides a promise-like API for interacting with the temporary - * elements. - * - * - * app.service('$mdToast', function($$interimElement) { - * var $mdToast = $$interimElement(toastDefaultOptions); - * return $mdToast; - * }); - * - * - * @param {object=} defaultOptions Options used by default for the `show` method on the service. - * - * @returns {$$interimElement.$service} - */ - -function InterimElementProvider() { - InterimElementFactory.$inject = ["$document", "$q", "$rootScope", "$timeout", "$rootElement", "$animate", "$mdUtil", "$mdCompiler", "$mdTheming", "$injector", "$exceptionHandler"]; - createInterimElementProvider.$get = InterimElementFactory; - return createInterimElementProvider; - - /** - * Returns a new provider which allows configuration of a new interimElement - * service. Allows configuration of default options & methods for options, - * as well as configuration of 'preset' methods (eg dialog.basic(): basic is a preset method) - */ - function createInterimElementProvider(interimFactoryName) { - factory.$inject = ["$$interimElement", "$injector"]; - var EXPOSED_METHODS = ['onHide', 'onShow', 'onRemove']; - - var customMethods = {}; - var providerConfig = { - presets: {} - }; - - var provider = { - setDefaults: setDefaults, - addPreset: addPreset, - addMethod: addMethod, - $get: factory - }; - - /** - * all interim elements will come with the 'build' preset - */ - provider.addPreset('build', { - methods: ['controller', 'controllerAs', 'resolve', 'multiple', - 'template', 'templateUrl', 'themable', 'transformTemplate', 'parent', 'contentElement'] - }); - - return provider; - - /** - * Save the configured defaults to be used when the factory is instantiated - */ - function setDefaults(definition) { - providerConfig.optionsFactory = definition.options; - providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS); - return provider; - } - - /** - * Add a method to the factory that isn't specific to any interim element operations - */ - function addMethod(name, fn) { - customMethods[name] = fn; - return provider; - } - - /** - * Save the configured preset to be used when the factory is instantiated - */ - function addPreset(name, definition) { - definition = definition || {}; - definition.methods = definition.methods || []; - definition.options = definition.options || function() { return {}; }; - - if (/^cancel|hide|show$/.test(name)) { - throw new Error("Preset '" + name + "' in " + interimFactoryName + " is reserved!"); - } - if (definition.methods.indexOf('_options') > -1) { - throw new Error("Method '_options' in " + interimFactoryName + " is reserved!"); - } - providerConfig.presets[name] = { - methods: definition.methods.concat(EXPOSED_METHODS), - optionsFactory: definition.options, - argOption: definition.argOption - }; - return provider; - } - - function addPresetMethod(presetName, methodName, method) { - providerConfig.presets[presetName][methodName] = method; - } - - /** - * Create a factory that has the given methods & defaults implementing interimElement - */ - /* @ngInject */ - function factory($$interimElement, $injector) { - var defaultMethods; - var defaultOptions; - var interimElementService = $$interimElement(); - - /* - * publicService is what the developer will be using. - * It has methods hide(), cancel(), show(), build(), and any other - * presets which were set during the config phase. - */ - var publicService = { - hide: interimElementService.hide, - cancel: interimElementService.cancel, - show: showInterimElement, - - // Special internal method to destroy an interim element without animations - // used when navigation changes causes a $scope.$destroy() action - destroy : destroyInterimElement - }; - - - defaultMethods = providerConfig.methods || []; - // This must be invoked after the publicService is initialized - defaultOptions = invokeFactory(providerConfig.optionsFactory, {}); - - // Copy over the simple custom methods - angular.forEach(customMethods, function(fn, name) { - publicService[name] = fn; - }); - - angular.forEach(providerConfig.presets, function(definition, name) { - var presetDefaults = invokeFactory(definition.optionsFactory, {}); - var presetMethods = (definition.methods || []).concat(defaultMethods); - - // Every interimElement built with a preset has a field called `$type`, - // which matches the name of the preset. - // Eg in preset 'confirm', options.$type === 'confirm' - angular.extend(presetDefaults, { $type: name }); - - // This creates a preset class which has setter methods for every - // method given in the `.addPreset()` function, as well as every - // method given in the `.setDefaults()` function. - // - // @example - // .setDefaults({ - // methods: ['hasBackdrop', 'clickOutsideToClose', 'escapeToClose', 'targetEvent'], - // options: dialogDefaultOptions - // }) - // .addPreset('alert', { - // methods: ['title', 'ok'], - // options: alertDialogOptions - // }) - // - // Set values will be passed to the options when interimElement.show() is called. - function Preset(opts) { - this._options = angular.extend({}, presetDefaults, opts); - } - angular.forEach(presetMethods, function(name) { - Preset.prototype[name] = function(value) { - this._options[name] = value; - return this; - }; - }); - - // Create shortcut method for one-linear methods - if (definition.argOption) { - var methodName = 'show' + name.charAt(0).toUpperCase() + name.slice(1); - publicService[methodName] = function(arg) { - var config = publicService[name](arg); - return publicService.show(config); - }; - } - - // eg $mdDialog.alert() will return a new alert preset - publicService[name] = function(arg) { - // If argOption is supplied, eg `argOption: 'content'`, then we assume - // if the argument is not an options object then it is the `argOption` option. - // - // @example `$mdToast.simple('hello')` // sets options.content to hello - // // because argOption === 'content' - if (arguments.length && definition.argOption && - !angular.isObject(arg) && !angular.isArray(arg)) { - - return (new Preset())[definition.argOption](arg); - - } else { - return new Preset(arg); - } - - }; - }); - - return publicService; - - /** - * - */ - function showInterimElement(opts) { - // opts is either a preset which stores its options on an _options field, - // or just an object made up of options - opts = opts || { }; - if (opts._options) opts = opts._options; - - return interimElementService.show( - angular.extend({}, defaultOptions, opts) - ); - } - - /** - * Special method to hide and destroy an interimElement WITHOUT - * any 'leave` or hide animations ( an immediate force hide/remove ) - * - * NOTE: This calls the onRemove() subclass method for each component... - * which must have code to respond to `options.$destroy == true` - */ - function destroyInterimElement(opts) { - return interimElementService.destroy(opts); - } - - /** - * Helper to call $injector.invoke with a local of the factory name for - * this provider. - * If an $mdDialog is providing options for a dialog and tries to inject - * $mdDialog, a circular dependency error will happen. - * We get around that by manually injecting $mdDialog as a local. - */ - function invokeFactory(factory, defaultVal) { - var locals = {}; - locals[interimFactoryName] = publicService; - return $injector.invoke(factory || function() { return defaultVal; }, {}, locals); - } - } - } - - /* @ngInject */ - function InterimElementFactory($document, $q, $rootScope, $timeout, $rootElement, $animate, - $mdUtil, $mdCompiler, $mdTheming, $injector, $exceptionHandler) { - return function createInterimElementService() { - var SHOW_CANCELLED = false; - - /** - * @ngdoc service - * @name $$interimElementProvider.$service - * - * @description - * A service used to control inserting and removing of an element from the DOM. - * It is used by $mdBottomSheet, $mdDialog, $mdToast, $mdMenu, $mdPanel, and $mdSelect. - */ - var service; - - var showPromises = []; // Promises for the interim's which are currently opening. - var hidePromises = []; // Promises for the interim's which are currently hiding. - var showingInterims = []; // Interim elements which are currently showing up. - - // Publish instance $$interimElement service; - return service = { - show: show, - hide: waitForInterim(hide), - cancel: waitForInterim(cancel), - destroy : destroy, - $injector_: $injector - }; - - /** - * @ngdoc method - * @name $$interimElementProvider.$service#show - * @kind function - * - * @description - * Adds the `$interimElement` to the DOM and returns a special promise that will be resolved - * or rejected with hide or cancel, respectively. - * - * @param {Object} options map of options and values - * @returns {Promise} a Promise that will be resolved when hide() is called or rejected when - * cancel() is called. - */ - function show(options) { - options = options || {}; - var interimElement = new InterimElement(options || {}); - - // When an interim element is currently showing, we have to cancel it. - // Just hiding it, will resolve the InterimElement's promise, the promise should be - // rejected instead. - var hideAction = options.multiple ? $q.resolve() : $q.all(showPromises); - - if (!options.multiple) { - // Wait for all opening interim's to finish their transition. - hideAction = hideAction.then(function() { - // Wait for all closing and showing interim's to be completely closed. - var promiseArray = hidePromises.concat(showingInterims.map(service.cancel)); - return $q.all(promiseArray); - }); - } - - var showAction = hideAction.then(function() { - - return interimElement - .show() - .then(function () { - showingInterims.push(interimElement); - }) - .catch(function (reason) { - return reason; - }) - .finally(function() { - showPromises.splice(showPromises.indexOf(showAction), 1); - }); - - }); - - showPromises.push(showAction); - - // In AngularJS 1.6+, exceptions inside promises will cause a rejection. We need to handle - // the rejection and only log it if it's an error. - interimElement.deferred.promise.catch(function(fault) { - if (fault instanceof Error) { - $exceptionHandler(fault); - } - - return fault; - }); - - // Return a promise that will be resolved when the interim - // element is hidden or cancelled... - return interimElement.deferred.promise; - } - - /** - * @ngdoc method - * @name $$interimElementProvider.$service#hide - * @kind function - * - * @description - * Removes the `$interimElement` from the DOM and resolves the Promise returned from `show()`. - * - * @param {*} reason Data used to resolve the Promise - * @param {object} options map of options and values - * @returns {Promise} a Promise that will be resolved after the element has been removed - * from the DOM. - */ - function hide(reason, options) { - options = options || {}; - - if (options.closeAll) { - // We have to make a shallow copy of the array, because otherwise the map will break. - return $q.all(showingInterims.slice().reverse().map(closeElement)); - } else if (options.closeTo !== undefined) { - return $q.all(showingInterims.slice(options.closeTo).map(closeElement)); - } - - // Hide the latest showing interim element. - return closeElement(showingInterims[showingInterims.length - 1]); - - /** - * @param {InterimElement} interim element to close - * @returns {Promise} - */ - function closeElement(interim) { - if (!interim) { - return $q.when(reason); - } - - var hideAction = interim - .remove(reason, false, options || { }) - .catch(function(reason) { return reason; }) - .finally(function() { - hidePromises.splice(hidePromises.indexOf(hideAction), 1); - }); - - showingInterims.splice(showingInterims.indexOf(interim), 1); - hidePromises.push(hideAction); - - return interim.deferred.promise; - } - } - - /** - * @ngdoc method - * @name $$interimElementProvider.$service#cancel - * @kind function - * - * @description - * Removes the `$interimElement` from the DOM and rejects the Promise returned from `show()`. - * - * @param {*} reason Data used to resolve the Promise - * @param {object} options map of options and values - * @returns {Promise} Promise that will be resolved after the element has been removed - * from the DOM. - */ - function cancel(reason, options) { - var interim = showingInterims.pop(); - if (!interim) { - return $q.when(reason); - } - - var cancelAction = interim - .remove(reason, true, options || {}) - .catch(function(reason) { return reason; }) - .finally(function() { - hidePromises.splice(hidePromises.indexOf(cancelAction), 1); - }); - - hidePromises.push(cancelAction); - - // Since AngularJS 1.6.7, promises will be logged to $exceptionHandler when the promise - // is not handling the rejection. We create a pseudo catch handler, which will prevent the - // promise from being logged to the $exceptionHandler. - return interim.deferred.promise.catch(angular.noop); - } - - /** - * Creates a function to wait for at least one interim element to be available. - * @param callbackFn Function to be used as callback - * @returns {Function} - */ - function waitForInterim(callbackFn) { - return function() { - var fnArguments = arguments; - - if (!showingInterims.length) { - // When there are still interim's opening, then wait for the first interim element to - // finish its open animation. - if (showPromises.length) { - return showPromises[0].finally(function () { - return callbackFn.apply(service, fnArguments); - }); - } - - return $q.when("No interim elements currently showing up."); - } - - return callbackFn.apply(service, fnArguments); - }; - } - - /** - * @ngdoc method - * @name $$interimElementProvider.$service#destroy - * @kind function - * - * Special method to quick-remove the interim element without running animations. This is - * useful when the parent component has been or is being destroyed. - * - * Note: interim elements are in "interim containers". - */ - function destroy(targetEl) { - var interim = !targetEl ? showingInterims.shift() : null; - - var parentEl = angular.element(targetEl).length && angular.element(targetEl)[0].parentNode; - - if (parentEl) { - // Try to find the interim in the stack which corresponds to the supplied DOM element. - var filtered = showingInterims.filter(function(entry) { - return entry.options.element[0] === parentEl; - }); - - // Note: This function might be called when the element already has been removed, - // in which case we won't find any matches. - if (filtered.length) { - interim = filtered[0]; - showingInterims.splice(showingInterims.indexOf(interim), 1); - } - } - - return interim ? interim.remove(SHOW_CANCELLED, false, { '$destroy': true }) : - $q.when(SHOW_CANCELLED); - } - - /* - * Internal Interim Element Object - * Used internally to manage the DOM element and related data - */ - function InterimElement(options) { - var self, element, showAction = $q.when(true); - - options = configureScopeAndTransitions(options); - - return self = { - options : options, - deferred: $q.defer(), - show : createAndTransitionIn, - remove : transitionOutAndRemove - }; - - /** - * Compile, link, and show this interim element. Use optional autoHide and transition-in - * effects. - * @return {Q.Promise} - */ - function createAndTransitionIn() { - return $q(function(resolve, reject) { - - // Trigger onCompiling callback before the compilation starts. - // This is useful, when modifying options, which can be influenced by developers. - options.onCompiling && options.onCompiling(options); - - compileElement(options) - .then(function(compiledData) { - element = linkElement(compiledData, options); - - // Expose the cleanup function from the compiler. - options.cleanupElement = compiledData.cleanup; - - showAction = showElement(element, options, compiledData.controller) - .then(resolve, rejectAll); - }).catch(rejectAll); - - function rejectAll(fault) { - // Force the '$md.show()' promise to reject - self.deferred.reject(fault); - - // Continue rejection propagation - reject(fault); - } - }); - } - - /** - * After the show process has finished/rejected: - * - announce 'removing', - * - perform the transition-out, and - * - perform optional clean up scope. - */ - function transitionOutAndRemove(response, isCancelled, opts) { - - // abort if the show() and compile failed - if (!element) return $q.when(false); - - options = angular.extend(options || {}, opts || {}); - options.cancelAutoHide && options.cancelAutoHide(); - options.element.triggerHandler('$mdInterimElementRemove'); - - if (options.$destroy === true) { - - return hideElement(options.element, options).then(function(){ - (isCancelled && rejectAll(response)) || resolveAll(response); - }); - - } else { - $q.when(showAction).finally(function() { - hideElement(options.element, options).then(function() { - isCancelled ? rejectAll(response) : resolveAll(response); - }, rejectAll); - }); - - return self.deferred.promise; - } - - - /** - * The `show()` returns a promise that will be resolved when the interim - * element is hidden or cancelled... - */ - function resolveAll(response) { - self.deferred.resolve(response); - } - - /** - * Force the '$md.show()' promise to reject - */ - function rejectAll(fault) { - self.deferred.reject(fault); - } - } - - /** - * Prepare optional isolated scope and prepare $animate with default enter and leave - * transitions for the new element instance. - */ - function configureScopeAndTransitions(options) { - options = options || { }; - if (options.template) { - options.template = $mdUtil.processTemplate(options.template); - } - - return angular.extend({ - preserveScope: false, - cancelAutoHide : angular.noop, - scope: options.scope || $rootScope.$new(options.isolateScope), - - /** - * Default usage to enable $animate to transition-in; can be easily overridden via 'options' - */ - onShow: function transitionIn(scope, element, options) { - return $animate.enter(element, options.parent); - }, - - /** - * Default usage to enable $animate to transition-out; can be easily overridden via 'options' - */ - onRemove: function transitionOut(scope, element) { - // Element could be undefined if a new element is shown before - // the old one finishes compiling. - return element && $animate.leave(element) || $q.when(); - } - }, options); - - } - - /** - * Compile an element with a templateUrl, controller, and locals - * @param {Object} options - * @return {Q.Promise<{element: JQLite=, link: Function, locals: Object, cleanup: any=, - * controller: Object=}>} - */ - function compileElement(options) { - - var compiled = !options.skipCompile ? $mdCompiler.compile(options) : null; - - return compiled || $q(function (resolve) { - resolve({ - locals: {}, - link: function () { - return options.element; - } - }); - }); - } - - /** - * Link an element with compiled configuration - * @param {{element: JQLite=, link: Function, locals: Object, controller: Object=}} compileData - * @param {Object} options - * @return {JQLite} - */ - function linkElement(compileData, options) { - angular.extend(compileData.locals, options); - - var element = compileData.link(options.scope); - - // Search for parent at insertion time, if not specified - options.element = element; - options.parent = findParent(element, options); - if (options.themable) $mdTheming(element); - - return element; - } - - /** - * Search for parent at insertion time, if not specified. - * @param {JQLite} element - * @param {Object} options - * @return {JQLite} - */ - function findParent(element, options) { - var parent = options.parent; - - // Search for parent at insertion time, if not specified - if (angular.isFunction(parent)) { - parent = parent(options.scope, element, options); - } else if (angular.isString(parent)) { - parent = angular.element($document[0].querySelector(parent)); - } else { - parent = angular.element(parent); - } - - // If parent querySelector/getter function fails, or it's just null, - // find a default. - if (!(parent || {}).length) { - var el; - if ($rootElement[0] && $rootElement[0].querySelector) { - el = $rootElement[0].querySelector(':not(svg) > body'); - } - if (!el) el = $rootElement[0]; - if (el.nodeName === '#comment') { - el = $document[0].body; - } - return angular.element(el); - } - - return parent; - } - - /** - * If auto-hide is enabled, start timer and prepare cancel function - */ - function startAutoHide() { - var autoHideTimer, cancelAutoHide = angular.noop; - - if (options.hideDelay) { - autoHideTimer = $timeout(service.hide, options.hideDelay) ; - cancelAutoHide = function() { - $timeout.cancel(autoHideTimer); - }; - } - - // Cache for subsequent use - options.cancelAutoHide = function() { - cancelAutoHide(); - options.cancelAutoHide = undefined; - }; - } - - /** - * Show the element (with transitions), notify complete and start optional auto hiding - * timer. - * @param {JQLite} element - * @param {Object} options - * @param {Object} controller - * @return {Q.Promise} - */ - function showElement(element, options, controller) { - // Trigger onShowing callback before the `show()` starts - var notifyShowing = options.onShowing || angular.noop; - // Trigger onComplete callback when the `show()` finishes - var notifyComplete = options.onComplete || angular.noop; - - // Necessary for consistency between AngularJS 1.5 and 1.6. - try { - // This fourth controller parameter is used by $mdDialog in beforeShow(). - notifyShowing(options.scope, element, options, controller); - } catch (e) { - return $q.reject(e); - } - - return $q(function (resolve, reject) { - try { - // Start transitionIn - $q.when(options.onShow(options.scope, element, options)) - .then(function () { - notifyComplete(options.scope, element, options); - startAutoHide(); - - resolve(element); - }, reject); - - } catch (e) { - reject(e.message); - } - }); - } - - function hideElement(element, options) { - var announceRemoving = options.onRemoving || angular.noop; - - return $q(function (resolve, reject) { - try { - // Start transitionIn - var action = $q.when(options.onRemove(options.scope, element, options) || true); - - // Trigger callback *before* the remove operation starts - announceRemoving(element, action); - - if (options.$destroy) { - // For $destroy, onRemove should be synchronous - resolve(element); - - if (!options.preserveScope && options.scope) { - // scope destroy should still be be done after the current digest is done - action.then(function() { options.scope.$destroy(); }); - } - } else { - // Wait until transition-out is done - action.then(function () { - if (!options.preserveScope && options.scope) { - options.scope.$destroy(); - } - - resolve(element); - }, reject); - } - } catch (e) { - reject(e.message); - } - }); - } - - } - }; - } -} - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - var $mdUtil, $interpolate, $log; - - var SUFFIXES = /(-gt)?-(sm|md|lg|print)/g; - var WHITESPACE = /\s+/g; - - var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none', 'noshrink', 'nogrow']; - var LAYOUT_OPTIONS = ['row', 'column']; - var ALIGNMENT_MAIN_AXIS= ["", "start", "center", "end", "stretch", "space-around", "space-between"]; - var ALIGNMENT_CROSS_AXIS= ["", "start", "center", "end", "stretch"]; - - var config = { - /** - * Enable directive attribute-to-class conversions - * Developers can use `` to quickly - * disable the Layout directives and prohibit the injection of Layout classNames - */ - enabled: true, - - /** - * List of mediaQuery breakpoints and associated suffixes - * [ - * { suffix: "sm", mediaQuery: "screen and (max-width: 599px)" }, - * { suffix: "md", mediaQuery: "screen and (min-width: 600px) and (max-width: 959px)" } - * ] - */ - breakpoints: [] - }; - - registerLayoutAPI(angular.module('material.core.layout', ['ng'])); - - /** - * registerLayoutAPI() - * - * The original AngularJS Material Layout solution used attribute selectors and CSS. - * - * ```html - *
    My Content
    - * ``` - * - * ```css - * [layout] { - * box-sizing: border-box; - * display:flex; - * } - * [layout=column] { - * flex-direction : column - * } - * ``` - * - * Use of attribute selectors creates significant performance impacts in some - * browsers... mainly IE. - * - * This module registers directives that allow the same layout attributes to be - * interpreted and converted to class selectors. The directive will add equivalent classes to - * each element that contains a Layout directive. - * - * ```html - *
    My Content
    - * ``` - * - * ```css - * .layout { - * box-sizing: border-box; - * display:flex; - * } - * .layout-column { - * flex-direction : column - * } - * ``` - */ - function registerLayoutAPI(module){ - var PREFIX_REGEXP = /^((?:x|data)[:\-_])/i; - var SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g; - - // NOTE: these are also defined in constants::MEDIA_PRIORITY and constants::MEDIA - var BREAKPOINTS = ["", "xs", "gt-xs", "sm", "gt-sm", "md", "gt-md", "lg", "gt-lg", "xl", "print"]; - var API_WITH_VALUES = ["layout", "flex", "flex-order", "flex-offset", "layout-align"]; - var API_NO_VALUES = ["show", "hide", "layout-padding", "layout-margin"]; - - - // Build directive registration functions for the standard Layout API... for all breakpoints. - angular.forEach(BREAKPOINTS, function(mqb) { - - // Attribute directives with expected, observable value(s) - angular.forEach(API_WITH_VALUES, function(name){ - var fullName = mqb ? name + "-" + mqb : name; - module.directive(directiveNormalize(fullName), attributeWithObserve(fullName)); - }); - - // Attribute directives with no expected value(s) - angular.forEach(API_NO_VALUES, function(name){ - var fullName = mqb ? name + "-" + mqb : name; - module.directive(directiveNormalize(fullName), attributeWithoutValue(fullName)); - }); - - }); - - // Register other, special directive functions for the Layout features: - module - .provider('$$mdLayout', function() { - // Publish internal service for Layouts - return { - $get : angular.noop, - validateAttributeValue : validateAttributeValue, - validateAttributeUsage : validateAttributeUsage, - /** - * Easy way to disable/enable the Layout API. - * When disabled, this stops all attribute-to-classname generations - */ - disableLayouts : function(isDisabled) { - config.enabled = (isDisabled !== true); - } - }; - }) - - .directive('mdLayoutCss' , disableLayoutDirective) - .directive('ngCloak' , buildCloakInterceptor('ng-cloak')) - - .directive('layoutWrap' , attributeWithoutValue('layout-wrap')) - .directive('layoutNowrap' , attributeWithoutValue('layout-nowrap')) - .directive('layoutNoWrap' , attributeWithoutValue('layout-no-wrap')) - .directive('layoutFill' , attributeWithoutValue('layout-fill')) - - // Determine if - .config(detectDisabledLayouts); - - /** - * Converts snake_case to camelCase. - * Also there is special case for Moz prefix starting with upper case letter. - * @param name Name to normalize - */ - function directiveNormalize(name) { - return name - .replace(PREFIX_REGEXP, '') - .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) { - return offset ? letter.toUpperCase() : letter; - }); - } - } - - - /** - * Detect if any of the HTML tags has a [md-layouts-disabled] attribute; - * If yes, then immediately disable all layout API features - * - * Note: this attribute should be specified on either the HTML or BODY tags - * @ngInject - */ - function detectDisabledLayouts() { - var isDisabled = !!document.querySelector('[md-layouts-disabled]'); - config.enabled = !isDisabled; - } - - /** - * Special directive that will disable ALL Layout conversions of layout - * attribute(s) to classname(s). - * - * - * - * - * - * ... - * - * - * Note: Using md-layout-css directive requires the developer to load the Material - * Layout Attribute stylesheet (which only uses attribute selectors): - * - * `angular-material.layout.css` - * - * Another option is to use the LayoutProvider to configure and disable the attribute - * conversions; this would obviate the use of the `md-layout-css` directive - */ - function disableLayoutDirective() { - // Return a 1x-only, first-match attribute directive - config.enabled = false; - - return { - restrict : 'A', - priority : '900' - }; - } - - /** - * Tail-hook ngCloak to delay the uncloaking while Layout transformers - * finish processing. Eliminates flicker with Material.Layouts - */ - function buildCloakInterceptor(className) { - return ['$timeout', function($timeout){ - return { - restrict : 'A', - priority : -10, // run after normal ng-cloak - compile : function(element) { - if (!config.enabled) return angular.noop; - - // Re-add the cloak - element.addClass(className); - - return function(scope, element) { - // Wait while layout injectors configure, then uncloak - // NOTE: $rAF does not delay enough... and this is a 1x-only event, - // $timeout is acceptable. - $timeout(function(){ - element.removeClass(className); - }, 10, false); - }; - } - }; - }]; - } - - - // ********************************************************************************* - // - // These functions create registration functions for AngularJS Material Layout attribute - // directives. This provides easy translation to switch AngularJS Material attribute selectors to - // CLASS selectors and directives; which has huge performance implications for IE Browsers. - // - // ********************************************************************************* - - /** - * Creates a directive registration function where a possible dynamic attribute - * value will be observed/watched. - * @param {string} className attribute name; eg `layout-gt-md` with value ="row" - */ - function attributeWithObserve(className) { - - return ['$mdUtil', '$interpolate', "$log", function(_$mdUtil_, _$interpolate_, _$log_) { - $mdUtil = _$mdUtil_; - $interpolate = _$interpolate_; - $log = _$log_; - - return { - restrict: 'A', - compile: function(element, attr) { - var linkFn; - if (config.enabled) { - // immediately replace static (non-interpolated) invalid values... - - validateAttributeUsage(className, attr, element, $log); - - validateAttributeValue(className, - getNormalizedAttrValue(className, attr, ""), - buildUpdateFn(element, className, attr) - ); - - linkFn = translateWithValueToCssClass; - } - - // Use for postLink to account for transforms after ng-transclude. - return linkFn || angular.noop; - } - }; - }]; - - /** - * Observe deprecated layout attributes and update the element's layout classes to match. - */ - function translateWithValueToCssClass(scope, element, attrs) { - var updateFn = updateClassWithValue(element, className, attrs); - var unwatch = attrs.$observe(attrs.$normalize(className), updateFn); - - updateFn(getNormalizedAttrValue(className, attrs, "")); - scope.$on("$destroy", function() { unwatch(); }); - } - } - - /** - * Creates a registration function for AngularJS Material Layout attribute directive. - * This is a `simple` transpose of attribute usage to class usage; where we ignore - * any attribute value. - */ - function attributeWithoutValue(className) { - return ['$mdUtil', '$interpolate', "$log", function(_$mdUtil_, _$interpolate_, _$log_) { - $mdUtil = _$mdUtil_; - $interpolate = _$interpolate_; - $log = _$log_; - - return { - restrict: 'A', - compile: function(element, attr) { - var linkFn; - if (config.enabled) { - // immediately replace static (non-interpolated) invalid values... - - validateAttributeValue(className, - getNormalizedAttrValue(className, attr, ""), - buildUpdateFn(element, className, attr) - ); - - translateToCssClass(null, element); - - // Use for postLink to account for transforms after ng-transclude. - linkFn = translateToCssClass; - } - - return linkFn || angular.noop; - } - }; - }]; - - /** - * Add transformed class selector. - */ - function translateToCssClass(scope, element) { - element.addClass(className); - } - } - - /** - * After link-phase, do NOT remove deprecated layout attribute selector. - * Instead watch the attribute so interpolated data-bindings to layout - * selectors will continue to be supported. - * - * $observe() the className and update with new class (after removing the last one) - * - * e.g. `layout="{{layoutDemo.direction}}"` will update... - * - * NOTE: The value must match one of the specified styles in the CSS. - * For example `flex-gt-md="{{size}}` where `scope.size == 47` will NOT work since - * only breakpoints for 0, 5, 10, 15... 100, 33, 34, 66, 67 are defined. - */ - function updateClassWithValue(element, className) { - var lastClass; - - return function updateClassFn(newValue) { - var value = validateAttributeValue(className, newValue || ""); - if (angular.isDefined(value)) { - if (lastClass) element.removeClass(lastClass); - lastClass = !value ? className : className + "-" + value.trim().replace(WHITESPACE, "-"); - element.addClass(lastClass); - } - }; - } - - /** - * Centralize warnings for known flexbox issues (especially IE-related issues) - */ - function validateAttributeUsage(className, attr, element, $log){ - var message, usage, url; - var nodeName = element[0].nodeName.toLowerCase(); - - switch (className.replace(SUFFIXES,"")) { - case "flex": - if ((nodeName === "md-button") || (nodeName === "fieldset")){ - // @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers - // Use
    wrapper inside (preferred) or outside - - usage = "<" + nodeName + " " + className + ">"; - url = "https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers"; - message = "Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details."; - - $log.warn($mdUtil.supplant(message, [usage, url])); - } - } - } - - - /** - * For the Layout attribute value, validate or replace with default fallback value. - */ - function validateAttributeValue(className, value, updateFn) { - var origValue = value; - - if (!needsInterpolation(value)) { - switch (className.replace(SUFFIXES,"")) { - case 'layout' : - if (!findIn(value, LAYOUT_OPTIONS)) { - value = LAYOUT_OPTIONS[0]; // 'row'; - } - break; - - case 'flex' : - if (!findIn(value, FLEX_OPTIONS)) { - if (isNaN(value)) { - value = ''; - } - } - break; - - case 'flex-offset' : - case 'flex-order' : - if (!value || isNaN(+value)) { - value = '0'; - } - break; - - case 'layout-align' : - var axis = extractAlignAxis(value); - value = $mdUtil.supplant("{main}-{cross}",axis); - break; - - case 'layout-padding' : - case 'layout-margin' : - case 'layout-fill' : - case 'layout-wrap' : - case 'layout-nowrap' : - value = ''; - break; - } - - if (value !== origValue) { - (updateFn || angular.noop)(value); - } - } - - return value ? value.trim() : ""; - } - - /** - * Replace current attribute value with fallback value - */ - function buildUpdateFn(element, className, attrs) { - return function updateAttrValue(fallback) { - if (!needsInterpolation(fallback)) { - // Do not modify the element's attribute value; so - // uses '' will not - // be affected. Just update the attrs value. - attrs[attrs.$normalize(className)] = fallback; - } - }; - } - - /** - * See if the original value has interpolation symbols: - * e.g. flex-gt-md="{{triggerPoint}}" - */ - function needsInterpolation(value) { - return (value || "").indexOf($interpolate.startSymbol()) > -1; - } - - function getNormalizedAttrValue(className, attrs, defaultVal) { - var normalizedAttr = attrs.$normalize(className); - return attrs[normalizedAttr] ? attrs[normalizedAttr].trim().replace(WHITESPACE, "-") : - defaultVal || null; - } - - function findIn(item, list, replaceWith) { - item = replaceWith && item ? item.replace(WHITESPACE, replaceWith) : item; - - var found = false; - if (item) { - list.forEach(function(it) { - it = replaceWith ? it.replace(WHITESPACE, replaceWith) : it; - found = found || (it === item); - }); - } - return found; - } - - function extractAlignAxis(attrValue) { - var axis = { - main : "start", - cross: "stretch" - }, values; - - attrValue = (attrValue || ""); - - if (attrValue.indexOf("-") === 0 || attrValue.indexOf(" ") === 0) { - // For missing main-axis values - attrValue = "none" + attrValue; - } - - values = attrValue.toLowerCase().trim().replace(WHITESPACE, "-").split("-"); - if (values.length && (values[0] === "space")) { - // for main-axis values of "space-around" or "space-between" - values = [values[0]+"-"+values[1],values[2]]; - } - - if (values.length > 0) axis.main = values[0] || axis.main; - if (values.length > 1) axis.cross = values[1] || axis.cross; - - if (ALIGNMENT_MAIN_AXIS.indexOf(axis.main) < 0) axis.main = "start"; - if (ALIGNMENT_CROSS_AXIS.indexOf(axis.cross) < 0) axis.cross = "stretch"; - - return axis; - } -})(); - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.core.liveannouncer - * @description - * AngularJS Material Live Announcer to provide accessibility for Voice Readers. - */ -MdLiveAnnouncer.$inject = ["$timeout"]; -angular - .module('material.core') - .service('$mdLiveAnnouncer', MdLiveAnnouncer); - -/** - * @ngdoc service - * @name $mdLiveAnnouncer - * @module material.core.liveannouncer - * - * @description - * - * Service to announce messages to supported screenreaders. - * - * > The `$mdLiveAnnouncer` service is internally used for components to provide proper accessibility. - * - * - * module.controller('AppCtrl', function($mdLiveAnnouncer) { - * // Basic announcement (Polite Mode) - * $mdLiveAnnouncer.announce('Hey Google'); - * - * // Custom announcement (Assertive Mode) - * $mdLiveAnnouncer.announce('Hey Google', 'assertive'); - * }); - * - * - */ -function MdLiveAnnouncer($timeout) { - /** @private @const @type {!angular.$timeout} */ - this._$timeout = $timeout; - - /** @private @const @type {!HTMLElement} */ - this._liveElement = this._createLiveElement(); - - /** @private @const @type {!number} */ - this._announceTimeout = 100; -} - -/** - * @ngdoc method - * @name $mdLiveAnnouncer#announce - * @description Announces messages to supported screenreaders. - * @param {string} message Message to be announced to the screenreader - * @param {'off'|'polite'|'assertive'} politeness The politeness of the announcer element. - */ -MdLiveAnnouncer.prototype.announce = function(message, politeness) { - if (!politeness) { - politeness = 'polite'; - } - - var self = this; - - self._liveElement.textContent = ''; - self._liveElement.setAttribute('aria-live', politeness); - - // This 100ms timeout is necessary for some browser + screen-reader combinations: - // - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout. - // - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a - // second time without clearing and then using a non-zero delay. - // (using JAWS 17 at time of this writing). - self._$timeout(function() { - self._liveElement.textContent = message; - }, self._announceTimeout, false); -}; - -/** - * Creates a live announcer element, which listens for DOM changes and announces them - * to the screenreaders. - * @returns {!HTMLElement} - * @private - */ -MdLiveAnnouncer.prototype._createLiveElement = function() { - var liveEl = document.createElement('div'); - - liveEl.classList.add('md-visually-hidden'); - liveEl.setAttribute('role', 'status'); - liveEl.setAttribute('aria-atomic', 'true'); - liveEl.setAttribute('aria-live', 'polite'); - - document.body.appendChild(liveEl); - - return liveEl; -}; - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc service - * @name $$mdMeta - * @module material.core.meta - * - * @description - * - * A provider and a service that simplifies meta tags access - * - * Note: This is intended only for use with dynamic meta tags such as browser color and title. - * Tags that are only processed when the page is rendered (such as `charset`, and `http-equiv`) - * will not work since `$$mdMeta` adds the tags after the page has already been loaded. - * - * ```js - * app.config(function($$mdMetaProvider) { - * var removeMeta = $$mdMetaProvider.setMeta('meta-name', 'content'); - * var metaValue = $$mdMetaProvider.getMeta('meta-name'); // -> 'content' - * - * removeMeta(); - * }); - * - * app.controller('myController', function($$mdMeta) { - * var removeMeta = $$mdMeta.setMeta('meta-name', 'content'); - * var metaValue = $$mdMeta.getMeta('meta-name'); // -> 'content' - * - * removeMeta(); - * }); - * ``` - * - * @returns {$$mdMeta.$service} - * - */ -angular.module('material.core.meta', []) - .provider('$$mdMeta', function () { - var head = angular.element(document.head); - var metaElements = {}; - - /** - * Checks if the requested element was written manually and maps it - * - * @param {string} name meta tag 'name' attribute value - * @returns {boolean} returns true if there is an element with the requested name - */ - function mapExistingElement(name) { - if (metaElements[name]) { - return true; - } - - var element = document.getElementsByName(name)[0]; - - if (!element) { - return false; - } - - metaElements[name] = angular.element(element); - - return true; - } - - /** - * @ngdoc method - * @name $$mdMeta#setMeta - * - * @description - * Creates meta element with the 'name' and 'content' attributes, - * if the meta tag is already created than we replace the 'content' value - * - * @param {string} name meta tag 'name' attribute value - * @param {string} content meta tag 'content' attribute value - * @returns {function} remove function - * - */ - function setMeta(name, content) { - mapExistingElement(name); - - if (!metaElements[name]) { - var newMeta = angular.element(''); - head.append(newMeta); - metaElements[name] = newMeta; - } - else { - metaElements[name].attr('content', content); - } - - return function () { - metaElements[name].attr('content', ''); - metaElements[name].remove(); - delete metaElements[name]; - }; - } - - /** - * @ngdoc method - * @name $$mdMeta#getMeta - * - * @description - * Gets the 'content' attribute value of the wanted meta element - * - * @param {string} name meta tag 'name' attribute value - * @returns {string} content attribute value - */ - function getMeta(name) { - if (!mapExistingElement(name)) { - throw Error('$$mdMeta: could not find a meta tag with the name \'' + name + '\''); - } - - return metaElements[name].attr('content'); - } - - var module = { - setMeta: setMeta, - getMeta: getMeta - }; - - return angular.extend({}, module, { - $get: function () { - return module; - } - }); - }); -})(); -(function(){ -"use strict"; - - /** - * @ngdoc module - * @name material.core.componentRegistry - * - * @description - * A component instance registration service. - * Note: currently this as a private service in the SideNav component. - */ - ComponentRegistry.$inject = ["$log", "$q"]; - angular.module('material.core') - .factory('$mdComponentRegistry', ComponentRegistry); - - /* - * @private - * @ngdoc factory - * @name ComponentRegistry - * @module material.core.componentRegistry - * - */ - function ComponentRegistry($log, $q) { - - var self; - var instances = []; - var pendings = { }; - - return self = { - /** - * Used to print an error when an instance for a handle isn't found. - */ - notFoundError: function(handle, msgContext) { - $log.error((msgContext || "") + 'No instance found for handle', handle); - }, - /** - * Return all registered instances as an array. - */ - getInstances: function() { - return instances; - }, - - /** - * Get a registered instance. - * @param handle the String handle to look up for a registered instance. - */ - get: function(handle) { - if (!isValidID(handle)) return null; - - var i, j, instance; - for (i = 0, j = instances.length; i < j; i++) { - instance = instances[i]; - if (instance.$$mdHandle === handle) { - return instance; - } - } - return null; - }, - - /** - * Register an instance. - * @param instance the instance to register - * @param handle the handle to identify the instance under. - */ - register: function(instance, handle) { - if (!handle) return angular.noop; - - instance.$$mdHandle = handle; - instances.push(instance); - resolveWhen(); - - return deregister; - - /** - * Remove registration for an instance - */ - function deregister() { - var index = instances.indexOf(instance); - if (index !== -1) { - instances.splice(index, 1); - } - } - - /** - * Resolve any pending promises for this instance - */ - function resolveWhen() { - var dfd = pendings[handle]; - if (dfd) { - dfd.forEach(function (promise) { - promise.resolve(instance); - }); - delete pendings[handle]; - } - } - }, - - /** - * Async accessor to registered component instance - * If not available then a promise is created to notify - * all listeners when the instance is registered. - */ - when : function(handle) { - if (isValidID(handle)) { - var deferred = $q.defer(); - var instance = self.get(handle); - - if (instance) { - deferred.resolve(instance); - } else { - if (pendings[handle] === undefined) { - pendings[handle] = []; - } - pendings[handle].push(deferred); - } - - return deferred.promise; - } - return $q.reject("Invalid `md-component-id` value."); - } - - }; - - function isValidID(handle){ - return handle && (handle !== ""); - } - - } - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * @ngdoc service - * @name $mdButtonInkRipple - * @module material.core - * - * @description - * Provides ripple effects for md-button. See $mdInkRipple service for all possible configuration options. - * - * @param {object=} scope Scope within the current context - * @param {object=} element The element the ripple effect should be applied to - * @param {object=} options (Optional) Configuration options to override the default ripple configuration - */ - - MdButtonInkRipple.$inject = ["$mdInkRipple"]; - angular.module('material.core') - .factory('$mdButtonInkRipple', MdButtonInkRipple); - - function MdButtonInkRipple($mdInkRipple) { - return { - attach: function attachRipple(scope, element, options) { - options = angular.extend(optionsForElement(element), options); - - return $mdInkRipple.attach(scope, element, options); - } - }; - - function optionsForElement(element) { - if (element.hasClass('md-icon-button')) { - return { - isMenuItem: element.hasClass('md-menu-item'), - fitRipple: true, - center: true - }; - } else { - return { - isMenuItem: element.hasClass('md-menu-item'), - dimBackground: true - }; - } - } - } -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * @ngdoc service - * @name $mdCheckboxInkRipple - * @module material.core - * - * @description - * Provides ripple effects for md-checkbox. See $mdInkRipple service for all possible configuration options. - * - * @param {object=} scope Scope within the current context - * @param {object=} element The element the ripple effect should be applied to - * @param {object=} options (Optional) Configuration options to override the defaultripple configuration - */ - - MdCheckboxInkRipple.$inject = ["$mdInkRipple"]; - angular.module('material.core') - .factory('$mdCheckboxInkRipple', MdCheckboxInkRipple); - - function MdCheckboxInkRipple($mdInkRipple) { - return { - attach: attach - }; - - function attach(scope, element, options) { - return $mdInkRipple.attach(scope, element, angular.extend({ - center: true, - dimBackground: false, - fitRipple: true - }, options)); - } - } -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * @ngdoc service - * @name $mdListInkRipple - * @module material.core - * - * @description - * Provides ripple effects for md-list. See $mdInkRipple service for all possible configuration options. - * - * @param {object=} scope Scope within the current context - * @param {object=} element The element the ripple effect should be applied to - * @param {object=} options (Optional) Configuration options to override the defaultripple configuration - */ - - MdListInkRipple.$inject = ["$mdInkRipple"]; - angular.module('material.core') - .factory('$mdListInkRipple', MdListInkRipple); - - function MdListInkRipple($mdInkRipple) { - return { - attach: attach - }; - - function attach(scope, element, options) { - return $mdInkRipple.attach(scope, element, angular.extend({ - center: false, - dimBackground: true, - outline: false, - rippleSize: 'full' - }, options)); - } - } -})(); - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.core.ripple - * @description - * Ripple - */ -InkRippleCtrl.$inject = ["$scope", "$element", "rippleOptions", "$window", "$timeout", "$mdUtil", "$mdColorUtil"]; -InkRippleDirective.$inject = ["$mdButtonInkRipple", "$mdCheckboxInkRipple"]; -angular.module('material.core') - .provider('$mdInkRipple', InkRippleProvider) - .directive('mdInkRipple', InkRippleDirective) - .directive('mdNoInk', attrNoDirective) - .directive('mdNoBar', attrNoDirective) - .directive('mdNoStretch', attrNoDirective); - -var DURATION = 450; - -/** - * @ngdoc directive - * @name mdInkRipple - * @module material.core.ripple - * - * @description - * The `md-ink-ripple` directive allows you to specify the ripple color or if a ripple is allowed. - * - * @param {string|boolean} md-ink-ripple A color string `#FF0000` or boolean (`false` or `0`) for - * preventing ripple - * - * @usage - * ### String values - * - * - * Ripples in red - * - * - * - * Not rippling - * - * - * - * ### Interpolated values - * - * - * Ripples with the return value of 'randomColor' function - * - * - * - * Ripples if 'canRipple' function return value is not 'false' or '0' - * - * - */ -function InkRippleDirective ($mdButtonInkRipple, $mdCheckboxInkRipple) { - return { - controller: angular.noop, - link: function (scope, element, attr) { - attr.hasOwnProperty('mdInkRippleCheckbox') - ? $mdCheckboxInkRipple.attach(scope, element) - : $mdButtonInkRipple.attach(scope, element); - } - }; -} - -/** - * @ngdoc service - * @name $mdInkRipple - * @module material.core.ripple - * - * @description - * `$mdInkRipple` is a service for adding ripples to any element. - * - * @usage - * - * app.factory('$myElementInkRipple', function($mdInkRipple) { - * return { - * attach: function (scope, element, options) { - * return $mdInkRipple.attach(scope, element, angular.extend({ - * center: false, - * dimBackground: true - * }, options)); - * } - * }; - * }); - * - * app.controller('myController', function ($scope, $element, $myElementInkRipple) { - * $scope.onClick = function (ev) { - * $myElementInkRipple.attach($scope, angular.element(ev.target), { center: true }); - * } - * }); - * - */ - -/** - * @ngdoc service - * @name $mdInkRippleProvider - * @module material.core.ripple - * - * @description - * If you want to disable ink ripples globally, for all components, you can call the - * `disableInkRipple` method in your app's config. - * - * - * @usage - * - * app.config(function ($mdInkRippleProvider) { - * $mdInkRippleProvider.disableInkRipple(); - * }); - * - */ - -function InkRippleProvider () { - var isDisabledGlobally = false; - - return { - disableInkRipple: disableInkRipple, - $get: ["$injector", function($injector) { - return { attach: attach }; - - /** - * @ngdoc method - * @name $mdInkRipple#attach - * - * @description - * Attaching given scope, element and options to inkRipple controller - * - * @param {object=} scope Scope within the current context - * @param {object=} element The element the ripple effect should be applied to - * @param {object=} options (Optional) Configuration options to override the defaultRipple configuration - * * `center` - Whether the ripple should start from the center of the container element - * * `dimBackground` - Whether the background should be dimmed with the ripple color - * * `colorElement` - The element the ripple should take its color from, defined by css property `color` - * * `fitRipple` - Whether the ripple should fill the element - */ - function attach (scope, element, options) { - if (isDisabledGlobally || element.controller('mdNoInk')) return angular.noop; - return $injector.instantiate(InkRippleCtrl, { - $scope: scope, - $element: element, - rippleOptions: options - }); - } - }] - }; - - /** - * @ngdoc method - * @name $mdInkRippleProvider#disableInkRipple - * - * @description - * A config-time method that, when called, disables ripples globally. - */ - function disableInkRipple () { - isDisabledGlobally = true; - } -} - -/** - * Controller used by the ripple service in order to apply ripples - * @ngInject - */ -function InkRippleCtrl ($scope, $element, rippleOptions, $window, $timeout, $mdUtil, $mdColorUtil) { - this.$window = $window; - this.$timeout = $timeout; - this.$mdUtil = $mdUtil; - this.$mdColorUtil = $mdColorUtil; - this.$scope = $scope; - this.$element = $element; - this.options = rippleOptions; - this.mousedown = false; - this.ripples = []; - this.timeout = null; // Stores a reference to the most-recent ripple timeout - this.lastRipple = null; - - $mdUtil.valueOnUse(this, 'container', this.createContainer); - - this.$element.addClass('md-ink-ripple'); - - // attach method for unit tests - ($element.controller('mdInkRipple') || {}).createRipple = angular.bind(this, this.createRipple); - ($element.controller('mdInkRipple') || {}).setColor = angular.bind(this, this.color); - - this.bindEvents(); -} - - -/** - * Either remove or unlock any remaining ripples when the user mouses off of the element (either by - * mouseup or mouseleave event) - */ -function autoCleanup (self, cleanupFn) { - if (self.mousedown || self.lastRipple) { - self.mousedown = false; - self.$mdUtil.nextTick(angular.bind(self, cleanupFn), false); - } -} - - -/** - * Returns the color that the ripple should be (either based on CSS or hard-coded) - * @returns {string} - */ -InkRippleCtrl.prototype.color = function (value) { - var self = this; - - // If assigning a color value, apply it to background and the ripple color - if (angular.isDefined(value)) { - self._color = self._parseColor(value); - } - - // If color lookup, use assigned, defined, or inherited - return self._color || self._parseColor(self.inkRipple()) || self._parseColor(getElementColor()); - - /** - * Finds the color element and returns its text color for use as default ripple color - * @returns {string} - */ - function getElementColor () { - var items = self.options && self.options.colorElement ? self.options.colorElement : []; - var elem = items.length ? items[ 0 ] : self.$element[ 0 ]; - - return elem ? self.$window.getComputedStyle(elem).color : 'rgb(0,0,0)'; - } -}; - -/** - * Updating the ripple colors based on the current inkRipple value - * or the element's computed style color - */ -InkRippleCtrl.prototype.calculateColor = function () { - return this.color(); -}; - - -/** - * Takes a string color and converts it to RGBA format - * @param {string} color - * @param {number} multiplier - * @returns {string} - */ -InkRippleCtrl.prototype._parseColor = function parseColor (color, multiplier) { - multiplier = multiplier || 1; - var colorUtil = this.$mdColorUtil; - - if (!color) return; - if (color.indexOf('rgba') === 0) return color.replace(/\d?\.?\d*\s*\)\s*$/, (0.1 * multiplier).toString() + ')'); - if (color.indexOf('rgb') === 0) return colorUtil.rgbToRgba(color); - if (color.indexOf('#') === 0) return colorUtil.hexToRgba(color); - -}; - -/** - * Binds events to the root element for - */ -InkRippleCtrl.prototype.bindEvents = function () { - this.$element.on('mousedown', angular.bind(this, this.handleMousedown)); - this.$element.on('mouseup touchend', angular.bind(this, this.handleMouseup)); - this.$element.on('mouseleave', angular.bind(this, this.handleMouseup)); - this.$element.on('touchmove', angular.bind(this, this.handleTouchmove)); -}; - -/** - * Create a new ripple on every mousedown event from the root element - * @param event {MouseEvent} - */ -InkRippleCtrl.prototype.handleMousedown = function (event) { - if (this.mousedown) return; - - // When jQuery is loaded, we have to get the original event - if (event.hasOwnProperty('originalEvent')) event = event.originalEvent; - this.mousedown = true; - if (this.options.center) { - this.createRipple(this.container.prop('clientWidth') / 2, this.container.prop('clientWidth') / 2); - } else { - - // We need to calculate the relative coordinates if the target is a sublayer of the ripple element - if (event.srcElement !== this.$element[0]) { - var layerRect = this.$element[0].getBoundingClientRect(); - var layerX = event.clientX - layerRect.left; - var layerY = event.clientY - layerRect.top; - - this.createRipple(layerX, layerY); - } else { - this.createRipple(event.offsetX, event.offsetY); - } - } -}; - -/** - * Either remove or unlock any remaining ripples when the user mouses off of the element (either by - * mouseup, touchend or mouseleave event) - */ -InkRippleCtrl.prototype.handleMouseup = function () { - this.$timeout(function () { - autoCleanup(this, this.clearRipples); - }.bind(this)); -}; - -/** - * Either remove or unlock any remaining ripples when the user mouses off of the element (by - * touchmove) - */ -InkRippleCtrl.prototype.handleTouchmove = function () { - autoCleanup(this, this.deleteRipples); -}; - -/** - * Cycles through all ripples and attempts to remove them. - */ -InkRippleCtrl.prototype.deleteRipples = function () { - for (var i = 0; i < this.ripples.length; i++) { - this.ripples[ i ].remove(); - } -}; - -/** - * Cycles through all ripples and attempts to remove them with fade. - * Depending on logic within `fadeInComplete`, some removals will be postponed. - */ -InkRippleCtrl.prototype.clearRipples = function () { - for (var i = 0; i < this.ripples.length; i++) { - this.fadeInComplete(this.ripples[ i ]); - } -}; - -/** - * Creates the ripple container element - * @returns {*} - */ -InkRippleCtrl.prototype.createContainer = function () { - var container = angular.element('
    '); - this.$element.append(container); - return container; -}; - -InkRippleCtrl.prototype.clearTimeout = function () { - if (this.timeout) { - this.$timeout.cancel(this.timeout); - this.timeout = null; - } -}; - -InkRippleCtrl.prototype.isRippleAllowed = function () { - var element = this.$element[0]; - do { - if (!element.tagName || element.tagName === 'BODY') break; - - if (element && angular.isFunction(element.hasAttribute)) { - if (element.hasAttribute('disabled')) return false; - if (this.inkRipple() === 'false' || this.inkRipple() === '0') return false; - } - - } while (element = element.parentNode); - return true; -}; - -/** - * The attribute `md-ink-ripple` may be a static or interpolated - * color value OR a boolean indicator (used to disable ripples) - */ -InkRippleCtrl.prototype.inkRipple = function () { - return this.$element.attr('md-ink-ripple'); -}; - -/** - * Creates a new ripple and adds it to the container. Also tracks ripple in `this.ripples`. - * @param left - * @param top - */ -InkRippleCtrl.prototype.createRipple = function (left, top) { - if (!this.isRippleAllowed()) return; - - var ctrl = this; - var colorUtil = ctrl.$mdColorUtil; - var ripple = angular.element('
    '); - var width = this.$element.prop('clientWidth'); - var height = this.$element.prop('clientHeight'); - var x = Math.max(Math.abs(width - left), left) * 2; - var y = Math.max(Math.abs(height - top), top) * 2; - var size = getSize(this.options.fitRipple, x, y); - var color = this.calculateColor(); - - ripple.css({ - left: left + 'px', - top: top + 'px', - background: 'black', - width: size + 'px', - height: size + 'px', - backgroundColor: colorUtil.rgbaToRgb(color), - borderColor: colorUtil.rgbaToRgb(color) - }); - this.lastRipple = ripple; - - // we only want one timeout to be running at a time - this.clearTimeout(); - this.timeout = this.$timeout(function () { - ctrl.clearTimeout(); - if (!ctrl.mousedown) ctrl.fadeInComplete(ripple); - }, DURATION * 0.35, false); - - if (this.options.dimBackground) this.container.css({ backgroundColor: color }); - this.container.append(ripple); - this.ripples.push(ripple); - ripple.addClass('md-ripple-placed'); - - this.$mdUtil.nextTick(function () { - - ripple.addClass('md-ripple-scaled md-ripple-active'); - ctrl.$timeout(function () { - ctrl.clearRipples(); - }, DURATION, false); - - }, false); - - function getSize (fit, x, y) { - return fit - ? Math.max(x, y) - : Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); - } -}; - - - -/** - * After fadeIn finishes, either kicks off the fade-out animation or queues the element for removal on mouseup - * @param ripple - */ -InkRippleCtrl.prototype.fadeInComplete = function (ripple) { - if (this.lastRipple === ripple) { - if (!this.timeout && !this.mousedown) { - this.removeRipple(ripple); - } - } else { - this.removeRipple(ripple); - } -}; - -/** - * Kicks off the animation for removing a ripple - * @param ripple {Element} - */ -InkRippleCtrl.prototype.removeRipple = function (ripple) { - var ctrl = this; - var index = this.ripples.indexOf(ripple); - if (index < 0) return; - this.ripples.splice(this.ripples.indexOf(ripple), 1); - ripple.removeClass('md-ripple-active'); - ripple.addClass('md-ripple-remove'); - if (this.ripples.length === 0) this.container.css({ backgroundColor: '' }); - // use a 2-second timeout in order to allow for the animation to finish - // we don't actually care how long the animation takes - this.$timeout(function () { - ctrl.fadeOutComplete(ripple); - }, DURATION, false); -}; - -/** - * Removes the provided ripple from the DOM - * @param ripple - */ -InkRippleCtrl.prototype.fadeOutComplete = function (ripple) { - ripple.remove(); - this.lastRipple = null; -}; - -/** - * Used to create an empty directive. This is used to track flag-directives whose children may have - * functionality based on them. - * - * Example: `md-no-ink` will potentially be used by all child directives. - */ -function attrNoDirective () { - return { controller: angular.noop }; -} - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * @ngdoc service - * @name $mdTabInkRipple - * @module material.core - * - * @description - * Provides ripple effects for md-tabs. See $mdInkRipple service for all possible configuration options. - * - * @param {object=} scope Scope within the current context - * @param {object=} element The element the ripple effect should be applied to - * @param {object=} options (Optional) Configuration options to override the defaultripple configuration - */ - - MdTabInkRipple.$inject = ["$mdInkRipple"]; - angular.module('material.core') - .factory('$mdTabInkRipple', MdTabInkRipple); - - function MdTabInkRipple($mdInkRipple) { - return { - attach: attach - }; - - function attach(scope, element, options) { - return $mdInkRipple.attach(scope, element, angular.extend({ - center: false, - dimBackground: true, - outline: false, - rippleSize: 'full' - }, options)); - } - } -})(); - -})(); -(function(){ -"use strict"; - -angular.module('material.core.theming.palette', []) -.constant('$mdColorPalette', { - 'red': { - '50': '#ffebee', - '100': '#ffcdd2', - '200': '#ef9a9a', - '300': '#e57373', - '400': '#ef5350', - '500': '#f44336', - '600': '#e53935', - '700': '#d32f2f', - '800': '#c62828', - '900': '#b71c1c', - 'A100': '#ff8a80', - 'A200': '#ff5252', - 'A400': '#ff1744', - 'A700': '#d50000', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 400 500 600 A100 A200 A400', - 'contrastStrongLightColors': '700 800 900 A700' - }, - 'pink': { - '50': '#fce4ec', - '100': '#f8bbd0', - '200': '#f48fb1', - '300': '#f06292', - '400': '#ec407a', - '500': '#e91e63', - '600': '#d81b60', - '700': '#c2185b', - '800': '#ad1457', - '900': '#880e4f', - 'A100': '#ff80ab', - 'A200': '#ff4081', - 'A400': '#f50057', - 'A700': '#c51162', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 400 A100 A200 A400', - // White on 500 does not meet the minimum 4.5 contrast ratio (at 4.34), - // but it's worse with a dark foreground (3.61). - 'contrastStrongLightColors': '500 600 700 800 900 A700' - }, - 'purple': { - '50': '#f3e5f5', - '100': '#e1bee7', - '200': '#ce93d8', - '300': '#ba68c8', - '400': '#ab47bc', - '500': '#9c27b0', - '600': '#8e24aa', - '700': '#7b1fa2', - '800': '#6a1b9a', - '900': '#4a148c', - 'A100': '#ea80fc', - 'A200': '#e040fb', - 'A400': '#d500f9', - 'A700': '#aa00ff', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 A100 A200 A400', - 'contrastStrongLightColors': '400 500 600 700 800 900 A700' - }, - 'deep-purple': { - '50': '#ede7f6', - '100': '#d1c4e9', - '200': '#b39ddb', - '300': '#9575cd', - '400': '#7e57c2', - '500': '#673ab7', - '600': '#5e35b1', - '700': '#512da8', - '800': '#4527a0', - '900': '#311b92', - 'A100': '#b388ff', - 'A200': '#7c4dff', - 'A400': '#651fff', - 'A700': '#6200ea', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 A100', - 'contrastStrongLightColors': '400 500 600 700 800 900 A200 A400 A700' - }, - 'indigo': { - '50': '#e8eaf6', - '100': '#c5cae9', - '200': '#9fa8da', - '300': '#7986cb', - '400': '#5c6bc0', - '500': '#3f51b5', - '600': '#3949ab', - '700': '#303f9f', - '800': '#283593', - '900': '#1a237e', - 'A100': '#8c9eff', - 'A200': '#536dfe', - 'A400': '#3d5afe', - 'A700': '#304ffe', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 A100 A200', - 'contrastStrongLightColors': '400 500 600 700 800 900 A400 A700' - }, - 'blue': { - '50': '#e3f2fd', - '100': '#bbdefb', - '200': '#90caf9', - '300': '#64b5f6', - '400': '#42a5f5', - '500': '#2196f3', - '600': '#1e88e5', - '700': '#1976d2', - '800': '#1565c0', - '900': '#0d47a1', - 'A100': '#82b1ff', - 'A200': '#448aff', - 'A400': '#2979ff', - 'A700': '#2962ff', - 'contrastDefaultColor': 'light', - // White on A400 does not meet the minimum 4.5 contrast ratio (at 3.98), - // but it's worse with a dark foreground (3.94). - 'contrastDarkColors': '50 100 200 300 400 500 600 A100 A200', - 'contrastStrongLightColors': '700 800 900 A400 A700' - }, - 'light-blue': { - '50': '#e1f5fe', - '100': '#b3e5fc', - '200': '#81d4fa', - '300': '#4fc3f7', - '400': '#29b6f6', - '500': '#03a9f4', - '600': '#039be5', - '700': '#0288d1', - '800': '#0277bd', - '900': '#01579b', - 'A100': '#80d8ff', - 'A200': '#40c4ff', - 'A400': '#00b0ff', - 'A700': '#0091ea', - 'contrastDefaultColor': 'dark', - // Dark on 700 does not meet the minimum 4.5 contrast ratio (at 4.07), - // but it's worse with a white foreground (3.85). - 'contrastStrongLightColors': '800 900 A700' - }, - 'cyan': { - '50': '#e0f7fa', - '100': '#b2ebf2', - '200': '#80deea', - '300': '#4dd0e1', - '400': '#26c6da', - '500': '#00bcd4', - '600': '#00acc1', - '700': '#0097a7', - '800': '#00838f', - '900': '#006064', - 'A100': '#84ffff', - 'A200': '#18ffff', - 'A400': '#00e5ff', - 'A700': '#00b8d4', - 'contrastDefaultColor': 'dark', - // Dark on 700 does not meet the minimum 4.5 contrast ratio (at 4.47), - // but it's worse with a white foreground (3.5). - 'contrastStrongLightColors': '800 900' - }, - 'teal': { - '50': '#e0f2f1', - '100': '#b2dfdb', - '200': '#80cbc4', - '300': '#4db6ac', - '400': '#26a69a', - '500': '#009688', - '600': '#00897b', - '700': '#00796b', - '800': '#00695c', - '900': '#004d40', - 'A100': '#a7ffeb', - 'A200': '#64ffda', - 'A400': '#1de9b6', - 'A700': '#00bfa5', - 'contrastDefaultColor': 'dark', - // Dark on 500 does not meet the minimum 4.5 contrast ratio (at 4.27), - // but it's worse with a white foreground (3.67). - // White on 600 does not meet the minimum 4.5 contrast ratio (at 4.31), - // but it's worse with a dark foreground (3.64). - 'contrastStrongLightColors': '600 700 800 900' - }, - 'green': { - '50': '#e8f5e9', - '100': '#c8e6c9', - '200': '#a5d6a7', - '300': '#81c784', - '400': '#66bb6a', - '500': '#4caf50', - '600': '#43a047', - '700': '#388e3c', - '800': '#2e7d32', - '900': '#1b5e20', - 'A100': '#b9f6ca', - 'A200': '#69f0ae', - 'A400': '#00e676', - 'A700': '#00c853', - 'contrastDefaultColor': 'dark', - // White on 700 does not meet the minimum 4.5 contrast ratio (at 4.11), - // but it's worse with a dark foreground (3.81). - 'contrastStrongLightColors': '700 800 900' - }, - 'light-green': { - '50': '#f1f8e9', - '100': '#dcedc8', - '200': '#c5e1a5', - '300': '#aed581', - '400': '#9ccc65', - '500': '#8bc34a', - '600': '#7cb342', - '700': '#689f38', - '800': '#558b2f', - '900': '#33691e', - 'A100': '#ccff90', - 'A200': '#b2ff59', - 'A400': '#76ff03', - 'A700': '#64dd17', - 'contrastDefaultColor': 'dark', - 'contrastStrongLightColors': '800 900' - }, - 'lime': { - '50': '#f9fbe7', - '100': '#f0f4c3', - '200': '#e6ee9c', - '300': '#dce775', - '400': '#d4e157', - '500': '#cddc39', - '600': '#c0ca33', - '700': '#afb42b', - '800': '#9e9d24', - '900': '#827717', - 'A100': '#f4ff81', - 'A200': '#eeff41', - 'A400': '#c6ff00', - 'A700': '#aeea00', - 'contrastDefaultColor': 'dark', - 'contrastStrongLightColors': '900' - }, - 'yellow': { - '50': '#fffde7', - '100': '#fff9c4', - '200': '#fff59d', - '300': '#fff176', - '400': '#ffee58', - '500': '#ffeb3b', - '600': '#fdd835', - '700': '#fbc02d', - '800': '#f9a825', - '900': '#f57f17', - 'A100': '#ffff8d', - 'A200': '#ffff00', - 'A400': '#ffea00', - 'A700': '#ffd600', - 'contrastDefaultColor': 'dark' - }, - 'amber': { - '50': '#fff8e1', - '100': '#ffecb3', - '200': '#ffe082', - '300': '#ffd54f', - '400': '#ffca28', - '500': '#ffc107', - '600': '#ffb300', - '700': '#ffa000', - '800': '#ff8f00', - '900': '#ff6f00', - 'A100': '#ffe57f', - 'A200': '#ffd740', - 'A400': '#ffc400', - 'A700': '#ffab00', - 'contrastDefaultColor': 'dark' - }, - 'orange': { - '50': '#fff3e0', - '100': '#ffe0b2', - '200': '#ffcc80', - '300': '#ffb74d', - '400': '#ffa726', - '500': '#ff9800', - '600': '#fb8c00', - '700': '#f57c00', - '800': '#ef6c00', - '900': '#e65100', - 'A100': '#ffd180', - 'A200': '#ffab40', - 'A400': '#ff9100', - 'A700': '#ff6d00', - 'contrastDefaultColor': 'dark', - 'contrastStrongLightColors': '900' - }, - 'deep-orange': { - '50': '#fbe9e7', - '100': '#ffccbc', - '200': '#ffab91', - '300': '#ff8a65', - '400': '#ff7043', - '500': '#ff5722', - '600': '#f4511e', - '700': '#e64a19', - '800': '#d84315', - '900': '#bf360c', - 'A100': '#ff9e80', - 'A200': '#ff6e40', - 'A400': '#ff3d00', - 'A700': '#dd2c00', - 'contrastDefaultColor': 'dark', - // Dark on 700 does not meet the minimum 4.5 contrast ratio (at 4.01), - // but it's worse with a white foreground (3.91). - // White on 800 does not meet the minimum 4.5 contrast ratio (at 4.43), - // but it's worse with a dark foreground (3.54). - 'contrastStrongLightColors': '800 900 A400 A700', - }, - 'brown': { - '50': '#efebe9', - '100': '#d7ccc8', - '200': '#bcaaa4', - '300': '#a1887f', - '400': '#8d6e63', - '500': '#795548', - '600': '#6d4c41', - '700': '#5d4037', - '800': '#4e342e', - '900': '#3e2723', - 'A100': '#d7ccc8', - 'A200': '#bcaaa4', - 'A400': '#8d6e63', - 'A700': '#5d4037', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 A100 A200', - 'contrastStrongLightColors': '400 500 600 700 800 900 A400 A700' - }, - 'grey': { - '50': '#fafafa', - '100': '#f5f5f5', - '200': '#eeeeee', - '300': '#e0e0e0', - '400': '#bdbdbd', - '500': '#9e9e9e', - '600': '#757575', - '700': '#616161', - '800': '#424242', - '900': '#212121', - 'A100': '#ffffff', - 'A200': '#000000', - 'A400': '#303030', - 'A700': '#616161', - 'contrastDefaultColor': 'dark', - 'contrastLightColors': '700 800 900 A200 A400 A700', - 'contrastStrongLightColors': '600' - }, - 'blue-grey': { - '50': '#eceff1', - '100': '#cfd8dc', - '200': '#b0bec5', - '300': '#90a4ae', - '400': '#78909c', - '500': '#607d8b', - '600': '#546e7a', - '700': '#455a64', - '800': '#37474f', - '900': '#263238', - 'A100': '#cfd8dc', - 'A200': '#b0bec5', - 'A400': '#78909c', - 'A700': '#455a64', - 'contrastDefaultColor': 'light', - 'contrastDarkColors': '50 100 200 300 400 A100 A200 A400', - // White on 500 does not meet the minimum 4.5 contrast ratio (at 4.37), - // but it's worse with a dark foreground. - 'contrastStrongLightColors': '500 600 700 800 900 A700' - } -}); - -})(); -(function(){ -"use strict"; - -(function(angular) { - 'use strict'; -/** - * @ngdoc module - * @name material.core.theming - * @description - * Theming - */ -detectDisabledThemes.$inject = ["$mdThemingProvider"]; -ThemingDirective.$inject = ["$mdTheming", "$interpolate", "$parse", "$mdUtil", "$q", "$log"]; -ThemableDirective.$inject = ["$mdTheming"]; -ThemingProvider.$inject = ["$mdColorPalette", "$$mdMetaProvider"]; -generateAllThemes.$inject = ["$injector", "$mdTheming"]; -angular.module('material.core.theming', ['material.core.theming.palette', 'material.core.meta']) - .directive('mdTheme', ThemingDirective) - .directive('mdThemable', ThemableDirective) - .directive('mdThemesDisabled', disableThemesDirective) - .provider('$mdTheming', ThemingProvider) - .config(detectDisabledThemes) - .run(generateAllThemes); - -/** - * Detect if the HTML or the BODY tags has a [md-themes-disabled] attribute - * If yes, then immediately disable all theme stylesheet generation and DOM injection - */ -/** - * @ngInject - */ -function detectDisabledThemes($mdThemingProvider) { - var isDisabled = !!document.querySelector('[md-themes-disabled]'); - $mdThemingProvider.disableTheming(isDisabled); -} - -/** - * @ngdoc service - * @name $mdThemingProvider - * @module material.core.theming - * - * @description Provider to configure the `$mdTheming` service. - * - * ### Default Theme - * The `$mdThemingProvider` uses by default the following theme configuration: - * - * - Primary Palette: `Blue` - * - Accent Palette: `Pink` - * - Warn Palette: `Deep-Orange` - * - Background Palette: `Grey` - * - * If you don't want to use the `md-theme` directive on the elements itself, you may want to overwrite - * the default theme.
    - * This can be done by using the following markup. - * - * - * myAppModule.config(function($mdThemingProvider) { - * $mdThemingProvider - * .theme('default') - * .primaryPalette('blue') - * .accentPalette('teal') - * .warnPalette('red') - * .backgroundPalette('grey'); - * }); - * - * - - * ### Dynamic Themes - * - * By default, if you change a theme at runtime, the `$mdTheming` service will not detect those changes.
    - * If you have an application, which changes its theme on runtime, you have to enable theme watching. - * - * - * myAppModule.config(function($mdThemingProvider) { - * // Enable theme watching. - * $mdThemingProvider.alwaysWatchTheme(true); - * }); - * - * - * ### Custom Theme Styles - * - * Sometimes you may want to use your own theme styles for some custom components.
    - * You are able to register your own styles by using the following markup. - * - * - * myAppModule.config(function($mdThemingProvider) { - * // Register our custom stylesheet into the theming provider. - * $mdThemingProvider.registerStyles(STYLESHEET); - * }); - * - * - * The `registerStyles` method only accepts strings as value, so you're actually not able to load an external - * stylesheet file into the `$mdThemingProvider`. - * - * If it's necessary to load an external stylesheet, we suggest using a bundler, which supports including raw content, - * like [raw-loader](https://github.com/webpack/raw-loader) for `webpack`. - * - * - * myAppModule.config(function($mdThemingProvider) { - * // Register your custom stylesheet into the theming provider. - * $mdThemingProvider.registerStyles(require('../styles/my-component.theme.css')); - * }); - * - * - * ### Browser color - * - * Enables browser header coloring - * for more info please visit: - * https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color - * - * Options parameter:
    - * `theme` - A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme.
    - * `palette` - Can be any one of the basic material design palettes, extended defined palettes and 'primary', - * 'accent', 'background' and 'warn'. Default is `primary`.
    - * `hue` - The hue from the selected palette. Default is `800`
    - * - * - * myAppModule.config(function($mdThemingProvider) { - * // Enable browser color - * $mdThemingProvider.enableBrowserColor({ - * theme: 'myTheme', // Default is 'default' - * palette: 'accent', // Default is 'primary', any basic material palette and extended palettes are available - * hue: '200' // Default is '800' - * }); - * }); - * - */ - -/** - * Some Example Valid Theming Expressions - * ======================================= - * - * Intention group expansion: (valid for primary, accent, warn, background) - * - * {{primary-100}} - grab shade 100 from the primary palette - * {{primary-100-0.7}} - grab shade 100, apply opacity of 0.7 - * {{primary-100-contrast}} - grab shade 100's contrast color - * {{primary-hue-1}} - grab the shade assigned to hue-1 from the primary palette - * {{primary-hue-1-0.7}} - apply 0.7 opacity to primary-hue-1 - * {{primary-color}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured shades set for each hue - * {{primary-color-0.7}} - Apply 0.7 opacity to each of the above rules - * {{primary-contrast}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured contrast (ie. text) color shades set for each hue - * {{primary-contrast-0.7}} - Apply 0.7 opacity to each of the above rules - * {{primary-contrast-divider}} - Apply divider opacity to contrast color - * - * Foreground expansion: Applies rgba to black/white foreground text - * - * Old Foreground Expressions: - * {{foreground-1}} - used for primary text - * {{foreground-2}} - used for secondary text/divider - * {{foreground-3}} - used for disabled text - * {{foreground-4}} - used for dividers - * - * New Foreground Expressions: - * - * Apply primary text color for contrasting with default background - * {{background-default-contrast}} - default opacity - * {{background-default-contrast-secondary}} - opacity for secondary text - * {{background-default-contrast-hint}} - opacity for hints and placeholders - * {{background-default-contrast-disabled}} - opacity for disabled text - * {{background-default-contrast-divider}} - opacity for dividers - * - * Apply contrast color for specific shades - * {{background-50-contrast-icon}} - Apply contrast color for icon on background's shade 50 hue - */ - -// In memory generated CSS rules; registered by theme.name -var GENERATED = { }; - -// In memory storage of defined themes and color palettes (both loaded by CSS, and user specified) -var PALETTES; - -// Text colors are automatically generated based on background color when not specified -// Custom palettes can provide override colors -// @see https://material.io/archive/guidelines/style/color.html#color-usability -var DARK_FOREGROUND = { - name: 'dark', -}; -var LIGHT_FOREGROUND = { - name: 'light', -}; - -var DARK_SHADOW = '1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4)'; -var LIGHT_SHADOW = ''; - -var DARK_CONTRAST_COLOR = colorToRgbaArray('rgba(0,0,0,0.87)'); -var LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgba(255,255,255,0.87)'); -var STRONG_LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgb(255,255,255)'); - -var THEME_COLOR_TYPES = ['primary', 'accent', 'warn', 'background']; -var DEFAULT_COLOR_TYPE = 'primary'; - -// A color in a theme will use these hues by default, if not specified by user. -var LIGHT_DEFAULT_HUES = { - 'accent': { - 'default': 'A200', - 'hue-1': 'A100', - 'hue-2': 'A400', - 'hue-3': 'A700' - }, - 'background': { - 'default': '50', - 'hue-1': 'A100', - 'hue-2': '100', - 'hue-3': '300' - } -}; - -var DARK_DEFAULT_HUES = { - 'background': { - 'default': 'A400', - 'hue-1': '800', - 'hue-2': '900', - 'hue-3': 'A200' - } -}; - -// Icon opacity values (active/inactive) from -// https://material.io/archive/guidelines/style/color.html#color-usability -var DARK_CONTRAST_OPACITY = { - 'icon': 0.54, - 'secondary': 0.54, - 'disabled': 0.38, - 'hint': 0.38, - 'divider': 0.12, -}; - -var LIGHT_CONTRAST_OPACITY = { - 'icon': 0.87, - 'secondary': 0.7, - 'disabled': 0.5, - 'hint': 0.5, - 'divider': 0.12 -}; - -// Icon opacity values (active/inactive) from -// https://material.io/archive/guidelines/style/color.html#color-usability -var STRONG_LIGHT_CONTRAST_OPACITY = { - 'icon': 1.0, - 'secondary': 0.7, - 'disabled': 0.5, - 'hint': 0.5, - 'divider': 0.12 -}; - -THEME_COLOR_TYPES.forEach(function(colorType) { - // Color types with unspecified default hues will use these default hue values - var defaultDefaultHues = { - 'default': '500', - 'hue-1': '300', - 'hue-2': '800', - 'hue-3': 'A100' - }; - if (!LIGHT_DEFAULT_HUES[colorType]) LIGHT_DEFAULT_HUES[colorType] = defaultDefaultHues; - if (!DARK_DEFAULT_HUES[colorType]) DARK_DEFAULT_HUES[colorType] = defaultDefaultHues; -}); - -var VALID_HUE_VALUES = [ - '50', '100', '200', '300', '400', '500', '600', - '700', '800', '900', 'A100', 'A200', 'A400', 'A700' -]; - -var themeConfig = { - disableTheming : false, // Generate our themes at run time; also disable stylesheet DOM injection - generateOnDemand : false, // Whether or not themes are to be generated on-demand (vs. eagerly). - registeredStyles : [], // Custom styles registered to be used in the theming of custom components. - nonce : null // Nonce to be added as an attribute to the generated themes style tags. -}; - -/** - * - */ -function ThemingProvider($mdColorPalette, $$mdMetaProvider) { - ThemingService.$inject = ["$rootScope", "$mdUtil", "$q", "$log"]; - PALETTES = { }; - var THEMES = { }; - - var themingProvider; - - var alwaysWatchTheme = false; - var defaultTheme = 'default'; - - // Load JS Defined Palettes - angular.extend(PALETTES, $mdColorPalette); - - // Default theme defined in core.js - - /** - * Adds `theme-color` and `msapplication-navbutton-color` meta tags with the color parameter - * @param {string} color Hex value of the wanted browser color - * @returns {function} Remove function of the meta tags - */ - var setBrowserColor = function (color) { - // Chrome, Firefox OS and Opera - var removeChrome = $$mdMetaProvider.setMeta('theme-color', color); - // Windows Phone - var removeWindows = $$mdMetaProvider.setMeta('msapplication-navbutton-color', color); - - return function () { - removeChrome(); - removeWindows(); - }; - }; - - /** - * @ngdoc method - * @name $mdThemingProvider#enableBrowserColor - * @description - * Enables browser header coloring. For more info please visit - * - * Web Fundamentals. - * @param {object=} options Options for the browser color, which include:
    - * - `theme` - `{string}`: A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme.
    - * - `palette` - `{string}`: Can be any one of the basic material design palettes, extended defined palettes, or `primary`, - * `accent`, `background`, and `warn`. Default is `primary`.
    - * - `hue` - `{string}`: The hue from the selected palette. Default is `800`.
    - * @returns {function} Function that removes the browser coloring when called. - */ - var enableBrowserColor = function (options) { - options = angular.isObject(options) ? options : {}; - - var theme = options.theme || 'default'; - var hue = options.hue || '800'; - - var palette = PALETTES[options.palette] || - PALETTES[THEMES[theme].colors[options.palette || 'primary'].name]; - - var color = angular.isObject(palette[hue]) ? palette[hue].hex : palette[hue]; - if (color.substr(0, 1) !== '#') color = '#' + color; - - return setBrowserColor(color); - }; - - return themingProvider = { - definePalette: definePalette, - extendPalette: extendPalette, - theme: registerTheme, - - /** - * return a read-only clone of the current theme configuration - */ - configuration : function() { - return angular.extend({ }, themeConfig, { - defaultTheme : defaultTheme, - alwaysWatchTheme : alwaysWatchTheme, - registeredStyles : [].concat(themeConfig.registeredStyles) - }); - }, - - /** - * @ngdoc method - * @name $mdThemingProvider#disableTheming - * @description - * An easier way to disable theming without having to use `.constant("$MD_THEME_CSS","");`. - * This disables all dynamic theme style sheet generations and injections. - * @param {boolean=} isDisabled Disable all dynamic theme style sheet generations and injections - * if `true` or `undefined`. - */ - disableTheming: function(isDisabled) { - themeConfig.disableTheming = angular.isUndefined(isDisabled) || !!isDisabled; - }, - - /** - * @ngdoc method - * @name $mdThemingProvider#registerStyles - * @param {string} styles The styles to be appended to AngularJS Material's built in theme CSS. - */ - registerStyles: function(styles) { - themeConfig.registeredStyles.push(styles); - }, - - /** - * @ngdoc method - * @name $mdThemingProvider#setNonce - * @param {string} nonceValue The nonce to be added as an attribute to the theme style tags. - * Setting a value allows the use of CSP policy without using the `'unsafe-inline'` directive. - * The string must already be base64 encoded. You can use `btoa(string)` to do this encoding. - * In your CSP's `style-src`, you would then add an entry for `'nonce-nonceValue'`. - */ - setNonce: function(nonceValue) { - themeConfig.nonce = nonceValue; - }, - - generateThemesOnDemand: function(onDemand) { - themeConfig.generateOnDemand = onDemand; - }, - - /** - * @ngdoc method - * @name $mdThemingProvider#setDefaultTheme - * @param {string} theme Default theme name to be applied to elements. - * Default value is `default`. - */ - setDefaultTheme: function(theme) { - defaultTheme = theme; - }, - - /** - * @ngdoc method - * @name $mdThemingProvider#alwaysWatchTheme - * @param {boolean} alwaysWatch Whether or not to always watch themes for changes and re-apply - * classes when they change. Default is `false`. Enabling can reduce performance. - */ - alwaysWatchTheme: function(alwaysWatch) { - alwaysWatchTheme = alwaysWatch; - }, - - enableBrowserColor: enableBrowserColor, - - $get: ThemingService, - _LIGHT_DEFAULT_HUES: LIGHT_DEFAULT_HUES, - _DARK_DEFAULT_HUES: DARK_DEFAULT_HUES, - _PALETTES: PALETTES, - _THEMES: THEMES, - _parseRules: parseRules, - _rgba: rgba - }; - - /** - * @ngdoc method - * @name $mdThemingProvider#definePalette - * @description - * In the event that you need to define a custom color palette, you can use this function to - * make it available to your theme for use in its intention groups.
    - * Note that you must specify all hues in the definition map. - * @param {string} name Name of palette being defined - * @param {object} map Palette definition that includes hue definitions and contrast colors: - * - `'50'` - `{string}`: HEX color - * - `'100'` - `{string}`: HEX color - * - `'200'` - `{string}`: HEX color - * - `'300'` - `{string}`: HEX color - * - `'400'` - `{string}`: HEX color - * - `'500'` - `{string}`: HEX color - * - `'600'` - `{string}`: HEX color - * - `'700'` - `{string}`: HEX color - * - `'800'` - `{string}`: HEX color - * - `'900'` - `{string}`: HEX color - * - `'A100'` - `{string}`: HEX color - * - `'A200'` - `{string}`: HEX color - * - `'A400'` - `{string}`: HEX color - * - `'A700'` - `{string}`: HEX color - * - `'contrastDefaultColor'` - `{string}`: `light` or `dark` - * - `'contrastDarkColors'` - `{string[]}`: Hues which should use dark contrast colors (i.e. raised button text). - * For example: `['50', '100', '200', '300', '400', 'A100']`. - * - `'contrastLightColors'` - `{string[]}`: Hues which should use light contrast colors (i.e. raised button text). - * For example: `['500', '600', '700', '800', '900', 'A200', 'A400', 'A700']`. - */ - function definePalette(name, map) { - map = map || {}; - PALETTES[name] = checkPaletteValid(name, map); - return themingProvider; - } - - /** - * @ngdoc method - * @name $mdThemingProvider#extendPalette - * @description - * Sometimes it is easier to extend an existing color palette and then change a few properties, - * rather than defining a whole new palette. - * @param {string} name Name of palette being extended - * @param {object} map Palette definition that includes optional hue definitions and contrast colors: - * - `'50'` - `{string}`: HEX color - * - `'100'` - `{string}`: HEX color - * - `'200'` - `{string}`: HEX color - * - `'300'` - `{string}`: HEX color - * - `'400'` - `{string}`: HEX color - * - `'500'` - `{string}`: HEX color - * - `'600'` - `{string}`: HEX color - * - `'700'` - `{string}`: HEX color - * - `'800'` - `{string}`: HEX color - * - `'900'` - `{string}`: HEX color - * - `'A100'` - `{string}`: HEX color - * - `'A200'` - `{string}`: HEX color - * - `'A400'` - `{string}`: HEX color - * - `'A700'` - `{string}`: HEX color - * - `'contrastDefaultColor'` - `{string}`: `light` or `dark` - * - `'contrastDarkColors'` - `{string[]}`: Hues which should use dark contrast colors (i.e. raised button text). - * For example: `['50', '100', '200', '300', '400', 'A100']`. - * - `'contrastLightColors'` - `{string[]}`: Hues which should use light contrast colors (i.e. raised button text). - * For example: `['500', '600', '700', '800', '900', 'A200', 'A400', 'A700']`. - * @returns {object} A new object which is a copy of the given palette, `name`, - * with variables from `map` overwritten. - */ - function extendPalette(name, map) { - return checkPaletteValid(name, angular.extend({}, PALETTES[name] || {}, map)); - } - - // Make sure that palette has all required hues - function checkPaletteValid(name, map) { - var missingColors = VALID_HUE_VALUES.filter(function(field) { - return !map[field]; - }); - if (missingColors.length) { - throw new Error("Missing colors %1 in palette %2!" - .replace('%1', missingColors.join(', ')) - .replace('%2', name)); - } - - return map; - } - - /** - * @ngdoc method - * @name $mdThemingProvider#theme - * @description - * Register a theme (which is a collection of color palettes); i.e. `warn`, `accent`, - * `background`, and `primary`.
    - * Optionally inherit from an existing theme. - * @param {string} name Name of theme being registered - * @param {string=} inheritFrom Existing theme name to inherit from - */ - function registerTheme(name, inheritFrom) { - if (THEMES[name]) return THEMES[name]; - - inheritFrom = inheritFrom || 'default'; - - var parentTheme = typeof inheritFrom === 'string' ? THEMES[inheritFrom] : inheritFrom; - var theme = new Theme(name); - - if (parentTheme) { - angular.forEach(parentTheme.colors, function(color, colorType) { - theme.colors[colorType] = { - name: color.name, - // Make sure a COPY of the hues is given to the child color, - // not the same reference. - hues: angular.extend({}, color.hues) - }; - }); - } - THEMES[name] = theme; - - return theme; - } - - function Theme(name) { - var self = this; - self.name = name; - self.colors = {}; - - self.dark = setDark; - setDark(false); - - function setDark(isDark) { - isDark = arguments.length === 0 ? true : !!isDark; - - // If no change, abort - if (isDark === self.isDark) return; - - self.isDark = isDark; - - self.foregroundPalette = self.isDark ? LIGHT_FOREGROUND : DARK_FOREGROUND; - self.foregroundShadow = self.isDark ? DARK_SHADOW : LIGHT_SHADOW; - - // Light and dark themes have different default hues. - // Go through each existing color type for this theme, and for every - // hue value that is still the default hue value from the previous light/dark setting, - // set it to the default hue value from the new light/dark setting. - var newDefaultHues = self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES; - var oldDefaultHues = self.isDark ? LIGHT_DEFAULT_HUES : DARK_DEFAULT_HUES; - angular.forEach(newDefaultHues, function(newDefaults, colorType) { - var color = self.colors[colorType]; - var oldDefaults = oldDefaultHues[colorType]; - if (color) { - for (var hueName in color.hues) { - if (color.hues[hueName] === oldDefaults[hueName]) { - color.hues[hueName] = newDefaults[hueName]; - } - } - } - }); - - return self; - } - - THEME_COLOR_TYPES.forEach(function(colorType) { - var defaultHues = (self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES)[colorType]; - self[colorType + 'Palette'] = function setPaletteType(paletteName, hues) { - var color = self.colors[colorType] = { - name: paletteName, - hues: angular.extend({}, defaultHues, hues) - }; - - Object.keys(color.hues).forEach(function(name) { - if (!defaultHues[name]) { - throw new Error("Invalid hue name '%1' in theme %2's %3 color %4. Available hue names: %4" - .replace('%1', name) - .replace('%2', self.name) - .replace('%3', paletteName) - .replace('%4', Object.keys(defaultHues).join(', ')) - ); - } - }); - Object.keys(color.hues).map(function(key) { - return color.hues[key]; - }).forEach(function(hueValue) { - if (VALID_HUE_VALUES.indexOf(hueValue) === -1) { - throw new Error("Invalid hue value '%1' in theme %2's %3 color %4. Available hue values: %5" - .replace('%1', hueValue) - .replace('%2', self.name) - .replace('%3', colorType) - .replace('%4', paletteName) - .replace('%5', VALID_HUE_VALUES.join(', ')) - ); - } - }); - return self; - }; - }); - } - - /** - * @ngdoc service - * @name $mdTheming - * @module material.core.theming - * @description - * Service that makes an element apply theming related classes to itself. - * - * For more information on the hue objects, their default values, as well as valid hue values, please visit the custom hues section of Configuring a Theme. - * - * - * // Example component directive that we want to apply theming classes to. - * app.directive('myFancyDirective', function($mdTheming) { - * return { - * restrict: 'AE', - * link: function(scope, element, attrs) { - * // Initialize the service using our directive's element - * $mdTheming(element); - * - * $mdTheming.defineTheme('myTheme', { - * primary: 'blue', - * primaryHues: { - * default: '500', - * hue-1: '300', - * hue-2: '900', - * hue-3: 'A100' - * }, - * accent: 'pink', - * accentHues: { - * default: '600', - * hue-1: '300', - * hue-2: '200', - * hue-3: 'A500' - * }, - * warn: 'red', - * // It's not necessary to specify all hues in the object. - * warnHues: { - * default: '200', - * hue-3: 'A100' - * }, - * // It's not necessary to specify custom hues at all. - * background: 'grey', - * dark: true - * }); - * // Your directive's custom code here. - * } - * }; - * }); - * - * @param {element=} element Element that will have theming classes applied to it. - */ - - /** - * @ngdoc property - * @name $mdTheming#THEMES - * @description - * Property to get all the themes defined - * @returns {object} All the themes defined with their properties. - */ - - /** - * @ngdoc property - * @name $mdTheming#PALETTES - * @description - * Property to get all the palettes defined - * @returns {object} All the palettes defined with their colors. - */ - - /** - * @ngdoc method - * @name $mdTheming#registered - * @description - * Determine is specified theme name is a valid, registered theme - * @param {string} themeName the theme to check if registered - * @returns {boolean} whether the theme is registered or not - */ - - /** - * @ngdoc method - * @name $mdTheming#defaultTheme - * @description - * Returns the default theme - * @returns {string} The default theme - */ - - /** - * @ngdoc method - * @name $mdTheming#generateTheme - * @description - * Lazy generate themes - by default, every theme is generated when defined. - * You can disable this in the configuration section using the - * `$mdThemingProvider.generateThemesOnDemand(true);` - * - * The theme name that is passed in must match the name of the theme that was defined as part of - * the configuration block. - * - * @param {string} name theme name to generate - */ - - /** - * @ngdoc method - * @name $mdTheming#setBrowserColor - * @description - * Enables browser header coloring. For more info please visit - * - * Web Fundamentals. - * @param {object=} options Options for the browser color, which include:
    - * - `theme` - `{string}`: A defined theme via `$mdThemeProvider` to use the palettes from. - * Default is `default` theme.
    - * - `palette` - `{string}`: Can be any one of the basic material design palettes, extended - * defined palettes, or `primary`, `accent`, `background`, and `warn`. Default is `primary`. - *
    - * - `hue` - `{string}`: The hue from the selected palette. Default is `800`.
    - * @returns {function} Function that removes the browser coloring when called. - */ - - /** - * @ngdoc method - * @name $mdTheming#defineTheme - * @description - * Dynamically define a theme by using an options object that contains palette names. - * - * @param {string} name Theme name to define - * @param {object} options Theme definition options - * - * Options are:
    - * - `primary` - `{string}`: The name of the primary palette to use in the theme.
    - * - `primaryHues` - `{object=}`: Override hues for primary palette.
    - * - `accent` - `{string}`: The name of the accent palette to use in the theme.
    - * - `accentHues` - `{object=}`: Override hues for accent palette.
    - * - `warn` - `{string}`: The name of the warn palette to use in the theme.
    - * - `warnHues` - `{object=}`: Override hues for warn palette.
    - * - `background` - `{string}`: The name of the background palette to use in the theme.
    - * - `backgroundHues` - `{object=}`: Override hues for background palette.
    - * - `dark` - `{boolean}`: Indicates if it's a dark theme.
    - * @returns {Promise} A resolved promise with the new theme name. - */ - - /* @ngInject */ - function ThemingService($rootScope, $mdUtil, $q, $log) { - // Allow us to be invoked via a linking function signature. - var applyTheme = function (scope, el) { - if (el === undefined) { el = scope; scope = undefined; } - if (scope === undefined) { scope = $rootScope; } - applyTheme.inherit(el, el); - }; - - Object.defineProperty(applyTheme, 'THEMES', { - get: function () { - return angular.extend({}, THEMES); - } - }); - Object.defineProperty(applyTheme, 'PALETTES', { - get: function () { - return angular.extend({}, PALETTES); - } - }); - Object.defineProperty(applyTheme, 'ALWAYS_WATCH', { - get: function () { - return alwaysWatchTheme; - } - }); - applyTheme.inherit = inheritTheme; - applyTheme.registered = registered; - applyTheme.defaultTheme = function() { return defaultTheme; }; - applyTheme.generateTheme = function(name) { generateTheme(THEMES[name], name, themeConfig.nonce); }; - applyTheme.defineTheme = function(name, options) { - options = options || {}; - - var theme = registerTheme(name); - - if (options.primary) { - theme.primaryPalette(options.primary, options.primaryHues); - } - if (options.accent) { - theme.accentPalette(options.accent, options.accentHues); - } - if (options.warn) { - theme.warnPalette(options.warn, options.warnHues); - } - if (options.background) { - theme.backgroundPalette(options.background, options.backgroundHues); - } - if (options.dark){ - theme.dark(); - } - - this.generateTheme(name); - - return $q.resolve(name); - }; - applyTheme.setBrowserColor = enableBrowserColor; - - return applyTheme; - - /** - * Determine is specified theme name is a valid, registered theme - */ - function registered(themeName) { - if (themeName === undefined || themeName === '') return true; - return applyTheme.THEMES[themeName] !== undefined; - } - - /** - * Get theme name for the element, then update with Theme CSS class - */ - function inheritTheme (el, parent) { - var ctrl = parent.controller('mdTheme') || el.data('$mdThemeController'); - var scope = el.scope(); - - updateThemeClass(lookupThemeName()); - - if (ctrl) { - var watchTheme = alwaysWatchTheme || - ctrl.$shouldWatch || - $mdUtil.parseAttributeBoolean(el.attr('md-theme-watch')); - - if (watchTheme || ctrl.isAsyncTheme) { - var clearNameWatcher = function () { - if (unwatch) { - unwatch(); - unwatch = undefined; - } - }; - - var unwatch = ctrl.registerChanges(function(name) { - updateThemeClass(name); - - if (!watchTheme) { - clearNameWatcher(); - } - }); - - if (scope) { - scope.$on('$destroy', clearNameWatcher); - } else { - el.on('$destroy', clearNameWatcher); - } - } - } - - /** - * Find the theme name from the parent controller or element data - */ - function lookupThemeName() { - // As a few components (dialog) add their controllers later, we should also watch for a controller init. - return ctrl && ctrl.$mdTheme || (defaultTheme === 'default' ? '' : defaultTheme); - } - - /** - * Remove old theme class and apply a new one - * NOTE: if not a valid theme name, then the current name is not changed - */ - function updateThemeClass(theme) { - if (!theme) return; - if (!registered(theme)) { - $log.warn('Attempted to use unregistered theme \'' + theme + '\'. ' + - 'Register it with $mdThemingProvider.theme().'); - } - - var oldTheme = el.data('$mdThemeName'); - if (oldTheme) el.removeClass('md-' + oldTheme +'-theme'); - el.addClass('md-' + theme + '-theme'); - el.data('$mdThemeName', theme); - if (ctrl) { - el.data('$mdThemeController', ctrl); - } - } - } - - } -} - -function ThemingDirective($mdTheming, $interpolate, $parse, $mdUtil, $q, $log) { - return { - priority: 101, // has to be more than 100 to be before interpolation (issue on IE) - link: { - pre: function(scope, el, attrs) { - var registeredCallbacks = []; - - var startSymbol = $interpolate.startSymbol(); - var endSymbol = $interpolate.endSymbol(); - - var theme = attrs.mdTheme.trim(); - - var hasInterpolation = - theme.substr(0, startSymbol.length) === startSymbol && - theme.lastIndexOf(endSymbol) === theme.length - endSymbol.length; - - var oneTimeOperator = '::'; - var oneTimeBind = attrs.mdTheme - .split(startSymbol).join('') - .split(endSymbol).join('') - .trim() - .substr(0, oneTimeOperator.length) === oneTimeOperator; - - var getTheme = function () { - var interpolation = $interpolate(attrs.mdTheme)(scope); - return $parse(interpolation)(scope) || interpolation; - }; - - var ctrl = { - isAsyncTheme: angular.isFunction(getTheme()) || angular.isFunction(getTheme().then), - registerChanges: function (cb, context) { - if (context) { - cb = angular.bind(context, cb); - } - - registeredCallbacks.push(cb); - - return function () { - var index = registeredCallbacks.indexOf(cb); - - if (index > -1) { - registeredCallbacks.splice(index, 1); - } - }; - }, - $setTheme: function (theme) { - if (!$mdTheming.registered(theme)) { - $log.warn('attempted to use unregistered theme \'' + theme + '\''); - } - - ctrl.$mdTheme = theme; - - // Iterating backwards to support unregistering during iteration - // http://stackoverflow.com/a/9882349/890293 - // we don't use `reverse()` of array because it mutates the array and we don't want it - // to get re-indexed - for (var i = registeredCallbacks.length; i--;) { - registeredCallbacks[i](theme); - } - }, - $shouldWatch: $mdUtil.parseAttributeBoolean(el.attr('md-theme-watch')) || - $mdTheming.ALWAYS_WATCH || - (hasInterpolation && !oneTimeBind) - }; - - el.data('$mdThemeController', ctrl); - - var setParsedTheme = function (theme) { - if (typeof theme === 'string') { - return ctrl.$setTheme(theme); - } - - $q.when(angular.isFunction(theme) ? theme() : theme) - .then(function(name) { - ctrl.$setTheme(name); - }); - }; - - setParsedTheme(getTheme()); - - var unwatch = scope.$watch(getTheme, function(theme) { - if (theme) { - setParsedTheme(theme); - - if (!ctrl.$shouldWatch) { - unwatch(); - } - } - }); - } - } - }; -} - -/** - * Special directive that will disable ALL runtime Theme style generation and DOM injection - * - * - * - * - * - * ... - * - * - * Note: Using md-themes-css directive requires the developer to load external - * theme stylesheets; e.g. custom themes from Material-Tools: - * - * `angular-material.themes.css` - * - * Another option is to use the ThemingProvider to configure and disable the attribute - * conversions; this would obviate the use of the `md-themes-css` directive - * - */ -function disableThemesDirective() { - themeConfig.disableTheming = true; - - // Return a 1x-only, first-match attribute directive - return { - restrict : 'A', - priority : '900' - }; -} - -function ThemableDirective($mdTheming) { - return $mdTheming; -} - -function parseRules(theme, colorType, rules) { - checkValidPalette(theme, colorType); - - rules = rules.replace(/THEME_NAME/g, theme.name); - var themeNameRegex = new RegExp('\\.md-' + theme.name + '-theme', 'g'); - // Matches '{{ primary-color }}', etc - var hueRegex = new RegExp('([\'"])?{{\\s*([a-zA-Z]+)-?(color|default)?-?(contrast)?-?((?:\\d\\.?\\d*)|(?:[a-zA-Z]+))?\\s*}}(["\'])?','g'); - var simpleVariableRegex = /'?"?{{\s*([a-zA-Z]+)-(A?\d+|hue-[0-3]|shadow|default)-?(contrast)?-?((?:\d\.?\d*)|(?:[a-zA-Z]+))?\s*}}'?"?/g; - var defaultBgHue = theme.colors['background'].hues['default']; - var defaultBgContrastType = PALETTES[theme.colors['background'].name][defaultBgHue].contrastType; - - // find and replace simple variables where we use a specific hue, not an entire palette - // eg. "{{primary-100}}" - // \(' + THEME_COLOR_TYPES.join('\|') + '\)' - rules = rules.replace(simpleVariableRegex, function(match, colorType, hue, contrast, opacity) { - var regexColorType = colorType; - if (colorType === 'foreground') { - if (hue === 'shadow') { - return theme.foregroundShadow; - } else if (theme.foregroundPalette[hue]) { - // Use user defined palette number (ie: foreground-2) - return rgba(colorToRgbaArray(theme.foregroundPalette[hue])); - } else if (theme.foregroundPalette['1']){ - return rgba(colorToRgbaArray(theme.foregroundPalette['1'])); - } - // Default to background-default-contrast-{opacity} - colorType = 'background'; - contrast = 'contrast'; - if (!opacity && hue) { - // Convert references to legacy hues to opacities (i.e. foreground-4 to *-divider) - switch (hue) { - // hue-1 uses default opacity - case '2': - opacity = 'secondary'; - break; - case '3': - opacity = 'disabled'; - break; - case '4': - opacity = 'divider'; - } - } - hue = 'default'; - } - - // `default` is also accepted as a hue-value, because the background palettes are - // using it as a name for the default hue. - if (hue.indexOf('hue') === 0 || hue === 'default') { - hue = theme.colors[colorType].hues[hue]; - } - - var colorDetails = (PALETTES[ theme.colors[colorType].name ][hue] || ''); - - // If user has specified a foreground color, use those - if (colorType === 'background' && contrast && regexColorType !== 'foreground' && - colorDetails.contrastType === defaultBgContrastType) { - // Don't process if colorType was changed - switch (opacity) { - case 'secondary': - case 'icon': - if (theme.foregroundPalette['2']) { - return rgba(colorToRgbaArray(theme.foregroundPalette['2'])); - } - break; - case 'disabled': - case 'hint': - if (theme.foregroundPalette['3']) { - return rgba(colorToRgbaArray(theme.foregroundPalette['3'])); - } - break; - case 'divider': - if (theme.foregroundPalette['4']) { - return rgba(colorToRgbaArray(theme.foregroundPalette['4'])); - } - break; - default: - if (theme.foregroundPalette['1']) { - return rgba(colorToRgbaArray(theme.foregroundPalette['1'])); - } - break; - } - } - - if (contrast && opacity) { - opacity = colorDetails.opacity[opacity] || opacity; - } - - return rgba(colorDetails[contrast ? 'contrast' : 'value'], opacity); - }); - - var generatedRules = []; - - // For each type, generate rules for each hue (ie. default, md-hue-1, md-hue-2, md-hue-3) - angular.forEach(['default', 'hue-1', 'hue-2', 'hue-3'], function(hueName) { - var newRule = rules - .replace(hueRegex, function(match, _, matchedColorType, hueType, contrast, opacity) { - var color = theme.colors[matchedColorType]; - var palette = PALETTES[color.name]; - var hueValue = color.hues[hueName]; - if (contrast && opacity) { - opacity = palette[hueValue].opacity[opacity] || opacity; - } - return rgba(palette[hueValue][hueType === 'color' ? 'value' : 'contrast'], opacity); - }); - if (hueName !== 'default') { - newRule = newRule.replace(themeNameRegex, '.md-' + theme.name + '-theme.md-' + hueName); - } - - // Don't apply a selector rule to the default theme, making it easier to override - // styles of the base-component - if (theme.name === 'default') { - var themeRuleRegex = /((?:\s|>|\.|\w|-|:|\(|\)|\[|]|"|'|=)*)\.md-default-theme((?:\s|>|\.|\w|-|:|\(|\)|\[|]|"|'|=)*)/g; - - newRule = newRule.replace(themeRuleRegex, function(match, start, end) { - return match + ', ' + start + end; - }); - } - generatedRules.push(newRule); - }); - - return generatedRules; -} - -var rulesByType = {}; - -// Generate our themes at run time given the state of THEMES and PALETTES -function generateAllThemes($injector, $mdTheming) { - var head = document.head; - var firstChild = head ? head.firstElementChild : null; - var themeCss = !themeConfig.disableTheming && $injector.has('$MD_THEME_CSS') ? $injector.get('$MD_THEME_CSS') : ''; - - // Append our custom registered styles to the theme stylesheet. - themeCss += themeConfig.registeredStyles.join(''); - - if (!firstChild) return; - if (themeCss.length === 0) return; // no rules, so no point in running this expensive task - - // Expose contrast colors for palettes to ensure that text is always readable - angular.forEach(PALETTES, sanitizePalette); - - // MD_THEME_CSS is a string generated by the build process that includes all the themeable - // components as templates - - // Break the CSS into individual rules - var rules = splitCss(themeCss).map(function(rule) { - return rule.trim(); - }); - - THEME_COLOR_TYPES.forEach(function(type) { - rulesByType[type] = ''; - }); - - // Sort the rules based on type, allowing us to do color substitution on a per-type basis - rules.forEach(function(rule) { - // First: test that if the rule has '.md-accent', it goes into the accent set of rules - for (var i = 0, type; type = THEME_COLOR_TYPES[i]; i++) { - if (rule.indexOf('.md-' + type) > -1) { - return rulesByType[type] += rule; - } - } - - // If no eg 'md-accent' class is found, try to just find 'accent' in the rule and guess from - // there - for (i = 0; type = THEME_COLOR_TYPES[i]; i++) { - if (rule.indexOf(type) > -1) { - return rulesByType[type] += rule; - } - } - - // Default to the primary array - return rulesByType[DEFAULT_COLOR_TYPE] += rule; - }); - - // If themes are being generated on-demand, quit here. The user will later manually - // call generateTheme to do this on a theme-by-theme basis. - if (themeConfig.generateOnDemand) return; - - angular.forEach($mdTheming.THEMES, function(theme) { - if (!GENERATED[theme.name] && !($mdTheming.defaultTheme() !== 'default' && theme.name === 'default')) { - generateTheme(theme, theme.name, themeConfig.nonce); - } - }); - - - // ************************* - // Internal functions - // ************************* - - /** - * The user specifies a 'default' contrast color as either light or dark, then explicitly lists - * which hues are the opposite contrast (eg. A100 has dark, A200 has light). - * @param {!object} palette to sanitize - */ - function sanitizePalette(palette) { - var defaultContrast = palette.contrastDefaultColor; - var lightColors = palette.contrastLightColors || []; - var strongLightColors = palette.contrastStrongLightColors || []; - var darkColors = palette.contrastDarkColors || []; - - // These colors are provided as space-separated lists - if (typeof lightColors === 'string') lightColors = lightColors.split(' '); - if (typeof strongLightColors === 'string') strongLightColors = strongLightColors.split(' '); - if (typeof darkColors === 'string') darkColors = darkColors.split(' '); - - // Cleanup after ourselves - delete palette.contrastDefaultColor; - delete palette.contrastLightColors; - delete palette.contrastStrongLightColors; - delete palette.contrastDarkColors; - - /** - * @param {string} hueName - * @return {'dark'|'light'|'strongLight'} - */ - function getContrastType(hueName) { - if (defaultContrast === 'light' ? darkColors.indexOf(hueName) !== -1 : - (lightColors.indexOf(hueName) === -1 && strongLightColors.indexOf(hueName) === -1)) { - return 'dark'; - } - if (strongLightColors.indexOf(hueName) !== -1) { - return 'strongLight'; - } - return 'light'; - } - - /** - * @param {'dark'|'light'|'strongLight'} contrastType - * @return {[number, number, number]} [red, green, blue] array - */ - function getContrastColor(contrastType) { - switch (contrastType) { - default: - case 'strongLight': - return STRONG_LIGHT_CONTRAST_COLOR; - case 'light': - return LIGHT_CONTRAST_COLOR; - case 'dark': - return DARK_CONTRAST_COLOR; - } - } - - /** - * @param {'dark'|'light'|'strongLight'} contrastType - * @return {{secondary: number, divider: number, hint: number, icon: number, disabled: number}} - */ - function getOpacityValues(contrastType) { - switch (contrastType) { - default: - case 'strongLight': - return STRONG_LIGHT_CONTRAST_OPACITY; - case 'light': - return LIGHT_CONTRAST_OPACITY; - case 'dark': - return DARK_CONTRAST_OPACITY; - } - } - // Change { 'A100': '#fffeee' } to { 'A100': { value: '#fffeee', contrast:DARK_CONTRAST_COLOR } - angular.forEach(palette, function(hueValue, hueName) { - if (angular.isObject(hueValue)) return; // Already converted - // Map everything to rgb colors - var rgbValue = colorToRgbaArray(hueValue); - if (!rgbValue) { - throw new Error("Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected." - .replace('%1', hueValue) - .replace('%2', palette.name) - .replace('%3', hueName)); - } - - var contrastType = getContrastType(hueName); - palette[hueName] = { - hex: palette[hueName], - value: rgbValue, - contrastType: contrastType, - contrast: getContrastColor(contrastType), - opacity: getOpacityValues(contrastType) - }; - }); - } - - /** - * @param {string} themeCss - * @returns {[]} a string representing a CSS file that is split, producing an array with a rule - * at each index. - */ - function splitCss(themeCss) { - var result = []; - var currentRule = ''; - var openedCurlyBrackets = 0; - var closedCurlyBrackets = 0; - - for (var i = 0; i < themeCss.length; i++) { - var character = themeCss.charAt(i); - - // Check for content in quotes - if (character === '\'' || character === '"') { - // Append text in quotes to current rule - var textInQuotes = themeCss.substring(i, themeCss.indexOf(character, i + 1)); - currentRule += textInQuotes; - - // Jump to the closing quote char - i += textInQuotes.length; - } else { - currentRule += character; - - if (character === '}') { - closedCurlyBrackets++; - if (closedCurlyBrackets === openedCurlyBrackets) { - closedCurlyBrackets = 0; - openedCurlyBrackets = 0; - result.push(currentRule); - currentRule = ''; - } - } else if (character === '{') { - openedCurlyBrackets++; - } - } - } - // Add comments added after last valid rule. - if (currentRule !== '') { - result.push(currentRule); - } - - return result; - } -} - -function generateTheme(theme, name, nonce) { - var head = document.head; - var firstChild = head ? head.firstElementChild : null; - - if (!GENERATED[name]) { - // For each theme, use the color palettes specified for - // `primary`, `warn` and `accent` to generate CSS rules. - THEME_COLOR_TYPES.forEach(function(colorType) { - var styleStrings = parseRules(theme, colorType, rulesByType[colorType]); - while (styleStrings.length) { - var styleContent = styleStrings.shift(); - if (styleContent) { - var style = document.createElement('style'); - style.setAttribute('md-theme-style', ''); - if (nonce) { - style.setAttribute('nonce', nonce); - } - style.appendChild(document.createTextNode(styleContent)); - head.insertBefore(style, firstChild); - } - } - }); - - GENERATED[theme.name] = true; - } - -} - - -function checkValidPalette(theme, colorType) { - // If theme attempts to use a palette that doesnt exist, throw error - if (!PALETTES[ (theme.colors[colorType] || {}).name ]) { - throw new Error( - "You supplied an invalid color palette for theme %1's %2 palette. Available palettes: %3" - .replace('%1', theme.name) - .replace('%2', colorType) - .replace('%3', Object.keys(PALETTES).join(', ')) - ); - } -} - -/** - * @param {string} clr rbg or rgba color - * @return {number[]|undefined} [red, green, blue] array if it can be computed - */ -function colorToRgbaArray(clr) { - if (angular.isArray(clr) && clr.length === 3) return clr; - if (/^rgb/.test(clr)) { - return clr.replace(/(^\s*rgba?\(|\)\s*$)/g, '').split(',').map(function(value, i) { - return i === 3 ? parseFloat(value) : parseInt(value, 10); - }); - } - if (clr.charAt(0) === '#') clr = clr.substring(1); - if (!/^([a-fA-F0-9]{3}){1,2}$/g.test(clr)) return; - - var dig = clr.length / 3; - var red = clr.substr(0, dig); - var grn = clr.substr(dig, dig); - var blu = clr.substr(dig * 2); - if (dig === 1) { - red += red; - grn += grn; - blu += blu; - } - return [parseInt(red, 16), parseInt(grn, 16), parseInt(blu, 16)]; -} - -function rgba(rgbArray, opacity) { - if (!rgbArray) return "rgb('0,0,0')"; - - if (rgbArray.length === 4) { - rgbArray = angular.copy(rgbArray); - opacity ? rgbArray.pop() : opacity = rgbArray.pop(); - } - return opacity && (typeof opacity == 'number' || (typeof opacity == 'string' && opacity.length)) ? - 'rgba(' + rgbArray.join(',') + ',' + opacity + ')' : - 'rgb(' + rgbArray.join(',') + ')'; -} - - -})(window.angular); - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.autocomplete - */ -/* - * @see js folder for autocomplete implementation - */ -angular.module('material.components.autocomplete', [ - 'material.core', - 'material.components.icon', - 'material.components.virtualRepeat' -]); - -})(); -(function(){ -"use strict"; - - -MdAutocompleteCtrl.$inject = ["$scope", "$element", "$mdUtil", "$mdConstant", "$mdTheming", "$window", "$animate", "$rootElement", "$attrs", "$q", "$log", "$mdLiveAnnouncer"];angular - .module('material.components.autocomplete') - .controller('MdAutocompleteCtrl', MdAutocompleteCtrl); - -var ITEM_HEIGHT = 48, - MAX_ITEMS = 5, - MENU_PADDING = 8, - INPUT_PADDING = 2, // Padding provided by `md-input-container` - MODE_STANDARD = 'standard', - MODE_VIRTUAL = 'virtual'; - -function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming, $window, - $animate, $rootElement, $attrs, $q, $log, $mdLiveAnnouncer) { - - // Internal Variables. - var ctrl = this, - itemParts = $scope.itemsExpr.split(/ in /i), - itemExpr = itemParts[ 1 ], - elements = null, - cache = {}, - noBlur = false, - selectedItemWatchers = [], - hasFocus = false, - fetchesInProgress = 0, - enableWrapScroll = null, - inputModelCtrl = null, - debouncedOnResize = $mdUtil.debounce(onWindowResize), - mode = MODE_VIRTUAL; // default - - /** - * The root document element. This is used for attaching a top-level click handler to - * close the options panel when a click outside said panel occurs. We use `documentElement` - * instead of body because, when scrolling is disabled, some browsers consider the body element - * to be completely off the screen and propagate events directly to the html element. - * @type {!Object} angular.JQLite - */ - ctrl.documentElement = angular.element(document.documentElement); - - // Public Exported Variables with handlers - defineProperty('hidden', handleHiddenChange, true); - - // Public Exported Variables - ctrl.scope = $scope; - ctrl.parent = $scope.$parent; - ctrl.itemName = itemParts[0]; - ctrl.matches = []; - ctrl.loading = false; - ctrl.hidden = true; - ctrl.index = -1; - ctrl.activeOption = null; - ctrl.id = $mdUtil.nextUid(); - ctrl.isDisabled = null; - ctrl.isRequired = null; - ctrl.isReadonly = null; - ctrl.hasNotFound = false; - ctrl.selectedMessage = $scope.selectedMessage || 'selected'; - ctrl.noMatchMessage = $scope.noMatchMessage || 'There are no matches available.'; - ctrl.singleMatchMessage = $scope.singleMatchMessage || 'There is 1 match available.'; - ctrl.multipleMatchStartMessage = $scope.multipleMatchStartMessage || 'There are '; - ctrl.multipleMatchEndMessage = $scope.multipleMatchEndMessage || ' matches available.'; - ctrl.defaultEscapeOptions = 'clear'; - - // Public Exported Methods - ctrl.keydown = keydown; - ctrl.blur = blur; - ctrl.focus = focus; - ctrl.clear = clearValue; - ctrl.select = select; - ctrl.listEnter = onListEnter; - ctrl.listLeave = onListLeave; - ctrl.focusInput = focusInputElement; - ctrl.getCurrentDisplayValue = getCurrentDisplayValue; - ctrl.registerSelectedItemWatcher = registerSelectedItemWatcher; - ctrl.unregisterSelectedItemWatcher = unregisterSelectedItemWatcher; - ctrl.notFoundVisible = notFoundVisible; - ctrl.loadingIsVisible = loadingIsVisible; - ctrl.positionDropdown = positionDropdown; - - /** - * Report types to be used for the $mdLiveAnnouncer - * @enum {number} Unique flag id. - */ - var ReportType = { - Count: 1, - Selected: 2 - }; - - return init(); - - // initialization methods - - /** - * Initialize the controller, setup watchers, gather elements - */ - function init () { - - $mdUtil.initOptionalProperties($scope, $attrs, { - searchText: '', - selectedItem: null, - clearButton: false, - disableVirtualRepeat: false, - }); - - $mdTheming($element); - configureWatchers(); - $mdUtil.nextTick(function () { - - gatherElements(); - moveDropdown(); - - // Touch devices often do not send a click event on tap. We still want to focus the input - // and open the options pop-up in these cases. - $element.on('touchstart', focusInputElement); - - // Forward all focus events to the input element when autofocus is enabled - if ($scope.autofocus) { - $element.on('focus', focusInputElement); - } - if ($scope.inputAriaDescribedBy) { - elements.input.setAttribute('aria-describedby', $scope.inputAriaDescribedBy); - } - if (!$scope.floatingLabel) { - if ($scope.inputAriaLabel) { - elements.input.setAttribute('aria-label', $scope.inputAriaLabel); - } else if ($scope.inputAriaLabelledBy) { - elements.input.setAttribute('aria-labelledby', $scope.inputAriaLabelledBy); - } else if ($scope.placeholder) { - // If no aria-label or aria-labelledby references are defined, then just label using the - // placeholder. - elements.input.setAttribute('aria-label', $scope.placeholder); - } - } - }); - } - - function updateModelValidators() { - if (!$scope.requireMatch || !inputModelCtrl) return; - - inputModelCtrl.$setValidity('md-require-match', !!$scope.selectedItem || !$scope.searchText); - } - - /** - * Calculates the dropdown's position and applies the new styles to the menu element - * @returns {*} - */ - function positionDropdown () { - if (!elements) { - return $mdUtil.nextTick(positionDropdown, false, $scope); - } - - var dropdownHeight = ($scope.dropdownItems || MAX_ITEMS) * ITEM_HEIGHT; - var hrect = elements.wrap.getBoundingClientRect(), - vrect = elements.snap.getBoundingClientRect(), - root = elements.root.getBoundingClientRect(), - top = vrect.bottom - root.top, - bot = root.bottom - vrect.top, - left = hrect.left - root.left, - width = hrect.width, - offset = getVerticalOffset(), - position = $scope.dropdownPosition, - styles, enoughBottomSpace, enoughTopSpace; - var bottomSpace = root.bottom - vrect.bottom - MENU_PADDING + $mdUtil.getViewportTop(); - var topSpace = vrect.top - MENU_PADDING; - - // Automatically determine dropdown placement based on available space in viewport. - if (!position) { - enoughTopSpace = topSpace > dropdownHeight; - enoughBottomSpace = bottomSpace > dropdownHeight; - if (enoughBottomSpace) { - position = 'bottom'; - } else if (enoughTopSpace) { - position = 'top'; - } else { - position = topSpace > bottomSpace ? 'top' : 'bottom'; - } - } - // Adjust the width to account for the padding provided by `md-input-container` - if ($attrs.mdFloatingLabel) { - left += INPUT_PADDING; - width -= INPUT_PADDING * 2; - } - styles = { - left: left + 'px', - minWidth: width + 'px', - maxWidth: Math.max(hrect.right - root.left, root.right - hrect.left) - MENU_PADDING + 'px' - }; - - if (position === 'top') { - styles.top = 'auto'; - styles.bottom = bot + 'px'; - styles.maxHeight = Math.min(dropdownHeight, topSpace) + 'px'; - } else { - bottomSpace = root.bottom - hrect.bottom - MENU_PADDING + $mdUtil.getViewportTop(); - - styles.top = (top - offset) + 'px'; - styles.bottom = 'auto'; - styles.maxHeight = Math.min(dropdownHeight, bottomSpace) + 'px'; - } - - elements.$.scrollContainer.css(styles); - $mdUtil.nextTick(correctHorizontalAlignment, false, $scope); - - /** - * Calculates the vertical offset for floating label examples to account for ngMessages - * @returns {number} - */ - function getVerticalOffset () { - var offset = 0; - var inputContainer = $element.find('md-input-container'); - if (inputContainer.length) { - var input = inputContainer.find('input'); - offset = inputContainer.prop('offsetHeight'); - offset -= input.prop('offsetTop'); - offset -= input.prop('offsetHeight'); - // add in the height left up top for the floating label text - offset += inputContainer.prop('offsetTop'); - } - return offset; - } - - /** - * Makes sure that the menu doesn't go off of the screen on either side. - */ - function correctHorizontalAlignment () { - var dropdown = elements.scrollContainer.getBoundingClientRect(), - styles = {}; - if (dropdown.right > root.right) { - styles.left = (hrect.right - dropdown.width) + 'px'; - } - elements.$.scrollContainer.css(styles); - } - } - - /** - * Moves the dropdown menu to the body tag in order to avoid z-index and overflow issues. - */ - function moveDropdown () { - if (!elements.$.root.length) return; - $mdTheming(elements.$.scrollContainer); - elements.$.scrollContainer.detach(); - elements.$.root.append(elements.$.scrollContainer); - if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement); - } - - /** - * Sends focus to the input element. - */ - function focusInputElement () { - elements.input.focus(); - } - - /** - * Update the activeOption based on the selected item in the listbox. - * The activeOption is used in the template to set the aria-activedescendant attribute, which - * enables screen readers to properly handle visual focus within the listbox and announce the - * item's place in the list. I.e. "List item 3 of 50". Anytime that `ctrl.index` changes, this - * function needs to be called to update the activeOption. - */ - function updateActiveOption() { - var selectedOption = elements.scroller.querySelector('.selected'); - if (selectedOption) { - ctrl.activeOption = selectedOption.id; - } else { - ctrl.activeOption = null; - } - } - - /** - * Sets up any watchers used by autocomplete - */ - function configureWatchers () { - var wait = parseInt($scope.delay, 10) || 0; - - $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); }); - $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); }); - $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); }); - - $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText); - $scope.$watch('selectedItem', selectedItemChange); - - angular.element($window).on('resize', debouncedOnResize); - - $scope.$on('$destroy', cleanup); - } - - /** - * Removes any events or leftover elements created by this controller - */ - function cleanup () { - if (!ctrl.hidden) { - $mdUtil.enableScrolling(); - } - - angular.element($window).off('resize', debouncedOnResize); - - if (elements){ - var items = ['ul', 'scroller', 'scrollContainer', 'input']; - angular.forEach(items, function(key){ - elements.$[key].remove(); - }); - } - } - - /** - * Event handler to be called whenever the window resizes. - */ - function onWindowResize() { - if (!ctrl.hidden) { - positionDropdown(); - } - } - - /** - * Gathers all of the elements needed for this controller - */ - function gatherElements () { - - var snapWrap = gatherSnapWrap(); - - elements = { - main: $element[0], - scrollContainer: $element[0].querySelector('.md-virtual-repeat-container, .md-standard-list-container'), - scroller: $element[0].querySelector('.md-virtual-repeat-scroller, .md-standard-list-scroller'), - ul: $element.find('ul')[0], - input: $element.find('input')[0], - wrap: snapWrap.wrap, - snap: snapWrap.snap, - root: document.body, - }; - - elements.li = elements.ul.getElementsByTagName('li'); - elements.$ = getAngularElements(elements); - mode = elements.scrollContainer.classList.contains('md-standard-list-container') ? MODE_STANDARD : MODE_VIRTUAL; - inputModelCtrl = elements.$.input.controller('ngModel'); - } - - /** - * Gathers the snap and wrap elements - * - */ - function gatherSnapWrap() { - var element; - var value; - for (element = $element; element.length; element = element.parent()) { - value = element.attr('md-autocomplete-snap'); - if (angular.isDefined(value)) break; - } - - if (element.length) { - return { - snap: element[0], - wrap: (value.toLowerCase() === 'width') ? element[0] : $element.find('md-autocomplete-wrap')[0] - }; - } - - var wrap = $element.find('md-autocomplete-wrap')[0]; - return { - snap: wrap, - wrap: wrap - }; - } - - /** - * Gathers angular-wrapped versions of each element - * @param elements - * @returns {{}} - */ - function getAngularElements (elements) { - var obj = {}; - for (var key in elements) { - if (elements.hasOwnProperty(key)) obj[ key ] = angular.element(elements[ key ]); - } - return obj; - } - - // event/change handlers - - /** - * @param {Event} $event - */ - function preventDefault($event) { - $event.preventDefault(); - } - - /** - * @param {Event} $event - */ - function stopPropagation($event) { - $event.stopPropagation(); - } - - /** - * Handles changes to the `hidden` property. - * @param {boolean} hidden true to hide the options pop-up, false to show it. - * @param {boolean} oldHidden the previous value of hidden - */ - function handleHiddenChange (hidden, oldHidden) { - var scrollContainerElement; - - if (elements) { - scrollContainerElement = angular.element(elements.scrollContainer); - } - if (!hidden && oldHidden) { - positionDropdown(); - - // Report in polite mode, because the screen reader should finish the default description of - // the input element. - reportMessages(true, ReportType.Count | ReportType.Selected); - - if (elements) { - $mdUtil.disableScrollAround(elements.scrollContainer); - enableWrapScroll = disableElementScrollEvents(elements.wrap); - if ($mdUtil.isIos) { - ctrl.documentElement.on('touchend', handleTouchOutsidePanel); - if (scrollContainerElement) { - scrollContainerElement.on('touchstart touchmove touchend', stopPropagation); - } - } - ctrl.index = getDefaultIndex(); - $mdUtil.nextTick(function() { - updateActiveOption(); - updateScroll(); - }); - } - } else if (hidden && !oldHidden) { - if ($mdUtil.isIos) { - ctrl.documentElement.off('touchend', handleTouchOutsidePanel); - if (scrollContainerElement) { - scrollContainerElement.off('touchstart touchmove touchend', stopPropagation); - } - } - $mdUtil.enableScrolling(); - - if (enableWrapScroll) { - enableWrapScroll(); - enableWrapScroll = null; - } - } - } - - /** - * Handling touch events that bubble up to the document is required for closing the dropdown - * panel on touch outside of the options pop-up panel on iOS. - * @param {Event} $event - */ - function handleTouchOutsidePanel($event) { - ctrl.hidden = true; - // iOS does not blur the pop-up for touches on the scroll mask, so we have to do it. - doBlur(true); - } - - /** - * Disables scrolling for a specific element. - * @param {!string|!DOMElement} element to disable scrolling - * @return {Function} function to call to re-enable scrolling for the element - */ - function disableElementScrollEvents(element) { - var elementToDisable = angular.element(element); - elementToDisable.on('wheel touchmove', preventDefault); - - return function() { - elementToDisable.off('wheel touchmove', preventDefault); - }; - } - - /** - * When the user mouses over the dropdown menu, ignore blur events. - */ - function onListEnter () { - noBlur = true; - } - - /** - * When the user's mouse leaves the menu, blur events may hide the menu again. - */ - function onListLeave () { - if (!hasFocus && !ctrl.hidden) elements.input.focus(); - noBlur = false; - ctrl.hidden = shouldHide(); - } - - /** - * Handles changes to the selected item. - * @param selectedItem - * @param previousSelectedItem - */ - function selectedItemChange (selectedItem, previousSelectedItem) { - - updateModelValidators(); - - if (selectedItem) { - getDisplayValue(selectedItem).then(function (val) { - $scope.searchText = val; - handleSelectedItemChange(selectedItem, previousSelectedItem); - }); - } else if (previousSelectedItem && $scope.searchText) { - getDisplayValue(previousSelectedItem).then(function(displayValue) { - // Clear the searchText, when the selectedItem is set to null. - // Do not clear the searchText, when the searchText isn't matching with the previous - // selected item. - if (angular.isString($scope.searchText) - && displayValue.toString().toLowerCase() === $scope.searchText.toLowerCase()) { - $scope.searchText = ''; - } - }); - } - - if (selectedItem !== previousSelectedItem) { - announceItemChange(); - } - } - - /** - * Use the user-defined expression to announce changes each time a new item is selected - */ - function announceItemChange () { - angular.isFunction($scope.itemChange) && - $scope.itemChange(getItemAsNameVal($scope.selectedItem)); - } - - /** - * Use the user-defined expression to announce changes each time the search text is changed - */ - function announceTextChange () { - angular.isFunction($scope.textChange) && $scope.textChange(); - } - - /** - * Calls any external watchers listening for the selected item. Used in conjunction with - * `registerSelectedItemWatcher`. - * @param selectedItem - * @param previousSelectedItem - */ - function handleSelectedItemChange (selectedItem, previousSelectedItem) { - selectedItemWatchers.forEach(function (watcher) { - watcher(selectedItem, previousSelectedItem); - }); - } - - /** - * Register a function to be called when the selected item changes. - * @param cb - */ - function registerSelectedItemWatcher (cb) { - if (selectedItemWatchers.indexOf(cb) === -1) { - selectedItemWatchers.push(cb); - } - } - - /** - * Unregister a function previously registered for selected item changes. - * @param cb - */ - function unregisterSelectedItemWatcher (cb) { - var i = selectedItemWatchers.indexOf(cb); - if (i !== -1) { - selectedItemWatchers.splice(i, 1); - } - } - - /** - * Handles changes to the searchText property. - * @param {string} searchText - * @param {string} previousSearchText - */ - function handleSearchText (searchText, previousSearchText) { - ctrl.index = getDefaultIndex(); - - // do nothing on init - if (searchText === previousSearchText) return; - - updateModelValidators(); - - getDisplayValue($scope.selectedItem).then(function (val) { - // clear selected item if search text no longer matches it - if (searchText !== val) { - $scope.selectedItem = null; - - // trigger change event if available - if (searchText !== previousSearchText) { - announceTextChange(); - } - - // cancel results if search text is not long enough - if (!isMinLengthMet()) { - ctrl.matches = []; - - setLoading(false); - reportMessages(true, ReportType.Count); - - } else { - handleQuery(); - } - } - }); - - } - - /** - * Handles input blur event, determines if the dropdown should hide. - * @param {Event=} $event - */ - function blur($event) { - hasFocus = false; - - if (!noBlur) { - ctrl.hidden = shouldHide(); - evalAttr('ngBlur', { $event: $event }); - } else if (angular.isObject($event)) { - $event.stopImmediatePropagation(); - } - } - - /** - * Force blur on input element - * @param {boolean} forceBlur - */ - function doBlur(forceBlur) { - if (forceBlur) { - noBlur = false; - hasFocus = false; - } - elements.input.blur(); - } - - /** - * Handles input focus event, determines if the dropdown should show. - */ - function focus($event) { - hasFocus = true; - - if (isSearchable() && isMinLengthMet()) { - handleQuery(); - } - - ctrl.hidden = shouldHide(); - - evalAttr('ngFocus', { $event: $event }); - } - - /** - * Handles keyboard input. - * @param event - */ - function keydown (event) { - switch (event.keyCode) { - case $mdConstant.KEY_CODE.DOWN_ARROW: - if (ctrl.loading || hasSelection()) return; - event.stopPropagation(); - event.preventDefault(); - ctrl.index = ctrl.index + 1 > ctrl.matches.length - 1 ? 0 : Math.min(ctrl.index + 1, ctrl.matches.length - 1); - $mdUtil.nextTick(updateActiveOption); - updateScroll(); - break; - case $mdConstant.KEY_CODE.UP_ARROW: - if (ctrl.loading || hasSelection()) return; - event.stopPropagation(); - event.preventDefault(); - ctrl.index = ctrl.index - 1 < 0 ? ctrl.matches.length - 1 : Math.max(0, ctrl.index - 1); - $mdUtil.nextTick(updateActiveOption); - updateScroll(); - break; - case $mdConstant.KEY_CODE.TAB: - // If we hit tab, assume that we've left the list so it will close - onListLeave(); - - if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return; - select(ctrl.index); - break; - case $mdConstant.KEY_CODE.ENTER: - if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return; - if (hasSelection()) return; - event.stopImmediatePropagation(); - event.preventDefault(); - select(ctrl.index); - break; - case $mdConstant.KEY_CODE.ESCAPE: - event.preventDefault(); // Prevent browser from always clearing input - if (!shouldProcessEscape()) return; - event.stopPropagation(); - - clearSelectedItem(); - if ($scope.searchText && hasEscapeOption('clear')) { - clearSearchText(); - } - - // Manually hide (needed for mdNotFound support) - ctrl.hidden = true; - - if (hasEscapeOption('blur')) { - // Force the component to blur if they hit escape - doBlur(true); - } - - break; - default: - } - } - - // getters - - /** - * Returns the minimum length needed to display the dropdown. - * @returns {*} - */ - function getMinLength () { - return angular.isNumber($scope.minLength) ? $scope.minLength : 1; - } - - /** - * Returns the display value for an item. - * @param {*} item - * @returns {*} - */ - function getDisplayValue (item) { - return $q.when(getItemText(item) || item).then(function(itemText) { - if (itemText && !angular.isString(itemText)) { - $log.warn('md-autocomplete: Could not resolve display value to a string. ' + - 'Please check the `md-item-text` attribute.'); - } - - return itemText; - }); - - /** - * Getter function to invoke user-defined expression (in the directive) - * to convert your object to a single string. - * @param {*} item - * @returns {string|null} - */ - function getItemText (item) { - return (item && $scope.itemText) ? $scope.itemText(getItemAsNameVal(item)) : null; - } - } - - /** - * Returns the locals object for compiling item templates. - * @param {*} item - * @returns {Object|undefined} - */ - function getItemAsNameVal (item) { - if (!item) { - return undefined; - } - - var locals = {}; - if (ctrl.itemName) { - locals[ ctrl.itemName ] = item; - } - - return locals; - } - - /** - * Returns the default index based on whether or not autoselect is enabled. - * @returns {number} 0 if autoselect is enabled, -1 if not. - */ - function getDefaultIndex () { - return $scope.autoselect ? 0 : -1; - } - - /** - * Sets the loading parameter and updates the hidden state. - * @param value {boolean} Whether or not the component is currently loading. - */ - function setLoading(value) { - if (ctrl.loading !== value) { - ctrl.loading = value; - } - - // Always refresh the hidden variable as something else might have changed - ctrl.hidden = shouldHide(); - } - - /** - * Determines if the menu should be hidden. - * @returns {boolean} true if the menu should be hidden - */ - function shouldHide () { - return !shouldShow(); - } - - /** - * Determines whether the autocomplete is able to query within the current state. - * @returns {boolean} true if the query can be run - */ - function isSearchable() { - if (ctrl.loading && !hasMatches()) { - // No query when query is in progress. - return false; - } else if (hasSelection()) { - // No query if there is already a selection - return false; - } - else if (!hasFocus) { - // No query if the input does not have focus - return false; - } - return true; - } - - /** - * @returns {boolean} if the escape keydown should be processed, return true. - * Otherwise return false. - */ - function shouldProcessEscape() { - return hasEscapeOption('blur') || !ctrl.hidden || ctrl.loading || hasEscapeOption('clear') && $scope.searchText; - } - - /** - * @param {string} option check if this option is set - * @returns {boolean} if the specified escape option is set, return true. Return false otherwise. - */ - function hasEscapeOption(option) { - if (!angular.isString($scope.escapeOptions)) { - return ctrl.defaultEscapeOptions.indexOf(option) !== -1; - } else { - return $scope.escapeOptions.toLowerCase().indexOf(option) !== -1; - } - } - - /** - * Determines if the menu should be shown. - * @returns {boolean} true if the menu should be shown - */ - function shouldShow() { - if (ctrl.isReadonly) { - // Don't show if read only is set - return false; - } else if (!isSearchable()) { - // Don't show if a query is in progress, there is already a selection, - // or the input is not focused. - return false; - } - return (isMinLengthMet() && hasMatches()) || notFoundVisible(); - } - - /** - * @returns {boolean} true if the search text has matches. - */ - function hasMatches() { - return ctrl.matches.length ? true : false; - } - - /** - * @returns {boolean} true if the autocomplete has a valid selection. - */ - function hasSelection() { - return ctrl.scope.selectedItem ? true : false; - } - - /** - * @returns {boolean} true if the loading indicator is, or should be, visible. - */ - function loadingIsVisible() { - return ctrl.loading && !hasSelection(); - } - - /** - * @returns {*} the display value of the current item. - */ - function getCurrentDisplayValue () { - return getDisplayValue(ctrl.matches[ ctrl.index ]); - } - - /** - * Determines if the minimum length is met by the search text. - * @returns {*} true if the minimum length is met by the search text - */ - function isMinLengthMet () { - return ($scope.searchText || '').length >= getMinLength(); - } - - // actions - - /** - * Defines a public property with a handler and a default value. - * @param {string} key - * @param {Function} handler function - * @param {*} defaultValue default value - */ - function defineProperty (key, handler, defaultValue) { - Object.defineProperty(ctrl, key, { - get: function () { return defaultValue; }, - set: function (newValue) { - var oldValue = defaultValue; - defaultValue = newValue; - handler(newValue, oldValue); - } - }); - } - - /** - * Selects the item at the given index. - * @param {number} index to select - */ - function select (index) { - // force form to update state for validation - $mdUtil.nextTick(function () { - getDisplayValue(ctrl.matches[ index ]).then(function (val) { - var ngModel = elements.$.input.controller('ngModel'); - $mdLiveAnnouncer.announce(val + ' ' + ctrl.selectedMessage, 'assertive'); - ngModel.$setViewValue(val); - ngModel.$render(); - }).finally(function () { - $scope.selectedItem = ctrl.matches[ index ]; - setLoading(false); - }); - }, false); - } - - /** - * Clears the searchText value and selected item. - * @param {Event} $event - */ - function clearValue ($event) { - if ($event) { - $event.stopPropagation(); - } - clearSelectedItem(); - clearSearchText(); - } - - /** - * Clears the selected item - */ - function clearSelectedItem () { - // Reset our variables - ctrl.index = -1; - $mdUtil.nextTick(updateActiveOption); - ctrl.matches = []; - } - - /** - * Clears the searchText value - */ - function clearSearchText () { - // Set the loading to true so we don't see flashes of content. - // The flashing will only occur when an async request is running. - // So the loading process will stop when the results had been retrieved. - setLoading(true); - - $scope.searchText = ''; - - // Normally, triggering the change / input event is unnecessary, because the browser detects it properly. - // But some browsers are not detecting it properly, which means that we have to trigger the event. - // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event. - // The `change` event is a good alternative and is supported by all supported browsers. - var eventObj = document.createEvent('CustomEvent'); - eventObj.initCustomEvent('change', true, true, { value: '' }); - elements.input.dispatchEvent(eventObj); - - // For some reason, firing the above event resets the value of $scope.searchText if - // $scope.searchText has a space character at the end, so we blank it one more time and then - // focus. - elements.input.blur(); - $scope.searchText = ''; - elements.input.focus(); - } - - /** - * Fetches the results for the provided search text. - * @param searchText - */ - function fetchResults (searchText) { - var items = $scope.$parent.$eval(itemExpr), - term = searchText.toLowerCase(), - isList = angular.isArray(items), - isPromise = !!items.then; // Every promise should contain a `then` property - - if (isList) onResultsRetrieved(items); - else if (isPromise) handleAsyncResults(items); - - function handleAsyncResults(items) { - if (!items) return; - - items = $q.when(items); - fetchesInProgress++; - setLoading(true); - - $mdUtil.nextTick(function () { - items - .then(onResultsRetrieved) - .finally(function(){ - if (--fetchesInProgress === 0) { - setLoading(false); - } - }); - },true, $scope); - } - - function onResultsRetrieved(matches) { - cache[term] = matches; - - // Just cache the results if the request is now outdated. - // The request becomes outdated, when the new searchText has changed during the result fetching. - if ((searchText || '') !== ($scope.searchText || '')) { - return; - } - - handleResults(matches); - } - } - - - /** - * Reports given message types to supported screen readers. - * @param {boolean} isPolite Whether the announcement should be polite. - * @param {!number} types Message flags to be reported to the screen reader. - */ - function reportMessages(isPolite, types) { - var politeness = isPolite ? 'polite' : 'assertive'; - var messages = []; - - if (types & ReportType.Selected && ctrl.index !== -1) { - messages.push(getCurrentDisplayValue()); - } - - if (types & ReportType.Count) { - messages.push($q.resolve(getCountMessage())); - } - - $q.all(messages).then(function(data) { - $mdLiveAnnouncer.announce(data.join(' '), politeness); - }); - } - - /** - * @returns {string} the ARIA message for how many results match the current query. - */ - function getCountMessage () { - switch (ctrl.matches.length) { - case 0: - return ctrl.noMatchMessage; - case 1: - return ctrl.singleMatchMessage; - default: - return ctrl.multipleMatchStartMessage + ctrl.matches.length + ctrl.multipleMatchEndMessage; - } - } - - /** - * Makes sure that the focused element is within view. - */ - function updateScroll () { - if (!elements.li[0]) return; - if (mode === MODE_STANDARD) { - updateStandardScroll(); - } else { - updateVirtualScroll(); - } - } - - function updateVirtualScroll() { - // elements in virtual scroll have consistent heights - var optionHeight = elements.li[0].offsetHeight, - top = optionHeight * Math.max(0, ctrl.index), - bottom = top + optionHeight, - containerHeight = elements.scroller.clientHeight, - scrollTop = elements.scroller.scrollTop; - - if (top < scrollTop) { - scrollTo(top); - } else if (bottom > scrollTop + containerHeight) { - scrollTo(bottom - containerHeight); - } - } - - function updateStandardScroll() { - // elements in standard scroll have variable heights - var selected = elements.li[Math.max(0, ctrl.index)]; - var containerHeight = elements.scrollContainer.offsetHeight, - top = selected && selected.offsetTop || 0, - bottom = top + selected.clientHeight, - scrollTop = elements.scrollContainer.scrollTop; - - if (top < scrollTop) { - scrollTo(top); - } else if (bottom > scrollTop + containerHeight) { - scrollTo(bottom - containerHeight); - } - } - - function isPromiseFetching() { - return fetchesInProgress !== 0; - } - - function scrollTo (offset) { - if (mode === MODE_STANDARD) { - elements.scrollContainer.scrollTop = offset; - } else { - elements.$.scrollContainer.controller('mdVirtualRepeatContainer').scrollTo(offset); - } - } - - function notFoundVisible () { - var textLength = (ctrl.scope.searchText || '').length; - - return ctrl.hasNotFound && !hasMatches() && (!ctrl.loading || isPromiseFetching()) && textLength >= getMinLength() && (hasFocus || noBlur) && !hasSelection(); - } - - /** - * Starts the query to gather the results for the current searchText. Attempts to return cached - * results first, then forwards the process to `fetchResults` if necessary. - */ - function handleQuery () { - var searchText = $scope.searchText || ''; - var term = searchText.toLowerCase(); - - // If caching is enabled and the current searchText is stored in the cache - if (!$scope.noCache && cache[term]) { - // The results should be handled as same as a normal un-cached request does. - handleResults(cache[term]); - } else { - fetchResults(searchText); - } - - ctrl.hidden = shouldHide(); - } - - /** - * Handles the retrieved results by showing them in the autocompletes dropdown. - * @param results Retrieved results - */ - function handleResults(results) { - ctrl.matches = results; - ctrl.hidden = shouldHide(); - - // If loading is in progress, then we'll end the progress. This is needed for example, - // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing. - if (ctrl.loading) setLoading(false); - - if ($scope.selectOnMatch) selectItemOnMatch(); - - positionDropdown(); - reportMessages(true, ReportType.Count); - } - - /** - * If there is only one matching item and the search text matches its display value exactly, - * automatically select that item. Note: This function is only called if the user uses the - * `md-select-on-match` flag. - */ - function selectItemOnMatch () { - var searchText = $scope.searchText, - matches = ctrl.matches, - item = matches[ 0 ]; - if (matches.length === 1) getDisplayValue(item).then(function (displayValue) { - var isMatching = searchText === displayValue; - if ($scope.matchInsensitive && !isMatching) { - isMatching = searchText.toLowerCase() === displayValue.toLowerCase(); - } - - if (isMatching) { - select(0); - } - }); - } - - /** - * Evaluates an attribute expression against the parent scope. - * @param {String} attr Name of the attribute to be evaluated. - * @param {Object?} locals Properties to be injected into the evaluation context. - */ - function evalAttr(attr, locals) { - if ($attrs[attr]) { - $scope.$parent.$eval($attrs[attr], locals || {}); - } - } - -} - -})(); -(function(){ -"use strict"; - - -MdAutocomplete.$inject = ["$$mdSvgRegistry"];angular - .module('material.components.autocomplete') - .directive('mdAutocomplete', MdAutocomplete); - -/** - * @ngdoc directive - * @name mdAutocomplete - * @module material.components.autocomplete - * - * @description - * `` is a special input component with a drop-down of all possible matches to a - * custom query. This component allows you to provide real-time suggestions as the user types - * in the input area. - * - * To start, you will need to specify the required parameters and provide a template for your - * results. The content inside `md-autocomplete` will be treated as a template. - * - * In more complex cases, you may want to include other content such as a message to display when - * no matches were found. You can do this by wrapping your template in `md-item-template` and - * adding a tag for `md-not-found`. An example of this is shown below. - * - * To reset the displayed value you must clear both values for `md-search-text` and - * `md-selected-item`. - * - * ### Validation - * - * You can use `ng-messages` to include validation the same way that you would normally validate; - * however, if you want to replicate a standard input with a floating label, you will have to - * do the following: - * - * - Make sure that your template is wrapped in `md-item-template` - * - Add your `ng-messages` code inside of `md-autocomplete` - * - Add your validation properties to `md-autocomplete` (ie. `required`) - * - Add a `name` to `md-autocomplete` (to be used on the generated `input`) - * - * There is an example below of how this should look. - * - * ### Snapping Drop-Down - * - * You can cause the autocomplete drop-down to snap to an ancestor element by applying the - * `md-autocomplete-snap` attribute to that element. You can also snap to the width of - * the `md-autocomplete-snap` element by setting the attribute's value to `width` - * (ie. `md-autocomplete-snap="width"`). - * - * ### Notes - * - * **Autocomplete Dropdown Items Rendering** - * - * The `md-autocomplete` uses the the - * mdVirtualRepeat directive for displaying the results inside of the dropdown.
    - * - * > When encountering issues regarding the item template please take a look at the - * VirtualRepeatContainer documentation. - * - * **Autocomplete inside of a Virtual Repeat** - * - * When using the `md-autocomplete` directive inside of a - * VirtualRepeatContainer the dropdown items - * might not update properly, because caching of the results is enabled by default. - * - * The autocomplete will then show invalid dropdown items, because the Virtual Repeat only updates - * the scope bindings rather than re-creating the `md-autocomplete`. This means that the previous - * cached results will be used. - * - * > To avoid such problems, ensure that the autocomplete does not cache any results via - * `md-no-cache="true"`: - * - * - * - * {{ item.display }} - * - * - * - * - * @param {expression} md-items An expression in the format of `item in results` to iterate over - * matches for your search.

    - * The `results` expression can be also a function, which returns the results synchronously - * or asynchronously (per Promise). - * @param {expression=} md-selected-item-change An expression to be run each time a new item is - * selected. - * @param {expression=} md-search-text-change An expression to be run each time the search text - * updates. - * @param {expression=} md-search-text A model to bind the search query text to. - * @param {object=} md-selected-item A model to bind the selected item to. - * @param {expression=} md-item-text An expression that will convert your object to a single string. - * @param {string=} placeholder Placeholder text that will be forwarded to the input. - * @param {boolean=} md-no-cache Disables the internal caching that happens in autocomplete. - * @param {boolean=} ng-disabled Determines whether or not to disable the input field. - * @param {boolean=} md-require-match When set to true, the autocomplete will add a validator, - * which will evaluate to false, when no item is currently selected. - * @param {number=} md-min-length Specifies the minimum length of text before autocomplete will - * make suggestions. - * @param {number=} md-delay Specifies the amount of time (in milliseconds) to wait before looking - * for results. - * @param {boolean=} md-clear-button Whether the clear button for the autocomplete input should show - * up or not. When `md-floating-label` is set, defaults to false, defaults to true otherwise. - * @param {boolean=} md-autofocus If true, the autocomplete will be automatically focused when a - * `$mdDialog`, `$mdBottomsheet` or `$mdSidenav`, which contains the autocomplete, is opening. - *

    - * Also the autocomplete will immediately focus the input element. - * @param {boolean=} md-no-asterisk When present, asterisk will not be appended to the floating - * label. - * @param {boolean=} md-autoselect If set to true, the first item will be automatically selected - * in the dropdown upon open. - * @param {string=} md-input-name The name attribute given to the input element to be used with - * FormController. - * @param {string=} md-menu-class This class will be applied to the dropdown menu for styling. - * @param {string=} md-menu-container-class This class will be applied to the parent container - * of the dropdown panel. - * @param {string=} md-input-class This will be applied to the input for styling. This attribute - * is only valid when a `md-floating-label` is defined. - * @param {string=} md-floating-label This will add a floating label to autocomplete and wrap it in - * `md-input-container`. - * @param {string=} md-select-on-focus When present the input's text will be automatically selected - * on focus. - * @param {string=} md-input-id An ID to be added to the input element. - * @param {number=} md-input-minlength The minimum length for the input's value for validation. - * @param {number=} md-input-maxlength The maximum length for the input's value for validation. - * @param {boolean=} md-select-on-match When set, autocomplete will automatically select - * the item if the search text is an exact match.

    - * An exact match is when only one match is displayed. - * @param {boolean=} md-match-case-insensitive When set and using `md-select-on-match`, autocomplete - * will select on case-insensitive match. - * @param {string=} md-escape-options Override escape key logic. Default is `clear`.
    - * Options: `blur`, `clear`, `none`. - * @param {string=} md-dropdown-items Specifies the maximum amount of items to be shown in - * the dropdown.

    - * When the dropdown doesn't fit into the viewport, the dropdown will shrink - * as much as possible. - * @param {string=} md-dropdown-position Overrides the default dropdown position. Options: `top`, - * `bottom`. - * @param {string=} input-aria-describedby A space-separated list of element IDs. This should - * contain the IDs of any elements that describe this autocomplete. Screen readers will read the - * content of these elements at the end of announcing that the autocomplete has been selected - * and describing its current state. The descriptive elements do not need to be visible on the - * page. - * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use case - * is that this would contain the ID of a `
    ' : ''; - } - - function getRepeatType(repeatMode) { - return isVirtualRepeatDisabled(repeatMode) ? - 'ng-repeat' : 'md-virtual-repeat'; - } - - function isVirtualRepeatDisabled(repeatMode) { - // ensure we have a valid repeat mode - var correctedRepeatMode = getRepeatMode(repeatMode); - return correctedRepeatMode !== REPEAT_VIRTUAL; - } - - function getInputElement () { - if (attr.mdFloatingLabel) { - return '\ - \ - \ - \ -
    ' + leftover + '
    \ -
    '; - } else { - return '\ - '; - } - } - - function getClearButton() { - return '' + - ''; - } - } - }; -} - -})(); -(function(){ -"use strict"; - - -MdAutocompleteItemScopeDirective.$inject = ["$compile", "$mdUtil"];angular - .module('material.components.autocomplete') - .directive('mdAutocompleteParentScope', MdAutocompleteItemScopeDirective); - -function MdAutocompleteItemScopeDirective($compile, $mdUtil) { - return { - restrict: 'AE', - compile: compile, - terminal: true, - transclude: 'element' - }; - - function compile(tElement, tAttr, transclude) { - return function postLink(scope, element, attr) { - var ctrl = scope.$mdAutocompleteCtrl; - var newScope = ctrl.parent.$new(); - var itemName = ctrl.itemName; - - // Watch for changes to our scope's variables and copy them to the new scope - watchVariable('$index', '$index'); - watchVariable('item', itemName); - - // Ensure that $digest calls on our scope trigger $digest on newScope. - connectScopes(); - - // Link the element against newScope. - transclude(newScope, function(clone) { - element.after(clone); - }); - - /** - * Creates a watcher for variables that are copied from the parent scope - * @param variable - * @param alias - */ - function watchVariable(variable, alias) { - newScope[alias] = scope[variable]; - - scope.$watch(variable, function(value) { - $mdUtil.nextTick(function() { - newScope[alias] = value; - }); - }); - } - - /** - * Creates watchers on scope and newScope that ensure that for any - * $digest of scope, newScope is also $digested. - */ - function connectScopes() { - var scopeDigesting = false; - var newScopeDigesting = false; - - scope.$watch(function() { - if (newScopeDigesting || scopeDigesting) { - return; - } - - scopeDigesting = true; - scope.$$postDigest(function() { - if (!newScopeDigesting) { - newScope.$digest(); - } - - scopeDigesting = newScopeDigesting = false; - }); - }); - - newScope.$watch(function() { - newScopeDigesting = true; - }); - } - }; - } -} -})(); -(function(){ -"use strict"; - - -MdHighlightCtrl.$inject = ["$scope", "$element", "$attrs", "$mdUtil"];angular - .module('material.components.autocomplete') - .controller('MdHighlightCtrl', MdHighlightCtrl); - -function MdHighlightCtrl ($scope, $element, $attrs, $mdUtil) { - this.$scope = $scope; - this.$element = $element; - this.$attrs = $attrs; - this.$mdUtil = $mdUtil; - - // Cache the Regex to avoid rebuilding each time. - this.regex = null; -} - -MdHighlightCtrl.prototype.init = function(unsafeTermFn, unsafeContentFn) { - - this.flags = this.$attrs.mdHighlightFlags || ''; - - this.unregisterFn = this.$scope.$watch(function($scope) { - return { - term: unsafeTermFn($scope), - contentText: unsafeContentFn($scope) - }; - }.bind(this), this.onRender.bind(this), true); - - this.$element.on('$destroy', this.unregisterFn); -}; - -/** - * Triggered once a new change has been recognized and the highlighted - * text needs to be updated. - */ -MdHighlightCtrl.prototype.onRender = function(state, prevState) { - - var contentText = state.contentText; - - /* Update the regex if it's outdated, because we don't want to rebuilt it constantly. */ - if (this.regex === null || state.term !== prevState.term) { - this.regex = this.createRegex(state.term, this.flags); - } - - /* If a term is available apply the regex to the content */ - if (state.term) { - this.applyRegex(contentText); - } else { - this.$element.text(contentText); - } - -}; - -/** - * Decomposes the specified text into different tokens (whether match or not). - * Breaking down the string guarantees proper XSS protection due to the native browser - * escaping of unsafe text. - */ -MdHighlightCtrl.prototype.applyRegex = function(text) { - var tokens = this.resolveTokens(text); - - this.$element.empty(); - - tokens.forEach(function (token) { - - if (token.isMatch) { - var tokenEl = angular.element('').text(token.text); - - this.$element.append(tokenEl); - } else { - this.$element.append(document.createTextNode(token)); - } - - }.bind(this)); - -}; - - /** - * Decomposes the specified text into different tokens by running the regex against the text. - */ -MdHighlightCtrl.prototype.resolveTokens = function(string) { - var tokens = []; - var lastIndex = 0; - - // Use replace here, because it supports global and single regular expressions at same time. - string.replace(this.regex, function(match, index) { - appendToken(lastIndex, index); - - tokens.push({ - text: match, - isMatch: true - }); - - lastIndex = index + match.length; - }); - - // Append the missing text as a token. - appendToken(lastIndex); - - return tokens; - - function appendToken(from, to) { - var targetText = string.slice(from, to); - targetText && tokens.push(targetText); - } -}; - -/** Creates a regex for the specified text with the given flags. */ -MdHighlightCtrl.prototype.createRegex = function(term, flags) { - var startFlag = '', endFlag = ''; - var regexTerm = this.$mdUtil.sanitize(term); - - if (flags.indexOf('^') >= 0) startFlag = '^'; - if (flags.indexOf('$') >= 0) endFlag = '$'; - - return new RegExp(startFlag + regexTerm + endFlag, flags.replace(/[$^]/g, '')); -}; - -})(); -(function(){ -"use strict"; - - -MdHighlight.$inject = ["$interpolate", "$parse"];angular - .module('material.components.autocomplete') - .directive('mdHighlightText', MdHighlight); - -/** - * @ngdoc directive - * @name mdHighlightText - * @module material.components.autocomplete - * - * @description - * The `md-highlight-text` directive allows you to specify text that should be highlighted within - * an element. Highlighted text will be wrapped in `` which can - * be styled through CSS. Please note that child elements may not be used with this directive. - * - * @param {string} md-highlight-text A model to be searched for - * @param {string=} md-highlight-flags A list of flags (loosely based on JavaScript RexExp flags). - * #### **Supported flags**: - * - `g`: Find all matches within the provided text - * - `i`: Ignore case when searching for matches - * - `$`: Only match if the text ends with the search term - * - `^`: Only match if the text begins with the search term - * - * @usage - * - * - *
      - *
    • - * {{result.text}} - *
    • - *
    - *
    - */ - -function MdHighlight ($interpolate, $parse) { - return { - terminal: true, - controller: 'MdHighlightCtrl', - compile: function mdHighlightCompile(tElement, tAttr) { - var termExpr = $parse(tAttr.mdHighlightText); - var unsafeContentExpr = $interpolate(tElement.html()); - - return function mdHighlightLink(scope, element, attr, ctrl) { - ctrl.init(termExpr, unsafeContentExpr); - }; - } - }; -} - -})(); -(function(){ -"use strict"; - -/* - * @ngdoc module - * @name material.components.backdrop - * @description Backdrop - */ - -/** - * @ngdoc directive - * @name mdBackdrop - * @module material.components.backdrop - * - * @restrict E - * - * @description - * `` is a backdrop element used by other components, such as dialog and bottom sheet. - * Apply class `opaque` to make the backdrop use the theme backdrop color. - * - */ - -angular - .module('material.components.backdrop', ['material.core']) - .directive('mdBackdrop', ["$mdTheming", "$mdUtil", "$animate", "$rootElement", "$window", "$log", "$$rAF", "$document", function BackdropDirective($mdTheming, $mdUtil, $animate, $rootElement, $window, $log, $$rAF, $document) { - var ERROR_CSS_POSITION = ' may not work properly in a scrolled, static-positioned parent container.'; - - return { - restrict: 'E', - link: postLink - }; - - function postLink(scope, element, attrs) { - // backdrop may be outside the $rootElement, tell ngAnimate to animate regardless - if ($animate.pin) $animate.pin(element, $rootElement); - - var bodyStyles; - - $$rAF(function() { - // If body scrolling has been disabled using mdUtil.disableBodyScroll(), - // adjust the 'backdrop' height to account for the fixed 'body' top offset. - // Note that this can be pretty expensive and is better done inside the $$rAF. - bodyStyles = $window.getComputedStyle($document[0].body); - - if (bodyStyles.position === 'fixed') { - var resizeHandler = $mdUtil.debounce(function(){ - bodyStyles = $window.getComputedStyle($document[0].body); - resize(); - }, 60, null, false); - - resize(); - angular.element($window).on('resize', resizeHandler); - - scope.$on('$destroy', function() { - angular.element($window).off('resize', resizeHandler); - }); - } - - // Often $animate.enter() is used to append the backDrop element - // so let's wait until $animate is done... - var parent = element.parent(); - - if (parent.length) { - if (parent[0].nodeName === 'BODY') { - element.css('position', 'fixed'); - } - - var styles = $window.getComputedStyle(parent[0]); - - if (styles.position === 'static') { - // backdrop uses position:absolute and will not work properly with parent position:static (default) - $log.warn(ERROR_CSS_POSITION); - } - - // Only inherit the parent if the backdrop has a parent. - $mdTheming.inherit(element, parent); - } - }); - - function resize() { - var viewportHeight = parseInt(bodyStyles.height, 10) + Math.abs(parseInt(bodyStyles.top, 10)); - element.css('height', viewportHeight + 'px'); - } - } - - }]); - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.bottomSheet - * @description - * BottomSheet - */ -MdBottomSheetDirective.$inject = ["$mdBottomSheet"]; -MdBottomSheetProvider.$inject = ["$$interimElementProvider"]; -angular - .module('material.components.bottomSheet', [ - 'material.core', - 'material.components.backdrop' - ]) - .directive('mdBottomSheet', MdBottomSheetDirective) - .provider('$mdBottomSheet', MdBottomSheetProvider); - -/* @ngInject */ -function MdBottomSheetDirective($mdBottomSheet) { - return { - restrict: 'E', - link : function postLink(scope, element) { - element.addClass('_md'); // private md component indicator for styling - - // When navigation force destroys an interimElement, then - // listen and $destroy() that interim instance... - scope.$on('$destroy', function() { - $mdBottomSheet.destroy(); - }); - } - }; -} - - -/** - * @ngdoc service - * @name $mdBottomSheet - * @module material.components.bottomSheet - * - * @description - * `$mdBottomSheet` opens a bottom sheet over the app and provides a simple promise API. - * - * ## Restrictions - * - * - The bottom sheet's template must have an outer `` element. - * - Add the `md-grid` class to the bottom sheet for a grid layout. - * - Add the `md-list` class to the bottom sheet for a list layout. - * - * @usage - * - *
    - * - * Open a Bottom Sheet! - * - *
    - *
    - * - * var app = angular.module('app', ['ngMaterial']); - * app.controller('MyController', function($scope, $mdBottomSheet) { - * $scope.openBottomSheet = function() { - * $mdBottomSheet.show({ - * template: '' + - * 'Hello! Close' + - * '' - * }) - * - * // Fires when the hide() method is used - * .then(function() { - * console.log('You clicked the button to close the bottom sheet!'); - * }) - * - * // Fires when the cancel() method is used - * .catch(function() { - * console.log('You hit escape or clicked the backdrop to close.'); - * }); - * }; - * - * $scope.closeBottomSheet = function($scope, $mdBottomSheet) { - * $mdBottomSheet.hide(); - * } - * - * }); - * - * - * ### Custom Presets - * Developers are also able to create their own preset, which can be easily used without repeating - * their options each time. - * - * - * $mdBottomSheetProvider.addPreset('testPreset', { - * options: function() { - * return { - * template: - * '' + - * 'This is a custom preset' + - * '', - * controllerAs: 'bottomSheet', - * bindToController: true, - * clickOutsideToClose: true, - * escapeToClose: true - * }; - * } - * }); - * - * - * After you create your preset during the config phase, you can easily access it. - * - * - * $mdBottomSheet.show( - * $mdBottomSheet.testPreset() - * ); - * - */ - -/** - * @ngdoc method - * @name $mdBottomSheet#show - * - * @description - * Show a bottom sheet with the specified options. - * - * Note: You should always provide a `.catch()` method in case the user hits the - * `esc` key or clicks the background to close. In this case, the `cancel()` method will - * automatically be called on the bottom sheet which will `reject()` the promise. See the @usage - * section above for an example. - * - * Newer versions of Angular will throw a `Possibly unhandled rejection` exception if you forget - * this. - * - * @param {Object} optionsOrPreset Either provide an `$mdBottomSheetPreset` defined during the - * config phase or an options object, with the following properties: - * - * - `templateUrl` - `{string=}`: The url of an html template file that will - * be used as the content of the bottom sheet. Restrictions: the template must - * have an outer `md-bottom-sheet` element. - * - `template` - `{string=}`: Same as templateUrl, except this is an actual - * template string. - * - `scope` - `{Object=}`: the scope to link the template / controller to. If none is specified, - * it will create a new child scope. This scope will be destroyed when the bottom sheet is - * removed unless `preserveScope` is set to true. - * - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. - * Default is false - * - `controller` - `{string=}`: The controller to associate with this bottom sheet. - * - `locals` - `{string=}`: An object containing key/value pairs. The keys will be used as names - * of values to inject into the controller. For example, `locals: {three: 3}` would inject - * `three` into the controller with the value of 3. - * - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the bottom sheet to - * close it. Default true. - * - `bindToController` - `{boolean=}`: When set to true, the locals will be bound to the - * controller instance and available in it's $onInit function. - * - `disableBackdrop` - `{boolean=}`: When set to true, the bottomsheet will not show a backdrop. - * - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the bottom sheet. - * Default true. - * - `isLockedOpen` - `{boolean=}`: Disables all default ways of closing the bottom sheet. - * **Note:** this will override the `clickOutsideToClose` and `escapeToClose` options, leaving - * only the `hide` and `cancel` methods as ways of closing the bottom sheet. Defaults to false. - * - `resolve` - `{Object=}`: Similar to locals, except it takes promises as values - * and the bottom sheet will not open until the promises resolve. - * - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope. - * - `parent` - `{element=}`: The element to append the bottom sheet to. The `parent` may be a - * `function`, `string`, `Object`, or null. Defaults to appending to the body of the root element - * (or the root element) of the application. - * e.g. angular.element(document.getElementById('content')) or "#content" - * - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the bottom sheet is - * open. Default true. - * - * @returns {promise} A promise that can be resolved with `$mdBottomSheet.hide()` or - * rejected with `$mdBottomSheet.cancel()`. - */ - -/** - * @ngdoc method - * @name $mdBottomSheet#hide - * - * @description - * Hide the existing bottom sheet and resolve the promise returned from - * `$mdBottomSheet.show()`. This call will close the most recently opened/current bottom sheet (if - * any). - * - * Note: Use a `.then()` on your `.show()` to handle this callback. - * - * @param {*=} response An argument for the resolved promise. - * - */ - -/** - * @ngdoc method - * @name $mdBottomSheet#cancel - * - * @description - * Hide the existing bottom sheet and reject the promise returned from - * `$mdBottomSheet.show()`. - * - * Note: Use a `.catch()` on your `.show()` to handle this callback. - * - * @param {*=} response An argument for the rejected promise. - * - */ - -function MdBottomSheetProvider($$interimElementProvider) { - // how fast we need to flick down to close the sheet, pixels/ms - bottomSheetDefaults.$inject = ["$animate", "$mdConstant", "$mdUtil", "$mdTheming", "$mdBottomSheet", "$rootElement", "$mdGesture", "$log"]; - var CLOSING_VELOCITY = 0.5; - var PADDING = 80; // same as css - - return $$interimElementProvider('$mdBottomSheet') - .setDefaults({ - methods: ['disableParentScroll', 'escapeToClose', 'clickOutsideToClose'], - options: bottomSheetDefaults - }); - - /* @ngInject */ - function bottomSheetDefaults($animate, $mdConstant, $mdUtil, $mdTheming, $mdBottomSheet, $rootElement, - $mdGesture, $log) { - var backdrop; - - return { - themable: true, - onShow: onShow, - onRemove: onRemove, - disableBackdrop: false, - escapeToClose: true, - clickOutsideToClose: true, - disableParentScroll: true, - isLockedOpen: false - }; - - function onShow(scope, element, options) { - element = $mdUtil.extractElementByName(element, 'md-bottom-sheet'); - - // prevent tab focus or click focus on the bottom-sheet container - element.attr('tabindex', '-1'); - - // Once the md-bottom-sheet has `ng-cloak` applied on his template the opening animation will not work properly. - // This is a very common problem, so we have to notify the developer about this. - if (element.hasClass('ng-cloak')) { - var message = '$mdBottomSheet: using `` will affect the bottom-sheet opening animations.'; - $log.warn(message, element[0]); - } - - if (options.isLockedOpen) { - options.clickOutsideToClose = false; - options.escapeToClose = false; - } else { - options.cleanupGestures = registerGestures(element, options.parent); - } - - if (!options.disableBackdrop) { - // Add a backdrop that will close on click - backdrop = $mdUtil.createBackdrop(scope, "md-bottom-sheet-backdrop md-opaque"); - - // Prevent mouse focus on backdrop; ONLY programmatic focus allowed. - // This allows clicks on backdrop to propagate to the $rootElement and - // ESC key events to be detected properly. - backdrop[0].tabIndex = -1; - - if (options.clickOutsideToClose) { - backdrop.on('click', function() { - $mdUtil.nextTick($mdBottomSheet.cancel, true); - }); - } - - $mdTheming.inherit(backdrop, options.parent); - - $animate.enter(backdrop, options.parent, null); - } - - $mdTheming.inherit(element, options.parent); - - if (options.disableParentScroll) { - options.restoreScroll = $mdUtil.disableScrollAround(element, options.parent); - } - - return $animate.enter(element, options.parent, backdrop) - .then(function() { - var focusable = $mdUtil.findFocusTarget(element) || angular.element( - element[0].querySelector('button') || - element[0].querySelector('a') || - element[0].querySelector($mdUtil.prefixer('ng-click', true)) - ) || backdrop; - - if (options.escapeToClose) { - options.rootElementKeyupCallback = function(e) { - if (e.keyCode === $mdConstant.KEY_CODE.ESCAPE) { - $mdUtil.nextTick($mdBottomSheet.cancel, true); - } - }; - - $rootElement.on('keyup', options.rootElementKeyupCallback); - focusable && focusable.focus(); - } - }); - - } - - function onRemove(scope, element, options) { - if (!options.disableBackdrop) $animate.leave(backdrop); - - return $animate.leave(element).then(function() { - if (options.disableParentScroll) { - options.restoreScroll(); - delete options.restoreScroll; - } - - options.cleanupGestures && options.cleanupGestures(); - }); - } - - /** - * Adds the drag gestures to the bottom sheet. - * @param {JQLite} element where CSS transitions will be applied - * @param {JQLite} parent used for registering gesture listeners - * @return {Function} function that removes gesture listeners that were set up by - * registerGestures() - */ - function registerGestures(element, parent) { - var deregister = $mdGesture.register(parent, 'drag', { horizontal: false }); - parent.on('$md.dragstart', onDragStart) - .on('$md.drag', onDrag) - .on('$md.dragend', onDragEnd); - - return function cleanupGestures() { - deregister(); - parent.off('$md.dragstart', onDragStart); - parent.off('$md.drag', onDrag); - parent.off('$md.dragend', onDragEnd); - }; - - function onDragStart() { - // Disable transitions on transform so that it feels fast - element.css($mdConstant.CSS.TRANSITION_DURATION, '0ms'); - } - - function onDrag(ev) { - var transform = ev.pointer.distanceY; - if (transform < 5) { - // Slow down drag when trying to drag up, and stop after PADDING - transform = Math.max(-PADDING, transform / 2); - } - element.css($mdConstant.CSS.TRANSFORM, 'translate3d(0,' + (PADDING + transform) + 'px,0)'); - } - - function onDragEnd(ev) { - if (ev.pointer.distanceY > 0 && - (ev.pointer.distanceY > 20 || Math.abs(ev.pointer.velocityY) > CLOSING_VELOCITY)) { - var distanceRemaining = element.prop('offsetHeight') - ev.pointer.distanceY; - var transitionDuration = Math.min(distanceRemaining / ev.pointer.velocityY * 0.75, 500); - element.css($mdConstant.CSS.TRANSITION_DURATION, transitionDuration + 'ms'); - $mdUtil.nextTick($mdBottomSheet.cancel, true); - } else { - element.css($mdConstant.CSS.TRANSITION_DURATION, ''); - element.css($mdConstant.CSS.TRANSFORM, ''); - } - } - } - } -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.button - * @description - * - * Button - */ -MdButtonDirective.$inject = ["$mdButtonInkRipple", "$mdTheming", "$mdAria", "$mdInteraction"]; -MdAnchorDirective.$inject = ["$mdTheming"]; -angular - .module('material.components.button', ['material.core']) - .directive('mdButton', MdButtonDirective) - .directive('a', MdAnchorDirective); - - -/** - * @private - * @restrict E - * - * @description - * `a` is an anchor directive used to inherit theme colors for md-primary, md-accent, etc. - * - * @usage - * - * - * - * - * - * - */ -function MdAnchorDirective($mdTheming) { - return { - restrict : 'E', - link : function postLink(scope, element) { - // Make sure to inherit theme so stand-alone anchors - // support theme colors for md-primary, md-accent, etc. - $mdTheming(element); - } - }; -} - - -/** - * @ngdoc directive - * @name mdButton - * @module material.components.button - * - * @restrict E - * - * @description - * `` is a button directive with optional ink ripples (default enabled). - * - * If you supply a `href` or `ng-href` attribute, it will become an `` element. Otherwise, it - * will become a `'; - } - } - - function postLink(scope, element, attr) { - $mdTheming(element); - $mdButtonInkRipple.attach(scope, element); - - // Use async expect to support possible bindings in the button label - $mdAria.expectWithoutText(element, 'aria-label'); - - // For anchor elements, we have to set tabindex manually when the element is disabled. - // We don't do this for md-nav-bar anchors as the component manages its own tabindex values. - if (isAnchor(attr) && angular.isDefined(attr.ngDisabled) && - !element.hasClass('_md-nav-button')) { - scope.$watch(attr.ngDisabled, function(isDisabled) { - element.attr('tabindex', isDisabled ? -1 : 0); - }); - } - - // disabling click event when disabled is true - element.on('click', function(e){ - if (attr.disabled === true) { - e.preventDefault(); - e.stopImmediatePropagation(); - } - }); - - if (!element.hasClass('md-no-focus')) { - - element.on('focus', function() { - - // Only show the focus effect when being focused through keyboard interaction or programmatically - if (!$mdInteraction.isUserInvoked() || $mdInteraction.getLastInteractionType() === 'keyboard') { - element.addClass('md-focused'); - } - - }); - - element.on('blur', function() { - element.removeClass('md-focused'); - }); - } - - } - -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.card - * - * @description - * Card components. - */ -mdCardDirective.$inject = ["$mdTheming"]; -angular.module('material.components.card', [ - 'material.core' - ]) - .directive('mdCard', mdCardDirective); - - -/** - * @ngdoc directive - * @name mdCard - * @module material.components.card - * - * @restrict E - * - * @description - * The `` directive is a container element used within `` containers. - * - * An image included as a direct descendant will fill the card's width. If you want to avoid this, - * you can add the `md-image-no-fill` class to the parent element. The `` - * container will wrap text content and provide padding. An `` element can be - * optionally included to put content flush against the bottom edge of the card. - * - * Action buttons can be included in an `` element, similar to ``. - * You can then position buttons using layout attributes. - * - * Card is built with: - * * `` - Header for the card, holds avatar, text and squared image - * - `` - Card avatar - * - `md-user-avatar` - Class for user image - * - `` - * - `` - Contains elements for the card description - * - `md-title` - Class for the card title - * - `md-subhead` - Class for the card sub header - * * `` - Image for the card - * * `` - Card content title - * - `` - * - `md-headline` - Class for the card content title - * - `md-subhead` - Class for the card content sub header - * - `` - Squared image within the title - * - `md-media-sm` - Class for small image - * - `md-media-md` - Class for medium image - * - `md-media-lg` - Class for large image - * - `md-media-xl` - Class for extra large image - * * `` - Card content - * * `` - Card actions - * - `` - Icon actions - * - * Cards have constant width and variable heights; where the maximum height is limited to what can - * fit within a single view on a platform, but it can temporarily expand as needed. - * - * @usage - * ### Card with optional footer - * - * - * image caption - * - *

    Card headline

    - *

    Card content

    - *
    - * - * Card footer - * - *
    - *
    - * - * ### Card with actions - * - * - * image caption - * - *

    Card headline

    - *

    Card content

    - *
    - * - * Action 1 - * Action 2 - * - *
    - *
    - * - * ### Card with header, image, title actions and content - * - * - * - * - * - * - * - * Title - * Sub header - * - * - * image caption - * - * - * Card headline - * Card subheader - * - * - * - * Action 1 - * Action 2 - * - * - * - * - * - * - * - *

    - * Card content - *

    - *
    - *
    - *
    - */ -function mdCardDirective($mdTheming) { - return { - restrict: 'E', - link: function ($scope, $element, attr) { - $element.addClass('_md'); // private md component indicator for styling - $mdTheming($element); - } - }; -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.checkbox - * @description Checkbox module! - */ -MdCheckboxDirective.$inject = ["inputDirective", "$mdAria", "$mdConstant", "$mdTheming", "$mdUtil", "$mdInteraction"]; -angular - .module('material.components.checkbox', ['material.core']) - .directive('mdCheckbox', MdCheckboxDirective); - -/** - * @ngdoc directive - * @name mdCheckbox - * @module material.components.checkbox - * @restrict E - * - * @description - * The checkbox directive is used like the normal - * [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D). - * - * As per the [Material Design spec](https://material.io/archive/guidelines/style/color.html#color-color-palette) - * the checkbox is in the accent color by default. The primary color palette may be used with - * the `md-primary` class. - * - * @param {expression} ng-model Assignable angular expression to data-bind to. - * @param {string=} name Property name of the form under which the control is published. - * @param {expression=} ng-true-value The value to which the expression should be set when selected. - * @param {expression=} ng-false-value The value to which the expression should be set when not - * selected. - * @param {expression=} ng-change Expression to be executed when the model value changes. - * @param {boolean=} md-no-ink If present, disable ink ripple effects. - * @param {string=} aria-label Adds label to checkbox for accessibility. - * Defaults to checkbox's text. If no default text is found, a warning will be logged. - * @param {expression=} md-indeterminate This determines when the checkbox should be rendered as - * 'indeterminate'. If a truthy expression or no value is passed in the checkbox renders in the - * md-indeterminate state. If falsy expression is passed in it just looks like a normal unchecked - * checkbox. The indeterminate, checked, and unchecked states are mutually exclusive. A box - * cannot be in any two states at the same time. Adding the 'md-indeterminate' attribute - * overrides any checked/unchecked rendering logic. When using the 'md-indeterminate' attribute - * use 'ng-checked' to define rendering logic instead of using 'ng-model'. - * @param {expression=} ng-checked If this expression evaluates as truthy, the 'md-checked' css - * class is added to the checkbox and it will appear checked. - * - * @usage - * - * - * Finished ? - * - * - * - * No Ink Effects - * - * - * - * Disabled - * - * - * - * - */ -function MdCheckboxDirective(inputDirective, $mdAria, $mdConstant, $mdTheming, $mdUtil, $mdInteraction) { - inputDirective = inputDirective[0]; - - return { - restrict: 'E', - transclude: true, - require: ['^?mdInputContainer', '?ngModel', '?^form'], - priority: $mdConstant.BEFORE_NG_ARIA, - template: - '
    ' + - '
    ' + - '
    ' + - '
    ', - compile: compile - }; - - // ********************************************************** - // Private Methods - // ********************************************************** - - function compile (tElement, tAttrs) { - tAttrs.$set('tabindex', tAttrs.tabindex || '0'); - tAttrs.$set('type', 'checkbox'); - tAttrs.$set('role', tAttrs.type); - tElement.addClass('md-auto-horizontal-margin'); - - return { - pre: function(scope, element) { - // Attach a click handler during preLink, in order to immediately stop propagation - // (especially for ng-click) when the checkbox is disabled. - element.on('click', function(e) { - if (this.hasAttribute('disabled')) { - e.stopImmediatePropagation(); - } - }); - }, - post: postLink - }; - - function postLink(scope, element, attr, ctrls) { - var isIndeterminate; - var containerCtrl = ctrls[0]; - var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel(); - var formCtrl = ctrls[2]; - var labelHasLink = element.find('a').length > 0; - - // The original component structure is not accessible when the checkbox's label contains a link. - // In order to keep backwards compatibility, we're only changing the structure of the component - // when we detect a link within the label. Using a span after the md-checkbox and attaching it - // via aria-labelledby allows screen readers to find and work with the link within the label. - if (labelHasLink) { - var labelId = 'label-' + $mdUtil.nextUid(); - attr.$set('aria-labelledby', labelId); - - var label = element.children()[1]; - // Use jQLite here since ChildNode.remove() is not supported in IE11. - angular.element(label).remove(); - label.removeAttribute('ng-transclude'); - label.className = 'md-checkbox-link-label'; - label.setAttribute('id', labelId); - element.after(label); - // Make sure that clicking on the label still causes the checkbox to be toggled, when appropriate. - var externalLabel = element.next(); - externalLabel.on('click', listener); - } - - if (containerCtrl) { - var isErrorGetter = containerCtrl.isErrorGetter || function() { - return ngModelCtrl.$invalid && (ngModelCtrl.$touched || (formCtrl && formCtrl.$submitted)); - }; - - containerCtrl.input = element; - - scope.$watch(isErrorGetter, containerCtrl.setInvalid); - } - - $mdTheming(element); - - // Redirect focus events to the root element, because IE11 is always focusing the container element instead - // of the md-checkbox element. This causes issues when using ngModelOptions: `updateOnBlur` - element.children().on('focus', function() { - element.focus(); - }); - - if ($mdUtil.parseAttributeBoolean(attr.mdIndeterminate)) { - setIndeterminateState(); - scope.$watch(attr.mdIndeterminate, setIndeterminateState); - } - - if (attr.ngChecked) { - scope.$watch(scope.$eval.bind(scope, attr.ngChecked), function(value) { - ngModelCtrl.$setViewValue(value); - ngModelCtrl.$render(); - }); - } - - $$watchExpr('ngDisabled', 'tabindex', { - true: '-1', - false: attr.tabindex - }); - - // Don't emit a warning when the label has a link within it. In that case we'll use - // aria-labelledby to point to another span that should be read as the label. - if (!labelHasLink) { - $mdAria.expectWithText(element, 'aria-label'); - } - - // Reuse the original input[type=checkbox] directive from AngularJS core. - // This is a bit hacky as we need our own event listener and own render - // function. - inputDirective.link.pre(scope, { - on: angular.noop, - 0: {} - }, attr, [ngModelCtrl]); - - element.on('click', listener) - .on('keypress', keypressHandler) - .on('focus', function() { - if ($mdInteraction.getLastInteractionType() === 'keyboard') { - element.addClass('md-focused'); - } - }) - .on('blur', function() { - element.removeClass('md-focused'); - }); - - ngModelCtrl.$render = render; - - function $$watchExpr(expr, htmlAttr, valueOpts) { - if (attr[expr]) { - scope.$watch(attr[expr], function(val) { - if (valueOpts[val]) { - element.attr(htmlAttr, valueOpts[val]); - } - }); - } - } - - /** - * @param {KeyboardEvent} ev 'keypress' event to handle - */ - function keypressHandler(ev) { - var keyCode = ev.which || ev.keyCode; - var submit, form; - - ev.preventDefault(); - switch (keyCode) { - case $mdConstant.KEY_CODE.SPACE: - element.addClass('md-focused'); - listener(ev); - break; - case $mdConstant.KEY_CODE.ENTER: - // Match the behavior of the native . - // When the enter key is pressed while focusing a native checkbox inside a form, - // the browser will trigger a `click` on the first non-disabled submit button/input - // in the form. Note that this is different from text inputs, which - // will directly submit the form without needing a submit button/input to be present. - form = $mdUtil.getClosest(ev.target, 'form'); - if (form) { - submit = form.querySelector('button[type="submit"]:enabled, input[type="submit"]:enabled'); - if (submit) { - submit.click(); - } - } - break; - } - } - - function listener(ev) { - // skipToggle boolean is used by the switch directive to prevent the click event - // when releasing the drag. There will be always a click if releasing the drag over the checkbox. - // If the click came from a link in the checkbox, don't toggle the value. - // We want the link to be opened without changing the value in this case. - if (element[0].hasAttribute('disabled') || scope.skipToggle || ev.target.tagName === 'A') { - return; - } - - scope.$apply(function() { - // Toggle the checkbox value... - var viewValue = attr.ngChecked && attr.ngClick ? attr.checked : !ngModelCtrl.$viewValue; - - ngModelCtrl.$setViewValue(viewValue, ev && ev.type); - ngModelCtrl.$render(); - }); - } - - function render() { - // Cast the $viewValue to a boolean since it could be undefined - var checked = !!ngModelCtrl.$viewValue && !isIndeterminate; - element.toggleClass('md-checked', checked); - if (!isIndeterminate) { - if (checked) { - element.attr('aria-checked', 'true'); - } else { - element.attr('aria-checked', 'false'); - } - } - } - - /** - * @param {string=} newValue - */ - function setIndeterminateState(newValue) { - isIndeterminate = newValue !== false; - if (isIndeterminate) { - element.attr('aria-checked', 'mixed'); - } - element.toggleClass('md-indeterminate', isIndeterminate); - ngModelCtrl.$render(); - } - } - } -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.chips - */ -/* - * @see js folder for chips implementation - */ -angular.module('material.components.chips', [ - 'material.core', - 'material.components.autocomplete' -]); - -})(); -(function(){ -"use strict"; - - -MdChipCtrl.$inject = ["$scope", "$element", "$mdConstant", "$timeout", "$mdUtil"];angular - .module('material.components.chips') - .controller('MdChipCtrl', MdChipCtrl); - -/** - * Controller for the MdChip component. Responsible for handling keyboard - * events and editing the chip if needed. - * - * @param $scope - * @param $element - * @param $mdConstant - * @param $timeout - * @param $mdUtil - * @constructor - */ -function MdChipCtrl ($scope, $element, $mdConstant, $timeout, $mdUtil) { - /** - * @type {$scope} - */ - this.$scope = $scope; - - /** - * @type {$element} - */ - this.$element = $element; - - /** - * @type {$mdConstant} - */ - this.$mdConstant = $mdConstant; - - /** - * @type {$timeout} - */ - this.$timeout = $timeout; - - /** - * @type {$mdUtil} - */ - this.$mdUtil = $mdUtil; - - /** - * @type {boolean} - */ - this.isEditing = false; - - /** - * @type {MdChipsCtrl} - */ - this.parentController = undefined; - - /** - * @type {boolean} - */ - this.enableChipEdit = false; -} - - -/** - * @param {MdChipsCtrl} controller - */ -MdChipCtrl.prototype.init = function(controller) { - this.parentController = controller; - this.enableChipEdit = this.parentController.enableChipEdit; - - if (this.enableChipEdit) { - this.$element.on('keydown', this.chipKeyDown.bind(this)); - this.$element.on('dblclick', this.chipMouseDoubleClick.bind(this)); - this.getChipContent().addClass('_md-chip-content-edit-is-enabled'); - } -}; - - -/** - * @return {Object} first element with the md-chip-content class - */ -MdChipCtrl.prototype.getChipContent = function() { - var chipContents = this.$element[0].getElementsByClassName('md-chip-content'); - return angular.element(chipContents[0]); -}; - - -/** - * When editing the chip, if the user modifies the existing contents, we'll get a span back and - * need to ignore text elements as they only contain blank space. - * `children()` ignores text elements. - * - * When editing the chip, if the user deletes the contents and then enters some new content - * we'll only get a text element back. - * @return {Object} jQuery object representing the content element of the chip - */ -MdChipCtrl.prototype.getContentElement = function() { - var contentElement = angular.element(this.getChipContent().children()[0]); - if (!contentElement || contentElement.length === 0) { - contentElement = angular.element(this.getChipContent().contents()[0]); - } - return contentElement; -}; - - -/** - * @return {number} index of this chip - */ -MdChipCtrl.prototype.getChipIndex = function() { - return parseInt(this.$element.attr('index')); -}; - - -/** - * Update the chip's contents, focus the chip if it's selected, and exit edit mode. - * If the contents were updated to be empty, remove the chip and re-focus the input element. - */ -MdChipCtrl.prototype.goOutOfEditMode = function() { - if (!this.isEditing) { - return; - } - - this.isEditing = false; - this.$element.removeClass('_md-chip-editing'); - this.getChipContent()[0].contentEditable = 'false'; - var chipIndex = this.getChipIndex(); - - var content = this.getContentElement().text(); - if (content) { - this.parentController.updateChipContents(chipIndex, content); - - this.$mdUtil.nextTick(function() { - if (this.parentController.selectedChip === chipIndex) { - this.parentController.focusChip(chipIndex); - } - }.bind(this)); - } else { - this.parentController.removeChipAndFocusInput(chipIndex); - } -}; - - -/** - * Given an HTML element. Selects contents of it. - * @param {Element} node - */ -MdChipCtrl.prototype.selectNodeContents = function(node) { - var range, selection; - if (document.body.createTextRange) { - range = document.body.createTextRange(); - range.moveToElementText(node); - range.select(); - } else if (window.getSelection) { - selection = window.getSelection(); - range = document.createRange(); - range.selectNodeContents(node); - selection.removeAllRanges(); - selection.addRange(range); - } -}; - - -/** - * Presents an input element to edit the contents of the chip. - */ -MdChipCtrl.prototype.goInEditMode = function() { - this.isEditing = true; - this.$element.addClass('_md-chip-editing'); - this.getChipContent()[0].contentEditable = 'true'; - this.getChipContent().on('blur', function() { - this.goOutOfEditMode(); - }.bind(this)); - - this.selectNodeContents(this.getChipContent()[0]); -}; - - -/** - * Handles the keydown event on the chip element. If enable-chip-edit attribute is - * set to true, space or enter keys can trigger going into edit mode. Enter can also - * trigger submitting if the chip is already being edited. - * @param {KeyboardEvent} event - */ -MdChipCtrl.prototype.chipKeyDown = function(event) { - if (!this.isEditing && - (event.keyCode === this.$mdConstant.KEY_CODE.ENTER || - event.keyCode === this.$mdConstant.KEY_CODE.SPACE)) { - event.preventDefault(); - this.goInEditMode(); - } else if (this.isEditing && event.keyCode === this.$mdConstant.KEY_CODE.ENTER) { - event.preventDefault(); - this.goOutOfEditMode(); - } -}; - - -/** - * Enter edit mode if we're not already editing and the enable-chip-edit attribute is enabled. - */ -MdChipCtrl.prototype.chipMouseDoubleClick = function() { - if (this.enableChipEdit && !this.isEditing) { - this.goInEditMode(); - } -}; - -})(); -(function(){ -"use strict"; - - -MdChip.$inject = ["$mdTheming", "$mdUtil", "$compile", "$timeout"];angular - .module('material.components.chips') - .directive('mdChip', MdChip); - -/** - * @ngdoc directive - * @name mdChip - * @module material.components.chips - * - * @description - * `` is a component used within ``. It is responsible for rendering an - * individual chip. - * - * - * @usage - * - * - * {{$chip}} - * - * - * - */ - -/** - * MDChip Directive Definition - * - * @param $mdTheming - * @param $mdUtil - * @param $compile - * @param $timeout - * @ngInject - */ -function MdChip($mdTheming, $mdUtil, $compile, $timeout) { - return { - restrict: 'E', - require: ['^?mdChips', 'mdChip'], - link: postLink, - controller: 'MdChipCtrl' - }; - - function postLink(scope, element, attr, ctrls) { - var chipsController = ctrls.shift(); - var chipController = ctrls.shift(); - var chipContentElement = angular.element(element[0].querySelector('.md-chip-content')); - - $mdTheming(element); - - if (chipsController) { - chipController.init(chipsController); - - // When a chip is blurred, make sure to unset (or reset) the selected chip so that tabbing - // through elements works properly - chipContentElement.on('blur', function() { - chipsController.resetSelectedChip(); - chipsController.$scope.$applyAsync(); - }); - } - - // Use $timeout to ensure we run AFTER the element has been added to the DOM so we can focus it. - $timeout(function() { - if (!chipsController) { - return; - } - - if (chipsController.shouldFocusLastChip) { - chipsController.focusLastChipThenInput(); - } - }); - } -} - -})(); -(function(){ -"use strict"; - - -MdChipRemove.$inject = ["$timeout"];angular - .module('material.components.chips') - .directive('mdChipRemove', MdChipRemove); - -/** - * @ngdoc directive - * @name mdChipRemove - * @restrict A - * @module material.components.chips - * - * @description - * Indicates that the associated element should be used as the delete button template for all chips. - * The associated element must be a child of `md-chips`. - * - * The provided button template will be appended to each chip and will remove the associated chip - * on click. - * - * The button is not styled or themed based on the theme set on the `md-chips` component. A theme - * class and custom icon can be specified in your template. - * - * You can also specify the `type` of the button in your template. - * - * @usage - * ### With Standard Chips - * - * - * - * - * - * - * ### With Object Chips - * - * - * - * - * - */ - - -/** - * MdChipRemove Directive Definition. - * - * @param $timeout - * @returns {{restrict: string, require: string[], link: Function, scope: boolean}} - * @constructor - */ -function MdChipRemove ($timeout) { - return { - restrict: 'A', - require: '^mdChips', - scope: false, - link: postLink - }; - - function postLink(scope, element, attr, ctrl) { - element.on('click', function() { - scope.$apply(function() { - ctrl.removeChip(scope.$$replacedScope.$index); - }); - }); - - // Child elements aren't available until after a $timeout tick as they are hidden by an - // `ng-if`. see http://goo.gl/zIWfuw - $timeout(function() { - element.attr({ 'tabindex': '-1', 'aria-hidden': 'true' }); - element.find('button').attr('tabindex', '-1'); - }); - } -} - -})(); -(function(){ -"use strict"; - - -MdChipTransclude.$inject = ["$compile"];angular - .module('material.components.chips') - .directive('mdChipTransclude', MdChipTransclude); - -function MdChipTransclude ($compile) { - return { - restrict: 'EA', - terminal: true, - link: link, - scope: false - }; - function link (scope, element, attr) { - var ctrl = scope.$parent.$mdChipsCtrl, - newScope = ctrl.parent.$new(false, ctrl.parent); - newScope.$$replacedScope = scope; - newScope.$chip = scope.$chip; - newScope.$index = scope.$index; - newScope.$mdChipsCtrl = ctrl; - - var newHtml = ctrl.$scope.$eval(attr.mdChipTransclude); - - element.html(newHtml); - $compile(element.contents())(newScope); - } -} - -})(); -(function(){ -"use strict"; - -/** - * The default chip append delay. - * - * @type {number} - */ -MdChipsCtrl.$inject = ["$scope", "$attrs", "$mdConstant", "$log", "$element", "$timeout", "$mdUtil", "$mdLiveAnnouncer", "$exceptionHandler"]; -var DEFAULT_CHIP_APPEND_DELAY = 300; - -angular - .module('material.components.chips') - .controller('MdChipsCtrl', MdChipsCtrl); - -/** - * Controller for the MdChips component. Responsible for adding to and - * removing from the list of chips, marking chips as selected, and binding to - * the models of various input components. - * - * @param $scope - * @param $attrs - * @param $mdConstant - * @param $log - * @param $element - * @param $timeout - * @param $mdUtil - * @param $mdLiveAnnouncer - * @param $exceptionHandler - * @constructor - */ -function MdChipsCtrl ($scope, $attrs, $mdConstant, $log, $element, $timeout, $mdUtil, - $mdLiveAnnouncer, $exceptionHandler) { - /** @type {Function} **/ - this.$timeout = $timeout; - - /** @type {Object} */ - this.$mdConstant = $mdConstant; - - /** @type {angular.$scope} */ - this.$scope = $scope; - - /** @type {angular.$scope} */ - this.parent = $scope.$parent; - - /** @type {$mdUtil} */ - this.$mdUtil = $mdUtil; - - /** @type {$log} */ - this.$log = $log; - - /** @type {$mdLiveAnnouncer} */ - this.$mdLiveAnnouncer = $mdLiveAnnouncer; - - /** @type {$exceptionHandler} */ - this.$exceptionHandler = $exceptionHandler; - - /** @type {$element} */ - this.$element = $element; - - /** @type {$attrs} */ - this.$attrs = $attrs; - - /** @type {angular.NgModelController} */ - this.ngModelCtrl = null; - - /** @type {angular.NgModelController} */ - this.userInputNgModelCtrl = null; - - /** @type {MdAutocompleteCtrl} */ - this.autocompleteCtrl = null; - - /** @type {Element} */ - this.userInputElement = null; - - /** @type {Array.} */ - this.items = []; - - /** @type {number} */ - this.selectedChip = -1; - - /** @type {string} */ - this.enableChipEdit = $mdUtil.parseAttributeBoolean($attrs.mdEnableChipEdit); - - /** @type {string} */ - this.addOnBlur = $mdUtil.parseAttributeBoolean($attrs.mdAddOnBlur); - - /** - * The class names to apply to the autocomplete or input. - * @type {string} - */ - this.inputClass = ''; - - /** - * The text to be used as the aria-label for the input. - * @type {string} - */ - this.inputAriaLabel = 'Chips input.'; - - /** - * Label text to describe the chips container. Used to give context and instructions to screen - * reader users when the chips container is selected. - * @type {string} - */ - this.containerHint = 'Chips container. Use arrow keys to select chips.'; - - /** - * Label text to describe the chips container when it is empty. Used to give context and - * instructions to screen reader users when the chips container is selected and it contains - * no chips. - * @type {string} - */ - this.containerEmptyHint = - 'Chips container. Enter the text area, then type text, and press enter to add a chip.'; - - /** - * Hidden hint text for how to delete a chip. Used to give context to screen readers. - * @type {string} - */ - this.deleteHint = 'Press delete to remove this chip.'; - - /** - * Hidden label for the delete button. Used to give context to screen readers. - * @type {string} - */ - this.deleteButtonLabel = 'Remove'; - - /** - * Model used by the input element. - * @type {string} - */ - this.chipBuffer = ''; - - /** - * Whether to use the transformChip expression to transform the chip buffer - * before appending it to the list. - * @type {boolean} - */ - this.useTransformChip = false; - - /** - * Whether to use the onAdd expression to notify of chip additions. - * @type {boolean} - */ - this.useOnAdd = false; - - /** - * Whether to use the onRemove expression to notify of chip removals. - * @type {boolean} - */ - this.useOnRemove = false; - - /** - * The ID of the chips wrapper which is used to build unique IDs for the chips and the aria-owns - * attribute. - * - * Defaults to '_md-chips-wrapper-' plus a unique number. - * - * @type {string} - */ - this.wrapperId = ''; - - /** - * Array of unique numbers which will be auto-generated any time the items change, and is used to - * create unique IDs for the aria-owns attribute. - * - * @type {Array} - */ - this.contentIds = []; - - /** - * The index of the chip that should have it's `tabindex` property set to `0` so it is selectable - * via the keyboard. - * - * @type {number|null} - */ - this.ariaTabIndex = null; - - /** - * After appending a chip, the chip will be focused for this number of milliseconds before the - * input is refocused. - * - * **Note:** This is **required** for compatibility with certain screen readers in order for - * them to properly allow keyboard access. - * - * @type {number} - */ - this.chipAppendDelay = DEFAULT_CHIP_APPEND_DELAY; - - /** - * Collection of functions to call to un-register watchers - * - * @type {Array} - */ - this.deRegister = []; - - /** - * The screen reader will announce the chip content followed by this message when a chip is added. - * @type {string} - */ - this.addedMessage = 'added'; - - /** - * The screen reader will announce the chip content followed by this message when a chip is - * removed. - * @type {string} - */ - this.removedMessage = 'removed'; - - this.init(); -} - -/** - * Initializes variables and sets up watchers - */ -MdChipsCtrl.prototype.init = function() { - var ctrl = this; - - // Set the wrapper ID - this.wrapperId = '_md-chips-wrapper-' + this.$mdUtil.nextUid(); - - // If we're using static chips, then we need to initialize a few things. - if (!this.$element.attr('ng-model')) { - this.setupStaticChips(); - } - - // Setup a watcher which manages the role and aria-owns attributes. - // This is never called for static chips since items is not defined. - this.deRegister.push( - this.$scope.$watchCollection('$mdChipsCtrl.items', function() { - // Make sure our input and wrapper have the correct ARIA attributes - ctrl.setupInputAria(); - ctrl.setupWrapperAria(); - }) - ); - - this.deRegister.push( - this.$attrs.$observe('mdChipAppendDelay', function(newValue) { - ctrl.chipAppendDelay = parseInt(newValue) || DEFAULT_CHIP_APPEND_DELAY; - }) - ); -}; - -/** - * Destructor for cleanup - */ -MdChipsCtrl.prototype.$onDestroy = function $onDestroy() { - var $destroyFn; - while (($destroyFn = this.deRegister.pop())) { - $destroyFn.call(this); - } -}; - -/** - * If we have an input, ensure it has the appropriate ARIA attributes. - */ -MdChipsCtrl.prototype.setupInputAria = function() { - var input = this.$element.find('input'); - - // If we have no input, just return - if (!input) { - return; - } - - input.attr('role', 'textbox'); - input.attr('aria-multiline', true); - if (this.inputAriaDescribedBy) { - input.attr('aria-describedby', this.inputAriaDescribedBy); - } - if (this.inputAriaLabelledBy) { - input.attr('aria-labelledby', this.inputAriaLabelledBy); - input.removeAttr('aria-label'); - } else { - input.attr('aria-label', this.inputAriaLabel); - } -}; - -/** - * Ensure our wrapper has the appropriate ARIA attributes. - */ -MdChipsCtrl.prototype.setupWrapperAria = function() { - var ctrl = this, - wrapper = this.$element.find('md-chips-wrap'); - - if (this.items && this.items.length) { - // Dynamically add the listbox role on every change because it must be removed when there are - // no items. - wrapper.attr('role', 'listbox'); - - // Generate some random (but unique) IDs for each chip - this.contentIds = this.items.map(function() { - return ctrl.wrapperId + '-chip-' + ctrl.$mdUtil.nextUid(); - }); - - // Use the contentIDs above to generate the aria-owns attribute - wrapper.attr('aria-owns', this.contentIds.join(' ')); - wrapper.attr('aria-label', this.containerHint); - } else { - // If we have no items, then the role and aria-owns attributes MUST be removed - wrapper.removeAttr('role'); - wrapper.removeAttr('aria-owns'); - wrapper.attr('aria-label', this.containerEmptyHint); - } -}; - -/** - * Apply specific roles and aria attributes for static chips - */ -MdChipsCtrl.prototype.setupStaticChips = function() { - var ctrl = this, i, staticChips; - var wrapper = this.$element.find('md-chips-wrap'); - - this.$timeout(function() { - wrapper.attr('role', 'list'); - staticChips = wrapper[0].children; - for (i = 0; i < staticChips.length; i++) { - staticChips[i].setAttribute('role', 'listitem'); - staticChips[i].setAttribute('aria-setsize', staticChips.length); - } - if (ctrl.inputAriaDescribedBy) { - wrapper.attr('aria-describedby', ctrl.inputAriaDescribedBy); - } - if (ctrl.inputAriaLabelledBy) { - wrapper.attr('aria-labelledby', ctrl.inputAriaLabelledBy); - wrapper.removeAttr('aria-label'); - } else { - wrapper.attr('aria-label', ctrl.inputAriaLabel); - } - }, 10); -}; - -/** - * Handles the keydown event on the input element: by default appends - * the buffer to the chip list, while backspace removes the last chip in the - * list if the current buffer is empty. - * @param {jQuery.Event|KeyboardEvent} event - */ -MdChipsCtrl.prototype.inputKeydown = function(event) { - var chipBuffer = this.getChipBuffer(); - - // If we have an autocomplete, and it handled the event, we have nothing to do - if (this.autocompleteCtrl && event.isDefaultPrevented && event.isDefaultPrevented()) { - return; - } - - if (event.keyCode === this.$mdConstant.KEY_CODE.BACKSPACE) { - // Only select and focus the previous chip, if the current caret position of the - // input element is at the beginning. - if (this.getCursorPosition(event.target) !== 0) { - return; - } - - event.preventDefault(); - event.stopPropagation(); - - if (this.items.length) { - this.selectAndFocusChipSafe(this.items.length - 1); - } - - return; - } - - // By default appends the buffer to the chip list. - if (!this.separatorKeys || this.separatorKeys.length < 1) { - this.separatorKeys = [this.$mdConstant.KEY_CODE.ENTER]; - } - - // Support additional separator key codes in an array of `md-separator-keys`. - if (this.separatorKeys.indexOf(event.keyCode) !== -1) { - if ((this.autocompleteCtrl && this.requireMatch) || !chipBuffer) return; - event.preventDefault(); - - // Only append the chip and reset the chip buffer if the max chips limit isn't reached. - if (this.hasMaxChipsReached()) return; - - this.appendChip(chipBuffer.trim()); - this.resetChipBuffer(); - - return false; - } -}; - -/** - * Returns the cursor position of the specified input element. - * @param {HTMLInputElement} element relevant input element - * @returns {Number} Cursor Position of the input. - */ -MdChipsCtrl.prototype.getCursorPosition = function(element) { - /* - * Figure out whether the current input for the chips buffer is valid for using - * the selectionStart / end property to retrieve the cursor position. - * Some browsers do not allow the use of those attributes, on different input types. - */ - try { - if (element.selectionStart === element.selectionEnd) { - return element.selectionStart; - } - } catch (e) { - if (!element.value) { - return 0; - } - } -}; - - -/** - * Updates the content of the chip at given index - * @param {number} chipIndex - * @param {string} chipContents - */ -MdChipsCtrl.prototype.updateChipContents = function(chipIndex, chipContents) { - if (chipIndex >= 0 && chipIndex < this.items.length) { - this.items[chipIndex] = chipContents; - this.updateNgModel(true); - } -}; - - -/** - * @return {boolean} true if a chip is currently being edited. False otherwise. - */ -MdChipsCtrl.prototype.isEditingChip = function() { - return !!this.$element[0].querySelector('._md-chip-editing'); -}; - -/** - * @param {string|Object} chip contents of a single chip - * @returns {boolean} true if the chip is an Object, false otherwise. - * @private - */ -MdChipsCtrl.prototype._isChipObject = function(chip) { - return angular.isObject(chip); -}; - -/** - * @returns {boolean} true if chips can be removed, false otherwise. - */ -MdChipsCtrl.prototype.isRemovable = function() { - // Return false if we have static chips - if (!this.ngModelCtrl) { - return false; - } - - return this.readonly ? this.removable : - angular.isDefined(this.removable) ? this.removable : true; -}; - -/** - * Handles the keydown event on the chip elements: backspace removes the selected chip, arrow - * keys switch which chip is active. - * @param {KeyboardEvent} event - */ -MdChipsCtrl.prototype.chipKeydown = function (event) { - if (this.getChipBuffer()) return; - if (this.isEditingChip()) return; - - switch (event.keyCode) { - case this.$mdConstant.KEY_CODE.BACKSPACE: - case this.$mdConstant.KEY_CODE.DELETE: - if (this.selectedChip < 0) return; - event.preventDefault(); - // Cancel the delete action only after the event cancel. Otherwise the page will go back. - if (!this.isRemovable()) return; - this.removeAndSelectAdjacentChip(this.selectedChip, event); - break; - case this.$mdConstant.KEY_CODE.LEFT_ARROW: - event.preventDefault(); - // By default, allow selection of -1 which will focus the input; if we're readonly, don't go - // below 0. - if (this.selectedChip < 0 || (this.readonly && this.selectedChip === 0)) { - this.selectedChip = this.items.length; - } - if (this.items.length) this.selectAndFocusChipSafe(this.selectedChip - 1); - break; - case this.$mdConstant.KEY_CODE.RIGHT_ARROW: - event.preventDefault(); - this.selectAndFocusChipSafe(this.selectedChip + 1); - break; - case this.$mdConstant.KEY_CODE.ESCAPE: - case this.$mdConstant.KEY_CODE.TAB: - if (this.selectedChip < 0) return; - event.preventDefault(); - this.onFocus(); - break; - } -}; - -/** - * Get the input's placeholder - uses `placeholder` when list is empty and `secondary-placeholder` - * when the list is non-empty. If `secondary-placeholder` is not provided, `placeholder` is used - * always. - * @returns {string} - */ -MdChipsCtrl.prototype.getPlaceholder = function() { - // Allow `secondary-placeholder` to be blank. - var useSecondary = (this.items && this.items.length && - (this.secondaryPlaceholder === '' || this.secondaryPlaceholder)); - return useSecondary ? this.secondaryPlaceholder : this.placeholder; -}; - -/** - * Removes chip at {@code index} and selects the adjacent chip. - * @param {number} index adjacent chip to select - * @param {Event=} event - */ -MdChipsCtrl.prototype.removeAndSelectAdjacentChip = function(index, event) { - var self = this; - var selIndex = self.getAdjacentChipIndex(index); - var wrap = this.$element[0].querySelector('md-chips-wrap'); - var chip = this.$element[0].querySelector('md-chip[index="' + index + '"]'); - - self.removeChip(index, event); - - // The double-timeout is currently necessary to ensure that the DOM has finalized and the select() - // will find the proper chip since the selection is index-based. - // - // TODO: Investigate calling from within chip $scope.$on('$destroy') to reduce/remove timeouts - self.$timeout(function() { - self.$timeout(function() { - self.selectAndFocusChipSafe(selIndex); - }); - }); -}; - -/** - * Sets the selected chip index to -1. - */ -MdChipsCtrl.prototype.resetSelectedChip = function() { - this.selectedChip = -1; - this.ariaTabIndex = null; -}; - -/** - * Gets the index of an adjacent chip to select after deletion. Adjacency is - * determined as the next chip in the list, unless the target chip is the - * last in the list, then it is the chip immediately preceding the target. If - * there is only one item in the list, -1 is returned (select none). - * The number returned is the index to select AFTER the target has been removed. - * If the current chip is not selected, then -1 is returned to select none. - * @param {number} index - * @returns {number} - */ -MdChipsCtrl.prototype.getAdjacentChipIndex = function(index) { - var len = this.items.length - 1; - return (len === 0) ? -1 : - (index === len) ? index - 1 : index; -}; - -/** - * Append the contents of the buffer to the chip list. This method will first - * call out to the md-transform-chip method, if provided. - * @param {string} newChip chip buffer contents that will be used to create the new chip - */ -MdChipsCtrl.prototype.appendChip = function(newChip) { - this.shouldFocusLastChip = !this.addOnBlur; - if (this.useTransformChip && this.transformChip) { - var transformedChip = this.transformChip({'$chip': newChip}); - - // Check to make sure the chip is defined before assigning it, otherwise, we'll just assume - // they want the string version. - if (angular.isDefined(transformedChip)) { - newChip = transformedChip; - } - } - - // If items contains an identical object to newChip, do not append - if (angular.isObject(newChip)) { - var identical = this.items.some(function(item) { - return angular.equals(newChip, item); - }); - if (identical) return; - } - - // Check for a null (but not undefined), or existing chip and cancel appending - if (newChip == null || this.items.indexOf(newChip) + 1) return; - - // Append the new chip onto our list - var length = this.items.push(newChip); - var index = length - 1; - - this.updateNgModel(); - - // Tell screen reader users that the chip was successfully added. - // TODO add a way for developers to specify which field of the object should be announced here. - var chipContent = angular.isObject(newChip) ? '' : newChip; - this.$mdLiveAnnouncer.announce(chipContent + ' ' + this.addedMessage, 'assertive'); - - // If the md-on-add attribute is specified, send a chip addition event - if (this.useOnAdd && this.onAdd) { - this.onAdd({ '$chip': newChip, '$index': index }); - } -}; - -/** - * Sets whether to use the md-transform-chip expression. This expression is - * bound to scope and controller in {@code MdChipsDirective} as - * {@code transformChip}. Due to the nature of directive scope bindings, the - * controller cannot know on its own/from the scope whether an expression was - * actually provided. - */ -MdChipsCtrl.prototype.useTransformChipExpression = function() { - this.useTransformChip = true; -}; - -/** - * Sets whether to use the md-on-add expression. This expression is - * bound to scope and controller in {@code MdChipsDirective} as - * {@code onAdd}. Due to the nature of directive scope bindings, the - * controller cannot know on its own/from the scope whether an expression was - * actually provided. - */ -MdChipsCtrl.prototype.useOnAddExpression = function() { - this.useOnAdd = true; -}; - -/** - * Sets whether to use the md-on-remove expression. This expression is - * bound to scope and controller in {@code MdChipsDirective} as - * {@code onRemove}. Due to the nature of directive scope bindings, the - * controller cannot know on its own/from the scope whether an expression was - * actually provided. - */ -MdChipsCtrl.prototype.useOnRemoveExpression = function() { - this.useOnRemove = true; -}; - -/** - * Sets whether to use the md-on-select expression. This expression is - * bound to scope and controller in {@code MdChipsDirective} as - * {@code onSelect}. Due to the nature of directive scope bindings, the - * controller cannot know on its own/from the scope whether an expression was - * actually provided. - */ -MdChipsCtrl.prototype.useOnSelectExpression = function() { - this.useOnSelect = true; -}; - -/** - * Gets the input buffer. The input buffer can be the model bound to the - * default input item {@code this.chipBuffer}, the {@code selectedItem} - * model of an {@code md-autocomplete}, or, through some magic, the model - * bound to any input or text area element found within a - * {@code md-input-container} element. - * @return {string} the input buffer - */ -MdChipsCtrl.prototype.getChipBuffer = function() { - var chipBuffer = !this.userInputElement ? this.chipBuffer : - this.userInputNgModelCtrl ? this.userInputNgModelCtrl.$viewValue : - this.userInputElement[0].value; - - // Ensure that the chip buffer is always a string. For example, the input element buffer - // might be falsy. - return angular.isString(chipBuffer) ? chipBuffer : ''; -}; - -/** - * Resets the input buffer for either the internal input or user provided input element. - */ -MdChipsCtrl.prototype.resetChipBuffer = function() { - if (this.userInputElement) { - if (this.userInputNgModelCtrl) { - this.userInputNgModelCtrl.$setViewValue(''); - this.userInputNgModelCtrl.$render(); - } else { - this.userInputElement[0].value = ''; - } - } else { - this.chipBuffer = ''; - } -}; - -/** - * @returns {boolean} true if the max chips limit has been reached, false otherwise. - */ -MdChipsCtrl.prototype.hasMaxChipsReached = function() { - if (angular.isString(this.maxChips)) { - this.maxChips = parseInt(this.maxChips, 10) || 0; - } - - return this.maxChips > 0 && this.items.length >= this.maxChips; -}; - -/** - * Updates the validity properties for the ngModel. - * - * TODO add the md-max-chips validator to this.ngModelCtrl.validators so that the validation will - * be performed automatically. - */ -MdChipsCtrl.prototype.validateModel = function() { - this.ngModelCtrl.$setValidity('md-max-chips', !this.hasMaxChipsReached()); - this.ngModelCtrl.$validate(); // rerun any registered validators -}; - -/** - * Function to handle updating the model, validation, and change notification when a chip - * is added, removed, or changed. - * @param {boolean=} skipValidation true to skip calling validateModel() - */ -MdChipsCtrl.prototype.updateNgModel = function(skipValidation) { - if (!skipValidation) { - this.validateModel(); - } - // This will trigger ng-change to fire, even in cases where $setViewValue() would not. - angular.forEach(this.ngModelCtrl.$viewChangeListeners, function(listener) { - try { - listener(); - } catch (e) { - this.$exceptionHandler(e); - } - }); -}; - -/** - * Removes the chip at the given index. - * @param {number} index of chip to remove - * @param {Event=} event optionally passed to the onRemove callback - */ -MdChipsCtrl.prototype.removeChip = function(index, event) { - var removed = this.items.splice(index, 1); - - this.updateNgModel(); - this.ngModelCtrl.$setDirty(); - - // Tell screen reader users that the chip was successfully removed. - // TODO add a way for developers to specify which field of the object should be announced here. - var chipContent = angular.isObject(removed[0]) ? '' : removed[0]; - this.$mdLiveAnnouncer.announce(chipContent + ' ' + this.removedMessage, 'assertive'); - - if (removed && removed.length && this.useOnRemove && this.onRemove) { - this.onRemove({ '$chip': removed[0], '$index': index, '$event': event }); - } -}; - -/** - * @param {number} index location of chip to remove - * @param {Event=} $event - */ -MdChipsCtrl.prototype.removeChipAndFocusInput = function (index, $event) { - this.removeChip(index, $event); - - if (this.autocompleteCtrl) { - // Always hide the autocomplete dropdown before focusing the autocomplete input. - // Wait for the input to move horizontally, because the chip was removed. - // This can lead to an incorrect dropdown position. - this.autocompleteCtrl.hidden = true; - this.$mdUtil.nextTick(this.onFocus.bind(this)); - } else { - this.onFocus(); - } - -}; -/** - * Selects the chip at `index`, - * @param {number} index location of chip to select and focus - */ -MdChipsCtrl.prototype.selectAndFocusChipSafe = function(index) { - // If we have no chips, or are asked to select a chip before the first, just focus the input - if (!this.items.length || index === -1) { - return this.focusInput(); - } - - // If we are asked to select a chip greater than the number of chips... - if (index >= this.items.length) { - if (this.readonly) { - // If we are readonly, jump back to the start (because we have no input) - index = 0; - } else { - // If we are not readonly, we should attempt to focus the input - return this.onFocus(); - } - } - - index = Math.max(index, 0); - index = Math.min(index, this.items.length - 1); - - this.selectChip(index); - this.focusChip(index); -}; - -/** - * Focus last chip, then focus the input. This is needed for screen reader support. - */ -MdChipsCtrl.prototype.focusLastChipThenInput = function() { - var ctrl = this; - - ctrl.shouldFocusLastChip = false; - - ctrl.focusChip(this.items.length - 1); - - ctrl.$timeout(function() { - ctrl.focusInput(); - }, ctrl.chipAppendDelay); -}; - -/** - * Focus the input element. - */ -MdChipsCtrl.prototype.focusInput = function() { - this.selectChip(-1); - this.onFocus(); -}; - -/** - * Marks the chip at the given index as selected. - * @param {number} index location of chip to select - */ -MdChipsCtrl.prototype.selectChip = function(index) { - if (index >= -1 && index <= this.items.length) { - this.selectedChip = index; - - // Fire the onSelect if provided - if (this.useOnSelect && this.onSelect) { - this.onSelect({'$chip': this.items[index] }); - } - } else { - this.$log.warn('Selected Chip index out of bounds; ignoring.'); - } -}; - -/** - * Call {@code focus()} on the chip at {@code index} - * @param {number} index location of chip to focus - */ -MdChipsCtrl.prototype.focusChip = function(index) { - var chipContent = this.$element[0].querySelector( - 'md-chip[index="' + index + '"] .md-chip-content' - ); - - this.ariaTabIndex = index; - - chipContent.focus(); -}; - -/** - * Configures the required interactions with the ngModel Controller. - * Specifically, set {@code this.items} to the {@code NgModelController#$viewValue}. - * @param {NgModelController} ngModelCtrl - */ -MdChipsCtrl.prototype.configureNgModel = function(ngModelCtrl) { - this.ngModelCtrl = ngModelCtrl; - - var self = this; - - // in chips the meaning of $isEmpty changes - ngModelCtrl.$isEmpty = function(value) { - return !value || value.length === 0; - }; - - ngModelCtrl.$render = function() { - // model is updated. do something. - self.items = self.ngModelCtrl.$viewValue; - }; -}; - -MdChipsCtrl.prototype.onFocus = function () { - var input = this.$element[0].querySelector('input'); - input && input.focus(); - this.resetSelectedChip(); -}; - -MdChipsCtrl.prototype.onInputFocus = function () { - this.inputHasFocus = true; - - // Make sure we have the appropriate ARIA attributes - this.setupInputAria(); - - // Make sure we don't have any chips selected - this.resetSelectedChip(); -}; - -MdChipsCtrl.prototype.onInputBlur = function () { - this.inputHasFocus = false; - - if (this.shouldAddOnBlur()) { - this.appendChip(this.getChipBuffer().trim()); - this.resetChipBuffer(); - } -}; - -/** - * Configure event bindings on input element. - * @param {angular.element} inputElement - */ -MdChipsCtrl.prototype.configureInput = function configureInput(inputElement) { - // Find the NgModelCtrl for the input element - var ngModelCtrl = inputElement.controller('ngModel'); - var ctrl = this; - - if (ngModelCtrl) { - - // sync touched-state from inner input to chips-element - this.deRegister.push( - this.$scope.$watch( - function() { - return ngModelCtrl.$touched; - }, - function(isTouched) { - isTouched && ctrl.ngModelCtrl.$setTouched(); - } - ) - ); - - // sync dirty-state from inner input to chips-element - this.deRegister.push( - this.$scope.$watch( - function() { - return ngModelCtrl.$dirty; - }, - function(isDirty) { - isDirty && ctrl.ngModelCtrl.$setDirty(); - } - ) - ); - } -}; - -/** - * Configure event bindings on a user-provided input element. - * @param {angular.element} inputElement - */ -MdChipsCtrl.prototype.configureUserInput = function(inputElement) { - this.userInputElement = inputElement; - - // Find the NgModelCtrl for the input element - var ngModelCtrl = inputElement.controller('ngModel'); - // `.controller` will look in the parent as well. - if (ngModelCtrl !== this.ngModelCtrl) { - this.userInputNgModelCtrl = ngModelCtrl; - } - - var scope = this.$scope; - var ctrl = this; - - // Run all of the events using evalAsync because a focus may fire a blur in the same digest loop - var scopeApplyFn = function(event, fn) { - scope.$evalAsync(angular.bind(ctrl, fn, event)); - }; - - // Bind to keydown and focus events of input - inputElement - .attr({ tabindex: 0 }) - .on('keydown', function(event) { scopeApplyFn(event, ctrl.inputKeydown); }) - .on('focus', function(event) { scopeApplyFn(event, ctrl.onInputFocus); }) - .on('blur', function(event) { scopeApplyFn(event, ctrl.onInputBlur); }); -}; - -/** - * @param {MdAutocompleteCtrl} ctrl controller from the autocomplete component - */ -MdChipsCtrl.prototype.configureAutocomplete = function(ctrl) { - if (ctrl) { - this.autocompleteCtrl = ctrl; - // Update the default container empty hint when we're inside of an autocomplete. - if (!this.$element.attr('container-empty-hint')) { - this.containerEmptyHint = 'Chips container with autocompletion. Enter the text area, ' + - 'type text to search, and then use the up and down arrow keys to select an option. ' + - 'Press enter to add the selected option as a chip.'; - this.setupWrapperAria(); - } - - ctrl.registerSelectedItemWatcher(angular.bind(this, function (item) { - if (item) { - // Only append the chip and reset the chip buffer if the max chips limit isn't reached. - if (this.hasMaxChipsReached()) return; - - this.appendChip(item); - this.resetChipBuffer(); - } - })); - - this.$element.find('input') - .on('focus',angular.bind(this, this.onInputFocus)) - .on('blur', angular.bind(this, this.onInputBlur)); - } -}; - -/** - * @returns {boolean} Whether the current chip buffer should be added on input blur or not. - */ -MdChipsCtrl.prototype.shouldAddOnBlur = function() { - - // Update the custom ngModel validators from the chips component. - this.validateModel(); - - var chipBuffer = this.getChipBuffer().trim(); - // If the model value is empty and required is set on the element, then the model will be invalid. - // In that case, we still want to allow adding the chip. The main (but not only) case we want - // to disallow is adding a chip on blur when md-max-chips validation fails. - var isModelValid = this.ngModelCtrl.$isEmpty(this.ngModelCtrl.$modelValue) || - this.ngModelCtrl.$valid; - var isAutocompleteShowing = this.autocompleteCtrl && !this.autocompleteCtrl.hidden; - - if (this.userInputNgModelCtrl) { - isModelValid = isModelValid && this.userInputNgModelCtrl.$valid; - } - - return this.addOnBlur && !this.requireMatch && chipBuffer && isModelValid && - !isAutocompleteShowing; -}; - -/** - * @returns {boolean} true if the input or a chip is focused. False otherwise. - */ -MdChipsCtrl.prototype.hasFocus = function () { - return this.inputHasFocus || this.selectedChip >= 0; -}; - -/** - * @param {number} index location of content id - * @returns {number} unique id for the aria-owns attribute - */ -MdChipsCtrl.prototype.contentIdFor = function(index) { - return this.contentIds[index]; -}; - -})(); -(function(){ -"use strict"; - - - MdChips.$inject = ["$mdTheming", "$mdUtil", "$compile", "$log", "$timeout", "$$mdSvgRegistry"];angular - .module('material.components.chips') - .directive('mdChips', MdChips); - - /** - * @ngdoc directive - * @name mdChips - * @module material.components.chips - * - * @description - * `` is an input component for building lists of strings or objects. The list items are - * displayed as 'chips'. This component can make use of an `` element or an - * `` element. - * - * ### Custom templates - * A custom template may be provided to render the content of each chip. This is achieved by - * specifying an `` element containing the custom content as a child of - * ``. - * - * Note: Any attributes on - * `` will be dropped as only the innerHTML is used for the chip template. The - * variables `$chip` and `$index` are available in the scope of ``, representing - * the chip object and its index in the list of chips, respectively. - * To override the chip delete control, include an element (ideally a button) with the attribute - * `md-chip-remove`. A click listener to remove the chip will be added automatically. The element - * is also placed as a sibling to the chip content (on which there are also click listeners) to - * avoid a nested ng-click situation. - * - * - * - * Sometimes developers want to limit the amount of possible chips.
    - * You can specify the maximum amount of chips by using the following markup. - * - * - * - * - * - * - * In some cases, you have an autocomplete inside of the `md-chips`.
    - * When the maximum amount of chips has been reached, you can also disable the autocomplete - * selection.
    - * Here is an example markup. - * - * - * - * - * - * - * - * ### Accessibility - * - * The `md-chips` component supports keyboard and screen reader users since Version 1.1.2. In - * order to achieve this, we modified the chips behavior to select newly appended chips for - * `300ms` before re-focusing the input and allowing the user to type. - * - * For most users, this delay is small enough that it will not be noticeable but allows certain - * screen readers to function properly (JAWS and NVDA in particular). - * - * We introduced a new `md-chip-append-delay` option to allow developers to better control this - * behavior. - * - * Please refer to the documentation of this option (below) for more information. - * - * @param {expression} ng-model Assignable AngularJS expression to be data-bound to the list of - * chips. The expression should evaluate to a `string` or `Object` Array. The type of this - * array should align with the return value of `md-transform-chip`. - * @param {expression=} ng-change AngularJS expression to be executed on chip addition, removal, - * or content change. - * @param {string=} placeholder Placeholder text that will be forwarded to the input. - * @param {string=} secondary-placeholder Placeholder text that will be forwarded to the input, - * displayed when there is at least one item in the list - * @param {boolean=} md-removable Enables or disables the deletion of chips through the - * removal icon or the Delete/Backspace key. Defaults to true. - * @param {boolean=} readonly Disables list manipulation (deleting or adding list items), hiding - * the input and delete buttons. If no `ng-model` is provided, the chips will automatically be - * marked as readonly.

    - * When `md-removable` is not defined, the `md-remove` behavior will be overwritten and - * disabled. - * @param {boolean=} md-enable-chip-edit Set this to `"true"` to enable editing of chip contents. - * The user can go into edit mode by pressing the `space` or `enter` keys, or by double - * clicking on the chip. Chip editing is only supported for chips using the basic template. - * **Note:** This attribute is only evaluated once; it is not watched. - * @param {boolean=} ng-required Whether ng-model is allowed to be empty or not. - * @param {number=} md-max-chips The maximum number of chips allowed to add through user input. - *

    The validation property `md-max-chips` can be used when the max chips - * amount is reached. - * @param {boolean=} md-add-on-blur When set to `"true"`, the remaining text inside of the input - * will be converted into a new chip on blur. - * **Note:** This attribute is only evaluated once; it is not watched. - * @param {expression} md-transform-chip An expression of form `myFunction($chip)` that when - * called expects one of the following return values: - * - an object representing the `$chip` input string - * - `undefined` to simply add the `$chip` input string, or - * - `null` to prevent the chip from being appended - * @param {expression=} md-on-add An expression which will be called when a chip has been - * added with `$chip` and `$index` available as parameters. - * @param {expression=} md-on-remove An expression which will be called when a chip has been - * removed with `$chip`, `$index`, and `$event` available as parameters. - * @param {expression=} md-on-select An expression which will be called when a chip is selected. - * @param {boolean=} md-require-match If true, and the chips template contains an autocomplete, - * only allow selection of pre-defined chips (i.e. you cannot add new ones). - * @param {string=} md-input-class This class will be applied to the child input for custom - * styling. If you are using an `md-autocomplete`, then you need to put this attribute on the - * `md-autocomplete` rather than the `md-chips`. - * @param {string=} input-aria-describedby A space-separated list of element IDs. This should - * contain the IDs of any elements that describe this autocomplete. Screen readers will read - * the content of these elements at the end of announcing that the chips input has been - * selected and describing its current state. The descriptive elements do not need to be - * visible on the page. - * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use - * case is that this would contain the ID of a `
    \ - \ -
    \ - {{$chip[$mdContactChipsCtrl.contactName]}}\ -
    \ -
    \ - {{$chip[$mdContactChipsCtrl.contactName]}}\ -
    \ -
    \ -
    '; - - -/** - * MDContactChips Directive Definition - * - * @param $mdTheming - * @param $mdUtil - * @returns {*} - * @ngInject - */ -function MdContactChips($mdTheming, $mdUtil) { - return { - template: function(element, attrs) { - return MD_CONTACT_CHIPS_TEMPLATE; - }, - restrict: 'E', - controller: 'MdContactChipsCtrl', - controllerAs: '$mdContactChipsCtrl', - bindToController: true, - compile: compile, - scope: { - contactQuery: '&mdContacts', - placeholder: '@?', - secondaryPlaceholder: '@?', - contactName: '@mdContactName', - contactImage: '@mdContactImage', - contactEmail: '@mdContactEmail', - contacts: '=ngModel', - ngChange: '&?', - requireMatch: '=?mdRequireMatch', - minLength: '=?mdMinLength', - maxChips: '=?mdMaxChips', - highlightFlags: '@?mdHighlightFlags', - chipAppendDelay: '@?mdChipAppendDelay', - separatorKeys: '=?mdSeparatorKeys', - removedMessage: '@?mdRemovedMessage', - inputClass: '@?mdInputClass', - inputAriaDescribedBy: '@?inputAriaDescribedby', - inputAriaLabelledBy: '@?inputAriaLabelledby', - inputAriaLabel: '@?', - containerHint: '@?', - containerEmptyHint: '@?', - deleteHint: '@?' - } - }; - - function compile(element, attr) { - return function postLink(scope, element, attrs, controllers) { - var contactChipsController = controllers; - - $mdUtil.initOptionalProperties(scope, attr); - $mdTheming(element); - - element.attr('tabindex', '-1'); - - attrs.$observe('mdChipAppendDelay', function(newValue) { - contactChipsController.chipAppendDelay = newValue; - }); - }; - } -} - -})(); -(function(){ -"use strict"; - -(function () { - "use strict"; - - /** - * Use a RegExp to check if the `md-colors=""` is static string - * or one that should be observed and dynamically interpolated. - */ - MdColorsDirective.$inject = ["$mdColors", "$mdUtil", "$log", "$parse"]; - MdColorsService.$inject = ["$mdTheming", "$mdUtil", "$log"]; - var STATIC_COLOR_EXPRESSION = /^{((\s|,)*?["'a-zA-Z-]+?\s*?:\s*?(['"])[a-zA-Z0-9-.]*(['"]))+\s*}$/; - var colorPalettes = null; - - /** - * @ngdoc module - * @name material.components.colors - * - * @description - * Define $mdColors service and a `md-colors=""` attribute directive - */ - angular - .module('material.components.colors', ['material.core']) - .directive('mdColors', MdColorsDirective) - .service('$mdColors', MdColorsService); - - /** - * @ngdoc service - * @name $mdColors - * @module material.components.colors - * - * @description - * By default, defining a theme does not make its colors available for applying to non AngularJS - * Material elements. The `$mdColors` service is used by the `md-color` directive to convert a - * set of color expressions to RGBA values and then apply those values to the element as CSS - * property values. - * - * @usage - * Getting a color based on a theme - * - * - * angular.controller('myCtrl', function ($mdColors) { - * var color = $mdColors.getThemeColor('myTheme-primary-900-0.5'); - * ... - * }); - * - * - * Applying a color from a palette to an element - * - * app.directive('myDirective', function($mdColors) { - * return { - * ... - * link: function (scope, elem) { - * $mdColors.applyThemeColors(elem, {color: 'red-A200-0.2'}); - * } - * } - * }); - * - */ - function MdColorsService($mdTheming, $mdUtil, $log) { - colorPalettes = colorPalettes || Object.keys($mdTheming.PALETTES); - - // Publish service instance - return { - applyThemeColors: applyThemeColors, - getThemeColor: getThemeColor, - hasTheme: hasTheme - }; - - // ******************************************** - // Internal Methods - // ******************************************** - - /** - * @ngdoc method - * @name $mdColors#applyThemeColors - * - * @description - * Lookup a set of colors by hue, theme, and palette, then apply those colors - * with the provided opacity (via `rgba()`) to the specified CSS property. - * - * @param {angular.element} element the element to apply the styles to - * @param {Object} colorExpression Keys are CSS properties and values are strings representing - * the `theme-palette-hue-opacity` of the desired color. For example: - * `{'color': 'red-A200-0.3', 'background-color': 'myTheme-primary-700-0.8'}`. Theme, hue, and - * opacity are optional. - */ - function applyThemeColors(element, colorExpression) { - try { - if (colorExpression) { - // Assign the calculate RGBA color values directly as inline CSS - element.css(interpolateColors(colorExpression)); - } - } catch (e) { - $log.error(e.message); - } - } - - /** - * @ngdoc method - * @name $mdColors#getThemeColor - * - * @description - * Get a parsed RGBA color using a string representing the `theme-palette-hue-opacity` of the - * desired color. - * - * @param {string} expression color expression like `'red-A200-0.3'` or - * `'myTheme-primary-700-0.8'`. Theme, hue, and opacity are optional. - * @returns {string} a CSS color value like `rgba(211, 47, 47, 0.8)` - */ - function getThemeColor(expression) { - var color = extractColorOptions(expression); - - return parseColor(color); - } - - /** - * Return the parsed color - * @param {{hue: *, theme: any, palette: *, opacity: (*|string|number)}} color hash map of color - * definitions - * @param {boolean=} contrast whether use contrast color for foreground. Defaults to false. - * @returns {string} rgba color string - */ - function parseColor(color, contrast) { - contrast = contrast || false; - var rgbValues = $mdTheming.PALETTES[color.palette][color.hue]; - - rgbValues = contrast ? rgbValues.contrast : rgbValues.value; - - return $mdUtil.supplant('rgba({0}, {1}, {2}, {3})', - [rgbValues[0], rgbValues[1], rgbValues[2], rgbValues[3] || color.opacity] - ); - } - - /** - * Convert the color expression into an object with scope-interpolated values - * Then calculate the rgba() values based on the theme color parts - * @param {Object} themeColors json object, keys are css properties and values are string of - * the wanted color, for example: `{color: 'red-A200-0.3'}`. - * @return {Object} Hashmap of CSS properties with associated `rgba()` string values - */ - function interpolateColors(themeColors) { - var rgbColors = {}; - - var hasColorProperty = themeColors.hasOwnProperty('color'); - - angular.forEach(themeColors, function (value, key) { - var color = extractColorOptions(value); - var hasBackground = key.indexOf('background') > -1; - - rgbColors[key] = parseColor(color); - if (hasBackground && !hasColorProperty) { - rgbColors.color = parseColor(color, true); - } - }); - - return rgbColors; - } - - /** - * Check if expression has defined theme - * For instance: - * 'myTheme-primary' => true - * 'red-800' => false - * @param {string} expression color expression like 'red-800', 'red-A200-0.3', - * 'myTheme-primary', or 'myTheme-primary-400' - * @return {boolean} true if the expression has a theme part, false otherwise. - */ - function hasTheme(expression) { - return angular.isDefined($mdTheming.THEMES[expression.split('-')[0]]); - } - - /** - * For the evaluated expression, extract the color parts into a hash map - * @param {string} expression color expression like 'red-800', 'red-A200-0.3', - * 'myTheme-primary', or 'myTheme-primary-400' - * @returns {{hue: *, theme: any, palette: *, opacity: (*|string|number)}} - */ - function extractColorOptions(expression) { - var parts = expression.split('-'); - var hasTheme = angular.isDefined($mdTheming.THEMES[parts[0]]); - var theme = hasTheme ? parts.splice(0, 1)[0] : $mdTheming.defaultTheme(); - - return { - theme: theme, - palette: extractPalette(parts, theme), - hue: extractHue(parts, theme), - opacity: parts[2] || 1 - }; - } - - /** - * Calculate the theme palette name - * @param {Array} parts - * @param {string} theme name - * @return {string} - */ - function extractPalette(parts, theme) { - // If the next section is one of the palettes we assume it's a two word palette - // Two word palette can be also written in camelCase, forming camelCase to dash-case - - var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1; - var palette = parts[0].replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); - - if (isTwoWord) palette = parts[0] + '-' + parts.splice(1, 1); - - if (colorPalettes.indexOf(palette) === -1) { - // If the palette is not in the palette list it's one of primary/accent/warn/background - var scheme = $mdTheming.THEMES[theme].colors[palette]; - if (!scheme) { - throw new Error($mdUtil.supplant( - 'mdColors: couldn\'t find \'{palette}\' in the palettes.', - {palette: palette})); - } - palette = scheme.name; - } - - return palette; - } - - /** - * @param {Array} parts - * @param {string} theme name - * @return {*} - */ - function extractHue(parts, theme) { - var themeColors = $mdTheming.THEMES[theme].colors; - - if (parts[1] === 'hue') { - var hueNumber = parseInt(parts.splice(2, 1)[0], 10); - - if (hueNumber < 1 || hueNumber > 3) { - throw new Error($mdUtil.supplant( - 'mdColors: \'hue-{hueNumber}\' is not a valid hue, can be only \'hue-1\', \'hue-2\' and \'hue-3\'', - {hueNumber: hueNumber})); - } - parts[1] = 'hue-' + hueNumber; - - if (!(parts[0] in themeColors)) { - throw new Error($mdUtil.supplant( - 'mdColors: \'hue-x\' can only be used with [{availableThemes}], but was used with \'{usedTheme}\'', - { - availableThemes: Object.keys(themeColors).join(', '), - usedTheme: parts[0] - })); - } - - return themeColors[parts[0]].hues[parts[1]]; - } - - return parts[1] || themeColors[parts[0] in themeColors ? parts[0] : 'primary'].hues['default']; - } - } - - /** - * @ngdoc directive - * @name mdColors - * @module material.components.colors - * - * @restrict A - * - * @description - * `mdColors` directive will apply the theme-based color expression as RGBA CSS style values. - * - * The format will be similar to the colors defined in the Sass files: - * - * ## `[?theme]-[palette]-[?hue]-[?opacity]` - * - [theme] - default value is the default theme - * - [palette] - can be either palette name or primary/accent/warn/background - * - [hue] - default is 500 (hue-x can be used with primary/accent/warn/background) - * - [opacity] - default is 1 - * - * - * > `?` indicates optional parameter - * - * @usage - * - *
    - *
    - * Color demo - *
    - *
    - *
    - * - * The `mdColors` directive will automatically watch for changes in the expression if it recognizes - * an interpolation expression or a function. For performance options, you can use `::` prefix to - * the `md-colors` expression to indicate a one-time data binding. - * - * - * - * - * - */ - function MdColorsDirective($mdColors, $mdUtil, $log, $parse) { - return { - restrict: 'A', - require: ['^?mdTheme'], - compile: function (tElem, tAttrs) { - var shouldWatch = shouldColorsWatch(); - - return function (scope, element, attrs, ctrl) { - var mdThemeController = ctrl[0]; - - var lastColors = {}; - - /** - * @param {string=} theme - * @return {Object} colors found in the specified theme - */ - var parseColors = function (theme) { - if (typeof theme !== 'string') { - theme = ''; - } - - if (!attrs.mdColors) { - attrs.mdColors = '{}'; - } - - /** - * Json.parse() does not work because the keys are not quoted; - * use $parse to convert to a hash map - */ - var colors = $parse(attrs.mdColors)(scope); - - /** - * If mdTheme is defined higher up the DOM tree, - * we add mdTheme's theme to the colors which don't specify a theme. - * - * @example - * - *
    - *
    - * Color demo - *
    - *
    - *
    - * - * 'primary-600' will be changed to 'myTheme-primary-600', - * but 'mySecondTheme-accent-200' will not be changed since it has a theme defined. - */ - if (mdThemeController) { - Object.keys(colors).forEach(function (prop) { - var color = colors[prop]; - if (!$mdColors.hasTheme(color)) { - colors[prop] = (theme || mdThemeController.$mdTheme) + '-' + color; - } - }); - } - - cleanElement(colors); - - return colors; - }; - - /** - * @param {Object} colors - */ - var cleanElement = function (colors) { - if (!angular.equals(colors, lastColors)) { - var keys = Object.keys(lastColors); - - if (lastColors.background && !keys.color) { - keys.push('color'); - } - - keys.forEach(function (key) { - element.css(key, ''); - }); - } - - lastColors = colors; - }; - - /** - * Registering for mgTheme changes and asking mdTheme controller run our callback whenever - * a theme changes. - */ - var unregisterChanges = angular.noop; - - if (mdThemeController) { - unregisterChanges = mdThemeController.registerChanges(function (theme) { - $mdColors.applyThemeColors(element, parseColors(theme)); - }); - } - - scope.$on('$destroy', function () { - unregisterChanges(); - }); - - try { - if (shouldWatch) { - scope.$watch(parseColors, angular.bind(this, - $mdColors.applyThemeColors, element - ), true); - } - else { - $mdColors.applyThemeColors(element, parseColors()); - } - - } - catch (e) { - $log.error(e.message); - } - - }; - - /** - * @return {boolean} - */ - function shouldColorsWatch() { - // Simulate 1x binding and mark mdColorsWatch == false - var rawColorExpression = tAttrs.mdColors; - var bindOnce = rawColorExpression.indexOf('::') > -1; - var isStatic = bindOnce ? true : STATIC_COLOR_EXPRESSION.test(tAttrs.mdColors); - - // Remove it for the postLink... - tAttrs.mdColors = rawColorExpression.replace('::', ''); - - var hasWatchAttr = angular.isDefined(tAttrs.mdColorsWatch); - - return (bindOnce || isStatic) ? false : - hasWatchAttr ? $mdUtil.parseAttributeBoolean(tAttrs.mdColorsWatch) : true; - } - } - }; - } -})(); - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.content - * - * @description - * Scrollable content - */ -mdContentDirective.$inject = ["$mdTheming"]; -angular.module('material.components.content', [ - 'material.core' -]) - .directive('mdContent', mdContentDirective); - -/** - * @ngdoc directive - * @name mdContent - * @module material.components.content - * - * @restrict E - * - * @description - * - * The `` directive is a container element useful for scrollable content. It achieves - * this by setting the CSS `overflow` property to `auto` so that content can properly scroll. - * - * In general, `` components are not designed to be nested inside one another. If - * possible, it is better to make them siblings. This often results in a better user experience as - * having nested scrollbars may confuse the user. - * - * ## Troubleshooting - * - * In some cases, you may wish to apply the `md-no-momentum` class to ensure that Safari's - * momentum scrolling is disabled. Momentum scrolling can cause flickering issues while scrolling - * SVG icons and some other components. - * - * Additionally, we now also offer the `md-no-flicker` class which can be applied to any element - * and uses a Webkit-specific filter of `blur(0px)` that forces GPU rendering of all elements - * inside (which eliminates the flicker on iOS devices). - * - * _Note: Forcing an element to render on the GPU can have unintended side-effects, especially - * related to the z-index of elements. Please use with caution and only on the elements needed._ - * - * @usage - * - * Add the `[layout-padding]` attribute to make the content padded. - * - * - * - * Lorem ipsum dolor sit amet, ne quod novum mei. - * - * - */ - -function mdContentDirective($mdTheming) { - return { - restrict: 'E', - controller: ['$scope', '$element', ContentController], - link: function(scope, element) { - element.addClass('_md'); // private md component indicator for styling - - $mdTheming(element); - scope.$broadcast('$mdContentLoaded', element); - - iosScrollFix(element[0]); - } - }; - - function ContentController($scope, $element) { - this.$scope = $scope; - this.$element = $element; - } -} - -function iosScrollFix(node) { - // IOS FIX: - // If we scroll where there is no more room for the webview to scroll, - // by default the webview itself will scroll up and down, this looks really - // bad. So if we are scrolling to the very top or bottom, add/subtract one - angular.element(node).on('$md.pressdown', function(ev) { - // Only touch events - if (ev.pointer.type !== 't') return; - // Don't let a child content's touchstart ruin it for us. - if (ev.$materialScrollFixed) return; - ev.$materialScrollFixed = true; - - if (node.scrollTop === 0) { - node.scrollTop = 1; - } else if (node.scrollHeight === node.scrollTop + node.offsetHeight) { - node.scrollTop -= 1; - } - }); -} - -})(); -(function(){ -"use strict"; - -/** - * @ngdoc module - * @name material.components.datepicker - * @description Module for the datepicker component. - */ - -angular.module('material.components.datepicker', [ - 'material.core', - 'material.components.icon', - 'material.components.virtualRepeat' -]); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * @ngdoc directive - * @name mdCalendar - * @module material.components.datepicker - * - * @param {Date} ng-model The component's model. Should be a Date object. - * @param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being - * updated. Also allows for a timezone to be specified. - * Read more at the - * ngModelOptions docs. - * @param {Date=} md-min-date Expression representing the minimum date. - * @param {Date=} md-max-date Expression representing the maximum date. - * @param {(function(Date): boolean)=} md-date-filter Function expecting a date and returning a - * boolean whether it can be selected in "day" mode or not. - * @param {(function(Date): boolean)=} md-month-filter Function expecting a date and returning a - * boolean whether it can be selected in "month" mode or not. - * @param {String=} md-current-view Current view of the calendar. Can be either "month" or "year". - * @param {String=} md-mode Restricts the user to only selecting a value from a particular view. - * This option can be used if the user is only supposed to choose from a certain date type - * (e.g. only selecting the month). Can be either "month" or "day". **Note** that this will - * overwrite the `md-current-view` value. - * - * @description - * `` is a component that renders a calendar that can be used to select a date. - * It is a part of the `` pane, however it can also be used on it's own. - * - * @usage - * - * - * - * - */ - CalendarCtrl.$inject = ["$element", "$scope", "$$mdDateUtil", "$mdUtil", "$mdConstant", "$mdTheming", "$$rAF", "$attrs", "$mdDateLocale", "$filter", "$document"]; - calendarDirective.$inject = ["inputDirective"]; - angular.module('material.components.datepicker') - .directive('mdCalendar', calendarDirective); - - // TODO(jelbourn): Mac Cmd + left / right == Home / End - // TODO(jelbourn): Refactor month element creation to use cloneNode (performance). - // TODO(jelbourn): Define virtual scrolling constants (compactness) users can override. - // TODO(jelbourn): Animated month transition on ng-model change (virtual-repeat) - // TODO(jelbourn): Scroll snapping (virtual repeat) - // TODO(jelbourn): Remove superfluous row from short months (virtual-repeat) - // TODO(jelbourn): Month headers stick to top when scrolling. - // TODO(jelbourn): Previous month opacity is lowered when partially scrolled out of view. - // TODO(jelbourn): Support md-calendar standalone on a page (as a tabstop w/ aria-live - // announcement and key handling). - // TODO Read-only calendar (not just date-picker). - - function calendarDirective(inputDirective) { - return { - template: function(tElement, tAttr) { - // This allows the calendar to work, without a datepicker. This ensures that the virtual - // repeater scrolls to the proper place on load by deferring the execution until the next - // digest. It's necessary only if the calendar is used without a datepicker, otherwise it's - // already wrapped in an ngIf. - var extraAttrs = tAttr.hasOwnProperty('ngIf') ? '' : 'ng-if="calendarCtrl.isInitialized"'; - return '' + - '
    ' + - '' + - '' + - '
    '; - }, - scope: { - minDate: '=mdMinDate', - maxDate: '=mdMaxDate', - dateFilter: '=mdDateFilter', - monthFilter: '=mdMonthFilter', - - // These need to be prefixed, because Angular resets - // any changes to the value due to bindToController. - _mode: '@mdMode', - _currentView: '@mdCurrentView' - }, - require: ['ngModel', 'mdCalendar'], - controller: CalendarCtrl, - controllerAs: 'calendarCtrl', - bindToController: true, - link: function(scope, element, attrs, controllers) { - var ngModelCtrl = controllers[0]; - var mdCalendarCtrl = controllers[1]; - mdCalendarCtrl.configureNgModel(ngModelCtrl, inputDirective); - } - }; - } - - /** - * Occasionally the hideVerticalScrollbar method might read an element's - * width as 0, because it hasn't been laid out yet. This value will be used - * as a fallback, in order to prevent scenarios where the element's width - * would otherwise have been set to 0. This value is the "usual" width of a - * calendar within a floating calendar pane. - */ - var FALLBACK_WIDTH = 340; - - /** Next identifier for calendar instance. */ - var nextUniqueId = 0; - - /** Maps the `md-mode` values to their corresponding calendar views. */ - var MODE_MAP = { - day: 'month', - month: 'year' - }; - - /** - * Controller for the mdCalendar component. - * @ngInject @constructor - */ - function CalendarCtrl($element, $scope, $$mdDateUtil, $mdUtil, $mdConstant, $mdTheming, $$rAF, - $attrs, $mdDateLocale, $filter, $document) { - $mdTheming($element); - - /** - * @final - * @type {!JQLite} - */ - this.$element = $element; - - /** - * @final - * @type {!angular.Scope} - */ - this.$scope = $scope; - - /** - * @final - * @type {!angular.$attrs} Current attributes object for the element - */ - this.$attrs = $attrs; - - /** @final */ - this.dateUtil = $$mdDateUtil; - - /** @final */ - this.$mdUtil = $mdUtil; - - /** @final */ - this.keyCode = $mdConstant.KEY_CODE; - - /** @final */ - this.$$rAF = $$rAF; - - /** @final */ - this.$mdDateLocale = $mdDateLocale; - - /** @final The built-in Angular date filter. */ - this.ngDateFilter = $filter('date'); - - /** - * @final - * @type {Date} - */ - this.today = this.dateUtil.createDateAtMidnight(); - - /** @type {!ngModel.NgModelController} */ - this.ngModelCtrl = undefined; - - /** @type {string} Class applied to the selected date cell. */ - this.SELECTED_DATE_CLASS = 'md-calendar-selected-date'; - - /** @type {string} Class applied to the cell for today. */ - this.TODAY_CLASS = 'md-calendar-date-today'; - - /** @type {string} Class applied to the focused cell. */ - this.FOCUSED_DATE_CLASS = 'md-focus'; - - /** - * @final - * @type {number} Unique ID for this calendar instance. - */ - this.id = nextUniqueId++; - - /** - * The date that is currently focused or showing in the calendar. This will initially be set - * to the ng-model value if set, otherwise to today. It will be updated as the user navigates - * to other months. The cell corresponding to the displayDate does not necessarily always have - * focus in the document (such as for cases when the user is scrolling the calendar). - * @type {Date} - */ - this.displayDate = null; - - /** - * Allows restricting the calendar to only allow selecting a month or a day. - * @type {'month'|'day'|null} - */ - this.mode = null; - - /** - * The selected date. Keep track of this separately from the ng-model value so that we - * can know, when the ng-model value changes, what the previous value was before it's updated - * in the component's UI. - * - * @type {Date} - */ - this.selectedDate = null; - - /** - * The first date that can be rendered by the calendar. The default is taken - * from the mdDateLocale provider and is limited by the mdMinDate. - * @type {Date} - */ - this.firstRenderableDate = null; - - /** - * The last date that can be rendered by the calendar. The default comes - * from the mdDateLocale provider and is limited by the maxDate. - * @type {Date} - */ - this.lastRenderableDate = null; - - /** - * Used to toggle initialize the root element in the next digest. - * @type {boolean} - */ - this.isInitialized = false; - - /** - * Cache for the width of the element without a scrollbar. Used to hide the scrollbar later on - * and to avoid extra reflows when switching between views. - * @type {number} - */ - this.width = 0; - - /** - * Caches the width of the scrollbar in order to be used when hiding it and to avoid extra reflows. - * @type {number} - */ - this.scrollbarWidth = 0; - - /** - * @type {boolean} set to true if the calendar is being used "standalone" (outside of a - * md-datepicker). - */ - this.standaloneMode = false; - - // Unless the user specifies so, the calendar should not be a tab stop. - // This is necessary because ngAria might add a tabindex to anything with an ng-model - // (based on whether or not the user has turned that particular feature on/off). - if (!$attrs.tabindex) { - $element.attr('tabindex', '-1'); - } - - var boundKeyHandler = angular.bind(this, this.handleKeyEvent); - - // If use the md-calendar directly in the body without datepicker, - // handleKeyEvent will disable other inputs on the page. - // So only apply the handleKeyEvent on the body when the md-calendar inside datepicker, - // otherwise apply on the calendar element only. - - var handleKeyElement; - if ($element.parent().hasClass('md-datepicker-calendar')) { - handleKeyElement = angular.element($document[0].body); - } else { - this.standaloneMode = true; - handleKeyElement = $element; - } - - // Bind the keydown handler to the body, in order to handle cases where the focused - // element gets removed from the DOM and stops propagating click events. - handleKeyElement.on('keydown', boundKeyHandler); - - $scope.$on('$destroy', function() { - handleKeyElement.off('keydown', boundKeyHandler); - }); - - // For AngularJS 1.4 and older, where there are no lifecycle hooks but bindings are pre-assigned, - // manually call the $onInit hook. - if (angular.version.major === 1 && angular.version.minor <= 4) { - this.$onInit(); - } - } - - /** - * AngularJS Lifecycle hook for newer AngularJS versions. - * Bindings are not guaranteed to have been assigned in the controller, but they are in the - * $onInit hook. - */ - CalendarCtrl.prototype.$onInit = function() { - /** - * The currently visible calendar view. Note the prefix on the scope value, - * which is necessary, because the datepicker seems to reset the real one value if the - * calendar is open, but the `currentView` on the datepicker's scope is empty. - * @type {String} - */ - if (this._mode && MODE_MAP.hasOwnProperty(this._mode)) { - this.currentView = MODE_MAP[this._mode]; - this.mode = this._mode; - } else { - this.currentView = this._currentView || 'month'; - this.mode = null; - } - - if (this.minDate && this.minDate > this.$mdDateLocale.firstRenderableDate) { - this.firstRenderableDate = this.minDate; - } else { - this.firstRenderableDate = this.$mdDateLocale.firstRenderableDate; - } - - if (this.maxDate && this.maxDate < this.$mdDateLocale.lastRenderableDate) { - this.lastRenderableDate = this.maxDate; - } else { - this.lastRenderableDate = this.$mdDateLocale.lastRenderableDate; - } - }; - - /** - * Sets up the controller's reference to ngModelController. - * @param {!ngModel.NgModelController} ngModelCtrl Instance of the ngModel controller. - * @param {Object} inputDirective Config for AngularJS's `input` directive. - */ - CalendarCtrl.prototype.configureNgModel = function(ngModelCtrl, inputDirective) { - var self = this; - self.ngModelCtrl = ngModelCtrl; - - // The component needs to be [type="date"] in order to be picked up by AngularJS. - this.$attrs.$set('type', 'date'); - - // Invoke the `input` directive link function, adding a stub for the element. - // This allows us to re-use AngularJS' logic for setting the timezone via ng-model-options. - // It works by calling the link function directly which then adds the proper `$parsers` and - // `$formatters` to the NgModelController. - inputDirective[0].link.pre(this.$scope, { - on: angular.noop, - val: angular.noop, - 0: {} - }, this.$attrs, [ngModelCtrl]); - - ngModelCtrl.$render = function() { - var value = this.$viewValue, convertedDate; - - // In the case where a conversion is needed, the $viewValue here will be a string like - // "2020-05-10" instead of a Date object. - if (!self.dateUtil.isValidDate(value)) { - convertedDate = self.dateUtil.removeLocalTzAndReparseDate(new Date(value)); - if (self.dateUtil.isValidDate(convertedDate)) { - value = convertedDate; - } - } - - // Notify the child scopes of any changes. - self.$scope.$broadcast('md-calendar-parent-changed', value); - - // Set up the selectedDate if it hasn't been already. - if (!self.selectedDate) { - self.selectedDate = value; - } - - // Also set up the displayDate. - if (!self.displayDate) { - self.displayDate = self.selectedDate || self.today; - } - }; - - self.$mdUtil.nextTick(function() { - self.isInitialized = true; - }); - }; - - /** - * Sets the ng-model value for the calendar and emits a change event. - * @param {Date} date new value for the calendar - */ - CalendarCtrl.prototype.setNgModelValue = function(date) { - var timezone = this.$mdUtil.getModelOption(this.ngModelCtrl, 'timezone'); - var value = this.dateUtil.createDateAtMidnight(date); - this.focusDate(value); - this.$scope.$emit('md-calendar-change', value); - // Using the timezone when the offset is negative (GMT+X) causes the previous day to be - // selected here. This check avoids that. - if (timezone == null || value.getTimezoneOffset() < 0) { - this.ngModelCtrl.$setViewValue(this.ngDateFilter(value, 'yyyy-MM-dd'), 'default'); - } else { - this.ngModelCtrl.$setViewValue(this.ngDateFilter(value, 'yyyy-MM-dd', timezone), 'default'); - } - this.ngModelCtrl.$render(); - return value; - }; - - /** - * Sets the current view that should be visible in the calendar - * @param {string} newView View name to be set. - * @param {number|Date} time Date object or a timestamp for the new display date. - */ - CalendarCtrl.prototype.setCurrentView = function(newView, time) { - var self = this; - - self.$mdUtil.nextTick(function() { - self.currentView = newView; - - if (time) { - self.displayDate = angular.isDate(time) ? time : new Date(time); - } - }); - }; - - /** - * Focus the cell corresponding to the given date. - * @param {Date=} date The date to be focused. - */ - CalendarCtrl.prototype.focusDate = function(date) { - if (this.dateUtil.isValidDate(date)) { - var previousFocus = this.$element[0].querySelector('.' + this.FOCUSED_DATE_CLASS); - if (previousFocus) { - previousFocus.classList.remove(this.FOCUSED_DATE_CLASS); - } - - var cellId = this.getDateId(date, this.currentView); - var cell = document.getElementById(cellId); - if (cell) { - cell.classList.add(this.FOCUSED_DATE_CLASS); - cell.focus(); - this.displayDate = date; - } - } else { - var rootElement = this.$element[0].querySelector('[ng-switch]'); - - if (rootElement) { - rootElement.focus(); - } - } - }; - - /** - * Highlights a date cell on the calendar and changes the selected date. - * @param {Date=} date Date to be marked as selected. - */ - CalendarCtrl.prototype.changeSelectedDate = function(date) { - var selectedDateClass = this.SELECTED_DATE_CLASS; - var prevDateCell = this.$element[0].querySelector('.' + selectedDateClass); - - // Remove the selected class from the previously selected date, if any. - if (prevDateCell) { - prevDateCell.classList.remove(selectedDateClass); - prevDateCell.setAttribute('aria-selected', 'false'); - } - - // Apply the select class to the new selected date if it is set. - if (date) { - var dateCell = document.getElementById(this.getDateId(date, this.currentView)); - if (dateCell) { - dateCell.classList.add(selectedDateClass); - dateCell.setAttribute('aria-selected', 'true'); - } - } - - this.selectedDate = date; - }; - - /** - * Normalizes the key event into an action name. The action will be broadcast - * to the child controllers. - * @param {KeyboardEvent} event - * @returns {string} The action that should be taken, or null if the key - * does not match a calendar shortcut. - */ - CalendarCtrl.prototype.getActionFromKeyEvent = function(event) { - var keyCode = this.keyCode; - - switch (event.which) { - case keyCode.ENTER: return 'select'; - - case keyCode.RIGHT_ARROW: return 'move-right'; - case keyCode.LEFT_ARROW: return 'move-left'; - - case keyCode.DOWN_ARROW: return event.metaKey ? 'move-page-down' : 'move-row-down'; - case keyCode.UP_ARROW: return event.metaKey ? 'move-page-up' : 'move-row-up'; - - case keyCode.PAGE_DOWN: return 'move-page-down'; - case keyCode.PAGE_UP: return 'move-page-up'; - - case keyCode.HOME: return 'start'; - case keyCode.END: return 'end'; - - default: return null; - } - }; - - /** - * Handles a key event in the calendar with the appropriate action. - * The action will either - * - select the focused date - * - navigate to focus a new date - * - emit a md-calendar-close event if in a md-datepicker panel - * - emit a md-calendar-parent-action - * - delegate to normal tab order if the TAB key is pressed in standalone mode - * @param {KeyboardEvent} event - */ - CalendarCtrl.prototype.handleKeyEvent = function(event) { - var self = this; - - this.$scope.$apply(function() { - // Capture escape and emit back up so that a wrapping component - // (such as a date-picker) can decide to close. - if (event.which === self.keyCode.ESCAPE || - (event.which === self.keyCode.TAB && !self.standaloneMode)) { - self.$scope.$emit('md-calendar-close'); - - if (event.which === self.keyCode.TAB) { - event.preventDefault(); - } - - return; - } else if (event.which === self.keyCode.TAB && self.standaloneMode) { - // delegate to the normal tab order if the TAB key is pressed in standalone mode - return; - } - - // Broadcast the action that any child controllers should take. - var action = self.getActionFromKeyEvent(event); - if (action) { - event.preventDefault(); - event.stopPropagation(); - self.$scope.$broadcast('md-calendar-parent-action', action); - } - }); - }; - - /** - * Hides the vertical scrollbar on the calendar scroller of a child controller by - * setting the width on the calendar scroller and the `overflow: hidden` wrapper - * around the scroller, and then setting a padding-right on the scroller equal - * to the width of the browser's scrollbar. - * - * This will cause a reflow. - * - * @param {object} childCtrl The child controller whose scrollbar should be hidden. - */ - CalendarCtrl.prototype.hideVerticalScrollbar = function(childCtrl) { - var self = this; - var element = childCtrl.$element[0]; - var scrollMask = element.querySelector('.md-calendar-scroll-mask'); - - if (self.width > 0) { - setWidth(); - } else { - self.$$rAF(function() { - var scroller = childCtrl.calendarScroller; - - self.scrollbarWidth = scroller.offsetWidth - scroller.clientWidth; - self.width = element.querySelector('table').offsetWidth; - setWidth(); - }); - } - - function setWidth() { - var width = self.width || FALLBACK_WIDTH; - var scrollbarWidth = self.scrollbarWidth; - var scroller = childCtrl.calendarScroller; - - scrollMask.style.width = width + 'px'; - scroller.style.width = (width + scrollbarWidth) + 'px'; - scroller.style.paddingRight = scrollbarWidth + 'px'; - } - }; - - /** - * Gets an identifier for a date unique to the calendar instance for internal - * purposes. Not to be displayed. - * @param {Date} date The date for which the id is being generated - * @param {string} namespace Namespace for the id. (month, year etc.) - * @returns {string} - */ - CalendarCtrl.prototype.getDateId = function(date, namespace) { - if (!namespace) { - throw new Error('A namespace for the date id has to be specified.'); - } - - return [ - 'md', - this.id, - namespace, - date.getFullYear(), - date.getMonth(), - date.getDate() - ].join('-'); - }; - - /** - * Util to trigger an extra digest on a parent scope, in order to to ensure that - * any child virtual repeaters have updated. This is necessary, because the virtual - * repeater doesn't update the $index the first time around since the content isn't - * in place yet. The case, in which this is an issue, is when the repeater has less - * than a page of content (e.g. a month or year view has a min or max date). - */ - CalendarCtrl.prototype.updateVirtualRepeat = function() { - var scope = this.$scope; - var virtualRepeatResizeListener = scope.$on('$md-resize-enable', function() { - if (!scope.$$phase) { - scope.$apply(); - } - - virtualRepeatResizeListener(); - }); - }; -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - CalendarMonthCtrl.$inject = ["$element", "$scope", "$animate", "$q", "$$mdDateUtil", "$mdDateLocale"]; - angular.module('material.components.datepicker') - .directive('mdCalendarMonth', calendarDirective); - - /** - * Height of one calendar month tbody. This must be made known to the virtual-repeat and is - * subsequently used for scrolling to specific months. - */ - var TBODY_HEIGHT = 265; - - /** - * Height of a calendar month with a single row. This is needed to calculate the offset for - * rendering an extra month in virtual-repeat that only contains one row. - */ - var TBODY_SINGLE_ROW_HEIGHT = 45; - - /** Private directive that represents a list of months inside the calendar. */ - function calendarDirective() { - return { - template: - '' + - '
    ' + - '' + - '' + - '' + - - // The ensures that the will always have the - // proper height, even if it's empty. If it's content is - // compiled, the will be overwritten. - '' + - '' + - '
    ' + - '
    ' + - '
    ', - require: ['^^mdCalendar', 'mdCalendarMonth'], - controller: CalendarMonthCtrl, - controllerAs: 'monthCtrl', - bindToController: true, - link: function(scope, element, attrs, controllers) { - var calendarCtrl = controllers[0]; - var monthCtrl = controllers[1]; - monthCtrl.initialize(calendarCtrl); - } - }; - } - - /** - * Controller for the calendar month component. - * @ngInject @constructor - */ - function CalendarMonthCtrl($element, $scope, $animate, $q, - $$mdDateUtil, $mdDateLocale) { - - /** @final {!angular.JQLite} */ - this.$element = $element; - - /** @final {!angular.Scope} */ - this.$scope = $scope; - - /** @final {!angular.$animate} */ - this.$animate = $animate; - - /** @final {!angular.$q} */ - this.$q = $q; - - /** @final */ - this.dateUtil = $$mdDateUtil; - - /** @final */ - this.dateLocale = $mdDateLocale; - - /** @final {HTMLElement} */ - this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller'); - - /** @type {boolean} */ - this.isInitialized = false; - - /** @type {boolean} */ - this.isMonthTransitionInProgress = false; - - var self = this; - - /** - * Handles a click event on a date cell. - * Created here so that every cell can use the same function instance. - * @this {HTMLTableCellElement} The cell that was clicked. - */ - this.cellClickHandler = function() { - var timestamp = $$mdDateUtil.getTimestampFromNode(this); - self.$scope.$apply(function() { - // The timestamp has to be converted to a valid date. - self.calendarCtrl.setNgModelValue(new Date(timestamp)); - }); - }; - - /** - * Handles click events on the month headers. Switches - * the calendar to the year view. - * @this {HTMLTableCellElement} The cell that was clicked. - */ - this.headerClickHandler = function() { - self.calendarCtrl.setCurrentView('year', $$mdDateUtil.getTimestampFromNode(this)); - }; - } - - /** Initialization **/ - - /** - * Initialize the controller by saving a reference to the calendar and - * setting up the object that will be iterated by the virtual repeater. - */ - CalendarMonthCtrl.prototype.initialize = function(calendarCtrl) { - /** - * Dummy array-like object for virtual-repeat to iterate over. The length is the total - * number of months that can be viewed. We add 2 months: one to include the current month - * and one for the last dummy month. - * - * This is shorter than ideal because of a (potential) Firefox bug - * https://bugzilla.mozilla.org/show_bug.cgi?id=1181658. - */ - - this.items = { - length: this.dateUtil.getMonthDistance( - calendarCtrl.firstRenderableDate, - calendarCtrl.lastRenderableDate - ) + 2 - }; - - this.calendarCtrl = calendarCtrl; - this.attachScopeListeners(); - calendarCtrl.updateVirtualRepeat(); - - // Fire the initial render, since we might have missed it the first time it fired. - calendarCtrl.ngModelCtrl && calendarCtrl.ngModelCtrl.$render(); - }; - - /** - * Gets the "index" of the currently selected date as it would be in the virtual-repeat. - * @returns {number} the "index" of the currently selected date - */ - CalendarMonthCtrl.prototype.getSelectedMonthIndex = function() { - var calendarCtrl = this.calendarCtrl; - - return this.dateUtil.getMonthDistance( - calendarCtrl.firstRenderableDate, - calendarCtrl.displayDate || calendarCtrl.selectedDate || calendarCtrl.today - ); - }; - - /** - * Change the date that is being shown in the calendar. If the given date is in a different - * month, the displayed month will be transitioned. - * @param {Date} date - */ - CalendarMonthCtrl.prototype.changeDisplayDate = function(date) { - // Initialization is deferred until this function is called because we want to reflect - // the starting value of ngModel. - if (!this.isInitialized) { - this.buildWeekHeader(); - this.calendarCtrl.hideVerticalScrollbar(this); - this.isInitialized = true; - return this.$q.when(); - } - - // If trying to show an invalid date or a transition is in progress, do nothing. - if (!this.dateUtil.isValidDate(date) || this.isMonthTransitionInProgress) { - return this.$q.when(); - } - - this.isMonthTransitionInProgress = true; - var animationPromise = this.animateDateChange(date); - - this.calendarCtrl.displayDate = date; - - var self = this; - animationPromise.then(function() { - self.isMonthTransitionInProgress = false; - }); - - return animationPromise; - }; - - /** - * Animates the transition from the calendar's current month to the given month. - * @param {Date} date - * @returns {angular.$q.Promise} The animation promise. - */ - CalendarMonthCtrl.prototype.animateDateChange = function(date) { - if (this.dateUtil.isValidDate(date)) { - var monthDistance = this.dateUtil.getMonthDistance(this.calendarCtrl.firstRenderableDate, date); - this.calendarScroller.scrollTop = monthDistance * TBODY_HEIGHT; - } - - return this.$q.when(); - }; - - /** - * Builds and appends a day-of-the-week header to the calendar. - * This should only need to be called once during initialization. - */ - CalendarMonthCtrl.prototype.buildWeekHeader = function() { - var firstDayOfWeek = this.dateLocale.firstDayOfWeek; - var shortDays = this.dateLocale.shortDays; - - var row = document.createElement('tr'); - for (var i = 0; i < 7; i++) { - var th = document.createElement('th'); - th.textContent = shortDays[(i + firstDayOfWeek) % 7]; - row.appendChild(th); - } - - this.$element.find('thead').append(row); - }; - - /** - * Attaches listeners for the scope events that are broadcast by the calendar. - */ - CalendarMonthCtrl.prototype.attachScopeListeners = function() { - var self = this; - - self.$scope.$on('md-calendar-parent-changed', function(event, value) { - self.calendarCtrl.changeSelectedDate(value); - self.changeDisplayDate(value); - }); - - self.$scope.$on('md-calendar-parent-action', angular.bind(this, this.handleKeyEvent)); - }; - - /** - * Handles the month-specific keyboard interactions. - * @param {Object} event Scope event object passed by the calendar. - * @param {String} action Action, corresponding to the key that was pressed. - */ - CalendarMonthCtrl.prototype.handleKeyEvent = function(event, action) { - var calendarCtrl = this.calendarCtrl; - var displayDate = calendarCtrl.displayDate; - - if (action === 'select') { - calendarCtrl.setNgModelValue(displayDate); - } else { - var date = null; - var dateUtil = this.dateUtil; - - switch (action) { - case 'move-right': date = dateUtil.incrementDays(displayDate, 1); break; - case 'move-left': date = dateUtil.incrementDays(displayDate, -1); break; - - case 'move-page-down': date = dateUtil.incrementMonths(displayDate, 1); break; - case 'move-page-up': date = dateUtil.incrementMonths(displayDate, -1); break; - - case 'move-row-down': date = dateUtil.incrementDays(displayDate, 7); break; - case 'move-row-up': date = dateUtil.incrementDays(displayDate, -7); break; - - case 'start': date = dateUtil.getFirstDateOfMonth(displayDate); break; - case 'end': date = dateUtil.getLastDateOfMonth(displayDate); break; - } - - if (date) { - date = this.dateUtil.clampDate(date, calendarCtrl.minDate, calendarCtrl.maxDate); - - this.changeDisplayDate(date).then(function() { - calendarCtrl.focusDate(date); - }); - } - } - }; -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - mdCalendarMonthBodyDirective.$inject = ["$compile", "$$mdSvgRegistry"]; - CalendarMonthBodyCtrl.$inject = ["$element", "$$mdDateUtil", "$mdDateLocale"]; - angular.module('material.components.datepicker') - .directive('mdCalendarMonthBody', mdCalendarMonthBodyDirective); - - /** - * Private directive consumed by md-calendar-month. Having this directive lets the calender use - * md-virtual-repeat and also cleanly separates the month DOM construction functions from - * the rest of the calendar controller logic. - * @ngInject - */ - function mdCalendarMonthBodyDirective($compile, $$mdSvgRegistry) { - var ARROW_ICON = $compile('')({})[0]; - - return { - require: ['^^mdCalendar', '^^mdCalendarMonth', 'mdCalendarMonthBody'], - scope: { offset: '=mdMonthOffset' }, - controller: CalendarMonthBodyCtrl, - controllerAs: 'mdMonthBodyCtrl', - bindToController: true, - link: function(scope, element, attrs, controllers) { - var calendarCtrl = controllers[0]; - var monthCtrl = controllers[1]; - var monthBodyCtrl = controllers[2]; - - monthBodyCtrl.calendarCtrl = calendarCtrl; - monthBodyCtrl.monthCtrl = monthCtrl; - monthBodyCtrl.arrowIcon = ARROW_ICON.cloneNode(true); - - // The virtual-repeat re-uses the same DOM elements, so there are only a limited number - // of repeated items that are linked, and then those elements have their bindings updated. - // Since the months are not generated by bindings, we simply regenerate the entire thing - // when the binding (offset) changes. - scope.$watch(function() { return monthBodyCtrl.offset; }, function(offset) { - if (angular.isNumber(offset)) { - monthBodyCtrl.generateContent(); - } - }); - } - }; - } - - /** - * Controller for a single calendar month. - * @ngInject @constructor - */ - function CalendarMonthBodyCtrl($element, $$mdDateUtil, $mdDateLocale) { - /** - * @final - * @type {!JQLite} - */ - this.$element = $element; - - /** @final */ - this.dateUtil = $$mdDateUtil; - - /** @final */ - this.dateLocale = $mdDateLocale; - - /** @type {Object} Reference to the month view. */ - this.monthCtrl = null; - - /** @type {Object} Reference to the calendar. */ - this.calendarCtrl = null; - - /** - * Number of months from the start of the month "items" that the currently rendered month - * occurs. Set via angular data binding. - * @type {number|null} - */ - this.offset = null; - - /** - * Date cell to focus after appending the month to the document. - * @type {HTMLElement} - */ - this.focusAfterAppend = null; - } - - /** Generate and append the content for this month to the directive element. */ - CalendarMonthBodyCtrl.prototype.generateContent = function() { - var date = this.dateUtil.incrementMonths(this.calendarCtrl.firstRenderableDate, this.offset); - - this.$element - .empty() - .append(this.buildCalendarForMonth(date)); - - if (this.focusAfterAppend) { - this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS); - this.focusAfterAppend = null; - } - }; - - /** - * Creates a single cell to contain a date in the calendar with all appropriate - * attributes and classes added. If a date is given, the cell content will be set - * based on the date. - * @param {Date=} opt_date - * @returns {HTMLElement} - */ - CalendarMonthBodyCtrl.prototype.buildDateCell = function(opt_date) { - var monthCtrl = this.monthCtrl; - var calendarCtrl = this.calendarCtrl; - - // TODO(jelbourn): cloneNode is likely a faster way of doing this. - var cell = document.createElement('td'); - cell.tabIndex = -1; - cell.classList.add('md-calendar-date'); - cell.setAttribute('role', 'gridcell'); - - if (opt_date) { - cell.setAttribute('tabindex', '-1'); - cell.setAttribute('aria-label', this.dateLocale.longDateFormatter(opt_date)); - cell.id = calendarCtrl.getDateId(opt_date, 'month'); - - // Use `data-timestamp` attribute because IE10 does not support the `dataset` property. - cell.setAttribute('data-timestamp', opt_date.getTime()); - - // TODO(jelourn): Doing these comparisons for class addition during generation might be slow. - // It may be better to finish the construction and then query the node and add the class. - if (this.dateUtil.isSameDay(opt_date, calendarCtrl.today)) { - cell.classList.add(calendarCtrl.TODAY_CLASS); - } - - if (this.dateUtil.isValidDate(calendarCtrl.selectedDate) && - this.dateUtil.isSameDay(opt_date, calendarCtrl.selectedDate)) { - cell.classList.add(calendarCtrl.SELECTED_DATE_CLASS); - cell.setAttribute('aria-selected', 'true'); - } - - var cellText = this.dateLocale.dates[opt_date.getDate()]; - - if (this.isDateEnabled(opt_date)) { - // Add a indicator for select, hover, and focus states. - var selectionIndicator = document.createElement('span'); - selectionIndicator.classList.add('md-calendar-date-selection-indicator'); - selectionIndicator.textContent = cellText; - cell.appendChild(selectionIndicator); - cell.addEventListener('click', monthCtrl.cellClickHandler); - - if (calendarCtrl.displayDate && this.dateUtil.isSameDay(opt_date, calendarCtrl.displayDate)) { - this.focusAfterAppend = cell; - } - } else { - cell.classList.add('md-calendar-date-disabled'); - cell.textContent = cellText; - } - } - - return cell; - }; - - /** - * Check whether date is in range and enabled - * @param {Date=} opt_date - * @return {boolean} Whether the date is enabled. - */ - CalendarMonthBodyCtrl.prototype.isDateEnabled = function(opt_date) { - return this.dateUtil.isDateWithinRange(opt_date, - this.calendarCtrl.minDate, this.calendarCtrl.maxDate) && - (!angular.isFunction(this.calendarCtrl.dateFilter) - || this.calendarCtrl.dateFilter(opt_date)); - }; - - /** - * Builds a `tr` element for the calendar grid. - * @param rowNumber The week number within the month. - * @returns {HTMLElement} - */ - CalendarMonthBodyCtrl.prototype.buildDateRow = function(rowNumber) { - var row = document.createElement('tr'); - row.setAttribute('role', 'row'); - - // Because of an NVDA bug (with Firefox), the row needs an aria-label in order - // to prevent the entire row being read aloud when the user moves between rows. - // See http://community.nvda-project.org/ticket/4643. - row.setAttribute('aria-label', this.dateLocale.weekNumberFormatter(rowNumber)); - - return row; - }; - - /** - * Builds the content for the given date's month. - * @param {Date=} opt_dateInMonth - * @returns {DocumentFragment} A document fragment containing the elements. - */ - CalendarMonthBodyCtrl.prototype.buildCalendarForMonth = function(opt_dateInMonth) { - var date = this.dateUtil.isValidDate(opt_dateInMonth) ? opt_dateInMonth : new Date(); - - var firstDayOfMonth = this.dateUtil.getFirstDateOfMonth(date); - var firstDayOfTheWeek = this.getLocaleDay_(firstDayOfMonth); - var numberOfDaysInMonth = this.dateUtil.getNumberOfDaysInMonth(date); - - // Store rows for the month in a document fragment so that we can append them all at once. - var monthBody = document.createDocumentFragment(); - - var rowNumber = 1; - var row = this.buildDateRow(rowNumber); - monthBody.appendChild(row); - - // If this is the final month in the list of items, only the first week should render, - // so we should return immediately after the first row is complete and has been - // attached to the body. - var isFinalMonth = this.offset === this.monthCtrl.items.length - 1; - - // Add a label for the month. If the month starts on a Sun/Mon/Tues, the month label - // goes on a row above the first of the month. Otherwise, the month label takes up the first - // two cells of the first row. - var blankCellOffset = 0; - var monthLabelCell = document.createElement('td'); - var monthLabelCellContent = document.createElement('span'); - var calendarCtrl = this.calendarCtrl; - - monthLabelCellContent.textContent = this.dateLocale.monthHeaderFormatter(date); - monthLabelCell.appendChild(monthLabelCellContent); - monthLabelCell.classList.add('md-calendar-month-label'); - // If the entire month is after the max date, render the label as a disabled state. - if (calendarCtrl.maxDate && firstDayOfMonth > calendarCtrl.maxDate) { - monthLabelCell.classList.add('md-calendar-month-label-disabled'); - // If the user isn't supposed to be able to change views, render the - // label as usual, but disable the clicking functionality. - } else if (!calendarCtrl.mode) { - monthLabelCell.addEventListener('click', this.monthCtrl.headerClickHandler); - monthLabelCell.setAttribute('data-timestamp', firstDayOfMonth.getTime()); - monthLabelCell.setAttribute('aria-label', this.dateLocale.monthFormatter(date)); - monthLabelCell.classList.add('md-calendar-label-clickable'); - monthLabelCell.appendChild(this.arrowIcon.cloneNode(true)); - } - - if (firstDayOfTheWeek <= 2) { - monthLabelCell.setAttribute('colspan', '7'); - - var monthLabelRow = this.buildDateRow(); - monthLabelRow.appendChild(monthLabelCell); - monthBody.insertBefore(monthLabelRow, row); - - if (isFinalMonth) { - return monthBody; - } - } else { - blankCellOffset = 3; - monthLabelCell.setAttribute('colspan', '3'); - row.appendChild(monthLabelCell); - } - - // Add a blank cell for each day of the week that occurs before the first of the month. - // For example, if the first day of the month is a Tuesday, add blank cells for Sun and Mon. - // The blankCellOffset is needed in cases where the first N cells are used by the month label. - for (var i = blankCellOffset; i < firstDayOfTheWeek; i++) { - row.appendChild(this.buildDateCell()); - } - - // Add a cell for each day of the month, keeping track of the day of the week so that - // we know when to start a new row. - var dayOfWeek = firstDayOfTheWeek; - var iterationDate = firstDayOfMonth; - for (var d = 1; d <= numberOfDaysInMonth; d++) { - // If we've reached the end of the week, start a new row. - if (dayOfWeek === 7) { - // We've finished the first row, so we're done if this is the final month. - if (isFinalMonth) { - return monthBody; - } - dayOfWeek = 0; - rowNumber++; - row = this.buildDateRow(rowNumber); - monthBody.appendChild(row); - } - - iterationDate.setDate(d); - var cell = this.buildDateCell(iterationDate); - row.appendChild(cell); - - dayOfWeek++; - } - - // Ensure that the last row of the month has 7 cells. - while (row.childNodes.length < 7) { - row.appendChild(this.buildDateCell()); - } - - // Ensure that all months have 6 rows. This is necessary for now because the virtual-repeat - // requires that all items have exactly the same height. - while (monthBody.childNodes.length < 6) { - var whitespaceRow = this.buildDateRow(); - for (var j = 0; j < 7; j++) { - whitespaceRow.appendChild(this.buildDateCell()); - } - monthBody.appendChild(whitespaceRow); - } - - return monthBody; - }; - - /** - * Gets the day-of-the-week index for a date for the current locale. - * @private - * @param {Date} date - * @returns {number} The column index of the date in the calendar. - */ - CalendarMonthBodyCtrl.prototype.getLocaleDay_ = function(date) { - return (date.getDay() + (7 - this.dateLocale.firstDayOfWeek)) % 7; - }; -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - CalendarYearCtrl.$inject = ["$element", "$scope", "$animate", "$q", "$$mdDateUtil", "$mdUtil"]; - angular.module('material.components.datepicker') - .directive('mdCalendarYear', calendarDirective); - - /** - * Height of one calendar year tbody. This must be made known to the virtual-repeat and is - * subsequently used for scrolling to specific years. - */ - var TBODY_HEIGHT = 88; - - /** Private component, representing a list of years in the calendar. */ - function calendarDirective() { - return { - template: - '
    ' + - '' + - '' + - '' + - // The ensures that the will have the proper - // height, even though it may be empty. - '' + - '' + - '
    ' + - '
    ' + - '
    ', - require: ['^^mdCalendar', 'mdCalendarYear'], - controller: CalendarYearCtrl, - controllerAs: 'yearCtrl', - bindToController: true, - link: function(scope, element, attrs, controllers) { - var calendarCtrl = controllers[0]; - var yearCtrl = controllers[1]; - yearCtrl.initialize(calendarCtrl); - } - }; - } - - /** - * Controller for the mdCalendar component. - * @ngInject @constructor - */ - function CalendarYearCtrl($element, $scope, $animate, $q, $$mdDateUtil, $mdUtil) { - - /** @final {!angular.JQLite} */ - this.$element = $element; - - /** @final {!angular.Scope} */ - this.$scope = $scope; - - /** @final {!angular.$animate} */ - this.$animate = $animate; - - /** @final {!angular.$q} */ - this.$q = $q; - - /** @final */ - this.dateUtil = $$mdDateUtil; - - /** @final {HTMLElement} */ - this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller'); - - /** @type {boolean} */ - this.isInitialized = false; - - /** @type {boolean} */ - this.isMonthTransitionInProgress = false; - - /** @final */ - this.$mdUtil = $mdUtil; - - var self = this; - - /** - * Handles a click event on a date cell. - * Created here so that every cell can use the same function instance. - * @this {HTMLTableCellElement} The cell that was clicked. - */ - this.cellClickHandler = function() { - self.onTimestampSelected($$mdDateUtil.getTimestampFromNode(this)); - }; - } - - /** - * Initialize the controller by saving a reference to the calendar and - * setting up the object that will be iterated by the virtual repeater. - */ - CalendarYearCtrl.prototype.initialize = function(calendarCtrl) { - /** - * Dummy array-like object for virtual-repeat to iterate over. The length is the total - * number of years that can be viewed. We add 1 extra in order to include the current year. - */ - - this.items = { - length: this.dateUtil.getYearDistance( - calendarCtrl.firstRenderableDate, - calendarCtrl.lastRenderableDate - ) + 1 - }; - - this.calendarCtrl = calendarCtrl; - this.attachScopeListeners(); - calendarCtrl.updateVirtualRepeat(); - - // Fire the initial render, since we might have missed it the first time it fired. - calendarCtrl.ngModelCtrl && calendarCtrl.ngModelCtrl.$render(); - }; - - /** - * Gets the "index" of the currently selected date as it would be in the virtual-repeat. - * @returns {number} - */ - CalendarYearCtrl.prototype.getFocusedYearIndex = function() { - var calendarCtrl = this.calendarCtrl; - - return this.dateUtil.getYearDistance( - calendarCtrl.firstRenderableDate, - calendarCtrl.displayDate || calendarCtrl.selectedDate || calendarCtrl.today - ); - }; - - /** - * Change the date that is highlighted in the calendar. - * @param {Date} date - */ - CalendarYearCtrl.prototype.changeDate = function(date) { - // Initialization is deferred until this function is called because we want to reflect - // the starting value of ngModel. - if (!this.isInitialized) { - this.calendarCtrl.hideVerticalScrollbar(this); - this.isInitialized = true; - return this.$q.when(); - } else if (this.dateUtil.isValidDate(date) && !this.isMonthTransitionInProgress) { - var self = this; - var animationPromise = this.animateDateChange(date); - - self.isMonthTransitionInProgress = true; - self.calendarCtrl.displayDate = date; - - return animationPromise.then(function() { - self.isMonthTransitionInProgress = false; - }); - } - }; - - /** - * Animates the transition from the calendar's current month to the given month. - * @param {Date} date - * @returns {angular.$q.Promise} The animation promise. - */ - CalendarYearCtrl.prototype.animateDateChange = function(date) { - if (this.dateUtil.isValidDate(date)) { - var monthDistance = this.dateUtil.getYearDistance(this.calendarCtrl.firstRenderableDate, date); - this.calendarScroller.scrollTop = monthDistance * TBODY_HEIGHT; - } - - return this.$q.when(); - }; - - /** - * Handles the year-view-specific keyboard interactions. - * @param {Object} event Scope event object passed by the calendar. - * @param {String} action Action, corresponding to the key that was pressed. - */ - CalendarYearCtrl.prototype.handleKeyEvent = function(event, action) { - var self = this; - var calendarCtrl = self.calendarCtrl; - var displayDate = calendarCtrl.displayDate; - - if (action === 'select') { - self.changeDate(displayDate).then(function() { - self.onTimestampSelected(displayDate); - }); - } else { - var date = null; - var dateUtil = self.dateUtil; - - switch (action) { - case 'move-right': date = dateUtil.incrementMonths(displayDate, 1); break; - case 'move-left': date = dateUtil.incrementMonths(displayDate, -1); break; - - case 'move-row-down': date = dateUtil.incrementMonths(displayDate, 6); break; - case 'move-row-up': date = dateUtil.incrementMonths(displayDate, -6); break; - } - - if (date) { - var min = calendarCtrl.minDate ? dateUtil.getFirstDateOfMonth(calendarCtrl.minDate) : null; - var max = calendarCtrl.maxDate ? dateUtil.getFirstDateOfMonth(calendarCtrl.maxDate) : null; - date = dateUtil.getFirstDateOfMonth(self.dateUtil.clampDate(date, min, max)); - - self.changeDate(date).then(function() { - calendarCtrl.focusDate(date); - }); - } - } - }; - - /** - * Attaches listeners for the scope events that are broadcast by the calendar. - */ - CalendarYearCtrl.prototype.attachScopeListeners = function() { - var self = this; - - self.$scope.$on('md-calendar-parent-changed', function(event, value) { - self.calendarCtrl.changeSelectedDate(value ? self.dateUtil.getFirstDateOfMonth(value) : value); - self.changeDate(value); - }); - - self.$scope.$on('md-calendar-parent-action', angular.bind(self, self.handleKeyEvent)); - }; - - /** - * Handles the behavior when a date is selected. Depending on the `mode` - * of the calendar, this can either switch back to the calendar view or - * set the model value. - * @param {number} timestamp The selected timestamp. - */ - CalendarYearCtrl.prototype.onTimestampSelected = function(timestamp) { - var calendarCtrl = this.calendarCtrl; - - if (calendarCtrl.mode) { - this.$mdUtil.nextTick(function() { - // The timestamp has to be converted to a valid date. - calendarCtrl.setNgModelValue(new Date(timestamp)); - }); - } else { - calendarCtrl.setCurrentView('month', timestamp); - } - }; -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - CalendarYearBodyCtrl.$inject = ["$element", "$$mdDateUtil", "$mdDateLocale"]; - angular.module('material.components.datepicker') - .directive('mdCalendarYearBody', mdCalendarYearDirective); - - /** - * Private component, consumed by the md-calendar-year, which separates the DOM construction logic - * and allows for the year view to use md-virtual-repeat. - */ - function mdCalendarYearDirective() { - return { - require: ['^^mdCalendar', '^^mdCalendarYear', 'mdCalendarYearBody'], - scope: { offset: '=mdYearOffset' }, - controller: CalendarYearBodyCtrl, - controllerAs: 'mdYearBodyCtrl', - bindToController: true, - link: function(scope, element, attrs, controllers) { - var calendarCtrl = controllers[0]; - var yearCtrl = controllers[1]; - var yearBodyCtrl = controllers[2]; - - yearBodyCtrl.calendarCtrl = calendarCtrl; - yearBodyCtrl.yearCtrl = yearCtrl; - - scope.$watch(function() { return yearBodyCtrl.offset; }, function(offset) { - if (angular.isNumber(offset)) { - yearBodyCtrl.generateContent(); - } - }); - } - }; - } - - /** - * Controller for a single year. - * @ngInject @constructor - */ - function CalendarYearBodyCtrl($element, $$mdDateUtil, $mdDateLocale) { - /** - * @final - * @type {!JQLite} - */ - this.$element = $element; - - /** @final */ - this.dateUtil = $$mdDateUtil; - - /** @final */ - this.dateLocale = $mdDateLocale; - - /** @type {Object} Reference to the calendar. */ - this.calendarCtrl = null; - - /** @type {Object} Reference to the year view. */ - this.yearCtrl = null; - - /** - * Number of months from the start of the month "items" that the currently rendered month - * occurs. Set via angular data binding. - * @type {number|null} - */ - this.offset = null; - - /** - * Date cell to focus after appending the month to the document. - * @type {HTMLElement} - */ - this.focusAfterAppend = null; - } - - /** Generate and append the content for this year to the directive element. */ - CalendarYearBodyCtrl.prototype.generateContent = function() { - var date = this.dateUtil.incrementYears(this.calendarCtrl.firstRenderableDate, this.offset); - - this.$element - .empty() - .append(this.buildCalendarForYear(date)); - - if (this.focusAfterAppend) { - this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS); - this.focusAfterAppend = null; - } - }; - - /** - * Creates a single cell to contain a year in the calendar. - * @param {number} year Four-digit year. - * @param {number} month Zero-indexed month. - * @returns {HTMLElement} - */ - CalendarYearBodyCtrl.prototype.buildMonthCell = function(year, month) { - var calendarCtrl = this.calendarCtrl; - var yearCtrl = this.yearCtrl; - var cell = this.buildBlankCell(); - - // Represent this month/year as a date. - var firstOfMonth = new Date(year, month, 1); - cell.setAttribute('aria-label', this.dateLocale.monthFormatter(firstOfMonth)); - cell.id = calendarCtrl.getDateId(firstOfMonth, 'year'); - - // Use `data-timestamp` attribute because IE10 does not support the `dataset` property. - cell.setAttribute('data-timestamp', String(firstOfMonth.getTime())); - - if (this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.today)) { - cell.classList.add(calendarCtrl.TODAY_CLASS); - } - - if (this.dateUtil.isValidDate(calendarCtrl.selectedDate) && - this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.selectedDate)) { - cell.classList.add(calendarCtrl.SELECTED_DATE_CLASS); - cell.setAttribute('aria-selected', 'true'); - } - - var cellText = this.dateLocale.shortMonths[month]; - - if (this.dateUtil.isMonthWithinRange( - firstOfMonth, calendarCtrl.minDate, calendarCtrl.maxDate) && - (!angular.isFunction(calendarCtrl.monthFilter) || - calendarCtrl.monthFilter(firstOfMonth))) { - var selectionIndicator = document.createElement('span'); - selectionIndicator.classList.add('md-calendar-date-selection-indicator'); - selectionIndicator.textContent = cellText; - cell.appendChild(selectionIndicator); - cell.addEventListener('click', yearCtrl.cellClickHandler); - - if (calendarCtrl.displayDate && - this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.displayDate)) { - this.focusAfterAppend = cell; - } - } else { - cell.classList.add('md-calendar-date-disabled'); - cell.textContent = cellText; - } - - return cell; - }; - - /** - * Builds a blank cell. - * @return {HTMLElement} - */ - CalendarYearBodyCtrl.prototype.buildBlankCell = function() { - var cell = document.createElement('td'); - cell.tabIndex = -1; - cell.classList.add('md-calendar-date'); - cell.setAttribute('role', 'gridcell'); - - cell.setAttribute('tabindex', '-1'); - return cell; - }; - - /** - * Builds the content for the given year. - * @param {Date} date Date for which the content should be built. - * @returns {DocumentFragment} A document fragment containing the months within the year. - */ - CalendarYearBodyCtrl.prototype.buildCalendarForYear = function(date) { - // Store rows for the month in a document fragment so that we can append them all at once. - var year = date.getFullYear(); - var yearBody = document.createDocumentFragment(); - - var monthCell, i; - // First row contains label and Jan-Jun. - var firstRow = document.createElement('tr'); - var labelCell = document.createElement('td'); - labelCell.className = 'md-calendar-month-label'; - labelCell.textContent = String(year); - firstRow.appendChild(labelCell); - - for (i = 0; i < 6; i++) { - firstRow.appendChild(this.buildMonthCell(year, i)); - } - yearBody.appendChild(firstRow); - - // Second row contains a blank cell and Jul-Dec. - var secondRow = document.createElement('tr'); - secondRow.appendChild(this.buildBlankCell()); - for (i = 6; i < 12; i++) { - secondRow.appendChild(this.buildMonthCell(year, i)); - } - yearBody.appendChild(secondRow); - - return yearBody; - }; -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * @ngdoc service - * @name $mdDateLocaleProvider - * @module material.components.datepicker - * - * @description - * The `$mdDateLocaleProvider` is the provider that creates the `$mdDateLocale` service. - * This provider that allows the user to specify messages, formatters, and parsers for date - * internationalization. The `$mdDateLocale` service itself is consumed by AngularJS Material - * components that deal with dates - * (i.e. mdDatepicker). - * - * @property {Array} months Array of month names (in order). - * @property {Array} shortMonths Array of abbreviated month names. - * @property {Array} days Array of the days of the week (in order). - * @property {Array} shortDays Array of abbreviated days of the week. - * @property {Array} dates Array of dates of the month. Only necessary for locales - * using a numeral system other than [1, 2, 3...]. - * @property {Array} firstDayOfWeek The first day of the week. Sunday = 0, Monday = 1, - * etc. - * @property {function(string): Date} parseDate Function that converts a date string to a Date - * object (the date portion). - * @property {function(Date, string): string} formatDate Function to format a date object to a - * string. The datepicker directive also provides the time zone, if it was specified. - * @property {function(Date): string} monthHeaderFormatter Function that returns the label for - * a month given a date. - * @property {function(Date): string} monthFormatter Function that returns the full name of a month - * for a given date. - * @property {function(number): string} weekNumberFormatter Function that returns a label for - * a week given the week number. - * @property {function(Date): string} longDateFormatter Function that formats a date into a long - * `aria-label` that is read by the screen reader when the focused date changes. - * @property {string} msgCalendar Translation of the label "Calendar" for the current locale. - * @property {string} msgOpenCalendar Translation of the button label "Open calendar" for the - * current locale. - * @property {Date} firstRenderableDate The date from which the datepicker calendar will begin - * rendering. Note that this will be ignored if a minimum date is set. - * Defaults to January 1st 1880. - * @property {Date} lastRenderableDate The last date that will be rendered by the datepicker - * calendar. Note that this will be ignored if a maximum date is set. - * Defaults to January 1st 2130. - * @property {function(string): boolean} isDateComplete Function to determine whether a string - * makes sense to be parsed to a `Date` object. Returns `true` if the date appears to be complete - * and parsing should occur. By default, this checks for 3 groups of text or numbers separated - * by delimiters. This means that by default, date strings must include a month, day, and year - * to be parsed and for the model to be updated. - * - * @usage - * - * myAppModule.config(function($mdDateLocaleProvider) { - * - * // Example of a French localization. - * $mdDateLocaleProvider.months = ['janvier', 'février', 'mars', ...]; - * $mdDateLocaleProvider.shortMonths = ['janv', 'févr', 'mars', ...]; - * $mdDateLocaleProvider.days = ['dimanche', 'lundi', 'mardi', ...]; - * $mdDateLocaleProvider.shortDays = ['Di', 'Lu', 'Ma', ...]; - * - * // Can change week display to start on Monday. - * $mdDateLocaleProvider.firstDayOfWeek = 1; - * - * // Optional. - * $mdDateLocaleProvider.dates = [1, 2, 3, 4, 5, 6, ...]; - * - * // Example uses moment.js to parse and format dates. - * $mdDateLocaleProvider.parseDate = function(dateString) { - * var m = moment(dateString, 'L', true); - * return m.isValid() ? m.toDate() : new Date(NaN); - * }; - * - * $mdDateLocaleProvider.formatDate = function(date) { - * var m = moment(date); - * return m.isValid() ? m.format('L') : ''; - * }; - * - * // Allow only a day and month to be specified. - * // This is required if using the 'M/D' format with moment.js. - * $mdDateLocaleProvider.isDateComplete = function(dateString) { - * dateString = dateString.trim(); - * - * // Look for two chunks of content (either numbers or text) separated by delimiters. - * var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-]))([a-zA-Z]{3,}|[0-9]{1,4})/; - * return re.test(dateString); - * }; - * - * $mdDateLocaleProvider.monthHeaderFormatter = function(date) { - * return myShortMonths[date.getMonth()] + ' ' + date.getFullYear(); - * }; - * - * // In addition to date display, date components also need localized messages - * // for aria-labels for screen-reader users. - * - * $mdDateLocaleProvider.weekNumberFormatter = function(weekNumber) { - * return 'Semaine ' + weekNumber; - * }; - * - * $mdDateLocaleProvider.msgCalendar = 'Calendrier'; - * $mdDateLocaleProvider.msgOpenCalendar = 'Ouvrir le calendrier'; - * - * // You can also set when your calendar begins and ends. - * $mdDateLocaleProvider.firstRenderableDate = new Date(1776, 6, 4); - * $mdDateLocaleProvider.lastRenderableDate = new Date(2012, 11, 21); - * }); - * - * - */ - angular.module('material.components.datepicker').config(["$provide", function($provide) { - // TODO(jelbourn): Assert provided values are correctly formatted. Need assertions. - - /** @constructor */ - function DateLocaleProvider() { - /** Array of full month names. E.g., ['January', 'February', ...] */ - this.months = null; - - /** Array of abbreviated month names. E.g., ['Jan', 'Feb', ...] */ - this.shortMonths = null; - - /** Array of full day of the week names. E.g., ['Monday', 'Tuesday', ...] */ - this.days = null; - - /** Array of abbreviated dat of the week names. E.g., ['M', 'T', ...] */ - this.shortDays = null; - - /** Array of dates of a month (1 - 31). Characters might be different in some locales. */ - this.dates = null; - - /** Index of the first day of the week. 0 = Sunday, 1 = Monday, etc. */ - this.firstDayOfWeek = 0; - - /** - * Function that converts the date portion of a Date to a string. - * @type {(function(Date): string)} - */ - this.formatDate = null; - - /** - * Function that converts a date string to a Date object (the date portion) - * @type {function(string): Date} - */ - this.parseDate = null; - - /** - * Function that formats a Date into a month header string. - * @type {function(Date): string} - */ - this.monthHeaderFormatter = null; - - /** - * Function that formats a week number into a label for the week. - * @type {function(number): string} - */ - this.weekNumberFormatter = null; - - /** - * Function that formats a date into a long aria-label that is read - * when the focused date changes. - * @type {function(Date): string} - */ - this.longDateFormatter = null; - - /** - * Function to determine whether a string makes sense to be - * parsed to a Date object. - * @type {function(string): boolean} - */ - this.isDateComplete = null; - - /** - * ARIA label for the calendar "dialog" used in the datepicker. - * @type {string} - */ - this.msgCalendar = ''; - - /** - * ARIA label for the datepicker's "Open calendar" buttons. - * @type {string} - */ - this.msgOpenCalendar = ''; - } - - /** - * Factory function that returns an instance of the dateLocale service. - * @ngInject - * @param $locale - * @param $filter - * @returns {DateLocale} - */ - DateLocaleProvider.prototype.$get = function($locale, $filter) { - /** - * Default date-to-string formatting function. - * @param {!Date} date - * @param {string=} timezone - * @returns {string} - */ - function defaultFormatDate(date, timezone) { - if (!date) { - return ''; - } - - // All of the dates created through ng-material *should* be set to midnight. - // If we encounter a date where the localeTime shows at 11pm instead of midnight, - // we have run into an issue with DST where we need to increment the hour by one: - // var d = new Date(1992, 9, 8, 0, 0, 0); - // d.toLocaleString(); // == "10/7/1992, 11:00:00 PM" - var localeTime = date.toLocaleTimeString(); - var formatDate = date; - if (date.getHours() === 0 && - (localeTime.indexOf('11:') !== -1 || localeTime.indexOf('23:') !== -1)) { - formatDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 0, 0); - } - - return $filter('date')(formatDate, 'M/d/yyyy', timezone); - } - - /** - * Default string-to-date parsing function. - * @param {string|number} dateString - * @returns {!Date} - */ - function defaultParseDate(dateString) { - return new Date(dateString); - } - - /** - * Default function to determine whether a string makes sense to be - * parsed to a Date object. - * - * This is very permissive and is just a basic check to ensure that - * things like single integers aren't able to be parsed into dates. - * @param {string} dateString - * @returns {boolean} - */ - function defaultIsDateComplete(dateString) { - dateString = dateString.trim(); - - // Looks for three chunks of content (either numbers or text) separated - // by delimiters. - var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-])){2}([a-zA-Z]{3,}|[0-9]{1,4})$/; - return re.test(dateString); - } - - /** - * Default date-to-string formatter to get a month header. - * @param {!Date} date - * @returns {string} - */ - function defaultMonthHeaderFormatter(date) { - return service.shortMonths[date.getMonth()] + ' ' + date.getFullYear(); - } - - /** - * Default formatter for a month. - * @param {!Date} date - * @returns {string} - */ - function defaultMonthFormatter(date) { - return service.months[date.getMonth()] + ' ' + date.getFullYear(); - } - - /** - * Default week number formatter. - * @param number - * @returns {string} - */ - function defaultWeekNumberFormatter(number) { - return 'Week ' + number; - } - - /** - * Default formatter for date cell aria-labels. - * @param {!Date} date - * @returns {string} - */ - function defaultLongDateFormatter(date) { - // Example: 'Thursday June 18 2015' - return [ - service.days[date.getDay()], - service.months[date.getMonth()], - service.dates[date.getDate()], - date.getFullYear() - ].join(' '); - } - - // The default "short" day strings are the first character of each day, - // e.g., "Monday" => "M". - var defaultShortDays = $locale.DATETIME_FORMATS.SHORTDAY.map(function(day) { - return day.substring(0, 1); - }); - - // The default dates are simply the numbers 1 through 31. - var defaultDates = Array(32); - for (var i = 1; i <= 31; i++) { - defaultDates[i] = i; - } - - // Default ARIA messages are in English (US). - var defaultMsgCalendar = 'Calendar'; - var defaultMsgOpenCalendar = 'Open calendar'; - - // Default start/end dates that are rendered in the calendar. - var defaultFirstRenderableDate = new Date(1880, 0, 1); - var defaultLastRendereableDate = new Date(defaultFirstRenderableDate.getFullYear() + 250, 0, 1); - - var service = { - months: this.months || $locale.DATETIME_FORMATS.MONTH, - shortMonths: this.shortMonths || $locale.DATETIME_FORMATS.SHORTMONTH, - days: this.days || $locale.DATETIME_FORMATS.DAY, - shortDays: this.shortDays || defaultShortDays, - dates: this.dates || defaultDates, - firstDayOfWeek: this.firstDayOfWeek || 0, - formatDate: this.formatDate || defaultFormatDate, - parseDate: this.parseDate || defaultParseDate, - isDateComplete: this.isDateComplete || defaultIsDateComplete, - monthHeaderFormatter: this.monthHeaderFormatter || defaultMonthHeaderFormatter, - monthFormatter: this.monthFormatter || defaultMonthFormatter, - weekNumberFormatter: this.weekNumberFormatter || defaultWeekNumberFormatter, - longDateFormatter: this.longDateFormatter || defaultLongDateFormatter, - msgCalendar: this.msgCalendar || defaultMsgCalendar, - msgOpenCalendar: this.msgOpenCalendar || defaultMsgOpenCalendar, - firstRenderableDate: this.firstRenderableDate || defaultFirstRenderableDate, - lastRenderableDate: this.lastRenderableDate || defaultLastRendereableDate - }; - - return service; - }; - DateLocaleProvider.prototype.$get.$inject = ["$locale", "$filter"]; - - $provide.provider('$mdDateLocale', new DateLocaleProvider()); - }]); -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - /** - * Utility for performing date calculations to facilitate operation of the calendar and - * datepicker. - */ - angular.module('material.components.datepicker').factory('$$mdDateUtil', ["$mdDateLocale", function($mdDateLocale) { - return { - getFirstDateOfMonth: getFirstDateOfMonth, - getNumberOfDaysInMonth: getNumberOfDaysInMonth, - getDateInNextMonth: getDateInNextMonth, - getDateInPreviousMonth: getDateInPreviousMonth, - isInNextMonth: isInNextMonth, - isInPreviousMonth: isInPreviousMonth, - getDateMidpoint: getDateMidpoint, - isSameMonthAndYear: isSameMonthAndYear, - getWeekOfMonth: getWeekOfMonth, - incrementDays: incrementDays, - incrementMonths: incrementMonths, - getLastDateOfMonth: getLastDateOfMonth, - isSameDay: isSameDay, - getMonthDistance: getMonthDistance, - isValidDate: isValidDate, - setDateTimeToMidnight: setDateTimeToMidnight, - createDateAtMidnight: createDateAtMidnight, - isDateWithinRange: isDateWithinRange, - incrementYears: incrementYears, - getYearDistance: getYearDistance, - clampDate: clampDate, - getTimestampFromNode: getTimestampFromNode, - isMonthWithinRange: isMonthWithinRange, - removeLocalTzAndReparseDate: removeLocalTzAndReparseDate - }; - - /** - * Gets the first day of the month for the given date's month. - * @param {Date} date - * @returns {Date} - */ - function getFirstDateOfMonth(date) { - return new Date(date.getFullYear(), date.getMonth(), 1); - } - - /** - * Gets the number of days in the month for the given date's month. - * @param date - * @returns {number} - */ - function getNumberOfDaysInMonth(date) { - return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(); - } - - /** - * Get an arbitrary date in the month after the given date's month. - * @param date - * @returns {Date} - */ - function getDateInNextMonth(date) { - return new Date(date.getFullYear(), date.getMonth() + 1, 1); - } - - /** - * Get an arbitrary date in the month before the given date's month. - * @param date - * @returns {Date} - */ - function getDateInPreviousMonth(date) { - return new Date(date.getFullYear(), date.getMonth() - 1, 1); - } - - /** - * Gets whether two dates have the same month and year. - * @param {Date} d1 - * @param {Date} d2 - * @returns {boolean} - */ - function isSameMonthAndYear(d1, d2) { - return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth(); - } - - /** - * Gets whether two dates are the same day (not not necessarily the same time). - * @param {Date} d1 - * @param {Date} d2 - * @returns {boolean} - */ - function isSameDay(d1, d2) { - return d1.getDate() == d2.getDate() && isSameMonthAndYear(d1, d2); - } - - /** - * Gets whether a date is in the month immediately after some date. - * @param {Date} startDate The date from which to compare. - * @param {Date} endDate The date to check. - * @returns {boolean} - */ - function isInNextMonth(startDate, endDate) { - var nextMonth = getDateInNextMonth(startDate); - return isSameMonthAndYear(nextMonth, endDate); - } - - /** - * Gets whether a date is in the month immediately before some date. - * @param {Date} startDate The date from which to compare. - * @param {Date} endDate The date to check. - * @returns {boolean} - */ - function isInPreviousMonth(startDate, endDate) { - var previousMonth = getDateInPreviousMonth(startDate); - return isSameMonthAndYear(endDate, previousMonth); - } - - /** - * Gets the midpoint between two dates. - * @param {Date} d1 - * @param {Date} d2 - * @returns {Date} - */ - function getDateMidpoint(d1, d2) { - return createDateAtMidnight((d1.getTime() + d2.getTime()) / 2); - } - - /** - * Gets the week of the month that a given date occurs in. - * @param {Date} date - * @returns {number} Index of the week of the month (zero-based). - */ - function getWeekOfMonth(date) { - var firstDayOfMonth = getFirstDateOfMonth(date); - return Math.floor((firstDayOfMonth.getDay() + date.getDate() - 1) / 7); - } - - /** - * Gets a new date incremented by the given number of days. Number of days can be negative. - * @param {Date} date - * @param {number} numberOfDays - * @returns {Date} - */ - function incrementDays(date, numberOfDays) { - return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays); - } - - /** - * Gets a new date incremented by the given number of months. Number of months can be negative. - * If the date of the given month does not match the target month, the date will be set to the - * last day of the month. - * @param {Date} date - * @param {number} numberOfMonths - * @returns {Date} - */ - function incrementMonths(date, numberOfMonths) { - // If the same date in the target month does not actually exist, the Date object will - // automatically advance *another* month by the number of missing days. - // For example, if you try to go from Jan. 30 to Feb. 30, you'll end up on March 2. - // So, we check if the month overflowed and go to the last day of the target month instead. - var dateInTargetMonth = new Date(date.getFullYear(), date.getMonth() + numberOfMonths, 1); - var numberOfDaysInMonth = getNumberOfDaysInMonth(dateInTargetMonth); - if (numberOfDaysInMonth < date.getDate()) { - dateInTargetMonth.setDate(numberOfDaysInMonth); - } else { - dateInTargetMonth.setDate(date.getDate()); - } - - return dateInTargetMonth; - } - - /** - * Get the integer distance between two months. This *only* considers the month and year - * portion of the Date instances. - * - * @param {Date} start - * @param {Date} end - * @returns {number} Number of months between `start` and `end`. If `end` is before `start` - * chronologically, this number will be negative. - */ - function getMonthDistance(start, end) { - return (12 * (end.getFullYear() - start.getFullYear())) + (end.getMonth() - start.getMonth()); - } - - /** - * Gets the last day of the month for the given date. - * @param {Date} date - * @returns {Date} - */ - function getLastDateOfMonth(date) { - return new Date(date.getFullYear(), date.getMonth(), getNumberOfDaysInMonth(date)); - } - - /** - * Checks whether a date is valid. - * @param {Date} date - * @return {boolean} Whether the date is a valid Date. - */ - function isValidDate(date) { - return date && date.getTime && !isNaN(date.getTime()); - } - - /** - * Sets a date's time to midnight. - * @param {Date} date - */ - function setDateTimeToMidnight(date) { - if (isValidDate(date)) { - date.setHours(0, 0, 0, 0); - } - } - - /** - * Creates a date with the time set to midnight. - * Drop-in replacement for two forms of the Date constructor via opt_value. - * @param {number|Date=} opt_value Leave undefined for a Date representing now. Or use a - * single value representing the number of seconds since the Unix Epoch or a Date object. - * @return {Date} New date with time set to midnight. - */ - function createDateAtMidnight(opt_value) { - var date; - if (angular.isDate(opt_value)) { - date = opt_value; - } else if (angular.isNumber(opt_value)) { - date = new Date(opt_value); - } else { - date = new Date(); - } - setDateTimeToMidnight(date); - return date; - } - - /** - * Checks if a date is within a min and max range, ignoring the time component. - * If minDate or maxDate are not dates, they are ignored. - * @param {Date} date - * @param {Date} minDate - * @param {Date} maxDate - */ - function isDateWithinRange(date, minDate, maxDate) { - var dateAtMidnight = createDateAtMidnight(date); - var minDateAtMidnight = isValidDate(minDate) ? createDateAtMidnight(minDate) : null; - var maxDateAtMidnight = isValidDate(maxDate) ? createDateAtMidnight(maxDate) : null; - return (!minDateAtMidnight || minDateAtMidnight <= dateAtMidnight) && - (!maxDateAtMidnight || maxDateAtMidnight >= dateAtMidnight); - } - - /** - * Gets a new date incremented by the given number of years. Number of years can be negative. - * See `incrementMonths` for notes on overflow for specific dates. - * @param {Date} date - * @param {number} numberOfYears - * @returns {Date} - */ - function incrementYears(date, numberOfYears) { - return incrementMonths(date, numberOfYears * 12); - } - - /** - * Get the integer distance between two years. This *only* considers the year portion of the - * Date instances. - * - * @param {Date} start - * @param {Date} end - * @returns {number} Number of months between `start` and `end`. If `end` is before `start` - * chronologically, this number will be negative. - */ - function getYearDistance(start, end) { - return end.getFullYear() - start.getFullYear(); - } - - /** - * Clamps a date between a minimum and a maximum date. - * @param {Date} date Date to be clamped - * @param {Date=} minDate Minimum date - * @param {Date=} maxDate Maximum date - * @return {Date} - */ - function clampDate(date, minDate, maxDate) { - var boundDate = date; - if (minDate && date < minDate) { - boundDate = new Date(minDate.getTime()); - } - if (maxDate && date > maxDate) { - boundDate = new Date(maxDate.getTime()); - } - return boundDate; - } - - /** - * Extracts and parses the timestamp from a DOM node. - * @param {HTMLElement} node Node from which the timestamp will be extracted. - * @return {number} Time since epoch. - */ - function getTimestampFromNode(node) { - if (node && node.hasAttribute('data-timestamp')) { - return Number(node.getAttribute('data-timestamp')); - } - } - - /** - * Checks if a month is within a min and max range, ignoring the date and time components. - * If minDate or maxDate are not dates, they are ignored. - * @param {Date} date - * @param {Date} minDate - * @param {Date} maxDate - */ - function isMonthWithinRange(date, minDate, maxDate) { - var month = date.getMonth(); - var year = date.getFullYear(); - - return (!minDate || minDate.getFullYear() < year || minDate.getMonth() <= month) && - (!maxDate || maxDate.getFullYear() > year || maxDate.getMonth() >= month); - } - - /** - * @param {Date} value date in local timezone - * @return {Date} date with local timezone offset removed - */ - function removeLocalTzAndReparseDate(value) { - var dateValue, formattedDate; - // Remove the local timezone offset before calling formatDate. - dateValue = new Date(value.getTime() + 60000 * value.getTimezoneOffset()); - formattedDate = $mdDateLocale.formatDate(dateValue); - // parseDate only works with a date formatted by formatDate when using Moment validation. - return $mdDateLocale.parseDate(formattedDate); - } - }]); -})(); - -})(); -(function(){ -"use strict"; - -(function() { - 'use strict'; - - // TODO(jelbourn): forward more attributes to the internal input (required, autofocus, etc.) - // TODO(jelbourn): something better for mobile (calendar panel takes up entire screen?) - // TODO(jelbourn): input behavior (masking? auto-complete?) - - DatePickerCtrl.$inject = ["$scope", "$element", "$attrs", "$window", "$mdConstant", "$mdTheming", "$mdUtil", "$mdDateLocale", "$$mdDateUtil", "$$rAF", "$filter", "$timeout"]; - datePickerDirective.$inject = ["$$mdSvgRegistry", "$mdUtil", "$mdAria", "inputDirective"]; - angular.module('material.components.datepicker') - .directive('mdDatepicker', datePickerDirective); - - /** - * @ngdoc directive - * @name mdDatepicker - * @module material.components.datepicker - * - * @param {Date} ng-model The component's model. Expects either a JavaScript Date object or a - * value that can be parsed into one (e.g. a ISO 8601 string). - * @param {Object=} ng-model-options Allows tuning of the way in which `ng-model` is being - * updated. Also allows for a timezone to be specified. - * - * Read more at the ngModelOptions docs. - * @param {expression=} ng-change Expression evaluated when the model value changes. - * @param {expression=} ng-focus Expression evaluated when the input is focused or the calendar - * is opened. - * @param {expression=} ng-blur Expression evaluated when focus is removed from the input or the - * calendar is closed. - * @param {boolean=} ng-disabled Whether the datepicker is disabled. - * @param {boolean=} ng-required Whether a value is required for the datepicker. - * @param {Date=} md-min-date Expression representing a min date (inclusive). - * @param {Date=} md-max-date Expression representing a max date (inclusive). - * @param {(function(Date): boolean)=} md-date-filter Function expecting a date and returning a - * boolean whether it can be selected in "day" mode or not. Returning false will also trigger a - * `filtered` model validation error. - * @param {(function(Date): boolean)=} md-month-filter Function expecting a date and returning a - * boolean whether it can be selected in "month" mode or not. Returning false will also trigger a - * `filtered` model validation error. - * @param {string=} md-placeholder The date input placeholder value. - * @param {string=} md-open-on-focus When present, the calendar will be opened when the input - * is focused. - * @param {Boolean=} md-is-open Expression that can be used to open the datepicker's calendar - * on-demand. - * @param {string=} md-current-view Default open view of the calendar pane. Can be either - * "month" or "year". - * @param {string=} md-mode Restricts the user to only selecting a value from a particular view. - * This option can be used if the user is only supposed to choose from a certain date type - * (e.g. only selecting the month). - * Can be either "month" or "day". **Note** that this will overwrite the `md-current-view` value. - * @param {string=} md-hide-icons Determines which datepicker icons should be hidden. Note that - * this may cause the datepicker to not align properly with other components. - * **Use at your own risk.** Possible values are: - * * `"all"` - Hides all icons. - * * `"calendar"` - Only hides the calendar icon. - * * `"triangle"` - Only hides the triangle icon. - * @param {Object=} md-date-locale Allows for the values from the `$mdDateLocaleProvider` to be - * overwritten on a per-element basis (e.g. `msgOpenCalendar` can be overwritten with - * `md-date-locale="{ msgOpenCalendar: 'Open a special calendar' }"`). - * @param {string=} input-aria-describedby A space-separated list of element IDs. This should - * contain the IDs of any elements that describe this datepicker. Screen readers will read the - * content of these elements at the end of announcing that the datepicker has been selected - * and describing its current state. The descriptive elements do not need to be visible on the - * page. - * @param {string=} input-aria-labelledby A space-separated list of element IDs. The ideal use - * case is that this would contain the ID of a `